Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp4856403pxb; Mon, 28 Mar 2022 04:40:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBEwImWWxFzquB9cDd5vsfVNWYjxn7QqYkvRQtcsEKs9EkE7dwMjA45OkXw7djUzY0IVrz X-Received: by 2002:a05:6402:10d5:b0:408:f881:f0f3 with SMTP id p21-20020a05640210d500b00408f881f0f3mr15669795edu.112.1648467604739; Mon, 28 Mar 2022 04:40:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1648467604; cv=pass; d=google.com; s=arc-20160816; b=dkLz/hIARX2Fs9BuuTIntcTHL7c/qcAIdDvffAyF9KkVg1yCMj3ikVKwl1dY3AG0Nz 2jaqmuhhqilXNcwoLQU5BA/5ZJ/wi6e63SlFacchzwlBv5Yw8w1I74hvw9NcdHaV8Rh/ jIvZubM9vDcNDFGkRZwRzsTBdN9cA6uUA9ivcjrTghFwMRZIvTeiydSgKDXQ4HkL0xuy gYASBqas+9AR69hwH+xGbfVRdLn1bUAvRu7dSZziiU2yEQZyWqNx7GJtr6WSQgMR3okq bZMnAOTjOOc62hkiYha23NCLS0TNfC9Ukwi1XRtF08mIijj61GTsgnyToG2wblBdL5aI okgg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=RmHuvG4R1k/1tI6uEuof648WQUCUdIpwuGB/OyyIPuo=; b=QCSHsS1u4QttjyTRoIYbB/AwcdLIIr4jhzdMH1VivzBpTMNB1iAaXCWMqOal6G74gq DQmpyzLeK+FK+FwLVGHDSOLqNjzzbnLqKK3msuybjU5fFdzdByvjhRHTD3hiPFPmm1Vp eClEVMcRVl27K9ol9TAK4IVmx3bCOppSTT8UZtLKHhJjyzw6FNAWjqxVMNKpNk1GXoBX REBBrV2g6SE3PnOmJ28s4pKz41FqIXsHl1iSjTOBM7+7TXk1cnuPMQo3hVRo0qiZZt7G Bb51SUjV6IMfzH3otzyHorzt/pDpnr/Wgfl8nd2MCdydLgZXptwRhDijCFaFnkqcXIeM LrfA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Nr9Xm+p1; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s9-20020a508dc9000000b00418c2b5bdb2si13493764edh.148.2022.03.28.04.39.30; Mon, 28 Mar 2022 04:40:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Nr9Xm+p1; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239818AbiC1JbG (ORCPT + 99 others); Mon, 28 Mar 2022 05:31:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239811AbiC1JbE (ORCPT ); Mon, 28 Mar 2022 05:31:04 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10080.outbound.protection.outlook.com [40.107.1.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 543E13CA5D; Mon, 28 Mar 2022 02:29:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HU9j/BE11W/QOJl/YqF+Kkklh0L8UAnraGcc24Ky1IeOL86mPSacBu0JS1IGMrv2o7t2SZ1vgnCPQlo3xNPT/TZY7eCu8J9msZnep+hqq9okZUMfkynRESPWsO+nYg3sESQCMCpDS44gAGIaLIuISVouxQ6L5uJNo+CJv0iyYnsv8gGHLd1rjEsLXlkv6wnyXb29XYyLHosu2SZg9dBS/nQjiaoTOXXKXObItzlMUtJmNXSiN/pN3Qvd72wU1Plm/lrRFGQLA+2K4k6T1LDsPpNUZZvYdMIKpMWnOja2Tsxu+WmC5le571I3s4Je15uzu4BePZZFHpQKovCydXk++g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RmHuvG4R1k/1tI6uEuof648WQUCUdIpwuGB/OyyIPuo=; b=Zt3NvPOuQv+ALjXjOMUT9pjU4h8ZZwy8MysS1763+w7Ul8hEkQ4G8mjeDoPmlKRJZd3KxFADTtFscqlRA8nloLiBznP8eGpdV00lDlYmmtVrpIqqZSiWKvivFNr7igTTH/7u/+0xmd8Nl6u4RaPcoov6rOtRZUxb5m2lwhNZPtGWZmMgHnIfag8eZIpB1a/9PnSqu+M6vfZMXuH8gADFNgLx4zqn6/y3IcyVIoUgy9j7upSi5db+W7xAH+MYvAmKCqewKvNCS59AInep9KPFkUOxtOuvLqGdeCtSwa4U808pyxQ/gZRlnyTq/Qy2l8U/xvTUCfH9jfQxZ/9I+ozMfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RmHuvG4R1k/1tI6uEuof648WQUCUdIpwuGB/OyyIPuo=; b=Nr9Xm+p1rFLhSHGLBtB9zGtbWM87j71JZg6Dhg6peiTbZ9EKL204/sGCd0NmmhTA7ihk5urUxAsFSgFDN96gtP6rq86T8NnD0Rg2ut8Ec8RPByA2NJ/jzoFz+36wInHEGSb1gx7YZi86x5bwwGVvDp9YGbvPE3uLNqCP202wLYY= Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by AM9PR04MB8164.eurprd04.prod.outlook.com (2603:10a6:20b:3ea::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.22; Mon, 28 Mar 2022 09:29:12 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::143:fed1:d645:f60b]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::143:fed1:d645:f60b%7]) with mapi id 15.20.5102.022; Mon, 28 Mar 2022 09:29:12 +0000 From: Pankaj Gupta To: Ahmad Fatoum , Horia Geanta , Herbert Xu , "David S. Miller" CC: "linux-security-module@vger.kernel.org" , Eric Biggers , David Gstir , Matthias Schiffer , Sumit Garg , Jan Luebbe , Richard Weinberger , "tharvey@gateworks.com" , Franck Lenormand , James Morris , Mimi Zohar , "linux-kernel@vger.kernel.org" , David Howells , Jarkko Sakkinen , "keyrings@vger.kernel.org" , "linux-crypto@vger.kernel.org" , "kernel@pengutronix.de" , "linux-integrity@vger.kernel.org" , James Bottomley , "Serge E. Hallyn" Subject: RE: [EXT] [PATCH v6 3/4] crypto: caam - add in-kernel interface for blob generator Thread-Topic: [EXT] [PATCH v6 3/4] crypto: caam - add in-kernel interface for blob generator Thread-Index: AQHYOVUNOyYgdbVIskOFW8XkCJYEX6zOQs5wgAAZNICABjWmsA== Date: Mon, 28 Mar 2022 09:29:12 +0000 Message-ID: References: <20220316164335.1720255-1-a.fatoum@pengutronix.de> <20220316164335.1720255-4-a.fatoum@pengutronix.de> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a26d9f2b-826c-49de-e131-08da109d6b6f x-ms-traffictypediagnostic: AM9PR04MB8164:EE_ x-ld-processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: qwS3ich4rLt201Z4rUEdCfv+YiBbi6bCQIUYvpIXtxKQSLdabgG0r8L2kjgyx2/2Lb38GGgIsWJU9BAAJOZ6UfdMZB2GmZuqKFGIph7KT4z0hw7F5nDDwUvHA38BUNqueoYqpS+zo/ByFeygHSr3erESOHloZSQJeVxEZAHmalumtH3u8rQauZyPurcHi6rbGyubUlHdnjz/esWid0tJ6Va4vSm3ESPk/cDKO5h+poj2FrfhsZNlvXf2MOA2yllGzadii07M0LEcyipboHBGd3hDAB0LF/VZQn08BKdQDDccdr+121+kvIXQ1EGfpqemUDrTjg/eHW/l/cNjddPBAFXPAvL6pGbRlmh+QotK54z7LcqFfdR0+QiIRIQeX9cvNxJcv0JX9TBontsxnsW5TLLxFu08+4PN+y6gK3qFsK5eqhLlTaihEu2Z9Azaawm0NEoPeNYBxBBU6P3qEXUtp18x2md1dv5pjK+1jQuusZYHMe4ofzdvSdfg8ttoi21/E5C5gA9ZMGyj81ZKIlF1t+sOcnJ0lJFxPJjkHyss54/1ZUccirYgQ1GgqDfPrJJnPyp7/eR4EJb27Q3dJIo7uhYednyWExtCSOmsPRWb5popqdrGodlecA5yyk49kSuGQiO6vzoaFfhedhRwXEhtaqKRMHVmrP74mWrZZ+E9QHUzT9poynIoZAItH01lPrhh/T7dnBXGZjxET9dO5IcbvgDB4nnmLidUI5FCA4z7JQjdtE+ZxmmBjoouGt0NdiiGlHmTrfD+NegHPpocW6K8M/b98SRx8uHRQ4lkHIPERiw= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8630.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(8676002)(38100700002)(6506007)(55016003)(122000001)(52536014)(2906002)(186003)(9686003)(71200400001)(86362001)(7696005)(4326008)(966005)(53546011)(55236004)(26005)(54906003)(110136005)(45080400002)(508600001)(38070700005)(316002)(5660300002)(33656002)(76116006)(66946007)(66476007)(44832011)(8936002)(66556008)(64756008)(7416002)(83380400001)(66446008);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?S9mosKYL1vczp2lcM46ejTjHeVyjlTRzGR5Yydt7OLLz6RyerZilxElHwX0j?= =?us-ascii?Q?Tt2RTI5W/rdJy1JopGqN3KS+sjXjurPavbi51KNoW6hO7IlzpnEL8E21plpQ?= =?us-ascii?Q?yQ6q+njokcZjPy9r3im8uEc/1NvGUWBuKqrbtDZQUqDpkdn5nLBAiH0lk5Po?= =?us-ascii?Q?K+ZiGZq9M/UfB2RX6aZslytwgEunBYS4XBOExaPYjCyqM03DMIpWlM0vNWRH?= =?us-ascii?Q?LPlOSz1ruglCvC2xTBK8LX6iRbA9Przow7RoA2qZcCwGo1ehavDThzt7os8K?= =?us-ascii?Q?ghy+MMhYHTY8hMt6mcJd/+kyyFFmR6/0Bh70XIbcAkEdZEVRFl8/TV3yRhpP?= =?us-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Dh85umr81/K+UUGwOK8DOEmXb68L?= =?us-ascii?Q?9TpkIioZojpghbsKI5dM1lNeq9IOVgMktu1d9KHiS4X+emD9mZmqgcHbgBPs?= =?us-ascii?Q?ru/4HltiUtWfgklYDrjFrg1mXpljYZ4e5zkqASIe2Tp2AgEdKRAxEnFQGrnt?= =?us-ascii?Q?FO0YJ5HoOXmGzjqlNzm4xL1aWjveMKHt0nT1lGitI0pzASbKtsDjQ5AnbyuO?= =?us-ascii?Q?NmTScMRIYR7b/hgykF2Qy6G6D0Ka41qfptUZcNYX7o/l8LSPPJKCGuecAl6Q?= =?us-ascii?Q?vqaV3assGtJIaNEU5Iz3tcJ/Y9NhxeP3lH+TCSyKIWuK3gTL19a/OJc/0JFF?= =?us-ascii?Q?sfO6SUoz1wouBda7bZnVenujLoJCo9+AdnU8Pl6OM1J63H5mRZMmyZS7L2Ts?= =?us-ascii?Q?MSCuiGklDJmaofT36RTGwlAgWHnFx4SHe7jQA2iNikfVBeF+8I3c9aXa9bVP?= =?us-ascii?Q?KHXVfl9TBDk+rCZB9aV+TNFRMmju6EfuDqmw+fuzi9dGcapx6WJF4ZKYIull?= =?us-ascii?Q?P90gBoMT0Q=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a26d9f2b-826c-49de-e131-08da109d6b6f X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Mar 2022 09:29:12.3032 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +2DPEmggRBCPClQAQE1RjDLCaJcy2DuDfysYBZm89qjSj2yC2yber2AYEbsRFt+9mp8KE36uJ0WQ94LXdHrEIw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8164 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hi Ahmad, Please find the comments in-line. Regards Pankaj > -----Original Message----- > From: Ahmad Fatoum > Sent: Thursday, March 24, 2022 3:40 PM > To: Pankaj Gupta ; Horia Geanta > ; Herbert Xu ; > David S. Miller > Cc: linux-security-module@vger.kernel.org; Eric Biggers > ; David Gstir ; Matthias > Schiffer ; Sumit Garg > ; Jan Luebbe ; Richard > Weinberger ; tharvey@gateworks.com; Franck Lenormand > ; James Morris ; Mimi > Zohar ; linux-kernel@vger.kernel.org; David Howells > ; Jarkko Sakkinen ; > keyrings@vger.kernel.org; linux-crypto@vger.kernel.org; > kernel@pengutronix.de; linux-integrity@vger.kernel.org; James Bottomley > ; Serge E. Hallyn > Subject: Re: [EXT] [PATCH v6 3/4] crypto: caam - add in-kernel interface = for > blob generator >=20 > Caution: EXT Email >=20 > Hello Pankaj, >=20 > On 24.03.22 10:55, Pankaj Gupta wrote: > > Hi Ahmad, > > > > Please find the comments in-line. >=20 > Thanks for you review. >=20 > > Suggest to continue to use two separate descriptor-creation-function fo= r > 'encap' and 'decap'. > > This will help these API(s) to be maintained easily going forward. >=20 > We can still split them up in future once there is a real need. > But currently they are exactly the same, except for input/output length, = so I > think it's correct to not introduce duplication unless needed. >=20 > >> - use append_seq_(in|out)_ptr_intlen for both encap/decap as a > >> result >=20 > Case in point. The intlen omission was because the two functions are larg= ely > identical and I only fixed up one of them. This is prone to repeat when w= e go > back to have identical code with minor differences. >=20 > > In continuation to the previous comment, there is another suggestion: > > > > Either: > > struct keyblob_info { > > void *key; > > size_t key_len; > > > > void *blob; > > size_t blob_len; > > > > size_t key_mod_len; > > const void *key_mod; > > }; >=20 > I can do that. >=20 Please do. Thanks. Patch 4/4, needs to be re-worked to. > Whats your opinion on the desc size computation? Comment the macro or > add the static inline helper? >=20 Comment the macro is fine. > Cheers, > Ahmad >=20 > -- > Pengutronix e.K. | = | > Steuerwalder Str. 21 | > https://eur01.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fwww. > pengutronix.de%2F&data=3D04%7C01%7Cpankaj.gupta%40nxp.com%7C4 > d60f0d524a04b7cbd7b08da0d7e7d21%7C686ea1d3bc2b4c6fa92cd99c5c30163 > 5%7C0%7C0%7C637837134158793951%7CUnknown%7CTWFpbGZsb3d8eyJWI > joiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3 > 000&sdata=3DPetvZm8teusBwQ4BeZ1VLEOvBlCrZ2k2bNG3SJBEXPw%3D& > amp;reserved=3D0 | > 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 = | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 = |