• Home
  • Raw
  • Download

Lines Matching refs:MP_OKAY

101 #define MP_OKAY       0   /* ok result */  macro
240 if ((res = mp_grow (c, max + 1)) != MP_OKAY) { in s_mp_add()
303 return MP_OKAY; in s_mp_add()
318 if ((res = mp_grow (c, max)) != MP_OKAY) { in s_mp_sub()
370 return MP_OKAY; in s_mp_sub()
396 return MP_OKAY; in mp_init()
545 if ((res = mp_init (&t)) != MP_OKAY) { in mp_mulmod()
549 if ((res = mp_mul (a, b, &t)) != MP_OKAY) { in mp_mulmod()
565 if ((res = mp_init (&t)) != MP_OKAY) { in mp_mod()
569 if ((res = mp_div (a, b, NULL, &t)) != MP_OKAY) { in mp_mod()
577 res = MP_OKAY; in mp_mod()
610 if ((err = mp_init(&tmpG)) != MP_OKAY) { in mp_exptmod()
613 if ((err = mp_invmod(G, P, &tmpG)) != MP_OKAY) { in mp_exptmod()
619 if ((err = mp_init(&tmpX)) != MP_OKAY) { in mp_exptmod()
623 if ((err = mp_abs(X, &tmpX)) != MP_OKAY) { in mp_exptmod()
783 &A, &B, &C, &D, NULL)) != MP_OKAY) { in mp_invmod_slow()
788 if ((res = mp_mod(a, b, &x)) != MP_OKAY) { in mp_invmod_slow()
791 if ((res = mp_copy (b, &y)) != MP_OKAY) { in mp_invmod_slow()
802 if ((res = mp_copy (&x, &u)) != MP_OKAY) { in mp_invmod_slow()
805 if ((res = mp_copy (&y, &v)) != MP_OKAY) { in mp_invmod_slow()
815 if ((res = mp_div_2 (&u, &u)) != MP_OKAY) { in mp_invmod_slow()
821 if ((res = mp_add (&A, &y, &A)) != MP_OKAY) { in mp_invmod_slow()
824 if ((res = mp_sub (&B, &x, &B)) != MP_OKAY) { in mp_invmod_slow()
829 if ((res = mp_div_2 (&A, &A)) != MP_OKAY) { in mp_invmod_slow()
832 if ((res = mp_div_2 (&B, &B)) != MP_OKAY) { in mp_invmod_slow()
840 if ((res = mp_div_2 (&v, &v)) != MP_OKAY) { in mp_invmod_slow()
846 if ((res = mp_add (&C, &y, &C)) != MP_OKAY) { in mp_invmod_slow()
849 if ((res = mp_sub (&D, &x, &D)) != MP_OKAY) { in mp_invmod_slow()
854 if ((res = mp_div_2 (&C, &C)) != MP_OKAY) { in mp_invmod_slow()
857 if ((res = mp_div_2 (&D, &D)) != MP_OKAY) { in mp_invmod_slow()
865 if ((res = mp_sub (&u, &v, &u)) != MP_OKAY) { in mp_invmod_slow()
869 if ((res = mp_sub (&A, &C, &A)) != MP_OKAY) { in mp_invmod_slow()
873 if ((res = mp_sub (&B, &D, &B)) != MP_OKAY) { in mp_invmod_slow()
878 if ((res = mp_sub (&v, &u, &v)) != MP_OKAY) { in mp_invmod_slow()
882 if ((res = mp_sub (&C, &A, &C)) != MP_OKAY) { in mp_invmod_slow()
886 if ((res = mp_sub (&D, &B, &D)) != MP_OKAY) { in mp_invmod_slow()
905 if ((res = mp_add(&C, b, &C)) != MP_OKAY) { in mp_invmod_slow()
912 if ((res = mp_sub(&C, b, &C)) != MP_OKAY) { in mp_invmod_slow()
919 res = MP_OKAY; in mp_invmod_slow()
968 if ((res = mp_grow(a, 2)) != MP_OKAY) { in mp_read_unsigned_bin()
978 if ((res = mp_mul_2d (a, 8, a)) != MP_OKAY) { in mp_read_unsigned_bin()
992 return MP_OKAY; in mp_read_unsigned_bin()
1002 if ((res = mp_init_copy (&t, a)) != MP_OKAY) { in mp_to_unsigned_bin()
1013 if ((res = mp_div_2d (&t, 8, &t, NULL)) != MP_OKAY) { in mp_to_unsigned_bin()
1020 return MP_OKAY; in mp_to_unsigned_bin()
1041 if ((res = mp_init (&t)) != MP_OKAY) { in mp_div_2d()
1047 if ((res = mp_mod_2d (a, b, &t)) != MP_OKAY) { in mp_div_2d()
1054 if ((res = mp_copy (a, c)) != MP_OKAY) { in mp_div_2d()
1097 return MP_OKAY; in mp_div_2d()
1105 if ((res = mp_init (a)) != MP_OKAY) { in mp_init_copy()
1135 return MP_OKAY; in mp_copy()
1140 if ((res = mp_grow (b, a->used)) != MP_OKAY) { in mp_copy()
1171 return MP_OKAY; in mp_copy()
1296 return MP_OKAY; in mp_grow()
1311 if ((res = mp_copy (a, b)) != MP_OKAY) { in mp_abs()
1319 return MP_OKAY; in mp_abs()
1341 if ((res = mp_grow (b, a->used)) != MP_OKAY) { in mp_div_2()
1378 return MP_OKAY; in mp_div_2()
1391 if ((res = mp_copy (a, c)) != MP_OKAY) { in mp_mul_2d()
1397 if ((res = mp_grow (c, c->used + b / DIGIT_BIT + 1)) != MP_OKAY) { in mp_mul_2d()
1404 if ((res = mp_lshd (c, b / DIGIT_BIT)) != MP_OKAY) { in mp_mul_2d()
1444 return MP_OKAY; in mp_mul_2d()
1451 mp_err res = MP_OKAY; /* Assume ok until proven otherwise */ in mp_init_multi()
1458 if (mp_init(cur_arg) != MP_OKAY) { in mp_init_multi()
1508 return MP_OKAY; in mp_lshd()
1513 if ((res = mp_grow (a, a->used + b)) != MP_OKAY) { in mp_lshd()
1544 return MP_OKAY; in mp_lshd()
1580 return MP_OKAY; in mp_mod_2d()
1590 if ((res = mp_copy (a, c)) != MP_OKAY) { in mp_mod_2d()
1602 return MP_OKAY; in mp_mod_2d()
1624 res = MP_OKAY; in mp_div()
1633 if ((res = mp_init_multi(&ta, &tb, &tq, &q, NULL)) != MP_OKAY) { in mp_div()
1640 if (((res = mp_abs(a, &ta)) != MP_OKAY) || in mp_div()
1641 ((res = mp_abs(b, &tb)) != MP_OKAY) || in mp_div()
1642 ((res = mp_mul_2d(&tb, n, &tb)) != MP_OKAY) || in mp_div()
1643 ((res = mp_mul_2d(&tq, n, &tq)) != MP_OKAY)) { in mp_div()
1649 if (((res = mp_sub(&ta, &tb, &ta)) != MP_OKAY) || in mp_div()
1650 ((res = mp_add(&q, &tq, &q)) != MP_OKAY)) { in mp_div()
1654 if (((res = mp_div_2d(&tb, 1, &tb, NULL)) != MP_OKAY) || in mp_div()
1655 ((res = mp_div_2d(&tq, 1, &tq, NULL)) != MP_OKAY)) { in mp_div()
1706 res = MP_OKAY; in mp_div()
1714 if ((res = mp_init_size (&q, a->used + 2)) != MP_OKAY) { in mp_div()
1719 if ((res = mp_init (&t1)) != MP_OKAY) { in mp_div()
1723 if ((res = mp_init (&t2)) != MP_OKAY) { in mp_div()
1727 if ((res = mp_init_copy (&x, a)) != MP_OKAY) { in mp_div()
1731 if ((res = mp_init_copy (&y, b)) != MP_OKAY) { in mp_div()
1743 if ((res = mp_mul_2d (&x, norm, &x)) != MP_OKAY) { in mp_div()
1746 if ((res = mp_mul_2d (&y, norm, &y)) != MP_OKAY) { in mp_div()
1758 if ((res = mp_lshd (&y, n - t)) != MP_OKAY) { /* y = y*b**{n-t} */ in mp_div()
1764 if ((res = mp_sub (&x, &y, &x)) != MP_OKAY) { in mp_div()
1806 if ((res = mp_mul_d (&t1, q.dp[i - t - 1], &t1)) != MP_OKAY) { in mp_div()
1818 if ((res = mp_mul_d (&y, q.dp[i - t - 1], &t1)) != MP_OKAY) { in mp_div()
1822 if ((res = mp_lshd (&t1, i - t - 1)) != MP_OKAY) { in mp_div()
1826 if ((res = mp_sub (&x, &t1, &x)) != MP_OKAY) { in mp_div()
1832 if ((res = mp_copy (&y, &t1)) != MP_OKAY) { in mp_div()
1835 if ((res = mp_lshd (&t1, i - t - 1)) != MP_OKAY) { in mp_div()
1838 if ((res = mp_add (&x, &t1, &x)) != MP_OKAY) { in mp_div()
1864 res = MP_OKAY; in mp_div()
1916 if ((err = mp_init(&M[1])) != MP_OKAY) { in s_mp_exptmod()
1922 if ((err = mp_init(&M[x])) != MP_OKAY) { in s_mp_exptmod()
1932 if ((err = mp_init (&mu)) != MP_OKAY) { in s_mp_exptmod()
1937 if ((err = mp_reduce_setup (&mu, P)) != MP_OKAY) { in s_mp_exptmod()
1942 if ((err = mp_reduce_2k_setup_l (P, &mu)) != MP_OKAY) { in s_mp_exptmod()
1956 if ((err = mp_mod (G, P, &M[1])) != MP_OKAY) { in s_mp_exptmod()
1963 if ((err = mp_copy (&M[1], &M[1 << (winsize - 1)])) != MP_OKAY) { in s_mp_exptmod()
1970 &M[1 << (winsize - 1)])) != MP_OKAY) { in s_mp_exptmod()
1975 if ((err = redux (&M[1 << (winsize - 1)], P, &mu)) != MP_OKAY) { in s_mp_exptmod()
1984 if ((err = mp_mul (&M[x - 1], &M[1], &M[x])) != MP_OKAY) { in s_mp_exptmod()
1987 if ((err = redux (&M[x], P, &mu)) != MP_OKAY) { in s_mp_exptmod()
1993 if ((err = mp_init (&res)) != MP_OKAY) { in s_mp_exptmod()
2033 if ((err = mp_sqr (&res, &res)) != MP_OKAY) { in s_mp_exptmod()
2036 if ((err = redux (&res, P, &mu)) != MP_OKAY) { in s_mp_exptmod()
2050 if ((err = mp_sqr (&res, &res)) != MP_OKAY) { in s_mp_exptmod()
2053 if ((err = redux (&res, P, &mu)) != MP_OKAY) { in s_mp_exptmod()
2059 if ((err = mp_mul (&res, &M[bitbuf], &res)) != MP_OKAY) { in s_mp_exptmod()
2062 if ((err = redux (&res, P, &mu)) != MP_OKAY) { in s_mp_exptmod()
2077 if ((err = mp_sqr (&res, &res)) != MP_OKAY) { in s_mp_exptmod()
2080 if ((err = redux (&res, P, &mu)) != MP_OKAY) { in s_mp_exptmod()
2087 if ((err = mp_mul (&res, &M[1], &res)) != MP_OKAY) { in s_mp_exptmod()
2090 if ((err = redux (&res, P, &mu)) != MP_OKAY) { in s_mp_exptmod()
2098 err = MP_OKAY; in s_mp_exptmod()
2157 if ((res = mp_init(&q)) != MP_OKAY) { in mp_reduce_2k_l()
2164 if ((res = mp_div_2d(a, p, &q, a)) != MP_OKAY) { in mp_reduce_2k_l()
2169 if ((res = mp_mul(&q, d, &q)) != MP_OKAY) { in mp_reduce_2k_l()
2174 if ((res = s_mp_add(a, &q, a)) != MP_OKAY) { in mp_reduce_2k_l()
2195 if ((res = mp_init(&tmp)) != MP_OKAY) { in mp_reduce_2k_setup_l()
2199 if ((res = mp_2expt(&tmp, mp_count_bits(a))) != MP_OKAY) { in mp_reduce_2k_setup_l()
2203 if ((res = s_mp_sub(&tmp, a, d)) != MP_OKAY) { in mp_reduce_2k_setup_l()
2226 if ((res = mp_grow (a, b / DIGIT_BIT + 1)) != MP_OKAY) { in mp_2expt()
2236 return MP_OKAY; in mp_2expt()
2247 if ((res = mp_2expt (a, b->used * 2 * DIGIT_BIT)) != MP_OKAY) { in mp_reduce_setup()
2264 if ((res = mp_init_copy (&q, x)) != MP_OKAY) { in mp_reduce()
2273 if ((res = mp_mul (&q, mu, &q)) != MP_OKAY) { in mp_reduce()
2278 if ((res = s_mp_mul_high_digs (&q, mu, &q, um)) != MP_OKAY) { in mp_reduce()
2282 if ((res = fast_s_mp_mul_high_digs (&q, mu, &q, um)) != MP_OKAY) { in mp_reduce()
2298 if ((res = mp_mod_2d (x, DIGIT_BIT * (um + 1), x)) != MP_OKAY) { in mp_reduce()
2303 if ((res = s_mp_mul_digs (&q, m, &q, um + 1)) != MP_OKAY) { in mp_reduce()
2308 if ((res = mp_sub (x, &q, x)) != MP_OKAY) { in mp_reduce()
2315 if ((res = mp_lshd (&q, um + 1)) != MP_OKAY) { in mp_reduce()
2318 if ((res = mp_add (x, &q, x)) != MP_OKAY) { in mp_reduce()
2325 if ((res = s_mp_sub (x, m, x)) != MP_OKAY) { in mp_reduce()
2358 if ((res = mp_init_size (&t, digs)) != MP_OKAY) { in s_mp_mul_digs()
2405 return MP_OKAY; in s_mp_mul_digs()
2434 if ((res = mp_grow (c, digs)) != MP_OKAY) { in fast_s_mp_mul_digs()
2493 return MP_OKAY; in fast_s_mp_mul_digs()
2522 return MP_OKAY; in mp_init_size()
2535 if ((res = mp_init_size (&t, 2*pa + 1)) != MP_OKAY) { in s_mp_sqr()
2586 return MP_OKAY; in s_mp_sqr()
2609 if ((res = mp_init_size (&t, a->used + b->used + 1)) != MP_OKAY) { in s_mp_mul_high_digs()
2646 return MP_OKAY; in s_mp_mul_high_digs()
2686 return MP_OKAY; in mp_montgomery_setup()
2710 if ((res = mp_grow (x, n->used + 1)) != MP_OKAY) { in fast_mp_montgomery_reduce()
2840 return MP_OKAY; in fast_mp_montgomery_reduce()
2853 if ((res = mp_grow (b, a->used + 1)) != MP_OKAY) { in mp_mul_2()
2904 return MP_OKAY; in mp_mul_2()
2924 if ((res = mp_2expt (a, (b->used - 1) * DIGIT_BIT + bits - 1)) != MP_OKAY) { in mp_montgomery_calc_normalization()
2935 if ((res = mp_mul_2 (a, a)) != MP_OKAY) { in mp_montgomery_calc_normalization()
2939 if ((res = s_mp_sub (a, b, a)) != MP_OKAY) { in mp_montgomery_calc_normalization()
2945 return MP_OKAY; in mp_montgomery_calc_normalization()
2997 if ((err = mp_init(&M[1])) != MP_OKAY) { in mp_exptmod_fast()
3003 if ((err = mp_init(&M[x])) != MP_OKAY) { in mp_exptmod_fast()
3016 if ((err = mp_montgomery_setup (P, &mp)) != MP_OKAY) { in mp_exptmod_fast()
3052 if ((err = mp_reduce_2k_setup(P, &mp)) != MP_OKAY) { in mp_exptmod_fast()
3063 if ((err = mp_init (&res)) != MP_OKAY) { in mp_exptmod_fast()
3077 if ((err = mp_montgomery_calc_normalization (&res, P)) != MP_OKAY) { in mp_exptmod_fast()
3086 if ((err = mp_mulmod (G, &res, P, &M[1])) != MP_OKAY) { in mp_exptmod_fast()
3091 if ((err = mp_mod(G, P, &M[1])) != MP_OKAY) { in mp_exptmod_fast()
3097 if ((err = mp_copy (&M[1], &M[1 << (winsize - 1)])) != MP_OKAY) { in mp_exptmod_fast()
3102 if ((err = mp_sqr (&M[1 << (winsize - 1)], &M[1 << (winsize - 1)])) != MP_OKAY) { in mp_exptmod_fast()
3105 if ((err = redux (&M[1 << (winsize - 1)], P, mp)) != MP_OKAY) { in mp_exptmod_fast()
3112 if ((err = mp_mul (&M[x - 1], &M[1], &M[x])) != MP_OKAY) { in mp_exptmod_fast()
3115 if ((err = redux (&M[x], P, mp)) != MP_OKAY) { in mp_exptmod_fast()
3155 if ((err = mp_sqr (&res, &res)) != MP_OKAY) { in mp_exptmod_fast()
3158 if ((err = redux (&res, P, mp)) != MP_OKAY) { in mp_exptmod_fast()
3172 if ((err = mp_sqr (&res, &res)) != MP_OKAY) { in mp_exptmod_fast()
3175 if ((err = redux (&res, P, mp)) != MP_OKAY) { in mp_exptmod_fast()
3181 if ((err = mp_mul (&res, &M[bitbuf], &res)) != MP_OKAY) { in mp_exptmod_fast()
3184 if ((err = redux (&res, P, mp)) != MP_OKAY) { in mp_exptmod_fast()
3199 if ((err = mp_sqr (&res, &res)) != MP_OKAY) { in mp_exptmod_fast()
3202 if ((err = redux (&res, P, mp)) != MP_OKAY) { in mp_exptmod_fast()
3210 if ((err = mp_mul (&res, &M[1], &res)) != MP_OKAY) { in mp_exptmod_fast()
3213 if ((err = redux (&res, P, mp)) != MP_OKAY) { in mp_exptmod_fast()
3227 if ((err = redux(&res, P, mp)) != MP_OKAY) { in mp_exptmod_fast()
3234 err = MP_OKAY; in mp_exptmod_fast()
3266 if ((res = mp_grow (b, pa)) != MP_OKAY) { in fast_s_mp_sqr()
3337 return MP_OKAY; in fast_s_mp_sqr()
3353 if ((res = mp_grow (c, a->used + 1)) != MP_OKAY) { in mp_mul_d()
3398 return MP_OKAY; in mp_mul_d()