This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade to Digest-SHA-5.41
[perl5.git] / ext / Digest / SHA / src / hmac.h
1 /*
2  * hmac.h: header file for HMAC-SHA-1/224/256/384/512 routines
3  *
4  * Ref: FIPS PUB 198 The Keyed-Hash Message Authentication Code
5  *
6  * Copyright (C) 2003-2006 Mark Shelor, All Rights Reserved
7  *
8  * Version: 5.41
9  * Sat Jun  3 01:50:46 MST 2006
10  *
11  */
12
13 #ifndef _INCLUDE_HMAC_H_
14 #define _INCLUDE_HMAC_H_
15
16 #include "sha.h"
17
18 typedef struct {
19         SHA *ksha;
20         SHA *isha;
21         SHA *osha;
22         unsigned char key[SHA_MAX_BLOCK_BITS/8];
23 } HMAC;
24
25 #if defined(__STDC__) && __STDC__ != 0
26         #define _HMAC_P(protos) protos
27 #else
28         #define _HMAC_P(protos) ()
29 #endif
30
31 #define _HMAC_STATE     HMAC *h
32 #define _HMAC_ALG       int alg
33 #define _HMAC_DATA      unsigned char *bitstr, unsigned long bitcnt
34 #define _HMAC_KEY       unsigned char *key, unsigned int keylen
35
36 HMAC            *hmacopen       _HMAC_P((_HMAC_ALG, _HMAC_KEY));
37 unsigned long    hmacwrite      _HMAC_P((_HMAC_DATA, _HMAC_STATE));
38 void             hmacfinish     _HMAC_P((_HMAC_STATE));
39 unsigned char   *hmacdigest     _HMAC_P((_HMAC_STATE));
40 char            *hmachex        _HMAC_P((_HMAC_STATE));
41 char            *hmacbase64     _HMAC_P((_HMAC_STATE));
42 int              hmacclose      _HMAC_P((_HMAC_STATE));
43
44 unsigned char   *hmac1digest    _HMAC_P((_HMAC_DATA, _HMAC_KEY));
45 char            *hmac1hex       _HMAC_P((_HMAC_DATA, _HMAC_KEY));
46 char            *hmac1base64    _HMAC_P((_HMAC_DATA, _HMAC_KEY));
47 unsigned char   *hmac224digest  _HMAC_P((_HMAC_DATA, _HMAC_KEY));
48 char            *hmac224hex     _HMAC_P((_HMAC_DATA, _HMAC_KEY));
49 char            *hmac224base64  _HMAC_P((_HMAC_DATA, _HMAC_KEY));
50 unsigned char   *hmac256digest  _HMAC_P((_HMAC_DATA, _HMAC_KEY));
51 char            *hmac256hex     _HMAC_P((_HMAC_DATA, _HMAC_KEY));
52 char            *hmac256base64  _HMAC_P((_HMAC_DATA, _HMAC_KEY));
53 unsigned char   *hmac384digest  _HMAC_P((_HMAC_DATA, _HMAC_KEY));
54 char            *hmac384hex     _HMAC_P((_HMAC_DATA, _HMAC_KEY));
55 char            *hmac384base64  _HMAC_P((_HMAC_DATA, _HMAC_KEY));
56 unsigned char   *hmac512digest  _HMAC_P((_HMAC_DATA, _HMAC_KEY));
57 char            *hmac512hex     _HMAC_P((_HMAC_DATA, _HMAC_KEY));
58 char            *hmac512base64  _HMAC_P((_HMAC_DATA, _HMAC_KEY));
59
60 #endif  /* _INCLUDE_HMAC_H_ */