9#include "InternalCryptLib.h"
10#include <mbedtls/pkcs5.h>
50 mbedtls_md_type_t HashAlg;
55 if ((Password ==
NULL) || (Salt ==
NULL) || (OutKey ==
NULL)) {
59 if ((PasswordLength == 0) || (PasswordLength > INT_MAX) ||
60 (SaltLength == 0) || (SaltLength > INT_MAX) ||
61 (KeyLength == 0) || (KeyLength > INT_MAX) ||
62 (IterationCount < 1) || (IterationCount > INT_MAX))
72 HashAlg = MBEDTLS_MD_SHA1;
75 HashAlg = MBEDTLS_MD_SHA256;
85 if (mbedtls_pkcs5_pbkdf2_hmac_ext (
87 (
CONST UINT8 *)Password,
#define SHA256_DIGEST_SIZE
BOOLEAN EFIAPI Pkcs5HashPassword(IN UINTN PasswordLength, IN CONST CHAR8 *Password, IN UINTN SaltLength, IN CONST UINT8 *Salt, IN UINTN IterationCount, IN UINTN DigestSize, IN UINTN KeyLength, OUT UINT8 *OutKey)