Lines Matching refs:a
34 void multiprecision_copy(uint32_t* c, uint32_t* a, uint32_t keyLength) { in multiprecision_copy() argument
35 for (uint32_t i = 0; i < keyLength; i++) c[i] = a[i]; in multiprecision_copy()
38 int multiprecision_compare(uint32_t* a, uint32_t* b, uint32_t keyLength) { 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, uint32_t keyLength) { 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, uint32_t keyLength) { in multiprecision_most_signdwords() argument
64 if (a[i]) break; in multiprecision_most_signdwords()
68 uint32_t multiprecision_most_signbits(uint32_t* a, uint32_t keyLength) { in multiprecision_most_signbits() argument
71 aMostSignDWORDs = multiprecision_most_signdwords(a, keyLength); 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
85 temp = a[i] + carrier; in multiprecision_add()
96 uint32_t multiprecision_sub(uint32_t* c, uint32_t* a, uint32_t* b, in multiprecision_sub() argument
103 temp = a[i] - borrow; in multiprecision_sub()
104 borrow = (temp > a[i]); in multiprecision_sub()
113 void multiprecision_lshift_mod(uint32_t* c, uint32_t* a, uint32_t keyLength) { in multiprecision_lshift_mod() argument
124 carrier = multiprecision_lshift(c, a, keyLength); in multiprecision_lshift_mod()
133 void multiprecision_rshift(uint32_t* c, uint32_t* a, uint32_t keyLength) { in multiprecision_rshift() argument
142 temp = a[i]; // in case of c==a in multiprecision_rshift()
150 void multiprecision_mersenns_mult_mod(uint32_t* c, uint32_t* a, uint32_t* b, in multiprecision_mersenns_mult_mod() argument
154 multiprecision_mult(cc, a, b, keyLength); in multiprecision_mersenns_mult_mod()
163 void multiprecision_mersenns_squa_mod(uint32_t* c, uint32_t* a, in multiprecision_mersenns_squa_mod() argument
165 multiprecision_mersenns_mult_mod(c, a, a, keyLength); in multiprecision_mersenns_squa_mod()
169 void multiprecision_add_mod(uint32_t* c, uint32_t* a, uint32_t* b, in multiprecision_add_mod() argument
181 carrier = multiprecision_add(c, a, b, keyLength); in multiprecision_add_mod()
190 void multiprecision_sub_mod(uint32_t* c, uint32_t* a, uint32_t* b, in multiprecision_sub_mod() argument
202 borrow = multiprecision_sub(c, a, b, keyLength); in multiprecision_sub_mod()
207 uint32_t multiprecision_lshift(uint32_t* c, uint32_t* a, uint32_t keyLength) { in multiprecision_lshift() argument
216 temp = a[i]; // in case c==a in multiprecision_lshift()
225 void multiprecision_mult(uint32_t* c, uint32_t* a, uint32_t* b, in multiprecision_mult() argument
239 result = ((uint64_t)a[i]) * ((uint64_t)b[j]); in multiprecision_mult()
241 V = a[i] * b[j]; in multiprecision_mult()
253 void multiprecision_fast_mod(uint32_t* c, uint32_t* a) { in multiprecision_fast_mod() argument
258 c[0] = a[0] + a[6]; in multiprecision_fast_mod()
259 U = c[0] < a[0]; in multiprecision_fast_mod()
260 c[0] += a[10]; in multiprecision_fast_mod()
261 U += c[0] < a[10]; in multiprecision_fast_mod()
263 c[1] = a[1] + U; in multiprecision_fast_mod()
264 U = c[1] < a[1]; in multiprecision_fast_mod()
265 c[1] += a[7]; in multiprecision_fast_mod()
266 U += c[1] < a[7]; in multiprecision_fast_mod()
267 c[1] += a[11]; in multiprecision_fast_mod()
268 U += c[1] < a[11]; in multiprecision_fast_mod()
270 c[2] = a[2] + U; in multiprecision_fast_mod()
271 U = c[2] < a[2]; in multiprecision_fast_mod()
272 c[2] += a[6]; in multiprecision_fast_mod()
273 U += c[2] < a[6]; in multiprecision_fast_mod()
274 c[2] += a[8]; in multiprecision_fast_mod()
275 U += c[2] < a[8]; in multiprecision_fast_mod()
276 c[2] += a[10]; in multiprecision_fast_mod()
277 U += c[2] < a[10]; in multiprecision_fast_mod()
279 c[3] = a[3] + U; in multiprecision_fast_mod()
280 U = c[3] < a[3]; in multiprecision_fast_mod()
281 c[3] += a[7]; in multiprecision_fast_mod()
282 U += c[3] < a[7]; in multiprecision_fast_mod()
283 c[3] += a[9]; in multiprecision_fast_mod()
284 U += c[3] < a[9]; in multiprecision_fast_mod()
285 c[3] += a[11]; in multiprecision_fast_mod()
286 U += c[3] < a[11]; in multiprecision_fast_mod()
288 c[4] = a[4] + U; in multiprecision_fast_mod()
289 U = c[4] < a[4]; in multiprecision_fast_mod()
290 c[4] += a[8]; in multiprecision_fast_mod()
291 U += c[4] < a[8]; in multiprecision_fast_mod()
292 c[4] += a[10]; in multiprecision_fast_mod()
293 U += c[4] < a[10]; in multiprecision_fast_mod()
295 c[5] = a[5] + U; in multiprecision_fast_mod()
296 U = c[5] < a[5]; in multiprecision_fast_mod()
297 c[5] += a[9]; in multiprecision_fast_mod()
298 U += c[5] < a[9]; in multiprecision_fast_mod()
299 c[5] += a[11]; in multiprecision_fast_mod()
300 U += c[5] < a[11]; in multiprecision_fast_mod()
324 void multiprecision_fast_mod_P256(uint32_t* c, uint32_t* a) { in multiprecision_fast_mod_P256() argument
343 C = a[13]; in multiprecision_fast_mod_P256()
344 C += a[14]; in multiprecision_fast_mod_P256()
345 UC = (C < a[14]); in multiprecision_fast_mod_P256()
346 C += a[15]; in multiprecision_fast_mod_P256()
347 UC += (C < a[15]); in multiprecision_fast_mod_P256()
350 E = a[8]; in multiprecision_fast_mod_P256()
351 E += a[9]; in multiprecision_fast_mod_P256()
352 UE = (E < a[9]); in multiprecision_fast_mod_P256()
355 F = a[9]; in multiprecision_fast_mod_P256()
356 F += a[10]; in multiprecision_fast_mod_P256()
357 UF = (F < a[10]); in multiprecision_fast_mod_P256()
360 G = a[10]; in multiprecision_fast_mod_P256()
361 G += a[11]; in multiprecision_fast_mod_P256()
362 UG = (G < a[11]); in multiprecision_fast_mod_P256()
367 B += a[12]; in multiprecision_fast_mod_P256()
368 UB += (B < a[12]); in multiprecision_fast_mod_P256()
373 A += a[11]; in multiprecision_fast_mod_P256()
374 UA += (A < a[11]); in multiprecision_fast_mod_P256()
375 UA -= (A < a[15]); in multiprecision_fast_mod_P256()
376 A -= a[15]; in multiprecision_fast_mod_P256()
381 D += a[10]; in multiprecision_fast_mod_P256()
382 UD += (D < a[10]); in multiprecision_fast_mod_P256()
383 UD -= (D < a[14]); in multiprecision_fast_mod_P256()
384 D -= a[14]; in multiprecision_fast_mod_P256()
386 c[0] = a[0]; in multiprecision_fast_mod_P256()
397 U = (a[1] < UU); in multiprecision_fast_mod_P256()
398 c[1] = a[1] - UU; in multiprecision_fast_mod_P256()
400 c[1] = a[1] + U; in multiprecision_fast_mod_P256()
401 U = (c[1] < a[1]); in multiprecision_fast_mod_P256()
414 U = (a[2] < UU); in multiprecision_fast_mod_P256()
415 c[2] = a[2] - UU; in multiprecision_fast_mod_P256()
417 c[2] = a[2] + U; in multiprecision_fast_mod_P256()
418 U = (c[2] < a[2]); in multiprecision_fast_mod_P256()
431 U = (a[3] < UU); in multiprecision_fast_mod_P256()
432 c[3] = a[3] - UU; in multiprecision_fast_mod_P256()
434 c[3] = a[3] + U; in multiprecision_fast_mod_P256()
435 U = (c[3] < a[3]); in multiprecision_fast_mod_P256()
441 c[3] += a[11]; in multiprecision_fast_mod_P256()
442 U += (c[3] < a[11]); in multiprecision_fast_mod_P256()
443 c[3] += a[12]; in multiprecision_fast_mod_P256()
444 U += (c[3] < a[12]); in multiprecision_fast_mod_P256()
445 U -= (c[3] < a[14]); in multiprecision_fast_mod_P256()
446 c[3] -= a[14]; in multiprecision_fast_mod_P256()
447 U -= (c[3] < a[15]); in multiprecision_fast_mod_P256()
448 c[3] -= a[15]; in multiprecision_fast_mod_P256()
456 U = (a[4] < UU); in multiprecision_fast_mod_P256()
457 c[4] = a[4] - UU; in multiprecision_fast_mod_P256()
459 c[4] = a[4] + U; in multiprecision_fast_mod_P256()
460 U = (c[4] < a[4]); in multiprecision_fast_mod_P256()
466 U -= (c[4] < a[15]); in multiprecision_fast_mod_P256()
467 c[4] -= a[15]; in multiprecision_fast_mod_P256()
468 c[4] += a[12]; in multiprecision_fast_mod_P256()
469 U += (c[4] < a[12]); in multiprecision_fast_mod_P256()
470 c[4] += a[13]; in multiprecision_fast_mod_P256()
471 U += (c[4] < a[13]); in multiprecision_fast_mod_P256()
479 U = (a[5] < UU); in multiprecision_fast_mod_P256()
480 c[5] = a[5] - UU; in multiprecision_fast_mod_P256()
482 c[5] = a[5] + U; in multiprecision_fast_mod_P256()
483 U = (c[5] < a[5]); in multiprecision_fast_mod_P256()
489 c[5] += a[13]; in multiprecision_fast_mod_P256()
490 U += (c[5] < a[13]); in multiprecision_fast_mod_P256()
491 c[5] += a[14]; in multiprecision_fast_mod_P256()
492 U += (c[5] < a[14]); in multiprecision_fast_mod_P256()
500 U = (a[6] < UU); in multiprecision_fast_mod_P256()
501 c[6] = a[6] - UU; in multiprecision_fast_mod_P256()
503 c[6] = a[6] + U; in multiprecision_fast_mod_P256()
504 U = (c[6] < a[6]); in multiprecision_fast_mod_P256()
510 c[6] += a[14]; in multiprecision_fast_mod_P256()
511 U += (c[6] < a[14]); in multiprecision_fast_mod_P256()
512 c[6] += a[14]; in multiprecision_fast_mod_P256()
513 U += (c[6] < a[14]); in multiprecision_fast_mod_P256()
514 c[6] += a[15]; in multiprecision_fast_mod_P256()
515 U += (c[6] < a[15]); in multiprecision_fast_mod_P256()
523 U = (a[7] < UU); in multiprecision_fast_mod_P256()
524 c[7] = a[7] - UU; in multiprecision_fast_mod_P256()
526 c[7] = a[7] + U; in multiprecision_fast_mod_P256()
527 U = (c[7] < a[7]); in multiprecision_fast_mod_P256()
530 c[7] += a[15]; in multiprecision_fast_mod_P256()
531 U += (c[7] < a[15]); in multiprecision_fast_mod_P256()
532 c[7] += a[15]; in multiprecision_fast_mod_P256()
533 U += (c[7] < a[15]); in multiprecision_fast_mod_P256()
534 c[7] += a[15]; in multiprecision_fast_mod_P256()
535 U += (c[7] < a[15]); in multiprecision_fast_mod_P256()
536 c[7] += a[8]; in multiprecision_fast_mod_P256()
537 U += (c[7] < a[8]); in multiprecision_fast_mod_P256()