change DIGIT_BIT define to be able to test e.g. FP_SIZE in a macro

This commit is contained in:
Steffen Jaeckel 2014-06-12 17:59:22 +02:00
parent 540e3ecbc1
commit 82aeb1d824

View File

@ -248,6 +248,7 @@
typedef unsigned long ulong64; typedef unsigned long ulong64;
#endif #endif
typedef ulong64 fp_digit; typedef ulong64 fp_digit;
#define SIZEOF_FP_DIGIT 8
typedef unsigned long fp_word __attribute__ ((mode(TI))); typedef unsigned long fp_word __attribute__ ((mode(TI)));
#else #else
/* this is to make porting into LibTomCrypt easier :-) */ /* this is to make porting into LibTomCrypt easier :-) */
@ -261,11 +262,12 @@
#endif #endif
#endif #endif
typedef unsigned long fp_digit; typedef unsigned long fp_digit;
#define SIZEOF_FP_DIGIT 4
typedef ulong64 fp_word; typedef ulong64 fp_word;
#endif #endif
/* # of digits this is */ /* # of digits this is */
#define DIGIT_BIT (int)((CHAR_BIT) * sizeof(fp_digit)) #define DIGIT_BIT ((CHAR_BIT) * SIZEOF_FP_DIGIT)
#define FP_MASK (fp_digit)(-1) #define FP_MASK (fp_digit)(-1)
#define FP_SIZE (FP_MAX_SIZE/DIGIT_BIT) #define FP_SIZE (FP_MAX_SIZE/DIGIT_BIT)