Lines Matching refs:TEMP
166 mp_int_clear(TEMP(last__))
167 #define TEMP(K) (temp + (K)) macro
168 #define LAST_TEMP() TEMP(last__)
1180 SETUP(mp_int_init_size(TEMP(0), 2 * um)); in mp_int_exptmod()
1181 SETUP(mp_int_init_size(TEMP(1), 2 * um)); in mp_int_exptmod()
1184 SETUP(mp_int_init_size(TEMP(2), 2 * um)); in mp_int_exptmod()
1185 s = TEMP(2); in mp_int_exptmod()
1191 if ((res = mp_int_mod(a, m, TEMP(0))) != MP_OK) goto CLEANUP; in mp_int_exptmod()
1193 if ((res = s_brmu(TEMP(1), m)) != MP_OK) goto CLEANUP; in mp_int_exptmod()
1195 if ((res = s_embar(TEMP(0), b, m, TEMP(1), s)) != MP_OK) in mp_int_exptmod()
1241 SETUP(mp_int_init_size(TEMP(0), 2 * um)); in mp_int_exptmod_known()
1244 SETUP(mp_int_init_size(TEMP(1), 2 * um)); in mp_int_exptmod_known()
1245 s = TEMP(1); in mp_int_exptmod_known()
1251 if ((res = mp_int_mod(a, m, TEMP(0))) != MP_OK) goto CLEANUP; in mp_int_exptmod_known()
1253 if ((res = s_embar(TEMP(0), b, m, mu, s)) != MP_OK) in mp_int_exptmod_known()
1285 if ((res = mp_int_egcd(a, m, TEMP(0), TEMP(1), NULL)) != MP_OK) in mp_int_invmod()
1288 if (mp_int_compare_value(TEMP(0), 1) != 0) { in mp_int_invmod()
1294 if ((res = mp_int_mod(TEMP(1), m, TEMP(1))) != MP_OK) in mp_int_invmod()
1303 res = mp_int_sub(m, TEMP(1), c); in mp_int_invmod()
1305 res = mp_int_copy(TEMP(1), c); in mp_int_invmod()
1417 TEMP(0)->digits[0] = 1; in mp_int_egcd()
1418 TEMP(3)->digits[0] = 1; in mp_int_egcd()
1420 SETUP(mp_int_init_copy(TEMP(4), a)); in mp_int_egcd()
1421 SETUP(mp_int_init_copy(TEMP(5), b)); in mp_int_egcd()
1424 MP_SIGN(TEMP(4)) = MP_ZPOS; in mp_int_egcd()
1425 MP_SIGN(TEMP(5)) = MP_ZPOS; in mp_int_egcd()
1428 int div2_u = s_dp2k(TEMP(4)), div2_v = s_dp2k(TEMP(5)); in mp_int_egcd()
1431 s_qdiv(TEMP(4), k); in mp_int_egcd()
1432 s_qdiv(TEMP(5), k); in mp_int_egcd()
1435 SETUP(mp_int_init_copy(TEMP(6), TEMP(4))); in mp_int_egcd()
1436 SETUP(mp_int_init_copy(TEMP(7), TEMP(5))); in mp_int_egcd()
1439 while (mp_int_is_even(TEMP(4))) { in mp_int_egcd()
1440 s_qdiv(TEMP(4), 1); in mp_int_egcd()
1442 if (mp_int_is_odd(TEMP(0)) || mp_int_is_odd(TEMP(1))) { in mp_int_egcd()
1443 if ((res = mp_int_add(TEMP(0), TEMP(7), TEMP(0))) != MP_OK) in mp_int_egcd()
1445 if ((res = mp_int_sub(TEMP(1), TEMP(6), TEMP(1))) != MP_OK) in mp_int_egcd()
1449 s_qdiv(TEMP(0), 1); in mp_int_egcd()
1450 s_qdiv(TEMP(1), 1); in mp_int_egcd()
1453 while (mp_int_is_even(TEMP(5))) { in mp_int_egcd()
1454 s_qdiv(TEMP(5), 1); in mp_int_egcd()
1456 if (mp_int_is_odd(TEMP(2)) || mp_int_is_odd(TEMP(3))) { in mp_int_egcd()
1457 if ((res = mp_int_add(TEMP(2), TEMP(7), TEMP(2))) != MP_OK) in mp_int_egcd()
1459 if ((res = mp_int_sub(TEMP(3), TEMP(6), TEMP(3))) != MP_OK) in mp_int_egcd()
1463 s_qdiv(TEMP(2), 1); in mp_int_egcd()
1464 s_qdiv(TEMP(3), 1); in mp_int_egcd()
1467 if (mp_int_compare(TEMP(4), TEMP(5)) >= 0) { in mp_int_egcd()
1468 if ((res = mp_int_sub(TEMP(4), TEMP(5), TEMP(4))) != MP_OK) goto CLEANUP; in mp_int_egcd()
1469 if ((res = mp_int_sub(TEMP(0), TEMP(2), TEMP(0))) != MP_OK) goto CLEANUP; in mp_int_egcd()
1470 if ((res = mp_int_sub(TEMP(1), TEMP(3), TEMP(1))) != MP_OK) goto CLEANUP; in mp_int_egcd()
1473 if ((res = mp_int_sub(TEMP(5), TEMP(4), TEMP(5))) != MP_OK) goto CLEANUP; in mp_int_egcd()
1474 if ((res = mp_int_sub(TEMP(2), TEMP(0), TEMP(2))) != MP_OK) goto CLEANUP; in mp_int_egcd()
1475 if ((res = mp_int_sub(TEMP(3), TEMP(1), TEMP(3))) != MP_OK) goto CLEANUP; in mp_int_egcd()
1478 if (CMPZ(TEMP(4)) == 0) { in mp_int_egcd()
1479 if (x && (res = mp_int_copy(TEMP(2), x)) != MP_OK) goto CLEANUP; in mp_int_egcd()
1480 if (y && (res = mp_int_copy(TEMP(3), y)) != MP_OK) goto CLEANUP; in mp_int_egcd()
1482 if (!s_qmul(TEMP(5), k)) { in mp_int_egcd()
1487 res = mp_int_copy(TEMP(5), c); in mp_int_egcd()
1573 (void) mp_int_abs(TEMP(0), TEMP(0)); in mp_int_root()
1574 (void) mp_int_abs(TEMP(1), TEMP(1)); in mp_int_root()
1577 if ((res = mp_int_expt(TEMP(1), b, TEMP(2))) != MP_OK) in mp_int_root()
1580 if (mp_int_compare_unsigned(TEMP(2), TEMP(0)) <= 0) in mp_int_root()
1583 if ((res = mp_int_sub(TEMP(2), TEMP(0), TEMP(2))) != MP_OK) in mp_int_root()
1585 if ((res = mp_int_expt(TEMP(1), b - 1, TEMP(3))) != MP_OK) in mp_int_root()
1587 if ((res = mp_int_mul_value(TEMP(3), b, TEMP(3))) != MP_OK) in mp_int_root()
1589 if ((res = mp_int_div(TEMP(2), TEMP(3), TEMP(4), NULL)) != MP_OK) in mp_int_root()
1591 if ((res = mp_int_sub(TEMP(1), TEMP(4), TEMP(4))) != MP_OK) in mp_int_root()
1594 if (mp_int_compare_unsigned(TEMP(1), TEMP(4)) == 0) { in mp_int_root()
1595 if ((res = mp_int_sub_value(TEMP(4), 1, TEMP(4))) != MP_OK) in mp_int_root()
1598 if ((res = mp_int_copy(TEMP(4), TEMP(1))) != MP_OK) in mp_int_root()
1602 if ((res = mp_int_copy(TEMP(1), c)) != MP_OK) in mp_int_root()
2762 ZERO(MP_DIGITS(TEMP(last__ - 1)), MP_ALLOC(TEMP(last__ - 1))); in s_embar()
2774 UMUL(c, a, TEMP(0)); in s_embar()
2775 if (!s_reduce(TEMP(0), m, mu, TEMP(1), TEMP(2))) { in s_embar()
2778 mp_int_copy(TEMP(0), c); in s_embar()
2782 USQR(a, TEMP(0)); in s_embar()
2783 assert(MP_SIGN(TEMP(0)) == MP_ZPOS); in s_embar()
2784 if (!s_reduce(TEMP(0), m, mu, TEMP(1), TEMP(2))) { in s_embar()
2787 assert(MP_SIGN(TEMP(0)) == MP_ZPOS); in s_embar()
2788 mp_int_copy(TEMP(0), a); in s_embar()
2798 UMUL(c, a, TEMP(0)); in s_embar()
2799 if (!s_reduce(TEMP(0), m, mu, TEMP(1), TEMP(2))) { in s_embar()
2802 mp_int_copy(TEMP(0), c); in s_embar()
2808 USQR(a, TEMP(0)); in s_embar()
2809 if (!s_reduce(TEMP(0), m, mu, TEMP(1), TEMP(2))) { in s_embar()
2812 (void) mp_int_copy(TEMP(0), a); in s_embar()