nrfxlib API 0.1.0
Loading...
Searching...
No Matches

APIs to for RSA encryption/decryption and sign/verify using PKCS1 v1.5, OEAP and PSS. More...

Data Structures

struct  ocrypto_rsa_pub_key
 
struct  ocrypto_rsa_key
 
struct  ocrypto_rsa_crt_key
 

Macros

#define OCRYPTO_RSA_PUB_KEY_SIZE(bits)   ((bits)/32)
 
#define OCRYPTO_RSA_KEY_SIZE(bits)   ((bits)/32*2)
 
#define OCRYPTO_RSA_CRT_KEY_SIZE(bits)   ((bits)/32*7/2)
 
#define OCRYPTO_RSA_PUB_MEM_SIZE(bits)   ((bits)/32*11)
 
#define OCRYPTO_RSA_MEM_SIZE(bits)   ((bits)/32*26)
 
#define OCRYPTO_RSA_CRT_MEM_SIZE(bits)   ((bits)/32*14)
 

variable-bit RSA key setup.

This group of functions is used for generic RSA key setup.

int ocrypto_rsa_init_pub_key (ocrypto_rsa_pub_key *key, uint32_t *key_mem, const uint8_t *n, size_t n_len, uint32_t e)
 
int ocrypto_rsa_init_key (ocrypto_rsa_key *key, uint32_t *key_mem, const uint8_t *n, size_t n_len, const uint8_t *d, size_t d_len)
 
int ocrypto_rsa_init_crt_key (ocrypto_rsa_crt_key *key, uint32_t *key_mem, const uint8_t *p, size_t p_len, const uint8_t *q, size_t q_len, const uint8_t *dp, size_t dp_len, const uint8_t *dq, size_t dq_len, const uint8_t *qinv, size_t qi_len)
 

RSA primitives.

This group of functions is used for basic RSA arithmetic.

int ocrypto_rsa_pub_exp (uint8_t *c, size_t c_len, const uint8_t *m, size_t m_len, const ocrypto_rsa_pub_key *pk, uint32_t *mem)
 
int ocrypto_rsa_exp (uint8_t *m, size_t m_len, const uint8_t *c, size_t c_len, const ocrypto_rsa_key *key, uint32_t *mem)
 
int ocrypto_rsa_crt_exp (uint8_t *m, size_t m_len, const uint8_t *c, size_t c_len, const ocrypto_rsa_crt_key *key, uint32_t *mem)
 

Detailed Description

APIs to for RSA encryption/decryption and sign/verify using PKCS1 v1.5, OEAP and PSS.

These functions support RSA key setup and primitives.

Supported key sizes (in bits) are: size >= 1024, size = 2^n or 3 * 2^n. This includes the popular sizes: 1024, 2048, 3072, and 4096 bits.