aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/Crypto
diff options
context:
space:
mode:
authorJeroen Leenarts <jeroen.leenarts@gmail.com>2018-09-26 11:22:15 +0200
committerRoopesh Chander <roop@roopc.net>2018-10-27 15:13:01 +0530
commit5bfb6a2c139db06366acfdc5cabe07f13f276249 (patch)
tree4e4392cffe3953749c745a6958fc3d60d99276c3 /WireGuard/WireGuard/Crypto
parentCrypto: Add Curve25519 C code to project (diff)
downloadwireguard-apple-5bfb6a2c139db06366acfdc5cabe07f13f276249.tar.xz
wireguard-apple-5bfb6a2c139db06366acfdc5cabe07f13f276249.zip
Crypto: Curve25519: Add explicit cast to supress conversion warning.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'WireGuard/WireGuard/Crypto')
-rw-r--r--WireGuard/WireGuard/Crypto/x25519.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/WireGuard/WireGuard/Crypto/x25519.c b/WireGuard/WireGuard/Crypto/x25519.c
index b198ae04..bc94933c 100644
--- a/WireGuard/WireGuard/Crypto/x25519.c
+++ b/WireGuard/WireGuard/Crypto/x25519.c
@@ -134,8 +134,8 @@ static void curve25519_shared_secret(uint8_t shared_secret[32], const uint8_t pr
for (i = 254; i >= 0; --i) {
r = (z[i >> 3] >> (i & 7)) & 1;
- cswap(a, b, r);
- cswap(c, d, r);
+ cswap(a, b, (int)r);
+ cswap(c, d, (int)r);
add(e, a, c);
subtract(a, a, c);
add(c, b, d);
@@ -154,8 +154,8 @@ static void curve25519_shared_secret(uint8_t shared_secret[32], const uint8_t pr
multmod(a, d, f);
multmod(d, b, x);
multmod(b, e, e);
- cswap(a, b, r);
- cswap(c, d, r);
+ cswap(a, b, (int)r);
+ cswap(c, d, (int)r);
}
invert(c, c);
multmod(a, a, c);