1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #ifndef _CRYPTO_CRYPTOSOFT_H_
25 #define _CRYPTO_CRYPTOSOFT_H_
26
27
28 struct swcr_data {
29 int sw_alg;
30 union {
31 struct {
32 u_int8_t *SW_ictx;
33 u_int8_t *SW_octx;
34 u_int32_t SW_klen;
35 struct auth_hash *SW_axf;
36 } SWCR_AUTH;
37 struct {
38 u_int8_t *SW_kschedule;
39 struct enc_xform *SW_exf;
40 } SWCR_ENC;
41 struct {
42 u_int32_t SW_size;
43 struct comp_algo *SW_cxf;
44 } SWCR_COMP;
45 } SWCR_UN;
46
47 #define sw_ictx SWCR_UN.SWCR_AUTH.SW_ictx
48 #define sw_octx SWCR_UN.SWCR_AUTH.SW_octx
49 #define sw_klen SWCR_UN.SWCR_AUTH.SW_klen
50 #define sw_axf SWCR_UN.SWCR_AUTH.SW_axf
51 #define sw_kschedule SWCR_UN.SWCR_ENC.SW_kschedule
52 #define sw_exf SWCR_UN.SWCR_ENC.SW_exf
53 #define sw_size SWCR_UN.SWCR_COMP.SW_size
54 #define sw_cxf SWCR_UN.SWCR_COMP.SW_cxf
55
56 struct swcr_data *sw_next;
57 };
58
59 #ifdef _KERNEL
60 extern u_int8_t hmac_ipad_buffer[64];
61 extern u_int8_t hmac_opad_buffer[64];
62
63 int swcr_encdec(struct cryptodesc *, struct swcr_data *, caddr_t, int);
64 int swcr_authcompute(struct cryptop *, struct cryptodesc *, struct swcr_data *,
65 caddr_t, int);
66 int swcr_compdec(struct cryptodesc *, struct swcr_data *, caddr_t, int);
67 int swcr_process(struct cryptop *);
68 int swcr_newsession(u_int32_t *, struct cryptoini *);
69 int swcr_freesession(u_int64_t);
70 void swcr_init(void);
71 #endif
72
73 #endif