From nobody Tue Feb 10 06:58:58 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+90884+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+90884+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1656515286; cv=none; d=zohomail.com; s=zohoarc; b=M/piC7ZmnuRJFSCQ0PM5RrAAiGXJQU9rskRxm6swEWXqcnarOtZjCLeat+ldEmN2g/FqLkPt1aSOVbHM04mKvHnmwbMFxOU4sqYLMT//WyhJ5ibUpUGg7u9jJ/7QAhhVAe02gPnfh8kIy8meTDlToaSomMbel94KRQVEg8xvbJI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656515286; 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=6TK9KDycfTY+cRLdB5u4QIMTxTbLThlOfgWc3sISyx8=; b=Wod3CVPO7sib4mw1ZGxLbXmG+A+L9urQLtNuq5uaKIDl66NFZmlrfZ8Z7SOyHBt0NU4KoLO0puOsn+Egszb9mxTX+lRHIMfQSlWhPr5Qqj1mg4aPry0qMY/TKYgO6Jl6SvGuZZ/Gs3YGt1TFk2RcipxaNN5cYGm85aLUpDzJH9s= 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+90884+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 1656515286908678.5200997337558; Wed, 29 Jun 2022 08:08:06 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id enonYY1788612xqm73lUBt6T; Wed, 29 Jun 2022 08:08:06 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.12691.1656515285744270626 for ; Wed, 29 Jun 2022 08:08:05 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A5E451A25; Wed, 29 Jun 2022 08:08:05 -0700 (PDT) X-Received: from pierre123.arm.com (unknown [10.57.42.208]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 80A9D3F792; Wed, 29 Jun 2022 08:08:03 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Sami Mujawar , Leif Lindholm , Ard Biesheuvel , Rebecca Cran , Michael D Kinney , Liming Gao , Edward Pickup Subject: [edk2-devel] [PATCH v1 6/7] MdePkg/AesLib: Add NULL instance of AesLib Date: Wed, 29 Jun 2022 17:07:12 +0200 Message-Id: <20220629150713.2600465-7-Pierre.Gondois@arm.com> In-Reply-To: <20220629150713.2600465-1-Pierre.Gondois@arm.com> References: <20220629150713.2600465-1-Pierre.Gondois@arm.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,pierre.gondois@arm.com X-Gm-Message-State: KFKl1nRtkg1i2UhHdkoGrk4cx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1656515286; bh=+hcpJMNaScm3Z2N3n0jlqpOansveg65Pn6eMD3G0t2I=; h=Cc:Date:From:Reply-To:Subject:To; b=oGG0Q72VIvFxEdgl1eyKPg8HOcxshARFSpy1G/B5auS/fv2ml0zr6SgkvXoFPcL6ZEq vsM995XQSwJNkiX2E8xQDNupP1JfEtYJy2+UkSwHWELeMn+ZJ6ZogCwU74vIjogi9qO1X hc6eL39RlAWUOBYnvo3aRw+lplRvW+eyZjM= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1656515288184100017 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3970 The FIPS PUB 197: "Advanced Encryption Standard (AES)" details the AES algorithm. Add an AesLibNull implementation. Signed-off-by: Pierre Gondois --- MdePkg/Library/AesLibNull/AesLibNull.c | 87 ++++++++++++++++++++++++ MdePkg/Library/AesLibNull/AesLibNull.inf | 24 +++++++ MdePkg/MdePkg.dsc | 1 + 3 files changed, 112 insertions(+) create mode 100644 MdePkg/Library/AesLibNull/AesLibNull.c create mode 100644 MdePkg/Library/AesLibNull/AesLibNull.inf diff --git a/MdePkg/Library/AesLibNull/AesLibNull.c b/MdePkg/Library/AesLib= Null/AesLibNull.c new file mode 100644 index 000000000000..3dd680fe37e4 --- /dev/null +++ b/MdePkg/Library/AesLibNull/AesLibNull.c @@ -0,0 +1,87 @@ +/** @file + Null AES Library + + Copyright (c) 2022, Arm Limited. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Reference(s): + - FIPS 197 November 26, 2001: + Specification for the ADVANCED ENCRYPTION STANDARD (AES) +**/ + +#include +#include + +/** Encrypt an AES block. + + Buffers are little-endian. Overlapping is not checked. + + @param [in] AesCtx AES context. + AesCtx is initialized with AesInitCtx (). + @param [in] InBlock Input Block. The block to cipher. + @param [out] OutBlock Output Block. The ciphered block. + + @retval EFI_SUCCESS Success. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_UNSUPPORTED Unsupported. +**/ +EFI_STATUS +EFIAPI +AesEncrypt ( + IN AES_CTX *AesCtx, + IN UINT8 CONST *InBlock, + OUT UINT8 *OutBlock + ) +{ + ASSERT (FALSE); + return EFI_UNSUPPORTED; +} + +/** Decrypt an AES block. + + Buffers are little-endian. Overlapping is not checked. + + @param [in] AesCtx AES context. + AesCtx is initialized with AesInitCtx (). + @param [in] InBlock Input Block. The block to de-cipher. + @param [out] OutBlock Output Block. The de-ciphered block. + + @retval EFI_SUCCESS Success. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_UNSUPPORTED Unsupported. +**/ +EFI_STATUS +EFIAPI +AesDecrypt ( + IN AES_CTX *AesCtx, + IN UINT8 CONST *InBlock, + OUT UINT8 *OutBlock + ) +{ + ASSERT (FALSE); + return EFI_UNSUPPORTED; +} + +/** Initialize an AES_CTX structure. + + @param [in] Key AES key. Buffer of KeySize bytes. + The buffer is little endian. + @param [in] KeySize Size of the key. Must be one of 128|192|256. + @param [in, out] AesCtx AES context to initialize. + + @retval EFI_SUCCESS Success. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_UNSUPPORTED Unsupported. +**/ +EFI_STATUS +EFIAPI +AesInitCtx ( + IN UINT8 *Key, + IN UINT32 KeySize, + IN OUT AES_CTX *AesCtx + ) +{ + ASSERT (FALSE); + return EFI_UNSUPPORTED; +} diff --git a/MdePkg/Library/AesLibNull/AesLibNull.inf b/MdePkg/Library/AesL= ibNull/AesLibNull.inf new file mode 100644 index 000000000000..3020e7b68571 --- /dev/null +++ b/MdePkg/Library/AesLibNull/AesLibNull.inf @@ -0,0 +1,24 @@ +## @file +# Null AES Library +# +# Copyright (c) 2022, Arm Limited. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +[Defines] + INF_VERSION =3D 0x0001001B + BASE_NAME =3D AesLibNull + FILE_GUID =3D F6DED279-FC26-40F6-88B2-05FF5E6E538F + VERSION_STRING =3D 1.0 + MODULE_TYPE =3D DXE_DRIVER + LIBRARY_CLASS =3D AesLib + +[Sources] + AesLibNull.c + +[Packages] + MdePkg/MdePkg.dec + +[LibraryClasses] + DebugLib diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc index 80e7233363d3..726350c215e5 100644 --- a/MdePkg/MdePkg.dsc +++ b/MdePkg/MdePkg.dsc @@ -68,6 +68,7 @@ [Components] MdePkg/Library/BaseRngLibNull/BaseRngLibNull.inf MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf MdePkg/Library/BaseTrngLibNull/BaseTrngLibNull.inf + MdePkg/Library/AesLibNull/AesLibNull.inf =20 MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf --=20 2.25.1 -=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 (#90884): https://edk2.groups.io/g/devel/message/90884 Mute This Topic: https://groups.io/mt/92066834/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-