From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web09.1300.1581722526510525084 for ; Fri, 14 Feb 2020 15:22:06 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=v04kr2Xn; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: amol.n.sukerkar@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Feb 2020 15:22:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,442,1574150400"; d="scan'208";a="433181133" Received: from orsmsx101.amr.corp.intel.com ([10.22.225.128]) by fmsmga005.fm.intel.com with ESMTP; 14 Feb 2020 15:22:05 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX101.amr.corp.intel.com (10.22.225.128) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 14 Feb 2020 15:22:05 -0800 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 14 Feb 2020 15:22:05 -0800 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 14 Feb 2020 15:22:05 -0800 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.58) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 14 Feb 2020 15:22:04 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N1ZBYzQ8ntnUoPbpQy/9o/pW744mFARmOp8hTtR56CjwRAq+FqO+j/Qi8vN+VbewAOh1whjYI/2OyLaGb0gjXKDLPjQr0NYBacd7xcIHb2dznRAg3rAuzuA6nsRP7u+Nwg2T/2qd1Mz3FGXuaSkYI1RALMmCRs80GocMRuuwZ5NiFwWelTcUHcL54bAri8fFlAV3AlOkejSp10CWFPG99YJfIhqd8utqHfXA9UZCHc+Pp1aTkHs4vgR4WTnxWyi6KYd49sDco7JKzcgWC2M2ZLTLMov7OEpmvfiUO2Ll3AT3Sc5XiNkk6/WcKDNugM2PoKeAb/ejQuCheuVEAhnh7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AorsGNAO2NKL1Rv8uQAnGDZoBKLI2GpYp8OZ5m464I4=; b=cJb3X4ZwcBTC/hONzXLebkk6g1JSP5EpiHVc28fT/iduD1ICgKYHSO+z91ddDmzek4+Mxz4JeiQDRSkLnFLRCBPKpdGSbKCFuFnY7RSEVBCg1gHakZZTxYDmMEJNWyTzDutfo7MDFgAIsaaTYTaxUuyCEorPU1VDiSg5b5MJRMIqkoeDzCUKjvwrPnYwFxNGdTuVeZqaTBNttf3jzGp6Pzc2vrkKgE9ZvHh9RV54FlDJciTwpiS1bEvGsmlOJxqEZKtH2X8oOhQQiBngEgy7fvGq5ri3/vkgbIDSTi0XKPE1f1+9Ca4Mkin/SwxKqf8NI9iu8CnPdOn24D9yCt5mVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AorsGNAO2NKL1Rv8uQAnGDZoBKLI2GpYp8OZ5m464I4=; b=v04kr2XnMuOlGrTjEchMHTU/KCVkckwxcjEm2pc2mHCCuACjBvzaxDtY4HegmQ3I7J/pmU9fY7E4LMw7I0UtxI/Jxo4nxyDyo7ydDoSUe9RulFNfO40l0b3hBPW0f5s+adYiqiN70QEboQHLAuVuJi5dWxzwYQij+YYkPA/nShw= Received: from SN6PR11MB2893.namprd11.prod.outlook.com (20.176.241.151) by SN6PR11MB3454.namprd11.prod.outlook.com (52.135.110.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.25; Fri, 14 Feb 2020 23:21:59 +0000 Received: from SN6PR11MB2893.namprd11.prod.outlook.com ([fe80::e59c:2d4b:b97c:9676]) by SN6PR11MB2893.namprd11.prod.outlook.com ([fe80::e59c:2d4b:b97c:9676%7]) with mapi id 15.20.2707.030; Fri, 14 Feb 2020 23:21:59 +0000 From: "Sukerkar, Amol N" To: "Kinney, Michael D" , "devel@edk2.groups.io" CC: "Yao, Jiewen" , "Wang, Jian J" , "Agrawal, Sachin" , "Gao, Liming" , "Sukerkar, Amol N" Subject: Re: [PATCH v2 1/2] CryptoPkg/BaseHashApiLib: Align BaseHashApiLib with TPM 2.0 Implementation Thread-Topic: [PATCH v2 1/2] CryptoPkg/BaseHashApiLib: Align BaseHashApiLib with TPM 2.0 Implementation Thread-Index: AQHV42Fk9YQL/u03kE+473AEPZeVBqgbQ7jwgAADlpCAAAzcQA== Date: Fri, 14 Feb 2020 23:21:59 +0000 Message-ID: References: <20200214180545.5872-1-amol.n.sukerkar@intel.com> <20200214180545.5872-2-amol.n.sukerkar@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.2.0.6 dlp-product: dlpe-windows authentication-results: spf=none (sender IP is ) smtp.mailfrom=amol.n.sukerkar@intel.com; x-originating-ip: [192.55.52.202] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b2cd9d46-0042-4801-76b3-08d7b1a4b0c9 x-ms-traffictypediagnostic: SN6PR11MB3454: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:826; x-forefront-prvs: 03137AC81E x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(366004)(136003)(346002)(396003)(376002)(199004)(189003)(7696005)(2906002)(86362001)(9686003)(110136005)(81156014)(81166006)(64756008)(66946007)(54906003)(71200400001)(66446008)(66476007)(8676002)(316002)(66556008)(107886003)(55016002)(76116006)(5660300002)(53546011)(33656002)(30864003)(478600001)(966005)(52536014)(26005)(19627235002)(8936002)(6506007)(186003)(4326008);DIR:OUT;SFP:1102;SCL:1;SRVR:SN6PR11MB3454;H:SN6PR11MB2893.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 7CwEiCQs94uaTeF6NmhQw/w/r9MVNMiUDkTR2J7LghHWL6qIc5uwhlEA2Pmd5v6TmnzlCPibMMnvVY9jUbU5E6QOB4OW5yduPJ2TMx1w1bySZYSnPDON5lJqX0SrFNWH7e/+tuxVShQGjIcf4ee+pevryMLheS4QDgINQ7/6JTIL8Fbx0YrNIat5nvK3lCVQZ4pKUbsJqQ+vPxdOUgG51xpMbyW0rkX7WqK9vaCQPa1We3thTR3euYjQp/Ywq8n3e/Ilb3mW47cjxiXfqNDgI4xQcyBPXyfw2vibyckSIg7YzbVpdoL5HIA/MWM/gngyz4YUNlIYsuMwT+XQUdPo1WYG8DTQ/jZ9CVG641+VEbHlbHct74mnmAFbN2bI6kXIvK2SaGTA/dgfiBgRpHhARj4JHAJ0xQCyac0UdxDc2gW1ar6e4YUjG99/MdbF96rRwDaIl1hsQp9PGsnNqFI2pXyPqZxnffl3bNRzoNzj675/0s+q9gIwMNuX3kaXPeI793UKm5j+gZsg10LBoPakNQ== x-ms-exchange-antispam-messagedata: ao5UnnTiI+AjhnWfKMny3rt4LTrauWgA7uf6EX5UOedtihZsOlQiWTeGtyiow4lfcGYtn7oA27re41yfgKbcHPpmutQaLbGIMTLPTxaNwsIGeajX5Wtp/h9CcKTtpBQgu1u+fm0obKNPlXnXipsjAA== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: b2cd9d46-0042-4801-76b3-08d7b1a4b0c9 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Feb 2020 23:21:59.3261 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: xAhpzVweWr3xw6yZoztj2W5wevS9RCqhH39/brpVQYURDNKlFOcFl/KSCMi7CmegAoEZemhObZACYMiGFVi5D2GUBsXo0PApTcuYSkgy+WM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3454 Return-Path: amol.n.sukerkar@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Mike, Addressed all the comments and sent newer version of patch. Thanks, Amol -----Original Message----- From: Kinney, Michael D =20 Sent: Friday, February 14, 2020 3:38 PM To: Sukerkar, Amol N ; devel@edk2.groups.io; Kin= ney, Michael D Cc: Yao, Jiewen ; Wang, Jian J ; Agrawal, Sachin ; Gao, Liming Subject: RE: [PATCH v2 1/2] CryptoPkg/BaseHashApiLib: Align BaseHashApiLib = with TPM 2.0 Implementation Amol, One additional comment. You added #include to the HashApiLib.h class. T= he public APIs do not depend on any definitions from so this line should ne removed from CryptoPkg/Include/Library/HashApiL= ib.h. Instead, #include should be added to the BaseHas= hApiLib implementation in the file CryptoPkg/Library/BaseHashApiLib/BaseHas= hApiLib.c. Thanks, Mike > -----Original Message----- > From: Kinney, Michael D > Sent: Friday, February 14, 2020 2:30 PM > To: Sukerkar, Amol N ;=20 > devel@edk2.groups.io; Kinney, Michael D > Cc: Yao, Jiewen ; Wang, Jian J=20 > ; Agrawal, Sachin ;=20 > Gao, Liming > Subject: RE: [PATCH v2 1/2] CryptoPkg/BaseHashApiLib: > Align BaseHashApiLib with TPM 2.0 Implementation >=20 > Amol, >=20 > Comments included below. >=20 > Mike >=20 > > -----Original Message----- > > From: Sukerkar, Amol N > > Sent: Friday, February 14, 2020 10:06 AM > > To: devel@edk2.groups.io > > Cc: Kinney, Michael D ; Yao, Jiewen=20 > > ; Wang, Jian J ;=20 > > Agrawal, Sachin ; Gao, Liming=20 > > > > Subject: [PATCH v2 1/2] CryptoPkg/BaseHashApiLib: > Align > > BaseHashApiLib with TPM 2.0 Implementation > > > > Ref: > > https://bugzilla.tianocore.org/show_bug.cgi?id=3D2511 > > > > This commit aligns the baseHashApiLib with TPM 2.0 Implementation as=20 > > follows: > > - Remove reference to MD4 and MD5 algorithms as they are deprecated > > - Align the enumerations for hashing algoerithms with the one used > > in TPM 2.0 implementation defined in IndustryStandard/Tpm20.h. > > > > Cc: Jiewen Yao > > Cc: Jian J Wang > > Cc: Michael D Kinney > > Signed-off-by: Amol N Sukerkar > > > > --- > > > > Notes: > > v2 > > - Fixed closed parentheses in commit message > > > > CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c | > > 120 ++++++-------------- > > CryptoPkg/CryptoPkg.dec | > > 16 ++- > > CryptoPkg/CryptoPkg.uni | > > 12 +- > > CryptoPkg/Include/Library/HashApiLib.h | > > 14 +-- > > 4 files changed, 50 insertions(+), 112 deletions(-) > > > > diff --git > > a/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c > > b/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c > > index 277ef9f0b421..b87a82b06ce1 100644 > > --- > a/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c > > +++ > b/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c > > @@ -31,32 +31,24 @@ HashApiGetContextSize ( > > VOID > > ) > > { > > - switch (PcdGet8 (PcdHashApiLibPolicy)) { > > - case HASH_API_ALGO_MD4: > > - return Md4GetContextSize (); > > - break; > > - > > - case HASH_API_ALGO_MD5: > > - return Md5GetContextSize (); > > - break; > > - > > - case HASH_API_ALGO_SHA1: > > + switch (PcdGet16 (PcdHashApiLibPolicy)) { > > + case HASH_ALG_SHA1: > > return Sha1GetContextSize (); > > break; > > > > - case HASH_API_ALGO_SHA256: > > + case HASH_ALG_SHA256: > > return Sha256GetContextSize (); > > break; > > > > - case HASH_API_ALGO_SHA384: > > + case HASH_ALG_SHA384: > > return Sha384GetContextSize (); > > break; > > > > - case HASH_API_ALGO_SHA512: > > + case HASH_ALG_SHA512: > > return Sha512GetContextSize (); > > break; > > > > - case HASH_API_ALGO_SM3_256: > > + case HASH_ALG_SM3_256: > > return Sm3GetContextSize (); > > break; > > > > @@ -81,32 +73,24 @@ HashApiInit ( > > OUT HASH_API_CONTEXT HashContext > > ) > > { > > - switch (PcdGet8 (PcdHashApiLibPolicy)) { > > - case HASH_API_ALGO_MD4: > > - return Md4Init (HashContext); > > - break; > > - > > - case HASH_API_ALGO_MD5: > > - return Md5Init (HashContext); > > - break; > > - > > - case HASH_API_ALGO_SHA1: > > + switch (PcdGet16 (PcdHashApiLibPolicy)) { > > + case HASH_ALG_SHA1: > > return Sha1Init (HashContext); > > break; > > > > - case HASH_API_ALGO_SHA256: > > + case HASH_ALG_SHA256: > > return Sha256Init (HashContext); > > break; > > > > - case HASH_API_ALGO_SHA384: > > + case HASH_ALG_SHA384: > > return Sha384Init (HashContext); > > break; > > > > - case HASH_API_ALGO_SHA512: > > + case HASH_ALG_SHA512: > > return Sha512Init (HashContext); > > break; > > > > - case HASH_API_ALGO_SM3_256: > > + case HASH_ALG_SM3_256: > > return Sm3Init (HashContext); > > break; > > > > @@ -133,32 +117,24 @@ HashApiDuplicate ( > > OUT HASH_API_CONTEXT NewHashContext > > ) > > { > > - switch (PcdGet8 (PcdHashApiLibPolicy)) { > > - case HASH_API_ALGO_MD4: > > - return Md4Duplicate (HashContext, > > NewHashContext); > > - break; > > - > > - case HASH_API_ALGO_MD5: > > - return Md5Duplicate (HashContext, > > NewHashContext); > > - break; > > - > > - case HASH_API_ALGO_SHA1: > > + switch (PcdGet16 (PcdHashApiLibPolicy)) { > > + case HASH_ALG_SHA1: > > return Sha1Duplicate (HashContext, NewHashContext); > > break; > > > > - case HASH_API_ALGO_SHA256: > > + case HASH_ALG_SHA256: > > return Sha256Duplicate (HashContext, NewHashContext); > > break; > > > > - case HASH_API_ALGO_SHA384: > > + case HASH_ALG_SHA384: > > return Sha384Duplicate (HashContext, NewHashContext); > > break; > > > > - case HASH_API_ALGO_SHA512: > > + case HASH_ALG_SHA512: > > return Sha512Duplicate (HashContext, NewHashContext); > > break; > > > > - case HASH_API_ALGO_SM3_256: > > + case HASH_ALG_SM3_256: > > return Sm3Duplicate (HashContext, NewHashContext); > > break; > > > > @@ -187,32 +163,24 @@ HashApiUpdate ( > > IN UINTN DataToHashLen > > ) > > { > > - switch (PcdGet8 (PcdHashApiLibPolicy)) { > > - case HASH_API_ALGO_MD4: > > - return Md4Update (HashContext, DataToHash, > > DataToHashLen); > > - break; > > - > > - case HASH_API_ALGO_MD5: > > - return Md5Update (HashContext, DataToHash, > > DataToHashLen); > > - break; > > - > > - case HASH_API_ALGO_SHA1: > > + switch (PcdGet16 (PcdHashApiLibPolicy)) { > > + case HASH_ALG_SHA1: > > return Sha1Update (HashContext, DataToHash, DataToHashLen); > > break; > > > > - case HASH_API_ALGO_SHA256: > > + case HASH_ALG_SHA256: > > return Sha256Update (HashContext, DataToHash, DataToHashLen); > > break; > > > > - case HASH_API_ALGO_SHA384: > > + case HASH_ALG_SHA384: > > return Sha384Update (HashContext, DataToHash, DataToHashLen); > > break; > > > > - case HASH_API_ALGO_SHA512: > > + case HASH_ALG_SHA512: > > return Sha512Update (HashContext, DataToHash, DataToHashLen); > > break; > > > > - case HASH_API_ALGO_SM3_256: > > + case HASH_ALG_SM3_256: > > return Sm3Update (HashContext, DataToHash, DataToHashLen); > > break; > > > > @@ -239,32 +207,24 @@ HashApiFinal ( > > OUT UINT8 *Digest > > ) > > { > > - switch (PcdGet8 (PcdHashApiLibPolicy)) { > > - case HASH_API_ALGO_MD4: > > - return Md4Final (HashContext, Digest); > > - break; > > - > > - case HASH_API_ALGO_MD5: > > - return Md5Final (HashContext, Digest); > > - break; > > - > > - case HASH_API_ALGO_SHA1: > > + switch (PcdGet16 (PcdHashApiLibPolicy)) { > > + case HASH_ALG_SHA1: > > return Sha1Final (HashContext, Digest); > > break; > > > > - case HASH_API_ALGO_SHA256: > > + case HASH_ALG_SHA256: > > return Sha256Final (HashContext, Digest); > > break; > > > > - case HASH_API_ALGO_SHA384: > > + case HASH_ALG_SHA384: > > return Sha384Final (HashContext, Digest); > > break; > > > > - case HASH_API_ALGO_SHA512: > > + case HASH_ALG_SHA512: > > return Sha512Final (HashContext, Digest); > > break; > > > > - case HASH_API_ALGO_SM3_256: > > + case HASH_ALG_SM3_256: > > return Sm3Final (HashContext, Digest); > > break; > > > > @@ -293,32 +253,24 @@ HashApiHashAll ( > > OUT UINT8 *Digest > > ) > > { > > - switch (PcdGet8 (PcdHashApiLibPolicy)) { > > - case HASH_API_ALGO_MD4: > > - return Md4HashAll (DataToHash, DataToHashLen, > > Digest); > > - break; > > - > > - case HASH_API_ALGO_MD5: > > - return Md5HashAll (DataToHash, DataToHashLen, > > Digest); > > - break; > > - > > - case HASH_API_ALGO_SHA1: > > + switch (PcdGet16 (PcdHashApiLibPolicy)) { > > + case HASH_ALG_SHA1: > > return Sha1HashAll (DataToHash, DataToHashLen, Digest); > > break; > > > > - case HASH_API_ALGO_SHA256: > > + case HASH_ALG_SHA256: > > return Sha256HashAll (DataToHash, > DataToHashLen, > > Digest); > > break; > > > > - case HASH_API_ALGO_SHA384: > > + case HASH_ALG_SHA384: > > return Sha384HashAll (DataToHash, > DataToHashLen, > > Digest); > > break; > > > > - case HASH_API_ALGO_SHA512: > > + case HASH_ALG_SHA512: > > return Sha512HashAll (DataToHash, > DataToHashLen, > > Digest); > > break; > > > > - case HASH_API_ALGO_SM3_256: > > + case HASH_ALG_SM3_256: > > return Sm3HashAll (DataToHash, DataToHashLen, Digest); > > break; > > > > diff --git a/CryptoPkg/CryptoPkg.dec b/CryptoPkg/CryptoPkg.dec index=20 > > 8bd63a76dd22..f185bcc82515 100644 > > --- a/CryptoPkg/CryptoPkg.dec > > +++ b/CryptoPkg/CryptoPkg.dec > > @@ -74,16 +74,14 @@ [PcdsFixedAtBuild, PcdsPatchableInModule,=20 > > PcdsDynamic, PcdsDynamicEx] > > # Based on the value set, the required algorithm > is > > chosen to calculate > > # the hash of data.
> > # The default hashing algorithm for > BaseHashApiLib > > is set to SHA256.
> > - # 0x00000001 - MD4.
> > - # 0x00000002 - MD5.
> > - # 0x00000003 - SHA1.
> > - # 0x00000004 - SHA256.
> > - # 0x00000005 - SHA384.
> > - # 0x00000006 - SHA512.
> > - # 0x00000007 - SM3_256.
> > + # 0x00000001 - SHA1.
> > + # 0x00000002 - SHA256.
> > + # 0x00000004 - SHA384.
> > + # 0x00000008 - SHA512.
> > + # 0x00000010 - SM3_256.
>=20 > Update the names to match the define names in Tpm20.h such as=20 > HASH_ALG_SHA256. >=20 > > # @Prompt Set policy for hashing unsigned image > for > > Secure Boot. > > - # @ValidRange 0x80000001 | 0x00000001 - 0x00000007 > > - > > > gEfiCryptoPkgTokenSpaceGuid.PcdHashApiLibPolicy|0x04|UI > > NT8|0x00000001 > > + # @ValidRange 0x80000001 | 0x00000001 - 0x00000010 >=20 > Using ValidRange is not correct because not all the values from=20 > 0x0000001 - 0x00000010 are valid. Should change to @ValidList. >=20 > # @ValidList 0x80000001 | 0x00000001, 0x00000002, 0x00000004,=20 > 0x00000008, 0x00000010 >=20 > > + > > > gEfiCryptoPkgTokenSpaceGuid.PcdHashApiLibPolicy|0x02|UI > > NT16|0x00000001 > > > > [UserExtensions.TianoCore."ExtraFiles"] > > CryptoPkgExtra.uni > > diff --git a/CryptoPkg/CryptoPkg.uni b/CryptoPkg/CryptoPkg.uni index=20 > > 2222762f42ee..7e97ac7af8b7 100644 > > --- a/CryptoPkg/CryptoPkg.uni > > +++ b/CryptoPkg/CryptoPkg.uni > > @@ -21,13 +21,11 @@ > > > > "Based on the value set, the required algorithm is chosen to=20 > > calculate\n" > > > > "the hash of data.
\n" > > > > "The default hashing algorithm for BaseHashApiLib is set to=20 > > SHA256.
\n" > > - > > "0x00000001 - MD4.
\n" > > - > > "0x00000002 - MD5.
\n" > > - > > "0x00000003 - SHA1.
\n" > > - > > "0x00000004 - SHA256.
\n" > > - > > "0x00000005 - SHA384.
\n" > > - > > "0x00000006 - SHA512.
\n" > > - > > "0x00000007 - SM3.
" > > + > > "0x00000001 - SHA1.
\n" > > + > > "0x00000002 - SHA256.
\n" > > + > > "0x00000004 - SHA384.
\n" > > + > > "0x00000008 - SHA512.
\n" > > + > > "0x00000010 - SM3.
" >=20 > Update the names to match the define names in Tpm20.h such as=20 > HASH_ALG_SHA256. >=20 > > > > #string > > > STR_gEfiCryptoPkgTokenSpaceGuid_PcdCryptoServiceFamilyE > > nable_PROMPT #language en-US "Enable/Disable EDK II Crypto=20 > > Protocol/PPI services" > > > > diff --git a/CryptoPkg/Include/Library/HashApiLib.h > > b/CryptoPkg/Include/Library/HashApiLib.h > > index 22068e5a1756..b8b52ae15bd9 100644 > > --- a/CryptoPkg/Include/Library/HashApiLib.h > > +++ b/CryptoPkg/Include/Library/HashApiLib.h > > @@ -12,20 +12,10 @@ > > #ifndef __BASEHASHAPILIB_H_ > > #define __BASEHASHAPILIB_H_ >=20 > This define name does not match the pattern for other includes and=20 > BASE should not be used here. > Please change to: >=20 > #ifndef __HASH_API_LIB_H_ > #define __HASH_API_LIB_H_ >=20 > > > > +#include > > + > > typedef VOID *HASH_API_CONTEXT; > > > > -// > > -// Hash Algorithms > > -// > > -#define HASH_API_ALGO_INVALID 0x00000000 > > -#define HASH_API_ALGO_MD4 0x00000001 > > -#define HASH_API_ALGO_MD5 0x00000002 > > -#define HASH_API_ALGO_SHA1 0x00000003 > > -#define HASH_API_ALGO_SHA256 0x00000004 > > -#define HASH_API_ALGO_SHA384 0x00000005 > > -#define HASH_API_ALGO_SHA512 0x00000006 > > -#define HASH_API_ALGO_SM3_256 0x00000007 > > - > > /** > > Retrieves the size, in bytes, of the context > buffer > > required for hash operations. > > > > -- > > 2.16.2.windows.1