From 70097ecfe54a9630e1e77fdc30204a5460228193 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Tue, 20 Jun 2017 17:43:35 +0200 Subject: Crypto: Add optimized Camellia assembly implementation for x86_64 based on work by Jussi Kivilinna (https://github.com/jkivilin/supercop-blockciphers). This improve speed by a factor of 2.5 when AES-NI supported by CPU and by 30% if AES-NI not supported. --- src/Common/Crypto.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Common') diff --git a/src/Common/Crypto.c b/src/Common/Crypto.c index 6c2b2e84..803c3d0f 100644 --- a/src/Common/Crypto.c +++ b/src/Common/Crypto.c @@ -251,6 +251,9 @@ void EncipherBlocks (int cipher, void *dataPtr, void *ks, size_t blockCount) else if (cipher == TWOFISH) { twofish_encrypt_blocks(ks, data, data, (uint32) blockCount); } + else if (cipher == CAMELLIA) { + camellia_encrypt_blocks(ks, data, data, (uint32) blockCount); + } #endif else if (cipher == GOST89) { gost_encrypt(data, data, ks, (int)blockCount); @@ -351,6 +354,9 @@ void DecipherBlocks (int cipher, void *dataPtr, void *ks, size_t blockCount) else if (cipher == TWOFISH) { twofish_decrypt_blocks(ks, data, data, (uint32) blockCount); } + else if (cipher == CAMELLIA) { + camellia_decrypt_blocks(ks, data, data, (uint32) blockCount); + } #endif else if (cipher == GOST89) { gost_decrypt(data, data, ks, (int)blockCount); @@ -430,6 +436,7 @@ BOOL CipherSupportsIntraDataUnitParallelization (int cipher) #endif #if CRYPTOPP_BOOL_X64 || (cipher == TWOFISH) + || (cipher == CAMELLIA) #endif ; } -- cgit v1.2.3