Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1715405rdb; Mon, 2 Oct 2023 20:44:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG60On9FQNIMYXy2QoUI31KnLFoLC4fqK/K8o0avnYtlpMHd7njpxJsGDI+ObH7yuZ0SjkF X-Received: by 2002:ac8:5f4a:0:b0:400:797e:d694 with SMTP id y10-20020ac85f4a000000b00400797ed694mr14141548qta.11.1696304690513; Mon, 02 Oct 2023 20:44:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696304690; cv=none; d=google.com; s=arc-20160816; b=m9S9znl6HAkiUDnPBlotcAL9i+4LQ9V9iLobu2yKDZFX5nc8rP24Fe07tSVGY2dPLd 9JotQ/nHUNz1E6/2KK8XzdDJx2CUMnAe8bwvWc8fI1kbIRolkgFM4mIsU/yP6cQ6CzPe xROKLOz91K6Ex+9IQqYopjy7AOCDFXf8X/JrcBbc/cC/NHXcfWf8phhwKywp+IbWU0Fd qIdDuIpfYkh4QPOUa3FqM4VJDc0dFh30DJ8p+Pe6wfSRdwq2waaP+I6jTolyyFxirceY fw2MUS/fK7OQV0InbqSF96UjaCx11+5ZdtQQ9n+eMCA2lOiD0yUb4ZGPdCLsh67BYtmN S1lA== 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=9rQcC9C4I4GkksQ5QA3r76ZosnoKRG19LUJYKCyW44I=; fh=l82EBe4859Giv8r8zr9oFIexxRwnYkkBFWiaDDuu954=; b=b+nmGWhwdRFVFoWYG/l2YOVKX3glwgKb2R47K4bGPucsISQkqGeUfQ+tN7RXhcnYTM dafjy8ZFz/FntUs6yJgAByAfeLaHuPziNjGU4FrMzORaVakRMYMUacgvMvUgVtglwlqg qkGstOphnWlAA5yz4yAO39y5UQCT4jGwLcL6QZgnIZ1+paOHdyAp27LUWh/qRrqlp/yg nnm0Vb4Js17ujnFvUPI8egQlPn809EH2NmViU+s4EG4H+P+xbbn9iJUCZ6QF6j/CGT2g dMFSgmPdcV2IQdPCo1J/FAa4yQomeZVnZX4tPfFQvePEaMgoznqgln9hdeCe6MrJtOJQ ERlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id p15-20020a17090a748f00b0026c198d8182si9217697pjk.105.2023.10.02.20.44.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 20:44:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 2553080C4D6F; Mon, 2 Oct 2023 20:44:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230120AbjJCDot (ORCPT + 99 others); Mon, 2 Oct 2023 23:44:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230128AbjJCDop (ORCPT ); Mon, 2 Oct 2023 23:44:45 -0400 Received: from abb.hmeau.com (abb.hmeau.com [144.6.53.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6EB7B8 for ; Mon, 2 Oct 2023 20:44:40 -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 1qnWKq-002wQy-6u; Tue, 03 Oct 2023 11:44:37 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Tue, 03 Oct 2023 11:44:40 +0800 From: Herbert Xu To: Linux Crypto Mailing List Cc: Shinichiro Kawasaki , Herbert Xu Subject: [PATCH 05/16] crypto: adiantum - Only access common skcipher fields on spawn Date: Tue, 3 Oct 2023 11:43:22 +0800 Message-Id: <20231003034333.1441826-6-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=-1.9 required=5.0 tests=BAYES_00,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 02 Oct 2023 20:44:49 -0700 (PDT) As skcipher spawns may be of the type lskcipher, only the common fields may be accessed. This was already the case but use the correct helpers to make this more obvious. Signed-off-by: Herbert Xu --- crypto/adiantum.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crypto/adiantum.c b/crypto/adiantum.c index c33ba22a6638..51703746d91e 100644 --- a/crypto/adiantum.c +++ b/crypto/adiantum.c @@ -468,7 +468,7 @@ static void adiantum_free_instance(struct skcipher_instance *inst) * Check for a supported set of inner algorithms. * See the comment at the beginning of this file. */ -static bool adiantum_supported_algorithms(struct skcipher_alg *streamcipher_alg, +static bool adiantum_supported_algorithms(struct skcipher_alg_common *streamcipher_alg, struct crypto_alg *blockcipher_alg, struct shash_alg *hash_alg) { @@ -494,7 +494,7 @@ static int adiantum_create(struct crypto_template *tmpl, struct rtattr **tb) const char *nhpoly1305_name; struct skcipher_instance *inst; struct adiantum_instance_ctx *ictx; - struct skcipher_alg *streamcipher_alg; + struct skcipher_alg_common *streamcipher_alg; struct crypto_alg *blockcipher_alg; struct shash_alg *hash_alg; int err; @@ -514,7 +514,7 @@ static int adiantum_create(struct crypto_template *tmpl, struct rtattr **tb) crypto_attr_alg_name(tb[1]), 0, mask); if (err) goto err_free_inst; - streamcipher_alg = crypto_spawn_skcipher_alg(&ictx->streamcipher_spawn); + streamcipher_alg = crypto_spawn_skcipher_alg_common(&ictx->streamcipher_spawn); /* Block cipher, e.g. "aes" */ err = crypto_grab_cipher(&ictx->blockcipher_spawn, @@ -578,8 +578,8 @@ static int adiantum_create(struct crypto_template *tmpl, struct rtattr **tb) inst->alg.decrypt = adiantum_decrypt; inst->alg.init = adiantum_init_tfm; inst->alg.exit = adiantum_exit_tfm; - inst->alg.min_keysize = crypto_skcipher_alg_min_keysize(streamcipher_alg); - inst->alg.max_keysize = crypto_skcipher_alg_max_keysize(streamcipher_alg); + inst->alg.min_keysize = streamcipher_alg->min_keysize; + inst->alg.max_keysize = streamcipher_alg->max_keysize; inst->alg.ivsize = TWEAK_SIZE; inst->free = adiantum_free_instance; -- 2.39.2