1700 Add SCSI UNMAP support
[unleashed.git] / usr / src / uts / common / sys / des.h
blob20a16c2cdaff8f3b762622a3502c696a5d354353
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
39 * Generic DES driver interface
40 * Keep this file hardware independent!
43 #include <sys/ioccom.h>
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
49 #define DES_MAXLEN 65536 /* maximum # of bytes to encrypt */
50 #define DES_QUICKLEN 16 /* maximum # of bytes to encrypt quickly */
52 enum desdir { ENCRYPT, DECRYPT };
53 enum desmode { CBC, ECB };
56 * parameters to ioctl call
58 struct desparams {
59 uchar_t des_key[8]; /* key (with low bit parity) */
60 enum desdir des_dir; /* direction */
61 enum desmode des_mode; /* mode */
62 uchar_t des_ivec[8]; /* input vector */
63 unsigned des_len; /* number of bytes to crypt */
64 union {
65 uchar_t UDES_data[DES_QUICKLEN];
66 uchar_t *UDES_buf;
67 } UDES;
68 #define des_data UDES.UDES_data /* direct data here if quick */
69 #define des_buf UDES.UDES_buf /* otherwise, pointer to data */
73 * Encrypt an arbitrary sized buffer
75 #define DESIOCBLOCK _IOWR('d', 6, struct desparams)
78 * Encrypt of small amount of data, quickly
80 #define DESIOCQUICK _IOWR('d', 7, struct desparams)
82 #ifdef __cplusplus
84 #endif
86 #endif /* _SYS_DES_H */