mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-05-22 12:31:31 +00:00
Windows: Add support for Argon2id as an alternative to PBKDF2 key derivation
This commit is contained in:
@@ -100,6 +100,7 @@ typedef struct EncryptionThreadPoolWorkItemStruct
|
||||
LONG *CompletionFlag;
|
||||
unsigned char *DerivedKey;
|
||||
int IterationCount;
|
||||
int Memorycost;
|
||||
TC_EVENT *NoOutstandingWorkItemEvent;
|
||||
LONG *OutstandingWorkItemCount;
|
||||
unsigned char *Password;
|
||||
@@ -267,6 +268,11 @@ static TC_THREAD_PROC EncryptionThreadProc (void *threadArg)
|
||||
workItem->KeyDerivation.IterationCount, workItem->KeyDerivation.DerivedKey, GetMaxPkcs5OutSize());
|
||||
break;
|
||||
|
||||
case ARGON2:
|
||||
derive_key_argon2(workItem->KeyDerivation.Password, workItem->KeyDerivation.PasswordLength, workItem->KeyDerivation.Salt, PKCS5_SALT_SIZE,
|
||||
workItem->KeyDerivation.IterationCount, workItem->KeyDerivation.Memorycost, workItem->KeyDerivation.DerivedKey, GetMaxPkcs5OutSize());
|
||||
break;
|
||||
|
||||
default:
|
||||
TC_THROW_FATAL_EXCEPTION;
|
||||
}
|
||||
@@ -527,7 +533,7 @@ void EncryptionThreadPoolStop ()
|
||||
}
|
||||
|
||||
|
||||
void EncryptionThreadPoolBeginKeyDerivation (TC_EVENT *completionEvent, TC_EVENT *noOutstandingWorkItemEvent, LONG *completionFlag, LONG *outstandingWorkItemCount, int pkcs5Prf, unsigned char *password, int passwordLength, unsigned char *salt, int iterationCount, unsigned char *derivedKey)
|
||||
void EncryptionThreadPoolBeginKeyDerivation (TC_EVENT *completionEvent, TC_EVENT *noOutstandingWorkItemEvent, LONG *completionFlag, LONG *outstandingWorkItemCount, int pkcs5Prf, unsigned char *password, int passwordLength, unsigned char *salt, int iterationCount, int memoryCost, unsigned char *derivedKey)
|
||||
{
|
||||
EncryptionThreadPoolWorkItem *workItem;
|
||||
|
||||
@@ -550,6 +556,7 @@ void EncryptionThreadPoolBeginKeyDerivation (TC_EVENT *completionEvent, TC_EVENT
|
||||
workItem->KeyDerivation.CompletionFlag = completionFlag;
|
||||
workItem->KeyDerivation.DerivedKey = derivedKey;
|
||||
workItem->KeyDerivation.IterationCount = iterationCount;
|
||||
workItem->KeyDerivation.Memorycost = memoryCost;
|
||||
workItem->KeyDerivation.NoOutstandingWorkItemEvent = noOutstandingWorkItemEvent;
|
||||
workItem->KeyDerivation.OutstandingWorkItemCount = outstandingWorkItemCount;
|
||||
workItem->KeyDerivation.Password = password;
|
||||
|
||||
Reference in New Issue
Block a user