diff options
Diffstat (limited to 'src/block/lion/lion.cpp')
-rw-r--r-- | src/block/lion/lion.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/block/lion/lion.cpp b/src/block/lion/lion.cpp index 0b3e7762a..7f6a06b79 100644 --- a/src/block/lion/lion.cpp +++ b/src/block/lion/lion.cpp @@ -33,8 +33,8 @@ void Lion::encrypt_n(const byte in[], byte out[], size_t blocks) const cipher->set_key(buffer, LEFT_SIZE); cipher->cipher1(out + LEFT_SIZE, RIGHT_SIZE); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -60,8 +60,8 @@ void Lion::decrypt_n(const byte in[], byte out[], size_t blocks) const cipher->set_key(buffer, LEFT_SIZE); cipher->cipher1(out + LEFT_SIZE, RIGHT_SIZE); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -83,7 +83,7 @@ std::string Lion::name() const { return "Lion(" + hash->name() + "," + cipher->name() + "," + - to_string(BLOCK_SIZE) + ")"; + to_string(block_size()) + ")"; } /* @@ -91,7 +91,7 @@ std::string Lion::name() const */ BlockCipher* Lion::clone() const { - return new Lion(hash->clone(), cipher->clone(), BLOCK_SIZE); + return new Lion(hash->clone(), cipher->clone(), block_size()); } /* @@ -112,11 +112,11 @@ Lion::Lion(HashFunction* hash_in, StreamCipher* sc_in, size_t block_len) : BlockCipher(std::max<size_t>(2*hash_in->output_length() + 1, block_len), 2, 2*hash_in->output_length(), 2), LEFT_SIZE(hash_in->output_length()), - RIGHT_SIZE(BLOCK_SIZE - LEFT_SIZE), + RIGHT_SIZE(block_size() - LEFT_SIZE), hash(hash_in), cipher(sc_in) { - if(2*LEFT_SIZE + 1 > BLOCK_SIZE) + if(2*LEFT_SIZE + 1 > block_size()) throw Invalid_Argument(name() + ": Chosen block size is too small"); if(!cipher->valid_keylength(LEFT_SIZE)) |