summaryrefslogtreecommitdiffstats
path: root/CryptoPkg/Private
diff options
context:
space:
mode:
authorZhihao Li <zhihao.li@intel.com>2022-03-18 12:22:09 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-03-18 06:49:18 +0000
commitc1e662101addbfd983026f06d119da2d470865a1 (patch)
treeb882e07ddf86c1d871de429ece5bce0ebb6da6ea /CryptoPkg/Private
parent28eeb08d8664df813637e12cb00c60cb30330be8 (diff)
downloadedk2-c1e662101addbfd983026f06d119da2d470865a1.tar.gz
edk2-c1e662101addbfd983026f06d119da2d470865a1.tar.bz2
edk2-c1e662101addbfd983026f06d119da2d470865a1.zip
CryptoPkg: Add new hash algorithm ParallelHash256HashAll in BaseCryptLib.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3596 Parallel hash function ParallelHash256HashAll, as defined in NIST's Special Publication 800-185, published December 2016. It utilizes multi-process to calculate the digest. Passed CI test. Onprotocol version code passed test. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com> Cc: Guomin Jiang <guomin.jiang@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Signed-off-by: Zhihao Li <zhihao.li@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Diffstat (limited to 'CryptoPkg/Private')
-rw-r--r--CryptoPkg/Private/Protocol/Crypto.h35
1 files changed, 33 insertions, 2 deletions
diff --git a/CryptoPkg/Private/Protocol/Crypto.h b/CryptoPkg/Private/Protocol/Crypto.h
index e378a8a8c6..c417568e96 100644
--- a/CryptoPkg/Private/Protocol/Crypto.h
+++ b/CryptoPkg/Private/Protocol/Crypto.h
@@ -2,7 +2,7 @@
This Protocol provides Crypto services to DXE modules
Copyright (C) Microsoft Corporation. All rights reserved.
- Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -21,7 +21,7 @@
/// the EDK II Crypto Protocol is extended, this version define must be
/// increased.
///
-#define EDKII_CRYPTO_VERSION 7
+#define EDKII_CRYPTO_VERSION 8
///
/// EDK II Crypto Protocol forward declaration
@@ -3457,6 +3457,35 @@ BOOLEAN
IN UINT16 SaltLen
);
+/**
+ Parallel hash function ParallelHash256, as defined in NIST's Special Publication 800-185,
+ published December 2016.
+
+ @param[in] Input Pointer to the input message (X).
+ @param[in] InputByteLen The number(>0) of input bytes provided for the input data.
+ @param[in] BlockSize The size of each block (B).
+ @param[out] Output Pointer to the output buffer.
+ @param[in] OutputByteLen The desired number of output bytes (L).
+ @param[in] Customization Pointer to the customization string (S).
+ @param[in] CustomByteLen The length of the customization string in bytes.
+
+ @retval TRUE ParallelHash256 digest computation succeeded.
+ @retval FALSE ParallelHash256 digest computation failed.
+ @retval FALSE This interface is not supported.
+
+**/
+typedef
+BOOLEAN
+(EFIAPI *EDKII_CRYPTO_PARALLEL_HASH_ALL)(
+ IN CONST VOID *Input,
+ IN UINTN InputByteLen,
+ IN UINTN BlockSize,
+ OUT VOID *Output,
+ IN UINTN OutputByteLen,
+ IN CONST VOID *Customization,
+ IN UINTN CustomByteLen
+ );
+
///
/// EDK II Crypto Protocol
///
@@ -3644,6 +3673,8 @@ struct _EDKII_CRYPTO_PROTOCOL {
/// RSA PSS
EDKII_CRYPTO_RSA_PSS_SIGN RsaPssSign;
EDKII_CRYPTO_RSA_PSS_VERIFY RsaPssVerify;
+ /// Parallel hash
+ EDKII_CRYPTO_PARALLEL_HASH_ALL ParallelHash256HashAll;
};
extern GUID gEdkiiCryptoProtocolGuid;