Skip to content

Commit 5952777

Browse files
committed
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.
1 parent ba47679 commit 5952777

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

src/Crypto/Argon2/include/argon2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ extern "C" {
4141
#ifdef A2_VISCTL
4242
#define ARGON2_PUBLIC __attribute__((visibility("default")))
4343
#define ARGON2_LOCAL __attribute__ ((visibility ("hidden")))
44-
#elif defined(_MSC_VER)
44+
#elif defined(_MSC_VER) && defined(ARGON2_EXPORTS)
4545
#define ARGON2_PUBLIC __declspec(dllexport)
4646
#define ARGON2_LOCAL
4747
#else

src/FormatDLL/VeraCryptFormatSDK.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ static int MapHashAlgorithm(const wchar_t* hashName)
110110
if (_wcsicmp(hashName, L"sha256") == 0) return SHA256;
111111
if (_wcsicmp(hashName, L"sha512") == 0) return SHA512;
112112
if (_wcsicmp(hashName, L"argon2") == 0) return ARGON2;
113+
if (_wcsicmp(hashName, L"argon2id") == 0) return ARGON2;
114+
if (_wcsicmp(hashName, L"BLAKE2b") == 0) return ARGON2;
115+
if (_wcsicmp(hashName, L"BLAKE2b-512") == 0) return ARGON2;
113116
return 0; // Not found
114117
}
115118

@@ -399,4 +402,4 @@ extern "C"
399402
}
400403
return TRUE;
401404
}
402-
}
405+
}

src/FormatDLL/VeraCryptFormatSDK.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* around the core logic from Tcformat.c and related VeraCrypt source files.
1919
*
2020
* First created by Mounir IDRASSI (mounir.idrassi@amcrypto.jp)
21-
*
21+
*
2222
*/
2323

2424
#pragma once
@@ -66,18 +66,18 @@ typedef struct _VeraCryptFormatOptions
6666
/** The encryption algorithm to use. E.g., L"AES", L"Serpent", L"Twofish", L"AES-Twofish-Serpent". */
6767
const wchar_t* encryptionAlgorithm;
6868

69-
/** 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". */
69+
/** 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". */
7070
const wchar_t* hashAlgorithm;
7171

7272
/** The filesystem for the new volume. E.g., L"NTFS", L"FAT", L"ExFAT", L"ReFS", or L"None". */
7373
const wchar_t* filesystem;
7474

7575
/** The cluster size in sectors (e.g., 1, 2, 4, 8...). Use 0 for default. */
7676
int clusterSize;
77-
77+
7878
/** If TRUE, performs a quick format. This is faster but less secure as old data is not overwritten. */
7979
BOOL quickFormat;
80-
80+
8181
/** If TRUE, creates a dynamically-expanding (sparse) file container. Only for file containers. Implies quickFormat=TRUE. */
8282
BOOL dynamicFormat;
8383

@@ -159,4 +159,4 @@ VCF_API int __cdecl VeraCryptFormat(const VeraCryptFormatOptions* options);
159159

160160
#ifdef __cplusplus
161161
}
162-
#endif
162+
#endif

0 commit comments

Comments
 (0)