diff options
author | Jack Lloyd <[email protected]> | 2018-06-21 11:25:05 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-06-21 11:25:05 -0400 |
commit | 49486ffd4a4da10227271d815a8d5b4b11656c54 (patch) | |
tree | 23a63eaedd5844d5c99f40c6bbfa0d5ac0e2a881 /src/lib/math | |
parent | 656f08f67b1c69316121d27d446270e8eb8b16f2 (diff) |
Avoid needless alloc and copy
Diffstat (limited to 'src/lib/math')
-rw-r--r-- | src/lib/math/bigint/bigint.h | 6 |
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 |