uts: make emu10k non-verbose
[unleashed.git] / include / sys / des.h
blob130e2838cd8b5d943c3207f28502c046535ae245
1 /*
2 * CDDL HEADER START
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.
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.
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]
20 * CDDL HEADER END
23 * Copyright 1998 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1983-1989 AT&T */
28 /* All Rights Reserved */
31 * Portions of this source code were derived from Berkeley 4.3 BSD
32 * under license from the Regents of the University of California.
35 #ifndef _SYS_DES_H
36 #define _SYS_DES_H
38 #pragma ident "%Z%%M% %I% %E% SMI"
41 * Generic DES driver interface
42 * Keep this file hardware independent!
45 #include <sys/ioccom.h>
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
51 #define DES_MAXLEN 65536 /* maximum # of bytes to encrypt */
52 #define DES_QUICKLEN 16 /* maximum # of bytes to encrypt quickly */
54 enum desdir { ENCRYPT, DECRYPT };
55 enum desmode { CBC, ECB };
58 * parameters to ioctl call
60 struct desparams {
61 uchar_t des_key[8]; /* key (with low bit parity) */
62 enum desdir des_dir; /* direction */
63 enum desmode des_mode; /* mode */
64 uchar_t des_ivec[8]; /* input vector */
65 unsigned des_len; /* number of bytes to crypt */
66 union {
67 uchar_t UDES_data[DES_QUICKLEN];
68 uchar_t *UDES_buf;
69 } UDES;
70 #define des_data UDES.UDES_data /* direct data here if quick */
71 #define des_buf UDES.UDES_buf /* otherwise, pointer to data */
75 * Encrypt an arbitrary sized buffer
77 #define DESIOCBLOCK _IOWR('d', 6, struct desparams)
80 * Encrypt of small amount of data, quickly
82 #define DESIOCQUICK _IOWR('d', 7, struct desparams)
84 #ifdef __cplusplus
86 #endif
88 #endif /* _SYS_DES_H */