From 4b70dbf7c24dc4f60349e96220601f6c55c81c52 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Fri, 26 Jun 2015 11:28:13 +0200 Subject: lib/block: Convert &vec[0] to vec.data() --- src/lib/block/aes_ssse3/aes_ssse3.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/lib/block/aes_ssse3') diff --git a/src/lib/block/aes_ssse3/aes_ssse3.cpp b/src/lib/block/aes_ssse3/aes_ssse3.cpp index b9731d010..f0d506b6e 100644 --- a/src/lib/block/aes_ssse3/aes_ssse3.cpp +++ b/src/lib/block/aes_ssse3/aes_ssse3.cpp @@ -348,7 +348,7 @@ void AES_128_SSSE3::encrypt_n(const byte in[], byte out[], size_t blocks) const const __m128i* in_mm = reinterpret_cast(in); __m128i* out_mm = reinterpret_cast<__m128i*>(out); - const __m128i* keys = reinterpret_cast(&EK[0]); + const __m128i* keys = reinterpret_cast(EK.data()); for(size_t i = 0; i != blocks; ++i) { @@ -365,7 +365,7 @@ void AES_128_SSSE3::decrypt_n(const byte in[], byte out[], size_t blocks) const const __m128i* in_mm = reinterpret_cast(in); __m128i* out_mm = reinterpret_cast<__m128i*>(out); - const __m128i* keys = reinterpret_cast(&DK[0]); + const __m128i* keys = reinterpret_cast(DK.data()); for(size_t i = 0; i != blocks; ++i) { @@ -387,8 +387,8 @@ void AES_128_SSSE3::key_schedule(const byte keyb[], size_t) EK.resize(11*4); DK.resize(11*4); - __m128i* EK_mm = reinterpret_cast<__m128i*>(&EK[0]); - __m128i* DK_mm = reinterpret_cast<__m128i*>(&DK[0]); + __m128i* EK_mm = reinterpret_cast<__m128i*>(EK.data()); + __m128i* DK_mm = reinterpret_cast<__m128i*>(DK.data()); _mm_storeu_si128(DK_mm + 10, _mm_shuffle_epi8(key, sr[2])); @@ -426,7 +426,7 @@ void AES_192_SSSE3::encrypt_n(const byte in[], byte out[], size_t blocks) const const __m128i* in_mm = reinterpret_cast(in); __m128i* out_mm = reinterpret_cast<__m128i*>(out); - const __m128i* keys = reinterpret_cast(&EK[0]); + const __m128i* keys = reinterpret_cast(EK.data()); for(size_t i = 0; i != blocks; ++i) { @@ -443,7 +443,7 @@ void AES_192_SSSE3::decrypt_n(const byte in[], byte out[], size_t blocks) const const __m128i* in_mm = reinterpret_cast(in); __m128i* out_mm = reinterpret_cast<__m128i*>(out); - const __m128i* keys = reinterpret_cast(&DK[0]); + const __m128i* keys = reinterpret_cast(DK.data()); for(size_t i = 0; i != blocks; ++i) { @@ -463,8 +463,8 @@ void AES_192_SSSE3::key_schedule(const byte keyb[], size_t) EK.resize(13*4); DK.resize(13*4); - __m128i* EK_mm = reinterpret_cast<__m128i*>(&EK[0]); - __m128i* DK_mm = reinterpret_cast<__m128i*>(&DK[0]); + __m128i* EK_mm = reinterpret_cast<__m128i*>(EK.data()); + __m128i* DK_mm = reinterpret_cast<__m128i*>(DK.data()); __m128i key1 = _mm_loadu_si128(reinterpret_cast(keyb)); __m128i key2 = _mm_loadu_si128(reinterpret_cast((keyb + 8))); @@ -533,7 +533,7 @@ void AES_256_SSSE3::encrypt_n(const byte in[], byte out[], size_t blocks) const const __m128i* in_mm = reinterpret_cast(in); __m128i* out_mm = reinterpret_cast<__m128i*>(out); - const __m128i* keys = reinterpret_cast(&EK[0]); + const __m128i* keys = reinterpret_cast(EK.data()); for(size_t i = 0; i != blocks; ++i) { @@ -550,7 +550,7 @@ void AES_256_SSSE3::decrypt_n(const byte in[], byte out[], size_t blocks) const const __m128i* in_mm = reinterpret_cast(in); __m128i* out_mm = reinterpret_cast<__m128i*>(out); - const __m128i* keys = reinterpret_cast(&DK[0]); + const __m128i* keys = reinterpret_cast(DK.data()); for(size_t i = 0; i != blocks; ++i) { @@ -570,8 +570,8 @@ void AES_256_SSSE3::key_schedule(const byte keyb[], size_t) EK.resize(15*4); DK.resize(15*4); - __m128i* EK_mm = reinterpret_cast<__m128i*>(&EK[0]); - __m128i* DK_mm = reinterpret_cast<__m128i*>(&DK[0]); + __m128i* EK_mm = reinterpret_cast<__m128i*>(EK.data()); + __m128i* DK_mm = reinterpret_cast<__m128i*>(DK.data()); __m128i key1 = _mm_loadu_si128(reinterpret_cast(keyb)); __m128i key2 = _mm_loadu_si128(reinterpret_cast((keyb + 16))); -- cgit v1.2.3