VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-06-01 22:10:39 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-06-01 22:12:00 (GMT)
commit76d3bc631eff60841026f2526d69f6d661d218a3 (patch)
treececc43976a8c45029b35b08ba3af0819ebee3993 /src/Common
parent99c4031d89ce4f72e3899b3cac660082a1820a48 (diff)
downloadVeraCrypt-76d3bc631eff60841026f2526d69f6d661d218a3.zip
VeraCrypt-76d3bc631eff60841026f2526d69f6d661d218a3.tar.gz
Crypto: Add support for Japanese encryption standard Camellia, including for system encryption.
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/BootEncryption.cpp13
-rw-r--r--src/Common/Common.rc8
-rw-r--r--src/Common/Crypto.c20
-rw-r--r--src/Common/Crypto.h8
-rw-r--r--src/Common/Dlgcode.c2
-rw-r--r--src/Common/Language.xml1
-rw-r--r--src/Common/Resource.h10
-rw-r--r--src/Common/Tcdefs.h8
-rw-r--r--src/Common/Tests.c87
-rw-r--r--src/Common/Volumes.c8
10 files changed, 156 insertions, 9 deletions
diff --git a/src/Common/BootEncryption.cpp b/src/Common/BootEncryption.cpp
index 7148ca2..bf65fd6 100644
--- a/src/Common/BootEncryption.cpp
+++ b/src/Common/BootEncryption.cpp
@@ -1169,6 +1169,19 @@ namespace VeraCrypt
bootLoaderId = rescueDisk ? IDR_RESCUE_LOADER_TWOFISH : IDR_BOOT_LOADER_TWOFISH;
}
break;
+
+ case CAMELLIA:
+ if (pkcs5_prf == SHA256)
+ {
+ bootSectorId = rescueDisk ? IDR_RESCUE_BOOT_SECTOR_CAMELLIA_SHA2 : IDR_BOOT_SECTOR_CAMELLIA_SHA2;
+ bootLoaderId = rescueDisk ? IDR_RESCUE_LOADER_CAMELLIA_SHA2 : IDR_BOOT_LOADER_CAMELLIA_SHA2;
+ }
+ else
+ {
+ bootSectorId = rescueDisk ? IDR_RESCUE_BOOT_SECTOR_CAMELLIA : IDR_BOOT_SECTOR_CAMELLIA;
+ bootLoaderId = rescueDisk ? IDR_RESCUE_LOADER_CAMELLIA : IDR_BOOT_LOADER_CAMELLIA;
+ }
+ break;
}
// Boot sector
diff --git a/src/Common/Common.rc b/src/Common/Common.rc
index b84fba8..96e941c 100644
--- a/src/Common/Common.rc
+++ b/src/Common/Common.rc
@@ -486,39 +486,47 @@ IDR_BOOT_SECTOR BIN "..\\Boot\\Windows\\Release\\Boo
IDR_BOOT_SECTOR_AES BIN "..\\Boot\\Windows\\Release_AES\\BootSector.bin"
IDR_BOOT_SECTOR_SERPENT BIN "..\\Boot\\Windows\\Release_Serpent\\BootSector.bin"
IDR_BOOT_SECTOR_TWOFISH BIN "..\\Boot\\Windows\\Release_Twofish\\BootSector.bin"
+IDR_BOOT_SECTOR_CAMELLIA BIN "..\\Boot\\Windows\\Release_Camellia\\BootSector.bin"
IDR_BOOT_LOADER_DECOMPRESSOR BIN "..\\Boot\\Windows\\Release\\Decompressor.com"
IDR_BOOT_LOADER BIN "..\\Boot\\Windows\\Release\\BootLoader.com.gz"
IDR_BOOT_LOADER_AES BIN "..\\Boot\\Windows\\Release_AES\\BootLoader.com.gz"
IDR_BOOT_LOADER_SERPENT BIN "..\\Boot\\Windows\\Release_Serpent\\BootLoader.com.gz"
IDR_BOOT_LOADER_TWOFISH BIN "..\\Boot\\Windows\\Release_Twofish\\BootLoader.com.gz"
+IDR_BOOT_LOADER_CAMELLIA BIN "..\\Boot\\Windows\\Release_Camellia\\BootLoader.com.gz"
IDR_BOOT_SECTOR_SHA2 BIN "..\\Boot\\Windows\\Release_SHA2\\BootSector.bin"
IDR_BOOT_SECTOR_AES_SHA2 BIN "..\\Boot\\Windows\\Release_AES_SHA2\\BootSector.bin"
IDR_BOOT_SECTOR_SERPENT_SHA2 BIN "..\\Boot\\Windows\\Release_Serpent_SHA2\\BootSector.bin"
IDR_BOOT_SECTOR_TWOFISH_SHA2 BIN "..\\Boot\\Windows\\Release_Twofish_SHA2\\BootSector.bin"
+IDR_BOOT_SECTOR_CAMELLIA_SHA2 BIN "..\\Boot\\Windows\\Release_Camellia_SHA2\\BootSector.bin"
IDR_BOOT_LOADER_SHA2 BIN "..\\Boot\\Windows\\Release_SHA2\\BootLoader.com.gz"
IDR_BOOT_LOADER_AES_SHA2 BIN "..\\Boot\\Windows\\Release_AES_SHA2\\BootLoader.com.gz"
IDR_BOOT_LOADER_SERPENT_SHA2 BIN "..\\Boot\\Windows\\Release_Serpent_SHA2\\BootLoader.com.gz"
IDR_BOOT_LOADER_TWOFISH_SHA2 BIN "..\\Boot\\Windows\\Release_Twofish_SHA2\\BootLoader.com.gz"
+IDR_BOOT_LOADER_CAMELLIA_SHA2 BIN "..\\Boot\\Windows\\Release_Camellia_SHA2\\BootLoader.com.gz"
IDR_RESCUE_BOOT_SECTOR BIN "..\\Boot\\Windows\\Rescue\\BootSector.bin"
IDR_RESCUE_BOOT_SECTOR_AES BIN "..\\Boot\\Windows\\Rescue_AES\\BootSector.bin"
IDR_RESCUE_BOOT_SECTOR_SERPENT BIN "..\\Boot\\Windows\\Rescue_Serpent\\BootSector.bin"
IDR_RESCUE_BOOT_SECTOR_TWOFISH BIN "..\\Boot\\Windows\\Rescue_Twofish\\BootSector.bin"
+IDR_RESCUE_BOOT_SECTOR_CAMELLIA BIN "..\\Boot\\Windows\\Rescue_Camellia\\BootSector.bin"
IDR_RESCUE_LOADER BIN "..\\Boot\\Windows\\Rescue\\BootLoader.com.gz"
IDR_RESCUE_LOADER_AES BIN "..\\Boot\\Windows\\Rescue_AES\\BootLoader.com.gz"
IDR_RESCUE_LOADER_SERPENT BIN "..\\Boot\\Windows\\Rescue_Serpent\\BootLoader.com.gz"
IDR_RESCUE_LOADER_TWOFISH BIN "..\\Boot\\Windows\\Rescue_Twofish\\BootLoader.com.gz"
+IDR_RESCUE_LOADER_CAMELLIA BIN "..\\Boot\\Windows\\Rescue_Camellia\\BootLoader.com.gz"
IDR_RESCUE_BOOT_SECTOR_SHA2 BIN "..\\Boot\\Windows\\Rescue_SHA2\\BootSector.bin"
IDR_RESCUE_BOOT_SECTOR_AES_SHA2 BIN "..\\Boot\\Windows\\Rescue_AES_SHA2\\BootSector.bin"
IDR_RESCUE_BOOT_SECTOR_SERPENT_SHA2 BIN "..\\Boot\\Windows\\Rescue_Serpent_SHA2\\BootSector.bin"
IDR_RESCUE_BOOT_SECTOR_TWOFISH_SHA2 BIN "..\\Boot\\Windows\\Rescue_Twofish_SHA2\\BootSector.bin"
+IDR_RESCUE_BOOT_SECTOR_CAMELLIA_SHA2 BIN "..\\Boot\\Windows\\Rescue_Camellia_SHA2\\BootSector.bin"
IDR_RESCUE_LOADER_SHA2 BIN "..\\Boot\\Windows\\Rescue_SHA2\\BootLoader.com.gz"
IDR_RESCUE_LOADER_AES_SHA2 BIN "..\\Boot\\Windows\\Rescue_AES_SHA2\\BootLoader.com.gz"
IDR_RESCUE_LOADER_SERPENT_SHA2 BIN "..\\Boot\\Windows\\Rescue_Serpent_SHA2\\BootLoader.com.gz"
IDR_RESCUE_LOADER_TWOFISH_SHA2 BIN "..\\Boot\\Windows\\Rescue_Twofish_SHA2\\BootLoader.com.gz"
+IDR_RESCUE_LOADER_CAMELLIA_SHA2 BIN "..\\Boot\\Windows\\Rescue_Camellia_SHA2\\BootLoader.com.gz"
/////////////////////////////////////////////////////////////////////////////
//
diff --git a/src/Common/Crypto.c b/src/Common/Crypto.c
index e5a3218..134a171 100644
--- a/src/Common/Crypto.c
+++ b/src/Common/Crypto.c
@@ -52,6 +52,7 @@ static Cipher Ciphers[] =
{ AES, L"AES", 16, 32, AES_KS },
{ SERPENT, L"Serpent", 16, 32, 140*4 },
{ TWOFISH, L"Twofish", 16, 32, TWOFISH_KS },
+ { CAMELLIA, L"Camellia", 16, 32, CAMELLIA_KS },
#endif
{ 0, 0, 0, 0, 0 }
};
@@ -68,6 +69,7 @@ static EncryptionAlgorithm EncryptionAlgorithms[] =
{ { AES, 0 }, { XTS, 0 }, 1 },
{ { SERPENT, 0 }, { XTS, 0 }, 1 },
{ { TWOFISH, 0 }, { XTS, 0 }, 1 },
+ { { CAMELLIA, 0 }, { XTS, 0 }, 1 },
{ { TWOFISH, AES, 0 }, { XTS, 0 }, 1 },
{ { SERPENT, TWOFISH, AES, 0 }, { XTS, 0 }, 1 },
{ { AES, SERPENT, 0 }, { XTS, 0 }, 1 },
@@ -133,6 +135,12 @@ int CipherInit (int cipher, unsigned char *key, unsigned __int8 *ks)
case TWOFISH:
twofish_set_key ((TwofishInstance *)ks, (const u4byte *)key);
break;
+
+#if !defined (TC_WINDOWS_BOOT) || defined (TC_WINDOWS_BOOT_CAMELLIA)
+ case CAMELLIA:
+ camellia_set_key (key, ks);
+ break;
+#endif
default:
// Unknown/wrong cipher ID
@@ -158,6 +166,9 @@ void EncipherBlock(int cipher, void *data, void *ks)
case TWOFISH: twofish_encrypt (ks, data, data); break;
case SERPENT: serpent_encrypt (data, data, ks); break;
+#if !defined (TC_WINDOWS_BOOT) || defined (TC_WINDOWS_BOOT_CAMELLIA)
+ case CAMELLIA: camellia_encrypt (data, data, ks); break;
+#endif
default: TC_THROW_FATAL_EXCEPTION; // Unknown/wrong ID
}
}
@@ -210,6 +221,9 @@ void DecipherBlock(int cipher, void *data, void *ks)
{
case SERPENT: serpent_decrypt (data, data, ks); break;
case TWOFISH: twofish_decrypt (ks, data, data); break;
+#if !defined (TC_WINDOWS_BOOT) || defined (TC_WINDOWS_BOOT_CAMELLIA)
+ case CAMELLIA: camellia_decrypt (data, data, ks); break;
+#endif
#ifndef TC_WINDOWS_BOOT
case AES:
@@ -945,7 +959,7 @@ void DecryptDataUnitsCurrentThread (unsigned __int8 *buf, const UINT64_STRUCT *s
#else // TC_WINDOWS_BOOT_SINGLE_CIPHER_MODE
-#if !defined (TC_WINDOWS_BOOT_AES) && !defined (TC_WINDOWS_BOOT_SERPENT) && !defined (TC_WINDOWS_BOOT_TWOFISH)
+#if !defined (TC_WINDOWS_BOOT_AES) && !defined (TC_WINDOWS_BOOT_SERPENT) && !defined (TC_WINDOWS_BOOT_TWOFISH) && !defined (TC_WINDOWS_BOOT_CAMELLIA)
#error No cipher defined
#endif
@@ -960,6 +974,8 @@ void EncipherBlock(int cipher, void *data, void *ks)
serpent_encrypt (data, data, ks);
#elif defined (TC_WINDOWS_BOOT_TWOFISH)
twofish_encrypt (ks, data, data);
+#elif defined (TC_WINDOWS_BOOT_CAMELLIA)
+ camellia_encrypt (data, data, ks);
#endif
}
@@ -974,6 +990,8 @@ void DecipherBlock(int cipher, void *data, void *ks)
serpent_decrypt (data, data, ks);
#elif defined (TC_WINDOWS_BOOT_TWOFISH)
twofish_decrypt (ks, data, data);
+#elif defined (TC_WINDOWS_BOOT_CAMELLIA)
+ camellia_decrypt (data, data, ks);
#endif
}
diff --git a/src/Common/Crypto.h b/src/Common/Crypto.h
index 5d9fff9..28b5f8c 100644
--- a/src/Common/Crypto.h
+++ b/src/Common/Crypto.h
@@ -106,7 +106,8 @@ enum
NONE = 0,
AES,
SERPENT,
- TWOFISH
+ TWOFISH,
+ CAMELLIA
};
typedef struct
@@ -155,6 +156,8 @@ typedef struct
# define MAX_EXPANDED_KEY SERPENT_KS
# elif defined (TC_WINDOWS_BOOT_TWOFISH)
# define MAX_EXPANDED_KEY TWOFISH_KS
+# elif defined (TC_WINDOWS_BOOT_CAMELLIA)
+# define MAX_EXPANDED_KEY CAMELLIA_KS
# endif
#else
@@ -186,6 +189,9 @@ typedef struct
#ifndef TC_WINDOWS_BOOT
# include "Sha2.h"
# include "Whirlpool.h"
+# include "Camellia.h"
+#else
+# include "CamelliaSmall.h"
#endif
#include "GfMul.h"
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c
index d70dfbc..2beac6e 100644
--- a/src/Common/Dlgcode.c
+++ b/src/Common/Dlgcode.c
@@ -6415,7 +6415,7 @@ ResetCipherTest(HWND hwndDlg, int idTestCipher)
SetWindowText(GetDlgItem(hwndDlg, IDC_PLAINTEXT), L"0000000000000000");
SetWindowText(GetDlgItem(hwndDlg, IDC_CIPHERTEXT), L"0000000000000000");
- if (idTestCipher == AES || idTestCipher == SERPENT || idTestCipher == TWOFISH)
+ if (idTestCipher == AES || idTestCipher == SERPENT || idTestCipher == TWOFISH || idTestCipher == CAMELLIA)
{
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);
diff --git a/src/Common/Language.xml b/src/Common/Language.xml
index 99e260c..23a1da5 100644
--- a/src/Common/Language.xml
+++ b/src/Common/Language.xml
@@ -1399,6 +1399,7 @@
<string lang="en" key="PIM_TOO_BIG">Personal Iterations Multiplier (PIM) maximum value is 2147468.</string>
<control lang="en" key="IDC_SKIP_RESCUE_VERIFICATION">Skip Rescue Disk verification</control>
<control lang="en" key="IDC_HIDE_WAITING_DIALOG">Don't show wait message dialog when performing operations</control>
+ <string lang="en" key="CAMELLIA_HELP">Jointly developed by Mitsubishi Electric and NTT of Japan. First published on 2000. 256-bit key, 128-bit block. Mode of operation is XTS. It has been approved for use by the ISO/IEC, the European Union's NESSIE project and the Japanese CRYPTREC project.</string>
</localization>
<!-- XML Schema -->
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
diff --git a/src/Common/Resource.h b/src/Common/Resource.h
index 03d4266..de895b0 100644
--- a/src/Common/Resource.h
+++ b/src/Common/Resource.h
@@ -59,6 +59,14 @@
#define IDR_RESCUE_LOADER_AES_SHA2 555
#define IDR_RESCUE_LOADER_SERPENT_SHA2 556
#define IDR_RESCUE_LOADER_TWOFISH_SHA2 557
+#define IDR_BOOT_SECTOR_CAMELLIA 558
+#define IDR_BOOT_LOADER_CAMELLIA 559
+#define IDR_RESCUE_BOOT_SECTOR_CAMELLIA 560
+#define IDR_RESCUE_LOADER_CAMELLIA 561
+#define IDR_BOOT_SECTOR_CAMELLIA_SHA2 562
+#define IDR_BOOT_LOADER_CAMELLIA_SHA2 563
+#define IDR_RESCUE_BOOT_SECTOR_CAMELLIA_SHA2 564
+#define IDR_RESCUE_LOADER_CAMELLIA_SHA2 565
#define IDC_HW_AES_LABEL_LINK 5000
#define IDC_HW_AES 5001
#define IDC_PARALLELIZATION_LABEL_LINK 5002
@@ -203,7 +211,7 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
-#define _APS_NEXT_RESOURCE_VALUE 558
+#define _APS_NEXT_RESOURCE_VALUE 566
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 5138
#define _APS_NEXT_SYMED_VALUE 101
diff --git a/src/Common/Tcdefs.h b/src/Common/Tcdefs.h
index 2d8a6fe..015a18a 100644
--- a/src/Common/Tcdefs.h
+++ b/src/Common/Tcdefs.h
@@ -16,16 +16,16 @@
#define TC_APP_NAME "VeraCrypt"
-// Version displayed to user
-#define VERSION_STRING "1.17"
+// Version displayed to user
+#define VERSION_STRING "1.18-BETA9"
// Version number to compare against driver
#define VERSION_NUM 0x0117
// Release date
-#define TC_STR_RELEASE_DATE L"February 13th, 2016"
+#define TC_STR_RELEASE_DATE L"May 29th, 2016"
#define TC_RELEASE_DATE_YEAR 2016
-#define TC_RELEASE_DATE_MONTH 2
+#define TC_RELEASE_DATE_MONTH 5
#define BYTES_PER_KB 1024LL
#define BYTES_PER_MB 1048576LL
diff --git a/src/Common/Tests.c b/src/Common/Tests.c
index 9d9e811..81ba416 100644
--- a/src/Common/Tests.c
+++ b/src/Common/Tests.c
@@ -348,6 +348,35 @@ TWOFISH_TEST twofish_vectors[TWOFISH_TEST_COUNT] = {
0x6C, 0xB4, 0x56, 0x1C, 0x40, 0xBF, 0x0A, 0x97, 0x05, 0x93, 0x1C, 0xB6, 0xD4, 0x08, 0xE7, 0xFA
};
+// Camellia ECB test vectors
+#define CAMELLIA_TEST_COUNT 2
+
+typedef struct {
+ unsigned char key[32];
+ unsigned char plaintext[16];
+ unsigned char ciphertext[16];
+ } CAMELLIA_TEST;
+
+CAMELLIA_TEST camellia_vectors[CAMELLIA_TEST_COUNT] = {
+{
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x98,
+ 0x76, 0x54, 0x32, 0x10, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
+ 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x01, 0x23, 0x45, 0x67,
+ 0x89, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10,
+ 0x9A, 0xCC, 0x23, 0x7D, 0xFF, 0x16, 0xD7, 0x6C, 0x20, 0xEF, 0x7C, 0x91,
+ 0x9E, 0x3A, 0x75, 0x09
+},
+{
+ 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10,
+ 0x48, 0x81, 0xFF, 0x48, 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00,
+ 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, 0xFF, 0x48, 0xE6, 0x84, 0x42, 0x17,
+ 0x16, 0xFC, 0x0B, 0x01, 0xAE, 0xB5, 0xC6, 0x76, 0x51, 0x20, 0xF9, 0x5F,
+ 0xEA, 0x02, 0x47, 0x14, 0xAD, 0x5C, 0x4D, 0x84, 0xEA, 0x02, 0x47, 0x14,
+ 0xAD, 0x5C, 0x4D, 0x84
+}
+};
+
+
/* Test vectors from FIPS 198a, RFC 4231, RFC 2104, RFC 2202, and other sources. */
char *hmac_sha256_test_keys[] =
@@ -464,6 +493,10 @@ void CipherInit2(int cipher, void* key, void* ks, int key_len)
case TWOFISH:
CipherInit(cipher,key,ks);
break;
+
+ case CAMELLIA:
+ CipherInit(cipher,key,ks);
+ break;
default:
/* Unknown/wrong ID */
@@ -625,6 +658,32 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
break;
}
}
+ else if (wcscmp (name, L"Camellia") == 0)
+ {
+ switch (testCase)
+ {
+ case 0:
+ if (crc != 0x2436badb)
+ return FALSE;
+ nTestsPerformed++;
+ break;
+ case 1:
+ if (crc != 0x247d2272)
+ return FALSE;
+ nTestsPerformed++;
+ break;
+ case 2:
+ if (crc != 0x72b49cde)
+ return FALSE;
+ nTestsPerformed++;
+ break;
+ case 3:
+ if (crc != 0xb838d2c1)
+ return FALSE;
+ nTestsPerformed++;
+ break;
+ }
+ }
else if (wcscmp (name, L"AES-Twofish") == 0)
{
switch (testCase)
@@ -819,6 +878,12 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
return FALSE;
nTestsPerformed++;
}
+ else if (wcscmp (name, L"Camellia") == 0)
+ {
+ if (crc != 0x8176b223)
+ return FALSE;
+ nTestsPerformed++;
+ }
else if (wcscmp (name, L"AES-Twofish") == 0)
{
if (crc != 0x14ce7385)
@@ -861,7 +926,7 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
nTestsPerformed++;
}
- return (nTestsPerformed == 80);
+ return (nTestsPerformed == 90);
}
static BOOL DoAutoTestAlgorithms (void)
@@ -963,6 +1028,26 @@ static BOOL DoAutoTestAlgorithms (void)
}
if (i != TWOFISH_TEST_COUNT)
bFailed = TRUE;
+
+ /* Camellia */
+
+ for (i = 0; i < CAMELLIA_TEST_COUNT; i++)
+ {
+ int cipher = CAMELLIA;
+ memcpy(key, camellia_vectors[i].key, 32);
+ memcpy(tmp, camellia_vectors[i].plaintext, 16);
+ CipherInit(cipher, key, ks_tmp);
+
+ EncipherBlock(cipher, tmp, ks_tmp);
+ if (memcmp(camellia_vectors[i].ciphertext, tmp, 16) != 0)
+ break;
+
+ DecipherBlock(cipher, tmp, ks_tmp);
+ if (memcmp(camellia_vectors[i].plaintext, tmp, 16) != 0)
+ break;
+ }
+ if (i != CAMELLIA_TEST_COUNT)
+ bFailed = TRUE;
/* PKCS #5 and HMACs */
diff --git a/src/Common/Volumes.c b/src/Common/Volumes.c
index 007a1c0..2f30a33 100644
--- a/src/Common/Volumes.c
+++ b/src/Common/Volumes.c
@@ -667,6 +667,8 @@ int ReadVolumeHeader (BOOL bBoot, char *header, Password *password, int pim, PCR
serpent_set_key (dk, cryptoInfo->ks);
#elif defined (TC_WINDOWS_BOOT_TWOFISH)
twofish_set_key ((TwofishInstance *) cryptoInfo->ks, (const u4byte *) dk);
+ #elif defined (TC_WINDOWS_BOOT_CAMELLIA)
+ camellia_set_key (dk, cryptoInfo->ks);
#else
status = EAInit (dk, cryptoInfo->ks);
if (status == ERR_CIPHER_INIT_FAILURE)
@@ -683,6 +685,8 @@ int ReadVolumeHeader (BOOL bBoot, char *header, Password *password, int pim, PCR
serpent_set_key (dk + 32, cryptoInfo->ks2);
#elif defined (TC_WINDOWS_BOOT_TWOFISH)
twofish_set_key ((TwofishInstance *)cryptoInfo->ks2, (const u4byte *) (dk + 32));
+ #elif defined (TC_WINDOWS_BOOT_CAMELLIA)
+ camellia_set_key (dk + 32, cryptoInfo->ks2);
#else
EAInit (dk + 32, cryptoInfo->ks2);
#endif
@@ -742,6 +746,8 @@ int ReadVolumeHeader (BOOL bBoot, char *header, Password *password, int pim, PCR
serpent_set_key (dk, cryptoInfo->ks);
#elif defined (TC_WINDOWS_BOOT_TWOFISH)
twofish_set_key ((TwofishInstance *) cryptoInfo->ks, (const u4byte *) dk);
+ #elif defined (TC_WINDOWS_BOOT_CAMELLIA)
+ camellia_set_key (dk, cryptoInfo->ks);
#else
status = EAInit (dk, cryptoInfo->ks);
if (status == ERR_CIPHER_INIT_FAILURE)
@@ -759,6 +765,8 @@ int ReadVolumeHeader (BOOL bBoot, char *header, Password *password, int pim, PCR
serpent_set_key (dk + 32, cryptoInfo->ks2);
#elif defined (TC_WINDOWS_BOOT_TWOFISH)
twofish_set_key ((TwofishInstance *)cryptoInfo->ks2, (const u4byte *) (dk + 32));
+ #elif defined (TC_WINDOWS_BOOT_CAMELLIA)
+ camellia_set_key (dk + 32, cryptoInfo->ks2);
#else
EAInit (dk + 32, cryptoInfo->ks2);
#endif