diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2014-12-16 00:14:42 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2014-12-16 00:17:59 +0100 |
commit | c27461572ca09705c16f26a1e9128ff3a4ebdda0 (patch) | |
tree | 41eff1e362c745d21e0cf90cb7d276dfb3cfff66 /src/Common/Crypto.h | |
parent | 634916230311eed9c6969aa516f4b9601438f9d3 (diff) | |
download | VeraCrypt-c27461572ca09705c16f26a1e9128ff3a4ebdda0.tar.gz VeraCrypt-c27461572ca09705c16f26a1e9128ff3a4ebdda0.zip |
Windows: Enhance performance by implementing the possibility to choose the correct hash algorithm of volumes during various operations (mount, change password...). In case of system encryption, slightly speedup Windows startup time by making the driver pickup the correct hash algorithm used for the encryption.
Diffstat (limited to 'src/Common/Crypto.h')
-rw-r--r-- | src/Common/Crypto.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/Common/Crypto.h b/src/Common/Crypto.h index a6ed56d2..4695239b 100644 --- a/src/Common/Crypto.h +++ b/src/Common/Crypto.h @@ -196,6 +196,7 @@ typedef struct CRYPTO_INFO_t {
int ea; /* Encryption algorithm ID */
int mode; /* Mode of operation (e.g., XTS) */
+ int pkcs5; /* PRF algorithm */
unsigned __int8 ks[MAX_EXPANDED_KEY]; /* Primary key schedule (if it is a cascade, it conatins multiple concatenated keys) */
unsigned __int8 ks2[MAX_EXPANDED_KEY]; /* Secondary key schedule (if cascade, multiple concatenated) for XTS mode. */
@@ -240,10 +241,26 @@ typedef struct CRYPTO_INFO_t UINT64_STRUCT EncryptedAreaLength;
uint32 HeaderFlags;
- int pkcs5;
} CRYPTO_INFO, *PCRYPTO_INFO;
+#ifdef _WIN32
+
+#pragma pack (push)
+#pragma pack(1)
+
+typedef struct BOOT_CRYPTO_HEADER_t
+{
+ __int16 ea; /* Encryption algorithm ID */
+ __int16 mode; /* Mode of operation (e.g., XTS) */
+ __int16 pkcs5; /* PRF algorithm */
+
+} BOOT_CRYPTO_HEADER, *PBOOT_CRYPTO_HEADER;
+
+#pragma pack (pop)
+
+#endif
+
PCRYPTO_INFO crypto_open (void);
void crypto_loadkey (PKEY_INFO keyInfo, char *lpszUserKey, int nUserKeyLen);
void crypto_close (PCRYPTO_INFO cryptoInfo);
@@ -300,6 +317,7 @@ const char *HashGetName (int hash_algo_id);
#ifndef TC_WINDOWS_BOOT
+Hash *HashGet (int id);
void HashGetName2 (char *buf, int hashId);
BOOL HashIsDeprecated (int hashId);
BOOL HashForSystemEncryption (int hashId);
|