Skip to content

Commit 7345a68

Browse files
authored
Merge pull request #270 from libtom/macro-fixes
Macro fixes
2 parents 96b5552 + 87edbfe commit 7345a68

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,5 @@ test_*.txt
8686
*.asc
8787
*.tar.xz
8888
*.zip
89+
90+
doc/pics/*.ps

bn_deprecated.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@
22
#ifdef BN_DEPRECATED_C
33
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
44
/* SPDX-License-Identifier: Unlicense */
5-
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
65

7-
/* SPDX-License-Identifier: Unlicense */
8-
#include <tommath_private.h>
96
#ifdef BN_MP_GET_BIT_C
10-
/* Checks the bit at position b and returns MP_YES
11-
if the bit is 1, MP_NO if it is 0 and MP_VAL
12-
in case of error */
137
int mp_get_bit(const mp_int *a, int b)
148
{
159
if (b < 0) {
@@ -18,7 +12,7 @@ int mp_get_bit(const mp_int *a, int b)
1812
return s_mp_get_bit(a, (unsigned int)b) == MP_YES ? MP_YES : MP_NO;
1913
}
2014
#endif
21-
#ifdef BN_MP_JACOBI_C
15+
#ifdef BN_S_MP_JACOBI_C
2216
mp_err s_mp_jacobi(const mp_int *a, const mp_int *n, int *c)
2317
{
2418
if (a->sign == MP_NEG) {
@@ -29,6 +23,8 @@ mp_err s_mp_jacobi(const mp_int *a, const mp_int *n, int *c)
2923
}
3024
return mp_kronecker(a, n, c);
3125
}
26+
#endif
27+
#ifdef BN_MP_JACOBI_C
3228
mp_err mp_jacobi(const mp_int *a, const mp_int *n, int *c)
3329
{
3430
return s_mp_jacobi(a, n, c);
@@ -120,7 +116,7 @@ mp_err mp_toom_sqr(const mp_int *a, mp_int *b)
120116
return s_mp_toom_sqr(a, b);
121117
}
122118
#endif
123-
#ifdef BN_REVERSE_C
119+
#ifdef S_MP_REVERSE_C
124120
void bn_reverse(unsigned char *s, int len)
125121
{
126122
s_mp_reverse(s, len);

tommath_private.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66

77
#include "tommath.h"
88

9-
#ifdef __cplusplus
10-
extern "C" {
11-
#endif
12-
139
/* Hardening libtommath
1410
* --------------------
1511
*
@@ -222,8 +218,4 @@ MP_DEPRECATED(s_mp_toom_mul) mp_err mp_toom_mul(const mp_int *a, const mp_int *b
222218
MP_DEPRECATED(s_mp_toom_sqr) mp_err mp_toom_sqr(const mp_int *a, mp_int *b);
223219
MP_DEPRECATED(s_mp_reverse) void bn_reverse(unsigned char *s, int len);
224220

225-
#ifdef __cplusplus
226-
}
227-
#endif
228-
229221
#endif

0 commit comments

Comments
 (0)