diff options
Diffstat (limited to 'src/lib/math/bigint/bigint.cpp')
-rw-r--r-- | src/lib/math/bigint/bigint.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/math/bigint/bigint.cpp b/src/lib/math/bigint/bigint.cpp index 96ca92b35..ad9e5a0da 100644 --- a/src/lib/math/bigint/bigint.cpp +++ b/src/lib/math/bigint/bigint.cpp @@ -505,10 +505,8 @@ void BigInt::ct_cond_assign(bool predicate, const BigInt& other) this->set_word_at(i, mask.select(o_word, t_word)); } - if(sign() != other.sign()) - { - cond_flip_sign(predicate); - } + const bool different_sign = sign() != other.sign(); + cond_flip_sign(predicate && different_sign); } #if defined(BOTAN_HAS_VALGRIND) |