X-CUBE-CRYPTOLIB: ECDSA invalid public key format
Hi,
I'm using STM32CubeExpansion_Crypto_V4.0.1 library for verifying a signed firmware file on STM32F7 controller. The key-pair has been generated using openssl command-line. The firmware has been signed using the private key (PEM). The signature has been stripped off the container headers and 64-byte sign generated. The public key has been converted to binary format (C array of 64 bytes) and embedded in the bootloader. However, the call to cmox_ecdsa_verify() fails with code 'CMOX_ECC_ERR_INVALID_PUBKEY (0x00060008) /*!< Invalid Public Key value */'.
Sequence of function calls, with few params:
cmox_ecc_construct(..., CMOX_ECC256_MATH_FUNCS, staticBuff[2048],... )
cmox_ecdsa_verify(..., CMOX_ECC_CURVE_SECP256K1, pubKeyBin[64],...)
cmox_ecc_cleanup()
The signature verification works fine on openssl command-line, with a dummy file. Would appreciate any pointers on this issue. Thank you.
