nrfxlib API 3.3.99
Loading...
Searching...
No Matches

RSA encryption/decryption and sign/verify algorithms, for 1024 and 2048 bit RSA keys. More...

Files

file  ocrypto_rsa.h
 RSA encryption/decryption and sign/verify algorithms, for 1024 and 2048 bit RSA keys.
 

1024-bit RSA Functions

This group of functions is used for 1024-bit RSA.

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)
 
int ocrypto_rsa1024_pkcs1_v15_decrypt (uint8_t *m, size_t m_len, const uint8_t c[128], const ocrypto_rsa1024_key *sk)
 
int ocrypto_rsa1024_pkcs1_v15_crt_decrypt (uint8_t *m, size_t m_len, const uint8_t c[128], const ocrypto_rsa1024_crt_key *sk)
 
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)
 
int ocrypto_rsa1024_oaep_sha256_decrypt (uint8_t *m, size_t m_len, const uint8_t c[128], const uint8_t *label, size_t l_len, const ocrypto_rsa1024_key *sk)
 
int ocrypto_rsa1024_oaep_sha256_crt_decrypt (uint8_t *m, size_t m_len, const uint8_t c[128], const uint8_t *label, size_t l_len, const ocrypto_rsa1024_crt_key *sk)
 
int ocrypto_rsa1024_pkcs1_v15_sha256_sign (uint8_t s[128], const uint8_t *m, size_t m_len, const ocrypto_rsa1024_key *sk)
 
int ocrypto_rsa1024_pkcs1_v15_sha256_crt_sign (uint8_t s[128], const uint8_t *m, size_t m_len, const ocrypto_rsa1024_crt_key *sk)
 
int ocrypto_rsa1024_pkcs1_v15_sha256_verify (const uint8_t s[128], const uint8_t *m, size_t m_len, const ocrypto_rsa1024_pub_key *pk)
 
int ocrypto_rsa1024_pss_sha256_sign (uint8_t s[128], const uint8_t *m, size_t m_len, const uint8_t *salt, size_t s_len, const ocrypto_rsa1024_key *sk)
 
int ocrypto_rsa1024_pss_sha256_crt_sign (uint8_t s[128], const uint8_t *m, size_t m_len, const uint8_t *salt, size_t s_len, const ocrypto_rsa1024_crt_key *sk)
 
int ocrypto_rsa1024_pss_sha256_verify (const uint8_t s[128], const uint8_t *m, size_t m_len, size_t s_len, const ocrypto_rsa1024_pub_key *pk)
 

2048-bit RSA Functions

This group of functions is used for 2048-bit RSA.

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)
 
int ocrypto_rsa2048_pkcs1_v15_decrypt (uint8_t *m, size_t mlen, const uint8_t c[256], const ocrypto_rsa2048_key *sk)
 
int ocrypto_rsa2048_pkcs1_v15_crt_decrypt (uint8_t *m, size_t mlen, const uint8_t c[256], const ocrypto_rsa2048_crt_key *sk)
 
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)
 
int ocrypto_rsa2048_oaep_sha256_decrypt (uint8_t *m, size_t mlen, const uint8_t c[256], const uint8_t *label, size_t llen, const ocrypto_rsa2048_key *sk)
 
int ocrypto_rsa2048_oaep_sha256_crt_decrypt (uint8_t *m, size_t mlen, const uint8_t c[256], const uint8_t *label, size_t llen, const ocrypto_rsa2048_crt_key *sk)
 
int ocrypto_rsa2048_pkcs1_v15_sha256_sign (uint8_t s[256], const uint8_t *m, size_t mlen, const ocrypto_rsa2048_key *sk)
 
int ocrypto_rsa2048_pkcs1_v15_sha256_crt_sign (uint8_t s[256], const uint8_t *m, size_t mlen, const ocrypto_rsa2048_crt_key *sk)
 
int ocrypto_rsa2048_pkcs1_v15_sha256_verify (const uint8_t s[256], const uint8_t *m, size_t mlen, const ocrypto_rsa2048_pub_key *pk)
 
int ocrypto_rsa2048_pss_sha256_sign (uint8_t s[256], const uint8_t *m, size_t mlen, const uint8_t *salt, size_t slen, const ocrypto_rsa2048_key *sk)
 
int ocrypto_rsa2048_pss_sha256_crt_sign (uint8_t s[256], const uint8_t *m, size_t mlen, const uint8_t *salt, size_t slen, const ocrypto_rsa2048_crt_key *sk)
 
int ocrypto_rsa2048_pss_sha256_verify (const uint8_t s[256], const uint8_t *m, size_t mlen, size_t slen, const ocrypto_rsa2048_pub_key *pk)
 

Detailed Description

RSA encryption/decryption and sign/verify algorithms, for 1024 and 2048 bit RSA keys.

These functions support RSA encryption and signatures with 1024 and 2048 bit modulo, PKCS1 V1.5, OAEP and PSS padding.

Remarks
1024 bit keys are no longer considered secure; use of at least 2048 bit keys is recommended.
This is the original ocrypto API for RSA. See the newer API that supports additional key sizes.
See also
RFC - PKCS #1: RSA Cryptography Specifications Version 2.2