diff options
author | Simon Warta <[email protected]> | 2015-06-25 11:16:28 +0200 |
---|---|---|
committer | Simon Warta <[email protected]> | 2015-06-25 11:16:28 +0200 |
commit | 026329021ca6693be545752238c517d477166a63 (patch) | |
tree | 76f45908577064e32f95280cd116b63fde9c72f7 /src/lib/mac | |
parent | 1033054c1495d4a10afc33f2747d24d9c32b6907 (diff) |
lib/mac: Convert &vec[0] to vec.data()
Diffstat (limited to 'src/lib/mac')
-rw-r--r-- | src/lib/mac/cbc_mac/cbc_mac.cpp | 2 | ||||
-rw-r--r-- | src/lib/mac/cmac/cmac.cpp | 2 | ||||
-rw-r--r-- | src/lib/mac/mac.cpp | 2 | ||||
-rw-r--r-- | src/lib/mac/poly1305/poly1305.cpp | 8 | ||||
-rw-r--r-- | src/lib/mac/x919_mac/x919_mac.cpp | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/mac/cbc_mac/cbc_mac.cpp b/src/lib/mac/cbc_mac/cbc_mac.cpp index f07c7fe37..b58372c78 100644 --- a/src/lib/mac/cbc_mac/cbc_mac.cpp +++ b/src/lib/mac/cbc_mac/cbc_mac.cpp @@ -57,7 +57,7 @@ void CBC_MAC::final_result(byte mac[]) if(m_position) m_cipher->encrypt(m_state); - copy_mem(mac, &m_state[0], m_state.size()); + copy_mem(mac, m_state.data(), m_state.size()); zeroise(m_state); m_position = 0; } diff --git a/src/lib/mac/cmac/cmac.cpp b/src/lib/mac/cmac/cmac.cpp index bb9d1c367..1621079dc 100644 --- a/src/lib/mac/cmac/cmac.cpp +++ b/src/lib/mac/cmac/cmac.cpp @@ -84,7 +84,7 @@ void CMAC::add_data(const byte input[], size_t length) input += output_length(); length -= output_length(); } - copy_mem(&m_buffer[0], input, length); + copy_mem(m_buffer.data(), input, length); m_position = 0; } m_position += length; diff --git a/src/lib/mac/mac.cpp b/src/lib/mac/mac.cpp index cd1951639..0bb1939c7 100644 --- a/src/lib/mac/mac.cpp +++ b/src/lib/mac/mac.cpp @@ -20,7 +20,7 @@ bool MessageAuthenticationCode::verify_mac(const byte mac[], size_t length) if(our_mac.size() != length) return false; - return same_mem(&our_mac[0], &mac[0], length); + return same_mem(our_mac.data(), mac, length); } } diff --git a/src/lib/mac/poly1305/poly1305.cpp b/src/lib/mac/poly1305/poly1305.cpp index 01f84cb32..545a749fa 100644 --- a/src/lib/mac/poly1305/poly1305.cpp +++ b/src/lib/mac/poly1305/poly1305.cpp @@ -132,10 +132,10 @@ void poly1305_finish(secure_vector<u64bit>& X, byte mac[16]) h0 = ((h0 ) | (h1 << 44)); h1 = ((h1 >> 20) | (h2 << 24)); - store_le(&mac[0], h0, h1); + store_le(mac, h0, h1); /* zero out the state */ - clear_mem(&X[0], X.size()); + clear_mem(X.data(), X.size()); } } @@ -166,7 +166,7 @@ void Poly1305::add_data(const byte input[], size_t length) if(m_buf_pos + length >= m_buf.size()) { - poly1305_blocks(m_poly, &m_buf[0], 1); + poly1305_blocks(m_poly, m_buf.data(), 1); input += (m_buf.size() - m_buf_pos); length -= (m_buf.size() - m_buf_pos); m_buf_pos = 0; @@ -191,7 +191,7 @@ void Poly1305::final_result(byte out[]) { m_buf[m_buf_pos] = 1; clear_mem(&m_buf[m_buf_pos+1], m_buf.size() - m_buf_pos - 1); - poly1305_blocks(m_poly, &m_buf[0], 1, true); + poly1305_blocks(m_poly, m_buf.data(), 1, true); } poly1305_finish(m_poly, out); diff --git a/src/lib/mac/x919_mac/x919_mac.cpp b/src/lib/mac/x919_mac/x919_mac.cpp index 2e0fb2817..542f9040a 100644 --- a/src/lib/mac/x919_mac/x919_mac.cpp +++ b/src/lib/mac/x919_mac/x919_mac.cpp @@ -45,7 +45,7 @@ void ANSI_X919_MAC::final_result(byte mac[]) { if(m_position) m_des1->encrypt(m_state); - m_des2->decrypt(&m_state[0], mac); + m_des2->decrypt(m_state.data(), mac); m_des1->encrypt(mac); zeroise(m_state); m_position = 0; |