From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 9E40CA0096 for ; Wed, 8 May 2019 19:38:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9509A2BD5; Wed, 8 May 2019 19:38:41 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id A5FA62B87 for ; Wed, 8 May 2019 19:38:40 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 May 2019 10:38:39 -0700 X-ExtLoop1: 1 Received: from irsmsx154.ger.corp.intel.com ([163.33.192.96]) by FMSMGA003.fm.intel.com with ESMTP; 08 May 2019 10:38:37 -0700 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.115]) by IRSMSX154.ger.corp.intel.com ([169.254.12.101]) with mapi id 14.03.0415.000; Wed, 8 May 2019 18:38:36 +0100 From: "Trahe, Fiona" To: "Doherty, Declan" , "De Lara Guarch, Pablo" , "akhil.goyal@nxp.com" , "ravi1.kumar@amd.com" , "Jerin Jacob Kollanukkaran" , Anoob Joseph , "Zhang, Roy Fan" , "tdu@semihalf.com" , "lironh@marvell.com" , "walan@marvell.com" , "g.singh@nxp.com" , Hemant Agrawal , Jay Zhou , "dev@dpdk.org" CC: "Trahe, Fiona" , "Kusztal, ArkadiuszX" , "Nowak, DamianX" Thread-Topic: [RFC] crypto: handling of encrypted digest Thread-Index: AdUFtU8i7TKAnBkoS4yLoFp4QeD9/g== Date: Wed, 8 May 2019 17:38:35 +0000 Message-ID: <348A99DA5F5B7549AA880327E580B435897562CC@IRSMSX101.ger.corp.intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjdlMGFlMzMtYmNkOS00YmE1LTliMjctZDdiZDkzZGE1MzVkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiYkNwME1Ca0xVS1ZkdDRvdHpCcW9DZWpGSzRST1wva1pjd2l4dW1YZ2E1RG5wVDdiY0p3MzFYZ1FCMktWbkpRQ1UifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: [dpdk-dev] [RFC] crypto: handling of encrypted digest X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190508173835.A6o8OjxLMK7uSOaMRvqu5FnKTlXp9TvSLv9M7UxDWbw@z> Hi all crypto PMD maintainers, We're getting requests to handle the following case on symmetric crypto API= , needed for 5G security: Generate digest, append to end of raw data, then encrypt the raw data p= lus digest. In opposite direction decryption returns raw data plus digest, authenti= cate the raw data against that decrypted digest. It's not clearly described on the cryptodev API whether this case is expect= ed to be supported or not. Tests are throwing up some issues - specifically - In out-of-place generate-auth-then-encrypt operations, it's necessary to = provide space at the end of both the source AND the destination buffer for = the digest. Which should the op.auth.digest.data refer to? - The unencrypted digest must be just stored temporarily until finished wit= h, then zeroed, for proper security. I see two options for handling this: 1. Use existing API - Document in comment under rte_crypto_sym_op.auth.dige= st.data that for encrypted digest cases=20 - In encrypt direction, xform chain must specify auth generate then cip= her encrypt=20 - In decrypt direction, xform chain must specify cipher decrypt then au= th verify - digest ptr must point to where the unencrypted digest will be stored,= i.e.=20 end of raw data+1 in m_dst for out-of-place operation in the decryp= t direction end of raw data+1 in m_src for all other operations. - for out-of-place operation there must be space for digest at end of b= oth m_src and m_dst - as for any unencrypted data, the unencrypted digest will be cleared b= y the PMD once no longer needed - cipher length >=3D auth length + digest length (Is it overkill to say= this? might someone want partial digest encryption?)=20 2. Extend the API with an explicit encrypted_digest flag in rte_crypto_auth= _xform. Document usage in comment - almost same as above. EXCEPT digest ptr sh= ould not be set, instead PMD will assume its location as above.=20 Regardless of which option, should this be considered a specific feature - = with a feature capability flag? Or are all PMDs expected to handle it and s= o treat as a bug or document as a limitation if they don't? Pros/cons: (1) could be considered as just a clarification and no deprecation notice n= eeded. Test cases may work against some existing PMDs. However the 2 PMDs w= e've tested so far - QAT and aesni_mb - need patches to work so are affecte= d anyway. (2) is more explicit - but may affect more PMDs - needs a deprecation notic= e. Opinions?