/external/openssl/crypto/bn/ |
D | bn_mont.c | 126 static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont); 130 BN_MONT_CTX *mont, BN_CTX *ctx) in BN_mod_mul_montgomery() argument 135 int num = mont->N.top; in BN_mod_mul_montgomery() 140 if (bn_mul_mont(r->d,a->d,b->d,mont->N.d,mont->n0,num)) in BN_mod_mul_montgomery() 165 if (!BN_from_montgomery_word(r,tmp,mont)) goto err; in BN_mod_mul_montgomery() 167 if (!BN_from_montgomery(r,tmp,mont,ctx)) goto err; in BN_mod_mul_montgomery() 177 static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont) in BN_from_montgomery_word() argument 183 n= &(mont->N); in BN_from_montgomery_word() 203 n0=mont->n0[0]; in BN_from_montgomery_word() 280 int BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont, in BN_from_montgomery() argument [all …]
|
D | bn_exp2.c | 128 BN_MONT_CTX *mont=NULL; in BN_mod_exp2_mont() local 159 mont=in_mont; in BN_mod_exp2_mont() 162 if ((mont=BN_MONT_CTX_new()) == NULL) goto err; in BN_mod_exp2_mont() 163 if (!BN_MONT_CTX_set(mont,m,ctx)) goto err; in BN_mod_exp2_mont() 187 if (!BN_to_montgomery(val1[0],a_mod_m,mont,ctx)) goto err; in BN_mod_exp2_mont() 190 if (!BN_mod_mul_montgomery(d,val1[0],val1[0],mont,ctx)) goto err; in BN_mod_exp2_mont() 197 d,mont,ctx)) in BN_mod_exp2_mont() 220 if (!BN_to_montgomery(val2[0],a_mod_m,mont,ctx)) goto err; in BN_mod_exp2_mont() 223 if (!BN_mod_mul_montgomery(d,val2[0],val2[0],mont,ctx)) goto err; in BN_mod_exp2_mont() 230 d,mont,ctx)) in BN_mod_exp2_mont() [all …]
|
D | bn_exp.c | 393 BN_MONT_CTX *mont=NULL; in BN_mod_exp_mont() local 426 mont=in_mont; in BN_mod_exp_mont() 429 if ((mont=BN_MONT_CTX_new()) == NULL) goto err; in BN_mod_exp_mont() 430 if (!BN_MONT_CTX_set(mont,m,ctx)) goto err; in BN_mod_exp_mont() 447 if (!BN_to_montgomery(val[0],aa,mont,ctx)) goto err; /* 1 */ in BN_mod_exp_mont() 452 if (!BN_mod_mul_montgomery(d,val[0],val[0],mont,ctx)) goto err; /* 2 */ in BN_mod_exp_mont() 458 d,mont,ctx)) in BN_mod_exp_mont() 470 if (!BN_to_montgomery(r,BN_value_one(),mont,ctx)) goto err; in BN_mod_exp_mont() 477 if (!BN_mod_mul_montgomery(r,r,r,mont,ctx)) in BN_mod_exp_mont() 508 if (!BN_mod_mul_montgomery(r,r,r,mont,ctx)) in BN_mod_exp_mont() [all …]
|
D | exp.c | 19 BN_MONT_CTX mont; local 22 BN_MONT_CTX_init(&mont); 41 BN_MONT_CTX_set(&mont,&c,&ctx); 50 BN_mod_exp_mont(&r,&a,&b,&c,&ctx,&mont);
|
D | bn_prime.c | 130 const BIGNUM *a1_odd, int k, BN_CTX *ctx, BN_MONT_CTX *mont); 250 BN_MONT_CTX *mont = NULL; in BN_is_prime_fasttest_ex() local 314 mont = BN_MONT_CTX_new(); in BN_is_prime_fasttest_ex() 315 if (mont == NULL) in BN_is_prime_fasttest_ex() 317 if (!BN_MONT_CTX_set(mont, A, ctx)) in BN_is_prime_fasttest_ex() 328 j = witness(check, A, A1, A1_odd, k, ctx, mont); in BN_is_prime_fasttest_ex() 346 if (mont != NULL) in BN_is_prime_fasttest_ex() 347 BN_MONT_CTX_free(mont); in BN_is_prime_fasttest_ex() 353 const BIGNUM *a1_odd, int k, BN_CTX *ctx, BN_MONT_CTX *mont) in witness() argument 355 if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */ in witness()
|
D | bn_lib.c | 92 void BN_set_params(int mult, int high, int low, int mont) in BN_set_params() argument 115 if (mont >= 0) in BN_set_params() 117 if (mont > (int)(sizeof(int)*8)-1) in BN_set_params() 118 mont=sizeof(int)*8-1; in BN_set_params() 119 bn_limit_bits_mont=mont; in BN_set_params() 120 bn_limit_num_mont=1<<mont; in BN_set_params()
|
D | bn.h | 577 BN_MONT_CTX *mont, BN_CTX *ctx); 578 #define BN_to_montgomery(r,a,mont,ctx) BN_mod_mul_montgomery(\ argument 579 (r),(a),&((mont)->RR),(mont),(ctx)) 581 BN_MONT_CTX *mont, BN_CTX *ctx); 582 void BN_MONT_CTX_free(BN_MONT_CTX *mont); 583 int BN_MONT_CTX_set(BN_MONT_CTX *mont,const BIGNUM *mod,BN_CTX *ctx); 613 void BN_set_params(int mul,int high,int low,int mont);
|
D | bntest.c | 724 BN_MONT_CTX *mont; in test_mont() local 734 mont=BN_MONT_CTX_new(); in test_mont() 735 if (mont == NULL) in test_mont() 747 BN_MONT_CTX_set(mont,&n,ctx); in test_mont() 752 BN_to_montgomery(&A,&a,mont,ctx); in test_mont() 753 BN_to_montgomery(&B,&b,mont,ctx); in test_mont() 755 BN_mod_mul_montgomery(&c,&A,&B,mont,ctx);/**/ in test_mont() 756 BN_from_montgomery(&A,&c,mont,ctx);/**/ in test_mont() 765 BN_num_bits(mont->N)); in test_mont() 771 BN_print(bp,&(mont->N)); in test_mont() [all …]
|
/external/chromium_org/third_party/openssl/openssl/crypto/bn/ |
D | bn_mont.c | 126 static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont); 130 BN_MONT_CTX *mont, BN_CTX *ctx) in BN_mod_mul_montgomery() argument 135 int num = mont->N.top; in BN_mod_mul_montgomery() 140 if (bn_mul_mont(r->d,a->d,b->d,mont->N.d,mont->n0,num)) in BN_mod_mul_montgomery() 165 if (!BN_from_montgomery_word(r,tmp,mont)) goto err; in BN_mod_mul_montgomery() 167 if (!BN_from_montgomery(r,tmp,mont,ctx)) goto err; in BN_mod_mul_montgomery() 177 static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont) in BN_from_montgomery_word() argument 183 n= &(mont->N); in BN_from_montgomery_word() 203 n0=mont->n0[0]; in BN_from_montgomery_word() 280 int BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont, in BN_from_montgomery() argument [all …]
|
D | bn_exp2.c | 128 BN_MONT_CTX *mont=NULL; in BN_mod_exp2_mont() local 159 mont=in_mont; in BN_mod_exp2_mont() 162 if ((mont=BN_MONT_CTX_new()) == NULL) goto err; in BN_mod_exp2_mont() 163 if (!BN_MONT_CTX_set(mont,m,ctx)) goto err; in BN_mod_exp2_mont() 187 if (!BN_to_montgomery(val1[0],a_mod_m,mont,ctx)) goto err; in BN_mod_exp2_mont() 190 if (!BN_mod_mul_montgomery(d,val1[0],val1[0],mont,ctx)) goto err; in BN_mod_exp2_mont() 197 d,mont,ctx)) in BN_mod_exp2_mont() 220 if (!BN_to_montgomery(val2[0],a_mod_m,mont,ctx)) goto err; in BN_mod_exp2_mont() 223 if (!BN_mod_mul_montgomery(d,val2[0],val2[0],mont,ctx)) goto err; in BN_mod_exp2_mont() 230 d,mont,ctx)) in BN_mod_exp2_mont() [all …]
|
D | bn_exp.c | 393 BN_MONT_CTX *mont=NULL; in BN_mod_exp_mont() local 426 mont=in_mont; in BN_mod_exp_mont() 429 if ((mont=BN_MONT_CTX_new()) == NULL) goto err; in BN_mod_exp_mont() 430 if (!BN_MONT_CTX_set(mont,m,ctx)) goto err; in BN_mod_exp_mont() 447 if (!BN_to_montgomery(val[0],aa,mont,ctx)) goto err; /* 1 */ in BN_mod_exp_mont() 452 if (!BN_mod_mul_montgomery(d,val[0],val[0],mont,ctx)) goto err; /* 2 */ in BN_mod_exp_mont() 458 d,mont,ctx)) in BN_mod_exp_mont() 470 if (!BN_to_montgomery(r,BN_value_one(),mont,ctx)) goto err; in BN_mod_exp_mont() 477 if (!BN_mod_mul_montgomery(r,r,r,mont,ctx)) in BN_mod_exp_mont() 508 if (!BN_mod_mul_montgomery(r,r,r,mont,ctx)) in BN_mod_exp_mont() [all …]
|
D | exp.c | 19 BN_MONT_CTX mont; local 22 BN_MONT_CTX_init(&mont); 41 BN_MONT_CTX_set(&mont,&c,&ctx); 50 BN_mod_exp_mont(&r,&a,&b,&c,&ctx,&mont);
|
D | bn_prime.c | 130 const BIGNUM *a1_odd, int k, BN_CTX *ctx, BN_MONT_CTX *mont); 250 BN_MONT_CTX *mont = NULL; in BN_is_prime_fasttest_ex() local 314 mont = BN_MONT_CTX_new(); in BN_is_prime_fasttest_ex() 315 if (mont == NULL) in BN_is_prime_fasttest_ex() 317 if (!BN_MONT_CTX_set(mont, A, ctx)) in BN_is_prime_fasttest_ex() 328 j = witness(check, A, A1, A1_odd, k, ctx, mont); in BN_is_prime_fasttest_ex() 346 if (mont != NULL) in BN_is_prime_fasttest_ex() 347 BN_MONT_CTX_free(mont); in BN_is_prime_fasttest_ex() 353 const BIGNUM *a1_odd, int k, BN_CTX *ctx, BN_MONT_CTX *mont) in witness() argument 355 if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */ in witness()
|
D | bn_lib.c | 92 void BN_set_params(int mult, int high, int low, int mont) in BN_set_params() argument 115 if (mont >= 0) in BN_set_params() 117 if (mont > (int)(sizeof(int)*8)-1) in BN_set_params() 118 mont=sizeof(int)*8-1; in BN_set_params() 119 bn_limit_bits_mont=mont; in BN_set_params() 120 bn_limit_num_mont=1<<mont; in BN_set_params()
|
D | bn.h | 575 BN_MONT_CTX *mont, BN_CTX *ctx); 576 #define BN_to_montgomery(r,a,mont,ctx) BN_mod_mul_montgomery(\ argument 577 (r),(a),&((mont)->RR),(mont),(ctx)) 579 BN_MONT_CTX *mont, BN_CTX *ctx); 580 void BN_MONT_CTX_free(BN_MONT_CTX *mont); 581 int BN_MONT_CTX_set(BN_MONT_CTX *mont,const BIGNUM *mod,BN_CTX *ctx); 611 void BN_set_params(int mul,int high,int low,int mont);
|
/external/chromium_org/third_party/openssl/openssl/crypto/ec/ |
D | ecp_mont.c | 207 BN_MONT_CTX *mont = NULL; in ec_GFp_mont_group_set_curve() local 229 mont = BN_MONT_CTX_new(); in ec_GFp_mont_group_set_curve() 230 if (mont == NULL) goto err; in ec_GFp_mont_group_set_curve() 231 if (!BN_MONT_CTX_set(mont, p, ctx)) in ec_GFp_mont_group_set_curve() 238 if (!BN_to_montgomery(one, BN_value_one(), mont, ctx)) goto err; in ec_GFp_mont_group_set_curve() 240 group->field_data1 = mont; in ec_GFp_mont_group_set_curve() 241 mont = NULL; in ec_GFp_mont_group_set_curve() 258 if (mont != NULL) in ec_GFp_mont_group_set_curve() 259 BN_MONT_CTX_free(mont); in ec_GFp_mont_group_set_curve()
|
/external/openssl/crypto/ec/ |
D | ecp_mont.c | 207 BN_MONT_CTX *mont = NULL; in ec_GFp_mont_group_set_curve() local 229 mont = BN_MONT_CTX_new(); in ec_GFp_mont_group_set_curve() 230 if (mont == NULL) goto err; in ec_GFp_mont_group_set_curve() 231 if (!BN_MONT_CTX_set(mont, p, ctx)) in ec_GFp_mont_group_set_curve() 238 if (!BN_to_montgomery(one, BN_value_one(), mont, ctx)) goto err; in ec_GFp_mont_group_set_curve() 240 group->field_data1 = mont; in ec_GFp_mont_group_set_curve() 241 mont = NULL; in ec_GFp_mont_group_set_curve() 258 if (mont != NULL) in ec_GFp_mont_group_set_curve() 259 BN_MONT_CTX_free(mont); in ec_GFp_mont_group_set_curve()
|
/external/openssl/crypto/dh/ |
D | dh_key.c | 123 BN_MONT_CTX *mont=NULL; in generate_key() local 149 mont = BN_MONT_CTX_set_locked(&dh->method_mont_p, in generate_key() 151 if (!mont) in generate_key() 187 if (!dh->meth->bn_mod_exp(dh, pub_key, dh->g, prk, dh->p, ctx, mont)) goto err; in generate_key() 206 BN_MONT_CTX *mont=NULL; in compute_key() local 230 mont = BN_MONT_CTX_set_locked(&dh->method_mont_p, in compute_key() 237 if (!mont) in compute_key() 247 if (!dh->meth->bn_mod_exp(dh, tmp, pub_key, dh->priv_key,dh->p,ctx,mont)) in compute_key()
|
/external/chromium_org/third_party/openssl/openssl/crypto/dh/ |
D | dh_key.c | 123 BN_MONT_CTX *mont=NULL; in generate_key() local 149 mont = BN_MONT_CTX_set_locked(&dh->method_mont_p, in generate_key() 151 if (!mont) in generate_key() 187 if (!dh->meth->bn_mod_exp(dh, pub_key, dh->g, prk, dh->p, ctx, mont)) goto err; in generate_key() 206 BN_MONT_CTX *mont=NULL; in compute_key() local 230 mont = BN_MONT_CTX_set_locked(&dh->method_mont_p, in compute_key() 237 if (!mont) in compute_key() 247 if (!dh->meth->bn_mod_exp(dh, tmp, pub_key, dh->priv_key,dh->p,ctx,mont)) in compute_key()
|
/external/chromium_org/third_party/openssl/openssl/crypto/dsa/ |
D | dsa_gen.c | 143 BN_MONT_CTX *mont=NULL; in dsa_builtin_paramgen() local 178 if ((mont=BN_MONT_CTX_new()) == NULL) in dsa_builtin_paramgen() 329 if (!BN_MONT_CTX_set(mont,p,ctx)) goto err; in dsa_builtin_paramgen() 334 if (!BN_mod_exp_mont(g,test,r0,p,ctx,mont)) goto err; in dsa_builtin_paramgen() 368 if (mont != NULL) BN_MONT_CTX_free(mont); in dsa_builtin_paramgen()
|
D | dsa_ossl.c | 312 BN_MONT_CTX *mont=NULL; in dsa_do_verify() local 373 mont = BN_MONT_CTX_set_locked(&dsa->method_mont_p, in dsa_do_verify() 375 if (!mont) in dsa_do_verify() 380 DSA_MOD_EXP(goto err, dsa, &t1, dsa->g, &u1, dsa->pub_key, &u2, dsa->p, ctx, mont); in dsa_do_verify()
|
/external/openssl/crypto/dsa/ |
D | dsa_gen.c | 143 BN_MONT_CTX *mont=NULL; in dsa_builtin_paramgen() local 178 if ((mont=BN_MONT_CTX_new()) == NULL) in dsa_builtin_paramgen() 329 if (!BN_MONT_CTX_set(mont,p,ctx)) goto err; in dsa_builtin_paramgen() 334 if (!BN_mod_exp_mont(g,test,r0,p,ctx,mont)) goto err; in dsa_builtin_paramgen() 368 if (mont != NULL) BN_MONT_CTX_free(mont); in dsa_builtin_paramgen()
|
D | dsa_ossl.c | 330 BN_MONT_CTX *mont=NULL; in dsa_do_verify() local 391 mont = BN_MONT_CTX_set_locked(&dsa->method_mont_p, in dsa_do_verify() 393 if (!mont) in dsa_do_verify() 398 DSA_MOD_EXP(goto err, dsa, &t1, dsa->g, &u1, dsa->pub_key, &u2, dsa->p, ctx, mont); in dsa_do_verify()
|
/external/chromium_org/third_party/openssl/openssl/include/openssl/ |
D | bn.h | 575 BN_MONT_CTX *mont, BN_CTX *ctx); 576 #define BN_to_montgomery(r,a,mont,ctx) BN_mod_mul_montgomery(\ argument 577 (r),(a),&((mont)->RR),(mont),(ctx)) 579 BN_MONT_CTX *mont, BN_CTX *ctx); 580 void BN_MONT_CTX_free(BN_MONT_CTX *mont); 581 int BN_MONT_CTX_set(BN_MONT_CTX *mont,const BIGNUM *mod,BN_CTX *ctx); 611 void BN_set_params(int mul,int high,int low,int mont);
|
/external/openssl/include/openssl/ |
D | bn.h | 577 BN_MONT_CTX *mont, BN_CTX *ctx); 578 #define BN_to_montgomery(r,a,mont,ctx) BN_mod_mul_montgomery(\ argument 579 (r),(a),&((mont)->RR),(mont),(ctx)) 581 BN_MONT_CTX *mont, BN_CTX *ctx); 582 void BN_MONT_CTX_free(BN_MONT_CTX *mont); 583 int BN_MONT_CTX_set(BN_MONT_CTX *mont,const BIGNUM *mod,BN_CTX *ctx); 613 void BN_set_params(int mul,int high,int low,int mont);
|