155714Skris/* crypto/des/spr.h */
255714Skris/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
355714Skris * All rights reserved.
455714Skris *
555714Skris * This package is an SSL implementation written
655714Skris * by Eric Young (eay@cryptsoft.com).
755714Skris * The implementation was written so as to conform with Netscapes SSL.
8296341Sdelphij *
955714Skris * This library is free for commercial and non-commercial use as long as
1055714Skris * the following conditions are aheared to.  The following conditions
1155714Skris * apply to all code found in this distribution, be it the RC4, RSA,
1255714Skris * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
1355714Skris * included with this distribution is covered by the same copyright terms
1455714Skris * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15296341Sdelphij *
1655714Skris * Copyright remains Eric Young's, and as such any Copyright notices in
1755714Skris * the code are not to be removed.
1855714Skris * If this package is used in a product, Eric Young should be given attribution
1955714Skris * as the author of the parts of the library used.
2055714Skris * This can be in the form of a textual message at program startup or
2155714Skris * in documentation (online or textual) provided with the package.
22296341Sdelphij *
2355714Skris * Redistribution and use in source and binary forms, with or without
2455714Skris * modification, are permitted provided that the following conditions
2555714Skris * are met:
2655714Skris * 1. Redistributions of source code must retain the copyright
2755714Skris *    notice, this list of conditions and the following disclaimer.
2855714Skris * 2. Redistributions in binary form must reproduce the above copyright
2955714Skris *    notice, this list of conditions and the following disclaimer in the
3055714Skris *    documentation and/or other materials provided with the distribution.
3155714Skris * 3. All advertising materials mentioning features or use of this software
3255714Skris *    must display the following acknowledgement:
3355714Skris *    "This product includes cryptographic software written by
3455714Skris *     Eric Young (eay@cryptsoft.com)"
3555714Skris *    The word 'cryptographic' can be left out if the rouines from the library
3655714Skris *    being used are not cryptographic related :-).
37296341Sdelphij * 4. If you include any Windows specific code (or a derivative thereof) from
3855714Skris *    the apps directory (application code) you must include an acknowledgement:
3955714Skris *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40296341Sdelphij *
4155714Skris * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
4255714Skris * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
4355714Skris * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
4455714Skris * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
4555714Skris * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
4655714Skris * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
4755714Skris * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
4855714Skris * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
4955714Skris * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
5055714Skris * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
5155714Skris * SUCH DAMAGE.
52296341Sdelphij *
5355714Skris * The licence and distribution terms for any publically available version or
5455714Skris * derivative of this code cannot be changed.  i.e. this code cannot simply be
5555714Skris * copied and put under another distribution licence
5655714Skris * [including the GNU Public Licence.]
5755714Skris */
5855714Skris
59296341SdelphijOPENSSL_GLOBAL const DES_LONG DES_SPtrans[8][64] = {
60296341Sdelphij    {
61296341Sdelphij        /* nibble 0 */
62296341Sdelphij        0x02080800L, 0x00080000L, 0x02000002L, 0x02080802L,
63296341Sdelphij        0x02000000L, 0x00080802L, 0x00080002L, 0x02000002L,
64296341Sdelphij        0x00080802L, 0x02080800L, 0x02080000L, 0x00000802L,
65296341Sdelphij        0x02000802L, 0x02000000L, 0x00000000L, 0x00080002L,
66296341Sdelphij        0x00080000L, 0x00000002L, 0x02000800L, 0x00080800L,
67296341Sdelphij        0x02080802L, 0x02080000L, 0x00000802L, 0x02000800L,
68296341Sdelphij        0x00000002L, 0x00000800L, 0x00080800L, 0x02080002L,
69296341Sdelphij        0x00000800L, 0x02000802L, 0x02080002L, 0x00000000L,
70296341Sdelphij        0x00000000L, 0x02080802L, 0x02000800L, 0x00080002L,
71296341Sdelphij        0x02080800L, 0x00080000L, 0x00000802L, 0x02000800L,
72296341Sdelphij        0x02080002L, 0x00000800L, 0x00080800L, 0x02000002L,
73296341Sdelphij        0x00080802L, 0x00000002L, 0x02000002L, 0x02080000L,
74296341Sdelphij        0x02080802L, 0x00080800L, 0x02080000L, 0x02000802L,
75296341Sdelphij        0x02000000L, 0x00000802L, 0x00080002L, 0x00000000L,
76296341Sdelphij        0x00080000L, 0x02000000L, 0x02000802L, 0x02080800L,
77296341Sdelphij        0x00000002L, 0x02080002L, 0x00000800L, 0x00080802L,
78296341Sdelphij    },
79296341Sdelphij    {
80296341Sdelphij        /* nibble 1 */
81296341Sdelphij        0x40108010L, 0x00000000L, 0x00108000L, 0x40100000L,
82296341Sdelphij        0x40000010L, 0x00008010L, 0x40008000L, 0x00108000L,
83296341Sdelphij        0x00008000L, 0x40100010L, 0x00000010L, 0x40008000L,
84296341Sdelphij        0x00100010L, 0x40108000L, 0x40100000L, 0x00000010L,
85296341Sdelphij        0x00100000L, 0x40008010L, 0x40100010L, 0x00008000L,
86296341Sdelphij        0x00108010L, 0x40000000L, 0x00000000L, 0x00100010L,
87296341Sdelphij        0x40008010L, 0x00108010L, 0x40108000L, 0x40000010L,
88296341Sdelphij        0x40000000L, 0x00100000L, 0x00008010L, 0x40108010L,
89296341Sdelphij        0x00100010L, 0x40108000L, 0x40008000L, 0x00108010L,
90296341Sdelphij        0x40108010L, 0x00100010L, 0x40000010L, 0x00000000L,
91296341Sdelphij        0x40000000L, 0x00008010L, 0x00100000L, 0x40100010L,
92296341Sdelphij        0x00008000L, 0x40000000L, 0x00108010L, 0x40008010L,
93296341Sdelphij        0x40108000L, 0x00008000L, 0x00000000L, 0x40000010L,
94296341Sdelphij        0x00000010L, 0x40108010L, 0x00108000L, 0x40100000L,
95296341Sdelphij        0x40100010L, 0x00100000L, 0x00008010L, 0x40008000L,
96296341Sdelphij        0x40008010L, 0x00000010L, 0x40100000L, 0x00108000L,
97296341Sdelphij    },
98296341Sdelphij    {
99296341Sdelphij        /* nibble 2 */
100296341Sdelphij        0x04000001L, 0x04040100L, 0x00000100L, 0x04000101L,
101296341Sdelphij        0x00040001L, 0x04000000L, 0x04000101L, 0x00040100L,
102296341Sdelphij        0x04000100L, 0x00040000L, 0x04040000L, 0x00000001L,
103296341Sdelphij        0x04040101L, 0x00000101L, 0x00000001L, 0x04040001L,
104296341Sdelphij        0x00000000L, 0x00040001L, 0x04040100L, 0x00000100L,
105296341Sdelphij        0x00000101L, 0x04040101L, 0x00040000L, 0x04000001L,
106296341Sdelphij        0x04040001L, 0x04000100L, 0x00040101L, 0x04040000L,
107296341Sdelphij        0x00040100L, 0x00000000L, 0x04000000L, 0x00040101L,
108296341Sdelphij        0x04040100L, 0x00000100L, 0x00000001L, 0x00040000L,
109296341Sdelphij        0x00000101L, 0x00040001L, 0x04040000L, 0x04000101L,
110296341Sdelphij        0x00000000L, 0x04040100L, 0x00040100L, 0x04040001L,
111296341Sdelphij        0x00040001L, 0x04000000L, 0x04040101L, 0x00000001L,
112296341Sdelphij        0x00040101L, 0x04000001L, 0x04000000L, 0x04040101L,
113296341Sdelphij        0x00040000L, 0x04000100L, 0x04000101L, 0x00040100L,
114296341Sdelphij        0x04000100L, 0x00000000L, 0x04040001L, 0x00000101L,
115296341Sdelphij        0x04000001L, 0x00040101L, 0x00000100L, 0x04040000L,
116296341Sdelphij    },
117296341Sdelphij    {
118296341Sdelphij        /* nibble 3 */
119296341Sdelphij        0x00401008L, 0x10001000L, 0x00000008L, 0x10401008L,
120296341Sdelphij        0x00000000L, 0x10400000L, 0x10001008L, 0x00400008L,
121296341Sdelphij        0x10401000L, 0x10000008L, 0x10000000L, 0x00001008L,
122296341Sdelphij        0x10000008L, 0x00401008L, 0x00400000L, 0x10000000L,
123296341Sdelphij        0x10400008L, 0x00401000L, 0x00001000L, 0x00000008L,
124296341Sdelphij        0x00401000L, 0x10001008L, 0x10400000L, 0x00001000L,
125296341Sdelphij        0x00001008L, 0x00000000L, 0x00400008L, 0x10401000L,
126296341Sdelphij        0x10001000L, 0x10400008L, 0x10401008L, 0x00400000L,
127296341Sdelphij        0x10400008L, 0x00001008L, 0x00400000L, 0x10000008L,
128296341Sdelphij        0x00401000L, 0x10001000L, 0x00000008L, 0x10400000L,
129296341Sdelphij        0x10001008L, 0x00000000L, 0x00001000L, 0x00400008L,
130296341Sdelphij        0x00000000L, 0x10400008L, 0x10401000L, 0x00001000L,
131296341Sdelphij        0x10000000L, 0x10401008L, 0x00401008L, 0x00400000L,
132296341Sdelphij        0x10401008L, 0x00000008L, 0x10001000L, 0x00401008L,
133296341Sdelphij        0x00400008L, 0x00401000L, 0x10400000L, 0x10001008L,
134296341Sdelphij        0x00001008L, 0x10000000L, 0x10000008L, 0x10401000L,
135296341Sdelphij    },
136296341Sdelphij    {
137296341Sdelphij        /* nibble 4 */
138296341Sdelphij        0x08000000L, 0x00010000L, 0x00000400L, 0x08010420L,
139296341Sdelphij        0x08010020L, 0x08000400L, 0x00010420L, 0x08010000L,
140296341Sdelphij        0x00010000L, 0x00000020L, 0x08000020L, 0x00010400L,
141296341Sdelphij        0x08000420L, 0x08010020L, 0x08010400L, 0x00000000L,
142296341Sdelphij        0x00010400L, 0x08000000L, 0x00010020L, 0x00000420L,
143296341Sdelphij        0x08000400L, 0x00010420L, 0x00000000L, 0x08000020L,
144296341Sdelphij        0x00000020L, 0x08000420L, 0x08010420L, 0x00010020L,
145296341Sdelphij        0x08010000L, 0x00000400L, 0x00000420L, 0x08010400L,
146296341Sdelphij        0x08010400L, 0x08000420L, 0x00010020L, 0x08010000L,
147296341Sdelphij        0x00010000L, 0x00000020L, 0x08000020L, 0x08000400L,
148296341Sdelphij        0x08000000L, 0x00010400L, 0x08010420L, 0x00000000L,
149296341Sdelphij        0x00010420L, 0x08000000L, 0x00000400L, 0x00010020L,
150296341Sdelphij        0x08000420L, 0x00000400L, 0x00000000L, 0x08010420L,
151296341Sdelphij        0x08010020L, 0x08010400L, 0x00000420L, 0x00010000L,
152296341Sdelphij        0x00010400L, 0x08010020L, 0x08000400L, 0x00000420L,
153296341Sdelphij        0x00000020L, 0x00010420L, 0x08010000L, 0x08000020L,
154296341Sdelphij    },
155296341Sdelphij    {
156296341Sdelphij        /* nibble 5 */
157296341Sdelphij        0x80000040L, 0x00200040L, 0x00000000L, 0x80202000L,
158296341Sdelphij        0x00200040L, 0x00002000L, 0x80002040L, 0x00200000L,
159296341Sdelphij        0x00002040L, 0x80202040L, 0x00202000L, 0x80000000L,
160296341Sdelphij        0x80002000L, 0x80000040L, 0x80200000L, 0x00202040L,
161296341Sdelphij        0x00200000L, 0x80002040L, 0x80200040L, 0x00000000L,
162296341Sdelphij        0x00002000L, 0x00000040L, 0x80202000L, 0x80200040L,
163296341Sdelphij        0x80202040L, 0x80200000L, 0x80000000L, 0x00002040L,
164296341Sdelphij        0x00000040L, 0x00202000L, 0x00202040L, 0x80002000L,
165296341Sdelphij        0x00002040L, 0x80000000L, 0x80002000L, 0x00202040L,
166296341Sdelphij        0x80202000L, 0x00200040L, 0x00000000L, 0x80002000L,
167296341Sdelphij        0x80000000L, 0x00002000L, 0x80200040L, 0x00200000L,
168296341Sdelphij        0x00200040L, 0x80202040L, 0x00202000L, 0x00000040L,
169296341Sdelphij        0x80202040L, 0x00202000L, 0x00200000L, 0x80002040L,
170296341Sdelphij        0x80000040L, 0x80200000L, 0x00202040L, 0x00000000L,
171296341Sdelphij        0x00002000L, 0x80000040L, 0x80002040L, 0x80202000L,
172296341Sdelphij        0x80200000L, 0x00002040L, 0x00000040L, 0x80200040L,
173296341Sdelphij    },
174296341Sdelphij    {
175296341Sdelphij        /* nibble 6 */
176296341Sdelphij        0x00004000L, 0x00000200L, 0x01000200L, 0x01000004L,
177296341Sdelphij        0x01004204L, 0x00004004L, 0x00004200L, 0x00000000L,
178296341Sdelphij        0x01000000L, 0x01000204L, 0x00000204L, 0x01004000L,
179296341Sdelphij        0x00000004L, 0x01004200L, 0x01004000L, 0x00000204L,
180296341Sdelphij        0x01000204L, 0x00004000L, 0x00004004L, 0x01004204L,
181296341Sdelphij        0x00000000L, 0x01000200L, 0x01000004L, 0x00004200L,
182296341Sdelphij        0x01004004L, 0x00004204L, 0x01004200L, 0x00000004L,
183296341Sdelphij        0x00004204L, 0x01004004L, 0x00000200L, 0x01000000L,
184296341Sdelphij        0x00004204L, 0x01004000L, 0x01004004L, 0x00000204L,
185296341Sdelphij        0x00004000L, 0x00000200L, 0x01000000L, 0x01004004L,
186296341Sdelphij        0x01000204L, 0x00004204L, 0x00004200L, 0x00000000L,
187296341Sdelphij        0x00000200L, 0x01000004L, 0x00000004L, 0x01000200L,
188296341Sdelphij        0x00000000L, 0x01000204L, 0x01000200L, 0x00004200L,
189296341Sdelphij        0x00000204L, 0x00004000L, 0x01004204L, 0x01000000L,
190296341Sdelphij        0x01004200L, 0x00000004L, 0x00004004L, 0x01004204L,
191296341Sdelphij        0x01000004L, 0x01004200L, 0x01004000L, 0x00004004L,
192296341Sdelphij    },
193296341Sdelphij    {
194296341Sdelphij        /* nibble 7 */
195296341Sdelphij        0x20800080L, 0x20820000L, 0x00020080L, 0x00000000L,
196296341Sdelphij        0x20020000L, 0x00800080L, 0x20800000L, 0x20820080L,
197296341Sdelphij        0x00000080L, 0x20000000L, 0x00820000L, 0x00020080L,
198296341Sdelphij        0x00820080L, 0x20020080L, 0x20000080L, 0x20800000L,
199296341Sdelphij        0x00020000L, 0x00820080L, 0x00800080L, 0x20020000L,
200296341Sdelphij        0x20820080L, 0x20000080L, 0x00000000L, 0x00820000L,
201296341Sdelphij        0x20000000L, 0x00800000L, 0x20020080L, 0x20800080L,
202296341Sdelphij        0x00800000L, 0x00020000L, 0x20820000L, 0x00000080L,
203296341Sdelphij        0x00800000L, 0x00020000L, 0x20000080L, 0x20820080L,
204296341Sdelphij        0x00020080L, 0x20000000L, 0x00000000L, 0x00820000L,
205296341Sdelphij        0x20800080L, 0x20020080L, 0x20020000L, 0x00800080L,
206296341Sdelphij        0x20820000L, 0x00000080L, 0x00800080L, 0x20020000L,
207296341Sdelphij        0x20820080L, 0x00800000L, 0x20800000L, 0x20000080L,
208296341Sdelphij        0x00820000L, 0x00020080L, 0x20020080L, 0x20800000L,
209296341Sdelphij        0x00000080L, 0x20820000L, 0x00820080L, 0x00000000L,
210296341Sdelphij        0x20000000L, 0x20800080L, 0x00020000L, 0x00820080L,
211296341Sdelphij    }
212296341Sdelphij};
213