Lines Matching refs:a

34 void multiprecision_copy(uint32_t* c, uint32_t* a) {  in multiprecision_copy()  argument
35 for (uint32_t i = 0; i < KEY_LENGTH_DWORDS_P256; i++) c[i] = a[i]; in multiprecision_copy()
38 int multiprecision_compare(uint32_t* a, uint32_t* b) { in multiprecision_compare() argument
40 if (a[i] > b[i]) return 1; in multiprecision_compare()
41 if (a[i] < b[i]) return -1; in multiprecision_compare()
46 int multiprecision_iszero(uint32_t* a) { in multiprecision_iszero() argument
48 if (a[i]) return 0; in multiprecision_iszero()
53 uint32_t multiprecision_dword_bits(uint32_t a) { in multiprecision_dword_bits() argument
55 for (i = 0; i < DWORD_BITS; i++, a >>= 1) in multiprecision_dword_bits()
56 if (a == 0) break; in multiprecision_dword_bits()
61 uint32_t multiprecision_most_signdwords(uint32_t* a) { in multiprecision_most_signdwords() argument
64 if (a[i]) break; in multiprecision_most_signdwords()
68 uint32_t multiprecision_most_signbits(uint32_t* a) { in multiprecision_most_signbits() argument
71 aMostSignDWORDs = multiprecision_most_signdwords(a); in multiprecision_most_signbits()
75 multiprecision_dword_bits(a[aMostSignDWORDs - 1])); in multiprecision_most_signbits()
78 uint32_t multiprecision_add(uint32_t* c, uint32_t* a, uint32_t* b) { in multiprecision_add() argument
84 temp = a[i] + carrier; in multiprecision_add()
95 uint32_t multiprecision_sub(uint32_t* c, uint32_t* a, uint32_t* b) { in multiprecision_sub() argument
101 temp = a[i] - borrow; in multiprecision_sub()
102 borrow = (temp > a[i]); in multiprecision_sub()
111 void multiprecision_lshift_mod(uint32_t* c, uint32_t* a) { in multiprecision_lshift_mod() argument
115 carrier = multiprecision_lshift(c, a); in multiprecision_lshift_mod()
124 void multiprecision_rshift(uint32_t* c, uint32_t* a) { in multiprecision_rshift() argument
133 temp = a[i]; // in case of c==a in multiprecision_rshift()
141 void multiprecision_mersenns_mult_mod(uint32_t* c, uint32_t* a, uint32_t* b) { in multiprecision_mersenns_mult_mod() argument
144 multiprecision_mult(cc, a, b); in multiprecision_mersenns_mult_mod()
149 void multiprecision_mersenns_squa_mod(uint32_t* c, uint32_t* a) { in multiprecision_mersenns_squa_mod() argument
150 multiprecision_mersenns_mult_mod(c, a, a); in multiprecision_mersenns_squa_mod()
154 void multiprecision_add_mod(uint32_t* c, uint32_t* a, uint32_t* b) { in multiprecision_add_mod() argument
158 carrier = multiprecision_add(c, a, b); in multiprecision_add_mod()
167 void multiprecision_sub_mod(uint32_t* c, uint32_t* a, uint32_t* b) { in multiprecision_sub_mod() argument
171 borrow = multiprecision_sub(c, a, b); in multiprecision_sub_mod()
176 uint32_t multiprecision_lshift(uint32_t* c, uint32_t* a) { in multiprecision_lshift() argument
185 temp = a[i]; // in case c==a in multiprecision_lshift()
194 void multiprecision_mult(uint32_t* c, uint32_t* a, uint32_t* b) { in multiprecision_mult() argument
207 result = ((uint64_t)a[i]) * ((uint64_t)b[j]); in multiprecision_mult()
209 V = a[i] * b[j]; in multiprecision_mult()
221 void multiprecision_fast_mod_P256(uint32_t* c, uint32_t* a) { in multiprecision_fast_mod_P256() argument
240 C = a[13]; in multiprecision_fast_mod_P256()
241 C += a[14]; in multiprecision_fast_mod_P256()
242 UC = (C < a[14]); in multiprecision_fast_mod_P256()
243 C += a[15]; in multiprecision_fast_mod_P256()
244 UC += (C < a[15]); in multiprecision_fast_mod_P256()
247 E = a[8]; in multiprecision_fast_mod_P256()
248 E += a[9]; in multiprecision_fast_mod_P256()
249 UE = (E < a[9]); in multiprecision_fast_mod_P256()
252 F = a[9]; in multiprecision_fast_mod_P256()
253 F += a[10]; in multiprecision_fast_mod_P256()
254 UF = (F < a[10]); in multiprecision_fast_mod_P256()
257 G = a[10]; in multiprecision_fast_mod_P256()
258 G += a[11]; in multiprecision_fast_mod_P256()
259 UG = (G < a[11]); in multiprecision_fast_mod_P256()
264 B += a[12]; in multiprecision_fast_mod_P256()
265 UB += (B < a[12]); in multiprecision_fast_mod_P256()
270 A += a[11]; in multiprecision_fast_mod_P256()
271 UA += (A < a[11]); in multiprecision_fast_mod_P256()
272 UA -= (A < a[15]); in multiprecision_fast_mod_P256()
273 A -= a[15]; in multiprecision_fast_mod_P256()
278 D += a[10]; in multiprecision_fast_mod_P256()
279 UD += (D < a[10]); in multiprecision_fast_mod_P256()
280 UD -= (D < a[14]); in multiprecision_fast_mod_P256()
281 D -= a[14]; in multiprecision_fast_mod_P256()
283 c[0] = a[0]; in multiprecision_fast_mod_P256()
294 U = (a[1] < UU); in multiprecision_fast_mod_P256()
295 c[1] = a[1] - UU; in multiprecision_fast_mod_P256()
297 c[1] = a[1] + U; in multiprecision_fast_mod_P256()
298 U = (c[1] < a[1]); in multiprecision_fast_mod_P256()
311 U = (a[2] < UU); in multiprecision_fast_mod_P256()
312 c[2] = a[2] - UU; in multiprecision_fast_mod_P256()
314 c[2] = a[2] + U; in multiprecision_fast_mod_P256()
315 U = (c[2] < a[2]); in multiprecision_fast_mod_P256()
328 U = (a[3] < UU); in multiprecision_fast_mod_P256()
329 c[3] = a[3] - UU; in multiprecision_fast_mod_P256()
331 c[3] = a[3] + U; in multiprecision_fast_mod_P256()
332 U = (c[3] < a[3]); in multiprecision_fast_mod_P256()
338 c[3] += a[11]; in multiprecision_fast_mod_P256()
339 U += (c[3] < a[11]); in multiprecision_fast_mod_P256()
340 c[3] += a[12]; in multiprecision_fast_mod_P256()
341 U += (c[3] < a[12]); in multiprecision_fast_mod_P256()
342 U -= (c[3] < a[14]); in multiprecision_fast_mod_P256()
343 c[3] -= a[14]; in multiprecision_fast_mod_P256()
344 U -= (c[3] < a[15]); in multiprecision_fast_mod_P256()
345 c[3] -= a[15]; in multiprecision_fast_mod_P256()
353 U = (a[4] < UU); in multiprecision_fast_mod_P256()
354 c[4] = a[4] - UU; in multiprecision_fast_mod_P256()
356 c[4] = a[4] + U; in multiprecision_fast_mod_P256()
357 U = (c[4] < a[4]); in multiprecision_fast_mod_P256()
363 U -= (c[4] < a[15]); in multiprecision_fast_mod_P256()
364 c[4] -= a[15]; in multiprecision_fast_mod_P256()
365 c[4] += a[12]; in multiprecision_fast_mod_P256()
366 U += (c[4] < a[12]); in multiprecision_fast_mod_P256()
367 c[4] += a[13]; in multiprecision_fast_mod_P256()
368 U += (c[4] < a[13]); in multiprecision_fast_mod_P256()
376 U = (a[5] < UU); in multiprecision_fast_mod_P256()
377 c[5] = a[5] - UU; in multiprecision_fast_mod_P256()
379 c[5] = a[5] + U; in multiprecision_fast_mod_P256()
380 U = (c[5] < a[5]); in multiprecision_fast_mod_P256()
386 c[5] += a[13]; in multiprecision_fast_mod_P256()
387 U += (c[5] < a[13]); in multiprecision_fast_mod_P256()
388 c[5] += a[14]; in multiprecision_fast_mod_P256()
389 U += (c[5] < a[14]); in multiprecision_fast_mod_P256()
397 U = (a[6] < UU); in multiprecision_fast_mod_P256()
398 c[6] = a[6] - UU; in multiprecision_fast_mod_P256()
400 c[6] = a[6] + U; in multiprecision_fast_mod_P256()
401 U = (c[6] < a[6]); in multiprecision_fast_mod_P256()
407 c[6] += a[14]; in multiprecision_fast_mod_P256()
408 U += (c[6] < a[14]); in multiprecision_fast_mod_P256()
409 c[6] += a[14]; in multiprecision_fast_mod_P256()
410 U += (c[6] < a[14]); in multiprecision_fast_mod_P256()
411 c[6] += a[15]; in multiprecision_fast_mod_P256()
412 U += (c[6] < a[15]); in multiprecision_fast_mod_P256()
420 U = (a[7] < UU); in multiprecision_fast_mod_P256()
421 c[7] = a[7] - UU; in multiprecision_fast_mod_P256()
423 c[7] = a[7] + U; in multiprecision_fast_mod_P256()
424 U = (c[7] < a[7]); in multiprecision_fast_mod_P256()
427 c[7] += a[15]; in multiprecision_fast_mod_P256()
428 U += (c[7] < a[15]); in multiprecision_fast_mod_P256()
429 c[7] += a[15]; in multiprecision_fast_mod_P256()
430 U += (c[7] < a[15]); in multiprecision_fast_mod_P256()
431 c[7] += a[15]; in multiprecision_fast_mod_P256()
432 U += (c[7] < a[15]); in multiprecision_fast_mod_P256()
433 c[7] += a[8]; in multiprecision_fast_mod_P256()
434 U += (c[7] < a[8]); in multiprecision_fast_mod_P256()