diff options
author | Simon Warta <[email protected]> | 2015-06-26 00:17:56 +0200 |
---|---|---|
committer | Simon Warta <[email protected]> | 2015-06-27 10:57:40 +0200 |
commit | c0d847700c2905d9f7eecf2835d2750b564fc65b (patch) | |
tree | b48224cfa0db44700531d78f0aa98bce835bfce5 /src/lib/hash/md2 | |
parent | d6044e49cefc7fb1415033ed7f7ed74e9a985d33 (diff) |
lib/hash: Convert &vec[0] to vec.data()
Diffstat (limited to 'src/lib/hash/md2')
-rw-r--r-- | src/lib/hash/md2/md2.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/hash/md2/md2.cpp b/src/lib/hash/md2/md2.cpp index 91d8154cf..6543cf1a0 100644 --- a/src/lib/hash/md2/md2.cpp +++ b/src/lib/hash/md2/md2.cpp @@ -43,7 +43,7 @@ void MD2::hash(const byte input[]) 0x9F, 0x11, 0x83, 0x14 }; buffer_insert(X, 16, input, hash_block_size()); - xor_buf(&X[32], &X[0], &X[16], hash_block_size()); + xor_buf(&X[32], X.data(), &X[16], hash_block_size()); byte T = 0; for(size_t i = 0; i != 18; ++i) @@ -73,7 +73,7 @@ void MD2::add_data(const byte input[], size_t length) if(position + length >= hash_block_size()) { - hash(&buffer[0]); + hash(buffer.data()); input += (hash_block_size() - position); length -= (hash_block_size() - position); while(length >= hash_block_size()) @@ -82,7 +82,7 @@ void MD2::add_data(const byte input[], size_t length) input += hash_block_size(); length -= hash_block_size(); } - copy_mem(&buffer[0], input, length); + copy_mem(buffer.data(), input, length); position = 0; } position += length; @@ -96,9 +96,9 @@ void MD2::final_result(byte output[]) for(size_t i = position; i != hash_block_size(); ++i) buffer[i] = static_cast<byte>(hash_block_size() - position); - hash(&buffer[0]); - hash(&checksum[0]); - copy_mem(output, &X[0], output_length()); + hash(buffer.data()); + hash(checksum.data()); + copy_mem(output, X.data(), output_length()); clear(); } |