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.web11.14028.1663689708150874236 for ; Tue, 20 Sep 2022 09:01:48 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=WbYRs7H0; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: jiewen.yao@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663689708; x=1695225708; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=NWQsVtZ22EFy6WgTUqhYa9P91cflNm6he3B6dUuzgk4=; b=WbYRs7H0idPUAf+j/XD/OWIhiv0gqZl6oUpY7aETOzANYvps36SkFRkg Hqct1e0kDz51eVORBwfN6s85vxXP4sfzc7Bz+eltS0FcLPVpibFGRiiLS wb62vrbgoL7fXdsFSuwMLW13CbNbNJam8SK6jmXFJ+T/QxBFOzRTIlrYz cvXMm5hq/w8A3yBubGrCj+U0c5zl8oa9DuovzeR5B+Zn33r8840ehEhbf o8k2udkfr6KlSMGWxjo+nzpidk+dCRFVN/+gBcbLs2wQTfOzNPt+5Oz+U iFERs7i9K4ZzWnj4I0KO+1m9RjZABu/4WvtkAzfE/C/6UEjCyIhPA8G7U Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10476"; a="279465963" X-IronPort-AV: E=Sophos;i="5.93,331,1654585200"; d="scan'208";a="279465963" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2022 09:01:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,331,1654585200"; d="scan'208";a="761360093" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga001.fm.intel.com with ESMTP; 20 Sep 2022 09:01:43 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX603.amr.corp.intel.com (10.22.229.16) 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 09:01:43 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) 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.2375.31 via Frontend Transport; Tue, 20 Sep 2022 09:01:43 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.108) by edgegateway.intel.com (134.134.137.102) 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 09:01:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BNxv6PaRySa+Apu3DmTk7I8CCG2dYzjTU/P5ZZezjnnlz2qvBAKgk93pUhNih6Qu3GCTOXWPMRDvycqcA1grck0jIkhIJVKcyzWqiFDplZzv6SVLumsAtJa9IzyHNXhjNHufqVK0yJg/DzomWjbj/nTaIiAUwmU1FLg0svSBlPo5LTjQCz2ZE0M1GU+4OyafL0l2awWyGY3bTGecjzEkwaBGZuFhuzb721DQfKou4xuiI+Hfi4fp5IptaGOQSzGtj2ekRZUAuOhMKtSqrOh4BrMHoemDtL9tpCpnwlCVutzWxu/PGoI8vBMnCL7SC1K7Y/JzWCkx9bnPbmTKjyYTCw== 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=T6h8RAFcvS1OgbSwwAjWm0/zRrGlANykgHD+4McKGUU=; b=cOVItbM7T9uoBBXLNx0ER3O3T4xgbmncDcZ5E1k2P7dkmaKB5ZOpNEL2Q/0lOg/Asafa2wKuEiZ0t1tOhAvf5ygqFr6lFKBUcDh+WwkDRmbFU1ItBFghbnGY6LJzkam47tb3U+45/SLwXVRNnT0gaZW3bPE0KFzFpPSTF251zMhLCjBzCi3WMr8NkBDXXhveT5toz8XIA9I78+8Y0H1j6LgfHf+E8b+QuUrJBT9kQyTxrP+RjnpzwOx+jeViqaMVCAIqGgMKdyQwwibWHXJW0VzD4iqtViA6CM6MyaXYMhbOqkbqkQYkzgMzEfLKsCg8DR+r/MUg9asLk6mXN+3cZg== 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 MW4PR11MB5872.namprd11.prod.outlook.com (2603:10b6:303:169::14) by BL1PR11MB5480.namprd11.prod.outlook.com (2603:10b6:208:314::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21; Tue, 20 Sep 2022 16:01:39 +0000 Received: from MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::c17d:f1c9:e958:b5e]) by MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::c17d:f1c9:e958:b5e%6]) with mapi id 15.20.5632.016; Tue, 20 Sep 2022 16:01:39 +0000 From: "Yao, Jiewen" 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 BaseCryptLib Thread-Topic: [PATCH 0/7] CryptoPkg: Add BigNum and EC support to BaseCryptLib Thread-Index: AQHYwpP9HrnMkybXh0S9Crp+4Ik2GK3ojdqQ Date: Tue, 20 Sep 2022 16:01:39 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.500.17 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR11MB5872:EE_|BL1PR11MB5480:EE_ x-ms-office365-filtering-correlation-id: 460ad759-4936-44d8-41d5-08da9b21674e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: p5Y6pqExDwCI1rtYogiQErr0WYQWQpzunIa60e6KO7h/q2qjjqgXGXb2X1g3xmyMfAGHDc8wzKmHU5tiROI51CpE+4kxS5qjORWLJdNTG9jE/s2gPGRu+H15t2oMrmm3e0o5faQPFDjBIbXQJqITnSh/7kafuABTLz4I8pLDLmtNiJF8rgPRLwTG9ssSofQH4cwaTRDkxvNBaDttkS8iSTW85n6ABi5CtmE0iNWCKF/jaBSY+oVvBd6IwOia/Y3DkqECUcCI04r2LuEv7LYCPBlt+IHyAp3ujHppvFDgBBa1rn+tev9m5Eo8UZ4O9YdQZ3yJQjT6+6ICkNgRDQB+bO5uadIO4v3h4XvAL8eDg/b31bLNH8ITc0XF0VhpDLv5IhHLGpHZlzKJlLe0QO0wg7K1gOikQ6UhGFSyP8dd84jGTMlbhr5ncPJrzDj+T54jKLvVJAp3k7FQafJK58At9N53lvDC5bXE7vK/ertVsZGapB8sUea3lx3QJtL9Sg7TYAlT8L4v+qiRTkbi97pNpImh1Fos8EPTOhtrOLSzAZhfY++YkOuvuY5uDmmySGDK5hwyiM6HRgFfKTsjI/0DvYQ1BS1f/QRxD1+5nKvd1Q5oSsLLif37cDMsp13l0xpWWMoWl4IuFMlToTguP/ITdfdsfP/MZNQDGfMUBb6wLkCvqHd43MJPg1z6qpDV81j8Rtg2eUPTAw3nX7P/KU/qSCQT/Z1ToA6QWI3CJDW7nkU9jaLsSd9n0DUMpugPUBiOyYhLNni5L6VjPv5AAFUvdtxlzPjlRYULdJ45l+Mjk72QDbLQpDgMDGCMd0I3Ihw9O8vLOSTLvNdV626w/W4Aeg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR11MB5872.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(39860400002)(136003)(396003)(346002)(376002)(366004)(451199015)(966005)(2906002)(54906003)(38070700005)(7696005)(66446008)(66946007)(53546011)(41300700001)(6506007)(64756008)(107886003)(55016003)(4326008)(33656002)(76116006)(8676002)(83380400001)(66476007)(110136005)(52536014)(316002)(5660300002)(186003)(8936002)(71200400001)(478600001)(66556008)(86362001)(38100700002)(26005)(9686003)(122000001)(82960400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?vGIcPe8B/KJ/FDtAeav/Xao6d6s2jgHTaqmxKiko4+V53Ab1B60quWU+eDRu?= =?us-ascii?Q?Izm6rgTT9VRTRCn8Nc3ZvtNS1JsQGZFDOZR7n4YQt4MsqSlGthZncjykDdP3?= =?us-ascii?Q?+VO52adS9r4x/tePi5F9osv4kUrvrJ9WE53kgp/sxp6HLVy3T0C4ERV6SZPp?= =?us-ascii?Q?m7NiqxOtohpnpVB2iBISbCC9CM+jIwazA71zVqHAAC7Za6r/oXokoT3sDoPD?= =?us-ascii?Q?TTDnoPi+YZWo1OAYo0rY5XOHZkcaHYz5em64q30CL0VtUej/pzEdjME3+7nf?= =?us-ascii?Q?SPvm0s80K13Z3lzLwFq+MKdQFxkzCLUDiKMm6u+xUV8wVK2wjPpxlBulRiw6?= =?us-ascii?Q?khSecij8Zy5SQesUzDG8jRTizHkADdkU+fkdltnMab1K3CQMcaH95u7hxhDV?= =?us-ascii?Q?+FZhGbDXQlYRg+mK7JC25PNeCq5P/Z9m63MvjwNxGS/s409UzyOn3l8xvhfi?= =?us-ascii?Q?pn12q/qoxOrhw9asnq8Hg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?us-ascii?Q?6xehh+P9bTqas19aFh8eURkcwTBV2mBJemHxGAM7Tpuxi+SOmDrGaJPPPHpO?= =?us-ascii?Q?kW2Q70w85KUmY5kIFGIh4xXgmq1Qq6Gtagv3dn3Ap+NVxJW+vEjTb47t23x2?= =?us-ascii?Q?uHEqlZKP+TtG/QsAW3W0BVHte8VSxsLHl7xXvXeXUwM3qfPFWkcK0G+IpKYH?= =?us-ascii?Q?55j1/Y9E4ukJazt0DytKRVCPFwPocSt0Il1miKrC?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5872.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 460ad759-4936-44d8-41d5-08da9b21674e X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Sep 2022 16:01:39.5598 (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: LjdVBibdRCcivQeUEMVTSyBVQ/LJLHcPUqInM82htbS3dL9ViN+V4bvAo05dXwfJctg8kaWPtWAKkUWJnsdWjw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5480 Return-Path: jiewen.yao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 ; Wang, > Jian J ; Xiaoyu Lu ; Jiang, > Guomin > Subject: [PATCH 0/7] CryptoPkg: Add BigNum and EC support to > 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 > are wrapped over OpenSSL. The implementation provides library functions > for EFI BaseCrypt protocol and EFI BaseCrypt Configuration Protocol. >=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 > expected result under specific input, that is, to ensure the 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 the > test is used AFL (2.52b) and Libfuzzer (clang+llvm-11.0.0) as the 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 ++++++++ > .../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 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 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