3.1.2.10. ECDSA signing for K3 devices
The SDK signs boot images with an RSA key by default. ECDSA (Elliptic Curve Digital Signature Algorithm) is an alternate asymmetric cryptographic algorithm which provides same level of security as RSA with drastically smaller keys. This page only lists what changes to use an ECDSA key instead on K3 devices such as the AM62x SoC. For the full signing procedure, follow the original guides linked in each section.
Any ECDSA curve supported by OpenSSL can be used (for example secp256r1, secp384r1, secp521r1). P-384 (secp384r1) is recommended. The FIT signature algorithm is sha512,ecdsa regardless of the curve.
3.1.2.10.1. Generate ECDSA keys
Generate the key and certificate with the same names the RSA setup already uses, so nothing else needs renaming:
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:secp384r1 -out custMpk.key
openssl req -new -x509 -key custMpk.key -out custMpk.crt -days 3650 -subj "/CN=Custom ECDSA Key"
Use openssl ecparam -list_curves to see the other curves available.
3.1.2.10.2. Sign boot images
For tiboot3.bin, tispl.bin and u-boot.img, binman picks the key from arch/arm/mach-k3/keys/. Replace the existing RSA files with your ECDSA ones:
cp custMpk.key arch/arm/mach-k3/keys/custMpk.pem
cp custMpk.crt arch/arm/mach-k3/keys/custMpk.crt
No devicetree or config changes are needed. Build as described in SDK Build using Makefile.
3.1.2.10.3. Sign kernel fitImage
Follow the U-Boot K3 FIT signature signing guide, with these differences:
Change the algorithm in the
signature-1node of yourfitImage.its. Keepkey-name-hint = "custMpk":signature-1 { algo = "sha512,ecdsa"; key-name-hint = "custMpk"; sign-images = "kernel", "fdt"; };
Put your ECDSA
custMpk.keyandcustMpk.crtin the keys directory you pass tomkimage -k.Rebuild U-Boot after generating the fitImage, so the updated
dt.dtbwith the public key is packed into u-boot.img.
Check the result with mkimage -l fitImage; the signature section should show sha512,ecdsa.
3.1.2.10.4. See also
Secure Boot - complete secure boot documentation
SDK Build using Makefile - top-level build instructions