/freebsd/crypto/libecc/src/nn/ |
H A D | nn_mod_pow.c | 39 …r(nn_t out, nn_src_t base, nn_src_t exp, nn_src_t mod, nn_src_t r, nn_src_t r_square, word_t mpinv) in _nn_exp_monty_ladder_ltr() argument 77 ret = nn_mul_redc1(&T[rbit], &T[rbit], r_square, mod, mpinv); EG(ret, err); in _nn_exp_monty_ladder_ltr() 83 ret = nn_mul_redc1(&T[rbit], base, r_square, mod, mpinv); EG(ret, err); in _nn_exp_monty_ladder_ltr() 94 ret = nn_mul_redc1(&T[1-rbit], &T[rbit], &T[rbit], mod, mpinv); EG(ret, err); in _nn_exp_monty_ladder_ltr() 114 ret = nn_mul_redc1(&T[2], &T[expbit ^ rbit], &T[expbit ^ rbit], mod, mpinv); EG(ret, err); in _nn_exp_monty_ladder_ltr() 121 ret = nn_mul_redc1(&T[1], &T[0], &T[1], mod, mpinv); EG(ret, err); in _nn_exp_monty_ladder_ltr() 135 ret = nn_mul_redc1(&T[rbit], &T[rbit], &T[1 - rbit], mod, mpinv); EG(ret, err); in _nn_exp_monty_ladder_ltr() 174 …c(nn_t out, nn_src_t base, nn_src_t exp, nn_src_t mod, nn_src_t r, nn_src_t r_square, word_t mpinv) in _nn_mod_pow_redc() argument 176 return _nn_exp_monty_ladder_ltr(out, base, exp, mod, r, r_square, mpinv); in _nn_mod_pow_redc() 222 …d(nn_t out, nn_src_t base, nn_src_t exp, nn_src_t mod, nn_src_t r, nn_src_t r_square, word_t mpinv) in _nn_mod_pow_redc_aliased() argument [all …]
|
H A D | nn_mul_redc1.c | 40 int nn_compute_redc1_coefs(nn_t r, nn_t r_square, nn_src_t p_in, word_t *mpinv) in nn_compute_redc1_coefs() argument 51 MUST_HAVE((mpinv != NULL), ret, err); in nn_compute_redc1_coefs() 98 (*mpinv) = _mpinv; in nn_compute_redc1_coefs() 125 word_t mpinv) in _nn_mul_redc1() argument 191 m = (word_t)(out->val[0] * mpinv); in _nn_mul_redc1() 226 nn_src_t p, word_t mpinv) in _nn_mul_redc1_aliased() argument 232 ret = _nn_mul_redc1(&out_cpy, in1, in2, p, mpinv); EG(ret, err); in _nn_mul_redc1_aliased() 247 word_t mpinv) in nn_mul_redc1() argument 257 ret = _nn_mul_redc1_aliased(out, in1, in2, p, mpinv); in nn_mul_redc1() 259 ret = _nn_mul_redc1(out, in1, in2, p, mpinv); in nn_mul_redc1() [all …]
|
/freebsd/crypto/libecc/src/examples/sig/common/ |
H A D | common.h | 184 word_t mpinv; in _nn_mod_pow_insecure() local 204 ret = nn_compute_redc1_coefs(&r, &r_square, mod, &mpinv); EG(ret, err); in _nn_mod_pow_insecure() 215 ret = nn_mul_redc1(&_base, &_base, &r_square, mod, mpinv); EG(ret, err); in _nn_mod_pow_insecure() 228 ret = nn_mul_redc1(out, out, out, mod, mpinv); EG(ret, err); in _nn_mod_pow_insecure() 232 ret = nn_mul_redc1(out, out, &_base, mod, mpinv); EG(ret, err); in _nn_mod_pow_insecure() 236 ret = nn_mul_redc1(out, out, &one, mod, mpinv); in _nn_mod_pow_insecure()
|
/freebsd/crypto/libecc/include/libecc/nn/ |
H A D | nn_mul_redc1.h | 21 word_t *mpinv); 23 word_t mpinv);
|
H A D | nn_mod_pow.h | 20 …(nn_t out, nn_src_t base, nn_src_t exp, nn_src_t mod, nn_src_t r, nn_src_t r_square, word_t mpinv);
|
H A D | nn_modinv.h | 24 …_modinv_fermat_redc(nn_t out, nn_src_t x, nn_src_t p, nn_src_t r, nn_src_t r_square, word_t mpinv);
|
/freebsd/crypto/libecc/src/fp/ |
H A D | fp.c | 56 word_t mpinv, in fp_ctx_init() argument 69 ctx->mpinv = mpinv; in fp_ctx_init() 90 word_t mpinv, p_shift, p_reciprocal; in fp_ctx_init_from_p() local 114 ret = nn_compute_redc1_coefs(&r, &r_square, &p, &mpinv); EG(ret, err); in fp_ctx_init_from_p() 118 mpinv, (bitcnt_t)p_shift, &p_normalized, p_reciprocal); in fp_ctx_init_from_p()
|
H A D | fp_pow.c | 31 …al), &(base->fp_val), exp, &(out->ctx->p), &(out->ctx->r), &(out->ctx->r_square), out->ctx->mpinv); in _fp_pow()
|
H A D | fp_mul_redc1.c | 28 return nn_mul_redc1(out, in1, in2, &(ctx->p), ctx->mpinv); in _fp_mul_redc1()
|
/freebsd/crypto/libecc/src/arithmetic_tests/ |
H A D | arithmetic_tests_generator.py | 1117 mpinv = 2**wlen - (modinv(nn_p, 2**wlen)) 1118 return r, r_square, mpinv 1702 nn_r, nn_r_square, mpinv = compute_monty_coef(nn_mod, getwlenbitlen(nn_mod, wlen)) 1712 …_int_string(nn_in1, wlen), format_int_string(nn_in2, wlen), format_int_string(nn_mod, wlen), mpinv) 1725 nn_r, nn_r_square, mpinv = compute_monty_coef(nn_mod, 2*getwlenbitlen(nn_mod, wlen)) 1727 nn_r, nn_r_square, mpinv = compute_monty_coef(nn_mod, getwlenbitlen(nn_mod, wlen)) 1730 …t_string(nn_r, wlen), format_int_string(nn_r_square, wlen), format_int_string(nn_mod, wlen), mpinv) 1760 nn_r, nn_r_square, mpinv = compute_monty_coef(nn_p, nn_nbits) 1764 return ("%s%s%s%s%s%s%s" % (f % nn_p, f % nn_r, f % nn_r_square, fmpinv % mpinv, 1846 nn_r, nn_r_square, mpinv = compute_monty_coef(nn_p, 2*getwlenbitlen(nn_p, wlen)) [all …]
|
/freebsd/crypto/libecc/include/libecc/fp/ |
H A D | fp.h | 41 word_t mpinv; member 65 word_t mpinv,
|
/freebsd/crypto/libecc/include/libecc/curves/known/ |
H A D | ec_params_external.h | 59 const ec_str_param *mpinv; member
|
H A D | ec_params_secp256r1.h | 180 .mpinv = &secp256r1_mpinv_str_param,
|
H A D | ec_params_gost512.h | 239 .mpinv = &GOST_512bits_curve_mpinv_str_param,
|
H A D | ec_params_brainpoolp512r1.h | 230 .mpinv = &brainpoolp512r1_mpinv_str_param,
|
H A D | ec_params_brainpoolp384r1.h | 218 .mpinv = &brainpoolp384r1_mpinv_str_param,
|
H A D | ec_params_secp384r1.h | 204 .mpinv = &secp384r1_mpinv_str_param,
|
H A D | ec_params_gost256.h | 186 .mpinv = &GOST_256bits_curve_mpinv_str_param,
|
H A D | ec_params_frp256v1.h | 186 .mpinv = &frp256v1_mpinv_str_param,
|
H A D | ec_params_brainpoolp256r1.h | 180 .mpinv = &brainpoolp256r1_mpinv_str_param,
|
H A D | ec_params_secp521r1.h | 280 .mpinv = &secp521r1_mpinv_str_param,
|
H A D | ec_params_brainpoolp224r1.h | 248 .mpinv = &brainpoolp224r1_mpinv_str_param,
|
H A D | ec_params_secp224r1.h | 241 .mpinv = &secp224r1_mpinv_str_param,
|
/freebsd/crypto/libecc/src/utils/ |
H A D | print_fp.c | 29 (long unsigned int)ctx->mpinv); in fp_ctx_print()
|
/freebsd/crypto/libecc/src/curves/ |
H A D | ec_params.c | 61 PARAM_BUF_PTR(in_str_params->mpinv), in import_params() 62 PARAM_BUF_LEN(in_str_params->mpinv)); EG(ret, err); in import_params()
|