This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update Digest-SHA to CPAN version 5.73
[perl5.git] / cpan / 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-2012 Mark Shelor, All Rights Reserved
7  *
8  * Version: 5.73
9  * Wed Oct 31 04:32:44 MST 2012
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 #define _HMAC_STATE     HMAC *h
26 #define _HMAC_ALG       int alg
27 #define _HMAC_DATA      unsigned char *bitstr, unsigned long bitcnt
28 #define _HMAC_KEY       unsigned char *key, unsigned int keylen
29
30 HMAC            *hmacopen       (_HMAC_ALG, _HMAC_KEY);
31 unsigned long    hmacwrite      (_HMAC_DATA, _HMAC_STATE);
32 void             hmacfinish     (_HMAC_STATE);
33 unsigned char   *hmacdigest     (_HMAC_STATE);
34 char            *hmachex        (_HMAC_STATE);
35 char            *hmacbase64     (_HMAC_STATE);
36 int              hmacclose      (_HMAC_STATE);
37
38 #ifndef SHA_PERL_MODULE
39
40 unsigned char   *hmac1digest            (_HMAC_DATA, _HMAC_KEY);
41 char            *hmac1hex               (_HMAC_DATA, _HMAC_KEY);
42 char            *hmac1base64            (_HMAC_DATA, _HMAC_KEY);
43 unsigned char   *hmac224digest          (_HMAC_DATA, _HMAC_KEY);
44 char            *hmac224hex             (_HMAC_DATA, _HMAC_KEY);
45 char            *hmac224base64          (_HMAC_DATA, _HMAC_KEY);
46 unsigned char   *hmac256digest          (_HMAC_DATA, _HMAC_KEY);
47 char            *hmac256hex             (_HMAC_DATA, _HMAC_KEY);
48 char            *hmac256base64          (_HMAC_DATA, _HMAC_KEY);
49 unsigned char   *hmac384digest          (_HMAC_DATA, _HMAC_KEY);
50 char            *hmac384hex             (_HMAC_DATA, _HMAC_KEY);
51 char            *hmac384base64          (_HMAC_DATA, _HMAC_KEY);
52 unsigned char   *hmac512digest          (_HMAC_DATA, _HMAC_KEY);
53 char            *hmac512hex             (_HMAC_DATA, _HMAC_KEY);
54 char            *hmac512base64          (_HMAC_DATA, _HMAC_KEY);
55 unsigned char   *hmac512224digest       (_HMAC_DATA, _HMAC_KEY);
56 char            *hmac512224hex          (_HMAC_DATA, _HMAC_KEY);
57 char            *hmac512224base64       (_HMAC_DATA, _HMAC_KEY);
58 unsigned char   *hmac512256digest       (_HMAC_DATA, _HMAC_KEY);
59 char            *hmac512256hex          (_HMAC_DATA, _HMAC_KEY);
60 char            *hmac512256base64       (_HMAC_DATA, _HMAC_KEY);
61
62 #endif
63
64 #endif  /* _INCLUDE_HMAC_H_ */