Hi Nordic Team,
in our project we want to write/read cryptographic keys to/from the KMU.
One of the algorithms we are going to use is ECDSA.
My naive approach was to just modify the existing nrf/samples/crypto/ecdsa code.
Another ticket in the developer zone (see https://devzone.nordicsemi.com/f/nordic-q-a/118434/kmu-psa-persistent-key-generation) reveals, that there's a bug in SDK v2.9.0.
Therefore, I switched ncs to the main branch (commit a95e127c906afef92e36e79120d2ec127c250b87).
My prj.conf equals:
My modified generate_ecdsa_keypair() succeeds to generate a new keypair in the KMU resp. read an existing keypair from the KMU:
But my modified import_ecdsa_pub_key() function fails:
psa_import_key() returns PSA_ERROR_INVALID_ARGUMENT.
The error code comes from nrf/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/kmu.c:837ff
The buffer size for the ECDSA public key (i.e. m_ecdsa_pub_key) is 65 bytes.
Am I doing something wrong?
Best regards,
Christian