BFISH.CPP 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***********************************************************************************************
  19. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Blowfish Component *
  23. * *
  24. * $Archive:: /Commando/Code/Launcher/BFISH.CPP $*
  25. * *
  26. * $Author:: Denzil_l $*
  27. * *
  28. * $Modtime:: 12/02/97 9:35p $*
  29. * *
  30. * $Revision:: 1 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * BlowfishEngine::Decrypt -- Decrypts data using blowfish algorithm. *
  35. * BlowfishEngine::Encrypt -- Encrypt an arbitrary block of data. *
  36. * BlowfishEngine::Process_Block -- Process a block of data using Blowfish algorithm. *
  37. * BlowfishEngine::Sub_Key_Encrypt -- Encrypts a block for use in S-Box processing. *
  38. * BlowfishEngine::Submit_Key -- Submit a key that will allow data processing. *
  39. * BlowfishEngine::~BlowfishEngine -- Destructor for the Blowfish engine. *
  40. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  41. #pragma warning(disable : 4514)
  42. #include "bfish.h"
  43. #include <string.h>
  44. #include <assert.h>
  45. /*
  46. ** Byte order controlled long integer. This integer is constructed
  47. ** so that character 0 (C0) is the most significant byte of the
  48. ** integer. This is biased toward big endian architecture, but that
  49. ** just happens to be how the Blowfish algorithm was designed.
  50. */
  51. typedef union {
  52. unsigned long Long;
  53. struct {
  54. unsigned char C3;
  55. unsigned char C2;
  56. unsigned char C1;
  57. unsigned char C0;
  58. } Char;
  59. } Int;
  60. /***********************************************************************************************
  61. * BlowfishEngine::~BlowfishEngine -- Destructor for the Blowfish engine. *
  62. * *
  63. * This destructor will clear out the s-box tables so that even if the memory for the *
  64. * class remains, it will contain no compromising data. *
  65. * *
  66. * INPUT: none *
  67. * *
  68. * OUTPUT: none *
  69. * *
  70. * WARNINGS: none *
  71. * *
  72. * HISTORY: *
  73. * 07/08/1996 JLB : Created. *
  74. *=============================================================================================*/
  75. BlowfishEngine::~BlowfishEngine(void)
  76. {
  77. if (IsKeyed) {
  78. Submit_Key(NULL, 0);
  79. }
  80. }
  81. /***********************************************************************************************
  82. * BlowfishEngine::Submit_Key -- Submit a key that will allow data processing. *
  83. * *
  84. * This routine must be called before any data can be encrypted or decrypted. This routine *
  85. * need only be called when the key is to be changed or set for the first time. Once the *
  86. * key has been set, the engine may be used to encrypt, decrypt, or both operations *
  87. * indefinitely. The key must be 56 bytes or less in length. This is necessary because *
  88. * any keys longer than that will not correctly affect the encryption process. *
  89. * *
  90. * If the key pointer is NULL, then the S-Box tables are reset to identity. This will *
  91. * mask the previous key setting. Use this method to clear the engine after processing in *
  92. * order to gain a measure of security. *
  93. * *
  94. * INPUT: key -- Pointer to the key data block. *
  95. * *
  96. * length -- The length of the submitted key. *
  97. * *
  98. * OUTPUT: none *
  99. * *
  100. * WARNINGS: This is a time consuming process. *
  101. * *
  102. * HISTORY: *
  103. * 04/14/1996 JLB : Created. *
  104. *=============================================================================================*/
  105. void BlowfishEngine::Submit_Key(void const * key, int length)
  106. {
  107. assert(length <= MAX_KEY_LENGTH);
  108. /*
  109. ** Initialize the permutation and S-Box tables to a known
  110. ** constant value.
  111. */
  112. memcpy(P_Encrypt, P_Init, sizeof(P_Init));
  113. memcpy(P_Decrypt, P_Init, sizeof(P_Init));
  114. memcpy(bf_S, S_Init, sizeof(S_Init));
  115. /*
  116. ** Validate parameters.
  117. */
  118. if (key == 0 || length == 0) {
  119. IsKeyed = false;
  120. return;
  121. }
  122. /*
  123. ** Combine the key with the permutation table. Wrap the key
  124. ** as many times as necessary to ensure that the entire
  125. ** permutation table has been modified. The key is lifted
  126. ** into a long by using endian independent means.
  127. */
  128. int j = 0;
  129. unsigned char const * key_ptr = (unsigned char const *)key;
  130. unsigned long * p_ptr = &P_Encrypt[0];
  131. for (int index = 0; index < ROUNDS+2; index++) {
  132. unsigned long data = 0;
  133. data = (data << CHAR_BIT) | key_ptr[j++ % length];
  134. data = (data << CHAR_BIT) | key_ptr[j++ % length];
  135. data = (data << CHAR_BIT) | key_ptr[j++ % length];
  136. data = (data << CHAR_BIT) | key_ptr[j++ % length];
  137. *p_ptr++ ^= data;
  138. }
  139. /*
  140. ** The permutation table must be scrambled by means of the key. This
  141. ** is how the key is factored into the encryption -- by merely altering
  142. ** the permutation (and S-Box) tables. Because this transformation alters
  143. ** the table data WHILE it is using the table data, the tables are
  144. ** thoroughly obfuscated by this process.
  145. */
  146. unsigned long left = 0x00000000L;
  147. unsigned long right = 0x00000000L;
  148. unsigned long * p_en = &P_Encrypt[0]; // Encryption table.
  149. unsigned long * p_de = &P_Decrypt[ROUNDS+1]; // Decryption table.
  150. for (int p_index = 0; p_index < ROUNDS+2; p_index += 2) {
  151. Sub_Key_Encrypt(left, right);
  152. *p_en++ = left;
  153. *p_en++ = right;
  154. *p_de-- = left;
  155. *p_de-- = right;
  156. }
  157. /*
  158. ** Perform a similar transmutation to the S-Box tables. Also notice that the
  159. ** working 64 bit number is carried into this process from the previous
  160. ** operation.
  161. */
  162. for (int sbox_index = 0; sbox_index < 4; sbox_index++) {
  163. for (int ss_index = 0; ss_index < UCHAR_MAX+1; ss_index += 2) {
  164. Sub_Key_Encrypt(left, right);
  165. bf_S[sbox_index][ss_index] = left;
  166. bf_S[sbox_index][ss_index + 1] = right;
  167. }
  168. }
  169. IsKeyed = true;
  170. }
  171. /***********************************************************************************************
  172. * BlowfishEngine::Encrypt -- Encrypt an arbitrary block of data. *
  173. * *
  174. * Use this routine to encrypt an arbitrary block of data. The block must be an even *
  175. * multiple of 8 bytes. Any bytes left over will not be encrypted. The 8 byte requirement *
  176. * is necessary because the underlying algorithm processes blocks in 8 byte chunks. *
  177. * Partial blocks are unrecoverable and useless. *
  178. * *
  179. * INPUT: plaintext-- Pointer to the data block to be encrypted. *
  180. * *
  181. * length -- The length of the data block. *
  182. * *
  183. * cyphertext- Pointer to the output buffer that will hold the encrypted data. *
  184. * *
  185. * OUTPUT: Returns with the actual number of bytes encrypted. *
  186. * *
  187. * WARNINGS: You must submit the key before calling this routine. This will only encrypt *
  188. * the plaintext in 8 byte increments. Modulo bytes left over are not processed. *
  189. * *
  190. * HISTORY: *
  191. * 04/14/1996 JLB : Created. *
  192. *=============================================================================================*/
  193. int BlowfishEngine::Encrypt(void const * plaintext, int length, void * cyphertext)
  194. {
  195. if (plaintext == 0 || length == 0) {
  196. return(0);
  197. }
  198. if (cyphertext == 0) cyphertext = (void *)plaintext;
  199. if (IsKeyed) {
  200. /*
  201. ** Validate parameters.
  202. */
  203. int blocks = length / BYTES_PER_BLOCK;
  204. /*
  205. ** Process the buffer in 64 bit chunks.
  206. */
  207. for (int index = 0; index < blocks; index++) {
  208. Process_Block(plaintext, cyphertext, P_Encrypt);
  209. plaintext = ((char *)plaintext) + BYTES_PER_BLOCK;
  210. cyphertext = ((char *)cyphertext) + BYTES_PER_BLOCK;
  211. }
  212. int encrypted = blocks * BYTES_PER_BLOCK;
  213. /*
  214. ** Copy over any trailing left over appendix bytes.
  215. */
  216. if (encrypted < length) {
  217. memmove(cyphertext, plaintext, length - encrypted);
  218. }
  219. return(encrypted);
  220. }
  221. /*
  222. ** Non-keyed processing merely copies the data.
  223. */
  224. if (plaintext != cyphertext) {
  225. memmove(cyphertext, plaintext, length);
  226. }
  227. return(length);
  228. }
  229. /***********************************************************************************************
  230. * BlowfishEngine::Decrypt -- Decrypt an arbitrary block of data. *
  231. * *
  232. * Use this routine to decrypt an arbitrary block of data. The block must be an even *
  233. * multiple of 8 bytes. Any bytes left over will not be decrypted. The 8 byte requirement *
  234. * is necessary because the underlying algorithm processes blocks in 8 byte chunks. *
  235. * Partial blocks are unrecoverable and useless. *
  236. * *
  237. * INPUT: cyphertext- Pointer to the data block to be decrypted. *
  238. * *
  239. * length -- The length of the data block. *
  240. * *
  241. * plaintext-- Pointer to the output buffer that will hold the decrypted data. *
  242. * *
  243. * OUTPUT: Returns with the actual number of bytes decrypted. *
  244. * *
  245. * WARNINGS: You must submit the key before calling this routine. This will only decrypt *
  246. * the cyphertext in 8 byte increments. Modulo bytes left over are not processed. *
  247. * *
  248. * HISTORY: *
  249. * 04/14/1996 JLB : Created. *
  250. *=============================================================================================*/
  251. int BlowfishEngine::Decrypt(void const * cyphertext, int length, void * plaintext)
  252. {
  253. if (cyphertext == 0 || length == 0) {
  254. return(0);
  255. }
  256. if (plaintext == 0) plaintext = (void *)cyphertext;
  257. if (IsKeyed) {
  258. /*
  259. ** Validate parameters.
  260. */
  261. int blocks = length / BYTES_PER_BLOCK;
  262. /*
  263. ** Process the buffer in 64 bit chunks.
  264. */
  265. for (int index = 0; index < blocks; index++) {
  266. Process_Block(cyphertext, plaintext, P_Decrypt);
  267. cyphertext = ((char *)cyphertext) + BYTES_PER_BLOCK;
  268. plaintext = ((char *)plaintext) + BYTES_PER_BLOCK;
  269. }
  270. int encrypted = blocks * BYTES_PER_BLOCK;
  271. /*
  272. ** Copy over any trailing left over appendix bytes.
  273. */
  274. if (encrypted < length) {
  275. memmove(plaintext, cyphertext, length - encrypted);
  276. }
  277. return(encrypted);
  278. }
  279. /*
  280. ** Non-keyed processing merely copies the data.
  281. */
  282. if (plaintext != cyphertext) {
  283. memmove(plaintext, cyphertext, length);
  284. }
  285. return(length);
  286. }
  287. /***********************************************************************************************
  288. * BlowfishEngine::Process_Block -- Process a block of data using Blowfish algorithm. *
  289. * *
  290. * This is the main processing routine for encryption and decryption. The algorithm *
  291. * consists of a 16 round Feistal network and uses mathematics from different algebraic *
  292. * groups (strengthens against differential cryptanalysis). The large S-Boxes and the *
  293. * rounds strengthen it against linear cryptanalysis. *
  294. * *
  295. * INPUT: plaintext -- Pointer to the source text (it actually might be a pointer to *
  296. * the cyphertext if this is called as a decryption process). *
  297. * *
  298. * cyphertext -- Pointer to the output buffer that will hold the processed block. *
  299. * *
  300. * ptable -- Pointer to the permutation table. This algorithm will encrypt *
  301. * and decrypt using the same S-Box tables. The encryption control *
  302. * is handled by the permutation table. *
  303. * *
  304. * OUTPUT: none *
  305. * *
  306. * WARNINGS: The source and destination buffers must be 8 bytes long. *
  307. * *
  308. * HISTORY: *
  309. * 04/19/1996 JLB : Created. *
  310. *=============================================================================================*/
  311. void BlowfishEngine::Process_Block(void const * plaintext, void * cyphertext, unsigned long const * ptable)
  312. {
  313. /*
  314. ** Input the left and right halves of the source block such that
  315. ** the byte order is constant regardless of the endian
  316. ** persuasion of the current processor. The blowfish algorithm is
  317. ** biased toward "big endian" architecture and some optimizations
  318. ** could be done for big endian processors in that case.
  319. */
  320. unsigned char const * source = (unsigned char const *)plaintext;
  321. Int left;
  322. left.Char.C0 = *source++;
  323. left.Char.C1 = *source++;
  324. left.Char.C2 = *source++;
  325. left.Char.C3 = *source++;
  326. Int right;
  327. right.Char.C0 = *source++;
  328. right.Char.C1 = *source++;
  329. right.Char.C2 = *source++;
  330. right.Char.C3 = *source;
  331. /*
  332. ** Perform all Feistal rounds on the block. This is the encryption/decryption
  333. ** process. Since there is an exchange that occurs after each round, two
  334. ** rounds are combined in this loop to avoid unnecessary exchanging.
  335. */
  336. for (int index = 0; index < ROUNDS/2; index++) {
  337. left.Long ^= *ptable++;
  338. right.Long ^= ((( bf_S[0][left.Char.C0] + bf_S[1][left.Char.C1]) ^ bf_S[2][left.Char.C2]) + bf_S[3][left.Char.C3]);
  339. right.Long ^= *ptable++;
  340. left.Long ^= ((( bf_S[0][right.Char.C0] + bf_S[1][right.Char.C1]) ^ bf_S[2][right.Char.C2]) + bf_S[3][right.Char.C3]);
  341. }
  342. /*
  343. ** The final two longs in the permutation table are processed into the block.
  344. ** The left and right halves are still reversed as a side effect of the last
  345. ** round.
  346. */
  347. left.Long ^= *ptable++;
  348. right.Long ^= *ptable;
  349. /*
  350. ** The final block data is output in endian architecture
  351. ** independent format. Notice that the blocks are output as
  352. ** right first and left second. This is to counteract the final
  353. ** superfluous exchange that occurs as a side effect of the
  354. ** encryption rounds.
  355. */
  356. unsigned char * out = (unsigned char *)cyphertext;
  357. *out++ = right.Char.C0;
  358. *out++ = right.Char.C1;
  359. *out++ = right.Char.C2;
  360. *out++ = right.Char.C3;
  361. *out++ = left.Char.C0;
  362. *out++ = left.Char.C1;
  363. *out++ = left.Char.C2;
  364. *out = left.Char.C3;
  365. }
  366. /***********************************************************************************************
  367. * BlowfishEngine::Sub_Key_Encrypt -- Encrypts a block for use in S-Box processing. *
  368. * *
  369. * This is the same as the normal process block function but it doesn't have the endian *
  370. * fixup logic. Since this routine is only called for S-Box table generation and it is *
  371. * known that the S-Box initial data is already in local machine endian format, the *
  372. * byte order fixups are not needed. This also has a tendency to speed up S-Box generation *
  373. * as well. *
  374. * *
  375. * INPUT: left -- The left half of the data block. *
  376. * *
  377. * right -- The right half of the data block. *
  378. * *
  379. * OUTPUT: none, but the processed block is stored back into the left and right half *
  380. * integers. *
  381. * *
  382. * WARNINGS: none *
  383. * *
  384. * HISTORY: *
  385. * 04/19/1996 JLB : Created. *
  386. *=============================================================================================*/
  387. void BlowfishEngine::Sub_Key_Encrypt(unsigned long & left, unsigned long & right)
  388. {
  389. Int l;
  390. l.Long = left;
  391. Int r;
  392. r.Long = right;
  393. for (int index = 0; index < ROUNDS; index += 2) {
  394. l.Long ^= P_Encrypt[index];
  395. r.Long ^= ((( bf_S[0][l.Char.C0] + bf_S[1][l.Char.C1]) ^ bf_S[2][l.Char.C2]) + bf_S[3][l.Char.C3]);
  396. r.Long ^= P_Encrypt[index+1];
  397. l.Long ^= ((( bf_S[0][r.Char.C0] + bf_S[1][r.Char.C1]) ^ bf_S[2][r.Char.C2]) + bf_S[3][r.Char.C3]);
  398. }
  399. left = r.Long ^ P_Encrypt[ROUNDS+1];
  400. right = l.Long ^ P_Encrypt[ROUNDS];
  401. }
  402. /*
  403. ** These tables have the bytes stored in machine endian format. Because of this,
  404. ** a special block cypher routine is needed when the sub-keys are generated.
  405. ** This is kludgier than it otherwise should be. However, storing these
  406. ** integers in machine independent format would be even more painful.
  407. */
  408. unsigned long const BlowfishEngine::P_Init[BlowfishEngine::ROUNDS+2] = {
  409. 0x243F6A88U,0x85A308D3U,0x13198A2EU,0x03707344U,0xA4093822U,0x299F31D0U,0x082EFA98U,0xEC4E6C89U,
  410. 0x452821E6U,0x38D01377U,0xBE5466CFU,0x34E90C6CU,0xC0AC29B7U,0xC97C50DDU,0x3F84D5B5U,0xB5470917U,
  411. 0x9216D5D9U,0x8979FB1BU
  412. };
  413. unsigned long const BlowfishEngine::S_Init[4][UCHAR_MAX+1] = {
  414. {
  415. 0xD1310BA6U,0x98DFB5ACU,0x2FFD72DBU,0xD01ADFB7U,0xB8E1AFEDU,0x6A267E96U,0xBA7C9045U,0xF12C7F99U,
  416. 0x24A19947U,0xB3916CF7U,0x0801F2E2U,0x858EFC16U,0x636920D8U,0x71574E69U,0xA458FEA3U,0xF4933D7EU,
  417. 0x0D95748FU,0x728EB658U,0x718BCD58U,0x82154AEEU,0x7B54A41DU,0xC25A59B5U,0x9C30D539U,0x2AF26013U,
  418. 0xC5D1B023U,0x286085F0U,0xCA417918U,0xB8DB38EFU,0x8E79DCB0U,0x603A180EU,0x6C9E0E8BU,0xB01E8A3EU,
  419. 0xD71577C1U,0xBD314B27U,0x78AF2FDAU,0x55605C60U,0xE65525F3U,0xAA55AB94U,0x57489862U,0x63E81440U,
  420. 0x55CA396AU,0x2AAB10B6U,0xB4CC5C34U,0x1141E8CEU,0xA15486AFU,0x7C72E993U,0xB3EE1411U,0x636FBC2AU,
  421. 0x2BA9C55DU,0x741831F6U,0xCE5C3E16U,0x9B87931EU,0xAFD6BA33U,0x6C24CF5CU,0x7A325381U,0x28958677U,
  422. 0x3B8F4898U,0x6B4BB9AFU,0xC4BFE81BU,0x66282193U,0x61D809CCU,0xFB21A991U,0x487CAC60U,0x5DEC8032U,
  423. 0xEF845D5DU,0xE98575B1U,0xDC262302U,0xEB651B88U,0x23893E81U,0xD396ACC5U,0x0F6D6FF3U,0x83F44239U,
  424. 0x2E0B4482U,0xA4842004U,0x69C8F04AU,0x9E1F9B5EU,0x21C66842U,0xF6E96C9AU,0x670C9C61U,0xABD388F0U,
  425. 0x6A51A0D2U,0xD8542F68U,0x960FA728U,0xAB5133A3U,0x6EEF0B6CU,0x137A3BE4U,0xBA3BF050U,0x7EFB2A98U,
  426. 0xA1F1651DU,0x39AF0176U,0x66CA593EU,0x82430E88U,0x8CEE8619U,0x456F9FB4U,0x7D84A5C3U,0x3B8B5EBEU,
  427. 0xE06F75D8U,0x85C12073U,0x401A449FU,0x56C16AA6U,0x4ED3AA62U,0x363F7706U,0x1BFEDF72U,0x429B023DU,
  428. 0x37D0D724U,0xD00A1248U,0xDB0FEAD3U,0x49F1C09BU,0x075372C9U,0x80991B7BU,0x25D479D8U,0xF6E8DEF7U,
  429. 0xE3FE501AU,0xB6794C3BU,0x976CE0BDU,0x04C006BAU,0xC1A94FB6U,0x409F60C4U,0x5E5C9EC2U,0x196A2463U,
  430. 0x68FB6FAFU,0x3E6C53B5U,0x1339B2EBU,0x3B52EC6FU,0x6DFC511FU,0x9B30952CU,0xCC814544U,0xAF5EBD09U,
  431. 0xBEE3D004U,0xDE334AFDU,0x660F2807U,0x192E4BB3U,0xC0CBA857U,0x45C8740FU,0xD20B5F39U,0xB9D3FBDBU,
  432. 0x5579C0BDU,0x1A60320AU,0xD6A100C6U,0x402C7279U,0x679F25FEU,0xFB1FA3CCU,0x8EA5E9F8U,0xDB3222F8U,
  433. 0x3C7516DFU,0xFD616B15U,0x2F501EC8U,0xAD0552ABU,0x323DB5FAU,0xFD238760U,0x53317B48U,0x3E00DF82U,
  434. 0x9E5C57BBU,0xCA6F8CA0U,0x1A87562EU,0xDF1769DBU,0xD542A8F6U,0x287EFFC3U,0xAC6732C6U,0x8C4F5573U,
  435. 0x695B27B0U,0xBBCA58C8U,0xE1FFA35DU,0xB8F011A0U,0x10FA3D98U,0xFD2183B8U,0x4AFCB56CU,0x2DD1D35BU,
  436. 0x9A53E479U,0xB6F84565U,0xD28E49BCU,0x4BFB9790U,0xE1DDF2DAU,0xA4CB7E33U,0x62FB1341U,0xCEE4C6E8U,
  437. 0xEF20CADAU,0x36774C01U,0xD07E9EFEU,0x2BF11FB4U,0x95DBDA4DU,0xAE909198U,0xEAAD8E71U,0x6B93D5A0U,
  438. 0xD08ED1D0U,0xAFC725E0U,0x8E3C5B2FU,0x8E7594B7U,0x8FF6E2FBU,0xF2122B64U,0x8888B812U,0x900DF01CU,
  439. 0x4FAD5EA0U,0x688FC31CU,0xD1CFF191U,0xB3A8C1ADU,0x2F2F2218U,0xBE0E1777U,0xEA752DFEU,0x8B021FA1U,
  440. 0xE5A0CC0FU,0xB56F74E8U,0x18ACF3D6U,0xCE89E299U,0xB4A84FE0U,0xFD13E0B7U,0x7CC43B81U,0xD2ADA8D9U,
  441. 0x165FA266U,0x80957705U,0x93CC7314U,0x211A1477U,0xE6AD2065U,0x77B5FA86U,0xC75442F5U,0xFB9D35CFU,
  442. 0xEBCDAF0CU,0x7B3E89A0U,0xD6411BD3U,0xAE1E7E49U,0x00250E2DU,0x2071B35EU,0x226800BBU,0x57B8E0AFU,
  443. 0x2464369BU,0xF009B91EU,0x5563911DU,0x59DFA6AAU,0x78C14389U,0xD95A537FU,0x207D5BA2U,0x02E5B9C5U,
  444. 0x83260376U,0x6295CFA9U,0x11C81968U,0x4E734A41U,0xB3472DCAU,0x7B14A94AU,0x1B510052U,0x9A532915U,
  445. 0xD60F573FU,0xBC9BC6E4U,0x2B60A476U,0x81E67400U,0x08BA6FB5U,0x571BE91FU,0xF296EC6BU,0x2A0DD915U,
  446. 0xB6636521U,0xE7B9F9B6U,0xFF34052EU,0xC5855664U,0x53B02D5DU,0xA99F8FA1U,0x08BA4799U,0x6E85076AU,
  447. },{
  448. 0x4B7A70E9U,0xB5B32944U,0xDB75092EU,0xC4192623U,0xAD6EA6B0U,0x49A7DF7DU,0x9CEE60B8U,0x8FEDB266U,
  449. 0xECAA8C71U,0x699A17FFU,0x5664526CU,0xC2B19EE1U,0x193602A5U,0x75094C29U,0xA0591340U,0xE4183A3EU,
  450. 0x3F54989AU,0x5B429D65U,0x6B8FE4D6U,0x99F73FD6U,0xA1D29C07U,0xEFE830F5U,0x4D2D38E6U,0xF0255DC1U,
  451. 0x4CDD2086U,0x8470EB26U,0x6382E9C6U,0x021ECC5EU,0x09686B3FU,0x3EBAEFC9U,0x3C971814U,0x6B6A70A1U,
  452. 0x687F3584U,0x52A0E286U,0xB79C5305U,0xAA500737U,0x3E07841CU,0x7FDEAE5CU,0x8E7D44ECU,0x5716F2B8U,
  453. 0xB03ADA37U,0xF0500C0DU,0xF01C1F04U,0x0200B3FFU,0xAE0CF51AU,0x3CB574B2U,0x25837A58U,0xDC0921BDU,
  454. 0xD19113F9U,0x7CA92FF6U,0x94324773U,0x22F54701U,0x3AE5E581U,0x37C2DADCU,0xC8B57634U,0x9AF3DDA7U,
  455. 0xA9446146U,0x0FD0030EU,0xECC8C73EU,0xA4751E41U,0xE238CD99U,0x3BEA0E2FU,0x3280BBA1U,0x183EB331U,
  456. 0x4E548B38U,0x4F6DB908U,0x6F420D03U,0xF60A04BFU,0x2CB81290U,0x24977C79U,0x5679B072U,0xBCAF89AFU,
  457. 0xDE9A771FU,0xD9930810U,0xB38BAE12U,0xDCCF3F2EU,0x5512721FU,0x2E6B7124U,0x501ADDE6U,0x9F84CD87U,
  458. 0x7A584718U,0x7408DA17U,0xBC9F9ABCU,0xE94B7D8CU,0xEC7AEC3AU,0xDB851DFAU,0x63094366U,0xC464C3D2U,
  459. 0xEF1C1847U,0x3215D908U,0xDD433B37U,0x24C2BA16U,0x12A14D43U,0x2A65C451U,0x50940002U,0x133AE4DDU,
  460. 0x71DFF89EU,0x10314E55U,0x81AC77D6U,0x5F11199BU,0x043556F1U,0xD7A3C76BU,0x3C11183BU,0x5924A509U,
  461. 0xF28FE6EDU,0x97F1FBFAU,0x9EBABF2CU,0x1E153C6EU,0x86E34570U,0xEAE96FB1U,0x860E5E0AU,0x5A3E2AB3U,
  462. 0x771FE71CU,0x4E3D06FAU,0x2965DCB9U,0x99E71D0FU,0x803E89D6U,0x5266C825U,0x2E4CC978U,0x9C10B36AU,
  463. 0xC6150EBAU,0x94E2EA78U,0xA5FC3C53U,0x1E0A2DF4U,0xF2F74EA7U,0x361D2B3DU,0x1939260FU,0x19C27960U,
  464. 0x5223A708U,0xF71312B6U,0xEBADFE6EU,0xEAC31F66U,0xE3BC4595U,0xA67BC883U,0xB17F37D1U,0x018CFF28U,
  465. 0xC332DDEFU,0xBE6C5AA5U,0x65582185U,0x68AB9802U,0xEECEA50FU,0xDB2F953BU,0x2AEF7DADU,0x5B6E2F84U,
  466. 0x1521B628U,0x29076170U,0xECDD4775U,0x619F1510U,0x13CCA830U,0xEB61BD96U,0x0334FE1EU,0xAA0363CFU,
  467. 0xB5735C90U,0x4C70A239U,0xD59E9E0BU,0xCBAADE14U,0xEECC86BCU,0x60622CA7U,0x9CAB5CABU,0xB2F3846EU,
  468. 0x648B1EAFU,0x19BDF0CAU,0xA02369B9U,0x655ABB50U,0x40685A32U,0x3C2AB4B3U,0x319EE9D5U,0xC021B8F7U,
  469. 0x9B540B19U,0x875FA099U,0x95F7997EU,0x623D7DA8U,0xF837889AU,0x97E32D77U,0x11ED935FU,0x16681281U,
  470. 0x0E358829U,0xC7E61FD6U,0x96DEDFA1U,0x7858BA99U,0x57F584A5U,0x1B227263U,0x9B83C3FFU,0x1AC24696U,
  471. 0xCDB30AEBU,0x532E3054U,0x8FD948E4U,0x6DBC3128U,0x58EBF2EFU,0x34C6FFEAU,0xFE28ED61U,0xEE7C3C73U,
  472. 0x5D4A14D9U,0xE864B7E3U,0x42105D14U,0x203E13E0U,0x45EEE2B6U,0xA3AAABEAU,0xDB6C4F15U,0xFACB4FD0U,
  473. 0xC742F442U,0xEF6ABBB5U,0x654F3B1DU,0x41CD2105U,0xD81E799EU,0x86854DC7U,0xE44B476AU,0x3D816250U,
  474. 0xCF62A1F2U,0x5B8D2646U,0xFC8883A0U,0xC1C7B6A3U,0x7F1524C3U,0x69CB7492U,0x47848A0BU,0x5692B285U,
  475. 0x095BBF00U,0xAD19489DU,0x1462B174U,0x23820E00U,0x58428D2AU,0x0C55F5EAU,0x1DADF43EU,0x233F7061U,
  476. 0x3372F092U,0x8D937E41U,0xD65FECF1U,0x6C223BDBU,0x7CDE3759U,0xCBEE7460U,0x4085F2A7U,0xCE77326EU,
  477. 0xA6078084U,0x19F8509EU,0xE8EFD855U,0x61D99735U,0xA969A7AAU,0xC50C06C2U,0x5A04ABFCU,0x800BCADCU,
  478. 0x9E447A2EU,0xC3453484U,0xFDD56705U,0x0E1E9EC9U,0xDB73DBD3U,0x105588CDU,0x675FDA79U,0xE3674340U,
  479. 0xC5C43465U,0x713E38D8U,0x3D28F89EU,0xF16DFF20U,0x153E21E7U,0x8FB03D4AU,0xE6E39F2BU,0xDB83ADF7U,
  480. },{
  481. 0xE93D5A68U,0x948140F7U,0xF64C261CU,0x94692934U,0x411520F7U,0x7602D4F7U,0xBCF46B2EU,0xD4A20068U,
  482. 0xD4082471U,0x3320F46AU,0x43B7D4B7U,0x500061AFU,0x1E39F62EU,0x97244546U,0x14214F74U,0xBF8B8840U,
  483. 0x4D95FC1DU,0x96B591AFU,0x70F4DDD3U,0x66A02F45U,0xBFBC09ECU,0x03BD9785U,0x7FAC6DD0U,0x31CB8504U,
  484. 0x96EB27B3U,0x55FD3941U,0xDA2547E6U,0xABCA0A9AU,0x28507825U,0x530429F4U,0x0A2C86DAU,0xE9B66DFBU,
  485. 0x68DC1462U,0xD7486900U,0x680EC0A4U,0x27A18DEEU,0x4F3FFEA2U,0xE887AD8CU,0xB58CE006U,0x7AF4D6B6U,
  486. 0xAACE1E7CU,0xD3375FECU,0xCE78A399U,0x406B2A42U,0x20FE9E35U,0xD9F385B9U,0xEE39D7ABU,0x3B124E8BU,
  487. 0x1DC9FAF7U,0x4B6D1856U,0x26A36631U,0xEAE397B2U,0x3A6EFA74U,0xDD5B4332U,0x6841E7F7U,0xCA7820FBU,
  488. 0xFB0AF54EU,0xD8FEB397U,0x454056ACU,0xBA489527U,0x55533A3AU,0x20838D87U,0xFE6BA9B7U,0xD096954BU,
  489. 0x55A867BCU,0xA1159A58U,0xCCA92963U,0x99E1DB33U,0xA62A4A56U,0x3F3125F9U,0x5EF47E1CU,0x9029317CU,
  490. 0xFDF8E802U,0x04272F70U,0x80BB155CU,0x05282CE3U,0x95C11548U,0xE4C66D22U,0x48C1133FU,0xC70F86DCU,
  491. 0x07F9C9EEU,0x41041F0FU,0x404779A4U,0x5D886E17U,0x325F51EBU,0xD59BC0D1U,0xF2BCC18FU,0x41113564U,
  492. 0x257B7834U,0x602A9C60U,0xDFF8E8A3U,0x1F636C1BU,0x0E12B4C2U,0x02E1329EU,0xAF664FD1U,0xCAD18115U,
  493. 0x6B2395E0U,0x333E92E1U,0x3B240B62U,0xEEBEB922U,0x85B2A20EU,0xE6BA0D99U,0xDE720C8CU,0x2DA2F728U,
  494. 0xD0127845U,0x95B794FDU,0x647D0862U,0xE7CCF5F0U,0x5449A36FU,0x877D48FAU,0xC39DFD27U,0xF33E8D1EU,
  495. 0x0A476341U,0x992EFF74U,0x3A6F6EABU,0xF4F8FD37U,0xA812DC60U,0xA1EBDDF8U,0x991BE14CU,0xDB6E6B0DU,
  496. 0xC67B5510U,0x6D672C37U,0x2765D43BU,0xDCD0E804U,0xF1290DC7U,0xCC00FFA3U,0xB5390F92U,0x690FED0BU,
  497. 0x667B9FFBU,0xCEDB7D9CU,0xA091CF0BU,0xD9155EA3U,0xBB132F88U,0x515BAD24U,0x7B9479BFU,0x763BD6EBU,
  498. 0x37392EB3U,0xCC115979U,0x8026E297U,0xF42E312DU,0x6842ADA7U,0xC66A2B3BU,0x12754CCCU,0x782EF11CU,
  499. 0x6A124237U,0xB79251E7U,0x06A1BBE6U,0x4BFB6350U,0x1A6B1018U,0x11CAEDFAU,0x3D25BDD8U,0xE2E1C3C9U,
  500. 0x44421659U,0x0A121386U,0xD90CEC6EU,0xD5ABEA2AU,0x64AF674EU,0xDA86A85FU,0xBEBFE988U,0x64E4C3FEU,
  501. 0x9DBC8057U,0xF0F7C086U,0x60787BF8U,0x6003604DU,0xD1FD8346U,0xF6381FB0U,0x7745AE04U,0xD736FCCCU,
  502. 0x83426B33U,0xF01EAB71U,0xB0804187U,0x3C005E5FU,0x77A057BEU,0xBDE8AE24U,0x55464299U,0xBF582E61U,
  503. 0x4E58F48FU,0xF2DDFDA2U,0xF474EF38U,0x8789BDC2U,0x5366F9C3U,0xC8B38E74U,0xB475F255U,0x46FCD9B9U,
  504. 0x7AEB2661U,0x8B1DDF84U,0x846A0E79U,0x915F95E2U,0x466E598EU,0x20B45770U,0x8CD55591U,0xC902DE4CU,
  505. 0xB90BACE1U,0xBB8205D0U,0x11A86248U,0x7574A99EU,0xB77F19B6U,0xE0A9DC09U,0x662D09A1U,0xC4324633U,
  506. 0xE85A1F02U,0x09F0BE8CU,0x4A99A025U,0x1D6EFE10U,0x1AB93D1DU,0x0BA5A4DFU,0xA186F20FU,0x2868F169U,
  507. 0xDCB7DA83U,0x573906FEU,0xA1E2CE9BU,0x4FCD7F52U,0x50115E01U,0xA70683FAU,0xA002B5C4U,0x0DE6D027U,
  508. 0x9AF88C27U,0x773F8641U,0xC3604C06U,0x61A806B5U,0xF0177A28U,0xC0F586E0U,0x006058AAU,0x30DC7D62U,
  509. 0x11E69ED7U,0x2338EA63U,0x53C2DD94U,0xC2C21634U,0xBBCBEE56U,0x90BCB6DEU,0xEBFC7DA1U,0xCE591D76U,
  510. 0x6F05E409U,0x4B7C0188U,0x39720A3DU,0x7C927C24U,0x86E3725FU,0x724D9DB9U,0x1AC15BB4U,0xD39EB8FCU,
  511. 0xED545578U,0x08FCA5B5U,0xD83D7CD3U,0x4DAD0FC4U,0x1E50EF5EU,0xB161E6F8U,0xA28514D9U,0x6C51133CU,
  512. 0x6FD5C7E7U,0x56E14EC4U,0x362ABFCEU,0xDDC6C837U,0xD79A3234U,0x92638212U,0x670EFA8EU,0x406000E0U,
  513. },{
  514. 0x3A39CE37U,0xD3FAF5CFU,0xABC27737U,0x5AC52D1BU,0x5CB0679EU,0x4FA33742U,0xD3822740U,0x99BC9BBEU,
  515. 0xD5118E9DU,0xBF0F7315U,0xD62D1C7EU,0xC700C47BU,0xB78C1B6BU,0x21A19045U,0xB26EB1BEU,0x6A366EB4U,
  516. 0x5748AB2FU,0xBC946E79U,0xC6A376D2U,0x6549C2C8U,0x530FF8EEU,0x468DDE7DU,0xD5730A1DU,0x4CD04DC6U,
  517. 0x2939BBDBU,0xA9BA4650U,0xAC9526E8U,0xBE5EE304U,0xA1FAD5F0U,0x6A2D519AU,0x63EF8CE2U,0x9A86EE22U,
  518. 0xC089C2B8U,0x43242EF6U,0xA51E03AAU,0x9CF2D0A4U,0x83C061BAU,0x9BE96A4DU,0x8FE51550U,0xBA645BD6U,
  519. 0x2826A2F9U,0xA73A3AE1U,0x4BA99586U,0xEF5562E9U,0xC72FEFD3U,0xF752F7DAU,0x3F046F69U,0x77FA0A59U,
  520. 0x80E4A915U,0x87B08601U,0x9B09E6ADU,0x3B3EE593U,0xE990FD5AU,0x9E34D797U,0x2CF0B7D9U,0x022B8B51U,
  521. 0x96D5AC3AU,0x017DA67DU,0xD1CF3ED6U,0x7C7D2D28U,0x1F9F25CFU,0xADF2B89BU,0x5AD6B472U,0x5A88F54CU,
  522. 0xE029AC71U,0xE019A5E6U,0x47B0ACFDU,0xED93FA9BU,0xE8D3C48DU,0x283B57CCU,0xF8D56629U,0x79132E28U,
  523. 0x785F0191U,0xED756055U,0xF7960E44U,0xE3D35E8CU,0x15056DD4U,0x88F46DBAU,0x03A16125U,0x0564F0BDU,
  524. 0xC3EB9E15U,0x3C9057A2U,0x97271AECU,0xA93A072AU,0x1B3F6D9BU,0x1E6321F5U,0xF59C66FBU,0x26DCF319U,
  525. 0x7533D928U,0xB155FDF5U,0x03563482U,0x8ABA3CBBU,0x28517711U,0xC20AD9F8U,0xABCC5167U,0xCCAD925FU,
  526. 0x4DE81751U,0x3830DC8EU,0x379D5862U,0x9320F991U,0xEA7A90C2U,0xFB3E7BCEU,0x5121CE64U,0x774FBE32U,
  527. 0xA8B6E37EU,0xC3293D46U,0x48DE5369U,0x6413E680U,0xA2AE0810U,0xDD6DB224U,0x69852DFDU,0x09072166U,
  528. 0xB39A460AU,0x6445C0DDU,0x586CDECFU,0x1C20C8AEU,0x5BBEF7DDU,0x1B588D40U,0xCCD2017FU,0x6BB4E3BBU,
  529. 0xDDA26A7EU,0x3A59FF45U,0x3E350A44U,0xBCB4CDD5U,0x72EACEA8U,0xFA6484BBU,0x8D6612AEU,0xBF3C6F47U,
  530. 0xD29BE463U,0x542F5D9EU,0xAEC2771BU,0xF64E6370U,0x740E0D8DU,0xE75B1357U,0xF8721671U,0xAF537D5DU,
  531. 0x4040CB08U,0x4EB4E2CCU,0x34D2466AU,0x0115AF84U,0xE1B00428U,0x95983A1DU,0x06B89FB4U,0xCE6EA048U,
  532. 0x6F3F3B82U,0x3520AB82U,0x011A1D4BU,0x277227F8U,0x611560B1U,0xE7933FDCU,0xBB3A792BU,0x344525BDU,
  533. 0xA08839E1U,0x51CE794BU,0x2F32C9B7U,0xA01FBAC9U,0xE01CC87EU,0xBCC7D1F6U,0xCF0111C3U,0xA1E8AAC7U,
  534. 0x1A908749U,0xD44FBD9AU,0xD0DADECBU,0xD50ADA38U,0x0339C32AU,0xC6913667U,0x8DF9317CU,0xE0B12B4FU,
  535. 0xF79E59B7U,0x43F5BB3AU,0xF2D519FFU,0x27D9459CU,0xBF97222CU,0x15E6FC2AU,0x0F91FC71U,0x9B941525U,
  536. 0xFAE59361U,0xCEB69CEBU,0xC2A86459U,0x12BAA8D1U,0xB6C1075EU,0xE3056A0CU,0x10D25065U,0xCB03A442U,
  537. 0xE0EC6E0EU,0x1698DB3BU,0x4C98A0BEU,0x3278E964U,0x9F1F9532U,0xE0D392DFU,0xD3A0342BU,0x8971F21EU,
  538. 0x1B0A7441U,0x4BA3348CU,0xC5BE7120U,0xC37632D8U,0xDF359F8DU,0x9B992F2EU,0xE60B6F47U,0x0FE3F11DU,
  539. 0xE54CDA54U,0x1EDAD891U,0xCE6279CFU,0xCD3E7E6FU,0x1618B166U,0xFD2C1D05U,0x848FD2C5U,0xF6FB2299U,
  540. 0xF523F357U,0xA6327623U,0x93A83531U,0x56CCCD02U,0xACF08162U,0x5A75EBB5U,0x6E163697U,0x88D273CCU,
  541. 0xDE966292U,0x81B949D0U,0x4C50901BU,0x71C65614U,0xE6C6C7BDU,0x327A140AU,0x45E1D006U,0xC3F27B9AU,
  542. 0xC9AA53FDU,0x62A80F00U,0xBB25BFE2U,0x35BDD2F6U,0x71126905U,0xB2040222U,0xB6CBCF7CU,0xCD769C2BU,
  543. 0x53113EC0U,0x1640E3D3U,0x38ABBD60U,0x2547ADF0U,0xBA38209CU,0xF746CE76U,0x77AFA1C5U,0x20756060U,
  544. 0x85CBFE4EU,0x8AE88DD8U,0x7AAAF9B0U,0x4CF9AA7EU,0x1948C25CU,0x02FB8A8CU,0x01C36AE4U,0xD6EBE1F9U,
  545. 0x90D4F869U,0xA65CDEA0U,0x3F09252DU,0xC208E69FU,0xB74E6132U,0xCE77E25BU,0x578FDFE3U,0x3AC372E6U
  546. }
  547. };