MFC r1.27:
[dragonfly.git] / sys / opencrypto / cryptosoft.h
blob6f81df300177fa1e2f045d57a0cbfe7d71c679ed
1 /* $FreeBSD: src/sys/opencrypto/cryptosoft.h,v 1.1.2.1 2002/11/21 23:34:23 sam Exp $ */
2 /* $DragonFly: src/sys/opencrypto/cryptosoft.h,v 1.2 2003/06/17 04:28:54 dillon Exp $ */
3 /* $OpenBSD: cryptosoft.h,v 1.10 2002/04/22 23:10:09 deraadt Exp $ */
5 /*
6 * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
8 * This code was written by Angelos D. Keromytis in Athens, Greece, in
9 * February 2000. Network Security Technologies Inc. (NSTI) kindly
10 * supported the development of this code.
12 * Copyright (c) 2000 Angelos D. Keromytis
14 * Permission to use, copy, and modify this software with or without fee
15 * is hereby granted, provided that this entire notice is included in
16 * all source code copies of any software which is or includes a copy or
17 * modification of this software.
19 * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
20 * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY
21 * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
22 * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
23 * PURPOSE.
26 #ifndef _CRYPTO_CRYPTOSOFT_H_
27 #define _CRYPTO_CRYPTOSOFT_H_
29 /* Software session entry */
30 struct swcr_data {
31 int sw_alg; /* Algorithm */
32 union {
33 struct {
34 u_int8_t *SW_ictx;
35 u_int8_t *SW_octx;
36 u_int32_t SW_klen;
37 struct auth_hash *SW_axf;
38 } SWCR_AUTH;
39 struct {
40 u_int8_t *SW_kschedule;
41 struct enc_xform *SW_exf;
42 } SWCR_ENC;
43 struct {
44 u_int32_t SW_size;
45 struct comp_algo *SW_cxf;
46 } SWCR_COMP;
47 } SWCR_UN;
49 #define sw_ictx SWCR_UN.SWCR_AUTH.SW_ictx
50 #define sw_octx SWCR_UN.SWCR_AUTH.SW_octx
51 #define sw_klen SWCR_UN.SWCR_AUTH.SW_klen
52 #define sw_axf SWCR_UN.SWCR_AUTH.SW_axf
53 #define sw_kschedule SWCR_UN.SWCR_ENC.SW_kschedule
54 #define sw_exf SWCR_UN.SWCR_ENC.SW_exf
55 #define sw_size SWCR_UN.SWCR_COMP.SW_size
56 #define sw_cxf SWCR_UN.SWCR_COMP.SW_cxf
58 struct swcr_data *sw_next;
61 #ifdef _KERNEL
62 extern u_int8_t hmac_ipad_buffer[64];
63 extern u_int8_t hmac_opad_buffer[64];
64 #endif /* _KERNEL */
66 #endif /* _CRYPTO_CRYPTO_H_ */