diff options
| author | Eric Biggers <ebiggers@kernel.org> | 2025-10-17 21:30:57 -0700 |
|---|---|---|
| committer | Eric Biggers <ebiggers@kernel.org> | 2025-10-29 22:04:24 -0700 |
| commit | 50b8e36994a042103ea92b6d9f6d7de725f9ac5f (patch) | |
| tree | fb997be4949f90195a335875f5d2ca431d9564c5 /include/crypto/blake2s.h | |
| parent | 04cadb4fe0341304741ef60a297366b553f0ce36 (diff) | |
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>
Diffstat (limited to 'include/crypto/blake2s.h')
| -rw-r--r-- | include/crypto/blake2s.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/crypto/blake2s.h b/include/crypto/blake2s.h index f9ffd39194eb..a7dd678725b2 100644 --- a/include/crypto/blake2s.h +++ b/include/crypto/blake2s.h @@ -86,9 +86,9 @@ static inline void blake2s_init_key(struct blake2s_state *state, void blake2s_update(struct blake2s_state *state, const u8 *in, size_t inlen); void blake2s_final(struct blake2s_state *state, u8 *out); -static inline void blake2s(u8 *out, const u8 *in, const u8 *key, - const size_t outlen, const size_t inlen, - const size_t keylen) +static inline void blake2s(const u8 *key, const size_t keylen, + const u8 *in, const size_t inlen, + u8 *out, const size_t outlen) { struct blake2s_state state; |