<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:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        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="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><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> Zhang, Roy Fan <roy.fan.zhang@intel.com> <br>
<b>Sent:</b> Thursday, December 16, 2021 4:05 PM<br>
<b>To:</b> Akhil Goyal <gakhil@marvell.com>; Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>; Anoob Joseph <anoobj@marvell.com><br>
<b>Cc:</b> dev@dpdk.org; Ramkumar Balu <rbalu@marvell.com><br>
<b>Subject:</b> RE: [RFC] Cryptodev: use rte_crypto_vec, group big-endian constraints<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi,<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> Akhil Goyal <<a href="mailto:gakhil@marvell.com">gakhil@marvell.com</a>>
<br>
<b>Sent:</b> Monday, December 13, 2021 9:36 AM<br>
<b>To:</b> Kusztal, ArkadiuszX <<a href="mailto:arkadiuszx.kusztal@intel.com">arkadiuszx.kusztal@intel.com</a>>; Anoob Joseph <<a href="mailto:anoobj@marvell.com">anoobj@marvell.com</a>>; Zhang, Roy Fan <<a href="mailto:roy.fan.zhang@intel.com">roy.fan.zhang@intel.com</a>><br>
<b>Cc:</b> <a href="mailto:dev@dpdk.org">dev@dpdk.org</a>; Ramkumar Balu <<a href="mailto:rbalu@marvell.com">rbalu@marvell.com</a>><br>
<b>Subject:</b> RE: [RFC] Cryptodev: use rte_crypto_vec, group big-endian constraints<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-IE"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi, <o:p></o:p></p>
<p class="MsoNormal">since DPDK 21.11 is out, we should start discussion to make asymmetric API stable.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">-              Struct rte_crypto_vec vs struct rte_crypto_param_t<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">We have two almost identical functionally structs, one in _sym.h another in asym.h so we probably should pick one of them.<o:p></o:p></p>
<p class="MsoNormal">“rte_crypto_vec” additionally contains total length which will be useful information as PMD will overwrite “len” in many cases.<o:p></o:p></p>
<p class="MsoNormal">Unfortunately as “rte_crypto.h” includes “_sym.h” and “_asym.h” not other way around we cannot move it to “rte_crypto.h” but asymmetric will include symmetric anyway so it probably will not be that big of an issue.<o:p></o:p></p>
<p class="MsoNormal"><b>[Akhil ] +1<o:p></o:p></b></p>
<p class="MsoNormal"><b>[Fan] +1 <o:p></o:p></b></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">-              Network byte order<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">               rte_crypto_param dP; /**<<o:p></o:p></p>
<p class="MsoNormal">               /**< dP - Private CRT component<o:p></o:p></p>
<p class="MsoNormal">               * Private CRT component of RSA parameter  required for CRT method<o:p></o:p></p>
<p class="MsoNormal">               * RSA private key operations in Octet-string network byte order<o:p></o:p></p>
<p class="MsoNormal">               * format.<o:p></o:p></p>
<p class="MsoNormal">               * dP = d mod ( p - 1 )<o:p></o:p></p>
<p class="MsoNormal">               */<o:p></o:p></p>
<p class="MsoNormal">We have plenty of these (sometimes in places where should not be, and not in places where should). Every member that contains this comment here is a big integer in big-endian format.<o:p></o:p></p>
<p class="MsoNormal">We could simplify it to:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">/** Big integer in big-endian format */<o:p></o:p></p>
<p class="MsoNormal">typedef struct rte_crypto_vec rte_crypto_bigint; <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">               rte_crypto_bigint dP; /**< d mod ( p - 1 ) */<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">ED related algorithms like (EDDSA) will use little-endian bit integers so it will have to use different approach.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b>[Akhil] Using different approaches for endianness may not be a good idea. Why can’t we use rte_crypto_vec for LE? It has a void * data. Right?<o:p></o:p></b></p>
<p class="MsoNormal"><b>[Fan] Akhil, do you believe a comment before the param is enough?<o:p></o:p></b></p>
<p class="MsoNormal">[Arek] – Yes, for me it would be rte_crypto_vec for LE and rte_crypto_bigint for BE, which would correspond to what other crypto libraries propose.<o:p></o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>