2
* Authentication Header declarations
3
* Copyright (C) 2003 Michael Richardson <mcr@sandelman.ottawa.on.ca>
5
* This program is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License as published by the
7
* Free Software Foundation; either version 2 of the License, or (at your
8
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10
* This program is distributed in the hope that it will be useful, but
11
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15
* RCSID $Id: ipsec_auth.h,v 1.1 2003/12/13 19:10:16 mcr Exp $
18
#include "ipsec_md5h.h"
19
#include "ipsec_sha1.h"
24
#define AH_FLENGTH 12 /* size of fixed part */
25
#define AHMD5_KMAX 64 /* MD5 max 512 bits key */
26
#define AHMD5_AMAX 12 /* MD5 96 bits of authenticator */
28
#define AHMD596_KLEN 16 /* MD5 128 bits key */
29
#define AHSHA196_KLEN 20 /* SHA1 160 bits key */
31
#define AHMD596_ALEN 16 /* MD5 128 bits authentication length */
32
#define AHSHA196_ALEN 20 /* SHA1 160 bits authentication length */
34
#define AHMD596_BLKLEN 64 /* MD5 block length */
35
#define AHSHA196_BLKLEN 64 /* SHA1 block length */
37
#define AH_AMAX AHSHA196_ALEN /* keep up to date! */
38
#define AHHMAC_HASHLEN 12 /* authenticator length of 96bits */
39
#define AHHMAC_RPLLEN 4 /* 32 bit replay counter */
41
#define DB_AH_PKTRX 0x0001
42
#define DB_AH_PKTRX2 0x0002
43
#define DB_AH_DMP 0x0004
44
#define DB_AH_IPSA 0x0010
45
#define DB_AH_XF 0x0020
46
#define DB_AH_INAU 0x0040
47
#define DB_AH_REPLAY 0x0100
51
/* General HMAC algorithm is described in RFC 2104 */
53
#define HMAC_IPAD 0x36
54
#define HMAC_OPAD 0x5C
57
MD5_CTX ictx; /* context after H(K XOR ipad) */
58
MD5_CTX octx; /* context after H(K XOR opad) */
62
SHA1_CTX ictx; /* context after H(K XOR ipad) */
63
SHA1_CTX octx; /* context after H(K XOR opad) */
67
void (*init)(void *ctx);
68
void (*update)(void *ctx, unsigned char *bytes, __u32 len);
69
void (*final)(unsigned char *hash, void *ctx);
75
#endif /* __KERNEL__ */
76
#endif /* IPSEC_AUTH_H */
79
* $Log: ipsec_auth.h,v $
80
* Revision 1.1 2003/12/13 19:10:16 mcr
81
* refactored rcv and xmit code - same as FS 2.05.
83
* Revision 1.1 2003/12/06 21:21:19 mcr
84
* split up receive path into per-transform files, for
85
* easier later removal.