From 6631d426646a41a7249de787d9f448be70737fd0 Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Sun, 19 May 2019 10:05:15 +0200 Subject: [PATCH 1/5] remove __cplusplus stuff from tommath_private.h tommath_private.h is an internal header which won't be included by a C++ source file. --- tommath_private.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tommath_private.h b/tommath_private.h index 2c07683ce..d1a8b63ab 100644 --- a/tommath_private.h +++ b/tommath_private.h @@ -6,10 +6,6 @@ #include "tommath.h" -#ifdef __cplusplus -extern "C" { -#endif - /* Hardening libtommath * -------------------- * @@ -222,8 +218,4 @@ MP_DEPRECATED(s_mp_toom_mul) mp_err mp_toom_mul(const mp_int *a, const mp_int *b MP_DEPRECATED(s_mp_toom_sqr) mp_err mp_toom_sqr(const mp_int *a, mp_int *b); MP_DEPRECATED(s_mp_reverse) void bn_reverse(unsigned char *s, int len); -#ifdef __cplusplus -} -#endif - #endif From dac8275e1b8340edd3d7cc828c6c407ded366ef0 Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Sun, 19 May 2019 10:55:27 +0200 Subject: [PATCH 2/5] fix mp_jacobi ifdef --- bn_deprecated.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bn_deprecated.c b/bn_deprecated.c index 1306507ee..acc1efd5c 100644 --- a/bn_deprecated.c +++ b/bn_deprecated.c @@ -18,7 +18,7 @@ int mp_get_bit(const mp_int *a, int b) return s_mp_get_bit(a, (unsigned int)b) == MP_YES ? MP_YES : MP_NO; } #endif -#ifdef BN_MP_JACOBI_C +#ifdef BN_S_MP_JACOBI_C mp_err s_mp_jacobi(const mp_int *a, const mp_int *n, int *c) { if (a->sign == MP_NEG) { @@ -29,6 +29,8 @@ mp_err s_mp_jacobi(const mp_int *a, const mp_int *n, int *c) } return mp_kronecker(a, n, c); } +#endif +#ifdef BN_MP_JACOBI_C mp_err mp_jacobi(const mp_int *a, const mp_int *n, int *c) { return s_mp_jacobi(a, n, c); From 6d84f15e53b5f38f8ed3ba7c727cf924b4f56116 Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Sun, 19 May 2019 10:58:04 +0200 Subject: [PATCH 3/5] remove comment in bn_deprecated --- bn_deprecated.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/bn_deprecated.c b/bn_deprecated.c index acc1efd5c..518d6344b 100644 --- a/bn_deprecated.c +++ b/bn_deprecated.c @@ -2,14 +2,8 @@ #ifdef BN_DEPRECATED_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ -/* LibTomMath, multiple-precision integer library -- Tom St Denis */ -/* SPDX-License-Identifier: Unlicense */ -#include #ifdef BN_MP_GET_BIT_C -/* Checks the bit at position b and returns MP_YES - if the bit is 1, MP_NO if it is 0 and MP_VAL - in case of error */ int mp_get_bit(const mp_int *a, int b) { if (b < 0) { From 69f03b3aab10ebb707997f0933d46b7fc69d052b Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Sun, 19 May 2019 11:50:31 +0200 Subject: [PATCH 4/5] gitignore doc/pics/*.ps --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 72a9e9bf6..da37fbf01 100644 --- a/.gitignore +++ b/.gitignore @@ -86,3 +86,5 @@ test_*.txt *.asc *.tar.xz *.zip + +doc/pics/*.ps From 87edbfe42a80964c3a5a6eaaa1582b9df9a8ecae Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Sun, 19 May 2019 20:43:42 +0200 Subject: [PATCH 5/5] ensure that bn_reverse is compiled in bn_deprecated.c --- bn_deprecated.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bn_deprecated.c b/bn_deprecated.c index 518d6344b..eb1a6e125 100644 --- a/bn_deprecated.c +++ b/bn_deprecated.c @@ -116,7 +116,7 @@ mp_err mp_toom_sqr(const mp_int *a, mp_int *b) return s_mp_toom_sqr(a, b); } #endif -#ifdef BN_REVERSE_C +#ifdef S_MP_REVERSE_C void bn_reverse(unsigned char *s, int len) { s_mp_reverse(s, len);