2000-02-29 05:21:42 +00:00
|
|
|
/*
|
|
|
|
* UFC-crypt: ultra fast crypt(3) implementation
|
|
|
|
*
|
2013-01-02 19:01:50 +00:00
|
|
|
* Copyright (C) 1991-2013 Free Software Foundation, Inc.
|
2000-02-29 05:21:42 +00:00
|
|
|
*
|
2001-07-06 05:37:16 +00:00
|
|
|
* The GNU C Library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
2000-02-29 05:21:42 +00:00
|
|
|
* License as published by the Free Software Foundation; either
|
2001-07-06 05:37:16 +00:00
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2000-02-29 05:21:42 +00:00
|
|
|
*
|
2001-07-06 05:37:16 +00:00
|
|
|
* The GNU C Library is distributed in the hope that it will be useful,
|
2000-02-29 05:21:42 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2001-07-06 05:37:16 +00:00
|
|
|
* Lesser General Public License for more details.
|
2000-02-29 05:21:42 +00:00
|
|
|
*
|
2001-07-06 05:37:16 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-02-09 23:18:22 +00:00
|
|
|
* License along with the GNU C Library; if not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
2000-02-29 05:21:42 +00:00
|
|
|
*
|
|
|
|
* @(#)crypt.h 1.5 12/20/96
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _CRYPT_H
|
|
|
|
#define _CRYPT_H 1
|
|
|
|
|
|
|
|
#include <features.h>
|
|
|
|
|
|
|
|
__BEGIN_DECLS
|
|
|
|
|
|
|
|
/* Encrypt at most 8 characters from KEY using salt to perturb DES. */
|
2012-01-08 04:57:22 +00:00
|
|
|
extern char *crypt (const char *__key, const char *__salt)
|
2004-09-17 19:27:08 +00:00
|
|
|
__THROW __nonnull ((1, 2));
|
2000-02-29 05:21:42 +00:00
|
|
|
|
|
|
|
/* Setup DES tables according KEY. */
|
2012-01-08 04:57:22 +00:00
|
|
|
extern void setkey (const char *__key) __THROW __nonnull ((1));
|
2000-02-29 05:21:42 +00:00
|
|
|
|
|
|
|
/* Encrypt data in BLOCK in place if EDFLAG is zero; otherwise decrypt
|
|
|
|
block in place. */
|
2013-11-21 21:57:37 +00:00
|
|
|
extern void encrypt (char *__glibc_block, int __edflag)
|
|
|
|
__THROW __nonnull ((1));
|
2000-02-29 05:21:42 +00:00
|
|
|
|
|
|
|
#ifdef __USE_GNU
|
|
|
|
/* Reentrant versions of the functions above. The additional argument
|
|
|
|
points to a structure where the results are placed in. */
|
|
|
|
struct crypt_data
|
|
|
|
{
|
|
|
|
char keysched[16 * 8];
|
|
|
|
char sb0[32768];
|
|
|
|
char sb1[32768];
|
|
|
|
char sb2[32768];
|
|
|
|
char sb3[32768];
|
|
|
|
/* end-of-aligment-critical-data */
|
|
|
|
char crypt_3_buf[14];
|
|
|
|
char current_salt[2];
|
|
|
|
long int current_saltbits;
|
|
|
|
int direction, initialized;
|
|
|
|
};
|
|
|
|
|
2012-01-08 04:57:22 +00:00
|
|
|
extern char *crypt_r (const char *__key, const char *__salt,
|
2004-09-17 19:27:08 +00:00
|
|
|
struct crypt_data * __restrict __data)
|
|
|
|
__THROW __nonnull ((1, 2, 3));
|
2000-02-29 05:21:42 +00:00
|
|
|
|
2012-01-08 04:57:22 +00:00
|
|
|
extern void setkey_r (const char *__key,
|
2004-09-17 19:27:08 +00:00
|
|
|
struct crypt_data * __restrict __data)
|
|
|
|
__THROW __nonnull ((1, 2));
|
2000-02-29 05:21:42 +00:00
|
|
|
|
2013-11-21 21:57:37 +00:00
|
|
|
extern void encrypt_r (char *__glibc_block, int __edflag,
|
2004-09-17 19:27:08 +00:00
|
|
|
struct crypt_data * __restrict __data)
|
|
|
|
__THROW __nonnull ((1, 3));
|
2000-02-29 05:21:42 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
__END_DECLS
|
|
|
|
|
|
|
|
#endif /* crypt.h */
|