nrfxlib API 0.1.0
Loading...
Searching...
No Matches

◆ ocrypto_ecdsa_p256_sign()

int ocrypto_ecdsa_p256_sign ( uint8_t  sig[64],
const uint8_t *  m,
size_t  mlen,
const uint8_t  sk[32],
const uint8_t  ek[32] 
)

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

ECDSA P-256 signature generation.

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

Parameters
[out]sigGenerated signature.
mInput message.
mlenLength of m.
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_p256_sign(sig, m, mlen, sk, ek));
int ocrypto_ecdsa_p256_sign(uint8_t sig[64], const uint8_t *m, size_t mlen, const uint8_t sk[32], const uint8_t ek[32])