Lines Matching refs:x1

549 static void ecc_point_double_jacobian(u64 *x1, u64 *y1, u64 *z1)  in ecc_point_double_jacobian()  argument
559 vli_mod_mult_fast(t5, x1, t4); /* t5 = x1*y1^2 = A */ in ecc_point_double_jacobian()
564 vli_mod_add(x1, x1, z1, curve_p); /* t1 = x1 + z1^2 */ in ecc_point_double_jacobian()
566 vli_mod_sub(z1, x1, z1, curve_p); /* t3 = x1 - z1^2 */ in ecc_point_double_jacobian()
567 vli_mod_mult_fast(x1, x1, z1); /* t1 = x1^2 - z1^4 */ in ecc_point_double_jacobian()
569 vli_mod_add(z1, x1, x1, curve_p); /* t3 = 2*(x1^2 - z1^4) */ in ecc_point_double_jacobian()
570 vli_mod_add(x1, x1, z1, curve_p); /* t1 = 3*(x1^2 - z1^4) */ in ecc_point_double_jacobian()
571 if (vli_test_bit(x1, 0)) { in ecc_point_double_jacobian()
572 u64 carry = vli_add(x1, x1, curve_p); in ecc_point_double_jacobian()
573 vli_rshift1(x1); in ecc_point_double_jacobian()
574 x1[NUM_ECC_DIGITS - 1] |= carry << 63; in ecc_point_double_jacobian()
576 vli_rshift1(x1); in ecc_point_double_jacobian()
580 vli_mod_square_fast(z1, x1); /* t3 = B^2 */ in ecc_point_double_jacobian()
584 vli_mod_mult_fast(x1, x1, t5); /* t1 = B * (A - x3) */ in ecc_point_double_jacobian()
585 vli_mod_sub(t4, x1, t4, curve_p); /* t4 = B * (A - x3) - y1^4 = y3 */ in ecc_point_double_jacobian()
587 vli_set(x1, z1); in ecc_point_double_jacobian()
593 static void apply_z(u64 *x1, u64 *y1, u64 *z) in apply_z() argument
598 vli_mod_mult_fast(x1, x1, t1); /* x1 * z^2 */ in apply_z()
604 static void xycz_initial_double(u64 *x1, u64 *y1, u64 *x2, u64 *y2, in xycz_initial_double() argument
609 vli_set(x2, x1); in xycz_initial_double()
618 apply_z(x1, y1, z); in xycz_initial_double()
620 ecc_point_double_jacobian(x1, y1, z); in xycz_initial_double()
629 static void xycz_add(u64 *x1, u64 *y1, u64 *x2, u64 *y2) in xycz_add() argument
634 vli_mod_sub(t5, x2, x1, curve_p); /* t5 = x2 - x1 */ in xycz_add()
636 vli_mod_mult_fast(x1, x1, t5); /* t1 = x1*A = B */ in xycz_add()
641 vli_mod_sub(t5, t5, x1, curve_p); /* t5 = D - B */ in xycz_add()
643 vli_mod_sub(x2, x2, x1, curve_p); /* t3 = C - B */ in xycz_add()
645 vli_mod_sub(x2, x1, t5, curve_p); /* t3 = B - x3 */ in xycz_add()
656 static void xycz_add_c(u64 *x1, u64 *y1, u64 *x2, u64 *y2) in xycz_add_c() argument
663 vli_mod_sub(t5, x2, x1, curve_p); /* t5 = x2 - x1 */ in xycz_add_c()
665 vli_mod_mult_fast(x1, x1, t5); /* t1 = x1*A = B */ in xycz_add_c()
670 vli_mod_sub(t6, x2, x1, curve_p); /* t6 = C - B */ in xycz_add_c()
672 vli_mod_add(t6, x1, x2, curve_p); /* t6 = B + C */ in xycz_add_c()
676 vli_mod_sub(t7, x1, x2, curve_p); /* t7 = B - x3 */ in xycz_add_c()
682 vli_mod_sub(t6, t7, x1, curve_p); /* t6 = x3' - B */ in xycz_add_c()
686 vli_set(x1, t7); in xycz_add_c()