Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3443278rwi; Wed, 12 Oct 2022 01:58:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Mmc7VPUqNoFUzxfGzChVS5Lfs/9YyYLJfTvo11yhbF9Xp9bhPAvbM1/9oVMkog4cBJuqH X-Received: by 2002:a17:907:782:b0:740:7120:c6e7 with SMTP id xd2-20020a170907078200b007407120c6e7mr21933824ejb.313.1665565126568; Wed, 12 Oct 2022 01:58:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665565126; cv=none; d=google.com; s=arc-20160816; b=awO7OZDM4q5k1PvyK94ga5vz3dxV7f2qomguMrwarTybfu8toLIIHglp4PICjO7txc a4qmxX4fuJLVR9N2BIRJdAzX3Dp7/JjDbH89SdYY5uAcaI0QTC0PReHY5rqWGvPHRL2T 4ST9lqWXwfySph3OytA2SDfjav3XKpZ7889JOFW4r5e4BAOAjHOvwYsw1G57c4M2w9tU 2Sf4qlOUFjOvSi17OiYyH0bFwf0VekJmWDwKmgirWmQxqM7xbzn72q+i8P3V7NXHKOlo BOk/exg5g7x7l/ruLX7RL9wN6e6vyyk4cRShZoYl/Mgx+bKPo33JD0cuTlZS7LaBbxpc MlKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=el3L4LXy75sjNMQMKUZWYBXxK+OjjMnkLi94H8sKIkY=; b=BAX1F+zyjIKrp2RG1Vv7u0dzSCenFKYNo9VtCGG2jk8rYXdTo+7nED5BOjpg2EQEDB oAnq+A8+oHyrZbYBxo7ymBy+sJVPXPJp46PY14OjF0wjLddTi8uvOcsNySupQddhwiUj kOMbU3ZmzL3tlU+bkyxRjCcX5byOU1VQwgGywE3TqFIu1p1aUuCtVIZJBtr/UALtZs74 qSo+b4k9/nwG6n4xx35qMNDiuh53Vdf6HWc3yvqG7fOqbo6Q3oHiDO/amhNTX/lJWihK 2lW9TUtoqARen18o92yH/QhTniDHuNmb74BQZ/u1n5QLtmPAX4y3IWafbce2ywqiKV7r prxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HZNFdhm3; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bx20-20020a170906a1d400b00781d793f524si13862894ejb.132.2022.10.12.01.58.22; Wed, 12 Oct 2022 01:58:46 -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=@kernel.org header.s=k20201202 header.b=HZNFdhm3; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229742AbiJLI6H (ORCPT + 99 others); Wed, 12 Oct 2022 04:58:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229818AbiJLI56 (ORCPT ); Wed, 12 Oct 2022 04:57:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFD381A223; Wed, 12 Oct 2022 01:57:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 25ADD61484; Wed, 12 Oct 2022 08:57:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A790C433C1; Wed, 12 Oct 2022 08:57:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665565075; bh=shsKQzsUAB9x2yWMHC6DQUjhQUfU+iyNcWw8gO89At0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HZNFdhm3Lb3Jxs/Ig4AdQhdvayVVr7rQ1OsU3rFuuGNF92nUvDpIeQpTuBaP4Q2T2 5PSRLyTPp8RMhJiUrQevdlggp9pS/TBsA2Pjiieyw9ZFSQt/2Eb+lOIJCqhRFhxJ7v AbR05ItcsPabOHiDm4dYWVsCfiJPASEqM9DZ33QwPreDoIpqFvmygI0mOrLa+rgmKM ILnxHOZRcJTCv8dUXENy+qiX0lE3GiaMBuuUt+AU8WaqpsHYePC7BFndLHNlFqvPOZ zr4pd/T42ooKIVzVE+CGeeR1nKnU/qKGQOEHgKZjeRMngLzDX6bm3mIB5Npj4jGLnC ZE98b0Pqt8xqw== Date: Wed, 12 Oct 2022 11:57:52 +0300 From: Jarkko Sakkinen To: Pankaj Gupta Cc: a.fatoum@pengutronix.de, gilad@benyossef.com, Jason@zx2c4.com, jejb@linux.ibm.com, zohar@linux.ibm.com, dhowells@redhat.com, sumit.garg@linaro.org, david@sigma-star.at, michael@walle.cc, john.ernberg@actia.se, jmorris@namei.org, serge@hallyn.com, herbert@gondor.apana.org.au, davem@davemloft.net, j.luebbe@pengutronix.de, ebiggers@kernel.org, richard@nod.at, keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, sahil.malhotra@nxp.com, kshitiz.varshney@nxp.com, horia.geanta@nxp.com, V.Sethi@nxp.com Subject: Re: [PATCH v0 3/8] crypto: hbk flags & info added to the tfm Message-ID: References: <20221006130837.17587-1-pankaj.gupta@nxp.com> <20221006130837.17587-4-pankaj.gupta@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221006130837.17587-4-pankaj.gupta@nxp.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 What are "hbk flags & info" and "the tfm"? There can be multiple instances of struct crypto_tfm in the kernel. Maybe "crypto: Add hbk_info and is_hbk to struct crypto_tfm" ? On Thu, Oct 06, 2022 at 06:38:32PM +0530, Pankaj Gupta wrote: > Consumer of the kernel crypto api, after allocating > the transformation (tfm), sets the: > - flag 'is_hbk' > - structure 'struct hw_bound_key_info hbk_info' > based on the type of key, the consumer is using. > > This helps: > > - This helps to influence the core processing logic > for the encapsulated algorithm. > - This flag is set by the consumer after allocating > the tfm and before calling the function crypto_xxx_setkey(). I don't really get "this helps part". > > Signed-off-by: Pankaj Gupta > --- > include/linux/crypto.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/linux/crypto.h b/include/linux/crypto.h > index 2324ab6f1846..cd476f8a1cb4 100644 > --- a/include/linux/crypto.h > +++ b/include/linux/crypto.h > @@ -19,6 +19,7 @@ > #include > #include > #include > +#include > > /* > * Autoloaded crypto modules should only use a prefixed name to avoid allowing > @@ -639,6 +640,10 @@ struct crypto_tfm { > > u32 crt_flags; > > + unsigned int is_hbk; Not sure why not just use bool as type here. > + > + struct hw_bound_key_info hbk_info; > + > int node; > > void (*exit)(struct crypto_tfm *tfm); > -- > 2.17.1 > BR, Jarkko