From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0085.outbound.protection.outlook.com [104.47.2.85]) by dpdk.org (Postfix) with ESMTP id 3545F1B395 for ; Tue, 25 Sep 2018 16:47:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xhbJUlDbEkz/bMRWqv6n0f6NTNROdVU4xQNt7bug2Q4=; b=C+2MH+TKHp7GG3atiKcrT+m8c2drZH0O2dzGDkJK/lwTRC3X1OG+5T7dcjHWDC4NbJanAV2dCdbS/L6sPzZyKf5Kf7fy1xZAQJmWYZEEG83FASkOp0JjRM1CpN6D8AaLObZN6/KYsLFJC5TEtSL4YCS0v0c3yiEkIEq1yQgYBhQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=akhil.goyal@nxp.com; Received: from [10.232.134.144] (14.143.30.134) by VI1PR04MB4893.eurprd04.prod.outlook.com (2603:10a6:803:56::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.17; Tue, 25 Sep 2018 14:47:06 +0000 To: Dmitry Eremin-Solenikov , dev@dpdk.org References: <20180916031823.17560-1-dmitry.ereminsolenikov@linaro.org> From: Akhil Goyal Message-ID: <37565196-8048-fd4b-3e88-7fe3d09236f8@nxp.com> Date: Tue, 25 Sep 2018 20:16:46 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180916031823.17560-1-dmitry.ereminsolenikov@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [14.143.30.134] X-ClientProxiedBy: MAXPR0101CA0013.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:c::23) To VI1PR04MB4893.eurprd04.prod.outlook.com (2603:10a6:803:56::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d184f2c0-3fc4-491b-962a-08d622f5c4c0 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB4893; X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB4893; 3:MokAdYl05y3T1MsaRMCCdkuBt1qpNjTNWF405I3BH7NBqkhDqeyw+AyLpFVqEkIso3MavTOsm8fy2G7Fva6RFCpTuVv99r0+fBWwb33+pQ0yA9A/Ep8YCtZQgrPKl62ByDYFpTsGy+pT6tmuuqnWEwaqT+YtubBCQKJWpWswBtwlNnsNYj7QNHELPcIMAeEwsb2oqjMQjYnneiGA+CNnVN26gQAj/AQ44njV9ehFepn+0/blCNGg5u16mdW4NsS2; 25:HCDJXbIX6NrdNMsNlVdTPBFWmgIghO/HJ56XNXkkgh2BROpVu4WMyaNfiLBHmHgukLRvlNlvoPqwBjbPlG3yfN7hBrQ4d8Rep1qJBoR1QOrsPGeUpWNUResXtf6B7npU8P3/9Zm9kbUKFLz85LRS+3o5gbFNdm0OeIaGASBH7/s0RJWQXPkI3JOYsry67u4kTC3qsG9leMVie8yX56tftSgzDIm4t+JwX1HyNDz6zjYI4AXW91gXWyIRnz5njZ/juzOH9hmuOnO+Vbh8paQ+pl/h301wotuQ/fdmWGl8ZhfcdEfR1Ha2o5HwnIWjtxmEALh5jZMAVeJAl3DXDP+VEw==; 31:VVyfJRjKvR7UQ04wan3LDZEUTxwbcnK6w7mjGNQphomBZe3QuvCSB8roMGaeiVwOZGylMM0uNXXGqdTbfKaBf9tCTanjXrk+eC2uQ4fMcBf3lmGCRKGjSNqQxp/ucRRqZgyOTbQTJGOPavTraU2CuXyMon0XWyAIFrYt7+mVTIlFhzv/Jx5NlLA2Wv0F8VNtuvkhPX6O4gPEAd8N8Q0yQ9tQfNyfLpddgm/MvyQShdM= X-MS-TrafficTypeDiagnostic: VI1PR04MB4893: X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB4893; 20:4vufP/X0UD6wVdDFYfzs7mdk1QLIP+MFWQiEDL4EFn3sio9ivCzuPlgh8Q3ddN5fiUpzhUec4P+WqRmCqk+EtlbTPVhbjFfsMbZN4+t0HICU1Hyvzg0X4UivXd+OwDbfLlzGTysQlOIbUsns06vu0AvvLS1hrPbsu6vABqnHSr46I5tSZhESSVv3s9hn/SgZdA8lGJbWkJMkGbNgNVUN7J/BYsyFwF3Ru2MfYflWWFIU1accX8x6XP+YkkzV47/JfE7rNCIhOd4yZRVIXaUL/Z+/wUQ3aNisGfHx7QLFZqIYBIXauybU/7VK7dbeUm0AGxfGyJZMczZbPgf6sV8DlVFM/eVtPicDYhokOV+kNxnGgBy0UFauVmmOi+aKJIEj4yj/g9moifDdwWnfXvBTFH3ruzRWdk1o3PL7wqpVXVqw218ctXr03BizRaGvjV6xzATsPyBjbQaVKJunclahOZa1w8RzHk5M0DHrHYtsmTs94kkiIuJcqiOB4pI+8cjK; 4:8fAuLt38O8iSL6fIUTEPz43NnxLO5KvX40gVO2em0yaoQHu/mEEcAouI8zTVl4U788pxEnV64BPugx8l0qZbdAg3yK2pEx8epzl3Io76vvduQQ6eDGdK8Q5NymP1JM3R7czEWd3j/NSnvAjZKrK3SWUE2Zx31rALb5zLikhhHy0iY20Lat4R4/QXb0x/3dKcwaCu8634WQIbstosPEYvXp+ZV4atXofaqTELRT0MbkV9191KELJeVwrrsBeFr70ne6Aok2seZ2qqjBj7PS4RmQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231355)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(149066)(150027)(6041310)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(201708071742011)(7699051); SRVR:VI1PR04MB4893; BCL:0; PCL:0; RULEID:; SRVR:VI1PR04MB4893; X-Forefront-PRVS: 08062C429B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(396003)(376002)(346002)(136003)(39860400002)(366004)(189003)(199004)(8676002)(86362001)(52116002)(31686004)(76176011)(5009440100003)(3846002)(6116002)(6666003)(23676004)(2486003)(52146003)(6486002)(53936002)(305945005)(7736002)(316002)(6246003)(5660300001)(230700001)(81166006)(8936002)(386003)(53546011)(81156014)(229853002)(31696002)(65826007)(68736007)(3260700006)(16576012)(25786009)(36756003)(64126003)(50466002)(11346002)(446003)(66066001)(65806001)(97736004)(65956001)(77096007)(47776003)(16526019)(26005)(186003)(58126008)(106356001)(2906002)(67846002)(478600001)(14444005)(486006)(2616005)(105586002)(956004)(44832011)(476003)(34290500001)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB4893; H:[10.232.134.144]; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtWSTFQUjA0TUI0ODkzOzIzOkhFYVdxN1FMci9raE1iTlZOY2hWSFkzWWg0?= =?utf-8?B?RlFrWVRlSG1kU3JDUkRLYVdrU1VndHQ1Vmc3eVpBOVhqc2crRmhxOXdmcWNv?= =?utf-8?B?K0MyS1hKSjY4SmJONDQ5dkF0SGpVMkFmdHFoU1o4M0NKcTY2Z2Q2Ni9kSktq?= =?utf-8?B?d2FVNW1od3F5VVBlSHhFYXNZNCtGN3BFYXllbzNzOW9pOTc2VSsra0tTVFY1?= =?utf-8?B?MjRKVVBqRnJXSlE4Q01y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XMNWa63/Qmnro3z91PbZNWkDcfrMUq/RDqiWnzSucKVectLrJLbRo=; 7:40pea4cpjbKxXIDR/NRTYb4sStn7GipOJiTfmBxUA8euXNJYm5Egx+UGQV8LpiinOIIKVDq5wUA6p7cwwvxHDzrwGV4J8xjwQjZiW2E5j5VQklllVL9LXWQaNJ6O0DeE7WNyZpRaVc71AY2M4v45p7UiGuUrHmd5OIpmIEsngqjZPp7LfKyaOF9tey8ajhpMi8o05MCbPfxYDcVyXQYENTdyJyvVUchHVj+NdicLciSr7nK/gKqc6Jzl5jtERr4/ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2018 14:47:06.6697 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d184f2c0-3fc4-491b-962a-08d622f5c4c0 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4893 Subject: Re: [dpdk-dev] [PATCH v2] crypto/openssl: support truncated HMAC operations 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: , X-List-Received-Date: Tue, 25 Sep 2018 14:47:09 -0000 On 9/16/2018 8:48 AM, Dmitry Eremin-Solenikov wrote: > IPsec requires truncated HMAC operations support. Extend OpenSSL crypto > PMD to support truncated HMAC operations necessary for IPsec. > > Signed-off-by: Dmitry Eremin-Solenikov > --- > Changes since V1: > - support all digest sizes from half of corresponding digest size up to > full length. Why can't we extend this to digest size starting from 1 to full length? Why is there a limitation for half of corresponding digest size? > > --- > drivers/crypto/openssl/rte_openssl_pmd.c | 19 ++++++++-------- > drivers/crypto/openssl/rte_openssl_pmd_ops.c | 24 ++++++++++---------- > 2 files changed, 22 insertions(+), 21 deletions(-) > > diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c > index 7d263aba3bbd..c635f1e2493c 100644 > --- a/drivers/crypto/openssl/rte_openssl_pmd.c > +++ b/drivers/crypto/openssl/rte_openssl_pmd.c > @@ -1509,15 +1509,7 @@ process_openssl_auth_op(struct openssl_qp *qp, struct rte_crypto_op *op, > > srclen = op->sym->auth.data.length; > > - if (sess->auth.operation == RTE_CRYPTO_AUTH_OP_VERIFY) > - dst = qp->temp_digest; > - else { > - dst = op->sym->auth.digest.data; > - if (dst == NULL) > - dst = rte_pktmbuf_mtod_offset(mbuf_dst, uint8_t *, > - op->sym->auth.data.offset + > - op->sym->auth.data.length); > - } > + dst = qp->temp_digest; > > switch (sess->auth.mode) { > case OPENSSL_AUTH_AS_AUTH: > @@ -1540,6 +1532,15 @@ process_openssl_auth_op(struct openssl_qp *qp, struct rte_crypto_op *op, > sess->auth.digest_length) != 0) { > op->status = RTE_CRYPTO_OP_STATUS_AUTH_FAILED; > } > + } else { > + uint8_t *auth_dst; > + > + auth_dst = op->sym->auth.digest.data; > + if (auth_dst == NULL) > + auth_dst = rte_pktmbuf_mtod_offset(mbuf_dst, uint8_t *, > + op->sym->auth.data.offset + > + op->sym->auth.data.length); > + memcpy(auth_dst, dst, sess->auth.digest_length); > } > > if (status != 0) > diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c b/drivers/crypto/openssl/rte_openssl_pmd_ops.c > index de2284390b12..6d3e21de404d 100644 > --- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c > +++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c > @@ -26,9 +26,9 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = { > .increment = 1 > }, > .digest_size = { > - .min = 16, > + .min = 8, > .max = 16, > - .increment = 0 > + .increment = 1 > }, > .iv_size = { 0 } > }, } > @@ -68,9 +68,9 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = { > .increment = 1 > }, > .digest_size = { > - .min = 20, > + .min = 10, > .max = 20, > - .increment = 0 > + .increment = 1 > }, > .iv_size = { 0 } > }, } > @@ -110,9 +110,9 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = { > .increment = 1 > }, > .digest_size = { > - .min = 28, > + .min = 14, > .max = 28, > - .increment = 0 > + .increment = 1 > }, > .iv_size = { 0 } > }, } > @@ -152,9 +152,9 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = { > .increment = 1 > }, > .digest_size = { > - .min = 32, > + .min = 16, > .max = 32, > - .increment = 0 > + .increment = 1 > }, > .iv_size = { 0 } > }, } > @@ -194,9 +194,9 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = { > .increment = 1 > }, > .digest_size = { > - .min = 48, > + .min = 24, > .max = 48, > - .increment = 0 > + .increment = 1 > }, > .iv_size = { 0 } > }, } > @@ -236,9 +236,9 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = { > .increment = 1 > }, > .digest_size = { > - .min = 64, > + .min = 32, > .max = 64, > - .increment = 0 > + .increment = 1 > }, > .iv_size = { 0 } > }, }