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

◆ ocrypto_rsa_pkcs1_v15_crt_decrypt()

int ocrypto_rsa_pkcs1_v15_crt_decrypt ( uint8_t *  m,
size_t  m_len,
const uint8_t *  c,
size_t  c_len,
const ocrypto_rsa_crt_key key,
uint32_t *  mem 
)

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

RSA PKCS1 V1.5 decryption with CRT acceleration.

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.
keyA valid RSA secret key with CRT coefficients.
memThe working memory. Length OCRYPTO_RSA_CRT_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_crt_key.
c, m, and mem may be same.