Make tables of standard encryption schemes etc.
[u/mdw/catacomb] / gmac.h
diff --git a/gmac.h b/gmac.h
index 1a89be9..cf134ac 100644 (file)
--- a/gmac.h
+++ b/gmac.h
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: gmac.h,v 1.2 2000/06/17 11:22:46 mdw Exp $
+ * $Id: gmac.h,v 1.3 2004/04/04 19:42:30 mdw Exp $
  *
  * Generic MAC function interface
  *
@@ -30,6 +30,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: gmac.h,v $
+ * Revision 1.3  2004/04/04 19:42:30  mdw
+ * Make tables of standard encryption schemes etc.
+ *
  * Revision 1.2  2000/06/17 11:22:46  mdw
  * Minor changes in the generic hash and MAC interfaces.
  *
@@ -76,6 +79,24 @@ typedef struct gcmac {
   gmac *(*key)(const void */*k*/, size_t /*sz*/); /* Create key */
 } gcmac;
 
+#define GM_KEY(cm, k, ksz)     (cm)->key((k), (ksz))
+#define GM_CLASS(km)           (km)->ops->c
+#define GM_INIT(km)            (km)->ops->init((km))
+#define GM_DESTROY(km)         (km)->ops->destroy((km))
+
+/*----- Tables ------------------------------------------------------------*/
+
+extern const gcmac *const gmactab[];
+
+/* --- @gmac_byname@ --- *
+ *
+ * Arguments:  @const char *p@ = pointer to name string
+ *
+ * Returns:    The named cipher class, or null.
+ */
+
+extern const gcmac *gmac_byname(const char */*p*/);
+
 /*----- That's all, folks -------------------------------------------------*/
 
 #ifdef __cplusplus