27#ifndef OCRYPTO_RSA_PRIMITIVES_H
28#define OCRYPTO_RSA_PRIMITIVES_H
42#define OCRYPTO_RSA_PUB_KEY_SIZE(bits) ((bits)/32)
47#define OCRYPTO_RSA_KEY_SIZE(bits) ((bits)/32*2)
52#define OCRYPTO_RSA_CRT_KEY_SIZE(bits) ((bits)/32*7/2)
58#define OCRYPTO_RSA_PUB_MEM_SIZE(bits) ((bits)/32*11)
63#define OCRYPTO_RSA_MEM_SIZE(bits) ((bits)/32*26)
68#define OCRYPTO_RSA_CRT_MEM_SIZE(bits) ((bits)/32*14)
134 const uint8_t *n,
size_t n_len,
157 const uint8_t *n,
size_t n_len,
158 const uint8_t *d,
size_t d_len);
186 const uint8_t *p,
size_t p_len,
187 const uint8_t *q,
size_t q_len,
188 const uint8_t *dp,
size_t dp_len,
189 const uint8_t *dq,
size_t dq_len,
190 const uint8_t *qinv,
size_t qi_len);
217 uint8_t *c,
size_t c_len,
218 const uint8_t *m,
size_t m_len,
240 uint8_t *m,
size_t m_len,
241 const uint8_t *c,
size_t c_len,
263 uint8_t *m,
size_t m_len,
264 const uint8_t *c,
size_t c_len,
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_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)
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_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)
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)
Definition ocrypto_rsa_primitives.h:97
Definition ocrypto_rsa_primitives.h:86
Definition ocrypto_rsa_primitives.h:75