aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/math
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-07-05 18:41:09 -0400
committerJack Lloyd <[email protected]>2019-07-05 18:41:09 -0400
commite7d15e07f8cbe0998fbc318413d5367398195b12 (patch)
tree221db4da354cbdb864a75c18cf1a8cc3d35052db /src/lib/math
parent849df018ae4fc2fe78dce0c6a5fae3b9c9b4c4af (diff)
Fix LGTM warning
Diffstat (limited to 'src/lib/math')
-rw-r--r--src/lib/math/mp/mp_core.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/math/mp/mp_core.h b/src/lib/math/mp/mp_core.h
index 300ee7889..4f9a412bd 100644
--- a/src/lib/math/mp/mp_core.h
+++ b/src/lib/math/mp/mp_core.h
@@ -19,9 +19,7 @@
namespace Botan {
-const word MP_WORD_MASK = ~static_cast<word>(0);
-const word MP_WORD_TOP_BIT = static_cast<word>(1) << (8*sizeof(word) - 1);
-const word MP_WORD_MAX = MP_WORD_MASK;
+const word MP_WORD_MAX = ~static_cast<word>(0);
/*
* If cond == 0, does nothing.
@@ -731,7 +729,7 @@ inline word bigint_divop(word n1, word n0, word d)
for(size_t i = 0; i != BOTAN_MP_WORD_BITS; ++i)
{
- word high_top_bit = (high & MP_WORD_TOP_BIT);
+ const word high_top_bit = high >> (BOTAN_MP_WORD_BITS-1);
high <<= 1;
high |= (n0 >> (BOTAN_MP_WORD_BITS-1-i)) & 1;