diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2016-12-19 17:46:38 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2016-12-26 00:00:05 +0100 |
commit | 5493de11d57159b8c048b33a71d9783b405cf2e8 (patch) | |
tree | 34d7a1abb852bc5b7593be22a1620de955061026 /src/Crypto/Twofish.c | |
parent | 1ef6177ae3605b4aa24beb6d9a0da214c15e100e (diff) | |
download | VeraCrypt-5493de11d57159b8c048b33a71d9783b405cf2e8.tar.gz VeraCrypt-5493de11d57159b8c048b33a71d9783b405cf2e8.zip |
Windows: Enable Twofish optimized 64-bit assembly for UEFI bootloader since a pre-compiled object file was included to its build system.
Diffstat (limited to 'src/Crypto/Twofish.c')
-rw-r--r-- | src/Crypto/Twofish.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Crypto/Twofish.c b/src/Crypto/Twofish.c index 23a5dfda..8ab59081 100644 --- a/src/Crypto/Twofish.c +++ b/src/Crypto/Twofish.c | |||
@@ -54,7 +54,7 @@ | |||
54 | #define UNROLL_TWOFISH | 54 | #define UNROLL_TWOFISH |
55 | #endif | 55 | #endif |
56 | 56 | ||
57 | #if CRYPTOPP_BOOL_X64 && !defined(_UEFI) | 57 | #if CRYPTOPP_BOOL_X64 |
58 | 58 | ||
59 | /* these are 64-bit assembly implementation taken from https://github.com/jkivilin/supercop-blockciphers | 59 | /* these are 64-bit assembly implementation taken from https://github.com/jkivilin/supercop-blockciphers |
60 | Copyright © 2011-2013 Jussi Kivilinna <jussi.kivilinna@iki.fi> | 60 | Copyright © 2011-2013 Jussi Kivilinna <jussi.kivilinna@iki.fi> |
@@ -630,7 +630,7 @@ void twofish_set_key(TwofishInstance *instance, const u4byte in_key[]) | |||
630 | uint32 b = rotl32(MDSQ[0][Q[0][Q[0][Q[1][Q[1][i + 1] ^ key[28]] ^ key[20]] ^ key[12]] ^ key[4]] ^ MDSQ[1][Q[0][Q[1][Q[1][Q[0][i + 1] ^ key[29]] ^ key[21]] ^ key[13]] ^ key[5]] | 630 | uint32 b = rotl32(MDSQ[0][Q[0][Q[0][Q[1][Q[1][i + 1] ^ key[28]] ^ key[20]] ^ key[12]] ^ key[4]] ^ MDSQ[1][Q[0][Q[1][Q[1][Q[0][i + 1] ^ key[29]] ^ key[21]] ^ key[13]] ^ key[5]] |
631 | ^ MDSQ[2][Q[1][Q[0][Q[0][Q[0][i + 1] ^ key[30]] ^ key[22]] ^ key[14]] ^ key[6]] ^ MDSQ[3][Q[1][Q[1][Q[0][Q[1][i + 1] ^ key[31]] ^ key[23]] ^ key[15]] ^ key[7]], 8); | 631 | ^ MDSQ[2][Q[1][Q[0][Q[0][Q[0][i + 1] ^ key[30]] ^ key[22]] ^ key[14]] ^ key[6]] ^ MDSQ[3][Q[1][Q[1][Q[0][Q[1][i + 1] ^ key[31]] ^ key[23]] ^ key[15]] ^ key[7]], 8); |
632 | a += b; | 632 | a += b; |
633 | #if CRYPTOPP_BOOL_X64 && !defined(_UEFI) | 633 | #if CRYPTOPP_BOOL_X64 |
634 | if (i < 8) | 634 | if (i < 8) |
635 | { | 635 | { |
636 | instance->w[i] = a; | 636 | instance->w[i] = a; |
@@ -998,7 +998,7 @@ void twofish_set_key(TwofishInstance *instance, const u4byte in_key[]) | |||
998 | 998 | ||
999 | #ifndef TC_MINIMIZE_CODE_SIZE | 999 | #ifndef TC_MINIMIZE_CODE_SIZE |
1000 | 1000 | ||
1001 | #if (CRYPTOPP_BOOL_X64 == 0) || defined(_UEFI) | 1001 | #if (CRYPTOPP_BOOL_X64 == 0) |
1002 | void twofish_encrypt(TwofishInstance *ks, const u4byte in_blk[4], u4byte out_blk[4]) | 1002 | void twofish_encrypt(TwofishInstance *ks, const u4byte in_blk[4], u4byte out_blk[4]) |
1003 | { | 1003 | { |
1004 | uint32* rk = ks->l_key; | 1004 | uint32* rk = ks->l_key; |
@@ -1071,7 +1071,7 @@ void twofish_encrypt(TwofishInstance *instance, const u4byte in_blk[4], u4byte o | |||
1071 | 1071 | ||
1072 | #ifndef TC_MINIMIZE_CODE_SIZE | 1072 | #ifndef TC_MINIMIZE_CODE_SIZE |
1073 | 1073 | ||
1074 | #if (CRYPTOPP_BOOL_X64 == 0) || defined(_UEFI) | 1074 | #if (CRYPTOPP_BOOL_X64 == 0) |
1075 | void twofish_decrypt(TwofishInstance *ks, const u4byte in_blk[4], u4byte out_blk[4]) | 1075 | void twofish_decrypt(TwofishInstance *ks, const u4byte in_blk[4], u4byte out_blk[4]) |
1076 | { | 1076 | { |
1077 | uint32* rk = ks->l_key; | 1077 | uint32* rk = ks->l_key; |