diff options
| author | Eric Biggers <ebiggers@kernel.org> | 2025-10-17 21:30:58 -0700 |
|---|---|---|
| committer | Eric Biggers <ebiggers@kernel.org> | 2025-10-29 22:04:24 -0700 |
| commit | 5e0ec8e46d4d6488242bb39a4ce5c0276afa5f32 (patch) | |
| tree | c867511d4d827a19d4f3333789f09de260ebd352 /lib/crypto/x86/blake2s.h | |
| parent | 50b8e36994a042103ea92b6d9f6d7de725f9ac5f (diff) | |
lib/crypto: blake2s: Rename blake2s_state to blake2s_ctx
For consistency with the SHA-1, SHA-2, SHA-3 (in development), and MD5
library APIs, rename blake2s_state to blake2s_ctx.
As a refresher, the ctx name:
- Is a bit shorter.
- Avoids confusion with the compression function state, which is also
often called the state (but is just part of the full context).
- Is consistent with OpenSSL.
Not a big deal, of course. But consistency is nice. With a BLAKE2b
library API about to be added, this is a convenient time to update this.
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20251018043106.375964-3-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Diffstat (limited to 'lib/crypto/x86/blake2s.h')
| -rw-r--r-- | lib/crypto/x86/blake2s.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/crypto/x86/blake2s.h b/lib/crypto/x86/blake2s.h index b6d30d2fa045..de360935b820 100644 --- a/lib/crypto/x86/blake2s.h +++ b/lib/crypto/x86/blake2s.h @@ -11,24 +11,24 @@ #include <linux/kernel.h> #include <linux/sizes.h> -asmlinkage void blake2s_compress_ssse3(struct blake2s_state *state, +asmlinkage void blake2s_compress_ssse3(struct blake2s_ctx *ctx, const u8 *block, const size_t nblocks, const u32 inc); -asmlinkage void blake2s_compress_avx512(struct blake2s_state *state, +asmlinkage void blake2s_compress_avx512(struct blake2s_ctx *ctx, const u8 *block, const size_t nblocks, const u32 inc); static __ro_after_init DEFINE_STATIC_KEY_FALSE(blake2s_use_ssse3); static __ro_after_init DEFINE_STATIC_KEY_FALSE(blake2s_use_avx512); -static void blake2s_compress(struct blake2s_state *state, const u8 *block, +static void blake2s_compress(struct blake2s_ctx *ctx, const u8 *block, size_t nblocks, const u32 inc) { /* SIMD disables preemption, so relax after processing each page. */ BUILD_BUG_ON(SZ_4K / BLAKE2S_BLOCK_SIZE < 8); if (!static_branch_likely(&blake2s_use_ssse3) || !may_use_simd()) { - blake2s_compress_generic(state, block, nblocks, inc); + blake2s_compress_generic(ctx, block, nblocks, inc); return; } @@ -38,9 +38,9 @@ static void blake2s_compress(struct blake2s_state *state, const u8 *block, kernel_fpu_begin(); if (static_branch_likely(&blake2s_use_avx512)) - blake2s_compress_avx512(state, block, blocks, inc); + blake2s_compress_avx512(ctx, block, blocks, inc); else - blake2s_compress_ssse3(state, block, blocks, inc); + blake2s_compress_ssse3(ctx, block, blocks, inc); kernel_fpu_end(); nblocks -= blocks; |
