]> git.saurik.com Git - apple/xnu.git/blob - bsd/crypto/des/spr.h
ebe9007f2e8234a5ac6d12f74b57ca124b8cd591
[apple/xnu.git] / bsd / crypto / des / spr.h
1 /* crypto/des/spr.h */
2 /* Copyright (C) 1995-1996 Eric Young (eay@mincom.oz.au)
3 * All rights reserved.
4 *
5 * This file is part of an SSL implementation written
6 * by Eric Young (eay@mincom.oz.au).
7 * The implementation was written so as to conform with Netscapes SSL
8 * specification. This library and applications are
9 * FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
10 * as long as the following conditions are aheared to.
11 *
12 * Copyright remains Eric Young's, and as such any Copyright notices in
13 * the code are not to be removed. If this code is used in a product,
14 * Eric Young should be given attribution as the author of the parts used.
15 * This can be in the form of a textual message at program startup or
16 * in documentation (online or textual) provided with the package.
17 *
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions
20 * are met:
21 * 1. Redistributions of source code must retain the copyright
22 * notice, this list of conditions and the following disclaimer.
23 * 2. Redistributions in binary form must reproduce the above copyright
24 * notice, this list of conditions and the following disclaimer in the
25 * documentation and/or other materials provided with the distribution.
26 * 3. All advertising materials mentioning features or use of this software
27 * must display the following acknowledgement:
28 * This product includes software developed by Eric Young (eay@mincom.oz.au)
29 *
30 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
31 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
34 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
36 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 * SUCH DAMAGE.
41 *
42 * The licence and distribution terms for any publically available version or
43 * derivative of this code cannot be changed. i.e. this code cannot simply be
44 * copied and put under another distribution licence
45 * [including the GNU Public Licence.]
46 */
47
48 static const DES_LONG des_SPtrans[8][64]={
49 {
50 /* nibble 0 */
51 0x00820200L, 0x00020000L, 0x80800000L, 0x80820200L,
52 0x00800000L, 0x80020200L, 0x80020000L, 0x80800000L,
53 0x80020200L, 0x00820200L, 0x00820000L, 0x80000200L,
54 0x80800200L, 0x00800000L, 0x00000000L, 0x80020000L,
55 0x00020000L, 0x80000000L, 0x00800200L, 0x00020200L,
56 0x80820200L, 0x00820000L, 0x80000200L, 0x00800200L,
57 0x80000000L, 0x00000200L, 0x00020200L, 0x80820000L,
58 0x00000200L, 0x80800200L, 0x80820000L, 0x00000000L,
59 0x00000000L, 0x80820200L, 0x00800200L, 0x80020000L,
60 0x00820200L, 0x00020000L, 0x80000200L, 0x00800200L,
61 0x80820000L, 0x00000200L, 0x00020200L, 0x80800000L,
62 0x80020200L, 0x80000000L, 0x80800000L, 0x00820000L,
63 0x80820200L, 0x00020200L, 0x00820000L, 0x80800200L,
64 0x00800000L, 0x80000200L, 0x80020000L, 0x00000000L,
65 0x00020000L, 0x00800000L, 0x80800200L, 0x00820200L,
66 0x80000000L, 0x80820000L, 0x00000200L, 0x80020200L,
67 },{
68 /* nibble 1 */
69 0x10042004L, 0x00000000L, 0x00042000L, 0x10040000L,
70 0x10000004L, 0x00002004L, 0x10002000L, 0x00042000L,
71 0x00002000L, 0x10040004L, 0x00000004L, 0x10002000L,
72 0x00040004L, 0x10042000L, 0x10040000L, 0x00000004L,
73 0x00040000L, 0x10002004L, 0x10040004L, 0x00002000L,
74 0x00042004L, 0x10000000L, 0x00000000L, 0x00040004L,
75 0x10002004L, 0x00042004L, 0x10042000L, 0x10000004L,
76 0x10000000L, 0x00040000L, 0x00002004L, 0x10042004L,
77 0x00040004L, 0x10042000L, 0x10002000L, 0x00042004L,
78 0x10042004L, 0x00040004L, 0x10000004L, 0x00000000L,
79 0x10000000L, 0x00002004L, 0x00040000L, 0x10040004L,
80 0x00002000L, 0x10000000L, 0x00042004L, 0x10002004L,
81 0x10042000L, 0x00002000L, 0x00000000L, 0x10000004L,
82 0x00000004L, 0x10042004L, 0x00042000L, 0x10040000L,
83 0x10040004L, 0x00040000L, 0x00002004L, 0x10002000L,
84 0x10002004L, 0x00000004L, 0x10040000L, 0x00042000L,
85 },{
86 /* nibble 2 */
87 0x41000000L, 0x01010040L, 0x00000040L, 0x41000040L,
88 0x40010000L, 0x01000000L, 0x41000040L, 0x00010040L,
89 0x01000040L, 0x00010000L, 0x01010000L, 0x40000000L,
90 0x41010040L, 0x40000040L, 0x40000000L, 0x41010000L,
91 0x00000000L, 0x40010000L, 0x01010040L, 0x00000040L,
92 0x40000040L, 0x41010040L, 0x00010000L, 0x41000000L,
93 0x41010000L, 0x01000040L, 0x40010040L, 0x01010000L,
94 0x00010040L, 0x00000000L, 0x01000000L, 0x40010040L,
95 0x01010040L, 0x00000040L, 0x40000000L, 0x00010000L,
96 0x40000040L, 0x40010000L, 0x01010000L, 0x41000040L,
97 0x00000000L, 0x01010040L, 0x00010040L, 0x41010000L,
98 0x40010000L, 0x01000000L, 0x41010040L, 0x40000000L,
99 0x40010040L, 0x41000000L, 0x01000000L, 0x41010040L,
100 0x00010000L, 0x01000040L, 0x41000040L, 0x00010040L,
101 0x01000040L, 0x00000000L, 0x41010000L, 0x40000040L,
102 0x41000000L, 0x40010040L, 0x00000040L, 0x01010000L,
103 },{
104 /* nibble 3 */
105 0x00100402L, 0x04000400L, 0x00000002L, 0x04100402L,
106 0x00000000L, 0x04100000L, 0x04000402L, 0x00100002L,
107 0x04100400L, 0x04000002L, 0x04000000L, 0x00000402L,
108 0x04000002L, 0x00100402L, 0x00100000L, 0x04000000L,
109 0x04100002L, 0x00100400L, 0x00000400L, 0x00000002L,
110 0x00100400L, 0x04000402L, 0x04100000L, 0x00000400L,
111 0x00000402L, 0x00000000L, 0x00100002L, 0x04100400L,
112 0x04000400L, 0x04100002L, 0x04100402L, 0x00100000L,
113 0x04100002L, 0x00000402L, 0x00100000L, 0x04000002L,
114 0x00100400L, 0x04000400L, 0x00000002L, 0x04100000L,
115 0x04000402L, 0x00000000L, 0x00000400L, 0x00100002L,
116 0x00000000L, 0x04100002L, 0x04100400L, 0x00000400L,
117 0x04000000L, 0x04100402L, 0x00100402L, 0x00100000L,
118 0x04100402L, 0x00000002L, 0x04000400L, 0x00100402L,
119 0x00100002L, 0x00100400L, 0x04100000L, 0x04000402L,
120 0x00000402L, 0x04000000L, 0x04000002L, 0x04100400L,
121 },{
122 /* nibble 4 */
123 0x02000000L, 0x00004000L, 0x00000100L, 0x02004108L,
124 0x02004008L, 0x02000100L, 0x00004108L, 0x02004000L,
125 0x00004000L, 0x00000008L, 0x02000008L, 0x00004100L,
126 0x02000108L, 0x02004008L, 0x02004100L, 0x00000000L,
127 0x00004100L, 0x02000000L, 0x00004008L, 0x00000108L,
128 0x02000100L, 0x00004108L, 0x00000000L, 0x02000008L,
129 0x00000008L, 0x02000108L, 0x02004108L, 0x00004008L,
130 0x02004000L, 0x00000100L, 0x00000108L, 0x02004100L,
131 0x02004100L, 0x02000108L, 0x00004008L, 0x02004000L,
132 0x00004000L, 0x00000008L, 0x02000008L, 0x02000100L,
133 0x02000000L, 0x00004100L, 0x02004108L, 0x00000000L,
134 0x00004108L, 0x02000000L, 0x00000100L, 0x00004008L,
135 0x02000108L, 0x00000100L, 0x00000000L, 0x02004108L,
136 0x02004008L, 0x02004100L, 0x00000108L, 0x00004000L,
137 0x00004100L, 0x02004008L, 0x02000100L, 0x00000108L,
138 0x00000008L, 0x00004108L, 0x02004000L, 0x02000008L,
139 },{
140 /* nibble 5 */
141 0x20000010L, 0x00080010L, 0x00000000L, 0x20080800L,
142 0x00080010L, 0x00000800L, 0x20000810L, 0x00080000L,
143 0x00000810L, 0x20080810L, 0x00080800L, 0x20000000L,
144 0x20000800L, 0x20000010L, 0x20080000L, 0x00080810L,
145 0x00080000L, 0x20000810L, 0x20080010L, 0x00000000L,
146 0x00000800L, 0x00000010L, 0x20080800L, 0x20080010L,
147 0x20080810L, 0x20080000L, 0x20000000L, 0x00000810L,
148 0x00000010L, 0x00080800L, 0x00080810L, 0x20000800L,
149 0x00000810L, 0x20000000L, 0x20000800L, 0x00080810L,
150 0x20080800L, 0x00080010L, 0x00000000L, 0x20000800L,
151 0x20000000L, 0x00000800L, 0x20080010L, 0x00080000L,
152 0x00080010L, 0x20080810L, 0x00080800L, 0x00000010L,
153 0x20080810L, 0x00080800L, 0x00080000L, 0x20000810L,
154 0x20000010L, 0x20080000L, 0x00080810L, 0x00000000L,
155 0x00000800L, 0x20000010L, 0x20000810L, 0x20080800L,
156 0x20080000L, 0x00000810L, 0x00000010L, 0x20080010L,
157 },{
158 /* nibble 6 */
159 0x00001000L, 0x00000080L, 0x00400080L, 0x00400001L,
160 0x00401081L, 0x00001001L, 0x00001080L, 0x00000000L,
161 0x00400000L, 0x00400081L, 0x00000081L, 0x00401000L,
162 0x00000001L, 0x00401080L, 0x00401000L, 0x00000081L,
163 0x00400081L, 0x00001000L, 0x00001001L, 0x00401081L,
164 0x00000000L, 0x00400080L, 0x00400001L, 0x00001080L,
165 0x00401001L, 0x00001081L, 0x00401080L, 0x00000001L,
166 0x00001081L, 0x00401001L, 0x00000080L, 0x00400000L,
167 0x00001081L, 0x00401000L, 0x00401001L, 0x00000081L,
168 0x00001000L, 0x00000080L, 0x00400000L, 0x00401001L,
169 0x00400081L, 0x00001081L, 0x00001080L, 0x00000000L,
170 0x00000080L, 0x00400001L, 0x00000001L, 0x00400080L,
171 0x00000000L, 0x00400081L, 0x00400080L, 0x00001080L,
172 0x00000081L, 0x00001000L, 0x00401081L, 0x00400000L,
173 0x00401080L, 0x00000001L, 0x00001001L, 0x00401081L,
174 0x00400001L, 0x00401080L, 0x00401000L, 0x00001001L,
175 },{
176 /* nibble 7 */
177 0x08200020L, 0x08208000L, 0x00008020L, 0x00000000L,
178 0x08008000L, 0x00200020L, 0x08200000L, 0x08208020L,
179 0x00000020L, 0x08000000L, 0x00208000L, 0x00008020L,
180 0x00208020L, 0x08008020L, 0x08000020L, 0x08200000L,
181 0x00008000L, 0x00208020L, 0x00200020L, 0x08008000L,
182 0x08208020L, 0x08000020L, 0x00000000L, 0x00208000L,
183 0x08000000L, 0x00200000L, 0x08008020L, 0x08200020L,
184 0x00200000L, 0x00008000L, 0x08208000L, 0x00000020L,
185 0x00200000L, 0x00008000L, 0x08000020L, 0x08208020L,
186 0x00008020L, 0x08000000L, 0x00000000L, 0x00208000L,
187 0x08200020L, 0x08008020L, 0x08008000L, 0x00200020L,
188 0x08208000L, 0x00000020L, 0x00200020L, 0x08008000L,
189 0x08208020L, 0x00200000L, 0x08200000L, 0x08000020L,
190 0x00208000L, 0x00008020L, 0x08008020L, 0x08200000L,
191 0x00000020L, 0x08208000L, 0x00208020L, 0x00000000L,
192 0x08000000L, 0x08200020L, 0x00008000L, 0x00208020L,
193 }};