VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Crypto.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-11-28 00:29:36 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-12-07 12:36:04 +0100
commit263abeee3a8c97e98fec49ee0ce628d6c5c5df50 (patch)
treec6a326a7c90280cb3926c58275f361b999bd2ba3 /src/Common/Crypto.c
parent68fababbe88cf213b3f2f3a71d66c2b05196aaed (diff)
downloadVeraCrypt-263abeee3a8c97e98fec49ee0ce628d6c5c5df50.tar.gz
VeraCrypt-263abeee3a8c97e98fec49ee0ce628d6c5c5df50.zip
Crypto: Add optimized Twofish assembly implementation for x86_64.
Diffstat (limited to 'src/Common/Crypto.c')
-rw-r--r--src/Common/Crypto.c13
1 files changed, 13 insertions, 0 deletions
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
@@ -247,6 +247,11 @@ void EncipherBlocks (int cipher, void *dataPtr, void *ks, size_t blockCount)
#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);
}
@@ -342,6 +347,11 @@ void DecipherBlocks (int cipher, void *dataPtr, void *ks, size_t blockCount)
#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);
}
@@ -418,6 +428,9 @@ BOOL CipherSupportsIntraDataUnitParallelization (int cipher)
#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE && !defined (_UEFI)
|| (cipher == SERPENT && HasSSE2())
#endif
+#if CRYPTOPP_BOOL_X64
+ || (cipher == TWOFISH)
+#endif
;
}