xref: /illumos-gate/usr/src/head/crypt.h (revision 0f1702c5201310f0529cd5abb77652e5e9b241b6)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 /*	Copyright (c) 1988 AT&T	*/
27 /*	  All Rights Reserved  	*/
28 
29 
30 #ifndef	_CRYPT_H
31 #define	_CRYPT_H
32 
33 #pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.1	*/
34 
35 #include <pwd.h>
36 
37 #ifdef	__cplusplus
38 extern "C" {
39 #endif
40 
41 /* Password and file encryption functions */
42 
43 #define	CRYPT_MAXCIPHERTEXTLEN	512
44 
45 #if defined(__STDC__)
46 extern char *crypt(const char *, const char *);
47 extern char *crypt_gensalt(const char *, const struct passwd *);
48 extern char *crypt_genhash_impl(char *, size_t, const char *,
49     const char *, const char **);
50 extern char *crypt_gensalt_impl(char *, size_t, const char *,
51     const struct passwd *, const char **);
52 extern int crypt_close(int *);
53 extern char *des_crypt(const char *, const char *);
54 extern void des_encrypt(char *, int);
55 extern void des_setkey(const char *);
56 extern void encrypt(char *, int);
57 extern int run_crypt(long, char *, unsigned, int *);
58 extern int run_setkey(int *, const char *);
59 extern void setkey(const char *);
60 #else
61 extern char *crypt();
62 extern char *crypt_gensalt();
63 extern char *crypt_genhash_impl();
64 extern char *crytp_gensalt_impl();
65 extern int crypt_close();
66 extern char *des_crypt();
67 extern void des_encrypt();
68 extern void des_setkey();
69 extern void encrypt();
70 extern int run_crypt();
71 extern int run_setkey();
72 extern void setkey();
73 #endif
74 
75 #ifdef	__cplusplus
76 }
77 #endif
78 
79 #endif	/* _CRYPT_H */
80