~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support HMAC mode for hash functions which need to store more state than
[catacomb]
/
hmac-def.h
diff --git
a/hmac-def.h
b/hmac-def.h
index
a8f2640
..
19df631
100644
(file)
--- a/
hmac-def.h
+++ b/
hmac-def.h
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-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
*
*
* Definitions for HMAC and NMAC
*
@@
-30,6
+30,10
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: hmac-def.h,v $
/*----- 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.
*
* Revision 1.4 2000/07/15 10:00:58 mdw
* New generic hash operation for copying hash contexts.
*
@@
-89,7
+93,7
@@
\
/* --- Useful constants --- */ \
\
\
/* --- Useful constants --- */ \
\
-const octet pre##_mackeysz[] = { KSZ_ANY, PRE##_
HASHSZ };
\
+const octet pre##_mackeysz[] = { KSZ_ANY, PRE##_
STATESZ };
\
\
/* --- @pre_nmacinit@ --- * \
* \
\
/* --- @pre_nmacinit@ --- * \
* \
@@
-104,8
+108,8
@@
const octet pre##_mackeysz[] = { KSZ_ANY, PRE##_HASHSZ }; \
\
void pre##_nmacinit(pre##_mackey *key, const void *ok, const void *ik) \
{ \
\
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; \
} \
\
key->ocount = key->icount = 0; \
} \
\
@@
-169,7
+173,7
@@
void pre##_hmacinit(pre##_mackey *key, const void *k, size_t sz) \
\
void pre##_macinit(pre##_macctx *ctx, const pre##_mackey *key) \
{ \
\
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); \
} \
ctx->count = key->ocount; \
pre##_set(&ctx->ctx, key->ichain, key->icount); \
} \