diff options
Diffstat (limited to 'src/algo_base')
-rw-r--r-- | src/algo_base/symkey.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/algo_base/symkey.cpp b/src/algo_base/symkey.cpp index a84ce2f19..5509b83bc 100644 --- a/src/algo_base/symkey.cpp +++ b/src/algo_base/symkey.cpp @@ -37,8 +37,7 @@ OctetString::OctetString(const std::string& hex_string) */ OctetString::OctetString(const byte in[], size_t n) { - bits.resize(n); - bits.copy(in, n); + bits.assign(in, in + n); } OctetString::OctetString(const MemoryRegion<byte>& b) : bits(b) @@ -129,7 +128,7 @@ OctetString operator+(const OctetString& k1, const OctetString& k2) OctetString operator^(const OctetString& k1, const OctetString& k2) { SecureVector<byte> ret(std::max(k1.length(), k2.length())); - ret.copy(k1.begin(), k1.length()); + copy_mem(&ret[0], k1.begin(), k1.length()); xor_buf(ret, k2.begin(), k2.length()); return OctetString(ret); } |