catcrypt: Implement symmetric key-encapsulation and signature schemes.
[u/mdw/catacomb] / dsa-verify.c
index a39c11b..dbab2df 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: dsa-verify.c,v 1.6 2001/06/16 12:56:38 mdw Exp $
+ * $Id: dsa-verify.c,v 1.7 2004/04/08 01:36:15 mdw Exp $
  *
  * DSA signature verification
  *
  * MA 02111-1307, USA.
  */
 
-/*----- Revision history --------------------------------------------------* 
- *
- * $Log: dsa-verify.c,v $
- * Revision 1.6  2001/06/16 12:56:38  mdw
- * Fixes for interface change to @mpmont_expr@ and @mpmont_mexpr@.
- *
- * Revision 1.5  2000/10/08 12:13:17  mdw
- * Use @MP_EQ@ instead of @MP_CMP@.
- *
- * Revision 1.4  2000/06/17 10:53:35  mdw
- * Typesetting fixes.
- *
- * Revision 1.3  1999/12/10 23:18:38  mdw
- * Change interface for suggested destinations.
- *
- * Revision 1.2  1999/11/23 00:20:04  mdw
- * Remove stray debugging code.
- *
- * Revision 1.1  1999/11/19 19:28:00  mdw
- * Implementation of the Digital Signature Algorithm.
- *
- */
-
 /*----- Header files ------------------------------------------------------*/
 
 #include "dsa.h"
@@ -92,8 +69,7 @@ int dsa_vrfy(const dsa_param *dp, mp *y, mp *m, mp *r, mp *s)
   /* --- Compute %$w = s^{-1} \bmod q$% --- */
 
   {
-    mp *z = MP_NEW;
-    mp_gcd(0, 0, &z, dp->q, s);
+    mp *z = mp_modinv(MP_NEW, s, dp->q);
     w = mpmont_mul(&qm, MP_NEW, z, qm.r2);
     mp_drop(z);
   }