From 89e063803d5b27c484a0b03d028bc4ce288d6815 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Sat, 21 Mar 2020 06:38:58 -0400 Subject: Deprecate BigInt::shrink_to_fit Add const-time annotations to gcd implementation. --- src/lib/math/bigint/bigint.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/lib/math/bigint/bigint.cpp') 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) -- cgit v1.2.3