From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web08.5581.1604444638427598715 for ; Tue, 03 Nov 2020 15:03:58 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=sKVXbQjr; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: jiewen.yao@intel.com) IronPort-SDR: hdcrxr9XmiGKPwldATgqER8eFomfYBe6yHf78t9vWVIBLwHNjyxo+ejdsqXWtJ10MaAUDEl5qz cDF0dDLCJRGA== X-IronPort-AV: E=McAfee;i="6000,8403,9794"; a="233303381" X-IronPort-AV: E=Sophos;i="5.77,449,1596524400"; d="scan'208,217";a="233303381" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2020 15:03:57 -0800 IronPort-SDR: jHA/CNRjDEYZRfe84uw+nJoCAG7YslA5kQS1tOOUq0LFFSqkyYVdgGueDMOxRpvwq1931vJZWA gH/SbEJAb1JQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,449,1596524400"; d="scan'208,217";a="336672887" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by orsmga002.jf.intel.com with ESMTP; 03 Nov 2020 15:03:57 -0800 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 3 Nov 2020 15:03:57 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 3 Nov 2020 15:03:56 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 3 Nov 2020 15:03:56 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.106) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Tue, 3 Nov 2020 15:03:56 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K1ErS9bOJ+p5m5x1arxWC0cu95lZL/WOVY+YSAJb5rXaMYP+402sL4xyGtdUIUDQ3e0D29R5/DJCg0fDeICMBYRq4av9nnH9isYqv3wjRVYryyixLL4XPQe0m+y23FRPNajcD08BkSsOzcjnPpy9R8HP5LwMfy8nXwXZZ51uBqQZ6Ox0o1xIiXDLeYJXomwRz/yT4II+BLHnMpwYq0a1F/NbTWCJpz//2pga0U/7NDFJPIqMXFGoW64hXsOoa6h+9PrhEHtiFD8TakdYSzBSq8F7dTwqjEfS5p40K6XW3jZO6IX8vJp4G9diHUKDfrcx/QJJTa2yl+KWFYXvfbhSFw== 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-SenderADCheck; bh=Ag47VxoKQ/uubjdJEvGAS6xmLiSy1w3ePGXZS5jH3/w=; b=Vj85N7vLhQC/e/sF4Ol9XMHmwOQO+c0vHGXHxhMFIKo5qfNiOFmpMN1qJGnMmF9+gSCOTAMw80XP5bQI3C6yCBQ2gzh5K7IKsnrJxCah1nZ03T021P5iTCbA6cSYAOFr59wuvec9aaLaFUvm1i6kioYguAholE5ctxoCwwWXRC8n9k22r1fTDJq4d4fnZWiNXFLPbxrc2U0irSr3DUTFo6LIzaZZpCrcQsTYmAdXK+xO2Fx7aazbY0awo0cNcP5fiGopp7DZpHZckY5uNnAL6bbeAkCfDPQM57mLMKx54x5R/8/I+m6IxDSHmf3jADrBH4vJnhKyCcZFS6jKB4/xzg== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ag47VxoKQ/uubjdJEvGAS6xmLiSy1w3ePGXZS5jH3/w=; b=sKVXbQjrviHzquAO6K2HWxOAqWbIK25WjhMG8WYgnA2j+uuUNY/lTnsX2SE9ENBtTXhBzwrtBhDjdEQmKkOTPm0Uy/iGI6S/M3eR7twtlbF/CaU4z3A34l6ZSzek9SXMqGJ/kacM2pnLwpit+2ide59uoKky48swA1tGu52C96w= Received: from CY4PR11MB1288.namprd11.prod.outlook.com (2603:10b6:903:23::8) by CY4PR1101MB2230.namprd11.prod.outlook.com (2603:10b6:910:1c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.29; Tue, 3 Nov 2020 23:03:52 +0000 Received: from CY4PR11MB1288.namprd11.prod.outlook.com ([fe80::a188:2994:6c14:aad7]) by CY4PR11MB1288.namprd11.prod.outlook.com ([fe80::a188:2994:6c14:aad7%12]) with mapi id 15.20.3499.032; Tue, 3 Nov 2020 23:03:52 +0000 From: "Yao, Jiewen" To: "Zurcher, Christopher J" , Bret Barkelew , "devel@edk2.groups.io" CC: "Wang, Jian J" , "Lu, XiaoyuX" , "Jiang, Guomin" , Sung-Uk Bin , Ard Biesheuvel Subject: Re: [PATCH 0/1] CryptoPkg/BaseCryptLib: Add EVP implementation for CryptAes.c Thread-Topic: [PATCH 0/1] CryptoPkg/BaseCryptLib: Add EVP implementation for CryptAes.c Thread-Index: AQHWrVo1s+HCwcbLE0KI4UNqtIO/mKmw6OKwgASJkdCAAC68sIAAA7cAgAFXlQCAABOL4A== Date: Tue, 3 Nov 2020 23:03:51 +0000 Message-ID: References: <20201028184254.6923-1-christopher.j.zurcher@intel.com> , In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2020-11-03T01:20:39.1057135Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Privileged dlp-version: 11.5.1.3 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.202] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ef7f36ff-8f3d-4dcd-70fb-08d8804cbb4b x-ms-traffictypediagnostic: CY4PR1101MB2230: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: RMyhQqWSAe1GIjaCoPYpdkxS1GQbHAfHvWF8KiXcdsBXmm2RaVpb5kamAKgs6xjk9mjpR93kFff4BYgHzIEzQWG4AihePfWYA+Cl7u3JAFNp6ghfLPsZOHU1zdpsd+y8smFJ0VxLG9UA071J8bOKv4qFsFlCrWQEBLbusRZ16qz9j/S7YWbw1kYCw0gpYfI22UK9DFrxpSySLH7uznCPv7JUPFLnlCuAHf2BB3As8fDu41dMjm1nlEkNNDBk3SFrR4f6fzLpva1oswDjfUvmCZZnx+PcPvK3V7Xtz2RsiEKgEG5Ke2gkQp2WZxiUMDTZ70xPClBgq74T3nhR+NWRau1bDzS8O9ltaXJKmv/0Mc7UkTGTrjHWl6YD/aoVo6TbTzPFfm4y0huAvYsr55q0EQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR11MB1288.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(39860400002)(376002)(346002)(136003)(396003)(166002)(64756008)(66446008)(7696005)(9686003)(66556008)(83380400001)(8676002)(76116006)(66476007)(66946007)(55016002)(316002)(54906003)(110136005)(5660300002)(478600001)(52536014)(2906002)(53546011)(8936002)(26005)(45080400002)(4326008)(186003)(966005)(33656002)(71200400001)(86362001)(6506007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: Z4i1ip/5xrE6cHXaBmc+SgURKr/g69Ra6Ozt6FTy+xAig0d3QkSZzsX4nO2oJ5bA/DcCsSubzXg4PioSd+7ydts0KcVtdh/5jdaAU4g6WFF6KO6o3kA5uOOnrYGUSlPsSIxovtZIaMED5rAMBcUraFvYTq8Mg19+Loee0pe8I9mCSHsq3JmG3GTYmw34WHLJJwN8IEwGfCCK/t0FFkAjAJwIUWCwMDGG4GV0tt+7ccgIpvRXEeHwAW/rz7AFSNMA0TYg/0Ie95MDdhD7MDXMRROJ+d+bQESF8ly+hka2EINYpB1LazF2FMeLGLauFYBGjymnhva0fuRLTpz5eidjEI9dvsLlZjHaRN1k1r+zB5QtIUZyHgmwrTAac+VOoBXGB49c+s/3R5ACMDWOBIQsrAbCz8feWgYbTbhJvEfytZuqac106g9P9xvTqjxmsgvbkjM1vd9TKXav0SnPIJ3VGR7yx4yPkl6euMxjDCgyi5xi3ZknneTqsRSMnudhrnwddLie98R6j1jxufJLxO+NCh4xWGIsmPTytDZ926TrdsHI8oJKY2gEIcec4bf62gLRrDybwaBrtHzXREV8+xdCDxy/9lWG2RIdFQ6QiPL+xzGY9AOXr3kQY+sxd3WIswj/2tRGsASCbjv/UBC0j/RzDQ== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CY4PR11MB1288.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ef7f36ff-8f3d-4dcd-70fb-08d8804cbb4b X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Nov 2020 23:03:52.0068 (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: 4FuWJ0cgpr4o9Wlj74TrktvMo7YcDZMdhsgvXOBBQi4AqEFIkYHyK+i5E3STT8sXVb+3TmQwFGFZmbczMEpK6A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1101MB2230 Return-Path: jiewen.yao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_CY4PR11MB128807F9081CC1C7D26B447C8C110CY4PR11MB1288namp_" --_000_CY4PR11MB128807F9081CC1C7D26B447C8C110CY4PR11MB1288namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Yes. I think PCD is a better option than adding another INF. Please add the comment as much as possible, to describe the PROs and CONs,= such as size/performance. From: Zurcher, Christopher J Sent: Wednesday, November 4, 2020 5:55 AM To: Bret Barkelew ; devel@edk2.groups.io; Yao= , Jiewen Cc: Wang, Jian J ; Lu, XiaoyuX ; Jiang, Guomin ; Sung-Uk Bin = ; Ard Biesheuvel Subject: RE: [PATCH 0/1] CryptoPkg/BaseCryptLib: Add EVP implementation fo= r CryptAes.c I'm OK with using a PCD here if there are no other objections. -- Christopher Zurcher From: Bret Barkelew > Sent: Monday, November 2, 2020 17:23 To: devel@edk2.groups.io; Yao, Jiewen >; Zurcher, Christopher J > Cc: Wang, Jian J >; Lu= , XiaoyuX >; Jiang, Guomi= n >; Sung-Uk Bin >; Ard Biesheuvel > Subject: RE: [PATCH 0/1] CryptoPkg/BaseCryptLib: Add EVP implementation fo= r CryptAes.c I agree that this should not be a C file. Based on the description, would = a FixedAtBuild PCD work to wrap the code? I don't know that it warrants a full LibraryClass, but that's another opti= on. Have you looked at just implementing it in a flavor of the new EDK2 binary= crypto payloads? Those are shared and wouldn't incur the per-module cost. - Bret From: Yao, Jiewen via groups.io Sent: Monday, November 2, 2020 5:13 PM To: Zurcher, Christopher J; devel@= edk2.groups.io Cc: Wang, Jian J; Lu, XiaoyuX; Jiang, Guomin; Sung-Uk Bin; Ard Biesheuvel Subject: [EXTERNAL] Re: [edk2-devel] [PATCH 0/1] CryptoPkg/BaseCryptLib: A= dd EVP implementation for CryptAes.c Thanks to provide the data. I have a little concern on what is the usage if we just add a standalone C= file. The EDKII build does not support cross package file including in INF, and = does not recommend cross module file including in INF. What is the expected= usage for the standalone CryptAes.c ? If you have a private project which want to use this, then you have to wri= te your own INF file. But if so, why not include this CryptAes.c along with= the new INF? Thank you Yao Jiewen > -----Original Message----- > From: Zurcher, Christopher J > > Sent: Tuesday, November 3, 2020 6:37 AM > To: Yao, Jiewen >; dev= el@edk2.groups.io > Cc: Wang, Jian J >; = Lu, XiaoyuX > >; Jiang, Guomin >; Sung-Uk > Bin >; Ard Biesheuvel > > Subject: RE: [PATCH 0/1] CryptoPkg/BaseCryptLib: Add EVP implementation > for CryptAes.c > > The size increase from adding the EVP interface to a module that does no= t > already include it (through the HMAC functions) is ~192KB. > Intel documentation on the IA version of the feature lists speed > improvement of ~32% to ~47% depending on the operation and key size. > Other architectures may see different speed improvements. I have only > tested this file with OvmfPkg through QEMU. > > I did not add this .c file to any INF file because it will add ~192KB to= any > module that includes AES functionality and it should be up to the end us= er if > they want to include this file for the size tradeoff vs. the speed gain = for their > particular architecture. Additionally as the only native OpensslLib > implementation available currently is for X64 architecture, any other > architecture would have a size increase with no speed improvement. > > Thanks, > Christopher Zurcher > > > -----Original Message----- > > From: Yao, Jiewen > > > Sent: Friday, October 30, 2020 18:10 > > To: Zurcher, Christopher J >; > > devel@edk2.groups.io > > Cc: Wang, Jian J >= ; Lu, XiaoyuX > >; > > Jiang, Guomin >;= Sung-Uk Bin bin@hp.com>; Ard > > Biesheuvel > > > Subject: RE: [PATCH 0/1] CryptoPkg/BaseCryptLib: Add EVP implementatio= n > for > > CryptAes.c > > > > HI Zucher > > I am not sure why you only add a .c file, but do not add this c to any= INF > > file. This seems a dummy C file. > > I recommend you drop this and create a full patch to add C and update = INF > > file. > > > > Since you are talking performance and size, do you have any data? > > For example, how fast you have got? What is the size difference before= and > > after? > > This can help other people make decision to choose which version. > > > > > > Thank you > > Yao Jiewen > > > > > > > -----Original Message----- > > > From: Christopher J Zurcher > > > > Sent: Thursday, October 29, 2020 2:43 AM > > > To: devel@edk2.groups.io > > > Cc: Yao, Jiewen >;= Wang, Jian J > > > >; Lu, XiaoyuX <= xiaoyux.lu@intel.com>; Jiang, > Guomin > > > >; Sung-Uk Bin= >; Ard > > > Biesheuvel > > > > Subject: [PATCH 0/1] CryptoPkg/BaseCryptLib: Add EVP implementation > for > > > CryptAes.c > > > > > > BZ: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2= F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2507&data=3D04%7C01%7C= bret.barkelew%40microsoft.com%7C4a13842bdd6240d452ca08d87f95ba5f%7C72f988bf= 86f141af91ab2d7cd011db47%7C1%7C0%7C637399628344133791%7CUnknown%7CTWFpbGZsb= 3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C100= 0&sdata=3DoOONHll9TASuW8eBAMvvLUNZhb9jOSRN18liIP7BHrk%3D&reserved= =3D0 > > > > > > This patch provides a drop-in replacement for CryptAes.c which utili= zes > > > the EVP interface to OpenSSL. This enables access to the assembly- > optimized > > > algorithms. > > > > > > This patch has been unit-tested in both VS and CLANG build > environments > > > using both an X64 assembly-optimized implementation of OpensslLib an= d > > > the > > > standard implementation. > > > > > > Usage of this file does not require an assembly-optimized > implementation of > > > OpensslLib to function; it does however require one to provide a spe= ed > > > improvement. > > > > > > The C-only AES implementation included by CryptAes.c is extremely sm= all, > > > and since this file includes the EVP interface, it will significantl= y > > > increase the size of any module that includes it. As a result, I hav= e not > > > replaced the original CryptAes.c as a default in any of the CryptLib > > > implementations. > > > > > > Cc: Jiewen Yao > > > > Cc: Jian J Wang = > > > > Cc: Xiaoyu Lu > > > > Cc: Guomin Jiang > > > > Cc: Sung-Uk Bin > > > > Cc: Ard Biesheuvel > > > > > > > Christopher J Zurcher (1): > > > CryptoPkg/BaseCryptLib: Add EVP implementation for CryptAes.c > > > > > > CryptoPkg/Library/BaseCryptLib/Cipher/CryptAesEvp.c | 262 > > > ++++++++++++++++++++ > > > 1 file changed, 262 insertions(+) > > > create mode 100644 > CryptoPkg/Library/BaseCryptLib/Cipher/CryptAesEvp.c > > > > > > -- > > > 2.28.0.windows.1 --_000_CY4PR11MB128807F9081CC1C7D26B447C8C110CY4PR11MB1288namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Yes. I think PCD is a better option than adding ano= ther INF.

 

Please add the comment as much as possible, to desc= ribe the PROs and CONs, such as size/performance.

 

From: Zurcher, Christopher J <christopher= .j.zurcher@intel.com>
Sent: Wednesday, November 4, 2020 5:55 AM
To: Bret Barkelew <Bret.Barkelew@microsoft.com>; devel@edk2.g= roups.io; Yao, Jiewen <jiewen.yao@intel.com>
Cc: Wang, Jian J <jian.j.wang@intel.com>; Lu, XiaoyuX <xia= oyux.lu@intel.com>; Jiang, Guomin <guomin.jiang@intel.com>; Sung-U= k Bin <sunguk-bin@hp.com>; Ard Biesheuvel <ard.biesheuvel@arm.com&= gt;
Subject: RE: [PATCH 0/1] CryptoPkg/BaseCryptLib: Add EVP implementa= tion for CryptAes.c

 

I’m OK with using a PCD here if there are no = other objections.

 

--

Christopher Zurcher

 

From: Bret Barkelew <Bret.Barkelew@microsoft.com>
Sent: Monday, November 2, 2020 17:23
To: devel@edk2.groups.io; Yao, Jiewen <jiewen.yao@intel= .com>; Zurcher, Christopher J <christopher.j.zurcher@intel.com>
Cc: Wang, Jian J <jian.= j.wang@intel.com>; Lu, XiaoyuX <xiaoyux.lu@intel.com>; Jiang, Guomin <guomin.jiang@intel.com>; Sung-Uk Bin <sunguk-bin@hp.com>; A= rd Biesheuvel <ard.biesheuvel@= arm.com>
Subject: RE: [PATCH 0/1] CryptoPkg/BaseCryptLib: Add EVP implementa= tion for CryptAes.c

 

I agree that this should not be a C file. Based on = the description, would a FixedAtBuild PCD work to wrap the code?=

 

I don’t know that it warrants a full LibraryC= lass, but that’s another option.

 

Have you looked at just implementing it in a flavor= of the new EDK2 binary crypto payloads? Those are shared and wouldn’= t incur the per-module cost.

 

- Bret

 

 

Thanks to provide th= e data.

I have a little concern on what is the usage if we just add a standalone C= file.

The EDKII build does not support cross package file including in INF, and = does not recommend cross module file including in INF. What is the expected= usage for the standalone CryptAes.c ?

If you have a private project which want to use this, then you have to wri= te your own INF file. But if so, why not include this CryptAes.c along with= the new INF?

Thank you
Yao Jiewen

> -----Original Message-----
> From: Zurcher, Christopher J <
christopher.j.zurcher@intel.com>
> Sent: Tuesday, November 3, 2020 6:37 AM
> To: Yao, Jiewen <jiewen.ya= o@intel.com>; devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.= wang@intel.com>; Lu, XiaoyuX
> <xiaoyux.lu@intel.com&= gt;; Jiang, Guomin <guomin.jia= ng@intel.com>; Sung-Uk
> Bin <sunguk-bin@hp.com>= ;; Ard Biesheuvel <ard.biesheu= vel@arm.com>
> Subject: RE: [PATCH 0/1] CryptoPkg/BaseCryptLib: Add EVP implementati= on
> for CryptAes.c
>
> The size increase from adding the EVP interface to a module that does= not
> already include it (through the HMAC functions) is ~192KB.
> Intel documentation on the IA version of the feature lists speed
> improvement of ~32% to ~47% depending on the operation and key size.<= br> > Other architectures may see different speed improvements. I have only=
> tested this file with OvmfPkg through QEMU.
>
> I did not add this .c file to any INF file because it will add ~192KB= to any
> module that includes AES functionality and it should be up to the end= user if
> they want to include this file for the size tradeoff vs. the speed ga= in for their
> particular architecture. Additionally as the only native OpensslLib > implementation available currently is for X64 architecture, any other=
> architecture would have a size increase with no speed improvement. >
> Thanks,
> Christopher Zurcher
>
> > -----Original Message-----
> > From: Yao, Jiewen <ji= ewen.yao@intel.com>
> > Sent: Friday, October 30, 2020 18:10
> > To: Zurcher, Christopher J <christopher.j.zurcher@intel.com>;
> > devel@edk2.groups.io=
> > Cc: Wang, Jian J <ji= an.j.wang@intel.com>; Lu, XiaoyuX
> <xiaoyux.lu@intel.com&= gt;;
> > Jiang, Guomin <guom= in.jiang@intel.com>; Sung-Uk Bin <sunguk-
> bin@hp.com>; Ard
> > Biesheuvel <ard.bie= sheuvel@arm.com>
> > Subject: RE: [PATCH 0/1] CryptoPkg/BaseCryptLib: Add EVP impleme= ntation
> for
> > CryptAes.c
> >
> > HI Zucher
> > I am not sure why you only add a .c file, but do not add this c = to any INF
> > file. This seems a dummy C file.
> > I recommend you drop this and create a full patch to add C and u= pdate INF
> > file.
> >
> > Since you are talking performance and size, do you have any data= ?
> > For example, how fast you have got? What is the size difference = before and
> > after?
> > This can help other people make decision to choose which version= .
> >
> >
> > Thank you
> > Yao Jiewen
> >
> >
> > > -----Original Message-----
> > > From: Christopher J Zurcher <christopher.j.zurcher@intel.com>
> > > Sent: Thursday, October 29, 2020 2:43 AM
> > > To: devel@edk2.grou= ps.io
> > > Cc: Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J
> > > <jian.j.wang@in= tel.com>; Lu, XiaoyuX <xi= aoyux.lu@intel.com>; Jiang,
> Guomin
> > > <guomin.jiang@= intel.com>; Sung-Uk Bin <sun= guk-bin@hp.com>; Ard
> > > Biesheuvel <ar= d.biesheuvel@arm.com>
> > > Subject: [PATCH 0/1] CryptoPkg/BaseCryptLib: Add EVP implem= entation
> for
> > > CryptAes.c
> > >
> > > BZ: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbugzil= la.tianocore.org%2Fshow_bug.cgi%3Fid%3D2507&amp;data=3D04%7C01%7Cbret.b= arkelew%40microsoft.com%7C4a13842bdd6240d452ca08d87f95ba5f%7C72f988bf86f141= af91ab2d7cd011db47%7C1%7C0%7C637399628344133791%7CUnknown%7CTWFpbGZsb3d8eyJ= WIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&= amp;sdata=3DoOONHll9TASuW8eBAMvvLUNZhb9jOSRN18liIP7BHrk%3D&amp;reserved= = =3D0
> > >
> > > This patch provides a drop-in replacement for CryptAes.c wh= ich utilizes
> > > the EVP interface to OpenSSL. This enables access to the as= sembly-
> optimized
> > > algorithms.
> > >
> > > This patch has been unit-tested in both VS and CLANG build<= br> > environments
> > > using both an X64 assembly-optimized implementation of Open= sslLib and
> > > the
> > > standard implementation.
> > >
> > > Usage of this file does not require an assembly-optimized > implementation of
> > > OpensslLib to function; it does however require one to prov= ide a speed
> > > improvement.
> > >
> > > The C-only AES implementation included by CryptAes.c is ext= remely small,
> > > and since this file includes the EVP interface, it will sig= nificantly
> > > increase the size of any module that includes it. As a resu= lt, I have not
> > > replaced the original CryptAes.c as a default in any of the= CryptLib
> > > implementations.
> > >
> > > Cc: Jiewen Yao <= jiewen.yao@intel.com>
> > > Cc: Jian J Wang <jian.j.wang@intel.com>
> > > Cc: Xiaoyu Lu <x= iaoyux.lu@intel.com>
> > > Cc: Guomin Jiang <guomin.jiang@intel.com>
> > > Cc: Sung-Uk Bin <su= nguk-bin@hp.com>
> > > Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
> > >
> > > Christopher J Zurcher (1):
> > >   CryptoPkg/BaseCryptLib: Add EVP implementation = for CryptAes.c
> > >
> > >  CryptoPkg/Library/BaseCryptLib/Cipher/CryptAesEvp.c |= 262
> > > ++++++++++++++++++++
> > >  1 file changed, 262 insertions(+)
> > >  create mode 100644
> CryptoPkg/Library/BaseCryptLib/Cipher/CryptAesEvp.c
> > >
> > > --
> > > 2.28.0.windows.1



 

--_000_CY4PR11MB128807F9081CC1C7D26B447C8C110CY4PR11MB1288namp_--