]>
git.saurik.com Git - apple/ipsec.git/blob - ipsec-tools/racoon/algorithm.h
1 /* $Id: algorithm.h,v 1.8 2004/11/18 15:14:44 ludvigm Exp $ */
4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the project nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 #include "Algorithm_types.h"
38 struct hmac_algorithm
{
42 caddr_t (*init
) (vchar_t
*);
43 void (*update
) (caddr_t
, vchar_t
*);
44 vchar_t
*(*final
) (caddr_t
);
45 int (*hashlen
) (void);
46 vchar_t
*(*one
) (vchar_t
*, vchar_t
*);
49 struct hash_algorithm
{
53 caddr_t (*init
) (void);
54 void (*update
) (caddr_t
, vchar_t
*);
55 vchar_t
*(*final
) (caddr_t
);
56 int (*hashlen
) (void);
57 vchar_t
*(*one
) (vchar_t
*);
60 struct enc_algorithm
{
65 vchar_t
*(*encrypt
) (vchar_t
*, vchar_t
*, vchar_t
*);
66 vchar_t
*(*decrypt
) (vchar_t
*, vchar_t
*, vchar_t
*);
67 int (*weakkey
) (vchar_t
*);
76 struct dhgroup
*dhgroup
;
79 /* ipcomp, auth meth, dh group */
80 struct misc_algorithm
{
86 extern int alg_oakley_hashdef_ok (int);
87 extern int alg_oakley_hashdef_doi (int);
88 extern int alg_oakley_hashdef_hashlen (int);
89 extern vchar_t
*alg_oakley_hashdef_one (int, vchar_t
*);
91 extern int alg_oakley_hmacdef_doi (int);
92 extern vchar_t
*alg_oakley_hmacdef_one (int, vchar_t
*, vchar_t
*);
94 extern int alg_oakley_encdef_ok (int);
95 extern int alg_oakley_encdef_doi (int);
96 extern int alg_oakley_encdef_keylen (int, int);
97 extern int alg_oakley_encdef_blocklen (int);
98 extern vchar_t
*alg_oakley_encdef_decrypt (int, vchar_t
*, vchar_t
*, vchar_t
*);
99 extern vchar_t
*alg_oakley_encdef_encrypt (int, vchar_t
*, vchar_t
*, vchar_t
*);
101 extern int alg_ipsec_encdef_doi (int);
102 extern int alg_ipsec_encdef_keylen (int, int);
104 extern int alg_ipsec_hmacdef_doi (int);
105 extern int alg_ipsec_hmacdef_hashlen (int);
107 extern int alg_ipsec_compdef_doi (int);
109 extern int alg_oakley_dhdef_doi (int);
110 extern int alg_oakley_dhdef_ok (int);
111 extern struct dhgroup
*alg_oakley_dhdef_group (int);
113 extern int alg_oakley_authdef_doi (int);
115 extern int default_keylen (int, int);
116 extern int check_keylen (int, int, int);
117 extern int algtype2doi (int, int);
118 extern int algclass2doi (int);
120 extern const char *alg_oakley_encdef_name (int);
121 extern const char *alg_oakley_hashdef_name (int);
122 extern const char *alg_oakley_dhdef_name (int);
123 extern const char *alg_oakley_authdef_name (int);
125 #endif /* _ALGORITHM_H */