diff options
Diffstat (limited to 'src/stream')
-rw-r--r-- | src/stream/arc4/arc4.cpp | 4 | ||||
-rw-r--r-- | src/stream/ctr/ctr.cpp | 7 | ||||
-rw-r--r-- | src/stream/ofb/ofb.cpp | 4 | ||||
-rw-r--r-- | src/stream/turing/turing.cpp | 4 |
4 files changed, 10 insertions, 9 deletions
diff --git a/src/stream/arc4/arc4.cpp b/src/stream/arc4/arc4.cpp index a3a2f9a65..90f0f0904 100644 --- a/src/stream/arc4/arc4.cpp +++ b/src/stream/arc4/arc4.cpp @@ -18,13 +18,13 @@ void ARC4::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); generate(); } - xor_buf(out, in, buffer.begin() + position, length); + xor_buf(out, in, &buffer[position], length); position += length; } 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]) diff --git a/src/stream/ofb/ofb.cpp b/src/stream/ofb/ofb.cpp index 332673153..6fc8e4b68 100644 --- a/src/stream/ofb/ofb.cpp +++ b/src/stream/ofb/ofb.cpp @@ -68,14 +68,14 @@ void OFB::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); permutation->encrypt(buffer); position = 0; } - xor_buf(out, in, buffer.begin() + position, length); + xor_buf(out, in, &buffer[position], length); position += length; } diff --git a/src/stream/turing/turing.cpp b/src/stream/turing/turing.cpp index bfb2166d8..c53b666ad 100644 --- a/src/stream/turing/turing.cpp +++ b/src/stream/turing/turing.cpp @@ -39,13 +39,13 @@ void Turing::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); generate(); } - xor_buf(out, in, buffer.begin() + position, length); + xor_buf(out, in, &buffer[position], length); position += length; } |