spr.h 9.2 KB

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