From: Ian Jackson Date: Tue, 25 Apr 2017 12:05:53 +0000 (+0100) Subject: Merge remote-tracking branch 'mdw/mdw/powm-sec' X-Git-Tag: v0.4.1~1 X-Git-Url: https://git.distorted.org.uk/~mdw/secnet/commitdiff_plain/1fc8a4acb3ef658696038c9c4bd3c155fbc27ac3?hp=cb8070409796bbf1187248b05609a61b7f49e6b8 Merge remote-tracking branch 'mdw/mdw/powm-sec' --- diff --git a/Makefile.in b/Makefile.in index 391acf9..406efde 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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 --- 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 --- 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);