/* -*-c-*-
*
- * $Id: gmac.h,v 1.2 2000/06/17 11:22:46 mdw Exp $
+ * $Id: gmac.h,v 1.4 2004/04/08 01:36:15 mdw Exp $
*
* Generic MAC function interface
*
* (c) 1999 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,
* MA 02111-1307, USA.
*/
-/*----- Revision history --------------------------------------------------*
- *
- * $Log: gmac.h,v $
- * Revision 1.2 2000/06/17 11:22:46 mdw
- * Minor changes in the generic hash and MAC interfaces.
- *
- * Revision 1.1 1999/12/10 23:16:01 mdw
- * Generic interface.
- *
- */
-
#ifndef CATACOMB_GMAC_H
#define CATACOMB_GMAC_H
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