cryptosoft.h revision 1.4.2.2 1 1.4.2.2 rmind /* $NetBSD: cryptosoft.h,v 1.4.2.2 2007/03/12 06:00:50 rmind Exp $ */
2 1.4.2.2 rmind /* $OpenBSD: cryptosoft.h,v 1.10 2002/04/22 23:10:09 deraadt Exp $ */
3 1.4.2.2 rmind
4 1.4.2.2 rmind /*
5 1.4.2.2 rmind * The author of this code is Angelos D. Keromytis (angelos (at) cis.upenn.edu)
6 1.4.2.2 rmind *
7 1.4.2.2 rmind * This code was written by Angelos D. Keromytis in Athens, Greece, in
8 1.4.2.2 rmind * February 2000. Network Security Technologies Inc. (NSTI) kindly
9 1.4.2.2 rmind * supported the development of this code.
10 1.4.2.2 rmind *
11 1.4.2.2 rmind * Copyright (c) 2000 Angelos D. Keromytis
12 1.4.2.2 rmind *
13 1.4.2.2 rmind * Permission to use, copy, and modify this software with or without fee
14 1.4.2.2 rmind * is hereby granted, provided that this entire notice is included in
15 1.4.2.2 rmind * all source code copies of any software which is or includes a copy or
16 1.4.2.2 rmind * modification of this software.
17 1.4.2.2 rmind *
18 1.4.2.2 rmind * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
19 1.4.2.2 rmind * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY
20 1.4.2.2 rmind * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
21 1.4.2.2 rmind * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
22 1.4.2.2 rmind * PURPOSE.
23 1.4.2.2 rmind */
24 1.4.2.2 rmind
25 1.4.2.2 rmind #ifndef _CRYPTO_CRYPTOSOFT_H_
26 1.4.2.2 rmind #define _CRYPTO_CRYPTOSOFT_H_
27 1.4.2.2 rmind
28 1.4.2.2 rmind /* Software session entry */
29 1.4.2.2 rmind struct swcr_data {
30 1.4.2.2 rmind int sw_alg; /* Algorithm */
31 1.4.2.2 rmind union {
32 1.4.2.2 rmind struct {
33 1.4.2.2 rmind u_int8_t *SW_ictx;
34 1.4.2.2 rmind u_int8_t *SW_octx;
35 1.4.2.2 rmind u_int32_t SW_klen;
36 1.4.2.2 rmind const struct swcr_auth_hash *SW_axf;
37 1.4.2.2 rmind } SWCR_AUTH;
38 1.4.2.2 rmind struct {
39 1.4.2.2 rmind u_int8_t *SW_kschedule;
40 1.4.2.2 rmind const struct swcr_enc_xform *SW_exf;
41 1.4.2.2 rmind } SWCR_ENC;
42 1.4.2.2 rmind struct {
43 1.4.2.2 rmind u_int32_t SW_size;
44 1.4.2.2 rmind const struct swcr_comp_algo *SW_cxf;
45 1.4.2.2 rmind } SWCR_COMP;
46 1.4.2.2 rmind } SWCR_UN;
47 1.4.2.2 rmind
48 1.4.2.2 rmind #define sw_ictx SWCR_UN.SWCR_AUTH.SW_ictx
49 1.4.2.2 rmind #define sw_octx SWCR_UN.SWCR_AUTH.SW_octx
50 1.4.2.2 rmind #define sw_klen SWCR_UN.SWCR_AUTH.SW_klen
51 1.4.2.2 rmind #define sw_axf SWCR_UN.SWCR_AUTH.SW_axf
52 1.4.2.2 rmind #define sw_kschedule SWCR_UN.SWCR_ENC.SW_kschedule
53 1.4.2.2 rmind #define sw_exf SWCR_UN.SWCR_ENC.SW_exf
54 1.4.2.2 rmind #define sw_size SWCR_UN.SWCR_COMP.SW_size
55 1.4.2.2 rmind #define sw_cxf SWCR_UN.SWCR_COMP.SW_cxf
56 1.4.2.2 rmind
57 1.4.2.2 rmind struct swcr_data *sw_next;
58 1.4.2.2 rmind };
59 1.4.2.2 rmind
60 1.4.2.2 rmind #ifdef _KERNEL
61 1.4.2.2 rmind int swcr_authcompute(struct cryptop *crp, struct cryptodesc *crd,
62 1.4.2.2 rmind struct swcr_data *sw, void *buf, int outtype);
63 1.4.2.2 rmind #endif /* _KERNEL */
64 1.4.2.2 rmind
65 1.4.2.2 rmind #endif /* _CRYPTO_CRYPTO_H_ */
66