[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251019160729.GA1604@sol>
Date: Sun, 19 Oct 2025 09:07:29 -0700
From: Eric Biggers <ebiggers@...nel.org>
To: "Jason A. Donenfeld" <Jason@...c4.com>
Cc: linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-btrfs@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
Ard Biesheuvel <ardb@...nel.org>
Subject: Re: [PATCH 01/10] lib/crypto: blake2s: Adjust parameter order of
blake2s()
On Sun, Oct 19, 2025 at 04:36:36PM +0200, Jason A. Donenfeld wrote:
> On Fri, Oct 17, 2025 at 09:30:57PM -0700, Eric Biggers wrote:
> > Reorder the parameters of blake2s() from (out, in, key, outlen, inlen,
> > keylen) to (key, keylen, in, inlen, out, outlen).
>
> No objections to putting the size next to the argument. That makes
> sense. But the order really should be:
>
> out, outlen, in, inlen, key, keylen
>
> in order to match normal APIs that output data. The output argument goes
> first. The input argument goes next. Auxiliary information goes after.
In general, both conventions are common. But in the other hashing
functions in the kernel, we've been using output last. I'd like to
prioritize making it consistent with:
md5()
sha1()
sha224()
sha256()
sha384()
sha512()
hmac_md5()
hmac_sha1()
hmac_sha224()
hmac_sha256()
hmac_sha384()
hmac_sha512()
hmac_md5_usingrawkey()
hmac_sha1_usingrawkey()
hmac_sha224_usingrawkey()
hmac_sha256_usingrawkey()
hmac_sha384_usingrawkey()
hmac_sha512_usingrawkey()
crypto_shash_finup()
crypto_shash_digest()
crypto_shash_tfm_digest()
[and the SHA-3 functions in David's patchset]
- Eric
Powered by blists - more mailing lists