]>
git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Library/BaseCryptLib/Kdf/CryptHkdfNull.c
2 HMAC-SHA256 KDF Wrapper Implementation which does not provide real capabilities.
4 Copyright (c) 2018 - 2022, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #include <Library/BaseCryptLib.h>
10 #include <Library/DebugLib.h>
13 Derive key data using HMAC-SHA256 based KDF.
15 @param[in] Key Pointer to the user-supplied key.
16 @param[in] KeySize Key size in bytes.
17 @param[in] Salt Pointer to the salt(non-secret) value.
18 @param[in] SaltSize Salt size in bytes.
19 @param[in] Info Pointer to the application specific info.
20 @param[in] InfoSize Info size in bytes.
21 @param[out] Out Pointer to buffer to receive hkdf value.
22 @param[in] OutSize Size of hkdf bytes to generate.
24 @retval TRUE Hkdf generated successfully.
25 @retval FALSE Hkdf generation failed.
30 HkdfSha256ExtractAndExpand (
46 Derive SHA256 HMAC-based Extract key Derivation Function (HKDF).
48 @param[in] Key Pointer to the user-supplied key.
49 @param[in] KeySize key size in bytes.
50 @param[in] Salt Pointer to the salt(non-secret) value.
51 @param[in] SaltSize salt size in bytes.
52 @param[out] PrkOut Pointer to buffer to receive hkdf value.
53 @param[in] PrkOutSize size of hkdf bytes to generate.
55 @retval true Hkdf generated successfully.
56 @retval false Hkdf generation failed.
75 Derive SHA256 HMAC-based Expand Key Derivation Function (HKDF).
77 @param[in] Prk Pointer to the user-supplied key.
78 @param[in] PrkSize Key size in bytes.
79 @param[in] Info Pointer to the application specific info.
80 @param[in] InfoSize Info size in bytes.
81 @param[out] Out Pointer to buffer to receive hkdf value.
82 @param[in] OutSize Size of hkdf bytes to generate.
84 @retval TRUE Hkdf generated successfully.
85 @retval FALSE Hkdf generation failed.
104 Derive SHA384 HMAC-based Extract-and-Expand Key Derivation Function (HKDF).
106 @param[in] Key Pointer to the user-supplied key.
107 @param[in] KeySize Key size in bytes.
108 @param[in] Salt Pointer to the salt(non-secret) value.
109 @param[in] SaltSize Salt size in bytes.
110 @param[in] Info Pointer to the application specific info.
111 @param[in] InfoSize Info size in bytes.
112 @param[out] Out Pointer to buffer to receive hkdf value.
113 @param[in] OutSize Size of hkdf bytes to generate.
115 @retval TRUE Hkdf generated successfully.
116 @retval FALSE Hkdf generation failed.
121 HkdfSha384ExtractAndExpand (
124 IN CONST UINT8
*Salt
,
126 IN CONST UINT8
*Info
,
137 Derive SHA384 HMAC-based Extract key Derivation Function (HKDF).
139 @param[in] Key Pointer to the user-supplied key.
140 @param[in] KeySize key size in bytes.
141 @param[in] Salt Pointer to the salt(non-secret) value.
142 @param[in] SaltSize salt size in bytes.
143 @param[out] PrkOut Pointer to buffer to receive hkdf value.
144 @param[in] PrkOutSize size of hkdf bytes to generate.
146 @retval true Hkdf generated successfully.
147 @retval false Hkdf generation failed.
155 IN CONST UINT8
*Salt
,
166 Derive SHA384 HMAC-based Expand Key Derivation Function (HKDF).
168 @param[in] Prk Pointer to the user-supplied key.
169 @param[in] PrkSize Key size in bytes.
170 @param[in] Info Pointer to the application specific info.
171 @param[in] InfoSize Info size in bytes.
172 @param[out] Out Pointer to buffer to receive hkdf value.
173 @param[in] OutSize Size of hkdf bytes to generate.
175 @retval TRUE Hkdf generated successfully.
176 @retval FALSE Hkdf generation failed.
184 IN CONST UINT8
*Info
,