Expunge revision histories in files.
[u/mdw/catacomb] / rsa-gen.c
index e3f5fda..951ab9f 100644 (file)
--- a/rsa-gen.c
+++ b/rsa-gen.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: rsa-gen.c,v 1.4 2000/10/08 12:11:22 mdw Exp $
+ * $Id: rsa-gen.c,v 1.5 2004/04/08 01:36:15 mdw Exp $
  *
  * RSA parameter generation
  *
  * MA 02111-1307, USA.
  */
 
-/*----- Revision history --------------------------------------------------* 
- *
- * $Log: rsa-gen.c,v $
- * Revision 1.4  2000/10/08 12:11:22  mdw
- * Use @MP_EQ@ instead of @MP_CMP@.
- *
- * Revision 1.3  2000/07/01 11:22:22  mdw
- * Remove bad type name `rsa_param'.
- *
- * Revision 1.2  2000/06/17 12:05:15  mdw
- * Lots of changes:
- *
- *   * Apply limits on %$\gcd(p - 1, q - 1)$% to reduce the space of
- *     equivalent decryption exponents.
- *
- *   * Force %$e = F_4 = 2^{16} + 1$% to avoid small-encryption-exponent
- *     attacks.
- *
- *   * Ensure that %$p > q$% and that %$p - q$% is large to deter
- *     square-root-based factoring methods.
- *
- *   * Use %$e d \equiv 1 \pmod{\lambda(n)}$%, where %$\lambda(n)$% is
- *     %$\lcm(p - 1, q - 1)$%, as recommended in PKCS#1, rather than the
- *     more usual %$\varphi(n) = (p - 1)(q - 1)$%.
- *
- *   * Handle aborts from pgen_jump.
- *
- * Revision 1.1  1999/12/22 15:50:45  mdw
- * Initial RSA support.
- *
- */
-
 /*----- Header files ------------------------------------------------------*/
 
 #include <mLib/dstr.h>
@@ -163,7 +131,7 @@ again:
   /* --- Work out the modulus and the CRT coefficient --- */
 
   rp->n = mp_mul(MP_NEW, rp->p, rp->q);
-  rp->q_inv = MP_NEW; mp_gcd(0, 0, &rp->q_inv, rp->p, rp->q);
+  rp->q_inv = mp_modinv(MP_NEW, rp->q, rp->p);
 
   /* --- Work out %$\varphi(n) = (p - 1)(q - 1)$% --- *
    *