X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/b817bfc642225b8c3c0b6a7e42d1fb949b61a606..02dfbd5b7af7816959dbd39c1fe628451204e35f:/gdsa.c diff --git a/gdsa.c b/gdsa.c index 9b23f4f..f60fb2d 100644 --- a/gdsa.c +++ b/gdsa.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: gdsa.c,v 1.2 2004/04/08 01:36:15 mdw Exp $ + * $Id$ * * Generalized version of DSA * @@ -61,7 +61,7 @@ ghash *gdsa_beginhash(const gdsa *c) { return (GH_INIT(c->h)); } * isn't finalized. */ -void gdsa_endhash(gdsa *c, ghash *h) { ; } +void gdsa_endhash(const gdsa *c, ghash *h) { ; } /* --- @gdsa_sign@ --- * * @@ -88,10 +88,10 @@ void gdsa_sign(const gdsa *c, gdsa_sig *s, const void *m, mp *k) new_k: k = mprand_range(k, g->r, c->r, 0); have_k: - if (MP_ISZERO(k)) goto new_k; + if (MP_ZEROP(k)) goto new_k; G_EXP(g, z, g->g, k); sr = G_TOINT(g, sr, z); assert(sr); - if (MP_ISZERO(sr)) goto new_k; + if (MP_ZEROP(sr)) goto new_k; mp_div(0, &sr, sr, g->r); mpbarrett_create(&b, g->r);