]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - sshecdsag.c
Support ECDH key exchange using the 'curve25519' curve.
[PuTTY.git] / sshecdsag.c
index 049967d6acb5972576b6c46ee4c63902a943ad49..4bd9e8f74a394bc1e0fd02094d6d9bdae4d3b854 100644 (file)
@@ -22,10 +22,10 @@ int ec_generate(struct ec_key *key, int bits, progfn_t pfn,
         return 0;
     }
 
-    key->privateKey = bignum_random_in_range(One, key->publicKey.curve->n);
+    key->privateKey = bignum_random_in_range(One, key->publicKey.curve->w.n);
     if (!key->privateKey) return 0;
 
-    publicKey = ecp_mul(&key->publicKey.curve->G, key->privateKey);
+    publicKey = ec_public(key->privateKey, key->publicKey.curve);
     if (!publicKey) {
         freebn(key->privateKey);
         key->privateKey = NULL;