<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Yes. I think PCD is a better option than adding another INF.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Please add the comment as much as possible, to describe the PROs and CONs, such as size/performance.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Zurcher, Christopher J <christopher.j.zurcher@intel.com>
<br>
<b>Sent:</b> Wednesday, November 4, 2020 5:55 AM<br>
<b>To:</b> Bret Barkelew <Bret.Barkelew@microsoft.com>; devel@edk2.groups.io; Yao, Jiewen <jiewen.yao@intel.com><br>
<b>Cc:</b> 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>; Ard Biesheuvel <ard.biesheuvel@arm.com><br>
<b>Subject:</b> RE: [PATCH 0/1] CryptoPkg/BaseCryptLib: Add EVP implementation for CryptAes.c<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m OK with using a PCD here if there are no other objections.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">--<o:p></o:p></p>
<p class="MsoNormal">Christopher Zurcher<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Bret Barkelew <<a href="mailto:Bret.Barkelew@microsoft.com">Bret.Barkelew@microsoft.com</a>>
<br>
<b>Sent:</b> Monday, November 2, 2020 17:23<br>
<b>To:</b> <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a>; Yao, Jiewen <<a href="mailto:jiewen.yao@intel.com">jiewen.yao@intel.com</a>>; Zurcher, Christopher J <<a href="mailto:christopher.j.zurcher@intel.com">christopher.j.zurcher@intel.com</a>><br>
<b>Cc:</b> Wang, Jian J <<a href="mailto:jian.j.wang@intel.com">jian.j.wang@intel.com</a>>; Lu, XiaoyuX <<a href="mailto:xiaoyux.lu@intel.com">xiaoyux.lu@intel.com</a>>; Jiang, Guomin <<a href="mailto:guomin.jiang@intel.com">guomin.jiang@intel.com</a>>; Sung-Uk
 Bin <<a href="mailto:sunguk-bin@hp.com">sunguk-bin@hp.com</a>>; Ard Biesheuvel <<a href="mailto:ard.biesheuvel@arm.com">ard.biesheuvel@arm.com</a>><br>
<b>Subject:</b> RE: [PATCH 0/1] CryptoPkg/BaseCryptLib: Add EVP implementation for CryptAes.c<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I agree that this should not be a C file. Based on the description, would a FixedAtBuild PCD work to wrap the code?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I don’t know that it warrants a full LibraryClass, but that’s another option.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">- Bret <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From: </b><a href="mailto:jiewen.yao=intel.com@groups.io">Yao, Jiewen via groups.io</a><br>
<b>Sent: </b>Monday, November 2, 2020 5:13 PM<br>
<b>To: </b><a href="mailto:christopher.j.zurcher@intel.com">Zurcher, Christopher J</a>;
<a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a><br>
<b>Cc: </b><a href="mailto:jian.j.wang@intel.com">Wang, Jian J</a>; <a href="mailto:xiaoyux.lu@intel.com">
Lu, XiaoyuX</a>; <a href="mailto:guomin.jiang@intel.com">Jiang, Guomin</a>; <a href="mailto:sunguk-bin@hp.com">
Sung-Uk Bin</a>; <a href="mailto:ard.biesheuvel@arm.com">Ard Biesheuvel</a><br>
<b>Subject: </b>[EXTERNAL] Re: [edk2-devel] [PATCH 0/1] CryptoPkg/BaseCryptLib: Add EVP implementation for CryptAes.c<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Thanks to provide the data.<br>
<br>
I have a little concern on what is the usage if we just add a standalone C file.<br>
<br>
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 ?<br>
<br>
If you have a private project which want to use this, then you have to write your own INF file. But if so, why not include this CryptAes.c along with the new INF?<br>
<br>
Thank you<br>
Yao Jiewen<br>
<br>
> -----Original Message-----<br>
> From: Zurcher, Christopher J <<a href="mailto:christopher.j.zurcher@intel.com">christopher.j.zurcher@intel.com</a>><br>
> Sent: Tuesday, November 3, 2020 6:37 AM<br>
> To: Yao, Jiewen <<a href="mailto:jiewen.yao@intel.com">jiewen.yao@intel.com</a>>;
<a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a><br>
> Cc: Wang, Jian J <<a href="mailto:jian.j.wang@intel.com">jian.j.wang@intel.com</a>>; Lu, XiaoyuX<br>
> <<a href="mailto:xiaoyux.lu@intel.com">xiaoyux.lu@intel.com</a>>; Jiang, Guomin <<a href="mailto:guomin.jiang@intel.com">guomin.jiang@intel.com</a>>; Sung-Uk<br>
> Bin <<a href="mailto:sunguk-bin@hp.com">sunguk-bin@hp.com</a>>; Ard Biesheuvel <<a href="mailto:ard.biesheuvel@arm.com">ard.biesheuvel@arm.com</a>><br>
> Subject: RE: [PATCH 0/1] CryptoPkg/BaseCryptLib: Add EVP implementation<br>
> for CryptAes.c<br>
> <br>
> The size increase from adding the EVP interface to a module that does not<br>
> already include it (through the HMAC functions) is ~192KB.<br>
> Intel documentation on the IA version of the feature lists speed<br>
> improvement of ~32% to ~47% depending on the operation and key size.<br>
> Other architectures may see different speed improvements. I have only<br>
> tested this file with OvmfPkg through QEMU.<br>
> <br>
> I did not add this .c file to any INF file because it will add ~192KB to any<br>
> module that includes AES functionality and it should be up to the end user if<br>
> they want to include this file for the size tradeoff vs. the speed gain for their<br>
> particular architecture. Additionally as the only native OpensslLib<br>
> implementation available currently is for X64 architecture, any other<br>
> architecture would have a size increase with no speed improvement.<br>
> <br>
> Thanks,<br>
> Christopher Zurcher<br>
> <br>
> > -----Original Message-----<br>
> > From: Yao, Jiewen <<a href="mailto:jiewen.yao@intel.com">jiewen.yao@intel.com</a>><br>
> > Sent: Friday, October 30, 2020 18:10<br>
> > To: Zurcher, Christopher J <<a href="mailto:christopher.j.zurcher@intel.com">christopher.j.zurcher@intel.com</a>>;<br>
> > <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a><br>
> > Cc: Wang, Jian J <<a href="mailto:jian.j.wang@intel.com">jian.j.wang@intel.com</a>>; Lu, XiaoyuX<br>
> <<a href="mailto:xiaoyux.lu@intel.com">xiaoyux.lu@intel.com</a>>;<br>
> > Jiang, Guomin <<a href="mailto:guomin.jiang@intel.com">guomin.jiang@intel.com</a>>; Sung-Uk Bin <sunguk-<br>
> <a href="mailto:bin@hp.com">bin@hp.com</a>>; Ard<br>
> > Biesheuvel <<a href="mailto:ard.biesheuvel@arm.com">ard.biesheuvel@arm.com</a>><br>
> > Subject: RE: [PATCH 0/1] CryptoPkg/BaseCryptLib: Add EVP implementation<br>
> for<br>
> > CryptAes.c<br>
> ><br>
> > HI Zucher<br>
> > I am not sure why you only add a .c file, but do not add this c to any INF<br>
> > file. This seems a dummy C file.<br>
> > I recommend you drop this and create a full patch to add C and update INF<br>
> > file.<br>
> ><br>
> > Since you are talking performance and size, do you have any data?<br>
> > For example, how fast you have got? What is the size difference before and<br>
> > after?<br>
> > This can help other people make decision to choose which version.<br>
> ><br>
> ><br>
> > Thank you<br>
> > Yao Jiewen<br>
> ><br>
> ><br>
> > > -----Original Message-----<br>
> > > From: Christopher J Zurcher <<a href="mailto:christopher.j.zurcher@intel.com">christopher.j.zurcher@intel.com</a>><br>
> > > Sent: Thursday, October 29, 2020 2:43 AM<br>
> > > To: <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a><br>
> > > Cc: Yao, Jiewen <<a href="mailto:jiewen.yao@intel.com">jiewen.yao@intel.com</a>>; Wang, Jian J<br>
> > > <<a href="mailto:jian.j.wang@intel.com">jian.j.wang@intel.com</a>>; Lu, XiaoyuX <<a href="mailto:xiaoyux.lu@intel.com">xiaoyux.lu@intel.com</a>>; Jiang,<br>
> Guomin<br>
> > > <<a href="mailto:guomin.jiang@intel.com">guomin.jiang@intel.com</a>>; Sung-Uk Bin <<a href="mailto:sunguk-bin@hp.com">sunguk-bin@hp.com</a>>; Ard<br>
> > > Biesheuvel <<a href="mailto:ard.biesheuvel@arm.com">ard.biesheuvel@arm.com</a>><br>
> > > Subject: [PATCH 0/1] CryptoPkg/BaseCryptLib: Add EVP implementation<br>
> for<br>
> > > CryptAes.c<br>
> > ><br>
> > > BZ: <a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2507&amp;data=04%7C01%7Cbret.barkelew%40microsoft.com%7C4a13842bdd6240d452ca08d87f95ba5f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637399628344133791%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=oOONHll9TASuW8eBAMvvLUNZhb9jOSRN18liIP7BHrk%3D&amp;reserved=0">
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2507&amp;data=04%7C01%7Cbret.barkelew%40microsoft.com%7C4a13842bdd6240d452ca08d87f95ba5f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637399628344133791%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=oOONHll9TASuW8eBAMvvLUNZhb9jOSRN18liIP7BHrk%3D&amp;reserved=0</a><br>
> > ><br>
> > > This patch provides a drop-in replacement for CryptAes.c which utilizes<br>
> > > the EVP interface to OpenSSL. This enables access to the assembly-<br>
> optimized<br>
> > > algorithms.<br>
> > ><br>
> > > This patch has been unit-tested in both VS and CLANG build<br>
> environments<br>
> > > using both an X64 assembly-optimized implementation of OpensslLib and<br>
> > > the<br>
> > > standard implementation.<br>
> > ><br>
> > > Usage of this file does not require an assembly-optimized<br>
> implementation of<br>
> > > OpensslLib to function; it does however require one to provide a speed<br>
> > > improvement.<br>
> > ><br>
> > > The C-only AES implementation included by CryptAes.c is extremely small,<br>
> > > and since this file includes the EVP interface, it will significantly<br>
> > > increase the size of any module that includes it. As a result, I have not<br>
> > > replaced the original CryptAes.c as a default in any of the CryptLib<br>
> > > implementations.<br>
> > ><br>
> > > Cc: Jiewen Yao <<a href="mailto:jiewen.yao@intel.com">jiewen.yao@intel.com</a>><br>
> > > Cc: Jian J Wang <<a href="mailto:jian.j.wang@intel.com">jian.j.wang@intel.com</a>><br>
> > > Cc: Xiaoyu Lu <<a href="mailto:xiaoyux.lu@intel.com">xiaoyux.lu@intel.com</a>><br>
> > > Cc: Guomin Jiang <<a href="mailto:guomin.jiang@intel.com">guomin.jiang@intel.com</a>><br>
> > > Cc: Sung-Uk Bin <<a href="mailto:sunguk-bin@hp.com">sunguk-bin@hp.com</a>><br>
> > > Cc: Ard Biesheuvel <<a href="mailto:ard.biesheuvel@arm.com">ard.biesheuvel@arm.com</a>><br>
> > ><br>
> > > Christopher J Zurcher (1):<br>
> > >   CryptoPkg/BaseCryptLib: Add EVP implementation for CryptAes.c<br>
> > ><br>
> > >  CryptoPkg/Library/BaseCryptLib/Cipher/CryptAesEvp.c | 262<br>
> > > ++++++++++++++++++++<br>
> > >  1 file changed, 262 insertions(+)<br>
> > >  create mode 100644<br>
> CryptoPkg/Library/BaseCryptLib/Cipher/CryptAesEvp.c<br>
> > ><br>
> > > --<br>
> > > 2.28.0.windows.1<br>
<br>
<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>


 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr> Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/66944">View/Reply Online (#66944)</a> |    |  <a target="_blank" href="https://groups.io/mt/77870226/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>