From c27461572ca09705c16f26a1e9128ff3a4ebdda0 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Tue, 16 Dec 2014 00:14:42 +0100 Subject: 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. --- src/Common/Crypto.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/Common/Crypto.h') 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); -- cgit v1.2.3