do not use long long for minimum prec calculation, improve comment

This commit is contained in:
Daniel Mendler 2019-11-22 16:01:42 +01:00 committed by Steffen Jaeckel
parent a8357d4328
commit f0ab662ffc
No known key found for this signature in database
GPG Key ID: AF0CB17621EDAD72

View File

@ -151,9 +151,10 @@ MP_STATIC_ASSERT(correct_word_size, sizeof(mp_word) == (2u * sizeof(mp_digit)))
/* 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
* - Must be large enough such that the mp_set_u64 setter can
* store uint64_t in the mp_int without growing
*/
#define MP_MIN_PREC MP_MAX(3, (((int)MP_SIZEOF_BITS(long long) + MP_DIGIT_BIT) - 1) / MP_DIGIT_BIT)
#define MP_MIN_PREC MP_MAX(3, (((int)MP_SIZEOF_BITS(uint64_t) + MP_DIGIT_BIT) - 1) / MP_DIGIT_BIT)
MP_STATIC_ASSERT(prec_geq_min_prec, MP_PREC >= MP_MIN_PREC)
/* random number source */