xref: /illumos-gate/usr/src/head/crypt.h (revision d7dc20313645bcb9c9960a816baebe924d60bcf3)
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 2014 Garrett D'Amore <garrett@damore.org>
23  *
24  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
25  * Use is subject to license terms.
26  */
27 
28 /*	Copyright (c) 1988 AT&T	*/
29 /*	  All Rights Reserved	*/
30 
31 
32 #ifndef	_CRYPT_H
33 #define	_CRYPT_H
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 extern char *crypt(const char *, const char *);
46 extern char *crypt_gensalt(const char *, const struct passwd *);
47 extern char *crypt_genhash_impl(char *, size_t, const char *,
48     const char *, const char **);
49 extern char *crypt_gensalt_impl(char *, size_t, const char *,
50     const struct passwd *, const char **);
51 extern int crypt_close(int *);
52 extern char *des_crypt(const char *, const char *);
53 extern void des_encrypt(char *, int);
54 extern void des_setkey(const char *);
55 extern void encrypt(char *, int);
56 extern int run_crypt(long, char *, unsigned, int *);
57 extern int run_setkey(int *, const char *);
58 extern void setkey(const char *);
59 
60 #ifdef	__cplusplus
61 }
62 #endif
63 
64 #endif	/* _CRYPT_H */
65