From: Herbert Xu <herbert@gondor.apana.org.au>
To: Corentin Labbe <clabbe.montjoie@gmail.com>
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] crypto: arm/blake2b - Set FINAL_NONZERO
Date: Fri, 25 Apr 2025 11:33:39 +0800 [thread overview]
Message-ID: <aAsCk3jtbAE7dPpJ@gondor.apana.org.au> (raw)
In-Reply-To: <aAqhbdiLmkHV350S@Red>
On Thu, Apr 24, 2025 at 10:39:09PM +0200, Corentin Labbe wrote:
>
> Thanks it fixes my crypto hw devices.
> So Tested-by: Corentin LABBE <clabbe.montjoie@gmail.com>
What about the sha1-ce failure on arm64? Did that go away too?
That didn't seem related to crypto_engine.
> But I still got some crash with blake2b:
> +[ 54.348477] alg: shash: blake2b-256-neon test failed (wrong result) on test vector 1, cfg="init+update+final aligned buffer"
> +[ 54.348525] alg: self-tests for blake2b-256 using blake2b-256-neon failed (rc=-22)
> +[ 54.348536] ------------[ cut here ]------------
OK this is easy, I left out the FINAL_NONZERO bit in the arm patch:
---8<---
Set FINAL_NONZERO as blake2b expects to have at least one byte for
finalisation.
Reported-by: Corentin LABBE <clabbe.montjoie@gmail.com>
Fixes: cc28260ab4fb ("crypto: arm/blake2b - Use API partial block handling")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
diff --git a/arch/arm/crypto/blake2b-neon-glue.c b/arch/arm/crypto/blake2b-neon-glue.c
index 7ae4ba0afe06..2ff443a91724 100644
--- a/arch/arm/crypto/blake2b-neon-glue.c
+++ b/arch/arm/crypto/blake2b-neon-glue.c
@@ -52,7 +52,8 @@ static int crypto_blake2b_finup_neon(struct shash_desc *desc, const u8 *in,
.base.cra_driver_name = driver_name, \
.base.cra_priority = 200, \
.base.cra_flags = CRYPTO_ALG_OPTIONAL_KEY | \
- CRYPTO_AHASH_ALG_BLOCK_ONLY, \
+ CRYPTO_AHASH_ALG_BLOCK_ONLY | \
+ CRYPTO_AHASH_ALG_FINAL_NONZERO, \
.base.cra_blocksize = BLAKE2B_BLOCK_SIZE, \
.base.cra_ctxsize = sizeof(struct blake2b_tfm_ctx), \
.base.cra_module = THIS_MODULE, \
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
next prev parent reply other threads:[~2025-04-25 3:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-24 12:09 all crypto selftests failed on linux-next-20250424 Corentin Labbe
2025-04-24 13:14 ` Herbert Xu
2025-04-24 14:42 ` [PATCH] crypto: Remove CRYPTO_ALG_ENGINE bit Herbert Xu
2025-04-24 20:39 ` Corentin Labbe
2025-04-25 3:33 ` Herbert Xu [this message]
2025-04-25 10:42 ` [PATCH] crypto: arm/blake2b - Set FINAL_NONZERO Corentin Labbe
2025-04-25 10:58 ` [PATCH] crypto: arm64/sha1 - Set finalize for short finup Herbert Xu
2025-04-25 19:16 ` Corentin Labbe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aAsCk3jtbAE7dPpJ@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=clabbe.montjoie@gmail.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®