summaryrefslogtreecommitdiff
path: root/crypto/chacha_generic.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2019-06-02 22:47:14 -0700
committerHerbert Xu <herbert@gondor.apana.org.au>2019-06-13 14:31:40 +0800
commitf3d7d849c549142fc086c9bfbf1e1df68b64eb90 (patch)
treead45df72089cb616125c7a08d8d0b05abe63b464 /crypto/chacha_generic.c
parentc43a25fe84e197d1ffe35be070731d8cbb1b3333 (diff)
downloadlinux-crypto-f3d7d849c549142fc086c9bfbf1e1df68b64eb90.tar.gz
linux-crypto-f3d7d849c549142fc086c9bfbf1e1df68b64eb90.zip
crypto: chacha - constify ctx and iv arguments
Constify the ctx and iv arguments to crypto_chacha_init() and the various chacha*_stream_xor() functions. This makes it clear that they are not modified. Signed-off-by: Eric Biggers <ebiggers@google.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r--crypto/chacha_generic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/chacha_generic.c b/crypto/chacha_generic.c
index d2ec0499..d283bd3b 100644
--- a/crypto/chacha_generic.c
+++ b/crypto/chacha_generic.c
@@ -36,7 +36,7 @@ static void chacha_docrypt(u32 *state, u8 *dst, const u8 *src,
}
static int chacha_stream_xor(struct skcipher_request *req,
- struct chacha_ctx *ctx, u8 *iv)
+ const struct chacha_ctx *ctx, const u8 *iv)
{
struct skcipher_walk walk;
u32 state[16];
@@ -60,7 +60,7 @@ static int chacha_stream_xor(struct skcipher_request *req,
return err;
}
-void crypto_chacha_init(u32 *state, struct chacha_ctx *ctx, u8 *iv)
+void crypto_chacha_init(u32 *state, const struct chacha_ctx *ctx, const u8 *iv)
{
state[0] = 0x61707865; /* "expa" */
state[1] = 0x3320646e; /* "nd 3" */