Lines Matching defs:r
57 /* Fast modular reduction for p192 = 2^192 - 2^64 - 1. a can be r. Uses
61 ec_GFp_nistp192_mod(const mp_int *a, mp_int *r, const GFMethod *meth)
79 if (a == r) {
82 return mp_copy(a, r);
88 MP_CHECKOK(mp_mod(a, &meth->irr, r));
119 /* implement r = (a2,a1,a0)+(a5,a5,a5)+(a4,a4,0)+(0,a3,a3) */
174 /* set the lower words of r */
175 if (a != r) {
176 MP_CHECKOK(s_mp_pad(r, 6));
178 MP_DIGIT(r, 5) = r2b;
179 MP_DIGIT(r, 4) = r2a;
180 MP_DIGIT(r, 3) = r1b;
181 MP_DIGIT(r, 2) = r1a;
182 MP_DIGIT(r, 1) = r0b;
183 MP_DIGIT(r, 0) = r0a;
184 MP_USED(r) = 6;
199 /* implement r = (a2,a1,a0)+(a5,a5,a5)+(a4,a4,0)+(0,a3,a3) */
218 /* set the lower words of r */
232 : "=r"(r0), "=r"(r1), "=r"(r2), "=r"(r3), "=r"(a3),
233 "=r"(a4), "=r"(a5)
254 : "=r"(r0), "=r"(r1), "=r"(r2), "=r"(r3), "=r"(a3)
279 /* set the lower words of r */
280 if (a != r) {
281 MP_CHECKOK(s_mp_pad(r, 3));
283 MP_DIGIT(r, 2) = r2;
284 MP_DIGIT(r, 1) = r1;
285 MP_DIGIT(r, 0) = r0;
286 MP_USED(r) = 3;
300 ec_GFp_nistp192_add(const mp_int *a, const mp_int *b, mp_int *r,
336 : "=r"(r0), "=r"(r1), "=r"(r2), "=r"(carry)
337 : "r" (a0), "r" (a1), "r" (a2), "0" (r0),
356 : "=r"(r0), "=r"(r1), "=r"(r2)
363 MP_CHECKOK(s_mp_pad(r, 3));
364 MP_DIGIT(r, 2) = r2;
365 MP_DIGIT(r, 1) = r1;
366 MP_DIGIT(r, 0) = r0;
367 MP_SIGN(r) = MP_ZPOS;
368 MP_USED(r) = 3;
369 s_mp_clamp(r);
381 ec_GFp_nistp192_sub(const mp_int *a, const mp_int *b, mp_int *r,
418 : "=r"(r0), "=r"(r1), "=r"(r2), "=r"(borrow)
419 : "r" (b0), "r" (b1), "r" (b2), "0" (r0),
436 : "=r"(r0), "=r"(r1), "=r"(r2)
442 MP_CHECKOK(s_mp_pad(r, 3));
443 MP_DIGIT(r, 2) = r2;
444 MP_DIGIT(r, 1) = r1;
445 MP_DIGIT(r, 0) = r0;
446 MP_SIGN(r) = MP_ZPOS;
447 MP_USED(r) = 3;
448 s_mp_clamp(r);
457 * result in r. r could be a. Uses optimized modular reduction for p192.
460 ec_GFp_nistp192_sqr(const mp_int *a, mp_int *r, const GFMethod *meth)
464 MP_CHECKOK(mp_sqr(a, r));
465 MP_CHECKOK(ec_GFp_nistp192_mod(r, r, meth));
471 * Store the result in r. r could be a or b; a could be b. Uses
474 ec_GFp_nistp192_mul(const mp_int *a, const mp_int *b, mp_int *r,
479 MP_CHECKOK(mp_mul(a, b, r));
480 MP_CHECKOK(ec_GFp_nistp192_mod(r, r, meth));
488 ec_GFp_nistp192_div(const mp_int *a, const mp_int *b, mp_int *r,
496 return mp_invmod(b, &meth->irr, r);
502 MP_CHECKOK(mp_mul(a, &t, r));
503 MP_CHECKOK(ec_GFp_nistp192_mod(r, r, meth));