Help Implementing ECDSA using PSA crypto API of mbedTLS

Hello,

I am developing FW for a BLE Peripheral on NRF52840_DK using nRF Connect SDK v1.9.1 on VScode.

So far, Peripheral and Client are able to connect and exchange data.

When Client is sending data: with a digital signature (raw 65 bytes) and its public key (raw, 65 bytes), In the Peripheral Code,

I need help in implementing digital signature using PSA library using psa_verify_message() function.

So far, i have used these functions successfully : 

psa_crypto_init()

psa_generate_random()

psa_hash_compute()
I have the raw 65 byte public key in BE format (04 zz yy xx .. .. .. aa), needed for verification
but dont understand how shall i use it as the first argument of psa_verify_message().
I am using standard curve NIST Sec P256R1
status = psa_verify_message(psa_key_id_t key, PSA_ALG_ECDSA(PSA_ALG_SHA_256), msg, sizeof(msg), signature, sizeof(signature));
Please explain me the steps needed to use this function
Thanks.
Parents Reply Children
No Data
Related