summaryrefslogtreecommitdiffstats
path: root/CryptoPkg/CryptoPkg.dec
diff options
context:
space:
mode:
authorAmol N Sukerkar <amol.n.sukerkar@intel.com>2020-02-03 10:18:50 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-02-03 23:49:28 +0000
commit3feea54eae33a6689bedf1e023edeb219faa76d6 (patch)
treec70d63f074e1a07b4e4e8126a697a6b01ffac71b /CryptoPkg/CryptoPkg.dec
parent2c061de06336d31dcc24d0765b702c975c6f06a9 (diff)
downloadedk2-3feea54eae33a6689bedf1e023edeb219faa76d6.tar.gz
edk2-3feea54eae33a6689bedf1e023edeb219faa76d6.tar.bz2
edk2-3feea54eae33a6689bedf1e023edeb219faa76d6.zip
CryptoPkg/BaseHashApiLib: Implement Unified Hash Calculation API
https://bugzilla.tianocore.org/show_bug.cgi?id=2151 This commit introduces a Unified Hash API to calculate hash using a hashing algorithm specified by the PCD, PcdHashApiLibPolicy. This library interfaces with the various hashing API, such as, MD4, MD5, SHA1, SHA256, SHA512 and SM3_256 implemented in BaseCryptLib. The user can calculate the desired hash by setting PcdHashApiLibPolicy to appropriate value. This feature is documented in the Bugzilla, https://bugzilla.tianocore.org/show_bug.cgi?id=2151. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Amol N Sukerkar <amol.n.sukerkar@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Diffstat (limited to 'CryptoPkg/CryptoPkg.dec')
-rw-r--r--CryptoPkg/CryptoPkg.dec20
1 files changed, 20 insertions, 0 deletions
diff --git a/CryptoPkg/CryptoPkg.dec b/CryptoPkg/CryptoPkg.dec
index 41af6e879e..8ad0fb5d61 100644
--- a/CryptoPkg/CryptoPkg.dec
+++ b/CryptoPkg/CryptoPkg.dec
@@ -33,9 +33,29 @@
##
TlsLib|Include/Library/TlsLib.h
+ ## @libraryclass Provides Unified API for different hash implementations.
+ #
+ HashApiLib|Include/Library/HashApiLib.h
+
[Guids]
## Crypto package token space guid.
gEfiCryptoPkgTokenSpaceGuid = { 0x6bd7de60, 0x9ef7, 0x4899, { 0x97, 0xd0, 0xab, 0xff, 0xfd, 0xe9, 0x70, 0xf2 } }
+[PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
+ ## This PCD indicates the HASH algorithm to calculate hash of data
+ # Based on the value set, the required algorithm is chosen to calculate
+ # the hash of data.<BR>
+ # The default hashing algorithm for BaseHashApiLib is set to SHA256.<BR>
+ # 0x00000001 - MD4.<BR>
+ # 0x00000002 - MD5.<BR>
+ # 0x00000003 - SHA1.<BR>
+ # 0x00000004 - SHA256.<BR>
+ # 0x00000005 - SHA384.<BR>
+ # 0x00000006 - SHA512.<BR>
+ # 0x00000007 - SM3_256.<BR>
+ # @Prompt Set policy for hashing unsigned image for Secure Boot.
+ # @ValidRange 0x80000001 | 0x00000001 - 0x00000007
+ gEfiCryptoPkgTokenSpaceGuid.PcdHashApiLibPolicy|0x04|UINT8|0x00000001
+
[UserExtensions.TianoCore."ExtraFiles"]
CryptoPkgExtra.uni