Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1715364rdb; Mon, 2 Oct 2023 20:44:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/BeZfxn20djAd+t/+rvsQUI6rdpOfPomHADTfMHWzVf4LcEy4YEbTYm4/PAQJr44YAVcH X-Received: by 2002:a05:6a20:100f:b0:15e:a46f:fcfc with SMTP id gs15-20020a056a20100f00b0015ea46ffcfcmr10378470pzc.21.1696304683644; Mon, 02 Oct 2023 20:44:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696304683; cv=none; d=google.com; s=arc-20160816; b=Yz4AVVlZgiMicdMCLmb+mZ50718u52dUDyHlL7v8UB9QQIn3UECeqr+RmOdOXXz17N 9+c6kvl4mJXjEnhanlHSsveuJSWbDvM6mxDcWEZV/loemezhf4JA3bBFWBJ8dYS0IsPk haGAkL9g7IUSx6lRS1tL1fS/E1sg7YPOXPm+fkmOMjy/heApPP+cnooey5rtGB5yzBwa PPZoYQJmQEt+7lMqQdiDq0YawUnqzaNhPKd71M2+zGELdbDvtrSwrToUp560PWIpGqCy qIx5h7jBKhJIWJvthivd5LQ1iIVinwys7FeIy2BpkjxlWB7/SU4sS9kQ3/pPbKSmpfLG KPqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=TfjW5pc5qZAVMXL7pBBSj5ofrxDWocVqFR92Pbg8Hl0=; fh=l82EBe4859Giv8r8zr9oFIexxRwnYkkBFWiaDDuu954=; b=U8wC7Xf8wn6+18PV/yX6RE/yP6rxsJhTbQ7hzB0OOzy98HUwt3AcEhH9MaB643KMoE eYAXV+ZbzGPVbB89osnAoByAB/RcmJhhTRyiszWaI9/vjgdSguoq0AjMrChlS/VXX8bS fMgAEpefs12UNeqWMYJKmn+PodKpJvw0+RlaAWy1VLtPgHwftp943rsIUijmWKwgGxpW AGuDpmNYd93sdOaqVaNsG6LfkLfOQFCOGcQc3ZJAVqNJgGZDdkU2DN7XUnPnenYiuoTK 8jTMhFJakgsBGEzSC0T8/WFAliZG60Rr36TLiUCwNlF1gLQvRh2S7MdaxklX6uvOyDI0 xYfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id d14-20020a170902cece00b001c75866c987si467918plg.584.2023.10.02.20.44.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 20:44:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 38C1B801BA6F; Mon, 2 Oct 2023 20:44:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230102AbjJCDol (ORCPT + 99 others); Mon, 2 Oct 2023 23:44:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230093AbjJCDok (ORCPT ); Mon, 2 Oct 2023 23:44:40 -0400 Received: from abb.hmeau.com (abb.hmeau.com [144.6.53.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 985FDBF for ; Mon, 2 Oct 2023 20:44:37 -0700 (PDT) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1qnWKm-002wQW-Tr; Tue, 03 Oct 2023 11:44:33 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Tue, 03 Oct 2023 11:44:36 +0800 From: Herbert Xu To: Linux Crypto Mailing List Cc: Shinichiro Kawasaki , Herbert Xu Subject: [PATCH 02/16] crypto: skcipher - Add crypto_spawn_skcipher_alg_common Date: Tue, 3 Oct 2023 11:43:19 +0800 Message-Id: <20231003034333.1441826-3-herbert@gondor.apana.org.au> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231003034333.1441826-1-herbert@gondor.apana.org.au> References: <20231003034333.1441826-1-herbert@gondor.apana.org.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 02 Oct 2023 20:44:40 -0700 (PDT) As skcipher spawns can be of two different types (skcipher vs. lskcipher), only the common fields can be accessed. Add a helper to return the common algorithm object. Signed-off-by: Herbert Xu --- include/crypto/internal/skcipher.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/crypto/internal/skcipher.h b/include/crypto/internal/skcipher.h index 4382fd707b8a..c767b5cfbd9c 100644 --- a/include/crypto/internal/skcipher.h +++ b/include/crypto/internal/skcipher.h @@ -160,6 +160,12 @@ static inline struct lskcipher_alg *crypto_lskcipher_spawn_alg( return container_of(spawn->base.alg, struct lskcipher_alg, co.base); } +static inline struct skcipher_alg_common *crypto_spawn_skcipher_alg_common( + struct crypto_skcipher_spawn *spawn) +{ + return container_of(spawn->base.alg, struct skcipher_alg_common, base); +} + static inline struct skcipher_alg *crypto_spawn_skcipher_alg( struct crypto_skcipher_spawn *spawn) { -- 2.39.2