From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web09.2907.1663736177575463163 for ; Tue, 20 Sep 2022 21:56:17 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=myGu5t+D; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: yi1.li@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663736177; x=1695272177; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Z13Z1AHh5VK+aotlJ6RWLF0G+QaRhcp4JS/SysAKgNc=; b=myGu5t+D1RGxqAxEw7XRGZ8yqy4f6KDKhFK6usML+Wni/ey9YCgqjLv6 PM/o2IPamLxFZ/C7TGQHL39MfTwGjNC9MYR4k+6us4aM+5waAhIzY92bW jDi481gbjrgOHQ5fnfiCgzX6HMmpqGrvoNwDrVp8mxEnE5eOGTRKZiy0N MceEBmUIXd5addYNcNrVqCtDacYh63GchndvDSryYSVjPiG5bt65Ro53G juk5eXparBrQ/iS1MyaB++AXwhSNULgVKqmmIEoGbYRMCV5if+93wXf3x plbo/FN8pktx08wk2yprLJXHHIcH46ymBa/Qb2SPeYvykjbSwOnpGzqek A==; X-IronPort-AV: E=McAfee;i="6500,9779,10476"; a="279625094" X-IronPort-AV: E=Sophos;i="5.93,332,1654585200"; d="scan'208";a="279625094" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2022 21:56:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,332,1654585200"; d="scan'208";a="652381131" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga001.jf.intel.com with ESMTP; 20 Sep 2022 21:56:16 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 20 Sep 2022 21:56:15 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 20 Sep 2022 21:56:15 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Tue, 20 Sep 2022 21:56:15 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Tue, 20 Sep 2022 21:56:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PD6N9KqNTNDJ/G+UKIWIBkc40HYv0CBaF6ZWU2UHm4YlCOo20KZflpNvDnxFoJQL0CgkZFQ1qC0Vz7AEEN2bxrz/KYFkD/TC0cIeDpt+pgTO1zaNJ4gCdE0Mk4op8SpP6VGR2KuSTCpgbhIWgOp0RGD6+Loj2AZoh2Zq2uVil3OBq4vc4Mo3+amxw+VIWx9001JuRJ3t4LDhE61Ybmal2UUU0sE6aQ+Ep6LU5ywsGUSZGtUFagF6sWpWycg8DQAFtxH5BuPyxhFA0G94j+3h4ZrldeVr/plyhmqm9ZbvkbJz9aUH7FAZF0c3PEWwmvQQutasdf9WmGhFJyXtgBneGQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tTiytFvebzOCXaubHlW0G79OtwQeKiNWOZDfikOAnRg=; b=UTRrQnK3XWyOzg/QRZWkTYaHKO/IvvaYeu+/lWE2k72LcEq4Yynp4bAivBTE//JDdPfKhJs7Mdb28hPFf0uLt3u8nO6vLR1Xu3lsbVw+PIMzDxmgVm+DgZUr1UIvlUklqJwEI/bAY+ziIHAzjMeBsWy/hMlY2yZUT4O8lUiipx8CY+J8/fz5rnB7ctCl43/0yAjqvkSrFBOCPFnzfjwglI1lPLZSj3lJEfpkWmbrk+g9HNqhZ6Gb48iCnhjMjIc5hzfrl7VtaMI+2wXEJ1itZ+L9ofCYQsuPYrIvPF6rH91N2rDRRBdqBxHk83I8nUEUuR5AvLTwTcwSlNyDbAYIfg== 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 Received: from SJ1PR11MB6227.namprd11.prod.outlook.com (2603:10b6:a03:45a::10) by MW3PR11MB4538.namprd11.prod.outlook.com (2603:10b6:303:57::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.15; Wed, 21 Sep 2022 04:56:07 +0000 Received: from SJ1PR11MB6227.namprd11.prod.outlook.com ([fe80::1d65:f35c:c823:1b51]) by SJ1PR11MB6227.namprd11.prod.outlook.com ([fe80::1d65:f35c:c823:1b51%9]) with mapi id 15.20.5588.011; Wed, 21 Sep 2022 04:56:07 +0000 From: "yi1 li" To: "Yao, Jiewen" , "devel@edk2.groups.io" CC: "Wang, Jian J" , "Lu, Xiaoyu1" , "Jiang, Guomin" Subject: Re: [PATCH 0/7] CryptoPkg: Add BigNum and EC support to BaseCryptLib Thread-Topic: [PATCH 0/7] CryptoPkg: Add BigNum and EC support to BaseCryptLib Thread-Index: AQHYwpP9g6g92m1BBkCDKZSrmzoPZa3oj2GAgACtlJA= Date: Wed, 21 Sep 2022 04:56:07 +0000 Message-ID: References: In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d1eed2e2-5992-4f74-6a87-08da9b8d9860 x-ms-traffictypediagnostic: MW3PR11MB4538:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: qCvn3ilfiVqff/Msa1PgVFzUZRd+YLMFl9JHiwkY4vR0R5dHH2rjYwZM41v5/j979Je9FcYAVPmsImQmY4Al6RaNuEmatF/Sa/4pV5ZFtQFdG7LFo+/ip6T0uaNJleeWCq/E8TPmiiAXD+3scM+agrGLl1lQcUIG6d1qwmUZF5RVvI8d68B66u41kOd8nRJk1OHBeDYfFDTzGl9vbZSgV7BXoUfYV5gHedAKX2n70FtC3q8IUUQR9jq5GF25jMtiP9Cmcd0LkO5F49y6sZ4amPAWjpeac2iBx1B0IJTyTMz5r57al6uwf6Kz2nL+jQmKwsxF9+oe1yKNMkO6X5srydeRODrkVcS1HE0Fk6EGZe65Jey9VdgiwBdthU/DES4qK/EQ52lCR/WKBb+pW8XAX6hV8Sq9AVpgB064XScyJQWVz8KjoSa4HWH5Sb7sXgS8FBaxSD2drf5/S8RCcsYAn+pbvHFS+w3GG0jtJ92vX7AFO7YV5eokCfnJ1GS9dDBAz3/1XuiWLX97Bxu263drA7VOlcLAa0raQXDiABfGEPV1EoeORFtlLXNfYX4gG8Yr3DpoSWSm1suaTPb+vJfneke0vhE5M33OMQHe8RlpAiRnz51DBg5vOhnZ0CYUbLFQ4msWKfpOJWit7tgOgPawRBF77fxGnN00RdjQh9xrrRyu5dYSm8fHXw0Y3SiTukvQFcsSaWmC2MsG/G61Ndo2a1p88p+RkJu5UFDpHRTPoegfvcO2cfY697P6oaBDKSGndyUU7AY4RvUeZUpv+gQ7ifziEKPs9UomRGD+Rzr95mSCKBsE4IYW7knpVd3BmCRjudgvBMKtVd8qwDizIvdqzw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ1PR11MB6227.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(346002)(396003)(39860400002)(366004)(376002)(451199015)(107886003)(966005)(86362001)(478600001)(71200400001)(8936002)(41300700001)(316002)(5660300002)(66476007)(8676002)(110136005)(54906003)(4326008)(66946007)(52536014)(66556008)(64756008)(76116006)(33656002)(66446008)(38070700005)(122000001)(55016003)(38100700002)(82960400001)(186003)(53546011)(7696005)(6506007)(26005)(9686003)(83380400001)(2906002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?aLfYaMq6m1hfVqbLpcGWq3gOdsbrqi3SwOx6wziJypbMe8AWYlkDLT4C9HU4?= =?us-ascii?Q?vWpjjkWNoKmMTStBLxUItgIs5KfQwsgPXVZoM0mBF/0j0DZuisG/yB2pzGeo?= =?us-ascii?Q?cNVQhN1FXGVXXOUahUPUOEeyj69llBc06ZCvs3kZwb/Uf04JGRR/suQViYpe?= =?us-ascii?Q?3Q9qATH/Z4RGG2/vpJ36NixI2UQ5TXtZ/asXjCe/+bngG2aLoJX1CJw1dirZ?= =?us-ascii?Q?FT6maXgvFtfZJkFIaj3uFIkiJCDhgZLhnu968xKx6gLteCLTE4MTmPZ7VFld?= =?us-ascii?Q?CvRboWBFB1VXaeXy7CnlgZ5+k1P6DIyIpMDo3gPiKaVAqHkyTUGzryh2rRJB?= =?us-ascii?Q?8m6deavoOpJBe3lOszXTSD+PMVWhplwNv/kK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r7wVyA1lj1c/HpqI54VCHtaWvCy5EClwP4d5o3?= =?us-ascii?Q?mT9iE9SqVbjdbODaOd6wY6NG3FBaicpwPtuUIuqhX7K3tMCbol+e6ZNFKays?= =?us-ascii?Q?roOx5VWfJsbgh9VO0/fK8IWlBZfih3/KBO39zjkmSuH7khL0102Yb545+Ro+?= =?us-ascii?Q?deWYoLaXpAceRyQGIxUqvbSqLBd1zM2aA7wudFY6B0E4NZrQUDdPGo1JqJ8n?= =?us-ascii?Q?u11H9BRQkblA8NQRi3kDzUvxbVyqNh5jzi54blPrEqTMCe1vUXbQRM0sJ7/s?= =?us-ascii?Q?SV5TmKSKk/Etjnwll6o=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ1PR11MB6227.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d1eed2e2-5992-4f74-6a87-08da9b8d9860 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Sep 2022 04:56:07.5183 (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: 6a3QutIJiCvq35mRNOvr32yqVLLTnJplVRylTnHwOHy0quZLcweW4NDE6xSvca8wrolsGYcKoQ19479auG05fA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR11MB4538 Return-Path: yi1.li@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Jiewen, Thanks for review, changes done. Since both BN and EC extend many structures, splitting them will cause git = conflicts, I've adjusted the order of patches: Ec commits are based on Bn commits. Jus= t convenient for merge. Thanks, Yi -----Original Message----- From: Yao, Jiewen =20 Sent: Wednesday, September 21, 2022 12:02 AM To: Li, Yi1 ; devel@edk2.groups.io Cc: Wang, Jian J ; Xiaoyu Lu ;= Jiang, Guomin Subject: RE: [PATCH 0/7] CryptoPkg: Add BigNum and EC support to BaseCryptL= ib Thanks for the patch. Please: 1) Separate BN and EC. Please submit 2 different patch sets. One for EC, th= e other for BN. 2) Please squash uncrustify tool update into previous patch. No need to sub= mit a standalone one. 3) Please increase EDKII_CRYPTO_VERSION. With that change, reviewed-by: Jiewen Yao > -----Original Message----- > From: Li, Yi1 > Sent: Wednesday, September 7, 2022 4:29 PM > To: devel@edk2.groups.io > Cc: Li, Yi1 ; Yao, Jiewen ;=20 > Wang, Jian J ; Xiaoyu Lu=20 > ; Jiang, Guomin > Subject: [PATCH 0/7] CryptoPkg: Add BigNum and EC support to=20 > BaseCryptLib >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3828 >=20 > Review PR: https://github.com/tianocore/edk2/pull/3309 > This patch sequence is used to add CryptBn and CryptEc library, which=20 > are wrapped over OpenSSL. The implementation provides library=20 > functions for EFI BaseCrypt protocol and EFI BaseCrypt Configuration Prot= ocol. >=20 > All APIs passed unit test and fuzzing test, detail as: > 1. Unit test: > The purpose of unit testing is to ensure that the function obtains the=20 > expected result under specific input, that is, to ensure the=20 > correctness of APIs. > All test case show in patch 5 and patch 6: > CryptoPkg/Test: Add unit test for CryptoBn > CryptoPkg/Test: Add unit test for CryptoEc 2. Fuzzing test: > Various Fuzz Testing are employed across the all introduced APIs, and=20 > the test is used AFL (2.52b) and Libfuzzer (clang+llvm-11.0.0) as the=20 > fuzzer, based on HBFA. > Fuzzing Pass Rate is 100%; > The Code Coverage of CryptBn is 100%; > The Code Coverage of CryptEc is 90.3%. > All test case show in: > https://github.com/liyi77/edk2- > staging/tree/HBFA/HBFA/UefiHostFuzzTestCasePkg/TestCase/CryptoPkg >=20 > Tested-by: Yi Li > Cc: Jiewen Yao > Cc: Jian J Wang > Cc: Xiaoyu Lu > Cc: Guomin Jiang >=20 > Signed-off-by: Yi Li >=20 > Yi Li (7): > CryptoPkg: Add BigNum support > CryptoPkg: Add BigNum API to DXE and protocol > CryptoPkg: Add EC support > CryptoPkg: Add EC APIs to DXE and protocol > CryptoPkg/Test: Add unit test for CryptoBn > CryptoPkg/Test: Add unit test for CryptoEc > CryptoPkg: Run uncrustify tools on EC and BN change >=20 > CryptoPkg/CryptoPkg.dsc | 2 + > CryptoPkg/Driver/Crypto.c | 1016 +++++++++++++- > CryptoPkg/Include/Library/BaseCryptLib.h | 842 ++++++++++++ > .../Pcd/PcdCryptoServiceFamilyEnable.h | 55 + > .../Library/BaseCryptLib/BaseCryptLib.inf | 3 + > CryptoPkg/Library/BaseCryptLib/Bn/CryptBn.c | 581 ++++++++ > .../Library/BaseCryptLib/Bn/CryptBnNull.c | 520 ++++++++ > .../Library/BaseCryptLib/PeiCryptLib.inf | 2 + > CryptoPkg/Library/BaseCryptLib/Pk/CryptEc.c | 765 +++++++++++ > .../Library/BaseCryptLib/Pk/CryptEcNull.c | 496 +++++++ > .../Library/BaseCryptLib/SmmCryptLib.inf | 2 + > .../BaseCryptLib/UnitTestHostBaseCryptLib.inf | 3 + > .../BaseCryptLibNull/BaseCryptLibNull.inf | 2 + > .../Library/BaseCryptLibNull/Bn/CryptBnNull.c | 520 ++++++++ =20 > .../Library/BaseCryptLibNull/Pk/CryptEcNull.c | 496 +++++++ > .../BaseCryptLibOnProtocolPpi/CryptLib.c | 961 ++++++++++++++ > CryptoPkg/Private/Protocol/Crypto.h | 1176 ++++++++++++++--- > CryptoPkg/Test/CryptoPkgHostUnitTest.dsc | 3 + > .../BaseCryptLib/BaseCryptLibUnitTests.c | 2 + > .../UnitTest/Library/BaseCryptLib/BnTests.c | 266 ++++ > .../UnitTest/Library/BaseCryptLib/EcTests.c | 290 ++++ > .../Library/BaseCryptLib/TestBaseCryptLib.h | 5 + > .../BaseCryptLib/TestBaseCryptLibHost.inf | 2 + > .../BaseCryptLib/TestBaseCryptLibShell.inf | 2 + > 24 files changed, 7852 insertions(+), 160 deletions(-) create mode=20 > 100644 CryptoPkg/Library/BaseCryptLib/Bn/CryptBn.c > create mode 100644 CryptoPkg/Library/BaseCryptLib/Bn/CryptBnNull.c > create mode 100644 CryptoPkg/Library/BaseCryptLib/Pk/CryptEc.c > create mode 100644 CryptoPkg/Library/BaseCryptLib/Pk/CryptEcNull.c > create mode 100644 > CryptoPkg/Library/BaseCryptLibNull/Bn/CryptBnNull.c > create mode 100644=20 > CryptoPkg/Library/BaseCryptLibNull/Pk/CryptEcNull.c > create mode 100644 > CryptoPkg/Test/UnitTest/Library/BaseCryptLib/BnTests.c > create mode 100644 > CryptoPkg/Test/UnitTest/Library/BaseCryptLib/EcTests.c >=20 > -- > 2.31.1.windows.1