diff options
author | Simon Warta <[email protected]> | 2015-06-26 11:28:13 +0200 |
---|---|---|
committer | Simon Warta <[email protected]> | 2015-06-27 11:15:18 +0200 |
commit | 4b70dbf7c24dc4f60349e96220601f6c55c81c52 (patch) | |
tree | b20cb7ace806a5937444a926d597987588a9856b /src/lib/block/des | |
parent | 922336151782c42455d08cca787215b0a4e7b617 (diff) |
lib/block: Convert &vec[0] to vec.data()
Diffstat (limited to 'src/lib/block/des')
-rw-r--r-- | src/lib/block/des/des.cpp | 6 | ||||
-rw-r--r-- | src/lib/block/des/desx.cpp | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/block/des/des.cpp b/src/lib/block/des/des.cpp index 2994b7cb2..c1013b9af 100644 --- a/src/lib/block/des/des.cpp +++ b/src/lib/block/des/des.cpp @@ -157,7 +157,7 @@ void DES::encrypt_n(const byte in[], byte out[], size_t blocks) const u32bit L = static_cast<u32bit>(T >> 32); u32bit R = static_cast<u32bit>(T); - des_encrypt(L, R, &round_key[0]); + des_encrypt(L, R, round_key.data()); T = (DES_FPTAB1[get_byte(0, L)] << 5) | (DES_FPTAB1[get_byte(1, L)] << 3) | (DES_FPTAB1[get_byte(2, L)] << 1) | (DES_FPTAB2[get_byte(3, L)] << 1) | @@ -187,7 +187,7 @@ void DES::decrypt_n(const byte in[], byte out[], size_t blocks) const u32bit L = static_cast<u32bit>(T >> 32); u32bit R = static_cast<u32bit>(T); - des_decrypt(L, R, &round_key[0]); + des_decrypt(L, R, round_key.data()); T = (DES_FPTAB1[get_byte(0, L)] << 5) | (DES_FPTAB1[get_byte(1, L)] << 3) | (DES_FPTAB1[get_byte(2, L)] << 1) | (DES_FPTAB2[get_byte(3, L)] << 1) | @@ -209,7 +209,7 @@ void DES::decrypt_n(const byte in[], byte out[], size_t blocks) const void DES::key_schedule(const byte key[], size_t) { round_key.resize(32); - des_key_schedule(&round_key[0], key); + des_key_schedule(round_key.data(), key); } void DES::clear() diff --git a/src/lib/block/des/desx.cpp b/src/lib/block/des/desx.cpp index 92cfc83cc..0e19460fc 100644 --- a/src/lib/block/des/desx.cpp +++ b/src/lib/block/des/desx.cpp @@ -19,9 +19,9 @@ void DESX::encrypt_n(const byte in[], byte out[], size_t blocks) const { for(size_t i = 0; i != blocks; ++i) { - xor_buf(out, in, &K1[0], BLOCK_SIZE); + xor_buf(out, in, K1.data(), BLOCK_SIZE); des.encrypt(out); - xor_buf(out, &K2[0], BLOCK_SIZE); + xor_buf(out, K2.data(), BLOCK_SIZE); in += BLOCK_SIZE; out += BLOCK_SIZE; @@ -35,9 +35,9 @@ void DESX::decrypt_n(const byte in[], byte out[], size_t blocks) const { for(size_t i = 0; i != blocks; ++i) { - xor_buf(out, in, &K2[0], BLOCK_SIZE); + xor_buf(out, in, K2.data(), BLOCK_SIZE); des.decrypt(out); - xor_buf(out, &K1[0], BLOCK_SIZE); + xor_buf(out, K1.data(), BLOCK_SIZE); in += BLOCK_SIZE; out += BLOCK_SIZE; |