Home | History | Annotate | Line # | Download | only in opencrypto
xform.h revision 1.6.8.1
      1  1.6.8.1      yamt /*	$NetBSD: xform.h,v 1.6.8.1 2005/11/29 21:23:33 yamt Exp $ */
      2      1.1  jonathan /*	$FreeBSD: src/sys/opencrypto/xform.h,v 1.1.2.1 2002/11/21 23:34:23 sam Exp $	*/
      3      1.1  jonathan /*	$OpenBSD: xform.h,v 1.10 2002/04/22 23:10:09 deraadt Exp $	*/
      4      1.1  jonathan 
      5      1.1  jonathan /*
      6      1.1  jonathan  * The author of this code is Angelos D. Keromytis (angelos (at) cis.upenn.edu)
      7      1.1  jonathan  *
      8      1.1  jonathan  * This code was written by Angelos D. Keromytis in Athens, Greece, in
      9      1.1  jonathan  * February 2000. Network Security Technologies Inc. (NSTI) kindly
     10      1.1  jonathan  * supported the development of this code.
     11      1.1  jonathan  *
     12      1.1  jonathan  * Copyright (c) 2000 Angelos D. Keromytis
     13      1.1  jonathan  *
     14      1.1  jonathan  * Permission to use, copy, and modify this software with or without fee
     15      1.1  jonathan  * is hereby granted, provided that this entire notice is included in
     16      1.1  jonathan  * all source code copies of any software which is or includes a copy or
     17      1.1  jonathan  * modification of this software.
     18      1.1  jonathan  *
     19      1.1  jonathan  * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
     20      1.1  jonathan  * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY
     21      1.1  jonathan  * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
     22      1.1  jonathan  * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
     23      1.1  jonathan  * PURPOSE.
     24      1.1  jonathan  */
     25      1.1  jonathan 
     26      1.1  jonathan #ifndef _CRYPTO_XFORM_H_
     27      1.1  jonathan #define _CRYPTO_XFORM_H_
     28      1.1  jonathan 
     29      1.2  jonathan #include <sys/md5.h>
     30      1.1  jonathan #include <sys/sha1.h>
     31      1.1  jonathan #include <crypto/sha2/sha2.h>
     32      1.4   thorpej #include <crypto/ripemd160/rmd160.h>
     33      1.1  jonathan 
     34      1.1  jonathan /* Declarations */
     35      1.1  jonathan struct auth_hash {
     36      1.1  jonathan 	int type;
     37      1.6  christos 	const char *name;
     38      1.1  jonathan 	u_int16_t keysize;
     39      1.1  jonathan 	u_int16_t hashsize;
     40      1.1  jonathan 	u_int16_t authsize;
     41      1.1  jonathan 	u_int16_t ctxsize;
     42      1.1  jonathan };
     43      1.1  jonathan 
     44      1.1  jonathan /* Provide array-limit for clients (e.g., netipsec) */
     45      1.1  jonathan #define	AH_ALEN_MAX	20	/* max authenticator hash length */
     46      1.1  jonathan 
     47      1.1  jonathan struct enc_xform {
     48      1.1  jonathan 	int type;
     49      1.6  christos 	const char *name;
     50      1.1  jonathan 	u_int16_t blocksize;
     51      1.1  jonathan 	u_int16_t minkey, maxkey;
     52      1.1  jonathan };
     53      1.1  jonathan 
     54      1.1  jonathan struct comp_algo {
     55      1.1  jonathan 	int type;
     56      1.6  christos 	const char *name;
     57      1.1  jonathan 	size_t minlen;
     58      1.1  jonathan };
     59      1.1  jonathan 
     60  1.6.8.1      yamt extern const u_int8_t hmac_ipad_buffer[64];
     61  1.6.8.1      yamt extern const u_int8_t hmac_opad_buffer[64];
     62      1.1  jonathan 
     63      1.1  jonathan extern struct enc_xform enc_xform_null;
     64      1.1  jonathan extern struct enc_xform enc_xform_des;
     65      1.1  jonathan extern struct enc_xform enc_xform_3des;
     66      1.1  jonathan extern struct enc_xform enc_xform_blf;
     67      1.1  jonathan extern struct enc_xform enc_xform_cast5;
     68      1.1  jonathan extern struct enc_xform enc_xform_skipjack;
     69      1.1  jonathan extern struct enc_xform enc_xform_rijndael128;
     70      1.1  jonathan extern struct enc_xform enc_xform_arc4;
     71      1.1  jonathan 
     72      1.1  jonathan extern struct auth_hash auth_hash_null;
     73      1.1  jonathan extern struct auth_hash auth_hash_md5;
     74      1.1  jonathan extern struct auth_hash auth_hash_sha1;
     75      1.1  jonathan extern struct auth_hash auth_hash_key_md5;
     76      1.1  jonathan extern struct auth_hash auth_hash_key_sha1;
     77      1.1  jonathan extern struct auth_hash auth_hash_hmac_md5_96;
     78      1.1  jonathan extern struct auth_hash auth_hash_hmac_sha1_96;
     79      1.1  jonathan extern struct auth_hash auth_hash_hmac_ripemd_160_96;
     80      1.1  jonathan extern struct auth_hash auth_hash_hmac_sha2_256;
     81      1.1  jonathan extern struct auth_hash auth_hash_hmac_sha2_384;
     82      1.1  jonathan extern struct auth_hash auth_hash_hmac_sha2_512;
     83      1.1  jonathan 
     84      1.1  jonathan extern struct comp_algo comp_algo_deflate;
     85      1.1  jonathan 
     86      1.1  jonathan #ifdef _KERNEL
     87      1.1  jonathan #include <sys/malloc.h>
     88      1.1  jonathan MALLOC_DECLARE(M_XDATA);
     89      1.1  jonathan #endif
     90      1.1  jonathan #endif /* _CRYPTO_XFORM_H_ */
     91