aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/modes/ecb/ecb.cpp
diff options
context:
space:
mode:
authorSimon Warta <[email protected]>2015-06-23 21:07:00 +0200
committerSimon Warta <[email protected]>2015-06-24 12:22:07 +0200
commitb6c79e70b16e862a7ffd3b54e980263548c1d251 (patch)
tree98cb253307a7096c5466bc2e2b6c471cffd08e49 /src/lib/modes/ecb/ecb.cpp
parentd4811ce2ea1c041795804e3ebd2a661d7e043d17 (diff)
lib/modes: Convert &vec[0] to vec.data()
Diffstat (limited to 'src/lib/modes/ecb/ecb.cpp')
-rw-r--r--src/lib/modes/ecb/ecb.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/modes/ecb/ecb.cpp b/src/lib/modes/ecb/ecb.cpp
index eaab1810d..73a241394 100644
--- a/src/lib/modes/ecb/ecb.cpp
+++ b/src/lib/modes/ecb/ecb.cpp
@@ -90,14 +90,14 @@ void ECB_Encryption::update(secure_vector<byte>& buffer, size_t offset)
{
BOTAN_ASSERT(buffer.size() >= offset, "Offset is sane");
const size_t sz = buffer.size() - offset;
- byte* buf = &buffer[offset];
+ byte* buf = buffer.data() + offset;
const size_t BS = cipher().block_size();
BOTAN_ASSERT(sz % BS == 0, "ECB input is full blocks");
const size_t blocks = sz / BS;
- cipher().encrypt_n(&buf[0], &buf[0], blocks);
+ cipher().encrypt_n(buf, buf, blocks);
}
void ECB_Encryption::finish(secure_vector<byte>& buffer, size_t offset)
@@ -131,14 +131,14 @@ void ECB_Decryption::update(secure_vector<byte>& buffer, size_t offset)
{
BOTAN_ASSERT(buffer.size() >= offset, "Offset is sane");
const size_t sz = buffer.size() - offset;
- byte* buf = &buffer[offset];
+ byte* buf = buffer.data() + offset;
const size_t BS = cipher().block_size();
BOTAN_ASSERT(sz % BS == 0, "Input is full blocks");
size_t blocks = sz / BS;
- cipher().decrypt_n(&buf[0], &buf[0], blocks);
+ cipher().decrypt_n(buf, buf, blocks);
}
void ECB_Decryption::finish(secure_vector<byte>& buffer, size_t offset)