Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp599154rda; Sun, 22 Oct 2023 01:19:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE39Xi76UDWqZa9B5YWtGDuQM4+J/sQNKVvqlXpCqqHZg1UaHx3fbNfGsv/Fp5xJFk/W30V X-Received: by 2002:a05:6e02:1cab:b0:351:4cdd:f533 with SMTP id x11-20020a056e021cab00b003514cddf533mr8361213ill.4.1697962753573; Sun, 22 Oct 2023 01:19:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697962753; cv=none; d=google.com; s=arc-20160816; b=YDRaHiXfDui8LSWZ+sD7bnDEZFuhp3doAgAompVADkcKvqdriKOnxnch/p8CDBIYZc B77o9RVAF1Gj9xZz37W0RftizLWFMKgwmac6cQXibX5kq6hCWVGRx1ibfOCm+SKgKsi6 3ueNtKmRO7RmwMJC45W/mpqID0Ri8Mxx4Hg1E3CBratV3RzFQV+L29+aX93UPBDU73Zr L+JUualZbCCSZaokku7jLkVk5mHx4z9lDPipRzau/Fb5WzrJCcZ7m/p/5ilc+8se7VjY hw6cLNmNQTcOfw85reVe14RHK1gt6KBtUFyMrclsJ3KZpEsV2EgS0YAzOwyIgtuXloQf eIWw== 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=xQl+a84m2cXN+RUNYDm5U/oBos6bs0cWfQEnQj+Sr6o=; fh=uKl1CTlin8qnxt56ErGp3UOINPCBskOXHDuKvJLDQbo=; b=R33ZDXhP9Gi4eZOOvwZ3fvlRHJ+/pca7En6DHvlUVfV/uHyLMVUJ5prVpCkSPuVqUJ ZE6EF7OLxHFHGz5+BJMuc9eZopo+abDXhogYPsyhbQRB+YH3sSi/ObNDFLZVigtBbvtv 1FcDo7USEeXastta1h0/UjqnNtt7N0W7WcKa6DFr49sfMANkZGkaSiKiYiKBjzoeK1jy D24E/rnVxL2GU5zE9F4cK6Itttg7nlOx1buU5q5HLc7BoNwCuzxIe7I8YXmxBcUtHlQy gdt7BwlGzhNAu1QimWgV0Jt3xb4YgaENSyQiRHvp8eU0H9jcvY7wFAHdvhOpnOjDTp5y 53VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZqexhcWw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id w14-20020a17090a780e00b002791bfc67bdsi4537842pjk.41.2023.10.22.01.19.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 01:19:13 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZqexhcWw; 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; 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 howler.vger.email (Postfix) with ESMTP id 7DA4980597A4; Sun, 22 Oct 2023 01:19:10 -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 S231719AbjJVISx (ORCPT + 99 others); Sun, 22 Oct 2023 04:18:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231461AbjJVISr (ORCPT ); Sun, 22 Oct 2023 04:18:47 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B93EBD6 for ; Sun, 22 Oct 2023 01:18:45 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 563EBC433C8 for ; Sun, 22 Oct 2023 08:18:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697962725; bh=nsEGWgLIg9i79Cc2Ebg5dQoQdi0mU0M4U4wWady7BaU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZqexhcWw1lK/dgjHYUsfAu3X6h4l0HQFqh9bncy/NxyPq3+6srOTlc7fVYrk73o2A jSNgu3wdVYZ7Sl08pD9qmmgX/aA7cKxol9+8519whluBhgsTvzkt/BDSI6BuxNPkth dMXK1H4blvzy4n4OSAn+Q3legvna3OuyRPclOweKXw1rUZBkP618/u7Fth5F92F7MS fH5ribo8AJvuYhq5KBNcyKA30LvvzMWgpNbC2Dg6t0wroNuW+wcZHhWhfGghMPr/2R azDmFrC6Q6v/qQ6tgAkIFSUS69356FjbcXg6IwPvBkv9gnH6Td/JPQH0nvj7zPWEqi HpTz22UDdN5+w== From: Eric Biggers To: linux-crypto@vger.kernel.org Subject: [PATCH 08/30] crypto: s5p-sss - remove unnecessary alignmask for ahashes Date: Sun, 22 Oct 2023 01:10:38 -0700 Message-ID: <20231022081100.123613-9-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=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Sun, 22 Oct 2023 01:19:10 -0700 (PDT) From: Eric Biggers The crypto API's support for alignmasks for ahash algorithms is nearly useless, as its only effect is to cause the API to align the key and result buffers. The drivers that happen to be specifying an alignmask for ahash rarely actually need it. When they do, it's easily fixable, especially considering that these buffers cannot be used for DMA. In preparation for removing alignmask support from ahash, this patch makes the s5p-sss driver no longer use it. This driver didn't actually rely on it; it only writes to the result buffer in s5p_hash_copy_result(), simply using memcpy(). And this driver only supports unkeyed hash algorithms, so the key buffer need not be considered. Signed-off-by: Eric Biggers --- drivers/crypto/s5p-sss.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c index fe8cf9ba8005c..43b840c7b743f 100644 --- a/drivers/crypto/s5p-sss.c +++ b/drivers/crypto/s5p-sss.c @@ -217,23 +217,20 @@ #define HASH_FLAGS_FINAL 1 #define HASH_FLAGS_DMA_ACTIVE 2 #define HASH_FLAGS_OUTPUT_READY 3 #define HASH_FLAGS_DMA_READY 4 #define HASH_FLAGS_SGS_COPIED 5 #define HASH_FLAGS_SGS_ALLOCED 6 /* HASH HW constants */ #define BUFLEN HASH_BLOCK_SIZE -#define SSS_HASH_DMA_LEN_ALIGN 8 -#define SSS_HASH_DMA_ALIGN_MASK (SSS_HASH_DMA_LEN_ALIGN - 1) - #define SSS_HASH_QUEUE_LENGTH 10 /** * struct samsung_aes_variant - platform specific SSS driver data * @aes_offset: AES register offset from SSS module's base. * @hash_offset: HASH register offset from SSS module's base. * @clk_names: names of clocks needed to run SSS IP * * Specifies platform specific configuration of SSS module. * Note: A structure for driver specific platform data is used for future @@ -1739,21 +1736,20 @@ static struct ahash_alg algs_sha1_md5_sha256[] = { .halg.digestsize = SHA1_DIGEST_SIZE, .halg.base = { .cra_name = "sha1", .cra_driver_name = "exynos-sha1", .cra_priority = 100, .cra_flags = CRYPTO_ALG_KERN_DRIVER_ONLY | CRYPTO_ALG_ASYNC | CRYPTO_ALG_NEED_FALLBACK, .cra_blocksize = HASH_BLOCK_SIZE, .cra_ctxsize = sizeof(struct s5p_hash_ctx), - .cra_alignmask = SSS_HASH_DMA_ALIGN_MASK, .cra_module = THIS_MODULE, .cra_init = s5p_hash_cra_init, .cra_exit = s5p_hash_cra_exit, } }, { .init = s5p_hash_init, .update = s5p_hash_update, .final = s5p_hash_final, .finup = s5p_hash_finup, @@ -1764,21 +1760,20 @@ static struct ahash_alg algs_sha1_md5_sha256[] = { .halg.digestsize = MD5_DIGEST_SIZE, .halg.base = { .cra_name = "md5", .cra_driver_name = "exynos-md5", .cra_priority = 100, .cra_flags = CRYPTO_ALG_KERN_DRIVER_ONLY | CRYPTO_ALG_ASYNC | CRYPTO_ALG_NEED_FALLBACK, .cra_blocksize = HASH_BLOCK_SIZE, .cra_ctxsize = sizeof(struct s5p_hash_ctx), - .cra_alignmask = SSS_HASH_DMA_ALIGN_MASK, .cra_module = THIS_MODULE, .cra_init = s5p_hash_cra_init, .cra_exit = s5p_hash_cra_exit, } }, { .init = s5p_hash_init, .update = s5p_hash_update, .final = s5p_hash_final, .finup = s5p_hash_finup, @@ -1789,21 +1784,20 @@ static struct ahash_alg algs_sha1_md5_sha256[] = { .halg.digestsize = SHA256_DIGEST_SIZE, .halg.base = { .cra_name = "sha256", .cra_driver_name = "exynos-sha256", .cra_priority = 100, .cra_flags = CRYPTO_ALG_KERN_DRIVER_ONLY | CRYPTO_ALG_ASYNC | CRYPTO_ALG_NEED_FALLBACK, .cra_blocksize = HASH_BLOCK_SIZE, .cra_ctxsize = sizeof(struct s5p_hash_ctx), - .cra_alignmask = SSS_HASH_DMA_ALIGN_MASK, .cra_module = THIS_MODULE, .cra_init = s5p_hash_cra_init, .cra_exit = s5p_hash_cra_exit, } } }; static void s5p_set_aes(struct s5p_aes_dev *dev, const u8 *key, const u8 *iv, const u8 *ctr, -- 2.42.0