Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp599116rda; Sun, 22 Oct 2023 01:19:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHPZFwWJQbfNEKlnMn0aqYdZjLLedhGvaxpfz3FyfaCeypVVftqIh3kUCTq/rzS4jU3i9dL X-Received: by 2002:a17:903:191:b0:1c9:bf14:4f94 with SMTP id z17-20020a170903019100b001c9bf144f94mr7027701plg.44.1697962748868; Sun, 22 Oct 2023 01:19:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697962748; cv=none; d=google.com; s=arc-20160816; b=C1QJx0WUv+3dTkeUr47CfvCqUAaQMf0lTgdGTeVQM13uE4i5fMxG2A/1CI/zloI8D6 eL9g9HsHUOKMZ6VxthuFdQxeGZL24uVuEvTAoyja6v8mEkp2DskkB38XjIHIjWkSk2Ph XUA0YLOqd03xlijrkExyOHISSREie0XX5bvdw6Mgi5n9zigc8SVcqHbPP9ZJOXWHi/fA NAsjQKtFyVElCGSj6vo+4PDGP63oAI72xYwM++t3aZcmwKS8NJHj6qmvMSFbtrotjey5 9FsPIUq2zvfZwf/y6CSIy6adKzfuFNG1rSFyATH0SfM14g2rOrbe+BU9yJtrRfZZjPuz Kjcg== 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:to:from :dkim-signature; bh=afIdeCqtEidggu8PMxvEddBYtX5SROSXCrc3OYmUi6w=; fh=uKl1CTlin8qnxt56ErGp3UOINPCBskOXHDuKvJLDQbo=; b=0ZptWZroQkqpeRRe46QVTI5UWZZrnbRt8FdW7QXN6CqQhmxYy4yhBytUIOrtu8Egkm KnM1cDE39v2EXByigSZYDYNoklmNhQawaiijlYTdYt6pM2An4Tn0bYoP7lrHEgVrn9yX zL/jAdbh3RJ6o8HzZ5wWi5Mo2WSKygrzwi6Wr90IYHSKMIxPmGf2Cyl7UKLrBqM4hMhW 2MKHwOEvOR+Z6KlpkZjHVRoQTwoJZLyxZJy1BNi3TUjJSH4ghRcWetj+ZGiTLlCkUusv MwqMmuAfwC0y8n4IeCjfwuKRMFZCQ0Rq6TI1mIEDzQmAXkb3gfqZqjElOOXRHa8VSic5 JlTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qRzbTJSQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id b9-20020a170903228900b001c61073b06bsi1623635plh.427.2023.10.22.01.19.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 01:19:08 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qRzbTJSQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id C9A8B807C573; Sun, 22 Oct 2023 01:19:04 -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 S231356AbjJVIS7 (ORCPT + 99 others); Sun, 22 Oct 2023 04:18:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231622AbjJVISt (ORCPT ); Sun, 22 Oct 2023 04:18:49 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEA8AF4 for ; Sun, 22 Oct 2023 01:18:47 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41E47C433D9 for ; Sun, 22 Oct 2023 08:18:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697962727; bh=rj/ALPreHUuVA2MtLaC3G7UlQAWXRyVrXCMUiaGremU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qRzbTJSQqIpLo4BesaG3aAHqb7rc5MRbNBHwrzobBNBC/e5HiLZMAYJs3h9u6RIb+ z8T/FHBPVNUKBoeVpbifnBBdBNzIbOAlObPbLW2D07DvScSHuB/+X0JGByflD9gxKi PnX/JRDB56qHUHy+/tkkag0XXiPfW/IJH1nU8gKFotPOxYvl9Zj4gA30hw13AjvDf4 1ewfR8irfAZqbA6dpVl/pvjEKuaq790EzykgI1WJmFojpps9V363CpnxkDqStUYEP6 6XWrCwjU0hdwX3h6PzcX4gkDcnxDB8mUcpg1AkSB4uOihm00RsbLQ7g1T7KuU0MjpQ lTvfwCq2n1owg== From: Eric Biggers To: linux-crypto@vger.kernel.org Subject: [PATCH 17/30] crypto: testmgr - stop checking crypto_ahash_alignmask Date: Sun, 22 Oct 2023 01:10:47 -0700 Message-ID: <20231022081100.123613-18-ebiggers@kernel.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231022081100.123613-1-ebiggers@kernel.org> References: <20231022081100.123613-1-ebiggers@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, 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 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]); Sun, 22 Oct 2023 01:19:05 -0700 (PDT) From: Eric Biggers Now that the alignmask for ahash and shash algorithms is always 0, crypto_ahash_alignmask() always returns 0 and will be removed. In preparation for this, stop checking crypto_ahash_alignmask() in testmgr. As a result of this change, test_sg_division::offset_relative_to_alignmask and testvec_config::key_offset_relative_to_alignmask no longer have any effect on ahash (or shash) algorithms. Therefore, also stop setting these flags in default_hash_testvec_configs[]. Signed-off-by: Eric Biggers --- crypto/testmgr.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 48a0929c7a158..335449a27f757 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c @@ -401,31 +401,29 @@ static const struct testvec_config default_hash_testvec_configs[] = { }, { .name = "digest aligned buffer", .src_divs = { { .proportion_of_total = 10000 } }, .finalization_type = FINALIZATION_TYPE_DIGEST, }, { .name = "init+update+final misaligned buffer", .src_divs = { { .proportion_of_total = 10000, .offset = 1 } }, .finalization_type = FINALIZATION_TYPE_FINAL, .key_offset = 1, }, { - .name = "digest buffer aligned only to alignmask", + .name = "digest misaligned buffer", .src_divs = { { .proportion_of_total = 10000, .offset = 1, - .offset_relative_to_alignmask = true, }, }, .finalization_type = FINALIZATION_TYPE_DIGEST, .key_offset = 1, - .key_offset_relative_to_alignmask = true, }, { .name = "init+update+update+final two even splits", .src_divs = { { .proportion_of_total = 5000 }, { .proportion_of_total = 5000, .flush_type = FLUSH_TYPE_FLUSH, }, }, .finalization_type = FINALIZATION_TYPE_FINAL, @@ -1451,54 +1449,53 @@ static int check_nonfinal_ahash_op(const char *op, int err, /* Test one hash test vector in one configuration, using the ahash API */ static int test_ahash_vec_cfg(const struct hash_testvec *vec, const char *vec_name, const struct testvec_config *cfg, struct ahash_request *req, struct test_sglist *tsgl, u8 *hashstate) { struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); - const unsigned int alignmask = crypto_ahash_alignmask(tfm); const unsigned int digestsize = crypto_ahash_digestsize(tfm); const unsigned int statesize = crypto_ahash_statesize(tfm); const char *driver = crypto_ahash_driver_name(tfm); const u32 req_flags = CRYPTO_TFM_REQ_MAY_BACKLOG | cfg->req_flags; const struct test_sg_division *divs[XBUFSIZE]; DECLARE_CRYPTO_WAIT(wait); unsigned int i; struct scatterlist *pending_sgl; unsigned int pending_len; u8 result[HASH_MAX_DIGESTSIZE + TESTMGR_POISON_LEN]; int err; /* Set the key, if specified */ if (vec->ksize) { err = do_setkey(crypto_ahash_setkey, tfm, vec->key, vec->ksize, - cfg, alignmask); + cfg, 0); if (err) { if (err == vec->setkey_error) return 0; pr_err("alg: ahash: %s setkey failed on test vector %s; expected_error=%d, actual_error=%d, flags=%#x\n", driver, vec_name, vec->setkey_error, err, crypto_ahash_get_flags(tfm)); return err; } if (vec->setkey_error) { pr_err("alg: ahash: %s setkey unexpectedly succeeded on test vector %s; expected_error=%d\n", driver, vec_name, vec->setkey_error); return -EINVAL; } } /* Build the scatterlist for the source data */ - err = build_hash_sglist(tsgl, vec, cfg, alignmask, divs); + err = build_hash_sglist(tsgl, vec, cfg, 0, divs); if (err) { pr_err("alg: ahash: %s: error preparing scatterlist for test vector %s, cfg=\"%s\"\n", driver, vec_name, cfg->name); return err; } /* Do the actual hashing */ testmgr_poison(req->__ctx, crypto_ahash_reqsize(tfm)); testmgr_poison(result, digestsize + TESTMGR_POISON_LEN); -- 2.42.0