9c7c3c7bccf25aa81fdeee85aa1f13acb90593f0
[openwrt/staging/mans0n.git] /
1 From 9cfd2787b0b37940c656c6ea5fede6b3c360f0e5 Mon Sep 17 00:00:00 2001
2 From: Herbert Xu <herbert@gondor.apana.org.au>
3 Date: Thu, 23 Jul 2020 17:50:48 +1000
4 Subject: [PATCH 060/124] crypto: x86/curve25519 - Remove unused carry
5 variables
6
7 commit 054a5540fb8f7268e2c79e9deab4242db15c8cba upstream.
8
9 The carry variables are assigned but never used, which upsets
10 the compiler. This patch removes them.
11
12 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
13 Reviewed-by: Karthikeyan Bhargavan <karthik.bhargavan@gmail.com>
14 Acked-by: Jason A. Donenfeld <Jason@zx2c4.com>
15 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
17 ---
18 arch/x86/crypto/curve25519-x86_64.c | 6 ++----
19 1 file changed, 2 insertions(+), 4 deletions(-)
20
21 --- a/arch/x86/crypto/curve25519-x86_64.c
22 +++ b/arch/x86/crypto/curve25519-x86_64.c
23 @@ -948,10 +948,8 @@ static void store_felem(u64 *b, u64 *f)
24 {
25 u64 f30 = f[3U];
26 u64 top_bit0 = f30 >> (u32)63U;
27 - u64 carry0;
28 u64 f31;
29 u64 top_bit;
30 - u64 carry;
31 u64 f0;
32 u64 f1;
33 u64 f2;
34 @@ -970,11 +968,11 @@ static void store_felem(u64 *b, u64 *f)
35 u64 o2;
36 u64 o3;
37 f[3U] = f30 & (u64)0x7fffffffffffffffU;
38 - carry0 = add_scalar(f, f, (u64)19U * top_bit0);
39 + add_scalar(f, f, (u64)19U * top_bit0);
40 f31 = f[3U];
41 top_bit = f31 >> (u32)63U;
42 f[3U] = f31 & (u64)0x7fffffffffffffffU;
43 - carry = add_scalar(f, f, (u64)19U * top_bit);
44 + add_scalar(f, f, (u64)19U * top_bit);
45 f0 = f[0U];
46 f1 = f[1U];
47 f2 = f[2U];