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/comb4p | |
parent | d6044e49cefc7fb1415033ed7f7ed74e9a985d33 (diff) |
lib/hash: Convert &vec[0] to vec.data()
Diffstat (limited to 'src/lib/hash/comb4p')
-rw-r--r-- | src/lib/hash/comb4p/comb4p.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/hash/comb4p/comb4p.cpp b/src/lib/hash/comb4p/comb4p.cpp index 4797e2483..843c530ef 100644 --- a/src/lib/hash/comb4p/comb4p.cpp +++ b/src/lib/hash/comb4p/comb4p.cpp @@ -25,14 +25,14 @@ void comb4p_round(secure_vector<byte>& out, h1.update(round_no); h2.update(round_no); - h1.update(&in[0], in.size()); - h2.update(&in[0], in.size()); + h1.update(in.data(), in.size()); + h2.update(in.data(), in.size()); secure_vector<byte> h_buf = h1.final(); - xor_buf(&out[0], &h_buf[0], std::min(out.size(), h_buf.size())); + xor_buf(out.data(), h_buf.data(), std::min(out.size(), h_buf.size())); h_buf = h2.final(); - xor_buf(&out[0], &h_buf[0], std::min(out.size(), h_buf.size())); + xor_buf(out.data(), h_buf.data(), std::min(out.size(), h_buf.size())); } } @@ -98,7 +98,7 @@ void Comb4P::final_result(byte out[]) secure_vector<byte> h2 = m_hash2->final(); // First round - xor_buf(&h1[0], &h2[0], std::min(h1.size(), h2.size())); + xor_buf(h1.data(), h2.data(), std::min(h1.size(), h2.size())); // Second round comb4p_round(h2, h1, 1, *m_hash1, *m_hash2); @@ -106,8 +106,8 @@ void Comb4P::final_result(byte out[]) // Third round comb4p_round(h1, h2, 2, *m_hash1, *m_hash2); - copy_mem(out , &h1[0], h1.size()); - copy_mem(out + h1.size(), &h2[0], h2.size()); + copy_mem(out , h1.data(), h1.size()); + copy_mem(out + h1.size(), h2.data(), h2.size()); // Prep for processing next message, if any m_hash1->update(0); |