From nobody Sun Feb 8 17:21:11 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+87170+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+87170+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1646180912; cv=none; d=zohomail.com; s=zohoarc; b=cUz3J6QEo9IBzDEerikU4fA6oX5E4D6YQiOvHDDpidDN46TsHxGG02NVSyqcPBL25gTMnffA3k79rCn8Zy7HiXbLUPTyWTL31v5teyoHxauC1DSMvevaFeBKq78Pn12xX9f6kboxjw6uD1ptRi3VUNbjeuNs+4h5VTXChFCRSUs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646180912; 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=/bKCxC0yd663gVrOU+v0Z8j9CuqM/lFSSAOnshvl8Jc=; b=BdqUYKxK/HMPrcAsH7llFcugODtbK09Ka9dyTEXSGVs2UpJKSRZZ8G+6cPbIqHxYM93lYKNiZXHSYxVFSSVn1r1hu7EsnCd/MNKOVoSrKUS76d2l/op3a4DrXAFbT34mTVbRbnEN0urpIBqmyLd/KzD8CglLMaPmIGudmmtsUAY= 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+87170+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 1646180912446252.7192098782482; Tue, 1 Mar 2022 16:28:32 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id qvKJYY1788612xnKzDjFEE7Z; Tue, 01 Mar 2022 16:28:27 -0800 X-Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web09.2274.1646180902366421497 for ; Tue, 01 Mar 2022 16:28:26 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10273"; a="253006543" X-IronPort-AV: E=Sophos;i="5.90,146,1643702400"; d="scan'208";a="253006543" X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2022 16:28:25 -0800 X-IronPort-AV: E=Sophos;i="5.90,146,1643702400"; d="scan'208";a="641482167" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.238.2.184]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2022 16:28:23 -0800 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 2/8] CryptoPkg: Add SecCryptLib Date: Wed, 2 Mar 2022 08:28:01 +0800 Message-Id: <20220302002807.982-3-min.m.xu@intel.com> In-Reply-To: <20220302002807.982-1-min.m.xu@intel.com> References: <20220302002807.982-1-min.m.xu@intel.com> 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: LtCJVKRlqkkcmAYkbAErnb3Gx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1646180907; bh=hZ6QObb66ZhxHFEVaisW6jvoBOEnEZwR8dfrz0L5n6Q=; h=Cc:Date:From:Reply-To:Subject:To; b=U5qKmj5n5UVjoQvwsjVjJeEjUEZbnUmvKoUuXldrfNAkALbVEExKSKuYrcSbIg1Wc9g SPXBCoSGpUW4fc04SixmUwpzTgLW33lUBv/7xKQWruM1jZk4QUo7xU0xR/fQbwN+cNj0J F8BGq7LUsZJEDW6R9zh+bL1gnTSIzxdR/Cc= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1646180914506100002 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 (#87170): https://edk2.groups.io/g/devel/message/87170 Mute This Topic: https://groups.io/mt/89491513/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-