Home | History | Annotate | Line # | Download | only in des
      1  1.1  thorpej /* crypto/des/spr.h */
      2  1.2      tls /* Copyright (C) 1995-1998 Eric Young (eay (at) cryptsoft.com)
      3  1.1  thorpej  * All rights reserved.
      4  1.1  thorpej  *
      5  1.2      tls  * This package is an SSL implementation written
      6  1.2      tls  * by Eric Young (eay (at) cryptsoft.com).
      7  1.2      tls  * The implementation was written so as to conform with Netscapes SSL.
      8  1.3    perry  *
      9  1.2      tls  * This library is free for commercial and non-commercial use as long as
     10  1.2      tls  * the following conditions are aheared to.  The following conditions
     11  1.2      tls  * apply to all code found in this distribution, be it the RC4, RSA,
     12  1.2      tls  * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
     13  1.2      tls  * included with this distribution is covered by the same copyright terms
     14  1.2      tls  * except that the holder is Tim Hudson (tjh (at) cryptsoft.com).
     15  1.3    perry  *
     16  1.1  thorpej  * Copyright remains Eric Young's, and as such any Copyright notices in
     17  1.2      tls  * the code are not to be removed.
     18  1.2      tls  * If this package is used in a product, Eric Young should be given attribution
     19  1.2      tls  * as the author of the parts of the library used.
     20  1.1  thorpej  * This can be in the form of a textual message at program startup or
     21  1.1  thorpej  * in documentation (online or textual) provided with the package.
     22  1.3    perry  *
     23  1.1  thorpej  * Redistribution and use in source and binary forms, with or without
     24  1.1  thorpej  * modification, are permitted provided that the following conditions
     25  1.1  thorpej  * are met:
     26  1.1  thorpej  * 1. Redistributions of source code must retain the copyright
     27  1.1  thorpej  *    notice, this list of conditions and the following disclaimer.
     28  1.1  thorpej  * 2. Redistributions in binary form must reproduce the above copyright
     29  1.1  thorpej  *    notice, this list of conditions and the following disclaimer in the
     30  1.1  thorpej  *    documentation and/or other materials provided with the distribution.
     31  1.1  thorpej  * 3. All advertising materials mentioning features or use of this software
     32  1.1  thorpej  *    must display the following acknowledgement:
     33  1.2      tls  *    "This product includes cryptographic software written by
     34  1.2      tls  *     Eric Young (eay (at) cryptsoft.com)"
     35  1.2      tls  *    The word 'cryptographic' can be left out if the rouines from the library
     36  1.2      tls  *    being used are not cryptographic related :-).
     37  1.3    perry  * 4. If you include any Windows specific code (or a derivative thereof) from
     38  1.2      tls  *    the apps directory (application code) you must include an acknowledgement:
     39  1.2      tls  *    "This product includes software written by Tim Hudson (tjh (at) cryptsoft.com)"
     40  1.3    perry  *
     41  1.1  thorpej  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
     42  1.1  thorpej  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     43  1.1  thorpej  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     44  1.1  thorpej  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
     45  1.1  thorpej  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     46  1.1  thorpej  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     47  1.1  thorpej  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     48  1.1  thorpej  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     49  1.1  thorpej  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     50  1.1  thorpej  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     51  1.1  thorpej  * SUCH DAMAGE.
     52  1.3    perry  *
     53  1.1  thorpej  * The licence and distribution terms for any publically available version or
     54  1.1  thorpej  * derivative of this code cannot be changed.  i.e. this code cannot simply be
     55  1.1  thorpej  * copied and put under another distribution licence
     56  1.1  thorpej  * [including the GNU Public Licence.]
     57  1.1  thorpej  */
     58  1.1  thorpej 
     59  1.2      tls const DES_LONG des_SPtrans[8][64]={
     60  1.1  thorpej {
     61  1.1  thorpej /* nibble 0 */
     62  1.2      tls 0x02080800L, 0x00080000L, 0x02000002L, 0x02080802L,
     63  1.2      tls 0x02000000L, 0x00080802L, 0x00080002L, 0x02000002L,
     64  1.2      tls 0x00080802L, 0x02080800L, 0x02080000L, 0x00000802L,
     65  1.2      tls 0x02000802L, 0x02000000L, 0x00000000L, 0x00080002L,
     66  1.2      tls 0x00080000L, 0x00000002L, 0x02000800L, 0x00080800L,
     67  1.2      tls 0x02080802L, 0x02080000L, 0x00000802L, 0x02000800L,
     68  1.2      tls 0x00000002L, 0x00000800L, 0x00080800L, 0x02080002L,
     69  1.2      tls 0x00000800L, 0x02000802L, 0x02080002L, 0x00000000L,
     70  1.2      tls 0x00000000L, 0x02080802L, 0x02000800L, 0x00080002L,
     71  1.2      tls 0x02080800L, 0x00080000L, 0x00000802L, 0x02000800L,
     72  1.2      tls 0x02080002L, 0x00000800L, 0x00080800L, 0x02000002L,
     73  1.2      tls 0x00080802L, 0x00000002L, 0x02000002L, 0x02080000L,
     74  1.2      tls 0x02080802L, 0x00080800L, 0x02080000L, 0x02000802L,
     75  1.2      tls 0x02000000L, 0x00000802L, 0x00080002L, 0x00000000L,
     76  1.2      tls 0x00080000L, 0x02000000L, 0x02000802L, 0x02080800L,
     77  1.2      tls 0x00000002L, 0x02080002L, 0x00000800L, 0x00080802L,
     78  1.1  thorpej },{
     79  1.1  thorpej /* nibble 1 */
     80  1.2      tls 0x40108010L, 0x00000000L, 0x00108000L, 0x40100000L,
     81  1.2      tls 0x40000010L, 0x00008010L, 0x40008000L, 0x00108000L,
     82  1.2      tls 0x00008000L, 0x40100010L, 0x00000010L, 0x40008000L,
     83  1.2      tls 0x00100010L, 0x40108000L, 0x40100000L, 0x00000010L,
     84  1.2      tls 0x00100000L, 0x40008010L, 0x40100010L, 0x00008000L,
     85  1.2      tls 0x00108010L, 0x40000000L, 0x00000000L, 0x00100010L,
     86  1.2      tls 0x40008010L, 0x00108010L, 0x40108000L, 0x40000010L,
     87  1.2      tls 0x40000000L, 0x00100000L, 0x00008010L, 0x40108010L,
     88  1.2      tls 0x00100010L, 0x40108000L, 0x40008000L, 0x00108010L,
     89  1.2      tls 0x40108010L, 0x00100010L, 0x40000010L, 0x00000000L,
     90  1.2      tls 0x40000000L, 0x00008010L, 0x00100000L, 0x40100010L,
     91  1.2      tls 0x00008000L, 0x40000000L, 0x00108010L, 0x40008010L,
     92  1.2      tls 0x40108000L, 0x00008000L, 0x00000000L, 0x40000010L,
     93  1.2      tls 0x00000010L, 0x40108010L, 0x00108000L, 0x40100000L,
     94  1.2      tls 0x40100010L, 0x00100000L, 0x00008010L, 0x40008000L,
     95  1.2      tls 0x40008010L, 0x00000010L, 0x40100000L, 0x00108000L,
     96  1.1  thorpej },{
     97  1.1  thorpej /* nibble 2 */
     98  1.2      tls 0x04000001L, 0x04040100L, 0x00000100L, 0x04000101L,
     99  1.2      tls 0x00040001L, 0x04000000L, 0x04000101L, 0x00040100L,
    100  1.2      tls 0x04000100L, 0x00040000L, 0x04040000L, 0x00000001L,
    101  1.2      tls 0x04040101L, 0x00000101L, 0x00000001L, 0x04040001L,
    102  1.2      tls 0x00000000L, 0x00040001L, 0x04040100L, 0x00000100L,
    103  1.2      tls 0x00000101L, 0x04040101L, 0x00040000L, 0x04000001L,
    104  1.2      tls 0x04040001L, 0x04000100L, 0x00040101L, 0x04040000L,
    105  1.2      tls 0x00040100L, 0x00000000L, 0x04000000L, 0x00040101L,
    106  1.2      tls 0x04040100L, 0x00000100L, 0x00000001L, 0x00040000L,
    107  1.2      tls 0x00000101L, 0x00040001L, 0x04040000L, 0x04000101L,
    108  1.2      tls 0x00000000L, 0x04040100L, 0x00040100L, 0x04040001L,
    109  1.2      tls 0x00040001L, 0x04000000L, 0x04040101L, 0x00000001L,
    110  1.2      tls 0x00040101L, 0x04000001L, 0x04000000L, 0x04040101L,
    111  1.2      tls 0x00040000L, 0x04000100L, 0x04000101L, 0x00040100L,
    112  1.2      tls 0x04000100L, 0x00000000L, 0x04040001L, 0x00000101L,
    113  1.2      tls 0x04000001L, 0x00040101L, 0x00000100L, 0x04040000L,
    114  1.1  thorpej },{
    115  1.1  thorpej /* nibble 3 */
    116  1.2      tls 0x00401008L, 0x10001000L, 0x00000008L, 0x10401008L,
    117  1.2      tls 0x00000000L, 0x10400000L, 0x10001008L, 0x00400008L,
    118  1.2      tls 0x10401000L, 0x10000008L, 0x10000000L, 0x00001008L,
    119  1.2      tls 0x10000008L, 0x00401008L, 0x00400000L, 0x10000000L,
    120  1.2      tls 0x10400008L, 0x00401000L, 0x00001000L, 0x00000008L,
    121  1.2      tls 0x00401000L, 0x10001008L, 0x10400000L, 0x00001000L,
    122  1.2      tls 0x00001008L, 0x00000000L, 0x00400008L, 0x10401000L,
    123  1.2      tls 0x10001000L, 0x10400008L, 0x10401008L, 0x00400000L,
    124  1.2      tls 0x10400008L, 0x00001008L, 0x00400000L, 0x10000008L,
    125  1.2      tls 0x00401000L, 0x10001000L, 0x00000008L, 0x10400000L,
    126  1.2      tls 0x10001008L, 0x00000000L, 0x00001000L, 0x00400008L,
    127  1.2      tls 0x00000000L, 0x10400008L, 0x10401000L, 0x00001000L,
    128  1.2      tls 0x10000000L, 0x10401008L, 0x00401008L, 0x00400000L,
    129  1.2      tls 0x10401008L, 0x00000008L, 0x10001000L, 0x00401008L,
    130  1.2      tls 0x00400008L, 0x00401000L, 0x10400000L, 0x10001008L,
    131  1.2      tls 0x00001008L, 0x10000000L, 0x10000008L, 0x10401000L,
    132  1.1  thorpej },{
    133  1.1  thorpej /* nibble 4 */
    134  1.2      tls 0x08000000L, 0x00010000L, 0x00000400L, 0x08010420L,
    135  1.2      tls 0x08010020L, 0x08000400L, 0x00010420L, 0x08010000L,
    136  1.2      tls 0x00010000L, 0x00000020L, 0x08000020L, 0x00010400L,
    137  1.2      tls 0x08000420L, 0x08010020L, 0x08010400L, 0x00000000L,
    138  1.2      tls 0x00010400L, 0x08000000L, 0x00010020L, 0x00000420L,
    139  1.2      tls 0x08000400L, 0x00010420L, 0x00000000L, 0x08000020L,
    140  1.2      tls 0x00000020L, 0x08000420L, 0x08010420L, 0x00010020L,
    141  1.2      tls 0x08010000L, 0x00000400L, 0x00000420L, 0x08010400L,
    142  1.2      tls 0x08010400L, 0x08000420L, 0x00010020L, 0x08010000L,
    143  1.2      tls 0x00010000L, 0x00000020L, 0x08000020L, 0x08000400L,
    144  1.2      tls 0x08000000L, 0x00010400L, 0x08010420L, 0x00000000L,
    145  1.2      tls 0x00010420L, 0x08000000L, 0x00000400L, 0x00010020L,
    146  1.2      tls 0x08000420L, 0x00000400L, 0x00000000L, 0x08010420L,
    147  1.2      tls 0x08010020L, 0x08010400L, 0x00000420L, 0x00010000L,
    148  1.2      tls 0x00010400L, 0x08010020L, 0x08000400L, 0x00000420L,
    149  1.2      tls 0x00000020L, 0x00010420L, 0x08010000L, 0x08000020L,
    150  1.1  thorpej },{
    151  1.1  thorpej /* nibble 5 */
    152  1.2      tls 0x80000040L, 0x00200040L, 0x00000000L, 0x80202000L,
    153  1.2      tls 0x00200040L, 0x00002000L, 0x80002040L, 0x00200000L,
    154  1.2      tls 0x00002040L, 0x80202040L, 0x00202000L, 0x80000000L,
    155  1.2      tls 0x80002000L, 0x80000040L, 0x80200000L, 0x00202040L,
    156  1.2      tls 0x00200000L, 0x80002040L, 0x80200040L, 0x00000000L,
    157  1.2      tls 0x00002000L, 0x00000040L, 0x80202000L, 0x80200040L,
    158  1.2      tls 0x80202040L, 0x80200000L, 0x80000000L, 0x00002040L,
    159  1.2      tls 0x00000040L, 0x00202000L, 0x00202040L, 0x80002000L,
    160  1.2      tls 0x00002040L, 0x80000000L, 0x80002000L, 0x00202040L,
    161  1.2      tls 0x80202000L, 0x00200040L, 0x00000000L, 0x80002000L,
    162  1.2      tls 0x80000000L, 0x00002000L, 0x80200040L, 0x00200000L,
    163  1.2      tls 0x00200040L, 0x80202040L, 0x00202000L, 0x00000040L,
    164  1.2      tls 0x80202040L, 0x00202000L, 0x00200000L, 0x80002040L,
    165  1.2      tls 0x80000040L, 0x80200000L, 0x00202040L, 0x00000000L,
    166  1.2      tls 0x00002000L, 0x80000040L, 0x80002040L, 0x80202000L,
    167  1.2      tls 0x80200000L, 0x00002040L, 0x00000040L, 0x80200040L,
    168  1.1  thorpej },{
    169  1.1  thorpej /* nibble 6 */
    170  1.2      tls 0x00004000L, 0x00000200L, 0x01000200L, 0x01000004L,
    171  1.2      tls 0x01004204L, 0x00004004L, 0x00004200L, 0x00000000L,
    172  1.2      tls 0x01000000L, 0x01000204L, 0x00000204L, 0x01004000L,
    173  1.2      tls 0x00000004L, 0x01004200L, 0x01004000L, 0x00000204L,
    174  1.2      tls 0x01000204L, 0x00004000L, 0x00004004L, 0x01004204L,
    175  1.2      tls 0x00000000L, 0x01000200L, 0x01000004L, 0x00004200L,
    176  1.2      tls 0x01004004L, 0x00004204L, 0x01004200L, 0x00000004L,
    177  1.2      tls 0x00004204L, 0x01004004L, 0x00000200L, 0x01000000L,
    178  1.2      tls 0x00004204L, 0x01004000L, 0x01004004L, 0x00000204L,
    179  1.2      tls 0x00004000L, 0x00000200L, 0x01000000L, 0x01004004L,
    180  1.2      tls 0x01000204L, 0x00004204L, 0x00004200L, 0x00000000L,
    181  1.2      tls 0x00000200L, 0x01000004L, 0x00000004L, 0x01000200L,
    182  1.2      tls 0x00000000L, 0x01000204L, 0x01000200L, 0x00004200L,
    183  1.2      tls 0x00000204L, 0x00004000L, 0x01004204L, 0x01000000L,
    184  1.2      tls 0x01004200L, 0x00000004L, 0x00004004L, 0x01004204L,
    185  1.2      tls 0x01000004L, 0x01004200L, 0x01004000L, 0x00004004L,
    186  1.1  thorpej },{
    187  1.1  thorpej /* nibble 7 */
    188  1.2      tls 0x20800080L, 0x20820000L, 0x00020080L, 0x00000000L,
    189  1.2      tls 0x20020000L, 0x00800080L, 0x20800000L, 0x20820080L,
    190  1.2      tls 0x00000080L, 0x20000000L, 0x00820000L, 0x00020080L,
    191  1.2      tls 0x00820080L, 0x20020080L, 0x20000080L, 0x20800000L,
    192  1.2      tls 0x00020000L, 0x00820080L, 0x00800080L, 0x20020000L,
    193  1.2      tls 0x20820080L, 0x20000080L, 0x00000000L, 0x00820000L,
    194  1.2      tls 0x20000000L, 0x00800000L, 0x20020080L, 0x20800080L,
    195  1.2      tls 0x00800000L, 0x00020000L, 0x20820000L, 0x00000080L,
    196  1.2      tls 0x00800000L, 0x00020000L, 0x20000080L, 0x20820080L,
    197  1.2      tls 0x00020080L, 0x20000000L, 0x00000000L, 0x00820000L,
    198  1.2      tls 0x20800080L, 0x20020080L, 0x20020000L, 0x00800080L,
    199  1.2      tls 0x20820000L, 0x00000080L, 0x00800080L, 0x20020000L,
    200  1.2      tls 0x20820080L, 0x00800000L, 0x20800000L, 0x20000080L,
    201  1.2      tls 0x00820000L, 0x00020080L, 0x20020080L, 0x20800000L,
    202  1.2      tls 0x00000080L, 0x20820000L, 0x00820080L, 0x00000000L,
    203  1.2      tls 0x20000000L, 0x20800080L, 0x00020000L, 0x00820080L,
    204  1.1  thorpej }};
    205