diff options
Diffstat (limited to 'src/block')
-rw-r--r-- | src/block/aes_intel/aes_intel.h | 6 | ||||
-rw-r--r-- | src/block/block_cipher.h | 5 | ||||
-rw-r--r-- | src/block/idea_sse2/idea_sse2.h | 2 | ||||
-rw-r--r-- | src/block/noekeon_simd/noekeon_simd.h | 2 | ||||
-rw-r--r-- | src/block/serpent_simd/serp_simd.h | 2 | ||||
-rw-r--r-- | src/block/xtea_simd/xtea_simd.h | 2 |
6 files changed, 19 insertions, 0 deletions
diff --git a/src/block/aes_intel/aes_intel.h b/src/block/aes_intel/aes_intel.h index 164655072..239516e24 100644 --- a/src/block/aes_intel/aes_intel.h +++ b/src/block/aes_intel/aes_intel.h @@ -18,6 +18,8 @@ namespace Botan { class BOTAN_DLL AES_128_Intel : public BlockCipher { public: + u32bit parallelism() const { return 8; } + void encrypt_n(const byte in[], byte out[], u32bit blocks) const; void decrypt_n(const byte in[], byte out[], u32bit blocks) const; @@ -38,6 +40,8 @@ class BOTAN_DLL AES_128_Intel : public BlockCipher class BOTAN_DLL AES_192_Intel : public BlockCipher { public: + u32bit parallelism() const { return 8; } + void encrypt_n(const byte in[], byte out[], u32bit blocks) const; void decrypt_n(const byte in[], byte out[], u32bit blocks) const; @@ -58,6 +62,8 @@ class BOTAN_DLL AES_192_Intel : public BlockCipher class BOTAN_DLL AES_256_Intel : public BlockCipher { public: + u32bit parallelism() const { return 8; } + void encrypt_n(const byte in[], byte out[], u32bit blocks) const; void decrypt_n(const byte in[], byte out[], u32bit blocks) const; diff --git a/src/block/block_cipher.h b/src/block/block_cipher.h index 06e8c5cea..2d9198c58 100644 --- a/src/block/block_cipher.h +++ b/src/block/block_cipher.h @@ -24,6 +24,11 @@ class BOTAN_DLL BlockCipher : public SymmetricAlgorithm const u32bit BLOCK_SIZE; /** + * @return the preferred parallelism of this cipher + */ + virtual u32bit parallelism() const { return 4; } + + /** * Encrypt a block. * @param in The plaintext block to be encrypted as a byte array. * Must be of length BLOCK_SIZE. diff --git a/src/block/idea_sse2/idea_sse2.h b/src/block/idea_sse2/idea_sse2.h index 167c981f8..657581d74 100644 --- a/src/block/idea_sse2/idea_sse2.h +++ b/src/block/idea_sse2/idea_sse2.h @@ -18,6 +18,8 @@ namespace Botan { class BOTAN_DLL IDEA_SSE2 : public IDEA { public: + u32bit parallelism() const { return 16; } + void encrypt_n(const byte in[], byte out[], u32bit blocks) const; void decrypt_n(const byte in[], byte out[], u32bit blocks) const; diff --git a/src/block/noekeon_simd/noekeon_simd.h b/src/block/noekeon_simd/noekeon_simd.h index 466c4b741..55fdfbd22 100644 --- a/src/block/noekeon_simd/noekeon_simd.h +++ b/src/block/noekeon_simd/noekeon_simd.h @@ -18,6 +18,8 @@ namespace Botan { class BOTAN_DLL Noekeon_SIMD : public Noekeon { public: + u32bit parallelism() const { return 8; } + void encrypt_n(const byte in[], byte out[], u32bit blocks) const; void decrypt_n(const byte in[], byte out[], u32bit blocks) const; diff --git a/src/block/serpent_simd/serp_simd.h b/src/block/serpent_simd/serp_simd.h index 1ecb70159..dc2b08736 100644 --- a/src/block/serpent_simd/serp_simd.h +++ b/src/block/serpent_simd/serp_simd.h @@ -18,6 +18,8 @@ namespace Botan { class BOTAN_DLL Serpent_SIMD : public Serpent { public: + u32bit parallelism() const { return 8; } + void encrypt_n(const byte in[], byte out[], u32bit blocks) const; void decrypt_n(const byte in[], byte out[], u32bit blocks) const; diff --git a/src/block/xtea_simd/xtea_simd.h b/src/block/xtea_simd/xtea_simd.h index e4ce734ed..04a4977ae 100644 --- a/src/block/xtea_simd/xtea_simd.h +++ b/src/block/xtea_simd/xtea_simd.h @@ -18,6 +18,8 @@ namespace Botan { class BOTAN_DLL XTEA_SIMD : public XTEA { public: + u32bit parallelism() const { return 16; } + void encrypt_n(const byte in[], byte out[], u32bit blocks) const; void decrypt_n(const byte in[], byte out[], u32bit blocks) const; BlockCipher* clone() const { return new XTEA_SIMD; } |