|
7 | 7 | /* SPDX-License-Identifier: Unlicense */ |
8 | 8 | #include <tommath_private.h> |
9 | 9 | #ifdef BN_FAST_MP_INVMOD_C |
10 | | -int fast_mp_invmod(const mp_int *a, const mp_int *b, mp_int *c) |
| 10 | +mp_err fast_mp_invmod(const mp_int *a, const mp_int *b, mp_int *c) |
11 | 11 | { |
12 | 12 | return s_mp_invmod_fast(a, b, c); |
13 | 13 | } |
14 | 14 | #endif |
15 | 15 | #ifdef BN_FAST_MP_MONTGOMERY_REDUCE_C |
16 | | -int fast_mp_montgomery_reduce(mp_int *x, const mp_int *n, mp_digit rho) |
| 16 | +mp_err fast_mp_montgomery_reduce(mp_int *x, const mp_int *n, mp_digit rho) |
17 | 17 | { |
18 | 18 | return s_mp_montgomery_reduce_fast(x, n, rho); |
19 | 19 | } |
20 | 20 | #endif |
21 | 21 | #ifdef BN_FAST_S_MP_MUL_DIGS_C |
22 | | -int fast_s_mp_mul_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs) |
| 22 | +mp_err fast_s_mp_mul_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs) |
23 | 23 | { |
24 | 24 | return s_mp_mul_digs_fast(a, b, c, digs); |
25 | 25 | } |
26 | 26 | #endif |
27 | 27 | #ifdef BN_FAST_S_MP_MUL_HIGH_DIGS_C |
28 | | -int fast_s_mp_mul_high_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs) |
| 28 | +mp_err fast_s_mp_mul_high_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs) |
29 | 29 | { |
30 | 30 | return s_mp_mul_high_digs_fast(a, b, c, digs); |
31 | 31 | } |
32 | 32 | #endif |
33 | 33 | #ifdef BN_FAST_S_MP_SQR_C |
34 | | -int fast_s_mp_sqr(const mp_int *a, mp_int *b) |
| 34 | +mp_err fast_s_mp_sqr(const mp_int *a, mp_int *b) |
35 | 35 | { |
36 | 36 | return s_mp_sqr_fast(a, b); |
37 | 37 | } |
38 | 38 | #endif |
39 | 39 | #ifdef BN_MP_BALANCE_MUL_C |
40 | | -int mp_balance_mul(const mp_int *a, const mp_int *b, mp_int *c) |
| 40 | +mp_err mp_balance_mul(const mp_int *a, const mp_int *b, mp_int *c) |
41 | 41 | { |
42 | 42 | return s_mp_balance_mul(a, b, c); |
43 | 43 | } |
44 | 44 | #endif |
45 | 45 | #ifdef BN_MP_EXPTMOD_FAST_C |
46 | | -int mp_exptmod_fast(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y, int redmode) |
| 46 | +mp_err mp_exptmod_fast(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y, int redmode) |
47 | 47 | { |
48 | 48 | return s_mp_exptmod_fast(G, X, P, Y, redmode); |
49 | 49 | } |
50 | 50 | #endif |
51 | 51 | #ifdef BN_MP_INVMOD_SLOW_C |
52 | | -int mp_invmod_slow(const mp_int *a, const mp_int *b, mp_int *c) |
| 52 | +mp_err mp_invmod_slow(const mp_int *a, const mp_int *b, mp_int *c) |
53 | 53 | { |
54 | 54 | return s_mp_invmod_slow(a, b, c); |
55 | 55 | } |
56 | 56 | #endif |
57 | 57 | #ifdef BN_MP_KARATSUBA_MUL_C |
58 | | -int mp_karatsuba_mul(const mp_int *a, const mp_int *b, mp_int *c) |
| 58 | +mp_err mp_karatsuba_mul(const mp_int *a, const mp_int *b, mp_int *c) |
59 | 59 | { |
60 | 60 | return s_mp_karatsuba_mul(a, b, c); |
61 | 61 | } |
62 | 62 | #endif |
63 | 63 | #ifdef BN_MP_KARATSUBA_SQR_C |
64 | | -int mp_karatsuba_sqr(const mp_int *a, mp_int *b) |
| 64 | +mp_err mp_karatsuba_sqr(const mp_int *a, mp_int *b) |
65 | 65 | { |
66 | 66 | return s_mp_karatsuba_sqr(a, b); |
67 | 67 | } |
68 | 68 | #endif |
69 | 69 | #ifdef BN_MP_TOOM_MUL_C |
70 | | -int mp_toom_mul(const mp_int *a, const mp_int *b, mp_int *c) |
| 70 | +mp_err mp_toom_mul(const mp_int *a, const mp_int *b, mp_int *c) |
71 | 71 | { |
72 | 72 | return s_mp_toom_mul(a, b, c); |
73 | 73 | } |
74 | 74 | #endif |
75 | 75 | #ifdef BN_MP_TOOM_SQR_C |
76 | | -int mp_toom_sqr(const mp_int *a, mp_int *b) |
| 76 | +mp_err mp_toom_sqr(const mp_int *a, mp_int *b) |
77 | 77 | { |
78 | 78 | return s_mp_toom_sqr(a, b); |
79 | 79 | } |
|
0 commit comments