diff options
author | lloyd <[email protected]> | 2012-05-18 14:24:51 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-05-18 14:24:51 +0000 |
commit | ab5c922f0e2635dc0e45fc757b27be9f28986acb (patch) | |
tree | c21a18bbfb316196b1b13488ef05f184f12be9f0 /src/algo_base | |
parent | 2c3dc93d6466a9215d585613fb55f5222ce70d10 (diff) |
Remove all uses of MemoryRegion::copy outside of internal uses in
secmem.h. Mostly replaced by assign or copy_mem.
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); } |