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

◆ ocrypto_rsa_oaep_sha256_decrypt()

int ocrypto_rsa_oaep_sha256_decrypt ( uint8_t * m,
size_t m_len,
const uint8_t * c,
size_t c_len,
const uint8_t * label,
size_t l_len,
const ocrypto_rsa_key * key,
uint32_t * mem )

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

RSA OAEP SHA256 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.
m_lenLength of m.
cThe ciphertext to decrypt.
c_lenLength of c.
labelThe label associated with the message.
l_lenLength of label. May be 0.
keyA valid RSA secret key.
memThe working memory. Length OCRYPTO_RSA_MEM_SIZE(bits).
Return values
-1If decryption failed.
-2If the output buffer is too short (m_len < length of message).
nIf a message of length n was successfully decrypted.
Remarks
The key key should be initialized with ocrypto_rsa_init_key.
c, m, and mem may be same.