Skip to content

Commit

Permalink
fix MP_MIN_PREC
Browse files Browse the repository at this point in the history
  • Loading branch information
minad committed Nov 3, 2019
1 parent f6e1152 commit f27db36
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tommath_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,13 @@ MP_STATIC_ASSERT(correct_word_size, sizeof(mp_word) == (2u * sizeof(mp_digit)))
# endif
#endif

/* Minimum number of available digits in mp_int, MP_PREC >= MP_MIN_PREC */
#define MP_MIN_PREC ((((int)MP_SIZEOF_BITS(long long) + MP_DIGIT_BIT) - 1) / MP_DIGIT_BIT)
/* Minimum number of available digits in mp_int, MP_PREC >= MP_MIN_PREC
* - Must be at least 3 for s_mp_div_school.
* - Must be large enough such that uint64_t can be stored in mp_int without growing
*/
#define MP_MIN_PREC 3

MP_STATIC_ASSERT(min_prec_large_enough, MP_MIN_PREC >= (((int)MP_SIZEOF_BITS(long long) + MP_DIGIT_BIT) - 1) / MP_DIGIT_BIT);
MP_STATIC_ASSERT(prec_geq_min_prec, MP_PREC >= MP_MIN_PREC)

/* random number source */
Expand Down

0 comments on commit f27db36

Please sign in to comment.