Lines Matching refs:in

310 static void bin28_to_felem(felem out, const u8 in[28])  in bin28_to_felem()
312 out[0] = *((const limb *)(in)) & 0x00ffffffffffffff; in bin28_to_felem()
313 out[1] = (*((const limb_aX *)(in + 7))) & 0x00ffffffffffffff; in bin28_to_felem()
314 out[2] = (*((const limb_aX *)(in + 14))) & 0x00ffffffffffffff; in bin28_to_felem()
315 out[3] = (*((const limb_aX *)(in + 20))) >> 8; in bin28_to_felem()
318 static void felem_to_bin28(u8 out[28], const felem in) in felem_to_bin28() argument
322 out[i] = in[0] >> (8 * i); in felem_to_bin28()
323 out[i + 7] = in[1] >> (8 * i); in felem_to_bin28()
324 out[i + 14] = in[2] >> (8 * i); in felem_to_bin28()
325 out[i + 21] = in[3] >> (8 * i); in felem_to_bin28()
349 static BIGNUM *felem_to_BN(BIGNUM *out, const felem in) in felem_to_BN() argument
352 felem_to_bin28(b_out, in); in felem_to_BN()
375 static void felem_assign(felem out, const felem in) in felem_assign() argument
377 out[0] = in[0]; in felem_assign()
378 out[1] = in[1]; in felem_assign()
379 out[2] = in[2]; in felem_assign()
380 out[3] = in[3]; in felem_assign()
384 static void felem_sum(felem out, const felem in) in felem_sum() argument
386 out[0] += in[0]; in felem_sum()
387 out[1] += in[1]; in felem_sum()
388 out[2] += in[2]; in felem_sum()
389 out[3] += in[3]; in felem_sum()
394 static void felem_diff(felem out, const felem in) in felem_diff() argument
407 out[0] -= in[0]; in felem_diff()
408 out[1] -= in[1]; in felem_diff()
409 out[2] -= in[2]; in felem_diff()
410 out[3] -= in[3]; in felem_diff()
415 static void widefelem_diff(widefelem out, const widefelem in) in widefelem_diff() argument
432 out[0] -= in[0]; in widefelem_diff()
433 out[1] -= in[1]; in widefelem_diff()
434 out[2] -= in[2]; in widefelem_diff()
435 out[3] -= in[3]; in widefelem_diff()
436 out[4] -= in[4]; in widefelem_diff()
437 out[5] -= in[5]; in widefelem_diff()
438 out[6] -= in[6]; in widefelem_diff()
443 static void felem_diff_128_64(widefelem out, const felem in) in felem_diff_128_64() argument
458 out[0] -= in[0]; in felem_diff_128_64()
459 out[1] -= in[1]; in felem_diff_128_64()
460 out[2] -= in[2]; in felem_diff_128_64()
461 out[3] -= in[3]; in felem_diff_128_64()
492 static void felem_square(widefelem out, const felem in) in felem_square() argument
495 tmp0 = 2 * in[0]; in felem_square()
496 tmp1 = 2 * in[1]; in felem_square()
497 tmp2 = 2 * in[2]; in felem_square()
498 out[0] = ((widelimb) in[0]) * in[0]; in felem_square()
499 out[1] = ((widelimb) in[0]) * tmp1; in felem_square()
500 out[2] = ((widelimb) in[0]) * tmp2 + ((widelimb) in[1]) * in[1]; in felem_square()
501 out[3] = ((widelimb) in[3]) * tmp0 + ((widelimb) in[1]) * tmp2; in felem_square()
502 out[4] = ((widelimb) in[3]) * tmp1 + ((widelimb) in[2]) * in[2]; in felem_square()
503 out[5] = ((widelimb) in[3]) * tmp2; in felem_square()
504 out[6] = ((widelimb) in[3]) * in[3]; in felem_square()
526 static void felem_reduce(felem out, const widefelem in) in felem_reduce() argument
537 output[0] = in[0] + two127p15; in felem_reduce()
538 output[1] = in[1] + two127m71m55; in felem_reduce()
539 output[2] = in[2] + two127m71; in felem_reduce()
540 output[3] = in[3]; in felem_reduce()
541 output[4] = in[4]; in felem_reduce()
544 output[4] += in[6] >> 16; in felem_reduce()
545 output[3] += (in[6] & 0xffff) << 40; in felem_reduce()
546 output[2] -= in[6]; in felem_reduce()
548 output[3] += in[5] >> 16; in felem_reduce()
549 output[2] += (in[5] & 0xffff) << 40; in felem_reduce()
550 output[1] -= in[5]; in felem_reduce()
590 static void felem_square_reduce(felem out, const felem in) in felem_square_reduce() argument
593 felem_square(tmp, in); in felem_square_reduce()
608 static void felem_contract(felem out, const felem in) in felem_contract() argument
614 tmp[0] = in[0]; in felem_contract()
615 tmp[1] = in[1]; in felem_contract()
616 tmp[2] = in[2]; in felem_contract()
617 tmp[3] = in[3]; in felem_contract()
619 a = (in[3] >> 56); in felem_contract()
627 a = ((in[3] & in[2] & (in[1] | 0x000000ffffffffff)) + 1) | in felem_contract()
628 (((int64_t) (in[0] + (in[1] & 0x000000ffffffffff)) - 1) >> 63); in felem_contract()
665 static void felem_neg(felem out, const felem in) in felem_neg() argument
670 felem_diff_128_64(tmp, in); in felem_neg()
679 static limb felem_is_zero(const felem in) in felem_is_zero() argument
683 zero = in[0] | in[1] | in[2] | in[3]; in felem_is_zero()
685 two224m96p1 = (in[0] ^ 1) | (in[1] ^ 0x00ffff0000000000) in felem_is_zero()
686 | (in[2] ^ 0x00ffffffffffffff) | (in[3] ^ 0x00ffffffffffffff); in felem_is_zero()
688 two225m97p2 = (in[0] ^ 2) | (in[1] ^ 0x00fffe0000000000) in felem_is_zero()
689 | (in[2] ^ 0x00ffffffffffffff) | (in[3] ^ 0x01ffffffffffffff); in felem_is_zero()
694 static int felem_is_zero_int(const void *in) in felem_is_zero_int() argument
696 return (int)(felem_is_zero(in) & ((limb) 1)); in felem_is_zero_int()
701 static void felem_inv(felem out, const felem in) in felem_inv() argument
707 felem_square(tmp, in); in felem_inv()
709 felem_mul(tmp, in, ftmp); in felem_inv()
713 felem_mul(tmp, in, ftmp); in felem_inv()
771 felem_mul(tmp, ftmp, in); in felem_inv()
785 static void copy_conditional(felem out, const felem in, limb icopy) in copy_conditional() argument
793 const limb tmp = copy & (in[i] ^ out[i]); in copy_conditional()
1124 static char get_bit(const felem_bytearray in, unsigned i) in get_bit() argument
1128 return (in[i >> 3] >> (i & 7)) & 1; in get_bit()