Merge remote-tracking branch 'mdw/mdw/powm-sec'
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 25 Apr 2017 12:05:53 +0000 (13:05 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 25 Apr 2017 12:05:53 +0000 (13:05 +0100)
Makefile.in
dh.c
rsa.c

index 391acf9..406efde 100644 (file)
@@ -166,7 +166,7 @@ eax-%-test.confirm: eax-%-test eax-%-test.vectors
 
 check-ipaddrset: ipaddrset-test.py ipaddrset.py ipaddrset-test.expected
        $(srcdir)/ipaddrset-test.py >ipaddrset-test.new
-       diff -u ipaddrset-test.expected ipaddrset-test.new
+       diff -u $(srcdir)/ipaddrset-test.expected ipaddrset-test.new
 
 .PRECIOUS: eax-%-test
 
diff --git a/dh.c b/dh.c
index 4300a91..0616a43 100644 (file)
--- a/dh.c
+++ b/dh.c
@@ -52,7 +52,7 @@ static string_t dh_makepublic(void *sst, uint8_t *secret, int32_t secretlen)
 
     read_mpbin(&a, secret, secretlen);
 
-    mpz_powm(&b, &st->g, &a, &st->p);
+    mpz_powm_sec(&b, &st->g, &a, &st->p);
 
     r=write_mpstring(&b);
 
@@ -76,7 +76,7 @@ static void dh_makeshared(void *sst, uint8_t *secret, int32_t secretlen,
     read_mpbin(&a, secret, secretlen);
     mpz_set_str(&b, rempublic, 16);
 
-    mpz_powm(&c, &b, &a, &st->p);
+    mpz_powm_sec(&c, &b, &a, &st->p);
 
     write_mpbin(&c,sharedsecret,buflen);
 
diff --git a/rsa.c b/rsa.c
index 51a382e..068cf41 100644 (file)
--- a/rsa.c
+++ b/rsa.c
@@ -148,8 +148,8 @@ static string_t rsa_sign(void *sst, uint8_t *data, int32_t datalen)
     mpz_init(&u);
     mpz_init(&v);
 
-    mpz_powm(&u, &a, &st->dp, &st->p);
-    mpz_powm(&v, &a, &st->dq, &st->q);
+    mpz_powm_sec(&u, &a, &st->dp, &st->p);
+    mpz_powm_sec(&v, &a, &st->dq, &st->q);
     mpz_sub(&tmp, &u, &v);
     mpz_mul(&tmp2, &tmp, &st->w);
     mpz_add(&tmp, &tmp2, &v);