• Home
  • Raw
  • Download

Lines Matching refs:res

79   int     res, neg;  in fast_mp_invmod()  local
87 if ((res = mp_init_multi(&x, &y, &u, &v, &B, &D, NULL)) != MP_OKAY) { in fast_mp_invmod()
88 return res; in fast_mp_invmod()
92 if ((res = mp_copy (b, &x)) != MP_OKAY) { in fast_mp_invmod()
97 if ((res = mp_mod (a, b, &y)) != MP_OKAY) { in fast_mp_invmod()
102 if ((res = mp_copy (&x, &u)) != MP_OKAY) { in fast_mp_invmod()
105 if ((res = mp_copy (&y, &v)) != MP_OKAY) { in fast_mp_invmod()
114 if ((res = mp_div_2 (&u, &u)) != MP_OKAY) { in fast_mp_invmod()
119 if ((res = mp_sub (&B, &x, &B)) != MP_OKAY) { in fast_mp_invmod()
124 if ((res = mp_div_2 (&B, &B)) != MP_OKAY) { in fast_mp_invmod()
132 if ((res = mp_div_2 (&v, &v)) != MP_OKAY) { in fast_mp_invmod()
138 if ((res = mp_sub (&D, &x, &D)) != MP_OKAY) { in fast_mp_invmod()
143 if ((res = mp_div_2 (&D, &D)) != MP_OKAY) { in fast_mp_invmod()
151 if ((res = mp_sub (&u, &v, &u)) != MP_OKAY) { in fast_mp_invmod()
155 if ((res = mp_sub (&B, &D, &B)) != MP_OKAY) { in fast_mp_invmod()
160 if ((res = mp_sub (&v, &u, &v)) != MP_OKAY) { in fast_mp_invmod()
164 if ((res = mp_sub (&D, &B, &D)) != MP_OKAY) { in fast_mp_invmod()
178 res = MP_VAL; in fast_mp_invmod()
185 if ((res = mp_add (&D, b, &D)) != MP_OKAY) { in fast_mp_invmod()
191 res = MP_OKAY; in fast_mp_invmod()
194 return res; in fast_mp_invmod()
232 int ix, res, olduse; in fast_mp_montgomery_reduce() local
240 if ((res = mp_grow (x, n->used + 1)) != MP_OKAY) { in fast_mp_montgomery_reduce()
241 return res; in fast_mp_montgomery_reduce()
416 int olduse, res, pa, ix, iz; in fast_s_mp_mul_digs() local
422 if ((res = mp_grow (c, digs)) != MP_OKAY) { in fast_s_mp_mul_digs()
423 return res; in fast_s_mp_mul_digs()
520 int olduse, res, pa, ix, iz; in fast_s_mp_mul_high_digs() local
527 if ((res = mp_grow (c, pa)) != MP_OKAY) { in fast_s_mp_mul_high_digs()
528 return res; in fast_s_mp_mul_high_digs()
623 int olduse, res, pa, ix, iz; in fast_s_mp_sqr() local
630 if ((res = mp_grow (b, pa)) != MP_OKAY) { in fast_s_mp_sqr()
631 return res; in fast_s_mp_sqr()
737 int res; in mp_2expt() local
743 if ((res = mp_grow (a, b / DIGIT_BIT + 1)) != MP_OKAY) { in mp_2expt()
744 return res; in mp_2expt()
788 int res; in mp_abs() local
792 if ((res = mp_copy (a, b)) != MP_OKAY) { in mp_abs()
793 return res; in mp_abs()
831 int sa, sb, res; in mp_add() local
842 res = s_mp_add (a, b, c); in mp_add()
850 res = s_mp_sub (b, a, c); in mp_add()
853 res = s_mp_sub (a, b, c); in mp_add()
856 return res; in mp_add()
889 int res, ix, oldused; in mp_add_d() local
894 if ((res = mp_grow(c, a->used + 1)) != MP_OKAY) { in mp_add_d()
895 return res; in mp_add_d()
905 res = mp_sub_d(a, b, c); in mp_add_d()
913 return res; in mp_add_d()
1005 int res; in mp_addmod() local
1008 if ((res = mp_init (&t)) != MP_OKAY) { in mp_addmod()
1009 return res; in mp_addmod()
1012 if ((res = mp_add (a, b, &t)) != MP_OKAY) { in mp_addmod()
1014 return res; in mp_addmod()
1016 res = mp_mod (&t, c, d); in mp_addmod()
1018 return res; in mp_addmod()
1050 int res, ix, px; in mp_and() local
1054 if ((res = mp_init_copy (&t, a)) != MP_OKAY) { in mp_and()
1055 return res; in mp_and()
1060 if ((res = mp_init_copy (&t, b)) != MP_OKAY) { in mp_and()
1061 return res; in mp_and()
1456 int res, n; in mp_copy() local
1465 if ((res = mp_grow (b, a->used)) != MP_OKAY) { in mp_copy()
1466 return res; in mp_copy()
1579 int res, n, n2; in mp_div() local
1589 res = mp_copy (a, d); in mp_div()
1591 res = MP_OKAY; in mp_div()
1596 return res; in mp_div()
1600 if ((res = mp_init_multi(&ta, &tb, &tq, &q, NULL) != MP_OKAY)) { in mp_div()
1601 return res; in mp_div()
1607 if (((res = mp_abs(a, &ta)) != MP_OKAY) || in mp_div()
1608 ((res = mp_abs(b, &tb)) != MP_OKAY) || in mp_div()
1609 ((res = mp_mul_2d(&tb, n, &tb)) != MP_OKAY) || in mp_div()
1610 ((res = mp_mul_2d(&tq, n, &tq)) != MP_OKAY)) { in mp_div()
1616 if (((res = mp_sub(&ta, &tb, &ta)) != MP_OKAY) || in mp_div()
1617 ((res = mp_add(&q, &tq, &q)) != MP_OKAY)) { in mp_div()
1621 if (((res = mp_div_2d(&tb, 1, &tb, NULL)) != MP_OKAY) || in mp_div()
1622 ((res = mp_div_2d(&tq, 1, &tq, NULL)) != MP_OKAY)) { in mp_div()
1640 return res; in mp_div()
1661 int res, n, t, i, norm, neg; in mp_div() local
1671 res = mp_copy (a, d); in mp_div()
1673 res = MP_OKAY; in mp_div()
1678 return res; in mp_div()
1681 if ((res = mp_init_size (&q, a->used + 2)) != MP_OKAY) { in mp_div()
1682 return res; in mp_div()
1686 if ((res = mp_init (&t1)) != MP_OKAY) { in mp_div()
1690 if ((res = mp_init (&t2)) != MP_OKAY) { in mp_div()
1694 if ((res = mp_init_copy (&x, a)) != MP_OKAY) { in mp_div()
1698 if ((res = mp_init_copy (&y, b)) != MP_OKAY) { in mp_div()
1710 if ((res = mp_mul_2d (&x, norm, &x)) != MP_OKAY) { in mp_div()
1713 if ((res = mp_mul_2d (&y, norm, &y)) != MP_OKAY) { in mp_div()
1725 if ((res = mp_lshd (&y, n - t)) != MP_OKAY) { /* y = y*b**{n-t} */ in mp_div()
1731 if ((res = mp_sub (&x, &y, &x)) != MP_OKAY) { in mp_div()
1773 if ((res = mp_mul_d (&t1, q.dp[i - t - 1], &t1)) != MP_OKAY) { in mp_div()
1785 if ((res = mp_mul_d (&y, q.dp[i - t - 1], &t1)) != MP_OKAY) { in mp_div()
1789 if ((res = mp_lshd (&t1, i - t - 1)) != MP_OKAY) { in mp_div()
1793 if ((res = mp_sub (&x, &t1, &x)) != MP_OKAY) { in mp_div()
1799 if ((res = mp_copy (&y, &t1)) != MP_OKAY) { in mp_div()
1802 if ((res = mp_lshd (&t1, i - t - 1)) != MP_OKAY) { in mp_div()
1805 if ((res = mp_add (&x, &t1, &x)) != MP_OKAY) { in mp_div()
1831 res = MP_OKAY; in mp_div()
1838 return res; in mp_div()
1872 int x, res, oldused; in mp_div_2() local
1876 if ((res = mp_grow (b, a->used)) != MP_OKAY) { in mp_div_2()
1877 return res; in mp_div_2()
1945 int x, res; in mp_div_2d() local
1951 res = mp_copy (a, c); in mp_div_2d()
1955 return res; in mp_div_2d()
1958 if ((res = mp_init (&t)) != MP_OKAY) { in mp_div_2d()
1959 return res; in mp_div_2d()
1964 if ((res = mp_mod_2d (a, b, &t)) != MP_OKAY) { in mp_div_2d()
1966 return res; in mp_div_2d()
1971 if ((res = mp_copy (a, c)) != MP_OKAY) { in mp_div_2d()
1973 return res; in mp_div_2d()
2049 int res, ix; in mp_div_3() local
2054 if ((res = mp_init_size(&q, a->used)) != MP_OKAY) { in mp_div_3()
2055 return res; in mp_div_3()
2096 return res; in mp_div_3()
2144 int res, ix; in mp_div_d() local
2181 if ((res = mp_init_size(&q, a->used)) != MP_OKAY) { in mp_div_d()
2182 return res; in mp_div_d()
2210 return res; in mp_div_d()
2461 int res, x; in mp_expt_d() local
2464 if ((res = mp_init_copy (&g, a)) != MP_OKAY) { in mp_expt_d()
2465 return res; in mp_expt_d()
2473 if ((res = mp_sqr (c, c)) != MP_OKAY) { in mp_expt_d()
2475 return res; in mp_expt_d()
2480 if ((res = mp_mul (c, &g, c)) != MP_OKAY) { in mp_expt_d()
2482 return res; in mp_expt_d()
2651 mp_int M[TAB_SIZE], res; in mp_exptmod_fast() local
2753 if ((err = mp_init (&res)) != MP_OKAY) { in mp_exptmod_fast()
2767 if ((err = mp_montgomery_calc_normalization (&res, P)) != MP_OKAY) { in mp_exptmod_fast()
2776 if ((err = mp_mulmod (G, &res, P, &M[1])) != MP_OKAY) { in mp_exptmod_fast()
2780 mp_set(&res, 1); in mp_exptmod_fast()
2845 if ((err = mp_sqr (&res, &res)) != MP_OKAY) { in mp_exptmod_fast()
2848 if ((err = redux (&res, P, mp)) != MP_OKAY) { in mp_exptmod_fast()
2862 if ((err = mp_sqr (&res, &res)) != MP_OKAY) { in mp_exptmod_fast()
2865 if ((err = redux (&res, P, mp)) != MP_OKAY) { in mp_exptmod_fast()
2871 if ((err = mp_mul (&res, &M[bitbuf], &res)) != MP_OKAY) { in mp_exptmod_fast()
2874 if ((err = redux (&res, P, mp)) != MP_OKAY) { in mp_exptmod_fast()
2889 if ((err = mp_sqr (&res, &res)) != MP_OKAY) { in mp_exptmod_fast()
2892 if ((err = redux (&res, P, mp)) != MP_OKAY) { in mp_exptmod_fast()
2900 if ((err = mp_mul (&res, &M[1], &res)) != MP_OKAY) { in mp_exptmod_fast()
2903 if ((err = redux (&res, P, mp)) != MP_OKAY) { in mp_exptmod_fast()
2917 if ((err = redux(&res, P, mp)) != MP_OKAY) { in mp_exptmod_fast()
2923 mp_exch (&res, Y); in mp_exptmod_fast()
2925 LBL_RES:mp_clear (&res); in mp_exptmod_fast()
3177 int k, u_lsb, v_lsb, res; in mp_gcd() local
3188 if ((res = mp_init_copy (&u, a)) != MP_OKAY) { in mp_gcd()
3189 return res; in mp_gcd()
3192 if ((res = mp_init_copy (&v, b)) != MP_OKAY) { in mp_gcd()
3206 if ((res = mp_div_2d(&u, k, &u, NULL)) != MP_OKAY) { in mp_gcd()
3210 if ((res = mp_div_2d(&v, k, &v, NULL)) != MP_OKAY) { in mp_gcd()
3217 if ((res = mp_div_2d(&u, u_lsb - k, &u, NULL)) != MP_OKAY) { in mp_gcd()
3223 if ((res = mp_div_2d(&v, v_lsb - k, &v, NULL)) != MP_OKAY) { in mp_gcd()
3236 if ((res = s_mp_sub(&v, &u, &v)) != MP_OKAY) { in mp_gcd()
3241 if ((res = mp_div_2d(&v, mp_cnt_lsb(&v), &v, NULL)) != MP_OKAY) { in mp_gcd()
3247 if ((res = mp_mul_2d (&u, k, c)) != MP_OKAY) { in mp_gcd()
3251 res = MP_OKAY; in mp_gcd()
3254 return res; in mp_gcd()
3286 unsigned long res; in mp_get_int() local
3296 res = DIGIT(a,i); in mp_get_int()
3299 res = (res << DIGIT_BIT) | DIGIT(a,i); in mp_get_int()
3303 return res & 0xFFFFFFFFUL; in mp_get_int()
3445 int res; in mp_init_copy() local
3447 if ((res = mp_init (a)) != MP_OKAY) { in mp_init_copy()
3448 return res; in mp_init_copy()
3481 mp_err res = MP_OKAY; /* Assume ok until proven otherwise */ in mp_init_multi() local
3505 res = MP_MEM; in mp_init_multi()
3512 return res; /* Assumed ok, if error flagged above. */ in mp_init_multi()
3715 int res; in mp_invmod_slow() local
3723 if ((res = mp_init_multi(&x, &y, &u, &v, in mp_invmod_slow()
3725 return res; in mp_invmod_slow()
3729 if ((res = mp_mod(a, b, &x)) != MP_OKAY) { in mp_invmod_slow()
3732 if ((res = mp_copy (b, &y)) != MP_OKAY) { in mp_invmod_slow()
3738 res = MP_VAL; in mp_invmod_slow()
3743 if ((res = mp_copy (&x, &u)) != MP_OKAY) { in mp_invmod_slow()
3746 if ((res = mp_copy (&y, &v)) != MP_OKAY) { in mp_invmod_slow()
3756 if ((res = mp_div_2 (&u, &u)) != MP_OKAY) { in mp_invmod_slow()
3762 if ((res = mp_add (&A, &y, &A)) != MP_OKAY) { in mp_invmod_slow()
3765 if ((res = mp_sub (&B, &x, &B)) != MP_OKAY) { in mp_invmod_slow()
3770 if ((res = mp_div_2 (&A, &A)) != MP_OKAY) { in mp_invmod_slow()
3773 if ((res = mp_div_2 (&B, &B)) != MP_OKAY) { in mp_invmod_slow()
3781 if ((res = mp_div_2 (&v, &v)) != MP_OKAY) { in mp_invmod_slow()
3787 if ((res = mp_add (&C, &y, &C)) != MP_OKAY) { in mp_invmod_slow()
3790 if ((res = mp_sub (&D, &x, &D)) != MP_OKAY) { in mp_invmod_slow()
3795 if ((res = mp_div_2 (&C, &C)) != MP_OKAY) { in mp_invmod_slow()
3798 if ((res = mp_div_2 (&D, &D)) != MP_OKAY) { in mp_invmod_slow()
3806 if ((res = mp_sub (&u, &v, &u)) != MP_OKAY) { in mp_invmod_slow()
3810 if ((res = mp_sub (&A, &C, &A)) != MP_OKAY) { in mp_invmod_slow()
3814 if ((res = mp_sub (&B, &D, &B)) != MP_OKAY) { in mp_invmod_slow()
3819 if ((res = mp_sub (&v, &u, &v)) != MP_OKAY) { in mp_invmod_slow()
3823 if ((res = mp_sub (&C, &A, &C)) != MP_OKAY) { in mp_invmod_slow()
3827 if ((res = mp_sub (&D, &B, &D)) != MP_OKAY) { in mp_invmod_slow()
3840 res = MP_VAL; in mp_invmod_slow()
3846 if ((res = mp_add(&C, b, &C)) != MP_OKAY) { in mp_invmod_slow()
3853 if ((res = mp_sub(&C, b, &C)) != MP_OKAY) { in mp_invmod_slow()
3860 res = MP_OKAY; in mp_invmod_slow()
3862 return res; in mp_invmod_slow()
3915 int res; in mp_is_square() local
3938 if ((res = mp_mod_d(arg,105,&c)) != MP_OKAY) { in mp_is_square()
3939 return res; in mp_is_square()
3946 if ((res = mp_init_set_int(&t,11L*13L*17L*19L*23L*29L*31L)) != MP_OKAY) { in mp_is_square()
3947 return res; in mp_is_square()
3949 if ((res = mp_mod(arg,&t,&t)) != MP_OKAY) { in mp_is_square()
3966 if ((res = mp_sqrt(arg,&t)) != MP_OKAY) { in mp_is_square()
3969 if ((res = mp_sqr(&t,&t)) != MP_OKAY) { in mp_is_square()
3975 return res; in mp_is_square()
4009 int k, s, r, res; in mp_jacobi() local
4033 if ((res = mp_init_copy (&a1, a)) != MP_OKAY) { in mp_jacobi()
4034 return res; in mp_jacobi()
4037 if ((res = mp_init (&p1)) != MP_OKAY) { in mp_jacobi()
4043 if ((res = mp_div_2d(&a1, k, &a1, NULL)) != MP_OKAY) { in mp_jacobi()
4071 if ((res = mp_mod (p, &a1, &p1)) != MP_OKAY) { in mp_jacobi()
4074 if ((res = mp_jacobi (&p1, &a1, &r)) != MP_OKAY) { in mp_jacobi()
4081 res = MP_OKAY; in mp_jacobi()
4084 return res; in mp_jacobi()
4411 int res; in mp_lcm() local
4415 if ((res = mp_init_multi (&t1, &t2, NULL)) != MP_OKAY) { in mp_lcm()
4416 return res; in mp_lcm()
4420 if ((res = mp_gcd (a, b, &t1)) != MP_OKAY) { in mp_lcm()
4427 if ((res = mp_div(a, &t1, &t2, NULL)) != MP_OKAY) { in mp_lcm()
4430 res = mp_mul(b, &t2, c); in mp_lcm()
4433 if ((res = mp_div(b, &t1, &t2, NULL)) != MP_OKAY) { in mp_lcm()
4436 res = mp_mul(a, &t2, c); in mp_lcm()
4444 return res; in mp_lcm()
4475 int x, res; in mp_lshd() local
4484 if ((res = mp_grow (a, a->used + b)) != MP_OKAY) { in mp_lshd()
4485 return res; in mp_lshd()
4548 int res; in mp_mod() local
4550 if ((res = mp_init (&t)) != MP_OKAY) { in mp_mod()
4551 return res; in mp_mod()
4554 if ((res = mp_div (a, b, NULL, &t)) != MP_OKAY) { in mp_mod()
4556 return res; in mp_mod()
4560 res = mp_add (b, &t, c); in mp_mod()
4562 res = MP_OKAY; in mp_mod()
4567 return res; in mp_mod()
4599 int x, res; in mp_mod_2d() local
4609 res = mp_copy (a, c); in mp_mod_2d()
4610 return res; in mp_mod_2d()
4614 if ((res = mp_copy (a, c)) != MP_OKAY) { in mp_mod_2d()
4615 return res; in mp_mod_2d()
4693 int x, bits, res; in mp_montgomery_calc_normalization() local
4699 if ((res = mp_2expt (a, (b->used - 1) * DIGIT_BIT + bits - 1)) != MP_OKAY) { in mp_montgomery_calc_normalization()
4700 return res; in mp_montgomery_calc_normalization()
4710 if ((res = mp_mul_2 (a, a)) != MP_OKAY) { in mp_montgomery_calc_normalization()
4711 return res; in mp_montgomery_calc_normalization()
4714 if ((res = s_mp_sub (a, b, a)) != MP_OKAY) { in mp_montgomery_calc_normalization()
4715 return res; in mp_montgomery_calc_normalization()
4752 int ix, res, digs; in mp_montgomery_reduce() local
4770 if ((res = mp_grow (x, digs)) != MP_OKAY) { in mp_montgomery_reduce()
4771 return res; in mp_montgomery_reduce()
4936 int res, neg; in mp_mul() local
4942 res = mp_toom_mul(a, b, c); in mp_mul()
4948 res = mp_karatsuba_mul (a, b, c); in mp_mul()
4964 res = fast_s_mp_mul_digs (a, b, c, digs); in mp_mul()
4968 res = s_mp_mul (a, b, c); /* uses s_mp_mul_digs */ in mp_mul()
4970 res = MP_VAL; in mp_mul()
4975 return res; in mp_mul()
5006 int x, res, oldused; in mp_mul_2() local
5010 if ((res = mp_grow (b, a->used + 1)) != MP_OKAY) { in mp_mul_2()
5011 return res; in mp_mul_2()
5093 int res; in mp_mul_2d() local
5097 if ((res = mp_copy (a, c)) != MP_OKAY) { in mp_mul_2d()
5098 return res; in mp_mul_2d()
5103 if ((res = mp_grow (c, c->used + b / DIGIT_BIT + 1)) != MP_OKAY) { in mp_mul_2d()
5104 return res; in mp_mul_2d()
5110 if ((res = mp_lshd (c, b / DIGIT_BIT)) != MP_OKAY) { in mp_mul_2d()
5111 return res; in mp_mul_2d()
5184 int ix, res, olduse; in mp_mul_d() local
5188 if ((res = mp_grow (c, a->used + 1)) != MP_OKAY) { in mp_mul_d()
5189 return res; in mp_mul_d()
5264 int res; in mp_mulmod() local
5267 if ((res = mp_init (&t)) != MP_OKAY) { in mp_mulmod()
5268 return res; in mp_mulmod()
5271 if ((res = mp_mul (a, b, &t)) != MP_OKAY) { in mp_mulmod()
5273 return res; in mp_mulmod()
5275 res = mp_mod (&t, c, d); in mp_mulmod()
5277 return res; in mp_mulmod()
5318 int res, neg; in mp_n_root() local
5325 if ((res = mp_init (&t1)) != MP_OKAY) { in mp_n_root()
5326 return res; in mp_n_root()
5329 if ((res = mp_init (&t2)) != MP_OKAY) { in mp_n_root()
5333 if ((res = mp_init (&t3)) != MP_OKAY) { in mp_n_root()
5346 if ((res = mp_copy (&t2, &t1)) != MP_OKAY) { in mp_n_root()
5353 if ((res = mp_expt_d (&t1, b - 1, &t3)) != MP_OKAY) { in mp_n_root()
5359 if ((res = mp_mul (&t3, &t1, &t2)) != MP_OKAY) { in mp_n_root()
5364 if ((res = mp_sub (&t2, a, &t2)) != MP_OKAY) { in mp_n_root()
5370 if ((res = mp_mul_d (&t3, b, &t3)) != MP_OKAY) { in mp_n_root()
5375 if ((res = mp_div (&t2, &t3, &t3, NULL)) != MP_OKAY) { in mp_n_root()
5379 if ((res = mp_sub (&t1, &t3, &t2)) != MP_OKAY) { in mp_n_root()
5386 if ((res = mp_expt_d (&t1, b, &t2)) != MP_OKAY) { in mp_n_root()
5391 if ((res = mp_sub_d (&t1, 1, &t1)) != MP_OKAY) { in mp_n_root()
5408 res = MP_OKAY; in mp_n_root()
5413 return res; in mp_n_root()
5444 int res; in mp_neg() local
5446 if ((res = mp_copy (a, b)) != MP_OKAY) { in mp_neg()
5447 return res; in mp_neg()
5488 int res, ix, px; in mp_or() local
5492 if ((res = mp_init_copy (&t, a)) != MP_OKAY) { in mp_or()
5493 return res; in mp_or()
5498 if ((res = mp_init_copy (&t, b)) != MP_OKAY) { in mp_or()
5499 return res; in mp_or()
5613 mp_digit res; in mp_prime_is_divisible() local
5620 if ((err = mp_mod_d (a, ltm_prime_tab[ix], &res)) != MP_OKAY) { in mp_prime_is_divisible()
5625 if (res == 0) { in mp_prime_is_divisible()
5669 int ix, err, res; in mp_prime_is_prime() local
5688 if ((err = mp_prime_is_divisible (a, &res)) != MP_OKAY) { in mp_prime_is_prime()
5693 if (res == MP_YES) { in mp_prime_is_prime()
5706 if ((err = mp_prime_miller_rabin (a, &b, &res)) != MP_OKAY) { in mp_prime_is_prime()
5710 if (res == MP_NO) { in mp_prime_is_prime()
5860 int err, res, x, y; in mp_prime_next_prime() local
5982 if ((err = mp_prime_miller_rabin(a, &b, &res)) != MP_OKAY) { in mp_prime_next_prime()
5985 if (res == MP_NO) { in mp_prime_next_prime()
5990 if (res == MP_YES) { in mp_prime_next_prime()
6102 int res, err, bsize, maskOR_msb_offset; in mp_prime_random_ex() local
6158 if ((err = mp_prime_is_prime(a, t, &res)) != MP_OKAY) { goto error; } in mp_prime_random_ex()
6159 if (res == MP_NO) { in mp_prime_random_ex()
6169 if ((err = mp_prime_is_prime(a, t, &res)) != MP_OKAY) { goto error; } in mp_prime_random_ex()
6171 } while (res == MP_NO); in mp_prime_random_ex()
6215 int res, digs; in mp_radix_size() local
6246 if ((res = mp_init_copy (&t, a)) != MP_OKAY) { in mp_radix_size()
6247 return res; in mp_radix_size()
6255 if ((res = mp_div_d (&t, (mp_digit) radix, &t, &d)) != MP_OKAY) { in mp_radix_size()
6257 return res; in mp_radix_size()
6326 int res; in mp_rand() local
6339 if ((res = mp_add_d (a, d, a)) != MP_OKAY) { in mp_rand()
6340 return res; in mp_rand()
6344 if ((res = mp_lshd (a, 1)) != MP_OKAY) { in mp_rand()
6345 return res; in mp_rand()
6348 if ((res = mp_add_d (a, ((mp_digit) abs (rand ())), a)) != MP_OKAY) { in mp_rand()
6349 return res; in mp_rand()
6384 int y, res, neg; in mp_read_radix() local
6426 if ((res = mp_mul_d (a, (mp_digit) radix, a)) != MP_OKAY) { in mp_read_radix()
6427 return res; in mp_read_radix()
6429 if ((res = mp_add_d (a, (mp_digit) y, a)) != MP_OKAY) { in mp_read_radix()
6430 return res; in mp_read_radix()
6473 int res; in mp_read_signed_bin() local
6476 if ((res = mp_read_unsigned_bin (a, b + 1, c - 1)) != MP_OKAY) { in mp_read_signed_bin()
6477 return res; in mp_read_signed_bin()
6518 int res; in mp_read_unsigned_bin() local
6522 if ((res = mp_grow(a, 2)) != MP_OKAY) { in mp_read_unsigned_bin()
6523 return res; in mp_read_unsigned_bin()
6532 if ((res = mp_mul_2d (a, 8, a)) != MP_OKAY) { in mp_read_unsigned_bin()
6533 return res; in mp_read_unsigned_bin()
6581 int res, um = m->used; in mp_reduce() local
6584 if ((res = mp_init_copy (&q, x)) != MP_OKAY) { in mp_reduce()
6585 return res; in mp_reduce()
6593 if ((res = mp_mul (&q, mu, &q)) != MP_OKAY) { in mp_reduce()
6598 if ((res = s_mp_mul_high_digs (&q, mu, &q, um)) != MP_OKAY) { in mp_reduce()
6602 if ((res = fast_s_mp_mul_high_digs (&q, mu, &q, um)) != MP_OKAY) { in mp_reduce()
6607 res = MP_VAL; in mp_reduce()
6617 if ((res = mp_mod_2d (x, DIGIT_BIT * (um + 1), x)) != MP_OKAY) { in mp_reduce()
6622 if ((res = s_mp_mul_digs (&q, m, &q, um + 1)) != MP_OKAY) { in mp_reduce()
6627 if ((res = mp_sub (x, &q, x)) != MP_OKAY) { in mp_reduce()
6634 if ((res = mp_lshd (&q, um + 1)) != MP_OKAY) in mp_reduce()
6636 if ((res = mp_add (x, &q, x)) != MP_OKAY) in mp_reduce()
6642 if ((res = s_mp_sub (x, m, x)) != MP_OKAY) { in mp_reduce()
6650 return res; in mp_reduce()
6682 int p, res; in mp_reduce_2k() local
6684 if ((res = mp_init(&q)) != MP_OKAY) { in mp_reduce_2k()
6685 return res; in mp_reduce_2k()
6691 if ((res = mp_div_2d(a, p, &q, a)) != MP_OKAY) { in mp_reduce_2k()
6697 if ((res = mp_mul_d(&q, d, &q)) != MP_OKAY) { in mp_reduce_2k()
6703 if ((res = s_mp_add(a, &q, a)) != MP_OKAY) { in mp_reduce_2k()
6714 return res; in mp_reduce_2k()
6750 int p, res; in mp_reduce_2k_l() local
6752 if ((res = mp_init(&q)) != MP_OKAY) { in mp_reduce_2k_l()
6753 return res; in mp_reduce_2k_l()
6759 if ((res = mp_div_2d(a, p, &q, a)) != MP_OKAY) { in mp_reduce_2k_l()
6764 if ((res = mp_mul(&q, d, &q)) != MP_OKAY) { in mp_reduce_2k_l()
6769 if ((res = s_mp_add(a, &q, a)) != MP_OKAY) { in mp_reduce_2k_l()
6780 return res; in mp_reduce_2k_l()
6812 int res, p; in mp_reduce_2k_setup() local
6815 if ((res = mp_init(&tmp)) != MP_OKAY) { in mp_reduce_2k_setup()
6816 return res; in mp_reduce_2k_setup()
6820 if ((res = mp_2expt(&tmp, p)) != MP_OKAY) { in mp_reduce_2k_setup()
6822 return res; in mp_reduce_2k_setup()
6825 if ((res = s_mp_sub(&tmp, a, &tmp)) != MP_OKAY) { in mp_reduce_2k_setup()
6827 return res; in mp_reduce_2k_setup()
6863 int res; in mp_reduce_2k_setup_l() local
6866 if ((res = mp_init(&tmp)) != MP_OKAY) { in mp_reduce_2k_setup_l()
6867 return res; in mp_reduce_2k_setup_l()
6870 if ((res = mp_2expt(&tmp, mp_count_bits(a))) != MP_OKAY) { in mp_reduce_2k_setup_l()
6874 if ((res = s_mp_sub(&tmp, a, d)) != MP_OKAY) { in mp_reduce_2k_setup_l()
6880 return res; in mp_reduce_2k_setup_l()
7017 int res; in mp_reduce_setup() local
7019 if ((res = mp_2expt (a, b->used * 2 * DIGIT_BIT)) != MP_OKAY) { in mp_reduce_setup()
7020 return res; in mp_reduce_setup()
7162 int x, res; in mp_set_int() local
7169 if ((res = mp_mul_2d (a, 4, a)) != MP_OKAY) { in mp_set_int()
7170 return res; in mp_set_int()
7285 int res; in mp_sqr() local
7290 res = mp_toom_sqr(a, b); in mp_sqr()
7296 res = mp_karatsuba_sqr (a, b); in mp_sqr()
7305 res = fast_s_mp_sqr (a, b); in mp_sqr()
7309 res = s_mp_sqr (a, b); in mp_sqr()
7311 res = MP_VAL; in mp_sqr()
7315 return res; in mp_sqr()
7347 int res; in mp_sqrmod() local
7350 if ((res = mp_init (&t)) != MP_OKAY) { in mp_sqrmod()
7351 return res; in mp_sqrmod()
7354 if ((res = mp_sqr (a, &t)) != MP_OKAY) { in mp_sqrmod()
7356 return res; in mp_sqrmod()
7358 res = mp_mod (&t, b, c); in mp_sqrmod()
7360 return res; in mp_sqrmod()
7391 int res; in mp_sqrt() local
7405 if ((res = mp_init_copy(&t1, arg)) != MP_OKAY) { in mp_sqrt()
7406 return res; in mp_sqrt()
7409 if ((res = mp_init(&t2)) != MP_OKAY) { in mp_sqrt()
7417 if ((res = mp_div(arg,&t1,&t2,NULL)) != MP_OKAY) { in mp_sqrt()
7420 if ((res = mp_add(&t1,&t2,&t1)) != MP_OKAY) { in mp_sqrt()
7423 if ((res = mp_div_2(&t1,&t1)) != MP_OKAY) { in mp_sqrt()
7428 if ((res = mp_div(arg,&t1,&t2,NULL)) != MP_OKAY) { in mp_sqrt()
7431 if ((res = mp_add(&t1,&t2,&t1)) != MP_OKAY) { in mp_sqrt()
7434 if ((res = mp_div_2(&t1,&t1)) != MP_OKAY) { in mp_sqrt()
7444 return res; in mp_sqrt()
7477 int sa, sb, res; in mp_sub() local
7488 res = s_mp_add (a, b, c); in mp_sub()
7498 res = s_mp_sub (a, b, c); in mp_sub()
7504 res = s_mp_sub (b, a, c); in mp_sub()
7507 return res; in mp_sub()
7541 int res, ix, oldused; in mp_sub_d() local
7545 if ((res = mp_grow(c, a->used + 1)) != MP_OKAY) { in mp_sub_d()
7546 return res; in mp_sub_d()
7555 res = mp_add_d(a, b, c); in mp_sub_d()
7561 return res; in mp_sub_d()
7637 int res; in mp_submod() local
7641 if ((res = mp_init (&t)) != MP_OKAY) { in mp_submod()
7642 return res; in mp_submod()
7645 if ((res = mp_sub (a, b, &t)) != MP_OKAY) { in mp_submod()
7647 return res; in mp_submod()
7649 res = mp_mod (&t, c, d); in mp_submod()
7651 return res; in mp_submod()
7682 int res; in mp_to_signed_bin() local
7684 if ((res = mp_to_unsigned_bin (a, b + 1)) != MP_OKAY) { in mp_to_signed_bin()
7685 return res; in mp_to_signed_bin()
7754 int x, res; in mp_to_unsigned_bin() local
7757 if ((res = mp_init_copy (&t, a)) != MP_OKAY) { in mp_to_unsigned_bin()
7758 return res; in mp_to_unsigned_bin()
7768 if ((res = mp_div_2d (&t, 8, &t, NULL)) != MP_OKAY) { in mp_to_unsigned_bin()
7770 return res; in mp_to_unsigned_bin()
7848 int res, B; in mp_toom_mul() local
7851 if ((res = mp_init_multi(&w0, &w1, &w2, &w3, &w4, in mp_toom_mul()
7854 return res; in mp_toom_mul()
7861 if ((res = mp_mod_2d(a, DIGIT_BIT * B, &a0)) != MP_OKAY) { in mp_toom_mul()
7865 if ((res = mp_copy(a, &a1)) != MP_OKAY) { in mp_toom_mul()
7871 if ((res = mp_copy(a, &a2)) != MP_OKAY) { in mp_toom_mul()
7877 if ((res = mp_mod_2d(b, DIGIT_BIT * B, &b0)) != MP_OKAY) { in mp_toom_mul()
7881 if ((res = mp_copy(b, &b1)) != MP_OKAY) { in mp_toom_mul()
7887 if ((res = mp_copy(b, &b2)) != MP_OKAY) { in mp_toom_mul()
7893 if ((res = mp_mul(&a0, &b0, &w0)) != MP_OKAY) { in mp_toom_mul()
7898 if ((res = mp_mul(&a2, &b2, &w4)) != MP_OKAY) { in mp_toom_mul()
7903 if ((res = mp_mul_2(&a0, &tmp1)) != MP_OKAY) { in mp_toom_mul()
7906 if ((res = mp_add(&tmp1, &a1, &tmp1)) != MP_OKAY) { in mp_toom_mul()
7909 if ((res = mp_mul_2(&tmp1, &tmp1)) != MP_OKAY) { in mp_toom_mul()
7912 if ((res = mp_add(&tmp1, &a2, &tmp1)) != MP_OKAY) { in mp_toom_mul()
7916 if ((res = mp_mul_2(&b0, &tmp2)) != MP_OKAY) { in mp_toom_mul()
7919 if ((res = mp_add(&tmp2, &b1, &tmp2)) != MP_OKAY) { in mp_toom_mul()
7922 if ((res = mp_mul_2(&tmp2, &tmp2)) != MP_OKAY) { in mp_toom_mul()
7925 if ((res = mp_add(&tmp2, &b2, &tmp2)) != MP_OKAY) { in mp_toom_mul()
7929 if ((res = mp_mul(&tmp1, &tmp2, &w1)) != MP_OKAY) { in mp_toom_mul()
7934 if ((res = mp_mul_2(&a2, &tmp1)) != MP_OKAY) { in mp_toom_mul()
7937 if ((res = mp_add(&tmp1, &a1, &tmp1)) != MP_OKAY) { in mp_toom_mul()
7940 if ((res = mp_mul_2(&tmp1, &tmp1)) != MP_OKAY) { in mp_toom_mul()
7943 if ((res = mp_add(&tmp1, &a0, &tmp1)) != MP_OKAY) { in mp_toom_mul()
7947 if ((res = mp_mul_2(&b2, &tmp2)) != MP_OKAY) { in mp_toom_mul()
7950 if ((res = mp_add(&tmp2, &b1, &tmp2)) != MP_OKAY) { in mp_toom_mul()
7953 if ((res = mp_mul_2(&tmp2, &tmp2)) != MP_OKAY) { in mp_toom_mul()
7956 if ((res = mp_add(&tmp2, &b0, &tmp2)) != MP_OKAY) { in mp_toom_mul()
7960 if ((res = mp_mul(&tmp1, &tmp2, &w3)) != MP_OKAY) { in mp_toom_mul()
7966 if ((res = mp_add(&a2, &a1, &tmp1)) != MP_OKAY) { in mp_toom_mul()
7969 if ((res = mp_add(&tmp1, &a0, &tmp1)) != MP_OKAY) { in mp_toom_mul()
7972 if ((res = mp_add(&b2, &b1, &tmp2)) != MP_OKAY) { in mp_toom_mul()
7975 if ((res = mp_add(&tmp2, &b0, &tmp2)) != MP_OKAY) { in mp_toom_mul()
7978 if ((res = mp_mul(&tmp1, &tmp2, &w2)) != MP_OKAY) { in mp_toom_mul()
7995 if ((res = mp_sub(&w1, &w4, &w1)) != MP_OKAY) { in mp_toom_mul()
7999 if ((res = mp_sub(&w3, &w0, &w3)) != MP_OKAY) { in mp_toom_mul()
8003 if ((res = mp_div_2(&w1, &w1)) != MP_OKAY) { in mp_toom_mul()
8007 if ((res = mp_div_2(&w3, &w3)) != MP_OKAY) { in mp_toom_mul()
8011 if ((res = mp_sub(&w2, &w0, &w2)) != MP_OKAY) { in mp_toom_mul()
8014 if ((res = mp_sub(&w2, &w4, &w2)) != MP_OKAY) { in mp_toom_mul()
8018 if ((res = mp_sub(&w1, &w2, &w1)) != MP_OKAY) { in mp_toom_mul()
8022 if ((res = mp_sub(&w3, &w2, &w3)) != MP_OKAY) { in mp_toom_mul()
8026 if ((res = mp_mul_2d(&w0, 3, &tmp1)) != MP_OKAY) { in mp_toom_mul()
8029 if ((res = mp_sub(&w1, &tmp1, &w1)) != MP_OKAY) { in mp_toom_mul()
8033 if ((res = mp_mul_2d(&w4, 3, &tmp1)) != MP_OKAY) { in mp_toom_mul()
8036 if ((res = mp_sub(&w3, &tmp1, &w3)) != MP_OKAY) { in mp_toom_mul()
8040 if ((res = mp_mul_d(&w2, 3, &w2)) != MP_OKAY) { in mp_toom_mul()
8043 if ((res = mp_sub(&w2, &w1, &w2)) != MP_OKAY) { in mp_toom_mul()
8046 if ((res = mp_sub(&w2, &w3, &w2)) != MP_OKAY) { in mp_toom_mul()
8050 if ((res = mp_sub(&w1, &w2, &w1)) != MP_OKAY) { in mp_toom_mul()
8054 if ((res = mp_sub(&w3, &w2, &w3)) != MP_OKAY) { in mp_toom_mul()
8058 if ((res = mp_div_3(&w1, &w1, NULL)) != MP_OKAY) { in mp_toom_mul()
8062 if ((res = mp_div_3(&w3, &w3, NULL)) != MP_OKAY) { in mp_toom_mul()
8067 if ((res = mp_lshd(&w1, 1*B)) != MP_OKAY) { in mp_toom_mul()
8070 if ((res = mp_lshd(&w2, 2*B)) != MP_OKAY) { in mp_toom_mul()
8073 if ((res = mp_lshd(&w3, 3*B)) != MP_OKAY) { in mp_toom_mul()
8076 if ((res = mp_lshd(&w4, 4*B)) != MP_OKAY) { in mp_toom_mul()
8080 if ((res = mp_add(&w0, &w1, c)) != MP_OKAY) { in mp_toom_mul()
8083 if ((res = mp_add(&w2, &w3, &tmp1)) != MP_OKAY) { in mp_toom_mul()
8086 if ((res = mp_add(&w4, &tmp1, &tmp1)) != MP_OKAY) { in mp_toom_mul()
8089 if ((res = mp_add(&tmp1, c, c)) != MP_OKAY) { in mp_toom_mul()
8097 return res; in mp_toom_mul()
8131 int res, B; in mp_toom_sqr() local
8134 if ((res = mp_init_multi(&w0, &w1, &w2, &w3, &w4, &a0, &a1, &a2, &tmp1, NULL)) != MP_OKAY) { in mp_toom_sqr()
8135 return res; in mp_toom_sqr()
8142 if ((res = mp_mod_2d(a, DIGIT_BIT * B, &a0)) != MP_OKAY) { in mp_toom_sqr()
8146 if ((res = mp_copy(a, &a1)) != MP_OKAY) { in mp_toom_sqr()
8152 if ((res = mp_copy(a, &a2)) != MP_OKAY) { in mp_toom_sqr()
8158 if ((res = mp_sqr(&a0, &w0)) != MP_OKAY) { in mp_toom_sqr()
8163 if ((res = mp_sqr(&a2, &w4)) != MP_OKAY) { in mp_toom_sqr()
8168 if ((res = mp_mul_2(&a0, &tmp1)) != MP_OKAY) { in mp_toom_sqr()
8171 if ((res = mp_add(&tmp1, &a1, &tmp1)) != MP_OKAY) { in mp_toom_sqr()
8174 if ((res = mp_mul_2(&tmp1, &tmp1)) != MP_OKAY) { in mp_toom_sqr()
8177 if ((res = mp_add(&tmp1, &a2, &tmp1)) != MP_OKAY) { in mp_toom_sqr()
8181 if ((res = mp_sqr(&tmp1, &w1)) != MP_OKAY) { in mp_toom_sqr()
8186 if ((res = mp_mul_2(&a2, &tmp1)) != MP_OKAY) { in mp_toom_sqr()
8189 if ((res = mp_add(&tmp1, &a1, &tmp1)) != MP_OKAY) { in mp_toom_sqr()
8192 if ((res = mp_mul_2(&tmp1, &tmp1)) != MP_OKAY) { in mp_toom_sqr()
8195 if ((res = mp_add(&tmp1, &a0, &tmp1)) != MP_OKAY) { in mp_toom_sqr()
8199 if ((res = mp_sqr(&tmp1, &w3)) != MP_OKAY) { in mp_toom_sqr()
8205 if ((res = mp_add(&a2, &a1, &tmp1)) != MP_OKAY) { in mp_toom_sqr()
8208 if ((res = mp_add(&tmp1, &a0, &tmp1)) != MP_OKAY) { in mp_toom_sqr()
8211 if ((res = mp_sqr(&tmp1, &w2)) != MP_OKAY) { in mp_toom_sqr()
8227 if ((res = mp_sub(&w1, &w4, &w1)) != MP_OKAY) { in mp_toom_sqr()
8231 if ((res = mp_sub(&w3, &w0, &w3)) != MP_OKAY) { in mp_toom_sqr()
8235 if ((res = mp_div_2(&w1, &w1)) != MP_OKAY) { in mp_toom_sqr()
8239 if ((res = mp_div_2(&w3, &w3)) != MP_OKAY) { in mp_toom_sqr()
8243 if ((res = mp_sub(&w2, &w0, &w2)) != MP_OKAY) { in mp_toom_sqr()
8246 if ((res = mp_sub(&w2, &w4, &w2)) != MP_OKAY) { in mp_toom_sqr()
8250 if ((res = mp_sub(&w1, &w2, &w1)) != MP_OKAY) { in mp_toom_sqr()
8254 if ((res = mp_sub(&w3, &w2, &w3)) != MP_OKAY) { in mp_toom_sqr()
8258 if ((res = mp_mul_2d(&w0, 3, &tmp1)) != MP_OKAY) { in mp_toom_sqr()
8261 if ((res = mp_sub(&w1, &tmp1, &w1)) != MP_OKAY) { in mp_toom_sqr()
8265 if ((res = mp_mul_2d(&w4, 3, &tmp1)) != MP_OKAY) { in mp_toom_sqr()
8268 if ((res = mp_sub(&w3, &tmp1, &w3)) != MP_OKAY) { in mp_toom_sqr()
8272 if ((res = mp_mul_d(&w2, 3, &w2)) != MP_OKAY) { in mp_toom_sqr()
8275 if ((res = mp_sub(&w2, &w1, &w2)) != MP_OKAY) { in mp_toom_sqr()
8278 if ((res = mp_sub(&w2, &w3, &w2)) != MP_OKAY) { in mp_toom_sqr()
8282 if ((res = mp_sub(&w1, &w2, &w1)) != MP_OKAY) { in mp_toom_sqr()
8286 if ((res = mp_sub(&w3, &w2, &w3)) != MP_OKAY) { in mp_toom_sqr()
8290 if ((res = mp_div_3(&w1, &w1, NULL)) != MP_OKAY) { in mp_toom_sqr()
8294 if ((res = mp_div_3(&w3, &w3, NULL)) != MP_OKAY) { in mp_toom_sqr()
8299 if ((res = mp_lshd(&w1, 1*B)) != MP_OKAY) { in mp_toom_sqr()
8302 if ((res = mp_lshd(&w2, 2*B)) != MP_OKAY) { in mp_toom_sqr()
8305 if ((res = mp_lshd(&w3, 3*B)) != MP_OKAY) { in mp_toom_sqr()
8308 if ((res = mp_lshd(&w4, 4*B)) != MP_OKAY) { in mp_toom_sqr()
8312 if ((res = mp_add(&w0, &w1, b)) != MP_OKAY) { in mp_toom_sqr()
8315 if ((res = mp_add(&w2, &w3, &tmp1)) != MP_OKAY) { in mp_toom_sqr()
8318 if ((res = mp_add(&w4, &tmp1, &tmp1)) != MP_OKAY) { in mp_toom_sqr()
8321 if ((res = mp_add(&tmp1, b, b)) != MP_OKAY) { in mp_toom_sqr()
8327 return res; in mp_toom_sqr()
8359 int res, digs; in mp_toradix() local
8376 if ((res = mp_init_copy (&t, a)) != MP_OKAY) { in mp_toradix()
8377 return res; in mp_toradix()
8389 if ((res = mp_div_d (&t, (mp_digit) radix, &t, &d)) != MP_OKAY) { in mp_toradix()
8391 return res; in mp_toradix()
8441 int res, digs; in mp_toradix_n() local
8458 if ((res = mp_init_copy (&t, a)) != MP_OKAY) { in mp_toradix_n()
8459 return res; in mp_toradix_n()
8481 if ((res = mp_div_d (&t, (mp_digit) radix, &t, &d)) != MP_OKAY) { in mp_toradix_n()
8483 return res; in mp_toradix_n()
8563 int res, ix, px; in mp_xor() local
8567 if ((res = mp_init_copy (&t, a)) != MP_OKAY) { in mp_xor()
8568 return res; in mp_xor()
8573 if ((res = mp_init_copy (&t, b)) != MP_OKAY) { in mp_xor()
8574 return res; in mp_xor()
8767 int olduse, res, min, max; in s_mp_add() local
8784 if ((res = mp_grow (c, max + 1)) != MP_OKAY) { in s_mp_add()
8785 return res; in s_mp_add()
8882 mp_int M[TAB_SIZE], res, mu; in s_mp_exptmod() local
8990 if ((err = mp_init (&res)) != MP_OKAY) { in s_mp_exptmod()
8993 mp_set (&res, 1); in s_mp_exptmod()
9030 if ((err = mp_sqr (&res, &res)) != MP_OKAY) { in s_mp_exptmod()
9033 if ((err = redux (&res, P, &mu)) != MP_OKAY) { in s_mp_exptmod()
9047 if ((err = mp_sqr (&res, &res)) != MP_OKAY) { in s_mp_exptmod()
9050 if ((err = redux (&res, P, &mu)) != MP_OKAY) { in s_mp_exptmod()
9056 if ((err = mp_mul (&res, &M[bitbuf], &res)) != MP_OKAY) { in s_mp_exptmod()
9059 if ((err = redux (&res, P, &mu)) != MP_OKAY) { in s_mp_exptmod()
9074 if ((err = mp_sqr (&res, &res)) != MP_OKAY) { in s_mp_exptmod()
9077 if ((err = redux (&res, P, &mu)) != MP_OKAY) { in s_mp_exptmod()
9084 if ((err = mp_mul (&res, &M[1], &res)) != MP_OKAY) { in s_mp_exptmod()
9087 if ((err = redux (&res, P, &mu)) != MP_OKAY) { in s_mp_exptmod()
9094 mp_exch (&res, Y); in s_mp_exptmod()
9096 LBL_RES:mp_clear (&res); in s_mp_exptmod()
9138 int res, pa, pb, ix, iy; in s_mp_mul_digs() local
9150 if ((res = mp_init_size (&t, digs)) != MP_OKAY) { in s_mp_mul_digs()
9151 return res; in s_mp_mul_digs()
9232 int res, pa, pb, ix, iy; in s_mp_mul_high_digs() local
9245 if ((res = mp_init_size (&t, a->used + b->used + 1)) != MP_OKAY) { in s_mp_mul_high_digs()
9246 return res; in s_mp_mul_high_digs()
9314 int res, ix, iy, pa; in s_mp_sqr() local
9319 if ((res = mp_init_size (&t, 2*pa + 1)) != MP_OKAY) { in s_mp_sqr()
9320 return res; in s_mp_sqr()
9402 int olduse, res, min, max; in s_mp_sub() local
9410 if ((res = mp_grow (c, max)) != MP_OKAY) { in s_mp_sub()
9411 return res; in s_mp_sub()