Lines Matching refs:keyLength

44 static void ECC_Double(Point *q, Point *p, uint32_t keyLength)  in ECC_Double()  argument
56 if (multiprecision_iszero(p->z, keyLength)) in ECC_Double()
58 multiprecision_init(q->z, keyLength); in ECC_Double()
65 multiprecision_mersenns_squa_mod(t1, z1, keyLength); // t1=z1^2 in ECC_Double()
66 multiprecision_sub_mod(t2, x1, t1, keyLength); // t2=x1-t1 in ECC_Double()
67 multiprecision_add_mod(t1, x1, t1, keyLength); // t1=x1+t1 in ECC_Double()
68 multiprecision_mersenns_mult_mod(t2, t1, t2, keyLength); // t2=t2*t1 in ECC_Double()
69 multiprecision_lshift_mod(t3, t2, keyLength); in ECC_Double()
70 multiprecision_add_mod(t2, t3, t2, keyLength); // t2=3t2 in ECC_Double()
72 multiprecision_mersenns_mult_mod(z3, y1, z1, keyLength); // z3=y1*z1 in ECC_Double()
73 multiprecision_lshift_mod(z3, z3, keyLength); in ECC_Double()
75 multiprecision_mersenns_squa_mod(y3, y1, keyLength); // y3=y1^2 in ECC_Double()
76 multiprecision_lshift_mod(y3, y3, keyLength); in ECC_Double()
77 multiprecision_mersenns_mult_mod(t3, y3, x1, keyLength); // t3=y3*x1=x1*y1^2 in ECC_Double()
78 multiprecision_lshift_mod(t3, t3, keyLength); in ECC_Double()
79 multiprecision_mersenns_squa_mod(y3, y3, keyLength); // y3=y3^2=y1^4 in ECC_Double()
80 multiprecision_lshift_mod(y3, y3, keyLength); in ECC_Double()
82 multiprecision_mersenns_squa_mod(x3, t2, keyLength); // x3=t2^2 in ECC_Double()
83 multiprecision_lshift_mod(t1, t3, keyLength); // t1=2t3 in ECC_Double()
84 multiprecision_sub_mod(x3, x3, t1, keyLength); // x3=x3-t1 in ECC_Double()
85 multiprecision_sub_mod(t1, t3, x3, keyLength); // t1=t3-x3 in ECC_Double()
86 multiprecision_mersenns_mult_mod(t1, t1, t2, keyLength); // t1=t1*t2 in ECC_Double()
87 multiprecision_sub_mod(y3, t1, y3, keyLength); // y3=t1-y3 in ECC_Double()
91 static void ECC_Add(Point *r, Point *p, Point *q, uint32_t keyLength) in ECC_Add() argument
110 if (multiprecision_iszero(z2, keyLength)) in ECC_Add()
117 if (multiprecision_iszero(z1, keyLength)) in ECC_Add()
123 multiprecision_mersenns_squa_mod(t1, z1, keyLength); // t1=z1^2 in ECC_Add()
124 multiprecision_mersenns_mult_mod(t2, z1, t1, keyLength); // t2=t1*z1 in ECC_Add()
125 multiprecision_mersenns_mult_mod(t1, x2, t1, keyLength); // t1=t1*x2 in ECC_Add()
126 multiprecision_mersenns_mult_mod(t2, y2, t2, keyLength); // t2=t2*y2 in ECC_Add()
128 multiprecision_sub_mod(t1, t1, x1, keyLength); // t1=t1-x1 in ECC_Add()
129 multiprecision_sub_mod(t2, t2, y1, keyLength); // t2=t2-y1 in ECC_Add()
131 if (multiprecision_iszero(t1, keyLength)) in ECC_Add()
133 if (multiprecision_iszero(t2, keyLength)) in ECC_Add()
135 ECC_Double(r, q, keyLength) ; in ECC_Add()
140 multiprecision_init(z3, keyLength); in ECC_Add()
145 multiprecision_mersenns_mult_mod(z3, z1, t1, keyLength); // z3=z1*t1 in ECC_Add()
146 multiprecision_mersenns_squa_mod(y3, t1, keyLength); // t3=t1^2 in ECC_Add()
147 multiprecision_mersenns_mult_mod(z1, y3, t1, keyLength); // t4=t3*t1 in ECC_Add()
148 multiprecision_mersenns_mult_mod(y3, y3, x1, keyLength); // t3=t3*x1 in ECC_Add()
149 multiprecision_lshift_mod(t1, y3, keyLength); // t1=2*t3 in ECC_Add()
150 multiprecision_mersenns_squa_mod(x3, t2, keyLength); // x3=t2^2 in ECC_Add()
151 multiprecision_sub_mod(x3, x3, t1, keyLength); // x3=x3-t1 in ECC_Add()
152 multiprecision_sub_mod(x3, x3, z1, keyLength); // x3=x3-t4 in ECC_Add()
153 multiprecision_sub_mod(y3, y3, x3, keyLength); // t3=t3-x3 in ECC_Add()
154 multiprecision_mersenns_mult_mod(y3, y3, t2, keyLength); // t3=t3*t2 in ECC_Add()
155 multiprecision_mersenns_mult_mod(z1, z1, y1, keyLength); // t4=t4*t1 in ECC_Add()
156 multiprecision_sub_mod(y3, y3, z1, keyLength); in ECC_Add()
160 static void ECC_NAF(uint8_t *naf, uint32_t *NumNAF, DWORD *k, uint32_t keyLength) in ECC_NAF() argument
167 while ((var = multiprecision_most_signbits(k, keyLength))>=1) in ECC_NAF()
192 multiprecision_rshift(k, k, keyLength); in ECC_NAF()
201 void ECC_PointMult_Bin_NAF(Point *q, Point *p, DWORD *n, uint32_t keyLength) in ECC_PointMult_Bin_NAF() argument
210 if (keyLength == KEY_LENGTH_DWORDS_P256) in ECC_PointMult_Bin_NAF()
220 multiprecision_init(p->z, keyLength); in ECC_PointMult_Bin_NAF()
227 multiprecision_copy(minus_p.x, p->x, keyLength); in ECC_PointMult_Bin_NAF()
228 multiprecision_sub(minus_p.y, modp, p->y, keyLength); in ECC_PointMult_Bin_NAF()
230 multiprecision_init(minus_p.z, keyLength); in ECC_PointMult_Bin_NAF()
235 ECC_NAF(naf, &NumNaf, n, keyLength); in ECC_PointMult_Bin_NAF()
240 ECC_Double(q, &r, keyLength); in ECC_PointMult_Bin_NAF()
246 ECC_Add(q, &r, p, keyLength); in ECC_PointMult_Bin_NAF()
251 ECC_Add(q, &r, &minus_p, keyLength); in ECC_PointMult_Bin_NAF()
255 multiprecision_inv_mod(minus_p.x, q->z, keyLength); in ECC_PointMult_Bin_NAF()
256 multiprecision_mersenns_squa_mod(q->z, minus_p.x, keyLength); in ECC_PointMult_Bin_NAF()
257 multiprecision_mersenns_mult_mod(q->x, q->x, q->z, keyLength); in ECC_PointMult_Bin_NAF()
258 multiprecision_mersenns_mult_mod(q->z, q->z, minus_p.x, keyLength); in ECC_PointMult_Bin_NAF()
259 multiprecision_mersenns_mult_mod(q->y, q->y, q->z, keyLength); in ECC_PointMult_Bin_NAF()