chiark / gitweb /
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 391acf9a9e6b62eb08b9a9aa4e2f5c696f623861..406efdef4ba2fc11d87a99ae118580576c001427 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 4300a912378b764a85e8fc3581d869008cbcc065..0616a43e4007dc330137431cbf8908b34823861c 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 51a382eaec66ae177064beca8e66f014692ab8c4..068cf41dfc13dfb94a35ec1656799ce0cdbd96c4 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);