Home
last modified time | relevance | path

Searched refs:mont (Results 1 – 25 of 27) sorted by relevance

12

/freebsd/crypto/openssl/crypto/bn/
H A Dbn_mont.c22 static int bn_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont);
26 BN_MONT_CTX *mont, BN_CTX *ctx) in BN_mod_mul_montgomery() argument
28 int ret = bn_mul_mont_fixed_top(r, a, b, mont, ctx); in BN_mod_mul_montgomery()
37 BN_MONT_CTX *mont, BN_CTX *ctx) in bn_mul_mont_fixed_top() argument
41 int num = mont->N.top; in bn_mul_mont_fixed_top()
47 if (bn_mul_mont(r->d, a->d, b->d, mont->N.d, mont->n0, num)) { in bn_mul_mont_fixed_top()
74 if (!bn_from_montgomery_word(r, tmp, mont)) in bn_mul_mont_fixed_top()
77 if (!BN_from_montgomery(r, tmp, mont, ctx)) in bn_mul_mont_fixed_top()
87 static int bn_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont) in bn_from_montgomery_word() argument
94 n = &(mont->N); in bn_from_montgomery_word()
[all …]
H A Dbuild.info9 # OPENSSL_BN_ASM_MONT For any collection with /-mont/ file names
19 $BNASM_x86=bn-586.S co-586.S x86-mont.S x86-gf2m.S
26 x86_64-mont.s x86_64-mont5.s x86_64-gf2m.s rsaz_exp.c rsaz-x86_64.s \
38 $BNASM_ia64=bn-ia64.s ia64-mont.s
40 $BNASM_ia64=bn_asm.c ia64-mont.s
43 $BNASM_sparcv9=asm/sparcv8plus.S sparcv9-mont.S sparcv9a-mont.S vis3-mont.S \
44 sparct4-mont.S bn_sparc.c
51 $BNASM_alpha=bn_asm.c alpha-mont.S
54 $BNASM_mips32=bn-mips.S mips-mont.S
60 $BNASM_s390x=bn_asm.c s390x-mont.S
[all …]
H A Dbn_exp2.c26 BN_MONT_CTX *mont = NULL; in BN_mod_exp2_mont() local
56 mont = in_mont; in BN_mod_exp2_mont()
58 if ((mont = BN_MONT_CTX_new()) == NULL) in BN_mod_exp2_mont()
60 if (!BN_MONT_CTX_set(mont, m, ctx)) in BN_mod_exp2_mont()
82 if (!BN_to_montgomery(val1[0], a_mod_m, mont, ctx)) in BN_mod_exp2_mont()
85 if (!BN_mod_mul_montgomery(d, val1[0], val1[0], mont, ctx)) in BN_mod_exp2_mont()
90 …(val1[i] = BN_CTX_get(ctx)) == NULL) || !BN_mod_mul_montgomery(val1[i], val1[i - 1], d, mont, ctx)) in BN_mod_exp2_mont()
109 if (!BN_to_montgomery(val2[0], a_mod_m, mont, ctx)) in BN_mod_exp2_mont()
112 if (!BN_mod_mul_montgomery(d, val2[0], val2[0], mont, ctx)) in BN_mod_exp2_mont()
117 …(val2[i] = BN_CTX_get(ctx)) == NULL) || !BN_mod_mul_montgomery(val2[i], val2[i - 1], d, mont, ctx)) in BN_mod_exp2_mont()
[all …]
H A Dbn_exp.c320 BN_MONT_CTX *mont = NULL; in BN_mod_exp_mont() local
362 mont = in_mont; in BN_mod_exp_mont()
364 if ((mont = BN_MONT_CTX_new()) == NULL) in BN_mod_exp_mont()
366 if (!BN_MONT_CTX_set(mont, m, ctx)) in BN_mod_exp_mont()
376 if (!bn_to_mont_fixed_top(val[0], aa, mont, ctx)) in BN_mod_exp_mont()
381 if (!bn_mul_mont_fixed_top(d, val[0], val[0], mont, ctx)) in BN_mod_exp_mont()
385 … (((val[i] = BN_CTX_get(ctx)) == NULL) || !bn_mul_mont_fixed_top(val[i], val[i - 1], d, mont, ctx)) in BN_mod_exp_mont()
409 if (!bn_to_mont_fixed_top(r, BN_value_one(), mont, ctx)) in BN_mod_exp_mont()
416 if (!bn_mul_mont_fixed_top(r, r, r, mont, ctx)) in BN_mod_exp_mont()
446 if (!bn_mul_mont_fixed_top(r, r, r, mont, ctx)) in BN_mod_exp_mont()
[all …]
H A Dbn_prime.c352 BN_MONT_CTX *mont = NULL; in ossl_bn_miller_rabin_is_prime() local
389 mont = BN_MONT_CTX_new(); in ossl_bn_miller_rabin_is_prime()
390 if (mont == NULL || !BN_MONT_CTX_set(mont, w, ctx)) in ossl_bn_miller_rabin_is_prime()
415 if (!BN_mod_exp_mont(z, b, m, w, ctx, mont)) in ossl_bn_miller_rabin_is_prime()
474 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()
1075 int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, in BN_to_montgomery() argument
1078 return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx); in BN_to_montgomery()
/freebsd/crypto/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()
H A Decp_nistz256.c1447 BN_MONT_CTX *mont = NULL, *ordmont = NULL; in ecp_nistz256group_full_init() local
1479 mont = BN_MONT_CTX_new(); in ecp_nistz256group_full_init()
1480 if (mont == NULL) in ecp_nistz256group_full_init()
1483 if (!ossl_bn_mont_ctx_set(mont, p, 256, params + 6 * param_len, param_len, in ecp_nistz256group_full_init()
1492 if (!BN_to_montgomery(one, BN_value_one(), mont, ctx)) { in ecp_nistz256group_full_init()
1496 group->field_data1 = mont; in ecp_nistz256group_full_init()
1497 mont = NULL; in ecp_nistz256group_full_init()
1556 BN_MONT_CTX_free(mont); in ecp_nistz256group_full_init()
/freebsd/crypto/openssl/doc/man3/
H A DBN_mod_mul_montgomery.pod14 void BN_MONT_CTX_free(BN_MONT_CTX *mont);
16 int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *m, BN_CTX *ctx);
20 BN_MONT_CTX *mont, BN_CTX *ctx);
22 int BN_from_montgomery(BIGNUM *r, BIGNUM *a, BN_MONT_CTX *mont,
25 int BN_to_montgomery(BIGNUM *r, BIGNUM *a, BN_MONT_CTX *mont,
37 BN_MONT_CTX_set() sets up the I<mont> structure from the modulus I<m>
44 If B<mont> is NULL, nothing is done.
H A DDSA_meth_new.pod61 BN_MONT_CTX *mont));
65 BN_CTX *ctx, BN_MONT_CTX *mont);
72 BN_MONT_CTX *mont));
/freebsd/crypto/openssl/crypto/bn/asm/
H A Dppc64-mont-fixed.pl466 my $mont = $class->SUPER::new($n);
468 return $mont;
566 my $mont;
568 $mont = new Mont::GPR(6);
569 $mont->mul_mont_fixed();
570 $code .= $mont->get_code();
572 $mont = new Mont::GPR_300(6);
573 $mont->mul_mont_fixed();
574 $code .= $mont->get_code();
/freebsd/crypto/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()
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()
527 BN_MONT_CTX *mont = NULL; in ossl_ffc_params_FIPS186_4_gen_verify() local
729 if ((mont = BN_MONT_CTX_new()) == NULL) in ossl_ffc_params_FIPS186_4_gen_verify()
731 if (!BN_MONT_CTX_set(mont, p, ctx)) in ossl_ffc_params_FIPS186_4_gen_verify()
735 && !ossl_ffc_params_validate_unverifiable_g(ctx, mont, p, q, params->g, in ossl_ffc_params_FIPS186_4_gen_verify()
751 if (!generate_canonical_g(ctx, mont, md, g, tmp, p, e, in ossl_ffc_params_FIPS186_4_gen_verify()
762 if (!generate_unverifiable_g(ctx, mont, g, tmp, p, e, pm1, &hret)) in ossl_ffc_params_FIPS186_4_gen_verify()
[all …]
H A Dffc_params_validate.c23 int ossl_ffc_params_validate_unverifiable_g(BN_CTX *ctx, BN_MONT_CTX *mont, in ossl_ffc_params_validate_unverifiable_g() argument
43 if (!BN_mod_exp_mont(tmp, g, q, p, ctx, mont)) in ossl_ffc_params_validate_unverifiable_g()
/freebsd/crypto/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()
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()
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()
H A Dbntest.c476 BN_MONT_CTX *mont = NULL; in test_modexp_mont5() local
487 || !TEST_ptr(mont = BN_MONT_CTX_new())) in test_modexp_mont5()
520 if (!(TEST_true(BN_MONT_CTX_set(mont, n, ctx)) in test_modexp_mont5()
521 && TEST_true(BN_mod_mul_montgomery(c, a, b, mont, ctx)) in test_modexp_mont5()
522 && TEST_true(BN_mod_mul_montgomery(d, b, a, mont, ctx)) in test_modexp_mont5()
532 && TEST_true(BN_MONT_CTX_set(mont, n, ctx)) in test_modexp_mont5()
533 && TEST_true(BN_mod_mul_montgomery(c, a, a, mont, ctx)) in test_modexp_mont5()
534 && TEST_true(BN_mod_mul_montgomery(d, a, b, mont, ctx)) in test_modexp_mont5()
577 && TEST_true(BN_MONT_CTX_set(mont, n, ctx)))) in test_modexp_mont5()
580 if (!TEST_true(BN_mod_mul_montgomery(c, a, a, mont, ctx)) in test_modexp_mont5()
[all …]
H A Dec_internal_test.c479 static int check_bn_mont_ctx(BN_MONT_CTX *mont, BIGNUM *mod, BN_CTX *ctx) in check_bn_mont_ctx() argument
486 if (!TEST_ptr(mont)) in check_bn_mont_ctx()
492 if (!TEST_true(ossl_bn_mont_ctx_eq(regenerated, mont))) in check_bn_mont_ctx()
/freebsd/crypto/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()
234 BN_MONT_CTX *mont = NULL; in ossl_dh_generate_public_key() local
249 mont = BN_MONT_CTX_set_locked(pmont, dh->lock, dh->params.p, ctx); in ossl_dh_generate_public_key()
250 if (mont == NULL) in ossl_dh_generate_public_key()
257 ctx, mont)) in ossl_dh_generate_public_key()
/freebsd/crypto/openssl/include/crypto/
H A Dbn.h75 BN_MONT_CTX *mont, BN_CTX *ctx);
79 int bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
81 int bn_from_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
/freebsd/crypto/openssl/providers/
H A Dfips.module.sources45 crypto/bn/asm/alpha-mont.pl
47 crypto/bn/asm/armv4-mont.pl
48 crypto/bn/asm/armv8-mont.pl
52 crypto/bn/asm/ia64-mont.pl
54 crypto/bn/asm/mips-mont.pl
56 crypto/bn/asm/parisc-mont.pl
57 crypto/bn/asm/ppc-mont.pl
59 crypto/bn/asm/ppc64-mont-fixed.pl
60 crypto/bn/asm/ppc64-mont.pl
70 crypto/bn/asm/s390x-mont.pl
[all …]
H A Dfips-sources.checksums45 819c9fd2b0cae9aab81c3cbd1815c2e22949d75f132f649b5883812d0bbaa39a crypto/bn/asm/alpha-mont.pl
47 5469ab174b62361c6ced8f5c1007c462700761c1aae72f0d2928ca39e57d47a1 crypto/bn/asm/armv4-mont.pl
48 1a2c890bcb9d96b24ef025c4894f89c56e83c05eb0db9532ba3b17a50753c2c2 crypto/bn/asm/armv8-mont.pl
52 199b9b100f194a2a128c14f2a71be5a04d50d069666d90ca5b69baee1318ccb7 crypto/bn/asm/ia64-mont.pl
54 687c5d6606fdfd0e242005972d15db74a9cbac2b8a9a54a56fcb1e99d3880ff3 crypto/bn/asm/mips-mont.pl
56 b27ec5181e387e812925bb26823b830f49d7a6e4971b6d11ea583f5632a1504b crypto/bn/asm/parisc-mont.pl
57 9973523b361db963eea4938a7a8a3adc692e1a4e1aec4fa1f1e57dc93da37921 crypto/bn/asm/ppc-mont.pl
59 0b3350f56d423a4df918a08e90c7c66227c4449a9f9c44096eacc254ebc65f9f crypto/bn/asm/ppc64-mont-fixed.pl
60 a25be64867ab837d93855af232e2bfa71b85b2c6f00e35e620fdc5618187fb6f crypto/bn/asm/ppc64-mont.pl
70 590388d69d7ac3a0e9af4014792f4f0fdb9552719e8fb48ebc7e5dfca2a491d4 crypto/bn/asm/s390x-mont.pl
[all …]
/freebsd/crypto/openssl/crypto/dsa/
H A Ddsa_ossl.c360 BN_MONT_CTX *mont = NULL; in dsa_do_verify() local
426 mont = BN_MONT_CTX_set_locked(&dsa->method_mont_p, in dsa_do_verify()
428 if (!mont) in dsa_do_verify()
434 dsa->params.p, ctx, mont)) in dsa_do_verify()
438 dsa->params.p, ctx, mont)) in dsa_do_verify()
/freebsd/secure/lib/libcrypto/
H A DMakefile.asm31 SRCS+= armv8-mont.pl
105 x86_64-gf2m.pl x86_64-mont.pl x86_64-mont5.pl
183 SRCS+= armv4-mont.pl armv4-gf2m.pl
248 SRCS+= bn-586.pl co-586.pl x86-gf2m.pl x86-mont.pl
323 SRCS+= ppc.pl ppc-mont.pl
385 SRCS+= ppc.pl ppc-mont.pl
454 SRCS+= ppc.pl ppc-mont.pl
H A DMakefile117 SRCS+= armv8-mont.S bn_asm.c
123 SRCS+= x86_64-gcc.c x86_64-gf2m.S x86_64-mont.S x86_64-mont5.S
125 SRCS+= armv4-gf2m.S armv4-mont.S bn_asm.c
127 SRCS+= bn-586.S co-586.S x86-gf2m.S x86-mont.S
129 SRCS+= bn_ppc.c bn-ppc.S ppc-mont.S
131 SRCS+= bn_ppc.c bn-ppc.S ppc-mont.S
133 SRCS+= bn_ppc.c bn-ppc.S ppc-mont.S
/freebsd/crypto/openssl/include/openssl/
H A Dbn.h409 BN_MONT_CTX *mont, BN_CTX *ctx);
410 int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
412 int BN_from_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
414 void BN_MONT_CTX_free(BN_MONT_CTX *mont);
415 int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx);
451 void BN_set_params(int mul, int high, int low, int mont);
/freebsd/sys/modules/ossl/
H A DMakefile75 ppc-mont.S \
98 ppc-mont.S \

12