<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;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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-IN" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi </span><span lang="EN-US">Arek,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">   Thanks for quick response.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I am using resulted output vector to verify the encrypted message.<o:p></o:p></span></p>
<pre><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">I thought the encrypted data will be in the asym_op->rsa.message.data after rte_cryptodev_enqueue_burst and rte_cryptodev_enqueue_burst call with operation type RTE_CRYPTO_ASYM_OP_ENCRYPT.<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">So ,I checked the hex_dump of asym_op->rsa.message.data.<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US">Code snippet:<o:p></o:p></span></pre>
<pre><span lang="EN-US">asym_op = result_op->asym;<o:p></o:p></span></pre>
<pre><span lang="EN-US">debug_hexdump(stdout, "encrypted message", asym_op->rsa.message.data,<o:p></o:p></span></pre>
<pre><span lang="EN-US">                      asym_op->rsa.message.length);<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span style="font-size:9.0pt;font-family:Consolas;color:#404040">Encrypted data will be placed in </span><span lang="EN-US">asym_op->rsa.cipher.data after crypto operation is my understanding is correct ?<o:p></o:p></span></pre>
<pre><span lang="EN-US">I should use <o:p></o:p></span></pre>
<pre><span lang="EN-US">debug_hexdump(stdout, "encrypted message", asym_op->rsa.cipher.data,<o:p></o:p></span></pre>
<pre><span lang="EN-US">                      asym_op->rsa.cipher.length);<o:p></o:p></span></pre>
<pre><span lang="EN-US">to check the encrypted message for the input given?<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US">Regards,<o:p></o:p></span></pre>
<pre><span lang="EN-US">Bala <o:p></o:p></span></pre>
<pre><span style="font-size:9.0pt;font-family:Consolas;color:#404040"><o:p> </o:p></span></pre>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>
<br>
<b>Sent:</b> 23 May 2022 18:15<br>
<b>To:</b> Balakrishnan K <Balakrishnan.K1@tatacommunications.com>; users@dpdk.org<br>
<b>Subject:</b> RE: how to use crypto openssl PMD for asymmetric encryption and decryption<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:dotted #003333 1.0pt;padding:10.0pt 10.0pt 10.0pt 10.0pt">
<p style="background:#CFD3D6"><b><span lang="EN-US" style="font-size:7.5pt;color:red">CAUTION</span></b><span lang="EN-US" style="font-size:7.5pt;color:red">: This email originated from outside of the organization. Do not click links or open attachments unless
 you recognize the sender and know the content is safe. <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Hi Bala,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Ciphertext will be written into asym_op->rsa.cipher.data (not message.data) by the PMD, here you are using same address for both hex dumps.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Although there is a bug in debug_hexdump in this function which may cause this confusion.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Plus, the test you are referring is PWCT test (Pairwise conditional test) -> it will encrypt, then decrypt.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Please take a look into this comment in queue_ops_rsa_enc_dec function:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">/* Use the resulted output as decryption Input vector*<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">So above this line there is an encryption part.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Below is decryption.           <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Arek<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Balakrishnan K <</span><a href="mailto:Balakrishnan.K1@tatacommunications.com"><span lang="EN-US">Balakrishnan.K1@tatacommunications.com</span></a><span lang="EN-US">>
<br>
<b>Sent:</b> Monday, May 23, 2022 1:33 PM<br>
<b>To:</b> </span><a href="mailto:users@dpdk.org"><span lang="EN-US">users@dpdk.org</span></a><span lang="EN-US"><br>
<b>Subject:</b> how to use crypto openssl PMD for asymmetric encryption and decryption<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Hi All,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">   I am new to dpdk. Planning to use openssl crypto PMD for encrypting/decrypting  the packets.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Couldn’t find much documents on openssl PMD for
<b>asymmetric</b> encryption/decryption.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Any one please point me in the right document.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I have tried to run the test cases wrote for asymmetric crypto using openssl virtual PMD.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">But the output of particular test case is same after the encryption done.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">File : app/test/test_cryptodev_asym.c<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Test executable: ./app/test/dpdk-test<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Test case : test_rsa_enc_dec<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">    <o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US">Input given to encryption:              <o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US">message at [0x1894e60], len=20<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">00000000: F8 BA 1A 55 D0 2F 85 AE 96 7B B6 2F B6 CD A8 EB | ...U./...{./....<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">00000010: 7E 78 A0 50                                     | ~x.P<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US">After processing the output also looks like same :<o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US">encrypted message exist at [0x1894e60], len=20<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">00000000: F8 BA 1A 55 D0 2F 85 AE 96 7B B6 2F B6 CD A8 EB | ...U./...{./....<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">00000010: 7E 78 A0 50<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Bala <o:p></o:p></span></p>
</div>
</div>
</div>
</body>
</html>