aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/math/ec_gfp/curve_nistp.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-02-23 07:49:49 -0500
committerJack Lloyd <[email protected]>2018-02-23 07:52:17 -0500
commite8bd6207f9de23c5a2709b9a8ad45cb5cf71beb3 (patch)
tree53d90b8180a70d4106f4761d83fc1af4374ba560 /src/lib/math/ec_gfp/curve_nistp.cpp
parenta37a5d75ce414bc0a8b12a28088442beae07cb4b (diff)
Avoid unneeded grow_to calls
Diffstat (limited to 'src/lib/math/ec_gfp/curve_nistp.cpp')
-rw-r--r--src/lib/math/ec_gfp/curve_nistp.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/math/ec_gfp/curve_nistp.cpp b/src/lib/math/ec_gfp/curve_nistp.cpp
index bc86ed358..62d11d4a9 100644
--- a/src/lib/math/ec_gfp/curve_nistp.cpp
+++ b/src/lib/math/ec_gfp/curve_nistp.cpp
@@ -19,7 +19,8 @@ void normalize(const BigInt& p, BigInt& x, secure_vector<word>& ws, size_t bound
const size_t p_words = p.sig_words();
// TODO: provide a high level function for this compare-and-sub operation
- x.grow_to(p_words + 1);
+ if(x.size() < p_words + 1)
+ x.grow_to(p_words + 1);
if(ws.size() < p_words + 1)
ws.resize(p_words + 1);