kernel: 5.4: import wireguard backport
[openwrt/openwrt.git] / target / linux / generic / backport-5.4 / 080-wireguard-0058-crypto-lib-chacha20poly1305-Add-missing-function-dec.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Herbert Xu <herbert@gondor.apana.org.au>
3 Date: Wed, 8 Jul 2020 12:41:13 +1000
4 Subject: [PATCH] crypto: lib/chacha20poly1305 - Add missing function
5 declaration
6
7 commit 06cc2afbbdf9a9e8df3e2f8db724997dd6e1b4ac upstream.
8
9 This patch adds a declaration for chacha20poly1305_selftest to
10 silence a sparse warning.
11
12 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
13 Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
14 ---
15 include/crypto/chacha20poly1305.h | 2 ++
16 lib/crypto/chacha20poly1305.c | 2 --
17 2 files changed, 2 insertions(+), 2 deletions(-)
18
19 --- a/include/crypto/chacha20poly1305.h
20 +++ b/include/crypto/chacha20poly1305.h
21 @@ -45,4 +45,6 @@ bool chacha20poly1305_decrypt_sg_inplace
22 const u64 nonce,
23 const u8 key[CHACHA20POLY1305_KEY_SIZE]);
24
25 +bool chacha20poly1305_selftest(void);
26 +
27 #endif /* __CHACHA20POLY1305_H */
28 --- a/lib/crypto/chacha20poly1305.c
29 +++ b/lib/crypto/chacha20poly1305.c
30 @@ -21,8 +21,6 @@
31
32 #define CHACHA_KEY_WORDS (CHACHA_KEY_SIZE / sizeof(u32))
33
34 -bool __init chacha20poly1305_selftest(void);
35 -
36 static void chacha_load_key(u32 *k, const u8 *in)
37 {
38 k[0] = get_unaligned_le32(in);