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

◆ ocrypto_rsa_pub_exp()

int ocrypto_rsa_pub_exp ( uint8_t *  c,
size_t  c_len,
const uint8_t *  m,
size_t  m_len,
const ocrypto_rsa_pub_key pk,
uint32_t *  mem 
)

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

RSA public key exponentiation. c = m^e mod n

Parameters
[out]cThe generated ciphertext.
c_lenLength of c.
mThe message to be encrypted.
m_lenLength of m.
pkA valid RSA public key.
memThe working memory. Length OCRYPTO_RSA_PUB_MEM_SIZE(bits).
Return values
-1If the input is too large (m >= n).
0On success.
Remarks
The key pk should be initialized with ocrypto_rsa_init_pub_key.
c, m, and mem may be same.