STM32 Crypto library, performing signing on a message file data not match with openssl data
I am working on STM32 crypto library and using STM32L433RC controller,
I am facing the issue of signature mismatching.
i have followed below steps
Step -1 Key generation using openssl tool for ECC256 curve
openssl ecparam -name prime256v1 -genkey -noout -out private-key.pem
openssl ec -in private-key.pem -pubout -out public-key.pem
read EC key
writing EC key
openssl ec -in private-key.pem -text -noout
read EC key
Private-Key: (256 bit)
priv:
cd:3d:64:7d:dd:33:d1:d3:db:91:f5:99:be:0e:b8:
6b:16:8e:b2:20:b7:1d:c8:16:db:81:d0:57:07:4e:
04:58
pub:
04:5a:bc:6d:ab:e3:38:64:25:86:79:2a:17:d8:8d:
09:ce:43:36:f6:a1:ba:2d:db:25:d6:6d:42:f6:7e:
a0:ea:3f:ba:85:fd:a4:10:08:15:ee:06:0e:d9:e4:
e7:44:50:82:4a:87:ea:46:74:8d:3e:33:a3:55:53:
6f:32:60:80:81
ASN1 OID: prime256v1
NIST CURVE: P-256
Step -2
Hash computation, sign and verify message file using openssl tool
Result is verify ok
Step -3
Importing private and public keys in STM32 project - Okay
Step -4 computation of hash and signing using library functions
cmox_hash_compute(CMOX_SHA256_ALGO,
Message, sizeof(Message),
Computed_Hash,
`` CMOX_SHA256_SIZE,
&computed_size);
cmox_ecdsa_sign(&Ecc_Ctx,
CMOX_ECC_CURVE_SECP256R1,
Known_Random, sizeof(Known_Random),
Private_Key, sizeof(Private_Key),
Computed_Hash, CMOX_SHA256_SIZE,
Computed_Signature, &computed_size);
The generated signature is differ from the signature generated using openssl.
how i can see content of generated signature in openssl
I am using the command of openssl "asn1parse -inform=der -in signature.txt" to see signatures in hex.
I am unable to understand why both data are not matching.
