From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web09.3101.1663738273797648501 for ; Tue, 20 Sep 2022 22:31:14 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=KNZzAq23; spf=pass (domain: intel.com, ip: 192.55.52.43, 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=1663738273; x=1695274273; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=74HyIy4WoXqA2stBIWabdY67Mzp0rogZfFVkKovZcL4=; b=KNZzAq23V9PuIqYrkNrPf9ar9KUzsRPClQiuqv4fXPlhinps2mCA9fpm vCrptOBmweKPKZGa7A4hce4oNEVkPD4RhhEtxLm9wMP00/AQNRx/DLjTJ zWVRh06x/FkLvqhRHJrfkI/mSRaEgX/PQkaNo5UW7ice9IrzUhwJ8KEPM /QWTlNCiP1+PqCbuyQYztPpGX/S39IvQVq+UzHnc/RTTmQuD1AT2jPuPx p4FsI/wiPpsdB5Wsl+2421Clr3PoQXAS66p6KkFxkjI9BTWE7X0d9DXWQ Yu6bn/2amKbDtuZuGLOfEouvTMCc2DQgsQ2F72jw6ND5zRL9uMX4jTsqI w==; X-IronPort-AV: E=McAfee;i="6500,9779,10476"; a="386189630" X-IronPort-AV: E=Sophos;i="5.93,332,1654585200"; d="scan'208";a="386189630" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2022 22:31:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,332,1654585200"; d="scan'208";a="570387328" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga003.jf.intel.com with ESMTP; 20 Sep 2022 22:31:13 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) 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 22:31:12 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx612.amr.corp.intel.com (10.18.126.92) 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 22:31:12 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) 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 22:31:12 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.171) 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 22:31:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HJO2udk3RU7UzF92xJ5WPC0faM7CNXajHvtbnu4GEPpo4f7wennJaPRF0TEoqtzq8bTNxYIYSkB7jsB7ZdB07j/AXTw/Qk09Rx/QZofJ+0bgRNaSPEDtQQXRmPZOyUT8rd7ATxrX4rNtRocjqMxbnv3ZKdokod0KkrCr3ZsLp9yNZBw4rWkLcD5NJJ3Aa1af1HntPvI5ID+oR9ajt+T2ooVvJNNB2JSHI36mJwOjoB8zWUO0qzrjscTqbZt6eKKe/nUOUrC2xRiP+BjZFwyr7SrXm/Ir3JCpoCMhA0OCwGLUxFspA+41U64/+rnycws5ImjTnKmAKz+M16STb57BZg== 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=6V0Mn8tf8EZP369yUtKx2oaS4lS+YfnTiEkR04dCCZA=; b=OFWy1qK91aUVZKOtZf8GWkZMDVjva4U0SN4fkQLUxO9fHQzvKB56VC8xgQUt78XJ+skOcEPbWa5NzwxZ6d8u2ArJrQ9A4C/XKdeT19jrgfkb8VQhLfiP3iBpXSWe25ltJeBtdL6s/ZqUPmqvxTY3ScEFI9fBOeY4DXcV/SCFjsWHUF1CinqfbfYlHgS9+UVenWnXXiitVWYwzzS0Vz5z6PO0RKIHRPiWsrikYbalSC3Z8hqdMYWZTMQXV9USgtZe8GU3zHkZdXHnDBuy1KHK7mfKmsU+zq5X4K6jM+ofkolzlvo7rhaekUvHxI3S0fDxwBQQNqrKtsB/rkWb+xKcMg== 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 MN2PR11MB4613.namprd11.prod.outlook.com (2603:10b6:208:26d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14; Wed, 21 Sep 2022 05:31:10 +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 05:31:10 +0000 From: "yi1 li" To: "devel@edk2.groups.io" CC: "Yao, Jiewen" , "Wang, Jian J" , "Lu, Xiaoyu1" , "Jiang, Guomin" Subject: Re: [PATCH V3 0/3] CryptoPkg: Add EC support Thread-Topic: [PATCH V3 0/3] CryptoPkg: Add EC support Thread-Index: AQHYzXtbVnkMNVIbDkWqcDXUUWrK1w== Date: Wed, 21 Sep 2022 05:31:09 +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: caa8d352-d984-48bb-68ce-08da9b927d95 x-ms-traffictypediagnostic: MN2PR11MB4613:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 7skVu/QFTkIyBpwxlSy5ZIqQRaetefNMxCUAfb2tnJfX0XfysVp/nWYkA5745NCPvPqmp3CkCzxhc8SkXxwHZiUoldrvgJsCaHxxDyx5ZZ4BacKvLUvREjn7tNluXKHsCY/t8+/ORi84p0W8l+qe0CI1o1jpn1ZXvetHxbaX3QY7tftXvboF2HdQswCL2WKWThBGgWTB9rBWZt3on9e6EvAYRAvQAtWIERGwNwp1tMkGjItDlPEX9NLM4pHmWz36JLmKe9C3rBKAG1LdX70maluXHrMd+Zlo5ImbnwfEu2AWxUwwHmpfAwY6vWq5uX1SJ0owhhMFQrnE9Q710s1Pot3nZLgiwlNrWqHT7+89hknDGHeJZX4XAJFzMPZTk/sPb21hTk5QipR22bkEHOMGCxJW1Cs6pHPkhK1vmCvnJnH470qbiLr6YWhsJMDRUa6Ak7e+q2dUvtNSOuI8AYnC+NSybWz7sWNwd/r6Lby00x8lQ4uhwoY17Vxs1+UHnBwJEZiOyZdo9b10u+p04cyFqMAhRQUKzTxlPouJFF4OISIQ8rUvsJn/jGJ634aR52Pyn8QtnwtNA+NUkuXljRbmvRQee5UeY6FRVObXOCvr5BLnnkRRLpa9W1Gr6K6hIHEG9aOj7AWIGR38ZhxUFBtoN6RrUfI3F8dlkPYzZdgDYdKRTIXuflVMRFADxLbxArL2Narz0hElOND5jw1RbQSDA133faBFh3A32T6B6CnqLcCtWxAhHFIkNtFpjjgqHqbHSiiHxjZA3ws+masS1OEwKFIOQAeDareK32Rt0n1bMSidoeRG/HW/yBfsNsTRfb4eV9gLtrDtaQCDjuWsWZy2Cg== 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)(376002)(396003)(366004)(39860400002)(451199015)(478600001)(41300700001)(966005)(71200400001)(66476007)(66946007)(86362001)(52536014)(64756008)(5660300002)(4326008)(8676002)(76116006)(55016003)(66446008)(66556008)(107886003)(8936002)(38070700005)(82960400001)(6916009)(33656002)(38100700002)(2906002)(316002)(122000001)(54906003)(186003)(26005)(9686003)(83380400001)(7696005)(6506007)(53546011);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?N67nGN1wbowvsA4Qzr+lc53mt7spALQ9LVSGMO7mDyCrauZ0D+lOHWjt6u2O?= =?us-ascii?Q?sFu5wW8xqhSnmCC/o5NCTAVBgw3GeBut4GJsjkWANJ6yHLeskPe8b6Fs5oX1?= =?us-ascii?Q?Z9Q7wlsRd2XjAxvGDrcLMuutNtlSWd0lfb6oeC209tfU6Y2EJBmLBOrYuTl4?= =?us-ascii?Q?jeRwIRQJcIMOlDaldMQwAQWGwxqivkGNQ4b3WBE+eaBSeXWN3az0cHrGQ9TK?= =?us-ascii?Q?RnleGBgrIVLGLv/xwayClGNbE9yKHdu/qV9GB3TinpZE/KDYetmOxlEtsnP5?= =?us-ascii?Q?pjp3G9S/61G85fHpd5MneG6Ud6kWJ9giBjMuvbCy0RdncbCxSKnMP6z72yWs?= =?us-ascii?Q?mCU4YD8ocZg/nVM/OKdHPReyKAjNnGeMYubM2zV7bY3HxFTEMNpa5/ygZ0oP?= =?us-ascii?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9K?= =?us-ascii?Q?GUNbLbeqFV+u2nW4NCyd1flmTy8s8VBC1WHf19vxc2INj9/jNgXJiHK+RaFb?= =?us-ascii?Q?It60g5bnf323gByX/5YIP+RbnWzBrwADb4ctK+65nvPPqPnX/kyzEufxK+Oo?= =?us-ascii?Q?DCmosKUe5WYYlCXdLUIlfAbU4++IlnmrTMEi7ZvOI5wBfQaFswsbH+mfMP1L?= =?us-ascii?Q?JvLvLclm9rxGD+8S06UhRF3cIThLSGBiF1WUE4mhcoKHBxs/u90XgQTTlwx4?= =?us-ascii?Q?7OuBe+7xphYCXUrgiMA=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: caa8d352-d984-48bb-68ce-08da9b927d95 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Sep 2022 05:31:10.0664 (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: /cN6EwRvgFqTC6C3HF2yT/6kjsADdhtYLcJj2SaONmBcInjdk7aPTbnBP/4yrFWSmf0bPKbTjt4COuCU4Ngo4w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4613 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 Resend patch sets because of typos in comment message. -----Original Message----- From: Li, Yi1 =20 Sent: Wednesday, September 21, 2022 1:27 PM To: devel@edk2.groups.io Cc: Li, Yi1 ; Yao, Jiewen ; Wang, J= ian J ; Lu, Xiaoyu1 ; Jiang, G= uomin Subject: [PATCH V3 0/3] CryptoPkg: Add EC support REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3828 Review PR: https://github.com/tianocore/edk2/pull/3309 This patch sequence is used to add CryptEc library, which are wrapped over = OpenSSL. The implementation provides library functions for EFI BaseCrypt pr= otocol and EFI BaseCrypt Configuration Protocol. 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 expe= cted result under specific input, that is, to ensure the correctness of API= s. All test case show in patch 3 :CryptoPkg/Test: Add unit test for CryptoEc. 2. Fuzzing test: Various Fuzz Testing are employed across the all introduced APIs, and the t= est is used AFL (2.52b) and Libfuzzer (clang+llvm-11.0.0) as the fuzzer, ba= sed on HBFA. Fuzzing Pass Rate is 100%; The Code Coverage new APIs is 90.3%. All test case show in: https://github.com/liyi77/edk2-staging/tree/HBFA/HBFA/UefiHostFuzzTestCaseP= kg/TestCase/CryptoPkg V2 change: 1. Squash uncrustify tool update into previous patch.=20 2. Increase EDKII_CRYPTO_VERSION to 10. Tested-by: Yi Li Cc: Jiewen Yao Cc: Jian J Wang Cc: Xiaoyu Lu Cc: Guomin Jiang Signed-off-by: Yi Li Yi Li (3): CryptoPkg: Add EC support CryptoPkg: Add EC APIs to DXE and protocol CryptoPkg/Test: Add unit test for CryptoEc CryptoPkg/CryptoPkg.dsc | 1 + CryptoPkg/Driver/Crypto.c | 496 +++++++++++ CryptoPkg/Include/Library/BaseCryptLib.h | 424 +++++++++ .../Pcd/PcdCryptoServiceFamilyEnable.h | 25 + .../Library/BaseCryptLib/BaseCryptLib.inf | 2 + .../Library/BaseCryptLib/PeiCryptLib.inf | 1 + CryptoPkg/Library/BaseCryptLib/Pk/CryptEc.c | 765 +++++++++++++++++ .../Library/BaseCryptLib/Pk/CryptEcNull.c | 496 +++++++++++ .../Library/BaseCryptLib/SmmCryptLib.inf | 1 + .../BaseCryptLib/UnitTestHostBaseCryptLib.inf | 2 + .../BaseCryptLibNull/BaseCryptLibNull.inf | 1 + .../Library/BaseCryptLibNull/Pk/CryptEcNull.c | 496 +++++++++++ .../BaseCryptLibOnProtocolPpi/CryptLib.c | 469 ++++++++++ CryptoPkg/Private/Protocol/Crypto.h | 801 ++++++++++++++---- CryptoPkg/Test/CryptoPkgHostUnitTest.dsc | 3 + .../BaseCryptLib/BaseCryptLibUnitTests.c | 1 + .../UnitTest/Library/BaseCryptLib/EcTests.c | 290 +++++++ .../Library/BaseCryptLib/TestBaseCryptLib.h | 2 + .../BaseCryptLib/TestBaseCryptLibHost.inf | 1 + .../BaseCryptLib/TestBaseCryptLibShell.inf | 1 + 20 files changed, 4093 insertions(+), 185 deletions(-) create mode 100644= CryptoPkg/Library/BaseCryptLib/Pk/CryptEc.c create mode 100644 CryptoPkg/Library/BaseCryptLib/Pk/CryptEcNull.c create mode 100644 CryptoPkg/Library/BaseCryptLibNull/Pk/CryptEcNull.c create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/EcTests.c -- 2.31.1.windows.1