diff options
author | Jack Lloyd <[email protected]> | 2018-08-15 07:46:36 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-08-15 07:46:36 -0400 |
commit | b3e15b49ad0946b141c78ac9bf25ef654b0eb017 (patch) | |
tree | 21bcda657a9dd59eb9eff0df989cf5da17813955 /src/lib/math/numbertheory/nistp_redc.cpp | |
parent | d4ab524798edd7609f9db7db5b050459fa7ad238 (diff) |
Remove support for 8 or 16 bit BigInt words
It turned out 8 bit was very broken (failed to compile, due to
overload problems with functions taking uint8_t vs word).
16 bit words work aside from a test failure, but is really slow.
Practically speaking we are not in a position to support 16-bit CPUs
very well. And being able to assume sizeof(word) >= sizeof(uint32_t)
allows simplifying some code.
Diffstat (limited to 'src/lib/math/numbertheory/nistp_redc.cpp')
-rw-r--r-- | src/lib/math/numbertheory/nistp_redc.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/lib/math/numbertheory/nistp_redc.cpp b/src/lib/math/numbertheory/nistp_redc.cpp index b74a2f9c6..1c2855784 100644 --- a/src/lib/math/numbertheory/nistp_redc.cpp +++ b/src/lib/math/numbertheory/nistp_redc.cpp @@ -91,10 +91,8 @@ inline uint32_t get_uint32_t(const BigInt& x, size_t i) { #if (BOTAN_MP_WORD_BITS == 32) return x.word_at(i); -#elif (BOTAN_MP_WORD_BITS == 64) - return static_cast<uint32_t>(x.word_at(i/2) >> ((i % 2)*32)); #else - #error "Not implemented" + return static_cast<uint32_t>(x.word_at(i/2) >> ((i % 2)*32)); #endif } @@ -103,10 +101,8 @@ inline void set_words(BigInt& x, size_t i, uint32_t R0, uint32_t R1) #if (BOTAN_MP_WORD_BITS == 32) x.set_word_at(i, R0); x.set_word_at(i+1, R1); -#elif (BOTAN_MP_WORD_BITS == 64) - x.set_word_at(i/2, (static_cast<uint64_t>(R1) << 32) | R0); #else - #error "Not implemented" + x.set_word_at(i/2, (static_cast<uint64_t>(R1) << 32) | R0); #endif } |