Where is there example code for getting a public key from a private key in ECC Cube cryptographic library?
Hi,
We are migrating our code from using the legacy crypto lib to the libSTM32Cryptographic_CM4.a.
- I can not find api document describing the functions etc, is there any thing like there was for the legacy lib (like https://www.st.com/resource/en/user_manual/dm00215061-stm32-crypto-library-stmicroelectronics.pdf)?
2.I am trying to write code that gets the public key from a given private key.
I had it working with the legacy code using the
retval = ECCscalarMul(G, ephermPrivKey, ephermPubKey, &ECparams, &mb);
but now I can not get it to work.
This is my code:
retval = cmox_ecdh(&Ecc_Ctx,
CMOX_ECC_CURVE_SECP256R1,
ephemPrivateKeyMsg.p_buf,
ephemPrivateKeyMsg.length,
ecc_256_FullG,
sizeof(ecc_256_FullG),
fullEphermPubKey,
&fullEphemPubLength);
where ecc_256_FullG is the x and y values of G, first x coordinate, then Y coordinate (that were correct in the legacy code), see below
Any ideas? example code for this?
Thanks!
const uint8_t ecc_256_FullG[]={0x6B, 0x17, 0xD1, 0xF2, 0xE1, 0x2C, 0x42, 0x47, 0xF8, 0xBC, 0xE6, 0xE5, 0x63, 0xA4, 0x40, 0xF2, 0x77, 0x03, 0x7D, 0x81, 0x2D, 0xEB, 0x33, 0xA0, 0xF4, 0xA1, 0x39, 0x45, 0xD8, 0x98, 0xC2, 0x96,
