1104476Ssam/*	$FreeBSD$	*/
2104476Ssam/*	$OpenBSD: cryptosoft.h,v 1.10 2002/04/22 23:10:09 deraadt Exp $	*/
3104476Ssam
4139825Simp/*-
5104476Ssam * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
6104476Ssam *
7104476Ssam * This code was written by Angelos D. Keromytis in Athens, Greece, in
8104476Ssam * February 2000. Network Security Technologies Inc. (NSTI) kindly
9104476Ssam * supported the development of this code.
10104476Ssam *
11104476Ssam * Copyright (c) 2000 Angelos D. Keromytis
12104476Ssam *
13104476Ssam * Permission to use, copy, and modify this software with or without fee
14104476Ssam * is hereby granted, provided that this entire notice is included in
15104476Ssam * all source code copies of any software which is or includes a copy or
16104476Ssam * modification of this software.
17104476Ssam *
18104476Ssam * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
19104476Ssam * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY
20104476Ssam * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
21104476Ssam * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
22104476Ssam * PURPOSE.
23104476Ssam */
24104476Ssam
25104476Ssam#ifndef _CRYPTO_CRYPTOSOFT_H_
26104476Ssam#define _CRYPTO_CRYPTOSOFT_H_
27104476Ssam
28104476Ssam/* Software session entry */
29104476Ssamstruct swcr_data {
30104476Ssam	int		sw_alg;		/* Algorithm */
31104476Ssam	union {
32104476Ssam		struct {
33104476Ssam			u_int8_t	 *SW_ictx;
34104476Ssam			u_int8_t	 *SW_octx;
35158703Spjd			u_int16_t	 SW_klen;
36158703Spjd			u_int16_t	 SW_mlen;
37104476Ssam			struct auth_hash *SW_axf;
38104476Ssam		} SWCR_AUTH;
39104476Ssam		struct {
40104476Ssam			u_int8_t	 *SW_kschedule;
41104476Ssam			struct enc_xform *SW_exf;
42104476Ssam		} SWCR_ENC;
43104476Ssam		struct {
44104476Ssam			u_int32_t	 SW_size;
45104476Ssam			struct comp_algo *SW_cxf;
46104476Ssam		} SWCR_COMP;
47104476Ssam	} SWCR_UN;
48104476Ssam
49104476Ssam#define sw_ictx		SWCR_UN.SWCR_AUTH.SW_ictx
50104476Ssam#define sw_octx		SWCR_UN.SWCR_AUTH.SW_octx
51104476Ssam#define sw_klen		SWCR_UN.SWCR_AUTH.SW_klen
52158703Spjd#define sw_mlen		SWCR_UN.SWCR_AUTH.SW_mlen
53104476Ssam#define sw_axf		SWCR_UN.SWCR_AUTH.SW_axf
54104476Ssam#define sw_kschedule	SWCR_UN.SWCR_ENC.SW_kschedule
55104476Ssam#define sw_exf		SWCR_UN.SWCR_ENC.SW_exf
56104476Ssam#define sw_size		SWCR_UN.SWCR_COMP.SW_size
57104476Ssam#define sw_cxf		SWCR_UN.SWCR_COMP.SW_cxf
58104476Ssam
59104476Ssam	struct swcr_data *sw_next;
60104476Ssam};
61104476Ssam
62104476Ssam#ifdef _KERNEL
63167755Ssamextern u_int8_t hmac_ipad_buffer[];
64167755Ssamextern u_int8_t hmac_opad_buffer[];
65104476Ssam#endif /* _KERNEL */
66104476Ssam
67104476Ssam#endif /* _CRYPTO_CRYPTO_H_ */
68