diff options
author | Eric Biggers <ebiggers@google.com> | 2019-06-03 01:47:14 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2019-06-13 02:31:40 -0400 |
commit | 860ab2e50204c41e713c54c752617d2da57f0fd7 (patch) | |
tree | 925afd2b64bb253f4963c9b6154ffb3306870824 /crypto | |
parent | 76cadf2244518d3b1610082d037b01e2651ea402 (diff) |
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 'crypto')
-rw-r--r-- | crypto/chacha_generic.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/chacha_generic.c b/crypto/chacha_generic.c index d2ec04997832..d283bd3bdb60 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, | |||
36 | } | 36 | } |
37 | 37 | ||
38 | static int chacha_stream_xor(struct skcipher_request *req, | 38 | static int chacha_stream_xor(struct skcipher_request *req, |
39 | struct chacha_ctx *ctx, u8 *iv) | 39 | const struct chacha_ctx *ctx, const u8 *iv) |
40 | { | 40 | { |
41 | struct skcipher_walk walk; | 41 | struct skcipher_walk walk; |
42 | u32 state[16]; | 42 | u32 state[16]; |
@@ -60,7 +60,7 @@ static int chacha_stream_xor(struct skcipher_request *req, | |||
60 | return err; | 60 | return err; |
61 | } | 61 | } |
62 | 62 | ||
63 | void crypto_chacha_init(u32 *state, struct chacha_ctx *ctx, u8 *iv) | 63 | void crypto_chacha_init(u32 *state, const struct chacha_ctx *ctx, const u8 *iv) |
64 | { | 64 | { |
65 | state[0] = 0x61707865; /* "expa" */ | 65 | state[0] = 0x61707865; /* "expa" */ |
66 | state[1] = 0x3320646e; /* "nd 3" */ | 66 | state[1] = 0x3320646e; /* "nd 3" */ |