diff options
author | lloyd <[email protected]> | 2012-05-18 13:58:23 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-05-18 13:58:23 +0000 |
commit | 2c3dc93d6466a9215d585613fb55f5222ce70d10 (patch) | |
tree | 9d44c738fdbb79103bed2d34c8fb171f8eaa00a2 /src/hash | |
parent | c2d0d2982e96ab7ce15e90b8d73c9774e2650d86 (diff) |
First step towards replacing the existing containers with std::vector
with a custom allocator; remove the 3 argument version of
MemoryRegion::copy, replacing with freestanding buffer_insert
function.
Diffstat (limited to 'src/hash')
-rw-r--r-- | src/hash/gost_3411/gost_3411.cpp | 4 | ||||
-rw-r--r-- | src/hash/md2/md2.cpp | 4 | ||||
-rw-r--r-- | src/hash/mdx_hash/mdx_hash.cpp | 4 | ||||
-rw-r--r-- | src/hash/skein/skein_512.cpp | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/hash/gost_3411/gost_3411.cpp b/src/hash/gost_3411/gost_3411.cpp index c0f39da47..6996e45e6 100644 --- a/src/hash/gost_3411/gost_3411.cpp +++ b/src/hash/gost_3411/gost_3411.cpp @@ -43,7 +43,7 @@ void GOST_34_11::add_data(const byte input[], size_t length) if(position) { - buffer.copy(position, input, length); + buffer_insert(buffer, position, input, length); if(position + length >= hash_block_size()) { @@ -60,7 +60,7 @@ void GOST_34_11::add_data(const byte input[], size_t length) if(full_blocks) compress_n(input, full_blocks); - buffer.copy(position, input + full_blocks * hash_block_size(), remaining); + buffer_insert(buffer, position, input + full_blocks * hash_block_size(), remaining); position += remaining; } diff --git a/src/hash/md2/md2.cpp b/src/hash/md2/md2.cpp index 761528dc6..f44053a1c 100644 --- a/src/hash/md2/md2.cpp +++ b/src/hash/md2/md2.cpp @@ -39,7 +39,7 @@ void MD2::hash(const byte input[]) 0x31, 0x44, 0x50, 0xB4, 0x8F, 0xED, 0x1F, 0x1A, 0xDB, 0x99, 0x8D, 0x33, 0x9F, 0x11, 0x83, 0x14 }; - X.copy(16, input, hash_block_size()); + buffer_insert(X, 16, input, hash_block_size()); xor_buf(&X[32], &X[0], &X[16], hash_block_size()); byte T = 0; @@ -66,7 +66,7 @@ void MD2::hash(const byte input[]) */ void MD2::add_data(const byte input[], size_t length) { - buffer.copy(position, input, length); + buffer_insert(buffer, position, input, length); if(position + length >= hash_block_size()) { diff --git a/src/hash/mdx_hash/mdx_hash.cpp b/src/hash/mdx_hash/mdx_hash.cpp index 7bfcf6592..81042c1fa 100644 --- a/src/hash/mdx_hash/mdx_hash.cpp +++ b/src/hash/mdx_hash/mdx_hash.cpp @@ -44,7 +44,7 @@ void MDx_HashFunction::add_data(const byte input[], size_t length) if(position) { - buffer.copy(position, input, length); + buffer_insert(buffer, position, input, length); if(position + length >= buffer.size()) { @@ -61,7 +61,7 @@ void MDx_HashFunction::add_data(const byte input[], size_t length) if(full_blocks) compress_n(input, full_blocks); - buffer.copy(position, input + full_blocks * buffer.size(), remaining); + buffer_insert(buffer, position, input + full_blocks * buffer.size(), remaining); position += remaining; } diff --git a/src/hash/skein/skein_512.cpp b/src/hash/skein/skein_512.cpp index 47bee5274..f6541fba7 100644 --- a/src/hash/skein/skein_512.cpp +++ b/src/hash/skein/skein_512.cpp @@ -210,7 +210,7 @@ void Skein_512::add_data(const byte input[], size_t length) if(buf_pos) { - buffer.copy(buf_pos, input, length); + buffer_insert(buffer, buf_pos, input, length); if(buf_pos + length > 64) { ubi_512(H, T, &buffer[0], buffer.size()); @@ -228,7 +228,7 @@ void Skein_512::add_data(const byte input[], size_t length) length -= full_blocks * 64; - buffer.copy(buf_pos, input + full_blocks * 64, length); + buffer_insert(buffer, buf_pos, input + full_blocks * 64, length); buf_pos += length; } |