projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix memory leaks.
[u/mdw/catacomb]
/
hmac.h
diff --git
a/hmac.h
b/hmac.h
index
d64003f
..
b489e54
100644
(file)
--- a/
hmac.h
+++ b/
hmac.h
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: hmac.h,v 1.
2 1999/12/10 23:17:39
mdw Exp $
+ * $Id: hmac.h,v 1.
4 2000/10/15 19:09:20
mdw Exp $
*
* Generic code for HMAC and NMAC
*
*
* Generic code for HMAC and NMAC
*
@@
-30,6
+30,13
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: hmac.h,v $
/*----- 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.
+ *
* Revision 1.2 1999/12/10 23:17:39 mdw
* Split mode macros into interface and implementation.
*
* Revision 1.2 1999/12/10 23:17:39 mdw
* Split mode macros into interface and implementation.
*
@@
-81,9
+88,9
@@
/* --- An HMAC or NMAC key --- */ \
\
typedef struct pre##_mackey { \
/* --- 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 */ \
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; \
\
unsigned icount; /* Byte count for inner hash */ \
} pre##_mackey; \
\
@@
-91,10
+98,14
@@
typedef struct pre##_mackey { \
\
typedef struct pre##_macctx { \
pre##_ctx ctx; /* Context for main hashing */ \
\
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; \
\
unsigned count; /* Byte count for outer hash */ \
} pre##_macctx; \
\
+/* --- Other useful constants --- */ \
+ \
+extern const octet pre##_mackeysz[]; \
+ \
/* --- @pre_nmacinit@ --- * \
* \
* Arguments: @pre_macctx *key@ = pointer to a MAC key object \
/* --- @pre_nmacinit@ --- * \
* \
* Arguments: @pre_macctx *key@ = pointer to a MAC key object \