Lines Matching refs:a
40 void multiprecision_copy(uint32_t* c, const uint32_t* a) { in multiprecision_copy() argument
41 for (uint32_t i = 0; i < KEY_LENGTH_DWORDS_P256; i++) c[i] = a[i]; in multiprecision_copy()
44 int multiprecision_compare(const uint32_t* a, const uint32_t* b) { in multiprecision_compare() argument
46 if (a[i] > b[i]) return 1; in multiprecision_compare()
47 if (a[i] < b[i]) return -1; in multiprecision_compare()
52 int multiprecision_iszero(const uint32_t* a) { in multiprecision_iszero() argument
54 if (a[i]) return 0; in multiprecision_iszero()
59 uint32_t multiprecision_dword_bits(uint32_t a) { in multiprecision_dword_bits() argument
61 for (i = 0; i < DWORD_BITS; i++, a >>= 1) in multiprecision_dword_bits()
62 if (a == 0) break; in multiprecision_dword_bits()
67 uint32_t multiprecision_most_signdwords(const uint32_t* a) { in multiprecision_most_signdwords() argument
70 if (a[i]) break; in multiprecision_most_signdwords()
74 uint32_t multiprecision_most_signbits(const uint32_t* a) { in multiprecision_most_signbits() argument
77 aMostSignDWORDs = multiprecision_most_signdwords(a); in multiprecision_most_signbits()
80 …return (((aMostSignDWORDs - 1) << DWORD_BITS_SHIFT) + multiprecision_dword_bits(a[aMostSignDWORDs … in multiprecision_most_signbits()
83 uint32_t multiprecision_add(uint32_t* c, const uint32_t* a, const uint32_t* b) { in multiprecision_add() argument
89 temp = a[i] + carrier; in multiprecision_add()
100 uint32_t multiprecision_sub(uint32_t* c, const uint32_t* a, const uint32_t* b) { in multiprecision_sub() argument
106 temp = a[i] - borrow; in multiprecision_sub()
107 borrow = (temp > a[i]); in multiprecision_sub()
116 void multiprecision_lshift_mod(uint32_t* c, const uint32_t* a, const uint32_t* modp) { in multiprecision_lshift_mod() argument
117 uint32_t carrier = multiprecision_lshift(c, a); in multiprecision_lshift_mod()
126 void multiprecision_rshift(uint32_t* c, const uint32_t* a) { in multiprecision_rshift() argument
135 temp = a[i]; // in case of c==a in multiprecision_rshift()
143 void multiprecision_mersenns_mult_mod(uint32_t* c, const uint32_t* a, const uint32_t* b, const uint… in multiprecision_mersenns_mult_mod() argument
146 multiprecision_mult(cc, a, b); in multiprecision_mersenns_mult_mod()
151 void multiprecision_mersenns_squa_mod(uint32_t* c, const uint32_t* a, const uint32_t* modp) { in multiprecision_mersenns_squa_mod() argument
152 multiprecision_mersenns_mult_mod(c, a, a, modp); in multiprecision_mersenns_squa_mod()
156 void multiprecision_add_mod(uint32_t* c, const uint32_t* a, const uint32_t* b, const uint32_t* modp… in multiprecision_add_mod() argument
157 uint32_t carrier = multiprecision_add(c, a, b); in multiprecision_add_mod()
166 void multiprecision_sub_mod(uint32_t* c, const uint32_t* a, const uint32_t* b, const uint32_t* modp… in multiprecision_sub_mod() argument
169 borrow = multiprecision_sub(c, a, b); in multiprecision_sub_mod()
174 uint32_t multiprecision_lshift(uint32_t* c, const uint32_t* a) { in multiprecision_lshift() argument
183 temp = a[i]; // in case c==a in multiprecision_lshift()
192 void multiprecision_mult(uint32_t* c, const uint32_t* a, const uint32_t* b) { in multiprecision_mult() argument
205 result = ((uint64_t)a[i]) * ((uint64_t)b[j]); in multiprecision_mult()
207 V = a[i] * b[j]; in multiprecision_mult()
219 void multiprecision_fast_mod_P256(uint32_t* c, const uint32_t* a, const uint32_t* modp) { in multiprecision_fast_mod_P256() argument
237 C = a[13]; in multiprecision_fast_mod_P256()
238 C += a[14]; in multiprecision_fast_mod_P256()
239 UC = (C < a[14]); in multiprecision_fast_mod_P256()
240 C += a[15]; in multiprecision_fast_mod_P256()
241 UC += (C < a[15]); in multiprecision_fast_mod_P256()
244 E = a[8]; in multiprecision_fast_mod_P256()
245 E += a[9]; in multiprecision_fast_mod_P256()
246 UE = (E < a[9]); in multiprecision_fast_mod_P256()
249 F = a[9]; in multiprecision_fast_mod_P256()
250 F += a[10]; in multiprecision_fast_mod_P256()
251 UF = (F < a[10]); in multiprecision_fast_mod_P256()
254 G = a[10]; in multiprecision_fast_mod_P256()
255 G += a[11]; in multiprecision_fast_mod_P256()
256 UG = (G < a[11]); in multiprecision_fast_mod_P256()
261 B += a[12]; in multiprecision_fast_mod_P256()
262 UB += (B < a[12]); in multiprecision_fast_mod_P256()
267 A += a[11]; in multiprecision_fast_mod_P256()
268 UA += (A < a[11]); in multiprecision_fast_mod_P256()
269 UA -= (A < a[15]); in multiprecision_fast_mod_P256()
270 A -= a[15]; in multiprecision_fast_mod_P256()
275 D += a[10]; in multiprecision_fast_mod_P256()
276 UD += (D < a[10]); in multiprecision_fast_mod_P256()
277 UD -= (D < a[14]); in multiprecision_fast_mod_P256()
278 D -= a[14]; in multiprecision_fast_mod_P256()
280 c[0] = a[0]; in multiprecision_fast_mod_P256()
291 U = (a[1] < UU); in multiprecision_fast_mod_P256()
292 c[1] = a[1] - UU; in multiprecision_fast_mod_P256()
294 c[1] = a[1] + U; in multiprecision_fast_mod_P256()
295 U = (c[1] < a[1]); in multiprecision_fast_mod_P256()
308 U = (a[2] < UU); in multiprecision_fast_mod_P256()
309 c[2] = a[2] - UU; in multiprecision_fast_mod_P256()
311 c[2] = a[2] + U; in multiprecision_fast_mod_P256()
312 U = (c[2] < a[2]); in multiprecision_fast_mod_P256()
325 U = (a[3] < UU); in multiprecision_fast_mod_P256()
326 c[3] = a[3] - UU; in multiprecision_fast_mod_P256()
328 c[3] = a[3] + U; in multiprecision_fast_mod_P256()
329 U = (c[3] < a[3]); in multiprecision_fast_mod_P256()
335 c[3] += a[11]; in multiprecision_fast_mod_P256()
336 U += (c[3] < a[11]); in multiprecision_fast_mod_P256()
337 c[3] += a[12]; in multiprecision_fast_mod_P256()
338 U += (c[3] < a[12]); in multiprecision_fast_mod_P256()
339 U -= (c[3] < a[14]); in multiprecision_fast_mod_P256()
340 c[3] -= a[14]; in multiprecision_fast_mod_P256()
341 U -= (c[3] < a[15]); in multiprecision_fast_mod_P256()
342 c[3] -= a[15]; in multiprecision_fast_mod_P256()
350 U = (a[4] < UU); in multiprecision_fast_mod_P256()
351 c[4] = a[4] - UU; in multiprecision_fast_mod_P256()
353 c[4] = a[4] + U; in multiprecision_fast_mod_P256()
354 U = (c[4] < a[4]); in multiprecision_fast_mod_P256()
360 U -= (c[4] < a[15]); in multiprecision_fast_mod_P256()
361 c[4] -= a[15]; in multiprecision_fast_mod_P256()
362 c[4] += a[12]; in multiprecision_fast_mod_P256()
363 U += (c[4] < a[12]); in multiprecision_fast_mod_P256()
364 c[4] += a[13]; in multiprecision_fast_mod_P256()
365 U += (c[4] < a[13]); in multiprecision_fast_mod_P256()
373 U = (a[5] < UU); in multiprecision_fast_mod_P256()
374 c[5] = a[5] - UU; in multiprecision_fast_mod_P256()
376 c[5] = a[5] + U; in multiprecision_fast_mod_P256()
377 U = (c[5] < a[5]); in multiprecision_fast_mod_P256()
383 c[5] += a[13]; in multiprecision_fast_mod_P256()
384 U += (c[5] < a[13]); in multiprecision_fast_mod_P256()
385 c[5] += a[14]; in multiprecision_fast_mod_P256()
386 U += (c[5] < a[14]); in multiprecision_fast_mod_P256()
394 U = (a[6] < UU); in multiprecision_fast_mod_P256()
395 c[6] = a[6] - UU; in multiprecision_fast_mod_P256()
397 c[6] = a[6] + U; in multiprecision_fast_mod_P256()
398 U = (c[6] < a[6]); in multiprecision_fast_mod_P256()
404 c[6] += a[14]; in multiprecision_fast_mod_P256()
405 U += (c[6] < a[14]); in multiprecision_fast_mod_P256()
406 c[6] += a[14]; in multiprecision_fast_mod_P256()
407 U += (c[6] < a[14]); in multiprecision_fast_mod_P256()
408 c[6] += a[15]; in multiprecision_fast_mod_P256()
409 U += (c[6] < a[15]); in multiprecision_fast_mod_P256()
417 U = (a[7] < UU); in multiprecision_fast_mod_P256()
418 c[7] = a[7] - UU; in multiprecision_fast_mod_P256()
420 c[7] = a[7] + U; in multiprecision_fast_mod_P256()
421 U = (c[7] < a[7]); in multiprecision_fast_mod_P256()
424 c[7] += a[15]; in multiprecision_fast_mod_P256()
425 U += (c[7] < a[15]); in multiprecision_fast_mod_P256()
426 c[7] += a[15]; in multiprecision_fast_mod_P256()
427 U += (c[7] < a[15]); in multiprecision_fast_mod_P256()
428 c[7] += a[15]; in multiprecision_fast_mod_P256()
429 U += (c[7] < a[15]); in multiprecision_fast_mod_P256()
430 c[7] += a[8]; in multiprecision_fast_mod_P256()
431 U += (c[7] < a[8]); in multiprecision_fast_mod_P256()