2 ** Copyright 2001-2005 Double Precision, Inc.
3 ** See COPYING for distribution information.
7 #include "../libhmac/hmac.h"
10 static void alloc_context_sha1( void (*func
)(void *, void *), void *arg
)
12 struct SHA1_CONTEXT c
;
14 (*func
)((void *)&c
, arg
);
17 static void alloc_hash_sha1( void (*func
)(unsigned char *, void *), void *arg
)
19 unsigned char c
[SHA1_DIGEST_SIZE
];
24 struct hmac_hashinfo hmac_sha1
= {
28 sizeof(struct SHA1_CONTEXT
),
29 (void (*)(void *))sha1_context_init
,
30 (void (*)(void *, const void *, unsigned))sha1_context_hashstream
,
31 (void (*)(void *, unsigned long))sha1_context_endstream
,
32 (void (*)(void *, unsigned char *))sha1_context_digest
,
33 (void (*)(void *, const unsigned char *))sha1_context_restore
,
37 static void alloc_context_sha256( void (*func
)(void *, void *), void *arg
)
39 struct SHA256_CONTEXT c
;
41 (*func
)((void *)&c
, arg
);
44 static void alloc_hash_sha256( void (*func
)(unsigned char *, void *), void *arg
)
46 unsigned char c
[SHA256_DIGEST_SIZE
];
51 struct hmac_hashinfo hmac_sha256
= {
55 sizeof(struct SHA256_CONTEXT
),
56 (void (*)(void *))sha256_context_init
,
57 (void (*)(void *, const void *, unsigned))sha256_context_hashstream
,
58 (void (*)(void *, unsigned long))sha256_context_endstream
,
59 (void (*)(void *, unsigned char *))sha256_context_digest
,
60 (void (*)(void *, const unsigned char *))sha256_context_restore
,