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