]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
Crypto: Curve25519: Add explicit cast to supress conversion warning.
authorJeroen Leenarts <jeroen.leenarts@gmail.com>
Wed, 26 Sep 2018 09:22:15 +0000 (11:22 +0200)
committerRoopesh Chander <roop@roopc.net>
Sat, 27 Oct 2018 09:43:01 +0000 (15:13 +0530)
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
WireGuard/WireGuard/Crypto/x25519.c

index b198ae046c9ee385436a262a40cb752871c9adf4..bc94933cc574fae65eb18e85120dbe8aeddd1b1c 100644 (file)
@@ -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);