aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/des
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-09-13 12:28:27 +0000
committerlloyd <[email protected]>2010-09-13 12:28:27 +0000
commit27d79c87365105d6128afe9eaf8a82383976ed44 (patch)
tree9a4f0e1d5ae7ecd5c058c0293d9b546191990cdb /src/block/des
parent9acfc3a50b31044e48d8dee5fc8030ad7f4518d4 (diff)
Anywhere where we use MemoryRegion::begin to get access to the raw pointer
representation (rather than in an interator context), instead use &buf[0], which works for both MemoryRegion and std::vector
Diffstat (limited to 'src/block/des')
-rw-r--r--src/block/des/des.cpp4
-rw-r--r--src/block/des/desx.cpp8
2 files changed, 6 insertions, 6 deletions
diff --git a/src/block/des/des.cpp b/src/block/des/des.cpp
index bbe564827..a24a1d445 100644
--- a/src/block/des/des.cpp
+++ b/src/block/des/des.cpp
@@ -203,7 +203,7 @@ void DES::decrypt_n(const byte in[], byte out[], u32bit blocks) const
*/
void DES::key_schedule(const byte key[], u32bit)
{
- des_key_schedule(round_key.begin(), key);
+ des_key_schedule(&round_key[0], key);
}
/*
@@ -283,7 +283,7 @@ void TripleDES::key_schedule(const byte key[], u32bit length)
if(length == 24)
des_key_schedule(&round_key[64], key + 16);
else
- copy_mem(&round_key[64], round_key.begin(), 32);
+ copy_mem(&round_key[64], &round_key[0], 32);
}
}
diff --git a/src/block/des/desx.cpp b/src/block/des/desx.cpp
index d19d7da8a..cc97c4e7b 100644
--- a/src/block/des/desx.cpp
+++ b/src/block/des/desx.cpp
@@ -17,9 +17,9 @@ void DESX::encrypt_n(const byte in[], byte out[], u32bit blocks) const
{
for(u32bit i = 0; i != blocks; ++i)
{
- xor_buf(out, in, K1.begin(), BLOCK_SIZE);
+ xor_buf(out, in, &K1[0], BLOCK_SIZE);
des.encrypt(out);
- xor_buf(out, K2.begin(), BLOCK_SIZE);
+ xor_buf(out, &K2[0], BLOCK_SIZE);
in += BLOCK_SIZE;
out += BLOCK_SIZE;
@@ -33,9 +33,9 @@ void DESX::decrypt_n(const byte in[], byte out[], u32bit blocks) const
{
for(u32bit i = 0; i != blocks; ++i)
{
- xor_buf(out, in, K2.begin(), BLOCK_SIZE);
+ xor_buf(out, in, &K2[0], BLOCK_SIZE);
des.decrypt(out);
- xor_buf(out, K1.begin(), BLOCK_SIZE);
+ xor_buf(out, &K1[0], BLOCK_SIZE);
in += BLOCK_SIZE;
out += BLOCK_SIZE;