Skip to content

Commit

Permalink
made MP_31BIT working
Browse files Browse the repository at this point in the history
  • Loading branch information
czurnieden authored and sjaeckel committed Jun 1, 2023
1 parent 2c4ce7a commit 13e6baf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 6 additions & 0 deletions demo/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ static int test_mp_hash(void)
0xabae35c7872c107d,
0xfec74888bcef5fcd,
0x27ba96030abceda5
#elif (MP_DIGIT_BIT == 31)
0xaf63bd4c8601b7df,
0xec1be1c4749a7b86,
0x138ac13639116f2e,
0xdd317b32ac9dd90f,
0x6f87eaac03140738
#else
0xaf63bd4c8601b7df,
0x7e868fbf541faf44,
Expand Down
2 changes: 1 addition & 1 deletion tommath.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ extern "C" {
#if defined(MP_16BIT)
typedef uint16_t mp_digit;
# define MP_DIGIT_BIT 15
#elif defined(MP_64BIT)
#elif ((defined (MP_64BIT)) && !(defined(MP_31BIT)) )
typedef uint64_t mp_digit;
# define MP_DIGIT_BIT 60
#else
Expand Down
5 changes: 1 addition & 4 deletions tommath_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ extern void MP_FREE(void *mem, size_t size);
#if defined(MP_16BIT)
typedef uint32_t mp_word;
#define MP_WORD_SIZE 4
#elif defined(MP_64BIT)
#elif ((defined (MP_64BIT)) && !(defined(MP_31BIT)) )
typedef unsigned long mp_word __attribute__((mode(TI)));
#define MP_WORD_SIZE 16
#else
Expand Down Expand Up @@ -229,9 +229,6 @@ MP_PRIVATE mp_err s_mp_radix_size_overestimate(const mp_int *a, const int radix,
MP_PRIVATE mp_err s_mp_fp_log(const mp_int *a, mp_int *c) MP_WUR;
MP_PRIVATE mp_err s_mp_fp_log_d(const mp_int *a, mp_word *c) MP_WUR;




#define MP_RADIX_MAP_REVERSE_SIZE 80u
extern MP_PRIVATE const char s_mp_radix_map[];
extern MP_PRIVATE const uint8_t s_mp_radix_map_reverse[];
Expand Down

0 comments on commit 13e6baf

Please sign in to comment.