[edk2-devel] [PATCH 0/5] CryptoPkg: Add HMAC-SHA384 cipher support.

Qi Zhang posted 5 patches 1 year, 8 months ago
Failed in applying to current master (apply log)
There is a newer version of this series
CryptoPkg/CryptoPkg.dsc                       |   3 +
CryptoPkg/Driver/Crypto.c                     | 221 ++++++
CryptoPkg/Include/Library/BaseCryptLib.h      | 188 ++++++
.../Pcd/PcdCryptoServiceFamilyEnable.h        |  13 +
.../Library/BaseCryptLib/BaseCryptLib.inf     |   2 +-
.../Library/BaseCryptLib/Hmac/CryptHmac.c     | 629 ++++++++++++++++++
.../Library/BaseCryptLib/Hmac/CryptHmacNull.c | 359 ++++++++++
.../BaseCryptLib/Hmac/CryptHmacSha256.c       | 217 ------
.../BaseCryptLib/Hmac/CryptHmacSha256Null.c   | 139 ----
.../Library/BaseCryptLib/PeiCryptLib.inf      |   2 +-
.../Library/BaseCryptLib/RuntimeCryptLib.inf  |   2 +-
.../Library/BaseCryptLib/SecCryptLib.inf      |   2 +-
.../Library/BaseCryptLib/SmmCryptLib.inf      |   2 +-
.../BaseCryptLib/UnitTestHostBaseCryptLib.inf |   2 +-
.../BaseCryptLibNull/BaseCryptLibNull.inf     |   2 +-
.../BaseCryptLibNull/Hmac/CryptHmacNull.c     | 359 ++++++++++
.../Hmac/CryptHmacSha256Null.c                | 139 ----
.../BaseCryptLibOnProtocolPpi/CryptLib.c      | 212 ++++++
CryptoPkg/Private/Protocol/Crypto.h           | 197 ++++++
.../UnitTest/Library/BaseCryptLib/HmacTests.c |  19 +
20 files changed, 2207 insertions(+), 502 deletions(-)
create mode 100644 CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmac.c
create mode 100644 CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacNull.c
delete mode 100644 CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256.c
delete mode 100644 CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256Null.c
create mode 100644 CryptoPkg/Library/BaseCryptLibNull/Hmac/CryptHmacNull.c
delete mode 100644 CryptoPkg/Library/BaseCryptLibNull/Hmac/CryptHmacSha256Null.c
[edk2-devel] [PATCH 0/5] CryptoPkg: Add HMAC-SHA384 cipher support.
Posted by Qi Zhang 1 year, 8 months ago
HmacSha256 is already supported on Edk2. This patchset is to add
HmacSha384 support.

With this change, the size increase of BaseCyrptLib is about 7K bytes.
HmacSha384 function is verifed by the Host UnitTest.
And also it has been integratd in
https://github.com/tianocore/edk2-staging/tree/DeviceSecurity and been
verified.

All the code change is on the PR https://github.com/tianocore/edk2/pull/3224.


REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4025

Signed-off-by: Qi Zhang <qi1.zhang@intel.com>
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>

Qi Zhang (5):
  CryptoPkg: Add new hmac definition to cryptlib
  CryptoPkg: Add HMAC-SHA384 cipher support.
  CryptoPkg: Update CryptLib inf as the file name changed.
  CryptoPkg: Add new hmac SHA api to Crypto Service.
  CryptoPkg: add Hmac Sha384 to host UnitTest.

 CryptoPkg/CryptoPkg.dsc                       |   3 +
 CryptoPkg/Driver/Crypto.c                     | 221 ++++++
 CryptoPkg/Include/Library/BaseCryptLib.h      | 188 ++++++
 .../Pcd/PcdCryptoServiceFamilyEnable.h        |  13 +
 .../Library/BaseCryptLib/BaseCryptLib.inf     |   2 +-
 .../Library/BaseCryptLib/Hmac/CryptHmac.c     | 629 ++++++++++++++++++
 .../Library/BaseCryptLib/Hmac/CryptHmacNull.c | 359 ++++++++++
 .../BaseCryptLib/Hmac/CryptHmacSha256.c       | 217 ------
 .../BaseCryptLib/Hmac/CryptHmacSha256Null.c   | 139 ----
 .../Library/BaseCryptLib/PeiCryptLib.inf      |   2 +-
 .../Library/BaseCryptLib/RuntimeCryptLib.inf  |   2 +-
 .../Library/BaseCryptLib/SecCryptLib.inf      |   2 +-
 .../Library/BaseCryptLib/SmmCryptLib.inf      |   2 +-
 .../BaseCryptLib/UnitTestHostBaseCryptLib.inf |   2 +-
 .../BaseCryptLibNull/BaseCryptLibNull.inf     |   2 +-
 .../BaseCryptLibNull/Hmac/CryptHmacNull.c     | 359 ++++++++++
 .../Hmac/CryptHmacSha256Null.c                | 139 ----
 .../BaseCryptLibOnProtocolPpi/CryptLib.c      | 212 ++++++
 CryptoPkg/Private/Protocol/Crypto.h           | 197 ++++++
 .../UnitTest/Library/BaseCryptLib/HmacTests.c |  19 +
 20 files changed, 2207 insertions(+), 502 deletions(-)
 create mode 100644 CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmac.c
 create mode 100644 CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacNull.c
 delete mode 100644 CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256.c
 delete mode 100644 CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256Null.c
 create mode 100644 CryptoPkg/Library/BaseCryptLibNull/Hmac/CryptHmacNull.c
 delete mode 100644 CryptoPkg/Library/BaseCryptLibNull/Hmac/CryptHmacSha256Null.c

-- 
2.26.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92652): https://edk2.groups.io/g/devel/message/92652
Mute This Topic: https://groups.io/mt/93199404/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 0/5] CryptoPkg: Add HMAC-SHA384 cipher support.
Posted by Yao, Jiewen 1 year, 7 months ago
Thanks for the patch. Please
1) Update the EDKII_CRYPTO_VERSION to higher version
2) Update always append new API to the end of _EDKII_CRYPTO_PROTOCOL (don't insert in the middle)

With that change, reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>

> -----Original Message-----
> From: Zhang, Qi1 <qi1.zhang@intel.com>
> Sent: Tuesday, August 23, 2022 3:06 PM
> To: devel@edk2.groups.io
> Cc: Zhang, Qi1 <qi1.zhang@intel.com>; Yao, Jiewen
> <jiewen.yao@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Lu, Xiaoyu1
> <xiaoyu1.lu@intel.com>; Jiang, Guomin <guomin.jiang@intel.com>
> Subject: [PATCH 0/5] CryptoPkg: Add HMAC-SHA384 cipher support.
> 
> HmacSha256 is already supported on Edk2. This patchset is to add
> HmacSha384 support.
> 
> With this change, the size increase of BaseCyrptLib is about 7K bytes.
> HmacSha384 function is verifed by the Host UnitTest.
> And also it has been integratd in
> https://github.com/tianocore/edk2-staging/tree/DeviceSecurity and been
> verified.
> 
> All the code change is on the PR
> https://github.com/tianocore/edk2/pull/3224.
> 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4025
> 
> Signed-off-by: Qi Zhang <qi1.zhang@intel.com>
> 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>
> 
> Qi Zhang (5):
>   CryptoPkg: Add new hmac definition to cryptlib
>   CryptoPkg: Add HMAC-SHA384 cipher support.
>   CryptoPkg: Update CryptLib inf as the file name changed.
>   CryptoPkg: Add new hmac SHA api to Crypto Service.
>   CryptoPkg: add Hmac Sha384 to host UnitTest.
> 
>  CryptoPkg/CryptoPkg.dsc                       |   3 +
>  CryptoPkg/Driver/Crypto.c                     | 221 ++++++
>  CryptoPkg/Include/Library/BaseCryptLib.h      | 188 ++++++
>  .../Pcd/PcdCryptoServiceFamilyEnable.h        |  13 +
>  .../Library/BaseCryptLib/BaseCryptLib.inf     |   2 +-
>  .../Library/BaseCryptLib/Hmac/CryptHmac.c     | 629
> ++++++++++++++++++
>  .../Library/BaseCryptLib/Hmac/CryptHmacNull.c | 359 ++++++++++
>  .../BaseCryptLib/Hmac/CryptHmacSha256.c       | 217 ------
>  .../BaseCryptLib/Hmac/CryptHmacSha256Null.c   | 139 ----
>  .../Library/BaseCryptLib/PeiCryptLib.inf      |   2 +-
>  .../Library/BaseCryptLib/RuntimeCryptLib.inf  |   2 +-
>  .../Library/BaseCryptLib/SecCryptLib.inf      |   2 +-
>  .../Library/BaseCryptLib/SmmCryptLib.inf      |   2 +-
>  .../BaseCryptLib/UnitTestHostBaseCryptLib.inf |   2 +-
>  .../BaseCryptLibNull/BaseCryptLibNull.inf     |   2 +-
>  .../BaseCryptLibNull/Hmac/CryptHmacNull.c     | 359 ++++++++++
>  .../Hmac/CryptHmacSha256Null.c                | 139 ----
>  .../BaseCryptLibOnProtocolPpi/CryptLib.c      | 212 ++++++
>  CryptoPkg/Private/Protocol/Crypto.h           | 197 ++++++
>  .../UnitTest/Library/BaseCryptLib/HmacTests.c |  19 +
>  20 files changed, 2207 insertions(+), 502 deletions(-)
>  create mode 100644 CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmac.c
>  create mode 100644
> CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacNull.c
>  delete mode 100644
> CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256.c
>  delete mode 100644
> CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256Null.c
>  create mode 100644
> CryptoPkg/Library/BaseCryptLibNull/Hmac/CryptHmacNull.c
>  delete mode 100644
> CryptoPkg/Library/BaseCryptLibNull/Hmac/CryptHmacSha256Null.c
> 
> --
> 2.26.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94002): https://edk2.groups.io/g/devel/message/94002
Mute This Topic: https://groups.io/mt/93199404/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 0/5] CryptoPkg: Add HMAC-SHA384 cipher support.
Posted by Qi Zhang 1 year, 7 months ago
Hi, Jiewen

Thanks for review. I've sent out v2 patch set for HMAC-SHA384, Hkdf SHA384, AeadAesGcm with comments addressed.

All the change is on PR https://github.com/tianocore/edk2/pull/3224. The merge order shall be HMAC-SHA384 ->  Hkdf SHA384 ->  AeadAesGcm.

Thank you!
Qi Zhang

-----Original Message-----
From: Yao, Jiewen <jiewen.yao@intel.com> 
Sent: Tuesday, September 20, 2022 11:53 PM
To: Zhang, Qi1 <qi1.zhang@intel.com>; devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@intel.com>; Lu, Xiaoyu1 <xiaoyu1.lu@intel.com>; Jiang, Guomin <guomin.jiang@intel.com>
Subject: RE: [PATCH 0/5] CryptoPkg: Add HMAC-SHA384 cipher support.

Thanks for the patch. Please
1) Update the EDKII_CRYPTO_VERSION to higher version
2) Update always append new API to the end of _EDKII_CRYPTO_PROTOCOL (don't insert in the middle)

With that change, reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>

> -----Original Message-----
> From: Zhang, Qi1 <qi1.zhang@intel.com>
> Sent: Tuesday, August 23, 2022 3:06 PM
> To: devel@edk2.groups.io
> Cc: Zhang, Qi1 <qi1.zhang@intel.com>; Yao, Jiewen 
> <jiewen.yao@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Lu, 
> Xiaoyu1 <xiaoyu1.lu@intel.com>; Jiang, Guomin <guomin.jiang@intel.com>
> Subject: [PATCH 0/5] CryptoPkg: Add HMAC-SHA384 cipher support.
> 
> HmacSha256 is already supported on Edk2. This patchset is to add
> HmacSha384 support.
> 
> With this change, the size increase of BaseCyrptLib is about 7K bytes.
> HmacSha384 function is verifed by the Host UnitTest.
> And also it has been integratd in
> https://github.com/tianocore/edk2-staging/tree/DeviceSecurity and been 
> verified.
> 
> All the code change is on the PR
> https://github.com/tianocore/edk2/pull/3224.
> 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4025
> 
> Signed-off-by: Qi Zhang <qi1.zhang@intel.com>
> 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>
> 
> Qi Zhang (5):
>   CryptoPkg: Add new hmac definition to cryptlib
>   CryptoPkg: Add HMAC-SHA384 cipher support.
>   CryptoPkg: Update CryptLib inf as the file name changed.
>   CryptoPkg: Add new hmac SHA api to Crypto Service.
>   CryptoPkg: add Hmac Sha384 to host UnitTest.
> 
>  CryptoPkg/CryptoPkg.dsc                       |   3 +
>  CryptoPkg/Driver/Crypto.c                     | 221 ++++++
>  CryptoPkg/Include/Library/BaseCryptLib.h      | 188 ++++++
>  .../Pcd/PcdCryptoServiceFamilyEnable.h        |  13 +
>  .../Library/BaseCryptLib/BaseCryptLib.inf     |   2 +-
>  .../Library/BaseCryptLib/Hmac/CryptHmac.c     | 629
> ++++++++++++++++++
>  .../Library/BaseCryptLib/Hmac/CryptHmacNull.c | 359 ++++++++++
>  .../BaseCryptLib/Hmac/CryptHmacSha256.c       | 217 ------
>  .../BaseCryptLib/Hmac/CryptHmacSha256Null.c   | 139 ----
>  .../Library/BaseCryptLib/PeiCryptLib.inf      |   2 +-
>  .../Library/BaseCryptLib/RuntimeCryptLib.inf  |   2 +-
>  .../Library/BaseCryptLib/SecCryptLib.inf      |   2 +-
>  .../Library/BaseCryptLib/SmmCryptLib.inf      |   2 +-
>  .../BaseCryptLib/UnitTestHostBaseCryptLib.inf |   2 +-
>  .../BaseCryptLibNull/BaseCryptLibNull.inf     |   2 +-
>  .../BaseCryptLibNull/Hmac/CryptHmacNull.c     | 359 ++++++++++
>  .../Hmac/CryptHmacSha256Null.c                | 139 ----
>  .../BaseCryptLibOnProtocolPpi/CryptLib.c      | 212 ++++++
>  CryptoPkg/Private/Protocol/Crypto.h           | 197 ++++++
>  .../UnitTest/Library/BaseCryptLib/HmacTests.c |  19 +
>  20 files changed, 2207 insertions(+), 502 deletions(-)  create mode 
> 100644 CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmac.c
>  create mode 100644
> CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacNull.c
>  delete mode 100644
> CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256.c
>  delete mode 100644
> CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256Null.c
>  create mode 100644
> CryptoPkg/Library/BaseCryptLibNull/Hmac/CryptHmacNull.c
>  delete mode 100644
> CryptoPkg/Library/BaseCryptLibNull/Hmac/CryptHmacSha256Null.c
> 
> --
> 2.26.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94181): https://edk2.groups.io/g/devel/message/94181
Mute This Topic: https://groups.io/mt/93199404/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-