Skip to content

Commit ac3df4f

Browse files
committed
move define to tommath_private.h
it's not required in the public header Signed-off-by: Steffen Jaeckel <[email protected]>
1 parent 6da2101 commit ac3df4f

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

tommath.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -413,17 +413,6 @@ mp_err mp_exteuclid(const mp_int *a, const mp_int *b, mp_int *U1, mp_int *U2, mp
413413
/* c = [a, b] or (a*b)/(a, b) */
414414
mp_err mp_lcm(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
415415

416-
/*
417-
The mp_log functions rely on the size of mp_word being larger than INT_MAX and in case
418-
there is a really weird architecture we try to check for it. Not a 100% reliable
419-
test but it has a safe fallback.
420-
*/
421-
422-
#if ((UINT_MAX == UINT32_MAX) && (MP_WORD_SIZE > 4)) \
423-
|| ((UINT_MAX == UINT16_MAX) && (MP_WORD_SIZE > 2))
424-
#define S_MP_FP_LOG_D_POSSIBLE_C
425-
#endif
426-
427416
/* Integer logarithm to integer base */
428417
mp_err mp_log_n(const mp_int *a, int base, int *c) MP_WUR;
429418

tommath_private.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,16 @@ MP_STATIC_ASSERT(prec_geq_min_prec, MP_DEFAULT_DIGIT_COUNT >= MP_MIN_DIGIT_COUNT
177177
#define MP_HAS_SET_DOUBLE
178178
#endif
179179

180+
/*
181+
The mp_log functions rely on the size of mp_word being larger than INT_MAX and in case
182+
there is a really weird architecture we try to check for it. Not a 100% reliable
183+
test but it has a safe fallback.
184+
*/
185+
#if ((UINT_MAX == UINT32_MAX) && (MP_WORD_SIZE > 4)) \
186+
|| ((UINT_MAX == UINT16_MAX) && (MP_WORD_SIZE > 2))
187+
#define S_MP_FP_LOG_D_POSSIBLE_C
188+
#endif
189+
180190
/* random number source */
181191
extern MP_PRIVATE mp_err(*s_mp_rand_source)(void *out, size_t size);
182192

0 commit comments

Comments
 (0)