mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-10 13:13:34 +01:00
Windows: Don't use Twofish x64 assembly implementation for UEFI bootloader (for now, yasm is not integrated in EDKII framework).
This commit is contained in:
parent
fb38269c89
commit
a0eadbd660
@ -247,7 +247,7 @@ void EncipherBlocks (int cipher, void *dataPtr, void *ks, size_t blockCount)
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#if CRYPTOPP_BOOL_X64
|
||||
#if CRYPTOPP_BOOL_X64 && !defined(_UEFI)
|
||||
else if (cipher == TWOFISH) {
|
||||
twofish_encrypt_blocks(ks, data, data, (uint32) blockCount);
|
||||
}
|
||||
@ -347,7 +347,7 @@ void DecipherBlocks (int cipher, void *dataPtr, void *ks, size_t blockCount)
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#if CRYPTOPP_BOOL_X64
|
||||
#if CRYPTOPP_BOOL_X64 && !defined(_UEFI)
|
||||
else if (cipher == TWOFISH) {
|
||||
twofish_decrypt_blocks(ks, data, data, (uint32) blockCount);
|
||||
}
|
||||
@ -428,7 +428,7 @@ BOOL CipherSupportsIntraDataUnitParallelization (int cipher)
|
||||
#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE && !defined (_UEFI)
|
||||
|| (cipher == SERPENT && HasSSE2())
|
||||
#endif
|
||||
#if CRYPTOPP_BOOL_X64
|
||||
#if CRYPTOPP_BOOL_X64 && !defined(_UEFI)
|
||||
|| (cipher == TWOFISH)
|
||||
#endif
|
||||
;
|
||||
|
@ -50,11 +50,11 @@
|
||||
Botan is released under the Simplified BSD License (see license.txt)
|
||||
*/
|
||||
|
||||
#if !defined (_MSC_VER) || defined(_WIN64)
|
||||
#if !defined (_MSC_VER) || defined(_M_X64)
|
||||
#define UNROLL_TWOFISH
|
||||
#endif
|
||||
|
||||
#if CRYPTOPP_BOOL_X64
|
||||
#if CRYPTOPP_BOOL_X64 && !defined(_UEFI)
|
||||
|
||||
/* these are 64-bit assembly implementation taken from https://github.com/jkivilin/supercop-blockciphers
|
||||
Copyright © 2011-2013 Jussi Kivilinna <jussi.kivilinna@iki.fi>
|
||||
@ -630,7 +630,7 @@ void twofish_set_key(TwofishInstance *instance, const u4byte in_key[])
|
||||
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]]
|
||||
^ 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);
|
||||
a += b;
|
||||
#if CRYPTOPP_BOOL_X64
|
||||
#if CRYPTOPP_BOOL_X64 && !defined(_UEFI)
|
||||
if (i < 8)
|
||||
{
|
||||
instance->w[i] = a;
|
||||
@ -998,7 +998,7 @@ void twofish_set_key(TwofishInstance *instance, const u4byte in_key[])
|
||||
|
||||
#ifndef TC_MINIMIZE_CODE_SIZE
|
||||
|
||||
#if CRYPTOPP_BOOL_X64 == 0
|
||||
#if (CRYPTOPP_BOOL_X64 == 0) || defined(_UEFI)
|
||||
void twofish_encrypt(TwofishInstance *ks, const u4byte in_blk[4], u4byte out_blk[4])
|
||||
{
|
||||
uint32* rk = ks->l_key;
|
||||
@ -1071,7 +1071,7 @@ void twofish_encrypt(TwofishInstance *instance, const u4byte in_blk[4], u4byte o
|
||||
|
||||
#ifndef TC_MINIMIZE_CODE_SIZE
|
||||
|
||||
#if CRYPTOPP_BOOL_X64 == 0
|
||||
#if (CRYPTOPP_BOOL_X64 == 0) || defined(_UEFI)
|
||||
void twofish_decrypt(TwofishInstance *ks, const u4byte in_blk[4], u4byte out_blk[4])
|
||||
{
|
||||
uint32* rk = ks->l_key;
|
||||
|
@ -35,7 +35,7 @@ extern "C"
|
||||
#endif
|
||||
typedef struct
|
||||
{
|
||||
#if CRYPTOPP_BOOL_X64
|
||||
#if CRYPTOPP_BOOL_X64 && !defined(_UEFI)
|
||||
u4byte mk_tab[4][256], w[8], k[32];
|
||||
#else
|
||||
u4byte l_key[40];
|
||||
@ -52,7 +52,7 @@ typedef struct
|
||||
|
||||
/* in_key must be 32-bytes long */
|
||||
void twofish_set_key(TwofishInstance *instance, const u4byte in_key[]);
|
||||
#if CRYPTOPP_BOOL_X64
|
||||
#if CRYPTOPP_BOOL_X64 && !defined(_UEFI)
|
||||
void twofish_encrypt_blocks(TwofishInstance *instance, const byte* in_blk, byte* out_blk, uint32 blockCount);
|
||||
void twofish_decrypt_blocks(TwofishInstance *instance, const byte* in_blk, byte* out_blk, uint32 blockCount);
|
||||
#define twofish_encrypt(instance,in_blk,out_blk) twofish_encrypt_blocks(instance, (const byte*) in_blk, (byte*) out_blk, 1)
|
||||
|
Loading…
Reference in New Issue
Block a user