162587Sitojun/*	$FreeBSD$	*/
291671Sume/*	$KAME: spr.h,v 1.4 2001/09/10 04:03:58 itojun Exp $	*/
362587Sitojun
455009Sshin/* crypto/des/spr.h */
591671Sume/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
655009Sshin * All rights reserved.
755009Sshin *
891671Sume * This package is an SSL implementation written
991671Sume * by Eric Young (eay@cryptsoft.com).
1091671Sume * The implementation was written so as to conform with Netscapes SSL.
1191671Sume *
1291671Sume * This library is free for commercial and non-commercial use as long as
1391671Sume * the following conditions are aheared to.  The following conditions
1491671Sume * apply to all code found in this distribution, be it the RC4, RSA,
1591671Sume * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
1691671Sume * included with this distribution is covered by the same copyright terms
1791671Sume * except that the holder is Tim Hudson (tjh@cryptsoft.com).
1891671Sume *
1955009Sshin * Copyright remains Eric Young's, and as such any Copyright notices in
2091671Sume * the code are not to be removed.
2191671Sume * If this package is used in a product, Eric Young should be given attribution
2291671Sume * as the author of the parts of the library used.
2355009Sshin * This can be in the form of a textual message at program startup or
2455009Sshin * in documentation (online or textual) provided with the package.
2591671Sume *
2655009Sshin * Redistribution and use in source and binary forms, with or without
2755009Sshin * modification, are permitted provided that the following conditions
2855009Sshin * are met:
2955009Sshin * 1. Redistributions of source code must retain the copyright
3055009Sshin *    notice, this list of conditions and the following disclaimer.
3155009Sshin * 2. Redistributions in binary form must reproduce the above copyright
3255009Sshin *    notice, this list of conditions and the following disclaimer in the
3355009Sshin *    documentation and/or other materials provided with the distribution.
3455009Sshin * 3. All advertising materials mentioning features or use of this software
3555009Sshin *    must display the following acknowledgement:
3691671Sume *    "This product includes cryptographic software written by
3791671Sume *     Eric Young (eay@cryptsoft.com)"
3891671Sume *    The word 'cryptographic' can be left out if the rouines from the library
3991671Sume *    being used are not cryptographic related :-).
4091671Sume * 4. If you include any Windows specific code (or a derivative thereof) from
4191671Sume *    the apps directory (application code) you must include an acknowledgement:
4291671Sume *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
4391671Sume *
4455009Sshin * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
4555009Sshin * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
4655009Sshin * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
4755009Sshin * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
4855009Sshin * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
4955009Sshin * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
5055009Sshin * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
5155009Sshin * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
5255009Sshin * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
5355009Sshin * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
5455009Sshin * SUCH DAMAGE.
5591671Sume *
5655009Sshin * The licence and distribution terms for any publically available version or
5755009Sshin * derivative of this code cannot be changed.  i.e. this code cannot simply be
5855009Sshin * copied and put under another distribution licence
5955009Sshin * [including the GNU Public Licence.]
6055009Sshin */
6155009Sshin
6291671Sumeconst DES_LONG des_SPtrans[8][64]={
6355009Sshin{
6455009Sshin/* nibble 0 */
6591671Sume0x02080800L, 0x00080000L, 0x02000002L, 0x02080802L,
6691671Sume0x02000000L, 0x00080802L, 0x00080002L, 0x02000002L,
6791671Sume0x00080802L, 0x02080800L, 0x02080000L, 0x00000802L,
6891671Sume0x02000802L, 0x02000000L, 0x00000000L, 0x00080002L,
6991671Sume0x00080000L, 0x00000002L, 0x02000800L, 0x00080800L,
7091671Sume0x02080802L, 0x02080000L, 0x00000802L, 0x02000800L,
7191671Sume0x00000002L, 0x00000800L, 0x00080800L, 0x02080002L,
7291671Sume0x00000800L, 0x02000802L, 0x02080002L, 0x00000000L,
7391671Sume0x00000000L, 0x02080802L, 0x02000800L, 0x00080002L,
7491671Sume0x02080800L, 0x00080000L, 0x00000802L, 0x02000800L,
7591671Sume0x02080002L, 0x00000800L, 0x00080800L, 0x02000002L,
7691671Sume0x00080802L, 0x00000002L, 0x02000002L, 0x02080000L,
7791671Sume0x02080802L, 0x00080800L, 0x02080000L, 0x02000802L,
7891671Sume0x02000000L, 0x00000802L, 0x00080002L, 0x00000000L,
7991671Sume0x00080000L, 0x02000000L, 0x02000802L, 0x02080800L,
8091671Sume0x00000002L, 0x02080002L, 0x00000800L, 0x00080802L,
8155009Sshin},{
8255009Sshin/* nibble 1 */
8391671Sume0x40108010L, 0x00000000L, 0x00108000L, 0x40100000L,
8491671Sume0x40000010L, 0x00008010L, 0x40008000L, 0x00108000L,
8591671Sume0x00008000L, 0x40100010L, 0x00000010L, 0x40008000L,
8691671Sume0x00100010L, 0x40108000L, 0x40100000L, 0x00000010L,
8791671Sume0x00100000L, 0x40008010L, 0x40100010L, 0x00008000L,
8891671Sume0x00108010L, 0x40000000L, 0x00000000L, 0x00100010L,
8991671Sume0x40008010L, 0x00108010L, 0x40108000L, 0x40000010L,
9091671Sume0x40000000L, 0x00100000L, 0x00008010L, 0x40108010L,
9191671Sume0x00100010L, 0x40108000L, 0x40008000L, 0x00108010L,
9291671Sume0x40108010L, 0x00100010L, 0x40000010L, 0x00000000L,
9391671Sume0x40000000L, 0x00008010L, 0x00100000L, 0x40100010L,
9491671Sume0x00008000L, 0x40000000L, 0x00108010L, 0x40008010L,
9591671Sume0x40108000L, 0x00008000L, 0x00000000L, 0x40000010L,
9691671Sume0x00000010L, 0x40108010L, 0x00108000L, 0x40100000L,
9791671Sume0x40100010L, 0x00100000L, 0x00008010L, 0x40008000L,
9891671Sume0x40008010L, 0x00000010L, 0x40100000L, 0x00108000L,
9955009Sshin},{
10055009Sshin/* nibble 2 */
10191671Sume0x04000001L, 0x04040100L, 0x00000100L, 0x04000101L,
10291671Sume0x00040001L, 0x04000000L, 0x04000101L, 0x00040100L,
10391671Sume0x04000100L, 0x00040000L, 0x04040000L, 0x00000001L,
10491671Sume0x04040101L, 0x00000101L, 0x00000001L, 0x04040001L,
10591671Sume0x00000000L, 0x00040001L, 0x04040100L, 0x00000100L,
10691671Sume0x00000101L, 0x04040101L, 0x00040000L, 0x04000001L,
10791671Sume0x04040001L, 0x04000100L, 0x00040101L, 0x04040000L,
10891671Sume0x00040100L, 0x00000000L, 0x04000000L, 0x00040101L,
10991671Sume0x04040100L, 0x00000100L, 0x00000001L, 0x00040000L,
11091671Sume0x00000101L, 0x00040001L, 0x04040000L, 0x04000101L,
11191671Sume0x00000000L, 0x04040100L, 0x00040100L, 0x04040001L,
11291671Sume0x00040001L, 0x04000000L, 0x04040101L, 0x00000001L,
11391671Sume0x00040101L, 0x04000001L, 0x04000000L, 0x04040101L,
11491671Sume0x00040000L, 0x04000100L, 0x04000101L, 0x00040100L,
11591671Sume0x04000100L, 0x00000000L, 0x04040001L, 0x00000101L,
11691671Sume0x04000001L, 0x00040101L, 0x00000100L, 0x04040000L,
11755009Sshin},{
11855009Sshin/* nibble 3 */
11991671Sume0x00401008L, 0x10001000L, 0x00000008L, 0x10401008L,
12091671Sume0x00000000L, 0x10400000L, 0x10001008L, 0x00400008L,
12191671Sume0x10401000L, 0x10000008L, 0x10000000L, 0x00001008L,
12291671Sume0x10000008L, 0x00401008L, 0x00400000L, 0x10000000L,
12391671Sume0x10400008L, 0x00401000L, 0x00001000L, 0x00000008L,
12491671Sume0x00401000L, 0x10001008L, 0x10400000L, 0x00001000L,
12591671Sume0x00001008L, 0x00000000L, 0x00400008L, 0x10401000L,
12691671Sume0x10001000L, 0x10400008L, 0x10401008L, 0x00400000L,
12791671Sume0x10400008L, 0x00001008L, 0x00400000L, 0x10000008L,
12891671Sume0x00401000L, 0x10001000L, 0x00000008L, 0x10400000L,
12991671Sume0x10001008L, 0x00000000L, 0x00001000L, 0x00400008L,
13091671Sume0x00000000L, 0x10400008L, 0x10401000L, 0x00001000L,
13191671Sume0x10000000L, 0x10401008L, 0x00401008L, 0x00400000L,
13291671Sume0x10401008L, 0x00000008L, 0x10001000L, 0x00401008L,
13391671Sume0x00400008L, 0x00401000L, 0x10400000L, 0x10001008L,
13491671Sume0x00001008L, 0x10000000L, 0x10000008L, 0x10401000L,
13555009Sshin},{
13655009Sshin/* nibble 4 */
13791671Sume0x08000000L, 0x00010000L, 0x00000400L, 0x08010420L,
13891671Sume0x08010020L, 0x08000400L, 0x00010420L, 0x08010000L,
13991671Sume0x00010000L, 0x00000020L, 0x08000020L, 0x00010400L,
14091671Sume0x08000420L, 0x08010020L, 0x08010400L, 0x00000000L,
14191671Sume0x00010400L, 0x08000000L, 0x00010020L, 0x00000420L,
14291671Sume0x08000400L, 0x00010420L, 0x00000000L, 0x08000020L,
14391671Sume0x00000020L, 0x08000420L, 0x08010420L, 0x00010020L,
14491671Sume0x08010000L, 0x00000400L, 0x00000420L, 0x08010400L,
14591671Sume0x08010400L, 0x08000420L, 0x00010020L, 0x08010000L,
14691671Sume0x00010000L, 0x00000020L, 0x08000020L, 0x08000400L,
14791671Sume0x08000000L, 0x00010400L, 0x08010420L, 0x00000000L,
14891671Sume0x00010420L, 0x08000000L, 0x00000400L, 0x00010020L,
14991671Sume0x08000420L, 0x00000400L, 0x00000000L, 0x08010420L,
15091671Sume0x08010020L, 0x08010400L, 0x00000420L, 0x00010000L,
15191671Sume0x00010400L, 0x08010020L, 0x08000400L, 0x00000420L,
15291671Sume0x00000020L, 0x00010420L, 0x08010000L, 0x08000020L,
15355009Sshin},{
15455009Sshin/* nibble 5 */
15591671Sume0x80000040L, 0x00200040L, 0x00000000L, 0x80202000L,
15691671Sume0x00200040L, 0x00002000L, 0x80002040L, 0x00200000L,
15791671Sume0x00002040L, 0x80202040L, 0x00202000L, 0x80000000L,
15891671Sume0x80002000L, 0x80000040L, 0x80200000L, 0x00202040L,
15991671Sume0x00200000L, 0x80002040L, 0x80200040L, 0x00000000L,
16091671Sume0x00002000L, 0x00000040L, 0x80202000L, 0x80200040L,
16191671Sume0x80202040L, 0x80200000L, 0x80000000L, 0x00002040L,
16291671Sume0x00000040L, 0x00202000L, 0x00202040L, 0x80002000L,
16391671Sume0x00002040L, 0x80000000L, 0x80002000L, 0x00202040L,
16491671Sume0x80202000L, 0x00200040L, 0x00000000L, 0x80002000L,
16591671Sume0x80000000L, 0x00002000L, 0x80200040L, 0x00200000L,
16691671Sume0x00200040L, 0x80202040L, 0x00202000L, 0x00000040L,
16791671Sume0x80202040L, 0x00202000L, 0x00200000L, 0x80002040L,
16891671Sume0x80000040L, 0x80200000L, 0x00202040L, 0x00000000L,
16991671Sume0x00002000L, 0x80000040L, 0x80002040L, 0x80202000L,
17091671Sume0x80200000L, 0x00002040L, 0x00000040L, 0x80200040L,
17155009Sshin},{
17255009Sshin/* nibble 6 */
17391671Sume0x00004000L, 0x00000200L, 0x01000200L, 0x01000004L,
17491671Sume0x01004204L, 0x00004004L, 0x00004200L, 0x00000000L,
17591671Sume0x01000000L, 0x01000204L, 0x00000204L, 0x01004000L,
17691671Sume0x00000004L, 0x01004200L, 0x01004000L, 0x00000204L,
17791671Sume0x01000204L, 0x00004000L, 0x00004004L, 0x01004204L,
17891671Sume0x00000000L, 0x01000200L, 0x01000004L, 0x00004200L,
17991671Sume0x01004004L, 0x00004204L, 0x01004200L, 0x00000004L,
18091671Sume0x00004204L, 0x01004004L, 0x00000200L, 0x01000000L,
18191671Sume0x00004204L, 0x01004000L, 0x01004004L, 0x00000204L,
18291671Sume0x00004000L, 0x00000200L, 0x01000000L, 0x01004004L,
18391671Sume0x01000204L, 0x00004204L, 0x00004200L, 0x00000000L,
18491671Sume0x00000200L, 0x01000004L, 0x00000004L, 0x01000200L,
18591671Sume0x00000000L, 0x01000204L, 0x01000200L, 0x00004200L,
18691671Sume0x00000204L, 0x00004000L, 0x01004204L, 0x01000000L,
18791671Sume0x01004200L, 0x00000004L, 0x00004004L, 0x01004204L,
18891671Sume0x01000004L, 0x01004200L, 0x01004000L, 0x00004004L,
18955009Sshin},{
19055009Sshin/* nibble 7 */
19191671Sume0x20800080L, 0x20820000L, 0x00020080L, 0x00000000L,
19291671Sume0x20020000L, 0x00800080L, 0x20800000L, 0x20820080L,
19391671Sume0x00000080L, 0x20000000L, 0x00820000L, 0x00020080L,
19491671Sume0x00820080L, 0x20020080L, 0x20000080L, 0x20800000L,
19591671Sume0x00020000L, 0x00820080L, 0x00800080L, 0x20020000L,
19691671Sume0x20820080L, 0x20000080L, 0x00000000L, 0x00820000L,
19791671Sume0x20000000L, 0x00800000L, 0x20020080L, 0x20800080L,
19891671Sume0x00800000L, 0x00020000L, 0x20820000L, 0x00000080L,
19991671Sume0x00800000L, 0x00020000L, 0x20000080L, 0x20820080L,
20091671Sume0x00020080L, 0x20000000L, 0x00000000L, 0x00820000L,
20191671Sume0x20800080L, 0x20020080L, 0x20020000L, 0x00800080L,
20291671Sume0x20820000L, 0x00000080L, 0x00800080L, 0x20020000L,
20391671Sume0x20820080L, 0x00800000L, 0x20800000L, 0x20000080L,
20491671Sume0x00820000L, 0x00020080L, 0x20020080L, 0x20800000L,
20591671Sume0x00000080L, 0x20820000L, 0x00820080L, 0x00000000L,
20691671Sume0x20000000L, 0x20800080L, 0x00020000L, 0x00820080L,
20755009Sshin}};
208