aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-11-27 11:32:34 -0500
committerJack Lloyd <[email protected]>2018-11-27 11:32:34 -0500
commitcf91494b524b241d8c3db5b797667c803ac6d9dd (patch)
tree10de78c9d0f928dc34f63e73d9c5abf1ee7cc0b3
parent3655faa31fd52a1c624f142420ea5c61a170688b (diff)
Need to ensure minimum size here
Previously handled by the early exit
-rw-r--r--src/lib/math/numbertheory/nistp_redc.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib/math/numbertheory/nistp_redc.cpp b/src/lib/math/numbertheory/nistp_redc.cpp
index 1c7afadc5..a74c4de9f 100644
--- a/src/lib/math/numbertheory/nistp_redc.cpp
+++ b/src/lib/math/numbertheory/nistp_redc.cpp
@@ -32,6 +32,7 @@ void redc_p521(BigInt& x, secure_vector<word>& ws)
bigint_shr2(ws.data(), x.data(), std::min(x.size(), 2*p_words), p_full_words, p_top_bits);
x.mask_bits(521);
+ x.grow_to(p_words);
// Word-level carry will be zero
word carry = bigint_add3_nc(x.mutable_data(), x.data(), p_words, ws.data(), p_words);