1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 02:58:02 -06:00

Crypto: Add optimized Twofish assembly implementation for x86_64.

This commit is contained in:
Mounir IDRASSI
2016-11-28 00:29:36 +01:00
parent 68fababbe8
commit 263abeee3a
13 changed files with 1049 additions and 421 deletions

View File

@@ -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
;
}