| /freebsd/crypto/libecc/include/libecc/words/ |
| H A D | words.h | 79 #define WLSHIFT(w, c) ((word_t)(((c) >= WORD_BITS) ? WORD(0) : (word_t)((w) << (c)))) 80 #define WRSHIFT(w, c) ((word_t)(((c) >= WORD_BITS) ? WORD(0) : (word_t)((w) >> (c)))) 89 #define WORD_MASK_IFZERO(w) ((word_t)(((word_t)((w) != 0)) - WORD(1))) 90 #define WORD_MASK_IFNOTZERO(w) ((word_t)(((word_t)((w) == 0)) - WORD(1))) 99 word_t in1h, in1l, in2h, in2l; \ 100 word_t tmph, tmpm, tmpl; \ 101 word_t tmpm1, tmpm2; \ 102 word_t carrym, carryl; \ 109 tmpl = (word_t)(in2l * in1l); \ 111 tmpm1 = (word_t)(in2h * in1l); \ [all …]
|
| /freebsd/crypto/libecc/src/nn/ |
| H A D | nn_div.c | 76 u8 shift, word_t *borrow) in _nn_cnd_sub_shift() 78 word_t tmp, borrow1, borrow2, _borrow = WORD(0); in _nn_cnd_sub_shift() 79 word_t mask = WORD_MASK_IFNOTZERO(cnd); in _nn_cnd_sub_shift() 91 tmp = (word_t)(out->val[shift + i] - (in->val[i] & mask)); in _nn_cnd_sub_shift() 92 borrow1 = (word_t)(tmp > out->val[shift + i]); in _nn_cnd_sub_shift() 93 out->val[shift + i] = (word_t)(tmp - _borrow); in _nn_cnd_sub_shift() 94 borrow2 = (word_t)(out->val[shift + i] > tmp); in _nn_cnd_sub_shift() 96 _borrow = (word_t)(borrow1 | borrow2); in _nn_cnd_sub_shift() 114 ATTRIBUTE_WARN_UNUSED_RET static int _nn_submul_word_shift(nn_t out, nn_src_t in, word_t w, u8 shif… in _nn_submul_word_shift() 115 word_t *borrow) in _nn_submul_word_shift() [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() 44 word_t _mpinv; in nn_compute_redc1_coefs() 125 word_t mpinv) in _nn_mul_redc1() 127 word_t prod_high, prod_low, carry, acc, m; in _nn_mul_redc1() 179 prod_low = (word_t)(prod_low + carry); in _nn_mul_redc1() 180 prod_high = (word_t)(prod_high + (prod_low < carry)); in _nn_mul_redc1() 181 out->val[j] = (word_t)(out->val[j] + prod_low); in _nn_mul_redc1() 182 carry = (word_t)(prod_high + (out->val[j] < prod_low)); in _nn_mul_redc1() 185 out->val[j] = (word_t)(out->val[j] + carry); in _nn_mul_redc1() 186 carry = (word_t)(out->val[j] < carry); in _nn_mul_redc1() [all …]
|
| H A D | nn_div.h | 24 ATTRIBUTE_WARN_UNUSED_RET int nn_divrem_unshifted(nn_t q, nn_t r, nn_src_t a, nn_src_t b, word_t v, 26 ATTRIBUTE_WARN_UNUSED_RET int nn_divrem_normalized(nn_t q, nn_t r, nn_src_t a, nn_src_t b, word_t v… 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… 32 ATTRIBUTE_WARN_UNUSED_RET int nn_mod_normalized(nn_t r, nn_src_t a, nn_src_t b, word_t v); 35 ATTRIBUTE_WARN_UNUSED_RET int wreciprocal(word_t dh, word_t dl, word_t *reciprocal); 36 ATTRIBUTE_WARN_UNUSED_RET int nn_compute_div_coefs(nn_t p_normalized, word_t *p_shift, 37 word_t *p_reciprocal, nn_src_t p_in);
|
| H A D | nn_add.c | 61 word_t *carry) in _nn_cnd_add() 63 word_t tmp, carry1, carry2, _carry = WORD(0); in _nn_cnd_add() 64 word_t mask = WORD_MASK_IFNOTZERO(cnd); in _nn_cnd_add() 82 tmp = (word_t)(in1->val[i] + (in2->val[i] & mask)); in _nn_cnd_add() 83 carry1 = (word_t)(tmp < in1->val[i]); in _nn_cnd_add() 84 out->val[i] = (word_t)(tmp + _carry); in _nn_cnd_add() 85 carry2 = (word_t)(out->val[i] < tmp); in _nn_cnd_add() 87 _carry = (word_t)(carry1 | carry2); in _nn_cnd_add() 121 word_t carry; in nn_cnd_add() 179 ATTRIBUTE_WARN_UNUSED_RET static int nn_add_word(nn_t out, nn_src_t in1, word_t w) in nn_add_word() [all …]
|
| H A D | nn.c | 33 #define NN_MAGIC ((word_t)((0xb4cf5d56e2023316ULL ^ (WORD(NN_MAX_WORD_LEN + WORDSIZE))))) 49 word_t val = 0; in __nn_is_wlen_consistent() 145 int nn_set_word_value(nn_t A, word_t val) in nn_set_word_value() 176 word_t mask = WORD_MASK_IFNOTZERO(cnd); in nn_cnd_swap() 178 word_t t, r; in nn_cnd_swap() 179 volatile word_t r_mask; in nn_cnd_swap() 199 word_t local_mask = WORD_MASK_IFNOTZERO((i < len)); in nn_cnd_swap() 205 t = (word_t)(((in1->wlen ^ in2->wlen) & mask) ^ r_mask); in nn_cnd_swap() 232 A->val[i] = (word_t)(A->val[i] & WORD_MASK_IFZERO((i >= new_wlen))); in nn_set_wlen() 321 int nn_cmp_word(nn_src_t in, word_t w, int *cmp) in nn_cmp_word() [all …]
|
| H A D | nn_mul.c | 47 word_t carry, prod_high, prod_low; in _nn_mul_low() 81 prod_low = (word_t)(prod_low + carry); in _nn_mul_low() 82 prod_high = (word_t)(prod_high + (prod_low < carry)); in _nn_mul_low() 88 out->val[pos] = (word_t)(out->val[pos] + prod_low); in _nn_mul_low() 89 carry = (word_t)(prod_high + (out->val[pos] < prod_low)); in _nn_mul_low() 97 out->val[pos + 1] = (word_t)(out->val[pos + 1] + carry); in _nn_mul_low() 182 int nn_mul_word(nn_t out, nn_src_t in, word_t w) in nn_mul_word()
|
| H A D | nn_logical.c | 55 word_t hipart = 0, lopart = 0; in nn_lshift_fixedlen() 119 word_t hipart = 0, lopart = 0; in nn_lshift() 173 word_t hipart = 0, lopart = 0; in nn_rshift_fixedlen() 240 word_t hipart = 0, lopart = 0; in nn_rshift() 298 word_t mask = (word_t)(((word_t)(WORD(1) << (bitlen % WORD_BITS))) - 1); in nn_rrot() 337 word_t mask = (word_t)(((word_t)(WORD(1) << (bitlen % WORD_BITS))) - 1); in nn_lrot() 477 A->val[i] = (word_t)(~(B->val[i])); in nn_not() 485 ATTRIBUTE_WARN_UNUSED_RET static u8 wclz(word_t A) in wclz()
|
| 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() 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() 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() 244 …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() 307 word_t mpinv; in nn_mod_pow()
|
| /freebsd/crypto/libecc/include/libecc/nn/ |
| H A D | nn_div.h | 24 ATTRIBUTE_WARN_UNUSED_RET int nn_divrem_unshifted(nn_t q, nn_t r, nn_src_t a, nn_src_t b, word_t v, 26 ATTRIBUTE_WARN_UNUSED_RET int nn_divrem_normalized(nn_t q, nn_t r, nn_src_t a, nn_src_t b, word_t v… 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… 32 ATTRIBUTE_WARN_UNUSED_RET int nn_mod_normalized(nn_t r, nn_src_t a, nn_src_t b, word_t v); 35 ATTRIBUTE_WARN_UNUSED_RET int wreciprocal(word_t dh, word_t dl, word_t *reciprocal); 36 ATTRIBUTE_WARN_UNUSED_RET int nn_compute_div_coefs(nn_t p_normalized, word_t *p_shift, 37 word_t *p_reciprocal, nn_src_t p_in);
|
| H A D | nn.h | 68 word_t val[BIT_LEN_WORDS(NN_MAX_BIT_LEN)]; 69 word_t magic; 80 ATTRIBUTE_WARN_UNUSED_RET int nn_set_word_value(nn_t A, word_t val); 89 ATTRIBUTE_WARN_UNUSED_RET int nn_cmp_word(nn_src_t in, word_t w, int *cmp);
|
| H A D | nn_mul_redc1.h | 21 word_t *mpinv); 23 word_t mpinv);
|
| H A D | nn_modinv.h | 22 ATTRIBUTE_WARN_UNUSED_RET int nn_modinv_word(nn_t out, word_t w, nn_src_t m); 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/contrib/llvm-project/llvm/include/llvm/Bitstream/ |
| H A D | BitstreamReader.h | 90 using word_t = size_t; 93 word_t CurWord = 0; 129 size_t ByteNo = size_t(BitNo/8) & ~(sizeof(word_t)-1); in JumpToBit() 130 unsigned WordBitNo = unsigned(BitNo & (sizeof(word_t)*8-1)); in JumpToBit() 139 if (Expected<word_t> Res = Read(WordBitNo)) in JumpToBit() 170 if (BitcodeBytes.size() >= NextChar + sizeof(word_t)) { in fillCurWord() 171 BytesRead = sizeof(word_t); in fillCurWord() 173 support::endian::read<word_t, llvm::endianness::little>(NextCharPtr); in fillCurWord() 186 Expected<word_t> Read(unsigned NumBits) { in Read() 187 static const unsigned BitsInWord = sizeof(word_t) * 8; in Read() [all …]
|
| /freebsd/crypto/libecc/include/libecc/fp/ |
| H A D | fp.h | 41 word_t mpinv; 54 word_t p_reciprocal; 56 word_t magic; 65 word_t mpinv, 66 bitcnt_t p_shift, nn_src_t p_normalized, word_t p_reciprocal); 76 word_t magic; 89 ATTRIBUTE_WARN_UNUSED_RET int fp_set_word_value(fp_t out, word_t val);
|
| /freebsd/crypto/openssl/crypto/ec/curve448/ |
| H A D | f_generic.c | 87 … x->limb[LIMBPERM(i)] = (word_t)((i < NLIMBS - 1) ? buffer & LIMB_MASK(LIMBPERM(i)) : buffer); in gf_deserialize() 90 … scarry = (scarry + x->limb[LIMBPERM(i)] - MODULUS->limb[LIMBPERM(i)]) >> (8 * sizeof(word_t)); in gf_deserialize() 93 return succ & word_is_zero((word_t)buffer) & ~word_is_zero((word_t)scarry); in gf_deserialize() 100 word_t scarry_0; in gf_strong_reduce() 124 scarry_0 = (word_t)scarry; in gf_strong_reduce() 133 assert(carry < 2 && ((word_t)carry + scarry_0) == 0); in gf_strong_reduce()
|
| H A D | word.h | 29 typedef uint64_t word_t, mask_t; typedef 35 typedef uint32_t word_t, mask_t; typedef 81 ret |= ~word_is_zero(m >> (i * 8 * sizeof(word_t))); in bool_to_mask()
|
| /freebsd/crypto/libecc/src/fp/ |
| H A D | fp.c | 24 #define FP_CTX_MAGIC ((word_t)(0x114366fc34955125ULL)) 56 word_t mpinv, in fp_ctx_init() 57 bitcnt_t p_shift, nn_src_t p_normalized, word_t p_reciprocal) in fp_ctx_init() 90 word_t mpinv, p_shift, p_reciprocal; in fp_ctx_init_from_p() 129 #define FP_MAGIC ((word_t)(0x14e96c8ab28221efULL)) 248 word_t val; in fp_one() 266 int fp_set_word_value(fp_t out, word_t val) in fp_set_word_value() 369 word_t mask; in fp_tabselect()
|
| /freebsd/crypto/libecc/include/libecc/sig/ |
| H A D | ec_key.h | 39 #define PRIV_KEY_MAGIC ((word_t)(0x2feb91e938a4855dULL)) 58 word_t magic; 119 #define PUB_KEY_MAGIC ((word_t)(0x31327f37741ffb76ULL)) 130 word_t magic;
|
| /freebsd/crypto/libecc/src/examples/hash/ |
| H A D | md2.h | 22 #define MD2_HASH_MAGIC ((word_t)(0x8432927137264770ULL)) 36 word_t magic;
|
| /freebsd/crypto/libecc/include/libecc/hash/ |
| H A D | hmac.h | 11 #define HMAC_MAGIC ((word_t)(0x9849020187612083ULL)) 23 word_t magic;
|
| H A D | sha256.h | 56 #define SHA256_HASH_MAGIC ((word_t)(0x11299a2b32098412ULL)) 68 word_t magic;
|
| H A D | sm3.h | 50 #define SM3_HASH_MAGIC ((word_t)(0x2947510312849204ULL)) 62 word_t magic;
|
| H A D | sha384.h | 56 #define SHA384_HASH_MAGIC ((word_t)(0x9227239b32098412ULL)) 68 word_t magic;
|
| H A D | ripemd160.h | 50 #define RIPEMD160_HASH_MAGIC ((word_t)(0x7392018463926719ULL)) 62 word_t magic;
|