Back to index

glibc  2.9
rpc_des.h
Go to the documentation of this file.
00001 /*
00002  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
00003  * unrestricted use provided that this legend is included on all tape
00004  * media and as a part of the software program in whole or part.  Users
00005  * may copy or modify Sun RPC without charge, but are not authorized
00006  * to license or distribute it to anyone else except as part of a product or
00007  * program developed by the user.
00008  * 
00009  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
00010  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
00011  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
00012  * 
00013  * Sun RPC is provided with no support and without any obligation on the
00014  * part of Sun Microsystems, Inc. to assist in its use, correction,
00015  * modification or enhancement.
00016  * 
00017  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
00018  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
00019  * OR ANY PART THEREOF.
00020  * 
00021  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
00022  * or profits or other special, indirect and consequential damages, even if
00023  * Sun has been advised of the possibility of such damages.
00024  * 
00025  * Sun Microsystems, Inc.
00026  * 2550 Garcia Avenue
00027  * Mountain View, California  94043
00028  */
00029 /*
00030  * Generic DES driver interface
00031  * Keep this file hardware independent!
00032  * Copyright (c) 1986 by Sun Microsystems, Inc.
00033  */
00034 
00035 #ifndef _DES_H
00036 #define _DES_H
00037 
00038 #include <sys/types.h>
00039 
00040 #define DES_MAXLEN   65536  /* maximum # of bytes to encrypt  */
00041 #define DES_QUICKLEN 16     /* maximum # of bytes to encrypt quickly */
00042 
00043 enum desdir
00044   {
00045     ENCRYPT, DECRYPT
00046   };
00047 enum desmode
00048   {
00049     CBC, ECB
00050   };
00051 
00052 /*
00053  * parameters to ioctl call
00054  */
00055 struct desparams
00056   {
00057     u_char des_key[8];             /* key (with low bit parity) */
00058     enum desdir des_dir;    /* direction */
00059     enum desmode des_mode;  /* mode */
00060     u_char des_ivec[8];            /* input vector */
00061     unsigned des_len;              /* number of bytes to crypt */
00062     union
00063       {
00064        u_char UDES_data[DES_QUICKLEN];
00065        u_char *UDES_buf;
00066       }
00067     UDES;
00068 #define des_data UDES.UDES_data    /* direct data here if quick */
00069 #define des_buf      UDES.UDES_buf /* otherwise, pointer to data */
00070   };
00071 
00072 #endif