This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade to Digest-SHA-5.44.
[perl5.git] / ext / Digest / SHA / src / hmac.h
CommitLineData
05128928
NC
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 *
77d2a621 6 * Copyright (C) 2003-2006 Mark Shelor, All Rights Reserved
05128928 7 *
1bd6a86e
SP
8 * Version: 5.44
9 * Sat Oct 14 00:42:44 MST 2006
05128928
NC
10 *
11 */
12
13#ifndef _INCLUDE_HMAC_H_
14#define _INCLUDE_HMAC_H_
15
16#include "sha.h"
17
18typedef struct {
19 SHA *ksha;
20 SHA *isha;
21 SHA *osha;
22 unsigned char key[SHA_MAX_BLOCK_BITS/8];
23} HMAC;
24
05128928
NC
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
44e8b72c
SP
30HMAC *hmacopen (_HMAC_ALG, _HMAC_KEY);
31unsigned long hmacwrite (_HMAC_DATA, _HMAC_STATE);
32void hmacfinish (_HMAC_STATE);
33unsigned char *hmacdigest (_HMAC_STATE);
34char *hmachex (_HMAC_STATE);
35char *hmacbase64 (_HMAC_STATE);
36int hmacclose (_HMAC_STATE);
37
38#ifndef SHA_PERL_MODULE
39
40unsigned char *hmac1digest (_HMAC_DATA, _HMAC_KEY);
41char *hmac1hex (_HMAC_DATA, _HMAC_KEY);
42char *hmac1base64 (_HMAC_DATA, _HMAC_KEY);
43unsigned char *hmac224digest (_HMAC_DATA, _HMAC_KEY);
44char *hmac224hex (_HMAC_DATA, _HMAC_KEY);
45char *hmac224base64 (_HMAC_DATA, _HMAC_KEY);
46unsigned char *hmac256digest (_HMAC_DATA, _HMAC_KEY);
47char *hmac256hex (_HMAC_DATA, _HMAC_KEY);
48char *hmac256base64 (_HMAC_DATA, _HMAC_KEY);
49unsigned char *hmac384digest (_HMAC_DATA, _HMAC_KEY);
50char *hmac384hex (_HMAC_DATA, _HMAC_KEY);
51char *hmac384base64 (_HMAC_DATA, _HMAC_KEY);
52unsigned char *hmac512digest (_HMAC_DATA, _HMAC_KEY);
53char *hmac512hex (_HMAC_DATA, _HMAC_KEY);
54char *hmac512base64 (_HMAC_DATA, _HMAC_KEY);
55
56#endif
05128928
NC
57
58#endif /* _INCLUDE_HMAC_H_ */