Home
last modified time | relevance | path

Searched refs:mont (Results 1 - 25 of 33) sorted by relevance

12

/third_party/node/deps/openssl/openssl/crypto/bn/
H A Dbn_mont.c23 static int bn_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont);
27 BN_MONT_CTX *mont, BN_CTX *ctx) in BN_mod_mul_montgomery()
29 int ret = bn_mul_mont_fixed_top(r, a, b, mont, ctx); in BN_mod_mul_montgomery()
38 BN_MONT_CTX *mont, BN_CTX *ctx) in bn_mul_mont_fixed_top()
42 int num = mont->N.top; in bn_mul_mont_fixed_top()
48 if (bn_mul_mont(r->d, a->d, b->d, mont->N.d, mont->n0, num)) { in bn_mul_mont_fixed_top()
75 if (!bn_from_montgomery_word(r, tmp, mont)) in bn_mul_mont_fixed_top()
78 if (!BN_from_montgomery(r, tmp, mont, ctx)) in bn_mul_mont_fixed_top()
88 static int bn_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont) in bn_from_montgomery_word() argument
26 BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_MONT_CTX *mont, BN_CTX *ctx) BN_mod_mul_montgomery() argument
37 bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_MONT_CTX *mont, BN_CTX *ctx) bn_mul_mont_fixed_top() argument
162 BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont, BN_CTX *ctx) BN_from_montgomery() argument
174 bn_from_mont_fixed_top(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont, BN_CTX *ctx) bn_from_mont_fixed_top() argument
222 bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, BN_CTX *ctx) bn_to_mont_fixed_top() argument
252 BN_MONT_CTX_free(BN_MONT_CTX *mont) BN_MONT_CTX_free() argument
263 BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) BN_MONT_CTX_set() argument
[all...]
H A Dbn_exp2.c27 BN_MONT_CTX *mont = NULL; in BN_mod_exp2_mont() local
57 mont = in_mont; in BN_mod_exp2_mont()
59 if ((mont = BN_MONT_CTX_new()) == NULL) in BN_mod_exp2_mont()
61 if (!BN_MONT_CTX_set(mont, m, ctx)) in BN_mod_exp2_mont()
83 if (!BN_to_montgomery(val1[0], a_mod_m, mont, ctx)) in BN_mod_exp2_mont()
86 if (!BN_mod_mul_montgomery(d, val1[0], val1[0], mont, ctx)) in BN_mod_exp2_mont()
92 !BN_mod_mul_montgomery(val1[i], val1[i - 1], d, mont, ctx)) in BN_mod_exp2_mont()
111 if (!BN_to_montgomery(val2[0], a_mod_m, mont, ctx)) in BN_mod_exp2_mont()
114 if (!BN_mod_mul_montgomery(d, val2[0], val2[0], mont, ctx)) in BN_mod_exp2_mont()
120 !BN_mod_mul_montgomery(val2[i], val2[i - 1], d, mont, ct in BN_mod_exp2_mont()
[all...]
H A Dbn_exp.c321 BN_MONT_CTX *mont = NULL; in BN_mod_exp_mont() local
363 mont = in_mont; in BN_mod_exp_mont()
365 if ((mont = BN_MONT_CTX_new()) == NULL) in BN_mod_exp_mont()
367 if (!BN_MONT_CTX_set(mont, m, ctx)) in BN_mod_exp_mont()
377 if (!bn_to_mont_fixed_top(val[0], aa, mont, ctx)) in BN_mod_exp_mont()
382 if (!bn_mul_mont_fixed_top(d, val[0], val[0], mont, ctx)) in BN_mod_exp_mont()
387 !bn_mul_mont_fixed_top(val[i], val[i - 1], d, mont, ctx)) in BN_mod_exp_mont()
412 if (!bn_to_mont_fixed_top(r, BN_value_one(), mont, ctx)) in BN_mod_exp_mont()
417 if (!bn_mul_mont_fixed_top(r, r, r, mont, ctx)) in BN_mod_exp_mont()
447 if (!bn_mul_mont_fixed_top(r, r, r, mont, ct in BN_mod_exp_mont()
615 BN_MONT_CTX *mont = NULL; BN_mod_exp_mont_consttime() local
1166 BN_MONT_CTX *mont = NULL; BN_mod_exp_mont_word() local
[all...]
H A Dbn_prime.c343 BN_MONT_CTX *mont = NULL; in ossl_bn_miller_rabin_is_prime() local
380 mont = BN_MONT_CTX_new(); in ossl_bn_miller_rabin_is_prime()
381 if (mont == NULL || !BN_MONT_CTX_set(mont, w, ctx)) in ossl_bn_miller_rabin_is_prime()
406 if (!BN_mod_exp_mont(z, b, m, w, ctx, mont)) in ossl_bn_miller_rabin_is_prime()
465 BN_MONT_CTX_free(mont); in ossl_bn_miller_rabin_is_prime()
H A Dbn_lib.c39 void BN_set_params(int mult, int high, int low, int mont) in BN_set_params() argument
59 if (mont >= 0) { in BN_set_params()
60 if (mont > (int)(sizeof(int) * 8) - 1) in BN_set_params()
61 mont = sizeof(int) * 8 - 1; in BN_set_params()
62 bn_limit_bits_mont = mont; in BN_set_params()
63 bn_limit_num_mont = 1 << mont; in BN_set_params()
948 int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, in BN_to_montgomery() argument
951 return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx); in BN_to_montgomery()
/third_party/openssl/crypto/bn/
H A Dbn_mont.c23 static int bn_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont);
27 BN_MONT_CTX *mont, BN_CTX *ctx) in BN_mod_mul_montgomery()
29 int ret = bn_mul_mont_fixed_top(r, a, b, mont, ctx); in BN_mod_mul_montgomery()
38 BN_MONT_CTX *mont, BN_CTX *ctx) in bn_mul_mont_fixed_top()
42 int num = mont->N.top; in bn_mul_mont_fixed_top()
48 if (bn_mul_mont(r->d, a->d, b->d, mont->N.d, mont->n0, num)) { in bn_mul_mont_fixed_top()
75 if (!bn_from_montgomery_word(r, tmp, mont)) in bn_mul_mont_fixed_top()
78 if (!BN_from_montgomery(r, tmp, mont, ctx)) in bn_mul_mont_fixed_top()
88 static int bn_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont) in bn_from_montgomery_word() argument
26 BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_MONT_CTX *mont, BN_CTX *ctx) BN_mod_mul_montgomery() argument
37 bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_MONT_CTX *mont, BN_CTX *ctx) bn_mul_mont_fixed_top() argument
162 BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont, BN_CTX *ctx) BN_from_montgomery() argument
174 bn_from_mont_fixed_top(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont, BN_CTX *ctx) bn_from_mont_fixed_top() argument
222 bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, BN_CTX *ctx) bn_to_mont_fixed_top() argument
252 BN_MONT_CTX_free(BN_MONT_CTX *mont) BN_MONT_CTX_free() argument
263 BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) BN_MONT_CTX_set() argument
[all...]
H A Dbn_exp2.c27 BN_MONT_CTX *mont = NULL; in BN_mod_exp2_mont() local
57 mont = in_mont; in BN_mod_exp2_mont()
59 if ((mont = BN_MONT_CTX_new()) == NULL) in BN_mod_exp2_mont()
61 if (!BN_MONT_CTX_set(mont, m, ctx)) in BN_mod_exp2_mont()
83 if (!BN_to_montgomery(val1[0], a_mod_m, mont, ctx)) in BN_mod_exp2_mont()
86 if (!BN_mod_mul_montgomery(d, val1[0], val1[0], mont, ctx)) in BN_mod_exp2_mont()
92 !BN_mod_mul_montgomery(val1[i], val1[i - 1], d, mont, ctx)) in BN_mod_exp2_mont()
111 if (!BN_to_montgomery(val2[0], a_mod_m, mont, ctx)) in BN_mod_exp2_mont()
114 if (!BN_mod_mul_montgomery(d, val2[0], val2[0], mont, ctx)) in BN_mod_exp2_mont()
120 !BN_mod_mul_montgomery(val2[i], val2[i - 1], d, mont, ct in BN_mod_exp2_mont()
[all...]
H A Dbn_exp.c313 BN_MONT_CTX *mont = NULL; in BN_mod_exp_mont() local
355 mont = in_mont; in BN_mod_exp_mont()
357 if ((mont = BN_MONT_CTX_new()) == NULL) in BN_mod_exp_mont()
359 if (!BN_MONT_CTX_set(mont, m, ctx)) in BN_mod_exp_mont()
369 if (!bn_to_mont_fixed_top(val[0], aa, mont, ctx)) in BN_mod_exp_mont()
374 if (!bn_mul_mont_fixed_top(d, val[0], val[0], mont, ctx)) in BN_mod_exp_mont()
379 !bn_mul_mont_fixed_top(val[i], val[i - 1], d, mont, ctx)) in BN_mod_exp_mont()
404 if (!bn_to_mont_fixed_top(r, BN_value_one(), mont, ctx)) in BN_mod_exp_mont()
409 if (!bn_mul_mont_fixed_top(r, r, r, mont, ctx)) in BN_mod_exp_mont()
439 if (!bn_mul_mont_fixed_top(r, r, r, mont, ct in BN_mod_exp_mont()
607 BN_MONT_CTX *mont = NULL; BN_mod_exp_mont_consttime() local
1158 BN_MONT_CTX *mont = NULL; BN_mod_exp_mont_word() local
[all...]
H A Dbn_prime.c343 BN_MONT_CTX *mont = NULL; in ossl_bn_miller_rabin_is_prime() local
380 mont = BN_MONT_CTX_new(); in ossl_bn_miller_rabin_is_prime()
381 if (mont == NULL || !BN_MONT_CTX_set(mont, w, ctx)) in ossl_bn_miller_rabin_is_prime()
406 if (!BN_mod_exp_mont(z, b, m, w, ctx, mont)) in ossl_bn_miller_rabin_is_prime()
465 BN_MONT_CTX_free(mont); in ossl_bn_miller_rabin_is_prime()
H A Dbn_lib.c39 void BN_set_params(int mult, int high, int low, int mont) in BN_set_params() argument
59 if (mont >= 0) { in BN_set_params()
60 if (mont > (int)(sizeof(int) * 8) - 1) in BN_set_params()
61 mont = sizeof(int) * 8 - 1; in BN_set_params()
62 bn_limit_bits_mont = mont; in BN_set_params()
63 bn_limit_num_mont = 1 << mont; in BN_set_params()
948 int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, in BN_to_montgomery() argument
951 return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx); in BN_to_montgomery()
/third_party/mbedtls/library/
H A Dbignum_mod.c70 if (N->rep.mont.rr != NULL) { in mbedtls_mpi_mod_modulus_free()
71 mbedtls_zeroize_and_free((mbedtls_mpi_uint *) N->rep.mont.rr, in mbedtls_mpi_mod_modulus_free()
73 N->rep.mont.rr = NULL; in mbedtls_mpi_mod_modulus_free()
75 N->rep.mont.mm = 0; in mbedtls_mpi_mod_modulus_free()
143 N->rep.mont.mm = mbedtls_mpi_core_montmul_init(N->p); in mbedtls_mpi_mod_modulus_setup()
144 ret = set_mont_const_square(&N->rep.mont.rr, N->p, N->limbs); in mbedtls_mpi_mod_modulus_setup()
210 N->rep.mont.rr, in mbedtls_mpi_mod_inv_mont()
231 Nmont.rep.mont.mm, Nmont.rep.mont.rr, in mbedtls_mpi_mod_inv_non_mont()
236 Nmont.rep.mont in mbedtls_mpi_mod_inv_non_mont()
[all...]
H A Dbignum_mod_raw.c130 N->rep.mont.mm, T); in mbedtls_mpi_mod_raw_mul()
242 N->rep.mont.mm, N->rep.mont.rr, T); in mbedtls_mpi_mod_raw_to_mont_rep()
258 mbedtls_mpi_core_from_mont_rep(X, X, N->p, N->limbs, N->rep.mont.mm, T); in mbedtls_mpi_mod_raw_from_mont_rep()
/third_party/node/deps/openssl/openssl/crypto/ec/
H A Decp_mont.c147 BN_MONT_CTX *mont = NULL; in ossl_ec_GFp_mont_group_set_curve() local
162 mont = BN_MONT_CTX_new(); in ossl_ec_GFp_mont_group_set_curve()
163 if (mont == NULL) in ossl_ec_GFp_mont_group_set_curve()
165 if (!BN_MONT_CTX_set(mont, p, ctx)) { in ossl_ec_GFp_mont_group_set_curve()
172 if (!BN_to_montgomery(one, BN_value_one(), mont, ctx)) in ossl_ec_GFp_mont_group_set_curve()
175 group->field_data1 = mont; in ossl_ec_GFp_mont_group_set_curve()
176 mont = NULL; in ossl_ec_GFp_mont_group_set_curve()
192 BN_MONT_CTX_free(mont); in ossl_ec_GFp_mont_group_set_curve()
/third_party/openssl/crypto/ec/
H A Decp_mont.c147 BN_MONT_CTX *mont = NULL; in ossl_ec_GFp_mont_group_set_curve() local
162 mont = BN_MONT_CTX_new(); in ossl_ec_GFp_mont_group_set_curve()
163 if (mont == NULL) in ossl_ec_GFp_mont_group_set_curve()
165 if (!BN_MONT_CTX_set(mont, p, ctx)) { in ossl_ec_GFp_mont_group_set_curve()
172 if (!BN_to_montgomery(one, BN_value_one(), mont, ctx)) in ossl_ec_GFp_mont_group_set_curve()
175 group->field_data1 = mont; in ossl_ec_GFp_mont_group_set_curve()
176 mont = NULL; in ossl_ec_GFp_mont_group_set_curve()
192 BN_MONT_CTX_free(mont); in ossl_ec_GFp_mont_group_set_curve()
/third_party/node/deps/openssl/openssl/crypto/ffc/
H A Dffc_params_generate.c95 static int generate_unverifiable_g(BN_CTX *ctx, BN_MONT_CTX *mont, BIGNUM *g, in generate_unverifiable_g() argument
108 if (!BN_mod_exp_mont(g, hbn, e, p, ctx, mont)) in generate_unverifiable_g()
129 * mont is used in a BN_mod_exp_mont() with a modulus of p.
132 static int generate_canonical_g(BN_CTX *ctx, BN_MONT_CTX *mont, in generate_canonical_g() argument
174 || !BN_mod_exp_mont(g, tmp, e, p, ctx, mont)) in generate_canonical_g()
524 BN_MONT_CTX *mont = NULL; in ossl_ffc_params_FIPS186_4_gen_verify() local
726 if ((mont = BN_MONT_CTX_new()) == NULL) in ossl_ffc_params_FIPS186_4_gen_verify()
728 if (!BN_MONT_CTX_set(mont, p, ctx)) in ossl_ffc_params_FIPS186_4_gen_verify()
732 && !ossl_ffc_params_validate_unverifiable_g(ctx, mont, p, q, params->g, in ossl_ffc_params_FIPS186_4_gen_verify()
748 if (!generate_canonical_g(ctx, mont, m in ossl_ffc_params_FIPS186_4_gen_verify()
815 BN_MONT_CTX *mont = NULL; ossl_ffc_params_FIPS186_2_gen_verify() local
[all...]
/third_party/openssl/crypto/ffc/
H A Dffc_params_generate.c95 static int generate_unverifiable_g(BN_CTX *ctx, BN_MONT_CTX *mont, BIGNUM *g, in generate_unverifiable_g() argument
108 if (!BN_mod_exp_mont(g, hbn, e, p, ctx, mont)) in generate_unverifiable_g()
129 * mont is used in a BN_mod_exp_mont() with a modulus of p.
132 static int generate_canonical_g(BN_CTX *ctx, BN_MONT_CTX *mont, in generate_canonical_g() argument
174 || !BN_mod_exp_mont(g, tmp, e, p, ctx, mont)) in generate_canonical_g()
524 BN_MONT_CTX *mont = NULL; in ossl_ffc_params_FIPS186_4_gen_verify() local
726 if ((mont = BN_MONT_CTX_new()) == NULL) in ossl_ffc_params_FIPS186_4_gen_verify()
728 if (!BN_MONT_CTX_set(mont, p, ctx)) in ossl_ffc_params_FIPS186_4_gen_verify()
732 && !ossl_ffc_params_validate_unverifiable_g(ctx, mont, p, q, params->g, in ossl_ffc_params_FIPS186_4_gen_verify()
748 if (!generate_canonical_g(ctx, mont, m in ossl_ffc_params_FIPS186_4_gen_verify()
815 BN_MONT_CTX *mont = NULL; ossl_ffc_params_FIPS186_2_gen_verify() local
[all...]
/third_party/openssl/ohos_lite/include/crypto/
H A Dbn.h74 BN_MONT_CTX *mont, BN_CTX *ctx);
75 int bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
77 int bn_from_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
/third_party/node/deps/openssl/openssl/crypto/dh/
H A Ddh_key.c43 BN_MONT_CTX *mont = NULL; in ossl_dh_compute_key() local
78 mont = BN_MONT_CTX_set_locked(&dh->method_mont_p, in ossl_dh_compute_key()
81 if (!mont) in ossl_dh_compute_key()
87 mont)) { in ossl_dh_compute_key()
230 BN_MONT_CTX *mont = NULL; in ossl_dh_generate_public_key() local
245 mont = BN_MONT_CTX_set_locked(pmont, dh->lock, dh->params.p, ctx); in ossl_dh_generate_public_key()
246 if (mont == NULL) in ossl_dh_generate_public_key()
253 ctx, mont)) in ossl_dh_generate_public_key()
/third_party/openssl/crypto/dh/
H A Ddh_key.c43 BN_MONT_CTX *mont = NULL; in ossl_dh_compute_key() local
78 mont = BN_MONT_CTX_set_locked(&dh->method_mont_p, in ossl_dh_compute_key()
81 if (!mont) in ossl_dh_compute_key()
87 mont)) { in ossl_dh_compute_key()
231 BN_MONT_CTX *mont = NULL; in ossl_dh_generate_public_key() local
246 mont = BN_MONT_CTX_set_locked(pmont, dh->lock, dh->params.p, ctx); in ossl_dh_generate_public_key()
247 if (mont == NULL) in ossl_dh_generate_public_key()
254 ctx, mont)) in ossl_dh_generate_public_key()
/third_party/openssl/test/
H A Dexptest.c53 BN_MONT_CTX *mont = NULL; in test_mod_exp_zero() local
98 if (!TEST_ptr(mont = BN_MONT_CTX_new())) in test_mod_exp_zero()
102 /* mont is not set but passed in */ in test_mod_exp_zero()
103 if (!TEST_false(BN_mod_exp_mont_consttime(r, p, a, m, ctx, mont))) in test_mod_exp_zero()
105 if (!TEST_false(BN_mod_exp_mont(r, p, a, m, ctx, mont))) in test_mod_exp_zero()
109 if (!TEST_true(BN_MONT_CTX_set(mont, m, ctx))) in test_mod_exp_zero()
112 /* we compute 0 ** a mod 1 here, to execute code that uses mont */ in test_mod_exp_zero()
113 if (!TEST_true(BN_mod_exp_mont_consttime(r, p, a, m, ctx, mont))) in test_mod_exp_zero()
119 if (!TEST_true(BN_mod_exp_mont(r, p, a, m, ctx, mont))) in test_mod_exp_zero()
145 BN_MONT_CTX_free(mont); in test_mod_exp_zero()
[all...]
H A Dbntest.c457 BN_MONT_CTX *mont = NULL; in test_modexp_mont5() local
468 || !TEST_ptr(mont = BN_MONT_CTX_new())) in test_modexp_mont5()
501 if (!(TEST_true(BN_MONT_CTX_set(mont, n, ctx)) in test_modexp_mont5()
502 && TEST_true(BN_mod_mul_montgomery(c, a, b, mont, ctx)) in test_modexp_mont5()
503 && TEST_true(BN_mod_mul_montgomery(d, b, a, mont, ctx)) in test_modexp_mont5()
513 && TEST_true(BN_MONT_CTX_set(mont, n, ctx)) in test_modexp_mont5()
514 && TEST_true(BN_mod_mul_montgomery(c, a, a, mont, ctx)) in test_modexp_mont5()
515 && TEST_true(BN_mod_mul_montgomery(d, a, b, mont, ctx)) in test_modexp_mont5()
558 && TEST_true(BN_MONT_CTX_set(mont, n, ctx)))) in test_modexp_mont5()
561 if (!TEST_true(BN_mod_mul_montgomery(c, a, a, mont, ct in test_modexp_mont5()
1603 BN_MONT_CTX *mont = BN_MONT_CTX_new(); file_modmul() local
2250 BN_MONT_CTX *mont = NULL; test_badmod() local
[all...]
/third_party/node/deps/openssl/openssl/include/crypto/
H A Dbn.h75 BN_MONT_CTX *mont, BN_CTX *ctx);
76 int bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
78 int bn_from_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
/third_party/openssl/include/crypto/
H A Dbn.h75 BN_MONT_CTX *mont, BN_CTX *ctx);
76 int bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
78 int bn_from_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
/third_party/node/deps/openssl/openssl/crypto/dsa/
H A Ddsa_ossl.c338 BN_MONT_CTX *mont = NULL; in dsa_do_verify() local
406 mont = BN_MONT_CTX_set_locked(&dsa->method_mont_p, in dsa_do_verify()
408 if (!mont) in dsa_do_verify()
414 dsa->params.p, ctx, mont)) in dsa_do_verify()
418 dsa->params.p, ctx, mont)) in dsa_do_verify()
/third_party/openssl/crypto/dsa/
H A Ddsa_ossl.c338 BN_MONT_CTX *mont = NULL; in dsa_do_verify() local
406 mont = BN_MONT_CTX_set_locked(&dsa->method_mont_p, in dsa_do_verify()
408 if (!mont) in dsa_do_verify()
414 dsa->params.p, ctx, mont)) in dsa_do_verify()
418 dsa->params.p, ctx, mont)) in dsa_do_verify()

Completed in 18 milliseconds

12