nrfxlib API 0.1.0
|
int ocrypto_rsa2048_pkcs1_v15_encrypt | ( | uint8_t | c[256], |
const uint8_t * | m, | ||
size_t | mlen, | ||
const uint8_t * | seed, | ||
size_t | slen, | ||
const ocrypto_rsa2048_pub_key * | pk | ||
) |
#include <crypto/nrf_oberon/include/ocrypto_rsa.h>
2048-bit RSA PKCS1 V1.5 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 <= 245. | |
seed | The random seed to be used for the padding. | |
slen | Length of seed . slen >= 253 - mlen . | |
pk | A valid 2048-bit RSA public key. |
-1 | If the message is too long (mlen > 245). |
-2 | If the seed is too short (slen < 253 - mlen). |
0 | On success. |
pk
should be initialized with ocrypto_rsa2048_init_pub_key
. seed
should consist of non-zero random bytes. c
may be same as m
.