aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch/riscv/lib
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2025-05-05 11:18:24 -0700
committerHerbert Xu <herbert@gondor.apana.org.au>2025-05-12 13:32:53 +0800
commitbdc2a55687f123bd32aaefb81e11c7450a431eaf (patch)
tree1d654231eecaaabd4860e631a248c04a45718abb /arch/riscv/lib
parentcrypto: lib/chacha - add strongly-typed state zeroization (diff)
downloadwireguard-linux-bdc2a55687f123bd32aaefb81e11c7450a431eaf.tar.xz
wireguard-linux-bdc2a55687f123bd32aaefb81e11c7450a431eaf.zip
crypto: lib/chacha - add array bounds to function prototypes
Add explicit array bounds to the function prototypes for the parameters that didn't already get handled by the conversion to use chacha_state: - chacha_block_*(): Change 'u8 *out' or 'u8 *stream' to u8 out[CHACHA_BLOCK_SIZE]. - hchacha_block_*(): Change 'u32 *out' or 'u32 *stream' to u32 out[HCHACHA_OUT_WORDS]. - chacha_init(): Change 'const u32 *key' to 'const u32 key[CHACHA_KEY_WORDS]'. Change 'const u8 *iv' to 'const u8 iv[CHACHA_IV_SIZE]'. No functional changes. This just makes it clear when fixed-size arrays are expected. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'arch/riscv/lib')
-rw-r--r--arch/riscv/lib/crypto/chacha-riscv64-glue.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/riscv/lib/crypto/chacha-riscv64-glue.c b/arch/riscv/lib/crypto/chacha-riscv64-glue.c
index 57541621981e..8c3f11d79be3 100644
--- a/arch/riscv/lib/crypto/chacha-riscv64-glue.c
+++ b/arch/riscv/lib/crypto/chacha-riscv64-glue.c
@@ -18,7 +18,8 @@ static __ro_after_init DEFINE_STATIC_KEY_FALSE(use_zvkb);
asmlinkage void chacha_zvkb(struct chacha_state *state, const u8 *in, u8 *out,
size_t nblocks, int nrounds);
-void hchacha_block_arch(const struct chacha_state *state, u32 *out, int nrounds)
+void hchacha_block_arch(const struct chacha_state *state,
+ u32 out[HCHACHA_OUT_WORDS], int nrounds)
{
hchacha_block_generic(state, out, nrounds);
}