From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web08.1760.1604356608504064433 for ; Mon, 02 Nov 2020 14:36:48 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=RtulnJwC; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: christopher.j.zurcher@intel.com) IronPort-SDR: iRIM0xAnOU02KgxQFMJy/iMgrqa/VMx1e1cihVj4sagUH1HddSUjxh0FZzQxe0lcIQtz9nkTnU 8ax+5EV+JMgA== X-IronPort-AV: E=McAfee;i="6000,8403,9793"; a="186803771" X-IronPort-AV: E=Sophos;i="5.77,446,1596524400"; d="scan'208";a="186803771" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2020 14:36:47 -0800 IronPort-SDR: iAsRRBOYMVMG4MxYf4P/zzgeZGD1i1pPKER1v1dR21GbFvG+SbLJSB0NhCNb4QC5ANSe2wPx8o 85fY6wuJRhcg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,446,1596524400"; d="scan'208";a="362757499" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by FMSMGA003.fm.intel.com with ESMTP; 02 Nov 2020 14:36:47 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx604.amr.corp.intel.com (10.18.126.84) 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 14:36:46 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) 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 14:36:46 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.102) by edgegateway.intel.com (192.55.55.71) 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 14:36:46 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tg/y3qQVZvYg/z46iCUR9EqAJ9I+aCq97DbZAscdAGDTYEaJyCru/a0wce7RxpQigVmPhWGrbOR5sAYakaNPdJOn80usvaKzootzXjv9AFdL25KFlMZOJhdPZPSRinoQDFyIu/6ywkS7odrqddtT1OYiwwfR8aTpC66eXyJm1Ew0UDkNvJHAoCuBmzLVZHXlDR39V68sfTXsBRXV1Vc2CgMNbBcKVld2hgDYESTYxtVacH03iAcKZdgAI9N0l9+7EAHJLWvo7wDCfxpmBX/I+cVmRqo5DUTgKJplKma0/hGoE3qKpNa8ekt9l8VTYWaELpUWwqhOB8Xl8cTQQiSkxw== 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=fDuzC7Lop4hHz1INqkG4AZA3VWG0jAu6paSp9vKuuBE=; b=mmfLb8UugoFqtPF3p3aLGmGvqggeI0uCByA/w3oV2xn1/Wd2Qtst+5R8tiPoRgCttrnh2RiP6J9outJSwGtM7yKiFUL82UKnCbOQ84Ygv/h6aM+CKQKy+rtaqb705Gpj2lLLPWfNbQ/mDXiLjL9FvKvLpSj6F2u0yRt6NhzrkZGP4uEUasiDbD/jQ+sYSEivmqgE8ou2Y9X+eJPYQwBHaJSiMQMbSmBXBa3c808EmVotO28zHP1br0Bp26eDZZeFotgFWaAB++IZrwcaYFAkV2JU4MaPgSRNZ0htJVhWPI7+17r2diZn6/ZAgze4S1e5FPQVJkJf53B36HrkX9E3QQ== 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=fDuzC7Lop4hHz1INqkG4AZA3VWG0jAu6paSp9vKuuBE=; b=RtulnJwC+Vz/wMGlmRRhdqviPO98Bbu3ZYyUjOZOo6VYTlKlAmmsLGZ5oTfXpZJ+rv7ZBXyOMYry3zuofQK6Zba48qv/v4pRJrp0h60zi/0v7psVxs2AL3yMPhQJzT6N/Lb8lgvkIW+54NuZmjyWWr/cyjyTV6UWRfkqLDcEosY= Received: from MWHPR1101MB2125.namprd11.prod.outlook.com (2603:10b6:301:4d::10) by MWHPR11MB0031.namprd11.prod.outlook.com (2603:10b6:301:69::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Mon, 2 Nov 2020 22:36:45 +0000 Received: from MWHPR1101MB2125.namprd11.prod.outlook.com ([fe80::f88d:c4b1:1f6d:7a73]) by MWHPR1101MB2125.namprd11.prod.outlook.com ([fe80::f88d:c4b1:1f6d:7a73%4]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 22:36:45 +0000 From: "Zurcher, Christopher J" 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 Thread-Topic: [PATCH 0/1] CryptoPkg/BaseCryptLib: Add EVP implementation for CryptAes.c Thread-Index: AQHWrVo1s+HCwcbLE0KI4UNqtIO/mKmw6OKwgASJkdA= Date: Mon, 2 Nov 2020 22:36:45 +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-reaction: no-action dlp-product: dlpe-windows 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: [50.53.185.44] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 976e2f8e-fe7e-4426-ba6c-08d87f7fc787 x-ms-traffictypediagnostic: MWHPR11MB0031: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: oYdu6bLmGcV4xlEegXP8CsfXOHoPkKXwLSLGQYkjFCv08KdhWFSKfe3FsoBKc1gFotcYy26FcvukgBqL8gqbFEvp/3V+3aY+PMGsVoKBWAcBh1f5uFEiX4itsyhnwHcbJbh2+VO3RsPZAxhpDwgoQ+L2gXBbh3KnKHVIRYfPWkKqsDcOlBqmjOP+LjsVCUMIPqVMrv2Fg7qTeW8kwDxB/dLaUDbZY+vJFCASH9WFGbO8L1GCzDLqIh7eevRZbOKu4kTaBmgMB4diV2cSDmHOuZIzcRPVhJNN8XTgaq+Q/XFE+eYjrqStPBz4+1UpZX884Ziqh65glm1XzGNfAFaV2lLGf0iWVjXp3jlckcOtqq+bVrTJtY9EV6IG/biSQmVIk0UsqOQj08UQr2xY0zBO1Q== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1101MB2125.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(396003)(39860400002)(346002)(376002)(136003)(316002)(110136005)(7696005)(2906002)(9686003)(54906003)(8936002)(6506007)(52536014)(83380400001)(33656002)(66476007)(53546011)(71200400001)(66446008)(55016002)(4326008)(8676002)(86362001)(966005)(26005)(66556008)(478600001)(66946007)(64756008)(76116006)(186003)(5660300002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: PHpaB5hYPFrDRNflAUn7kvdD6AHtKLNJnFdC2p421Kl6uAhqa7hcqrk54aCUwzgnrSe5RyAnLZ/eDUWwTNAkX2uV3l1ndjc+jfYdvGAXfomzCV+zIJc3KSqNXZ4yBAHcwW8v8VDdQBtiCXTdkbWvhCWxalNZ645tEiPITbnnrZIBP5l+A+amBK7iQrAJOos1L6Bg4dnsiWtewu4dnffLW4pKgN41JxsfUfMHRclN1l+EZbjV4pAiNt8u+8tT0tYpp0TZw7krAhbYD5k4SzuizTyzk2e74w6yAjcXkQgRpsKNT+F4S0rmm/yn3wL/9QDGM4H4wKudq/3EjlSSMsv90qz/aNtOCPCCLXf+IKzxah3cbJolgtft9ux+N22CrDeLoelOqYLuFfsVetZdSR3rX/edii7g/cHHotezi8pWDTE+Ud15AfbDpsagSWdoQtldVC25X7zcPGOl3bEYaurVJYopqZ6JgrbjKsY9AM6baWx/P7Yqv2hB/iBPS6EPVK9LH0xGnBnADub+7W4fRG07f5ofwhD7Ij88iPTKAXbU6lPJ2k4GF3BMggzmYTHWYP/TDlbdLfAmhR7xPhfjoOPdHOUnRr1e544pOMKKgZfEHipg8PWqYR55lM6kNmxqat4wN0hw0aeRLJTHaxyQ2MjSyQ== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR1101MB2125.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 976e2f8e-fe7e-4426-ba6c-08d87f7fc787 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Nov 2020 22:36:45.6131 (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: ZnZbuDQnD+zZzfxC4jpuwdfejIz8ctRMrtOBc8ifS63/AzoaKlmS2+HWLU51WsjrPvNfhFsIFHEZaJY8TyS3nnu3Ym/Yn2k6Pq2VStp1+uU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB0031 Return-Path: christopher.j.zurcher@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable The size increase from adding the EVP interface to a module that does not a= lready include it (through the HMAC functions) is ~192KB. Intel documentation on the IA version of the feature lists speed improvemen= t of ~32% to ~47% depending on the operation and key size. Other architectu= res 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 an= y 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 gai= n for their particular architecture. Additionally as the only native Openss= lLib 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 ; = Ard > Biesheuvel > Subject: RE: [PATCH 0/1] CryptoPkg/BaseCryptLib: Add EVP implementation f= or > CryptAes.c >=20 > HI Zucher > I am not sure why you only add a .c file, but do not add this c to any IN= F > file. This seems a dummy C file. > I recommend you drop this and create a full patch to add C and update INF > file. >=20 > 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 an= d > after? > This can help other people make decision to choose which version. >=20 >=20 > Thank you > Yao Jiewen >=20 >=20 > > -----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, Guo= min > > ; 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 utilizes > > the EVP interface to OpenSSL. This enables access to the assembly-optim= ized > > 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 implementatio= n of > > OpensslLib to function; it does however require one to provide a speed > > improvement. > > > > The C-only AES implementation included by CryptAes.c is extremely small= , > > 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 n= ot > > 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