]> git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Library/BaseCryptLibNull/Pk/CryptPkcs5Pbkdf2Null.c
CryptoPkg: Add Null instance of the BaseCryptLib class
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLibNull / Pk / CryptPkcs5Pbkdf2Null.c
1 /** @file
2 PBKDF2 Key Derivation Function Wrapper Implementation which does not provide real
3 capabilities.
4
5 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #include "InternalCryptLib.h"
11
12 /**
13 Derives a key from a password using a salt and iteration count, based on PKCS#5 v2.0
14 password based encryption key derivation function PBKDF2, as specified in RFC 2898.
15
16 Return FALSE to indicate this interface is not supported.
17
18 @param[in] PasswordLength Length of input password in bytes.
19 @param[in] Password Pointer to the array for the password.
20 @param[in] SaltLength Size of the Salt in bytes.
21 @param[in] Salt Pointer to the Salt.
22 @param[in] IterationCount Number of iterations to perform. Its value should be
23 greater than or equal to 1.
24 @param[in] DigestSize Size of the message digest to be used (eg. SHA256_DIGEST_SIZE).
25 NOTE: DigestSize will be used to determine the hash algorithm.
26 Only SHA1_DIGEST_SIZE or SHA256_DIGEST_SIZE is supported.
27 @param[in] KeyLength Size of the derived key buffer in bytes.
28 @param[out] OutKey Pointer to the output derived key buffer.
29
30 @retval FALSE This interface is not supported.
31
32 **/
33 BOOLEAN
34 EFIAPI
35 Pkcs5HashPassword (
36 IN UINTN PasswordLength,
37 IN CONST CHAR8 *Password,
38 IN UINTN SaltLength,
39 IN CONST UINT8 *Salt,
40 IN UINTN IterationCount,
41 IN UINTN DigestSize,
42 IN UINTN KeyLength,
43 OUT UINT8 *OutKey
44 )
45 {
46 ASSERT (FALSE);
47 return FALSE;
48 }