diff options
author | lloyd <[email protected]> | 2010-09-13 12:28:27 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-09-13 12:28:27 +0000 |
commit | 27d79c87365105d6128afe9eaf8a82383976ed44 (patch) | |
tree | 9a4f0e1d5ae7ecd5c058c0293d9b546191990cdb /src/stream/ctr | |
parent | 9acfc3a50b31044e48d8dee5fc8030ad7f4518d4 (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/stream/ctr')
-rw-r--r-- | src/stream/ctr/ctr.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/stream/ctr/ctr.cpp b/src/stream/ctr/ctr.cpp index cd1b1b7fb..6162a76a0 100644 --- a/src/stream/ctr/ctr.cpp +++ b/src/stream/ctr/ctr.cpp @@ -71,13 +71,13 @@ void CTR_BE::cipher(const byte in[], byte out[], u32bit length) { while(length >= buffer.size() - position) { - xor_buf(out, in, buffer.begin() + position, buffer.size() - position); + xor_buf(out, in, &buffer[position], buffer.size() - position); length -= (buffer.size() - position); in += (buffer.size() - position); out += (buffer.size() - position); increment_counter(); } - xor_buf(out, in, buffer.begin() + position, length); + xor_buf(out, in, &buffer[position], length); position += length; } @@ -100,7 +100,8 @@ void CTR_BE::set_iv(const byte iv[], u32bit iv_len) for(u32bit i = 1; i != PARALLEL_BLOCKS; ++i) { counter.copy(i*BLOCK_SIZE, - counter.begin() + (i-1)*BLOCK_SIZE, BLOCK_SIZE); + &counter[(i-1)*BLOCK_SIZE], + BLOCK_SIZE); for(s32bit j = BLOCK_SIZE - 1; j >= 0; --j) if(++counter[i*BLOCK_SIZE+j]) |