<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;}
span.EmailStyle19
        {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">Hi Bala,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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></p>
<p class="MsoNormal">Although there is a bug in debug_hexdump in this function which may cause this confusion.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Plus, the test you are referring is PWCT test (Pairwise conditional test) -> it will encrypt, then decrypt.<o:p></o:p></p>
<p class="MsoNormal">Please take a look into this comment in queue_ops_rsa_enc_dec function:<o:p></o:p></p>
<p class="MsoNormal">/* Use the resulted output as decryption Input vector*<o:p></o:p></p>
<p class="MsoNormal">So above this line there is an encryption part.<o:p></o:p></p>
<p class="MsoNormal">Below is decryption.           <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Regards,<o:p></o:p></p>
<p class="MsoNormal">Arek<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> Balakrishnan K <Balakrishnan.K1@tatacommunications.com>
<br>
<b>Sent:</b> Monday, May 23, 2022 1:33 PM<br>
<b>To:</b> users@dpdk.org<br>
<b>Subject:</b> how to use crypto openssl PMD for asymmetric encryption and decryption<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi All,<o:p></o:p></p>
<p class="MsoNormal">   I am new to dpdk. Planning to use openssl crypto PMD for encrypting/decrypting  the packets.<o:p></o:p></p>
<p class="MsoNormal">Couldn’t find much documents on openssl PMD for <b>asymmetric</b> encryption/decryption.<o:p></o:p></p>
<p class="MsoNormal">Any one please point me in the right document.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have tried to run the test cases wrote for asymmetric crypto using openssl virtual PMD.<o:p></o:p></p>
<p class="MsoNormal">But the output of particular test case is same after the encryption done.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">File : app/test/test_cryptodev_asym.c<o:p></o:p></p>
<p class="MsoNormal">Test executable: ./app/test/dpdk-test<o:p></o:p></p>
<p class="MsoNormal">Test case : test_rsa_enc_dec<o:p></o:p></p>
<p class="MsoNormal">    <o:p></o:p></p>
<p class="MsoNormal"><b>Input given to encryption:              <o:p></o:p></b></p>
<p class="MsoNormal">message at [0x1894e60], len=20<o:p></o:p></p>
<p class="MsoNormal">00000000: F8 BA 1A 55 D0 2F 85 AE 96 7B B6 2F B6 CD A8 EB | ...U./...{./....<o:p></o:p></p>
<p class="MsoNormal">00000010: 7E 78 A0 50                                     | ~x.P<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b>After processing the output also looks like same :<o:p></o:p></b></p>
<p class="MsoNormal">encrypted message exist at [0x1894e60], len=20<o:p></o:p></p>
<p class="MsoNormal">00000000: F8 BA 1A 55 D0 2F 85 AE 96 7B B6 2F B6 CD A8 EB | ...U./...{./....<o:p></o:p></p>
<p class="MsoNormal">00000010: 7E 78 A0 50<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Regards,<o:p></o:p></p>
<p class="MsoNormal">Bala <o:p></o:p></p>
</div>
</div>
</body>
</html>