From nobody Mon Feb 9 07:57:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+88583+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+88583+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1649400112; cv=none; d=zohomail.com; s=zohoarc; b=ZEAkY3gG8aP5Nk9M68r2yCDOo5C/5tB5pWBc3toMmzQ/OPY0r3ci/mQPb2hjmYARprfMFaSHSoAhvsOBMyHEDajPT31pCRaNnvoTwbbnr5z0tFX7uOU3X9wNYwOb7SuMEtT/RM9COsDsjUQfE9osEaXNzJ6LTy/tTpYi1oAFbYk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649400112; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=xTYYe3Fp4N9mr3r8ekvp22jxXk+hzRTjMH/+ouaKo+k=; b=gTdpYu6GALI5IfqJ3g+ZC9kL5PQA5VjaYQOs+CGfEePkFu7XpMm8XZxUbrY4fG+JBXrUwEJFb8X/mXRDRj5KAal6cAptvbryYaaljc1k71fitFh2Swt5nP41njiIIKN3ko6t1d3Zx067HimnauyyMX1jus593pYYENdNneZcoRo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+88583+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1649400112643572.1382149425845; Thu, 7 Apr 2022 23:41:52 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id vQ6YYY1788612xpWodJTQb2L; Thu, 07 Apr 2022 23:41:52 -0700 X-Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web10.2832.1649400109993352709 for ; Thu, 07 Apr 2022 23:41:51 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10310"; a="261700533" X-IronPort-AV: E=Sophos;i="5.90,244,1643702400"; d="scan'208";a="261700533" X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 23:41:42 -0700 X-IronPort-AV: E=Sophos;i="5.90,244,1643702400"; d="scan'208";a="525257537" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.255.28.237]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 23:41:41 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min Xu , Jiewen Yao , Jian J Wang , Xiaoyu Lu , Guomin Jiang , Gerd Hoffmann Subject: [edk2-devel] [PATCH V2 2/8] CryptoPkg: Add SecCryptLib Date: Fri, 8 Apr 2022 14:39:17 +0800 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,min.m.xu@intel.com X-Gm-Message-State: ypSYoEeburOz6woqDLNdNL5Ax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649400112; bh=apA0QRSUXiTp98TaAWrKBcu3wFD7ux+3JnMdE4sBdOs=; h=Cc:Date:From:Reply-To:Subject:To; b=upw/oRiHLkP2GMmu0OBSLJLxvoRLeNJxCvHQPJchC73W/toQ/jEx1uaKx4TThzhf4RP WVDZ05OxzZK4HWG0TGoEp64QzFn7UBWyv4r+7VbsjO+xzcREIdXmDwU466edNOP7vFy6I x4K0sAcBOdgT3ZVF0L9Oj9hYB2Bs1LHUx/4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649400113743100003 Content-Type: text/plain; charset="utf-8" RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3853 This is the Cryptographic library instance for SEC. The motivation of this library is to support SHA384 in SEC phase for Td guest. So only Hash/CryptSha512.c is included which supports SHA384 and SHA512. Cc: Jiewen Yao Cc: Jian J Wang Cc: Xiaoyu Lu Cc: Guomin Jiang Cc: Gerd Hoffmann Signed-off-by: Min Xu --- CryptoPkg/CryptoPkg.dsc | 4 ++ .../Library/BaseCryptLib/SecCryptLib.inf | 67 +++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf diff --git a/CryptoPkg/CryptoPkg.dsc b/CryptoPkg/CryptoPkg.dsc index 0aa72ed87846..b814e9616454 100644 --- a/CryptoPkg/CryptoPkg.dsc +++ b/CryptoPkg/CryptoPkg.dsc @@ -109,6 +109,9 @@ [LibraryClasses.ARM] ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf =20 +[LibraryClasses.common.SEC] + BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf + [LibraryClasses.common.PEIM] PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiRepor= tStatusCodeLib.inf @@ -236,6 +239,7 @@ !if $(CRYPTO_SERVICES) =3D=3D PACKAGE [Components] CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf + CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf diff --git a/CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf b/CryptoPkg/Lib= rary/BaseCryptLib/SecCryptLib.inf new file mode 100644 index 000000000000..6ef2f67e35dd --- /dev/null +++ b/CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf @@ -0,0 +1,67 @@ +## @file +# Cryptographic Library Instance for SEC. +# +# Caution: This module requires additional review when modified. +# This library will have external input - signature. +# This external input must be validated carefully to avoid security issue= s such as +# buffer overflow or integer overflow. +# +# Copyright (c) 2021, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D SecCryptLib + FILE_GUID =3D 3689D343-0D32-4284-8053-BF10537990E8 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D BaseCryptLib|SEC + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 +# + +[Sources] + InternalCryptLib.h + Hash/CryptSha512.c + + SysCall/CrtWrapper.c + SysCall/ConstantTimeClock.c + SysCall/BaseMemAllocation.c + +[Packages] + MdePkg/MdePkg.dec + CryptoPkg/CryptoPkg.dec + +[LibraryClasses] + BaseLib + BaseMemoryLib + MemoryAllocationLib + DebugLib + OpensslLib + IntrinsicLib + +# +# Remove these [BuildOptions] after this library is cleaned up +# +[BuildOptions] + # + # suppress the following warnings so we do not break the build with warn= ings-as-errors: + # C4090: 'function' : different 'const' qualifiers + # C4718: 'function call' : recursive call has no side effects, deleting + # + MSFT:*_*_*_CC_FLAGS =3D /wd4090 /wd4718 + + # -JCryptoPkg/Include : To disable the use of the system includes provid= ed by RVCT + # --diag_remark=3D1 : Reduce severity of "#1-D: last line of file en= ds without a newline" + RVCT:*_*_ARM_CC_FLAGS =3D -JCryptoPkg/Include --diag_remark=3D1 + + GCC:*_CLANG35_*_CC_FLAGS =3D -std=3Dc99 + GCC:*_CLANG38_*_CC_FLAGS =3D -std=3Dc99 + GCC:*_CLANGPDB_*_CC_FLAGS =3D -std=3Dc99 -Wno-error=3Dincompatible-point= er-types + + XCODE:*_*_*_CC_FLAGS =3D -std=3Dc99 --=20 2.29.2.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#88583): https://edk2.groups.io/g/devel/message/88583 Mute This Topic: https://groups.io/mt/90330664/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-