ghash.h: Fix GH_HASHSTR64*.
[u/mdw/catacomb] / gkcdsa.c
index 6d812ff..ed2b37d 100644 (file)
--- a/gkcdsa.c
+++ b/gkcdsa.c
@@ -1,13 +1,13 @@
 /* -*-c-*-
  *
- * $Id: gkcdsa.c,v 1.2 2004/04/08 01:36:15 mdw Exp $
+ * $Id$
  *
  * Generalized version of KCDSA
  *
  * (c) 2004 Straylight/Edgeware
  */
 
-/*----- Licensing notice --------------------------------------------------* 
+/*----- Licensing notice --------------------------------------------------*
  *
  * This file is part of Catacomb.
  *
  * it under the terms of the GNU Library General Public License as
  * published by the Free Software Foundation; either version 2 of the
  * License, or (at your option) any later version.
- * 
+ *
  * Catacomb is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU Library General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU Library General Public
  * License along with Catacomb; if not, write to the Free
  * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
@@ -37,9 +37,9 @@
 
 /*----- Main code ---------------------------------------------------------*/
 
-/* --- @gdsa_beginhash@ --- *
+/* --- @gkcdsa_beginhash@ --- *
  *
- * Arguments:  @const gdsa *c@ = pointer to the context structure
+ * Arguments:  @const gkcdsa *c@ = pointer to the context structure
  *
  * Returns:    A hashing context for you to hash the message.
  *
@@ -68,11 +68,11 @@ ghash *gkcdsa_beginhash(const gkcdsa *c)
  * Returns:    ---
  *
  * Use:                Does any final thing that KCDSA wants to do when hashing a
- *             message.  (Actually, there's nothing.)  The hashing context
+ *             message.  (Actually, there's nothing.)  The hashing context
  *             isn't finalized.
  */
 
-void gkcdsa_endhash(gkcdsa *c, ghash *h) { ; }
+void gkcdsa_endhash(const gkcdsa *c, ghash *h) { ; }
 
 /* --- @hashge@ --- *
  *
@@ -129,7 +129,7 @@ void gkcdsa_sign(const gkcdsa *c, gkcdsa_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);
   if (!s->r) s->r = xmalloc(hsz);
   h = hashge(g, c->h, z); GH_DONE(h, s->r);
@@ -209,7 +209,7 @@ static void showge(group *g, const char *p, ge *x) {
 }
 
 static void showmp(const char *p, mp *x, int r) {
-  fprintf(stderr, "*** %s = ", p); mp_writefile(x, stderr, r); 
+  fprintf(stderr, "*** %s = ", p); mp_writefile(x, stderr, r);
   putc('\n', stderr);
 }