Add CRC as another hash function.
[u/mdw/catacomb] / rspit.c
diff --git a/rspit.c b/rspit.c
index b9c8e72..f4083f6 100644 (file)
--- a/rspit.c
+++ b/rspit.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: rspit.c,v 1.13 2000/12/06 20:33:27 mdw Exp $
+ * $Id: rspit.c,v 1.15 2001/04/19 18:26:13 mdw Exp $
  *
  * Spit out random numbers
  *
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: rspit.c,v $
+ * Revision 1.15  2001/04/19 18:26:13  mdw
+ * Use the new MAC keysize names.
+ *
+ * Revision 1.14  2001/02/21 20:03:22  mdw
+ * Added support for MD2 hash function.
+ *
  * Revision 1.13  2000/12/06 20:33:27  mdw
  * Make flags be macros rather than enumerations, to ensure that they're
  * unsigned.
 #include "square-counter.h"
 #include "serpent-counter.h"
 
+#include "md2-mgf.h"
 #include "md4-mgf.h"
 #include "md5-mgf.h"
 #include "sha-mgf.h"
@@ -190,6 +197,7 @@ extern gen generators[];
   E(SERPENT, serpent)
 
 #define HASHES                                                         \
+  E(MD2, md2)                                                          \
   E(MD4, md4)                                                          \
   E(MD5, md5)                                                          \
   E(SHA, sha)                                                          \
@@ -722,7 +730,7 @@ static grand *gen_rand(unsigned i)
     switch (o) {
       case 'k':
        DRESET(&d);
-       textkey(&d, optarg, rmd160_mackeysz);
+       textkey(&d, optarg, rmd160_hmackeysz);
        r->ops->misc(r, RAND_KEY, d.buf, d.len);
        break;
       case 't':
@@ -730,7 +738,7 @@ static grand *gen_rand(unsigned i)
        break;
       case 'H':
        DRESET(&d);
-       hexkey(&d, optarg, rmd160_mackeysz);
+       hexkey(&d, optarg, rmd160_hmackeysz);
        r->ops->misc(r, GRAND_SEEDBLOCK, d.buf, d.len);
        break;
     }