xref: /titanic_44/usr/src/lib/libcrypt/common/llib-lcrypt (revision 4496171313bed39e96f21bc2f9faf2868e267ae3)
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, Version 1.0 only
6 * (the "License").  You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22/* LINTLIBRARY */
23/* PROTOLIB1 */
24
25/*
26 * Copyright (c) 1997, 2000 by Sun Microsystems, Inc.
27 * All rights reserved.
28 */
29#pragma ident	"%Z%%M%	%I%	%E% SMI"
30
31#include <stdio.h>
32#include <sys/types.h>
33#include <des/softdes.h>
34#include <des/desdata.h>
35#include <sys/des.h>
36
37/*
38 * usr/src/lib/libcrypt
39 */
40
41/* crypt.c */
42void setkey(const char *key);
43void encrypt(char *block, int edflag);
44char *crypt(const char *pw, const char *salt);
45
46/* cryptio.c */
47int _run_setkey(int p[2], const char *keyparam);
48int run_setkey(int p[2], const char *keyparam);
49int _run_crypt(long offset, char *buffer, unsigned int count, int p[2]);
50int run_crypt(long offset, char *buffer, unsigned int count, int p[2]);
51int _makekey(int b[2]);
52int makekey(int b[2]);
53int crypt_close_nolock(int p[2]);
54int _crypt_close(int p[2]);
55int crypt_close(int p[2]);
56
57/* des.c */
58int cbc_crypt(char *key, char *buf, size_t len, unsigned int mode, char *ivec);
59int ecb_crypt(char *key, char *buf, size_t len, unsigned int mode);
60
61/* des_crypt.c */
62void _des_setkey(const char *key);
63void des_setkey(const char *key);
64void _des_encrypt(char *block, int edflag);
65void des_encrypt(char *block, int edflag);
66char *des_crypt(const char *pw, const char *salt);
67
68/* des_decrypt.c */
69void _des_decrypt1(char *block, char *L, char *IP, char *R, char *preS,
70			char *E, char KS[][48], char S[][64], char *f,
71			char *tempL, char *P, char *FP);
72
73/* des_encrypt.c */
74void des_encrypt1(char *block, char *L, char *IP, char *R, char *preS,
75			char *E, char KS[][48], char S[][64], char *f,
76			char *tempL, char *P, char *FP);
77void _des_encrypt1(char *block, char *L, char *IP, char *R, char *preS,
78			char *E, char KS[][48], char S[][64], char *f,
79			char *tempL, char *P, char *FP);
80
81/* des_soft.c */
82void des_setparity(char *p);
83int __des_crypt(char *buf, unsigned len, struct desparams *desp);
84