VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Crypto.h
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2019-01-21 00:42:53 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2019-01-21 00:45:31 +0100
commitee0a2659da24b4b7543f52647fb2d8cbbd12408c (patch)
tree2977c82ee2d24d4c0bfd18a30b3f0fe7b4b25601 /src/Common/Crypto.h
parent27b3fee02d5242e743f87dd15db61d89073e8caa (diff)
downloadVeraCrypt-ee0a2659da24b4b7543f52647fb2d8cbbd12408c.tar.gz
VeraCrypt-ee0a2659da24b4b7543f52647fb2d8cbbd12408c.zip
Windows driver: remove volumes master keys from CRYPTO_INFO since they are not needed after their key schedule is created
Diffstat (limited to 'src/Common/Crypto.h')
-rw-r--r--src/Common/Crypto.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Common/Crypto.h b/src/Common/Crypto.h
index 6021c42f..27bc723f 100644
--- a/src/Common/Crypto.h
+++ b/src/Common/Crypto.h
@@ -245,8 +245,12 @@ typedef struct CRYPTO_INFO_t
#ifndef TC_WINDOWS_BOOT
uint16 HeaderVersion;
+#ifdef TC_WINDOWS_DRIVER
+ unsigned __int8 master_keydata_hash[SHA512_DIGESTSIZE];
+#else
CRYPTOPP_ALIGN_DATA(16) unsigned __int8 master_keydata[MASTER_KEYDATA_SIZE]; /* This holds the volume header area containing concatenated master key(s) and secondary key(s) (XTS mode). For LRW (deprecated/legacy), it contains the tweak key before the master key(s). For CBC (deprecated/legacy), it contains the IV seed before the master key(s). */
CRYPTOPP_ALIGN_DATA(16) unsigned __int8 k2[MASTER_KEYDATA_SIZE]; /* For XTS, this contains the secondary key (if cascade, multiple concatenated). For LRW (deprecated/legacy), it contains the tweak key. For CBC (deprecated/legacy), it contains the IV seed. */
+#endif
int noIterations;
BOOL bTrueCryptMode;
@@ -320,7 +324,7 @@ int EAInit (int ea, unsigned char *key, unsigned char *ks);
#else
int EAInit (unsigned char *key, unsigned char *ks);
#endif
-BOOL EAInitMode (PCRYPTO_INFO ci);
+BOOL EAInitMode (PCRYPTO_INFO ci, unsigned char* key2);
void EncipherBlock(int cipher, void *data, void *ks);
void DecipherBlock(int cipher, void *data, void *ks);
#ifndef TC_WINDOWS_BOOT