Home | History | Annotate | Download | only in libmincrypt

Lines Matching full:carry

191 /* felem_reduce_carry adds a multiple of p in order to cancel |carry|,
194 * On entry: carry < 2**3, inout[0,2,...] < 2**29, inout[1,3,...] < 2**28.
196 static void felem_reduce_carry(felem inout, limb carry) {
197 const u32 carry_mask = NON_ZERO_TO_ALL_ONES(carry);
199 inout[0] += carry << 1;
201 /* carry < 2**3 thus (carry << 11) < 2**14 and we added 2**28 in the
203 inout[3] -= carry << 11;
207 inout[6] -= carry << 22;
208 /* This may underflow if carry is non-zero but, if so, we'll fix it in the
211 inout[7] += carry << 25;
219 limb carry = 0;
224 out[i] += carry;
225 carry = out[i] >> 29;
233 out[i] += carry;
234 carry = out[i] >> 28;
238 felem_reduce_carry(out, carry);
257 limb carry = 0;
263 out[i] += carry;
264 carry = out[i] >> 29;
273 out[i] += carry;
274 carry = out[i] >> 28;
278 felem_reduce_carry(out, carry);
298 limb tmp2[18], carry, x, xMask;
314 carry = tmp2[1] >> 28;
322 tmp2[i] += carry;
323 carry = tmp2[i] >> 29;
333 tmp2[i] += carry;
334 carry = tmp2[i] >> 28;
341 tmp2[17] += carry;
448 /* We merge the right shift with a carry chain. The words above 2**257 have
450 carry = 0;
456 out[i] += carry;
458 carry = out[i] >> 29;
463 out[i] += carry;
464 carry = out[i] >> 28;
469 out[8] += carry;
470 carry = out[8] >> 29;
473 felem_reduce_carry(out, carry);
675 limb carry = 0;
680 out[i] += carry;
681 carry = out[i] >> 29;
689 out[i] += carry;
690 carry = out[i] >> 28;
694 felem_reduce_carry(out, carry);
702 limb carry = 0, next_carry;
709 out[i] += carry;
710 carry = next_carry + (out[i] >> 29);
720 out[i] += carry;
721 carry = next_carry + (out[i] >> 28);
725 felem_reduce_carry(out, carry);
733 limb carry = 0, next_carry;
740 out[i] += carry;
741 carry = next_carry + (out[i] >> 29);
751 out[i] += carry;
752 carry = next_carry + (out[i] >> 28);
756 felem_reduce_carry(out, carry);
762 limb carry;
770 carry = 0;
772 tmp[i] += carry;
773 carry = tmp[i] >> 29;
780 tmp[i] += carry;
781 carry = tmp[i] >> 28;
785 felem_reduce_carry(tmp, carry);
786 } while (carry);