diff options
author | lloyd <[email protected]> | 2009-10-14 22:35:03 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-10-14 22:35:03 +0000 |
commit | 09a17201a8132f8422a4c371cf1e56553317bc66 (patch) | |
tree | 912dff1d664d10a473554d6517ba44c8e980545e /src/block/lion/lion.cpp | |
parent | 28f875732c6379531e28c12091c44031941e0dff (diff) |
Cleanups/random changes in the stream cipher code:
Remove encrypt, decrypt - replace by cipher() and cipher1()
Remove seek() - not well supported/tested, I want to redo with a new interface
once CTR and OFB modes become stream ciphers.
Rename resync to set_iv()
Remove StreamCipher::IV_LENGTH and add StreamCipher::valid_iv_length() to
allow multiple IV lengths (as for instance Turing allows, as would Salsa20
if XSalsa20 were supported).
Diffstat (limited to 'src/block/lion/lion.cpp')
-rw-r--r-- | src/block/lion/lion.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/block/lion/lion.cpp b/src/block/lion/lion.cpp index 83c1e3aa3..0ed7b2630 100644 --- a/src/block/lion/lion.cpp +++ b/src/block/lion/lion.cpp @@ -22,7 +22,7 @@ void Lion::encrypt_n(const byte in[], byte out[], u32bit blocks) const { xor_buf(buffer, in, key1, LEFT_SIZE); cipher->set_key(buffer, LEFT_SIZE); - cipher->encrypt(in + LEFT_SIZE, out + LEFT_SIZE, RIGHT_SIZE); + cipher->cipher(in + LEFT_SIZE, out + LEFT_SIZE, RIGHT_SIZE); hash->update(out + LEFT_SIZE, RIGHT_SIZE); hash->final(buffer); @@ -30,7 +30,7 @@ void Lion::encrypt_n(const byte in[], byte out[], u32bit blocks) const xor_buf(buffer, out, key2, LEFT_SIZE); cipher->set_key(buffer, LEFT_SIZE); - cipher->encrypt(out + LEFT_SIZE, RIGHT_SIZE); + cipher->cipher1(out + LEFT_SIZE, RIGHT_SIZE); in += BLOCK_SIZE; out += BLOCK_SIZE; @@ -48,7 +48,7 @@ void Lion::decrypt_n(const byte in[], byte out[], u32bit blocks) const { xor_buf(buffer, in, key2, LEFT_SIZE); cipher->set_key(buffer, LEFT_SIZE); - cipher->encrypt(in + LEFT_SIZE, out + LEFT_SIZE, RIGHT_SIZE); + cipher->cipher(in + LEFT_SIZE, out + LEFT_SIZE, RIGHT_SIZE); hash->update(out + LEFT_SIZE, RIGHT_SIZE); hash->final(buffer); @@ -56,7 +56,7 @@ void Lion::decrypt_n(const byte in[], byte out[], u32bit blocks) const xor_buf(buffer, out, key1, LEFT_SIZE); cipher->set_key(buffer, LEFT_SIZE); - cipher->encrypt(out + LEFT_SIZE, RIGHT_SIZE); + cipher->cipher1(out + LEFT_SIZE, RIGHT_SIZE); in += BLOCK_SIZE; out += BLOCK_SIZE; |