[edk2-devel] [PATCH v3 0/2] Enhancement and Fixes to BaseHashApiLib

Sukerkar, Amol N posted 2 patches 4 years, 2 months ago
Failed in applying to current master (apply log)
There is a newer version of this series
CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c | 121 ++++++--------------
CryptoPkg/CryptoPkg.dec                           |  18 ++-
CryptoPkg/CryptoPkg.uni                           |  12 +-
CryptoPkg/Include/Library/HashApiLib.h            |  16 +--
4 files changed, 52 insertions(+), 115 deletions(-)
[edk2-devel] [PATCH v3 0/2] Enhancement and Fixes to BaseHashApiLib
Posted by Sukerkar, Amol N 4 years, 2 months ago
This patch implements the fixes and enhancement to BaseHashApiLib in
the following manner:
- Remove reference to MD4 and MD5 hashing algorithms as they are
  deprecated;
- Align the enumeration for hashing algorithmswith the one used in
  TPM 2.0 implementation defined in IndustryStandard/Tpm20.h;
- Change the type of PcdHashApiLibPolicy to PcdsFixedAtBuild to
  optimize away the unused hashing algorithms for a particular
  instance of HashApiLib.

More information can be found at Bugzilla ticket,
https://bugzilla.tianocore.org/show_bug.cgi?id=2511.

Amol N Sukerkar (2):
  CryptoPkg/BaseHashApiLib: Align BaseHashApiLib with TPM 2.0
    Implementation
  CryptoPkg/BaseHashApiLib: Change PcdHashApiLibPolicy type to
    FixedAtBuild

 CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c | 121 ++++++--------------
 CryptoPkg/CryptoPkg.dec                           |  18 ++-
 CryptoPkg/CryptoPkg.uni                           |  12 +-
 CryptoPkg/Include/Library/HashApiLib.h            |  16 +--
 4 files changed, 52 insertions(+), 115 deletions(-)

-- 
2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#54483): https://edk2.groups.io/g/devel/message/54483
Mute This Topic: https://groups.io/mt/71287682/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v3 0/2] Enhancement and Fixes to BaseHashApiLib
Posted by Michael D Kinney 4 years, 2 months ago
Amol,

Thanks for the quick update.

I see you changed the PCD to type UINT16.  I think this was
based on Jiewen feedback to use a set of TPM specific 
algorithms defines that were UINT16.

However, the HASH define values being used are 32-bits
and everywhere else that those defines values are used,
they are also 32-bits.

I recommend we keep the type UINT32, and use 8 digit
hex values in all references to the values and valid
value checks.

Thanks,

Mike

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On
> Behalf Of Sukerkar, Amol N
> Sent: Friday, February 14, 2020 3:21 PM
> To: devel@edk2.groups.io
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>;
> Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J
> <jian.j.wang@intel.com>; Agrawal, Sachin
> <sachin.agrawal@intel.com>; Gao, Liming
> <liming.gao@intel.com>
> Subject: [edk2-devel] [PATCH v3 0/2] Enhancement and
> Fixes to BaseHashApiLib
> 
> This patch implements the fixes and enhancement to
> BaseHashApiLib in
> the following manner:
> - Remove reference to MD4 and MD5 hashing algorithms as
> they are
>   deprecated;
> - Align the enumeration for hashing algorithmswith the
> one used in
>   TPM 2.0 implementation defined in
> IndustryStandard/Tpm20.h;
> - Change the type of PcdHashApiLibPolicy to
> PcdsFixedAtBuild to
>   optimize away the unused hashing algorithms for a
> particular
>   instance of HashApiLib.
> 
> More information can be found at Bugzilla ticket,
> https://bugzilla.tianocore.org/show_bug.cgi?id=2511.
> 
> Amol N Sukerkar (2):
>   CryptoPkg/BaseHashApiLib: Align BaseHashApiLib with
> TPM 2.0
>     Implementation
>   CryptoPkg/BaseHashApiLib: Change PcdHashApiLibPolicy
> type to
>     FixedAtBuild
> 
>  CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c |
> 121 ++++++--------------
>  CryptoPkg/CryptoPkg.dec                           |
> 18 ++-
>  CryptoPkg/CryptoPkg.uni                           |
> 12 +-
>  CryptoPkg/Include/Library/HashApiLib.h            |
> 16 +--
>  4 files changed, 52 insertions(+), 115 deletions(-)
> 
> --
> 2.16.2.windows.1
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#54489): https://edk2.groups.io/g/devel/message/54489
Mute This Topic: https://groups.io/mt/71287682/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v3 0/2] Enhancement and Fixes to BaseHashApiLib
Posted by Sukerkar, Amol N 4 years, 2 months ago
Hi Mike,

Although the values were listed in 8-digit hex format, the PCD, PcdHashApiLibPolicy itself was of type UINT8 earlier that was changed to UINT16. I agree changing the type to UINT32 will align with all the other PCDs implementing TCG spec (and using Tpm20.h defines). Can you confirm my understanding is accurate?

Thanks,
Amol

-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@intel.com> 
Sent: Friday, February 14, 2020 5:04 PM
To: devel@edk2.groups.io; Sukerkar, Amol N <amol.n.sukerkar@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>
Cc: Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Agrawal, Sachin <sachin.agrawal@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: RE: [edk2-devel] [PATCH v3 0/2] Enhancement and Fixes to BaseHashApiLib

Amol,

Thanks for the quick update.

I see you changed the PCD to type UINT16.  I think this was based on Jiewen feedback to use a set of TPM specific algorithms defines that were UINT16.

However, the HASH define values being used are 32-bits and everywhere else that those defines values are used, they are also 32-bits.

I recommend we keep the type UINT32, and use 8 digit hex values in all references to the values and valid value checks.

Thanks,

Mike

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of 
> Sukerkar, Amol N
> Sent: Friday, February 14, 2020 3:21 PM
> To: devel@edk2.groups.io
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Yao, Jiewen 
> <jiewen.yao@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Agrawal, 
> Sachin <sachin.agrawal@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [edk2-devel] [PATCH v3 0/2] Enhancement and Fixes to 
> BaseHashApiLib
> 
> This patch implements the fixes and enhancement to BaseHashApiLib in 
> the following manner:
> - Remove reference to MD4 and MD5 hashing algorithms as they are
>   deprecated;
> - Align the enumeration for hashing algorithmswith the one used in
>   TPM 2.0 implementation defined in
> IndustryStandard/Tpm20.h;
> - Change the type of PcdHashApiLibPolicy to PcdsFixedAtBuild to
>   optimize away the unused hashing algorithms for a particular
>   instance of HashApiLib.
> 
> More information can be found at Bugzilla ticket, 
> https://bugzilla.tianocore.org/show_bug.cgi?id=2511.
> 
> Amol N Sukerkar (2):
>   CryptoPkg/BaseHashApiLib: Align BaseHashApiLib with TPM 2.0
>     Implementation
>   CryptoPkg/BaseHashApiLib: Change PcdHashApiLibPolicy type to
>     FixedAtBuild
> 
>  CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c |
> 121 ++++++--------------
>  CryptoPkg/CryptoPkg.dec                           |
> 18 ++-
>  CryptoPkg/CryptoPkg.uni                           |
> 12 +-
>  CryptoPkg/Include/Library/HashApiLib.h            |
> 16 +--
>  4 files changed, 52 insertions(+), 115 deletions(-)
> 
> --
> 2.16.2.windows.1
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#54490): https://edk2.groups.io/g/devel/message/54490
Mute This Topic: https://groups.io/mt/71287682/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v3 0/2] Enhancement and Fixes to BaseHashApiLib
Posted by Michael D Kinney 4 years, 2 months ago
Yes.  That is correct.

Mike

> -----Original Message-----
> From: Sukerkar, Amol N <amol.n.sukerkar@intel.com>
> Sent: Friday, February 14, 2020 4:12 PM
> To: Kinney, Michael D <michael.d.kinney@intel.com>;
> devel@edk2.groups.io
> Cc: Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J
> <jian.j.wang@intel.com>; Agrawal, Sachin
> <sachin.agrawal@intel.com>; Gao, Liming
> <liming.gao@intel.com>; Sukerkar, Amol N
> <amol.n.sukerkar@intel.com>
> Subject: RE: [edk2-devel] [PATCH v3 0/2] Enhancement
> and Fixes to BaseHashApiLib
> 
> Hi Mike,
> 
> Although the values were listed in 8-digit hex format,
> the PCD, PcdHashApiLibPolicy itself was of type UINT8
> earlier that was changed to UINT16. I agree changing
> the type to UINT32 will align with all the other PCDs
> implementing TCG spec (and using Tpm20.h defines). Can
> you confirm my understanding is accurate?
> 
> Thanks,
> Amol
> 
> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Friday, February 14, 2020 5:04 PM
> To: devel@edk2.groups.io; Sukerkar, Amol N
> <amol.n.sukerkar@intel.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>
> Cc: Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J
> <jian.j.wang@intel.com>; Agrawal, Sachin
> <sachin.agrawal@intel.com>; Gao, Liming
> <liming.gao@intel.com>
> Subject: RE: [edk2-devel] [PATCH v3 0/2] Enhancement
> and Fixes to BaseHashApiLib
> 
> Amol,
> 
> Thanks for the quick update.
> 
> I see you changed the PCD to type UINT16.  I think this
> was based on Jiewen feedback to use a set of TPM
> specific algorithms defines that were UINT16.
> 
> However, the HASH define values being used are 32-bits
> and everywhere else that those defines values are used,
> they are also 32-bits.
> 
> I recommend we keep the type UINT32, and use 8 digit
> hex values in all references to the values and valid
> value checks.
> 
> Thanks,
> 
> Mike
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On
> Behalf Of
> > Sukerkar, Amol N
> > Sent: Friday, February 14, 2020 3:21 PM
> > To: devel@edk2.groups.io
> > Cc: Kinney, Michael D <michael.d.kinney@intel.com>;
> Yao, Jiewen
> > <jiewen.yao@intel.com>; Wang, Jian J
> <jian.j.wang@intel.com>; Agrawal,
> > Sachin <sachin.agrawal@intel.com>; Gao, Liming
> <liming.gao@intel.com>
> > Subject: [edk2-devel] [PATCH v3 0/2] Enhancement and
> Fixes to
> > BaseHashApiLib
> >
> > This patch implements the fixes and enhancement to
> BaseHashApiLib in
> > the following manner:
> > - Remove reference to MD4 and MD5 hashing algorithms
> as they are
> >   deprecated;
> > - Align the enumeration for hashing algorithmswith
> the one used in
> >   TPM 2.0 implementation defined in
> > IndustryStandard/Tpm20.h;
> > - Change the type of PcdHashApiLibPolicy to
> PcdsFixedAtBuild to
> >   optimize away the unused hashing algorithms for a
> particular
> >   instance of HashApiLib.
> >
> > More information can be found at Bugzilla ticket,
> > https://bugzilla.tianocore.org/show_bug.cgi?id=2511.
> >
> > Amol N Sukerkar (2):
> >   CryptoPkg/BaseHashApiLib: Align BaseHashApiLib with
> TPM 2.0
> >     Implementation
> >   CryptoPkg/BaseHashApiLib: Change
> PcdHashApiLibPolicy type to
> >     FixedAtBuild
> >
> >  CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c |
> > 121 ++++++--------------
> >  CryptoPkg/CryptoPkg.dec                           |
> > 18 ++-
> >  CryptoPkg/CryptoPkg.uni                           |
> > 12 +-
> >  CryptoPkg/Include/Library/HashApiLib.h            |
> > 16 +--
> >  4 files changed, 52 insertions(+), 115 deletions(-)
> >
> > --
> > 2.16.2.windows.1
> >
> >
> > 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#54491): https://edk2.groups.io/g/devel/message/54491
Mute This Topic: https://groups.io/mt/71287682/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-