From 263abeee3a8c97e98fec49ee0ce628d6c5c5df50 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 28 Nov 2016 00:29:36 +0100 Subject: Crypto: Add optimized Twofish assembly implementation for x86_64. --- src/Common/Crypto.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/Common/Crypto.c') diff --git a/src/Common/Crypto.c b/src/Common/Crypto.c index f0b3759a..808c8af7 100644 --- a/src/Common/Crypto.c +++ b/src/Common/Crypto.c @@ -246,6 +246,11 @@ void EncipherBlocks (int cipher, void *dataPtr, void *ks, size_t blockCount) KeRestoreFloatingPointState (&floatingPointState); #endif } +#endif +#if CRYPTOPP_BOOL_X64 + else if (cipher == TWOFISH) { + twofish_encrypt_blocks(ks, data, data, (uint32) blockCount); + } #endif else if (cipher == GOST89) { gost_encrypt(data, data, ks, (int)blockCount); @@ -341,6 +346,11 @@ void DecipherBlocks (int cipher, void *dataPtr, void *ks, size_t blockCount) KeRestoreFloatingPointState (&floatingPointState); #endif } +#endif +#if CRYPTOPP_BOOL_X64 + else if (cipher == TWOFISH) { + twofish_decrypt_blocks(ks, data, data, (uint32) blockCount); + } #endif else if (cipher == GOST89) { gost_decrypt(data, data, ks, (int)blockCount); @@ -417,6 +427,9 @@ BOOL CipherSupportsIntraDataUnitParallelization (int cipher) || (cipher == GOST89) #if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE && !defined (_UEFI) || (cipher == SERPENT && HasSSE2()) +#endif +#if CRYPTOPP_BOOL_X64 + || (cipher == TWOFISH) #endif ; } -- cgit v1.2.3