• Home
  • Raw
  • Download

Lines Matching refs:recp

13 void BN_RECP_CTX_init(BN_RECP_CTX *recp)  in BN_RECP_CTX_init()  argument
15 memset(recp, 0, sizeof(*recp)); in BN_RECP_CTX_init()
16 bn_init(&(recp->N)); in BN_RECP_CTX_init()
17 bn_init(&(recp->Nr)); in BN_RECP_CTX_init()
35 void BN_RECP_CTX_free(BN_RECP_CTX *recp) in BN_RECP_CTX_free() argument
37 if (recp == NULL) in BN_RECP_CTX_free()
39 BN_free(&recp->N); in BN_RECP_CTX_free()
40 BN_free(&recp->Nr); in BN_RECP_CTX_free()
41 if (recp->flags & BN_FLG_MALLOCED) in BN_RECP_CTX_free()
42 OPENSSL_free(recp); in BN_RECP_CTX_free()
45 int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *d, BN_CTX *ctx) in BN_RECP_CTX_set() argument
47 if (!BN_copy(&(recp->N), d)) in BN_RECP_CTX_set()
49 BN_zero(&(recp->Nr)); in BN_RECP_CTX_set()
50 recp->num_bits = BN_num_bits(d); in BN_RECP_CTX_set()
51 recp->shift = 0; in BN_RECP_CTX_set()
56 BN_RECP_CTX *recp, BN_CTX *ctx) in BN_mod_mul_reciprocal() argument
77 ret = BN_div_recp(NULL, r, ca, recp, ctx); in BN_mod_mul_reciprocal()
85 BN_RECP_CTX *recp, BN_CTX *ctx) in BN_div_recp() argument
98 if (BN_ucmp(m, &(recp->N)) < 0) { in BN_div_recp()
115 j = recp->num_bits << 1; in BN_div_recp()
120 if (i != recp->shift) in BN_div_recp()
121 recp->shift = BN_reciprocal(&(recp->Nr), &(recp->N), i, ctx); in BN_div_recp()
123 if (recp->shift == -1) in BN_div_recp()
132 if (!BN_rshift(a, m, recp->num_bits)) in BN_div_recp()
134 if (!BN_mul(b, a, &(recp->Nr), ctx)) in BN_div_recp()
136 if (!BN_rshift(d, b, i - recp->num_bits)) in BN_div_recp()
140 if (!BN_mul(b, &(recp->N), d, ctx)) in BN_div_recp()
147 while (BN_ucmp(r, &(recp->N)) >= 0) { in BN_div_recp()
152 if (!BN_usub(r, r, &(recp->N))) in BN_div_recp()
159 d->neg = m->neg ^ recp->N.neg; in BN_div_recp()