aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/math
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-06-21 11:25:05 -0400
committerJack Lloyd <[email protected]>2018-06-21 11:25:05 -0400
commit49486ffd4a4da10227271d815a8d5b4b11656c54 (patch)
tree23a63eaedd5844d5c99f40c6bbfa0d5ac0e2a881 /src/lib/math
parent656f08f67b1c69316121d27d446270e8eb8b16f2 (diff)
Avoid needless alloc and copy
Diffstat (limited to 'src/lib/math')
-rw-r--r--src/lib/math/bigint/bigint.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/math/bigint/bigint.h b/src/lib/math/bigint/bigint.h
index 0b826c8f5..8c627c584 100644
--- a/src/lib/math/bigint/bigint.h
+++ b/src/lib/math/bigint/bigint.h
@@ -445,6 +445,12 @@ class BOTAN_PUBLIC_API(2,0) BigInt final
m_reg[i] = w;
}
+ void set_words(const word w[], size_t len)
+ {
+ m_reg.resize(len);
+ copy_mem(mutable_data(), w, len);
+ }
+
/**
* Tests if the sign of the integer is negative
* @result true, iff the integer has a negative sign