![]() |
nrfxlib API 3.3.99
|
| int ocrypto_rsa2048_oaep_sha256_encrypt | ( | uint8_t | c[256], |
| const uint8_t * | m, | ||
| size_t | mlen, | ||
| const uint8_t * | label, | ||
| size_t | llen, | ||
| const uint8_t | seed[32], | ||
| const ocrypto_rsa2048_pub_key * | pk ) |
#include <crypto/nrf_oberon/include/ocrypto_rsa.h>
2048-bit RSA OAEP SHA256 encryption.
The message m is encrypted to a ciphertext returned in c.
| [out] | c | The generated 256-byte ciphertext. |
| m | The message to be encrypted. | |
| mlen | Length of m. 0 <= mlen <= 190. | |
| label | The label associated with the message. | |
| llen | Length of label. May be 0. | |
| seed | 32-byte random seed. | |
| pk | A valid 2048-bit RSA public key. |
| -1 | If the message is too long (mlen > 190). |
| 0 | On success. |
pk should be initialized with ocrypto_rsa2048_init_pub_key. c may be same as m.