mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-12 03:18:26 -06:00
Remove SM4 support!
This commit is contained in:
@@ -69,7 +69,6 @@ static Cipher Ciphers[] =
|
||||
{ TWOFISH, L"Twofish", 16, 32, TWOFISH_KS },
|
||||
{ CAMELLIA, L"Camellia", 16, 32, CAMELLIA_KS },
|
||||
{ KUZNYECHIK, L"Kuznyechik",16, 32, KUZNYECHIK_KS },
|
||||
{ SM4, L"SM4", 16, 16, SM4_KS },
|
||||
#endif
|
||||
#endif
|
||||
{ 0, 0, 0, 0, 0 }
|
||||
@@ -90,7 +89,6 @@ static EncryptionAlgorithm EncryptionAlgorithms[] =
|
||||
{ { TWOFISH, 0 }, { XTS, 0 }, 1, 1 },
|
||||
{ { CAMELLIA, 0 }, { XTS, 0 }, 1, 1 },
|
||||
{ { KUZNYECHIK, 0 }, { XTS, 0 }, 0, 1 },
|
||||
{ { SM4, 0 }, { XTS, 0 }, 0, 1 },
|
||||
{ { TWOFISH, AES, 0 }, { XTS, 0 }, 1, 1 },
|
||||
{ { SERPENT, TWOFISH, AES, 0 }, { XTS, 0 }, 1, 1 },
|
||||
{ { AES, SERPENT, 0 }, { XTS, 0 }, 1, 1 },
|
||||
@@ -98,13 +96,9 @@ static EncryptionAlgorithm EncryptionAlgorithms[] =
|
||||
{ { SERPENT, TWOFISH, 0 }, { XTS, 0 }, 1, 1 },
|
||||
{ { KUZNYECHIK, CAMELLIA, 0 }, { XTS, 0 }, 0, 1 },
|
||||
{ { TWOFISH, KUZNYECHIK, 0 }, { XTS, 0 }, 0, 1 },
|
||||
{ { KUZNYECHIK, SM4, 0 }, { XTS, 0 }, 0, 1 },
|
||||
{ { SERPENT, SM4, 0 }, { XTS, 0 }, 0, 1 },
|
||||
{ { TWOFISH, SM4, 0 }, { XTS, 0 }, 0, 1 },
|
||||
{ { SERPENT, CAMELLIA, 0 }, { XTS, 0 }, 0, 1 },
|
||||
{ { AES, KUZNYECHIK, 0 }, { XTS, 0 }, 0, 1 },
|
||||
{ { CAMELLIA, SERPENT, KUZNYECHIK, 0 }, { XTS, 0 }, 0, 1 },
|
||||
{ { SERPENT, TWOFISH, SM4, 0 }, { XTS, 0 }, 0, 1 },
|
||||
#endif
|
||||
{ { 0, 0 }, { 0, 0}, 0, 0 } // Must be all-zero
|
||||
|
||||
@@ -183,9 +177,6 @@ int CipherInit (int cipher, unsigned char *key, unsigned __int8 *ks)
|
||||
case KUZNYECHIK:
|
||||
kuznyechik_set_key(key, (kuznyechik_kds*)ks);
|
||||
break;
|
||||
case SM4:
|
||||
sm4_set_key(key, (sm4_kds*)ks);
|
||||
break;
|
||||
#endif // !defined(TC_WINDOWS_BOOT)
|
||||
|
||||
#endif
|
||||
@@ -218,7 +209,6 @@ void EncipherBlock(int cipher, void *data, void *ks)
|
||||
#endif
|
||||
#if !defined(TC_WINDOWS_BOOT)
|
||||
case KUZNYECHIK: kuznyechik_encrypt_block(data, data, ks); break;
|
||||
case SM4: sm4_encrypt_block(data, data, ks); break;
|
||||
#endif // !defined(TC_WINDOWS_BOOT)
|
||||
#endif
|
||||
default: TC_THROW_FATAL_EXCEPTION; // Unknown/wrong ID
|
||||
@@ -270,12 +260,6 @@ void EncipherBlocks (int cipher, void *dataPtr, void *ks, size_t blockCount)
|
||||
{
|
||||
kuznyechik_encrypt_blocks (data, data, blockCount, ks);
|
||||
}
|
||||
else if (cipher == SM4
|
||||
&& HasSSE41() && HasAESNI()
|
||||
)
|
||||
{
|
||||
sm4_encrypt_blocks(data, data, blockCount, ks);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
else
|
||||
@@ -303,7 +287,6 @@ void DecipherBlock(int cipher, void *data, void *ks)
|
||||
#endif
|
||||
#if !defined(TC_WINDOWS_BOOT)
|
||||
case KUZNYECHIK: kuznyechik_decrypt_block(data, data, ks); break;
|
||||
case SM4: sm4_decrypt_block(data, data, ks); break;
|
||||
#endif // !defined(TC_WINDOWS_BOOT)
|
||||
#endif
|
||||
|
||||
@@ -369,12 +352,6 @@ void DecipherBlocks (int cipher, void *dataPtr, void *ks, size_t blockCount)
|
||||
{
|
||||
kuznyechik_decrypt_blocks (data, data, blockCount, ks);
|
||||
}
|
||||
else if (cipher == SM4
|
||||
&& HasSSE41() && HasAESNI()
|
||||
)
|
||||
{
|
||||
sm4_decrypt_blocks(data, data, blockCount, ks);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
else
|
||||
@@ -445,7 +422,6 @@ BOOL CipherSupportsIntraDataUnitParallelization (int cipher)
|
||||
#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE && !defined (_UEFI)
|
||||
|| (cipher == SERPENT && HasSSE2())
|
||||
|| (cipher == KUZNYECHIK && HasSSE2())
|
||||
|| (cipher == SM4 && HasSSE41() && HasAESNI())
|
||||
#endif
|
||||
#if CRYPTOPP_BOOL_X64 && !defined(CRYPTOPP_DISABLE_ASM)
|
||||
|| (cipher == TWOFISH)
|
||||
|
||||
@@ -112,8 +112,7 @@ enum
|
||||
SERPENT,
|
||||
TWOFISH,
|
||||
CAMELLIA,
|
||||
KUZNYECHIK,
|
||||
SM4
|
||||
KUZNYECHIK
|
||||
};
|
||||
|
||||
typedef struct
|
||||
@@ -173,7 +172,7 @@ typedef struct
|
||||
#ifdef TC_WINDOWS_BOOT
|
||||
#define MAX_EXPANDED_KEY VC_MAX((AES_KS + SERPENT_KS + TWOFISH_KS), CAMELLIA_KS)
|
||||
#else
|
||||
#define MAX_EXPANDED_KEY VC_MAX(VC_MAX(VC_MAX(VC_MAX(VC_MAX((AES_KS + SERPENT_KS + TWOFISH_KS), CAMELLIA_KS + KUZNYECHIK_KS + SERPENT_KS), KUZNYECHIK_KS + TWOFISH_KS), AES_KS + KUZNYECHIK_KS), SM4_KS + SERPENT_KS + TWOFISH_KS), SM4_KS + KUZNYECHIK_KS)
|
||||
#define MAX_EXPANDED_KEY VC_MAX(VC_MAX(VC_MAX((AES_KS + SERPENT_KS + TWOFISH_KS), CAMELLIA_KS + KUZNYECHIK_KS + SERPENT_KS), KUZNYECHIK_KS + TWOFISH_KS), AES_KS + KUZNYECHIK_KS)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -207,7 +206,6 @@ typedef struct
|
||||
# include "Streebog.h"
|
||||
# include "kuznyechik.h"
|
||||
# include "Camellia.h"
|
||||
# include "sm4.h"
|
||||
#if !defined (_UEFI)
|
||||
# include "chachaRng.h"
|
||||
# include "t1ha.h"
|
||||
|
||||
@@ -7812,23 +7812,13 @@ ResetCipherTest(HWND hwndDlg, int idTestCipher)
|
||||
SetWindowText(GetDlgItem(hwndDlg, IDC_CIPHERTEXT), L"0000000000000000");
|
||||
|
||||
if (idTestCipher == AES || idTestCipher == SERPENT || idTestCipher == TWOFISH || idTestCipher == CAMELLIA
|
||||
|| idTestCipher == KUZNYECHIK || idTestCipher == SM4
|
||||
|| idTestCipher == KUZNYECHIK
|
||||
)
|
||||
{
|
||||
if (idTestCipher == SM4) // SM4 key size is 128 bits
|
||||
{
|
||||
ndx = (int) SendMessage (GetDlgItem(hwndDlg, IDC_KEY_SIZE), CB_ADDSTRING, 0,(LPARAM) L"128");
|
||||
SendMessage(GetDlgItem(hwndDlg, IDC_KEY_SIZE), CB_SETITEMDATA, ndx, (LPARAM)16);
|
||||
SetWindowText(GetDlgItem(hwndDlg, IDC_KEY), L"00000000000000000000000000000000");
|
||||
SetWindowText(GetDlgItem(hwndDlg, IDC_SECONDARY_KEY), L"00000000000000000000000000000000");
|
||||
}
|
||||
else
|
||||
{
|
||||
ndx = (int)SendMessage(GetDlgItem(hwndDlg, IDC_KEY_SIZE), CB_ADDSTRING, 0, (LPARAM)L"256");
|
||||
SendMessage(GetDlgItem(hwndDlg, IDC_KEY_SIZE), CB_SETITEMDATA, ndx, (LPARAM)32);
|
||||
SetWindowText(GetDlgItem(hwndDlg, IDC_KEY), L"0000000000000000000000000000000000000000000000000000000000000000");
|
||||
SetWindowText(GetDlgItem(hwndDlg, IDC_SECONDARY_KEY), L"0000000000000000000000000000000000000000000000000000000000000000");
|
||||
}
|
||||
ndx = (int)SendMessage(GetDlgItem(hwndDlg, IDC_KEY_SIZE), CB_ADDSTRING, 0, (LPARAM)L"256");
|
||||
SendMessage(GetDlgItem(hwndDlg, IDC_KEY_SIZE), CB_SETITEMDATA, ndx, (LPARAM)32);
|
||||
SetWindowText(GetDlgItem(hwndDlg, IDC_KEY), L"0000000000000000000000000000000000000000000000000000000000000000");
|
||||
SetWindowText(GetDlgItem(hwndDlg, IDC_SECONDARY_KEY), L"0000000000000000000000000000000000000000000000000000000000000000");
|
||||
SendMessage(GetDlgItem(hwndDlg, IDC_KEY_SIZE), CB_SETCURSEL, ndx,0);
|
||||
|
||||
SendMessage (GetDlgItem(hwndDlg, IDC_PLAINTEXT_SIZE), CB_RESETCONTENT, 0,0);
|
||||
@@ -11351,10 +11341,6 @@ void Applink (const char *dest)
|
||||
{
|
||||
StringCbCopyW (page, sizeof (page),L"Camellia.html");
|
||||
}
|
||||
else if (strcmp(dest, "sm4") == 0)
|
||||
{
|
||||
StringCbCopyW (page, sizeof (page),L"SM4.html");
|
||||
}
|
||||
else if (strcmp(dest, "cascades") == 0)
|
||||
{
|
||||
StringCbCopyW (page, sizeof (page),L"Cascades.html");
|
||||
|
||||
@@ -1644,7 +1644,6 @@
|
||||
<entry lang="en" key="MOUNTPOINT_BLOCKED">ERROR: The volume mount point is blocked because it overrides a protected system directory.\n\nPlease choose a different mount point.</entry>
|
||||
<entry lang="en" key="MOUNTPOINT_NOTALLOWED">ERROR: The volume mount point is not allowed because it overrides a directory that is part of the PATH environment variable.\n\nPlease choose a different mount point.</entry>
|
||||
<entry lang="en" key="INSECURE_MODE">[INSECURE MODE]</entry>
|
||||
<entry lang="en" key="SM4_HELP">SM4 is a block cipher standard published by the Chinese National Cryptography Administration in 2006 as part of the GB/T 32907-2016 standard. 128-bit key, 128-bit block. Mode of operation is XTS. It is widely used in Chinese national standards and commercial applications.</entry>
|
||||
</localization>
|
||||
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="VeraCrypt">
|
||||
|
||||
@@ -422,78 +422,6 @@ KUZNYECHIK_TEST kuznyechik_vectors[KUZNYECHIK_TEST_COUNT] = {
|
||||
}
|
||||
};
|
||||
|
||||
// SM4 ECB test vectors
|
||||
#define SM4_TEST_COUNT 11
|
||||
|
||||
typedef struct {
|
||||
unsigned char key[16];
|
||||
unsigned char plaintext[16];
|
||||
unsigned char ciphertext[16];
|
||||
} SM4_TEST;
|
||||
|
||||
// Based on test vector fron cppcrypto (cppcrypto/testvectors/block_cipher/sm4.txt)
|
||||
SM4_TEST sm4_vectors[SM4_TEST_COUNT] = {
|
||||
{
|
||||
// KEY 0
|
||||
{ 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef,0xfe,0xdc,0xba,0x98,0x76,0x54,0x32,0x10 },
|
||||
{ 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef,0xfe,0xdc,0xba,0x98,0x76,0x54,0x32,0x10 },
|
||||
{ 0x68,0x1e,0xdf,0x34,0xd2,0x06,0x96,0x5e,0x86,0xb3,0xe9,0x4f,0x53,0x6e,0x42,0x46 }
|
||||
},
|
||||
{
|
||||
// KEY 1
|
||||
{ 0x68,0x1e,0xdf,0x34,0xd2,0x06,0x96,0x5e,0x86,0xb3,0xe9,0x4f,0x53,0x6e,0x42,0x46 },
|
||||
{ 0xf4,0x21,0x31,0xb0,0x02,0x42,0x5b,0x6f,0x5c,0xf5,0x2a,0x81,0x06,0x82,0xa0,0x9d },
|
||||
{ 0xec,0x4b,0x7b,0x17,0x57,0xfe,0xe9,0xce,0x45,0x51,0x97,0xe5,0xbf,0x9c,0x3a,0x90 }
|
||||
},
|
||||
{
|
||||
// After KEY 1, PT/CT pairs
|
||||
{ 0x68,0x1e,0xdf,0x34,0xd2,0x06,0x96,0x5e,0x86,0xb3,0xe9,0x4f,0x53,0x6e,0x42,0x46 },
|
||||
{ 0x07,0xbc,0xae,0x6a,0x83,0x88,0xe1,0x46,0x51,0xfe,0xd8,0x4b,0x37,0x49,0xd3,0x86 },
|
||||
{ 0x89,0xf2,0xc4,0x1e,0xd9,0x7d,0xbb,0x1b,0x74,0xa2,0xad,0x93,0xb9,0x03,0xbb,0xc9 }
|
||||
},
|
||||
{
|
||||
{ 0x68,0x1e,0xdf,0x34,0xd2,0x06,0x96,0x5e,0x86,0xb3,0xe9,0x4f,0x53,0x6e,0x42,0x46 },
|
||||
{ 0xf4,0x76,0x26,0x15,0xb3,0x2c,0x00,0x0a,0x16,0x5e,0x1d,0x72,0x2d,0x70,0x80,0x52 },
|
||||
{ 0xf4,0x5a,0x41,0x05,0x2f,0x9b,0xf3,0xd5,0xb6,0x5d,0xf8,0xcc,0x1c,0x75,0xb4,0xcf }
|
||||
},
|
||||
{
|
||||
{ 0x68,0x1e,0xdf,0x34,0xd2,0x06,0x96,0x5e,0x86,0xb3,0xe9,0x4f,0x53,0x6e,0x42,0x46 },
|
||||
{ 0xba,0x3c,0x19,0xd8,0x92,0x63,0x56,0xed,0x14,0x91,0xc6,0xe4,0xe5,0x28,0x78,0x2f },
|
||||
{ 0x3e,0x1f,0x30,0xd5,0x7d,0xf4,0xb6,0x06,0x94,0xf5,0x66,0xde,0x44,0x48,0x4f,0xaf }
|
||||
},
|
||||
{
|
||||
// KEY 2
|
||||
{ 0x78,0x1e,0xdf,0x34,0xd2,0x06,0x96,0x5e,0x86,0xb3,0xe9,0x4f,0x53,0x6e,0x42,0x47 },
|
||||
{ 0x91,0x08,0x95,0x7f,0xf9,0x17,0xe3,0xd6,0x1c,0x4e,0xa3,0x3e,0x53,0xdb,0x6e,0xf3 },
|
||||
{ 0x6a,0x52,0x9a,0xc0,0x93,0xa5,0xf3,0x04,0x5a,0xed,0x78,0x7f,0x70,0xcc,0xb7,0xf5 }
|
||||
},
|
||||
{
|
||||
{ 0x78,0x1e,0xdf,0x34,0xd2,0x06,0x96,0x5e,0x86,0xb3,0xe9,0x4f,0x53,0x6e,0x42,0x47 },
|
||||
{ 0xcb,0xa0,0xf0,0x56,0x75,0x35,0xd6,0x61,0x48,0xb3,0x5a,0x92,0x58,0x72,0x9c,0x23 },
|
||||
{ 0x63,0x46,0xf0,0xe4,0xc5,0x95,0x32,0xd4,0x18,0xce,0x31,0x5b,0x9f,0x22,0xa0,0xf4 }
|
||||
},
|
||||
{
|
||||
{ 0x78,0x1e,0xdf,0x34,0xd2,0x06,0x96,0x5e,0x86,0xb3,0xe9,0x4f,0x53,0x6e,0x42,0x47 },
|
||||
{ 0xfa,0x59,0x80,0x11,0xf7,0xc2,0x10,0x07,0x99,0x45,0x1e,0x62,0xf3,0xb5,0xcf,0x09 },
|
||||
{ 0x62,0x55,0x45,0x91,0x00,0x95,0x8f,0x4d,0x95,0x3a,0x9d,0x56,0x67,0x69,0x2d,0x6d }
|
||||
},
|
||||
{
|
||||
{ 0x78,0x1e,0xdf,0x34,0xd2,0x06,0x96,0x5e,0x86,0xb3,0xe9,0x4f,0x53,0x6e,0x42,0x47 },
|
||||
{ 0xba,0x1f,0x85,0x55,0xb2,0xdd,0xab,0x0e,0x4e,0x4d,0x80,0x26,0xb0,0x5a,0xf3,0x89 },
|
||||
{ 0x37,0x6f,0xeb,0x09,0x78,0xb5,0x2a,0xb9,0xc9,0x84,0xa1,0x4d,0x7e,0x66,0xf6,0x71 }
|
||||
},
|
||||
{
|
||||
{ 0x78,0x1e,0xdf,0x34,0xd2,0x06,0x96,0x5e,0x86,0xb3,0xe9,0x4f,0x53,0x6e,0x42,0x47 },
|
||||
{ 0x50,0xc6,0x3c,0xe2,0x55,0x82,0x57,0x1a,0xa5,0xd8,0xee,0x22,0x08,0x9c,0x1b,0x59 },
|
||||
{ 0x31,0xff,0xaf,0x2c,0xad,0x65,0x49,0xf3,0xd9,0xfc,0xd7,0xf0,0x2d,0xf5,0x81,0x24 }
|
||||
},
|
||||
{
|
||||
{ 0x78,0x1e,0xdf,0x34,0xd2,0x06,0x96,0x5e,0x86,0xb3,0xe9,0x4f,0x53,0x6e,0x42,0x47 },
|
||||
{ 0x22,0x9a,0xd7,0xa8,0xa8,0x3c,0x5e,0x23,0x84,0xb4,0x08,0x2e,0x50,0xd0,0x6e,0xbf },
|
||||
{ 0x76,0xf2,0x9e,0x93,0xdd,0xf5,0x79,0x32,0xa4,0x1e,0x83,0xbb,0x7b,0x61,0xa4,0x06 }
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/* Test vectors from FIPS 198a, RFC 4231, RFC 2104, RFC 2202, and other sources. */
|
||||
@@ -722,7 +650,6 @@ void CipherInit2(int cipher, void* key, void* ks)
|
||||
case TWOFISH:
|
||||
case CAMELLIA:
|
||||
case KUZNYECHIK:
|
||||
case SM4:
|
||||
CipherInit(cipher,key,ks);
|
||||
break;
|
||||
default:
|
||||
@@ -941,33 +868,7 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (wcscmp (name, L"SM4") == 0)
|
||||
{
|
||||
switch (testCase)
|
||||
{
|
||||
case 0:
|
||||
if (crc != 0x561b1367)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 1:
|
||||
if (crc != 0x8f72e14d)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 2:
|
||||
if (crc != 0xf96df16f)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 3:
|
||||
if (crc != 0x8997e6eb)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (wcscmp (name, L"AES-Twofish") == 0)
|
||||
{
|
||||
switch (testCase)
|
||||
@@ -1202,84 +1103,6 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (wcscmp (name, L"SM4-Kuznyechik") == 0)
|
||||
{
|
||||
switch (testCase)
|
||||
{
|
||||
case 0:
|
||||
if (crc != 0xa8179f71)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 1:
|
||||
if (crc != 0xaa372193)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 2:
|
||||
if (crc != 0x49b78057)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 3:
|
||||
if (crc != 0x80718fd2)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (wcscmp (name, L"SM4-Serpent") == 0)
|
||||
{
|
||||
switch (testCase)
|
||||
{
|
||||
case 0:
|
||||
if (crc != 0x77cd332a)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 1:
|
||||
if (crc != 0x3a2be34b)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 2:
|
||||
if (crc != 0xfc1a6d4c)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 3:
|
||||
if (crc != 0xf9b54baf)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (wcscmp (name, L"SM4-Twofish") == 0)
|
||||
{
|
||||
switch (testCase)
|
||||
{
|
||||
case 0:
|
||||
if (crc != 0xd9a46a64)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 1:
|
||||
if (crc != 0x371fdc08)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 2:
|
||||
if (crc != 0x231c5104)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 3:
|
||||
if (crc != 0xa920424b)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (wcscmp (name, L"Kuznyechik-Serpent-Camellia") == 0)
|
||||
{
|
||||
switch (testCase)
|
||||
@@ -1306,32 +1129,6 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (wcscmp (name, L"SM4-Twofish-Serpent") == 0)
|
||||
{
|
||||
switch (testCase)
|
||||
{
|
||||
case 0:
|
||||
if (crc != 0x3ef6c86f)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 1:
|
||||
if (crc != 0xe5202d6c)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 2:
|
||||
if (crc != 0xa3acb43b)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 3:
|
||||
if (crc != 0xe9d64477)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (crc == 0x9f5edd58)
|
||||
return FALSE;
|
||||
@@ -1409,12 +1206,6 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
}
|
||||
else if (wcscmp (name, L"SM4") == 0)
|
||||
{
|
||||
if (crc != 0x7b600d06)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
}
|
||||
else if (wcscmp (name, L"AES-Twofish") == 0)
|
||||
{
|
||||
if (crc != 0x14ce7385)
|
||||
@@ -1469,36 +1260,12 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
}
|
||||
else if (wcscmp (name, L"SM4-Kuznyechik") == 0)
|
||||
{
|
||||
if (crc != 0x23039a99)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
}
|
||||
else if (wcscmp (name, L"SM4-Serpent") == 0)
|
||||
{
|
||||
if (crc != 0xa7c3155b)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
}
|
||||
else if (wcscmp (name, L"SM4-Twofish") == 0)
|
||||
{
|
||||
if (crc != 0x1eaede31)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
}
|
||||
else if (wcscmp (name, L"Kuznyechik-Serpent-Camellia") == 0)
|
||||
{
|
||||
if (crc != 0x755dad72)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
}
|
||||
else if (wcscmp (name, L"SM4-Twofish-Serpent") == 0)
|
||||
{
|
||||
if (crc != 0x9723753f)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
}
|
||||
#endif
|
||||
if (crc == 0x9f5edd58)
|
||||
return FALSE;
|
||||
@@ -1510,7 +1277,7 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
|
||||
|
||||
nTestsPerformed++;
|
||||
}
|
||||
return (nTestsPerformed == 200);
|
||||
return (nTestsPerformed == 150);
|
||||
}
|
||||
|
||||
static BOOL DoAutoTestAlgorithms (void)
|
||||
@@ -1652,26 +1419,6 @@ static BOOL DoAutoTestAlgorithms (void)
|
||||
}
|
||||
if (i != KUZNYECHIK_TEST_COUNT)
|
||||
bFailed = TRUE;
|
||||
|
||||
/* SM4 */
|
||||
|
||||
for (i = 0; i < SM4_TEST_COUNT; i++)
|
||||
{
|
||||
int cipher = SM4;
|
||||
memcpy(key, sm4_vectors[i].key, 16);
|
||||
memcpy(tmp, sm4_vectors[i].plaintext, 16);
|
||||
CipherInit(cipher, key, ks_tmp);
|
||||
|
||||
EncipherBlock(cipher, tmp, ks_tmp);
|
||||
if (memcmp(sm4_vectors[i].ciphertext, tmp, 16) != 0)
|
||||
break;
|
||||
|
||||
DecipherBlock(cipher, tmp, ks_tmp);
|
||||
if (memcmp(sm4_vectors[i].plaintext, tmp, 16) != 0)
|
||||
break;
|
||||
}
|
||||
if (i != SM4_TEST_COUNT)
|
||||
bFailed = TRUE;
|
||||
#endif
|
||||
|
||||
/* PKCS #5 and HMACs */
|
||||
|
||||
@@ -312,14 +312,9 @@ namespace VeraCrypt
|
||||
typeid (EncryptionModeXTS));
|
||||
#endif
|
||||
bool algoNotSupported = (typeid (*volume->GetEncryptionAlgorithm()) == typeid (Kuznyechik))
|
||||
|| (typeid (*volume->GetEncryptionAlgorithm()) == typeid (SM4))
|
||||
|| (typeid (*volume->GetEncryptionAlgorithm()) == typeid (CamelliaKuznyechik))
|
||||
|| (typeid (*volume->GetEncryptionAlgorithm()) == typeid (KuznyechikTwofish))
|
||||
|| (typeid (*volume->GetEncryptionAlgorithm()) == typeid (KuznyechikAES))
|
||||
|| (typeid (*volume->GetEncryptionAlgorithm()) == typeid (SM4Kuznyechik))
|
||||
|| (typeid (*volume->GetEncryptionAlgorithm()) == typeid (SM4Serpent))
|
||||
|| (typeid (*volume->GetEncryptionAlgorithm()) == typeid (SM4Twofish))
|
||||
|| (typeid (*volume->GetEncryptionAlgorithm()) == typeid (SM4TwofishSerpent))
|
||||
|| (typeid (*volume->GetEncryptionAlgorithm()) == typeid (KuznyechikSerpentCamellia));
|
||||
|
||||
if (options.NoKernelCrypto
|
||||
|
||||
@@ -260,11 +260,6 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Sha2Intel.c" />
|
||||
<ClCompile Include="sm4-impl-aesni.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="sm4.cpp" />
|
||||
<ClCompile Include="Streebog.c" />
|
||||
<ClCompile Include="t1ha2.c" />
|
||||
<ClCompile Include="t1ha2_selfcheck.c" />
|
||||
@@ -292,7 +287,6 @@
|
||||
<ClInclude Include="SerpentFast.h" />
|
||||
<ClInclude Include="SerpentFast_sbox.h" />
|
||||
<ClInclude Include="Sha2.h" />
|
||||
<ClInclude Include="sm4.h" />
|
||||
<ClInclude Include="Streebog.h" />
|
||||
<ClInclude Include="t1ha.h" />
|
||||
<ClInclude Include="t1ha_bits.h" />
|
||||
|
||||
@@ -99,12 +99,6 @@
|
||||
<ClCompile Include="sha256_armv8.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="sm4.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="sm4-impl-aesni.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Aes.h">
|
||||
@@ -182,9 +176,6 @@
|
||||
<ClInclude Include="t1ha_selfcheck.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="sm4.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="Aes_hw_cpu.asm">
|
||||
|
||||
@@ -48,8 +48,6 @@ SOURCES = \
|
||||
Streebog.c \
|
||||
kuznyechik.c \
|
||||
kuznyechik_simd.c \
|
||||
sm4.cpp \
|
||||
sm4-impl-aesni.cpp \
|
||||
Whirlpool.c \
|
||||
Camellia.c \
|
||||
Camellia_$(TC_ARCH).S \
|
||||
|
||||
@@ -277,11 +277,6 @@ copy $(OutDir)veracrypt.inf "$(SolutionDir)Debug\Setup Files\veracrypt.inf"</Com
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Crypto\Sha2Intel.c" />
|
||||
<ClCompile Include="..\Crypto\sm4-impl-aesni.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Crypto\sm4.cpp" />
|
||||
<ClCompile Include="..\Crypto\Streebog.c" />
|
||||
<ClCompile Include="..\Crypto\t1ha2.c" />
|
||||
<ClCompile Include="..\Crypto\t1ha2_selfcheck.c" />
|
||||
@@ -319,7 +314,6 @@ copy $(OutDir)veracrypt.inf "$(SolutionDir)Debug\Setup Files\veracrypt.inf"</Com
|
||||
<ClInclude Include="..\Crypto\SerpentFast.h" />
|
||||
<ClInclude Include="..\Crypto\SerpentFast_sbox.h" />
|
||||
<ClInclude Include="..\Crypto\Sha2.h" />
|
||||
<ClInclude Include="..\Crypto\sm4.h" />
|
||||
<ClInclude Include="..\Crypto\Streebog.h" />
|
||||
<ClInclude Include="..\Crypto\t1ha.h" />
|
||||
<ClInclude Include="..\Crypto\t1ha_bits.h" />
|
||||
|
||||
@@ -171,12 +171,6 @@
|
||||
<ClCompile Include="..\Crypto\sha256_armv8.c">
|
||||
<Filter>Crypto\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Crypto\sm4.cpp">
|
||||
<Filter>Crypto\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Crypto\sm4-impl-aesni.cpp">
|
||||
<Filter>Crypto\Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Common\Tcdefs.h">
|
||||
@@ -287,9 +281,6 @@
|
||||
<ClInclude Include="..\Driver\VolumeFilter.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Crypto\sm4.h">
|
||||
<Filter>Crypto\Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="..\Crypto\Aes_hw_cpu.asm">
|
||||
|
||||
@@ -1442,12 +1442,6 @@ void ComboSelChangeEA (HWND hwndDlg)
|
||||
|
||||
SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("CAMELLIA_HELP"));
|
||||
}
|
||||
else if (wcscmp (name, L"SM4") == 0)
|
||||
{
|
||||
StringCbPrintfW (hyperLink, sizeof(hyperLink) / 2, GetString ("MORE_INFO_ABOUT"), name);
|
||||
|
||||
SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("SM4_HELP"));
|
||||
}
|
||||
else if (EAGetCipherCount (nIndex) > 1)
|
||||
{
|
||||
// Cascade
|
||||
@@ -5660,8 +5654,6 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
||||
Applink ("kuznyechik");
|
||||
else if (wcscmp (name, L"Camellia") == 0)
|
||||
Applink ("camellia");
|
||||
else if (wcscmp (name, L"SM4") == 0)
|
||||
Applink ("sm4");
|
||||
else if (EAGetCipherCount (nIndex) > 1)
|
||||
Applink ("cascades");
|
||||
|
||||
|
||||
@@ -100,8 +100,6 @@ namespace VeraCrypt
|
||||
EncryptionAlgorithmStaticText->SetLabel (LangString["CAMELLIA_HELP"]);
|
||||
else if (typeid (*ea) == typeid (Kuznyechik))
|
||||
EncryptionAlgorithmStaticText->SetLabel (LangString["KUZNYECHIK_HELP"]);
|
||||
else if (typeid (*ea) == typeid (SM4))
|
||||
EncryptionAlgorithmStaticText->SetLabel (LangString["SM4_HELP"]);
|
||||
else
|
||||
EncryptionAlgorithmStaticText->SetLabel (L"");
|
||||
}
|
||||
|
||||
@@ -1304,10 +1304,6 @@ namespace VeraCrypt
|
||||
{
|
||||
url = L"Kuznyechik.html";
|
||||
}
|
||||
else if (linkId == L"sm4")
|
||||
{
|
||||
url = L"SM4.html";
|
||||
}
|
||||
else if (linkId == L"cascades")
|
||||
{
|
||||
url = L"Cascades.html";
|
||||
|
||||
@@ -797,9 +797,6 @@
|
||||
<Component Id="cmp9EC1750F7CD9717D3A761FC2930C509D" Guid="{980F49E8-EBCD-4720-8466-C03DC2B3BBD7}">
|
||||
<File Id="fil780042F951150166D5D328C10993CE7E" KeyPath="yes" Source="$(sys.CURRENTDIR)\docs\html\en\Kuznyechik.html" Checksum="yes" DiskId="1" />
|
||||
</Component>
|
||||
<Component Id="cmpDD785B73974849F0B358BE861E72DF01" Guid="{1AEB282A-FFC1-49E1-A6BA-11B8A60E52DC}">
|
||||
<File Id="fil49731D859E3640C6A02879615E946D42" KeyPath="yes" Source="$(sys.CURRENTDIR)\docs\html\en\SM4.html" Checksum="yes" DiskId="1" />
|
||||
</Component>
|
||||
<Component Id="cmp4298A84BD6956E2A2742B5678BCFF173" Guid="{2809427F-697F-48A4-853B-5BE4AE1E720A}">
|
||||
<File Id="fil01E37EFCBAF6AB983418B79E3DD75E88" KeyPath="yes" Source="$(sys.CURRENTDIR)\docs\html\en\Language Packs.html" Checksum="yes" DiskId="1" />
|
||||
</Component>
|
||||
@@ -1446,9 +1443,6 @@
|
||||
<Component Id="cmpCA290469DDC2BF237F81DDD5B1767EED" Guid="{AF232DD2-C9E9-43B2-BA21-C653C3D78B17}">
|
||||
<File Id="fil707DCE82E2DB960CA32D798C9D58BFD0" KeyPath="yes" Source="$(sys.CURRENTDIR)\docs\html\ru\Kuznyechik.html" Checksum="yes" DiskId="1" />
|
||||
</Component>
|
||||
<Component Id="cmp28F5B42ECF3547A7962DF465FFB005D1" Guid="{941CF92B-37B4-4119-87BA-D63A7D892031}">
|
||||
<File Id="fil91EBD060483445EAA9DE2D3DB51DD7C7" KeyPath="yes" Source="$(sys.CURRENTDIR)\docs\html\ru\SM4.html" Checksum="yes" DiskId="1" />
|
||||
</Component>
|
||||
<Component Id="cmp72EE25B25C5C68F03DF9176C2D3F8BDD" Guid="{E162CD5B-C72D-4DEE-BD06-048CAB209743}">
|
||||
<File Id="fil30D8E2286343AA063BB31ADDD09E8B79" KeyPath="yes" Source="$(sys.CURRENTDIR)\docs\html\ru\Language Packs.html" Checksum="yes" DiskId="1" />
|
||||
</Component>
|
||||
@@ -2094,9 +2088,6 @@
|
||||
<Component Id="cmp56374396CDBAA23F8BE5DEBA503FDDAA" Guid="{3EEA13F1-B8EB-B348-9D83-BD6B5B37A796}">
|
||||
<File Id="filC44D0EAFF15558D6E435AFE7666B22EA" KeyPath="yes" Source="$(sys.CURRENTDIR)\docs\html\zh-cn\Kuznyechik.html" Checksum="yes" DiskId="1" />
|
||||
</Component>
|
||||
<Component Id="cmpC16F53E9B3C7478A98F30448CB6DD523" Guid="{C16F53E9-B3C7-478A-98F3-0448CB6DD523}">
|
||||
<File Id="filC0CC0D6052124CBF959DF853C14352C1" KeyPath="yes" Source="$(sys.CURRENTDIR)\docs\html\zh-cn\SM4.html" Checksum="yes" DiskId="1" />
|
||||
</Component>
|
||||
<Component Id="cmpB6A781131BBE88FA5794EFF1F719744B" Guid="{80F23A6A-622B-FA9A-1627-088BB700C6F2}">
|
||||
<File Id="fil63A19CD842764B27343E0E63488B8540" KeyPath="yes" Source="$(sys.CURRENTDIR)\docs\html\zh-cn\Language Packs.html" Checksum="yes" DiskId="1" />
|
||||
</Component>
|
||||
@@ -2786,7 +2777,6 @@
|
||||
<ComponentRef Id="cmpFC8FB415783E0AA424FBD685EFACF54E" />
|
||||
<ComponentRef Id="cmp2BCEA21755E1C812ACCF15A09210FCCD" />
|
||||
<ComponentRef Id="cmp9EC1750F7CD9717D3A761FC2930C509D" />
|
||||
<ComponentRef Id="cmpDD785B73974849F0B358BE861E72DF01" />
|
||||
<ComponentRef Id="cmp4298A84BD6956E2A2742B5678BCFF173" />
|
||||
<ComponentRef Id="cmp2D9F7D88EF1F843BDEA5A39D13330B8A" />
|
||||
<ComponentRef Id="cmp58EAECCB29CB9ABDDDB72F9378E4EE77" />
|
||||
@@ -3004,7 +2994,6 @@
|
||||
<ComponentRef Id="cmpD858F6459F1D5BE26754F7B9A6B256FB" />
|
||||
<ComponentRef Id="cmpD935A23E00BC5621253BAF554A60C48A" />
|
||||
<ComponentRef Id="cmpCA290469DDC2BF237F81DDD5B1767EED" />
|
||||
<ComponentRef Id="cmp28F5B42ECF3547A7962DF465FFB005D1" />
|
||||
<ComponentRef Id="cmp72EE25B25C5C68F03DF9176C2D3F8BDD" />
|
||||
<ComponentRef Id="cmp29F705976D3FE416CA69F9A85F81E453" />
|
||||
<ComponentRef Id="cmp3092B4A3F28D76A5F41FB2DC967976BF" />
|
||||
@@ -3222,7 +3211,6 @@
|
||||
<ComponentRef Id="cmp536D5016E985775CACBEE78964CDB44D" />
|
||||
<ComponentRef Id="cmp34B70BB362A4A65AF541E008135AFD87" />
|
||||
<ComponentRef Id="cmp56374396CDBAA23F8BE5DEBA503FDDAA" />
|
||||
<ComponentRef Id="cmpC16F53E9B3C7478A98F30448CB6DD523" />
|
||||
<ComponentRef Id="cmpB6A781131BBE88FA5794EFF1F719744B" />
|
||||
<ComponentRef Id="cmpE78E6B581A96987CFBA2F14881CC8C29" />
|
||||
<ComponentRef Id="cmp3DA875F1A8705BEE59E1117BB79E9587" />
|
||||
|
||||
@@ -733,10 +733,6 @@ void Applink_Dll (MSIHANDLE hInstaller, const char *dest)
|
||||
{
|
||||
StringCbCopyW (page, sizeof (page),L"Camellia.html");
|
||||
}
|
||||
else if (strcmp(dest, "sm4") == 0)
|
||||
{
|
||||
StringCbCopyW (page, sizeof (page),L"SM4.html");
|
||||
}
|
||||
else if (strcmp(dest, "cascades") == 0)
|
||||
{
|
||||
StringCbCopyW (page, sizeof (page),L"Cascades.html");
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include "Crypto/Twofish.h"
|
||||
#include "Crypto/Camellia.h"
|
||||
#include "Crypto/kuznyechik.h"
|
||||
#include "Crypto/sm4.h"
|
||||
|
||||
#ifdef TC_AES_HW_CPU
|
||||
# include "Crypto/Aes_hw_cpu.h"
|
||||
@@ -100,7 +99,6 @@ namespace VeraCrypt
|
||||
l.push_back (shared_ptr <Cipher> (new CipherTwofish ()));
|
||||
l.push_back (shared_ptr <Cipher> (new CipherCamellia ()));
|
||||
l.push_back (shared_ptr <Cipher> (new CipherKuznyechik ()));
|
||||
l.push_back (shared_ptr <Cipher> (new CipherSM4 ()));
|
||||
#endif
|
||||
return l;
|
||||
}
|
||||
@@ -521,72 +519,6 @@ namespace VeraCrypt
|
||||
#endif
|
||||
}
|
||||
|
||||
// SM4
|
||||
void CipherSM4::Decrypt (uint8 *data) const
|
||||
{
|
||||
sm4_decrypt_block (data, data, (sm4_kds *) ScheduledKey.Ptr());
|
||||
}
|
||||
|
||||
void CipherSM4::Encrypt (uint8 *data) const
|
||||
{
|
||||
sm4_encrypt_block (data, data, (sm4_kds *) ScheduledKey.Ptr());
|
||||
}
|
||||
|
||||
size_t CipherSM4::GetScheduledKeySize () const
|
||||
{
|
||||
return SM4_KS;
|
||||
}
|
||||
|
||||
void CipherSM4::SetCipherKey (const uint8 *key)
|
||||
{
|
||||
sm4_set_key (key, (sm4_kds *) ScheduledKey.Ptr());
|
||||
}
|
||||
void CipherSM4::EncryptBlocks (uint8 *data, size_t blockCount) const
|
||||
{
|
||||
if (!Initialized)
|
||||
throw NotInitialized (SRC_POS);
|
||||
|
||||
if ((blockCount >= 4)
|
||||
&& IsHwSupportAvailable())
|
||||
{
|
||||
sm4_encrypt_blocks (data, data, blockCount, (sm4_kds *) ScheduledKey.Ptr());
|
||||
}
|
||||
else
|
||||
Cipher::EncryptBlocks (data, blockCount);
|
||||
}
|
||||
|
||||
void CipherSM4::DecryptBlocks (uint8 *data, size_t blockCount) const
|
||||
{
|
||||
if (!Initialized)
|
||||
throw NotInitialized (SRC_POS);
|
||||
|
||||
if ((blockCount >= 4)
|
||||
&& IsHwSupportAvailable())
|
||||
{
|
||||
sm4_decrypt_blocks (data, data, blockCount, (sm4_kds *) ScheduledKey.Ptr());
|
||||
}
|
||||
else
|
||||
Cipher::DecryptBlocks (data, blockCount);
|
||||
}
|
||||
|
||||
bool CipherSM4::IsHwSupportAvailable () const
|
||||
{
|
||||
#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32
|
||||
static bool state = false;
|
||||
static bool stateValid = false;
|
||||
|
||||
if (!stateValid)
|
||||
{
|
||||
state = HasSSE41() && HasAESNI();
|
||||
stateValid = true;
|
||||
}
|
||||
return state;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
bool Cipher::HwSupportEnabled = true;
|
||||
}
|
||||
|
||||
@@ -148,7 +148,6 @@ namespace VeraCrypt
|
||||
TC_CIPHER (Twofish, 16, 32);
|
||||
TC_CIPHER (Camellia, 16, 32);
|
||||
TC_CIPHER (Kuznyechik, 16, 32);
|
||||
TC_CIPHER (SM4, 16, 16);
|
||||
|
||||
#undef TC_CIPHER_ADD_METHODS
|
||||
#define TC_CIPHER_ADD_METHODS
|
||||
|
||||
@@ -70,7 +70,6 @@ namespace VeraCrypt
|
||||
l.push_back (shared_ptr <EncryptionAlgorithm> (new Twofish ()));
|
||||
l.push_back (shared_ptr <EncryptionAlgorithm> (new Camellia ()));
|
||||
l.push_back (shared_ptr <EncryptionAlgorithm> (new Kuznyechik ()));
|
||||
l.push_back (shared_ptr <EncryptionAlgorithm> (new SM4 ()));
|
||||
l.push_back (shared_ptr <EncryptionAlgorithm> (new AESTwofish ()));
|
||||
l.push_back (shared_ptr <EncryptionAlgorithm> (new AESTwofishSerpent ()));
|
||||
l.push_back (shared_ptr <EncryptionAlgorithm> (new CamelliaKuznyechik ()));
|
||||
@@ -81,10 +80,6 @@ namespace VeraCrypt
|
||||
l.push_back (shared_ptr <EncryptionAlgorithm> (new SerpentAES ()));
|
||||
l.push_back (shared_ptr <EncryptionAlgorithm> (new SerpentTwofishAES ()));
|
||||
l.push_back (shared_ptr <EncryptionAlgorithm> (new TwofishSerpent ()));
|
||||
l.push_back (shared_ptr <EncryptionAlgorithm> (new SM4Kuznyechik ()));
|
||||
l.push_back (shared_ptr <EncryptionAlgorithm> (new SM4Serpent ()));
|
||||
l.push_back (shared_ptr <EncryptionAlgorithm> (new SM4Twofish ()));
|
||||
l.push_back (shared_ptr <EncryptionAlgorithm> (new SM4TwofishSerpent ()));
|
||||
#endif
|
||||
return l;
|
||||
}
|
||||
@@ -386,49 +381,5 @@ namespace VeraCrypt
|
||||
SupportedModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeXTS ()));
|
||||
}
|
||||
|
||||
// SM4
|
||||
SM4::SM4 ()
|
||||
{
|
||||
Ciphers.push_back (shared_ptr <Cipher> (new CipherSM4()));
|
||||
|
||||
SupportedModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeXTS ()));
|
||||
}
|
||||
|
||||
// SM4-Kuznyechik
|
||||
SM4Kuznyechik::SM4Kuznyechik ()
|
||||
{
|
||||
Ciphers.push_back (shared_ptr <Cipher> (new CipherKuznyechik ()));
|
||||
Ciphers.push_back (shared_ptr <Cipher> (new CipherSM4 ()));
|
||||
|
||||
SupportedModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeXTS ()));
|
||||
}
|
||||
|
||||
// SM4-Serpent
|
||||
SM4Serpent::SM4Serpent ()
|
||||
{
|
||||
Ciphers.push_back (shared_ptr <Cipher> (new CipherSerpent ()));
|
||||
Ciphers.push_back (shared_ptr <Cipher> (new CipherSM4 ()));
|
||||
|
||||
SupportedModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeXTS ()));
|
||||
}
|
||||
|
||||
// SM4-Twofish
|
||||
SM4Twofish::SM4Twofish ()
|
||||
{
|
||||
Ciphers.push_back (shared_ptr <Cipher> (new CipherTwofish ()));
|
||||
Ciphers.push_back (shared_ptr <Cipher> (new CipherSM4 ()));
|
||||
|
||||
SupportedModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeXTS ()));
|
||||
}
|
||||
|
||||
// SM4-Twofish-Serpent
|
||||
SM4TwofishSerpent::SM4TwofishSerpent ()
|
||||
{
|
||||
Ciphers.push_back (shared_ptr <Cipher> (new CipherSerpent ()));
|
||||
Ciphers.push_back (shared_ptr <Cipher> (new CipherTwofish ()));
|
||||
Ciphers.push_back (shared_ptr <Cipher> (new CipherSM4 ()));
|
||||
|
||||
SupportedModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeXTS ()));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -95,11 +95,6 @@ namespace VeraCrypt
|
||||
TC_ENCRYPTION_ALGORITHM (KuznyechikSerpentCamellia);
|
||||
TC_ENCRYPTION_ALGORITHM (CamelliaKuznyechik);
|
||||
TC_ENCRYPTION_ALGORITHM (CamelliaSerpent);
|
||||
TC_ENCRYPTION_ALGORITHM (SM4);
|
||||
TC_ENCRYPTION_ALGORITHM (SM4Kuznyechik);
|
||||
TC_ENCRYPTION_ALGORITHM (SM4Serpent);
|
||||
TC_ENCRYPTION_ALGORITHM (SM4Twofish);
|
||||
TC_ENCRYPTION_ALGORITHM (SM4TwofishSerpent);
|
||||
|
||||
|
||||
#undef TC_ENCRYPTION_ALGORITHM
|
||||
|
||||
@@ -163,102 +163,6 @@ namespace VeraCrypt
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
static const CipherTestVector SM4TestVectors[] =
|
||||
{
|
||||
{
|
||||
// KEY 0
|
||||
{ 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef,0xfe,0xdc,0xba,0x98,0x76,0x54,0x32,0x10,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // dummy
|
||||
},
|
||||
16,
|
||||
{ 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef,0xfe,0xdc,0xba,0x98,0x76,0x54,0x32,0x10 },
|
||||
{ 0x68,0x1e,0xdf,0x34,0xd2,0x06,0x96,0x5e,0x86,0xb3,0xe9,0x4f,0x53,0x6e,0x42,0x46 }
|
||||
},
|
||||
{
|
||||
// KEY 1
|
||||
{ 0x68,0x1e,0xdf,0x34,0xd2,0x06,0x96,0x5e,0x86,0xb3,0xe9,0x4f,0x53,0x6e,0x42,0x46,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // dummy
|
||||
},
|
||||
16,
|
||||
{ 0xf4,0x21,0x31,0xb0,0x02,0x42,0x5b,0x6f,0x5c,0xf5,0x2a,0x81,0x06,0x82,0xa0,0x9d },
|
||||
{ 0xec,0x4b,0x7b,0x17,0x57,0xfe,0xe9,0xce,0x45,0x51,0x97,0xe5,0xbf,0x9c,0x3a,0x90 }
|
||||
},
|
||||
{
|
||||
// After KEY 1, PT/CT pairs
|
||||
{ 0x68,0x1e,0xdf,0x34,0xd2,0x06,0x96,0x5e,0x86,0xb3,0xe9,0x4f,0x53,0x6e,0x42,0x46,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // dummy
|
||||
},
|
||||
16,
|
||||
{ 0x07,0xbc,0xae,0x6a,0x83,0x88,0xe1,0x46,0x51,0xfe,0xd8,0x4b,0x37,0x49,0xd3,0x86 },
|
||||
{ 0x89,0xf2,0xc4,0x1e,0xd9,0x7d,0xbb,0x1b,0x74,0xa2,0xad,0x93,0xb9,0x03,0xbb,0xc9 }
|
||||
},
|
||||
{
|
||||
{ 0x68,0x1e,0xdf,0x34,0xd2,0x06,0x96,0x5e,0x86,0xb3,0xe9,0x4f,0x53,0x6e,0x42,0x46,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // dummy
|
||||
},
|
||||
16,
|
||||
{ 0xf4,0x76,0x26,0x15,0xb3,0x2c,0x00,0x0a,0x16,0x5e,0x1d,0x72,0x2d,0x70,0x80,0x52 },
|
||||
{ 0xf4,0x5a,0x41,0x05,0x2f,0x9b,0xf3,0xd5,0xb6,0x5d,0xf8,0xcc,0x1c,0x75,0xb4,0xcf }
|
||||
},
|
||||
{
|
||||
{ 0x68,0x1e,0xdf,0x34,0xd2,0x06,0x96,0x5e,0x86,0xb3,0xe9,0x4f,0x53,0x6e,0x42,0x46,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // dummy
|
||||
},
|
||||
16,
|
||||
{ 0xba,0x3c,0x19,0xd8,0x92,0x63,0x56,0xed,0x14,0x91,0xc6,0xe4,0xe5,0x28,0x78,0x2f },
|
||||
{ 0x3e,0x1f,0x30,0xd5,0x7d,0xf4,0xb6,0x06,0x94,0xf5,0x66,0xde,0x44,0x48,0x4f,0xaf }
|
||||
},
|
||||
{
|
||||
// KEY 2
|
||||
{ 0x78,0x1e,0xdf,0x34,0xd2,0x06,0x96,0x5e,0x86,0xb3,0xe9,0x4f,0x53,0x6e,0x42,0x47,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // dummy
|
||||
},
|
||||
16,
|
||||
{ 0x91,0x08,0x95,0x7f,0xf9,0x17,0xe3,0xd6,0x1c,0x4e,0xa3,0x3e,0x53,0xdb,0x6e,0xf3 },
|
||||
{ 0x6a,0x52,0x9a,0xc0,0x93,0xa5,0xf3,0x04,0x5a,0xed,0x78,0x7f,0x70,0xcc,0xb7,0xf5 }
|
||||
},
|
||||
{
|
||||
{ 0x78,0x1e,0xdf,0x34,0xd2,0x06,0x96,0x5e,0x86,0xb3,0xe9,0x4f,0x53,0x6e,0x42,0x47,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // dummy
|
||||
},
|
||||
16,
|
||||
{ 0xcb,0xa0,0xf0,0x56,0x75,0x35,0xd6,0x61,0x48,0xb3,0x5a,0x92,0x58,0x72,0x9c,0x23 },
|
||||
{ 0x63,0x46,0xf0,0xe4,0xc5,0x95,0x32,0xd4,0x18,0xce,0x31,0x5b,0x9f,0x22,0xa0,0xf4 }
|
||||
},
|
||||
{
|
||||
{ 0x78,0x1e,0xdf,0x34,0xd2,0x06,0x96,0x5e,0x86,0xb3,0xe9,0x4f,0x53,0x6e,0x42,0x47,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // dummy
|
||||
},
|
||||
16,
|
||||
{ 0xfa,0x59,0x80,0x11,0xf7,0xc2,0x10,0x07,0x99,0x45,0x1e,0x62,0xf3,0xb5,0xcf,0x09 },
|
||||
{ 0x62,0x55,0x45,0x91,0x00,0x95,0x8f,0x4d,0x95,0x3a,0x9d,0x56,0x67,0x69,0x2d,0x6d }
|
||||
},
|
||||
{
|
||||
{ 0x78,0x1e,0xdf,0x34,0xd2,0x06,0x96,0x5e,0x86,0xb3,0xe9,0x4f,0x53,0x6e,0x42,0x47,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // dummy
|
||||
},
|
||||
16,
|
||||
{ 0xba,0x1f,0x85,0x55,0xb2,0xdd,0xab,0x0e,0x4e,0x4d,0x80,0x26,0xb0,0x5a,0xf3,0x89 },
|
||||
{ 0x37,0x6f,0xeb,0x09,0x78,0xb5,0x2a,0xb9,0xc9,0x84,0xa1,0x4d,0x7e,0x66,0xf6,0x71 }
|
||||
},
|
||||
{
|
||||
{ 0x78,0x1e,0xdf,0x34,0xd2,0x06,0x96,0x5e,0x86,0xb3,0xe9,0x4f,0x53,0x6e,0x42,0x47,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // dummy
|
||||
},
|
||||
16,
|
||||
{ 0x50,0xc6,0x3c,0xe2,0x55,0x82,0x57,0x1a,0xa5,0xd8,0xee,0x22,0x08,0x9c,0x1b,0x59 },
|
||||
{ 0x31,0xff,0xaf,0x2c,0xad,0x65,0x49,0xf3,0xd9,0xfc,0xd7,0xf0,0x2d,0xf5,0x81,0x24 }
|
||||
},
|
||||
{
|
||||
{ 0x78,0x1e,0xdf,0x34,0xd2,0x06,0x96,0x5e,0x86,0xb3,0xe9,0x4f,0x53,0x6e,0x42,0x47,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // dummy
|
||||
},
|
||||
16,
|
||||
{ 0x22,0x9a,0xd7,0xa8,0xa8,0x3c,0x5e,0x23,0x84,0xb4,0x08,0x2e,0x50,0xd0,0x6e,0xbf },
|
||||
{ 0x76,0xf2,0x9e,0x93,0xdd,0xf5,0x79,0x32,0xa4,0x1e,0x83,0xbb,0x7b,0x61,0xa4,0x06 }
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
static void TestCipher (Cipher &cipher, const CipherTestVector *testVector, size_t testVectorCount)
|
||||
@@ -311,9 +215,6 @@ namespace VeraCrypt
|
||||
|
||||
CipherKuznyechik kuznyechik;
|
||||
TestCipher (kuznyechik, KuznyechikTestVectors, array_capacity (KuznyechikTestVectors));
|
||||
|
||||
CipherSM4 sm4;
|
||||
TestCipher (sm4, SM4TestVectors, array_capacity (SM4TestVectors));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -790,32 +691,6 @@ namespace VeraCrypt
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (typeid (ea) == typeid (SM4))
|
||||
{
|
||||
switch (testCase)
|
||||
{
|
||||
case 0:
|
||||
if (crc != 0x561b1367)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 1:
|
||||
if (crc != 0x8f72e14d)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 2:
|
||||
if (crc != 0xf96df16f)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 3:
|
||||
if (crc != 0x8997e6eb)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (typeid (ea) == typeid (AESTwofish))
|
||||
{
|
||||
switch (testCase)
|
||||
@@ -1076,110 +951,6 @@ namespace VeraCrypt
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (typeid (ea) == typeid (SM4Kuznyechik))
|
||||
{
|
||||
switch (testCase)
|
||||
{
|
||||
case 0:
|
||||
if (crc != 0xa8179f71)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 1:
|
||||
if (crc != 0xaa372193)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 2:
|
||||
if (crc != 0x49b78057)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 3:
|
||||
if (crc != 0x80718fd2)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (typeid (ea) == typeid (SM4Serpent))
|
||||
{
|
||||
switch (testCase)
|
||||
{
|
||||
case 0:
|
||||
if (crc != 0x77cd332a)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 1:
|
||||
if (crc != 0x3a2be34b)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 2:
|
||||
if (crc != 0xfc1a6d4c)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 3:
|
||||
if (crc != 0xf9b54baf)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (typeid (ea) == typeid (SM4Twofish))
|
||||
{
|
||||
switch (testCase)
|
||||
{
|
||||
case 0:
|
||||
if (crc != 0xd9a46a64)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 1:
|
||||
if (crc != 0x371fdc08)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 2:
|
||||
if (crc != 0x231c5104)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 3:
|
||||
if (crc != 0xa920424b)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (typeid (ea) == typeid (SM4TwofishSerpent))
|
||||
{
|
||||
switch (testCase)
|
||||
{
|
||||
case 0:
|
||||
if (crc != 0x3ef6c86f)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 1:
|
||||
if (crc != 0xe5202d6c)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 2:
|
||||
if (crc != 0xa3acb43b)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
case 3:
|
||||
if (crc != 0xe9d64477)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (crc == 0x9f5edd58)
|
||||
throw TestFailed (SRC_POS);
|
||||
@@ -1267,12 +1038,6 @@ namespace VeraCrypt
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
}
|
||||
else if (typeid (ea) == typeid (SM4))
|
||||
{
|
||||
if (crc != 0x7b600d06)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
}
|
||||
else if (typeid (ea) == typeid (AESTwofish))
|
||||
{
|
||||
if (crc != 0x14ce7385)
|
||||
@@ -1333,30 +1098,6 @@ namespace VeraCrypt
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
}
|
||||
else if (typeid (ea) == typeid (SM4Kuznyechik))
|
||||
{
|
||||
if (crc != 0x23039a99)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
}
|
||||
else if (typeid (ea) == typeid (SM4Serpent))
|
||||
{
|
||||
if (crc != 0xa7c3155b)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
}
|
||||
else if (typeid (ea) == typeid (SM4Twofish))
|
||||
{
|
||||
if (crc != 0x1eaede31)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
}
|
||||
else if (typeid (ea) == typeid (SM4TwofishSerpent))
|
||||
{
|
||||
if (crc != 0x9723753f)
|
||||
throw TestFailed (SRC_POS);
|
||||
nTestsPerformed++;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (crc == 0x9f5edd58)
|
||||
@@ -1370,7 +1111,7 @@ namespace VeraCrypt
|
||||
nTestsPerformed++;
|
||||
}
|
||||
#ifndef WOLFCRYPT_BACKEND
|
||||
if (nTestsPerformed != 200)
|
||||
if (nTestsPerformed != 150)
|
||||
#else
|
||||
if (nTestsPerformed != 10)
|
||||
#endif
|
||||
|
||||
@@ -96,11 +96,6 @@ else
|
||||
OBJS += ../Crypto/blake2s_SSE41.o
|
||||
OBJS += ../Crypto/blake2s_SSSE3.o
|
||||
endif
|
||||
ifeq "$(GCC_GTEQ_440)" "1"
|
||||
OBJAESNI += ../Crypto/sm4-impl-aesni.oaesni
|
||||
else
|
||||
OBJS += ../Crypto/sm4-impl-aesni.o
|
||||
endif
|
||||
ifeq "$(GCC_GTEQ_500)" "1"
|
||||
OBJSHANI += ../Crypto/Sha2Intel.oshani
|
||||
else
|
||||
@@ -124,7 +119,6 @@ OBJS += ../Crypto/Camellia.o
|
||||
OBJS += ../Crypto/Streebog.o
|
||||
OBJS += ../Crypto/kuznyechik.o
|
||||
OBJS += ../Crypto/kuznyechik_simd.o
|
||||
OBJS += ../Crypto/sm4.o
|
||||
OBJS += ../Common/Pkcs5.o
|
||||
endif
|
||||
|
||||
|
||||
@@ -109,7 +109,6 @@ namespace VeraCrypt
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new Twofish ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new Camellia ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new Kuznyechik ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new SM4 ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new AESTwofish ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new AESTwofishSerpent ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new CamelliaKuznyechik ()));
|
||||
@@ -120,10 +119,6 @@ namespace VeraCrypt
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new SerpentAES ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new SerpentTwofishAES ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new TwofishSerpent ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new SM4Kuznyechik ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new SM4Serpent ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new SM4Twofish ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new SM4TwofishSerpent ()));
|
||||
SupportedEncryptionModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeXTS ()));
|
||||
#else
|
||||
SupportedEncryptionModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeWolfCryptXTS ()));
|
||||
@@ -163,7 +158,6 @@ namespace VeraCrypt
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new Twofish ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new Camellia ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new Kuznyechik ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new SM4 ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new AESTwofish ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new AESTwofishSerpent ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new CamelliaKuznyechik ()));
|
||||
@@ -174,10 +168,6 @@ namespace VeraCrypt
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new SerpentAES ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new SerpentTwofishAES ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new TwofishSerpent ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new SM4Kuznyechik ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new SM4Serpent ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new SM4Twofish ()));
|
||||
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new SM4TwofishSerpent ()));
|
||||
|
||||
SupportedEncryptionModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeXTS ()));
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user