Skip to content

made MP_31BIT working #549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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