diff options
author | lloyd <[email protected]> | 2009-09-15 12:39:44 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-09-15 12:39:44 +0000 |
commit | 467cfb8b8a31eecfaf63c30cfa13b69bef4cd566 (patch) | |
tree | aa6314c8afa6d2c5e0759a57fc52c91a36f43af1 /src/block/serpent_ia32/serp_ia32.cpp | |
parent | 63fb872cb36a44a852ec33133de7c242bd44427e (diff) | |
parent | 18d1a6d4d11d40afb2d5a9d96b0437933bcaa472 (diff) |
propagate from branch 'net.randombit.botan.1_8' (head ef51dd2869ed38dae3aeb1c3b931ca9d595580e1)
to branch 'net.randombit.botan' (head fc1942640045423f411fd865cbd584090b28d7eb)
Diffstat (limited to 'src/block/serpent_ia32/serp_ia32.cpp')
-rw-r--r-- | src/block/serpent_ia32/serp_ia32.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/block/serpent_ia32/serp_ia32.cpp b/src/block/serpent_ia32/serp_ia32.cpp index 37dd4e637..997bec2fc 100644 --- a/src/block/serpent_ia32/serp_ia32.cpp +++ b/src/block/serpent_ia32/serp_ia32.cpp @@ -21,17 +21,27 @@ void botan_serpent_ia32_key_schedule(u32bit[140]); /* * Serpent Encryption */ -void Serpent_IA32::enc(const byte in[], byte out[]) const +void Serpent_IA32::encrypt_n(const byte in[], byte out[], u32bit blocks) const { - botan_serpent_ia32_encrypt(in, out, round_key); + for(u32bit i = 0; i != blocks; ++i) + { + botan_serpent_ia32_encrypt(in, out, round_key); + in += BLOCK_SIZE; + out += BLOCK_SIZE; + } } /* * Serpent Decryption */ -void Serpent_IA32::dec(const byte in[], byte out[]) const +void Serpent_IA32::decrypt_n(const byte in[], byte out[], u32bit blocks) const { - botan_serpent_ia32_decrypt(in, out, round_key); + for(u32bit i = 0; i != blocks; ++i) + { + botan_serpent_ia32_decrypt(in, out, round_key); + in += BLOCK_SIZE; + out += BLOCK_SIZE; + } } /* |