From 432bcf59badb8f6271146772ccbc1649822c25cb Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 25 May 2010 14:44:27 +0000 Subject: Change BlockCipher::parallelism() to return the native parallelism of the implementation rather than the preferred one. Update all implementations. Add a new function parallel_bytes() which returns parallelism() * BLOCK_SIZE * BUILD_TIME_CONSTANT This is because i noticed all current calls of parallelism() just multiplied the result by the block size already, so this simplified that code. The build time constant is set to 4, which was the previous default return value of parallelism(). However the SIMD versions returned 2*native paralellism rather than 4*, so this increases the buffer sizes used for those algorithms. The constant multiple lives in buildh.in and build.h, and is named BOTAN_BLOCK_CIPHER_PAR_MULT. --- src/block/noekeon_simd/noekeon_simd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/block/noekeon_simd') diff --git a/src/block/noekeon_simd/noekeon_simd.h b/src/block/noekeon_simd/noekeon_simd.h index 55fdfbd22..aba1e3d65 100644 --- a/src/block/noekeon_simd/noekeon_simd.h +++ b/src/block/noekeon_simd/noekeon_simd.h @@ -18,7 +18,7 @@ namespace Botan { class BOTAN_DLL Noekeon_SIMD : public Noekeon { public: - u32bit parallelism() const { return 8; } + u32bit parallelism() const { return 4; } void encrypt_n(const byte in[], byte out[], u32bit blocks) const; void decrypt_n(const byte in[], byte out[], u32bit blocks) const; -- cgit v1.2.3