VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Crypto.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2017-06-20 17:43:35 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2017-06-21 01:39:55 +0200
commit70097ecfe54a9630e1e77fdc30204a5460228193 (patch)
treef43481a6ede0e0fcd81f8ba02006613d02d23032 /src/Common/Crypto.c
parentee5c1784ea0ed1328f7607bf3ea619ef3bd96d03 (diff)
downloadVeraCrypt-70097ecfe54a9630e1e77fdc30204a5460228193.tar.gz
VeraCrypt-70097ecfe54a9630e1e77fdc30204a5460228193.zip
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.
Diffstat (limited to 'src/Common/Crypto.c')
-rw-r--r--src/Common/Crypto.c7
1 files changed, 7 insertions, 0 deletions
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
;
}