the hash output size.
/* -*-c-*-
*
- * $Id: hmac-def.h,v 1.4 2000/07/15 10:00:58 mdw Exp $
+ * $Id: hmac-def.h,v 1.5 2000/10/15 19:09:20 mdw Exp $
*
* Definitions for HMAC and NMAC
*
/*----- Revision history --------------------------------------------------*
*
* $Log: hmac-def.h,v $
+ * Revision 1.5 2000/10/15 19:09:20 mdw
+ * Support HMAC mode for hash functions which need to store more state than
+ * the hash output size.
+ *
* Revision 1.4 2000/07/15 10:00:58 mdw
* New generic hash operation for copying hash contexts.
*
\
/* --- Useful constants --- */ \
\
-const octet pre##_mackeysz[] = { KSZ_ANY, PRE##_HASHSZ }; \
+const octet pre##_mackeysz[] = { KSZ_ANY, PRE##_STATESZ }; \
\
/* --- @pre_nmacinit@ --- * \
* \
\
void pre##_nmacinit(pre##_mackey *key, const void *ok, const void *ik) \
{ \
- memcpy(key->ochain, ok, PRE##_HASHSZ); \
- memcpy(key->ichain, ik, PRE##_HASHSZ); \
+ memcpy(key->ochain, ok, PRE##_STATESZ); \
+ memcpy(key->ichain, ik, PRE##_STATESZ); \
key->ocount = key->icount = 0; \
} \
\
\
void pre##_macinit(pre##_macctx *ctx, const pre##_mackey *key) \
{ \
- memcpy(ctx->chain, key->ochain, PRE##_HASHSZ); \
+ memcpy(ctx->chain, key->ochain, PRE##_STATESZ); \
ctx->count = key->ocount; \
pre##_set(&ctx->ctx, key->ichain, key->icount); \
} \
/* -*-c-*-
*
- * $Id: hmac.h,v 1.3 2000/06/17 11:23:57 mdw Exp $
+ * $Id: hmac.h,v 1.4 2000/10/15 19:09:20 mdw Exp $
*
* Generic code for HMAC and NMAC
*
/*----- Revision history --------------------------------------------------*
*
* $Log: hmac.h,v $
+ * Revision 1.4 2000/10/15 19:09:20 mdw
+ * Support HMAC mode for hash functions which need to store more state than
+ * the hash output size.
+ *
* Revision 1.3 2000/06/17 11:23:57 mdw
* New key size interface.
*
/* --- An HMAC or NMAC key --- */ \
\
typedef struct pre##_mackey { \
- octet ochain[PRE##_HASHSZ]; /* Chaining for outer hash */ \
+ octet ochain[PRE##_STATESZ]; /* Chaining for outer hash */ \
unsigned ocount; /* Byte count for outer hash */ \
- octet ichain[PRE##_HASHSZ]; /* Chaining for inner hash */ \
+ octet ichain[PRE##_STATESZ]; /* Chaining for inner hash */ \
unsigned icount; /* Byte count for inner hash */ \
} pre##_mackey; \
\
\
typedef struct pre##_macctx { \
pre##_ctx ctx; /* Context for main hashing */ \
- octet chain[PRE##_HASHSZ]; /* Chaining for outer hash */ \
+ octet chain[PRE##_STATESZ]; /* Chaining for outer hash */ \
unsigned count; /* Byte count for outer hash */ \
} pre##_macctx; \
\
/* -*-c-*-
*
- * $Id: md4.h,v 1.3 2000/06/17 11:32:52 mdw Exp $
+ * $Id: md4.h,v 1.4 2000/10/15 19:09:20 mdw Exp $
*
* The MD4 message digest function
*
/*----- Revision history --------------------------------------------------*
*
* $Log: md4.h,v $
+ * Revision 1.4 2000/10/15 19:09:20 mdw
+ * Support HMAC mode for hash functions which need to store more state than
+ * the hash output size.
+ *
* Revision 1.3 2000/06/17 11:32:52 mdw
* Change buffer offset to be unsigned.
*
#define MD4_BUFSZ 64
#define MD4_HASHSZ 16
+#define MD4_STATESZ 16
/*----- Data structures ---------------------------------------------------*/
/* -*-c-*-
*
- * $Id: md5.h,v 1.3 2000/06/17 11:32:52 mdw Exp $
+ * $Id: md5.h,v 1.4 2000/10/15 19:09:20 mdw Exp $
*
* The MD5 message digest function
*
/*----- Revision history --------------------------------------------------*
*
* $Log: md5.h,v $
+ * Revision 1.4 2000/10/15 19:09:20 mdw
+ * Support HMAC mode for hash functions which need to store more state than
+ * the hash output size.
+ *
* Revision 1.3 2000/06/17 11:32:52 mdw
* Change buffer offset to be unsigned.
*
#define MD5_BUFSZ 64
#define MD5_HASHSZ 16
+#define MD5_STATESZ 16
/*----- Data structures ---------------------------------------------------*/
/* -*-c-*-
*
- * $Id: rmd128.h,v 1.1 2000/07/09 21:30:31 mdw Exp $
+ * $Id: rmd128.h,v 1.2 2000/10/15 19:09:20 mdw Exp $
*
* The RIPEMD-128 message digest function
*
/*----- Revision history --------------------------------------------------*
*
* $Log: rmd128.h,v $
+ * Revision 1.2 2000/10/15 19:09:20 mdw
+ * Support HMAC mode for hash functions which need to store more state than
+ * the hash output size.
+ *
* Revision 1.1 2000/07/09 21:30:31 mdw
* New RIPEMD variants.
*
#define RMD128_BUFSZ 64
#define RMD128_HASHSZ 16
+#define RMD128_STATESZ 16
/*----- Data structures ---------------------------------------------------*/
/* -*-c-*-
*
- * $Id: rmd160.h,v 1.3 2000/06/17 11:32:52 mdw Exp $
+ * $Id: rmd160.h,v 1.4 2000/10/15 19:09:20 mdw Exp $
*
* The RIPEMD-160 message digest function
*
/*----- Revision history --------------------------------------------------*
*
* $Log: rmd160.h,v $
+ * Revision 1.4 2000/10/15 19:09:20 mdw
+ * Support HMAC mode for hash functions which need to store more state than
+ * the hash output size.
+ *
* Revision 1.3 2000/06/17 11:32:52 mdw
* Change buffer offset to be unsigned.
*
#define RMD160_BUFSZ 64
#define RMD160_HASHSZ 20
+#define RMD160_STATESZ 20
/*----- Data structures ---------------------------------------------------*/
/* -*-c-*-
*
- * $Id: rmd256.h,v 1.1 2000/07/09 21:30:31 mdw Exp $
+ * $Id: rmd256.h,v 1.2 2000/10/15 19:09:20 mdw Exp $
*
* The RIPEMD-256 message digest function
*
/*----- Revision history --------------------------------------------------*
*
* $Log: rmd256.h,v $
+ * Revision 1.2 2000/10/15 19:09:20 mdw
+ * Support HMAC mode for hash functions which need to store more state than
+ * the hash output size.
+ *
* Revision 1.1 2000/07/09 21:30:31 mdw
* New RIPEMD variants.
*
#define RMD256_BUFSZ 64
#define RMD256_HASHSZ 32
+#define RMD256_STATESZ 32
/*----- Data structures ---------------------------------------------------*/
/* -*-c-*-
*
- * $Id: rmd320.h,v 1.1 2000/07/09 21:30:31 mdw Exp $
+ * $Id: rmd320.h,v 1.2 2000/10/15 19:09:20 mdw Exp $
*
* The RIPEMD-320 message digest function
*
/*----- Revision history --------------------------------------------------*
*
* $Log: rmd320.h,v $
+ * Revision 1.2 2000/10/15 19:09:20 mdw
+ * Support HMAC mode for hash functions which need to store more state than
+ * the hash output size.
+ *
* Revision 1.1 2000/07/09 21:30:31 mdw
* New RIPEMD variants.
*
#define RMD320_BUFSZ 64
#define RMD320_HASHSZ 40
+#define RMD320_STATESZ 40
/*----- Data structures ---------------------------------------------------*/
/* -*-c-*-
*
- * $Id: sha.h,v 1.4 2000/06/17 11:32:52 mdw Exp $
+ * $Id: sha.h,v 1.5 2000/10/15 19:09:20 mdw Exp $
*
* Implementation of the SHA-1 hash function
*
/*----- Revision history --------------------------------------------------*
*
* $Log: sha.h,v $
+ * Revision 1.5 2000/10/15 19:09:20 mdw
+ * Support HMAC mode for hash functions which need to store more state than
+ * the hash output size.
+ *
* Revision 1.4 2000/06/17 11:32:52 mdw
* Change buffer offset to be unsigned.
*
#define SHA_BUFSZ 64
#define SHA_HASHSZ 20
+#define SHA_STATESZ 20
/*----- Data structures ---------------------------------------------------*/
/* -*-c-*-
*
- * $Id: sha256.h,v 1.1 2000/10/15 17:48:15 mdw Exp $
+ * $Id: sha256.h,v 1.2 2000/10/15 19:09:20 mdw Exp $
*
* Implementation of the SHA-256 hash function
*
/*----- Revision history --------------------------------------------------*
*
* $Log: sha256.h,v $
+ * Revision 1.2 2000/10/15 19:09:20 mdw
+ * Support HMAC mode for hash functions which need to store more state than
+ * the hash output size.
+ *
* Revision 1.1 2000/10/15 17:48:15 mdw
* New SHA variants with longer outputs.
*
#define SHA256_BUFSZ 64
#define SHA256_HASHSZ 32
+#define SHA256_STATESZ 32
/*----- Data structures ---------------------------------------------------*/
/* -*-c-*-
*
- * $Id: sha512.h,v 1.1 2000/10/15 17:48:15 mdw Exp $
+ * $Id: sha512.h,v 1.2 2000/10/15 19:09:20 mdw Exp $
*
* Implementation of the SHA-512 hash function
*
/*----- Revision history --------------------------------------------------*
*
* $Log: sha512.h,v $
+ * Revision 1.2 2000/10/15 19:09:20 mdw
+ * Support HMAC mode for hash functions which need to store more state than
+ * the hash output size.
+ *
* Revision 1.1 2000/10/15 17:48:15 mdw
* New SHA variants with longer outputs.
*
#define SHA512_BUFSZ 128
#define SHA512_HASHSZ 64
+#define SHA512_STATESZ 64
#define SHA384_BUFSZ 128
#define SHA384_HASHSZ 48
+#define SHA384_STATESZ 64
/*----- Data structures ---------------------------------------------------*/
/* -*-c-*-
*
- * $Id: tiger.h,v 1.1 2000/07/15 10:02:43 mdw Exp $
+ * $Id: tiger.h,v 1.2 2000/10/15 19:09:20 mdw Exp $
*
* The Tiger hash function
*
/*----- Revision history --------------------------------------------------*
*
* $Log: tiger.h,v $
+ * Revision 1.2 2000/10/15 19:09:20 mdw
+ * Support HMAC mode for hash functions which need to store more state than
+ * the hash output size.
+ *
* Revision 1.1 2000/07/15 10:02:43 mdw
* Anderson and Biham's Tiger hash function added.
*
#define TIGER_BUFSZ 64
#define TIGER_HASHSZ 24
+#define TIGER_STATESZ 24
/*----- Data structures ---------------------------------------------------*/