I am trying to generate an ECDSA signature using ARM's CryptoCell 310 (hardware cryptography module) and verify the signature using mbedTLS software library.
The harware module documentation says that the ECDSA is performed according to ANS X9.62 standard.
The cryptocell generated signature for SECP256R1 is 64 bytes long and looks like this:
95D9AFCC53A8618FF99AA7AB86013F59148B112BDFB15A7775BDE04B1001A84AB77A0F1C82327BA3B420AA172DB288CA030028CAF7C43637EF3B9990B21D082C
I need to convert it into DER encoded signature so that mbedTLS can verify it, but I don't know how the R and S parameters are encoded in it. I have tried to take first half of that string as the R parameter, second half as S and encode it to DER like this:
304602210095D9AFCC53A8618FF99AA7AB86013F59148B112BDFB15A7775BDE04B1001A84A022100B77A0F1C82327BA3B420AA172DB288CA030028CAF7C43637EF3B9990B21D082C
Unfortunately it didn't work. I have also tried to do big/little endian swaps, trying the second half as R and first as S, but it still didn't work.
I have tried to obtain the X9.62 standard, but couldn't find anything about the encoding.
Does anyone know what encoding is that?
Thanks in advance.