Blame crypt/crypt.h

Packit 6c4009
/*
Packit 6c4009
 * UFC-crypt: ultra fast crypt(3) implementation
Packit 6c4009
 *
Packit 6c4009
 * Copyright (C) 1991-2018 Free Software Foundation, Inc.
Packit 6c4009
 *
Packit 6c4009
 * The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
 * modify it under the terms of the GNU Lesser General Public
Packit 6c4009
 * License as published by the Free Software Foundation; either
Packit 6c4009
 * version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
 *
Packit 6c4009
 * The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
 * Lesser General Public License for more details.
Packit 6c4009
 *
Packit 6c4009
 * You should have received a copy of the GNU Lesser General Public
Packit 6c4009
 * License along with the GNU C Library; if not, see
Packit 6c4009
 * <http://www.gnu.org/licenses/>.
Packit 6c4009
 *
Packit 6c4009
 * @(#)crypt.h	1.5 12/20/96
Packit 6c4009
 *
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
#ifndef _CRYPT_H
Packit 6c4009
#define _CRYPT_H	1
Packit 6c4009
Packit 6c4009
#include <features.h>
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
/* One-way hash PHRASE, returning a string suitable for storage in the
Packit 6c4009
   user database.  SALT selects the one-way function to use, and
Packit 6c4009
   ensures that no two users' hashes are the same, even if they use
Packit 6c4009
   the same passphrase.  The return value points to static storage
Packit 6c4009
   which will be overwritten by the next call to crypt.  */
Packit 6c4009
extern char *crypt (const char *__phrase, const char *__salt)
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
Packit 6c4009
/* This structure provides scratch and output buffers for 'crypt_r'.
Packit 6c4009
   Its contents should not be accessed directly.  */
Packit 6c4009
struct crypt_data
Packit 6c4009
  {
Packit 6c4009
    char keysched[16 * 8];
Packit 6c4009
    char sb0[32768];
Packit 6c4009
    char sb1[32768];
Packit 6c4009
    char sb2[32768];
Packit 6c4009
    char sb3[32768];
Packit 6c4009
    /* end-of-aligment-critical-data */
Packit 6c4009
    char crypt_3_buf[14];
Packit 6c4009
    char current_salt[2];
Packit 6c4009
    long int current_saltbits;
Packit 6c4009
    int  direction, initialized;
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
/* Thread-safe version of 'crypt'.
Packit 6c4009
   DATA must point to a 'struct crypt_data' allocated by the caller.
Packit 6c4009
   Before the first call to 'crypt_r' with a new 'struct crypt_data',
Packit 6c4009
   that object must be initialized to all zeroes.  The pointer
Packit 6c4009
   returned, if not NULL, will point within DATA.  (It will still be
Packit 6c4009
   overwritten by the next call to 'crypt_r' with the same DATA.)  */
Packit 6c4009
extern char *crypt_r (const char *__phrase, const char *__salt,
Packit 6c4009
		      struct crypt_data * __restrict __data)
Packit 6c4009
     __THROW __nonnull ((1, 2, 3));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif	/* crypt.h */