MPI
static int dh_is_pubkey_valid(struct dh_ctx *ctx, MPI y)
MPI val, q;
MPI p; /* Value is guaranteed to be set. */
MPI base, val = mpi_alloc(0);
MPI g; /* Value is guaranteed to be set. */
MPI xa; /* Value is guaranteed to be set. */
MPI pone;
static int _compute_val(const struct dh_ctx *ctx, MPI base, MPI val)
MPI m, c = mpi_alloc(0);
MPI c, m = mpi_alloc(0);
MPI n;
MPI e;
MPI d;
MPI p;
MPI q;
MPI dp;
MPI dq;
static int rsa_check_exponent_fips(MPI e)
MPI e_max = NULL;
MPI qinv;
static int rsa_check_payload(MPI x, MPI n)
MPI n1;
static int _rsa_enc(const struct rsa_mpi_key *key, MPI c, MPI m)
static int _rsa_dec_crt(const struct rsa_mpi_key *key, MPI m_or_m1_or_h, MPI c)
MPI m2, m12_or_qh;
MPI n;
static inline unsigned int mpi_get_size(MPI a)
MPI mpi_alloc(unsigned nlimbs);
void mpi_free(MPI a);
int mpi_resize(MPI a, unsigned nlimbs);
MPI mpi_copy(MPI a);
MPI mpi_read_raw_data(const void *xbuffer, size_t nbytes);
MPI mpi_read_from_buffer(const void *buffer, unsigned *ret_nread);
MPI mpi_read_raw_from_sgl(struct scatterlist *sgl, unsigned int len);
void *mpi_get_buffer(MPI a, unsigned *nbytes, int *sign);
int mpi_read_buffer(MPI a, uint8_t *buf, unsigned buf_len, unsigned *nbytes,
int mpi_write_to_sgl(MPI a, struct scatterlist *sg, unsigned nbytes,
int mpi_mod(MPI rem, MPI dividend, MPI divisor);
int mpi_powm(MPI res, MPI base, MPI exp, MPI mod);
int mpi_cmp_ui(MPI u, ulong v);
int mpi_cmp(MPI u, MPI v);
int mpi_sub_ui(MPI w, MPI u, unsigned long vval);
void mpi_normalize(MPI a);
unsigned mpi_get_nbits(MPI a);
int mpi_test_bit(MPI a, unsigned int n);
int mpi_set_bit(MPI a, unsigned int n);
int mpi_rshift(MPI x, MPI a, unsigned int n);
int mpi_add(MPI w, MPI u, MPI v);
int mpi_sub(MPI w, MPI u, MPI v);
int mpi_addm(MPI w, MPI u, MPI v, MPI m);
int mpi_subm(MPI w, MPI u, MPI v, MPI m);
int mpi_mul(MPI w, MPI u, MPI v);
int mpi_mulm(MPI w, MPI u, MPI v, MPI m);
int mpi_tdiv_r(MPI rem, MPI num, MPI den);
int mpi_fdiv_r(MPI rem, MPI dividend, MPI divisor);
int mpi_addm(MPI w, MPI u, MPI v, MPI m)
int mpi_subm(MPI w, MPI u, MPI v, MPI m)
int mpi_add(MPI w, MPI u, MPI v)
int mpi_sub(MPI w, MPI u, MPI v)
MPI vv;
int mpi_rshift(MPI x, MPI a, unsigned int n)
void mpi_normalize(MPI a)
unsigned mpi_get_nbits(MPI a)
int mpi_test_bit(MPI a, unsigned int n)
int mpi_set_bit(MPI a, unsigned int n)
int mpi_cmp_ui(MPI u, unsigned long v)
int mpi_cmp(MPI u, MPI v)
int mpi_tdiv_qr(MPI quot, MPI rem, MPI num, MPI den);
int mpi_fdiv_r(MPI rem, MPI dividend, MPI divisor)
MPI temp_divisor = NULL;
int mpi_tdiv_r(MPI rem, MPI num, MPI den)
int mpi_tdiv_qr(MPI quot, MPI rem, MPI num, MPI den)
void mpi_assign_limb_space(MPI a, mpi_ptr_t ap, unsigned nlimbs);
static inline int RESIZE_IF_NEEDED(MPI a, unsigned b)
int mpi_mod(MPI rem, MPI dividend, MPI divisor)
int mpi_mulm(MPI w, MPI u, MPI v, MPI m)
int mpi_mul(MPI w, MPI u, MPI v)
int mpi_powm(MPI res, MPI base, MPI exp, MPI mod)
int mpi_sub_ui(MPI w, MPI u, unsigned long vval)
static int count_lzeros(MPI a)
int mpi_read_buffer(MPI a, uint8_t *buf, unsigned buf_len, unsigned *nbytes,
void *mpi_get_buffer(MPI a, unsigned *nbytes, int *sign)
int mpi_write_to_sgl(MPI a, struct scatterlist *sgl, unsigned nbytes,
MPI mpi_read_raw_from_sgl(struct scatterlist *sgl, unsigned int nbytes)
MPI val = NULL;
MPI mpi_read_raw_data(const void *xbuffer, size_t nbytes)
MPI val = NULL;
MPI mpi_read_from_buffer(const void *xbuffer, unsigned *ret_nread)
MPI val;
void mpi_free(MPI a)
MPI mpi_copy(MPI a)
MPI b;
MPI mpi_alloc(unsigned nlimbs)
MPI a;
void mpi_assign_limb_space(MPI a, mpi_ptr_t ap, unsigned nlimbs)
int mpi_resize(MPI a, unsigned nlimbs)
MPI in = NULL, res = NULL, pkey[2];