ECDSA signing functionality for the bootloader.
|
int32_t
|
btl_verifyEcdsaP256r1
(const uint8_t *sha256, const uint8_t *signatureR, const uint8_t *signatureS, const uint8_t *keyX, const uint8_t *keyY)
|
|
int32_t btl_verifyEcdsaP256r1
|
(
|
const uint8_t *
|
sha256,
|
|
|
const uint8_t *
|
signatureR,
|
|
|
const uint8_t *
|
signatureS,
|
|
|
const uint8_t *
|
keyX,
|
|
|
const uint8_t *
|
keyY
|
|
)
|
|
|
Verify an ECDSA signature of a SHA256-hash using secp256r1.
Verifies the authenticity of data by checking the ECDSA signature of the data's SHA256-hash. This function is only for use with the secp256r1 curve. The public key which the signature is validated against will be retrieved from the respective tokens in the lockbits-page.
-
Parameters
-
sha256
|
The hash of the data which is authenticated
|
signatureR
|
Byte array (MSB first) of R-point of the ECDSA signature
|
signatureS
|
Byte array (MSB first) of S-point of the ECDSA signature
|
keyX
|
Pointer to the X coordinate of the ECDSA public key
|
keyY
|
Pointer to the Y coordinate of the ECDSA public key
|
-
Returns
-
BOOTLOADER_OK
if signature is valid, else error code in
BOOTLOADER_ERROR_SECURITY_BASE
range.