Lines Matching refs:c
36 void multiprecision_init(uint32_t* c) { in multiprecision_init() argument
37 for (uint32_t i = 0; i < KEY_LENGTH_DWORDS_P256; i++) c[i] = 0; in multiprecision_init()
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()
83 uint32_t multiprecision_add(uint32_t* c, const uint32_t* a, const uint32_t* b) { in multiprecision_add() argument
93 c[i] = temp; in multiprecision_add()
100 uint32_t multiprecision_sub(uint32_t* c, const uint32_t* a, const uint32_t* b) { in multiprecision_sub() argument
108 c[i] = temp - b[i]; in multiprecision_sub()
109 borrow |= (c[i] > temp); 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()
119 multiprecision_sub(c, c, modp); in multiprecision_lshift_mod()
120 } else if (multiprecision_compare(c, modp) >= 0) { in multiprecision_lshift_mod()
121 multiprecision_sub(c, c, modp); in multiprecision_lshift_mod()
126 void multiprecision_rshift(uint32_t* c, const uint32_t* a) { in multiprecision_rshift() argument
136 c[i] = (temp >> b) | carrier; 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
147 multiprecision_fast_mod_P256(c, cc, modp); 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()
159 multiprecision_sub(c, c, modp); in multiprecision_add_mod()
160 } else if (multiprecision_compare(c, modp) >= 0) { in multiprecision_add_mod()
161 multiprecision_sub(c, c, modp); 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()
170 if (borrow) multiprecision_add(c, c, modp); in multiprecision_sub_mod()
174 uint32_t multiprecision_lshift(uint32_t* c, const uint32_t* a) { in multiprecision_lshift() argument
184 c[i] = (temp << b) | carrier; in multiprecision_lshift()
192 void multiprecision_mult(uint32_t* c, const uint32_t* a, const uint32_t* b) { in multiprecision_mult() argument
198 multiprecision_init(c); in multiprecision_mult()
211 V = V + c[i + j]; in multiprecision_mult()
212 U += (V < c[i + j]); in multiprecision_mult()
213 c[i + j] = V; in multiprecision_mult()
215 c[i + KEY_LENGTH_DWORDS_P256] = U; 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
280 c[0] = a[0]; in multiprecision_fast_mod_P256()
281 c[0] += E; in multiprecision_fast_mod_P256()
282 U = (c[0] < E); in multiprecision_fast_mod_P256()
284 U -= (c[0] < A); in multiprecision_fast_mod_P256()
286 c[0] -= A; 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()
298 c[1] += F; in multiprecision_fast_mod_P256()
299 U += (c[1] < F); in multiprecision_fast_mod_P256()
301 U -= (c[1] < B); in multiprecision_fast_mod_P256()
303 c[1] -= B; 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()
315 c[2] += G; in multiprecision_fast_mod_P256()
316 U += (c[2] < G); in multiprecision_fast_mod_P256()
318 U -= (c[2] < C); in multiprecision_fast_mod_P256()
320 c[2] -= C; 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()
332 c[3] += A; in multiprecision_fast_mod_P256()
333 U += (c[3] < A); 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()
343 U -= (c[3] < E); in multiprecision_fast_mod_P256()
345 c[3] -= E; 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()
357 c[4] += B; in multiprecision_fast_mod_P256()
358 U += (c[4] < B); 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()
366 U -= (c[4] < F); in multiprecision_fast_mod_P256()
368 c[4] -= F; 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()
380 c[5] += C; in multiprecision_fast_mod_P256()
381 U += (c[5] < C); 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()
387 U -= (c[5] < G); in multiprecision_fast_mod_P256()
389 c[5] -= G; 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()
401 c[6] += C; in multiprecision_fast_mod_P256()
402 U += (c[6] < C); 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()
410 U -= (c[6] < E); in multiprecision_fast_mod_P256()
412 c[6] -= E; 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()
432 U -= (c[7] < D); in multiprecision_fast_mod_P256()
434 c[7] -= D; in multiprecision_fast_mod_P256()
438 multiprecision_add(c, c, modp); in multiprecision_fast_mod_P256()
443 multiprecision_sub(c, c, modp); in multiprecision_fast_mod_P256()
448 if (multiprecision_compare(c, modp) >= 0) multiprecision_sub(c, c, modp); in multiprecision_fast_mod_P256()