xref: /dflybsd-src/sys/crypto/des/spr.h (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
186d7f5d3SJohn Marino /*	$FreeBSD: src/sys/crypto/des/spr.h,v 1.4 2002/03/05 09:19:02 ume Exp $	*/
286d7f5d3SJohn Marino /*	$KAME: spr.h,v 1.4 2001/09/10 04:03:58 itojun Exp $	*/
386d7f5d3SJohn Marino 
486d7f5d3SJohn Marino /* crypto/des/spr.h */
586d7f5d3SJohn Marino /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
686d7f5d3SJohn Marino  * All rights reserved.
786d7f5d3SJohn Marino  *
886d7f5d3SJohn Marino  * This package is an SSL implementation written
986d7f5d3SJohn Marino  * by Eric Young (eay@cryptsoft.com).
1086d7f5d3SJohn Marino  * The implementation was written so as to conform with Netscapes SSL.
1186d7f5d3SJohn Marino  *
1286d7f5d3SJohn Marino  * This library is free for commercial and non-commercial use as long as
1386d7f5d3SJohn Marino  * the following conditions are aheared to.  The following conditions
1486d7f5d3SJohn Marino  * apply to all code found in this distribution, be it the RC4, RSA,
1586d7f5d3SJohn Marino  * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
1686d7f5d3SJohn Marino  * included with this distribution is covered by the same copyright terms
1786d7f5d3SJohn Marino  * except that the holder is Tim Hudson (tjh@cryptsoft.com).
1886d7f5d3SJohn Marino  *
1986d7f5d3SJohn Marino  * Copyright remains Eric Young's, and as such any Copyright notices in
2086d7f5d3SJohn Marino  * the code are not to be removed.
2186d7f5d3SJohn Marino  * If this package is used in a product, Eric Young should be given attribution
2286d7f5d3SJohn Marino  * as the author of the parts of the library used.
2386d7f5d3SJohn Marino  * This can be in the form of a textual message at program startup or
2486d7f5d3SJohn Marino  * in documentation (online or textual) provided with the package.
2586d7f5d3SJohn Marino  *
2686d7f5d3SJohn Marino  * Redistribution and use in source and binary forms, with or without
2786d7f5d3SJohn Marino  * modification, are permitted provided that the following conditions
2886d7f5d3SJohn Marino  * are met:
2986d7f5d3SJohn Marino  * 1. Redistributions of source code must retain the copyright
3086d7f5d3SJohn Marino  *    notice, this list of conditions and the following disclaimer.
3186d7f5d3SJohn Marino  * 2. Redistributions in binary form must reproduce the above copyright
3286d7f5d3SJohn Marino  *    notice, this list of conditions and the following disclaimer in the
3386d7f5d3SJohn Marino  *    documentation and/or other materials provided with the distribution.
3486d7f5d3SJohn Marino  * 3. All advertising materials mentioning features or use of this software
3586d7f5d3SJohn Marino  *    must display the following acknowledgement:
3686d7f5d3SJohn Marino  *    "This product includes cryptographic software written by
3786d7f5d3SJohn Marino  *     Eric Young (eay@cryptsoft.com)"
3886d7f5d3SJohn Marino  *    The word 'cryptographic' can be left out if the rouines from the library
3986d7f5d3SJohn Marino  *    being used are not cryptographic related :-).
4086d7f5d3SJohn Marino  * 4. If you include any Windows specific code (or a derivative thereof) from
4186d7f5d3SJohn Marino  *    the apps directory (application code) you must include an acknowledgement:
4286d7f5d3SJohn Marino  *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
4386d7f5d3SJohn Marino  *
4486d7f5d3SJohn Marino  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
4586d7f5d3SJohn Marino  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
4686d7f5d3SJohn Marino  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
4786d7f5d3SJohn Marino  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
4886d7f5d3SJohn Marino  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
4986d7f5d3SJohn Marino  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
5086d7f5d3SJohn Marino  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
5186d7f5d3SJohn Marino  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
5286d7f5d3SJohn Marino  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
5386d7f5d3SJohn Marino  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
5486d7f5d3SJohn Marino  * SUCH DAMAGE.
5586d7f5d3SJohn Marino  *
5686d7f5d3SJohn Marino  * The licence and distribution terms for any publically available version or
5786d7f5d3SJohn Marino  * derivative of this code cannot be changed.  i.e. this code cannot simply be
5886d7f5d3SJohn Marino  * copied and put under another distribution licence
5986d7f5d3SJohn Marino  * [including the GNU Public Licence.]
6086d7f5d3SJohn Marino  */
6186d7f5d3SJohn Marino 
6286d7f5d3SJohn Marino const DES_LONG des_SPtrans[8][64]={
6386d7f5d3SJohn Marino {
6486d7f5d3SJohn Marino /* nibble 0 */
6586d7f5d3SJohn Marino 0x02080800L, 0x00080000L, 0x02000002L, 0x02080802L,
6686d7f5d3SJohn Marino 0x02000000L, 0x00080802L, 0x00080002L, 0x02000002L,
6786d7f5d3SJohn Marino 0x00080802L, 0x02080800L, 0x02080000L, 0x00000802L,
6886d7f5d3SJohn Marino 0x02000802L, 0x02000000L, 0x00000000L, 0x00080002L,
6986d7f5d3SJohn Marino 0x00080000L, 0x00000002L, 0x02000800L, 0x00080800L,
7086d7f5d3SJohn Marino 0x02080802L, 0x02080000L, 0x00000802L, 0x02000800L,
7186d7f5d3SJohn Marino 0x00000002L, 0x00000800L, 0x00080800L, 0x02080002L,
7286d7f5d3SJohn Marino 0x00000800L, 0x02000802L, 0x02080002L, 0x00000000L,
7386d7f5d3SJohn Marino 0x00000000L, 0x02080802L, 0x02000800L, 0x00080002L,
7486d7f5d3SJohn Marino 0x02080800L, 0x00080000L, 0x00000802L, 0x02000800L,
7586d7f5d3SJohn Marino 0x02080002L, 0x00000800L, 0x00080800L, 0x02000002L,
7686d7f5d3SJohn Marino 0x00080802L, 0x00000002L, 0x02000002L, 0x02080000L,
7786d7f5d3SJohn Marino 0x02080802L, 0x00080800L, 0x02080000L, 0x02000802L,
7886d7f5d3SJohn Marino 0x02000000L, 0x00000802L, 0x00080002L, 0x00000000L,
7986d7f5d3SJohn Marino 0x00080000L, 0x02000000L, 0x02000802L, 0x02080800L,
8086d7f5d3SJohn Marino 0x00000002L, 0x02080002L, 0x00000800L, 0x00080802L,
8186d7f5d3SJohn Marino },{
8286d7f5d3SJohn Marino /* nibble 1 */
8386d7f5d3SJohn Marino 0x40108010L, 0x00000000L, 0x00108000L, 0x40100000L,
8486d7f5d3SJohn Marino 0x40000010L, 0x00008010L, 0x40008000L, 0x00108000L,
8586d7f5d3SJohn Marino 0x00008000L, 0x40100010L, 0x00000010L, 0x40008000L,
8686d7f5d3SJohn Marino 0x00100010L, 0x40108000L, 0x40100000L, 0x00000010L,
8786d7f5d3SJohn Marino 0x00100000L, 0x40008010L, 0x40100010L, 0x00008000L,
8886d7f5d3SJohn Marino 0x00108010L, 0x40000000L, 0x00000000L, 0x00100010L,
8986d7f5d3SJohn Marino 0x40008010L, 0x00108010L, 0x40108000L, 0x40000010L,
9086d7f5d3SJohn Marino 0x40000000L, 0x00100000L, 0x00008010L, 0x40108010L,
9186d7f5d3SJohn Marino 0x00100010L, 0x40108000L, 0x40008000L, 0x00108010L,
9286d7f5d3SJohn Marino 0x40108010L, 0x00100010L, 0x40000010L, 0x00000000L,
9386d7f5d3SJohn Marino 0x40000000L, 0x00008010L, 0x00100000L, 0x40100010L,
9486d7f5d3SJohn Marino 0x00008000L, 0x40000000L, 0x00108010L, 0x40008010L,
9586d7f5d3SJohn Marino 0x40108000L, 0x00008000L, 0x00000000L, 0x40000010L,
9686d7f5d3SJohn Marino 0x00000010L, 0x40108010L, 0x00108000L, 0x40100000L,
9786d7f5d3SJohn Marino 0x40100010L, 0x00100000L, 0x00008010L, 0x40008000L,
9886d7f5d3SJohn Marino 0x40008010L, 0x00000010L, 0x40100000L, 0x00108000L,
9986d7f5d3SJohn Marino },{
10086d7f5d3SJohn Marino /* nibble 2 */
10186d7f5d3SJohn Marino 0x04000001L, 0x04040100L, 0x00000100L, 0x04000101L,
10286d7f5d3SJohn Marino 0x00040001L, 0x04000000L, 0x04000101L, 0x00040100L,
10386d7f5d3SJohn Marino 0x04000100L, 0x00040000L, 0x04040000L, 0x00000001L,
10486d7f5d3SJohn Marino 0x04040101L, 0x00000101L, 0x00000001L, 0x04040001L,
10586d7f5d3SJohn Marino 0x00000000L, 0x00040001L, 0x04040100L, 0x00000100L,
10686d7f5d3SJohn Marino 0x00000101L, 0x04040101L, 0x00040000L, 0x04000001L,
10786d7f5d3SJohn Marino 0x04040001L, 0x04000100L, 0x00040101L, 0x04040000L,
10886d7f5d3SJohn Marino 0x00040100L, 0x00000000L, 0x04000000L, 0x00040101L,
10986d7f5d3SJohn Marino 0x04040100L, 0x00000100L, 0x00000001L, 0x00040000L,
11086d7f5d3SJohn Marino 0x00000101L, 0x00040001L, 0x04040000L, 0x04000101L,
11186d7f5d3SJohn Marino 0x00000000L, 0x04040100L, 0x00040100L, 0x04040001L,
11286d7f5d3SJohn Marino 0x00040001L, 0x04000000L, 0x04040101L, 0x00000001L,
11386d7f5d3SJohn Marino 0x00040101L, 0x04000001L, 0x04000000L, 0x04040101L,
11486d7f5d3SJohn Marino 0x00040000L, 0x04000100L, 0x04000101L, 0x00040100L,
11586d7f5d3SJohn Marino 0x04000100L, 0x00000000L, 0x04040001L, 0x00000101L,
11686d7f5d3SJohn Marino 0x04000001L, 0x00040101L, 0x00000100L, 0x04040000L,
11786d7f5d3SJohn Marino },{
11886d7f5d3SJohn Marino /* nibble 3 */
11986d7f5d3SJohn Marino 0x00401008L, 0x10001000L, 0x00000008L, 0x10401008L,
12086d7f5d3SJohn Marino 0x00000000L, 0x10400000L, 0x10001008L, 0x00400008L,
12186d7f5d3SJohn Marino 0x10401000L, 0x10000008L, 0x10000000L, 0x00001008L,
12286d7f5d3SJohn Marino 0x10000008L, 0x00401008L, 0x00400000L, 0x10000000L,
12386d7f5d3SJohn Marino 0x10400008L, 0x00401000L, 0x00001000L, 0x00000008L,
12486d7f5d3SJohn Marino 0x00401000L, 0x10001008L, 0x10400000L, 0x00001000L,
12586d7f5d3SJohn Marino 0x00001008L, 0x00000000L, 0x00400008L, 0x10401000L,
12686d7f5d3SJohn Marino 0x10001000L, 0x10400008L, 0x10401008L, 0x00400000L,
12786d7f5d3SJohn Marino 0x10400008L, 0x00001008L, 0x00400000L, 0x10000008L,
12886d7f5d3SJohn Marino 0x00401000L, 0x10001000L, 0x00000008L, 0x10400000L,
12986d7f5d3SJohn Marino 0x10001008L, 0x00000000L, 0x00001000L, 0x00400008L,
13086d7f5d3SJohn Marino 0x00000000L, 0x10400008L, 0x10401000L, 0x00001000L,
13186d7f5d3SJohn Marino 0x10000000L, 0x10401008L, 0x00401008L, 0x00400000L,
13286d7f5d3SJohn Marino 0x10401008L, 0x00000008L, 0x10001000L, 0x00401008L,
13386d7f5d3SJohn Marino 0x00400008L, 0x00401000L, 0x10400000L, 0x10001008L,
13486d7f5d3SJohn Marino 0x00001008L, 0x10000000L, 0x10000008L, 0x10401000L,
13586d7f5d3SJohn Marino },{
13686d7f5d3SJohn Marino /* nibble 4 */
13786d7f5d3SJohn Marino 0x08000000L, 0x00010000L, 0x00000400L, 0x08010420L,
13886d7f5d3SJohn Marino 0x08010020L, 0x08000400L, 0x00010420L, 0x08010000L,
13986d7f5d3SJohn Marino 0x00010000L, 0x00000020L, 0x08000020L, 0x00010400L,
14086d7f5d3SJohn Marino 0x08000420L, 0x08010020L, 0x08010400L, 0x00000000L,
14186d7f5d3SJohn Marino 0x00010400L, 0x08000000L, 0x00010020L, 0x00000420L,
14286d7f5d3SJohn Marino 0x08000400L, 0x00010420L, 0x00000000L, 0x08000020L,
14386d7f5d3SJohn Marino 0x00000020L, 0x08000420L, 0x08010420L, 0x00010020L,
14486d7f5d3SJohn Marino 0x08010000L, 0x00000400L, 0x00000420L, 0x08010400L,
14586d7f5d3SJohn Marino 0x08010400L, 0x08000420L, 0x00010020L, 0x08010000L,
14686d7f5d3SJohn Marino 0x00010000L, 0x00000020L, 0x08000020L, 0x08000400L,
14786d7f5d3SJohn Marino 0x08000000L, 0x00010400L, 0x08010420L, 0x00000000L,
14886d7f5d3SJohn Marino 0x00010420L, 0x08000000L, 0x00000400L, 0x00010020L,
14986d7f5d3SJohn Marino 0x08000420L, 0x00000400L, 0x00000000L, 0x08010420L,
15086d7f5d3SJohn Marino 0x08010020L, 0x08010400L, 0x00000420L, 0x00010000L,
15186d7f5d3SJohn Marino 0x00010400L, 0x08010020L, 0x08000400L, 0x00000420L,
15286d7f5d3SJohn Marino 0x00000020L, 0x00010420L, 0x08010000L, 0x08000020L,
15386d7f5d3SJohn Marino },{
15486d7f5d3SJohn Marino /* nibble 5 */
15586d7f5d3SJohn Marino 0x80000040L, 0x00200040L, 0x00000000L, 0x80202000L,
15686d7f5d3SJohn Marino 0x00200040L, 0x00002000L, 0x80002040L, 0x00200000L,
15786d7f5d3SJohn Marino 0x00002040L, 0x80202040L, 0x00202000L, 0x80000000L,
15886d7f5d3SJohn Marino 0x80002000L, 0x80000040L, 0x80200000L, 0x00202040L,
15986d7f5d3SJohn Marino 0x00200000L, 0x80002040L, 0x80200040L, 0x00000000L,
16086d7f5d3SJohn Marino 0x00002000L, 0x00000040L, 0x80202000L, 0x80200040L,
16186d7f5d3SJohn Marino 0x80202040L, 0x80200000L, 0x80000000L, 0x00002040L,
16286d7f5d3SJohn Marino 0x00000040L, 0x00202000L, 0x00202040L, 0x80002000L,
16386d7f5d3SJohn Marino 0x00002040L, 0x80000000L, 0x80002000L, 0x00202040L,
16486d7f5d3SJohn Marino 0x80202000L, 0x00200040L, 0x00000000L, 0x80002000L,
16586d7f5d3SJohn Marino 0x80000000L, 0x00002000L, 0x80200040L, 0x00200000L,
16686d7f5d3SJohn Marino 0x00200040L, 0x80202040L, 0x00202000L, 0x00000040L,
16786d7f5d3SJohn Marino 0x80202040L, 0x00202000L, 0x00200000L, 0x80002040L,
16886d7f5d3SJohn Marino 0x80000040L, 0x80200000L, 0x00202040L, 0x00000000L,
16986d7f5d3SJohn Marino 0x00002000L, 0x80000040L, 0x80002040L, 0x80202000L,
17086d7f5d3SJohn Marino 0x80200000L, 0x00002040L, 0x00000040L, 0x80200040L,
17186d7f5d3SJohn Marino },{
17286d7f5d3SJohn Marino /* nibble 6 */
17386d7f5d3SJohn Marino 0x00004000L, 0x00000200L, 0x01000200L, 0x01000004L,
17486d7f5d3SJohn Marino 0x01004204L, 0x00004004L, 0x00004200L, 0x00000000L,
17586d7f5d3SJohn Marino 0x01000000L, 0x01000204L, 0x00000204L, 0x01004000L,
17686d7f5d3SJohn Marino 0x00000004L, 0x01004200L, 0x01004000L, 0x00000204L,
17786d7f5d3SJohn Marino 0x01000204L, 0x00004000L, 0x00004004L, 0x01004204L,
17886d7f5d3SJohn Marino 0x00000000L, 0x01000200L, 0x01000004L, 0x00004200L,
17986d7f5d3SJohn Marino 0x01004004L, 0x00004204L, 0x01004200L, 0x00000004L,
18086d7f5d3SJohn Marino 0x00004204L, 0x01004004L, 0x00000200L, 0x01000000L,
18186d7f5d3SJohn Marino 0x00004204L, 0x01004000L, 0x01004004L, 0x00000204L,
18286d7f5d3SJohn Marino 0x00004000L, 0x00000200L, 0x01000000L, 0x01004004L,
18386d7f5d3SJohn Marino 0x01000204L, 0x00004204L, 0x00004200L, 0x00000000L,
18486d7f5d3SJohn Marino 0x00000200L, 0x01000004L, 0x00000004L, 0x01000200L,
18586d7f5d3SJohn Marino 0x00000000L, 0x01000204L, 0x01000200L, 0x00004200L,
18686d7f5d3SJohn Marino 0x00000204L, 0x00004000L, 0x01004204L, 0x01000000L,
18786d7f5d3SJohn Marino 0x01004200L, 0x00000004L, 0x00004004L, 0x01004204L,
18886d7f5d3SJohn Marino 0x01000004L, 0x01004200L, 0x01004000L, 0x00004004L,
18986d7f5d3SJohn Marino },{
19086d7f5d3SJohn Marino /* nibble 7 */
19186d7f5d3SJohn Marino 0x20800080L, 0x20820000L, 0x00020080L, 0x00000000L,
19286d7f5d3SJohn Marino 0x20020000L, 0x00800080L, 0x20800000L, 0x20820080L,
19386d7f5d3SJohn Marino 0x00000080L, 0x20000000L, 0x00820000L, 0x00020080L,
19486d7f5d3SJohn Marino 0x00820080L, 0x20020080L, 0x20000080L, 0x20800000L,
19586d7f5d3SJohn Marino 0x00020000L, 0x00820080L, 0x00800080L, 0x20020000L,
19686d7f5d3SJohn Marino 0x20820080L, 0x20000080L, 0x00000000L, 0x00820000L,
19786d7f5d3SJohn Marino 0x20000000L, 0x00800000L, 0x20020080L, 0x20800080L,
19886d7f5d3SJohn Marino 0x00800000L, 0x00020000L, 0x20820000L, 0x00000080L,
19986d7f5d3SJohn Marino 0x00800000L, 0x00020000L, 0x20000080L, 0x20820080L,
20086d7f5d3SJohn Marino 0x00020080L, 0x20000000L, 0x00000000L, 0x00820000L,
20186d7f5d3SJohn Marino 0x20800080L, 0x20020080L, 0x20020000L, 0x00800080L,
20286d7f5d3SJohn Marino 0x20820000L, 0x00000080L, 0x00800080L, 0x20020000L,
20386d7f5d3SJohn Marino 0x20820080L, 0x00800000L, 0x20800000L, 0x20000080L,
20486d7f5d3SJohn Marino 0x00820000L, 0x00020080L, 0x20020080L, 0x20800000L,
20586d7f5d3SJohn Marino 0x00000080L, 0x20820000L, 0x00820080L, 0x00000000L,
20686d7f5d3SJohn Marino 0x20000000L, 0x20800080L, 0x00020000L, 0x00820080L,
20786d7f5d3SJohn Marino }};
208