From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web09.3756.1604366031576615065 for ; Mon, 02 Nov 2020 17:13:51 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=JqVPCqA0; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: jiewen.yao@intel.com) IronPort-SDR: s4wbF94A8V7w0qJXABozONt+7z476c4CEmltaROoeN1JXX8hiFSinXRJvtz9e6Tq4dOwwFmvV5 kn78vcRT8Rtw== X-IronPort-AV: E=McAfee;i="6000,8403,9793"; a="169083286" X-IronPort-AV: E=Sophos;i="5.77,446,1596524400"; d="scan'208";a="169083286" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2020 17:13:50 -0800 IronPort-SDR: LQmdXx3NW7JkRfUMY9/tbpOdqLbsda6lHDeRVAtGnZlJkcwTD5VYGBoPNYr1fGsFqdsFsdQTrH Y6w91Q5rmYXg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,446,1596524400"; d="scan'208";a="357511947" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga002.fm.intel.com with ESMTP; 02 Nov 2020 17:13:49 -0800 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 2 Nov 2020 17:13:49 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 2 Nov 2020 17:13:06 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 2 Nov 2020 17:13:06 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.107) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Mon, 2 Nov 2020 17:13:05 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BSwGb+rseLmLqBRs24wfReqjehD2o3iR4YTAvZ33hFwARPyot9K+M6dR9uCuWLEG3GsSaRegEpWXNNr6qTu0ADQoJdlXbq8IKNiJl3/wWNZVd+OVv7bHY6hjSA2JyEZjfvOc8NaOMUrGP7Z5jjdAVDQGqaHCpL962u4EC396P2nsZMsexBaHmXAsqSbgWM9+6Ov0JQM4lZ9ostTmKCGppIjdN409zaEgezAd9Kefls5OQJlCfbjmsNHk2GX/aSpnPNWs0rkCMqJH1iTDLcTRHcnoyM+HA8RK+DZwOSlbzvMMjhxehQh0E7a0OzedWPXe7jRw1Qe3f5CvtbzSnyVC8Q== 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=AMeKY/8FzAG1M5V3xd940AU/rQrU+Zorr/eFeOhGtWk=; b=B8OSIP2CXsFtxtZlQgaJAJYhTdtBvYZFTTXxRuRZtaCa/EYpYRLR6YtOtFV8iFExHy0YjXTz70gFwHbkCClw4wu1PxyQwJDnNs8kOZGIMl3j/m4cByWFfLtwI/CDqowTA+l3gtDKxgNqzBqRFBEu30EXtm7rQQlTWoIT4RJebINQ6BisQIyI0mmcly/0dH4h4sO43AEWG3XMCZ+NpUReNFi0LI452ZUizYVvtGXOjBb7RUuI7NSy7A0vJZYbdm4XYOW1Gsc6FecubSV+LTHaksdjgtpgRKP8SS6XnRu/rvWO6qwvaJPmV59AcEh/ZTCmTj3iHugbKIWNCJd2Kvh8lA== 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=AMeKY/8FzAG1M5V3xd940AU/rQrU+Zorr/eFeOhGtWk=; b=JqVPCqA0o6155zk2PYSWcs4PkjxNqEswMdRPPjGdX4jJEj0y0MIplaB/mYvzJZDNvCZIN3t0JMHyp0S6pq8Deq/v+NXo1Age/KKbrAML9n1Yof3L1dqs/QF3QU657IpwWYqNiDtlVewwIyAMPVHibYxVjz+3EPgYQpKlKZtnUBs= Received: from CY4PR11MB1288.namprd11.prod.outlook.com (2603:10b6:903:23::8) by CY4PR1101MB2120.namprd11.prod.outlook.com (2603:10b6:910:1e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Tue, 3 Nov 2020 01:13:04 +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 01:13:04 +0000 From: "Yao, Jiewen" To: "Zurcher, Christopher J" , "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/mKmw6OKwgASJkdCAAC68sA== Date: Tue, 3 Nov 2020 01:13:04 +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: 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.217] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3810b356-e3d7-43cf-ae68-08d87f959d84 x-ms-traffictypediagnostic: CY4PR1101MB2120: 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: Mg+mOUyrkwYOnDJzanIQ+X9fxxPXuTm1Jha5wNG38vGX3H1bdTI+E5/8erezHZNWbSOYxRsE3K7uwlmTxKbpaoxnXZI8tJL7PypRv4sOh1Rc+CLQkkGL1pZFafuAVcB5KMqYBxL0YEmh72FsgtpstpifksbKZoHEGoo3/gr7I5oHknwUpoJnVIKLr5R3ifUVWWw/Bt/uU95bJ8irgxo3mXrubKr9Y/ZVvyCjlDyER2BT8xn83gTbg0UjXBnvpdiQYACSvXvnDLFZK39aNmPqb+VufmBlEchxqaKcAsnsdxSM5xBOJRybPLAJtJQGV8yzHOtjPBChChNjBY0Bw5a+Dgc11KlJqUeSDpsrr0oofA9+oJSMhnCtlPNbQlPNiCxVVEr7M12X/rBy1Tl/DlfQ/A== 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)(346002)(136003)(39860400002)(396003)(376002)(366004)(86362001)(53546011)(8936002)(186003)(2906002)(8676002)(26005)(5660300002)(52536014)(6506007)(7696005)(9686003)(71200400001)(4326008)(316002)(110136005)(54906003)(33656002)(55016002)(966005)(83380400001)(64756008)(66946007)(478600001)(76116006)(66476007)(66446008)(66556008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: MQL/CZqu3Srh50OpBc8ZexgjVOuZXl512Z57WXwEdfcYjxlfihmTLnVZRskWM4Fjx/769WrD99x1LUN3+mbZx7koZ+CGyXz/vXcuR8bOnfGhpdUi3hff7wOJ6djex1n1YiTiC/39KzGLBe69wX6NojxKUSvGF2A3kTaB1wyFd13745hzKKQmMnkt7K7Os72WGlxd7zPLaBXERm/D1hcX3GNHLkaZNHyDudhZFh/9iipkNtnSv29ZVkahindK+LPudacKGkCzxjVFdlTorMKgjnU/L2o8FpRBx8o5LKofWDEYopslUnwxesS9V3ud6LBLVGT9MRSIgwBkoK15fztB2CLk8LUz9mupLJIihUWiSaEhm0nd/OCgEB4ieNXvnvitg0wSeircUrDlSa1nMvpLWSE/2Utuc3e43cGmiEAGsO+N8wB9So2tPEv07kIrYm7kix1ONpcc9qC68pVP7I0ai7+eiRnqU6c3l82KRY/AyE/Fe+cGN4Ai/sFffJJWk2SxJ8WdCIlQPWXDvpS7EiSow9PM1W2S0PxyLIi/rr7wr2UvopYg02ZP3MwajhrwuibXeRBXym76ihnjf772lpXqUTUkAj6DsYdD0Gpmkn2QocunGkzQx1vOKjCdO9McF13H+AMj0RRLyC1drsyPw+f23A== 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: 3810b356-e3d7-43cf-ae68-08d87f959d84 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Nov 2020 01:13:04.2018 (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: VLJOpEoa0shLr+Hae/LrJ7aRFRcoipRYw+l2RFp1Sok7LNE96Qy8bmlZU5P1OZBtfxLattUrenQCAxxWAMtHyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1101MB2120 Return-Path: jiewen.yao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 d= oes 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 writ= e 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 ; 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 >=20 > 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. > Other architectures may see different speed improvements. I have only > tested this file with OvmfPkg through QEMU. >=20 > 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 use= r if > they want to include this file for the size tradeoff vs. the speed gain f= or 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. >=20 > Thanks, > Christopher Zurcher >=20 > > -----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 implementation > 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 I= NF > > 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 ; Jiang, > Guomin > > > ; Sung-Uk Bin ; Ard > > > Biesheuvel > > > Subject: [PATCH 0/1] CryptoPkg/BaseCryptLib: Add EVP implementation > for > > > CryptAes.c > > > > > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2507 > > > > > > This patch provides a drop-in replacement for CryptAes.c which utiliz= es > > > 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 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 provide a spee= d > > > improvement. > > > > > > The C-only AES implementation included by CryptAes.c is extremely sma= ll, > > > and since this file includes the EVP interface, it will significantly > > > increase the size of any module that includes it. As a result, I have= 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