nrfxlib API 0.1.0
|
int ocrypto_rsa1024_pkcs1_v15_encrypt | ( | uint8_t | c[128], |
const uint8_t * | m, | ||
size_t | m_len, | ||
const uint8_t * | seed, | ||
size_t | s_len, | ||
const ocrypto_rsa1024_pub_key * | pk | ||
) |
#include <crypto/nrf_oberon/include/ocrypto_rsa.h>
1024 bit RSA PKCS1 V1.5 encryption.
The message m
is encrypted to a ciphertext returned in c
.
[out] | c | The generated 128-byte ciphertext. |
m | The message to be encrypted. | |
m_len | Length of m . 0 <= m_len <= 117. | |
seed | The random seed to be used for the padding. | |
s_len | Length of seed . s_len >= 125 - m_len | |
pk | A valid 1024-bit RSA public key. |
-1 | If the message is too long (m_len > 117). |
-2 | If the seed is too short (s_len < 125 - m_len). |
0 | On success. |
pk
should be initialized with ocrypto_rsa1024_init_pub_key
. seed
should consist of non-zero random bytes. c
may be same as m
.