nrfxlib API 2.7.99
Loading...
Searching...
No Matches

◆ ocrypto_ecdsa_p521_sign_hash()

int ocrypto_ecdsa_p521_sign_hash ( uint8_t  sig[132],
const uint8_t  hash[64],
const uint8_t  sk[66],
const uint8_t  ek[66] 
)

#include <crypto/nrf_oberon/include/ocrypto_ecdsa_p521.h>

ECDSA P-521 signature generation from SHA512 hash.

The message hash hash is signed using the secret key sk and the ephemeral session key ek. The signature is put into sig.

Parameters
[out]sigGenerated signature.
hashInput hash.
skSecret key.
ekSession key. Must be pre-filled with random data.
Return values
0If ek is a valid session key.
-1Otherwise.
Remarks
To generate a valid signature use the following code pattern:
do get_random(ek); while (ocrypto_ecdsa_p521_sign_hash(sig, hash, sk, ek));
int ocrypto_ecdsa_p521_sign_hash(uint8_t sig[132], const uint8_t hash[64], const uint8_t sk[66], const uint8_t ek[66])