]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
lib/crypto: blake2s: Adjust parameter order of blake2s()
authorEric Biggers <ebiggers@kernel.org>
Sat, 18 Oct 2025 04:30:57 +0000 (21:30 -0700)
committerEric Biggers <ebiggers@kernel.org>
Thu, 30 Oct 2025 05:04:24 +0000 (22:04 -0700)
commit50b8e36994a042103ea92b6d9f6d7de725f9ac5f
treefb997be4949f90195a335875f5d2ca431d9564c5
parent04cadb4fe0341304741ef60a297366b553f0ce36
lib/crypto: blake2s: Adjust parameter order of blake2s()

Reorder the parameters of blake2s() from (out, in, key, outlen, inlen,
keylen) to (key, keylen, in, inlen, out, outlen).

This aligns BLAKE2s with the common conventions of pairing buffers and
their lengths, and having outputs follow inputs.  This is widely used
elsewhere in lib/crypto/ and crypto/, and even elsewhere in the BLAKE2s
code itself such as blake2s_init_key() and blake2s_final().  So
blake2s() was a bit of an exception.

Notably, this results in the same order as hmac_*_usingrawkey().

Note that since the type signature changed, it's not possible for a
blake2s() call site to be silently missed.

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20251018043106.375964-2-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
drivers/char/random.c
drivers/net/wireguard/cookie.c
drivers/net/wireguard/noise.c
include/crypto/blake2s.h
lib/crypto/tests/blake2s_kunit.c