1/* $NetBSD: xform.h,v 1.19 2011/05/26 21:50:03 drochner Exp $ */
2/* $FreeBSD: src/sys/opencrypto/xform.h,v 1.1.2.1 2002/11/21 23:34:23 sam Exp $ */
3/* $OpenBSD: xform.h,v 1.10 2002/04/22 23:10:09 deraadt Exp $ */
4
5/*
6 * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
7 *
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.
11 *
12 * Copyright (c) 2000 Angelos D. Keromytis
13 *
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.
18 *
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.
24 */
25
26#ifndef _CRYPTO_XFORM_H_
27#define _CRYPTO_XFORM_H_
28
29/* Declarations */
30struct auth_hash {
31 int type;
32 const char *name;
33 u_int16_t keysize;
34 u_int16_t hashsize;
35 u_int16_t authsize;
36 u_int16_t blocksize;
37};
38
39/* Provide array-limit for clients (e.g., netipsec) */
40#define AH_ALEN_MAX 32 /* max authenticator hash length */
41
42struct enc_xform {
43 int type;
44 const char *name;
45 u_int16_t blocksize, ivsize;
46 u_int16_t minkey, maxkey;
47};
48
49struct comp_algo {
50 int type;
51 const char *name;
52 size_t minlen;
53};
54
55extern const u_int8_t hmac_ipad_buffer[128];
56extern const u_int8_t hmac_opad_buffer[128];
57
58extern const struct enc_xform enc_xform_null;
59extern const struct enc_xform enc_xform_des;
60extern const struct enc_xform enc_xform_3des;
61extern const struct enc_xform enc_xform_blf;
62extern const struct enc_xform enc_xform_cast5;
63extern const struct enc_xform enc_xform_skipjack;
64extern const struct enc_xform enc_xform_rijndael128;
65extern const struct enc_xform enc_xform_arc4;
66extern const struct enc_xform enc_xform_camellia;
67extern const struct enc_xform enc_xform_aes_ctr;
68extern const struct enc_xform enc_xform_aes_gcm;
69extern const struct enc_xform enc_xform_aes_gmac;
70
71extern const struct auth_hash auth_hash_null;
72extern const struct auth_hash auth_hash_md5;
73extern const struct auth_hash auth_hash_sha1;
74extern const struct auth_hash auth_hash_key_md5;
75extern const struct auth_hash auth_hash_key_sha1;
76extern const struct auth_hash auth_hash_hmac_md5;
77extern const struct auth_hash auth_hash_hmac_sha1;
78extern const struct auth_hash auth_hash_hmac_ripemd_160;
79extern const struct auth_hash auth_hash_hmac_md5_96;
80extern const struct auth_hash auth_hash_hmac_sha1_96;
81extern const struct auth_hash auth_hash_hmac_ripemd_160_96;
82extern const struct auth_hash auth_hash_hmac_sha2_256;
83extern const struct auth_hash auth_hash_hmac_sha2_384;
84extern const struct auth_hash auth_hash_hmac_sha2_512;
85extern const struct auth_hash auth_hash_aes_xcbc_mac_96;
86extern const struct auth_hash auth_hash_gmac_aes_128;
87extern const struct auth_hash auth_hash_gmac_aes_192;
88extern const struct auth_hash auth_hash_gmac_aes_256;
89
90extern const struct comp_algo comp_algo_deflate;
91extern const struct comp_algo comp_algo_deflate_nogrow;
92extern const struct comp_algo comp_algo_gzip;
93
94#ifdef _KERNEL
95#include <sys/malloc.h>
96MALLOC_DECLARE(M_XDATA);
97#endif
98#endif /* _CRYPTO_XFORM_H_ */
99