Back to index

glibc  2.9
crypt.h
Go to the documentation of this file.
00001 /*
00002  * UFC-crypt: ultra fast crypt(3) implementation
00003  *
00004  * Copyright (C) 1991,92,93,96,97,98,2000,2004 Free Software Foundation, Inc.
00005  *
00006  * The GNU C Library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * The GNU C Library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with the GNU C Library; if not, write to the Free
00018  * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019  * 02111-1307 USA.
00020  *
00021  * @(#)crypt.h       1.5 12/20/96
00022  *
00023  */
00024 
00025 #ifndef _CRYPT_H
00026 #define _CRYPT_H     1
00027 
00028 #include <features.h>
00029 
00030 __BEGIN_DECLS
00031 
00032 /* Encrypt at most 8 characters from KEY using salt to perturb DES.  */
00033 extern char *crypt (__const char *__key, __const char *__salt)
00034      __THROW __nonnull ((1, 2));
00035 
00036 /* Setup DES tables according KEY.  */
00037 extern void setkey (__const char *__key) __THROW __nonnull ((1));
00038 
00039 /* Encrypt data in BLOCK in place if EDFLAG is zero; otherwise decrypt
00040    block in place.  */
00041 extern void encrypt (char *__block, int __edflag) __THROW __nonnull ((1));
00042 
00043 #ifdef __USE_GNU
00044 /* Reentrant versions of the functions above.  The additional argument
00045    points to a structure where the results are placed in.  */
00046 struct crypt_data
00047   {
00048     char keysched[16 * 8];
00049     char sb0[32768];
00050     char sb1[32768];
00051     char sb2[32768];
00052     char sb3[32768];
00053     /* end-of-aligment-critical-data */
00054     char crypt_3_buf[14];
00055     char current_salt[2];
00056     long int current_saltbits;
00057     int  direction, initialized;
00058   };
00059 
00060 extern char *crypt_r (__const char *__key, __const char *__salt,
00061                     struct crypt_data * __restrict __data)
00062      __THROW __nonnull ((1, 2, 3));
00063 
00064 extern void setkey_r (__const char *__key,
00065                     struct crypt_data * __restrict __data)
00066      __THROW __nonnull ((1, 2));
00067 
00068 extern void encrypt_r (char *__block, int __edflag,
00069                      struct crypt_data * __restrict __data)
00070      __THROW __nonnull ((1, 3));
00071 #endif
00072 
00073 __END_DECLS
00074 
00075 #endif /* crypt.h */