nrfxlib API 2.8.99
Loading...
Searching...
No Matches

◆ ocrypto_rsa2048_pkcs1_v15_decrypt()

int ocrypto_rsa2048_pkcs1_v15_decrypt ( uint8_t * m,
size_t mlen,
const uint8_t c[256],
const ocrypto_rsa2048_key * sk )

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

2048-bit RSA PKCS1 V1.5 decryption.

The ciphertext c is decrypted to the message returned in m.

Parameters
[out]mThe decrypted message. The buffer must be long enough to hold the message.
mlenLength of m.
cThe 256-byte ciphertext to decrypt.
skA valid 2048-bit RSA secret key.
Return values
-1If decryption failed.
-2If the output buffer is too short (mlen < length of message).
nIf a message of length n was successfully decrypted.
Remarks
The key sk should be initialized with ocrypto_rsa2048_init_key.
m may be same as c.