From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id B63C27803CD for ; Wed, 30 Aug 2023 07:52:37 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=wbOj5NeUfZ5iWbq0DRYpd1oJJtbmB/o7nDiEn8wPwXE=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1693381956; v=1; b=RMXOJcmYzk6e4w1bs4NDdtf/i3PPHSNP1ePJl5hFotgfRDgaH9MWWrKN7y1qkDNVJD6Wys+E EsjjaA6kOUbsElEwvXs3K4IdBUP1iGTtabDXLjW/xAnSyvrNCdKuP3Ls8EL51L2ziCpcLAy9k/A fC9v8/M26dG2XzTNp7jchV/E= X-Received: by 127.0.0.2 with SMTP id 7qfuYY7687511xzpgwlnd78U; Wed, 30 Aug 2023 00:52:36 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.9013.1693381945374772998 for ; Wed, 30 Aug 2023 00:52:35 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10817"; a="378289191" X-IronPort-AV: E=Sophos;i="6.02,212,1688454000"; d="scan'208";a="378289191" X-Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2023 00:52:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10817"; a="742139756" X-IronPort-AV: E=Sophos;i="6.02,212,1688454000"; d="scan'208";a="742139756" X-Received: from shwdejointd777.ccr.corp.intel.com ([10.239.58.116]) by fmsmga007.fm.intel.com with ESMTP; 30 Aug 2023 00:52:29 -0700 From: "Wenxing Hou" To: devel@edk2.groups.io Cc: Jiewen Yao , Yi Li , Xiaoyu Lu , Guomin Jiang Subject: [edk2-devel] [edk2/add_mbedtls PATCH 4/9] CryptoPkg: Add HKDF functions based on Mbedtls Date: Wed, 30 Aug 2023 15:52:15 +0800 Message-Id: <20230830075220.2070-5-wenxing.hou@intel.com> In-Reply-To: <20230830075220.2070-1-wenxing.hou@intel.com> References: <20230830075220.2070-1-wenxing.hou@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,wenxing.hou@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: eFR10Cp961cIM61ldjHjAPN0x7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=RMXOJcmY; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Add HKDF APIs. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4177 Cc: Jiewen Yao cc: Yi Li Cc: Xiaoyu Lu Cc: Guomin Jiang Signed-off-by: Wenxing Hou --- .../BaseCryptLibMbedTls/Kdf/CryptHkdf.c | 372 ++++++++++++++++++ .../BaseCryptLibMbedTls/Kdf/CryptHkdfNull.c | 192 +++++++++ 2 files changed, 564 insertions(+) create mode 100644 CryptoPkg/Library/BaseCryptLibMbedTls/Kdf/CryptHkdf.c create mode 100644 CryptoPkg/Library/BaseCryptLibMbedTls/Kdf/CryptHkdfNull= .c diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/Kdf/CryptHkdf.c b/Crypto= Pkg/Library/BaseCryptLibMbedTls/Kdf/CryptHkdf.c new file mode 100644 index 0000000000..5bc632deb9 --- /dev/null +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/Kdf/CryptHkdf.c @@ -0,0 +1,372 @@ +/** @file=0D + HMAC-SHA256 KDF Wrapper Implementation over MbedTLS.=0D +=0D + RFC 5869: HMAC-based Extract-and-Expand Key Derivation Function (HKDF)=0D +=0D +Copyright (c) 2023, Intel Corporation. All rights reserved.
=0D +SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +#include "InternalCryptLib.h"=0D +#include =0D +=0D +/**=0D + Derive HMAC-based Extract-and-Expand Key Derivation Function (HKDF).=0D +=0D + @param[in] MdType Message Digest Type.=0D + @param[in] Key Pointer to the user-supplied key.=0D + @param[in] KeySize Key size in bytes.=0D + @param[in] Salt Pointer to the salt(non-secret) value.=0D + @param[in] SaltSize Salt size in bytes.=0D + @param[in] Info Pointer to the application specific info.= =0D + @param[in] InfoSize Info size in bytes.=0D + @param[out] Out Pointer to buffer to receive hkdf value.=0D + @param[in] OutSize Size of hkdf bytes to generate.=0D +=0D + @retval TRUE Hkdf generated successfully.=0D + @retval FALSE Hkdf generation failed.=0D +=0D +**/=0D +STATIC=0D +BOOLEAN=0D +HkdfMdExtractAndExpand (=0D + IN mbedtls_md_type_t MdType,=0D + IN CONST UINT8 *Key,=0D + IN UINTN KeySize,=0D + IN CONST UINT8 *Salt,=0D + IN UINTN SaltSize,=0D + IN CONST UINT8 *Info,=0D + IN UINTN InfoSize,=0D + OUT UINT8 *Out,=0D + IN UINTN OutSize=0D + )=0D +{=0D + const mbedtls_md_info_t *md;=0D + INT32 Ret;=0D +=0D + if ((Key =3D=3D NULL) || (Salt =3D=3D NULL) || (Info =3D=3D NULL) || (Ou= t =3D=3D NULL) ||=0D + (KeySize > INT_MAX) || (SaltSize > INT_MAX) || (InfoSize > INT_MAX) = || (OutSize > INT_MAX))=0D + {=0D + return FALSE;=0D + }=0D +=0D + md =3D mbedtls_md_info_from_type (MdType);=0D + ASSERT (md !=3D NULL);=0D +=0D + Ret =3D mbedtls_hkdf (md, Salt, (UINT32)SaltSize, Key, (UINT32)KeySize, = Info, (UINT32)InfoSize, Out, (UINT32)OutSize);=0D + if (Ret !=3D 0) {=0D + return FALSE;=0D + }=0D +=0D + return TRUE;=0D +}=0D +=0D +/**=0D + Derive HMAC-based Extract Key Derivation Function (HKDF).=0D +=0D + @param[in] MdType Message Digest Type.=0D + @param[in] Key Pointer to the user-supplied key.=0D + @param[in] KeySize Key size in bytes.=0D + @param[in] Salt Pointer to the salt(non-secret) value.=0D + @param[in] SaltSize Salt size in bytes.=0D + @param[out] PrkOut Pointer to buffer to receive hkdf value.=0D + @param[in] PrkOutSize Size of hkdf bytes to generate.=0D +=0D + @retval TRUE Hkdf generated successfully.=0D + @retval FALSE Hkdf generation failed.=0D +=0D +**/=0D +STATIC=0D +BOOLEAN=0D +HkdfMdExtract (=0D + IN mbedtls_md_type_t MdType,=0D + IN CONST UINT8 *Key,=0D + IN UINTN KeySize,=0D + IN CONST UINT8 *Salt,=0D + IN UINTN SaltSize,=0D + OUT UINT8 *PrkOut,=0D + IN UINTN PrkOutSize=0D + )=0D +{=0D + const mbedtls_md_info_t *md;=0D + INT32 Ret;=0D + UINTN MdSize;=0D +=0D + if ((Key =3D=3D NULL) || (Salt =3D=3D NULL) || (PrkOut =3D=3D NULL) ||=0D + (KeySize > INT_MAX) || (SaltSize > INT_MAX) || (PrkOutSize > INT_MAX= ))=0D + {=0D + return FALSE;=0D + }=0D +=0D + MdSize =3D 0;=0D + switch (MdType) {=0D + case MBEDTLS_MD_SHA256:=0D + MdSize =3D SHA256_DIGEST_SIZE;=0D + break;=0D + case MBEDTLS_MD_SHA384:=0D + MdSize =3D SHA384_DIGEST_SIZE;=0D + break;=0D + case MBEDTLS_MD_SHA512:=0D + MdSize =3D SHA512_DIGEST_SIZE;=0D + break;=0D + default:=0D + return FALSE;=0D + }=0D +=0D + if (PrkOutSize !=3D MdSize) {=0D + return FALSE;=0D + }=0D +=0D + md =3D mbedtls_md_info_from_type (MdType);=0D + ASSERT (md !=3D NULL);=0D +=0D + Ret =3D mbedtls_hkdf_extract (md, Salt, (UINT32)SaltSize, Key, (UINT32)K= eySize, PrkOut);=0D + if (Ret !=3D 0) {=0D + return FALSE;=0D + }=0D +=0D + return TRUE;=0D +}=0D +=0D +/**=0D + Derive HMAC-based Expand Key Derivation Function (HKDF).=0D +=0D + @param[in] MdType Message Digest Type.=0D + @param[in] Prk Pointer to the user-supplied key.=0D + @param[in] PrkSize Key size in bytes.=0D + @param[in] Info Pointer to the application specific info.= =0D + @param[in] InfoSize Info size in bytes.=0D + @param[out] Out Pointer to buffer to receive hkdf value.=0D + @param[in] OutSize Size of hkdf bytes to generate.=0D +=0D + @retval TRUE Hkdf generated successfully.=0D + @retval FALSE Hkdf generation failed.=0D +=0D +**/=0D +STATIC=0D +BOOLEAN=0D +HkdfMdExpand (=0D + IN mbedtls_md_type_t MdType,=0D + IN CONST UINT8 *Prk,=0D + IN UINTN PrkSize,=0D + IN CONST UINT8 *Info,=0D + IN UINTN InfoSize,=0D + OUT UINT8 *Out,=0D + IN UINTN OutSize=0D + )=0D +{=0D + const mbedtls_md_info_t *md;=0D + INT32 Ret;=0D + UINTN MdSize;=0D +=0D + if ((Prk =3D=3D NULL) || (Info =3D=3D NULL) || (Out =3D=3D NULL) ||=0D + (PrkSize > INT_MAX) || (InfoSize > INT_MAX) || (OutSize > INT_MAX))= =0D + {=0D + return FALSE;=0D + }=0D +=0D + switch (MdType) {=0D + case MBEDTLS_MD_SHA256:=0D + MdSize =3D SHA256_DIGEST_SIZE;=0D + break;=0D + case MBEDTLS_MD_SHA384:=0D + MdSize =3D SHA384_DIGEST_SIZE;=0D + break;=0D + case MBEDTLS_MD_SHA512:=0D + MdSize =3D SHA512_DIGEST_SIZE;=0D + break;=0D + default:=0D + return FALSE;=0D + }=0D +=0D + if (PrkSize !=3D MdSize) {=0D + return FALSE;=0D + }=0D +=0D + md =3D mbedtls_md_info_from_type (MdType);=0D + ASSERT (md !=3D NULL);=0D +=0D + Ret =3D mbedtls_hkdf_expand (md, Prk, (UINT32)PrkSize, Info, (UINT32)Inf= oSize, Out, (UINT32)OutSize);=0D + if (Ret !=3D 0) {=0D + return FALSE;=0D + }=0D +=0D + return TRUE;=0D +}=0D +=0D +/**=0D + Derive SHA256 HMAC-based Extract-and-Expand Key Derivation Function (HKD= F).=0D +=0D + @param[in] Key Pointer to the user-supplied key.=0D + @param[in] KeySize Key size in bytes.=0D + @param[in] Salt Pointer to the salt(non-secret) value.=0D + @param[in] SaltSize Salt size in bytes.=0D + @param[in] Info Pointer to the application specific info.= =0D + @param[in] InfoSize Info size in bytes.=0D + @param[out] Out Pointer to buffer to receive hkdf value.=0D + @param[in] OutSize Size of hkdf bytes to generate.=0D +=0D + @retval TRUE Hkdf generated successfully.=0D + @retval FALSE Hkdf generation failed.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +HkdfSha256ExtractAndExpand (=0D + IN CONST UINT8 *Key,=0D + IN UINTN KeySize,=0D + IN CONST UINT8 *Salt,=0D + IN UINTN SaltSize,=0D + IN CONST UINT8 *Info,=0D + IN UINTN InfoSize,=0D + OUT UINT8 *Out,=0D + IN UINTN OutSize=0D + )=0D +{=0D + return HkdfMdExtractAndExpand (MBEDTLS_MD_SHA256, Key, KeySize, Salt, Sa= ltSize, Info, InfoSize, Out, OutSize);=0D +}=0D +=0D +/**=0D + Derive SHA256 HMAC-based Extract Key Derivation Function (HKDF).=0D +=0D + @param[in] Key Pointer to the user-supplied key.=0D + @param[in] KeySize Key size in bytes.=0D + @param[in] Salt Pointer to the salt(non-secret) value.=0D + @param[in] SaltSize Salt size in bytes.=0D + @param[out] PrkOut Pointer to buffer to receive hkdf value.=0D + @param[in] PrkOutSize Size of hkdf bytes to generate.=0D +=0D + @retval TRUE Hkdf generated successfully.=0D + @retval FALSE Hkdf generation failed.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +HkdfSha256Extract (=0D + IN CONST UINT8 *Key,=0D + IN UINTN KeySize,=0D + IN CONST UINT8 *Salt,=0D + IN UINTN SaltSize,=0D + OUT UINT8 *PrkOut,=0D + IN UINTN PrkOutSize=0D + )=0D +{=0D + return HkdfMdExtract (MBEDTLS_MD_SHA256, Key, KeySize, Salt, SaltSize, P= rkOut, PrkOutSize);=0D +}=0D +=0D +/**=0D + Derive SHA256 HMAC-based Expand Key Derivation Function (HKDF).=0D +=0D + @param[in] Prk Pointer to the user-supplied key.=0D + @param[in] PrkSize Key size in bytes.=0D + @param[in] Info Pointer to the application specific info.= =0D + @param[in] InfoSize Info size in bytes.=0D + @param[out] Out Pointer to buffer to receive hkdf value.=0D + @param[in] OutSize Size of hkdf bytes to generate.=0D +=0D + @retval TRUE Hkdf generated successfully.=0D + @retval FALSE Hkdf generation failed.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +HkdfSha256Expand (=0D + IN CONST UINT8 *Prk,=0D + IN UINTN PrkSize,=0D + IN CONST UINT8 *Info,=0D + IN UINTN InfoSize,=0D + OUT UINT8 *Out,=0D + IN UINTN OutSize=0D + )=0D +{=0D + return HkdfMdExpand (MBEDTLS_MD_SHA256, Prk, PrkSize, Info, InfoSize, Ou= t, OutSize);=0D +}=0D +=0D +/**=0D + Derive SHA384 HMAC-based Extract-and-Expand Key Derivation Function (HKD= F).=0D +=0D + @param[in] Key Pointer to the user-supplied key.=0D + @param[in] KeySize Key size in bytes.=0D + @param[in] Salt Pointer to the salt(non-secret) value.=0D + @param[in] SaltSize Salt size in bytes.=0D + @param[in] Info Pointer to the application specific info.= =0D + @param[in] InfoSize Info size in bytes.=0D + @param[out] Out Pointer to buffer to receive hkdf value.=0D + @param[in] OutSize Size of hkdf bytes to generate.=0D +=0D + @retval TRUE Hkdf generated successfully.=0D + @retval FALSE Hkdf generation failed.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +HkdfSha384ExtractAndExpand (=0D + IN CONST UINT8 *Key,=0D + IN UINTN KeySize,=0D + IN CONST UINT8 *Salt,=0D + IN UINTN SaltSize,=0D + IN CONST UINT8 *Info,=0D + IN UINTN InfoSize,=0D + OUT UINT8 *Out,=0D + IN UINTN OutSize=0D + )=0D +{=0D + return HkdfMdExtractAndExpand (MBEDTLS_MD_SHA384, Key, KeySize, Salt, Sa= ltSize, Info, InfoSize, Out, OutSize);=0D +}=0D +=0D +/**=0D + Derive SHA384 HMAC-based Extract Key Derivation Function (HKDF).=0D +=0D + @param[in] Key Pointer to the user-supplied key.=0D + @param[in] KeySize Key size in bytes.=0D + @param[in] Salt Pointer to the salt(non-secret) value.=0D + @param[in] SaltSize Salt size in bytes.=0D + @param[out] PrkOut Pointer to buffer to receive hkdf value.=0D + @param[in] PrkOutSize Size of hkdf bytes to generate.=0D +=0D + @retval TRUE Hkdf generated successfully.=0D + @retval FALSE Hkdf generation failed.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +HkdfSha384Extract (=0D + IN CONST UINT8 *Key,=0D + IN UINTN KeySize,=0D + IN CONST UINT8 *Salt,=0D + IN UINTN SaltSize,=0D + OUT UINT8 *PrkOut,=0D + IN UINTN PrkOutSize=0D + )=0D +{=0D + return HkdfMdExtract (MBEDTLS_MD_SHA384, Key, KeySize, Salt, SaltSize, P= rkOut, PrkOutSize);=0D +}=0D +=0D +/**=0D + Derive SHA384 HMAC-based Expand Key Derivation Function (HKDF).=0D +=0D + @param[in] Prk Pointer to the user-supplied key.=0D + @param[in] PrkSize Key size in bytes.=0D + @param[in] Info Pointer to the application specific info.= =0D + @param[in] InfoSize Info size in bytes.=0D + @param[out] Out Pointer to buffer to receive hkdf value.=0D + @param[in] OutSize Size of hkdf bytes to generate.=0D +=0D + @retval TRUE Hkdf generated successfully.=0D + @retval FALSE Hkdf generation failed.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +HkdfSha384Expand (=0D + IN CONST UINT8 *Prk,=0D + IN UINTN PrkSize,=0D + IN CONST UINT8 *Info,=0D + IN UINTN InfoSize,=0D + OUT UINT8 *Out,=0D + IN UINTN OutSize=0D + )=0D +{=0D + return HkdfMdExpand (MBEDTLS_MD_SHA384, Prk, PrkSize, Info, InfoSize, Ou= t, OutSize);=0D +}=0D diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/Kdf/CryptHkdfNull.c b/Cr= yptoPkg/Library/BaseCryptLibMbedTls/Kdf/CryptHkdfNull.c new file mode 100644 index 0000000000..8ec29b314a --- /dev/null +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/Kdf/CryptHkdfNull.c @@ -0,0 +1,192 @@ +/** @file=0D + HMAC-SHA256 KDF Wrapper Implementation which does not provide real capab= ilities.=0D +=0D +Copyright (c) 2023, Intel Corporation. All rights reserved.
=0D +SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +#include =0D +#include =0D +=0D +/**=0D + Derive key data using HMAC-SHA256 based KDF.=0D +=0D + @param[in] Key Pointer to the user-supplied key.=0D + @param[in] KeySize Key size in bytes.=0D + @param[in] Salt Pointer to the salt(non-secret) value.=0D + @param[in] SaltSize Salt size in bytes.=0D + @param[in] Info Pointer to the application specific info.= =0D + @param[in] InfoSize Info size in bytes.=0D + @param[out] Out Pointer to buffer to receive hkdf value.=0D + @param[in] OutSize Size of hkdf bytes to generate.=0D +=0D + @retval TRUE Hkdf generated successfully.=0D + @retval FALSE Hkdf generation failed.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +HkdfSha256ExtractAndExpand (=0D + IN CONST UINT8 *Key,=0D + IN UINTN KeySize,=0D + IN CONST UINT8 *Salt,=0D + IN UINTN SaltSize,=0D + IN CONST UINT8 *Info,=0D + IN UINTN InfoSize,=0D + OUT UINT8 *Out,=0D + IN UINTN OutSize=0D + )=0D +{=0D + ASSERT (FALSE);=0D + return FALSE;=0D +}=0D +=0D +/**=0D + Derive SHA256 HMAC-based Extract key Derivation Function (HKDF).=0D +=0D + @param[in] Key Pointer to the user-supplied key.=0D + @param[in] KeySize key size in bytes.=0D + @param[in] Salt Pointer to the salt(non-secret) value.=0D + @param[in] SaltSize salt size in bytes.=0D + @param[out] PrkOut Pointer to buffer to receive hkdf value.=0D + @param[in] PrkOutSize size of hkdf bytes to generate.=0D +=0D + @retval true Hkdf generated successfully.=0D + @retval false Hkdf generation failed.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +HkdfSha256Extract (=0D + IN CONST UINT8 *Key,=0D + IN UINTN KeySize,=0D + IN CONST UINT8 *Salt,=0D + IN UINTN SaltSize,=0D + OUT UINT8 *PrkOut,=0D + UINTN PrkOutSize=0D + )=0D +{=0D + ASSERT (FALSE);=0D + return FALSE;=0D +}=0D +=0D +/**=0D + Derive SHA256 HMAC-based Expand Key Derivation Function (HKDF).=0D +=0D + @param[in] Prk Pointer to the user-supplied key.=0D + @param[in] PrkSize Key size in bytes.=0D + @param[in] Info Pointer to the application specific info.= =0D + @param[in] InfoSize Info size in bytes.=0D + @param[out] Out Pointer to buffer to receive hkdf value.=0D + @param[in] OutSize Size of hkdf bytes to generate.=0D +=0D + @retval TRUE Hkdf generated successfully.=0D + @retval FALSE Hkdf generation failed.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +HkdfSha256Expand (=0D + IN CONST UINT8 *Prk,=0D + IN UINTN PrkSize,=0D + IN CONST UINT8 *Info,=0D + IN UINTN InfoSize,=0D + OUT UINT8 *Out,=0D + IN UINTN OutSize=0D + )=0D +{=0D + ASSERT (FALSE);=0D + return FALSE;=0D +}=0D +=0D +/**=0D + Derive SHA384 HMAC-based Extract-and-Expand Key Derivation Function (HKD= F).=0D +=0D + @param[in] Key Pointer to the user-supplied key.=0D + @param[in] KeySize Key size in bytes.=0D + @param[in] Salt Pointer to the salt(non-secret) value.=0D + @param[in] SaltSize Salt size in bytes.=0D + @param[in] Info Pointer to the application specific info.= =0D + @param[in] InfoSize Info size in bytes.=0D + @param[out] Out Pointer to buffer to receive hkdf value.=0D + @param[in] OutSize Size of hkdf bytes to generate.=0D +=0D + @retval TRUE Hkdf generated successfully.=0D + @retval FALSE Hkdf generation failed.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +HkdfSha384ExtractAndExpand (=0D + IN CONST UINT8 *Key,=0D + IN UINTN KeySize,=0D + IN CONST UINT8 *Salt,=0D + IN UINTN SaltSize,=0D + IN CONST UINT8 *Info,=0D + IN UINTN InfoSize,=0D + OUT UINT8 *Out,=0D + IN UINTN OutSize=0D + )=0D +{=0D + ASSERT (FALSE);=0D + return FALSE;=0D +}=0D +=0D +/**=0D + Derive SHA384 HMAC-based Extract key Derivation Function (HKDF).=0D +=0D + @param[in] Key Pointer to the user-supplied key.=0D + @param[in] KeySize key size in bytes.=0D + @param[in] Salt Pointer to the salt(non-secret) value.=0D + @param[in] SaltSize salt size in bytes.=0D + @param[out] PrkOut Pointer to buffer to receive hkdf value.=0D + @param[in] PrkOutSize size of hkdf bytes to generate.=0D +=0D + @retval true Hkdf generated successfully.=0D + @retval false Hkdf generation failed.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +HkdfSha384Extract (=0D + IN CONST UINT8 *Key,=0D + IN UINTN KeySize,=0D + IN CONST UINT8 *Salt,=0D + IN UINTN SaltSize,=0D + OUT UINT8 *PrkOut,=0D + UINTN PrkOutSize=0D + )=0D +{=0D + ASSERT (FALSE);=0D + return FALSE;=0D +}=0D +=0D +/**=0D + Derive SHA384 HMAC-based Expand Key Derivation Function (HKDF).=0D +=0D + @param[in] Prk Pointer to the user-supplied key.=0D + @param[in] PrkSize Key size in bytes.=0D + @param[in] Info Pointer to the application specific info.= =0D + @param[in] InfoSize Info size in bytes.=0D + @param[out] Out Pointer to buffer to receive hkdf value.=0D + @param[in] OutSize Size of hkdf bytes to generate.=0D +=0D + @retval TRUE Hkdf generated successfully.=0D + @retval FALSE Hkdf generation failed.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +HkdfSha384Expand (=0D + IN CONST UINT8 *Prk,=0D + IN UINTN PrkSize,=0D + IN CONST UINT8 *Info,=0D + IN UINTN InfoSize,=0D + OUT UINT8 *Out,=0D + IN UINTN OutSize=0D + )=0D +{=0D + ASSERT (FALSE);=0D + return FALSE;=0D +}=0D --=20 2.26.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108123): https://edk2.groups.io/g/devel/message/108123 Mute This Topic: https://groups.io/mt/101048099/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-