From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web12.28466.1661238389086803848 for ; Tue, 23 Aug 2022 00:06:36 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=aW9FULrF; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: qi1.zhang@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661238396; x=1692774396; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YojEyQdhJ4p4vygDuQG283ibdHDkSKAtMM24pajBnEY=; b=aW9FULrFyuqPlVgmT2i31LaW48mjqH5pKIX4iduf5nt8nEuOxu8fpCBg MU/DzMS1T6t0EC9Rnu7sGNg9ID/Jwn8gjAylW83IzDr8xjR0OcBIzlcyl 7suvck57f1Uwzq/r1ZC4OdMlrKLvu1s0JRRtyRKAT8bzy0DpRjsuMneb0 iVhNLeeHxp5MV1DwRVCY+bx6tWg7EOZ2snFIncrhmPL7cVEvnl24LFCXN VmWhAFQicU4dueO/VX4MTpq8b09BNBSQTs7FwN95TQnOz5IuWYLMRnX0/ czkDs+gT35LABz4VJYYMmuZxvB3m7f/msrz3/8fbQlvQhTJgAvcrVrzUl w==; X-IronPort-AV: E=McAfee;i="6500,9779,10447"; a="294893718" X-IronPort-AV: E=Sophos;i="5.93,256,1654585200"; d="scan'208";a="294893718" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Aug 2022 00:06:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,256,1654585200"; d="scan'208";a="677512618" Received: from shwdesssddpdqi.ccr.corp.intel.com ([10.239.157.129]) by fmsmga004.fm.intel.com with ESMTP; 23 Aug 2022 00:06:34 -0700 From: "Qi Zhang" To: devel@edk2.groups.io Cc: Qi Zhang , Jiewen Yao , Jian J Wang , Xiaoyu Lu , Guomin Jiang Subject: [PATCH 4/5] CryptoPkg: Add new hmac SHA api to Crypto Service. Date: Tue, 23 Aug 2022 15:06:22 +0800 Message-Id: <20220823070623.7002-5-qi1.zhang@intel.com> X-Mailer: git-send-email 2.26.2.windows.1 In-Reply-To: <20220823070623.7002-1-qi1.zhang@intel.com> References: <20220823070623.7002-1-qi1.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4025 Signed-off-by: Qi Zhang Cc: Jiewen Yao Cc: Jian J Wang Cc: Xiaoyu Lu Cc: Guomin Jiang --- CryptoPkg/CryptoPkg.dsc | 3 + CryptoPkg/Driver/Crypto.c | 221 ++++++++++++++++++ .../BaseCryptLibOnProtocolPpi/CryptLib.c | 212 +++++++++++++++++ 3 files changed, 436 insertions(+) diff --git a/CryptoPkg/CryptoPkg.dsc b/CryptoPkg/CryptoPkg.dsc index 50e7721f25..417804f64f 100644 --- a/CryptoPkg/CryptoPkg.dsc +++ b/CryptoPkg/CryptoPkg.dsc @@ -147,6 +147,7 @@ =0D !if $(CRYPTO_SERVICES) IN "PACKAGE ALL"=0D gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Fami= ly | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha384.Fami= ly | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Md5.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Dh.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D @@ -172,6 +173,7 @@ =0D !if $(CRYPTO_SERVICES) =3D=3D MIN_PEI=0D gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Fami= ly | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha384.Fami= ly | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D @@ -186,6 +188,7 @@ =0D !if $(CRYPTO_SERVICES) =3D=3D MIN_DXE_MIN_SMM=0D gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Fami= ly | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha384.Fami= ly | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.P= kcs1v2Encrypt | TRUE=0D gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.P= kcs5HashPassword | TRUE=0D gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.P= kcs7Verify | TRUE=0D diff --git a/CryptoPkg/Driver/Crypto.c b/CryptoPkg/Driver/Crypto.c index 76cb9f4da0..cdbba2b811 100644 --- a/CryptoPkg/Driver/Crypto.c +++ b/CryptoPkg/Driver/Crypto.c @@ -1847,6 +1847,218 @@ CryptoServiceHmacSha256Final ( return CALL_BASECRYPTLIB (HmacSha256.Services.Final, HmacSha256Final, (H= macSha256Context, HmacValue), FALSE);=0D }=0D =0D +/**=0D + Computes the HMAC-SHA256 digest of a input data buffer.=0D +=0D + This function performs the HMAC-SHA256 digest of a given data buffer, an= d places=0D + the digest value into the specified memory.=0D +=0D + If this interface is not supported, then return FALSE.=0D +=0D + @param[in] Data Pointer to the buffer containing the data to be= digested.=0D + @param[in] DataSize Size of Data buffer in bytes.=0D + @param[in] Key Pointer to the user-supplied key.=0D + @param[in] KeySize Key size in bytes.=0D + @param[out] HmacValue Pointer to a buffer that receives the HMAC-SHA2= 56 digest=0D + value (32 bytes).=0D +=0D + @retval TRUE HMAC-SHA256 digest computation succeeded.=0D + @retval FALSE HMAC-SHA256 digest computation failed.=0D + @retval FALSE This interface is not supported.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +CryptoServiceHmacSha256All (=0D + IN CONST VOID *Data,=0D + IN UINTN DataSize,=0D + IN CONST UINT8 *Key,=0D + IN UINTN KeySize,=0D + OUT UINT8 *HmacValue=0D + )=0D +{=0D + return CALL_BASECRYPTLIB (HmacSha256.Services.All, HmacSha256All, (Data,= DataSize, Key, KeySize, HmacValue), FALSE);=0D +}=0D +=0D +/**=0D + Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA38= 4 use.=0D +=0D + @return Pointer to the HMAC_CTX context that has been initialized.=0D + If the allocations fails, HmacSha384New() returns NULL.=0D +=0D +**/=0D +VOID *=0D +EFIAPI=0D +CryptoServiceHmacSha384New (=0D + VOID=0D + )=0D +{=0D + return CALL_BASECRYPTLIB (HmacSha384.Services.New, HmacSha384New, (), NU= LL);=0D +}=0D +=0D +/**=0D + Release the specified HMAC_CTX context.=0D +=0D + @param[in] HmacSha384Ctx Pointer to the HMAC_CTX context to be release= d.=0D +=0D +**/=0D +VOID=0D +EFIAPI=0D +CryptoServiceHmacSha384Free (=0D + IN VOID *HmacSha384Ctx=0D + )=0D +{=0D + CALL_VOID_BASECRYPTLIB (HmacSha384.Services.Free, HmacSha384Free, (HmacS= ha384Ctx));=0D +}=0D +=0D +/**=0D + Set user-supplied key for subsequent use. It must be done before any=0D + calling to HmacSha384Update().=0D +=0D + If HmacSha384Context is NULL, then return FALSE.=0D + If this interface is not supported, then return FALSE.=0D +=0D + @param[out] HmacSha384Context Pointer to HMAC-SHA384 context.=0D + @param[in] Key Pointer to the user-supplied key.=0D + @param[in] KeySize Key size in bytes.=0D +=0D + @retval TRUE The Key is set successfully.=0D + @retval FALSE The Key is set unsuccessfully.=0D + @retval FALSE This interface is not supported.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +CryptoServiceHmacSha384SetKey (=0D + OUT VOID *HmacSha384Context,=0D + IN CONST UINT8 *Key,=0D + IN UINTN KeySize=0D + )=0D +{=0D + return CALL_BASECRYPTLIB (HmacSha384.Services.SetKey, HmacSha384SetKey, = (HmacSha384Context, Key, KeySize), FALSE);=0D +}=0D +=0D +/**=0D + Makes a copy of an existing HMAC-SHA384 context.=0D +=0D + If HmacSha384Context is NULL, then return FALSE.=0D + If NewHmacSha384Context is NULL, then return FALSE.=0D + If this interface is not supported, then return FALSE.=0D +=0D + @param[in] HmacSha384Context Pointer to HMAC-SHA384 context being c= opied.=0D + @param[out] NewHmacSha384Context Pointer to new HMAC-SHA384 context.=0D +=0D + @retval TRUE HMAC-SHA384 context copy succeeded.=0D + @retval FALSE HMAC-SHA384 context copy failed.=0D + @retval FALSE This interface is not supported.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +CryptoServiceHmacSha384Duplicate (=0D + IN CONST VOID *HmacSha384Context,=0D + OUT VOID *NewHmacSha384Context=0D + )=0D +{=0D + return CALL_BASECRYPTLIB (HmacSha384.Services.Duplicate, HmacSha256Dupli= cate, (HmacSha384Context, NewHmacSha384Context), FALSE);=0D +}=0D +=0D +/**=0D + Digests the input data and updates HMAC-SHA384 context.=0D +=0D + This function performs HMAC-SHA384 digest on a data buffer of the specif= ied size.=0D + It can be called multiple times to compute the digest of long or discont= inuous data streams.=0D + HMAC-SHA384 context should be initialized by HmacSha384New(), and should= not be finalized=0D + by HmacSha384Final(). Behavior with invalid context is undefined.=0D +=0D + If HmacSha384Context is NULL, then return FALSE.=0D + If this interface is not supported, then return FALSE.=0D +=0D + @param[in, out] HmacSha384Context Pointer to the HMAC-SHA384 context.=0D + @param[in] Data Pointer to the buffer containing the = data to be digested.=0D + @param[in] DataSize Size of Data buffer in bytes.=0D +=0D + @retval TRUE HMAC-SHA384 data digest succeeded.=0D + @retval FALSE HMAC-SHA384 data digest failed.=0D + @retval FALSE This interface is not supported.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +CryptoServiceHmacSha384Update (=0D + IN OUT VOID *HmacSha384Context,=0D + IN CONST VOID *Data,=0D + IN UINTN DataSize=0D + )=0D +{=0D + return CALL_BASECRYPTLIB (HmacSha384.Services.Update, HmacSha384Update, = (HmacSha384Context, Data, DataSize), FALSE);=0D +}=0D +=0D +/**=0D + Completes computation of the HMAC-SHA384 digest value.=0D +=0D + This function completes HMAC-SHA384 hash computation and retrieves the d= igest value into=0D + the specified memory. After this function has been called, the HMAC-SHA3= 84 context cannot=0D + be used again.=0D + HMAC-SHA384 context should be initialized by HmacSha384New(), and should= not be finalized=0D + by HmacSha384Final(). Behavior with invalid HMAC-SHA384 context is undef= ined.=0D +=0D + If HmacSha384Context is NULL, then return FALSE.=0D + If HmacValue is NULL, then return FALSE.=0D + If this interface is not supported, then return FALSE.=0D +=0D + @param[in, out] HmacSha384Context Pointer to the HMAC-SHA384 context.= =0D + @param[out] HmacValue Pointer to a buffer that receives th= e HMAC-SHA384 digest=0D + value (48 bytes).=0D +=0D + @retval TRUE HMAC-SHA384 digest computation succeeded.=0D + @retval FALSE HMAC-SHA384 digest computation failed.=0D + @retval FALSE This interface is not supported.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +CryptoServiceHmacSha384Final (=0D + IN OUT VOID *HmacSha384Context,=0D + OUT UINT8 *HmacValue=0D + )=0D +{=0D + return CALL_BASECRYPTLIB (HmacSha384.Services.Final, HmacSha384Final, (H= macSha384Context, HmacValue), FALSE);=0D +}=0D +=0D +/**=0D + Computes the HMAC-SHA384 digest of a input data buffer.=0D +=0D + This function performs the HMAC-SHA384 digest of a given data buffer, an= d places=0D + the digest value into the specified memory.=0D +=0D + If this interface is not supported, then return FALSE.=0D +=0D + @param[in] Data Pointer to the buffer containing the data to be= digested.=0D + @param[in] DataSize Size of Data buffer in bytes.=0D + @param[in] Key Pointer to the user-supplied key.=0D + @param[in] KeySize Key size in bytes.=0D + @param[out] HmacValue Pointer to a buffer that receives the HMAC-SHA3= 84 digest=0D + value (48 bytes).=0D +=0D + @retval TRUE HMAC-SHA384 digest computation succeeded.=0D + @retval FALSE HMAC-SHA384 digest computation failed.=0D + @retval FALSE This interface is not supported.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +CryptoServiceHmacSha384All (=0D + IN CONST VOID *Data,=0D + IN UINTN DataSize,=0D + IN CONST UINT8 *Key,=0D + IN UINTN KeySize,=0D + OUT UINT8 *HmacValue=0D + )=0D +{=0D + return CALL_BASECRYPTLIB (HmacSha384.Services.All, HmacSha384All, (Data,= DataSize, Key, KeySize, HmacValue), FALSE);=0D +}=0D +=0D // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D // Symmetric Cryptography Primitive=0D // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D @@ -4606,6 +4818,15 @@ const EDKII_CRYPTO_PROTOCOL mEdkiiCrypto =3D { CryptoServiceHmacSha256Duplicate,=0D CryptoServiceHmacSha256Update,=0D CryptoServiceHmacSha256Final,=0D + CryptoServiceHmacSha256All,=0D + /// HMAC SHA384=0D + CryptoServiceHmacSha384New,=0D + CryptoServiceHmacSha384Free,=0D + CryptoServiceHmacSha384SetKey,=0D + CryptoServiceHmacSha384Duplicate,=0D + CryptoServiceHmacSha384Update,=0D + CryptoServiceHmacSha384Final,=0D + CryptoServiceHmacSha384All,=0D /// Md4 - deprecated and unsupported=0D DeprecatedCryptoServiceMd4GetContextSize,=0D DeprecatedCryptoServiceMd4Init,=0D diff --git a/CryptoPkg/Library/BaseCryptLibOnProtocolPpi/CryptLib.c b/Crypt= oPkg/Library/BaseCryptLibOnProtocolPpi/CryptLib.c index 8ee1b53cf9..0218e9b594 100644 --- a/CryptoPkg/Library/BaseCryptLibOnProtocolPpi/CryptLib.c +++ b/CryptoPkg/Library/BaseCryptLibOnProtocolPpi/CryptLib.c @@ -1201,6 +1201,218 @@ HmacSha256Final ( CALL_CRYPTO_SERVICE (HmacSha256Final, (HmacSha256Context, HmacValue), FA= LSE);=0D }=0D =0D +/**=0D + Computes the HMAC-SHA256 digest of a input data buffer.=0D +=0D + This function performs the HMAC-SHA256 digest of a given data buffer, an= d places=0D + the digest value into the specified memory.=0D +=0D + If this interface is not supported, then return FALSE.=0D +=0D + @param[in] Data Pointer to the buffer containing the data to be= digested.=0D + @param[in] DataSize Size of Data buffer in bytes.=0D + @param[in] Key Pointer to the user-supplied key.=0D + @param[in] KeySize Key size in bytes.=0D + @param[out] HmacValue Pointer to a buffer that receives the HMAC-SHA2= 56 digest=0D + value (32 bytes).=0D +=0D + @retval TRUE HMAC-SHA256 digest computation succeeded.=0D + @retval FALSE HMAC-SHA256 digest computation failed.=0D + @retval FALSE This interface is not supported.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +HmacSha256All (=0D + IN CONST VOID *Data,=0D + IN UINTN DataSize,=0D + IN CONST UINT8 *Key,=0D + IN UINTN KeySize,=0D + OUT UINT8 *HmacValue=0D + )=0D +{=0D + CALL_CRYPTO_SERVICE (HmacSha256All, (Data, DataSize, Key, KeySize, HmacV= alue), FALSE);=0D +}=0D +=0D +/**=0D + Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA38= 4 use.=0D +=0D + @return Pointer to the HMAC_CTX context that has been initialized.=0D + If the allocations fails, HmacSha384New() returns NULL.=0D +=0D +**/=0D +VOID *=0D +EFIAPI=0D +HmacSha384New (=0D + VOID=0D + )=0D +{=0D + CALL_CRYPTO_SERVICE (HmacSha384New, (), NULL);=0D +}=0D +=0D +/**=0D + Release the specified HMAC_CTX context.=0D +=0D + @param[in] HmacSha384Ctx Pointer to the HMAC_CTX context to be release= d.=0D +=0D +**/=0D +VOID=0D +EFIAPI=0D +HmacSha384Free (=0D + IN VOID *HmacSha384Ctx=0D + )=0D +{=0D + CALL_VOID_CRYPTO_SERVICE (HmacSha384Free, (HmacSha384Ctx));=0D +}=0D +=0D +/**=0D + Set user-supplied key for subsequent use. It must be done before any=0D + calling to HmacSha384Update().=0D +=0D + If HmacSha384Context is NULL, then return FALSE.=0D + If this interface is not supported, then return FALSE.=0D +=0D + @param[out] HmacSha384Context Pointer to HMAC-SHA384 context.=0D + @param[in] Key Pointer to the user-supplied key.=0D + @param[in] KeySize Key size in bytes.=0D +=0D + @retval TRUE The Key is set successfully.=0D + @retval FALSE The Key is set unsuccessfully.=0D + @retval FALSE This interface is not supported.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +HmacSha384SetKey (=0D + OUT VOID *HmacSha384Context,=0D + IN CONST UINT8 *Key,=0D + IN UINTN KeySize=0D + )=0D +{=0D + CALL_CRYPTO_SERVICE (HmacSha384SetKey, (HmacSha384Context, Key, KeySize)= , FALSE);=0D +}=0D +=0D +/**=0D + Makes a copy of an existing HMAC-SHA384 context.=0D +=0D + If HmacSha384Context is NULL, then return FALSE.=0D + If NewHmacSha384Context is NULL, then return FALSE.=0D + If this interface is not supported, then return FALSE.=0D +=0D + @param[in] HmacSha384Context Pointer to HMAC-SHA384 context being c= opied.=0D + @param[out] NewHmacSha384Context Pointer to new HMAC-SHA384 context.=0D +=0D + @retval TRUE HMAC-SHA384 context copy succeeded.=0D + @retval FALSE HMAC-SHA384 context copy failed.=0D + @retval FALSE This interface is not supported.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +HmacSha384Duplicate (=0D + IN CONST VOID *HmacSha384Context,=0D + OUT VOID *NewHmacSha384Context=0D + )=0D +{=0D + CALL_CRYPTO_SERVICE (HmacSha384Duplicate, (HmacSha384Context, NewHmacSha= 384Context), FALSE);=0D +}=0D +=0D +/**=0D + Digests the input data and updates HMAC-SHA384 context.=0D +=0D + This function performs HMAC-SHA384 digest on a data buffer of the specif= ied size.=0D + It can be called multiple times to compute the digest of long or discont= inuous data streams.=0D + HMAC-SHA384 context should be initialized by HmacSha384New(), and should= not be finalized=0D + by HmacSha384Final(). Behavior with invalid context is undefined.=0D +=0D + If HmacSha384Context is NULL, then return FALSE.=0D + If this interface is not supported, then return FALSE.=0D +=0D + @param[in, out] HmacSha384Context Pointer to the HMAC-SHA384 context.=0D + @param[in] Data Pointer to the buffer containing the = data to be digested.=0D + @param[in] DataSize Size of Data buffer in bytes.=0D +=0D + @retval TRUE HMAC-SHA384 data digest succeeded.=0D + @retval FALSE HMAC-SHA384 data digest failed.=0D + @retval FALSE This interface is not supported.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +HmacSha384Update (=0D + IN OUT VOID *HmacSha384Context,=0D + IN CONST VOID *Data,=0D + IN UINTN DataSize=0D + )=0D +{=0D + CALL_CRYPTO_SERVICE (HmacSha384Update, (HmacSha384Context, Data, DataSiz= e), FALSE);=0D +}=0D +=0D +/**=0D + Completes computation of the HMAC-SHA384 digest value.=0D +=0D + This function completes HMAC-SHA384 hash computation and retrieves the d= igest value into=0D + the specified memory. After this function has been called, the HMAC-SHA3= 84 context cannot=0D + be used again.=0D + HMAC-SHA384 context should be initialized by HmacSha384New(), and should= not be finalized=0D + by HmacSha384Final(). Behavior with invalid HMAC-SHA384 context is undef= ined.=0D +=0D + If HmacSha384Context is NULL, then return FALSE.=0D + If HmacValue is NULL, then return FALSE.=0D + If this interface is not supported, then return FALSE.=0D +=0D + @param[in, out] HmacSha384Context Pointer to the HMAC-SHA384 context.= =0D + @param[out] HmacValue Pointer to a buffer that receives th= e HMAC-SHA384 digest=0D + value (48 bytes).=0D +=0D + @retval TRUE HMAC-SHA384 digest computation succeeded.=0D + @retval FALSE HMAC-SHA384 digest computation failed.=0D + @retval FALSE This interface is not supported.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +HmacSha384Final (=0D + IN OUT VOID *HmacSha384Context,=0D + OUT UINT8 *HmacValue=0D + )=0D +{=0D + CALL_CRYPTO_SERVICE (HmacSha384Final, (HmacSha384Context, HmacValue), FA= LSE);=0D +}=0D +=0D +/**=0D + Computes the HMAC-SHA384 digest of a input data buffer.=0D +=0D + This function performs the HMAC-SHA384 digest of a given data buffer, an= d places=0D + the digest value into the specified memory.=0D +=0D + If this interface is not supported, then return FALSE.=0D +=0D + @param[in] Data Pointer to the buffer containing the data to be= digested.=0D + @param[in] DataSize Size of Data buffer in bytes.=0D + @param[in] Key Pointer to the user-supplied key.=0D + @param[in] KeySize Key size in bytes.=0D + @param[out] HmacValue Pointer to a buffer that receives the HMAC-SHA3= 84 digest=0D + value (48 bytes).=0D +=0D + @retval TRUE HMAC-SHA384 digest computation succeeded.=0D + @retval FALSE HMAC-SHA384 digest computation failed.=0D + @retval FALSE This interface is not supported.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +HmacSha384All (=0D + IN CONST VOID *Data,=0D + IN UINTN DataSize,=0D + IN CONST UINT8 *Key,=0D + IN UINTN KeySize,=0D + OUT UINT8 *HmacValue=0D + )=0D +{=0D + CALL_CRYPTO_SERVICE (HmacSha384All, (Data, DataSize, Key, KeySize, HmacV= alue), FALSE);=0D +}=0D +=0D // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D // Symmetric Cryptography Primitive=0D // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D --=20 2.26.2.windows.1