From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web12.15630.1664097993446262916 for ; Sun, 25 Sep 2022 02:26:33 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=AEfX+dkM; spf=pass (domain: intel.com, ip: 192.55.52.88, 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=1664097993; x=1695633993; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=R7eaeI4n2S1myxGJjsHIZXCJ+D3CihCUfsXmNS1Dudc=; b=AEfX+dkMa0GpnK6A0F74gX1MLniSUGIk9X2jwOeNB5uywPBGOntzEqbe 4OfalOdUqvcNWF+0zZD0e/w1PNIOBKBsuZzeTJ7Ip+Pr/R8M5b9WFo11K Pw4EMHLVm2BZnsNWEClZRSfbvOrxd0W5PWXF9H6tYfcCriGVst4oXL0jq L/gVUb6LtVDiKML7sNJA7QQAGzWmoFgmxd4KndbanYaHZ3cHrAbAmWT9o SPJkX+MgXO880AmtNTN2k2KixugiFMxFDCmmk0+F54Sf3fbS0t0UnRJxC VfPp5RzwxJzMfMX5yLerqWwt1gbpsw0jYkXOG2YzbpajIDKufLnCoj16v A==; X-IronPort-AV: E=McAfee;i="6500,9779,10480"; a="327184317" X-IronPort-AV: E=Sophos;i="5.93,344,1654585200"; d="scan'208";a="327184317" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2022 02:26:29 -0700 X-IronPort-AV: E=Sophos;i="5.93,344,1654585200"; d="scan'208";a="683184402" Received: from liyi4-desktop.ccr.corp.intel.com ([10.239.153.82]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2022 02:26:28 -0700 From: "yi1 li" To: devel@edk2.groups.io Cc: Yi Li , Jiewen Yao , Jian J Wang , Xiaoyu Lu , Guomin Jiang , Michael D Kinney Subject: [PATCH V5 0/4] CryptoPkg: Add EC support Date: Sun, 25 Sep 2022 17:26:17 +0800 Message-Id: X-Mailer: git-send-email 2.31.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3828 Review PR: https://github.com/tianocore/edk2/pull/3398 This patch sequence is used to add CryptEc library, which are wrapped over OpenSSL. The implementation provides library functions for EFI BaseCrypt protocol 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 expected result under specific input, that is, to ensure the correctness of APIs. 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 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 new APIs is 90.3%. All test case show in: https://github.com/liyi77/edk2-staging/tree/HBFA/HBFA/UefiHostFuzzTestCasePkg/TestCase/CryptoPkg V2 change: 1. Squash uncrustify tool update into previous patch. 2. Increase EDKII_CRYPTO_VERSION to 10. V3 change: Fix typo in comment. V4 change: Add ECC related usage reference V5 change: Optimized the description of ECC reference Tested-by: Yi Li Cc: Jiewen Yao Cc: Jian J Wang Cc: Xiaoyu Lu Cc: Guomin Jiang Cc: Michael D Kinney Signed-off-by: Yi Li Yi Li (4): CryptoPkg: Add EC support CryptoPkg: Add EC APIs to DXE and protocol CryptoPkg: Add ECC related usage reference CryptoPkg/Test: Add unit test for CryptoEc CryptoPkg/CryptoPkg.dec | 29 + 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 | 831 +++++++++++++----- 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 + 21 files changed, 4137 insertions(+), 200 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