Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

CC310 ECDSA Signature Size

Hello,

We are using the nRF52840 which has a CC310.

My question is about signature sizes when performing ECDSA signing/verification using the functions CRYS_ECDSA_Sign and CRYS_ECDSA_Verify that are provided in the ARM header file crys_ecpki_ecdsa.h.

If I call CRYS_ECDSA_Sign and pass it a hashMode of CRYS_ECPKI_HASH_SHA512_mode and pSignatureOutSize of 64, it returns fine.

If I call If I call CRYS_ECDSA_Sign and pass it a hashMode of CRYS_ECPKI_HASH_SHA256_mode and pSignatureOutSize of 32, it returns an error:

/*! Illegal signature size. */
#define CRYS_ECDSA_SIGN_INVALID_SIGNATURE_OUT_SIZE_ERROR (CRYS_ECPKI_MODULE_ERROR_BASE + 0x62UL)

So I'm wondering: shouldn't the size of the SHA256 signature be 32 bytes? So why does this return an error?

Also, noticed that the SHA512 actually returns an output of 72 bytes which made me wonder what format is used for the signatures?

Thanks!

Parents Reply Children
No Data
Related