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