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

◆ ocrypto_rsa1024_oaep_sha256_encrypt()

int ocrypto_rsa1024_oaep_sha256_encrypt ( uint8_t c[128],
const uint8_t * m,
size_t m_len,
const uint8_t * label,
size_t l_len,
const uint8_t seed[32],
const ocrypto_rsa1024_pub_key * pk )

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

1024-bit RSA OAEP SHA256 encryption.

The message m is encrypted to a ciphertext returned in c.

Parameters
[out]cThe generated 128-byte ciphertext.
mThe message to be encrypted.
m_lenLength of m. 0 <= m_len <= 62.
labelThe label associated with the message.
l_lenLength of label. May be 0.
seed32-byte random seed.
pkA valid 1024-bit RSA public key.
Return values
-1If the message is too long (m_len > 62).
0On success.
Remarks
The key pk should be initialized with ocrypto_rsa1024_init_pub_key.
c may be same as m.