Lines Matching refs:P256_LIMBS

41 #define P256_LIMBS      (256/BN_BITS2)  macro
46 BN_ULONG X[P256_LIMBS];
47 BN_ULONG Y[P256_LIMBS];
48 BN_ULONG Z[P256_LIMBS];
52 BN_ULONG X[P256_LIMBS];
53 BN_ULONG Y[P256_LIMBS];
90 void ecp_nistz256_add(BN_ULONG res[P256_LIMBS],
91 const BN_ULONG a[P256_LIMBS],
92 const BN_ULONG b[P256_LIMBS]);
94 void ecp_nistz256_mul_by_2(BN_ULONG res[P256_LIMBS],
95 const BN_ULONG a[P256_LIMBS]);
97 void ecp_nistz256_mul_by_3(BN_ULONG res[P256_LIMBS],
98 const BN_ULONG a[P256_LIMBS]);
101 void ecp_nistz256_div_by_2(BN_ULONG res[P256_LIMBS],
102 const BN_ULONG a[P256_LIMBS]);
104 void ecp_nistz256_sub(BN_ULONG res[P256_LIMBS],
105 const BN_ULONG a[P256_LIMBS],
106 const BN_ULONG b[P256_LIMBS]);
108 void ecp_nistz256_neg(BN_ULONG res[P256_LIMBS], const BN_ULONG a[P256_LIMBS]);
110 void ecp_nistz256_mul_mont(BN_ULONG res[P256_LIMBS],
111 const BN_ULONG a[P256_LIMBS],
112 const BN_ULONG b[P256_LIMBS]);
114 void ecp_nistz256_sqr_mont(BN_ULONG res[P256_LIMBS],
115 const BN_ULONG a[P256_LIMBS]);
117 void ecp_nistz256_from_mont(BN_ULONG res[P256_LIMBS],
118 const BN_ULONG in[P256_LIMBS]);
120 void ecp_nistz256_to_mont(BN_ULONG res[P256_LIMBS],
121 const BN_ULONG in[P256_LIMBS]);
133 static const BN_ULONG ONE[P256_LIMBS] = {
168 static void copy_conditional(BN_ULONG dst[P256_LIMBS], in copy_conditional() argument
169 const BN_ULONG src[P256_LIMBS], BN_ULONG move) in copy_conditional() argument
178 if (P256_LIMBS == 8) { in copy_conditional()
194 static BN_ULONG is_equal(const BN_ULONG a[P256_LIMBS], in is_equal() argument
195 const BN_ULONG b[P256_LIMBS]) in is_equal() argument
203 if (P256_LIMBS == 8) { in is_equal()
218 if (bn_get_top(z) == (P256_LIMBS - P256_LIMBS / 8)) { in is_one()
223 if (P256_LIMBS == 8) { in is_one()
259 BN_ULONG S[P256_LIMBS]; in ecp_nistz256_point_double()
260 BN_ULONG M[P256_LIMBS]; in ecp_nistz256_point_double()
261 BN_ULONG Zsqr[P256_LIMBS]; in ecp_nistz256_point_double()
262 BN_ULONG tmp0[P256_LIMBS]; in ecp_nistz256_point_double()
306 BN_ULONG U2[P256_LIMBS], S2[P256_LIMBS]; in ecp_nistz256_point_add()
307 BN_ULONG U1[P256_LIMBS], S1[P256_LIMBS]; in ecp_nistz256_point_add()
308 BN_ULONG Z1sqr[P256_LIMBS]; in ecp_nistz256_point_add()
309 BN_ULONG Z2sqr[P256_LIMBS]; in ecp_nistz256_point_add()
310 BN_ULONG H[P256_LIMBS], R[P256_LIMBS]; in ecp_nistz256_point_add()
311 BN_ULONG Hsqr[P256_LIMBS]; in ecp_nistz256_point_add()
312 BN_ULONG Rsqr[P256_LIMBS]; in ecp_nistz256_point_add()
313 BN_ULONG Hcub[P256_LIMBS]; in ecp_nistz256_point_add()
315 BN_ULONG res_x[P256_LIMBS]; in ecp_nistz256_point_add()
316 BN_ULONG res_y[P256_LIMBS]; in ecp_nistz256_point_add()
317 BN_ULONG res_z[P256_LIMBS]; in ecp_nistz256_point_add()
333 if (P256_LIMBS == 8) in ecp_nistz256_point_add()
337 if (P256_LIMBS == 8) in ecp_nistz256_point_add()
437 BN_ULONG U2[P256_LIMBS], S2[P256_LIMBS]; in ecp_nistz256_point_add_affine()
438 BN_ULONG Z1sqr[P256_LIMBS]; in ecp_nistz256_point_add_affine()
439 BN_ULONG H[P256_LIMBS], R[P256_LIMBS]; in ecp_nistz256_point_add_affine()
440 BN_ULONG Hsqr[P256_LIMBS]; in ecp_nistz256_point_add_affine()
441 BN_ULONG Rsqr[P256_LIMBS]; in ecp_nistz256_point_add_affine()
442 BN_ULONG Hcub[P256_LIMBS]; in ecp_nistz256_point_add_affine()
444 BN_ULONG res_x[P256_LIMBS]; in ecp_nistz256_point_add_affine()
445 BN_ULONG res_y[P256_LIMBS]; in ecp_nistz256_point_add_affine()
446 BN_ULONG res_z[P256_LIMBS]; in ecp_nistz256_point_add_affine()
461 if (P256_LIMBS == 8) in ecp_nistz256_point_add_affine()
470 if (P256_LIMBS == 8) in ecp_nistz256_point_add_affine()
520 static void ecp_nistz256_mod_inverse(BN_ULONG r[P256_LIMBS], in ecp_nistz256_mod_inverse() argument
521 const BN_ULONG in[P256_LIMBS]) in ecp_nistz256_mod_inverse() argument
527 BN_ULONG p2[P256_LIMBS]; in ecp_nistz256_mod_inverse()
528 BN_ULONG p4[P256_LIMBS]; in ecp_nistz256_mod_inverse()
529 BN_ULONG p8[P256_LIMBS]; in ecp_nistz256_mod_inverse()
530 BN_ULONG p16[P256_LIMBS]; in ecp_nistz256_mod_inverse()
531 BN_ULONG p32[P256_LIMBS]; in ecp_nistz256_mod_inverse()
532 BN_ULONG res[P256_LIMBS]; in ecp_nistz256_mod_inverse()
600 __owur static int ecp_nistz256_bignum_to_field_elem(BN_ULONG out[P256_LIMBS], in ecp_nistz256_bignum_to_field_elem() argument
603 return bn_copy_words(out, in, P256_LIMBS); in ecp_nistz256_bignum_to_field_elem()
779 static const BN_ULONG def_xG[P256_LIMBS] = {
784 static const BN_ULONG def_yG[P256_LIMBS] = {
795 return (bn_get_top(generator->X) == P256_LIMBS) && in ecp_nistz256_is_affine_G()
796 (bn_get_top(generator->Y) == P256_LIMBS) && in ecp_nistz256_is_affine_G()
930 if ((ret = bn_set_words(out->X, in->X, P256_LIMBS)) in ecp_nistz256_set_from_affine()
931 && (ret = bn_set_words(out->Y, in->Y, P256_LIMBS)) in ecp_nistz256_set_from_affine()
932 && (ret = bn_set_words(out->Z, ONE, P256_LIMBS))) in ecp_nistz256_set_from_affine()
1066 if (P256_LIMBS == 8) in ecp_nistz256_points_mul()
1077 if (P256_LIMBS == 8) { in ecp_nistz256_points_mul()
1143 if (!bn_set_words(r->X, p.p.X, P256_LIMBS) || in ecp_nistz256_points_mul()
1144 !bn_set_words(r->Y, p.p.Y, P256_LIMBS) || in ecp_nistz256_points_mul()
1145 !bn_set_words(r->Z, p.p.Z, P256_LIMBS)) { in ecp_nistz256_points_mul()
1163 BN_ULONG z_inv2[P256_LIMBS]; in ecp_nistz256_get_affine()
1164 BN_ULONG z_inv3[P256_LIMBS]; in ecp_nistz256_get_affine()
1165 BN_ULONG x_aff[P256_LIMBS]; in ecp_nistz256_get_affine()
1166 BN_ULONG y_aff[P256_LIMBS]; in ecp_nistz256_get_affine()
1167 BN_ULONG point_x[P256_LIMBS], point_y[P256_LIMBS], point_z[P256_LIMBS]; in ecp_nistz256_get_affine()
1168 BN_ULONG x_ret[P256_LIMBS], y_ret[P256_LIMBS]; in ecp_nistz256_get_affine()
1188 if (!bn_set_words(x, x_ret, P256_LIMBS)) in ecp_nistz256_get_affine()
1196 if (!bn_set_words(y, y_ret, P256_LIMBS)) in ecp_nistz256_get_affine()
1272 void ecp_nistz256_ord_mul_mont(BN_ULONG res[P256_LIMBS],
1273 const BN_ULONG a[P256_LIMBS],
1274 const BN_ULONG b[P256_LIMBS]);
1275 void ecp_nistz256_ord_sqr_mont(BN_ULONG res[P256_LIMBS],
1276 const BN_ULONG a[P256_LIMBS],
1283 static const BN_ULONG RR[P256_LIMBS] = { in ecp_nistz256_inv_mod_ord()
1288 static const BN_ULONG one[P256_LIMBS] = { in ecp_nistz256_inv_mod_ord()
1295 BN_ULONG table[15][P256_LIMBS]; in ecp_nistz256_inv_mod_ord()
1296 BN_ULONG out[P256_LIMBS], t[P256_LIMBS]; in ecp_nistz256_inv_mod_ord()
1306 if (bn_wexpand(r, P256_LIMBS) == NULL) { in ecp_nistz256_inv_mod_ord()
1437 if (!bn_set_words(r, out, P256_LIMBS)) in ecp_nistz256_inv_mod_ord()