• Home
  • Raw
  • Download

Lines Matching refs:mont

588                     const BIGNUM *m, BN_CTX *ctx, const BN_MONT_CTX *mont) {  in BN_mod_exp_mont()  argument
624 if (mont == NULL) { in BN_mod_exp_mont()
629 mont = new_mont; in BN_mod_exp_mont()
637 if (!BN_to_montgomery(val[0], a, mont, ctx)) { in BN_mod_exp_mont()
643 !BN_mod_mul_montgomery(d, val[0], val[0], mont, ctx)) { in BN_mod_exp_mont()
649 !BN_mod_mul_montgomery(val[i], val[i - 1], d, mont, ctx)) { in BN_mod_exp_mont()
661 if (!r_is_one && !BN_mod_mul_montgomery(r, r, r, mont, ctx)) { in BN_mod_exp_mont()
685 if (!BN_mod_mul_montgomery(r, r, r, mont, ctx)) { in BN_mod_exp_mont()
697 } else if (!BN_mod_mul_montgomery(r, r, val[wvalue >> 1], mont, ctx)) { in BN_mod_exp_mont()
711 if (!BN_from_montgomery(rr, r, mont, ctx)) { in BN_mod_exp_mont()
724 const BN_MONT_CTX *mont) { in bn_mod_exp_mont_small() argument
725 if (num != (size_t)mont->N.width || num > BN_SMALL_MAX_WORDS) { in bn_mod_exp_mont_small()
728 assert(BN_is_odd(&mont->N)); in bn_mod_exp_mont_small()
735 bn_from_montgomery_small(r, mont->RR.d, num, mont); in bn_mod_exp_mont_small()
753 bn_mod_mul_montgomery_small(d, val[0], val[0], num, mont); in bn_mod_exp_mont_small()
755 bn_mod_mul_montgomery_small(val[i], val[i - 1], d, num, mont); in bn_mod_exp_mont_small()
766 bn_mod_mul_montgomery_small(r, r, r, num, mont); in bn_mod_exp_mont_small()
789 bn_mod_mul_montgomery_small(r, r, r, num, mont); in bn_mod_exp_mont_small()
798 bn_mod_mul_montgomery_small(r, r, val[wvalue >> 1], num, mont); in bn_mod_exp_mont_small()
813 const BN_MONT_CTX *mont) { in bn_mod_inverse_prime_mont_small() argument
814 if (num != (size_t)mont->N.width || num > BN_SMALL_MAX_WORDS) { in bn_mod_inverse_prime_mont_small()
820 const BN_ULONG *p = mont->N.d; in bn_mod_inverse_prime_mont_small()
833 bn_mod_exp_mont_small(r, a, num, p_minus_two, num, mont); in bn_mod_inverse_prime_mont_small()
903 const BN_MONT_CTX *mont) { in BN_mod_exp_mont_consttime() argument
940 if (mont == NULL) { in BN_mod_exp_mont_consttime()
945 mont = new_mont; in BN_mod_exp_mont_consttime()
950 int top = mont->N.width; in BN_mod_exp_mont_consttime()
969 RSAZ_1024_mod_exp_avx2(rr->d, a->d, p->d, m->d, mont->RR.d, mont->n0[0], in BN_mod_exp_mont_consttime()
984 powerbufLen += top * sizeof(mont->N.d[0]); in BN_mod_exp_mont_consttime()
1020 if (!bn_one_to_montgomery(&tmp, mont, ctx)) { in BN_mod_exp_mont_consttime()
1027 if (!BN_to_montgomery(&am, a, mont, ctx)) { in BN_mod_exp_mont_consttime()
1039 const BN_ULONG *n0 = mont->n0; in BN_mod_exp_mont_consttime()
1053 np[i] = mont->N.d[i]; in BN_mod_exp_mont_consttime()
1161 if (!BN_mod_mul_montgomery(&tmp, &am, &am, mont, ctx)) { in BN_mod_exp_mont_consttime()
1169 if (!BN_mod_mul_montgomery(&tmp, &am, &tmp, mont, ctx)) { in BN_mod_exp_mont_consttime()
1192 if (!BN_mod_mul_montgomery(&tmp, &tmp, &tmp, mont, ctx)) { in BN_mod_exp_mont_consttime()
1204 if (!BN_mod_mul_montgomery(&tmp, &tmp, &am, mont, ctx)) { in BN_mod_exp_mont_consttime()
1211 if (!BN_from_montgomery(rr, &tmp, mont, ctx)) { in BN_mod_exp_mont_consttime()
1227 const BN_MONT_CTX *mont) { in BN_mod_exp_mont_word() argument
1243 ret = BN_mod_exp_mont(rr, &a_bignum, p, m, ctx, mont); in BN_mod_exp_mont_word()
1255 BN_CTX *ctx, const BN_MONT_CTX *mont) { in BN_mod_exp2_mont() argument
1263 if (mont == NULL) { in BN_mod_exp2_mont()
1268 mont = new_mont; in BN_mod_exp2_mont()
1274 if (!BN_mod_exp_mont(rr, a1, p1, m, ctx, mont) || in BN_mod_exp2_mont()
1275 !BN_mod_exp_mont(&tmp, a2, p2, m, ctx, mont) || in BN_mod_exp2_mont()
1276 !BN_to_montgomery(rr, rr, mont, ctx) || in BN_mod_exp2_mont()
1277 !BN_mod_mul_montgomery(rr, rr, &tmp, mont, ctx)) { in BN_mod_exp2_mont()