From 595277722687027806cb2ce038e40fb4ee18c0ef Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 15 Jun 2026 12:31:01 +0900 Subject: [PATCH] Update Format DLL SDK for VeraCrypt 1.26.29 Keep Argon2 symbols internal unless explicitly exported so VeraCryptFormat.dll exposes only the SDK API. Add Argon2id/BLAKE2b aliases for the SDK hash selector and update the public header comment to reflect the supported KDF/hash set. --- src/Crypto/Argon2/include/argon2.h | 2 +- src/FormatDLL/VeraCryptFormatSDK.cpp | 5 ++++- src/FormatDLL/VeraCryptFormatSDK.h | 10 +++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/Crypto/Argon2/include/argon2.h b/src/Crypto/Argon2/include/argon2.h index 49239967..d7fcd6ff 100644 --- a/src/Crypto/Argon2/include/argon2.h +++ b/src/Crypto/Argon2/include/argon2.h @@ -41,7 +41,7 @@ extern "C" { #ifdef A2_VISCTL #define ARGON2_PUBLIC __attribute__((visibility("default"))) #define ARGON2_LOCAL __attribute__ ((visibility ("hidden"))) -#elif defined(_MSC_VER) +#elif defined(_MSC_VER) && defined(ARGON2_EXPORTS) #define ARGON2_PUBLIC __declspec(dllexport) #define ARGON2_LOCAL #else diff --git a/src/FormatDLL/VeraCryptFormatSDK.cpp b/src/FormatDLL/VeraCryptFormatSDK.cpp index dbbc14d7..23b0533b 100644 --- a/src/FormatDLL/VeraCryptFormatSDK.cpp +++ b/src/FormatDLL/VeraCryptFormatSDK.cpp @@ -110,6 +110,9 @@ static int MapHashAlgorithm(const wchar_t* hashName) if (_wcsicmp(hashName, L"sha256") == 0) return SHA256; if (_wcsicmp(hashName, L"sha512") == 0) return SHA512; if (_wcsicmp(hashName, L"argon2") == 0) return ARGON2; + if (_wcsicmp(hashName, L"argon2id") == 0) return ARGON2; + if (_wcsicmp(hashName, L"BLAKE2b") == 0) return ARGON2; + if (_wcsicmp(hashName, L"BLAKE2b-512") == 0) return ARGON2; return 0; // Not found } @@ -399,4 +402,4 @@ extern "C" } return TRUE; } -} \ No newline at end of file +} diff --git a/src/FormatDLL/VeraCryptFormatSDK.h b/src/FormatDLL/VeraCryptFormatSDK.h index 6f971e22..a8be7a0a 100644 --- a/src/FormatDLL/VeraCryptFormatSDK.h +++ b/src/FormatDLL/VeraCryptFormatSDK.h @@ -18,7 +18,7 @@ * around the core logic from Tcformat.c and related VeraCrypt source files. * * First created by Mounir IDRASSI (mounir.idrassi@amcrypto.jp) - * + * */ #pragma once @@ -66,7 +66,7 @@ typedef struct _VeraCryptFormatOptions /** The encryption algorithm to use. E.g., L"AES", L"Serpent", L"Twofish", L"AES-Twofish-Serpent". */ const wchar_t* encryptionAlgorithm; - /** The header key derivation algorithm and random pool hash selector. E.g., L"Argon2" (Argon2id KDF), L"SHA-512", L"RIPEMD-160", L"Whirlpool", L"BLAKE2s-256", L"SHA-256". */ + /** The header key derivation algorithm and random pool hash selector. E.g., L"Argon2" (Argon2id KDF), L"SHA-512", L"SHA-256", L"Whirlpool", L"BLAKE2s-256", L"Streebog". */ const wchar_t* hashAlgorithm; /** The filesystem for the new volume. E.g., L"NTFS", L"FAT", L"ExFAT", L"ReFS", or L"None". */ @@ -74,10 +74,10 @@ typedef struct _VeraCryptFormatOptions /** The cluster size in sectors (e.g., 1, 2, 4, 8...). Use 0 for default. */ int clusterSize; - + /** If TRUE, performs a quick format. This is faster but less secure as old data is not overwritten. */ BOOL quickFormat; - + /** If TRUE, creates a dynamically-expanding (sparse) file container. Only for file containers. Implies quickFormat=TRUE. */ BOOL dynamicFormat; @@ -159,4 +159,4 @@ VCF_API int __cdecl VeraCryptFormat(const VeraCryptFormatOptions* options); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif