MP_PREC is an internal macro, it should be defined in tommath_private.h

This commit is contained in:
Daniel Mendler 2019-05-23 16:37:34 +02:00 committed by Steffen Jaeckel
parent 3000eaa48d
commit c7a7bd47af
No known key found for this signature in database
GPG Key ID: AF0CB17621EDAD72
2 changed files with 14 additions and 7 deletions

View File

@ -161,12 +161,13 @@ TOOM_SQR_CUTOFF;
/* default precision */
#ifndef MP_PREC
# ifndef MP_LOW_MEM
# define MP_PREC 32 /* default digits of precision */
# define PRIVATE_MP_PREC 32 /* default digits of precision */
# elif defined(MP_8BIT)
# define MP_PREC 16 /* default digits of precision */
# define PRIVATE_MP_PREC 16 /* default digits of precision */
# else
# define MP_PREC 8 /* default digits of precision */
# define PRIVATE_MP_PREC 8 /* default digits of precision */
# endif
# define MP_PREC (MP_DEPRECATED_PRAGMA("MP_PREC is an internal macro") PRIVATE_MP_PREC)
#endif
/* size of comba arrays, should be at least 2 * 2**(BITS_PER_WORD - BITS_PER_DIGIT*2) */

View File

@ -140,10 +140,6 @@ extern void *MP_CALLOC(size_t nmemb, size_t size);
extern void MP_FREE(void *mem, size_t size);
#endif
/* TODO: Remove PRIVATE_MP_WARRAY as soon as deprecated MP_WARRAY is removed from tommath.h */
#undef MP_WARRAY
#define MP_WARRAY PRIVATE_MP_WARRAY
/* TODO: Remove private_mp_word as soon as deprecated mp_word is removed from tommath. */
#undef mp_word
typedef private_mp_word mp_word;
@ -162,6 +158,16 @@ typedef private_mp_word mp_word;
#define MP_SIZEOF_BITS(type) ((size_t)CHAR_BIT * sizeof(type))
#define MP_MAXFAST (int)(1uL << (MP_SIZEOF_BITS(mp_word) - (2u * (size_t)MP_DIGIT_BIT)))
/* TODO: Remove PRIVATE_MP_WARRAY as soon as deprecated MP_WARRAY is removed from tommath.h */
#undef MP_WARRAY
#define MP_WARRAY PRIVATE_MP_WARRAY
/* TODO: Remove PRIVATE_MP_PREC as soon as deprecated MP_PREC is removed from tommath.h */
#ifdef PRIVATE_MP_PREC
# undef MP_PREC
# define MP_PREC PRIVATE_MP_PREC
#endif
/* Minimum number of available digits in mp_int, MP_PREC >= MP_MIN_PREC */
#define MP_MIN_PREC ((((CHAR_BIT * (int)sizeof(long long)) + MP_DIGIT_BIT) - 1) / MP_DIGIT_BIT)