diff options
author | lloyd <[email protected]> | 2010-10-13 02:56:03 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-10-13 02:56:03 +0000 |
commit | 3697dcff8b5e9765b41114281ce10e7ed3d3abb4 (patch) | |
tree | 670853a74b0fe173e7e9fce9cd3e6eda7a03d2c7 /src/stream/ctr | |
parent | 63121e1e169616f724bf79b8aac1a2b4423c8904 (diff) |
s/BLOCK_SIZE/block_size()/
Diffstat (limited to 'src/stream/ctr')
-rw-r--r-- | src/stream/ctr/ctr.cpp | 15 | ||||
-rw-r--r-- | src/stream/ctr/ctr.h | 2 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/stream/ctr/ctr.cpp b/src/stream/ctr/ctr.cpp index 0a962bd5a..dc2f334a8 100644 --- a/src/stream/ctr/ctr.cpp +++ b/src/stream/ctr/ctr.cpp @@ -89,7 +89,7 @@ void CTR_BE::set_iv(const byte iv[], size_t iv_len) if(!valid_iv_length(iv_len)) throw Invalid_IV_Length(name(), iv_len); - const size_t BLOCK_SIZE = permutation->BLOCK_SIZE; + const size_t BLOCK_SIZE = permutation->block_size(); zeroise(counter); @@ -117,21 +117,22 @@ void CTR_BE::set_iv(const byte iv[], size_t iv_len) */ void CTR_BE::increment_counter() { - const size_t PARALLEL_BLOCKS = counter.size() / permutation->BLOCK_SIZE; + const size_t BLOCK_SIZE = permutation->block_size(); + const size_t PARALLEL_BLOCKS = counter.size() / BLOCK_SIZE; for(size_t i = 0; i != PARALLEL_BLOCKS; ++i) { - byte* this_ctr = &counter[i * permutation->BLOCK_SIZE]; + byte* this_ctr = &counter[i * BLOCK_SIZE]; - byte last_byte = this_ctr[permutation->BLOCK_SIZE-1]; + byte last_byte = this_ctr[BLOCK_SIZE-1]; last_byte += PARALLEL_BLOCKS; - if(this_ctr[permutation->BLOCK_SIZE-1] > last_byte) - for(s32bit j = permutation->BLOCK_SIZE - 2; j >= 0; --j) + if(this_ctr[BLOCK_SIZE-1] > last_byte) + for(s32bit j = BLOCK_SIZE - 2; j >= 0; --j) if(++this_ctr[j]) break; - this_ctr[permutation->BLOCK_SIZE-1] = last_byte; + this_ctr[BLOCK_SIZE-1] = last_byte; } permutation->encrypt_n(&counter[0], &buffer[0], PARALLEL_BLOCKS); diff --git a/src/stream/ctr/ctr.h b/src/stream/ctr/ctr.h index 8c317acb0..e62ab2860 100644 --- a/src/stream/ctr/ctr.h +++ b/src/stream/ctr/ctr.h @@ -24,7 +24,7 @@ class BOTAN_DLL CTR_BE : public StreamCipher void set_iv(const byte iv[], size_t iv_len); bool valid_iv_length(size_t iv_len) const - { return (iv_len <= permutation->BLOCK_SIZE); } + { return (iv_len <= permutation->block_size()); } std::string name() const; |