aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/math/bigint/bigint.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2020-03-21 06:38:58 -0400
committerJack Lloyd <[email protected]>2020-03-21 06:38:58 -0400
commit89e063803d5b27c484a0b03d028bc4ce288d6815 (patch)
tree6c2fae845ea448112a674b0100c4277e7fa31d24 /src/lib/math/bigint/bigint.cpp
parente966996ff101145e489958610370366c4ee6dd36 (diff)
Deprecate BigInt::shrink_to_fit
Add const-time annotations to gcd implementation.
Diffstat (limited to 'src/lib/math/bigint/bigint.cpp')
-rw-r--r--src/lib/math/bigint/bigint.cpp6
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)