Xilinx / bootgen

bootgen source code
Other
34 stars 42 forks source link

FPGA authentication, Zynqmp #15

Closed ldts closed 3 years ago

ldts commented 3 years ago

Hi

I am trying to use the same key used for signing boot.bin to sign the fpga bistream. For Zynqmp this key is 4096bits.

However when I execute the following bif:

jramirez@trex lmp-tools (master *+%)$ cat bifs/fpga.bif 
the_ROM_image:
{
        [sskfile] keys/SSK.pem
        [authentication=rsa] fpga.bit
}

and try to sign the bitstream:

./bootgenl -arch fpga -image bifs/fpga.bif -o fpga-signed.bin -w on -log error

I get the following error:

****** Xilinx Bootgen v2021.1
  **** Build date : Jul 20 2021-15:27:34
    ** Copyright 1986-2021 Xilinx, Inc. All Rights Reserved.

[ERROR]  : Incorrect Key Size !!!
           Key Size is 4096 bits. Expected key size is 2048 bits

Should I be signing differently?

RamyaDarapuneni commented 3 years ago

Hi @ldts We ideally don't support FPGA from here. Please use bootgen from Xilinx Releases. It is a miss to remove -arch fpga from here. I will check and make it in the coming releases.

ldts commented 3 years ago

@RamyaDarapuneni thanks for the quick reply

um, executing from petalinux I get the same error:

vivado@trex:~/deploy,base/lmp-tools$ which bootgen
/opt/Xilinx/petalinux/tools/xsct/bin//bootgen
vivado@trex:~/deploy,base/lmp-tools$ bootgen -arch fpga -image bifs/fpga.bif -o fpga-signed.bin -w on -log error

****** Xilinx Bootgen v2019.2
  **** Build date : Oct 23 2019-22:59:42
    ** Copyright 1986-2019 Xilinx, Inc. All Rights Reserved.

[ERROR]  : ERROR: [Bitstream 40-288] UltraScale FPGAs only support RSA-2048 authentication.  Incorrect RSA key size of 4096 specified in keys/SSK.pem.
sadanandmutyala commented 3 years ago

@ldts, plnx builds bootgen using same code from this github repo. @RamyaDarapuneni meant using Bootgen from Vitis. We also have standalone Bootgen installer with smaller footprint FPGA code is proprietary and cannot be released on github. This is mentioned in the overview section. Sorry for any confusion

ldts commented 3 years ago

@sadanandmutyala

the_ROM_image:                                                                                                               
{                                                                                                                            
        [pskfile] keys/PSK.pem                                                                                               
        [sskfile] keys/SSK.pem                                                                                               
        [destination_device=pl, authentication=rsa] fpga.bit                                                                 
}    

./bootgen -arch zynqmp -image bifs/fpga.bif -o fpga.bit.bin -w on -log error

This worked for me (using this bootgen)

ldts commented 3 years ago

so we are good.

RamyaDarapuneni commented 3 years ago

Thanks @idts, closing this now. I thought you were checking for FPGA specifically.