Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2554656rda; Wed, 25 Oct 2023 06:16:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBWWvB54fxXRvxGBpNnODkPxHlYSt1k8uvLQXp/Pnwce3gGojJlbAN+DOot6sQax2HxUhX X-Received: by 2002:a25:8608:0:b0:d81:91b2:62ea with SMTP id y8-20020a258608000000b00d8191b262eamr20672507ybk.1.1698239778055; Wed, 25 Oct 2023 06:16:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698239778; cv=none; d=google.com; s=arc-20160816; b=UgXPqvV8PIF5iaG09R9U5F1fCP737NWRxHJWWM4bGlON1ogS4gsQhhnZfoZNPrZ4HM /ueRVvY0TRwY6SmzPST16FJZ8av8HbM82X/86Vf8Rx8/+4CHGXF/yyuSL1tAtVfY8qB7 9cFJ4NBLZlAIAG8emAtI7hiEaDvzYfcCQQ6oS7J1LUjZqvniwmmkX7DLIo4V1pX0xocA 4o6I4LgDcvHB5qD0fBLghgTHnh8niFAIPEJ56xBy43mcNbppTsvMt32odXSzLzUI59Rv 9p9emszSqJDWUs7ihGE7w5Haix+9TsBkWopnranNwaUFhroitkp5+oEX6RPz6wDJEG+M tNPw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=cV1PUHJZjuWLXGMUIbBqZOhzu0saUfvOrAWTEIJ/hMU=; fh=v8SlAb8vOWeuU/XKcMsm5/V2gwyJLmFCvIFdIJTrq7Y=; b=Xacc9DOa9fyV3qdLo8zYF4pMk02sTwIsRTuM4qRICLy9dh6FK49QKSMpsu4/9QgCj5 hJAtCzEKontrWVv476o28psfkUQLlpJA2D0sr4rdPCtb6tJjIe35vJkcwdgSQWiqeraT HGA8O8PPyLkJbGhGcyc0KHF0tQTw9BoZxQRiEE0zh6dpzhwVb83KyxCzFWUCJKho8j69 MdstDWX4ljZ61nPB7m7yNkt1ZTnFtmi5ahQyEKzA3+8Dn0wwURtfJBZAw0dbx6o170ya 98klE3+WXU06ojXSxHEj0DFRB8blZFcFtBtn99ohJ7uDIVGuuiYt8rjrzD1MsNlwZnD+ bl9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Uvhb5hON; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id v2-20020a25ab82000000b00d9cb53e5194si10242007ybi.681.2023.10.25.06.16.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 06:16:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Uvhb5hON; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id AB1AC805060A; Wed, 25 Oct 2023 06:16:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232823AbjJYNP7 (ORCPT + 99 others); Wed, 25 Oct 2023 09:15:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233808AbjJYNP6 (ORCPT ); Wed, 25 Oct 2023 09:15:58 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B60771B5 for ; Wed, 25 Oct 2023 06:15:54 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4083f61312eso45983235e9.3 for ; Wed, 25 Oct 2023 06:15:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698239753; x=1698844553; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=cV1PUHJZjuWLXGMUIbBqZOhzu0saUfvOrAWTEIJ/hMU=; b=Uvhb5hONJdomhOqxyHGXGd45WeN7xVzYsp6PxdKeT3kBWR5950yEMw+kGeojnZo2rq HrnXrPqkfzZVZ/RDFAkKRKjcD1VgxCh3gQ2+LIwBLOMjK0IS89bTzU/WCvPnZVYdteyv n0TV0jOiB2th6h0x+lxyhyiabwI1wdkM26nI4Ur+WdzISKfhXQeDvqSh1FdESjgBRImN AV8j3X3xizOke7wmoi/pGhnLnqvLZYsBfAqozYF0UbPU8Kq5x5PPw0UvHObmF5YB0TNF jDOBdimjoY0G8OnALn5+BF2fH1oHJDpQdOgaj1ZRuyU5hOMvRNhS/qbflw/ALu9JYQVp J6mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698239753; x=1698844553; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cV1PUHJZjuWLXGMUIbBqZOhzu0saUfvOrAWTEIJ/hMU=; b=lz+HrU9iNXQ795kI++0ba/atZ7CHyHiBKmf2BSq+wqDx7ZwDNwB70HUTPjZ64+u5Ck DVsV4wde6KPQGhTYA/y1F0UD56325lopJC4v+Qe/7bSNB0JJSedKdDEDfTCk+sRHCnPE y/3VEfEUYCNBN4h5IISvL50wVGOWp5UztLC0ACifEpP4X4txmeY1zK0b49kDlvCpjgFm RmMoH8LgzH1d+9m1KYWqXn6A7DndbXVyk6G7G/K+dgif5/nLsWx2kk4l/J1n+mnJQyve uaL1dMS4yns3GGyKadBlcpwqPpsUouo8cSKcs4dexd1YfIV8I6uDnVkwTbnh/s967O6R l7SA== X-Gm-Message-State: AOJu0YxVAIJYo0yHw6zKcovCwJo/abSFXSyioAzssm+4++bhG01j0w/l GHMSqhXPdZ2Fi1tE27bA3tA= X-Received: by 2002:a5d:6892:0:b0:32d:8b21:40fc with SMTP id h18-20020a5d6892000000b0032d8b2140fcmr12008724wru.9.1698239752799; Wed, 25 Oct 2023 06:15:52 -0700 (PDT) Received: from Red ([2a01:cb1d:3d5:a100:4a02:2aff:fe07:1efc]) by smtp.googlemail.com with ESMTPSA id t14-20020a5d534e000000b0032710f5584fsm12023765wrv.25.2023.10.25.06.15.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 06:15:52 -0700 (PDT) Date: Wed, 25 Oct 2023 15:15:51 +0200 From: Corentin Labbe To: Eric Biggers Cc: linux-crypto@vger.kernel.org Subject: Re: [PATCH 02/30] crypto: sun4i-ss - remove unnecessary alignmask for ahashes Message-ID: References: <20231022081100.123613-1-ebiggers@kernel.org> <20231022081100.123613-3-ebiggers@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231022081100.123613-3-ebiggers@kernel.org> X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 groat.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 (groat.vger.email [0.0.0.0]); Wed, 25 Oct 2023 06:16:03 -0700 (PDT) Le Sun, Oct 22, 2023 at 01:10:32AM -0700, Eric Biggers a ?crit : > 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 sun4i-ss driver no longer use it. This driver didn't actually > rely on it; it only writes to the result buffer in sun4i_hash(), already > using the unaligned access helpers. And this driver only supports > unkeyed hash algorithms, so the key buffer need not be considered. > > Signed-off-by: Eric Biggers > --- > drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c > index 3bcfcfc370842..e23a020a64628 100644 > --- a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c > +++ b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c > @@ -42,21 +42,20 @@ static struct sun4i_ss_alg_template ss_algs[] = { > .digest = sun4i_hash_digest, > .export = sun4i_hash_export_md5, > .import = sun4i_hash_import_md5, > .halg = { > .digestsize = MD5_DIGEST_SIZE, > .statesize = sizeof(struct md5_state), > .base = { > .cra_name = "md5", > .cra_driver_name = "md5-sun4i-ss", > .cra_priority = 300, > - .cra_alignmask = 3, > .cra_blocksize = MD5_HMAC_BLOCK_SIZE, > .cra_ctxsize = sizeof(struct sun4i_req_ctx), > .cra_module = THIS_MODULE, > .cra_init = sun4i_hash_crainit, > .cra_exit = sun4i_hash_craexit, > } > } > } > }, > { .type = CRYPTO_ALG_TYPE_AHASH, > @@ -69,21 +68,20 @@ static struct sun4i_ss_alg_template ss_algs[] = { > .digest = sun4i_hash_digest, > .export = sun4i_hash_export_sha1, > .import = sun4i_hash_import_sha1, > .halg = { > .digestsize = SHA1_DIGEST_SIZE, > .statesize = sizeof(struct sha1_state), > .base = { > .cra_name = "sha1", > .cra_driver_name = "sha1-sun4i-ss", > .cra_priority = 300, > - .cra_alignmask = 3, > .cra_blocksize = SHA1_BLOCK_SIZE, > .cra_ctxsize = sizeof(struct sun4i_req_ctx), > .cra_module = THIS_MODULE, > .cra_init = sun4i_hash_crainit, > .cra_exit = sun4i_hash_craexit, > } > } > } > }, > { .type = CRYPTO_ALG_TYPE_SKCIPHER, > -- > 2.42.0 > Acked-by: Corentin Labbe Thanks