Lines Matching refs:MP_OKAY
101 #define MP_OKAY 0 /* ok result */
240 if ((res = mp_grow (c, max + 1)) != MP_OKAY) {
303 return MP_OKAY;
318 if ((res = mp_grow (c, max)) != MP_OKAY) {
370 return MP_OKAY;
396 return MP_OKAY;
545 if ((res = mp_init (&t)) != MP_OKAY) {
549 if ((res = mp_mul (a, b, &t)) != MP_OKAY) {
565 if ((res = mp_init (&t)) != MP_OKAY) {
569 if ((res = mp_div (a, b, NULL, &t)) != MP_OKAY) {
577 res = MP_OKAY;
610 if ((err = mp_init(&tmpG)) != MP_OKAY) {
613 if ((err = mp_invmod(G, P, &tmpG)) != MP_OKAY) {
619 if ((err = mp_init(&tmpX)) != MP_OKAY) {
623 if ((err = mp_abs(X, &tmpX)) != MP_OKAY) {
783 &A, &B, &C, &D, NULL)) != MP_OKAY) {
788 if ((res = mp_mod(a, b, &x)) != MP_OKAY) {
791 if ((res = mp_copy (b, &y)) != MP_OKAY) {
802 if ((res = mp_copy (&x, &u)) != MP_OKAY) {
805 if ((res = mp_copy (&y, &v)) != MP_OKAY) {
815 if ((res = mp_div_2 (&u, &u)) != MP_OKAY) {
821 if ((res = mp_add (&A, &y, &A)) != MP_OKAY) {
824 if ((res = mp_sub (&B, &x, &B)) != MP_OKAY) {
829 if ((res = mp_div_2 (&A, &A)) != MP_OKAY) {
832 if ((res = mp_div_2 (&B, &B)) != MP_OKAY) {
840 if ((res = mp_div_2 (&v, &v)) != MP_OKAY) {
846 if ((res = mp_add (&C, &y, &C)) != MP_OKAY) {
849 if ((res = mp_sub (&D, &x, &D)) != MP_OKAY) {
854 if ((res = mp_div_2 (&C, &C)) != MP_OKAY) {
857 if ((res = mp_div_2 (&D, &D)) != MP_OKAY) {
865 if ((res = mp_sub (&u, &v, &u)) != MP_OKAY) {
869 if ((res = mp_sub (&A, &C, &A)) != MP_OKAY) {
873 if ((res = mp_sub (&B, &D, &B)) != MP_OKAY) {
878 if ((res = mp_sub (&v, &u, &v)) != MP_OKAY) {
882 if ((res = mp_sub (&C, &A, &C)) != MP_OKAY) {
886 if ((res = mp_sub (&D, &B, &D)) != MP_OKAY) {
905 if ((res = mp_add(&C, b, &C)) != MP_OKAY) {
912 if ((res = mp_sub(&C, b, &C)) != MP_OKAY) {
919 res = MP_OKAY;
968 if ((res = mp_grow(a, 2)) != MP_OKAY) {
978 if ((res = mp_mul_2d (a, 8, a)) != MP_OKAY) {
992 return MP_OKAY;
1002 if ((res = mp_init_copy (&t, a)) != MP_OKAY) {
1013 if ((res = mp_div_2d (&t, 8, &t, NULL)) != MP_OKAY) {
1020 return MP_OKAY;
1041 if ((res = mp_init (&t)) != MP_OKAY) {
1047 if ((res = mp_mod_2d (a, b, &t)) != MP_OKAY) {
1054 if ((res = mp_copy (a, c)) != MP_OKAY) {
1097 return MP_OKAY;
1105 if ((res = mp_init (a)) != MP_OKAY) {
1135 return MP_OKAY;
1140 if ((res = mp_grow (b, a->used)) != MP_OKAY) {
1171 return MP_OKAY;
1296 return MP_OKAY;
1311 if ((res = mp_copy (a, b)) != MP_OKAY) {
1319 return MP_OKAY;
1341 if ((res = mp_grow (b, a->used)) != MP_OKAY) {
1378 return MP_OKAY;
1391 if ((res = mp_copy (a, c)) != MP_OKAY) {
1397 if ((res = mp_grow (c, c->used + b / DIGIT_BIT + 1)) != MP_OKAY) {
1404 if ((res = mp_lshd (c, b / DIGIT_BIT)) != MP_OKAY) {
1444 return MP_OKAY;
1451 mp_err res = MP_OKAY; /* Assume ok until proven otherwise */
1458 if (mp_init(cur_arg) != MP_OKAY) {
1509 return MP_OKAY;
1514 if ((res = mp_grow (a, a->used + b)) != MP_OKAY) {
1545 return MP_OKAY;
1581 return MP_OKAY;
1591 if ((res = mp_copy (a, c)) != MP_OKAY) {
1603 return MP_OKAY;
1625 res = MP_OKAY;
1634 if ((res = mp_init_multi(&ta, &tb, &tq, &q, NULL) != MP_OKAY)) {
1641 if (((res = mp_abs(a, &ta)) != MP_OKAY) ||
1642 ((res = mp_abs(b, &tb)) != MP_OKAY) ||
1643 ((res = mp_mul_2d(&tb, n, &tb)) != MP_OKAY) ||
1644 ((res = mp_mul_2d(&tq, n, &tq)) != MP_OKAY)) {
1650 if (((res = mp_sub(&ta, &tb, &ta)) != MP_OKAY) ||
1651 ((res = mp_add(&q, &tq, &q)) != MP_OKAY)) {
1655 if (((res = mp_div_2d(&tb, 1, &tb, NULL)) != MP_OKAY) ||
1656 ((res = mp_div_2d(&tq, 1, &tq, NULL)) != MP_OKAY)) {
1707 res = MP_OKAY;
1715 if ((res = mp_init_size (&q, a->used + 2)) != MP_OKAY) {
1720 if ((res = mp_init (&t1)) != MP_OKAY) {
1724 if ((res = mp_init (&t2)) != MP_OKAY) {
1728 if ((res = mp_init_copy (&x, a)) != MP_OKAY) {
1732 if ((res = mp_init_copy (&y, b)) != MP_OKAY) {
1744 if ((res = mp_mul_2d (&x, norm, &x)) != MP_OKAY) {
1747 if ((res = mp_mul_2d (&y, norm, &y)) != MP_OKAY) {
1759 if ((res = mp_lshd (&y, n - t)) != MP_OKAY) { /* y = y*b**{n-t} */
1765 if ((res = mp_sub (&x, &y, &x)) != MP_OKAY) {
1807 if ((res = mp_mul_d (&t1, q.dp[i - t - 1], &t1)) != MP_OKAY) {
1819 if ((res = mp_mul_d (&y, q.dp[i - t - 1], &t1)) != MP_OKAY) {
1823 if ((res = mp_lshd (&t1, i - t - 1)) != MP_OKAY) {
1827 if ((res = mp_sub (&x, &t1, &x)) != MP_OKAY) {
1833 if ((res = mp_copy (&y, &t1)) != MP_OKAY) {
1836 if ((res = mp_lshd (&t1, i - t - 1)) != MP_OKAY) {
1839 if ((res = mp_add (&x, &t1, &x)) != MP_OKAY) {
1865 res = MP_OKAY;
1917 if ((err = mp_init(&M[1])) != MP_OKAY) {
1923 if ((err = mp_init(&M[x])) != MP_OKAY) {
1933 if ((err = mp_init (&mu)) != MP_OKAY) {
1938 if ((err = mp_reduce_setup (&mu, P)) != MP_OKAY) {
1943 if ((err = mp_reduce_2k_setup_l (P, &mu)) != MP_OKAY) {
1957 if ((err = mp_mod (G, P, &M[1])) != MP_OKAY) {
1964 if ((err = mp_copy (&M[1], &M[1 << (winsize - 1)])) != MP_OKAY) {
1971 &M[1 << (winsize - 1)])) != MP_OKAY) {
1976 if ((err = redux (&M[1 << (winsize - 1)], P, &mu)) != MP_OKAY) {
1985 if ((err = mp_mul (&M[x - 1], &M[1], &M[x])) != MP_OKAY) {
1988 if ((err = redux (&M[x], P, &mu)) != MP_OKAY) {
1994 if ((err = mp_init (&res)) != MP_OKAY) {
2034 if ((err = mp_sqr (&res, &res)) != MP_OKAY) {
2037 if ((err = redux (&res, P, &mu)) != MP_OKAY) {
2051 if ((err = mp_sqr (&res, &res)) != MP_OKAY) {
2054 if ((err = redux (&res, P, &mu)) != MP_OKAY) {
2060 if ((err = mp_mul (&res, &M[bitbuf], &res)) != MP_OKAY) {
2063 if ((err = redux (&res, P, &mu)) != MP_OKAY) {
2078 if ((err = mp_sqr (&res, &res)) != MP_OKAY) {
2081 if ((err = redux (&res, P, &mu)) != MP_OKAY) {
2088 if ((err = mp_mul (&res, &M[1], &res)) != MP_OKAY) {
2091 if ((err = redux (&res, P, &mu)) != MP_OKAY) {
2099 err = MP_OKAY;
2158 if ((res = mp_init(&q)) != MP_OKAY) {
2165 if ((res = mp_div_2d(a, p, &q, a)) != MP_OKAY) {
2170 if ((res = mp_mul(&q, d, &q)) != MP_OKAY) {
2175 if ((res = s_mp_add(a, &q, a)) != MP_OKAY) {
2196 if ((res = mp_init(&tmp)) != MP_OKAY) {
2200 if ((res = mp_2expt(&tmp, mp_count_bits(a))) != MP_OKAY) {
2204 if ((res = s_mp_sub(&tmp, a, d)) != MP_OKAY) {
2227 if ((res = mp_grow (a, b / DIGIT_BIT + 1)) != MP_OKAY) {
2237 return MP_OKAY;
2248 if ((res = mp_2expt (a, b->used * 2 * DIGIT_BIT)) != MP_OKAY) {
2265 if ((res = mp_init_copy (&q, x)) != MP_OKAY) {
2274 if ((res = mp_mul (&q, mu, &q)) != MP_OKAY) {
2279 if ((res = s_mp_mul_high_digs (&q, mu, &q, um)) != MP_OKAY) {
2283 if ((res = fast_s_mp_mul_high_digs (&q, mu, &q, um)) != MP_OKAY) {
2299 if ((res = mp_mod_2d (x, DIGIT_BIT * (um + 1), x)) != MP_OKAY) {
2304 if ((res = s_mp_mul_digs (&q, m, &q, um + 1)) != MP_OKAY) {
2309 if ((res = mp_sub (x, &q, x)) != MP_OKAY) {
2316 if ((res = mp_lshd (&q, um + 1)) != MP_OKAY) {
2319 if ((res = mp_add (x, &q, x)) != MP_OKAY) {
2326 if ((res = s_mp_sub (x, m, x)) != MP_OKAY) {
2359 if ((res = mp_init_size (&t, digs)) != MP_OKAY) {
2406 return MP_OKAY;
2435 if ((res = mp_grow (c, digs)) != MP_OKAY) {
2494 return MP_OKAY;
2523 return MP_OKAY;
2536 if ((res = mp_init_size (&t, 2*pa + 1)) != MP_OKAY) {
2587 return MP_OKAY;
2610 if ((res = mp_init_size (&t, a->used + b->used + 1)) != MP_OKAY) {
2647 return MP_OKAY;
2687 return MP_OKAY;
2711 if ((res = mp_grow (x, n->used + 1)) != MP_OKAY) {
2841 return MP_OKAY;
2854 if ((res = mp_grow (b, a->used + 1)) != MP_OKAY) {
2905 return MP_OKAY;
2925 if ((res = mp_2expt (a, (b->used - 1) * DIGIT_BIT + bits - 1)) != MP_OKAY) {
2936 if ((res = mp_mul_2 (a, a)) != MP_OKAY) {
2940 if ((res = s_mp_sub (a, b, a)) != MP_OKAY) {
2946 return MP_OKAY;
2998 if ((err = mp_init(&M[1])) != MP_OKAY) {
3004 if ((err = mp_init(&M[x])) != MP_OKAY) {
3017 if ((err = mp_montgomery_setup (P, &mp)) != MP_OKAY) {
3053 if ((err = mp_reduce_2k_setup(P, &mp)) != MP_OKAY) {
3064 if ((err = mp_init (&res)) != MP_OKAY) {
3078 if ((err = mp_montgomery_calc_normalization (&res, P)) != MP_OKAY) {
3087 if ((err = mp_mulmod (G, &res, P, &M[1])) != MP_OKAY) {
3092 if ((err = mp_mod(G, P, &M[1])) != MP_OKAY) {
3098 if ((err = mp_copy (&M[1], &M[1 << (winsize - 1)])) != MP_OKAY) {
3103 if ((err = mp_sqr (&M[1 << (winsize - 1)], &M[1 << (winsize - 1)])) != MP_OKAY) {
3106 if ((err = redux (&M[1 << (winsize - 1)], P, mp)) != MP_OKAY) {
3113 if ((err = mp_mul (&M[x - 1], &M[1], &M[x])) != MP_OKAY) {
3116 if ((err = redux (&M[x], P, mp)) != MP_OKAY) {
3156 if ((err = mp_sqr (&res, &res)) != MP_OKAY) {
3159 if ((err = redux (&res, P, mp)) != MP_OKAY) {
3173 if ((err = mp_sqr (&res, &res)) != MP_OKAY) {
3176 if ((err = redux (&res, P, mp)) != MP_OKAY) {
3182 if ((err = mp_mul (&res, &M[bitbuf], &res)) != MP_OKAY) {
3185 if ((err = redux (&res, P, mp)) != MP_OKAY) {
3200 if ((err = mp_sqr (&res, &res)) != MP_OKAY) {
3203 if ((err = redux (&res, P, mp)) != MP_OKAY) {
3211 if ((err = mp_mul (&res, &M[1], &res)) != MP_OKAY) {
3214 if ((err = redux (&res, P, mp)) != MP_OKAY) {
3228 if ((err = redux(&res, P, mp)) != MP_OKAY) {
3235 err = MP_OKAY;
3267 if ((res = mp_grow (b, pa)) != MP_OKAY) {
3338 return MP_OKAY;
3354 if ((res = mp_grow (c, a->used + 1)) != MP_OKAY) {
3399 return MP_OKAY;