/freebsd/crypto/libecc/include/libecc/nn/ |
H A D | nn_logical.h | 20 ATTRIBUTE_WARN_UNUSED_RET int nn_rshift_fixedlen(nn_t out, nn_src_t in, bitcnt_t cnt); 21 ATTRIBUTE_WARN_UNUSED_RET int nn_rshift(nn_t out, nn_src_t in, bitcnt_t cnt); 22 ATTRIBUTE_WARN_UNUSED_RET int nn_lshift_fixedlen(nn_t out, nn_src_t in, bitcnt_t cnt); 23 ATTRIBUTE_WARN_UNUSED_RET int nn_lshift(nn_t out, nn_src_t in, bitcnt_t cnt); 24 ATTRIBUTE_WARN_UNUSED_RET int nn_rrot(nn_t out, nn_src_t in, bitcnt_t cnt, bitcnt_t bitlen); 25 ATTRIBUTE_WARN_UNUSED_RET int nn_lrot(nn_t out, nn_src_t in, bitcnt_t cnt, bitcnt_t bitlen); 30 ATTRIBUTE_WARN_UNUSED_RET int nn_clz(nn_src_t A, bitcnt_t *lz); 31 ATTRIBUTE_WARN_UNUSED_RET int nn_bitlen(nn_src_t A, bitcnt_t *blen); 32 ATTRIBUTE_WARN_UNUSED_RET int nn_getbit(nn_src_t in, bitcnt_t bit, u8 *bitval);
|
H A D | nn_div.h | 25 bitcnt_t cnt); 31 ATTRIBUTE_WARN_UNUSED_RET int nn_mod_unshifted(nn_t r, nn_src_t a, nn_src_t b, word_t v, bitcnt_t c…
|
H A D | nn_modinv.h | 21 ATTRIBUTE_WARN_UNUSED_RET int nn_modinv_2exp(nn_t out, nn_src_t in, bitcnt_t exp, int *in_isodd);
|
/freebsd/crypto/libecc/src/nn/ |
H A D | nn_logical.c | 39 int nn_lshift_fixedlen(nn_t out, nn_src_t in, bitcnt_t cnt) in nn_lshift_fixedlen() 42 bitcnt_t lshift, hshift; in nn_lshift_fixedlen() 52 lshift = (bitcnt_t)(WORD_BITS - hshift); in nn_lshift_fixedlen() 94 int nn_lshift(nn_t out, nn_src_t in, bitcnt_t cnt) in nn_lshift() 96 bitcnt_t lshift, hshift, blen; in nn_lshift() 116 lshift = (bitcnt_t)(WORD_BITS - hshift); in nn_lshift() 157 int nn_rshift_fixedlen(nn_t out, nn_src_t in, bitcnt_t cnt) in nn_rshift_fixedlen() 160 bitcnt_t lshift, hshift; in nn_rshift_fixedlen() 170 hshift = (bitcnt_t)(WORD_BITS - lshift); in nn_rshift_fixedlen() 211 int nn_rshift(nn_t out, nn_src_t in, bitcnt_t cnt) in nn_rshift() [all …]
|
H A D | nn_modinv.c | 54 bitcnt_t cnt; in _nn_modinv_odd() 106 cnt = (bitcnt_t)((a.wlen + b.wlen) * WORD_BITS); in _nn_modinv_odd() 108 cnt = (bitcnt_t)(cnt - 1); in _nn_modinv_odd() 314 int nn_modinv_2exp(nn_t _out, nn_src_t x, bitcnt_t exp, int *x_isodd) in nn_modinv_2exp() 316 bitcnt_t cnt; in nn_modinv_2exp() 318 bitcnt_t exp_cnt = exp % WORD_BITS; in nn_modinv_2exp() 334 if (exp == (bitcnt_t)0){ in nn_modinv_2exp() 355 for (; cnt < WORD_MIN(WORD_BITS, exp); cnt = (bitcnt_t)(cnt << 1)) { in nn_modinv_2exp() 381 for (; cnt < ((exp + 1) >> 1); cnt = (bitcnt_t)(cnt << 1)) { in nn_modinv_2exp()
|
H A D | nn_div.h | 25 bitcnt_t cnt); 31 ATTRIBUTE_WARN_UNUSED_RET int nn_mod_unshifted(nn_t r, nn_src_t a, nn_src_t b, word_t v, bitcnt_t c…
|
H A D | nn_rand.c | 98 bitcnt_t q_bit_len, q_len; in nn_get_random_mod() 105 q_len = (bitcnt_t)BYTECEIL(q_bit_len); in nn_get_random_mod()
|
H A D | nn_mod_pow.c | 43 bitcnt_t explen, oldexplen; in _nn_exp_monty_ladder_ltr() 68 ret = nn_getbit(&mask, (bitcnt_t)(explen - 1), &rbit); EG(ret, err); in _nn_exp_monty_ladder_ltr() 102 explen = (bitcnt_t)(explen - 1); in _nn_exp_monty_ladder_ltr() 105 explen = (bitcnt_t)(explen - 1); in _nn_exp_monty_ladder_ltr()
|
H A D | nn_div.c | 410 word_t v, bitcnt_t cnt) in _nn_divrem_unshifted() 489 word_t v, bitcnt_t cnt) in _nn_divrem_unshifted_aliased() 513 word_t v, bitcnt_t cnt) in nn_divrem_unshifted() 543 int nn_mod_unshifted(nn_t r, nn_src_t a, nn_src_t b, word_t v, bitcnt_t cnt) in nn_mod_unshifted() 796 bitcnt_t p_rounded_bitlen, p_bitlen; in nn_compute_div_coefs() 825 p_rounded_bitlen = (bitcnt_t)(WORD_BITS * p.wlen); in nn_compute_div_coefs() 832 ret = nn_lshift(p_normalized, &p, (bitcnt_t)(*p_shift)); EG(ret, err); in nn_compute_div_coefs() 842 …ret = nn_rshift(&tmp_nn, p_normalized, (bitcnt_t)(p_rounded_bitlen - (2 * WORDSIZE))); EG(ret, err… in nn_compute_div_coefs() 875 bitcnt_t cnt; in _nn_divrem()
|
/freebsd/crypto/libecc/include/libecc/fp/ |
H A D | fp.h | 38 bitcnt_t p_bitlen; 50 bitcnt_t p_shift; 63 ATTRIBUTE_WARN_UNUSED_RET int fp_ctx_init(fp_ctx_t ctx, nn_src_t p, bitcnt_t p_bitlen, 66 bitcnt_t p_shift, nn_src_t p_normalized, word_t p_reciprocal);
|
/freebsd/crypto/libecc/src/examples/sig/common/ |
H A D | common.h | 12 bitcnt_t blen; in _i2osp() 109 bitcnt_t msb_bit_len, q_bitlen; in _fix_scalar_msb() 120 bitcnt_t msb_bit_len, q_square_bitlen; in _fix_scalar_msb() 181 bitcnt_t explen; in _nn_mod_pow_insecure() 222 explen = (bitcnt_t)(explen - 1); in _nn_mod_pow_insecure()
|
/freebsd/crypto/libecc/src/sig/ |
H A D | ecdsa_common.c | 48 ATTRIBUTE_WARN_UNUSED_RET static int __ecdsa_rfc6979_nonce(nn_t k, nn_src_t q, bitcnt_t q_bit_len, in __ecdsa_rfc6979_nonce() 58 bitcnt_t t_bit_len; in __ecdsa_rfc6979_nonce() 91 ret = nn_rshift(k, k, (bitcnt_t)((8 * hsize) - q_bit_len)); EG(ret, err); in __ecdsa_rfc6979_nonce() 143 t_bit_len = (bitcnt_t)(t_bit_len + (8 * hmac_size)); in __ecdsa_rfc6979_nonce() 147 ret = nn_rshift(k, k, (bitcnt_t)((8 * q_len) - q_bit_len)); EG(ret, err); in __ecdsa_rfc6979_nonce() 325 bitcnt_t rshift, q_bit_len; in __ecdsa_sign_finalize() 400 rshift = (bitcnt_t)((hsize * 8) - q_bit_len); in __ecdsa_sign_finalize() 622 bitcnt_t q_bit_len; in __ecdsa_verify_init() 710 bitcnt_t rshift, q_bit_len; in __ecdsa_verify_finalize() 762 rshift = (bitcnt_t)((hsize * 8) - q_bit_len); in __ecdsa_verify_finalize() [all …]
|
H A D | fuzzing_ecgdsa.c | 49 bitcnt_t q_bit_len, p_bit_len, rshift; in ecgdsa_sign_raw() 114 rshift = (bitcnt_t)((hsize * 8) - q_bit_len); in ecgdsa_sign_raw() 265 bitcnt_t q_bit_len, rshift; in ecgdsa_verify_raw() 318 rshift = (bitcnt_t)((hsize * 8) - q_bit_len); in ecgdsa_verify_raw()
|
H A D | fuzzing_ecdsa.c | 47 bitcnt_t rshift, q_bit_len; in ecdsa_sign_raw() 117 rshift = (bitcnt_t)((hsize * 8) - q_bit_len); in ecdsa_sign_raw() 285 bitcnt_t rshift, q_bit_len; in ecdsa_verify_raw() 346 rshift = (bitcnt_t)((hsize * 8) - q_bit_len); in ecdsa_verify_raw()
|
H A D | ecgdsa.c | 188 bitcnt_t q_bit_len, p_bit_len, rshift; in _ecgdsa_sign_finalize() 255 rshift = (bitcnt_t)((hsize * 8) - q_bit_len); in _ecgdsa_sign_finalize() 417 bitcnt_t q_bit_len; in _ecgdsa_verify_init() 509 bitcnt_t q_bit_len, rshift; in _ecgdsa_verify_finalize() 553 rshift = (bitcnt_t)((hsize * 8) - q_bit_len); in _ecgdsa_verify_finalize()
|
H A D | bign_common.c | 200 ATTRIBUTE_WARN_UNUSED_RET static int __bign_determinitic_nonce(nn_t k, nn_src_t q, bitcnt_t q_bit_l… in __bign_determinitic_nonce() 477 bitcnt_t q_bit_len, p_bit_len; in __bign_sign_finalize() 661 ret = nn_lshift(&tmp, &tmp, (bitcnt_t)(8*l)); EG(ret, err); in __bign_sign_finalize() 745 bitcnt_t q_bit_len; in __bign_verify_init() 852 bitcnt_t p_bit_len, q_bit_len; in __bign_verify_finalize() 926 ret = nn_lshift(&tmp, &tmp, (bitcnt_t)(8*l)); EG(ret, err); in __bign_verify_finalize()
|
/freebsd/crypto/libecc/src/arithmetic_tests/ |
H A D | arithmetic_tests.c | 643 NN_T_GENERIC_OUT(0), NN_T_GENERIC_IN(1), (bitcnt_t)UINT_GENERIC_IN(2)) 646 NN_T_GENERIC_OUT(0), NN_T_GENERIC_IN(1), (bitcnt_t)UINT_GENERIC_IN(2)) 649 NN_T_GENERIC_OUT(0), NN_T_GENERIC_IN(1), (bitcnt_t)UINT_GENERIC_IN(2)) 652 NN_T_GENERIC_OUT(0), NN_T_GENERIC_IN(1), (bitcnt_t)UINT_GENERIC_IN(2)) 655 …NN_T_GENERIC_OUT(0), NN_T_GENERIC_IN(1), (bitcnt_t)UINT_GENERIC_IN(2), (bitcnt_t)UINT_GENERIC_IN(3… 658 …NN_T_GENERIC_OUT(0), NN_T_GENERIC_IN(1), (bitcnt_t)UINT_GENERIC_IN(2), (bitcnt_t)UINT_GENERIC_IN(3… 1083 if((bitcnt_t)fp_ctx_pshift.val[0] != fp_ctx_param.p_shift){ in main() 1085 printf("Imported mpinv from modulus=%d", (bitcnt_t)fp_ctx_pshift.val[0]); in main()
|
/freebsd/crypto/libecc/src/fp/ |
H A D | fp.c | 54 int fp_ctx_init(fp_ctx_t ctx, nn_src_t p, bitcnt_t p_bitlen, in fp_ctx_init() 57 bitcnt_t p_shift, nn_src_t p_normalized, word_t p_reciprocal) in fp_ctx_init() 91 bitcnt_t p_bitlen; in fp_ctx_init_from_p() 118 mpinv, (bitcnt_t)p_shift, &p_normalized, p_reciprocal); in fp_ctx_init_from_p()
|
/freebsd/crypto/libecc/src/curves/ |
H A D | ec_params.c | 78 (bitcnt_t)(tmp_p_bitlen.val[0]), in import_params() 80 tmp_mpinv.val[0], (bitcnt_t)tmp_p_shift.val[0], in import_params() 107 out_params->ec_gen_order_bitlen = (bitcnt_t)(tmp_order_bitlen.val[0]); in import_params()
|
H A D | prj_pt.c | 1321 bitcnt_t mlen; in _prj_pt_mul_ltr_monty_dbl_add_always() 1342 bitcnt_t msb_bit_len, order_bitlen; in _prj_pt_mul_ltr_monty_dbl_add_always() 1353 bitcnt_t msb_bit_len, curve_order_square_bitlen; in _prj_pt_mul_ltr_monty_dbl_add_always() 1468 bitcnt_t mlen; in _prj_pt_mul_ltr_monty_dbl_add_always() 1489 bitcnt_t msb_bit_len, order_bitlen; in _prj_pt_mul_ltr_monty_dbl_add_always() 1500 bitcnt_t msb_bit_len, curve_order_square_bitlen; in _prj_pt_mul_ltr_monty_dbl_add_always() 1573 bitcnt_t mlen; in _prj_pt_mul_ltr_monty_ladder() 1596 bitcnt_t msb_bit_len, order_bitlen; in _prj_pt_mul_ltr_monty_ladder() 1607 bitcnt_t msb_bit_len, curve_order_square_bitlen; in _prj_pt_mul_ltr_monty_ladder() 1838 bitcnt_t explen; in __prj_pt_unprotected_mult() [all …]
|
/freebsd/crypto/libecc/src/examples/sig/gostr34_10_94/ |
H A D | gostr34_10_94.c | 92 bitcnt_t N, rshift; in gostr34_10_94_sign() 177 rshift = (bitcnt_t)((hlen * 8) - N); in gostr34_10_94_sign() 255 bitcnt_t N, rshift; in gostr34_10_94_verify() 313 rshift = (bitcnt_t)((hlen * 8) - N); in gostr34_10_94_verify()
|
/freebsd/crypto/libecc/include/libecc/curves/ |
H A D | ec_params.h | 66 bitcnt_t ec_gen_order_bitlen;
|
/freebsd/crypto/libecc/src/examples/sig/dsa/ |
H A D | dsa.c | 200 bitcnt_t N, rshift; in dsa_sign() 282 rshift = (bitcnt_t)((hlen * 8) - N); in dsa_sign() 357 bitcnt_t N, rshift; in dsa_verify() 412 rshift = (bitcnt_t)((hlen * 8) - N); in dsa_verify()
|
/freebsd/crypto/libecc/src/examples/basic/ |
H A D | nn_miller_rabin.c | 49 bitcnt_t k; in miller_rabin() 135 bitcnt_t blen; in miller_rabin()
|
/freebsd/crypto/libecc/include/libecc/words/ |
H A D | words.h | 71 typedef u16 bitcnt_t; typedef
|