diff options
-rw-r--r-- | src/lib/stream/chacha/chacha.cpp | 4 | ||||
-rw-r--r-- | src/lib/stream/ctr/ctr.cpp | 4 | ||||
-rw-r--r-- | src/lib/stream/salsa20/salsa20.cpp | 6 | ||||
-rw-r--r-- | src/lib/stream/stream_cipher.h | 6 |
4 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/stream/chacha/chacha.cpp b/src/lib/stream/chacha/chacha.cpp index d0c534083..9841f99a2 100644 --- a/src/lib/stream/chacha/chacha.cpp +++ b/src/lib/stream/chacha/chacha.cpp @@ -71,7 +71,7 @@ void ChaCha::cipher(const byte in[], byte out[], size_t length) length -= (m_buffer.size() - m_position); in += (m_buffer.size() - m_position); out += (m_buffer.size() - m_position); - chacha(&m_buffer[0], &m_state[0]); + chacha(m_buffer.data(), m_state.data()); ++m_state[12]; m_state[13] += (m_state[12] == 0); @@ -144,7 +144,7 @@ void ChaCha::set_iv(const byte iv[], size_t length) m_state[15] = load_le<u32bit>(iv, 2); } - chacha(&m_buffer[0], &m_state[0]); + chacha(m_buffer.data(), m_state.data()); ++m_state[12]; m_state[13] += (m_state[12] == 0); diff --git a/src/lib/stream/ctr/ctr.cpp b/src/lib/stream/ctr/ctr.cpp index 3b2e75f72..f1cdc7c42 100644 --- a/src/lib/stream/ctr/ctr.cpp +++ b/src/lib/stream/ctr/ctr.cpp @@ -87,7 +87,7 @@ void CTR_BE::set_iv(const byte iv[], size_t iv_len) break; } - m_cipher->encrypt_n(&m_counter[0], &m_pad[0], n_wide); + m_cipher->encrypt_n(m_counter.data(), m_pad.data(), n_wide); m_pad_pos = 0; } @@ -111,7 +111,7 @@ void CTR_BE::increment_counter() } } - m_cipher->encrypt_n(&m_counter[0], &m_pad[0], n_wide); + m_cipher->encrypt_n(m_counter.data(), m_pad.data(), n_wide); m_pad_pos = 0; } diff --git a/src/lib/stream/salsa20/salsa20.cpp b/src/lib/stream/salsa20/salsa20.cpp index 7ab7b4f76..daf01dd0a 100644 --- a/src/lib/stream/salsa20/salsa20.cpp +++ b/src/lib/stream/salsa20/salsa20.cpp @@ -111,7 +111,7 @@ void Salsa20::cipher(const byte in[], byte out[], size_t length) length -= (m_buffer.size() - m_position); in += (m_buffer.size() - m_position); out += (m_buffer.size() - m_position); - salsa20(&m_buffer[0], &m_state[0]); + salsa20(m_buffer.data(), m_state.data()); ++m_state[8]; m_state[9] += (m_state[8] == 0); @@ -187,7 +187,7 @@ void Salsa20::set_iv(const byte iv[], size_t length) m_state[9] = load_le<u32bit>(iv, 3); secure_vector<u32bit> hsalsa(8); - hsalsa20(&hsalsa[0], &m_state[0]); + hsalsa20(hsalsa.data(), m_state.data()); m_state[ 1] = hsalsa[0]; m_state[ 2] = hsalsa[1]; @@ -204,7 +204,7 @@ void Salsa20::set_iv(const byte iv[], size_t length) m_state[8] = 0; m_state[9] = 0; - salsa20(&m_buffer[0], &m_state[0]); + salsa20(m_buffer.data(), m_state.data()); ++m_state[8]; m_state[9] += (m_state[8] == 0); diff --git a/src/lib/stream/stream_cipher.h b/src/lib/stream/stream_cipher.h index 9768aea70..bfdd152a7 100644 --- a/src/lib/stream/stream_cipher.h +++ b/src/lib/stream/stream_cipher.h @@ -38,15 +38,15 @@ class BOTAN_DLL StreamCipher : public SymmetricAlgorithm template<typename Alloc> void encipher(std::vector<byte, Alloc>& inout) - { cipher(&inout[0], &inout[0], inout.size()); } + { cipher(inout.data(), inout.data(), inout.size()); } template<typename Alloc> void encrypt(std::vector<byte, Alloc>& inout) - { cipher(&inout[0], &inout[0], inout.size()); } + { cipher(inout.data(), inout.data(), inout.size()); } template<typename Alloc> void decrypt(std::vector<byte, Alloc>& inout) - { cipher(&inout[0], &inout[0], inout.size()); } + { cipher(inout.data(), inout.data(), inout.size()); } /** * Resync the cipher using the IV |