diff options
author | lloyd <[email protected]> | 2009-09-17 18:18:15 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-09-17 18:18:15 +0000 |
commit | b086b54c16383da44eebfa8f14d55e6e50dc87b8 (patch) | |
tree | 5ff5b7fb36a12904ddbaeda4cb4c2c59e78e2b28 /src/block/serpent_ia32/serp_ia32.cpp | |
parent | 87e25c7e270a52fda8c39296be01918bb6aa75d6 (diff) | |
parent | 7e839d037119055b572f40ce0cd882f85583db2e (diff) |
propagate from branch 'net.randombit.botan.1_8' (head 1f4729658b70a340064bc9a33c923a44ecab84d8)
to branch 'net.randombit.botan' (head b9ca6596a127964cb9795d22bc2a5642fab5de84)
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; + } } /* |