9075 Improve ZFS pool import/load process and corrupted pool recovery
[unleashed.git] / usr / src / uts / common / des / softdes.h
blob5f25bd30e56cf4ef7b17954efabcdbf61f3c5395
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
22 * Copyright 1998 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
27 /* All Rights Reserved */
30 * Portions of this source code were derived from Berkeley 4.3 BSD
31 * under license from the Regents of the University of California.
34 #ifndef _SYS_SOFTDES_H
35 #define _SYS_SOFTDES_H
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
42 * softdes.h, Data types and definition for software DES
46 * A chunk is an area of storage used in three different ways
47 * - As a 64 bit quantity (in high endian notation)
48 * - As a 48 bit quantity (6 low order bits per byte)
49 * - As a 32 bit quantity (first 4 bytes)
51 typedef union {
52 struct {
54 * This (and the one farther down) looks awfully backwards???
56 #ifdef _LONG_LONG_LTOH
57 uint32_t _long1;
58 uint32_t _long0;
59 #else
60 uint32_t _long0;
61 uint32_t _long1;
62 #endif
63 } _longs;
65 #define long0 _longs._long0
66 #define long1 _longs._long1
67 struct {
68 #ifdef _LONG_LONG_LTOH
69 uchar_t _byte7;
70 uchar_t _byte6;
71 uchar_t _byte5;
72 uchar_t _byte4;
73 uchar_t _byte3;
74 uchar_t _byte2;
75 uchar_t _byte1;
76 uchar_t _byte0;
77 #else
78 uchar_t _byte0;
79 uchar_t _byte1;
80 uchar_t _byte2;
81 uchar_t _byte3;
82 uchar_t _byte4;
83 uchar_t _byte5;
84 uchar_t _byte6;
85 uchar_t _byte7;
86 #endif
87 } _bytes;
88 #define byte0 _bytes._byte0
89 #define byte1 _bytes._byte1
90 #define byte2 _bytes._byte2
91 #define byte3 _bytes._byte3
92 #define byte4 _bytes._byte4
93 #define byte5 _bytes._byte5
94 #define byte6 _bytes._byte6
95 #define byte7 _bytes._byte7
96 } chunk_t;
99 * Intermediate key storage
100 * Created by des_setkey, used by des_encrypt and des_decrypt
101 * 16 48 bit values
103 struct deskeydata {
104 chunk_t keyval[16];
107 #ifdef __cplusplus
109 #endif
111 #endif /* _SYS_SOFTDES_H */