aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/math/bigint/bigint.h
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-08-21 09:26:15 -0400
committerJack Lloyd <[email protected]>2019-08-22 10:07:16 -0400
commit6adfc07738df32dc38d1b4c19e51ac3f0e21e145 (patch)
tree09bbb4c340cb2504e9e293bb8a9005595e0eda79 /src/lib/math/bigint/bigint.h
parentf4f8dc439252589263bb20221d5b865fa60b4343 (diff)
Small BigInt optimizations
Based on profiling RSA key generation
Diffstat (limited to 'src/lib/math/bigint/bigint.h')
-rw-r--r--src/lib/math/bigint/bigint.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/math/bigint/bigint.h b/src/lib/math/bigint/bigint.h
index 80b23ca8c..505bacde0 100644
--- a/src/lib/math/bigint/bigint.h
+++ b/src/lib/math/bigint/bigint.h
@@ -948,7 +948,11 @@ class BOTAN_PUBLIC_API(2,0) BigInt final
{
invalidate_sig_words();
if(i >= m_reg.size())
+ {
+ if(w == 0)
+ return;
grow_to(i + 1);
+ }
m_reg[i] = w;
}