Fix curve25519 code for MSVC.

MSVC doesn't like unary minus on unsigned types. Also, the speed test
always failed because the inputs were all zeros and thus had small
order.

Change-Id: Ic2d3c2c9bd57dc66295d93891396871cebac1e0b
diff --git a/crypto/curve25519/curve25519.c b/crypto/curve25519/curve25519.c
index 3e805b8..14c94c8 100644
--- a/crypto/curve25519/curve25519.c
+++ b/crypto/curve25519/curve25519.c
@@ -231,7 +231,7 @@
  *
  * Preconditions: b in {0,1}. */
 static void fe_cswap(fe f, fe g, unsigned int b) {
-  b = -b;
+  b = 0-b;
   unsigned i;
   for (i = 0; i < 10; i++) {
     int32_t x = f[i] ^ g[i];
@@ -807,7 +807,7 @@
  *
  * Preconditions: b in {0,1}. */
 static void fe_cmov(fe f, const fe g, unsigned b) {
-  b = -b;
+  b = 0-b;
   unsigned i;
   for (i = 0; i < 10; i++) {
     int32_t x = f[i] ^ g[i];
diff --git a/tool/speed.cc b/tool/speed.cc
index e9584a1..54f3c75 100644
--- a/tool/speed.cc
+++ b/tool/speed.cc
@@ -456,6 +456,8 @@
         uint8_t out[32], in1[32], in2[32];
         memset(in1, 0, sizeof(in1));
         memset(in2, 0, sizeof(in2));
+        in1[0] = 1;
+        in2[0] = 9;
         return X25519(out, in1, in2) == 1;
       })) {
     fprintf(stderr, "Curve25519 arbitrary point multiplication failed.\n");