diff --git a/Algo256/blake256.cu b/Algo256/blake256.cu deleted file mode 100644 index 3d2ca608..00000000 --- a/Algo256/blake256.cu +++ /dev/null @@ -1,599 +0,0 @@ -/** - * Blake-256 Cuda Kernel (Tested on SM 5/5.2) - * - * Tanguy Pruvot / SP - Jan 2016 - */ - -#include -#include - -#include "miner.h" - -extern "C" { -#include "sph/sph_blake.h" -} - -/* threads per block */ -#define TPB 512 - -/* hash by cpu with blake 256 */ -extern "C" void blake256hash(void *output, const void *input, int8_t rounds = 14) -{ - uchar hash[64]; - sph_blake256_context ctx; - - sph_blake256_set_rounds(rounds); - - sph_blake256_init(&ctx); - sph_blake256(&ctx, input, 80); - sph_blake256_close(&ctx, hash); - - memcpy(output, hash, 32); -} - -#include "cuda_helper.h" - -#ifdef __INTELLISENSE__ -#define __byte_perm(x, y, b) x -#endif - -__constant__ uint32_t _ALIGN(32) d_data[12]; - -/* 8 adapters max */ -static uint32_t *d_resNonce[MAX_GPUS]; -static uint32_t *h_resNonce[MAX_GPUS]; - -/* max count of found nonces in one call */ -#define NBN 2 -static __thread uint32_t extra_results[NBN] = { UINT32_MAX }; - -#define GSPREC(a,b,c,d,x,y) { \ - v[a] += (m[x] ^ c_u256[y]) + v[b]; \ - v[d] = __byte_perm(v[d] ^ v[a],0, 0x1032); \ - v[c] += v[d]; \ - v[b] = SPH_ROTR32(v[b] ^ v[c], 12); \ - v[a] += (m[y] ^ c_u256[x]) + v[b]; \ - v[d] = __byte_perm(v[d] ^ v[a],0, 0x0321); \ - v[c] += v[d]; \ - v[b] = SPH_ROTR32(v[b] ^ v[c], 7); \ - } - -__device__ __forceinline__ -void blake256_compress_14(uint32_t *h, const uint32_t *block, const uint32_t T0) -{ - uint32_t /*_ALIGN(8)*/ m[16]; - uint32_t v[16]; - - m[0] = block[0]; - m[1] = block[1]; - m[2] = block[2]; - m[3] = block[3]; - - const uint32_t c_u256[16] = { - 0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344, - 0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89, - 0x452821E6, 0x38D01377, 0xBE5466CF, 0x34E90C6C, - 0xC0AC29B7, 0xC97C50DD, 0x3F84D5B5, 0xB5470917 - }; - - const uint32_t c_Padding[12] = { - 0x80000000UL, 0, 0, 0, - 0, 0, 0, 0, - 0, 1, 0, 640, - }; - - #pragma unroll - for (uint32_t i = 0; i < 12; i++) { - m[i+4] = c_Padding[i]; - } - - //#pragma unroll 8 - for(uint32_t i = 0; i < 8; i++) - v[i] = h[i]; - - v[ 8] = c_u256[0]; - v[ 9] = c_u256[1]; - v[10] = c_u256[2]; - v[11] = c_u256[3]; - - v[12] = c_u256[4] ^ T0; - v[13] = c_u256[5] ^ T0; - v[14] = c_u256[6]; - v[15] = c_u256[7]; - - // { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - GSPREC(0, 4, 0x8, 0xC,0,1); - GSPREC(1, 5, 0x9, 0xD,2,3); - GSPREC(2, 6, 0xA, 0xE, 4,5); - GSPREC(3, 7, 0xB, 0xF, 6,7); - GSPREC(0, 5, 0xA, 0xF, 8,9); - GSPREC(1, 6, 0xB, 0xC, 10,11); - GSPREC(2, 7, 0x8, 0xD, 12,13); - GSPREC(3, 4, 0x9, 0xE, 14,15); - // { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - GSPREC(0, 4, 0x8, 0xC, 14, 10); - GSPREC(1, 5, 0x9, 0xD, 4, 8); - GSPREC(2, 6, 0xA, 0xE, 9, 15); - GSPREC(3, 7, 0xB, 0xF, 13, 6); - GSPREC(0, 5, 0xA, 0xF, 1, 12); - GSPREC(1, 6, 0xB, 0xC, 0, 2); - GSPREC(2, 7, 0x8, 0xD, 11, 7); - GSPREC(3, 4, 0x9, 0xE, 5, 3); - // { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - GSPREC(0, 4, 0x8, 0xC, 11, 8); - GSPREC(1, 5, 0x9, 0xD, 12, 0); - GSPREC(2, 6, 0xA, 0xE, 5, 2); - GSPREC(3, 7, 0xB, 0xF, 15, 13); - GSPREC(0, 5, 0xA, 0xF, 10, 14); - GSPREC(1, 6, 0xB, 0xC, 3, 6); - GSPREC(2, 7, 0x8, 0xD, 7, 1); - GSPREC(3, 4, 0x9, 0xE, 9, 4); - // { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - GSPREC(0, 4, 0x8, 0xC, 7, 9); - GSPREC(1, 5, 0x9, 0xD, 3, 1); - GSPREC(2, 6, 0xA, 0xE, 13, 12); - GSPREC(3, 7, 0xB, 0xF, 11, 14); - GSPREC(0, 5, 0xA, 0xF, 2, 6); - GSPREC(1, 6, 0xB, 0xC, 5, 10); - GSPREC(2, 7, 0x8, 0xD, 4, 0); - GSPREC(3, 4, 0x9, 0xE, 15, 8); - // { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, - GSPREC(0, 4, 0x8, 0xC, 9, 0); - GSPREC(1, 5, 0x9, 0xD, 5, 7); - GSPREC(2, 6, 0xA, 0xE, 2, 4); - GSPREC(3, 7, 0xB, 0xF, 10, 15); - GSPREC(0, 5, 0xA, 0xF, 14, 1); - GSPREC(1, 6, 0xB, 0xC, 11, 12); - GSPREC(2, 7, 0x8, 0xD, 6, 8); - GSPREC(3, 4, 0x9, 0xE, 3, 13); - // { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 }, - GSPREC(0, 4, 0x8, 0xC, 2, 12); - GSPREC(1, 5, 0x9, 0xD, 6, 10); - GSPREC(2, 6, 0xA, 0xE, 0, 11); - GSPREC(3, 7, 0xB, 0xF, 8, 3); - GSPREC(0, 5, 0xA, 0xF, 4, 13); - GSPREC(1, 6, 0xB, 0xC, 7, 5); - GSPREC(2, 7, 0x8, 0xD, 15, 14); - GSPREC(3, 4, 0x9, 0xE, 1, 9); - // { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 }, - GSPREC(0, 4, 0x8, 0xC, 12, 5); - GSPREC(1, 5, 0x9, 0xD, 1, 15); - GSPREC(2, 6, 0xA, 0xE, 14, 13); - GSPREC(3, 7, 0xB, 0xF, 4, 10); - GSPREC(0, 5, 0xA, 0xF, 0, 7); - GSPREC(1, 6, 0xB, 0xC, 6, 3); - GSPREC(2, 7, 0x8, 0xD, 9, 2); - GSPREC(3, 4, 0x9, 0xE, 8, 11); - // { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 }, - GSPREC(0, 4, 0x8, 0xC, 13, 11); - GSPREC(1, 5, 0x9, 0xD, 7, 14); - GSPREC(2, 6, 0xA, 0xE, 12, 1); - GSPREC(3, 7, 0xB, 0xF, 3, 9); - GSPREC(0, 5, 0xA, 0xF, 5, 0); - GSPREC(1, 6, 0xB, 0xC, 15, 4); - GSPREC(2, 7, 0x8, 0xD, 8, 6); - GSPREC(3, 4, 0x9, 0xE, 2, 10); - // { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 }, - GSPREC(0, 4, 0x8, 0xC, 6, 15); - GSPREC(1, 5, 0x9, 0xD, 14, 9); - GSPREC(2, 6, 0xA, 0xE, 11, 3); - GSPREC(3, 7, 0xB, 0xF, 0, 8); - GSPREC(0, 5, 0xA, 0xF, 12, 2); - GSPREC(1, 6, 0xB, 0xC, 13, 7); - GSPREC(2, 7, 0x8, 0xD, 1, 4); - GSPREC(3, 4, 0x9, 0xE, 10, 5); - // { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 }, - GSPREC(0, 4, 0x8, 0xC, 10, 2); - GSPREC(1, 5, 0x9, 0xD, 8, 4); - GSPREC(2, 6, 0xA, 0xE, 7, 6); - GSPREC(3, 7, 0xB, 0xF, 1, 5); - GSPREC(0, 5, 0xA, 0xF, 15, 11); - GSPREC(1, 6, 0xB, 0xC, 9, 14); - GSPREC(2, 7, 0x8, 0xD, 3, 12); - GSPREC(3, 4, 0x9, 0xE, 13, 0); - // { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - GSPREC(0, 4, 0x8, 0xC, 0, 1); - GSPREC(1, 5, 0x9, 0xD, 2, 3); - GSPREC(2, 6, 0xA, 0xE, 4, 5); - GSPREC(3, 7, 0xB, 0xF, 6, 7); - GSPREC(0, 5, 0xA, 0xF, 8, 9); - GSPREC(1, 6, 0xB, 0xC, 10, 11); - GSPREC(2, 7, 0x8, 0xD, 12, 13); - GSPREC(3, 4, 0x9, 0xE, 14, 15); - // { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - GSPREC(0, 4, 0x8, 0xC, 14, 10); - GSPREC(1, 5, 0x9, 0xD, 4, 8); - GSPREC(2, 6, 0xA, 0xE, 9, 15); - GSPREC(3, 7, 0xB, 0xF, 13, 6); - GSPREC(0, 5, 0xA, 0xF, 1, 12); - GSPREC(1, 6, 0xB, 0xC, 0, 2); - GSPREC(2, 7, 0x8, 0xD, 11, 7); - GSPREC(3, 4, 0x9, 0xE, 5, 3); - // { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - GSPREC(0, 4, 0x8, 0xC, 11, 8); - GSPREC(1, 5, 0x9, 0xD, 12, 0); - GSPREC(2, 6, 0xA, 0xE, 5, 2); - GSPREC(3, 7, 0xB, 0xF, 15, 13); - GSPREC(0, 5, 0xA, 0xF, 10, 14); - GSPREC(1, 6, 0xB, 0xC, 3, 6); - GSPREC(2, 7, 0x8, 0xD, 7, 1); - GSPREC(3, 4, 0x9, 0xE, 9, 4); - // { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - GSPREC(0, 4, 0x8, 0xC, 7, 9); - GSPREC(1, 5, 0x9, 0xD, 3, 1); - GSPREC(2, 6, 0xA, 0xE, 13, 12); - GSPREC(3, 7, 0xB, 0xF, 11, 14); - GSPREC(0, 5, 0xA, 0xF, 2, 6); - GSPREC(1, 6, 0xB, 0xC, 5, 10); - GSPREC(2, 7, 0x8, 0xD, 4, 0); - GSPREC(3, 4, 0x9, 0xE, 15, 8); - - // only compute h6 & 7 - h[6U] ^= v[6U] ^ v[14U]; - h[7U] ^= v[7U] ^ v[15U]; -} - -/* ############################################################################################################################### */ -/* Precalculated 1st 64-bytes block (midstate) method */ - -__global__ __launch_bounds__(1024,1) -void blake256_gpu_hash_16(const uint32_t threads, const uint32_t startNonce, uint32_t *resNonce, const uint64_t highTarget) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const uint32_t nonce = startNonce + thread; - uint32_t _ALIGN(16) h[8]; - - #pragma unroll - for(int i=0; i < 8; i++) { - h[i] = d_data[i]; - } - - // ------ Close: Bytes 64 to 80 ------ - - uint32_t _ALIGN(16) ending[4]; - ending[0] = d_data[8]; - ending[1] = d_data[9]; - ending[2] = d_data[10]; - ending[3] = nonce; /* our tested value */ - - blake256_compress_14(h, ending, 640); - - if (h[7] == 0 && cuda_swab32(h[6]) <= highTarget) { -#if NBN == 2 - if (resNonce[0] != UINT32_MAX) - resNonce[1] = nonce; - else - resNonce[0] = nonce; -#else - resNonce[0] = nonce; -#endif - } - } -} - -__global__ -#if __CUDA_ARCH__ >= 500 -__launch_bounds__(512, 3) /* 40 regs */ -#endif -void blake256_gpu_hash_16_8(const uint32_t threads, const uint32_t startNonce, uint32_t *resNonce, const uint64_t highTarget) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t h[8]; - const uint32_t nonce = startNonce + thread; - - #pragma unroll - for (int i = 0; i < 8; i++) { - h[i] = d_data[i]; - } - - // ------ Close: Bytes 64 to 80 ------ - - uint32_t m[16] = { - d_data[8], d_data[9], d_data[10], nonce, - 0x80000000UL, 0, 0, 0, - 0, 0, 0, 0, - 0, 1, 0, 640, - }; - - const uint32_t c_u256[16] = { - 0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344, - 0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89, - 0x452821E6, 0x38D01377, 0xBE5466CF, 0x34E90C6C, - 0xC0AC29B7, 0xC97C50DD, 0x3F84D5B5, 0xB5470917 - }; - - uint32_t v[16]; - - #pragma unroll - for (uint32_t i = 0; i < 8; i++) - v[i] = h[i]; - - v[8] = c_u256[0]; - v[9] = c_u256[1]; - v[10] = c_u256[2]; - v[11] = c_u256[3]; - - v[12] = c_u256[4] ^ 640U; - v[13] = c_u256[5] ^ 640U; - v[14] = c_u256[6]; - v[15] = c_u256[7]; - - // { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - GSPREC(0, 4, 0x8, 0xC, 0, 1); - GSPREC(1, 5, 0x9, 0xD, 2, 3); - GSPREC(2, 6, 0xA, 0xE, 4, 5); - GSPREC(3, 7, 0xB, 0xF, 6, 7); - GSPREC(0, 5, 0xA, 0xF, 8, 9); - GSPREC(1, 6, 0xB, 0xC, 10, 11); - GSPREC(2, 7, 0x8, 0xD, 12, 13); - GSPREC(3, 4, 0x9, 0xE, 14, 15); - // { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - GSPREC(0, 4, 0x8, 0xC, 14, 10); - GSPREC(1, 5, 0x9, 0xD, 4, 8); - GSPREC(2, 6, 0xA, 0xE, 9, 15); - GSPREC(3, 7, 0xB, 0xF, 13, 6); - GSPREC(0, 5, 0xA, 0xF, 1, 12); - GSPREC(1, 6, 0xB, 0xC, 0, 2); - GSPREC(2, 7, 0x8, 0xD, 11, 7); - GSPREC(3, 4, 0x9, 0xE, 5, 3); - // { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - GSPREC(0, 4, 0x8, 0xC, 11, 8); - GSPREC(1, 5, 0x9, 0xD, 12, 0); - GSPREC(2, 6, 0xA, 0xE, 5, 2); - GSPREC(3, 7, 0xB, 0xF, 15, 13); - GSPREC(0, 5, 0xA, 0xF, 10, 14); - GSPREC(1, 6, 0xB, 0xC, 3, 6); - GSPREC(2, 7, 0x8, 0xD, 7, 1); - GSPREC(3, 4, 0x9, 0xE, 9, 4); - // { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - GSPREC(0, 4, 0x8, 0xC, 7, 9); - GSPREC(1, 5, 0x9, 0xD, 3, 1); - GSPREC(2, 6, 0xA, 0xE, 13, 12); - GSPREC(3, 7, 0xB, 0xF, 11, 14); - GSPREC(0, 5, 0xA, 0xF, 2, 6); - GSPREC(1, 6, 0xB, 0xC, 5, 10); - GSPREC(2, 7, 0x8, 0xD, 4, 0); - GSPREC(3, 4, 0x9, 0xE, 15, 8); - // { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, - GSPREC(0, 4, 0x8, 0xC, 9, 0); - GSPREC(1, 5, 0x9, 0xD, 5, 7); - GSPREC(2, 6, 0xA, 0xE, 2, 4); - GSPREC(3, 7, 0xB, 0xF, 10, 15); - GSPREC(0, 5, 0xA, 0xF, 14, 1); - GSPREC(1, 6, 0xB, 0xC, 11, 12); - GSPREC(2, 7, 0x8, 0xD, 6, 8); - GSPREC(3, 4, 0x9, 0xE, 3, 13); - // { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 }, - GSPREC(0, 4, 0x8, 0xC, 2, 12); - GSPREC(1, 5, 0x9, 0xD, 6, 10); - GSPREC(2, 6, 0xA, 0xE, 0, 11); - GSPREC(3, 7, 0xB, 0xF, 8, 3); - GSPREC(0, 5, 0xA, 0xF, 4, 13); - GSPREC(1, 6, 0xB, 0xC, 7, 5); - GSPREC(2, 7, 0x8, 0xD, 15, 14); - GSPREC(3, 4, 0x9, 0xE, 1, 9); - // { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 }, - GSPREC(0, 4, 0x8, 0xC, 12, 5); - GSPREC(1, 5, 0x9, 0xD, 1, 15); - GSPREC(2, 6, 0xA, 0xE, 14, 13); - GSPREC(3, 7, 0xB, 0xF, 4, 10); - GSPREC(0, 5, 0xA, 0xF, 0, 7); - GSPREC(1, 6, 0xB, 0xC, 6, 3); - GSPREC(2, 7, 0x8, 0xD, 9, 2); - GSPREC(3, 4, 0x9, 0xE, 8, 11); - // { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 }, - GSPREC(0, 4, 0x8, 0xC, 13, 11); - GSPREC(1, 5, 0x9, 0xD, 7, 14); - GSPREC(2, 6, 0xA, 0xE, 12, 1); - GSPREC(3, 7, 0xB, 0xF, 3, 9); - GSPREC(0, 5, 0xA, 0xF, 5, 0); - GSPREC(1, 6, 0xB, 0xC, 15, 4); - GSPREC(2, 7, 0x8, 0xD, 8, 6); - //GSPREC(3, 4, 0x9, 0xE, 2, 10); - // { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 }, - - // only compute h6 & 7 - //h[6] ^= v[6] ^ v[14]; - //h[7] ^= v[7] ^ v[15]; - - if ((h[7]^v[7]^v[15]) == 0) // h7 - { - GSPREC(3, 4, 0x9, 0xE, 2, 10); - if (cuda_swab32(h[6]^v[6]^v[14]) <= highTarget) { -#if NBN == 2 - if (resNonce[0] != UINT32_MAX) - resNonce[1] = nonce; - else - resNonce[0] = nonce; -#else - resNonce[0] = nonce; -#endif - } - } - } -} - -__host__ -static uint32_t blake256_cpu_hash_16(const int thr_id, const uint32_t threads, const uint32_t startNonce, const uint64_t highTarget, - const int8_t rounds) -{ - uint32_t result = UINT32_MAX; - - dim3 grid((threads + TPB-1)/TPB); - dim3 block(TPB); - - /* Check error on Ctrl+C or kill to prevent segfaults on exit */ - if (cudaMemset(d_resNonce[thr_id], 0xff, NBN*sizeof(uint32_t)) != cudaSuccess) - return result; - - if (rounds == 8) - blake256_gpu_hash_16_8 <<>> (threads, startNonce, d_resNonce[thr_id], highTarget); - else - blake256_gpu_hash_16 <<>> (threads, startNonce, d_resNonce[thr_id], highTarget); - - if (cudaSuccess == cudaMemcpy(h_resNonce[thr_id], d_resNonce[thr_id], NBN*sizeof(uint32_t), cudaMemcpyDeviceToHost)) { - result = h_resNonce[thr_id][0]; - for (int n=0; n < (NBN-1); n++) - extra_results[n] = h_resNonce[thr_id][n+1]; - } - return result; -} - -__host__ -static void blake256mid(uint32_t *output, const uint32_t *input, int8_t rounds = 14) -{ - sph_blake256_context ctx; - - sph_blake256_set_rounds(rounds); - - sph_blake256_init(&ctx); - sph_blake256(&ctx, input, 64); - - memcpy(output, (void*)ctx.H, 32); -} - -__host__ -void blake256_cpu_setBlock_16(uint32_t *penddata, const uint32_t *midstate, const uint32_t *ptarget) -{ - uint32_t _ALIGN(64) data[11]; - memcpy(data, midstate, 32); - data[8] = penddata[0]; - data[9] = penddata[1]; - data[10]= penddata[2]; - CUDA_SAFE_CALL(cudaMemcpyToSymbol(d_data, data, 32 + 12, 0, cudaMemcpyHostToDevice)); -} - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_blake256(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done, int8_t blakerounds=14) -{ - uint32_t _ALIGN(64) endiandata[20]; - uint32_t _ALIGN(64) midstate[8]; - - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - - const uint32_t first_nonce = pdata[19]; - uint64_t targetHigh = ((uint64_t*)ptarget)[3]; - - int dev_id = device_map[thr_id]; - int intensity = (device_sm[dev_id] > 500 && !is_windows()) ? 30 : 26; - if (device_sm[dev_id] < 350) intensity = 22; - - uint32_t throughput = cuda_default_throughput(thr_id, 1U << intensity); - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - int rc = 0; - - if (opt_benchmark) { - targetHigh = 0x1ULL << 32; - ptarget[6] = swab32(0xff); - } - - if (!init[thr_id]) - { - cudaSetDevice(dev_id); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage (linux) - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - cudaDeviceSetCacheConfig(cudaFuncCachePreferL1); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - cuda_get_arch(thr_id); - - CUDA_CALL_OR_RET_X(cudaMalloc(&d_resNonce[thr_id], NBN * sizeof(uint32_t)), -1); - CUDA_CALL_OR_RET_X(cudaMallocHost(&h_resNonce[thr_id], NBN * sizeof(uint32_t)), -1); - init[thr_id] = true; - } - - for (int k = 0; k < 16; k++) - be32enc(&endiandata[k], pdata[k]); - - blake256mid(midstate, endiandata, blakerounds); - blake256_cpu_setBlock_16(&pdata[16], midstate, ptarget); - - do { - // GPU HASH (second block only, first is midstate) - work->nonces[0] = blake256_cpu_hash_16(thr_id, throughput, pdata[19], targetHigh, blakerounds); - - *hashes_done = pdata[19] - first_nonce + throughput; - - if (work->nonces[0] != UINT32_MAX) - { - uint32_t _ALIGN(64) vhashcpu[8]; - const uint32_t Htarg = ptarget[6]; - - for (int k=16; k < 19; k++) - be32enc(&endiandata[k], pdata[k]); - - be32enc(&endiandata[19], work->nonces[0]); - blake256hash(vhashcpu, endiandata, blakerounds); - - if (vhashcpu[6] <= Htarg && fulltest(vhashcpu, ptarget)) - { - work->valid_nonces = 1; - work_set_target_ratio(work, vhashcpu); -#if NBN > 1 - if (extra_results[0] != UINT32_MAX) { - work->nonces[1] = extra_results[0]; - be32enc(&endiandata[19], work->nonces[1]); - blake256hash(vhashcpu, endiandata, blakerounds); - if (vhashcpu[6] <= Htarg && fulltest(vhashcpu, ptarget)) { - if (bn_hash_target_ratio(vhashcpu, ptarget) > work->shareratio[0]) { - work_set_target_ratio(work, vhashcpu); - xchg(work->nonces[0], work->nonces[1]); - } else { - bn_set_target_ratio(work, vhashcpu, 1); - } - work->valid_nonces = 2; - } - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - extra_results[0] = UINT32_MAX; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } -#endif - return work->valid_nonces; - } - else if (vhashcpu[6] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart && max_nonce > (uint64_t)throughput + pdata[19]); - - *hashes_done = pdata[19] - first_nonce; - - MyStreamSynchronize(NULL, 0, device_map[thr_id]); - return rc; -} - -// cleanup -extern "C" void free_blake256(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaDeviceSynchronize(); - - cudaFreeHost(h_resNonce[thr_id]); - cudaFree(d_resNonce[thr_id]); - - init[thr_id] = false; - - cudaDeviceSynchronize(); -} - diff --git a/Algo256/blake2s.cu b/Algo256/blake2s.cu deleted file mode 100644 index 29d28f49..00000000 --- a/Algo256/blake2s.cu +++ /dev/null @@ -1,552 +0,0 @@ -/** - * Based on the SPH implementation of blake2s - * Provos Alexis - 2016 - */ - -#include "miner.h" - -#include -#include - -#include "sph/blake2s.h" -#include "sph/sph_types.h" - -#ifdef __INTELLISENSE__ -#define __byte_perm(x, y, b) x -#endif - -#include "cuda_helper.h" - -#ifdef __CUDA_ARCH__ - -__device__ __forceinline__ -uint32_t ROR8(const uint32_t a) { - return __byte_perm(a, 0, 0x0321); -} - -__device__ __forceinline__ -uint32_t ROL16(const uint32_t a) { - return __byte_perm(a, 0, 0x1032); -} - -#else -#define ROR8(u) (u >> 8) -#define ROL16(u) (u << 16) -#endif - -static const uint32_t blake2s_IV[8] = { - 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL, - 0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL -}; - -static const uint8_t blake2s_sigma[10][16] = { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, - { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 }, - { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 }, - { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 }, - { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 }, - { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 }, -}; - -#define G(r,i,a,b,c,d) \ - do { \ - a = a + b + m[blake2s_sigma[r][2*i+0]]; \ - d = SPH_ROTR32(d ^ a, 16); \ - c = c + d; \ - b = SPH_ROTR32(b ^ c, 12); \ - a = a + b + m[blake2s_sigma[r][2*i+1]]; \ - d = SPH_ROTR32(d ^ a, 8); \ - c = c + d; \ - b = SPH_ROTR32(b ^ c, 7); \ - } while(0) -#define ROUND(r) \ - do { \ - G(r,0,v[0],v[4],v[ 8],v[12]); \ - G(r,1,v[1],v[5],v[ 9],v[13]); \ - G(r,2,v[2],v[6],v[10],v[14]); \ - G(r,3,v[3],v[7],v[11],v[15]); \ - G(r,4,v[0],v[5],v[10],v[15]); \ - G(r,5,v[1],v[6],v[11],v[12]); \ - G(r,6,v[2],v[7],v[ 8],v[13]); \ - G(r,7,v[3],v[4],v[ 9],v[14]); \ - } while(0) - -extern "C" void blake2s_hash(void *output, const void *input) -{ - uint32_t m[16]; - uint32_t v[16]; - uint32_t h[8]; - - uint32_t *in = (uint32_t*)input; -// COMPRESS - for(int i = 0; i < 16; ++i ) - m[i] = in[i]; - - h[0] = 0x01010020 ^ blake2s_IV[0]; - h[1] = blake2s_IV[1]; - h[2] = blake2s_IV[2]; - h[3] = blake2s_IV[3]; - h[4] = blake2s_IV[4]; - h[5] = blake2s_IV[5]; - h[6] = blake2s_IV[6]; - h[7] = blake2s_IV[7]; - - for(int i = 0; i < 8; ++i ) - v[i] = h[i]; - - v[ 8] = blake2s_IV[0]; v[ 9] = blake2s_IV[1]; - v[10] = blake2s_IV[2]; v[11] = blake2s_IV[3]; - v[12] = 64 ^ blake2s_IV[4]; v[13] = blake2s_IV[5]; - v[14] = blake2s_IV[6]; v[15] = blake2s_IV[7]; - - ROUND( 0 ); ROUND( 1 ); - ROUND( 2 ); ROUND( 3 ); - ROUND( 4 ); ROUND( 5 ); - ROUND( 6 ); ROUND( 7 ); - ROUND( 8 ); ROUND( 9 ); - - for(size_t i = 0; i < 8; ++i) - h[i] ^= v[i] ^ v[i + 8]; - -// COMPRESS - m[0] = in[16]; m[1] = in[17]; - m[2] = in[18]; m[3] = in[19]; - for(size_t i = 4; i < 16; ++i) - m[i] = 0; - - for(size_t i = 0; i < 8; ++i) - v[i] = h[i]; - - v[ 8] = blake2s_IV[0]; v[ 9] = blake2s_IV[1]; - v[10] = blake2s_IV[2]; v[11] = blake2s_IV[3]; - v[12] = 0x50 ^ blake2s_IV[4]; v[13] = blake2s_IV[5]; - v[14] = ~blake2s_IV[6]; v[15] = blake2s_IV[7]; - - ROUND( 0 ); ROUND( 1 ); - ROUND( 2 ); ROUND( 3 ); - ROUND( 4 ); ROUND( 5 ); - ROUND( 6 ); ROUND( 7 ); - ROUND( 8 ); ROUND( 9 ); - - for(size_t i = 0; i < 8; ++i) - h[i] ^= v[i] ^ v[i + 8]; - - memcpy(output, h, 32); -} - -#define TPB 1024 -#define NPT 256 -#define maxResults 16 -#define NBN 1 - -__constant__ uint32_t _ALIGN(32) midstate[20]; - -static uint32_t *d_resNonce[MAX_GPUS]; -static uint32_t *h_resNonce[MAX_GPUS]; - -#define GS4(a,b,c,d,e,f,a1,b1,c1,d1,e1,f1,a2,b2,c2,d2,e2,f2,a3,b3,c3,d3,e3,f3){ \ - a += b + e; a1+= b1 + e1; a2+= b2 + e2; a3+= b3 + e3; \ - d = ROL16( d ^ a); d1 = ROL16(d1 ^ a1); d2 = ROL16(d2 ^ a2); d3 = ROL16(d3 ^ a3); \ - c +=d; c1+=d1; c2+=d2; c3+=d3;\ - b = ROTR32(b ^ c, 12); b1 = ROTR32(b1^c1, 12); b2 = ROTR32(b2^c2, 12); b3 = ROTR32(b3^c3, 12); \ - a += b + f; a1+= b1 + f1; a2+= b2 + f2; a3+= b3 + f3; \ - d = ROR8(d ^ a); d1 = ROR8(d1^a1); d2 = ROR8(d2^a2); d3 = ROR8(d3^a3); \ - c += d; c1 += d1; c2 += d2; c3 += d3;\ - b = ROTR32(b ^ c, 7); b1 = ROTR32(b1^c1, 7); b2 = ROTR32(b2^c2, 7); b3 = ROTR32(b3^c3, 7); \ -} - -__global__ __launch_bounds__(TPB,1) -void blake2s_gpu_hash_nonce(const uint32_t threads, const uint32_t startNonce, uint32_t *resNonce, const uint32_t ptarget7) -{ - const uint32_t step = gridDim.x * blockDim.x; - - uint32_t m[ 3]; - uint32_t v[16]; - - m[0] = midstate[16]; - m[1] = midstate[17]; - m[2] = midstate[18]; - - const uint32_t h7 = midstate[19]; - - for(uint32_t thread = blockDim.x * blockIdx.x + threadIdx.x ; thread data; - uint32_t *ptarget = work->target; - uint32_t *resNonces; - - const uint32_t first_nonce = pdata[19]; - - const int dev_id = device_map[thr_id]; - int rc = 0; - int intensity = is_windows() ? 25 : 28; - uint32_t throughput = cuda_default_throughput(thr_id, 1U << intensity); - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - const dim3 grid((throughput + (NPT*TPB)-1)/(NPT*TPB)); - const dim3 block(TPB); - - if (!init[thr_id]) - { - cudaSetDevice(dev_id); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage (linux) - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - cuda_get_arch(thr_id); - - CUDA_CALL_OR_RET_X(cudaMalloc(&d_resNonce[thr_id], maxResults * sizeof(uint32_t)), -1); - CUDA_CALL_OR_RET_X(cudaMallocHost(&h_resNonce[thr_id], maxResults * sizeof(uint32_t)), -1); - init[thr_id] = true; - } - resNonces = h_resNonce[thr_id]; - - for (int i=0; i < 19; i++) { - be32enc(&endiandata[i], pdata[i]); - } - blake2s_setBlock(endiandata,ptarget[7]); - - cudaMemset(d_resNonce[thr_id], 0x00, maxResults*sizeof(uint32_t)); - - do { - if(ptarget[7]) { - blake2s_gpu_hash_nonce<<>>(throughput,pdata[19],d_resNonce[thr_id],ptarget[7]); - } else { - blake2s_gpu_hash_nonce<<>>(throughput,pdata[19],d_resNonce[thr_id]); - } - cudaMemcpy(resNonces, d_resNonce[thr_id], sizeof(uint32_t), cudaMemcpyDeviceToHost); - - if(resNonces[0]) - { - cudaMemcpy(resNonces, d_resNonce[thr_id], maxResults*sizeof(uint32_t), cudaMemcpyDeviceToHost); - cudaMemset(d_resNonce[thr_id], 0x00, sizeof(uint32_t)); - - if(resNonces[0] >= maxResults) { - gpulog(LOG_WARNING, thr_id, "candidates flood: %u", resNonces[0]); - resNonces[0] = maxResults-1; - } - - uint32_t vhashcpu[8]; - uint32_t nonce = sph_bswap32(resNonces[1]); - be32enc(&endiandata[19], nonce); - blake2s_hash(vhashcpu, endiandata); - - *hashes_done = pdata[19] - first_nonce + throughput; - - if(vhashcpu[6] <= ptarget[6] && fulltest(vhashcpu, ptarget)) - { - work_set_target_ratio(work, vhashcpu); - work->nonces[0] = nonce; - rc = work->valid_nonces = 1; - - // search for 2nd best nonce - for(uint32_t j=2; j <= resNonces[0]; j++) - { - nonce = sph_bswap32(resNonces[j]); - be32enc(&endiandata[19], nonce); - blake2s_hash(vhashcpu, endiandata); - if(vhashcpu[6] <= ptarget[6] && fulltest(vhashcpu, ptarget)) - { - gpulog(LOG_DEBUG, thr_id, "Multiple nonces: 1/%08x - %u/%08x", work->nonces[0], j, nonce); - - work->nonces[1] = nonce; - if (bn_hash_target_ratio(vhashcpu, ptarget) > work->shareratio[0]) { - work->shareratio[1] = work->shareratio[0]; - work->sharediff[1] = work->sharediff[0]; - xchg(work->nonces[1], work->nonces[0]); - work_set_target_ratio(work, vhashcpu); - } else if (work->valid_nonces == 1) { - bn_set_target_ratio(work, vhashcpu, 1); - } - - work->valid_nonces++; - rc = 2; - break; - } - } - pdata[19] = max(work->nonces[0], work->nonces[1]); // next scan start - return rc; - } else if (vhashcpu[7] > ptarget[7]) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", resNonces[0]); - } - } - - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart && (uint64_t)max_nonce > (uint64_t)throughput + pdata[19]); - - *hashes_done = pdata[19] - first_nonce; - - return rc; -} - -// cleanup -extern "C" void free_blake2s(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaDeviceSynchronize(); - - cudaFreeHost(h_resNonce[thr_id]); - cudaFree(d_resNonce[thr_id]); - - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/Algo256/bmw.cu b/Algo256/bmw.cu deleted file mode 100644 index c2e4be60..00000000 --- a/Algo256/bmw.cu +++ /dev/null @@ -1,138 +0,0 @@ -/** - * bmw-256 MDT - * tpruvot - 2015 - */ -extern "C" { -#include "sph/sph_bmw.h" -} - -#include -#include - -static uint32_t *d_hash[MAX_GPUS]; - -extern void bmw256_midstate_init(int thr_id, uint32_t threads); -extern void bmw256_midstate_free(int thr_id); -extern void bmw256_setBlock_80(int thr_id, void *pdata); -extern void bmw256_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_outputHash, int swap); - -extern uint32_t cuda_check_hash_32(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_inputHash); - -// CPU Hash -extern "C" void bmw_hash(void *state, const void *input) -{ - uint32_t _ALIGN(64) hash[16]; - sph_bmw256_context ctx; - - sph_bmw256_init(&ctx); - sph_bmw256(&ctx, input, 80); - sph_bmw256_close(&ctx, (void*) hash); - - memcpy(state, hash, 32); -} - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_bmw(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t _ALIGN(64) endiandata[20]; - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - uint32_t throughput = cuda_default_throughput(thr_id, 1U << 21); - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ptarget[7] = 0x0005; - - if (!init[thr_id]) { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - cuda_check_cpu_init(thr_id, throughput); - bmw256_midstate_init(thr_id, throughput); - - CUDA_SAFE_CALL(cudaMalloc(&d_hash[thr_id], (size_t)32 * throughput)); - - init[thr_id] = true; - } - - for (int k=0; k < 20; k++) { - be32enc(&endiandata[k], ((uint32_t*)pdata)[k]); - } - - cudaGetLastError(); - bmw256_setBlock_80(thr_id, (void*)endiandata); - - cuda_check_cpu_setTarget(ptarget); - - do { - bmw256_cpu_hash_80(thr_id, (int) throughput, pdata[19], d_hash[thr_id], 1); - - *hashes_done = pdata[19] - first_nonce + throughput; - - work->nonces[0] = cuda_check_hash_32(thr_id, throughput, pdata[19], d_hash[thr_id]); - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - be32enc(&endiandata[19], work->nonces[0]); - bmw_hash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - bmw_hash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - return 0; -} - -// cleanup -extern "C" void free_bmw(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - bmw256_midstate_free(thr_id); - cuda_check_cpu_free(thr_id); - - cudaDeviceSynchronize(); - init[thr_id] = false; -} diff --git a/Algo256/cuda_blake256.cu b/Algo256/cuda_blake256.cu deleted file mode 100644 index 418ca07e..00000000 --- a/Algo256/cuda_blake256.cu +++ /dev/null @@ -1,580 +0,0 @@ -/** - * Blake-256 Cuda Kernel (Tested on SM 5.0) - * - * Tanguy Pruvot - Nov. 2014 - * - * + merged blake+keccak kernel for lyra2v2 - */ -extern "C" { -#include "sph/sph_blake.h" -} - -#include "cuda_helper.h" - -#include - -#ifdef __INTELLISENSE__ -/* just for vstudio code colors */ -__device__ uint32_t __byte_perm(uint32_t a, uint32_t b, uint32_t c); -#endif - -#define UINT2(x,y) make_uint2(x,y) - -__device__ __inline__ uint2 ROR8(const uint2 a) { - uint2 result; - result.x = __byte_perm(a.y, a.x, 0x0765); - result.y = __byte_perm(a.x, a.y, 0x0765); - return result; -} - -static __device__ uint64_t cuda_swab32ll(uint64_t x) { - return MAKE_ULONGLONG(cuda_swab32(_LODWORD(x)), cuda_swab32(_HIDWORD(x))); -} - -__constant__ static uint32_t c_data[3 + 1]; - -__constant__ static uint32_t sigma[16][16]; -static uint32_t c_sigma[16][16] = { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, - { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 }, - { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 }, - { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 }, - { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 }, - { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 }, - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, - { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } -}; - -static const uint32_t c_IV256[8] = { - 0x6A09E667, 0xBB67AE85, - 0x3C6EF372, 0xA54FF53A, - 0x510E527F, 0x9B05688C, - 0x1F83D9AB, 0x5BE0CD19 -}; - -__device__ __constant__ static uint32_t cpu_h[8]; - -__device__ __constant__ static uint32_t u256[16]; -static const uint32_t c_u256[16] = { - 0x243F6A88, 0x85A308D3, - 0x13198A2E, 0x03707344, - 0xA4093822, 0x299F31D0, - 0x082EFA98, 0xEC4E6C89, - 0x452821E6, 0x38D01377, - 0xBE5466CF, 0x34E90C6C, - 0xC0AC29B7, 0xC97C50DD, - 0x3F84D5B5, 0xB5470917 -}; - -__constant__ uint2 keccak_round_constants35[24] = { - { 0x00000001ul, 0x00000000 }, { 0x00008082ul, 0x00000000 }, - { 0x0000808aul, 0x80000000 }, { 0x80008000ul, 0x80000000 }, - { 0x0000808bul, 0x00000000 }, { 0x80000001ul, 0x00000000 }, - { 0x80008081ul, 0x80000000 }, { 0x00008009ul, 0x80000000 }, - { 0x0000008aul, 0x00000000 }, { 0x00000088ul, 0x00000000 }, - { 0x80008009ul, 0x00000000 }, { 0x8000000aul, 0x00000000 }, - { 0x8000808bul, 0x00000000 }, { 0x0000008bul, 0x80000000 }, - { 0x00008089ul, 0x80000000 }, { 0x00008003ul, 0x80000000 }, - { 0x00008002ul, 0x80000000 }, { 0x00000080ul, 0x80000000 }, - { 0x0000800aul, 0x00000000 }, { 0x8000000aul, 0x80000000 }, - { 0x80008081ul, 0x80000000 }, { 0x00008080ul, 0x80000000 }, - { 0x80000001ul, 0x00000000 }, { 0x80008008ul, 0x80000000 } -}; - - -#define GS2(a,b,c,d,x) { \ - const uint32_t idx1 = sigma[r][x]; \ - const uint32_t idx2 = sigma[r][(x)+1]; \ - v[a] += (m[idx1] ^ u256[idx2]) + v[b]; \ - v[d] = SPH_ROTL32(v[d] ^ v[a], 16); \ - v[c] += v[d]; \ - v[b] = SPH_ROTR32(v[b] ^ v[c], 12); \ -\ - v[a] += (m[idx2] ^ u256[idx1]) + v[b]; \ - v[d] = SPH_ROTR32(v[d] ^ v[a], 8); \ - v[c] += v[d]; \ - v[b] = SPH_ROTR32(v[b] ^ v[c], 7); \ -} - -//#define ROTL32(x, n) ((x) << (n)) | ((x) >> (32 - (n))) -//#define ROTR32(x, n) (((x) >> (n)) | ((x) << (32 - (n)))) -#define hostGS(a,b,c,d,x) { \ - const uint32_t idx1 = c_sigma[r][x]; \ - const uint32_t idx2 = c_sigma[r][(x)+1]; \ - v[a] += (m[idx1] ^ c_u256[idx2]) + v[b]; \ - v[d] = ROTR32(v[d] ^ v[a], 16); \ - v[c] += v[d]; \ - v[b] = ROTR32(v[b] ^ v[c], 12); \ -\ - v[a] += (m[idx2] ^ c_u256[idx1]) + v[b]; \ - v[d] = ROTR32(v[d] ^ v[a], 8); \ - v[c] += v[d]; \ - v[b] = ROTR32(v[b] ^ v[c], 7); \ - } - -#define GSPREC(a,b,c,d,x,y) { \ - v[a] += (m[x] ^ u256[y]) + v[b]; \ - v[d] = __byte_perm(v[d] ^ v[a],0, 0x1032); \ - v[c] += v[d]; \ - v[b] = SPH_ROTR32(v[b] ^ v[c], 12); \ - v[a] += (m[y] ^ u256[x]) + v[b]; \ - v[d] = __byte_perm(v[d] ^ v[a],0, 0x0321); \ - v[c] += v[d]; \ - v[b] = SPH_ROTR32(v[b] ^ v[c], 7); \ - } - -/* Second part (64-80) msg never change, store it */ -__device__ __constant__ static const uint32_t c_Padding[16] = { - 0, 0, 0, 0, - 0x80000000, 0, 0, 0, - 0, 0, 0, 0, - 0, 1, 0, 640, -}; - -__host__ __forceinline__ -static void blake256_compress1st(uint32_t *h, const uint32_t *block, const uint32_t T0) -{ - uint32_t m[16]; - uint32_t v[16]; - - for (int i = 0; i < 16; i++) { - m[i] = block[i]; - } - - for (int i = 0; i < 8; i++) - v[i] = h[i]; - - v[8] = c_u256[0]; - v[9] = c_u256[1]; - v[10] = c_u256[2]; - v[11] = c_u256[3]; - - v[12] = c_u256[4] ^ T0; - v[13] = c_u256[5] ^ T0; - v[14] = c_u256[6]; - v[15] = c_u256[7]; - - for (int r = 0; r < 14; r++) { - /* column step */ - hostGS(0, 4, 0x8, 0xC, 0x0); - hostGS(1, 5, 0x9, 0xD, 0x2); - hostGS(2, 6, 0xA, 0xE, 0x4); - hostGS(3, 7, 0xB, 0xF, 0x6); - /* diagonal step */ - hostGS(0, 5, 0xA, 0xF, 0x8); - hostGS(1, 6, 0xB, 0xC, 0xA); - hostGS(2, 7, 0x8, 0xD, 0xC); - hostGS(3, 4, 0x9, 0xE, 0xE); - } - - for (int i = 0; i < 16; i++) { - int j = i & 7; - h[j] ^= v[i]; - } -} - -__device__ __forceinline__ -static void blake256_compress2nd(uint32_t *h, const uint32_t *block, const uint32_t T0) -{ - uint32_t m[16]; - uint32_t v[16]; - - m[0] = block[0]; - m[1] = block[1]; - m[2] = block[2]; - m[3] = block[3]; - - #pragma unroll - for (int i = 4; i < 16; i++) { - m[i] = c_Padding[i]; - } - - #pragma unroll 8 - for (int i = 0; i < 8; i++) - v[i] = h[i]; - - v[8] = u256[0]; - v[9] = u256[1]; - v[10] = u256[2]; - v[11] = u256[3]; - - v[12] = u256[4] ^ T0; - v[13] = u256[5] ^ T0; - v[14] = u256[6]; - v[15] = u256[7]; - - #pragma unroll 14 - for (int r = 0; r < 14; r++) { - /* column step */ - GS2(0, 4, 0x8, 0xC, 0x0); - GS2(1, 5, 0x9, 0xD, 0x2); - GS2(2, 6, 0xA, 0xE, 0x4); - GS2(3, 7, 0xB, 0xF, 0x6); - /* diagonal step */ - GS2(0, 5, 0xA, 0xF, 0x8); - GS2(1, 6, 0xB, 0xC, 0xA); - GS2(2, 7, 0x8, 0xD, 0xC); - GS2(3, 4, 0x9, 0xE, 0xE); - } - - #pragma unroll 16 - for (int i = 0; i < 16; i++) { - int j = i & 7; - h[j] ^= v[i]; - } -} - -static void __forceinline__ __device__ keccak_block(uint2 *s) -{ - uint2 bc[5], tmpxor[5], u, v; - // uint2 s[25]; - - #pragma unroll 1 - for (int i = 0; i < 24; i++) - { - #pragma unroll - for (uint32_t x = 0; x < 5; x++) - tmpxor[x] = s[x] ^ s[x + 5] ^ s[x + 10] ^ s[x + 15] ^ s[x + 20]; - - bc[0] = tmpxor[0] ^ ROL2(tmpxor[2], 1); - bc[1] = tmpxor[1] ^ ROL2(tmpxor[3], 1); - bc[2] = tmpxor[2] ^ ROL2(tmpxor[4], 1); - bc[3] = tmpxor[3] ^ ROL2(tmpxor[0], 1); - bc[4] = tmpxor[4] ^ ROL2(tmpxor[1], 1); - - u = s[1] ^ bc[0]; - - s[0] ^= bc[4]; - s[1] = ROL2(s[6] ^ bc[0], 44); - s[6] = ROL2(s[9] ^ bc[3], 20); - s[9] = ROL2(s[22] ^ bc[1], 61); - s[22] = ROL2(s[14] ^ bc[3], 39); - s[14] = ROL2(s[20] ^ bc[4], 18); - s[20] = ROL2(s[2] ^ bc[1], 62); - s[2] = ROL2(s[12] ^ bc[1], 43); - s[12] = ROL2(s[13] ^ bc[2], 25); - s[13] = ROL8(s[19] ^ bc[3]); - s[19] = ROR8(s[23] ^ bc[2]); - s[23] = ROL2(s[15] ^ bc[4], 41); - s[15] = ROL2(s[4] ^ bc[3], 27); - s[4] = ROL2(s[24] ^ bc[3], 14); - s[24] = ROL2(s[21] ^ bc[0], 2); - s[21] = ROL2(s[8] ^ bc[2], 55); - s[8] = ROL2(s[16] ^ bc[0], 45); - s[16] = ROL2(s[5] ^ bc[4], 36); - s[5] = ROL2(s[3] ^ bc[2], 28); - s[3] = ROL2(s[18] ^ bc[2], 21); - s[18] = ROL2(s[17] ^ bc[1], 15); - s[17] = ROL2(s[11] ^ bc[0], 10); - s[11] = ROL2(s[7] ^ bc[1], 6); - s[7] = ROL2(s[10] ^ bc[4], 3); - s[10] = ROL2(u, 1); - - u = s[0]; v = s[1]; s[0] ^= (~v) & s[2]; s[1] ^= (~s[2]) & s[3]; s[2] ^= (~s[3]) & s[4]; s[3] ^= (~s[4]) & u; s[4] ^= (~u) & v; - u = s[5]; v = s[6]; s[5] ^= (~v) & s[7]; s[6] ^= (~s[7]) & s[8]; s[7] ^= (~s[8]) & s[9]; s[8] ^= (~s[9]) & u; s[9] ^= (~u) & v; - u = s[10]; v = s[11]; s[10] ^= (~v) & s[12]; s[11] ^= (~s[12]) & s[13]; s[12] ^= (~s[13]) & s[14]; s[13] ^= (~s[14]) & u; s[14] ^= (~u) & v; - u = s[15]; v = s[16]; s[15] ^= (~v) & s[17]; s[16] ^= (~s[17]) & s[18]; s[17] ^= (~s[18]) & s[19]; s[18] ^= (~s[19]) & u; s[19] ^= (~u) & v; - u = s[20]; v = s[21]; s[20] ^= (~v) & s[22]; s[21] ^= (~s[22]) & s[23]; s[22] ^= (~s[23]) & s[24]; s[23] ^= (~s[24]) & u; s[24] ^= (~u) & v; - s[0] ^= keccak_round_constants35[i]; - } -} - - -//__launch_bounds__(256) -__global__ -void blakeKeccak256_gpu_hash_80(const uint32_t threads, const uint32_t startNonce, uint32_t * Hash) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const uint32_t nonce = startNonce + thread; - const uint32_t T0 = 640; - - uint32_t h[8]; - #pragma unroll 8 - for (int i = 0; i<8; i++) { h[i] = cpu_h[i]; } - - uint32_t v[16]; - - const uint32_t c_Padding[12] = { - 0x80000000, 0, 0, 0, - 0, 0, 0, 0, - 0, 1, 0, 640 - }; - - const uint32_t u256[16] = { - 0x243F6A88, 0x85A308D3, - 0x13198A2E, 0x03707344, - 0xA4093822, 0x299F31D0, - 0x082EFA98, 0xEC4E6C89, - 0x452821E6, 0x38D01377, - 0xBE5466CF, 0x34E90C6C, - 0xC0AC29B7, 0xC97C50DD, - 0x3F84D5B5, 0xB5470917 - }; - - uint32_t m[16] = { - c_data[0], c_data[1], c_data[2], nonce, - c_Padding[0], c_Padding[1], c_Padding[2], c_Padding[3], - c_Padding[4], c_Padding[5], c_Padding[6], c_Padding[7], - c_Padding[8], c_Padding[9], c_Padding[10], c_Padding[11] - }; - - #pragma unroll 8 - for (int i = 0; i < 8; i++) - v[i] = h[i]; - - v[8] = u256[0]; - v[9] = u256[1]; - v[10] = u256[2]; - v[11] = u256[3]; - v[12] = u256[4] ^ T0; - v[13] = u256[5] ^ T0; - v[14] = u256[6]; - v[15] = u256[7]; - - // { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - GSPREC(0, 4, 0x8, 0xC, 0, 1); - GSPREC(1, 5, 0x9, 0xD, 2, 3); - GSPREC(2, 6, 0xA, 0xE, 4, 5); - GSPREC(3, 7, 0xB, 0xF, 6, 7); - GSPREC(0, 5, 0xA, 0xF, 8, 9); - GSPREC(1, 6, 0xB, 0xC, 10, 11); - GSPREC(2, 7, 0x8, 0xD, 12, 13); - GSPREC(3, 4, 0x9, 0xE, 14, 15); - // { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - GSPREC(0, 4, 0x8, 0xC, 14, 10); - GSPREC(1, 5, 0x9, 0xD, 4, 8); - GSPREC(2, 6, 0xA, 0xE, 9, 15); - GSPREC(3, 7, 0xB, 0xF, 13, 6); - GSPREC(0, 5, 0xA, 0xF, 1, 12); - GSPREC(1, 6, 0xB, 0xC, 0, 2); - GSPREC(2, 7, 0x8, 0xD, 11, 7); - GSPREC(3, 4, 0x9, 0xE, 5, 3); - // { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - GSPREC(0, 4, 0x8, 0xC, 11, 8); - GSPREC(1, 5, 0x9, 0xD, 12, 0); - GSPREC(2, 6, 0xA, 0xE, 5, 2); - GSPREC(3, 7, 0xB, 0xF, 15, 13); - GSPREC(0, 5, 0xA, 0xF, 10, 14); - GSPREC(1, 6, 0xB, 0xC, 3, 6); - GSPREC(2, 7, 0x8, 0xD, 7, 1); - GSPREC(3, 4, 0x9, 0xE, 9, 4); - // { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - GSPREC(0, 4, 0x8, 0xC, 7, 9); - GSPREC(1, 5, 0x9, 0xD, 3, 1); - GSPREC(2, 6, 0xA, 0xE, 13, 12); - GSPREC(3, 7, 0xB, 0xF, 11, 14); - GSPREC(0, 5, 0xA, 0xF, 2, 6); - GSPREC(1, 6, 0xB, 0xC, 5, 10); - GSPREC(2, 7, 0x8, 0xD, 4, 0); - GSPREC(3, 4, 0x9, 0xE, 15, 8); - // { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, - GSPREC(0, 4, 0x8, 0xC, 9, 0); - GSPREC(1, 5, 0x9, 0xD, 5, 7); - GSPREC(2, 6, 0xA, 0xE, 2, 4); - GSPREC(3, 7, 0xB, 0xF, 10, 15); - GSPREC(0, 5, 0xA, 0xF, 14, 1); - GSPREC(1, 6, 0xB, 0xC, 11, 12); - GSPREC(2, 7, 0x8, 0xD, 6, 8); - GSPREC(3, 4, 0x9, 0xE, 3, 13); - // { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 }, - GSPREC(0, 4, 0x8, 0xC, 2, 12); - GSPREC(1, 5, 0x9, 0xD, 6, 10); - GSPREC(2, 6, 0xA, 0xE, 0, 11); - GSPREC(3, 7, 0xB, 0xF, 8, 3); - GSPREC(0, 5, 0xA, 0xF, 4, 13); - GSPREC(1, 6, 0xB, 0xC, 7, 5); - GSPREC(2, 7, 0x8, 0xD, 15, 14); - GSPREC(3, 4, 0x9, 0xE, 1, 9); - // { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 }, - GSPREC(0, 4, 0x8, 0xC, 12, 5); - GSPREC(1, 5, 0x9, 0xD, 1, 15); - GSPREC(2, 6, 0xA, 0xE, 14, 13); - GSPREC(3, 7, 0xB, 0xF, 4, 10); - GSPREC(0, 5, 0xA, 0xF, 0, 7); - GSPREC(1, 6, 0xB, 0xC, 6, 3); - GSPREC(2, 7, 0x8, 0xD, 9, 2); - GSPREC(3, 4, 0x9, 0xE, 8, 11); - // { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 }, - GSPREC(0, 4, 0x8, 0xC, 13, 11); - GSPREC(1, 5, 0x9, 0xD, 7, 14); - GSPREC(2, 6, 0xA, 0xE, 12, 1); - GSPREC(3, 7, 0xB, 0xF, 3, 9); - GSPREC(0, 5, 0xA, 0xF, 5, 0); - GSPREC(1, 6, 0xB, 0xC, 15, 4); - GSPREC(2, 7, 0x8, 0xD, 8, 6); - GSPREC(3, 4, 0x9, 0xE, 2, 10); - // { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 }, - GSPREC(0, 4, 0x8, 0xC, 6, 15); - GSPREC(1, 5, 0x9, 0xD, 14, 9); - GSPREC(2, 6, 0xA, 0xE, 11, 3); - GSPREC(3, 7, 0xB, 0xF, 0, 8); - GSPREC(0, 5, 0xA, 0xF, 12, 2); - GSPREC(1, 6, 0xB, 0xC, 13, 7); - GSPREC(2, 7, 0x8, 0xD, 1, 4); - GSPREC(3, 4, 0x9, 0xE, 10, 5); - // { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 }, - GSPREC(0, 4, 0x8, 0xC, 10, 2); - GSPREC(1, 5, 0x9, 0xD, 8, 4); - GSPREC(2, 6, 0xA, 0xE, 7, 6); - GSPREC(3, 7, 0xB, 0xF, 1, 5); - GSPREC(0, 5, 0xA, 0xF, 15, 11); - GSPREC(1, 6, 0xB, 0xC, 9, 14); - GSPREC(2, 7, 0x8, 0xD, 3, 12); - GSPREC(3, 4, 0x9, 0xE, 13, 0); - // { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - GSPREC(0, 4, 0x8, 0xC, 0, 1); - GSPREC(1, 5, 0x9, 0xD, 2, 3); - GSPREC(2, 6, 0xA, 0xE, 4, 5); - GSPREC(3, 7, 0xB, 0xF, 6, 7); - GSPREC(0, 5, 0xA, 0xF, 8, 9); - GSPREC(1, 6, 0xB, 0xC, 10, 11); - GSPREC(2, 7, 0x8, 0xD, 12, 13); - GSPREC(3, 4, 0x9, 0xE, 14, 15); - // { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - GSPREC(0, 4, 0x8, 0xC, 14, 10); - GSPREC(1, 5, 0x9, 0xD, 4, 8); - GSPREC(2, 6, 0xA, 0xE, 9, 15); - GSPREC(3, 7, 0xB, 0xF, 13, 6); - GSPREC(0, 5, 0xA, 0xF, 1, 12); - GSPREC(1, 6, 0xB, 0xC, 0, 2); - GSPREC(2, 7, 0x8, 0xD, 11, 7); - GSPREC(3, 4, 0x9, 0xE, 5, 3); - // { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - GSPREC(0, 4, 0x8, 0xC, 11, 8); - GSPREC(1, 5, 0x9, 0xD, 12, 0); - GSPREC(2, 6, 0xA, 0xE, 5, 2); - GSPREC(3, 7, 0xB, 0xF, 15, 13); - GSPREC(0, 5, 0xA, 0xF, 10, 14); - GSPREC(1, 6, 0xB, 0xC, 3, 6); - GSPREC(2, 7, 0x8, 0xD, 7, 1); - GSPREC(3, 4, 0x9, 0xE, 9, 4); - // { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - GSPREC(0, 4, 0x8, 0xC, 7, 9); - GSPREC(1, 5, 0x9, 0xD, 3, 1); - GSPREC(2, 6, 0xA, 0xE, 13, 12); - GSPREC(3, 7, 0xB, 0xF, 11, 14); - GSPREC(0, 5, 0xA, 0xF, 2, 6); - GSPREC(1, 6, 0xB, 0xC, 5, 10); - GSPREC(2, 7, 0x8, 0xD, 4, 0); - GSPREC(3, 4, 0x9, 0xE, 15, 8); - - h[0] = cuda_swab32(h[0] ^ v[0] ^ v[8]); - h[1] = cuda_swab32(h[1] ^ v[1] ^ v[9]); - h[2] = cuda_swab32(h[2] ^ v[2] ^ v[10]); - h[3] = cuda_swab32(h[3] ^ v[3] ^ v[11]); - h[4] = cuda_swab32(h[4] ^ v[4] ^ v[12]); - h[5] = cuda_swab32(h[5] ^ v[5] ^ v[13]); - h[6] = cuda_swab32(h[6] ^ v[6] ^ v[14]); - h[7] = cuda_swab32(h[7] ^ v[7] ^ v[15]); - - uint2 keccak_gpu_state[25] = { 0 }; - keccak_gpu_state[0].x = h[0]; - keccak_gpu_state[0].y = h[1]; - keccak_gpu_state[1].x = h[2]; - keccak_gpu_state[1].y = h[3]; - keccak_gpu_state[2].x = h[4]; - keccak_gpu_state[2].y = h[5]; - keccak_gpu_state[3].x = h[6]; - keccak_gpu_state[3].y = h[7]; - keccak_gpu_state[4] = UINT2(1, 0); - - keccak_gpu_state[16] = UINT2(0, 0x80000000); - keccak_block(keccak_gpu_state); - - uint64_t *outputHash = (uint64_t *)Hash; - #pragma unroll 4 - for (int i = 0; i<4; i++) - outputHash[i*threads + thread] = devectorize(keccak_gpu_state[i]); - } -} - -__global__ __launch_bounds__(256, 3) -void blake256_gpu_hash_80(const uint32_t threads, const uint32_t startNonce, uint64_t * Hash) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t h[8]; - uint32_t input[4]; - - #pragma unroll - for (int i = 0; i < 8; i++) h[i] = cpu_h[i]; - - #pragma unroll - for (int i = 0; i < 3; ++i) input[i] = c_data[i]; - - input[3] = startNonce + thread; - blake256_compress2nd(h, input, 640); - - #pragma unroll - for (int i = 0; i<4; i++) { - Hash[i*threads + thread] = cuda_swab32ll(MAKE_ULONGLONG(h[2 * i], h[2 * i + 1])); - } - } -} - -__host__ -void blake256_cpu_hash_80(const int thr_id, const uint32_t threads, const uint32_t startNonce, uint64_t *Hash, int order) -{ - const uint32_t threadsperblock = 256; - - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - - blake256_gpu_hash_80 << > > (threads, startNonce, Hash); - MyStreamSynchronize(NULL, order, thr_id); -} - -__host__ -void blake256_cpu_setBlock_80(uint32_t *pdata) -{ - uint32_t h[8], data[20]; - - memcpy(data, pdata, 80); - memcpy(h, c_IV256, sizeof(c_IV256)); - blake256_compress1st(h, pdata, 512); - - cudaMemcpyToSymbol(cpu_h, h, sizeof(h), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(c_data, &data[16], sizeof(c_data), 0, cudaMemcpyHostToDevice); -} - -__host__ -void blake256_cpu_init(int thr_id, uint32_t threads) -{ - cudaMemcpyToSymbol(u256, c_u256, sizeof(c_u256), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(sigma, c_sigma, sizeof(c_sigma), 0, cudaMemcpyHostToDevice); -} - -/** for lyra2v2 **/ - -__host__ -void blakeKeccak256_cpu_hash_80(const int thr_id, const uint32_t threads, const uint32_t startNonce, uint64_t *Hash, int order) -{ - const uint32_t threadsperblock = 256; - - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - - blakeKeccak256_gpu_hash_80 <<>> (threads, startNonce, (uint32_t *)Hash); -} - -__host__ -void blakeKeccak256_cpu_hash_80(const int thr_id, const uint32_t threads, const uint32_t startNonce, uint64_t *Hash, int order, cudaStream_t stream) -{ - const uint32_t threadsperblock = 256; - - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - - blakeKeccak256_gpu_hash_80 <<>> (threads, startNonce, (uint32_t *)Hash); -} diff --git a/Algo256/cuda_bmw.cu b/Algo256/cuda_bmw.cu deleted file mode 100644 index c4638b99..00000000 --- a/Algo256/cuda_bmw.cu +++ /dev/null @@ -1,380 +0,0 @@ -/** - * BMW-256 CUDA Implementation - tpruvot 2015 - * - * Not optimal but close to the sph version and easier to adapt. - */ - -#include -#include - -#define SPH_64 1 -#define USE_MIDSTATE - -extern "C" { -#include "sph/sph_bmw.h" -} - -#include "cuda_helper.h" - -__constant__ uint64_t c_PaddedMessage80[16]; // padded message (80 bytes + padding) - -#ifndef USE_MIDSTATE -__constant__ static sph_u32 IV256[16] = { - 0x40414243, 0x44454647, 0x48494A4B, 0x4C4D4E4F, - 0x50515253, 0x54555657, 0x58595A5B, 0x5C5D5E5F, - 0x60616263, 0x64656667, 0x68696A6B, 0x6C6D6E6F, - 0x70717273, 0x74757677, 0x78797A7B, 0x7C7D7E7F -}; -#endif - -__constant__ static sph_u32 final_s[16] = { - 0xaaaaaaa0, 0xaaaaaaa1, 0xaaaaaaa2, 0xaaaaaaa3, - 0xaaaaaaa4, 0xaaaaaaa5, 0xaaaaaaa6, 0xaaaaaaa7, - 0xaaaaaaa8, 0xaaaaaaa9, 0xaaaaaaaa, 0xaaaaaaab, - 0xaaaaaaac, 0xaaaaaaad, 0xaaaaaaae, 0xaaaaaaaf -}; - -static sph_bmw_small_context* d_midstate[MAX_GPUS]; - -#define I16_16 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 -#define I16_17 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 -#define I16_18 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 -#define I16_19 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 -#define I16_20 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 -#define I16_21 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 -#define I16_22 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 -#define I16_23 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 -#define I16_24 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 -#define I16_25 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 -#define I16_26 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 -#define I16_27 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -#define I16_28 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 -#define I16_29 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28 -#define I16_30 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 -#define I16_31 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 - -//#define M16_16 0, 1, 3, 4, 7, 10, 11 -//#define M16_17 1, 2, 4, 5, 8, 11, 12 -#define M16_18 2, 3, 5, 6, 9, 12, 13 -#define M16_19 3, 4, 6, 7, 10, 13, 14 -#define M16_20 4, 5, 7, 8, 11, 14, 15 -#define M16_21 5, 6, 8, 9, 12, 15, 16 -#define M16_22 6, 7, 9, 10, 13, 0, 1 -#define M16_23 7, 8, 10, 11, 14, 1, 2 -#define M16_24 8, 9, 11, 12, 15, 2, 3 -#define M16_25 9, 10, 12, 13, 0, 3, 4 -#define M16_26 10, 11, 13, 14, 1, 4, 5 -#define M16_27 11, 12, 14, 15, 2, 5, 6 -#define M16_28 12, 13, 15, 16, 3, 6, 7 -#define M16_29 13, 14, 0, 1, 4, 7, 8 -#define M16_30 14, 15, 1, 2, 5, 8, 9 -#define M16_31 15, 16, 2, 3, 6, 9, 10 - -#define ss0(x) (((x) >> 1) ^ ((x) << 3) ^ ROTL32(x, 4) ^ ROTL32(x, 19)) -#define ss1(x) (((x) >> 1) ^ ((x) << 2) ^ ROTL32(x, 8) ^ ROTL32(x, 23)) -#define ss2(x) (((x) >> 2) ^ ((x) << 1) ^ ROTL32(x, 12) ^ ROTL32(x, 25)) -#define ss3(x) (((x) >> 2) ^ ((x) << 2) ^ ROTL32(x, 15) ^ ROTL32(x, 29)) -#define ss4(x) (((x) >> 1) ^ (x)) -#define ss5(x) (((x) >> 2) ^ (x)) - -#define rs1(x) ROTL32(x, 3) -#define rs2(x) ROTL32(x, 7) -#define rs3(x) ROTL32(x, 13) -#define rs4(x) ROTL32(x, 16) -#define rs5(x) ROTL32(x, 19) -#define rs6(x) ROTL32(x, 23) -#define rs7(x) ROTL32(x, 27) - -#define MAKE_W(tt, i0, op01, i1, op12, i2, op23, i3, op34, i4) \ - tt((data[i0] ^ h[i0]) op01 (data[i1] ^ h[i1]) op12 (data[i2] ^ h[i2]) op23 (data[i3] ^ h[i3]) op34 (data[i4] ^ h[i4])) -//#define Ws0 MAKE_W(SPH_T32, 5, -, 7, +, 10, +, 13, +, 14) -//#define Ws1 MAKE_W(SPH_T32, 6, -, 8, +, 11, +, 14, -, 15) -//#define Ws2 MAKE_W(SPH_T32, 0, +, 7, +, 9, -, 12, +, 15) -//#define Ws3 MAKE_W(SPH_T32, 0, -, 1, +, 8, -, 10, +, 13) -//#define Ws4 MAKE_W(SPH_T32, 1, +, 2, +, 9, -, 11, -, 14) -//#define Ws5 MAKE_W(SPH_T32, 3, -, 2, +, 10, -, 12, +, 15) -//#define Ws6 MAKE_W(SPH_T32, 4, -, 0, -, 3, -, 11, +, 13) -//#define Ws7 MAKE_W(SPH_T32, 1, -, 4, -, 5, -, 12, -, 14) -//#define Ws8 MAKE_W(SPH_T32, 2, -, 5, -, 6, +, 13, -, 15) -//#define Ws9 MAKE_W(SPH_T32, 0, -, 3, +, 6, -, 7, +, 14) -//#define Ws10 MAKE_W(SPH_T32, 8, -, 1, -, 4, -, 7, +, 15) -//#define Ws11 MAKE_W(SPH_T32, 8, -, 0, -, 2, -, 5, +, 9) -//#define Ws12 MAKE_W(SPH_T32, 1, +, 3, -, 6, -, 9, +, 10) -//#define Ws13 MAKE_W(SPH_T32, 2, +, 4, +, 7, +, 10, +, 11) -//#define Ws14 MAKE_W(SPH_T32, 3, -, 5, +, 8, -, 11, -, 12) -//#define Ws15 MAKE_W(SPH_T32, 12, -, 4, -, 6, -, 9, +, 13) - -__device__ -static void gpu_compress_small(const sph_u32 *data, const sph_u32 h[16], sph_u32 dh[16]) -{ - // FOLD MAKE_Qas; - - sph_u32 dx[16]; - for (int i=0; i<16; i++) - dx[i] = data[i] ^ h[i]; - - sph_u32 qt[32]; - qt[ 0] = dx[ 5] - dx[7] + dx[10] + dx[13] + dx[14]; // Ws0 - qt[ 1] = dx[ 6] - dx[8] + dx[11] + dx[14] - dx[15]; // Ws1 - qt[ 2] = dx[ 0] + dx[7] + dx[ 9] - dx[12] + dx[15]; // Ws2 - qt[ 3] = dx[ 0] - dx[1] + dx[ 8] - dx[10] + dx[13]; // Ws3 - qt[ 4] = dx[ 1] + dx[2] + dx[ 9] - dx[11] - dx[14]; // Ws4; - qt[ 5] = dx[ 3] - dx[2] + dx[10] - dx[12] + dx[15]; // Ws5; - qt[ 6] = dx[ 4] - dx[0] - dx[ 3] - dx[11] + dx[13]; // Ws6; - qt[ 7] = dx[ 1] - dx[4] - dx[ 5] - dx[12] - dx[14]; // Ws7; - qt[ 8] = dx[ 2] - dx[5] - dx[ 6] + dx[13] - dx[15]; // Ws8; - qt[ 9] = dx[ 0] - dx[3] + dx[ 6] - dx[ 7] + dx[14]; // Ws9; - qt[10] = dx[ 8] - dx[1] - dx[ 4] - dx[ 7] + dx[15]; // Ws10; - qt[11] = dx[ 8] - dx[0] - dx[ 2] - dx[ 5] + dx[ 9]; // Ws11; - qt[12] = dx[ 1] + dx[3] - dx[ 6] - dx[ 9] + dx[10]; // Ws12; - qt[13] = dx[ 2] + dx[4] + dx[ 7] + dx[10] + dx[11]; // Ws13; - qt[14] = dx[ 3] - dx[5] + dx[ 8] - dx[11] - dx[12]; // Ws14; - qt[15] = dx[12] - dx[4] - dx[ 6] - dx[ 9] + dx[13]; // Ws15; - - qt[ 0] = ss0(qt[ 0]) + h[ 1]; - qt[ 1] = ss1(qt[ 1]) + h[ 2]; - qt[ 2] = ss2(qt[ 2]) + h[ 3]; - qt[ 3] = ss3(qt[ 3]) + h[ 4]; - qt[ 4] = ss4(qt[ 4]) + h[ 5]; - - qt[ 5] = ss0(qt[ 5]) + h[ 6]; - qt[ 6] = ss1(qt[ 6]) + h[ 7]; - qt[ 7] = ss2(qt[ 7]) + h[ 8]; - qt[ 8] = ss3(qt[ 8]) + h[ 9]; - qt[ 9] = ss4(qt[ 9]) + h[10]; - - qt[10] = ss0(qt[10]) + h[11]; - qt[11] = ss1(qt[11]) + h[12]; - qt[12] = ss2(qt[12]) + h[13]; - qt[13] = ss3(qt[13]) + h[14]; - qt[14] = ss4(qt[14]) + h[15]; - - qt[15] = ss0(qt[15]) + h[ 0]; - - //MAKE_Qbs; - #define Ks(j) ((sph_u32)(0x05555555UL * j)) - #define Qs(j) (qt[j]) - - #define expand1s_in(i16, \ - i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, \ - i0m, i1m, i3m, i4m, i7m, i10m, i11m) \ - (ss1(qt[i0]) + ss2(qt[i1]) + ss3(qt[i2]) + ss0(qt[i3]) + ss1(qt[i4]) + ss2(qt[i5]) + ss3(qt[i6]) + ss0(qt[i7]) \ - + ss1(qt[i8]) + ss2(qt[i9]) + ss3(qt[i10]) + ss0(qt[i11]) + ss1(qt[i12]) + ss2(qt[i13]) + ss3(qt[i14]) + ss0(qt[i15]) \ - + ((ROTL32(data[i0m], i1m) + ROTL32(data[i3m], i4m) - ROTL32(data[i10m], i11m) + Ks(i16)) ^ h[i7m])) - - qt[16] = expand1s_in(16, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 3, 4, 7, 10, 11); - qt[17] = expand1s_in(17, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 4, 5, 8, 11, 12); - - #define expand2s_inner(qf, i16, \ - i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, \ - i0m, i1m, i3m, i4m, i7m, i10m, i11m) \ - (qf(i0) + rs1(qf(i1)) + qf(i2) + rs2(qf(i3)) \ - + qf(i4) + rs3(qf(i5)) + qf(i6) + rs4(qf(i7)) + qf(i8) + rs5(qf(i9)) + qf(i10) + rs6(qf(i11)) \ - + qf(i12) + rs7(qf(i13)) + ss4(qf(i14)) + ss5(qf(i15)) \ - + ((ROTL32(data[i0m], i1m) + ROTL32(data[i3m], i4m) - ROTL32(data[i10m], i11m) + Ks(i16)) ^ h[i7m])) - -#ifdef _MSC_VER - #define LPAR ( - #define expand2s(i16) \ - expand2s_(Qs, i16, I16_ ## i16, M16_ ## i16) - #define expand2s_(qf, i16, ix, iy) \ - expand2s_inner LPAR qf, i16, ix, iy) -#else - #define expand2s_(i16, ix, iy) \ - expand2s_inner(Qs, i16, ix, iy) - #define expand2s(i16) \ - expand2s_(i16, I16_ ## i16, M16_ ## i16) -#endif - - qt[18] = expand2s(18); - qt[19] = expand2s(19); - qt[20] = expand2s(20); - qt[21] = expand2s(21); - qt[22] = expand2s(22); - qt[23] = expand2s(23); - qt[24] = expand2s(24); - qt[25] = expand2s(25); - qt[26] = expand2s(26); - qt[27] = expand2s(27); - qt[28] = expand2s(28); - qt[29] = expand2s(29); - qt[30] = expand2s(30); - qt[31] = expand2s(31); - - sph_u32 xl, xh; - xl = Qs(16) ^ Qs(17) ^ Qs(18) ^ Qs(19) ^ Qs(20) ^ Qs(21) ^ Qs(22) ^ Qs(23); - - xh = xl ^ Qs(24) ^ Qs(25) ^ Qs(26) ^ Qs(27) ^ Qs(28) ^ Qs(29) ^ Qs(30) ^ Qs(31); - - dh[ 0] = ((xh << 5) ^ (Qs(16) >> 5) ^ data[ 0]) + (xl ^ Qs(24) ^ Qs(0)); - dh[ 1] = ((xh >> 7) ^ (Qs(17) << 8) ^ data[ 1]) + (xl ^ Qs(25) ^ Qs(1)); - dh[ 2] = ((xh >> 5) ^ (Qs(18) << 5) ^ data[ 2]) + (xl ^ Qs(26) ^ Qs(2)); - dh[ 3] = ((xh >> 1) ^ (Qs(19) << 5) ^ data[ 3]) + (xl ^ Qs(27) ^ Qs(3)); - dh[ 4] = ((xh >> 3) ^ (Qs(20) << 0) ^ data[ 4]) + (xl ^ Qs(28) ^ Qs(4)); - dh[ 5] = ((xh << 6) ^ (Qs(21) >> 6) ^ data[ 5]) + (xl ^ Qs(29) ^ Qs(5)); - dh[ 6] = ((xh >> 4) ^ (Qs(22) << 6) ^ data[ 6]) + (xl ^ Qs(30) ^ Qs(6)); - dh[ 7] = ((xh >> 11) ^ (Qs(23) << 2) ^ data[ 7]) + (xl ^ Qs(31) ^ Qs(7)); - - dh[ 8] = ROTL32(dh[4], 9) + (xh ^ Qs(24) ^ data[ 8]) + ((xl << 8) ^ Qs(23) ^ Qs( 8)); - dh[ 9] = ROTL32(dh[5], 10) + (xh ^ Qs(25) ^ data[ 9]) + ((xl >> 6) ^ Qs(16) ^ Qs( 9)); - dh[10] = ROTL32(dh[6], 11) + (xh ^ Qs(26) ^ data[10]) + ((xl << 6) ^ Qs(17) ^ Qs(10)); - dh[11] = ROTL32(dh[7], 12) + (xh ^ Qs(27) ^ data[11]) + ((xl << 4) ^ Qs(18) ^ Qs(11)); - dh[12] = ROTL32(dh[0], 13) + (xh ^ Qs(28) ^ data[12]) + ((xl >> 3) ^ Qs(19) ^ Qs(12)); - dh[13] = ROTL32(dh[1], 14) + (xh ^ Qs(29) ^ data[13]) + ((xl >> 4) ^ Qs(20) ^ Qs(13)); - dh[14] = ROTL32(dh[2], 15) + (xh ^ Qs(30) ^ data[14]) + ((xl >> 7) ^ Qs(21) ^ Qs(14)); - dh[15] = ROTL32(dh[3], 16) + (xh ^ Qs(31) ^ data[15]) + ((xl >> 2) ^ Qs(22) ^ Qs(15)); -} - -#ifndef USE_MIDSTATE - -__device__ -static void gpu_bmw256_init(sph_bmw_small_context *sc) -{ - memcpy(sc->H, IV256, sizeof sc->H); - sc->ptr = 0; - sc->bit_count = 0; -} - -__device__ -static void gpu_bmw256(sph_bmw_small_context *sc, const void *data, size_t len) -{ - sph_u32 htmp[16]; - sph_u32 *h1, *h2; - unsigned char *buf = sc->buf; - size_t ptr = sc->ptr; - - sc->bit_count += (sph_u64)len << 3; - - h1 = sc->H; - h2 = htmp; - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - data = (const unsigned char *)data + clen; - len -= clen; - ptr += clen; - if (ptr == sizeof sc->buf) { - sph_u32 *ht; - - gpu_compress_small((sph_u32 *) buf, h1, h2); - ht = h1; - h1 = h2; - h2 = ht; - ptr = 0; - } - } - sc->ptr = ptr; - if (h1 != sc->H) - memcpy(sc->H, h1, sizeof sc->H); -} - -#endif - -#define sph_enc64le(ptr, x) \ - *((uint64_t*)(ptr)) = x -#define sph_enc64le_aligned sph_enc64le - -__device__ -static void gpu_bmw256_close(sph_bmw_small_context *sc, uint2 *out) -{ - unsigned char *buf = sc->buf; - size_t ptr = sc->ptr; - - buf[ptr ++] = 0x80; - sph_u32 *h = sc->H; - - sph_u32 h1[16]; - if (ptr > (sizeof sc->buf) - 8) { - memset(buf + ptr, 0, (sizeof sc->buf) - ptr); - gpu_compress_small((sph_u32 *) buf, h, h1); - ptr = 0; - h = h1; - } - memset(buf + ptr, 0, sizeof(sc->buf) - 8 - ptr); - - sph_enc64le_aligned(buf + sizeof(sc->buf) - 8, SPH_T64(sc->bit_count)); - - sph_u32 h2[16]; - gpu_compress_small((sph_u32 *) buf, h, h2); - gpu_compress_small(h2, final_s, h1); - - uint64_t* h64 = (uint64_t*) (&h1[8]); - #pragma unroll - for (int i = 0; i < 4; i++) { - out[i] = vectorize(h64[i]); - } -} - -__global__ /* __launch_bounds__(256, 3) */ -void bmw256_gpu_hash_80(uint32_t threads, uint32_t startNonce, uint64_t *g_hash, sph_bmw256_context *d_midstate, int swap) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t nonce = startNonce + thread; - nonce = swap ? cuda_swab32(nonce): nonce; - -#ifndef USE_MIDSTATE - uint2 hash[10]; - #pragma unroll - for(int i=0;i<9;i++) - hash[i] = vectorize(c_PaddedMessage80[i]); - hash[9] = make_uint2(c_PaddedMessage80[9], nonce); - - sph_bmw256_context ctx; - gpu_bmw256_init(&ctx); - gpu_bmw256(&ctx, (void*) hash, 80); -#else - sph_bmw256_context ctx; - ctx.ptr = 16; ctx.bit_count = 640; - uint2 *buf = (uint2 *) ctx.buf; - buf[0] = vectorize(c_PaddedMessage80[8]); - buf[1] = make_uint2(c_PaddedMessage80[9], nonce); - #pragma unroll - for(int i=0;i<16;i++) - ctx.H[i] = d_midstate->H[i]; -#endif - gpu_bmw256_close(&ctx, (uint2*) &g_hash[thread << 2]); - } -} - -__host__ -void bmw256_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNonce, uint32_t *d_outputHash, int swap) -{ - const uint32_t threadsperblock = 256; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - bmw256_gpu_hash_80<<>>(threads, startNonce, (uint64_t*)d_outputHash, d_midstate[thr_id], swap); -} - -__host__ -void bmw256_setBlock_80(int thr_id, void *pdata) -{ - uint64_t PaddedMessage[16]; - memcpy(PaddedMessage, pdata, 80); - memset(&PaddedMessage[10], 0, 48); - CUDA_SAFE_CALL(cudaMemcpyToSymbol(c_PaddedMessage80, PaddedMessage, sizeof(PaddedMessage), 0, cudaMemcpyHostToDevice)); - - sph_bmw256_context ctx; - sph_bmw256_init(&ctx); - sph_bmw256(&ctx, (void*) PaddedMessage, 80); - CUDA_SAFE_CALL(cudaMemcpy(d_midstate[thr_id], &ctx, sizeof(sph_bmw256_context), cudaMemcpyHostToDevice)); -} - -__host__ -void bmw256_midstate_init(int thr_id, uint32_t threads) -{ - cudaMalloc(&d_midstate[thr_id], sizeof(sph_bmw256_context)); -} - -__host__ -void bmw256_midstate_free(int thr_id) -{ - cudaFree(d_midstate[thr_id]); -} diff --git a/Algo256/cuda_bmw256.cu b/Algo256/cuda_bmw256.cu deleted file mode 100644 index 0fde12ee..00000000 --- a/Algo256/cuda_bmw256.cu +++ /dev/null @@ -1,283 +0,0 @@ -#include -#include - -#include "cuda_helper.h" - -#undef SPH_ROTL32 -#define SPH_ROTL32 ROTL32 - -static uint32_t *d_gnounce[MAX_GPUS]; -static uint32_t *d_GNonce[MAX_GPUS]; - -__constant__ uint64_t pTarget[4]; - -#define shl(x, n) ((x) << (n)) -#define shr(x, n) ((x) >> (n)) - -#define ss0(x) (shr((x), 1) ^ shl((x), 3) ^ SPH_ROTL32((x), 4) ^ SPH_ROTL32((x), 19)) -#define ss1(x) (shr((x), 1) ^ shl((x), 2) ^ SPH_ROTL32((x), 8) ^ SPH_ROTL32((x), 23)) -#define ss2(x) (shr((x), 2) ^ shl((x), 1) ^ SPH_ROTL32((x), 12) ^ SPH_ROTL32((x), 25)) -#define ss3(x) (shr((x), 2) ^ shl((x), 2) ^ SPH_ROTL32((x), 15) ^ SPH_ROTL32((x), 29)) -#define ss4(x) (shr((x), 1) ^ (x)) -#define ss5(x) (shr((x), 2) ^ (x)) - -#define rs1(x) SPH_ROTL32((x), 3) -#define rs2(x) SPH_ROTL32((x), 7) -#define rs3(x) SPH_ROTL32((x), 13) -#define rs4(x) SPH_ROTL32((x), 16) -#define rs5(x) SPH_ROTL32((x), 19) -#define rs6(x) SPH_ROTL32((x), 23) -#define rs7(x) SPH_ROTL32((x), 27) - -/* Message expansion function 1 */ -__forceinline__ __device__ -uint32_t expand32_1(int i, uint32_t *M32, const uint32_t *H, uint32_t *Q) -{ - return (ss1(Q[i - 16]) + ss2(Q[i - 15]) + ss3(Q[i - 14]) + ss0(Q[i - 13]) - + ss1(Q[i - 12]) + ss2(Q[i - 11]) + ss3(Q[i - 10]) + ss0(Q[i - 9]) - + ss1(Q[i - 8]) + ss2(Q[i - 7]) + ss3(Q[i - 6]) + ss0(Q[i - 5]) - + ss1(Q[i - 4]) + ss2(Q[i - 3]) + ss3(Q[i - 2]) + ss0(Q[i - 1]) - + ((i*(0x05555555ul) + SPH_ROTL32(M32[(i - 16) % 16], ((i - 16) % 16) + 1) - + SPH_ROTL32(M32[(i - 13) % 16], ((i - 13) % 16) + 1) - - SPH_ROTL32(M32[(i - 6) % 16], ((i - 6) % 16) + 1)) ^ H[(i - 16 + 7) % 16])); -} - -/* Message expansion function 2 */ -__forceinline__ __device__ -uint32_t expand32_2(int i, uint32_t *M32, const uint32_t *H, uint32_t *Q) -{ - return (Q[i - 16] + rs1(Q[i - 15]) + Q[i - 14] + rs2(Q[i - 13]) - + Q[i - 12] + rs3(Q[i - 11]) + Q[i - 10] + rs4(Q[i - 9]) - + Q[i - 8] + rs5(Q[i - 7]) + Q[i - 6] + rs6(Q[i - 5]) - + Q[i - 4] + rs7(Q[i - 3]) + ss4(Q[i - 2]) + ss5(Q[i - 1]) - + ((i*(0x05555555ul) + SPH_ROTL32(M32[(i - 16) % 16], ((i - 16) % 16) + 1) - + SPH_ROTL32(M32[(i - 13) % 16], ((i - 13) % 16) + 1) - - SPH_ROTL32(M32[(i - 6) % 16], ((i - 6) % 16) + 1)) ^ H[(i - 16 + 7) % 16])); -} - -__forceinline__ __device__ -void Compression256(uint32_t * M32) -{ - uint32_t Q[32], XL32, XH32; - - const uint32_t H[16] = { - 0x40414243, 0x44454647, 0x48494A4B, 0x4C4D4E4F, - 0x50515253, 0x54555657, 0x58595A5B, 0x5C5D5E5F, - 0x60616263, 0x64656667, 0x68696A6B, 0x6C6D6E6F, - 0x70717273, 0x74757677, 0x78797A7B, 0x7C7D7E7F - }; - - Q[0] = (M32[5] ^ H[5]) - (M32[7] ^ H[7]) + (M32[10] ^ H[10]) + (M32[13] ^ H[13]) + (M32[14] ^ H[14]); - Q[1] = (M32[6] ^ H[6]) - (M32[8] ^ H[8]) + (M32[11] ^ H[11]) + (M32[14] ^ H[14]) - (M32[15] ^ H[15]); - Q[2] = (M32[0] ^ H[0]) + (M32[7] ^ H[7]) + (M32[9] ^ H[9]) - (M32[12] ^ H[12]) + (M32[15] ^ H[15]); - Q[3] = (M32[0] ^ H[0]) - (M32[1] ^ H[1]) + (M32[8] ^ H[8]) - (M32[10] ^ H[10]) + (M32[13] ^ H[13]); - Q[4] = (M32[1] ^ H[1]) + (M32[2] ^ H[2]) + (M32[9] ^ H[9]) - (M32[11] ^ H[11]) - (M32[14] ^ H[14]); - Q[5] = (M32[3] ^ H[3]) - (M32[2] ^ H[2]) + (M32[10] ^ H[10]) - (M32[12] ^ H[12]) + (M32[15] ^ H[15]); - Q[6] = (M32[4] ^ H[4]) - (M32[0] ^ H[0]) - (M32[3] ^ H[3]) - (M32[11] ^ H[11]) + (M32[13] ^ H[13]); - Q[7] = (M32[1] ^ H[1]) - (M32[4] ^ H[4]) - (M32[5] ^ H[5]) - (M32[12] ^ H[12]) - (M32[14] ^ H[14]); - Q[8] = (M32[2] ^ H[2]) - (M32[5] ^ H[5]) - (M32[6] ^ H[6]) + (M32[13] ^ H[13]) - (M32[15] ^ H[15]); - Q[9] = (M32[0] ^ H[0]) - (M32[3] ^ H[3]) + (M32[6] ^ H[6]) - (M32[7] ^ H[7]) + (M32[14] ^ H[14]); - Q[10] = (M32[8] ^ H[8]) - (M32[1] ^ H[1]) - (M32[4] ^ H[4]) - (M32[7] ^ H[7]) + (M32[15] ^ H[15]); - Q[11] = (M32[8] ^ H[8]) - (M32[0] ^ H[0]) - (M32[2] ^ H[2]) - (M32[5] ^ H[5]) + (M32[9] ^ H[9]); - Q[12] = (M32[1] ^ H[1]) + (M32[3] ^ H[3]) - (M32[6] ^ H[6]) - (M32[9] ^ H[9]) + (M32[10] ^ H[10]); - Q[13] = (M32[2] ^ H[2]) + (M32[4] ^ H[4]) + (M32[7] ^ H[7]) + (M32[10] ^ H[10]) + (M32[11] ^ H[11]); - Q[14] = (M32[3] ^ H[3]) - (M32[5] ^ H[5]) + (M32[8] ^ H[8]) - (M32[11] ^ H[11]) - (M32[12] ^ H[12]); - Q[15] = (M32[12] ^ H[12]) - (M32[4] ^ H[4]) - (M32[6] ^ H[6]) - (M32[9] ^ H[9]) + (M32[13] ^ H[13]); - - /* Diffuse the differences in every word in a bijective manner with ssi, and then add the values of the previous double pipe. */ - Q[0] = ss0(Q[0]) + H[1]; - Q[1] = ss1(Q[1]) + H[2]; - Q[2] = ss2(Q[2]) + H[3]; - Q[3] = ss3(Q[3]) + H[4]; - Q[4] = ss4(Q[4]) + H[5]; - Q[5] = ss0(Q[5]) + H[6]; - Q[6] = ss1(Q[6]) + H[7]; - Q[7] = ss2(Q[7]) + H[8]; - Q[8] = ss3(Q[8]) + H[9]; - Q[9] = ss4(Q[9]) + H[10]; - Q[10] = ss0(Q[10]) + H[11]; - Q[11] = ss1(Q[11]) + H[12]; - Q[12] = ss2(Q[12]) + H[13]; - Q[13] = ss3(Q[13]) + H[14]; - Q[14] = ss4(Q[14]) + H[15]; - Q[15] = ss0(Q[15]) + H[0]; - - /* This is the Message expansion or f_1 in the documentation. */ - /* It has 16 rounds. */ - /* Blue Midnight Wish has two tunable security parameters. */ - /* The parameters are named EXPAND_1_ROUNDS and EXPAND_2_ROUNDS. */ - /* The following relation for these parameters should is satisfied: */ - /* EXPAND_1_ROUNDS + EXPAND_2_ROUNDS = 16 */ - - #pragma unroll - for (int i=16; i<18; i++) - Q[i] = expand32_1(i, M32, H, Q); - - #pragma nounroll - for (int i=18; i<32; i++) - Q[i] = expand32_2(i, M32, H, Q); - - /* Blue Midnight Wish has two temporary cummulative variables that accumulate via XORing */ - /* 16 new variables that are prooduced in the Message Expansion part. */ - XL32 = Q[16] ^ Q[17] ^ Q[18] ^ Q[19] ^ Q[20] ^ Q[21] ^ Q[22] ^ Q[23]; - XH32 = XL32^Q[24] ^ Q[25] ^ Q[26] ^ Q[27] ^ Q[28] ^ Q[29] ^ Q[30] ^ Q[31]; - - - /* This part is the function f_2 - in the documentation */ - - /* Compute the double chaining pipe for the next message block. */ - M32[0] = (shl(XH32, 5) ^ shr(Q[16], 5) ^ M32[0]) + (XL32 ^ Q[24] ^ Q[0]); - M32[1] = (shr(XH32, 7) ^ shl(Q[17], 8) ^ M32[1]) + (XL32 ^ Q[25] ^ Q[1]); - M32[2] = (shr(XH32, 5) ^ shl(Q[18], 5) ^ M32[2]) + (XL32 ^ Q[26] ^ Q[2]); - M32[3] = (shr(XH32, 1) ^ shl(Q[19], 5) ^ M32[3]) + (XL32 ^ Q[27] ^ Q[3]); - M32[4] = (shr(XH32, 3) ^ Q[20] ^ M32[4]) + (XL32 ^ Q[28] ^ Q[4]); - M32[5] = (shl(XH32, 6) ^ shr(Q[21], 6) ^ M32[5]) + (XL32 ^ Q[29] ^ Q[5]); - M32[6] = (shr(XH32, 4) ^ shl(Q[22], 6) ^ M32[6]) + (XL32 ^ Q[30] ^ Q[6]); - M32[7] = (shr(XH32, 11) ^ shl(Q[23], 2) ^ M32[7]) + (XL32 ^ Q[31] ^ Q[7]); - - M32[8] = SPH_ROTL32(M32[4], 9) + (XH32 ^ Q[24] ^ M32[8]) + (shl(XL32, 8) ^ Q[23] ^ Q[8]); - M32[9] = SPH_ROTL32(M32[5], 10) + (XH32 ^ Q[25] ^ M32[9]) + (shr(XL32, 6) ^ Q[16] ^ Q[9]); - M32[10] = SPH_ROTL32(M32[6], 11) + (XH32 ^ Q[26] ^ M32[10]) + (shl(XL32, 6) ^ Q[17] ^ Q[10]); - M32[11] = SPH_ROTL32(M32[7], 12) + (XH32 ^ Q[27] ^ M32[11]) + (shl(XL32, 4) ^ Q[18] ^ Q[11]); - M32[12] = SPH_ROTL32(M32[0], 13) + (XH32 ^ Q[28] ^ M32[12]) + (shr(XL32, 3) ^ Q[19] ^ Q[12]); - M32[13] = SPH_ROTL32(M32[1], 14) + (XH32 ^ Q[29] ^ M32[13]) + (shr(XL32, 4) ^ Q[20] ^ Q[13]); - M32[14] = SPH_ROTL32(M32[2], 15) + (XH32 ^ Q[30] ^ M32[14]) + (shr(XL32, 7) ^ Q[21] ^ Q[14]); - M32[15] = SPH_ROTL32(M32[3], 16) + (XH32 ^ Q[31] ^ M32[15]) + (shr(XL32, 2) ^ Q[22] ^ Q[15]); -} - -__forceinline__ __device__ -void Compression256_2(uint32_t * M32) -{ - uint32_t XL32, XH32, Q[32]; - - const uint32_t H[16] = { - 0xaaaaaaa0, 0xaaaaaaa1, 0xaaaaaaa2, 0xaaaaaaa3, - 0xaaaaaaa4, 0xaaaaaaa5, 0xaaaaaaa6, 0xaaaaaaa7, - 0xaaaaaaa8, 0xaaaaaaa9, 0xaaaaaaaa, 0xaaaaaaab, - 0xaaaaaaac, 0xaaaaaaad, 0xaaaaaaae, 0xaaaaaaaf - }; - - Q[0] = (M32[5] ^ H[5]) - (M32[7] ^ H[7]) + (M32[10] ^ H[10]) + (M32[13] ^ H[13]) + (M32[14] ^ H[14]); - Q[1] = (M32[6] ^ H[6]) - (M32[8] ^ H[8]) + (M32[11] ^ H[11]) + (M32[14] ^ H[14]) - (M32[15] ^ H[15]); - Q[2] = (M32[0] ^ H[0]) + (M32[7] ^ H[7]) + (M32[9] ^ H[9]) - (M32[12] ^ H[12]) + (M32[15] ^ H[15]); - Q[3] = (M32[0] ^ H[0]) - (M32[1] ^ H[1]) + (M32[8] ^ H[8]) - (M32[10] ^ H[10]) + (M32[13] ^ H[13]); - Q[4] = (M32[1] ^ H[1]) + (M32[2] ^ H[2]) + (M32[9] ^ H[9]) - (M32[11] ^ H[11]) - (M32[14] ^ H[14]); - Q[5] = (M32[3] ^ H[3]) - (M32[2] ^ H[2]) + (M32[10] ^ H[10]) - (M32[12] ^ H[12]) + (M32[15] ^ H[15]); - Q[6] = (M32[4] ^ H[4]) - (M32[0] ^ H[0]) - (M32[3] ^ H[3]) - (M32[11] ^ H[11]) + (M32[13] ^ H[13]); - Q[7] = (M32[1] ^ H[1]) - (M32[4] ^ H[4]) - (M32[5] ^ H[5]) - (M32[12] ^ H[12]) - (M32[14] ^ H[14]); - Q[8] = (M32[2] ^ H[2]) - (M32[5] ^ H[5]) - (M32[6] ^ H[6]) + (M32[13] ^ H[13]) - (M32[15] ^ H[15]); - Q[9] = (M32[0] ^ H[0]) - (M32[3] ^ H[3]) + (M32[6] ^ H[6]) - (M32[7] ^ H[7]) + (M32[14] ^ H[14]); - Q[10] = (M32[8] ^ H[8]) - (M32[1] ^ H[1]) - (M32[4] ^ H[4]) - (M32[7] ^ H[7]) + (M32[15] ^ H[15]); - Q[11] = (M32[8] ^ H[8]) - (M32[0] ^ H[0]) - (M32[2] ^ H[2]) - (M32[5] ^ H[5]) + (M32[9] ^ H[9]); - Q[12] = (M32[1] ^ H[1]) + (M32[3] ^ H[3]) - (M32[6] ^ H[6]) - (M32[9] ^ H[9]) + (M32[10] ^ H[10]); - Q[13] = (M32[2] ^ H[2]) + (M32[4] ^ H[4]) + (M32[7] ^ H[7]) + (M32[10] ^ H[10]) + (M32[11] ^ H[11]); - Q[14] = (M32[3] ^ H[3]) - (M32[5] ^ H[5]) + (M32[8] ^ H[8]) - (M32[11] ^ H[11]) - (M32[12] ^ H[12]); - Q[15] = (M32[12] ^ H[12]) - (M32[4] ^ H[4]) - (M32[6] ^ H[6]) - (M32[9] ^ H[9]) + (M32[13] ^ H[13]); - - /* Diffuse the differences in every word in a bijective manner with ssi, and then add the values of the previous double pipe.*/ - Q[0] = ss0(Q[0]) + H[1]; - Q[1] = ss1(Q[1]) + H[2]; - Q[2] = ss2(Q[2]) + H[3]; - Q[3] = ss3(Q[3]) + H[4]; - Q[4] = ss4(Q[4]) + H[5]; - Q[5] = ss0(Q[5]) + H[6]; - Q[6] = ss1(Q[6]) + H[7]; - Q[7] = ss2(Q[7]) + H[8]; - Q[8] = ss3(Q[8]) + H[9]; - Q[9] = ss4(Q[9]) + H[10]; - Q[10] = ss0(Q[10]) + H[11]; - Q[11] = ss1(Q[11]) + H[12]; - Q[12] = ss2(Q[12]) + H[13]; - Q[13] = ss3(Q[13]) + H[14]; - Q[14] = ss4(Q[14]) + H[15]; - Q[15] = ss0(Q[15]) + H[0]; - - /* This is the Message expansion or f_1 in the documentation. */ - /* It has 16 rounds. */ - /* Blue Midnight Wish has two tunable security parameters. */ - /* The parameters are named EXPAND_1_ROUNDS and EXPAND_2_ROUNDS. */ - /* The following relation for these parameters should is satisfied: */ - /* EXPAND_1_ROUNDS + EXPAND_2_ROUNDS = 16 */ - - #pragma unroll - for (int i = 16; i<18; i++) - Q[i] = expand32_1(i, M32, H, Q); - - #pragma nounroll - for (int i = 18; i<32; i++) - Q[i] = expand32_2(i, M32, H, Q); - - /* Blue Midnight Wish has two temporary cummulative variables that accumulate via XORing */ - /* 16 new variables that are prooduced in the Message Expansion part. */ - XL32 = Q[16] ^ Q[17] ^ Q[18] ^ Q[19] ^ Q[20] ^ Q[21] ^ Q[22] ^ Q[23]; - XH32 = XL32 ^ Q[24] ^ Q[25] ^ Q[26] ^ Q[27] ^ Q[28] ^ Q[29] ^ Q[30] ^ Q[31]; - - M32[2] = (shr(XH32, 5) ^ shl(Q[18], 5) ^ M32[2]) + (XL32 ^ Q[26] ^ Q[2]); - M32[3] = (shr(XH32, 1) ^ shl(Q[19], 5) ^ M32[3]) + (XL32 ^ Q[27] ^ Q[3]); - M32[14] = SPH_ROTL32(M32[2], 15) + (XH32 ^ Q[30] ^ M32[14]) + (shr(XL32, 7) ^ Q[21] ^ Q[14]); - M32[15] = SPH_ROTL32(M32[3], 16) + (XH32 ^ Q[31] ^ M32[15]) + (shr(XL32, 2) ^ Q[22] ^ Q[15]); -} - -#define TPB 512 -__global__ __launch_bounds__(TPB, 2) -void bmw256_gpu_hash_32(uint32_t threads, uint32_t startNounce, uint64_t *g_hash, uint32_t *const __restrict__ nonceVector) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t message[16] = { 0 }; - - LOHI(message[0], message[1], __ldg(&g_hash[thread])); - LOHI(message[2], message[3], __ldg(&g_hash[thread + 1 * threads])); - LOHI(message[4], message[5], __ldg(&g_hash[thread + 2 * threads])); - LOHI(message[6], message[7], __ldg(&g_hash[thread + 3 * threads])); - - message[8]=0x80; - message[14]=0x100; - Compression256(message); - Compression256_2(message); - - if (((uint64_t*)message)[7] <= pTarget[3]) - { - uint32_t tmp = atomicExch(&nonceVector[0], startNounce + thread); - if (tmp != 0) - nonceVector[1] = tmp; - } - } -} - -__host__ -void bmw256_cpu_hash_32(int thr_id, uint32_t threads, uint32_t startNounce, uint64_t *g_hash, uint32_t *resultnonces) -{ - const uint32_t threadsperblock = TPB; - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - - cudaMemset(d_GNonce[thr_id], 0, 2 * sizeof(uint32_t)); - - bmw256_gpu_hash_32 << > >(threads, startNounce, g_hash, d_GNonce[thr_id]); - cudaMemcpy(d_gnounce[thr_id], d_GNonce[thr_id], 2 * sizeof(uint32_t), cudaMemcpyDeviceToHost); - resultnonces[0] = *(d_gnounce[thr_id]); - resultnonces[1] = *(d_gnounce[thr_id] + 1); -} - - -__host__ -void bmw256_cpu_init(int thr_id, uint32_t threads) -{ - cudaMalloc(&d_GNonce[thr_id], 2 * sizeof(uint32_t)); - cudaMallocHost(&d_gnounce[thr_id], 2 * sizeof(uint32_t)); -} - -__host__ -void bmw256_cpu_free(int thr_id) -{ - cudaFree(d_GNonce[thr_id]); - cudaFreeHost(d_gnounce[thr_id]); -} - -__host__ -void bmw256_setTarget(const void *pTargetIn) -{ - cudaMemcpyToSymbol(pTarget, pTargetIn, 32, 0, cudaMemcpyHostToDevice); -} diff --git a/Algo256/cuda_cubehash256.cu b/Algo256/cuda_cubehash256.cu deleted file mode 100644 index 153e87a1..00000000 --- a/Algo256/cuda_cubehash256.cu +++ /dev/null @@ -1,370 +0,0 @@ -#include "cuda_helper.h" - -#define CUBEHASH_ROUNDS 16 /* this is r for CubeHashr/b */ -#define CUBEHASH_BLOCKBYTES 32 /* this is b for CubeHashr/b */ - -#ifdef __INTELLISENSE__ -/* just for vstudio code colors */ -#define __CUDA_ARCH__ 520 -#endif - -#if __CUDA_ARCH__ < 350 -#define LROT(x,bits) ((x << bits) | (x >> (32 - bits))) -#else -#define LROT(x, bits) __funnelshift_l(x, x, bits) -#endif - -#define TPB35 576 -#define TPB50 1024 - -#define ROTATEUPWARDS7(a) LROT(a,7) -#define ROTATEUPWARDS11(a) LROT(a,11) - -__device__ __forceinline__ void rrounds(uint32_t x[2][2][2][2][2]) -{ - int r; - - uint32_t x0[2][2][2][2]; - uint32_t x1[2][2][2][2]; - - for (r = 0; r < CUBEHASH_ROUNDS; r += 2) { - /* "rotate x_0jklm upwards by 7 bits" */ - x0[0][0][0][0] = ROTATEUPWARDS7(x[0][0][0][0][0]); - x0[0][0][0][1] = ROTATEUPWARDS7(x[0][0][0][0][1]); - x0[0][0][1][0] = ROTATEUPWARDS7(x[0][0][0][1][0]); - x0[0][0][1][1] = ROTATEUPWARDS7(x[0][0][0][1][1]); - x0[0][1][0][0] = ROTATEUPWARDS7(x[0][0][1][0][0]); - x0[0][1][0][1] = ROTATEUPWARDS7(x[0][0][1][0][1]); - x0[0][1][1][0] = ROTATEUPWARDS7(x[0][0][1][1][0]); - x0[0][1][1][1] = ROTATEUPWARDS7(x[0][0][1][1][1]); - x0[1][0][0][0] = ROTATEUPWARDS7(x[0][1][0][0][0]); - x0[1][0][0][1] = ROTATEUPWARDS7(x[0][1][0][0][1]); - x0[1][0][1][0] = ROTATEUPWARDS7(x[0][1][0][1][0]); - x0[1][0][1][1] = ROTATEUPWARDS7(x[0][1][0][1][1]); - x0[1][1][0][0] = ROTATEUPWARDS7(x[0][1][1][0][0]); - x0[1][1][0][1] = ROTATEUPWARDS7(x[0][1][1][0][1]); - x0[1][1][1][0] = ROTATEUPWARDS7(x[0][1][1][1][0]); - x0[1][1][1][1] = ROTATEUPWARDS7(x[0][1][1][1][1]); - - /* "add x_0jklm into x_1jklm modulo 2^32" */ - x1[0][0][0][0] = x[1][0][0][0][0] + x[0][0][0][0][0]; - x1[0][0][0][1] = x[1][0][0][0][1] + x[0][0][0][0][1]; - x1[0][0][1][0] = x[1][0][0][1][0] + x[0][0][0][1][0]; - x1[0][0][1][1] = x[1][0][0][1][1] + x[0][0][0][1][1]; - x1[0][1][0][0] = x[1][0][1][0][0] + x[0][0][1][0][0]; - x1[0][1][0][1] = x[1][0][1][0][1] + x[0][0][1][0][1]; - x1[0][1][1][0] = x[1][0][1][1][0] + x[0][0][1][1][0]; - x1[0][1][1][1] = x[1][0][1][1][1] + x[0][0][1][1][1]; - x1[1][0][0][0] = x[1][1][0][0][0] + x[0][1][0][0][0]; - x1[1][0][0][1] = x[1][1][0][0][1] + x[0][1][0][0][1]; - x1[1][0][1][0] = x[1][1][0][1][0] + x[0][1][0][1][0]; - x1[1][0][1][1] = x[1][1][0][1][1] + x[0][1][0][1][1]; - x1[1][1][0][0] = x[1][1][1][0][0] + x[0][1][1][0][0]; - x1[1][1][0][1] = x[1][1][1][0][1] + x[0][1][1][0][1]; - x1[1][1][1][0] = x[1][1][1][1][0] + x[0][1][1][1][0]; - x1[1][1][1][1] = x[1][1][1][1][1] + x[0][1][1][1][1]; - - /* "xor x_1~jklm into x_0jklm" */ - x[0][0][0][0][0] = x0[0][0][0][0] ^ x1[1][0][0][0]; - x[0][0][0][0][1] = x0[0][0][0][1] ^ x1[1][0][0][1]; - x[0][0][0][1][0] = x0[0][0][1][0] ^ x1[1][0][1][0]; - x[0][0][0][1][1] = x0[0][0][1][1] ^ x1[1][0][1][1]; - x[0][0][1][0][0] = x0[0][1][0][0] ^ x1[1][1][0][0]; - x[0][0][1][0][1] = x0[0][1][0][1] ^ x1[1][1][0][1]; - x[0][0][1][1][0] = x0[0][1][1][0] ^ x1[1][1][1][0]; - x[0][0][1][1][1] = x0[0][1][1][1] ^ x1[1][1][1][1]; - x[0][1][0][0][0] = x0[1][0][0][0] ^ x1[0][0][0][0]; - x[0][1][0][0][1] = x0[1][0][0][1] ^ x1[0][0][0][1]; - x[0][1][0][1][0] = x0[1][0][1][0] ^ x1[0][0][1][0]; - x[0][1][0][1][1] = x0[1][0][1][1] ^ x1[0][0][1][1]; - x[0][1][1][0][0] = x0[1][1][0][0] ^ x1[0][1][0][0]; - x[0][1][1][0][1] = x0[1][1][0][1] ^ x1[0][1][0][1]; - x[0][1][1][1][0] = x0[1][1][1][0] ^ x1[0][1][1][0]; - x[0][1][1][1][1] = x0[1][1][1][1] ^ x1[0][1][1][1]; - - /* "rotate x_0jklm upwards by 11 bits" */ - x0[0][0][0][0] = ROTATEUPWARDS11(x[0][0][0][0][0]); - x0[0][0][0][1] = ROTATEUPWARDS11(x[0][0][0][0][1]); - x0[0][0][1][0] = ROTATEUPWARDS11(x[0][0][0][1][0]); - x0[0][0][1][1] = ROTATEUPWARDS11(x[0][0][0][1][1]); - x0[0][1][0][0] = ROTATEUPWARDS11(x[0][0][1][0][0]); - x0[0][1][0][1] = ROTATEUPWARDS11(x[0][0][1][0][1]); - x0[0][1][1][0] = ROTATEUPWARDS11(x[0][0][1][1][0]); - x0[0][1][1][1] = ROTATEUPWARDS11(x[0][0][1][1][1]); - x0[1][0][0][0] = ROTATEUPWARDS11(x[0][1][0][0][0]); - x0[1][0][0][1] = ROTATEUPWARDS11(x[0][1][0][0][1]); - x0[1][0][1][0] = ROTATEUPWARDS11(x[0][1][0][1][0]); - x0[1][0][1][1] = ROTATEUPWARDS11(x[0][1][0][1][1]); - x0[1][1][0][0] = ROTATEUPWARDS11(x[0][1][1][0][0]); - x0[1][1][0][1] = ROTATEUPWARDS11(x[0][1][1][0][1]); - x0[1][1][1][0] = ROTATEUPWARDS11(x[0][1][1][1][0]); - x0[1][1][1][1] = ROTATEUPWARDS11(x[0][1][1][1][1]); - - /* "add x_0jklm into x_1~jk~lm modulo 2^32" */ - x[1][1][0][1][0] = x1[1][0][1][0] + x[0][0][0][0][0]; - x[1][1][0][1][1] = x1[1][0][1][1] + x[0][0][0][0][1]; - x[1][1][0][0][0] = x1[1][0][0][0] + x[0][0][0][1][0]; - x[1][1][0][0][1] = x1[1][0][0][1] + x[0][0][0][1][1]; - x[1][1][1][1][0] = x1[1][1][1][0] + x[0][0][1][0][0]; - x[1][1][1][1][1] = x1[1][1][1][1] + x[0][0][1][0][1]; - x[1][1][1][0][0] = x1[1][1][0][0] + x[0][0][1][1][0]; - x[1][1][1][0][1] = x1[1][1][0][1] + x[0][0][1][1][1]; - x[1][0][0][1][0] = x1[0][0][1][0] + x[0][1][0][0][0]; - x[1][0][0][1][1] = x1[0][0][1][1] + x[0][1][0][0][1]; - x[1][0][0][0][0] = x1[0][0][0][0] + x[0][1][0][1][0]; - x[1][0][0][0][1] = x1[0][0][0][1] + x[0][1][0][1][1]; - x[1][0][1][1][0] = x1[0][1][1][0] + x[0][1][1][0][0]; - x[1][0][1][1][1] = x1[0][1][1][1] + x[0][1][1][0][1]; - x[1][0][1][0][0] = x1[0][1][0][0] + x[0][1][1][1][0]; - x[1][0][1][0][1] = x1[0][1][0][1] + x[0][1][1][1][1]; - - /* "xor x_1~j~k~lm into x_0jklm" */ - x[0][0][0][0][0] = x0[0][0][0][0] ^ x[1][1][1][1][0]; - x[0][0][0][0][1] = x0[0][0][0][1] ^ x[1][1][1][1][1]; - x[0][0][0][1][0] = x0[0][0][1][0] ^ x[1][1][1][0][0]; - x[0][0][0][1][1] = x0[0][0][1][1] ^ x[1][1][1][0][1]; - x[0][0][1][0][0] = x0[0][1][0][0] ^ x[1][1][0][1][0]; - x[0][0][1][0][1] = x0[0][1][0][1] ^ x[1][1][0][1][1]; - x[0][0][1][1][0] = x0[0][1][1][0] ^ x[1][1][0][0][0]; - x[0][0][1][1][1] = x0[0][1][1][1] ^ x[1][1][0][0][1]; - x[0][1][0][0][0] = x0[1][0][0][0] ^ x[1][0][1][1][0]; - x[0][1][0][0][1] = x0[1][0][0][1] ^ x[1][0][1][1][1]; - x[0][1][0][1][0] = x0[1][0][1][0] ^ x[1][0][1][0][0]; - x[0][1][0][1][1] = x0[1][0][1][1] ^ x[1][0][1][0][1]; - x[0][1][1][0][0] = x0[1][1][0][0] ^ x[1][0][0][1][0]; - x[0][1][1][0][1] = x0[1][1][0][1] ^ x[1][0][0][1][1]; - x[0][1][1][1][0] = x0[1][1][1][0] ^ x[1][0][0][0][0]; - x[0][1][1][1][1] = x0[1][1][1][1] ^ x[1][0][0][0][1]; - - /* "rotate x_0jklm upwards by 7 bits" */ - x0[0][0][0][0] = ROTATEUPWARDS7(x[0][0][0][0][0]); - x0[0][0][0][1] = ROTATEUPWARDS7(x[0][0][0][0][1]); - x0[0][0][1][0] = ROTATEUPWARDS7(x[0][0][0][1][0]); - x0[0][0][1][1] = ROTATEUPWARDS7(x[0][0][0][1][1]); - x0[0][1][0][0] = ROTATEUPWARDS7(x[0][0][1][0][0]); - x0[0][1][0][1] = ROTATEUPWARDS7(x[0][0][1][0][1]); - x0[0][1][1][0] = ROTATEUPWARDS7(x[0][0][1][1][0]); - x0[0][1][1][1] = ROTATEUPWARDS7(x[0][0][1][1][1]); - x0[1][0][0][0] = ROTATEUPWARDS7(x[0][1][0][0][0]); - x0[1][0][0][1] = ROTATEUPWARDS7(x[0][1][0][0][1]); - x0[1][0][1][0] = ROTATEUPWARDS7(x[0][1][0][1][0]); - x0[1][0][1][1] = ROTATEUPWARDS7(x[0][1][0][1][1]); - x0[1][1][0][0] = ROTATEUPWARDS7(x[0][1][1][0][0]); - x0[1][1][0][1] = ROTATEUPWARDS7(x[0][1][1][0][1]); - x0[1][1][1][0] = ROTATEUPWARDS7(x[0][1][1][1][0]); - x0[1][1][1][1] = ROTATEUPWARDS7(x[0][1][1][1][1]); - - /* "add x_0jklm into x_1~j~k~l~m modulo 2^32" */ - x1[1][1][1][1] = x[1][1][1][1][1] + x[0][0][0][0][0]; - x1[1][1][1][0] = x[1][1][1][1][0] + x[0][0][0][0][1]; - x1[1][1][0][1] = x[1][1][1][0][1] + x[0][0][0][1][0]; - x1[1][1][0][0] = x[1][1][1][0][0] + x[0][0][0][1][1]; - x1[1][0][1][1] = x[1][1][0][1][1] + x[0][0][1][0][0]; - x1[1][0][1][0] = x[1][1][0][1][0] + x[0][0][1][0][1]; - x1[1][0][0][1] = x[1][1][0][0][1] + x[0][0][1][1][0]; - x1[1][0][0][0] = x[1][1][0][0][0] + x[0][0][1][1][1]; - x1[0][1][1][1] = x[1][0][1][1][1] + x[0][1][0][0][0]; - x1[0][1][1][0] = x[1][0][1][1][0] + x[0][1][0][0][1]; - x1[0][1][0][1] = x[1][0][1][0][1] + x[0][1][0][1][0]; - x1[0][1][0][0] = x[1][0][1][0][0] + x[0][1][0][1][1]; - x1[0][0][1][1] = x[1][0][0][1][1] + x[0][1][1][0][0]; - x1[0][0][1][0] = x[1][0][0][1][0] + x[0][1][1][0][1]; - x1[0][0][0][1] = x[1][0][0][0][1] + x[0][1][1][1][0]; - x1[0][0][0][0] = x[1][0][0][0][0] + x[0][1][1][1][1]; - - /* "xor x_1j~k~l~m into x_0jklm" */ - x[0][0][0][0][0] = x0[0][0][0][0] ^ x1[0][1][1][1]; - x[0][0][0][0][1] = x0[0][0][0][1] ^ x1[0][1][1][0]; - x[0][0][0][1][0] = x0[0][0][1][0] ^ x1[0][1][0][1]; - x[0][0][0][1][1] = x0[0][0][1][1] ^ x1[0][1][0][0]; - x[0][0][1][0][0] = x0[0][1][0][0] ^ x1[0][0][1][1]; - x[0][0][1][0][1] = x0[0][1][0][1] ^ x1[0][0][1][0]; - x[0][0][1][1][0] = x0[0][1][1][0] ^ x1[0][0][0][1]; - x[0][0][1][1][1] = x0[0][1][1][1] ^ x1[0][0][0][0]; - x[0][1][0][0][0] = x0[1][0][0][0] ^ x1[1][1][1][1]; - x[0][1][0][0][1] = x0[1][0][0][1] ^ x1[1][1][1][0]; - x[0][1][0][1][0] = x0[1][0][1][0] ^ x1[1][1][0][1]; - x[0][1][0][1][1] = x0[1][0][1][1] ^ x1[1][1][0][0]; - x[0][1][1][0][0] = x0[1][1][0][0] ^ x1[1][0][1][1]; - x[0][1][1][0][1] = x0[1][1][0][1] ^ x1[1][0][1][0]; - x[0][1][1][1][0] = x0[1][1][1][0] ^ x1[1][0][0][1]; - x[0][1][1][1][1] = x0[1][1][1][1] ^ x1[1][0][0][0]; - - /* "rotate x_0jklm upwards by 11 bits" */ - x0[0][0][0][0] = ROTATEUPWARDS11(x[0][0][0][0][0]); - x0[0][0][0][1] = ROTATEUPWARDS11(x[0][0][0][0][1]); - x0[0][0][1][0] = ROTATEUPWARDS11(x[0][0][0][1][0]); - x0[0][0][1][1] = ROTATEUPWARDS11(x[0][0][0][1][1]); - x0[0][1][0][0] = ROTATEUPWARDS11(x[0][0][1][0][0]); - x0[0][1][0][1] = ROTATEUPWARDS11(x[0][0][1][0][1]); - x0[0][1][1][0] = ROTATEUPWARDS11(x[0][0][1][1][0]); - x0[0][1][1][1] = ROTATEUPWARDS11(x[0][0][1][1][1]); - x0[1][0][0][0] = ROTATEUPWARDS11(x[0][1][0][0][0]); - x0[1][0][0][1] = ROTATEUPWARDS11(x[0][1][0][0][1]); - x0[1][0][1][0] = ROTATEUPWARDS11(x[0][1][0][1][0]); - x0[1][0][1][1] = ROTATEUPWARDS11(x[0][1][0][1][1]); - x0[1][1][0][0] = ROTATEUPWARDS11(x[0][1][1][0][0]); - x0[1][1][0][1] = ROTATEUPWARDS11(x[0][1][1][0][1]); - x0[1][1][1][0] = ROTATEUPWARDS11(x[0][1][1][1][0]); - x0[1][1][1][1] = ROTATEUPWARDS11(x[0][1][1][1][1]); - - /* "add x_0jklm into x_1j~kl~m modulo 2^32" */ - x[1][0][1][0][1] = x1[0][1][0][1] + x[0][0][0][0][0]; - x[1][0][1][0][0] = x1[0][1][0][0] + x[0][0][0][0][1]; - x[1][0][1][1][1] = x1[0][1][1][1] + x[0][0][0][1][0]; - x[1][0][1][1][0] = x1[0][1][1][0] + x[0][0][0][1][1]; - x[1][0][0][0][1] = x1[0][0][0][1] + x[0][0][1][0][0]; - x[1][0][0][0][0] = x1[0][0][0][0] + x[0][0][1][0][1]; - x[1][0][0][1][1] = x1[0][0][1][1] + x[0][0][1][1][0]; - x[1][0][0][1][0] = x1[0][0][1][0] + x[0][0][1][1][1]; - x[1][1][1][0][1] = x1[1][1][0][1] + x[0][1][0][0][0]; - x[1][1][1][0][0] = x1[1][1][0][0] + x[0][1][0][0][1]; - x[1][1][1][1][1] = x1[1][1][1][1] + x[0][1][0][1][0]; - x[1][1][1][1][0] = x1[1][1][1][0] + x[0][1][0][1][1]; - x[1][1][0][0][1] = x1[1][0][0][1] + x[0][1][1][0][0]; - x[1][1][0][0][0] = x1[1][0][0][0] + x[0][1][1][0][1]; - x[1][1][0][1][1] = x1[1][0][1][1] + x[0][1][1][1][0]; - x[1][1][0][1][0] = x1[1][0][1][0] + x[0][1][1][1][1]; - - /* "xor x_1jkl~m into x_0jklm" */ - x[0][0][0][0][0] = x0[0][0][0][0] ^ x[1][0][0][0][1]; - x[0][0][0][0][1] = x0[0][0][0][1] ^ x[1][0][0][0][0]; - x[0][0][0][1][0] = x0[0][0][1][0] ^ x[1][0][0][1][1]; - x[0][0][0][1][1] = x0[0][0][1][1] ^ x[1][0][0][1][0]; - x[0][0][1][0][0] = x0[0][1][0][0] ^ x[1][0][1][0][1]; - x[0][0][1][0][1] = x0[0][1][0][1] ^ x[1][0][1][0][0]; - x[0][0][1][1][0] = x0[0][1][1][0] ^ x[1][0][1][1][1]; - x[0][0][1][1][1] = x0[0][1][1][1] ^ x[1][0][1][1][0]; - x[0][1][0][0][0] = x0[1][0][0][0] ^ x[1][1][0][0][1]; - x[0][1][0][0][1] = x0[1][0][0][1] ^ x[1][1][0][0][0]; - x[0][1][0][1][0] = x0[1][0][1][0] ^ x[1][1][0][1][1]; - x[0][1][0][1][1] = x0[1][0][1][1] ^ x[1][1][0][1][0]; - x[0][1][1][0][0] = x0[1][1][0][0] ^ x[1][1][1][0][1]; - x[0][1][1][0][1] = x0[1][1][0][1] ^ x[1][1][1][0][0]; - x[0][1][1][1][0] = x0[1][1][1][0] ^ x[1][1][1][1][1]; - x[0][1][1][1][1] = x0[1][1][1][1] ^ x[1][1][1][1][0]; - } -} - -__device__ __forceinline__ -void Final(uint32_t x[2][2][2][2][2], uint32_t *hashval) -{ - /* "the integer 1 is xored into the last state word x_11111" */ - x[1][1][1][1][1] ^= 1U; - - /* "the state is then transformed invertibly through 10r identical rounds" */ - for (int i = 0; i < 10; ++i) rrounds(x); - - /* "output the first h/8 bytes of the state" */ - hashval[0] = x[0][0][0][0][0]; - hashval[1] = x[0][0][0][0][1]; - hashval[2] = x[0][0][0][1][0]; - hashval[3] = x[0][0][0][1][1]; - hashval[4] = x[0][0][1][0][0]; - hashval[5] = x[0][0][1][0][1]; - hashval[6] = x[0][0][1][1][0]; - hashval[7] = x[0][0][1][1][1]; -} - -#if __CUDA_ARCH__ >= 500 -__global__ __launch_bounds__(TPB50, 1) -#else -__global__ __launch_bounds__(TPB35, 1) -#endif -void cubehash256_gpu_hash_32(uint32_t threads, uint32_t startNounce, uint2 *g_hash) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { -#if __CUDA_ARCH__ >= 500 - uint2 Hash[4]; - - Hash[0] = __ldg(&g_hash[thread]); - Hash[1] = __ldg(&g_hash[thread + 1 * threads]); - Hash[2] = __ldg(&g_hash[thread + 2 * threads]); - Hash[3] = __ldg(&g_hash[thread + 3 * threads]); -#else - uint32_t Hash[8]; - - LOHI(Hash[0], Hash[1], __ldg(&((uint64_t*)g_hash)[thread])); - LOHI(Hash[2], Hash[3], __ldg(&((uint64_t*)g_hash)[thread + 1 * threads])); - LOHI(Hash[4], Hash[5], __ldg(&((uint64_t*)g_hash)[thread + 2 * threads])); - LOHI(Hash[6], Hash[7], __ldg(&((uint64_t*)g_hash)[thread + 3 * threads])); -#endif - - uint32_t x[2][2][2][2][2] = - { - 0xEA2BD4B4, 0xCCD6F29F, 0x63117E71, 0x35481EAE, - 0x22512D5B, 0xE5D94E63, 0x7E624131, 0xF4CC12BE, - 0xC2D0B696, 0x42AF2070, 0xD0720C35, 0x3361DA8C, - 0x28CCECA4, 0x8EF8AD83, 0x4680AC00, 0x40E5FBAB, - 0xD89041C3, 0x6107FBD5, 0x6C859D41, 0xF0B26679, - 0x09392549, 0x5FA25603, 0x65C892FD, 0x93CB6285, - 0x2AF2B5AE, 0x9E4B4E60, 0x774ABFDD, 0x85254725, - 0x15815AEB, 0x4AB6AAD6, 0x9CDAF8AF, 0xD6032C0A - }; - -#if __CUDA_ARCH__ >= 500 - x[0][0][0][0][0] ^= Hash[0].x; - x[0][0][0][0][1] ^= Hash[0].y; - x[0][0][0][1][0] ^= Hash[1].x; - x[0][0][0][1][1] ^= Hash[1].y; - x[0][0][1][0][0] ^= Hash[2].x; - x[0][0][1][0][1] ^= Hash[2].y; - x[0][0][1][1][0] ^= Hash[3].x; - x[0][0][1][1][1] ^= Hash[3].y; -#else - x[0][0][0][0][0] ^= Hash[0]; - x[0][0][0][0][1] ^= Hash[1]; - x[0][0][0][1][0] ^= Hash[2]; - x[0][0][0][1][1] ^= Hash[3]; - x[0][0][1][0][0] ^= Hash[4]; - x[0][0][1][0][1] ^= Hash[5]; - x[0][0][1][1][0] ^= Hash[6]; - x[0][0][1][1][1] ^= Hash[7]; -#endif - rrounds(x); - x[0][0][0][0][0] ^= 0x80U; - rrounds(x); - -#if __CUDA_ARCH__ >= 500 - Final(x, (uint32_t*)Hash); - - g_hash[thread] = Hash[0]; - g_hash[1 * threads + thread] = Hash[1]; - g_hash[2 * threads + thread] = Hash[2]; - g_hash[3 * threads + thread] = Hash[3]; -#else - Final(x, Hash); - - ((uint64_t*)g_hash)[thread] = ((uint64_t*)Hash)[0]; - ((uint64_t*)g_hash)[1 * threads + thread] = ((uint64_t*)Hash)[1]; - ((uint64_t*)g_hash)[2 * threads + thread] = ((uint64_t*)Hash)[2]; - ((uint64_t*)g_hash)[3 * threads + thread] = ((uint64_t*)Hash)[3]; -#endif - } -} - -__host__ -void cubehash256_cpu_hash_32(int thr_id, uint32_t threads, uint32_t startNounce, uint64_t *d_hash, int order) -{ - uint32_t tpb = TPB35; - if (cuda_arch[thr_id] >= 500) tpb = TPB50; - - dim3 grid((threads + tpb - 1) / tpb); - dim3 block(tpb); - - cubehash256_gpu_hash_32 <<>> (threads, startNounce, (uint2*)d_hash); -} - -__host__ -void cubehash256_cpu_hash_32(int thr_id, uint32_t threads, uint32_t startNounce, uint64_t *d_hash, int order, cudaStream_t stream) -{ - uint32_t tpb = TPB35; - if (cuda_arch[thr_id] >= 500) tpb = TPB50; - - dim3 grid((threads + tpb - 1) / tpb); - dim3 block(tpb); - - cubehash256_gpu_hash_32 <<>> (threads, startNounce, (uint2*)d_hash); -} diff --git a/Algo256/cuda_fugue256.cu b/Algo256/cuda_fugue256.cu deleted file mode 100644 index 5c9d6870..00000000 --- a/Algo256/cuda_fugue256.cu +++ /dev/null @@ -1,785 +0,0 @@ -#include -#include - -#include "sph/sph_fugue.h" - -#include "cuda_helper.h" -#include - -#define USE_SHARED 1 - -uint32_t *d_fugue256_hashoutput[MAX_GPUS]; -static uint32_t *d_resultNonce[MAX_GPUS]; -static unsigned int* d_textures[MAX_GPUS][8]; - -__constant__ uint32_t GPUstate[30]; // Single GPU -__constant__ uint32_t pTarget[8]; // Single GPU - -static texture mixTab0Tex; -static texture mixTab1Tex; -static texture mixTab2Tex; -static texture mixTab3Tex; - -#if USE_SHARED -#define mixtab0(x) (*((uint32_t*)mixtabs + ( (x)))) -#define mixtab1(x) (*((uint32_t*)mixtabs + (256+(x)))) -#define mixtab2(x) (*((uint32_t*)mixtabs + (512+(x)))) -#define mixtab3(x) (*((uint32_t*)mixtabs + (768+(x)))) -#else -#define mixtab0(x) tex1Dfetch(mixTab0Tex, x) -#define mixtab1(x) tex1Dfetch(mixTab1Tex, x) -#define mixtab2(x) tex1Dfetch(mixTab2Tex, x) -#define mixtab3(x) tex1Dfetch(mixTab3Tex, x) -#endif - -/* TABELLEN */ -static const uint32_t mixtab0_cpu[] = { - SPH_C32(0x63633297), SPH_C32(0x7c7c6feb), SPH_C32(0x77775ec7), - SPH_C32(0x7b7b7af7), SPH_C32(0xf2f2e8e5), SPH_C32(0x6b6b0ab7), - SPH_C32(0x6f6f16a7), SPH_C32(0xc5c56d39), SPH_C32(0x303090c0), - SPH_C32(0x01010704), SPH_C32(0x67672e87), SPH_C32(0x2b2bd1ac), - SPH_C32(0xfefeccd5), SPH_C32(0xd7d71371), SPH_C32(0xabab7c9a), - SPH_C32(0x767659c3), SPH_C32(0xcaca4005), SPH_C32(0x8282a33e), - SPH_C32(0xc9c94909), SPH_C32(0x7d7d68ef), SPH_C32(0xfafad0c5), - SPH_C32(0x5959947f), SPH_C32(0x4747ce07), SPH_C32(0xf0f0e6ed), - SPH_C32(0xadad6e82), SPH_C32(0xd4d41a7d), SPH_C32(0xa2a243be), - SPH_C32(0xafaf608a), SPH_C32(0x9c9cf946), SPH_C32(0xa4a451a6), - SPH_C32(0x727245d3), SPH_C32(0xc0c0762d), SPH_C32(0xb7b728ea), - SPH_C32(0xfdfdc5d9), SPH_C32(0x9393d47a), SPH_C32(0x2626f298), - SPH_C32(0x363682d8), SPH_C32(0x3f3fbdfc), SPH_C32(0xf7f7f3f1), - SPH_C32(0xcccc521d), SPH_C32(0x34348cd0), SPH_C32(0xa5a556a2), - SPH_C32(0xe5e58db9), SPH_C32(0xf1f1e1e9), SPH_C32(0x71714cdf), - SPH_C32(0xd8d83e4d), SPH_C32(0x313197c4), SPH_C32(0x15156b54), - SPH_C32(0x04041c10), SPH_C32(0xc7c76331), SPH_C32(0x2323e98c), - SPH_C32(0xc3c37f21), SPH_C32(0x18184860), SPH_C32(0x9696cf6e), - SPH_C32(0x05051b14), SPH_C32(0x9a9aeb5e), SPH_C32(0x0707151c), - SPH_C32(0x12127e48), SPH_C32(0x8080ad36), SPH_C32(0xe2e298a5), - SPH_C32(0xebeba781), SPH_C32(0x2727f59c), SPH_C32(0xb2b233fe), - SPH_C32(0x757550cf), SPH_C32(0x09093f24), SPH_C32(0x8383a43a), - SPH_C32(0x2c2cc4b0), SPH_C32(0x1a1a4668), SPH_C32(0x1b1b416c), - SPH_C32(0x6e6e11a3), SPH_C32(0x5a5a9d73), SPH_C32(0xa0a04db6), - SPH_C32(0x5252a553), SPH_C32(0x3b3ba1ec), SPH_C32(0xd6d61475), - SPH_C32(0xb3b334fa), SPH_C32(0x2929dfa4), SPH_C32(0xe3e39fa1), - SPH_C32(0x2f2fcdbc), SPH_C32(0x8484b126), SPH_C32(0x5353a257), - SPH_C32(0xd1d10169), SPH_C32(0x00000000), SPH_C32(0xededb599), - SPH_C32(0x2020e080), SPH_C32(0xfcfcc2dd), SPH_C32(0xb1b13af2), - SPH_C32(0x5b5b9a77), SPH_C32(0x6a6a0db3), SPH_C32(0xcbcb4701), - SPH_C32(0xbebe17ce), SPH_C32(0x3939afe4), SPH_C32(0x4a4aed33), - SPH_C32(0x4c4cff2b), SPH_C32(0x5858937b), SPH_C32(0xcfcf5b11), - SPH_C32(0xd0d0066d), SPH_C32(0xefefbb91), SPH_C32(0xaaaa7b9e), - SPH_C32(0xfbfbd7c1), SPH_C32(0x4343d217), SPH_C32(0x4d4df82f), - SPH_C32(0x333399cc), SPH_C32(0x8585b622), SPH_C32(0x4545c00f), - SPH_C32(0xf9f9d9c9), SPH_C32(0x02020e08), SPH_C32(0x7f7f66e7), - SPH_C32(0x5050ab5b), SPH_C32(0x3c3cb4f0), SPH_C32(0x9f9ff04a), - SPH_C32(0xa8a87596), SPH_C32(0x5151ac5f), SPH_C32(0xa3a344ba), - SPH_C32(0x4040db1b), SPH_C32(0x8f8f800a), SPH_C32(0x9292d37e), - SPH_C32(0x9d9dfe42), SPH_C32(0x3838a8e0), SPH_C32(0xf5f5fdf9), - SPH_C32(0xbcbc19c6), SPH_C32(0xb6b62fee), SPH_C32(0xdada3045), - SPH_C32(0x2121e784), SPH_C32(0x10107040), SPH_C32(0xffffcbd1), - SPH_C32(0xf3f3efe1), SPH_C32(0xd2d20865), SPH_C32(0xcdcd5519), - SPH_C32(0x0c0c2430), SPH_C32(0x1313794c), SPH_C32(0xececb29d), - SPH_C32(0x5f5f8667), SPH_C32(0x9797c86a), SPH_C32(0x4444c70b), - SPH_C32(0x1717655c), SPH_C32(0xc4c46a3d), SPH_C32(0xa7a758aa), - SPH_C32(0x7e7e61e3), SPH_C32(0x3d3db3f4), SPH_C32(0x6464278b), - SPH_C32(0x5d5d886f), SPH_C32(0x19194f64), SPH_C32(0x737342d7), - SPH_C32(0x60603b9b), SPH_C32(0x8181aa32), SPH_C32(0x4f4ff627), - SPH_C32(0xdcdc225d), SPH_C32(0x2222ee88), SPH_C32(0x2a2ad6a8), - SPH_C32(0x9090dd76), SPH_C32(0x88889516), SPH_C32(0x4646c903), - SPH_C32(0xeeeebc95), SPH_C32(0xb8b805d6), SPH_C32(0x14146c50), - SPH_C32(0xdede2c55), SPH_C32(0x5e5e8163), SPH_C32(0x0b0b312c), - SPH_C32(0xdbdb3741), SPH_C32(0xe0e096ad), SPH_C32(0x32329ec8), - SPH_C32(0x3a3aa6e8), SPH_C32(0x0a0a3628), SPH_C32(0x4949e43f), - SPH_C32(0x06061218), SPH_C32(0x2424fc90), SPH_C32(0x5c5c8f6b), - SPH_C32(0xc2c27825), SPH_C32(0xd3d30f61), SPH_C32(0xacac6986), - SPH_C32(0x62623593), SPH_C32(0x9191da72), SPH_C32(0x9595c662), - SPH_C32(0xe4e48abd), SPH_C32(0x797974ff), SPH_C32(0xe7e783b1), - SPH_C32(0xc8c84e0d), SPH_C32(0x373785dc), SPH_C32(0x6d6d18af), - SPH_C32(0x8d8d8e02), SPH_C32(0xd5d51d79), SPH_C32(0x4e4ef123), - SPH_C32(0xa9a97292), SPH_C32(0x6c6c1fab), SPH_C32(0x5656b943), - SPH_C32(0xf4f4fafd), SPH_C32(0xeaeaa085), SPH_C32(0x6565208f), - SPH_C32(0x7a7a7df3), SPH_C32(0xaeae678e), SPH_C32(0x08083820), - SPH_C32(0xbaba0bde), SPH_C32(0x787873fb), SPH_C32(0x2525fb94), - SPH_C32(0x2e2ecab8), SPH_C32(0x1c1c5470), SPH_C32(0xa6a65fae), - SPH_C32(0xb4b421e6), SPH_C32(0xc6c66435), SPH_C32(0xe8e8ae8d), - SPH_C32(0xdddd2559), SPH_C32(0x747457cb), SPH_C32(0x1f1f5d7c), - SPH_C32(0x4b4bea37), SPH_C32(0xbdbd1ec2), SPH_C32(0x8b8b9c1a), - SPH_C32(0x8a8a9b1e), SPH_C32(0x70704bdb), SPH_C32(0x3e3ebaf8), - SPH_C32(0xb5b526e2), SPH_C32(0x66662983), SPH_C32(0x4848e33b), - SPH_C32(0x0303090c), SPH_C32(0xf6f6f4f5), SPH_C32(0x0e0e2a38), - SPH_C32(0x61613c9f), SPH_C32(0x35358bd4), SPH_C32(0x5757be47), - SPH_C32(0xb9b902d2), SPH_C32(0x8686bf2e), SPH_C32(0xc1c17129), - SPH_C32(0x1d1d5374), SPH_C32(0x9e9ef74e), SPH_C32(0xe1e191a9), - SPH_C32(0xf8f8decd), SPH_C32(0x9898e556), SPH_C32(0x11117744), - SPH_C32(0x696904bf), SPH_C32(0xd9d93949), SPH_C32(0x8e8e870e), - SPH_C32(0x9494c166), SPH_C32(0x9b9bec5a), SPH_C32(0x1e1e5a78), - SPH_C32(0x8787b82a), SPH_C32(0xe9e9a989), SPH_C32(0xcece5c15), - SPH_C32(0x5555b04f), SPH_C32(0x2828d8a0), SPH_C32(0xdfdf2b51), - SPH_C32(0x8c8c8906), SPH_C32(0xa1a14ab2), SPH_C32(0x89899212), - SPH_C32(0x0d0d2334), SPH_C32(0xbfbf10ca), SPH_C32(0xe6e684b5), - SPH_C32(0x4242d513), SPH_C32(0x686803bb), SPH_C32(0x4141dc1f), - SPH_C32(0x9999e252), SPH_C32(0x2d2dc3b4), SPH_C32(0x0f0f2d3c), - SPH_C32(0xb0b03df6), SPH_C32(0x5454b74b), SPH_C32(0xbbbb0cda), - SPH_C32(0x16166258) -}; - -static const uint32_t mixtab1_cpu[] = { - SPH_C32(0x97636332), SPH_C32(0xeb7c7c6f), SPH_C32(0xc777775e), - SPH_C32(0xf77b7b7a), SPH_C32(0xe5f2f2e8), SPH_C32(0xb76b6b0a), - SPH_C32(0xa76f6f16), SPH_C32(0x39c5c56d), SPH_C32(0xc0303090), - SPH_C32(0x04010107), SPH_C32(0x8767672e), SPH_C32(0xac2b2bd1), - SPH_C32(0xd5fefecc), SPH_C32(0x71d7d713), SPH_C32(0x9aabab7c), - SPH_C32(0xc3767659), SPH_C32(0x05caca40), SPH_C32(0x3e8282a3), - SPH_C32(0x09c9c949), SPH_C32(0xef7d7d68), SPH_C32(0xc5fafad0), - SPH_C32(0x7f595994), SPH_C32(0x074747ce), SPH_C32(0xedf0f0e6), - SPH_C32(0x82adad6e), SPH_C32(0x7dd4d41a), SPH_C32(0xbea2a243), - SPH_C32(0x8aafaf60), SPH_C32(0x469c9cf9), SPH_C32(0xa6a4a451), - SPH_C32(0xd3727245), SPH_C32(0x2dc0c076), SPH_C32(0xeab7b728), - SPH_C32(0xd9fdfdc5), SPH_C32(0x7a9393d4), SPH_C32(0x982626f2), - SPH_C32(0xd8363682), SPH_C32(0xfc3f3fbd), SPH_C32(0xf1f7f7f3), - SPH_C32(0x1dcccc52), SPH_C32(0xd034348c), SPH_C32(0xa2a5a556), - SPH_C32(0xb9e5e58d), SPH_C32(0xe9f1f1e1), SPH_C32(0xdf71714c), - SPH_C32(0x4dd8d83e), SPH_C32(0xc4313197), SPH_C32(0x5415156b), - SPH_C32(0x1004041c), SPH_C32(0x31c7c763), SPH_C32(0x8c2323e9), - SPH_C32(0x21c3c37f), SPH_C32(0x60181848), SPH_C32(0x6e9696cf), - SPH_C32(0x1405051b), SPH_C32(0x5e9a9aeb), SPH_C32(0x1c070715), - SPH_C32(0x4812127e), SPH_C32(0x368080ad), SPH_C32(0xa5e2e298), - SPH_C32(0x81ebeba7), SPH_C32(0x9c2727f5), SPH_C32(0xfeb2b233), - SPH_C32(0xcf757550), SPH_C32(0x2409093f), SPH_C32(0x3a8383a4), - SPH_C32(0xb02c2cc4), SPH_C32(0x681a1a46), SPH_C32(0x6c1b1b41), - SPH_C32(0xa36e6e11), SPH_C32(0x735a5a9d), SPH_C32(0xb6a0a04d), - SPH_C32(0x535252a5), SPH_C32(0xec3b3ba1), SPH_C32(0x75d6d614), - SPH_C32(0xfab3b334), SPH_C32(0xa42929df), SPH_C32(0xa1e3e39f), - SPH_C32(0xbc2f2fcd), SPH_C32(0x268484b1), SPH_C32(0x575353a2), - SPH_C32(0x69d1d101), SPH_C32(0x00000000), SPH_C32(0x99ededb5), - SPH_C32(0x802020e0), SPH_C32(0xddfcfcc2), SPH_C32(0xf2b1b13a), - SPH_C32(0x775b5b9a), SPH_C32(0xb36a6a0d), SPH_C32(0x01cbcb47), - SPH_C32(0xcebebe17), SPH_C32(0xe43939af), SPH_C32(0x334a4aed), - SPH_C32(0x2b4c4cff), SPH_C32(0x7b585893), SPH_C32(0x11cfcf5b), - SPH_C32(0x6dd0d006), SPH_C32(0x91efefbb), SPH_C32(0x9eaaaa7b), - SPH_C32(0xc1fbfbd7), SPH_C32(0x174343d2), SPH_C32(0x2f4d4df8), - SPH_C32(0xcc333399), SPH_C32(0x228585b6), SPH_C32(0x0f4545c0), - SPH_C32(0xc9f9f9d9), SPH_C32(0x0802020e), SPH_C32(0xe77f7f66), - SPH_C32(0x5b5050ab), SPH_C32(0xf03c3cb4), SPH_C32(0x4a9f9ff0), - SPH_C32(0x96a8a875), SPH_C32(0x5f5151ac), SPH_C32(0xbaa3a344), - SPH_C32(0x1b4040db), SPH_C32(0x0a8f8f80), SPH_C32(0x7e9292d3), - SPH_C32(0x429d9dfe), SPH_C32(0xe03838a8), SPH_C32(0xf9f5f5fd), - SPH_C32(0xc6bcbc19), SPH_C32(0xeeb6b62f), SPH_C32(0x45dada30), - SPH_C32(0x842121e7), SPH_C32(0x40101070), SPH_C32(0xd1ffffcb), - SPH_C32(0xe1f3f3ef), SPH_C32(0x65d2d208), SPH_C32(0x19cdcd55), - SPH_C32(0x300c0c24), SPH_C32(0x4c131379), SPH_C32(0x9dececb2), - SPH_C32(0x675f5f86), SPH_C32(0x6a9797c8), SPH_C32(0x0b4444c7), - SPH_C32(0x5c171765), SPH_C32(0x3dc4c46a), SPH_C32(0xaaa7a758), - SPH_C32(0xe37e7e61), SPH_C32(0xf43d3db3), SPH_C32(0x8b646427), - SPH_C32(0x6f5d5d88), SPH_C32(0x6419194f), SPH_C32(0xd7737342), - SPH_C32(0x9b60603b), SPH_C32(0x328181aa), SPH_C32(0x274f4ff6), - SPH_C32(0x5ddcdc22), SPH_C32(0x882222ee), SPH_C32(0xa82a2ad6), - SPH_C32(0x769090dd), SPH_C32(0x16888895), SPH_C32(0x034646c9), - SPH_C32(0x95eeeebc), SPH_C32(0xd6b8b805), SPH_C32(0x5014146c), - SPH_C32(0x55dede2c), SPH_C32(0x635e5e81), SPH_C32(0x2c0b0b31), - SPH_C32(0x41dbdb37), SPH_C32(0xade0e096), SPH_C32(0xc832329e), - SPH_C32(0xe83a3aa6), SPH_C32(0x280a0a36), SPH_C32(0x3f4949e4), - SPH_C32(0x18060612), SPH_C32(0x902424fc), SPH_C32(0x6b5c5c8f), - SPH_C32(0x25c2c278), SPH_C32(0x61d3d30f), SPH_C32(0x86acac69), - SPH_C32(0x93626235), SPH_C32(0x729191da), SPH_C32(0x629595c6), - SPH_C32(0xbde4e48a), SPH_C32(0xff797974), SPH_C32(0xb1e7e783), - SPH_C32(0x0dc8c84e), SPH_C32(0xdc373785), SPH_C32(0xaf6d6d18), - SPH_C32(0x028d8d8e), SPH_C32(0x79d5d51d), SPH_C32(0x234e4ef1), - SPH_C32(0x92a9a972), SPH_C32(0xab6c6c1f), SPH_C32(0x435656b9), - SPH_C32(0xfdf4f4fa), SPH_C32(0x85eaeaa0), SPH_C32(0x8f656520), - SPH_C32(0xf37a7a7d), SPH_C32(0x8eaeae67), SPH_C32(0x20080838), - SPH_C32(0xdebaba0b), SPH_C32(0xfb787873), SPH_C32(0x942525fb), - SPH_C32(0xb82e2eca), SPH_C32(0x701c1c54), SPH_C32(0xaea6a65f), - SPH_C32(0xe6b4b421), SPH_C32(0x35c6c664), SPH_C32(0x8de8e8ae), - SPH_C32(0x59dddd25), SPH_C32(0xcb747457), SPH_C32(0x7c1f1f5d), - SPH_C32(0x374b4bea), SPH_C32(0xc2bdbd1e), SPH_C32(0x1a8b8b9c), - SPH_C32(0x1e8a8a9b), SPH_C32(0xdb70704b), SPH_C32(0xf83e3eba), - SPH_C32(0xe2b5b526), SPH_C32(0x83666629), SPH_C32(0x3b4848e3), - SPH_C32(0x0c030309), SPH_C32(0xf5f6f6f4), SPH_C32(0x380e0e2a), - SPH_C32(0x9f61613c), SPH_C32(0xd435358b), SPH_C32(0x475757be), - SPH_C32(0xd2b9b902), SPH_C32(0x2e8686bf), SPH_C32(0x29c1c171), - SPH_C32(0x741d1d53), SPH_C32(0x4e9e9ef7), SPH_C32(0xa9e1e191), - SPH_C32(0xcdf8f8de), SPH_C32(0x569898e5), SPH_C32(0x44111177), - SPH_C32(0xbf696904), SPH_C32(0x49d9d939), SPH_C32(0x0e8e8e87), - SPH_C32(0x669494c1), SPH_C32(0x5a9b9bec), SPH_C32(0x781e1e5a), - SPH_C32(0x2a8787b8), SPH_C32(0x89e9e9a9), SPH_C32(0x15cece5c), - SPH_C32(0x4f5555b0), SPH_C32(0xa02828d8), SPH_C32(0x51dfdf2b), - SPH_C32(0x068c8c89), SPH_C32(0xb2a1a14a), SPH_C32(0x12898992), - SPH_C32(0x340d0d23), SPH_C32(0xcabfbf10), SPH_C32(0xb5e6e684), - SPH_C32(0x134242d5), SPH_C32(0xbb686803), SPH_C32(0x1f4141dc), - SPH_C32(0x529999e2), SPH_C32(0xb42d2dc3), SPH_C32(0x3c0f0f2d), - SPH_C32(0xf6b0b03d), SPH_C32(0x4b5454b7), SPH_C32(0xdabbbb0c), - SPH_C32(0x58161662) -}; - -static const uint32_t mixtab2_cpu[] = { - SPH_C32(0x32976363), SPH_C32(0x6feb7c7c), SPH_C32(0x5ec77777), - SPH_C32(0x7af77b7b), SPH_C32(0xe8e5f2f2), SPH_C32(0x0ab76b6b), - SPH_C32(0x16a76f6f), SPH_C32(0x6d39c5c5), SPH_C32(0x90c03030), - SPH_C32(0x07040101), SPH_C32(0x2e876767), SPH_C32(0xd1ac2b2b), - SPH_C32(0xccd5fefe), SPH_C32(0x1371d7d7), SPH_C32(0x7c9aabab), - SPH_C32(0x59c37676), SPH_C32(0x4005caca), SPH_C32(0xa33e8282), - SPH_C32(0x4909c9c9), SPH_C32(0x68ef7d7d), SPH_C32(0xd0c5fafa), - SPH_C32(0x947f5959), SPH_C32(0xce074747), SPH_C32(0xe6edf0f0), - SPH_C32(0x6e82adad), SPH_C32(0x1a7dd4d4), SPH_C32(0x43bea2a2), - SPH_C32(0x608aafaf), SPH_C32(0xf9469c9c), SPH_C32(0x51a6a4a4), - SPH_C32(0x45d37272), SPH_C32(0x762dc0c0), SPH_C32(0x28eab7b7), - SPH_C32(0xc5d9fdfd), SPH_C32(0xd47a9393), SPH_C32(0xf2982626), - SPH_C32(0x82d83636), SPH_C32(0xbdfc3f3f), SPH_C32(0xf3f1f7f7), - SPH_C32(0x521dcccc), SPH_C32(0x8cd03434), SPH_C32(0x56a2a5a5), - SPH_C32(0x8db9e5e5), SPH_C32(0xe1e9f1f1), SPH_C32(0x4cdf7171), - SPH_C32(0x3e4dd8d8), SPH_C32(0x97c43131), SPH_C32(0x6b541515), - SPH_C32(0x1c100404), SPH_C32(0x6331c7c7), SPH_C32(0xe98c2323), - SPH_C32(0x7f21c3c3), SPH_C32(0x48601818), SPH_C32(0xcf6e9696), - SPH_C32(0x1b140505), SPH_C32(0xeb5e9a9a), SPH_C32(0x151c0707), - SPH_C32(0x7e481212), SPH_C32(0xad368080), SPH_C32(0x98a5e2e2), - SPH_C32(0xa781ebeb), SPH_C32(0xf59c2727), SPH_C32(0x33feb2b2), - SPH_C32(0x50cf7575), SPH_C32(0x3f240909), SPH_C32(0xa43a8383), - SPH_C32(0xc4b02c2c), SPH_C32(0x46681a1a), SPH_C32(0x416c1b1b), - SPH_C32(0x11a36e6e), SPH_C32(0x9d735a5a), SPH_C32(0x4db6a0a0), - SPH_C32(0xa5535252), SPH_C32(0xa1ec3b3b), SPH_C32(0x1475d6d6), - SPH_C32(0x34fab3b3), SPH_C32(0xdfa42929), SPH_C32(0x9fa1e3e3), - SPH_C32(0xcdbc2f2f), SPH_C32(0xb1268484), SPH_C32(0xa2575353), - SPH_C32(0x0169d1d1), SPH_C32(0x00000000), SPH_C32(0xb599eded), - SPH_C32(0xe0802020), SPH_C32(0xc2ddfcfc), SPH_C32(0x3af2b1b1), - SPH_C32(0x9a775b5b), SPH_C32(0x0db36a6a), SPH_C32(0x4701cbcb), - SPH_C32(0x17cebebe), SPH_C32(0xafe43939), SPH_C32(0xed334a4a), - SPH_C32(0xff2b4c4c), SPH_C32(0x937b5858), SPH_C32(0x5b11cfcf), - SPH_C32(0x066dd0d0), SPH_C32(0xbb91efef), SPH_C32(0x7b9eaaaa), - SPH_C32(0xd7c1fbfb), SPH_C32(0xd2174343), SPH_C32(0xf82f4d4d), - SPH_C32(0x99cc3333), SPH_C32(0xb6228585), SPH_C32(0xc00f4545), - SPH_C32(0xd9c9f9f9), SPH_C32(0x0e080202), SPH_C32(0x66e77f7f), - SPH_C32(0xab5b5050), SPH_C32(0xb4f03c3c), SPH_C32(0xf04a9f9f), - SPH_C32(0x7596a8a8), SPH_C32(0xac5f5151), SPH_C32(0x44baa3a3), - SPH_C32(0xdb1b4040), SPH_C32(0x800a8f8f), SPH_C32(0xd37e9292), - SPH_C32(0xfe429d9d), SPH_C32(0xa8e03838), SPH_C32(0xfdf9f5f5), - SPH_C32(0x19c6bcbc), SPH_C32(0x2feeb6b6), SPH_C32(0x3045dada), - SPH_C32(0xe7842121), SPH_C32(0x70401010), SPH_C32(0xcbd1ffff), - SPH_C32(0xefe1f3f3), SPH_C32(0x0865d2d2), SPH_C32(0x5519cdcd), - SPH_C32(0x24300c0c), SPH_C32(0x794c1313), SPH_C32(0xb29decec), - SPH_C32(0x86675f5f), SPH_C32(0xc86a9797), SPH_C32(0xc70b4444), - SPH_C32(0x655c1717), SPH_C32(0x6a3dc4c4), SPH_C32(0x58aaa7a7), - SPH_C32(0x61e37e7e), SPH_C32(0xb3f43d3d), SPH_C32(0x278b6464), - SPH_C32(0x886f5d5d), SPH_C32(0x4f641919), SPH_C32(0x42d77373), - SPH_C32(0x3b9b6060), SPH_C32(0xaa328181), SPH_C32(0xf6274f4f), - SPH_C32(0x225ddcdc), SPH_C32(0xee882222), SPH_C32(0xd6a82a2a), - SPH_C32(0xdd769090), SPH_C32(0x95168888), SPH_C32(0xc9034646), - SPH_C32(0xbc95eeee), SPH_C32(0x05d6b8b8), SPH_C32(0x6c501414), - SPH_C32(0x2c55dede), SPH_C32(0x81635e5e), SPH_C32(0x312c0b0b), - SPH_C32(0x3741dbdb), SPH_C32(0x96ade0e0), SPH_C32(0x9ec83232), - SPH_C32(0xa6e83a3a), SPH_C32(0x36280a0a), SPH_C32(0xe43f4949), - SPH_C32(0x12180606), SPH_C32(0xfc902424), SPH_C32(0x8f6b5c5c), - SPH_C32(0x7825c2c2), SPH_C32(0x0f61d3d3), SPH_C32(0x6986acac), - SPH_C32(0x35936262), SPH_C32(0xda729191), SPH_C32(0xc6629595), - SPH_C32(0x8abde4e4), SPH_C32(0x74ff7979), SPH_C32(0x83b1e7e7), - SPH_C32(0x4e0dc8c8), SPH_C32(0x85dc3737), SPH_C32(0x18af6d6d), - SPH_C32(0x8e028d8d), SPH_C32(0x1d79d5d5), SPH_C32(0xf1234e4e), - SPH_C32(0x7292a9a9), SPH_C32(0x1fab6c6c), SPH_C32(0xb9435656), - SPH_C32(0xfafdf4f4), SPH_C32(0xa085eaea), SPH_C32(0x208f6565), - SPH_C32(0x7df37a7a), SPH_C32(0x678eaeae), SPH_C32(0x38200808), - SPH_C32(0x0bdebaba), SPH_C32(0x73fb7878), SPH_C32(0xfb942525), - SPH_C32(0xcab82e2e), SPH_C32(0x54701c1c), SPH_C32(0x5faea6a6), - SPH_C32(0x21e6b4b4), SPH_C32(0x6435c6c6), SPH_C32(0xae8de8e8), - SPH_C32(0x2559dddd), SPH_C32(0x57cb7474), SPH_C32(0x5d7c1f1f), - SPH_C32(0xea374b4b), SPH_C32(0x1ec2bdbd), SPH_C32(0x9c1a8b8b), - SPH_C32(0x9b1e8a8a), SPH_C32(0x4bdb7070), SPH_C32(0xbaf83e3e), - SPH_C32(0x26e2b5b5), SPH_C32(0x29836666), SPH_C32(0xe33b4848), - SPH_C32(0x090c0303), SPH_C32(0xf4f5f6f6), SPH_C32(0x2a380e0e), - SPH_C32(0x3c9f6161), SPH_C32(0x8bd43535), SPH_C32(0xbe475757), - SPH_C32(0x02d2b9b9), SPH_C32(0xbf2e8686), SPH_C32(0x7129c1c1), - SPH_C32(0x53741d1d), SPH_C32(0xf74e9e9e), SPH_C32(0x91a9e1e1), - SPH_C32(0xdecdf8f8), SPH_C32(0xe5569898), SPH_C32(0x77441111), - SPH_C32(0x04bf6969), SPH_C32(0x3949d9d9), SPH_C32(0x870e8e8e), - SPH_C32(0xc1669494), SPH_C32(0xec5a9b9b), SPH_C32(0x5a781e1e), - SPH_C32(0xb82a8787), SPH_C32(0xa989e9e9), SPH_C32(0x5c15cece), - SPH_C32(0xb04f5555), SPH_C32(0xd8a02828), SPH_C32(0x2b51dfdf), - SPH_C32(0x89068c8c), SPH_C32(0x4ab2a1a1), SPH_C32(0x92128989), - SPH_C32(0x23340d0d), SPH_C32(0x10cabfbf), SPH_C32(0x84b5e6e6), - SPH_C32(0xd5134242), SPH_C32(0x03bb6868), SPH_C32(0xdc1f4141), - SPH_C32(0xe2529999), SPH_C32(0xc3b42d2d), SPH_C32(0x2d3c0f0f), - SPH_C32(0x3df6b0b0), SPH_C32(0xb74b5454), SPH_C32(0x0cdabbbb), - SPH_C32(0x62581616) -}; - -static const uint32_t mixtab3_cpu[] = { - SPH_C32(0x63329763), SPH_C32(0x7c6feb7c), SPH_C32(0x775ec777), - SPH_C32(0x7b7af77b), SPH_C32(0xf2e8e5f2), SPH_C32(0x6b0ab76b), - SPH_C32(0x6f16a76f), SPH_C32(0xc56d39c5), SPH_C32(0x3090c030), - SPH_C32(0x01070401), SPH_C32(0x672e8767), SPH_C32(0x2bd1ac2b), - SPH_C32(0xfeccd5fe), SPH_C32(0xd71371d7), SPH_C32(0xab7c9aab), - SPH_C32(0x7659c376), SPH_C32(0xca4005ca), SPH_C32(0x82a33e82), - SPH_C32(0xc94909c9), SPH_C32(0x7d68ef7d), SPH_C32(0xfad0c5fa), - SPH_C32(0x59947f59), SPH_C32(0x47ce0747), SPH_C32(0xf0e6edf0), - SPH_C32(0xad6e82ad), SPH_C32(0xd41a7dd4), SPH_C32(0xa243bea2), - SPH_C32(0xaf608aaf), SPH_C32(0x9cf9469c), SPH_C32(0xa451a6a4), - SPH_C32(0x7245d372), SPH_C32(0xc0762dc0), SPH_C32(0xb728eab7), - SPH_C32(0xfdc5d9fd), SPH_C32(0x93d47a93), SPH_C32(0x26f29826), - SPH_C32(0x3682d836), SPH_C32(0x3fbdfc3f), SPH_C32(0xf7f3f1f7), - SPH_C32(0xcc521dcc), SPH_C32(0x348cd034), SPH_C32(0xa556a2a5), - SPH_C32(0xe58db9e5), SPH_C32(0xf1e1e9f1), SPH_C32(0x714cdf71), - SPH_C32(0xd83e4dd8), SPH_C32(0x3197c431), SPH_C32(0x156b5415), - SPH_C32(0x041c1004), SPH_C32(0xc76331c7), SPH_C32(0x23e98c23), - SPH_C32(0xc37f21c3), SPH_C32(0x18486018), SPH_C32(0x96cf6e96), - SPH_C32(0x051b1405), SPH_C32(0x9aeb5e9a), SPH_C32(0x07151c07), - SPH_C32(0x127e4812), SPH_C32(0x80ad3680), SPH_C32(0xe298a5e2), - SPH_C32(0xeba781eb), SPH_C32(0x27f59c27), SPH_C32(0xb233feb2), - SPH_C32(0x7550cf75), SPH_C32(0x093f2409), SPH_C32(0x83a43a83), - SPH_C32(0x2cc4b02c), SPH_C32(0x1a46681a), SPH_C32(0x1b416c1b), - SPH_C32(0x6e11a36e), SPH_C32(0x5a9d735a), SPH_C32(0xa04db6a0), - SPH_C32(0x52a55352), SPH_C32(0x3ba1ec3b), SPH_C32(0xd61475d6), - SPH_C32(0xb334fab3), SPH_C32(0x29dfa429), SPH_C32(0xe39fa1e3), - SPH_C32(0x2fcdbc2f), SPH_C32(0x84b12684), SPH_C32(0x53a25753), - SPH_C32(0xd10169d1), SPH_C32(0x00000000), SPH_C32(0xedb599ed), - SPH_C32(0x20e08020), SPH_C32(0xfcc2ddfc), SPH_C32(0xb13af2b1), - SPH_C32(0x5b9a775b), SPH_C32(0x6a0db36a), SPH_C32(0xcb4701cb), - SPH_C32(0xbe17cebe), SPH_C32(0x39afe439), SPH_C32(0x4aed334a), - SPH_C32(0x4cff2b4c), SPH_C32(0x58937b58), SPH_C32(0xcf5b11cf), - SPH_C32(0xd0066dd0), SPH_C32(0xefbb91ef), SPH_C32(0xaa7b9eaa), - SPH_C32(0xfbd7c1fb), SPH_C32(0x43d21743), SPH_C32(0x4df82f4d), - SPH_C32(0x3399cc33), SPH_C32(0x85b62285), SPH_C32(0x45c00f45), - SPH_C32(0xf9d9c9f9), SPH_C32(0x020e0802), SPH_C32(0x7f66e77f), - SPH_C32(0x50ab5b50), SPH_C32(0x3cb4f03c), SPH_C32(0x9ff04a9f), - SPH_C32(0xa87596a8), SPH_C32(0x51ac5f51), SPH_C32(0xa344baa3), - SPH_C32(0x40db1b40), SPH_C32(0x8f800a8f), SPH_C32(0x92d37e92), - SPH_C32(0x9dfe429d), SPH_C32(0x38a8e038), SPH_C32(0xf5fdf9f5), - SPH_C32(0xbc19c6bc), SPH_C32(0xb62feeb6), SPH_C32(0xda3045da), - SPH_C32(0x21e78421), SPH_C32(0x10704010), SPH_C32(0xffcbd1ff), - SPH_C32(0xf3efe1f3), SPH_C32(0xd20865d2), SPH_C32(0xcd5519cd), - SPH_C32(0x0c24300c), SPH_C32(0x13794c13), SPH_C32(0xecb29dec), - SPH_C32(0x5f86675f), SPH_C32(0x97c86a97), SPH_C32(0x44c70b44), - SPH_C32(0x17655c17), SPH_C32(0xc46a3dc4), SPH_C32(0xa758aaa7), - SPH_C32(0x7e61e37e), SPH_C32(0x3db3f43d), SPH_C32(0x64278b64), - SPH_C32(0x5d886f5d), SPH_C32(0x194f6419), SPH_C32(0x7342d773), - SPH_C32(0x603b9b60), SPH_C32(0x81aa3281), SPH_C32(0x4ff6274f), - SPH_C32(0xdc225ddc), SPH_C32(0x22ee8822), SPH_C32(0x2ad6a82a), - SPH_C32(0x90dd7690), SPH_C32(0x88951688), SPH_C32(0x46c90346), - SPH_C32(0xeebc95ee), SPH_C32(0xb805d6b8), SPH_C32(0x146c5014), - SPH_C32(0xde2c55de), SPH_C32(0x5e81635e), SPH_C32(0x0b312c0b), - SPH_C32(0xdb3741db), SPH_C32(0xe096ade0), SPH_C32(0x329ec832), - SPH_C32(0x3aa6e83a), SPH_C32(0x0a36280a), SPH_C32(0x49e43f49), - SPH_C32(0x06121806), SPH_C32(0x24fc9024), SPH_C32(0x5c8f6b5c), - SPH_C32(0xc27825c2), SPH_C32(0xd30f61d3), SPH_C32(0xac6986ac), - SPH_C32(0x62359362), SPH_C32(0x91da7291), SPH_C32(0x95c66295), - SPH_C32(0xe48abde4), SPH_C32(0x7974ff79), SPH_C32(0xe783b1e7), - SPH_C32(0xc84e0dc8), SPH_C32(0x3785dc37), SPH_C32(0x6d18af6d), - SPH_C32(0x8d8e028d), SPH_C32(0xd51d79d5), SPH_C32(0x4ef1234e), - SPH_C32(0xa97292a9), SPH_C32(0x6c1fab6c), SPH_C32(0x56b94356), - SPH_C32(0xf4fafdf4), SPH_C32(0xeaa085ea), SPH_C32(0x65208f65), - SPH_C32(0x7a7df37a), SPH_C32(0xae678eae), SPH_C32(0x08382008), - SPH_C32(0xba0bdeba), SPH_C32(0x7873fb78), SPH_C32(0x25fb9425), - SPH_C32(0x2ecab82e), SPH_C32(0x1c54701c), SPH_C32(0xa65faea6), - SPH_C32(0xb421e6b4), SPH_C32(0xc66435c6), SPH_C32(0xe8ae8de8), - SPH_C32(0xdd2559dd), SPH_C32(0x7457cb74), SPH_C32(0x1f5d7c1f), - SPH_C32(0x4bea374b), SPH_C32(0xbd1ec2bd), SPH_C32(0x8b9c1a8b), - SPH_C32(0x8a9b1e8a), SPH_C32(0x704bdb70), SPH_C32(0x3ebaf83e), - SPH_C32(0xb526e2b5), SPH_C32(0x66298366), SPH_C32(0x48e33b48), - SPH_C32(0x03090c03), SPH_C32(0xf6f4f5f6), SPH_C32(0x0e2a380e), - SPH_C32(0x613c9f61), SPH_C32(0x358bd435), SPH_C32(0x57be4757), - SPH_C32(0xb902d2b9), SPH_C32(0x86bf2e86), SPH_C32(0xc17129c1), - SPH_C32(0x1d53741d), SPH_C32(0x9ef74e9e), SPH_C32(0xe191a9e1), - SPH_C32(0xf8decdf8), SPH_C32(0x98e55698), SPH_C32(0x11774411), - SPH_C32(0x6904bf69), SPH_C32(0xd93949d9), SPH_C32(0x8e870e8e), - SPH_C32(0x94c16694), SPH_C32(0x9bec5a9b), SPH_C32(0x1e5a781e), - SPH_C32(0x87b82a87), SPH_C32(0xe9a989e9), SPH_C32(0xce5c15ce), - SPH_C32(0x55b04f55), SPH_C32(0x28d8a028), SPH_C32(0xdf2b51df), - SPH_C32(0x8c89068c), SPH_C32(0xa14ab2a1), SPH_C32(0x89921289), - SPH_C32(0x0d23340d), SPH_C32(0xbf10cabf), SPH_C32(0xe684b5e6), - SPH_C32(0x42d51342), SPH_C32(0x6803bb68), SPH_C32(0x41dc1f41), - SPH_C32(0x99e25299), SPH_C32(0x2dc3b42d), SPH_C32(0x0f2d3c0f), - SPH_C32(0xb03df6b0), SPH_C32(0x54b74b54), SPH_C32(0xbb0cdabb), - SPH_C32(0x16625816) -}; - -#define TIX2(q, x00, x01, x08, x10, x24) { \ - x10 ^= x00; \ - x00 = (q); \ - x08 ^= x00; \ - x01 ^= x24; \ - } - -#define TIX3(q, x00, x01, x04, x08, x16, x27, x30) { \ - x16 ^= x00; \ - x00 = (q); \ - x08 ^= x00; \ - x01 ^= x27; \ - x04 ^= x30; \ - } - -#define TIX4(q, x00, x01, x04, x07, x08, x22, x24, x27, x30) { \ - x22 ^= x00; \ - x00 = (q); \ - x08 ^= x00; \ - x01 ^= x24; \ - x04 ^= x27; \ - x07 ^= x30; \ - } - -#define CMIX30(x00, x01, x02, x04, x05, x06, x15, x16, x17) { \ - x00 ^= x04; \ - x01 ^= x05; \ - x02 ^= x06; \ - x15 ^= x04; \ - x16 ^= x05; \ - x17 ^= x06; \ - } - -#define CMIX36(x00, x01, x02, x04, x05, x06, x18, x19, x20) { \ - x00 ^= x04; \ - x01 ^= x05; \ - x02 ^= x06; \ - x18 ^= x04; \ - x19 ^= x05; \ - x20 ^= x06; \ - } - -#define SMIX(x0, x1, x2, x3) { \ - uint32_t c0 = 0; \ - uint32_t c1 = 0; \ - uint32_t c2 = 0; \ - uint32_t c3 = 0; \ - uint32_t r0 = 0; \ - uint32_t r1 = 0; \ - uint32_t r2 = 0; \ - uint32_t r3 = 0; \ - uint32_t tmp; \ - tmp = mixtab0(x0 >> 24); \ - c0 ^= tmp; \ - tmp = mixtab1((x0 >> 16) & 0xFF); \ - c0 ^= tmp; \ - r1 ^= tmp; \ - tmp = mixtab2((x0 >> 8) & 0xFF); \ - c0 ^= tmp; \ - r2 ^= tmp; \ - tmp = mixtab3(x0 & 0xFF); \ - c0 ^= tmp; \ - r3 ^= tmp; \ - tmp = mixtab0(x1 >> 24); \ - c1 ^= tmp; \ - r0 ^= tmp; \ - tmp = mixtab1((x1 >> 16) & 0xFF); \ - c1 ^= tmp; \ - tmp = mixtab2((x1 >> 8) & 0xFF); \ - c1 ^= tmp; \ - r2 ^= tmp; \ - tmp = mixtab3(x1 & 0xFF); \ - c1 ^= tmp; \ - r3 ^= tmp; \ - tmp = mixtab0(x2 >> 24); \ - c2 ^= tmp; \ - r0 ^= tmp; \ - tmp = mixtab1((x2 >> 16) & 0xFF); \ - c2 ^= tmp; \ - r1 ^= tmp; \ - tmp = mixtab2((x2 >> 8) & 0xFF); \ - c2 ^= tmp; \ - tmp = mixtab3(x2 & 0xFF); \ - c2 ^= tmp; \ - r3 ^= tmp; \ - tmp = mixtab0(x3 >> 24); \ - c3 ^= tmp; \ - r0 ^= tmp; \ - tmp = mixtab1((x3 >> 16) & 0xFF); \ - c3 ^= tmp; \ - r1 ^= tmp; \ - tmp = mixtab2((x3 >> 8) & 0xFF); \ - c3 ^= tmp; \ - r2 ^= tmp; \ - tmp = mixtab3(x3 & 0xFF); \ - c3 ^= tmp; \ - x0 = ((c0 ^ r0) & SPH_C32(0xFF000000)) \ - | ((c1 ^ r1) & SPH_C32(0x00FF0000)) \ - | ((c2 ^ r2) & SPH_C32(0x0000FF00)) \ - | ((c3 ^ r3) & SPH_C32(0x000000FF)); \ - x1 = ((c1 ^ (r0 << 8)) & SPH_C32(0xFF000000)) \ - | ((c2 ^ (r1 << 8)) & SPH_C32(0x00FF0000)) \ - | ((c3 ^ (r2 << 8)) & SPH_C32(0x0000FF00)) \ - | ((c0 ^ (r3 >> 24)) & SPH_C32(0x000000FF)); \ - x2 = ((c2 ^ (r0 << 16)) & SPH_C32(0xFF000000)) \ - | ((c3 ^ (r1 << 16)) & SPH_C32(0x00FF0000)) \ - | ((c0 ^ (r2 >> 16)) & SPH_C32(0x0000FF00)) \ - | ((c1 ^ (r3 >> 16)) & SPH_C32(0x000000FF)); \ - x3 = ((c3 ^ (r0 << 24)) & SPH_C32(0xFF000000)) \ - | ((c0 ^ (r1 >> 8)) & SPH_C32(0x00FF0000)) \ - | ((c1 ^ (r2 >> 8)) & SPH_C32(0x0000FF00)) \ - | ((c2 ^ (r3 >> 8)) & SPH_C32(0x000000FF)); \ - /* */ \ - } - -#define S00 (sc[ 0]) -#define S01 (sc[ 1]) -#define S02 (sc[ 2]) -#define S03 (sc[ 3]) -#define S04 (sc[ 4]) -#define S05 (sc[ 5]) -#define S06 (sc[ 6]) -#define S07 (sc[ 7]) -#define S08 (sc[ 8]) -#define S09 (sc[ 9]) -#define S10 (sc[10]) -#define S11 (sc[11]) -#define S12 (sc[12]) -#define S13 (sc[13]) -#define S14 (sc[14]) -#define S15 (sc[15]) -#define S16 (sc[16]) -#define S17 (sc[17]) -#define S18 (sc[18]) -#define S19 (sc[19]) -#define S20 (sc[20]) -#define S21 (sc[21]) -#define S22 (sc[22]) -#define S23 (sc[23]) -#define S24 (sc[24]) -#define S25 (sc[25]) -#define S26 (sc[26]) -#define S27 (sc[27]) -#define S28 (sc[28]) -#define S29 (sc[29]) -#define S30 (sc[30]) -#define S31 (sc[31]) -#define S32 (sc[32]) -#define S33 (sc[33]) -#define S34 (sc[34]) -#define S35 (sc[35]) - -#define SWAB32(x) ( ((x & 0x000000FF) << 24) | ((x & 0x0000FF00) << 8) | ((x & 0x00FF0000) >> 8) | ((x & 0xFF000000) >> 24) ) -/* GPU - FUNKTIONEN */ - -#if USE_SHARED -__global__ void __launch_bounds__(256) -#else -__global__ void -#endif -fugue256_gpu_hash(int thr_id, uint32_t threads, uint32_t startNounce, void *outputHash, uint32_t *resNounce) -{ -#if USE_SHARED - extern __shared__ char mixtabs[]; - - *((uint32_t*)mixtabs + ( threadIdx.x)) = tex1Dfetch(mixTab0Tex, threadIdx.x); - *((uint32_t*)mixtabs + (256+threadIdx.x)) = tex1Dfetch(mixTab1Tex, threadIdx.x); - *((uint32_t*)mixtabs + (512+threadIdx.x)) = tex1Dfetch(mixTab2Tex, threadIdx.x); - *((uint32_t*)mixtabs + (768+threadIdx.x)) = tex1Dfetch(mixTab3Tex, threadIdx.x); - - __syncthreads(); -#endif - - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - /* Nimm den State und verarbeite das letztenByte (die Nounce) */ - uint32_t sc[30]; - - #pragma unroll 30 - for(int i=0;i<30;i++) - sc[i] = GPUstate[i]; - - uint32_t nounce = startNounce + thread; // muss noch ermittelt werden - uint32_t q; - - - // Bei Byte 80 laufen die Teilrunden: 4-0-1 (hier fest) - - // Teilrunde 4 - q = nounce; - TIX2(q, S06, S07, S14, S16, S00); - CMIX30(S03, S04, S05, S07, S08, S09, S18, S19, S20); - SMIX(S03, S04, S05, S06); - CMIX30(S00, S01, S02, S04, S05, S06, S15, S16, S17); - SMIX(S00, S01, S02, S03); - - // Teilrunde 0 - q = 0; - TIX2(q, S00, S01, S08, S10, S24); - CMIX30(S27, S28, S29, S01, S02, S03, S12, S13, S14); - SMIX(S27, S28, S29, S00); - CMIX30(S24, S25, S26, S28, S29, S00, S09, S10, S11); - SMIX(S24, S25, S26, S27); - - // Teilrunde 1 - q = 0x280; // hoffentlich richtig rum... - TIX2(q, S24, S25, S02, S04, S18); - CMIX30(S21, S22, S23, S25, S26, S27, S06, S07, S08); - SMIX(S21, S22, S23, S24); - CMIX30(S18, S19, S20, S22, S23, S24, S03, S04, S05); - SMIX(S18, S19, S20, S21); - - // Rundenende - // rms = 12, d.h. 30 - 12 = 18 - - #pragma unroll 10 - for(int i=0;i<10;i++) - { - //ROR(3, 30); - uint32_t tmp[3]; - #pragma unroll 3 - for(int k=0;k<3;k++) - tmp[k] = sc[27+k]; - #pragma unroll 27 - for(int k=26;k>=0;k--) - sc[k+3] = sc[k]; - #pragma unroll 3 - for(int k=0;k<3;k++) - sc[k] = tmp[k]; - - - CMIX30(sc[18], sc[19], sc[20], sc[22], sc[23], sc[24], sc[3], sc[4], sc[5]); - SMIX(sc[18], sc[19], sc[20], sc[21]); - } - - #pragma unroll 13 - for(int i=0;i<13;i++) - { - sc[22] ^= sc[18]; - sc[3] ^= sc[18]; - - // ROR(15, 30); BEGIN - uint32_t tmp1[15]; - #pragma unroll 15 - for(int k=0;k<15;k++) - tmp1[k] = sc[15+k]; - #pragma unroll 15 - for(int k=14;k>=0;k--) - sc[k+15] = sc[k]; - #pragma unroll 15 - for(int k=0;k<15;k++) - sc[k] = tmp1[k]; - // ROR(15, 30); END - - SMIX(sc[18], sc[19], sc[20], sc[21]); - sc[22] ^= sc[18]; - sc[4] ^= sc[18]; - - // ROR(14, 30); BEGIN - uint32_t tmp2[14]; - #pragma unroll 14 - for(int k=0;k<14;k++) - tmp2[k] = sc[16+k]; - #pragma unroll 16 - for(int k=15;k>=0;k--) - sc[k+14] = sc[k]; - #pragma unroll 14 - for(int k=0;k<14;k++) - sc[k] = tmp2[k]; - // ROR(14, 30); END - - SMIX(sc[18], sc[19], sc[20], sc[21]); - } - - sc[22] ^= sc[18]; - sc[3] ^= sc[18]; - - /* - // SWAP32 und Daten ausgeben - #pragma unroll 4 - for(int i=0;i<4;i++) - ((uint32_t*)outputHash)[8*thread+i] = SWAB32(sc[19+i]); - - #pragma unroll 4 - for(int i=0;i<4;i++) - ((uint32_t*)outputHash)[8*thread+i+4] = SWAB32(sc[3+i]); - */ - uint32_t hash[8]; - #pragma unroll 4 - for(int i=0;i<4;i++) - ((uint32_t*)hash)[i] = SWAB32(sc[19+i]); - - #pragma unroll 4 - for(int i=0;i<4;i++) - ((uint32_t*)hash)[i+4] = SWAB32(sc[3+i]); - - int i; - bool rc = true; - - for (i = 7; i >= 0; i--) { - if (hash[i] > pTarget[i]) { - rc = false; - break; - } - if (hash[i] < pTarget[i]) { - rc = true; - break; - } - } - - if(rc == true) - { - if(resNounce[0] > nounce) - resNounce[0] = nounce; - } - } -} - -#define texDef(id, texname, texmem, texsource, texsize) { \ - unsigned int *texmem; \ - cudaMalloc(&texmem, texsize); \ - d_textures[thr_id][id] = texmem; \ - cudaMemcpy(texmem, texsource, texsize, cudaMemcpyHostToDevice); \ - texname.normalized = 0; \ - texname.filterMode = cudaFilterModePoint; \ - texname.addressMode[0] = cudaAddressModeClamp; \ - { cudaChannelFormatDesc channelDesc = cudaCreateChannelDesc(); \ - cudaBindTexture(NULL, &texname, texmem, &channelDesc, texsize ); \ - } \ -} - -__host__ -void fugue256_cpu_init(int thr_id, uint32_t threads) -{ - // Link the hash tables in the GPU - texDef(0, mixTab0Tex, mixTab0m, mixtab0_cpu, sizeof(uint32_t)*256); - texDef(1, mixTab1Tex, mixTab1m, mixtab1_cpu, sizeof(uint32_t)*256); - texDef(2, mixTab2Tex, mixTab2m, mixtab2_cpu, sizeof(uint32_t)*256); - texDef(3, mixTab3Tex, mixTab3m, mixtab3_cpu, sizeof(uint32_t)*256); - - CUDA_SAFE_CALL(cudaMalloc(&d_fugue256_hashoutput[thr_id], (size_t) 32 * threads)); - cudaMalloc(&d_resultNonce[thr_id], sizeof(uint32_t)); -} - -__host__ -void fugue256_cpu_free(int thr_id) -{ - cudaFree(d_fugue256_hashoutput[thr_id]); - cudaFree(d_resultNonce[thr_id]); - - for (int i=0; i<4; i++) - cudaFree(d_textures[thr_id][i]); -} - -__host__ -void fugue256_cpu_setBlock(int thr_id, void *data, void *pTargetIn) -{ - sph_fugue256_context ctx_fugue_const; - sph_fugue256_init(&ctx_fugue_const); - sph_fugue256 (&ctx_fugue_const, data, 80); - cudaMemcpyToSymbol(GPUstate, ctx_fugue_const.S, sizeof(uint32_t) * 30); - - cudaMemcpyToSymbol(pTarget, pTargetIn, 32); - - cudaMemset(d_resultNonce[thr_id], 0xFF, sizeof(uint32_t)); -} - -__host__ -void fugue256_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce, void *outputHashes, uint32_t *nounce) -{ -#if USE_SHARED - const uint32_t threadsperblock = 256; // Alignment mit mixtab Grösse. NICHT ÄNDERN -#else - const uint32_t threadsperblock = 512; // so einstellen wie gewünscht ;-) -#endif - // berechne wie viele Thread Blocks wir brauchen - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - // Größe des dynamischen Shared Memory Bereichs -#if USE_SHARED - size_t shared_size = 4 * 256 * sizeof(uint32_t); -#else - size_t shared_size = 0; -#endif - fugue256_gpu_hash<<>>(thr_id, threads, startNounce, d_fugue256_hashoutput[thr_id], d_resultNonce[thr_id]); - - // Strategisches Sleep Kommando zur Senkung der CPU Last - MyStreamSynchronize(NULL, 0, thr_id); - - //cudaMemcpy(outputHashes, d_fugue256_hashoutput[thr_id], 8 * sizeof(uint32_t), cudaMemcpyDeviceToHost); - cudaMemcpy(nounce, d_resultNonce[thr_id], sizeof(uint32_t), cudaMemcpyDeviceToHost); -} diff --git a/Algo256/cuda_groestl256.cu b/Algo256/cuda_groestl256.cu deleted file mode 100644 index 5d796e2f..00000000 --- a/Algo256/cuda_groestl256.cu +++ /dev/null @@ -1,335 +0,0 @@ -#include - -#define SPH_C32(x) ((uint32_t)(x ## U)) -#define SPH_T32(x) ((x) & SPH_C32(0xFFFFFFFF)) - -#include "cuda_helper.h" - -static uint32_t *h_GNonces[MAX_GPUS]; -static uint32_t *d_GNonces[MAX_GPUS]; -static unsigned int* d_textures[MAX_GPUS][8]; - -__constant__ uint32_t pTarget[8]; - -#define C32e(x) \ - ((SPH_C32(x) >> 24) \ - | ((SPH_C32(x) >> 8) & SPH_C32(0x0000FF00)) \ - | ((SPH_C32(x) << 8) & SPH_C32(0x00FF0000)) \ - | ((SPH_C32(x) << 24) & SPH_C32(0xFF000000))) - -#define PC32up(j, r) ((uint32_t)((j) + (r))) -#define PC32dn(j, r) 0 -#define QC32up(j, r) 0xFFFFFFFF -#define QC32dn(j, r) (((uint32_t)(r) << 24) ^ SPH_T32(~((uint32_t)(j) << 24))) - -#define B32_0(x) __byte_perm(x, 0, 0x4440) -//((x) & 0xFF) -#define B32_1(x) __byte_perm(x, 0, 0x4441) -//(((x) >> 8) & 0xFF) -#define B32_2(x) __byte_perm(x, 0, 0x4442) -//(((x) >> 16) & 0xFF) -#define B32_3(x) __byte_perm(x, 0, 0x4443) -//((x) >> 24) - -#define MAXWELL_OR_FERMI 1 -#if MAXWELL_OR_FERMI - #define USE_SHARED 1 - // Maxwell and Fermi cards get the best speed with SHARED access it seems. - #if USE_SHARED - #define T0up(x) (*((uint32_t*)mixtabs + ( (x)))) - #define T0dn(x) (*((uint32_t*)mixtabs + (256+(x)))) - #define T1up(x) (*((uint32_t*)mixtabs + (512+(x)))) - #define T1dn(x) (*((uint32_t*)mixtabs + (768+(x)))) - #define T2up(x) (*((uint32_t*)mixtabs + (1024+(x)))) - #define T2dn(x) (*((uint32_t*)mixtabs + (1280+(x)))) - #define T3up(x) (*((uint32_t*)mixtabs + (1536+(x)))) - #define T3dn(x) (*((uint32_t*)mixtabs + (1792+(x)))) - #else - #define T0up(x) tex1Dfetch(t0up2, x) - #define T0dn(x) tex1Dfetch(t0dn2, x) - #define T1up(x) tex1Dfetch(t1up2, x) - #define T1dn(x) tex1Dfetch(t1dn2, x) - #define T2up(x) tex1Dfetch(t2up2, x) - #define T2dn(x) tex1Dfetch(t2dn2, x) - #define T3up(x) tex1Dfetch(t3up2, x) - #define T3dn(x) tex1Dfetch(t3dn2, x) - #endif -#else - #define USE_SHARED 1 - // a healthy mix between shared and textured access provides the highest speed on Compute 3.0 and 3.5! - #define T0up(x) (*((uint32_t*)mixtabs + ( (x)))) - #define T0dn(x) tex1Dfetch(t0dn2, x) - #define T1up(x) tex1Dfetch(t1up2, x) - #define T1dn(x) (*((uint32_t*)mixtabs + (768+(x)))) - #define T2up(x) tex1Dfetch(t2up2, x) - #define T2dn(x) (*((uint32_t*)mixtabs + (1280+(x)))) - #define T3up(x) (*((uint32_t*)mixtabs + (1536+(x)))) - #define T3dn(x) tex1Dfetch(t3dn2, x) -#endif - -static texture t0up2; -static texture t0dn2; -static texture t1up2; -static texture t1dn2; -static texture t2up2; -static texture t2dn2; -static texture t3up2; -static texture t3dn2; - -#define RSTT(d0, d1, a, b0, b1, b2, b3, b4, b5, b6, b7) do { \ - t[d0] = T0up(B32_0(a[b0])) \ - ^ T1up(B32_1(a[b1])) \ - ^ T2up(B32_2(a[b2])) \ - ^ T3up(B32_3(a[b3])) \ - ^ T0dn(B32_0(a[b4])) \ - ^ T1dn(B32_1(a[b5])) \ - ^ T2dn(B32_2(a[b6])) \ - ^ T3dn(B32_3(a[b7])); \ - t[d1] = T0dn(B32_0(a[b0])) \ - ^ T1dn(B32_1(a[b1])) \ - ^ T2dn(B32_2(a[b2])) \ - ^ T3dn(B32_3(a[b3])) \ - ^ T0up(B32_0(a[b4])) \ - ^ T1up(B32_1(a[b5])) \ - ^ T2up(B32_2(a[b6])) \ - ^ T3up(B32_3(a[b7])); \ - } while (0) - - -extern uint32_t T0up_cpu[]; -extern uint32_t T0dn_cpu[]; -extern uint32_t T1up_cpu[]; -extern uint32_t T1dn_cpu[]; -extern uint32_t T2up_cpu[]; -extern uint32_t T2dn_cpu[]; -extern uint32_t T3up_cpu[]; -extern uint32_t T3dn_cpu[]; - -__device__ __forceinline__ -void groestl256_perm_P(uint32_t thread,uint32_t *a, char *mixtabs) -{ - #pragma unroll 10 - for (int r = 0; r<10; r++) - { - uint32_t t[16]; - - a[0x0] ^= PC32up(0x00, r); - a[0x2] ^= PC32up(0x10, r); - a[0x4] ^= PC32up(0x20, r); - a[0x6] ^= PC32up(0x30, r); - a[0x8] ^= PC32up(0x40, r); - a[0xA] ^= PC32up(0x50, r); - a[0xC] ^= PC32up(0x60, r); - a[0xE] ^= PC32up(0x70, r); - RSTT(0x0, 0x1, a, 0x0, 0x2, 0x4, 0x6, 0x9, 0xB, 0xD, 0xF); - RSTT(0x2, 0x3, a, 0x2, 0x4, 0x6, 0x8, 0xB, 0xD, 0xF, 0x1); - RSTT(0x4, 0x5, a, 0x4, 0x6, 0x8, 0xA, 0xD, 0xF, 0x1, 0x3); - RSTT(0x6, 0x7, a, 0x6, 0x8, 0xA, 0xC, 0xF, 0x1, 0x3, 0x5); - RSTT(0x8, 0x9, a, 0x8, 0xA, 0xC, 0xE, 0x1, 0x3, 0x5, 0x7); - RSTT(0xA, 0xB, a, 0xA, 0xC, 0xE, 0x0, 0x3, 0x5, 0x7, 0x9); - RSTT(0xC, 0xD, a, 0xC, 0xE, 0x0, 0x2, 0x5, 0x7, 0x9, 0xB); - RSTT(0xE, 0xF, a, 0xE, 0x0, 0x2, 0x4, 0x7, 0x9, 0xB, 0xD); - - #pragma unroll 16 - for (int k = 0; k<16; k++) - a[k] = t[k]; - } -} - -__device__ __forceinline__ -void groestl256_perm_Q(uint32_t thread, uint32_t *a, char *mixtabs) -{ - #pragma unroll - for (int r = 0; r<10; r++) - { - uint32_t t[16]; - - a[0x0] ^= QC32up(0x00, r); - a[0x1] ^= QC32dn(0x00, r); - a[0x2] ^= QC32up(0x10, r); - a[0x3] ^= QC32dn(0x10, r); - a[0x4] ^= QC32up(0x20, r); - a[0x5] ^= QC32dn(0x20, r); - a[0x6] ^= QC32up(0x30, r); - a[0x7] ^= QC32dn(0x30, r); - a[0x8] ^= QC32up(0x40, r); - a[0x9] ^= QC32dn(0x40, r); - a[0xA] ^= QC32up(0x50, r); - a[0xB] ^= QC32dn(0x50, r); - a[0xC] ^= QC32up(0x60, r); - a[0xD] ^= QC32dn(0x60, r); - a[0xE] ^= QC32up(0x70, r); - a[0xF] ^= QC32dn(0x70, r); - RSTT(0x0, 0x1, a, 0x2, 0x6, 0xA, 0xE, 0x1, 0x5, 0x9, 0xD); - RSTT(0x2, 0x3, a, 0x4, 0x8, 0xC, 0x0, 0x3, 0x7, 0xB, 0xF); - RSTT(0x4, 0x5, a, 0x6, 0xA, 0xE, 0x2, 0x5, 0x9, 0xD, 0x1); - RSTT(0x6, 0x7, a, 0x8, 0xC, 0x0, 0x4, 0x7, 0xB, 0xF, 0x3); - RSTT(0x8, 0x9, a, 0xA, 0xE, 0x2, 0x6, 0x9, 0xD, 0x1, 0x5); - RSTT(0xA, 0xB, a, 0xC, 0x0, 0x4, 0x8, 0xB, 0xF, 0x3, 0x7); - RSTT(0xC, 0xD, a, 0xE, 0x2, 0x6, 0xA, 0xD, 0x1, 0x5, 0x9); - RSTT(0xE, 0xF, a, 0x0, 0x4, 0x8, 0xC, 0xF, 0x3, 0x7, 0xB); - - #pragma unroll - for (int k = 0; k<16; k++) - a[k] = t[k]; - } -} - -__global__ __launch_bounds__(256,1) -void groestl256_gpu_hash_32(uint32_t threads, uint32_t startNounce, uint64_t *outputHash, uint32_t *resNonces) -{ -#if USE_SHARED - extern __shared__ char mixtabs[]; - - if (threadIdx.x < 256) { - *((uint32_t*)mixtabs + (threadIdx.x)) = tex1Dfetch(t0up2, threadIdx.x); - *((uint32_t*)mixtabs + (256 + threadIdx.x)) = tex1Dfetch(t0dn2, threadIdx.x); - *((uint32_t*)mixtabs + (512 + threadIdx.x)) = tex1Dfetch(t1up2, threadIdx.x); - *((uint32_t*)mixtabs + (768 + threadIdx.x)) = tex1Dfetch(t1dn2, threadIdx.x); - *((uint32_t*)mixtabs + (1024 + threadIdx.x)) = tex1Dfetch(t2up2, threadIdx.x); - *((uint32_t*)mixtabs + (1280 + threadIdx.x)) = tex1Dfetch(t2dn2, threadIdx.x); - *((uint32_t*)mixtabs + (1536 + threadIdx.x)) = tex1Dfetch(t3up2, threadIdx.x); - *((uint32_t*)mixtabs + (1792 + threadIdx.x)) = tex1Dfetch(t3dn2, threadIdx.x); - } - - __syncthreads(); -#endif - - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - // GROESTL - uint32_t message[16]; - uint32_t state[16]; - - #pragma unroll - for (int k = 0; k<4; k++) - LOHI(message[2*k], message[2*k+1], outputHash[k*threads+thread]); - - #pragma unroll - for (int k = 9; k<15; k++) - message[k] = 0; - - message[8] = 0x80; - message[15] = 0x01000000; - - #pragma unroll 16 - for (int u = 0; u<16; u++) - state[u] = message[u]; - - state[15] ^= 0x10000; - - // Perm - -#if USE_SHARED - groestl256_perm_P(thread, state, mixtabs); - state[15] ^= 0x10000; - groestl256_perm_Q(thread, message, mixtabs); -#else - groestl256_perm_P(thread, state, NULL); - state[15] ^= 0x10000; - groestl256_perm_P(thread, message, NULL); -#endif - #pragma unroll 16 - for (int u = 0; u<16; u++) state[u] ^= message[u]; - #pragma unroll 16 - for (int u = 0; u<16; u++) message[u] = state[u]; -#if USE_SHARED - groestl256_perm_P(thread, message, mixtabs); -#else - groestl256_perm_P(thread, message, NULL); -#endif - state[14] ^= message[14]; - state[15] ^= message[15]; - - uint32_t nonce = startNounce + thread; - if (state[15] <= pTarget[7]) { - atomicMin(&resNonces[1], resNonces[0]); - atomicMin(&resNonces[0], nonce); - } - } -} - -#define texDef(id, texname, texmem, texsource, texsize) { \ - unsigned int *texmem; \ - cudaMalloc(&texmem, texsize); \ - d_textures[thr_id][id] = texmem; \ - cudaMemcpy(texmem, texsource, texsize, cudaMemcpyHostToDevice); \ - texname.normalized = 0; \ - texname.filterMode = cudaFilterModePoint; \ - texname.addressMode[0] = cudaAddressModeClamp; \ - { cudaChannelFormatDesc channelDesc = cudaCreateChannelDesc(); \ - cudaBindTexture(NULL, &texname, texmem, &channelDesc, texsize ); \ - } \ -} - -__host__ -void groestl256_cpu_init(int thr_id, uint32_t threads) -{ - // Texturen mit obigem Makro initialisieren - texDef(0, t0up2, d_T0up, T0up_cpu, sizeof(uint32_t) * 256); - texDef(1, t0dn2, d_T0dn, T0dn_cpu, sizeof(uint32_t) * 256); - texDef(2, t1up2, d_T1up, T1up_cpu, sizeof(uint32_t) * 256); - texDef(3, t1dn2, d_T1dn, T1dn_cpu, sizeof(uint32_t) * 256); - texDef(4, t2up2, d_T2up, T2up_cpu, sizeof(uint32_t) * 256); - texDef(5, t2dn2, d_T2dn, T2dn_cpu, sizeof(uint32_t) * 256); - texDef(6, t3up2, d_T3up, T3up_cpu, sizeof(uint32_t) * 256); - texDef(7, t3dn2, d_T3dn, T3dn_cpu, sizeof(uint32_t) * 256); - - cudaMalloc(&d_GNonces[thr_id], 2*sizeof(uint32_t)); - cudaMallocHost(&h_GNonces[thr_id], 2*sizeof(uint32_t)); -} - -__host__ -void groestl256_cpu_free(int thr_id) -{ - for (int i=0; i<8; i++) - cudaFree(d_textures[thr_id][i]); - - cudaFree(d_GNonces[thr_id]); - cudaFreeHost(h_GNonces[thr_id]); -} - -__host__ -uint32_t groestl256_cpu_hash_32(int thr_id, uint32_t threads, uint32_t startNounce, uint64_t *d_outputHash, int order) -{ - uint32_t result = UINT32_MAX; - cudaMemset(d_GNonces[thr_id], 0xff, 2*sizeof(uint32_t)); - const uint32_t threadsperblock = 256; - - // berechne wie viele Thread Blocks wir brauchen - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - -#if USE_SHARED - size_t shared_size = 8 * 256 * sizeof(uint32_t); -#else - size_t shared_size = 0; -#endif - groestl256_gpu_hash_32<<>>(threads, startNounce, d_outputHash, d_GNonces[thr_id]); - - MyStreamSynchronize(NULL, order, thr_id); - - // get first found nonce - cudaMemcpy(h_GNonces[thr_id], d_GNonces[thr_id], 1*sizeof(uint32_t), cudaMemcpyDeviceToHost); - result = *h_GNonces[thr_id]; - - return result; -} - -__host__ -uint32_t groestl256_getSecNonce(int thr_id, int num) -{ - uint32_t results[2]; - memset(results, 0xFF, sizeof(results)); - cudaMemcpy(results, d_GNonces[thr_id], sizeof(results), cudaMemcpyDeviceToHost); - if (results[1] == results[0]) - return UINT32_MAX; - return results[num]; -} - -__host__ -void groestl256_setTarget(const void *pTargetIn) -{ - cudaMemcpyToSymbol(pTarget, pTargetIn, 32, 0, cudaMemcpyHostToDevice); -} diff --git a/Algo256/cuda_skein256.cu b/Algo256/cuda_skein256.cu deleted file mode 100644 index cbeb660e..00000000 --- a/Algo256/cuda_skein256.cu +++ /dev/null @@ -1,313 +0,0 @@ -#include - -#include "cuda_helper.h" - -static __forceinline__ __device__ -void Round512v35(uint2 &p0, uint2 &p1, uint2 &p2, uint2 &p3, uint2 &p4, uint2 &p5, uint2 &p6, uint2 &p7, - const int ROT0, const int ROT1, const int ROT2, const int ROT3) -{ - p0 += p1; p1 = ROL2(p1, ROT0) ^ p0; - p2 += p3; p3 = ROL2(p3, ROT1) ^ p2; - p4 += p5; p5 = ROL2(p5, ROT2) ^ p4; - p6 += p7; p7 = ROL2(p7, ROT3) ^ p6; -} - -__forceinline__ __device__ -void Round_8_512v35(const uint2 *const __restrict__ ks, const uint2 *const __restrict__ ts, - uint2 &p0, uint2 &p1, uint2 &p2, uint2 &p3, uint2 &p4, uint2 &p5, uint2 &p6, uint2 &p7, int R) -{ - Round512v35(p0, p1, p2, p3, p4, p5, p6, p7, 46, 36, 19, 37); - Round512v35(p2, p1, p4, p7, p6, p5, p0, p3, 33, 27, 14, 42); - Round512v35(p4, p1, p6, p3, p0, p5, p2, p7, 17, 49, 36, 39); - Round512v35(p6, p1, p0, p7, p2, p5, p4, p3, 44, 9, 54, 56); - - p0 += ks[(R+0) % 9]; - p1 += ks[(R+1) % 9]; - p2 += ks[(R+2) % 9]; - p3 += ks[(R+3) % 9]; - p4 += ks[(R+4) % 9]; - p5 += ks[(R+5) % 9] + ts[(R+0) % 3]; - p6 += ks[(R+6) % 9] + ts[(R+1) % 3]; - p7 += ks[(R+7) % 9] + make_uint2(R, 0); - - Round512v35(p0, p1, p2, p3, p4, p5, p6, p7, 39, 30, 34, 24); - Round512v35(p2, p1, p4, p7, p6, p5, p0, p3, 13, 50, 10, 17); - Round512v35(p4, p1, p6, p3, p0, p5, p2, p7, 25, 29, 39, 43); - Round512v35(p6, p1, p0, p7, p2, p5, p4, p3, 8, 35, 56, 22); - - p0 += ks[(R+1) % 9]; - p1 += ks[(R+2) % 9]; - p2 += ks[(R+3) % 9]; - p3 += ks[(R+4) % 9]; - p4 += ks[(R+5) % 9]; - p5 += ks[(R+6) % 9] + ts[(R+1) % 3]; - p6 += ks[(R+7) % 9] + ts[(R+2) % 3]; - p7 += ks[(R+8) % 9] + make_uint2(R+1, 0); -} - -__forceinline__ __device__ -void Round_8_512v35_final(const uint2 *const __restrict__ ks, const uint2 *const __restrict__ ts, - uint2 &p0, uint2 &p1, uint2 &p2, uint2 &p3, uint2 &p4, uint2 &p5, uint2 &p6, uint2 &p7) -{ - Round512v35(p0, p1, p2, p3, p4, p5, p6, p7, 46, 36, 19, 37); - Round512v35(p2, p1, p4, p7, p6, p5, p0, p3, 33, 27, 14, 42); - Round512v35(p4, p1, p6, p3, p0, p5, p2, p7, 17, 49, 36, 39); - Round512v35(p6, p1, p0, p7, p2, p5, p4, p3, 44, 9, 54, 56); - - p0 += ks[8]; - p1 += ks[0]; - p2 += ks[1]; - p3 += ks[2]; - p4 += ks[3]; - p5 += ks[4] + ts[2]; - p6 += ks[5] + ts[0]; - p7 += ks[6] + make_uint2(17, 0); - - Round512v35(p0, p1, p2, p3, p4, p5, p6, p7, 39, 30, 34, 24); - Round512v35(p2, p1, p4, p7, p6, p5, p0, p3, 13, 50, 10, 17); - Round512v35(p4, p1, p6, p3, p0, p5, p2, p7, 25, 29, 39, 43); - Round512v35(p6, p1, p0, p7, p2, p5, p4, p3, 8, 35, 56, 22); - - p0 += ks[0]; - p1 += ks[1]; - p2 += ks[2]; - p3 += ks[3]; -} - -__global__ __launch_bounds__(256,3) -void skein256_gpu_hash_32(uint32_t threads, uint32_t startNounce, uint64_t *outputHash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - - if (thread < threads) - { - const uint2 skein_ks_parity = { 0xA9FC1A22, 0x1BD11BDA }; - const uint2 t12[6] = { - { 0x20, 0 }, - { 0, 0xf0000000 }, - { 0x20, 0xf0000000 }, - { 0x08, 0 }, - { 0, 0xff000000 }, - { 0x08, 0xff000000 } - }; - - uint2 h[9] = { - { 0x2FDB3E13, 0xCCD044A1 }, - { 0x1A79A9EB, 0xE8359030 }, - { 0x4F816E6F, 0x55AEA061 }, - { 0xAE9B94DB, 0x2A2767A4 }, - { 0x74DD7683, 0xEC06025E }, - { 0xC4746251, 0xE7A436CD }, - { 0x393AD185, 0xC36FBAF9 }, - { 0x33EDFC13, 0x3EEDBA18 }, - { 0xC73A4E2A, 0xB69D3CFC } - }; - uint2 dt0,dt1,dt2,dt3; - uint2 p0, p1, p2, p3, p4, p5, p6, p7; - - LOHI(dt0.x,dt0.y,outputHash[thread]); - LOHI(dt1.x,dt1.y,outputHash[threads+thread]); - LOHI(dt2.x,dt2.y,outputHash[2*threads+thread]); - LOHI(dt3.x,dt3.y,outputHash[3*threads+thread]); - - p0 = h[0] + dt0; - p1 = h[1] + dt1; - p2 = h[2] + dt2; - p3 = h[3] + dt3; - p4 = h[4]; - p5 = h[5] + t12[0]; - p6 = h[6] + t12[1]; - p7 = h[7]; - - // forced unroll required - Round_8_512v35(h, t12, p0, p1, p2, p3, p4, p5, p6, p7, 1); - Round_8_512v35(h, t12, p0, p1, p2, p3, p4, p5, p6, p7, 3); - Round_8_512v35(h, t12, p0, p1, p2, p3, p4, p5, p6, p7, 5); - Round_8_512v35(h, t12, p0, p1, p2, p3, p4, p5, p6, p7, 7); - Round_8_512v35(h, t12, p0, p1, p2, p3, p4, p5, p6, p7, 9); - Round_8_512v35(h, t12, p0, p1, p2, p3, p4, p5, p6, p7, 11); - Round_8_512v35(h, t12, p0, p1, p2, p3, p4, p5, p6, p7, 13); - Round_8_512v35(h, t12, p0, p1, p2, p3, p4, p5, p6, p7, 15); - Round_8_512v35(h, t12, p0, p1, p2, p3, p4, p5, p6, p7, 17); - - p0 ^= dt0; - p1 ^= dt1; - p2 ^= dt2; - p3 ^= dt3; - - h[0] = p0; - h[1] = p1; - h[2] = p2; - h[3] = p3; - h[4] = p4; - h[5] = p5; - h[6] = p6; - h[7] = p7; - h[8] = skein_ks_parity ^ h[0] ^ h[1] ^ h[2] ^ h[3] ^ h[4] ^ h[5] ^ h[6] ^ h[7]; - - const uint2 *t = t12+3; - p5 += t12[3]; //p5 already equal h[5] - p6 += t12[4]; - - // forced unroll - Round_8_512v35(h, t, p0, p1, p2, p3, p4, p5, p6, p7, 1); - Round_8_512v35(h, t, p0, p1, p2, p3, p4, p5, p6, p7, 3); - Round_8_512v35(h, t, p0, p1, p2, p3, p4, p5, p6, p7, 5); - Round_8_512v35(h, t, p0, p1, p2, p3, p4, p5, p6, p7, 7); - Round_8_512v35(h, t, p0, p1, p2, p3, p4, p5, p6, p7, 9); - Round_8_512v35(h, t, p0, p1, p2, p3, p4, p5, p6, p7, 11); - Round_8_512v35(h, t, p0, p1, p2, p3, p4, p5, p6, p7, 13); - Round_8_512v35(h, t, p0, p1, p2, p3, p4, p5, p6, p7, 15); - Round_8_512v35_final(h, t, p0, p1, p2, p3, p4, p5, p6, p7); - - outputHash[thread] = devectorize(p0); - outputHash[threads+thread] = devectorize(p1); - outputHash[2*threads+thread] = devectorize(p2); - outputHash[3*threads+thread] = devectorize(p3); - } -} - -static __forceinline__ __device__ -void Round512v30(uint64_t &p0, uint64_t &p1, uint64_t &p2, uint64_t &p3, - uint64_t &p4, uint64_t &p5, uint64_t &p6, uint64_t &p7, - const int ROT0, const int ROT1, const int ROT2, const int ROT3) -{ - p0 += p1; p1 = ROTL64(p1, ROT0) ^ p0; - p2 += p3; p3 = ROTL64(p3, ROT1) ^ p2; - p4 += p5; p5 = ROTL64(p5, ROT2) ^ p4; - p6 += p7; p7 = ROTL64(p7, ROT3) ^ p6; -} - -static __forceinline__ __device__ -void Round_8_512v30(uint64_t *ks, uint64_t *ts, - uint64_t &p0, uint64_t &p1, uint64_t &p2, uint64_t &p3, - uint64_t &p4, uint64_t &p5, uint64_t &p6, uint64_t &p7, int R) -{ - Round512v30(p0, p1, p2, p3, p4, p5, p6, p7, 46, 36, 19, 37); - Round512v30(p2, p1, p4, p7, p6, p5, p0, p3, 33, 27, 14, 42); - Round512v30(p4, p1, p6, p3, p0, p5, p2, p7, 17, 49, 36, 39); - Round512v30(p6, p1, p0, p7, p2, p5, p4, p3, 44, 9, 54, 56); - - p0 += ks[(R+0) % 9]; - p1 += ks[(R+1) % 9]; - p2 += ks[(R+2) % 9]; - p3 += ks[(R+3) % 9]; - p4 += ks[(R+4) % 9]; - p5 += ks[(R+5) % 9] + ts[(R+0) % 3]; - p6 += ks[(R+6) % 9] + ts[(R+1) % 3]; - p7 += ks[(R+7) % 9] + R; - - Round512v30(p0, p1, p2, p3, p4, p5, p6, p7, 39, 30, 34, 24); - Round512v30(p2, p1, p4, p7, p6, p5, p0, p3, 13, 50, 10, 17); - Round512v30(p4, p1, p6, p3, p0, p5, p2, p7, 25, 29, 39, 43); - Round512v30(p6, p1, p0, p7, p2, p5, p4, p3, 8, 35, 56, 22); - - p0 += ks[(R+1) % 9]; - p1 += ks[(R+2) % 9]; - p2 += ks[(R+3) % 9]; - p3 += ks[(R+4) % 9]; - p4 += ks[(R+5) % 9]; - p5 += ks[(R+6) % 9] + ts[(R+1) % 3]; - p6 += ks[(R+7) % 9] + ts[(R+2) % 3]; - p7 += ks[(R+8) % 9] + R+1; -} - -#define skein_ks_parity64 0x1BD11BDAA9FC1A22ull -#include -__global__ __launch_bounds__(256, 3) -void skein256_gpu_hash_32_v30(uint32_t threads, uint32_t startNounce, uint64_t *outputHash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint64_t h[12] = { // SKEIN_IV512_256 - 0xCCD044A12FDB3E13, 0xE83590301A79A9EB, - 0x55AEA0614F816E6F, 0x2A2767A4AE9B94DB, - 0xEC06025E74DD7683, 0xE7A436CDC4746251, - 0xC36FBAF9393AD185, 0x3EEDBA1833EDFC13, - 0xb69d3cfcc73a4e2a, // skein_ks_parity64 ^ h[0..7] - 0x20, 0xf000000000000000, 0xf000000000000020 // t0..2 - }; - uint64_t dt0 = outputHash[thread]; - uint64_t dt1 = outputHash[threads + thread]; - uint64_t dt2 = outputHash[threads*2 + thread]; - uint64_t dt3 = outputHash[threads*3 + thread]; - - uint64_t *t = &h[9]; - uint64_t p0 = h[0] + dt0; - uint64_t p1 = h[1] + dt1; - uint64_t p2 = h[2] + dt2; - uint64_t p3 = h[3] + dt3; - uint64_t p4 = h[4]; - uint64_t p5 = h[5] + t[0]; - uint64_t p6 = h[6] + t[1]; - uint64_t p7 = h[7]; - - #pragma unroll 9 - for (int i = 1; i<19; i += 2) { - Round_8_512v30(h, t, p0, p1, p2, p3, p4, p5, p6, p7, i); - } - - p0 ^= dt0; - p1 ^= dt1; - p2 ^= dt2; - p3 ^= dt3; - - h[0] = p0; - h[1] = p1; - h[2] = p2; - h[3] = p3; - h[4] = p4; - h[5] = p5; - h[6] = p6; - h[7] = p7; - h[8] = skein_ks_parity64; - - #pragma unroll 8 - for (int i = 0; i<8; i++) { - h[8] ^= h[i]; - } - - t[0] = 0x08; - t[1] = 0xff00000000000000; - t[2] = 0xff00000000000008; - - p5 += t[0]; //p5 already equal h[5] - p6 += t[1]; - - #pragma unroll 9 - for (int i = 1; i<19; i += 2) { - Round_8_512v30(h, t, p0, p1, p2, p3, p4, p5, p6, p7, i); - } - - outputHash[thread] = p0; - outputHash[threads + thread] = p1; - outputHash[threads*2 + thread] = p2; - outputHash[threads*3 + thread] = p3; - } //thread -} - -__host__ -void skein256_cpu_init(int thr_id, uint32_t threads) -{ - cuda_get_arch(thr_id); -} - -__host__ -void skein256_cpu_hash_32(int thr_id, uint32_t threads, uint32_t startNounce, uint64_t *d_outputHash, int order) -{ - const uint32_t threadsperblock = 256; - int dev_id = device_map[thr_id]; - - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - - // only 1kH/s perf change between kernels on a 960... - if (device_sm[dev_id] > 300 && cuda_arch[dev_id] > 300) - skein256_gpu_hash_32<<>>(threads, startNounce, d_outputHash); - else - skein256_gpu_hash_32_v30<<>>(threads, startNounce, d_outputHash); - - MyStreamSynchronize(NULL, order, thr_id); -} - diff --git a/Algo256/decred.cu b/Algo256/decred.cu deleted file mode 100644 index e539c8e6..00000000 --- a/Algo256/decred.cu +++ /dev/null @@ -1,475 +0,0 @@ -/** - * Blake-256 Decred 180-Bytes input Cuda Kernel - * - * Tanguy Pruvot, Alexis Provos - Feb/Sep 2016 - */ - -#include -#include -#include - -extern "C" { -#include -} - -/* threads per block */ -#define TPB 640 - -/* max count of found nonces in one call (like sgminer) */ -#define MAX_RESULTS 4 - -/* hash by cpu with blake 256 */ -extern "C" void decred_hash(void *output, const void *input) -{ - sph_blake256_context ctx; - - sph_blake256_set_rounds(14); - - sph_blake256_init(&ctx); - sph_blake256(&ctx, input, 180); - sph_blake256_close(&ctx, output); -} - -#include - -#ifdef __INTELLISENSE__ -#define __byte_perm(x, y, b) x -#define atomicInc(p, max) (*p)++ -#endif - -__constant__ uint32_t _ALIGN(16) c_h[2]; -__constant__ uint32_t _ALIGN(16) c_data[32]; -__constant__ uint32_t _ALIGN(16) c_xors[215]; - -/* Buffers of candidate nonce(s) */ -static uint32_t *d_resNonce[MAX_GPUS]; -static uint32_t *h_resNonce[MAX_GPUS]; - -#define ROR8(a) __byte_perm(a, 0, 0x0321) -#define ROL16(a) __byte_perm(a, 0, 0x1032) - -/* macro bodies */ -#define pxorGS(a,b,c,d) { \ - v[a]+= c_xors[i++] + v[b]; \ - v[d] = ROL16(v[d] ^ v[a]); \ - v[c]+= v[d]; \ - v[b] = ROTR32(v[b] ^ v[c], 12); \ - v[a]+= c_xors[i++] + v[b]; \ - v[d] = ROR8(v[d] ^ v[a]); \ - v[c]+= v[d]; \ - v[b] = ROTR32(v[b] ^ v[c], 7); \ -} - -#define pxorGS2(a,b,c,d, a1,b1,c1,d1) {\ - v[ a]+= c_xors[i++] + v[ b]; v[a1]+= c_xors[i++] + v[b1]; \ - v[ d] = ROL16(v[ d] ^ v[ a]); v[d1] = ROL16(v[d1] ^ v[a1]); \ - v[ c]+= v[ d]; v[c1]+= v[d1]; \ - v[ b] = ROTR32(v[ b] ^ v[ c], 12); v[b1] = ROTR32(v[b1] ^ v[c1], 12); \ - v[ a]+= c_xors[i++] + v[ b]; v[a1]+= c_xors[i++] + v[b1]; \ - v[ d] = ROR8(v[ d] ^ v[ a]); v[d1] = ROR8(v[d1] ^ v[a1]); \ - v[ c]+= v[ d]; v[c1]+= v[d1]; \ - v[ b] = ROTR32(v[ b] ^ v[ c], 7); v[b1] = ROTR32(v[b1] ^ v[c1], 7); \ -} - -#define pxory1GS2(a,b,c,d, a1,b1,c1,d1) { \ - v[ a]+= c_xors[i++] + v[ b]; v[a1]+= c_xors[i++] + v[b1]; \ - v[ d] = ROL16(v[ d] ^ v[ a]); v[d1] = ROL16(v[d1] ^ v[a1]); \ - v[ c]+= v[ d]; v[c1]+= v[d1]; \ - v[ b] = ROTR32(v[ b] ^ v[ c], 12); v[b1] = ROTR32(v[b1] ^ v[c1], 12); \ - v[ a]+= c_xors[i++] + v[ b]; v[a1]+= (c_xors[i++]^nonce) + v[b1]; \ - v[ d] = ROR8(v[ d] ^ v[ a]); v[d1] = ROR8(v[d1] ^ v[a1]); \ - v[ c]+= v[ d]; v[c1]+= v[d1]; \ - v[ b] = ROTR32(v[ b] ^ v[ c], 7); v[b1] = ROTR32(v[b1] ^ v[c1], 7); \ -} - -#define pxory0GS2(a,b,c,d, a1,b1,c1,d1) { \ - v[ a]+= c_xors[i++] + v[ b]; v[a1]+= c_xors[i++] + v[b1]; \ - v[ d] = ROL16(v[ d] ^ v[ a]); v[d1] = ROL16(v[d1] ^ v[a1]); \ - v[ c]+= v[ d]; v[c1]+= v[d1]; \ - v[ b] = ROTR32(v[ b] ^ v[ c], 12); v[b1] = ROTR32(v[b1] ^ v[c1], 12); \ - v[ a]+= (c_xors[i++]^nonce) + v[ b]; v[a1]+= c_xors[i++] + v[b1]; \ - v[ d] = ROR8(v[ d] ^ v[ a]); v[d1] = ROR8(v[d1] ^ v[a1]); \ - v[ c]+= v[ d]; v[c1]+= v[d1]; \ - v[ b] = ROTR32(v[ b] ^ v[ c], 7); v[b1] = ROTR32(v[b1] ^ v[c1], 7); \ -} - -#define pxorx1GS2(a,b,c,d, a1,b1,c1,d1) { \ - v[ a]+= c_xors[i++] + v[ b]; v[a1]+= (c_xors[i++]^nonce) + v[b1]; \ - v[ d] = ROL16(v[ d] ^ v[ a]); v[d1] = ROL16(v[d1] ^ v[a1]); \ - v[ c]+= v[ d]; v[c1]+= v[d1]; \ - v[ b] = ROTR32(v[ b] ^ v[ c], 12); v[b1] = ROTR32(v[b1] ^ v[c1], 12); \ - v[ a]+= c_xors[i++] + v[ b]; v[a1]+= c_xors[i++] + v[b1]; \ - v[ d] = ROR8(v[ d] ^ v[ a]); v[d1] = ROR8(v[d1] ^ v[a1]); \ - v[ c]+= v[ d]; v[c1]+= v[d1]; \ - v[ b] = ROTR32(v[ b] ^ v[ c], 7); v[b1] = ROTR32(v[b1] ^ v[c1], 7); \ -} - -#define pxorx0GS2(a,b,c,d, a1,b1,c1,d1) { \ - v[ a]+= (c_xors[i++]^nonce) + v[ b]; v[a1]+= c_xors[i++] + v[b1]; \ - v[ d] = ROL16(v[ d] ^ v[ a]); v[d1] = ROL16(v[d1] ^ v[a1]); \ - v[ c]+= v[ d]; v[c1]+= v[d1]; \ - v[ b] = ROTR32(v[ b] ^ v[ c], 12); v[b1] = ROTR32(v[b1] ^ v[c1], 12); \ - v[ a]+= c_xors[i++] + v[ b]; v[a1]+= c_xors[i++] + v[b1]; \ - v[ d] = ROR8(v[ d] ^ v[ a]); v[d1] = ROR8(v[d1] ^ v[a1]); \ - v[ c]+= v[ d]; v[c1]+= v[d1]; \ - v[ b] = ROTR32(v[ b] ^ v[ c], 7); v[b1] = ROTR32(v[b1] ^ v[c1], 7); \ -} - -__global__ __launch_bounds__(TPB,1) -void decred_gpu_hash_nonce(const uint32_t threads, const uint32_t startNonce, uint32_t *resNonce, const uint32_t highTarget) -{ - const uint32_t thread = blockDim.x * blockIdx.x + threadIdx.x; - - if (thread < threads) - { - uint32_t v[16]; - #pragma unroll - for(int i=0; i<16; i+=4) { - *(uint4*)&v[i] = *(uint4*)&c_data[i]; - } - - const uint32_t nonce = startNonce + thread; - v[ 1]+= (nonce ^ 0x13198A2E); - v[13] = ROR8(v[13] ^ v[1]); - v[ 9]+= v[13]; - v[ 5] = ROTR32(v[5] ^ v[9], 7); - - int i = 0; - v[ 1]+= c_xors[i++];// + v[ 6]; - v[ 0]+= v[5]; - v[12] = ROL16(v[12] ^ v[ 1]); v[15] = ROL16(v[15] ^ v[ 0]); - v[11]+= v[12]; v[10]+= v[15]; - v[ 6] = ROTR32(v[ 6] ^ v[11], 12); v[ 5] = ROTR32(v[5] ^ v[10], 12); - v[ 1]+= c_xors[i++] + v[ 6]; v[ 0]+= c_xors[i++] + v[ 5]; - v[12] = ROR8(v[12] ^ v[ 1]); v[15] = ROR8(v[15] ^ v[ 0]); - v[11]+= v[12]; v[10]+= v[15]; - v[ 6] = ROTR32(v[ 6] ^ v[11], 7); v[ 5] = ROTR32(v[ 5] ^ v[10], 7); - - pxorGS2( 2, 7, 8, 13, 3, 4, 9, 14); - pxorGS2( 0, 4, 8, 12, 1, 5, 9, 13); pxorGS2( 2, 6, 10, 14, 3, 7, 11, 15); pxorGS2( 0, 5, 10, 15, 1, 6, 11, 12); pxory1GS2( 2, 7, 8, 13, 3, 4, 9, 14); - pxorGS2( 0, 4, 8, 12, 1, 5, 9, 13); pxorGS2( 2, 6, 10, 14, 3, 7, 11, 15); pxorx1GS2( 0, 5, 10, 15, 1, 6, 11, 12); pxorGS2( 2, 7, 8, 13, 3, 4, 9, 14); - pxorx1GS2( 0, 4, 8, 12, 1, 5, 9, 13); pxorGS2( 2, 6, 10, 14, 3, 7, 11, 15); pxorGS2( 0, 5, 10, 15, 1, 6, 11, 12); pxorGS2( 2, 7, 8, 13, 3, 4, 9, 14); - pxorGS2( 0, 4, 8, 12, 1, 5, 9, 13); pxorGS2( 2, 6, 10, 14, 3, 7, 11, 15); pxorGS2( 0, 5, 10, 15, 1, 6, 11, 12); pxorx1GS2( 2, 7, 8, 13, 3, 4, 9, 14); - pxorGS2( 0, 4, 8, 12, 1, 5, 9, 13); pxory1GS2( 2, 6, 10, 14, 3, 7, 11, 15); pxorGS2( 0, 5, 10, 15, 1, 6, 11, 12); pxorGS2( 2, 7, 8, 13, 3, 4, 9, 14); - pxorGS2( 0, 4, 8, 12, 1, 5, 9, 13); pxorGS2( 2, 6, 10, 14, 3, 7, 11, 15); pxory1GS2( 0, 5, 10, 15, 1, 6, 11, 12); pxorGS2( 2, 7, 8, 13, 3, 4, 9, 14); - pxorGS2( 0, 4, 8, 12, 1, 5, 9, 13); pxorx1GS2( 2, 6, 10, 14, 3, 7, 11, 15); pxorGS2( 0, 5, 10, 15, 1, 6, 11, 12); pxorGS2( 2, 7, 8, 13, 3, 4, 9, 14); - pxorGS2( 0, 4, 8, 12, 1, 5, 9, 13); pxory0GS2( 2, 6, 10, 14, 3, 7, 11, 15); pxorGS2( 0, 5, 10, 15, 1, 6, 11, 12); pxorGS2( 2, 7, 8, 13, 3, 4, 9, 14); - pxorGS2( 0, 4, 8, 12, 1, 5, 9, 13); pxorGS2( 2, 6, 10, 14, 3, 7, 11, 15); pxorGS2( 0, 5, 10, 15, 1, 6, 11, 12); pxorx0GS2( 2, 7, 8, 13, 3, 4, 9, 14); - pxory1GS2( 0, 4, 8, 12, 1, 5, 9, 13); pxorGS2( 2, 6, 10, 14, 3, 7, 11, 15); pxorGS2( 0, 5, 10, 15, 1, 6, 11, 12); pxorGS2( 2, 7, 8, 13, 3, 4, 9, 14); - pxorGS2( 0, 4, 8, 12, 1, 5, 9, 13); pxorGS2( 2, 6, 10, 14, 3, 7, 11, 15); pxorGS2( 0, 5, 10, 15, 1, 6, 11, 12); pxory1GS2( 2, 7, 8, 13, 3, 4, 9, 14); - pxorGS2( 0, 4, 8, 12, 1, 5, 9, 13); pxorGS2( 2, 6, 10, 14, 3, 7, 11, 15); pxorx1GS2( 0, 5, 10, 15, 1, 6, 11, 12); pxorGS2( 2, 7, 8, 13, 3, 4, 9, 14); - pxorx1GS2( 0, 4, 8, 12, 1, 5, 9, 13); pxorGS2( 2, 6, 10, 14, 3, 7, 11, 15); pxorGS2( 0, 5, 10, 15, 1, 6, 11, 12); pxorGS( 2, 7, 8, 13); - - if ((c_h[1]^v[15]) == v[7]) { - v[ 3] += c_xors[i++] + v[4]; - v[14] = ROL16(v[14] ^ v[3]); - v[ 9] += v[14]; - v[ 4] = ROTR32(v[4] ^ v[9], 12); - v[ 3] += c_xors[i++] + v[4]; - v[14] = ROR8(v[14] ^ v[3]); - if(cuda_swab32((c_h[0]^v[6]^v[14])) <= highTarget) { - uint32_t pos = atomicInc(&resNonce[0], UINT32_MAX)+1; - resNonce[pos] = nonce; - return; - } - } - } -} - -__host__ -void decred_cpu_setBlock_52(const uint32_t *input) -{ -/* - Precompute everything possible and pass it on constant memory -*/ - const uint32_t z[16] = { - 0x243F6A88U, 0x85A308D3U, 0x13198A2EU, 0x03707344U, - 0xA4093822U, 0x299F31D0U, 0x082EFA98U, 0xEC4E6C89U, - 0x452821E6U, 0x38D01377U, 0xBE5466CFU, 0x34E90C6CU, - 0xC0AC29B7U, 0xC97C50DDU, 0x3F84D5B5U, 0xB5470917U - }; - - int i=0; - uint32_t _ALIGN(64) preXOR[215]; - uint32_t _ALIGN(64) data[16]; - uint32_t _ALIGN(64) m[16]; - uint32_t _ALIGN(64) h[ 2]; - - sph_blake256_context ctx; - sph_blake256_set_rounds(14); - sph_blake256_init(&ctx); - sph_blake256(&ctx, input, 128); - - data[ 0] = ctx.H[0]; - data[ 1] = ctx.H[1]; - data[ 2] = ctx.H[2]; - data[ 3] = ctx.H[3]; - data[ 4] = ctx.H[4]; - data[ 5] = ctx.H[5]; - data[ 8] = ctx.H[6]; - - data[12] = swab32(input[35]); - data[13] = ctx.H[7]; - - // pre swab32 - m[ 0] = swab32(input[32]); m[ 1] = swab32(input[33]); - m[ 2] = swab32(input[34]); m[ 3] = 0; - m[ 4] = swab32(input[36]); m[ 5] = swab32(input[37]); - m[ 6] = swab32(input[38]); m[ 7] = swab32(input[39]); - m[ 8] = swab32(input[40]); m[ 9] = swab32(input[41]); - m[10] = swab32(input[42]); m[11] = swab32(input[43]); - m[12] = swab32(input[44]); m[13] = 0x80000001; - m[14] = 0; - m[15] = 0x000005a0; - - h[ 0] = data[ 8]; - h[ 1] = data[13]; - - CUDA_SAFE_CALL(cudaMemcpyToSymbol(c_h,h, 8, 0, cudaMemcpyHostToDevice)); - - data[ 0]+= (m[ 0] ^ z[1]) + data[ 4]; - data[12] = SPH_ROTR32(z[4] ^ SPH_C32(0x5A0) ^ data[ 0], 16); - - data[ 8] = z[0]+data[12]; - data[ 4] = SPH_ROTR32(data[ 4] ^ data[ 8], 12); - data[ 0]+= (m[ 1] ^ z[0]) + data[ 4]; - data[12] = SPH_ROTR32(data[12] ^ data[ 0],8); - data[ 8]+= data[12]; - data[ 4] = SPH_ROTR32(data[ 4] ^ data[ 8], 7); - - data[ 1]+= (m[ 2] ^ z[3]) + data[ 5]; - data[13] = SPH_ROTR32((z[5] ^ SPH_C32(0x5A0)) ^ data[ 1], 16); - data[ 9] = z[1]+data[13]; - data[ 5] = SPH_ROTR32(data[ 5] ^ data[ 9], 12); - data[ 1]+= data[ 5]; //+nonce ^ ... - - data[ 2]+= (m[ 4] ^ z[5]) + h[ 0]; - data[14] = SPH_ROTR32(z[6] ^ data[ 2],16); - data[10] = z[2] + data[14]; - data[ 6] = SPH_ROTR32(h[ 0] ^ data[10], 12); - data[ 2]+= (m[ 5] ^ z[4]) + data[ 6]; - data[14] = SPH_ROTR32(data[14] ^ data[ 2], 8); - data[10]+= data[14]; - data[ 6] = SPH_ROTR32(data[ 6] ^ data[10], 7); - - data[ 3]+= (m[ 6] ^ z[7]) + h[ 1]; - data[15] = SPH_ROTR32(z[7] ^ data[ 3],16); - data[11] = z[3] + data[15]; - data[ 7] = SPH_ROTR32(h[ 1] ^ data[11], 12); - data[ 3]+= (m[ 7] ^ z[6]) + data[ 7]; - data[15] = SPH_ROTR32(data[15] ^ data[ 3],8); - data[11]+= data[15]; - data[ 7] = SPH_ROTR32(data[11] ^ data[ 7], 7); - data[ 0]+= m[ 8] ^ z[9]; - - CUDA_SAFE_CALL(cudaMemcpyToSymbol(c_data, data, 64, 0, cudaMemcpyHostToDevice)); - -#define precalcXORGS(x,y) { \ - preXOR[i++]= (m[x] ^ z[y]); \ - preXOR[i++]= (m[y] ^ z[x]); \ -} -#define precalcXORGS2(x,y,x1,y1){\ - preXOR[i++] = (m[ x] ^ z[ y]);\ - preXOR[i++] = (m[x1] ^ z[y1]);\ - preXOR[i++] = (m[ y] ^ z[ x]);\ - preXOR[i++] = (m[y1] ^ z[x1]);\ -} - precalcXORGS(10,11); - preXOR[ 0]+=data[ 6]; - preXOR[i++] = (m[9] ^ z[8]); - precalcXORGS2(12,13,14,15); - precalcXORGS2(14,10, 4, 8); - precalcXORGS2( 9,15,13, 6); - precalcXORGS2( 1,12, 0, 2); - precalcXORGS2(11, 7, 5, 3); - precalcXORGS2(11, 8,12, 0); - precalcXORGS2( 5, 2,15,13); - precalcXORGS2(10,14, 3, 6); - precalcXORGS2( 7, 1, 9, 4); - precalcXORGS2( 7, 9, 3, 1); - precalcXORGS2(13,12,11,14); - precalcXORGS2( 2, 6, 5,10); - precalcXORGS2( 4, 0,15, 8); - precalcXORGS2( 9, 0, 5, 7); - precalcXORGS2( 2, 4,10,15); - precalcXORGS2(14, 1,11,12); - precalcXORGS2( 6, 8, 3,13); - precalcXORGS2( 2,12, 6,10); - precalcXORGS2( 0,11, 8, 3); - precalcXORGS2( 4,13, 7, 5); - precalcXORGS2(15,14, 1, 9); - precalcXORGS2(12, 5, 1,15); - precalcXORGS2(14,13, 4,10); - precalcXORGS2( 0, 7, 6, 3); - precalcXORGS2( 9, 2, 8,11); - precalcXORGS2(13,11, 7,14); - precalcXORGS2(12, 1, 3, 9); - precalcXORGS2( 5, 0,15, 4); - precalcXORGS2( 8, 6, 2,10); - precalcXORGS2( 6,15,14, 9); - precalcXORGS2(11, 3, 0, 8); - precalcXORGS2(12, 2,13, 7); - precalcXORGS2( 1, 4,10, 5); - precalcXORGS2(10, 2, 8, 4); - precalcXORGS2( 7, 6, 1, 5); - precalcXORGS2(15,11, 9,14); - precalcXORGS2( 3,12,13, 0); - precalcXORGS2( 0, 1, 2, 3); - precalcXORGS2( 4, 5, 6, 7); - precalcXORGS2( 8, 9,10,11); - precalcXORGS2(12,13,14,15); - precalcXORGS2(14,10, 4, 8); - precalcXORGS2( 9,15,13, 6); - precalcXORGS2( 1,12, 0, 2); - precalcXORGS2(11, 7, 5, 3); - precalcXORGS2(11, 8,12, 0); - precalcXORGS2( 5, 2,15,13); - precalcXORGS2(10,14, 3, 6); - precalcXORGS2( 7, 1, 9, 4); - precalcXORGS2( 7, 9, 3, 1); - precalcXORGS2(13,12,11,14); - precalcXORGS2( 2, 6, 5,10); - precalcXORGS( 4, 0); - precalcXORGS(15, 8); - - CUDA_SAFE_CALL(cudaMemcpyToSymbol(c_xors, preXOR, 215*sizeof(uint32_t), 0, cudaMemcpyHostToDevice)); -} - -/* ############################################################################################################################### */ - -static bool init[MAX_GPUS] = { 0 }; - -// nonce position is different in decred -#define DCR_NONCE_OFT32 35 - -extern "C" int scanhash_decred(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t _ALIGN(64) endiandata[48]; - - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - uint32_t *pnonce = &pdata[DCR_NONCE_OFT32]; - - const uint32_t first_nonce = *pnonce; - const uint32_t targetHigh = opt_benchmark ? 0x1ULL : ptarget[6]; - - const int dev_id = device_map[thr_id]; - int intensity = (device_sm[dev_id] > 500 && !is_windows()) ? 29 : 25; - if (device_sm[dev_id] < 350) intensity = 22; - - uint32_t throughput = cuda_default_throughput(thr_id, 1U << intensity); - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - const dim3 grid((throughput + TPB-1)/(TPB)); - const dim3 block(TPB); - - if (!init[thr_id]) { - cudaSetDevice(dev_id); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage (linux) - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - cudaDeviceSetCacheConfig(cudaFuncCachePreferL1); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - cuda_get_arch(thr_id); - - CUDA_CALL_OR_RET_X(cudaMalloc(&d_resNonce[thr_id], MAX_RESULTS*sizeof(uint32_t)), -1); - CUDA_CALL_OR_RET_X(cudaMallocHost(&h_resNonce[thr_id], MAX_RESULTS*sizeof(uint32_t)), -1); - init[thr_id] = true; - } - memcpy(endiandata, pdata, 180); - - decred_cpu_setBlock_52(endiandata); - cudaMemset(d_resNonce[thr_id], 0x00, sizeof(uint32_t)); - - do { - uint32_t* resNonces = h_resNonce[thr_id]; - - if (resNonces[0]) cudaMemset(d_resNonce[thr_id], 0x00, sizeof(uint32_t)); - - // GPU HASH - decred_gpu_hash_nonce <<>> (throughput, (*pnonce), d_resNonce[thr_id], targetHigh); - - *hashes_done = (*pnonce) - first_nonce + throughput; - - // first cell contains the valid nonces count - cudaMemcpy(resNonces, d_resNonce[thr_id], sizeof(uint32_t), cudaMemcpyDeviceToHost); - - if (resNonces[0]) - { - uint32_t _ALIGN(64) vhash[8]; - - cudaMemcpy(resNonces, d_resNonce[thr_id], (resNonces[0]+1)*sizeof(uint32_t), cudaMemcpyDeviceToHost); - - be32enc(&endiandata[DCR_NONCE_OFT32], resNonces[1]); - decred_hash(vhash, endiandata); - if (vhash[6] <= ptarget[6] && fulltest(vhash, ptarget)) - { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - work->nonces[0] = swab32(resNonces[1]); - *pnonce = work->nonces[0]; - - // search for another nonce - for(uint32_t n=2; n <= resNonces[0]; n++) - { - be32enc(&endiandata[DCR_NONCE_OFT32], resNonces[n]); - decred_hash(vhash, endiandata); - if (vhash[6] <= ptarget[6] && fulltest(vhash, ptarget)) { - work->nonces[1] = swab32(resNonces[n]); - if (bn_hash_target_ratio(vhash, ptarget) > work->shareratio[0]) { - // we really want the best first ? depends... - work->shareratio[1] = work->shareratio[0]; - work->sharediff[1] = work->sharediff[0]; - xchg(work->nonces[1], work->nonces[0]); - work_set_target_ratio(work, vhash); - work->valid_nonces++; - } else if (work->valid_nonces == 1) { - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - } - work->valid_nonces = 2; // MAX_NONCES submit limited to 2 - - gpulog(LOG_DEBUG, thr_id, "multiple nonces 1:%08x (%g) %u:%08x (%g)", - work->nonces[0], work->sharediff[0], n, work->nonces[1], work->sharediff[1]); - - } else if (vhash[6] > ptarget[6]) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result %u for %08x does not validate on CPU!", n, resNonces[n]); - } - } - return work->valid_nonces; - - } else if (vhash[6] > ptarget[6]) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", resNonces[1]); - } - } - *pnonce += throughput; - - } while (!work_restart[thr_id].restart && max_nonce > (uint64_t)throughput + (*pnonce)); - - *hashes_done = (*pnonce) - first_nonce; - MyStreamSynchronize(NULL, 0, device_map[thr_id]); - return 0; -} - -// cleanup -extern "C" void free_decred(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaDeviceSynchronize(); - cudaFreeHost(h_resNonce[thr_id]); - cudaFree(d_resNonce[thr_id]); - - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/Algo256/keccak256.cu b/Algo256/keccak256.cu index 89803f69..84b0cd4d 100644 --- a/Algo256/keccak256.cu +++ b/Algo256/keccak256.cu @@ -5,8 +5,6 @@ extern "C" { -#include "sph/sph_shavite.h" -#include "sph/sph_simd.h" #include "sph/sph_keccak.h" #include "miner.h" @@ -77,7 +75,7 @@ extern "C" int scanhash_keccak256(int thr_id, struct work* work, uint32_t max_no cuda_get_arch(thr_id); use_compat_kernels[thr_id] = true; // (cuda_arch[dev_id] < 500); - if(!use_compat_kernels[thr_id]) { + if (!use_compat_kernels[thr_id]) { keccak256_cpu_init(thr_id); } else { // really useful ? diff --git a/Algo256/vanilla.cu b/Algo256/vanilla.cu deleted file mode 100644 index 1b63aedd..00000000 --- a/Algo256/vanilla.cu +++ /dev/null @@ -1,492 +0,0 @@ -/** - * Optimized Blake-256 8-rounds Cuda Kernel (Tested on SM >3.0) - * Based upon Blake-256 implementation of Tanguy Pruvot - Nov. 2014 - * - * Provos Alexis - Jan. 2016 - * - * Fixed CUDA 7.5 flaw - * minor code changes - * code cleanup - * increased nonces per thread - * removed SSE2 midstate computation - * Provos Alexis - Mar 2016 - */ - -#include -#include - -#include "miner.h" - -extern "C" { -#include "sph/sph_blake.h" -} - -#include "cuda_helper.h" - -#ifdef __INTELLISENSE__ -#define __byte_perm(x, y, b) x -#endif - -/* threads per block and nonces per thread */ -#define TPB 768 -#define NPT 384 -#define NBN 2 - -__constant__ uint32_t _ALIGN(16) d_data[21]; - -/* 16 gpu threads max */ -static uint32_t *d_resNonce[MAX_GPUS]; -static uint32_t *h_resNonce[MAX_GPUS]; -static cudaStream_t streams[MAX_GPUS]; - -/* hash by cpu with blake 256 */ -extern "C" void vanillahash(void *output, const void *input, int8_t blakerounds){ - uchar hash[64]; - sph_blake256_context ctx; - - sph_blake256_set_rounds(blakerounds); - - sph_blake256_init(&ctx); - sph_blake256(&ctx, input, 80); - sph_blake256_close(&ctx, hash); - - memcpy(output, hash, 32); -} -#define GS4(a,b,c,d,x,y,a1,b1,c1,d1,x1,y1,a2,b2,c2,d2,x2,y2,a3,b3,c3,d3,x3,y3) { \ - v[ a]+= (m[ x] ^ z[ y]) + v[ b]; \ - v[a1]+= (m[x1] ^ z[y1]) + v[b1]; \ - v[a2]+= (m[x2] ^ z[y2]) + v[b2]; \ - v[a3]+= (m[x3] ^ z[y3]) + v[b3]; \ - \ - v[ d] = __byte_perm(v[ d] ^ v[ a], 0, 0x1032); \ - v[d1] = __byte_perm(v[d1] ^ v[a1], 0, 0x1032); \ - v[d2] = __byte_perm(v[d2] ^ v[a2], 0, 0x1032); \ - v[d3] = __byte_perm(v[d3] ^ v[a3], 0, 0x1032); \ - \ - v[ c]+= v[ d]; \ - v[c1]+= v[d1]; \ - v[c2]+= v[d2]; \ - v[c3]+= v[d3]; \ - \ - v[ b] = ROTR32(v[ b] ^ v[ c], 12); \ - v[b1] = ROTR32(v[b1] ^ v[c1], 12); \ - v[b2] = ROTR32(v[b2] ^ v[c2], 12); \ - v[b3] = ROTR32(v[b3] ^ v[c3], 12); \ - \ - v[ a]+= (m[ y] ^ z[ x]) + v[ b]; \ - v[a1]+= (m[y1] ^ z[x1]) + v[b1]; \ - v[a2]+= (m[y2] ^ z[x2]) + v[b2]; \ - v[a3]+= (m[y3] ^ z[x3]) + v[b3]; \ - \ - v[ d] = __byte_perm(v[ d] ^ v[ a], 0, 0x0321); \ - v[d1] = __byte_perm(v[d1] ^ v[a1], 0, 0x0321); \ - v[d2] = __byte_perm(v[d2] ^ v[a2], 0, 0x0321); \ - v[d3] = __byte_perm(v[d3] ^ v[a3], 0, 0x0321); \ - \ - v[ c]+= v[ d]; \ - v[c1]+= v[d1]; \ - v[c2]+= v[d2]; \ - v[c3]+= v[d3]; \ - \ - v[ b] = ROTR32(v[ b] ^ v[ c], 7); \ - v[b1] = ROTR32(v[b1] ^ v[c1], 7); \ - v[b2] = ROTR32(v[b2] ^ v[c2], 7); \ - v[b3] = ROTR32(v[b3] ^ v[c3], 7); \ -} - -#define GS3(a,b,c,d,x,y,a1,b1,c1,d1,x1,y1,a2,b2,c2,d2,x2,y2) { \ - v[ a]+= (m[ x] ^ z[ y]) + v[ b]; \ - v[a1]+= (m[x1] ^ z[y1]) + v[b1]; \ - v[a2]+= (m[x2] ^ z[y2]) + v[b2]; \ - \ - v[ d] = __byte_perm(v[ d] ^ v[ a], 0, 0x1032); \ - v[d1] = __byte_perm(v[d1] ^ v[a1], 0, 0x1032); \ - v[d2] = __byte_perm(v[d2] ^ v[a2], 0, 0x1032); \ - \ - v[ c]+= v[ d]; \ - v[c1]+= v[d1]; \ - v[c2]+= v[d2]; \ - \ - v[ b] = ROTR32(v[ b] ^ v[ c], 12); \ - v[b1] = ROTR32(v[b1] ^ v[c1], 12); \ - v[b2] = ROTR32(v[b2] ^ v[c2], 12); \ - \ - v[ a]+= (m[ y] ^ z[ x]) + v[ b]; \ - v[a1]+= (m[y1] ^ z[x1]) + v[b1]; \ - v[a2]+= (m[y2] ^ z[x2]) + v[b2]; \ - \ - v[ d] = __byte_perm(v[ d] ^ v[ a], 0, 0x0321); \ - v[d1] = __byte_perm(v[d1] ^ v[a1], 0, 0x0321); \ - v[d2] = __byte_perm(v[d2] ^ v[a2], 0, 0x0321); \ - \ - v[ c]+= v[ d]; \ - v[c1]+= v[d1]; \ - v[c2]+= v[d2]; \ - \ - v[ b] = ROTR32(v[ b] ^ v[ c], 7); \ - v[b1] = ROTR32(v[b1] ^ v[c1], 7); \ - v[b2] = ROTR32(v[b2] ^ v[c2], 7); \ -} - -#define GS2(a,b,c,d,x,y,a1,b1,c1,d1,x1,y1) { \ - v[ a]+= (m[ x] ^ z[ y]) + v[ b]; \ - v[a1]+= (m[x1] ^ z[y1]) + v[b1]; \ - \ - v[ d] = __byte_perm(v[ d] ^ v[ a], 0, 0x1032); \ - v[d1] = __byte_perm(v[d1] ^ v[a1], 0, 0x1032); \ - \ - v[ c]+= v[ d]; \ - v[c1]+= v[d1]; \ - \ - v[ b] = ROTR32(v[ b] ^ v[ c], 12); \ - v[b1] = ROTR32(v[b1] ^ v[c1], 12); \ - \ - v[ a]+= (m[ y] ^ z[ x]) + v[ b]; \ - v[a1]+= (m[y1] ^ z[x1]) + v[b1]; \ - \ - v[ d] = __byte_perm(v[ d] ^ v[ a], 0, 0x0321); \ - v[d1] = __byte_perm(v[d1] ^ v[a1], 0, 0x0321); \ - \ - v[ c]+= v[ d]; \ - v[c1]+= v[d1]; \ - \ - v[ b] = ROTR32(v[ b] ^ v[ c], 7); \ - v[b1] = ROTR32(v[b1] ^ v[c1], 7); \ -} - -#define GS(a,b,c,d,x,y) { \ - v[a] += (m[x] ^ z[y]) + v[b]; \ - v[d] = __byte_perm(v[d] ^ v[a],0, 0x1032); \ - v[c] += v[d]; \ - v[b] = ROTR32(v[b] ^ v[c], 12); \ - v[a] += (m[y] ^ z[x]) + v[b]; \ - v[d] = __byte_perm(v[d] ^ v[a],0, 0x0321); \ - v[c] += v[d]; \ - v[b] = ROTR32(v[b] ^ v[c], 7); \ -} - -__global__ __launch_bounds__(TPB,1) -void vanilla_gpu_hash_16_8(const uint32_t threads, const uint32_t startNonce, uint32_t *resNonce,const uint64_t highTarget){ - uint32_t _ALIGN(16) v[16]; - uint32_t _ALIGN(16) tmp[16]; - - const size_t thread = blockDim.x * blockIdx.x + threadIdx.x; - const uint64_t step = gridDim.x * blockDim.x; - const uint64_t maxNonce = startNonce + threads; - - const int8_t r[][16] = { - { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 },{ 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 },{ 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, - { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 },{ 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 }, - { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } - }; - const uint32_t z[16] = { - 0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344, 0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89, - 0x452821E6, 0x38D01377, 0xBE5466CF, 0x34E90C6C, 0xC0AC29B7, 0xC97C50DD, 0x3F84D5B5, 0xB5470917 - }; - -//PREFETCH - #pragma unroll - for(int i=0;i<16;i++){ - tmp[ i] = d_data[ i]; - } - - uint32_t m[16] = { - d_data[16], d_data[17], d_data[18], 0, - 0x80000000UL, 0, 0, 0, - 0, 0, 0, 0, - 0, 1, 0, 640 - }; - - const uint32_t h7 = d_data[19]; - const uint32_t h6 = d_data[20]; -//END OF PREFETCH - uint64_t m3 = startNonce + thread; -loopstart: - if(m3>=maxNonce)return; - m[3] = m3; - - #pragma unroll - for(int i=0;i<16;i++) - v[ i] = tmp[ i]; - - v[ 1]+= m[3] ^ z[2]; - v[13] = __byte_perm(v[13] ^ v[1],0, 0x0321); - v[ 9]+= v[13]; - v[ 5] = ROTR32(v[5] ^ v[9], 7); - v[ 0]+= v[5]; - v[15] = __byte_perm(v[15] ^ v[0],0, 0x1032); - - v[10]+= v[15]; - v[ 5] = ROTR32(v[5] ^ v[10], 12); - v[ 0]+= z[8] + v[5]; - v[15] = __byte_perm(v[15] ^ v[0],0, 0x0321); - v[10]+= v[15]; - v[ 5] = ROTR32(v[5] ^ v[10], 7); - - GS3( 1, 6,11,12,10,11, 2, 7, 8,13,12,13, 3, 4, 9,14,14,15); - - #pragma unroll - for(int i=0;i<6;i++){ - GS4(0, 4, 8,12,r[i][ 0],r[i][ 1], 1, 5, 9,13,r[i][ 2],r[i][ 3], 2, 6,10,14,r[i][ 4],r[i][ 5], 3, 7,11,15,r[i][ 6],r[i][ 7]); - GS4(0, 5,10,15,r[i][ 8],r[i][ 9], 1, 6,11,12,r[i][10],r[i][11], 2, 7, 8,13,r[i][12],r[i][13], 3, 4, 9,14,r[i][14],r[i][15]); - } - GS4(0, 4, 8,12,r[6][ 0],r[6][ 1], 1, 5, 9,13,r[6][ 2],r[6][ 3], 2, 6,10,14,r[6][ 4],r[6][ 5], 3, 7,11,15,r[6][ 6],r[6][ 7]); - - v[ 0] += (m[ 5] ^ z[0]) + v[5]; - v[ 2] += (m[ 8] ^ z[6]) + v[7]; - v[13] = __byte_perm(v[13] ^ v[2],0, 0x1032); - v[15] = __byte_perm(v[15] ^ v[0],0, 0x1032); - - v[ 8] += v[13]; - v[10] += v[15]; - - v[ 5] = ROTR32(v[ 5] ^ v[10], 12); - v[ 7] = ROTR32(v[ 7] ^ v[ 8], 12); - - v[ 0] += (m[ 0] ^ z[5]) + v[5]; - v[ 2] += (m[ 6] ^ z[8]) + v[7]; - - v[15] = __byte_perm(v[15] ^ v[ 0],0, 0x0321); - v[13] = __byte_perm(v[13] ^ v[ 2],0, 0x0321); - - v[8] += v[13]; - v[7] = ROTR32(v[7] ^ v[8], 7); - - // only compute h6 & 7 - if((v[15]^h7)==v[7]){ - v[ 1] += (m[15] ^ z[ 4]) + v[6]; - v[ 3] += (m[2] ^ z[10]) + v[4]; - v[12] = __byte_perm(v[12] ^ v[ 1],0, 0x1032); - v[14] = __byte_perm(v[14] ^ v[3],0, 0x1032); - v[11] += v[12]; - v[ 9] += v[14]; - v[ 6] = ROTR32(v[ 6] ^ v[11], 12); - - v[ 1] += (m[ 4] ^ z[15]) + v[ 6]; - v[ 3] += (m[10] ^ z[ 2]) + ROTR32(v[ 4] ^ v[ 9],12); - v[12] = __byte_perm(v[12] ^ v[ 1],0, 0x0321); - v[14] = __byte_perm(v[14] ^ v[ 3],0, 0x0321); - - v[11] += v[12]; - v[ 6] = ROTR32(v[ 6] ^ v[11], 7); - - if(cuda_swab32(h6^v[6]^v[14]) <= highTarget) { -#if NBN == 2 - /* keep the smallest nonce, + extra one if found */ - if (m[3] < resNonce[0]){ - resNonce[1] = resNonce[0]; - resNonce[0] = m[3]; - } - else - resNonce[1] = m[3]; -#else - resNonce[0] = m[3]; -#endif - return; //<-- this may cause a problem on extranonce if the extranonce is on position current_nonce + X * step where X=[1,2,3..,N] - } - } - m3+=step; - goto loopstart; -} - -__host__ -void vanilla_cpu_setBlock_16(const int thr_id,const uint32_t* endiandata, uint32_t *penddata){ - - const uint32_t _ALIGN(64) z[16] = { - SPH_C32(0x243F6A88), SPH_C32(0x85A308D3), SPH_C32(0x13198A2E), SPH_C32(0x03707344), - SPH_C32(0xA4093822), SPH_C32(0x299F31D0), SPH_C32(0x082EFA98), SPH_C32(0xEC4E6C89), - SPH_C32(0x452821E6), SPH_C32(0x38D01377), SPH_C32(0xBE5466CF), SPH_C32(0x34E90C6C), - SPH_C32(0xC0AC29B7), SPH_C32(0xC97C50DD), SPH_C32(0x3F84D5B5), SPH_C32(0xB5470917) - }; - uint32_t _ALIGN(64) h[22]; - - sph_blake256_context ctx; - - sph_blake256_set_rounds(8); - - sph_blake256_init(&ctx); - sph_blake256(&ctx, endiandata, 64); - - h[ 0] = ctx.H[0]; h[ 1] = ctx.H[1]; - h[ 2] = ctx.H[2]; h[21] = ctx.H[3]; - h[ 4] = ctx.H[4]; h[20] = ctx.H[5]; - h[19] = ctx.H[6]; h[16] = ctx.H[7]; - - uint32_t tmp = h[20]; - h[20] = h[19]; - h[19] = h[16]; - h[16] = penddata[ 0]; - h[17] = penddata[ 1]; - h[18] = penddata[ 2]; - h[12] = z[ 4] ^ 640; - h[ 8] = z[ 0]; - - h[ 0] += (h[16] ^ z[ 1]) + h[ 4]; - h[12] = SPH_ROTR32(h[12] ^ h[0],16); - h[ 8] += h[12]; - h[ 4] = SPH_ROTR32(h[ 4] ^ h[ 8], 12); - h[ 0] += (h[17] ^ z[ 0]) + h[ 4]; - h[12] = SPH_ROTR32(h[12] ^ h[0],8); - h[ 8] += h[12]; - h[ 4] = SPH_ROTR32(h[ 4] ^ h[ 8], 7); - - h[1] += (h[18] ^ z[ 3]) + tmp; - - h[13] = SPH_ROTR32(z[ 5] ^ 640 ^ h[1],16); - h[ 5] = ROTR32(tmp ^ (z[ 1] + h[13]), 12); - - h[ 1] += h[ 5]; - h[ 2] += (0x80000000UL ^ z[ 5]) + h[20]; - - h[14] = SPH_ROTR32(z[ 6] ^ h[2], 16); - h[ 6] = z[ 2] + h[14]; - h[ 6] = SPH_ROTR32(h[20] ^ h[ 6], 12); - - h[21] += z[ 7] + h[19]; - h[ 0] += z[ 9]; - - h[ 2] += z[ 4] + h[ 6]; - - h[ 9] = z[ 1] + h[13]; - h[10] = z[ 2] + h[14]; - - h[14] = SPH_ROTR32(h[14] ^ h[2],8); //0x0321 - h[10]+=h[14]; - - h[ 6] = SPH_ROTR32(h[ 6] ^ h[10],7); - h[15] = SPH_ROTR32(z[ 7] ^ h[21],16); - - h[11] = z[ 3] + h[15]; - h[ 7] = SPH_ROTR32(h[19] ^ h[11], 12); - h[ 3] = h[21] + h[ 7] + z[ 6]; - - h[15] = SPH_ROTR32(h[15] ^ h[ 3],8); - h[11]+= h[15]; - h[ 7] = ROTR32(h[ 7] ^ h[11],7); - - cudaMemcpyToSymbolAsync(d_data, h, 21*sizeof(uint32_t), 0, cudaMemcpyHostToDevice, streams[thr_id]); -} - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_vanilla(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done, const int8_t blakerounds) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - const uint32_t targetHigh = ptarget[6]; - int dev_id = device_map[thr_id]; - - int intensity = (device_sm[dev_id] > 500 && !is_windows()) ? 30 : 24; - if (device_sm[dev_id] < 350) intensity = 22; - uint32_t throughput = cuda_default_throughput(thr_id, 1U << intensity); - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (!init[thr_id]) { - cudaSetDevice(dev_id); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage (linux) - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - cudaDeviceSetCacheConfig(cudaFuncCachePreferL1); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - cuda_get_arch(thr_id); - - CUDA_CALL_OR_RET_X(cudaMalloc(&d_resNonce[thr_id], NBN * sizeof(uint32_t)), -1); - CUDA_CALL_OR_RET_X(cudaMallocHost(&h_resNonce[thr_id], NBN * sizeof(uint32_t)), -1); - cudaStreamCreate(&streams[thr_id]); - init[thr_id] = true; - } - - uint32_t _ALIGN(64) endiandata[20]; - - for (int k = 0; k < 16; k++) - be32enc(&endiandata[k], pdata[k]); - - cudaMemsetAsync(d_resNonce[thr_id], 0xff, sizeof(uint32_t),streams[thr_id]); - - vanilla_cpu_setBlock_16(thr_id,endiandata,&pdata[16]); - - const dim3 grid((throughput + (NPT*TPB)-1)/(NPT*TPB)); - const dim3 block(TPB); - int rc = 0; - - do { - vanilla_gpu_hash_16_8<<>>(throughput, pdata[19], d_resNonce[thr_id], targetHigh); - cudaMemcpyAsync(h_resNonce[thr_id], d_resNonce[thr_id], NBN*sizeof(uint32_t), cudaMemcpyDeviceToHost,streams[thr_id]); - *hashes_done = pdata[19] - first_nonce + throughput; - cudaStreamSynchronize(streams[thr_id]); - - if (h_resNonce[thr_id][0] != UINT32_MAX){ - uint32_t vhashcpu[8]; - uint32_t Htarg = (uint32_t)targetHigh; - - for (int k=0; k < 19; k++) - be32enc(&endiandata[k], pdata[k]); - - be32enc(&endiandata[19], h_resNonce[thr_id][0]); - vanillahash(vhashcpu, endiandata, blakerounds); - - if (vhashcpu[6] <= Htarg && fulltest(vhashcpu, ptarget)) { - work->valid_nonces = 1; - work->nonces[0] = h_resNonce[thr_id][0]; - work_set_target_ratio(work, vhashcpu); -#if NBN > 1 - if (h_resNonce[thr_id][1] != UINT32_MAX) { - work->nonces[1] = h_resNonce[thr_id][1]; - be32enc(&endiandata[19], h_resNonce[thr_id][1]); - vanillahash(vhashcpu, endiandata, blakerounds); - if (bn_hash_target_ratio(vhashcpu, ptarget) > work->shareratio[0]) { - work_set_target_ratio(work, vhashcpu); - xchg(work->nonces[0], work->nonces[1]); - } - work->valid_nonces = 2; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } -#endif - return work->valid_nonces; - } - else if (vhashcpu[6] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", h_resNonce[thr_id][0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - MyStreamSynchronize(NULL, 0, dev_id); - return rc; -} - -// cleanup -extern "C" void free_vanilla(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFreeHost(h_resNonce[thr_id]); - cudaFree(d_resNonce[thr_id]); - - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/JHA/cuda_jha_compactionTest.cu b/JHA/cuda_jha_compactionTest.cu deleted file mode 100644 index 35a13b7b..00000000 --- a/JHA/cuda_jha_compactionTest.cu +++ /dev/null @@ -1,369 +0,0 @@ -#include -#include - -#include "cuda_helper.h" -#include - -#ifdef __INTELLISENSE__ -#define __shfl_up(a,b) -#endif - -static uint32_t *d_tempBranch1Nonces[MAX_GPUS]; -static uint32_t *d_numValid[MAX_GPUS]; -static uint32_t *h_numValid[MAX_GPUS]; - -static uint32_t *d_partSum[2][MAX_GPUS]; // für bis zu vier partielle Summen - -// True/False tester -typedef uint32_t(*cuda_compactTestFunction_t)(uint32_t *inpHash); - -__device__ uint32_t JackpotTrueTest(uint32_t *inpHash) -{ - uint32_t tmp = inpHash[0] & 0x01; - return (tmp == 1); -} - -__device__ uint32_t JackpotFalseTest(uint32_t *inpHash) -{ - uint32_t tmp = inpHash[0] & 0x01; - return (tmp == 0); -} - -__device__ cuda_compactTestFunction_t d_JackpotTrueFunction = JackpotTrueTest, d_JackpotFalseFunction = JackpotFalseTest; - -cuda_compactTestFunction_t h_JackpotTrueFunction[MAX_GPUS], h_JackpotFalseFunction[MAX_GPUS]; - -// Setup-Function -__host__ -void jackpot_compactTest_cpu_init(int thr_id, uint32_t threads) -{ - cudaMemcpyFromSymbol(&h_JackpotTrueFunction[thr_id], d_JackpotTrueFunction, sizeof(cuda_compactTestFunction_t)); - cudaMemcpyFromSymbol(&h_JackpotFalseFunction[thr_id], d_JackpotFalseFunction, sizeof(cuda_compactTestFunction_t)); - - // wir brauchen auch Speicherplatz auf dem Device - cudaMalloc(&d_tempBranch1Nonces[thr_id], sizeof(uint32_t) * threads * 2); - cudaMalloc(&d_numValid[thr_id], 2*sizeof(uint32_t)); - cudaMallocHost(&h_numValid[thr_id], 2*sizeof(uint32_t)); - - uint32_t s1; - s1 = (threads / 256) * 2; - - cudaMalloc(&d_partSum[0][thr_id], sizeof(uint32_t) * s1); // BLOCKSIZE (Threads/Block) - cudaMalloc(&d_partSum[1][thr_id], sizeof(uint32_t) * s1); // BLOCKSIZE (Threads/Block) -} - -__host__ -void jackpot_compactTest_cpu_free(int thr_id) -{ - cudaFree(d_tempBranch1Nonces[thr_id]); - cudaFree(d_numValid[thr_id]); - - cudaFree(d_partSum[0][thr_id]); - cudaFree(d_partSum[1][thr_id]); - - cudaFreeHost(h_numValid[thr_id]); -} - -#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 300 -/** - * __shfl_up() calculates a source lane ID by subtracting delta from the caller's lane ID, and clamping to the range 0..width-1 - */ -#undef __shfl_up -#define __shfl_up(var, delta, width) (0) -#endif - -// Die Summenfunktion (vom NVIDIA SDK) -__global__ -void jackpot_compactTest_gpu_SCAN(uint32_t *data, int width, uint32_t *partial_sums=NULL, cuda_compactTestFunction_t testFunc=NULL, - uint32_t threads=0, uint32_t startNounce=0, uint32_t *inpHashes=NULL, uint32_t *d_validNonceTable=NULL) -{ - extern __shared__ uint32_t sums[]; - int id = ((blockIdx.x * blockDim.x) + threadIdx.x); - //int lane_id = id % warpSize; - int lane_id = id % width; - // determine a warp_id within a block - //int warp_id = threadIdx.x / warpSize; - int warp_id = threadIdx.x / width; - - sums[lane_id] = 0; - - // Below is the basic structure of using a shfl instruction - // for a scan. - // Record "value" as a variable - we accumulate it along the way - uint32_t value; - if(testFunc != NULL) - { - if (id < threads) - { - uint32_t *inpHash; - if(d_validNonceTable == NULL) - { - // keine Nonce-Liste - inpHash = &inpHashes[id<<4]; - }else - { - // Nonce-Liste verfügbar - int nonce = d_validNonceTable[id] - startNounce; - inpHash = &inpHashes[nonce<<4]; - } - value = (*testFunc)(inpHash); - }else - { - value = 0; - } - }else - { - value = data[id]; - } - - __syncthreads(); - - // Now accumulate in log steps up the chain - // compute sums, with another thread's value who is - // distance delta away (i). Note - // those threads where the thread 'i' away would have - // been out of bounds of the warp are unaffected. This - // creates the scan sum. -#pragma unroll - - for (int i=1; i<=width; i*=2) - { - uint32_t n = __shfl_up((int)value, i, width); - - if (lane_id >= i) value += n; - } - - // value now holds the scan value for the individual thread - // next sum the largest values for each warp - - // write the sum of the warp to smem - //if (threadIdx.x % warpSize == warpSize-1) - if (threadIdx.x % width == width-1) - { - sums[warp_id] = value; - } - - __syncthreads(); - - // - // scan sum the warp sums - // the same shfl scan operation, but performed on warp sums - // - if (warp_id == 0) - { - uint32_t warp_sum = sums[lane_id]; - - for (int i=1; i<=width; i*=2) - { - uint32_t n = __shfl_up((int)warp_sum, i, width); - - if (lane_id >= i) warp_sum += n; - } - - sums[lane_id] = warp_sum; - } - - __syncthreads(); - - // perform a uniform add across warps in the block - // read neighbouring warp's sum and add it to threads value - uint32_t blockSum = 0; - - if (warp_id > 0) - { - blockSum = sums[warp_id-1]; - } - - value += blockSum; - - // Now write out our result - data[id] = value; - - // last thread has sum, write write out the block's sum - if (partial_sums != NULL && threadIdx.x == blockDim.x-1) - { - partial_sums[blockIdx.x] = value; - } -} - -// Uniform add: add partial sums array -__global__ -void jackpot_compactTest_gpu_ADD(uint32_t *data, uint32_t *partial_sums, int len) -{ - __shared__ uint32_t buf; - int id = ((blockIdx.x * blockDim.x) + threadIdx.x); - - if (id > len) return; - - if (threadIdx.x == 0) - { - buf = partial_sums[blockIdx.x]; - } - - __syncthreads(); - data[id] += buf; -} - -// Der Scatter -__global__ -void jackpot_compactTest_gpu_SCATTER(uint32_t *sum, uint32_t *outp, cuda_compactTestFunction_t testFunc, - uint32_t threads=0, uint32_t startNounce=0, uint32_t *inpHashes=NULL, uint32_t *d_validNonceTable=NULL) -{ - int id = ((blockIdx.x * blockDim.x) + threadIdx.x); - uint32_t actNounce = id; - uint32_t value; - if (id < threads) - { -// uint32_t nounce = startNounce + id; - uint32_t *inpHash; - if(d_validNonceTable == NULL) - { - // keine Nonce-Liste - inpHash = &inpHashes[id<<4]; - }else - { - // Nonce-Liste verfügbar - int nonce = d_validNonceTable[id] - startNounce; - actNounce = nonce; - inpHash = &inpHashes[nonce<<4]; - } - - value = (*testFunc)(inpHash); - }else - { - value = 0; - } - - if( value ) - { - int idx = sum[id]; - if(idx > 0) - outp[idx-1] = startNounce + actNounce; - } -} - -__host__ -static uint32_t jackpot_compactTest_roundUpExp(uint32_t val) -{ - if(val == 0) - return 0; - - uint32_t mask = 0x80000000; - while( (val & mask) == 0 ) mask = mask >> 1; - - if( (val & (~mask)) != 0 ) - return mask << 1; - - return mask; -} - -__host__ -void jackpot_compactTest_cpu_singleCompaction(int thr_id, uint32_t threads, uint32_t *nrm, uint32_t *d_nonces1, - cuda_compactTestFunction_t function, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable) -{ - int orgThreads = threads; - threads = (int)jackpot_compactTest_roundUpExp((uint32_t)threads); - // threadsPerBlock ausrechnen - int blockSize = 256; - int nSummen = threads / blockSize; - - int thr1 = (threads+blockSize-1) / blockSize; - int thr2 = threads / (blockSize*blockSize); - int blockSize2 = (nSummen < blockSize) ? nSummen : blockSize; - int thr3 = (nSummen + blockSize2-1) / blockSize2; - - bool callThrid = (thr2 > 0) ? true : false; - - // Erster Initialscan - jackpot_compactTest_gpu_SCAN<<>>( - d_tempBranch1Nonces[thr_id], 32, d_partSum[0][thr_id], function, orgThreads, startNounce, inpHashes, d_validNonceTable); - - // weitere Scans - if(callThrid) - { - jackpot_compactTest_gpu_SCAN<<>>(d_partSum[0][thr_id], 32, d_partSum[1][thr_id]); - jackpot_compactTest_gpu_SCAN<<<1, thr2, 32*sizeof(uint32_t)>>>(d_partSum[1][thr_id], (thr2>32) ? 32 : thr2); - }else - { - jackpot_compactTest_gpu_SCAN<<>>(d_partSum[0][thr_id], (blockSize2>32) ? 32 : blockSize2); - } - - // Sync + Anzahl merken - cudaStreamSynchronize(NULL); - - if(callThrid) - cudaMemcpy(nrm, &(d_partSum[1][thr_id])[thr2-1], sizeof(uint32_t), cudaMemcpyDeviceToHost); - else - cudaMemcpy(nrm, &(d_partSum[0][thr_id])[nSummen-1], sizeof(uint32_t), cudaMemcpyDeviceToHost); - - - // Addieren - if(callThrid) - { - jackpot_compactTest_gpu_ADD<<>>(d_partSum[0][thr_id]+blockSize, d_partSum[1][thr_id], blockSize*thr2); - } - jackpot_compactTest_gpu_ADD<<>>(d_tempBranch1Nonces[thr_id]+blockSize, d_partSum[0][thr_id], threads); - - // Scatter - jackpot_compactTest_gpu_SCATTER<<>>(d_tempBranch1Nonces[thr_id], d_nonces1, - function, orgThreads, startNounce, inpHashes, d_validNonceTable); - - // Sync - cudaStreamSynchronize(NULL); -} - -////// ACHTUNG: Diese funktion geht aktuell nur mit threads > 65536 (Am besten 256 * 1024 oder 256*2048) -__host__ -void jackpot_compactTest_cpu_dualCompaction(int thr_id, uint32_t threads, uint32_t *nrm, uint32_t *d_nonces1, - uint32_t *d_nonces2, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable) -{ - jackpot_compactTest_cpu_singleCompaction(thr_id, threads, &nrm[0], d_nonces1, h_JackpotTrueFunction[thr_id], startNounce, inpHashes, d_validNonceTable); - jackpot_compactTest_cpu_singleCompaction(thr_id, threads, &nrm[1], d_nonces2, h_JackpotFalseFunction[thr_id], startNounce, inpHashes, d_validNonceTable); - - /* - // threadsPerBlock ausrechnen - int blockSize = 256; - int thr1 = threads / blockSize; - int thr2 = threads / (blockSize*blockSize); - - // 1 - jackpot_compactTest_gpu_SCAN<<>>(d_tempBranch1Nonces[thr_id], 32, d_partSum1[thr_id], h_JackpotTrueFunction[thr_id], threads, startNounce, inpHashes); - jackpot_compactTest_gpu_SCAN<<>>(d_partSum1[thr_id], 32, d_partSum2[thr_id]); - jackpot_compactTest_gpu_SCAN<<<1, thr2, 32*sizeof(uint32_t)>>>(d_partSum2[thr_id], (thr2>32) ? 32 : thr2); - cudaStreamSynchronize(NULL); - cudaMemcpy(&nrm[0], &(d_partSum2[thr_id])[thr2-1], sizeof(uint32_t), cudaMemcpyDeviceToHost); - jackpot_compactTest_gpu_ADD<<>>(d_partSum1[thr_id]+blockSize, d_partSum2[thr_id], blockSize*thr2); - jackpot_compactTest_gpu_ADD<<>>(d_tempBranch1Nonces[thr_id]+blockSize, d_partSum1[thr_id], threads); - - // 2 - jackpot_compactTest_gpu_SCAN<<>>(d_tempBranch2Nonces[thr_id], 32, d_partSum1[thr_id], h_JackpotFalseFunction[thr_id], threads, startNounce, inpHashes); - jackpot_compactTest_gpu_SCAN<<>>(d_partSum1[thr_id], 32, d_partSum2[thr_id]); - jackpot_compactTest_gpu_SCAN<<<1, thr2, 32*sizeof(uint32_t)>>>(d_partSum2[thr_id], (thr2>32) ? 32 : thr2); - cudaStreamSynchronize(NULL); - cudaMemcpy(&nrm[1], &(d_partSum2[thr_id])[thr2-1], sizeof(uint32_t), cudaMemcpyDeviceToHost); - jackpot_compactTest_gpu_ADD<<>>(d_partSum1[thr_id]+blockSize, d_partSum2[thr_id], blockSize*thr2); - jackpot_compactTest_gpu_ADD<<>>(d_tempBranch2Nonces[thr_id]+blockSize, d_partSum1[thr_id], threads); - - // Hier ist noch eine Besonderheit: in d_tempBranch1Nonces sind die element von 1...nrm1 die Interessanten - // Schritt 3: Scatter - jackpot_compactTest_gpu_SCATTER<<>>(d_tempBranch1Nonces[thr_id], d_nonces1, h_JackpotTrueFunction[thr_id], threads, startNounce, inpHashes); - jackpot_compactTest_gpu_SCATTER<<>>(d_tempBranch2Nonces[thr_id], d_nonces2, h_JackpotFalseFunction[thr_id], threads, startNounce, inpHashes); - cudaStreamSynchronize(NULL); - */ -} - -__host__ -void jackpot_compactTest_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable, - uint32_t *d_nonces1, uint32_t *nrm1, uint32_t *d_nonces2, uint32_t *nrm2, int order) -{ - // Wenn validNonceTable genutzt wird, dann werden auch nur die Nonces betrachtet, die dort enthalten sind - // "threads" ist in diesem Fall auf die Länge dieses Array's zu setzen! - - jackpot_compactTest_cpu_dualCompaction(thr_id, threads, - h_numValid[thr_id], d_nonces1, d_nonces2, - startNounce, inpHashes, d_validNonceTable); - - cudaStreamSynchronize(NULL); // Das original braucht zwar etwas CPU-Last, ist an dieser Stelle aber evtl besser - *nrm1 = h_numValid[thr_id][0]; - *nrm2 = h_numValid[thr_id][1]; -} diff --git a/JHA/cuda_jha_keccak512.cu b/JHA/cuda_jha_keccak512.cu deleted file mode 100644 index a47fec18..00000000 --- a/JHA/cuda_jha_keccak512.cu +++ /dev/null @@ -1,666 +0,0 @@ -#include -#include - -#include "cuda_helper.h" -#include "miner.h" - -// ZR5 -__constant__ uint32_t d_OriginalData[20]; - -__constant__ uint32_t c_PaddedMessage[18]; -__constant__ uint64_t c_State[25]; - -#define U32TO64_LE(p) \ - (((uint64_t)(*p)) | (((uint64_t)(*(p + 1))) << 32)) - -#define U64TO32_LE(p, v) \ - *p = (uint32_t)((v)); *(p+1) = (uint32_t)((v) >> 32); - -static const uint64_t host_keccak_round_constants[24] = { - 0x0000000000000001ull, 0x0000000000008082ull, - 0x800000000000808aull, 0x8000000080008000ull, - 0x000000000000808bull, 0x0000000080000001ull, - 0x8000000080008081ull, 0x8000000000008009ull, - 0x000000000000008aull, 0x0000000000000088ull, - 0x0000000080008009ull, 0x000000008000000aull, - 0x000000008000808bull, 0x800000000000008bull, - 0x8000000000008089ull, 0x8000000000008003ull, - 0x8000000000008002ull, 0x8000000000000080ull, - 0x000000000000800aull, 0x800000008000000aull, - 0x8000000080008081ull, 0x8000000000008080ull, - 0x0000000080000001ull, 0x8000000080008008ull -}; - -__constant__ uint64_t c_keccak_round_constants[24]; - -static __device__ __forceinline__ void -keccak_block(uint64_t *s, const uint32_t *in, const uint64_t *keccak_round_constants) { - size_t i; - uint64_t t[5], u[5], v, w; - - /* absorb input */ - #pragma unroll 9 - for (i = 0; i < 72 / 8; i++, in += 2) - s[i] ^= U32TO64_LE(in); - - for (i = 0; i < 24; i++) { - /* theta: c = a[0,i] ^ a[1,i] ^ .. a[4,i] */ - t[0] = s[0] ^ s[5] ^ s[10] ^ s[15] ^ s[20]; - t[1] = s[1] ^ s[6] ^ s[11] ^ s[16] ^ s[21]; - t[2] = s[2] ^ s[7] ^ s[12] ^ s[17] ^ s[22]; - t[3] = s[3] ^ s[8] ^ s[13] ^ s[18] ^ s[23]; - t[4] = s[4] ^ s[9] ^ s[14] ^ s[19] ^ s[24]; - - /* theta: d[i] = c[i+4] ^ rotl(c[i+1],1) */ - u[0] = t[4] ^ ROTL64(t[1], 1); - u[1] = t[0] ^ ROTL64(t[2], 1); - u[2] = t[1] ^ ROTL64(t[3], 1); - u[3] = t[2] ^ ROTL64(t[4], 1); - u[4] = t[3] ^ ROTL64(t[0], 1); - - /* theta: a[0,i], a[1,i], .. a[4,i] ^= d[i] */ - s[0] ^= u[0]; s[5] ^= u[0]; s[10] ^= u[0]; s[15] ^= u[0]; s[20] ^= u[0]; - s[1] ^= u[1]; s[6] ^= u[1]; s[11] ^= u[1]; s[16] ^= u[1]; s[21] ^= u[1]; - s[2] ^= u[2]; s[7] ^= u[2]; s[12] ^= u[2]; s[17] ^= u[2]; s[22] ^= u[2]; - s[3] ^= u[3]; s[8] ^= u[3]; s[13] ^= u[3]; s[18] ^= u[3]; s[23] ^= u[3]; - s[4] ^= u[4]; s[9] ^= u[4]; s[14] ^= u[4]; s[19] ^= u[4]; s[24] ^= u[4]; - - /* rho pi: b[..] = rotl(a[..], ..) */ - v = s[ 1]; - s[ 1] = ROTL64(s[ 6], 44); - s[ 6] = ROTL64(s[ 9], 20); - s[ 9] = ROTL64(s[22], 61); - s[22] = ROTL64(s[14], 39); - s[14] = ROTL64(s[20], 18); - s[20] = ROTL64(s[ 2], 62); - s[ 2] = ROTL64(s[12], 43); - s[12] = ROTL64(s[13], 25); - s[13] = ROTL64(s[19], 8); - s[19] = ROTL64(s[23], 56); - s[23] = ROTL64(s[15], 41); - s[15] = ROTL64(s[ 4], 27); - s[ 4] = ROTL64(s[24], 14); - s[24] = ROTL64(s[21], 2); - s[21] = ROTL64(s[ 8], 55); - s[ 8] = ROTL64(s[16], 45); - s[16] = ROTL64(s[ 5], 36); - s[ 5] = ROTL64(s[ 3], 28); - s[ 3] = ROTL64(s[18], 21); - s[18] = ROTL64(s[17], 15); - s[17] = ROTL64(s[11], 10); - s[11] = ROTL64(s[ 7], 6); - s[ 7] = ROTL64(s[10], 3); - s[10] = ROTL64( v, 1); - - /* chi: a[i,j] ^= ~b[i,j+1] & b[i,j+2] */ - v = s[ 0]; w = s[ 1]; s[ 0] ^= (~w) & s[ 2]; s[ 1] ^= (~s[ 2]) & s[ 3]; s[ 2] ^= (~s[ 3]) & s[ 4]; s[ 3] ^= (~s[ 4]) & v; s[ 4] ^= (~v) & w; - v = s[ 5]; w = s[ 6]; s[ 5] ^= (~w) & s[ 7]; s[ 6] ^= (~s[ 7]) & s[ 8]; s[ 7] ^= (~s[ 8]) & s[ 9]; s[ 8] ^= (~s[ 9]) & v; s[ 9] ^= (~v) & w; - v = s[10]; w = s[11]; s[10] ^= (~w) & s[12]; s[11] ^= (~s[12]) & s[13]; s[12] ^= (~s[13]) & s[14]; s[13] ^= (~s[14]) & v; s[14] ^= (~v) & w; - v = s[15]; w = s[16]; s[15] ^= (~w) & s[17]; s[16] ^= (~s[17]) & s[18]; s[17] ^= (~s[18]) & s[19]; s[18] ^= (~s[19]) & v; s[19] ^= (~v) & w; - v = s[20]; w = s[21]; s[20] ^= (~w) & s[22]; s[21] ^= (~s[22]) & s[23]; s[22] ^= (~s[23]) & s[24]; s[23] ^= (~s[24]) & v; s[24] ^= (~v) & w; - - /* iota: a[0,0] ^= round constant */ - s[0] ^= keccak_round_constants[i]; - } -} - -// Setup-Funktionen -__host__ -void jackpot_keccak512_cpu_init(int thr_id, uint32_t threads) -{ - // Kopiere die Hash-Tabellen in den GPU-Speicher - cudaMemcpyToSymbol( c_keccak_round_constants, - host_keccak_round_constants, - sizeof(host_keccak_round_constants), - 0, cudaMemcpyHostToDevice); -} - -#define cKeccakB 1600 -#define cKeccakR 576 - -#define cKeccakR_SizeInBytes (cKeccakR / 8) -#define crypto_hash_BYTES 64 - -#if (cKeccakB == 1600) - typedef unsigned long long UINT64; - typedef UINT64 tKeccakLane; - #define cKeccakNumberOfRounds 24 -#endif - -#define cKeccakLaneSizeInBits (sizeof(tKeccakLane) * 8) - -#define ROL(a, offset) ((((tKeccakLane)a) << ((offset) % cKeccakLaneSizeInBits)) ^ (((tKeccakLane)a) >> (cKeccakLaneSizeInBits-((offset) % cKeccakLaneSizeInBits)))) -#if ((cKeccakB/25) == 8) - #define ROL_mult8(a, offset) ((tKeccakLane)a) -#else - #define ROL_mult8(a, offset) ROL(a, offset) -#endif - -const tKeccakLane KeccakF_RoundConstants[cKeccakNumberOfRounds] = { - (tKeccakLane)0x0000000000000001ULL, - (tKeccakLane)0x0000000000008082ULL, - (tKeccakLane)0x800000000000808aULL, - (tKeccakLane)0x8000000080008000ULL, - (tKeccakLane)0x000000000000808bULL, - (tKeccakLane)0x0000000080000001ULL, - (tKeccakLane)0x8000000080008081ULL, - (tKeccakLane)0x8000000000008009ULL, - (tKeccakLane)0x000000000000008aULL, - (tKeccakLane)0x0000000000000088ULL, - (tKeccakLane)0x0000000080008009ULL, - (tKeccakLane)0x000000008000000aULL, - (tKeccakLane)0x000000008000808bULL, - (tKeccakLane)0x800000000000008bULL, - (tKeccakLane)0x8000000000008089ULL, - (tKeccakLane)0x8000000000008003ULL, - (tKeccakLane)0x8000000000008002ULL, - (tKeccakLane)0x8000000000000080ULL -#if (cKeccakB >= 400) - , (tKeccakLane)0x000000000000800aULL, - (tKeccakLane)0x800000008000000aULL -#if (cKeccakB >= 800) - , (tKeccakLane)0x8000000080008081ULL, - (tKeccakLane)0x8000000000008080ULL -#if (cKeccakB == 1600) - , (tKeccakLane)0x0000000080000001ULL, - (tKeccakLane)0x8000000080008008ULL -#endif -#endif -#endif -}; - -void KeccakF(tKeccakLane * state, const tKeccakLane *in, int laneCount) -{ - while ( --laneCount >= 0 ) { - state[laneCount] ^= in[laneCount]; - } - - { - tKeccakLane Aba, Abe, Abi, Abo, Abu; - tKeccakLane Aga, Age, Agi, Ago, Agu; - tKeccakLane Aka, Ake, Aki, Ako, Aku; - tKeccakLane Ama, Ame, Ami, Amo, Amu; - tKeccakLane Asa, Ase, Asi, Aso, Asu; - tKeccakLane BCa, BCe, BCi, BCo, BCu; - tKeccakLane Da, De, Di, Do, Du; - tKeccakLane Eba, Ebe, Ebi, Ebo, Ebu; - tKeccakLane Ega, Ege, Egi, Ego, Egu; - tKeccakLane Eka, Eke, Eki, Eko, Eku; - tKeccakLane Ema, Eme, Emi, Emo, Emu; - tKeccakLane Esa, Ese, Esi, Eso, Esu; - #define round laneCount - - //copyFromState(A, state) - Aba = state[ 0]; - Abe = state[ 1]; - Abi = state[ 2]; - Abo = state[ 3]; - Abu = state[ 4]; - Aga = state[ 5]; - Age = state[ 6]; - Agi = state[ 7]; - Ago = state[ 8]; - Agu = state[ 9]; - Aka = state[10]; - Ake = state[11]; - Aki = state[12]; - Ako = state[13]; - Aku = state[14]; - Ama = state[15]; - Ame = state[16]; - Ami = state[17]; - Amo = state[18]; - Amu = state[19]; - Asa = state[20]; - Ase = state[21]; - Asi = state[22]; - Aso = state[23]; - Asu = state[24]; - - for( round = 0; round < cKeccakNumberOfRounds; round += 2 ) - { - // prepareTheta - BCa = Aba^Aga^Aka^Ama^Asa; - BCe = Abe^Age^Ake^Ame^Ase; - BCi = Abi^Agi^Aki^Ami^Asi; - BCo = Abo^Ago^Ako^Amo^Aso; - BCu = Abu^Agu^Aku^Amu^Asu; - - //thetaRhoPiChiIotaPrepareTheta(round , A, E) - Da = BCu^ROL(BCe, 1); - De = BCa^ROL(BCi, 1); - Di = BCe^ROL(BCo, 1); - Do = BCi^ROL(BCu, 1); - Du = BCo^ROL(BCa, 1); - - Aba ^= Da; - BCa = Aba; - Age ^= De; - BCe = ROL(Age, 44); - Aki ^= Di; - BCi = ROL(Aki, 43); - Amo ^= Do; - BCo = ROL(Amo, 21); - Asu ^= Du; - BCu = ROL(Asu, 14); - Eba = BCa ^((~BCe)& BCi ); - Eba ^= (tKeccakLane)KeccakF_RoundConstants[round]; - Ebe = BCe ^((~BCi)& BCo ); - Ebi = BCi ^((~BCo)& BCu ); - Ebo = BCo ^((~BCu)& BCa ); - Ebu = BCu ^((~BCa)& BCe ); - - Abo ^= Do; - BCa = ROL(Abo, 28); - Agu ^= Du; - BCe = ROL(Agu, 20); - Aka ^= Da; - BCi = ROL(Aka, 3); - Ame ^= De; - BCo = ROL(Ame, 45); - Asi ^= Di; - BCu = ROL(Asi, 61); - Ega = BCa ^((~BCe)& BCi ); - Ege = BCe ^((~BCi)& BCo ); - Egi = BCi ^((~BCo)& BCu ); - Ego = BCo ^((~BCu)& BCa ); - Egu = BCu ^((~BCa)& BCe ); - - Abe ^= De; - BCa = ROL(Abe, 1); - Agi ^= Di; - BCe = ROL(Agi, 6); - Ako ^= Do; - BCi = ROL(Ako, 25); - Amu ^= Du; - BCo = ROL_mult8(Amu, 8); - Asa ^= Da; - BCu = ROL(Asa, 18); - Eka = BCa ^((~BCe)& BCi ); - Eke = BCe ^((~BCi)& BCo ); - Eki = BCi ^((~BCo)& BCu ); - Eko = BCo ^((~BCu)& BCa ); - Eku = BCu ^((~BCa)& BCe ); - - Abu ^= Du; - BCa = ROL(Abu, 27); - Aga ^= Da; - BCe = ROL(Aga, 36); - Ake ^= De; - BCi = ROL(Ake, 10); - Ami ^= Di; - BCo = ROL(Ami, 15); - Aso ^= Do; - BCu = ROL_mult8(Aso, 56); - Ema = BCa ^((~BCe)& BCi ); - Eme = BCe ^((~BCi)& BCo ); - Emi = BCi ^((~BCo)& BCu ); - Emo = BCo ^((~BCu)& BCa ); - Emu = BCu ^((~BCa)& BCe ); - - Abi ^= Di; - BCa = ROL(Abi, 62); - Ago ^= Do; - BCe = ROL(Ago, 55); - Aku ^= Du; - BCi = ROL(Aku, 39); - Ama ^= Da; - BCo = ROL(Ama, 41); - Ase ^= De; - BCu = ROL(Ase, 2); - Esa = BCa ^((~BCe)& BCi ); - Ese = BCe ^((~BCi)& BCo ); - Esi = BCi ^((~BCo)& BCu ); - Eso = BCo ^((~BCu)& BCa ); - Esu = BCu ^((~BCa)& BCe ); - - // prepareTheta - BCa = Eba^Ega^Eka^Ema^Esa; - BCe = Ebe^Ege^Eke^Eme^Ese; - BCi = Ebi^Egi^Eki^Emi^Esi; - BCo = Ebo^Ego^Eko^Emo^Eso; - BCu = Ebu^Egu^Eku^Emu^Esu; - - //thetaRhoPiChiIotaPrepareTheta(round+1, E, A) - Da = BCu^ROL(BCe, 1); - De = BCa^ROL(BCi, 1); - Di = BCe^ROL(BCo, 1); - Do = BCi^ROL(BCu, 1); - Du = BCo^ROL(BCa, 1); - - Eba ^= Da; - BCa = Eba; - Ege ^= De; - BCe = ROL(Ege, 44); - Eki ^= Di; - BCi = ROL(Eki, 43); - Emo ^= Do; - BCo = ROL(Emo, 21); - Esu ^= Du; - BCu = ROL(Esu, 14); - Aba = BCa ^((~BCe)& BCi ); - Aba ^= (tKeccakLane)KeccakF_RoundConstants[round+1]; - Abe = BCe ^((~BCi)& BCo ); - Abi = BCi ^((~BCo)& BCu ); - Abo = BCo ^((~BCu)& BCa ); - Abu = BCu ^((~BCa)& BCe ); - - Ebo ^= Do; - BCa = ROL(Ebo, 28); - Egu ^= Du; - BCe = ROL(Egu, 20); - Eka ^= Da; - BCi = ROL(Eka, 3); - Eme ^= De; - BCo = ROL(Eme, 45); - Esi ^= Di; - BCu = ROL(Esi, 61); - Aga = BCa ^((~BCe)& BCi ); - Age = BCe ^((~BCi)& BCo ); - Agi = BCi ^((~BCo)& BCu ); - Ago = BCo ^((~BCu)& BCa ); - Agu = BCu ^((~BCa)& BCe ); - - Ebe ^= De; - BCa = ROL(Ebe, 1); - Egi ^= Di; - BCe = ROL(Egi, 6); - Eko ^= Do; - BCi = ROL(Eko, 25); - Emu ^= Du; - BCo = ROL_mult8(Emu, 8); - Esa ^= Da; - BCu = ROL(Esa, 18); - Aka = BCa ^((~BCe)& BCi ); - Ake = BCe ^((~BCi)& BCo ); - Aki = BCi ^((~BCo)& BCu ); - Ako = BCo ^((~BCu)& BCa ); - Aku = BCu ^((~BCa)& BCe ); - - Ebu ^= Du; - BCa = ROL(Ebu, 27); - Ega ^= Da; - BCe = ROL(Ega, 36); - Eke ^= De; - BCi = ROL(Eke, 10); - Emi ^= Di; - BCo = ROL(Emi, 15); - Eso ^= Do; - BCu = ROL_mult8(Eso, 56); - Ama = BCa ^((~BCe)& BCi ); - Ame = BCe ^((~BCi)& BCo ); - Ami = BCi ^((~BCo)& BCu ); - Amo = BCo ^((~BCu)& BCa ); - Amu = BCu ^((~BCa)& BCe ); - - Ebi ^= Di; - BCa = ROL(Ebi, 62); - Ego ^= Do; - BCe = ROL(Ego, 55); - Eku ^= Du; - BCi = ROL(Eku, 39); - Ema ^= Da; - BCo = ROL(Ema, 41); - Ese ^= De; - BCu = ROL(Ese, 2); - Asa = BCa ^((~BCe)& BCi ); - Ase = BCe ^((~BCi)& BCo ); - Asi = BCi ^((~BCo)& BCu ); - Aso = BCo ^((~BCu)& BCa ); - Asu = BCu ^((~BCa)& BCe ); - } - - //copyToState(state, A) - state[ 0] = Aba; - state[ 1] = Abe; - state[ 2] = Abi; - state[ 3] = Abo; - state[ 4] = Abu; - state[ 5] = Aga; - state[ 6] = Age; - state[ 7] = Agi; - state[ 8] = Ago; - state[ 9] = Agu; - state[10] = Aka; - state[11] = Ake; - state[12] = Aki; - state[13] = Ako; - state[14] = Aku; - state[15] = Ama; - state[16] = Ame; - state[17] = Ami; - state[18] = Amo; - state[19] = Amu; - state[20] = Asa; - state[21] = Ase; - state[22] = Asi; - state[23] = Aso; - state[24] = Asu; - - #undef round - } -} - -// inlen kann 72...143 betragen -__host__ -void jackpot_keccak512_cpu_setBlock(void *pdata, size_t inlen) -{ - const unsigned char *in = (const unsigned char*)pdata; - - tKeccakLane state[5 * 5]; - unsigned char temp[cKeccakR_SizeInBytes]; - - memset( state, 0, sizeof(state) ); - - for ( /* empty */; inlen >= cKeccakR_SizeInBytes; inlen -= cKeccakR_SizeInBytes, in += cKeccakR_SizeInBytes) - { - KeccakF( state, (const tKeccakLane*)in, cKeccakR_SizeInBytes / sizeof(tKeccakLane) ); - } - - // Copy state of the first round (72 Bytes) - // in Constant Memory - cudaMemcpyToSymbol( c_State, - state, - sizeof(state), - 0, cudaMemcpyHostToDevice); - - // second part - memcpy(temp, in, inlen); - temp[inlen++] = 1; - memset(temp + inlen, 0, cKeccakR_SizeInBytes - inlen); - temp[cKeccakR_SizeInBytes-1] |= 0x80; - - // Copy rest of the message in constant memory - cudaMemcpyToSymbol( c_PaddedMessage, - temp, - cKeccakR_SizeInBytes, - 0, cudaMemcpyHostToDevice); -} - -__global__ -void jackpot_keccak512_gpu_hash(uint32_t threads, uint32_t startNounce, uint64_t *g_hash) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t nounce = startNounce + thread; - - int hashPosition = nounce - startNounce; - - uint32_t message[18]; - #pragma unroll 18 - for(int i=0;i<18;i++) - message[i] = c_PaddedMessage[i]; - - message[1] = cuda_swab32(nounce); - - // State init - uint64_t keccak_gpu_state[25]; - #pragma unroll 25 - for (int i=0; i<25; i++) - keccak_gpu_state[i] = c_State[i]; - - // den Block einmal gut durchschütteln - keccak_block(keccak_gpu_state, message, c_keccak_round_constants); - - uint32_t hash[16]; - - #pragma unroll 8 - for (size_t i = 0; i < 64; i += 8) { - U64TO32_LE((&hash[i/4]), keccak_gpu_state[i / 8]); - } - - // copy hash - uint32_t *outpHash = (uint32_t*)&g_hash[8 * hashPosition]; - - #pragma unroll 16 - for(int i=0;i<16;i++) - outpHash[i] = hash[i]; - } -} - -__host__ -void jackpot_keccak512_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, int order) -{ - const uint32_t threadsperblock = 256; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - size_t shared_size = 0; - - jackpot_keccak512_gpu_hash<<>>(threads, startNounce, (uint64_t*)d_hash); - //MyStreamSynchronize(NULL, order, thr_id); -} - - -/* zr5 keccak, no nonce swab32 */ - -__global__ -void zr5_keccak512_gpu_hash(uint32_t threads, uint32_t startNounce, uint64_t *g_hash) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t nounce = startNounce + thread; - uint32_t message[18]; - - #pragma unroll 18 - for(int i=0; i<18; i++) - message[i] = c_PaddedMessage[i]; - - message[1] = nounce; - - // Get mid-state - uint64_t keccak_gpu_state[25]; - #pragma unroll 25 - for (int i=0; i<25; i++) - keccak_gpu_state[i] = c_State[i]; - - keccak_block(keccak_gpu_state, message, c_keccak_round_constants); - - uint32_t hash[16]; - - #pragma unroll 8 - for (int i = 0; i < 8; i++) { - U64TO32_LE((&hash[i*2]), keccak_gpu_state[i]); - } - - // Output (64 bytes hash required) - uint32_t hashPosition = nounce - startNounce; - //uint32_t *outpHash = (uint32_t*) (&g_hash[hashPosition*8]); - //#pragma unroll 16 - //for(int i=0; i<16; i++) - // outpHash[i] = hash[i]; - - uint4 *outpHash = (uint4*) (&g_hash[hashPosition*8]); - uint4 *psrc = (uint4*) hash; - outpHash[0] = psrc[0]; - outpHash[1] = psrc[1]; - outpHash[2] = psrc[2]; - outpHash[3] = psrc[3]; - } -} - -__host__ -void zr5_keccak512_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash) -{ - const uint32_t threadsperblock = 256; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - zr5_keccak512_gpu_hash<<>>(threads, startNounce, (uint64_t*)d_hash); - //MyStreamSynchronize(NULL, 0, thr_id); -} - -/* required for the second hash part of zr5 */ - -__global__ -void zr5_keccak512_gpu_hash_pok(uint32_t threads, uint32_t startNounce, uint32_t *g_hash, uint16_t *d_poks, uint32_t version) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t nounce = startNounce + thread; - - uint32_t message[18]; /* 72 bytes */ - - // pok - hash[0] from prev hash - message[0] = version | (0x10000UL * d_poks[thread]); - #pragma unroll - for (int i=1; i<18; i++) { - message[i]=d_OriginalData[i]; - } - - // first bloc - uint64_t keccak_gpu_state[25] = { 0 }; - keccak_block(keccak_gpu_state, message, c_keccak_round_constants); - - // second bloc - message[0] = d_OriginalData[18]; - message[1] = nounce; //cuda_swab32(nounce); - message[2] = 1; - - #pragma unroll - for(int i=3; i<17; i++) - message[i] = 0; - - message[17] = 0x80000000UL; - - keccak_block(keccak_gpu_state, message, c_keccak_round_constants); - - uint32_t hash[16]; - - #pragma unroll 8 - for (size_t i = 0; i < 8; i++) { - U64TO32_LE((&hash[i*2]), keccak_gpu_state[i]); - } - - //uint32_t *outpHash = &g_hash[thread * 16]; - //#pragma unroll 16 - //for(int i=0; i<16; i++) - // outpHash[i] = hash[i]; - - uint4 *outpHash = (uint4*) (&g_hash[thread * 16]); - uint4 *psrc = (uint4*) hash; - outpHash[0] = psrc[0]; - outpHash[1] = psrc[1]; - outpHash[2] = psrc[2]; - outpHash[3] = psrc[3]; - } -} - -__host__ -void zr5_keccak512_cpu_hash_pok(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t* pdata, uint32_t *d_hash, uint16_t *d_poks) -{ - const uint32_t threadsperblock = 256; - const uint32_t version = (pdata[0] & (~POK_DATA_MASK)) | (use_pok ? POK_BOOL_MASK : 0); - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - cudaMemcpyToSymbol(d_OriginalData, pdata, sizeof(d_OriginalData), 0, cudaMemcpyHostToDevice); - zr5_keccak512_gpu_hash_pok<<>>(threads, startNounce, d_hash, d_poks, version); - //MyStreamSynchronize(NULL, 10, thr_id); -} diff --git a/JHA/jackpotcoin.cu b/JHA/jackpotcoin.cu deleted file mode 100644 index 78e5bd02..00000000 --- a/JHA/jackpotcoin.cu +++ /dev/null @@ -1,295 +0,0 @@ -extern "C" -{ -#include "sph/sph_keccak.h" -#include "sph/sph_blake.h" -#include "sph/sph_groestl.h" -#include "sph/sph_jh.h" -#include "sph/sph_skein.h" -} - -#include "miner.h" -#include "cuda_helper.h" -#include "quark/cuda_quark.h" - -static uint32_t *d_hash[MAX_GPUS] = { 0 }; - -// Speicher zur Generierung der Noncevektoren für die bedingten Hashes -static uint32_t *d_jackpotNonces[MAX_GPUS] = { 0 }; -static uint32_t *d_branch1Nonces[MAX_GPUS] = { 0 }; -static uint32_t *d_branch2Nonces[MAX_GPUS] = { 0 }; -static uint32_t *d_branch3Nonces[MAX_GPUS] = { 0 }; - -extern void jackpot_keccak512_cpu_init(int thr_id, uint32_t threads); -extern void jackpot_keccak512_cpu_setBlock(void *pdata, size_t inlen); -extern void jackpot_keccak512_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, int order); - -extern void jackpot_compactTest_cpu_init(int thr_id, uint32_t threads); -extern void jackpot_compactTest_cpu_free(int thr_id); -extern void jackpot_compactTest_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable, - uint32_t *d_nonces1, uint32_t *nrm1, uint32_t *d_nonces2, uint32_t *nrm2, int order); - -extern uint32_t cuda_check_hash_branch(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_inputHash, int order); - -// CPU HASH JHA v8 -extern "C" void jackpothash(void *state, const void *input) -{ - uint32_t hash[16]; - unsigned int rnd; - - sph_blake512_context ctx_blake; - sph_groestl512_context ctx_groestl; - sph_jh512_context ctx_jh; - sph_keccak512_context ctx_keccak; - sph_skein512_context ctx_skein; - - sph_keccak512_init(&ctx_keccak); - sph_keccak512 (&ctx_keccak, input, 80); - sph_keccak512_close(&ctx_keccak, hash); - - for (rnd = 0; rnd < 3; rnd++) - { - if (hash[0] & 0x01) { - sph_groestl512_init(&ctx_groestl); - sph_groestl512 (&ctx_groestl, (&hash), 64); - sph_groestl512_close(&ctx_groestl, (&hash)); - } - else { - sph_skein512_init(&ctx_skein); - sph_skein512 (&ctx_skein, (&hash), 64); - sph_skein512_close(&ctx_skein, (&hash)); - } - - if (hash[0] & 0x01) { - sph_blake512_init(&ctx_blake); - sph_blake512 (&ctx_blake, (&hash), 64); - sph_blake512_close(&ctx_blake, (&hash)); - } - else { - sph_jh512_init(&ctx_jh); - sph_jh512 (&ctx_jh, (&hash), 64); - sph_jh512_close(&ctx_jh, (&hash)); - } - } - memcpy(state, hash, 32); -} - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_jackpot(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t _ALIGN(64) endiandata[22]; - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - int dev_id = device_map[thr_id]; - - uint32_t throughput = cuda_default_throughput(thr_id, 1U << 20); - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ptarget[7] = 0x000f; - - if (!init[thr_id]) - { - cudaSetDevice(dev_id); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - cuda_get_arch(thr_id); - if (device_sm[dev_id] < 300 || cuda_arch[dev_id] < 300) { - gpulog(LOG_ERR, thr_id, "Sorry, This algo is not supported by this GPU arch (SM 3.0 required)"); - proper_exit(EXIT_CODE_CUDA_ERROR); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - CUDA_SAFE_CALL(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput)); - - jackpot_keccak512_cpu_init(thr_id, throughput); - jackpot_compactTest_cpu_init(thr_id, throughput); - quark_blake512_cpu_init(thr_id, throughput); - quark_groestl512_cpu_init(thr_id, throughput); - quark_jh512_cpu_init(thr_id, throughput); - quark_skein512_cpu_init(thr_id, throughput); - - cuda_check_cpu_init(thr_id, throughput); - - cudaMalloc(&d_branch1Nonces[thr_id], (size_t) sizeof(uint32_t)*throughput*2); - cudaMalloc(&d_branch2Nonces[thr_id], (size_t) sizeof(uint32_t)*throughput*2); - cudaMalloc(&d_branch3Nonces[thr_id], (size_t) sizeof(uint32_t)*throughput*2); - - CUDA_SAFE_CALL(cudaMalloc(&d_jackpotNonces[thr_id], (size_t) sizeof(uint32_t)*throughput*2)); - - init[thr_id] = true; - } - - for (int k=0; k < 22; k++) - be32enc(&endiandata[k], pdata[k]); - - jackpot_keccak512_cpu_setBlock((void*)endiandata, 80); - cuda_check_cpu_setTarget(ptarget); - - do { - int order = 0; - - // erstes Keccak512 Hash mit CUDA - jackpot_keccak512_cpu_hash(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - - uint32_t nrm1, nrm2, nrm3; - - // Runde 1 (ohne Gröstl) - - jackpot_compactTest_cpu_hash_64(thr_id, throughput, pdata[19], d_hash[thr_id], NULL, - d_branch1Nonces[thr_id], &nrm1, - d_branch3Nonces[thr_id], &nrm3, - order++); - - // verfolge den skein-pfad weiter - quark_skein512_cpu_hash_64(thr_id, nrm3, pdata[19], d_branch3Nonces[thr_id], d_hash[thr_id], order++); - - // noch schnell Blake & JH - jackpot_compactTest_cpu_hash_64(thr_id, nrm3, pdata[19], d_hash[thr_id], d_branch3Nonces[thr_id], - d_branch1Nonces[thr_id], &nrm1, - d_branch2Nonces[thr_id], &nrm2, - order++); - - if (nrm1+nrm2 == nrm3) { - quark_blake512_cpu_hash_64(thr_id, nrm1, pdata[19], d_branch1Nonces[thr_id], d_hash[thr_id], order++); - quark_jh512_cpu_hash_64(thr_id, nrm2, pdata[19], d_branch2Nonces[thr_id], d_hash[thr_id], order++); - } - - // Runde 3 (komplett) - - // jackpotNonces in branch1/2 aufsplitten gemäss if (hash[0] & 0x01) - jackpot_compactTest_cpu_hash_64(thr_id, nrm3, pdata[19], d_hash[thr_id], d_branch3Nonces[thr_id], - d_branch1Nonces[thr_id], &nrm1, - d_branch2Nonces[thr_id], &nrm2, - order++); - - if (nrm1+nrm2 == nrm3) { - quark_groestl512_cpu_hash_64(thr_id, nrm1, pdata[19], d_branch1Nonces[thr_id], d_hash[thr_id], order++); - quark_skein512_cpu_hash_64(thr_id, nrm2, pdata[19], d_branch2Nonces[thr_id], d_hash[thr_id], order++); - } - - // jackpotNonces in branch1/2 aufsplitten gemäss if (hash[0] & 0x01) - jackpot_compactTest_cpu_hash_64(thr_id, nrm3, pdata[19], d_hash[thr_id], d_branch3Nonces[thr_id], - d_branch1Nonces[thr_id], &nrm1, - d_branch2Nonces[thr_id], &nrm2, - order++); - - if (nrm1+nrm2 == nrm3) { - quark_blake512_cpu_hash_64(thr_id, nrm1, pdata[19], d_branch1Nonces[thr_id], d_hash[thr_id], order++); - quark_jh512_cpu_hash_64(thr_id, nrm2, pdata[19], d_branch2Nonces[thr_id], d_hash[thr_id], order++); - } - - // Runde 3 (komplett) - - // jackpotNonces in branch1/2 aufsplitten gemäss if (hash[0] & 0x01) - jackpot_compactTest_cpu_hash_64(thr_id, nrm3, pdata[19], d_hash[thr_id], d_branch3Nonces[thr_id], - d_branch1Nonces[thr_id], &nrm1, - d_branch2Nonces[thr_id], &nrm2, - order++); - - if (nrm1+nrm2 == nrm3) { - quark_groestl512_cpu_hash_64(thr_id, nrm1, pdata[19], d_branch1Nonces[thr_id], d_hash[thr_id], order++); - quark_skein512_cpu_hash_64(thr_id, nrm2, pdata[19], d_branch2Nonces[thr_id], d_hash[thr_id], order++); - } - - // jackpotNonces in branch1/2 aufsplitten gemäss if (hash[0] & 0x01) - jackpot_compactTest_cpu_hash_64(thr_id, nrm3, pdata[19], d_hash[thr_id], d_branch3Nonces[thr_id], - d_branch1Nonces[thr_id], &nrm1, - d_branch2Nonces[thr_id], &nrm2, - order++); - - if (nrm1+nrm2 == nrm3) { - quark_blake512_cpu_hash_64(thr_id, nrm1, pdata[19], d_branch1Nonces[thr_id], d_hash[thr_id], order++); - quark_jh512_cpu_hash_64(thr_id, nrm2, pdata[19], d_branch2Nonces[thr_id], d_hash[thr_id], order++); - } - - *hashes_done = pdata[19] - first_nonce + throughput; - - CUDA_LOG_ERROR(); - - work->nonces[0] = cuda_check_hash_branch(thr_id, nrm3, pdata[19], d_branch3Nonces[thr_id], d_hash[thr_id], order++); - - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - be32enc(&endiandata[19], work->nonces[0]); - - // jackpothash function gibt die Zahl der Runden zurück - jackpothash(vhash, endiandata); - - if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); -#if 0 - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - jackpothash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } -#else - pdata[19] = work->nonces[0] + 1; // cursor -#endif - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - - CUDA_LOG_ERROR(); - - return 0; -} - -// cleanup -extern "C" void free_jackpot(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_branch1Nonces[thr_id]); - cudaFree(d_branch2Nonces[thr_id]); - cudaFree(d_branch3Nonces[thr_id]); - cudaFree(d_jackpotNonces[thr_id]); - - quark_blake512_cpu_free(thr_id); - quark_groestl512_cpu_free(thr_id); - jackpot_compactTest_cpu_free(thr_id); - - cudaFree(d_hash[thr_id]); - - cuda_check_cpu_free(thr_id); - CUDA_LOG_ERROR(); - - cudaDeviceSynchronize(); - - init[thr_id] = false; -} diff --git a/JHA/jha.cu b/JHA/jha.cu deleted file mode 100644 index ec7895c1..00000000 --- a/JHA/jha.cu +++ /dev/null @@ -1,265 +0,0 @@ -/** - * JHA v8 algorithm - compatible implementation - * @author tpruvot@github 05-2017 - */ - -extern "C" { -#include "sph/sph_keccak.h" -#include "sph/sph_blake.h" -#include "sph/sph_groestl.h" -#include "sph/sph_jh.h" -#include "sph/sph_skein.h" -} - -#include "miner.h" -#include "cuda_helper.h" -#include "quark/cuda_quark.h" - -static uint32_t *d_hash[MAX_GPUS] = { 0 }; -static uint32_t *d_hash_br2[MAX_GPUS]; -static uint32_t *d_tempBranch[MAX_GPUS]; - -extern void jackpot_keccak512_cpu_init(int thr_id, uint32_t threads); -extern void jackpot_keccak512_cpu_setBlock(void *pdata, size_t inlen); -extern void jackpot_keccak512_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, int order); - -// CPU HASH -extern "C" void jha_hash(void *output, const void *input) -{ - uint32_t hash[16]; - - sph_blake512_context ctx_blake; - sph_groestl512_context ctx_groestl; - sph_jh512_context ctx_jh; - sph_keccak512_context ctx_keccak; - sph_skein512_context ctx_skein; - - sph_keccak512_init(&ctx_keccak); - sph_keccak512 (&ctx_keccak, input, 80); - sph_keccak512_close(&ctx_keccak, hash); - - for (int rnd = 0; rnd < 3; rnd++) - { - if (hash[0] & 0x01) { - sph_groestl512_init(&ctx_groestl); - sph_groestl512 (&ctx_groestl, (&hash), 64); - sph_groestl512_close(&ctx_groestl, (&hash)); - } - else { - sph_skein512_init(&ctx_skein); - sph_skein512 (&ctx_skein, (&hash), 64); - sph_skein512_close(&ctx_skein, (&hash)); - } - - if (hash[0] & 0x01) { - sph_blake512_init(&ctx_blake); - sph_blake512 (&ctx_blake, (&hash), 64); - sph_blake512_close(&ctx_blake, (&hash)); - } - else { - sph_jh512_init(&ctx_jh); - sph_jh512 (&ctx_jh, (&hash), 64); - sph_jh512_close(&ctx_jh, (&hash)); - } - } - memcpy(output, hash, 32); -} - -__global__ __launch_bounds__(128, 8) -void jha_filter_gpu(const uint32_t threads, const uint32_t* d_hash, uint32_t* d_branch2, uint32_t* d_NonceBranch) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const uint32_t offset = thread * 16U; // 64U / sizeof(uint32_t); - uint4 *psrc = (uint4*) (&d_hash[offset]); - d_NonceBranch[thread] = ((uint8_t*)psrc)[0] & 0x01; - if (d_NonceBranch[thread]) return; - // uint4 = 4x uint32_t = 16 bytes - uint4 *pdst = (uint4*) (&d_branch2[offset]); - pdst[0] = psrc[0]; - pdst[1] = psrc[1]; - pdst[2] = psrc[2]; - pdst[3] = psrc[3]; - } -} - -__global__ __launch_bounds__(128, 8) -void jha_merge_gpu(const uint32_t threads, uint32_t* d_hash, uint32_t* d_branch2, uint32_t* const d_NonceBranch) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads && !d_NonceBranch[thread]) - { - const uint32_t offset = thread * 16U; - uint4 *pdst = (uint4*) (&d_hash[offset]); - uint4 *psrc = (uint4*) (&d_branch2[offset]); - pdst[0] = psrc[0]; - pdst[1] = psrc[1]; - pdst[2] = psrc[2]; - pdst[3] = psrc[3]; - } -} - -__host__ -uint32_t jha_filter_cpu(const int thr_id, const uint32_t threads, const uint32_t *inpHashes, uint32_t* d_branch2) -{ - const uint32_t threadsperblock = 128; - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - // extract algo permution hashes to a second branch buffer - jha_filter_gpu <<>> (threads, inpHashes, d_branch2, d_tempBranch[thr_id]); - return threads; -} - -__host__ -void jha_merge_cpu(const int thr_id, const uint32_t threads, uint32_t *outpHashes, uint32_t* d_branch2) -{ - const uint32_t threadsperblock = 128; - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - // put back second branch hashes to the common buffer d_hash - jha_merge_gpu <<>> (threads, outpHashes, d_branch2, d_tempBranch[thr_id]); -} - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_jha(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t _ALIGN(64) endiandata[22]; - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - int dev_id = device_map[thr_id]; - - uint32_t throughput = cuda_default_throughput(thr_id, 1U << 20); - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ptarget[7] = 0x000f; - - if (!init[thr_id]) - { - cudaSetDevice(dev_id); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - cuda_get_arch(thr_id); - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - CUDA_SAFE_CALL(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput)); - CUDA_SAFE_CALL(cudaMalloc(&d_hash_br2[thr_id], (size_t) 64 * throughput)); - CUDA_SAFE_CALL(cudaMalloc(&d_tempBranch[thr_id], sizeof(uint32_t) * throughput)); - - jackpot_keccak512_cpu_init(thr_id, throughput); - quark_blake512_cpu_init(thr_id, throughput); - quark_groestl512_cpu_init(thr_id, throughput); - quark_jh512_cpu_init(thr_id, throughput); - quark_skein512_cpu_init(thr_id, throughput); - - cuda_check_cpu_init(thr_id, throughput); - - init[thr_id] = true; - } - - for (int k=0; k < 22; k++) - be32enc(&endiandata[k], pdata[k]); - - jackpot_keccak512_cpu_setBlock((void*)endiandata, 80); - cuda_check_cpu_setTarget(ptarget); - - do { - int order = 0; - - jackpot_keccak512_cpu_hash(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - - for (int rnd = 0; rnd < 3; rnd++) - { - jha_filter_cpu(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - quark_groestl512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash_br2[thr_id], order++); - jha_merge_cpu(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - - jha_filter_cpu(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - quark_blake512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_jh512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash_br2[thr_id], order++); - jha_merge_cpu(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - } - - *hashes_done = pdata[19] - first_nonce + throughput; - - CUDA_LOG_ERROR(); - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - - be32enc(&endiandata[19], work->nonces[0]); - jha_hash(vhash, endiandata); - - if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - jha_hash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - - CUDA_LOG_ERROR(); - - return 0; -} - -// cleanup -extern "C" void free_jha(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - cudaFree(d_hash_br2[thr_id]); - cudaFree(d_tempBranch[thr_id]); - - quark_blake512_cpu_free(thr_id); - quark_groestl512_cpu_free(thr_id); - - cuda_check_cpu_free(thr_id); - CUDA_LOG_ERROR(); - - cudaDeviceSynchronize(); - init[thr_id] = false; -} diff --git a/Makefile.am b/Makefile.am index b911b92c..e3ac1591 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,7 +7,7 @@ else JANSSON_INCLUDES= endif -EXTRA_DIST = autogen.sh README.md README.txt LICENSE.txt \ +EXTRA_DIST = autogen.sh README.md README.txt LICENSE.txt \ ccminer.sln ccminer.vcxproj ccminer.vcxproj.filters \ compat/gettimeofday.c compat/getopt/getopt_long.c @@ -18,76 +18,16 @@ bin_PROGRAMS = ccminer ccminer_SOURCES = elist.h miner.h compat.h \ compat/inttypes.h compat/stdbool.h compat/unistd.h \ compat/sys/time.h compat/getopt/getopt.h \ - crc32.c hefty1.c \ + crc32.c \ ccminer.cpp pools.cpp util.cpp bench.cpp bignum.cpp \ api.cpp hashlog.cpp nvml.cpp stats.cpp sysinfos.cpp cuda.cpp \ nvsettings.cpp \ - equi/equi-stratum.cpp equi/equi.cpp equi/blake2/blake2bx.cpp \ - equi/equihash.cpp equi/cuda_equi.cu \ - heavy/heavy.cu \ - heavy/cuda_blake512.cu heavy/cuda_blake512.h \ - heavy/cuda_combine.cu heavy/cuda_combine.h \ - heavy/cuda_groestl512.cu heavy/cuda_groestl512.h \ - heavy/cuda_hefty1.cu heavy/cuda_hefty1.h \ - heavy/cuda_keccak512.cu heavy/cuda_keccak512.h \ - heavy/cuda_sha256.cu heavy/cuda_sha256.h \ - heavy/bastion.cu heavy/cuda_bastion.cu \ - fuguecoin.cpp Algo256/cuda_fugue256.cu sph/fugue.c uint256.h \ - groestlcoin.cpp cuda_groestlcoin.cu cuda_groestlcoin.h \ - myriadgroestl.cpp cuda_myriadgroestl.cu \ - lyra2/Lyra2.c lyra2/Sponge.c \ - lyra2/lyra2RE.cu lyra2/cuda_lyra2.cu \ - lyra2/lyra2REv2.cu lyra2/cuda_lyra2v2.cu \ - lyra2/Lyra2Z.c lyra2/lyra2Z.cu lyra2/cuda_lyra2Z.cu \ - Algo256/cuda_bmw256.cu Algo256/cuda_cubehash256.cu \ - Algo256/cuda_blake256.cu Algo256/cuda_groestl256.cu \ - Algo256/cuda_keccak256_sm3.cu Algo256/cuda_keccak256.cu Algo256/cuda_skein256.cu \ - Algo256/blake256.cu Algo256/decred.cu Algo256/vanilla.cu Algo256/keccak256.cu \ - Algo256/blake2s.cu sph/blake2s.c \ - Algo256/bmw.cu Algo256/cuda_bmw.cu \ - crypto/xmr-rpc.cpp crypto/wildkeccak-cpu.cpp crypto/wildkeccak.cu \ - crypto/cryptolight.cu crypto/cryptolight-core.cu crypto/cryptolight-cpu.cpp \ - crypto/cryptonight.cu crypto/cryptonight-core.cu crypto/cryptonight-extra.cu \ - crypto/cryptonight-cpu.cpp crypto/oaes_lib.cpp crypto/aesb.cpp crypto/cpu/c_keccak.c \ - JHA/jha.cu JHA/jackpotcoin.cu JHA/cuda_jha_keccak512.cu \ - JHA/cuda_jha_compactionTest.cu cuda_checkhash.cu \ - quark/cuda_jh512.cu quark/cuda_quark_blake512.cu quark/cuda_quark_groestl512.cu quark/cuda_skein512.cu \ - quark/cuda_bmw512.cu quark/cuda_quark_keccak512.cu \ - quark/nist5.cu \ - quark/quarkcoin.cu quark/cuda_quark_compactionTest.cu \ - neoscrypt/neoscrypt.cpp neoscrypt/neoscrypt-cpu.c neoscrypt/cuda_neoscrypt.cu \ - pentablake.cu skein.cu cuda_skeincoin.cu skein2.cpp zr5.cu \ - skunk/skunk.cu skunk/cuda_skunk.cu skunk/cuda_skunk_streebog.cu \ - sha256/sha256d.cu sha256/cuda_sha256d.cu sha256/sha256t.cu sha256/cuda_sha256t.cu \ - sia/sia.cu sia/sia-rpc.cpp sph/blake2b.c \ - sph/bmw.c sph/blake.c sph/groestl.c sph/jh.c sph/keccak.c sph/skein.c \ - sph/cubehash.c sph/echo.c sph/luffa.c sph/sha2.c sph/shavite.c sph/simd.c \ - sph/hamsi.c sph/hamsi_helper.c sph/streebog.c \ - sph/shabal.c sph/whirlpool.c sph/sha2big.c sph/haval.c \ - sph/ripemd.c sph/sph_sha2.c \ - polytimos.cu \ - lbry/lbry.cu lbry/cuda_sha256_lbry.cu lbry/cuda_sha512_lbry.cu lbry/cuda_lbry_merged.cu \ - qubit/qubit.cu qubit/qubit_luffa512.cu qubit/qubit_luffa512_alexis.cu qubit/deep.cu qubit/luffa.cu \ - tribus/tribus.cu tribus/cuda_echo512_final.cu \ - x11/x11.cu x11/fresh.cu x11/cuda_x11_luffa512.cu x11/cuda_x11_cubehash512.cu \ - x11/cuda_x11_shavite512.cu x11/cuda_x11_shavite512_alexis.cu x11/cuda_x11_simd512.cu x11/cuda_x11_echo.cu x11/cuda_x11_echo_alexis.cu \ - x11/cuda_x11_luffa512_Cubehash.cu x11/x11evo.cu x11/timetravel.cu x11/bitcore.cu \ - x13/x13.cu x13/cuda_x13_hamsi512.cu x13/cuda_x13_hamsi512_alexis.cu x13/cuda_x13_fugue512.cu x13/cuda_x13_fugue512_alexis.cu \ - x13/hsr.cu x13/cuda_hsr_sm3.cu x13/sm3.c \ - x15/x14.cu x15/x15.cu x15/cuda_x14_shabal512.cu x15/cuda_x14_shabal512_alexis.cu x15/cuda_x15_whirlpool.cu \ - x15/whirlpool.cu x15/cuda_x15_whirlpool_sm3.cu \ - x16/x16r.cu x16/x16s.cu x16/cuda_x16_echo512.cu x16/cuda_x16_fugue512.cu \ - x16/cuda_x16_shabal512.cu x16/cuda_x16_simd512_80.cu \ - x17/x17.cu x17/hmq17.cu x17/cuda_x17_haval256.cu x17/cuda_x17_sha512.cu \ - x11/phi.cu x11/cuda_streebog_maxwell.cu \ - x11/c11.cu x11/s3.cu x11/sib.cu x11/veltor.cu x11/cuda_streebog.cu - -# scrypt -ccminer_SOURCES += scrypt.cpp scrypt-jane.cpp \ - scrypt/blake.cu scrypt/keccak.cu scrypt/sha256.cu \ - scrypt/salsa_kernel.cu scrypt/test_kernel.cu \ - scrypt/fermi_kernel.cu scrypt/kepler_kernel.cu \ - scrypt/nv_kernel.cu scrypt/nv_kernel2.cu scrypt/titan_kernel.cu + Algo256/cuda_keccak256_sm3.cu Algo256/cuda_keccak256.cu \ + Algo256/keccak256.cu \ + crypto/cpu/c_keccak.c \ + cuda_checkhash.cu \ + sha256/sha256d.cu sha256/cuda_sha256d.cu \ + sph/sph_sha2.c if HAVE_NVML nvml_defs = -DUSE_WRAPNVML @@ -109,7 +49,6 @@ ccminer_LDADD += -lomp endif #ccminer_CPPFLAGS += -DUSE_LIBSODIUM -#ccminer_LDFLAGS += -Lequi/lib #ccminer_LDADD += -lsodium ccminer_LDADD += -lcuda @@ -126,76 +65,3 @@ nvcc_FLAGS += $(JANSSON_INCLUDES) --ptxas-options="-v" # we're now targeting all major compute architectures within one binary. .cu.o: $(NVCC) $(nvcc_FLAGS) --maxrregcount=128 -o $@ -c $< - -Algo256/blake256.o: Algo256/blake256.cu - $(NVCC) $(nvcc_FLAGS) --maxrregcount=64 -o $@ -c $< - -Algo256/cuda_bmw.o: Algo256/cuda_bmw.cu - $(NVCC) $(nvcc_FLAGS) --maxrregcount=76 -o $@ -c $< - -crypto/cryptonight-core.o: crypto/cryptonight-core.cu - $(NVCC) $(nvcc_FLAGS) --maxrregcount=64 -o $@ -c $< - -crypto/cryptonight-extra.o: crypto/cryptonight-extra.cu - $(NVCC) $(nvcc_FLAGS) -o $@ -c $< - -heavy/cuda_hefty1.o: heavy/cuda_hefty1.cu - $(NVCC) $(nvcc_FLAGS) --maxrregcount=80 -o $@ -c $< - -qubit/qubit_luffa512.o: qubit/qubit_luffa512.cu - $(NVCC) $(nvcc_FLAGS) --maxrregcount=80 -o $@ -c $< - -# Luffa and Echo are faster with 80 registers than 128 -x11/cuda_x11_luffa512.o: x11/cuda_x11_luffa512.cu - $(NVCC) $(nvcc_FLAGS) --maxrregcount=80 -o $@ -c $< - -x11/cuda_x11_luffa512_Cubehash.o: x11/cuda_x11_luffa512_Cubehash.cu - $(NVCC) $(nvcc_FLAGS) --maxrregcount=76 -o $@ -c $< - -x11/cuda_x11_simd512.o: x11/cuda_x11_simd512.cu - $(NVCC) $(nvcc_FLAGS) -Xcompiler -Wno-unused-variable -o $@ -c $< - -x13/cuda_x13_hamsi512.o: x13/cuda_x13_hamsi512.cu - $(NVCC) $(nvcc_FLAGS) --maxrregcount=72 -o $@ -c $< - -x17/cuda_x17_sha512.o: x17/cuda_x17_sha512.cu - $(NVCC) $(nvcc_FLAGS) --maxrregcount=80 -o $@ -c $< - -quark/cuda_quark_blake512.o: quark/cuda_quark_blake512.cu - $(NVCC) $(nvcc_FLAGS) --maxrregcount=80 -o $@ -c $< - -quark/cuda_jh512.o: quark/cuda_jh512.cu - $(NVCC) $(nvcc_FLAGS) --maxrregcount=80 -o $@ -c $< - -quark/cuda_quark_keccak512.o: quark/cuda_quark_keccak512.cu - $(NVCC) $(nvcc_FLAGS) --maxrregcount=88 -o $@ -c $< - -quark/cuda_quark_compactionTest.o: quark/cuda_quark_compactionTest.cu - $(NVCC) $(nvcc_FLAGS) --maxrregcount=80 -o $@ -c $< - -JHA/cuda_jha_compactionTest.o: JHA/cuda_jha_compactionTest.cu - $(NVCC) $(nvcc_FLAGS) --maxrregcount=80 -o $@ -c $< - -# This object does not use cuda device code but call the different kernels (autotune) -scrypt/salsa_kernel.o: scrypt/salsa_kernel.cu - $(NVCC) $(JANSSON_INCLUDES) -I. @CUDA_INCLUDES@ @CUDA_CFLAGS@ -gencode=arch=compute_30,code=\"sm_30,compute_30\" -o $@ -c $< - -# These kernels are for older devices (SM) - -scrypt/test_kernel.o: scrypt/test_kernel.cu - $(NVCC) $(JANSSON_INCLUDES) -I. @CUDA_INCLUDES@ @CUDA_CFLAGS@ -gencode=arch=compute_30,code=\"sm_30,compute_30\" -o $@ -c $< - -scrypt/fermi_kernel.o: scrypt/fermi_kernel.cu - $(NVCC) $(JANSSON_INCLUDES) -I. @CUDA_INCLUDES@ @CUDA_CFLAGS@ -gencode=arch=compute_30,code=\"sm_30,compute_30\" -o $@ -c $< - -scrypt/kepler_kernel.o: scrypt/kepler_kernel.cu - $(NVCC) $(JANSSON_INCLUDES) -I. @CUDA_INCLUDES@ @CUDA_CFLAGS@ -gencode=arch=compute_30,code=\"sm_30,compute_30\" -o $@ -c $< - -scrypt/nv_kernel.o: scrypt/nv_kernel.cu - $(NVCC) $(JANSSON_INCLUDES) -I. @CUDA_INCLUDES@ @CUDA_CFLAGS@ -gencode=arch=compute_30,code=\"sm_30,compute_30\" -o $@ -c $< - -scrypt/titan_kernel.o: scrypt/titan_kernel.cu - $(NVCC) $(nvcc_FLAGS) -gencode=arch=compute_35,code=\"sm_35,compute_35\" -o $@ -c $< - -skein.o: skein.cu - $(NVCC) $(nvcc_FLAGS) --maxrregcount=64 -o $@ -c $< diff --git a/algos.h b/algos.h index 800f6028..c25e8069 100644 --- a/algos.h +++ b/algos.h @@ -5,70 +5,8 @@ #include "compat.h" enum sha_algos { - ALGO_BLAKECOIN = 0, - ALGO_BLAKE, - ALGO_BLAKE2S, - ALGO_BMW, - ALGO_BASTION, - ALGO_C11, - ALGO_CRYPTOLIGHT, - ALGO_CRYPTONIGHT, - ALGO_DEEP, - ALGO_DECRED, - ALGO_DMD_GR, - ALGO_EQUIHASH, - ALGO_FRESH, - ALGO_FUGUE256, /* Fugue256 */ - ALGO_GROESTL, - ALGO_HEAVY, /* Heavycoin hash */ - ALGO_HMQ1725, - ALGO_HSR, ALGO_KECCAK, - ALGO_KECCAKC, /* refreshed Keccak with pool factor 256 */ - ALGO_JACKPOT, - ALGO_JHA, - ALGO_LBRY, - ALGO_LUFFA, - ALGO_LYRA2, - ALGO_LYRA2v2, - ALGO_LYRA2Z, - ALGO_MJOLLNIR, /* Hefty hash */ - ALGO_MYR_GR, - ALGO_NEOSCRYPT, - ALGO_NIST5, - ALGO_PENTABLAKE, - ALGO_PHI, - ALGO_POLYTIMOS, - ALGO_QUARK, - ALGO_QUBIT, - ALGO_SCRYPT, - ALGO_SCRYPT_JANE, ALGO_SHA256D, - ALGO_SHA256T, - ALGO_SIA, - ALGO_SIB, - ALGO_SKEIN, - ALGO_SKEIN2, - ALGO_SKUNK, - ALGO_S3, - ALGO_TIMETRAVEL, - ALGO_TRIBUS, - ALGO_BITCORE, - ALGO_X11EVO, - ALGO_X11, - ALGO_X13, - ALGO_X14, - ALGO_X15, - ALGO_X16R, - ALGO_X16S, - ALGO_X17, - ALGO_VANILLA, - ALGO_VELTOR, - ALGO_WHIRLCOIN, - ALGO_WHIRLPOOL, - ALGO_WHIRLPOOLX, - ALGO_WILDKECCAK, - ALGO_ZR5, ALGO_AUTO, ALGO_COUNT }; @@ -76,70 +14,8 @@ enum sha_algos { extern volatile enum sha_algos opt_algo; static const char *algo_names[] = { - "blakecoin", - "blake", - "blake2s", - "bmw", - "bastion", - "c11", - "cryptolight", - "cryptonight", - "deep", - "decred", - "dmd-gr", - "equihash", - "fresh", - "fugue256", - "groestl", - "heavy", - "hmq1725", - "hsr", "keccak", - "keccakc", - "jackpot", - "jha", - "lbry", - "luffa", - "lyra2", - "lyra2v2", - "lyra2z", - "mjollnir", - "myr-gr", - "neoscrypt", - "nist5", - "penta", - "phi", - "polytimos", - "quark", - "qubit", - "scrypt", - "scrypt-jane", "sha256d", - "sha256t", - "sia", - "sib", - "skein", - "skein2", - "skunk", - "s3", - "timetravel", - "tribus", - "bitcore", - "x11evo", - "x11", - "x13", - "x14", - "x15", - "x16r", - "x16s", - "x17", - "vanilla", - "veltor", - "whirlcoin", - "whirlpool", - "whirlpoolx", - "wildkeccak", - "zr5", "auto", /* reserved for multi algo */ "" }; @@ -159,40 +35,10 @@ static inline int algo_to_int(char* arg) // some aliases... if (!strcasecmp("all", arg)) i = ALGO_AUTO; - else if (!strcasecmp("cryptonight-light", arg)) - i = ALGO_CRYPTOLIGHT; - else if (!strcasecmp("cryptonight-lite", arg)) - i = ALGO_CRYPTOLIGHT; - else if (!strcasecmp("flax", arg)) - i = ALGO_C11; - else if (!strcasecmp("diamond", arg)) - i = ALGO_DMD_GR; - else if (!strcasecmp("equi", arg)) - i = ALGO_EQUIHASH; - else if (!strcasecmp("doom", arg)) - i = ALGO_LUFFA; - else if (!strcasecmp("hmq17", arg)) - i = ALGO_HMQ1725; - else if (!strcasecmp("hshare", arg)) - i = ALGO_HSR; - else if (!strcasecmp("lyra2re", arg)) - i = ALGO_LYRA2; - else if (!strcasecmp("lyra2rev2", arg)) - i = ALGO_LYRA2v2; - else if (!strcasecmp("phi1612", arg)) - i = ALGO_PHI; else if (!strcasecmp("bitcoin", arg)) i = ALGO_SHA256D; else if (!strcasecmp("sha256", arg)) i = ALGO_SHA256D; - else if (!strcasecmp("thorsriddle", arg)) - i = ALGO_VELTOR; - else if (!strcasecmp("timetravel10", arg)) - i = ALGO_BITCORE; - else if (!strcasecmp("whirl", arg)) - i = ALGO_WHIRLPOOL; - else if (!strcasecmp("ziftr", arg)) - i = ALGO_ZR5; else i = -1; } diff --git a/api.cpp b/api.cpp index 87d30950..74ec4a14 100644 --- a/api.cpp +++ b/api.cpp @@ -231,14 +231,7 @@ static char *getpoolnfo(char *params) if (stratum.job.xnonce2) { /* used temporary to be sure all is ok */ sprintf(extra, "0x"); - if (p->algo == ALGO_DECRED) { - char compat[32] = { 0 }; - cbin2hex(&extra[2], (const char*) stratum.xnonce1, min(36, stratum.xnonce2_size)); - cbin2hex(compat, (const char*) stratum.job.xnonce2, 4); - memcpy(&extra[2], compat, 8); // compat extranonce - } else { - cbin2hex(&extra[2], (const char*) stratum.job.xnonce2, stratum.xnonce2_size); - } + cbin2hex(&extra[2], (const char*) stratum.job.xnonce2, stratum.xnonce2_size); } snprintf(s, MYBUFSIZ, "POOL=%s;ALGO=%s;URL=%s;USER=%s;SOLV=%d;ACC=%d;REJ=%d;STALE=%u;H=%u;JOB=%s;DIFF=%.6f;" diff --git a/bench.cpp b/bench.cpp index 75bb69eb..5db2af87 100644 --- a/bench.cpp +++ b/bench.cpp @@ -49,68 +49,8 @@ void bench_free() void algo_free_all(int thr_id) { // only initialized algos will be freed - free_bastion(thr_id); - free_bitcore(thr_id); - free_blake256(thr_id); - free_blake2s(thr_id); - free_bmw(thr_id); - free_c11(thr_id); - free_cryptolight(thr_id); - free_cryptonight(thr_id); - free_decred(thr_id); - free_deep(thr_id); - free_equihash(thr_id); free_keccak256(thr_id); - free_fresh(thr_id); - free_fugue256(thr_id); - free_groestlcoin(thr_id); -#ifdef WITH_HEAVY_ALGO - free_heavy(thr_id); -#endif - free_hmq17(thr_id); - free_hsr(thr_id); - free_jackpot(thr_id); - free_jha(thr_id); - free_lbry(thr_id); - free_luffa(thr_id); - free_lyra2(thr_id); - free_lyra2v2(thr_id); - free_lyra2Z(thr_id); - free_myriad(thr_id); - free_neoscrypt(thr_id); - free_nist5(thr_id); - free_pentablake(thr_id); - free_phi(thr_id); - free_polytimos(thr_id); - free_quark(thr_id); - free_qubit(thr_id); - free_skeincoin(thr_id); - free_skein2(thr_id); - free_skunk(thr_id); free_sha256d(thr_id); - free_sha256t(thr_id); - free_sia(thr_id); - free_sib(thr_id); - free_s3(thr_id); - free_vanilla(thr_id); - free_veltor(thr_id); - free_whirl(thr_id); - //free_whirlx(thr_id); - free_wildkeccak(thr_id); - free_x11evo(thr_id); - free_x11(thr_id); - free_x13(thr_id); - free_x14(thr_id); - free_x15(thr_id); - free_x16r(thr_id); - free_x16s(thr_id); - free_x17(thr_id); - free_zr5(thr_id); - free_scrypt(thr_id); - free_scrypt_jane(thr_id); - free_timetravel(thr_id); - free_tribus(thr_id); - free_bitcore(thr_id); } // benchmark all algos (called once per mining thread) @@ -126,32 +66,6 @@ bool bench_algo_switch_next(int thr_id) algo++; - // skip some duplicated algos - if (algo == ALGO_C11) algo++; // same as x11 - if (algo == ALGO_DMD_GR) algo++; // same as groestl - if (algo == ALGO_HEAVY) algo++; // dead - if (algo == ALGO_MJOLLNIR) algo++; // same as heavy - if (algo == ALGO_KECCAKC) algo++; // same as keccak - if (algo == ALGO_WHIRLCOIN) algo++; // same as whirlpool - if (algo == ALGO_WHIRLPOOLX) algo++; // disabled - // todo: algo switch from RPC 2.0 - if (algo == ALGO_CRYPTOLIGHT) algo++; - if (algo == ALGO_CRYPTONIGHT) algo++; - if (algo == ALGO_WILDKECCAK) algo++; - if (algo == ALGO_QUARK) algo++; // to fix - if (algo == ALGO_LBRY && CUDART_VERSION < 7000) algo++; - - if (device_sm[dev_id] && device_sm[dev_id] < 300) { - // incompatible SM 2.1 kernels... - if (algo == ALGO_GROESTL) algo++; - if (algo == ALGO_MYR_GR) algo++; - if (algo == ALGO_NEOSCRYPT) algo++; - if (algo == ALGO_WHIRLPOOLX) algo++; - } - // and unwanted ones... - if (algo == ALGO_SCRYPT) algo++; - if (algo == ALGO_SCRYPT_JANE) algo++; - // free current algo memory and track mem usage mused = cuda_available_memory(thr_id); algo_free_all(thr_id); diff --git a/ccminer.conf b/ccminer.conf index 1760afd7..922c7767 100644 --- a/ccminer.conf +++ b/ccminer.conf @@ -1,8 +1,11 @@ { - "_comment1" : "Possible keys are the long options (ccminer --help)", - "_comment2" : "todo: support /* comments */", + "_comment1" : "You can add any long options (ccminer --help) to this conf file", + "_comment2" : "The only available algo is keccak, which is actually SHA3d", + "_comment3" : "Be sure to fill in your desired pool and BSHA3 address (url, user)", + "_comment4" : "Default address belongs to the SHA3d GPU Miner's author", + "_comment5" : "todo: support /* comments */", - "algo" : "lbry", + "algo" : "keccak", "intensity": 22, "api-bind": "127.0.0.1:4068", @@ -14,7 +17,7 @@ "protocol" : false, "cpu-priority" : 3, - "url" : "stratum+tcp://yiimp.ccminer.org:3334", - "user" : "bK2wcSFJv2nnNjFvTN5Q7VX8X8unJktJsa", - "pass" : "donate" + "url" : "stratum+tcp://mypool.com:3008", + "user" : "cR75HuSFYK5BpuWGRLpgJEjP6oqNrnjEc5", + "pass" : "x" } diff --git a/ccminer.cpp b/ccminer.cpp index 24075d5d..bb49b069 100644 --- a/ccminer.cpp +++ b/ccminer.cpp @@ -42,11 +42,9 @@ #endif #include "miner.h" + #include "algos.h" -#include "sia/sia-rpc.h" -#include "crypto/xmr-rpc.h" #include "sph/sph_keccak.h" -#include "equi/equihash.h" #include "donate.h" #include @@ -128,7 +126,6 @@ int opt_priority = 0; static double opt_difficulty = 1.; bool opt_extranonce = false; bool opt_trust_pool = false; -uint16_t opt_vote = 9999; int num_cpus; int active_gpus; bool need_nvsettings = false; @@ -176,8 +173,6 @@ volatile int pool_switch_count = 0; bool conditional_pool_rotate = false; pthread_barrier_t pool_algo_barr; -extern char* opt_scratchpad_url; - // current connection char *rpc_user = NULL; char *rpc_pass; @@ -246,74 +241,12 @@ int opt_api_mcast_port = 4068; bool opt_stratum_stats = false; -double dev_donate_percent = MIN_DEV_DONATE_PERCENT; - -static char const usage[] = "\ -Usage: " PROGRAM_NAME " [OPTIONS]\n\ -Options:\n\ - -a, --algo=ALGO specify the hash algorithm to use\n\ - bastion Hefty bastion\n\ - bitcore Timetravel-10\n\ - blake Blake 256 (SFR)\n\ - blake2s Blake2-S 256 (NEVA)\n\ - blakecoin Fast Blake 256 (8 rounds)\n\ - bmw BMW 256\n\ - cryptolight AEON cryptonight (MEM/2)\n\ - cryptonight XMR cryptonight\n\ - c11/flax X11 variant\n\ - decred Decred Blake256\n\ - deep Deepcoin\n\ - equihash Zcash Equihash\n\ - dmd-gr Diamond-Groestl\n\ - fresh Freshcoin (shavite 80)\n\ - fugue256 Fuguecoin\n\ - groestl Groestlcoin\n" -#ifdef WITH_HEAVY_ALGO -" heavy Heavycoin\n" -#endif -" hmq1725 Doubloons / Espers\n\ - jackpot JHA v8\n\ - keccak Deprecated Keccak-256\n\ - keccakc Keccak-256 (CreativeCoin)\n\ - lbry LBRY Credits (Sha/Ripemd)\n\ - luffa Joincoin\n\ - lyra2 CryptoCoin\n\ - lyra2v2 VertCoin\n\ - lyra2z ZeroCoin (3rd impl)\n\ - myr-gr Myriad-Groestl\n\ - neoscrypt FeatherCoin, Phoenix, UFO...\n\ - nist5 NIST5 (TalkCoin)\n\ - penta Pentablake hash (5x Blake 512)\n\ - phi BHCoin\n\ - polytimos Politimos\n\ - quark Quark\n\ - qubit Qubit\n\ - sha256d SHA256d (bitcoin)\n\ - sha256t SHA256 x3\n\ - sia SIA (Blake2B)\n\ - sib Sibcoin (X11+Streebog)\n\ - scrypt Scrypt\n\ - scrypt-jane Scrypt-jane Chacha\n\ - skein Skein SHA2 (Skeincoin)\n\ - skein2 Double Skein (Woodcoin)\n\ - skunk Skein Cube Fugue Streebog\n\ - s3 S3 (1Coin)\n\ - timetravel Machinecoin permuted x8\n\ - tribus Denarius\n\ - vanilla Blake256-8 (VNL)\n\ - veltor Thorsriddle streebog\n\ - whirlcoin Old Whirlcoin (Whirlpool algo)\n\ - whirlpool Whirlpool algo\n\ - x11evo Permuted x11 (Revolver)\n\ - x11 X11 (DarkCoin)\n\ - x13 X13 (MaruCoin)\n\ - x14 X14\n\ - x15 X15\n\ - x16r X16R (Raven)\n\ - x16s X16S\n\ - x17 X17\n\ - wildkeccak Boolberry\n\ - zr5 ZR5 (ZiftrCoin)\n\ +double dev_donate_percent = 0.0; + +static char const usage[] = "Usage: " PROGRAM_NAME " [OPTIONS]\n \ +Options:\n \ + -a, --algo=ALGO specify the hash algorithm to use\n \ + keccak Double Keccak-256\n \ -d, --devices Comma separated list of CUDA devices to use.\n\ Device IDs start counting from 0! Alternatively takes\n\ string names of your cards like gtx780ti or gt640#2\n\ @@ -429,13 +362,6 @@ struct option options[] = { { "no-gbt", 0, NULL, 1011 }, { "no-longpoll", 0, NULL, 1003 }, { "no-stratum", 0, NULL, 1007 }, - { "no-autotune", 0, NULL, 1004 }, // scrypt - { "interactive", 1, NULL, 1050 }, // scrypt - { "lookup-gap", 1, NULL, 'L' }, // scrypt - { "texture-cache", 1, NULL, 1051 },// scrypt - { "launch-config", 1, NULL, 'l' }, // scrypt bbr xmr - { "scratchpad", 1, NULL, 'k' }, // bbr - { "bfactor", 1, NULL, 1055 }, // xmr { "max-temp", 1, NULL, 1060 }, { "max-diff", 1, NULL, 1061 }, { "max-rate", 1, NULL, 1062 }, @@ -600,10 +526,7 @@ void get_currentalgo(char* buf, int sz) void format_hashrate(double hashrate, char *output) { - if (opt_algo == ALGO_EQUIHASH) - format_hashrate_unit(hashrate, output, "Sol/s"); - else - format_hashrate_unit(hashrate, output, "H/s"); + format_hashrate_unit(hashrate, output, "H/s"); } /** @@ -687,13 +610,6 @@ static void calc_network_diff(struct work *work) // sample for diff 43.281 : 1c05ea29 // todo: endian reversed on longpoll could be zr5 specific... uint32_t nbits = have_longpoll ? work->data[18] : swab32(work->data[18]); - if (opt_algo == ALGO_LBRY) nbits = swab32(work->data[26]); - if (opt_algo == ALGO_DECRED) nbits = work->data[29]; - if (opt_algo == ALGO_SIA) nbits = work->data[11]; // unsure if correct - if (opt_algo == ALGO_EQUIHASH) { - net_diff = equi_network_diff(work); - return; - } uint32_t bits = (nbits & 0xffffff); int16_t shift = (swab32(nbits) & 0xff); // 0x1c = 28 @@ -703,7 +619,6 @@ static void calc_network_diff(struct work *work) for (int m=shift; m < 29; m++) d *= 256.0; for (int m=29; m < shift; m++) d /= 256.0; - if (opt_algo == ALGO_DECRED && shift == 28) d *= 256.0; if (opt_debug_diff) applog(LOG_DEBUG, "net diff: %f -> shift %u, bits %08x", d, shift, bits); @@ -718,20 +633,6 @@ static bool work_decode(const json_t *val, struct work *work) int i; switch (opt_algo) { - case ALGO_DECRED: - data_size = 192; - adata_sz = 180/4; - break; - case ALGO_NEOSCRYPT: - case ALGO_ZR5: - data_size = 80; - adata_sz = data_size / 4; - break; - case ALGO_CRYPTOLIGHT: - case ALGO_CRYPTONIGHT: - case ALGO_WILDKECCAK: - return rpc2_job_decode(val, work); - default: data_size = 128; adata_sz = data_size / 4; } @@ -756,11 +657,7 @@ static bool work_decode(const json_t *val, struct work *work) return false; } - if (opt_algo == ALGO_HEAVY) { - if (unlikely(!jobj_binary(val, "maxvote", &work->maxvote, sizeof(work->maxvote)))) { - work->maxvote = 2048; - } - } else work->maxvote = 0; + work->maxvote = 0; for (i = 0; i < adata_sz; i++) work->data[i] = le32dec(work->data + i); @@ -776,64 +673,10 @@ static bool work_decode(const json_t *val, struct work *work) stratum_diff = work->targetdiff; work->tx_count = use_pok = 0; - if (opt_algo == ALGO_ZR5 && work->data[0] & POK_BOOL_MASK) { - use_pok = 1; - json_t *txs = json_object_get(val, "txs"); - if (txs && json_is_array(txs)) { - size_t idx, totlen = 0; - json_t *p; - - json_array_foreach(txs, idx, p) { - const int tx = work->tx_count % POK_MAX_TXS; - const char* hexstr = json_string_value(p); - size_t txlen = strlen(hexstr)/2; - work->tx_count++; - if (work->tx_count > POK_MAX_TXS || txlen >= POK_MAX_TX_SZ) { - // when tx is too big, just reset use_pok for the block - use_pok = 0; - if (opt_debug) applog(LOG_WARNING, - "pok: large block ignored, tx len: %u", txlen); - work->tx_count = 0; - break; - } - hex2bin((uchar*)work->txs[tx].data, hexstr, min(txlen, POK_MAX_TX_SZ)); - work->txs[tx].len = (uint32_t) (txlen); - totlen += txlen; - } - if (opt_debug) - applog(LOG_DEBUG, "block txs: %u, total len: %u", work->tx_count, totlen); - } - } /* use work ntime as job id (solo-mining) */ cbin2hex(work->job_id, (const char*)&work->data[17], 4); - if (opt_algo == ALGO_DECRED) { - uint16_t vote; - // always keep last bit of votebits - memcpy(&vote, &work->data[25], 2); - vote = (opt_vote << 1) | (vote & 1); - memcpy(&work->data[25], &vote, 2); - // some random extradata to make it unique - work->data[36] = (rand()*4); - work->data[37] = (rand()*4) << 8; - // required for the longpoll pool block info... - work->height = work->data[32]; - if (!have_longpoll && work->height > net_blocks + 1) { - char netinfo[64] = { 0 }; - if (opt_showdiff && net_diff > 0.) { - if (net_diff != work->targetdiff) - sprintf(netinfo, ", diff %.3f, pool %.1f", net_diff, work->targetdiff); - else - sprintf(netinfo, ", diff %.3f", net_diff); - } - applog(LOG_BLUE, "%s block %d%s", - algo_names[opt_algo], work->height, netinfo); - net_blocks = work->height - 1; - } - cbin2hex(work->job_id, (const char*)&work->data[34], 4); - } - return true; } @@ -909,27 +752,14 @@ static bool submit_upstream_work(CURL *curl, struct work *work) struct work submit_work; memcpy(&submit_work, work, sizeof(struct work)); if (!hashlog_already_submittted(submit_work.job_id, submit_work.nonces[idnonce])) { - if (rpc2_stratum_submit(pool, &submit_work)) - hashlog_remember_submit(&submit_work, submit_work.nonces[idnonce]); stratum.job.shares_count++; } return true; } - if (pool->type & POOL_STRATUM && stratum.is_equihash) { - struct work submit_work; - memcpy(&submit_work, work, sizeof(struct work)); - //if (!hashlog_already_submittted(submit_work.job_id, submit_work.nonces[idnonce])) { - if (equi_stratum_submit(pool, &submit_work)) - hashlog_remember_submit(&submit_work, submit_work.nonces[idnonce]); - stratum.job.shares_count++; - //} - return true; - } - /* discard if a newer block was received */ stale_work = work->height && work->height < g_work.height; - if (have_stratum && !stale_work && !opt_submit_stale && opt_algo != ALGO_ZR5 && opt_algo != ALGO_SCRYPT_JANE) { + if (have_stratum && !stale_work && !opt_submit_stale) { pthread_mutex_lock(&g_work_lock); if (strlen(work->job_id + 8)) stale_work = strncmp(work->job_id + 8, g_work.job_id + 8, sizeof(g_work.job_id) - 8); @@ -956,10 +786,6 @@ static bool submit_upstream_work(CURL *curl, struct work *work) } } - if (!stale_work && opt_algo == ALGO_ZR5 && !have_stratum) { - stale_work = (memcmp(&work->data[1], &g_work.data[1], 68)); - } - if (!submit_old && stale_work) { if (opt_debug) applog(LOG_WARNING, "stale work detected, discarding"); @@ -973,42 +799,12 @@ static bool submit_upstream_work(CURL *curl, struct work *work) uint16_t nvote = 0; switch (opt_algo) { - case ALGO_BLAKE: - case ALGO_BLAKECOIN: - case ALGO_BLAKE2S: - case ALGO_BMW: case ALGO_SHA256D: - case ALGO_SHA256T: - case ALGO_VANILLA: // fast algos require that... (todo: regen hash) check_dups = true; le32enc(&ntime, work->data[17]); le32enc(&nonce, work->data[19]); break; - case ALGO_DECRED: - be16enc(&nvote, *((uint16_t*)&work->data[25])); - be32enc(&ntime, work->data[34]); - be32enc(&nonce, work->data[35]); - break; - case ALGO_HEAVY: - le32enc(&ntime, work->data[17]); - le32enc(&nonce, work->data[19]); - be16enc(&nvote, *((uint16_t*)&work->data[20])); - break; - case ALGO_LBRY: - check_dups = true; - le32enc(&ntime, work->data[25]); - //le32enc(&nonce, work->data[27]); - break; - case ALGO_SIA: - be32enc(&ntime, work->data[10]); - be32enc(&nonce, work->data[8]); - break; - case ALGO_ZR5: - check_dups = true; - be32enc(&ntime, work->data[17]); - be32enc(&nonce, work->data[19]); - break; default: le32enc(&ntime, work->data[17]); le32enc(&nonce, work->data[19]); @@ -1032,14 +828,7 @@ static bool submit_upstream_work(CURL *curl, struct work *work) ntimestr = bin2hex((const uchar*)(&ntime), 4); - if (opt_algo == ALGO_DECRED) { - xnonce2str = bin2hex((const uchar*)&work->data[36], stratum.xnonce1_size); - } else if (opt_algo == ALGO_SIA) { - uint16_t high_nonce = swab32(work->data[9]) >> 16; - xnonce2str = bin2hex((unsigned char*)(&high_nonce), 2); - } else { - xnonce2str = bin2hex(work->xnonce2, work->xnonce2_len); - } + xnonce2str = bin2hex(work->xnonce2, work->xnonce2_len); // store to keep/display the solved ratio/diff stratum.sharediff = work->sharediff[idnonce]; @@ -1051,17 +840,10 @@ static bool submit_upstream_work(CURL *curl, struct work *work) applog(LOG_DEBUG, "share diff: %.5f (x %.1f)", stratum.sharediff, work->shareratio[idnonce]); - if (opt_vote) { // ALGO_HEAVY - nvotestr = bin2hex((const uchar*)(&nvote), 2); - sprintf(s, "{\"method\": \"mining.submit\", \"params\": [" - "\"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\"], \"id\":%u}", - pool->user, work->job_id + 8, xnonce2str, ntimestr, noncestr, nvotestr, stratum.job.shares_count + 10); - free(nvotestr); - } else { - sprintf(s, "{\"method\": \"mining.submit\", \"params\": [" - "\"%s\", \"%s\", \"%s\", \"%s\", \"%s\"], \"id\":%u}", - pool->user, work->job_id + 8, xnonce2str, ntimestr, noncestr, stratum.job.shares_count + 10); - } + sprintf(s, "{\"method\": \"mining.submit\", \"params\": [" + "\"%s\", \"%s\", \"%s\", \"%s\", \"%s\"], \"id\":%u}", + pool->user, work->job_id + 8, xnonce2str, ntimestr, noncestr, stratum.job.shares_count + 10); + free(xnonce2str); free(ntimestr); free(noncestr); @@ -1140,20 +922,8 @@ static bool submit_upstream_work(CURL *curl, struct work *work) /* build hex string */ char *str = NULL; - if (opt_algo == ALGO_ZR5) { - data_size = 80; adata_sz = 20; - } - else if (opt_algo == ALGO_DECRED) { - data_size = 192; adata_sz = 180/4; - } - else if (opt_algo == ALGO_SIA) { - return sia_submit(curl, pool, work); - } - - if (opt_algo != ALGO_HEAVY && opt_algo != ALGO_MJOLLNIR) { - for (int i = 0; i < adata_sz; i++) - le32enc(work->data + i, work->data[i]); - } + for (int i = 0; i < adata_sz; i++) + le32enc(work->data + i, work->data[i]); str = bin2hex((uchar*)work->data, data_size); if (unlikely(!str)) { applog(LOG_ERR, "submit_upstream_work OOM"); @@ -1663,19 +1433,6 @@ static bool get_upstream_work(CURL *curl, struct work *work) gettimeofday(&tv_start, NULL); - if (opt_algo == ALGO_SIA) { - char *sia_header = sia_getheader(curl, pool); - if (sia_header) { - rc = sia_work_decode(sia_header, work); - free(sia_header); - } - gettimeofday(&tv_end, NULL); - if (have_stratum || unlikely(work->pooln != cur_pooln)) { - return rc; - } - return rc; - } - if (opt_debug_threads) applog(LOG_DEBUG, "%s: want_longpoll=%d have_longpoll=%d", __func__, want_longpoll, have_longpoll); @@ -1903,14 +1660,8 @@ bool get_work(struct thr_info *thr, struct work *work) memset(work->data, 0x55, 76); //work->data[17] = swab32((uint32_t)time(NULL)); memset(work->data + 19, 0x00, 52); - if (opt_algo == ALGO_DECRED) { - memset(&work->data[35], 0x00, 52); - } else if (opt_algo == ALGO_LBRY) { - work->data[28] = 0x80000000; - } else { - work->data[20] = 0x80000000; - work->data[31] = 0x00000280; - } + work->data[20] = 0x80000000; + work->data[31] = 0x00000280; memset(work->target, 0x00, sizeof(work->target)); return true; } @@ -1975,9 +1726,6 @@ static bool stratum_gen_work(struct stratum_ctx *sctx, struct work *work) uchar merkle_root[64] = { 0 }; int i; - if (sctx->rpc2) - return rpc2_stratum_gen_work(sctx, work); - if (!sctx->job.job_id) { // applog(LOG_WARNING, "stratum_gen_work: job not yet retrieved"); return false; @@ -1997,40 +1745,11 @@ static bool stratum_gen_work(struct stratum_ctx *sctx, struct work *work) work->pooln = sctx->pooln; /* Generate merkle root */ - switch (opt_algo) { - case ALGO_DECRED: - case ALGO_EQUIHASH: - case ALGO_SIA: - // getwork over stratum, no merkle to generate - break; -#ifdef WITH_HEAVY_ALGO - case ALGO_HEAVY: - case ALGO_MJOLLNIR: - heavycoin_hash(merkle_root, sctx->job.coinbase, (int)sctx->job.coinbase_size); - break; -#endif - case ALGO_KECCAK: - sha3d(merkle_root, sctx->job.coinbase, (int)sctx->job.coinbase_size); - break; - case ALGO_FUGUE256: - case ALGO_GROESTL: - case ALGO_BLAKECOIN: - case ALGO_WHIRLCOIN: - SHA256((uchar*)sctx->job.coinbase, sctx->job.coinbase_size, (uchar*)merkle_root); - break; - case ALGO_WHIRLPOOL: - default: - sha256d(merkle_root, sctx->job.coinbase, (int)sctx->job.coinbase_size); - } + sha3d(merkle_root, sctx->job.coinbase, (int)sctx->job.coinbase_size); for (i = 0; i < sctx->job.merkle_count; i++) { memcpy(merkle_root + 32, sctx->job.merkle[i], 32); -#ifdef WITH_HEAVY_ALGO - if (opt_algo == ALGO_HEAVY || opt_algo == ALGO_MJOLLNIR) - heavycoin_hash(merkle_root, merkle_root, 64); - else -#endif - sha256d(merkle_root, merkle_root, 64); + sha256d(merkle_root, merkle_root, 64); } /* Increment extranonce2 */ @@ -2042,90 +1761,21 @@ static bool stratum_gen_work(struct stratum_ctx *sctx, struct work *work) for (i = 0; i < 8; i++) work->data[1 + i] = le32dec((uint32_t *)sctx->job.prevhash + i); - if (opt_algo == ALGO_DECRED) { - uint16_t vote; - for (i = 0; i < 8; i++) // reversed prevhash - work->data[1 + i] = swab32(work->data[1 + i]); - // decred header (coinb1) [merkle...nonce] - memcpy(&work->data[9], sctx->job.coinbase, 108); - // last vote bit should never be changed - memcpy(&vote, &work->data[25], 2); - vote = (opt_vote << 1) | (vote & 1); - memcpy(&work->data[25], &vote, 2); - // extradata - if (sctx->xnonce1_size > sizeof(work->data)-(32*4)) { - // should never happen... - applog(LOG_ERR, "extranonce size overflow!"); - sctx->xnonce1_size = sizeof(work->data)-(32*4); - } - memcpy(&work->data[36], sctx->xnonce1, sctx->xnonce1_size); - work->data[37] = (rand()*4) << 8; // random work data - // block header suffix from coinb2 (stake version) - memcpy(&work->data[44], &sctx->job.coinbase[sctx->job.coinbase_size-4], 4); - sctx->job.height = work->data[32]; - //applog_hex(work->data, 180); - } else if (opt_algo == ALGO_EQUIHASH) { - memcpy(&work->data[9], sctx->job.coinbase, 32+32); // merkle [9..16] + reserved - work->data[25] = le32dec(sctx->job.ntime); - work->data[26] = le32dec(sctx->job.nbits); - memcpy(&work->data[27], sctx->xnonce1, sctx->xnonce1_size & 0x1F); // pool extranonce - work->data[35] = 0x80; - //applog_hex(work->data, 140); - } else if (opt_algo == ALGO_LBRY) { - for (i = 0; i < 8; i++) - work->data[9 + i] = be32dec((uint32_t *)merkle_root + i); - for (i = 0; i < 8; i++) - work->data[17 + i] = ((uint32_t*)sctx->job.claim)[i]; - work->data[25] = le32dec(sctx->job.ntime); - work->data[26] = le32dec(sctx->job.nbits); - work->data[28] = 0x80000000; - } else if (opt_algo == ALGO_SIA) { - uint32_t extra = 0; - memcpy(&extra, &sctx->job.coinbase[32], 2); - for (i = 0; i < 8; i++) // reversed hash - work->data[i] = ((uint32_t*)sctx->job.prevhash)[7-i]; - work->data[8] = 0; // nonce - work->data[9] = swab32(extra) | ((rand() << 8) & 0xffff); - work->data[10] = be32dec(sctx->job.ntime); - work->data[11] = be32dec(sctx->job.nbits); - memcpy(&work->data[12], sctx->job.coinbase, 32); // merkle_root - work->data[20] = 0x80000000; - if (opt_debug) applog_hex(work->data, 80); - } else { - for (i = 0; i < 8; i++) - work->data[9 + i] = be32dec((uint32_t *)merkle_root + i); - work->data[17] = le32dec(sctx->job.ntime); - work->data[18] = le32dec(sctx->job.nbits); - work->data[20] = 0x80000000; - work->data[31] = (opt_algo == ALGO_MJOLLNIR) ? 0x000002A0 : 0x00000280; - } + for (i = 0; i < 8; i++) + work->data[9 + i] = be32dec((uint32_t *)merkle_root + i); + work->data[17] = le32dec(sctx->job.ntime); + work->data[18] = le32dec(sctx->job.nbits); + work->data[20] = 0x80000000; + work->data[31] = 0x00000280; if (opt_showdiff || opt_max_diff > 0.) calc_network_diff(work); - switch (opt_algo) { - case ALGO_MJOLLNIR: - case ALGO_HEAVY: - case ALGO_ZR5: - for (i = 0; i < 20; i++) - work->data[i] = swab32(work->data[i]); - break; - } - - // HeavyCoin (vote / reward) - if (opt_algo == ALGO_HEAVY) { - work->maxvote = 2048; - uint16_t *ext = (uint16_t*)(&work->data[20]); - ext[0] = opt_vote; - ext[1] = be16dec(sctx->job.nreward); - // applog(LOG_DEBUG, "DEBUG: vote=%hx reward=%hx", ext[0], ext[1]); - } - pthread_mutex_unlock(&stratum_work_lock); - if (opt_debug && opt_algo != ALGO_DECRED && opt_algo != ALGO_EQUIHASH && opt_algo != ALGO_SIA) { + if (opt_debug) { uint32_t utm = work->data[17]; - if (opt_algo != ALGO_ZR5) utm = swab32(utm); + utm = swab32(utm); char *tm = atime2str(utm - sctx->srvtime_diff); char *xnonce2str = bin2hex(work->xnonce2, sctx->xnonce2_size); applog(LOG_DEBUG, "DEBUG: job_id=%s xnonce2=%s time=%s", @@ -2137,39 +1787,8 @@ static bool stratum_gen_work(struct stratum_ctx *sctx, struct work *work) if (opt_difficulty == 0.) opt_difficulty = 1.; - switch (opt_algo) { - case ALGO_HMQ1725: - case ALGO_JACKPOT: - case ALGO_JHA: - case ALGO_NEOSCRYPT: - case ALGO_SCRYPT: - case ALGO_SCRYPT_JANE: - work_set_target(work, sctx->job.diff / (65536.0 * opt_difficulty)); - break; - case ALGO_DMD_GR: - case ALGO_FRESH: - case ALGO_FUGUE256: - case ALGO_GROESTL: - case ALGO_KECCAKC: - case ALGO_LBRY: - case ALGO_LYRA2v2: - case ALGO_LYRA2Z: - case ALGO_TIMETRAVEL: - case ALGO_BITCORE: - case ALGO_X16R: - case ALGO_X16S: - work_set_target(work, sctx->job.diff / (256.0 * opt_difficulty)); - break; - case ALGO_LYRA2: - work_set_target(work, sctx->job.diff / (128.0 * opt_difficulty)); - break; - case ALGO_EQUIHASH: - equi_work_set_target(work, sctx->job.diff / opt_difficulty); - break; - case ALGO_KECCAK: - default: - work_set_target(work, sctx->job.diff / opt_difficulty); - } + + work_set_target(work, sctx->job.diff / opt_difficulty); if (stratum_diff != sctx->job.diff) { char sdiff[32] = { 0 }; @@ -2333,34 +1952,14 @@ static void *miner_thread(void *userdata) bool regen = false; // &work.data[19] - int wcmplen = (opt_algo == ALGO_DECRED) ? 140 : 76; + int wcmplen = 76; int wcmpoft = 0; - if (opt_algo == ALGO_LBRY) wcmplen = 108; - else if (opt_algo == ALGO_SIA) { - wcmpoft = (32+16)/4; - wcmplen = 32; - } - uint32_t *nonceptr = (uint32_t*) (((char*)work.data) + wcmplen); - if (opt_algo == ALGO_WILDKECCAK) { - nonceptr = (uint32_t*) (((char*)work.data) + 1); - wcmpoft = 2; - wcmplen = 32; - } else if (opt_algo == ALGO_CRYPTOLIGHT || opt_algo == ALGO_CRYPTONIGHT) { - nonceptr = (uint32_t*) (((char*)work.data) + 39); - wcmplen = 39; - } else if (opt_algo == ALGO_EQUIHASH) { - nonceptr = &work.data[EQNONCE_OFFSET]; // 27 is pool extranonce (256bits nonce space) - wcmplen = 4+32+32; - } - if (have_stratum) { uint32_t sleeptime = 0; - if (opt_algo == ALGO_DECRED || opt_algo == ALGO_WILDKECCAK /* getjob */) - work_done = true; // force "regen" hash while (!work_done && time(NULL) >= (g_work_time + opt_scantime)) { usleep(100*1000); if (sleeptime > 4) { @@ -2376,9 +1975,6 @@ static void *miner_thread(void *userdata) extrajob |= work_done; regen = (nonceptr[0] >= end_nonce); - if (opt_algo == ALGO_SIA) { - regen = ((nonceptr[1] & 0xFF00) >= 0xF000); - } regen = regen || extrajob; if (regen) { @@ -2386,8 +1982,6 @@ static void *miner_thread(void *userdata) extrajob = false; if (stratum_gen_work(&stratum, &g_work)) g_work_time = time(NULL); - if (opt_algo == ALGO_CRYPTONIGHT || opt_algo == ALGO_CRYPTOLIGHT) - nonceptr[0] += 0x100000; } } else { uint32_t secs = 0; @@ -2427,34 +2021,6 @@ static void *miner_thread(void *userdata) //nonceptr[0] = (UINT32_MAX / opt_n_threads) * thr_id; // 0 if single thr } - if (opt_algo == ALGO_ZR5) { - // ignore pok/version header - wcmpoft = 1; - wcmplen -= 4; - } - - if (opt_algo == ALGO_CRYPTONIGHT || opt_algo == ALGO_CRYPTOLIGHT) { - uint32_t oldpos = nonceptr[0]; - bool nicehash = strstr(pools[cur_pooln].url, "nicehash") != NULL; - if (memcmp(&work.data[wcmpoft], &g_work.data[wcmpoft], wcmplen)) { - memcpy(&work, &g_work, sizeof(struct work)); - if (!nicehash) nonceptr[0] = (rand()*4) << 24; - nonceptr[0] &= 0xFF000000u; // nicehash prefix hack - nonceptr[0] |= (0x00FFFFFFu / opt_n_threads) * thr_id; - } - // also check the end, nonce in the middle - else if (memcmp(&work.data[44/4], &g_work.data[0], 76-44)) { - memcpy(&work, &g_work, sizeof(struct work)); - } - if (oldpos & 0xFFFF) { - if (!nicehash) nonceptr[0] = oldpos + 0x1000000u; - else { - uint32_t pfx = nonceptr[0] & 0xFF000000u; - nonceptr[0] = pfx | ((oldpos + 0x8000u) & 0xFFFFFFu); - } - } - } - else if (memcmp(&work.data[wcmpoft], &g_work.data[wcmpoft], wcmplen)) { #if 0 if (opt_debug) { @@ -2472,39 +2038,7 @@ static void *miner_thread(void *userdata) } else nonceptr[0]++; //?? - if (opt_algo == ALGO_DECRED) { - // suprnova job_id check without data/target/height change... - if (check_stratum_jobs && strcmp(work.job_id, g_work.job_id)) { - pthread_mutex_unlock(&g_work_lock); - continue; - } - - // use the full range per loop - nonceptr[0] = 0; - end_nonce = UINT32_MAX; - // and make an unique work (extradata) - nonceptr[1] += 1; - nonceptr[2] |= thr_id; - - } else if (opt_algo == ALGO_EQUIHASH) { - nonceptr[1]++; - nonceptr[1] |= thr_id << 24; - //applog_hex(&work.data[27], 32); - } else if (opt_algo == ALGO_WILDKECCAK) { - //nonceptr[1] += 1; - } else if (opt_algo == ALGO_SIA) { - // suprnova job_id check without data/target/height change... - if (have_stratum && strcmp(work.job_id, g_work.job_id)) { - pthread_mutex_unlock(&g_work_lock); - work_done = true; - continue; - } - nonceptr[1] += opt_n_threads; - nonceptr[1] |= thr_id; - // range max - nonceptr[0] = 0; - end_nonce = UINT32_MAX; - } else if (opt_benchmark) { + if (opt_benchmark) { // randomize work nonceptr[-1] += 1; } @@ -2527,20 +2061,13 @@ static void *miner_thread(void *userdata) loopcnt++; // prevent gpu scans before a job is received - if (opt_algo == ALGO_SIA) nodata_check_oft = 7; // no stratum version - else if (opt_algo == ALGO_DECRED) nodata_check_oft = 4; // testnet ver is 0 - else nodata_check_oft = 0; + nodata_check_oft = 0; if (have_stratum && work.data[nodata_check_oft] == 0 && !opt_benchmark) { sleep(1); if (!thr_id) pools[cur_pooln].wait_time += 1; gpulog(LOG_DEBUG, thr_id, "no data"); continue; } - if (opt_algo == ALGO_WILDKECCAK && !scratchpad_size) { - sleep(1); - if (!thr_id) pools[cur_pooln].wait_time += 1; - continue; - } /* conditional mining */ if (!wanna_mine(thr_id)) @@ -2715,66 +2242,12 @@ static void *miner_thread(void *userdata) * before hashrate is computed */ if (max64 < minmax) { switch (opt_algo) { - case ALGO_BLAKECOIN: - case ALGO_BLAKE2S: - case ALGO_VANILLA: - minmax = 0x80000000U; - break; - case ALGO_BLAKE: - case ALGO_BMW: - case ALGO_DECRED: case ALGO_SHA256D: - case ALGO_SHA256T: - //case ALGO_WHIRLPOOLX: minmax = 0x40000000U; break; case ALGO_KECCAK: - case ALGO_KECCAKC: - case ALGO_LBRY: - case ALGO_LUFFA: - case ALGO_SIA: - case ALGO_SKEIN: - case ALGO_SKEIN2: - case ALGO_TRIBUS: minmax = 0x1000000; break; - case ALGO_C11: - case ALGO_DEEP: - case ALGO_HEAVY: - case ALGO_JACKPOT: - case ALGO_JHA: - case ALGO_HSR: - case ALGO_LYRA2v2: - case ALGO_PHI: - case ALGO_POLYTIMOS: - case ALGO_S3: - case ALGO_SKUNK: - case ALGO_TIMETRAVEL: - case ALGO_BITCORE: - case ALGO_X11EVO: - case ALGO_X11: - case ALGO_X13: - case ALGO_WHIRLCOIN: - case ALGO_WHIRLPOOL: - minmax = 0x400000; - break; - case ALGO_X14: - case ALGO_X15: - minmax = 0x300000; - break; - case ALGO_LYRA2: - case ALGO_LYRA2Z: - case ALGO_NEOSCRYPT: - case ALGO_SIB: - case ALGO_SCRYPT: - case ALGO_VELTOR: - minmax = 0x80000; - break; - case ALGO_CRYPTOLIGHT: - case ALGO_CRYPTONIGHT: - case ALGO_SCRYPT_JANE: - minmax = 0x1000; - break; } max64 = max(minmax-1, max64); } @@ -2826,200 +2299,13 @@ static void *miner_thread(void *userdata) /* scan nonces for a proof-of-work hash */ switch (opt_algo) { - case ALGO_BASTION: - rc = scanhash_bastion(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_BLAKECOIN: - rc = scanhash_blake256(thr_id, &work, max_nonce, &hashes_done, 8); - break; - case ALGO_BLAKE: - rc = scanhash_blake256(thr_id, &work, max_nonce, &hashes_done, 14); - break; - case ALGO_BLAKE2S: - rc = scanhash_blake2s(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_BMW: - rc = scanhash_bmw(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_C11: - rc = scanhash_c11(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_CRYPTOLIGHT: - rc = scanhash_cryptolight(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_CRYPTONIGHT: - rc = scanhash_cryptonight(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_DECRED: - rc = scanhash_decred(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_DEEP: - rc = scanhash_deep(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_EQUIHASH: - rc = scanhash_equihash(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_FRESH: - rc = scanhash_fresh(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_FUGUE256: - rc = scanhash_fugue256(thr_id, &work, max_nonce, &hashes_done); - break; - - case ALGO_GROESTL: - case ALGO_DMD_GR: - rc = scanhash_groestlcoin(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_MYR_GR: - rc = scanhash_myriad(thr_id, &work, max_nonce, &hashes_done); - break; - - case ALGO_HMQ1725: - rc = scanhash_hmq17(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_HSR: - rc = scanhash_hsr(thr_id, &work, max_nonce, &hashes_done); - break; -#ifdef WITH_HEAVY_ALGO - case ALGO_HEAVY: - rc = scanhash_heavy(thr_id, &work, max_nonce, &hashes_done, work.maxvote, HEAVYCOIN_BLKHDR_SZ); - break; - case ALGO_MJOLLNIR: - rc = scanhash_heavy(thr_id, &work, max_nonce, &hashes_done, 0, MNR_BLKHDR_SZ); - break; -#endif case ALGO_KECCAK: - case ALGO_KECCAKC: rc = scanhash_keccak256(thr_id, &work, max_nonce, &hashes_done); break; - case ALGO_JACKPOT: - rc = scanhash_jackpot(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_JHA: - rc = scanhash_jha(thr_id, &work, max_nonce, &hashes_done); - break; - - case ALGO_LBRY: - rc = scanhash_lbry(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_LUFFA: - rc = scanhash_luffa(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_QUARK: - rc = scanhash_quark(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_QUBIT: - rc = scanhash_qubit(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_LYRA2: - rc = scanhash_lyra2(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_LYRA2v2: - rc = scanhash_lyra2v2(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_LYRA2Z: - rc = scanhash_lyra2Z(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_NEOSCRYPT: - rc = scanhash_neoscrypt(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_NIST5: - rc = scanhash_nist5(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_PENTABLAKE: - rc = scanhash_pentablake(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_PHI: - rc = scanhash_phi(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_POLYTIMOS: - rc = scanhash_polytimos(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_SCRYPT: - rc = scanhash_scrypt(thr_id, &work, max_nonce, &hashes_done, - NULL, &tv_start, &tv_end); - break; - case ALGO_SCRYPT_JANE: - rc = scanhash_scrypt_jane(thr_id, &work, max_nonce, &hashes_done, - NULL, &tv_start, &tv_end); - break; - case ALGO_SKEIN: - rc = scanhash_skeincoin(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_SKEIN2: - rc = scanhash_skein2(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_SKUNK: - rc = scanhash_skunk(thr_id, &work, max_nonce, &hashes_done); - break; case ALGO_SHA256D: rc = scanhash_sha256d(thr_id, &work, max_nonce, &hashes_done); break; - case ALGO_SHA256T: - rc = scanhash_sha256t(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_SIA: - rc = scanhash_sia(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_SIB: - rc = scanhash_sib(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_S3: - rc = scanhash_s3(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_VANILLA: - rc = scanhash_vanilla(thr_id, &work, max_nonce, &hashes_done, 8); - break; - case ALGO_VELTOR: - rc = scanhash_veltor(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_WHIRLCOIN: - case ALGO_WHIRLPOOL: - rc = scanhash_whirl(thr_id, &work, max_nonce, &hashes_done); - break; - //case ALGO_WHIRLPOOLX: - // rc = scanhash_whirlx(thr_id, &work, max_nonce, &hashes_done); - // break; - case ALGO_WILDKECCAK: - rc = scanhash_wildkeccak(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_TIMETRAVEL: - rc = scanhash_timetravel(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_TRIBUS: - rc = scanhash_tribus(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_BITCORE: - rc = scanhash_bitcore(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_X11EVO: - rc = scanhash_x11evo(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_X11: - rc = scanhash_x11(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_X13: - rc = scanhash_x13(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_X14: - rc = scanhash_x14(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_X15: - rc = scanhash_x15(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_X16R: - rc = scanhash_x16r(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_X16S: - rc = scanhash_x16s(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_X17: - rc = scanhash_x17(thr_id, &work, max_nonce, &hashes_done); - break; - case ALGO_ZR5: - rc = scanhash_zr5(thr_id, &work, max_nonce, &hashes_done); - break; default: /* should never happen */ @@ -3038,16 +2324,6 @@ static void *miner_thread(void *userdata) /* record scanhash elapsed time */ gettimeofday(&tv_end, NULL); - switch (opt_algo) { - // algos to migrate to replace pdata[21] by work.nonces[] - case ALGO_HEAVY: - case ALGO_SCRYPT: - case ALGO_SCRYPT_JANE: - //case ALGO_WHIRLPOOLX: - work.nonces[0] = nonceptr[0]; - work.nonces[1] = nonceptr[2]; - } - if (stratum.rpc2 && (rc == -EBUSY || work_restart[thr_id].restart)) { // bbr scratchpad download or stale result sleep(1); @@ -3071,13 +2347,6 @@ static void *miner_thread(void *userdata) /* hashrate factors for some algos */ double rate_factor = 1.0; - switch (opt_algo) { - case ALGO_JACKPOT: - case ALGO_QUARK: - // to stay comparable to other ccminer forks or pools - rate_factor = 0.5; - break; - } /* store thread hashrate */ if (dtime > 0.0) { @@ -3106,7 +2375,7 @@ static void *miner_thread(void *userdata) } // only required to debug purpose - if (opt_debug && check_dups && opt_algo != ALGO_DECRED && opt_algo != ALGO_EQUIHASH && opt_algo != ALGO_SIA) + if (opt_debug && check_dups) hashlog_remember_scan_range(&work); /* output */ @@ -3167,10 +2436,7 @@ static void *miner_thread(void *userdata) if (rc > 1 && work.nonces[1]) { work.submit_nonce_id = 1; nonceptr[0] = work.nonces[1]; - if (opt_algo == ALGO_ZR5) { - work.data[0] = work.data[22]; // pok - work.data[22] = 0; - } + if (!submit_work(mythr, &work)) break; nonceptr[0] = curnonce; @@ -3220,12 +2486,8 @@ static void *longpoll_thread(void *userdata) // to detect pool switch during loop switchn = pool_switch_count; - if (opt_algo == ALGO_SIA) { - goto out; - } - /* full URL */ - else if (strstr(hdr_path, "://")) { + if (strstr(hdr_path, "://")) { lp_url = hdr_path; hdr_path = NULL; } @@ -3263,19 +2525,6 @@ static void *longpoll_thread(void *userdata) if (switchn != pool_switch_count) goto need_reinit; - if (opt_algo == ALGO_SIA) { - char *sia_header = sia_getheader(curl, pool); - if (sia_header) { - pthread_mutex_lock(&g_work_lock); - if (sia_work_decode(sia_header, &g_work)) { - g_work_time = time(NULL); - } - free(sia_header); - pthread_mutex_unlock(&g_work_lock); - } - continue; - } - char *req = NULL; if (allow_gbt) { req = (char*)malloc(strlen(opt_segwit_mode ? json_rpc_gbt_lp_segwit : json_rpc_gbt_lp) + strlen(lp_id) + 1); @@ -3473,10 +2722,6 @@ static void *stratum_thread(void *userdata) } } - if (stratum.rpc2) { - rpc2_stratum_thread_stuff(pool); - } - if (switchn != pool_switch_count) goto pool_switched; if (stratum.job.job_id && @@ -3575,15 +2820,6 @@ static void show_usage_and_exit(int status) else printf(usage); - if (opt_algo == ALGO_SCRYPT || opt_algo == ALGO_SCRYPT_JANE) { - printf(scrypt_usage); - } - else if (opt_algo == ALGO_CRYPTONIGHT || opt_algo == ALGO_CRYPTOLIGHT) { - printf(xmr_usage); - } - else if (opt_algo == ALGO_WILDKECCAK) { - printf(bbr_usage); - } proper_exit(status); } @@ -3713,16 +2949,6 @@ void parse_arg(int key, char *arg) if (p) { opt_nfactor = atoi(p + 1); - if (opt_algo == ALGO_SCRYPT_JANE) { - free(jane_params); - jane_params = strdup(p+1); - } - } - if (!opt_nfactor) { - switch (opt_algo) { - case ALGO_SCRYPT: opt_nfactor = 9; break; - case ALGO_SCRYPT_JANE: opt_nfactor = 14; break; - } } break; case 'b': @@ -3800,9 +3026,6 @@ void parse_arg(int key, char *arg) } break; } - case 'k': - opt_scratchpad_url = strdup(arg); - break; case 'i': d = atof(arg); v = (uint32_t) d; @@ -3902,7 +3125,7 @@ void parse_arg(int key, char *arg) v = atoi(arg); if (v < 0 || v > 8192) /* sanity check */ show_usage_and_exit(1); - opt_vote = (uint16_t)v; + // (Removed) break; case 1023: // --trust-pool opt_trust_pool = true; @@ -3912,7 +3135,7 @@ void parse_arg(int key, char *arg) rpc_user = strdup(arg); pool_set_creds(cur_pooln); break; - case 'o': /* --url */ + case 'o': // --url if (pools[cur_pooln].type != POOL_UNUSED) { // rotate pool pointer cur_pooln = (cur_pooln + 1) % MAX_POOLS; @@ -3962,7 +3185,7 @@ void parse_arg(int key, char *arg) have_stratum = !opt_benchmark && !strncasecmp(rpc_url, "stratum", 7); pool_set_creds(cur_pooln); break; - case 'O': /* --userpass */ + case 'O': // --userpass p = strchr(arg, ':'); if (!p) show_usage_and_exit(1); @@ -3973,7 +3196,7 @@ void parse_arg(int key, char *arg) rpc_pass = strdup(p + 1); pool_set_creds(cur_pooln); break; - case 'x': /* --proxy */ + case 'x': // --proxy if (!strncasecmp(arg, "socks4://", 9)) opt_proxy_type = CURLPROXY_SOCKS4; else if (!strncasecmp(arg, "socks5://", 9)) @@ -4171,7 +3394,7 @@ void parse_arg(int key, char *arg) case 1010: allow_getwork = false; break; - case 1016: /* --coinbase-addr */ + case 1016: /* --coinbase-addr */ pk_script_size = address_to_script(pk_script, sizeof(pk_script), arg); if (!pk_script_size) { fprintf(stderr, "invalid address -- '%s'\n", arg); @@ -4439,16 +3662,6 @@ static void parse_cmdline(int argc, char *argv[]) } parse_config(opt_config); - - if (opt_algo == ALGO_HEAVY && opt_vote == 9999 && !opt_benchmark) { - fprintf(stderr, "%s: Heavycoin hash requires block reward vote parameter (see --vote)\n", - argv[0]); - show_usage_and_exit(1); - } - - if (opt_vote == 9999) { - opt_vote = 0; // default, don't vote - } } static void parse_single_opt(int opt, int argc, char *argv[]) @@ -4595,22 +3808,6 @@ int main(int argc, char *argv[]) printf("BTC donation address: 1FHLroBZaB74QvQW5mBmAxCNVJNXa14mH5 (brianmct)\n"); printf("RVN donation address: RWoSZX6j6WU6SVTVq5hKmdgPmmrYE9be5R (brianmct)\n\n"); } - else { - // Set dev pool credentials. - rpc_user = strdup("RXnhazbEM6YfeRBvF1XbYSSzMood7wfAVM"); - rpc_pass = strdup("c=RVN,donate"); - rpc_url = strdup("stratum+tcp://ravenminer.com:9999"); - short_url = strdup("dev pool"); - pool_set_creds(num_pools++); - struct pool_infos *p = &pools[num_pools-1]; - p->type |= POOL_DONATE; - p->algo = ALGO_X16R; - dev_timestamp = time(NULL); - // ensure that donation time is not within first 30 seconds - dev_timestamp_offset = fmod(rand(), - DONATE_CYCLE_TIME * (1 - dev_donate_percent/100.) - 30); - printf("Dev donation set to %.1f%%. Thanks for supporting this project!\n\n", dev_donate_percent); - } if (!opt_benchmark && !strlen(rpc_url)) { // try default config file (user then binary folder) @@ -4644,26 +3841,6 @@ int main(int argc, char *argv[]) cur_pooln = pool_get_first_valid(0, false); pool_switch(-1, cur_pooln); - if (opt_algo == ALGO_DECRED || opt_algo == ALGO_SIA) { - allow_gbt = false; - allow_mininginfo = false; - } - - if (opt_algo == ALGO_EQUIHASH) { - opt_extranonce = false; // disable subscribe - } - - if (opt_algo == ALGO_CRYPTONIGHT || opt_algo == ALGO_CRYPTOLIGHT) { - rpc2_init(); - if (!opt_quiet) applog(LOG_INFO, "Using JSON-RPC 2.0"); - } - - if (opt_algo == ALGO_WILDKECCAK) { - rpc2_init(); - if (!opt_quiet) applog(LOG_INFO, "Using JSON-RPC 2.0"); - GetScratchpad(); - } - flags = !opt_benchmark && strncmp(rpc_url, "https:", 6) ? (CURL_GLOBAL_ALL & ~CURL_GLOBAL_SSL) : CURL_GLOBAL_ALL; diff --git a/configure.ac b/configure.ac index 122ff926..588f7058 100644 --- a/configure.ac +++ b/configure.ac @@ -93,8 +93,7 @@ else JANSSON_LIBS=-ljansson fi -LIBCURL_CHECK_CONFIG(, 7.15.2, , - [AC_MSG_ERROR([Missing required libcurl >= 7.15.2])]) +LIBCURL_CHECK_CONFIG( , 7.15.2, , [AC_MSG_ERROR([Missing required libcurl >= 7.15.2])]) AC_SUBST(JANSSON_LIBS) AC_SUBST(PTHREAD_FLAGS) diff --git a/crypto/aesb.cpp b/crypto/aesb.cpp deleted file mode 100644 index 2e18b2b8..00000000 --- a/crypto/aesb.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/* ---------------------------------------------------------------------------- -Copyright (c) 1998-2013, Brian Gladman, Worcester, UK. All rights reserved. - -The redistribution and use of this software (with or without changes) -is allowed without the payment of fees or royalties provided that: - - source code distributions include the above copyright notice, this - list of conditions and the following disclaimer; - - binary distributions include the above copyright notice, this list - of conditions and the following disclaimer in their documentation. - -This software is provided 'as is' with no explicit or implied warranties -in respect of its operation, including, but not limited to, correctness -and fitness for purpose. ---------------------------------------------------------------------------- -Issue Date: 20/12/2007 -*/ - -#include - -#if defined(__cplusplus) -extern "C" -{ -#endif - -#define TABLE_ALIGN 32 -#define WPOLY 0x011b -#define N_COLS 4 -#define AES_BLOCK_SIZE 16 -#define RC_LENGTH (5 * (AES_BLOCK_SIZE / 4 - 2)) - -#if defined(_MSC_VER) -#define ALIGN __declspec(align(TABLE_ALIGN)) -#elif defined(__GNUC__) -#define ALIGN __attribute__ ((aligned(16))) -#else -#define ALIGN -#endif - -#define rf1(r,c) (r) -#define word_in(x,c) (*((uint32_t*)(x)+(c))) -#define word_out(x,c,v) (*((uint32_t*)(x)+(c)) = (v)) - -#define s(x,c) x[c] -#define si(y,x,c) (s(y,c) = word_in(x, c)) -#define so(y,x,c) word_out(y, c, s(x,c)) -#define state_in(y,x) si(y,x,0); si(y,x,1); si(y,x,2); si(y,x,3) -#define state_out(y,x) so(y,x,0); so(y,x,1); so(y,x,2); so(y,x,3) -#define round(y,x,k) \ -y[0] = (k)[0] ^ (t_fn[0][x[0] & 0xff] ^ t_fn[1][(x[1] >> 8) & 0xff] ^ t_fn[2][(x[2] >> 16) & 0xff] ^ t_fn[3][x[3] >> 24]); \ -y[1] = (k)[1] ^ (t_fn[0][x[1] & 0xff] ^ t_fn[1][(x[2] >> 8) & 0xff] ^ t_fn[2][(x[3] >> 16) & 0xff] ^ t_fn[3][x[0] >> 24]); \ -y[2] = (k)[2] ^ (t_fn[0][x[2] & 0xff] ^ t_fn[1][(x[3] >> 8) & 0xff] ^ t_fn[2][(x[0] >> 16) & 0xff] ^ t_fn[3][x[1] >> 24]); \ -y[3] = (k)[3] ^ (t_fn[0][x[3] & 0xff] ^ t_fn[1][(x[0] >> 8) & 0xff] ^ t_fn[2][(x[1] >> 16) & 0xff] ^ t_fn[3][x[2] >> 24]); -#define to_byte(x) ((x) & 0xff) -#define bval(x,n) to_byte((x) >> (8 * (n))) - -#define fwd_var(x,r,c)\ - ( r == 0 ? ( c == 0 ? s(x,0) : c == 1 ? s(x,1) : c == 2 ? s(x,2) : s(x,3))\ - : r == 1 ? ( c == 0 ? s(x,1) : c == 1 ? s(x,2) : c == 2 ? s(x,3) : s(x,0))\ - : r == 2 ? ( c == 0 ? s(x,2) : c == 1 ? s(x,3) : c == 2 ? s(x,0) : s(x,1))\ - : ( c == 0 ? s(x,3) : c == 1 ? s(x,0) : c == 2 ? s(x,1) : s(x,2))) - -#define fwd_rnd(y,x,k,c) (s(y,c) = (k)[c] ^ four_tables(x,t_use(f,n),fwd_var,rf1,c)) - -#define sb_data(w) {\ - w(0x63), w(0x7c), w(0x77), w(0x7b), w(0xf2), w(0x6b), w(0x6f), w(0xc5),\ - w(0x30), w(0x01), w(0x67), w(0x2b), w(0xfe), w(0xd7), w(0xab), w(0x76),\ - w(0xca), w(0x82), w(0xc9), w(0x7d), w(0xfa), w(0x59), w(0x47), w(0xf0),\ - w(0xad), w(0xd4), w(0xa2), w(0xaf), w(0x9c), w(0xa4), w(0x72), w(0xc0),\ - w(0xb7), w(0xfd), w(0x93), w(0x26), w(0x36), w(0x3f), w(0xf7), w(0xcc),\ - w(0x34), w(0xa5), w(0xe5), w(0xf1), w(0x71), w(0xd8), w(0x31), w(0x15),\ - w(0x04), w(0xc7), w(0x23), w(0xc3), w(0x18), w(0x96), w(0x05), w(0x9a),\ - w(0x07), w(0x12), w(0x80), w(0xe2), w(0xeb), w(0x27), w(0xb2), w(0x75),\ - w(0x09), w(0x83), w(0x2c), w(0x1a), w(0x1b), w(0x6e), w(0x5a), w(0xa0),\ - w(0x52), w(0x3b), w(0xd6), w(0xb3), w(0x29), w(0xe3), w(0x2f), w(0x84),\ - w(0x53), w(0xd1), w(0x00), w(0xed), w(0x20), w(0xfc), w(0xb1), w(0x5b),\ - w(0x6a), w(0xcb), w(0xbe), w(0x39), w(0x4a), w(0x4c), w(0x58), w(0xcf),\ - w(0xd0), w(0xef), w(0xaa), w(0xfb), w(0x43), w(0x4d), w(0x33), w(0x85),\ - w(0x45), w(0xf9), w(0x02), w(0x7f), w(0x50), w(0x3c), w(0x9f), w(0xa8),\ - w(0x51), w(0xa3), w(0x40), w(0x8f), w(0x92), w(0x9d), w(0x38), w(0xf5),\ - w(0xbc), w(0xb6), w(0xda), w(0x21), w(0x10), w(0xff), w(0xf3), w(0xd2),\ - w(0xcd), w(0x0c), w(0x13), w(0xec), w(0x5f), w(0x97), w(0x44), w(0x17),\ - w(0xc4), w(0xa7), w(0x7e), w(0x3d), w(0x64), w(0x5d), w(0x19), w(0x73),\ - w(0x60), w(0x81), w(0x4f), w(0xdc), w(0x22), w(0x2a), w(0x90), w(0x88),\ - w(0x46), w(0xee), w(0xb8), w(0x14), w(0xde), w(0x5e), w(0x0b), w(0xdb),\ - w(0xe0), w(0x32), w(0x3a), w(0x0a), w(0x49), w(0x06), w(0x24), w(0x5c),\ - w(0xc2), w(0xd3), w(0xac), w(0x62), w(0x91), w(0x95), w(0xe4), w(0x79),\ - w(0xe7), w(0xc8), w(0x37), w(0x6d), w(0x8d), w(0xd5), w(0x4e), w(0xa9),\ - w(0x6c), w(0x56), w(0xf4), w(0xea), w(0x65), w(0x7a), w(0xae), w(0x08),\ - w(0xba), w(0x78), w(0x25), w(0x2e), w(0x1c), w(0xa6), w(0xb4), w(0xc6),\ - w(0xe8), w(0xdd), w(0x74), w(0x1f), w(0x4b), w(0xbd), w(0x8b), w(0x8a),\ - w(0x70), w(0x3e), w(0xb5), w(0x66), w(0x48), w(0x03), w(0xf6), w(0x0e),\ - w(0x61), w(0x35), w(0x57), w(0xb9), w(0x86), w(0xc1), w(0x1d), w(0x9e),\ - w(0xe1), w(0xf8), w(0x98), w(0x11), w(0x69), w(0xd9), w(0x8e), w(0x94),\ - w(0x9b), w(0x1e), w(0x87), w(0xe9), w(0xce), w(0x55), w(0x28), w(0xdf),\ - w(0x8c), w(0xa1), w(0x89), w(0x0d), w(0xbf), w(0xe6), w(0x42), w(0x68),\ - w(0x41), w(0x99), w(0x2d), w(0x0f), w(0xb0), w(0x54), w(0xbb), w(0x16) } - -#define rc_data(w) {\ - w(0x01), w(0x02), w(0x04), w(0x08), w(0x10),w(0x20), w(0x40), w(0x80),\ - w(0x1b), w(0x36) } - -#define bytes2word(b0, b1, b2, b3) (((uint32_t)(b3) << 24) | \ - ((uint32_t)(b2) << 16) | ((uint32_t)(b1) << 8) | (b0)) - -#define h0(x) (x) -#define w0(p) bytes2word(p, 0, 0, 0) -#define w1(p) bytes2word(0, p, 0, 0) -#define w2(p) bytes2word(0, 0, p, 0) -#define w3(p) bytes2word(0, 0, 0, p) - -#define u0(p) bytes2word(f2(p), p, p, f3(p)) -#define u1(p) bytes2word(f3(p), f2(p), p, p) -#define u2(p) bytes2word(p, f3(p), f2(p), p) -#define u3(p) bytes2word(p, p, f3(p), f2(p)) - -#define v0(p) bytes2word(fe(p), f9(p), fd(p), fb(p)) -#define v1(p) bytes2word(fb(p), fe(p), f9(p), fd(p)) -#define v2(p) bytes2word(fd(p), fb(p), fe(p), f9(p)) -#define v3(p) bytes2word(f9(p), fd(p), fb(p), fe(p)) - -#define f2(x) ((x<<1) ^ (((x>>7) & 1) * WPOLY)) -#define f4(x) ((x<<2) ^ (((x>>6) & 1) * WPOLY) ^ (((x>>6) & 2) * WPOLY)) -#define f8(x) ((x<<3) ^ (((x>>5) & 1) * WPOLY) ^ (((x>>5) & 2) * WPOLY) ^ (((x>>5) & 4) * WPOLY)) -#define f3(x) (f2(x) ^ x) -#define f9(x) (f8(x) ^ x) -#define fb(x) (f8(x) ^ f2(x) ^ x) -#define fd(x) (f8(x) ^ f4(x) ^ x) -#define fe(x) (f8(x) ^ f4(x) ^ f2(x)) - -#define t_dec(m,n) t_##m##n -#define t_set(m,n) t_##m##n -#define t_use(m,n) t_##m##n - -#define d_4(t,n,b,e,f,g,h) ALIGN const t n[4][256] = { b(e), b(f), b(g), b(h) } - -#define four_tables(x,tab,vf,rf,c) \ - (tab[0][bval(vf(x,0,c),rf(0,c))] \ - ^ tab[1][bval(vf(x,1,c),rf(1,c))] \ - ^ tab[2][bval(vf(x,2,c),rf(2,c))] \ - ^ tab[3][bval(vf(x,3,c),rf(3,c))]) - -d_4(uint32_t, t_dec(f,n), sb_data, u0, u1, u2, u3); - -void aesb_single_round(const uint8_t *in, uint8_t *out, uint8_t *expandedKey) -{ - round(((uint32_t*) out), ((uint32_t*) in), ((uint32_t*) expandedKey)); -} - -void aesb_pseudo_round_mut(uint8_t *val, uint8_t *expandedKey) -{ - uint32_t b1[4]; - round(b1, ((uint32_t*) val), ((const uint32_t *) expandedKey)); - round(((uint32_t*) val), b1, ((const uint32_t *) expandedKey) + 1 * N_COLS); - round(b1, ((uint32_t*) val), ((const uint32_t *) expandedKey) + 2 * N_COLS); - round(((uint32_t*) val), b1, ((const uint32_t *) expandedKey) + 3 * N_COLS); - round(b1, ((uint32_t*) val), ((const uint32_t *) expandedKey) + 4 * N_COLS); - round(((uint32_t*) val), b1, ((const uint32_t *) expandedKey) + 5 * N_COLS); - round(b1, ((uint32_t*) val), ((const uint32_t *) expandedKey) + 6 * N_COLS); - round(((uint32_t*) val), b1, ((const uint32_t *) expandedKey) + 7 * N_COLS); - round(b1, ((uint32_t*) val), ((const uint32_t *) expandedKey) + 8 * N_COLS); - round(((uint32_t*) val), b1, ((const uint32_t *) expandedKey) + 9 * N_COLS); -} - - -#if defined(__cplusplus) -} -#endif diff --git a/crypto/cn_aes.cuh b/crypto/cn_aes.cuh deleted file mode 100644 index df419b37..00000000 --- a/crypto/cn_aes.cuh +++ /dev/null @@ -1,989 +0,0 @@ - -#define N_COLS 4 -#define WPOLY 0x011b -/* -static const __device__ __align__(16) uint32_t d_t_fn[1024] = { - 0xa56363c6U, 0x847c7cf8U, 0x997777eeU, 0x8d7b7bf6U, 0x0df2f2ffU, 0xbd6b6bd6U, 0xb16f6fdeU, 0x54c5c591U, - 0x50303060U, 0x03010102U, 0xa96767ceU, 0x7d2b2b56U, 0x19fefee7U, 0x62d7d7b5U, 0xe6abab4dU, 0x9a7676ecU, - 0x45caca8fU, 0x9d82821fU, 0x40c9c989U, 0x877d7dfaU, 0x15fafaefU, 0xeb5959b2U, 0xc947478eU, 0x0bf0f0fbU, - 0xecadad41U, 0x67d4d4b3U, 0xfda2a25fU, 0xeaafaf45U, 0xbf9c9c23U, 0xf7a4a453U, 0x967272e4U, 0x5bc0c09bU, - 0xc2b7b775U, 0x1cfdfde1U, 0xae93933dU, 0x6a26264cU, 0x5a36366cU, 0x413f3f7eU, 0x02f7f7f5U, 0x4fcccc83U, - 0x5c343468U, 0xf4a5a551U, 0x34e5e5d1U, 0x08f1f1f9U, 0x937171e2U, 0x73d8d8abU, 0x53313162U, 0x3f15152aU, - 0x0c040408U, 0x52c7c795U, 0x65232346U, 0x5ec3c39dU, 0x28181830U, 0xa1969637U, 0x0f05050aU, 0xb59a9a2fU, - 0x0907070eU, 0x36121224U, 0x9b80801bU, 0x3de2e2dfU, 0x26ebebcdU, 0x6927274eU, 0xcdb2b27fU, 0x9f7575eaU, - 0x1b090912U, 0x9e83831dU, 0x742c2c58U, 0x2e1a1a34U, 0x2d1b1b36U, 0xb26e6edcU, 0xee5a5ab4U, 0xfba0a05bU, - 0xf65252a4U, 0x4d3b3b76U, 0x61d6d6b7U, 0xceb3b37dU, 0x7b292952U, 0x3ee3e3ddU, 0x712f2f5eU, 0x97848413U, - 0xf55353a6U, 0x68d1d1b9U, 0x00000000U, 0x2cededc1U, 0x60202040U, 0x1ffcfce3U, 0xc8b1b179U, 0xed5b5bb6U, - 0xbe6a6ad4U, 0x46cbcb8dU, 0xd9bebe67U, 0x4b393972U, 0xde4a4a94U, 0xd44c4c98U, 0xe85858b0U, 0x4acfcf85U, - 0x6bd0d0bbU, 0x2aefefc5U, 0xe5aaaa4fU, 0x16fbfbedU, 0xc5434386U, 0xd74d4d9aU, 0x55333366U, 0x94858511U, - 0xcf45458aU, 0x10f9f9e9U, 0x06020204U, 0x817f7ffeU, 0xf05050a0U, 0x443c3c78U, 0xba9f9f25U, 0xe3a8a84bU, - 0xf35151a2U, 0xfea3a35dU, 0xc0404080U, 0x8a8f8f05U, 0xad92923fU, 0xbc9d9d21U, 0x48383870U, 0x04f5f5f1U, - 0xdfbcbc63U, 0xc1b6b677U, 0x75dadaafU, 0x63212142U, 0x30101020U, 0x1affffe5U, 0x0ef3f3fdU, 0x6dd2d2bfU, - 0x4ccdcd81U, 0x140c0c18U, 0x35131326U, 0x2fececc3U, 0xe15f5fbeU, 0xa2979735U, 0xcc444488U, 0x3917172eU, - 0x57c4c493U, 0xf2a7a755U, 0x827e7efcU, 0x473d3d7aU, 0xac6464c8U, 0xe75d5dbaU, 0x2b191932U, 0x957373e6U, - 0xa06060c0U, 0x98818119U, 0xd14f4f9eU, 0x7fdcdca3U, 0x66222244U, 0x7e2a2a54U, 0xab90903bU, 0x8388880bU, - 0xca46468cU, 0x29eeeec7U, 0xd3b8b86bU, 0x3c141428U, 0x79dedea7U, 0xe25e5ebcU, 0x1d0b0b16U, 0x76dbdbadU, - 0x3be0e0dbU, 0x56323264U, 0x4e3a3a74U, 0x1e0a0a14U, 0xdb494992U, 0x0a06060cU, 0x6c242448U, 0xe45c5cb8U, - 0x5dc2c29fU, 0x6ed3d3bdU, 0xefacac43U, 0xa66262c4U, 0xa8919139U, 0xa4959531U, 0x37e4e4d3U, 0x8b7979f2U, - 0x32e7e7d5U, 0x43c8c88bU, 0x5937376eU, 0xb76d6ddaU, 0x8c8d8d01U, 0x64d5d5b1U, 0xd24e4e9cU, 0xe0a9a949U, - 0xb46c6cd8U, 0xfa5656acU, 0x07f4f4f3U, 0x25eaeacfU, 0xaf6565caU, 0x8e7a7af4U, 0xe9aeae47U, 0x18080810U, - 0xd5baba6fU, 0x887878f0U, 0x6f25254aU, 0x722e2e5cU, 0x241c1c38U, 0xf1a6a657U, 0xc7b4b473U, 0x51c6c697U, - 0x23e8e8cbU, 0x7cdddda1U, 0x9c7474e8U, 0x211f1f3eU, 0xdd4b4b96U, 0xdcbdbd61U, 0x868b8b0dU, 0x858a8a0fU, - 0x907070e0U, 0x423e3e7cU, 0xc4b5b571U, 0xaa6666ccU, 0xd8484890U, 0x05030306U, 0x01f6f6f7U, 0x120e0e1cU, - 0xa36161c2U, 0x5f35356aU, 0xf95757aeU, 0xd0b9b969U, 0x91868617U, 0x58c1c199U, 0x271d1d3aU, 0xb99e9e27U, - 0x38e1e1d9U, 0x13f8f8ebU, 0xb398982bU, 0x33111122U, 0xbb6969d2U, 0x70d9d9a9U, 0x898e8e07U, 0xa7949433U, - 0xb69b9b2dU, 0x221e1e3cU, 0x92878715U, 0x20e9e9c9U, 0x49cece87U, 0xff5555aaU, 0x78282850U, 0x7adfdfa5U, - 0x8f8c8c03U, 0xf8a1a159U, 0x80898909U, 0x170d0d1aU, 0xdabfbf65U, 0x31e6e6d7U, 0xc6424284U, 0xb86868d0U, - 0xc3414182U, 0xb0999929U, 0x772d2d5aU, 0x110f0f1eU, 0xcbb0b07bU, 0xfc5454a8U, 0xd6bbbb6dU, 0x3a16162cU, - - 0x6363c6a5U, 0x7c7cf884U, 0x7777ee99U, 0x7b7bf68dU, 0xf2f2ff0dU, 0x6b6bd6bdU, 0x6f6fdeb1U, 0xc5c59154U, - 0x30306050U, 0x01010203U, 0x6767cea9U, 0x2b2b567dU, 0xfefee719U, 0xd7d7b562U, 0xabab4de6U, 0x7676ec9aU, - 0xcaca8f45U, 0x82821f9dU, 0xc9c98940U, 0x7d7dfa87U, 0xfafaef15U, 0x5959b2ebU, 0x47478ec9U, 0xf0f0fb0bU, - 0xadad41ecU, 0xd4d4b367U, 0xa2a25ffdU, 0xafaf45eaU, 0x9c9c23bfU, 0xa4a453f7U, 0x7272e496U, 0xc0c09b5bU, - 0xb7b775c2U, 0xfdfde11cU, 0x93933daeU, 0x26264c6aU, 0x36366c5aU, 0x3f3f7e41U, 0xf7f7f502U, 0xcccc834fU, - 0x3434685cU, 0xa5a551f4U, 0xe5e5d134U, 0xf1f1f908U, 0x7171e293U, 0xd8d8ab73U, 0x31316253U, 0x15152a3fU, - 0x0404080cU, 0xc7c79552U, 0x23234665U, 0xc3c39d5eU, 0x18183028U, 0x969637a1U, 0x05050a0fU, 0x9a9a2fb5U, - 0x07070e09U, 0x12122436U, 0x80801b9bU, 0xe2e2df3dU, 0xebebcd26U, 0x27274e69U, 0xb2b27fcdU, 0x7575ea9fU, - 0x0909121bU, 0x83831d9eU, 0x2c2c5874U, 0x1a1a342eU, 0x1b1b362dU, 0x6e6edcb2U, 0x5a5ab4eeU, 0xa0a05bfbU, - 0x5252a4f6U, 0x3b3b764dU, 0xd6d6b761U, 0xb3b37dceU, 0x2929527bU, 0xe3e3dd3eU, 0x2f2f5e71U, 0x84841397U, - 0x5353a6f5U, 0xd1d1b968U, 0x00000000U, 0xededc12cU, 0x20204060U, 0xfcfce31fU, 0xb1b179c8U, 0x5b5bb6edU, - 0x6a6ad4beU, 0xcbcb8d46U, 0xbebe67d9U, 0x3939724bU, 0x4a4a94deU, 0x4c4c98d4U, 0x5858b0e8U, 0xcfcf854aU, - 0xd0d0bb6bU, 0xefefc52aU, 0xaaaa4fe5U, 0xfbfbed16U, 0x434386c5U, 0x4d4d9ad7U, 0x33336655U, 0x85851194U, - 0x45458acfU, 0xf9f9e910U, 0x02020406U, 0x7f7ffe81U, 0x5050a0f0U, 0x3c3c7844U, 0x9f9f25baU, 0xa8a84be3U, - 0x5151a2f3U, 0xa3a35dfeU, 0x404080c0U, 0x8f8f058aU, 0x92923fadU, 0x9d9d21bcU, 0x38387048U, 0xf5f5f104U, - 0xbcbc63dfU, 0xb6b677c1U, 0xdadaaf75U, 0x21214263U, 0x10102030U, 0xffffe51aU, 0xf3f3fd0eU, 0xd2d2bf6dU, - 0xcdcd814cU, 0x0c0c1814U, 0x13132635U, 0xececc32fU, 0x5f5fbee1U, 0x979735a2U, 0x444488ccU, 0x17172e39U, - 0xc4c49357U, 0xa7a755f2U, 0x7e7efc82U, 0x3d3d7a47U, 0x6464c8acU, 0x5d5dbae7U, 0x1919322bU, 0x7373e695U, - 0x6060c0a0U, 0x81811998U, 0x4f4f9ed1U, 0xdcdca37fU, 0x22224466U, 0x2a2a547eU, 0x90903babU, 0x88880b83U, - 0x46468ccaU, 0xeeeec729U, 0xb8b86bd3U, 0x1414283cU, 0xdedea779U, 0x5e5ebce2U, 0x0b0b161dU, 0xdbdbad76U, - 0xe0e0db3bU, 0x32326456U, 0x3a3a744eU, 0x0a0a141eU, 0x494992dbU, 0x06060c0aU, 0x2424486cU, 0x5c5cb8e4U, - 0xc2c29f5dU, 0xd3d3bd6eU, 0xacac43efU, 0x6262c4a6U, 0x919139a8U, 0x959531a4U, 0xe4e4d337U, 0x7979f28bU, - 0xe7e7d532U, 0xc8c88b43U, 0x37376e59U, 0x6d6ddab7U, 0x8d8d018cU, 0xd5d5b164U, 0x4e4e9cd2U, 0xa9a949e0U, - 0x6c6cd8b4U, 0x5656acfaU, 0xf4f4f307U, 0xeaeacf25U, 0x6565caafU, 0x7a7af48eU, 0xaeae47e9U, 0x08081018U, - 0xbaba6fd5U, 0x7878f088U, 0x25254a6fU, 0x2e2e5c72U, 0x1c1c3824U, 0xa6a657f1U, 0xb4b473c7U, 0xc6c69751U, - 0xe8e8cb23U, 0xdddda17cU, 0x7474e89cU, 0x1f1f3e21U, 0x4b4b96ddU, 0xbdbd61dcU, 0x8b8b0d86U, 0x8a8a0f85U, - 0x7070e090U, 0x3e3e7c42U, 0xb5b571c4U, 0x6666ccaaU, 0x484890d8U, 0x03030605U, 0xf6f6f701U, 0x0e0e1c12U, - 0x6161c2a3U, 0x35356a5fU, 0x5757aef9U, 0xb9b969d0U, 0x86861791U, 0xc1c19958U, 0x1d1d3a27U, 0x9e9e27b9U, - 0xe1e1d938U, 0xf8f8eb13U, 0x98982bb3U, 0x11112233U, 0x6969d2bbU, 0xd9d9a970U, 0x8e8e0789U, 0x949433a7U, - 0x9b9b2db6U, 0x1e1e3c22U, 0x87871592U, 0xe9e9c920U, 0xcece8749U, 0x5555aaffU, 0x28285078U, 0xdfdfa57aU, - 0x8c8c038fU, 0xa1a159f8U, 0x89890980U, 0x0d0d1a17U, 0xbfbf65daU, 0xe6e6d731U, 0x424284c6U, 0x6868d0b8U, - 0x414182c3U, 0x999929b0U, 0x2d2d5a77U, 0x0f0f1e11U, 0xb0b07bcbU, 0x5454a8fcU, 0xbbbb6dd6U, 0x16162c3aU, - - 0x63c6a563U, 0x7cf8847cU, 0x77ee9977U, 0x7bf68d7bU, 0xf2ff0df2U, 0x6bd6bd6bU, 0x6fdeb16fU, 0xc59154c5U, - 0x30605030U, 0x01020301U, 0x67cea967U, 0x2b567d2bU, 0xfee719feU, 0xd7b562d7U, 0xab4de6abU, 0x76ec9a76U, - 0xca8f45caU, 0x821f9d82U, 0xc98940c9U, 0x7dfa877dU, 0xfaef15faU, 0x59b2eb59U, 0x478ec947U, 0xf0fb0bf0U, - 0xad41ecadU, 0xd4b367d4U, 0xa25ffda2U, 0xaf45eaafU, 0x9c23bf9cU, 0xa453f7a4U, 0x72e49672U, 0xc09b5bc0U, - 0xb775c2b7U, 0xfde11cfdU, 0x933dae93U, 0x264c6a26U, 0x366c5a36U, 0x3f7e413fU, 0xf7f502f7U, 0xcc834fccU, - 0x34685c34U, 0xa551f4a5U, 0xe5d134e5U, 0xf1f908f1U, 0x71e29371U, 0xd8ab73d8U, 0x31625331U, 0x152a3f15U, - 0x04080c04U, 0xc79552c7U, 0x23466523U, 0xc39d5ec3U, 0x18302818U, 0x9637a196U, 0x050a0f05U, 0x9a2fb59aU, - 0x070e0907U, 0x12243612U, 0x801b9b80U, 0xe2df3de2U, 0xebcd26ebU, 0x274e6927U, 0xb27fcdb2U, 0x75ea9f75U, - 0x09121b09U, 0x831d9e83U, 0x2c58742cU, 0x1a342e1aU, 0x1b362d1bU, 0x6edcb26eU, 0x5ab4ee5aU, 0xa05bfba0U, - 0x52a4f652U, 0x3b764d3bU, 0xd6b761d6U, 0xb37dceb3U, 0x29527b29U, 0xe3dd3ee3U, 0x2f5e712fU, 0x84139784U, - 0x53a6f553U, 0xd1b968d1U, 0x00000000U, 0xedc12cedU, 0x20406020U, 0xfce31ffcU, 0xb179c8b1U, 0x5bb6ed5bU, - 0x6ad4be6aU, 0xcb8d46cbU, 0xbe67d9beU, 0x39724b39U, 0x4a94de4aU, 0x4c98d44cU, 0x58b0e858U, 0xcf854acfU, - 0xd0bb6bd0U, 0xefc52aefU, 0xaa4fe5aaU, 0xfbed16fbU, 0x4386c543U, 0x4d9ad74dU, 0x33665533U, 0x85119485U, - 0x458acf45U, 0xf9e910f9U, 0x02040602U, 0x7ffe817fU, 0x50a0f050U, 0x3c78443cU, 0x9f25ba9fU, 0xa84be3a8U, - 0x51a2f351U, 0xa35dfea3U, 0x4080c040U, 0x8f058a8fU, 0x923fad92U, 0x9d21bc9dU, 0x38704838U, 0xf5f104f5U, - 0xbc63dfbcU, 0xb677c1b6U, 0xdaaf75daU, 0x21426321U, 0x10203010U, 0xffe51affU, 0xf3fd0ef3U, 0xd2bf6dd2U, - 0xcd814ccdU, 0x0c18140cU, 0x13263513U, 0xecc32fecU, 0x5fbee15fU, 0x9735a297U, 0x4488cc44U, 0x172e3917U, - 0xc49357c4U, 0xa755f2a7U, 0x7efc827eU, 0x3d7a473dU, 0x64c8ac64U, 0x5dbae75dU, 0x19322b19U, 0x73e69573U, - 0x60c0a060U, 0x81199881U, 0x4f9ed14fU, 0xdca37fdcU, 0x22446622U, 0x2a547e2aU, 0x903bab90U, 0x880b8388U, - 0x468cca46U, 0xeec729eeU, 0xb86bd3b8U, 0x14283c14U, 0xdea779deU, 0x5ebce25eU, 0x0b161d0bU, 0xdbad76dbU, - 0xe0db3be0U, 0x32645632U, 0x3a744e3aU, 0x0a141e0aU, 0x4992db49U, 0x060c0a06U, 0x24486c24U, 0x5cb8e45cU, - 0xc29f5dc2U, 0xd3bd6ed3U, 0xac43efacU, 0x62c4a662U, 0x9139a891U, 0x9531a495U, 0xe4d337e4U, 0x79f28b79U, - 0xe7d532e7U, 0xc88b43c8U, 0x376e5937U, 0x6ddab76dU, 0x8d018c8dU, 0xd5b164d5U, 0x4e9cd24eU, 0xa949e0a9U, - 0x6cd8b46cU, 0x56acfa56U, 0xf4f307f4U, 0xeacf25eaU, 0x65caaf65U, 0x7af48e7aU, 0xae47e9aeU, 0x08101808U, - 0xba6fd5baU, 0x78f08878U, 0x254a6f25U, 0x2e5c722eU, 0x1c38241cU, 0xa657f1a6U, 0xb473c7b4U, 0xc69751c6U, - 0xe8cb23e8U, 0xdda17cddU, 0x74e89c74U, 0x1f3e211fU, 0x4b96dd4bU, 0xbd61dcbdU, 0x8b0d868bU, 0x8a0f858aU, - 0x70e09070U, 0x3e7c423eU, 0xb571c4b5U, 0x66ccaa66U, 0x4890d848U, 0x03060503U, 0xf6f701f6U, 0x0e1c120eU, - 0x61c2a361U, 0x356a5f35U, 0x57aef957U, 0xb969d0b9U, 0x86179186U, 0xc19958c1U, 0x1d3a271dU, 0x9e27b99eU, - 0xe1d938e1U, 0xf8eb13f8U, 0x982bb398U, 0x11223311U, 0x69d2bb69U, 0xd9a970d9U, 0x8e07898eU, 0x9433a794U, - 0x9b2db69bU, 0x1e3c221eU, 0x87159287U, 0xe9c920e9U, 0xce8749ceU, 0x55aaff55U, 0x28507828U, 0xdfa57adfU, - 0x8c038f8cU, 0xa159f8a1U, 0x89098089U, 0x0d1a170dU, 0xbf65dabfU, 0xe6d731e6U, 0x4284c642U, 0x68d0b868U, - 0x4182c341U, 0x9929b099U, 0x2d5a772dU, 0x0f1e110fU, 0xb07bcbb0U, 0x54a8fc54U, 0xbb6dd6bbU, 0x162c3a16U, - - 0xc6a56363U, 0xf8847c7cU, 0xee997777U, 0xf68d7b7bU, 0xff0df2f2U, 0xd6bd6b6bU, 0xdeb16f6fU, 0x9154c5c5U, - 0x60503030U, 0x02030101U, 0xcea96767U, 0x567d2b2bU, 0xe719fefeU, 0xb562d7d7U, 0x4de6ababU, 0xec9a7676U, - 0x8f45cacaU, 0x1f9d8282U, 0x8940c9c9U, 0xfa877d7dU, 0xef15fafaU, 0xb2eb5959U, 0x8ec94747U, 0xfb0bf0f0U, - 0x41ecadadU, 0xb367d4d4U, 0x5ffda2a2U, 0x45eaafafU, 0x23bf9c9cU, 0x53f7a4a4U, 0xe4967272U, 0x9b5bc0c0U, - 0x75c2b7b7U, 0xe11cfdfdU, 0x3dae9393U, 0x4c6a2626U, 0x6c5a3636U, 0x7e413f3fU, 0xf502f7f7U, 0x834fccccU, - 0x685c3434U, 0x51f4a5a5U, 0xd134e5e5U, 0xf908f1f1U, 0xe2937171U, 0xab73d8d8U, 0x62533131U, 0x2a3f1515U, - 0x080c0404U, 0x9552c7c7U, 0x46652323U, 0x9d5ec3c3U, 0x30281818U, 0x37a19696U, 0x0a0f0505U, 0x2fb59a9aU, - 0x0e090707U, 0x24361212U, 0x1b9b8080U, 0xdf3de2e2U, 0xcd26ebebU, 0x4e692727U, 0x7fcdb2b2U, 0xea9f7575U, - 0x121b0909U, 0x1d9e8383U, 0x58742c2cU, 0x342e1a1aU, 0x362d1b1bU, 0xdcb26e6eU, 0xb4ee5a5aU, 0x5bfba0a0U, - 0xa4f65252U, 0x764d3b3bU, 0xb761d6d6U, 0x7dceb3b3U, 0x527b2929U, 0xdd3ee3e3U, 0x5e712f2fU, 0x13978484U, - 0xa6f55353U, 0xb968d1d1U, 0x00000000U, 0xc12cededU, 0x40602020U, 0xe31ffcfcU, 0x79c8b1b1U, 0xb6ed5b5bU, - 0xd4be6a6aU, 0x8d46cbcbU, 0x67d9bebeU, 0x724b3939U, 0x94de4a4aU, 0x98d44c4cU, 0xb0e85858U, 0x854acfcfU, - 0xbb6bd0d0U, 0xc52aefefU, 0x4fe5aaaaU, 0xed16fbfbU, 0x86c54343U, 0x9ad74d4dU, 0x66553333U, 0x11948585U, - 0x8acf4545U, 0xe910f9f9U, 0x04060202U, 0xfe817f7fU, 0xa0f05050U, 0x78443c3cU, 0x25ba9f9fU, 0x4be3a8a8U, - 0xa2f35151U, 0x5dfea3a3U, 0x80c04040U, 0x058a8f8fU, 0x3fad9292U, 0x21bc9d9dU, 0x70483838U, 0xf104f5f5U, - 0x63dfbcbcU, 0x77c1b6b6U, 0xaf75dadaU, 0x42632121U, 0x20301010U, 0xe51affffU, 0xfd0ef3f3U, 0xbf6dd2d2U, - 0x814ccdcdU, 0x18140c0cU, 0x26351313U, 0xc32fececU, 0xbee15f5fU, 0x35a29797U, 0x88cc4444U, 0x2e391717U, - 0x9357c4c4U, 0x55f2a7a7U, 0xfc827e7eU, 0x7a473d3dU, 0xc8ac6464U, 0xbae75d5dU, 0x322b1919U, 0xe6957373U, - 0xc0a06060U, 0x19988181U, 0x9ed14f4fU, 0xa37fdcdcU, 0x44662222U, 0x547e2a2aU, 0x3bab9090U, 0x0b838888U, - 0x8cca4646U, 0xc729eeeeU, 0x6bd3b8b8U, 0x283c1414U, 0xa779dedeU, 0xbce25e5eU, 0x161d0b0bU, 0xad76dbdbU, - 0xdb3be0e0U, 0x64563232U, 0x744e3a3aU, 0x141e0a0aU, 0x92db4949U, 0x0c0a0606U, 0x486c2424U, 0xb8e45c5cU, - 0x9f5dc2c2U, 0xbd6ed3d3U, 0x43efacacU, 0xc4a66262U, 0x39a89191U, 0x31a49595U, 0xd337e4e4U, 0xf28b7979U, - 0xd532e7e7U, 0x8b43c8c8U, 0x6e593737U, 0xdab76d6dU, 0x018c8d8dU, 0xb164d5d5U, 0x9cd24e4eU, 0x49e0a9a9U, - 0xd8b46c6cU, 0xacfa5656U, 0xf307f4f4U, 0xcf25eaeaU, 0xcaaf6565U, 0xf48e7a7aU, 0x47e9aeaeU, 0x10180808U, - 0x6fd5babaU, 0xf0887878U, 0x4a6f2525U, 0x5c722e2eU, 0x38241c1cU, 0x57f1a6a6U, 0x73c7b4b4U, 0x9751c6c6U, - 0xcb23e8e8U, 0xa17cddddU, 0xe89c7474U, 0x3e211f1fU, 0x96dd4b4bU, 0x61dcbdbdU, 0x0d868b8bU, 0x0f858a8aU, - 0xe0907070U, 0x7c423e3eU, 0x71c4b5b5U, 0xccaa6666U, 0x90d84848U, 0x06050303U, 0xf701f6f6U, 0x1c120e0eU, - 0xc2a36161U, 0x6a5f3535U, 0xaef95757U, 0x69d0b9b9U, 0x17918686U, 0x9958c1c1U, 0x3a271d1dU, 0x27b99e9eU, - 0xd938e1e1U, 0xeb13f8f8U, 0x2bb39898U, 0x22331111U, 0xd2bb6969U, 0xa970d9d9U, 0x07898e8eU, 0x33a79494U, - 0x2db69b9bU, 0x3c221e1eU, 0x15928787U, 0xc920e9e9U, 0x8749ceceU, 0xaaff5555U, 0x50782828U, 0xa57adfdfU, - 0x038f8c8cU, 0x59f8a1a1U, 0x09808989U, 0x1a170d0dU, 0x65dabfbfU, 0xd731e6e6U, 0x84c64242U, 0xd0b86868U, - 0x82c34141U, 0x29b09999U, 0x5a772d2dU, 0x1e110f0fU, 0x7bcbb0b0U, 0xa8fc5454U, 0x6dd6bbbbU, 0x2c3a1616U -}; -*/ - -#define AS_U32(addr) *((uint32_t*)(addr)) -#define AS_UINT2(addr) *((uint2*)(addr)) -#define AS_UINT4(addr) *((uint4*)(addr)) -#define AS_UL2(addr) *((ulonglong2*)(addr)) - -#define t_fn0(x) (sharedMemory[x]) -#define t_fn1(x) (sharedMemory[0x100U | (x)]) -#define t_fn2(x) (sharedMemory[0x200U | (x)]) -#define t_fn3(x) (sharedMemory[0x300U | (x)]) - -#define round(shared, out, x, k) \ - out[0] = (k)[0] ^ (t_fn0(x[0] & 0xff) ^ t_fn1((x[1] >> 8) & 0xff) ^ t_fn2((x[2] >> 16) & 0xff) ^ t_fn3((x[3] >> 24) & 0xff)); \ - out[1] = (k)[1] ^ (t_fn0(x[1] & 0xff) ^ t_fn1((x[2] >> 8) & 0xff) ^ t_fn2((x[3] >> 16) & 0xff) ^ t_fn3((x[0] >> 24) & 0xff)); \ - out[2] = (k)[2] ^ (t_fn0(x[2] & 0xff) ^ t_fn1((x[3] >> 8) & 0xff) ^ t_fn2((x[0] >> 16) & 0xff) ^ t_fn3((x[1] >> 24) & 0xff)); \ - out[3] = (k)[3] ^ (t_fn0(x[3] & 0xff) ^ t_fn1((x[0] >> 8) & 0xff) ^ t_fn2((x[1] >> 16) & 0xff) ^ t_fn3((x[2] >> 24) & 0xff)); - -#define round_u4(shared, out, in, k) \ - ((uint32_t*)out)[0] = (k)[0] ^ t_fn0(in[0].x) ^ t_fn1(in[1].y) ^ t_fn2(in[2].z) ^ t_fn3(in[3].w); \ - ((uint32_t*)out)[1] = (k)[1] ^ t_fn0(in[1].x) ^ t_fn1(in[2].y) ^ t_fn2(in[3].z) ^ t_fn3(in[0].w); \ - ((uint32_t*)out)[2] = (k)[2] ^ t_fn0(in[2].x) ^ t_fn1(in[3].y) ^ t_fn2(in[0].z) ^ t_fn3(in[1].w); \ - ((uint32_t*)out)[3] = (k)[3] ^ t_fn0(in[3].x) ^ t_fn1(in[0].y) ^ t_fn2(in[1].z) ^ t_fn3(in[2].w); - -#ifdef __INTELLISENSE__ -#define __byte_perm(a,b,c) a -#endif - -#define OFF32_0(x) (x & 0xFFu) -#define OFF32_1(x) __byte_perm(x, 0x01, 0x5541) -#define OFF32_2(x) __byte_perm(x, 0x02, 0x5542) -#define OFF32_3(x) __byte_perm(x, 0x03, 0x5543) - -#define SHARED_0(x) sharedMemory[OFF32_0(x)] -#define SHARED_1(x) sharedMemory[OFF32_1(x)] -#define SHARED_2(x) sharedMemory[OFF32_2(x)] -#define SHARED_3(x) sharedMemory[OFF32_3(x)] - -__device__ __forceinline__ -void cn_aes_single_round(uint32_t * const sharedMemory, uint32_t * const in, uint32_t * out, uint32_t* expandedKey) -{ - asm("// aes_single_round"); - out[0] = expandedKey[0] ^ SHARED_0(in[0]) ^ SHARED_1(in[1]) ^ SHARED_2(in[2]) ^ SHARED_3(in[3]); - out[1] = expandedKey[1] ^ SHARED_0(in[1]) ^ SHARED_1(in[2]) ^ SHARED_2(in[3]) ^ SHARED_3(in[0]); - out[2] = expandedKey[2] ^ SHARED_0(in[2]) ^ SHARED_1(in[3]) ^ SHARED_2(in[0]) ^ SHARED_3(in[1]); - out[3] = expandedKey[3] ^ SHARED_0(in[3]) ^ SHARED_1(in[0]) ^ SHARED_2(in[1]) ^ SHARED_3(in[2]); -} - -// -#ifdef _WIN64 -/* do a mul.wide.u32 to prevent a shl + cvt 32 to 64 on ld.shared [ptr] */ -#define OFF8_0(x) (x & 0xFFu) * sizeof(uint32_t) -#define OFF8_1(x) __byte_perm(x, 0x01, 0x5541) * sizeof(uint32_t) -#define OFF8_2(x) __byte_perm(x, 0x02, 0x5542) * sizeof(uint32_t) -#define OFF8_3(x) __byte_perm(x, 0x03, 0x5543) * sizeof(uint32_t) -#else -#define OFF8_0(x) (x & 0xFFu) << 2 -#define OFF8_1(x) __byte_perm(x, 0x01, 0x5541) << 2 -#define OFF8_2(x) __byte_perm(x, 0x02, 0x5542) << 2 -#define OFF8_3(x) __byte_perm(x, 0x03, 0x5543) << 2 -#endif - -#define SHAR8_0(x) AS_U32(&sharedMemory[OFF8_0(x)]) -#define SHAR8_1(x) AS_U32(&sharedMemory[OFF8_1(x)]) -#define SHAR8_2(x) AS_U32(&sharedMemory[OFF8_2(x)]) -#define SHAR8_3(x) AS_U32(&sharedMemory[OFF8_3(x)]) - -__device__ __forceinline__ -void cn_aes_single_round_b(uint8_t * const sharedMemory, void * const long_state, const uint4 key, uint4 *res) -{ - asm("// aes_single_round_b"); - uint4 in = AS_UINT4(long_state); - *res = key; - res->x ^= SHAR8_0(in.x) ^ SHAR8_1(in.y) ^ SHAR8_2(in.z) ^ SHAR8_3(in.w); - res->y ^= SHAR8_0(in.y) ^ SHAR8_1(in.z) ^ SHAR8_2(in.w) ^ SHAR8_3(in.x); - res->z ^= SHAR8_0(in.z) ^ SHAR8_1(in.w) ^ SHAR8_2(in.x) ^ SHAR8_3(in.y); - res->w ^= SHAR8_0(in.w) ^ SHAR8_1(in.x) ^ SHAR8_2(in.y) ^ SHAR8_3(in.z); -} - -#define round_perm(shared, out, in, k) \ - out[0] = (k)[0] ^ SHARED_0(in[0]) ^ SHARED_1(in[1]) ^ SHARED_2(in[2]) ^ SHARED_3(in[3]); \ - out[1] = (k)[1] ^ SHARED_0(in[1]) ^ SHARED_1(in[2]) ^ SHARED_2(in[3]) ^ SHARED_3(in[0]); \ - out[2] = (k)[2] ^ SHARED_0(in[2]) ^ SHARED_1(in[3]) ^ SHARED_2(in[0]) ^ SHARED_3(in[1]); \ - out[3] = (k)[3] ^ SHARED_0(in[3]) ^ SHARED_1(in[0]) ^ SHARED_2(in[1]) ^ SHARED_3(in[2]); - -__device__ __forceinline__ -void cn_aes_pseudo_round_mut(const uint32_t * sharedMemory, uint32_t * val, uint32_t const * expandedKey) -{ - asm("// aes_pseudo_round_mut"); - uint32_t b[4]; - round_perm(sharedMemory, b, val, expandedKey); - round_perm(sharedMemory, val, b, expandedKey + (1 * N_COLS)); - round_perm(sharedMemory, b, val, expandedKey + (2 * N_COLS)); - round_perm(sharedMemory, val, b, expandedKey + (3 * N_COLS)); - round_perm(sharedMemory, b, val, expandedKey + (4 * N_COLS)); - round_perm(sharedMemory, val, b, expandedKey + (5 * N_COLS)); - round_perm(sharedMemory, b, val, expandedKey + (6 * N_COLS)); - round_perm(sharedMemory, val, b, expandedKey + (7 * N_COLS)); - round_perm(sharedMemory, b, val, expandedKey + (8 * N_COLS)); - round_perm(sharedMemory, val, b, expandedKey + (9 * N_COLS)); -} - -static __forceinline__ __device__ uint4 operator ^ (const uint4 &a, const uint4 &b) { - return make_uint4(a.x ^ b.x, a.y ^ b.y, a.z ^ b.z, a.w ^ b.w); -} - -#define round_perm4(in, k) {\ - uint4 tmp; \ - tmp.x = SHARED_0(in.x) ^ SHARED_1(in.y) ^ SHARED_2(in.z) ^ SHARED_3(in.w); \ - tmp.y = SHARED_0(in.y) ^ SHARED_1(in.z) ^ SHARED_2(in.w) ^ SHARED_3(in.x); \ - tmp.z = SHARED_0(in.z) ^ SHARED_1(in.w) ^ SHARED_2(in.x) ^ SHARED_3(in.y); \ - tmp.w = SHARED_0(in.w) ^ SHARED_1(in.x) ^ SHARED_2(in.y) ^ SHARED_3(in.z); \ - val = tmp ^ key[k]; \ -} - -__device__ __forceinline__ -void cn_aes_pseudo_round_mut_uint4(uint32_t * const sharedMemory, uint4 &val, uint4 const key[10]) -{ - asm("// aes_pseudo_round_mut_uint4"); - round_perm4(val, 0); - round_perm4(val, 1); - round_perm4(val, 2); - round_perm4(val, 3); - round_perm4(val, 4); - round_perm4(val, 5); - round_perm4(val, 6); - round_perm4(val, 7); - round_perm4(val, 8); - round_perm4(val, 9); -} - -/* -__device__ __forceinline__ -void cn_aes_gpu_init2(uint32_t* sharedMemory) -{ -#if 0 - if(blockDim.x >= 64) - { - if(threadIdx.x < 64) { - #define thrX (threadIdx.x << 2U) // ensure offsets aligned (16) to vector - #pragma unroll 4 - for (uint32_t i = 0; i < 1024U; i += 256U) // 32x32 = 1024, 4 * 256 also - AS_UINT4(&sharedMemory[i + thrX]) = AS_UINT4(&d_t_fn[i + thrX]); - } - - } else -#endif - if(blockDim.x >= 32) { - - if(threadIdx.x < 32) { -#if 0 - #pragma unroll 32 - for(uint32_t i = 0; i < 1024; i += 32) - sharedMemory[threadIdx.x + i] = d_t_fn[threadIdx.x + i]; -#else - #define thrX (threadIdx.x << 2U) // ensure offsets aligned (16) to vector - #pragma unroll 8 - for (uint32_t i = 0; i < 1024; i += 128U) // 32x32 = 1024, 8 * 128 also - AS_UINT4(&sharedMemory[i + thrX]) = AS_UINT4(&d_t_fn[i + thrX]); -#endif - } - - } else { - - if(threadIdx.x < 4) { -#if 0 - for (uint32_t i = 0; i < 1024; i += 4) - sharedMemory[threadIdx.x + i] = d_t_fn[threadIdx.x + i]; -#else - #define thrX (threadIdx.x << 2U) // ensure offsets aligned (16) to vector - #pragma unroll 64 - for (uint32_t i = 0; i < 1024; i += 16U) - AS_UINT4(&sharedMemory[i + thrX]) = AS_UINT4(&d_t_fn[i + thrX]); -#endif - } - } -} -*/ - -__device__ __forceinline__ -void cn_aes_gpu_init(uint32_t* sharedMemory) -{ - // AES 0 - switch (threadIdx.x) { - case 0: - AS_UL2(&sharedMemory[0x000]) = make_ulonglong2(0x847c7cf8a56363c6, 0x8d7b7bf6997777ee); - AS_UL2(&sharedMemory[0x004]) = make_ulonglong2(0xbd6b6bd60df2f2ff, 0x54c5c591b16f6fde); - AS_UL2(&sharedMemory[0x008]) = make_ulonglong2(0x0301010250303060, 0x7d2b2b56a96767ce); - AS_UL2(&sharedMemory[0x00C]) = make_ulonglong2(0x62d7d7b519fefee7, 0x9a7676ece6abab4d); - AS_UL2(&sharedMemory[0x010]) = make_ulonglong2(0x9d82821f45caca8f, 0x877d7dfa40c9c989); - AS_UL2(&sharedMemory[0x014]) = make_ulonglong2(0xeb5959b215fafaef, 0x0bf0f0fbc947478e); - AS_UL2(&sharedMemory[0x018]) = make_ulonglong2(0x67d4d4b3ecadad41, 0xeaafaf45fda2a25f); - AS_UL2(&sharedMemory[0x01C]) = make_ulonglong2(0xf7a4a453bf9c9c23, 0x5bc0c09b967272e4); - break; - case 1: - AS_UL2(&sharedMemory[0x020]) = make_ulonglong2(0x1cfdfde1c2b7b775, 0x6a26264cae93933d); - AS_UL2(&sharedMemory[0x024]) = make_ulonglong2(0x413f3f7e5a36366c, 0x4fcccc8302f7f7f5); - AS_UL2(&sharedMemory[0x028]) = make_ulonglong2(0xf4a5a5515c343468, 0x08f1f1f934e5e5d1); - AS_UL2(&sharedMemory[0x02C]) = make_ulonglong2(0x73d8d8ab937171e2, 0x3f15152a53313162); - AS_UL2(&sharedMemory[0x030]) = make_ulonglong2(0x52c7c7950c040408, 0x5ec3c39d65232346); - AS_UL2(&sharedMemory[0x034]) = make_ulonglong2(0xa196963728181830, 0xb59a9a2f0f05050a); - AS_UL2(&sharedMemory[0x038]) = make_ulonglong2(0x361212240907070e, 0x3de2e2df9b80801b); - AS_UL2(&sharedMemory[0x03C]) = make_ulonglong2(0x6927274e26ebebcd, 0x9f7575eacdb2b27f); - break; - case 2: - AS_UL2(&sharedMemory[0x040]) = make_ulonglong2(0x9e83831d1b090912, 0x2e1a1a34742c2c58); - AS_UL2(&sharedMemory[0x044]) = make_ulonglong2(0xb26e6edc2d1b1b36, 0xfba0a05bee5a5ab4); - AS_UL2(&sharedMemory[0x048]) = make_ulonglong2(0x4d3b3b76f65252a4, 0xceb3b37d61d6d6b7); - AS_UL2(&sharedMemory[0x04C]) = make_ulonglong2(0x3ee3e3dd7b292952, 0x97848413712f2f5e); - AS_UL2(&sharedMemory[0x050]) = make_ulonglong2(0x68d1d1b9f55353a6, 0x2cededc100000000); - AS_UL2(&sharedMemory[0x054]) = make_ulonglong2(0x1ffcfce360202040, 0xed5b5bb6c8b1b179); - AS_UL2(&sharedMemory[0x058]) = make_ulonglong2(0x46cbcb8dbe6a6ad4, 0x4b393972d9bebe67); - AS_UL2(&sharedMemory[0x05C]) = make_ulonglong2(0xd44c4c98de4a4a94, 0x4acfcf85e85858b0); - break; - case 3: - AS_UL2(&sharedMemory[0x060]) = make_ulonglong2(0x2aefefc56bd0d0bb, 0x16fbfbede5aaaa4f); - AS_UL2(&sharedMemory[0x064]) = make_ulonglong2(0xd74d4d9ac5434386, 0x9485851155333366); - AS_UL2(&sharedMemory[0x068]) = make_ulonglong2(0x10f9f9e9cf45458a, 0x817f7ffe06020204); - AS_UL2(&sharedMemory[0x06C]) = make_ulonglong2(0x443c3c78f05050a0, 0xe3a8a84bba9f9f25); - AS_UL2(&sharedMemory[0x070]) = make_ulonglong2(0xfea3a35df35151a2, 0x8a8f8f05c0404080); - AS_UL2(&sharedMemory[0x074]) = make_ulonglong2(0xbc9d9d21ad92923f, 0x04f5f5f148383870); - AS_UL2(&sharedMemory[0x078]) = make_ulonglong2(0xc1b6b677dfbcbc63, 0x6321214275dadaaf); - AS_UL2(&sharedMemory[0x07C]) = make_ulonglong2(0x1affffe530101020, 0x6dd2d2bf0ef3f3fd); - break; - case 4: - AS_UL2(&sharedMemory[0x080]) = make_ulonglong2(0x140c0c184ccdcd81, 0x2fececc335131326); - AS_UL2(&sharedMemory[0x084]) = make_ulonglong2(0xa2979735e15f5fbe, 0x3917172ecc444488); - AS_UL2(&sharedMemory[0x088]) = make_ulonglong2(0xf2a7a75557c4c493, 0x473d3d7a827e7efc); - AS_UL2(&sharedMemory[0x08C]) = make_ulonglong2(0xe75d5dbaac6464c8, 0x957373e62b191932); - AS_UL2(&sharedMemory[0x090]) = make_ulonglong2(0x98818119a06060c0, 0x7fdcdca3d14f4f9e); - AS_UL2(&sharedMemory[0x094]) = make_ulonglong2(0x7e2a2a5466222244, 0x8388880bab90903b); - AS_UL2(&sharedMemory[0x098]) = make_ulonglong2(0x29eeeec7ca46468c, 0x3c141428d3b8b86b); - AS_UL2(&sharedMemory[0x09C]) = make_ulonglong2(0xe25e5ebc79dedea7, 0x76dbdbad1d0b0b16); - break; - case 5: - AS_UL2(&sharedMemory[0x0A0]) = make_ulonglong2(0x563232643be0e0db, 0x1e0a0a144e3a3a74); - AS_UL2(&sharedMemory[0x0A4]) = make_ulonglong2(0x0a06060cdb494992, 0xe45c5cb86c242448); - AS_UL2(&sharedMemory[0x0A8]) = make_ulonglong2(0x6ed3d3bd5dc2c29f, 0xa66262c4efacac43); - AS_UL2(&sharedMemory[0x0AC]) = make_ulonglong2(0xa4959531a8919139, 0x8b7979f237e4e4d3); - AS_UL2(&sharedMemory[0x0B0]) = make_ulonglong2(0x43c8c88b32e7e7d5, 0xb76d6dda5937376e); - AS_UL2(&sharedMemory[0x0B4]) = make_ulonglong2(0x64d5d5b18c8d8d01, 0xe0a9a949d24e4e9c); - AS_UL2(&sharedMemory[0x0B8]) = make_ulonglong2(0xfa5656acb46c6cd8, 0x25eaeacf07f4f4f3); - AS_UL2(&sharedMemory[0x0BC]) = make_ulonglong2(0x8e7a7af4af6565ca, 0x18080810e9aeae47); - break; - case 6: - AS_UL2(&sharedMemory[0x0C0]) = make_ulonglong2(0x887878f0d5baba6f, 0x722e2e5c6f25254a); - AS_UL2(&sharedMemory[0x0C4]) = make_ulonglong2(0xf1a6a657241c1c38, 0x51c6c697c7b4b473); - AS_UL2(&sharedMemory[0x0C8]) = make_ulonglong2(0x7cdddda123e8e8cb, 0x211f1f3e9c7474e8); - AS_UL2(&sharedMemory[0x0CC]) = make_ulonglong2(0xdcbdbd61dd4b4b96, 0x858a8a0f868b8b0d); - AS_UL2(&sharedMemory[0x0D0]) = make_ulonglong2(0x423e3e7c907070e0, 0xaa6666ccc4b5b571); - AS_UL2(&sharedMemory[0x0D4]) = make_ulonglong2(0x05030306d8484890, 0x120e0e1c01f6f6f7); - AS_UL2(&sharedMemory[0x0D8]) = make_ulonglong2(0x5f35356aa36161c2, 0xd0b9b969f95757ae); - AS_UL2(&sharedMemory[0x0DC]) = make_ulonglong2(0x58c1c19991868617, 0xb99e9e27271d1d3a); - break; - case 7: - AS_UL2(&sharedMemory[0x0E0]) = make_ulonglong2(0x13f8f8eb38e1e1d9, 0x33111122b398982b); - AS_UL2(&sharedMemory[0x0E4]) = make_ulonglong2(0x70d9d9a9bb6969d2, 0xa7949433898e8e07); - AS_UL2(&sharedMemory[0x0E8]) = make_ulonglong2(0x221e1e3cb69b9b2d, 0x20e9e9c992878715); - AS_UL2(&sharedMemory[0x0EC]) = make_ulonglong2(0xff5555aa49cece87, 0x7adfdfa578282850); - AS_UL2(&sharedMemory[0x0F0]) = make_ulonglong2(0xf8a1a1598f8c8c03, 0x170d0d1a80898909); - AS_UL2(&sharedMemory[0x0F4]) = make_ulonglong2(0x31e6e6d7dabfbf65, 0xb86868d0c6424284); - AS_UL2(&sharedMemory[0x0F8]) = make_ulonglong2(0xb0999929c3414182, 0x110f0f1e772d2d5a); - AS_UL2(&sharedMemory[0x0FC]) = make_ulonglong2(0xfc5454a8cbb0b07b, 0x3a16162cd6bbbb6d); - break; - } - // AES 1 - switch (threadIdx.x) { - case 0: - AS_UL2(&sharedMemory[0x100]) = make_ulonglong2(0x7c7cf8846363c6a5, 0x7b7bf68d7777ee99); - AS_UL2(&sharedMemory[0x104]) = make_ulonglong2(0x6b6bd6bdf2f2ff0d, 0xc5c591546f6fdeb1); - AS_UL2(&sharedMemory[0x108]) = make_ulonglong2(0x0101020330306050, 0x2b2b567d6767cea9); - AS_UL2(&sharedMemory[0x10C]) = make_ulonglong2(0xd7d7b562fefee719, 0x7676ec9aabab4de6); - AS_UL2(&sharedMemory[0x110]) = make_ulonglong2(0x82821f9dcaca8f45, 0x7d7dfa87c9c98940); - AS_UL2(&sharedMemory[0x114]) = make_ulonglong2(0x5959b2ebfafaef15, 0xf0f0fb0b47478ec9); - AS_UL2(&sharedMemory[0x118]) = make_ulonglong2(0xd4d4b367adad41ec, 0xafaf45eaa2a25ffd); - AS_UL2(&sharedMemory[0x11C]) = make_ulonglong2(0xa4a453f79c9c23bf, 0xc0c09b5b7272e496); - break; - case 1: - AS_UL2(&sharedMemory[0x120]) = make_ulonglong2(0xfdfde11cb7b775c2, 0x26264c6a93933dae); - AS_UL2(&sharedMemory[0x124]) = make_ulonglong2(0x3f3f7e4136366c5a, 0xcccc834ff7f7f502); - AS_UL2(&sharedMemory[0x128]) = make_ulonglong2(0xa5a551f43434685c, 0xf1f1f908e5e5d134); - AS_UL2(&sharedMemory[0x12C]) = make_ulonglong2(0xd8d8ab737171e293, 0x15152a3f31316253); - AS_UL2(&sharedMemory[0x130]) = make_ulonglong2(0xc7c795520404080c, 0xc3c39d5e23234665); - AS_UL2(&sharedMemory[0x134]) = make_ulonglong2(0x969637a118183028, 0x9a9a2fb505050a0f); - AS_UL2(&sharedMemory[0x138]) = make_ulonglong2(0x1212243607070e09, 0xe2e2df3d80801b9b); - AS_UL2(&sharedMemory[0x13C]) = make_ulonglong2(0x27274e69ebebcd26, 0x7575ea9fb2b27fcd); - break; - case 2: - AS_UL2(&sharedMemory[0x140]) = make_ulonglong2(0x83831d9e0909121b, 0x1a1a342e2c2c5874); - AS_UL2(&sharedMemory[0x144]) = make_ulonglong2(0x6e6edcb21b1b362d, 0xa0a05bfb5a5ab4ee); - AS_UL2(&sharedMemory[0x148]) = make_ulonglong2(0x3b3b764d5252a4f6, 0xb3b37dced6d6b761); - AS_UL2(&sharedMemory[0x14C]) = make_ulonglong2(0xe3e3dd3e2929527b, 0x848413972f2f5e71); - AS_UL2(&sharedMemory[0x150]) = make_ulonglong2(0xd1d1b9685353a6f5, 0xededc12c00000000); - AS_UL2(&sharedMemory[0x154]) = make_ulonglong2(0xfcfce31f20204060, 0x5b5bb6edb1b179c8); - AS_UL2(&sharedMemory[0x158]) = make_ulonglong2(0xcbcb8d466a6ad4be, 0x3939724bbebe67d9); - AS_UL2(&sharedMemory[0x15C]) = make_ulonglong2(0x4c4c98d44a4a94de, 0xcfcf854a5858b0e8); - break; - case 3: - AS_UL2(&sharedMemory[0x160]) = make_ulonglong2(0xefefc52ad0d0bb6b, 0xfbfbed16aaaa4fe5); - AS_UL2(&sharedMemory[0x164]) = make_ulonglong2(0x4d4d9ad7434386c5, 0x8585119433336655); - AS_UL2(&sharedMemory[0x168]) = make_ulonglong2(0xf9f9e91045458acf, 0x7f7ffe8102020406); - AS_UL2(&sharedMemory[0x16C]) = make_ulonglong2(0x3c3c78445050a0f0, 0xa8a84be39f9f25ba); - AS_UL2(&sharedMemory[0x170]) = make_ulonglong2(0xa3a35dfe5151a2f3, 0x8f8f058a404080c0); - AS_UL2(&sharedMemory[0x174]) = make_ulonglong2(0x9d9d21bc92923fad, 0xf5f5f10438387048); - AS_UL2(&sharedMemory[0x178]) = make_ulonglong2(0xb6b677c1bcbc63df, 0x21214263dadaaf75); - AS_UL2(&sharedMemory[0x17C]) = make_ulonglong2(0xffffe51a10102030, 0xd2d2bf6df3f3fd0e); - break; - case 4: - AS_UL2(&sharedMemory[0x180]) = make_ulonglong2(0x0c0c1814cdcd814c, 0xececc32f13132635); - AS_UL2(&sharedMemory[0x184]) = make_ulonglong2(0x979735a25f5fbee1, 0x17172e39444488cc); - AS_UL2(&sharedMemory[0x188]) = make_ulonglong2(0xa7a755f2c4c49357, 0x3d3d7a477e7efc82); - AS_UL2(&sharedMemory[0x18C]) = make_ulonglong2(0x5d5dbae76464c8ac, 0x7373e6951919322b); - AS_UL2(&sharedMemory[0x190]) = make_ulonglong2(0x818119986060c0a0, 0xdcdca37f4f4f9ed1); - AS_UL2(&sharedMemory[0x194]) = make_ulonglong2(0x2a2a547e22224466, 0x88880b8390903bab); - AS_UL2(&sharedMemory[0x198]) = make_ulonglong2(0xeeeec72946468cca, 0x1414283cb8b86bd3); - AS_UL2(&sharedMemory[0x19C]) = make_ulonglong2(0x5e5ebce2dedea779, 0xdbdbad760b0b161d); - break; - case 5: - AS_UL2(&sharedMemory[0x1A0]) = make_ulonglong2(0x32326456e0e0db3b, 0x0a0a141e3a3a744e); - AS_UL2(&sharedMemory[0x1A4]) = make_ulonglong2(0x06060c0a494992db, 0x5c5cb8e42424486c); - AS_UL2(&sharedMemory[0x1A8]) = make_ulonglong2(0xd3d3bd6ec2c29f5d, 0x6262c4a6acac43ef); - AS_UL2(&sharedMemory[0x1AC]) = make_ulonglong2(0x959531a4919139a8, 0x7979f28be4e4d337); - AS_UL2(&sharedMemory[0x1B0]) = make_ulonglong2(0xc8c88b43e7e7d532, 0x6d6ddab737376e59); - AS_UL2(&sharedMemory[0x1B4]) = make_ulonglong2(0xd5d5b1648d8d018c, 0xa9a949e04e4e9cd2); - AS_UL2(&sharedMemory[0x1B8]) = make_ulonglong2(0x5656acfa6c6cd8b4, 0xeaeacf25f4f4f307); - AS_UL2(&sharedMemory[0x1BC]) = make_ulonglong2(0x7a7af48e6565caaf, 0x08081018aeae47e9); - break; - case 6: - AS_UL2(&sharedMemory[0x1C0]) = make_ulonglong2(0x7878f088baba6fd5, 0x2e2e5c7225254a6f); - AS_UL2(&sharedMemory[0x1C4]) = make_ulonglong2(0xa6a657f11c1c3824, 0xc6c69751b4b473c7); - AS_UL2(&sharedMemory[0x1C8]) = make_ulonglong2(0xdddda17ce8e8cb23, 0x1f1f3e217474e89c); - AS_UL2(&sharedMemory[0x1CC]) = make_ulonglong2(0xbdbd61dc4b4b96dd, 0x8a8a0f858b8b0d86); - AS_UL2(&sharedMemory[0x1D0]) = make_ulonglong2(0x3e3e7c427070e090, 0x6666ccaab5b571c4); - AS_UL2(&sharedMemory[0x1D4]) = make_ulonglong2(0x03030605484890d8, 0x0e0e1c12f6f6f701); - AS_UL2(&sharedMemory[0x1D8]) = make_ulonglong2(0x35356a5f6161c2a3, 0xb9b969d05757aef9); - AS_UL2(&sharedMemory[0x1DC]) = make_ulonglong2(0xc1c1995886861791, 0x9e9e27b91d1d3a27); - break; - case 7: - AS_UL2(&sharedMemory[0x1E0]) = make_ulonglong2(0xf8f8eb13e1e1d938, 0x1111223398982bb3); - AS_UL2(&sharedMemory[0x1E4]) = make_ulonglong2(0xd9d9a9706969d2bb, 0x949433a78e8e0789); - AS_UL2(&sharedMemory[0x1E8]) = make_ulonglong2(0x1e1e3c229b9b2db6, 0xe9e9c92087871592); - AS_UL2(&sharedMemory[0x1EC]) = make_ulonglong2(0x5555aaffcece8749, 0xdfdfa57a28285078); - AS_UL2(&sharedMemory[0x1F0]) = make_ulonglong2(0xa1a159f88c8c038f, 0x0d0d1a1789890980); - AS_UL2(&sharedMemory[0x1F4]) = make_ulonglong2(0xe6e6d731bfbf65da, 0x6868d0b8424284c6); - AS_UL2(&sharedMemory[0x1F8]) = make_ulonglong2(0x999929b0414182c3, 0x0f0f1e112d2d5a77); - AS_UL2(&sharedMemory[0x1FC]) = make_ulonglong2(0x5454a8fcb0b07bcb, 0x16162c3abbbb6dd6); - break; - } - // AES 2 - switch (threadIdx.x) { - case 0: - AS_UL2(&sharedMemory[0x200]) = make_ulonglong2(0x7cf8847c63c6a563, 0x7bf68d7b77ee9977); - AS_UL2(&sharedMemory[0x204]) = make_ulonglong2(0x6bd6bd6bf2ff0df2, 0xc59154c56fdeb16f); - AS_UL2(&sharedMemory[0x208]) = make_ulonglong2(0x0102030130605030, 0x2b567d2b67cea967); - AS_UL2(&sharedMemory[0x20C]) = make_ulonglong2(0xd7b562d7fee719fe, 0x76ec9a76ab4de6ab); - AS_UL2(&sharedMemory[0x210]) = make_ulonglong2(0x821f9d82ca8f45ca, 0x7dfa877dc98940c9); - AS_UL2(&sharedMemory[0x214]) = make_ulonglong2(0x59b2eb59faef15fa, 0xf0fb0bf0478ec947); - AS_UL2(&sharedMemory[0x218]) = make_ulonglong2(0xd4b367d4ad41ecad, 0xaf45eaafa25ffda2); - AS_UL2(&sharedMemory[0x21C]) = make_ulonglong2(0xa453f7a49c23bf9c, 0xc09b5bc072e49672); - break; - case 1: - AS_UL2(&sharedMemory[0x220]) = make_ulonglong2(0xfde11cfdb775c2b7, 0x264c6a26933dae93); - AS_UL2(&sharedMemory[0x224]) = make_ulonglong2(0x3f7e413f366c5a36, 0xcc834fccf7f502f7); - AS_UL2(&sharedMemory[0x228]) = make_ulonglong2(0xa551f4a534685c34, 0xf1f908f1e5d134e5); - AS_UL2(&sharedMemory[0x22C]) = make_ulonglong2(0xd8ab73d871e29371, 0x152a3f1531625331); - AS_UL2(&sharedMemory[0x230]) = make_ulonglong2(0xc79552c704080c04, 0xc39d5ec323466523); - AS_UL2(&sharedMemory[0x234]) = make_ulonglong2(0x9637a19618302818, 0x9a2fb59a050a0f05); - AS_UL2(&sharedMemory[0x238]) = make_ulonglong2(0x12243612070e0907, 0xe2df3de2801b9b80); - AS_UL2(&sharedMemory[0x23C]) = make_ulonglong2(0x274e6927ebcd26eb, 0x75ea9f75b27fcdb2); - break; - case 2: - AS_UL2(&sharedMemory[0x240]) = make_ulonglong2(0x831d9e8309121b09, 0x1a342e1a2c58742c); - AS_UL2(&sharedMemory[0x244]) = make_ulonglong2(0x6edcb26e1b362d1b, 0xa05bfba05ab4ee5a); - AS_UL2(&sharedMemory[0x248]) = make_ulonglong2(0x3b764d3b52a4f652, 0xb37dceb3d6b761d6); - AS_UL2(&sharedMemory[0x24C]) = make_ulonglong2(0xe3dd3ee329527b29, 0x841397842f5e712f); - AS_UL2(&sharedMemory[0x250]) = make_ulonglong2(0xd1b968d153a6f553, 0xedc12ced00000000); - AS_UL2(&sharedMemory[0x254]) = make_ulonglong2(0xfce31ffc20406020, 0x5bb6ed5bb179c8b1); - AS_UL2(&sharedMemory[0x258]) = make_ulonglong2(0xcb8d46cb6ad4be6a, 0x39724b39be67d9be); - AS_UL2(&sharedMemory[0x25C]) = make_ulonglong2(0x4c98d44c4a94de4a, 0xcf854acf58b0e858); - break; - case 3: - AS_UL2(&sharedMemory[0x260]) = make_ulonglong2(0xefc52aefd0bb6bd0, 0xfbed16fbaa4fe5aa); - AS_UL2(&sharedMemory[0x264]) = make_ulonglong2(0x4d9ad74d4386c543, 0x8511948533665533); - AS_UL2(&sharedMemory[0x268]) = make_ulonglong2(0xf9e910f9458acf45, 0x7ffe817f02040602); - AS_UL2(&sharedMemory[0x26C]) = make_ulonglong2(0x3c78443c50a0f050, 0xa84be3a89f25ba9f); - AS_UL2(&sharedMemory[0x270]) = make_ulonglong2(0xa35dfea351a2f351, 0x8f058a8f4080c040); - AS_UL2(&sharedMemory[0x274]) = make_ulonglong2(0x9d21bc9d923fad92, 0xf5f104f538704838); - AS_UL2(&sharedMemory[0x278]) = make_ulonglong2(0xb677c1b6bc63dfbc, 0x21426321daaf75da); - AS_UL2(&sharedMemory[0x27C]) = make_ulonglong2(0xffe51aff10203010, 0xd2bf6dd2f3fd0ef3); - break; - case 4: - AS_UL2(&sharedMemory[0x280]) = make_ulonglong2(0x0c18140ccd814ccd, 0xecc32fec13263513); - AS_UL2(&sharedMemory[0x284]) = make_ulonglong2(0x9735a2975fbee15f, 0x172e39174488cc44); - AS_UL2(&sharedMemory[0x288]) = make_ulonglong2(0xa755f2a7c49357c4, 0x3d7a473d7efc827e); - AS_UL2(&sharedMemory[0x28C]) = make_ulonglong2(0x5dbae75d64c8ac64, 0x73e6957319322b19); - AS_UL2(&sharedMemory[0x290]) = make_ulonglong2(0x8119988160c0a060, 0xdca37fdc4f9ed14f); - AS_UL2(&sharedMemory[0x294]) = make_ulonglong2(0x2a547e2a22446622, 0x880b8388903bab90); - AS_UL2(&sharedMemory[0x298]) = make_ulonglong2(0xeec729ee468cca46, 0x14283c14b86bd3b8); - AS_UL2(&sharedMemory[0x29C]) = make_ulonglong2(0x5ebce25edea779de, 0xdbad76db0b161d0b); - break; - case 5: - AS_UL2(&sharedMemory[0x2A0]) = make_ulonglong2(0x32645632e0db3be0, 0x0a141e0a3a744e3a); - AS_UL2(&sharedMemory[0x2A4]) = make_ulonglong2(0x060c0a064992db49, 0x5cb8e45c24486c24); - AS_UL2(&sharedMemory[0x2A8]) = make_ulonglong2(0xd3bd6ed3c29f5dc2, 0x62c4a662ac43efac); - AS_UL2(&sharedMemory[0x2AC]) = make_ulonglong2(0x9531a4959139a891, 0x79f28b79e4d337e4); - AS_UL2(&sharedMemory[0x2B0]) = make_ulonglong2(0xc88b43c8e7d532e7, 0x6ddab76d376e5937); - AS_UL2(&sharedMemory[0x2B4]) = make_ulonglong2(0xd5b164d58d018c8d, 0xa949e0a94e9cd24e); - AS_UL2(&sharedMemory[0x2B8]) = make_ulonglong2(0x56acfa566cd8b46c, 0xeacf25eaf4f307f4); - AS_UL2(&sharedMemory[0x2BC]) = make_ulonglong2(0x7af48e7a65caaf65, 0x08101808ae47e9ae); - break; - case 6: - AS_UL2(&sharedMemory[0x2C0]) = make_ulonglong2(0x78f08878ba6fd5ba, 0x2e5c722e254a6f25); - AS_UL2(&sharedMemory[0x2C4]) = make_ulonglong2(0xa657f1a61c38241c, 0xc69751c6b473c7b4); - AS_UL2(&sharedMemory[0x2C8]) = make_ulonglong2(0xdda17cdde8cb23e8, 0x1f3e211f74e89c74); - AS_UL2(&sharedMemory[0x2CC]) = make_ulonglong2(0xbd61dcbd4b96dd4b, 0x8a0f858a8b0d868b); - AS_UL2(&sharedMemory[0x2D0]) = make_ulonglong2(0x3e7c423e70e09070, 0x66ccaa66b571c4b5); - AS_UL2(&sharedMemory[0x2D4]) = make_ulonglong2(0x030605034890d848, 0x0e1c120ef6f701f6); - AS_UL2(&sharedMemory[0x2D8]) = make_ulonglong2(0x356a5f3561c2a361, 0xb969d0b957aef957); - AS_UL2(&sharedMemory[0x2DC]) = make_ulonglong2(0xc19958c186179186, 0x9e27b99e1d3a271d); - break; - case 7: - AS_UL2(&sharedMemory[0x2E0]) = make_ulonglong2(0xf8eb13f8e1d938e1, 0x11223311982bb398); - AS_UL2(&sharedMemory[0x2E4]) = make_ulonglong2(0xd9a970d969d2bb69, 0x9433a7948e07898e); - AS_UL2(&sharedMemory[0x2E8]) = make_ulonglong2(0x1e3c221e9b2db69b, 0xe9c920e987159287); - AS_UL2(&sharedMemory[0x2EC]) = make_ulonglong2(0x55aaff55ce8749ce, 0xdfa57adf28507828); - AS_UL2(&sharedMemory[0x2F0]) = make_ulonglong2(0xa159f8a18c038f8c, 0x0d1a170d89098089); - AS_UL2(&sharedMemory[0x2F4]) = make_ulonglong2(0xe6d731e6bf65dabf, 0x68d0b8684284c642); - AS_UL2(&sharedMemory[0x2F8]) = make_ulonglong2(0x9929b0994182c341, 0x0f1e110f2d5a772d); - AS_UL2(&sharedMemory[0x2FC]) = make_ulonglong2(0x54a8fc54b07bcbb0, 0x162c3a16bb6dd6bb); - break; - } - // AES 3 - switch (threadIdx.x) { - case 0: - AS_UL2(&sharedMemory[0x300]) = make_ulonglong2(0xf8847c7cc6a56363, 0xf68d7b7bee997777); - AS_UL2(&sharedMemory[0x304]) = make_ulonglong2(0xd6bd6b6bff0df2f2, 0x9154c5c5deb16f6f); - AS_UL2(&sharedMemory[0x308]) = make_ulonglong2(0x0203010160503030, 0x567d2b2bcea96767); - AS_UL2(&sharedMemory[0x30C]) = make_ulonglong2(0xb562d7d7e719fefe, 0xec9a76764de6abab); - AS_UL2(&sharedMemory[0x310]) = make_ulonglong2(0x1f9d82828f45caca, 0xfa877d7d8940c9c9); - AS_UL2(&sharedMemory[0x314]) = make_ulonglong2(0xb2eb5959ef15fafa, 0xfb0bf0f08ec94747); - AS_UL2(&sharedMemory[0x318]) = make_ulonglong2(0xb367d4d441ecadad, 0x45eaafaf5ffda2a2); - AS_UL2(&sharedMemory[0x31C]) = make_ulonglong2(0x53f7a4a423bf9c9c, 0x9b5bc0c0e4967272); - break; - case 1: - AS_UL2(&sharedMemory[0x320]) = make_ulonglong2(0xe11cfdfd75c2b7b7, 0x4c6a26263dae9393); - AS_UL2(&sharedMemory[0x324]) = make_ulonglong2(0x7e413f3f6c5a3636, 0x834fccccf502f7f7); - AS_UL2(&sharedMemory[0x328]) = make_ulonglong2(0x51f4a5a5685c3434, 0xf908f1f1d134e5e5); - AS_UL2(&sharedMemory[0x32C]) = make_ulonglong2(0xab73d8d8e2937171, 0x2a3f151562533131); - AS_UL2(&sharedMemory[0x330]) = make_ulonglong2(0x9552c7c7080c0404, 0x9d5ec3c346652323); - AS_UL2(&sharedMemory[0x334]) = make_ulonglong2(0x37a1969630281818, 0x2fb59a9a0a0f0505); - AS_UL2(&sharedMemory[0x338]) = make_ulonglong2(0x243612120e090707, 0xdf3de2e21b9b8080); - AS_UL2(&sharedMemory[0x33C]) = make_ulonglong2(0x4e692727cd26ebeb, 0xea9f75757fcdb2b2); - break; - case 2: - AS_UL2(&sharedMemory[0x340]) = make_ulonglong2(0x1d9e8383121b0909, 0x342e1a1a58742c2c); - AS_UL2(&sharedMemory[0x344]) = make_ulonglong2(0xdcb26e6e362d1b1b, 0x5bfba0a0b4ee5a5a); - AS_UL2(&sharedMemory[0x348]) = make_ulonglong2(0x764d3b3ba4f65252, 0x7dceb3b3b761d6d6); - AS_UL2(&sharedMemory[0x34C]) = make_ulonglong2(0xdd3ee3e3527b2929, 0x139784845e712f2f); - AS_UL2(&sharedMemory[0x350]) = make_ulonglong2(0xb968d1d1a6f55353, 0xc12ceded00000000); - AS_UL2(&sharedMemory[0x354]) = make_ulonglong2(0xe31ffcfc40602020, 0xb6ed5b5b79c8b1b1); - AS_UL2(&sharedMemory[0x358]) = make_ulonglong2(0x8d46cbcbd4be6a6a, 0x724b393967d9bebe); - AS_UL2(&sharedMemory[0x35C]) = make_ulonglong2(0x98d44c4c94de4a4a, 0x854acfcfb0e85858); - break; - case 3: - AS_UL2(&sharedMemory[0x360]) = make_ulonglong2(0xc52aefefbb6bd0d0, 0xed16fbfb4fe5aaaa); - AS_UL2(&sharedMemory[0x364]) = make_ulonglong2(0x9ad74d4d86c54343, 0x1194858566553333); - AS_UL2(&sharedMemory[0x368]) = make_ulonglong2(0xe910f9f98acf4545, 0xfe817f7f04060202); - AS_UL2(&sharedMemory[0x36C]) = make_ulonglong2(0x78443c3ca0f05050, 0x4be3a8a825ba9f9f); - AS_UL2(&sharedMemory[0x370]) = make_ulonglong2(0x5dfea3a3a2f35151, 0x058a8f8f80c04040); - AS_UL2(&sharedMemory[0x374]) = make_ulonglong2(0x21bc9d9d3fad9292, 0xf104f5f570483838); - AS_UL2(&sharedMemory[0x378]) = make_ulonglong2(0x77c1b6b663dfbcbc, 0x42632121af75dada); - AS_UL2(&sharedMemory[0x37C]) = make_ulonglong2(0xe51affff20301010, 0xbf6dd2d2fd0ef3f3); - break; - case 4: - AS_UL2(&sharedMemory[0x380]) = make_ulonglong2(0x18140c0c814ccdcd, 0xc32fecec26351313); - AS_UL2(&sharedMemory[0x384]) = make_ulonglong2(0x35a29797bee15f5f, 0x2e39171788cc4444); - AS_UL2(&sharedMemory[0x388]) = make_ulonglong2(0x55f2a7a79357c4c4, 0x7a473d3dfc827e7e); - AS_UL2(&sharedMemory[0x38C]) = make_ulonglong2(0xbae75d5dc8ac6464, 0xe6957373322b1919); - AS_UL2(&sharedMemory[0x390]) = make_ulonglong2(0x19988181c0a06060, 0xa37fdcdc9ed14f4f); - AS_UL2(&sharedMemory[0x394]) = make_ulonglong2(0x547e2a2a44662222, 0x0b8388883bab9090); - AS_UL2(&sharedMemory[0x398]) = make_ulonglong2(0xc729eeee8cca4646, 0x283c14146bd3b8b8); - AS_UL2(&sharedMemory[0x39C]) = make_ulonglong2(0xbce25e5ea779dede, 0xad76dbdb161d0b0b); - break; - case 5: - AS_UL2(&sharedMemory[0x3A0]) = make_ulonglong2(0x64563232db3be0e0, 0x141e0a0a744e3a3a); - AS_UL2(&sharedMemory[0x3A4]) = make_ulonglong2(0x0c0a060692db4949, 0xb8e45c5c486c2424); - AS_UL2(&sharedMemory[0x3A8]) = make_ulonglong2(0xbd6ed3d39f5dc2c2, 0xc4a6626243efacac); - AS_UL2(&sharedMemory[0x3AC]) = make_ulonglong2(0x31a4959539a89191, 0xf28b7979d337e4e4); - AS_UL2(&sharedMemory[0x3B0]) = make_ulonglong2(0x8b43c8c8d532e7e7, 0xdab76d6d6e593737); - AS_UL2(&sharedMemory[0x3B4]) = make_ulonglong2(0xb164d5d5018c8d8d, 0x49e0a9a99cd24e4e); - AS_UL2(&sharedMemory[0x3B8]) = make_ulonglong2(0xacfa5656d8b46c6c, 0xcf25eaeaf307f4f4); - AS_UL2(&sharedMemory[0x3BC]) = make_ulonglong2(0xf48e7a7acaaf6565, 0x1018080847e9aeae); - break; - case 6: - AS_UL2(&sharedMemory[0x3C0]) = make_ulonglong2(0xf08878786fd5baba, 0x5c722e2e4a6f2525); - AS_UL2(&sharedMemory[0x3C4]) = make_ulonglong2(0x57f1a6a638241c1c, 0x9751c6c673c7b4b4); - AS_UL2(&sharedMemory[0x3C8]) = make_ulonglong2(0xa17cddddcb23e8e8, 0x3e211f1fe89c7474); - AS_UL2(&sharedMemory[0x3CC]) = make_ulonglong2(0x61dcbdbd96dd4b4b, 0x0f858a8a0d868b8b); - AS_UL2(&sharedMemory[0x3D0]) = make_ulonglong2(0x7c423e3ee0907070, 0xccaa666671c4b5b5); - AS_UL2(&sharedMemory[0x3D4]) = make_ulonglong2(0x0605030390d84848, 0x1c120e0ef701f6f6); - AS_UL2(&sharedMemory[0x3D8]) = make_ulonglong2(0x6a5f3535c2a36161, 0x69d0b9b9aef95757); - AS_UL2(&sharedMemory[0x3DC]) = make_ulonglong2(0x9958c1c117918686, 0x27b99e9e3a271d1d); - break; - case 7: - AS_UL2(&sharedMemory[0x3E0]) = make_ulonglong2(0xeb13f8f8d938e1e1, 0x223311112bb39898); - AS_UL2(&sharedMemory[0x3E4]) = make_ulonglong2(0xa970d9d9d2bb6969, 0x33a7949407898e8e); - AS_UL2(&sharedMemory[0x3E8]) = make_ulonglong2(0x3c221e1e2db69b9b, 0xc920e9e915928787); - AS_UL2(&sharedMemory[0x3EC]) = make_ulonglong2(0xaaff55558749cece, 0xa57adfdf50782828); - AS_UL2(&sharedMemory[0x3F0]) = make_ulonglong2(0x59f8a1a1038f8c8c, 0x1a170d0d09808989); - AS_UL2(&sharedMemory[0x3F4]) = make_ulonglong2(0xd731e6e665dabfbf, 0xd0b8686884c64242); - AS_UL2(&sharedMemory[0x3F8]) = make_ulonglong2(0x29b0999982c34141, 0x1e110f0f5a772d2d); - AS_UL2(&sharedMemory[0x3FC]) = make_ulonglong2(0xa8fc54547bcbb0b0, 0x2c3a16166dd6bbbb); - break; - } -} - -__device__ __forceinline__ -void cn_aes_gpu_init_u4(uint32_t* sharedMemory) -{ - // AES 0 - switch (threadIdx.x) { - case 0: - AS_UINT4(&sharedMemory[0x000]) = make_uint4(0xa56363c6, 0x847c7cf8, 0x997777ee, 0x8d7b7bf6); - AS_UINT4(&sharedMemory[0x004]) = make_uint4(0x0df2f2ff, 0xbd6b6bd6, 0xb16f6fde, 0x54c5c591); - AS_UINT4(&sharedMemory[0x008]) = make_uint4(0x50303060, 0x03010102, 0xa96767ce, 0x7d2b2b56); - AS_UINT4(&sharedMemory[0x00C]) = make_uint4(0x19fefee7, 0x62d7d7b5, 0xe6abab4d, 0x9a7676ec); - AS_UINT4(&sharedMemory[0x010]) = make_uint4(0x45caca8f, 0x9d82821f, 0x40c9c989, 0x877d7dfa); - AS_UINT4(&sharedMemory[0x014]) = make_uint4(0x15fafaef, 0xeb5959b2, 0xc947478e, 0x0bf0f0fb); - AS_UINT4(&sharedMemory[0x018]) = make_uint4(0xecadad41, 0x67d4d4b3, 0xfda2a25f, 0xeaafaf45); - AS_UINT4(&sharedMemory[0x01C]) = make_uint4(0xbf9c9c23, 0xf7a4a453, 0x967272e4, 0x5bc0c09b); - break; - case 1: - AS_UINT4(&sharedMemory[0x020]) = make_uint4(0xc2b7b775, 0x1cfdfde1, 0xae93933d, 0x6a26264c); - AS_UINT4(&sharedMemory[0x024]) = make_uint4(0x5a36366c, 0x413f3f7e, 0x02f7f7f5, 0x4fcccc83); - AS_UINT4(&sharedMemory[0x028]) = make_uint4(0x5c343468, 0xf4a5a551, 0x34e5e5d1, 0x08f1f1f9); - AS_UINT4(&sharedMemory[0x02C]) = make_uint4(0x937171e2, 0x73d8d8ab, 0x53313162, 0x3f15152a); - AS_UINT4(&sharedMemory[0x030]) = make_uint4(0x0c040408, 0x52c7c795, 0x65232346, 0x5ec3c39d); - AS_UINT4(&sharedMemory[0x034]) = make_uint4(0x28181830, 0xa1969637, 0x0f05050a, 0xb59a9a2f); - AS_UINT4(&sharedMemory[0x038]) = make_uint4(0x0907070e, 0x36121224, 0x9b80801b, 0x3de2e2df); - AS_UINT4(&sharedMemory[0x03C]) = make_uint4(0x26ebebcd, 0x6927274e, 0xcdb2b27f, 0x9f7575ea); - break; - case 2: - AS_UINT4(&sharedMemory[0x040]) = make_uint4(0x1b090912, 0x9e83831d, 0x742c2c58, 0x2e1a1a34); - AS_UINT4(&sharedMemory[0x044]) = make_uint4(0x2d1b1b36, 0xb26e6edc, 0xee5a5ab4, 0xfba0a05b); - AS_UINT4(&sharedMemory[0x048]) = make_uint4(0xf65252a4, 0x4d3b3b76, 0x61d6d6b7, 0xceb3b37d); - AS_UINT4(&sharedMemory[0x04C]) = make_uint4(0x7b292952, 0x3ee3e3dd, 0x712f2f5e, 0x97848413); - AS_UINT4(&sharedMemory[0x050]) = make_uint4(0xf55353a6, 0x68d1d1b9, 0x00000000, 0x2cededc1); - AS_UINT4(&sharedMemory[0x054]) = make_uint4(0x60202040, 0x1ffcfce3, 0xc8b1b179, 0xed5b5bb6); - AS_UINT4(&sharedMemory[0x058]) = make_uint4(0xbe6a6ad4, 0x46cbcb8d, 0xd9bebe67, 0x4b393972); - AS_UINT4(&sharedMemory[0x05C]) = make_uint4(0xde4a4a94, 0xd44c4c98, 0xe85858b0, 0x4acfcf85); - break; - case 3: - AS_UINT4(&sharedMemory[0x060]) = make_uint4(0x6bd0d0bb, 0x2aefefc5, 0xe5aaaa4f, 0x16fbfbed); - AS_UINT4(&sharedMemory[0x064]) = make_uint4(0xc5434386, 0xd74d4d9a, 0x55333366, 0x94858511); - AS_UINT4(&sharedMemory[0x068]) = make_uint4(0xcf45458a, 0x10f9f9e9, 0x06020204, 0x817f7ffe); - AS_UINT4(&sharedMemory[0x06C]) = make_uint4(0xf05050a0, 0x443c3c78, 0xba9f9f25, 0xe3a8a84b); - AS_UINT4(&sharedMemory[0x070]) = make_uint4(0xf35151a2, 0xfea3a35d, 0xc0404080, 0x8a8f8f05); - AS_UINT4(&sharedMemory[0x074]) = make_uint4(0xad92923f, 0xbc9d9d21, 0x48383870, 0x04f5f5f1); - AS_UINT4(&sharedMemory[0x078]) = make_uint4(0xdfbcbc63, 0xc1b6b677, 0x75dadaaf, 0x63212142); - AS_UINT4(&sharedMemory[0x07C]) = make_uint4(0x30101020, 0x1affffe5, 0x0ef3f3fd, 0x6dd2d2bf); - break; - case 4: - AS_UINT4(&sharedMemory[0x080]) = make_uint4(0x4ccdcd81, 0x140c0c18, 0x35131326, 0x2fececc3); - AS_UINT4(&sharedMemory[0x084]) = make_uint4(0xe15f5fbe, 0xa2979735, 0xcc444488, 0x3917172e); - AS_UINT4(&sharedMemory[0x088]) = make_uint4(0x57c4c493, 0xf2a7a755, 0x827e7efc, 0x473d3d7a); - AS_UINT4(&sharedMemory[0x08C]) = make_uint4(0xac6464c8, 0xe75d5dba, 0x2b191932, 0x957373e6); - AS_UINT4(&sharedMemory[0x090]) = make_uint4(0xa06060c0, 0x98818119, 0xd14f4f9e, 0x7fdcdca3); - AS_UINT4(&sharedMemory[0x094]) = make_uint4(0x66222244, 0x7e2a2a54, 0xab90903b, 0x8388880b); - AS_UINT4(&sharedMemory[0x098]) = make_uint4(0xca46468c, 0x29eeeec7, 0xd3b8b86b, 0x3c141428); - AS_UINT4(&sharedMemory[0x09C]) = make_uint4(0x79dedea7, 0xe25e5ebc, 0x1d0b0b16, 0x76dbdbad); - break; - case 5: - AS_UINT4(&sharedMemory[0x0A0]) = make_uint4(0x3be0e0db, 0x56323264, 0x4e3a3a74, 0x1e0a0a14); - AS_UINT4(&sharedMemory[0x0A4]) = make_uint4(0xdb494992, 0x0a06060c, 0x6c242448, 0xe45c5cb8); - AS_UINT4(&sharedMemory[0x0A8]) = make_uint4(0x5dc2c29f, 0x6ed3d3bd, 0xefacac43, 0xa66262c4); - AS_UINT4(&sharedMemory[0x0AC]) = make_uint4(0xa8919139, 0xa4959531, 0x37e4e4d3, 0x8b7979f2); - AS_UINT4(&sharedMemory[0x0B0]) = make_uint4(0x32e7e7d5, 0x43c8c88b, 0x5937376e, 0xb76d6dda); - AS_UINT4(&sharedMemory[0x0B4]) = make_uint4(0x8c8d8d01, 0x64d5d5b1, 0xd24e4e9c, 0xe0a9a949); - AS_UINT4(&sharedMemory[0x0B8]) = make_uint4(0xb46c6cd8, 0xfa5656ac, 0x07f4f4f3, 0x25eaeacf); - AS_UINT4(&sharedMemory[0x0BC]) = make_uint4(0xaf6565ca, 0x8e7a7af4, 0xe9aeae47, 0x18080810); - break; - case 6: - AS_UINT4(&sharedMemory[0x0C0]) = make_uint4(0xd5baba6f, 0x887878f0, 0x6f25254a, 0x722e2e5c); - AS_UINT4(&sharedMemory[0x0C4]) = make_uint4(0x241c1c38, 0xf1a6a657, 0xc7b4b473, 0x51c6c697); - AS_UINT4(&sharedMemory[0x0C8]) = make_uint4(0x23e8e8cb, 0x7cdddda1, 0x9c7474e8, 0x211f1f3e); - AS_UINT4(&sharedMemory[0x0CC]) = make_uint4(0xdd4b4b96, 0xdcbdbd61, 0x868b8b0d, 0x858a8a0f); - AS_UINT4(&sharedMemory[0x0D0]) = make_uint4(0x907070e0, 0x423e3e7c, 0xc4b5b571, 0xaa6666cc); - AS_UINT4(&sharedMemory[0x0D4]) = make_uint4(0xd8484890, 0x05030306, 0x01f6f6f7, 0x120e0e1c); - AS_UINT4(&sharedMemory[0x0D8]) = make_uint4(0xa36161c2, 0x5f35356a, 0xf95757ae, 0xd0b9b969); - AS_UINT4(&sharedMemory[0x0DC]) = make_uint4(0x91868617, 0x58c1c199, 0x271d1d3a, 0xb99e9e27); - break; - case 7: - AS_UINT4(&sharedMemory[0x0E0]) = make_uint4(0x38e1e1d9, 0x13f8f8eb, 0xb398982b, 0x33111122); - AS_UINT4(&sharedMemory[0x0E4]) = make_uint4(0xbb6969d2, 0x70d9d9a9, 0x898e8e07, 0xa7949433); - AS_UINT4(&sharedMemory[0x0E8]) = make_uint4(0xb69b9b2d, 0x221e1e3c, 0x92878715, 0x20e9e9c9); - AS_UINT4(&sharedMemory[0x0EC]) = make_uint4(0x49cece87, 0xff5555aa, 0x78282850, 0x7adfdfa5); - AS_UINT4(&sharedMemory[0x0F0]) = make_uint4(0x8f8c8c03, 0xf8a1a159, 0x80898909, 0x170d0d1a); - AS_UINT4(&sharedMemory[0x0F4]) = make_uint4(0xdabfbf65, 0x31e6e6d7, 0xc6424284, 0xb86868d0); - AS_UINT4(&sharedMemory[0x0F8]) = make_uint4(0xc3414182, 0xb0999929, 0x772d2d5a, 0x110f0f1e); - AS_UINT4(&sharedMemory[0x0FC]) = make_uint4(0xcbb0b07b, 0xfc5454a8, 0xd6bbbb6d, 0x3a16162c); - break; - } - // AES 1 - switch (threadIdx.x) { - case 0: - AS_UINT4(&sharedMemory[0x100]) = make_uint4(0x6363c6a5, 0x7c7cf884, 0x7777ee99, 0x7b7bf68d); - AS_UINT4(&sharedMemory[0x104]) = make_uint4(0xf2f2ff0d, 0x6b6bd6bd, 0x6f6fdeb1, 0xc5c59154); - AS_UINT4(&sharedMemory[0x108]) = make_uint4(0x30306050, 0x01010203, 0x6767cea9, 0x2b2b567d); - AS_UINT4(&sharedMemory[0x10C]) = make_uint4(0xfefee719, 0xd7d7b562, 0xabab4de6, 0x7676ec9a); - AS_UINT4(&sharedMemory[0x110]) = make_uint4(0xcaca8f45, 0x82821f9d, 0xc9c98940, 0x7d7dfa87); - AS_UINT4(&sharedMemory[0x114]) = make_uint4(0xfafaef15, 0x5959b2eb, 0x47478ec9, 0xf0f0fb0b); - AS_UINT4(&sharedMemory[0x118]) = make_uint4(0xadad41ec, 0xd4d4b367, 0xa2a25ffd, 0xafaf45ea); - AS_UINT4(&sharedMemory[0x11C]) = make_uint4(0x9c9c23bf, 0xa4a453f7, 0x7272e496, 0xc0c09b5b); - break; - case 1: - AS_UINT4(&sharedMemory[0x120]) = make_uint4(0xb7b775c2, 0xfdfde11c, 0x93933dae, 0x26264c6a); - AS_UINT4(&sharedMemory[0x124]) = make_uint4(0x36366c5a, 0x3f3f7e41, 0xf7f7f502, 0xcccc834f); - AS_UINT4(&sharedMemory[0x128]) = make_uint4(0x3434685c, 0xa5a551f4, 0xe5e5d134, 0xf1f1f908); - AS_UINT4(&sharedMemory[0x12C]) = make_uint4(0x7171e293, 0xd8d8ab73, 0x31316253, 0x15152a3f); - AS_UINT4(&sharedMemory[0x130]) = make_uint4(0x0404080c, 0xc7c79552, 0x23234665, 0xc3c39d5e); - AS_UINT4(&sharedMemory[0x134]) = make_uint4(0x18183028, 0x969637a1, 0x05050a0f, 0x9a9a2fb5); - AS_UINT4(&sharedMemory[0x138]) = make_uint4(0x07070e09, 0x12122436, 0x80801b9b, 0xe2e2df3d); - AS_UINT4(&sharedMemory[0x13C]) = make_uint4(0xebebcd26, 0x27274e69, 0xb2b27fcd, 0x7575ea9f); - break; - case 2: - AS_UINT4(&sharedMemory[0x140]) = make_uint4(0x0909121b, 0x83831d9e, 0x2c2c5874, 0x1a1a342e); - AS_UINT4(&sharedMemory[0x144]) = make_uint4(0x1b1b362d, 0x6e6edcb2, 0x5a5ab4ee, 0xa0a05bfb); - AS_UINT4(&sharedMemory[0x148]) = make_uint4(0x5252a4f6, 0x3b3b764d, 0xd6d6b761, 0xb3b37dce); - AS_UINT4(&sharedMemory[0x14C]) = make_uint4(0x2929527b, 0xe3e3dd3e, 0x2f2f5e71, 0x84841397); - AS_UINT4(&sharedMemory[0x150]) = make_uint4(0x5353a6f5, 0xd1d1b968, 0x00000000, 0xededc12c); - AS_UINT4(&sharedMemory[0x154]) = make_uint4(0x20204060, 0xfcfce31f, 0xb1b179c8, 0x5b5bb6ed); - AS_UINT4(&sharedMemory[0x158]) = make_uint4(0x6a6ad4be, 0xcbcb8d46, 0xbebe67d9, 0x3939724b); - AS_UINT4(&sharedMemory[0x15C]) = make_uint4(0x4a4a94de, 0x4c4c98d4, 0x5858b0e8, 0xcfcf854a); - break; - case 3: - AS_UINT4(&sharedMemory[0x160]) = make_uint4(0xd0d0bb6b, 0xefefc52a, 0xaaaa4fe5, 0xfbfbed16); - AS_UINT4(&sharedMemory[0x164]) = make_uint4(0x434386c5, 0x4d4d9ad7, 0x33336655, 0x85851194); - AS_UINT4(&sharedMemory[0x168]) = make_uint4(0x45458acf, 0xf9f9e910, 0x02020406, 0x7f7ffe81); - AS_UINT4(&sharedMemory[0x16C]) = make_uint4(0x5050a0f0, 0x3c3c7844, 0x9f9f25ba, 0xa8a84be3); - AS_UINT4(&sharedMemory[0x170]) = make_uint4(0x5151a2f3, 0xa3a35dfe, 0x404080c0, 0x8f8f058a); - AS_UINT4(&sharedMemory[0x174]) = make_uint4(0x92923fad, 0x9d9d21bc, 0x38387048, 0xf5f5f104); - AS_UINT4(&sharedMemory[0x178]) = make_uint4(0xbcbc63df, 0xb6b677c1, 0xdadaaf75, 0x21214263); - AS_UINT4(&sharedMemory[0x17C]) = make_uint4(0x10102030, 0xffffe51a, 0xf3f3fd0e, 0xd2d2bf6d); - break; - case 4: - AS_UINT4(&sharedMemory[0x180]) = make_uint4(0xcdcd814c, 0x0c0c1814, 0x13132635, 0xececc32f); - AS_UINT4(&sharedMemory[0x184]) = make_uint4(0x5f5fbee1, 0x979735a2, 0x444488cc, 0x17172e39); - AS_UINT4(&sharedMemory[0x188]) = make_uint4(0xc4c49357, 0xa7a755f2, 0x7e7efc82, 0x3d3d7a47); - AS_UINT4(&sharedMemory[0x18C]) = make_uint4(0x6464c8ac, 0x5d5dbae7, 0x1919322b, 0x7373e695); - AS_UINT4(&sharedMemory[0x190]) = make_uint4(0x6060c0a0, 0x81811998, 0x4f4f9ed1, 0xdcdca37f); - AS_UINT4(&sharedMemory[0x194]) = make_uint4(0x22224466, 0x2a2a547e, 0x90903bab, 0x88880b83); - AS_UINT4(&sharedMemory[0x198]) = make_uint4(0x46468cca, 0xeeeec729, 0xb8b86bd3, 0x1414283c); - AS_UINT4(&sharedMemory[0x19C]) = make_uint4(0xdedea779, 0x5e5ebce2, 0x0b0b161d, 0xdbdbad76); - break; - case 5: - AS_UINT4(&sharedMemory[0x1A0]) = make_uint4(0xe0e0db3b, 0x32326456, 0x3a3a744e, 0x0a0a141e); - AS_UINT4(&sharedMemory[0x1A4]) = make_uint4(0x494992db, 0x06060c0a, 0x2424486c, 0x5c5cb8e4); - AS_UINT4(&sharedMemory[0x1A8]) = make_uint4(0xc2c29f5d, 0xd3d3bd6e, 0xacac43ef, 0x6262c4a6); - AS_UINT4(&sharedMemory[0x1AC]) = make_uint4(0x919139a8, 0x959531a4, 0xe4e4d337, 0x7979f28b); - AS_UINT4(&sharedMemory[0x1B0]) = make_uint4(0xe7e7d532, 0xc8c88b43, 0x37376e59, 0x6d6ddab7); - AS_UINT4(&sharedMemory[0x1B4]) = make_uint4(0x8d8d018c, 0xd5d5b164, 0x4e4e9cd2, 0xa9a949e0); - AS_UINT4(&sharedMemory[0x1B8]) = make_uint4(0x6c6cd8b4, 0x5656acfa, 0xf4f4f307, 0xeaeacf25); - AS_UINT4(&sharedMemory[0x1BC]) = make_uint4(0x6565caaf, 0x7a7af48e, 0xaeae47e9, 0x08081018); - break; - case 6: - AS_UINT4(&sharedMemory[0x1C0]) = make_uint4(0xbaba6fd5, 0x7878f088, 0x25254a6f, 0x2e2e5c72); - AS_UINT4(&sharedMemory[0x1C4]) = make_uint4(0x1c1c3824, 0xa6a657f1, 0xb4b473c7, 0xc6c69751); - AS_UINT4(&sharedMemory[0x1C8]) = make_uint4(0xe8e8cb23, 0xdddda17c, 0x7474e89c, 0x1f1f3e21); - AS_UINT4(&sharedMemory[0x1CC]) = make_uint4(0x4b4b96dd, 0xbdbd61dc, 0x8b8b0d86, 0x8a8a0f85); - AS_UINT4(&sharedMemory[0x1D0]) = make_uint4(0x7070e090, 0x3e3e7c42, 0xb5b571c4, 0x6666ccaa); - AS_UINT4(&sharedMemory[0x1D4]) = make_uint4(0x484890d8, 0x03030605, 0xf6f6f701, 0x0e0e1c12); - AS_UINT4(&sharedMemory[0x1D8]) = make_uint4(0x6161c2a3, 0x35356a5f, 0x5757aef9, 0xb9b969d0); - AS_UINT4(&sharedMemory[0x1DC]) = make_uint4(0x86861791, 0xc1c19958, 0x1d1d3a27, 0x9e9e27b9); - break; - case 7: - AS_UINT4(&sharedMemory[0x1E0]) = make_uint4(0xe1e1d938, 0xf8f8eb13, 0x98982bb3, 0x11112233); - AS_UINT4(&sharedMemory[0x1E4]) = make_uint4(0x6969d2bb, 0xd9d9a970, 0x8e8e0789, 0x949433a7); - AS_UINT4(&sharedMemory[0x1E8]) = make_uint4(0x9b9b2db6, 0x1e1e3c22, 0x87871592, 0xe9e9c920); - AS_UINT4(&sharedMemory[0x1EC]) = make_uint4(0xcece8749, 0x5555aaff, 0x28285078, 0xdfdfa57a); - AS_UINT4(&sharedMemory[0x1F0]) = make_uint4(0x8c8c038f, 0xa1a159f8, 0x89890980, 0x0d0d1a17); - AS_UINT4(&sharedMemory[0x1F4]) = make_uint4(0xbfbf65da, 0xe6e6d731, 0x424284c6, 0x6868d0b8); - AS_UINT4(&sharedMemory[0x1F8]) = make_uint4(0x414182c3, 0x999929b0, 0x2d2d5a77, 0x0f0f1e11); - AS_UINT4(&sharedMemory[0x1FC]) = make_uint4(0xb0b07bcb, 0x5454a8fc, 0xbbbb6dd6, 0x16162c3a); - break; - } - // AES 2 - switch (threadIdx.x) { - case 0: - AS_UINT4(&sharedMemory[0x200]) = make_uint4(0x63c6a563, 0x7cf8847c, 0x77ee9977, 0x7bf68d7b); - AS_UINT4(&sharedMemory[0x204]) = make_uint4(0xf2ff0df2, 0x6bd6bd6b, 0x6fdeb16f, 0xc59154c5); - AS_UINT4(&sharedMemory[0x208]) = make_uint4(0x30605030, 0x01020301, 0x67cea967, 0x2b567d2b); - AS_UINT4(&sharedMemory[0x20C]) = make_uint4(0xfee719fe, 0xd7b562d7, 0xab4de6ab, 0x76ec9a76); - AS_UINT4(&sharedMemory[0x210]) = make_uint4(0xca8f45ca, 0x821f9d82, 0xc98940c9, 0x7dfa877d); - AS_UINT4(&sharedMemory[0x214]) = make_uint4(0xfaef15fa, 0x59b2eb59, 0x478ec947, 0xf0fb0bf0); - AS_UINT4(&sharedMemory[0x218]) = make_uint4(0xad41ecad, 0xd4b367d4, 0xa25ffda2, 0xaf45eaaf); - AS_UINT4(&sharedMemory[0x21C]) = make_uint4(0x9c23bf9c, 0xa453f7a4, 0x72e49672, 0xc09b5bc0); - break; - case 1: - AS_UINT4(&sharedMemory[0x220]) = make_uint4(0xb775c2b7, 0xfde11cfd, 0x933dae93, 0x264c6a26); - AS_UINT4(&sharedMemory[0x224]) = make_uint4(0x366c5a36, 0x3f7e413f, 0xf7f502f7, 0xcc834fcc); - AS_UINT4(&sharedMemory[0x228]) = make_uint4(0x34685c34, 0xa551f4a5, 0xe5d134e5, 0xf1f908f1); - AS_UINT4(&sharedMemory[0x22C]) = make_uint4(0x71e29371, 0xd8ab73d8, 0x31625331, 0x152a3f15); - AS_UINT4(&sharedMemory[0x230]) = make_uint4(0x04080c04, 0xc79552c7, 0x23466523, 0xc39d5ec3); - AS_UINT4(&sharedMemory[0x234]) = make_uint4(0x18302818, 0x9637a196, 0x050a0f05, 0x9a2fb59a); - AS_UINT4(&sharedMemory[0x238]) = make_uint4(0x070e0907, 0x12243612, 0x801b9b80, 0xe2df3de2); - AS_UINT4(&sharedMemory[0x23C]) = make_uint4(0xebcd26eb, 0x274e6927, 0xb27fcdb2, 0x75ea9f75); - break; - case 2: - AS_UINT4(&sharedMemory[0x240]) = make_uint4(0x09121b09, 0x831d9e83, 0x2c58742c, 0x1a342e1a); - AS_UINT4(&sharedMemory[0x244]) = make_uint4(0x1b362d1b, 0x6edcb26e, 0x5ab4ee5a, 0xa05bfba0); - AS_UINT4(&sharedMemory[0x248]) = make_uint4(0x52a4f652, 0x3b764d3b, 0xd6b761d6, 0xb37dceb3); - AS_UINT4(&sharedMemory[0x24C]) = make_uint4(0x29527b29, 0xe3dd3ee3, 0x2f5e712f, 0x84139784); - AS_UINT4(&sharedMemory[0x250]) = make_uint4(0x53a6f553, 0xd1b968d1, 0x00000000, 0xedc12ced); - AS_UINT4(&sharedMemory[0x254]) = make_uint4(0x20406020, 0xfce31ffc, 0xb179c8b1, 0x5bb6ed5b); - AS_UINT4(&sharedMemory[0x258]) = make_uint4(0x6ad4be6a, 0xcb8d46cb, 0xbe67d9be, 0x39724b39); - AS_UINT4(&sharedMemory[0x25C]) = make_uint4(0x4a94de4a, 0x4c98d44c, 0x58b0e858, 0xcf854acf); - break; - case 3: - AS_UINT4(&sharedMemory[0x260]) = make_uint4(0xd0bb6bd0, 0xefc52aef, 0xaa4fe5aa, 0xfbed16fb); - AS_UINT4(&sharedMemory[0x264]) = make_uint4(0x4386c543, 0x4d9ad74d, 0x33665533, 0x85119485); - AS_UINT4(&sharedMemory[0x268]) = make_uint4(0x458acf45, 0xf9e910f9, 0x02040602, 0x7ffe817f); - AS_UINT4(&sharedMemory[0x26C]) = make_uint4(0x50a0f050, 0x3c78443c, 0x9f25ba9f, 0xa84be3a8); - AS_UINT4(&sharedMemory[0x270]) = make_uint4(0x51a2f351, 0xa35dfea3, 0x4080c040, 0x8f058a8f); - AS_UINT4(&sharedMemory[0x274]) = make_uint4(0x923fad92, 0x9d21bc9d, 0x38704838, 0xf5f104f5); - AS_UINT4(&sharedMemory[0x278]) = make_uint4(0xbc63dfbc, 0xb677c1b6, 0xdaaf75da, 0x21426321); - AS_UINT4(&sharedMemory[0x27C]) = make_uint4(0x10203010, 0xffe51aff, 0xf3fd0ef3, 0xd2bf6dd2); - break; - case 4: - AS_UINT4(&sharedMemory[0x280]) = make_uint4(0xcd814ccd, 0x0c18140c, 0x13263513, 0xecc32fec); - AS_UINT4(&sharedMemory[0x284]) = make_uint4(0x5fbee15f, 0x9735a297, 0x4488cc44, 0x172e3917); - AS_UINT4(&sharedMemory[0x288]) = make_uint4(0xc49357c4, 0xa755f2a7, 0x7efc827e, 0x3d7a473d); - AS_UINT4(&sharedMemory[0x28C]) = make_uint4(0x64c8ac64, 0x5dbae75d, 0x19322b19, 0x73e69573); - AS_UINT4(&sharedMemory[0x290]) = make_uint4(0x60c0a060, 0x81199881, 0x4f9ed14f, 0xdca37fdc); - AS_UINT4(&sharedMemory[0x294]) = make_uint4(0x22446622, 0x2a547e2a, 0x903bab90, 0x880b8388); - AS_UINT4(&sharedMemory[0x298]) = make_uint4(0x468cca46, 0xeec729ee, 0xb86bd3b8, 0x14283c14); - AS_UINT4(&sharedMemory[0x29C]) = make_uint4(0xdea779de, 0x5ebce25e, 0x0b161d0b, 0xdbad76db); - break; - case 5: - AS_UINT4(&sharedMemory[0x2A0]) = make_uint4(0xe0db3be0, 0x32645632, 0x3a744e3a, 0x0a141e0a); - AS_UINT4(&sharedMemory[0x2A4]) = make_uint4(0x4992db49, 0x060c0a06, 0x24486c24, 0x5cb8e45c); - AS_UINT4(&sharedMemory[0x2A8]) = make_uint4(0xc29f5dc2, 0xd3bd6ed3, 0xac43efac, 0x62c4a662); - AS_UINT4(&sharedMemory[0x2AC]) = make_uint4(0x9139a891, 0x9531a495, 0xe4d337e4, 0x79f28b79); - AS_UINT4(&sharedMemory[0x2B0]) = make_uint4(0xe7d532e7, 0xc88b43c8, 0x376e5937, 0x6ddab76d); - AS_UINT4(&sharedMemory[0x2B4]) = make_uint4(0x8d018c8d, 0xd5b164d5, 0x4e9cd24e, 0xa949e0a9); - AS_UINT4(&sharedMemory[0x2B8]) = make_uint4(0x6cd8b46c, 0x56acfa56, 0xf4f307f4, 0xeacf25ea); - AS_UINT4(&sharedMemory[0x2BC]) = make_uint4(0x65caaf65, 0x7af48e7a, 0xae47e9ae, 0x08101808); - break; - case 6: - AS_UINT4(&sharedMemory[0x2C0]) = make_uint4(0xba6fd5ba, 0x78f08878, 0x254a6f25, 0x2e5c722e); - AS_UINT4(&sharedMemory[0x2C4]) = make_uint4(0x1c38241c, 0xa657f1a6, 0xb473c7b4, 0xc69751c6); - AS_UINT4(&sharedMemory[0x2C8]) = make_uint4(0xe8cb23e8, 0xdda17cdd, 0x74e89c74, 0x1f3e211f); - AS_UINT4(&sharedMemory[0x2CC]) = make_uint4(0x4b96dd4b, 0xbd61dcbd, 0x8b0d868b, 0x8a0f858a); - AS_UINT4(&sharedMemory[0x2D0]) = make_uint4(0x70e09070, 0x3e7c423e, 0xb571c4b5, 0x66ccaa66); - AS_UINT4(&sharedMemory[0x2D4]) = make_uint4(0x4890d848, 0x03060503, 0xf6f701f6, 0x0e1c120e); - AS_UINT4(&sharedMemory[0x2D8]) = make_uint4(0x61c2a361, 0x356a5f35, 0x57aef957, 0xb969d0b9); - AS_UINT4(&sharedMemory[0x2DC]) = make_uint4(0x86179186, 0xc19958c1, 0x1d3a271d, 0x9e27b99e); - break; - case 7: - AS_UINT4(&sharedMemory[0x2E0]) = make_uint4(0xe1d938e1, 0xf8eb13f8, 0x982bb398, 0x11223311); - AS_UINT4(&sharedMemory[0x2E4]) = make_uint4(0x69d2bb69, 0xd9a970d9, 0x8e07898e, 0x9433a794); - AS_UINT4(&sharedMemory[0x2E8]) = make_uint4(0x9b2db69b, 0x1e3c221e, 0x87159287, 0xe9c920e9); - AS_UINT4(&sharedMemory[0x2EC]) = make_uint4(0xce8749ce, 0x55aaff55, 0x28507828, 0xdfa57adf); - AS_UINT4(&sharedMemory[0x2F0]) = make_uint4(0x8c038f8c, 0xa159f8a1, 0x89098089, 0x0d1a170d); - AS_UINT4(&sharedMemory[0x2F4]) = make_uint4(0xbf65dabf, 0xe6d731e6, 0x4284c642, 0x68d0b868); - AS_UINT4(&sharedMemory[0x2F8]) = make_uint4(0x4182c341, 0x9929b099, 0x2d5a772d, 0x0f1e110f); - AS_UINT4(&sharedMemory[0x2FC]) = make_uint4(0xb07bcbb0, 0x54a8fc54, 0xbb6dd6bb, 0x162c3a16); - break; - } - // AES 3 - switch (threadIdx.x) { - case 0: - AS_UINT4(&sharedMemory[0x300]) = make_uint4(0xc6a56363, 0xf8847c7c, 0xee997777, 0xf68d7b7b); - AS_UINT4(&sharedMemory[0x304]) = make_uint4(0xff0df2f2, 0xd6bd6b6b, 0xdeb16f6f, 0x9154c5c5); - AS_UINT4(&sharedMemory[0x308]) = make_uint4(0x60503030, 0x02030101, 0xcea96767, 0x567d2b2b); - AS_UINT4(&sharedMemory[0x30C]) = make_uint4(0xe719fefe, 0xb562d7d7, 0x4de6abab, 0xec9a7676); - AS_UINT4(&sharedMemory[0x310]) = make_uint4(0x8f45caca, 0x1f9d8282, 0x8940c9c9, 0xfa877d7d); - AS_UINT4(&sharedMemory[0x314]) = make_uint4(0xef15fafa, 0xb2eb5959, 0x8ec94747, 0xfb0bf0f0); - AS_UINT4(&sharedMemory[0x318]) = make_uint4(0x41ecadad, 0xb367d4d4, 0x5ffda2a2, 0x45eaafaf); - AS_UINT4(&sharedMemory[0x31C]) = make_uint4(0x23bf9c9c, 0x53f7a4a4, 0xe4967272, 0x9b5bc0c0); - break; - case 1: - AS_UINT4(&sharedMemory[0x320]) = make_uint4(0x75c2b7b7, 0xe11cfdfd, 0x3dae9393, 0x4c6a2626); - AS_UINT4(&sharedMemory[0x324]) = make_uint4(0x6c5a3636, 0x7e413f3f, 0xf502f7f7, 0x834fcccc); - AS_UINT4(&sharedMemory[0x328]) = make_uint4(0x685c3434, 0x51f4a5a5, 0xd134e5e5, 0xf908f1f1); - AS_UINT4(&sharedMemory[0x32C]) = make_uint4(0xe2937171, 0xab73d8d8, 0x62533131, 0x2a3f1515); - AS_UINT4(&sharedMemory[0x330]) = make_uint4(0x080c0404, 0x9552c7c7, 0x46652323, 0x9d5ec3c3); - AS_UINT4(&sharedMemory[0x334]) = make_uint4(0x30281818, 0x37a19696, 0x0a0f0505, 0x2fb59a9a); - AS_UINT4(&sharedMemory[0x338]) = make_uint4(0x0e090707, 0x24361212, 0x1b9b8080, 0xdf3de2e2); - AS_UINT4(&sharedMemory[0x33C]) = make_uint4(0xcd26ebeb, 0x4e692727, 0x7fcdb2b2, 0xea9f7575); - break; - case 2: - AS_UINT4(&sharedMemory[0x340]) = make_uint4(0x121b0909, 0x1d9e8383, 0x58742c2c, 0x342e1a1a); - AS_UINT4(&sharedMemory[0x344]) = make_uint4(0x362d1b1b, 0xdcb26e6e, 0xb4ee5a5a, 0x5bfba0a0); - AS_UINT4(&sharedMemory[0x348]) = make_uint4(0xa4f65252, 0x764d3b3b, 0xb761d6d6, 0x7dceb3b3); - AS_UINT4(&sharedMemory[0x34C]) = make_uint4(0x527b2929, 0xdd3ee3e3, 0x5e712f2f, 0x13978484); - AS_UINT4(&sharedMemory[0x350]) = make_uint4(0xa6f55353, 0xb968d1d1, 0x00000000, 0xc12ceded); - AS_UINT4(&sharedMemory[0x354]) = make_uint4(0x40602020, 0xe31ffcfc, 0x79c8b1b1, 0xb6ed5b5b); - AS_UINT4(&sharedMemory[0x358]) = make_uint4(0xd4be6a6a, 0x8d46cbcb, 0x67d9bebe, 0x724b3939); - AS_UINT4(&sharedMemory[0x35C]) = make_uint4(0x94de4a4a, 0x98d44c4c, 0xb0e85858, 0x854acfcf); - break; - case 3: - AS_UINT4(&sharedMemory[0x360]) = make_uint4(0xbb6bd0d0, 0xc52aefef, 0x4fe5aaaa, 0xed16fbfb); - AS_UINT4(&sharedMemory[0x364]) = make_uint4(0x86c54343, 0x9ad74d4d, 0x66553333, 0x11948585); - AS_UINT4(&sharedMemory[0x368]) = make_uint4(0x8acf4545, 0xe910f9f9, 0x04060202, 0xfe817f7f); - AS_UINT4(&sharedMemory[0x36C]) = make_uint4(0xa0f05050, 0x78443c3c, 0x25ba9f9f, 0x4be3a8a8); - AS_UINT4(&sharedMemory[0x370]) = make_uint4(0xa2f35151, 0x5dfea3a3, 0x80c04040, 0x058a8f8f); - AS_UINT4(&sharedMemory[0x374]) = make_uint4(0x3fad9292, 0x21bc9d9d, 0x70483838, 0xf104f5f5); - AS_UINT4(&sharedMemory[0x378]) = make_uint4(0x63dfbcbc, 0x77c1b6b6, 0xaf75dada, 0x42632121); - AS_UINT4(&sharedMemory[0x37C]) = make_uint4(0x20301010, 0xe51affff, 0xfd0ef3f3, 0xbf6dd2d2); - break; - case 4: - AS_UINT4(&sharedMemory[0x380]) = make_uint4(0x814ccdcd, 0x18140c0c, 0x26351313, 0xc32fecec); - AS_UINT4(&sharedMemory[0x384]) = make_uint4(0xbee15f5f, 0x35a29797, 0x88cc4444, 0x2e391717); - AS_UINT4(&sharedMemory[0x388]) = make_uint4(0x9357c4c4, 0x55f2a7a7, 0xfc827e7e, 0x7a473d3d); - AS_UINT4(&sharedMemory[0x38C]) = make_uint4(0xc8ac6464, 0xbae75d5d, 0x322b1919, 0xe6957373); - AS_UINT4(&sharedMemory[0x390]) = make_uint4(0xc0a06060, 0x19988181, 0x9ed14f4f, 0xa37fdcdc); - AS_UINT4(&sharedMemory[0x394]) = make_uint4(0x44662222, 0x547e2a2a, 0x3bab9090, 0x0b838888); - AS_UINT4(&sharedMemory[0x398]) = make_uint4(0x8cca4646, 0xc729eeee, 0x6bd3b8b8, 0x283c1414); - AS_UINT4(&sharedMemory[0x39C]) = make_uint4(0xa779dede, 0xbce25e5e, 0x161d0b0b, 0xad76dbdb); - break; - case 5: - AS_UINT4(&sharedMemory[0x3A0]) = make_uint4(0xdb3be0e0, 0x64563232, 0x744e3a3a, 0x141e0a0a); - AS_UINT4(&sharedMemory[0x3A4]) = make_uint4(0x92db4949, 0x0c0a0606, 0x486c2424, 0xb8e45c5c); - AS_UINT4(&sharedMemory[0x3A8]) = make_uint4(0x9f5dc2c2, 0xbd6ed3d3, 0x43efacac, 0xc4a66262); - AS_UINT4(&sharedMemory[0x3AC]) = make_uint4(0x39a89191, 0x31a49595, 0xd337e4e4, 0xf28b7979); - AS_UINT4(&sharedMemory[0x3B0]) = make_uint4(0xd532e7e7, 0x8b43c8c8, 0x6e593737, 0xdab76d6d); - AS_UINT4(&sharedMemory[0x3B4]) = make_uint4(0x018c8d8d, 0xb164d5d5, 0x9cd24e4e, 0x49e0a9a9); - AS_UINT4(&sharedMemory[0x3B8]) = make_uint4(0xd8b46c6c, 0xacfa5656, 0xf307f4f4, 0xcf25eaea); - AS_UINT4(&sharedMemory[0x3BC]) = make_uint4(0xcaaf6565, 0xf48e7a7a, 0x47e9aeae, 0x10180808); - break; - case 6: - AS_UINT4(&sharedMemory[0x3C0]) = make_uint4(0x6fd5baba, 0xf0887878, 0x4a6f2525, 0x5c722e2e); - AS_UINT4(&sharedMemory[0x3C4]) = make_uint4(0x38241c1c, 0x57f1a6a6, 0x73c7b4b4, 0x9751c6c6); - AS_UINT4(&sharedMemory[0x3C8]) = make_uint4(0xcb23e8e8, 0xa17cdddd, 0xe89c7474, 0x3e211f1f); - AS_UINT4(&sharedMemory[0x3CC]) = make_uint4(0x96dd4b4b, 0x61dcbdbd, 0x0d868b8b, 0x0f858a8a); - AS_UINT4(&sharedMemory[0x3D0]) = make_uint4(0xe0907070, 0x7c423e3e, 0x71c4b5b5, 0xccaa6666); - AS_UINT4(&sharedMemory[0x3D4]) = make_uint4(0x90d84848, 0x06050303, 0xf701f6f6, 0x1c120e0e); - AS_UINT4(&sharedMemory[0x3D8]) = make_uint4(0xc2a36161, 0x6a5f3535, 0xaef95757, 0x69d0b9b9); - AS_UINT4(&sharedMemory[0x3DC]) = make_uint4(0x17918686, 0x9958c1c1, 0x3a271d1d, 0x27b99e9e); - break; - case 7: - AS_UINT4(&sharedMemory[0x3E0]) = make_uint4(0xd938e1e1, 0xeb13f8f8, 0x2bb39898, 0x22331111); - AS_UINT4(&sharedMemory[0x3E4]) = make_uint4(0xd2bb6969, 0xa970d9d9, 0x07898e8e, 0x33a79494); - AS_UINT4(&sharedMemory[0x3E8]) = make_uint4(0x2db69b9b, 0x3c221e1e, 0x15928787, 0xc920e9e9); - AS_UINT4(&sharedMemory[0x3EC]) = make_uint4(0x8749cece, 0xaaff5555, 0x50782828, 0xa57adfdf); - AS_UINT4(&sharedMemory[0x3F0]) = make_uint4(0x038f8c8c, 0x59f8a1a1, 0x09808989, 0x1a170d0d); - AS_UINT4(&sharedMemory[0x3F4]) = make_uint4(0x65dabfbf, 0xd731e6e6, 0x84c64242, 0xd0b86868); - AS_UINT4(&sharedMemory[0x3F8]) = make_uint4(0x82c34141, 0x29b09999, 0x5a772d2d, 0x1e110f0f); - AS_UINT4(&sharedMemory[0x3FC]) = make_uint4(0x7bcbb0b0, 0xa8fc5454, 0x6dd6bbbb, 0x2c3a1616); - break; - } -} diff --git a/crypto/cn_blake.cuh b/crypto/cn_blake.cuh deleted file mode 100644 index 5c0d09f2..00000000 --- a/crypto/cn_blake.cuh +++ /dev/null @@ -1,180 +0,0 @@ -//#include - -typedef struct { - uint32_t h[8], s[4], t[2]; - int buflen, nullt; - uint8_t buf[64]; -} blake_state; - -#define U8TO32(p) \ - (((uint32_t)((p)[0]) << 24) | ((uint32_t)((p)[1]) << 16) | \ - ((uint32_t)((p)[2]) << 8) | ((uint32_t)((p)[3]) )) - -#define U32TO8(p, v) \ - (p)[0] = (uint8_t)((v) >> 24); (p)[1] = (uint8_t)((v) >> 16); \ - (p)[2] = (uint8_t)((v) >> 8); (p)[3] = (uint8_t)((v) ); - -#define BLAKE_ROT(x,n) ROTR32(x, n) -#define BLAKE_G(a,b,c,d,e) \ - v[a] += (m[d_blake_sigma[i][e]] ^ d_blake_cst[d_blake_sigma[i][e+1]]) + v[b]; \ - v[d] = BLAKE_ROT(v[d] ^ v[a],16); \ - v[c] += v[d]; \ - v[b] = BLAKE_ROT(v[b] ^ v[c],12); \ - v[a] += (m[d_blake_sigma[i][e+1]] ^ d_blake_cst[d_blake_sigma[i][e]]) + v[b]; \ - v[d] = BLAKE_ROT(v[d] ^ v[a], 8); \ - v[c] += v[d]; \ - v[b] = BLAKE_ROT(v[b] ^ v[c], 7); - -__constant__ uint8_t d_blake_sigma[14][16] = { - {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, - {14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3}, - {11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4}, - {7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8}, - {9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13}, - {2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9}, - {12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11}, - {13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10}, - {6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5}, - {10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0}, - {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, - {14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3}, - {11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4}, - {7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8} -}; - -__constant__ uint32_t d_blake_cst[16] = { - 0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344, - 0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89, - 0x452821E6, 0x38D01377, 0xBE5466CF, 0x34E90C6C, - 0xC0AC29B7, 0xC97C50DD, 0x3F84D5B5, 0xB5470917 -}; - -__device__ -void cn_blake_compress(blake_state * __restrict__ S, const uint8_t * __restrict__ block) -{ - uint32_t v[16], m[16], i; - - for (i = 0; i < 16; ++i) m[i] = U8TO32(block + i * 4); - for (i = 0; i < 8; ++i) v[i] = S->h[i]; - v[ 8] = S->s[0] ^ 0x243F6A88; - v[ 9] = S->s[1] ^ 0x85A308D3; - v[10] = S->s[2] ^ 0x13198A2E; - v[11] = S->s[3] ^ 0x03707344; - v[12] = 0xA4093822; - v[13] = 0x299F31D0; - v[14] = 0x082EFA98; - v[15] = 0xEC4E6C89; - - if (S->nullt == 0) { - v[12] ^= S->t[0]; - v[13] ^= S->t[0]; - v[14] ^= S->t[1]; - v[15] ^= S->t[1]; - } - - for (i = 0; i < 14; ++i) { - BLAKE_G(0, 4, 8, 12, 0); - BLAKE_G(1, 5, 9, 13, 2); - BLAKE_G(2, 6, 10, 14, 4); - BLAKE_G(3, 7, 11, 15, 6); - BLAKE_G(3, 4, 9, 14, 14); - BLAKE_G(2, 7, 8, 13, 12); - BLAKE_G(0, 5, 10, 15, 8); - BLAKE_G(1, 6, 11, 12, 10); - } - - for (i = 0; i < 16; ++i) S->h[i % 8] ^= v[i]; - for (i = 0; i < 8; ++i) S->h[i] ^= S->s[i % 4]; -} - -__device__ void cn_blake_update(blake_state * __restrict__ S, const uint8_t * __restrict__ data, uint64_t datalen) -{ - int left = S->buflen >> 3; - int fill = 64 - left; - - if (left && (((datalen >> 3) & 0x3F) >= (unsigned) fill)) { - memcpy((void *) (S->buf + left), (void *) data, fill); - S->t[0] += 512; - if (S->t[0] == 0) S->t[1]++; - cn_blake_compress(S, S->buf); - data += fill; - datalen -= (fill << 3); - left = 0; - } - - while (datalen >= 512) { - S->t[0] += 512; - if (S->t[0] == 0) S->t[1]++; - cn_blake_compress(S, data); - data += 64; - datalen -= 512; - } - - if (datalen > 0) { - memcpy((void *) (S->buf + left), (void *) data, datalen >> 3); - S->buflen = (left << 3) + datalen; - } else { - S->buflen = 0; - } -} - -__device__ -void cn_blake_final(blake_state * __restrict__ S, uint8_t * __restrict__ digest) -{ - const uint8_t padding[] = { - 0x80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - }; - uint8_t pa = 0x81, pb = 0x01; - uint8_t msglen[8]; - uint32_t lo = S->t[0] + S->buflen, hi = S->t[1]; - if (lo < (unsigned) S->buflen) hi++; - U32TO8(msglen + 0, hi); - U32TO8(msglen + 4, lo); - - if (S->buflen == 440) { - S->t[0] -= 8; - cn_blake_update(S, &pa, 8); - } else { - if (S->buflen < 440) { - if (S->buflen == 0) S->nullt = 1; - S->t[0] -= 440 - S->buflen; - cn_blake_update(S, padding, 440 - S->buflen); - } else { - S->t[0] -= 512 - S->buflen; - cn_blake_update(S, padding, 512 - S->buflen); - S->t[0] -= 440; - cn_blake_update(S, padding + 1, 440); - S->nullt = 1; - } - cn_blake_update(S, &pb, 8); - S->t[0] -= 8; - } - S->t[0] -= 64; - cn_blake_update(S, msglen, 64); - - U32TO8(digest + 0, S->h[0]); - U32TO8(digest + 4, S->h[1]); - U32TO8(digest + 8, S->h[2]); - U32TO8(digest + 12, S->h[3]); - U32TO8(digest + 16, S->h[4]); - U32TO8(digest + 20, S->h[5]); - U32TO8(digest + 24, S->h[6]); - U32TO8(digest + 28, S->h[7]); -} - -__device__ -void cn_blake(const uint8_t * __restrict__ in, uint64_t inlen, uint8_t * __restrict__ out) -{ - blake_state bs; - blake_state *S = (blake_state *)&bs; - - S->h[0] = 0x6A09E667; S->h[1] = 0xBB67AE85; S->h[2] = 0x3C6EF372; - S->h[3] = 0xA54FF53A; S->h[4] = 0x510E527F; S->h[5] = 0x9B05688C; - S->h[6] = 0x1F83D9AB; S->h[7] = 0x5BE0CD19; - S->t[0] = S->t[1] = S->buflen = S->nullt = 0; - S->s[0] = S->s[1] = S->s[2] = S->s[3] = 0; - - cn_blake_update(S, (uint8_t *)in, inlen * 8); - cn_blake_final(S, (uint8_t *)out); -} diff --git a/crypto/cn_groestl.cuh b/crypto/cn_groestl.cuh deleted file mode 100644 index 62530d44..00000000 --- a/crypto/cn_groestl.cuh +++ /dev/null @@ -1,347 +0,0 @@ - -#define GROESTL_ROWS 8 -#define GROESTL_LENGTHFIELDLEN GROESTL_ROWS -#define GROESTL_COLS512 8 -#define GROESTL_SIZE512 (GROESTL_ROWS*GROESTL_COLS512) -#define GROESTL_ROUNDS512 10 -#define GROESTL_HASH_BIT_LEN 256 - -#define GROESTL_ROTL32(v, n) ROTL32(v, n) - -#define li_32(h) 0x##h##u -#define GROESTL_EXT_BYTE(var,n) ((uint8_t)((uint32_t)(var) >> (8*n))) -#define u32BIG(a) \ - ((GROESTL_ROTL32(a,8) & li_32(00FF00FF)) | \ - (GROESTL_ROTL32(a,24) & li_32(FF00FF00))) - -typedef struct { - uint32_t chaining[GROESTL_SIZE512/sizeof(uint32_t)]; - uint32_t block_counter1, block_counter2; - BitSequence buffer[GROESTL_SIZE512]; - int buf_ptr; - int bits_in_last_byte; -} groestlHashState; - -__constant__ uint32_t d_groestl_T[512] = { - 0xa5f432c6, 0xc6a597f4, 0x84976ff8, 0xf884eb97, 0x99b05eee, 0xee99c7b0, 0x8d8c7af6, 0xf68df78c, 0x0d17e8ff, 0xff0de517, 0xbddc0ad6, 0xd6bdb7dc, 0xb1c816de, 0xdeb1a7c8, 0x54fc6d91, 0x915439fc, - 0x50f09060, 0x6050c0f0, 0x03050702, 0x02030405, 0xa9e02ece, 0xcea987e0, 0x7d87d156, 0x567dac87, 0x192bcce7, 0xe719d52b, 0x62a613b5, 0xb56271a6, 0xe6317c4d, 0x4de69a31, 0x9ab559ec, 0xec9ac3b5, - 0x45cf408f, 0x8f4505cf, 0x9dbca31f, 0x1f9d3ebc, 0x40c04989, 0x894009c0, 0x879268fa, 0xfa87ef92, 0x153fd0ef, 0xef15c53f, 0xeb2694b2, 0xb2eb7f26, 0xc940ce8e, 0x8ec90740, 0x0b1de6fb, 0xfb0bed1d, - 0xec2f6e41, 0x41ec822f, 0x67a91ab3, 0xb3677da9, 0xfd1c435f, 0x5ffdbe1c, 0xea256045, 0x45ea8a25, 0xbfdaf923, 0x23bf46da, 0xf7025153, 0x53f7a602, 0x96a145e4, 0xe496d3a1, 0x5bed769b, 0x9b5b2ded, - 0xc25d2875, 0x75c2ea5d, 0x1c24c5e1, 0xe11cd924, 0xaee9d43d, 0x3dae7ae9, 0x6abef24c, 0x4c6a98be, 0x5aee826c, 0x6c5ad8ee, 0x41c3bd7e, 0x7e41fcc3, 0x0206f3f5, 0xf502f106, 0x4fd15283, 0x834f1dd1, - 0x5ce48c68, 0x685cd0e4, 0xf4075651, 0x51f4a207, 0x345c8dd1, 0xd134b95c, 0x0818e1f9, 0xf908e918, 0x93ae4ce2, 0xe293dfae, 0x73953eab, 0xab734d95, 0x53f59762, 0x6253c4f5, 0x3f416b2a, 0x2a3f5441, - 0x0c141c08, 0x080c1014, 0x52f66395, 0x955231f6, 0x65afe946, 0x46658caf, 0x5ee27f9d, 0x9d5e21e2, 0x28784830, 0x30286078, 0xa1f8cf37, 0x37a16ef8, 0x0f111b0a, 0x0a0f1411, 0xb5c4eb2f, 0x2fb55ec4, - 0x091b150e, 0x0e091c1b, 0x365a7e24, 0x2436485a, 0x9bb6ad1b, 0x1b9b36b6, 0x3d4798df, 0xdf3da547, 0x266aa7cd, 0xcd26816a, 0x69bbf54e, 0x4e699cbb, 0xcd4c337f, 0x7fcdfe4c, 0x9fba50ea, 0xea9fcfba, - 0x1b2d3f12, 0x121b242d, 0x9eb9a41d, 0x1d9e3ab9, 0x749cc458, 0x5874b09c, 0x2e724634, 0x342e6872, 0x2d774136, 0x362d6c77, 0xb2cd11dc, 0xdcb2a3cd, 0xee299db4, 0xb4ee7329, 0xfb164d5b, 0x5bfbb616, - 0xf601a5a4, 0xa4f65301, 0x4dd7a176, 0x764decd7, 0x61a314b7, 0xb76175a3, 0xce49347d, 0x7dcefa49, 0x7b8ddf52, 0x527ba48d, 0x3e429fdd, 0xdd3ea142, 0x7193cd5e, 0x5e71bc93, 0x97a2b113, 0x139726a2, - 0xf504a2a6, 0xa6f55704, 0x68b801b9, 0xb96869b8, 0, 0, 0x2c74b5c1, 0xc12c9974, 0x60a0e040, 0x406080a0, 0x1f21c2e3, 0xe31fdd21, 0xc8433a79, 0x79c8f243, 0xed2c9ab6, 0xb6ed772c, - 0xbed90dd4, 0xd4beb3d9, 0x46ca478d, 0x8d4601ca, 0xd9701767, 0x67d9ce70, 0x4bddaf72, 0x724be4dd, 0xde79ed94, 0x94de3379, 0xd467ff98, 0x98d42b67, 0xe82393b0, 0xb0e87b23, 0x4ade5b85, 0x854a11de, - 0x6bbd06bb, 0xbb6b6dbd, 0x2a7ebbc5, 0xc52a917e, 0xe5347b4f, 0x4fe59e34, 0x163ad7ed, 0xed16c13a, 0xc554d286, 0x86c51754, 0xd762f89a, 0x9ad72f62, 0x55ff9966, 0x6655ccff, 0x94a7b611, 0x119422a7, - 0xcf4ac08a, 0x8acf0f4a, 0x1030d9e9, 0xe910c930, 0x060a0e04, 0x0406080a, 0x819866fe, 0xfe81e798, 0xf00baba0, 0xa0f05b0b, 0x44ccb478, 0x7844f0cc, 0xbad5f025, 0x25ba4ad5, 0xe33e754b, 0x4be3963e, - 0xf30eaca2, 0xa2f35f0e, 0xfe19445d, 0x5dfeba19, 0xc05bdb80, 0x80c01b5b, 0x8a858005, 0x058a0a85, 0xadecd33f, 0x3fad7eec, 0xbcdffe21, 0x21bc42df, 0x48d8a870, 0x7048e0d8, 0x040cfdf1, 0xf104f90c, - 0xdf7a1963, 0x63dfc67a, 0xc1582f77, 0x77c1ee58, 0x759f30af, 0xaf75459f, 0x63a5e742, 0x426384a5, 0x30507020, 0x20304050, 0x1a2ecbe5, 0xe51ad12e, 0x0e12effd, 0xfd0ee112, 0x6db708bf, 0xbf6d65b7, - 0x4cd45581, 0x814c19d4, 0x143c2418, 0x1814303c, 0x355f7926, 0x26354c5f, 0x2f71b2c3, 0xc32f9d71, 0xe13886be, 0xbee16738, 0xa2fdc835, 0x35a26afd, 0xcc4fc788, 0x88cc0b4f, 0x394b652e, 0x2e395c4b, - 0x57f96a93, 0x93573df9, 0xf20d5855, 0x55f2aa0d, 0x829d61fc, 0xfc82e39d, 0x47c9b37a, 0x7a47f4c9, 0xacef27c8, 0xc8ac8bef, 0xe73288ba, 0xbae76f32, 0x2b7d4f32, 0x322b647d, 0x95a442e6, 0xe695d7a4, - 0xa0fb3bc0, 0xc0a09bfb, 0x98b3aa19, 0x199832b3, 0xd168f69e, 0x9ed12768, 0x7f8122a3, 0xa37f5d81, 0x66aaee44, 0x446688aa, 0x7e82d654, 0x547ea882, 0xabe6dd3b, 0x3bab76e6, 0x839e950b, 0xb83169e, - 0xca45c98c, 0x8cca0345, 0x297bbcc7, 0xc729957b, 0xd36e056b, 0x6bd3d66e, 0x3c446c28, 0x283c5044, 0x798b2ca7, 0xa779558b, 0xe23d81bc, 0xbce2633d, 0x1d273116, 0x161d2c27, 0x769a37ad, 0xad76419a, - 0x3b4d96db, 0xdb3bad4d, 0x56fa9e64, 0x6456c8fa, 0x4ed2a674, 0x744ee8d2, 0x1e223614, 0x141e2822, 0xdb76e492, 0x92db3f76, 0x0a1e120c, 0x0c0a181e, 0x6cb4fc48, 0x486c90b4, 0xe4378fb8, 0xb8e46b37, - 0x5de7789f, 0x9f5d25e7, 0x6eb20fbd, 0xbd6e61b2, 0xef2a6943, 0x43ef862a, 0xa6f135c4, 0xc4a693f1, 0xa8e3da39, 0x39a872e3, 0xa4f7c631, 0x31a462f7, 0x37598ad3, 0xd337bd59, 0x8b8674f2, 0xf28bff86, - 0x325683d5, 0xd532b156, 0x43c54e8b, 0x8b430dc5, 0x59eb856e, 0x6e59dceb, 0xb7c218da, 0xdab7afc2, 0x8c8f8e01, 0x018c028f, 0x64ac1db1, 0xb16479ac, 0xd26df19c, 0x9cd2236d, 0xe03b7249, 0x49e0923b, - 0xb4c71fd8, 0xd8b4abc7, 0xfa15b9ac, 0xacfa4315, 0x0709faf3, 0xf307fd09, 0x256fa0cf, 0xcf25856f, 0xafea20ca, 0xcaaf8fea, 0x8e897df4, 0xf48ef389, 0xe9206747, 0x47e98e20, 0x18283810, 0x10182028, - 0xd5640b6f, 0x6fd5de64, 0x888373f0, 0xf088fb83, 0x6fb1fb4a, 0x4a6f94b1, 0x7296ca5c, 0x5c72b896, 0x246c5438, 0x3824706c, 0xf1085f57, 0x57f1ae08, 0xc7522173, 0x73c7e652, 0x51f36497, 0x975135f3, - 0x2365aecb, 0xcb238d65, 0x7c8425a1, 0xa17c5984, 0x9cbf57e8, 0xe89ccbbf, 0x21635d3e, 0x3e217c63, 0xdd7cea96, 0x96dd377c, 0xdc7f1e61, 0x61dcc27f, 0x86919c0d, 0x0d861a91, 0x85949b0f, 0xf851e94, - 0x90ab4be0, 0xe090dbab, 0x42c6ba7c, 0x7c42f8c6, 0xc4572671, 0x71c4e257, 0xaae529cc, 0xccaa83e5, 0xd873e390, 0x90d83b73, 0x050f0906, 0x06050c0f, 0x0103f4f7, 0xf701f503, 0x12362a1c, 0x1c123836, - 0xa3fe3cc2, 0xc2a39ffe, 0x5fe18b6a, 0x6a5fd4e1, 0xf910beae, 0xaef94710, 0xd06b0269, 0x69d0d26b, 0x91a8bf17, 0x17912ea8, 0x58e87199, 0x995829e8, 0x2769533a, 0x3a277469, 0xb9d0f727, 0x27b94ed0, - 0x384891d9, 0xd938a948, 0x1335deeb, 0xeb13cd35, 0xb3cee52b, 0x2bb356ce, 0x33557722, 0x22334455, 0xbbd604d2, 0xd2bbbfd6, 0x709039a9, 0xa9704990, 0x89808707, 0x07890e80, 0xa7f2c133, 0x33a766f2, - 0xb6c1ec2d, 0x2db65ac1, 0x22665a3c, 0x3c227866, 0x92adb815, 0x15922aad, 0x2060a9c9, 0xc9208960, 0x49db5c87, 0x874915db, 0xff1ab0aa, 0xaaff4f1a, 0x7888d850, 0x5078a088, 0x7a8e2ba5, 0xa57a518e, - 0x8f8a8903, 0x038f068a, 0xf8134a59, 0x59f8b213, 0x809b9209, 0x0980129b, 0x1739231a, 0x1a173439, 0xda751065, 0x65daca75, 0x315384d7, 0xd731b553, 0xc651d584, 0x84c61351, 0xb8d303d0, 0xd0b8bbd3, - 0xc35edc82, 0x82c31f5e, 0xb0cbe229, 0x29b052cb, 0x7799c35a, 0x5a77b499, 0x11332d1e, 0x1e113c33, 0xcb463d7b, 0x7bcbf646, 0xfc1fb7a8, 0xa8fc4b1f, 0xd6610c6d, 0x6dd6da61, 0x3a4e622c, 0x2c3a584e -}; - -#define GROESTL_ROTATE_COLUMN_DOWN(v1, v2, amount_bytes, temp_var) { \ - temp_var = (v1<<(8*amount_bytes))|(v2>>(8*(4-amount_bytes))); \ - v2 = (v2<<(8*amount_bytes))|(v1>>(8*(4-amount_bytes))); \ - v1 = temp_var; \ -} - -#define GROESTL_COLUMN(x,y,i, c0,c1,c2,c3,c4,c5,c6,c7, tv1,tv2,tu,tl,t) \ - tu = d_groestl_T[2*(uint32_t)x[4*c0+0]]; \ - tl = d_groestl_T[2*(uint32_t)x[4*c0+0]+1]; \ - tv1 = d_groestl_T[2*(uint32_t)x[4*c1+1]]; \ - tv2 = d_groestl_T[2*(uint32_t)x[4*c1+1]+1]; \ - GROESTL_ROTATE_COLUMN_DOWN(tv1,tv2,1,t) \ - tu ^= tv1; \ - tl ^= tv2; \ - tv1 = d_groestl_T[2*(uint32_t)x[4*c2+2]]; \ - tv2 = d_groestl_T[2*(uint32_t)x[4*c2+2]+1]; \ - GROESTL_ROTATE_COLUMN_DOWN(tv1,tv2,2,t) \ - tu ^= tv1; \ - tl ^= tv2; \ - tv1 = d_groestl_T[2*(uint32_t)x[4*c3+3]]; \ - tv2 = d_groestl_T[2*(uint32_t)x[4*c3+3]+1]; \ - GROESTL_ROTATE_COLUMN_DOWN(tv1,tv2,3,t) \ - tu ^= tv1; \ - tl ^= tv2; \ - tl ^= d_groestl_T[2*(uint32_t)x[4*c4+0]]; \ - tu ^= d_groestl_T[2*(uint32_t)x[4*c4+0]+1]; \ - tv1 = d_groestl_T[2*(uint32_t)x[4*c5+1]]; \ - tv2 = d_groestl_T[2*(uint32_t)x[4*c5+1]+1]; \ - GROESTL_ROTATE_COLUMN_DOWN(tv1,tv2,1,t) \ - tl ^= tv1; \ - tu ^= tv2; \ - tv1 = d_groestl_T[2*(uint32_t)x[4*c6+2]]; \ - tv2 = d_groestl_T[2*(uint32_t)x[4*c6+2]+1]; \ - GROESTL_ROTATE_COLUMN_DOWN(tv1,tv2,2,t) \ - tl ^= tv1; \ - tu ^= tv2; \ - tv1 = d_groestl_T[2*(uint32_t)x[4*c7+3]]; \ - tv2 = d_groestl_T[2*(uint32_t)x[4*c7+3]+1]; \ - GROESTL_ROTATE_COLUMN_DOWN(tv1,tv2,3,t) \ - tl ^= tv1; \ - tu ^= tv2; \ - y[i] = tu; \ - y[i+1] = tl; - -__device__ -void cn_groestl_RND512P(uint8_t * __restrict__ x, uint32_t * __restrict__ y, uint32_t r) -{ - uint32_t temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp; - uint32_t* x32 = (uint32_t*)x; - x32[ 0] ^= 0x00000000^r; - x32[ 2] ^= 0x00000010^r; - x32[ 4] ^= 0x00000020^r; - x32[ 6] ^= 0x00000030^r; - x32[ 8] ^= 0x00000040^r; - x32[10] ^= 0x00000050^r; - x32[12] ^= 0x00000060^r; - x32[14] ^= 0x00000070^r; - GROESTL_COLUMN(x,y, 0, 0, 2, 4, 6, 9, 11, 13, 15, temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp); - GROESTL_COLUMN(x,y, 2, 2, 4, 6, 8, 11, 13, 15, 1, temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp); - GROESTL_COLUMN(x,y, 4, 4, 6, 8, 10, 13, 15, 1, 3, temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp); - GROESTL_COLUMN(x,y, 6, 6, 8, 10, 12, 15, 1, 3, 5, temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp); - GROESTL_COLUMN(x,y, 8, 8, 10, 12, 14, 1, 3, 5, 7, temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp); - GROESTL_COLUMN(x,y,10, 10, 12, 14, 0, 3, 5, 7, 9, temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp); - GROESTL_COLUMN(x,y,12, 12, 14, 0, 2, 5, 7, 9, 11, temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp); - GROESTL_COLUMN(x,y,14, 14, 0, 2, 4, 7, 9, 11, 13, temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp); -} - -__device__ -void cn_groestl_RND512Q(uint8_t * __restrict__ x, uint32_t * __restrict__ y, uint32_t r) -{ - uint32_t temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp; - uint32_t* x32 = (uint32_t*)x; - x32[ 0] = ~x32[ 0]; - x32[ 1] ^= 0xffffffff^r; - x32[ 2] = ~x32[ 2]; - x32[ 3] ^= 0xefffffff^r; - x32[ 4] = ~x32[ 4]; - x32[ 5] ^= 0xdfffffff^r; - x32[ 6] = ~x32[ 6]; - x32[ 7] ^= 0xcfffffff^r; - x32[ 8] = ~x32[ 8]; - x32[ 9] ^= 0xbfffffff^r; - x32[10] = ~x32[10]; - x32[11] ^= 0xafffffff^r; - x32[12] = ~x32[12]; - x32[13] ^= 0x9fffffff^r; - x32[14] = ~x32[14]; - x32[15] ^= 0x8fffffff^r; - GROESTL_COLUMN(x,y, 0, 2, 6, 10, 14, 1, 5, 9, 13, temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp); - GROESTL_COLUMN(x,y, 2, 4, 8, 12, 0, 3, 7, 11, 15, temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp); - GROESTL_COLUMN(x,y, 4, 6, 10, 14, 2, 5, 9, 13, 1, temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp); - GROESTL_COLUMN(x,y, 6, 8, 12, 0, 4, 7, 11, 15, 3, temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp); - GROESTL_COLUMN(x,y, 8, 10, 14, 2, 6, 9, 13, 1, 5, temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp); - GROESTL_COLUMN(x,y,10, 12, 0, 4, 8, 11, 15, 3, 7, temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp); - GROESTL_COLUMN(x,y,12, 14, 2, 6, 10, 13, 1, 5, 9, temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp); - GROESTL_COLUMN(x,y,14, 0, 4, 8, 12, 15, 3, 7, 11, temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp); -} - -__device__ -void cn_groestl_F512(uint32_t * __restrict__ h, const uint32_t * __restrict__ m) -{ - int i; - uint32_t Ptmp[2*GROESTL_COLS512]; - uint32_t Qtmp[2*GROESTL_COLS512]; - uint32_t y[2*GROESTL_COLS512]; - uint32_t z[2*GROESTL_COLS512]; - - for (i = 0; i < 2*GROESTL_COLS512; i++) { - z[i] = m[i]; - Ptmp[i] = h[i]^m[i]; - } - - cn_groestl_RND512Q((uint8_t*)z, y, 0x00000000); - cn_groestl_RND512Q((uint8_t*)y, z, 0x01000000); - cn_groestl_RND512Q((uint8_t*)z, y, 0x02000000); - cn_groestl_RND512Q((uint8_t*)y, z, 0x03000000); - cn_groestl_RND512Q((uint8_t*)z, y, 0x04000000); - cn_groestl_RND512Q((uint8_t*)y, z, 0x05000000); - cn_groestl_RND512Q((uint8_t*)z, y, 0x06000000); - cn_groestl_RND512Q((uint8_t*)y, z, 0x07000000); - cn_groestl_RND512Q((uint8_t*)z, y, 0x08000000); - cn_groestl_RND512Q((uint8_t*)y, Qtmp, 0x09000000); - - cn_groestl_RND512P((uint8_t*)Ptmp, y, 0x00000000); - cn_groestl_RND512P((uint8_t*)y, z, 0x00000001); - cn_groestl_RND512P((uint8_t*)z, y, 0x00000002); - cn_groestl_RND512P((uint8_t*)y, z, 0x00000003); - cn_groestl_RND512P((uint8_t*)z, y, 0x00000004); - cn_groestl_RND512P((uint8_t*)y, z, 0x00000005); - cn_groestl_RND512P((uint8_t*)z, y, 0x00000006); - cn_groestl_RND512P((uint8_t*)y, z, 0x00000007); - cn_groestl_RND512P((uint8_t*)z, y, 0x00000008); - cn_groestl_RND512P((uint8_t*)y, Ptmp, 0x00000009); - - for (i = 0; i < 2*GROESTL_COLS512; i++) - h[i] ^= Ptmp[i]^Qtmp[i]; -} - -__device__ -void cn_groestl_outputtransformation(groestlHashState *ctx) -{ - int j; - uint32_t temp[2*GROESTL_COLS512]; - uint32_t y[2*GROESTL_COLS512]; - uint32_t z[2*GROESTL_COLS512]; - - for (j = 0; j < 2*GROESTL_COLS512; j++) - temp[j] = ctx->chaining[j]; - - cn_groestl_RND512P((uint8_t*)temp, y, 0x00000000); - cn_groestl_RND512P((uint8_t*)y, z, 0x00000001); - cn_groestl_RND512P((uint8_t*)z, y, 0x00000002); - cn_groestl_RND512P((uint8_t*)y, z, 0x00000003); - cn_groestl_RND512P((uint8_t*)z, y, 0x00000004); - cn_groestl_RND512P((uint8_t*)y, z, 0x00000005); - cn_groestl_RND512P((uint8_t*)z, y, 0x00000006); - cn_groestl_RND512P((uint8_t*)y, z, 0x00000007); - cn_groestl_RND512P((uint8_t*)z, y, 0x00000008); - cn_groestl_RND512P((uint8_t*)y, temp, 0x00000009); - - for (j = 0; j < 2*GROESTL_COLS512; j++) - ctx->chaining[j] ^= temp[j]; -} - -__device__ -void cn_groestl_transform(groestlHashState * __restrict__ ctx, - const uint8_t * __restrict__ input, int msglen) -{ - for (; msglen >= GROESTL_SIZE512; msglen -= GROESTL_SIZE512, input += GROESTL_SIZE512) { - cn_groestl_F512(ctx->chaining,(uint32_t*)input); - ctx->block_counter1++; - if (ctx->block_counter1 == 0) ctx->block_counter2++; - } -} - -__device__ -void cn_groestl_final(groestlHashState* __restrict__ ctx, BitSequence* __restrict__ output) -{ - int i, j = 0, hashbytelen = GROESTL_HASH_BIT_LEN/8; - uint8_t *s = (BitSequence*)ctx->chaining; - - if (ctx->bits_in_last_byte) { - ctx->buffer[(int)ctx->buf_ptr-1] &= ((1<bits_in_last_byte)-1)<<(8-ctx->bits_in_last_byte); - ctx->buffer[(int)ctx->buf_ptr-1] ^= 0x1<<(7-ctx->bits_in_last_byte); - ctx->bits_in_last_byte = 0; - } - else ctx->buffer[(int)ctx->buf_ptr++] = 0x80; - - if (ctx->buf_ptr > GROESTL_SIZE512-GROESTL_LENGTHFIELDLEN) { - while (ctx->buf_ptr < GROESTL_SIZE512) { - ctx->buffer[(int)ctx->buf_ptr++] = 0; - } - cn_groestl_transform(ctx, ctx->buffer, GROESTL_SIZE512); - ctx->buf_ptr = 0; - } - while (ctx->buf_ptr < GROESTL_SIZE512-GROESTL_LENGTHFIELDLEN) { - ctx->buffer[(int)ctx->buf_ptr++] = 0; - } - - ctx->block_counter1++; - if (ctx->block_counter1 == 0) ctx->block_counter2++; - ctx->buf_ptr = GROESTL_SIZE512; - - while (ctx->buf_ptr > GROESTL_SIZE512-(int)sizeof(uint32_t)) { - ctx->buffer[(int)--ctx->buf_ptr] = (uint8_t)ctx->block_counter1; - ctx->block_counter1 >>= 8; - } - while (ctx->buf_ptr > GROESTL_SIZE512-GROESTL_LENGTHFIELDLEN) { - ctx->buffer[(int)--ctx->buf_ptr] = (uint8_t)ctx->block_counter2; - ctx->block_counter2 >>= 8; - } - cn_groestl_transform(ctx, ctx->buffer, GROESTL_SIZE512); - cn_groestl_outputtransformation(ctx); - - for (i = GROESTL_SIZE512-hashbytelen; i < GROESTL_SIZE512; i++,j++) { - output[j] = s[i]; - } - - for (i = 0; i < GROESTL_COLS512; i++) { - ctx->chaining[i] = 0; - } - for (i = 0; i < GROESTL_SIZE512; i++) { - ctx->buffer[i] = 0; - } -} - -__device__ -void cn_groestl_update(groestlHashState* __restrict__ ctx, - const BitSequence* __restrict__ input, DataLength databitlen) -{ - int index = 0; - int msglen = (int)(databitlen/8); - int rem = (int)(databitlen%8); - - if (ctx->buf_ptr) { - while (ctx->buf_ptr < GROESTL_SIZE512 && index < msglen) { - ctx->buffer[(int)ctx->buf_ptr++] = input[index++]; - } - if (ctx->buf_ptr < GROESTL_SIZE512) { - if (rem) { - ctx->bits_in_last_byte = rem; - ctx->buffer[(int)ctx->buf_ptr++] = input[index]; - } - return; - } - - ctx->buf_ptr = 0; - cn_groestl_transform(ctx, ctx->buffer, GROESTL_SIZE512); - } - - cn_groestl_transform(ctx, input+index, msglen-index); - index += ((msglen-index)/GROESTL_SIZE512)*GROESTL_SIZE512; - - while (index < msglen) { - ctx->buffer[(int)ctx->buf_ptr++] = input[index++]; - } - - if (rem) { - ctx->bits_in_last_byte = rem; - ctx->buffer[(int)ctx->buf_ptr++] = input[index]; - } -} - -__device__ -void cn_groestl_init(groestlHashState* ctx) -{ - int i = 0; - - for(;i<(GROESTL_SIZE512/sizeof(uint32_t));i++) - ctx->chaining[i] = 0; - - ctx->chaining[2*GROESTL_COLS512-1] = u32BIG((uint32_t)GROESTL_HASH_BIT_LEN); - ctx->buf_ptr = 0; - ctx->block_counter1 = 0; - ctx->block_counter2 = 0; - ctx->bits_in_last_byte = 0; -} - -__device__ -void cn_groestl(const BitSequence * __restrict__ data, DataLength len, BitSequence * __restrict__ hashval) -{ - DataLength databitlen = len << 3; - groestlHashState context; - - cn_groestl_init(&context); - cn_groestl_update(&context, data, databitlen); - cn_groestl_final(&context, hashval); -} diff --git a/crypto/cn_jh.cuh b/crypto/cn_jh.cuh deleted file mode 100644 index c2df7637..00000000 --- a/crypto/cn_jh.cuh +++ /dev/null @@ -1,294 +0,0 @@ - -typedef struct { - int hashbitlen; - unsigned long long databitlen; - unsigned long long datasize_in_buffer; - uint64_t x[8][2]; - unsigned char buffer[64]; -} jhHashState; - -__constant__ unsigned char d_JH256_H0[512] = { - 0xeb, 0x98, 0xa3, 0x41, 0x2c, 0x20, 0xd3, 0xeb, 0x92, 0xcd, 0xbe, 0x7b, 0x9c, 0xb2, 0x45, 0xc1, - 0x1c, 0x93, 0x51, 0x91, 0x60, 0xd4, 0xc7, 0xfa, 0x26, 0x0, 0x82, 0xd6, 0x7e, 0x50, 0x8a, 0x3, - 0xa4, 0x23, 0x9e, 0x26, 0x77, 0x26, 0xb9, 0x45, 0xe0, 0xfb, 0x1a, 0x48, 0xd4, 0x1a, 0x94, 0x77, - 0xcd, 0xb5, 0xab, 0x26, 0x2, 0x6b, 0x17, 0x7a, 0x56, 0xf0, 0x24, 0x42, 0xf, 0xff, 0x2f, 0xa8, - 0x71, 0xa3, 0x96, 0x89, 0x7f, 0x2e, 0x4d, 0x75, 0x1d, 0x14, 0x49, 0x8, 0xf7, 0x7d, 0xe2, 0x62, - 0x27, 0x76, 0x95, 0xf7, 0x76, 0x24, 0x8f, 0x94, 0x87, 0xd5, 0xb6, 0x57, 0x47, 0x80, 0x29, 0x6c, - 0x5c, 0x5e, 0x27, 0x2d, 0xac, 0x8e, 0xd, 0x6c, 0x51, 0x84, 0x50, 0xc6, 0x57, 0x5, 0x7a, 0xf, - 0x7b, 0xe4, 0xd3, 0x67, 0x70, 0x24, 0x12, 0xea, 0x89, 0xe3, 0xab, 0x13, 0xd3, 0x1c, 0xd7, 0x69 -}; - -__constant__ unsigned char d_E8_rc[42][32] = { - {0x72, 0xd5, 0xde, 0xa2, 0xdf, 0x15, 0xf8, 0x67, 0x7b, 0x84, 0x15, 0xa, 0xb7, 0x23, 0x15, 0x57, 0x81, 0xab, 0xd6, 0x90, 0x4d, 0x5a, 0x87, 0xf6, 0x4e, 0x9f, 0x4f, 0xc5, 0xc3, 0xd1, 0x2b, 0x40}, - {0xea, 0x98, 0x3a, 0xe0, 0x5c, 0x45, 0xfa, 0x9c, 0x3, 0xc5, 0xd2, 0x99, 0x66, 0xb2, 0x99, 0x9a, 0x66, 0x2, 0x96, 0xb4, 0xf2, 0xbb, 0x53, 0x8a, 0xb5, 0x56, 0x14, 0x1a, 0x88, 0xdb, 0xa2, 0x31}, - {0x3, 0xa3, 0x5a, 0x5c, 0x9a, 0x19, 0xe, 0xdb, 0x40, 0x3f, 0xb2, 0xa, 0x87, 0xc1, 0x44, 0x10, 0x1c, 0x5, 0x19, 0x80, 0x84, 0x9e, 0x95, 0x1d, 0x6f, 0x33, 0xeb, 0xad, 0x5e, 0xe7, 0xcd, 0xdc}, - {0x10, 0xba, 0x13, 0x92, 0x2, 0xbf, 0x6b, 0x41, 0xdc, 0x78, 0x65, 0x15, 0xf7, 0xbb, 0x27, 0xd0, 0xa, 0x2c, 0x81, 0x39, 0x37, 0xaa, 0x78, 0x50, 0x3f, 0x1a, 0xbf, 0xd2, 0x41, 0x0, 0x91, 0xd3}, - {0x42, 0x2d, 0x5a, 0xd, 0xf6, 0xcc, 0x7e, 0x90, 0xdd, 0x62, 0x9f, 0x9c, 0x92, 0xc0, 0x97, 0xce, 0x18, 0x5c, 0xa7, 0xb, 0xc7, 0x2b, 0x44, 0xac, 0xd1, 0xdf, 0x65, 0xd6, 0x63, 0xc6, 0xfc, 0x23}, - {0x97, 0x6e, 0x6c, 0x3, 0x9e, 0xe0, 0xb8, 0x1a, 0x21, 0x5, 0x45, 0x7e, 0x44, 0x6c, 0xec, 0xa8, 0xee, 0xf1, 0x3, 0xbb, 0x5d, 0x8e, 0x61, 0xfa, 0xfd, 0x96, 0x97, 0xb2, 0x94, 0x83, 0x81, 0x97}, - {0x4a, 0x8e, 0x85, 0x37, 0xdb, 0x3, 0x30, 0x2f, 0x2a, 0x67, 0x8d, 0x2d, 0xfb, 0x9f, 0x6a, 0x95, 0x8a, 0xfe, 0x73, 0x81, 0xf8, 0xb8, 0x69, 0x6c, 0x8a, 0xc7, 0x72, 0x46, 0xc0, 0x7f, 0x42, 0x14}, - {0xc5, 0xf4, 0x15, 0x8f, 0xbd, 0xc7, 0x5e, 0xc4, 0x75, 0x44, 0x6f, 0xa7, 0x8f, 0x11, 0xbb, 0x80, 0x52, 0xde, 0x75, 0xb7, 0xae, 0xe4, 0x88, 0xbc, 0x82, 0xb8, 0x0, 0x1e, 0x98, 0xa6, 0xa3, 0xf4}, - {0x8e, 0xf4, 0x8f, 0x33, 0xa9, 0xa3, 0x63, 0x15, 0xaa, 0x5f, 0x56, 0x24, 0xd5, 0xb7, 0xf9, 0x89, 0xb6, 0xf1, 0xed, 0x20, 0x7c, 0x5a, 0xe0, 0xfd, 0x36, 0xca, 0xe9, 0x5a, 0x6, 0x42, 0x2c, 0x36}, - {0xce, 0x29, 0x35, 0x43, 0x4e, 0xfe, 0x98, 0x3d, 0x53, 0x3a, 0xf9, 0x74, 0x73, 0x9a, 0x4b, 0xa7, 0xd0, 0xf5, 0x1f, 0x59, 0x6f, 0x4e, 0x81, 0x86, 0xe, 0x9d, 0xad, 0x81, 0xaf, 0xd8, 0x5a, 0x9f}, - {0xa7, 0x5, 0x6, 0x67, 0xee, 0x34, 0x62, 0x6a, 0x8b, 0xb, 0x28, 0xbe, 0x6e, 0xb9, 0x17, 0x27, 0x47, 0x74, 0x7, 0x26, 0xc6, 0x80, 0x10, 0x3f, 0xe0, 0xa0, 0x7e, 0x6f, 0xc6, 0x7e, 0x48, 0x7b}, - {0xd, 0x55, 0xa, 0xa5, 0x4a, 0xf8, 0xa4, 0xc0, 0x91, 0xe3, 0xe7, 0x9f, 0x97, 0x8e, 0xf1, 0x9e, 0x86, 0x76, 0x72, 0x81, 0x50, 0x60, 0x8d, 0xd4, 0x7e, 0x9e, 0x5a, 0x41, 0xf3, 0xe5, 0xb0, 0x62}, - {0xfc, 0x9f, 0x1f, 0xec, 0x40, 0x54, 0x20, 0x7a, 0xe3, 0xe4, 0x1a, 0x0, 0xce, 0xf4, 0xc9, 0x84, 0x4f, 0xd7, 0x94, 0xf5, 0x9d, 0xfa, 0x95, 0xd8, 0x55, 0x2e, 0x7e, 0x11, 0x24, 0xc3, 0x54, 0xa5}, - {0x5b, 0xdf, 0x72, 0x28, 0xbd, 0xfe, 0x6e, 0x28, 0x78, 0xf5, 0x7f, 0xe2, 0xf, 0xa5, 0xc4, 0xb2, 0x5, 0x89, 0x7c, 0xef, 0xee, 0x49, 0xd3, 0x2e, 0x44, 0x7e, 0x93, 0x85, 0xeb, 0x28, 0x59, 0x7f}, - {0x70, 0x5f, 0x69, 0x37, 0xb3, 0x24, 0x31, 0x4a, 0x5e, 0x86, 0x28, 0xf1, 0x1d, 0xd6, 0xe4, 0x65, 0xc7, 0x1b, 0x77, 0x4, 0x51, 0xb9, 0x20, 0xe7, 0x74, 0xfe, 0x43, 0xe8, 0x23, 0xd4, 0x87, 0x8a}, - {0x7d, 0x29, 0xe8, 0xa3, 0x92, 0x76, 0x94, 0xf2, 0xdd, 0xcb, 0x7a, 0x9, 0x9b, 0x30, 0xd9, 0xc1, 0x1d, 0x1b, 0x30, 0xfb, 0x5b, 0xdc, 0x1b, 0xe0, 0xda, 0x24, 0x49, 0x4f, 0xf2, 0x9c, 0x82, 0xbf}, - {0xa4, 0xe7, 0xba, 0x31, 0xb4, 0x70, 0xbf, 0xff, 0xd, 0x32, 0x44, 0x5, 0xde, 0xf8, 0xbc, 0x48, 0x3b, 0xae, 0xfc, 0x32, 0x53, 0xbb, 0xd3, 0x39, 0x45, 0x9f, 0xc3, 0xc1, 0xe0, 0x29, 0x8b, 0xa0}, - {0xe5, 0xc9, 0x5, 0xfd, 0xf7, 0xae, 0x9, 0xf, 0x94, 0x70, 0x34, 0x12, 0x42, 0x90, 0xf1, 0x34, 0xa2, 0x71, 0xb7, 0x1, 0xe3, 0x44, 0xed, 0x95, 0xe9, 0x3b, 0x8e, 0x36, 0x4f, 0x2f, 0x98, 0x4a}, - {0x88, 0x40, 0x1d, 0x63, 0xa0, 0x6c, 0xf6, 0x15, 0x47, 0xc1, 0x44, 0x4b, 0x87, 0x52, 0xaf, 0xff, 0x7e, 0xbb, 0x4a, 0xf1, 0xe2, 0xa, 0xc6, 0x30, 0x46, 0x70, 0xb6, 0xc5, 0xcc, 0x6e, 0x8c, 0xe6}, - {0xa4, 0xd5, 0xa4, 0x56, 0xbd, 0x4f, 0xca, 0x0, 0xda, 0x9d, 0x84, 0x4b, 0xc8, 0x3e, 0x18, 0xae, 0x73, 0x57, 0xce, 0x45, 0x30, 0x64, 0xd1, 0xad, 0xe8, 0xa6, 0xce, 0x68, 0x14, 0x5c, 0x25, 0x67}, - {0xa3, 0xda, 0x8c, 0xf2, 0xcb, 0xe, 0xe1, 0x16, 0x33, 0xe9, 0x6, 0x58, 0x9a, 0x94, 0x99, 0x9a, 0x1f, 0x60, 0xb2, 0x20, 0xc2, 0x6f, 0x84, 0x7b, 0xd1, 0xce, 0xac, 0x7f, 0xa0, 0xd1, 0x85, 0x18}, - {0x32, 0x59, 0x5b, 0xa1, 0x8d, 0xdd, 0x19, 0xd3, 0x50, 0x9a, 0x1c, 0xc0, 0xaa, 0xa5, 0xb4, 0x46, 0x9f, 0x3d, 0x63, 0x67, 0xe4, 0x4, 0x6b, 0xba, 0xf6, 0xca, 0x19, 0xab, 0xb, 0x56, 0xee, 0x7e}, - {0x1f, 0xb1, 0x79, 0xea, 0xa9, 0x28, 0x21, 0x74, 0xe9, 0xbd, 0xf7, 0x35, 0x3b, 0x36, 0x51, 0xee, 0x1d, 0x57, 0xac, 0x5a, 0x75, 0x50, 0xd3, 0x76, 0x3a, 0x46, 0xc2, 0xfe, 0xa3, 0x7d, 0x70, 0x1}, - {0xf7, 0x35, 0xc1, 0xaf, 0x98, 0xa4, 0xd8, 0x42, 0x78, 0xed, 0xec, 0x20, 0x9e, 0x6b, 0x67, 0x79, 0x41, 0x83, 0x63, 0x15, 0xea, 0x3a, 0xdb, 0xa8, 0xfa, 0xc3, 0x3b, 0x4d, 0x32, 0x83, 0x2c, 0x83}, - {0xa7, 0x40, 0x3b, 0x1f, 0x1c, 0x27, 0x47, 0xf3, 0x59, 0x40, 0xf0, 0x34, 0xb7, 0x2d, 0x76, 0x9a, 0xe7, 0x3e, 0x4e, 0x6c, 0xd2, 0x21, 0x4f, 0xfd, 0xb8, 0xfd, 0x8d, 0x39, 0xdc, 0x57, 0x59, 0xef}, - {0x8d, 0x9b, 0xc, 0x49, 0x2b, 0x49, 0xeb, 0xda, 0x5b, 0xa2, 0xd7, 0x49, 0x68, 0xf3, 0x70, 0xd, 0x7d, 0x3b, 0xae, 0xd0, 0x7a, 0x8d, 0x55, 0x84, 0xf5, 0xa5, 0xe9, 0xf0, 0xe4, 0xf8, 0x8e, 0x65}, - {0xa0, 0xb8, 0xa2, 0xf4, 0x36, 0x10, 0x3b, 0x53, 0xc, 0xa8, 0x7, 0x9e, 0x75, 0x3e, 0xec, 0x5a, 0x91, 0x68, 0x94, 0x92, 0x56, 0xe8, 0x88, 0x4f, 0x5b, 0xb0, 0x5c, 0x55, 0xf8, 0xba, 0xbc, 0x4c}, - {0xe3, 0xbb, 0x3b, 0x99, 0xf3, 0x87, 0x94, 0x7b, 0x75, 0xda, 0xf4, 0xd6, 0x72, 0x6b, 0x1c, 0x5d, 0x64, 0xae, 0xac, 0x28, 0xdc, 0x34, 0xb3, 0x6d, 0x6c, 0x34, 0xa5, 0x50, 0xb8, 0x28, 0xdb, 0x71}, - {0xf8, 0x61, 0xe2, 0xf2, 0x10, 0x8d, 0x51, 0x2a, 0xe3, 0xdb, 0x64, 0x33, 0x59, 0xdd, 0x75, 0xfc, 0x1c, 0xac, 0xbc, 0xf1, 0x43, 0xce, 0x3f, 0xa2, 0x67, 0xbb, 0xd1, 0x3c, 0x2, 0xe8, 0x43, 0xb0}, - {0x33, 0xa, 0x5b, 0xca, 0x88, 0x29, 0xa1, 0x75, 0x7f, 0x34, 0x19, 0x4d, 0xb4, 0x16, 0x53, 0x5c, 0x92, 0x3b, 0x94, 0xc3, 0xe, 0x79, 0x4d, 0x1e, 0x79, 0x74, 0x75, 0xd7, 0xb6, 0xee, 0xaf, 0x3f}, - {0xea, 0xa8, 0xd4, 0xf7, 0xbe, 0x1a, 0x39, 0x21, 0x5c, 0xf4, 0x7e, 0x9, 0x4c, 0x23, 0x27, 0x51, 0x26, 0xa3, 0x24, 0x53, 0xba, 0x32, 0x3c, 0xd2, 0x44, 0xa3, 0x17, 0x4a, 0x6d, 0xa6, 0xd5, 0xad}, - {0xb5, 0x1d, 0x3e, 0xa6, 0xaf, 0xf2, 0xc9, 0x8, 0x83, 0x59, 0x3d, 0x98, 0x91, 0x6b, 0x3c, 0x56, 0x4c, 0xf8, 0x7c, 0xa1, 0x72, 0x86, 0x60, 0x4d, 0x46, 0xe2, 0x3e, 0xcc, 0x8, 0x6e, 0xc7, 0xf6}, - {0x2f, 0x98, 0x33, 0xb3, 0xb1, 0xbc, 0x76, 0x5e, 0x2b, 0xd6, 0x66, 0xa5, 0xef, 0xc4, 0xe6, 0x2a, 0x6, 0xf4, 0xb6, 0xe8, 0xbe, 0xc1, 0xd4, 0x36, 0x74, 0xee, 0x82, 0x15, 0xbc, 0xef, 0x21, 0x63}, - {0xfd, 0xc1, 0x4e, 0xd, 0xf4, 0x53, 0xc9, 0x69, 0xa7, 0x7d, 0x5a, 0xc4, 0x6, 0x58, 0x58, 0x26, 0x7e, 0xc1, 0x14, 0x16, 0x6, 0xe0, 0xfa, 0x16, 0x7e, 0x90, 0xaf, 0x3d, 0x28, 0x63, 0x9d, 0x3f}, - {0xd2, 0xc9, 0xf2, 0xe3, 0x0, 0x9b, 0xd2, 0xc, 0x5f, 0xaa, 0xce, 0x30, 0xb7, 0xd4, 0xc, 0x30, 0x74, 0x2a, 0x51, 0x16, 0xf2, 0xe0, 0x32, 0x98, 0xd, 0xeb, 0x30, 0xd8, 0xe3, 0xce, 0xf8, 0x9a}, - {0x4b, 0xc5, 0x9e, 0x7b, 0xb5, 0xf1, 0x79, 0x92, 0xff, 0x51, 0xe6, 0x6e, 0x4, 0x86, 0x68, 0xd3, 0x9b, 0x23, 0x4d, 0x57, 0xe6, 0x96, 0x67, 0x31, 0xcc, 0xe6, 0xa6, 0xf3, 0x17, 0xa, 0x75, 0x5}, - {0xb1, 0x76, 0x81, 0xd9, 0x13, 0x32, 0x6c, 0xce, 0x3c, 0x17, 0x52, 0x84, 0xf8, 0x5, 0xa2, 0x62, 0xf4, 0x2b, 0xcb, 0xb3, 0x78, 0x47, 0x15, 0x47, 0xff, 0x46, 0x54, 0x82, 0x23, 0x93, 0x6a, 0x48}, - {0x38, 0xdf, 0x58, 0x7, 0x4e, 0x5e, 0x65, 0x65, 0xf2, 0xfc, 0x7c, 0x89, 0xfc, 0x86, 0x50, 0x8e, 0x31, 0x70, 0x2e, 0x44, 0xd0, 0xb, 0xca, 0x86, 0xf0, 0x40, 0x9, 0xa2, 0x30, 0x78, 0x47, 0x4e}, - {0x65, 0xa0, 0xee, 0x39, 0xd1, 0xf7, 0x38, 0x83, 0xf7, 0x5e, 0xe9, 0x37, 0xe4, 0x2c, 0x3a, 0xbd, 0x21, 0x97, 0xb2, 0x26, 0x1, 0x13, 0xf8, 0x6f, 0xa3, 0x44, 0xed, 0xd1, 0xef, 0x9f, 0xde, 0xe7}, - {0x8b, 0xa0, 0xdf, 0x15, 0x76, 0x25, 0x92, 0xd9, 0x3c, 0x85, 0xf7, 0xf6, 0x12, 0xdc, 0x42, 0xbe, 0xd8, 0xa7, 0xec, 0x7c, 0xab, 0x27, 0xb0, 0x7e, 0x53, 0x8d, 0x7d, 0xda, 0xaa, 0x3e, 0xa8, 0xde}, - {0xaa, 0x25, 0xce, 0x93, 0xbd, 0x2, 0x69, 0xd8, 0x5a, 0xf6, 0x43, 0xfd, 0x1a, 0x73, 0x8, 0xf9, 0xc0, 0x5f, 0xef, 0xda, 0x17, 0x4a, 0x19, 0xa5, 0x97, 0x4d, 0x66, 0x33, 0x4c, 0xfd, 0x21, 0x6a}, - {0x35, 0xb4, 0x98, 0x31, 0xdb, 0x41, 0x15, 0x70, 0xea, 0x1e, 0xf, 0xbb, 0xed, 0xcd, 0x54, 0x9b, 0x9a, 0xd0, 0x63, 0xa1, 0x51, 0x97, 0x40, 0x72, 0xf6, 0x75, 0x9d, 0xbf, 0x91, 0x47, 0x6f, 0xe2} -}; - -#define JH_SWAP1(x) (x) = ((((x) & 0x5555555555555555ULL) << 1) | (((x) & 0xaaaaaaaaaaaaaaaaULL) >> 1)); -#define JH_SWAP2(x) (x) = ((((x) & 0x3333333333333333ULL) << 2) | (((x) & 0xccccccccccccccccULL) >> 2)); -#define JH_SWAP4(x) (x) = ((((x) & 0x0f0f0f0f0f0f0f0fULL) << 4) | (((x) & 0xf0f0f0f0f0f0f0f0ULL) >> 4)); -#define JH_SWAP8(x) (x) = ((((x) & 0x00ff00ff00ff00ffULL) << 8) | (((x) & 0xff00ff00ff00ff00ULL) >> 8)); -#define JH_SWAP16(x) (x) = ((((x) & 0x0000ffff0000ffffULL) << 16) | (((x) & 0xffff0000ffff0000ULL) >> 16)); -#define JH_SWAP32(x) (x) = (((x) << 32) | ((x) >> 32)); - -#define JH_L(m0,m1,m2,m3,m4,m5,m6,m7) \ - (m4) ^= (m1); \ - (m5) ^= (m2); \ - (m6) ^= (m0) ^ (m3); \ - (m7) ^= (m0); \ - (m0) ^= (m5); \ - (m1) ^= (m6); \ - (m2) ^= (m4) ^ (m7); \ - (m3) ^= (m4); - -#define JH_SS(m0,m1,m2,m3,m4,m5,m6,m7,cc0,cc1) \ - m3 = ~(m3); \ - m7 = ~(m7); \ - m0 ^= ((~(m2)) & (cc0)); \ - m4 ^= ((~(m6)) & (cc1)); \ - temp0 = (cc0) ^ ((m0) & (m1));\ - temp1 = (cc1) ^ ((m4) & (m5));\ - m0 ^= ((m2) & (m3)); \ - m4 ^= ((m6) & (m7)); \ - m3 ^= ((~(m1)) & (m2)); \ - m7 ^= ((~(m5)) & (m6)); \ - m1 ^= ((m0) & (m2)); \ - m5 ^= ((m4) & (m6)); \ - m2 ^= ((m0) & (~(m3))); \ - m6 ^= ((m4) & (~(m7))); \ - m0 ^= ((m1) | (m3)); \ - m4 ^= ((m5) | (m7)); \ - m3 ^= ((m1) & (m2)); \ - m7 ^= ((m5) & (m6)); \ - m1 ^= (temp0 & (m0)); \ - m5 ^= (temp1 & (m4)); \ - m2 ^= temp0; \ - m6 ^= temp1; - -__device__ -void cn_jh_E8(jhHashState *state) -{ - uint64_t i,roundnumber,temp0,temp1; - - for (roundnumber = 0; roundnumber < 42; roundnumber = roundnumber+7) - { - for (i = 0; i < 2; i++) { - JH_SS(state->x[0][i],state->x[2][i],state->x[4][i],state->x[6][i],state->x[1][i],state->x[3][i],state->x[5][i],state->x[7][i], - ((uint64_t *)d_E8_rc[roundnumber+0])[i],((uint64_t *)d_E8_rc[roundnumber+0])[i+2] ); - JH_L(state->x[0][i],state->x[2][i],state->x[4][i],state->x[6][i],state->x[1][i],state->x[3][i],state->x[5][i],state->x[7][i]); - JH_SWAP1(state->x[1][i]); JH_SWAP1(state->x[3][i]); JH_SWAP1(state->x[5][i]); JH_SWAP1(state->x[7][i]); - } - - for (i = 0; i < 2; i++) { - JH_SS(state->x[0][i],state->x[2][i],state->x[4][i],state->x[6][i],state->x[1][i],state->x[3][i],state->x[5][i],state->x[7][i], - ((uint64_t *)d_E8_rc[roundnumber+1])[i],((uint64_t *)d_E8_rc[roundnumber+1])[i+2] ); - JH_L(state->x[0][i],state->x[2][i],state->x[4][i],state->x[6][i],state->x[1][i],state->x[3][i],state->x[5][i],state->x[7][i]); - JH_SWAP2(state->x[1][i]); JH_SWAP2(state->x[3][i]); JH_SWAP2(state->x[5][i]); JH_SWAP2(state->x[7][i]); - } - - for (i = 0; i < 2; i++) { - JH_SS(state->x[0][i],state->x[2][i],state->x[4][i],state->x[6][i],state->x[1][i],state->x[3][i],state->x[5][i],state->x[7][i], - ((uint64_t *)d_E8_rc[roundnumber+2])[i],((uint64_t *)d_E8_rc[roundnumber+2])[i+2] ); - JH_L(state->x[0][i],state->x[2][i],state->x[4][i],state->x[6][i],state->x[1][i],state->x[3][i],state->x[5][i],state->x[7][i]); - JH_SWAP4(state->x[1][i]); JH_SWAP4(state->x[3][i]); JH_SWAP4(state->x[5][i]); JH_SWAP4(state->x[7][i]); - } - - for (i = 0; i < 2; i++) { - JH_SS(state->x[0][i],state->x[2][i],state->x[4][i],state->x[6][i],state->x[1][i],state->x[3][i],state->x[5][i],state->x[7][i], - ((uint64_t *)d_E8_rc[roundnumber+3])[i],((uint64_t *)d_E8_rc[roundnumber+3])[i+2] ); - JH_L(state->x[0][i],state->x[2][i],state->x[4][i],state->x[6][i],state->x[1][i],state->x[3][i],state->x[5][i],state->x[7][i]); - JH_SWAP8(state->x[1][i]); JH_SWAP8(state->x[3][i]); JH_SWAP8(state->x[5][i]); JH_SWAP8(state->x[7][i]); - } - - for (i = 0; i < 2; i++) { - JH_SS(state->x[0][i],state->x[2][i],state->x[4][i],state->x[6][i],state->x[1][i],state->x[3][i],state->x[5][i],state->x[7][i], - ((uint64_t *)d_E8_rc[roundnumber+4])[i],((uint64_t *)d_E8_rc[roundnumber+4])[i+2] ); - JH_L(state->x[0][i],state->x[2][i],state->x[4][i],state->x[6][i],state->x[1][i],state->x[3][i],state->x[5][i],state->x[7][i]); - JH_SWAP16(state->x[1][i]); JH_SWAP16(state->x[3][i]); JH_SWAP16(state->x[5][i]); JH_SWAP16(state->x[7][i]); - } - - for (i = 0; i < 2; i++) { - JH_SS(state->x[0][i],state->x[2][i],state->x[4][i],state->x[6][i],state->x[1][i],state->x[3][i],state->x[5][i],state->x[7][i], - ((uint64_t *)d_E8_rc[roundnumber+5])[i],((uint64_t *)d_E8_rc[roundnumber+5])[i+2] ); - JH_L(state->x[0][i],state->x[2][i],state->x[4][i],state->x[6][i],state->x[1][i],state->x[3][i],state->x[5][i],state->x[7][i]); - JH_SWAP32(state->x[1][i]); JH_SWAP32(state->x[3][i]); JH_SWAP32(state->x[5][i]); JH_SWAP32(state->x[7][i]); - } - - for (i = 0; i < 2; i++) { - JH_SS(state->x[0][i],state->x[2][i],state->x[4][i],state->x[6][i],state->x[1][i],state->x[3][i],state->x[5][i],state->x[7][i], - ((uint64_t *)d_E8_rc[roundnumber+6])[i],((uint64_t *)d_E8_rc[roundnumber+6])[i+2] ); - JH_L(state->x[0][i],state->x[2][i],state->x[4][i],state->x[6][i],state->x[1][i],state->x[3][i],state->x[5][i],state->x[7][i]); - } - - for (i = 1; i < 8; i = i+2) { - temp0 = state->x[i][0]; state->x[i][0] = state->x[i][1]; state->x[i][1] = temp0; - } - } -} - -__device__ -void cn_jh_F8(jhHashState *state) -{ - uint64_t i; - for (i = 0; i < 8; i++) { - state->x[i >> 1][i & 1] ^= ((uint64_t *)state->buffer)[i]; - } - - cn_jh_E8(state); - - for (i = 0; i < 8; i++) { - state->x[(8+i) >> 1][(8+i) & 1] ^= ((uint64_t *)state->buffer)[i]; - } -} - -__device__ -void cn_jh_update(jhHashState * __restrict__ state, const uint8_t * __restrict__ data, DataLength databitlen) -{ - DataLength index; - - state->databitlen += databitlen; - index = 0; - - if ( (state->datasize_in_buffer > 0 ) && (( state->datasize_in_buffer + databitlen) < 512) ) - { - if ( (databitlen & 7) == 0 ) { - memcpy(state->buffer + (state->datasize_in_buffer >> 3), data, 64-(state->datasize_in_buffer >> 3)); - } - else memcpy(state->buffer + (state->datasize_in_buffer >> 3), data, 64-(state->datasize_in_buffer >> 3)+1); - state->datasize_in_buffer += databitlen; - databitlen = 0; - } - - if ( (state->datasize_in_buffer > 0 ) && (( state->datasize_in_buffer + databitlen) >= 512) ) { - memcpy( state->buffer + (state->datasize_in_buffer >> 3), data, 64-(state->datasize_in_buffer >> 3) ) ; - index = 64-(state->datasize_in_buffer >> 3); - databitlen = databitlen - (512 - state->datasize_in_buffer); - cn_jh_F8(state); - state->datasize_in_buffer = 0; - } - - for ( ; databitlen >= 512; index = index+64, databitlen = databitlen - 512) { - memcpy(state->buffer, data+index, 64); - cn_jh_F8(state); - } - - if ( databitlen > 0) { - if ((databitlen & 7) == 0) - memcpy(state->buffer, data+index, (databitlen & 0x1ff) >> 3); - else - memcpy(state->buffer, data+index, ((databitlen & 0x1ff) >> 3)+1); - state->datasize_in_buffer = databitlen; - } -} - -/* pad the message, process the padded block(s), truncate the hash value H to obtain the message digest */ -__device__ -void cn_jh_final(jhHashState * __restrict__ state, uint32_t * __restrict__ hashval) -{ - unsigned int i; - //uint32_t *bufptr = (uint32_t *)state->buffer; - - if ( (state->databitlen & 0x1ff) == 0 ) { - /* pad the message when databitlen is multiple of 512 bits, then process the padded block */ - memset(state->buffer, 0, 64); - //for( i = 0; i < 16; i++ ) *(bufptr+i) = 0x00000000; - state->buffer[0] = 0x80; - state->buffer[63] = state->databitlen & 0xff; - state->buffer[62] = (state->databitlen >> 8) & 0xff; - state->buffer[61] = (state->databitlen >> 16) & 0xff; - state->buffer[60] = (state->databitlen >> 24) & 0xff; - state->buffer[59] = (state->databitlen >> 32) & 0xff; - state->buffer[58] = (state->databitlen >> 40) & 0xff; - state->buffer[57] = (state->databitlen >> 48) & 0xff; - state->buffer[56] = (state->databitlen >> 56) & 0xff; - cn_jh_F8(state); - - } else { - - /*set the rest of the bytes in the buffer to 0*/ - if ( (state->datasize_in_buffer & 7) == 0) { - for (i = (state->databitlen & 0x1ff) >> 3; i < 64; i++) state->buffer[i] = 0; - } else { - for (i = ((state->databitlen & 0x1ff) >> 3)+1; i < 64; i++) state->buffer[i] = 0; - } - - /*pad and process the partial block when databitlen is not multiple of 512 bits, then hash the padded blocks*/ - state->buffer[((state->databitlen & 0x1ff) >> 3)] |= 1 << (7- (state->databitlen & 7)); - - cn_jh_F8(state); - memset(state->buffer, 0, 64); - //for( i = 0; i < 16; i++ ) *(bufptr+i) = 0x00000000; - state->buffer[63] = state->databitlen & 0xff; - state->buffer[62] = (state->databitlen >> 8) & 0xff; - state->buffer[61] = (state->databitlen >> 16) & 0xff; - state->buffer[60] = (state->databitlen >> 24) & 0xff; - state->buffer[59] = (state->databitlen >> 32) & 0xff; - state->buffer[58] = (state->databitlen >> 40) & 0xff; - state->buffer[57] = (state->databitlen >> 48) & 0xff; - state->buffer[56] = (state->databitlen >> 56) & 0xff; - cn_jh_F8(state); - } - - MEMCPY4(hashval, ((unsigned char*)state->x) + 64 + 32, 8); -} - -__device__ -void cn_jh_init(jhHashState *state, int hashbitlen) -{ - state->databitlen = 0; - state->datasize_in_buffer = 0; - state->hashbitlen = hashbitlen; - //memcpy(state->x, d_JH256_H0, 128); - MEMCPY8(state->x, d_JH256_H0, 128 / 8); -} - -__device__ -void cn_jh256(const uint8_t * __restrict__ data, DataLength len, uint32_t * __restrict__ hashval) -{ - const int hashbitlen = 256; - DataLength databitlen = len << 3; - jhHashState state; - - cn_jh_init(&state, hashbitlen); - cn_jh_update(&state, data, databitlen); - cn_jh_final(&state, hashval); -} diff --git a/crypto/cn_skein.cuh b/crypto/cn_skein.cuh deleted file mode 100644 index 2096467f..00000000 --- a/crypto/cn_skein.cuh +++ /dev/null @@ -1,325 +0,0 @@ -typedef unsigned int uint_t; /* native unsigned integer */ - -#define SKEIN_MODIFIER_WORDS ( 2) /* number of modifier (tweak) words */ - -#define SKEIN_256_STATE_WORDS ( 4) -#define SKEIN_512_STATE_WORDS ( 8) -#define SKEIN1024_STATE_WORDS (16) - -#define SKEIN_256_STATE_BYTES ( 8*SKEIN_256_STATE_WORDS) -#define SKEIN_512_STATE_BYTES ( 8*SKEIN_512_STATE_WORDS) -#define SKEIN1024_STATE_BYTES ( 8*SKEIN1024_STATE_WORDS) - -#define SKEIN_256_STATE_BITS (64*SKEIN_256_STATE_WORDS) -#define SKEIN_512_STATE_BITS (64*SKEIN_512_STATE_WORDS) -#define SKEIN1024_STATE_BITS (64*SKEIN1024_STATE_WORDS) - -#define SKEIN_256_BLOCK_BYTES ( 8*SKEIN_256_STATE_WORDS) -#define SKEIN_512_BLOCK_BYTES ( 8*SKEIN_512_STATE_WORDS) -#define SKEIN1024_BLOCK_BYTES ( 8*SKEIN1024_STATE_WORDS) - -#define SKEIN_MK_64(hi32,lo32) ((lo32) + (((uint64_t) (hi32)) << 32)) -#define SKEIN_KS_PARITY SKEIN_MK_64(0x1BD11BDA,0xA9FC1A22) - -#define SKEIN_T1_BIT(BIT) ((BIT) - 64) /* offset 64 because it's the second word */ - -#define SKEIN_T1_POS_FIRST SKEIN_T1_BIT(126) /* bits 126 : first block flag */ -#define SKEIN_T1_POS_BIT_PAD SKEIN_T1_BIT(119) /* bit 119 : partial final input byte */ -#define SKEIN_T1_POS_FINAL SKEIN_T1_BIT(127) /* bit 127 : final block flag */ -#define SKEIN_T1_POS_BLK_TYPE SKEIN_T1_BIT(120) /* bits 120..125: type field */ - -#define SKEIN_T1_FLAG_FIRST (((uint64_t) 1 ) << SKEIN_T1_POS_FIRST) -#define SKEIN_T1_FLAG_BIT_PAD (((uint64_t) 1 ) << SKEIN_T1_POS_BIT_PAD) -#define SKEIN_T1_FLAG_FINAL (((uint64_t) 1 ) << SKEIN_T1_POS_FINAL) - -#define SKEIN_BLK_TYPE_MSG (48) /* message processing */ -#define SKEIN_BLK_TYPE_OUT (63) /* output stage */ - -#define SKEIN_T1_BLK_TYPE(T) (((uint64_t) (SKEIN_BLK_TYPE_##T)) << SKEIN_T1_POS_BLK_TYPE) - -#define SKEIN_T1_BLK_TYPE_MSG SKEIN_T1_BLK_TYPE(MSG) /* message processing */ -#define SKEIN_T1_BLK_TYPE_OUT SKEIN_T1_BLK_TYPE(OUT) /* output stage */ - -#define SKEIN_T1_BLK_TYPE_OUT_FINAL (SKEIN_T1_BLK_TYPE_OUT | SKEIN_T1_FLAG_FINAL) - -#define Skein_Set_Tweak(ctxPtr,TWK_NUM,tVal) {(ctxPtr)->h.T[TWK_NUM] = (tVal);} - -#define Skein_Set_T0(ctxPtr,T0) Skein_Set_Tweak(ctxPtr,0,T0) -#define Skein_Set_T1(ctxPtr,T1) Skein_Set_Tweak(ctxPtr,1,T1) - -#define Skein_Set_T0_T1(ctxPtr,T0,T1) { \ - Skein_Set_T0(ctxPtr,(T0)); \ - Skein_Set_T1(ctxPtr,(T1)); } - -#define Skein_Start_New_Type(ctxPtr,BLK_TYPE) \ -{ Skein_Set_T0_T1(ctxPtr,0,SKEIN_T1_FLAG_FIRST | SKEIN_T1_BLK_TYPE_##BLK_TYPE); (ctxPtr)->h.bCnt=0; } - -#define Skein_Set_Bit_Pad_Flag(hdr) { (hdr).T[1] |= SKEIN_T1_FLAG_BIT_PAD; } - -#define KW_TWK_BASE (0) -#define KW_KEY_BASE (3) -#define ks (kw + KW_KEY_BASE) -#define ts (kw + KW_TWK_BASE) - -#define R512(p0,p1,p2,p3,p4,p5,p6,p7,R512ROT,rNum) \ - X##p0 += X##p1; X##p1 = ROTL64(X##p1,R512ROT##_0); X##p1 ^= X##p0; \ - X##p2 += X##p3; X##p3 = ROTL64(X##p3,R512ROT##_1); X##p3 ^= X##p2; \ - X##p4 += X##p5; X##p5 = ROTL64(X##p5,R512ROT##_2); X##p5 ^= X##p4; \ - X##p6 += X##p7; X##p7 = ROTL64(X##p7,R512ROT##_3); X##p7 ^= X##p6; - -#define I512(R) \ - X0 += ks[((R)+1) % 9]; \ - X1 += ks[((R)+2) % 9]; \ - X2 += ks[((R)+3) % 9]; \ - X3 += ks[((R)+4) % 9]; \ - X4 += ks[((R)+5) % 9]; \ - X5 += ks[((R)+6) % 9] + ts[((R)+1) % 3]; \ - X6 += ks[((R)+7) % 9] + ts[((R)+2) % 3]; \ - X7 += ks[((R)+8) % 9] + (R)+1; - - -#define R512_8_rounds(R) \ - R512(0,1,2,3,4,5,6,7,R_512_0,8*(R)+ 1); \ - R512(2,1,4,7,6,5,0,3,R_512_1,8*(R)+ 2); \ - R512(4,1,6,3,0,5,2,7,R_512_2,8*(R)+ 3); \ - R512(6,1,0,7,2,5,4,3,R_512_3,8*(R)+ 4); \ - I512(2*(R)); \ - R512(0,1,2,3,4,5,6,7,R_512_4,8*(R)+ 5); \ - R512(2,1,4,7,6,5,0,3,R_512_5,8*(R)+ 6); \ - R512(4,1,6,3,0,5,2,7,R_512_6,8*(R)+ 7); \ - R512(6,1,0,7,2,5,4,3,R_512_7,8*(R)+ 8); \ - I512(2*(R)+1); - -typedef struct -{ - size_t hashBitLen; - size_t bCnt; - uint64_t T[SKEIN_MODIFIER_WORDS]; -} Skein_Ctxt_Hdr_t; - -typedef struct { - Skein_Ctxt_Hdr_t h; - uint64_t X[SKEIN_256_STATE_WORDS]; - uint8_t b[SKEIN_256_BLOCK_BYTES]; -} Skein_256_Ctxt_t; - -typedef struct { - Skein_Ctxt_Hdr_t h; - uint64_t X[SKEIN_512_STATE_WORDS]; - uint8_t b[SKEIN_512_BLOCK_BYTES]; -} Skein_512_Ctxt_t; - -typedef struct { - uint_t statebits; - union { - Skein_Ctxt_Hdr_t h; - Skein_256_Ctxt_t ctx_256; - Skein_512_Ctxt_t ctx_512; - } u; -} skeinHashState; - -__device__ -void cn_skein256_init(skeinHashState *state, size_t hashBitLen) -{ - const uint64_t SKEIN_512_IV_256[] = - { - SKEIN_MK_64(0xCCD044A1,0x2FDB3E13), - SKEIN_MK_64(0xE8359030,0x1A79A9EB), - SKEIN_MK_64(0x55AEA061,0x4F816E6F), - SKEIN_MK_64(0x2A2767A4,0xAE9B94DB), - SKEIN_MK_64(0xEC06025E,0x74DD7683), - SKEIN_MK_64(0xE7A436CD,0xC4746251), - SKEIN_MK_64(0xC36FBAF9,0x393AD185), - SKEIN_MK_64(0x3EEDBA18,0x33EDFC13) - }; - - Skein_512_Ctxt_t *ctx = &state->u.ctx_512; - - ctx->h.hashBitLen = hashBitLen; - - memcpy(ctx->X, SKEIN_512_IV_256, sizeof(ctx->X)); - - Skein_Start_New_Type(ctx, MSG); -} - -__device__ -void cn_skein_processblock(Skein_512_Ctxt_t * __restrict__ ctx, const uint8_t * __restrict__ blkPtr, size_t blkCnt, size_t byteCntAdd) -{ - enum { - R_512_0_0=46, R_512_0_1=36, R_512_0_2=19, R_512_0_3=37, - R_512_1_0=33, R_512_1_1=27, R_512_1_2=14, R_512_1_3=42, - R_512_2_0=17, R_512_2_1=49, R_512_2_2=36, R_512_2_3=39, - R_512_3_0=44, R_512_3_1= 9, R_512_3_2=54, R_512_3_3=56, - R_512_4_0=39, R_512_4_1=30, R_512_4_2=34, R_512_4_3=24, - R_512_5_0=13, R_512_5_1=50, R_512_5_2=10, R_512_5_3=17, - R_512_6_0=25, R_512_6_1=29, R_512_6_2=39, R_512_6_3=43, - R_512_7_0= 8, R_512_7_1=35, R_512_7_2=56, R_512_7_3=22 - }; - uint64_t X0,X1,X2,X3,X4,X5,X6,X7; - uint64_t w[SKEIN_512_STATE_WORDS]; - uint64_t kw[SKEIN_512_STATE_WORDS+4]; - - ts[0] = ctx->h.T[0]; - ts[1] = ctx->h.T[1]; - - do { - - ts[0] += byteCntAdd; - - ks[0] = ctx->X[0]; - ks[1] = ctx->X[1]; - ks[2] = ctx->X[2]; - ks[3] = ctx->X[3]; - ks[4] = ctx->X[4]; - ks[5] = ctx->X[5]; - ks[6] = ctx->X[6]; - ks[7] = ctx->X[7]; - ks[8] = ks[0] ^ ks[1] ^ ks[2] ^ ks[3] ^ - ks[4] ^ ks[5] ^ ks[6] ^ ks[7] ^ SKEIN_KS_PARITY; - - ts[2] = ts[0] ^ ts[1]; - - memcpy(w, blkPtr, SKEIN_512_STATE_WORDS << 3); - - X0 = w[0] + ks[0]; - X1 = w[1] + ks[1]; - X2 = w[2] + ks[2]; - X3 = w[3] + ks[3]; - X4 = w[4] + ks[4]; - X5 = w[5] + ks[5] + ts[0]; - X6 = w[6] + ks[6] + ts[1]; - X7 = w[7] + ks[7]; - - blkPtr += SKEIN_512_BLOCK_BYTES; - - R512_8_rounds( 0); - R512_8_rounds( 1); - R512_8_rounds( 2); - R512_8_rounds( 3); - R512_8_rounds( 4); - R512_8_rounds( 5); - R512_8_rounds( 6); - R512_8_rounds( 7); - R512_8_rounds( 8); - - ctx->X[0] = X0 ^ w[0]; - ctx->X[1] = X1 ^ w[1]; - ctx->X[2] = X2 ^ w[2]; - ctx->X[3] = X3 ^ w[3]; - ctx->X[4] = X4 ^ w[4]; - ctx->X[5] = X5 ^ w[5]; - ctx->X[6] = X6 ^ w[6]; - ctx->X[7] = X7 ^ w[7]; - - ts[1] &= ~SKEIN_T1_FLAG_FIRST; - } while (--blkCnt); - - ctx->h.T[0] = ts[0]; - ctx->h.T[1] = ts[1]; -} - -__device__ -void cn_skein_block(Skein_512_Ctxt_t * __restrict__ ctx, const uint8_t * __restrict__ msg, size_t msgByteCnt) -{ - size_t n; - - if (msgByteCnt + ctx->h.bCnt > SKEIN_512_BLOCK_BYTES) - { - if (ctx->h.bCnt) { - - n = SKEIN_512_BLOCK_BYTES - ctx->h.bCnt; - - if (n) { - - memcpy(&ctx->b[ctx->h.bCnt],msg,n); - msgByteCnt -= n; - msg += n; - ctx->h.bCnt += n; - } - - cn_skein_processblock(ctx, ctx->b, 1, SKEIN_512_BLOCK_BYTES); - ctx->h.bCnt = 0; - } - - if (msgByteCnt > SKEIN_512_BLOCK_BYTES) { - - n = (msgByteCnt - 1) / SKEIN_512_BLOCK_BYTES; - cn_skein_processblock(ctx, msg, n, SKEIN_512_BLOCK_BYTES); - msgByteCnt -= n * SKEIN_512_BLOCK_BYTES; - msg += n * SKEIN_512_BLOCK_BYTES; - } - } - - if (msgByteCnt) { - - memcpy(&ctx->b[ctx->h.bCnt],msg,msgByteCnt); - ctx->h.bCnt += msgByteCnt; - } -} - -__device__ -void cn_skein256_update(skeinHashState * __restrict__ state, const uint8_t * __restrict__ data, DataLength databitlen) -{ - if ((databitlen & 7) == 0) { - - cn_skein_block(&state->u.ctx_512, data, databitlen >> 3); - } - else { - - size_t bCnt = (databitlen >> 3) + 1; - uint8_t b,mask; - - mask = (uint8_t) (1u << (7 - (databitlen & 7))); - b = (uint8_t) ((data[bCnt-1] & (0-mask)) | mask); - - cn_skein_block(&state->u.ctx_512, data, bCnt - 1); - cn_skein_block(&state->u.ctx_512, &b, 1); - - Skein_Set_Bit_Pad_Flag(state->u.h); - } -} - -__device__ -void cn_skein256_final(skeinHashState * __restrict__ state, uint32_t * __restrict__ hashVal) -{ - uint64_t X[SKEIN_512_STATE_WORDS]; - Skein_512_Ctxt_t *ctx = (Skein_512_Ctxt_t *)&state->u.ctx_512; - const int byteCnt = (ctx->h.hashBitLen + 7) >> 3; - - ctx->h.T[1] |= SKEIN_T1_FLAG_FINAL; - - if (ctx->h.bCnt < SKEIN_512_BLOCK_BYTES) - { - memset(&ctx->b[ctx->h.bCnt], 0, SKEIN_512_BLOCK_BYTES - ctx->h.bCnt); - } - - cn_skein_processblock(ctx, ctx->b, 1, ctx->h.bCnt); - - memset(ctx->b, 0, sizeof(ctx->b)); - memcpy(X, ctx->X, sizeof(X)); - - for (int i = 0; i*SKEIN_512_BLOCK_BYTES < byteCnt; i++) - { - int n = byteCnt - i*SKEIN_512_BLOCK_BYTES; - if (n > SKEIN_512_BLOCK_BYTES) n = SKEIN_512_BLOCK_BYTES; - ((uint64_t *)ctx->b)[0] = (uint64_t)i; - Skein_Start_New_Type(ctx, OUT_FINAL); - cn_skein_processblock(ctx, ctx->b, 1, sizeof(uint64_t)); - memcpy(hashVal + (i*SKEIN_512_BLOCK_BYTES/sizeof(uint32_t)), ctx->X, n); - memcpy(ctx->X, X, sizeof(X)); // restore the counter mode key for next time - } -} - -__device__ -void cn_skein(const uint8_t * __restrict__ data, DataLength len, uint32_t * __restrict__ hashval) -{ - int hashbitlen = 256; - DataLength databitlen = len << 3; - skeinHashState state; - - state.statebits = 64*SKEIN_512_STATE_WORDS; - - cn_skein256_init(&state, hashbitlen); - cn_skein256_update(&state, data, databitlen); - cn_skein256_final(&state, hashval); -} diff --git a/crypto/cryptolight-core.cu b/crypto/cryptolight-core.cu deleted file mode 100644 index 3891768d..00000000 --- a/crypto/cryptolight-core.cu +++ /dev/null @@ -1,281 +0,0 @@ -#include -#include -#include -#include -#include - -#include "cryptolight.h" -#define LONG_SHL_IDX 18 -#define LONG_LOOPS32 0x40000 - -#include "cn_aes.cuh" - -#define MUL_SUM_XOR_DST(a,c,dst) { \ - uint64_t hi, lo = cuda_mul128(((uint64_t *)a)[0], ((uint64_t *)dst)[0], &hi) + ((uint64_t *)c)[1]; \ - hi += ((uint64_t *)c)[0]; \ - ((uint64_t *)c)[0] = ((uint64_t *)dst)[0] ^ hi; \ - ((uint64_t *)c)[1] = ((uint64_t *)dst)[1] ^ lo; \ - ((uint64_t *)dst)[0] = hi; \ - ((uint64_t *)dst)[1] = lo; } - -__device__ __forceinline__ uint64_t cuda_mul128(uint64_t multiplier, uint64_t multiplicand, uint64_t* product_hi) -{ - *product_hi = __umul64hi(multiplier, multiplicand); - return(multiplier * multiplicand); -} - -__global__ -void cryptolight_core_gpu_phase1(int threads, uint32_t * long_state, uint32_t * ctx_state, uint32_t * ctx_key1) -{ - __shared__ uint32_t __align__(16) sharedMemory[1024]; - - cn_aes_gpu_init(sharedMemory); - - const int thread = (blockDim.x * blockIdx.x + threadIdx.x) >> 3; - const int sub = (threadIdx.x & 7) << 2; - - if(thread < threads) - { - const int oft = thread * 52 + sub + 16; // not aligned 16! - const int long_oft = (thread << LONG_SHL_IDX) + sub; - uint32_t __align__(16) key[40]; - uint32_t __align__(16) text[4]; - - // copy 160 bytes - #pragma unroll - for (int i = 0; i < 40; i += 4) - AS_UINT4(&key[i]) = AS_UINT4(ctx_key1 + thread * 40 + i); - - AS_UINT2(&text[0]) = AS_UINT2(&ctx_state[oft]); - AS_UINT2(&text[2]) = AS_UINT2(&ctx_state[oft + 2]); - - __syncthreads(); - for(int i = 0; i < LONG_LOOPS32; i += 32) { - cn_aes_pseudo_round_mut(sharedMemory, text, key); - AS_UINT4(&long_state[long_oft + i]) = AS_UINT4(text); - } - } -} - -__global__ -void cryptolight_core_gpu_phase2(const int threads, const int bfactor, const int partidx, uint32_t * d_long_state, uint32_t * d_ctx_a, uint32_t * d_ctx_b) -{ - __shared__ uint32_t __align__(16) sharedMemory[1024]; - - cn_aes_gpu_init(sharedMemory); - - __syncthreads(); - -#if 0 && __CUDA_ARCH__ >= 300 - - const int thread = (blockDim.x * blockIdx.x + threadIdx.x) >> 2; - const int sub = threadIdx.x & 3; - - if(thread < threads) - { - const int batchsize = ITER >> (2 + bfactor); - const int start = partidx * batchsize; - const int end = start + batchsize; - uint32_t * __restrict__ long_state = &d_long_state[thread << LONG_SHL_IDX]; - uint32_t * __restrict__ ctx_a = d_ctx_a + thread * 4; - uint32_t * __restrict__ ctx_b = d_ctx_b + thread * 4; - uint32_t a, b, c, x[4]; - uint32_t t1[4], t2[4], res; - uint64_t reshi, reslo; - int j; - - a = ctx_a[sub]; - b = ctx_b[sub]; - - #pragma unroll 8 - for(int i = start; i < end; ++i) - { - //j = ((uint32_t *)a)[0] & 0xFFFF0; - j = (__shfl((int)a, 0, 4) & E2I_MASK1) >> 2; - - //cn_aes_single_round(sharedMemory, &long_state[j], c, a); - x[0] = long_state[j + sub]; - x[1] = __shfl((int)x[0], sub + 1, 4); - x[2] = __shfl((int)x[0], sub + 2, 4); - x[3] = __shfl((int)x[0], sub + 3, 4); - c = a ^ - t_fn0(x[0] & 0xff) ^ - t_fn1((x[1] >> 8) & 0xff) ^ - t_fn2((x[2] >> 16) & 0xff) ^ - t_fn3((x[3] >> 24) & 0xff); - - //XOR_BLOCKS_DST(c, b, &long_state[j]); - long_state[j + sub] = c ^ b; - - //MUL_SUM_XOR_DST(c, a, &long_state[((uint32_t *)c)[0] & 0xFFFF0]); - j = (__shfl((int)c, 0, 4) & E2I_MASK1) >> 2; - #pragma unroll - for(int k = 0; k < 2; k++) - t1[k] = __shfl((int)c, k, 4); - #pragma unroll - for(int k = 0; k < 4; k++) - t2[k] = __shfl((int)a, k, 4); - asm( - "mad.lo.u64 %0, %2, %3, %4;\n\t" - "mad.hi.u64 %1, %2, %3, %5;\n\t" - : "=l"(reslo), "=l"(reshi) - : "l"(((uint64_t *)t1)[0]), "l"(((uint64_t *)long_state)[j >> 1]), "l"(((uint64_t *)t2)[1]), "l"(((uint64_t *)t2)[0])); - res = (sub & 2 ? reslo : reshi) >> (sub & 1 ? 32 : 0); - a = long_state[j + sub] ^ res; - long_state[j + sub] = res; - - //j = ((uint32_t *)a)[0] & 0xFFFF0; - j = (__shfl((int)a, 0, 4) & E2I_MASK1) >> 2; - - //cn_aes_single_round(sharedMemory, &long_state[j], b, a); - x[0] = long_state[j + sub]; - x[1] = __shfl((int)x[0], sub + 1, 4); - x[2] = __shfl((int)x[0], sub + 2, 4); - x[3] = __shfl((int)x[0], sub + 3, 4); - b = a ^ - t_fn0(x[0] & 0xff) ^ - t_fn1((x[1] >> 8) & 0xff) ^ - t_fn2((x[2] >> 16) & 0xff) ^ - t_fn3((x[3] >> 24) & 0xff); - - //XOR_BLOCKS_DST(b, c, &long_state[j]); - long_state[j + sub] = c ^ b; - - //MUL_SUM_XOR_DST(b, a, &long_state[((uint32_t *)b)[0] & 0xFFFF0]); - j = (__shfl((int)b, 0, 4) & E2I_MASK1) >> 2; - - #pragma unroll - for(int k = 0; k < 2; k++) - t1[k] = __shfl((int)b, k, 4); - - #pragma unroll - for(int k = 0; k < 4; k++) - t2[k] = __shfl((int)a, k, 4); - asm( - "mad.lo.u64 %0, %2, %3, %4;\n\t" - "mad.hi.u64 %1, %2, %3, %5;\n\t" - : "=l"(reslo), "=l"(reshi) - : "l"(((uint64_t *)t1)[0]), "l"(((uint64_t *)long_state)[j >> 1]), "l"(((uint64_t *)t2)[1]), "l"(((uint64_t *)t2)[0])); - res = (sub & 2 ? reslo : reshi) >> (sub & 1 ? 32 : 0); - a = long_state[j + sub] ^ res; - long_state[j + sub] = res; - } - - if(bfactor > 0) - { - ctx_a[sub] = a; - ctx_b[sub] = b; - } - } - -#else // __CUDA_ARCH__ < 300 - - const int thread = blockDim.x * blockIdx.x + threadIdx.x; - - if (thread < threads) - { - const int batchsize = ITER >> (2 + bfactor); - const int start = partidx * batchsize; - const int end = start + batchsize; - const int longptr = thread << LONG_SHL_IDX; - uint32_t * long_state = &d_long_state[longptr]; - - uint64_t * ctx_a = (uint64_t*)(&d_ctx_a[thread * 4]); - uint64_t * ctx_b = (uint64_t*)(&d_ctx_b[thread * 4]); - uint4 A = AS_UINT4(ctx_a); - uint4 B = AS_UINT4(ctx_b); - uint32_t* a = (uint32_t*)&A; - uint32_t* b = (uint32_t*)&B; - - for (int i = start; i < end; i++) // end = 262144 - { - uint32_t c[4]; - uint32_t j = (a[0] >> 2) & E2I_MASK2; - cn_aes_single_round(sharedMemory, &long_state[j], c, a); - XOR_BLOCKS_DST(c, b, &long_state[j]); - MUL_SUM_XOR_DST(c, a, &long_state[(c[0] >> 2) & E2I_MASK2]); - - j = (a[0] >> 2) & E2I_MASK2; - cn_aes_single_round(sharedMemory, &long_state[j], b, a); - XOR_BLOCKS_DST(b, c, &long_state[j]); - MUL_SUM_XOR_DST(b, a, &long_state[(b[0] >> 2) & E2I_MASK2]); - } - - if (bfactor > 0) { - AS_UINT4(ctx_a) = A; - AS_UINT4(ctx_b) = B; - } - } -#endif // __CUDA_ARCH__ >= 300 -} - -__global__ -void cryptolight_core_gpu_phase3(int threads, const uint32_t * long_state, uint32_t * ctx_state, uint32_t * ctx_key2) -{ - __shared__ uint32_t __align__(16) sharedMemory[1024]; - - cn_aes_gpu_init(sharedMemory); - - const int thread = (blockDim.x * blockIdx.x + threadIdx.x) >> 3; - const int sub = (threadIdx.x & 7) << 2; - - if(thread < threads) - { - const int long_oft = (thread << LONG_SHL_IDX) + sub; - const int oft = thread * 52 + sub + 16; - uint32_t __align__(16) key[40]; - uint32_t __align__(16) text[4]; - - #pragma unroll - for (int i = 0; i < 40; i += 4) - AS_UINT4(&key[i]) = AS_UINT4(ctx_key2 + thread * 40 + i); - - AS_UINT2(&text[0]) = AS_UINT2(&ctx_state[oft + 0]); - AS_UINT2(&text[2]) = AS_UINT2(&ctx_state[oft + 2]); - - __syncthreads(); - for(int i = 0; i < LONG_LOOPS32; i += 32) - { - #pragma unroll - for(int j = 0; j < 4; j++) - text[j] ^= long_state[long_oft + i + j]; - - cn_aes_pseudo_round_mut(sharedMemory, text, key); - } - - AS_UINT2(&ctx_state[oft + 0]) = AS_UINT2(&text[0]); - AS_UINT2(&ctx_state[oft + 2]) = AS_UINT2(&text[2]); - } -} - -extern int device_bfactor[MAX_GPUS]; - -__host__ -void cryptolight_core_cpu_hash(int thr_id, int blocks, int threads, uint32_t *d_long_state, uint64_t *d_ctx_state, - uint32_t *d_ctx_a, uint32_t *d_ctx_b, uint32_t *d_ctx_key1, uint32_t *d_ctx_key2) -{ - dim3 grid(blocks); - dim3 block(threads); - dim3 block4(threads << 2); - dim3 block8(threads << 3); - - const int bfactor = device_bfactor[thr_id]; - const int bsleep = bfactor ? 100 : 0; - - int i, partcount = 1 << bfactor; - int dev_id = device_map[thr_id]; - - cryptolight_core_gpu_phase1 <<>>(blocks*threads, d_long_state, (uint32_t*)d_ctx_state, d_ctx_key1); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); - if(partcount > 1) usleep(bsleep); - - for(i = 0; i < partcount; i++) - { - cryptolight_core_gpu_phase2 <<= 300 ? block4 : block)>>>(blocks*threads, bfactor, i, d_long_state, d_ctx_a, d_ctx_b); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); - if(partcount > 1) usleep(bsleep); - } - - cryptolight_core_gpu_phase3 <<>>(blocks*threads, d_long_state, (uint32_t*)d_ctx_state, d_ctx_key2); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); -} diff --git a/crypto/cryptolight-cpu.cpp b/crypto/cryptolight-cpu.cpp deleted file mode 100644 index b0ee386c..00000000 --- a/crypto/cryptolight-cpu.cpp +++ /dev/null @@ -1,229 +0,0 @@ -#include -#include - -#include "oaes_lib.h" -#include "cryptolight.h" - -extern "C" { -#include -#include -#include -#include -#include "cpu/c_keccak.h" -} - -struct cryptonight_ctx { - uint8_t long_state[MEMORY]; - union cn_slow_hash_state state; - uint8_t text[INIT_SIZE_BYTE]; - uint8_t a[AES_BLOCK_SIZE]; - uint8_t b[AES_BLOCK_SIZE]; - uint8_t c[AES_BLOCK_SIZE]; - oaes_ctx* aes_ctx; -}; - -static void do_blake_hash(const void* input, int len, void* output) -{ - uchar hash[32]; - sph_blake256_context ctx; - sph_blake256_set_rounds(14); - sph_blake256_init(&ctx); - sph_blake256(&ctx, input, len); - sph_blake256_close(&ctx, hash); - memcpy(output, hash, 32); -} - -static void do_groestl_hash(const void* input, int len, void* output) -{ - uchar hash[32]; - sph_groestl256_context ctx; - sph_groestl256_init(&ctx); - sph_groestl256(&ctx, input, len); - sph_groestl256_close(&ctx, hash); - memcpy(output, hash, 32); -} - -static void do_jh_hash(const void* input, int len, void* output) -{ - uchar hash[64]; - sph_jh256_context ctx; - sph_jh256_init(&ctx); - sph_jh256(&ctx, input, len); - sph_jh256_close(&ctx, hash); - memcpy(output, hash, 32); -} - -static void do_skein_hash(const void* input, int len, void* output) -{ - uchar hash[32]; - sph_skein256_context ctx; - sph_skein256_init(&ctx); - sph_skein256(&ctx, input, len); - sph_skein256_close(&ctx, hash); - memcpy(output, hash, 32); -} - -// todo: use sph if possible -static void keccak_hash_permutation(union hash_state *state) { - keccakf((uint64_t*)state, 24); -} - -static void keccak_hash_process(union hash_state *state, const uint8_t *buf, int count) { - keccak1600(buf, (int)count, (uint8_t*)state); -} - -extern "C" int fast_aesb_single_round(const uint8_t *in, uint8_t*out, const uint8_t *expandedKey); -extern "C" int aesb_single_round(const uint8_t *in, uint8_t*out, const uint8_t *expandedKey); -extern "C" int aesb_pseudo_round_mut(uint8_t *val, uint8_t *expandedKey); -extern "C" int fast_aesb_pseudo_round_mut(uint8_t *val, uint8_t *expandedKey); - -static void (* const extra_hashes[4])(const void*, int, void *) = { - do_blake_hash, do_groestl_hash, do_jh_hash, do_skein_hash -}; - -static uint64_t mul128(uint64_t multiplier, uint64_t multiplicand, uint64_t* product_hi) -{ - // multiplier = ab = a * 2^32 + b - // multiplicand = cd = c * 2^32 + d - // ab * cd = a * c * 2^64 + (a * d + b * c) * 2^32 + b * d - uint64_t a = hi_dword(multiplier); - uint64_t b = lo_dword(multiplier); - uint64_t c = hi_dword(multiplicand); - uint64_t d = lo_dword(multiplicand); - - uint64_t ac = a * c; - uint64_t ad = a * d; - uint64_t bc = b * c; - uint64_t bd = b * d; - - uint64_t adbc = ad + bc; - uint64_t adbc_carry = adbc < ad ? 1 : 0; - - // multiplier * multiplicand = product_hi * 2^64 + product_lo - uint64_t product_lo = bd + (adbc << 32); - uint64_t product_lo_carry = product_lo < bd ? 1 : 0; - *product_hi = ac + (adbc >> 32) + (adbc_carry << 32) + product_lo_carry; - - return product_lo; -} - -static size_t e2i(const uint8_t* a) { - //const uint32_t mask = (MEMORY / AES_BLOCK_SIZE - 1); - //return (*((uint64_t*) a) / AES_BLOCK_SIZE) & mask; - return *((uint64_t*) a) & 0xFFFF0; /* mask * AES_BLOCK_SIZE */ -} - -static void mul(const uint8_t* a, const uint8_t* b, uint8_t* res) { - ((uint64_t*) res)[1] = mul128(((uint64_t*) a)[0], ((uint64_t*) b)[0], (uint64_t*) res); -} - -static void sum_half_blocks(uint8_t* a, const uint8_t* b) { - ((uint64_t*) a)[0] += ((uint64_t*) b)[0]; - ((uint64_t*) a)[1] += ((uint64_t*) b)[1]; -} - -static void sum_half_blocks_dst(const uint8_t* a, const uint8_t* b, uint8_t* dst) { - ((uint64_t*) dst)[0] = ((uint64_t*) a)[0] + ((uint64_t*) b)[0]; - ((uint64_t*) dst)[1] = ((uint64_t*) a)[1] + ((uint64_t*) b)[1]; -} - -static void mul_sum_dst(const uint8_t* a, const uint8_t* b, const uint8_t* c, uint8_t* dst) { - ((uint64_t*) dst)[1] = mul128(((uint64_t*) a)[0], ((uint64_t*) b)[0], (uint64_t*) dst) + ((uint64_t*) c)[1]; - ((uint64_t*) dst)[0] += ((uint64_t*) c)[0]; -} - -static void mul_sum_xor_dst(const uint8_t* a, uint8_t* c, uint8_t* dst) { - uint64_t hi, lo = mul128(((uint64_t*) a)[0], ((uint64_t*) dst)[0], &hi) + ((uint64_t*) c)[1]; - hi += ((uint64_t*) c)[0]; - - ((uint64_t*) c)[0] = ((uint64_t*) dst)[0] ^ hi; - ((uint64_t*) c)[1] = ((uint64_t*) dst)[1] ^ lo; - ((uint64_t*) dst)[0] = hi; - ((uint64_t*) dst)[1] = lo; -} - -static void copy_block(uint8_t* dst, const uint8_t* src) { - ((uint64_t*) dst)[0] = ((uint64_t*) src)[0]; - ((uint64_t*) dst)[1] = ((uint64_t*) src)[1]; -} - -static void xor_blocks(uint8_t* a, const uint8_t* b) { - ((uint64_t*) a)[0] ^= ((uint64_t*) b)[0]; - ((uint64_t*) a)[1] ^= ((uint64_t*) b)[1]; -} - -static void xor_blocks_dst(const uint8_t* a, const uint8_t* b, uint8_t* dst) { - ((uint64_t*) dst)[0] = ((uint64_t*) a)[0] ^ ((uint64_t*) b)[0]; - ((uint64_t*) dst)[1] = ((uint64_t*) a)[1] ^ ((uint64_t*) b)[1]; -} - -static void cryptolight_hash_ctx(void* output, const void* input, const int len, struct cryptonight_ctx* ctx) -{ - size_t i, j; - keccak_hash_process(&ctx->state.hs, (const uint8_t*) input, len); - ctx->aes_ctx = (oaes_ctx*) oaes_alloc(); - memcpy(ctx->text, ctx->state.init, INIT_SIZE_BYTE); - - oaes_key_import_data(ctx->aes_ctx, ctx->state.hs.b, AES_KEY_SIZE); - for (i = 0; likely(i < MEMORY); i += INIT_SIZE_BYTE) { -#undef RND -#define RND(p) aesb_pseudo_round_mut(&ctx->text[AES_BLOCK_SIZE * p], ctx->aes_ctx->key->exp_data); - RND(0); - RND(1); - RND(2); - RND(3); - RND(4); - RND(5); - RND(6); - RND(7); - memcpy(&ctx->long_state[i], ctx->text, INIT_SIZE_BYTE); - } - - xor_blocks_dst(&ctx->state.k[0], &ctx->state.k[32], ctx->a); - xor_blocks_dst(&ctx->state.k[16], &ctx->state.k[48], ctx->b); - - for (i = 0; likely(i < ITER / 4); ++i) { - j = e2i(ctx->a); - aesb_single_round(&ctx->long_state[j], ctx->c, ctx->a); - xor_blocks_dst(ctx->c, ctx->b, &ctx->long_state[j]); - - mul_sum_xor_dst(ctx->c, ctx->a, &ctx->long_state[e2i(ctx->c)]); - - j = e2i(ctx->a); - aesb_single_round(&ctx->long_state[j], ctx->b, ctx->a); - xor_blocks_dst(ctx->b, ctx->c, &ctx->long_state[j]); - - mul_sum_xor_dst(ctx->b, ctx->a, &ctx->long_state[e2i(ctx->b)]); - } - - memcpy(ctx->text, ctx->state.init, INIT_SIZE_BYTE); - oaes_key_import_data(ctx->aes_ctx, &ctx->state.hs.b[32], AES_KEY_SIZE); - for (i = 0; likely(i < MEMORY); i += INIT_SIZE_BYTE) { -#undef RND -#define RND(p) xor_blocks(&ctx->text[p * AES_BLOCK_SIZE], &ctx->long_state[i + p * AES_BLOCK_SIZE]); \ - aesb_pseudo_round_mut(&ctx->text[p * AES_BLOCK_SIZE], ctx->aes_ctx->key->exp_data); - RND(0); - RND(1); - RND(2); - RND(3); - RND(4); - RND(5); - RND(6); - RND(7); - } - memcpy(ctx->state.init, ctx->text, INIT_SIZE_BYTE); - keccak_hash_permutation(&ctx->state.hs); - - int extra_algo = ctx->state.hs.b[0] & 3; - extra_hashes[extra_algo](&ctx->state, 200, output); - if (opt_debug) applog(LOG_DEBUG, "extra algo=%d", extra_algo); - - oaes_free((OAES_CTX **) &ctx->aes_ctx); -} - -void cryptolight_hash(void* output, const void* input, int len) -{ - struct cryptonight_ctx *ctx = (struct cryptonight_ctx*)malloc(sizeof(struct cryptonight_ctx)); - cryptolight_hash_ctx(output, input, len, ctx); - free(ctx); -} diff --git a/crypto/cryptolight.cu b/crypto/cryptolight.cu deleted file mode 100644 index c8ab8ea4..00000000 --- a/crypto/cryptolight.cu +++ /dev/null @@ -1,168 +0,0 @@ - -#include "cryptolight.h" - -extern char *device_config[MAX_GPUS]; // -l 32x16 - -static __thread uint32_t cn_blocks = 32; -static __thread uint32_t cn_threads = 16; - -static uint32_t *d_long_state[MAX_GPUS]; -static uint64_t *d_ctx_state[MAX_GPUS]; -static uint32_t *d_ctx_key1[MAX_GPUS]; -static uint32_t *d_ctx_key2[MAX_GPUS]; -static uint32_t *d_ctx_text[MAX_GPUS]; -static uint32_t *d_ctx_a[MAX_GPUS]; -static uint32_t *d_ctx_b[MAX_GPUS]; - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_cryptolight(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - int res = 0; - uint32_t throughput = 0; - - uint32_t *ptarget = work->target; - uint8_t *pdata = (uint8_t*) work->data; - uint32_t *nonceptr = (uint32_t*) (&pdata[39]); - const uint32_t first_nonce = *nonceptr; - uint32_t nonce = first_nonce; - - if(opt_benchmark) { - ptarget[7] = 0x00ff; - } - - if(!init[thr_id]) - { - if (device_config[thr_id]) { - sscanf(device_config[thr_id], "%ux%u", &cn_blocks, &cn_threads); - throughput = cuda_default_throughput(thr_id, cn_blocks*cn_threads); - gpulog(LOG_INFO, thr_id, "Using %u x %u kernel launch config, %u threads", - cn_blocks, cn_threads, throughput); - } else { - throughput = cuda_default_throughput(thr_id, cn_blocks*cn_threads); - if (throughput != cn_blocks*cn_threads && cn_threads) { - cn_blocks = throughput / cn_threads; - throughput = cn_threads * cn_blocks; - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u threads (%ux%u)", - throughput2intensity(throughput), throughput, cn_blocks, cn_threads); - } - - if(sizeof(size_t) == 4 && throughput > UINT32_MAX / MEMORY) { - gpulog(LOG_ERR, thr_id, "THE 32bit VERSION CAN'T ALLOCATE MORE THAN 4GB OF MEMORY!"); - gpulog(LOG_ERR, thr_id, "PLEASE REDUCE THE NUMBER OF THREADS OR BLOCKS"); - exit(1); - } - - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - cudaDeviceSetCacheConfig(cudaFuncCachePreferL1); - CUDA_LOG_ERROR(); - } - - const size_t alloc = MEMORY * throughput; - cryptonight_extra_cpu_init(thr_id, throughput); - - cudaMalloc(&d_long_state[thr_id], alloc); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); - cudaMalloc(&d_ctx_state[thr_id], 26 * sizeof(uint64_t) * throughput); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); - cudaMalloc(&d_ctx_key1[thr_id], 40 * sizeof(uint32_t) * throughput); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); - cudaMalloc(&d_ctx_key2[thr_id], 40 * sizeof(uint32_t) * throughput); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); - cudaMalloc(&d_ctx_text[thr_id], 32 * sizeof(uint32_t) * throughput); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); - cudaMalloc(&d_ctx_a[thr_id], 4 * sizeof(uint32_t) * throughput); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); - cudaMalloc(&d_ctx_b[thr_id], 4 * sizeof(uint32_t) * throughput); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); - - init[thr_id] = true; - } - - throughput = cn_blocks*cn_threads; - - do - { - const uint32_t Htarg = ptarget[7]; - uint32_t resNonces[2] = { UINT32_MAX, UINT32_MAX }; - - cryptonight_extra_cpu_setData(thr_id, pdata, ptarget); - cryptonight_extra_cpu_prepare(thr_id, throughput, nonce, d_ctx_state[thr_id], d_ctx_a[thr_id], d_ctx_b[thr_id], d_ctx_key1[thr_id], d_ctx_key2[thr_id]); - cryptolight_core_cpu_hash(thr_id, cn_blocks, cn_threads, d_long_state[thr_id], d_ctx_state[thr_id], d_ctx_a[thr_id], d_ctx_b[thr_id], d_ctx_key1[thr_id], d_ctx_key2[thr_id]); - cryptonight_extra_cpu_final(thr_id, throughput, nonce, resNonces, d_ctx_state[thr_id]); - - *hashes_done = nonce - first_nonce + throughput; - - if(resNonces[0] != UINT32_MAX) - { - uint32_t vhash[8]; - uint32_t tempdata[19]; - uint32_t *tempnonceptr = (uint32_t*)(((char*)tempdata) + 39); - memcpy(tempdata, pdata, 76); - *tempnonceptr = resNonces[0]; - cryptolight_hash(vhash, tempdata, 76); - if(vhash[7] <= Htarg && fulltest(vhash, ptarget)) - { - res = 1; - work->nonces[0] = resNonces[0]; - work_set_target_ratio(work, vhash); - // second nonce - if(resNonces[1] != UINT32_MAX) - { - *tempnonceptr = resNonces[1]; - cryptolight_hash(vhash, tempdata, 76); - if(vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - res++; - work->nonces[1] = resNonces[1]; - } else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - } - } - goto done; - } else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for nonce %08x does not validate on CPU!", resNonces[0]); - } - } - - if ((uint64_t) throughput + nonce >= max_nonce - 127) { - nonce = max_nonce; - break; - } - - nonce += throughput; - gpulog(LOG_DEBUG, thr_id, "nonce %08x", nonce); - - } while (!work_restart[thr_id].restart && max_nonce > (uint64_t)throughput + nonce); - -done: - gpulog(LOG_DEBUG, thr_id, "nonce %08x exit", nonce); - work->valid_nonces = res; - *nonceptr = nonce; - return res; -} - -void free_cryptolight(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaFree(d_long_state[thr_id]); - cudaFree(d_ctx_state[thr_id]); - cudaFree(d_ctx_key1[thr_id]); - cudaFree(d_ctx_key2[thr_id]); - cudaFree(d_ctx_text[thr_id]); - cudaFree(d_ctx_a[thr_id]); - cudaFree(d_ctx_b[thr_id]); - - cryptonight_extra_cpu_free(thr_id); - - cudaDeviceSynchronize(); - - init[thr_id] = false; -} diff --git a/crypto/cryptolight.h b/crypto/cryptolight.h deleted file mode 100644 index 443cf5b3..00000000 --- a/crypto/cryptolight.h +++ /dev/null @@ -1,143 +0,0 @@ -#pragma once -#include -#include - -#ifdef __INTELLISENSE__ -/* avoid red underlining */ -#define __CUDA_ARCH__ 520 -struct uint3 { - unsigned int x, y, z; -}; -struct uint3 threadIdx; -struct uint3 blockIdx; -struct uint3 blockDim; -#define atomicExch(p,y) (*p) = y -#define __funnelshift_r(a,b,c) 1 -#define __syncthreads() -#define __threadfence_block() -#define asm(x) -#define __shfl(a,b,c) 1 -#define __umul64hi(a,b) a*b -#endif - -#define MEMORY (1UL << 20) /* 1 MiB - 1048576 */ -#define ITER (1UL << 19) /* 512k */ -#define E2I_MASK1 0xFFFF0 /* MEMORY / AES_BLOCK_SIZE - 1 = 0xFFFF */ -#define E2I_MASK2 0x3FFFC /* 0xFFFF0 >> 2 */ - -#define AES_BLOCK_SIZE 16 -#define AES_KEY_SIZE 32 -#define INIT_SIZE_BLK 8 -#define INIT_SIZE_BYTE (INIT_SIZE_BLK * AES_BLOCK_SIZE) // 128 B - -#define AES_RKEY_LEN 4 -#define AES_COL_LEN 4 -#define AES_ROUND_BASE 7 - -#ifndef HASH_SIZE -#define HASH_SIZE 32 -#endif - -#ifndef HASH_DATA_AREA -#define HASH_DATA_AREA 136 -#endif - -#define hi_dword(x) (x >> 32) -#define lo_dword(x) (x & 0xFFFFFFFF) - -#define C32(x) ((uint32_t)(x ## U)) -#define T32(x) ((x) & C32(0xFFFFFFFF)) - -#ifndef ROTL64 - #if __CUDA_ARCH__ >= 350 - __forceinline__ __device__ uint64_t cuda_ROTL64(const uint64_t value, const int offset) { - uint2 result; - if(offset >= 32) { - asm("shf.l.wrap.b32 %0, %1, %2, %3;" : "=r"(result.x) : "r"(__double2loint(__longlong_as_double(value))), "r"(__double2hiint(__longlong_as_double(value))), "r"(offset)); - asm("shf.l.wrap.b32 %0, %1, %2, %3;" : "=r"(result.y) : "r"(__double2hiint(__longlong_as_double(value))), "r"(__double2loint(__longlong_as_double(value))), "r"(offset)); - } else { - asm("shf.l.wrap.b32 %0, %1, %2, %3;" : "=r"(result.x) : "r"(__double2hiint(__longlong_as_double(value))), "r"(__double2loint(__longlong_as_double(value))), "r"(offset)); - asm("shf.l.wrap.b32 %0, %1, %2, %3;" : "=r"(result.y) : "r"(__double2loint(__longlong_as_double(value))), "r"(__double2hiint(__longlong_as_double(value))), "r"(offset)); - } - return __double_as_longlong(__hiloint2double(result.y, result.x)); - } - #define ROTL64(x, n) (cuda_ROTL64(x, n)) - #else - #define ROTL64(x, n) (((x) << (n)) | ((x) >> (64 - (n)))) - #endif -#endif - -#ifndef ROTL32 - #if __CUDA_ARCH__ < 350 - #define ROTL32(x, n) T32(((x) << (n)) | ((x) >> (32 - (n)))) - #else - #define ROTL32(x, n) __funnelshift_l( (x), (x), (n) ) - #endif -#endif - -#ifndef ROTR32 - #if __CUDA_ARCH__ < 350 - #define ROTR32(x, n) (((x) >> (n)) | ((x) << (32 - (n)))) - #else - #define ROTR32(x, n) __funnelshift_r( (x), (x), (n) ) - #endif -#endif - -#define MEMSET8(dst,what,cnt) { \ - int i_memset8; \ - uint64_t *out_memset8 = (uint64_t *)(dst); \ - for( i_memset8 = 0; i_memset8 < cnt; i_memset8++ ) \ - out_memset8[i_memset8] = (what); } - -#define MEMSET4(dst,what,cnt) { \ - int i_memset4; \ - uint32_t *out_memset4 = (uint32_t *)(dst); \ - for( i_memset4 = 0; i_memset4 < cnt; i_memset4++ ) \ - out_memset4[i_memset4] = (what); } - -#define MEMCPY8(dst,src,cnt) { \ - int i_memcpy8; \ - uint64_t *in_memcpy8 = (uint64_t *)(src); \ - uint64_t *out_memcpy8 = (uint64_t *)(dst); \ - for( i_memcpy8 = 0; i_memcpy8 < cnt; i_memcpy8++ ) \ - out_memcpy8[i_memcpy8] = in_memcpy8[i_memcpy8]; } - -#define MEMCPY4(dst,src,cnt) { \ - int i_memcpy4; \ - uint32_t *in_memcpy4 = (uint32_t *)(src); \ - uint32_t *out_memcpy4 = (uint32_t *)(dst); \ - for( i_memcpy4 = 0; i_memcpy4 < cnt; i_memcpy4++ ) \ - out_memcpy4[i_memcpy4] = in_memcpy4[i_memcpy4]; } - -#define XOR_BLOCKS_DST(x,y,z) { \ - ((uint64_t *)z)[0] = ((uint64_t *)(x))[0] ^ ((uint64_t *)(y))[0]; \ - ((uint64_t *)z)[1] = ((uint64_t *)(x))[1] ^ ((uint64_t *)(y))[1]; } - -union hash_state { - uint8_t b[200]; - uint64_t w[25]; -}; - -union cn_slow_hash_state { - union hash_state hs; - struct { - uint8_t k[64]; - uint8_t init[INIT_SIZE_BYTE]; - }; -}; - -static inline void exit_if_cudaerror(int thr_id, const char *src, int line) -{ - cudaError_t err = cudaGetLastError(); - if(err != cudaSuccess) { - gpulog(LOG_ERR, thr_id, "%s %s line %d", cudaGetErrorString(err), src, line); - exit(1); - } -} -void cryptolight_core_cpu_hash(int thr_id, int blocks, int threads, uint32_t *d_long_state, uint64_t *d_ctx_state, uint32_t *d_ctx_a, uint32_t *d_ctx_b, uint32_t *d_ctx_key1, uint32_t *d_ctx_key2); - -void cryptonight_extra_cpu_setData(int thr_id, const void *data, const void *pTargetIn); -void cryptonight_extra_cpu_init(int thr_id, uint32_t threads); -void cryptonight_extra_cpu_free(int thr_id); -void cryptonight_extra_cpu_prepare(int thr_id, uint32_t threads, uint32_t startNonce, uint64_t *d_ctx_state, uint32_t *d_ctx_a, uint32_t *d_ctx_b, uint32_t *d_ctx_key1, uint32_t *d_ctx_key2); -void cryptonight_extra_cpu_final(int thr_id, uint32_t threads, uint32_t startNonce, uint32_t *nonce, uint64_t *d_ctx_state); diff --git a/crypto/cryptonight-core.cu b/crypto/cryptonight-core.cu deleted file mode 100644 index 4780f375..00000000 --- a/crypto/cryptonight-core.cu +++ /dev/null @@ -1,186 +0,0 @@ -#include -#include -#include -#include -#include - -#include "cryptonight.h" - -#define LONG_SHL32 19 // 1<<19 -#define LONG_SHL64 18 // 1<<18 (uint64_t* index) -#define LONG_LOOPS32 0x80000U -#define LONG_LOOPS64 0x40000U - -#include "cn_aes.cuh" - -__global__ -//__launch_bounds__(128, 9) // 56 registers -void cryptonight_core_gpu_phase1(const uint32_t threads, uint64_t * long_state, uint64_t * const ctx_state, uint32_t * ctx_key1) -{ - __shared__ __align__(16) uint32_t sharedMemory[1024]; - cn_aes_gpu_init(sharedMemory); - __syncthreads(); - - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x) >> 3; - const uint32_t sub = (threadIdx.x & 7) << 1; // 0 2 .. 14 - - if(thread < threads) - { - const uint32_t long_oft = (thread << LONG_SHL64) + sub; - - const uint32_t* ctx_key = &ctx_key1[thread * 40U]; - uint4 keys[10]; - #pragma unroll 10 // load 160 bytes - for (int i = 0; i < 10; i ++) - keys[i] = AS_UINT4(&ctx_key[i*4]); - - uint4 text = AS_UINT4(&ctx_state[thread * 26U + sub + 8U]); - - for (uint32_t i = 0; i < LONG_LOOPS64; i += 16U) { - cn_aes_pseudo_round_mut_uint4(sharedMemory, text, keys); - AS_UINT4(&long_state[long_oft + i]) = text; - } - } -} - -__device__ __forceinline__ ulonglong2 cuda_mul128(const uint64_t multiplier, const uint64_t multiplicand) -{ - ulonglong2 product; - product.x = __umul64hi(multiplier, multiplicand); - product.y = multiplier * multiplicand; - return product; -} - -static __forceinline__ __device__ void operator += (ulonglong2 &a, const ulonglong2 b) { - a.x += b.x; a.y += b.y; -} - -static __forceinline__ __device__ ulonglong2 operator ^ (const ulonglong2 &a, const ulonglong2 &b) { - return make_ulonglong2(a.x ^ b.x, a.y ^ b.y); -} - -#undef MUL_SUM_XOR_DST -__device__ __forceinline__ void MUL_SUM_XOR_DST(const uint64_t m, uint4 &a, void* far_dst) -{ - ulonglong2 d = AS_UL2(far_dst); - ulonglong2 p = cuda_mul128(m, d.x); - p += AS_UL2(&a); - AS_UL2(&a) = p ^ d; - AS_UL2(far_dst) = p; -} - -__global__ -#if __CUDA_ARCH__ >= 500 -//__launch_bounds__(128,12) /* force 40 regs to allow -l ...x32 */ -#endif -void cryptonight_core_gpu_phase2(const uint32_t threads, const uint32_t bfactor, const uint32_t partidx, - uint64_t * d_long_state, uint32_t * d_ctx_a, uint32_t * d_ctx_b) -{ - __shared__ __align__(16) uint32_t sharedMemory[1024]; - cn_aes_gpu_init(sharedMemory); - __syncthreads(); - - const uint32_t thread = blockDim.x * blockIdx.x + threadIdx.x; - - if (thread < threads) - { - const uint32_t batchsize = ITER >> (2U + bfactor); - const uint32_t start = partidx * batchsize; - const uint32_t end = start + batchsize; - - void * ctx_a = (void*)(&d_ctx_a[thread << 2U]); - void * ctx_b = (void*)(&d_ctx_b[thread << 2U]); - uint4 A = AS_UINT4(ctx_a); // ld.global.u32.v4 - uint4 B = AS_UINT4(ctx_b); - - uint64_t * long_state = &d_long_state[thread << LONG_SHL64]; - for (int i = start; i < end; i++) // end = 262144 - { - uint4 C; - - uint32_t j = (A.x & E2I_MASK) >> 3; - cn_aes_single_round_b((uint8_t*)sharedMemory, &long_state[j], A, &C); - AS_UINT4(&long_state[j]) = C ^ B; // st.global.u32.v4 - MUL_SUM_XOR_DST((AS_UL2(&C)).x, A, &long_state[(C.x & E2I_MASK) >> 3]); - - j = (A.x & E2I_MASK) >> 3; - cn_aes_single_round_b((uint8_t*)sharedMemory, &long_state[j], A, &B); - AS_UINT4(&long_state[j]) = C ^ B; - MUL_SUM_XOR_DST((AS_UL2(&B)).x, A, &long_state[(B.x & E2I_MASK) >> 3]); - } - - if (bfactor) { - AS_UINT4(ctx_a) = A; - AS_UINT4(ctx_b) = B; - } - } -} - -__global__ -void cryptonight_core_gpu_phase3(const uint32_t threads, const uint64_t * long_state, uint64_t * ctx_state, uint32_t * __restrict__ ctx_key2) -{ - __shared__ __align__(16) uint32_t sharedMemory[1024]; - cn_aes_gpu_init(sharedMemory); - __syncthreads(); - - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x) >> 3U; - const uint32_t sub = (threadIdx.x & 7U) << 1U; - - if(thread < threads) - { - const uint32_t long_oft = (thread << LONG_SHL64) + sub; - const uint32_t st_oft = (thread * 26U) + sub + 8U; - - uint4 key[10]; - const uint32_t* ctx_key = &ctx_key2[thread * 40U]; - #pragma unroll 10 // 160 bytes - for (int i = 0; i < 10; i++) - key[i] = AS_UINT4(&ctx_key[i*4U]); - - uint4 text = AS_UINT4(&ctx_state[st_oft]); - - for(uint32_t i = 0; i < LONG_LOOPS64; i += 16U) - { - uint4 st = AS_UINT4(&long_state[long_oft + i]); - text = text ^ st; - cn_aes_pseudo_round_mut_uint4(sharedMemory, text, key); - } - - AS_UINT4(&ctx_state[st_oft]) = text; - } -} - -extern int device_bfactor[MAX_GPUS]; - -__host__ -void cryptonight_core_cuda(int thr_id, int blocks, int threads, uint64_t *d_long_state, uint64_t *d_ctx_state, - uint32_t *d_ctx_a, uint32_t *d_ctx_b, uint32_t *d_ctx_key1, uint32_t *d_ctx_key2) -{ - dim3 grid(blocks); - dim3 block(threads); - //dim3 block2(threads << 1); - dim3 block4(threads << 2); - dim3 block8(threads << 3); - - const uint32_t bfactor = (uint32_t) device_bfactor[thr_id]; - const uint32_t partcount = 1 << bfactor; - const uint32_t throughput = (uint32_t) (blocks*threads); - - const int bsleep = bfactor ? 100 : 0; - const int dev_id = device_map[thr_id]; - - cryptonight_core_gpu_phase1 <<>> (throughput, d_long_state, d_ctx_state, d_ctx_key1); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); - if(partcount > 1) usleep(bsleep); - - for (uint32_t i = 0; i < partcount; i++) - { - dim3 b = device_sm[dev_id] >= 300 ? block4 : block; - cryptonight_core_gpu_phase2 <<>> (throughput, bfactor, i, d_long_state, d_ctx_a, d_ctx_b); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); - if(partcount > 1) usleep(bsleep); - } - - cryptonight_core_gpu_phase3 <<>> (throughput, d_long_state, d_ctx_state, d_ctx_key2); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); -} diff --git a/crypto/cryptonight-cpu.cpp b/crypto/cryptonight-cpu.cpp deleted file mode 100644 index 66b3cf47..00000000 --- a/crypto/cryptonight-cpu.cpp +++ /dev/null @@ -1,227 +0,0 @@ -#include -#include - -#include "oaes_lib.h" -#include "cryptonight.h" - -extern "C" { -#include -#include -#include -#include -#include "cpu/c_keccak.h" -} - -struct cryptonight_ctx { - uint8_t long_state[MEMORY]; - union cn_slow_hash_state state; - uint8_t text[INIT_SIZE_BYTE]; - uint8_t a[AES_BLOCK_SIZE]; - uint8_t b[AES_BLOCK_SIZE]; - uint8_t c[AES_BLOCK_SIZE]; - oaes_ctx* aes_ctx; -}; - -static void do_blake_hash(const void* input, size_t len, void* output) -{ - uchar hash[32]; - sph_blake256_context ctx; - sph_blake256_set_rounds(14); - sph_blake256_init(&ctx); - sph_blake256(&ctx, input, len); - sph_blake256_close(&ctx, hash); - memcpy(output, hash, 32); -} - -static void do_groestl_hash(const void* input, size_t len, void* output) -{ - uchar hash[32]; - sph_groestl256_context ctx; - sph_groestl256_init(&ctx); - sph_groestl256(&ctx, input, len); - sph_groestl256_close(&ctx, hash); - memcpy(output, hash, 32); -} - -static void do_jh_hash(const void* input, size_t len, void* output) -{ - uchar hash[64]; - sph_jh256_context ctx; - sph_jh256_init(&ctx); - sph_jh256(&ctx, input, len); - sph_jh256_close(&ctx, hash); - memcpy(output, hash, 32); -} - -static void do_skein_hash(const void* input, size_t len, void* output) -{ - uchar hash[32]; - sph_skein256_context ctx; - sph_skein256_init(&ctx); - sph_skein256(&ctx, input, len); - sph_skein256_close(&ctx, hash); - memcpy(output, hash, 32); -} - -// todo: use sph if possible -static void keccak_hash_permutation(union hash_state *state) { - keccakf((uint64_t*)state, 24); -} - -static void keccak_hash_process(union hash_state *state, const uint8_t *buf, size_t count) { - keccak1600(buf, (int)count, (uint8_t*)state); -} - -extern "C" int fast_aesb_single_round(const uint8_t *in, uint8_t*out, const uint8_t *expandedKey); -extern "C" int aesb_single_round(const uint8_t *in, uint8_t*out, const uint8_t *expandedKey); -extern "C" int aesb_pseudo_round_mut(uint8_t *val, uint8_t *expandedKey); -extern "C" int fast_aesb_pseudo_round_mut(uint8_t *val, uint8_t *expandedKey); - -static void (* const extra_hashes[4])(const void*, size_t, void *) = { - do_blake_hash, do_groestl_hash, do_jh_hash, do_skein_hash -}; - -static uint64_t mul128(uint64_t multiplier, uint64_t multiplicand, uint64_t* product_hi) -{ - // multiplier = ab = a * 2^32 + b - // multiplicand = cd = c * 2^32 + d - // ab * cd = a * c * 2^64 + (a * d + b * c) * 2^32 + b * d - uint64_t a = hi_dword(multiplier); - uint64_t b = lo_dword(multiplier); - uint64_t c = hi_dword(multiplicand); - uint64_t d = lo_dword(multiplicand); - - uint64_t ac = a * c; - uint64_t ad = a * d; - uint64_t bc = b * c; - uint64_t bd = b * d; - - uint64_t adbc = ad + bc; - uint64_t adbc_carry = adbc < ad ? 1 : 0; - - // multiplier * multiplicand = product_hi * 2^64 + product_lo - uint64_t product_lo = bd + (adbc << 32); - uint64_t product_lo_carry = product_lo < bd ? 1 : 0; - *product_hi = ac + (adbc >> 32) + (adbc_carry << 32) + product_lo_carry; - - return product_lo; -} - -static size_t e2i(const uint8_t* a) { - return (*((uint64_t*) a) / AES_BLOCK_SIZE) & (MEMORY / AES_BLOCK_SIZE - 1); -} - -static void mul(const uint8_t* a, const uint8_t* b, uint8_t* res) { - ((uint64_t*) res)[1] = mul128(((uint64_t*) a)[0], ((uint64_t*) b)[0], (uint64_t*) res); -} - -static void sum_half_blocks(uint8_t* a, const uint8_t* b) { - ((uint64_t*) a)[0] += ((uint64_t*) b)[0]; - ((uint64_t*) a)[1] += ((uint64_t*) b)[1]; -} - -static void sum_half_blocks_dst(const uint8_t* a, const uint8_t* b, uint8_t* dst) { - ((uint64_t*) dst)[0] = ((uint64_t*) a)[0] + ((uint64_t*) b)[0]; - ((uint64_t*) dst)[1] = ((uint64_t*) a)[1] + ((uint64_t*) b)[1]; -} - -static void mul_sum_dst(const uint8_t* a, const uint8_t* b, const uint8_t* c, uint8_t* dst) { - ((uint64_t*) dst)[1] = mul128(((uint64_t*) a)[0], ((uint64_t*) b)[0], (uint64_t*) dst) + ((uint64_t*) c)[1]; - ((uint64_t*) dst)[0] += ((uint64_t*) c)[0]; -} - -static void mul_sum_xor_dst(const uint8_t* a, uint8_t* c, uint8_t* dst) { - uint64_t hi, lo = mul128(((uint64_t*) a)[0], ((uint64_t*) dst)[0], &hi) + ((uint64_t*) c)[1]; - hi += ((uint64_t*) c)[0]; - - ((uint64_t*) c)[0] = ((uint64_t*) dst)[0] ^ hi; - ((uint64_t*) c)[1] = ((uint64_t*) dst)[1] ^ lo; - ((uint64_t*) dst)[0] = hi; - ((uint64_t*) dst)[1] = lo; -} - -static void copy_block(uint8_t* dst, const uint8_t* src) { - ((uint64_t*) dst)[0] = ((uint64_t*) src)[0]; - ((uint64_t*) dst)[1] = ((uint64_t*) src)[1]; -} - -static void xor_blocks(uint8_t* a, const uint8_t* b) { - ((uint64_t*) a)[0] ^= ((uint64_t*) b)[0]; - ((uint64_t*) a)[1] ^= ((uint64_t*) b)[1]; -} - -static void xor_blocks_dst(const uint8_t* a, const uint8_t* b, uint8_t* dst) { - ((uint64_t*) dst)[0] = ((uint64_t*) a)[0] ^ ((uint64_t*) b)[0]; - ((uint64_t*) dst)[1] = ((uint64_t*) a)[1] ^ ((uint64_t*) b)[1]; -} - -static void cryptonight_hash_ctx(void* output, const void* input, size_t len, struct cryptonight_ctx* ctx) -{ - size_t i, j; - keccak_hash_process(&ctx->state.hs, (const uint8_t*) input, len); - ctx->aes_ctx = (oaes_ctx*) oaes_alloc(); - memcpy(ctx->text, ctx->state.init, INIT_SIZE_BYTE); - - oaes_key_import_data(ctx->aes_ctx, ctx->state.hs.b, AES_KEY_SIZE); - for (i = 0; likely(i < MEMORY); i += INIT_SIZE_BYTE) { -#undef RND -#define RND(p) aesb_pseudo_round_mut(&ctx->text[AES_BLOCK_SIZE * p], ctx->aes_ctx->key->exp_data); - RND(0); - RND(1); - RND(2); - RND(3); - RND(4); - RND(5); - RND(6); - RND(7); - memcpy(&ctx->long_state[i], ctx->text, INIT_SIZE_BYTE); - } - - xor_blocks_dst(&ctx->state.k[0], &ctx->state.k[32], ctx->a); - xor_blocks_dst(&ctx->state.k[16], &ctx->state.k[48], ctx->b); - - for (i = 0; likely(i < ITER / 4); ++i) { - j = e2i(ctx->a) * AES_BLOCK_SIZE; - aesb_single_round(&ctx->long_state[j], ctx->c, ctx->a); - xor_blocks_dst(ctx->c, ctx->b, &ctx->long_state[j]); - - mul_sum_xor_dst(ctx->c, ctx->a, &ctx->long_state[e2i(ctx->c) * AES_BLOCK_SIZE]); - - j = e2i(ctx->a) * AES_BLOCK_SIZE; - aesb_single_round(&ctx->long_state[j], ctx->b, ctx->a); - xor_blocks_dst(ctx->b, ctx->c, &ctx->long_state[j]); - - mul_sum_xor_dst(ctx->b, ctx->a, &ctx->long_state[e2i(ctx->b) * AES_BLOCK_SIZE]); - } - - memcpy(ctx->text, ctx->state.init, INIT_SIZE_BYTE); - oaes_key_import_data(ctx->aes_ctx, &ctx->state.hs.b[32], AES_KEY_SIZE); - for (i = 0; likely(i < MEMORY); i += INIT_SIZE_BYTE) { -#undef RND -#define RND(p) xor_blocks(&ctx->text[p * AES_BLOCK_SIZE], &ctx->long_state[i + p * AES_BLOCK_SIZE]); \ - aesb_pseudo_round_mut(&ctx->text[p * AES_BLOCK_SIZE], ctx->aes_ctx->key->exp_data); - RND(0); - RND(1); - RND(2); - RND(3); - RND(4); - RND(5); - RND(6); - RND(7); - } - memcpy(ctx->state.init, ctx->text, INIT_SIZE_BYTE); - keccak_hash_permutation(&ctx->state.hs); - - int extra_algo = ctx->state.hs.b[0] & 3; - extra_hashes[extra_algo](&ctx->state, 200, output); - if (opt_debug) applog(LOG_DEBUG, "extra algo=%d", extra_algo); - - oaes_free((OAES_CTX **) &ctx->aes_ctx); -} - -void cryptonight_hash(void* output, const void* input, size_t len) -{ - struct cryptonight_ctx *ctx = (struct cryptonight_ctx*)malloc(sizeof(struct cryptonight_ctx)); - cryptonight_hash_ctx(output, input, len, ctx); - free(ctx); -} diff --git a/crypto/cryptonight-extra.cu b/crypto/cryptonight-extra.cu deleted file mode 100644 index 6d3c1312..00000000 --- a/crypto/cryptonight-extra.cu +++ /dev/null @@ -1,247 +0,0 @@ -#include -#include -#include -#ifndef _WIN32 -#include -#endif - -#include -#include -#include "cryptonight.h" - -typedef uint8_t BitSequence; -typedef uint64_t DataLength; - -static uint32_t *d_input[MAX_GPUS] = { 0 }; -static uint32_t *d_target[MAX_GPUS]; -static uint32_t *d_result[MAX_GPUS]; - -#include "cn_keccak.cuh" -#include "cn_blake.cuh" -#include "cn_groestl.cuh" -#include "cn_jh.cuh" -#include "cn_skein.cuh" - -__constant__ uint8_t d_sub_byte[16][16] = { - {0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76}, - {0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0}, - {0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15}, - {0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75}, - {0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84}, - {0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf}, - {0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8}, - {0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2}, - {0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73}, - {0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb}, - {0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79}, - {0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08}, - {0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a}, - {0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e}, - {0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf}, - {0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16} -}; - -__device__ __forceinline__ -void cryptonight_aes_set_key(uint32_t * __restrict__ key, const uint32_t * __restrict__ data) -{ - const uint32_t aes_gf[] = { - 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36 - }; - - MEMSET4(key, 0, 40); - MEMCPY4(key, data, 8); - - #pragma unroll - for(int i = 8; i < 40; i++) - { - uint8_t temp[4]; - *(uint32_t *)temp = key[i - 1]; - - if(i % 8 == 0) { - *(uint32_t *)temp = ROTR32(*(uint32_t *)temp, 8); - for(int j = 0; j < 4; j++) - temp[j] = d_sub_byte[(temp[j] >> 4) & 0x0f][temp[j] & 0x0f]; - *(uint32_t *)temp ^= aes_gf[i / 8 - 1]; - } - else if(i % 8 == 4) { - #pragma unroll - for(int j = 0; j < 4; j++) - temp[j] = d_sub_byte[(temp[j] >> 4) & 0x0f][temp[j] & 0x0f]; - } - - key[i] = key[(i - 8)] ^ *(uint32_t *)temp; - } -} - -__global__ -void cryptonight_extra_gpu_prepare(const uint32_t threads, uint32_t * __restrict__ d_input, uint32_t startNonce, - uint64_t * d_ctx_state, uint32_t * __restrict__ d_ctx_a, uint32_t * __restrict__ d_ctx_b, - uint32_t * __restrict__ d_ctx_key1, uint32_t * __restrict__ d_ctx_key2) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - - if(thread < threads) - { - uint32_t ctx_state[50]; - uint32_t ctx_a[4]; - uint32_t ctx_b[4]; - uint32_t ctx_key1[40]; - uint32_t ctx_key2[40]; - uint32_t input[19]; - - MEMCPY4(input, d_input, 19); - *((uint32_t *)(((char *)input) + 39)) = startNonce + thread; - - cn_keccak((uint8_t *)input, (uint8_t *)ctx_state); - cryptonight_aes_set_key(ctx_key1, ctx_state); - cryptonight_aes_set_key(ctx_key2, ctx_state + 8); - XOR_BLOCKS_DST(ctx_state, ctx_state + 8, ctx_a); - XOR_BLOCKS_DST(ctx_state + 4, ctx_state + 12, ctx_b); - - MEMCPY8(&d_ctx_state[thread * 26], ctx_state, 25); - MEMCPY4(d_ctx_a + thread * 4, ctx_a, 4); - MEMCPY4(d_ctx_b + thread * 4, ctx_b, 4); - MEMCPY4(d_ctx_key1 + thread * 40, ctx_key1, 40); - MEMCPY4(d_ctx_key2 + thread * 40, ctx_key2, 40); - } -} - -__global__ -void cryptonight_extra_gpu_keccak(uint32_t threads, uint32_t * d_ctx_state) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if(thread < threads) - { - uint64_t* ctx_state = (uint64_t*) (&d_ctx_state[thread * 52U]); - uint64_t state[25]; - #pragma unroll - for(int i = 0; i < 25; i++) - state[i] = ctx_state[i]; - - cn_keccakf2(state); - - // to reduce the final kernel stack frame, cut algos in 2 kernels - // ps: these 2 final kernels are not important for the overall xmr hashrate (< 1%) - switch (((uint8_t*)state)[0] & 0x03) - { - case 0: { - uint32_t hash[8]; - cn_blake((uint8_t*)state, 200, (uint8_t*)hash); - ((uint32_t*)ctx_state)[0] = 0; - ((uint32_t*)ctx_state)[6] = hash[6]; - ((uint32_t*)ctx_state)[7] = hash[7]; - break; - } - case 1: { - uint32_t hash[8]; - cn_groestl((BitSequence*)state, 200, (BitSequence*)hash); - ((uint32_t*)ctx_state)[0] = 0; - ((uint32_t*)ctx_state)[6] = hash[6]; - ((uint32_t*)ctx_state)[7] = hash[7]; - break; - } - default: { - #pragma unroll - for(int i = 0; i < 25; i++) - ctx_state[i] = state[i]; - } - } - } -} - -__global__ -void cryptonight_extra_gpu_final(uint32_t threads, const uint32_t startNonce, uint64_t * __restrict__ d_ctx_state, - const uint32_t* d_target, uint32_t * resNonces) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if(thread < threads) - { - uint64_t* const state = &d_ctx_state[thread * 26U]; - - uint32_t hash[8]; - switch(((uint8_t *)state)[0] & 0x03) - { - case 0: { - uint32_t* h32 = (uint32_t*)state; - hash[6] = h32[6]; - hash[7] = h32[7]; - break; - } - case 2: { - cn_jh256((uint8_t*)state, 200, hash); - break; - } - case 3: { - cn_skein((uint8_t*)state, 200, hash); - break; - } - } - - if(hash[7] <= d_target[1] && hash[6] <= d_target[0]) - { - const uint32_t nonce = startNonce + thread; - uint32_t tmp = atomicExch(resNonces, nonce); - if(tmp != UINT32_MAX) - resNonces[1] = tmp; - } - } -} - -__host__ -void cryptonight_extra_cpu_setData(int thr_id, const void *data, const void *ptarget) -{ - uint32_t *pTargetIn = (uint32_t*) ptarget; - cudaMemcpy(d_input[thr_id], data, 19 * sizeof(uint32_t), cudaMemcpyHostToDevice); - cudaMemcpy(d_target[thr_id], &pTargetIn[6], 2*sizeof(uint32_t), cudaMemcpyHostToDevice); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); -} - -__host__ -void cryptonight_extra_cpu_init(int thr_id, uint32_t threads) -{ - cudaMalloc(&d_input[thr_id], 19 * sizeof(uint32_t)); - cudaMalloc(&d_target[thr_id], 2*sizeof(uint32_t)); - cudaMalloc(&d_result[thr_id], 2*sizeof(uint32_t)); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); -} - -__host__ -void cryptonight_extra_cpu_prepare(int thr_id, uint32_t threads, uint32_t startNonce, uint64_t *d_ctx_state, uint32_t *d_ctx_a, uint32_t *d_ctx_b, uint32_t *d_ctx_key1, uint32_t *d_ctx_key2) -{ - uint32_t threadsperblock = 128; - - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - - cryptonight_extra_gpu_prepare <<>> (threads, d_input[thr_id], startNonce, d_ctx_state, d_ctx_a, d_ctx_b, d_ctx_key1, d_ctx_key2); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); -} - -__host__ -void cryptonight_extra_cpu_final(int thr_id, uint32_t threads, uint32_t startNonce, uint32_t *resnonce, uint64_t *d_ctx_state) -{ - uint32_t threadsperblock = 128; - - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - - cudaMemset(d_result[thr_id], 0xFF, 2*sizeof(uint32_t)); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); - cryptonight_extra_gpu_keccak <<>> (threads, (uint32_t*)d_ctx_state); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); - cryptonight_extra_gpu_final <<>> (threads, startNonce, d_ctx_state, d_target[thr_id], d_result[thr_id]); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); - cudaMemcpy(resnonce, d_result[thr_id], 2 * sizeof(uint32_t), cudaMemcpyDeviceToHost); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); -} - -__host__ -void cryptonight_extra_cpu_free(int thr_id) -{ - if (d_input[thr_id]) { - cudaFree(d_input[thr_id]); - cudaFree(d_target[thr_id]); - cudaFree(d_result[thr_id]); - d_input[thr_id] = NULL; - } -} \ No newline at end of file diff --git a/crypto/cryptonight.cu b/crypto/cryptonight.cu deleted file mode 100644 index 0214ce4f..00000000 --- a/crypto/cryptonight.cu +++ /dev/null @@ -1,185 +0,0 @@ - -#include "cryptonight.h" - -extern char *device_config[MAX_GPUS]; // -l 32x16 - -static __thread uint32_t cn_blocks; -static __thread uint32_t cn_threads; - -// used for gpu intensity on algo init -static __thread bool gpu_init_shown = false; -#define gpulog_init(p,thr,fmt, ...) if (!gpu_init_shown) \ - gpulog(p, thr, fmt, ##__VA_ARGS__) - -static uint64_t *d_long_state[MAX_GPUS]; -static uint64_t *d_ctx_state[MAX_GPUS]; -static uint32_t *d_ctx_key1[MAX_GPUS]; -static uint32_t *d_ctx_key2[MAX_GPUS]; -static uint32_t *d_ctx_text[MAX_GPUS]; -static uint32_t *d_ctx_a[MAX_GPUS]; -static uint32_t *d_ctx_b[MAX_GPUS]; - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_cryptonight(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - int res = 0; - uint32_t throughput = 0; - - uint32_t *ptarget = work->target; - uint8_t *pdata = (uint8_t*) work->data; - uint32_t *nonceptr = (uint32_t*) (&pdata[39]); - const uint32_t first_nonce = *nonceptr; - uint32_t nonce = first_nonce; - int dev_id = device_map[thr_id]; - - if(opt_benchmark) { - ptarget[7] = 0x00ff; - } - - if(!init[thr_id]) - { - int mem = cuda_available_memory(thr_id); - int mul = device_sm[dev_id] >= 300 ? 4 : 1; // see cryptonight-core.cu - cn_threads = device_sm[dev_id] >= 600 ? 16 : 8; // real TPB is x4 on SM3+ - cn_blocks = device_mpcount[dev_id] * 4; - if (cn_blocks*cn_threads*2.2 > mem) cn_blocks = device_mpcount[dev_id] * 2; - - if (!opt_quiet) - gpulog_init(LOG_INFO, thr_id, "%s, %d MB available, %hd SMX", device_name[dev_id], - mem, device_mpcount[dev_id]); - - if (device_config[thr_id]) { - int res = sscanf(device_config[thr_id], "%ux%u", &cn_blocks, &cn_threads); - throughput = cuda_default_throughput(thr_id, cn_blocks*cn_threads); - gpulog_init(LOG_INFO, thr_id, "Using %ux%u(x%d) kernel launch config, %u threads", - cn_blocks, cn_threads, mul, throughput); - } else { - throughput = cuda_default_throughput(thr_id, cn_blocks*cn_threads); - if (throughput != cn_blocks*cn_threads && cn_threads) { - cn_blocks = throughput / cn_threads; - throughput = cn_threads * cn_blocks; - } - gpulog_init(LOG_INFO, thr_id, "%u threads (%g) with %u blocks",// of %ux%d", - throughput, throughput2intensity(throughput), cn_blocks);//, cn_threads, mul); - } - - if(sizeof(size_t) == 4 && throughput > UINT32_MAX / MEMORY) { - gpulog(LOG_ERR, thr_id, "THE 32bit VERSION CAN'T ALLOCATE MORE THAN 4GB OF MEMORY!"); - gpulog(LOG_ERR, thr_id, "PLEASE REDUCE THE NUMBER OF THREADS OR BLOCKS"); - exit(1); - } - - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - cudaDeviceSetCacheConfig(cudaFuncCachePreferL1); - CUDA_LOG_ERROR(); - } - - const size_t alloc = MEMORY * throughput; - cryptonight_extra_cpu_init(thr_id, throughput); - - cudaMalloc(&d_long_state[thr_id], alloc); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); - cudaMalloc(&d_ctx_state[thr_id], 208 * throughput); // 52*4 (200 is not aligned 16) - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); - cudaMalloc(&d_ctx_key1[thr_id], 40 * sizeof(uint32_t) * throughput); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); - cudaMalloc(&d_ctx_key2[thr_id], 40 * sizeof(uint32_t) * throughput); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); - cudaMalloc(&d_ctx_text[thr_id], 32 * sizeof(uint32_t) * throughput); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); - cudaMalloc(&d_ctx_a[thr_id], 4 * sizeof(uint32_t) * throughput); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); - cudaMalloc(&d_ctx_b[thr_id], 4 * sizeof(uint32_t) * throughput); - exit_if_cudaerror(thr_id, __FUNCTION__, __LINE__); - - gpu_init_shown = true; - init[thr_id] = true; - } - - throughput = cn_blocks*cn_threads; - - do - { - const uint32_t Htarg = ptarget[7]; - uint32_t resNonces[2] = { UINT32_MAX, UINT32_MAX }; - - cryptonight_extra_cpu_setData(thr_id, pdata, ptarget); - cryptonight_extra_cpu_prepare(thr_id, throughput, nonce, d_ctx_state[thr_id], d_ctx_a[thr_id], d_ctx_b[thr_id], d_ctx_key1[thr_id], d_ctx_key2[thr_id]); - cryptonight_core_cuda(thr_id, cn_blocks, cn_threads, d_long_state[thr_id], d_ctx_state[thr_id], d_ctx_a[thr_id], d_ctx_b[thr_id], d_ctx_key1[thr_id], d_ctx_key2[thr_id]); - cryptonight_extra_cpu_final(thr_id, throughput, nonce, resNonces, d_ctx_state[thr_id]); - - *hashes_done = nonce - first_nonce + throughput; - - if(resNonces[0] != UINT32_MAX) - { - uint32_t vhash[8]; - uint32_t tempdata[19]; - uint32_t *tempnonceptr = (uint32_t*)(((char*)tempdata) + 39); - memcpy(tempdata, pdata, 76); - *tempnonceptr = resNonces[0]; - cryptonight_hash(vhash, tempdata, 76); - if(vhash[7] <= Htarg && fulltest(vhash, ptarget)) - { - res = 1; - work->nonces[0] = resNonces[0]; - work_set_target_ratio(work, vhash); - // second nonce - if(resNonces[1] != UINT32_MAX) - { - *tempnonceptr = resNonces[1]; - cryptonight_hash(vhash, tempdata, 76); - if(vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - res++; - work->nonces[1] = resNonces[1]; - } else { - gpu_increment_reject(thr_id); - } - } - goto done; - } else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for nonce %08x does not validate on CPU!", resNonces[0]); - } - } - - if ((uint64_t) throughput + nonce >= max_nonce - 127) { - nonce = max_nonce; - break; - } - - nonce += throughput; - gpulog(LOG_DEBUG, thr_id, "nonce %08x", nonce); - - } while (!work_restart[thr_id].restart && max_nonce > (uint64_t)throughput + nonce); - -done: - gpulog(LOG_DEBUG, thr_id, "nonce %08x exit", nonce); - work->valid_nonces = res; - *nonceptr = nonce; - return res; -} - -void free_cryptonight(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaFree(d_long_state[thr_id]); - cudaFree(d_ctx_state[thr_id]); - cudaFree(d_ctx_key1[thr_id]); - cudaFree(d_ctx_key2[thr_id]); - cudaFree(d_ctx_text[thr_id]); - cudaFree(d_ctx_a[thr_id]); - cudaFree(d_ctx_b[thr_id]); - - cryptonight_extra_cpu_free(thr_id); - - cudaDeviceSynchronize(); - - init[thr_id] = false; -} diff --git a/crypto/cryptonight.h b/crypto/cryptonight.h deleted file mode 100644 index 4a318324..00000000 --- a/crypto/cryptonight.h +++ /dev/null @@ -1,145 +0,0 @@ -#pragma once -#include -#include - -#ifdef __INTELLISENSE__ -/* avoid red underlining */ -#define __CUDA_ARCH__ 520 -struct uint3 { - unsigned int x, y, z; -}; -struct uint3 threadIdx; -struct uint3 blockIdx; -struct uint3 blockDim; -#define atomicExch(p,y) (*p) = y -#define __funnelshift_r(a,b,c) 1 -#define __syncthreads() -#define __threadfence_block() -#define asm(x) -#define __shfl(a,b,c) 1 -#define __umul64hi(a,b) a*b -#endif - - -#define MEMORY (1U << 21) // 2 MiB / 2097152 B -#define ITER (1U << 20) // 1048576 -#define E2I_MASK 0x1FFFF0u - -#define AES_BLOCK_SIZE 16U -#define AES_KEY_SIZE 32 -#define INIT_SIZE_BLK 8 -#define INIT_SIZE_BYTE (INIT_SIZE_BLK * AES_BLOCK_SIZE) // 128 B - -#define AES_RKEY_LEN 4 -#define AES_COL_LEN 4 -#define AES_ROUND_BASE 7 - -#ifndef HASH_SIZE -#define HASH_SIZE 32 -#endif - -#ifndef HASH_DATA_AREA -#define HASH_DATA_AREA 136 -#endif - -#define hi_dword(x) (x >> 32) -#define lo_dword(x) (x & 0xFFFFFFFF) - -#define C32(x) ((uint32_t)(x ## U)) -#define T32(x) ((x) & C32(0xFFFFFFFF)) - -#ifndef ROTL64 - #if __CUDA_ARCH__ >= 350 - __forceinline__ __device__ uint64_t cuda_ROTL64(const uint64_t value, const int offset) { - uint2 result; - if(offset >= 32) { - asm("shf.l.wrap.b32 %0, %1, %2, %3;" : "=r"(result.x) : "r"(__double2loint(__longlong_as_double(value))), "r"(__double2hiint(__longlong_as_double(value))), "r"(offset)); - asm("shf.l.wrap.b32 %0, %1, %2, %3;" : "=r"(result.y) : "r"(__double2hiint(__longlong_as_double(value))), "r"(__double2loint(__longlong_as_double(value))), "r"(offset)); - } else { - asm("shf.l.wrap.b32 %0, %1, %2, %3;" : "=r"(result.x) : "r"(__double2hiint(__longlong_as_double(value))), "r"(__double2loint(__longlong_as_double(value))), "r"(offset)); - asm("shf.l.wrap.b32 %0, %1, %2, %3;" : "=r"(result.y) : "r"(__double2loint(__longlong_as_double(value))), "r"(__double2hiint(__longlong_as_double(value))), "r"(offset)); - } - return __double_as_longlong(__hiloint2double(result.y, result.x)); - } - #define ROTL64(x, n) (cuda_ROTL64(x, n)) - #else - #define ROTL64(x, n) (((x) << (n)) | ((x) >> (64 - (n)))) - #endif -#endif - -#ifndef ROTL32 - #if __CUDA_ARCH__ < 350 - #define ROTL32(x, n) T32(((x) << (n)) | ((x) >> (32 - (n)))) - #else - #define ROTL32(x, n) __funnelshift_l( (x), (x), (n) ) - #endif -#endif - -#ifndef ROTR32 - #if __CUDA_ARCH__ < 350 - #define ROTR32(x, n) (((x) >> (n)) | ((x) << (32 - (n)))) - #else - #define ROTR32(x, n) __funnelshift_r( (x), (x), (n) ) - #endif -#endif - -#define MEMSET8(dst,what,cnt) { \ - int i_memset8; \ - uint64_t *out_memset8 = (uint64_t *)(dst); \ - for( i_memset8 = 0; i_memset8 < cnt; i_memset8++ ) \ - out_memset8[i_memset8] = (what); } - -#define MEMSET4(dst,what,cnt) { \ - int i_memset4; \ - uint32_t *out_memset4 = (uint32_t *)(dst); \ - for( i_memset4 = 0; i_memset4 < cnt; i_memset4++ ) \ - out_memset4[i_memset4] = (what); } - -#define MEMCPY8(dst,src,cnt) { \ - int i_memcpy8; \ - uint64_t *in_memcpy8 = (uint64_t *)(src); \ - uint64_t *out_memcpy8 = (uint64_t *)(dst); \ - for( i_memcpy8 = 0; i_memcpy8 < cnt; i_memcpy8++ ) \ - out_memcpy8[i_memcpy8] = in_memcpy8[i_memcpy8]; } - -#define MEMCPY4(dst,src,cnt) { \ - int i_memcpy4; \ - uint32_t *in_memcpy4 = (uint32_t *)(src); \ - uint32_t *out_memcpy4 = (uint32_t *)(dst); \ - for( i_memcpy4 = 0; i_memcpy4 < cnt; i_memcpy4++ ) \ - out_memcpy4[i_memcpy4] = in_memcpy4[i_memcpy4]; } - -#define XOR_BLOCKS_DST(x,y,z) { \ - ((uint64_t *)z)[0] = ((uint64_t *)(x))[0] ^ ((uint64_t *)(y))[0]; \ - ((uint64_t *)z)[1] = ((uint64_t *)(x))[1] ^ ((uint64_t *)(y))[1]; } - -#define E2I(x) ((size_t)(((*((uint64_t*)(x)) >> 4) & 0x1ffff))) - -union hash_state { - uint8_t b[200]; - uint64_t w[25]; -}; - -union cn_slow_hash_state { - union hash_state hs; - struct { - uint8_t k[64]; - uint8_t init[INIT_SIZE_BYTE]; - }; -}; - -static inline void exit_if_cudaerror(int thr_id, const char *src, int line) -{ - cudaError_t err = cudaGetLastError(); - if(err != cudaSuccess) { - gpulog(LOG_ERR, thr_id, "%s %s line %d", cudaGetErrorString(err), src, line); - exit(1); - } -} -void cryptonight_core_cuda(int thr_id, int blocks, int threads, uint64_t *d_long_state, uint64_t *d_ctx_state, uint32_t *d_ctx_a, uint32_t *d_ctx_b, uint32_t *d_ctx_key1, uint32_t *d_ctx_key2); - -void cryptonight_extra_cpu_setData(int thr_id, const void *data, const void *pTargetIn); -void cryptonight_extra_cpu_init(int thr_id, uint32_t threads); -void cryptonight_extra_cpu_free(int thr_id); -void cryptonight_extra_cpu_prepare(int thr_id, uint32_t threads, uint32_t startNonce, uint64_t *d_ctx_state, uint32_t *d_ctx_a, uint32_t *d_ctx_b, uint32_t *d_ctx_key1, uint32_t *d_ctx_key2); -void cryptonight_extra_cpu_final(int thr_id, uint32_t threads, uint32_t startNonce, uint32_t *nonce, uint64_t *d_ctx_state); diff --git a/crypto/oaes_config.h b/crypto/oaes_config.h deleted file mode 100644 index 78b8edb1..00000000 --- a/crypto/oaes_config.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * --------------------------------------------------------------------------- - * OpenAES License - * --------------------------------------------------------------------------- - * Copyright (c) 2012, Nabil S. Al Ramli, www.nalramli.com - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * --------------------------------------------------------------------------- - */ - -#ifndef _OAES_CONFIG_H -#define _OAES_CONFIG_H - -#ifdef __cplusplus -extern "C" { -#endif - -//#ifndef OAES_HAVE_ISAAC -//#define OAES_HAVE_ISAAC 1 -//#endif // OAES_HAVE_ISAAC - -//#ifndef OAES_DEBUG -//#define OAES_DEBUG 0 -//#endif // OAES_DEBUG -//#define OAES_DEBUG 1 - -#ifdef __cplusplus -} -#endif - -#endif // _OAES_CONFIG_H diff --git a/crypto/oaes_lib.cpp b/crypto/oaes_lib.cpp deleted file mode 100644 index 9427d828..00000000 --- a/crypto/oaes_lib.cpp +++ /dev/null @@ -1,1447 +0,0 @@ -/* - * --------------------------------------------------------------------------- - * OpenAES License - * --------------------------------------------------------------------------- - * Copyright (c) 2012, Nabil S. Al Ramli, www.nalramli.com - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * --------------------------------------------------------------------------- - */ -static const char _NR[] = { - 0x4e,0x61,0x62,0x69,0x6c,0x20,0x53,0x2e,0x20, - 0x41,0x6c,0x20,0x52,0x61,0x6d,0x6c,0x69,0x00 }; - -#include "miner.h" - -#include -#include -#include -#if !((defined(__FreeBSD__) && __FreeBSD__ >= 10) || defined(__APPLE__)) -#include -#endif -#include -#include -#include - -#ifdef _MSC_VER -#include -#define getpid() _getpid() -#else -#include -#include -#endif - -#include "oaes_config.h" -#include "oaes_lib.h" - -#ifdef OAES_HAVE_ISAAC -#include "rand.h" -#endif // OAES_HAVE_ISAAC - -#define OAES_RKEY_LEN 4 -#define OAES_COL_LEN 4 -#define OAES_ROUND_BASE 7 - -// the block is padded -#define OAES_FLAG_PAD 0x01 - -#ifndef min -# define min(a,b) (((a)<(b)) ? (a) : (b)) -#endif /* min */ - -// "OAES<8-bit header version><8-bit type><16-bit options><8-bit flags><56-bit reserved>" -static uint8_t oaes_header[OAES_BLOCK_SIZE] = { - // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, - /*0*/ 0x4f, 0x41, 0x45, 0x53, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -static uint8_t oaes_gf_8[] = { - 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36 }; - -static uint8_t oaes_sub_byte_value[16][16] = { - // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, - /*0*/ { 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76 }, - /*1*/ { 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0 }, - /*2*/ { 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15 }, - /*3*/ { 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75 }, - /*4*/ { 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84 }, - /*5*/ { 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf }, - /*6*/ { 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8 }, - /*7*/ { 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2 }, - /*8*/ { 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73 }, - /*9*/ { 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb }, - /*a*/ { 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79 }, - /*b*/ { 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08 }, - /*c*/ { 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a }, - /*d*/ { 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e }, - /*e*/ { 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf }, - /*f*/ { 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 }, -}; - -static uint8_t oaes_inv_sub_byte_value[16][16] = { - // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, - /*0*/ { 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb }, - /*1*/ { 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb }, - /*2*/ { 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e }, - /*3*/ { 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25 }, - /*4*/ { 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92 }, - /*5*/ { 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84 }, - /*6*/ { 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06 }, - /*7*/ { 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b }, - /*8*/ { 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73 }, - /*9*/ { 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e }, - /*a*/ { 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b }, - /*b*/ { 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4 }, - /*c*/ { 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f }, - /*d*/ { 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef }, - /*e*/ { 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61 }, - /*f*/ { 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d }, -}; - -static uint8_t oaes_gf_mul_2[16][16] = { - // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, - /*0*/ { 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e }, - /*1*/ { 0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e, 0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e }, - /*2*/ { 0x40, 0x42, 0x44, 0x46, 0x48, 0x4a, 0x4c, 0x4e, 0x50, 0x52, 0x54, 0x56, 0x58, 0x5a, 0x5c, 0x5e }, - /*3*/ { 0x60, 0x62, 0x64, 0x66, 0x68, 0x6a, 0x6c, 0x6e, 0x70, 0x72, 0x74, 0x76, 0x78, 0x7a, 0x7c, 0x7e }, - /*4*/ { 0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8c, 0x8e, 0x90, 0x92, 0x94, 0x96, 0x98, 0x9a, 0x9c, 0x9e }, - /*5*/ { 0xa0, 0xa2, 0xa4, 0xa6, 0xa8, 0xaa, 0xac, 0xae, 0xb0, 0xb2, 0xb4, 0xb6, 0xb8, 0xba, 0xbc, 0xbe }, - /*6*/ { 0xc0, 0xc2, 0xc4, 0xc6, 0xc8, 0xca, 0xcc, 0xce, 0xd0, 0xd2, 0xd4, 0xd6, 0xd8, 0xda, 0xdc, 0xde }, - /*7*/ { 0xe0, 0xe2, 0xe4, 0xe6, 0xe8, 0xea, 0xec, 0xee, 0xf0, 0xf2, 0xf4, 0xf6, 0xf8, 0xfa, 0xfc, 0xfe }, - /*8*/ { 0x1b, 0x19, 0x1f, 0x1d, 0x13, 0x11, 0x17, 0x15, 0x0b, 0x09, 0x0f, 0x0d, 0x03, 0x01, 0x07, 0x05 }, - /*9*/ { 0x3b, 0x39, 0x3f, 0x3d, 0x33, 0x31, 0x37, 0x35, 0x2b, 0x29, 0x2f, 0x2d, 0x23, 0x21, 0x27, 0x25 }, - /*a*/ { 0x5b, 0x59, 0x5f, 0x5d, 0x53, 0x51, 0x57, 0x55, 0x4b, 0x49, 0x4f, 0x4d, 0x43, 0x41, 0x47, 0x45 }, - /*b*/ { 0x7b, 0x79, 0x7f, 0x7d, 0x73, 0x71, 0x77, 0x75, 0x6b, 0x69, 0x6f, 0x6d, 0x63, 0x61, 0x67, 0x65 }, - /*c*/ { 0x9b, 0x99, 0x9f, 0x9d, 0x93, 0x91, 0x97, 0x95, 0x8b, 0x89, 0x8f, 0x8d, 0x83, 0x81, 0x87, 0x85 }, - /*d*/ { 0xbb, 0xb9, 0xbf, 0xbd, 0xb3, 0xb1, 0xb7, 0xb5, 0xab, 0xa9, 0xaf, 0xad, 0xa3, 0xa1, 0xa7, 0xa5 }, - /*e*/ { 0xdb, 0xd9, 0xdf, 0xdd, 0xd3, 0xd1, 0xd7, 0xd5, 0xcb, 0xc9, 0xcf, 0xcd, 0xc3, 0xc1, 0xc7, 0xc5 }, - /*f*/ { 0xfb, 0xf9, 0xff, 0xfd, 0xf3, 0xf1, 0xf7, 0xf5, 0xeb, 0xe9, 0xef, 0xed, 0xe3, 0xe1, 0xe7, 0xe5 }, -}; - -static uint8_t oaes_gf_mul_3[16][16] = { - // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, - /*0*/ { 0x00, 0x03, 0x06, 0x05, 0x0c, 0x0f, 0x0a, 0x09, 0x18, 0x1b, 0x1e, 0x1d, 0x14, 0x17, 0x12, 0x11 }, - /*1*/ { 0x30, 0x33, 0x36, 0x35, 0x3c, 0x3f, 0x3a, 0x39, 0x28, 0x2b, 0x2e, 0x2d, 0x24, 0x27, 0x22, 0x21 }, - /*2*/ { 0x60, 0x63, 0x66, 0x65, 0x6c, 0x6f, 0x6a, 0x69, 0x78, 0x7b, 0x7e, 0x7d, 0x74, 0x77, 0x72, 0x71 }, - /*3*/ { 0x50, 0x53, 0x56, 0x55, 0x5c, 0x5f, 0x5a, 0x59, 0x48, 0x4b, 0x4e, 0x4d, 0x44, 0x47, 0x42, 0x41 }, - /*4*/ { 0xc0, 0xc3, 0xc6, 0xc5, 0xcc, 0xcf, 0xca, 0xc9, 0xd8, 0xdb, 0xde, 0xdd, 0xd4, 0xd7, 0xd2, 0xd1 }, - /*5*/ { 0xf0, 0xf3, 0xf6, 0xf5, 0xfc, 0xff, 0xfa, 0xf9, 0xe8, 0xeb, 0xee, 0xed, 0xe4, 0xe7, 0xe2, 0xe1 }, - /*6*/ { 0xa0, 0xa3, 0xa6, 0xa5, 0xac, 0xaf, 0xaa, 0xa9, 0xb8, 0xbb, 0xbe, 0xbd, 0xb4, 0xb7, 0xb2, 0xb1 }, - /*7*/ { 0x90, 0x93, 0x96, 0x95, 0x9c, 0x9f, 0x9a, 0x99, 0x88, 0x8b, 0x8e, 0x8d, 0x84, 0x87, 0x82, 0x81 }, - /*8*/ { 0x9b, 0x98, 0x9d, 0x9e, 0x97, 0x94, 0x91, 0x92, 0x83, 0x80, 0x85, 0x86, 0x8f, 0x8c, 0x89, 0x8a }, - /*9*/ { 0xab, 0xa8, 0xad, 0xae, 0xa7, 0xa4, 0xa1, 0xa2, 0xb3, 0xb0, 0xb5, 0xb6, 0xbf, 0xbc, 0xb9, 0xba }, - /*a*/ { 0xfb, 0xf8, 0xfd, 0xfe, 0xf7, 0xf4, 0xf1, 0xf2, 0xe3, 0xe0, 0xe5, 0xe6, 0xef, 0xec, 0xe9, 0xea }, - /*b*/ { 0xcb, 0xc8, 0xcd, 0xce, 0xc7, 0xc4, 0xc1, 0xc2, 0xd3, 0xd0, 0xd5, 0xd6, 0xdf, 0xdc, 0xd9, 0xda }, - /*c*/ { 0x5b, 0x58, 0x5d, 0x5e, 0x57, 0x54, 0x51, 0x52, 0x43, 0x40, 0x45, 0x46, 0x4f, 0x4c, 0x49, 0x4a }, - /*d*/ { 0x6b, 0x68, 0x6d, 0x6e, 0x67, 0x64, 0x61, 0x62, 0x73, 0x70, 0x75, 0x76, 0x7f, 0x7c, 0x79, 0x7a }, - /*e*/ { 0x3b, 0x38, 0x3d, 0x3e, 0x37, 0x34, 0x31, 0x32, 0x23, 0x20, 0x25, 0x26, 0x2f, 0x2c, 0x29, 0x2a }, - /*f*/ { 0x0b, 0x08, 0x0d, 0x0e, 0x07, 0x04, 0x01, 0x02, 0x13, 0x10, 0x15, 0x16, 0x1f, 0x1c, 0x19, 0x1a }, -}; - -static uint8_t oaes_gf_mul_9[16][16] = { - // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, - /*0*/ { 0x00, 0x09, 0x12, 0x1b, 0x24, 0x2d, 0x36, 0x3f, 0x48, 0x41, 0x5a, 0x53, 0x6c, 0x65, 0x7e, 0x77 }, - /*1*/ { 0x90, 0x99, 0x82, 0x8b, 0xb4, 0xbd, 0xa6, 0xaf, 0xd8, 0xd1, 0xca, 0xc3, 0xfc, 0xf5, 0xee, 0xe7 }, - /*2*/ { 0x3b, 0x32, 0x29, 0x20, 0x1f, 0x16, 0x0d, 0x04, 0x73, 0x7a, 0x61, 0x68, 0x57, 0x5e, 0x45, 0x4c }, - /*3*/ { 0xab, 0xa2, 0xb9, 0xb0, 0x8f, 0x86, 0x9d, 0x94, 0xe3, 0xea, 0xf1, 0xf8, 0xc7, 0xce, 0xd5, 0xdc }, - /*4*/ { 0x76, 0x7f, 0x64, 0x6d, 0x52, 0x5b, 0x40, 0x49, 0x3e, 0x37, 0x2c, 0x25, 0x1a, 0x13, 0x08, 0x01 }, - /*5*/ { 0xe6, 0xef, 0xf4, 0xfd, 0xc2, 0xcb, 0xd0, 0xd9, 0xae, 0xa7, 0xbc, 0xb5, 0x8a, 0x83, 0x98, 0x91 }, - /*6*/ { 0x4d, 0x44, 0x5f, 0x56, 0x69, 0x60, 0x7b, 0x72, 0x05, 0x0c, 0x17, 0x1e, 0x21, 0x28, 0x33, 0x3a }, - /*7*/ { 0xdd, 0xd4, 0xcf, 0xc6, 0xf9, 0xf0, 0xeb, 0xe2, 0x95, 0x9c, 0x87, 0x8e, 0xb1, 0xb8, 0xa3, 0xaa }, - /*8*/ { 0xec, 0xe5, 0xfe, 0xf7, 0xc8, 0xc1, 0xda, 0xd3, 0xa4, 0xad, 0xb6, 0xbf, 0x80, 0x89, 0x92, 0x9b }, - /*9*/ { 0x7c, 0x75, 0x6e, 0x67, 0x58, 0x51, 0x4a, 0x43, 0x34, 0x3d, 0x26, 0x2f, 0x10, 0x19, 0x02, 0x0b }, - /*a*/ { 0xd7, 0xde, 0xc5, 0xcc, 0xf3, 0xfa, 0xe1, 0xe8, 0x9f, 0x96, 0x8d, 0x84, 0xbb, 0xb2, 0xa9, 0xa0 }, - /*b*/ { 0x47, 0x4e, 0x55, 0x5c, 0x63, 0x6a, 0x71, 0x78, 0x0f, 0x06, 0x1d, 0x14, 0x2b, 0x22, 0x39, 0x30 }, - /*c*/ { 0x9a, 0x93, 0x88, 0x81, 0xbe, 0xb7, 0xac, 0xa5, 0xd2, 0xdb, 0xc0, 0xc9, 0xf6, 0xff, 0xe4, 0xed }, - /*d*/ { 0x0a, 0x03, 0x18, 0x11, 0x2e, 0x27, 0x3c, 0x35, 0x42, 0x4b, 0x50, 0x59, 0x66, 0x6f, 0x74, 0x7d }, - /*e*/ { 0xa1, 0xa8, 0xb3, 0xba, 0x85, 0x8c, 0x97, 0x9e, 0xe9, 0xe0, 0xfb, 0xf2, 0xcd, 0xc4, 0xdf, 0xd6 }, - /*f*/ { 0x31, 0x38, 0x23, 0x2a, 0x15, 0x1c, 0x07, 0x0e, 0x79, 0x70, 0x6b, 0x62, 0x5d, 0x54, 0x4f, 0x46 }, -}; - -static uint8_t oaes_gf_mul_b[16][16] = { - // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, - /*0*/ { 0x00, 0x0b, 0x16, 0x1d, 0x2c, 0x27, 0x3a, 0x31, 0x58, 0x53, 0x4e, 0x45, 0x74, 0x7f, 0x62, 0x69 }, - /*1*/ { 0xb0, 0xbb, 0xa6, 0xad, 0x9c, 0x97, 0x8a, 0x81, 0xe8, 0xe3, 0xfe, 0xf5, 0xc4, 0xcf, 0xd2, 0xd9 }, - /*2*/ { 0x7b, 0x70, 0x6d, 0x66, 0x57, 0x5c, 0x41, 0x4a, 0x23, 0x28, 0x35, 0x3e, 0x0f, 0x04, 0x19, 0x12 }, - /*3*/ { 0xcb, 0xc0, 0xdd, 0xd6, 0xe7, 0xec, 0xf1, 0xfa, 0x93, 0x98, 0x85, 0x8e, 0xbf, 0xb4, 0xa9, 0xa2 }, - /*4*/ { 0xf6, 0xfd, 0xe0, 0xeb, 0xda, 0xd1, 0xcc, 0xc7, 0xae, 0xa5, 0xb8, 0xb3, 0x82, 0x89, 0x94, 0x9f }, - /*5*/ { 0x46, 0x4d, 0x50, 0x5b, 0x6a, 0x61, 0x7c, 0x77, 0x1e, 0x15, 0x08, 0x03, 0x32, 0x39, 0x24, 0x2f }, - /*6*/ { 0x8d, 0x86, 0x9b, 0x90, 0xa1, 0xaa, 0xb7, 0xbc, 0xd5, 0xde, 0xc3, 0xc8, 0xf9, 0xf2, 0xef, 0xe4 }, - /*7*/ { 0x3d, 0x36, 0x2b, 0x20, 0x11, 0x1a, 0x07, 0x0c, 0x65, 0x6e, 0x73, 0x78, 0x49, 0x42, 0x5f, 0x54 }, - /*8*/ { 0xf7, 0xfc, 0xe1, 0xea, 0xdb, 0xd0, 0xcd, 0xc6, 0xaf, 0xa4, 0xb9, 0xb2, 0x83, 0x88, 0x95, 0x9e }, - /*9*/ { 0x47, 0x4c, 0x51, 0x5a, 0x6b, 0x60, 0x7d, 0x76, 0x1f, 0x14, 0x09, 0x02, 0x33, 0x38, 0x25, 0x2e }, - /*a*/ { 0x8c, 0x87, 0x9a, 0x91, 0xa0, 0xab, 0xb6, 0xbd, 0xd4, 0xdf, 0xc2, 0xc9, 0xf8, 0xf3, 0xee, 0xe5 }, - /*b*/ { 0x3c, 0x37, 0x2a, 0x21, 0x10, 0x1b, 0x06, 0x0d, 0x64, 0x6f, 0x72, 0x79, 0x48, 0x43, 0x5e, 0x55 }, - /*c*/ { 0x01, 0x0a, 0x17, 0x1c, 0x2d, 0x26, 0x3b, 0x30, 0x59, 0x52, 0x4f, 0x44, 0x75, 0x7e, 0x63, 0x68 }, - /*d*/ { 0xb1, 0xba, 0xa7, 0xac, 0x9d, 0x96, 0x8b, 0x80, 0xe9, 0xe2, 0xff, 0xf4, 0xc5, 0xce, 0xd3, 0xd8 }, - /*e*/ { 0x7a, 0x71, 0x6c, 0x67, 0x56, 0x5d, 0x40, 0x4b, 0x22, 0x29, 0x34, 0x3f, 0x0e, 0x05, 0x18, 0x13 }, - /*f*/ { 0xca, 0xc1, 0xdc, 0xd7, 0xe6, 0xed, 0xf0, 0xfb, 0x92, 0x99, 0x84, 0x8f, 0xbe, 0xb5, 0xa8, 0xa3 }, -}; - -static uint8_t oaes_gf_mul_d[16][16] = { - // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, - /*0*/ { 0x00, 0x0d, 0x1a, 0x17, 0x34, 0x39, 0x2e, 0x23, 0x68, 0x65, 0x72, 0x7f, 0x5c, 0x51, 0x46, 0x4b }, - /*1*/ { 0xd0, 0xdd, 0xca, 0xc7, 0xe4, 0xe9, 0xfe, 0xf3, 0xb8, 0xb5, 0xa2, 0xaf, 0x8c, 0x81, 0x96, 0x9b }, - /*2*/ { 0xbb, 0xb6, 0xa1, 0xac, 0x8f, 0x82, 0x95, 0x98, 0xd3, 0xde, 0xc9, 0xc4, 0xe7, 0xea, 0xfd, 0xf0 }, - /*3*/ { 0x6b, 0x66, 0x71, 0x7c, 0x5f, 0x52, 0x45, 0x48, 0x03, 0x0e, 0x19, 0x14, 0x37, 0x3a, 0x2d, 0x20 }, - /*4*/ { 0x6d, 0x60, 0x77, 0x7a, 0x59, 0x54, 0x43, 0x4e, 0x05, 0x08, 0x1f, 0x12, 0x31, 0x3c, 0x2b, 0x26 }, - /*5*/ { 0xbd, 0xb0, 0xa7, 0xaa, 0x89, 0x84, 0x93, 0x9e, 0xd5, 0xd8, 0xcf, 0xc2, 0xe1, 0xec, 0xfb, 0xf6 }, - /*6*/ { 0xd6, 0xdb, 0xcc, 0xc1, 0xe2, 0xef, 0xf8, 0xf5, 0xbe, 0xb3, 0xa4, 0xa9, 0x8a, 0x87, 0x90, 0x9d }, - /*7*/ { 0x06, 0x0b, 0x1c, 0x11, 0x32, 0x3f, 0x28, 0x25, 0x6e, 0x63, 0x74, 0x79, 0x5a, 0x57, 0x40, 0x4d }, - /*8*/ { 0xda, 0xd7, 0xc0, 0xcd, 0xee, 0xe3, 0xf4, 0xf9, 0xb2, 0xbf, 0xa8, 0xa5, 0x86, 0x8b, 0x9c, 0x91 }, - /*9*/ { 0x0a, 0x07, 0x10, 0x1d, 0x3e, 0x33, 0x24, 0x29, 0x62, 0x6f, 0x78, 0x75, 0x56, 0x5b, 0x4c, 0x41 }, - /*a*/ { 0x61, 0x6c, 0x7b, 0x76, 0x55, 0x58, 0x4f, 0x42, 0x09, 0x04, 0x13, 0x1e, 0x3d, 0x30, 0x27, 0x2a }, - /*b*/ { 0xb1, 0xbc, 0xab, 0xa6, 0x85, 0x88, 0x9f, 0x92, 0xd9, 0xd4, 0xc3, 0xce, 0xed, 0xe0, 0xf7, 0xfa }, - /*c*/ { 0xb7, 0xba, 0xad, 0xa0, 0x83, 0x8e, 0x99, 0x94, 0xdf, 0xd2, 0xc5, 0xc8, 0xeb, 0xe6, 0xf1, 0xfc }, - /*d*/ { 0x67, 0x6a, 0x7d, 0x70, 0x53, 0x5e, 0x49, 0x44, 0x0f, 0x02, 0x15, 0x18, 0x3b, 0x36, 0x21, 0x2c }, - /*e*/ { 0x0c, 0x01, 0x16, 0x1b, 0x38, 0x35, 0x22, 0x2f, 0x64, 0x69, 0x7e, 0x73, 0x50, 0x5d, 0x4a, 0x47 }, - /*f*/ { 0xdc, 0xd1, 0xc6, 0xcb, 0xe8, 0xe5, 0xf2, 0xff, 0xb4, 0xb9, 0xae, 0xa3, 0x80, 0x8d, 0x9a, 0x97 }, -}; - -static uint8_t oaes_gf_mul_e[16][16] = { - // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, - /*0*/ { 0x00, 0x0e, 0x1c, 0x12, 0x38, 0x36, 0x24, 0x2a, 0x70, 0x7e, 0x6c, 0x62, 0x48, 0x46, 0x54, 0x5a }, - /*1*/ { 0xe0, 0xee, 0xfc, 0xf2, 0xd8, 0xd6, 0xc4, 0xca, 0x90, 0x9e, 0x8c, 0x82, 0xa8, 0xa6, 0xb4, 0xba }, - /*2*/ { 0xdb, 0xd5, 0xc7, 0xc9, 0xe3, 0xed, 0xff, 0xf1, 0xab, 0xa5, 0xb7, 0xb9, 0x93, 0x9d, 0x8f, 0x81 }, - /*3*/ { 0x3b, 0x35, 0x27, 0x29, 0x03, 0x0d, 0x1f, 0x11, 0x4b, 0x45, 0x57, 0x59, 0x73, 0x7d, 0x6f, 0x61 }, - /*4*/ { 0xad, 0xa3, 0xb1, 0xbf, 0x95, 0x9b, 0x89, 0x87, 0xdd, 0xd3, 0xc1, 0xcf, 0xe5, 0xeb, 0xf9, 0xf7 }, - /*5*/ { 0x4d, 0x43, 0x51, 0x5f, 0x75, 0x7b, 0x69, 0x67, 0x3d, 0x33, 0x21, 0x2f, 0x05, 0x0b, 0x19, 0x17 }, - /*6*/ { 0x76, 0x78, 0x6a, 0x64, 0x4e, 0x40, 0x52, 0x5c, 0x06, 0x08, 0x1a, 0x14, 0x3e, 0x30, 0x22, 0x2c }, - /*7*/ { 0x96, 0x98, 0x8a, 0x84, 0xae, 0xa0, 0xb2, 0xbc, 0xe6, 0xe8, 0xfa, 0xf4, 0xde, 0xd0, 0xc2, 0xcc }, - /*8*/ { 0x41, 0x4f, 0x5d, 0x53, 0x79, 0x77, 0x65, 0x6b, 0x31, 0x3f, 0x2d, 0x23, 0x09, 0x07, 0x15, 0x1b }, - /*9*/ { 0xa1, 0xaf, 0xbd, 0xb3, 0x99, 0x97, 0x85, 0x8b, 0xd1, 0xdf, 0xcd, 0xc3, 0xe9, 0xe7, 0xf5, 0xfb }, - /*a*/ { 0x9a, 0x94, 0x86, 0x88, 0xa2, 0xac, 0xbe, 0xb0, 0xea, 0xe4, 0xf6, 0xf8, 0xd2, 0xdc, 0xce, 0xc0 }, - /*b*/ { 0x7a, 0x74, 0x66, 0x68, 0x42, 0x4c, 0x5e, 0x50, 0x0a, 0x04, 0x16, 0x18, 0x32, 0x3c, 0x2e, 0x20 }, - /*c*/ { 0xec, 0xe2, 0xf0, 0xfe, 0xd4, 0xda, 0xc8, 0xc6, 0x9c, 0x92, 0x80, 0x8e, 0xa4, 0xaa, 0xb8, 0xb6 }, - /*d*/ { 0x0c, 0x02, 0x10, 0x1e, 0x34, 0x3a, 0x28, 0x26, 0x7c, 0x72, 0x60, 0x6e, 0x44, 0x4a, 0x58, 0x56 }, - /*e*/ { 0x37, 0x39, 0x2b, 0x25, 0x0f, 0x01, 0x13, 0x1d, 0x47, 0x49, 0x5b, 0x55, 0x7f, 0x71, 0x63, 0x6d }, - /*f*/ { 0xd7, 0xd9, 0xcb, 0xc5, 0xef, 0xe1, 0xf3, 0xfd, 0xa7, 0xa9, 0xbb, 0xb5, 0x9f, 0x91, 0x83, 0x8d }, -}; - -static OAES_RET oaes_sub_byte( uint8_t * byte ) -{ - size_t _x, _y; - - if( unlikely(NULL == byte) ) - return OAES_RET_ARG1; - - _y = ((_x = *byte) >> 4) & 0x0f; - _x &= 0x0f; - *byte = oaes_sub_byte_value[_y][_x]; - - return OAES_RET_SUCCESS; -} - -static OAES_RET oaes_inv_sub_byte( uint8_t * byte ) -{ - size_t _x, _y; - - if( NULL == byte ) - return OAES_RET_ARG1; - - _x = _y = *byte; - _x &= 0x0f; - _y &= 0xf0; - _y >>= 4; - *byte = oaes_inv_sub_byte_value[_y][_x]; - - return OAES_RET_SUCCESS; -} -/* -static OAES_RET oaes_word_rot_right( uint8_t word[OAES_COL_LEN] ) -{ - uint8_t _temp[OAES_COL_LEN]; - - if( NULL == word ) - return OAES_RET_ARG1; - - memcpy( _temp + 1, word, OAES_COL_LEN - 1 ); - _temp[0] = word[OAES_COL_LEN - 1]; - memcpy( word, _temp, OAES_COL_LEN ); - - return OAES_RET_SUCCESS; -} -*/ -static OAES_RET oaes_word_rot_left( uint8_t word[OAES_COL_LEN] ) -{ - uint8_t _temp[OAES_COL_LEN]; - - if( NULL == word ) - return OAES_RET_ARG1; - - memcpy( _temp, word + 1, OAES_COL_LEN - 1 ); - _temp[OAES_COL_LEN - 1] = word[0]; - memcpy( word, _temp, OAES_COL_LEN ); - - return OAES_RET_SUCCESS; -} - -static OAES_RET oaes_shift_rows( uint8_t block[OAES_BLOCK_SIZE] ) -{ - uint8_t _temp[] = { block[0x03], block[0x02], block[0x01], block[0x06], block[0x0b] }; - - if( unlikely(NULL == block) ) - return OAES_RET_ARG1; - - block[0x0b] = block[0x07]; - block[0x01] = block[0x05]; - block[0x02] = block[0x0a]; - block[0x03] = block[0x0f]; - block[0x05] = block[0x09]; - block[0x06] = block[0x0e]; - block[0x07] = _temp[0]; - block[0x09] = block[0x0d]; - block[0x0a] = _temp[1]; - block[0x0d] = _temp[2]; - block[0x0e] = _temp[3]; - block[0x0f] = _temp[4]; - - return OAES_RET_SUCCESS; -} - -static OAES_RET oaes_inv_shift_rows( uint8_t block[OAES_BLOCK_SIZE] ) -{ - uint8_t _temp[OAES_BLOCK_SIZE]; - - if( NULL == block ) - return OAES_RET_ARG1; - - _temp[0x00] = block[0x00]; - _temp[0x01] = block[0x0d]; - _temp[0x02] = block[0x0a]; - _temp[0x03] = block[0x07]; - _temp[0x04] = block[0x04]; - _temp[0x05] = block[0x01]; - _temp[0x06] = block[0x0e]; - _temp[0x07] = block[0x0b]; - _temp[0x08] = block[0x08]; - _temp[0x09] = block[0x05]; - _temp[0x0a] = block[0x02]; - _temp[0x0b] = block[0x0f]; - _temp[0x0c] = block[0x0c]; - _temp[0x0d] = block[0x09]; - _temp[0x0e] = block[0x06]; - _temp[0x0f] = block[0x03]; - memcpy( block, _temp, OAES_BLOCK_SIZE ); - - return OAES_RET_SUCCESS; -} - -static uint8_t oaes_gf_mul(uint8_t left, uint8_t right) -{ - size_t _x, _y; - - _y = ((_x = left) >> 4) & 0x0f; - _x &= 0x0f; - - switch( right ) - { - case 0x02: - return oaes_gf_mul_2[_y][_x]; - break; - case 0x03: - return oaes_gf_mul_3[_y][_x]; - break; - case 0x09: - return oaes_gf_mul_9[_y][_x]; - break; - case 0x0b: - return oaes_gf_mul_b[_y][_x]; - break; - case 0x0d: - return oaes_gf_mul_d[_y][_x]; - break; - case 0x0e: - return oaes_gf_mul_e[_y][_x]; - break; - default: - return left; - break; - } -} - -static OAES_RET oaes_mix_cols( uint8_t word[OAES_COL_LEN] ) -{ - uint8_t _temp[OAES_COL_LEN]; - - if( unlikely(NULL == word) ) - return OAES_RET_ARG1; - - _temp[0] = oaes_gf_mul(word[0], 0x02) ^ oaes_gf_mul( word[1], 0x03 ) ^ - word[2] ^ word[3]; - _temp[1] = word[0] ^ oaes_gf_mul( word[1], 0x02 ) ^ - oaes_gf_mul( word[2], 0x03 ) ^ word[3]; - _temp[2] = word[0] ^ word[1] ^ - oaes_gf_mul( word[2], 0x02 ) ^ oaes_gf_mul( word[3], 0x03 ); - _temp[3] = oaes_gf_mul( word[0], 0x03 ) ^ word[1] ^ - word[2] ^ oaes_gf_mul( word[3], 0x02 ); - memcpy( word, _temp, OAES_COL_LEN ); - - return OAES_RET_SUCCESS; -} - -static OAES_RET oaes_inv_mix_cols( uint8_t word[OAES_COL_LEN] ) -{ - uint8_t _temp[OAES_COL_LEN]; - - if( NULL == word ) - return OAES_RET_ARG1; - - _temp[0] = oaes_gf_mul( word[0], 0x0e ) ^ oaes_gf_mul( word[1], 0x0b ) ^ - oaes_gf_mul( word[2], 0x0d ) ^ oaes_gf_mul( word[3], 0x09 ); - _temp[1] = oaes_gf_mul( word[0], 0x09 ) ^ oaes_gf_mul( word[1], 0x0e ) ^ - oaes_gf_mul( word[2], 0x0b ) ^ oaes_gf_mul( word[3], 0x0d ); - _temp[2] = oaes_gf_mul( word[0], 0x0d ) ^ oaes_gf_mul( word[1], 0x09 ) ^ - oaes_gf_mul( word[2], 0x0e ) ^ oaes_gf_mul( word[3], 0x0b ); - _temp[3] = oaes_gf_mul( word[0], 0x0b ) ^ oaes_gf_mul( word[1], 0x0d ) ^ - oaes_gf_mul( word[2], 0x09 ) ^ oaes_gf_mul( word[3], 0x0e ); - memcpy( word, _temp, OAES_COL_LEN ); - - return OAES_RET_SUCCESS; -} - -OAES_RET oaes_sprintf( - char * buf, size_t * buf_len, const uint8_t * data, size_t data_len ) -{ - size_t _i, _buf_len_in; - char _temp[4]; - - if( NULL == buf_len ) - return OAES_RET_ARG2; - - _buf_len_in = *buf_len; - *buf_len = data_len * 3 + data_len / OAES_BLOCK_SIZE + 1; - - if( NULL == buf ) - return OAES_RET_SUCCESS; - - if( *buf_len > _buf_len_in ) - return OAES_RET_BUF; - - if( NULL == data ) - return OAES_RET_ARG3; - - strcpy( buf, "" ); - - for( _i = 0; _i < data_len; _i++ ) - { - sprintf( _temp, "%02x ", data[_i] ); - strcat( buf, _temp ); - if( _i && 0 == ( _i + 1 ) % OAES_BLOCK_SIZE ) - strcat( buf, "\n" ); - } - - return OAES_RET_SUCCESS; -} - -#ifdef OAES_HAVE_ISAAC -static void oaes_get_seed( char buf[RANDSIZ + 1] ) -{ - struct timeb timer; - struct tm *gmTimer; - char * _test = NULL; - - ftime (&timer); - gmTimer = gmtime( &timer.time ); - _test = (char *) calloc( sizeof( char ), timer.millitm ); - sprintf( buf, "%04d%02d%02d%02d%02d%02d%03d%p%d", - gmTimer->tm_year + 1900, gmTimer->tm_mon + 1, gmTimer->tm_mday, - gmTimer->tm_hour, gmTimer->tm_min, gmTimer->tm_sec, timer.millitm, - _test + timer.millitm, getpid() ); - - if( _test ) - free( _test ); -} -#else -static uint32_t oaes_get_seed(void) -{ - struct timeb timer; - struct tm *gmTimer; - char * _test = NULL; - uint32_t _ret = 0; - - ftime (&timer); - gmTimer = gmtime( &timer.time ); - _test = (char *) calloc( sizeof( char ), timer.millitm ); - _ret = (uint32_t)(gmTimer->tm_year + 1900 + gmTimer->tm_mon + 1 + gmTimer->tm_mday + - gmTimer->tm_hour + gmTimer->tm_min + gmTimer->tm_sec + timer.millitm + - (uintptr_t) ( _test + timer.millitm ) + getpid()); - - if( _test ) - free( _test ); - - return _ret; -} -#endif // OAES_HAVE_ISAAC - -static OAES_RET oaes_key_destroy( oaes_key ** key ) -{ - if( NULL == *key ) - return OAES_RET_SUCCESS; - - if( (*key)->data ) - { - free( (*key)->data ); - (*key)->data = NULL; - } - - if( (*key)->exp_data ) - { - free( (*key)->exp_data ); - (*key)->exp_data = NULL; - } - - (*key)->data_len = 0; - (*key)->exp_data_len = 0; - (*key)->num_keys = 0; - (*key)->key_base = 0; - free( *key ); - *key = NULL; - - return OAES_RET_SUCCESS; -} - -static OAES_RET oaes_key_expand( OAES_CTX * ctx ) -{ - size_t _i, _j; - oaes_ctx * _ctx = (oaes_ctx *) ctx; - uint8_t _temp[OAES_COL_LEN]; - - if( NULL == _ctx ) - return OAES_RET_ARG1; - - if( NULL == _ctx->key ) - return OAES_RET_NOKEY; - - _ctx->key->key_base = _ctx->key->data_len / OAES_RKEY_LEN; - _ctx->key->num_keys = _ctx->key->key_base + OAES_ROUND_BASE; - - _ctx->key->exp_data_len = _ctx->key->num_keys * OAES_RKEY_LEN * OAES_COL_LEN; - _ctx->key->exp_data = (uint8_t *) - calloc( _ctx->key->exp_data_len, sizeof( uint8_t )); - - if( NULL == _ctx->key->exp_data ) - return OAES_RET_MEM; - - // the first _ctx->key->data_len are a direct copy - memcpy( _ctx->key->exp_data, _ctx->key->data, _ctx->key->data_len ); - - // apply ExpandKey algorithm for remainder - for( _i = _ctx->key->key_base; _i < _ctx->key->num_keys * OAES_RKEY_LEN; _i++ ) - { - - memcpy( _temp, - _ctx->key->exp_data + ( _i - 1 ) * OAES_RKEY_LEN, OAES_COL_LEN ); - - // transform key column - if( 0 == _i % _ctx->key->key_base ) - { - oaes_word_rot_left( _temp ); - - for( _j = 0; _j < OAES_COL_LEN; _j++ ) - oaes_sub_byte( _temp + _j ); - - _temp[0] = _temp[0] ^ oaes_gf_8[ _i / _ctx->key->key_base - 1 ]; - } - else if( _ctx->key->key_base > 6 && 4 == _i % _ctx->key->key_base ) - { - for( _j = 0; _j < OAES_COL_LEN; _j++ ) - oaes_sub_byte( _temp + _j ); - } - - for( _j = 0; _j < OAES_COL_LEN; _j++ ) - { - _ctx->key->exp_data[ _i * OAES_RKEY_LEN + _j ] = - _ctx->key->exp_data[ ( _i - _ctx->key->key_base ) * - OAES_RKEY_LEN + _j ] ^ _temp[_j]; - } - } - - return OAES_RET_SUCCESS; -} - -static OAES_RET oaes_key_gen( OAES_CTX * ctx, size_t key_size ) -{ - size_t _i; - oaes_key * _key = NULL; - oaes_ctx * _ctx = (oaes_ctx *) ctx; - OAES_RET _rc = OAES_RET_SUCCESS; - - if( NULL == _ctx ) - return OAES_RET_ARG1; - - _key = (oaes_key *) calloc( sizeof( oaes_key ), 1 ); - - if( NULL == _key ) - return OAES_RET_MEM; - - if( _ctx->key ) - oaes_key_destroy( &(_ctx->key) ); - - _key->data_len = key_size; - _key->data = (uint8_t *) calloc( key_size, sizeof( uint8_t )); - - if( NULL == _key->data ) - return OAES_RET_MEM; - - for( _i = 0; _i < key_size; _i++ ) -#ifdef OAES_HAVE_ISAAC - _key->data[_i] = (uint8_t) rand( _ctx->rctx ); -#else - _key->data[_i] = (uint8_t) rand(); -#endif // OAES_HAVE_ISAAC - - _ctx->key = _key; - _rc = _rc ? _rc : oaes_key_expand( ctx ); - - if( _rc != OAES_RET_SUCCESS ) - { - oaes_key_destroy( &(_ctx->key) ); - return _rc; - } - - return OAES_RET_SUCCESS; -} - -OAES_RET oaes_key_gen_128( OAES_CTX * ctx ) -{ - return oaes_key_gen( ctx, 16 ); -} - -OAES_RET oaes_key_gen_192( OAES_CTX * ctx ) -{ - return oaes_key_gen( ctx, 24 ); -} - -OAES_RET oaes_key_gen_256( OAES_CTX * ctx ) -{ - return oaes_key_gen( ctx, 32 ); -} - -OAES_RET oaes_key_export( OAES_CTX * ctx, - uint8_t * data, size_t * data_len ) -{ - size_t _data_len_in; - oaes_ctx * _ctx = (oaes_ctx *) ctx; - - if( NULL == _ctx ) - return OAES_RET_ARG1; - - if( NULL == _ctx->key ) - return OAES_RET_NOKEY; - - if( NULL == data_len ) - return OAES_RET_ARG3; - - _data_len_in = *data_len; - // data + header - *data_len = _ctx->key->data_len + OAES_BLOCK_SIZE; - - if( NULL == data ) - return OAES_RET_SUCCESS; - - if( _data_len_in < *data_len ) - return OAES_RET_BUF; - - // header - memcpy( data, oaes_header, OAES_BLOCK_SIZE ); - data[5] = 0x01; - data[7] = (uint8_t)(_ctx->key->data_len); - memcpy( data + OAES_BLOCK_SIZE, _ctx->key->data, _ctx->key->data_len ); - - return OAES_RET_SUCCESS; -} - -OAES_RET oaes_key_export_data( OAES_CTX * ctx, - uint8_t * data, size_t * data_len ) -{ - size_t _data_len_in; - oaes_ctx * _ctx = (oaes_ctx *) ctx; - - if( NULL == _ctx ) - return OAES_RET_ARG1; - - if( NULL == _ctx->key ) - return OAES_RET_NOKEY; - - if( NULL == data_len ) - return OAES_RET_ARG3; - - _data_len_in = *data_len; - *data_len = _ctx->key->data_len; - - if( NULL == data ) - return OAES_RET_SUCCESS; - - if( _data_len_in < *data_len ) - return OAES_RET_BUF; - - memcpy( data, _ctx->key->data, *data_len ); - - return OAES_RET_SUCCESS; -} - -OAES_RET oaes_key_import( OAES_CTX * ctx, - const uint8_t * data, size_t data_len ) -{ - oaes_ctx * _ctx = (oaes_ctx *) ctx; - OAES_RET _rc = OAES_RET_SUCCESS; - int _key_length; - - if( NULL == _ctx ) - return OAES_RET_ARG1; - - if( NULL == data ) - return OAES_RET_ARG2; - - switch( data_len ) - { - case 16 + OAES_BLOCK_SIZE: - case 24 + OAES_BLOCK_SIZE: - case 32 + OAES_BLOCK_SIZE: - break; - default: - return OAES_RET_ARG3; - } - - // header - if( 0 != memcmp( data, oaes_header, 4 ) ) - return OAES_RET_HEADER; - - // header version - switch( data[4] ) - { - case 0x01: - break; - default: - return OAES_RET_HEADER; - } - - // header type - switch( data[5] ) - { - case 0x01: - break; - default: - return OAES_RET_HEADER; - } - - // options - _key_length = data[7]; - switch( _key_length ) - { - case 16: - case 24: - case 32: - break; - default: - return OAES_RET_HEADER; - } - - if( (int)data_len != _key_length + OAES_BLOCK_SIZE ) - return OAES_RET_ARG3; - - if( _ctx->key ) - oaes_key_destroy( &(_ctx->key) ); - - _ctx->key = (oaes_key *) calloc( sizeof( oaes_key ), 1 ); - - if( NULL == _ctx->key ) - return OAES_RET_MEM; - - _ctx->key->data_len = _key_length; - _ctx->key->data = (uint8_t *) - calloc( _key_length, sizeof( uint8_t )); - - if( NULL == _ctx->key->data ) - { - oaes_key_destroy( &(_ctx->key) ); - return OAES_RET_MEM; - } - - memcpy( _ctx->key->data, data + OAES_BLOCK_SIZE, _key_length ); - _rc = _rc ? _rc : oaes_key_expand( ctx ); - - if( _rc != OAES_RET_SUCCESS ) - { - oaes_key_destroy( &(_ctx->key) ); - return _rc; - } - - return OAES_RET_SUCCESS; -} - -OAES_RET oaes_key_import_data( OAES_CTX * ctx, - const uint8_t * data, size_t data_len ) -{ - oaes_ctx * _ctx = (oaes_ctx *) ctx; - OAES_RET _rc = OAES_RET_SUCCESS; - - if( NULL == _ctx ) - return OAES_RET_ARG1; - - if( NULL == data ) - return OAES_RET_ARG2; - - switch( data_len ) - { - case 16: - case 24: - case 32: - break; - default: - return OAES_RET_ARG3; - } - - if( _ctx->key ) - oaes_key_destroy( &(_ctx->key) ); - - _ctx->key = (oaes_key *) calloc( sizeof( oaes_key ), 1 ); - - if( NULL == _ctx->key ) - return OAES_RET_MEM; - - _ctx->key->data_len = data_len; - _ctx->key->data = (uint8_t *) - calloc( data_len, sizeof( uint8_t )); - - if( NULL == _ctx->key->data ) - { - oaes_key_destroy( &(_ctx->key) ); - return OAES_RET_MEM; - } - - memcpy( _ctx->key->data, data, data_len ); - _rc = _rc ? _rc : oaes_key_expand( ctx ); - - if( _rc != OAES_RET_SUCCESS ) - { - oaes_key_destroy( &(_ctx->key) ); - return _rc; - } - - return OAES_RET_SUCCESS; -} - -OAES_CTX * oaes_alloc(void) -{ - oaes_ctx * _ctx = (oaes_ctx *) calloc(sizeof(oaes_ctx), 1); - if(!_ctx) - return NULL; - -#ifdef OAES_HAVE_ISAAC - { - ub4 _i = 0; - char _seed[RANDSIZ + 1]; - - _ctx->rctx = (randctx *) calloc(sizeof(randctx), 1); - if(!_ctx->rctx) { - free(_ctx); - return NULL; - } - - oaes_get_seed( _seed ); - memset( _ctx->rctx->randrsl, 0, RANDSIZ ); - memcpy( _ctx->rctx->randrsl, _seed, RANDSIZ ); - randinit( _ctx->rctx, TRUE); - } -#else - srand( oaes_get_seed() ); -#endif // OAES_HAVE_ISAAC - - _ctx->key = NULL; - oaes_set_option( _ctx, OAES_OPTION_CBC, NULL ); - -#ifdef OAES_DEBUG - _ctx->step_cb = NULL; - oaes_set_option( _ctx, OAES_OPTION_STEP_OFF, NULL ); -#endif // OAES_DEBUG - - return (OAES_CTX *) _ctx; -} - -OAES_RET oaes_free(OAES_CTX ** ctx) -{ - oaes_ctx ** _ctx = (oaes_ctx **) ctx; - - if(!_ctx) - return OAES_RET_ARG1; - - if(!*_ctx) - return OAES_RET_SUCCESS; - - if( (*_ctx)->key ) - oaes_key_destroy( &((*_ctx)->key) ); - -#ifdef OAES_HAVE_ISAAC - if( (*_ctx)->rctx ) - { - free( (*_ctx)->rctx ); - (*_ctx)->rctx = NULL; - } -#endif // OAES_HAVE_ISAAC - - free( *_ctx ); - *_ctx = NULL; - - return OAES_RET_SUCCESS; -} - -OAES_RET oaes_set_option(OAES_CTX * ctx, OAES_OPTION option, const void * value) -{ - size_t _i; - oaes_ctx * _ctx = (oaes_ctx *) ctx; - - if( NULL == _ctx ) - return OAES_RET_ARG1; - - switch( option ) - { - case OAES_OPTION_ECB: - _ctx->options &= ~OAES_OPTION_CBC; - memset( _ctx->iv, 0, OAES_BLOCK_SIZE ); - break; - - case OAES_OPTION_CBC: - _ctx->options &= ~OAES_OPTION_ECB; - if( value ) - memcpy( _ctx->iv, value, OAES_BLOCK_SIZE ); - else - { - for( _i = 0; _i < OAES_BLOCK_SIZE; _i++ ) -#ifdef OAES_HAVE_ISAAC - _ctx->iv[_i] = (uint8_t) rand( _ctx->rctx ); -#else - _ctx->iv[_i] = (uint8_t) rand(); -#endif // OAES_HAVE_ISAAC - } - break; - -#ifdef OAES_DEBUG - - case OAES_OPTION_STEP_ON: - if( value ) - { - _ctx->options &= ~OAES_OPTION_STEP_OFF; - _ctx->step_cb = value; - } - else - { - _ctx->options &= ~OAES_OPTION_STEP_ON; - _ctx->options |= OAES_OPTION_STEP_OFF; - _ctx->step_cb = NULL; - return OAES_RET_ARG3; - } - break; - - case OAES_OPTION_STEP_OFF: - _ctx->options &= ~OAES_OPTION_STEP_ON; - _ctx->step_cb = NULL; - break; - -#endif // OAES_DEBUG - - default: - return OAES_RET_ARG2; - } - - _ctx->options |= option; - - return OAES_RET_SUCCESS; -} - -static OAES_RET oaes_encrypt_block(OAES_CTX * ctx, uint8_t * c, size_t c_len) -{ - size_t _i, _j; - oaes_ctx * _ctx = (oaes_ctx *) ctx; - - if( NULL == _ctx ) - return OAES_RET_ARG1; - - if( NULL == c ) - return OAES_RET_ARG2; - - if( c_len != OAES_BLOCK_SIZE ) - return OAES_RET_ARG3; - - if( NULL == _ctx->key ) - return OAES_RET_NOKEY; - -#ifdef OAES_DEBUG - if( _ctx->step_cb ) - _ctx->step_cb( c, "input", 1, NULL ); -#endif // OAES_DEBUG - - // AddRoundKey(State, K0) - for( _i = 0; _i < c_len; _i++ ) - c[_i] = c[_i] ^ _ctx->key->exp_data[_i]; - -#ifdef OAES_DEBUG - if( _ctx->step_cb ) - { - _ctx->step_cb( _ctx->key->exp_data, "k_sch", 1, NULL ); - _ctx->step_cb( c, "k_add", 1, NULL ); - } -#endif // OAES_DEBUG - - // for round = 1 step 1 to Nr–1 - for( _i = 1; _i < _ctx->key->num_keys - 1; _i++ ) - { - // SubBytes(state) - for( _j = 0; _j < c_len; _j++ ) - oaes_sub_byte( c + _j ); - -#ifdef OAES_DEBUG - if( _ctx->step_cb ) - _ctx->step_cb( c, "s_box", _i, NULL ); -#endif // OAES_DEBUG - - // ShiftRows(state) - oaes_shift_rows( c ); - -#ifdef OAES_DEBUG - if( _ctx->step_cb ) - _ctx->step_cb( c, "s_row", _i, NULL ); -#endif // OAES_DEBUG - - // MixColumns(state) - oaes_mix_cols( c ); - oaes_mix_cols( c + 4 ); - oaes_mix_cols( c + 8 ); - oaes_mix_cols( c + 12 ); - -#ifdef OAES_DEBUG - if( _ctx->step_cb ) - _ctx->step_cb( c, "m_col", _i, NULL ); -#endif // OAES_DEBUG - - // AddRoundKey(state, w[round*Nb, (round+1)*Nb-1]) - for( _j = 0; _j < c_len; _j++ ) - c[_j] = c[_j] ^ - _ctx->key->exp_data[_i * OAES_RKEY_LEN * OAES_COL_LEN + _j]; - -#ifdef OAES_DEBUG - if( _ctx->step_cb ) - { - _ctx->step_cb( _ctx->key->exp_data + _i * OAES_RKEY_LEN * OAES_COL_LEN, - "k_sch", _i, NULL ); - _ctx->step_cb( c, "k_add", _i, NULL ); - } -#endif // OAES_DEBUG - - } - - // SubBytes(state) - for( _i = 0; _i < c_len; _i++ ) - oaes_sub_byte( c + _i ); - -#ifdef OAES_DEBUG - if( _ctx->step_cb ) - _ctx->step_cb( c, "s_box", _ctx->key->num_keys - 1, NULL ); -#endif // OAES_DEBUG - - // ShiftRows(state) - oaes_shift_rows( c ); - -#ifdef OAES_DEBUG - if( _ctx->step_cb ) - _ctx->step_cb( c, "s_row", _ctx->key->num_keys - 1, NULL ); -#endif // OAES_DEBUG - - // AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1]) - for( _i = 0; _i < c_len; _i++ ) - c[_i] = c[_i] ^ _ctx->key->exp_data[ - ( _ctx->key->num_keys - 1 ) * OAES_RKEY_LEN * OAES_COL_LEN + _i ]; - -#ifdef OAES_DEBUG - if( _ctx->step_cb ) - { - _ctx->step_cb( _ctx->key->exp_data + - ( _ctx->key->num_keys - 1 ) * OAES_RKEY_LEN * OAES_COL_LEN, - "k_sch", _ctx->key->num_keys - 1, NULL ); - _ctx->step_cb( c, "output", _ctx->key->num_keys - 1, NULL ); - } -#endif // OAES_DEBUG - - return OAES_RET_SUCCESS; -} - -static OAES_RET oaes_decrypt_block(OAES_CTX * ctx, uint8_t * c, size_t c_len) -{ - size_t _i, _j; - oaes_ctx * _ctx = (oaes_ctx *) ctx; - - if( NULL == _ctx ) - return OAES_RET_ARG1; - - if( NULL == c ) - return OAES_RET_ARG2; - - if( c_len != OAES_BLOCK_SIZE ) - return OAES_RET_ARG3; - - if( NULL == _ctx->key ) - return OAES_RET_NOKEY; - -#ifdef OAES_DEBUG - if( _ctx->step_cb ) - _ctx->step_cb( c, "iinput", _ctx->key->num_keys - 1, NULL ); -#endif // OAES_DEBUG - - // AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1]) - for( _i = 0; _i < c_len; _i++ ) - c[_i] = c[_i] ^ _ctx->key->exp_data[ - ( _ctx->key->num_keys - 1 ) * OAES_RKEY_LEN * OAES_COL_LEN + _i ]; - -#ifdef OAES_DEBUG - if( _ctx->step_cb ) - { - _ctx->step_cb( _ctx->key->exp_data + - ( _ctx->key->num_keys - 1 ) * OAES_RKEY_LEN * OAES_COL_LEN, - "ik_sch", _ctx->key->num_keys - 1, NULL ); - _ctx->step_cb( c, "ik_add", _ctx->key->num_keys - 1, NULL ); - } -#endif // OAES_DEBUG - - for( _i = _ctx->key->num_keys - 2; _i > 0; _i-- ) - { - // InvShiftRows(state) - oaes_inv_shift_rows( c ); - -#ifdef OAES_DEBUG - if( _ctx->step_cb ) - _ctx->step_cb( c, "is_row", _i, NULL ); -#endif // OAES_DEBUG - - // InvSubBytes(state) - for( _j = 0; _j < c_len; _j++ ) - oaes_inv_sub_byte( c + _j ); - -#ifdef OAES_DEBUG - if( _ctx->step_cb ) - _ctx->step_cb( c, "is_box", _i, NULL ); -#endif // OAES_DEBUG - - // AddRoundKey(state, w[round*Nb, (round+1)*Nb-1]) - for( _j = 0; _j < c_len; _j++ ) - c[_j] = c[_j] ^ - _ctx->key->exp_data[_i * OAES_RKEY_LEN * OAES_COL_LEN + _j]; - -#ifdef OAES_DEBUG - if( _ctx->step_cb ) - { - _ctx->step_cb( _ctx->key->exp_data + _i * OAES_RKEY_LEN * OAES_COL_LEN, - "ik_sch", _i, NULL ); - _ctx->step_cb( c, "ik_add", _i, NULL ); - } -#endif // OAES_DEBUG - - // InvMixColums(state) - oaes_inv_mix_cols( c ); - oaes_inv_mix_cols( c + 4 ); - oaes_inv_mix_cols( c + 8 ); - oaes_inv_mix_cols( c + 12 ); - -#ifdef OAES_DEBUG - if( _ctx->step_cb ) - _ctx->step_cb( c, "im_col", _i, NULL ); -#endif // OAES_DEBUG - - } - - // InvShiftRows(state) - oaes_inv_shift_rows( c ); - -#ifdef OAES_DEBUG - if( _ctx->step_cb ) - _ctx->step_cb( c, "is_row", 1, NULL ); -#endif // OAES_DEBUG - - // InvSubBytes(state) - for( _i = 0; _i < c_len; _i++ ) - oaes_inv_sub_byte( c + _i ); - -#ifdef OAES_DEBUG - if( _ctx->step_cb ) - _ctx->step_cb( c, "is_box", 1, NULL ); -#endif // OAES_DEBUG - - // AddRoundKey(state, w[0, Nb-1]) - for( _i = 0; _i < c_len; _i++ ) - c[_i] = c[_i] ^ _ctx->key->exp_data[_i]; - -#ifdef OAES_DEBUG - if( _ctx->step_cb ) - { - _ctx->step_cb( _ctx->key->exp_data, "ik_sch", 1, NULL ); - _ctx->step_cb( c, "ioutput", 1, NULL ); - } -#endif // OAES_DEBUG - - return OAES_RET_SUCCESS; -} - -OAES_RET oaes_encrypt(OAES_CTX * ctx, const uint8_t * m, size_t m_len, uint8_t * c, size_t * c_len) -{ - size_t _i, _j, _c_len_in, _c_data_len; - size_t _pad_len = m_len % OAES_BLOCK_SIZE == 0 ? - 0 : OAES_BLOCK_SIZE - m_len % OAES_BLOCK_SIZE; - oaes_ctx * _ctx = (oaes_ctx *) ctx; - OAES_RET _rc = OAES_RET_SUCCESS; - uint8_t _flags = _pad_len ? OAES_FLAG_PAD : 0; - - if( NULL == _ctx ) - return OAES_RET_ARG1; - - if( NULL == m ) - return OAES_RET_ARG2; - - if( NULL == c_len ) - return OAES_RET_ARG5; - - _c_len_in = *c_len; - // data + pad - _c_data_len = m_len + _pad_len; - // header + iv + data + pad - *c_len = 2 * OAES_BLOCK_SIZE + m_len + _pad_len; - - if( NULL == c ) - return OAES_RET_SUCCESS; - - if( _c_len_in < *c_len ) - return OAES_RET_BUF; - - if( NULL == _ctx->key ) - return OAES_RET_NOKEY; - - // header - memcpy(c, oaes_header, OAES_BLOCK_SIZE ); - memcpy(c + 6, &_ctx->options, sizeof(_ctx->options)); - memcpy(c + 8, &_flags, sizeof(_flags)); - // iv - memcpy(c + OAES_BLOCK_SIZE, _ctx->iv, OAES_BLOCK_SIZE ); - // data - memcpy(c + 2 * OAES_BLOCK_SIZE, m, m_len ); - - for( _i = 0; _i < _c_data_len; _i += OAES_BLOCK_SIZE ) - { - uint8_t _block[OAES_BLOCK_SIZE]; - size_t _block_size = min( m_len - _i, OAES_BLOCK_SIZE ); - - memcpy( _block, c + 2 * OAES_BLOCK_SIZE + _i, _block_size ); - - // insert pad - for( _j = 0; _j < OAES_BLOCK_SIZE - _block_size; _j++ ) - _block[ _block_size + _j ] = (uint8_t)_j + 1; - - // CBC - if( _ctx->options & OAES_OPTION_CBC ) - { - for( _j = 0; _j < OAES_BLOCK_SIZE; _j++ ) - _block[_j] = _block[_j] ^ _ctx->iv[_j]; - } - - _rc = _rc ? _rc : - oaes_encrypt_block( ctx, _block, OAES_BLOCK_SIZE ); - memcpy( c + 2 * OAES_BLOCK_SIZE + _i, _block, OAES_BLOCK_SIZE ); - - if( _ctx->options & OAES_OPTION_CBC ) - memcpy( _ctx->iv, _block, OAES_BLOCK_SIZE ); - } - - return _rc; -} - -OAES_RET oaes_decrypt(OAES_CTX * ctx, const uint8_t * c, size_t c_len, uint8_t * m, size_t * m_len) -{ - size_t _i, _j, _m_len_in; - oaes_ctx * _ctx = (oaes_ctx *) ctx; - OAES_RET _rc = OAES_RET_SUCCESS; - uint8_t _iv[OAES_BLOCK_SIZE]; - uint8_t _flags; - OAES_OPTION _options; - - if( NULL == ctx ) - return OAES_RET_ARG1; - - if( NULL == c ) - return OAES_RET_ARG2; - - if( c_len % OAES_BLOCK_SIZE ) - return OAES_RET_ARG3; - - if( NULL == m_len ) - return OAES_RET_ARG5; - - _m_len_in = *m_len; - *m_len = c_len - 2 * OAES_BLOCK_SIZE; - - if( NULL == m ) - return OAES_RET_SUCCESS; - - if( _m_len_in < *m_len ) - return OAES_RET_BUF; - - if( NULL == _ctx->key ) - return OAES_RET_NOKEY; - - // header - if( 0 != memcmp( c, oaes_header, 4 ) ) - return OAES_RET_HEADER; - - // header version - switch( c[4] ) - { - case 0x01: - break; - default: - return OAES_RET_HEADER; - } - - // header type - switch( c[5] ) - { - case 0x02: - break; - default: - return OAES_RET_HEADER; - } - - // options - memcpy(&_options, c + 6, sizeof(_options)); - // validate that all options are valid - if( _options & ~( - OAES_OPTION_ECB - | OAES_OPTION_CBC -#ifdef OAES_DEBUG - | OAES_OPTION_STEP_ON - | OAES_OPTION_STEP_OFF -#endif // OAES_DEBUG - ) ) - return OAES_RET_HEADER; - if( ( _options & OAES_OPTION_ECB ) && - ( _options & OAES_OPTION_CBC ) ) - return OAES_RET_HEADER; - if( _options == OAES_OPTION_NONE ) - return OAES_RET_HEADER; - - // flags - memcpy(&_flags, c + 8, sizeof(_flags)); - // validate that all flags are valid - if( _flags & ~( - OAES_FLAG_PAD - ) ) - return OAES_RET_HEADER; - - // iv - memcpy( _iv, c + OAES_BLOCK_SIZE, OAES_BLOCK_SIZE); - // data + pad - memcpy( m, c + 2 * OAES_BLOCK_SIZE, *m_len ); - - for( _i = 0; _i < *m_len; _i += OAES_BLOCK_SIZE ) - { - if( ( _options & OAES_OPTION_CBC ) && _i > 0 ) - memcpy( _iv, c + OAES_BLOCK_SIZE + _i, OAES_BLOCK_SIZE ); - - _rc = _rc ? _rc : - oaes_decrypt_block( ctx, m + _i, min( *m_len - _i, OAES_BLOCK_SIZE ) ); - - // CBC - if( _options & OAES_OPTION_CBC ) - { - for( _j = 0; _j < OAES_BLOCK_SIZE; _j++ ) - m[ _i + _j ] = m[ _i + _j ] ^ _iv[_j]; - } - } - - // remove pad - if( _flags & OAES_FLAG_PAD ) - { - int _is_pad = 1; - size_t _temp = (size_t) m[*m_len - 1]; - - if( _temp <= 0x00 || _temp > 0x0f ) - return OAES_RET_HEADER; - for( _i = 0; _i < _temp; _i++ ) - if( m[*m_len - 1 - _i] != _temp - _i ) - _is_pad = 0; - if( _is_pad ) - { - memset( m + *m_len - _temp, 0, _temp ); - *m_len -= _temp; - } - else - return OAES_RET_HEADER; - } - - return OAES_RET_SUCCESS; -} - -OAES_API OAES_RET oaes_encryption_round(const uint8_t * key, uint8_t * c) -{ - size_t _i; - - if(!key) - return OAES_RET_ARG1; - - if(!c) - return OAES_RET_ARG2; - - // SubBytes(state) - for(_i = 0; _i < OAES_BLOCK_SIZE; _i++) - oaes_sub_byte( c + _i ); - - // ShiftRows(state) - oaes_shift_rows( c ); - - // MixColumns(state) - oaes_mix_cols( c ); - oaes_mix_cols( c + 4 ); - oaes_mix_cols( c + 8 ); - oaes_mix_cols( c + 12 ); - - // AddRoundKey(State, key) - for( _i = 0; _i < OAES_BLOCK_SIZE; _i++ ) - c[_i] ^= key[_i]; - - return OAES_RET_SUCCESS; -} - -OAES_API OAES_RET oaes_pseudo_encrypt_ecb(OAES_CTX * ctx, uint8_t * c) -{ - oaes_ctx * _ctx = (oaes_ctx *) ctx; - size_t _i; - - if(!_ctx) - return OAES_RET_ARG1; - - if(!c) - return OAES_RET_ARG2; - - if(!_ctx->key) - return OAES_RET_NOKEY; - - for (_i = 0; _i < 10; _i++) - oaes_encryption_round(&_ctx->key->exp_data[_i * OAES_RKEY_LEN * OAES_COL_LEN], c); - - return OAES_RET_SUCCESS; -} diff --git a/crypto/oaes_lib.h b/crypto/oaes_lib.h deleted file mode 100644 index c48bad46..00000000 --- a/crypto/oaes_lib.h +++ /dev/null @@ -1,214 +0,0 @@ -/* - * --------------------------------------------------------------------------- - * OpenAES License - * --------------------------------------------------------------------------- - * Copyright (c) 2012, Nabil S. Al Ramli, www.nalramli.com - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * --------------------------------------------------------------------------- - */ - -#ifndef _OAES_LIB_H -#define _OAES_LIB_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef _WIN32 -# ifdef OAES_SHARED -# ifdef oaes_lib_EXPORTS -# define OAES_API __declspec(dllexport) -# else -# define OAES_API __declspec(dllimport) -# endif -# else -# define OAES_API -# endif -#else -# define OAES_API -#endif // WIN32 - -#define OAES_VERSION "0.8.1" -#define OAES_BLOCK_SIZE 16 - -typedef void OAES_CTX; - -typedef enum -{ - OAES_RET_FIRST = 0, - OAES_RET_SUCCESS = 0, - OAES_RET_UNKNOWN, - OAES_RET_ARG1, - OAES_RET_ARG2, - OAES_RET_ARG3, - OAES_RET_ARG4, - OAES_RET_ARG5, - OAES_RET_NOKEY, - OAES_RET_MEM, - OAES_RET_BUF, - OAES_RET_HEADER, - OAES_RET_COUNT -} OAES_RET; - -/* - * oaes_set_option() takes one of these values for its [option] parameter - * some options accept either an optional or a required [value] parameter - */ -// no option -#define OAES_OPTION_NONE 0 -// enable ECB mode, disable CBC mode -#define OAES_OPTION_ECB 1 -// enable CBC mode, disable ECB mode -// value is optional, may pass uint8_t iv[OAES_BLOCK_SIZE] to specify -// the value of the initialization vector, iv -#define OAES_OPTION_CBC 2 - -#ifdef OAES_DEBUG -typedef int ( * oaes_step_cb ) ( - const uint8_t state[OAES_BLOCK_SIZE], - const char * step_name, - int step_count, - void * user_data ); -// enable state stepping mode -// value is required, must pass oaes_step_cb to receive the state at each step -#define OAES_OPTION_STEP_ON 4 -// disable state stepping mode -#define OAES_OPTION_STEP_OFF 8 -#endif // OAES_DEBUG - -typedef uint16_t OAES_OPTION; - -typedef struct _oaes_key -{ - size_t data_len; - uint8_t *data; - size_t exp_data_len; - uint8_t *exp_data; - size_t num_keys; - size_t key_base; -} oaes_key; - -typedef struct _oaes_ctx -{ -#ifdef OAES_HAVE_ISAAC - randctx * rctx; -#endif // OAES_HAVE_ISAAC - -#ifdef OAES_DEBUG - oaes_step_cb step_cb; -#endif // OAES_DEBUG - - oaes_key * key; - OAES_OPTION options; - uint8_t iv[OAES_BLOCK_SIZE]; -} oaes_ctx; -/* - * // usage: - * - * OAES_CTX * ctx = oaes_alloc(); - * . - * . - * . - * { - * oaes_gen_key_xxx( ctx ); - * { - * oaes_key_export( ctx, _buf, &_buf_len ); - * // or - * oaes_key_export_data( ctx, _buf, &_buf_len );\ - * } - * } - * // or - * { - * oaes_key_import( ctx, _buf, _buf_len ); - * // or - * oaes_key_import_data( ctx, _buf, _buf_len ); - * } - * . - * . - * . - * oaes_encrypt( ctx, m, m_len, c, &c_len ); - * . - * . - * . - * oaes_decrypt( ctx, c, c_len, m, &m_len ); - * . - * . - * . - * oaes_free( &ctx ); - */ - -OAES_API OAES_CTX * oaes_alloc(void); - -OAES_API OAES_RET oaes_free( OAES_CTX ** ctx ); - -OAES_API OAES_RET oaes_set_option( OAES_CTX * ctx, - OAES_OPTION option, const void * value ); - -OAES_API OAES_RET oaes_key_gen_128( OAES_CTX * ctx ); - -OAES_API OAES_RET oaes_key_gen_192( OAES_CTX * ctx ); - -OAES_API OAES_RET oaes_key_gen_256( OAES_CTX * ctx ); - -// export key with header information -// set data == NULL to get the required data_len -OAES_API OAES_RET oaes_key_export( OAES_CTX * ctx, - uint8_t * data, size_t * data_len ); - -// directly export the data from key -// set data == NULL to get the required data_len -OAES_API OAES_RET oaes_key_export_data( OAES_CTX * ctx, - uint8_t * data, size_t * data_len ); - -// import key with header information -OAES_API OAES_RET oaes_key_import( OAES_CTX * ctx, - const uint8_t * data, size_t data_len ); - -// directly import data into key -OAES_API OAES_RET oaes_key_import_data( OAES_CTX * ctx, - const uint8_t * data, size_t data_len ); - -// set c == NULL to get the required c_len -OAES_API OAES_RET oaes_encrypt( OAES_CTX * ctx, - const uint8_t * m, size_t m_len, uint8_t * c, size_t * c_len ); - -// set m == NULL to get the required m_len -OAES_API OAES_RET oaes_decrypt( OAES_CTX * ctx, - const uint8_t * c, size_t c_len, uint8_t * m, size_t * m_len ); - -// set buf == NULL to get the required buf_len -OAES_API OAES_RET oaes_sprintf( - char * buf, size_t * buf_len, const uint8_t * data, size_t data_len ); - -OAES_API OAES_RET oaes_encryption_round( const uint8_t * key, uint8_t * c ); - -OAES_API OAES_RET oaes_pseudo_encrypt_ecb( OAES_CTX * ctx, uint8_t * c ); - -#ifdef __cplusplus -} -#endif - -#endif // _OAES_LIB_H diff --git a/crypto/wildkeccak-cpu.cpp b/crypto/wildkeccak-cpu.cpp deleted file mode 100644 index 64686b06..00000000 --- a/crypto/wildkeccak-cpu.cpp +++ /dev/null @@ -1,376 +0,0 @@ -// Memory-hard extension of keccak for PoW -// Copyright (c) 2012-2013 The Cryptonote developers -// Copyright (c) 2014 The Boolberry developers - -// Distributed under the MIT/X11 software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -// Modified for CPUminer by Lucas Jones -// Adapted for ccminer by Tanguy Pruvot - 2016 - -#include -#include -#include -#include - -#ifdef _MSC_VER -#include -#include -#if OPENSSL_VERSION_NUMBER < 0x10100000L -#include "compat/bignum_ssl10.hpp" -#else -#include "bignum.hpp" -#endif -#include "int128_c.h" -#else -#include -#endif - -#include - -#include "xmr-rpc.h" - -extern uint64_t* pscratchpad_buff; - -struct reciprocal_value64 { - uint64_t m; - uint8_t sh1, sh2; -}; - -static inline int fls64(uint64_t x) -{ -#if defined(_WIN64) - unsigned long bitpos = 0; - _BitScanReverse64(&bitpos, x); - return (int) (bitpos + 1); -#elif defined(WIN32) - unsigned long hipos = 0, bitpos = 0; - uint32_t hi = x >> 32; - _BitScanReverse(&hipos, hi); - if (!hipos) { - _BitScanReverse(&bitpos, (uint32_t) x); - } - return (int) hipos ? hipos + 33 : bitpos + 1; -#else - /* - * AMD64 says BSRQ won't clobber the dest reg if x==0; Intel64 says the - * dest reg is undefined if x==0, but their CPU architect says its - * value is written to set it to the same as before. - */ - register long bitpos = -1; - asm("bsrq %1,%0" : "+r" (bitpos) : "rm" (x)); - return bitpos + 1; -#endif -} - -static inline struct reciprocal_value64 reciprocal_val64(uint64_t d) -{ - struct reciprocal_value64 R; - int l; - - l = fls64(d - 1); - -#ifdef _MSC_VER - uint128 v1; - v1.Lo = (1ULL << l) - d;v1.Hi=0; - uint128 v2; - v2.Hi = 1; v2.Lo = 0; - - uint128 v; - mult128(v1,v2,&v); - divmod128by64(v.Hi,v.Lo,d,&v.Hi,&v.Lo); - Increment(&v); - R.m = (uint64_t)v.Hi; -#else - __uint128_t m; - m = (((__uint128_t)1 << 64) * ((1ULL << l) - d)); - m /= d; - ++m; - R.m = (uint64_t)m; -#endif - - R.sh1 = min(l, 1); - R.sh2 = max(l - 1, 0); - - return R; -} - -static inline uint64_t reciprocal_divide64(uint64_t a, struct reciprocal_value64 R) -{ -#ifdef _MSC_VER - uint128 v; - mult64to128(a,R.m,&v.Hi,&v.Lo); - uint64_t t = v.Hi; -#else - uint64_t t = (uint64_t)(((__uint128_t)a * R.m) >> 64); -#endif - return (t + ((a - t) >> R.sh1)) >> R.sh2; -} - -static inline uint64_t reciprocal_remainder64(uint64_t A, uint64_t B, struct reciprocal_value64 R) -{ - uint64_t div, mod; - - div = reciprocal_divide64(A, R); - mod = A - (uint64_t) (div * B); - if (mod >= B) mod -= B; - return mod; -} - -//#define UNROLL_SCR_MIX - -static inline uint64_t rotl641(uint64_t x) { return((x << 1) | (x >> 63)); } -static inline uint64_t rotl64_1(uint64_t x, uint64_t y) { return((x << y) | (x >> (64 - y))); } -static inline uint64_t rotl64_2(uint64_t x, uint64_t y) { return(rotl64_1((x >> 32) | (x << 32), y)); } -static inline uint64_t bitselect(uint64_t a, uint64_t b, uint64_t c) { return(a ^ (c & (b ^ a))); } - -static inline void keccakf_mul(uint64_t *s) -{ - uint64_t bc[5], t[5]; - uint64_t tmp1, tmp2; - int i; - - for(i = 0; i < 5; i++) - t[i] = s[i + 0] ^ s[i + 5] ^ s[i + 10] * s[i + 15] * s[i + 20]; - - bc[0] = t[0] ^ rotl641(t[2]); - bc[1] = t[1] ^ rotl641(t[3]); - bc[2] = t[2] ^ rotl641(t[4]); - bc[3] = t[3] ^ rotl641(t[0]); - bc[4] = t[4] ^ rotl641(t[1]); - - tmp1 = s[1] ^ bc[0]; - - s[ 0] ^= bc[4]; - s[ 1] = rotl64_1(s[ 6] ^ bc[0], 44); - s[ 6] = rotl64_1(s[ 9] ^ bc[3], 20); - s[ 9] = rotl64_1(s[22] ^ bc[1], 61); - s[22] = rotl64_1(s[14] ^ bc[3], 39); - s[14] = rotl64_1(s[20] ^ bc[4], 18); - s[20] = rotl64_1(s[ 2] ^ bc[1], 62); - s[ 2] = rotl64_1(s[12] ^ bc[1], 43); - s[12] = rotl64_1(s[13] ^ bc[2], 25); - s[13] = rotl64_1(s[19] ^ bc[3], 8); - s[19] = rotl64_1(s[23] ^ bc[2], 56); - s[23] = rotl64_1(s[15] ^ bc[4], 41); - s[15] = rotl64_1(s[ 4] ^ bc[3], 27); - s[ 4] = rotl64_1(s[24] ^ bc[3], 14); - s[24] = rotl64_1(s[21] ^ bc[0], 2); - s[21] = rotl64_1(s[ 8] ^ bc[2], 55); - s[ 8] = rotl64_1(s[16] ^ bc[0], 45); - s[16] = rotl64_1(s[ 5] ^ bc[4], 36); - s[ 5] = rotl64_1(s[ 3] ^ bc[2], 28); - s[ 3] = rotl64_1(s[18] ^ bc[2], 21); - s[18] = rotl64_1(s[17] ^ bc[1], 15); - s[17] = rotl64_1(s[11] ^ bc[0], 10); - s[11] = rotl64_1(s[ 7] ^ bc[1], 6); - s[ 7] = rotl64_1(s[10] ^ bc[4], 3); - s[10] = rotl64_1(tmp1, 1); - - tmp1 = s[0]; tmp2 = s[1]; s[0] = bitselect(s[0] ^ s[2], s[0], s[1]); s[1] = bitselect(s[1] ^ s[3], s[1], s[2]); s[2] = bitselect(s[2] ^ s[4], s[2], s[3]); s[3] = bitselect(s[3] ^ tmp1, s[3], s[4]); s[4] = bitselect(s[4] ^ tmp2, s[4], tmp1); - tmp1 = s[5]; tmp2 = s[6]; s[5] = bitselect(s[5] ^ s[7], s[5], s[6]); s[6] = bitselect(s[6] ^ s[8], s[6], s[7]); s[7] = bitselect(s[7] ^ s[9], s[7], s[8]); s[8] = bitselect(s[8] ^ tmp1, s[8], s[9]); s[9] = bitselect(s[9] ^ tmp2, s[9], tmp1); - tmp1 = s[10]; tmp2 = s[11]; s[10] = bitselect(s[10] ^ s[12], s[10], s[11]); s[11] = bitselect(s[11] ^ s[13], s[11], s[12]); s[12] = bitselect(s[12] ^ s[14], s[12], s[13]); s[13] = bitselect(s[13] ^ tmp1, s[13], s[14]); s[14] = bitselect(s[14] ^ tmp2, s[14], tmp1); - tmp1 = s[15]; tmp2 = s[16]; s[15] = bitselect(s[15] ^ s[17], s[15], s[16]); s[16] = bitselect(s[16] ^ s[18], s[16], s[17]); s[17] = bitselect(s[17] ^ s[19], s[17], s[18]); s[18] = bitselect(s[18] ^ tmp1, s[18], s[19]); s[19] = bitselect(s[19] ^ tmp2, s[19], tmp1); - tmp1 = s[20]; tmp2 = s[21]; s[20] = bitselect(s[20] ^ s[22], s[20], s[21]); s[21] = bitselect(s[21] ^ s[23], s[21], s[22]); s[22] = bitselect(s[22] ^ s[24], s[22], s[23]); s[23] = bitselect(s[23] ^ tmp1, s[23], s[24]); s[24] = bitselect(s[24] ^ tmp2, s[24], tmp1); - - s[0] ^= 0x0000000000000001ULL; -} - -static inline void keccakf_mul_last(uint64_t *s) -{ - uint64_t bc[5], xormul[5]; - uint64_t tmp1, tmp2; - int i; - - for(i = 0; i < 5; i++) - xormul[i] = s[i + 0] ^ s[i + 5] ^ s[i + 10] * s[i + 15] * s[i + 20]; - - bc[0] = xormul[0] ^ rotl641(xormul[2]); - bc[1] = xormul[1] ^ rotl641(xormul[3]); - bc[2] = xormul[2] ^ rotl641(xormul[4]); - bc[3] = xormul[3] ^ rotl641(xormul[0]); - bc[4] = xormul[4] ^ rotl641(xormul[1]); - - s[0] ^= bc[4]; - s[1] = rotl64_2(s[6] ^ bc[0], 12); - s[2] = rotl64_2(s[12] ^ bc[1], 11); - s[4] = rotl64_1(s[24] ^ bc[3], 14); - s[3] = rotl64_1(s[18] ^ bc[2], 21); - - tmp1 = s[0]; tmp2 = s[1]; s[0] = bitselect(s[0] ^ s[2], s[0], s[1]); s[1] = bitselect(s[1] ^ s[3], s[1], s[2]); s[2] = bitselect(s[2] ^ s[4], s[2], s[3]); s[3] = bitselect(s[3] ^ tmp1, s[3], s[4]); - s[0] ^= 0x0000000000000001ULL; -} - -struct reciprocal_value64 cached_recip; -static uint64_t cached_scr_size = 0; - -static inline void scr_mix(uint64_t *st, uint64_t scr_size, struct reciprocal_value64 recip) -{ -#define KK_MIXIN_SIZE 24 - uint64_t _ALIGN(128) idx[KK_MIXIN_SIZE]; - -#ifdef _MSC_VER - #define pscr pscratchpad_buff - int x; - - // non-optimized 64bit operations - for (x = 0; x < KK_MIXIN_SIZE; x++) { - idx[x] = reciprocal_remainder64(st[x], scr_size, recip) << 2; - } - if (idx[7] > scr_size*4) { - applog(LOG_WARNING, "Wrong remainder64 returned by the cpu hash %016llx > %016llx", - (unsigned long long) idx[7], (unsigned long long) scr_size*4); - return; - } - for(x = 0; x < KK_MIXIN_SIZE; x += 4) { - st[x + 0] ^= pscr[idx[x] + 0] ^ pscr[idx[x + 1] + 0] ^ pscr[idx[x + 2] + 0] ^ pscr[idx[x + 3] + 0]; - st[x + 1] ^= pscr[idx[x] + 1] ^ pscr[idx[x + 1] + 1] ^ pscr[idx[x + 2] + 1] ^ pscr[idx[x + 3] + 1]; - st[x + 2] ^= pscr[idx[x] + 2] ^ pscr[idx[x + 1] + 2] ^ pscr[idx[x + 2] + 2] ^ pscr[idx[x + 3] + 2]; - st[x + 3] ^= pscr[idx[x] + 3] ^ pscr[idx[x + 1] + 3] ^ pscr[idx[x + 2] + 3] ^ pscr[idx[x + 3] + 3]; - } - return; - -#elif !defined(UNROLL_SCR_MIX) - - #pragma GCC ivdep - for(int x = 0; x < 3; ++x) - { - __m128i *st0, *st1, *st2, *st3; - - idx[0] = reciprocal_remainder64(st[(x << 3) + 0], scr_size, recip) << 2; - idx[1] = reciprocal_remainder64(st[(x << 3) + 1], scr_size, recip) << 2; - idx[2] = reciprocal_remainder64(st[(x << 3) + 2], scr_size, recip) << 2; - idx[3] = reciprocal_remainder64(st[(x << 3) + 3], scr_size, recip) << 2; - idx[4] = reciprocal_remainder64(st[(x << 3) + 4], scr_size, recip) << 2; - idx[5] = reciprocal_remainder64(st[(x << 3) + 5], scr_size, recip) << 2; - idx[6] = reciprocal_remainder64(st[(x << 3) + 6], scr_size, recip) << 2; - idx[7] = reciprocal_remainder64(st[(x << 3) + 7], scr_size, recip) << 2; - - for(int y = 0; y < 8; y++) _mm_prefetch((const char*) (&pscratchpad_buff[idx[y]]), _MM_HINT_T1); - - st0 = (__m128i *)&st[(x << 3) + 0]; - st1 = (__m128i *)&st[(x << 3) + 2]; - st2 = (__m128i *)&st[(x << 3) + 4]; - st3 = (__m128i *)&st[(x << 3) + 6]; - - *st0 = _mm_xor_si128(*st0, *((__m128i *)&pscratchpad_buff[idx[0]])); - *st0 = _mm_xor_si128(*st0, *((__m128i *)&pscratchpad_buff[idx[1]])); - *st0 = _mm_xor_si128(*st0, *((__m128i *)&pscratchpad_buff[idx[2]])); - *st0 = _mm_xor_si128(*st0, *((__m128i *)&pscratchpad_buff[idx[3]])); - - *st1 = _mm_xor_si128(*st1, *((__m128i *)&pscratchpad_buff[idx[0] + 2])); - *st1 = _mm_xor_si128(*st1, *((__m128i *)&pscratchpad_buff[idx[1] + 2])); - *st1 = _mm_xor_si128(*st1, *((__m128i *)&pscratchpad_buff[idx[2] + 2])); - *st1 = _mm_xor_si128(*st1, *((__m128i *)&pscratchpad_buff[idx[3] + 2])); - - *st2 = _mm_xor_si128(*st2, *((__m128i *)&pscratchpad_buff[idx[4]])); - *st2 = _mm_xor_si128(*st2, *((__m128i *)&pscratchpad_buff[idx[5]])); - *st2 = _mm_xor_si128(*st2, *((__m128i *)&pscratchpad_buff[idx[6]])); - *st2 = _mm_xor_si128(*st2, *((__m128i *)&pscratchpad_buff[idx[7]])); - - *st3 = _mm_xor_si128(*st3, *((__m128i *)&pscratchpad_buff[idx[4] + 2])); - *st3 = _mm_xor_si128(*st3, *((__m128i *)&pscratchpad_buff[idx[5] + 2])); - *st3 = _mm_xor_si128(*st3, *((__m128i *)&pscratchpad_buff[idx[6] + 2])); - *st3 = _mm_xor_si128(*st3, *((__m128i *)&pscratchpad_buff[idx[7] + 2])); - } - -#else - #warning using AVX2 optimizations - - idx[ 0] = reciprocal_remainder64(st[0], scr_size, recip) << 2; - idx[ 1] = reciprocal_remainder64(st[1], scr_size, recip) << 2; - idx[ 2] = reciprocal_remainder64(st[2], scr_size, recip) << 2; - idx[ 3] = reciprocal_remainder64(st[3], scr_size, recip) << 2; - idx[ 4] = reciprocal_remainder64(st[4], scr_size, recip) << 2; - idx[ 5] = reciprocal_remainder64(st[5], scr_size, recip) << 2; - idx[ 6] = reciprocal_remainder64(st[6], scr_size, recip) << 2; - idx[ 7] = reciprocal_remainder64(st[7], scr_size, recip) << 2; - - for(int y = 0; y < 8; y++) _mm_prefetch(&pscratchpad_buff[idx[y]], _MM_HINT_T1); - - idx[ 8] = reciprocal_remainder64(st[8], scr_size, recip) << 2; - idx[ 9] = reciprocal_remainder64(st[9], scr_size, recip) << 2; - idx[10] = reciprocal_remainder64(st[10], scr_size, recip) << 2; - idx[11] = reciprocal_remainder64(st[11], scr_size, recip) << 2; - idx[12] = reciprocal_remainder64(st[12], scr_size, recip) << 2; - idx[13] = reciprocal_remainder64(st[13], scr_size, recip) << 2; - idx[14] = reciprocal_remainder64(st[14], scr_size, recip) << 2; - idx[15] = reciprocal_remainder64(st[15], scr_size, recip) << 2; - - for(int y = 8; y < 16; ++y) _mm_prefetch(&pscratchpad_buff[idx[y]], _MM_HINT_T1); - - idx[16] = reciprocal_remainder64(st[16], scr_size, recip) << 2; - idx[17] = reciprocal_remainder64(st[17], scr_size, recip) << 2; - idx[18] = reciprocal_remainder64(st[18], scr_size, recip) << 2; - idx[19] = reciprocal_remainder64(st[19], scr_size, recip) << 2; - idx[20] = reciprocal_remainder64(st[20], scr_size, recip) << 2; - idx[21] = reciprocal_remainder64(st[21], scr_size, recip) << 2; - idx[22] = reciprocal_remainder64(st[22], scr_size, recip) << 2; - idx[23] = reciprocal_remainder64(st[23], scr_size, recip) << 2; - - for(int y = 16; y < 24; ++y) _mm_prefetch(&pscratchpad_buff[idx[y]], _MM_HINT_T1); - - __m256i *st0 = (__m256i *)&st[0]; - - for(int x = 0; x < 6; ++x) - { - *st0 = _mm256_xor_si256(*st0, *((__m256i *)&pscratchpad_buff[idx[(x << 2) + 0]])); - *st0 = _mm256_xor_si256(*st0, *((__m256i *)&pscratchpad_buff[idx[(x << 2) + 1]])); - *st0 = _mm256_xor_si256(*st0, *((__m256i *)&pscratchpad_buff[idx[(x << 2) + 2]])); - *st0 = _mm256_xor_si256(*st0, *((__m256i *)&pscratchpad_buff[idx[(x << 2) + 3]])); - ++st0; - } - -#endif - return; -} - -static void wild_keccak_hash_dbl(uint8_t * __restrict md, const uint8_t * __restrict in) -{ - uint64_t _ALIGN(32) st[25]; - uint64_t scr_size, i; - struct reciprocal_value64 recip; - - scr_size = scratchpad_size >> 2; - if (scr_size == cached_scr_size) - recip = cached_recip; - else { - cached_recip = recip = reciprocal_val64(scr_size); - cached_scr_size = scr_size; - } - - // Wild Keccak #1 - memcpy(st, in, 88); - st[10] = (st[10] & 0x00000000000000FFULL) | 0x0000000000000100ULL; - memset(&st[11], 0, 112); - st[16] |= 0x8000000000000000ULL; - - for(i = 0; i < 23; i++) { - keccakf_mul(st); - scr_mix(st, scr_size, recip); - } - - keccakf_mul_last(st); - - // Wild Keccak #2 - memset(&st[4], 0x00, 168); - st[ 4] = 0x0000000000000001ULL; - st[16] = 0x8000000000000000ULL; - - for(i = 0; i < 23; i++) { - keccakf_mul(st); - scr_mix(st, scr_size, recip); - } - - keccakf_mul_last(st); - - memcpy(md, st, 32); - return; -} - -void wildkeccak_hash(void* output, const void* input, uint64_t* scratchpad, uint64_t ssize) -{ - if (scratchpad) pscratchpad_buff = scratchpad; - if (!scratchpad_size) scratchpad_size = ssize; - wild_keccak_hash_dbl((uint8_t*)output, (uint8_t*)input); -} diff --git a/crypto/wildkeccak.cu b/crypto/wildkeccak.cu deleted file mode 100644 index 99657611..00000000 --- a/crypto/wildkeccak.cu +++ /dev/null @@ -1,381 +0,0 @@ -// WildKeccak CUDA Kernel, Code based on Linux Wolf0 bbr-miner implementation from 2014 -// Adapted to ccminer 2.0 - tpruvot 2016-2017 -// -// NOTE FOR SP: this ccminer version is licensed under GPLv3 Licence - -extern "C" { -#include -#include -#include -} - -#include -#include -#include // todo - -#include "wildkeccak.h" - -extern char *device_config[MAX_GPUS]; // -l -extern uint64_t* pscratchpad_buff; - -static uint64_t* d_input[MAX_GPUS]; -static uint32_t* d_retnonce[MAX_GPUS]; -static ulonglong4* d_scratchpad[MAX_GPUS]; - -static uint64_t* h_scratchpad[MAX_GPUS] = { 0 }; -static cudaStream_t bufpad_stream[MAX_GPUS] = { 0 }; -static cudaStream_t kernel_stream[MAX_GPUS] = { 0 }; - -uint64_t scratchpad_size = 0; - -uint32_t WK_CUDABlocks = 64; -uint32_t WK_CUDAThreads = 256; - -#define st0 vst0.x -#define st1 vst0.y -#define st2 vst0.z -#define st3 vst0.w - -#define st4 vst4.x -#define st5 vst4.y -#define st6 vst4.z -#define st7 vst4.w - -#define st8 vst8.x -#define st9 vst8.y -#define st10 vst8.z -#define st11 vst8.w - -#define st12 vst12.x -#define st13 vst12.y -#define st14 vst12.z -#define st15 vst12.w - -#define st16 vst16.x -#define st17 vst16.y -#define st18 vst16.z -#define st19 vst16.w - -#define st20 vst20.x -#define st21 vst20.y -#define st22 vst20.z -#define st23 vst20.w - -#if __CUDA_ARCH__ >= 320 - -__device__ __forceinline__ uint64_t cuda_rotl641(const uint64_t value) -{ - uint2 result; - asm("shf.l.wrap.b32 %0, %1, %2, 1U;" : "=r"(result.x) - : "r"(__double2hiint(__longlong_as_double(value))), "r"(__double2loint(__longlong_as_double(value)))); - asm("shf.l.wrap.b32 %0, %1, %2, 1U;" : "=r"(result.y) - : "r"(__double2loint(__longlong_as_double(value))), "r"(__double2hiint(__longlong_as_double(value)))); - return __double_as_longlong(__hiloint2double(result.y, result.x)); -} - -#else -__noinline__ __device__ uint64_t cuda_rotl641(const uint64_t x) { return((x << 1) | (x >> 63)); } -#endif - -__noinline__ __device__ uint64_t bitselect(const uint64_t a, const uint64_t b, const uint64_t c) { return(a ^ (c & (b ^ a))); } - -#define ROTL641(x) (cuda_rotl641(x)) - -#define RND() \ - bc[0] = st0 ^ st5 ^ st10 * st15 * st20 ^ ROTL641(st2 ^ st7 ^ st12 * st17 * st22); \ - bc[1] = st1 ^ st6 ^ st11 * st16 * st21 ^ ROTL641(st3 ^ st8 ^ st13 * st18 * st23); \ - bc[2] = st2 ^ st7 ^ st12 * st17 * st22 ^ ROTL641(st4 ^ st9 ^ st14 * st19 * st24); \ - bc[3] = st3 ^ st8 ^ st13 * st18 * st23 ^ ROTL641(st0 ^ st5 ^ st10 * st15 * st20); \ - bc[4] = st4 ^ st9 ^ st14 * st19 * st24 ^ ROTL641(st1 ^ st6 ^ st11 * st16 * st21); \ - tmp1 = st1 ^ bc[0]; \ - \ - st0 ^= bc[4]; \ - st1 = ROTL64(st6 ^ bc[0], 44); \ - st6 = ROTL64(st9 ^ bc[3], 20); \ - st9 = ROTL64(st22 ^ bc[1], 61); \ - st22 = ROTL64(st14 ^ bc[3], 39); \ - st14 = ROTL64(st20 ^ bc[4], 18); \ - st20 = ROTL64(st2 ^ bc[1], 62); \ - st2 = ROTL64(st12 ^ bc[1], 43); \ - st12 = ROTL64(st13 ^ bc[2], 25); \ - st13 = ROTL64(st19 ^ bc[3], 8); \ - st19 = ROTL64(st23 ^ bc[2], 56); \ - st23 = ROTL64(st15 ^ bc[4], 41); \ - st15 = ROTL64(st4 ^ bc[3], 27); \ - st4 = ROTL64(st24 ^ bc[3], 14); \ - st24 = ROTL64(st21 ^ bc[0], 2); \ - st21 = ROTL64(st8 ^ bc[2], 55); \ - st8 = ROTL64(st16 ^ bc[0], 45); \ - st16 = ROTL64(st5 ^ bc[4], 36); \ - st5 = ROTL64(st3 ^ bc[2], 28); \ - st3 = ROTL64(st18 ^ bc[2], 21); \ - st18 = ROTL64(st17 ^ bc[1], 15); \ - st17 = ROTL64(st11 ^ bc[0], 10); \ - st11 = ROTL64(st7 ^ bc[1], 6); \ - st7 = ROTL64(st10 ^ bc[4], 3); \ - st10 = ROTL641(tmp1); \ - \ - tmp1 = st0; tmp2 = st1; st0 = bitselect(st0 ^ st2, st0, st1); st1 = bitselect(st1 ^ st3, st1, st2); \ - st2 = bitselect(st2 ^ st4, st2, st3); st3 = bitselect(st3 ^ tmp1, st3, st4); st4 = bitselect(st4 ^ tmp2, st4, tmp1); \ - tmp1 = st5; tmp2 = st6; st5 = bitselect(st5 ^ st7, st5, st6); st6 = bitselect(st6 ^ st8, st6, st7); \ - st7 = bitselect(st7 ^ st9, st7, st8); st8 = bitselect(st8 ^ tmp1, st8, st9); st9 = bitselect(st9 ^ tmp2, st9, tmp1); \ - tmp1 = st10; tmp2 = st11; st10 = bitselect(st10 ^ st12, st10, st11); st11 = bitselect(st11 ^ st13, st11, st12); \ - st12 = bitselect(st12 ^ st14, st12, st13); st13 = bitselect(st13 ^ tmp1, st13, st14); st14 = bitselect(st14 ^ tmp2, st14, tmp1); \ - tmp1 = st15; tmp2 = st16; st15 = bitselect(st15 ^ st17, st15, st16); st16 = bitselect(st16 ^ st18, st16, st17); \ - st17 = bitselect(st17 ^ st19, st17, st18); st18 = bitselect(st18 ^ tmp1, st18, st19); st19 = bitselect(st19 ^ tmp2, st19, tmp1); \ - tmp1 = st20; tmp2 = st21; st20 = bitselect(st20 ^ st22, st20, st21); st21 = bitselect(st21 ^ st23, st21, st22); \ - st22 = bitselect(st22 ^ st24, st22, st23); st23 = bitselect(st23 ^ tmp1, st23, st24); st24 = bitselect(st24 ^ tmp2, st24, tmp1); \ - st0 ^= 1; - -#define LASTRND1() \ - bc[0] = st0 ^ st5 ^ st10 * st15 * st20 ^ ROTL64(st2 ^ st7 ^ st12 * st17 * st22, 1); \ - bc[1] = st1 ^ st6 ^ st11 * st16 * st21 ^ ROTL64(st3 ^ st8 ^ st13 * st18 * st23, 1); \ - bc[2] = st2 ^ st7 ^ st12 * st17 * st22 ^ ROTL64(st4 ^ st9 ^ st14 * st19 * st24, 1); \ - bc[3] = st3 ^ st8 ^ st13 * st18 * st23 ^ ROTL64(st0 ^ st5 ^ st10 * st15 * st20, 1); \ - bc[4] = st4 ^ st9 ^ st14 * st19 * st24 ^ ROTL64(st1 ^ st6 ^ st11 * st16 * st21, 1); \ - \ - st0 ^= bc[4]; \ - st1 = ROTL64(st6 ^ bc[0], 44); \ - st2 = ROTL64(st12 ^ bc[1], 43); \ - st4 = ROTL64(st24 ^ bc[3], 14); \ - st3 = ROTL64(st18 ^ bc[2], 21); \ - \ - tmp1 = st0; st0 = bitselect(st0 ^ st2, st0, st1); st1 = bitselect(st1 ^ st3, st1, st2); st2 = bitselect(st2 ^ st4, st2, st3); st3 = bitselect(st3 ^ tmp1, st3, st4); \ - st0 ^= 1; - -#define LASTRND2() \ - bc[2] = st2 ^ st7 ^ st12 * st17 * st22 ^ ROTL64(st4 ^ st9 ^ st14 * st19 * st24, 1); \ - bc[3] = st3 ^ st8 ^ st13 * st18 * st23 ^ ROTL64(st0 ^ st5 ^ st10 * st15 * st20, 1); \ - bc[4] = st4 ^ st9 ^ st14 * st19 * st24 ^ ROTL64(st1 ^ st6 ^ st11 * st16 * st21, 1); \ - \ - st0 ^= bc[4]; \ - st4 = ROTL64(st24 ^ bc[3], 14); \ - st3 = ROTL64(st18 ^ bc[2], 21); \ - st3 = bitselect(st3 ^ st0, st3, st4); - -__device__ ulonglong4 operator^(const ulonglong4 &a, const ulonglong4 &b) -{ - return(make_ulonglong4(a.x ^ b.x, a.y ^ b.y, a.z ^ b.z, a.w ^ b.w)); -} - -#define MIX(vst) vst = vst ^ scratchpad[vst.x % scr_size] ^ scratchpad[vst.y % scr_size] ^ scratchpad[vst.z % scr_size] ^ scratchpad[vst.w % scr_size]; - -#define MIX_ALL MIX(vst0); MIX(vst4); MIX(vst8); MIX(vst12); MIX(vst16); MIX(vst20); - -__global__ -void wk(uint32_t* __restrict__ retnonce, const uint64_t* __restrict__ input, const ulonglong4* __restrict__ scratchpad, - const uint32_t scr_size, const uint32_t target, uint64_t startNonce) -{ - ulonglong4 vst0, vst4, vst8, vst12, vst16, vst20; - uint64_t bc[5]; - uint64_t st24, tmp1, tmp2; - - const uint64_t nonce = startNonce + (blockDim.x * blockIdx.x) + threadIdx.x; - vst0 = make_ulonglong4((nonce << 8) + (input[0] & 0xFF), input[1] & 0xFFFFFFFFFFFFFF00ULL, input[2], input[3]); - vst4 = make_ulonglong4(input[4], input[5], input[6], input[7]); - vst8 = make_ulonglong4(input[8], input[9], (input[10] & 0xFF) | 0x100, 0); - vst12 = make_ulonglong4(0, 0, 0, 0); - vst16 = make_ulonglong4(0x8000000000000000ULL, 0, 0, 0); - vst20 = make_ulonglong4(0, 0, 0, 0); - st24 = 0; - - RND(); - MIX_ALL; - - for(int i = 0; i < 22; i++) { - RND(); - MIX_ALL; - } - - LASTRND1(); - - vst4 = make_ulonglong4(1, 0, 0, 0); - vst8 = make_ulonglong4(0, 0, 0, 0); - vst12 = make_ulonglong4(0, 0, 0, 0); - vst16 = make_ulonglong4(0x8000000000000000ULL, 0, 0, 0); - vst20 = make_ulonglong4(0, 0, 0, 0); - st24 = 0; - - RND(); - MIX_ALL; - - #pragma unroll - for(int i = 0; i < 22; i++) { - RND(); - MIX_ALL; - } - - LASTRND2(); - - if((st3 >> 32) <= target) { - retnonce[0] = (uint32_t) nonce; - retnonce[1] = retnonce[0]; - } -} - -__host__ -void wildkeccak_kernel(const int thr_id, const uint32_t threads, const uint32_t startNounce, const uint2 target, uint32_t *resNonces) -{ - CUDA_SAFE_CALL(cudaMemsetAsync(d_retnonce[thr_id], 0xff, 2 * sizeof(uint32_t), kernel_stream[thr_id])); - - const uint32_t threadsperblock = WK_CUDAThreads; - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - - wk <<>> (d_retnonce[thr_id], d_input[thr_id], d_scratchpad[thr_id], - (uint32_t)(scratchpad_size >> 2), target.y, startNounce); - - cudaMemcpyAsync(resNonces, d_retnonce[thr_id], 2*sizeof(uint32_t), cudaMemcpyDeviceToHost, kernel_stream[thr_id]); -} - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_wildkeccak(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *ptarget = work->target; - uint32_t throughput = 0; - uint64_t n, nonce, first; - uint8_t *pdata = (uint8_t*) work->data; - memcpy(&first, &pdata[1], 8); - n = nonce = first; - - if (!scratchpad_size || !h_scratchpad[thr_id]) { - if (h_scratchpad[thr_id]) - applog(LOG_ERR, "Scratchpad size is not set!"); - work->data[0] = 0; // invalidate - sleep(1); - return -EBUSY; - } - - if (!init[thr_id]) { - - if (device_config[thr_id]) { - sscanf(device_config[thr_id], "%ux%u", &WK_CUDABlocks, &WK_CUDAThreads); - gpulog(LOG_INFO, thr_id, "Using %u x %u kernel launch config, %u threads", - WK_CUDABlocks, WK_CUDAThreads, throughput); - } else { - throughput = cuda_default_throughput(thr_id, WK_CUDABlocks*WK_CUDAThreads); - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - } - - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage (linux) - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - cudaDeviceSetCacheConfig(cudaFuncCachePreferL1); - CUDA_LOG_ERROR(); - } - - CUDA_SAFE_CALL(cudaMalloc(&d_input[thr_id], 88)); - CUDA_SAFE_CALL(cudaMalloc(&d_retnonce[thr_id], 2*sizeof(uint32_t))); - - int status = (int) cudaMalloc(&d_scratchpad[thr_id], WILD_KECCAK_SCRATCHPAD_BUFFSIZE); - if (status != cudaSuccess) { - gpulog(LOG_ERR, thr_id, "Unable to allocate device memory, %u MB, err %d", - (uint32_t) (WILD_KECCAK_SCRATCHPAD_BUFFSIZE/(1024*1024)), status); - exit(-ENOMEM); - } - - cudaStreamCreate(&bufpad_stream[thr_id]); - cudaStreamCreate(&kernel_stream[thr_id]); - - CUDA_SAFE_CALL(cudaMemcpyAsync(d_scratchpad[thr_id], h_scratchpad[thr_id], scratchpad_size << 3, cudaMemcpyHostToDevice, bufpad_stream[thr_id])); - - init[thr_id] = true; - } - - throughput = WK_CUDABlocks * WK_CUDAThreads; - - cudaMemcpy(d_input[thr_id], pdata, 88, cudaMemcpyHostToDevice); -// cudaMemset(d_retnonce[thr_id], 0xFF, 2*sizeof(uint32_t)); - - if (h_scratchpad[thr_id]) { - cudaStreamSynchronize(bufpad_stream[thr_id]); - } - - do { -// const uint32_t blocks = WK_CUDABlocks, threads = WK_CUDAThreads; -// const dim3 block(blocks); -// const dim3 thread(threads); - uint32_t h_retnonce[2] = { UINT32_MAX, UINT32_MAX }; - uint2 target = make_uint2(ptarget[6], ptarget[7]); - - wildkeccak_kernel(thr_id, throughput, (uint32_t) nonce, target, h_retnonce); - /* - wk <<>> (d_retnonce[thr_id], d_input[thr_id], d_scratchpad[thr_id], - (uint32_t)(scratchpad_size >> 2), nonce, ptarget[7]); - */ - - *hashes_done = (unsigned long) (n - first + throughput); - - cudaStreamSynchronize(kernel_stream[thr_id]); - if(h_retnonce[0] != UINT32_MAX) { - uint8_t _ALIGN(64) cpuhash[32]; - uint32_t* vhash = (uint32_t*) cpuhash; - uint64_t nonce64; - memcpy(&pdata[1], &h_retnonce[0], sizeof(uint32_t)); - memcpy(&nonce64, &pdata[1], 8); - wildkeccak_hash(cpuhash, pdata, pscratchpad_buff, scratchpad_size); - if (!cpuhash[31] && vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { - work_set_target_ratio(work, vhash); - //applog_hex(pdata, 84); - //applog_hex(cpuhash, 32); - //applog_hex(ptarget, 32); - memcpy(work->nonces, &nonce64, 8); - if (n + throughput > max_nonce) { - *hashes_done = (unsigned long) (max_nonce - first); - } - work->valid_nonces = 1; - return 1; - } else if (vhash[7] > ptarget[7]) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for nonce %08x does not validate on CPU!", h_retnonce[0]); - } - } - - if (n + throughput >= max_nonce) { - n = max_nonce; - break; - } - - n += throughput; - nonce += throughput; - - } while(!work_restart[thr_id].restart); - - *hashes_done = (unsigned long) (n - first + 1); - return 0; -} - -void wildkeccak_scratchpad_need_update(uint64_t* pscratchpad_buff) -{ - for(int i = 0; i < opt_n_threads; i++) { - h_scratchpad[i] = pscratchpad_buff; - if (init[i]) { - gpulog(LOG_DEBUG, i, "Starting scratchpad update..."); - cudaMemcpyAsync(d_scratchpad[i], h_scratchpad[i], scratchpad_size << 3, cudaMemcpyHostToDevice, bufpad_stream[i]); - work_restart[i].restart = true; - } - } -} - -void free_wildkeccak(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_scratchpad[thr_id]); - cudaFree(d_input[thr_id]); - cudaFree(d_retnonce[thr_id]); - - cudaStreamDestroy(bufpad_stream[thr_id]); - cudaStreamDestroy(kernel_stream[thr_id]); - - cudaDeviceSynchronize(); - - init[thr_id] = false; -} diff --git a/crypto/wildkeccak.h b/crypto/wildkeccak.h deleted file mode 100644 index 287ed153..00000000 --- a/crypto/wildkeccak.h +++ /dev/null @@ -1,10 +0,0 @@ - -#define WILD_KECCAK_SCRATCHPAD_BUFFSIZE 1ULL << 29 -#define WILD_KECCAK_ADDENDUMS_ARRAY_SIZE 10 - -extern uint64_t scratchpad_size; - -extern uint32_t WK_CUDABlocks, WK_CUDAThreads; - -void wildkeccak_scratchpad_need_update(uint64_t* pscratchpad_buff); - diff --git a/crypto/xmr-rpc.cpp b/crypto/xmr-rpc.cpp deleted file mode 100644 index 82b7845f..00000000 --- a/crypto/xmr-rpc.cpp +++ /dev/null @@ -1,1328 +0,0 @@ -/** - * XMR RPC 2.0 Stratum and BBR Scratchpad - * tpruvot@github - October 2016 - Under GPLv3 Licence - */ - -#include -#include -#include -#include -#include // mkdir - -#include - -#ifdef _MSC_VER -#include "mman.h" // mmap -#include // _mkdir -#define chdir(x) _chdir(x) -#define mkdir(x) _mkdir(x) -#define getcwd(d,sz) _getcwd(d,sz) -#define unlink(x) _unlink(x) -#define PATH_MAX MAX_PATH -#else -#include // mmap -#endif - -#if defined(__APPLE__) && !defined(MAP_HUGETLB) -#define MAP_ANONYMOUS MAP_ANON -#define MAP_HUGETLB 0 -#define MAP_POPULATE 0 -#define MADV_HUGEPAGE 0 -#endif - -#ifndef MADV_HUGEPAGE -#define MADV_HUGEPAGE 0 -#endif - -#ifndef PRIu64 -#define PRIu64 "I64u" -#endif - -#include -#include "xmr-rpc.h" -#include "wildkeccak.h" - -double target_to_diff_rpc2(uint32_t* target) -{ - // unlike other algos, xmr diff is very low - if (opt_algo == ALGO_CRYPTONIGHT && target[7]) { - // simplified to get 1.0 for 1000 - return (double) (UINT32_MAX / target[7]) / 1000; - } - else if (opt_algo == ALGO_CRYPTOLIGHT && target[7]) { - return (double) (UINT32_MAX / target[7]) / 1000; - } - else if (opt_algo == ALGO_WILDKECCAK) { - return target_to_diff(target) * 1000; - } - return target_to_diff(target); // util.cpp -} - -extern struct stratum_ctx stratum; - -bool jobj_binary(const json_t *obj, const char *key, void *buf, size_t buflen); - -pthread_mutex_t rpc2_job_lock; -pthread_mutex_t rpc2_work_lock; -pthread_mutex_t rpc2_login_lock; -//pthread_mutex_t rpc2_getscratchpad_lock; - -char* opt_scratchpad_url = NULL; -uint64_t* pscratchpad_buff = NULL; - -// hide addendums flood on start -static bool opt_quiet_start = true; - -static const char * pscratchpad_local_cache = NULL; -static const char cachedir_suffix[] = "boolberry"; /* scratchpad cache saved as ~/.cache/boolberry/scratchpad.bin */ -static char scratchpad_file[PATH_MAX]; -static time_t prev_save = 0; -static struct scratchpad_hi current_scratchpad_hi; -static struct addendums_array_entry add_arr[WILD_KECCAK_ADDENDUMS_ARRAY_SIZE]; - -static char *rpc2_job_id = NULL; -static char *rpc2_blob = NULL; -static uint32_t rpc2_target = 0; -static size_t rpc2_bloblen = 0; -static struct work rpc2_work; - -static char rpc2_id[64] = { 0 }; -static uint64_t last_found_nonce = 0; - -static const char* get_json_string_param(const json_t *val, const char* param_name) -{ - json_t *tmp; - tmp = json_object_get(val, param_name); - if(!tmp) { - return NULL; - } - return json_string_value(tmp); -} - -static size_t hex2bin_len(unsigned char *p, const char *hexstr, size_t len) -{ - char hex_byte[3]; - char *ep; - size_t count = 0; - - hex_byte[2] = '\0'; - - while (*hexstr && len) { - if (!hexstr[1]) { - applog(LOG_ERR, "hex2bin str truncated"); - return 0; - } - hex_byte[0] = hexstr[0]; - hex_byte[1] = hexstr[1]; - *p = (unsigned char) strtol(hex_byte, &ep, 16); - if (*ep) { - applog(LOG_ERR, "hex2bin failed on '%s'", hex_byte); - return 0; - } - count++; - p++; - hexstr += 2; - len--; - } - - return (/*len == 0 &&*/ *hexstr == 0) ? count : 0; -} - -static bool parse_height_info(const json_t *hi_section, struct scratchpad_hi* phi) -{ - unsigned char prevhash[32] = { 0 }; - const char* block_id; - uint64_t hi_h; - size_t len; - - if(!phi || !hi_section) { - applog(LOG_ERR, "parse_height_info: wrong params"); - return false; - } - - json_t *height = json_object_get(hi_section, "height"); - if(!height) { - applog(LOG_ERR, "JSON inval hi, no height param"); - goto err_out; - } - - if(!json_is_integer(height)) { - applog(LOG_ERR, "JSON inval hi: height is not integer "); - goto err_out; - } - - hi_h = (uint64_t)json_integer_value(height); - if(!hi_h) { - applog(LOG_ERR, "JSON inval hi: height is 0"); - goto err_out; - } - - block_id = get_json_string_param(hi_section, "block_id"); - if(!block_id) { - applog(LOG_ERR, "JSON inval hi: block_id not found "); - goto err_out; - } - - len = hex2bin_len(prevhash, block_id, 32); - if(len != 32) { - applog(LOG_ERR, "JSON inval hi: block_id wrong len %d", len); - goto err_out; - } - - phi->height = hi_h; - memcpy(phi->prevhash, prevhash, 32); - - return true; -err_out: - return false; -} - -static void reset_scratchpad(void) -{ - current_scratchpad_hi.height = 0; - scratchpad_size = 0; - //unlink(scratchpad_file); -} - -static bool patch_scratchpad_with_addendum(uint64_t global_add_startpoint, uint64_t* padd_buff, size_t count/*uint64 units*/) -{ - for(size_t i = 0; i < count; i += 4) { - uint64_t global_offset = (padd_buff[i]%(global_add_startpoint/4))*4; - for(size_t j = 0; j != 4; j++) - pscratchpad_buff[global_offset + j] ^= padd_buff[i + j]; - } - return true; -} - -static bool apply_addendum(uint64_t* padd_buff, size_t count/*uint64 units*/) -{ - if(WILD_KECCAK_SCRATCHPAD_BUFFSIZE <= (scratchpad_size + count)*8 ) { - applog(LOG_ERR, "!!!!!!! WILD_KECCAK_SCRATCHPAD_BUFFSIZE overflowed !!!!!!!! please increase this constant! "); - return false; - } - - if(!patch_scratchpad_with_addendum(scratchpad_size, padd_buff, count)) { - applog(LOG_ERR, "patch_scratchpad_with_addendum is broken, resetting scratchpad"); - reset_scratchpad(); - return false; - } - for(int k = 0; k != count; k++) - pscratchpad_buff[scratchpad_size+k] = padd_buff[k]; - - scratchpad_size += count; - - return true; -} - -static bool pop_addendum(struct addendums_array_entry* entry) -{ - if(!entry) - return false; - - if(!entry->add_size || !entry->prev_hi.height) { - applog(LOG_ERR, "wrong parameters"); - return false; - } - patch_scratchpad_with_addendum(scratchpad_size - entry->add_size, &pscratchpad_buff[scratchpad_size - entry->add_size], (size_t) entry->add_size); - scratchpad_size = scratchpad_size - entry->add_size; - memcpy(¤t_scratchpad_hi, &entry->prev_hi, sizeof(entry->prev_hi)); - - memset(entry, 0, sizeof(struct addendums_array_entry)); - return true; -} - -// playback scratchpad addendums for whole add_arr -static bool revert_scratchpad() -{ - size_t p = 0; - size_t i = 0; - size_t arr_size = ARRAY_SIZE(add_arr); - - for(p=0; p != arr_size; p++) { - i = arr_size-(p+1); - if(!add_arr[i].prev_hi.height) - continue; - pop_addendum(&add_arr[i]); - } - return true; -} - -static bool push_addendum_info(struct scratchpad_hi* pprev_hi, uint64_t size /* uint64 units count*/) -{ - size_t i = 0; - size_t arr_size = ARRAY_SIZE(add_arr); - - // Find last free entry - for(i=0; i != arr_size; i++) { - if(!add_arr[i].prev_hi.height) - break; - } - - if(i >= arr_size) { - // Shift array - memmove(&add_arr[0], &add_arr[1], (arr_size-1)*sizeof(add_arr[0])); - i = arr_size - 1; - } - add_arr[i].prev_hi = *pprev_hi; - add_arr[i].add_size = size; - - return true; -} - -static bool addendum_decode(const json_t *addm) -{ - struct scratchpad_hi hi; - unsigned char prevhash[32]; - uint64_t* padd_buff; - uint64_t old_height; - - json_t* hi_section = json_object_get(addm, "hi"); - if (!hi_section) { - //applog(LOG_ERR, "JSON addms field not found"); - //return false; - return true; - } - - if(!parse_height_info(hi_section, &hi)) { - return false; - } - - const char* prev_id_str = get_json_string_param(addm, "prev_id"); - if(!prev_id_str) { - applog(LOG_ERR, "JSON prev_id is not a string"); - return false; - } - if(!hex2bin(prevhash, prev_id_str, 32)) { - applog(LOG_ERR, "JSON prev_id is not valid hex string"); - return false; - } - - if(current_scratchpad_hi.height != hi.height -1) - { - if(current_scratchpad_hi.height > hi.height -1) { - //skip low scratchpad - applog(LOG_ERR, "addendum with hi.height=%lld skiped since current_scratchpad_hi.height=%lld", hi.height, current_scratchpad_hi.height); - return true; - } - - //TODO: ADD SPLIT HANDLING HERE - applog(LOG_ERR, "JSON height in addendum-1 (%lld-1) missmatched with current_scratchpad_hi.height(%lld), reverting scratchpad and re-login", - hi.height, current_scratchpad_hi.height); - revert_scratchpad(); - //init re-login - strcpy(rpc2_id, ""); - return false; - } - - if(memcmp(prevhash, current_scratchpad_hi.prevhash, 32)) { - //TODO: ADD SPLIT HANDLING HERE - applog(LOG_ERR, "JSON prev_id in addendum missmatched with current_scratchpad_hi.prevhash"); - return false; - } - - const char* addm_hexstr = get_json_string_param(addm, "addm"); - if(!addm_hexstr) { - applog(LOG_ERR, "JSON prev_id in addendum missmatched with current_scratchpad_hi.prevhash"); - return false; - } - size_t add_len = strlen(addm_hexstr); - if(add_len%64) { - applog(LOG_ERR, "JSON wrong addm hex str len"); - return false; - } - padd_buff = (uint64_t*) calloc(1, add_len/2); - if (!padd_buff) { - applog(LOG_ERR, "out of memory, wanted %zu", add_len/2); - return false; - } - - if(!hex2bin((unsigned char*)padd_buff, addm_hexstr, add_len/2)) { - applog(LOG_ERR, "JSON wrong addm hex str len"); - goto err_out; - } - - if(!apply_addendum(padd_buff, add_len/16)) { - applog(LOG_ERR, "JSON Failed to apply_addendum!"); - goto err_out; - } - free(padd_buff); - - push_addendum_info(¤t_scratchpad_hi, add_len/16); - old_height = current_scratchpad_hi.height; - current_scratchpad_hi = hi; - - if (!opt_quiet && !opt_quiet_start) - applog(LOG_BLUE, "ADDENDUM APPLIED: Block %lld", (long long) current_scratchpad_hi.height); - - return true; -err_out: - free(padd_buff); - return false; -} - -static bool addendums_decode(const json_t *job) -{ - json_t* paddms = json_object_get(job, "addms"); - if (!paddms) { - //applog(LOG_ERR, "JSON addms field not found"); - //return false; - return true; - } - - if(!json_is_array(paddms)) { - applog(LOG_ERR, "JSON addms field is not array"); - return false; - } - - size_t add_sz = json_array_size(paddms); - for (size_t i = 0; i < add_sz; i++) - { - json_t *addm = json_array_get(paddms, i); - if (!addm) { - applog(LOG_ERR, "Internal error: failed to get addm"); - return false; - } - if(!addendum_decode(addm)) - return false; - } - - return true; -} - -bool rpc2_job_decode(const json_t *job, struct work *work) -{ - json_t *tmp; - size_t blobLen; - const char *job_id; - const char *hexblob; - - tmp = json_object_get(job, "job_id"); - if (!tmp) { - applog(LOG_ERR, "JSON inval job id"); - goto err_out; - } - - if(opt_algo == ALGO_WILDKECCAK && !addendums_decode(job)) { - applog(LOG_ERR, "JSON failed to process addendums"); - goto err_out; - } - // now allow ADDENDUM notices (after the init) - opt_quiet_start = false; - - job_id = json_string_value(tmp); - tmp = json_object_get(job, "blob"); - if (!tmp) { - applog(LOG_ERR, "JSON inval blob"); - goto err_out; - } - hexblob = json_string_value(tmp); - blobLen = strlen(hexblob); - if (blobLen % 2 != 0 || ((blobLen / 2) < 40 && blobLen != 0) || (blobLen / 2) > 128) - { - applog(LOG_ERR, "JSON invalid blob length"); - goto err_out; - } - - if (blobLen != 0) - { - pthread_mutex_lock(&rpc2_job_lock); - char *blob = (char*) calloc(1, blobLen / 2); - if (!hex2bin(blob, hexblob, blobLen / 2)) - { - applog(LOG_ERR, "JSON inval blob"); - pthread_mutex_unlock(&rpc2_job_lock); - goto err_out; - } - if (rpc2_blob) { - free(rpc2_blob); - } - rpc2_bloblen = blobLen / 2; - rpc2_blob = (char*) malloc(rpc2_bloblen); - memcpy(rpc2_blob, blob, blobLen / 2); - - free(blob); - - uint32_t target; - jobj_binary(job, "target", &target, 4); - if(rpc2_target != target) { - double difficulty = (((double) UINT32_MAX) / target); - stratum.job.diff = difficulty; - rpc2_target = target; - } - - if (rpc2_job_id) { - // reset job share counter - if (strcmp(rpc2_job_id, job_id)) stratum.job.shares_count = 0; - free(rpc2_job_id); - } - rpc2_job_id = strdup(job_id); - pthread_mutex_unlock(&rpc2_job_lock); - } - - if(work) - { - if (!rpc2_blob) { - applog(LOG_ERR, "Requested work before work was received"); - goto err_out; - } - memcpy(work->data, rpc2_blob, rpc2_bloblen); - memset(work->target, 0xff, sizeof(work->target)); - work->target[7] = rpc2_target; - work->targetdiff = target_to_diff_rpc2(work->target); - - snprintf(work->job_id, sizeof(work->job_id), "%s", rpc2_job_id); - } - - if (opt_algo == ALGO_WILDKECCAK) - wildkeccak_scratchpad_need_update(pscratchpad_buff); - return true; - -err_out: - return false; -} - -extern struct work _ALIGN(64) g_work; -extern volatile time_t g_work_time; -extern bool submit_old; - -bool rpc2_stratum_job(struct stratum_ctx *sctx, json_t *id, json_t *params) -{ - bool ret = false; - pthread_mutex_lock(&rpc2_work_lock); - ret = rpc2_job_decode(params, &rpc2_work); - // update miner threads work - ret = ret && rpc2_stratum_gen_work(sctx, &g_work); - restart_threads(); - pthread_mutex_unlock(&rpc2_work_lock); - return ret; -} - -bool rpc2_stratum_gen_work(struct stratum_ctx *sctx, struct work *work) -{ -// pthread_mutex_lock(&rpc2_work_lock); - memcpy(work, &rpc2_work, sizeof(struct work)); - if (stratum_diff != sctx->job.diff) { - char sdiff[32] = { 0 }; - stratum_diff = sctx->job.diff; - if (opt_showdiff && work->targetdiff != stratum_diff) - snprintf(sdiff, 32, " (%g)", work->targetdiff); - if (stratum_diff >= 1e6) - applog(LOG_WARNING, "Stratum difficulty set to %.1f M%s", stratum_diff/1e6, sdiff); - else - applog(LOG_WARNING, "Stratum difficulty set to %.0f%s", stratum_diff, sdiff); - } - if (work->target[7] != rpc2_target) { - work->target[7] = rpc2_target; - work->targetdiff = target_to_diff_rpc2(work->target); - g_work_time = 0; - restart_threads(); - } -// pthread_mutex_unlock(&rpc2_work_lock); - return (work->data[0] != 0); -} - -#define JSON_SUBMIT_BUF_LEN 512 -// called by submit_upstream_work() -bool rpc2_stratum_submit(struct pool_infos *pool, struct work *work) -{ - char _ALIGN(64) s[JSON_SUBMIT_BUF_LEN]; - uint8_t _ALIGN(64) hash[32]; - uint8_t _ALIGN(64) data[88]; - char *noncestr, *hashhex; - int idnonce = work->submit_nonce_id; - - memcpy(&data[0], work->data, 88); - - if (opt_algo == ALGO_WILDKECCAK) { - // 64 bits nonce - memcpy(&data[1], work->nonces, 8); - // pass if the previous hash is not the current previous hash - if(!submit_old && memcmp(&work->data[3], &g_work.data[3], 28)) { - if (opt_debug) applog(LOG_DEBUG, "stale work detected"); - pool->stales_count++; - return false; - } - noncestr = bin2hex((unsigned char*) &data[1], 8); - // "nonce":"5794ec8000000000" => 0x0000000080ec9457 - memcpy(&last_found_nonce, work->nonces, 8); - wildkeccak_hash(hash, data, NULL, 0); - work_set_target_ratio(work, (uint32_t*) hash); - } - - else if (opt_algo == ALGO_CRYPTOLIGHT) { - uint32_t nonce = work->nonces[idnonce]; - noncestr = bin2hex((unsigned char*) &nonce, 4); - last_found_nonce = nonce; - cryptolight_hash(hash, data, 76); - work_set_target_ratio(work, (uint32_t*) hash); - } - - else if (opt_algo == ALGO_CRYPTONIGHT) { - uint32_t nonce = work->nonces[idnonce]; - noncestr = bin2hex((unsigned char*) &nonce, 4); - last_found_nonce = nonce; - cryptonight_hash(hash, data, 76); - work_set_target_ratio(work, (uint32_t*) hash); - } - - if (hash[31] != 0) - return false; // prevent bad hashes - hashhex = bin2hex((unsigned char*)hash, 32); - - snprintf(s, sizeof(s), "{\"method\":\"submit\",\"params\":" - "{\"id\":\"%s\",\"job_id\":\"%s\",\"nonce\":\"%s\",\"result\":\"%s\"}, \"id\":%u}", - rpc2_id, work->job_id, noncestr, hashhex, stratum.job.shares_count + 10); - - free(hashhex); - free(noncestr); - - gettimeofday(&stratum.tv_submit, NULL); - - if(!stratum_send_line(&stratum, s)) { - applog(LOG_ERR, "%s stratum_send_line failed", __func__); - return false; - } - - //stratum.sharediff = target_to_diff_rpc2((uint32_t*)hash); - stratum.sharediff = work->sharediff[idnonce]; - - return true; -} - -bool rpc2_login_decode(const json_t *val) -{ - const char *id; - const char *s; - json_t *res = json_object_get(val, "result"); - if(!res) { - applog(LOG_ERR, "JSON invalid result"); - goto err_out; - } - - json_t *tmp; - tmp = json_object_get(res, "id"); - if(!tmp) { - applog(LOG_ERR, "JSON inval id"); - goto err_out; - } - id = json_string_value(tmp); - if(!id) { - applog(LOG_ERR, "JSON id is not a string"); - goto err_out; - } - - strncpy(rpc2_id, id, sizeof(rpc2_id)-1); - - if(opt_debug) - applog(LOG_DEBUG, "Auth id: %s", id); - - tmp = json_object_get(res, "status"); - if(!tmp) { - applog(LOG_ERR, "JSON inval status"); - goto err_out; - } - s = json_string_value(tmp); - if(!s) { - applog(LOG_ERR, "JSON status is not a string"); - goto err_out; - } - if(strcmp(s, "OK")) { - applog(LOG_ERR, "JSON returned status \"%s\"", s); - goto err_out; - } - - return true; - -err_out: - return false; -} - -bool store_scratchpad_to_file(bool do_fsync) -{ - char file_name_buff[PATH_MAX] = { 0 }; - FILE *fp; - int ret; - - if(opt_algo != ALGO_WILDKECCAK) return true; - if(!scratchpad_size || !pscratchpad_buff) return true; - - snprintf(file_name_buff, sizeof(file_name_buff), "%s.tmp", pscratchpad_local_cache); - unlink(file_name_buff); - fp = fopen(file_name_buff, "wbx"); - if (!fp) { - applog(LOG_ERR, "failed to create file %s: %s", file_name_buff, strerror(errno)); - return false; - } - - struct scratchpad_file_header sf = { 0 }; - memcpy(sf.add_arr, add_arr, sizeof(sf.add_arr)); - sf.current_hi = current_scratchpad_hi; - sf.scratchpad_size = scratchpad_size; - - if ((fwrite(&sf, sizeof(sf), 1, fp) != 1) || - (fwrite(pscratchpad_buff, 8, (size_t) scratchpad_size, fp) != scratchpad_size)) { - applog(LOG_ERR, "failed to write file %s: %s", file_name_buff, strerror(errno)); - fclose(fp); - unlink(file_name_buff); - return false; - } - fflush(fp); - /*if (do_fsync) { - if (fsync(fileno(fp)) == -1) { - applog(LOG_ERR, "failed to fsync file %s: %s", file_name_buff, strerror(errno)); - fclose(fp); - unlink(file_name_buff); - return false; - } - }*/ - if (fclose(fp) == EOF) { - applog(LOG_ERR, "failed to write file %s: %s", file_name_buff, strerror(errno)); - unlink(file_name_buff); - return false; - } - ret = rename(file_name_buff, pscratchpad_local_cache); - if (ret == -1) { - applog(LOG_ERR, "failed to rename %s to %s: %s", - file_name_buff, pscratchpad_local_cache, strerror(errno)); - unlink(file_name_buff); - return false; - } - applog(LOG_DEBUG, "saved scratchpad to %s (%zu+%zu bytes)", pscratchpad_local_cache, - sizeof(struct scratchpad_file_header), (size_t)scratchpad_size * 8); - return true; -} - -/* TODO: repetitive error+log spam handling */ -bool load_scratchpad_from_file(const char *fname) -{ - FILE *fp; - long flen; - - if(opt_algo != ALGO_WILDKECCAK) return true; - - fp = fopen(fname, "rb"); - if (!fp) { - if (errno != ENOENT) { - applog(LOG_ERR, "failed to load %s: %s", fname, strerror(errno)); - } - return false; - } - - struct scratchpad_file_header fh = { 0 }; - if ((fread(&fh, sizeof(fh), 1, fp) != 1)) { - applog(LOG_ERR, "read error from %s: %s", fname, strerror(errno)); - fclose(fp); - return false; - } - - if ((fh.scratchpad_size*8 > (WILD_KECCAK_SCRATCHPAD_BUFFSIZE)) ||(fh.scratchpad_size%4)) { - applog(LOG_ERR, "file %s size invalid (%" PRIu64 "), max=%zu", - fname, fh.scratchpad_size*8, WILD_KECCAK_SCRATCHPAD_BUFFSIZE); - fclose(fp); - return false; - } - - if (fread(pscratchpad_buff, 8, (size_t) fh.scratchpad_size, fp) != fh.scratchpad_size) { - applog(LOG_ERR, "read error from %s: %s", fname, strerror(errno)); - fclose(fp); - return false; - } - - scratchpad_size = fh.scratchpad_size; - current_scratchpad_hi = fh.current_hi; - memcpy(&add_arr[0], &fh.add_arr[0], sizeof(fh.add_arr)); - flen = (long)scratchpad_size*8; - - if (!opt_quiet) { - applog(LOG_INFO, "Scratchpad size %ld kB at block %" PRIu64, flen/1024, current_scratchpad_hi.height); - } - - fclose(fp); - prev_save = time(NULL); - - return true; -} - -bool dump_scratchpad_to_file_debug() -{ - char file_name_buff[1024] = { 0 }; - if(opt_algo != ALGO_WILDKECCAK) return true; - - snprintf(file_name_buff, sizeof(file_name_buff), "scratchpad_%" PRIu64 "_%llx.scr", - current_scratchpad_hi.height, (long long) last_found_nonce); - - /* do not bother rewriting if it exists already */ - - FILE *fp = fopen(file_name_buff, "w"); - if(!fp) { - applog(LOG_WARNING, "failed to open file %s: %s", file_name_buff, strerror(errno)); - return false; - } - if (fwrite(pscratchpad_buff, 8, (size_t) scratchpad_size, fp) != scratchpad_size) { - applog(LOG_ERR, "failed to write file %s: %s", file_name_buff, strerror(errno)); - fclose(fp); - return false; - } - if (fclose(fp) == EOF) { - applog(LOG_ERR, "failed to write file %s: %s", file_name_buff, strerror(errno)); - return false; - } - - fclose(fp); - return true; -} - -static bool try_mkdir_chdir(const char *dirn) -{ - if (chdir(dirn) == -1) { - if (errno == ENOENT) { -#ifdef WIN32 - if (mkdir(dirn) == -1) { -#else - if (mkdir(dirn, 0700) == -1) { -#endif - applog(LOG_ERR, "mkdir failed: %s", strerror(errno)); - return false; - } - if (chdir(dirn) == -1) { - applog(LOG_ERR, "chdir failed: %s", strerror(errno)); - return false; - } - } else { - applog(LOG_ERR, "chdir failed: %s", strerror(errno)); - return false; - } - } - return true; -} - -static size_t curl_write_data(void *ptr, size_t size, size_t nmemb, FILE *stream) -{ - size_t written = fwrite(ptr, size, nmemb, stream); - return written; -} - -static bool download_inital_scratchpad(const char* path_to, const char* url) -{ - CURL *curl; - CURLcode res; - char curl_error_buff[CURL_ERROR_SIZE] = { 0 }; - FILE *fp = fopen(path_to,"wb"); - if (!fp) { - applog(LOG_ERR, "Failed to create file %s error %d", path_to, errno); - return false; - } - - applog(LOG_INFO, "Downloading scratchpad...."); - - curl_global_cleanup(); - res = curl_global_init(CURL_GLOBAL_ALL); - if (res != CURLE_OK) { - applog(LOG_WARNING, "curl curl_global_init error: %d", (int) res); - } - - curl = curl_easy_init(); - if (!curl) { - applog(LOG_INFO, "Failed to curl_easy_init."); - fclose(fp); - unlink(path_to); - return false; - } - - if (opt_protocol && opt_debug) { - curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); - } - if (opt_proxy) { - curl_easy_setopt(curl, CURLOPT_PROXY, opt_proxy); - curl_easy_setopt(curl, CURLOPT_PROXYTYPE, opt_proxy_type); - } - curl_easy_setopt(curl, CURLOPT_URL, url); - curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 30); - curl_easy_setopt(curl, CURLOPT_TIMEOUT, 300); - curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); - curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_error_buff); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_write_data); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp); - //curl_easy_setopt(curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2); - curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0); - if (opt_cert) { - curl_easy_setopt(curl, CURLOPT_CAINFO, opt_cert); - } else { - curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0); - } - - res = curl_easy_perform(curl); - if (res != CURLE_OK) { - if (res == CURLE_OUT_OF_MEMORY) { - applog(LOG_ERR, "Failed to download file, not enough memory!"); - applog(LOG_ERR, "curl error: %s", curl_error_buff); - } else { - applog(LOG_ERR, "Failed to download file, error: %s", curl_error_buff); - } - } else { - applog(LOG_INFO, "Scratchpad downloaded."); - } - /* always cleanup */ - curl_easy_cleanup(curl); - - fflush(fp); - fclose(fp); - - if (res != CURLE_OK) { - unlink(path_to); - return false; - } - return true; -} - -#ifndef WIN32 - -void GetScratchpad() -{ - const char *phome_var_name = "HOME"; - size_t sz = WILD_KECCAK_SCRATCHPAD_BUFFSIZE; - char cachedir[PATH_MAX]; - - if(!getenv(phome_var_name)) { - applog(LOG_ERR, "$%s not set", phome_var_name); - exit(1); - } - else if(!try_mkdir_chdir(getenv(phome_var_name))) { - exit(1); - } - - if(!try_mkdir_chdir(".cache")) exit(1); - - if(!try_mkdir_chdir(cachedir_suffix)) exit(1); - - if(getcwd(cachedir, sizeof(cachedir) - 22) == NULL) { - applog(LOG_ERR, "getcwd failed: %s", strerror(errno)); - exit(1); - } - - snprintf(scratchpad_file, sizeof(scratchpad_file), "%s/scratchpad.bin", cachedir); - pscratchpad_local_cache = scratchpad_file; - - if (!opt_quiet) - applog(LOG_INFO, "Scratchpad file %s", pscratchpad_local_cache); - - pscratchpad_buff = (uint64_t*) mmap(0, sz, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB | MAP_POPULATE, 0, 0); - if(pscratchpad_buff == MAP_FAILED) - { - if(opt_debug) applog(LOG_DEBUG, "hugetlb not available"); - pscratchpad_buff = (uint64_t*) malloc(sz); - if(!pscratchpad_buff) { - applog(LOG_ERR, "Scratchpad allocation failed"); - exit(1); - } - } else { - if(opt_debug) applog(LOG_DEBUG, "using hugetlb"); - } - madvise(pscratchpad_buff, sz, MADV_RANDOM | MADV_WILLNEED | MADV_HUGEPAGE); - mlock(pscratchpad_buff, sz); - - if(!load_scratchpad_from_file(pscratchpad_local_cache)) - { - if(!opt_scratchpad_url) { - applog(LOG_ERR, "Scratchpad URL not set. Please specify correct scratchpad url by -k or --scratchpad option"); - exit(1); - } - if(!download_inital_scratchpad(pscratchpad_local_cache, opt_scratchpad_url)) { - applog(LOG_ERR, "Scratchpad not found and not downloaded. Please specify correct scratchpad url by -k or --scratchpad option"); - exit(1); - } - if(!load_scratchpad_from_file(pscratchpad_local_cache)) { - applog(LOG_ERR, "Failed to load scratchpad data after downloading, probably broken scratchpad link, please restart miner with correct inital scratcpad link(-k or --scratchpad )"); - unlink(pscratchpad_local_cache); - exit(1); - } - } -} - -#else /* Windows */ - -void GetScratchpad() -{ - bool scratchpad_need_update = false; - size_t sz = WILD_KECCAK_SCRATCHPAD_BUFFSIZE; - const char* phome_var_name = "LOCALAPPDATA"; - char cachedir[PATH_MAX]; - - if(!getenv(phome_var_name)) { - applog(LOG_ERR, "%s env var is not set", phome_var_name); - exit(1); - } - else if(!try_mkdir_chdir(getenv(phome_var_name))) { - exit(1); - } - - if(!try_mkdir_chdir(".cache")) - exit(1); - - if(!try_mkdir_chdir(cachedir_suffix)) - exit(1); - - if(getcwd(cachedir, sizeof(cachedir) - 22) == NULL) { - applog(LOG_ERR, "getcwd failed: %s", strerror(errno)); - exit(1); - } - - snprintf(scratchpad_file, sizeof(scratchpad_file), "%s\\scratchpad.bin", cachedir); - pscratchpad_local_cache = scratchpad_file; - - if (!opt_quiet) - applog(LOG_INFO, "Scratchpad file %s", pscratchpad_local_cache); - - if (pscratchpad_buff) { - reset_scratchpad(); - wildkeccak_scratchpad_need_update(NULL); - scratchpad_need_update = true; - free(pscratchpad_buff); - pscratchpad_buff = NULL; - } - - pscratchpad_buff = (uint64_t*) malloc(sz); - if(!pscratchpad_buff) { - applog(LOG_ERR, "Scratchpad allocation failed"); - exit(1); - } - - if(!load_scratchpad_from_file(pscratchpad_local_cache)) - { - if(!opt_scratchpad_url) { - applog(LOG_ERR, "Scratchpad URL not set. Please specify correct scratchpad url by -k or --scratchpad option"); - exit(1); - } - free(pscratchpad_buff); - pscratchpad_buff = NULL; - if(!download_inital_scratchpad(pscratchpad_local_cache, opt_scratchpad_url)) { - applog(LOG_ERR, "Scratchpad not found and not downloaded. Please specify correct scratchpad url by -k or --scratchpad option"); - exit(1); - } - pscratchpad_buff = (uint64_t*) malloc(sz); - if(!pscratchpad_buff) { - applog(LOG_ERR, "Scratchpad allocation failed"); - exit(1); - } - if(!load_scratchpad_from_file(pscratchpad_local_cache)) { - applog(LOG_ERR, "Failed to load scratchpad data after downloading, probably broken scratchpad link, please restart miner with correct inital scratcpad link(-k or --scratchpad )"); - unlink(pscratchpad_local_cache); - exit(1); - } - } - - if (scratchpad_need_update) - wildkeccak_scratchpad_need_update(pscratchpad_buff); -} - -#endif /* GetScratchpad() linux */ - -static bool rpc2_getfullscratchpad_decode(const json_t *val) -{ - const char* status; - const char* scratch_hex; - size_t len; - json_t *hi; - json_t *res = json_object_get(val, "result"); - if(!res) { - applog(LOG_ERR, "JSON invalid result in rpc2_getfullscratchpad_decode"); - goto err_out; - } - - //check status - status = get_json_string_param(res, "status"); - if (!status ) { - applog(LOG_ERR, "JSON status is not a string"); - goto err_out; - } - - if(strcmp(status, "OK")) { - applog(LOG_ERR, "JSON returned status \"%s\"", status); - goto err_out; - } - - //parse scratchpad - scratch_hex = get_json_string_param(res, "scratchpad_hex"); - if (!scratch_hex) { - applog(LOG_ERR, "JSON scratch_hex is not a string"); - goto err_out; - } - - len = hex2bin_len((unsigned char*)pscratchpad_buff, scratch_hex, WILD_KECCAK_SCRATCHPAD_BUFFSIZE); - if (!len) { - applog(LOG_ERR, "JSON scratch_hex is not valid hex"); - goto err_out; - } - - if (len%8 || len%32) { - applog(LOG_ERR, "JSON scratch_hex is not valid size=%d bytes", len); - goto err_out; - } - - //parse hi - hi = json_object_get(res, "hi"); - if(!hi) { - applog(LOG_ERR, "JSON inval hi"); - goto err_out; - } - - if(!parse_height_info(hi, ¤t_scratchpad_hi)) - { - applog(LOG_ERR, "JSON inval hi, failed to parse"); - goto err_out; - } - - applog(LOG_INFO, "Fetched scratchpad size %d bytes", len); - scratchpad_size = len/8; - - return true; - -err_out: return false; -} - -static bool rpc2_stratum_getscratchpad(struct stratum_ctx *sctx) -{ - bool ret = false; - json_t *val = NULL; - json_error_t err; - char *s, *sret; - if(opt_algo != ALGO_WILDKECCAK) return true; - - s = (char*) calloc(1, 1024); - if (!s) - goto out; - sprintf(s, "{\"method\": \"getfullscratchpad\", \"params\": {\"id\": \"%s\", \"agent\": \"" USER_AGENT "\"}, \"id\": 1}", rpc2_id); - - applog(LOG_INFO, "Getting full scratchpad...."); - if (!stratum_send_line(sctx, s)) - goto out; - - //sret = stratum_recv_line_timeout(sctx, 920); - sret = stratum_recv_line(sctx); - if (!sret) - goto out; - applog(LOG_DEBUG, "Getting full scratchpad received line"); - - val = JSON_LOADS(sret, &err); - free(sret); - if (!val) { - applog(LOG_ERR, "JSON decode rpc2_getscratchpad response failed(%d): %s", err.line, err.text); - goto out; - } - - applog(LOG_DEBUG, "Getting full scratchpad parsed line"); - - ret = rpc2_getfullscratchpad_decode(val); - -out: - free(s); - if (val) - json_decref(val); - - return ret; -} - -bool rpc2_stratum_authorize(struct stratum_ctx *sctx, const char *user, const char *pass) -{ - bool ret = false; - json_t *val = NULL, *res_val, *err_val, *job_val = NULL; - json_error_t err; - char *sret; - char *s = (char*) calloc(1, 320 + strlen(user) + strlen(pass)); - - if (opt_algo == ALGO_WILDKECCAK) { - char *prevhash = bin2hex((const unsigned char*)current_scratchpad_hi.prevhash, 32); - sprintf(s, "{\"method\":\"login\",\"params\":{\"login\":\"%s\",\"pass\":\"%s\"," - "\"hi\":{\"height\":%" PRIu64 ",\"block_id\":\"%s\"}," - "\"agent\":\"" USER_AGENT "\"},\"id\":2}", - user, pass, current_scratchpad_hi.height, prevhash); - free(prevhash); - } else { - sprintf(s, "{\"method\":\"login\",\"params\":{\"login\":\"%s\",\"pass\":\"%s\"," - "\"agent\":\"" USER_AGENT "\"},\"id\":2}", - user, pass); - } - - if (!stratum_send_line(sctx, s)) - goto out; - - while (1) { - sret = stratum_recv_line(sctx); - if (!sret) - goto out; - if (!stratum_handle_method(sctx, sret)) - break; - free(sret); - } - - val = JSON_LOADS(sret, &err); - free(sret); - if (!val) { - applog(LOG_ERR, "JSON decode failed(%d): %s", err.line, err.text); - goto out; - } - - res_val = json_object_get(val, "result"); - err_val = json_object_get(val, "error"); - - if (!res_val || json_is_false(res_val) || - (err_val && !json_is_null(err_val))) { - applog(LOG_ERR, "Stratum authentication failed"); - if (err_val) { - const char *msg = json_string_value(json_object_get(err_val,"message")); - if (msg && strlen(msg)) { - if (strstr(msg, "scratchpad too old") && pscratchpad_local_cache) { - if (unlink(pscratchpad_local_cache) == 0) { - applog(LOG_INFO, "Outdated scratchpad, deleted...", pscratchpad_local_cache); - GetScratchpad(); - goto out; - } - } - applog(LOG_NOTICE, "%s", msg); - } - } - goto out; - } - - rpc2_login_decode(val); - job_val = json_object_get(res_val, "job"); - - pthread_mutex_lock(&rpc2_work_lock); - if(job_val) rpc2_job_decode(job_val, &rpc2_work); - pthread_mutex_unlock(&rpc2_work_lock); - - ret = true; - -out: - free(s); - if (val) - json_decref(val); - - return ret; -} - -bool rpc2_stratum_request_job(struct stratum_ctx *sctx) -{ - json_t *val = NULL, *res_val, *err_val; - json_error_t err; - bool ret = false; - char *sret; - char *s = (char*) calloc(1, 10*2048); - if (!s) { - applog(LOG_ERR, "Stratum job OOM!"); - return ret; - } - - if (opt_algo == ALGO_WILDKECCAK) { - char* prevhash = bin2hex((const unsigned char*)current_scratchpad_hi.prevhash, 32); - sprintf(s, "{\"method\":\"getjob\",\"params\": {" - "\"id\":\"%s\", \"hi\": {\"height\": %" PRIu64 ",\"block_id\":\"%s\" }, \"agent\": \"" USER_AGENT "\"}," - "\"id\":1}", - rpc2_id, current_scratchpad_hi.height, prevhash); - free(prevhash); - } else { - sprintf(s, "{\"method\":\"getjob\",\"params\":{\"id\":\"%s\"},\"id\":1}", rpc2_id); - } - - if(!stratum_send_line(sctx, s)) { - applog(LOG_ERR, "Stratum failed to send getjob line"); - goto out; - } - - sret = stratum_recv_line(sctx); - if (!sret) { - applog(LOG_ERR, "Stratum failed to recv getjob line"); - goto out; - } - - val = JSON_LOADS(sret, &err); - free(sret); - if (!val) { - applog(LOG_ERR, "JSON getwork decode failed(%d): %s", err.line, err.text); - goto out; - } - - res_val = json_object_get(val, "result"); - err_val = json_object_get(val, "error"); - - if (!res_val || json_is_false(res_val) || - (err_val && !json_is_null(err_val))) { - applog(LOG_ERR, "Stratum getjob failed"); - goto out; - } - - pthread_mutex_lock(&rpc2_work_lock); - rpc2_job_decode(res_val, &rpc2_work); - pthread_mutex_unlock(&rpc2_work_lock); - - ret = true; -out: - if (val) - json_decref(val); - - return ret; -} - -int rpc2_stratum_thread_stuff(struct pool_infos* pool) -{ - int opt_fail_pause = 10; - - if(!strcmp(rpc2_id, "")) { - if (!opt_quiet) - applog(LOG_DEBUG, "disconnecting..."); - stratum_disconnect(&stratum); - //not logged in, try to relogin - if (!opt_quiet) - applog(LOG_DEBUG, "Re-connect and relogin..."); - if(!stratum_connect(&stratum, stratum.url) || !stratum_authorize(&stratum, pool->user, pool->pass)) { - stratum_disconnect(&stratum); - applog(LOG_ERR, "Failed...retry after %d seconds", opt_fail_pause); - sleep(opt_fail_pause); - } - } - - if(!scratchpad_size && opt_algo == ALGO_WILDKECCAK) { - if(!rpc2_stratum_getscratchpad(&stratum)) { - stratum_disconnect(&stratum); - applog(LOG_ERR, "...retry after %d seconds", opt_fail_pause); - sleep(opt_fail_pause); - } - store_scratchpad_to_file(false); - prev_save = time(NULL); - - if(!rpc2_stratum_request_job(&stratum)) { - stratum_disconnect(&stratum); - applog(LOG_ERR, "...retry after %d seconds", opt_fail_pause); - sleep(opt_fail_pause); - } - } - - /* save every 12 hours */ - if ((time(NULL) - prev_save) > 12*3600) { - store_scratchpad_to_file(false); - prev_save = time(NULL); - } - - if (rpc2_work.job_id && (!g_work_time || strcmp(rpc2_work.job_id, g_work.job_id))) { - pthread_mutex_lock(&rpc2_work_lock); - rpc2_stratum_gen_work(&stratum, &g_work); - g_work_time = time(NULL); - pthread_mutex_unlock(&rpc2_work_lock); - - if (opt_debug) applog(LOG_DEBUG, "Stratum detected new block"); - restart_threads(); - } - - return 0; -} - -void rpc2_init() -{ - memset(¤t_scratchpad_hi, 0, sizeof(struct scratchpad_hi)); - memset(&rpc2_work, 0, sizeof(struct work)); - - pthread_mutex_init(&rpc2_job_lock, NULL); - pthread_mutex_init(&rpc2_work_lock, NULL); - pthread_mutex_init(&rpc2_login_lock, NULL); - //pthread_mutex_init(&rpc2_getscratchpad_lock, NULL); -} diff --git a/crypto/xmr-rpc.h b/crypto/xmr-rpc.h deleted file mode 100644 index 6e6002f6..00000000 --- a/crypto/xmr-rpc.h +++ /dev/null @@ -1,41 +0,0 @@ - -#include - -#include "wildkeccak.h" - -#ifdef WIN32 -#define _PACKED _ALIGN(4) -#else -#define _PACKED __attribute__((__packed__)) -#endif - -struct _PACKED scratchpad_hi { - unsigned char prevhash[32]; - uint64_t height; -}; - -struct _PACKED addendums_array_entry { - struct scratchpad_hi prev_hi; - uint64_t add_size; -}; - - -struct _PACKED scratchpad_file_header { - struct scratchpad_hi current_hi; - struct addendums_array_entry add_arr[WILD_KECCAK_ADDENDUMS_ARRAY_SIZE]; - uint64_t scratchpad_size; -}; - - -bool rpc2_job_decode(const json_t *job, struct work *work); -bool rpc2_stratum_job(struct stratum_ctx *sctx, json_t *id, json_t *params); -bool rpc2_stratum_gen_work(struct stratum_ctx *sctx, struct work *work); -bool rpc2_stratum_submit(struct pool_infos *pool, struct work *work); - -int rpc2_stratum_thread_stuff(struct pool_infos* pool); - -bool rpc2_login_decode(const json_t *val); - -void rpc2_init(); - -void GetScratchpad(); diff --git a/cuda_fugue256.h b/cuda_fugue256.h deleted file mode 100644 index 44f3fd02..00000000 --- a/cuda_fugue256.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _CUDA_FUGUE256_H -#define _CUDA_FUGUE256_H - -void fugue256_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce, void *outputHashes, uint32_t *nounce); -void fugue256_cpu_setBlock(int thr_id, void *data, void *pTargetIn); -void fugue256_cpu_init(int thr_id, uint32_t threads); -void fugue256_cpu_free(int thr_id); - -#endif diff --git a/cuda_groestlcoin.cu b/cuda_groestlcoin.cu deleted file mode 100644 index 5c8fcf9c..00000000 --- a/cuda_groestlcoin.cu +++ /dev/null @@ -1,163 +0,0 @@ -// Auf Groestlcoin spezialisierte Version von Groestl inkl. Bitslice - -#include -#include - -#include "cuda_helper.h" - -#ifdef __INTELLISENSE__ -#define __CUDA_ARCH__ 500 -#define __byte_perm(x,y,n) x -#endif - -#include "miner.h" - -__constant__ uint32_t pTarget[8]; // Single GPU -__constant__ uint32_t groestlcoin_gpu_msg[32]; - -static uint32_t *d_resultNonce[MAX_GPUS]; - -#if __CUDA_ARCH__ >= 300 -// 64 Registers Variant for Compute 3.0+ -#include "quark/groestl_functions_quad.h" -#include "quark/groestl_transf_quad.h" -#endif - -#define SWAB32(x) cuda_swab32(x) - -__global__ __launch_bounds__(256, 4) -void groestlcoin_gpu_hash_quad(uint32_t threads, uint32_t startNounce, uint32_t *resNounce) -{ -#if __CUDA_ARCH__ >= 300 - // durch 4 dividieren, weil jeweils 4 Threads zusammen ein Hash berechnen - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x) / 4; - if (thread < threads) - { - // GROESTL - uint32_t paddedInput[8]; - - #pragma unroll 8 - for(int k=0;k<8;k++) paddedInput[k] = groestlcoin_gpu_msg[4*k+threadIdx.x%4]; - - uint32_t nounce = startNounce + thread; - if ((threadIdx.x % 4) == 3) - paddedInput[4] = SWAB32(nounce); // 4*4+3 = 19 - - uint32_t msgBitsliced[8]; - to_bitslice_quad(paddedInput, msgBitsliced); - - uint32_t state[8]; - for (int round=0; round<2; round++) - { - groestl512_progressMessage_quad(state, msgBitsliced); - - if (round < 1) - { - // Verkettung zweier Runden inclusive Padding. - msgBitsliced[ 0] = __byte_perm(state[ 0], 0x00800100, 0x4341 + ((threadIdx.x%4)==3)*0x2000); - msgBitsliced[ 1] = __byte_perm(state[ 1], 0x00800100, 0x4341); - msgBitsliced[ 2] = __byte_perm(state[ 2], 0x00800100, 0x4341); - msgBitsliced[ 3] = __byte_perm(state[ 3], 0x00800100, 0x4341); - msgBitsliced[ 4] = __byte_perm(state[ 4], 0x00800100, 0x4341); - msgBitsliced[ 5] = __byte_perm(state[ 5], 0x00800100, 0x4341); - msgBitsliced[ 6] = __byte_perm(state[ 6], 0x00800100, 0x4341); - msgBitsliced[ 7] = __byte_perm(state[ 7], 0x00800100, 0x4341 + ((threadIdx.x%4)==0)*0x0010); - } - } - - // Nur der erste von jeweils 4 Threads bekommt das Ergebns-Hash - uint32_t out_state[16]; - from_bitslice_quad(state, out_state); - - if (threadIdx.x % 4 == 0) - { - int i, position = -1; - bool rc = true; - - #pragma unroll 8 - for (i = 7; i >= 0; i--) { - if (out_state[i] > pTarget[i]) { - if(position < i) { - position = i; - rc = false; - } - } - if (out_state[i] < pTarget[i]) { - if(position < i) { - position = i; - rc = true; - } - } - } - - if(rc && resNounce[0] > nounce) - resNounce[0] = nounce; - } - } -#endif -} - -__host__ -void groestlcoin_cpu_init(int thr_id, uint32_t threads) -{ - // to check if the binary supports SM3+ - cuda_get_arch(thr_id); - - CUDA_SAFE_CALL(cudaMalloc(&d_resultNonce[thr_id], sizeof(uint32_t))); -} - -__host__ -void groestlcoin_cpu_free(int thr_id) -{ - cudaFree(d_resultNonce[thr_id]); -} - -__host__ -void groestlcoin_cpu_setBlock(int thr_id, void *data, void *pTargetIn) -{ - uint32_t msgBlock[32] = { 0 }; - - memcpy(&msgBlock[0], data, 80); - - // Erweitere die Nachricht auf den Nachrichtenblock (padding) - // Unsere Nachricht hat 80 Byte - msgBlock[20] = 0x80; - msgBlock[31] = 0x01000000; - - // groestl512 braucht hierfür keinen CPU-Code (die einzige Runde wird - // auf der GPU ausgeführt) - - // Blockheader setzen (korrekte Nonce und Hefty Hash fehlen da drin noch) - cudaMemcpyToSymbol(groestlcoin_gpu_msg, msgBlock, 128); - - cudaMemset(d_resultNonce[thr_id], 0xFF, sizeof(uint32_t)); - cudaMemcpyToSymbol(pTarget, pTargetIn, 32); -} - -__host__ -void groestlcoin_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *resNonce) -{ - uint32_t threadsperblock = 256; - - // Compute 3.0 benutzt die registeroptimierte Quad Variante mit Warp Shuffle - // mit den Quad Funktionen brauchen wir jetzt 4 threads pro Hash, daher Faktor 4 bei der Blockzahl - int factor = 4; - - // berechne wie viele Thread Blocks wir brauchen - dim3 grid(factor*((threads + threadsperblock-1)/threadsperblock)); - dim3 block(threadsperblock); - - int dev_id = device_map[thr_id]; - if (device_sm[dev_id] < 300 || cuda_arch[dev_id] < 300) { - gpulog(LOG_ERR, thr_id, "Sorry, This algo is not supported by this GPU arch (SM 3.0 required)"); - proper_exit(EXIT_CODE_CUDA_ERROR); - } - - cudaMemset(d_resultNonce[thr_id], 0xFF, sizeof(uint32_t)); - groestlcoin_gpu_hash_quad <<>> (threads, startNounce, d_resultNonce[thr_id]); - - // Strategisches Sleep Kommando zur Senkung der CPU Last - // MyStreamSynchronize(NULL, 0, thr_id); - - cudaMemcpy(resNonce, d_resultNonce[thr_id], sizeof(uint32_t), cudaMemcpyDeviceToHost); -} diff --git a/cuda_groestlcoin.h b/cuda_groestlcoin.h deleted file mode 100644 index e38f086f..00000000 --- a/cuda_groestlcoin.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _CUDA_GROESTLCOIN_H -#define _CUDA_GROESTLCOIN_H - -void groestlcoin_cpu_init(int thr_id, uint32_t threads); -void groestlcoin_cpu_free(int thr_id); -void groestlcoin_cpu_setBlock(int thr_id, void *data, void *pTargetIn); -void groestlcoin_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *resNonce); - -#endif \ No newline at end of file diff --git a/cuda_myriadgroestl.cu b/cuda_myriadgroestl.cu deleted file mode 100644 index 4edc142d..00000000 --- a/cuda_myriadgroestl.cu +++ /dev/null @@ -1,360 +0,0 @@ -// Auf Myriadcoin spezialisierte Version von Groestl inkl. Bitslice - -#include -#include - -#include "cuda_helper.h" - -#ifdef __INTELLISENSE__ -#define __CUDA_ARCH__ 500 -#define __funnelshift_r(x,y,n) (x >> n) -#define atomicExch(p,x) x -#endif - -#if __CUDA_ARCH__ >= 300 -// 64 Registers Variant for Compute 3.0 -#include "quark/groestl_functions_quad.h" -#include "quark/groestl_transf_quad.h" -#endif - -// globaler Speicher für alle HeftyHashes aller Threads -static uint32_t *d_outputHashes[MAX_GPUS]; -static uint32_t *d_resultNonces[MAX_GPUS]; - -__constant__ uint32_t pTarget[2]; // Same for all GPU -__constant__ uint32_t myriadgroestl_gpu_msg[32]; - -// muss expandiert werden -__constant__ uint32_t myr_sha256_gpu_constantTable[64]; -__constant__ uint32_t myr_sha256_gpu_constantTable2[64]; - -const uint32_t myr_sha256_cpu_constantTable[] = { - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2, -}; - -const uint32_t myr_sha256_cpu_w2Table[] = { - 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000200, - 0x80000000, 0x01400000, 0x00205000, 0x00005088, 0x22000800, 0x22550014, 0x05089742, 0xa0000020, - 0x5a880000, 0x005c9400, 0x0016d49d, 0xfa801f00, 0xd33225d0, 0x11675959, 0xf6e6bfda, 0xb30c1549, - 0x08b2b050, 0x9d7c4c27, 0x0ce2a393, 0x88e6e1ea, 0xa52b4335, 0x67a16f49, 0xd732016f, 0x4eeb2e91, - 0x5dbf55e5, 0x8eee2335, 0xe2bc5ec2, 0xa83f4394, 0x45ad78f7, 0x36f3d0cd, 0xd99c05e8, 0xb0511dc7, - 0x69bc7ac4, 0xbd11375b, 0xe3ba71e5, 0x3b209ff2, 0x18feee17, 0xe25ad9e7, 0x13375046, 0x0515089d, - 0x4f0d0f04, 0x2627484e, 0x310128d2, 0xc668b434, 0x420841cc, 0x62d311b8, 0xe59ba771, 0x85a7a484 -}; - -#define SWAB32(x) cuda_swab32(x) - -#if __CUDA_ARCH__ < 320 - // Kepler (Compute 3.0) - #define ROTR32(x, n) (((x) >> (n)) | ((x) << (32 - (n)))) -#else - // Kepler (Compute 3.5) - #define ROTR32(x, n) __funnelshift_r( (x), (x), (n) ) -#endif - -#define R(x, n) ((x) >> (n)) -#define Ch(x, y, z) ((x & (y ^ z)) ^ z) -#define Maj(x, y, z) ((x & (y | z)) | (y & z)) -#define S0(x) (ROTR32(x, 2) ^ ROTR32(x, 13) ^ ROTR32(x, 22)) -#define S1(x) (ROTR32(x, 6) ^ ROTR32(x, 11) ^ ROTR32(x, 25)) -#define s0(x) (ROTR32(x, 7) ^ ROTR32(x, 18) ^ R(x, 3)) -#define s1(x) (ROTR32(x, 17) ^ ROTR32(x, 19) ^ R(x, 10)) - -__device__ __forceinline__ -void myriadgroestl_gpu_sha256(uint32_t *message) -{ - uint32_t W1[16]; - #pragma unroll - for(int k=0; k<16; k++) - W1[k] = SWAB32(message[k]); - - uint32_t regs[8] = { - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, - 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 - }; - - // Progress W1 - #pragma unroll - for(int j=0; j<16; j++) - { - uint32_t T1 = regs[7] + S1(regs[4]) + Ch(regs[4], regs[5], regs[6]) + myr_sha256_gpu_constantTable[j] + W1[j]; - uint32_t T2 = S0(regs[0]) + Maj(regs[0], regs[1], regs[2]); - - #pragma unroll 7 - for (int k=6; k >= 0; k--) regs[k+1] = regs[k]; - regs[0] = T1 + T2; - regs[4] += T1; - } - - // Progress W2...W3 - uint32_t W2[16]; - - ////// PART 1 - #pragma unroll - for(int j=0; j<2; j++) - W2[j] = s1(W1[14+j]) + W1[9+j] + s0(W1[1+j]) + W1[j]; - - #pragma unroll 5 - for(int j=2; j<7;j++) - W2[j] = s1(W2[j-2]) + W1[9+j] + s0(W1[1+j]) + W1[j]; - - #pragma unroll - for(int j=7; j<15; j++) - W2[j] = s1(W2[j-2]) + W2[j-7] + s0(W1[1+j]) + W1[j]; - - W2[15] = s1(W2[13]) + W2[8] + s0(W2[0]) + W1[15]; - - // Round function - #pragma unroll - for(int j=0; j<16; j++) - { - uint32_t T1 = regs[7] + S1(regs[4]) + Ch(regs[4], regs[5], regs[6]) + myr_sha256_gpu_constantTable[j + 16] + W2[j]; - uint32_t T2 = S0(regs[0]) + Maj(regs[0], regs[1], regs[2]); - - #pragma unroll 7 - for (int l=6; l >= 0; l--) regs[l+1] = regs[l]; - regs[0] = T1 + T2; - regs[4] += T1; - } - - ////// PART 2 - #pragma unroll - for(int j=0; j<2; j++) - W1[j] = s1(W2[14+j]) + W2[9+j] + s0(W2[1+j]) + W2[j]; - #pragma unroll 5 - for(int j=2; j<7; j++) - W1[j] = s1(W1[j-2]) + W2[9+j] + s0(W2[1+j]) + W2[j]; - - #pragma unroll - for(int j=7; j<15; j++) - W1[j] = s1(W1[j-2]) + W1[j-7] + s0(W2[1+j]) + W2[j]; - - W1[15] = s1(W1[13]) + W1[8] + s0(W1[0]) + W2[15]; - - // Round function - #pragma unroll - for(int j=0; j<16; j++) - { - uint32_t T1 = regs[7] + S1(regs[4]) + Ch(regs[4], regs[5], regs[6]) + myr_sha256_gpu_constantTable[j + 32] + W1[j]; - uint32_t T2 = S0(regs[0]) + Maj(regs[0], regs[1], regs[2]); - - #pragma unroll 7 - for (int l=6; l >= 0; l--) regs[l+1] = regs[l]; - regs[0] = T1 + T2; - regs[4] += T1; - } - - ////// PART 3 - #pragma unroll - for(int j=0; j<2; j++) - W2[j] = s1(W1[14+j]) + W1[9+j] + s0(W1[1+j]) + W1[j]; - - #pragma unroll 5 - for(int j=2; j<7; j++) - W2[j] = s1(W2[j-2]) + W1[9+j] + s0(W1[1+j]) + W1[j]; - - #pragma unroll - for(int j=7; j<15; j++) - W2[j] = s1(W2[j-2]) + W2[j-7] + s0(W1[1+j]) + W1[j]; - - W2[15] = s1(W2[13]) + W2[8] + s0(W2[0]) + W1[15]; - - // Round function - #pragma unroll - for(int j=0; j<16; j++) - { - uint32_t T1 = regs[7] + S1(regs[4]) + Ch(regs[4], regs[5], regs[6]) + myr_sha256_gpu_constantTable[j + 48] + W2[j]; - uint32_t T2 = S0(regs[0]) + Maj(regs[0], regs[1], regs[2]); - - #pragma unroll 7 - for (int l=6; l >= 0; l--) regs[l+1] = regs[l]; - regs[0] = T1 + T2; - regs[4] += T1; - } - - uint32_t hash[8] = { - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, - 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 - }; - - #pragma unroll 8 - for(int k=0; k<8; k++) - hash[k] += regs[k]; - - ///// - ///// 2nd Round (wegen Msg-Padding) - ///// - #pragma unroll - for(int k=0; k<8; k++) - regs[k] = hash[k]; - - // Progress W1 - #pragma unroll - for(int j=0; j<64; j++) - { - uint32_t T1 = regs[7] + S1(regs[4]) + Ch(regs[4], regs[5], regs[6]) + myr_sha256_gpu_constantTable2[j]; - uint32_t T2 = S0(regs[0]) + Maj(regs[0], regs[1], regs[2]); - - #pragma unroll 7 - for (int k=6; k >= 0; k--) regs[k+1] = regs[k]; - regs[0] = T1 + T2; - regs[4] += T1; - } - -#if 0 - // Full sha hash - #pragma unroll - for(int k=0; k<8; k++) - hash[k] += regs[k]; - - #pragma unroll - for(int k=0; k<8; k++) - message[k] = SWAB32(hash[k]); -#else - message[6] = SWAB32(hash[6] + regs[6]); - message[7] = SWAB32(hash[7] + regs[7]); -#endif -} - -__global__ -//__launch_bounds__(256, 6) // we want <= 40 regs -void myriadgroestl_gpu_hash_sha(uint32_t threads, uint32_t startNounce, uint32_t *hashBuffer, uint32_t *resNonces) -{ -#if __CUDA_ARCH__ >= 300 - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const uint32_t nonce = startNounce + thread; - - uint32_t out_state[16]; - uint32_t *inpHash = &hashBuffer[16 * thread]; - - #pragma unroll 16 - for (int i=0; i < 16; i++) - out_state[i] = inpHash[i]; - - myriadgroestl_gpu_sha256(out_state); - - if (out_state[7] <= pTarget[1] && out_state[6] <= pTarget[0]) - { - uint32_t tmp = atomicExch(&resNonces[0], nonce); - if (tmp != UINT32_MAX) - resNonces[1] = tmp; - } - } -#endif -} - -__global__ -__launch_bounds__(256, 4) -void myriadgroestl_gpu_hash_quad(uint32_t threads, uint32_t startNounce, uint32_t *hashBuffer) -{ -#if __CUDA_ARCH__ >= 300 - // durch 4 dividieren, weil jeweils 4 Threads zusammen ein Hash berechnen - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x) / 4; - if (thread < threads) - { - // GROESTL - uint32_t paddedInput[8]; - #pragma unroll 8 - for(int k=0; k<8; k++) - paddedInput[k] = myriadgroestl_gpu_msg[4*k+threadIdx.x%4]; - - uint32_t nounce = startNounce + thread; - if ((threadIdx.x % 4) == 3) - paddedInput[4] = SWAB32(nounce); // 4*4+3 = 19 - - uint32_t msgBitsliced[8]; - to_bitslice_quad(paddedInput, msgBitsliced); - - uint32_t state[8]; - groestl512_progressMessage_quad(state, msgBitsliced); - - uint32_t out_state[16]; - from_bitslice_quad(state, out_state); - - if ((threadIdx.x & 0x03) == 0) - { - uint32_t *outpHash = &hashBuffer[16 * thread]; - #pragma unroll 16 - for(int k=0; k<16; k++) outpHash[k] = out_state[k]; - } - } -#endif -} - -// Setup Function -__host__ -void myriadgroestl_cpu_init(int thr_id, uint32_t threads) -{ - uint32_t temp[64]; - for(int i=0; i<64; i++) - temp[i] = myr_sha256_cpu_w2Table[i] + myr_sha256_cpu_constantTable[i]; - - cudaMemcpyToSymbol( myr_sha256_gpu_constantTable2, temp, sizeof(uint32_t) * 64 ); - - cudaMemcpyToSymbol( myr_sha256_gpu_constantTable, - myr_sha256_cpu_constantTable, - sizeof(uint32_t) * 64 ); - - // to check if the binary supports SM3+ - cuda_get_arch(thr_id); - - cudaMalloc(&d_outputHashes[thr_id], (size_t) 64 * threads); - cudaMalloc(&d_resultNonces[thr_id], 2 * sizeof(uint32_t)); -} - -__host__ -void myriadgroestl_cpu_free(int thr_id) -{ - cudaFree(d_outputHashes[thr_id]); - cudaFree(d_resultNonces[thr_id]); -} - -__host__ -void myriadgroestl_cpu_setBlock(int thr_id, void *data, uint32_t *pTargetIn) -{ - uint32_t msgBlock[32] = { 0 }; - memcpy(&msgBlock[0], data, 80); - msgBlock[20] = 0x80; - msgBlock[31] = 0x01000000; - - cudaMemcpyToSymbol(myriadgroestl_gpu_msg, msgBlock, 128); - cudaMemcpyToSymbol(pTarget, &pTargetIn[6], 2 * sizeof(uint32_t)); -} - -__host__ -void myriadgroestl_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *resNounce) -{ - uint32_t threadsperblock = 256; - - cudaMemset(d_resultNonces[thr_id], 0xFF, 2 * sizeof(uint32_t)); - - // Compute 3.0 benutzt die registeroptimierte Quad Variante mit Warp Shuffle - // mit den Quad Funktionen brauchen wir jetzt 4 threads pro Hash, daher Faktor 4 bei der Blockzahl - const int factor = 4; - - dim3 grid(factor*((threads + threadsperblock-1)/threadsperblock)); - dim3 block(threadsperblock); - - int dev_id = device_map[thr_id]; - if (device_sm[dev_id] < 300 || cuda_arch[dev_id] < 300) { - printf("Sorry, This algo is not supported by this GPU arch (SM 3.0 required)"); - return; - } - - myriadgroestl_gpu_hash_quad <<< grid, block >>> (threads, startNounce, d_outputHashes[thr_id]); - - dim3 grid2((threads + threadsperblock-1)/threadsperblock); - myriadgroestl_gpu_hash_sha <<< grid2, block >>> (threads, startNounce, d_outputHashes[thr_id], d_resultNonces[thr_id]); - - cudaMemcpy(resNounce, d_resultNonces[thr_id], 2 * sizeof(uint32_t), cudaMemcpyDeviceToHost); -} diff --git a/cuda_skeincoin.cu b/cuda_skeincoin.cu deleted file mode 100644 index 8c91c5ef..00000000 --- a/cuda_skeincoin.cu +++ /dev/null @@ -1,747 +0,0 @@ -/* Merged skein512 80 + sha256 64 (in a single kernel) for SM 5+ - * based on sp and klaus work, adapted by tpruvot to keep skein2 compat - */ - -#include -#include -#include - -#include "cuda_helper.h" - -/* try 1024 for 970+ */ -#define TPB 512 - -static __constant__ uint64_t c_message16[2]; -static __constant__ uint2 precalcvalues[9]; - -static uint32_t *d_found[MAX_GPUS]; - -static __device__ __forceinline__ uint2 vectorizelow(uint32_t v) { - uint2 result; - result.x = v; - result.y = 0; - return result; -} - -static __device__ __forceinline__ uint2 vectorizehigh(uint32_t v) { - uint2 result; - result.x = 0; - result.y = v; - return result; -} - -/* - * M9_ ## s ## _ ## i evaluates to s+i mod 9 (0 <= s <= 18, 0 <= i <= 7). - */ - -#define M9_0_0 0 -#define M9_0_1 1 -#define M9_0_2 2 -#define M9_0_3 3 -#define M9_0_4 4 -#define M9_0_5 5 -#define M9_0_6 6 -#define M9_0_7 7 - -#define M9_1_0 1 -#define M9_1_1 2 -#define M9_1_2 3 -#define M9_1_3 4 -#define M9_1_4 5 -#define M9_1_5 6 -#define M9_1_6 7 -#define M9_1_7 8 - -#define M9_2_0 2 -#define M9_2_1 3 -#define M9_2_2 4 -#define M9_2_3 5 -#define M9_2_4 6 -#define M9_2_5 7 -#define M9_2_6 8 -#define M9_2_7 0 - -#define M9_3_0 3 -#define M9_3_1 4 -#define M9_3_2 5 -#define M9_3_3 6 -#define M9_3_4 7 -#define M9_3_5 8 -#define M9_3_6 0 -#define M9_3_7 1 - -#define M9_4_0 4 -#define M9_4_1 5 -#define M9_4_2 6 -#define M9_4_3 7 -#define M9_4_4 8 -#define M9_4_5 0 -#define M9_4_6 1 -#define M9_4_7 2 - -#define M9_5_0 5 -#define M9_5_1 6 -#define M9_5_2 7 -#define M9_5_3 8 -#define M9_5_4 0 -#define M9_5_5 1 -#define M9_5_6 2 -#define M9_5_7 3 - -#define M9_6_0 6 -#define M9_6_1 7 -#define M9_6_2 8 -#define M9_6_3 0 -#define M9_6_4 1 -#define M9_6_5 2 -#define M9_6_6 3 -#define M9_6_7 4 - -#define M9_7_0 7 -#define M9_7_1 8 -#define M9_7_2 0 -#define M9_7_3 1 -#define M9_7_4 2 -#define M9_7_5 3 -#define M9_7_6 4 -#define M9_7_7 5 - -#define M9_8_0 8 -#define M9_8_1 0 -#define M9_8_2 1 -#define M9_8_3 2 -#define M9_8_4 3 -#define M9_8_5 4 -#define M9_8_6 5 -#define M9_8_7 6 - -#define M9_9_0 0 -#define M9_9_1 1 -#define M9_9_2 2 -#define M9_9_3 3 -#define M9_9_4 4 -#define M9_9_5 5 -#define M9_9_6 6 -#define M9_9_7 7 - -#define M9_10_0 1 -#define M9_10_1 2 -#define M9_10_2 3 -#define M9_10_3 4 -#define M9_10_4 5 -#define M9_10_5 6 -#define M9_10_6 7 -#define M9_10_7 8 - -#define M9_11_0 2 -#define M9_11_1 3 -#define M9_11_2 4 -#define M9_11_3 5 -#define M9_11_4 6 -#define M9_11_5 7 -#define M9_11_6 8 -#define M9_11_7 0 - -#define M9_12_0 3 -#define M9_12_1 4 -#define M9_12_2 5 -#define M9_12_3 6 -#define M9_12_4 7 -#define M9_12_5 8 -#define M9_12_6 0 -#define M9_12_7 1 - -#define M9_13_0 4 -#define M9_13_1 5 -#define M9_13_2 6 -#define M9_13_3 7 -#define M9_13_4 8 -#define M9_13_5 0 -#define M9_13_6 1 -#define M9_13_7 2 - -#define M9_14_0 5 -#define M9_14_1 6 -#define M9_14_2 7 -#define M9_14_3 8 -#define M9_14_4 0 -#define M9_14_5 1 -#define M9_14_6 2 -#define M9_14_7 3 - -#define M9_15_0 6 -#define M9_15_1 7 -#define M9_15_2 8 -#define M9_15_3 0 -#define M9_15_4 1 -#define M9_15_5 2 -#define M9_15_6 3 -#define M9_15_7 4 - -#define M9_16_0 7 -#define M9_16_1 8 -#define M9_16_2 0 -#define M9_16_3 1 -#define M9_16_4 2 -#define M9_16_5 3 -#define M9_16_6 4 -#define M9_16_7 5 - -#define M9_17_0 8 -#define M9_17_1 0 -#define M9_17_2 1 -#define M9_17_3 2 -#define M9_17_4 3 -#define M9_17_5 4 -#define M9_17_6 5 -#define M9_17_7 6 - -#define M9_18_0 0 -#define M9_18_1 1 -#define M9_18_2 2 -#define M9_18_3 3 -#define M9_18_4 4 -#define M9_18_5 5 -#define M9_18_6 6 -#define M9_18_7 7 - -/* - * M3_ ## s ## _ ## i evaluates to s+i mod 3 (0 <= s <= 18, 0 <= i <= 1). - */ - -#define M3_0_0 0 -#define M3_0_1 1 -#define M3_1_0 1 -#define M3_1_1 2 -#define M3_2_0 2 -#define M3_2_1 0 -#define M3_3_0 0 -#define M3_3_1 1 -#define M3_4_0 1 -#define M3_4_1 2 -#define M3_5_0 2 -#define M3_5_1 0 -#define M3_6_0 0 -#define M3_6_1 1 -#define M3_7_0 1 -#define M3_7_1 2 -#define M3_8_0 2 -#define M3_8_1 0 -#define M3_9_0 0 -#define M3_9_1 1 -#define M3_10_0 1 -#define M3_10_1 2 -#define M3_11_0 2 -#define M3_11_1 0 -#define M3_12_0 0 -#define M3_12_1 1 -#define M3_13_0 1 -#define M3_13_1 2 -#define M3_14_0 2 -#define M3_14_1 0 -#define M3_15_0 0 -#define M3_15_1 1 -#define M3_16_0 1 -#define M3_16_1 2 -#define M3_17_0 2 -#define M3_17_1 0 -#define M3_18_0 0 -#define M3_18_1 1 - -#define XCAT(x, y) XCAT_(x, y) -#define XCAT_(x, y) x ## y - -#define SKBI(k, s, i) XCAT(k, XCAT(XCAT(XCAT(M9_, s), _), i)) -#define SKBT(t, s, v) XCAT(t, XCAT(XCAT(XCAT(M3_, s), _), v)) - -#define TFBIG_KINIT_UI2(k0, k1, k2, k3, k4, k5, k6, k7, k8, t0, t1, t2) { \ - k8 = ((k0 ^ k1) ^ (k2 ^ k3)) ^ ((k4 ^ k5) ^ (k6 ^ k7)) \ - ^ vectorize(SPH_C64(0x1BD11BDAA9FC1A22)); \ - t2 = t0 ^ t1; \ -} - -#define TFBIG_ADDKEY_UI2(w0, w1, w2, w3, w4, w5, w6, w7, k, t, s) { \ - w0 = (w0 + SKBI(k, s, 0)); \ - w1 = (w1 + SKBI(k, s, 1)); \ - w2 = (w2 + SKBI(k, s, 2)); \ - w3 = (w3 + SKBI(k, s, 3)); \ - w4 = (w4 + SKBI(k, s, 4)); \ - w5 = (w5 + SKBI(k, s, 5) + SKBT(t, s, 0)); \ - w6 = (w6 + SKBI(k, s, 6) + SKBT(t, s, 1)); \ - w7 = (w7 + SKBI(k, s, 7) + vectorize(s)); \ -} - -#define TFBIG_MIX_UI2(x0, x1, rc) { \ - x0 = x0 + x1; \ - x1 = ROL2(x1, rc) ^ x0; \ -} - -#define TFBIG_MIX8_UI2(w0, w1, w2, w3, w4, w5, w6, w7, rc0, rc1, rc2, rc3) { \ - TFBIG_MIX_UI2(w0, w1, rc0); \ - TFBIG_MIX_UI2(w2, w3, rc1); \ - TFBIG_MIX_UI2(w4, w5, rc2); \ - TFBIG_MIX_UI2(w6, w7, rc3); \ -} - -#define TFBIG_4e_UI2(s) { \ - TFBIG_ADDKEY_UI2(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, s); \ - TFBIG_MIX8_UI2(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], 46, 36, 19, 37); \ - TFBIG_MIX8_UI2(p[2], p[1], p[4], p[7], p[6], p[5], p[0], p[3], 33, 27, 14, 42); \ - TFBIG_MIX8_UI2(p[4], p[1], p[6], p[3], p[0], p[5], p[2], p[7], 17, 49, 36, 39); \ - TFBIG_MIX8_UI2(p[6], p[1], p[0], p[7], p[2], p[5], p[4], p[3], 44, 9, 54, 56); \ -} - -#define TFBIG_4o_UI2(s) { \ - TFBIG_ADDKEY_UI2(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, s); \ - TFBIG_MIX8_UI2(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], 39, 30, 34, 24); \ - TFBIG_MIX8_UI2(p[2], p[1], p[4], p[7], p[6], p[5], p[0], p[3], 13, 50, 10, 17); \ - TFBIG_MIX8_UI2(p[4], p[1], p[6], p[3], p[0], p[5], p[2], p[7], 25, 29, 39, 43); \ - TFBIG_MIX8_UI2(p[6], p[1], p[0], p[7], p[2], p[5], p[4], p[3], 8, 35, 56, 22); \ -} - -/* precalc */ - -#define TFBIG_ADDKEY_PRE(w0, w1, w2, w3, w4, w5, w6, w7, k, t, s) { \ - w0 = (w0 + SKBI(k, s, 0)); \ - w1 = (w1 + SKBI(k, s, 1)); \ - w2 = (w2 + SKBI(k, s, 2)); \ - w3 = (w3 + SKBI(k, s, 3)); \ - w4 = (w4 + SKBI(k, s, 4)); \ - w5 = (w5 + SKBI(k, s, 5) + SKBT(t, s, 0)); \ - w6 = (w6 + SKBI(k, s, 6) + SKBT(t, s, 1)); \ - w7 = (w7 + SKBI(k, s, 7) + (s)); \ -} - -#define TFBIG_MIX_PRE(x0, x1, rc) { \ - x0 = x0 + x1; \ - x1 = ROTL64(x1, rc) ^ x0; \ -} - -#define TFBIG_MIX8_PRE(w0, w1, w2, w3, w4, w5, w6, w7, rc0, rc1, rc2, rc3) { \ - TFBIG_MIX_PRE(w0, w1, rc0); \ - TFBIG_MIX_PRE(w2, w3, rc1); \ - TFBIG_MIX_PRE(w4, w5, rc2); \ - TFBIG_MIX_PRE(w6, w7, rc3); \ -} - -#define TFBIG_4e_PRE(s) { \ - TFBIG_ADDKEY_PRE(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, s); \ - TFBIG_MIX8_PRE(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], 46, 36, 19, 37); \ - TFBIG_MIX8_PRE(p[2], p[1], p[4], p[7], p[6], p[5], p[0], p[3], 33, 27, 14, 42); \ - TFBIG_MIX8_PRE(p[4], p[1], p[6], p[3], p[0], p[5], p[2], p[7], 17, 49, 36, 39); \ - TFBIG_MIX8_PRE(p[6], p[1], p[0], p[7], p[2], p[5], p[4], p[3], 44, 9, 54, 56); \ -} - -#define TFBIG_4o_PRE(s) { \ - TFBIG_ADDKEY_PRE(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, s); \ - TFBIG_MIX8_PRE(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], 39, 30, 34, 24); \ - TFBIG_MIX8_PRE(p[2], p[1], p[4], p[7], p[6], p[5], p[0], p[3], 13, 50, 10, 17); \ - TFBIG_MIX8_PRE(p[4], p[1], p[6], p[3], p[0], p[5], p[2], p[7], 25, 29, 39, 43); \ - TFBIG_MIX8_PRE(p[6], p[1], p[0], p[7], p[2], p[5], p[4], p[3], 8, 35, 56, 22); \ -} - -/* Elementary defines for SHA256 */ - -#define SWAB32(x) cuda_swab32(x) - -#define R(x, n) ((x) >> (n)) -#define Ch(x, y, z) ((x & (y ^ z)) ^ z) -#define Maj(x, y, z) ((x & (y | z)) | (y & z)) -#define S0(x) (ROTR32(x, 2) ^ ROTR32(x, 13) ^ ROTR32(x, 22)) -#define S1(x) (ROTR32(x, 6) ^ ROTR32(x, 11) ^ ROTR32(x, 25)) -#define s0(x) (ROTR32(x, 7) ^ ROTR32(x, 18) ^ R(x, 3)) -#define s1(x) (ROTR32(x,17) ^ ROTR32(x, 19) ^ R(x, 10)) - -static __device__ __constant__ uint32_t sha256_hashTable[] = { - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 -}; - -// precomputed table -static __constant__ uint32_t sha256_endingTable[64] = { - 0xc28a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf374, - 0x649b69c1, 0xf0fe4786, 0x0fe1edc6, 0x240cf254, 0x4fe9346f, 0x6cc984be, 0x61b9411e, 0x16f988fa, - 0xf2c65152, 0xa88e5a6d, 0xb019fc65, 0xb9d99ec7, 0x9a1231c3, 0xe70eeaa0, 0xfdb1232b, 0xc7353eb0, - 0x3069bad5, 0xcb976d5f, 0x5a0f118f, 0xdc1eeefd, 0x0a35b689, 0xde0b7a04, 0x58f4ca9d, 0xe15d5b16, - 0x007f3e86, 0x37088980, 0xa507ea32, 0x6fab9537, 0x17406110, 0x0d8cd6f1, 0xcdaa3b6d, 0xc0bbbe37, - 0x83613bda, 0xdb48a363, 0x0b02e931, 0x6fd15ca7, 0x521afaca, 0x31338431, 0x6ed41a95, 0x6d437890, - 0xc39c91f2, 0x9eccabbd, 0xb5c9a0e6, 0x532fb63c, 0xd2c741c6, 0x07237ea3, 0xa4954b68, 0x4c191d76 -}; - -static __constant__ uint32_t sha256_constantTable[64] = { - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -}; - -__global__ __launch_bounds__(TPB) -void skeincoin_gpu_hash_50(uint32_t threads, uint32_t startNounce, uint32_t* d_found, uint64_t target64, int swap) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint2 h0, h1, h2, h3, h4, h5, h6, h7, h8; - uint2 t0, t1, t2; - uint2 p[8]; - - h0 = precalcvalues[0]; - h1 = precalcvalues[1]; - h2 = precalcvalues[2]; - h3 = precalcvalues[3]; - h4 = precalcvalues[4]; - h5 = precalcvalues[5]; - h6 = precalcvalues[6]; - h7 = precalcvalues[7]; - t2 = precalcvalues[8]; - - const uint32_t nonce = startNounce + thread; - const uint2 nonce2 = make_uint2(_LODWORD(c_message16[1]), swap ? cuda_swab32(nonce) : nonce); - - // skein_big_close -> etype = 0x160, ptr = 16, bcount = 1, extra = 16 - p[0] = vectorize(c_message16[0]); - p[1] = nonce2; - - #pragma unroll - for (int i = 2; i < 8; i++) - p[i] = make_uint2(0, 0); - - t0 = vectorizelow(0x50ull); // SPH_T64(bcount << 6) + (sph_u64)(extra); - t1 = vectorizehigh(0xB0000000ul); // (bcount >> 58) + ((sph_u64)(etype) << 55); - TFBIG_KINIT_UI2(h0, h1, h2, h3, h4, h5, h6, h7, h8, t0, t1, t2); - TFBIG_4e_UI2(0); - TFBIG_4o_UI2(1); - TFBIG_4e_UI2(2); - TFBIG_4o_UI2(3); - TFBIG_4e_UI2(4); - TFBIG_4o_UI2(5); - TFBIG_4e_UI2(6); - TFBIG_4o_UI2(7); - TFBIG_4e_UI2(8); - TFBIG_4o_UI2(9); - TFBIG_4e_UI2(10); - TFBIG_4o_UI2(11); - TFBIG_4e_UI2(12); - TFBIG_4o_UI2(13); - TFBIG_4e_UI2(14); - TFBIG_4o_UI2(15); - TFBIG_4e_UI2(16); - TFBIG_4o_UI2(17); - TFBIG_ADDKEY_UI2(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, 18); - - - t0 = vectorizelow(8); // extra - t1 = vectorizehigh(0xFF000000ul); // etype - - h0 = vectorize(c_message16[0]) ^ p[0]; - h1 = nonce2 ^ p[1]; - h2 = p[2]; - h3 = p[3]; - h4 = p[4]; - h5 = p[5]; - h6 = p[6]; - h7 = p[7]; - - h8 = h0 ^ h1 ^ p[2] ^ p[3] ^ p[4] ^ p[5] ^ p[6] ^ p[7] ^ vectorize(0x1BD11BDAA9FC1A22); - t2 = vectorize(0xFF00000000000008ull); - - // p[8] = { 0 }; - #pragma unroll 8 - for (int i = 0; i<8; i++) - p[i] = make_uint2(0, 0); - - TFBIG_4e_UI2(0); - TFBIG_4o_UI2(1); - TFBIG_4e_UI2(2); - TFBIG_4o_UI2(3); - TFBIG_4e_UI2(4); - TFBIG_4o_UI2(5); - TFBIG_4e_UI2(6); - TFBIG_4o_UI2(7); - TFBIG_4e_UI2(8); - TFBIG_4o_UI2(9); - TFBIG_4e_UI2(10); - TFBIG_4o_UI2(11); - TFBIG_4e_UI2(12); - TFBIG_4o_UI2(13); - TFBIG_4e_UI2(14); - TFBIG_4o_UI2(15); - TFBIG_4e_UI2(16); - TFBIG_4o_UI2(17); - TFBIG_ADDKEY_UI2(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, 18); - - uint32_t *message = (uint32_t *)p; - - uint32_t regs[8]; - uint32_t hash[8]; - - // Init with Hash-Table - #pragma unroll 8 - for (int k = 0; k < 8; k++) { - hash[k] = regs[k] = sha256_hashTable[k]; - } - - uint32_t W1[16]; - uint32_t W2[16]; - - #pragma unroll 16 - for (int k = 0; k<16; k++) - W1[k] = SWAB32(message[k]); - - // Progress W1 - #pragma unroll 16 - for (int j = 0; j<16; j++) - { - uint32_t T1, T2; - T1 = regs[7] + S1(regs[4]) + Ch(regs[4], regs[5], regs[6]) + sha256_constantTable[j] + W1[j]; - T2 = S0(regs[0]) + Maj(regs[0], regs[1], regs[2]); - - #pragma unroll 7 - for (int k = 6; k >= 0; k--) regs[k + 1] = regs[k]; - regs[0] = T1 + T2; - regs[4] += T1; - } - - // Progress W2...W3 - - ////// PART 1 - #pragma unroll 2 - for (int j = 0; j<2; j++) - W2[j] = s1(W1[14 + j]) + W1[9 + j] + s0(W1[1 + j]) + W1[j]; - #pragma unroll 5 - for (int j = 2; j<7; j++) - W2[j] = s1(W2[j - 2]) + W1[9 + j] + s0(W1[1 + j]) + W1[j]; - - #pragma unroll 8 - for (int j = 7; j<15; j++) - W2[j] = s1(W2[j - 2]) + W2[j - 7] + s0(W1[1 + j]) + W1[j]; - - W2[15] = s1(W2[13]) + W2[8] + s0(W2[0]) + W1[15]; - - // Round function - #pragma unroll 16 - for (int j = 0; j<16; j++) - { - uint32_t T1, T2; - T1 = regs[7] + S1(regs[4]) + Ch(regs[4], regs[5], regs[6]) + sha256_constantTable[j + 16] + W2[j]; - T2 = S0(regs[0]) + Maj(regs[0], regs[1], regs[2]); - - #pragma unroll 7 - for (int l = 6; l >= 0; l--) regs[l + 1] = regs[l]; - regs[0] = T1 + T2; - regs[4] += T1; - } - - ////// PART 2 - #pragma unroll 2 - for (int j = 0; j<2; j++) - W1[j] = s1(W2[14 + j]) + W2[9 + j] + s0(W2[1 + j]) + W2[j]; - - #pragma unroll 5 - for (int j = 2; j<7; j++) - W1[j] = s1(W1[j - 2]) + W2[9 + j] + s0(W2[1 + j]) + W2[j]; - - #pragma unroll 8 - for (int j = 7; j<15; j++) - W1[j] = s1(W1[j - 2]) + W1[j - 7] + s0(W2[1 + j]) + W2[j]; - - W1[15] = s1(W1[13]) + W1[8] + s0(W1[0]) + W2[15]; - - // Round function - #pragma unroll 16 - for (int j = 0; j<16; j++) - { - uint32_t T1, T2; - T1 = regs[7] + S1(regs[4]) + Ch(regs[4], regs[5], regs[6]) + sha256_constantTable[j + 32] + W1[j]; - T2 = S0(regs[0]) + Maj(regs[0], regs[1], regs[2]); - - #pragma unroll 7 - for (int l = 6; l >= 0; l--) regs[l + 1] = regs[l]; - regs[0] = T1 + T2; - regs[4] += T1; - } - - ////// PART 3 - #pragma unroll 2 - for (int j = 0; j<2; j++) - W2[j] = s1(W1[14 + j]) + W1[9 + j] + s0(W1[1 + j]) + W1[j]; - - #pragma unroll 5 - for (int j = 2; j<7; j++) - W2[j] = s1(W2[j - 2]) + W1[9 + j] + s0(W1[1 + j]) + W1[j]; - - #pragma unroll 8 - for (int j = 7; j<15; j++) - W2[j] = s1(W2[j - 2]) + W2[j - 7] + s0(W1[1 + j]) + W1[j]; - - W2[15] = s1(W2[13]) + W2[8] + s0(W2[0]) + W1[15]; - - // Round function - #pragma unroll 16 - for (int j = 0; j<16; j++) - { - uint32_t T1, T2; - T1 = regs[7] + S1(regs[4]) + Ch(regs[4], regs[5], regs[6]) + sha256_constantTable[j + 48] + W2[j]; - T2 = S0(regs[0]) + Maj(regs[0], regs[1], regs[2]); - - #pragma unroll 7 - for (int l = 6; l >= 0; l--) regs[l + 1] = regs[l]; - regs[0] = T1 + T2; - regs[4] += T1; - } - - #pragma unroll 8 - for (int k = 0; k<8; k++) - hash[k] += regs[k]; - - ///// - ///// Second Pass (ending) - ///// - #pragma unroll 8 - for (int k = 0; k<8; k++) - regs[k] = hash[k]; - - // Progress W1 - uint32_t T1, T2; - #pragma unroll 1 - for (int j = 0; j<56; j++)//62 - { - T1 = regs[7] + S1(regs[4]) + Ch(regs[4], regs[5], regs[6]) + sha256_endingTable[j]; - T2 = S0(regs[0]) + Maj(regs[0], regs[1], regs[2]); - - #pragma unroll 7 - for (int k = 6; k >= 0; k--) - regs[k + 1] = regs[k]; - regs[0] = T1 + T2; - regs[4] += T1; - } - T1 = regs[7] + S1(regs[4]) + Ch(regs[4], regs[5], regs[6])+sha256_endingTable[56]; - T2 = S0(regs[0]) + Maj(regs[0], regs[1], regs[2]); - regs[7] = T1 + T2; - regs[3] += T1; - - T1 = regs[6] + S1(regs[3]) + Ch(regs[3], regs[4], regs[5]) + sha256_endingTable[57]; - T2 = S0(regs[7]) + Maj(regs[7], regs[0], regs[1]); - regs[6] = T1 + T2; - regs[2] += T1; - //************ - regs[1] += regs[5] + S1(regs[2]) + Ch(regs[2], regs[3], regs[4]) + sha256_endingTable[58]; - regs[0] += regs[4] + S1(regs[1]) + Ch(regs[1], regs[2], regs[3]) + sha256_endingTable[59]; - regs[7] += regs[3] + S1(regs[0]) + Ch(regs[0], regs[1], regs[2]) + sha256_endingTable[60]; - regs[6] += regs[2] + S1(regs[7]) + Ch(regs[7], regs[0], regs[1]) + sha256_endingTable[61]; - - uint64_t test = SWAB32(hash[7] + regs[7]); - test <<= 32; - test|= SWAB32(hash[6] + regs[6]); - if (test <= target64) - { - uint32_t tmp = atomicExch(&(d_found[0]), startNounce + thread); - if (tmp != UINT32_MAX) - d_found[1] = tmp; - } - } -} - -__host__ -static void precalc(uint64_t* message) -{ - uint64_t h0, h1, h2, h3, h4, h5, h6, h7, h8; - uint64_t t0, t1, t2; - - h0 = 0x4903ADFF749C51CEull; - h1 = 0x0D95DE399746DF03ull; - h2 = 0x8FD1934127C79BCEull; - h3 = 0x9A255629FF352CB1ull; - h4 = 0x5DB62599DF6CA7B0ull; - h5 = 0xEABE394CA9D5C3F4ull; - h6 = 0x991112C71A75B523ull; - h7 = 0xAE18A40B660FCC33ull; - //h8 = h0 ^ h1 ^ h2 ^ h3 ^ h4 ^ h5 ^ h6 ^ h7 ^ SPH_C64(0x1BD11BDAA9FC1A22); - h8 = 0xcab2076d98173ec4ULL; - - t0 = 64; // ptr - t1 = 0x7000000000000000ull; - t2 = 0x7000000000000040ull; - - uint64_t p[8]; - for (int i = 0; i<8; i++) - p[i] = message[i]; - - TFBIG_4e_PRE(0); - TFBIG_4o_PRE(1); - TFBIG_4e_PRE(2); - TFBIG_4o_PRE(3); - TFBIG_4e_PRE(4); - TFBIG_4o_PRE(5); - TFBIG_4e_PRE(6); - TFBIG_4o_PRE(7); - TFBIG_4e_PRE(8); - TFBIG_4o_PRE(9); - TFBIG_4e_PRE(10); - TFBIG_4o_PRE(11); - TFBIG_4e_PRE(12); - TFBIG_4o_PRE(13); - TFBIG_4e_PRE(14); - TFBIG_4o_PRE(15); - TFBIG_4e_PRE(16); - TFBIG_4o_PRE(17); - TFBIG_ADDKEY_PRE(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, 18); - - uint64_t buffer[9]; - buffer[0] = message[0] ^ p[0]; - buffer[1] = message[1] ^ p[1]; - buffer[2] = message[2] ^ p[2]; - buffer[3] = message[3] ^ p[3]; - buffer[4] = message[4] ^ p[4]; - buffer[5] = message[5] ^ p[5]; - buffer[6] = message[6] ^ p[6]; - buffer[7] = message[7] ^ p[7]; - buffer[8] = t2; - CUDA_SAFE_CALL(cudaMemcpyToSymbol(precalcvalues, buffer, sizeof(buffer), 0, cudaMemcpyHostToDevice)); -} - -__host__ -void skeincoin_init(int thr_id) -{ - cuda_get_arch(thr_id); - CUDA_SAFE_CALL(cudaMalloc(&d_found[thr_id], 2 * sizeof(uint32_t))); -} - -__host__ -void skeincoin_free(int thr_id) { - cudaFree(d_found[thr_id]); -} - -__host__ -void skeincoin_setBlock_80(int thr_id, void *pdata) -{ - uint64_t message[16]; - memcpy(&message[0], pdata, 80); - - cudaMemcpyToSymbol(c_message16, &message[8], 16, 0, cudaMemcpyHostToDevice); - - precalc(message); -} - -__host__ -uint32_t skeincoin_hash_sm5(int thr_id, uint32_t threads, uint32_t startNounce, int swap, uint64_t target64, uint32_t *secNonce) -{ - uint32_t h_found[2]; - uint32_t threadsperblock = TPB; - dim3 block(threadsperblock); - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - - memset(h_found, 0xff, sizeof(h_found)); - cudaMemset(d_found[thr_id], 0xff, 2 * sizeof(uint32_t)); - - skeincoin_gpu_hash_50 <<< grid, block >>> (threads, startNounce, d_found[thr_id], target64, swap); - - cudaMemcpy(h_found, d_found[thr_id], 2 * sizeof(uint32_t), cudaMemcpyDeviceToHost); - if (h_found[1] && h_found[1] != UINT32_MAX && h_found[1] != h_found[0]) - *secNonce = h_found[1]; - return h_found[0]; -} diff --git a/equi/blake2/blake2-config.h b/equi/blake2/blake2-config.h deleted file mode 100644 index 2a8f9ed6..00000000 --- a/equi/blake2/blake2-config.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - BLAKE2 reference source code package - optimized C implementations - - Written in 2012 by Samuel Neves - - To the extent possible under law, the author(s) have dedicated all copyright - and related and neighboring rights to this software to the public domain - worldwide. This software is distributed without any warranty. - - You should have received a copy of the CC0 Public Domain Dedication along with - this software. If not, see . -*/ -#pragma once -#ifndef __BLAKE2_CONFIG_H__ -#define __BLAKE2_CONFIG_H__ - -// These don't work everywhere -#if (defined(__SSE2__) || defined(_M_AMD_64) || defined(_M_X64)) -#define HAVE_SSE2 -#endif - -#if defined(__SSSE3__) -#define HAVE_SSSE3 -#endif - -#if defined(__SSE4_1__) -#define HAVE_SSE41 -#endif - -#if defined(__AVX__) -#define HAVE_AVX -#endif - -#if defined(__XOP__) -#define HAVE_XOP -#endif - - -#ifdef HAVE_AVX2 -#ifndef HAVE_AVX -#define HAVE_AVX -#endif -#endif - -#ifdef HAVE_XOP -#ifndef HAVE_AVX -#define HAVE_AVX -#endif -#endif - -#ifdef HAVE_AVX -#ifndef HAVE_SSE41 -#define HAVE_SSE41 -#endif -#endif - -#ifdef HAVE_SSE41 -#ifndef HAVE_SSSE3 -#define HAVE_SSSE3 -#endif -#endif - -#ifdef HAVE_SSSE3 -#define HAVE_SSE2 -#endif - -#if !defined(HAVE_SSE2) - -#ifdef _MSC_VER -// enforce required stuff for now -#define HAVE_SSE2 -//#define HAVE_SSSE3 -#define HAVE_SSE41 -#else -# error "This code requires at least SSE 4.1" -#endif - -#endif - -#endif - diff --git a/equi/blake2/blake2-impl.h b/equi/blake2/blake2-impl.h deleted file mode 100644 index 16219dbc..00000000 --- a/equi/blake2/blake2-impl.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - BLAKE2 reference source code package - optimized C implementations - - Written in 2012 by Samuel Neves - - To the extent possible under law, the author(s) have dedicated all copyright - and related and neighboring rights to this software to the public domain - worldwide. This software is distributed without any warranty. - - You should have received a copy of the CC0 Public Domain Dedication along with - this software. If not, see . -*/ -#pragma once -#ifndef __BLAKE2_IMPL_H__ -#define __BLAKE2_IMPL_H__ - -#include - -static inline uint32_t load32( const void *src ) -{ -#if defined(NATIVE_LITTLE_ENDIAN) - uint32_t w; - memcpy(&w, src, sizeof w); - return w; -#else - const uint8_t *p = ( const uint8_t * )src; - uint32_t w = *p++; - w |= ( uint32_t )( *p++ ) << 8; - w |= ( uint32_t )( *p++ ) << 16; - w |= ( uint32_t )( *p++ ) << 24; - return w; -#endif -} - -static inline uint64_t load64( const void *src ) -{ -#if defined(NATIVE_LITTLE_ENDIAN) - uint64_t w; - memcpy(&w, src, sizeof w); - return w; -#else - const uint8_t *p = ( const uint8_t * )src; - uint64_t w = *p++; - w |= ( uint64_t )( *p++ ) << 8; - w |= ( uint64_t )( *p++ ) << 16; - w |= ( uint64_t )( *p++ ) << 24; - w |= ( uint64_t )( *p++ ) << 32; - w |= ( uint64_t )( *p++ ) << 40; - w |= ( uint64_t )( *p++ ) << 48; - w |= ( uint64_t )( *p++ ) << 56; - return w; -#endif -} - -static inline void store32( void *dst, uint32_t w ) -{ -#if defined(NATIVE_LITTLE_ENDIAN) - memcpy(dst, &w, sizeof w); -#else - uint8_t *p = ( uint8_t * )dst; - *p++ = ( uint8_t )w; w >>= 8; - *p++ = ( uint8_t )w; w >>= 8; - *p++ = ( uint8_t )w; w >>= 8; - *p++ = ( uint8_t )w; -#endif -} - -static inline void store64( void *dst, uint64_t w ) -{ -#if defined(NATIVE_LITTLE_ENDIAN) - memcpy(dst, &w, sizeof w); -#else - uint8_t *p = ( uint8_t * )dst; - *p++ = ( uint8_t )w; w >>= 8; - *p++ = ( uint8_t )w; w >>= 8; - *p++ = ( uint8_t )w; w >>= 8; - *p++ = ( uint8_t )w; w >>= 8; - *p++ = ( uint8_t )w; w >>= 8; - *p++ = ( uint8_t )w; w >>= 8; - *p++ = ( uint8_t )w; w >>= 8; - *p++ = ( uint8_t )w; -#endif -} - -static inline uint64_t load48( const void *src ) -{ - const uint8_t *p = ( const uint8_t * )src; - uint64_t w = *p++; - w |= ( uint64_t )( *p++ ) << 8; - w |= ( uint64_t )( *p++ ) << 16; - w |= ( uint64_t )( *p++ ) << 24; - w |= ( uint64_t )( *p++ ) << 32; - w |= ( uint64_t )( *p++ ) << 40; - return w; -} - -static inline void store48( void *dst, uint64_t w ) -{ - uint8_t *p = ( uint8_t * )dst; - *p++ = ( uint8_t )w; w >>= 8; - *p++ = ( uint8_t )w; w >>= 8; - *p++ = ( uint8_t )w; w >>= 8; - *p++ = ( uint8_t )w; w >>= 8; - *p++ = ( uint8_t )w; w >>= 8; - *p++ = ( uint8_t )w; -} - -static inline uint32_t rotl32( const uint32_t w, const unsigned c ) -{ - return ( w << c ) | ( w >> ( 32 - c ) ); -} - -static inline uint64_t rotl64( const uint64_t w, const unsigned c ) -{ - return ( w << c ) | ( w >> ( 64 - c ) ); -} - -static inline uint32_t rotr32( const uint32_t w, const unsigned c ) -{ - return ( w >> c ) | ( w << ( 32 - c ) ); -} - -static inline uint64_t rotr64( const uint64_t w, const unsigned c ) -{ - return ( w >> c ) | ( w << ( 64 - c ) ); -} - -/* prevents compiler optimizing out memset() */ -static inline void secure_zero_memory( void *v, size_t n ) -{ - volatile uint8_t *p = ( volatile uint8_t * )v; - while( n-- ) *p++ = 0; -} - -#endif - diff --git a/equi/blake2/blake2-round.h b/equi/blake2/blake2-round.h deleted file mode 100644 index 400ed203..00000000 --- a/equi/blake2/blake2-round.h +++ /dev/null @@ -1,85 +0,0 @@ -#define _mm_roti_epi64(x, c) \ - (-(c) == 32) ? _mm_shuffle_epi32((x), _MM_SHUFFLE(2,3,0,1)) \ - : (-(c) == 24) ? _mm_shuffle_epi8((x), r24) \ - : (-(c) == 16) ? _mm_shuffle_epi8((x), r16) \ - : (-(c) == 63) ? _mm_xor_si128(_mm_srli_epi64((x), -(c)), _mm_add_epi64((x), (x))) \ - : _mm_xor_si128(_mm_srli_epi64((x), -(c)), _mm_slli_epi64((x), 64-(-(c)))) - -#define G1(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h) \ - row1l = _mm_add_epi64(row1l, row2l); \ - row1h = _mm_add_epi64(row1h, row2h); \ - \ - row4l = _mm_xor_si128(row4l, row1l); \ - row4h = _mm_xor_si128(row4h, row1h); \ - \ - row4l = _mm_roti_epi64(row4l, -32); \ - row4h = _mm_roti_epi64(row4h, -32); \ - \ - row3l = _mm_add_epi64(row3l, row4l); \ - row3h = _mm_add_epi64(row3h, row4h); \ - \ - row2l = _mm_xor_si128(row2l, row3l); \ - row2h = _mm_xor_si128(row2h, row3h); \ - \ - row2l = _mm_roti_epi64(row2l, -24); \ - row2h = _mm_roti_epi64(row2h, -24); \ - -#define G2(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h) \ - row1l = _mm_add_epi64(row1l, row2l); \ - row1h = _mm_add_epi64(row1h, row2h); \ - \ - row4l = _mm_xor_si128(row4l, row1l); \ - row4h = _mm_xor_si128(row4h, row1h); \ - \ - row4l = _mm_roti_epi64(row4l, -16); \ - row4h = _mm_roti_epi64(row4h, -16); \ - \ - row3l = _mm_add_epi64(row3l, row4l); \ - row3h = _mm_add_epi64(row3h, row4h); \ - \ - row2l = _mm_xor_si128(row2l, row3l); \ - row2h = _mm_xor_si128(row2h, row3h); \ - \ - row2l = _mm_roti_epi64(row2l, -63); \ - row2h = _mm_roti_epi64(row2h, -63); \ - -#define DIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h) \ - t0 = _mm_alignr_epi8(row2h, row2l, 8); \ - t1 = _mm_alignr_epi8(row2l, row2h, 8); \ - row2l = t0; \ - row2h = t1; \ - \ - t0 = row3l; \ - row3l = row3h; \ - row3h = t0; \ - \ - t0 = _mm_alignr_epi8(row4h, row4l, 8); \ - t1 = _mm_alignr_epi8(row4l, row4h, 8); \ - row4l = t1; \ - row4h = t0; - -#define UNDIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h) \ - t0 = _mm_alignr_epi8(row2l, row2h, 8); \ - t1 = _mm_alignr_epi8(row2h, row2l, 8); \ - row2l = t0; \ - row2h = t1; \ - \ - t0 = row3l; \ - row3l = row3h; \ - row3h = t0; \ - \ - t0 = _mm_alignr_epi8(row4l, row4h, 8); \ - t1 = _mm_alignr_epi8(row4h, row4l, 8); \ - row4l = t1; \ - row4h = t0; - -#define BLAKE2_ROUND(row1l,row1h,row2l,row2h,row3l,row3h,row4l,row4h) \ - G1(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h); \ - G2(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h); \ - \ - DIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h); \ - \ - G1(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h); \ - G2(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h); \ - \ - UNDIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h); diff --git a/equi/blake2/blake2.h b/equi/blake2/blake2.h deleted file mode 100644 index 32065764..00000000 --- a/equi/blake2/blake2.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - BLAKE2 reference source code package - optimized C implementations - - Written in 2012 by Samuel Neves - - To the extent possible under law, the author(s) have dedicated all copyright - and related and neighboring rights to this software to the public domain - worldwide. This software is distributed without any warranty. - - You should have received a copy of the CC0 Public Domain Dedication along with - this software. If not, see . -*/ -#pragma once -#ifndef __BLAKE2_H__ -#define __BLAKE2_H__ - -#include -#include - -#if defined(_MSC_VER) -#define ALIGN(x) __declspec(align(x)) -#else -#define ALIGN(x) __attribute__ ((__aligned__(x))) -#endif - -#if defined(__cplusplus) -extern "C" { -#endif - - enum blake2b_constant - { - BLAKE2B_BLOCKBYTES = 128, - BLAKE2B_OUTBYTES = 64, - BLAKE2B_KEYBYTES = 64, - BLAKE2B_SALTBYTES = 16, - BLAKE2B_PERSONALBYTES = 16 - }; - -#pragma pack(push, 1) - typedef struct __blake2b_param - { - uint8_t digest_length; // 1 - uint8_t key_length; // 2 - uint8_t fanout; // 3 - uint8_t depth; // 4 - uint32_t leaf_length; // 8 - uint64_t node_offset; // 16 - uint8_t node_depth; // 17 - uint8_t inner_length; // 18 - uint8_t reserved[14]; // 32 - uint8_t salt[BLAKE2B_SALTBYTES]; // 48 - uint8_t personal[BLAKE2B_PERSONALBYTES]; // 64 - } blake2b_param; - - ALIGN( 64 ) typedef struct __blake2b_state - { - uint64_t h[8]; - uint8_t buf[BLAKE2B_BLOCKBYTES]; - uint16_t counter; - uint8_t buflen; - uint8_t lastblock; - } blake2b_state; - -#pragma pack(pop) - - int eq_blake2b_init( blake2b_state *S, const uint8_t outlen ); - int eq_blake2b_init_key( blake2b_state *S, const uint8_t outlen, const void *key, const uint8_t keylen ); - int eq_blake2b_init_param( blake2b_state *S, const blake2b_param *P ); - int eq_blake2b_update( blake2b_state *S, const uint8_t *in, uint64_t inlen ); - int eq_blake2b_final( blake2b_state *S, uint8_t *out, uint8_t outlen ); - - // Simple API - int eq_blake2b( uint8_t *out, const void *in, const void *key, const uint8_t outlen, const uint64_t inlen, uint8_t keylen ); - - static inline int eq_blake2( uint8_t *out, const void *in, const void *key, const uint8_t outlen, const uint64_t inlen, uint8_t keylen ) - { - return eq_blake2b( out, in, key, outlen, inlen, keylen ); - } - -#if defined(__cplusplus) -} -#endif - -#endif - diff --git a/equi/blake2/blake2b-load-sse2.h b/equi/blake2/blake2b-load-sse2.h deleted file mode 100644 index 1ba153c8..00000000 --- a/equi/blake2/blake2b-load-sse2.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - BLAKE2 reference source code package - optimized C implementations - - Written in 2012 by Samuel Neves - - To the extent possible under law, the author(s) have dedicated all copyright - and related and neighboring rights to this software to the public domain - worldwide. This software is distributed without any warranty. - - You should have received a copy of the CC0 Public Domain Dedication along with - this software. If not, see . -*/ -#pragma once -#ifndef __BLAKE2B_LOAD_SSE2_H__ -#define __BLAKE2B_LOAD_SSE2_H__ - -#define LOAD_MSG_0_1(b0, b1) b0 = _mm_set_epi64x(m2, m0); b1 = _mm_set_epi64x(m6, m4) -#define LOAD_MSG_0_2(b0, b1) b0 = _mm_set_epi64x(m3, m1); b1 = _mm_set_epi64x(m7, m5) -#define LOAD_MSG_0_3(b0, b1) b0 = _mm_set_epi64x(m10, m8); b1 = _mm_set_epi64x(m14, m12) -#define LOAD_MSG_0_4(b0, b1) b0 = _mm_set_epi64x(m11, m9); b1 = _mm_set_epi64x(m15, m13) -#define LOAD_MSG_1_1(b0, b1) b0 = _mm_set_epi64x(m4, m14); b1 = _mm_set_epi64x(m13, m9) -#define LOAD_MSG_1_2(b0, b1) b0 = _mm_set_epi64x(m8, m10); b1 = _mm_set_epi64x(m6, m15) -#define LOAD_MSG_1_3(b0, b1) b0 = _mm_set_epi64x(m0, m1); b1 = _mm_set_epi64x(m5, m11) -#define LOAD_MSG_1_4(b0, b1) b0 = _mm_set_epi64x(m2, m12); b1 = _mm_set_epi64x(m3, m7) -#define LOAD_MSG_2_1(b0, b1) b0 = _mm_set_epi64x(m12, m11); b1 = _mm_set_epi64x(m15, m5) -#define LOAD_MSG_2_2(b0, b1) b0 = _mm_set_epi64x(m0, m8); b1 = _mm_set_epi64x(m13, m2) -#define LOAD_MSG_2_3(b0, b1) b0 = _mm_set_epi64x(m3, m10); b1 = _mm_set_epi64x(m9, m7) -#define LOAD_MSG_2_4(b0, b1) b0 = _mm_set_epi64x(m6, m14); b1 = _mm_set_epi64x(m4, m1) -#define LOAD_MSG_3_1(b0, b1) b0 = _mm_set_epi64x(m3, m7); b1 = _mm_set_epi64x(m11, m13) -#define LOAD_MSG_3_2(b0, b1) b0 = _mm_set_epi64x(m1, m9); b1 = _mm_set_epi64x(m14, m12) -#define LOAD_MSG_3_3(b0, b1) b0 = _mm_set_epi64x(m5, m2); b1 = _mm_set_epi64x(m15, m4) -#define LOAD_MSG_3_4(b0, b1) b0 = _mm_set_epi64x(m10, m6); b1 = _mm_set_epi64x(m8, m0) -#define LOAD_MSG_4_1(b0, b1) b0 = _mm_set_epi64x(m5, m9); b1 = _mm_set_epi64x(m10, m2) -#define LOAD_MSG_4_2(b0, b1) b0 = _mm_set_epi64x(m7, m0); b1 = _mm_set_epi64x(m15, m4) -#define LOAD_MSG_4_3(b0, b1) b0 = _mm_set_epi64x(m11, m14); b1 = _mm_set_epi64x(m3, m6) -#define LOAD_MSG_4_4(b0, b1) b0 = _mm_set_epi64x(m12, m1); b1 = _mm_set_epi64x(m13, m8) -#define LOAD_MSG_5_1(b0, b1) b0 = _mm_set_epi64x(m6, m2); b1 = _mm_set_epi64x(m8, m0) -#define LOAD_MSG_5_2(b0, b1) b0 = _mm_set_epi64x(m10, m12); b1 = _mm_set_epi64x(m3, m11) -#define LOAD_MSG_5_3(b0, b1) b0 = _mm_set_epi64x(m7, m4); b1 = _mm_set_epi64x(m1, m15) -#define LOAD_MSG_5_4(b0, b1) b0 = _mm_set_epi64x(m5, m13); b1 = _mm_set_epi64x(m9, m14) -#define LOAD_MSG_6_1(b0, b1) b0 = _mm_set_epi64x(m1, m12); b1 = _mm_set_epi64x(m4, m14) -#define LOAD_MSG_6_2(b0, b1) b0 = _mm_set_epi64x(m15, m5); b1 = _mm_set_epi64x(m10, m13) -#define LOAD_MSG_6_3(b0, b1) b0 = _mm_set_epi64x(m6, m0); b1 = _mm_set_epi64x(m8, m9) -#define LOAD_MSG_6_4(b0, b1) b0 = _mm_set_epi64x(m3, m7); b1 = _mm_set_epi64x(m11, m2) -#define LOAD_MSG_7_1(b0, b1) b0 = _mm_set_epi64x(m7, m13); b1 = _mm_set_epi64x(m3, m12) -#define LOAD_MSG_7_2(b0, b1) b0 = _mm_set_epi64x(m14, m11); b1 = _mm_set_epi64x(m9, m1) -#define LOAD_MSG_7_3(b0, b1) b0 = _mm_set_epi64x(m15, m5); b1 = _mm_set_epi64x(m2, m8) -#define LOAD_MSG_7_4(b0, b1) b0 = _mm_set_epi64x(m4, m0); b1 = _mm_set_epi64x(m10, m6) -#define LOAD_MSG_8_1(b0, b1) b0 = _mm_set_epi64x(m14, m6); b1 = _mm_set_epi64x(m0, m11) -#define LOAD_MSG_8_2(b0, b1) b0 = _mm_set_epi64x(m9, m15); b1 = _mm_set_epi64x(m8, m3) -#define LOAD_MSG_8_3(b0, b1) b0 = _mm_set_epi64x(m13, m12); b1 = _mm_set_epi64x(m10, m1) -#define LOAD_MSG_8_4(b0, b1) b0 = _mm_set_epi64x(m7, m2); b1 = _mm_set_epi64x(m5, m4) -#define LOAD_MSG_9_1(b0, b1) b0 = _mm_set_epi64x(m8, m10); b1 = _mm_set_epi64x(m1, m7) -#define LOAD_MSG_9_2(b0, b1) b0 = _mm_set_epi64x(m4, m2); b1 = _mm_set_epi64x(m5, m6) -#define LOAD_MSG_9_3(b0, b1) b0 = _mm_set_epi64x(m9, m15); b1 = _mm_set_epi64x(m13, m3) -#define LOAD_MSG_9_4(b0, b1) b0 = _mm_set_epi64x(m14, m11); b1 = _mm_set_epi64x(m0, m12) -#define LOAD_MSG_10_1(b0, b1) b0 = _mm_set_epi64x(m2, m0); b1 = _mm_set_epi64x(m6, m4) -#define LOAD_MSG_10_2(b0, b1) b0 = _mm_set_epi64x(m3, m1); b1 = _mm_set_epi64x(m7, m5) -#define LOAD_MSG_10_3(b0, b1) b0 = _mm_set_epi64x(m10, m8); b1 = _mm_set_epi64x(m14, m12) -#define LOAD_MSG_10_4(b0, b1) b0 = _mm_set_epi64x(m11, m9); b1 = _mm_set_epi64x(m15, m13) -#define LOAD_MSG_11_1(b0, b1) b0 = _mm_set_epi64x(m4, m14); b1 = _mm_set_epi64x(m13, m9) -#define LOAD_MSG_11_2(b0, b1) b0 = _mm_set_epi64x(m8, m10); b1 = _mm_set_epi64x(m6, m15) -#define LOAD_MSG_11_3(b0, b1) b0 = _mm_set_epi64x(m0, m1); b1 = _mm_set_epi64x(m5, m11) -#define LOAD_MSG_11_4(b0, b1) b0 = _mm_set_epi64x(m2, m12); b1 = _mm_set_epi64x(m3, m7) - - -#endif - diff --git a/equi/blake2/blake2b-load-sse41.h b/equi/blake2/blake2b-load-sse41.h deleted file mode 100644 index f6c1bc83..00000000 --- a/equi/blake2/blake2b-load-sse41.h +++ /dev/null @@ -1,402 +0,0 @@ -/* - BLAKE2 reference source code package - optimized C implementations - - Written in 2012 by Samuel Neves - - To the extent possible under law, the author(s) have dedicated all copyright - and related and neighboring rights to this software to the public domain - worldwide. This software is distributed without any warranty. - - You should have received a copy of the CC0 Public Domain Dedication along with - this software. If not, see . -*/ -#pragma once -#ifndef __BLAKE2B_LOAD_SSE41_H__ -#define __BLAKE2B_LOAD_SSE41_H__ - -#define LOAD_MSG_0_1(b0, b1) \ -do \ -{ \ -b0 = _mm_unpacklo_epi64(m0, m1); \ -b1 = _mm_unpacklo_epi64(m2, m3); \ -} while(0) - - -#define LOAD_MSG_0_2(b0, b1) \ -do \ -{ \ -b0 = _mm_unpackhi_epi64(m0, m1); \ -b1 = _mm_unpackhi_epi64(m2, m3); \ -} while(0) - - -#define LOAD_MSG_0_3(b0, b1) \ -do \ -{ \ -b0 = _mm_unpacklo_epi64(m4, m5); \ -b1 = _mm_unpacklo_epi64(m6, m7); \ -} while(0) - - -#define LOAD_MSG_0_4(b0, b1) \ -do \ -{ \ -b0 = _mm_unpackhi_epi64(m4, m5); \ -b1 = _mm_unpackhi_epi64(m6, m7); \ -} while(0) - - -#define LOAD_MSG_1_1(b0, b1) \ -do \ -{ \ -b0 = _mm_unpacklo_epi64(m7, m2); \ -b1 = _mm_unpackhi_epi64(m4, m6); \ -} while(0) - - -#define LOAD_MSG_1_2(b0, b1) \ -do \ -{ \ -b0 = _mm_unpacklo_epi64(m5, m4); \ -b1 = _mm_alignr_epi8(m3, m7, 8); \ -} while(0) - - -#define LOAD_MSG_1_3(b0, b1) \ -do \ -{ \ -b0 = _mm_shuffle_epi32(m0, _MM_SHUFFLE(1,0,3,2)); \ -b1 = _mm_unpackhi_epi64(m5, m2); \ -} while(0) - - -#define LOAD_MSG_1_4(b0, b1) \ -do \ -{ \ -b0 = _mm_unpacklo_epi64(m6, m1); \ -b1 = _mm_unpackhi_epi64(m3, m1); \ -} while(0) - - -#define LOAD_MSG_2_1(b0, b1) \ -do \ -{ \ -b0 = _mm_alignr_epi8(m6, m5, 8); \ -b1 = _mm_unpackhi_epi64(m2, m7); \ -} while(0) - - -#define LOAD_MSG_2_2(b0, b1) \ -do \ -{ \ -b0 = _mm_unpacklo_epi64(m4, m0); \ -b1 = _mm_blend_epi16(m1, m6, 0xF0); \ -} while(0) - - -#define LOAD_MSG_2_3(b0, b1) \ -do \ -{ \ -b0 = _mm_blend_epi16(m5, m1, 0xF0); \ -b1 = _mm_unpackhi_epi64(m3, m4); \ -} while(0) - - -#define LOAD_MSG_2_4(b0, b1) \ -do \ -{ \ -b0 = _mm_unpacklo_epi64(m7, m3); \ -b1 = _mm_alignr_epi8(m2, m0, 8); \ -} while(0) - - -#define LOAD_MSG_3_1(b0, b1) \ -do \ -{ \ -b0 = _mm_unpackhi_epi64(m3, m1); \ -b1 = _mm_unpackhi_epi64(m6, m5); \ -} while(0) - - -#define LOAD_MSG_3_2(b0, b1) \ -do \ -{ \ -b0 = _mm_unpackhi_epi64(m4, m0); \ -b1 = _mm_unpacklo_epi64(m6, m7); \ -} while(0) - - -#define LOAD_MSG_3_3(b0, b1) \ -do \ -{ \ -b0 = _mm_blend_epi16(m1, m2, 0xF0); \ -b1 = _mm_blend_epi16(m2, m7, 0xF0); \ -} while(0) - - -#define LOAD_MSG_3_4(b0, b1) \ -do \ -{ \ -b0 = _mm_unpacklo_epi64(m3, m5); \ -b1 = _mm_unpacklo_epi64(m0, m4); \ -} while(0) - - -#define LOAD_MSG_4_1(b0, b1) \ -do \ -{ \ -b0 = _mm_unpackhi_epi64(m4, m2); \ -b1 = _mm_unpacklo_epi64(m1, m5); \ -} while(0) - - -#define LOAD_MSG_4_2(b0, b1) \ -do \ -{ \ -b0 = _mm_blend_epi16(m0, m3, 0xF0); \ -b1 = _mm_blend_epi16(m2, m7, 0xF0); \ -} while(0) - - -#define LOAD_MSG_4_3(b0, b1) \ -do \ -{ \ -b0 = _mm_blend_epi16(m7, m5, 0xF0); \ -b1 = _mm_blend_epi16(m3, m1, 0xF0); \ -} while(0) - - -#define LOAD_MSG_4_4(b0, b1) \ -do \ -{ \ -b0 = _mm_alignr_epi8(m6, m0, 8); \ -b1 = _mm_blend_epi16(m4, m6, 0xF0); \ -} while(0) - - -#define LOAD_MSG_5_1(b0, b1) \ -do \ -{ \ -b0 = _mm_unpacklo_epi64(m1, m3); \ -b1 = _mm_unpacklo_epi64(m0, m4); \ -} while(0) - - -#define LOAD_MSG_5_2(b0, b1) \ -do \ -{ \ -b0 = _mm_unpacklo_epi64(m6, m5); \ -b1 = _mm_unpackhi_epi64(m5, m1); \ -} while(0) - - -#define LOAD_MSG_5_3(b0, b1) \ -do \ -{ \ -b0 = _mm_blend_epi16(m2, m3, 0xF0); \ -b1 = _mm_unpackhi_epi64(m7, m0); \ -} while(0) - - -#define LOAD_MSG_5_4(b0, b1) \ -do \ -{ \ -b0 = _mm_unpackhi_epi64(m6, m2); \ -b1 = _mm_blend_epi16(m7, m4, 0xF0); \ -} while(0) - - -#define LOAD_MSG_6_1(b0, b1) \ -do \ -{ \ -b0 = _mm_blend_epi16(m6, m0, 0xF0); \ -b1 = _mm_unpacklo_epi64(m7, m2); \ -} while(0) - - -#define LOAD_MSG_6_2(b0, b1) \ -do \ -{ \ -b0 = _mm_unpackhi_epi64(m2, m7); \ -b1 = _mm_alignr_epi8(m5, m6, 8); \ -} while(0) - - -#define LOAD_MSG_6_3(b0, b1) \ -do \ -{ \ -b0 = _mm_unpacklo_epi64(m0, m3); \ -b1 = _mm_shuffle_epi32(m4, _MM_SHUFFLE(1,0,3,2)); \ -} while(0) - - -#define LOAD_MSG_6_4(b0, b1) \ -do \ -{ \ -b0 = _mm_unpackhi_epi64(m3, m1); \ -b1 = _mm_blend_epi16(m1, m5, 0xF0); \ -} while(0) - - -#define LOAD_MSG_7_1(b0, b1) \ -do \ -{ \ -b0 = _mm_unpackhi_epi64(m6, m3); \ -b1 = _mm_blend_epi16(m6, m1, 0xF0); \ -} while(0) - - -#define LOAD_MSG_7_2(b0, b1) \ -do \ -{ \ -b0 = _mm_alignr_epi8(m7, m5, 8); \ -b1 = _mm_unpackhi_epi64(m0, m4); \ -} while(0) - - -#define LOAD_MSG_7_3(b0, b1) \ -do \ -{ \ -b0 = _mm_unpackhi_epi64(m2, m7); \ -b1 = _mm_unpacklo_epi64(m4, m1); \ -} while(0) - - -#define LOAD_MSG_7_4(b0, b1) \ -do \ -{ \ -b0 = _mm_unpacklo_epi64(m0, m2); \ -b1 = _mm_unpacklo_epi64(m3, m5); \ -} while(0) - - -#define LOAD_MSG_8_1(b0, b1) \ -do \ -{ \ -b0 = _mm_unpacklo_epi64(m3, m7); \ -b1 = _mm_alignr_epi8(m0, m5, 8); \ -} while(0) - - -#define LOAD_MSG_8_2(b0, b1) \ -do \ -{ \ -b0 = _mm_unpackhi_epi64(m7, m4); \ -b1 = _mm_alignr_epi8(m4, m1, 8); \ -} while(0) - - -#define LOAD_MSG_8_3(b0, b1) \ -do \ -{ \ -b0 = m6; \ -b1 = _mm_alignr_epi8(m5, m0, 8); \ -} while(0) - - -#define LOAD_MSG_8_4(b0, b1) \ -do \ -{ \ -b0 = _mm_blend_epi16(m1, m3, 0xF0); \ -b1 = m2; \ -} while(0) - - -#define LOAD_MSG_9_1(b0, b1) \ -do \ -{ \ -b0 = _mm_unpacklo_epi64(m5, m4); \ -b1 = _mm_unpackhi_epi64(m3, m0); \ -} while(0) - - -#define LOAD_MSG_9_2(b0, b1) \ -do \ -{ \ -b0 = _mm_unpacklo_epi64(m1, m2); \ -b1 = _mm_blend_epi16(m3, m2, 0xF0); \ -} while(0) - - -#define LOAD_MSG_9_3(b0, b1) \ -do \ -{ \ -b0 = _mm_unpackhi_epi64(m7, m4); \ -b1 = _mm_unpackhi_epi64(m1, m6); \ -} while(0) - - -#define LOAD_MSG_9_4(b0, b1) \ -do \ -{ \ -b0 = _mm_alignr_epi8(m7, m5, 8); \ -b1 = _mm_unpacklo_epi64(m6, m0); \ -} while(0) - - -#define LOAD_MSG_10_1(b0, b1) \ -do \ -{ \ -b0 = _mm_unpacklo_epi64(m0, m1); \ -b1 = _mm_unpacklo_epi64(m2, m3); \ -} while(0) - - -#define LOAD_MSG_10_2(b0, b1) \ -do \ -{ \ -b0 = _mm_unpackhi_epi64(m0, m1); \ -b1 = _mm_unpackhi_epi64(m2, m3); \ -} while(0) - - -#define LOAD_MSG_10_3(b0, b1) \ -do \ -{ \ -b0 = _mm_unpacklo_epi64(m4, m5); \ -b1 = _mm_unpacklo_epi64(m6, m7); \ -} while(0) - - -#define LOAD_MSG_10_4(b0, b1) \ -do \ -{ \ -b0 = _mm_unpackhi_epi64(m4, m5); \ -b1 = _mm_unpackhi_epi64(m6, m7); \ -} while(0) - - -#define LOAD_MSG_11_1(b0, b1) \ -do \ -{ \ -b0 = _mm_unpacklo_epi64(m7, m2); \ -b1 = _mm_unpackhi_epi64(m4, m6); \ -} while(0) - - -#define LOAD_MSG_11_2(b0, b1) \ -do \ -{ \ -b0 = _mm_unpacklo_epi64(m5, m4); \ -b1 = _mm_alignr_epi8(m3, m7, 8); \ -} while(0) - - -#define LOAD_MSG_11_3(b0, b1) \ -do \ -{ \ -b0 = _mm_shuffle_epi32(m0, _MM_SHUFFLE(1,0,3,2)); \ -b1 = _mm_unpackhi_epi64(m5, m2); \ -} while(0) - - -#define LOAD_MSG_11_4(b0, b1) \ -do \ -{ \ -b0 = _mm_unpacklo_epi64(m6, m1); \ -b1 = _mm_unpackhi_epi64(m3, m1); \ -} while(0) - - -#endif - diff --git a/equi/blake2/blake2b-round.h b/equi/blake2/blake2b-round.h deleted file mode 100644 index b39106b8..00000000 --- a/equi/blake2/blake2b-round.h +++ /dev/null @@ -1,170 +0,0 @@ -/* - BLAKE2 reference source code package - optimized C implementations - - Written in 2012 by Samuel Neves - - To the extent possible under law, the author(s) have dedicated all copyright - and related and neighboring rights to this software to the public domain - worldwide. This software is distributed without any warranty. - - You should have received a copy of the CC0 Public Domain Dedication along with - this software. If not, see . -*/ -#pragma once -#ifndef __BLAKE2B_ROUND_H__ -#define __BLAKE2B_ROUND_H__ - -#define LOAD(p) _mm_load_si128( (const __m128i *)(p) ) -#define STORE(p,r) _mm_store_si128((__m128i *)(p), r) - -#define LOADU(p) _mm_loadu_si128( (const __m128i *)(p) ) -#define STOREU(p,r) _mm_storeu_si128((__m128i *)(p), r) - -#define TOF(reg) _mm_castsi128_ps((reg)) -#define TOI(reg) _mm_castps_si128((reg)) - -#define LIKELY(x) __builtin_expect((x),1) - - -/* Microarchitecture-specific macros */ -#ifndef HAVE_XOP -#ifdef HAVE_SSSE3 -#define _mm_roti_epi64(x, c) \ - (-(c) == 32) ? _mm_shuffle_epi32((x), _MM_SHUFFLE(2,3,0,1)) \ - : (-(c) == 24) ? _mm_shuffle_epi8((x), r24) \ - : (-(c) == 16) ? _mm_shuffle_epi8((x), r16) \ - : (-(c) == 63) ? _mm_xor_si128(_mm_srli_epi64((x), -(c)), _mm_add_epi64((x), (x))) \ - : _mm_xor_si128(_mm_srli_epi64((x), -(c)), _mm_slli_epi64((x), 64-(-(c)))) -#else -#define _mm_roti_epi64(r, c) _mm_xor_si128(_mm_srli_epi64( (r), -(c) ),_mm_slli_epi64( (r), 64-(-c) )) -#endif -#else -/* ... */ -#endif - - - -#define G1(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1) \ - row1l = _mm_add_epi64(_mm_add_epi64(row1l, b0), row2l); \ - row1h = _mm_add_epi64(_mm_add_epi64(row1h, b1), row2h); \ - \ - row4l = _mm_xor_si128(row4l, row1l); \ - row4h = _mm_xor_si128(row4h, row1h); \ - \ - row4l = _mm_roti_epi64(row4l, (-32)); \ - row4h = _mm_roti_epi64(row4h, (-32)); \ - \ - row3l = _mm_add_epi64(row3l, row4l); \ - row3h = _mm_add_epi64(row3h, row4h); \ - \ - row2l = _mm_xor_si128(row2l, row3l); \ - row2h = _mm_xor_si128(row2h, row3h); \ - \ - row2l = _mm_roti_epi64(row2l, (-24)); \ - row2h = _mm_roti_epi64(row2h, (-24)); \ - -#define G2(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1) \ - row1l = _mm_add_epi64(_mm_add_epi64(row1l, b0), row2l); \ - row1h = _mm_add_epi64(_mm_add_epi64(row1h, b1), row2h); \ - \ - row4l = _mm_xor_si128(row4l, row1l); \ - row4h = _mm_xor_si128(row4h, row1h); \ - \ - row4l = _mm_roti_epi64(row4l, (-16)); \ - row4h = _mm_roti_epi64(row4h, (-16)); \ - \ - row3l = _mm_add_epi64(row3l, row4l); \ - row3h = _mm_add_epi64(row3h, row4h); \ - \ - row2l = _mm_xor_si128(row2l, row3l); \ - row2h = _mm_xor_si128(row2h, row3h); \ - \ - row2l = _mm_roti_epi64(row2l, (-63)); \ - row2h = _mm_roti_epi64(row2h, (-63)); \ - -#if defined(HAVE_SSSE3) -#define DIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h) \ - t0 = _mm_alignr_epi8(row2h, row2l, 8); \ - t1 = _mm_alignr_epi8(row2l, row2h, 8); \ - row2l = t0; \ - row2h = t1; \ - \ - t0 = row3l; \ - row3l = row3h; \ - row3h = t0; \ - \ - t0 = _mm_alignr_epi8(row4h, row4l, 8); \ - t1 = _mm_alignr_epi8(row4l, row4h, 8); \ - row4l = t1; \ - row4h = t0; - -#define UNDIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h) \ - t0 = _mm_alignr_epi8(row2l, row2h, 8); \ - t1 = _mm_alignr_epi8(row2h, row2l, 8); \ - row2l = t0; \ - row2h = t1; \ - \ - t0 = row3l; \ - row3l = row3h; \ - row3h = t0; \ - \ - t0 = _mm_alignr_epi8(row4l, row4h, 8); \ - t1 = _mm_alignr_epi8(row4h, row4l, 8); \ - row4l = t1; \ - row4h = t0; -#else - -#define DIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h) \ - t0 = row4l;\ - t1 = row2l;\ - row4l = row3l;\ - row3l = row3h;\ - row3h = row4l;\ - row4l = _mm_unpackhi_epi64(row4h, _mm_unpacklo_epi64(t0, t0)); \ - row4h = _mm_unpackhi_epi64(t0, _mm_unpacklo_epi64(row4h, row4h)); \ - row2l = _mm_unpackhi_epi64(row2l, _mm_unpacklo_epi64(row2h, row2h)); \ - row2h = _mm_unpackhi_epi64(row2h, _mm_unpacklo_epi64(t1, t1)) - -#define UNDIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h) \ - t0 = row3l;\ - row3l = row3h;\ - row3h = t0;\ - t0 = row2l;\ - t1 = row4l;\ - row2l = _mm_unpackhi_epi64(row2h, _mm_unpacklo_epi64(row2l, row2l)); \ - row2h = _mm_unpackhi_epi64(t0, _mm_unpacklo_epi64(row2h, row2h)); \ - row4l = _mm_unpackhi_epi64(row4l, _mm_unpacklo_epi64(row4h, row4h)); \ - row4h = _mm_unpackhi_epi64(row4h, _mm_unpacklo_epi64(t1, t1)) - -#endif - -#if defined(HAVE_SSE41) -#include "blake2b-load-sse41.h" -#else -#include "blake2b-load-sse2.h" -#endif - -#define ROUND(r) \ - LOAD_MSG_ ##r ##_1(b0, b1); \ - G1(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1); \ - LOAD_MSG_ ##r ##_2(b0, b1); \ - G2(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1); \ - DIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h); \ - LOAD_MSG_ ##r ##_3(b0, b1); \ - G1(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1); \ - LOAD_MSG_ ##r ##_4(b0, b1); \ - G2(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1); \ - UNDIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h); - -#endif - -#define BLAKE2_ROUND(row1l,row1h,row2l,row2h,row3l,row3h,row4l,row4h) \ - G1(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h); \ - G2(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h); \ - \ - DIAGONALIZE(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h); \ - \ - G1(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h); \ - G2(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h); \ - \ - UNDIAGONALIZE(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h); diff --git a/equi/blake2/blake2bx.cpp b/equi/blake2/blake2bx.cpp deleted file mode 100644 index 6f5c0417..00000000 --- a/equi/blake2/blake2bx.cpp +++ /dev/null @@ -1,262 +0,0 @@ -/* - BLAKE2 reference source code package - optimized C implementations - - Written in 2012 by Samuel Neves - - To the extent possible under law, the author(s) have dedicated all copyright - and related and neighboring rights to this software to the public domain - worldwide. This software is distributed without any warranty. - - You should have received a copy of the CC0 Public Domain Dedication along with - this software. If not, see . -*/ - -#include -#include -#include - - -#include "blake2.h" -#include "blake2-impl.h" - -#include "blake2-config.h" - -#ifdef WIN32 -#include -#endif - -#include -#if defined(HAVE_SSSE3) -#include -#endif -#if defined(HAVE_SSE41) -#include -#endif -#if defined(HAVE_AVX) -#include -#endif -#if defined(HAVE_XOP) -#include -#endif - -#include "blake2b-round.h" - -ALIGN(64) static const uint64_t blake2b_IV[8] = { - 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, - 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, - 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL, - 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL -}; - -/* init xors IV with input parameter block */ -int eq_blake2b_init_param(blake2b_state *S, const blake2b_param *P) -{ - //blake2b_init0( S ); - const uint8_t * v = (const uint8_t *)(blake2b_IV); - const uint8_t * p = (const uint8_t *)(P); - uint8_t * h = (uint8_t *)(S->h); - /* IV XOR ParamBlock */ - memset(S, 0, sizeof(blake2b_state)); - - for (int i = 0; i < BLAKE2B_OUTBYTES; ++i) h[i] = v[i] ^ p[i]; - - return 0; -} - -/* Some sort of default parameter block initialization, for sequential blake2b */ -int eq_blake2b_init(blake2b_state *S, const uint8_t outlen) -{ - if ((!outlen) || (outlen > BLAKE2B_OUTBYTES)) return -1; - - const blake2b_param P = - { - outlen, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - { 0 }, - { 0 }, - { 0 } - }; - return eq_blake2b_init_param(S, &P); -} - -int eq_blake2b_init_key(blake2b_state *S, const uint8_t outlen, const void *key, const uint8_t keylen) -{ - if ((!outlen) || (outlen > BLAKE2B_OUTBYTES)) return -1; - - if ((!keylen) || keylen > BLAKE2B_KEYBYTES) return -1; - - const blake2b_param P = - { - outlen, - keylen, - 1, - 1, - 0, - 0, - 0, - 0, - { 0 }, - { 0 }, - { 0 } - }; - - if (eq_blake2b_init_param(S, &P) < 0) - return 0; - - { - uint8_t block[BLAKE2B_BLOCKBYTES]; - memset(block, 0, BLAKE2B_BLOCKBYTES); - memcpy(block, key, keylen); - eq_blake2b_update(S, block, BLAKE2B_BLOCKBYTES); - secure_zero_memory(block, BLAKE2B_BLOCKBYTES); /* Burn the key from stack */ - } - return 0; -} - -static inline int blake2b_compress(blake2b_state *S, const uint8_t block[BLAKE2B_BLOCKBYTES]) -{ - __m128i row1l, row1h; - __m128i row2l, row2h; - __m128i row3l, row3h; - __m128i row4l, row4h; - __m128i b0, b1; - __m128i t0, t1; -#if defined(HAVE_SSSE3) && !defined(HAVE_XOP) - const __m128i r16 = _mm_setr_epi8(2, 3, 4, 5, 6, 7, 0, 1, 10, 11, 12, 13, 14, 15, 8, 9); - const __m128i r24 = _mm_setr_epi8(3, 4, 5, 6, 7, 0, 1, 2, 11, 12, 13, 14, 15, 8, 9, 10); -#endif -#if defined(HAVE_SSE41) - const __m128i m0 = LOADU(block + 00); - const __m128i m1 = LOADU(block + 16); - const __m128i m2 = LOADU(block + 32); - const __m128i m3 = LOADU(block + 48); - const __m128i m4 = LOADU(block + 64); - const __m128i m5 = LOADU(block + 80); - const __m128i m6 = LOADU(block + 96); - const __m128i m7 = LOADU(block + 112); -#else - const uint64_t m0 = ( ( uint64_t * )block )[ 0]; - const uint64_t m1 = ( ( uint64_t * )block )[ 1]; - const uint64_t m2 = ( ( uint64_t * )block )[ 2]; - const uint64_t m3 = ( ( uint64_t * )block )[ 3]; - const uint64_t m4 = ( ( uint64_t * )block )[ 4]; - const uint64_t m5 = ( ( uint64_t * )block )[ 5]; - const uint64_t m6 = ( ( uint64_t * )block )[ 6]; - const uint64_t m7 = ( ( uint64_t * )block )[ 7]; - const uint64_t m8 = ( ( uint64_t * )block )[ 8]; - const uint64_t m9 = ( ( uint64_t * )block )[ 9]; - const uint64_t m10 = ( ( uint64_t * )block )[10]; - const uint64_t m11 = ( ( uint64_t * )block )[11]; - const uint64_t m12 = ( ( uint64_t * )block )[12]; - const uint64_t m13 = ( ( uint64_t * )block )[13]; - const uint64_t m14 = ( ( uint64_t * )block )[14]; - const uint64_t m15 = ( ( uint64_t * )block )[15]; -#endif - row1l = LOADU(&S->h[0]); - row1h = LOADU(&S->h[2]); - row2l = LOADU(&S->h[4]); - row2h = LOADU(&S->h[6]); - row3l = LOADU(&blake2b_IV[0]); - row3h = LOADU(&blake2b_IV[2]); - row4l = _mm_xor_si128(LOADU(&blake2b_IV[4]), _mm_set_epi32(0, 0, 0, S->counter)); - row4h = _mm_xor_si128(LOADU(&blake2b_IV[6]), _mm_set_epi32(0, 0, 0L - S->lastblock, 0L - S->lastblock)); - ROUND(0); - ROUND(1); - ROUND(2); - ROUND(3); - ROUND(4); - ROUND(5); - ROUND(6); - ROUND(7); - ROUND(8); - ROUND(9); - ROUND(10); - ROUND(11); - row1l = _mm_xor_si128(row3l, row1l); - row1h = _mm_xor_si128(row3h, row1h); - STOREU(&S->h[0], _mm_xor_si128(LOADU(&S->h[0]), row1l)); - STOREU(&S->h[2], _mm_xor_si128(LOADU(&S->h[2]), row1h)); - row2l = _mm_xor_si128(row4l, row2l); - row2h = _mm_xor_si128(row4h, row2h); - STOREU(&S->h[4], _mm_xor_si128(LOADU(&S->h[4]), row2l)); - STOREU(&S->h[6], _mm_xor_si128(LOADU(&S->h[6]), row2h)); - return 0; -} - -int eq_blake2b_update(blake2b_state *S, const uint8_t *in, uint64_t inlen) -{ - while (inlen > 0) - { - size_t left = S->buflen; - size_t fill = BLAKE2B_BLOCKBYTES - left; - - if (inlen > fill) - { - memcpy(S->buf + left, in, fill); // Fill buffer - in += fill; - inlen -= fill; - S->counter += BLAKE2B_BLOCKBYTES; - blake2b_compress(S, S->buf); // Compress - S->buflen = 0; - } - else // inlen <= fill - { - memcpy(S->buf + left, in, inlen); - S->buflen += (uint8_t) inlen; // not enough to compress - in += inlen; - inlen = 0; - } - } - - return 0; -} - -int eq_blake2b_final(blake2b_state *S, uint8_t *out, uint8_t outlen) -{ - if (outlen > BLAKE2B_OUTBYTES) - return -1; - - if (S->buflen > BLAKE2B_BLOCKBYTES) - { - S->counter += BLAKE2B_BLOCKBYTES; - blake2b_compress(S, S->buf); - S->buflen -= BLAKE2B_BLOCKBYTES; - memcpy(S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen); - } - - S->counter += S->buflen; - S->lastblock = 1; - memset(S->buf + S->buflen, 0, BLAKE2B_BLOCKBYTES - S->buflen); /* Padding */ - blake2b_compress(S, S->buf); - memcpy(out, &S->h[0], outlen); - S->lastblock = 0; - return 0; -} - -int eq_blake2b(uint8_t *out, const void *in, const void *key, const uint8_t outlen, const uint64_t inlen, uint8_t keylen) -{ - blake2b_state S[1]; - - /* Verify parameters */ - if (!in || !out) return -1; - if (NULL == key) keylen = 0; - - if (keylen) - { - if (eq_blake2b_init_key(S, outlen, key, keylen) < 0) return -1; - } - else - { - if (eq_blake2b_init(S, outlen) < 0) return -1; - } - - eq_blake2b_update(S, (const uint8_t *)in, inlen); - eq_blake2b_final(S, out, outlen); - return 0; -} diff --git a/equi/cuda_equi.cu b/equi/cuda_equi.cu deleted file mode 100644 index a3b76a77..00000000 --- a/equi/cuda_equi.cu +++ /dev/null @@ -1,2130 +0,0 @@ -/* - * Equihash solver created by djeZo (l33tsoftw@gmail.com) for NiceHash - * Adapted to be more compatible with older C++ compilers - * - * cuda_djezo solver was released by NiceHash (www.nicehash.com) under - * GPL 3.0 license. If you don't have a copy, you can obtain one from - * https://www.gnu.org/licenses/gpl-3.0.txt - * - * Based on CUDA solver by John Tromp released under MIT license. - * Some helper functions taken out of OpenCL solver by Marc Bevand - * released under MIT license. - * - * Copyright (c) 2016 John Tromp, Marc Bevand - * Copyright (c) 2017 djeZo, Tanguy Pruvot (GPL v3) - */ - -#ifdef WIN32 -#include -#endif - -#include -#include -//#include - -#include "equihash.h" -#include "eqcuda.hpp" // eq_cuda_context - -#include "blake2/blake2.h" - -//#define WN 200 -//#define WK 9 -#ifndef MAX_GPUS -#define MAX_GPUS 16 -#endif - -#define NDIGITS (WK+1) -#define DIGITBITS (WN/(NDIGITS)) -#define PROOFSIZE (1< -#include -#define __launch_bounds__(max_tpb, min_blocks) -#define __CUDA_ARCH__ 520 -uint32_t __byte_perm(uint32_t x, uint32_t y, uint32_t z); -uint32_t __byte_perm(uint32_t x, uint32_t y, uint32_t z); -uint32_t __shfl2(uint32_t x, uint32_t y); -uint32_t __shfl_sync(uint32_t mask, uint32_t x, uint32_t y); -uint32_t atomicExch(uint32_t *x, uint32_t y); -uint32_t atomicAdd(uint32_t *x, uint32_t y); -void __syncthreads(void); -void __threadfence(void); -void __threadfence_block(void); -uint32_t __ldg(const uint32_t* address); -uint64_t __ldg(const uint64_t* address); -uint4 __ldca(const uint4 *ptr); -u32 __ldca(const u32 *ptr); -u32 umin(const u32, const u32); -u32 umax(const u32, const u32); -#endif - -#define OPT_SYNC_ALL - -#if CUDA_VERSION >= 9000 && __CUDA_ARCH__ >= 300 -#define __shfl2(var, srcLane) __shfl_sync(0xFFFFFFFFu, var, srcLane) -#undef __any -#define __any(p) __any_sync(0xFFFFFFFFu, p) -#else -#define __shfl2 __shfl -#endif - -typedef u32 proof[PROOFSIZE]; - -struct __align__(32) slot { - u32 hash[8]; -}; - -struct __align__(16) slotsmall { - u32 hash[4]; -}; - -struct __align__(8) slottiny { - u32 hash[2]; -}; - -template -struct equi -{ - slot round0trees[4096][RB8_NSLOTS]; - slot trees[1][NBUCKETS][NSLOTS]; - struct { - slotsmall treessmall[NSLOTS]; - slottiny treestiny[NSLOTS]; - } round2trees[NBUCKETS]; - struct { - slotsmall treessmall[NSLOTS]; - slottiny treestiny[NSLOTS]; - } round3trees[NBUCKETS]; - slotsmall treessmall[4][NBUCKETS][NSLOTS]; - slottiny treestiny[1][4096][RB8_NSLOTS_LD]; - u32 round4bidandsids[NBUCKETS][NSLOTS]; - union { - u64 blake_h[8]; - u32 blake_h32[16]; - }; - struct { - u32 nslots8[4096]; - u32 nslots0[4096]; - u32 nslots[9][NBUCKETS]; - scontainerreal srealcont; - } edata; -}; - -// todo: use cuda_helper.h and/or cuda_vector.h -__device__ __forceinline__ uint2 operator^ (uint2 a, uint2 b) -{ - return make_uint2(a.x ^ b.x, a.y ^ b.y); -} - -__device__ __forceinline__ uint4 operator^ (uint4 a, uint4 b) -{ - return make_uint4(a.x ^ b.x, a.y ^ b.y, a.z ^ b.z, a.w ^ b.w); -} - -// for ROR 63 (or ROL 1); this func only support (32 <= offset < 64) -__device__ __forceinline__ uint2 ROR2(const uint2 a, const int offset) -{ - uint2 result; -#if __CUDA_ARCH__ > 300 - { - asm("shf.r.wrap.b32 %0, %1, %2, %3;" : "=r"(result.x) : "r"(a.y), "r"(a.x), "r"(offset)); - asm("shf.r.wrap.b32 %0, %1, %2, %3;" : "=r"(result.y) : "r"(a.x), "r"(a.y), "r"(offset)); - } -#else - result.y = ((a.x >> (offset - 32)) | (a.y << (64 - offset))); - result.x = ((a.y >> (offset - 32)) | (a.x << (64 - offset))); -#endif - return result; -} - - -__device__ __forceinline__ uint2 SWAPUINT2(uint2 value) -{ - return make_uint2(value.y, value.x); -} - -__device__ __forceinline__ uint2 ROR24(const uint2 a) -{ - uint2 result; - result.x = __byte_perm(a.y, a.x, 0x2107); - result.y = __byte_perm(a.y, a.x, 0x6543); - return result; -} - -__device__ __forceinline__ uint2 ROR16(const uint2 a) -{ - uint2 result; - result.x = __byte_perm(a.y, a.x, 0x1076); - result.y = __byte_perm(a.y, a.x, 0x5432); - return result; -} - -__device__ __forceinline__ void G2(u64 & a, u64 & b, u64 & c, u64 & d, u64 x, u64 y) -{ - a = a + b + x; - ((uint2*)&d)[0] = SWAPUINT2(((uint2*)&d)[0] ^ ((uint2*)&a)[0]); - c = c + d; - ((uint2*)&b)[0] = ROR24(((uint2*)&b)[0] ^ ((uint2*)&c)[0]); - a = a + b + y; - ((uint2*)&d)[0] = ROR16(((uint2*)&d)[0] ^ ((uint2*)&a)[0]); - c = c + d; - ((uint2*)&b)[0] = ROR2(((uint2*)&b)[0] ^ ((uint2*)&c)[0], 63U); -} - -// untested.. -struct packer_default -{ - __device__ __forceinline__ static u32 set_bucketid_and_slots(const u32 bucketid, const u32 s0, const u32 s1, const u32 RB, const u32 SM) - { - return (((bucketid << SLOTBITS) | s0) << SLOTBITS) | s1; - } - - __device__ __forceinline__ static u32 get_bucketid(const u32 bid, const u32 RB, const u32 SM) - { - // BUCKMASK-ed to prevent illegal memory accesses in case of memory errors - return (bid >> (2 * SLOTBITS)) & BUCKMASK; - } - - __device__ __forceinline__ static u32 get_slot0(const u32 bid, const u32 s1, const u32 RB, const u32 SM) - { - return bid & SLOTMASK; - } - - __device__ __forceinline__ static u32 get_slot1(const u32 bid, const u32 RB, const u32 SM) - { - return (bid >> SLOTBITS) & SLOTMASK; - } -}; - - -struct packer_cantor -{ - __device__ __forceinline__ static u32 cantor(const u32 s0, const u32 s1) - { - u32 a = umax(s0, s1); - u32 b = umin(s0, s1); - return a * (a + 1) / 2 + b; - } - - __device__ __forceinline__ static u32 set_bucketid_and_slots(const u32 bucketid, const u32 s0, const u32 s1, const u32 RB, const u32 SM) - { - return (bucketid << CANTORBITS) | cantor(s0, s1); - } - - __device__ __forceinline__ static u32 get_bucketid(const u32 bid, const u32 RB, const u32 SM) - { - return (bid >> CANTORBITS) & BUCKMASK; - } - - __device__ __forceinline__ static u32 get_slot0(const u32 bid, const u32 s1, const u32 RB, const u32 SM) - { - return ((bid & CANTORMASK) - cantor(0, s1)) & SLOTMASK; - } - - __device__ __forceinline__ static u32 get_slot1(const u32 bid, const u32 RB, const u32 SM) - { - u32 k, q, sqr = 8 * (bid & CANTORMASK) + 1; - // this k=sqrt(sqr) computing loop averages 3.4 iterations out of maximum 9 - for (k = CANTORMAXSQRT; (q = sqr / k) < k; k = (k + q) / 2); - return ((k - 1) / 2) & SLOTMASK; - } -}; - -__device__ __constant__ const u64 blake_iv[] = { - 0x6a09e667f3bcc908, 0xbb67ae8584caa73b, - 0x3c6ef372fe94f82b, 0xa54ff53a5f1d36f1, - 0x510e527fade682d1, 0x9b05688c2b3e6c1f, - 0x1f83d9abfb41bd6b, 0x5be0cd19137e2179, -}; - -#if CUDART_VERSION < 8000 || !defined(__ldca) -#define __ldca(ptr) *(ptr) -#endif - -template -__global__ void digit_first(equi* eq, u32 nonce) -{ - const u32 block = blockIdx.x * blockDim.x + threadIdx.x; - __shared__ u64 hash_h[8]; - u32* hash_h32 = (u32*)hash_h; - - if (threadIdx.x < 16) - hash_h32[threadIdx.x] = __ldca(&eq->blake_h32[threadIdx.x]); - - __syncthreads(); - - u64 m = (u64)block << 32 | (u64)nonce; - - union - { - u64 v[16]; - u32 v32[32]; - uint4 v128[8]; - }; - - v[0] = hash_h[0]; - v[1] = hash_h[1]; - v[2] = hash_h[2]; - v[3] = hash_h[3]; - v[4] = hash_h[4]; - v[5] = hash_h[5]; - v[6] = hash_h[6]; - v[7] = hash_h[7]; - v[8] = blake_iv[0]; - v[9] = blake_iv[1]; - v[10] = blake_iv[2]; - v[11] = blake_iv[3]; - v[12] = blake_iv[4] ^ (128 + 16); - v[13] = blake_iv[5]; - v[14] = blake_iv[6] ^ 0xffffffffffffffff; - v[15] = blake_iv[7]; - - // mix 1 - G2(v[0], v[4], v[8], v[12], 0, m); - G2(v[1], v[5], v[9], v[13], 0, 0); - G2(v[2], v[6], v[10], v[14], 0, 0); - G2(v[3], v[7], v[11], v[15], 0, 0); - G2(v[0], v[5], v[10], v[15], 0, 0); - G2(v[1], v[6], v[11], v[12], 0, 0); - G2(v[2], v[7], v[8], v[13], 0, 0); - G2(v[3], v[4], v[9], v[14], 0, 0); - - // mix 2 - G2(v[0], v[4], v[8], v[12], 0, 0); - G2(v[1], v[5], v[9], v[13], 0, 0); - G2(v[2], v[6], v[10], v[14], 0, 0); - G2(v[3], v[7], v[11], v[15], 0, 0); - G2(v[0], v[5], v[10], v[15], m, 0); - G2(v[1], v[6], v[11], v[12], 0, 0); - G2(v[2], v[7], v[8], v[13], 0, 0); - G2(v[3], v[4], v[9], v[14], 0, 0); - - // mix 3 - G2(v[0], v[4], v[8], v[12], 0, 0); - G2(v[1], v[5], v[9], v[13], 0, 0); - G2(v[2], v[6], v[10], v[14], 0, 0); - G2(v[3], v[7], v[11], v[15], 0, 0); - G2(v[0], v[5], v[10], v[15], 0, 0); - G2(v[1], v[6], v[11], v[12], 0, 0); - G2(v[2], v[7], v[8], v[13], 0, m); - G2(v[3], v[4], v[9], v[14], 0, 0); - - // mix 4 - G2(v[0], v[4], v[8], v[12], 0, 0); - G2(v[1], v[5], v[9], v[13], 0, m); - G2(v[2], v[6], v[10], v[14], 0, 0); - G2(v[3], v[7], v[11], v[15], 0, 0); - G2(v[0], v[5], v[10], v[15], 0, 0); - G2(v[1], v[6], v[11], v[12], 0, 0); - G2(v[2], v[7], v[8], v[13], 0, 0); - G2(v[3], v[4], v[9], v[14], 0, 0); - - // mix 5 - G2(v[0], v[4], v[8], v[12], 0, 0); - G2(v[1], v[5], v[9], v[13], 0, 0); - G2(v[2], v[6], v[10], v[14], 0, 0); - G2(v[3], v[7], v[11], v[15], 0, 0); - G2(v[0], v[5], v[10], v[15], 0, m); - G2(v[1], v[6], v[11], v[12], 0, 0); - G2(v[2], v[7], v[8], v[13], 0, 0); - G2(v[3], v[4], v[9], v[14], 0, 0); - - // mix 6 - G2(v[0], v[4], v[8], v[12], 0, 0); - G2(v[1], v[5], v[9], v[13], 0, 0); - G2(v[2], v[6], v[10], v[14], 0, 0); - G2(v[3], v[7], v[11], v[15], 0, 0); - G2(v[0], v[5], v[10], v[15], 0, 0); - G2(v[1], v[6], v[11], v[12], 0, 0); - G2(v[2], v[7], v[8], v[13], 0, 0); - G2(v[3], v[4], v[9], v[14], m, 0); - - // mix 7 - G2(v[0], v[4], v[8], v[12], 0, 0); - G2(v[1], v[5], v[9], v[13], m, 0); - G2(v[2], v[6], v[10], v[14], 0, 0); - G2(v[3], v[7], v[11], v[15], 0, 0); - G2(v[0], v[5], v[10], v[15], 0, 0); - G2(v[1], v[6], v[11], v[12], 0, 0); - G2(v[2], v[7], v[8], v[13], 0, 0); - G2(v[3], v[4], v[9], v[14], 0, 0); - - // mix 8 - G2(v[0], v[4], v[8], v[12], 0, 0); - G2(v[1], v[5], v[9], v[13], 0, 0); - G2(v[2], v[6], v[10], v[14], 0, m); - G2(v[3], v[7], v[11], v[15], 0, 0); - G2(v[0], v[5], v[10], v[15], 0, 0); - G2(v[1], v[6], v[11], v[12], 0, 0); - G2(v[2], v[7], v[8], v[13], 0, 0); - G2(v[3], v[4], v[9], v[14], 0, 0); - - // mix 9 - G2(v[0], v[4], v[8], v[12], 0, 0); - G2(v[1], v[5], v[9], v[13], 0, 0); - G2(v[2], v[6], v[10], v[14], 0, 0); - G2(v[3], v[7], v[11], v[15], 0, 0); - G2(v[0], v[5], v[10], v[15], 0, 0); - G2(v[1], v[6], v[11], v[12], 0, 0); - G2(v[2], v[7], v[8], v[13], m, 0); - G2(v[3], v[4], v[9], v[14], 0, 0); - - // mix 10 - G2(v[0], v[4], v[8], v[12], 0, 0); - G2(v[1], v[5], v[9], v[13], 0, 0); - G2(v[2], v[6], v[10], v[14], 0, 0); - G2(v[3], v[7], v[11], v[15], m, 0); - G2(v[0], v[5], v[10], v[15], 0, 0); - G2(v[1], v[6], v[11], v[12], 0, 0); - G2(v[2], v[7], v[8], v[13], 0, 0); - G2(v[3], v[4], v[9], v[14], 0, 0); - - // mix 11 - G2(v[0], v[4], v[8], v[12], 0, m); - G2(v[1], v[5], v[9], v[13], 0, 0); - G2(v[2], v[6], v[10], v[14], 0, 0); - G2(v[3], v[7], v[11], v[15], 0, 0); - G2(v[0], v[5], v[10], v[15], 0, 0); - G2(v[1], v[6], v[11], v[12], 0, 0); - G2(v[2], v[7], v[8], v[13], 0, 0); - G2(v[3], v[4], v[9], v[14], 0, 0); - - // mix 12 - G2(v[0], v[4], v[8], v[12], 0, 0); - G2(v[1], v[5], v[9], v[13], 0, 0); - G2(v[2], v[6], v[10], v[14], 0, 0); - G2(v[3], v[7], v[11], v[15], 0, 0); - G2(v[0], v[5], v[10], v[15], m, 0); - G2(v[1], v[6], v[11], v[12], 0, 0); - G2(v[2], v[7], v[8], v[13], 0, 0); - G2(v[3], v[4], v[9], v[14], 0, 0); - - v[0] ^= hash_h[0] ^ v[8]; - v[1] ^= hash_h[1] ^ v[9]; - v[2] ^= hash_h[2] ^ v[10]; - v[3] ^= hash_h[3] ^ v[11]; - v[4] ^= hash_h[4] ^ v[12]; - v[5] ^= hash_h[5] ^ v[13]; - v32[12] ^= hash_h32[12] ^ v32[28]; - - u32 bexor = __byte_perm(v32[0], 0, 0x4012); // first 20 bits - u32 bucketid; - asm("bfe.u32 %0, %1, 12, 12;" : "=r"(bucketid) : "r"(bexor)); - u32 slotp = atomicAdd(&eq->edata.nslots0[bucketid], 1); - if (slotp < RB8_NSLOTS) - { - slot* s = &eq->round0trees[bucketid][slotp]; - - uint4 tt; - tt.x = __byte_perm(v32[0], v32[1], 0x1234); - tt.y = __byte_perm(v32[1], v32[2], 0x1234); - tt.z = __byte_perm(v32[2], v32[3], 0x1234); - tt.w = __byte_perm(v32[3], v32[4], 0x1234); - *(uint4*)(&s->hash[0]) = tt; - - tt.x = __byte_perm(v32[4], v32[5], 0x1234); - tt.y = __byte_perm(v32[5], v32[6], 0x1234); - tt.z = 0; - tt.w = block << 1; - *(uint4*)(&s->hash[4]) = tt; - } - - bexor = __byte_perm(v32[6], 0, 0x0123); - asm("bfe.u32 %0, %1, 12, 12;" : "=r"(bucketid) : "r"(bexor)); - slotp = atomicAdd(&eq->edata.nslots0[bucketid], 1); - if (slotp < RB8_NSLOTS) - { - slot* s = &eq->round0trees[bucketid][slotp]; - - uint4 tt; - tt.x = __byte_perm(v32[6], v32[7], 0x2345); - tt.y = __byte_perm(v32[7], v32[8], 0x2345); - tt.z = __byte_perm(v32[8], v32[9], 0x2345); - tt.w = __byte_perm(v32[9], v32[10], 0x2345); - *(uint4*)(&s->hash[0]) = tt; - - tt.x = __byte_perm(v32[10], v32[11], 0x2345); - tt.y = __byte_perm(v32[11], v32[12], 0x2345); - tt.z = 0; - tt.w = (block << 1) + 1; - *(uint4*)(&s->hash[4]) = tt; - } -} - -/* - Functions digit_1 to digit_8 works by the same principle; - Each thread does 2-3 slot loads (loads are coalesced). - Xorwork of slots is loaded into shared memory and is kept in registers (except for digit_1). - At the same time, restbits (8 or 9 bits) in xorwork are used for collisions. - Restbits determine position in ht. - Following next is pair creation. First one (or two) pairs' xorworks are put into global memory - as soon as possible, the rest pairs are saved in shared memory (one u32 per pair - 16 bit indices). - In most cases, all threads have one (or two) pairs so with this trick, we offload memory writes a bit in last step. - In last step we save xorwork of pairs in memory. -*/ -template -__global__ void digit_1(equi* eq) -{ - __shared__ u16 ht[256][SSM - 1]; - __shared__ uint2 lastword1[RB8_NSLOTS]; - __shared__ uint4 lastword2[RB8_NSLOTS]; - __shared__ int ht_len[MAXPAIRS]; - __shared__ u32 pairs_len; - __shared__ u32 next_pair; - - const u32 threadid = threadIdx.x; - const u32 bucketid = blockIdx.x; - - // reset hashtable len - if (threadid < 256) - ht_len[threadid] = 0; - else if (threadid == (THREADS - 1)) - pairs_len = 0; - else if (threadid == (THREADS - 33)) - next_pair = 0; - - u32 bsize = umin(eq->edata.nslots0[bucketid], RB8_NSLOTS); - - u32 hr[2]; - int pos[2]; - pos[0] = pos[1] = SSM; - - uint2 ta[2]; - uint4 tb[2]; - - u32 si[2]; - -#ifdef OPT_SYNC_ALL - // enable this to make fully safe shared mem operations; - // disabled gains some speed, but can rarely cause a crash - __syncthreads(); -#endif - #pragma unroll - for (u32 i = 0; i != 2; ++i) - { - si[i] = i * THREADS + threadid; - if (si[i] >= bsize) break; - - const slot* pslot1 = eq->round0trees[bucketid] + si[i]; - - // get xhash - uint4 a1 = *(uint4*)(&pslot1->hash[0]); - uint2 a2 = *(uint2*)(&pslot1->hash[4]); - ta[i].x = a1.x; - ta[i].y = a1.y; - lastword1[si[i]] = ta[i]; - tb[i].x = a1.z; - tb[i].y = a1.w; - tb[i].z = a2.x; - tb[i].w = a2.y; - lastword2[si[i]] = tb[i]; - - asm("bfe.u32 %0, %1, 20, 8;" : "=r"(hr[i]) : "r"(ta[i].x)); - pos[i] = atomicAdd(&ht_len[hr[i]], 1); - if (pos[i] < (SSM - 1)) ht[hr[i]][pos[i]] = si[i]; - } - - __syncthreads(); - int* pairs = ht_len; - - u32 xors[6]; - u32 xorbucketid, xorslot; - - #pragma unroll - for (u32 i = 0; i != 2; ++i) - { - if (pos[i] >= SSM) continue; - - if (pos[i] > 0) - { - u16 p = ht[hr[i]][0]; - - *(uint2*)(&xors[0]) = ta[i] ^ lastword1[p]; - - asm("bfe.u32 %0, %1, %2, %3;" : "=r"(xorbucketid) : "r"(xors[0]), "r"(RB), "r"(BUCKBITS)); - xorslot = atomicAdd(&eq->edata.nslots[1][xorbucketid], 1); - - if (xorslot < NSLOTS) - { - *(uint4*)(&xors[2]) = lastword2[si[i]] ^ lastword2[p]; - - slot &xs = eq->trees[0][xorbucketid][xorslot]; - *(uint4*)(&xs.hash[0]) = *(uint4*)(&xors[1]); - uint4 ttx; - ttx.x = xors[5]; - ttx.y = xors[0]; - ttx.z = packer_default::set_bucketid_and_slots(bucketid, si[i], p, 8, RB8_NSLOTS); - ttx.w = 0; - *(uint4*)(&xs.hash[4]) = ttx; - } - - for (int k = 1; k != pos[i]; ++k) - { - u32 pindex = atomicAdd(&pairs_len, 1); - if (pindex >= MAXPAIRS) break; - u16 prev = ht[hr[i]][k]; - pairs[pindex] = __byte_perm(si[i], prev, 0x1054); - } - } - } - - __syncthreads(); - - // process pairs - u32 plen = umin(pairs_len, MAXPAIRS); - - u32 i, k; - for (u32 s = atomicAdd(&next_pair, 1); s < plen; s = atomicAdd(&next_pair, 1)) - { - int pair = pairs[s]; - i = __byte_perm(pair, 0, 0x4510); - k = __byte_perm(pair, 0, 0x4532); - - *(uint2*)(&xors[0]) = lastword1[i] ^ lastword1[k]; - - asm("bfe.u32 %0, %1, %2, %3;" : "=r"(xorbucketid) : "r"(xors[0]), "r"(RB), "r"(BUCKBITS)); - xorslot = atomicAdd(&eq->edata.nslots[1][xorbucketid], 1); - - if (xorslot < NSLOTS) - { - *(uint4*)(&xors[2]) = lastword2[i] ^ lastword2[k]; - - slot &xs = eq->trees[0][xorbucketid][xorslot]; - *(uint4*)(&xs.hash[0]) = *(uint4*)(&xors[1]); - uint4 ttx; - ttx.x = xors[5]; - ttx.y = xors[0]; - ttx.z = packer_default::set_bucketid_and_slots(bucketid, i, k, 8, RB8_NSLOTS); - ttx.w = 0; - *(uint4*)(&xs.hash[4]) = ttx; - } - } -} - - -template -__global__ void digit_2(equi* eq) -{ - __shared__ u16 ht[NRESTS][SSM - 1]; - __shared__ u32 lastword1[NSLOTS]; - __shared__ uint4 lastword2[NSLOTS]; - __shared__ int ht_len[NRESTS]; - __shared__ int pairs[MAXPAIRS]; - __shared__ u32 pairs_len; - __shared__ u32 next_pair; - - const u32 threadid = threadIdx.x; - const u32 bucketid = blockIdx.x; - - // reset hashtable len - if (threadid < NRESTS) - ht_len[threadid] = 0; - else if (threadid == (THREADS - 1)) - pairs_len = 0; - else if (threadid == (THREADS - 33)) - next_pair = 0; - - slot* buck = eq->trees[0][bucketid]; - u32 bsize = umin(eq->edata.nslots[1][bucketid], NSLOTS); - - u32 hr[2]; - int pos[2]; - pos[0] = pos[1] = SSM; - - u32 ta[2]; - uint4 tt[2]; - - u32 si[2]; -#ifdef OPT_SYNC_ALL - __syncthreads(); -#endif - #pragma unroll 2 - for (u32 i = 0; i < 2; i++) - { - si[i] = i * THREADS + threadid; - if (si[i] >= bsize) break; - - // get slot - const slot* pslot1 = buck + si[i]; - - uint4 ttx = *(uint4*)(&pslot1->hash[0]); - lastword1[si[i]] = ta[i] = ttx.x; - uint2 tty = *(uint2*)(&pslot1->hash[4]); - tt[i].x = ttx.y; - tt[i].y = ttx.z; - tt[i].z = ttx.w; - tt[i].w = tty.x; - lastword2[si[i]] = tt[i]; - - hr[i] = tty.y & RESTMASK; - pos[i] = atomicAdd(&ht_len[hr[i]], 1); - if (pos[i] < (SSM - 1)) ht[hr[i]][pos[i]] = si[i]; - } - - __syncthreads(); - - u32 xors[5]; - u32 xorbucketid, xorslot; - - #pragma unroll 2 - for (u32 i = 0; i < 2; i++) - { - if (pos[i] >= SSM) continue; - - if (pos[i] > 0) - { - u16 p = ht[hr[i]][0]; - - xors[0] = ta[i] ^ lastword1[p]; - - xorbucketid = xors[0] >> (12 + RB); - xorslot = atomicAdd(&eq->edata.nslots[2][xorbucketid], 1); - if (xorslot < NSLOTS) - { - *(uint4*)(&xors[1]) = tt[i] ^ lastword2[p]; - slotsmall &xs = eq->round2trees[xorbucketid].treessmall[xorslot]; - *(uint4*)(&xs.hash[0]) = *(uint4*)(&xors[0]); - slottiny &xst = eq->round2trees[xorbucketid].treestiny[xorslot]; - uint2 ttx; - ttx.x = xors[4]; - ttx.y = PACKER::set_bucketid_and_slots(bucketid, si[i], p, RB, SM); - *(uint2*)(&xst.hash[0]) = ttx; - } - - for (int k = 1; k != pos[i]; ++k) - { - u32 pindex = atomicAdd(&pairs_len, 1); - if (pindex >= MAXPAIRS) break; - u16 prev = ht[hr[i]][k]; - pairs[pindex] = __byte_perm(si[i], prev, 0x1054); - } - } - } - - __syncthreads(); - - // process pairs - u32 plen = umin(pairs_len, MAXPAIRS); - - u32 i, k; - for (u32 s = atomicAdd(&next_pair, 1); s < plen; s = atomicAdd(&next_pair, 1)) - { - int pair = pairs[s]; - i = __byte_perm(pair, 0, 0x4510); - k = __byte_perm(pair, 0, 0x4532); - - xors[0] = lastword1[i] ^ lastword1[k]; - - xorbucketid = xors[0] >> (12 + RB); - xorslot = atomicAdd(&eq->edata.nslots[2][xorbucketid], 1); - if (xorslot < NSLOTS) - { - *(uint4*)(&xors[1]) = lastword2[i] ^ lastword2[k]; - slotsmall &xs = eq->round2trees[xorbucketid].treessmall[xorslot]; - *(uint4*)(&xs.hash[0]) = *(uint4*)(&xors[0]); - slottiny &xst = eq->round2trees[xorbucketid].treestiny[xorslot]; - uint2 ttx; - ttx.x = xors[4]; - ttx.y = PACKER::set_bucketid_and_slots(bucketid, i, k, RB, SM); - *(uint2*)(&xst.hash[0]) = ttx; - } - } -} - - -template -__global__ void digit_3(equi* eq) -{ - __shared__ u16 ht[NRESTS][(SSM - 1)]; - __shared__ uint4 lastword1[NSLOTS]; - __shared__ u32 lastword2[NSLOTS]; - __shared__ int ht_len[NRESTS]; - __shared__ int pairs[MAXPAIRS]; - __shared__ u32 pairs_len; - __shared__ u32 next_pair; - - const u32 threadid = threadIdx.x; - const u32 bucketid = blockIdx.x; - - // reset hashtable len - if (threadid < NRESTS) - ht_len[threadid] = 0; - else if (threadid == (THREADS - 1)) - pairs_len = 0; - else if (threadid == (THREADS - 33)) - next_pair = 0; - - u32 bsize = umin(eq->edata.nslots[2][bucketid], NSLOTS); - - u32 hr[2]; - int pos[2]; - pos[0] = pos[1] = SSM; - - u32 si[2]; - uint4 tt[2]; - u32 ta[2]; - -#ifdef OPT_SYNC_ALL - __syncthreads(); -#endif - - #pragma unroll 2 - for (u32 i = 0; i < 2; i++) - { - si[i] = i * THREADS + threadid; - if (si[i] >= bsize) break; - - slotsmall &xs = eq->round2trees[bucketid].treessmall[si[i]]; - slottiny &xst = eq->round2trees[bucketid].treestiny[si[i]]; - - tt[i] = *(uint4*)(&xs.hash[0]); - lastword1[si[i]] = tt[i]; - ta[i] = xst.hash[0]; - lastword2[si[i]] = ta[i]; - asm("bfe.u32 %0, %1, 12, %2;" : "=r"(hr[i]) : "r"(tt[i].x), "r"(RB)); - pos[i] = atomicAdd(&ht_len[hr[i]], 1); - if (pos[i] < (SSM - 1)) ht[hr[i]][pos[i]] = si[i]; - } - - __syncthreads(); - - u32 xors[5]; - u32 bexor, xorbucketid, xorslot; - - #pragma unroll 2 - for (u32 i = 0; i < 2; i++) - { - if (pos[i] >= SSM) continue; - - if (pos[i] > 0) - { - u16 p = ht[hr[i]][0]; - - xors[4] = ta[i] ^ lastword2[p]; - - if (xors[4] != 0) - { - *(uint4*)(&xors[0]) = tt[i] ^ lastword1[p]; - - bexor = __byte_perm(xors[0], xors[1], 0x2107); - asm("bfe.u32 %0, %1, %2, %3;" : "=r"(xorbucketid) : "r"(bexor), "r"(RB), "r"(BUCKBITS)); - xorslot = atomicAdd(&eq->edata.nslots[3][xorbucketid], 1); - - if (xorslot < NSLOTS) - { - slotsmall &xs = eq->round3trees[xorbucketid].treessmall[xorslot]; - *(uint4*)(&xs.hash[0]) = *(uint4*)(&xors[1]); - slottiny &xst = eq->round3trees[xorbucketid].treestiny[xorslot]; - uint2 ttx; - ttx.x = bexor; - ttx.y = PACKER::set_bucketid_and_slots(bucketid, si[i], p, RB, SM); - *(uint2*)(&xst.hash[0]) = ttx; - } - } - - for (int k = 1; k != pos[i]; ++k) - { - u32 pindex = atomicAdd(&pairs_len, 1); - if (pindex >= MAXPAIRS) break; - u16 prev = ht[hr[i]][k]; - pairs[pindex] = __byte_perm(si[i], prev, 0x1054); - } - } - } - - __syncthreads(); - - // process pairs - u32 plen = umin(pairs_len, MAXPAIRS); - - u32 i, k; - for (u32 s = atomicAdd(&next_pair, 1); s < plen; s = atomicAdd(&next_pair, 1)) - { - int pair = pairs[s]; - i = __byte_perm(pair, 0, 0x4510); - k = __byte_perm(pair, 0, 0x4532); - - xors[4] = lastword2[i] ^ lastword2[k]; - - if (xors[4] != 0) - { - *(uint4*)(&xors[0]) = lastword1[i] ^ lastword1[k]; - - bexor = __byte_perm(xors[0], xors[1], 0x2107); - asm("bfe.u32 %0, %1, %2, %3;" : "=r"(xorbucketid) : "r"(bexor), "r"(RB), "r"(BUCKBITS)); - xorslot = atomicAdd(&eq->edata.nslots[3][xorbucketid], 1); - - if (xorslot < NSLOTS) - { - slotsmall &xs = eq->round3trees[xorbucketid].treessmall[xorslot]; - *(uint4*)(&xs.hash[0]) = *(uint4*)(&xors[1]); - slottiny &xst = eq->round3trees[xorbucketid].treestiny[xorslot]; - uint2 ttx; - ttx.x = bexor; - ttx.y = PACKER::set_bucketid_and_slots(bucketid, i, k, RB, SM); - *(uint2*)(&xst.hash[0]) = ttx; - } - } - } -} - - -template -__global__ void digit_4(equi* eq) -{ - __shared__ u16 ht[NRESTS][(SSM - 1)]; - __shared__ uint4 lastword[NSLOTS]; - __shared__ int ht_len[NRESTS]; - __shared__ int pairs[MAXPAIRS]; - __shared__ u32 pairs_len; - __shared__ u32 next_pair; - - const u32 threadid = threadIdx.x; - const u32 bucketid = blockIdx.x; - - // reset hashtable len - if (threadid < NRESTS) - ht_len[threadid] = 0; - else if (threadid == (THREADS - 1)) - pairs_len = 0; - else if (threadid == (THREADS - 33)) - next_pair = 0; - - u32 bsize = umin(eq->edata.nslots[3][bucketid], NSLOTS); - - u32 hr[2]; - int pos[2]; - pos[0] = pos[1] = SSM; - - u32 si[2]; - uint4 tt[2]; -#ifdef OPT_SYNC_ALL - __syncthreads(); -#endif - #pragma unroll 2 - for (u32 i = 0; i < 2; i++) - { - si[i] = i * THREADS + threadid; - if (si[i] >= bsize) break; - - slotsmall &xs = eq->round3trees[bucketid].treessmall[si[i]]; - slottiny &xst = eq->round3trees[bucketid].treestiny[si[i]]; - - // get xhash - tt[i] = *(uint4*)(&xs.hash[0]); - lastword[si[i]] = tt[i]; - hr[i] = xst.hash[0] & RESTMASK; - pos[i] = atomicAdd(&ht_len[hr[i]], 1); - if (pos[i] < (SSM - 1)) ht[hr[i]][pos[i]] = si[i]; - } - - __syncthreads(); - u32 xors[4]; - u32 xorbucketid, xorslot; - - #pragma unroll 2 - for (u32 i = 0; i < 2; i++) - { - if (pos[i] >= SSM) continue; - - if (pos[i] > 0) - { - u16 p = ht[hr[i]][0]; - - *(uint4*)(&xors[0]) = tt[i] ^ lastword[p]; - - if (xors[3] != 0) - { - asm("bfe.u32 %0, %1, %2, %3;" : "=r"(xorbucketid) : "r"(xors[0]), "r"(4 + RB), "r"(BUCKBITS)); - xorslot = atomicAdd(&eq->edata.nslots[4][xorbucketid], 1); - if (xorslot < NSLOTS) - { - slotsmall &xs = eq->treessmall[3][xorbucketid][xorslot]; - *(uint4*)(&xs.hash[0]) = *(uint4*)(&xors[0]); - - eq->round4bidandsids[xorbucketid][xorslot] = PACKER::set_bucketid_and_slots(bucketid, si[i], p, RB, SM); - } - } - - for (int k = 1; k != pos[i]; ++k) - { - u32 pindex = atomicAdd(&pairs_len, 1); - if (pindex >= MAXPAIRS) break; - u16 prev = ht[hr[i]][k]; - pairs[pindex] = __byte_perm(si[i], prev, 0x1054); - } - } - } - - __syncthreads(); - - // process pairs - u32 plen = umin(pairs_len, MAXPAIRS); - u32 i, k; - for (u32 s = atomicAdd(&next_pair, 1); s < plen; s = atomicAdd(&next_pair, 1)) - { - int pair = pairs[s]; - i = __byte_perm(pair, 0, 0x4510); - k = __byte_perm(pair, 0, 0x4532); - - *(uint4*)(&xors[0]) = lastword[i] ^ lastword[k]; - if (xors[3] != 0) - { - asm("bfe.u32 %0, %1, %2, %3;" : "=r"(xorbucketid) : "r"(xors[0]), "r"(4 + RB), "r"(BUCKBITS)); - xorslot = atomicAdd(&eq->edata.nslots[4][xorbucketid], 1); - if (xorslot < NSLOTS) - { - slotsmall &xs = eq->treessmall[3][xorbucketid][xorslot]; - *(uint4*)(&xs.hash[0]) = *(uint4*)(&xors[0]); - eq->round4bidandsids[xorbucketid][xorslot] = PACKER::set_bucketid_and_slots(bucketid, i, k, RB, SM); - } - } - } -} - - -template -__global__ void digit_5(equi* eq) -{ - __shared__ u16 ht[NRESTS][(SSM - 1)]; - __shared__ uint4 lastword[NSLOTS]; - __shared__ int ht_len[NRESTS]; - __shared__ int pairs[MAXPAIRS]; - __shared__ u32 pairs_len; - __shared__ u32 next_pair; - - const u32 threadid = threadIdx.x; - const u32 bucketid = blockIdx.x; - - if (threadid < NRESTS) - ht_len[threadid] = 0; - else if (threadid == (THREADS - 1)) - pairs_len = 0; - else if (threadid == (THREADS - 33)) - next_pair = 0; - - slotsmall* buck = eq->treessmall[3][bucketid]; - u32 bsize = umin(eq->edata.nslots[4][bucketid], NSLOTS); - - u32 hr[2]; - int pos[2]; - pos[0] = pos[1] = SSM; - - u32 si[2]; - uint4 tt[2]; -#ifdef OPT_SYNC_ALL - __syncthreads(); -#endif - #pragma unroll 2 - for (u32 i = 0; i < 2; i++) - { - si[i] = i * THREADS + threadid; - if (si[i] >= bsize) break; - - const slotsmall* pslot1 = buck + si[i]; - - tt[i] = *(uint4*)(&pslot1->hash[0]); - lastword[si[i]] = tt[i]; - asm("bfe.u32 %0, %1, 4, %2;" : "=r"(hr[i]) : "r"(tt[i].x), "r"(RB)); - pos[i] = atomicAdd(&ht_len[hr[i]], 1); - if (pos[i] < (SSM - 1)) ht[hr[i]][pos[i]] = si[i]; - } - - __syncthreads(); - u32 xors[4]; - u32 bexor, xorbucketid, xorslot; - - #pragma unroll 2 - for (u32 i = 0; i < 2; i++) - { - if (pos[i] >= SSM) continue; - - if (pos[i] > 0) - { - u16 p = ht[hr[i]][0]; - - *(uint4*)(&xors[0]) = tt[i] ^ lastword[p]; - - if (xors[3] != 0) - { - bexor = __byte_perm(xors[0], xors[1], 0x1076); - asm("bfe.u32 %0, %1, %2, %3;" : "=r"(xorbucketid) : "r"(bexor), "r"(RB), "r"(BUCKBITS)); - xorslot = atomicAdd(&eq->edata.nslots[5][xorbucketid], 1); - if (xorslot < NSLOTS) - { - slotsmall &xs = eq->treessmall[2][xorbucketid][xorslot]; - uint4 ttx; - ttx.x = xors[1]; - ttx.y = xors[2]; - ttx.z = xors[3]; - ttx.w = PACKER::set_bucketid_and_slots(bucketid, si[i], p, RB, SM); - *(uint4*)(&xs.hash[0]) = ttx; - } - } - - for (int k = 1; k != pos[i]; ++k) - { - u32 pindex = atomicAdd(&pairs_len, 1); - if (pindex >= MAXPAIRS) break; - u16 prev = ht[hr[i]][k]; - pairs[pindex] = __byte_perm(si[i], prev, 0x1054); - } - } - } - - __syncthreads(); - - // process pairs - u32 plen = umin(pairs_len, MAXPAIRS); - u32 i, k; - for (u32 s = atomicAdd(&next_pair, 1); s < plen; s = atomicAdd(&next_pair, 1)) - { - int pair = pairs[s]; - i = __byte_perm(pair, 0, 0x4510); - k = __byte_perm(pair, 0, 0x4532); - - *(uint4*)(&xors[0]) = lastword[i] ^ lastword[k]; - - if (xors[3] != 0) - { - bexor = __byte_perm(xors[0], xors[1], 0x1076); - asm("bfe.u32 %0, %1, %2, %3;" : "=r"(xorbucketid) : "r"(bexor), "r"(RB), "r"(BUCKBITS)); - xorslot = atomicAdd(&eq->edata.nslots[5][xorbucketid], 1); - if (xorslot < NSLOTS) - { - slotsmall &xs = eq->treessmall[2][xorbucketid][xorslot]; - uint4 tt; - tt.x = xors[1]; - tt.y = xors[2]; - tt.z = xors[3]; - tt.w = PACKER::set_bucketid_and_slots(bucketid, i, k, RB, SM); - *(uint4*)(&xs.hash[0]) = tt; - } - } - } -} - - -template -__global__ void digit_6(equi* eq) -{ - __shared__ u16 ht[NRESTS][(SSM - 1)]; - __shared__ uint2 lastword1[NSLOTS]; - __shared__ u32 lastword2[NSLOTS]; - __shared__ int ht_len[MAXPAIRS]; - __shared__ u32 pairs_len; - __shared__ u32 bsize_sh; - __shared__ u32 next_pair; - - const u32 threadid = threadIdx.x; - const u32 bucketid = blockIdx.x; - - // reset hashtable len - ht_len[threadid] = 0; - if (threadid == (NRESTS - 1)) - { - pairs_len = 0; - next_pair = 0; - } - else if (threadid == (NRESTS - 33)) - bsize_sh = umin(eq->edata.nslots[5][bucketid], NSLOTS); - - slotsmall* buck = eq->treessmall[2][bucketid]; - - u32 hr[3]; - int pos[3]; - pos[0] = pos[1] = pos[2] = SSM; - - u32 si[3]; - uint4 tt[3]; - - __syncthreads(); - - u32 bsize = bsize_sh; - - #pragma unroll 3 - for (u32 i = 0; i < 3; i++) - { - si[i] = i * NRESTS + threadid; - if (si[i] >= bsize) break; - - const slotsmall* pslot1 = buck + si[i]; - - tt[i] = *(uint4*)(&pslot1->hash[0]); - lastword1[si[i]] = *(uint2*)(&tt[i].x); - lastword2[si[i]] = tt[i].z; - asm("bfe.u32 %0, %1, 16, %2;" : "=r"(hr[i]) : "r"(tt[i].x), "r"(RB)); - pos[i] = atomicAdd(&ht_len[hr[i]], 1); - if (pos[i] < (SSM - 1)) ht[hr[i]][pos[i]] = si[i]; - } - - // doing this to save shared memory - int* pairs = ht_len; - __syncthreads(); - - u32 xors[3]; - u32 bexor, xorbucketid, xorslot; - - #pragma unroll 3 - for (u32 i = 0; i < 3; i++) - { - if (pos[i] >= SSM) continue; - - if (pos[i] > 0) - { - u16 p = ht[hr[i]][0]; - - xors[2] = tt[i].z ^ lastword2[p]; - - if (xors[2] != 0) - { - *(uint2*)(&xors[0]) = *(uint2*)(&tt[i].x) ^ lastword1[p]; - - bexor = __byte_perm(xors[0], xors[1], 0x1076); - xorbucketid = bexor >> (12 + RB); - xorslot = atomicAdd(&eq->edata.nslots[6][xorbucketid], 1); - if (xorslot < NSLOTS) - { - slotsmall &xs = eq->treessmall[0][xorbucketid][xorslot]; - uint4 ttx; - ttx.x = xors[1]; - ttx.y = xors[2]; - ttx.z = bexor; - ttx.w = PACKER::set_bucketid_and_slots(bucketid, si[i], p, RB, SM); - *(uint4*)(&xs.hash[0]) = ttx; - } - } - - if (pos[i] > 1) - { - p = ht[hr[i]][1]; - - xors[2] = tt[i].z ^ lastword2[p]; - - if (xors[2] != 0) - { - *(uint2*)(&xors[0]) = *(uint2*)(&tt[i].x) ^ lastword1[p]; - - bexor = __byte_perm(xors[0], xors[1], 0x1076); - xorbucketid = bexor >> (12 + RB); - xorslot = atomicAdd(&eq->edata.nslots[6][xorbucketid], 1); - if (xorslot < NSLOTS) - { - slotsmall &xs = eq->treessmall[0][xorbucketid][xorslot]; - uint4 ttx; - ttx.x = xors[1]; - ttx.y = xors[2]; - ttx.z = bexor; - ttx.w = PACKER::set_bucketid_and_slots(bucketid, si[i], p, RB, SM); - *(uint4*)(&xs.hash[0]) = ttx; - } - } - - for (int k = 2; k != pos[i]; ++k) - { - u32 pindex = atomicAdd(&pairs_len, 1); - if (pindex >= MAXPAIRS) break; - u16 prev = ht[hr[i]][k]; - pairs[pindex] = __byte_perm(si[i], prev, 0x1054); - } - } - } - } - - __syncthreads(); - - // process pairs - u32 plen = umin(pairs_len, MAXPAIRS); - for (u32 s = atomicAdd(&next_pair, 1); s < plen; s = atomicAdd(&next_pair, 1)) - { - u32 pair = pairs[s]; - u32 i = __byte_perm(pair, 0, 0x4510); - u32 k = __byte_perm(pair, 0, 0x4532); - - xors[2] = lastword2[i] ^ lastword2[k]; - if (xors[2] == 0) - continue; - - *(uint2*)(&xors[0]) = lastword1[i] ^ lastword1[k]; - - bexor = __byte_perm(xors[0], xors[1], 0x1076); - xorbucketid = bexor >> (12 + RB); - xorslot = atomicAdd(&eq->edata.nslots[6][xorbucketid], 1); - if (xorslot >= NSLOTS) continue; - slotsmall &xs = eq->treessmall[0][xorbucketid][xorslot]; - uint4 ttx; - ttx.x = xors[1]; - ttx.y = xors[2]; - ttx.z = bexor; - ttx.w = PACKER::set_bucketid_and_slots(bucketid, i, k, RB, SM); - *(uint4*)(&xs.hash[0]) = ttx; - } -} - - -template -__global__ void digit_7(equi* eq) -{ - __shared__ u16 ht[NRESTS][(SSM - 1)]; - __shared__ u32 lastword[NSLOTS][2]; - __shared__ int ht_len[NRESTS]; - __shared__ int pairs[MAXPAIRS]; - __shared__ u32 pairs_len; - __shared__ u32 bsize_sh; - __shared__ u32 next_pair; - - const u32 threadid = threadIdx.x; - const u32 bucketid = blockIdx.x; - - // reset hashtable len - ht_len[threadid] = 0; - if (threadid == (NRESTS - 1)) - { - pairs_len = 0; - next_pair = 0; - } - else if (threadid == (NRESTS - 33)) - bsize_sh = umin(eq->edata.nslots[6][bucketid], NSLOTS); - - slotsmall* buck = eq->treessmall[0][bucketid]; - - u32 hr[3]; - int pos[3]; - pos[0] = pos[1] = pos[2] = SSM; - - u32 si[3]; - uint4 tt[3]; - - __syncthreads(); - - u32 bsize = bsize_sh; - - #pragma unroll 3 - for (u32 i = 0; i < 3; i++) - { - si[i] = i * NRESTS + threadid; - if (si[i] >= bsize) break; - - const slotsmall* pslot1 = buck + si[i]; - - // get xhash - tt[i] = *(uint4*)(&pslot1->hash[0]); - *(uint2*)(&lastword[si[i]][0]) = *(uint2*)(&tt[i].x); - asm("bfe.u32 %0, %1, 12, %2;" : "=r"(hr[i]) : "r"(tt[i].z), "r"(RB)); - pos[i] = atomicAdd(&ht_len[hr[i]], 1); - if (pos[i] < (SSM - 1)) ht[hr[i]][pos[i]] = si[i]; - } - - __syncthreads(); - - u32 xors[2]; - u32 xorbucketid, xorslot; - - #pragma unroll 3 - for (u32 i = 0; i < 3; i++) - { - if (pos[i] >= SSM) continue; - - if (pos[i] > 0) - { - u16 p = ht[hr[i]][0]; - - *(uint2*)(&xors[0]) = *(uint2*)(&tt[i].x) ^ *(uint2*)(&lastword[p][0]); - - if (xors[1] != 0) - { - asm("bfe.u32 %0, %1, %2, %3;" : "=r"(xorbucketid) : "r"(xors[0]), "r"(8 + RB), "r"(BUCKBITS)); - xorslot = atomicAdd(&eq->edata.nslots[7][xorbucketid], 1); - if (xorslot < NSLOTS) - { - slotsmall &xs = eq->treessmall[1][xorbucketid][xorslot]; - uint4 ttx; - ttx.x = xors[0]; - ttx.y = xors[1]; - ttx.z = PACKER::set_bucketid_and_slots(bucketid, si[i], p, RB, SM); - ttx.w = 0; - *(uint4*)(&xs.hash[0]) = ttx; - } - } - - if (pos[i] > 1) - { - p = ht[hr[i]][1]; - - *(uint2*)(&xors[0]) = *(uint2*)(&tt[i].x) ^ *(uint2*)(&lastword[p][0]); - - if (xors[1] != 0) - { - asm("bfe.u32 %0, %1, %2, %3;" : "=r"(xorbucketid) : "r"(xors[0]), "r"(8 + RB), "r"(BUCKBITS)); - xorslot = atomicAdd(&eq->edata.nslots[7][xorbucketid], 1); - if (xorslot < NSLOTS) - { - slotsmall &xs = eq->treessmall[1][xorbucketid][xorslot]; - uint4 ttx; - ttx.x = xors[0]; - ttx.y = xors[1]; - ttx.z = PACKER::set_bucketid_and_slots(bucketid, si[i], p, RB, SM); - ttx.w = 0; - *(uint4*)(&xs.hash[0]) = ttx; - } - } - - for (int k = 2; k != pos[i]; ++k) - { - u32 pindex = atomicAdd(&pairs_len, 1); - if (pindex >= MAXPAIRS) break; - u16 prev = ht[hr[i]][k]; - pairs[pindex] = __byte_perm(si[i], prev, 0x1054); - } - } - } - } - - __syncthreads(); - - // process pairs - u32 plen = umin(pairs_len, MAXPAIRS); - for (u32 s = atomicAdd(&next_pair, 1); s < plen; s = atomicAdd(&next_pair, 1)) - { - int pair = pairs[s]; - u32 i = __byte_perm(pair, 0, 0x4510); - u32 k = __byte_perm(pair, 0, 0x4532); - - *(uint2*)(&xors[0]) = *(uint2*)(&lastword[i][0]) ^ *(uint2*)(&lastword[k][0]); - - if (xors[1] == 0) - continue; - - asm("bfe.u32 %0, %1, %2, %3;" : "=r"(xorbucketid) : "r"(xors[0]), "r"(8 + RB), "r"(BUCKBITS)); - xorslot = atomicAdd(&eq->edata.nslots[7][xorbucketid], 1); - if (xorslot >= NSLOTS) continue; - slotsmall &xs = eq->treessmall[1][xorbucketid][xorslot]; - uint4 tt; - tt.x = xors[0]; - tt.y = xors[1]; - tt.z = PACKER::set_bucketid_and_slots(bucketid, i, k, RB, SM); - tt.w = 0; - *(uint4*)(&xs.hash[0]) = tt; - } -} - - -template -__global__ void digit_8(equi* eq) -{ - __shared__ u16 ht[NRESTS][(SSM - 1)]; - __shared__ u32 lastword[NSLOTS][2]; - __shared__ int ht_len[NRESTS]; - __shared__ int pairs[MAXPAIRS]; - __shared__ u32 pairs_len; - __shared__ u32 bsize_sh; - __shared__ u32 next_pair; - - const u32 threadid = threadIdx.x; - const u32 bucketid = blockIdx.x; - - // reset hashtable len - ht_len[threadid] = 0; - if (threadid == (NRESTS - 1)) - { - next_pair = 0; - pairs_len = 0; - } - else if (threadid == (NRESTS - 33)) - bsize_sh = umin(eq->edata.nslots[7][bucketid], NSLOTS); - - slotsmall* buck = eq->treessmall[1][bucketid]; - - u32 hr[3]; - int pos[3]; - pos[0] = pos[1] = pos[2] = SSM; - - u32 si[3]; - uint2 tt[3]; - - __syncthreads(); - - u32 bsize = bsize_sh; - - #pragma unroll 3 - for (u32 i = 0; i < 3; i++) - { - si[i] = i * NRESTS + threadid; - if (si[i] >= bsize) break; - - const slotsmall* pslot1 = buck + si[i]; - - // get xhash - tt[i] = *(uint2*)(&pslot1->hash[0]); - *(uint2*)(&lastword[si[i]][0]) = *(uint2*)(&tt[i].x); - asm("bfe.u32 %0, %1, 8, %2;" : "=r"(hr[i]) : "r"(tt[i].x), "r"(RB)); - pos[i] = atomicAdd(&ht_len[hr[i]], 1); - if (pos[i] < (SSM - 1)) ht[hr[i]][pos[i]] = si[i]; - } - - __syncthreads(); - - u32 xors[2]; - u32 bexor, xorbucketid, xorslot; - - #pragma unroll 3 - for (u32 i = 0; i < 3; i++) - { - if (pos[i] >= SSM) continue; - - if (pos[i] > 0) - { - u16 p = ht[hr[i]][0]; - - *(uint2*)(&xors[0]) = *(uint2*)(&tt[i].x) ^ *(uint2*)(&lastword[p][0]); - - if (xors[1] != 0) - { - bexor = __byte_perm(xors[0], xors[1], 0x0765); - xorbucketid = bexor >> (12 + 8); - xorslot = atomicAdd(&eq->edata.nslots8[xorbucketid], 1); - if (xorslot < RB8_NSLOTS_LD) - { - slottiny &xs = eq->treestiny[0][xorbucketid][xorslot]; - uint2 tt; - tt.x = xors[1]; - tt.y = PACKER::set_bucketid_and_slots(bucketid, si[i], p, RB, SM); - *(uint2*)(&xs.hash[0]) = tt; - } - } - - if (pos[i] > 1) - { - p = ht[hr[i]][1]; - - *(uint2*)(&xors[0]) = *(uint2*)(&tt[i].x) ^ *(uint2*)(&lastword[p][0]); - - if (xors[1] != 0) - { - bexor = __byte_perm(xors[0], xors[1], 0x0765); - xorbucketid = bexor >> (12 + 8); - xorslot = atomicAdd(&eq->edata.nslots8[xorbucketid], 1); - if (xorslot < RB8_NSLOTS_LD) - { - slottiny &xs = eq->treestiny[0][xorbucketid][xorslot]; - uint2 tt; - tt.x = xors[1]; - tt.y = PACKER::set_bucketid_and_slots(bucketid, si[i], p, RB, SM); - *(uint2*)(&xs.hash[0]) = tt; - } - } - - for (int k = 2; k != pos[i]; ++k) - { - u32 pindex = atomicAdd(&pairs_len, 1); - if (pindex >= MAXPAIRS) break; - u16 prev = ht[hr[i]][k]; - pairs[pindex] = __byte_perm(si[i], prev, 0x1054); - } - } - } - } - - __syncthreads(); - - // process pairs - u32 plen = umin(pairs_len, MAXPAIRS); - for (u32 s = atomicAdd(&next_pair, 1); s < plen; s = atomicAdd(&next_pair, 1)) - { - int pair = pairs[s]; - u32 i = __byte_perm(pair, 0, 0x4510); - u32 k = __byte_perm(pair, 0, 0x4532); - - *(uint2*)(&xors[0]) = *(uint2*)(&lastword[i][0]) ^ *(uint2*)(&lastword[k][0]); - - if (xors[1] == 0) - continue; - - bexor = __byte_perm(xors[0], xors[1], 0x0765); - xorbucketid = bexor >> (12 + 8); - xorslot = atomicAdd(&eq->edata.nslots8[xorbucketid], 1); - if (xorslot >= RB8_NSLOTS_LD) continue; - slottiny &xs = eq->treestiny[0][xorbucketid][xorslot]; - uint2 tt; - tt.x = xors[1]; - tt.y = PACKER::set_bucketid_and_slots(bucketid, i, k, RB, SM); - *(uint2*)(&xs.hash[0]) = tt; - } -} - -/* - Last round function is similar to previous ones but has different ending. - We use warps to process final candidates. Each warp process one candidate. - First two bidandsids (u32 of stored bucketid and two slotids) are retreived by - lane 0 and lane 16, next four bidandsids by lane 0, 8, 16 and 24, ... until - all lanes in warp have bidandsids from round 4. Next, each thread retreives - 16 indices. While doing so, indices are put into comparison using atomicExch - to determine if there are duplicates (tromp's method). At the end, if no - duplicates are found, candidate solution is saved (all indices). Note that this - dup check method is not exact so CPU dup checking is needed after. -*/ -template -__global__ void digit_last_wdc(equi* eq) -{ - __shared__ u8 shared_data[8192]; - int* ht_len = (int*)(&shared_data[0]); - int* pairs = ht_len; - u32* lastword = (u32*)(&shared_data[256 * 4]); - u16* ht = (u16*)(&shared_data[256 * 4 + RB8_NSLOTS_LD * 4]); - u32* pairs_len = (u32*)(&shared_data[8188]); - - const u32 threadid = threadIdx.x; - const u32 bucketid = blockIdx.x; - - // reset hashtable len - #pragma unroll - for (u32 i = 0; i < FCT; i++) - ht_len[(i * (256 / FCT)) + threadid] = 0; - - if (threadid == ((256 / FCT) - 1)) - *pairs_len = 0; - - slottiny* buck = eq->treestiny[0][bucketid]; - u32 bsize = umin(eq->edata.nslots8[bucketid], RB8_NSLOTS_LD); - - u32 si[3 * FCT]; - u32 hr[3 * FCT]; - int pos[3 * FCT]; - u32 lw[3 * FCT]; - - #pragma unroll - for (u32 i = 0; i < (3 * FCT); i++) - pos[i] = SSM; - - __syncthreads(); - - #pragma unroll - for (u32 i = 0; i < (3 * FCT); i++) - { - si[i] = i * (256 / FCT) + threadid; - if (si[i] >= bsize) break; - - const slottiny* pslot1 = buck + si[i]; - - // get xhash - uint2 tt = *(uint2*)(&pslot1->hash[0]); - lw[i] = tt.x; - lastword[si[i]] = lw[i]; - - u32 a; - asm("bfe.u32 %0, %1, 20, 8;" : "=r"(a) : "r"(lw[i])); - hr[i] = a; - - pos[i] = atomicAdd(&ht_len[hr[i]], 1); - if (pos[i] < (SSM - 1)) - ht[hr[i] * (SSM - 1) + pos[i]] = si[i]; - } - - __syncthreads(); - - #pragma unroll - for (u32 i = 0; i < (3 * FCT); i++) - { - if (pos[i] >= SSM) continue; - - for (int k = 0; k != pos[i]; ++k) - { - u16 prev = ht[hr[i] * (SSM - 1) + k]; - if (lw[i] != lastword[prev]) continue; - u32 pindex = atomicAdd(pairs_len, 1); - if (pindex >= MAXPAIRS) break; - pairs[pindex] = __byte_perm(si[i], prev, 0x1054); - } - } - - __syncthreads(); - u32 plen = umin(*pairs_len, 64); - -#define CALC_LEVEL(a, b, c, d) { \ - u32 plvl = levels[b]; \ - u32* bucks = eq->round4bidandsids[PACKER::get_bucketid(plvl, RB, SM)]; \ - u32 slot1 = PACKER::get_slot1(plvl, RB, SM); \ - u32 slot0 = PACKER::get_slot0(plvl, slot1, RB, SM); \ - levels[b] = bucks[slot1]; \ - levels[c] = bucks[slot0]; \ - } - -#define CALC_LEVEL_SMALL(a, b, c, d) { \ - u32 plvl = levels[b]; \ - slotsmall* bucks = eq->treessmall[a][PACKER::get_bucketid(plvl, RB, SM)]; \ - u32 slot1 = PACKER::get_slot1(plvl, RB, SM); \ - u32 slot0 = PACKER::get_slot0(plvl, slot1, RB, SM); \ - levels[b] = bucks[slot1].hash[d]; \ - levels[c] = bucks[slot0].hash[d]; \ - } - - u32 lane = threadIdx.x & 0x1f; - u32 par = threadIdx.x >> 5; - - u32* levels = (u32*)&pairs[MAXPAIRS + (par << DUPBITS)]; - u32* susp = levels; - - while (par < plen) - { - int pair = pairs[par]; - par += W; - - if (lane % 16 == 0) - { - u32 plvl; - if (lane == 0) plvl = buck[__byte_perm(pair, 0, 0x4510)].hash[1]; - else plvl = buck[__byte_perm(pair, 0, 0x4532)].hash[1]; - slotsmall* bucks = eq->treessmall[1][PACKER::get_bucketid(plvl, RB, SM)]; - u32 slot1 = PACKER::get_slot1(plvl, RB, SM); - u32 slot0 = PACKER::get_slot0(plvl, slot1, RB, SM); - levels[lane] = bucks[slot1].hash[2]; - levels[lane + 8] = bucks[slot0].hash[2]; - } - - if (lane % 8 == 0) - CALC_LEVEL_SMALL(0, lane, lane + 4, 3); - - if (lane % 4 == 0) - CALC_LEVEL_SMALL(2, lane, lane + 2, 3); - - if (lane % 2 == 0) - CALC_LEVEL(0, lane, lane + 1, 4); - - u32 ind[16]; - - u32 f1 = levels[lane]; - const slottiny* buck_v4 = &eq->round3trees[PACKER::get_bucketid(f1, RB, SM)].treestiny[0]; - const u32 slot1_v4 = PACKER::get_slot1(f1, RB, SM); - const u32 slot0_v4 = PACKER::get_slot0(f1, slot1_v4, RB, SM); - - susp[lane] = 0xffffffff; - susp[32 + lane] = 0xffffffff; - -#define CHECK_DUP(a) \ - __any(atomicExch(&susp[(ind[a] & ((1 << DUPBITS) - 1))], (ind[a] >> DUPBITS)) == (ind[a] >> DUPBITS)) - - u32 f2 = buck_v4[slot1_v4].hash[1]; - const slottiny* buck_v3_1 = &eq->round2trees[PACKER::get_bucketid(f2, RB, SM)].treestiny[0]; - const u32 slot1_v3_1 = PACKER::get_slot1(f2, RB, SM); - const u32 slot0_v3_1 = PACKER::get_slot0(f2, slot1_v3_1, RB, SM); - - susp[64 + lane] = 0xffffffff; - susp[96 + lane] = 0xffffffff; - - u32 f0 = buck_v3_1[slot1_v3_1].hash[1]; - const slot* buck_v2_1 = eq->trees[0][PACKER::get_bucketid(f0, RB, SM)]; - const u32 slot1_v2_1 = PACKER::get_slot1(f0, RB, SM); - const u32 slot0_v2_1 = PACKER::get_slot0(f0, slot1_v2_1, RB, SM); - - susp[128 + lane] = 0xffffffff; - susp[160 + lane] = 0xffffffff; - - u32 f3 = buck_v2_1[slot1_v2_1].hash[6]; - const slot* buck_fin_1 = eq->round0trees[packer_default::get_bucketid(f3, 8, RB8_NSLOTS)]; - const u32 slot1_fin_1 = packer_default::get_slot1(f3, 8, RB8_NSLOTS); - const u32 slot0_fin_1 = packer_default::get_slot0(f3, slot1_fin_1, 8, RB8_NSLOTS); - - susp[192 + lane] = 0xffffffff; - susp[224 + lane] = 0xffffffff; - - ind[0] = buck_fin_1[slot1_fin_1].hash[7]; - if (CHECK_DUP(0)) continue; - ind[1] = buck_fin_1[slot0_fin_1].hash[7]; - if (CHECK_DUP(1)) continue; - - u32 f4 = buck_v2_1[slot0_v2_1].hash[6]; - const slot* buck_fin_2 = eq->round0trees[packer_default::get_bucketid(f4, 8, RB8_NSLOTS)]; - const u32 slot1_fin_2 = packer_default::get_slot1(f4, 8, RB8_NSLOTS); - const u32 slot0_fin_2 = packer_default::get_slot0(f4, slot1_fin_2, 8, RB8_NSLOTS); - - ind[2] = buck_fin_2[slot1_fin_2].hash[7]; - if (CHECK_DUP(2)) continue; - ind[3] = buck_fin_2[slot0_fin_2].hash[7]; - if (CHECK_DUP(3)) continue; - - u32 f5 = buck_v3_1[slot0_v3_1].hash[1]; - const slot* buck_v2_2 = eq->trees[0][PACKER::get_bucketid(f5, RB, SM)]; - const u32 slot1_v2_2 = PACKER::get_slot1(f5, RB, SM); - const u32 slot0_v2_2 = PACKER::get_slot0(f5, slot1_v2_2, RB, SM); - - u32 f6 = buck_v2_2[slot1_v2_2].hash[6]; - const slot* buck_fin_3 = eq->round0trees[packer_default::get_bucketid(f6, 8, RB8_NSLOTS)]; - const u32 slot1_fin_3 = packer_default::get_slot1(f6, 8, RB8_NSLOTS); - const u32 slot0_fin_3 = packer_default::get_slot0(f6, slot1_fin_3, 8, RB8_NSLOTS); - - ind[4] = buck_fin_3[slot1_fin_3].hash[7]; - if (CHECK_DUP(4)) continue; - ind[5] = buck_fin_3[slot0_fin_3].hash[7]; - if (CHECK_DUP(5)) continue; - - u32 f7 = buck_v2_2[slot0_v2_2].hash[6]; - const slot* buck_fin_4 = eq->round0trees[packer_default::get_bucketid(f7, 8, RB8_NSLOTS)]; - const u32 slot1_fin_4 = packer_default::get_slot1(f7, 8, RB8_NSLOTS); - const u32 slot0_fin_4 = packer_default::get_slot0(f7, slot1_fin_4, 8, RB8_NSLOTS); - - ind[6] = buck_fin_4[slot1_fin_4].hash[7]; - if (CHECK_DUP(6)) continue; - ind[7] = buck_fin_4[slot0_fin_4].hash[7]; - if (CHECK_DUP(7)) continue; - - u32 f8 = buck_v4[slot0_v4].hash[1]; - const slottiny* buck_v3_2 = &eq->round2trees[PACKER::get_bucketid(f8, RB, SM)].treestiny[0]; - const u32 slot1_v3_2 = PACKER::get_slot1(f8, RB, SM); - const u32 slot0_v3_2 = PACKER::get_slot0(f8, slot1_v3_2, RB, SM); - - u32 f9 = buck_v3_2[slot1_v3_2].hash[1]; - const slot* buck_v2_3 = eq->trees[0][PACKER::get_bucketid(f9, RB, SM)]; - const u32 slot1_v2_3 = PACKER::get_slot1(f9, RB, SM); - const u32 slot0_v2_3 = PACKER::get_slot0(f9, slot1_v2_3, RB, SM); - - u32 f10 = buck_v2_3[slot1_v2_3].hash[6]; - const slot* buck_fin_5 = eq->round0trees[packer_default::get_bucketid(f10, 8, RB8_NSLOTS)]; - const u32 slot1_fin_5 = packer_default::get_slot1(f10, 8, RB8_NSLOTS); - const u32 slot0_fin_5 = packer_default::get_slot0(f10, slot1_fin_5, 8, RB8_NSLOTS); - - ind[8] = buck_fin_5[slot1_fin_5].hash[7]; - if (CHECK_DUP(8)) continue; - ind[9] = buck_fin_5[slot0_fin_5].hash[7]; - if (CHECK_DUP(9)) continue; - - u32 f11 = buck_v2_3[slot0_v2_3].hash[6]; - const slot* buck_fin_6 = eq->round0trees[packer_default::get_bucketid(f11, 8, RB8_NSLOTS)]; - const u32 slot1_fin_6 = packer_default::get_slot1(f11, 8, RB8_NSLOTS); - const u32 slot0_fin_6 = packer_default::get_slot0(f11, slot1_fin_6, 8, RB8_NSLOTS); - - ind[10] = buck_fin_6[slot1_fin_6].hash[7]; - if (CHECK_DUP(10)) continue; - ind[11] = buck_fin_6[slot0_fin_6].hash[7]; - if (CHECK_DUP(11)) continue; - - u32 f12 = buck_v3_2[slot0_v3_2].hash[1]; - const slot* buck_v2_4 = eq->trees[0][PACKER::get_bucketid(f12, RB, SM)]; - const u32 slot1_v2_4 = PACKER::get_slot1(f12, RB, SM); - const u32 slot0_v2_4 = PACKER::get_slot0(f12, slot1_v2_4, RB, SM); - - u32 f13 = buck_v2_4[slot1_v2_4].hash[6]; - const slot* buck_fin_7 = eq->round0trees[packer_default::get_bucketid(f13, 8, RB8_NSLOTS)]; - const u32 slot1_fin_7 = packer_default::get_slot1(f13, 8, RB8_NSLOTS); - const u32 slot0_fin_7 = packer_default::get_slot0(f13, slot1_fin_7, 8, RB8_NSLOTS); - - ind[12] = buck_fin_7[slot1_fin_7].hash[7]; - if (CHECK_DUP(12)) continue; - ind[13] = buck_fin_7[slot0_fin_7].hash[7]; - if (CHECK_DUP(13)) continue; - - u32 f14 = buck_v2_4[slot0_v2_4].hash[6]; - const slot* buck_fin_8 = eq->round0trees[packer_default::get_bucketid(f14, 8, RB8_NSLOTS)]; - const u32 slot1_fin_8 = packer_default::get_slot1(f14, 8, RB8_NSLOTS); - const u32 slot0_fin_8 = packer_default::get_slot0(f14, slot1_fin_8, 8, RB8_NSLOTS); - - ind[14] = buck_fin_8[slot1_fin_8].hash[7]; - if (CHECK_DUP(14)) continue; - ind[15] = buck_fin_8[slot0_fin_8].hash[7]; - if (CHECK_DUP(15)) continue; - - u32 soli; - if (lane == 0) { - soli = atomicAdd(&eq->edata.srealcont.nsols, 1); - } -#if __CUDA_ARCH__ >= 300 - // all threads get the value from lane 0 - soli = __shfl2(soli, 0); -#else - __syncthreads(); - soli = eq->edata.srealcont.nsols; -#endif - if (soli < MAXREALSOLS) - { - u32 pos = lane << 4; - *(uint4*)(&eq->edata.srealcont.sols[soli][pos ]) = *(uint4*)(&ind[ 0]); - *(uint4*)(&eq->edata.srealcont.sols[soli][pos + 4]) = *(uint4*)(&ind[ 4]); - *(uint4*)(&eq->edata.srealcont.sols[soli][pos + 8]) = *(uint4*)(&ind[ 8]); - *(uint4*)(&eq->edata.srealcont.sols[soli][pos + 12]) = *(uint4*)(&ind[12]); - } - } -} - -//std::mutex dev_init; -int dev_init_done[MAX_GPUS] = { 0 }; - -__host__ -static int compu32(const void *pa, const void *pb) -{ - uint32_t a = *(uint32_t *)pa, b = *(uint32_t *)pb; - return a b[i]) - { - need_sorting = 1; - tmp = a[i]; - a[i] = b[i]; - b[i] = tmp; - } - else if (a[i] < b[i]) - return; - } -} - -__host__ -static void setheader(blake2b_state *ctx, const char *header, const u32 headerLen, const char* nce, const u32 nonceLen) -{ - uint32_t le_N = WN; - uint32_t le_K = WK; - uchar personal[] = "ZcashPoW01230123"; - memcpy(personal + 8, &le_N, 4); - memcpy(personal + 12, &le_K, 4); - blake2b_param P[1]; - P->digest_length = HASHOUT; - P->key_length = 0; - P->fanout = 1; - P->depth = 1; - P->leaf_length = 0; - P->node_offset = 0; - P->node_depth = 0; - P->inner_length = 0; - memset(P->reserved, 0, sizeof(P->reserved)); - memset(P->salt, 0, sizeof(P->salt)); - memcpy(P->personal, (const uint8_t *)personal, 16); - eq_blake2b_init_param(ctx, P); - eq_blake2b_update(ctx, (const uchar *)header, headerLen); - if (nonceLen) eq_blake2b_update(ctx, (const uchar *)nce, nonceLen); -} - -#ifdef WIN32 -typedef CUresult(CUDAAPI *dec_cuDeviceGet)(CUdevice*, int); -typedef CUresult(CUDAAPI *dec_cuCtxCreate)(CUcontext*, unsigned int, CUdevice); -typedef CUresult(CUDAAPI *dec_cuCtxPushCurrent)(CUcontext); -typedef CUresult(CUDAAPI *dec_cuCtxDestroy)(CUcontext); - -dec_cuDeviceGet _cuDeviceGet = nullptr; -dec_cuCtxCreate _cuCtxCreate = nullptr; -dec_cuCtxPushCurrent _cuCtxPushCurrent = nullptr; -dec_cuCtxDestroy _cuCtxDestroy = nullptr; -#endif - -template -__host__ eq_cuda_context::eq_cuda_context(int thr_id, int dev_id) -{ - thread_id = thr_id; - device_id = dev_id; - solutions = nullptr; - equi_mem_sz = sizeof(equi); - throughput = NBLOCKS; - totalblocks = NBLOCKS/FD_THREADS; - threadsperblock = FD_THREADS; - threadsperblock_digits = THREADS; - - //dev_init.lock(); - if (!dev_init_done[device_id]) - { - // only first thread shall init device - checkCudaErrors(cudaSetDevice(device_id)); - checkCudaErrors(cudaDeviceReset()); - checkCudaErrors(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync)); - - pctx = nullptr; - } - else - { - // create new context - CUdevice dev; - -#ifdef WIN32 - if (_cuDeviceGet == nullptr) - { - HMODULE hmod = LoadLibraryA("nvcuda.dll"); - if (hmod == NULL) - throw std::runtime_error("Failed to load nvcuda.dll"); - _cuDeviceGet = (dec_cuDeviceGet)GetProcAddress(hmod, "cuDeviceGet"); - if (_cuDeviceGet == nullptr) - throw std::runtime_error("Failed to get cuDeviceGet address"); - _cuCtxCreate = (dec_cuCtxCreate)GetProcAddress(hmod, "cuCtxCreate_v2"); - if (_cuCtxCreate == nullptr) - throw std::runtime_error("Failed to get cuCtxCreate address"); - _cuCtxPushCurrent = (dec_cuCtxPushCurrent)GetProcAddress(hmod, "cuCtxPushCurrent_v2"); - if (_cuCtxPushCurrent == nullptr) - throw std::runtime_error("Failed to get cuCtxPushCurrent address"); - _cuCtxDestroy = (dec_cuCtxDestroy)GetProcAddress(hmod, "cuCtxDestroy_v2"); - if (_cuCtxDestroy == nullptr) - throw std::runtime_error("Failed to get cuCtxDestroy address"); - } - - checkCudaDriverErrors(_cuDeviceGet(&dev, device_id)); - checkCudaDriverErrors(_cuCtxCreate(&pctx, CU_CTX_SCHED_BLOCKING_SYNC, dev)); - checkCudaDriverErrors(_cuCtxPushCurrent(pctx)); -#else - checkCudaDriverErrors(cuDeviceGet(&dev, device_id)); - checkCudaDriverErrors(cuCtxCreate(&pctx, CU_CTX_SCHED_BLOCKING_SYNC, dev)); - checkCudaDriverErrors(cuCtxPushCurrent(pctx)); -#endif - } - ++dev_init_done[device_id]; - //dev_init.unlock(); - - if (cudaMalloc((void**)&device_eq, equi_mem_sz) != cudaSuccess) - throw std::runtime_error("CUDA: failed to alloc memory"); - - solutions = (scontainerreal*) malloc(sizeof(scontainerreal)); - if (!solutions) - throw std::runtime_error("EOM: failed to alloc solutions memory"); -} - -template -__host__ void eq_cuda_context::solve(const char *tequihash_header, - unsigned int tequihash_header_len, - const char* nonce, - unsigned int nonce_len, - fn_cancel cancelf, - fn_solution solutionf, - fn_hashdone hashdonef) -{ - blake2b_state blake_ctx; - - int blocks = NBUCKETS; - - setheader(&blake_ctx, tequihash_header, tequihash_header_len, nonce, nonce_len); - - // todo: improve - // djezo solver allows last 4 bytes of nonce to be iterrated - // this can be used to create internal loop - calc initial blake hash only once, then load 8*8 bytes on device (blake state h) - // then just iterate nn++ - // less CPU load, 1 cudaMemcpy less -> faster - //u32 nn = *(u32*)&nonce[28]; - u32 nn = 0; - - checkCudaErrors(cudaMemcpy(&device_eq->blake_h, &blake_ctx.h, sizeof(u64) * 8, cudaMemcpyHostToDevice)); - - checkCudaErrors(cudaMemset(&device_eq->edata, 0, sizeof(device_eq->edata))); - - digit_first <<>>(device_eq, nn); - - digit_1 <<<4096, 512 >>>(device_eq); - digit_2 <<>>(device_eq); - digit_3 <<>>(device_eq); - - if (cancelf(thread_id)) return; - - digit_4 <<>>(device_eq); - digit_5 <<>>(device_eq); - - digit_6 <<>>(device_eq); - digit_7 <<>>(device_eq); - digit_8 <<>>(device_eq); - - digit_last_wdc <<<4096, 256 / 2 >>>(device_eq); - - checkCudaErrors(cudaMemcpy(solutions, &device_eq->edata.srealcont, (MAXREALSOLS * (512 * 4)) + 4, cudaMemcpyDeviceToHost)); - - //printf("T%d nsols: %u\n", thread_id, solutions->nsols); - //if (solutions->nsols > 9) - // printf("missing sol, total: %u\n", solutions->nsols); - - for (u32 s = 0; (s < solutions->nsols) && (s < MAXREALSOLS); s++) - { - // remove dups on CPU (dup removal on GPU is not fully exact and can pass on some invalid solutions) - if (duped(solutions->sols[s])) continue; - - // perform sort of pairs - for (uint32_t level = 0; level < 9; level++) - for (uint32_t i = 0; i < (1 << 9); i += (2 << level)) - sort_pair(&solutions->sols[s][i], 1 << level); - - std::vector index_vector(PROOFSIZE); - for (u32 i = 0; i < PROOFSIZE; i++) { - index_vector[i] = solutions->sols[s][i]; - } - - solutionf(thread_id, index_vector, DIGITBITS, nullptr); - } - - // ccminer: only use hashdonef if no solutions... - if (!solutions->nsols) - hashdonef(thread_id); -} - -// destructor -template -__host__ -void eq_cuda_context::freemem() -{ - if (solutions) - free(solutions); - - if (device_eq) { - cudaFree(device_eq); - device_eq = NULL; - } - - if (pctx) { - // non primary thread, destroy context -#ifdef WIN32 - checkCudaDriverErrors(_cuCtxDestroy(pctx)); -#else - checkCudaDriverErrors(cuCtxDestroy(pctx)); -#endif - } else { - checkCudaErrors(cudaDeviceReset()); - dev_init_done[device_id] = 0; - } -} - -template -__host__ -eq_cuda_context::~eq_cuda_context() -{ - freemem(); -} - -#ifdef CONFIG_MODE_1 -template class eq_cuda_context; -#endif - -#ifdef CONFIG_MODE_2 -template class eq_cuda_context; -#endif - -#ifdef CONFIG_MODE_3 -template class eq_cuda_context; -#endif diff --git a/equi/eqcuda.hpp b/equi/eqcuda.hpp deleted file mode 100644 index fa5abb11..00000000 --- a/equi/eqcuda.hpp +++ /dev/null @@ -1,136 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#ifdef WIN32 -#define _SNPRINTF _snprintf -#else -#define _SNPRINTF snprintf -#endif - -#ifndef nullptr -#define nullptr NULL -#endif - -#ifdef WIN32 -#define rt_error std::runtime_error -#else -class rt_error : public std::runtime_error -{ -public: - explicit rt_error(const std::string& str) : std::runtime_error(str) {} -}; -#endif - -#define checkCudaErrors(call) \ -do { \ - cudaError_t err = call; \ - if (cudaSuccess != err) { \ - char errorBuff[512]; \ - _SNPRINTF(errorBuff, sizeof(errorBuff) - 1, \ - "CUDA error '%s' in func '%s' line %d", \ - cudaGetErrorString(err), __FUNCTION__, __LINE__); \ - throw rt_error(errorBuff); \ - } \ -} while (0) - -#define checkCudaDriverErrors(call) \ -do { \ - CUresult err = call; \ - if (CUDA_SUCCESS != err) { \ - char errorBuff[512]; \ - _SNPRINTF(errorBuff, sizeof(errorBuff) - 1, \ - "CUDA error DRIVER: '%d' in func '%s' line %d", \ - err, __FUNCTION__, __LINE__); \ - throw rt_error(errorBuff); \ - } \ -} while (0) - -typedef uint64_t u64; -typedef uint32_t u32; -typedef uint16_t u16; -typedef uint8_t u8; -typedef unsigned char uchar; - -struct packer_default; -struct packer_cantor; - -#define MAXREALSOLS 9 - -struct scontainerreal { - u32 sols[MAXREALSOLS][512]; - u32 nsols; -}; - -#if 0 -#include -#define fn_solution std::function&, size_t, const unsigned char*)> -#define fn_hashdone std::function -#define fn_cancel std::function -#else -typedef void (*fn_solution)(int thr_id, const std::vector&, size_t, const unsigned char*); -typedef void (*fn_hashdone)(int thr_id); -typedef bool (*fn_cancel)(int thr_id); -#endif - -template struct equi; - -// --------------------------------------------------------------------------------------------------- - -struct eq_cuda_context_interface -{ - //virtual ~eq_cuda_context_interface(); - - virtual void solve(const char *tequihash_header, - unsigned int tequihash_header_len, - const char* nonce, - unsigned int nonce_len, - fn_cancel cancelf, - fn_solution solutionf, - fn_hashdone hashdonef); - -public: - int thread_id; - int device_id; - int throughput; - int totalblocks; - int threadsperblock; - int threadsperblock_digits; - size_t equi_mem_sz; -}; - -// --------------------------------------------------------------------------------------------------- - -template -class eq_cuda_context : public eq_cuda_context_interface -{ - equi* device_eq; - scontainerreal* solutions; - CUcontext pctx; - - void solve(const char *tequihash_header, - unsigned int tequihash_header_len, - const char* nonce, - unsigned int nonce_len, - fn_cancel cancelf, - fn_solution solutionf, - fn_hashdone hashdonef); -public: - eq_cuda_context(int thr_id, int dev_id); - void freemem(); - ~eq_cuda_context(); -}; - -// RB, SM, SSM, TPB, PACKER... but any change only here will fail.. -#define CONFIG_MODE_1 9, 1248, 12, 640, packer_cantor -//#define CONFIG_MODE_2 8, 640, 12, 512, packer_default diff --git a/equi/equi-stratum.cpp b/equi/equi-stratum.cpp deleted file mode 100644 index 403c1850..00000000 --- a/equi/equi-stratum.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/** - * Equihash specific stratum protocol - * tpruvot@github - 2017 - Part under GPLv3 Licence - */ - -#include -#include -#include -#include - -#include "equihash.h" - -extern struct stratum_ctx stratum; -extern pthread_mutex_t stratum_work_lock; - -// ZEC uses a different scale to compute diff... -// sample targets to diff (stored in the reverse byte order in work->target) -// 0007fff800000000000000000000000000000000000000000000000000000000 is stratum diff 32 -// 003fffc000000000000000000000000000000000000000000000000000000000 is stratum diff 4 -// 00ffff0000000000000000000000000000000000000000000000000000000000 is stratum diff 1 -double target_to_diff_equi(uint32_t* target) -{ - uchar* tgt = (uchar*) target; - uint64_t m = - (uint64_t)tgt[30] << 24 | - (uint64_t)tgt[29] << 16 | - (uint64_t)tgt[28] << 8 | - (uint64_t)tgt[27] << 0; - - if (!m) - return 0.; - else - return (double)0xffff0000UL/m; -} - -void diff_to_target_equi(uint32_t *target, double diff) -{ - uint64_t m; - int k; - - for (k = 6; k > 0 && diff > 1.0; k--) - diff /= 4294967296.0; - m = (uint64_t)(4294901760.0 / diff); - if (m == 0 && k == 6) - memset(target, 0xff, 32); - else { - memset(target, 0, 32); - target[k + 1] = (uint32_t)(m >> 8); - target[k + 2] = (uint32_t)(m >> 40); - //memset(target, 0xff, 6*sizeof(uint32_t)); - for (k = 0; k < 28 && ((uint8_t*)target)[k] == 0; k++) - ((uint8_t*)target)[k] = 0xff; - } -} - -/* compute nbits to get the network diff */ -double equi_network_diff(struct work *work) -{ - //KMD bits: "1e 015971", - //KMD target: "00 00 015971000000000000000000000000000000000000000000000000000000", - //KMD bits: "1d 686aaf", - //KMD target: "00 0000 686aaf0000000000000000000000000000000000000000000000000000", - uint32_t nbits = work->data[26]; - uint32_t bits = (nbits & 0xffffff); - int16_t shift = (swab32(nbits) & 0xff); - shift = (31 - shift) * 8; // 8 bits shift for 0x1e, 16 for 0x1d - uint64_t tgt64 = swab32(bits); - tgt64 = tgt64 << shift; - // applog_hex(&tgt64, 8); - uint8_t net_target[32] = { 0 }; - for (int b=0; b<8; b++) - net_target[31-b] = ((uint8_t*)&tgt64)[b]; - // applog_hex(net_target, 32); - double d = target_to_diff_equi((uint32_t*)net_target); - return d; -} - -void equi_work_set_target(struct work* work, double diff) -{ - // target is given as data by the equihash stratum - // memcpy(work->target, stratum.job.claim, 32); // claim field is only used for lbry - diff_to_target_equi(work->target, diff); - //applog(LOG_BLUE, "diff %f to target :", diff); - //applog_hex(work->target, 32); - work->targetdiff = diff; -} - -bool equi_stratum_set_target(struct stratum_ctx *sctx, json_t *params) -{ - uint8_t target_bin[32], target_be[32]; - - const char *target_hex = json_string_value(json_array_get(params, 0)); - if (!target_hex || strlen(target_hex) == 0) - return false; - - hex2bin(target_bin, target_hex, 32); - memset(target_be, 0xff, 32); - int filled = 0; - for (int i=0; i<32; i++) { - if (filled == 3) break; - target_be[31-i] = target_bin[i]; - if (target_bin[i]) filled++; - } - memcpy(sctx->job.claim, target_be, 32); // hack, unused struct field - - pthread_mutex_lock(&stratum_work_lock); - sctx->next_diff = target_to_diff_equi((uint32_t*) &target_be); - pthread_mutex_unlock(&stratum_work_lock); - - //applog(LOG_BLUE, "low diff %f", sctx->next_diff); - //applog_hex(target_be, 32); - - return true; -} - -bool equi_stratum_notify(struct stratum_ctx *sctx, json_t *params) -{ - const char *job_id, *version, *prevhash, *coinb1, *coinb2, *nbits, *stime; - size_t coinb1_size, coinb2_size; - bool clean, ret = false; - int ntime, i, p=0; - job_id = json_string_value(json_array_get(params, p++)); - version = json_string_value(json_array_get(params, p++)); - prevhash = json_string_value(json_array_get(params, p++)); - coinb1 = json_string_value(json_array_get(params, p++)); //merkle - coinb2 = json_string_value(json_array_get(params, p++)); //blank (reserved) - stime = json_string_value(json_array_get(params, p++)); - nbits = json_string_value(json_array_get(params, p++)); - clean = json_is_true(json_array_get(params, p)); p++; - - if (!job_id || !prevhash || !coinb1 || !coinb2 || !version || !nbits || !stime || - strlen(prevhash) != 64 || strlen(version) != 8 || - strlen(coinb1) != 64 || strlen(coinb2) != 64 || - strlen(nbits) != 8 || strlen(stime) != 8) { - applog(LOG_ERR, "Stratum notify: invalid parameters"); - goto out; - } - - /* store stratum server time diff */ - hex2bin((uchar *)&ntime, stime, 4); - ntime = ntime - (int) time(0); - if (ntime > sctx->srvtime_diff) { - sctx->srvtime_diff = ntime; - if (opt_protocol && ntime > 20) - applog(LOG_DEBUG, "stratum time is at least %ds in the future", ntime); - } - - pthread_mutex_lock(&stratum_work_lock); - hex2bin(sctx->job.version, version, 4); - hex2bin(sctx->job.prevhash, prevhash, 32); - - coinb1_size = strlen(coinb1) / 2; - coinb2_size = strlen(coinb2) / 2; - sctx->job.coinbase_size = coinb1_size + coinb2_size + // merkle + reserved - sctx->xnonce1_size + sctx->xnonce2_size; // extranonce and... - - sctx->job.coinbase = (uchar*) realloc(sctx->job.coinbase, sctx->job.coinbase_size); - hex2bin(sctx->job.coinbase, coinb1, coinb1_size); - hex2bin(sctx->job.coinbase + coinb1_size, coinb2, coinb2_size); - - sctx->job.xnonce2 = sctx->job.coinbase + coinb1_size + coinb2_size + sctx->xnonce1_size; - if (!sctx->job.job_id || strcmp(sctx->job.job_id, job_id)) - memset(sctx->job.xnonce2, 0, sctx->xnonce2_size); - memcpy(sctx->job.coinbase + coinb1_size + coinb2_size, sctx->xnonce1, sctx->xnonce1_size); - - for (i = 0; i < sctx->job.merkle_count; i++) - free(sctx->job.merkle[i]); - free(sctx->job.merkle); - sctx->job.merkle = NULL; - sctx->job.merkle_count = 0; - - free(sctx->job.job_id); - sctx->job.job_id = strdup(job_id); - - hex2bin(sctx->job.nbits, nbits, 4); - hex2bin(sctx->job.ntime, stime, 4); - sctx->job.clean = clean; - - sctx->job.diff = sctx->next_diff; - pthread_mutex_unlock(&stratum_work_lock); - - ret = true; - -out: - return ret; -} - -// equihash stratum protocol is not standard, use client.show_message to pass block height -bool equi_stratum_show_message(struct stratum_ctx *sctx, json_t *id, json_t *params) -{ - char *s; - json_t *val; - bool ret; - - val = json_array_get(params, 0); - if (val) { - const char* data = json_string_value(val); - if (data && strlen(data)) { - char symbol[32] = { 0 }; - uint32_t height = 0; - int ss = sscanf(data, "equihash %s block %u", symbol, &height); - if (height && ss > 1) sctx->job.height = height; - if (opt_debug && ss > 1) applog(LOG_DEBUG, "%s", data); - } - } - - if (!id || json_is_null(id)) - return true; - - val = json_object(); - json_object_set(val, "id", id); - json_object_set_new(val, "error", json_null()); - json_object_set_new(val, "result", json_true()); - s = json_dumps(val, 0); - ret = stratum_send_line(sctx, s); - json_decref(val); - free(s); - - return ret; -} - -void equi_store_work_solution(struct work* work, uint32_t* hash, void* sol_data) -{ - int nonce = work->valid_nonces-1; - memcpy(work->extra, sol_data, 1347); - bn_store_hash_target_ratio(hash, work->target, work, nonce); - //work->sharediff[nonce] = target_to_diff_equi(hash); -} - -#define JSON_SUBMIT_BUF_LEN (4*1024) -// called by submit_upstream_work() -bool equi_stratum_submit(struct pool_infos *pool, struct work *work) -{ - char _ALIGN(64) s[JSON_SUBMIT_BUF_LEN]; - char _ALIGN(64) timehex[16] = { 0 }; - char *jobid, *noncestr, *solhex; - int idnonce = work->submit_nonce_id; - - // scanned nonce - work->data[EQNONCE_OFFSET] = work->nonces[idnonce]; - unsigned char * nonce = (unsigned char*) (&work->data[27]); - size_t nonce_len = 32 - stratum.xnonce1_size; - // long nonce without pool prefix (extranonce) - noncestr = bin2hex(&nonce[stratum.xnonce1_size], nonce_len); - - solhex = (char*) calloc(1, 1344*2 + 64); - if (!solhex || !noncestr) { - applog(LOG_ERR, "unable to alloc share memory"); - return false; - } - cbin2hex(solhex, (const char*) work->extra, 1347); - - jobid = work->job_id + 8; - sprintf(timehex, "%08x", swab32(work->data[25])); - - snprintf(s, sizeof(s), "{\"method\":\"mining.submit\",\"params\":" - "[\"%s\",\"%s\",\"%s\",\"%s\",\"%s\"], \"id\":%u}", - pool->user, jobid, timehex, noncestr, solhex, - stratum.job.shares_count + 10); - - free(solhex); - free(noncestr); - - gettimeofday(&stratum.tv_submit, NULL); - - if(!stratum_send_line(&stratum, s)) { - applog(LOG_ERR, "%s stratum_send_line failed", __func__); - return false; - } - - stratum.sharediff = work->sharediff[idnonce]; - stratum.job.shares_count++; - - return true; -} diff --git a/equi/equi.cpp b/equi/equi.cpp deleted file mode 100644 index 0a1d919b..00000000 --- a/equi/equi.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Port to Generic C of C++ implementation of the Equihash Proof-of-Work - * algorithm from zcashd. - * - * Copyright (c) 2016 abc at openwall dot com - * Copyright (c) 2016 Jack Grigg - * Copyright (c) 2016 The Zcash developers - * Copyright (c) 2017 tpruvot - * - * Distributed under the MIT software license, see the accompanying - * file COPYING or http://www.opensource.org/licenses/mit-license.php. - */ - -#include -#include -#include -#include - -#include "equihash.h" - -//#define USE_LIBSODIUM - -#ifdef USE_LIBSODIUM -#include "sodium.h" -#define blake2b_state crypto_generichash_blake2b_state -#else -#include "blake2/blake2.h" -#define be32toh(x) swab32(x) -#define htole32(x) (x) -#define HASHOUT 50 -#endif - -#include - -static void digestInit(blake2b_state *S, const uint32_t n, const uint32_t k) -{ - uint32_t le_N = htole32(n); - uint32_t le_K = htole32(k); -#ifdef USE_LIBSODIUM - uint8_t personalization[crypto_generichash_blake2b_PERSONALBYTES] = { 0 }; - - memcpy(personalization, "ZcashPoW", 8); - memcpy(personalization + 8, &le_N, 4); - memcpy(personalization + 12, &le_K, 4); - - crypto_generichash_blake2b_init_salt_personal(S, - NULL, 0, (512 / n) * n / 8, NULL, personalization); -#else - unsigned char personal[] = "ZcashPoW01230123"; - memcpy(personal + 8, &le_N, 4); - memcpy(personal + 12, &le_K, 4); - blake2b_param P[1]; - P->digest_length = HASHOUT; - P->key_length = 0; - P->fanout = 1; - P->depth = 1; - P->leaf_length = 0; - P->node_offset = 0; - P->node_depth = 0; - P->inner_length = 0; - memset(P->reserved, 0, sizeof(P->reserved)); - memset(P->salt, 0, sizeof(P->salt)); - memcpy(P->personal, (const uint8_t *)personal, 16); - eq_blake2b_init_param(S, P); -#endif -} - -static void expandArray(const unsigned char *in, const uint32_t in_len, - unsigned char *out, const uint32_t out_len, - const uint32_t bit_len, const uint32_t byte_pad) -{ - assert(bit_len >= 8); - assert(8 * sizeof(uint32_t) >= 7 + bit_len); - - const uint32_t out_width = (bit_len + 7) / 8 + byte_pad; - assert(out_len == 8 * out_width * in_len / bit_len); - - const uint32_t bit_len_mask = ((uint32_t)1 << bit_len) - 1; - - // The acc_bits least-significant bits of acc_value represent a bit sequence - // in big-endian order. - uint32_t acc_bits = 0; - uint32_t acc_value = 0; - uint32_t j = 0; - - for (uint32_t i = 0; i < in_len; i++) - { - acc_value = (acc_value << 8) | in[i]; - acc_bits += 8; - - // When we have bit_len or more bits in the accumulator, write the next - // output element. - if (acc_bits >= bit_len) { - acc_bits -= bit_len; - for (uint32_t x = 0; x < byte_pad; x++) { - out[j + x] = 0; - } - for (uint32_t x = byte_pad; x < out_width; x++) { - out[j + x] = ( - // Big-endian - acc_value >> (acc_bits + (8 * (out_width - x - 1))) - ) & ( - // Apply bit_len_mask across byte boundaries - (bit_len_mask >> (8 * (out_width - x - 1))) & 0xFF - ); - } - j += out_width; - } - } -} - -static void generateHash(blake2b_state *S, const uint32_t g, uint8_t *hash, const size_t hashLen) -{ - const uint32_t le_g = htole32(g); - blake2b_state digest = *S; /* copy */ -#ifdef USE_LIBSODIUM - crypto_generichash_blake2b_update(&digest, (uint8_t *)&le_g, sizeof(le_g)); - crypto_generichash_blake2b_final(&digest, hash, hashLen); -#else - eq_blake2b_update(&digest, (const uint8_t*) &le_g, sizeof(le_g)); - eq_blake2b_final(&digest, hash, (uint8_t) (hashLen & 0xFF)); -#endif -} - -static int isZero(const uint8_t *hash, size_t len) -{ - // This doesn't need to be constant time. - for (size_t i = 0; i < len; i++) { - if (hash[i] != 0) return 0; - } - return 1; -} - -// hdr -> header including nonce (140 bytes) -// soln -> equihash solution (excluding 3 bytes with size, so 1344 bytes length) -bool equi_verify(uint8_t* const hdr, uint8_t* const soln) -{ - const uint32_t n = WN; // 200 - const uint32_t k = WK; // 9 - const uint32_t collisionBitLength = n / (k + 1); - const uint32_t collisionByteLength = (collisionBitLength + 7) / 8; - const uint32_t hashLength = (k + 1) * collisionByteLength; - const uint32_t indicesPerHashOutput = 512 / n; - const uint32_t hashOutput = indicesPerHashOutput * n / 8; - const uint32_t equihashSolutionSize = (1 << k) * (n / (k + 1) + 1) / 8; - const uint32_t solnr = 1 << k; - - uint32_t indices[512] = { 0 }; - uint8_t vHash[hashLength] = { 0 }; - - blake2b_state state; - digestInit(&state, n, k); -#ifdef USE_LIBSODIUM - crypto_generichash_blake2b_update(&state, hdr, 140); -#else - eq_blake2b_update(&state, hdr, 140); -#endif - - expandArray(soln, equihashSolutionSize, (uint8_t*) &indices, sizeof(indices), collisionBitLength + 1, 1); - - for (uint32_t j = 0; j < solnr; j++) { - uint8_t tmpHash[hashOutput]; - uint8_t hash[hashLength]; - uint32_t i = be32toh(indices[j]); - generateHash(&state, i / indicesPerHashOutput, tmpHash, hashOutput); - expandArray(tmpHash + (i % indicesPerHashOutput * n / 8), n / 8, hash, hashLength, collisionBitLength, 0); - for (uint32_t k = 0; k < hashLength; k++) - vHash[k] ^= hash[k]; - } - return isZero(vHash, sizeof(vHash)); -} diff --git a/equi/equihash.cpp b/equi/equihash.cpp deleted file mode 100644 index c9ac1fcf..00000000 --- a/equi/equihash.cpp +++ /dev/null @@ -1,297 +0,0 @@ -/** - * Equihash solver interface for ccminer (compatible with linux and windows) - * Solver taken from nheqminer, by djeZo (and NiceHash) - * tpruvot - 2017 (GPL v3) - */ -#include -#include -#include - -#include -#include - -#include - -#include "eqcuda.hpp" -#include "equihash.h" // equi_verify() - -#include - -// All solutions (BLOCK_HEADER_LEN + SOLSIZE_LEN + SOL_LEN) sha256d should be under the target -extern "C" void equi_hash(const void* input, void* output, int len) -{ - uint8_t _ALIGN(64) hash0[32], hash1[32]; - - sph_sha256_context ctx_sha256; - - sph_sha256_init(&ctx_sha256); - sph_sha256(&ctx_sha256, input, len); - sph_sha256_close(&ctx_sha256, hash0); - sph_sha256(&ctx_sha256, hash0, 32); - sph_sha256_close(&ctx_sha256, hash1); - - memcpy(output, hash1, 32); -} - -// input here is 140 for the header and 1344 for the solution (equi.cpp) -extern "C" int equi_verify_sol(void * const hdr, void * const sol) -{ - bool res = equi_verify((uint8_t*) hdr, (uint8_t*) sol); - - //applog_hex((void*)hdr, 140); - //applog_hex((void*)sol, 1344); - - return res ? 1 : 0; -} - -#include - -//#define EQNONCE_OFFSET 30 /* 27:34 */ -#define NONCE_OFT EQNONCE_OFFSET - -static bool init[MAX_GPUS] = { 0 }; -static int valid_sols[MAX_GPUS] = { 0 }; -static uint8_t _ALIGN(64) data_sols[MAX_GPUS][MAXREALSOLS][1536] = { 0 }; // 140+3+1344 required -static eq_cuda_context_interface* solvers[MAX_GPUS] = { NULL }; - -static void CompressArray(const unsigned char* in, size_t in_len, - unsigned char* out, size_t out_len, size_t bit_len, size_t byte_pad) -{ - assert(bit_len >= 8); - assert(8 * sizeof(uint32_t) >= 7 + bit_len); - - size_t in_width = (bit_len + 7) / 8 + byte_pad; - assert(out_len == bit_len*in_len / (8 * in_width)); - - uint32_t bit_len_mask = (1UL << bit_len) - 1; - - // The acc_bits least-significant bits of acc_value represent a bit sequence - // in big-endian order. - size_t acc_bits = 0; - uint32_t acc_value = 0; - - size_t j = 0; - for (size_t i = 0; i < out_len; i++) { - // When we have fewer than 8 bits left in the accumulator, read the next - // input element. - if (acc_bits < 8) { - acc_value = acc_value << bit_len; - for (size_t x = byte_pad; x < in_width; x++) { - acc_value = acc_value | ( - ( - // Apply bit_len_mask across byte boundaries - in[j + x] & ((bit_len_mask >> (8 * (in_width - x - 1))) & 0xFF) - ) << (8 * (in_width - x - 1))); // Big-endian - } - j += in_width; - acc_bits += bit_len; - } - - acc_bits -= 8; - out[i] = (acc_value >> acc_bits) & 0xFF; - } -} - -#ifndef htobe32 -#define htobe32(x) swab32(x) -#endif - -static void EhIndexToArray(const u32 i, unsigned char* arr) -{ - u32 bei = htobe32(i); - memcpy(arr, &bei, sizeof(u32)); -} - -static std::vector GetMinimalFromIndices(std::vector indices, size_t cBitLen) -{ - assert(((cBitLen + 1) + 7) / 8 <= sizeof(u32)); - size_t lenIndices = indices.size()*sizeof(u32); - size_t minLen = (cBitLen + 1)*lenIndices / (8 * sizeof(u32)); - size_t bytePad = sizeof(u32) - ((cBitLen + 1) + 7) / 8; - std::vector array(lenIndices); - for (size_t i = 0; i < indices.size(); i++) { - EhIndexToArray(indices[i], array.data() + (i*sizeof(u32))); - } - std::vector ret(minLen); - CompressArray(array.data(), lenIndices, ret.data(), minLen, cBitLen + 1, bytePad); - return ret; -} - -// solver callbacks -static void cb_solution(int thr_id, const std::vector& solutions, size_t cbitlen, const unsigned char *compressed_sol) -{ - std::vector nSolution; - if (!compressed_sol) { - nSolution = GetMinimalFromIndices(solutions, cbitlen); - } else { - gpulog(LOG_INFO, thr_id, "compressed_sol"); - nSolution = std::vector(1344); - for (size_t i = 0; i < cbitlen; i++) - nSolution[i] = compressed_sol[i]; - } - int nsol = valid_sols[thr_id]; - if (nsol < 0) nsol = 0; - if(nSolution.size() == 1344) { - // todo, only store solution data here... - le32enc(&data_sols[thr_id][nsol][140], 0x000540fd); // sol sz header - memcpy(&data_sols[thr_id][nsol][143], nSolution.data(), 1344); - valid_sols[thr_id] = nsol + 1; - } -} -static void cb_hashdone(int thr_id) { - if (!valid_sols[thr_id]) valid_sols[thr_id] = -1; -} -static bool cb_cancel(int thr_id) { - if (work_restart[thr_id].restart) - valid_sols[thr_id] = -1; - return work_restart[thr_id].restart; -} - -extern "C" int scanhash_equihash(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t _ALIGN(64) endiandata[35]; - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[NONCE_OFT]; - uint32_t nonce_increment = rand() & 0xFF; // nonce randomizer - struct timeval tv_start, tv_end, diff; - double secs, solps; - uint32_t soluce_count = 0; - - if (opt_benchmark) - ptarget[7] = 0xfffff; - - if (!init[thr_id]) { - try { - int mode = 1; - switch (mode) { - case 1: - solvers[thr_id] = new eq_cuda_context(thr_id, device_map[thr_id]); - break; -#ifdef CONFIG_MODE_2 - case 2: - solvers[thr_id] = new eq_cuda_context(thr_id, device_map[thr_id]); - break; -#endif -#ifdef CONFIG_MODE_3 - case 3: - solvers[thr_id] = new eq_cuda_context(thr_id, device_map[thr_id]); - break; -#endif - default: - proper_exit(EXIT_CODE_SW_INIT_ERROR); - return -1; - } - size_t memSz = solvers[thr_id]->equi_mem_sz / (1024*1024); - gpus_intensity[thr_id] = (uint32_t) solvers[thr_id]->throughput; - api_set_throughput(thr_id, gpus_intensity[thr_id]); - gpulog(LOG_DEBUG, thr_id, "Allocated %u MB of context memory", (u32) memSz); - cuda_get_arch(thr_id); - init[thr_id] = true; - } catch (const std::exception & e) { - CUDA_LOG_ERROR(); - gpulog(LOG_ERR, thr_id, "init: %s", e.what()); - proper_exit(EXIT_CODE_CUDA_ERROR); - } - } - - gettimeofday(&tv_start, NULL); - memcpy(endiandata, pdata, 140); - work->valid_nonces = 0; - - do { - - try { - - valid_sols[thr_id] = 0; - solvers[thr_id]->solve( - (const char *) endiandata, (unsigned int) (140 - 32), - (const char *) &endiandata[27], (unsigned int) 32, - &cb_cancel, &cb_solution, &cb_hashdone - ); - - *hashes_done = soluce_count; - - } catch (const std::exception & e) { - gpulog(LOG_WARNING, thr_id, "solver: %s", e.what()); - free_equihash(thr_id); - sleep(1); - return -1; - } - - if (valid_sols[thr_id] > 0) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - uint8_t _ALIGN(64) full_data[140+3+1344] = { 0 }; - uint8_t* sol_data = &full_data[140]; - - soluce_count += valid_sols[thr_id]; - - for (int nsol=0; nsol < valid_sols[thr_id]; nsol++) - { - memcpy(full_data, endiandata, 140); - memcpy(sol_data, &data_sols[thr_id][nsol][140], 1347); - equi_hash(full_data, vhash, 140+3+1344); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) - { - bool valid = equi_verify_sol(endiandata, &sol_data[3]); - if (valid && work->valid_nonces < MAX_NONCES) { - work->valid_nonces++; - memcpy(work->data, endiandata, 140); - equi_store_work_solution(work, vhash, sol_data); - work->nonces[work->valid_nonces-1] = endiandata[NONCE_OFT]; - pdata[NONCE_OFT] = endiandata[NONCE_OFT] + 1; - //applog_hex(vhash, 32); - //applog_hex(&work->data[27], 32); - goto out; // second solution storage not handled.. - } - } - if (work->valid_nonces == MAX_NONCES) goto out; - } - if (work->valid_nonces) - goto out; - - valid_sols[thr_id] = 0; - } - - endiandata[NONCE_OFT] += nonce_increment; - - } while (!work_restart[thr_id].restart); - -out: - gettimeofday(&tv_end, NULL); - timeval_subtract(&diff, &tv_end, &tv_start); - secs = (1.0 * diff.tv_sec) + (0.000001 * diff.tv_usec); - solps = (double)soluce_count / secs; - gpulog(LOG_DEBUG, thr_id, "%d solutions in %.2f s (%.2f Sol/s)", soluce_count, secs, solps); - - // H/s - *hashes_done = soluce_count; - - pdata[NONCE_OFT] = endiandata[NONCE_OFT] + 1; - - return work->valid_nonces; -} - -// cleanup -void free_equihash(int thr_id) -{ - if (!init[thr_id]) - return; - - // assume config 1 was used... interface destructor seems bad - eq_cuda_context* ptr = dynamic_cast*>(solvers[thr_id]); - ptr->freemem(); - ptr = NULL; - - solvers[thr_id] = NULL; - - init[thr_id] = false; -} - -// mmm... viva c++ junk -void eq_cuda_context_interface::solve(const char *tequihash_header, unsigned int tequihash_header_len, - const char* nonce, unsigned int nonce_len, - fn_cancel cancelf, fn_solution solutionf, fn_hashdone hashdonef) { } diff --git a/equi/equihash.h b/equi/equihash.h deleted file mode 100644 index cdf47fa5..00000000 --- a/equi/equihash.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef EQUIHASH_H -#define EQUIHASH_H - -#include - -// miner nonce "cursor" unique for each thread -#define EQNONCE_OFFSET 30 /* 27:34 */ - -#define WK 9 -#define WN 200 -//#define CONFIG_MODE_1 9, 1248, 12, 640, packer_cantor /* eqcuda.hpp */ - -extern "C" { - void equi_hash(const void* input, void* output, int len); - int equi_verify_sol(void* const hdr, void* const soln); - bool equi_verify(uint8_t* const hdr, uint8_t* const soln); -} - -#endif diff --git a/fuguecoin.cpp b/fuguecoin.cpp deleted file mode 100644 index 1e36e672..00000000 --- a/fuguecoin.cpp +++ /dev/null @@ -1,114 +0,0 @@ -#include -#include -#include - -#include "sph/sph_fugue.h" - -#include "miner.h" - -#include "cuda_fugue256.h" - -#define SWAP32(x) \ - ((((x) << 24) & 0xff000000u) | (((x) << 8) & 0x00ff0000u) | \ - (((x) >> 8) & 0x0000ff00u) | (((x) >> 24) & 0x000000ffu)) - -void fugue256_hash(unsigned char* output, const unsigned char* input, int len) -{ - sph_fugue256_context ctx; - - sph_fugue256_init(&ctx); - sph_fugue256(&ctx, input, len); - sph_fugue256_close(&ctx, (void *)output); -} - -static bool init[MAX_GPUS] = { 0 }; - -int scanhash_fugue256(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t _ALIGN(64) endiandata[20]; - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - uint32_t start_nonce = pdata[19]++; - int intensity = (device_sm[device_map[thr_id]] > 500) ? 22 : 19; - uint32_t throughput = cuda_default_throughput(thr_id, 1U << intensity); - if (init[thr_id]) throughput = min(throughput, max_nonce - start_nonce); - - if (opt_benchmark) - ptarget[7] = 0xf; - - // init - if(!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - fugue256_cpu_init(thr_id, throughput); - init[thr_id] = true; - } - - // Endian - for (int kk=0; kk < 20; kk++) - be32enc(&endiandata[kk], pdata[kk]); - - fugue256_cpu_setBlock(thr_id, endiandata, (void*)ptarget); - - do { - // GPU - uint32_t foundNounce = UINT32_MAX; - fugue256_cpu_hash(thr_id, throughput, pdata[19], NULL, &foundNounce); - - *hashes_done = pdata[19] - start_nonce + throughput; - - if (foundNounce < UINT32_MAX && bench_algo < 0) - { - uint32_t vhash[8]; - sph_fugue256_context ctx_fugue; - endiandata[19] = SWAP32(foundNounce); - - sph_fugue256_init(&ctx_fugue); - sph_fugue256 (&ctx_fugue, endiandata, 80); - sph_fugue256_close(&ctx_fugue, &vhash); - - if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) - { - work_set_target_ratio(work, vhash); - pdata[19] = foundNounce; - return 1; - } else { - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", foundNounce); - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - start_nonce; - return 0; -} - -// cleanup -void free_fugue256(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - fugue256_cpu_free(thr_id); - - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/groestlcoin.cpp b/groestlcoin.cpp deleted file mode 100644 index 453bd4c1..00000000 --- a/groestlcoin.cpp +++ /dev/null @@ -1,113 +0,0 @@ -#include -#include -#include -#include - -#include "sph/sph_groestl.h" -#include "cuda_groestlcoin.h" - -#include "miner.h" - -// CPU hash -void groestlhash(void *state, const void *input) -{ - uint32_t _ALIGN(64) hash[16]; - sph_groestl512_context ctx_groestl; - - sph_groestl512_init(&ctx_groestl); - sph_groestl512(&ctx_groestl, input, 80); - sph_groestl512_close(&ctx_groestl, hash); - - sph_groestl512_init(&ctx_groestl); - sph_groestl512(&ctx_groestl, hash, 64); - sph_groestl512_close(&ctx_groestl, hash); - - memcpy(state, hash, 32); -} - -static bool init[MAX_GPUS] = { 0 }; - -int scanhash_groestlcoin(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t _ALIGN(64) endiandata[32]; - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - uint32_t start_nonce = pdata[19]; - uint32_t throughput = cuda_default_throughput(thr_id, 1 << 19); // 256*256*8 - if (init[thr_id]) throughput = min(throughput, max_nonce - start_nonce); - - if (opt_benchmark) - ptarget[7] = 0x001f; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - CUDA_LOG_ERROR(); - groestlcoin_cpu_init(thr_id, throughput); - init[thr_id] = true; - } - - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - groestlcoin_cpu_setBlock(thr_id, endiandata, (void*)ptarget); - - do { - memset(work->nonces, 0xff, sizeof(work->nonces)); - - *hashes_done = pdata[19] - start_nonce + throughput; - - // GPU hash - groestlcoin_cpu_hash(thr_id, throughput, pdata[19], &work->nonces[0]); - - if (work->nonces[0] < UINT32_MAX && bench_algo < 0) - { - uint32_t _ALIGN(64) vhash[8]; - endiandata[19] = swab32(work->nonces[0]); - groestlhash(vhash, endiandata); - - if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - pdata[19] = work->nonces[0] + 1; // cursor - return work->valid_nonces; - } else if (vhash[7] > ptarget[7]) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - start_nonce; - return 0; -} - -// cleanup -void free_groestlcoin(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - groestlcoin_cpu_free(thr_id); - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/heavy/bastion.cu b/heavy/bastion.cu deleted file mode 100644 index ec9ba8d7..00000000 --- a/heavy/bastion.cu +++ /dev/null @@ -1,331 +0,0 @@ -/** - * bastion cuda implemention tpruvot@github 2017 - */ - -#include -#include -//#include -#include -#include -#include - -static uint32_t *d_hash[MAX_GPUS]; -static uint32_t* d_hash_br1[MAX_GPUS]; -static uint32_t* d_hash_br2[MAX_GPUS]; - -extern void quark_skein512_cpu_init(int thr_id, uint32_t threads); -extern void quark_skein512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void x11_luffa512_cpu_init(int thr_id, uint32_t threads); -extern void x11_luffa512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void x13_hamsi512_cpu_init(int thr_id, uint32_t threads); -extern void x13_hamsi512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void x13_fugue512_cpu_init(int thr_id, uint32_t threads); -extern void x13_fugue512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -extern void x13_fugue512_cpu_free(int thr_id); - -extern void x14_shabal512_cpu_init(int thr_id, uint32_t threads); -extern void x14_shabal512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void x15_whirlpool_cpu_init(int thr_id, uint32_t threads, int mode); -extern void x15_whirlpool_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -extern void x15_whirlpool_cpu_free(int thr_id); - -extern void x11_echo512_cpu_init(int thr_id, uint32_t threads); -extern void x11_echo512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void bastion_init(const int thr_id, const uint32_t threads); -extern void bastion_free(const int thr_id); - -extern uint32_t bastion_filter2(const int thr_id, const uint32_t threads, const uint32_t *inpHashes, uint32_t* d_hash1, uint32_t* d_hash2); -extern void bastion_merge2(const int thr_id, const uint32_t threads, uint32_t *outpHashes, uint32_t* d_hash1, uint32_t* d_hash2); - -extern void hefty_cpu_hash(int thr_id, uint32_t threads, int startNounce); -extern void hefty_cpu_setBlock(int thr_id, uint32_t threads, void *data, int len); -extern void hefty_cpu_init(int thr_id, uint32_t threads); -extern void hefty_cpu_free(int thr_id); -extern void hefty_copy_hashes(int thr_id, uint32_t threads, uint32_t* d_outputhash); - -#define TRACE(algo) {} - -static bool init[MAX_GPUS] = { 0 }; - -int scanhash_bastion(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - // CUDA will process thousands of threads. - uint32_t throughput = cuda_default_throughput(thr_id, 1U << 20); - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ptarget[7] = 0x00ff; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - - CUDA_SAFE_CALL(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput)); - CUDA_SAFE_CALL(cudaMalloc(&d_hash_br1[thr_id], (size_t) 64 * throughput)); - CUDA_SAFE_CALL(cudaMalloc(&d_hash_br2[thr_id], (size_t) 64 * throughput)); - - bastion_init(thr_id, throughput); - hefty_cpu_init(thr_id, throughput); - x11_luffa512_cpu_init(thr_id, throughput); - - quark_skein512_cpu_init(thr_id, throughput); - x13_hamsi512_cpu_init(thr_id, throughput); - x13_fugue512_cpu_init(thr_id, throughput); - x14_shabal512_cpu_init(thr_id, throughput); - x15_whirlpool_cpu_init(thr_id, throughput, 0); - x11_echo512_cpu_init(thr_id, throughput); - - cuda_check_cpu_init(thr_id, throughput); - - init[thr_id] = true; - } - - uint32_t endiandata[20]; - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - hefty_cpu_setBlock(thr_id, throughput, endiandata, 80); - - cuda_check_cpu_setTarget(ptarget); - - do { - uint32_t branchNonces; - int order = 0; - - // hefty - hefty_cpu_hash(thr_id, throughput, pdata[19]); - hefty_copy_hashes(thr_id, throughput, d_hash[thr_id]); - TRACE("hefty :"); - - x11_luffa512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("luffa :"); - - // fugue or skein - branchNonces = bastion_filter2(thr_id, throughput, d_hash[thr_id], d_hash_br1[thr_id], d_hash_br2[thr_id]); - x13_fugue512_cpu_hash_64(thr_id, branchNonces, pdata[19], NULL, d_hash_br1[thr_id], order++); - quark_skein512_cpu_hash_64(thr_id, throughput-branchNonces, pdata[19], NULL, d_hash_br2[thr_id], order++); - bastion_merge2(thr_id, throughput, d_hash[thr_id], d_hash_br1[thr_id], d_hash_br2[thr_id]); - TRACE("perm1 :"); - - x15_whirlpool_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("whirl :"); - x13_fugue512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - - // echo or luffa - branchNonces = bastion_filter2(thr_id, throughput, d_hash[thr_id], d_hash_br1[thr_id], d_hash_br2[thr_id]); - x11_echo512_cpu_hash_64(thr_id, branchNonces, pdata[19], NULL, d_hash_br1[thr_id], order++); - x11_luffa512_cpu_hash_64(thr_id, throughput-branchNonces, pdata[19], NULL, d_hash_br2[thr_id], order++); - bastion_merge2(thr_id, throughput, d_hash[thr_id], d_hash_br1[thr_id], d_hash_br2[thr_id]); - TRACE("perm2 :"); - - x14_shabal512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - - // shabal or whirlpool - branchNonces = bastion_filter2(thr_id, throughput, d_hash[thr_id], d_hash_br1[thr_id], d_hash_br2[thr_id]); - x14_shabal512_cpu_hash_64(thr_id, branchNonces, pdata[19], NULL, d_hash_br1[thr_id], order++); - x15_whirlpool_cpu_hash_64(thr_id, throughput-branchNonces, pdata[19], NULL, d_hash_br2[thr_id], order++); - bastion_merge2(thr_id, throughput, d_hash[thr_id], d_hash_br1[thr_id], d_hash_br2[thr_id]); - TRACE("perm3 :"); - - x14_shabal512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - - // hamsi or luffa - branchNonces = bastion_filter2(thr_id, throughput, d_hash[thr_id], d_hash_br1[thr_id], d_hash_br2[thr_id]); - x13_hamsi512_cpu_hash_64(thr_id, branchNonces, pdata[19], NULL, d_hash_br1[thr_id], order++); - x11_luffa512_cpu_hash_64(thr_id, throughput-branchNonces, pdata[19], NULL, d_hash_br2[thr_id], order++); - bastion_merge2(thr_id, throughput, d_hash[thr_id], d_hash_br1[thr_id], d_hash_br2[thr_id]); - TRACE("perm4 :"); - - *hashes_done = pdata[19] - first_nonce + throughput; - - CUDA_LOG_ERROR(); - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - if (work->nonces[0] != UINT32_MAX) - { - uint32_t _ALIGN(64) vhash[8]; - const uint32_t Htarg = ptarget[7]; - endiandata[19] = work->nonces[0]; - bastionhash(vhash, (uchar*) endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - work->nonces[0] = swab32(work->nonces[0]); - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - if (work->nonces[1] != 0) { - endiandata[19] = work->nonces[1]; - bastionhash(vhash, (uchar*) endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - work->nonces[1] = swab32(work->nonces[1]); - pdata[19] = max(work->nonces[0], work->nonces[1])+1; - } else { - pdata[19] = work->nonces[0]+1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) gpulog(LOG_WARNING, thr_id, - "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = swab32(work->nonces[0]) + 1; - continue; - } - } - - if ((uint64_t)throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - - CUDA_LOG_ERROR(); - - return 0; -} - -// cleanup -extern "C" void free_bastion(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - cudaFree(d_hash_br1[thr_id]); - cudaFree(d_hash_br2[thr_id]); - - hefty_cpu_free(thr_id); - x13_fugue512_cpu_free(thr_id); - x15_whirlpool_cpu_free(thr_id); - - bastion_free(thr_id); - cuda_check_cpu_free(thr_id); - init[thr_id] = false; - - cudaDeviceSynchronize(); -} - -#undef SPH_C32 -#undef SPH_T32 -#undef SPH_C64 -#undef SPH_T64 -extern "C" { -#include "hefty1.h" -#include "sph/sph_luffa.h" -#include "sph/sph_fugue.h" -#include "sph/sph_skein.h" -#include "sph/sph_whirlpool.h" -#include "sph/sph_shabal.h" -#include "sph/sph_echo.h" -#include "sph/sph_hamsi.h" -} - -__host__ -void bastionhash(void* output, const uchar* input) -{ - unsigned char _ALIGN(128) hash[64] = { 0 }; - - sph_echo512_context ctx_echo; - sph_luffa512_context ctx_luffa; - sph_fugue512_context ctx_fugue; - sph_whirlpool_context ctx_whirlpool; - sph_shabal512_context ctx_shabal; - sph_skein512_context ctx_skein; - sph_hamsi512_context ctx_hamsi; - - HEFTY1(input, 80, hash); - - sph_luffa512_init(&ctx_luffa); - sph_luffa512(&ctx_luffa, hash, 64); - sph_luffa512_close(&ctx_luffa, hash); - - if (hash[0] & 0x8) - { - sph_fugue512_init(&ctx_fugue); - sph_fugue512(&ctx_fugue, hash, 64); - sph_fugue512_close(&ctx_fugue, hash); - } else { - sph_skein512_init(&ctx_skein); - sph_skein512(&ctx_skein, hash, 64); - sph_skein512_close(&ctx_skein, hash); - } - - sph_whirlpool_init(&ctx_whirlpool); - sph_whirlpool(&ctx_whirlpool, hash, 64); - sph_whirlpool_close(&ctx_whirlpool, hash); - - sph_fugue512_init(&ctx_fugue); - sph_fugue512(&ctx_fugue, hash, 64); - sph_fugue512_close(&ctx_fugue, hash); - - if (hash[0] & 0x8) - { - sph_echo512_init(&ctx_echo); - sph_echo512(&ctx_echo, hash, 64); - sph_echo512_close(&ctx_echo, hash); - } else { - sph_luffa512_init(&ctx_luffa); - sph_luffa512(&ctx_luffa, hash, 64); - sph_luffa512_close(&ctx_luffa, hash); - } - - sph_shabal512_init(&ctx_shabal); - sph_shabal512(&ctx_shabal, hash, 64); - sph_shabal512_close(&ctx_shabal, hash); - - sph_skein512_init(&ctx_skein); - sph_skein512(&ctx_skein, hash, 64); - sph_skein512_close(&ctx_skein, hash); - - if (hash[0] & 0x8) - { - sph_shabal512_init(&ctx_shabal); - sph_shabal512(&ctx_shabal, hash, 64); - sph_shabal512_close(&ctx_shabal, hash); - } else { - sph_whirlpool_init(&ctx_whirlpool); - sph_whirlpool(&ctx_whirlpool, hash, 64); - sph_whirlpool_close(&ctx_whirlpool, hash); - } - - sph_shabal512_init(&ctx_shabal); - sph_shabal512(&ctx_shabal, hash, 64); - sph_shabal512_close(&ctx_shabal, hash); - - if (hash[0] & 0x8) - { - sph_hamsi512_init(&ctx_hamsi); - sph_hamsi512(&ctx_hamsi, hash, 64); - sph_hamsi512_close(&ctx_hamsi, hash); - } else { - sph_luffa512_init(&ctx_luffa); - sph_luffa512(&ctx_luffa, hash, 64); - sph_luffa512_close(&ctx_luffa, hash); - } - - memcpy(output, hash, 32); -} diff --git a/heavy/cuda_bastion.cu b/heavy/cuda_bastion.cu deleted file mode 100644 index 44e301a7..00000000 --- a/heavy/cuda_bastion.cu +++ /dev/null @@ -1,103 +0,0 @@ -#include - -#include "cuda_helper.h" - -static uint32_t *d_offsets1[MAX_GPUS] = { 0 }; -static uint32_t *d_offsets2[MAX_GPUS] = { 0 }; - -static uint32_t *d_brcount1[MAX_GPUS] = { 0 }; -static uint32_t *d_brcount2[MAX_GPUS] = { 0 }; - -__global__ __launch_bounds__(128, 6) -void bastion_filter2_gpu(const uint32_t threads, const uint32_t* d_hash, uint32_t* d_hash1, uint32_t* d_hash2, uint32_t* d_br_ofts1, uint32_t* d_count1, uint32_t* d_br_ofts2, uint32_t* d_count2) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const uint32_t offset = thread * 16U; // 64U / sizeof(uint32_t); - uint4 *psrc = (uint4*) (&d_hash[offset]); - uint4 *pdst; - d_br_ofts1[thread] = 0; - d_br_ofts2[thread] = 0; - if (((uint8_t*)psrc)[0] & 0x8) { - // uint4 = 4x uint32_t = 16 bytes - uint32_t oft = atomicAdd(d_count1, 1U) * 16U; - d_br_ofts1[thread] = oft + 16U; - pdst = (uint4*) (&d_hash1[oft]); - } else { - uint32_t oft = atomicAdd(d_count2, 1U) * 16U; - d_br_ofts2[thread] = oft + 16U; - pdst = (uint4*) (&d_hash2[oft]); - } - pdst[0] = psrc[0]; - pdst[1] = psrc[1]; - pdst[2] = psrc[2]; - pdst[3] = psrc[3]; - } -} - -__global__ __launch_bounds__(128, 6) -void bastion_merge2_gpu(const uint32_t threads, uint32_t* d_hash, uint32_t* d_hash1, uint32_t* d_hash2, uint32_t* d_br_ofts1, uint32_t* d_br_ofts2) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const uint32_t offset = thread * 16U; - uint4 *pdst = (uint4*) (&d_hash[offset]); - uint4 *psrc; - if (d_br_ofts1[thread]) { - const uint32_t oft = d_br_ofts1[thread] - 16U; - psrc = (uint4*) (&d_hash1[oft]); - } else { - const uint32_t oft = d_br_ofts2[thread] - 16U; - psrc = (uint4*) (&d_hash2[oft]); - } - pdst[0] = psrc[0]; - pdst[1] = psrc[1]; - pdst[2] = psrc[2]; - pdst[3] = psrc[3]; - } -} - - -__host__ -void bastion_init(const int thr_id, const uint32_t threads) -{ - CUDA_SAFE_CALL(cudaMalloc(&d_offsets1[thr_id], sizeof(uint32_t) * threads)); - CUDA_SAFE_CALL(cudaMalloc(&d_offsets2[thr_id], sizeof(uint32_t) * threads)); - CUDA_SAFE_CALL(cudaMalloc(&d_brcount1[thr_id], sizeof(uint32_t))); - CUDA_SAFE_CALL(cudaMalloc(&d_brcount2[thr_id], sizeof(uint32_t))); -} - -__host__ -void bastion_free(const int thr_id) -{ - cudaFree(d_offsets1[thr_id]); - cudaFree(d_offsets2[thr_id]); - cudaFree(d_brcount1[thr_id]); - cudaFree(d_brcount2[thr_id]); -} - -__host__ -uint32_t bastion_filter2(const int thr_id, const uint32_t threads, const uint32_t *inpHashes, uint32_t* d_hash1, uint32_t* d_hash2) -{ - uint32_t num = 0; - cudaMemset(d_brcount1[thr_id], 0, 4); - cudaMemset(d_brcount2[thr_id], 0, 4); - const uint32_t threadsperblock = 128; - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - bastion_filter2_gpu <<>> (threads, inpHashes, d_hash1, d_hash2, d_offsets1[thr_id], d_brcount1[thr_id], d_offsets2[thr_id], d_brcount2[thr_id]); - cudaMemcpy(&num, d_brcount1[thr_id], 4, cudaMemcpyDeviceToHost); - return num; -} - -__host__ -void bastion_merge2(const int thr_id, const uint32_t threads, uint32_t *outpHashes, uint32_t* d_hash1, uint32_t* d_hash2) -{ - const uint32_t threadsperblock = 128; - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - // put back branch hashes to the common buffer d_hash - bastion_merge2_gpu <<>> (threads, outpHashes, d_hash1, d_hash2, d_offsets1[thr_id], d_offsets2[thr_id]); -} diff --git a/heavy/cuda_blake512.cu b/heavy/cuda_blake512.cu deleted file mode 100644 index f3d22fa1..00000000 --- a/heavy/cuda_blake512.cu +++ /dev/null @@ -1,264 +0,0 @@ -#include -#include - -#include "cuda_helper.h" - -// globaler Speicher für alle HeftyHashes aller Threads -extern uint32_t *heavy_heftyHashes[MAX_GPUS]; -extern uint32_t *heavy_nonceVector[MAX_GPUS]; - -// globaler Speicher für unsere Ergebnisse -uint32_t *d_hash5output[MAX_GPUS]; - -// die Message (112 bzw. 116 Bytes) mit Padding zur Berechnung auf der GPU -__constant__ uint64_t c_PaddedMessage[16]; // padded message (80/84+32 bytes + padding) - - -// ---------------------------- BEGIN CUDA blake512 functions ------------------------------------ - -__constant__ uint8_t c_sigma[16][16]; - -const uint8_t host_sigma[16][16] = -{ - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - {14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - {11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, - { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 }, - {12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 }, - {13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 }, - { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 }, - {10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 }, - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - {14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - {11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, - { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } -}; - -/* in cuda_helper */ -#define SWAP32(x) cuda_swab32(x) -#define SWAP64(x) cuda_swab64(x) - -__constant__ uint64_t c_SecondRound[15]; - -const uint64_t host_SecondRound[15] = -{ - 0,0,0,0,0,0,0,0,0,0,0,0,0,SWAP64(1),0 -}; - -__constant__ uint64_t c_u512[16]; - -const uint64_t host_u512[16] = -{ - 0x243f6a8885a308d3ULL, 0x13198a2e03707344ULL, - 0xa4093822299f31d0ULL, 0x082efa98ec4e6c89ULL, - 0x452821e638d01377ULL, 0xbe5466cf34e90c6cULL, - 0xc0ac29b7c97c50ddULL, 0x3f84d5b5b5470917ULL, - 0x9216d5d98979fb1bULL, 0xd1310ba698dfb5acULL, - 0x2ffd72dbd01adfb7ULL, 0xb8e1afed6a267e96ULL, - 0xba7c9045f12c7f99ULL, 0x24a19947b3916cf7ULL, - 0x0801f2e2858efc16ULL, 0x636920d871574e69ULL -}; - - -#define G(a,b,c,d,e) \ - v[a] += (m[sigma[i][e]] ^ u512[sigma[i][e+1]]) + v[b];\ - v[d] = SWAPDWORDS( v[d] ^ v[a]); \ - v[c] += v[d]; \ - v[b] = ROTR64( v[b] ^ v[c],25); \ - v[a] += (m[sigma[i][e+1]] ^ u512[sigma[i][e]])+v[b]; \ - v[d] = ROTR64( v[d] ^ v[a],16); \ - v[c] += v[d]; \ - v[b] = ROTR64( v[b] ^ v[c],11); - -template __device__ void blake512_compress( uint64_t *h, const uint64_t *block, int nullt, const uint8_t ((*sigma)[16]), const uint64_t *u512 ) -{ - uint64_t v[16], m[16], i; - -#pragma unroll 16 - for( i = 0; i < 16; ++i ) m[i] = cuda_swab64(block[i]); - -#pragma unroll 8 - for( i = 0; i < 8; ++i ) v[i] = h[i]; - - v[ 8] = u512[0]; - v[ 9] = u512[1]; - v[10] = u512[2]; - v[11] = u512[3]; - v[12] = u512[4]; - v[13] = u512[5]; - v[14] = u512[6]; - v[15] = u512[7]; - - /* don't xor t when the block is only padding */ - if ( !nullt ) { - v[12] ^= 8*(BLOCKSIZE+32); - v[13] ^= 8*(BLOCKSIZE+32); - } - -//#pragma unroll 16 - for( i = 0; i < 16; ++i ) - { - /* column step */ - G( 0, 4, 8, 12, 0 ); - G( 1, 5, 9, 13, 2 ); - G( 2, 6, 10, 14, 4 ); - G( 3, 7, 11, 15, 6 ); - /* diagonal step */ - G( 0, 5, 10, 15, 8 ); - G( 1, 6, 11, 12, 10 ); - G( 2, 7, 8, 13, 12 ); - G( 3, 4, 9, 14, 14 ); - } - -#pragma unroll 16 - for( i = 0; i < 16; ++i ) h[i % 8] ^= v[i]; -} - -template __global__ void blake512_gpu_hash(uint32_t threads, uint32_t startNounce, void *outputHash, uint32_t *heftyHashes, uint32_t *nonceVector) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - // bestimme den aktuellen Zähler - //uint32_t nounce = startNounce + thread; - uint32_t nounce = nonceVector[thread]; - - // Index-Position des Hashes in den Hash Puffern bestimmen (Hefty1 und outputHash) - uint32_t hashPosition = nounce - startNounce; - - // State vorbereiten - uint64_t h[8]; - h[0] = 0x6a09e667f3bcc908ULL; - h[1] = 0xbb67ae8584caa73bULL; - h[2] = 0x3c6ef372fe94f82bULL; - h[3] = 0xa54ff53a5f1d36f1ULL; - h[4] = 0x510e527fade682d1ULL; - h[5] = 0x9b05688c2b3e6c1fULL; - h[6] = 0x1f83d9abfb41bd6bULL; - h[7] = 0x5be0cd19137e2179ULL; - - // 128 Byte für die Message - uint64_t buf[16]; - - // Message für die erste Runde in Register holen -#pragma unroll 16 - for (int i=0; i < 16; ++i) buf[i] = c_PaddedMessage[i]; - - // die Nounce durch die thread-spezifische ersetzen - buf[9] = REPLACE_HIDWORD(buf[9], nounce); - - uint32_t *hefty = heftyHashes + 8 * hashPosition; - if (BLOCKSIZE == 84) { - // den thread-spezifischen Hefty1 hash einsetzen - // aufwändig, weil das nicht mit uint64_t Wörtern aligned ist. - buf[10] = REPLACE_HIDWORD(buf[10], hefty[0]); - buf[11] = REPLACE_LODWORD(buf[11], hefty[1]); - buf[11] = REPLACE_HIDWORD(buf[11], hefty[2]); - buf[12] = REPLACE_LODWORD(buf[12], hefty[3]); - buf[12] = REPLACE_HIDWORD(buf[12], hefty[4]); - buf[13] = REPLACE_LODWORD(buf[13], hefty[5]); - buf[13] = REPLACE_HIDWORD(buf[13], hefty[6]); - buf[14] = REPLACE_LODWORD(buf[14], hefty[7]); - } - else if (BLOCKSIZE == 80) { - buf[10] = MAKE_ULONGLONG(hefty[0], hefty[1]); - buf[11] = MAKE_ULONGLONG(hefty[2], hefty[3]); - buf[12] = MAKE_ULONGLONG(hefty[4], hefty[5]); - buf[13] = MAKE_ULONGLONG(hefty[6], hefty[7]); - } - - // erste Runde - blake512_compress( h, buf, 0, c_sigma, c_u512 ); - - - // zweite Runde -#pragma unroll 15 - for (int i=0; i < 15; ++i) buf[i] = c_SecondRound[i]; - buf[15] = SWAP64(8*(BLOCKSIZE+32)); // Blocksize in Bits einsetzen - blake512_compress( h, buf, 1, c_sigma, c_u512 ); - - // Hash rauslassen - uint64_t *outHash = (uint64_t *)outputHash + 8 * hashPosition; -#pragma unroll 8 - for (int i=0; i < 8; ++i) outHash[i] = cuda_swab64( h[i] ); - } -} - - -// ---------------------------- END CUDA blake512 functions ------------------------------------ - -// Setup Function -__host__ -void blake512_cpu_init(int thr_id, uint32_t threads) -{ - // Kopiere die Hash-Tabellen in den GPU-Speicher - cudaMemcpyToSymbol( c_sigma, - host_sigma, - sizeof(host_sigma), - 0, cudaMemcpyHostToDevice); - - cudaMemcpyToSymbol( c_u512, - host_u512, - sizeof(host_u512), - 0, cudaMemcpyHostToDevice); - - cudaMemcpyToSymbol( c_SecondRound, - host_SecondRound, - sizeof(host_SecondRound), - 0, cudaMemcpyHostToDevice); - - // Speicher für alle Ergebnisse belegen - CUDA_SAFE_CALL(cudaMalloc(&d_hash5output[thr_id], (size_t) 64 * threads)); -} - -__host__ -void blake512_cpu_free(int thr_id) -{ - cudaFree(d_hash5output[thr_id]); -} - -static int BLOCKSIZE = 84; - -__host__ -void blake512_cpu_setBlock(void *pdata, int len) - // data muss 84-Byte haben! - // heftyHash hat 32-Byte -{ - unsigned char PaddedMessage[128]; - if (len == 84) { - // Message mit Padding für erste Runde bereitstellen - memcpy(PaddedMessage, pdata, 84); - memset(PaddedMessage+84, 0, 32); // leeres Hefty Hash einfüllen - memset(PaddedMessage+116, 0, 12); - PaddedMessage[116] = 0x80; - } else if (len == 80) { - memcpy(PaddedMessage, pdata, 80); - memset(PaddedMessage+80, 0, 32); // leeres Hefty Hash einfüllen - memset(PaddedMessage+112, 0, 16); - PaddedMessage[112] = 0x80; - } - // die Message (116 Bytes) ohne Padding zur Berechnung auf der GPU - cudaMemcpyToSymbol( c_PaddedMessage, PaddedMessage, 16*sizeof(uint64_t), 0, cudaMemcpyHostToDevice); - BLOCKSIZE = len; -} - -__host__ void blake512_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce) -{ - const uint32_t threadsperblock = 256; - - // berechne wie viele Thread Blocks wir brauchen - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - // Größe des dynamischen Shared Memory Bereichs - size_t shared_size = 0; - - if (BLOCKSIZE == 80) - blake512_gpu_hash<80><<>>(threads, startNounce, d_hash5output[thr_id], heavy_heftyHashes[thr_id], heavy_nonceVector[thr_id]); - else if (BLOCKSIZE == 84) - blake512_gpu_hash<84><<>>(threads, startNounce, d_hash5output[thr_id], heavy_heftyHashes[thr_id], heavy_nonceVector[thr_id]); -} diff --git a/heavy/cuda_combine.cu b/heavy/cuda_combine.cu deleted file mode 100644 index 64a95617..00000000 --- a/heavy/cuda_combine.cu +++ /dev/null @@ -1,151 +0,0 @@ -#include - -#include "cuda_helper.h" - -// globaler Speicher für unsere Ergebnisse -static uint32_t *d_hashoutput[MAX_GPUS]; -extern uint32_t *d_hash2output[MAX_GPUS]; -extern uint32_t *d_hash3output[MAX_GPUS]; -extern uint32_t *d_hash4output[MAX_GPUS]; -extern uint32_t *d_hash5output[MAX_GPUS]; - -extern uint32_t *heavy_nonceVector[MAX_GPUS]; - -/* Combines top 64-bits from each hash into a single hash */ -__device__ -static void combine_hashes(uint32_t *out, uint32_t *hash1, uint32_t *hash2, uint32_t *hash3, uint32_t *hash4) -{ - uint32_t lout[8]; // Combining in Registern machen - -#pragma unroll 8 - for (int i=0; i < 8; ++i) - lout[i] = 0; - - // das Makro setzt jeweils 4 Bits aus vier verschiedenen Hashes zu einem Nibble zusammen -#define MIX(bits, mask, i) \ - lout[(255 - (bits+3))/32] <<= 4; \ - if ((hash1[i] & mask) != 0) lout[(255 - (bits+0))/32] |= 8; \ - if ((hash2[i] & mask) != 0) lout[(255 - (bits+1))/32] |= 4; \ - if ((hash3[i] & mask) != 0) lout[(255 - (bits+2))/32] |= 2; \ - if ((hash4[i] & mask) != 0) lout[(255 - (bits+3))/32] |= 1; \ - - /* Transpose first 64 bits of each hash into out */ - MIX( 0, 0x80000000, 7); - MIX( 4, 0x40000000, 7); - MIX( 8, 0x20000000, 7); - MIX( 12, 0x10000000, 7); - MIX( 16, 0x08000000, 7); - MIX( 20, 0x04000000, 7); - MIX( 24, 0x02000000, 7); - MIX( 28, 0x01000000, 7); - MIX( 32, 0x00800000, 7); - MIX( 36, 0x00400000, 7); - MIX( 40, 0x00200000, 7); - MIX( 44, 0x00100000, 7); - MIX( 48, 0x00080000, 7); - MIX( 52, 0x00040000, 7); - MIX( 56, 0x00020000, 7); - MIX( 60, 0x00010000, 7); - MIX( 64, 0x00008000, 7); - MIX( 68, 0x00004000, 7); - MIX( 72, 0x00002000, 7); - MIX( 76, 0x00001000, 7); - MIX( 80, 0x00000800, 7); - MIX( 84, 0x00000400, 7); - MIX( 88, 0x00000200, 7); - MIX( 92, 0x00000100, 7); - MIX( 96, 0x00000080, 7); - MIX(100, 0x00000040, 7); - MIX(104, 0x00000020, 7); - MIX(108, 0x00000010, 7); - MIX(112, 0x00000008, 7); - MIX(116, 0x00000004, 7); - MIX(120, 0x00000002, 7); - MIX(124, 0x00000001, 7); - - MIX(128, 0x80000000, 6); - MIX(132, 0x40000000, 6); - MIX(136, 0x20000000, 6); - MIX(140, 0x10000000, 6); - MIX(144, 0x08000000, 6); - MIX(148, 0x04000000, 6); - MIX(152, 0x02000000, 6); - MIX(156, 0x01000000, 6); - MIX(160, 0x00800000, 6); - MIX(164, 0x00400000, 6); - MIX(168, 0x00200000, 6); - MIX(172, 0x00100000, 6); - MIX(176, 0x00080000, 6); - MIX(180, 0x00040000, 6); - MIX(184, 0x00020000, 6); - MIX(188, 0x00010000, 6); - MIX(192, 0x00008000, 6); - MIX(196, 0x00004000, 6); - MIX(200, 0x00002000, 6); - MIX(204, 0x00001000, 6); - MIX(208, 0x00000800, 6); - MIX(212, 0x00000400, 6); - MIX(216, 0x00000200, 6); - MIX(220, 0x00000100, 6); - MIX(224, 0x00000080, 6); - MIX(228, 0x00000040, 6); - MIX(232, 0x00000020, 6); - MIX(236, 0x00000010, 6); - MIX(240, 0x00000008, 6); - MIX(244, 0x00000004, 6); - MIX(248, 0x00000002, 6); - MIX(252, 0x00000001, 6); - -#pragma unroll 8 - for (int i=0; i < 8; ++i) - out[i] = lout[i]; -} - -__global__ -void combine_gpu_hash(uint32_t threads, uint32_t startNounce, uint32_t *out, uint32_t *hash2, uint32_t *hash3, uint32_t *hash4, uint32_t *hash5, uint32_t *nonceVector) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t nounce = nonceVector[thread]; - uint32_t hashPosition = nounce - startNounce; - // Die Aufgabe der combine-funktion besteht aus zwei Teilen. - // 1) Komprimiere die hashes zu einem kleinen Array - // 2) Errechne dort den combines-value - - // Die Kompression wird dadurch verwirklicht, dass im out-array weiterhin mit "thread" indiziert - // wird. Die anderen Werte werden mit der nonce indiziert - - combine_hashes(&out[8 * thread], &hash2[8 * hashPosition], &hash3[16 * hashPosition], &hash4[16 * hashPosition], &hash5[16 * hashPosition]); - } -} - -__host__ -void combine_cpu_init(int thr_id, uint32_t threads) -{ - // Speicher für alle Ergebnisse belegen - CUDA_SAFE_CALL(cudaMalloc(&d_hashoutput[thr_id], (size_t) 32 * threads)); -} - -__host__ -void combine_cpu_free(int thr_id) -{ - cudaFree(d_hashoutput[thr_id]); -} - -__host__ -void combine_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *hash) -{ - // diese Kopien sind optional, da die Hashes jetzt bereits auf der GPU liegen sollten - - const uint32_t threadsperblock = 128; - - // berechne wie viele Thread Blocks wir brauchen - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - combine_gpu_hash <<>> (threads, startNounce, d_hashoutput[thr_id], d_hash2output[thr_id], d_hash3output[thr_id], d_hash4output[thr_id], d_hash5output[thr_id], heavy_nonceVector[thr_id]); - - // da die Hash Auswertung noch auf der CPU erfolgt, müssen die Ergebnisse auf jeden Fall zum Host kopiert werden - CUDA_SAFE_CALL(cudaMemcpy(hash, d_hashoutput[thr_id], 8 * sizeof(uint32_t) * threads, cudaMemcpyDeviceToHost)); -} diff --git a/heavy/cuda_groestl512.cu b/heavy/cuda_groestl512.cu deleted file mode 100644 index ef4c2c14..00000000 --- a/heavy/cuda_groestl512.cu +++ /dev/null @@ -1,834 +0,0 @@ -#include -#include - -#define SPH_C32(x) ((uint32_t)(x ## U)) -#define SPH_T32(x) ((x) & SPH_C32(0xFFFFFFFF)) - -#include "cuda_helper.h" - -// globaler Speicher für alle HeftyHashes aller Threads -extern uint32_t *heavy_heftyHashes[MAX_GPUS]; -extern uint32_t *heavy_nonceVector[MAX_GPUS]; -static unsigned int *d_textures[MAX_GPUS][8]; - -// globaler Speicher für unsere Ergebnisse -uint32_t *d_hash4output[MAX_GPUS]; - -__constant__ uint32_t groestl_gpu_state[32]; -__constant__ uint32_t groestl_gpu_msg[32]; - -#define PC32up(j, r) ((uint32_t)((j) + (r))) -#define PC32dn(j, r) 0 -#define QC32up(j, r) 0xFFFFFFFF -#define QC32dn(j, r) (((uint32_t)(r) << 24) ^ SPH_T32(~((uint32_t)(j) << 24))) - -#define B32_0(x) ((x) & 0xFF) -#define B32_1(x) (((x) >> 8) & 0xFF) -#define B32_2(x) (((x) >> 16) & 0xFF) -#define B32_3(x) ((x) >> 24) - -#define C32e(x) ((SPH_C32(x) >> 24) \ - | ((SPH_C32(x) >> 8) & SPH_C32(0x0000FF00)) \ - | ((SPH_C32(x) << 8) & SPH_C32(0x00FF0000)) \ - | ((SPH_C32(x) << 24) & SPH_C32(0xFF000000))) - -#define T0up(x) tex1Dfetch(t0up, x) -#define T0dn(x) tex1Dfetch(t0dn, x) -#define T1up(x) tex1Dfetch(t1up, x) -#define T1dn(x) tex1Dfetch(t1dn, x) -#define T2up(x) tex1Dfetch(t2up, x) -#define T2dn(x) tex1Dfetch(t2dn, x) -#define T3up(x) tex1Dfetch(t3up, x) -#define T3dn(x) tex1Dfetch(t3dn, x) - -texture t0up; -texture t0dn; -texture t1up; -texture t1dn; -texture t2up; -texture t2dn; -texture t3up; -texture t3dn; - -uint32_t T0up_cpu[] = { - C32e(0xc632f4a5), C32e(0xf86f9784), C32e(0xee5eb099), C32e(0xf67a8c8d), - C32e(0xffe8170d), C32e(0xd60adcbd), C32e(0xde16c8b1), C32e(0x916dfc54), - C32e(0x6090f050), C32e(0x02070503), C32e(0xce2ee0a9), C32e(0x56d1877d), - C32e(0xe7cc2b19), C32e(0xb513a662), C32e(0x4d7c31e6), C32e(0xec59b59a), - C32e(0x8f40cf45), C32e(0x1fa3bc9d), C32e(0x8949c040), C32e(0xfa689287), - C32e(0xefd03f15), C32e(0xb29426eb), C32e(0x8ece40c9), C32e(0xfbe61d0b), - C32e(0x416e2fec), C32e(0xb31aa967), C32e(0x5f431cfd), C32e(0x456025ea), - C32e(0x23f9dabf), C32e(0x535102f7), C32e(0xe445a196), C32e(0x9b76ed5b), - C32e(0x75285dc2), C32e(0xe1c5241c), C32e(0x3dd4e9ae), C32e(0x4cf2be6a), - C32e(0x6c82ee5a), C32e(0x7ebdc341), C32e(0xf5f30602), C32e(0x8352d14f), - C32e(0x688ce45c), C32e(0x515607f4), C32e(0xd18d5c34), C32e(0xf9e11808), - C32e(0xe24cae93), C32e(0xab3e9573), C32e(0x6297f553), C32e(0x2a6b413f), - C32e(0x081c140c), C32e(0x9563f652), C32e(0x46e9af65), C32e(0x9d7fe25e), - C32e(0x30487828), C32e(0x37cff8a1), C32e(0x0a1b110f), C32e(0x2febc4b5), - C32e(0x0e151b09), C32e(0x247e5a36), C32e(0x1badb69b), C32e(0xdf98473d), - C32e(0xcda76a26), C32e(0x4ef5bb69), C32e(0x7f334ccd), C32e(0xea50ba9f), - C32e(0x123f2d1b), C32e(0x1da4b99e), C32e(0x58c49c74), C32e(0x3446722e), - C32e(0x3641772d), C32e(0xdc11cdb2), C32e(0xb49d29ee), C32e(0x5b4d16fb), - C32e(0xa4a501f6), C32e(0x76a1d74d), C32e(0xb714a361), C32e(0x7d3449ce), - C32e(0x52df8d7b), C32e(0xdd9f423e), C32e(0x5ecd9371), C32e(0x13b1a297), - C32e(0xa6a204f5), C32e(0xb901b868), C32e(0x00000000), C32e(0xc1b5742c), - C32e(0x40e0a060), C32e(0xe3c2211f), C32e(0x793a43c8), C32e(0xb69a2ced), - C32e(0xd40dd9be), C32e(0x8d47ca46), C32e(0x671770d9), C32e(0x72afdd4b), - C32e(0x94ed79de), C32e(0x98ff67d4), C32e(0xb09323e8), C32e(0x855bde4a), - C32e(0xbb06bd6b), C32e(0xc5bb7e2a), C32e(0x4f7b34e5), C32e(0xedd73a16), - C32e(0x86d254c5), C32e(0x9af862d7), C32e(0x6699ff55), C32e(0x11b6a794), - C32e(0x8ac04acf), C32e(0xe9d93010), C32e(0x040e0a06), C32e(0xfe669881), - C32e(0xa0ab0bf0), C32e(0x78b4cc44), C32e(0x25f0d5ba), C32e(0x4b753ee3), - C32e(0xa2ac0ef3), C32e(0x5d4419fe), C32e(0x80db5bc0), C32e(0x0580858a), - C32e(0x3fd3ecad), C32e(0x21fedfbc), C32e(0x70a8d848), C32e(0xf1fd0c04), - C32e(0x63197adf), C32e(0x772f58c1), C32e(0xaf309f75), C32e(0x42e7a563), - C32e(0x20705030), C32e(0xe5cb2e1a), C32e(0xfdef120e), C32e(0xbf08b76d), - C32e(0x8155d44c), C32e(0x18243c14), C32e(0x26795f35), C32e(0xc3b2712f), - C32e(0xbe8638e1), C32e(0x35c8fda2), C32e(0x88c74fcc), C32e(0x2e654b39), - C32e(0x936af957), C32e(0x55580df2), C32e(0xfc619d82), C32e(0x7ab3c947), - C32e(0xc827efac), C32e(0xba8832e7), C32e(0x324f7d2b), C32e(0xe642a495), - C32e(0xc03bfba0), C32e(0x19aab398), C32e(0x9ef668d1), C32e(0xa322817f), - C32e(0x44eeaa66), C32e(0x54d6827e), C32e(0x3bdde6ab), C32e(0x0b959e83), - C32e(0x8cc945ca), C32e(0xc7bc7b29), C32e(0x6b056ed3), C32e(0x286c443c), - C32e(0xa72c8b79), C32e(0xbc813de2), C32e(0x1631271d), C32e(0xad379a76), - C32e(0xdb964d3b), C32e(0x649efa56), C32e(0x74a6d24e), C32e(0x1436221e), - C32e(0x92e476db), C32e(0x0c121e0a), C32e(0x48fcb46c), C32e(0xb88f37e4), - C32e(0x9f78e75d), C32e(0xbd0fb26e), C32e(0x43692aef), C32e(0xc435f1a6), - C32e(0x39dae3a8), C32e(0x31c6f7a4), C32e(0xd38a5937), C32e(0xf274868b), - C32e(0xd5835632), C32e(0x8b4ec543), C32e(0x6e85eb59), C32e(0xda18c2b7), - C32e(0x018e8f8c), C32e(0xb11dac64), C32e(0x9cf16dd2), C32e(0x49723be0), - C32e(0xd81fc7b4), C32e(0xacb915fa), C32e(0xf3fa0907), C32e(0xcfa06f25), - C32e(0xca20eaaf), C32e(0xf47d898e), C32e(0x476720e9), C32e(0x10382818), - C32e(0x6f0b64d5), C32e(0xf0738388), C32e(0x4afbb16f), C32e(0x5cca9672), - C32e(0x38546c24), C32e(0x575f08f1), C32e(0x732152c7), C32e(0x9764f351), - C32e(0xcbae6523), C32e(0xa125847c), C32e(0xe857bf9c), C32e(0x3e5d6321), - C32e(0x96ea7cdd), C32e(0x611e7fdc), C32e(0x0d9c9186), C32e(0x0f9b9485), - C32e(0xe04bab90), C32e(0x7cbac642), C32e(0x712657c4), C32e(0xcc29e5aa), - C32e(0x90e373d8), C32e(0x06090f05), C32e(0xf7f40301), C32e(0x1c2a3612), - C32e(0xc23cfea3), C32e(0x6a8be15f), C32e(0xaebe10f9), C32e(0x69026bd0), - C32e(0x17bfa891), C32e(0x9971e858), C32e(0x3a536927), C32e(0x27f7d0b9), - C32e(0xd9914838), C32e(0xebde3513), C32e(0x2be5ceb3), C32e(0x22775533), - C32e(0xd204d6bb), C32e(0xa9399070), C32e(0x07878089), C32e(0x33c1f2a7), - C32e(0x2decc1b6), C32e(0x3c5a6622), C32e(0x15b8ad92), C32e(0xc9a96020), - C32e(0x875cdb49), C32e(0xaab01aff), C32e(0x50d88878), C32e(0xa52b8e7a), - C32e(0x03898a8f), C32e(0x594a13f8), C32e(0x09929b80), C32e(0x1a233917), - C32e(0x651075da), C32e(0xd7845331), C32e(0x84d551c6), C32e(0xd003d3b8), - C32e(0x82dc5ec3), C32e(0x29e2cbb0), C32e(0x5ac39977), C32e(0x1e2d3311), - C32e(0x7b3d46cb), C32e(0xa8b71ffc), C32e(0x6d0c61d6), C32e(0x2c624e3a) -}; - -uint32_t T0dn_cpu[] = { - C32e(0xf497a5c6), C32e(0x97eb84f8), C32e(0xb0c799ee), C32e(0x8cf78df6), - C32e(0x17e50dff), C32e(0xdcb7bdd6), C32e(0xc8a7b1de), C32e(0xfc395491), - C32e(0xf0c05060), C32e(0x05040302), C32e(0xe087a9ce), C32e(0x87ac7d56), - C32e(0x2bd519e7), C32e(0xa67162b5), C32e(0x319ae64d), C32e(0xb5c39aec), - C32e(0xcf05458f), C32e(0xbc3e9d1f), C32e(0xc0094089), C32e(0x92ef87fa), - C32e(0x3fc515ef), C32e(0x267febb2), C32e(0x4007c98e), C32e(0x1ded0bfb), - C32e(0x2f82ec41), C32e(0xa97d67b3), C32e(0x1cbefd5f), C32e(0x258aea45), - C32e(0xda46bf23), C32e(0x02a6f753), C32e(0xa1d396e4), C32e(0xed2d5b9b), - C32e(0x5deac275), C32e(0x24d91ce1), C32e(0xe97aae3d), C32e(0xbe986a4c), - C32e(0xeed85a6c), C32e(0xc3fc417e), C32e(0x06f102f5), C32e(0xd11d4f83), - C32e(0xe4d05c68), C32e(0x07a2f451), C32e(0x5cb934d1), C32e(0x18e908f9), - C32e(0xaedf93e2), C32e(0x954d73ab), C32e(0xf5c45362), C32e(0x41543f2a), - C32e(0x14100c08), C32e(0xf6315295), C32e(0xaf8c6546), C32e(0xe2215e9d), - C32e(0x78602830), C32e(0xf86ea137), C32e(0x11140f0a), C32e(0xc45eb52f), - C32e(0x1b1c090e), C32e(0x5a483624), C32e(0xb6369b1b), C32e(0x47a53ddf), - C32e(0x6a8126cd), C32e(0xbb9c694e), C32e(0x4cfecd7f), C32e(0xbacf9fea), - C32e(0x2d241b12), C32e(0xb93a9e1d), C32e(0x9cb07458), C32e(0x72682e34), - C32e(0x776c2d36), C32e(0xcda3b2dc), C32e(0x2973eeb4), C32e(0x16b6fb5b), - C32e(0x0153f6a4), C32e(0xd7ec4d76), C32e(0xa37561b7), C32e(0x49face7d), - C32e(0x8da47b52), C32e(0x42a13edd), C32e(0x93bc715e), C32e(0xa2269713), - C32e(0x0457f5a6), C32e(0xb86968b9), C32e(0x00000000), C32e(0x74992cc1), - C32e(0xa0806040), C32e(0x21dd1fe3), C32e(0x43f2c879), C32e(0x2c77edb6), - C32e(0xd9b3bed4), C32e(0xca01468d), C32e(0x70ced967), C32e(0xdde44b72), - C32e(0x7933de94), C32e(0x672bd498), C32e(0x237be8b0), C32e(0xde114a85), - C32e(0xbd6d6bbb), C32e(0x7e912ac5), C32e(0x349ee54f), C32e(0x3ac116ed), - C32e(0x5417c586), C32e(0x622fd79a), C32e(0xffcc5566), C32e(0xa7229411), - C32e(0x4a0fcf8a), C32e(0x30c910e9), C32e(0x0a080604), C32e(0x98e781fe), - C32e(0x0b5bf0a0), C32e(0xccf04478), C32e(0xd54aba25), C32e(0x3e96e34b), - C32e(0x0e5ff3a2), C32e(0x19bafe5d), C32e(0x5b1bc080), C32e(0x850a8a05), - C32e(0xec7ead3f), C32e(0xdf42bc21), C32e(0xd8e04870), C32e(0x0cf904f1), - C32e(0x7ac6df63), C32e(0x58eec177), C32e(0x9f4575af), C32e(0xa5846342), - C32e(0x50403020), C32e(0x2ed11ae5), C32e(0x12e10efd), C32e(0xb7656dbf), - C32e(0xd4194c81), C32e(0x3c301418), C32e(0x5f4c3526), C32e(0x719d2fc3), - C32e(0x3867e1be), C32e(0xfd6aa235), C32e(0x4f0bcc88), C32e(0x4b5c392e), - C32e(0xf93d5793), C32e(0x0daaf255), C32e(0x9de382fc), C32e(0xc9f4477a), - C32e(0xef8bacc8), C32e(0x326fe7ba), C32e(0x7d642b32), C32e(0xa4d795e6), - C32e(0xfb9ba0c0), C32e(0xb3329819), C32e(0x6827d19e), C32e(0x815d7fa3), - C32e(0xaa886644), C32e(0x82a87e54), C32e(0xe676ab3b), C32e(0x9e16830b), - C32e(0x4503ca8c), C32e(0x7b9529c7), C32e(0x6ed6d36b), C32e(0x44503c28), - C32e(0x8b5579a7), C32e(0x3d63e2bc), C32e(0x272c1d16), C32e(0x9a4176ad), - C32e(0x4dad3bdb), C32e(0xfac85664), C32e(0xd2e84e74), C32e(0x22281e14), - C32e(0x763fdb92), C32e(0x1e180a0c), C32e(0xb4906c48), C32e(0x376be4b8), - C32e(0xe7255d9f), C32e(0xb2616ebd), C32e(0x2a86ef43), C32e(0xf193a6c4), - C32e(0xe372a839), C32e(0xf762a431), C32e(0x59bd37d3), C32e(0x86ff8bf2), - C32e(0x56b132d5), C32e(0xc50d438b), C32e(0xebdc596e), C32e(0xc2afb7da), - C32e(0x8f028c01), C32e(0xac7964b1), C32e(0x6d23d29c), C32e(0x3b92e049), - C32e(0xc7abb4d8), C32e(0x1543faac), C32e(0x09fd07f3), C32e(0x6f8525cf), - C32e(0xea8fafca), C32e(0x89f38ef4), C32e(0x208ee947), C32e(0x28201810), - C32e(0x64ded56f), C32e(0x83fb88f0), C32e(0xb1946f4a), C32e(0x96b8725c), - C32e(0x6c702438), C32e(0x08aef157), C32e(0x52e6c773), C32e(0xf3355197), - C32e(0x658d23cb), C32e(0x84597ca1), C32e(0xbfcb9ce8), C32e(0x637c213e), - C32e(0x7c37dd96), C32e(0x7fc2dc61), C32e(0x911a860d), C32e(0x941e850f), - C32e(0xabdb90e0), C32e(0xc6f8427c), C32e(0x57e2c471), C32e(0xe583aacc), - C32e(0x733bd890), C32e(0x0f0c0506), C32e(0x03f501f7), C32e(0x3638121c), - C32e(0xfe9fa3c2), C32e(0xe1d45f6a), C32e(0x1047f9ae), C32e(0x6bd2d069), - C32e(0xa82e9117), C32e(0xe8295899), C32e(0x6974273a), C32e(0xd04eb927), - C32e(0x48a938d9), C32e(0x35cd13eb), C32e(0xce56b32b), C32e(0x55443322), - C32e(0xd6bfbbd2), C32e(0x904970a9), C32e(0x800e8907), C32e(0xf266a733), - C32e(0xc15ab62d), C32e(0x6678223c), C32e(0xad2a9215), C32e(0x608920c9), - C32e(0xdb154987), C32e(0x1a4fffaa), C32e(0x88a07850), C32e(0x8e517aa5), - C32e(0x8a068f03), C32e(0x13b2f859), C32e(0x9b128009), C32e(0x3934171a), - C32e(0x75cada65), C32e(0x53b531d7), C32e(0x5113c684), C32e(0xd3bbb8d0), - C32e(0x5e1fc382), C32e(0xcb52b029), C32e(0x99b4775a), C32e(0x333c111e), - C32e(0x46f6cb7b), C32e(0x1f4bfca8), C32e(0x61dad66d), C32e(0x4e583a2c) -}; - -uint32_t T1up_cpu[] = { - C32e(0xc6c632f4), C32e(0xf8f86f97), C32e(0xeeee5eb0), C32e(0xf6f67a8c), - C32e(0xffffe817), C32e(0xd6d60adc), C32e(0xdede16c8), C32e(0x91916dfc), - C32e(0x606090f0), C32e(0x02020705), C32e(0xcece2ee0), C32e(0x5656d187), - C32e(0xe7e7cc2b), C32e(0xb5b513a6), C32e(0x4d4d7c31), C32e(0xecec59b5), - C32e(0x8f8f40cf), C32e(0x1f1fa3bc), C32e(0x898949c0), C32e(0xfafa6892), - C32e(0xefefd03f), C32e(0xb2b29426), C32e(0x8e8ece40), C32e(0xfbfbe61d), - C32e(0x41416e2f), C32e(0xb3b31aa9), C32e(0x5f5f431c), C32e(0x45456025), - C32e(0x2323f9da), C32e(0x53535102), C32e(0xe4e445a1), C32e(0x9b9b76ed), - C32e(0x7575285d), C32e(0xe1e1c524), C32e(0x3d3dd4e9), C32e(0x4c4cf2be), - C32e(0x6c6c82ee), C32e(0x7e7ebdc3), C32e(0xf5f5f306), C32e(0x838352d1), - C32e(0x68688ce4), C32e(0x51515607), C32e(0xd1d18d5c), C32e(0xf9f9e118), - C32e(0xe2e24cae), C32e(0xabab3e95), C32e(0x626297f5), C32e(0x2a2a6b41), - C32e(0x08081c14), C32e(0x959563f6), C32e(0x4646e9af), C32e(0x9d9d7fe2), - C32e(0x30304878), C32e(0x3737cff8), C32e(0x0a0a1b11), C32e(0x2f2febc4), - C32e(0x0e0e151b), C32e(0x24247e5a), C32e(0x1b1badb6), C32e(0xdfdf9847), - C32e(0xcdcda76a), C32e(0x4e4ef5bb), C32e(0x7f7f334c), C32e(0xeaea50ba), - C32e(0x12123f2d), C32e(0x1d1da4b9), C32e(0x5858c49c), C32e(0x34344672), - C32e(0x36364177), C32e(0xdcdc11cd), C32e(0xb4b49d29), C32e(0x5b5b4d16), - C32e(0xa4a4a501), C32e(0x7676a1d7), C32e(0xb7b714a3), C32e(0x7d7d3449), - C32e(0x5252df8d), C32e(0xdddd9f42), C32e(0x5e5ecd93), C32e(0x1313b1a2), - C32e(0xa6a6a204), C32e(0xb9b901b8), C32e(0x00000000), C32e(0xc1c1b574), - C32e(0x4040e0a0), C32e(0xe3e3c221), C32e(0x79793a43), C32e(0xb6b69a2c), - C32e(0xd4d40dd9), C32e(0x8d8d47ca), C32e(0x67671770), C32e(0x7272afdd), - C32e(0x9494ed79), C32e(0x9898ff67), C32e(0xb0b09323), C32e(0x85855bde), - C32e(0xbbbb06bd), C32e(0xc5c5bb7e), C32e(0x4f4f7b34), C32e(0xededd73a), - C32e(0x8686d254), C32e(0x9a9af862), C32e(0x666699ff), C32e(0x1111b6a7), - C32e(0x8a8ac04a), C32e(0xe9e9d930), C32e(0x04040e0a), C32e(0xfefe6698), - C32e(0xa0a0ab0b), C32e(0x7878b4cc), C32e(0x2525f0d5), C32e(0x4b4b753e), - C32e(0xa2a2ac0e), C32e(0x5d5d4419), C32e(0x8080db5b), C32e(0x05058085), - C32e(0x3f3fd3ec), C32e(0x2121fedf), C32e(0x7070a8d8), C32e(0xf1f1fd0c), - C32e(0x6363197a), C32e(0x77772f58), C32e(0xafaf309f), C32e(0x4242e7a5), - C32e(0x20207050), C32e(0xe5e5cb2e), C32e(0xfdfdef12), C32e(0xbfbf08b7), - C32e(0x818155d4), C32e(0x1818243c), C32e(0x2626795f), C32e(0xc3c3b271), - C32e(0xbebe8638), C32e(0x3535c8fd), C32e(0x8888c74f), C32e(0x2e2e654b), - C32e(0x93936af9), C32e(0x5555580d), C32e(0xfcfc619d), C32e(0x7a7ab3c9), - C32e(0xc8c827ef), C32e(0xbaba8832), C32e(0x32324f7d), C32e(0xe6e642a4), - C32e(0xc0c03bfb), C32e(0x1919aab3), C32e(0x9e9ef668), C32e(0xa3a32281), - C32e(0x4444eeaa), C32e(0x5454d682), C32e(0x3b3bdde6), C32e(0x0b0b959e), - C32e(0x8c8cc945), C32e(0xc7c7bc7b), C32e(0x6b6b056e), C32e(0x28286c44), - C32e(0xa7a72c8b), C32e(0xbcbc813d), C32e(0x16163127), C32e(0xadad379a), - C32e(0xdbdb964d), C32e(0x64649efa), C32e(0x7474a6d2), C32e(0x14143622), - C32e(0x9292e476), C32e(0x0c0c121e), C32e(0x4848fcb4), C32e(0xb8b88f37), - C32e(0x9f9f78e7), C32e(0xbdbd0fb2), C32e(0x4343692a), C32e(0xc4c435f1), - C32e(0x3939dae3), C32e(0x3131c6f7), C32e(0xd3d38a59), C32e(0xf2f27486), - C32e(0xd5d58356), C32e(0x8b8b4ec5), C32e(0x6e6e85eb), C32e(0xdada18c2), - C32e(0x01018e8f), C32e(0xb1b11dac), C32e(0x9c9cf16d), C32e(0x4949723b), - C32e(0xd8d81fc7), C32e(0xacacb915), C32e(0xf3f3fa09), C32e(0xcfcfa06f), - C32e(0xcaca20ea), C32e(0xf4f47d89), C32e(0x47476720), C32e(0x10103828), - C32e(0x6f6f0b64), C32e(0xf0f07383), C32e(0x4a4afbb1), C32e(0x5c5cca96), - C32e(0x3838546c), C32e(0x57575f08), C32e(0x73732152), C32e(0x979764f3), - C32e(0xcbcbae65), C32e(0xa1a12584), C32e(0xe8e857bf), C32e(0x3e3e5d63), - C32e(0x9696ea7c), C32e(0x61611e7f), C32e(0x0d0d9c91), C32e(0x0f0f9b94), - C32e(0xe0e04bab), C32e(0x7c7cbac6), C32e(0x71712657), C32e(0xcccc29e5), - C32e(0x9090e373), C32e(0x0606090f), C32e(0xf7f7f403), C32e(0x1c1c2a36), - C32e(0xc2c23cfe), C32e(0x6a6a8be1), C32e(0xaeaebe10), C32e(0x6969026b), - C32e(0x1717bfa8), C32e(0x999971e8), C32e(0x3a3a5369), C32e(0x2727f7d0), - C32e(0xd9d99148), C32e(0xebebde35), C32e(0x2b2be5ce), C32e(0x22227755), - C32e(0xd2d204d6), C32e(0xa9a93990), C32e(0x07078780), C32e(0x3333c1f2), - C32e(0x2d2decc1), C32e(0x3c3c5a66), C32e(0x1515b8ad), C32e(0xc9c9a960), - C32e(0x87875cdb), C32e(0xaaaab01a), C32e(0x5050d888), C32e(0xa5a52b8e), - C32e(0x0303898a), C32e(0x59594a13), C32e(0x0909929b), C32e(0x1a1a2339), - C32e(0x65651075), C32e(0xd7d78453), C32e(0x8484d551), C32e(0xd0d003d3), - C32e(0x8282dc5e), C32e(0x2929e2cb), C32e(0x5a5ac399), C32e(0x1e1e2d33), - C32e(0x7b7b3d46), C32e(0xa8a8b71f), C32e(0x6d6d0c61), C32e(0x2c2c624e) -}; - -uint32_t T1dn_cpu[] = { - C32e(0xa5f497a5), C32e(0x8497eb84), C32e(0x99b0c799), C32e(0x8d8cf78d), - C32e(0x0d17e50d), C32e(0xbddcb7bd), C32e(0xb1c8a7b1), C32e(0x54fc3954), - C32e(0x50f0c050), C32e(0x03050403), C32e(0xa9e087a9), C32e(0x7d87ac7d), - C32e(0x192bd519), C32e(0x62a67162), C32e(0xe6319ae6), C32e(0x9ab5c39a), - C32e(0x45cf0545), C32e(0x9dbc3e9d), C32e(0x40c00940), C32e(0x8792ef87), - C32e(0x153fc515), C32e(0xeb267feb), C32e(0xc94007c9), C32e(0x0b1ded0b), - C32e(0xec2f82ec), C32e(0x67a97d67), C32e(0xfd1cbefd), C32e(0xea258aea), - C32e(0xbfda46bf), C32e(0xf702a6f7), C32e(0x96a1d396), C32e(0x5bed2d5b), - C32e(0xc25deac2), C32e(0x1c24d91c), C32e(0xaee97aae), C32e(0x6abe986a), - C32e(0x5aeed85a), C32e(0x41c3fc41), C32e(0x0206f102), C32e(0x4fd11d4f), - C32e(0x5ce4d05c), C32e(0xf407a2f4), C32e(0x345cb934), C32e(0x0818e908), - C32e(0x93aedf93), C32e(0x73954d73), C32e(0x53f5c453), C32e(0x3f41543f), - C32e(0x0c14100c), C32e(0x52f63152), C32e(0x65af8c65), C32e(0x5ee2215e), - C32e(0x28786028), C32e(0xa1f86ea1), C32e(0x0f11140f), C32e(0xb5c45eb5), - C32e(0x091b1c09), C32e(0x365a4836), C32e(0x9bb6369b), C32e(0x3d47a53d), - C32e(0x266a8126), C32e(0x69bb9c69), C32e(0xcd4cfecd), C32e(0x9fbacf9f), - C32e(0x1b2d241b), C32e(0x9eb93a9e), C32e(0x749cb074), C32e(0x2e72682e), - C32e(0x2d776c2d), C32e(0xb2cda3b2), C32e(0xee2973ee), C32e(0xfb16b6fb), - C32e(0xf60153f6), C32e(0x4dd7ec4d), C32e(0x61a37561), C32e(0xce49face), - C32e(0x7b8da47b), C32e(0x3e42a13e), C32e(0x7193bc71), C32e(0x97a22697), - C32e(0xf50457f5), C32e(0x68b86968), C32e(0x00000000), C32e(0x2c74992c), - C32e(0x60a08060), C32e(0x1f21dd1f), C32e(0xc843f2c8), C32e(0xed2c77ed), - C32e(0xbed9b3be), C32e(0x46ca0146), C32e(0xd970ced9), C32e(0x4bdde44b), - C32e(0xde7933de), C32e(0xd4672bd4), C32e(0xe8237be8), C32e(0x4ade114a), - C32e(0x6bbd6d6b), C32e(0x2a7e912a), C32e(0xe5349ee5), C32e(0x163ac116), - C32e(0xc55417c5), C32e(0xd7622fd7), C32e(0x55ffcc55), C32e(0x94a72294), - C32e(0xcf4a0fcf), C32e(0x1030c910), C32e(0x060a0806), C32e(0x8198e781), - C32e(0xf00b5bf0), C32e(0x44ccf044), C32e(0xbad54aba), C32e(0xe33e96e3), - C32e(0xf30e5ff3), C32e(0xfe19bafe), C32e(0xc05b1bc0), C32e(0x8a850a8a), - C32e(0xadec7ead), C32e(0xbcdf42bc), C32e(0x48d8e048), C32e(0x040cf904), - C32e(0xdf7ac6df), C32e(0xc158eec1), C32e(0x759f4575), C32e(0x63a58463), - C32e(0x30504030), C32e(0x1a2ed11a), C32e(0x0e12e10e), C32e(0x6db7656d), - C32e(0x4cd4194c), C32e(0x143c3014), C32e(0x355f4c35), C32e(0x2f719d2f), - C32e(0xe13867e1), C32e(0xa2fd6aa2), C32e(0xcc4f0bcc), C32e(0x394b5c39), - C32e(0x57f93d57), C32e(0xf20daaf2), C32e(0x829de382), C32e(0x47c9f447), - C32e(0xacef8bac), C32e(0xe7326fe7), C32e(0x2b7d642b), C32e(0x95a4d795), - C32e(0xa0fb9ba0), C32e(0x98b33298), C32e(0xd16827d1), C32e(0x7f815d7f), - C32e(0x66aa8866), C32e(0x7e82a87e), C32e(0xabe676ab), C32e(0x839e1683), - C32e(0xca4503ca), C32e(0x297b9529), C32e(0xd36ed6d3), C32e(0x3c44503c), - C32e(0x798b5579), C32e(0xe23d63e2), C32e(0x1d272c1d), C32e(0x769a4176), - C32e(0x3b4dad3b), C32e(0x56fac856), C32e(0x4ed2e84e), C32e(0x1e22281e), - C32e(0xdb763fdb), C32e(0x0a1e180a), C32e(0x6cb4906c), C32e(0xe4376be4), - C32e(0x5de7255d), C32e(0x6eb2616e), C32e(0xef2a86ef), C32e(0xa6f193a6), - C32e(0xa8e372a8), C32e(0xa4f762a4), C32e(0x3759bd37), C32e(0x8b86ff8b), - C32e(0x3256b132), C32e(0x43c50d43), C32e(0x59ebdc59), C32e(0xb7c2afb7), - C32e(0x8c8f028c), C32e(0x64ac7964), C32e(0xd26d23d2), C32e(0xe03b92e0), - C32e(0xb4c7abb4), C32e(0xfa1543fa), C32e(0x0709fd07), C32e(0x256f8525), - C32e(0xafea8faf), C32e(0x8e89f38e), C32e(0xe9208ee9), C32e(0x18282018), - C32e(0xd564ded5), C32e(0x8883fb88), C32e(0x6fb1946f), C32e(0x7296b872), - C32e(0x246c7024), C32e(0xf108aef1), C32e(0xc752e6c7), C32e(0x51f33551), - C32e(0x23658d23), C32e(0x7c84597c), C32e(0x9cbfcb9c), C32e(0x21637c21), - C32e(0xdd7c37dd), C32e(0xdc7fc2dc), C32e(0x86911a86), C32e(0x85941e85), - C32e(0x90abdb90), C32e(0x42c6f842), C32e(0xc457e2c4), C32e(0xaae583aa), - C32e(0xd8733bd8), C32e(0x050f0c05), C32e(0x0103f501), C32e(0x12363812), - C32e(0xa3fe9fa3), C32e(0x5fe1d45f), C32e(0xf91047f9), C32e(0xd06bd2d0), - C32e(0x91a82e91), C32e(0x58e82958), C32e(0x27697427), C32e(0xb9d04eb9), - C32e(0x3848a938), C32e(0x1335cd13), C32e(0xb3ce56b3), C32e(0x33554433), - C32e(0xbbd6bfbb), C32e(0x70904970), C32e(0x89800e89), C32e(0xa7f266a7), - C32e(0xb6c15ab6), C32e(0x22667822), C32e(0x92ad2a92), C32e(0x20608920), - C32e(0x49db1549), C32e(0xff1a4fff), C32e(0x7888a078), C32e(0x7a8e517a), - C32e(0x8f8a068f), C32e(0xf813b2f8), C32e(0x809b1280), C32e(0x17393417), - C32e(0xda75cada), C32e(0x3153b531), C32e(0xc65113c6), C32e(0xb8d3bbb8), - C32e(0xc35e1fc3), C32e(0xb0cb52b0), C32e(0x7799b477), C32e(0x11333c11), - C32e(0xcb46f6cb), C32e(0xfc1f4bfc), C32e(0xd661dad6), C32e(0x3a4e583a) -}; - -uint32_t T2up_cpu[] = { - C32e(0xa5c6c632), C32e(0x84f8f86f), C32e(0x99eeee5e), C32e(0x8df6f67a), - C32e(0x0dffffe8), C32e(0xbdd6d60a), C32e(0xb1dede16), C32e(0x5491916d), - C32e(0x50606090), C32e(0x03020207), C32e(0xa9cece2e), C32e(0x7d5656d1), - C32e(0x19e7e7cc), C32e(0x62b5b513), C32e(0xe64d4d7c), C32e(0x9aecec59), - C32e(0x458f8f40), C32e(0x9d1f1fa3), C32e(0x40898949), C32e(0x87fafa68), - C32e(0x15efefd0), C32e(0xebb2b294), C32e(0xc98e8ece), C32e(0x0bfbfbe6), - C32e(0xec41416e), C32e(0x67b3b31a), C32e(0xfd5f5f43), C32e(0xea454560), - C32e(0xbf2323f9), C32e(0xf7535351), C32e(0x96e4e445), C32e(0x5b9b9b76), - C32e(0xc2757528), C32e(0x1ce1e1c5), C32e(0xae3d3dd4), C32e(0x6a4c4cf2), - C32e(0x5a6c6c82), C32e(0x417e7ebd), C32e(0x02f5f5f3), C32e(0x4f838352), - C32e(0x5c68688c), C32e(0xf4515156), C32e(0x34d1d18d), C32e(0x08f9f9e1), - C32e(0x93e2e24c), C32e(0x73abab3e), C32e(0x53626297), C32e(0x3f2a2a6b), - C32e(0x0c08081c), C32e(0x52959563), C32e(0x654646e9), C32e(0x5e9d9d7f), - C32e(0x28303048), C32e(0xa13737cf), C32e(0x0f0a0a1b), C32e(0xb52f2feb), - C32e(0x090e0e15), C32e(0x3624247e), C32e(0x9b1b1bad), C32e(0x3ddfdf98), - C32e(0x26cdcda7), C32e(0x694e4ef5), C32e(0xcd7f7f33), C32e(0x9feaea50), - C32e(0x1b12123f), C32e(0x9e1d1da4), C32e(0x745858c4), C32e(0x2e343446), - C32e(0x2d363641), C32e(0xb2dcdc11), C32e(0xeeb4b49d), C32e(0xfb5b5b4d), - C32e(0xf6a4a4a5), C32e(0x4d7676a1), C32e(0x61b7b714), C32e(0xce7d7d34), - C32e(0x7b5252df), C32e(0x3edddd9f), C32e(0x715e5ecd), C32e(0x971313b1), - C32e(0xf5a6a6a2), C32e(0x68b9b901), C32e(0x00000000), C32e(0x2cc1c1b5), - C32e(0x604040e0), C32e(0x1fe3e3c2), C32e(0xc879793a), C32e(0xedb6b69a), - C32e(0xbed4d40d), C32e(0x468d8d47), C32e(0xd9676717), C32e(0x4b7272af), - C32e(0xde9494ed), C32e(0xd49898ff), C32e(0xe8b0b093), C32e(0x4a85855b), - C32e(0x6bbbbb06), C32e(0x2ac5c5bb), C32e(0xe54f4f7b), C32e(0x16ededd7), - C32e(0xc58686d2), C32e(0xd79a9af8), C32e(0x55666699), C32e(0x941111b6), - C32e(0xcf8a8ac0), C32e(0x10e9e9d9), C32e(0x0604040e), C32e(0x81fefe66), - C32e(0xf0a0a0ab), C32e(0x447878b4), C32e(0xba2525f0), C32e(0xe34b4b75), - C32e(0xf3a2a2ac), C32e(0xfe5d5d44), C32e(0xc08080db), C32e(0x8a050580), - C32e(0xad3f3fd3), C32e(0xbc2121fe), C32e(0x487070a8), C32e(0x04f1f1fd), - C32e(0xdf636319), C32e(0xc177772f), C32e(0x75afaf30), C32e(0x634242e7), - C32e(0x30202070), C32e(0x1ae5e5cb), C32e(0x0efdfdef), C32e(0x6dbfbf08), - C32e(0x4c818155), C32e(0x14181824), C32e(0x35262679), C32e(0x2fc3c3b2), - C32e(0xe1bebe86), C32e(0xa23535c8), C32e(0xcc8888c7), C32e(0x392e2e65), - C32e(0x5793936a), C32e(0xf2555558), C32e(0x82fcfc61), C32e(0x477a7ab3), - C32e(0xacc8c827), C32e(0xe7baba88), C32e(0x2b32324f), C32e(0x95e6e642), - C32e(0xa0c0c03b), C32e(0x981919aa), C32e(0xd19e9ef6), C32e(0x7fa3a322), - C32e(0x664444ee), C32e(0x7e5454d6), C32e(0xab3b3bdd), C32e(0x830b0b95), - C32e(0xca8c8cc9), C32e(0x29c7c7bc), C32e(0xd36b6b05), C32e(0x3c28286c), - C32e(0x79a7a72c), C32e(0xe2bcbc81), C32e(0x1d161631), C32e(0x76adad37), - C32e(0x3bdbdb96), C32e(0x5664649e), C32e(0x4e7474a6), C32e(0x1e141436), - C32e(0xdb9292e4), C32e(0x0a0c0c12), C32e(0x6c4848fc), C32e(0xe4b8b88f), - C32e(0x5d9f9f78), C32e(0x6ebdbd0f), C32e(0xef434369), C32e(0xa6c4c435), - C32e(0xa83939da), C32e(0xa43131c6), C32e(0x37d3d38a), C32e(0x8bf2f274), - C32e(0x32d5d583), C32e(0x438b8b4e), C32e(0x596e6e85), C32e(0xb7dada18), - C32e(0x8c01018e), C32e(0x64b1b11d), C32e(0xd29c9cf1), C32e(0xe0494972), - C32e(0xb4d8d81f), C32e(0xfaacacb9), C32e(0x07f3f3fa), C32e(0x25cfcfa0), - C32e(0xafcaca20), C32e(0x8ef4f47d), C32e(0xe9474767), C32e(0x18101038), - C32e(0xd56f6f0b), C32e(0x88f0f073), C32e(0x6f4a4afb), C32e(0x725c5cca), - C32e(0x24383854), C32e(0xf157575f), C32e(0xc7737321), C32e(0x51979764), - C32e(0x23cbcbae), C32e(0x7ca1a125), C32e(0x9ce8e857), C32e(0x213e3e5d), - C32e(0xdd9696ea), C32e(0xdc61611e), C32e(0x860d0d9c), C32e(0x850f0f9b), - C32e(0x90e0e04b), C32e(0x427c7cba), C32e(0xc4717126), C32e(0xaacccc29), - C32e(0xd89090e3), C32e(0x05060609), C32e(0x01f7f7f4), C32e(0x121c1c2a), - C32e(0xa3c2c23c), C32e(0x5f6a6a8b), C32e(0xf9aeaebe), C32e(0xd0696902), - C32e(0x911717bf), C32e(0x58999971), C32e(0x273a3a53), C32e(0xb92727f7), - C32e(0x38d9d991), C32e(0x13ebebde), C32e(0xb32b2be5), C32e(0x33222277), - C32e(0xbbd2d204), C32e(0x70a9a939), C32e(0x89070787), C32e(0xa73333c1), - C32e(0xb62d2dec), C32e(0x223c3c5a), C32e(0x921515b8), C32e(0x20c9c9a9), - C32e(0x4987875c), C32e(0xffaaaab0), C32e(0x785050d8), C32e(0x7aa5a52b), - C32e(0x8f030389), C32e(0xf859594a), C32e(0x80090992), C32e(0x171a1a23), - C32e(0xda656510), C32e(0x31d7d784), C32e(0xc68484d5), C32e(0xb8d0d003), - C32e(0xc38282dc), C32e(0xb02929e2), C32e(0x775a5ac3), C32e(0x111e1e2d), - C32e(0xcb7b7b3d), C32e(0xfca8a8b7), C32e(0xd66d6d0c), C32e(0x3a2c2c62) -}; - -uint32_t T2dn_cpu[] = { - C32e(0xf4a5f497), C32e(0x978497eb), C32e(0xb099b0c7), C32e(0x8c8d8cf7), - C32e(0x170d17e5), C32e(0xdcbddcb7), C32e(0xc8b1c8a7), C32e(0xfc54fc39), - C32e(0xf050f0c0), C32e(0x05030504), C32e(0xe0a9e087), C32e(0x877d87ac), - C32e(0x2b192bd5), C32e(0xa662a671), C32e(0x31e6319a), C32e(0xb59ab5c3), - C32e(0xcf45cf05), C32e(0xbc9dbc3e), C32e(0xc040c009), C32e(0x928792ef), - C32e(0x3f153fc5), C32e(0x26eb267f), C32e(0x40c94007), C32e(0x1d0b1ded), - C32e(0x2fec2f82), C32e(0xa967a97d), C32e(0x1cfd1cbe), C32e(0x25ea258a), - C32e(0xdabfda46), C32e(0x02f702a6), C32e(0xa196a1d3), C32e(0xed5bed2d), - C32e(0x5dc25dea), C32e(0x241c24d9), C32e(0xe9aee97a), C32e(0xbe6abe98), - C32e(0xee5aeed8), C32e(0xc341c3fc), C32e(0x060206f1), C32e(0xd14fd11d), - C32e(0xe45ce4d0), C32e(0x07f407a2), C32e(0x5c345cb9), C32e(0x180818e9), - C32e(0xae93aedf), C32e(0x9573954d), C32e(0xf553f5c4), C32e(0x413f4154), - C32e(0x140c1410), C32e(0xf652f631), C32e(0xaf65af8c), C32e(0xe25ee221), - C32e(0x78287860), C32e(0xf8a1f86e), C32e(0x110f1114), C32e(0xc4b5c45e), - C32e(0x1b091b1c), C32e(0x5a365a48), C32e(0xb69bb636), C32e(0x473d47a5), - C32e(0x6a266a81), C32e(0xbb69bb9c), C32e(0x4ccd4cfe), C32e(0xba9fbacf), - C32e(0x2d1b2d24), C32e(0xb99eb93a), C32e(0x9c749cb0), C32e(0x722e7268), - C32e(0x772d776c), C32e(0xcdb2cda3), C32e(0x29ee2973), C32e(0x16fb16b6), - C32e(0x01f60153), C32e(0xd74dd7ec), C32e(0xa361a375), C32e(0x49ce49fa), - C32e(0x8d7b8da4), C32e(0x423e42a1), C32e(0x937193bc), C32e(0xa297a226), - C32e(0x04f50457), C32e(0xb868b869), C32e(0x00000000), C32e(0x742c7499), - C32e(0xa060a080), C32e(0x211f21dd), C32e(0x43c843f2), C32e(0x2ced2c77), - C32e(0xd9bed9b3), C32e(0xca46ca01), C32e(0x70d970ce), C32e(0xdd4bdde4), - C32e(0x79de7933), C32e(0x67d4672b), C32e(0x23e8237b), C32e(0xde4ade11), - C32e(0xbd6bbd6d), C32e(0x7e2a7e91), C32e(0x34e5349e), C32e(0x3a163ac1), - C32e(0x54c55417), C32e(0x62d7622f), C32e(0xff55ffcc), C32e(0xa794a722), - C32e(0x4acf4a0f), C32e(0x301030c9), C32e(0x0a060a08), C32e(0x988198e7), - C32e(0x0bf00b5b), C32e(0xcc44ccf0), C32e(0xd5bad54a), C32e(0x3ee33e96), - C32e(0x0ef30e5f), C32e(0x19fe19ba), C32e(0x5bc05b1b), C32e(0x858a850a), - C32e(0xecadec7e), C32e(0xdfbcdf42), C32e(0xd848d8e0), C32e(0x0c040cf9), - C32e(0x7adf7ac6), C32e(0x58c158ee), C32e(0x9f759f45), C32e(0xa563a584), - C32e(0x50305040), C32e(0x2e1a2ed1), C32e(0x120e12e1), C32e(0xb76db765), - C32e(0xd44cd419), C32e(0x3c143c30), C32e(0x5f355f4c), C32e(0x712f719d), - C32e(0x38e13867), C32e(0xfda2fd6a), C32e(0x4fcc4f0b), C32e(0x4b394b5c), - C32e(0xf957f93d), C32e(0x0df20daa), C32e(0x9d829de3), C32e(0xc947c9f4), - C32e(0xefacef8b), C32e(0x32e7326f), C32e(0x7d2b7d64), C32e(0xa495a4d7), - C32e(0xfba0fb9b), C32e(0xb398b332), C32e(0x68d16827), C32e(0x817f815d), - C32e(0xaa66aa88), C32e(0x827e82a8), C32e(0xe6abe676), C32e(0x9e839e16), - C32e(0x45ca4503), C32e(0x7b297b95), C32e(0x6ed36ed6), C32e(0x443c4450), - C32e(0x8b798b55), C32e(0x3de23d63), C32e(0x271d272c), C32e(0x9a769a41), - C32e(0x4d3b4dad), C32e(0xfa56fac8), C32e(0xd24ed2e8), C32e(0x221e2228), - C32e(0x76db763f), C32e(0x1e0a1e18), C32e(0xb46cb490), C32e(0x37e4376b), - C32e(0xe75de725), C32e(0xb26eb261), C32e(0x2aef2a86), C32e(0xf1a6f193), - C32e(0xe3a8e372), C32e(0xf7a4f762), C32e(0x593759bd), C32e(0x868b86ff), - C32e(0x563256b1), C32e(0xc543c50d), C32e(0xeb59ebdc), C32e(0xc2b7c2af), - C32e(0x8f8c8f02), C32e(0xac64ac79), C32e(0x6dd26d23), C32e(0x3be03b92), - C32e(0xc7b4c7ab), C32e(0x15fa1543), C32e(0x090709fd), C32e(0x6f256f85), - C32e(0xeaafea8f), C32e(0x898e89f3), C32e(0x20e9208e), C32e(0x28182820), - C32e(0x64d564de), C32e(0x838883fb), C32e(0xb16fb194), C32e(0x967296b8), - C32e(0x6c246c70), C32e(0x08f108ae), C32e(0x52c752e6), C32e(0xf351f335), - C32e(0x6523658d), C32e(0x847c8459), C32e(0xbf9cbfcb), C32e(0x6321637c), - C32e(0x7cdd7c37), C32e(0x7fdc7fc2), C32e(0x9186911a), C32e(0x9485941e), - C32e(0xab90abdb), C32e(0xc642c6f8), C32e(0x57c457e2), C32e(0xe5aae583), - C32e(0x73d8733b), C32e(0x0f050f0c), C32e(0x030103f5), C32e(0x36123638), - C32e(0xfea3fe9f), C32e(0xe15fe1d4), C32e(0x10f91047), C32e(0x6bd06bd2), - C32e(0xa891a82e), C32e(0xe858e829), C32e(0x69276974), C32e(0xd0b9d04e), - C32e(0x483848a9), C32e(0x351335cd), C32e(0xceb3ce56), C32e(0x55335544), - C32e(0xd6bbd6bf), C32e(0x90709049), C32e(0x8089800e), C32e(0xf2a7f266), - C32e(0xc1b6c15a), C32e(0x66226678), C32e(0xad92ad2a), C32e(0x60206089), - C32e(0xdb49db15), C32e(0x1aff1a4f), C32e(0x887888a0), C32e(0x8e7a8e51), - C32e(0x8a8f8a06), C32e(0x13f813b2), C32e(0x9b809b12), C32e(0x39173934), - C32e(0x75da75ca), C32e(0x533153b5), C32e(0x51c65113), C32e(0xd3b8d3bb), - C32e(0x5ec35e1f), C32e(0xcbb0cb52), C32e(0x997799b4), C32e(0x3311333c), - C32e(0x46cb46f6), C32e(0x1ffc1f4b), C32e(0x61d661da), C32e(0x4e3a4e58) -}; - -uint32_t T3up_cpu[] = { - C32e(0x97a5c6c6), C32e(0xeb84f8f8), C32e(0xc799eeee), C32e(0xf78df6f6), - C32e(0xe50dffff), C32e(0xb7bdd6d6), C32e(0xa7b1dede), C32e(0x39549191), - C32e(0xc0506060), C32e(0x04030202), C32e(0x87a9cece), C32e(0xac7d5656), - C32e(0xd519e7e7), C32e(0x7162b5b5), C32e(0x9ae64d4d), C32e(0xc39aecec), - C32e(0x05458f8f), C32e(0x3e9d1f1f), C32e(0x09408989), C32e(0xef87fafa), - C32e(0xc515efef), C32e(0x7febb2b2), C32e(0x07c98e8e), C32e(0xed0bfbfb), - C32e(0x82ec4141), C32e(0x7d67b3b3), C32e(0xbefd5f5f), C32e(0x8aea4545), - C32e(0x46bf2323), C32e(0xa6f75353), C32e(0xd396e4e4), C32e(0x2d5b9b9b), - C32e(0xeac27575), C32e(0xd91ce1e1), C32e(0x7aae3d3d), C32e(0x986a4c4c), - C32e(0xd85a6c6c), C32e(0xfc417e7e), C32e(0xf102f5f5), C32e(0x1d4f8383), - C32e(0xd05c6868), C32e(0xa2f45151), C32e(0xb934d1d1), C32e(0xe908f9f9), - C32e(0xdf93e2e2), C32e(0x4d73abab), C32e(0xc4536262), C32e(0x543f2a2a), - C32e(0x100c0808), C32e(0x31529595), C32e(0x8c654646), C32e(0x215e9d9d), - C32e(0x60283030), C32e(0x6ea13737), C32e(0x140f0a0a), C32e(0x5eb52f2f), - C32e(0x1c090e0e), C32e(0x48362424), C32e(0x369b1b1b), C32e(0xa53ddfdf), - C32e(0x8126cdcd), C32e(0x9c694e4e), C32e(0xfecd7f7f), C32e(0xcf9feaea), - C32e(0x241b1212), C32e(0x3a9e1d1d), C32e(0xb0745858), C32e(0x682e3434), - C32e(0x6c2d3636), C32e(0xa3b2dcdc), C32e(0x73eeb4b4), C32e(0xb6fb5b5b), - C32e(0x53f6a4a4), C32e(0xec4d7676), C32e(0x7561b7b7), C32e(0xface7d7d), - C32e(0xa47b5252), C32e(0xa13edddd), C32e(0xbc715e5e), C32e(0x26971313), - C32e(0x57f5a6a6), C32e(0x6968b9b9), C32e(0x00000000), C32e(0x992cc1c1), - C32e(0x80604040), C32e(0xdd1fe3e3), C32e(0xf2c87979), C32e(0x77edb6b6), - C32e(0xb3bed4d4), C32e(0x01468d8d), C32e(0xced96767), C32e(0xe44b7272), - C32e(0x33de9494), C32e(0x2bd49898), C32e(0x7be8b0b0), C32e(0x114a8585), - C32e(0x6d6bbbbb), C32e(0x912ac5c5), C32e(0x9ee54f4f), C32e(0xc116eded), - C32e(0x17c58686), C32e(0x2fd79a9a), C32e(0xcc556666), C32e(0x22941111), - C32e(0x0fcf8a8a), C32e(0xc910e9e9), C32e(0x08060404), C32e(0xe781fefe), - C32e(0x5bf0a0a0), C32e(0xf0447878), C32e(0x4aba2525), C32e(0x96e34b4b), - C32e(0x5ff3a2a2), C32e(0xbafe5d5d), C32e(0x1bc08080), C32e(0x0a8a0505), - C32e(0x7ead3f3f), C32e(0x42bc2121), C32e(0xe0487070), C32e(0xf904f1f1), - C32e(0xc6df6363), C32e(0xeec17777), C32e(0x4575afaf), C32e(0x84634242), - C32e(0x40302020), C32e(0xd11ae5e5), C32e(0xe10efdfd), C32e(0x656dbfbf), - C32e(0x194c8181), C32e(0x30141818), C32e(0x4c352626), C32e(0x9d2fc3c3), - C32e(0x67e1bebe), C32e(0x6aa23535), C32e(0x0bcc8888), C32e(0x5c392e2e), - C32e(0x3d579393), C32e(0xaaf25555), C32e(0xe382fcfc), C32e(0xf4477a7a), - C32e(0x8bacc8c8), C32e(0x6fe7baba), C32e(0x642b3232), C32e(0xd795e6e6), - C32e(0x9ba0c0c0), C32e(0x32981919), C32e(0x27d19e9e), C32e(0x5d7fa3a3), - C32e(0x88664444), C32e(0xa87e5454), C32e(0x76ab3b3b), C32e(0x16830b0b), - C32e(0x03ca8c8c), C32e(0x9529c7c7), C32e(0xd6d36b6b), C32e(0x503c2828), - C32e(0x5579a7a7), C32e(0x63e2bcbc), C32e(0x2c1d1616), C32e(0x4176adad), - C32e(0xad3bdbdb), C32e(0xc8566464), C32e(0xe84e7474), C32e(0x281e1414), - C32e(0x3fdb9292), C32e(0x180a0c0c), C32e(0x906c4848), C32e(0x6be4b8b8), - C32e(0x255d9f9f), C32e(0x616ebdbd), C32e(0x86ef4343), C32e(0x93a6c4c4), - C32e(0x72a83939), C32e(0x62a43131), C32e(0xbd37d3d3), C32e(0xff8bf2f2), - C32e(0xb132d5d5), C32e(0x0d438b8b), C32e(0xdc596e6e), C32e(0xafb7dada), - C32e(0x028c0101), C32e(0x7964b1b1), C32e(0x23d29c9c), C32e(0x92e04949), - C32e(0xabb4d8d8), C32e(0x43faacac), C32e(0xfd07f3f3), C32e(0x8525cfcf), - C32e(0x8fafcaca), C32e(0xf38ef4f4), C32e(0x8ee94747), C32e(0x20181010), - C32e(0xded56f6f), C32e(0xfb88f0f0), C32e(0x946f4a4a), C32e(0xb8725c5c), - C32e(0x70243838), C32e(0xaef15757), C32e(0xe6c77373), C32e(0x35519797), - C32e(0x8d23cbcb), C32e(0x597ca1a1), C32e(0xcb9ce8e8), C32e(0x7c213e3e), - C32e(0x37dd9696), C32e(0xc2dc6161), C32e(0x1a860d0d), C32e(0x1e850f0f), - C32e(0xdb90e0e0), C32e(0xf8427c7c), C32e(0xe2c47171), C32e(0x83aacccc), - C32e(0x3bd89090), C32e(0x0c050606), C32e(0xf501f7f7), C32e(0x38121c1c), - C32e(0x9fa3c2c2), C32e(0xd45f6a6a), C32e(0x47f9aeae), C32e(0xd2d06969), - C32e(0x2e911717), C32e(0x29589999), C32e(0x74273a3a), C32e(0x4eb92727), - C32e(0xa938d9d9), C32e(0xcd13ebeb), C32e(0x56b32b2b), C32e(0x44332222), - C32e(0xbfbbd2d2), C32e(0x4970a9a9), C32e(0x0e890707), C32e(0x66a73333), - C32e(0x5ab62d2d), C32e(0x78223c3c), C32e(0x2a921515), C32e(0x8920c9c9), - C32e(0x15498787), C32e(0x4fffaaaa), C32e(0xa0785050), C32e(0x517aa5a5), - C32e(0x068f0303), C32e(0xb2f85959), C32e(0x12800909), C32e(0x34171a1a), - C32e(0xcada6565), C32e(0xb531d7d7), C32e(0x13c68484), C32e(0xbbb8d0d0), - C32e(0x1fc38282), C32e(0x52b02929), C32e(0xb4775a5a), C32e(0x3c111e1e), - C32e(0xf6cb7b7b), C32e(0x4bfca8a8), C32e(0xdad66d6d), C32e(0x583a2c2c) -}; - -uint32_t T3dn_cpu[] = { - C32e(0x32f4a5f4), C32e(0x6f978497), C32e(0x5eb099b0), C32e(0x7a8c8d8c), - C32e(0xe8170d17), C32e(0x0adcbddc), C32e(0x16c8b1c8), C32e(0x6dfc54fc), - C32e(0x90f050f0), C32e(0x07050305), C32e(0x2ee0a9e0), C32e(0xd1877d87), - C32e(0xcc2b192b), C32e(0x13a662a6), C32e(0x7c31e631), C32e(0x59b59ab5), - C32e(0x40cf45cf), C32e(0xa3bc9dbc), C32e(0x49c040c0), C32e(0x68928792), - C32e(0xd03f153f), C32e(0x9426eb26), C32e(0xce40c940), C32e(0xe61d0b1d), - C32e(0x6e2fec2f), C32e(0x1aa967a9), C32e(0x431cfd1c), C32e(0x6025ea25), - C32e(0xf9dabfda), C32e(0x5102f702), C32e(0x45a196a1), C32e(0x76ed5bed), - C32e(0x285dc25d), C32e(0xc5241c24), C32e(0xd4e9aee9), C32e(0xf2be6abe), - C32e(0x82ee5aee), C32e(0xbdc341c3), C32e(0xf3060206), C32e(0x52d14fd1), - C32e(0x8ce45ce4), C32e(0x5607f407), C32e(0x8d5c345c), C32e(0xe1180818), - C32e(0x4cae93ae), C32e(0x3e957395), C32e(0x97f553f5), C32e(0x6b413f41), - C32e(0x1c140c14), C32e(0x63f652f6), C32e(0xe9af65af), C32e(0x7fe25ee2), - C32e(0x48782878), C32e(0xcff8a1f8), C32e(0x1b110f11), C32e(0xebc4b5c4), - C32e(0x151b091b), C32e(0x7e5a365a), C32e(0xadb69bb6), C32e(0x98473d47), - C32e(0xa76a266a), C32e(0xf5bb69bb), C32e(0x334ccd4c), C32e(0x50ba9fba), - C32e(0x3f2d1b2d), C32e(0xa4b99eb9), C32e(0xc49c749c), C32e(0x46722e72), - C32e(0x41772d77), C32e(0x11cdb2cd), C32e(0x9d29ee29), C32e(0x4d16fb16), - C32e(0xa501f601), C32e(0xa1d74dd7), C32e(0x14a361a3), C32e(0x3449ce49), - C32e(0xdf8d7b8d), C32e(0x9f423e42), C32e(0xcd937193), C32e(0xb1a297a2), - C32e(0xa204f504), C32e(0x01b868b8), C32e(0x00000000), C32e(0xb5742c74), - C32e(0xe0a060a0), C32e(0xc2211f21), C32e(0x3a43c843), C32e(0x9a2ced2c), - C32e(0x0dd9bed9), C32e(0x47ca46ca), C32e(0x1770d970), C32e(0xafdd4bdd), - C32e(0xed79de79), C32e(0xff67d467), C32e(0x9323e823), C32e(0x5bde4ade), - C32e(0x06bd6bbd), C32e(0xbb7e2a7e), C32e(0x7b34e534), C32e(0xd73a163a), - C32e(0xd254c554), C32e(0xf862d762), C32e(0x99ff55ff), C32e(0xb6a794a7), - C32e(0xc04acf4a), C32e(0xd9301030), C32e(0x0e0a060a), C32e(0x66988198), - C32e(0xab0bf00b), C32e(0xb4cc44cc), C32e(0xf0d5bad5), C32e(0x753ee33e), - C32e(0xac0ef30e), C32e(0x4419fe19), C32e(0xdb5bc05b), C32e(0x80858a85), - C32e(0xd3ecadec), C32e(0xfedfbcdf), C32e(0xa8d848d8), C32e(0xfd0c040c), - C32e(0x197adf7a), C32e(0x2f58c158), C32e(0x309f759f), C32e(0xe7a563a5), - C32e(0x70503050), C32e(0xcb2e1a2e), C32e(0xef120e12), C32e(0x08b76db7), - C32e(0x55d44cd4), C32e(0x243c143c), C32e(0x795f355f), C32e(0xb2712f71), - C32e(0x8638e138), C32e(0xc8fda2fd), C32e(0xc74fcc4f), C32e(0x654b394b), - C32e(0x6af957f9), C32e(0x580df20d), C32e(0x619d829d), C32e(0xb3c947c9), - C32e(0x27efacef), C32e(0x8832e732), C32e(0x4f7d2b7d), C32e(0x42a495a4), - C32e(0x3bfba0fb), C32e(0xaab398b3), C32e(0xf668d168), C32e(0x22817f81), - C32e(0xeeaa66aa), C32e(0xd6827e82), C32e(0xdde6abe6), C32e(0x959e839e), - C32e(0xc945ca45), C32e(0xbc7b297b), C32e(0x056ed36e), C32e(0x6c443c44), - C32e(0x2c8b798b), C32e(0x813de23d), C32e(0x31271d27), C32e(0x379a769a), - C32e(0x964d3b4d), C32e(0x9efa56fa), C32e(0xa6d24ed2), C32e(0x36221e22), - C32e(0xe476db76), C32e(0x121e0a1e), C32e(0xfcb46cb4), C32e(0x8f37e437), - C32e(0x78e75de7), C32e(0x0fb26eb2), C32e(0x692aef2a), C32e(0x35f1a6f1), - C32e(0xdae3a8e3), C32e(0xc6f7a4f7), C32e(0x8a593759), C32e(0x74868b86), - C32e(0x83563256), C32e(0x4ec543c5), C32e(0x85eb59eb), C32e(0x18c2b7c2), - C32e(0x8e8f8c8f), C32e(0x1dac64ac), C32e(0xf16dd26d), C32e(0x723be03b), - C32e(0x1fc7b4c7), C32e(0xb915fa15), C32e(0xfa090709), C32e(0xa06f256f), - C32e(0x20eaafea), C32e(0x7d898e89), C32e(0x6720e920), C32e(0x38281828), - C32e(0x0b64d564), C32e(0x73838883), C32e(0xfbb16fb1), C32e(0xca967296), - C32e(0x546c246c), C32e(0x5f08f108), C32e(0x2152c752), C32e(0x64f351f3), - C32e(0xae652365), C32e(0x25847c84), C32e(0x57bf9cbf), C32e(0x5d632163), - C32e(0xea7cdd7c), C32e(0x1e7fdc7f), C32e(0x9c918691), C32e(0x9b948594), - C32e(0x4bab90ab), C32e(0xbac642c6), C32e(0x2657c457), C32e(0x29e5aae5), - C32e(0xe373d873), C32e(0x090f050f), C32e(0xf4030103), C32e(0x2a361236), - C32e(0x3cfea3fe), C32e(0x8be15fe1), C32e(0xbe10f910), C32e(0x026bd06b), - C32e(0xbfa891a8), C32e(0x71e858e8), C32e(0x53692769), C32e(0xf7d0b9d0), - C32e(0x91483848), C32e(0xde351335), C32e(0xe5ceb3ce), C32e(0x77553355), - C32e(0x04d6bbd6), C32e(0x39907090), C32e(0x87808980), C32e(0xc1f2a7f2), - C32e(0xecc1b6c1), C32e(0x5a662266), C32e(0xb8ad92ad), C32e(0xa9602060), - C32e(0x5cdb49db), C32e(0xb01aff1a), C32e(0xd8887888), C32e(0x2b8e7a8e), - C32e(0x898a8f8a), C32e(0x4a13f813), C32e(0x929b809b), C32e(0x23391739), - C32e(0x1075da75), C32e(0x84533153), C32e(0xd551c651), C32e(0x03d3b8d3), - C32e(0xdc5ec35e), C32e(0xe2cbb0cb), C32e(0xc3997799), C32e(0x2d331133), - C32e(0x3d46cb46), C32e(0xb71ffc1f), C32e(0x0c61d661), C32e(0x624e3a4e) -}; - -__device__ void groestl512_perm_P(uint32_t *a) -{ - uint32_t t[32]; - -//#pragma unroll 14 - for(int r=0;r<14;r++) - { -#pragma unroll 16 - for(int k=0;k<16;k++) - { - a[(k*2)+0] ^= PC32up(k * 0x10, r); - //a[(k<<1)+1] ^= PC32dn(k * 0x10, r); - } - - // RBTT -#pragma unroll 16 - for(int k=0;k<32;k+=2) - { - t[k + 0] = T0up( B32_0(a[k & 0x1f]) ) ^ - T1up( B32_1(a[(k + 2) & 0x1f]) ) ^ - T2up( B32_2(a[(k + 4) & 0x1f]) ) ^ - T3up( B32_3(a[(k + 6) & 0x1f]) ) ^ - T0dn( B32_0(a[(k + 9) & 0x1f]) ) ^ - T1dn( B32_1(a[(k + 11) & 0x1f]) ) ^ - T2dn( B32_2(a[(k + 13) & 0x1f]) ) ^ - T3dn( B32_3(a[(k + 23) & 0x1f]) ); - - t[k + 1] = T0dn( B32_0(a[k & 0x1f]) ) ^ - T1dn( B32_1(a[(k + 2) & 0x1f]) ) ^ - T2dn( B32_2(a[(k + 4) & 0x1f]) ) ^ - T3dn( B32_3(a[(k + 6) & 0x1f]) ) ^ - T0up( B32_0(a[(k + 9) & 0x1f]) ) ^ - T1up( B32_1(a[(k + 11) & 0x1f]) ) ^ - T2up( B32_2(a[(k + 13) & 0x1f]) ) ^ - T3up( B32_3(a[(k + 23) & 0x1f]) ); - } -#pragma unroll 32 - for(int k=0;k<32;k++) - a[k] = t[k]; - } -} - -__device__ void groestl512_perm_Q(uint32_t *a) -{ -//#pragma unroll 14 - for(int r=0;r<14;r++) - { - uint32_t t[32]; - -#pragma unroll 16 - for(int k=0;k<16;k++) - { - a[(k*2)+0] ^= QC32up(k * 0x10, r); - a[(k*2)+1] ^= QC32dn(k * 0x10, r); - } - - // RBTT -#pragma unroll 16 - for(int k=0;k<32;k+=2) - { - t[k + 0] = T0up( B32_0(a[(k + 2) & 0x1f]) ) ^ - T1up( B32_1(a[(k + 6) & 0x1f]) ) ^ - T2up( B32_2(a[(k + 10) & 0x1f]) ) ^ - T3up( B32_3(a[(k + 22) & 0x1f]) ) ^ - T0dn( B32_0(a[(k + 1) & 0x1f]) ) ^ - T1dn( B32_1(a[(k + 5) & 0x1f]) ) ^ - T2dn( B32_2(a[(k + 9) & 0x1f]) ) ^ - T3dn( B32_3(a[(k + 13) & 0x1f]) ); - - t[k + 1] = T0dn( B32_0(a[(k + 2) & 0x1f]) ) ^ - T1dn( B32_1(a[(k + 6) & 0x1f]) ) ^ - T2dn( B32_2(a[(k + 10) & 0x1f]) ) ^ - T3dn( B32_3(a[(k + 22) & 0x1f]) ) ^ - T0up( B32_0(a[(k + 1) & 0x1f]) ) ^ - T1up( B32_1(a[(k + 5) & 0x1f]) ) ^ - T2up( B32_2(a[(k + 9) & 0x1f]) ) ^ - T3up( B32_3(a[(k + 13) & 0x1f]) ); - } -#pragma unroll 32 - for(int k=0;k<32;k++) - a[k] = t[k]; - } -} - -template __global__ void groestl512_gpu_hash(uint32_t threads, uint32_t startNounce, void *outputHash, uint32_t *heftyHashes, uint32_t *nonceVector) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t message[32]; - uint32_t state[32]; - - // lese message ein & verknüpfe diese mit dem hash1 von hefty1 - // lese den state ein - -#pragma unroll 32 - for(int k=0;k<32;k++) - { - state[k] = groestl_gpu_state[k]; - message[k] = groestl_gpu_msg[k]; - } - - uint32_t nounce = nonceVector[thread]; - // nounce setzen - //message[19] = startNounce + thread; - message[19] = nounce; - - uint32_t hashPosition = nounce - startNounce; - - // den richtigen Hefty1 Hash holen -// memcpy(&message[21], &heftyHashes[8 * hashPosition], sizeof(uint32_t) * 8); - uint32_t *heftyHash = &heftyHashes[8 * hashPosition]; -#pragma unroll 8 - for (int k=0; k<8; ++k) - message[BLOCKSIZE/4+k] = heftyHash[k]; - - uint32_t g[32]; -#pragma unroll 32 - for(int u=0;u<32;u++) - g[u] = message[u] ^ state[u]; - - // Perm - groestl512_perm_P(g); - groestl512_perm_Q(message); - -#pragma unroll 32 - for(int u=0;u<32;u++) - { - state[u] ^= g[u] ^ message[u]; - g[u] = state[u]; - } - - groestl512_perm_P(g); - -#pragma unroll 32 - for(int u=0;u<32;u++) - state[u] ^= g[u]; - - // kopiere Ergebnis -#pragma unroll 16 - for(int k=0;k<16;k++) - ((uint32_t*)outputHash)[16*hashPosition+k] = state[k + 16]; - } -} - -#define texDef(id, texname, texmem, texsource, texsize) { \ - unsigned int *texmem; \ - cudaMalloc(&texmem, texsize); \ - d_textures[thr_id][id] = texmem; \ - cudaMemcpy(texmem, texsource, texsize, cudaMemcpyHostToDevice); \ - texname.normalized = 0; \ - texname.filterMode = cudaFilterModePoint; \ - texname.addressMode[0] = cudaAddressModeClamp; \ - { cudaChannelFormatDesc channelDesc = cudaCreateChannelDesc(); \ - cudaBindTexture(NULL, &texname, texmem, &channelDesc, texsize ); \ - } \ -} - -// Setup Function -__host__ -void groestl512_cpu_init(int thr_id, uint32_t threads) -{ - // Texturen mit obigem Makro initialisieren - texDef(0, t0up, d_T0up, T0up_cpu, sizeof(uint32_t)*256); - texDef(1, t0dn, d_T0dn, T0dn_cpu, sizeof(uint32_t)*256); - texDef(2, t1up, d_T1up, T1up_cpu, sizeof(uint32_t)*256); - texDef(3, t1dn, d_T1dn, T1dn_cpu, sizeof(uint32_t)*256); - texDef(4, t2up, d_T2up, T2up_cpu, sizeof(uint32_t)*256); - texDef(5, t2dn, d_T2dn, T2dn_cpu, sizeof(uint32_t)*256); - texDef(6, t3up, d_T3up, T3up_cpu, sizeof(uint32_t)*256); - texDef(7, t3dn, d_T3dn, T3dn_cpu, sizeof(uint32_t)*256); - - // Speicher für alle Ergebnisse belegen - cudaMalloc(&d_hash4output[thr_id], (size_t) 64 * threads); -} - -__host__ -void groestl512_cpu_free(int thr_id) -{ - for (int i=0; i <8; i++) - cudaFree(d_textures[thr_id][i]); - - cudaFree(d_hash4output[thr_id]); -} - -static int BLOCKSIZE = 84; - -__host__ -void groestl512_cpu_setBlock(void *data, int len) - // data muss 80/84-Byte haben! - // heftyHash hat 32-Byte -{ - // Nachricht expandieren und setzen - uint32_t msgBlock[32]; - - memset(msgBlock, 0, sizeof(uint32_t) * 32); - memcpy(&msgBlock[0], data, len); - - // Erweitere die Nachricht auf den Nachrichtenblock (padding) - // Unsere Nachricht hat 112/116 Byte - if (len == 84) { - msgBlock[29] = 0x80; - msgBlock[31] = 0x01000000; - } else if (len == 80) { - msgBlock[28] = 0x80; - msgBlock[31] = 0x01000000; - } - // groestl512 braucht hierfür keinen CPU-Code (die einzige Runde wird - // auf der GPU ausgeführt) - - // setze register - uint32_t groestl_state_init[32]; - memset(groestl_state_init, 0, sizeof(uint32_t) * 32); - groestl_state_init[31] = 0x20000; - - // state speichern - cudaMemcpyToSymbol(groestl_gpu_state, groestl_state_init, 128); - - // Blockheader setzen (korrekte Nonce und Hefty Hash fehlen da drin noch) - cudaMemcpyToSymbol(groestl_gpu_msg, msgBlock, 128); - BLOCKSIZE = len; -} - -__host__ void groestl512_cpu_copyHeftyHash(int thr_id, uint32_t threads, void *heftyHashes, int copy) -{ - // Hefty1 Hashes kopieren (eigentlich nur zum debuggen) - if (copy) - CUDA_SAFE_CALL(cudaMemcpy(heavy_heftyHashes[thr_id], heftyHashes, 8 * sizeof(uint32_t) * threads, cudaMemcpyHostToDevice)); -} - -__host__ void groestl512_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce) -{ - const uint32_t threadsperblock = 128; - - // berechne wie viele Thread Blocks wir brauchen - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - // Größe des dynamischen Shared Memory Bereichs - size_t shared_size = 0; - - if (BLOCKSIZE == 84) - groestl512_gpu_hash<84><<>>(threads, startNounce, d_hash4output[thr_id], heavy_heftyHashes[thr_id], heavy_nonceVector[thr_id]); - else if (BLOCKSIZE == 80) - groestl512_gpu_hash<80><<>>(threads, startNounce, d_hash4output[thr_id], heavy_heftyHashes[thr_id], heavy_nonceVector[thr_id]); -} diff --git a/heavy/cuda_hefty1.cu b/heavy/cuda_hefty1.cu deleted file mode 100644 index 7700acc0..00000000 --- a/heavy/cuda_hefty1.cu +++ /dev/null @@ -1,447 +0,0 @@ -#include -#include - -#include "miner.h" - -#include "cuda_helper.h" - -#define USE_SHARED 1 - -// globaler Speicher für alle HeftyHashes aller Threads -uint32_t *heavy_heftyHashes[MAX_GPUS]; - -/* Hash-Tabellen */ -__constant__ uint32_t hefty_gpu_constantTable[64]; -#if USE_SHARED -#define heftyLookUp(x) (*((uint32_t*)heftytab + (x))) -#else -#define heftyLookUp(x) hefty_gpu_constantTable[x] -#endif - -// muss expandiert werden -__constant__ uint32_t hefty_gpu_blockHeader[16]; // 2x512 Bit Message -__constant__ uint32_t hefty_gpu_register[8]; -__constant__ uint32_t hefty_gpu_sponge[4]; - -uint32_t hefty_cpu_hashTable[] = { - 0x6a09e667UL, - 0xbb67ae85UL, - 0x3c6ef372UL, - 0xa54ff53aUL, - 0x510e527fUL, - 0x9b05688cUL, - 0x1f83d9abUL, - 0x5be0cd19UL -}; - -uint32_t hefty_cpu_constantTable[] = { - 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, - 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, - 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, - 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, - 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, - 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, - 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, - 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, - 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, - 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, - 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, - 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, - 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, - 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, - 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, - 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL -}; - -#if 0 -#define S(x, n) (((x) >> (n)) | ((x) << (32 - (n)))) -#else -__host__ __device__ -static uint32_t S(uint32_t x, int n) -{ - return (((x) >> (n)) | ((x) << (32 - (n)))); -} -#endif - -#define R(x, n) ((x) >> (n)) -#define Ch(x, y, z) ((x & (y ^ z)) ^ z) -#define Maj(x, y, z) ((x & (y | z)) | (y & z)) -#define S0(x) (S(x, 2) ^ S(x, 13) ^ S(x, 22)) -#define S1(x) (S(x, 6) ^ S(x, 11) ^ S(x, 25)) -#define s0(x) (S(x, 7) ^ S(x, 18) ^ R(x, 3)) -#define s1(x) (S(x, 17) ^ S(x, 19) ^ R(x, 10)) - -#define SWAB32(x) ( ((x & 0x000000FF) << 24) | ((x & 0x0000FF00) << 8) | ((x & 0x00FF0000) >> 8) | ((x & 0xFF000000) >> 24) ) - -// uint8_t -#define smoosh4(x) ( ((x)>>4) ^ ((x) & 0x0F) ) - -__host__ __forceinline__ __device__ -uint8_t smoosh2(uint32_t x) -{ - uint16_t w = (x >> 16) ^ (x & 0xffff); - uint8_t n = smoosh4( (uint8_t)( (w >> 8) ^ (w & 0xFF) ) ); - return 24 - (((n >> 2) ^ (n & 0x03)) << 3); -} -// 4 auf einmal -#define smoosh4Quad(x) ( (((x)>>4) ^ (x)) & 0x0F0F0F0F ) -#define getByte(x,y) ( ((x) >> (y)) & 0xFF ) - -__host__ __forceinline__ __device__ -void Mangle(uint32_t *inp) -{ - uint32_t r = smoosh4Quad(inp[0]); - uint32_t inp0org; - uint32_t tmp0Mask, tmp1Mask; - uint32_t in1, in2, isAddition; - int32_t tmp; - uint8_t b; - - inp[1] = inp[1] ^ S(inp[0], getByte(r, 24)); - - r += 0x01010101; - tmp = smoosh2(inp[1]); - b = getByte(r,tmp); - inp0org = S(inp[0], b); - tmp0Mask = (uint32_t) -((tmp >> 3) & 1); // Bit 3 an Position 0 - tmp1Mask = (uint32_t) -((tmp >> 4) & 1); // Bit 4 an Position 0 - - in1 = (inp[2] & ~inp0org) | - (tmp1Mask & ~inp[2] & inp0org) | - (~tmp0Mask & ~inp[2] & inp0org); - in2 = inp[2] += ~inp0org; - isAddition = ~tmp0Mask & tmp1Mask; - inp[2] = isAddition ? in2 : in1; - - r += 0x01010101; - tmp = smoosh2(inp[1] ^ inp[2]); - b = getByte(r,tmp); - inp0org = S(inp[0], b); - tmp0Mask = (uint32_t) -((tmp >> 3) & 1); // Bit 3 an Position 0 - tmp1Mask = (uint32_t) -((tmp >> 4) & 1); // Bit 4 an Position 0 - - in1 = (inp[3] & ~inp0org) | - (tmp1Mask & ~inp[3] & inp0org) | - (~tmp0Mask & ~inp[3] & inp0org); - in2 = inp[3] += ~inp0org; - isAddition = ~tmp0Mask & tmp1Mask; - inp[3] = isAddition ? in2 : in1; - - inp[0] ^= (inp[1] ^ inp[2]) + inp[3]; -} - -__host__ __forceinline__ __device__ -void Absorb(uint32_t *inp, uint32_t x) -{ - inp[0] ^= x; - Mangle(inp); -} - -__host__ __forceinline__ __device__ -uint32_t Squeeze(uint32_t *inp) -{ - uint32_t y = inp[0]; - Mangle(inp); - return y; -} - -__host__ __forceinline__ __device__ -uint32_t Br(uint32_t *sponge, uint32_t x) -{ - uint32_t r = Squeeze(sponge); - uint32_t t = ((r >> 8) & 0x1F); - uint32_t y = 1 << t; - - uint32_t a = (((r>>1) & 0x01) << t) & y; - uint32_t b = ((r & 0x01) << t) & y; - uint32_t c = x & y; - - uint32_t retVal = (x & ~y) | (~b & c) | (a & ~c); - return retVal; -} - -__device__ __forceinline__ -void hefty_gpu_round(uint32_t *regs, uint32_t W, uint32_t K, uint32_t *sponge) -{ - uint32_t tmpBr; - - uint32_t brG = Br(sponge, regs[6]); - uint32_t brF = Br(sponge, regs[5]); - uint32_t tmp1 = Ch(regs[4], brF, brG) + regs[7] + W + K; - uint32_t brE = Br(sponge, regs[4]); - uint32_t tmp2 = tmp1 + S1(brE); - uint32_t brC = Br(sponge, regs[2]); - uint32_t brB = Br(sponge, regs[1]); - uint32_t brA = Br(sponge, regs[0]); - uint32_t tmp3 = Maj(brA, brB, brC); - tmpBr = Br(sponge, regs[0]); - uint32_t tmp4 = tmp3 + S0(tmpBr); - tmpBr = Br(sponge, tmp2); - - #pragma unroll 7 - for (int k=6; k >= 0; k--) regs[k+1] = regs[k]; - regs[0] = tmp2 + tmp4; - regs[4] += tmpBr; -} - -__host__ -void hefty_cpu_round(uint32_t *regs, uint32_t W, uint32_t K, uint32_t *sponge) -{ - uint32_t tmpBr; - - uint32_t brG = Br(sponge, regs[6]); - uint32_t brF = Br(sponge, regs[5]); - uint32_t tmp1 = Ch(regs[4], brF, brG) + regs[7] + W + K; - uint32_t brE = Br(sponge, regs[4]); - uint32_t tmp2 = tmp1 + S1(brE); - uint32_t brC = Br(sponge, regs[2]); - uint32_t brB = Br(sponge, regs[1]); - uint32_t brA = Br(sponge, regs[0]); - uint32_t tmp3 = Maj(brA, brB, brC); - tmpBr = Br(sponge, regs[0]); - uint32_t tmp4 = tmp3 + S0(tmpBr); - tmpBr = Br(sponge, tmp2); - - for (int k=6; k >= 0; k--) regs[k+1] = regs[k]; - regs[0] = tmp2 + tmp4; - regs[4] += tmpBr; -} - -__global__ -void hefty_gpu_hash(uint32_t threads, uint32_t startNounce, uint32_t *outputHash) -{ -#if USE_SHARED - extern __shared__ unsigned char heftytab[]; - if(threadIdx.x < 64) - { - *((uint32_t*)heftytab + threadIdx.x) = hefty_gpu_constantTable[threadIdx.x]; - } - - __syncthreads(); -#endif - - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - // bestimme den aktuellen Zähler - uint32_t nounce = startNounce + thread; - - // jeder thread in diesem Block bekommt sein eigenes W Array im Shared memory - // reduktion von 256 byte auf 128 byte - uint32_t W1[16]; - uint32_t W2[16]; - - // Initialisiere die register a bis h mit der Hash-Tabelle - uint32_t regs[8]; - uint32_t hash[8]; - uint32_t sponge[4]; - -#pragma unroll 4 - for(int k=0; k < 4; k++) - sponge[k] = hefty_gpu_sponge[k]; - - // pre -#pragma unroll 8 - for (int k=0; k < 8; k++) - { - regs[k] = hefty_gpu_register[k]; - hash[k] = regs[k]; - } - - //memcpy(W, &hefty_gpu_blockHeader[0], sizeof(uint32_t) * 16); // verbleibende 20 bytes aus Block 2 plus padding -#pragma unroll 16 - for(int k=0;k<16;k++) - W1[k] = hefty_gpu_blockHeader[k]; - W1[3] = SWAB32(nounce); - - // 2. Runde -#pragma unroll 16 - for(int j=0;j<16;j++) - Absorb(sponge, W1[j] ^ heftyLookUp(j)); - -// Progress W1 (Bytes 0...63) -#pragma unroll 16 - for(int j=0;j<16;j++) - { - Absorb(sponge, regs[3] ^ regs[7]); - hefty_gpu_round(regs, W1[j], heftyLookUp(j), sponge); - } - -// Progress W2 (Bytes 64...127) then W3 (Bytes 128...191) ... - - - for(int k=0;k<3;k++) - { - - for(int j=0;j<2;j++) - W2[j] = s1(W1[14+j]) + W1[9+j] + s0(W1[1+j]) + W1[j]; - - for(int j=2;j<7;j++) - W2[j] = s1(W2[j-2]) + W1[9+j] + s0(W1[1+j]) + W1[j]; - - - for(int j=7;j<15;j++) - W2[j] = s1(W2[j-2]) + W2[j-7] + s0(W1[1+j]) + W1[j]; - - W2[15] = s1(W2[13]) + W2[8] + s0(W2[0]) + W1[15]; - - - for(int j=0;j<16;j++) - { - Absorb(sponge, regs[3] + regs[7]); - hefty_gpu_round(regs, W2[j], heftyLookUp(j + ((k+1)<<4)), sponge); - } - - for(int j=0;j<16;j++) - W1[j] = W2[j]; - } - -#pragma unroll 8 - for(int k=0;k<8;k++) - hash[k] += regs[k]; - -#pragma unroll 8 - for(int k=0;k<8;k++) - ((uint32_t*)outputHash)[(thread<<3)+k] = SWAB32(hash[k]); - } -} - -__host__ -void hefty_cpu_init(int thr_id, uint32_t threads) -{ - cudaSetDevice(device_map[thr_id]); - - // Kopiere die Hash-Tabellen in den GPU-Speicher - cudaMemcpyToSymbol( hefty_gpu_constantTable, - hefty_cpu_constantTable, - sizeof(uint32_t) * 64 ); - - // Speicher für alle Hefty1 hashes belegen - CUDA_SAFE_CALL(cudaMalloc(&heavy_heftyHashes[thr_id], (size_t) 32 * threads)); -} - -__host__ -void hefty_cpu_free(int thr_id) -{ - cudaFree(heavy_heftyHashes[thr_id]); -} - -__host__ -void hefty_cpu_setBlock(int thr_id, uint32_t threads, void *data, int len) -// data muss 80/84-Byte haben! -{ - // Nachricht expandieren und setzen - uint32_t msgBlock[32]; - - memset(msgBlock, 0, sizeof(msgBlock)); - memcpy(&msgBlock[0], data, len); - if (len == 84) { - msgBlock[21] |= 0x80; - msgBlock[31] = 672; // bitlen - } else if (len == 80) { - msgBlock[20] |= 0x80; - msgBlock[31] = 640; // bitlen - } - - for(int i=0;i<31;i++) // Byteorder drehen - msgBlock[i] = SWAB32(msgBlock[i]); - - // die erste Runde wird auf der CPU durchgeführt, da diese für - // alle Threads gleich ist. Der Hash wird dann an die Threads - // übergeben - - // Erstelle expandierten Block W - uint32_t W[64]; - memcpy(W, &msgBlock[0], sizeof(uint32_t) * 16); - for(int j=16;j<64;j++) - W[j] = s1(W[j-2]) + W[j-7] + s0(W[j-15]) + W[j-16]; - - // Initialisiere die register a bis h mit der Hash-Tabelle - uint32_t regs[8]; - uint32_t hash[8]; - uint32_t sponge[4]; - - // pre - memset(sponge, 0, sizeof(uint32_t) * 4); - for (int k=0; k < 8; k++) - { - regs[k] = hefty_cpu_hashTable[k]; - hash[k] = regs[k]; - } - - // 1. Runde - for(int j=0;j<16;j++) - Absorb(sponge, W[j] ^ hefty_cpu_constantTable[j]); - - for(int j=0;j<16;j++) - { - Absorb(sponge, regs[3] ^ regs[7]); - hefty_cpu_round(regs, W[j], hefty_cpu_constantTable[j], sponge); - } - - for(int j=16;j<64;j++) - { - Absorb(sponge, regs[3] + regs[7]); - hefty_cpu_round(regs, W[j], hefty_cpu_constantTable[j], sponge); - } - - for(int k=0;k<8;k++) - hash[k] += regs[k]; - - // sponge speichern - cudaMemcpyToSymbol(hefty_gpu_sponge, sponge, 16); - // hash speichern - cudaMemcpyToSymbol(hefty_gpu_register, hash, 32); - // Blockheader setzen (korrekte Nonce fehlt da drin noch) - CUDA_SAFE_CALL(cudaMemcpyToSymbol(hefty_gpu_blockHeader, &msgBlock[16], 64)); -} - -__host__ -void hefty_cpu_hash(int thr_id, uint32_t threads, int startNounce) -{ - uint32_t threadsperblock = 256; - - // berechne wie viele Thread Blocks wir brauchen - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - // Größe des dynamischen Shared Memory Bereichs -#if USE_SHARED - int shared_size = 8 * 64 * sizeof(uint32_t); -#else - int shared_size = 0; -#endif - - hefty_gpu_hash <<< grid, block, shared_size >>> (threads, startNounce, heavy_heftyHashes[thr_id]); - - // Strategisches Sleep Kommando zur Senkung der CPU Last - MyStreamSynchronize(NULL, 0, thr_id); -} - -__global__ -__launch_bounds__(128, 8) -void hefty_gpu_copy(const uint32_t threads, uint32_t* d_heftyhash, uint64_t* d_hash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const uint32_t offset = thread * 8U; // 32 / sizeof(uint32_t); - uint4 *psrc = (uint4*) (&d_heftyhash[offset]); - uint4 *pdst = (uint4*) (&d_hash[offset]); - pdst[0] = psrc[0]; - pdst[1] = psrc[1]; - pdst[2] = make_uint4(0,0,0,0); - pdst[3] = make_uint4(0,0,0,0); - } -} - -__host__ -void hefty_copy_hashes(int thr_id, uint32_t threads, uint32_t* d_outputhash) -{ - const uint32_t threadsperblock = 128; - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - hefty_gpu_copy <<< grid, block >>> (threads, heavy_heftyHashes[thr_id], (uint64_t*) d_outputhash); - cudaStreamSynchronize(NULL); -} - diff --git a/heavy/cuda_keccak512.cu b/heavy/cuda_keccak512.cu deleted file mode 100644 index 3e94f162..00000000 --- a/heavy/cuda_keccak512.cu +++ /dev/null @@ -1,285 +0,0 @@ -#include -#include - -#include "cuda_helper.h" - -// globaler Speicher für alle HeftyHashes aller Threads -extern uint32_t *heavy_heftyHashes[MAX_GPUS]; -extern uint32_t *heavy_nonceVector[MAX_GPUS]; - -// globaler Speicher für unsere Ergebnisse -uint32_t *d_hash3output[MAX_GPUS]; -extern uint32_t *d_hash4output[MAX_GPUS]; -extern uint32_t *d_hash5output[MAX_GPUS]; - -// der Keccak512 State nach der ersten Runde (72 Bytes) -__constant__ uint64_t c_State[25]; - -// die Message (72 Bytes) für die zweite Runde auf der GPU -__constant__ uint32_t c_PaddedMessage2[18]; // 44 bytes of remaining message (Nonce at offset 4) plus padding - -// ---------------------------- BEGIN CUDA keccak512 functions ------------------------------------ - -#define U32TO64_LE(p) \ - (((uint64_t)(*p)) | (((uint64_t)(*(p + 1))) << 32)) - -#define U64TO32_LE(p, v) \ - *p = (uint32_t)((v)); *(p+1) = (uint32_t)((v) >> 32); - -static __device__ void mycpy72(uint32_t *d, const uint32_t *s) { - #pragma unroll 18 - for (int k=0; k < 18; ++k) d[k] = s[k]; -} - -static __device__ void mycpy32(uint32_t *d, const uint32_t *s) { - #pragma unroll 8 - for (int k=0; k < 8; ++k) d[k] = s[k]; -} - -typedef struct keccak_hash_state_t { - uint64_t state[25]; // 25*2 - uint32_t buffer[72/4]; // 72 -} keccak_hash_state; - -__device__ void statecopy(uint64_t *d, uint64_t *s) -{ - #pragma unroll 25 - for (int i=0; i < 25; ++i) - d[i] = s[i]; -} - - -static const uint64_t host_keccak_round_constants[24] = { - 0x0000000000000001ull, 0x0000000000008082ull, - 0x800000000000808aull, 0x8000000080008000ull, - 0x000000000000808bull, 0x0000000080000001ull, - 0x8000000080008081ull, 0x8000000000008009ull, - 0x000000000000008aull, 0x0000000000000088ull, - 0x0000000080008009ull, 0x000000008000000aull, - 0x000000008000808bull, 0x800000000000008bull, - 0x8000000000008089ull, 0x8000000000008003ull, - 0x8000000000008002ull, 0x8000000000000080ull, - 0x000000000000800aull, 0x800000008000000aull, - 0x8000000080008081ull, 0x8000000000008080ull, - 0x0000000080000001ull, 0x8000000080008008ull -}; - -__constant__ uint64_t c_keccak_round_constants[24]; - -__host__ __device__ void -keccak_block(uint64_t *s, const uint32_t *in, const uint64_t *keccak_round_constants) { - size_t i; - uint64_t t[5], u[5], v, w; - - /* absorb input */ - for (i = 0; i < 9 /* 72/8 */; i++, in += 2) - s[i] ^= U32TO64_LE(in); - - for (i = 0; i < 24; i++) { - /* theta: c = a[0,i] ^ a[1,i] ^ .. a[4,i] */ - t[0] = s[0] ^ s[5] ^ s[10] ^ s[15] ^ s[20]; - t[1] = s[1] ^ s[6] ^ s[11] ^ s[16] ^ s[21]; - t[2] = s[2] ^ s[7] ^ s[12] ^ s[17] ^ s[22]; - t[3] = s[3] ^ s[8] ^ s[13] ^ s[18] ^ s[23]; - t[4] = s[4] ^ s[9] ^ s[14] ^ s[19] ^ s[24]; - - /* theta: d[i] = c[i+4] ^ rotl(c[i+1],1) */ - u[0] = t[4] ^ ROTL64(t[1], 1); - u[1] = t[0] ^ ROTL64(t[2], 1); - u[2] = t[1] ^ ROTL64(t[3], 1); - u[3] = t[2] ^ ROTL64(t[4], 1); - u[4] = t[3] ^ ROTL64(t[0], 1); - - /* theta: a[0,i], a[1,i], .. a[4,i] ^= d[i] */ - s[0] ^= u[0]; s[5] ^= u[0]; s[10] ^= u[0]; s[15] ^= u[0]; s[20] ^= u[0]; - s[1] ^= u[1]; s[6] ^= u[1]; s[11] ^= u[1]; s[16] ^= u[1]; s[21] ^= u[1]; - s[2] ^= u[2]; s[7] ^= u[2]; s[12] ^= u[2]; s[17] ^= u[2]; s[22] ^= u[2]; - s[3] ^= u[3]; s[8] ^= u[3]; s[13] ^= u[3]; s[18] ^= u[3]; s[23] ^= u[3]; - s[4] ^= u[4]; s[9] ^= u[4]; s[14] ^= u[4]; s[19] ^= u[4]; s[24] ^= u[4]; - - /* rho pi: b[..] = rotl(a[..], ..) */ - v = s[ 1]; - s[ 1] = ROTL64(s[ 6], 44); - s[ 6] = ROTL64(s[ 9], 20); - s[ 9] = ROTL64(s[22], 61); - s[22] = ROTL64(s[14], 39); - s[14] = ROTL64(s[20], 18); - s[20] = ROTL64(s[ 2], 62); - s[ 2] = ROTL64(s[12], 43); - s[12] = ROTL64(s[13], 25); - s[13] = ROTL64(s[19], 8); - s[19] = ROTL64(s[23], 56); - s[23] = ROTL64(s[15], 41); - s[15] = ROTL64(s[ 4], 27); - s[ 4] = ROTL64(s[24], 14); - s[24] = ROTL64(s[21], 2); - s[21] = ROTL64(s[ 8], 55); - s[ 8] = ROTL64(s[16], 45); - s[16] = ROTL64(s[ 5], 36); - s[ 5] = ROTL64(s[ 3], 28); - s[ 3] = ROTL64(s[18], 21); - s[18] = ROTL64(s[17], 15); - s[17] = ROTL64(s[11], 10); - s[11] = ROTL64(s[ 7], 6); - s[ 7] = ROTL64(s[10], 3); - s[10] = ROTL64( v, 1); - - /* chi: a[i,j] ^= ~b[i,j+1] & b[i,j+2] */ - v = s[ 0]; w = s[ 1]; s[ 0] ^= (~w) & s[ 2]; s[ 1] ^= (~s[ 2]) & s[ 3]; s[ 2] ^= (~s[ 3]) & s[ 4]; s[ 3] ^= (~s[ 4]) & v; s[ 4] ^= (~v) & w; - v = s[ 5]; w = s[ 6]; s[ 5] ^= (~w) & s[ 7]; s[ 6] ^= (~s[ 7]) & s[ 8]; s[ 7] ^= (~s[ 8]) & s[ 9]; s[ 8] ^= (~s[ 9]) & v; s[ 9] ^= (~v) & w; - v = s[10]; w = s[11]; s[10] ^= (~w) & s[12]; s[11] ^= (~s[12]) & s[13]; s[12] ^= (~s[13]) & s[14]; s[13] ^= (~s[14]) & v; s[14] ^= (~v) & w; - v = s[15]; w = s[16]; s[15] ^= (~w) & s[17]; s[16] ^= (~s[17]) & s[18]; s[17] ^= (~s[18]) & s[19]; s[18] ^= (~s[19]) & v; s[19] ^= (~v) & w; - v = s[20]; w = s[21]; s[20] ^= (~w) & s[22]; s[21] ^= (~s[22]) & s[23]; s[22] ^= (~s[23]) & s[24]; s[23] ^= (~s[24]) & v; s[24] ^= (~v) & w; - - /* iota: a[0,0] ^= round constant */ - s[0] ^= keccak_round_constants[i]; - } -} - -// Die Hash-Funktion -template __global__ void keccak512_gpu_hash(uint32_t threads, uint32_t startNounce, void *outputHash, uint32_t *heftyHashes, uint32_t *nonceVector) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - // bestimme den aktuellen Zähler - //uint32_t nounce = startNounce + thread; - uint32_t nounce = nonceVector[thread]; - - // Index-Position des Hashes in den Hash Puffern bestimmen (Hefty1 und outputHash) - uint32_t hashPosition = nounce - startNounce; - - // erstmal den State der ersten Runde holen - uint64_t keccak_gpu_state[25]; -#pragma unroll 25 - for (int i=0; i < 25; ++i) - keccak_gpu_state[i] = c_State[i]; - - // Message2 in den Puffer holen - uint32_t msgBlock[18]; - mycpy72(msgBlock, c_PaddedMessage2); - - // die individuelle Nonce einsetzen - msgBlock[1] = nounce; - - // den individuellen Hefty1 Hash einsetzen - mycpy32(&msgBlock[(BLOCKSIZE-72)/sizeof(uint32_t)], &heftyHashes[8 * hashPosition]); - - // den Block einmal gut durchschütteln - keccak_block(keccak_gpu_state, msgBlock, c_keccak_round_constants); - - // das Hash erzeugen - uint32_t hash[16]; - -#pragma unroll 8 - for (size_t i = 0; i < 64; i += 8) { - U64TO32_LE((&hash[i/4]), keccak_gpu_state[i / 8]); - } - - // und ins Global Memory rausschreiben -#pragma unroll 16 - for(int k=0;k<16;k++) - ((uint32_t*)outputHash)[16*hashPosition+k] = hash[k]; - } -} - -// ---------------------------- END CUDA keccak512 functions ------------------------------------ - -__host__ -void keccak512_cpu_init(int thr_id, uint32_t threads) -{ - // Kopiere die Hash-Tabellen in den GPU-Speicher - cudaMemcpyToSymbol( c_keccak_round_constants, - host_keccak_round_constants, - sizeof(host_keccak_round_constants), - 0, cudaMemcpyHostToDevice); - - // Speicher für alle Ergebnisse belegen - cudaMalloc(&d_hash3output[thr_id], (size_t) 64 * threads); -} - -__host__ -void keccak512_cpu_free(int thr_id) -{ - cudaFree(d_hash3output[thr_id]); -} - -// ----------------BEGIN keccak512 CPU version from scrypt-jane code -------------------- - -#define SCRYPT_HASH_DIGEST_SIZE 64 -#define SCRYPT_KECCAK_F 1600 -#define SCRYPT_KECCAK_C (SCRYPT_HASH_DIGEST_SIZE * 8 * 2) /* 1024 */ -#define SCRYPT_KECCAK_R (SCRYPT_KECCAK_F - SCRYPT_KECCAK_C) /* 576 */ -#define SCRYPT_HASH_BLOCK_SIZE (SCRYPT_KECCAK_R / 8) /* 72 */ - -// --------------- END keccak512 CPU version from scrypt-jane code -------------------- - -static int BLOCKSIZE = 84; - -__host__ -void keccak512_cpu_setBlock(void *data, int len) - // data muss 80 oder 84-Byte haben! - // heftyHash hat 32-Byte -{ - // CH - // state init - uint64_t keccak_cpu_state[25]; - memset(keccak_cpu_state, 0, sizeof(keccak_cpu_state)); - - // erste Runde - keccak_block((uint64_t*)&keccak_cpu_state, (const uint32_t*)data, host_keccak_round_constants); - - // state kopieren - cudaMemcpyToSymbol( c_State, keccak_cpu_state, 25*sizeof(uint64_t), 0, cudaMemcpyHostToDevice); - - // keccak hat 72-Byte blöcke, d.h. in unserem Fall zwei Blöcke - // zu jeweils - uint32_t msgBlock[18]; - memset(msgBlock, 0, 18 * sizeof(uint32_t)); - - // kopiere die restlichen Daten rein (aber nur alles nach Byte 72) - if (len == 84) - memcpy(&msgBlock[0], &((uint8_t*)data)[72], 12); - else if (len == 80) - memcpy(&msgBlock[0], &((uint8_t*)data)[72], 8); - - // Nachricht abschließen - if (len == 84) - msgBlock[11] = 0x01; - else if (len == 80) - msgBlock[10] = 0x01; - msgBlock[17] = 0x80000000; - - // Message 2 ins Constant Memory kopieren (die variable Nonce und - // der Hefty1 Anteil muss aber auf der GPU erst noch ersetzt werden) - cudaMemcpyToSymbol( c_PaddedMessage2, msgBlock, 18*sizeof(uint32_t), 0, cudaMemcpyHostToDevice ); - - BLOCKSIZE = len; -} - -__host__ -void keccak512_cpu_copyHeftyHash(int thr_id, uint32_t threads, void *heftyHashes, int copy) -{ - // Hefty1 Hashes kopieren - if (copy) - CUDA_SAFE_CALL(cudaMemcpy(heavy_heftyHashes[thr_id], heftyHashes, 8 * sizeof(uint32_t) * threads, cudaMemcpyHostToDevice)); - //else cudaThreadSynchronize(); -} - -__host__ -void keccak512_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce) -{ - const uint32_t threadsperblock = 128; - - // berechne wie viele Thread Blocks wir brauchen - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - // Größe des dynamischen Shared Memory Bereichs - size_t shared_size = 0; - - if (BLOCKSIZE==84) - keccak512_gpu_hash<84><<>>(threads, startNounce, d_hash3output[thr_id], heavy_heftyHashes[thr_id], heavy_nonceVector[thr_id]); - else if (BLOCKSIZE==80) - keccak512_gpu_hash<80><<>>(threads, startNounce, d_hash3output[thr_id], heavy_heftyHashes[thr_id], heavy_nonceVector[thr_id]); -} diff --git a/heavy/cuda_sha256.cu b/heavy/cuda_sha256.cu deleted file mode 100644 index 7441621b..00000000 --- a/heavy/cuda_sha256.cu +++ /dev/null @@ -1,282 +0,0 @@ -#include -#include - -#include "cuda_helper.h" - -// globaler Speicher für alle HeftyHashes aller Threads -extern uint32_t *heavy_heftyHashes[MAX_GPUS]; -extern uint32_t *heavy_nonceVector[MAX_GPUS]; - -// globaler Speicher für unsere Ergebnisse -uint32_t *d_hash2output[MAX_GPUS]; - - -/* Hash-Tabellen */ -__constant__ uint32_t sha256_gpu_constantTable[64]; - -// muss expandiert werden -__constant__ uint32_t sha256_gpu_blockHeader[16]; // 2x512 Bit Message -__constant__ uint32_t sha256_gpu_register[8]; - -uint32_t sha256_cpu_hashTable[] = { 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 }; -uint32_t sha256_cpu_constantTable[] = { - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2, -}; - -#define S(x, n) (((x) >> (n)) | ((x) << (32 - (n)))) -#define R(x, n) ((x) >> (n)) -#define Ch(x, y, z) ((x & (y ^ z)) ^ z) -#define Maj(x, y, z) ((x & (y | z)) | (y & z)) -#define S0(x) (S(x, 2) ^ S(x, 13) ^ S(x, 22)) -#define S1(x) (S(x, 6) ^ S(x, 11) ^ S(x, 25)) -#define s0(x) (S(x, 7) ^ S(x, 18) ^ R(x, 3)) -#define s1(x) (S(x, 17) ^ S(x, 19) ^ R(x, 10)) - -#define SWAB32(x) ( ((x & 0x000000FF) << 24) | ((x & 0x0000FF00) << 8) | ((x & 0x00FF0000) >> 8) | ((x & 0xFF000000) >> 24) ) - -// Die Hash-Funktion -template __global__ void sha256_gpu_hash(uint32_t threads, uint32_t startNounce, void *outputHash, uint32_t *heftyHashes, uint32_t *nonceVector) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - // bestimme den aktuellen Zähler - uint32_t nounce = startNounce + thread; - nonceVector[thread] = nounce; - - // jeder thread in diesem Block bekommt sein eigenes W Array im Shared memory - uint32_t W1[16]; - uint32_t W2[16]; - - // Initialisiere die register a bis h mit der Hash-Tabelle - uint32_t regs[8]; - uint32_t hash[8]; - - // pre -#pragma unroll 8 - for (int k=0; k < 8; k++) - { - regs[k] = sha256_gpu_register[k]; - hash[k] = regs[k]; - } - - // 2. Runde - //memcpy(W, &sha256_gpu_blockHeader[0], sizeof(uint32_t) * 16); // TODO: aufsplitten in zwei Teilblöcke - //memcpy(&W[5], &heftyHashes[8 * (blockDim.x * blockIdx.x + threadIdx.x)], sizeof(uint32_t) * 8); // den richtigen Hefty1 Hash holen -#pragma unroll 16 - for(int k=0;k<16;k++) - W1[k] = sha256_gpu_blockHeader[k]; - - uint32_t offset = 8 * (blockDim.x * blockIdx.x + threadIdx.x); -#pragma unroll 8 - for(int k=0;k<8;k++) - W1[((BLOCKSIZE-64)/4)+k] = heftyHashes[offset + k]; - -#pragma unroll 8 - for (int i=((BLOCKSIZE-64)/4); i < ((BLOCKSIZE-64)/4)+8; ++i) W1[i] = SWAB32(W1[i]); // die Hefty1 Hashes brauchen eine Drehung ;) - W1[3] = SWAB32(nounce); - -// Progress W1 -#pragma unroll 16 - for(int j=0;j<16;j++) - { - uint32_t T1, T2; - T1 = regs[7] + S1(regs[4]) + Ch(regs[4], regs[5], regs[6]) + sha256_gpu_constantTable[j] + W1[j]; - T2 = S0(regs[0]) + Maj(regs[0], regs[1], regs[2]); - - #pragma unroll 7 - for (int k=6; k >= 0; k--) regs[k+1] = regs[k]; - regs[0] = T1 + T2; - regs[4] += T1; - } - -// Progress W2...W3 -#pragma unroll 3 - for(int k=0;k<3;k++) - { - #pragma unroll 2 - for(int j=0;j<2;j++) - W2[j] = s1(W1[14+j]) + W1[9+j] + s0(W1[1+j]) + W1[j]; - #pragma unroll 5 - for(int j=2;j<7;j++) - W2[j] = s1(W2[j-2]) + W1[9+j] + s0(W1[1+j]) + W1[j]; - - #pragma unroll 8 - for(int j=7;j<15;j++) - W2[j] = s1(W2[j-2]) + W2[j-7] + s0(W1[1+j]) + W1[j]; - - W2[15] = s1(W2[13]) + W2[8] + s0(W2[0]) + W1[15]; - - // Rundenfunktion - #pragma unroll 16 - for(int j=0;j<16;j++) - { - uint32_t T1, T2; - T1 = regs[7] + S1(regs[4]) + Ch(regs[4], regs[5], regs[6]) + sha256_gpu_constantTable[j + 16 * (k+1)] + W2[j]; - T2 = S0(regs[0]) + Maj(regs[0], regs[1], regs[2]); - - #pragma unroll 7 - for (int l=6; l >= 0; l--) regs[l+1] = regs[l]; - regs[0] = T1 + T2; - regs[4] += T1; - } - - #pragma unroll 16 - for(int j=0;j<16;j++) - W1[j] = W2[j]; - } - -/* - for(int j=16;j<64;j++) - W[j] = s1(W[j-2]) + W[j-7] + s0(W[j-15]) + W[j-16]; - -#pragma unroll 64 - for(int j=0;j<64;j++) - { - uint32_t T1, T2; - T1 = regs[7] + S1(regs[4]) + Ch(regs[4], regs[5], regs[6]) + sha256_gpu_constantTable[j] + W[j]; - T2 = S0(regs[0]) + Maj(regs[0], regs[1], regs[2]); - - #pragma unroll 7 - for (int k=6; k >= 0; k--) regs[k+1] = regs[k]; - regs[0] = T1 + T2; - regs[4] += T1; - } -*/ -#pragma unroll 8 - for(int k=0;k<8;k++) - hash[k] += regs[k]; - -#pragma unroll 8 - for(int k=0;k<8;k++) - ((uint32_t*)outputHash)[8*thread+k] = SWAB32(hash[k]); - } -} - -// Setup Function -__host__ -void sha256_cpu_init(int thr_id, uint32_t threads) -{ - // Kopiere die Hash-Tabellen in den GPU-Speicher - cudaMemcpyToSymbol( sha256_gpu_constantTable, - sha256_cpu_constantTable, - sizeof(uint32_t) * 64 ); - - // Speicher für alle Ergebnisse belegen - cudaMalloc(&d_hash2output[thr_id], (size_t) 8 * sizeof(uint32_t) * threads); -} - -__host__ -void sha256_cpu_free(int thr_id) -{ - cudaFree(d_hash2output[thr_id]); -} - -static int BLOCKSIZE = 84; - -__host__ void sha256_cpu_setBlock(void *data, int len) - // data muss 80/84-Byte haben! - // heftyHash hat 32-Byte -{ - // Nachricht expandieren und setzen - uint32_t msgBlock[32]; - - memset(msgBlock, 0, sizeof(uint32_t) * 32); - memcpy(&msgBlock[0], data, len); - if (len == 84) { - memset(&msgBlock[21], 0, 32); // vorläufig Nullen anstatt der Hefty1 Hashes einfüllen - msgBlock[29] |= 0x80; - msgBlock[31] = 928; // bitlen - } else if (len == 80) { - memset(&msgBlock[20], 0, 32); // vorläufig Nullen anstatt der Hefty1 Hashes einfüllen - msgBlock[28] |= 0x80; - msgBlock[31] = 896; // bitlen - } - - for(int i=0;i<31;i++) // Byteorder drehen - msgBlock[i] = SWAB32(msgBlock[i]); - - // die erste Runde wird auf der CPU durchgeführt, da diese für - // alle Threads gleich ist. Der Hash wird dann an die Threads - // übergeben - uint32_t W[64]; - - // Erstelle expandierten Block W - memcpy(W, &msgBlock[0], sizeof(uint32_t) * 16); - for(int j=16;j<64;j++) - W[j] = s1(W[j-2]) + W[j-7] + s0(W[j-15]) + W[j-16]; - - // Initialisiere die register a bis h mit der Hash-Tabelle - uint32_t regs[8]; - uint32_t hash[8]; - - // pre - for (int k=0; k < 8; k++) - { - regs[k] = sha256_cpu_hashTable[k]; - hash[k] = regs[k]; - } - - // 1. Runde - for(int j=0;j<64;j++) - { - uint32_t T1, T2; - T1 = regs[7] + S1(regs[4]) + Ch(regs[4], regs[5], regs[6]) + sha256_cpu_constantTable[j] + W[j]; - T2 = S0(regs[0]) + Maj(regs[0], regs[1], regs[2]); - - //#pragma unroll 7 - for (int k=6; k >= 0; k--) regs[k+1] = regs[k]; - // sollte mal noch durch memmov ersetzt werden! -// memcpy(®s[1], ®s[0], sizeof(uint32_t) * 7); - regs[0] = T1 + T2; - regs[4] += T1; - } - - for(int k=0;k<8;k++) - hash[k] += regs[k]; - - // hash speichern - cudaMemcpyToSymbol( sha256_gpu_register, - hash, - sizeof(uint32_t) * 8 ); - - // Blockheader setzen (korrekte Nonce und Hefty Hash fehlen da drin noch) - cudaMemcpyToSymbol( sha256_gpu_blockHeader, - &msgBlock[16], - 64); - - BLOCKSIZE = len; -} - -__host__ void sha256_cpu_copyHeftyHash(int thr_id, uint32_t threads, void *heftyHashes, int copy) -{ - // Hefty1 Hashes kopieren - if (copy) - CUDA_SAFE_CALL(cudaMemcpy(heavy_heftyHashes[thr_id], heftyHashes, 8 * sizeof(uint32_t) * threads, cudaMemcpyHostToDevice)); - //else cudaThreadSynchronize(); -} - -__host__ void sha256_cpu_hash(int thr_id, uint32_t threads, int startNounce) -{ - const uint32_t threadsperblock = 256; - - // berechne wie viele Thread Blocks wir brauchen - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - // Größe des dynamischen Shared Memory Bereichs - size_t shared_size = 0; - - if (BLOCKSIZE == 84) - sha256_gpu_hash<84><<>>(threads, startNounce, d_hash2output[thr_id], heavy_heftyHashes[thr_id], heavy_nonceVector[thr_id]); - else if (BLOCKSIZE == 80) { - sha256_gpu_hash<80><<>>(threads, startNounce, d_hash2output[thr_id], heavy_heftyHashes[thr_id], heavy_nonceVector[thr_id]); - } -} diff --git a/heavy/heavy.cu b/heavy/heavy.cu deleted file mode 100644 index a5349c26..00000000 --- a/heavy/heavy.cu +++ /dev/null @@ -1,422 +0,0 @@ -#include -#include -#include -#include - -#ifndef WITH_HEAVY_ALGO -#include -#include "miner.h" -// nonce array also used in other algos -uint32_t *heavy_nonceVector[MAX_GPUS]; -int scanhash_heavy(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done, uint32_t maxvote, int blocklen) -{ - applog(LOG_ERR, "heavy algo not included in this build!"); - sleep(3); - return -1; -} -void free_heavy(int thr_id) {} - -#else - -// include thrust if possible -#if defined(__GNUC__) && __GNUC__ == 5 && __GNUC_MINOR__ >= 2 && CUDA_VERSION < 7000 -#warning "Heavy: incompatible GCC version!" -#define USE_THRUST 0 -#else -#define USE_THRUST 1 -#endif - -#if USE_THRUST -#include -#include -#endif - -#include "miner.h" -#include "cuda_helper.h" - -// nonce array also used in other algos -uint32_t *heavy_nonceVector[MAX_GPUS]; - -extern uint32_t *d_hash2output[MAX_GPUS]; -extern uint32_t *d_hash3output[MAX_GPUS]; -extern uint32_t *d_hash4output[MAX_GPUS]; -extern uint32_t *d_hash5output[MAX_GPUS]; - -#define HEAVYCOIN_BLKHDR_SZ 84 -#define MNR_BLKHDR_SZ 80 - -extern uint32_t *heavy_heftyHashes[MAX_GPUS]; - -#ifdef _MSC_VER -#include -static uint32_t __inline bitsset( uint32_t x ) -{ - DWORD r = 0; - _BitScanReverse(&r, x); - return r; -} -#else -static uint32_t bitsset( uint32_t x ) -{ - return 31-__builtin_clz(x); -} -#endif - -// Finde das high bit in einem Multiword-Integer. -static int findhighbit(const uint32_t *ptarget, int words) -{ - int i; - int highbit = 0; - for (i=words-1; i >= 0; --i) - { - if (ptarget[i] != 0) { - highbit = i*32 + bitsset(ptarget[i])+1; - break; - } - } - return highbit; -} - -// Generiere ein Multiword-Integer das die Zahl -// (2 << highbit) - 1 repräsentiert. -static void genmask(uint32_t *ptarget, int words, int highbit) -{ - int i; - for (i=words-1; i >= 0; --i) - { - if ((i+1)*32 <= highbit) - ptarget[i] = UINT32_MAX; - else if (i*32 > highbit) - ptarget[i] = 0x00000000; - else - ptarget[i] = (1 << (highbit-i*32)) - 1; - } -} - -struct check_nonce_for_remove -{ - check_nonce_for_remove(uint64_t target, uint32_t *hashes, uint32_t hashlen, uint32_t startNonce) : - m_target(target), - m_hashes(hashes), - m_hashlen(hashlen), - m_startNonce(startNonce) { } - - uint64_t m_target; - uint32_t *m_hashes; - uint32_t m_hashlen; - uint32_t m_startNonce; - - __device__ - bool operator()(const uint32_t x) - { - // Position im Hash Buffer - uint32_t hashIndex = x - m_startNonce; - // Wert des Hashes (als uint64_t) auslesen. - // Steht im 6. und 7. Wort des Hashes (jeder dieser Hashes hat 512 Bits) - uint64_t hashValue = *((uint64_t*)(&m_hashes[m_hashlen*hashIndex + 6])); - bool res = (hashValue & m_target) != hashValue; - //printf("ndx=%x val=%08x target=%lx\n", hashIndex, hashValue, m_target); - // gegen das Target prüfen. Es dürfen nur Bits aus dem Target gesetzt sein. - return res; - } -}; - -static bool init[MAX_GPUS] = { 0 }; - -__host__ -int scanhash_heavy(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done, uint32_t maxvote, int blocklen) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - // CUDA will process thousands of threads. - uint32_t throughput = cuda_default_throughput(thr_id, (1U << 19) - 256); - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - int rc = 0; - uint32_t *hash = NULL; - uint32_t *cpu_nonceVector = NULL; - - int nrmCalls[6]; - memset(nrmCalls, 0, sizeof(int) * 6); - - if (opt_benchmark) - ptarget[7] = 0x000f; - - // für jeden Hash ein individuelles Target erstellen basierend - // auf dem höchsten Bit, das in ptarget gesetzt ist. - int highbit = findhighbit(ptarget, 8); - uint32_t target2[2], target3[2], target4[2], target5[2]; - genmask(target2, 2, highbit/4+(((highbit%4)>3)?1:0) ); // SHA256 - genmask(target3, 2, highbit/4+(((highbit%4)>2)?1:0) ); // keccak512 - genmask(target4, 2, highbit/4+(((highbit%4)>1)?1:0) ); // groestl512 - genmask(target5, 2, highbit/4+(((highbit%4)>0)?1:0) ); // blake512 - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - hefty_cpu_init(thr_id, throughput); - sha256_cpu_init(thr_id, throughput); - keccak512_cpu_init(thr_id, throughput); - groestl512_cpu_init(thr_id, throughput); - blake512_cpu_init(thr_id, throughput); - combine_cpu_init(thr_id, throughput); - - CUDA_SAFE_CALL(cudaMalloc(&heavy_nonceVector[thr_id], sizeof(uint32_t) * throughput)); - - init[thr_id] = true; - } - - // weird but require at least one cudaSetDevice first - CUDA_SAFE_CALL(cudaMallocHost(&hash, (size_t) 32 * throughput)); - CUDA_SAFE_CALL(cudaMallocHost(&cpu_nonceVector, sizeof(uint32_t) * throughput)); - - if (blocklen == HEAVYCOIN_BLKHDR_SZ) - { - uint16_t *ext = (uint16_t*) &pdata[20]; - - if (opt_vote > maxvote && !opt_benchmark) { - applog(LOG_WARNING, "Your block reward vote (%hu) exceeds the maxvote reported by the pool (%hu).", - opt_vote, maxvote); - } - - if (opt_trust_pool && opt_vote > maxvote) { - applog(LOG_WARNING, "Capping block reward vote to maxvote reported by pool."); - ext[0] = maxvote; - } - else - ext[0] = opt_vote; - } - - // Setze die Blockdaten - hefty_cpu_setBlock(thr_id, throughput, pdata, blocklen); - sha256_cpu_setBlock(pdata, blocklen); - keccak512_cpu_setBlock(pdata, blocklen); - groestl512_cpu_setBlock(pdata, blocklen); - blake512_cpu_setBlock(pdata, blocklen); - - do { - uint32_t actualNumberOfValuesInNonceVectorGPU = throughput; - - ////// Compaction init - - hefty_cpu_hash(thr_id, throughput, pdata[19]); - sha256_cpu_hash(thr_id, throughput, pdata[19]); - - // Hier ist die längste CPU Wartephase. Deshalb ein strategisches MyStreamSynchronize() hier. - MyStreamSynchronize(NULL, 1, thr_id); - -#if USE_THRUST - thrust::device_ptr devNoncePtr(heavy_nonceVector[thr_id]); - thrust::device_ptr devNoncePtrEnd((heavy_nonceVector[thr_id]) + throughput); - - ////// Compaction - uint64_t *t = (uint64_t*) target2; - devNoncePtrEnd = thrust::remove_if(devNoncePtr, devNoncePtrEnd, check_nonce_for_remove(*t, d_hash2output[thr_id], 8, pdata[19])); - actualNumberOfValuesInNonceVectorGPU = (uint32_t)(devNoncePtrEnd - devNoncePtr); - if(actualNumberOfValuesInNonceVectorGPU == 0) - goto emptyNonceVector; - - keccak512_cpu_hash(thr_id, actualNumberOfValuesInNonceVectorGPU, pdata[19]); - - ////// Compaction - t = (uint64_t*) target3; - devNoncePtrEnd = thrust::remove_if(devNoncePtr, devNoncePtrEnd, check_nonce_for_remove(*t, d_hash3output[thr_id], 16, pdata[19])); - actualNumberOfValuesInNonceVectorGPU = (uint32_t)(devNoncePtrEnd - devNoncePtr); - if(actualNumberOfValuesInNonceVectorGPU == 0) - goto emptyNonceVector; - - blake512_cpu_hash(thr_id, actualNumberOfValuesInNonceVectorGPU, pdata[19]); - - ////// Compaction - t = (uint64_t*) target5; - devNoncePtrEnd = thrust::remove_if(devNoncePtr, devNoncePtrEnd, check_nonce_for_remove(*t, d_hash5output[thr_id], 16, pdata[19])); - actualNumberOfValuesInNonceVectorGPU = (uint32_t)(devNoncePtrEnd - devNoncePtr); - if(actualNumberOfValuesInNonceVectorGPU == 0) - goto emptyNonceVector; - - groestl512_cpu_hash(thr_id, actualNumberOfValuesInNonceVectorGPU, pdata[19]); - - ////// Compaction - t = (uint64_t*) target4; - devNoncePtrEnd = thrust::remove_if(devNoncePtr, devNoncePtrEnd, check_nonce_for_remove(*t, d_hash4output[thr_id], 16, pdata[19])); - actualNumberOfValuesInNonceVectorGPU = (uint32_t)(devNoncePtrEnd - devNoncePtr); -#else - // todo (nvlabs cub ?) - actualNumberOfValuesInNonceVectorGPU = 0; -#endif - if(actualNumberOfValuesInNonceVectorGPU == 0) - goto emptyNonceVector; - - // combine - combine_cpu_hash(thr_id, actualNumberOfValuesInNonceVectorGPU, pdata[19], hash); - - if (opt_tracegpu) { - applog(LOG_BLUE, "heavy GPU hash:"); - applog_hash((uchar*)hash); - } - - // Ergebnisse kopieren - if(actualNumberOfValuesInNonceVectorGPU > 0) - { - size_t size = sizeof(uint32_t) * actualNumberOfValuesInNonceVectorGPU; - cudaMemcpy(cpu_nonceVector, heavy_nonceVector[thr_id], size, cudaMemcpyDeviceToHost); - - for (uint32_t i=0; i < actualNumberOfValuesInNonceVectorGPU; i++) - { - uint32_t nonce = cpu_nonceVector[i]; - uint32_t *foundhash = &hash[8*i]; - if (foundhash[7] <= ptarget[7] && fulltest(foundhash, ptarget)) { - uint32_t vhash[8]; - pdata[19] += nonce - pdata[19]; - heavycoin_hash((uchar*)vhash, (uchar*)pdata, blocklen); - if (memcmp(vhash, foundhash, 32)) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", nonce); - } else { - work_set_target_ratio(work, vhash); - rc = 1; - goto exit; - } - } - } - } - -emptyNonceVector: - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - -exit: - *hashes_done = pdata[19] - first_nonce; - - cudaFreeHost(cpu_nonceVector); - cudaFreeHost(hash); - CUDA_LOG_ERROR(); - - return rc; -} - -// cleanup -extern "C" void free_heavy(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(heavy_nonceVector[thr_id]); - - blake512_cpu_free(thr_id); - groestl512_cpu_free(thr_id); - hefty_cpu_free(thr_id); - keccak512_cpu_free(thr_id); - sha256_cpu_free(thr_id); - combine_cpu_free(thr_id); - - init[thr_id] = false; - - cudaDeviceSynchronize(); -} - -#endif - -extern "C" { -#include "sph/sph_keccak.h" -#include "sph/sph_blake.h" -#include "sph/sph_groestl.h" -} -#include "hefty1.h" -#include "heavy/heavy.h" - -/* Combines top 64-bits from each hash into a single hash */ -__host__ -static void combine_hashes(uint32_t *out, const uint32_t *hash1, const uint32_t *hash2, const uint32_t *hash3, const uint32_t *hash4) -{ - const uint32_t *hash[4] = { hash1, hash2, hash3, hash4 }; - int bits; - unsigned int i; - uint32_t mask; - unsigned int k; - - /* Transpose first 64 bits of each hash into out */ - memset(out, 0, 32); - bits = 0; - for (i = 7; i >= 6; i--) { - for (mask = 0x80000000; mask; mask >>= 1) { - for (k = 0; k < 4; k++) { - out[(255 - bits) / 32] <<= 1; - if ((hash[k][i] & mask) != 0) - out[(255 - bits) / 32] |= 1; - bits++; - } - } - } -} - -// CPU hash function -__host__ -void heavycoin_hash(uchar* output, const uchar* input, int len) -{ - unsigned char hash1[32]; - unsigned char hash2[32]; - uint32_t hash3[16]; - uint32_t hash4[16]; - uint32_t hash5[16]; - uint32_t *final; - SHA256_CTX ctx; - sph_keccak512_context keccakCtx; - sph_groestl512_context groestlCtx; - sph_blake512_context blakeCtx; - - HEFTY1(input, len, hash1); - - /* HEFTY1 is new, so take an extra security measure to eliminate - * the possiblity of collisions: - * - * Hash(x) = SHA256(x + HEFTY1(x)) - * - * N.B. '+' is concatenation. - */ - SHA256_Init(&ctx); - SHA256_Update(&ctx, input, len); - SHA256_Update(&ctx, hash1, sizeof(hash1)); - SHA256_Final(hash2, &ctx); - - /* Additional security: Do not rely on a single cryptographic hash - * function. Instead, combine the outputs of 4 of the most secure - * cryptographic hash functions-- SHA256, KECCAK512, GROESTL512 - * and BLAKE512. - */ - - sph_keccak512_init(&keccakCtx); - sph_keccak512(&keccakCtx, input, len); - sph_keccak512(&keccakCtx, hash1, sizeof(hash1)); - sph_keccak512_close(&keccakCtx, (void *)&hash3); - - sph_groestl512_init(&groestlCtx); - sph_groestl512(&groestlCtx, input, len); - sph_groestl512(&groestlCtx, hash1, sizeof(hash1)); - sph_groestl512_close(&groestlCtx, (void *)&hash4); - - sph_blake512_init(&blakeCtx); - sph_blake512(&blakeCtx, input, len); - sph_blake512(&blakeCtx, (unsigned char *)&hash1, sizeof(hash1)); - sph_blake512_close(&blakeCtx, (void *)&hash5); - - final = (uint32_t *)output; - combine_hashes(final, (uint32_t *)hash2, hash3, hash4, hash5); -} diff --git a/heavy/heavy.h b/heavy/heavy.h deleted file mode 100644 index 50affc40..00000000 --- a/heavy/heavy.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _CUDA_HEAVY_H -#define _CUDA_HEAVY_H - -void blake512_cpu_init(int thr_id, uint32_t threads); -void blake512_cpu_setBlock(void *pdata, int len); -void blake512_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce); -void blake512_cpu_free(int thr_id); - -void groestl512_cpu_init(int thr_id, uint32_t threads); -void groestl512_cpu_copyHeftyHash(int thr_id, uint32_t threads, void *heftyHashes, int copy); -void groestl512_cpu_setBlock(void *data, int len); -void groestl512_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce); -void groestl512_cpu_free(int thr_id); - -void hefty_cpu_hash(int thr_id, uint32_t threads, int startNounce); -void hefty_cpu_setBlock(int thr_id, uint32_t threads, void *data, int len); -void hefty_cpu_init(int thr_id, uint32_t threads); -void hefty_cpu_free(int thr_id); - -void keccak512_cpu_init(int thr_id, uint32_t threads); -void keccak512_cpu_setBlock(void *data, int len); -void keccak512_cpu_copyHeftyHash(int thr_id, uint32_t threads, void *heftyHashes, int copy); -void keccak512_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce); -void keccak512_cpu_free(int thr_id); - -void sha256_cpu_init(int thr_id, uint32_t threads); -void sha256_cpu_setBlock(void *data, int len); -void sha256_cpu_hash(int thr_id, uint32_t threads, int startNounce); -void sha256_cpu_copyHeftyHash(int thr_id, uint32_t threads, void *heftyHashes, int copy); -void sha256_cpu_free(int thr_id); - -void combine_cpu_init(int thr_id, uint32_t threads); -void combine_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *hash); -void combine_cpu_free(int thr_id); - -#endif diff --git a/hefty1.c b/hefty1.c deleted file mode 100644 index 208f0bd6..00000000 --- a/hefty1.c +++ /dev/null @@ -1,371 +0,0 @@ -/* - * HEFTY1 CPU-only cryptographic hash function - * - * Copyright (c) 2014, dbcc14 - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those - * of the authors and should not be interpreted as representing official policies, - * either expressed or implied, of the FreeBSD Project. - */ - -#include -#include - -#include "hefty1.h" - -#ifdef WIN32 -#define inline __inline -#endif - -#define Min(A, B) (A <= B ? A : B) - -#define RoundFunc(ctx, A, B, C, D, E, F, G, H, W, K) \ - { \ - /* To thwart parallelism, Br modifies itself each time it's \ - * called. This also means that calling it in different \ - * orders yeilds different results. In C the order of \ - * evaluation of function arguments and + operands are \ - * unspecified (and depends on the compiler), so we must make \ - * the order of Br calls explicit. \ - */ \ - uint32_t brG = Br(ctx, G); \ - uint32_t tmp1 = Ch(E, Br(ctx, F), brG) + H + W + K; \ - uint32_t tmp2 = tmp1 + Sigma1(Br(ctx, E)); \ - uint32_t brC = Br(ctx, C); \ - uint32_t brB = Br(ctx, B); \ - uint32_t tmp3 = Ma(Br(ctx, A), brB, brC); \ - uint32_t tmp4 = tmp3 + Sigma0(Br(ctx, A)); \ - H = G; \ - G = F; \ - F = E; \ - E = D + Br(ctx, tmp2); \ - D = C; \ - C = B; \ - B = A; \ - A = tmp2 + tmp4; \ - } \ - -/* Nothing up my sleeve constants */ -const static uint32_t K[64] = { - 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, - 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, - 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, - 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, - 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, - 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, - 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, - 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, - 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, - 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, - 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, - 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, - 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, - 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, - 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, - 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL -}; - -/* Initial hash values */ -const static uint32_t H[HEFTY1_STATE_WORDS] = { - 0x6a09e667UL, - 0xbb67ae85UL, - 0x3c6ef372UL, - 0xa54ff53aUL, - 0x510e527fUL, - 0x9b05688cUL, - 0x1f83d9abUL, - 0x5be0cd19UL -}; - -static inline uint32_t Rr(uint32_t X, uint8_t n) -{ - return (X >> n) | (X << (32 - n)); -} - -static inline uint32_t Ch(uint32_t E, uint32_t F, uint32_t G) -{ - return (E & F) ^ (~E & G); -} - -static inline uint32_t Sigma1(uint32_t E) -{ - return Rr(E, 6) ^ Rr(E, 11) ^ Rr(E, 25); -} - -static inline uint32_t sigma1(uint32_t X) -{ - return Rr(X, 17) ^ Rr(X, 19) ^ (X >> 10); -} - -static inline uint32_t Ma(uint32_t A, uint32_t B, uint32_t C) -{ - return (A & B) ^ (A & C) ^ (B & C); -} - -static inline uint32_t Sigma0(uint32_t A) -{ - return Rr(A, 2) ^ Rr(A, 13) ^ Rr(A, 22); -} - -static inline uint32_t sigma0(uint32_t X) -{ - return Rr(X, 7) ^ Rr(X, 18) ^ (X >> 3); -} - -static inline uint32_t Reverse32(uint32_t n) -{ - #if BYTE_ORDER == LITTLE_ENDIAN - return n << 24 | (n & 0x0000ff00) << 8 | (n & 0x00ff0000) >> 8 | n >> 24; - #else - return n; - #endif -} - -static inline uint64_t Reverse64(uint64_t n) -{ - #if BYTE_ORDER == LITTLE_ENDIAN - uint32_t a = n >> 32; - uint32_t b = (n << 32) >> 32; - - return (uint64_t)Reverse32(b) << 32 | Reverse32(a); - #else - return n; - #endif -} - -/* Smoosh byte into nibble */ -static inline uint8_t Smoosh4(uint8_t X) -{ - return (X >> 4) ^ (X & 0xf); -} - -/* Smoosh 32-bit word into 2-bits */ -static inline uint8_t Smoosh2(uint32_t X) -{ - uint16_t w = (X >> 16) ^ (X & 0xffff); - uint8_t n = Smoosh4((w >> 8) ^ (w & 0xff)); - return (n >> 2) ^ (n & 0x3); -} -#include -static void Mangle(uint32_t *S) -{ - uint8_t r0 = Smoosh4(S[0] >> 24); - uint8_t r1 = Smoosh4(S[0] >> 16); - uint8_t r2 = Smoosh4(S[0] >> 8); - uint8_t r3 = Smoosh4(S[0] & 0xff); - - /* Diffuse */ - S[1] ^= Rr(S[0], r0); - switch (Smoosh2(S[1])) { - case 0: S[2] ^= Rr(S[0], 1 + r0); break; - case 1: S[2] += Rr(~S[0], 1 + r1); break; - case 2: S[2] &= Rr(~S[0], 1 + r2); break; - case 3: S[2] ^= Rr(S[0], 1 + r3); break; - } - switch (Smoosh2(S[1] ^ S[2])) { - case 0: S[3] ^= Rr(S[0], 2 + r0); break; - case 1: S[3] += Rr(~S[0], 2 + r1); break; - case 2: S[3] &= Rr(~S[0], 2 + r2); break; - case 3: S[3] ^= Rr(S[0], 2 + r3); break; - } - - /* Compress */ - S[0] ^= (S[1] ^ S[2]) + S[3]; -} - -static void Absorb(uint32_t *S, uint32_t X) -{ - uint32_t *R = S; - R[0] ^= X; - Mangle(S); -} - -static uint32_t Squeeze(uint32_t *S) -{ - uint32_t Y = S[0]; - Mangle(S); - return Y; -} - -/* Branch, compress and serialize function */ -static inline uint32_t Br(HEFTY1_CTX *ctx, uint32_t X) -{ - uint32_t R = Squeeze(ctx->sponge); - - uint8_t r0 = R >> 8; - uint8_t r1 = R & 0xff; - - uint32_t Y = 1 << (r0 % 32); - - switch (r1 % 4) - { - case 0: - /* Do nothing */ - break; - case 1: - return X & ~Y; - case 2: - return X | Y; - case 3: - return X ^ Y; - } - - return X; -} - -static void HashBlock(HEFTY1_CTX *ctx) -{ - uint32_t A, B, C, D, E, F, G, H; - uint32_t W[HEFTY1_BLOCK_BYTES]; - int t; - - assert(ctx); - - A = ctx->h[0]; - B = ctx->h[1]; - C = ctx->h[2]; - D = ctx->h[3]; - E = ctx->h[4]; - F = ctx->h[5]; - G = ctx->h[6]; - H = ctx->h[7]; - - t = 0; - for (; t < 16; t++) { - W[t] = Reverse32(((uint32_t *)&ctx->block[0])[t]); /* To host byte order */ - Absorb(ctx->sponge, W[t] ^ K[t]); - } - - for (t = 0; t < 16; t++) { - Absorb(ctx->sponge, D ^ H); - RoundFunc(ctx, A, B, C, D, E, F, G, H, W[t], K[t]); - } - for (t = 16; t < 64; t++) { - Absorb(ctx->sponge, H + D); - W[t] = sigma1(W[t - 2]) + W[t - 7] + sigma0(W[t - 15]) + W[t - 16]; - RoundFunc(ctx, A, B, C, D, E, F, G, H, W[t], K[t]); - } - - ctx->h[0] += A; - ctx->h[1] += B; - ctx->h[2] += C; - ctx->h[3] += D; - ctx->h[4] += E; - ctx->h[5] += F; - ctx->h[6] += G; - ctx->h[7] += H; - - A = 0; - B = 0; - C = 0; - D = 0; - E = 0; - F = 0; - G = 0; - H = 0; - - memset(W, 0, sizeof(W)); -} - -/* Public interface */ - -void HEFTY1_Init(HEFTY1_CTX *ctx) -{ - assert(ctx); - - memcpy(ctx->h, H, sizeof(ctx->h)); - memset(ctx->block, 0, sizeof(ctx->block)); - ctx->written = 0; - memset(ctx->sponge, 0, sizeof(ctx->sponge)); -} - -void HEFTY1_Update(HEFTY1_CTX *ctx, const void *buf, size_t len) -{ - uint64_t read; - assert(ctx); - - read = 0; - while (len) { - uint64_t end = ctx->written % HEFTY1_BLOCK_BYTES; - uint64_t count = Min(len, HEFTY1_BLOCK_BYTES - end); - memcpy(&ctx->block[end], &((unsigned char *)buf)[read], (size_t)count); - len -= (size_t)count; - read += count; - ctx->written += count; - if (!(ctx->written % HEFTY1_BLOCK_BYTES)) - HashBlock(ctx); - } -} - -void HEFTY1_Final(unsigned char *digest, HEFTY1_CTX *ctx) -{ - uint64_t used; - uint64_t *len; - int i; - assert(digest); - assert(ctx); - - /* Pad message (FIPS 180 Section 5.1.1) */ - used = ctx->written % HEFTY1_BLOCK_BYTES; - ctx->block[used++] = 0x80; /* Append 1 to end of message */ - if (used > HEFTY1_BLOCK_BYTES - 8) { - /* We have already written into the last 64bits, so - * we must continue into the next block. */ - memset(&ctx->block[used], 0, HEFTY1_BLOCK_BYTES - (size_t)used); - HashBlock(ctx); - used = 0; /* Create a new block (below) */ - } - - /* All remaining bits to zero */ - memset(&ctx->block[used], 0, HEFTY1_BLOCK_BYTES - 8 - (size_t)used); - - /* The last 64bits encode the length (in network byte order) */ - len = (uint64_t *)&ctx->block[HEFTY1_BLOCK_BYTES - 8]; - *len = Reverse64(ctx->written*8); - - HashBlock(ctx); - - /* Convert back to network byte order */ - i = 0; - for (; i < HEFTY1_STATE_WORDS; i++) - ctx->h[i] = Reverse32(ctx->h[i]); - - memcpy(digest, ctx->h, sizeof(ctx->h)); - memset(ctx, 0, sizeof(HEFTY1_CTX)); -} - -unsigned char* HEFTY1(const unsigned char *buf, size_t len, unsigned char *digest) -{ - HEFTY1_CTX ctx; - static unsigned char m[HEFTY1_DIGEST_BYTES]; - - if (!digest) - digest = m; - - HEFTY1_Init(&ctx); - HEFTY1_Update(&ctx, buf, len); - HEFTY1_Final(digest, &ctx); - - return digest; -} diff --git a/hefty1.h b/hefty1.h deleted file mode 100644 index 6610fbd4..00000000 --- a/hefty1.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * HEFTY1 CPU-only cryptographic hash function - * - * Copyright (c) 2014, dbcc14 - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those - * of the authors and should not be interpreted as representing official policies, - * either expressed or implied, of the FreeBSD Project. - */ - -#ifndef __HEFTY1_H__ -#define __HEFTY1_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef WIN32 -#include -#endif - -#include - -#define HEFTY1_DIGEST_BYTES 32 -#define HEFTY1_BLOCK_BYTES 64 -#define HEFTY1_STATE_WORDS 8 -#define HEFTY1_SPONGE_WORDS 4 - -typedef struct HEFTY1_CTX { - uint32_t h[HEFTY1_STATE_WORDS]; - uint8_t block[HEFTY1_BLOCK_BYTES]; - uint64_t written; - uint32_t sponge[HEFTY1_SPONGE_WORDS]; -} HEFTY1_CTX; - -void HEFTY1_Init(HEFTY1_CTX *cxt); -void HEFTY1_Update(HEFTY1_CTX *cxt, const void *data, size_t len); -void HEFTY1_Final(unsigned char *digest, HEFTY1_CTX *cxt); -unsigned char* HEFTY1(const unsigned char *data, size_t len, unsigned char *digest); - -#ifdef __cplusplus -} -#endif - -#endif /* __HEFTY1_H__ */ diff --git a/lbry/cuda_lbry_merged.cu b/lbry/cuda_lbry_merged.cu deleted file mode 100644 index c140350b..00000000 --- a/lbry/cuda_lbry_merged.cu +++ /dev/null @@ -1,1062 +0,0 @@ -/* - * LBRY merged kernel CUDA implementation. - * For compute 5.2 and beyond gpus - * tpruvot and Provos Alexis - Sep 2016 - * Sponsored by LBRY.IO team - */ - -#include -#include -#include - -#include -#include - -#include - -__constant__ static uint32_t _ALIGN(16) c_midstate112[8]; -__constant__ static uint32_t _ALIGN(16) c_midbuffer112[8]; -__constant__ static uint32_t _ALIGN(16) c_dataEnd112[12]; - -__constant__ static const uint32_t c_H256[8] = { - 0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19 -}; -__constant__ static uint32_t _ALIGN(8) c_K[64] = { - 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, - 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, - 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC, 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, - 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967, - 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, - 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, - 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, - 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2 -}; - -#ifdef __INTELLISENSE__ -#define atomicExch(p,y) y -#define __byte_perm(x,y,z) x -#endif - -// ------------------------------------------------------------------------------------------------ - -static const uint32_t cpu_H256[8] = { - 0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19 -}; - -static const uint32_t cpu_K[64] = { - 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, - 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, - 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC, 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, - 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967, - 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, - 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, - 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, - 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2 -}; - -__host__ -static void sha256_step1_host(uint32_t a, uint32_t b, uint32_t c, uint32_t &d, uint32_t e, uint32_t f, uint32_t g, uint32_t &h, uint32_t in, const uint32_t Kshared) -{ - uint32_t vxandx = (((f) ^ (g)) & (e)) ^ (g); // xandx(e, f, g); - uint32_t bsg21 = ROTR32(e, 6) ^ ROTR32(e, 11) ^ ROTR32(e, 25); // bsg2_1(e); - uint32_t bsg20 = ROTR32(a, 2) ^ ROTR32(a, 13) ^ ROTR32(a, 22); //bsg2_0(a); - uint32_t andorv = ((b) & (c)) | (((b) | (c)) & (a)); //andor32(a,b,c); - uint32_t t1 = h + bsg21 + vxandx + Kshared + in; - uint32_t t2 = bsg20 + andorv; - d = d + t1; - h = t1 + t2; -} - -__host__ -static void sha256_step2_host(uint32_t a, uint32_t b, uint32_t c, uint32_t &d, - uint32_t e, uint32_t f, uint32_t g, uint32_t &h, uint32_t* in, uint32_t pc, const uint32_t Kshared) -{ - int pcidx1 = (pc-2) & 0xF; - int pcidx2 = (pc-7) & 0xF; - int pcidx3 = (pc-15) & 0xF; - - uint32_t inx0 = in[pc]; - uint32_t inx1 = in[pcidx1]; - uint32_t inx2 = in[pcidx2]; - uint32_t inx3 = in[pcidx3]; - - uint32_t ssg21 = ROTR32(inx1, 17) ^ ROTR32(inx1, 19) ^ SPH_T32((inx1) >> 10); //ssg2_1(inx1); - uint32_t ssg20 = ROTR32(inx3, 7) ^ ROTR32(inx3, 18) ^ SPH_T32((inx3) >> 3); //ssg2_0(inx3); - uint32_t vxandx = (((f) ^ (g)) & (e)) ^ (g); // xandx(e, f, g); - uint32_t bsg21 = ROTR32(e, 6) ^ ROTR32(e, 11) ^ ROTR32(e, 25); // bsg2_1(e); - uint32_t bsg20 = ROTR32(a, 2) ^ ROTR32(a, 13) ^ ROTR32(a, 22); //bsg2_0(a); - uint32_t andorv = ((b) & (c)) | (((b) | (c)) & (a)); //andor32(a,b,c); - uint32_t t1,t2; - - in[pc] = ssg21 + inx2 + ssg20 + inx0; - - t1 = h + bsg21 + vxandx + Kshared + in[pc]; - t2 = bsg20 + andorv; - d = d + t1; - h = t1 + t2; -} - -__host__ -static void sha256_round_body_host(uint32_t* in, uint32_t* state, const uint32_t* Kshared) -{ - uint32_t a = state[0]; - uint32_t b = state[1]; - uint32_t c = state[2]; - uint32_t d = state[3]; - uint32_t e = state[4]; - uint32_t f = state[5]; - uint32_t g = state[6]; - uint32_t h = state[7]; - - sha256_step1_host(a,b,c,d,e,f,g,h,in[0], Kshared[0]); - sha256_step1_host(h,a,b,c,d,e,f,g,in[1], Kshared[1]); - sha256_step1_host(g,h,a,b,c,d,e,f,in[2], Kshared[2]); - sha256_step1_host(f,g,h,a,b,c,d,e,in[3], Kshared[3]); - sha256_step1_host(e,f,g,h,a,b,c,d,in[4], Kshared[4]); - sha256_step1_host(d,e,f,g,h,a,b,c,in[5], Kshared[5]); - sha256_step1_host(c,d,e,f,g,h,a,b,in[6], Kshared[6]); - sha256_step1_host(b,c,d,e,f,g,h,a,in[7], Kshared[7]); - sha256_step1_host(a,b,c,d,e,f,g,h,in[8], Kshared[8]); - sha256_step1_host(h,a,b,c,d,e,f,g,in[9], Kshared[9]); - sha256_step1_host(g,h,a,b,c,d,e,f,in[10],Kshared[10]); - sha256_step1_host(f,g,h,a,b,c,d,e,in[11],Kshared[11]); - sha256_step1_host(e,f,g,h,a,b,c,d,in[12],Kshared[12]); - sha256_step1_host(d,e,f,g,h,a,b,c,in[13],Kshared[13]); - sha256_step1_host(c,d,e,f,g,h,a,b,in[14],Kshared[14]); - sha256_step1_host(b,c,d,e,f,g,h,a,in[15],Kshared[15]); - - for (int i=0; i<3; i++) - { - sha256_step2_host(a,b,c,d,e,f,g,h,in,0, Kshared[16+16*i]); - sha256_step2_host(h,a,b,c,d,e,f,g,in,1, Kshared[17+16*i]); - sha256_step2_host(g,h,a,b,c,d,e,f,in,2, Kshared[18+16*i]); - sha256_step2_host(f,g,h,a,b,c,d,e,in,3, Kshared[19+16*i]); - sha256_step2_host(e,f,g,h,a,b,c,d,in,4, Kshared[20+16*i]); - sha256_step2_host(d,e,f,g,h,a,b,c,in,5, Kshared[21+16*i]); - sha256_step2_host(c,d,e,f,g,h,a,b,in,6, Kshared[22+16*i]); - sha256_step2_host(b,c,d,e,f,g,h,a,in,7, Kshared[23+16*i]); - sha256_step2_host(a,b,c,d,e,f,g,h,in,8, Kshared[24+16*i]); - sha256_step2_host(h,a,b,c,d,e,f,g,in,9, Kshared[25+16*i]); - sha256_step2_host(g,h,a,b,c,d,e,f,in,10,Kshared[26+16*i]); - sha256_step2_host(f,g,h,a,b,c,d,e,in,11,Kshared[27+16*i]); - sha256_step2_host(e,f,g,h,a,b,c,d,in,12,Kshared[28+16*i]); - sha256_step2_host(d,e,f,g,h,a,b,c,in,13,Kshared[29+16*i]); - sha256_step2_host(c,d,e,f,g,h,a,b,in,14,Kshared[30+16*i]); - sha256_step2_host(b,c,d,e,f,g,h,a,in,15,Kshared[31+16*i]); - } - - state[0] += a; - state[1] += b; - state[2] += c; - state[3] += d; - state[4] += e; - state[5] += f; - state[6] += g; - state[7] += h; -} - -__host__ -void lbry_sha256_setBlock_112_merged(uint32_t *pdata) -{ - uint32_t in[16], buf[8], end[16]; - for (int i=0;i<16;i++) in[i] = cuda_swab32(pdata[i]); - for (int i=0; i<8;i++) buf[i] = cpu_H256[i]; - for (int i=0;i<11;i++) end[i] = cuda_swab32(pdata[16+i]); - sha256_round_body_host(in, buf, cpu_K); - - cudaMemcpyToSymbol(c_midstate112, buf, 32, 0, cudaMemcpyHostToDevice); - - uint32_t a = buf[0]; - uint32_t b = buf[1]; - uint32_t c = buf[2]; - uint32_t d = buf[3]; - uint32_t e = buf[4]; - uint32_t f = buf[5]; - uint32_t g = buf[6]; - uint32_t h = buf[7]; - - sha256_step1_host(a,b,c,d,e,f,g,h,end[0], cpu_K[0]); - sha256_step1_host(h,a,b,c,d,e,f,g,end[1], cpu_K[1]); - sha256_step1_host(g,h,a,b,c,d,e,f,end[2], cpu_K[2]); - sha256_step1_host(f,g,h,a,b,c,d,e,end[3], cpu_K[3]); - sha256_step1_host(e,f,g,h,a,b,c,d,end[4], cpu_K[4]); - sha256_step1_host(d,e,f,g,h,a,b,c,end[5], cpu_K[5]); - sha256_step1_host(c,d,e,f,g,h,a,b,end[6], cpu_K[6]); - sha256_step1_host(b,c,d,e,f,g,h,a,end[7], cpu_K[7]); - sha256_step1_host(a,b,c,d,e,f,g,h,end[8], cpu_K[8]); - sha256_step1_host(h,a,b,c,d,e,f,g,end[9], cpu_K[9]); - sha256_step1_host(g,h,a,b,c,d,e,f,end[10],cpu_K[10]); - sha256_step1_host(f, g, h, a, b, c, d, e, 0, cpu_K[11]); - - buf[0] = a; - buf[1] = b; - buf[2] = c; - buf[3] = d; - buf[4] = e; - buf[5] = f; - buf[6] = g; - buf[7] = h; - - cudaMemcpyToSymbol(c_midbuffer112, buf, 32, 0, cudaMemcpyHostToDevice); - - end[12] = 0x80000000; - end[13] = 0; - end[14] = 0; - end[15] = 0x380; - uint32_t x2_0,x2_1; - - x2_0 = ROTR32(end[1], 7) ^ ROTR32(end[1], 18) ^ SPH_T32(end[1] >> 3); //ssg2_0(inx3);//ssg2_0(end[1]); -// x2_1 = ROTR32(end[14], 17) ^ ROTR32(end[14], 19) ^ SPH_T32(end[14] >> 10) + x2_0; //ssg2_1(inx1); ssg2_1(end[14]) + x2_0; - end[0] = end[0] + end[9] + x2_0; - - x2_0 = ROTR32(end[2], 7) ^ ROTR32(end[2], 18) ^ SPH_T32(end[2] >> 3); - x2_1 = (ROTR32(end[15], 17) ^ ROTR32(end[15], 19) ^ SPH_T32(end[15] >> 10)) + x2_0; - end[1] = end[1] + end[10] + x2_1; - - x2_0 = ROTR32(end[3], 7) ^ ROTR32(end[3], 18) ^ SPH_T32(end[3] >> 3);//ssg2_0(end[3]); - x2_1 = (ROTR32(end[0], 17) ^ ROTR32(end[0], 19) ^ SPH_T32(end[0] >> 10)) + x2_0; - end[2]+= x2_1; - - x2_0 = ROTR32(end[4], 7) ^ ROTR32(end[4], 18) ^ SPH_T32(end[4] >> 3);//ssg2_0(end[4]); - x2_1 = (ROTR32(end[1], 17) ^ ROTR32(end[1], 19) ^ SPH_T32(end[1] >> 10)) + x2_0; - end[3] = end[3] + end[12] + x2_1; - - x2_0 = ROTR32(end[5], 7) ^ ROTR32(end[5], 18) ^ SPH_T32(end[5] >> 3);//ssg2_0(end[4]); - end[4] = end[4] + end[13] + x2_0; - - x2_0 = ROTR32(end[6], 7) ^ ROTR32(end[6], 18) ^ SPH_T32(end[6] >> 3);//ssg2_0(end[6]); - x2_1 = (ROTR32(end[3], 17) ^ ROTR32(end[3], 19) ^ SPH_T32(end[3] >> 10)) + x2_0; - end[5] = end[5] + end[14] + x2_1; - - x2_0 = ROTR32(end[7], 7) ^ ROTR32(end[7], 18) ^ SPH_T32(end[7] >> 3);//ssg2_0(end[7]); - end[6] = end[6] + end[15] + x2_0; - - x2_0 = ROTR32(end[8], 7) ^ ROTR32(end[8], 18) ^ SPH_T32(end[8] >> 3);//ssg2_0(end[8]); - x2_1 = (ROTR32(end[5], 17) ^ ROTR32(end[5], 19) ^ SPH_T32(end[5] >> 10)) + x2_0; - end[7] = end[7] + end[0] + x2_1; - - x2_0 = ROTR32(end[9], 7) ^ ROTR32(end[9], 18) ^ SPH_T32(end[9] >> 3);//ssg2_0(end[9]); - end[8] = end[8] + end[1] + x2_0; - - x2_0 = ROTR32(end[10], 7) ^ ROTR32(end[10], 18) ^ SPH_T32(end[10] >> 3);//ssg2_0(end[10]); - x2_1 = (ROTR32(end[7], 17) ^ ROTR32(end[7], 19) ^ SPH_T32(end[7] >> 10)) + x2_0; - end[9] = end[9] + x2_1; - - cudaMemcpyToSymbol(c_dataEnd112, end, sizeof(end), 0, cudaMemcpyHostToDevice); -} - -//END OF HOST FUNCTIONS ------------------------------------------------------------------- - -//SHA256 MACROS --------------------------------------------------------------------------- - -#define xor3b(a,b,c) (a ^ b ^ c) - -__device__ __forceinline__ uint32_t bsg2_0(const uint32_t x){ - return xor3b(ROTR32(x,2),ROTR32(x,13),ROTR32(x,22)); -} - -__device__ __forceinline__ uint32_t bsg2_1(const uint32_t x){ - return xor3b(ROTR32(x,6),ROTR32(x,11),ROTR32(x,25)); -} - -__device__ __forceinline__ uint32_t ssg2_0(const uint32_t x){ - return xor3b(ROTR32(x,7),ROTR32(x,18),(x>>3)); -} - -__device__ __forceinline__ uint32_t ssg2_1(const uint32_t x){ - return xor3b(ROTR32(x,17),ROTR32(x,19),(x>>10)); -} - -__device__ __forceinline__ uint64_t vectorizeswap(const uint64_t v){ - uint2 result; - asm volatile ("mov.b64 {%0,%1},%2;" : "=r"(result.y), "=r"(result.x) : "l"(v)); - return devectorize(result); -} - -#define Maj(x, y, z) ((x & (y | z)) | (y & z)) -#define Ch(a, b, c) (((b^c) & a) ^ c) - -__device__ -static void sha2_step(const uint32_t a, const uint32_t b,const uint32_t c, uint32_t &d, - const uint32_t e,const uint32_t f,const uint32_t g, uint32_t &h, - const uint32_t in, const uint32_t Kshared) -{ - const uint32_t t1 = h + bsg2_1(e) + Ch(e, f, g) + Kshared + in; - h = t1 + Maj(a, b, c) + bsg2_0(a); - d+= t1; -} - -__device__ -static void sha256_round_first(uint32_t *in, uint32_t *buf, - const uint32_t *state, const uint32_t* __restrict__ Kshared) -{ - uint32_t a = buf[0] + in[11]; - uint32_t b = buf[1]; - uint32_t c = buf[2]; - uint32_t d = buf[3]; - uint32_t e = buf[4] + in[11]; - uint32_t f = buf[5]; - uint32_t g = buf[6]; - uint32_t h = buf[7]; - - // 10 first steps made on host - //sha2_step(f,g,h,a,b,c,d,e,in[11],Kshared[11]); - - sha2_step(e,f,g,h,a,b,c,d,in[12],Kshared[12]); - sha2_step(d,e,f,g,h,a,b,c,in[13],Kshared[13]); - sha2_step(c,d,e,f,g,h,a,b,in[14],Kshared[14]); - sha2_step(b,c,d,e,f,g,h,a,in[15],Kshared[15]); - - //in is partially precomputed on host - in[2]+= in[11]; - in[4]+= ssg2_1(in[2]); - in[6]+= ssg2_1(in[4]); - in[8]+= ssg2_1(in[6]); - in[9]+= in[ 2]; - - sha2_step(a,b,c,d,e,f,g,h,in[0], Kshared[16]); - sha2_step(h,a,b,c,d,e,f,g,in[1], Kshared[17]); - sha2_step(g,h,a,b,c,d,e,f,in[2], Kshared[18]); - sha2_step(f,g,h,a,b,c,d,e,in[3], Kshared[19]); - sha2_step(e,f,g,h,a,b,c,d,in[4], Kshared[20]); - sha2_step(d,e,f,g,h,a,b,c,in[5], Kshared[21]); - sha2_step(c,d,e,f,g,h,a,b,in[6], Kshared[22]); - sha2_step(b,c,d,e,f,g,h,a,in[7], Kshared[23]); - sha2_step(a,b,c,d,e,f,g,h,in[8], Kshared[24]); - sha2_step(h,a,b,c,d,e,f,g,in[9], Kshared[25]); - - #pragma unroll 6 - for (uint32_t j = 10; j < 16; j++) { - const uint32_t x2_0 = ssg2_0(in[(j + 1) & 15]); - const uint32_t x2_1 = ssg2_1(in[(j + 14) & 15]) + x2_0; - in[j] = in[j] + in[(j + 9) & 15] + x2_1; - } - - sha2_step(g,h,a,b,c,d,e,f,in[10],Kshared[26]); - sha2_step(f,g,h,a,b,c,d,e,in[11],Kshared[27]); - sha2_step(e,f,g,h,a,b,c,d,in[12],Kshared[28]); - sha2_step(d,e,f,g,h,a,b,c,in[13],Kshared[29]); - sha2_step(c,d,e,f,g,h,a,b,in[14],Kshared[30]); - sha2_step(b,c,d,e,f,g,h,a,in[15],Kshared[31]); - - #pragma unroll 16 - for (uint32_t j = 0; j < 16; j++) { - const uint32_t x2_0 = ssg2_0(in[(j + 1) & 15]); - const uint32_t x2_1 = ssg2_1(in[(j + 14) & 15]) + x2_0; - in[j] = in[j] + in[(j + 9) & 15] + x2_1; - } - - sha2_step(a,b,c,d,e,f,g,h,in[0], Kshared[16+16]); - sha2_step(h,a,b,c,d,e,f,g,in[1], Kshared[17+16]); - sha2_step(g,h,a,b,c,d,e,f,in[2], Kshared[18+16]); - sha2_step(f,g,h,a,b,c,d,e,in[3], Kshared[19+16]); - sha2_step(e,f,g,h,a,b,c,d,in[4], Kshared[20+16]); - sha2_step(d,e,f,g,h,a,b,c,in[5], Kshared[21+16]); - sha2_step(c,d,e,f,g,h,a,b,in[6], Kshared[22+16]); - sha2_step(b,c,d,e,f,g,h,a,in[7], Kshared[23+16]); - sha2_step(a,b,c,d,e,f,g,h,in[8], Kshared[24+16]); - sha2_step(h,a,b,c,d,e,f,g,in[9], Kshared[25+16]); - sha2_step(g,h,a,b,c,d,e,f,in[10],Kshared[26+16]); - sha2_step(f,g,h,a,b,c,d,e,in[11],Kshared[27+16]); - sha2_step(e,f,g,h,a,b,c,d,in[12],Kshared[28+16]); - sha2_step(d,e,f,g,h,a,b,c,in[13],Kshared[29+16]); - sha2_step(c,d,e,f,g,h,a,b,in[14],Kshared[30+16]); - sha2_step(b,c,d,e,f,g,h,a,in[15],Kshared[31+16]); - - #pragma unroll 16 - for (uint32_t j = 0; j < 16; j++) { - const uint32_t x2_0 = ssg2_0(in[(j + 1) & 15]); - const uint32_t x2_1 = ssg2_1(in[(j + 14) & 15]) + x2_0; - in[j] = in[j] + in[(j + 9) & 15] + x2_1; - } - - sha2_step(a,b,c,d,e,f,g,h,in[0], Kshared[16+16*2]); - sha2_step(h,a,b,c,d,e,f,g,in[1], Kshared[17+16*2]); - sha2_step(g,h,a,b,c,d,e,f,in[2], Kshared[18+16*2]); - sha2_step(f,g,h,a,b,c,d,e,in[3], Kshared[19+16*2]); - sha2_step(e,f,g,h,a,b,c,d,in[4], Kshared[20+16*2]); - sha2_step(d,e,f,g,h,a,b,c,in[5], Kshared[21+16*2]); - sha2_step(c,d,e,f,g,h,a,b,in[6], Kshared[22+16*2]); - sha2_step(b,c,d,e,f,g,h,a,in[7], Kshared[23+16*2]); - sha2_step(a,b,c,d,e,f,g,h,in[8], Kshared[24+16*2]); - sha2_step(h,a,b,c,d,e,f,g,in[9], Kshared[25+16*2]); - sha2_step(g,h,a,b,c,d,e,f,in[10],Kshared[26+16*2]); - sha2_step(f,g,h,a,b,c,d,e,in[11],Kshared[27+16*2]); - sha2_step(e,f,g,h,a,b,c,d,in[12],Kshared[28+16*2]); - sha2_step(d,e,f,g,h,a,b,c,in[13],Kshared[29+16*2]); - sha2_step(c,d,e,f,g,h,a,b,in[14],Kshared[30+16*2]); - sha2_step(b,c,d,e,f,g,h,a,in[15],Kshared[31+16*2]); - - buf[ 0] = state[0] + a; - buf[ 1] = state[1] + b; - buf[ 2] = state[2] + c; - buf[ 3] = state[3] + d; - buf[ 4] = state[4] + e; - buf[ 5] = state[5] + f; - buf[ 6] = state[6] + g; - buf[ 7] = state[7] + h; -} - -__device__ -static void sha256_round_body(uint32_t *in, uint32_t *state,const uint32_t* Kshared) -{ - uint32_t a = state[0]; - uint32_t b = state[1]; - uint32_t c = state[2]; - uint32_t d = state[3]; - uint32_t e = state[4]; - uint32_t f = state[5]; - uint32_t g = state[6]; - uint32_t h = state[7]; - - sha2_step(a,b,c,d,e,f,g,h,in[ 0], Kshared[ 0]); - sha2_step(h,a,b,c,d,e,f,g,in[ 1], Kshared[ 1]); - sha2_step(g,h,a,b,c,d,e,f,in[ 2], Kshared[ 2]); - sha2_step(f,g,h,a,b,c,d,e,in[ 3], Kshared[ 3]); - sha2_step(e,f,g,h,a,b,c,d,in[ 4], Kshared[ 4]); - sha2_step(d,e,f,g,h,a,b,c,in[ 5], Kshared[ 5]); - sha2_step(c,d,e,f,g,h,a,b,in[ 6], Kshared[ 6]); - sha2_step(b,c,d,e,f,g,h,a,in[ 7], Kshared[ 7]); - sha2_step(a,b,c,d,e,f,g,h,in[ 8], Kshared[ 8]); - sha2_step(h,a,b,c,d,e,f,g,in[ 9], Kshared[ 9]); - sha2_step(g,h,a,b,c,d,e,f,in[10], Kshared[10]); - sha2_step(f,g,h,a,b,c,d,e,in[11], Kshared[11]); - sha2_step(e,f,g,h,a,b,c,d,in[12], Kshared[12]); - sha2_step(d,e,f,g,h,a,b,c,in[13], Kshared[13]); - sha2_step(c,d,e,f,g,h,a,b,in[14], Kshared[14]); - sha2_step(b,c,d,e,f,g,h,a,in[15], Kshared[15]); - - #pragma unroll 3 - for (int i=0; i<3; i++) - { - #pragma unroll 16 - for (uint32_t j = 0; j < 16; j++) { - const uint32_t x2_0 = ssg2_0(in[(j + 1) & 15]); - const uint32_t x2_1 = ssg2_1(in[(j + 14) & 15]) + x2_0; - in[j] = in[j] + in[(j + 9) & 15] + x2_1; - } - sha2_step(a, b, c, d, e, f, g, h, in[ 0], Kshared[16 + 16 * i]); - sha2_step(h, a, b, c, d, e, f, g, in[ 1], Kshared[17 + 16 * i]); - sha2_step(g, h, a, b, c, d, e, f, in[ 2], Kshared[18 + 16 * i]); - sha2_step(f, g, h, a, b, c, d, e, in[ 3], Kshared[19 + 16 * i]); - sha2_step(e, f, g, h, a, b, c, d, in[ 4], Kshared[20 + 16 * i]); - sha2_step(d, e, f, g, h, a, b, c, in[ 5], Kshared[21 + 16 * i]); - sha2_step(c, d, e, f, g, h, a, b, in[ 6], Kshared[22 + 16 * i]); - sha2_step(b, c, d, e, f, g, h, a, in[ 7], Kshared[23 + 16 * i]); - sha2_step(a, b, c, d, e, f, g, h, in[ 8], Kshared[24 + 16 * i]); - sha2_step(h, a, b, c, d, e, f, g, in[ 9], Kshared[25 + 16 * i]); - sha2_step(g, h, a, b, c, d, e, f, in[10], Kshared[26 + 16 * i]); - sha2_step(f, g, h, a, b, c, d, e, in[11], Kshared[27 + 16 * i]); - sha2_step(e, f, g, h, a, b, c, d, in[12], Kshared[28 + 16 * i]); - sha2_step(d, e, f, g, h, a, b, c, in[13], Kshared[29 + 16 * i]); - sha2_step(c, d, e, f, g, h, a, b, in[14], Kshared[30 + 16 * i]); - sha2_step(b, c, d, e, f, g, h, a, in[15], Kshared[31 + 16 * i]); - } - - state[0] += a; - state[1] += b; - state[2] += c; - state[3] += d; - state[4] += e; - state[5] += f; - state[6] += g; - state[7] += h; -} - -__device__ -static void sha256_round_body_final(uint32_t *in, uint32_t *state, const uint32_t *Kshared) -{ - uint32_t a = state[0]; - uint32_t b = state[1]; - uint32_t c = state[2]; - uint32_t d = state[3]; - uint32_t e = state[4]; - uint32_t f = state[5]; - uint32_t g = state[6]; - uint32_t h = state[7]; - - sha2_step(a,b,c,d,e,f,g,h,in[ 0], Kshared[0]); - sha2_step(h,a,b,c,d,e,f,g,in[ 1], Kshared[1]); - sha2_step(g,h,a,b,c,d,e,f,in[ 2], Kshared[2]); - sha2_step(f,g,h,a,b,c,d,e,in[ 3], Kshared[3]); - sha2_step(e,f,g,h,a,b,c,d,in[ 4], Kshared[4]); - sha2_step(d,e,f,g,h,a,b,c,in[ 5], Kshared[5]); - sha2_step(c,d,e,f,g,h,a,b,in[ 6], Kshared[6]); - sha2_step(b,c,d,e,f,g,h,a,in[ 7], Kshared[7]); - sha2_step(a,b,c,d,e,f,g,h,in[ 8], Kshared[8]); - sha2_step(h,a,b,c,d,e,f,g,in[ 9], Kshared[9]); - sha2_step(g,h,a,b,c,d,e,f,in[10], Kshared[10]); - sha2_step(f,g,h,a,b,c,d,e,in[11], Kshared[11]); - sha2_step(e,f,g,h,a,b,c,d,in[12], Kshared[12]); - sha2_step(d,e,f,g,h,a,b,c,in[13], Kshared[13]); - sha2_step(c,d,e,f,g,h,a,b,in[14], Kshared[14]); - sha2_step(b,c,d,e,f,g,h,a,in[15], Kshared[15]); - - #pragma unroll 2 - for (int i=0; i<2; i++) - { - #pragma unroll 16 - for (uint32_t j = 0; j < 16; j++) { - const uint32_t x2_0 = ssg2_0(in[(j + 1) & 15]); - const uint32_t x2_1 = ssg2_1(in[(j + 14) & 15]) + x2_0; - in[j] = in[j] + in[(j + 9) & 15] + x2_1; - } - sha2_step(a, b, c, d, e, f, g, h, in[ 0], Kshared[16 + 16 * i]); - sha2_step(h, a, b, c, d, e, f, g, in[ 1], Kshared[17 + 16 * i]); - sha2_step(g, h, a, b, c, d, e, f, in[ 2], Kshared[18 + 16 * i]); - sha2_step(f, g, h, a, b, c, d, e, in[ 3], Kshared[19 + 16 * i]); - sha2_step(e, f, g, h, a, b, c, d, in[ 4], Kshared[20 + 16 * i]); - sha2_step(d, e, f, g, h, a, b, c, in[ 5], Kshared[21 + 16 * i]); - sha2_step(c, d, e, f, g, h, a, b, in[ 6], Kshared[22 + 16 * i]); - sha2_step(b, c, d, e, f, g, h, a, in[ 7], Kshared[23 + 16 * i]); - sha2_step(a, b, c, d, e, f, g, h, in[ 8], Kshared[24 + 16 * i]); - sha2_step(h, a, b, c, d, e, f, g, in[ 9], Kshared[25 + 16 * i]); - sha2_step(g, h, a, b, c, d, e, f, in[10], Kshared[26 + 16 * i]); - sha2_step(f, g, h, a, b, c, d, e, in[11], Kshared[27 + 16 * i]); - sha2_step(e, f, g, h, a, b, c, d, in[12], Kshared[28 + 16 * i]); - sha2_step(d, e, f, g, h, a, b, c, in[13], Kshared[29 + 16 * i]); - sha2_step(c, d, e, f, g, h, a, b, in[14], Kshared[30 + 16 * i]); - sha2_step(b, c, d, e, f, g, h, a, in[15], Kshared[31 + 16 * i]); - } - #pragma unroll 16 - for (uint32_t j = 0; j < 16; j++) { - const uint32_t x2_0 = ssg2_0(in[(j + 1) & 15]); - const uint32_t x2_1 = ssg2_1(in[(j + 14) & 15]) + x2_0; - in[j] = in[j] + in[(j + 9) & 15] + x2_1; - } - sha2_step(a, b, c, d, e, f, g, h, in[ 0], Kshared[16 + 16 * 2]); - sha2_step(h, a, b, c, d, e, f, g, in[ 1], Kshared[17 + 16 * 2]); - sha2_step(g, h, a, b, c, d, e, f, in[ 2], Kshared[18 + 16 * 2]); - sha2_step(f, g, h, a, b, c, d, e, in[ 3], Kshared[19 + 16 * 2]); - sha2_step(e, f, g, h, a, b, c, d, in[ 4], Kshared[20 + 16 * 2]); - sha2_step(d, e, f, g, h, a, b, c, in[ 5], Kshared[21 + 16 * 2]); - sha2_step(c, d, e, f, g, h, a, b, in[ 6], Kshared[22 + 16 * 2]); - sha2_step(b, c, d, e, f, g, h, a, in[ 7], Kshared[23 + 16 * 2]); - sha2_step(a, b, c, d, e, f, g, h, in[ 8], Kshared[24 + 16 * 2]); - sha2_step(h, a, b, c, d, e, f, g, in[ 9], Kshared[25 + 16 * 2]); - sha2_step(g, h, a, b, c, d, e, f, in[10], Kshared[26 + 16 * 2]); - sha2_step(f, g, h, a, b, c, d, e, in[11], Kshared[27 + 16 * 2]); - sha2_step(e, f, g, h, a, b, c, d, in[12], Kshared[28 + 16 * 2]); - sha2_step(d, e, f, g, h, a, b, c, in[13], Kshared[29 + 16 * 2]); - - state[6] += g; - state[7] += h; -} - -//END OF SHA256 MACROS -------------------------------------------------------------------- - -//SHA512 MACROS --------------------------------------------------------------------------- -static __constant__ _ALIGN(8) uint64_t K_512[80] = { - 0x428A2F98D728AE22, 0x7137449123EF65CD, 0xB5C0FBCFEC4D3B2F, 0xE9B5DBA58189DBBC, - 0x3956C25BF348B538, 0x59F111F1B605D019, 0x923F82A4AF194F9B, 0xAB1C5ED5DA6D8118, - 0xD807AA98A3030242, 0x12835B0145706FBE, 0x243185BE4EE4B28C, 0x550C7DC3D5FFB4E2, - 0x72BE5D74F27B896F, 0x80DEB1FE3B1696B1, 0x9BDC06A725C71235, 0xC19BF174CF692694, - 0xE49B69C19EF14AD2, 0xEFBE4786384F25E3, 0x0FC19DC68B8CD5B5, 0x240CA1CC77AC9C65, - 0x2DE92C6F592B0275, 0x4A7484AA6EA6E483, 0x5CB0A9DCBD41FBD4, 0x76F988DA831153B5, - 0x983E5152EE66DFAB, 0xA831C66D2DB43210, 0xB00327C898FB213F, 0xBF597FC7BEEF0EE4, - 0xC6E00BF33DA88FC2, 0xD5A79147930AA725, 0x06CA6351E003826F, 0x142929670A0E6E70, - 0x27B70A8546D22FFC, 0x2E1B21385C26C926, 0x4D2C6DFC5AC42AED, 0x53380D139D95B3DF, - 0x650A73548BAF63DE, 0x766A0ABB3C77B2A8, 0x81C2C92E47EDAEE6, 0x92722C851482353B, - 0xA2BFE8A14CF10364, 0xA81A664BBC423001, 0xC24B8B70D0F89791, 0xC76C51A30654BE30, - 0xD192E819D6EF5218, 0xD69906245565A910, 0xF40E35855771202A, 0x106AA07032BBD1B8, - 0x19A4C116B8D2D0C8, 0x1E376C085141AB53, 0x2748774CDF8EEB99, 0x34B0BCB5E19B48A8, - 0x391C0CB3C5C95A63, 0x4ED8AA4AE3418ACB, 0x5B9CCA4F7763E373, 0x682E6FF3D6B2B8A3, - 0x748F82EE5DEFB2FC, 0x78A5636F43172F60, 0x84C87814A1F0AB72, 0x8CC702081A6439EC, - 0x90BEFFFA23631E28, 0xA4506CEBDE82BDE9, 0xBEF9A3F7B2C67915, 0xC67178F2E372532B, - 0xCA273ECEEA26619C, 0xD186B8C721C0C207, 0xEADA7DD6CDE0EB1E, 0xF57D4F7FEE6ED178, - 0x06F067AA72176FBA, 0x0A637DC5A2C898A6, 0x113F9804BEF90DAE, 0x1B710B35131C471B, - 0x28DB77F523047D84, 0x32CAAB7B40C72493, 0x3C9EBE0A15C9BEBC, 0x431D67C49C100D4C, - 0x4CC5D4BECB3E42B6, 0x597F299CFC657E2A, 0x5FCB6FAB3AD6FAEC, 0x6C44198C4A475817 -}; - -#undef xor3 -#define xor3(a,b,c) (a^b^c) - -#define bsg5_0(x) xor3(ROTR64(x,28),ROTR64(x,34),ROTR64(x,39)) -#define bsg5_1(x) xor3(ROTR64(x,14),ROTR64(x,18),ROTR64(x,41)) -#define ssg5_0(x) xor3(ROTR64(x, 1),ROTR64(x, 8),x>>7) -#define ssg5_1(x) xor3(ROTR64(x,19),ROTR64(x,61),x>>6) - -#define andor64(a,b,c) ((a & (b | c)) | (b & c)) -#define xandx64(e,f,g) (g ^ (e & (g ^ f))) - -__device__ __forceinline__ -uint64_t cuda_swab64ll(const uint32_t x, const uint32_t y) -{ - uint64_t r; - asm("prmt.b32 %1, %1, 0, 0x0123; // swab64ll\n\t" - "prmt.b32 %2, %2, 0, 0x0123;\n\t" - "mov.b64 %0, {%1,%2};\n\t" - : "=l"(r): "r"(x), "r"(y) ); - return r; -} - -// RIPEMD MACROS----------------------------------------------------------------------------- -static __constant__ const uint32_t c_IV[5] = { 0x67452301u, 0xEFCDAB89u, 0x98BADCFEu, 0x10325476u, 0xC3D2E1F0u }; -static __constant__ const uint32_t c_K1[5] = { 0, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E }; -static __constant__ const uint32_t c_K2[5] = { 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0 }; - -__device__ __forceinline__ -static uint32_t ROTATE(const uint32_t x,const uint32_t r) { - if(r==8) - return __byte_perm(x, 0, 0x2103); - else - return ROTL32(x,r); -} - -/* - * Round functions for RIPEMD-160. - */ -//#define F1(x, y, z) xor3x(x, y, z) -__device__ __forceinline__ -uint32_t F1(const uint32_t a, const uint32_t b, const uint32_t c) { - uint32_t result; - #if __CUDA_ARCH__ >= 500 && CUDA_VERSION >= 7050 - asm volatile ("lop3.b32 %0, %1, %2, %3, 0x96;" : "=r"(result) : "r"(a), "r"(b),"r"(c)); - #else - result = a^b^c; - #endif - return result; -} -//#define F2(x, y, z) ((x & (y ^ z)) ^ z) -__device__ __forceinline__ -uint32_t F2(const uint32_t a, const uint32_t b, const uint32_t c) { - uint32_t result; - #if __CUDA_ARCH__ >= 500 && CUDA_VERSION >= 7050 - asm volatile ("lop3.b32 %0, %1, %2, %3, 0xCA;" : "=r"(result) : "r"(a), "r"(b),"r"(c)); //0xCA=((F0∧(CC⊻AA))⊻AA) - #else - result = ((a & (b ^ c)) ^ c); - #endif - return result; -} -//#define F3(x, y, z) ((x | ~y) ^ z) -__device__ __forceinline__ -uint32_t F3(const uint32_t x, const uint32_t y, const uint32_t z) { - uint32_t result; - #if __CUDA_ARCH__ >= 500 && CUDA_VERSION >= 7050 - asm volatile ("lop3.b32 %0, %1, %2, %3, 0x59;" : "=r"(result) : "r"(x), "r"(y),"r"(z)); //0x59=((F0∨(¬CC))⊻AA) - #else - result = ((x | ~y) ^ z); - #endif - return result; -} -//#define F4(x, y, z) (y ^ ((x ^ y) & z)) -__device__ __forceinline__ -uint32_t F4(const uint32_t x, const uint32_t y, const uint32_t z) { - uint32_t result; - #if __CUDA_ARCH__ >= 500 && CUDA_VERSION >= 7050 - asm volatile ("lop3.b32 %0, %1, %2, %3, 0xE4;" : "=r"(result) : "r"(x), "r"(y),"r"(z)); //0xE4=(CC⊻((F0⊻CC)∧AA)) - #else - result = (y ^ ((x ^ y) & z)); - #endif - return result; -} -//#define F5(x, y, z) (x ^ (y | ~z)) -__device__ __forceinline__ -uint32_t F5(const uint32_t x, const uint32_t y, const uint32_t z) { - uint32_t result; - #if __CUDA_ARCH__ >= 500 && CUDA_VERSION >= 7050 - asm volatile ("lop3.b32 %0, %1, %2, %3, 0x2D;" : "=r"(result) : "r"(x), "r"(y),"r"(z)); //0x2D=(F0⊻(CC∨(¬AA))) - #else - result = (x ^ (y | ~z)); - #endif - return result; -} - -/* - * Round constants for RIPEMD-160. - */ -#define RR(a, b, c, d, e, f, s, r, k) { \ - a = e + ROTATE((a + k + r + f(b, c, d)), s); \ - c = ROTL32(c, 10); \ -} - -#define ROUND1(a, b, c, d, e, f, s, r, k) \ - RR(a[0], b[0], c[0], d[0], e[0], f, s, r, c_K1[k]) - -#define ROUND2(a, b, c, d, e, f, s, r, k) \ - RR(a[1], b[1], c[1], d[1], e[1], f, s, r, c_K2[k]) - -#define RIPEMD160_ROUND_BODY(in, h) { \ - uint32_t A[2], B[2], C[2], D[2], E[2]; \ - uint32_t tmp; \ -\ - A[0] = A[1] = h[0]; \ - B[0] = B[1] = h[1]; \ - C[0] = C[1] = h[2]; \ - D[0] = D[1] = h[3]; \ - E[0] = E[1] = h[4]; \ -\ - ROUND1(A, B, C, D, E, F1, 11, in[ 0], 0); \ - ROUND1(E, A, B, C, D, F1, 14, in[ 1], 0); \ - ROUND1(D, E, A, B, C, F1, 15, in[ 2], 0); \ - ROUND1(C, D, E, A, B, F1, 12, in[ 3], 0); \ - ROUND1(B, C, D, E, A, F1, 5, in[ 4], 0); \ - ROUND1(A, B, C, D, E, F1, 8, in[ 5], 0); \ - ROUND1(E, A, B, C, D, F1, 7, in[ 6], 0); \ - ROUND1(D, E, A, B, C, F1, 9, in[ 7], 0); \ - ROUND1(C, D, E, A, B, F1, 11, in[ 8], 0); \ - ROUND1(B, C, D, E, A, F1, 13, in[ 9], 0); \ - ROUND1(A, B, C, D, E, F1, 14, in[10], 0); \ - ROUND1(E, A, B, C, D, F1, 15, in[11], 0); \ - ROUND1(D, E, A, B, C, F1, 6, in[12], 0); \ - ROUND1(C, D, E, A, B, F1, 7, in[13], 0); \ - ROUND1(B, C, D, E, A, F1, 9, in[14], 0); \ - ROUND1(A, B, C, D, E, F1, 8, in[15], 0); \ -\ - ROUND1(E, A, B, C, D, F2, 7, in[ 7], 1); \ - ROUND1(D, E, A, B, C, F2, 6, in[ 4], 1); \ - ROUND1(C, D, E, A, B, F2, 8, in[13], 1); \ - ROUND1(B, C, D, E, A, F2, 13, in[ 1], 1); \ - ROUND1(A, B, C, D, E, F2, 11, in[10], 1); \ - ROUND1(E, A, B, C, D, F2, 9, in[ 6], 1); \ - ROUND1(D, E, A, B, C, F2, 7, in[15], 1); \ - ROUND1(C, D, E, A, B, F2, 15, in[ 3], 1); \ - ROUND1(B, C, D, E, A, F2, 7, in[12], 1); \ - ROUND1(A, B, C, D, E, F2, 12, in[ 0], 1); \ - ROUND1(E, A, B, C, D, F2, 15, in[ 9], 1); \ - ROUND1(D, E, A, B, C, F2, 9, in[ 5], 1); \ - ROUND1(C, D, E, A, B, F2, 11, in[ 2], 1); \ - ROUND1(B, C, D, E, A, F2, 7, in[14], 1); \ - ROUND1(A, B, C, D, E, F2, 13, in[11], 1); \ - ROUND1(E, A, B, C, D, F2, 12, in[ 8], 1); \ -\ - ROUND1(D, E, A, B, C, F3, 11, in[ 3], 2); \ - ROUND1(C, D, E, A, B, F3, 13, in[10], 2); \ - ROUND1(B, C, D, E, A, F3, 6, in[14], 2); \ - ROUND1(A, B, C, D, E, F3, 7, in[ 4], 2); \ - ROUND1(E, A, B, C, D, F3, 14, in[ 9], 2); \ - ROUND1(D, E, A, B, C, F3, 9, in[15], 2); \ - ROUND1(C, D, E, A, B, F3, 13, in[ 8], 2); \ - ROUND1(B, C, D, E, A, F3, 15, in[ 1], 2); \ - ROUND1(A, B, C, D, E, F3, 14, in[ 2], 2); \ - ROUND1(E, A, B, C, D, F3, 8, in[ 7], 2); \ - ROUND1(D, E, A, B, C, F3, 13, in[ 0], 2); \ - ROUND1(C, D, E, A, B, F3, 6, in[ 6], 2); \ - ROUND1(B, C, D, E, A, F3, 5, in[13], 2); \ - ROUND1(A, B, C, D, E, F3, 12, in[11], 2); \ - ROUND1(E, A, B, C, D, F3, 7, in[ 5], 2); \ - ROUND1(D, E, A, B, C, F3, 5, in[12], 2); \ -\ - ROUND1(C, D, E, A, B, F4, 11, in[ 1], 3); \ - ROUND1(B, C, D, E, A, F4, 12, in[ 9], 3); \ - ROUND1(A, B, C, D, E, F4, 14, in[11], 3); \ - ROUND1(E, A, B, C, D, F4, 15, in[10], 3); \ - ROUND1(D, E, A, B, C, F4, 14, in[ 0], 3); \ - ROUND1(C, D, E, A, B, F4, 15, in[ 8], 3); \ - ROUND1(B, C, D, E, A, F4, 9, in[12], 3); \ - ROUND1(A, B, C, D, E, F4, 8, in[ 4], 3); \ - ROUND1(E, A, B, C, D, F4, 9, in[13], 3); \ - ROUND1(D, E, A, B, C, F4, 14, in[ 3], 3); \ - ROUND1(C, D, E, A, B, F4, 5, in[ 7], 3); \ - ROUND1(B, C, D, E, A, F4, 6, in[15], 3); \ - ROUND1(A, B, C, D, E, F4, 8, in[14], 3); \ - ROUND1(E, A, B, C, D, F4, 6, in[ 5], 3); \ - ROUND1(D, E, A, B, C, F4, 5, in[ 6], 3); \ - ROUND1(C, D, E, A, B, F4, 12, in[ 2], 3); \ -\ - ROUND1(B, C, D, E, A, F5, 9, in[ 4], 4); \ - ROUND1(A, B, C, D, E, F5, 15, in[ 0], 4); \ - ROUND1(E, A, B, C, D, F5, 5, in[ 5], 4); \ - ROUND1(D, E, A, B, C, F5, 11, in[ 9], 4); \ - ROUND1(C, D, E, A, B, F5, 6, in[ 7], 4); \ - ROUND1(B, C, D, E, A, F5, 8, in[12], 4); \ - ROUND1(A, B, C, D, E, F5, 13, in[ 2], 4); \ - ROUND1(E, A, B, C, D, F5, 12, in[10], 4); \ - ROUND1(D, E, A, B, C, F5, 5, in[14], 4); \ - ROUND1(C, D, E, A, B, F5, 12, in[ 1], 4); \ - ROUND1(B, C, D, E, A, F5, 13, in[ 3], 4); \ - ROUND1(A, B, C, D, E, F5, 14, in[ 8], 4); \ - ROUND1(E, A, B, C, D, F5, 11, in[11], 4); \ - ROUND1(D, E, A, B, C, F5, 8, in[ 6], 4); \ - ROUND1(C, D, E, A, B, F5, 5, in[15], 4); \ - ROUND1(B, C, D, E, A, F5, 6, in[13], 4); \ -\ - ROUND2(A, B, C, D, E, F5, 8, in[ 5], 0); \ - ROUND2(E, A, B, C, D, F5, 9, in[14], 0); \ - ROUND2(D, E, A, B, C, F5, 9, in[ 7], 0); \ - ROUND2(C, D, E, A, B, F5, 11, in[ 0], 0); \ - ROUND2(B, C, D, E, A, F5, 13, in[ 9], 0); \ - ROUND2(A, B, C, D, E, F5, 15, in[ 2], 0); \ - ROUND2(E, A, B, C, D, F5, 15, in[11], 0); \ - ROUND2(D, E, A, B, C, F5, 5, in[ 4], 0); \ - ROUND2(C, D, E, A, B, F5, 7, in[13], 0); \ - ROUND2(B, C, D, E, A, F5, 7, in[ 6], 0); \ - ROUND2(A, B, C, D, E, F5, 8, in[15], 0); \ - ROUND2(E, A, B, C, D, F5, 11, in[ 8], 0); \ - ROUND2(D, E, A, B, C, F5, 14, in[ 1], 0); \ - ROUND2(C, D, E, A, B, F5, 14, in[10], 0); \ - ROUND2(B, C, D, E, A, F5, 12, in[ 3], 0); \ - ROUND2(A, B, C, D, E, F5, 6, in[12], 0); \ -\ - ROUND2(E, A, B, C, D, F4, 9, in[ 6], 1); \ - ROUND2(D, E, A, B, C, F4, 13, in[11], 1); \ - ROUND2(C, D, E, A, B, F4, 15, in[ 3], 1); \ - ROUND2(B, C, D, E, A, F4, 7, in[ 7], 1); \ - ROUND2(A, B, C, D, E, F4, 12, in[ 0], 1); \ - ROUND2(E, A, B, C, D, F4, 8, in[13], 1); \ - ROUND2(D, E, A, B, C, F4, 9, in[ 5], 1); \ - ROUND2(C, D, E, A, B, F4, 11, in[10], 1); \ - ROUND2(B, C, D, E, A, F4, 7, in[14], 1); \ - ROUND2(A, B, C, D, E, F4, 7, in[15], 1); \ - ROUND2(E, A, B, C, D, F4, 12, in[ 8], 1); \ - ROUND2(D, E, A, B, C, F4, 7, in[12], 1); \ - ROUND2(C, D, E, A, B, F4, 6, in[ 4], 1); \ - ROUND2(B, C, D, E, A, F4, 15, in[ 9], 1); \ - ROUND2(A, B, C, D, E, F4, 13, in[ 1], 1); \ - ROUND2(E, A, B, C, D, F4, 11, in[ 2], 1); \ -\ - ROUND2(D, E, A, B, C, F3, 9, in[15], 2); \ - ROUND2(C, D, E, A, B, F3, 7, in[ 5], 2); \ - ROUND2(B, C, D, E, A, F3, 15, in[ 1], 2); \ - ROUND2(A, B, C, D, E, F3, 11, in[ 3], 2); \ - ROUND2(E, A, B, C, D, F3, 8, in[ 7], 2); \ - ROUND2(D, E, A, B, C, F3, 6, in[14], 2); \ - ROUND2(C, D, E, A, B, F3, 6, in[ 6], 2); \ - ROUND2(B, C, D, E, A, F3, 14, in[ 9], 2); \ - ROUND2(A, B, C, D, E, F3, 12, in[11], 2); \ - ROUND2(E, A, B, C, D, F3, 13, in[ 8], 2); \ - ROUND2(D, E, A, B, C, F3, 5, in[12], 2); \ - ROUND2(C, D, E, A, B, F3, 14, in[ 2], 2); \ - ROUND2(B, C, D, E, A, F3, 13, in[10], 2); \ - ROUND2(A, B, C, D, E, F3, 13, in[ 0], 2); \ - ROUND2(E, A, B, C, D, F3, 7, in[ 4], 2); \ - ROUND2(D, E, A, B, C, F3, 5, in[13], 2); \ -\ - ROUND2(C, D, E, A, B, F2, 15, in[ 8], 3); \ - ROUND2(B, C, D, E, A, F2, 5, in[ 6], 3); \ - ROUND2(A, B, C, D, E, F2, 8, in[ 4], 3); \ - ROUND2(E, A, B, C, D, F2, 11, in[ 1], 3); \ - ROUND2(D, E, A, B, C, F2, 14, in[ 3], 3); \ - ROUND2(C, D, E, A, B, F2, 14, in[11], 3); \ - ROUND2(B, C, D, E, A, F2, 6, in[15], 3); \ - ROUND2(A, B, C, D, E, F2, 14, in[ 0], 3); \ - ROUND2(E, A, B, C, D, F2, 6, in[ 5], 3); \ - ROUND2(D, E, A, B, C, F2, 9, in[12], 3); \ - ROUND2(C, D, E, A, B, F2, 12, in[ 2], 3); \ - ROUND2(B, C, D, E, A, F2, 9, in[13], 3); \ - ROUND2(A, B, C, D, E, F2, 12, in[ 9], 3); \ - ROUND2(E, A, B, C, D, F2, 5, in[ 7], 3); \ - ROUND2(D, E, A, B, C, F2, 15, in[10], 3); \ - ROUND2(C, D, E, A, B, F2, 8, in[14], 3); \ -\ - ROUND2(B, C, D, E, A, F1, 8, in[12], 4); \ - ROUND2(A, B, C, D, E, F1, 5, in[15], 4); \ - ROUND2(E, A, B, C, D, F1, 12, in[10], 4); \ - ROUND2(D, E, A, B, C, F1, 9, in[ 4], 4); \ - ROUND2(C, D, E, A, B, F1, 12, in[ 1], 4); \ - ROUND2(B, C, D, E, A, F1, 5, in[ 5], 4); \ - ROUND2(A, B, C, D, E, F1, 14, in[ 8], 4); \ - ROUND2(E, A, B, C, D, F1, 6, in[ 7], 4); \ - ROUND2(D, E, A, B, C, F1, 8, in[ 6], 4); \ - ROUND2(C, D, E, A, B, F1, 13, in[ 2], 4); \ - ROUND2(B, C, D, E, A, F1, 6, in[13], 4); \ - ROUND2(A, B, C, D, E, F1, 5, in[14], 4); \ - ROUND2(E, A, B, C, D, F1, 15, in[ 0], 4); \ - ROUND2(D, E, A, B, C, F1, 13, in[ 3], 4); \ - ROUND2(C, D, E, A, B, F1, 11, in[ 9], 4); \ - ROUND2(B, C, D, E, A, F1, 11, in[11], 4); \ -\ - tmp = h[1] + C[0] + D[1]; \ - h[1] = h[2] + D[0] + E[1]; \ - h[2] = h[3] + E[0] + A[1]; \ - h[3] = h[4] + A[0] + B[1]; \ - h[4] = h[0] + B[0] + C[1]; \ - h[0] = tmp; \ -} -// END OF RIPEMD MACROS---------------------------------------------------------------------- - -__global__ -__launch_bounds__(768,1) /* will force 64 regs max on SM 3+ */ -void gpu_lbry_merged(const uint32_t threads, const uint32_t startNonce, uint32_t *resNonces, const uint64_t target64) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - - const uint64_t IV512[8] = { - 0x6A09E667F3BCC908, 0xBB67AE8584CAA73B, 0x3C6EF372FE94F82B, 0xA54FF53A5F1D36F1, - 0x510E527FADE682D1, 0x9B05688C2B3E6C1F, 0x1F83D9ABFB41BD6B, 0x5BE0CD19137E2179 - }; - - if (thread < threads) - { - uint64_t r[8]; - uint64_t W[16]; - uint32_t dat[16]; - uint32_t buf[8], state[8]; - uint32_t h[5]; - - *(uint2x4*)&dat[0] = *(uint2x4*)&c_dataEnd112[0]; - dat[ 8] = c_dataEnd112[ 8]; - dat[ 9] = c_dataEnd112[ 9]; - dat[10] = c_dataEnd112[10]; - dat[11] = startNonce + thread; - dat[12] = 0x80000000; - dat[13] = 0; - dat[14] = 0; - dat[15] = 0x380; - - *(uint2x4*)&state[0] = *(uint2x4*)&c_midstate112[0]; - *(uint2x4*)&buf[0] = *(uint2x4*)&c_midbuffer112[0]; - - sha256_round_first(dat, buf, state, c_K); - - // second sha256 - - #pragma unroll 8 - for(int i=0; i<8; i++){ - dat[i] = buf[i]; - } - dat[8] = 0x80000000; - - #pragma unroll 6 - for(int i=9; i<15; i++) dat[i] = 0; - dat[15] = 0x100; - - #pragma unroll 8 - for(int i=0; i<8; i++) - buf[i] = c_H256[i]; - - sha256_round_body(dat, buf, c_K); - -// SHA512------------------------------------------------------------------------------------- - - #pragma unroll 8 - for(int i=0; i<8; i++) - r[i] = IV512[i]; - - W[0] = vectorizeswap(((uint64_t*)buf)[0]); - W[1] = vectorizeswap(((uint64_t*)buf)[1]); - W[2] = vectorizeswap(((uint64_t*)buf)[2]); - W[3] = vectorizeswap(((uint64_t*)buf)[3]); - W[4] = 0x8000000000000000; // end tag - - #pragma unroll 10 - for (int i = 5; i < 15; i++) - W[i] = 0; - - W[15] = 0x100; // 256 bits - - #pragma unroll 16 - for (uint32_t i = 0; i < 16; i++) - { -// sha512_step2(r, W[ i], K_512[ i], i&7); - const uint32_t ord = i&7; - const uint64_t T1 = r[(15-ord) & 7] + K_512[ i] + W[ i] + bsg5_1(r[(12-ord) & 7]) + - xandx64(r[(12-ord) & 7], r[(13-ord) & 7], r[(14-ord) & 7]); - - r[(15-ord)& 7] = andor64(r[( 8-ord) & 7], r[( 9-ord) & 7], r[(10-ord) & 7]) + bsg5_0(r[( 8-ord) & 7]) + T1; - r[(11-ord)& 7] = r[(11-ord)& 7] + T1; - } - - #pragma unroll 5 - for (uint32_t i = 16; i < 80; i+=16) - { - #pragma unroll 16 - for (uint32_t j = 0; j<16; j++) - W[(i + j) & 15] = W[((i + j) - 7) & 15] + W[(i + j) & 15] + ssg5_0(W[((i + j) - 15) & 15]) + ssg5_1(W[((i + j) - 2) & 15]); - - #pragma unroll 16 - for (uint32_t j = 0; j<16; j++) { - - const uint32_t ord = (i+j)&7; - const uint64_t T1 = K_512[i+j] + W[ j] + r[(15-ord) & 7] + bsg5_1(r[(12-ord) & 7]) + - xandx64(r[(12-ord) & 7], r[(13-ord) & 7], r[(14-ord) & 7]); - - r[(15-ord)& 7] = andor64(r[( 8-ord) & 7], r[( 9-ord) & 7], r[(10-ord) & 7]) + bsg5_0(r[( 8-ord) & 7]) + T1; - r[(11-ord)& 7] = r[(11-ord)& 7] + T1; - } - } - -//END OF SHA512------------------------------------------------------------------------------ - #pragma unroll 4 - for (int i = 0; i < 4; i++) - *(uint64_t*)&dat[i*2] = cuda_swab64(r[i] + IV512[i]); - dat[8] = 0x80; - - #pragma unroll 7 - for (int i=9; i<16; i++) dat[i] = 0; - - dat[14] = 0x100; // size in bits - - #pragma unroll 5 - for (int i=0; i<5; i++) - h[i] = c_IV[i]; - - RIPEMD160_ROUND_BODY(dat, h); - - #pragma unroll 5 - for (int i=0; i<5; i++) - buf[i] = h[i]; - - // second 32 bytes block hash - #pragma unroll 4 - for (int i=0; i < 4; i++) - *(uint64_t*)&dat[i*2] = cuda_swab64(r[i+4] + IV512[i+4]); - - dat[8] = 0x80; - - #pragma unroll 7 - for (int i=9; i<16; i++) dat[i] = 0; - - dat[14] = 0x100; // size in bits - - #pragma unroll 5 - for (int i=0; i<5; i++) - h[i] = c_IV[i]; - - RIPEMD160_ROUND_BODY(dat, h); - - // first final sha256 - - #pragma unroll 5 - for (int i=0; i<5; i++) dat[i] = cuda_swab32(buf[i]); - #pragma unroll 5 - for (int i=0; i<5; i++) dat[i+5] = cuda_swab32(h[i]); - dat[10] = 0x80000000; - #pragma unroll 4 - for (int i=11; i<15; i++) dat[i] = 0; - - dat[15] = 0x140; - - #pragma unroll 8 - for(int i=0; i<8; i++) - buf[i] = c_H256[i]; - - sha256_round_body(dat, buf, c_K); - - // second sha256 - - #pragma unroll 8 - for(int i=0; i<8; i++) { - dat[i] = buf[i]; - } - dat[8] = 0x80000000; - - #pragma unroll 8 - for(int i=0; i<8; i++) - buf[i] = c_H256[i]; - - #pragma unroll 6 - for (int i=9; i<15; i++) dat[i] = 0; - dat[15] = 0x100; - - sha256_round_body_final(dat, buf, c_K); - - // valid nonces - if (cuda_swab64ll(buf[ 6],buf[ 7]) <= target64) { - uint32_t tmp = atomicExch(&resNonces[0], thread); - if (tmp != UINT32_MAX) - resNonces[1] = tmp; - } - } -} - -__host__ -void lbry_merged(int thr_id, uint32_t startNonce, uint32_t threads, uint32_t *d_resNonce, const uint64_t target64) -{ - uint32_t threadsperblock = 768; - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - - gpu_lbry_merged <<>> (threads,startNonce, d_resNonce, target64); -} diff --git a/lbry/cuda_sha256_lbry.cu b/lbry/cuda_sha256_lbry.cu deleted file mode 100644 index ed66994c..00000000 --- a/lbry/cuda_sha256_lbry.cu +++ /dev/null @@ -1,960 +0,0 @@ -/* - * sha256 + ripemd CUDA implementation for SM 5.0 GPUS (and lower) - * Tanguy Pruvot and Provos Alexis - Jul / Sep 2016 - * Sponsored by LBRY.IO team - */ - -#include -#include -#include - -#include -#include - -#include - -__constant__ static uint32_t _ALIGN(16) c_midstate112[8]; -__constant__ static uint32_t _ALIGN(16) c_midbuffer112[8]; -__constant__ static uint32_t _ALIGN(16) c_dataEnd112[12]; - -__constant__ const uint32_t c_H256[8] = { - 0x6A09E667U, 0xBB67AE85U, 0x3C6EF372U, 0xA54FF53AU, - 0x510E527FU, 0x9B05688CU, 0x1F83D9ABU, 0x5BE0CD19U -}; -__constant__ static uint32_t _ALIGN(16) c_K[64] = { - 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, - 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, - 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC, 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, - 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967, - 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, - 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, - 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, - 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2 -}; - -#ifdef __INTELLISENSE__ -#define atomicExch(p,y) y -#define __byte_perm(x,y,c) x -#endif - -// ------------------------------------------------------------------------------------------------ - -static const uint32_t cpu_H256[8] = { - 0x6A09E667U, 0xBB67AE85U, 0x3C6EF372U, 0xA54FF53AU, - 0x510E527FU, 0x9B05688CU, 0x1F83D9ABU, 0x5BE0CD19U -}; - -static const uint32_t cpu_K[64] = { - 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, - 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, - 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC, 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, - 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967, - 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, - 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, - 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, - 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2 -}; - -__host__ -static void sha256_step1_host(uint32_t a, uint32_t b, uint32_t c, uint32_t &d, - uint32_t e, uint32_t f, uint32_t g, uint32_t &h, uint32_t in, const uint32_t Kshared) -{ - uint32_t vxandx = (((f) ^ (g)) & (e)) ^ (g); // xandx(e, f, g); - uint32_t bsg21 = ROTR32(e, 6) ^ ROTR32(e, 11) ^ ROTR32(e, 25); // bsg2_1(e); - uint32_t bsg20 = ROTR32(a, 2) ^ ROTR32(a, 13) ^ ROTR32(a, 22); //bsg2_0(a); - uint32_t andorv = ((b) & (c)) | (((b) | (c)) & (a)); //andor32(a,b,c); - uint32_t t1 = h + bsg21 + vxandx + Kshared + in; - uint32_t t2 = bsg20 + andorv; - d = d + t1; - h = t1 + t2; -} - -__host__ -static void sha256_step2_host(uint32_t a, uint32_t b, uint32_t c, uint32_t &d, - uint32_t e, uint32_t f, uint32_t g, uint32_t &h, uint32_t* in, uint32_t pc, const uint32_t Kshared) -{ - int pcidx1 = (pc-2) & 0xF; - int pcidx2 = (pc-7) & 0xF; - int pcidx3 = (pc-15) & 0xF; - - uint32_t inx0 = in[pc]; - uint32_t inx1 = in[pcidx1]; - uint32_t inx2 = in[pcidx2]; - uint32_t inx3 = in[pcidx3]; - - uint32_t ssg21 = ROTR32(inx1, 17) ^ ROTR32(inx1, 19) ^ SPH_T32((inx1) >> 10); //ssg2_1(inx1); - uint32_t ssg20 = ROTR32(inx3, 7) ^ ROTR32(inx3, 18) ^ SPH_T32((inx3) >> 3); //ssg2_0(inx3); - uint32_t vxandx = (((f) ^ (g)) & (e)) ^ (g); // xandx(e, f, g); - uint32_t bsg21 = ROTR32(e, 6) ^ ROTR32(e, 11) ^ ROTR32(e, 25); // bsg2_1(e); - uint32_t bsg20 = ROTR32(a, 2) ^ ROTR32(a, 13) ^ ROTR32(a, 22); //bsg2_0(a); - uint32_t andorv = ((b) & (c)) | (((b) | (c)) & (a)); //andor32(a,b,c); - uint32_t t1,t2; - - in[pc] = ssg21 + inx2 + ssg20 + inx0; - - t1 = h + bsg21 + vxandx + Kshared + in[pc]; - t2 = bsg20 + andorv; - d = d + t1; - h = t1 + t2; -} - -__host__ -static void sha256_round_body_host(uint32_t* in, uint32_t* state, const uint32_t* Kshared) -{ - uint32_t a = state[0]; - uint32_t b = state[1]; - uint32_t c = state[2]; - uint32_t d = state[3]; - uint32_t e = state[4]; - uint32_t f = state[5]; - uint32_t g = state[6]; - uint32_t h = state[7]; - - sha256_step1_host(a,b,c,d,e,f,g,h,in[0], Kshared[0]); - sha256_step1_host(h,a,b,c,d,e,f,g,in[1], Kshared[1]); - sha256_step1_host(g,h,a,b,c,d,e,f,in[2], Kshared[2]); - sha256_step1_host(f,g,h,a,b,c,d,e,in[3], Kshared[3]); - sha256_step1_host(e,f,g,h,a,b,c,d,in[4], Kshared[4]); - sha256_step1_host(d,e,f,g,h,a,b,c,in[5], Kshared[5]); - sha256_step1_host(c,d,e,f,g,h,a,b,in[6], Kshared[6]); - sha256_step1_host(b,c,d,e,f,g,h,a,in[7], Kshared[7]); - sha256_step1_host(a,b,c,d,e,f,g,h,in[8], Kshared[8]); - sha256_step1_host(h,a,b,c,d,e,f,g,in[9], Kshared[9]); - sha256_step1_host(g,h,a,b,c,d,e,f,in[10],Kshared[10]); - sha256_step1_host(f,g,h,a,b,c,d,e,in[11],Kshared[11]); - sha256_step1_host(e,f,g,h,a,b,c,d,in[12],Kshared[12]); - sha256_step1_host(d,e,f,g,h,a,b,c,in[13],Kshared[13]); - sha256_step1_host(c,d,e,f,g,h,a,b,in[14],Kshared[14]); - sha256_step1_host(b,c,d,e,f,g,h,a,in[15],Kshared[15]); - - for (int i=0; i<3; i++) - { - sha256_step2_host(a,b,c,d,e,f,g,h,in,0, Kshared[16+16*i]); - sha256_step2_host(h,a,b,c,d,e,f,g,in,1, Kshared[17+16*i]); - sha256_step2_host(g,h,a,b,c,d,e,f,in,2, Kshared[18+16*i]); - sha256_step2_host(f,g,h,a,b,c,d,e,in,3, Kshared[19+16*i]); - sha256_step2_host(e,f,g,h,a,b,c,d,in,4, Kshared[20+16*i]); - sha256_step2_host(d,e,f,g,h,a,b,c,in,5, Kshared[21+16*i]); - sha256_step2_host(c,d,e,f,g,h,a,b,in,6, Kshared[22+16*i]); - sha256_step2_host(b,c,d,e,f,g,h,a,in,7, Kshared[23+16*i]); - sha256_step2_host(a,b,c,d,e,f,g,h,in,8, Kshared[24+16*i]); - sha256_step2_host(h,a,b,c,d,e,f,g,in,9, Kshared[25+16*i]); - sha256_step2_host(g,h,a,b,c,d,e,f,in,10,Kshared[26+16*i]); - sha256_step2_host(f,g,h,a,b,c,d,e,in,11,Kshared[27+16*i]); - sha256_step2_host(e,f,g,h,a,b,c,d,in,12,Kshared[28+16*i]); - sha256_step2_host(d,e,f,g,h,a,b,c,in,13,Kshared[29+16*i]); - sha256_step2_host(c,d,e,f,g,h,a,b,in,14,Kshared[30+16*i]); - sha256_step2_host(b,c,d,e,f,g,h,a,in,15,Kshared[31+16*i]); - } - - state[0] += a; - state[1] += b; - state[2] += c; - state[3] += d; - state[4] += e; - state[5] += f; - state[6] += g; - state[7] += h; -} - -#define xor3b(a,b,c) (a ^ b ^ c) - -__device__ __forceinline__ uint32_t bsg2_0(const uint32_t x) -{ - return xor3b(ROTR32(x,2),ROTR32(x,13),ROTR32(x,22)); -} - -__device__ __forceinline__ uint32_t bsg2_1(const uint32_t x) -{ - return xor3b(ROTR32(x,6),ROTR32(x,11),ROTR32(x,25)); -} - -__device__ __forceinline__ uint32_t ssg2_0(const uint32_t x) -{ - return xor3b(ROTR32(x,7),ROTR32(x,18),(x>>3)); -} - -__device__ __forceinline__ uint32_t ssg2_1(const uint32_t x) -{ - return xor3b(ROTR32(x,17),ROTR32(x,19),(x>>10)); -} - -__device__ __forceinline__ uint2 vectorizeswap(uint64_t v) -{ - uint2 result; - asm("mov.b64 {%0,%1},%2; // vectorizeswap \n\t" - : "=r"(result.y), "=r"(result.x) : "l"(v)); - return result; -} - -#define Maj(x, y, z) ((x & (y | z)) | (y & z)) -#define Ch(a, b, c) (((b^c) & a) ^ c) - -__device__ __forceinline__ -static void sha2_step(const uint32_t a,const uint32_t b,const uint32_t c, uint32_t &d,const uint32_t e,const uint32_t f,const uint32_t g, uint32_t &h,const uint32_t in, const uint32_t Kshared) -{ - const uint32_t t1 = h + bsg2_1(e) + Ch(e, f, g) + Kshared + in; - h = t1 + bsg2_0(a) + Maj(a, b, c); - d+= t1; - -} - -__device__ __forceinline__ -static void sha256_round_first(uint32_t *const __restrict__ in,uint32_t *const __restrict__ buf,const uint32_t *const __restrict__ state,const uint32_t* __restrict__ Kshared) -{ - uint32_t a = buf[0] + in[11]; - uint32_t b = buf[1]; - uint32_t c = buf[2]; - uint32_t d = buf[3]; - uint32_t e = buf[4] + in[11]; - uint32_t f = buf[5]; - uint32_t g = buf[6]; - uint32_t h = buf[7]; - - // 10 first steps made on host - //sha2_step(f,g,h,a,b,c,d,e,in[11],Kshared[11]); - - sha2_step(e,f,g,h,a,b,c,d,in[12],Kshared[12]); - sha2_step(d,e,f,g,h,a,b,c,in[13],Kshared[13]); - sha2_step(c,d,e,f,g,h,a,b,in[14],Kshared[14]); - sha2_step(b,c,d,e,f,g,h,a,in[15],Kshared[15]); - - //in is partially precomputed on host - in[2]+= in[11]; - in[4]+= ssg2_1(in[2]); - in[6]+= ssg2_1(in[4]); - in[8]+= ssg2_1(in[6]); - in[9]+= in[ 2]; - - sha2_step(a,b,c,d,e,f,g,h,in[0], Kshared[16]); - sha2_step(h,a,b,c,d,e,f,g,in[1], Kshared[17]); - sha2_step(g,h,a,b,c,d,e,f,in[2], Kshared[18]); - sha2_step(f,g,h,a,b,c,d,e,in[3], Kshared[19]); - sha2_step(e,f,g,h,a,b,c,d,in[4], Kshared[20]); - sha2_step(d,e,f,g,h,a,b,c,in[5], Kshared[21]); - sha2_step(c,d,e,f,g,h,a,b,in[6], Kshared[22]); - sha2_step(b,c,d,e,f,g,h,a,in[7], Kshared[23]); - sha2_step(a,b,c,d,e,f,g,h,in[8], Kshared[24]); - sha2_step(h,a,b,c,d,e,f,g,in[9], Kshared[25]); - - #pragma unroll 6 - for (uint32_t j = 10; j < 16; j++){ - in[j] = in[j] + in[(j + 9) & 15] + ssg2_0(in[(j + 1) & 15]) + ssg2_1(in[(j + 14) & 15]); - } - - sha2_step(g,h,a,b,c,d,e,f,in[10],Kshared[26]); - sha2_step(f,g,h,a,b,c,d,e,in[11],Kshared[27]); - sha2_step(e,f,g,h,a,b,c,d,in[12],Kshared[28]); - sha2_step(d,e,f,g,h,a,b,c,in[13],Kshared[29]); - sha2_step(c,d,e,f,g,h,a,b,in[14],Kshared[30]); - sha2_step(b,c,d,e,f,g,h,a,in[15],Kshared[31]); - - #pragma unroll 16 - for (uint32_t j = 0; j < 16; j++){ - in[j] = in[j] + in[(j + 9) & 15] + ssg2_0(in[(j + 1) & 15]) + ssg2_1(in[(j + 14) & 15]); - } - - sha2_step(a,b,c,d,e,f,g,h,in[0], Kshared[16+16]); - sha2_step(h,a,b,c,d,e,f,g,in[1], Kshared[17+16]); - sha2_step(g,h,a,b,c,d,e,f,in[2], Kshared[18+16]); - sha2_step(f,g,h,a,b,c,d,e,in[3], Kshared[19+16]); - sha2_step(e,f,g,h,a,b,c,d,in[4], Kshared[20+16]); - sha2_step(d,e,f,g,h,a,b,c,in[5], Kshared[21+16]); - sha2_step(c,d,e,f,g,h,a,b,in[6], Kshared[22+16]); - sha2_step(b,c,d,e,f,g,h,a,in[7], Kshared[23+16]); - sha2_step(a,b,c,d,e,f,g,h,in[8], Kshared[24+16]); - sha2_step(h,a,b,c,d,e,f,g,in[9], Kshared[25+16]); - sha2_step(g,h,a,b,c,d,e,f,in[10],Kshared[26+16]); - sha2_step(f,g,h,a,b,c,d,e,in[11],Kshared[27+16]); - sha2_step(e,f,g,h,a,b,c,d,in[12],Kshared[28+16]); - sha2_step(d,e,f,g,h,a,b,c,in[13],Kshared[29+16]); - sha2_step(c,d,e,f,g,h,a,b,in[14],Kshared[30+16]); - sha2_step(b,c,d,e,f,g,h,a,in[15],Kshared[31+16]); - - #pragma unroll 16 - for (uint32_t j = 0; j < 16; j++){ - in[j] = in[j] + in[(j + 9) & 15] + ssg2_0(in[(j + 1) & 15]) + ssg2_1(in[(j + 14) & 15]); - } - - sha2_step(a,b,c,d,e,f,g,h,in[0], Kshared[16+16*2]); - sha2_step(h,a,b,c,d,e,f,g,in[1], Kshared[17+16*2]); - sha2_step(g,h,a,b,c,d,e,f,in[2], Kshared[18+16*2]); - sha2_step(f,g,h,a,b,c,d,e,in[3], Kshared[19+16*2]); - sha2_step(e,f,g,h,a,b,c,d,in[4], Kshared[20+16*2]); - sha2_step(d,e,f,g,h,a,b,c,in[5], Kshared[21+16*2]); - sha2_step(c,d,e,f,g,h,a,b,in[6], Kshared[22+16*2]); - sha2_step(b,c,d,e,f,g,h,a,in[7], Kshared[23+16*2]); - sha2_step(a,b,c,d,e,f,g,h,in[8], Kshared[24+16*2]); - sha2_step(h,a,b,c,d,e,f,g,in[9], Kshared[25+16*2]); - sha2_step(g,h,a,b,c,d,e,f,in[10],Kshared[26+16*2]); - sha2_step(f,g,h,a,b,c,d,e,in[11],Kshared[27+16*2]); - sha2_step(e,f,g,h,a,b,c,d,in[12],Kshared[28+16*2]); - sha2_step(d,e,f,g,h,a,b,c,in[13],Kshared[29+16*2]); - sha2_step(c,d,e,f,g,h,a,b,in[14],Kshared[30+16*2]); - sha2_step(b,c,d,e,f,g,h,a,in[15],Kshared[31+16*2]); - - buf[ 0] = state[0] + a; - buf[ 1] = state[1] + b; - buf[ 2] = state[2] + c; - buf[ 3] = state[3] + d; - buf[ 4] = state[4] + e; - buf[ 5] = state[5] + f; - buf[ 6] = state[6] + g; - buf[ 7] = state[7] + h; -} - -__device__ __forceinline__ -static void sha256_round_body(uint32_t *const __restrict__ in, uint32_t *const __restrict__ state,const uint32_t *const __restrict__ Kshared) -{ - uint32_t a = state[0]; - uint32_t b = state[1]; - uint32_t c = state[2]; - uint32_t d = state[3]; - uint32_t e = state[4]; - uint32_t f = state[5]; - uint32_t g = state[6]; - uint32_t h = state[7]; - - sha2_step(a,b,c,d,e,f,g,h,in[0], Kshared[0]); - sha2_step(h,a,b,c,d,e,f,g,in[1], Kshared[1]); - sha2_step(g,h,a,b,c,d,e,f,in[2], Kshared[2]); - sha2_step(f,g,h,a,b,c,d,e,in[3], Kshared[3]); - sha2_step(e,f,g,h,a,b,c,d,in[4], Kshared[4]); - sha2_step(d,e,f,g,h,a,b,c,in[5], Kshared[5]); - sha2_step(c,d,e,f,g,h,a,b,in[6], Kshared[6]); - sha2_step(b,c,d,e,f,g,h,a,in[7], Kshared[7]); - sha2_step(a,b,c,d,e,f,g,h,in[8], Kshared[8]); - sha2_step(h,a,b,c,d,e,f,g,in[9], Kshared[9]); - sha2_step(g,h,a,b,c,d,e,f,in[10],Kshared[10]); - sha2_step(f,g,h,a,b,c,d,e,in[11],Kshared[11]); - sha2_step(e,f,g,h,a,b,c,d,in[12],Kshared[12]); - sha2_step(d,e,f,g,h,a,b,c,in[13],Kshared[13]); - sha2_step(c,d,e,f,g,h,a,b,in[14],Kshared[14]); - sha2_step(b,c,d,e,f,g,h,a,in[15],Kshared[15]); - - #pragma unroll 3 - for (uint32_t i=0; i<3; i++) - { - #pragma unroll 16 - for (uint32_t j = 0; j < 16; j++){ - in[j] = in[j] + in[(j + 9) & 15] + ssg2_0(in[(j + 1) & 15]) + ssg2_1(in[(j + 14) & 15]); - } - sha2_step(a, b, c, d, e, f, g, h, in[0], Kshared[16 + 16 * i]); - sha2_step(h, a, b, c, d, e, f, g, in[1], Kshared[17 + 16 * i]); - sha2_step(g, h, a, b, c, d, e, f, in[2], Kshared[18 + 16 * i]); - sha2_step(f, g, h, a, b, c, d, e, in[3], Kshared[19 + 16 * i]); - sha2_step(e, f, g, h, a, b, c, d, in[4], Kshared[20 + 16 * i]); - sha2_step(d, e, f, g, h, a, b, c, in[5], Kshared[21 + 16 * i]); - sha2_step(c, d, e, f, g, h, a, b, in[6], Kshared[22 + 16 * i]); - sha2_step(b, c, d, e, f, g, h, a, in[7], Kshared[23 + 16 * i]); - sha2_step(a, b, c, d, e, f, g, h, in[8], Kshared[24 + 16 * i]); - sha2_step(h, a, b, c, d, e, f, g, in[9], Kshared[25 + 16 * i]); - sha2_step(g, h, a, b, c, d, e, f, in[10], Kshared[26 + 16 * i]); - sha2_step(f, g, h, a, b, c, d, e, in[11], Kshared[27 + 16 * i]); - sha2_step(e, f, g, h, a, b, c, d, in[12], Kshared[28 + 16 * i]); - sha2_step(d, e, f, g, h, a, b, c, in[13], Kshared[29 + 16 * i]); - sha2_step(c, d, e, f, g, h, a, b, in[14], Kshared[30 + 16 * i]); - sha2_step(b, c, d, e, f, g, h, a, in[15], Kshared[31 + 16 * i]); - } - - state[0] += a; - state[1] += b; - state[2] += c; - state[3] += d; - state[4] += e; - state[5] += f; - state[6] += g; - state[7] += h; -} - -__device__ __forceinline__ -static void sha256_round_body_final(uint32_t *const __restrict__ in, uint32_t *const __restrict__ state,const uint32_t *const __restrict__ Kshared) -{ - uint32_t a = state[0]; - uint32_t b = state[1]; - uint32_t c = state[2]; - uint32_t d = state[3]; - uint32_t e = state[4]; - uint32_t f = state[5]; - uint32_t g = state[6]; - uint32_t h = state[7]; - - sha2_step(a,b,c,d,e,f,g,h,in[0], Kshared[0]); - sha2_step(h,a,b,c,d,e,f,g,in[1], Kshared[1]); - sha2_step(g,h,a,b,c,d,e,f,in[2], Kshared[2]); - sha2_step(f,g,h,a,b,c,d,e,in[3], Kshared[3]); - sha2_step(e,f,g,h,a,b,c,d,in[4], Kshared[4]); - sha2_step(d,e,f,g,h,a,b,c,in[5], Kshared[5]); - sha2_step(c,d,e,f,g,h,a,b,in[6], Kshared[6]); - sha2_step(b,c,d,e,f,g,h,a,in[7], Kshared[7]); - sha2_step(a,b,c,d,e,f,g,h,in[8], Kshared[8]); - sha2_step(h,a,b,c,d,e,f,g,in[9], Kshared[9]); - sha2_step(g,h,a,b,c,d,e,f,in[10],Kshared[10]); - sha2_step(f,g,h,a,b,c,d,e,in[11],Kshared[11]); - sha2_step(e,f,g,h,a,b,c,d,in[12],Kshared[12]); - sha2_step(d,e,f,g,h,a,b,c,in[13],Kshared[13]); - sha2_step(c,d,e,f,g,h,a,b,in[14],Kshared[14]); - sha2_step(b,c,d,e,f,g,h,a,in[15],Kshared[15]); - - #pragma unroll 2 - for (uint32_t i=0; i<2; i++) - { - #pragma unroll 16 - for (uint32_t j = 0; j < 16; j++){ - in[j] = in[j] + in[(j + 9) & 15] + ssg2_0(in[(j + 1) & 15]) + ssg2_1(in[(j + 14) & 15]); - } - sha2_step(a, b, c, d, e, f, g, h, in[0], Kshared[16 + 16 * i]); - sha2_step(h, a, b, c, d, e, f, g, in[1], Kshared[17 + 16 * i]); - sha2_step(g, h, a, b, c, d, e, f, in[2], Kshared[18 + 16 * i]); - sha2_step(f, g, h, a, b, c, d, e, in[3], Kshared[19 + 16 * i]); - sha2_step(e, f, g, h, a, b, c, d, in[4], Kshared[20 + 16 * i]); - sha2_step(d, e, f, g, h, a, b, c, in[5], Kshared[21 + 16 * i]); - sha2_step(c, d, e, f, g, h, a, b, in[6], Kshared[22 + 16 * i]); - sha2_step(b, c, d, e, f, g, h, a, in[7], Kshared[23 + 16 * i]); - sha2_step(a, b, c, d, e, f, g, h, in[8], Kshared[24 + 16 * i]); - sha2_step(h, a, b, c, d, e, f, g, in[9], Kshared[25 + 16 * i]); - sha2_step(g, h, a, b, c, d, e, f, in[10], Kshared[26 + 16 * i]); - sha2_step(f, g, h, a, b, c, d, e, in[11], Kshared[27 + 16 * i]); - sha2_step(e, f, g, h, a, b, c, d, in[12], Kshared[28 + 16 * i]); - sha2_step(d, e, f, g, h, a, b, c, in[13], Kshared[29 + 16 * i]); - sha2_step(c, d, e, f, g, h, a, b, in[14], Kshared[30 + 16 * i]); - sha2_step(b, c, d, e, f, g, h, a, in[15], Kshared[31 + 16 * i]); - } - #pragma unroll 16 - for (uint32_t j = 0; j < 16; j++){ - in[j] = in[j] + in[(j + 9) & 15] + ssg2_0(in[(j + 1) & 15]) + ssg2_1(in[(j + 14) & 15]); - } - sha2_step(a, b, c, d, e, f, g, h, in[0], Kshared[16 + 16 * 2]); - sha2_step(h, a, b, c, d, e, f, g, in[1], Kshared[17 + 16 * 2]); - sha2_step(g, h, a, b, c, d, e, f, in[2], Kshared[18 + 16 * 2]); - sha2_step(f, g, h, a, b, c, d, e, in[3], Kshared[19 + 16 * 2]); - sha2_step(e, f, g, h, a, b, c, d, in[4], Kshared[20 + 16 * 2]); - sha2_step(d, e, f, g, h, a, b, c, in[5], Kshared[21 + 16 * 2]); - sha2_step(c, d, e, f, g, h, a, b, in[6], Kshared[22 + 16 * 2]); - sha2_step(b, c, d, e, f, g, h, a, in[7], Kshared[23 + 16 * 2]); - sha2_step(a, b, c, d, e, f, g, h, in[8], Kshared[24 + 16 * 2]); - sha2_step(h, a, b, c, d, e, f, g, in[9], Kshared[25 + 16 * 2]); - sha2_step(g, h, a, b, c, d, e, f, in[10], Kshared[26 + 16 * 2]); - sha2_step(f, g, h, a, b, c, d, e, in[11], Kshared[27 + 16 * 2]); - sha2_step(e, f, g, h, a, b, c, d, in[12], Kshared[28 + 16 * 2]); - sha2_step(d, e, f, g, h, a, b, c, in[13], Kshared[29 + 16 * 2]); - - state[6] += g; - state[7] += h; -} - - __device__ __forceinline__ -uint64_t cuda_swab64ll(const uint32_t x, const uint32_t y) { - uint64_t r; - asm("prmt.b32 %1, %1, 0, 0x0123; // swab64ll\n\t" - "prmt.b32 %2, %2, 0, 0x0123;\n\t" - "mov.b64 %0, {%1,%2};\n\t" - : "=l"(r): "r"(x), "r"(y) ); - return r; -} - -__global__ -#if CUDA_VERSION > 6050 -__launch_bounds__(768,2) /* to force 32 regs */ -#endif -void lbry_sha256d_gpu_hash_112(const uint32_t threads, const uint32_t startNonce, uint64_t *outputHash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - uint32_t buf[8], state[8]; - if (thread < threads) - { - uint32_t dat[16]; - - #pragma unroll 11 - for (uint32_t i=0; i<11; i++) dat[i] = c_dataEnd112[i]; - dat[11] = startNonce + thread; - dat[12] = 0x80000000; - dat[13] = 0; - dat[14] = 0; - dat[15] = 0x380; - - *(uint2x4*)&state[0] = *(uint2x4*)&c_midstate112[0]; - *(uint2x4*)&buf[0] = *(uint2x4*)&c_midbuffer112[0]; - - sha256_round_first(dat, buf, state, c_K); // no shared mem here - - // second sha256 - - *(uint2x4*)&dat[0] = *(uint2x4*)&buf[0]; - - dat[8] = 0x80000000; - - #pragma unroll 6 - for (uint32_t i=9; i<15; i++) dat[i] = 0; - dat[15] = 0x100; - - *(uint2x4*)&buf[0] = *(uint2x4*)&c_H256[0]; - - sha256_round_body(dat, buf, c_K); //no shared mem at all - - // output - *(uint2*)&buf[0] = vectorizeswap(((uint64_t*)buf)[0]); - *(uint2*)&buf[2] = vectorizeswap(((uint64_t*)buf)[1]); - *(uint2*)&buf[4] = vectorizeswap(((uint64_t*)buf)[2]); - *(uint2*)&buf[6] = vectorizeswap(((uint64_t*)buf)[3]); - - *(uint2x4*)&outputHash[thread<<3] = *(uint2x4*)&buf[0]; - } -} - -__host__ -void lbry_sha256d_hash_112(int thr_id, uint32_t threads, uint32_t startNonce, uint32_t *d_outputHash){ - - const int threadsperblock = 768; - - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - - lbry_sha256d_gpu_hash_112 <<>> (threads, startNonce, (uint64_t*) d_outputHash); -} - -__host__ -void lbry_sha256_init(int thr_id) -{ - cudaMemcpyToSymbol(c_K, cpu_K, sizeof(cpu_K), 0, cudaMemcpyHostToDevice); -} - -__host__ -void lbry_sha256_setBlock_112(uint32_t *pdata){ - - uint32_t in[16], buf[8], end[16]; - for (int i=0;i<16;i++) in[i] = cuda_swab32(pdata[i]); - for (int i=0; i<8;i++) buf[i] = cpu_H256[i]; - for (int i=0;i<11;i++) end[i] = cuda_swab32(pdata[16+i]); - sha256_round_body_host(in, buf, cpu_K); - - cudaMemcpyToSymbol(c_midstate112, buf, 32, 0, cudaMemcpyHostToDevice); - - uint32_t a = buf[0]; - uint32_t b = buf[1]; - uint32_t c = buf[2]; - uint32_t d = buf[3]; - uint32_t e = buf[4]; - uint32_t f = buf[5]; - uint32_t g = buf[6]; - uint32_t h = buf[7]; - - sha256_step1_host(a,b,c,d,e,f,g,h,end[0], cpu_K[0]); - sha256_step1_host(h,a,b,c,d,e,f,g,end[1], cpu_K[1]); - sha256_step1_host(g,h,a,b,c,d,e,f,end[2], cpu_K[2]); - sha256_step1_host(f,g,h,a,b,c,d,e,end[3], cpu_K[3]); - sha256_step1_host(e,f,g,h,a,b,c,d,end[4], cpu_K[4]); - sha256_step1_host(d,e,f,g,h,a,b,c,end[5], cpu_K[5]); - sha256_step1_host(c,d,e,f,g,h,a,b,end[6], cpu_K[6]); - sha256_step1_host(b,c,d,e,f,g,h,a,end[7], cpu_K[7]); - sha256_step1_host(a,b,c,d,e,f,g,h,end[8], cpu_K[8]); - sha256_step1_host(h,a,b,c,d,e,f,g,end[9], cpu_K[9]); - sha256_step1_host(g,h,a,b,c,d,e,f,end[10],cpu_K[10]); - sha256_step1_host(f, g, h, a, b, c, d, e, 0, cpu_K[11]); - - buf[0] = a; - buf[1] = b; - buf[2] = c; - buf[3] = d; - buf[4] = e; - buf[5] = f; - buf[6] = g; - buf[7] = h; - - cudaMemcpyToSymbol(c_midbuffer112, buf, 32, 0, cudaMemcpyHostToDevice); - - end[12] = 0x80000000; - end[13] = 0; - end[14] = 0; - end[15] = 0x380; - uint32_t x2_0,x2_1; - - x2_0 = ROTR32(end[1], 7) ^ ROTR32(end[1], 18) ^ SPH_T32(end[1] >> 3); //ssg2_0(end[1]); -// x2_1 = ROTR32(end[14], 17) ^ ROTR32(end[14], 19) ^ SPH_T32(end[14] >> 10) + x2_0; //ssg2_1(end[14]) + x2_0; - end[0] = end[0] + end[9] + x2_0; - - x2_0 = ROTR32(end[2], 7) ^ ROTR32(end[2], 18) ^ SPH_T32(end[2] >> 3); - x2_1 = (ROTR32(end[15], 17) ^ ROTR32(end[15], 19) ^ SPH_T32(end[15] >> 10)) + x2_0; - end[1] = end[1] + end[10] + x2_1; - - x2_0 = ROTR32(end[3], 7) ^ ROTR32(end[3], 18) ^ SPH_T32(end[3] >> 3);//ssg2_0(end[3]); - x2_1 = (ROTR32(end[0], 17) ^ ROTR32(end[0], 19) ^ SPH_T32(end[0] >> 10)) + x2_0; - end[2]+= x2_1; - - x2_0 = ROTR32(end[4], 7) ^ ROTR32(end[4], 18) ^ SPH_T32(end[4] >> 3);//ssg2_0(end[4]); - x2_1 = (ROTR32(end[1], 17) ^ ROTR32(end[1], 19) ^ SPH_T32(end[1] >> 10)) + x2_0; - end[3] = end[3] + end[12] + x2_1; - - x2_0 = ROTR32(end[5], 7) ^ ROTR32(end[5], 18) ^ SPH_T32(end[5] >> 3);//ssg2_0(end[4]); - end[4] = end[4] + end[13] + x2_0; - - x2_0 = ROTR32(end[6], 7) ^ ROTR32(end[6], 18) ^ SPH_T32(end[6] >> 3);//ssg2_0(end[6]); - x2_1 = (ROTR32(end[3], 17) ^ ROTR32(end[3], 19) ^ SPH_T32(end[3] >> 10)) + x2_0; - end[5] = end[5] + end[14] + x2_1; - - x2_0 = ROTR32(end[7], 7) ^ ROTR32(end[7], 18) ^ SPH_T32(end[7] >> 3);//ssg2_0(end[7]); - end[6] = end[6] + end[15] + x2_0; - - x2_0 = ROTR32(end[8], 7) ^ ROTR32(end[8], 18) ^ SPH_T32(end[8] >> 3);//ssg2_0(end[8]); - x2_1 = (ROTR32(end[5], 17) ^ ROTR32(end[5], 19) ^ SPH_T32(end[5] >> 10)) + x2_0; - end[7] = end[7] + end[0] + x2_1; - - x2_0 = ROTR32(end[9], 7) ^ ROTR32(end[9], 18) ^ SPH_T32(end[9] >> 3);//ssg2_0(end[9]); - end[8] = end[8] + end[1] + x2_0; - - x2_0 = ROTR32(end[10], 7) ^ ROTR32(end[10], 18) ^ SPH_T32(end[10] >> 3);//ssg2_0(end[10]); - x2_1 = (ROTR32(end[7], 17) ^ ROTR32(end[7], 19) ^ SPH_T32(end[7] >> 10)) + x2_0; - end[9] = end[9] + x2_1; - - cudaMemcpyToSymbol(c_dataEnd112, end, 12*sizeof(uint32_t), 0, cudaMemcpyHostToDevice); -} - -// ------------------------------------------------------------------------------------------ - -static __constant__ const uint32_t c_IV[5] = { 0x67452301u, 0xEFCDAB89u, 0x98BADCFEu, 0x10325476u, 0xC3D2E1F0u }; - -static __constant__ const uint32_t c_K1[5] = { 0, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E }; - -static __constant__ const uint32_t c_K2[5] = { 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0 }; - -__device__ __forceinline__ -static uint32_t ROTATE(const uint32_t x,const uint32_t r){ - if(r==8) - return __byte_perm(x, 0, 0x2103); - else - return ROTL32(x,r); -} - -/* - * Round functions for RIPEMD-160. - */ -#define F1(x, y, z) (x ^ y ^ z) -#define F2(x, y, z) ((x & (y ^ z)) ^ z) -#define F3(x, y, z) ((x | ~y) ^ z) -#define F4(x, y, z) (y ^ ((x ^ y) & z)) -#define F5(x, y, z) (x ^ (y | ~z)) - -/* - * Round constants for RIPEMD-160. - */ -#define RR(a, b, c, d, e, f, s, r, k) { \ - a = e + ROTATE((a + r + k + f(b, c, d)), s); \ - c = ROTL32(c, 10); \ -} - -#define ROUND1(a, b, c, d, e, f, s, r, k) \ - RR(a[0], b[0], c[0], d[0], e[0], f, s, r, c_K1[k]) - -#define ROUND2(a, b, c, d, e, f, s, r, k) \ - RR(a[1], b[1], c[1], d[1], e[1], f, s, r, c_K2[k]) - -#define RIPEMD160_ROUND_BODY(in, h) { \ - uint32_t A[2], B[2], C[2], D[2], E[2]; \ - uint32_t tmp; \ -\ - A[0] = A[1] = h[0]; \ - B[0] = B[1] = h[1]; \ - C[0] = C[1] = h[2]; \ - D[0] = D[1] = h[3]; \ - E[0] = E[1] = h[4]; \ -\ - ROUND1(A, B, C, D, E, F1, 11, in[ 0], 0); \ - ROUND1(E, A, B, C, D, F1, 14, in[ 1], 0); \ - ROUND1(D, E, A, B, C, F1, 15, in[ 2], 0); \ - ROUND1(C, D, E, A, B, F1, 12, in[ 3], 0); \ - ROUND1(B, C, D, E, A, F1, 5, in[ 4], 0); \ - ROUND1(A, B, C, D, E, F1, 8, in[ 5], 0); \ - ROUND1(E, A, B, C, D, F1, 7, in[ 6], 0); \ - ROUND1(D, E, A, B, C, F1, 9, in[ 7], 0); \ - ROUND1(C, D, E, A, B, F1, 11, in[ 8], 0); \ - ROUND1(B, C, D, E, A, F1, 13, in[ 9], 0); \ - ROUND1(A, B, C, D, E, F1, 14, in[10], 0); \ - ROUND1(E, A, B, C, D, F1, 15, in[11], 0); \ - ROUND1(D, E, A, B, C, F1, 6, in[12], 0); \ - ROUND1(C, D, E, A, B, F1, 7, in[13], 0); \ - ROUND1(B, C, D, E, A, F1, 9, in[14], 0); \ - ROUND1(A, B, C, D, E, F1, 8, in[15], 0); \ -\ - ROUND1(E, A, B, C, D, F2, 7, in[ 7], 1); \ - ROUND1(D, E, A, B, C, F2, 6, in[ 4], 1); \ - ROUND1(C, D, E, A, B, F2, 8, in[13], 1); \ - ROUND1(B, C, D, E, A, F2, 13, in[ 1], 1); \ - ROUND1(A, B, C, D, E, F2, 11, in[10], 1); \ - ROUND1(E, A, B, C, D, F2, 9, in[ 6], 1); \ - ROUND1(D, E, A, B, C, F2, 7, in[15], 1); \ - ROUND1(C, D, E, A, B, F2, 15, in[ 3], 1); \ - ROUND1(B, C, D, E, A, F2, 7, in[12], 1); \ - ROUND1(A, B, C, D, E, F2, 12, in[ 0], 1); \ - ROUND1(E, A, B, C, D, F2, 15, in[ 9], 1); \ - ROUND1(D, E, A, B, C, F2, 9, in[ 5], 1); \ - ROUND1(C, D, E, A, B, F2, 11, in[ 2], 1); \ - ROUND1(B, C, D, E, A, F2, 7, in[14], 1); \ - ROUND1(A, B, C, D, E, F2, 13, in[11], 1); \ - ROUND1(E, A, B, C, D, F2, 12, in[ 8], 1); \ -\ - ROUND1(D, E, A, B, C, F3, 11, in[ 3], 2); \ - ROUND1(C, D, E, A, B, F3, 13, in[10], 2); \ - ROUND1(B, C, D, E, A, F3, 6, in[14], 2); \ - ROUND1(A, B, C, D, E, F3, 7, in[ 4], 2); \ - ROUND1(E, A, B, C, D, F3, 14, in[ 9], 2); \ - ROUND1(D, E, A, B, C, F3, 9, in[15], 2); \ - ROUND1(C, D, E, A, B, F3, 13, in[ 8], 2); \ - ROUND1(B, C, D, E, A, F3, 15, in[ 1], 2); \ - ROUND1(A, B, C, D, E, F3, 14, in[ 2], 2); \ - ROUND1(E, A, B, C, D, F3, 8, in[ 7], 2); \ - ROUND1(D, E, A, B, C, F3, 13, in[ 0], 2); \ - ROUND1(C, D, E, A, B, F3, 6, in[ 6], 2); \ - ROUND1(B, C, D, E, A, F3, 5, in[13], 2); \ - ROUND1(A, B, C, D, E, F3, 12, in[11], 2); \ - ROUND1(E, A, B, C, D, F3, 7, in[ 5], 2); \ - ROUND1(D, E, A, B, C, F3, 5, in[12], 2); \ -\ - ROUND1(C, D, E, A, B, F4, 11, in[ 1], 3); \ - ROUND1(B, C, D, E, A, F4, 12, in[ 9], 3); \ - ROUND1(A, B, C, D, E, F4, 14, in[11], 3); \ - ROUND1(E, A, B, C, D, F4, 15, in[10], 3); \ - ROUND1(D, E, A, B, C, F4, 14, in[ 0], 3); \ - ROUND1(C, D, E, A, B, F4, 15, in[ 8], 3); \ - ROUND1(B, C, D, E, A, F4, 9, in[12], 3); \ - ROUND1(A, B, C, D, E, F4, 8, in[ 4], 3); \ - ROUND1(E, A, B, C, D, F4, 9, in[13], 3); \ - ROUND1(D, E, A, B, C, F4, 14, in[ 3], 3); \ - ROUND1(C, D, E, A, B, F4, 5, in[ 7], 3); \ - ROUND1(B, C, D, E, A, F4, 6, in[15], 3); \ - ROUND1(A, B, C, D, E, F4, 8, in[14], 3); \ - ROUND1(E, A, B, C, D, F4, 6, in[ 5], 3); \ - ROUND1(D, E, A, B, C, F4, 5, in[ 6], 3); \ - ROUND1(C, D, E, A, B, F4, 12, in[ 2], 3); \ -\ - ROUND1(B, C, D, E, A, F5, 9, in[ 4], 4); \ - ROUND1(A, B, C, D, E, F5, 15, in[ 0], 4); \ - ROUND1(E, A, B, C, D, F5, 5, in[ 5], 4); \ - ROUND1(D, E, A, B, C, F5, 11, in[ 9], 4); \ - ROUND1(C, D, E, A, B, F5, 6, in[ 7], 4); \ - ROUND1(B, C, D, E, A, F5, 8, in[12], 4); \ - ROUND1(A, B, C, D, E, F5, 13, in[ 2], 4); \ - ROUND1(E, A, B, C, D, F5, 12, in[10], 4); \ - ROUND1(D, E, A, B, C, F5, 5, in[14], 4); \ - ROUND1(C, D, E, A, B, F5, 12, in[ 1], 4); \ - ROUND1(B, C, D, E, A, F5, 13, in[ 3], 4); \ - ROUND1(A, B, C, D, E, F5, 14, in[ 8], 4); \ - ROUND1(E, A, B, C, D, F5, 11, in[11], 4); \ - ROUND1(D, E, A, B, C, F5, 8, in[ 6], 4); \ - ROUND1(C, D, E, A, B, F5, 5, in[15], 4); \ - ROUND1(B, C, D, E, A, F5, 6, in[13], 4); \ -\ - ROUND2(A, B, C, D, E, F5, 8, in[ 5], 0); \ - ROUND2(E, A, B, C, D, F5, 9, in[14], 0); \ - ROUND2(D, E, A, B, C, F5, 9, in[ 7], 0); \ - ROUND2(C, D, E, A, B, F5, 11, in[ 0], 0); \ - ROUND2(B, C, D, E, A, F5, 13, in[ 9], 0); \ - ROUND2(A, B, C, D, E, F5, 15, in[ 2], 0); \ - ROUND2(E, A, B, C, D, F5, 15, in[11], 0); \ - ROUND2(D, E, A, B, C, F5, 5, in[ 4], 0); \ - ROUND2(C, D, E, A, B, F5, 7, in[13], 0); \ - ROUND2(B, C, D, E, A, F5, 7, in[ 6], 0); \ - ROUND2(A, B, C, D, E, F5, 8, in[15], 0); \ - ROUND2(E, A, B, C, D, F5, 11, in[ 8], 0); \ - ROUND2(D, E, A, B, C, F5, 14, in[ 1], 0); \ - ROUND2(C, D, E, A, B, F5, 14, in[10], 0); \ - ROUND2(B, C, D, E, A, F5, 12, in[ 3], 0); \ - ROUND2(A, B, C, D, E, F5, 6, in[12], 0); \ -\ - ROUND2(E, A, B, C, D, F4, 9, in[ 6], 1); \ - ROUND2(D, E, A, B, C, F4, 13, in[11], 1); \ - ROUND2(C, D, E, A, B, F4, 15, in[ 3], 1); \ - ROUND2(B, C, D, E, A, F4, 7, in[ 7], 1); \ - ROUND2(A, B, C, D, E, F4, 12, in[ 0], 1); \ - ROUND2(E, A, B, C, D, F4, 8, in[13], 1); \ - ROUND2(D, E, A, B, C, F4, 9, in[ 5], 1); \ - ROUND2(C, D, E, A, B, F4, 11, in[10], 1); \ - ROUND2(B, C, D, E, A, F4, 7, in[14], 1); \ - ROUND2(A, B, C, D, E, F4, 7, in[15], 1); \ - ROUND2(E, A, B, C, D, F4, 12, in[ 8], 1); \ - ROUND2(D, E, A, B, C, F4, 7, in[12], 1); \ - ROUND2(C, D, E, A, B, F4, 6, in[ 4], 1); \ - ROUND2(B, C, D, E, A, F4, 15, in[ 9], 1); \ - ROUND2(A, B, C, D, E, F4, 13, in[ 1], 1); \ - ROUND2(E, A, B, C, D, F4, 11, in[ 2], 1); \ -\ - ROUND2(D, E, A, B, C, F3, 9, in[15], 2); \ - ROUND2(C, D, E, A, B, F3, 7, in[ 5], 2); \ - ROUND2(B, C, D, E, A, F3, 15, in[ 1], 2); \ - ROUND2(A, B, C, D, E, F3, 11, in[ 3], 2); \ - ROUND2(E, A, B, C, D, F3, 8, in[ 7], 2); \ - ROUND2(D, E, A, B, C, F3, 6, in[14], 2); \ - ROUND2(C, D, E, A, B, F3, 6, in[ 6], 2); \ - ROUND2(B, C, D, E, A, F3, 14, in[ 9], 2); \ - ROUND2(A, B, C, D, E, F3, 12, in[11], 2); \ - ROUND2(E, A, B, C, D, F3, 13, in[ 8], 2); \ - ROUND2(D, E, A, B, C, F3, 5, in[12], 2); \ - ROUND2(C, D, E, A, B, F3, 14, in[ 2], 2); \ - ROUND2(B, C, D, E, A, F3, 13, in[10], 2); \ - ROUND2(A, B, C, D, E, F3, 13, in[ 0], 2); \ - ROUND2(E, A, B, C, D, F3, 7, in[ 4], 2); \ - ROUND2(D, E, A, B, C, F3, 5, in[13], 2); \ -\ - ROUND2(C, D, E, A, B, F2, 15, in[ 8], 3); \ - ROUND2(B, C, D, E, A, F2, 5, in[ 6], 3); \ - ROUND2(A, B, C, D, E, F2, 8, in[ 4], 3); \ - ROUND2(E, A, B, C, D, F2, 11, in[ 1], 3); \ - ROUND2(D, E, A, B, C, F2, 14, in[ 3], 3); \ - ROUND2(C, D, E, A, B, F2, 14, in[11], 3); \ - ROUND2(B, C, D, E, A, F2, 6, in[15], 3); \ - ROUND2(A, B, C, D, E, F2, 14, in[ 0], 3); \ - ROUND2(E, A, B, C, D, F2, 6, in[ 5], 3); \ - ROUND2(D, E, A, B, C, F2, 9, in[12], 3); \ - ROUND2(C, D, E, A, B, F2, 12, in[ 2], 3); \ - ROUND2(B, C, D, E, A, F2, 9, in[13], 3); \ - ROUND2(A, B, C, D, E, F2, 12, in[ 9], 3); \ - ROUND2(E, A, B, C, D, F2, 5, in[ 7], 3); \ - ROUND2(D, E, A, B, C, F2, 15, in[10], 3); \ - ROUND2(C, D, E, A, B, F2, 8, in[14], 3); \ -\ - ROUND2(B, C, D, E, A, F1, 8, in[12], 4); \ - ROUND2(A, B, C, D, E, F1, 5, in[15], 4); \ - ROUND2(E, A, B, C, D, F1, 12, in[10], 4); \ - ROUND2(D, E, A, B, C, F1, 9, in[ 4], 4); \ - ROUND2(C, D, E, A, B, F1, 12, in[ 1], 4); \ - ROUND2(B, C, D, E, A, F1, 5, in[ 5], 4); \ - ROUND2(A, B, C, D, E, F1, 14, in[ 8], 4); \ - ROUND2(E, A, B, C, D, F1, 6, in[ 7], 4); \ - ROUND2(D, E, A, B, C, F1, 8, in[ 6], 4); \ - ROUND2(C, D, E, A, B, F1, 13, in[ 2], 4); \ - ROUND2(B, C, D, E, A, F1, 6, in[13], 4); \ - ROUND2(A, B, C, D, E, F1, 5, in[14], 4); \ - ROUND2(E, A, B, C, D, F1, 15, in[ 0], 4); \ - ROUND2(D, E, A, B, C, F1, 13, in[ 3], 4); \ - ROUND2(C, D, E, A, B, F1, 11, in[ 9], 4); \ - ROUND2(B, C, D, E, A, F1, 11, in[11], 4); \ -\ - tmp = h[1] + C[0] + D[1]; \ - h[1] = h[2] + D[0] + E[1]; \ - h[2] = h[3] + E[0] + A[1]; \ - h[3] = h[4] + A[0] + B[1]; \ - h[4] = h[0] + B[0] + C[1]; \ - h[0] = tmp; \ -} - -__global__ -#if CUDA_VERSION > 6050 -__launch_bounds__(1024,2) /* to force 32 regs */ -#endif -void lbry_ripemd(const uint32_t threads, uint64_t *Hash512){ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - uint32_t dat[16]; - uint32_t h[5]; - uint32_t buf[8]; // align for vectorize - if(thread 6050 -__launch_bounds__(768,2) /* to force 32 regs */ -#endif -void lbry_sha256d_gpu_hash_final(const uint32_t threads, uint64_t *Hash512, uint32_t *resNonces,const uint64_t target64) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - uint32_t dat[16]; - uint32_t buf[8]; // align for vectorize - if (thread < threads) - { - // first final sha256 - - uint32_t* input = (uint32_t*) (&Hash512[thread<<3]); - - *(uint2x4*)&dat[0] = __ldg4((uint2x4*)&input[0]); - *(uint2*)&dat[8] = __ldg((uint2*)&input[8]); - dat[10] = 0x80000000; - #pragma unroll 4 - for (int i=11; i<15; i++) dat[i] = 0; - dat[15] = 0x140; - - *(uint2x4*)&buf[0] = *(uint2x4*)&c_H256[0]; - - sha256_round_body(dat, buf, c_K); // s_K uses too many regs - - // second sha256 - - *(uint2x4*)&dat[0] = *(uint2x4*)&buf[0]; - *(uint2x4*)&buf[0] = *(uint2x4*)&c_H256[0]; - - dat[8] = 0x80000000; - - #pragma unroll 6 - for (int i=9; i<15; i++) dat[i] = 0; - dat[15] = 0x100; - - sha256_round_body_final(dat, buf, c_K); - - // valid nonces - if (cuda_swab64ll(buf[ 6],buf[ 7]) <= target64) { - uint32_t tmp = atomicExch(&resNonces[0], thread); - if (tmp != UINT32_MAX) - resNonces[1] = tmp; - } - } -} - -__host__ -void lbry_sha256d_hash_final(int thr_id, uint32_t threads, uint32_t *d_inputHash, uint32_t *d_resNonce, const uint64_t target64) -{ - int threadsperblock; - - threadsperblock = 1024; - dim3 grid1((threads + threadsperblock - 1) / threadsperblock); - dim3 block1(threadsperblock); - - threadsperblock = 768; - dim3 grid2((threads + threadsperblock - 1) / threadsperblock); - dim3 block2(threadsperblock); - lbry_ripemd <<>> (threads,(uint64_t*) d_inputHash); - lbry_sha256d_gpu_hash_final <<>> (threads, (uint64_t*) d_inputHash, d_resNonce, target64); -} diff --git a/lbry/cuda_sha512_lbry.cu b/lbry/cuda_sha512_lbry.cu deleted file mode 100644 index fea598bd..00000000 --- a/lbry/cuda_sha512_lbry.cu +++ /dev/null @@ -1,140 +0,0 @@ -/** - * sha-512 CUDA implementation. - * Tanguy Pruvot and Provos Alexis - Jul / Sep 2016 - * Sponsored by LBRY.IO team - */ - -//#define USE_ROT_ASM_OPT 0 -#include -#include - -#include - -static __constant__ _ALIGN(8) uint64_t K_512[80] = { - 0x428A2F98D728AE22, 0x7137449123EF65CD, 0xB5C0FBCFEC4D3B2F, 0xE9B5DBA58189DBBC, - 0x3956C25BF348B538, 0x59F111F1B605D019, 0x923F82A4AF194F9B, 0xAB1C5ED5DA6D8118, - 0xD807AA98A3030242, 0x12835B0145706FBE, 0x243185BE4EE4B28C, 0x550C7DC3D5FFB4E2, - 0x72BE5D74F27B896F, 0x80DEB1FE3B1696B1, 0x9BDC06A725C71235, 0xC19BF174CF692694, - 0xE49B69C19EF14AD2, 0xEFBE4786384F25E3, 0x0FC19DC68B8CD5B5, 0x240CA1CC77AC9C65, - 0x2DE92C6F592B0275, 0x4A7484AA6EA6E483, 0x5CB0A9DCBD41FBD4, 0x76F988DA831153B5, - 0x983E5152EE66DFAB, 0xA831C66D2DB43210, 0xB00327C898FB213F, 0xBF597FC7BEEF0EE4, - 0xC6E00BF33DA88FC2, 0xD5A79147930AA725, 0x06CA6351E003826F, 0x142929670A0E6E70, - 0x27B70A8546D22FFC, 0x2E1B21385C26C926, 0x4D2C6DFC5AC42AED, 0x53380D139D95B3DF, - 0x650A73548BAF63DE, 0x766A0ABB3C77B2A8, 0x81C2C92E47EDAEE6, 0x92722C851482353B, - 0xA2BFE8A14CF10364, 0xA81A664BBC423001, 0xC24B8B70D0F89791, 0xC76C51A30654BE30, - 0xD192E819D6EF5218, 0xD69906245565A910, 0xF40E35855771202A, 0x106AA07032BBD1B8, - 0x19A4C116B8D2D0C8, 0x1E376C085141AB53, 0x2748774CDF8EEB99, 0x34B0BCB5E19B48A8, - 0x391C0CB3C5C95A63, 0x4ED8AA4AE3418ACB, 0x5B9CCA4F7763E373, 0x682E6FF3D6B2B8A3, - 0x748F82EE5DEFB2FC, 0x78A5636F43172F60, 0x84C87814A1F0AB72, 0x8CC702081A6439EC, - 0x90BEFFFA23631E28, 0xA4506CEBDE82BDE9, 0xBEF9A3F7B2C67915, 0xC67178F2E372532B, - 0xCA273ECEEA26619C, 0xD186B8C721C0C207, 0xEADA7DD6CDE0EB1E, 0xF57D4F7FEE6ED178, - 0x06F067AA72176FBA, 0x0A637DC5A2C898A6, 0x113F9804BEF90DAE, 0x1B710B35131C471B, - 0x28DB77F523047D84, 0x32CAAB7B40C72493, 0x3C9EBE0A15C9BEBC, 0x431D67C49C100D4C, - 0x4CC5D4BECB3E42B6, 0x597F299CFC657E2A, 0x5FCB6FAB3AD6FAEC, 0x6C44198C4A475817 -}; - -#undef xor3 -#define xor3(a,b,c) (a^b^c) - -//#define ROR64_8(x) ROTR64(x,8) -__device__ __inline__ -uint64_t ROR64_8(const uint64_t u64) { - const uint2 a = vectorize(u64); - uint2 result; - result.x = __byte_perm(a.y, a.x, 0x0765); - result.y = __byte_perm(a.y, a.x, 0x4321); - return devectorize(result); -} - -#define bsg5_0(x) xor3(ROTR64(x,28),ROTR64(x,34),ROTR64(x,39)) -#define bsg5_1(x) xor3(ROTR64(x,14),ROTR64(x,18),ROTR64(x,41)) -#define ssg5_0(x) xor3(ROTR64(x,1), ROR64_8(x), x>>7) -#define ssg5_1(x) xor3(ROTR64(x,19),ROTR64(x,61), x>>6) - -#define andor64(a,b,c) ((a & (b | c)) | (b & c)) -#define xandx64(e,f,g) (g ^ (e & (g ^ f))) - -__device__ __forceinline__ -static void sha512_step2(uint64_t *const r,const uint64_t W,const uint64_t K, const int ord) -{ - const uint64_t T1 = r[(15-ord) & 7] + K + W + bsg5_1(r[(12-ord) & 7]) + xandx64(r[(12-ord) & 7],r[(13-ord) & 7],r[(14-ord) & 7]); - r[(15-ord) & 7] = andor64(r[(8-ord) & 7],r[(9-ord) & 7],r[(10-ord) & 7]) + bsg5_0(r[(8-ord) & 7]) + T1; - r[(11-ord) & 7]+= T1; -} - -/**************************************************************************************************/ - -__global__ -#if CUDA_VERSION > 6050 -__launch_bounds__(512,2) -#endif -void lbry_sha512_gpu_hash_32(const uint32_t threads, uint64_t *g_hash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - const uint64_t IV512[8] = { - 0x6A09E667F3BCC908, 0xBB67AE8584CAA73B, 0x3C6EF372FE94F82B, 0xA54FF53A5F1D36F1, - 0x510E527FADE682D1, 0x9B05688C2B3E6C1F, 0x1F83D9ABFB41BD6B, 0x5BE0CD19137E2179 - }; - uint64_t r[8]; - uint64_t W[16]; - if (thread < threads) - { - uint64_t *pHash = &g_hash[thread<<3]; - - *(uint2x4*)&r[0] = *(uint2x4*)&IV512[0]; - *(uint2x4*)&r[4] = *(uint2x4*)&IV512[4]; - - *(uint2x4*)&W[0] = __ldg4((uint2x4*)pHash); - - W[4] = 0x8000000000000000; // end tag - - #pragma unroll - for (uint32_t i = 5; i < 15; i++) W[i] = 0; - - W[15] = 0x100; // 256 bits - - #pragma unroll 16 - for (int i = 0; i < 16; i ++){ - sha512_step2(r, W[i], K_512[i], i&7); - } - - #pragma unroll 5 - for (uint32_t i = 16; i < 80; i+=16){ - #pragma unroll - for (uint32_t j = 0; j<16; j++){ - W[(i + j) & 15] += W[((i + j) - 7) & 15] + ssg5_0(W[((i + j) - 15) & 15]) + ssg5_1(W[((i + j) - 2) & 15]); - } - #pragma unroll - for (uint32_t j = 0; j<16; j++){ - sha512_step2(r, W[j], K_512[i+j], (i+j)&7); - } - } - - #pragma unroll 8 - for (uint32_t i = 0; i < 8; i++) - r[i] = cuda_swab64(r[i] + IV512[i]); - - *(uint2x4*)&pHash[0] = *(uint2x4*)&r[0]; - *(uint2x4*)&pHash[4] = *(uint2x4*)&r[4]; - - } -} - -__host__ -void lbry_sha512_hash_32(int thr_id, uint32_t threads, uint32_t *d_hash) -{ - const uint32_t threadsperblock = 256; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - lbry_sha512_gpu_hash_32 <<>> (threads, (uint64_t*)d_hash); -} - -/**************************************************************************************************/ - -__host__ -void lbry_sha512_init(int thr_id) -{ -// cudaMemcpyToSymbol(K_512, K512, 80*sizeof(uint64_t), 0, cudaMemcpyHostToDevice); -} diff --git a/lbry/lbry.cu b/lbry/lbry.cu deleted file mode 100644 index 89f67cd6..00000000 --- a/lbry/lbry.cu +++ /dev/null @@ -1,242 +0,0 @@ -/** - * Lbry Algo (sha-256 / sha-512 / ripemd) - * - * tpruvot and Provos Alexis - Jan 2017 - * - * Sponsored by LBRY.IO team - */ - -#include -#include - -extern "C" { -#include -#include -} - -#include -#include - -#define A 64 -#define debug_cpu 0 - -extern "C" void lbry_hash(void* output, const void* input) -{ - uint32_t _ALIGN(A) hashA[16]; - uint32_t _ALIGN(A) hashB[8]; - uint32_t _ALIGN(A) hashC[8]; - - sph_sha256_context ctx_sha256; - sph_sha512_context ctx_sha512; - sph_ripemd160_context ctx_ripemd; - - sph_sha256_init(&ctx_sha256); - sph_sha256(&ctx_sha256, input, 112); - sph_sha256_close(&ctx_sha256, hashA); - - sph_sha256(&ctx_sha256, hashA, 32); - sph_sha256_close(&ctx_sha256, hashA); - - sph_sha512_init(&ctx_sha512); - sph_sha512(&ctx_sha512, hashA, 32); - sph_sha512_close(&ctx_sha512, hashA); - - sph_ripemd160_init(&ctx_ripemd); - sph_ripemd160(&ctx_ripemd, hashA, 32); // sha512 low - sph_ripemd160_close(&ctx_ripemd, hashB); - if (debug_cpu) applog_hex(hashB, 20); - - sph_ripemd160(&ctx_ripemd, &hashA[8], 32); // sha512 high - sph_ripemd160_close(&ctx_ripemd, hashC); - if (debug_cpu) applog_hex(hashC, 20); - - sph_sha256(&ctx_sha256, hashB, 20); - sph_sha256(&ctx_sha256, hashC, 20); - sph_sha256_close(&ctx_sha256, hashA); - if (debug_cpu) applog_hex(hashA,32); - - sph_sha256(&ctx_sha256, hashA, 32); - sph_sha256_close(&ctx_sha256, hashA); - - memcpy(output, hashA, 32); -} - -/* ############################################################################################################################### */ - -extern void lbry_sha256_init(int thr_id); -extern void lbry_sha256_free(int thr_id); -extern void lbry_sha256_setBlock_112(uint32_t *pdata); -extern void lbry_sha256d_hash_112(int thr_id, uint32_t threads, uint32_t startNonce, uint32_t *d_outputHash); -extern void lbry_sha512_init(int thr_id); -extern void lbry_sha512_hash_32(int thr_id, uint32_t threads, uint32_t *d_hash); -extern void lbry_sha256d_hash_final(int thr_id, uint32_t threads, uint32_t *d_inputHash, uint32_t *d_resNonce, const uint64_t target64); - -extern void lbry_sha256_setBlock_112_merged(uint32_t *pdata); -extern void lbry_merged(int thr_id,uint32_t startNonce, uint32_t threads, uint32_t *d_resNonce, const uint64_t target64); - -static __inline uint32_t swab32_if(uint32_t val, bool iftrue) { - return iftrue ? swab32(val) : val; -} - -static bool init[MAX_GPUS] = { 0 }; - -static uint32_t *d_hash[MAX_GPUS]; -static uint32_t *d_resNonce[MAX_GPUS]; -// nonce position is different -#define LBC_NONCE_OFT32 27 - -extern "C" int scanhash_lbry(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t _ALIGN(A) endiandata[28]; - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - - const uint32_t first_nonce = pdata[LBC_NONCE_OFT32]; - const int swap = 0; // to toggle nonce endian (need kernel change) - - const int dev_id = device_map[thr_id]; - const bool merged_kernel = (device_sm[dev_id] > 500); - - int intensity = (device_sm[dev_id] > 500 && !is_windows()) ? 22 : 20; - if (device_sm[dev_id] >= 600) intensity = 23; - if (device_sm[dev_id] < 350) intensity = 18; - - uint32_t throughput = cuda_default_throughput(thr_id, 1U << intensity); - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) { - ptarget[7] = 0xf; - } - - if (!init[thr_id]){ - cudaSetDevice(dev_id); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - cudaDeviceSetCacheConfig(cudaFuncCachePreferL1); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - cuda_get_arch(thr_id); - - if (CUDART_VERSION == 6050) { - applog(LOG_ERR, "This lbry kernel is not compatible with CUDA 6.5!"); - proper_exit(EXIT_FAILURE); - } - - if (!merged_kernel) - CUDA_SAFE_CALL(cudaMalloc(&d_hash[thr_id], (size_t)64 * throughput)); - - CUDA_SAFE_CALL(cudaMalloc(&d_resNonce[thr_id], 2 * sizeof(uint32_t))); - CUDA_LOG_ERROR(); - - init[thr_id] = true; - } - - for (int i=0; i < LBC_NONCE_OFT32; i++) { - be32enc(&endiandata[i], pdata[i]); - } - - if (merged_kernel) - lbry_sha256_setBlock_112_merged(endiandata); - else - lbry_sha256_setBlock_112(endiandata); - - cudaMemset(d_resNonce[thr_id], 0xFF, 2 * sizeof(uint32_t)); - - do { - uint32_t resNonces[2] = { UINT32_MAX, UINT32_MAX }; - - // Hash with CUDA - if (merged_kernel) { - lbry_merged(thr_id, pdata[LBC_NONCE_OFT32], throughput, d_resNonce[thr_id], AS_U64(&ptarget[6])); - } else { - lbry_sha256d_hash_112(thr_id, throughput, pdata[LBC_NONCE_OFT32], d_hash[thr_id]); - lbry_sha512_hash_32(thr_id, throughput, d_hash[thr_id]); - lbry_sha256d_hash_final(thr_id, throughput, d_hash[thr_id], d_resNonce[thr_id], AS_U64(&ptarget[6])); - } - - *hashes_done = pdata[LBC_NONCE_OFT32] - first_nonce + throughput; - - cudaMemcpy(resNonces, d_resNonce[thr_id], 2 * sizeof(uint32_t), cudaMemcpyDeviceToHost); - - if (resNonces[0] != UINT32_MAX) - { - uint32_t _ALIGN(A) vhash[8]; - const uint32_t Htarg = ptarget[7]; - const uint32_t startNonce = pdata[LBC_NONCE_OFT32]; - resNonces[0] += startNonce; - - endiandata[LBC_NONCE_OFT32] = swab32_if(resNonces[0], !swap); - lbry_hash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) - { - work->nonces[0] = swab32_if(resNonces[0], swap); - work_set_target_ratio(work, vhash); - work->valid_nonces = 1; - - if (resNonces[1] != UINT32_MAX) - { - resNonces[1] += startNonce; - endiandata[LBC_NONCE_OFT32] = swab32_if(resNonces[1], !swap); - lbry_hash(vhash, endiandata); - work->nonces[1] = swab32_if(resNonces[1], swap); - - if (bn_hash_target_ratio(vhash, ptarget) > work->shareratio[0]) { - // best first - xchg(work->nonces[1], work->nonces[0]); - work->sharediff[1] = work->sharediff[0]; - work->shareratio[1] = work->shareratio[0]; - work_set_target_ratio(work, vhash); - } else { - bn_set_target_ratio(work, vhash, 1); - } - work->valid_nonces++; - } - - pdata[LBC_NONCE_OFT32] = max(work->nonces[0], work->nonces[1]); // next scan start - - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", resNonces[0]); - cudaMemset(d_resNonce[thr_id], 0xFF, 2 * sizeof(uint32_t)); - } - } - - if ((uint64_t) throughput + pdata[LBC_NONCE_OFT32] >= max_nonce) { - pdata[LBC_NONCE_OFT32] = max_nonce; - break; - } - - pdata[LBC_NONCE_OFT32] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[LBC_NONCE_OFT32] - first_nonce; - - return 0; -} - -// cleanup -void free_lbry(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - if(device_sm[device_map[thr_id]] <= 500) - cudaFree(d_hash[thr_id]); - - cudaFree(d_resNonce[thr_id]); - - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/lyra2/Lyra2.c b/lyra2/Lyra2.c deleted file mode 100644 index 1f0a953e..00000000 --- a/lyra2/Lyra2.c +++ /dev/null @@ -1,214 +0,0 @@ -/** - * Implementation of the Lyra2 Password Hashing Scheme (PHS). - * - * Author: The Lyra PHC team (http://www.lyra-kdf.net/) -- 2014. - * - * This software is hereby placed in the public domain. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#include -#include -#include -#include - -#include "Lyra2.h" -#include "Sponge.h" - -/** - * Executes Lyra2 based on the G function from Blake2b. This version supports salts and passwords - * whose combined length is smaller than the size of the memory matrix, (i.e., (nRows x nCols x b) bits, - * where "b" is the underlying sponge's bitrate). In this implementation, the "basil" is composed by all - * integer parameters (treated as type "unsigned int") in the order they are provided, plus the value - * of nCols, (i.e., basil = kLen || pwdlen || saltlen || timeCost || nRows || nCols). - * - * @param K The derived key to be output by the algorithm - * @param kLen Desired key length - * @param pwd User password - * @param pwdlen Password length - * @param salt Salt - * @param saltlen Salt length - * @param timeCost Parameter to determine the processing time (T) - * @param nRows Number or rows of the memory matrix (R) - * @param nCols Number of columns of the memory matrix (C) - * - * @return 0 if the key is generated correctly; -1 if there is an error (usually due to lack of memory for allocation) - */ -int LYRA2(void *K, int64_t kLen, const void *pwd, int32_t pwdlen, const void *salt, int32_t saltlen, int64_t timeCost, const int16_t nRows, const int16_t nCols) -{ - //============================= Basic variables ============================// - int64_t row = 2; //index of row to be processed - int64_t prev = 1; //index of prev (last row ever computed/modified) - int64_t rowa = 0; //index of row* (a previous row, deterministically picked during Setup and randomly picked while Wandering) - int64_t tau; //Time Loop iterator - int64_t step = 1; //Visitation step (used during Setup and Wandering phases) - int64_t window = 2; //Visitation window (used to define which rows can be revisited during Setup) - int64_t gap = 1; //Modifier to the step, assuming the values 1 or -1 - int64_t i; //auxiliary iteration counter - int64_t v64; // 64bit var for memcpy - //==========================================================================/ - - //========== Initializing the Memory Matrix and pointers to it =============// - //Tries to allocate enough space for the whole memory matrix - - const int64_t ROW_LEN_INT64 = BLOCK_LEN_INT64 * nCols; - const int64_t ROW_LEN_BYTES = ROW_LEN_INT64 * 8; - // for Lyra2REv2, nCols = 4, v1 was using 8 - const int64_t BLOCK_LEN = (nCols == 4) ? BLOCK_LEN_BLAKE2_SAFE_INT64 : BLOCK_LEN_BLAKE2_SAFE_BYTES; - - size_t sz = (size_t)ROW_LEN_BYTES * nRows; - uint64_t *wholeMatrix = malloc(sz); - if (wholeMatrix == NULL) { - return -1; - } - memset(wholeMatrix, 0, sz); - - //Allocates pointers to each row of the matrix - uint64_t **memMatrix = malloc(sizeof(uint64_t*) * nRows); - if (memMatrix == NULL) { - return -1; - } - //Places the pointers in the correct positions - uint64_t *ptrWord = wholeMatrix; - for (i = 0; i < nRows; i++) { - memMatrix[i] = ptrWord; - ptrWord += ROW_LEN_INT64; - } - //==========================================================================/ - - //============= Getting the password + salt + basil padded with 10*1 ===============// - //OBS.:The memory matrix will temporarily hold the password: not for saving memory, - //but this ensures that the password copied locally will be overwritten as soon as possible - - //First, we clean enough blocks for the password, salt, basil and padding - int64_t nBlocksInput = ((saltlen + pwdlen + 6 * sizeof(uint64_t)) / BLOCK_LEN_BLAKE2_SAFE_BYTES) + 1; - - byte *ptrByte = (byte*) wholeMatrix; - - //Prepends the password - memcpy(ptrByte, pwd, pwdlen); - ptrByte += pwdlen; - - //Concatenates the salt - memcpy(ptrByte, salt, saltlen); - ptrByte += saltlen; - - memset(ptrByte, 0, (size_t) (nBlocksInput * BLOCK_LEN_BLAKE2_SAFE_BYTES - (saltlen + pwdlen))); - - //Concatenates the basil: every integer passed as parameter, in the order they are provided by the interface - memcpy(ptrByte, &kLen, sizeof(int64_t)); - ptrByte += sizeof(uint64_t); - v64 = pwdlen; - memcpy(ptrByte, &v64, sizeof(int64_t)); - ptrByte += sizeof(uint64_t); - v64 = saltlen; - memcpy(ptrByte, &v64, sizeof(int64_t)); - ptrByte += sizeof(uint64_t); - v64 = timeCost; - memcpy(ptrByte, &v64, sizeof(int64_t)); - ptrByte += sizeof(uint64_t); - v64 = nRows; - memcpy(ptrByte, &v64, sizeof(int64_t)); - ptrByte += sizeof(uint64_t); - v64 = nCols; - memcpy(ptrByte, &v64, sizeof(int64_t)); - ptrByte += sizeof(uint64_t); - - //Now comes the padding - *ptrByte = 0x80; //first byte of padding: right after the password - ptrByte = (byte*) wholeMatrix; //resets the pointer to the start of the memory matrix - ptrByte += nBlocksInput * BLOCK_LEN_BLAKE2_SAFE_BYTES - 1; //sets the pointer to the correct position: end of incomplete block - *ptrByte ^= 0x01; //last byte of padding: at the end of the last incomplete block - //==========================================================================/ - - //======================= Initializing the Sponge State ====================// - //Sponge state: 16 uint64_t, BLOCK_LEN_INT64 words of them for the bitrate (b) and the remainder for the capacity (c) - uint64_t state[16]; - initState(state); - //==========================================================================/ - - //================================ Setup Phase =============================// - //Absorbing salt, password and basil: this is the only place in which the block length is hard-coded to 512 bits - ptrWord = wholeMatrix; - for (i = 0; i < nBlocksInput; i++) { - absorbBlockBlake2Safe(state, ptrWord); //absorbs each block of pad(pwd || salt || basil) - ptrWord += BLOCK_LEN; //goes to next block of pad(pwd || salt || basil) - } - - //Initializes M[0] and M[1] - reducedSqueezeRow0(state, memMatrix[0], nCols); //The locally copied password is most likely overwritten here - - reducedDuplexRow1(state, memMatrix[0], memMatrix[1], nCols); - - do { - //M[row] = rand; //M[row*] = M[row*] XOR rotW(rand) - - reducedDuplexRowSetup(state, memMatrix[prev], memMatrix[rowa], memMatrix[row], nCols); - - //updates the value of row* (deterministically picked during Setup)) - rowa = (rowa + step) & (window - 1); - //update prev: it now points to the last row ever computed - prev = row; - //updates row: goes to the next row to be computed - row++; - - //Checks if all rows in the window where visited. - if (rowa == 0) { - step = window + gap; //changes the step: approximately doubles its value - window *= 2; //doubles the size of the re-visitation window - gap = -gap; //inverts the modifier to the step - } - - } while (row < nRows); - //==========================================================================/ - - //============================ Wandering Phase =============================// - row = 0; //Resets the visitation to the first row of the memory matrix - for (tau = 1; tau <= timeCost; tau++) { - //Step is approximately half the number of all rows of the memory matrix for an odd tau; otherwise, it is -1 - step = (tau % 2 == 0) ? -1 : nRows / 2 - 1; - do { - //Selects a pseudorandom index row* - //------------------------------------------------------------------------------------------ - rowa = state[0] & (unsigned int)(nRows-1); //(USE THIS IF nRows IS A POWER OF 2) - //rowa = state[0] % nRows; //(USE THIS FOR THE "GENERIC" CASE) - //------------------------------------------------------------------------------------------ - - //Performs a reduced-round duplexing operation over M[row*] XOR M[prev], updating both M[row*] and M[row] - reducedDuplexRow(state, memMatrix[prev], memMatrix[rowa], memMatrix[row], nCols); - - //update prev: it now points to the last row ever computed - prev = row; - - //updates row: goes to the next row to be computed - //------------------------------------------------------------------------------------------ - row = (row + step) & (unsigned int)(nRows-1); //(USE THIS IF nRows IS A POWER OF 2) - //row = (row + step) % nRows; //(USE THIS FOR THE "GENERIC" CASE) - //------------------------------------------------------------------------------------------ - - } while (row != 0); - } - - //============================ Wrap-up Phase ===============================// - //Absorbs the last block of the memory matrix - absorbBlock(state, memMatrix[rowa]); - - //Squeezes the key - squeeze(state, K, (unsigned int) kLen); - - //========================= Freeing the memory =============================// - free(memMatrix); - free(wholeMatrix); - - return 0; -} diff --git a/lyra2/Lyra2.h b/lyra2/Lyra2.h deleted file mode 100644 index edf91792..00000000 --- a/lyra2/Lyra2.h +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Header file for the Lyra2 Password Hashing Scheme (PHS). - * - * Author: The Lyra PHC team (http://www.lyra-kdf.net/) -- 2014. - * - * This software is hereby placed in the public domain. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef LYRA2_H_ -#define LYRA2_H_ - -#include - -typedef unsigned char byte; - -//Block length required so Blake2's Initialization Vector (IV) is not overwritten (THIS SHOULD NOT BE MODIFIED) -#define BLOCK_LEN_BLAKE2_SAFE_INT64 8 //512 bits (=64 bytes, =8 uint64_t) -#define BLOCK_LEN_BLAKE2_SAFE_BYTES (BLOCK_LEN_BLAKE2_SAFE_INT64 * 8) //same as above, in bytes - - -#ifdef BLOCK_LEN_BITS - #define BLOCK_LEN_INT64 (BLOCK_LEN_BITS/64) //Block length: 768 bits (=96 bytes, =12 uint64_t) - #define BLOCK_LEN_BYTES (BLOCK_LEN_BITS/8) //Block length, in bytes -#else //default block lenght: 768 bits - #define BLOCK_LEN_INT64 12 //Block length: 768 bits (=96 bytes, =12 uint64_t) - #define BLOCK_LEN_BYTES (BLOCK_LEN_INT64 * 8) //Block length, in bytes -#endif - -int LYRA2(void *K, int64_t kLen, const void *pwd, int32_t pwdlen, const void *salt, int32_t saltlen, int64_t timeCost, const int16_t nRows, const int16_t nCols); - -#endif /* LYRA2_H_ */ diff --git a/lyra2/Lyra2Z.c b/lyra2/Lyra2Z.c deleted file mode 100644 index edf463b1..00000000 --- a/lyra2/Lyra2Z.c +++ /dev/null @@ -1,215 +0,0 @@ -/** - * Implementation of the Lyra2 Password Hashing Scheme (PHS). - * - * Author: The Lyra PHC team (http://www.lyra-kdf.net/) -- 2014. - * - * This software is hereby placed in the public domain. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#include -#include -#include -#include - -#include "Lyra2Z.h" -#include "Sponge.h" - -/** - * Executes Lyra2 based on the G function from Blake2b. This version supports salts and passwords - * whose combined length is smaller than the size of the memory matrix, (i.e., (nRows x nCols x b) bits, - * where "b" is the underlying sponge's bitrate). In this implementation, the "basil" is composed by all - * integer parameters (treated as type "unsigned int") in the order they are provided, plus the value - * of nCols, (i.e., basil = kLen || pwdlen || saltlen || timeCost || nRows || nCols). - * - * @param K The derived key to be output by the algorithm - * @param kLen Desired key length - * @param pwd User password - * @param pwdlen Password length - * @param salt Salt - * @param saltlen Salt length - * @param timeCost Parameter to determine the processing time (T) - * @param nRows Number or rows of the memory matrix (R) - * @param nCols Number of columns of the memory matrix (C) - * - * @return 0 if the key is generated correctly; -1 if there is an error (usually due to lack of memory for allocation) - */ -int LYRA2Z(void *K, int64_t kLen, const void *pwd, int32_t pwdlen, const void *salt, int32_t saltlen, int64_t timeCost, const int16_t nRows, const int16_t nCols) -{ - //============================= Basic variables ============================// - int64_t row = 2; //index of row to be processed - int64_t prev = 1; //index of prev (last row ever computed/modified) - int64_t rowa = 0; //index of row* (a previous row, deterministically picked during Setup and randomly picked while Wandering) - int64_t tau; //Time Loop iterator - int64_t step = 1; //Visitation step (used during Setup and Wandering phases) - int64_t window = 2; //Visitation window (used to define which rows can be revisited during Setup) - int64_t gap = 1; //Modifier to the step, assuming the values 1 or -1 - int64_t i; //auxiliary iteration counter - int64_t v64; // 64bit var for memcpy - //==========================================================================/ - - //========== Initializing the Memory Matrix and pointers to it =============// - //Tries to allocate enough space for the whole memory matrix - - const int64_t ROW_LEN_INT64 = BLOCK_LEN_INT64 * nCols; - const int64_t ROW_LEN_BYTES = ROW_LEN_INT64 * 8; - // for Lyra2REv2, nCols = 4, v1 was using 8 - const int64_t BLOCK_LEN = BLOCK_LEN_BLAKE2_SAFE_INT64; - - size_t sz = (size_t)ROW_LEN_BYTES * nRows; - uint64_t *wholeMatrix = malloc(sz); - if (wholeMatrix == NULL) { - return -1; - } - memset(wholeMatrix, 0, sz); - - //Allocates pointers to each row of the matrix - uint64_t **memMatrix = malloc(sizeof(uint64_t*) * nRows); - if (memMatrix == NULL) { - return -1; - } - //Places the pointers in the correct positions - uint64_t *ptrWord = wholeMatrix; - for (i = 0; i < nRows; i++) { - memMatrix[i] = ptrWord; - ptrWord += ROW_LEN_INT64; - } - //==========================================================================/ - - //============= Getting the password + salt + basil padded with 10*1 ===============// - //OBS.:The memory matrix will temporarily hold the password: not for saving memory, - //but this ensures that the password copied locally will be overwritten as soon as possible - - //First, we clean enough blocks for the password, salt, basil and padding - int64_t nBlocksInput = ((saltlen + pwdlen + 6 * sizeof(uint64_t)) / BLOCK_LEN_BLAKE2_SAFE_BYTES) + 1; - - byte *ptrByte = (byte*) wholeMatrix; - - //Prepends the password - memcpy(ptrByte, pwd, pwdlen); - ptrByte += pwdlen; - - //Concatenates the salt - memcpy(ptrByte, salt, saltlen); - ptrByte += saltlen; - - memset(ptrByte, 0, (size_t) (nBlocksInput * BLOCK_LEN_BLAKE2_SAFE_BYTES - (saltlen + pwdlen))); - - //Concatenates the basil: every integer passed as parameter, in the order they are provided by the interface - memcpy(ptrByte, &kLen, sizeof(int64_t)); - ptrByte += sizeof(uint64_t); - v64 = pwdlen; - memcpy(ptrByte, &v64, sizeof(int64_t)); - ptrByte += sizeof(uint64_t); - v64 = saltlen; - memcpy(ptrByte, &v64, sizeof(int64_t)); - ptrByte += sizeof(uint64_t); - v64 = timeCost; - memcpy(ptrByte, &v64, sizeof(int64_t)); - ptrByte += sizeof(uint64_t); - v64 = nRows; - memcpy(ptrByte, &v64, sizeof(int64_t)); - ptrByte += sizeof(uint64_t); - v64 = nCols; - memcpy(ptrByte, &v64, sizeof(int64_t)); - ptrByte += sizeof(uint64_t); - - //Now comes the padding - *ptrByte = 0x80; //first byte of padding: right after the password - ptrByte = (byte*) wholeMatrix; //resets the pointer to the start of the memory matrix - ptrByte += nBlocksInput * BLOCK_LEN_BLAKE2_SAFE_BYTES - 1; //sets the pointer to the correct position: end of incomplete block - *ptrByte ^= 0x01; //last byte of padding: at the end of the last incomplete block - //==========================================================================/ - - //======================= Initializing the Sponge State ====================// - //Sponge state: 16 uint64_t, BLOCK_LEN_INT64 words of them for the bitrate (b) and the remainder for the capacity (c) - uint64_t state[16]; - initState(state); - //==========================================================================/ - - //================================ Setup Phase =============================// - //Absorbing salt, password and basil: this is the only place in which the block length is hard-coded to 512 bits - ptrWord = wholeMatrix; - for (i = 0; i < nBlocksInput; i++) { - absorbBlockBlake2Safe(state, ptrWord); //absorbs each block of pad(pwd || salt || basil) - ptrWord += BLOCK_LEN; //goes to next block of pad(pwd || salt || basil) - } - - //Initializes M[0] and M[1] - reducedSqueezeRow0(state, memMatrix[0], nCols); //The locally copied password is most likely overwritten here - - reducedDuplexRow1(state, memMatrix[0], memMatrix[1], nCols); - - do { - //M[row] = rand; //M[row*] = M[row*] XOR rotW(rand) - - reducedDuplexRowSetup(state, memMatrix[prev], memMatrix[rowa], memMatrix[row], nCols); - - //updates the value of row* (deterministically picked during Setup)) - rowa = (rowa + step) & (window - 1); - //update prev: it now points to the last row ever computed - prev = row; - //updates row: goes to the next row to be computed - row++; - - //Checks if all rows in the window where visited. - if (rowa == 0) { - step = window + gap; //changes the step: approximately doubles its value - window *= 2; //doubles the size of the re-visitation window - gap = -gap; //inverts the modifier to the step - } - - } while (row < nRows); - //==========================================================================/ - - //============================ Wandering Phase =============================// - row = 0; //Resets the visitation to the first row of the memory matrix - for (tau = 1; tau <= timeCost; tau++) { - //Step is approximately half the number of all rows of the memory matrix for an odd tau; otherwise, it is -1 - step = (tau % 2 == 0) ? -1 : nRows / 2 - 1; - do { - //Selects a pseudorandom index row* - //------------------------------------------------------------------------------------------ - rowa = state[0] & (unsigned int)(nRows-1); //(USE THIS IF nRows IS A POWER OF 2) - //rowa = state[0] % nRows; //(USE THIS FOR THE "GENERIC" CASE) - //------------------------------------------------------------------------------------------ - - //Performs a reduced-round duplexing operation over M[row*] XOR M[prev], updating both M[row*] and M[row] - reducedDuplexRow(state, memMatrix[prev], memMatrix[rowa], memMatrix[row], nCols); - - //update prev: it now points to the last row ever computed - prev = row; - - //updates row: goes to the next row to be computed - //------------------------------------------------------------------------------------------ - row = (row + step) & (unsigned int)(nRows-1); //(USE THIS IF nRows IS A POWER OF 2) - //row = (row + step) % nRows; //(USE THIS FOR THE "GENERIC" CASE) - //------------------------------------------------------------------------------------------ - - } while (row != 0); - } - - //============================ Wrap-up Phase ===============================// - //Absorbs the last block of the memory matrix - absorbBlock(state, memMatrix[rowa]); - - //Squeezes the key - squeeze(state, K, (unsigned int) kLen); - - //========================= Freeing the memory =============================// - free(memMatrix); - free(wholeMatrix); - - return 0; -} - diff --git a/lyra2/Lyra2Z.h b/lyra2/Lyra2Z.h deleted file mode 100644 index aaade365..00000000 --- a/lyra2/Lyra2Z.h +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Header file for the Lyra2 Password Hashing Scheme (PHS). - * - * Author: The Lyra PHC team (http://www.lyra-kdf.net/) -- 2014. - * - * This software is hereby placed in the public domain. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef LYRA2Z_H_ -#define LYRA2Z_H_ - -#include - -typedef unsigned char byte; - -//Block length required so Blake2's Initialization Vector (IV) is not overwritten (THIS SHOULD NOT BE MODIFIED) -#define BLOCK_LEN_BLAKE2_SAFE_INT64 8 //512 bits (=64 bytes, =8 uint64_t) -#define BLOCK_LEN_BLAKE2_SAFE_BYTES (BLOCK_LEN_BLAKE2_SAFE_INT64 * 8) //same as above, in bytes - - -#ifdef BLOCK_LEN_BITS - #define BLOCK_LEN_INT64 (BLOCK_LEN_BITS/64) //Block length: 768 bits (=96 bytes, =12 uint64_t) - #define BLOCK_LEN_BYTES (BLOCK_LEN_BITS/8) //Block length, in bytes -#else //default block lenght: 768 bits - #define BLOCK_LEN_INT64 12 //Block length: 768 bits (=96 bytes, =12 uint64_t) - #define BLOCK_LEN_BYTES (BLOCK_LEN_INT64 * 8) //Block length, in bytes -#endif - -int LYRA2Z(void *K, int64_t kLen, const void *pwd, int32_t pwdlen, const void *salt, int32_t saltlen, int64_t timeCost, const int16_t nRows, const int16_t nCols); - -#endif /* LYRA2_H_ */ diff --git a/lyra2/Sponge.c b/lyra2/Sponge.c deleted file mode 100644 index a698229d..00000000 --- a/lyra2/Sponge.c +++ /dev/null @@ -1,410 +0,0 @@ -/** - * A simple implementation of Blake2b's internal permutation - * in the form of a sponge. - * - * Author: The Lyra PHC team (http://www.lyra-kdf.net/) -- 2014. - * - * This software is hereby placed in the public domain. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#include -#include -#include -#include "Sponge.h" -#include "Lyra2.h" - - -/** - * Initializes the Sponge State. The first 512 bits are set to zeros and the remainder - * receive Blake2b's IV as per Blake2b's specification. Note: Even though sponges - * typically have their internal state initialized with zeros, Blake2b's G function - * has a fixed point: if the internal state and message are both filled with zeros. the - * resulting permutation will always be a block filled with zeros; this happens because - * Blake2b does not use the constants originally employed in Blake2 inside its G function, - * relying on the IV for avoiding possible fixed points. - * - * @param state The 1024-bit array to be initialized - */ -void initState(uint64_t state[/*16*/]) { - //First 512 bis are zeros - memset(state, 0, 64); - //Remainder BLOCK_LEN_BLAKE2_SAFE_BYTES are reserved to the IV - state[8] = blake2b_IV[0]; - state[9] = blake2b_IV[1]; - state[10] = blake2b_IV[2]; - state[11] = blake2b_IV[3]; - state[12] = blake2b_IV[4]; - state[13] = blake2b_IV[5]; - state[14] = blake2b_IV[6]; - state[15] = blake2b_IV[7]; -} - -/** - * Execute Blake2b's G function, with all 12 rounds. - * - * @param v A 1024-bit (16 uint64_t) array to be processed by Blake2b's G function - */ -__inline static void blake2bLyra(uint64_t *v) { - ROUND_LYRA(0); - ROUND_LYRA(1); - ROUND_LYRA(2); - ROUND_LYRA(3); - ROUND_LYRA(4); - ROUND_LYRA(5); - ROUND_LYRA(6); - ROUND_LYRA(7); - ROUND_LYRA(8); - ROUND_LYRA(9); - ROUND_LYRA(10); - ROUND_LYRA(11); -} - -/** - * Executes a reduced version of Blake2b's G function with only one round - * @param v A 1024-bit (16 uint64_t) array to be processed by Blake2b's G function - */ -__inline static void reducedBlake2bLyra(uint64_t *v) { - ROUND_LYRA(0); -} - -/** - * Performs a squeeze operation, using Blake2b's G function as the - * internal permutation - * - * @param state The current state of the sponge - * @param out Array that will receive the data squeezed - * @param len The number of bytes to be squeezed into the "out" array - */ -void squeeze(uint64_t *state, byte *out, unsigned int len) -{ - int fullBlocks = len / BLOCK_LEN_BYTES; - byte *ptr = out; - int i; - //Squeezes full blocks - for (i = 0; i < fullBlocks; i++) { - memcpy(ptr, state, BLOCK_LEN_BYTES); - blake2bLyra(state); - ptr += BLOCK_LEN_BYTES; - } - - //Squeezes remaining bytes - memcpy(ptr, state, (len % BLOCK_LEN_BYTES)); -} - -/** - * Performs an absorb operation for a single block (BLOCK_LEN_INT64 words - * of type uint64_t), using Blake2b's G function as the internal permutation - * - * @param state The current state of the sponge - * @param in The block to be absorbed (BLOCK_LEN_INT64 words) - */ -void absorbBlock(uint64_t *state, const uint64_t *in) -{ - //XORs the first BLOCK_LEN_INT64 words of "in" with the current state - state[0] ^= in[0]; - state[1] ^= in[1]; - state[2] ^= in[2]; - state[3] ^= in[3]; - state[4] ^= in[4]; - state[5] ^= in[5]; - state[6] ^= in[6]; - state[7] ^= in[7]; - state[8] ^= in[8]; - state[9] ^= in[9]; - state[10] ^= in[10]; - state[11] ^= in[11]; - - //Applies the transformation f to the sponge's state - blake2bLyra(state); -} - -/** - * Performs an absorb operation for a single block (BLOCK_LEN_BLAKE2_SAFE_INT64 - * words of type uint64_t), using Blake2b's G function as the internal permutation - * - * @param state The current state of the sponge - * @param in The block to be absorbed (BLOCK_LEN_BLAKE2_SAFE_INT64 words) - */ -void absorbBlockBlake2Safe(uint64_t *state, const uint64_t *in) -{ - //XORs the first BLOCK_LEN_BLAKE2_SAFE_INT64 words of "in" with the current state - - state[0] ^= in[0]; - state[1] ^= in[1]; - state[2] ^= in[2]; - state[3] ^= in[3]; - state[4] ^= in[4]; - state[5] ^= in[5]; - state[6] ^= in[6]; - state[7] ^= in[7]; - - //Applies the transformation f to the sponge's state - blake2bLyra(state); -} - -/** - * Performs a reduced squeeze operation for a single row, from the highest to - * the lowest index, using the reduced-round Blake2b's G function as the - * internal permutation - * - * @param state The current state of the sponge - * @param rowOut Row to receive the data squeezed - */ -void reducedSqueezeRow0(uint64_t* state, uint64_t* rowOut, const uint32_t nCols) -{ - uint64_t* ptrWord = rowOut + (nCols-1)*BLOCK_LEN_INT64; //In Lyra2: pointer to M[0][C-1] - unsigned int i; - //M[row][C-1-col] = H.reduced_squeeze() - for (i = 0; i < nCols; i++) { - ptrWord[0] = state[0]; - ptrWord[1] = state[1]; - ptrWord[2] = state[2]; - ptrWord[3] = state[3]; - ptrWord[4] = state[4]; - ptrWord[5] = state[5]; - ptrWord[6] = state[6]; - ptrWord[7] = state[7]; - ptrWord[8] = state[8]; - ptrWord[9] = state[9]; - ptrWord[10] = state[10]; - ptrWord[11] = state[11]; - - //Goes to next block (column) that will receive the squeezed data - ptrWord -= BLOCK_LEN_INT64; - - //Applies the reduced-round transformation f to the sponge's state - reducedBlake2bLyra(state); - } -} - -/** - * Performs a reduced duplex operation for a single row, from the highest to - * the lowest index, using the reduced-round Blake2b's G function as the - * internal permutation - * - * @param state The current state of the sponge - * @param rowIn Row to feed the sponge - * @param rowOut Row to receive the sponge's output - */ -void reducedDuplexRow1(uint64_t *state, uint64_t *rowIn, uint64_t *rowOut, const uint32_t nCols) -{ - uint64_t* ptrWordIn = rowIn; //In Lyra2: pointer to prev - uint64_t* ptrWordOut = rowOut + (nCols-1)*BLOCK_LEN_INT64; //In Lyra2: pointer to row - unsigned int i; - - for (i = 0; i < nCols; i++) { - - //Absorbing "M[prev][col]" - state[0] ^= (ptrWordIn[0]); - state[1] ^= (ptrWordIn[1]); - state[2] ^= (ptrWordIn[2]); - state[3] ^= (ptrWordIn[3]); - state[4] ^= (ptrWordIn[4]); - state[5] ^= (ptrWordIn[5]); - state[6] ^= (ptrWordIn[6]); - state[7] ^= (ptrWordIn[7]); - state[8] ^= (ptrWordIn[8]); - state[9] ^= (ptrWordIn[9]); - state[10] ^= (ptrWordIn[10]); - state[11] ^= (ptrWordIn[11]); - - //Applies the reduced-round transformation f to the sponge's state - reducedBlake2bLyra(state); - - //M[row][C-1-col] = M[prev][col] XOR rand - ptrWordOut[0] = ptrWordIn[0] ^ state[0]; - ptrWordOut[1] = ptrWordIn[1] ^ state[1]; - ptrWordOut[2] = ptrWordIn[2] ^ state[2]; - ptrWordOut[3] = ptrWordIn[3] ^ state[3]; - ptrWordOut[4] = ptrWordIn[4] ^ state[4]; - ptrWordOut[5] = ptrWordIn[5] ^ state[5]; - ptrWordOut[6] = ptrWordIn[6] ^ state[6]; - ptrWordOut[7] = ptrWordIn[7] ^ state[7]; - ptrWordOut[8] = ptrWordIn[8] ^ state[8]; - ptrWordOut[9] = ptrWordIn[9] ^ state[9]; - ptrWordOut[10] = ptrWordIn[10] ^ state[10]; - ptrWordOut[11] = ptrWordIn[11] ^ state[11]; - - //Input: next column (i.e., next block in sequence) - ptrWordIn += BLOCK_LEN_INT64; - //Output: goes to previous column - ptrWordOut -= BLOCK_LEN_INT64; - } -} - -/** - * Performs a duplexing operation over "M[rowInOut][col] [+] M[rowIn][col]" (i.e., - * the wordwise addition of two columns, ignoring carries between words). The - * output of this operation, "rand", is then used to make - * "M[rowOut][(N_COLS-1)-col] = M[rowIn][col] XOR rand" and - * "M[rowInOut][col] = M[rowInOut][col] XOR rotW(rand)", where rotW is a 64-bit - * rotation to the left and N_COLS is a system parameter. - * - * @param state The current state of the sponge - * @param rowIn Row used only as input - * @param rowInOut Row used as input and to receive output after rotation - * @param rowOut Row receiving the output - * - */ -void reducedDuplexRowSetup(uint64_t *state, uint64_t *rowIn, uint64_t *rowInOut, uint64_t *rowOut, const uint32_t nCols) -{ - uint64_t* ptrWordIn = rowIn; //In Lyra2: pointer to prev - uint64_t* ptrWordInOut = rowInOut; //In Lyra2: pointer to row* - uint64_t* ptrWordOut = rowOut + (nCols-1)*BLOCK_LEN_INT64; //In Lyra2: pointer to row - unsigned int i; - - for (i = 0; i < nCols; i++) { - - //Absorbing "M[prev] [+] M[row*]" - state[0] ^= (ptrWordIn[0] + ptrWordInOut[0]); - state[1] ^= (ptrWordIn[1] + ptrWordInOut[1]); - state[2] ^= (ptrWordIn[2] + ptrWordInOut[2]); - state[3] ^= (ptrWordIn[3] + ptrWordInOut[3]); - state[4] ^= (ptrWordIn[4] + ptrWordInOut[4]); - state[5] ^= (ptrWordIn[5] + ptrWordInOut[5]); - state[6] ^= (ptrWordIn[6] + ptrWordInOut[6]); - state[7] ^= (ptrWordIn[7] + ptrWordInOut[7]); - state[8] ^= (ptrWordIn[8] + ptrWordInOut[8]); - state[9] ^= (ptrWordIn[9] + ptrWordInOut[9]); - state[10] ^= (ptrWordIn[10] + ptrWordInOut[10]); - state[11] ^= (ptrWordIn[11] + ptrWordInOut[11]); - - //Applies the reduced-round transformation f to the sponge's state - reducedBlake2bLyra(state); - - //M[row][col] = M[prev][col] XOR rand - ptrWordOut[0] = ptrWordIn[0] ^ state[0]; - ptrWordOut[1] = ptrWordIn[1] ^ state[1]; - ptrWordOut[2] = ptrWordIn[2] ^ state[2]; - ptrWordOut[3] = ptrWordIn[3] ^ state[3]; - ptrWordOut[4] = ptrWordIn[4] ^ state[4]; - ptrWordOut[5] = ptrWordIn[5] ^ state[5]; - ptrWordOut[6] = ptrWordIn[6] ^ state[6]; - ptrWordOut[7] = ptrWordIn[7] ^ state[7]; - ptrWordOut[8] = ptrWordIn[8] ^ state[8]; - ptrWordOut[9] = ptrWordIn[9] ^ state[9]; - ptrWordOut[10] = ptrWordIn[10] ^ state[10]; - ptrWordOut[11] = ptrWordIn[11] ^ state[11]; - - //M[row*][col] = M[row*][col] XOR rotW(rand) - ptrWordInOut[0] ^= state[11]; - ptrWordInOut[1] ^= state[0]; - ptrWordInOut[2] ^= state[1]; - ptrWordInOut[3] ^= state[2]; - ptrWordInOut[4] ^= state[3]; - ptrWordInOut[5] ^= state[4]; - ptrWordInOut[6] ^= state[5]; - ptrWordInOut[7] ^= state[6]; - ptrWordInOut[8] ^= state[7]; - ptrWordInOut[9] ^= state[8]; - ptrWordInOut[10] ^= state[9]; - ptrWordInOut[11] ^= state[10]; - - //Inputs: next column (i.e., next block in sequence) - ptrWordInOut += BLOCK_LEN_INT64; - ptrWordIn += BLOCK_LEN_INT64; - //Output: goes to previous column - ptrWordOut -= BLOCK_LEN_INT64; - } -} - -/** - * Performs a duplexing operation over "M[rowInOut][col] [+] M[rowIn][col]" (i.e., - * the wordwise addition of two columns, ignoring carries between words). The - * output of this operation, "rand", is then used to make - * "M[rowOut][col] = M[rowOut][col] XOR rand" and - * "M[rowInOut][col] = M[rowInOut][col] XOR rotW(rand)", where rotW is a 64-bit - * rotation to the left. - * - * @param state The current state of the sponge - * @param rowIn Row used only as input - * @param rowInOut Row used as input and to receive output after rotation - * @param rowOut Row receiving the output - * - */ -void reducedDuplexRow(uint64_t *state, uint64_t *rowIn, uint64_t *rowInOut, uint64_t *rowOut, const uint32_t nCols) -{ - uint64_t* ptrWordInOut = rowInOut; //In Lyra2: pointer to row* - uint64_t* ptrWordIn = rowIn; //In Lyra2: pointer to prev - uint64_t* ptrWordOut = rowOut; //In Lyra2: pointer to row - unsigned int i; - - for (i = 0; i < nCols; i++) { - - //Absorbing "M[prev] [+] M[row*]" - state[0] ^= (ptrWordIn[0] + ptrWordInOut[0]); - state[1] ^= (ptrWordIn[1] + ptrWordInOut[1]); - state[2] ^= (ptrWordIn[2] + ptrWordInOut[2]); - state[3] ^= (ptrWordIn[3] + ptrWordInOut[3]); - state[4] ^= (ptrWordIn[4] + ptrWordInOut[4]); - state[5] ^= (ptrWordIn[5] + ptrWordInOut[5]); - state[6] ^= (ptrWordIn[6] + ptrWordInOut[6]); - state[7] ^= (ptrWordIn[7] + ptrWordInOut[7]); - state[8] ^= (ptrWordIn[8] + ptrWordInOut[8]); - state[9] ^= (ptrWordIn[9] + ptrWordInOut[9]); - state[10] ^= (ptrWordIn[10] + ptrWordInOut[10]); - state[11] ^= (ptrWordIn[11] + ptrWordInOut[11]); - - //Applies the reduced-round transformation f to the sponge's state - reducedBlake2bLyra(state); - - //M[rowOut][col] = M[rowOut][col] XOR rand - ptrWordOut[0] ^= state[0]; - ptrWordOut[1] ^= state[1]; - ptrWordOut[2] ^= state[2]; - ptrWordOut[3] ^= state[3]; - ptrWordOut[4] ^= state[4]; - ptrWordOut[5] ^= state[5]; - ptrWordOut[6] ^= state[6]; - ptrWordOut[7] ^= state[7]; - ptrWordOut[8] ^= state[8]; - ptrWordOut[9] ^= state[9]; - ptrWordOut[10] ^= state[10]; - ptrWordOut[11] ^= state[11]; - - //M[rowInOut][col] = M[rowInOut][col] XOR rotW(rand) - ptrWordInOut[0] ^= state[11]; - ptrWordInOut[1] ^= state[0]; - ptrWordInOut[2] ^= state[1]; - ptrWordInOut[3] ^= state[2]; - ptrWordInOut[4] ^= state[3]; - ptrWordInOut[5] ^= state[4]; - ptrWordInOut[6] ^= state[5]; - ptrWordInOut[7] ^= state[6]; - ptrWordInOut[8] ^= state[7]; - ptrWordInOut[9] ^= state[8]; - ptrWordInOut[10] ^= state[9]; - ptrWordInOut[11] ^= state[10]; - - //Goes to next block - ptrWordOut += BLOCK_LEN_INT64; - ptrWordInOut += BLOCK_LEN_INT64; - ptrWordIn += BLOCK_LEN_INT64; - } -} - -/** - * Prints an array of unsigned chars - */ -void printArray(unsigned char *array, unsigned int size, char *name) -{ - unsigned int i; - printf("%s: ", name); - for (i = 0; i < size; i++) { - printf("%2x|", array[i]); - } - printf("\n"); -} - -//////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/lyra2/Sponge.h b/lyra2/Sponge.h deleted file mode 100644 index 7fcd0934..00000000 --- a/lyra2/Sponge.h +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Header file for Blake2b's internal permutation in the form of a sponge. - * This code is based on the original Blake2b's implementation provided by - * Samuel Neves (https://blake2.net/) - * - * Author: The Lyra PHC team (http://www.lyra-kdf.net/) -- 2014. - * - * This software is hereby placed in the public domain. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef SPONGE_H_ -#define SPONGE_H_ - -#include - -/* Blake2b IV Array */ -static const uint64_t blake2b_IV[8] = -{ - 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, - 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, - 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL, - 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL -}; - -/* Blake2b's rotation */ -static __inline uint64_t rotr64(const uint64_t w, const unsigned c) { -#ifdef _MSC_VER - return _rotr64(w, c); -#else - return ( w >> c ) | ( w << ( 64 - c ) ); -#endif -} - -/* Blake2b's G function */ -#define G(r,i,a,b,c,d) do { \ - a = a + b; \ - d = rotr64(d ^ a, 32); \ - c = c + d; \ - b = rotr64(b ^ c, 24); \ - a = a + b; \ - d = rotr64(d ^ a, 16); \ - c = c + d; \ - b = rotr64(b ^ c, 63); \ - } while(0) - - -/*One Round of the Blake2b's compression function*/ -#define ROUND_LYRA(r) \ - G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \ - G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \ - G(r,2,v[ 2],v[ 6],v[10],v[14]); \ - G(r,3,v[ 3],v[ 7],v[11],v[15]); \ - G(r,4,v[ 0],v[ 5],v[10],v[15]); \ - G(r,5,v[ 1],v[ 6],v[11],v[12]); \ - G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \ - G(r,7,v[ 3],v[ 4],v[ 9],v[14]); - -//---- Housekeeping -void initState(uint64_t state[/*16*/]); - -//---- Squeezes -void squeeze(uint64_t *state, unsigned char *out, unsigned int len); -void reducedSqueezeRow0(uint64_t* state, uint64_t* row, const uint32_t nCols); - -//---- Absorbs -void absorbBlock(uint64_t *state, const uint64_t *in); -void absorbBlockBlake2Safe(uint64_t *state, const uint64_t *in); - -//---- Duplexes -void reducedDuplexRow1(uint64_t *state, uint64_t *rowIn, uint64_t *rowOut, const uint32_t nCols); -void reducedDuplexRowSetup(uint64_t *state, uint64_t *rowIn, uint64_t *rowInOut, uint64_t *rowOut, const uint32_t nCols); -void reducedDuplexRow(uint64_t *state, uint64_t *rowIn, uint64_t *rowInOut, uint64_t *rowOut, const uint32_t nCols); - -//---- Misc -void printArray(unsigned char *array, unsigned int size, char *name); - -#endif /* SPONGE_H_ */ diff --git a/lyra2/cuda_lyra2.cu b/lyra2/cuda_lyra2.cu deleted file mode 100644 index 7905d238..00000000 --- a/lyra2/cuda_lyra2.cu +++ /dev/null @@ -1,572 +0,0 @@ -/** - * Lyra2 (v1) cuda implementation based on djm34 work - * tpruvot@github 2015, Nanashi 08/2016 (from 1.8-r2) - */ - -#include -#include - -#define TPB52 32 - -#include "cuda_lyra2_sm2.cuh" -#include "cuda_lyra2_sm5.cuh" - -#ifdef __INTELLISENSE__ -/* just for vstudio code colors */ -#define __CUDA_ARCH__ 520 -#endif - -#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ > 500 - -#include "cuda_lyra2_vectors.h" - -#ifdef __INTELLISENSE__ -/* just for vstudio code colors */ -__device__ uint32_t __shfl(uint32_t a, uint32_t b, uint32_t c); -#endif - -#define Nrow 8 -#define Ncol 8 -#define memshift 3 - -#define BUF_COUNT 0 - -__device__ uint2 *DMatrix; - -__device__ __forceinline__ void LD4S(uint2 res[3], const int row, const int col, const int thread, const int threads) -{ -#if BUF_COUNT != 8 - extern __shared__ uint2 shared_mem[]; - const int s0 = (Ncol * (row - BUF_COUNT) + col) * memshift; -#endif -#if BUF_COUNT != 0 - const int d0 = (memshift *(Ncol * row + col) * threads + thread)*blockDim.x + threadIdx.x; -#endif - -#if BUF_COUNT == 8 - #pragma unroll - for (int j = 0; j < 3; j++) - res[j] = *(DMatrix + d0 + j * threads * blockDim.x); -#elif BUF_COUNT == 0 - #pragma unroll - for (int j = 0; j < 3; j++) - res[j] = shared_mem[((s0 + j) * blockDim.y + threadIdx.y) * blockDim.x + threadIdx.x]; -#else - if (row < BUF_COUNT) - { - #pragma unroll - for (int j = 0; j < 3; j++) - res[j] = *(DMatrix + d0 + j * threads * blockDim.x); - } - else - { - #pragma unroll - for (int j = 0; j < 3; j++) - res[j] = shared_mem[((s0 + j) * blockDim.y + threadIdx.y) * blockDim.x + threadIdx.x]; - } -#endif -} - -__device__ __forceinline__ void ST4S(const int row, const int col, const uint2 data[3], const int thread, const int threads) -{ -#if BUF_COUNT != 8 - extern __shared__ uint2 shared_mem[]; - const int s0 = (Ncol * (row - BUF_COUNT) + col) * memshift; -#endif -#if BUF_COUNT != 0 - const int d0 = (memshift *(Ncol * row + col) * threads + thread)*blockDim.x + threadIdx.x; -#endif - -#if BUF_COUNT == 8 - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + d0 + j * threads * blockDim.x) = data[j]; - -#elif BUF_COUNT == 0 - #pragma unroll - for (int j = 0; j < 3; j++) - shared_mem[((s0 + j) * blockDim.y + threadIdx.y) * blockDim.x + threadIdx.x] = data[j]; - -#else - if (row < BUF_COUNT) - { - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + d0 + j * threads * blockDim.x) = data[j]; - } - else - { - #pragma unroll - for (int j = 0; j < 3; j++) - shared_mem[((s0 + j) * blockDim.y + threadIdx.y) * blockDim.x + threadIdx.x] = data[j]; - } -#endif -} - -#if __CUDA_ARCH__ >= 300 -__device__ __forceinline__ uint32_t WarpShuffle(uint32_t a, uint32_t b, uint32_t c) -{ - return __shfl(a, b, c); -} - -__device__ __forceinline__ uint2 WarpShuffle(uint2 a, uint32_t b, uint32_t c) -{ - return make_uint2(__shfl(a.x, b, c), __shfl(a.y, b, c)); -} - -__device__ __forceinline__ void WarpShuffle3(uint2 &a1, uint2 &a2, uint2 &a3, uint32_t b1, uint32_t b2, uint32_t b3, uint32_t c) -{ - a1 = WarpShuffle(a1, b1, c); - a2 = WarpShuffle(a2, b2, c); - a3 = WarpShuffle(a3, b3, c); -} - -#else -__device__ __forceinline__ uint32_t WarpShuffle(uint32_t a, uint32_t b, uint32_t c) -{ - extern __shared__ uint2 shared_mem[]; - - const uint32_t thread = blockDim.x * threadIdx.y + threadIdx.x; - uint32_t *_ptr = (uint32_t*)shared_mem; - - __threadfence_block(); - uint32_t buf = _ptr[thread]; - - _ptr[thread] = a; - __threadfence_block(); - uint32_t result = _ptr[(thread&~(c - 1)) + (b&(c - 1))]; - - __threadfence_block(); - _ptr[thread] = buf; - - __threadfence_block(); - return result; -} - -__device__ __forceinline__ uint2 WarpShuffle(uint2 a, uint32_t b, uint32_t c) -{ - extern __shared__ uint2 shared_mem[]; - - const uint32_t thread = blockDim.x * threadIdx.y + threadIdx.x; - - __threadfence_block(); - uint2 buf = shared_mem[thread]; - - shared_mem[thread] = a; - __threadfence_block(); - uint2 result = shared_mem[(thread&~(c - 1)) + (b&(c - 1))]; - - __threadfence_block(); - shared_mem[thread] = buf; - - __threadfence_block(); - return result; -} - -__device__ __forceinline__ void WarpShuffle3(uint2 &a1, uint2 &a2, uint2 &a3, uint32_t b1, uint32_t b2, uint32_t b3, uint32_t c) -{ - extern __shared__ uint2 shared_mem[]; - - const uint32_t thread = blockDim.x * threadIdx.y + threadIdx.x; - - __threadfence_block(); - uint2 buf = shared_mem[thread]; - - shared_mem[thread] = a1; - __threadfence_block(); - a1 = shared_mem[(thread&~(c - 1)) + (b1&(c - 1))]; - __threadfence_block(); - shared_mem[thread] = a2; - __threadfence_block(); - a2 = shared_mem[(thread&~(c - 1)) + (b2&(c - 1))]; - __threadfence_block(); - shared_mem[thread] = a3; - __threadfence_block(); - a3 = shared_mem[(thread&~(c - 1)) + (b3&(c - 1))]; - - __threadfence_block(); - shared_mem[thread] = buf; - __threadfence_block(); -} - -#endif - -#if __CUDA_ARCH__ > 500 || !defined(__CUDA_ARCH) -static __device__ __forceinline__ -void Gfunc(uint2 &a, uint2 &b, uint2 &c, uint2 &d) -{ - a += b; uint2 tmp = d; d.y = a.x ^ tmp.x; d.x = a.y ^ tmp.y; - c += d; b ^= c; b = ROR24(b); - a += b; d ^= a; d = ROR16(d); - c += d; b ^= c; b = ROR2(b, 63); -} -#endif - -__device__ __forceinline__ void round_lyra(uint2 s[4]) -{ - Gfunc(s[0], s[1], s[2], s[3]); - WarpShuffle3(s[1], s[2], s[3], threadIdx.x + 1, threadIdx.x + 2, threadIdx.x + 3, 4); - Gfunc(s[0], s[1], s[2], s[3]); - WarpShuffle3(s[1], s[2], s[3], threadIdx.x + 3, threadIdx.x + 2, threadIdx.x + 1, 4); -} - -static __device__ __forceinline__ -void round_lyra(uint2x4* s) -{ - Gfunc(s[0].x, s[1].x, s[2].x, s[3].x); - Gfunc(s[0].y, s[1].y, s[2].y, s[3].y); - Gfunc(s[0].z, s[1].z, s[2].z, s[3].z); - Gfunc(s[0].w, s[1].w, s[2].w, s[3].w); - Gfunc(s[0].x, s[1].y, s[2].z, s[3].w); - Gfunc(s[0].y, s[1].z, s[2].w, s[3].x); - Gfunc(s[0].z, s[1].w, s[2].x, s[3].y); - Gfunc(s[0].w, s[1].x, s[2].y, s[3].z); -} - -static __device__ __forceinline__ -void reduceDuplex(uint2 state[4], uint32_t thread, const uint32_t threads) -{ - uint2 state1[3]; - -#if __CUDA_ARCH__ > 500 -#pragma unroll -#endif - for (int i = 0; i < Nrow; i++) - { - ST4S(0, Ncol - i - 1, state, thread, threads); - - round_lyra(state); - } - - #pragma unroll 4 - for (int i = 0; i < Nrow; i++) - { - LD4S(state1, 0, i, thread, threads); - for (int j = 0; j < 3; j++) - state[j] ^= state1[j]; - - round_lyra(state); - - for (int j = 0; j < 3; j++) - state1[j] ^= state[j]; - ST4S(1, Ncol - i - 1, state1, thread, threads); - } -} - -static __device__ __forceinline__ -void reduceDuplexRowSetup(const int rowIn, const int rowInOut, const int rowOut, uint2 state[4], uint32_t thread, const uint32_t threads) -{ - uint2 state1[3], state2[3]; - - #pragma unroll 1 - for (int i = 0; i < Nrow; i++) - { - LD4S(state1, rowIn, i, thread, threads); - LD4S(state2, rowInOut, i, thread, threads); - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + state2[j]; - - round_lyra(state); - - #pragma unroll - for (int j = 0; j < 3; j++) - state1[j] ^= state[j]; - - ST4S(rowOut, Ncol - i - 1, state1, thread, threads); - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - state2[0] ^= Data2; - state2[1] ^= Data0; - state2[2] ^= Data1; - } else { - state2[0] ^= Data0; - state2[1] ^= Data1; - state2[2] ^= Data2; - } - - ST4S(rowInOut, i, state2, thread, threads); - } -} - -static __device__ __forceinline__ -void reduceDuplexRowt(const int rowIn, const int rowInOut, const int rowOut, uint2 state[4], const uint32_t thread, const uint32_t threads) -{ - for (int i = 0; i < Nrow; i++) - { - uint2 state1[3], state2[3]; - - LD4S(state1, rowIn, i, thread, threads); - LD4S(state2, rowInOut, i, thread, threads); - -#pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + state2[j]; - - round_lyra(state); - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - state2[0] ^= Data2; - state2[1] ^= Data0; - state2[2] ^= Data1; - } - else - { - state2[0] ^= Data0; - state2[1] ^= Data1; - state2[2] ^= Data2; - } - - ST4S(rowInOut, i, state2, thread, threads); - - LD4S(state1, rowOut, i, thread, threads); - -#pragma unroll - for (int j = 0; j < 3; j++) - state1[j] ^= state[j]; - - ST4S(rowOut, i, state1, thread, threads); - } -} - -static __device__ __forceinline__ -void reduceDuplexRowt_8(const int rowInOut, uint2* state, const uint32_t thread, const uint32_t threads) -{ - uint2 state1[3], state2[3], last[3]; - - LD4S(state1, 2, 0, thread, threads); - LD4S(last, rowInOut, 0, thread, threads); - - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + last[j]; - - round_lyra(state); - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - last[0] ^= Data2; - last[1] ^= Data0; - last[2] ^= Data1; - } else { - last[0] ^= Data0; - last[1] ^= Data1; - last[2] ^= Data2; - } - - if (rowInOut == 5) - { - #pragma unroll - for (int j = 0; j < 3; j++) - last[j] ^= state[j]; - } - - for (int i = 1; i < Nrow; i++) - { - LD4S(state1, 2, i, thread, threads); - LD4S(state2, rowInOut, i, thread, threads); - - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + state2[j]; - - round_lyra(state); - } - - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= last[j]; -} - -__constant__ uint2x4 blake2b_IV[2] = { - 0xf3bcc908lu, 0x6a09e667lu, - 0x84caa73blu, 0xbb67ae85lu, - 0xfe94f82blu, 0x3c6ef372lu, - 0x5f1d36f1lu, 0xa54ff53alu, - 0xade682d1lu, 0x510e527flu, - 0x2b3e6c1flu, 0x9b05688clu, - 0xfb41bd6blu, 0x1f83d9ablu, - 0x137e2179lu, 0x5be0cd19lu -}; - -__global__ __launch_bounds__(64, 1) -void lyra2_gpu_hash_32_1(uint32_t threads, uint32_t startNounce, uint2 *g_hash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - - if (thread < threads) - { - uint2x4 state[4]; - - state[0].x = state[1].x = __ldg(&g_hash[thread + threads * 0]); - state[0].y = state[1].y = __ldg(&g_hash[thread + threads * 1]); - state[0].z = state[1].z = __ldg(&g_hash[thread + threads * 2]); - state[0].w = state[1].w = __ldg(&g_hash[thread + threads * 3]); - state[2] = blake2b_IV[0]; - state[3] = blake2b_IV[1]; - - for (int i = 0; i<24; i++) - round_lyra(state); //because 12 is not enough - - ((uint2x4*)DMatrix)[threads * 0 + thread] = state[0]; - ((uint2x4*)DMatrix)[threads * 1 + thread] = state[1]; - ((uint2x4*)DMatrix)[threads * 2 + thread] = state[2]; - ((uint2x4*)DMatrix)[threads * 3 + thread] = state[3]; - } -} - -__global__ -__launch_bounds__(TPB52, 1) -void lyra2_gpu_hash_32_2(uint32_t threads, uint32_t startNounce, uint64_t *g_hash) -{ - const uint32_t thread = blockDim.y * blockIdx.x + threadIdx.y; - - if (thread < threads) - { - uint2 state[4]; - state[0] = __ldg(&DMatrix[(0 * threads + thread) * blockDim.x + threadIdx.x]); - state[1] = __ldg(&DMatrix[(1 * threads + thread) * blockDim.x + threadIdx.x]); - state[2] = __ldg(&DMatrix[(2 * threads + thread) * blockDim.x + threadIdx.x]); - state[3] = __ldg(&DMatrix[(3 * threads + thread) * blockDim.x + threadIdx.x]); - - reduceDuplex(state, thread, threads); - reduceDuplexRowSetup(1, 0, 2, state, thread, threads); - reduceDuplexRowSetup(2, 1, 3, state, thread, threads); - reduceDuplexRowSetup(3, 0, 4, state, thread, threads); - reduceDuplexRowSetup(4, 3, 5, state, thread, threads); - reduceDuplexRowSetup(5, 2, 6, state, thread, threads); - reduceDuplexRowSetup(6, 1, 7, state, thread, threads); - - uint32_t rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowt(7, rowa, 0, state, thread, threads); - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowt(0, rowa, 3, state, thread, threads); - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowt(3, rowa, 6, state, thread, threads); - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowt(6, rowa, 1, state, thread, threads); - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowt(1, rowa, 4, state, thread, threads); - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowt(4, rowa, 7, state, thread, threads); - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowt(7, rowa, 2, state, thread, threads); - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowt_8(rowa, state, thread, threads); - - DMatrix[(0 * threads + thread) * blockDim.x + threadIdx.x] = state[0]; - DMatrix[(1 * threads + thread) * blockDim.x + threadIdx.x] = state[1]; - DMatrix[(2 * threads + thread) * blockDim.x + threadIdx.x] = state[2]; - DMatrix[(3 * threads + thread) * blockDim.x + threadIdx.x] = state[3]; - } -} - -__global__ __launch_bounds__(64, 1) -void lyra2_gpu_hash_32_3(uint32_t threads, uint32_t startNounce, uint2 *g_hash) -{ - const uint32_t thread = blockDim.x * blockIdx.x + threadIdx.x; - - uint28 state[4]; - - if (thread < threads) - { - state[0] = __ldg4(&((uint2x4*)DMatrix)[threads * 0 + thread]); - state[1] = __ldg4(&((uint2x4*)DMatrix)[threads * 1 + thread]); - state[2] = __ldg4(&((uint2x4*)DMatrix)[threads * 2 + thread]); - state[3] = __ldg4(&((uint2x4*)DMatrix)[threads * 3 + thread]); - - for (int i = 0; i < 12; i++) - round_lyra(state); - - g_hash[thread + threads * 0] = state[0].x; - g_hash[thread + threads * 1] = state[0].y; - g_hash[thread + threads * 2] = state[0].z; - g_hash[thread + threads * 3] = state[0].w; - - } //thread -} -#else -#if __CUDA_ARCH__ < 500 - -/* for unsupported SM arch */ -__device__ void* DMatrix; -#endif -__global__ void lyra2_gpu_hash_32_1(uint32_t threads, uint32_t startNounce, uint2 *g_hash) {} -__global__ void lyra2_gpu_hash_32_2(uint32_t threads, uint32_t startNounce, uint64_t *g_hash) {} -__global__ void lyra2_gpu_hash_32_3(uint32_t threads, uint32_t startNounce, uint2 *g_hash) {} -#endif - -__host__ -void lyra2_cpu_init(int thr_id, uint32_t threads, uint64_t *d_matrix) -{ - // just assign the device pointer allocated in main loop - cudaMemcpyToSymbol(DMatrix, &d_matrix, sizeof(uint64_t*), 0, cudaMemcpyHostToDevice); -} - -__host__ -void lyra2_cpu_hash_32(int thr_id, uint32_t threads, uint32_t startNounce, uint64_t *d_hash, bool gtx750ti) -{ - int dev_id = device_map[thr_id % MAX_GPUS]; - - uint32_t tpb = TPB52; - - if (cuda_arch[dev_id] >= 520) tpb = TPB52; - else if (cuda_arch[dev_id] >= 500) tpb = TPB50; - else if (cuda_arch[dev_id] >= 200) tpb = TPB20; - - dim3 grid1((threads * 4 + tpb - 1) / tpb); - dim3 block1(4, tpb >> 2); - - dim3 grid2((threads + 64 - 1) / 64); - dim3 block2(64); - - dim3 grid3((threads + tpb - 1) / tpb); - dim3 block3(tpb); - - if (cuda_arch[dev_id] >= 520) - { - lyra2_gpu_hash_32_1 <<< grid2, block2 >>> (threads, startNounce, (uint2*)d_hash); - - lyra2_gpu_hash_32_2 <<< grid1, block1, 24 * (8 - 0) * sizeof(uint2) * tpb >>> (threads, startNounce, d_hash); - - lyra2_gpu_hash_32_3 <<< grid2, block2 >>> (threads, startNounce, (uint2*)d_hash); - } - else if (cuda_arch[dev_id] >= 500) - { - size_t shared_mem = 0; - - if (gtx750ti) - // suitable amount to adjust for 8warp - shared_mem = 8192; - else - // suitable amount to adjust for 10warp - shared_mem = 6144; - - lyra2_gpu_hash_32_1_sm5 <<< grid2, block2 >>> (threads, startNounce, (uint2*)d_hash); - - lyra2_gpu_hash_32_2_sm5 <<< grid1, block1, shared_mem >>> (threads, startNounce, (uint2*)d_hash); - - lyra2_gpu_hash_32_3_sm5 <<< grid2, block2 >>> (threads, startNounce, (uint2*)d_hash); - } - else - lyra2_gpu_hash_32_sm2 <<< grid3, block3 >>> (threads, startNounce, d_hash); -} diff --git a/lyra2/cuda_lyra2Z.cu b/lyra2/cuda_lyra2Z.cu deleted file mode 100644 index 3a7e565f..00000000 --- a/lyra2/cuda_lyra2Z.cu +++ /dev/null @@ -1,973 +0,0 @@ -/** - * Lyra2 (v1) cuda implementation based on djm34 work - * tpruvot@github 2015, Nanashi 08/2016 (from 1.8-r2) - * Lyra2Z implentation for Zcoin based on all the previous - * djm34 2017 - **/ - -#include -#include - -#define TPB52 32 -#define TPB30 160 -#define TPB20 160 - -#include "cuda_lyra2Z_sm5.cuh" - -#ifdef __INTELLISENSE__ -/* just for vstudio code colors */ -__device__ uint32_t __shfl(uint32_t a, uint32_t b, uint32_t c); -#define atomicMin() -#define __CUDA_ARCH__ 520 -#endif - -static uint32_t *h_GNonces[16]; // this need to get fixed as the rest of that routine -static uint32_t *d_GNonces[16]; - -#define reduceDuplexRow(rowIn, rowInOut, rowOut) { \ - for (int i = 0; i < 8; i++) { \ - for (int j = 0; j < 12; j++) \ - state[j] ^= Matrix[12 * i + j][rowIn] + Matrix[12 * i + j][rowInOut]; \ - round_lyra_sm2(state); \ - for (int j = 0; j < 12; j++) \ - Matrix[j + 12 * i][rowOut] ^= state[j]; \ - Matrix[0 + 12 * i][rowInOut] ^= state[11]; \ - Matrix[1 + 12 * i][rowInOut] ^= state[0]; \ - Matrix[2 + 12 * i][rowInOut] ^= state[1]; \ - Matrix[3 + 12 * i][rowInOut] ^= state[2]; \ - Matrix[4 + 12 * i][rowInOut] ^= state[3]; \ - Matrix[5 + 12 * i][rowInOut] ^= state[4]; \ - Matrix[6 + 12 * i][rowInOut] ^= state[5]; \ - Matrix[7 + 12 * i][rowInOut] ^= state[6]; \ - Matrix[8 + 12 * i][rowInOut] ^= state[7]; \ - Matrix[9 + 12 * i][rowInOut] ^= state[8]; \ - Matrix[10+ 12 * i][rowInOut] ^= state[9]; \ - Matrix[11+ 12 * i][rowInOut] ^= state[10]; \ - } \ - } - -#define absorbblock(in) { \ - state[0] ^= Matrix[0][in]; \ - state[1] ^= Matrix[1][in]; \ - state[2] ^= Matrix[2][in]; \ - state[3] ^= Matrix[3][in]; \ - state[4] ^= Matrix[4][in]; \ - state[5] ^= Matrix[5][in]; \ - state[6] ^= Matrix[6][in]; \ - state[7] ^= Matrix[7][in]; \ - state[8] ^= Matrix[8][in]; \ - state[9] ^= Matrix[9][in]; \ - state[10] ^= Matrix[10][in]; \ - state[11] ^= Matrix[11][in]; \ - round_lyra_sm2(state); \ - round_lyra_sm2(state); \ - round_lyra_sm2(state); \ - round_lyra_sm2(state); \ - round_lyra_sm2(state); \ - round_lyra_sm2(state); \ - round_lyra_sm2(state); \ - round_lyra_sm2(state); \ - round_lyra_sm2(state); \ - round_lyra_sm2(state); \ - round_lyra_sm2(state); \ - round_lyra_sm2(state); \ - } - -__device__ __forceinline__ -static void round_lyra_sm2(uint2 *s) -{ - Gfunc(s[0], s[4], s[8], s[12]); - Gfunc(s[1], s[5], s[9], s[13]); - Gfunc(s[2], s[6], s[10], s[14]); - Gfunc(s[3], s[7], s[11], s[15]); - Gfunc(s[0], s[5], s[10], s[15]); - Gfunc(s[1], s[6], s[11], s[12]); - Gfunc(s[2], s[7], s[8], s[13]); - Gfunc(s[3], s[4], s[9], s[14]); -} - -__device__ __forceinline__ -void reduceDuplexRowSetup(const int rowIn, const int rowInOut, const int rowOut, uint2 state[16], uint2 Matrix[96][8]) -{ -#if __CUDA_ARCH__ > 500 -#pragma unroll -#endif - for (int i = 0; i < 8; i++) - { - #pragma unroll - for (int j = 0; j < 12; j++) - state[j] ^= Matrix[12 * i + j][rowIn] + Matrix[12 * i + j][rowInOut]; - - round_lyra_sm2(state); - - #pragma unroll - for (int j = 0; j < 12; j++) - Matrix[j + 84 - 12 * i][rowOut] = Matrix[12 * i + j][rowIn] ^ state[j]; - - Matrix[0 + 12 * i][rowInOut] ^= state[11]; - Matrix[1 + 12 * i][rowInOut] ^= state[0]; - Matrix[2 + 12 * i][rowInOut] ^= state[1]; - Matrix[3 + 12 * i][rowInOut] ^= state[2]; - Matrix[4 + 12 * i][rowInOut] ^= state[3]; - Matrix[5 + 12 * i][rowInOut] ^= state[4]; - Matrix[6 + 12 * i][rowInOut] ^= state[5]; - Matrix[7 + 12 * i][rowInOut] ^= state[6]; - Matrix[8 + 12 * i][rowInOut] ^= state[7]; - Matrix[9 + 12 * i][rowInOut] ^= state[8]; - Matrix[10 + 12 * i][rowInOut] ^= state[9]; - Matrix[11 + 12 * i][rowInOut] ^= state[10]; - } -} - -#if __CUDA_ARCH__ < 350 - -__constant__ static uint2 blake2b_IV_sm2[8] = { - { 0xf3bcc908, 0x6a09e667 }, { 0x84caa73b, 0xbb67ae85 }, - { 0xfe94f82b, 0x3c6ef372 }, { 0x5f1d36f1, 0xa54ff53a }, - { 0xade682d1, 0x510e527f }, { 0x2b3e6c1f, 0x9b05688c }, - { 0xfb41bd6b, 0x1f83d9ab }, { 0x137e2179, 0x5be0cd19 } -}; - -__global__ __launch_bounds__(TPB30, 1) -void lyra2Z_gpu_hash_32_sm2(uint32_t threads, uint32_t startNounce, uint64_t *g_hash, uint32_t *resNonces) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - const uint2 Mask[8] = { - { 0x00000020, 0x00000000 },{ 0x00000020, 0x00000000 }, - { 0x00000020, 0x00000000 },{ 0x00000008, 0x00000000 }, - { 0x00000008, 0x00000000 },{ 0x00000008, 0x00000000 }, - { 0x00000080, 0x00000000 },{ 0x00000000, 0x01000000 } - }; - if (thread < threads) - { - uint2 state[16]; - - #pragma unroll - for (int i = 0; i<4; i++) { - LOHI(state[i].x, state[i].y, g_hash[threads*i + thread]); - } //password - - #pragma unroll - for (int i = 0; i<4; i++) { - state[i + 4] = state[i]; - } //salt - - #pragma unroll - for (int i = 0; i<8; i++) { - state[i + 8] = blake2b_IV_sm2[i]; - } - - // blake2blyra x2 - //#pragma unroll 24 - for (int i = 0; i<12; i++) { - round_lyra_sm2(state); - } - - for (int i = 0; i<8; i++) - state[i] ^= Mask[i]; - - for (int i = 0; i<12; i++) { - round_lyra_sm2(state); - } - - uint2 Matrix[96][8]; // not cool - - // reducedSqueezeRow0 - #pragma unroll 8 - for (int i = 0; i < 8; i++) - { - #pragma unroll 12 - for (int j = 0; j<12; j++) { - Matrix[j + 84 - 12 * i][0] = state[j]; - } - round_lyra_sm2(state); - } - - // reducedSqueezeRow1 - #pragma unroll 8 - for (int i = 0; i < 8; i++) - { - #pragma unroll 12 - for (int j = 0; j<12; j++) { - state[j] ^= Matrix[j + 12 * i][0]; - } - round_lyra_sm2(state); - #pragma unroll 12 - for (int j = 0; j<12; j++) { - Matrix[j + 84 - 12 * i][1] = Matrix[j + 12 * i][0] ^ state[j]; - } - } - - reduceDuplexRowSetup(1, 0, 2, state, Matrix); - reduceDuplexRowSetup(2, 1, 3, state, Matrix); - reduceDuplexRowSetup(3, 0, 4, state, Matrix); - reduceDuplexRowSetup(4, 3, 5, state, Matrix); - reduceDuplexRowSetup(5, 2, 6, state, Matrix); - reduceDuplexRowSetup(6, 1, 7, state, Matrix); - - uint32_t rowa; - uint32_t prev = 7; - uint32_t iterator = 0; - for (uint32_t i = 0; i<8; i++) { - rowa = state[0].x & 7; - reduceDuplexRow(prev, rowa, iterator); - prev = iterator; - iterator = (iterator + 3) & 7; - } - for (uint32_t i = 0; i<8; i++) { - rowa = state[0].x & 7; - reduceDuplexRow(prev, rowa, iterator); - prev = iterator; - iterator = (iterator - 1) & 7; - } - - for (uint32_t i = 0; i<8; i++) { - rowa = state[0].x & 7; - reduceDuplexRow(prev, rowa, iterator); - prev = iterator; - iterator = (iterator + 3) & 7; - } - for (uint32_t i = 0; i<8; i++) { - rowa = state[0].x & 7; - reduceDuplexRow(prev, rowa, iterator); - prev = iterator; - iterator = (iterator - 1) & 7; - } - - for (uint32_t i = 0; i<8; i++) { - rowa = state[0].x & 7; - reduceDuplexRow(prev, rowa, iterator); - prev = iterator; - iterator = (iterator + 3) & 7; - } - for (uint32_t i = 0; i<8; i++) { - rowa = state[0].x & 7; - reduceDuplexRow(prev, rowa, iterator); - prev = iterator; - iterator = (iterator - 1) & 7; - } - - for (uint32_t i = 0; i<8; i++) { - rowa = state[0].x & 7; - reduceDuplexRow(prev, rowa, iterator); - prev = iterator; - iterator = (iterator + 3) & 7; - } - for (uint32_t i = 0; i<8; i++) { - rowa = state[0].x & 7; - reduceDuplexRow(prev, rowa, iterator); - prev = iterator; - iterator = (iterator - 1) & 7; - } - - absorbblock(rowa); - uint32_t nonce = startNounce + thread; - if (((uint64_t*)state)[3] <= ((uint64_t*)pTarget)[3]) { - atomicMin(&resNonces[1], resNonces[0]); - atomicMin(&resNonces[0], nonce); - } - } //thread -} -#else -__global__ void lyra2Z_gpu_hash_32_sm2(uint32_t threads, uint32_t startNounce, uint64_t *g_hash, uint32_t *resNonces) {} -#endif - -#if __CUDA_ARCH__ > 500 - -#include "cuda_lyra2_vectors.h" -//#include "cuda_vector_uint2x4.h" - -#define Nrow 8 -#define Ncol 8 -#define memshift 3 - -#define BUF_COUNT 0 - -__device__ uint2 *DMatrix; - -__device__ __forceinline__ -void LD4S(uint2 res[3], const int row, const int col, const int thread, const int threads) -{ -#if BUF_COUNT != 8 - extern __shared__ uint2 shared_mem[]; - const int s0 = (Ncol * (row - BUF_COUNT) + col) * memshift; -#endif -#if BUF_COUNT != 0 - const int d0 = (memshift *(Ncol * row + col) * threads + thread)*blockDim.x + threadIdx.x; -#endif - -#if BUF_COUNT == 8 - #pragma unroll - for (int j = 0; j < 3; j++) - res[j] = *(DMatrix + d0 + j * threads * blockDim.x); -#elif BUF_COUNT == 0 - #pragma unroll - for (int j = 0; j < 3; j++) - res[j] = shared_mem[((s0 + j) * blockDim.y + threadIdx.y) * blockDim.x + threadIdx.x]; -#else - if (row < BUF_COUNT) { - #pragma unroll - for (int j = 0; j < 3; j++) - res[j] = *(DMatrix + d0 + j * threads * blockDim.x); - } else { - #pragma unroll - for (int j = 0; j < 3; j++) - res[j] = shared_mem[((s0 + j) * blockDim.y + threadIdx.y) * blockDim.x + threadIdx.x]; - } -#endif -} - -__device__ __forceinline__ -void ST4S(const int row, const int col, const uint2 data[3], const int thread, const int threads) -{ -#if BUF_COUNT != 8 - extern __shared__ uint2 shared_mem[]; - const int s0 = (Ncol * (row - BUF_COUNT) + col) * memshift; -#endif -#if BUF_COUNT != 0 - const int d0 = (memshift *(Ncol * row + col) * threads + thread)*blockDim.x + threadIdx.x; -#endif - -#if BUF_COUNT == 8 - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + d0 + j * threads * blockDim.x) = data[j]; - -#elif BUF_COUNT == 0 - #pragma unroll - for (int j = 0; j < 3; j++) - shared_mem[((s0 + j) * blockDim.y + threadIdx.y) * blockDim.x + threadIdx.x] = data[j]; -#else - if (row < BUF_COUNT) { - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + d0 + j * threads * blockDim.x) = data[j]; - } else { - #pragma unroll - for (int j = 0; j < 3; j++) - shared_mem[((s0 + j) * blockDim.y + threadIdx.y) * blockDim.x + threadIdx.x] = data[j]; - } -#endif -} - -#if __CUDA_ARCH__ >= 300 -__device__ __forceinline__ uint32_t WarpShuffle(uint32_t a, uint32_t b, uint32_t c) -{ - return __shfl(a, b, c); -} - -__device__ __forceinline__ uint2 WarpShuffle(uint2 a, uint32_t b, uint32_t c) -{ - return make_uint2(__shfl(a.x, b, c), __shfl(a.y, b, c)); -} - -__device__ __forceinline__ -void WarpShuffle3(uint2 &a1, uint2 &a2, uint2 &a3, uint32_t b1, uint32_t b2, uint32_t b3, uint32_t c) -{ - a1 = WarpShuffle(a1, b1, c); - a2 = WarpShuffle(a2, b2, c); - a3 = WarpShuffle(a3, b3, c); -} - -#else -__device__ __forceinline__ uint32_t WarpShuffle(uint32_t a, uint32_t b, uint32_t c) -{ - extern __shared__ uint2 shared_mem[]; - - const uint32_t thread = blockDim.x * threadIdx.y + threadIdx.x; - uint32_t *_ptr = (uint32_t*)shared_mem; - - __threadfence_block(); - uint32_t buf = _ptr[thread]; - - _ptr[thread] = a; - __threadfence_block(); - uint32_t result = _ptr[(thread&~(c - 1)) + (b&(c - 1))]; - - __threadfence_block(); - _ptr[thread] = buf; - - __threadfence_block(); - return result; -} - -__device__ __forceinline__ uint2 WarpShuffle(uint2 a, uint32_t b, uint32_t c) -{ - extern __shared__ uint2 shared_mem[]; - - const uint32_t thread = blockDim.x * threadIdx.y + threadIdx.x; - - __threadfence_block(); - uint2 buf = shared_mem[thread]; - - shared_mem[thread] = a; - __threadfence_block(); - uint2 result = shared_mem[(thread&~(c - 1)) + (b&(c - 1))]; - - __threadfence_block(); - shared_mem[thread] = buf; - - __threadfence_block(); - return result; -} - -__device__ __forceinline__ void WarpShuffle3(uint2 &a1, uint2 &a2, uint2 &a3, uint32_t b1, uint32_t b2, uint32_t b3, uint32_t c) -{ - extern __shared__ uint2 shared_mem[]; - - const uint32_t thread = blockDim.x * threadIdx.y + threadIdx.x; - - __threadfence_block(); - uint2 buf = shared_mem[thread]; - - shared_mem[thread] = a1; - __threadfence_block(); - a1 = shared_mem[(thread&~(c - 1)) + (b1&(c - 1))]; - __threadfence_block(); - shared_mem[thread] = a2; - __threadfence_block(); - a2 = shared_mem[(thread&~(c - 1)) + (b2&(c - 1))]; - __threadfence_block(); - shared_mem[thread] = a3; - __threadfence_block(); - a3 = shared_mem[(thread&~(c - 1)) + (b3&(c - 1))]; - - __threadfence_block(); - shared_mem[thread] = buf; - __threadfence_block(); -} -#endif - -__device__ __forceinline__ void round_lyra(uint2 s[4]) -{ - Gfunc(s[0], s[1], s[2], s[3]); - WarpShuffle3(s[1], s[2], s[3], threadIdx.x + 1, threadIdx.x + 2, threadIdx.x + 3, 4); - Gfunc(s[0], s[1], s[2], s[3]); - WarpShuffle3(s[1], s[2], s[3], threadIdx.x + 3, threadIdx.x + 2, threadIdx.x + 1, 4); -} - -static __device__ __forceinline__ -void round_lyra(uint2x4* s) -{ - Gfunc(s[0].x, s[1].x, s[2].x, s[3].x); - Gfunc(s[0].y, s[1].y, s[2].y, s[3].y); - Gfunc(s[0].z, s[1].z, s[2].z, s[3].z); - Gfunc(s[0].w, s[1].w, s[2].w, s[3].w); - Gfunc(s[0].x, s[1].y, s[2].z, s[3].w); - Gfunc(s[0].y, s[1].z, s[2].w, s[3].x); - Gfunc(s[0].z, s[1].w, s[2].x, s[3].y); - Gfunc(s[0].w, s[1].x, s[2].y, s[3].z); -} - -static __device__ __forceinline__ -void reduceDuplex(uint2 state[4], uint32_t thread, const uint32_t threads) -{ - uint2 state1[3]; - -#if __CUDA_ARCH__ > 500 -#pragma unroll -#endif - for (int i = 0; i < Nrow; i++) - { - ST4S(0, Ncol - i - 1, state, thread, threads); - - round_lyra(state); - } - - #pragma unroll 4 - for (int i = 0; i < Nrow; i++) - { - LD4S(state1, 0, i, thread, threads); - for (int j = 0; j < 3; j++) - state[j] ^= state1[j]; - - round_lyra(state); - - for (int j = 0; j < 3; j++) - state1[j] ^= state[j]; - ST4S(1, Ncol - i - 1, state1, thread, threads); - } -} - -static __device__ __forceinline__ -void reduceDuplexRowSetup(const int rowIn, const int rowInOut, const int rowOut, uint2 state[4], uint32_t thread, const uint32_t threads) -{ - uint2 state1[3], state2[3]; - - #pragma unroll 1 - for (int i = 0; i < Nrow; i++) - { - LD4S(state1, rowIn, i, thread, threads); - LD4S(state2, rowInOut, i, thread, threads); - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + state2[j]; - - round_lyra(state); - - #pragma unroll - for (int j = 0; j < 3; j++) - state1[j] ^= state[j]; - - ST4S(rowOut, Ncol - i - 1, state1, thread, threads); - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - state2[0] ^= Data2; - state2[1] ^= Data0; - state2[2] ^= Data1; - } else { - state2[0] ^= Data0; - state2[1] ^= Data1; - state2[2] ^= Data2; - } - - ST4S(rowInOut, i, state2, thread, threads); - } -} - -static __device__ __forceinline__ -void reduceDuplexRowt(const int rowIn, const int rowInOut, const int rowOut, uint2 state[4], const uint32_t thread, const uint32_t threads) -{ - for (int i = 0; i < Nrow; i++) - { - uint2 state1[3], state2[3]; - - LD4S(state1, rowIn, i, thread, threads); - LD4S(state2, rowInOut, i, thread, threads); - - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + state2[j]; - - round_lyra(state); - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - state2[0] ^= Data2; - state2[1] ^= Data0; - state2[2] ^= Data1; - } - else - { - state2[0] ^= Data0; - state2[1] ^= Data1; - state2[2] ^= Data2; - } - - ST4S(rowInOut, i, state2, thread, threads); - - LD4S(state1, rowOut, i, thread, threads); - - #pragma unroll - for (int j = 0; j < 3; j++) - state1[j] ^= state[j]; - - ST4S(rowOut, i, state1, thread, threads); - } -} - -#if 0 -static __device__ __forceinline__ -void reduceDuplexRowt_8(const int rowInOut, uint2* state, const uint32_t thread, const uint32_t threads) -{ - uint2 state1[3], state2[3], last[3]; - - LD4S(state1, 2, 0, thread, threads); - LD4S(last, rowInOut, 0, thread, threads); - - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + last[j]; - - round_lyra(state); - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - last[0] ^= Data2; - last[1] ^= Data0; - last[2] ^= Data1; - } else { - last[0] ^= Data0; - last[1] ^= Data1; - last[2] ^= Data2; - } - - if (rowInOut == 5) - { - #pragma unroll - for (int j = 0; j < 3; j++) - last[j] ^= state[j]; - } - - for (int i = 1; i < Nrow; i++) - { - LD4S(state1, 2, i, thread, threads); - LD4S(state2, rowInOut, i, thread, threads); - - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + state2[j]; - - round_lyra(state); - } - - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= last[j]; -} -#endif - -static __device__ __forceinline__ -void reduceDuplexRowt_8_v2(const int rowIn, const int rowOut, const int rowInOut, uint2* state, const uint32_t thread, const uint32_t threads) -{ - uint2 state1[3], state2[3], last[3]; - - LD4S(state1, rowIn, 0, thread, threads); - LD4S(last, rowInOut, 0, thread, threads); - - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + last[j]; - - round_lyra(state); - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - last[0] ^= Data2; - last[1] ^= Data0; - last[2] ^= Data1; - } - else { - last[0] ^= Data0; - last[1] ^= Data1; - last[2] ^= Data2; - } - - if (rowInOut == rowOut) { - #pragma unroll - for (int j = 0; j < 3; j++) - last[j] ^= state[j]; - } - - for (int i = 1; i < Nrow; i++) - { - LD4S(state1, rowIn, i, thread, threads); - LD4S(state2, rowInOut, i, thread, threads); - - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + state2[j]; - - round_lyra(state); - } - - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= last[j]; -} - -__global__ -__launch_bounds__(64, 1) -void lyra2Z_gpu_hash_32_1(uint32_t threads, uint32_t startNounce, uint2 *g_hash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - const uint2x4 Mask[2] = { - 0x00000020UL, 0x00000000UL, 0x00000020UL, 0x00000000UL, - 0x00000020UL, 0x00000000UL, 0x00000008UL, 0x00000000UL, - 0x00000008UL, 0x00000000UL, 0x00000008UL, 0x00000000UL, - 0x00000080UL, 0x00000000UL, 0x00000000UL, 0x01000000UL - }; - const uint2x4 blake2b_IV[2] = { - 0xf3bcc908lu, 0x6a09e667lu, - 0x84caa73blu, 0xbb67ae85lu, - 0xfe94f82blu, 0x3c6ef372lu, - 0x5f1d36f1lu, 0xa54ff53alu, - 0xade682d1lu, 0x510e527flu, - 0x2b3e6c1flu, 0x9b05688clu, - 0xfb41bd6blu, 0x1f83d9ablu, - 0x137e2179lu, 0x5be0cd19lu - }; - if (thread < threads) - { - uint2x4 state[4]; - - state[0].x = state[1].x = __ldg(&g_hash[thread + threads * 0]); - state[0].y = state[1].y = __ldg(&g_hash[thread + threads * 1]); - state[0].z = state[1].z = __ldg(&g_hash[thread + threads * 2]); - state[0].w = state[1].w = __ldg(&g_hash[thread + threads * 3]); - state[2] = blake2b_IV[0]; - state[3] = blake2b_IV[1]; - - for (int i = 0; i<12; i++) - round_lyra(state); - - state[0] ^= Mask[0]; - state[1] ^= Mask[1]; - - for (int i = 0; i<12; i++) - round_lyra(state); //because 12 is not enough - - ((uint2x4*)DMatrix)[threads * 0 + thread] = state[0]; - ((uint2x4*)DMatrix)[threads * 1 + thread] = state[1]; - ((uint2x4*)DMatrix)[threads * 2 + thread] = state[2]; - ((uint2x4*)DMatrix)[threads * 3 + thread] = state[3]; - } -} - -__global__ -__launch_bounds__(TPB52, 1) -void lyra2Z_gpu_hash_32_2(uint32_t threads, uint32_t startNounce, uint64_t *g_hash) -{ - const uint32_t thread = blockDim.y * blockIdx.x + threadIdx.y; - - if (thread < threads) - { - uint2 state[4]; - state[0] = __ldg(&DMatrix[(0 * threads + thread) * blockDim.x + threadIdx.x]); - state[1] = __ldg(&DMatrix[(1 * threads + thread) * blockDim.x + threadIdx.x]); - state[2] = __ldg(&DMatrix[(2 * threads + thread) * blockDim.x + threadIdx.x]); - state[3] = __ldg(&DMatrix[(3 * threads + thread) * blockDim.x + threadIdx.x]); - - reduceDuplex(state, thread, threads); - reduceDuplexRowSetup(1, 0, 2, state, thread, threads); - reduceDuplexRowSetup(2, 1, 3, state, thread, threads); - reduceDuplexRowSetup(3, 0, 4, state, thread, threads); - reduceDuplexRowSetup(4, 3, 5, state, thread, threads); - reduceDuplexRowSetup(5, 2, 6, state, thread, threads); - reduceDuplexRowSetup(6, 1, 7, state, thread, threads); - - uint32_t rowa; // = WarpShuffle(state[0].x, 0, 4) & 7; - uint32_t prev = 7; - uint32_t iterator = 0; - - //for (uint32_t j=0;j<4;j++) { - - for (uint32_t i = 0; i<8; i++) { - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowt(prev, rowa, iterator, state, thread, threads); - prev = iterator; - iterator = (iterator + 3) & 7; - } - - for (uint32_t i = 0; i<8; i++) { - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowt(prev, rowa, iterator, state, thread, threads); - prev = iterator; - iterator = (iterator - 1) & 7; - } - - for (uint32_t i = 0; i<8; i++) { - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowt(prev, rowa, iterator, state, thread, threads); - prev = iterator; - iterator = (iterator + 3) & 7; - } - - for (uint32_t i = 0; i<8; i++) { - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowt(prev, rowa, iterator, state, thread, threads); - prev = iterator; - iterator = (iterator - 1) & 7; - } - - for (uint32_t i = 0; i<8; i++) { - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowt(prev, rowa, iterator, state, thread, threads); - prev = iterator; - iterator = (iterator + 3) & 7; - } - - for (uint32_t i = 0; i<8; i++) { - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowt(prev, rowa, iterator, state, thread, threads); - prev = iterator; - iterator = (iterator - 1) & 7; - } - - for (uint32_t i = 0; i<8; i++) { - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowt(prev, rowa, iterator, state, thread, threads); - prev = iterator; - iterator = (iterator + 3) & 7; - } - - for (uint32_t i = 0; i<7; i++) { - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowt(prev, rowa, iterator, state, thread, threads); - prev = iterator; - iterator = (iterator - 1) & 7; - } - - //} - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowt_8_v2(prev,iterator,rowa, state, thread, threads); - - DMatrix[(0 * threads + thread) * blockDim.x + threadIdx.x] = state[0]; - DMatrix[(1 * threads + thread) * blockDim.x + threadIdx.x] = state[1]; - DMatrix[(2 * threads + thread) * blockDim.x + threadIdx.x] = state[2]; - DMatrix[(3 * threads + thread) * blockDim.x + threadIdx.x] = state[3]; - } -} - -__global__ -__launch_bounds__(64, 1) -void lyra2Z_gpu_hash_32_3(uint32_t threads, uint32_t startNounce, uint2 *g_hash, uint32_t *resNonces) -{ - const uint32_t thread = blockDim.x * blockIdx.x + threadIdx.x; - - uint28 state[4]; - - if (thread < threads) - { - state[0] = __ldg4(&((uint2x4*)DMatrix)[threads * 0 + thread]); - state[1] = __ldg4(&((uint2x4*)DMatrix)[threads * 1 + thread]); - state[2] = __ldg4(&((uint2x4*)DMatrix)[threads * 2 + thread]); - state[3] = __ldg4(&((uint2x4*)DMatrix)[threads * 3 + thread]); - - for (int i = 0; i < 12; i++) - round_lyra(state); - - uint32_t nonce = startNounce + thread; - if (((uint64_t*)state)[3] <= ((uint64_t*)pTarget)[3]) { - atomicMin(&resNonces[1], resNonces[0]); - atomicMin(&resNonces[0], nonce); - } -/* - g_hash[thread + threads * 0] = state[0].x; - g_hash[thread + threads * 1] = state[0].y; - g_hash[thread + threads * 2] = state[0].z; - g_hash[thread + threads * 3] = state[0].w; -*/ - } -} -#else -#if __CUDA_ARCH__ < 350 -__device__ void* DMatrix; -#endif -__global__ void lyra2Z_gpu_hash_32_1(uint32_t threads, uint32_t startNounce, uint2 *g_hash) {} -__global__ void lyra2Z_gpu_hash_32_2(uint32_t threads, uint32_t startNounce, uint64_t *g_hash) {} -__global__ void lyra2Z_gpu_hash_32_3(uint32_t threads, uint32_t startNounce, uint2 *g_hash, uint32_t *resNonces) {} -#endif - -__host__ -void lyra2Z_cpu_init(int thr_id, uint32_t threads, uint64_t *d_matrix) -{ - // just assign the device pointer allocated in main loop - cudaMemcpyToSymbol(DMatrix, &d_matrix, sizeof(uint64_t*), 0, cudaMemcpyHostToDevice); - cudaMalloc(&d_GNonces[thr_id], 2 * sizeof(uint32_t)); - cudaMallocHost(&h_GNonces[thr_id], 2 * sizeof(uint32_t)); -} - -__host__ -void lyra2Z_cpu_init_sm2(int thr_id, uint32_t threads) -{ - // just assign the device pointer allocated in main loop - cudaMalloc(&d_GNonces[thr_id], 2 * sizeof(uint32_t)); - cudaMallocHost(&h_GNonces[thr_id], 2 * sizeof(uint32_t)); -} - -__host__ -void lyra2Z_cpu_free(int thr_id) -{ - cudaFree(d_GNonces[thr_id]); - cudaFreeHost(h_GNonces[thr_id]); -} - -__host__ -uint32_t lyra2Z_getSecNonce(int thr_id, int num) -{ - uint32_t results[2]; - memset(results, 0xFF, sizeof(results)); - cudaMemcpy(results, d_GNonces[thr_id], sizeof(results), cudaMemcpyDeviceToHost); - if (results[1] == results[0]) - return UINT32_MAX; - return results[num]; -} - -__host__ -void lyra2Z_setTarget(const void *pTargetIn) -{ - cudaMemcpyToSymbol(pTarget, pTargetIn, 32, 0, cudaMemcpyHostToDevice); -} - -__host__ -uint32_t lyra2Z_cpu_hash_32(int thr_id, uint32_t threads, uint32_t startNounce, uint64_t *d_hash, bool gtx750ti) -{ - uint32_t result = UINT32_MAX; - cudaMemset(d_GNonces[thr_id], 0xff, 2 * sizeof(uint32_t)); - int dev_id = device_map[thr_id % MAX_GPUS]; - - uint32_t tpb = TPB52; - - if (device_sm[dev_id] == 500) - tpb = TPB50; - if (device_sm[dev_id] == 200) - tpb = TPB20; - - dim3 grid1((threads * 4 + tpb - 1) / tpb); - dim3 block1(4, tpb >> 2); - - dim3 grid2((threads + 64 - 1) / 64); - dim3 block2(64); - - dim3 grid3((threads + tpb - 1) / tpb); - dim3 block3(tpb); - - if (device_sm[dev_id] >= 520) - { - lyra2Z_gpu_hash_32_1 <<< grid2, block2 >>> (threads, startNounce, (uint2*)d_hash); - - lyra2Z_gpu_hash_32_2 <<< grid1, block1, 24 * (8 - 0) * sizeof(uint2) * tpb >>> (threads, startNounce, d_hash); - - lyra2Z_gpu_hash_32_3 <<< grid2, block2 >>> (threads, startNounce, (uint2*)d_hash, d_GNonces[thr_id]); - } - else if (device_sm[dev_id] == 500 || device_sm[dev_id] == 350) - { - size_t shared_mem = 0; - - if (gtx750ti) - // suitable amount to adjust for 8warp - shared_mem = 8192; - else - // suitable amount to adjust for 10warp - shared_mem = 6144; - - lyra2Z_gpu_hash_32_1_sm5 <<< grid2, block2 >>> (threads, startNounce, (uint2*)d_hash); - - lyra2Z_gpu_hash_32_2_sm5 <<< grid1, block1, shared_mem >>> (threads, startNounce, (uint2*)d_hash); - - lyra2Z_gpu_hash_32_3_sm5 <<< grid2, block2 >>> (threads, startNounce, (uint2*)d_hash, d_GNonces[thr_id]); - } - else - lyra2Z_gpu_hash_32_sm2 <<< grid3, block3 >>> (threads, startNounce, d_hash, d_GNonces[thr_id]); - - // get first found nonce - cudaMemcpy(h_GNonces[thr_id], d_GNonces[thr_id], 1 * sizeof(uint32_t), cudaMemcpyDeviceToHost); - result = *h_GNonces[thr_id]; - - return result; -} diff --git a/lyra2/cuda_lyra2Z_sm5.cuh b/lyra2/cuda_lyra2Z_sm5.cuh deleted file mode 100644 index 1d8ae689..00000000 --- a/lyra2/cuda_lyra2Z_sm5.cuh +++ /dev/null @@ -1,819 +0,0 @@ -#include - -#ifdef __INTELLISENSE__ -/* just for vstudio code colors */ -//#define __CUDA_ARCH__ 500 -#define __threadfence_block() -#define __ldg(x) *(x) -#define atomicMin(p,y) y -#endif - -#include "cuda_helper.h" - -#define TPB50 32 - -__constant__ uint32_t pTarget[8]; - -static __device__ __forceinline__ -void Gfunc(uint2 & a, uint2 &b, uint2 &c, uint2 &d) -{ -#if __CUDA_ARCH__ > 500 - a += b; uint2 tmp = d; d.y = a.x ^ tmp.x; d.x = a.y ^ tmp.y; - c += d; b ^= c; b = ROR24(b); - a += b; d ^= a; d = ROR16(d); - c += d; b ^= c; b = ROR2(b, 63); -#else - a += b; d ^= a; d = SWAPUINT2(d); - c += d; b ^= c; b = ROR2(b, 24); - a += b; d ^= a; d = ROR2(d, 16); - c += d; b ^= c; b = ROR2(b, 63); -#endif -} - -#if __CUDA_ARCH__ == 500 || __CUDA_ARCH__ == 350 -#include "cuda_lyra2_vectors.h" - -#define Nrow 8 -#define Ncol 8 -#define memshift 3 - -__device__ uint2 *DMatrix; - -__device__ __forceinline__ uint2 LD4S(const int index) -{ - extern __shared__ uint2 shared_mem[]; - - return shared_mem[(index * blockDim.y + threadIdx.y) * blockDim.x + threadIdx.x]; -} - -__device__ __forceinline__ void ST4S(const int index, const uint2 data) -{ - extern __shared__ uint2 shared_mem[]; - - shared_mem[(index * blockDim.y + threadIdx.y) * blockDim.x + threadIdx.x] = data; -} - -#if __CUDA_ARCH__ == 300 -__device__ __forceinline__ uint32_t WarpShuffle(uint32_t a, uint32_t b, uint32_t c) -{ - return __shfl(a, b, c); -} - -__device__ __forceinline__ uint2 WarpShuffle(uint2 a, uint32_t b, uint32_t c) -{ - return make_uint2(__shfl(a.x, b, c), __shfl(a.y, b, c)); -} - -__device__ __forceinline__ void WarpShuffle3(uint2 &a1, uint2 &a2, uint2 &a3, uint32_t b1, uint32_t b2, uint32_t b3, uint32_t c) -{ - a1 = WarpShuffle(a1, b1, c); - a2 = WarpShuffle(a2, b2, c); - a3 = WarpShuffle(a3, b3, c); -} -#else // != 300 - -__device__ __forceinline__ uint32_t WarpShuffle(uint32_t a, uint32_t b, uint32_t c) -{ - extern __shared__ uint2 shared_mem[]; - - const uint32_t thread = blockDim.x * threadIdx.y + threadIdx.x; - uint32_t *_ptr = (uint32_t*)shared_mem; - - __threadfence_block(); - uint32_t buf = _ptr[thread]; - - _ptr[thread] = a; - __threadfence_block(); - uint32_t result = _ptr[(thread&~(c - 1)) + (b&(c - 1))]; - - __threadfence_block(); - _ptr[thread] = buf; - - __threadfence_block(); - return result; -} - -__device__ __forceinline__ uint2 WarpShuffle(uint2 a, uint32_t b, uint32_t c) -{ - extern __shared__ uint2 shared_mem[]; - - const uint32_t thread = blockDim.x * threadIdx.y + threadIdx.x; - - __threadfence_block(); - uint2 buf = shared_mem[thread]; - - shared_mem[thread] = a; - __threadfence_block(); - uint2 result = shared_mem[(thread&~(c - 1)) + (b&(c - 1))]; - - __threadfence_block(); - shared_mem[thread] = buf; - - __threadfence_block(); - return result; -} - -__device__ __forceinline__ void WarpShuffle3(uint2 &a1, uint2 &a2, uint2 &a3, uint32_t b1, uint32_t b2, uint32_t b3, uint32_t c) -{ - extern __shared__ uint2 shared_mem[]; - - const uint32_t thread = blockDim.x * threadIdx.y + threadIdx.x; - - __threadfence_block(); - uint2 buf = shared_mem[thread]; - - shared_mem[thread] = a1; - __threadfence_block(); - a1 = shared_mem[(thread&~(c - 1)) + (b1&(c - 1))]; - __threadfence_block(); - shared_mem[thread] = a2; - __threadfence_block(); - a2 = shared_mem[(thread&~(c - 1)) + (b2&(c - 1))]; - __threadfence_block(); - shared_mem[thread] = a3; - __threadfence_block(); - a3 = shared_mem[(thread&~(c - 1)) + (b3&(c - 1))]; - - __threadfence_block(); - shared_mem[thread] = buf; - __threadfence_block(); -} - -#endif // != 300 - -__device__ __forceinline__ void round_lyra(uint2 s[4]) -{ - Gfunc(s[0], s[1], s[2], s[3]); - WarpShuffle3(s[1], s[2], s[3], threadIdx.x + 1, threadIdx.x + 2, threadIdx.x + 3, 4); - Gfunc(s[0], s[1], s[2], s[3]); - WarpShuffle3(s[1], s[2], s[3], threadIdx.x + 3, threadIdx.x + 2, threadIdx.x + 1, 4); -} - -static __device__ __forceinline__ -void round_lyra(uint2x4* s) -{ - Gfunc(s[0].x, s[1].x, s[2].x, s[3].x); - Gfunc(s[0].y, s[1].y, s[2].y, s[3].y); - Gfunc(s[0].z, s[1].z, s[2].z, s[3].z); - Gfunc(s[0].w, s[1].w, s[2].w, s[3].w); - Gfunc(s[0].x, s[1].y, s[2].z, s[3].w); - Gfunc(s[0].y, s[1].z, s[2].w, s[3].x); - Gfunc(s[0].z, s[1].w, s[2].x, s[3].y); - Gfunc(s[0].w, s[1].x, s[2].y, s[3].z); -} - -static __device__ __forceinline__ -void reduceDuplexV5(uint2 state[4], const uint32_t thread, const uint32_t threads) -{ - uint2 state1[3], state2[3]; - - const uint32_t ps0 = (memshift * Ncol * 0 * threads + thread)*blockDim.x + threadIdx.x; - const uint32_t ps1 = (memshift * Ncol * 1 * threads + thread)*blockDim.x + threadIdx.x; - const uint32_t ps2 = (memshift * Ncol * 2 * threads + thread)*blockDim.x + threadIdx.x; - const uint32_t ps3 = (memshift * Ncol * 3 * threads + thread)*blockDim.x + threadIdx.x; - const uint32_t ps4 = (memshift * Ncol * 4 * threads + thread)*blockDim.x + threadIdx.x; - const uint32_t ps5 = (memshift * Ncol * 5 * threads + thread)*blockDim.x + threadIdx.x; - const uint32_t ps6 = (memshift * Ncol * 6 * threads + thread)*blockDim.x + threadIdx.x; - const uint32_t ps7 = (memshift * Ncol * 7 * threads + thread)*blockDim.x + threadIdx.x; - - for (int i = 0; i < 8; i++) - { - const uint32_t s0 = memshift * Ncol * 0 + (Ncol - 1 - i) * memshift; - #pragma unroll - for (int j = 0; j < 3; j++) - ST4S(s0 + j, state[j]); - round_lyra(state); - } - - for (int i = 0; i < 8; i++) - { - const uint32_t s0 = memshift * Ncol * 0 + i * memshift; - const uint32_t s1 = ps1 + (7 - i)*memshift* threads*blockDim.x; - #pragma unroll - for (int j = 0; j < 3; j++) - state1[j] = LD4S(s0 + j); - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j]; - - round_lyra(state); - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s1 + j*threads*blockDim.x) = state1[j] ^ state[j]; - } - - // 1, 0, 2 - for (int i = 0; i < 8; i++) - { - const uint32_t s0 = memshift * Ncol * 0 + i * memshift; - const uint32_t s1 = ps1 + i * memshift* threads*blockDim.x; - const uint32_t s2 = ps2 + (7 - i)*memshift* threads*blockDim.x; - #pragma unroll - for (int j = 0; j < 3; j++) - state1[j] = *(DMatrix + s1 + j*threads*blockDim.x); - #pragma unroll - for (int j = 0; j < 3; j++) - state2[j] = LD4S(s0 + j); - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + state2[j]; - - round_lyra(state); - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s2 + j*threads*blockDim.x) = state1[j] ^ state[j]; - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - state2[0] ^= Data2; - state2[1] ^= Data0; - state2[2] ^= Data1; - } - else - { - state2[0] ^= Data0; - state2[1] ^= Data1; - state2[2] ^= Data2; - } - - #pragma unroll - for (int j = 0; j < 3; j++) - ST4S(s0 + j, state2[j]); - } - - // 2, 1, 3 - for (int i = 0; i < 8; i++) - { - const uint32_t s1 = ps1 + i * memshift* threads*blockDim.x; - const uint32_t s2 = ps2 + i * memshift* threads*blockDim.x; - const uint32_t s3 = ps3 + (7 - i)*memshift* threads*blockDim.x; - #pragma unroll - for (int j = 0; j < 3; j++) - state1[j] = *(DMatrix + s2 + j*threads*blockDim.x); - #pragma unroll - for (int j = 0; j < 3; j++) - state2[j] = *(DMatrix + s1 + j*threads*blockDim.x); - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + state2[j]; - - round_lyra(state); - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s3 + j*threads*blockDim.x) = state1[j] ^ state[j]; - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - state2[0] ^= Data2; - state2[1] ^= Data0; - state2[2] ^= Data1; - } else { - state2[0] ^= Data0; - state2[1] ^= Data1; - state2[2] ^= Data2; - } - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s1 + j*threads*blockDim.x) = state2[j]; - } - - // 3, 0, 4 - for (int i = 0; i < 8; i++) - { - const uint32_t ls0 = memshift * Ncol * 0 + i * memshift; - const uint32_t s0 = ps0 + i * memshift* threads*blockDim.x; - const uint32_t s3 = ps3 + i * memshift* threads*blockDim.x; - const uint32_t s4 = ps4 + (7 - i)*memshift* threads*blockDim.x; - #pragma unroll - for (int j = 0; j < 3; j++) - state1[j] = *(DMatrix + s3 + j*threads*blockDim.x); - #pragma unroll - for (int j = 0; j < 3; j++) - state2[j] = LD4S(ls0 + j); - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + state2[j]; - - round_lyra(state); - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s4 + j*threads*blockDim.x) = state1[j] ^ state[j]; - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - state2[0] ^= Data2; - state2[1] ^= Data0; - state2[2] ^= Data1; - } else { - state2[0] ^= Data0; - state2[1] ^= Data1; - state2[2] ^= Data2; - } - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s0 + j*threads*blockDim.x) = state2[j]; - } - - // 4, 3, 5 - for (int i = 0; i < 8; i++) - { - const uint32_t s3 = ps3 + i * memshift* threads*blockDim.x; - const uint32_t s4 = ps4 + i * memshift* threads*blockDim.x; - const uint32_t s5 = ps5 + (7 - i)*memshift* threads*blockDim.x; - #pragma unroll - for (int j = 0; j < 3; j++) - state1[j] = *(DMatrix + s4 + j*threads*blockDim.x); - #pragma unroll - for (int j = 0; j < 3; j++) - state2[j] = *(DMatrix + s3 + j*threads*blockDim.x); - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + state2[j]; - - round_lyra(state); - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s5 + j*threads*blockDim.x) = state1[j] ^ state[j]; - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - state2[0] ^= Data2; - state2[1] ^= Data0; - state2[2] ^= Data1; - } - else - { - state2[0] ^= Data0; - state2[1] ^= Data1; - state2[2] ^= Data2; - } - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s3 + j*threads*blockDim.x) = state2[j]; - } - - // 5, 2, 6 - for (int i = 0; i < 8; i++) - { - const uint32_t s2 = ps2 + i * memshift* threads*blockDim.x; - const uint32_t s5 = ps5 + i * memshift* threads*blockDim.x; - const uint32_t s6 = ps6 + (7 - i)*memshift* threads*blockDim.x; - #pragma unroll - for (int j = 0; j < 3; j++) - state1[j] = *(DMatrix + s5 + j*threads*blockDim.x); - #pragma unroll - for (int j = 0; j < 3; j++) - state2[j] = *(DMatrix + s2 + j*threads*blockDim.x); - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + state2[j]; - - round_lyra(state); - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s6 + j*threads*blockDim.x) = state1[j] ^ state[j]; - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - state2[0] ^= Data2; - state2[1] ^= Data0; - state2[2] ^= Data1; - } - else - { - state2[0] ^= Data0; - state2[1] ^= Data1; - state2[2] ^= Data2; - } - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s2 + j*threads*blockDim.x) = state2[j]; - } - - // 6, 1, 7 - for (int i = 0; i < 8; i++) - { - const uint32_t s1 = ps1 + i * memshift* threads*blockDim.x; - const uint32_t s6 = ps6 + i * memshift* threads*blockDim.x; - const uint32_t s7 = ps7 + (7 - i)*memshift* threads*blockDim.x; - #pragma unroll - for (int j = 0; j < 3; j++) - state1[j] = *(DMatrix + s6 + j*threads*blockDim.x); - #pragma unroll - for (int j = 0; j < 3; j++) - state2[j] = *(DMatrix + s1 + j*threads*blockDim.x); - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + state2[j]; - - round_lyra(state); - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s7 + j*threads*blockDim.x) = state1[j] ^ state[j]; - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - state2[0] ^= Data2; - state2[1] ^= Data0; - state2[2] ^= Data1; - } else { - state2[0] ^= Data0; - state2[1] ^= Data1; - state2[2] ^= Data2; - } - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s1 + j*threads*blockDim.x) = state2[j]; - } -} - -static __device__ __forceinline__ -void reduceDuplexRowV50(const int rowIn, const int rowInOut, const int rowOut, uint2 state[4], const uint32_t thread, const uint32_t threads) -{ - const uint32_t ps1 = (memshift * Ncol * rowIn*threads + thread)*blockDim.x + threadIdx.x; - const uint32_t ps2 = (memshift * Ncol * rowInOut *threads + thread)*blockDim.x + threadIdx.x; - const uint32_t ps3 = (memshift * Ncol * rowOut*threads + thread)*blockDim.x + threadIdx.x; - - #pragma unroll 1 - for (int i = 0; i < 8; i++) - { - uint2 state1[3], state2[3]; - - const uint32_t s1 = ps1 + i*memshift*threads *blockDim.x; - const uint32_t s2 = ps2 + i*memshift*threads *blockDim.x; - const uint32_t s3 = ps3 + i*memshift*threads *blockDim.x; - - #pragma unroll - for (int j = 0; j < 3; j++) { - state1[j] = *(DMatrix + s1 + j*threads*blockDim.x); - state2[j] = *(DMatrix + s2 + j*threads*blockDim.x); - } - - #pragma unroll - for (int j = 0; j < 3; j++) { - state1[j] += state2[j]; - state[j] ^= state1[j]; - } - - round_lyra(state); - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - state2[0] ^= Data2; - state2[1] ^= Data0; - state2[2] ^= Data1; - } else { - state2[0] ^= Data0; - state2[1] ^= Data1; - state2[2] ^= Data2; - } - - #pragma unroll - for (int j = 0; j < 3; j++) - { - *(DMatrix + s2 + j*threads*blockDim.x) = state2[j]; - *(DMatrix + s3 + j*threads*blockDim.x) ^= state[j]; - } - } -} - -static __device__ __forceinline__ -void reduceDuplexRowV50_8(const int rowInOut, uint2 state[4], const uint32_t thread, const uint32_t threads) -{ - const uint32_t ps1 = (memshift * Ncol * 2*threads + thread)*blockDim.x + threadIdx.x; - const uint32_t ps2 = (memshift * Ncol * rowInOut *threads + thread)*blockDim.x + threadIdx.x; - // const uint32_t ps3 = (memshift * Ncol * 5*threads + thread)*blockDim.x + threadIdx.x; - - uint2 state1[3], last[3]; - - #pragma unroll - for (int j = 0; j < 3; j++) { - state1[j] = *(DMatrix + ps1 + j*threads*blockDim.x); - last[j] = *(DMatrix + ps2 + j*threads*blockDim.x); - } - - #pragma unroll - for (int j = 0; j < 3; j++) { - state1[j] += last[j]; - state[j] ^= state1[j]; - } - - round_lyra(state); - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - last[0] ^= Data2; - last[1] ^= Data0; - last[2] ^= Data1; - } else { - last[0] ^= Data0; - last[1] ^= Data1; - last[2] ^= Data2; - } - - if (rowInOut == 5) - { - #pragma unroll - for (int j = 0; j < 3; j++) - last[j] ^= state[j]; - } - - for (int i = 1; i < 8; i++) - { - const uint32_t s1 = ps1 + i*memshift*threads *blockDim.x; - const uint32_t s2 = ps2 + i*memshift*threads *blockDim.x; - - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= *(DMatrix + s1 + j*threads*blockDim.x) + *(DMatrix + s2 + j*threads*blockDim.x); - - round_lyra(state); - } - - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= last[j]; -} - -static __device__ __forceinline__ -void reduceDuplexRowV50_8_v2(const int rowIn, const int rowOut,const int rowInOut, uint2 state[4], const uint32_t thread, const uint32_t threads) -{ - const uint32_t ps1 = (memshift * Ncol * rowIn * threads + thread)*blockDim.x + threadIdx.x; - const uint32_t ps2 = (memshift * Ncol * rowInOut *threads + thread)*blockDim.x + threadIdx.x; - // const uint32_t ps3 = (memshift * Ncol * 5*threads + thread)*blockDim.x + threadIdx.x; - - uint2 state1[3], last[3]; - - #pragma unroll - for (int j = 0; j < 3; j++) { - state1[j] = *(DMatrix + ps1 + j*threads*blockDim.x); - last[j] = *(DMatrix + ps2 + j*threads*blockDim.x); - } - - #pragma unroll - for (int j = 0; j < 3; j++) { - state1[j] += last[j]; - state[j] ^= state1[j]; - } - - round_lyra(state); - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - last[0] ^= Data2; - last[1] ^= Data0; - last[2] ^= Data1; - } - else { - last[0] ^= Data0; - last[1] ^= Data1; - last[2] ^= Data2; - } - - if (rowInOut == rowOut) - { -#pragma unroll - for (int j = 0; j < 3; j++) - last[j] ^= state[j]; - } - - for (int i = 1; i < 8; i++) - { - const uint32_t s1 = ps1 + i*memshift*threads *blockDim.x; - const uint32_t s2 = ps2 + i*memshift*threads *blockDim.x; - -#pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= *(DMatrix + s1 + j*threads*blockDim.x) + *(DMatrix + s2 + j*threads*blockDim.x); - - round_lyra(state); - } - - -#pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= last[j]; - -} - - -__global__ __launch_bounds__(64, 1) -void lyra2Z_gpu_hash_32_1_sm5(uint32_t threads, uint32_t startNounce, uint2 *g_hash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - - const uint2x4 blake2b_IV[2] = { - { { 0xf3bcc908, 0x6a09e667 }, { 0x84caa73b, 0xbb67ae85 }, { 0xfe94f82b, 0x3c6ef372 }, { 0x5f1d36f1, 0xa54ff53a } }, - { { 0xade682d1, 0x510e527f }, { 0x2b3e6c1f, 0x9b05688c }, { 0xfb41bd6b, 0x1f83d9ab }, { 0x137e2179, 0x5be0cd19 } } - }; - const uint2x4 Mask[2] = { - 0x00000020UL, 0x00000000UL, 0x00000020UL, 0x00000000UL, - 0x00000020UL, 0x00000000UL, 0x00000008UL, 0x00000000UL, - 0x00000008UL, 0x00000000UL, 0x00000008UL, 0x00000000UL, - 0x00000080UL, 0x00000000UL, 0x00000000UL, 0x01000000UL - }; - if (thread < threads) - { - uint2x4 state[4]; - - ((uint2*)state)[0] = __ldg(&g_hash[thread]); - ((uint2*)state)[1] = __ldg(&g_hash[thread + threads]); - ((uint2*)state)[2] = __ldg(&g_hash[thread + threads * 2]); - ((uint2*)state)[3] = __ldg(&g_hash[thread + threads * 3]); - - state[1] = state[0]; - state[2] = blake2b_IV[0]; - state[3] = blake2b_IV[1]; - - for (int i = 0; i < 12; i++) - round_lyra(state); //because 12 is not enough - - state[0] ^= Mask[0]; - state[1] ^= Mask[1]; - - for (int i = 0; i < 12; i++) - round_lyra(state); //because 12 is not enough - - - ((uint2x4*)DMatrix)[0 * threads + thread] = state[0]; - ((uint2x4*)DMatrix)[1 * threads + thread] = state[1]; - ((uint2x4*)DMatrix)[2 * threads + thread] = state[2]; - ((uint2x4*)DMatrix)[3 * threads + thread] = state[3]; - } -} - -__global__ __launch_bounds__(TPB50, 1) -void lyra2Z_gpu_hash_32_2_sm5(uint32_t threads, uint32_t startNounce, uint2 *g_hash) -{ - const uint32_t thread = (blockDim.y * blockIdx.x + threadIdx.y); - - if (thread < threads) - { - uint2 state[4]; - - state[0] = __ldg(&DMatrix[(0 * threads + thread)*blockDim.x + threadIdx.x]); - state[1] = __ldg(&DMatrix[(1 * threads + thread)*blockDim.x + threadIdx.x]); - state[2] = __ldg(&DMatrix[(2 * threads + thread)*blockDim.x + threadIdx.x]); - state[3] = __ldg(&DMatrix[(3 * threads + thread)*blockDim.x + threadIdx.x]); - - reduceDuplexV5(state, thread, threads); - - uint32_t rowa; // = WarpShuffle(state[0].x, 0, 4) & 7; - uint32_t prev = 7; - uint32_t iterator = 0; - for (uint32_t i = 0; i<8; i++) { - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowV50(prev, rowa, iterator, state, thread, threads); - prev = iterator; - iterator = (iterator + 3) & 7; - } - for (uint32_t i = 0; i<8; i++) { - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowV50(prev, rowa, iterator, state, thread, threads); - prev = iterator; - iterator = (iterator - 1) & 7; - } - for (uint32_t i = 0; i<8; i++) { - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowV50(prev, rowa, iterator, state, thread, threads); - prev = iterator; - iterator = (iterator + 3) & 7; - } - for (uint32_t i = 0; i<8; i++) { - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowV50(prev, rowa, iterator, state, thread, threads); - prev = iterator; - iterator = (iterator - 1) & 7; - } - for (uint32_t i = 0; i<8; i++) { - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowV50(prev, rowa, iterator, state, thread, threads); - prev = iterator; - iterator = (iterator + 3) & 7; - } - for (uint32_t i = 0; i<8; i++) { - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowV50(prev, rowa, iterator, state, thread, threads); - prev = iterator; - iterator = (iterator - 1) & 7; - } - for (uint32_t i = 0; i<8; i++) { - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowV50(prev, rowa, iterator, state, thread, threads); - prev = iterator; - iterator = (iterator + 3) & 7; - } - for (uint32_t i = 0; i<7; i++) { - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowV50(prev, rowa, iterator, state, thread, threads); - prev = iterator; - iterator = (iterator - 1) & 7; - } - - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowV50_8_v2(prev,iterator,rowa, state, thread, threads); - - DMatrix[(0 * threads + thread)*blockDim.x + threadIdx.x] = state[0]; - DMatrix[(1 * threads + thread)*blockDim.x + threadIdx.x] = state[1]; - DMatrix[(2 * threads + thread)*blockDim.x + threadIdx.x] = state[2]; - DMatrix[(3 * threads + thread)*blockDim.x + threadIdx.x] = state[3]; - } -} - -__global__ __launch_bounds__(64, 1) -void lyra2Z_gpu_hash_32_3_sm5(uint32_t threads, uint32_t startNounce, uint2 *g_hash, uint32_t *resNonces) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - - if (thread < threads) - { - uint2x4 state[4]; - - state[0] = __ldg4(&((uint2x4*)DMatrix)[0 * threads + thread]); - state[1] = __ldg4(&((uint2x4*)DMatrix)[1 * threads + thread]); - state[2] = __ldg4(&((uint2x4*)DMatrix)[2 * threads + thread]); - state[3] = __ldg4(&((uint2x4*)DMatrix)[3 * threads + thread]); - - for (int i = 0; i < 12; i++) - round_lyra(state); - - uint32_t nonce = startNounce + thread; - if (((uint64_t*)state)[3] <= ((uint64_t*)pTarget)[3]) { - atomicMin(&resNonces[1], resNonces[0]); - atomicMin(&resNonces[0], nonce); - } - } -} - -#else -/* if __CUDA_ARCH__ != 500 .. host */ -__global__ void lyra2Z_gpu_hash_32_1_sm5(uint32_t threads, uint32_t startNounce, uint2 *g_hash) {} -__global__ void lyra2Z_gpu_hash_32_2_sm5(uint32_t threads, uint32_t startNounce, uint2 *g_hash) {} -__global__ void lyra2Z_gpu_hash_32_3_sm5(uint32_t threads, uint32_t startNounce, uint2 *g_hash, uint32_t *resNonces) {} -#endif diff --git a/lyra2/cuda_lyra2_sm2.cuh b/lyra2/cuda_lyra2_sm2.cuh deleted file mode 100644 index 18263b28..00000000 --- a/lyra2/cuda_lyra2_sm2.cuh +++ /dev/null @@ -1,228 +0,0 @@ -#include - -#ifdef __INTELLISENSE__ -/* just for vstudio code colors, only uncomment that temporary, dont commit it */ -//#undef __CUDA_ARCH__ -//#define __CUDA_ARCH__ 500 -#endif - -#include "cuda_helper.h" - -#define TPB30 160 -#define TPB20 160 - -#if (__CUDA_ARCH__ >= 200 && __CUDA_ARCH__ <= 350) || !defined(__CUDA_ARCH__) -__constant__ static uint2 blake2b_IV_sm2[8] = { - { 0xf3bcc908, 0x6a09e667 }, - { 0x84caa73b, 0xbb67ae85 }, - { 0xfe94f82b, 0x3c6ef372 }, - { 0x5f1d36f1, 0xa54ff53a }, - { 0xade682d1, 0x510e527f }, - { 0x2b3e6c1f, 0x9b05688c }, - { 0xfb41bd6b, 0x1f83d9ab }, - { 0x137e2179, 0x5be0cd19 } -}; -#endif - -#if __CUDA_ARCH__ >= 200 && __CUDA_ARCH__ <= 350 - -#define reduceDuplexRow(rowIn, rowInOut, rowOut) { \ - for (int i = 0; i < 8; i++) { \ - for (int j = 0; j < 12; j++) \ - state[j] ^= Matrix[12 * i + j][rowIn] + Matrix[12 * i + j][rowInOut]; \ - round_lyra(state); \ - for (int j = 0; j < 12; j++) \ - Matrix[j + 12 * i][rowOut] ^= state[j]; \ - Matrix[0 + 12 * i][rowInOut] ^= state[11]; \ - Matrix[1 + 12 * i][rowInOut] ^= state[0]; \ - Matrix[2 + 12 * i][rowInOut] ^= state[1]; \ - Matrix[3 + 12 * i][rowInOut] ^= state[2]; \ - Matrix[4 + 12 * i][rowInOut] ^= state[3]; \ - Matrix[5 + 12 * i][rowInOut] ^= state[4]; \ - Matrix[6 + 12 * i][rowInOut] ^= state[5]; \ - Matrix[7 + 12 * i][rowInOut] ^= state[6]; \ - Matrix[8 + 12 * i][rowInOut] ^= state[7]; \ - Matrix[9 + 12 * i][rowInOut] ^= state[8]; \ - Matrix[10+ 12 * i][rowInOut] ^= state[9]; \ - Matrix[11+ 12 * i][rowInOut] ^= state[10]; \ - } \ - } - -#define absorbblock(in) { \ - state[0] ^= Matrix[0][in]; \ - state[1] ^= Matrix[1][in]; \ - state[2] ^= Matrix[2][in]; \ - state[3] ^= Matrix[3][in]; \ - state[4] ^= Matrix[4][in]; \ - state[5] ^= Matrix[5][in]; \ - state[6] ^= Matrix[6][in]; \ - state[7] ^= Matrix[7][in]; \ - state[8] ^= Matrix[8][in]; \ - state[9] ^= Matrix[9][in]; \ - state[10] ^= Matrix[10][in]; \ - state[11] ^= Matrix[11][in]; \ - round_lyra(state); \ - round_lyra(state); \ - round_lyra(state); \ - round_lyra(state); \ - round_lyra(state); \ - round_lyra(state); \ - round_lyra(state); \ - round_lyra(state); \ - round_lyra(state); \ - round_lyra(state); \ - round_lyra(state); \ - round_lyra(state); \ - } - -static __device__ __forceinline__ -void Gfunc(uint2 & a, uint2 &b, uint2 &c, uint2 &d) -{ - a += b; d ^= a; d = SWAPUINT2(d); - c += d; b ^= c; b = ROR2(b, 24); - a += b; d ^= a; d = ROR2(d, 16); - c += d; b ^= c; b = ROR2(b, 63); -} - -__device__ __forceinline__ -static void round_lyra(uint2 *s) -{ - Gfunc(s[0], s[4], s[8], s[12]); - Gfunc(s[1], s[5], s[9], s[13]); - Gfunc(s[2], s[6], s[10], s[14]); - Gfunc(s[3], s[7], s[11], s[15]); - Gfunc(s[0], s[5], s[10], s[15]); - Gfunc(s[1], s[6], s[11], s[12]); - Gfunc(s[2], s[7], s[8], s[13]); - Gfunc(s[3], s[4], s[9], s[14]); -} - -__device__ __forceinline__ -void reduceDuplexRowSetup(const int rowIn, const int rowInOut, const int rowOut, uint2 state[16], uint2 Matrix[96][8]) -{ -#if __CUDA_ARCH__ > 500 - #pragma unroll -#endif - for (int i = 0; i < 8; i++) - { - #pragma unroll - for (int j = 0; j < 12; j++) - state[j] ^= Matrix[12 * i + j][rowIn] + Matrix[12 * i + j][rowInOut]; - - round_lyra(state); - - #pragma unroll - for (int j = 0; j < 12; j++) - Matrix[j + 84 - 12 * i][rowOut] = Matrix[12 * i + j][rowIn] ^ state[j]; - - Matrix[0 + 12 * i][rowInOut] ^= state[11]; - Matrix[1 + 12 * i][rowInOut] ^= state[0]; - Matrix[2 + 12 * i][rowInOut] ^= state[1]; - Matrix[3 + 12 * i][rowInOut] ^= state[2]; - Matrix[4 + 12 * i][rowInOut] ^= state[3]; - Matrix[5 + 12 * i][rowInOut] ^= state[4]; - Matrix[6 + 12 * i][rowInOut] ^= state[5]; - Matrix[7 + 12 * i][rowInOut] ^= state[6]; - Matrix[8 + 12 * i][rowInOut] ^= state[7]; - Matrix[9 + 12 * i][rowInOut] ^= state[8]; - Matrix[10 + 12 * i][rowInOut] ^= state[9]; - Matrix[11 + 12 * i][rowInOut] ^= state[10]; - } -} - -__global__ __launch_bounds__(TPB30, 1) -void lyra2_gpu_hash_32_sm2(uint32_t threads, uint32_t startNounce, uint64_t *g_hash) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint2 state[16]; - - #pragma unroll - for (int i = 0; i<4; i++) { - LOHI(state[i].x, state[i].y, g_hash[threads*i + thread]); - } //password - - #pragma unroll - for (int i = 0; i<4; i++) { - state[i + 4] = state[i]; - } //salt - - #pragma unroll - for (int i = 0; i<8; i++) { - state[i + 8] = blake2b_IV_sm2[i]; - } - - // blake2blyra x2 - //#pragma unroll 24 - for (int i = 0; i<24; i++) { - round_lyra(state); - } //because 12 is not enough - - uint2 Matrix[96][8]; // not cool - - // reducedSqueezeRow0 - #pragma unroll 8 - for (int i = 0; i < 8; i++) - { - #pragma unroll 12 - for (int j = 0; j<12; j++) { - Matrix[j + 84 - 12 * i][0] = state[j]; - } - round_lyra(state); - } - - // reducedSqueezeRow1 - #pragma unroll 8 - for (int i = 0; i < 8; i++) - { - #pragma unroll 12 - for (int j = 0; j<12; j++) { - state[j] ^= Matrix[j + 12 * i][0]; - } - round_lyra(state); - #pragma unroll 12 - for (int j = 0; j<12; j++) { - Matrix[j + 84 - 12 * i][1] = Matrix[j + 12 * i][0] ^ state[j]; - } - } - - reduceDuplexRowSetup(1, 0, 2, state, Matrix); - reduceDuplexRowSetup(2, 1, 3, state, Matrix); - reduceDuplexRowSetup(3, 0, 4, state, Matrix); - reduceDuplexRowSetup(4, 3, 5, state, Matrix); - reduceDuplexRowSetup(5, 2, 6, state, Matrix); - reduceDuplexRowSetup(6, 1, 7, state, Matrix); - - uint32_t rowa; - rowa = state[0].x & 7; - reduceDuplexRow(7, rowa, 0); - rowa = state[0].x & 7; - reduceDuplexRow(0, rowa, 3); - rowa = state[0].x & 7; - reduceDuplexRow(3, rowa, 6); - rowa = state[0].x & 7; - reduceDuplexRow(6, rowa, 1); - rowa = state[0].x & 7; - reduceDuplexRow(1, rowa, 4); - rowa = state[0].x & 7; - reduceDuplexRow(4, rowa, 7); - rowa = state[0].x & 7; - reduceDuplexRow(7, rowa, 2); - rowa = state[0].x & 7; - reduceDuplexRow(2, rowa, 5); - - absorbblock(rowa); - - #pragma unroll - for (int i = 0; i<4; i++) { - g_hash[threads*i + thread] = devectorize(state[i]); - } - - } //thread -} - -#else -/* if __CUDA_ARCH__ < 200 .. host */ -__global__ void lyra2_gpu_hash_32_sm2(uint32_t threads, uint32_t startNounce, uint64_t *g_hash) {} -#endif diff --git a/lyra2/cuda_lyra2_sm5.cuh b/lyra2/cuda_lyra2_sm5.cuh deleted file mode 100644 index fc13172c..00000000 --- a/lyra2/cuda_lyra2_sm5.cuh +++ /dev/null @@ -1,693 +0,0 @@ -#include - -#ifdef __INTELLISENSE__ -/* just for vstudio code colors */ -#undef __CUDA_ARCH__ -#define __CUDA_ARCH__ 500 -#endif - -#include "cuda_helper.h" - -#define TPB50 32 - -#if __CUDA_ARCH__ == 500 -#include "cuda_lyra2_vectors.h" - -#define Nrow 8 -#define Ncol 8 -#define memshift 3 - -__device__ uint2 *DMatrix; - -__device__ __forceinline__ uint2 LD4S(const int index) -{ - extern __shared__ uint2 shared_mem[]; - - return shared_mem[(index * blockDim.y + threadIdx.y) * blockDim.x + threadIdx.x]; -} - -__device__ __forceinline__ void ST4S(const int index, const uint2 data) -{ - extern __shared__ uint2 shared_mem[]; - - shared_mem[(index * blockDim.y + threadIdx.y) * blockDim.x + threadIdx.x] = data; -} - -#if __CUDA_ARCH__ == 300 -__device__ __forceinline__ uint32_t WarpShuffle(uint32_t a, uint32_t b, uint32_t c) -{ - return __shfl(a, b, c); -} - -__device__ __forceinline__ uint2 WarpShuffle(uint2 a, uint32_t b, uint32_t c) -{ - return make_uint2(__shfl(a.x, b, c), __shfl(a.y, b, c)); -} - -__device__ __forceinline__ void WarpShuffle3(uint2 &a1, uint2 &a2, uint2 &a3, uint32_t b1, uint32_t b2, uint32_t b3, uint32_t c) -{ - a1 = WarpShuffle(a1, b1, c); - a2 = WarpShuffle(a2, b2, c); - a3 = WarpShuffle(a3, b3, c); -} - -#else -__device__ __forceinline__ uint32_t WarpShuffle(uint32_t a, uint32_t b, uint32_t c) -{ - extern __shared__ uint2 shared_mem[]; - - const uint32_t thread = blockDim.x * threadIdx.y + threadIdx.x; - uint32_t *_ptr = (uint32_t*)shared_mem; - - __threadfence_block(); - uint32_t buf = _ptr[thread]; - - _ptr[thread] = a; - __threadfence_block(); - uint32_t result = _ptr[(thread&~(c - 1)) + (b&(c - 1))]; - - __threadfence_block(); - _ptr[thread] = buf; - - __threadfence_block(); - return result; -} - -__device__ __forceinline__ uint2 WarpShuffle(uint2 a, uint32_t b, uint32_t c) -{ - extern __shared__ uint2 shared_mem[]; - - const uint32_t thread = blockDim.x * threadIdx.y + threadIdx.x; - - __threadfence_block(); - uint2 buf = shared_mem[thread]; - - shared_mem[thread] = a; - __threadfence_block(); - uint2 result = shared_mem[(thread&~(c - 1)) + (b&(c - 1))]; - - __threadfence_block(); - shared_mem[thread] = buf; - - __threadfence_block(); - return result; -} - -__device__ __forceinline__ void WarpShuffle3(uint2 &a1, uint2 &a2, uint2 &a3, uint32_t b1, uint32_t b2, uint32_t b3, uint32_t c) -{ - extern __shared__ uint2 shared_mem[]; - - const uint32_t thread = blockDim.x * threadIdx.y + threadIdx.x; - - __threadfence_block(); - uint2 buf = shared_mem[thread]; - - shared_mem[thread] = a1; - __threadfence_block(); - a1 = shared_mem[(thread&~(c - 1)) + (b1&(c - 1))]; - __threadfence_block(); - shared_mem[thread] = a2; - __threadfence_block(); - a2 = shared_mem[(thread&~(c - 1)) + (b2&(c - 1))]; - __threadfence_block(); - shared_mem[thread] = a3; - __threadfence_block(); - a3 = shared_mem[(thread&~(c - 1)) + (b3&(c - 1))]; - - __threadfence_block(); - shared_mem[thread] = buf; - __threadfence_block(); -} - -#endif - -#if __CUDA_ARCH__ >= 300 -static __device__ __forceinline__ -void Gfunc(uint2 &a, uint2 &b, uint2 &c, uint2 &d) -{ - a += b; d ^= a; d = SWAPUINT2(d); - c += d; b ^= c; b = ROR24(b); //ROR2(b, 24); - a += b; d ^= a; d = ROR16(d); - c += d; b ^= c; b = ROR2(b, 63); -} -#endif - -__device__ __forceinline__ void round_lyra(uint2 s[4]) -{ - Gfunc(s[0], s[1], s[2], s[3]); - WarpShuffle3(s[1], s[2], s[3], threadIdx.x + 1, threadIdx.x + 2, threadIdx.x + 3, 4); - Gfunc(s[0], s[1], s[2], s[3]); - WarpShuffle3(s[1], s[2], s[3], threadIdx.x + 3, threadIdx.x + 2, threadIdx.x + 1, 4); -} - -static __device__ __forceinline__ -void round_lyra(uint2x4* s) -{ - Gfunc(s[0].x, s[1].x, s[2].x, s[3].x); - Gfunc(s[0].y, s[1].y, s[2].y, s[3].y); - Gfunc(s[0].z, s[1].z, s[2].z, s[3].z); - Gfunc(s[0].w, s[1].w, s[2].w, s[3].w); - Gfunc(s[0].x, s[1].y, s[2].z, s[3].w); - Gfunc(s[0].y, s[1].z, s[2].w, s[3].x); - Gfunc(s[0].z, s[1].w, s[2].x, s[3].y); - Gfunc(s[0].w, s[1].x, s[2].y, s[3].z); -} - -static __device__ __forceinline__ -void reduceDuplexV5(uint2 state[4], const uint32_t thread, const uint32_t threads) -{ - uint2 state1[3], state2[3]; - - const uint32_t ps0 = (memshift * Ncol * 0 * threads + thread)*blockDim.x + threadIdx.x; - const uint32_t ps1 = (memshift * Ncol * 1 * threads + thread)*blockDim.x + threadIdx.x; - const uint32_t ps2 = (memshift * Ncol * 2 * threads + thread)*blockDim.x + threadIdx.x; - const uint32_t ps3 = (memshift * Ncol * 3 * threads + thread)*blockDim.x + threadIdx.x; - const uint32_t ps4 = (memshift * Ncol * 4 * threads + thread)*blockDim.x + threadIdx.x; - const uint32_t ps5 = (memshift * Ncol * 5 * threads + thread)*blockDim.x + threadIdx.x; - const uint32_t ps6 = (memshift * Ncol * 6 * threads + thread)*blockDim.x + threadIdx.x; - const uint32_t ps7 = (memshift * Ncol * 7 * threads + thread)*blockDim.x + threadIdx.x; - - for (int i = 0; i < 8; i++) - { - const uint32_t s0 = memshift * Ncol * 0 + (Ncol - 1 - i) * memshift; - #pragma unroll - for (int j = 0; j < 3; j++) - ST4S(s0 + j, state[j]); - round_lyra(state); - } - - for (int i = 0; i < 8; i++) - { - const uint32_t s0 = memshift * Ncol * 0 + i * memshift; - const uint32_t s1 = ps1 + (7 - i)*memshift* threads*blockDim.x; - #pragma unroll - for (int j = 0; j < 3; j++) - state1[j] = LD4S(s0 + j); - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j]; - - round_lyra(state); - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s1 + j*threads*blockDim.x) = state1[j] ^ state[j]; - } - - // 1, 0, 2 - for (int i = 0; i < 8; i++) - { - const uint32_t s0 = memshift * Ncol * 0 + i * memshift; - const uint32_t s1 = ps1 + i * memshift* threads*blockDim.x; - const uint32_t s2 = ps2 + (7 - i)*memshift* threads*blockDim.x; - #pragma unroll - for (int j = 0; j < 3; j++) - state1[j] = *(DMatrix + s1 + j*threads*blockDim.x); - #pragma unroll - for (int j = 0; j < 3; j++) - state2[j] = LD4S(s0 + j); - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + state2[j]; - - round_lyra(state); - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s2 + j*threads*blockDim.x) = state1[j] ^ state[j]; - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - state2[0] ^= Data2; - state2[1] ^= Data0; - state2[2] ^= Data1; - } - else - { - state2[0] ^= Data0; - state2[1] ^= Data1; - state2[2] ^= Data2; - } - - #pragma unroll - for (int j = 0; j < 3; j++) - ST4S(s0 + j, state2[j]); - } - - // 2, 1, 3 - for (int i = 0; i < 8; i++) - { - const uint32_t s1 = ps1 + i * memshift* threads*blockDim.x; - const uint32_t s2 = ps2 + i * memshift* threads*blockDim.x; - const uint32_t s3 = ps3 + (7 - i)*memshift* threads*blockDim.x; - #pragma unroll - for (int j = 0; j < 3; j++) - state1[j] = *(DMatrix + s2 + j*threads*blockDim.x); - #pragma unroll - for (int j = 0; j < 3; j++) - state2[j] = *(DMatrix + s1 + j*threads*blockDim.x); - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + state2[j]; - - round_lyra(state); - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s3 + j*threads*blockDim.x) = state1[j] ^ state[j]; - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - state2[0] ^= Data2; - state2[1] ^= Data0; - state2[2] ^= Data1; - } else { - state2[0] ^= Data0; - state2[1] ^= Data1; - state2[2] ^= Data2; - } - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s1 + j*threads*blockDim.x) = state2[j]; - } - - // 3, 0, 4 - for (int i = 0; i < 8; i++) - { - const uint32_t ls0 = memshift * Ncol * 0 + i * memshift; - const uint32_t s0 = ps0 + i * memshift* threads*blockDim.x; - const uint32_t s3 = ps3 + i * memshift* threads*blockDim.x; - const uint32_t s4 = ps4 + (7 - i)*memshift* threads*blockDim.x; - #pragma unroll - for (int j = 0; j < 3; j++) - state1[j] = *(DMatrix + s3 + j*threads*blockDim.x); - #pragma unroll - for (int j = 0; j < 3; j++) - state2[j] = LD4S(ls0 + j); - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + state2[j]; - - round_lyra(state); - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s4 + j*threads*blockDim.x) = state1[j] ^ state[j]; - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - state2[0] ^= Data2; - state2[1] ^= Data0; - state2[2] ^= Data1; - } else { - state2[0] ^= Data0; - state2[1] ^= Data1; - state2[2] ^= Data2; - } - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s0 + j*threads*blockDim.x) = state2[j]; - } - - // 4, 3, 5 - for (int i = 0; i < 8; i++) - { - const uint32_t s3 = ps3 + i * memshift* threads*blockDim.x; - const uint32_t s4 = ps4 + i * memshift* threads*blockDim.x; - const uint32_t s5 = ps5 + (7 - i)*memshift* threads*blockDim.x; - #pragma unroll - for (int j = 0; j < 3; j++) - state1[j] = *(DMatrix + s4 + j*threads*blockDim.x); - #pragma unroll - for (int j = 0; j < 3; j++) - state2[j] = *(DMatrix + s3 + j*threads*blockDim.x); - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + state2[j]; - - round_lyra(state); - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s5 + j*threads*blockDim.x) = state1[j] ^ state[j]; - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - state2[0] ^= Data2; - state2[1] ^= Data0; - state2[2] ^= Data1; - } - else - { - state2[0] ^= Data0; - state2[1] ^= Data1; - state2[2] ^= Data2; - } - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s3 + j*threads*blockDim.x) = state2[j]; - } - - // 5, 2, 6 - for (int i = 0; i < 8; i++) - { - const uint32_t s2 = ps2 + i * memshift* threads*blockDim.x; - const uint32_t s5 = ps5 + i * memshift* threads*blockDim.x; - const uint32_t s6 = ps6 + (7 - i)*memshift* threads*blockDim.x; - #pragma unroll - for (int j = 0; j < 3; j++) - state1[j] = *(DMatrix + s5 + j*threads*blockDim.x); - #pragma unroll - for (int j = 0; j < 3; j++) - state2[j] = *(DMatrix + s2 + j*threads*blockDim.x); - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + state2[j]; - - round_lyra(state); - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s6 + j*threads*blockDim.x) = state1[j] ^ state[j]; - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - state2[0] ^= Data2; - state2[1] ^= Data0; - state2[2] ^= Data1; - } - else - { - state2[0] ^= Data0; - state2[1] ^= Data1; - state2[2] ^= Data2; - } - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s2 + j*threads*blockDim.x) = state2[j]; - } - - // 6, 1, 7 - for (int i = 0; i < 8; i++) - { - const uint32_t s1 = ps1 + i * memshift* threads*blockDim.x; - const uint32_t s6 = ps6 + i * memshift* threads*blockDim.x; - const uint32_t s7 = ps7 + (7 - i)*memshift* threads*blockDim.x; - #pragma unroll - for (int j = 0; j < 3; j++) - state1[j] = *(DMatrix + s6 + j*threads*blockDim.x); - #pragma unroll - for (int j = 0; j < 3; j++) - state2[j] = *(DMatrix + s1 + j*threads*blockDim.x); - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + state2[j]; - - round_lyra(state); - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s7 + j*threads*blockDim.x) = state1[j] ^ state[j]; - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - state2[0] ^= Data2; - state2[1] ^= Data0; - state2[2] ^= Data1; - } else { - state2[0] ^= Data0; - state2[1] ^= Data1; - state2[2] ^= Data2; - } - - #pragma unroll - for (int j = 0; j < 3; j++) - *(DMatrix + s1 + j*threads*blockDim.x) = state2[j]; - } -} - -static __device__ __forceinline__ -void reduceDuplexRowV50(const int rowIn, const int rowInOut, const int rowOut, uint2 state[4], const uint32_t thread, const uint32_t threads) -{ - const uint32_t ps1 = (memshift * Ncol * rowIn*threads + thread)*blockDim.x + threadIdx.x; - const uint32_t ps2 = (memshift * Ncol * rowInOut *threads + thread)*blockDim.x + threadIdx.x; - const uint32_t ps3 = (memshift * Ncol * rowOut*threads + thread)*blockDim.x + threadIdx.x; - - #pragma unroll 1 - for (int i = 0; i < 8; i++) - { - uint2 state1[3], state2[3]; - - const uint32_t s1 = ps1 + i*memshift*threads *blockDim.x; - const uint32_t s2 = ps2 + i*memshift*threads *blockDim.x; - const uint32_t s3 = ps3 + i*memshift*threads *blockDim.x; - - #pragma unroll - for (int j = 0; j < 3; j++) { - state1[j] = *(DMatrix + s1 + j*threads*blockDim.x); - state2[j] = *(DMatrix + s2 + j*threads*blockDim.x); - } - - #pragma unroll - for (int j = 0; j < 3; j++) { - state1[j] += state2[j]; - state[j] ^= state1[j]; - } - - round_lyra(state); - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - state2[0] ^= Data2; - state2[1] ^= Data0; - state2[2] ^= Data1; - } else { - state2[0] ^= Data0; - state2[1] ^= Data1; - state2[2] ^= Data2; - } - - #pragma unroll - for (int j = 0; j < 3; j++) - { - *(DMatrix + s2 + j*threads*blockDim.x) = state2[j]; - *(DMatrix + s3 + j*threads*blockDim.x) ^= state[j]; - } - } -} - -static __device__ __forceinline__ -void reduceDuplexRowV50_8(const int rowInOut, uint2 state[4], const uint32_t thread, const uint32_t threads) -{ - const uint32_t ps1 = (memshift * Ncol * 2*threads + thread)*blockDim.x + threadIdx.x; - const uint32_t ps2 = (memshift * Ncol * rowInOut *threads + thread)*blockDim.x + threadIdx.x; - // const uint32_t ps3 = (memshift * Ncol * 5*threads + thread)*blockDim.x + threadIdx.x; - - uint2 state1[3], last[3]; - - #pragma unroll - for (int j = 0; j < 3; j++) { - state1[j] = *(DMatrix + ps1 + j*threads*blockDim.x); - last[j] = *(DMatrix + ps2 + j*threads*blockDim.x); - } - - #pragma unroll - for (int j = 0; j < 3; j++) { - state1[j] += last[j]; - state[j] ^= state1[j]; - } - - round_lyra(state); - - // simultaneously receive data from preceding thread and send data to following thread - uint2 Data0 = state[0]; - uint2 Data1 = state[1]; - uint2 Data2 = state[2]; - WarpShuffle3(Data0, Data1, Data2, threadIdx.x - 1, threadIdx.x - 1, threadIdx.x - 1, 4); - - if (threadIdx.x == 0) - { - last[0] ^= Data2; - last[1] ^= Data0; - last[2] ^= Data1; - } else { - last[0] ^= Data0; - last[1] ^= Data1; - last[2] ^= Data2; - } - - if (rowInOut == 5) - { - #pragma unroll - for (int j = 0; j < 3; j++) - last[j] ^= state[j]; - } - - for (int i = 1; i < 8; i++) - { - const uint32_t s1 = ps1 + i*memshift*threads *blockDim.x; - const uint32_t s2 = ps2 + i*memshift*threads *blockDim.x; - - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= *(DMatrix + s1 + j*threads*blockDim.x) + *(DMatrix + s2 + j*threads*blockDim.x); - - round_lyra(state); - } - - -#pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= last[j]; - -} - -__global__ __launch_bounds__(64, 1) -void lyra2_gpu_hash_32_1_sm5(uint32_t threads, uint32_t startNounce, uint2 *g_hash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - - const uint2x4 blake2b_IV[2] = { - { { 0xf3bcc908, 0x6a09e667 }, { 0x84caa73b, 0xbb67ae85 }, { 0xfe94f82b, 0x3c6ef372 }, { 0x5f1d36f1, 0xa54ff53a } }, - { { 0xade682d1, 0x510e527f }, { 0x2b3e6c1f, 0x9b05688c }, { 0xfb41bd6b, 0x1f83d9ab }, { 0x137e2179, 0x5be0cd19 } } - }; - - if (thread < threads) - { - uint2x4 state[4]; - - ((uint2*)state)[0] = __ldg(&g_hash[thread]); - ((uint2*)state)[1] = __ldg(&g_hash[thread + threads]); - ((uint2*)state)[2] = __ldg(&g_hash[thread + threads * 2]); - ((uint2*)state)[3] = __ldg(&g_hash[thread + threads * 3]); - - state[1] = state[0]; - state[2] = blake2b_IV[0]; - state[3] = blake2b_IV[1]; - - for (int i = 0; i < 24; i++) - round_lyra(state); //because 12 is not enough - - ((uint2x4*)DMatrix)[0 * threads + thread] = state[0]; - ((uint2x4*)DMatrix)[1 * threads + thread] = state[1]; - ((uint2x4*)DMatrix)[2 * threads + thread] = state[2]; - ((uint2x4*)DMatrix)[3 * threads + thread] = state[3]; - } -} - -__global__ __launch_bounds__(TPB50, 1) -void lyra2_gpu_hash_32_2_sm5(uint32_t threads, uint32_t startNounce, uint2 *g_hash) -{ - const uint32_t thread = (blockDim.y * blockIdx.x + threadIdx.y); - - if (thread < threads) - { - uint2 state[4]; - - state[0] = __ldg(&DMatrix[(0 * threads + thread)*blockDim.x + threadIdx.x]); - state[1] = __ldg(&DMatrix[(1 * threads + thread)*blockDim.x + threadIdx.x]); - state[2] = __ldg(&DMatrix[(2 * threads + thread)*blockDim.x + threadIdx.x]); - state[3] = __ldg(&DMatrix[(3 * threads + thread)*blockDim.x + threadIdx.x]); - - reduceDuplexV5(state, thread, threads); - - uint32_t rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowV50(7, rowa, 0, state, thread, threads); - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowV50(0, rowa, 3, state, thread, threads); - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowV50(3, rowa, 6, state, thread, threads); - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowV50(6, rowa, 1, state, thread, threads); - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowV50(1, rowa, 4, state, thread, threads); - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowV50(4, rowa, 7, state, thread, threads); - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowV50(7, rowa, 2, state, thread, threads); - rowa = WarpShuffle(state[0].x, 0, 4) & 7; - reduceDuplexRowV50_8(rowa, state, thread, threads); - - DMatrix[(0 * threads + thread)*blockDim.x + threadIdx.x] = state[0]; - DMatrix[(1 * threads + thread)*blockDim.x + threadIdx.x] = state[1]; - DMatrix[(2 * threads + thread)*blockDim.x + threadIdx.x] = state[2]; - DMatrix[(3 * threads + thread)*blockDim.x + threadIdx.x] = state[3]; - } -} - -__global__ __launch_bounds__(64, 1) -void lyra2_gpu_hash_32_3_sm5(uint32_t threads, uint32_t startNounce, uint2 *g_hash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - - if (thread < threads) - { - uint2x4 state[4]; - - state[0] = __ldg4(&((uint2x4*)DMatrix)[0 * threads + thread]); - state[1] = __ldg4(&((uint2x4*)DMatrix)[1 * threads + thread]); - state[2] = __ldg4(&((uint2x4*)DMatrix)[2 * threads + thread]); - state[3] = __ldg4(&((uint2x4*)DMatrix)[3 * threads + thread]); - - for (int i = 0; i < 12; i++) - round_lyra(state); - - g_hash[thread] = ((uint2*)state)[0]; - g_hash[thread + threads] = ((uint2*)state)[1]; - g_hash[thread + threads * 2] = ((uint2*)state)[2]; - g_hash[thread + threads * 3] = ((uint2*)state)[3]; - } -} - -#else -/* if __CUDA_ARCH__ != 500 .. host */ -__global__ void lyra2_gpu_hash_32_1_sm5(uint32_t threads, uint32_t startNounce, uint2 *g_hash) {} -__global__ void lyra2_gpu_hash_32_2_sm5(uint32_t threads, uint32_t startNounce, uint2 *g_hash) {} -__global__ void lyra2_gpu_hash_32_3_sm5(uint32_t threads, uint32_t startNounce, uint2 *g_hash) {} -#endif diff --git a/lyra2/cuda_lyra2_vectors.h b/lyra2/cuda_lyra2_vectors.h deleted file mode 100644 index 6bb11d3c..00000000 --- a/lyra2/cuda_lyra2_vectors.h +++ /dev/null @@ -1,601 +0,0 @@ -/* DJM CRAP to strip (again) made for SM 3.2+ */ - -#ifndef CUDA_LYRA_VECTOR_H -#define CUDA_LYRA_VECTOR_H - -/////////////////////////////////////////////////////////////////////////////////// -#if (defined(_MSC_VER) && defined(_WIN64)) || defined(__LP64__) -#define __LDG_PTR "l" -#else -#define __LDG_PTR "r" -#endif - -#include "cuda_helper.h" - -#if __CUDA_ARCH__ < 300 -#define __shfl(x, y, z) (x) -#endif - -#if CUDA_VERSION >= 9000 && __CUDA_ARCH__ >= 300 -#define __shfl2(var, srcLane) __shfl_sync(0xFFFFFFFFu, var, srcLane) -#else -#define __shfl2 __shfl -#endif - -#if __CUDA_ARCH__ < 320 && !defined(__ldg4) -#define __ldg4(x) (*(x)) -#endif - -typedef struct __align__(32) uint8 { - unsigned int s0, s1, s2, s3, s4, s5, s6, s7; -} uint8; - -typedef struct __align__(64) uint2_8 { - uint2 s0, s1, s2, s3, s4, s5, s6, s7; -} uint2_8; - -typedef struct __align__(64) ulonglong2to8 { - ulonglong2 l0,l1,l2,l3; -} ulonglong2to8; - -typedef struct __align__(128) ulonglong8to16 { - ulonglong2to8 lo, hi; -} ulonglong8to16; - -typedef struct __align__(128) ulonglong16to32{ - ulonglong8to16 lo, hi; -} ulonglong16to32; - -typedef struct __align__(128) ulonglong32to64{ - ulonglong16to32 lo, hi; -} ulonglong32to64; - -typedef struct __align__(128) ulonglonglong { - ulonglong2 s0,s1,s2,s3,s4,s5,s6,s7; -} ulonglonglong; - -typedef struct __align__(64) uint16 { - union { - struct {unsigned int s0, s1, s2, s3, s4, s5, s6, s7;}; - uint8 lo; - }; - union { - struct {unsigned int s8, s9, sa, sb, sc, sd, se, sf;}; - uint8 hi; - }; -} uint16; - -typedef struct __align__(128) uint2_16 { - union { - struct { uint2 s0, s1, s2, s3, s4, s5, s6, s7; }; - uint2_8 lo; - }; - union { - struct { uint2 s8, s9, sa, sb, sc, sd, se, sf; }; - uint2_8 hi; - }; -} uint2_16; - -typedef struct __align__(128) uint32 { - uint16 lo,hi; -} uint32; - -struct __align__(128) ulong8 { - ulonglong4 s0, s1, s2, s3; -}; -typedef __device_builtin__ struct ulong8 ulong8; - -typedef struct __align__(128) ulonglong16{ - ulonglong4 s0, s1, s2, s3, s4, s5, s6, s7; -} ulonglong16; - -typedef struct __align__(16) uint28 { - uint2 x, y, z, w; -} uint2x4; -typedef uint2x4 uint28; /* name deprecated */ - -typedef struct __builtin_align__(32) uint48 { - uint4 s0,s1; -} uint48; - -typedef struct __builtin_align__(128) uint4x16{ - uint4 s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15; -} uint4x16; - -static __inline__ __device__ ulonglong2to8 make_ulonglong2to8(ulonglong2 s0, ulonglong2 s1, ulonglong2 s2, ulonglong2 s3) -{ - ulonglong2to8 t; t.l0=s0; t.l1=s1; t.l2=s2; t.l3=s3; - return t; -} - -static __inline__ __device__ ulonglong8to16 make_ulonglong8to16(const ulonglong2to8 &s0, const ulonglong2to8 &s1) -{ - ulonglong8to16 t; t.lo = s0; t.hi = s1; - return t; -} - -static __inline__ __device__ ulonglong16to32 make_ulonglong16to32(const ulonglong8to16 &s0, const ulonglong8to16 &s1) -{ - ulonglong16to32 t; t.lo = s0; t.hi = s1; - return t; -} - -static __inline__ __device__ ulonglong32to64 make_ulonglong32to64(const ulonglong16to32 &s0, const ulonglong16to32 &s1) -{ - ulonglong32to64 t; t.lo = s0; t.hi = s1; - return t; -} - -static __inline__ __host__ __device__ ulonglonglong make_ulonglonglong( - const ulonglong2 &s0, const ulonglong2 &s1, const ulonglong2 &s2, const ulonglong2 &s3, - const ulonglong2 &s4, const ulonglong2 &s5) -{ - ulonglonglong t; t.s0 = s0; t.s1 = s1; t.s2 = s2; t.s3 = s3; t.s4 = s4; t.s5 = s5; - return t; -} - -static __inline__ __device__ uint48 make_uint48(uint4 s0, uint4 s1) -{ - uint48 t; t.s0 = s0; t.s1 = s1; - return t; -} - -static __inline__ __device__ uint28 make_uint28(uint2 s0, uint2 s1, uint2 s2, uint2 s3) -{ - uint28 t; t.x = s0; t.y = s1; t.z = s2; t.w = s3; - return t; -} - -static __inline__ __host__ __device__ uint4x16 make_uint4x16( - uint4 s0, uint4 s1, uint4 s2, uint4 s3, uint4 s4, uint4 s5, uint4 s6, uint4 s7, - uint4 s8, uint4 s9, uint4 sa, uint4 sb, uint4 sc, uint4 sd, uint4 se, uint4 sf) -{ - uint4x16 t; t.s0 = s0; t.s1 = s1; t.s2 = s2; t.s3 = s3; t.s4 = s4; t.s5 = s5; t.s6 = s6; t.s7 = s7; - t.s8 = s8; t.s9 = s9; t.s10 = sa; t.s11 = sb; t.s12 = sc; t.s13 = sd; t.s14 = se; t.s15 = sf; - return t; -} - -static __inline__ __device__ uint2_16 make_uint2_16( - uint2 s0, uint2 s1, uint2 s2, uint2 s3, uint2 s4, uint2 s5, uint2 s6, uint2 s7, - uint2 s8, uint2 s9, uint2 sa, uint2 sb, uint2 sc, uint2 sd, uint2 se, uint2 sf) -{ - uint2_16 t; t.s0 = s0; t.s1 = s1; t.s2 = s2; t.s3 = s3; t.s4 = s4; t.s5 = s5; t.s6 = s6; t.s7 = s7; - t.s8 = s8; t.s9 = s9; t.sa = sa; t.sb = sb; t.sc = sc; t.sd = sd; t.se = se; t.sf = sf; - return t; -} - -static __inline__ __host__ __device__ uint16 make_uint16( - unsigned int s0, unsigned int s1, unsigned int s2, unsigned int s3, unsigned int s4, unsigned int s5, unsigned int s6, unsigned int s7, - unsigned int s8, unsigned int s9, unsigned int sa, unsigned int sb, unsigned int sc, unsigned int sd, unsigned int se, unsigned int sf) -{ - uint16 t; t.s0 = s0; t.s1 = s1; t.s2 = s2; t.s3 = s3; t.s4 = s4; t.s5 = s5; t.s6 = s6; t.s7 = s7; - t.s8 = s8; t.s9 = s9; t.sa = sa; t.sb = sb; t.sc = sc; t.sd = sd; t.se = se; t.sf = sf; - return t; -} - -static __inline__ __host__ __device__ uint16 make_uint16(const uint8 &a, const uint8 &b) -{ - uint16 t; t.lo=a; t.hi=b; return t; -} - -static __inline__ __host__ __device__ uint32 make_uint32(const uint16 &a, const uint16 &b) -{ - uint32 t; t.lo = a; t.hi = b; return t; -} - - -static __inline__ __host__ __device__ uint8 make_uint8( - unsigned int s0, unsigned int s1, unsigned int s2, unsigned int s3, unsigned int s4, unsigned int s5, unsigned int s6, unsigned int s7) -{ - uint8 t; t.s0 = s0; t.s1 = s1; t.s2 = s2; t.s3 = s3; t.s4 = s4; t.s5 = s5; t.s6 = s6; t.s7 = s7; - return t; -} - -static __inline__ __host__ __device__ uint2_8 make_uint2_8( - uint2 s0, uint2 s1, uint2 s2, uint2 s3, uint2 s4, uint2 s5, uint2 s6, uint2 s7) -{ - uint2_8 t; t.s0 = s0; t.s1 = s1; t.s2 = s2; t.s3 = s3; t.s4 = s4; t.s5 = s5; t.s6 = s6; t.s7 = s7; - return t; -} - -static __inline__ __host__ __device__ ulonglong16 make_ulonglong16(const ulonglong4 &s0, const ulonglong4 &s1, - const ulonglong4 &s2, const ulonglong4 &s3, const ulonglong4 &s4, const ulonglong4 &s5, const ulonglong4 &s6, const ulonglong4 &s7) -{ - ulonglong16 t; t.s0 = s0; t.s1 = s1; t.s2 = s2; t.s3 = s3; t.s4 = s4; t.s5 = s5; t.s6 = s6; t.s7 = s7; - return t; -} - -static __inline__ __host__ __device__ ulong8 make_ulong8( - ulonglong4 s0, ulonglong4 s1, ulonglong4 s2, ulonglong4 s3) -{ - ulong8 t; t.s0 = s0; t.s1 = s1; t.s2 = s2; t.s3 = s3;// t.s4 = s4; t.s5 = s5; t.s6 = s6; t.s7 = s7; - return t; -} - - -static __forceinline__ __device__ uchar4 operator^ (uchar4 a, uchar4 b) { return make_uchar4(a.x ^ b.x, a.y ^ b.y, a.z ^ b.z, a.w ^ b.w); } -static __forceinline__ __device__ uchar4 operator+ (uchar4 a, uchar4 b) { return make_uchar4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); } - -static __forceinline__ __device__ uint4 operator+ (uint4 a, uint4 b) { return make_uint4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); } - -static __forceinline__ __device__ ulonglong4 operator^ (ulonglong4 a, ulonglong4 b) { return make_ulonglong4(a.x ^ b.x, a.y ^ b.y, a.z ^ b.z, a.w ^ b.w); } -static __forceinline__ __device__ ulonglong4 operator+ (ulonglong4 a, ulonglong4 b) { return make_ulonglong4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); } -static __forceinline__ __device__ ulonglong2 operator^ (ulonglong2 a, ulonglong2 b) { return make_ulonglong2(a.x ^ b.x, a.y ^ b.y); } -static __forceinline__ __device__ ulonglong2 operator+ (ulonglong2 a, ulonglong2 b) { return make_ulonglong2(a.x + b.x, a.y + b.y); } - -static __forceinline__ __device__ ulong8 operator^ (const ulong8 &a, const ulong8 &b) { - return make_ulong8(a.s0 ^ b.s0, a.s1 ^ b.s1, a.s2 ^ b.s2, a.s3 ^ b.s3); -} - -static __forceinline__ __device__ ulong8 operator+ (const ulong8 &a, const ulong8 &b) { - return make_ulong8(a.s0 + b.s0, a.s1 + b.s1, a.s2 + b.s2, a.s3 + b.s3); -} - -static __forceinline__ __device__ __host__ uint8 operator^ (const uint8 &a, const uint8 &b) { return make_uint8(a.s0 ^ b.s0, a.s1 ^ b.s1, a.s2 ^ b.s2, a.s3 ^ b.s3, a.s4 ^ b.s4, a.s5 ^ b.s5, a.s6 ^ b.s6, a.s7 ^ b.s7); } - -static __forceinline__ __device__ __host__ uint8 operator+ (const uint8 &a, const uint8 &b) { return make_uint8(a.s0 + b.s0, a.s1 + b.s1, a.s2 + b.s2, a.s3 + b.s3, a.s4 + b.s4, a.s5 + b.s5, a.s6 + b.s6, a.s7 + b.s7); } - -static __forceinline__ __device__ uint2_8 operator^ (const uint2_8 &a, const uint2_8 &b) { return make_uint2_8(a.s0 ^ b.s0, a.s1 ^ b.s1, a.s2 ^ b.s2, a.s3 ^ b.s3, a.s4 ^ b.s4, a.s5 ^ b.s5, a.s6 ^ b.s6, a.s7 ^ b.s7); } - -static __forceinline__ __device__ uint2_8 operator+ (const uint2_8 &a, const uint2_8 &b) { return make_uint2_8(a.s0 + b.s0, a.s1 + b.s1, a.s2 + b.s2, a.s3 + b.s3, a.s4 + b.s4, a.s5 + b.s5, a.s6 + b.s6, a.s7 + b.s7); } - - -////////////// mess++ ////// - -static __forceinline__ __device__ uint28 operator^ (const uint28 &a, const uint28 &b) { - return make_uint28(a.x ^ b.x, a.y ^ b.y, a.z ^ b.z, a.w ^ b.w); -} - -static __forceinline__ __device__ uint28 operator+ (const uint28 &a, const uint28 &b) { - return make_uint28(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); -} - -static __forceinline__ __device__ uint48 operator+ (const uint48 &a, const uint48 &b) { - return make_uint48(a.s0 + b.s0, a.s1 + b.s1); -} - -///////////////////////// - -static __forceinline__ __device__ __host__ uint16 operator^ (const uint16 &a, const uint16 &b) { - return make_uint16(a.s0 ^ b.s0, a.s1 ^ b.s1, a.s2 ^ b.s2, a.s3 ^ b.s3, a.s4 ^ b.s4, a.s5 ^ b.s5, a.s6 ^ b.s6, a.s7 ^ b.s7, - a.s8 ^ b.s8, a.s9 ^ b.s9, a.sa ^ b.sa, a.sb ^ b.sb, a.sc ^ b.sc, a.sd ^ b.sd, a.se ^ b.se, a.sf ^ b.sf); -} - -static __forceinline__ __device__ __host__ uint16 operator+ (const uint16 &a, const uint16 &b) { - return make_uint16(a.s0 + b.s0, a.s1 + b.s1, a.s2 + b.s2, a.s3 + b.s3, a.s4 + b.s4, a.s5 + b.s5, a.s6 + b.s6, a.s7 + b.s7, - a.s8 + b.s8, a.s9 + b.s9, a.sa + b.sa, a.sb + b.sb, a.sc + b.sc, a.sd + b.sd, a.se + b.se, a.sf + b.sf); -} - -static __forceinline__ __device__ uint2_16 operator^ (const uint2_16 &a, const uint2_16 &b) { - return make_uint2_16(a.s0 ^ b.s0, a.s1 ^ b.s1, a.s2 ^ b.s2, a.s3 ^ b.s3, a.s4 ^ b.s4, a.s5 ^ b.s5, a.s6 ^ b.s6, a.s7 ^ b.s7, - a.s8 ^ b.s8, a.s9 ^ b.s9, a.sa ^ b.sa, a.sb ^ b.sb, a.sc ^ b.sc, a.sd ^ b.sd, a.se ^ b.se, a.sf ^ b.sf); -} - -static __forceinline__ __device__ uint2_16 operator+ (const uint2_16 &a, const uint2_16 &b) { - return make_uint2_16(a.s0 + b.s0, a.s1 + b.s1, a.s2 + b.s2, a.s3 + b.s3, a.s4 + b.s4, a.s5 + b.s5, a.s6 + b.s6, a.s7 + b.s7, - a.s8 + b.s8, a.s9 + b.s9, a.sa + b.sa, a.sb + b.sb, a.sc + b.sc, a.sd + b.sd, a.se + b.se, a.sf + b.sf); -} - -static __forceinline__ __device__ uint32 operator^ (const uint32 &a, const uint32 &b) { - return make_uint32(a.lo ^ b.lo, a.hi ^ b.hi); -} - -static __forceinline__ __device__ uint32 operator+ (const uint32 &a, const uint32 &b) { - return make_uint32(a.lo + b.lo, a.hi + b.hi); -} - -static __forceinline__ __device__ ulonglong16 operator^ (const ulonglong16 &a, const ulonglong16 &b) { - return make_ulonglong16(a.s0 ^ b.s0, a.s1 ^ b.s1, a.s2 ^ b.s2, a.s3 ^ b.s3, a.s4 ^ b.s4, a.s5 ^ b.s5, a.s6 ^ b.s6, a.s7 ^ b.s7); -} - -static __forceinline__ __device__ ulonglong16 operator+ (const ulonglong16 &a, const ulonglong16 &b) { - return make_ulonglong16(a.s0 + b.s0, a.s1 + b.s1, a.s2 + b.s2, a.s3 + b.s3, a.s4 + b.s4, a.s5 + b.s5, a.s6 + b.s6, a.s7 + b.s7); -} - -static __forceinline__ __device__ void operator^= (ulong8 &a, const ulong8 &b) { a = a ^ b; } - -static __forceinline__ __device__ void operator^= (uint28 &a, const uint28 &b) { a = a ^ b; } -static __forceinline__ __device__ void operator+= (uint28 &a, const uint28 &b) { a = a + b; } - -static __forceinline__ __device__ void operator^= (uint2_8 &a, const uint2_8 &b) { a = a ^ b; } -static __forceinline__ __device__ void operator+= (uint2_8 &a, const uint2_8 &b) { a = a + b; } - -static __forceinline__ __device__ void operator^= (uint32 &a, const uint32 &b) { a = a ^ b; } -static __forceinline__ __device__ void operator+= (uint32 &a, const uint32 &b) { a = a + b; } - -static __forceinline__ __device__ void operator^= (uchar4 &a, uchar4 b) { a = a ^ b; } - -static __forceinline__ __device__ __host__ void operator^= (uint8 &a, const uint8 &b) { a = a ^ b; } -static __forceinline__ __device__ __host__ void operator^= (uint16 &a, const uint16 &b) { a = a ^ b; } - -static __forceinline__ __device__ void operator^= (ulonglong16 &a, const ulonglong16 &b) { a = a ^ b; } -static __forceinline__ __device__ void operator^= (ulonglong4 &a, const ulonglong4 &b) { a = a ^ b; } -static __forceinline__ __device__ void operator+= (ulonglong4 &a, const ulonglong4 &b) { a = a + b; } - -static __forceinline__ __device__ void operator^= (ulonglong2 &a, const ulonglong2 &b) { a = a ^ b; } -static __forceinline__ __device__ void operator+= (ulonglong2 &a, const ulonglong2 &b) { a = a + b; } - -static __forceinline__ __device__ -ulonglong2to8 operator^ (const ulonglong2to8 &a, const ulonglong2to8 &b) -{ - return make_ulonglong2to8(a.l0 ^ b.l0, a.l1 ^ b.l1, a.l2 ^ b.l2, a.l3 ^ b.l3); -} -static __forceinline__ __device__ -ulonglong2to8 operator+ (const ulonglong2to8 &a, const ulonglong2to8 &b) -{ - return make_ulonglong2to8(a.l0 + b.l0, a.l1 + b.l1, a.l2 + b.l2, a.l3 + b.l3); -} - -static __forceinline__ __device__ -ulonglong8to16 operator^ (const ulonglong8to16 &a, const ulonglong8to16 &b) -{ - return make_ulonglong8to16(a.lo ^ b.lo, a.hi ^ b.hi); -} - -static __forceinline__ __device__ -ulonglong8to16 operator+ (const ulonglong8to16 &a, const ulonglong8to16 &b) -{ - return make_ulonglong8to16(a.lo + b.lo, a.hi + b.hi); -} - -static __forceinline__ __device__ -ulonglong16to32 operator^ (const ulonglong16to32 &a, const ulonglong16to32 &b) -{ - return make_ulonglong16to32(a.lo ^ b.lo, a.hi ^ b.hi); -} - -static __forceinline__ __device__ -ulonglong16to32 operator+ (const ulonglong16to32 &a, const ulonglong16to32 &b) -{ - return make_ulonglong16to32(a.lo + b.lo, a.hi + b.hi); -} - -static __forceinline__ __device__ -ulonglong32to64 operator^ (const ulonglong32to64 &a, const ulonglong32to64 &b) -{ - return make_ulonglong32to64(a.lo ^ b.lo, a.hi ^ b.hi); -} - -static __forceinline__ __device__ -ulonglong32to64 operator+ (const ulonglong32to64 &a, const ulonglong32to64 &b) -{ - return make_ulonglong32to64(a.lo + b.lo, a.hi + b.hi); -} - -static __forceinline__ __device__ ulonglonglong operator^ (const ulonglonglong &a, const ulonglonglong &b) { - return make_ulonglonglong(a.s0 ^ b.s0, a.s1 ^ b.s1, a.s2 ^ b.s2, a.s3 ^ b.s3, a.s4 ^ b.s4, a.s5 ^ b.s5); -} - -static __forceinline__ __device__ ulonglonglong operator+ (const ulonglonglong &a, const ulonglonglong &b) { - return make_ulonglonglong(a.s0 + b.s0, a.s1 + b.s1, a.s2 + b.s2, a.s3 + b.s3, a.s4 + b.s4, a.s5 + b.s5); -} - -static __forceinline__ __device__ void operator^= (ulonglong2to8 &a, const ulonglong2to8 &b) { a = a ^ b; } - -static __forceinline__ __device__ void operator+= (uint4 &a, uint4 b) { a = a + b; } -static __forceinline__ __device__ void operator+= (uchar4 &a, uchar4 b) { a = a + b; } -static __forceinline__ __device__ __host__ void operator+= (uint8 &a, const uint8 &b) { a = a + b; } -static __forceinline__ __device__ __host__ void operator+= (uint16 &a, const uint16 &b) { a = a + b; } -static __forceinline__ __device__ void operator+= (uint2_16 &a, const uint2_16 &b) { a = a + b; } -static __forceinline__ __device__ void operator^= (uint2_16 &a, const uint2_16 &b) { a = a + b; } - -static __forceinline__ __device__ void operator+= (ulong8 &a, const ulong8 &b) { a = a + b; } -static __forceinline__ __device__ void operator+= (ulonglong16 &a, const ulonglong16 &b) { a = a + b; } -static __forceinline__ __device__ void operator+= (ulonglong8to16 &a, const ulonglong8to16 &b) { a = a + b; } -static __forceinline__ __device__ void operator^= (ulonglong8to16 &a, const ulonglong8to16 &b) { a = a ^ b; } - -static __forceinline__ __device__ void operator+= (ulonglong16to32 &a, const ulonglong16to32 &b) { a = a + b; } -static __forceinline__ __device__ void operator^= (ulonglong16to32 &a, const ulonglong16to32 &b) { a = a ^ b; } - -static __forceinline__ __device__ void operator+= (ulonglong32to64 &a, const ulonglong32to64 &b) { a = a + b; } -static __forceinline__ __device__ void operator^= (ulonglong32to64 &a, const ulonglong32to64 &b) { a = a ^ b; } - -static __forceinline__ __device__ void operator+= (ulonglonglong &a, const ulonglonglong &b) { a = a + b; } -static __forceinline__ __device__ void operator^= (ulonglonglong &a, const ulonglonglong &b) { a = a ^ b; } - -#if __CUDA_ARCH__ < 320 - -#define rotate ROTL32 -#define rotateR ROTR32 - -#else - -static __forceinline__ __device__ uint4 rotate4(uint4 vec4, uint32_t shift) -{ - uint4 ret; - asm("shf.l.wrap.b32 %0, %1, %2, %3;" : "=r"(ret.x) : "r"(vec4.x), "r"(vec4.x), "r"(shift)); - asm("shf.l.wrap.b32 %0, %1, %2, %3;" : "=r"(ret.y) : "r"(vec4.y), "r"(vec4.y), "r"(shift)); - asm("shf.l.wrap.b32 %0, %1, %2, %3;" : "=r"(ret.z) : "r"(vec4.z), "r"(vec4.z), "r"(shift)); - asm("shf.l.wrap.b32 %0, %1, %2, %3;" : "=r"(ret.w) : "r"(vec4.w), "r"(vec4.w), "r"(shift)); - return ret; -} - -static __forceinline__ __device__ uint4 rotate4R(uint4 vec4, uint32_t shift) -{ - uint4 ret; - asm("shf.r.wrap.b32 %0, %1, %2, %3;" : "=r"(ret.x) : "r"(vec4.x), "r"(vec4.x), "r"(shift)); - asm("shf.r.wrap.b32 %0, %1, %2, %3;" : "=r"(ret.y) : "r"(vec4.y), "r"(vec4.y), "r"(shift)); - asm("shf.r.wrap.b32 %0, %1, %2, %3;" : "=r"(ret.z) : "r"(vec4.z), "r"(vec4.z), "r"(shift)); - asm("shf.r.wrap.b32 %0, %1, %2, %3;" : "=r"(ret.w) : "r"(vec4.w), "r"(vec4.w), "r"(shift)); - return ret; -} - -static __forceinline__ __device__ uint32_t rotate(uint32_t vec4, uint32_t shift) -{ - uint32_t ret; - asm("shf.l.wrap.b32 %0, %1, %2, %3;" : "=r"(ret) : "r"(vec4), "r"(vec4), "r"(shift)); - return ret; -} - -static __forceinline__ __device__ uint32_t rotateR(uint32_t vec4, uint32_t shift) -{ - uint32_t ret; - asm("shf.r.wrap.b32 %0, %1, %2, %3;" : "=r"(ret) : "r"(vec4), "r"(vec4), "r"(shift)); - return ret; -} - -static __device__ __inline__ ulonglong4 __ldg4(const ulonglong4 *ptr) -{ - ulonglong4 ret; - asm("ld.global.nc.v2.u64 {%0,%1}, [%2];" : "=l"(ret.x), "=l"(ret.y) : __LDG_PTR(ptr)); - asm("ld.global.nc.v2.u64 {%0,%1}, [%2+16];" : "=l"(ret.z), "=l"(ret.w) : __LDG_PTR(ptr)); - return ret; -} - -static __device__ __inline__ void ldg4(const ulonglong4 *ptr,ulonglong4 *ret) -{ - asm("ld.global.nc.v2.u64 {%0,%1}, [%2];" : "=l"(ret[0].x), "=l"(ret[0].y) : __LDG_PTR(ptr)); - asm("ld.global.nc.v2.u64 {%0,%1}, [%2+16];" : "=l"(ret[0].z), "=l"(ret[0].w) : __LDG_PTR(ptr)); - asm("ld.global.nc.v2.u64 {%0,%1}, [%2+32];" : "=l"(ret[1].x), "=l"(ret[1].y) : __LDG_PTR(ptr)); - asm("ld.global.nc.v2.u64 {%0,%1}, [%2+48];" : "=l"(ret[1].z), "=l"(ret[1].w) : __LDG_PTR(ptr)); - asm("ld.global.nc.v2.u64 {%0,%1}, [%2+64];" : "=l"(ret[2].x), "=l"(ret[2].y) : __LDG_PTR(ptr)); - asm("ld.global.nc.v2.u64 {%0,%1}, [%2+80];" : "=l"(ret[2].z), "=l"(ret[2].w) : __LDG_PTR(ptr)); -} - -static __device__ __inline__ uint28 __ldg4(const uint28 *ptr) -{ - uint28 ret; - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4];" : "=r"(ret.x.x), "=r"(ret.x.y), "=r"(ret.y.x), "=r"(ret.y.y) : __LDG_PTR(ptr)); - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4+16];" : "=r"(ret.z.x), "=r"(ret.z.y), "=r"(ret.w.x), "=r"(ret.w.y) : __LDG_PTR(ptr)); - return ret; -} - -static __device__ __inline__ uint48 __ldg4(const uint48 *ptr) -{ - uint48 ret; - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4];" : "=r"(ret.s0.x), "=r"(ret.s0.y), "=r"(ret.s0.z), "=r"(ret.s0.w) : __LDG_PTR(ptr)); - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4+16];" : "=r"(ret.s1.x), "=r"(ret.s1.y), "=r"(ret.s1.z), "=r"(ret.s1.w) : __LDG_PTR(ptr)); - return ret; -} - -static __device__ __inline__ void ldg4(const uint28 *ptr, uint28 *ret) -{ - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4];" : "=r"(ret[0].x.x), "=r"(ret[0].x.y), "=r"(ret[0].y.x), "=r"(ret[0].y.y) : __LDG_PTR(ptr)); - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4+16];" : "=r"(ret[0].z.x), "=r"(ret[0].z.y), "=r"(ret[0].w.x), "=r"(ret[0].w.y) : __LDG_PTR(ptr)); - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4+32];" : "=r"(ret[1].x.x), "=r"(ret[1].x.y), "=r"(ret[1].y.x), "=r"(ret[1].y.y) : __LDG_PTR(ptr)); - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4+48];" : "=r"(ret[1].z.x), "=r"(ret[1].z.y), "=r"(ret[1].w.x), "=r"(ret[1].w.y) : __LDG_PTR(ptr)); - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4+64];" : "=r"(ret[2].x.x), "=r"(ret[2].x.y), "=r"(ret[2].y.x), "=r"(ret[2].y.y) : __LDG_PTR(ptr)); - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4+80];" : "=r"(ret[2].z.x), "=r"(ret[2].z.y), "=r"(ret[2].w.x), "=r"(ret[2].w.y) : __LDG_PTR(ptr)); -} - -#endif /* __CUDA_ARCH__ < 320 */ - - -static __forceinline__ __device__ uint8 swapvec(const uint8 &buf) -{ - uint8 vec; - vec.s0 = cuda_swab32(buf.s0); - vec.s1 = cuda_swab32(buf.s1); - vec.s2 = cuda_swab32(buf.s2); - vec.s3 = cuda_swab32(buf.s3); - vec.s4 = cuda_swab32(buf.s4); - vec.s5 = cuda_swab32(buf.s5); - vec.s6 = cuda_swab32(buf.s6); - vec.s7 = cuda_swab32(buf.s7); - return vec; -} - -static __forceinline__ __device__ uint8 swapvec(const uint8 *buf) -{ - uint8 vec; - vec.s0 = cuda_swab32(buf[0].s0); - vec.s1 = cuda_swab32(buf[0].s1); - vec.s2 = cuda_swab32(buf[0].s2); - vec.s3 = cuda_swab32(buf[0].s3); - vec.s4 = cuda_swab32(buf[0].s4); - vec.s5 = cuda_swab32(buf[0].s5); - vec.s6 = cuda_swab32(buf[0].s6); - vec.s7 = cuda_swab32(buf[0].s7); - return vec; -} - -static __forceinline__ __device__ uint16 swapvec(const uint16 *buf) -{ - uint16 vec; - vec.s0 = cuda_swab32(buf[0].s0); - vec.s1 = cuda_swab32(buf[0].s1); - vec.s2 = cuda_swab32(buf[0].s2); - vec.s3 = cuda_swab32(buf[0].s3); - vec.s4 = cuda_swab32(buf[0].s4); - vec.s5 = cuda_swab32(buf[0].s5); - vec.s6 = cuda_swab32(buf[0].s6); - vec.s7 = cuda_swab32(buf[0].s7); - vec.s8 = cuda_swab32(buf[0].s8); - vec.s9 = cuda_swab32(buf[0].s9); - vec.sa = cuda_swab32(buf[0].sa); - vec.sb = cuda_swab32(buf[0].sb); - vec.sc = cuda_swab32(buf[0].sc); - vec.sd = cuda_swab32(buf[0].sd); - vec.se = cuda_swab32(buf[0].se); - vec.sf = cuda_swab32(buf[0].sf); - return vec; -} - -static __forceinline__ __device__ uint16 swapvec(const uint16 &buf) -{ - uint16 vec; - vec.s0 = cuda_swab32(buf.s0); - vec.s1 = cuda_swab32(buf.s1); - vec.s2 = cuda_swab32(buf.s2); - vec.s3 = cuda_swab32(buf.s3); - vec.s4 = cuda_swab32(buf.s4); - vec.s5 = cuda_swab32(buf.s5); - vec.s6 = cuda_swab32(buf.s6); - vec.s7 = cuda_swab32(buf.s7); - vec.s8 = cuda_swab32(buf.s8); - vec.s9 = cuda_swab32(buf.s9); - vec.sa = cuda_swab32(buf.sa); - vec.sb = cuda_swab32(buf.sb); - vec.sc = cuda_swab32(buf.sc); - vec.sd = cuda_swab32(buf.sd); - vec.se = cuda_swab32(buf.se); - vec.sf = cuda_swab32(buf.sf); - return vec; -} - -static __device__ __forceinline__ uint28 shuffle4(const uint28 &var, int lane) -{ -#if __CUDA_ARCH__ >= 300 - uint28 res; - res.x.x = __shfl2(var.x.x, lane); - res.x.y = __shfl2(var.x.y, lane); - res.y.x = __shfl2(var.y.x, lane); - res.y.y = __shfl2(var.y.y, lane); - res.z.x = __shfl2(var.z.x, lane); - res.z.y = __shfl2(var.z.y, lane); - res.w.x = __shfl2(var.w.x, lane); - res.w.y = __shfl2(var.w.y, lane); - return res; -#else - return var; -#endif -} - -static __device__ __forceinline__ ulonglong4 shuffle4(ulonglong4 var, int lane) -{ -#if __CUDA_ARCH__ >= 300 - ulonglong4 res; - uint2 temp; - temp = vectorize(var.x); - temp.x = __shfl2(temp.x, lane); - temp.y = __shfl2(temp.y, lane); - res.x = devectorize(temp); - temp = vectorize(var.y); - temp.x = __shfl2(temp.x, lane); - temp.y = __shfl2(temp.y, lane); - res.y = devectorize(temp); - temp = vectorize(var.z); - temp.x = __shfl2(temp.x, lane); - temp.y = __shfl2(temp.y, lane); - res.z = devectorize(temp); - temp = vectorize(var.w); - temp.x = __shfl2(temp.x, lane); - temp.y = __shfl2(temp.y, lane); - res.w = devectorize(temp); - return res; -#else - return var; -#endif -} - -#endif // #ifndef CUDA_LYRA_VECTOR_H diff --git a/lyra2/cuda_lyra2v2.cu b/lyra2/cuda_lyra2v2.cu deleted file mode 100644 index df3291c1..00000000 --- a/lyra2/cuda_lyra2v2.cu +++ /dev/null @@ -1,469 +0,0 @@ -/** - * Lyra2 (v2) CUDA Implementation - * - * Based on djm34/VTC sources and incredible 2x boost by Nanashi Meiyo-Meijin (May 2016) - */ -#include -#include -#include - -#include "cuda_lyra2v2_sm3.cuh" - -#ifdef __INTELLISENSE__ -/* just for vstudio code colors */ -#define __CUDA_ARCH__ 500 -#endif - -#define TPB 32 - -#if __CUDA_ARCH__ >= 500 - -#include "cuda_lyra2_vectors.h" - -#define Nrow 4 -#define Ncol 4 -#define memshift 3 - -__device__ uint2x4 *DMatrix; - -__device__ __forceinline__ uint2 LD4S(const int index) -{ - extern __shared__ uint2 shared_mem[]; - return shared_mem[(index * blockDim.y + threadIdx.y) * blockDim.x + threadIdx.x]; -} - -__device__ __forceinline__ void ST4S(const int index, const uint2 data) -{ - extern __shared__ uint2 shared_mem[]; - shared_mem[(index * blockDim.y + threadIdx.y) * blockDim.x + threadIdx.x] = data; -} - -__device__ __forceinline__ uint2 shuffle2(uint2 a, uint32_t b, uint32_t c) -{ - return make_uint2(__shfl(a.x, b, c), __shfl(a.y, b, c)); -} - -__device__ __forceinline__ -void Gfunc_v5(uint2 &a, uint2 &b, uint2 &c, uint2 &d) -{ - a += b; d ^= a; d = SWAPUINT2(d); - c += d; b ^= c; b = ROR2(b, 24); - a += b; d ^= a; d = ROR2(d, 16); - c += d; b ^= c; b = ROR2(b, 63); -} - -__device__ __forceinline__ -void round_lyra_v5(uint2x4 s[4]) -{ - Gfunc_v5(s[0].x, s[1].x, s[2].x, s[3].x); - Gfunc_v5(s[0].y, s[1].y, s[2].y, s[3].y); - Gfunc_v5(s[0].z, s[1].z, s[2].z, s[3].z); - Gfunc_v5(s[0].w, s[1].w, s[2].w, s[3].w); - - Gfunc_v5(s[0].x, s[1].y, s[2].z, s[3].w); - Gfunc_v5(s[0].y, s[1].z, s[2].w, s[3].x); - Gfunc_v5(s[0].z, s[1].w, s[2].x, s[3].y); - Gfunc_v5(s[0].w, s[1].x, s[2].y, s[3].z); -} - -__device__ __forceinline__ -void round_lyra_v5(uint2 s[4]) -{ - Gfunc_v5(s[0], s[1], s[2], s[3]); - s[1] = shuffle2(s[1], threadIdx.x + 1, 4); - s[2] = shuffle2(s[2], threadIdx.x + 2, 4); - s[3] = shuffle2(s[3], threadIdx.x + 3, 4); - Gfunc_v5(s[0], s[1], s[2], s[3]); - s[1] = shuffle2(s[1], threadIdx.x + 3, 4); - s[2] = shuffle2(s[2], threadIdx.x + 2, 4); - s[3] = shuffle2(s[3], threadIdx.x + 1, 4); -} - -__device__ __forceinline__ -void reduceDuplexRowSetup2(uint2 state[4]) -{ - uint2 state1[Ncol][3], state0[Ncol][3], state2[3]; - int i, j; - - #pragma unroll - for (int i = 0; i < Ncol; i++) - { - #pragma unroll - for (j = 0; j < 3; j++) - state0[Ncol - i - 1][j] = state[j]; - round_lyra_v5(state); - } - - //#pragma unroll 4 - for (i = 0; i < Ncol; i++) - { - #pragma unroll - for (j = 0; j < 3; j++) - state[j] ^= state0[i][j]; - - round_lyra_v5(state); - - #pragma unroll - for (j = 0; j < 3; j++) - state1[Ncol - i - 1][j] = state0[i][j]; - - #pragma unroll - for (j = 0; j < 3; j++) - state1[Ncol - i - 1][j] ^= state[j]; - } - - for (i = 0; i < Ncol; i++) - { - const uint32_t s0 = memshift * Ncol * 0 + i * memshift; - const uint32_t s2 = memshift * Ncol * 2 + memshift * (Ncol - 1) - i*memshift; - - #pragma unroll - for (j = 0; j < 3; j++) - state[j] ^= state1[i][j] + state0[i][j]; - - round_lyra_v5(state); - - #pragma unroll - for (j = 0; j < 3; j++) - state2[j] = state1[i][j]; - - #pragma unroll - for (j = 0; j < 3; j++) - state2[j] ^= state[j]; - - #pragma unroll - for (j = 0; j < 3; j++) - ST4S(s2 + j, state2[j]); - - uint2 Data0 = shuffle2(state[0], threadIdx.x - 1, 4); - uint2 Data1 = shuffle2(state[1], threadIdx.x - 1, 4); - uint2 Data2 = shuffle2(state[2], threadIdx.x - 1, 4); - - if (threadIdx.x == 0) { - state0[i][0] ^= Data2; - state0[i][1] ^= Data0; - state0[i][2] ^= Data1; - } else { - state0[i][0] ^= Data0; - state0[i][1] ^= Data1; - state0[i][2] ^= Data2; - } - - #pragma unroll - for (j = 0; j < 3; j++) - ST4S(s0 + j, state0[i][j]); - - #pragma unroll - for (j = 0; j < 3; j++) - state0[i][j] = state2[j]; - - } - - for (i = 0; i < Ncol; i++) - { - const uint32_t s1 = memshift * Ncol * 1 + i*memshift; - const uint32_t s3 = memshift * Ncol * 3 + memshift * (Ncol - 1) - i*memshift; - - #pragma unroll - for (j = 0; j < 3; j++) - state[j] ^= state1[i][j] + state0[Ncol - i - 1][j]; - - round_lyra_v5(state); - - #pragma unroll - for (j = 0; j < 3; j++) - state0[Ncol - i - 1][j] ^= state[j]; - - #pragma unroll - for (j = 0; j < 3; j++) - ST4S(s3 + j, state0[Ncol - i - 1][j]); - - uint2 Data0 = shuffle2(state[0], threadIdx.x - 1, 4); - uint2 Data1 = shuffle2(state[1], threadIdx.x - 1, 4); - uint2 Data2 = shuffle2(state[2], threadIdx.x - 1, 4); - - if (threadIdx.x == 0) { - state1[i][0] ^= Data2; - state1[i][1] ^= Data0; - state1[i][2] ^= Data1; - } else { - state1[i][0] ^= Data0; - state1[i][1] ^= Data1; - state1[i][2] ^= Data2; - } - - #pragma unroll - for (j = 0; j < 3; j++) - ST4S(s1 + j, state1[i][j]); - } -} - -__device__ -void reduceDuplexRowt2(const int rowIn, const int rowInOut, const int rowOut, uint2 state[4]) -{ - uint2 state1[3], state2[3]; - const uint32_t ps1 = memshift * Ncol * rowIn; - const uint32_t ps2 = memshift * Ncol * rowInOut; - const uint32_t ps3 = memshift * Ncol * rowOut; - - for (int i = 0; i < Ncol; i++) - { - const uint32_t s1 = ps1 + i*memshift; - const uint32_t s2 = ps2 + i*memshift; - const uint32_t s3 = ps3 + i*memshift; - - #pragma unroll - for (int j = 0; j < 3; j++) - state1[j] = LD4S(s1 + j); - - #pragma unroll - for (int j = 0; j < 3; j++) - state2[j] = LD4S(s2 + j); - - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= state1[j] + state2[j]; - - round_lyra_v5(state); - - uint2 Data0 = shuffle2(state[0], threadIdx.x - 1, 4); - uint2 Data1 = shuffle2(state[1], threadIdx.x - 1, 4); - uint2 Data2 = shuffle2(state[2], threadIdx.x - 1, 4); - - if (threadIdx.x == 0) { - state2[0] ^= Data2; - state2[1] ^= Data0; - state2[2] ^= Data1; - } else { - state2[0] ^= Data0; - state2[1] ^= Data1; - state2[2] ^= Data2; - } - - #pragma unroll - for (int j = 0; j < 3; j++) - ST4S(s2 + j, state2[j]); - - #pragma unroll - for (int j = 0; j < 3; j++) - ST4S(s3 + j, LD4S(s3 + j) ^ state[j]); - } -} - -__device__ -void reduceDuplexRowt2x4(const int rowInOut, uint2 state[4]) -{ - const int rowIn = 2; - const int rowOut = 3; - - int i, j; - uint2 last[3]; - const uint32_t ps1 = memshift * Ncol * rowIn; - const uint32_t ps2 = memshift * Ncol * rowInOut; - - #pragma unroll - for (int j = 0; j < 3; j++) - last[j] = LD4S(ps2 + j); - - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= LD4S(ps1 + j) + last[j]; - - round_lyra_v5(state); - - uint2 Data0 = shuffle2(state[0], threadIdx.x - 1, 4); - uint2 Data1 = shuffle2(state[1], threadIdx.x - 1, 4); - uint2 Data2 = shuffle2(state[2], threadIdx.x - 1, 4); - - if (threadIdx.x == 0) { - last[0] ^= Data2; - last[1] ^= Data0; - last[2] ^= Data1; - } else { - last[0] ^= Data0; - last[1] ^= Data1; - last[2] ^= Data2; - } - - if (rowInOut == rowOut) - { - #pragma unroll - for (j = 0; j < 3; j++) - last[j] ^= state[j]; - } - - for (i = 1; i < Ncol; i++) - { - const uint32_t s1 = ps1 + i*memshift; - const uint32_t s2 = ps2 + i*memshift; - - #pragma unroll - for (j = 0; j < 3; j++) - state[j] ^= LD4S(s1 + j) + LD4S(s2 + j); - - round_lyra_v5(state); - } - - #pragma unroll - for (int j = 0; j < 3; j++) - state[j] ^= last[j]; -} - -__global__ -__launch_bounds__(TPB, 1) -void lyra2v2_gpu_hash_32_1(uint32_t threads, uint2 *inputHash) -{ - const uint32_t thread = blockDim.x * blockIdx.x + threadIdx.x; - - const uint2x4 blake2b_IV[2] = { - 0xf3bcc908UL, 0x6a09e667UL, 0x84caa73bUL, 0xbb67ae85UL, - 0xfe94f82bUL, 0x3c6ef372UL, 0x5f1d36f1UL, 0xa54ff53aUL, - 0xade682d1UL, 0x510e527fUL, 0x2b3e6c1fUL, 0x9b05688cUL, - 0xfb41bd6bUL, 0x1f83d9abUL, 0x137e2179UL, 0x5be0cd19UL - }; - - const uint2x4 Mask[2] = { - 0x00000020UL, 0x00000000UL, 0x00000020UL, 0x00000000UL, - 0x00000020UL, 0x00000000UL, 0x00000001UL, 0x00000000UL, - 0x00000004UL, 0x00000000UL, 0x00000004UL, 0x00000000UL, - 0x00000080UL, 0x00000000UL, 0x00000000UL, 0x01000000UL - }; - - uint2x4 state[4]; - - if (thread < threads) - { - state[0].x = state[1].x = __ldg(&inputHash[thread + threads * 0]); - state[0].y = state[1].y = __ldg(&inputHash[thread + threads * 1]); - state[0].z = state[1].z = __ldg(&inputHash[thread + threads * 2]); - state[0].w = state[1].w = __ldg(&inputHash[thread + threads * 3]); - state[2] = blake2b_IV[0]; - state[3] = blake2b_IV[1]; - - for (int i = 0; i<12; i++) - round_lyra_v5(state); - - state[0] ^= Mask[0]; - state[1] ^= Mask[1]; - - for (int i = 0; i<12; i++) - round_lyra_v5(state); - - DMatrix[blockDim.x * gridDim.x * 0 + thread] = state[0]; - DMatrix[blockDim.x * gridDim.x * 1 + thread] = state[1]; - DMatrix[blockDim.x * gridDim.x * 2 + thread] = state[2]; - DMatrix[blockDim.x * gridDim.x * 3 + thread] = state[3]; - } -} - -__global__ -__launch_bounds__(TPB, 1) -void lyra2v2_gpu_hash_32_2(uint32_t threads) -{ - const uint32_t thread = blockDim.y * blockIdx.x + threadIdx.y; - - if (thread < threads) - { - uint2 state[4]; - state[0] = ((uint2*)DMatrix)[(0 * gridDim.x * blockDim.y + thread) * blockDim.x + threadIdx.x]; - state[1] = ((uint2*)DMatrix)[(1 * gridDim.x * blockDim.y + thread) * blockDim.x + threadIdx.x]; - state[2] = ((uint2*)DMatrix)[(2 * gridDim.x * blockDim.y + thread) * blockDim.x + threadIdx.x]; - state[3] = ((uint2*)DMatrix)[(3 * gridDim.x * blockDim.y + thread) * blockDim.x + threadIdx.x]; - - reduceDuplexRowSetup2(state); - - uint32_t rowa; - int prev = 3; - - for (int i = 0; i < 3; i++) - { - rowa = __shfl(state[0].x, 0, 4) & 3; - reduceDuplexRowt2(prev, rowa, i, state); - prev = i; - } - - rowa = __shfl(state[0].x, 0, 4) & 3; - reduceDuplexRowt2x4(rowa, state); - - ((uint2*)DMatrix)[(0 * gridDim.x * blockDim.y + thread) * blockDim.x + threadIdx.x] = state[0]; - ((uint2*)DMatrix)[(1 * gridDim.x * blockDim.y + thread) * blockDim.x + threadIdx.x] = state[1]; - ((uint2*)DMatrix)[(2 * gridDim.x * blockDim.y + thread) * blockDim.x + threadIdx.x] = state[2]; - ((uint2*)DMatrix)[(3 * gridDim.x * blockDim.y + thread) * blockDim.x + threadIdx.x] = state[3]; - } -} - -__global__ -__launch_bounds__(TPB, 1) -void lyra2v2_gpu_hash_32_3(uint32_t threads, uint2 *outputHash) -{ - const uint32_t thread = blockDim.x * blockIdx.x + threadIdx.x; - - uint2x4 state[4]; - - if (thread < threads) - { - state[0] = __ldg4(&DMatrix[blockDim.x * gridDim.x * 0 + thread]); - state[1] = __ldg4(&DMatrix[blockDim.x * gridDim.x * 1 + thread]); - state[2] = __ldg4(&DMatrix[blockDim.x * gridDim.x * 2 + thread]); - state[3] = __ldg4(&DMatrix[blockDim.x * gridDim.x * 3 + thread]); - - for (int i = 0; i < 12; i++) - round_lyra_v5(state); - - outputHash[thread + threads * 0] = state[0].x; - outputHash[thread + threads * 1] = state[0].y; - outputHash[thread + threads * 2] = state[0].z; - outputHash[thread + threads * 3] = state[0].w; - } -} - -#else -#include "cuda_helper.h" -#if __CUDA_ARCH__ < 200 -__device__ void* DMatrix; -#endif -__global__ void lyra2v2_gpu_hash_32_1(uint32_t threads, uint2 *inputHash) {} -__global__ void lyra2v2_gpu_hash_32_2(uint32_t threads) {} -__global__ void lyra2v2_gpu_hash_32_3(uint32_t threads, uint2 *outputHash) {} -#endif - - -__host__ -void lyra2v2_cpu_init(int thr_id, uint32_t threads, uint64_t *d_matrix) -{ - cuda_get_arch(thr_id); - // just assign the device pointer allocated in main loop - cudaMemcpyToSymbol(DMatrix, &d_matrix, sizeof(uint64_t*), 0, cudaMemcpyHostToDevice); -} - -__host__ -void lyra2v2_cpu_hash_32(int thr_id, uint32_t threads, uint32_t startNounce, uint64_t *g_hash, int order) -{ - int dev_id = device_map[thr_id % MAX_GPUS]; - - if (device_sm[dev_id] >= 500) { - - const uint32_t tpb = TPB; - - dim3 grid2((threads + tpb - 1) / tpb); - dim3 block2(tpb); - dim3 grid4((threads * 4 + tpb - 1) / tpb); - dim3 block4(4, tpb / 4); - - lyra2v2_gpu_hash_32_1 <<< grid2, block2 >>> (threads, (uint2*)g_hash); - lyra2v2_gpu_hash_32_2 <<< grid4, block4, 48 * sizeof(uint2) * tpb >>> (threads); - lyra2v2_gpu_hash_32_3 <<< grid2, block2 >>> (threads, (uint2*)g_hash); - - } else { - - uint32_t tpb = 16; - if (cuda_arch[dev_id] >= 350) tpb = TPB35; - else if (cuda_arch[dev_id] >= 300) tpb = TPB30; - else if (cuda_arch[dev_id] >= 200) tpb = TPB20; - - dim3 grid((threads + tpb - 1) / tpb); - dim3 block(tpb); - lyra2v2_gpu_hash_32_v3 <<< grid, block >>> (threads, startNounce, (uint2*)g_hash); - - } -} diff --git a/lyra2/cuda_lyra2v2_sm3.cuh b/lyra2/cuda_lyra2v2_sm3.cuh deleted file mode 100644 index 0999a265..00000000 --- a/lyra2/cuda_lyra2v2_sm3.cuh +++ /dev/null @@ -1,338 +0,0 @@ -/* SM 2/3/3.5 Variant for lyra2REv2 */ - -#ifdef __INTELLISENSE__ -/* just for vstudio code colors, only uncomment that temporary, dont commit it */ -//#undef __CUDA_ARCH__ -//#define __CUDA_ARCH__ 500 -#endif - -#define TPB20 64 -#define TPB30 64 -#define TPB35 64 - -#if __CUDA_ARCH__ >= 200 && __CUDA_ARCH__ < 500 - -#include "cuda_lyra2_vectors.h" - -#define Nrow 4 -#define Ncol 4 - -#define vectype ulonglong4 -#define memshift 4 - -__device__ vectype *DMatrix; - -static __device__ __forceinline__ -void Gfunc_v35(unsigned long long &a, unsigned long long &b, unsigned long long &c, unsigned long long &d) -{ - a += b; d ^= a; d = ROTR64(d, 32); - c += d; b ^= c; b = ROTR64(b, 24); - a += b; d ^= a; d = ROTR64(d, 16); - c += d; b ^= c; b = ROTR64(b, 63); -} - -static __device__ __forceinline__ -void round_lyra_v35(vectype* s) -{ - Gfunc_v35(s[0].x, s[1].x, s[2].x, s[3].x); - Gfunc_v35(s[0].y, s[1].y, s[2].y, s[3].y); - Gfunc_v35(s[0].z, s[1].z, s[2].z, s[3].z); - Gfunc_v35(s[0].w, s[1].w, s[2].w, s[3].w); - - Gfunc_v35(s[0].x, s[1].y, s[2].z, s[3].w); - Gfunc_v35(s[0].y, s[1].z, s[2].w, s[3].x); - Gfunc_v35(s[0].z, s[1].w, s[2].x, s[3].y); - Gfunc_v35(s[0].w, s[1].x, s[2].y, s[3].z); -} - -static __device__ __forceinline__ -void reduceDuplexV3(vectype state[4], uint32_t thread) -{ - vectype state1[3]; - uint32_t ps1 = (Nrow * Ncol * memshift * thread); - uint32_t ps2 = (memshift * (Ncol - 1) * Nrow + memshift * 1 + Nrow * Ncol * memshift * thread); - - #pragma unroll 4 - for (int i = 0; i < Ncol; i++) - { - uint32_t s1 = ps1 + Nrow * i *memshift; - uint32_t s2 = ps2 - Nrow * i *memshift; - - for (int j = 0; j < 3; j++) - state1[j] = __ldg4(&(DMatrix + s1)[j]); - - for (int j = 0; j < 3; j++) - state[j] ^= state1[j]; - round_lyra_v35(state); - - for (int j = 0; j < 3; j++) - state1[j] ^= state[j]; - - for (int j = 0; j < 3; j++) - (DMatrix + s2)[j] = state1[j]; - } -} - -static __device__ __forceinline__ -void reduceDuplexRowSetupV3(const int rowIn, const int rowInOut, const int rowOut, vectype state[4], uint32_t thread) -{ - vectype state2[3], state1[3]; - - uint32_t ps1 = (memshift * rowIn + Nrow * Ncol * memshift * thread); - uint32_t ps2 = (memshift * rowInOut + Nrow * Ncol * memshift * thread); - uint32_t ps3 = (Nrow * memshift * (Ncol - 1) + memshift * rowOut + Nrow * Ncol * memshift * thread); - - for (int i = 0; i < Ncol; i++) - { - uint32_t s1 = ps1 + Nrow*i*memshift; - uint32_t s2 = ps2 + Nrow*i*memshift; - uint32_t s3 = ps3 - Nrow*i*memshift; - - for (int j = 0; j < 3; j++) - state1[j] = __ldg4(&(DMatrix + s1 )[j]); - for (int j = 0; j < 3; j++) - state2[j] = __ldg4(&(DMatrix + s2 )[j]); - for (int j = 0; j < 3; j++) { - vectype tmp = state1[j] + state2[j]; - state[j] ^= tmp; - } - - round_lyra_v35(state); - - for (int j = 0; j < 3; j++) { - state1[j] ^= state[j]; - (DMatrix + s3)[j] = state1[j]; - } - - ((uint2*)state2)[0] ^= ((uint2*)state)[11]; - for (int j = 0; j < 11; j++) - ((uint2*)state2)[j + 1] ^= ((uint2*)state)[j]; - - for (int j = 0; j < 3; j++) - (DMatrix + s2)[j] = state2[j]; - } -} - -static __device__ __forceinline__ -void reduceDuplexRowtV3(const int rowIn, const int rowInOut, const int rowOut, vectype* state, uint32_t thread) -{ - vectype state1[3], state2[3]; - uint32_t ps1 = (memshift * rowIn + Nrow * Ncol * memshift * thread); - uint32_t ps2 = (memshift * rowInOut + Nrow * Ncol * memshift * thread); - uint32_t ps3 = (memshift * rowOut + Nrow * Ncol * memshift * thread); - - #pragma nounroll - for (int i = 0; i < Ncol; i++) - { - uint32_t s1 = ps1 + Nrow * i*memshift; - uint32_t s2 = ps2 + Nrow * i*memshift; - uint32_t s3 = ps3 + Nrow * i*memshift; - - for (int j = 0; j < 3; j++) - state1[j] = __ldg4(&(DMatrix + s1)[j]); - - for (int j = 0; j < 3; j++) - state2[j] = __ldg4(&(DMatrix + s2)[j]); - - for (int j = 0; j < 3; j++) - state1[j] += state2[j]; - - for (int j = 0; j < 3; j++) - state[j] ^= state1[j]; - - round_lyra_v35(state); - - ((uint2*)state2)[0] ^= ((uint2*)state)[11]; - - for (int j = 0; j < 11; j++) - ((uint2*)state2)[j + 1] ^= ((uint2*)state)[j]; - - if (rowInOut != rowOut) { - - for (int j = 0; j < 3; j++) - (DMatrix + s2)[j] = state2[j]; - - for (int j = 0; j < 3; j++) - (DMatrix + s3)[j] ^= state[j]; - - } else { - - for (int j = 0; j < 3; j++) - state2[j] ^= state[j]; - - for (int j = 0; j < 3; j++) - (DMatrix + s2)[j] = state2[j]; - } - } -} - -#if __CUDA_ARCH__ >= 300 -__global__ __launch_bounds__(TPB35, 1) -void lyra2v2_gpu_hash_32_v3(uint32_t threads, uint32_t startNounce, uint2 *outputHash) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - - vectype state[4]; - vectype blake2b_IV[2]; - vectype padding[2]; - - if (threadIdx.x == 0) { - - ((uint16*)blake2b_IV)[0] = make_uint16( - 0xf3bcc908, 0x6a09e667 , 0x84caa73b, 0xbb67ae85, - 0xfe94f82b, 0x3c6ef372 , 0x5f1d36f1, 0xa54ff53a, - 0xade682d1, 0x510e527f , 0x2b3e6c1f, 0x9b05688c, - 0xfb41bd6b, 0x1f83d9ab , 0x137e2179, 0x5be0cd19 - ); - ((uint16*)padding)[0] = make_uint16( - 0x20, 0x0 , 0x20, 0x0 , 0x20, 0x0 , 0x01, 0x0, - 0x04, 0x0 , 0x04, 0x0 , 0x80, 0x0 , 0x0, 0x01000000 - ); - } - - if (thread < threads) - { - ((uint2*)state)[0] = __ldg(&outputHash[thread]); - ((uint2*)state)[1] = __ldg(&outputHash[thread + threads]); - ((uint2*)state)[2] = __ldg(&outputHash[thread + 2 * threads]); - ((uint2*)state)[3] = __ldg(&outputHash[thread + 3 * threads]); - - state[1] = state[0]; - state[2] = shuffle4(((vectype*)blake2b_IV)[0], 0); - state[3] = shuffle4(((vectype*)blake2b_IV)[1], 0); - - for (int i = 0; i<12; i++) - round_lyra_v35(state); - - state[0] ^= shuffle4(((vectype*)padding)[0], 0); - state[1] ^= shuffle4(((vectype*)padding)[1], 0); - - for (int i = 0; i<12; i++) - round_lyra_v35(state); - - uint32_t ps1 = (4 * memshift * 3 + 16 * memshift * thread); - - //#pragma unroll 4 - for (int i = 0; i < 4; i++) - { - uint32_t s1 = ps1 - 4 * memshift * i; - for (int j = 0; j < 3; j++) - (DMatrix + s1)[j] = (state)[j]; - - round_lyra_v35(state); - } - - reduceDuplexV3(state, thread); - reduceDuplexRowSetupV3(1, 0, 2, state, thread); - reduceDuplexRowSetupV3(2, 1, 3, state, thread); - - uint32_t rowa; - int prev = 3; - for (int i = 0; i < 4; i++) - { - rowa = ((uint2*)state)[0].x & 3; reduceDuplexRowtV3(prev, rowa, i, state, thread); - prev = i; - } - - uint32_t shift = (memshift * rowa + 16 * memshift * thread); - - for (int j = 0; j < 3; j++) - state[j] ^= __ldg4(&(DMatrix + shift)[j]); - - for (int i = 0; i < 12; i++) - round_lyra_v35(state); - - outputHash[thread] = ((uint2*)state)[0]; - outputHash[thread + threads] = ((uint2*)state)[1]; - outputHash[thread + 2 * threads] = ((uint2*)state)[2]; - outputHash[thread + 3 * threads] = ((uint2*)state)[3]; - - } //thread -} -#elif __CUDA_ARCH__ >= 200 -__global__ __launch_bounds__(TPB20, 1) -void lyra2v2_gpu_hash_32_v3(uint32_t threads, uint32_t startNounce, uint2 *outputHash) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - - vectype state[4]; - vectype blake2b_IV[2]; - vectype padding[2]; - - ((uint16*)blake2b_IV)[0] = make_uint16( - 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, - 0xfe94f82b, 0x3c6ef372, 0x5f1d36f1, 0xa54ff53a, - 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c, - 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19 - ); - ((uint16*)padding)[0] = make_uint16( - 0x20, 0x0, 0x20, 0x0, 0x20, 0x0, 0x01, 0x0, - 0x04, 0x0, 0x04, 0x0, 0x80, 0x0, 0x0, 0x01000000 - ); - - if (thread < threads) - { - - ((uint2*)state)[0] = outputHash[thread]; - ((uint2*)state)[1] = outputHash[thread + threads]; - ((uint2*)state)[2] = outputHash[thread + 2 * threads]; - ((uint2*)state)[3] = outputHash[thread + 3 * threads]; - - state[1] = state[0]; - state[2] = ((vectype*)blake2b_IV)[0]; - state[3] = ((vectype*)blake2b_IV)[1]; - - for (int i = 0; i<12; i++) - round_lyra_v35(state); - - state[0] ^= ((vectype*)padding)[0]; - state[1] ^= ((vectype*)padding)[1]; - - for (int i = 0; i<12; i++) - round_lyra_v35(state); - - uint32_t ps1 = (4 * memshift * 3 + 16 * memshift * thread); - - //#pragma unroll 4 - for (int i = 0; i < 4; i++) - { - uint32_t s1 = ps1 - 4 * memshift * i; - for (int j = 0; j < 3; j++) - (DMatrix + s1)[j] = (state)[j]; - - round_lyra_v35(state); - } - - reduceDuplexV3(state, thread); - reduceDuplexRowSetupV3(1, 0, 2, state, thread); - reduceDuplexRowSetupV3(2, 1, 3, state, thread); - - uint32_t rowa; - int prev = 3; - for (int i = 0; i < 4; i++) - { - rowa = ((uint2*)state)[0].x & 3; reduceDuplexRowtV3(prev, rowa, i, state, thread); - prev = i; - } - - uint32_t shift = (memshift * rowa + 16 * memshift * thread); - - for (int j = 0; j < 3; j++) - state[j] ^= __ldg4(&(DMatrix + shift)[j]); - - for (int i = 0; i < 12; i++) - round_lyra_v35(state); - - outputHash[thread] = ((uint2*)state)[0]; - outputHash[thread + threads] = ((uint2*)state)[1]; - outputHash[thread + 2 * threads] = ((uint2*)state)[2]; - outputHash[thread + 3 * threads] = ((uint2*)state)[3]; - - } //thread -} -#endif - -#else -/* host & sm5+ */ -__global__ void lyra2v2_gpu_hash_32_v3(uint32_t threads, uint32_t startNounce, uint2 *outputHash) {} -#endif diff --git a/lyra2/lyra2RE.cu b/lyra2/lyra2RE.cu deleted file mode 100644 index b3ad49f1..00000000 --- a/lyra2/lyra2RE.cu +++ /dev/null @@ -1,200 +0,0 @@ -extern "C" { -#include "sph/sph_blake.h" -#include "sph/sph_groestl.h" -#include "sph/sph_skein.h" -#include "sph/sph_keccak.h" -#include "lyra2/Lyra2.h" -} - -#include -#include - -static uint64_t* d_hash[MAX_GPUS]; -static uint64_t* d_matrix[MAX_GPUS]; - -extern void blake256_cpu_init(int thr_id, uint32_t threads); -extern void blake256_cpu_setBlock_80(uint32_t *pdata); -//extern void blake256_cpu_hash_80(const int thr_id, const uint32_t threads, const uint32_t startNonce, uint64_t *Hash, int order); - -//extern void keccak256_sm3_hash_32(int thr_id, uint32_t threads, uint32_t startNonce, uint64_t *d_outputHash, int order); -//extern void keccak256_sm3_init(int thr_id, uint32_t threads); -//extern void keccak256_sm3_free(int thr_id); - -extern void blakeKeccak256_cpu_hash_80(const int thr_id, const uint32_t threads, const uint32_t startNonce, uint64_t *Hash, int order); - -extern void skein256_cpu_hash_32(int thr_id, uint32_t threads, uint32_t startNonce, uint64_t *d_outputHash, int order); -extern void skein256_cpu_init(int thr_id, uint32_t threads); - -extern void lyra2_cpu_init(int thr_id, uint32_t threads, uint64_t *d_matrix); -extern void lyra2_cpu_hash_32(int thr_id, uint32_t threads, uint32_t startNonce, uint64_t *d_outputHash, bool gtx750ti); - -extern void groestl256_cpu_init(int thr_id, uint32_t threads); -extern void groestl256_cpu_free(int thr_id); -extern void groestl256_setTarget(const void *ptarget); -extern uint32_t groestl256_cpu_hash_32(int thr_id, uint32_t threads, uint32_t startNounce, uint64_t *d_outputHash, int order); -extern uint32_t groestl256_getSecNonce(int thr_id, int num); - - -extern "C" void lyra2re_hash(void *state, const void *input) -{ - uint32_t hashA[8], hashB[8]; - - sph_blake256_context ctx_blake; - sph_keccak256_context ctx_keccak; - sph_skein256_context ctx_skein; - sph_groestl256_context ctx_groestl; - - sph_blake256_set_rounds(14); - - sph_blake256_init(&ctx_blake); - sph_blake256(&ctx_blake, input, 80); - sph_blake256_close(&ctx_blake, hashA); - - sph_keccak256_init(&ctx_keccak); - sph_keccak256(&ctx_keccak, hashA, 32); - sph_keccak256_close(&ctx_keccak, hashB); - - LYRA2(hashA, 32, hashB, 32, hashB, 32, 1, 8, 8); - - sph_skein256_init(&ctx_skein); - sph_skein256(&ctx_skein, hashA, 32); - sph_skein256_close(&ctx_skein, hashB); - - sph_groestl256_init(&ctx_groestl); - sph_groestl256(&ctx_groestl, hashB, 32); - sph_groestl256_close(&ctx_groestl, hashA); - - memcpy(state, hashA, 32); -} - -static bool init[MAX_GPUS] = { 0 }; -static __thread uint32_t throughput = 0; - -extern "C" int scanhash_lyra2(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - - if (opt_benchmark) - ptarget[7] = 0x00ff; - - static __thread bool gtx750ti; - if (!init[thr_id]) - { - int dev_id = device_map[thr_id]; - cudaSetDevice(dev_id); - CUDA_LOG_ERROR(); - - int intensity = (device_sm[dev_id] >= 500 && !is_windows()) ? 17 : 16; - if (device_sm[device_map[thr_id]] == 500) intensity = 15; - throughput = cuda_default_throughput(thr_id, 1U << intensity); // 18=256*256*4; - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - cudaDeviceProp props; - cudaGetDeviceProperties(&props, dev_id); - - if (strstr(props.name, "750 Ti")) gtx750ti = true; - else gtx750ti = false; - - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - blake256_cpu_init(thr_id, throughput); - //keccak256_sm3_init(thr_id, throughput); - skein256_cpu_init(thr_id, throughput); - groestl256_cpu_init(thr_id, throughput); - - //cuda_get_arch(thr_id); - if (device_sm[dev_id] >= 500) - { - size_t matrix_sz = device_sm[dev_id] > 500 ? sizeof(uint64_t) * 4 * 4 : sizeof(uint64_t) * 8 * 8 * 3 * 4; - CUDA_SAFE_CALL(cudaMalloc(&d_matrix[thr_id], matrix_sz * throughput)); - lyra2_cpu_init(thr_id, throughput, d_matrix[thr_id]); - } - - CUDA_SAFE_CALL(cudaMalloc(&d_hash[thr_id], (size_t)32 * throughput)); - - init[thr_id] = true; - } - - uint32_t _ALIGN(128) endiandata[20]; - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - blake256_cpu_setBlock_80(pdata); - groestl256_setTarget(ptarget); - - do { - int order = 0; - - //blake256_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - //keccak256_sm3_hash_32(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - blakeKeccak256_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - lyra2_cpu_hash_32(thr_id, throughput, pdata[19], d_hash[thr_id], gtx750ti); - skein256_cpu_hash_32(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - - *hashes_done = pdata[19] - first_nonce + throughput; - - work->nonces[0] = groestl256_cpu_hash_32(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - - be32enc(&endiandata[19], work->nonces[0]); - lyra2re_hash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - work->nonces[1] = groestl256_getSecNonce(thr_id, 1); - if (work->nonces[1] != UINT32_MAX) { - be32enc(&endiandata[19], work->nonces[1]); - lyra2re_hash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t)throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - return 0; -} - -// cleanup -extern "C" void free_lyra2(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - cudaFree(d_matrix[thr_id]); - - //keccak256_sm3_free(thr_id); - groestl256_cpu_free(thr_id); - - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/lyra2/lyra2REv2.cu b/lyra2/lyra2REv2.cu deleted file mode 100644 index 715f311e..00000000 --- a/lyra2/lyra2REv2.cu +++ /dev/null @@ -1,209 +0,0 @@ -extern "C" { -#include "sph/sph_blake.h" -#include "sph/sph_bmw.h" -#include "sph/sph_skein.h" -#include "sph/sph_keccak.h" -#include "sph/sph_cubehash.h" -#include "lyra2/Lyra2.h" -} - -#include -#include - -static uint64_t *d_hash[MAX_GPUS]; -static uint64_t* d_matrix[MAX_GPUS]; - -extern void blake256_cpu_init(int thr_id, uint32_t threads); -extern void blake256_cpu_setBlock_80(uint32_t *pdata); -//extern void blake256_cpu_hash_80(const int thr_id, const uint32_t threads, const uint32_t startNonce, uint64_t *Hash, int order); - -//extern void keccak256_sm3_hash_32(int thr_id, uint32_t threads, uint32_t startNonce, uint64_t *d_outputHash, int order); -//extern void keccak256_sm3_init(int thr_id, uint32_t threads); -//extern void keccak256_sm3_free(int thr_id); - -extern void blakeKeccak256_cpu_hash_80(const int thr_id, const uint32_t threads, const uint32_t startNonce, uint64_t *Hash, int order); - -extern void skein256_cpu_hash_32(int thr_id, uint32_t threads, uint32_t startNonce, uint64_t *d_outputHash, int order); -extern void skein256_cpu_init(int thr_id, uint32_t threads); -extern void cubehash256_cpu_hash_32(int thr_id, uint32_t threads, uint32_t startNounce, uint64_t *d_hash, int order); - -extern void lyra2v2_cpu_hash_32(int thr_id, uint32_t threads, uint32_t startNonce, uint64_t *d_outputHash, int order); -extern void lyra2v2_cpu_init(int thr_id, uint32_t threads, uint64_t* d_matrix); - -extern void bmw256_setTarget(const void *ptarget); -extern void bmw256_cpu_init(int thr_id, uint32_t threads); -extern void bmw256_cpu_free(int thr_id); -extern void bmw256_cpu_hash_32(int thr_id, uint32_t threads, uint32_t startNounce, uint64_t *g_hash, uint32_t *resultnonces); - -void lyra2v2_hash(void *state, const void *input) -{ - uint32_t hashA[8], hashB[8]; - - sph_blake256_context ctx_blake; - sph_keccak256_context ctx_keccak; - sph_skein256_context ctx_skein; - sph_bmw256_context ctx_bmw; - sph_cubehash256_context ctx_cube; - - sph_blake256_set_rounds(14); - - sph_blake256_init(&ctx_blake); - sph_blake256(&ctx_blake, input, 80); - sph_blake256_close(&ctx_blake, hashA); - - sph_keccak256_init(&ctx_keccak); - sph_keccak256(&ctx_keccak, hashA, 32); - sph_keccak256_close(&ctx_keccak, hashB); - - sph_cubehash256_init(&ctx_cube); - sph_cubehash256(&ctx_cube, hashB, 32); - sph_cubehash256_close(&ctx_cube, hashA); - - LYRA2(hashB, 32, hashA, 32, hashA, 32, 1, 4, 4); - - sph_skein256_init(&ctx_skein); - sph_skein256(&ctx_skein, hashB, 32); - sph_skein256_close(&ctx_skein, hashA); - - sph_cubehash256_init(&ctx_cube); - sph_cubehash256(&ctx_cube, hashA, 32); - sph_cubehash256_close(&ctx_cube, hashB); - - sph_bmw256_init(&ctx_bmw); - sph_bmw256(&ctx_bmw, hashB, 32); - sph_bmw256_close(&ctx_bmw, hashA); - - memcpy(state, hashA, 32); -} - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_lyra2v2(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - int dev_id = device_map[thr_id]; - int intensity = (device_sm[dev_id] < 500) ? 18 : is_windows() ? 19 : 20; - if (strstr(device_name[dev_id], "GTX 10")) intensity = 20; - uint32_t throughput = cuda_default_throughput(dev_id, 1UL << intensity); - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ptarget[7] = 0x000f; - - if (!init[thr_id]) - { - size_t matrix_sz = 16 * sizeof(uint64_t) * 4 * 3; - cudaSetDevice(dev_id); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - blake256_cpu_init(thr_id, throughput); - //keccak256_sm3_init(thr_id,throughput); - skein256_cpu_init(thr_id, throughput); - bmw256_cpu_init(thr_id, throughput); - - cuda_get_arch(thr_id); // cuda_arch[] also used in cubehash256 - - // SM 3 implentation requires a bit more memory - if (device_sm[dev_id] < 500 || cuda_arch[dev_id] < 500) - matrix_sz = 16 * sizeof(uint64_t) * 4 * 4; - - CUDA_SAFE_CALL(cudaMalloc(&d_matrix[thr_id], matrix_sz * throughput)); - lyra2v2_cpu_init(thr_id, throughput, d_matrix[thr_id]); - - CUDA_SAFE_CALL(cudaMalloc(&d_hash[thr_id], (size_t)32 * throughput)); - - api_set_throughput(thr_id, throughput); - init[thr_id] = true; - } - - uint32_t endiandata[20]; - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - blake256_cpu_setBlock_80(pdata); - bmw256_setTarget(ptarget); - - do { - int order = 0; - - //blake256_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - //keccak256_sm3_hash_32(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - blakeKeccak256_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - cubehash256_cpu_hash_32(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - lyra2v2_cpu_hash_32(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - skein256_cpu_hash_32(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - cubehash256_cpu_hash_32(thr_id, throughput,pdata[19], d_hash[thr_id], order++); - - memset(work->nonces, 0, sizeof(work->nonces)); - bmw256_cpu_hash_32(thr_id, throughput, pdata[19], d_hash[thr_id], work->nonces); - - *hashes_done = pdata[19] - first_nonce + throughput; - - if (work->nonces[0] != 0) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - be32enc(&endiandata[19], work->nonces[0]); - lyra2v2_hash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - lyra2v2_hash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t)throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart && !abort_flag); - - *hashes_done = pdata[19] - first_nonce; - return 0; -} - -// cleanup -extern "C" void free_lyra2v2(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - cudaFree(d_matrix[thr_id]); - - bmw256_cpu_free(thr_id); - //keccak256_sm3_free(thr_id); - - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/lyra2/lyra2Z.cu b/lyra2/lyra2Z.cu deleted file mode 100644 index 7d84b3c6..00000000 --- a/lyra2/lyra2Z.cu +++ /dev/null @@ -1,168 +0,0 @@ -extern "C" { -#include -#include "Lyra2Z.h" -} - -#include -#include - -static uint64_t* d_hash[MAX_GPUS]; -static uint64_t* d_matrix[MAX_GPUS]; - -extern void blake256_cpu_init(int thr_id, uint32_t threads); -extern void blake256_cpu_hash_80(const int thr_id, const uint32_t threads, const uint32_t startNonce, uint64_t *Hash, int order); -extern void blake256_cpu_setBlock_80(uint32_t *pdata); - -extern void lyra2Z_cpu_init(int thr_id, uint32_t threads, uint64_t *d_matrix); -extern void lyra2Z_cpu_init_sm2(int thr_id, uint32_t threads); -extern void lyra2Z_cpu_free(int thr_id); -extern uint32_t lyra2Z_cpu_hash_32(int thr_id, uint32_t threads, uint32_t startNonce, uint64_t *d_outputHash, bool gtx750ti); - -extern void lyra2Z_setTarget(const void *ptarget); -extern uint32_t lyra2Z_getSecNonce(int thr_id, int num); - -extern "C" void lyra2Z_hash(void *state, const void *input) -{ - uint32_t _ALIGN(64) hashA[8], hashB[8]; - sph_blake256_context ctx_blake; - - sph_blake256_set_rounds(14); - sph_blake256_init(&ctx_blake); - sph_blake256(&ctx_blake, input, 80); - sph_blake256_close(&ctx_blake, hashA); - - LYRA2Z(hashB, 32, hashA, 32, hashA, 32, 8, 8, 8); - - memcpy(state, hashB, 32); -} - -static bool init[MAX_GPUS] = { 0 }; -static __thread uint32_t throughput = 0; -static __thread bool gtx750ti = false; - -extern "C" int scanhash_lyra2Z(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - uint32_t _ALIGN(64) endiandata[20]; - const uint32_t first_nonce = pdata[19]; - int dev_id = device_map[thr_id]; - - if (opt_benchmark) - ptarget[7] = 0x00ff; - - if (!init[thr_id]) - { - cudaSetDevice(dev_id); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - - cuda_get_arch(thr_id); - int intensity = (device_sm[dev_id] > 500 && !is_windows()) ? 17 : 16; - if (device_sm[dev_id] <= 500) intensity = 15; - throughput = cuda_default_throughput(thr_id, 1U << intensity); // 18=256*256*4; - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - cudaDeviceProp props; - cudaGetDeviceProperties(&props, dev_id); - gtx750ti = (strstr(props.name, "750 Ti") != NULL); - - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - blake256_cpu_init(thr_id, throughput); - - if (device_sm[dev_id] >= 350) - { - size_t matrix_sz = device_sm[dev_id] > 500 ? sizeof(uint64_t) * 4 * 4 : sizeof(uint64_t) * 8 * 8 * 3 * 4; - CUDA_SAFE_CALL(cudaMalloc(&d_matrix[thr_id], matrix_sz * throughput)); - lyra2Z_cpu_init(thr_id, throughput, d_matrix[thr_id]); - } - else - lyra2Z_cpu_init_sm2(thr_id, throughput); - - CUDA_SAFE_CALL(cudaMalloc(&d_hash[thr_id], (size_t)32 * throughput)); - - init[thr_id] = true; - } - - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - blake256_cpu_setBlock_80(pdata); - lyra2Z_setTarget(ptarget); - - do { - int order = 0; - - blake256_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - - *hashes_done = pdata[19] - first_nonce + throughput; - - work->nonces[0] = lyra2Z_cpu_hash_32(thr_id, throughput, pdata[19], d_hash[thr_id], gtx750ti); - - if (work->nonces[0] != UINT32_MAX) - { - uint32_t _ALIGN(64) vhash[8]; - - be32enc(&endiandata[19], work->nonces[0]); - lyra2Z_hash(vhash, endiandata); - - if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work->nonces[1] = lyra2Z_getSecNonce(thr_id, 1); - work_set_target_ratio(work, vhash); - pdata[19] = work->nonces[0] + 1; - if (work->nonces[1] != UINT32_MAX) - { - be32enc(&endiandata[19], work->nonces[1]); - lyra2Z_hash(vhash, endiandata); - if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - } - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > ptarget[7]) { - gpu_increment_reject(thr_id); - if (!opt_quiet) gpulog(LOG_WARNING, thr_id, - "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0]; - continue; - } - } - - if ((uint64_t)throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - return 0; -} - -// cleanup -extern "C" void free_lyra2Z(int thr_id) -{ - int dev_id = device_map[thr_id]; - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - if (device_sm[dev_id] >= 350) - cudaFree(d_matrix[thr_id]); - lyra2Z_cpu_free(thr_id); - - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/miner.h b/miner.h index e7f661b3..7912b9e1 100644 --- a/miner.h +++ b/miner.h @@ -553,7 +553,6 @@ extern int api_thr_id; extern volatile bool abort_flag; extern struct work_restart *work_restart; extern bool opt_trust_pool; -extern uint16_t opt_vote; extern uint64_t global_hashrate; extern uint64_t net_hashrate; @@ -697,7 +696,6 @@ struct stratum_ctx { time_t tm_connected; int rpc2; - int is_equihash; int srvtime_diff; }; @@ -831,15 +829,6 @@ void stratum_free_job(struct stratum_ctx *sctx); bool rpc2_stratum_authorize(struct stratum_ctx *sctx, const char *user, const char *pass); -bool equi_stratum_notify(struct stratum_ctx *sctx, json_t *params); -bool equi_stratum_set_target(struct stratum_ctx *sctx, json_t *params); -bool equi_stratum_submit(struct pool_infos *pool, struct work *work); -bool equi_stratum_show_message(struct stratum_ctx *sctx, json_t *id, json_t *params); -void equi_work_set_target(struct work* work, double diff); -void equi_store_work_solution(struct work* work, uint32_t* hash, void* sol_data); -int equi_verify_sol(void * const hdr, void * const sol); -double equi_network_diff(struct work *work); - void hashlog_remember_submit(struct work* work, uint32_t nonce); void hashlog_remember_scan_range(struct work* work); double hashlog_get_sharediff(char* jobid, int idnonce, double defvalue); @@ -892,64 +881,8 @@ void applog_hash64(void *hash); void applog_compare_hash(void *hash, void *hash_ref); void print_hash_tests(void); -void bastionhash(void* output, const unsigned char* input); -void blake256hash(void *output, const void *input, int8_t rounds); -void blake2b_hash(void *output, const void *input); -void blake2s_hash(void *output, const void *input); -void bmw_hash(void *state, const void *input); -void c11hash(void *output, const void *input); -void cryptolight_hash(void* output, const void* input, int len); -void cryptonight_hash(void* output, const void* input, size_t len); -void decred_hash(void *state, const void *input); -void deephash(void *state, const void *input); -void luffa_hash(void *state, const void *input); -void fresh_hash(void *state, const void *input); -void fugue256_hash(unsigned char* output, const unsigned char* input, int len); -void heavycoin_hash(unsigned char* output, const unsigned char* input, int len); -void hmq17hash(void *output, const void *input); -void hsr_hash(void *output, const void *input); void keccak256_hash(void *state, const void *input); -void jackpothash(void *state, const void *input); -void groestlhash(void *state, const void *input); -void jha_hash(void *output, const void *input); -void lbry_hash(void *output, const void *input); -void lyra2re_hash(void *state, const void *input); -void lyra2v2_hash(void *state, const void *input); -void lyra2Z_hash(void *state, const void *input); -void myriadhash(void *state, const void *input); -void neoscrypt(uchar *output, const uchar *input, uint32_t profile); -void nist5hash(void *state, const void *input); -void pentablakehash(void *output, const void *input); -void phihash(void *output, const void *input); -void polytimos_hash(void *output, const void *input); -void quarkhash(void *state, const void *input); -void qubithash(void *state, const void *input); -void scrypthash(void* output, const void* input); -void scryptjane_hash(void* output, const void* input); void sha256d_hash(void *output, const void *input); -void sha256t_hash(void *output, const void *input); -void sibhash(void *output, const void *input); -void skeincoinhash(void *output, const void *input); -void skein2hash(void *output, const void *input); -void skunk_hash(void *state, const void *input); -void s3hash(void *output, const void *input); -void timetravel_hash(void *output, const void *input); -void bitcore_hash(void *output, const void *input); -void tribus_hash(void *output, const void *input); -void veltorhash(void *output, const void *input); -void wcoinhash(void *state, const void *input); -void whirlxHash(void *state, const void *input); -void x11evo_hash(void *output, const void *input); -void x11hash(void *output, const void *input); -void x13hash(void *output, const void *input); -void x14hash(void *output, const void *input); -void x15hash(void *output, const void *input); -void x16r_hash(void *output, const void *input); -void x16s_hash(void *output, const void *input); -void x17hash(void *output, const void *input); -void wildkeccak_hash(void *output, const void *input, uint64_t* scratchpad, uint64_t ssize); -void zr5hash(void *output, const void *input); -void zr5hash_pok(void *output, uint32_t *pdata); #ifdef __cplusplus } diff --git a/myriadgroestl.cpp b/myriadgroestl.cpp deleted file mode 100644 index 77ac593f..00000000 --- a/myriadgroestl.cpp +++ /dev/null @@ -1,130 +0,0 @@ -#include -#include -#include -#include - -#include "sph/sph_groestl.h" - -#include "miner.h" - -void myriadgroestl_cpu_init(int thr_id, uint32_t threads); -void myriadgroestl_cpu_free(int thr_id); -void myriadgroestl_cpu_setBlock(int thr_id, void *data, uint32_t *target); -void myriadgroestl_cpu_hash(int thr_id, uint32_t threads, uint32_t startNonce, uint32_t *resNonces); - -void myriadhash(void *state, const void *input) -{ - uint32_t _ALIGN(64) hash[16]; - sph_groestl512_context ctx_groestl; - SHA256_CTX sha256; - - sph_groestl512_init(&ctx_groestl); - sph_groestl512(&ctx_groestl, input, 80); - sph_groestl512_close(&ctx_groestl, hash); - - SHA256_Init(&sha256); - SHA256_Update(&sha256,(unsigned char *)hash, 64); - SHA256_Final((unsigned char *)hash, &sha256); - - memcpy(state, hash, 32); -} - -static bool init[MAX_GPUS] = { 0 }; - -int scanhash_myriad(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t _ALIGN(64) endiandata[32]; - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - uint32_t start_nonce = pdata[19]; - int dev_id = device_map[thr_id]; - int intensity = (device_sm[dev_id] >= 600) ? 20 : 18; - uint32_t throughput = cuda_default_throughput(thr_id, 1U << intensity); - if (init[thr_id]) throughput = min(throughput, max_nonce - start_nonce); - - if (opt_benchmark) - ptarget[7] = 0x0000ff; - - // init - if(!init[thr_id]) - { - cudaSetDevice(dev_id); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - myriadgroestl_cpu_init(thr_id, throughput); - init[thr_id] = true; - } - - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - myriadgroestl_cpu_setBlock(thr_id, endiandata, ptarget); - - do { - memset(work->nonces, 0xff, sizeof(work->nonces)); - - // GPU - myriadgroestl_cpu_hash(thr_id, throughput, pdata[19], work->nonces); - - *hashes_done = pdata[19] - start_nonce + throughput; - - if (work->nonces[0] < UINT32_MAX && bench_algo < 0) - { - uint32_t _ALIGN(64) vhash[8]; - endiandata[19] = swab32(work->nonces[0]); - myriadhash(vhash, endiandata); - if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - if (work->nonces[1] != UINT32_MAX) { - endiandata[19] = swab32(work->nonces[1]); - myriadhash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces = 2; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > ptarget[7]) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = max_nonce - start_nonce; - - return 0; -} - -// cleanup -void free_myriad(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - myriadgroestl_cpu_free(thr_id); - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/neoscrypt/cuda_neoscrypt.cu b/neoscrypt/cuda_neoscrypt.cu deleted file mode 100644 index 9ea3b756..00000000 --- a/neoscrypt/cuda_neoscrypt.cu +++ /dev/null @@ -1,1552 +0,0 @@ -// originally from djm34 - github.com/djm34/ccminer-sp-neoscrypt -// kernel code from Nanashi Meiyo-Meijin 1.7.6-r10 (July 2016) - -#include -#include - -#include -#include -#include "cuda_vectors.h" - -typedef uint48 uint4x2; - -#include "miner.h" - -#ifdef __INTELLISENSE__ -#define __CUDA_ARCH__ 500 -#define __byte_perm(x,y,c) x -#define __shfl(x,y,c) x -#define atomicExch(p,x) x -#endif - -static uint32_t* d_NNonce[MAX_GPUS]; - -__device__ uint2x4* W; -__device__ uint2x4* Tr; -__device__ uint2x4* Tr2; -__device__ uint2x4* Input; - -__constant__ uint32_t c_data[64]; -__constant__ uint32_t c_target[2]; -__constant__ uint32_t key_init[16]; -__constant__ uint32_t input_init[16]; - -static const __constant__ uint8 BLAKE2S_IV_Vec = { - 0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, - 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19 -}; - -static const uint8 BLAKE2S_IV_Vechost = { - 0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, - 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19 -}; - -static const uint32_t BLAKE2S_SIGMA_host[10][16] = { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, - { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 }, - { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 }, - { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 }, - { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 }, - { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 }, -}; - -__constant__ uint32_t BLAKE2S_SIGMA[10][16] = { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, - { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 }, - { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 }, - { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 }, - { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 }, - { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 }, -}; - -#define BLOCK_SIZE 64U -#define BLAKE2S_BLOCK_SIZE 64U -#define BLAKE2S_OUT_SIZE 32U - -#define SALSA(a,b,c,d) { \ - t = rotateL(a+d, 7U); b ^= t; \ - t = rotateL(b+a, 9U); c ^= t; \ - t = rotateL(c+b, 13U); d ^= t; \ - t = rotateL(d+c, 18U); a ^= t; \ -} - -#define shf_r_clamp32(out,a,b,shift) \ - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(out) : "r"(a), "r"(b), "r"(shift)); - -#if __CUDA_ARCH__ >= 300 -__device__ __forceinline__ uint32_t WarpShuffle(uint32_t a, uint32_t b, uint32_t c) -{ - return __shfl(a, b, c); -} - -__device__ __forceinline__ void WarpShuffle3(uint32_t &a1, uint32_t &a2, uint32_t &a3, uint32_t b1, uint32_t b2, uint32_t b3, uint32_t c) -{ - a1 = WarpShuffle(a1, b1, c); - a2 = WarpShuffle(a2, b2, c); - a3 = WarpShuffle(a3, b3, c); -} - -#else -__device__ __forceinline__ uint32_t WarpShuffle(uint32_t a, uint32_t b, uint32_t c) -{ - __shared__ uint32_t shared_mem[32]; - - const uint32_t thread = blockDim.x * threadIdx.y + threadIdx.x; - - shared_mem[thread] = a; - __threadfence_block(); - - uint32_t result = shared_mem[(thread&~(c - 1)) + (b&(c - 1))]; - __threadfence_block(); - - return result; -} - -__device__ __forceinline__ void WarpShuffle3(uint32_t &a1, uint32_t &a2, uint32_t &a3, uint32_t b1, uint32_t b2, uint32_t b3, uint32_t c) -{ - __shared__ uint32_t shared_mem[32]; - - const uint32_t thread = blockDim.x * threadIdx.y + threadIdx.x; - - shared_mem[thread] = a1; - __threadfence_block(); - - a1 = shared_mem[(thread&~(c - 1)) + (b1&(c - 1))]; - __threadfence_block(); - - shared_mem[thread] = a2; - __threadfence_block(); - - a2 = shared_mem[(thread&~(c - 1)) + (b2&(c - 1))]; - __threadfence_block(); - - shared_mem[thread] = a3; - __threadfence_block(); - - a3 = shared_mem[(thread&~(c - 1)) + (b3&(c - 1))]; - __threadfence_block(); -} - -#endif - -#define CHACHA_STEP(a,b,c,d) { \ - a += b; d = __byte_perm(d^a, 0, 0x1032); \ - c += d; b = rotateL(b^c, 12); \ - a += b; d = __byte_perm(d^a, 0, 0x2103); \ - c += d; b = rotateL(b^c, 7); \ -} - -#if __CUDA_ARCH__ < 500 - -__device__ __forceinline__ -static void shift256R4(uint32_t* ret, const uint8 &vec4, const uint32_t shift2) -{ -#if __CUDA_ARCH__ >= 320 - uint32_t shift = 32U - shift2; - asm("shf.r.clamp.b32 %0, 0, %1, %2;" : "=r"(ret[0]) : "r"(vec4.s0), "r"(shift)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(ret[1]) : "r"(vec4.s0), "r"(vec4.s1), "r"(shift)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(ret[2]) : "r"(vec4.s1), "r"(vec4.s2), "r"(shift)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(ret[3]) : "r"(vec4.s2), "r"(vec4.s3), "r"(shift)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(ret[4]) : "r"(vec4.s3), "r"(vec4.s4), "r"(shift)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(ret[5]) : "r"(vec4.s4), "r"(vec4.s5), "r"(shift)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(ret[6]) : "r"(vec4.s5), "r"(vec4.s6), "r"(shift)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(ret[7]) : "r"(vec4.s6), "r"(vec4.s7), "r"(shift)); - asm("shr.b32 %0, %1, %2;" : "=r"(ret[8]) : "r"(vec4.s7), "r"(shift)); -#else - // to check - shift256R(ret, vec4, shift2); -#endif -} - -#define BLAKE(a, b, c, d, key1, key2) { \ - a += key1; \ - a += b; d = rotateL(d^a, 16); \ - c += d; b = rotateR(b^c, 12); \ - a += key2; \ - a += b; d = rotateR(d^a, 8); \ - c += d; b = rotateR(b^c, 7); \ -} - -#define BLAKE_G(idx0, idx1, a, b, c, d, key) { \ - idx = BLAKE2S_SIGMA[idx0][idx1]; a += key[idx]; \ - a += b; d = rotateL(d^a, 16); \ - c += d; b = rotateR(b^c, 12); \ - idx = BLAKE2S_SIGMA[idx0][idx1+1]; a += key[idx]; \ - a += b; d = rotateR(d^a, 8); \ - c += d; b = rotateR(b^c, 7); \ -} - -#define BLAKE_G_PRE(idx0, idx1, a, b, c, d, key) { \ - a += key[idx0]; \ - a += b; d = rotateL(d^a, 16); \ - c += d; b = rotateR(b^c, 12); \ - a += key[idx1]; \ - a += b; d = rotateR(d^a, 8); \ - c += d; b = rotateR(b^c, 7); \ -} - -#define BLAKE_G_PRE0(idx0, idx1, a, b, c, d, key) { \ - a += b; d = rotateL(d^a, 16); \ - c += d; b = rotateR(b^c, 12); \ - a += b; d = rotateR(d^a, 8); \ - c += d; b = rotateR(b^c, 7); \ -} - -#define BLAKE_G_PRE1(idx0, idx1, a, b, c, d, key) { \ - a += key[idx0]; \ - a += b; d = rotateL(d^a, 16); \ - c += d; b = rotateR(b^c, 12); \ - a += b; d = rotateR(d^a, 8); \ - c += d; b = rotateR(b^c, 7); \ -} - -#define BLAKE_G_PRE2(idx0, idx1, a, b, c, d, key) { \ - a += b; d = rotateL(d^a, 16); \ - c += d; b = rotateR(b^c, 12); \ - a += key[idx1]; \ - a += b; d = rotateR(d^a, 8); \ - c += d; b = rotateR(b^c, 7); \ -} - -static __forceinline__ __device__ -void Blake2S(uint32_t *out, const uint32_t* const __restrict__ inout, const uint32_t * const __restrict__ TheKey) -{ - uint16 V; - uint32_t idx; - uint8 tmpblock; - - V.hi = BLAKE2S_IV_Vec; - V.lo = BLAKE2S_IV_Vec; - V.lo.s0 ^= 0x01012020; - - // Copy input block for later - tmpblock = V.lo; - - V.hi.s4 ^= BLAKE2S_BLOCK_SIZE; - - // { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - BLAKE_G_PRE(0, 1, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, TheKey); - BLAKE_G_PRE(2, 3, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, TheKey); - BLAKE_G_PRE(4, 5, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, TheKey); - BLAKE_G_PRE(6, 7, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, TheKey); - BLAKE_G_PRE0(8, 9, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, TheKey); - BLAKE_G_PRE0(10, 11, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, TheKey); - BLAKE_G_PRE0(12, 13, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, TheKey); - BLAKE_G_PRE0(14, 15, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, TheKey); - // { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - BLAKE_G_PRE0(14, 10, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, TheKey); - BLAKE_G_PRE1(4, 8, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, TheKey); - BLAKE_G_PRE0(9, 15, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, TheKey); - BLAKE_G_PRE2(13, 6, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, TheKey); - BLAKE_G_PRE1(1, 12, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, TheKey); - BLAKE_G_PRE(0, 2, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, TheKey); - BLAKE_G_PRE2(11, 7, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, TheKey); - BLAKE_G_PRE(5, 3, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, TheKey); - // { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - BLAKE_G_PRE0(11, 8, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, TheKey); - BLAKE_G_PRE2(12, 0, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, TheKey); - BLAKE_G_PRE(5, 2, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, TheKey); - BLAKE_G_PRE0(15, 13, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, TheKey); - BLAKE_G_PRE0(10, 14, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, TheKey); - BLAKE_G_PRE(3, 6, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, TheKey); - BLAKE_G_PRE(7, 1, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, TheKey); - BLAKE_G_PRE2(9, 4, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, TheKey); - // { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - BLAKE_G_PRE1(7, 9, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, TheKey); - BLAKE_G_PRE(3, 1, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, TheKey); - BLAKE_G_PRE0(13, 12, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, TheKey); - BLAKE_G_PRE0(11, 14, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, TheKey); - BLAKE_G_PRE(2, 6, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, TheKey); - BLAKE_G_PRE1(5, 10, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, TheKey); - BLAKE_G_PRE(4, 0, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, TheKey); - BLAKE_G_PRE0(15, 8, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, TheKey); - // { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, - BLAKE_G_PRE2(9, 0, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, TheKey); - BLAKE_G_PRE(5, 7, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, TheKey); - BLAKE_G_PRE(2, 4, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, TheKey); - BLAKE_G_PRE0(10, 15, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, TheKey); - BLAKE_G_PRE2(14, 1, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, TheKey); - BLAKE_G_PRE0(11, 12, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, TheKey); - BLAKE_G_PRE1(6, 8, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, TheKey); - BLAKE_G_PRE1(3, 13, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, TheKey); - // { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 }, - BLAKE_G_PRE1(2, 12, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, TheKey); - BLAKE_G_PRE1(6, 10, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, TheKey); - BLAKE_G_PRE1(0, 11, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, TheKey); - BLAKE_G_PRE2(8, 3, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, TheKey); - BLAKE_G_PRE1(4, 13, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, TheKey); - BLAKE_G_PRE(7, 5, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, TheKey); - BLAKE_G_PRE0(15, 14, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, TheKey); - BLAKE_G_PRE1(1, 9, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, TheKey); - // { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 }, - BLAKE_G_PRE2(12, 5, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, TheKey); - BLAKE_G_PRE1(1, 15, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, TheKey); - BLAKE_G_PRE0(14, 13, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, TheKey); - BLAKE_G_PRE1(4, 10, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, TheKey); - BLAKE_G_PRE(0, 7, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, TheKey); - BLAKE_G_PRE(6, 3, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, TheKey); - BLAKE_G_PRE2(9, 2, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, TheKey); - BLAKE_G_PRE0(8, 11, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, TheKey); - // { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 }, - BLAKE_G_PRE0(13, 11, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, TheKey); - BLAKE_G_PRE1(7, 14, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, TheKey); - BLAKE_G_PRE2(12, 1, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, TheKey); - BLAKE_G_PRE1(3, 9, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, TheKey); - BLAKE_G_PRE(5, 0, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, TheKey); - BLAKE_G_PRE2(15, 4, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, TheKey); - BLAKE_G_PRE2(8, 6, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, TheKey); - BLAKE_G_PRE(2, 10, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, TheKey); - // { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 }, - BLAKE_G_PRE1(6, 15, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, TheKey); - BLAKE_G_PRE0(14, 9, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, TheKey); - BLAKE_G_PRE2(11, 3, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, TheKey); - BLAKE_G_PRE1(0, 8, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, TheKey); - BLAKE_G_PRE2(12, 2, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, TheKey); - BLAKE_G_PRE2(13, 7, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, TheKey); - BLAKE_G_PRE(1, 4, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, TheKey); - BLAKE_G_PRE2(10, 5, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, TheKey); - // { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 }, - BLAKE_G_PRE2(10, 2, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, TheKey); - BLAKE_G_PRE2(8, 4, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, TheKey); - BLAKE_G_PRE(7, 6, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, TheKey); - BLAKE_G_PRE(1, 5, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, TheKey); - BLAKE_G_PRE0(15, 11, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, TheKey); - BLAKE_G_PRE0(9, 14, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, TheKey); - BLAKE_G_PRE1(3, 12, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, TheKey); - BLAKE_G_PRE2(13, 0, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, TheKey); - - V.lo ^= V.hi ^ tmpblock; - - V.hi = BLAKE2S_IV_Vec; - tmpblock = V.lo; - - V.hi.s4 ^= 128; - V.hi.s6 = ~V.hi.s6; - - // { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - BLAKE_G_PRE(0, 1, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, inout); - BLAKE_G_PRE(2, 3, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, inout); - BLAKE_G_PRE(4, 5, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, inout); - BLAKE_G_PRE(6, 7, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, inout); - BLAKE_G_PRE(8, 9, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, inout); - BLAKE_G_PRE(10, 11, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, inout); - BLAKE_G_PRE(12, 13, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, inout); - BLAKE_G_PRE(14, 15, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, inout); - // { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - BLAKE_G_PRE(14, 10, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, inout); - BLAKE_G_PRE(4, 8, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, inout); - BLAKE_G_PRE(9, 15, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, inout); - BLAKE_G_PRE(13, 6, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, inout); - BLAKE_G_PRE(1, 12, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, inout); - BLAKE_G_PRE(0, 2, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, inout); - BLAKE_G_PRE(11, 7, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, inout); - BLAKE_G_PRE(5, 3, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, inout); - // { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - BLAKE_G_PRE(11, 8, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, inout); - BLAKE_G_PRE(12, 0, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, inout); - BLAKE_G_PRE(5, 2, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, inout); - BLAKE_G_PRE(15, 13, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, inout); - BLAKE_G_PRE(10, 14, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, inout); - BLAKE_G_PRE(3, 6, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, inout); - BLAKE_G_PRE(7, 1, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, inout); - BLAKE_G_PRE(9, 4, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, inout); - // { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - BLAKE_G_PRE(7, 9, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, inout); - BLAKE_G_PRE(3, 1, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, inout); - BLAKE_G_PRE(13, 12, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, inout); - BLAKE_G_PRE(11, 14, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, inout); - BLAKE_G_PRE(2, 6, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, inout); - BLAKE_G_PRE(5, 10, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, inout); - BLAKE_G_PRE(4, 0, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, inout); - BLAKE_G_PRE(15, 8, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, inout); - - for (uint32_t x = 4U; x < 10U; x++) - { - BLAKE_G(x, 0x00, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, inout); - BLAKE_G(x, 0x02, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, inout); - BLAKE_G(x, 0x04, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, inout); - BLAKE_G(x, 0x06, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, inout); - BLAKE_G(x, 0x08, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, inout); - BLAKE_G(x, 0x0A, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, inout); - BLAKE_G(x, 0x0C, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, inout); - BLAKE_G(x, 0x0E, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, inout); - } - - V.lo ^= V.hi ^ tmpblock; - - ((uint8*)out)[0] = V.lo; -} -#endif - -#if __CUDA_ARCH__ >= 500 - -#define BLAKE_G(idx0, idx1, a, b, c, d, key) { \ - idx = BLAKE2S_SIGMA[idx0][idx1]; a += key[idx]; \ - a += b; d = __byte_perm(d^a, 0, 0x1032); \ - c += d; b = rotateR(b^c, 12); \ - idx = BLAKE2S_SIGMA[idx0][idx1+1]; a += key[idx]; \ - a += b; d = __byte_perm(d^a, 0, 0x0321); \ - c += d; b = rotateR(b^c, 7); \ -} - -#define BLAKE(a, b, c, d, key1,key2) { \ - a += key1; \ - a += b; d = __byte_perm(d^a, 0, 0x1032); \ - c += d; b = rotateR(b^c, 12); \ - a += key2; \ - a += b; d = __byte_perm(d^a, 0, 0x0321); \ - c += d; b = rotateR(b^c, 7); \ -} - -#define BLAKE_G_PRE(idx0,idx1, a, b, c, d, key) { \ - a += key[idx0]; \ - a += b; d = __byte_perm(d^a, 0, 0x1032); \ - c += d; b = rotateR(b^c, 12); \ - a += key[idx1]; \ - a += b; d = __byte_perm(d^a, 0, 0x0321); \ - c += d; b = rotateR(b^c, 7); \ -} - -#define BLAKE_G_PRE0(idx0,idx1, a, b, c, d, key) { \ - a += b; d = __byte_perm(d^a, 0, 0x1032); \ - c += d; b = rotateR(b^c, 12); \ - a += b; d = __byte_perm(d^a, 0, 0x0321); \ - c += d; b = rotateR(b^c, 7); \ -} - -#define BLAKE_G_PRE1(idx0,idx1, a, b, c, d, key) { \ - a += key[idx0]; \ - a += b; d = __byte_perm(d^a, 0, 0x1032); \ - c += d; b = rotateR(b^c, 12); \ - a += b; d = __byte_perm(d^a, 0, 0x0321); \ - c += d; b = rotateR(b^c, 7); \ -} - -#define BLAKE_G_PRE2(idx0,idx1, a, b, c, d, key) { \ - a += b; d = __byte_perm(d^a, 0, 0x1032); \ - c += d; b = rotateR(b^c, 12); \ - a += key[idx1]; \ - a += b; d = __byte_perm(d^a, 0, 0x0321); \ - c += d; b = rotateR(b^c, 7); \ -} - -static __forceinline__ __device__ -void Blake2S_v2(uint32_t *out, const uint32_t* __restrict__ inout, const uint32_t * __restrict__ TheKey) -{ - uint16 V; - uint8 tmpblock; - - V.hi = BLAKE2S_IV_Vec; - V.lo = BLAKE2S_IV_Vec; - V.lo.s0 ^= 0x01012020; - - // Copy input block for later - tmpblock = V.lo; - - V.hi.s4 ^= BLAKE2S_BLOCK_SIZE; - - // { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - BLAKE_G_PRE(0, 1, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, TheKey); - BLAKE_G_PRE(2, 3, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, TheKey); - BLAKE_G_PRE(4, 5, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, TheKey); - BLAKE_G_PRE(6, 7, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, TheKey); - BLAKE_G_PRE0(8, 9, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, TheKey); - BLAKE_G_PRE0(10, 11, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, TheKey); - BLAKE_G_PRE0(12, 13, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, TheKey); - BLAKE_G_PRE0(14, 15, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, TheKey); - // { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - BLAKE_G_PRE0(14, 10, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, TheKey); - BLAKE_G_PRE1(4, 8, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, TheKey); - BLAKE_G_PRE0(9, 15, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, TheKey); - BLAKE_G_PRE2(13, 6, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, TheKey); - BLAKE_G_PRE1(1, 12, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, TheKey); - BLAKE_G_PRE(0, 2, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, TheKey); - BLAKE_G_PRE2(11, 7, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, TheKey); - BLAKE_G_PRE(5, 3, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, TheKey); - // { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - BLAKE_G_PRE0(11, 8, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, TheKey); - BLAKE_G_PRE2(12, 0, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, TheKey); - BLAKE_G_PRE(5, 2, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, TheKey); - BLAKE_G_PRE0(15, 13, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, TheKey); - BLAKE_G_PRE0(10, 14, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, TheKey); - BLAKE_G_PRE(3, 6, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, TheKey); - BLAKE_G_PRE(7, 1, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, TheKey); - BLAKE_G_PRE2(9, 4, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, TheKey); - // { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - BLAKE_G_PRE1(7, 9, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, TheKey); - BLAKE_G_PRE(3, 1, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, TheKey); - BLAKE_G_PRE0(13, 12, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, TheKey); - BLAKE_G_PRE0(11, 14, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, TheKey); - BLAKE_G_PRE(2, 6, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, TheKey); - BLAKE_G_PRE1(5, 10, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, TheKey); - BLAKE_G_PRE(4, 0, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, TheKey); - BLAKE_G_PRE0(15, 8, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, TheKey); - // { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, - BLAKE_G_PRE2(9, 0, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, TheKey); - BLAKE_G_PRE(5, 7, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, TheKey); - BLAKE_G_PRE(2, 4, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, TheKey); - BLAKE_G_PRE0(10, 15, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, TheKey); - BLAKE_G_PRE2(14, 1, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, TheKey); - BLAKE_G_PRE0(11, 12, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, TheKey); - BLAKE_G_PRE1(6, 8, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, TheKey); - BLAKE_G_PRE1(3, 13, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, TheKey); - // { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 }, - BLAKE_G_PRE1(2, 12, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, TheKey); - BLAKE_G_PRE1(6, 10, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, TheKey); - BLAKE_G_PRE1(0, 11, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, TheKey); - BLAKE_G_PRE2(8, 3, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, TheKey); - BLAKE_G_PRE1(4, 13, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, TheKey); - BLAKE_G_PRE(7, 5, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, TheKey); - BLAKE_G_PRE0(15, 14, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, TheKey); - BLAKE_G_PRE1(1, 9, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, TheKey); - // { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 }, - BLAKE_G_PRE2(12, 5, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, TheKey); - BLAKE_G_PRE1(1, 15, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, TheKey); - BLAKE_G_PRE0(14, 13, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, TheKey); - BLAKE_G_PRE1(4, 10, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, TheKey); - BLAKE_G_PRE(0, 7, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, TheKey); - BLAKE_G_PRE(6, 3, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, TheKey); - BLAKE_G_PRE2(9, 2, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, TheKey); - BLAKE_G_PRE0(8, 11, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, TheKey); - // { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 }, - BLAKE_G_PRE0(13, 11, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, TheKey); - BLAKE_G_PRE1(7, 14, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, TheKey); - BLAKE_G_PRE2(12, 1, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, TheKey); - BLAKE_G_PRE1(3, 9, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, TheKey); - BLAKE_G_PRE(5, 0, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, TheKey); - BLAKE_G_PRE2(15, 4, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, TheKey); - BLAKE_G_PRE2(8, 6, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, TheKey); - BLAKE_G_PRE(2, 10, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, TheKey); - // { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 }, - BLAKE_G_PRE1(6, 15, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, TheKey); - BLAKE_G_PRE0(14, 9, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, TheKey); - BLAKE_G_PRE2(11, 3, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, TheKey); - BLAKE_G_PRE1(0, 8, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, TheKey); - BLAKE_G_PRE2(12, 2, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, TheKey); - BLAKE_G_PRE2(13, 7, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, TheKey); - BLAKE_G_PRE(1, 4, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, TheKey); - BLAKE_G_PRE2(10, 5, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, TheKey); - // { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 }, - BLAKE_G_PRE2(10, 2, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, TheKey); - BLAKE_G_PRE2(8, 4, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, TheKey); - BLAKE_G_PRE(7, 6, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, TheKey); - BLAKE_G_PRE(1, 5, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, TheKey); - BLAKE_G_PRE0(15, 11, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, TheKey); - BLAKE_G_PRE0(9, 14, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, TheKey); - BLAKE_G_PRE1(3, 12, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, TheKey); - BLAKE_G_PRE2(13, 0, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, TheKey); - - V.lo ^= V.hi; - V.lo ^= tmpblock; - - V.hi = BLAKE2S_IV_Vec; - tmpblock = V.lo; - - V.hi.s4 ^= 128; - V.hi.s6 = ~V.hi.s6; - - // { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - BLAKE_G_PRE(0, 1, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, inout); - BLAKE_G_PRE(2, 3, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, inout); - BLAKE_G_PRE(4, 5, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, inout); - BLAKE_G_PRE(6, 7, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, inout); - BLAKE_G_PRE(8, 9, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, inout); - BLAKE_G_PRE(10, 11, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, inout); - BLAKE_G_PRE(12, 13, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, inout); - BLAKE_G_PRE(14, 15, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, inout); - // { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - BLAKE_G_PRE(14, 10, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, inout); - BLAKE_G_PRE(4, 8, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, inout); - BLAKE_G_PRE(9, 15, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, inout); - BLAKE_G_PRE(13, 6, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, inout); - BLAKE_G_PRE(1, 12, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, inout); - BLAKE_G_PRE(0, 2, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, inout); - BLAKE_G_PRE(11, 7, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, inout); - BLAKE_G_PRE(5, 3, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, inout); - // { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - BLAKE_G_PRE(11, 8, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, inout); - BLAKE_G_PRE(12, 0, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, inout); - BLAKE_G_PRE(5, 2, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, inout); - BLAKE_G_PRE(15, 13, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, inout); - BLAKE_G_PRE(10, 14, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, inout); - BLAKE_G_PRE(3, 6, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, inout); - BLAKE_G_PRE(7, 1, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, inout); - BLAKE_G_PRE(9, 4, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, inout); - // { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - BLAKE_G_PRE(7, 9, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, inout); - BLAKE_G_PRE(3, 1, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, inout); - BLAKE_G_PRE(13, 12, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, inout); - BLAKE_G_PRE(11, 14, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, inout); - BLAKE_G_PRE(2, 6, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, inout); - BLAKE_G_PRE(5, 10, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, inout); - BLAKE_G_PRE(4, 0, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, inout); - BLAKE_G_PRE(15, 8, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, inout); - - BLAKE(V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, inout[9], inout[0]); - BLAKE(V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, inout[5], inout[7]); - BLAKE(V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, inout[2], inout[4]); - BLAKE(V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, inout[10], inout[15]); - BLAKE(V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, inout[14], inout[1]); - BLAKE(V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, inout[11], inout[12]); - BLAKE(V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, inout[6], inout[8]); - BLAKE(V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, inout[3], inout[13]); - - BLAKE(V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, inout[2], inout[12]); - BLAKE(V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, inout[6], inout[10]); - BLAKE(V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, inout[0], inout[11]); - BLAKE(V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, inout[8], inout[3]); - BLAKE(V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, inout[4], inout[13]); - BLAKE(V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, inout[7], inout[5]); - BLAKE(V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, inout[15], inout[14]); - BLAKE(V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, inout[1], inout[9]); - - BLAKE(V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, inout[12], inout[5]); - BLAKE(V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, inout[1], inout[15]); - BLAKE(V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, inout[14], inout[13]); - BLAKE(V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, inout[4], inout[10]); - BLAKE(V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, inout[0], inout[7]); - BLAKE(V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, inout[6], inout[3]); - BLAKE(V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, inout[9], inout[2]); - BLAKE(V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, inout[8], inout[11]); - // 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10, - BLAKE(V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, inout[13], inout[11]); - BLAKE(V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, inout[7], inout[14]); - BLAKE(V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, inout[12], inout[1]); - BLAKE(V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, inout[3], inout[9]); - BLAKE(V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, inout[5], inout[0]); - BLAKE(V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, inout[15], inout[4]); - BLAKE(V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, inout[8], inout[6]); - BLAKE(V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, inout[2], inout[10]); - // 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5, - BLAKE(V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, inout[6], inout[15]); - BLAKE(V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, inout[14], inout[9]); - BLAKE(V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, inout[11], inout[3]); - BLAKE(V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, inout[0], inout[8]); - BLAKE(V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, inout[12], inout[2]); - BLAKE(V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, inout[13], inout[7]); - BLAKE(V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, inout[1], inout[4]); - BLAKE(V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, inout[10], inout[5]); - // 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0, - BLAKE(V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, inout[10], inout[2]); - BLAKE(V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, inout[8], inout[4]); - BLAKE(V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, inout[7], inout[6]); - BLAKE(V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, inout[1], inout[5]); - BLAKE(V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, inout[15], inout[11]); - BLAKE(V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, inout[9], inout[14]); - BLAKE(V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, inout[3], inout[12]); - BLAKE(V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, inout[13], inout[0]); - - V.lo ^= V.hi; - V.lo ^= tmpblock; - - ((uint8*)out)[0] = V.lo; -} - -#endif /* __CUDA_ARCH__ >= 500 */ - -#define SALSA_CORE(state) { \ - uint32_t t; \ - SALSA(state.x, state.y, state.z, state.w); \ - WarpShuffle3(state.y, state.z, state.w, threadIdx.x + 3, threadIdx.x + 2, threadIdx.x + 1,4); \ - SALSA(state.x, state.w, state.z, state.y); \ - WarpShuffle3(state.y, state.z, state.w, threadIdx.x + 1, threadIdx.x + 2, threadIdx.x + 3,4); \ -} - -#define CHACHA_CORE_PARALLEL(state) { \ - CHACHA_STEP(state.x, state.y, state.z, state.w); \ - WarpShuffle3(state.y, state.z, state.w, threadIdx.x + 1, threadIdx.x + 2, threadIdx.x + 3,4); \ - CHACHA_STEP(state.x, state.y, state.z, state.w); \ - WarpShuffle3(state.y, state.z, state.w, threadIdx.x + 3, threadIdx.x + 2, threadIdx.x + 1,4); \ -} - -__forceinline__ __device__ -uint4 salsa_small_scalar_rnd(const uint4 X) -{ - uint4 state = X; - - #pragma nounroll - for (int i = 0; i < 10; i++) { - SALSA_CORE(state); - } - - return (X + state); -} - -__device__ __forceinline__ -uint4 chacha_small_parallel_rnd(const uint4 X) -{ - uint4 state = X; - - #pragma nounroll - for (int i = 0; i < 10; i++) { - CHACHA_CORE_PARALLEL(state); - } - return (X + state); -} - -__device__ __forceinline__ -void neoscrypt_chacha(uint4 XV[4]) -{ - uint4 temp; - - XV[0] = chacha_small_parallel_rnd(XV[0] ^ XV[3]); - temp = chacha_small_parallel_rnd(XV[1] ^ XV[0]); - XV[1] = chacha_small_parallel_rnd(XV[2] ^ temp); - XV[3] = chacha_small_parallel_rnd(XV[3] ^ XV[1]); - XV[2] = temp; -} - -__device__ __forceinline__ -void neoscrypt_salsa(uint4 XV[4]) -{ - uint4 temp; - - XV[0] = salsa_small_scalar_rnd(XV[0] ^ XV[3]); - temp = salsa_small_scalar_rnd(XV[1] ^ XV[0]); - XV[1] = salsa_small_scalar_rnd(XV[2] ^ temp); - XV[3] = salsa_small_scalar_rnd(XV[3] ^ XV[1]); - XV[2] = temp; -} - - -#if __CUDA_ARCH__ < 500 -static __forceinline__ __device__ -void fastkdf256_v1(const uint32_t thread, const uint32_t nonce, uint32_t* const s_data) -{ - uint2x4 output[8]; - uint32_t* B = (uint32_t*)&s_data[threadIdx.x * 64U]; - uint32_t qbuf, rbuf, bitbuf; - uint32_t input[BLAKE2S_BLOCK_SIZE / 4]; - uint32_t key[BLAKE2S_BLOCK_SIZE / 4] = { 0 }; - - const uint32_t data18 = c_data[18]; - const uint32_t data20 = c_data[0]; - - ((uintx64*)(B))[0] = ((uintx64*)c_data)[0]; - ((uint32_t*)B)[19] = nonce; - ((uint32_t*)B)[39] = nonce; - ((uint32_t*)B)[59] = nonce; - - ((uint816*)input)[0] = ((uint816*)input_init)[0]; - ((uint4x2*)key)[0] = ((uint4x2*)key_init)[0]; - - #pragma unroll 1 - for (int i = 0; i < 31; i++) - { - uint32_t bufidx = 0; - #pragma unroll - for (int x = 0; x < BLAKE2S_OUT_SIZE / 4; ++x) - { - uint32_t bufhelper = (input[x] & 0x00ff00ff) + ((input[x] & 0xff00ff00) >> 8); - bufhelper = bufhelper + (bufhelper >> 16); - bufidx += bufhelper; - } - bufidx &= 0x000000ff; - qbuf = bufidx >> 2; - rbuf = bufidx & 3; - bitbuf = rbuf << 3; - - uint32_t shifted[9]; - shift256R4(shifted, ((uint8*)input)[0], bitbuf); - - uint32_t temp[9]; - //#pragma unroll - for (int k = 0; k < 9; k++) - { - uint32_t indice = (k + qbuf) & 0x3f; - temp[k] = B[indice] ^ shifted[k]; - B[indice] = temp[k]; - } -#if __CUDA_ARCH__ >= 320 || !defined(__CUDA_ARCH__) - uint32_t a = c_data[qbuf & 0x3f], b; - //#pragma unroll - for (int k = 0; k<16; k += 2) - { - b = c_data[(qbuf + k + 1) & 0x3f]; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(input[k]) : "r"(a), "r"(b), "r"(bitbuf)); - a = c_data[(qbuf + k + 2) & 0x3f]; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(input[k + 1]) : "r"(b), "r"(a), "r"(bitbuf)); - } - - const uint32_t noncepos = 19U - qbuf % 20U; - if (noncepos <= 16U && qbuf < 60U) - { - if (noncepos != 0) - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(input[noncepos - 1]) : "r"(data18), "r"(nonce), "r"(bitbuf)); - if (noncepos != 16U) - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(input[noncepos]) : "r"(nonce), "r"(data20), "r"(bitbuf)); - } - - for (int k = 0; k<8; k++) - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[k]) : "r"(temp[k]), "r"(temp[k + 1]), "r"(bitbuf)); -#else - //#error SM 3.0 code missing here - printf("", data18, data20); -#endif - Blake2S(input, input, key); - } - - uint32_t bufidx = 0; - #pragma unroll - for (int x = 0; x < BLAKE2S_OUT_SIZE / 4; ++x) - { - uint32_t bufhelper = (input[x] & 0x00ff00ff) + ((input[x] & 0xff00ff00) >> 8); - bufhelper = bufhelper + (bufhelper >> 16); - bufidx += bufhelper; - } - bufidx &= 0x000000ff; - qbuf = bufidx >> 2; - rbuf = bufidx & 3; - bitbuf = rbuf << 3; - -#if __CUDA_ARCH__ >= 320 - for (int i = 0; i<64; i++) - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(((uint32_t*)output)[i]) : "r"(B[(qbuf + i) & 0x3f]), "r"(B[(qbuf + i + 1) & 0x3f4]), "r"(bitbuf)); -#endif - - ((ulonglong4*)output)[0] ^= ((ulonglong4*)input)[0]; - ((uintx64*)output)[0] ^= ((uintx64*)c_data)[0]; - ((uint32_t*)output)[19] ^= nonce; - ((uint32_t*)output)[39] ^= nonce; - ((uint32_t*)output)[59] ^= nonce; - - for (int i = 0; i<8; i++) - (Input + 8U * thread)[i] = output[i]; -} -#endif - -#if __CUDA_ARCH__ >= 500 -static __forceinline__ __device__ -void fastkdf256_v2(const uint32_t thread, const uint32_t nonce, uint32_t* const s_data) -{ - const uint32_t data18 = c_data[18]; - const uint32_t data20 = c_data[0]; - uint32_t input[16]; - uint32_t key[16] = { 0 }; - uint32_t qbuf, rbuf, bitbuf; - - uint32_t* B = (uint32_t*)&s_data[threadIdx.x * 64U]; - ((uintx64*)(B))[0] = ((uintx64*)c_data)[0]; - - B[19] = nonce; - B[39] = nonce; - B[59] = nonce; - - { - uint32_t bufidx = 0; - #pragma unroll - for (int x = 0; x < BLAKE2S_OUT_SIZE / 4; ++x) - { - uint32_t bufhelper = (input_init[x] & 0x00ff00ff) + ((input_init[x] & 0xff00ff00) >> 8); - bufhelper = bufhelper + (bufhelper >> 16); - bufidx += bufhelper; - } - bufidx &= 0x000000ff; - qbuf = bufidx >> 2; - rbuf = bufidx & 3; - bitbuf = rbuf << 3; - - uint32_t temp[9]; - - uint32_t shifted; - uint32_t shift = 32U - bitbuf; - asm("shl.b32 %0, %1, %2;" : "=r"(shifted) : "r"(input_init[0]), "r"(bitbuf)); - temp[0] = B[(0 + qbuf) & 0x3f] ^ shifted; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(shifted) : "r"(input_init[0]), "r"(input_init[1]), "r"(shift)); - temp[1] = B[(1 + qbuf) & 0x3f] ^ shifted; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(shifted) : "r"(input_init[1]), "r"(input_init[2]), "r"(shift)); - temp[2] = B[(2 + qbuf) & 0x3f] ^ shifted; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(shifted) : "r"(input_init[2]), "r"(input_init[3]), "r"(shift)); - temp[3] = B[(3 + qbuf) & 0x3f] ^ shifted; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(shifted) : "r"(input_init[3]), "r"(input_init[4]), "r"(shift)); - temp[4] = B[(4 + qbuf) & 0x3f] ^ shifted; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(shifted) : "r"(input_init[4]), "r"(input_init[5]), "r"(shift)); - temp[5] = B[(5 + qbuf) & 0x3f] ^ shifted; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(shifted) : "r"(input_init[5]), "r"(input_init[6]), "r"(shift)); - temp[6] = B[(6 + qbuf) & 0x3f] ^ shifted; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(shifted) : "r"(input_init[6]), "r"(input_init[7]), "r"(shift)); - temp[7] = B[(7 + qbuf) & 0x3f] ^ shifted; - asm("shr.b32 %0, %1, %2;" : "=r"(shifted) : "r"(input_init[7]), "r"(shift)); - temp[8] = B[(8 + qbuf) & 0x3f] ^ shifted; - - uint32_t a = c_data[qbuf & 0x3f], b; - - #pragma unroll - for (int k = 0; k<16; k += 2) - { - b = c_data[(qbuf + k + 1) & 0x3f]; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(input[k]) : "r"(a), "r"(b), "r"(bitbuf)); - a = c_data[(qbuf + k + 2) & 0x3f]; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(input[k + 1]) : "r"(b), "r"(a), "r"(bitbuf)); - } - - const uint32_t noncepos = 19 - qbuf % 20U; - if (noncepos <= 16U && qbuf < 60U) - { - if (noncepos) - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(input[noncepos - 1]) : "r"(data18), "r"(nonce), "r"(bitbuf)); - if (noncepos != 16U) - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(input[noncepos]) : "r"(nonce), "r"(data20), "r"(bitbuf)); - } - - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[0]) : "r"(temp[0]), "r"(temp[1]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[1]) : "r"(temp[1]), "r"(temp[2]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[2]) : "r"(temp[2]), "r"(temp[3]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[3]) : "r"(temp[3]), "r"(temp[4]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[4]) : "r"(temp[4]), "r"(temp[5]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[5]) : "r"(temp[5]), "r"(temp[6]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[6]) : "r"(temp[6]), "r"(temp[7]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[7]) : "r"(temp[7]), "r"(temp[8]), "r"(bitbuf)); - - Blake2S_v2(input, input, key); - - #pragma unroll - for (int k = 0; k < 9; k++) - B[(k + qbuf) & 0x3f] = temp[k]; - } - - for (int i = 1; i < 31; i++) - { - uint32_t bufidx = 0; - #pragma unroll - for (int x = 0; x < BLAKE2S_OUT_SIZE / 4; ++x) - { - uint32_t bufhelper = (input[x] & 0x00ff00ff) + ((input[x] & 0xff00ff00) >> 8); - bufhelper = bufhelper + (bufhelper >> 16); - bufidx += bufhelper; - } - bufidx &= 0x000000ff; - qbuf = bufidx >> 2; - rbuf = bufidx & 3; - bitbuf = rbuf << 3; - - uint32_t temp[9]; - - uint32_t shifted; - uint32_t shift = 32U - bitbuf; - asm("shl.b32 %0, %1, %2;" : "=r"(shifted) : "r"(input[0]), "r"(bitbuf)); - temp[0] = B[(0 + qbuf) & 0x3f] ^ shifted; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(shifted) : "r"(input[0]), "r"(input[1]), "r"(shift)); - temp[1] = B[(1 + qbuf) & 0x3f] ^ shifted; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(shifted) : "r"(input[1]), "r"(input[2]), "r"(shift)); - temp[2] = B[(2 + qbuf) & 0x3f] ^ shifted; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(shifted) : "r"(input[2]), "r"(input[3]), "r"(shift)); - temp[3] = B[(3 + qbuf) & 0x3f] ^ shifted; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(shifted) : "r"(input[3]), "r"(input[4]), "r"(shift)); - temp[4] = B[(4 + qbuf) & 0x3f] ^ shifted; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(shifted) : "r"(input[4]), "r"(input[5]), "r"(shift)); - temp[5] = B[(5 + qbuf) & 0x3f] ^ shifted; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(shifted) : "r"(input[5]), "r"(input[6]), "r"(shift)); - temp[6] = B[(6 + qbuf) & 0x3f] ^ shifted; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(shifted) : "r"(input[6]), "r"(input[7]), "r"(shift)); - temp[7] = B[(7 + qbuf) & 0x3f] ^ shifted; - asm("shr.b32 %0, %1, %2;" : "=r"(shifted) : "r"(input[7]), "r"(shift)); - temp[8] = B[(8 + qbuf) & 0x3f] ^ shifted; - - uint32_t a = c_data[qbuf & 0x3f], b; - - #pragma unroll - for (int k = 0; k<16; k += 2) - { - b = c_data[(qbuf + k + 1) & 0x3f]; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(input[k]) : "r"(a), "r"(b), "r"(bitbuf)); - a = c_data[(qbuf + k + 2) & 0x3f]; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(input[k + 1]) : "r"(b), "r"(a), "r"(bitbuf)); - } - - const uint32_t noncepos = 19 - qbuf % 20U; - if (noncepos <= 16U && qbuf < 60U) - { - if (noncepos) - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(input[noncepos - 1]) : "r"(data18), "r"(nonce), "r"(bitbuf)); - if (noncepos != 16U) - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(input[noncepos]) : "r"(nonce), "r"(data20), "r"(bitbuf)); - } - - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[0]) : "r"(temp[0]), "r"(temp[1]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[1]) : "r"(temp[1]), "r"(temp[2]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[2]) : "r"(temp[2]), "r"(temp[3]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[3]) : "r"(temp[3]), "r"(temp[4]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[4]) : "r"(temp[4]), "r"(temp[5]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[5]) : "r"(temp[5]), "r"(temp[6]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[6]) : "r"(temp[6]), "r"(temp[7]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[7]) : "r"(temp[7]), "r"(temp[8]), "r"(bitbuf)); - - Blake2S_v2(input, input, key); - - #pragma unroll - for (int k = 0; k < 9; k++) - B[(k + qbuf) & 0x3f] = temp[k]; - } - - { - uint32_t bufidx = 0; - #pragma unroll - for (int x = 0; x < BLAKE2S_OUT_SIZE / 4; ++x) - { - uint32_t bufhelper = (input[x] & 0x00ff00ff) + ((input[x] & 0xff00ff00) >> 8); - bufhelper = bufhelper + (bufhelper >> 16); - bufidx += bufhelper; - } - bufidx &= 0x000000ff; - qbuf = bufidx >> 2; - rbuf = bufidx & 3; - bitbuf = rbuf << 3; - } - - uint2x4 output[8]; - for (int i = 0; i<64; i++) { - const uint32_t a = (qbuf + i) & 0x3f, b = (qbuf + i + 1) & 0x3f; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(((uint32_t*)output)[i]) : "r"(B[a]), "r"(B[b]), "r"(bitbuf)); - } - - output[0] ^= ((uint2x4*)input)[0]; - #pragma unroll - for (int i = 0; i<8; i++) - output[i] ^= ((uint2x4*)c_data)[i]; - - ((uint32_t*)output)[19] ^= nonce; - ((uint32_t*)output)[39] ^= nonce; - ((uint32_t*)output)[59] ^= nonce;; - ((ulonglong16 *)(Input + 8U * thread))[0] = ((ulonglong16*)output)[0]; -} -#endif - -#if __CUDA_ARCH__ < 500 -static __forceinline__ __device__ -uint32_t fastkdf32_v1(uint32_t thread, const uint32_t nonce, uint32_t* const salt, uint32_t* const s_data) -{ - const uint32_t cdata7 = c_data[7]; - const uint32_t data18 = c_data[18]; - const uint32_t data20 = c_data[0]; - - uint32_t* B0 = (uint32_t*)&s_data[threadIdx.x * 64U]; - ((uintx64*)B0)[0] = ((uintx64*)salt)[0]; - - uint32_t input[BLAKE2S_BLOCK_SIZE / 4]; - ((uint816*)input)[0] = ((uint816*)c_data)[0]; - - uint32_t key[BLAKE2S_BLOCK_SIZE / 4]; - ((uint4x2*)key)[0] = ((uint4x2*)salt)[0]; - ((uint4*)key)[2] = make_uint4(0, 0, 0, 0); - ((uint4*)key)[3] = make_uint4(0, 0, 0, 0); - - uint32_t qbuf, rbuf, bitbuf; - uint32_t temp[9]; - - #pragma nounroll - for (int i = 0; i < 31; i++) - { - Blake2S(input, input, key); - - uint32_t bufidx = 0; - #pragma unroll - for (int x = 0; x < BLAKE2S_OUT_SIZE / 4; ++x) - { - uint32_t bufhelper = (input[x] & 0x00ff00ff) + ((input[x] & 0xff00ff00) >> 8); - bufhelper = bufhelper + (bufhelper >> 16); - bufidx += bufhelper; - } - bufidx &= 0x000000ff; - qbuf = bufidx >> 2; - rbuf = bufidx & 3; - bitbuf = rbuf << 3; - uint32_t shifted[9]; - - shift256R4(shifted, ((uint8*)input)[0], bitbuf); - - for (int k = 0; k < 9; k++) { - temp[k] = B0[(k + qbuf) & 0x3f]; - } - - ((uint2x4*)temp)[0] ^= ((uint2x4*)shifted)[0]; - temp[8] ^= shifted[8]; - -#if __CUDA_ARCH__ >= 320 || !defined(__CUDA_ARCH__) - uint32_t a = c_data[qbuf & 0x3f], b; - //#pragma unroll - for (int k = 0; k<16; k += 2) - { - b = c_data[(qbuf + k + 1) & 0x3f]; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(input[k]) : "r"(a), "r"(b), "r"(bitbuf)); - a = c_data[(qbuf + k + 2) & 0x3f]; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(input[k + 1]) : "r"(b), "r"(a), "r"(bitbuf)); - } - - const uint32_t noncepos = 19U - qbuf % 20U; - if (noncepos <= 16U && qbuf < 60U) - { - if (noncepos != 0) asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(input[noncepos - 1]) : "r"(data18), "r"(nonce), "r"(bitbuf)); - if (noncepos != 16U) asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(input[noncepos]) : "r"(nonce), "r"(data20), "r"(bitbuf)); - } - - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[0]) : "r"(temp[0]), "r"(temp[1]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[1]) : "r"(temp[1]), "r"(temp[2]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[2]) : "r"(temp[2]), "r"(temp[3]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[3]) : "r"(temp[3]), "r"(temp[4]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[4]) : "r"(temp[4]), "r"(temp[5]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[5]) : "r"(temp[5]), "r"(temp[6]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[6]) : "r"(temp[6]), "r"(temp[7]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[7]) : "r"(temp[7]), "r"(temp[8]), "r"(bitbuf)); -#else - //#error SM 3.0 code missing here - printf("", data18, data20); -#endif - for (int k = 0; k < 9; k++) { - B0[(k + qbuf) & 0x3f] = temp[k]; - } - } - - Blake2S(input, input, key); - - uint32_t bufidx = 0; - #pragma unroll - for (int x = 0; x < BLAKE2S_OUT_SIZE / 4; ++x) - { - uint32_t bufhelper = (input[x] & 0x00ff00ff) + ((input[x] & 0xff00ff00) >> 8); - bufhelper = bufhelper + (bufhelper >> 16); - bufidx += bufhelper; - } - bufidx &= 0x000000ff; - qbuf = bufidx >> 2; - rbuf = bufidx & 3; - bitbuf = rbuf << 3; - - for (int k = 7; k < 9; k++) { - temp[k] = B0[(k + qbuf) & 0x3f]; - } - - uint32_t output; -#if __CUDA_ARCH__ >= 320 - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(output) : "r"(temp[7]), "r"(temp[8]), "r"(bitbuf)); -#else - output = (MAKE_ULONGLONG(temp[7], temp[8]) >> bitbuf); // to check maybe 7/8 reversed -#endif - output ^= input[7] ^ cdata7; - return output; -} -#endif - -#if __CUDA_ARCH__ >= 500 -static __forceinline__ __device__ -uint32_t fastkdf32_v3(uint32_t thread, const uint32_t nonce, uint32_t* const salt, uint32_t* const s_data) -{ - const uint32_t cdata7 = c_data[7]; - const uint32_t data18 = c_data[18]; - const uint32_t data20 = c_data[0]; - - uint32_t* B0 = (uint32_t*)&s_data[threadIdx.x * 64U]; - ((uintx64*)B0)[0] = ((uintx64*)salt)[0]; - - uint32_t input[BLAKE2S_BLOCK_SIZE / 4]; - ((uint816*)input)[0] = ((uint816*)c_data)[0]; - - uint32_t key[BLAKE2S_BLOCK_SIZE / 4]; - ((uint4x2*)key)[0] = ((uint4x2*)salt)[0]; - ((uint4*)key)[2] = make_uint4(0, 0, 0, 0); - ((uint4*)key)[3] = make_uint4(0, 0, 0, 0); - - uint32_t qbuf, rbuf, bitbuf; - uint32_t temp[9]; - - #pragma nounroll - for (int i = 0; i < 31; i++) - { - Blake2S_v2(input, input, key); - - uint32_t bufidx = 0; - #pragma unroll - for (int x = 0; x < BLAKE2S_OUT_SIZE / 4; ++x) - { - uint32_t bufhelper = (input[x] & 0x00ff00ff) + ((input[x] & 0xff00ff00) >> 8); - bufhelper = bufhelper + (bufhelper >> 16); - bufidx += bufhelper; - } - bufidx &= 0x000000ff; - qbuf = bufidx >> 2; - rbuf = bufidx & 3; - bitbuf = rbuf << 3; - - uint32_t shifted; - uint32_t shift = 32U - bitbuf; - asm("shl.b32 %0, %1, %2;" : "=r"(shifted) : "r"(input[0]), "r"(bitbuf)); - temp[0] = B0[(0 + qbuf) & 0x3f] ^ shifted; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(shifted) : "r"(input[0]), "r"(input[1]), "r"(shift)); - temp[1] = B0[(1 + qbuf) & 0x3f] ^ shifted; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(shifted) : "r"(input[1]), "r"(input[2]), "r"(shift)); - temp[2] = B0[(2 + qbuf) & 0x3f] ^ shifted; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(shifted) : "r"(input[2]), "r"(input[3]), "r"(shift)); - temp[3] = B0[(3 + qbuf) & 0x3f] ^ shifted; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(shifted) : "r"(input[3]), "r"(input[4]), "r"(shift)); - temp[4] = B0[(4 + qbuf) & 0x3f] ^ shifted; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(shifted) : "r"(input[4]), "r"(input[5]), "r"(shift)); - temp[5] = B0[(5 + qbuf) & 0x3f] ^ shifted; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(shifted) : "r"(input[5]), "r"(input[6]), "r"(shift)); - temp[6] = B0[(6 + qbuf) & 0x3f] ^ shifted; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(shifted) : "r"(input[6]), "r"(input[7]), "r"(shift)); - temp[7] = B0[(7 + qbuf) & 0x3f] ^ shifted; - asm("shr.b32 %0, %1, %2;" : "=r"(shifted) : "r"(input[7]), "r"(shift)); - temp[8] = B0[(8 + qbuf) & 0x3f] ^ shifted; - - uint32_t a = c_data[qbuf & 0x3f], b; - #pragma unroll - for (int k = 0; k<16; k += 2) - { - b = c_data[(qbuf + k + 1) & 0x3f]; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(input[k]) : "r"(a), "r"(b), "r"(bitbuf)); - a = c_data[(qbuf + k + 2) & 0x3f]; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(input[k + 1]) : "r"(b), "r"(a), "r"(bitbuf)); - } - - const uint32_t noncepos = 19U - qbuf % 20U; - if (noncepos <= 16U && qbuf < 60U) - { - if (noncepos != 0) - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(input[noncepos - 1]) : "r"(data18), "r"(nonce), "r"(bitbuf)); - if (noncepos != 16U) - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(input[noncepos]) : "r"(nonce), "r"(data20), "r"(bitbuf)); - } - - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[0]) : "r"(temp[0]), "r"(temp[1]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[1]) : "r"(temp[1]), "r"(temp[2]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[2]) : "r"(temp[2]), "r"(temp[3]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[3]) : "r"(temp[3]), "r"(temp[4]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[4]) : "r"(temp[4]), "r"(temp[5]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[5]) : "r"(temp[5]), "r"(temp[6]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[6]) : "r"(temp[6]), "r"(temp[7]), "r"(bitbuf)); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(key[7]) : "r"(temp[7]), "r"(temp[8]), "r"(bitbuf)); - - #pragma unroll - for (int k = 0; k < 9; k++) { - B0[(k + qbuf) & 0x3f] = temp[k]; - } - } - - Blake2S_v2(input, input, key); - - uint32_t bufidx = 0; - #pragma unroll - for (int x = 0; x < BLAKE2S_OUT_SIZE / 4; ++x) - { - uint32_t bufhelper = (input[x] & 0x00ff00ff) + ((input[x] & 0xff00ff00) >> 8); - bufhelper = bufhelper + (bufhelper >> 16); - bufidx += bufhelper; - } - bufidx &= 0x000000ff; - qbuf = bufidx >> 2; - rbuf = bufidx & 3; - bitbuf = rbuf << 3; - - temp[7] = B0[(qbuf + 7) & 0x3f]; - temp[8] = B0[(qbuf + 8) & 0x3f]; - - uint32_t output; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(output) : "r"(temp[7]), "r"(temp[8]), "r"(bitbuf)); - output ^= input[7] ^ cdata7; - return output; -} -#endif - - -#define BLAKE_Ghost(idx0, idx1, a, b, c, d, key) { \ - idx = BLAKE2S_SIGMA_host[idx0][idx1]; a += key[idx]; \ - a += b; d = ROTR32(d^a,16); \ - c += d; b = ROTR32(b^c, 12); \ - idx = BLAKE2S_SIGMA_host[idx0][idx1+1]; a += key[idx]; \ - a += b; d = ROTR32(d^a,8); \ - c += d; b = ROTR32(b^c, 7); \ -} - -static void Blake2Shost(uint32_t * inout, const uint32_t * inkey) -{ - uint16 V; - uint32_t idx; - uint8 tmpblock; - - V.hi = BLAKE2S_IV_Vechost; - V.lo = BLAKE2S_IV_Vechost; - V.lo.s0 ^= 0x01012020; - - // Copy input block for later - tmpblock = V.lo; - - V.hi.s4 ^= BLAKE2S_BLOCK_SIZE; - - for (int x = 0; x < 10; ++x) - { - BLAKE_Ghost(x, 0x00, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, inkey); - BLAKE_Ghost(x, 0x02, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, inkey); - BLAKE_Ghost(x, 0x04, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, inkey); - BLAKE_Ghost(x, 0x06, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, inkey); - BLAKE_Ghost(x, 0x08, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, inkey); - BLAKE_Ghost(x, 0x0A, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, inkey); - BLAKE_Ghost(x, 0x0C, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, inkey); - BLAKE_Ghost(x, 0x0E, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, inkey); - } - - V.lo ^= V.hi; - V.lo ^= tmpblock; - - V.hi = BLAKE2S_IV_Vechost; - tmpblock = V.lo; - - V.hi.s4 ^= 128; - V.hi.s6 = ~V.hi.s6; - - for (int x = 0; x < 10; ++x) - { - BLAKE_Ghost(x, 0x00, V.lo.s0, V.lo.s4, V.hi.s0, V.hi.s4, inout); - BLAKE_Ghost(x, 0x02, V.lo.s1, V.lo.s5, V.hi.s1, V.hi.s5, inout); - BLAKE_Ghost(x, 0x04, V.lo.s2, V.lo.s6, V.hi.s2, V.hi.s6, inout); - BLAKE_Ghost(x, 0x06, V.lo.s3, V.lo.s7, V.hi.s3, V.hi.s7, inout); - BLAKE_Ghost(x, 0x08, V.lo.s0, V.lo.s5, V.hi.s2, V.hi.s7, inout); - BLAKE_Ghost(x, 0x0A, V.lo.s1, V.lo.s6, V.hi.s3, V.hi.s4, inout); - BLAKE_Ghost(x, 0x0C, V.lo.s2, V.lo.s7, V.hi.s0, V.hi.s5, inout); - BLAKE_Ghost(x, 0x0E, V.lo.s3, V.lo.s4, V.hi.s1, V.hi.s6, inout); - } - - V.lo ^= V.hi ^ tmpblock; - - ((uint8*)inout)[0] = V.lo; -} - - -#define TPB 32 -#define TPB2 64 - -__global__ -__launch_bounds__(TPB2, 1) -void neoscrypt_gpu_hash_start(const int stratum, const uint32_t startNonce) -{ - __shared__ uint32_t s_data[64 * TPB2]; - - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - const uint32_t nonce = startNonce + thread; - const uint32_t ZNonce = (stratum) ? cuda_swab32(nonce) : nonce; //freaking morons !!! - - __syncthreads(); -#if __CUDA_ARCH__ < 500 - fastkdf256_v1(thread, ZNonce, s_data); -#else - fastkdf256_v2(thread, ZNonce, s_data); -#endif -} - -__global__ -__launch_bounds__(TPB, 1) -void neoscrypt_gpu_hash_chacha1() -{ - const uint32_t thread = (blockDim.y * blockIdx.x + threadIdx.y); - const uint32_t threads = (gridDim.x * blockDim.y); - const uint32_t shiftTr = 8U * thread; - - uint4 X[4]; - for (int i = 0; i < 4; i++) - { - X[i].x = __ldg((uint32_t*)&(Input + shiftTr)[i * 2] + 0 * 4 + threadIdx.x); - X[i].y = __ldg((uint32_t*)&(Input + shiftTr)[i * 2] + 1 * 4 + threadIdx.x); - X[i].z = __ldg((uint32_t*)&(Input + shiftTr)[i * 2] + 2 * 4 + threadIdx.x); - X[i].w = __ldg((uint32_t*)&(Input + shiftTr)[i * 2] + 3 * 4 + threadIdx.x); - } - - #pragma nounroll - for (int i = 0; i < 128; i++) - { - uint32_t offset = 8U * (thread + threads * i); - for (int j = 0; j < 4; j++) - ((uint4*)(W + offset))[j * 4 + threadIdx.x] = X[j]; - neoscrypt_chacha(X); - } - - #pragma nounroll - for (int t = 0; t < 128; t++) - { - uint32_t offset = 8U * (thread + threads * (WarpShuffle(X[3].x, 0, 4) & 0x7F)); - for (int j = 0; j < 4; j++) - X[j] ^= ((uint4*)(W + offset))[j * 4 + threadIdx.x]; - neoscrypt_chacha(X); - } - - #pragma unroll - for (int i = 0; i < 4; i++) - { - *((uint32_t*)&(Tr + shiftTr)[i * 2] + 0 * 4 + threadIdx.x) = X[i].x; - *((uint32_t*)&(Tr + shiftTr)[i * 2] + 1 * 4 + threadIdx.x) = X[i].y; - *((uint32_t*)&(Tr + shiftTr)[i * 2] + 2 * 4 + threadIdx.x) = X[i].z; - *((uint32_t*)&(Tr + shiftTr)[i * 2] + 3 * 4 + threadIdx.x) = X[i].w; - } -} - -__global__ -__launch_bounds__(TPB, 1) -void neoscrypt_gpu_hash_salsa1() -{ - const uint32_t thread = (blockDim.y * blockIdx.x + threadIdx.y); - const uint32_t threads = (gridDim.x * blockDim.y); - const uint32_t shiftTr = 8U * thread; - - uint4 Z[4]; - for (int i = 0; i < 4; i++) - { - Z[i].x = __ldg((uint32_t*)&(Input + shiftTr)[i * 2] + ((0 + threadIdx.x) & 3) * 4 + threadIdx.x); - Z[i].y = __ldg((uint32_t*)&(Input + shiftTr)[i * 2] + ((1 + threadIdx.x) & 3) * 4 + threadIdx.x); - Z[i].z = __ldg((uint32_t*)&(Input + shiftTr)[i * 2] + ((2 + threadIdx.x) & 3) * 4 + threadIdx.x); - Z[i].w = __ldg((uint32_t*)&(Input + shiftTr)[i * 2] + ((3 + threadIdx.x) & 3) * 4 + threadIdx.x); - } - - #pragma nounroll - for (int i = 0; i < 128; i++) - { - uint32_t offset = 8U * (thread + threads * i); - for (int j = 0; j < 4; j++) - ((uint4*)(W + offset))[j * 4 + threadIdx.x] = Z[j]; - neoscrypt_salsa(Z); - } - - #pragma nounroll - for (int t = 0; t < 128; t++) - { - uint32_t offset = 8U * (thread + threads * (WarpShuffle(Z[3].x, 0, 4) & 0x7F)); - for (int j = 0; j < 4; j++) - Z[j] ^= ((uint4*)(W + offset))[j * 4 + threadIdx.x]; - neoscrypt_salsa(Z); - } - #pragma unroll - for (int i = 0; i < 4; i++) - { - *((uint32_t*)&(Tr2 + shiftTr)[i * 2] + ((0 + threadIdx.x) & 3) * 4 + threadIdx.x) = Z[i].x; - *((uint32_t*)&(Tr2 + shiftTr)[i * 2] + ((1 + threadIdx.x) & 3) * 4 + threadIdx.x) = Z[i].y; - *((uint32_t*)&(Tr2 + shiftTr)[i * 2] + ((2 + threadIdx.x) & 3) * 4 + threadIdx.x) = Z[i].z; - *((uint32_t*)&(Tr2 + shiftTr)[i * 2] + ((3 + threadIdx.x) & 3) * 4 + threadIdx.x) = Z[i].w; - } -} - -__global__ -__launch_bounds__(TPB2, 8) -void neoscrypt_gpu_hash_ending(const int stratum, const uint32_t startNonce, uint32_t *resNonces) -{ - __shared__ uint32_t s_data[64 * TPB2]; - - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - const uint32_t shiftTr = thread * 8U; - const uint32_t nonce = startNonce + thread; - const uint32_t ZNonce = (stratum) ? cuda_swab32(nonce) : nonce; - - __syncthreads(); - - uint2x4 Z[8]; - #pragma unroll - for (int i = 0; i<8; i++) - Z[i] = __ldg4(&(Tr2 + shiftTr)[i]) ^ __ldg4(&(Tr + shiftTr)[i]); - -#if __CUDA_ARCH__ < 500 - uint32_t outbuf = fastkdf32_v1(thread, ZNonce, (uint32_t*)Z, s_data); -#else - uint32_t outbuf = fastkdf32_v3(thread, ZNonce, (uint32_t*)Z, s_data); -#endif - - if (outbuf <= c_target[1]) - { - resNonces[0] = nonce; - //uint32_t tmp = atomicExch(resNonces, nonce); - //if(tmp != UINT32_MAX) - // resNonces[1] = tmp; - } -} - -static __thread uint32_t *hash1 = NULL; -static __thread uint32_t *Trans1 = NULL; -static __thread uint32_t *Trans2 = NULL; // 2 streams -static __thread uint32_t *Trans3 = NULL; // 2 streams - -__host__ -void neoscrypt_init(int thr_id, uint32_t threads) -{ - cuda_get_arch(thr_id); - - CUDA_SAFE_CALL(cudaMalloc(&d_NNonce[thr_id], 2 * sizeof(uint32_t))); - CUDA_SAFE_CALL(cudaMalloc(&hash1, 32 * 128 * sizeof(uint64_t) * threads)); - CUDA_SAFE_CALL(cudaMalloc(&Trans1, 32 * sizeof(uint64_t) * threads)); - CUDA_SAFE_CALL(cudaMalloc(&Trans2, 32 * sizeof(uint64_t) * threads)); - CUDA_SAFE_CALL(cudaMalloc(&Trans3, 32 * sizeof(uint64_t) * threads)); - - CUDA_SAFE_CALL(cudaMemcpyToSymbol(W, &hash1, sizeof(uint2x4*), 0, cudaMemcpyHostToDevice)); - CUDA_SAFE_CALL(cudaMemcpyToSymbol(Tr, &Trans1, sizeof(uint2x4*), 0, cudaMemcpyHostToDevice)); - CUDA_SAFE_CALL(cudaMemcpyToSymbol(Tr2, &Trans2, sizeof(uint2x4*), 0, cudaMemcpyHostToDevice)); - CUDA_SAFE_CALL(cudaMemcpyToSymbol(Input, &Trans3, sizeof(uint2x4*), 0, cudaMemcpyHostToDevice)); -} - -__host__ -void neoscrypt_free(int thr_id) -{ - cudaFree(d_NNonce[thr_id]); - - cudaFree(hash1); - cudaFree(Trans1); - cudaFree(Trans2); - cudaFree(Trans3); -} - -__host__ -void neoscrypt_hash_k4(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *resNonces, bool stratum) -{ - CUDA_SAFE_CALL(cudaMemset(d_NNonce[thr_id], 0xff, 2 * sizeof(uint32_t))); - - const int threadsperblock2 = TPB2; - dim3 grid2((threads + threadsperblock2 - 1) / threadsperblock2); - dim3 block2(threadsperblock2); - - const int threadsperblock = TPB; - dim3 grid3((threads * 4 + threadsperblock - 1) / threadsperblock); - dim3 block3(4, threadsperblock >> 2); - - neoscrypt_gpu_hash_start <<>> (stratum, startNounce); //fastkdf - - neoscrypt_gpu_hash_salsa1 <<>> (); - neoscrypt_gpu_hash_chacha1 <<>> (); - - neoscrypt_gpu_hash_ending <<>> (stratum, startNounce, d_NNonce[thr_id]); //fastkdf+end - - CUDA_SAFE_CALL(cudaMemcpy(resNonces, d_NNonce[thr_id], 2 * sizeof(uint32_t), cudaMemcpyDeviceToHost)); -} - -__host__ -void neoscrypt_setBlockTarget(uint32_t* const pdata, uint32_t* const target) -{ - uint32_t PaddedMessage[64]; - uint32_t input[16], key[16] = { 0 }; - - for (int i = 0; i < 19; i++) - { - PaddedMessage[i] = pdata[i]; - PaddedMessage[i + 20] = pdata[i]; - PaddedMessage[i + 40] = pdata[i]; - } - for (int i = 0; i<4; i++) - PaddedMessage[i + 60] = pdata[i]; - - PaddedMessage[19] = 0; - PaddedMessage[39] = 0; - PaddedMessage[59] = 0; - - ((uint16*)input)[0] = ((uint16*)pdata)[0]; - ((uint8*)key)[0] = ((uint8*)pdata)[0]; - - Blake2Shost(input, key); - - cudaMemcpyToSymbol(input_init, input, 64, 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(key_init, key, 64, 0, cudaMemcpyHostToDevice); - - cudaMemcpyToSymbol(c_target, &target[6], 2 * sizeof(uint32_t), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(c_data, PaddedMessage, 64 * sizeof(uint32_t), 0, cudaMemcpyHostToDevice); - CUDA_SAFE_CALL(cudaGetLastError()); -} - diff --git a/neoscrypt/cuda_vectors.h b/neoscrypt/cuda_vectors.h deleted file mode 100644 index 74e8843c..00000000 --- a/neoscrypt/cuda_vectors.h +++ /dev/null @@ -1,570 +0,0 @@ -#ifndef CUDA_VECTOR_H -#define CUDA_VECTOR_H - - -/////////////////////////////////////////////////////////////////////////////////// -#if (defined(_MSC_VER) && defined(_WIN64)) || defined(__LP64__) -#define __LDG_PTR "l" -#else -#define __LDG_PTR "r" -#endif - -#include "cuda_helper.h" - -//typedef __device_builtin__ struct ulong16 ulong16; - - -typedef struct __align__(32) uint8 -{ - unsigned int s0, s1, s2, s3, s4, s5, s6, s7; -} uint8; - -typedef struct __align__(64) ulonglong2to8 -{ -ulonglong2 l0,l1,l2,l3; -} ulonglong2to8; - -typedef struct __align__(128) ulonglong8to16 -{ - ulonglong2to8 lo, hi; -} ulonglong8to16; - -typedef struct __align__(256) ulonglong16to32 -{ - ulonglong8to16 lo, hi; -} ulonglong16to32; - -typedef struct __align__(512) ulonglong32to64 -{ - ulonglong16to32 lo, hi; -} ulonglong32to64; - - - -typedef struct __align__(1024) ulonglonglong -{ - ulonglong8to16 s0,s1,s2,s3,s4,s5,s6,s7; -} ulonglonglong; - - - - -typedef struct __align__(64) uint16 -{ - union { - struct {unsigned int s0, s1, s2, s3, s4, s5, s6, s7;}; - uint8 lo; - }; - union { - struct {unsigned int s8, s9, sa, sb, sc, sd, se, sf;}; - uint8 hi; - }; -} uint16; - -typedef struct __align__(128) uint32 -{ - - uint16 lo,hi; -} uint32; - - - -struct __align__(128) ulong8 -{ - ulonglong4 s0, s1, s2, s3; -}; -typedef __device_builtin__ struct ulong8 ulong8; - - -typedef struct __align__(256) ulonglong16 -{ - ulonglong2 s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sa, sb, sc, sd, se, sf; -} ulonglong16; - -typedef struct __align__(32) uint48 -{ - uint4 s0, s1; - -} uint48; - -typedef struct __align__(64) uint816 -{ - uint48 s0, s1; - -} uint816; - -typedef struct __align__(128) uint1632 -{ - uint816 s0, s1; - -} uint1632; - -typedef struct __align__(256) uintx64 -{ - uint1632 s0, s1; - -} uintx64; - -typedef struct __align__(512) uintx128 -{ - uintx64 s0, s1; - -} uintx128; - -typedef struct __align__(1024) uintx256 -{ - uintx128 s0, s1; - -} uintx256; - - - -typedef struct __align__(256) uint4x16 -{ - uint4 s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15; -} uint4x16; - -static __inline__ __device__ ulonglong2to8 make_ulonglong2to8(ulonglong2 s0, ulonglong2 s1, ulonglong2 s2, ulonglong2 s3) -{ -ulonglong2to8 t; t.l0=s0; t.l1=s1; t.l2=s2; t.l3=s3; -return t; -} - -static __inline__ __device__ ulonglong8to16 make_ulonglong8to16(const ulonglong2to8 &s0, const ulonglong2to8 &s1) -{ - ulonglong8to16 t; t.lo = s0; t.hi = s1; - return t; -} - -static __inline__ __device__ ulonglong16to32 make_ulonglong16to32(const ulonglong8to16 &s0, const ulonglong8to16 &s1) -{ - ulonglong16to32 t; t.lo = s0; t.hi = s1; - return t; -} - -static __inline__ __device__ ulonglong32to64 make_ulonglong32to64(const ulonglong16to32 &s0, const ulonglong16to32 &s1) -{ - ulonglong32to64 t; t.lo = s0; t.hi = s1; - return t; -} - - -static __inline__ __host__ __device__ ulonglonglong make_ulonglonglong( - const ulonglong8to16 &s0, const ulonglong8to16 &s1, const ulonglong8to16 &s2, const ulonglong8to16 &s3, - const ulonglong8to16 &s4, const ulonglong8to16 &s5, const ulonglong8to16 &s6, const ulonglong8to16 &s7) -{ - ulonglonglong t; t.s0 = s0; t.s1 = s1; t.s2 = s2; t.s3 = s3; t.s4 = s4; t.s5 = s5; t.s6 = s6; t.s7 = s7; - return t; -} - - -static __inline__ __device__ uint48 make_uint48(uint4 s0, uint4 s1) -{ - uint48 t; t.s0 = s0; t.s1 = s1; - return t; -} - -static __inline__ __device__ uint816 make_uint816(const uint48 &s0, const uint48 &s1) -{ - uint816 t; t.s0 = s0; t.s1 = s1; - return t; -} - -static __inline__ __device__ uint1632 make_uint1632(const uint816 &s0, const uint816 &s1) -{ - uint1632 t; t.s0 = s0; t.s1 = s1; - return t; -} - -static __inline__ __device__ uintx64 make_uintx64(const uint1632 &s0, const uint1632 &s1) -{ - uintx64 t; t.s0 = s0; t.s1 = s1; - return t; -} - -static __inline__ __device__ uintx128 make_uintx128(const uintx64 &s0, const uintx64 &s1) -{ - uintx128 t; t.s0 = s0; t.s1 = s1; - return t; -} - -static __inline__ __device__ uintx256 make_uintx256(const uintx128 &s0, const uintx128 &s1) -{ - uintx256 t; t.s0 = s0; t.s1 = s1; - return t; -} - - -static __inline__ __device__ uintx256 make_uintx64(const uintx128 &s0, const uintx128 &s1) -{ - uintx256 t; t.s0 = s0; t.s1 = s1; - return t; -} - - -static __inline__ __host__ __device__ uint4x16 make_uint4x16( - uint4 s0, uint4 s1, uint4 s2, uint4 s3, uint4 s4, uint4 s5, uint4 s6, uint4 s7, - uint4 s8, uint4 s9, uint4 sa, uint4 sb, uint4 sc, uint4 sd, uint4 se, uint4 sf) -{ - uint4x16 t; t.s0 = s0; t.s1 = s1; t.s2 = s2; t.s3 = s3; t.s4 = s4; t.s5 = s5; t.s6 = s6; t.s7 = s7; - t.s8 = s8; t.s9 = s9; t.s10 = sa; t.s11 = sb; t.s12 = sc; t.s13 = sd; t.s14 = se; t.s15 = sf; - return t; -} - - - - -static __inline__ __host__ __device__ uint16 make_uint16( - unsigned int s0, unsigned int s1, unsigned int s2, unsigned int s3, unsigned int s4, unsigned int s5, unsigned int s6, unsigned int s7, - unsigned int s8, unsigned int s9, unsigned int sa, unsigned int sb, unsigned int sc, unsigned int sd, unsigned int se, unsigned int sf) -{ - uint16 t; t.s0 = s0; t.s1 = s1; t.s2 = s2; t.s3 = s3; t.s4 = s4; t.s5 = s5; t.s6 = s6; t.s7 = s7; - t.s8 = s8; t.s9 = s9; t.sa = sa; t.sb = sb; t.sc = sc; t.sd = sd; t.se = se; t.sf = sf; - return t; -} - -static __inline__ __host__ __device__ uint16 make_uint16(const uint8 &a, const uint8 &b) -{ - uint16 t; t.lo=a; t.hi=b; return t; -} - -static __inline__ __host__ __device__ uint32 make_uint32(const uint16 &a, const uint16 &b) -{ - uint32 t; t.lo = a; t.hi = b; return t; -} - - -static __inline__ __host__ __device__ uint8 make_uint8( - unsigned int s0, unsigned int s1, unsigned int s2, unsigned int s3, unsigned int s4, unsigned int s5, unsigned int s6, unsigned int s7) -{ - uint8 t; t.s0 = s0; t.s1 = s1; t.s2 = s2; t.s3 = s3; t.s4 = s4; t.s5 = s5; t.s6 = s6; t.s7 = s7; - return t; -} - - -static __inline__ __host__ __device__ ulonglong16 make_ulonglong16(const ulonglong2 &s0, const ulonglong2 &s1, - const ulonglong2 &s2, const ulonglong2 &s3, const ulonglong2 &s4, const ulonglong2 &s5, const ulonglong2 &s6, const ulonglong2 &s7, - const ulonglong2 &s8, const ulonglong2 &s9, - const ulonglong2 &sa, const ulonglong2 &sb, const ulonglong2 &sc, const ulonglong2 &sd, const ulonglong2 &se, const ulonglong2 &sf -) { - ulonglong16 t; t.s0 = s0; t.s1 = s1; t.s2 = s2; t.s3 = s3; t.s4 = s4; t.s5 = s5; t.s6 = s6; t.s7 = s7; - t.s8 = s8; t.s9 = s9; t.sa = sa; t.sb = sb; t.sc = sc; t.sd = sd; t.se = se; t.sf = sf; - return t; -} - - - -static __inline__ __host__ __device__ ulong8 make_ulong8( - ulonglong4 s0, ulonglong4 s1, ulonglong4 s2, ulonglong4 s3) -{ - ulong8 t; t.s0 = s0; t.s1 = s1; t.s2 = s2; t.s3 = s3;// t.s4 = s4; t.s5 = s5; t.s6 = s6; t.s7 = s7; - return t; -} - - -static __forceinline__ __device__ uchar4 operator^ (uchar4 a, uchar4 b) { return make_uchar4(a.x ^ b.x, a.y ^ b.y, a.z ^ b.z, a.w ^ b.w); } -static __forceinline__ __device__ uchar4 operator+ (uchar4 a, uchar4 b) { return make_uchar4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); } - - - - - -static __forceinline__ __device__ uint4 operator^ (uint4 a, uint4 b) { return make_uint4(a.x ^ b.x, a.y ^ b.y, a.z ^ b.z, a.w ^ b.w); } -static __forceinline__ __device__ uint4 operator+ (uint4 a, uint4 b) { return make_uint4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); } - - -static __forceinline__ __device__ ulonglong4 operator^ (ulonglong4 a, ulonglong4 b) { return make_ulonglong4(a.x ^ b.x, a.y ^ b.y, a.z ^ b.z, a.w ^ b.w); } -static __forceinline__ __device__ ulonglong4 operator+ (ulonglong4 a, ulonglong4 b) { return make_ulonglong4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); } -static __forceinline__ __device__ ulonglong2 operator^ (ulonglong2 a, ulonglong2 b) { return make_ulonglong2(a.x ^ b.x, a.y ^ b.y); } -static __forceinline__ __device__ ulonglong2 operator+ (ulonglong2 a, ulonglong2 b) { return make_ulonglong2(a.x + b.x, a.y + b.y); } - -static __forceinline__ __device__ ulong8 operator^ (const ulong8 &a, const ulong8 &b) { - return make_ulong8(a.s0 ^ b.s0, a.s1 ^ b.s1, a.s2 ^ b.s2, a.s3 ^ b.s3); -} //, a.s4 ^ b.s4, a.s5 ^ b.s5, a.s6 ^ b.s6, a.s7 ^ b.s7); } - -static __forceinline__ __device__ ulong8 operator+ (const ulong8 &a, const ulong8 &b) { - return make_ulong8(a.s0 + b.s0, a.s1 + b.s1, a.s2 + b.s2, a.s3 + b.s3); -} //, a.s4 + b.s4, a.s5 + b.s5, a.s6 + b.s6, a.s7 + b.s7); } - - -static __forceinline__ __device__ __host__ uint8 operator^ (const uint8 &a, const uint8 &b) { return make_uint8(a.s0 ^ b.s0, a.s1 ^ b.s1, a.s2 ^ b.s2, a.s3 ^ b.s3, a.s4 ^ b.s4, a.s5 ^ b.s5, a.s6 ^ b.s6, a.s7 ^ b.s7); } - -static __forceinline__ __device__ __host__ uint8 operator+ (const uint8 &a, const uint8 &b) { return make_uint8(a.s0 + b.s0, a.s1 + b.s1, a.s2 + b.s2, a.s3 + b.s3, a.s4 + b.s4, a.s5 + b.s5, a.s6 + b.s6, a.s7 + b.s7); } - -////////////// mess++ ////// - -static __forceinline__ __device__ uint48 operator^ (const uint48 &a, const uint48 &b) { - return make_uint48(a.s0 ^ b.s0, a.s1 ^ b.s1); -} - -static __forceinline__ __device__ uint816 operator^ (const uint816 &a, const uint816 &b) { - return make_uint816(a.s0 ^ b.s0, a.s1 ^ b.s1); -} - -static __forceinline__ __device__ uint1632 operator^ (const uint1632 &a, const uint1632 &b) { - return make_uint1632(a.s0 ^ b.s0, a.s1 ^ b.s1); -} - - -static __forceinline__ __device__ uintx64 operator^ (const uintx64 &a, const uintx64 &b) { - return make_uintx64(a.s0 ^ b.s0, a.s1 ^ b.s1); -} - -static __forceinline__ __device__ uintx128 operator^ (const uintx128 &a, const uintx128 &b) { - return make_uintx128(a.s0 ^ b.s0, a.s1 ^ b.s1); -} - -static __forceinline__ __device__ uintx256 operator^ (const uintx256 &a, const uintx256 &b) { - return make_uintx256(a.s0 ^ b.s0, a.s1 ^ b.s1); -} - -///////////////////////// - -static __forceinline__ __device__ __host__ uint16 operator^ (const uint16 &a, const uint16 &b) { - return make_uint16(a.s0 ^ b.s0, a.s1 ^ b.s1, a.s2 ^ b.s2, a.s3 ^ b.s3, a.s4 ^ b.s4, a.s5 ^ b.s5, a.s6 ^ b.s6, a.s7 ^ b.s7, - a.s8 ^ b.s8, a.s9 ^ b.s9, a.sa ^ b.sa, a.sb ^ b.sb, a.sc ^ b.sc, a.sd ^ b.sd, a.se ^ b.se, a.sf ^ b.sf); -} - -static __forceinline__ __device__ __host__ uint16 operator+ (const uint16 &a, const uint16 &b) { - return make_uint16(a.s0 + b.s0, a.s1 + b.s1, a.s2 + b.s2, a.s3 + b.s3, a.s4 + b.s4, a.s5 + b.s5, a.s6 + b.s6, a.s7 + b.s7, - a.s8 + b.s8, a.s9 + b.s9, a.sa + b.sa, a.sb + b.sb, a.sc + b.sc, a.sd + b.sd, a.se + b.se, a.sf + b.sf); -} - -static __forceinline__ __device__ uint32 operator^ (const uint32 &a, const uint32 &b) { - return make_uint32(a.lo ^ b.lo, a.hi ^ b.hi); -} - -static __forceinline__ __device__ uint32 operator+ (const uint32 &a, const uint32 &b) { - return make_uint32(a.lo + b.lo, a.hi + b.hi); -} - -static __forceinline__ __device__ ulonglong16 operator^ (const ulonglong16 &a, const ulonglong16 &b) { - return make_ulonglong16(a.s0 ^ b.s0, a.s1 ^ b.s1, a.s2 ^ b.s2, a.s3 ^ b.s3, a.s4 ^ b.s4, a.s5 ^ b.s5, a.s6 ^ b.s6, a.s7 ^ b.s7, - a.s8 ^ b.s8, a.s9 ^ b.s9, a.sa ^ b.sa, a.sb ^ b.sb, a.sc ^ b.sc, a.sd ^ b.sd, a.se ^ b.se, a.sf ^ b.sf -); -} - -static __forceinline__ __device__ ulonglong16 operator+ (const ulonglong16 &a, const ulonglong16 &b) { - return make_ulonglong16(a.s0 + b.s0, a.s1 + b.s1, a.s2 + b.s2, a.s3 + b.s3, a.s4 + b.s4, a.s5 + b.s5, a.s6 + b.s6, a.s7 + b.s7, - a.s8 + b.s8, a.s9 + b.s9, a.sa + b.sa, a.sb + b.sb, a.sc + b.sc, a.sd + b.sd, a.se + b.se, a.sf + b.sf -); -} - -static __forceinline__ __device__ void operator^= (ulong8 &a, const ulong8 &b) { a = a ^ b; } -static __forceinline__ __device__ void operator^= (uintx64 &a, const uintx64 &b) { a = a ^ b; } - -static __forceinline__ __device__ void operator^= (uintx128 &a, const uintx128 &b) { a = a ^ b; } -static __forceinline__ __device__ void operator^= (uintx256 &a, const uintx256 &b) { a = a ^ b; } - - -static __forceinline__ __device__ void operator^= (uint816 &a, const uint816 &b) { a = a ^ b; } - -static __forceinline__ __device__ void operator^= (uint48 &a, const uint48 &b) { a = a ^ b; } - -static __forceinline__ __device__ void operator^= (uint32 &a, const uint32 &b) { a = a ^ b; } - -static __forceinline__ __device__ void operator+= (uint32 &a, const uint32 &b) { a = a + b; } - - -static __forceinline__ __device__ void operator^= (uint4 &a, uint4 b) { a = a ^ b; } -static __forceinline__ __device__ void operator^= (uchar4 &a, uchar4 b) { a = a ^ b; } -static __forceinline__ __device__ __host__ void operator^= (uint8 &a, const uint8 &b) { a = a ^ b; } -static __forceinline__ __device__ __host__ void operator^= (uint16 &a, const uint16 &b) { a = a ^ b; } - -static __forceinline__ __device__ void operator^= (ulonglong16 &a, const ulonglong16 &b) { a = a ^ b; } -static __forceinline__ __device__ void operator^= (ulonglong4 &a, const ulonglong4 &b) { a = a ^ b; } -static __forceinline__ __device__ void operator^= (ulonglong2 &a, const ulonglong2 &b) { a = a ^ b; } -static __forceinline__ __device__ void operator+= (ulonglong2 &a, const ulonglong2 &b) { a = a + b; } - -static __forceinline__ __device__ -ulonglong2to8 operator^ (const ulonglong2to8 &a, const ulonglong2to8 &b) -{ - return make_ulonglong2to8(a.l0 ^ b.l0, a.l1 ^ b.l1, a.l2 ^ b.l2, a.l3 ^ b.l3); -} -static __forceinline__ __device__ -ulonglong2to8 operator+ (const ulonglong2to8 &a, const ulonglong2to8 &b) -{ - return make_ulonglong2to8(a.l0 + b.l0, a.l1 + b.l1, a.l2 + b.l2, a.l3 + b.l3); -} - - -static __forceinline__ __device__ -ulonglong8to16 operator^ (const ulonglong8to16 &a, const ulonglong8to16 &b) -{ - return make_ulonglong8to16(a.lo ^ b.lo, a.hi ^ b.hi); -} - -static __forceinline__ __device__ -ulonglong8to16 operator+ (const ulonglong8to16 &a, const ulonglong8to16 &b) -{ - return make_ulonglong8to16(a.lo + b.lo, a.hi + b.hi); -} - -static __forceinline__ __device__ -ulonglong16to32 operator^ (const ulonglong16to32 &a, const ulonglong16to32 &b) -{ - return make_ulonglong16to32(a.lo ^ b.lo, a.hi ^ b.hi); -} - -static __forceinline__ __device__ -ulonglong16to32 operator+ (const ulonglong16to32 &a, const ulonglong16to32 &b) -{ - return make_ulonglong16to32(a.lo + b.lo, a.hi + b.hi); -} - -static __forceinline__ __device__ -ulonglong32to64 operator^ (const ulonglong32to64 &a, const ulonglong32to64 &b) -{ - return make_ulonglong32to64(a.lo ^ b.lo, a.hi ^ b.hi); -} - -static __forceinline__ __device__ -ulonglong32to64 operator+ (const ulonglong32to64 &a, const ulonglong32to64 &b) -{ - return make_ulonglong32to64(a.lo + b.lo, a.hi + b.hi); -} - - -static __forceinline__ __device__ ulonglonglong operator^ (const ulonglonglong &a, const ulonglonglong &b) { - return make_ulonglonglong(a.s0 ^ b.s0, a.s1 ^ b.s1, a.s2 ^ b.s2, a.s3 ^ b.s3, a.s4 ^ b.s4, a.s5 ^ b.s5, a.s6 ^ b.s6, a.s7 ^ b.s7); -} - -static __forceinline__ __device__ ulonglonglong operator+ (const ulonglonglong &a, const ulonglonglong &b) { - return make_ulonglonglong(a.s0 + b.s0, a.s1 + b.s1, a.s2 + b.s2, a.s3 + b.s3, a.s4 + b.s4, a.s5 + b.s5, a.s6 + b.s6, a.s7 + b.s7); -} - - -static __forceinline__ __device__ void operator^= (ulonglong2to8 &a, const ulonglong2to8 &b) { a = a ^ b; } -static __forceinline__ __device__ void operator+= (uint4 &a, uint4 b) { a = a + b; } -static __forceinline__ __device__ void operator+= (uchar4 &a, uchar4 b) { a = a + b; } -static __forceinline__ __device__ __host__ void operator+= (uint8 &a, const uint8 &b) { a = a + b; } -static __forceinline__ __device__ __host__ void operator+= (uint16 &a, const uint16 &b) { a = a + b; } -static __forceinline__ __device__ void operator+= (ulong8 &a, const ulong8 &b) { a = a + b; } -static __forceinline__ __device__ void operator+= (ulonglong16 &a, const ulonglong16 &b) { a = a + b; } -static __forceinline__ __device__ void operator+= (ulonglong8to16 &a, const ulonglong8to16 &b) { a = a + b; } -static __forceinline__ __device__ void operator^= (ulonglong8to16 &a, const ulonglong8to16 &b) { a = a ^ b; } - -static __forceinline__ __device__ void operator+= (ulonglong16to32 &a, const ulonglong16to32 &b) { a = a + b; } -static __forceinline__ __device__ void operator^= (ulonglong16to32 &a, const ulonglong16to32 &b) { a = a ^ b; } - -static __forceinline__ __device__ void operator+= (ulonglong32to64 &a, const ulonglong32to64 &b) { a = a + b; } -static __forceinline__ __device__ void operator^= (ulonglong32to64 &a, const ulonglong32to64 &b) { a = a ^ b; } - -static __forceinline__ __device__ void operator+= (ulonglonglong &a, const ulonglonglong &b) { a = a + b; } -static __forceinline__ __device__ void operator^= (ulonglonglong &a, const ulonglonglong &b) { a = a ^ b; } - -#if __CUDA_ARCH__ < 320 - -#define rotateL ROTL32 -#define rotateR ROTR32 - -#else - -static __forceinline__ __device__ uint32_t rotateL(uint32_t vec4, uint32_t shift) -{ - uint32_t ret; - asm("shf.l.wrap.b32 %0, %1, %2, %3;" : "=r"(ret) : "r"(vec4), "r"(vec4), "r"(shift)); - return ret; -} - -static __forceinline__ __device__ uint32_t rotateR(uint32_t vec4, uint32_t shift) -{ - uint32_t ret; - asm("shf.r.wrap.b32 %0, %1, %2, %3;" : "=r"(ret) : "r"(vec4), "r"(vec4), "r"(shift)); - return ret; -} - -#endif - -#if __CUDA_ARCH__ < 320 - -// right shift a 64-bytes integer (256-bits) by 0 8 16 24 bits -// require a uint32_t[9] ret array -// note: djm neoscrypt implementation is near the limits of gpu capabilities -// and weird behaviors can happen when tuning device functions code... -__device__ static void shift256R(uint32_t* ret, const uint8 &vec4, uint32_t shift) -{ - uint8_t *v = (uint8_t*) &vec4.s0; - uint8_t *r = (uint8_t*) ret; - uint8_t bytes = (uint8_t) (shift >> 3); - ret[0] = 0; - for (uint8_t i=bytes; i<32; i++) - r[i] = v[i-bytes]; - ret[8] = vec4.s7 >> (32 - shift); // shuffled part required -} - -#else - -// same for SM 3.5+, really faster ? -__device__ static void shift256R(uint32_t* ret, const uint8 &vec4, uint32_t shift) -{ - uint32_t truc = 0, truc2 = cuda_swab32(vec4.s7), truc3 = 0; - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(truc) : "r"(truc3), "r"(truc2), "r"(shift)); - ret[8] = cuda_swab32(truc); - truc3 = cuda_swab32(vec4.s6); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(truc) : "r"(truc2), "r"(truc3), "r"(shift)); - ret[7] = cuda_swab32(truc); - truc2 = cuda_swab32(vec4.s5); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(truc) : "r"(truc3), "r"(truc2), "r"(shift)); - ret[6] = cuda_swab32(truc); - truc3 = cuda_swab32(vec4.s4); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(truc) : "r"(truc2), "r"(truc3), "r"(shift)); - ret[5] = cuda_swab32(truc); - truc2 = cuda_swab32(vec4.s3); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(truc) : "r"(truc3), "r"(truc2), "r"(shift)); - ret[4] = cuda_swab32(truc); - truc3 = cuda_swab32(vec4.s2); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(truc) : "r"(truc2), "r"(truc3), "r"(shift)); - ret[3] = cuda_swab32(truc); - truc2 = cuda_swab32(vec4.s1); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(truc) : "r"(truc3), "r"(truc2), "r"(shift)); - ret[2] = cuda_swab32(truc); - truc3 = cuda_swab32(vec4.s0); - asm("shf.r.clamp.b32 %0, %1, %2, %3;" : "=r"(truc) : "r"(truc2), "r"(truc3), "r"(shift)); - ret[1] = cuda_swab32(truc); - asm("shr.b32 %0, %1, %2;" : "=r"(truc) : "r"(truc3), "r"(shift)); - ret[0] = cuda_swab32(truc); -} -#endif - -#if __CUDA_ARCH__ < 320 - -// copy 256 bytes -static __device__ __inline__ uintx64 ldg256(const uint4 *ptr) -{ - uintx64 ret; - uint32_t *dst = (uint32_t*) &ret.s0; - uint32_t *src = (uint32_t*) &ptr[0].x; - for (int i=0; i < (256 / sizeof(uint32_t)); i++) { - dst[i] = src[i]; - } - return ret; -} - -#else - -// complicated way to copy 256 bytes ;) -static __device__ __inline__ uintx64 ldg256(const uint4 *ptr) -{ - uintx64 ret; - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4];" : "=r"(ret.s0.s0.s0.s0.x), "=r"(ret.s0.s0.s0.s0.y), "=r"(ret.s0.s0.s0.s0.z), "=r"(ret.s0.s0.s0.s0.w) : __LDG_PTR(ptr)); - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4+16];" : "=r"(ret.s0.s0.s0.s1.x), "=r"(ret.s0.s0.s0.s1.y), "=r"(ret.s0.s0.s0.s1.z), "=r"(ret.s0.s0.s0.s1.w) : __LDG_PTR(ptr)); - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4+32];" : "=r"(ret.s0.s0.s1.s0.x), "=r"(ret.s0.s0.s1.s0.y), "=r"(ret.s0.s0.s1.s0.z), "=r"(ret.s0.s0.s1.s0.w) : __LDG_PTR(ptr)); - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4+48];" : "=r"(ret.s0.s0.s1.s1.x), "=r"(ret.s0.s0.s1.s1.y), "=r"(ret.s0.s0.s1.s1.z), "=r"(ret.s0.s0.s1.s1.w) : __LDG_PTR(ptr)); - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4+64];" : "=r"(ret.s0.s1.s0.s0.x), "=r"(ret.s0.s1.s0.s0.y), "=r"(ret.s0.s1.s0.s0.z), "=r"(ret.s0.s1.s0.s0.w) : __LDG_PTR(ptr)); - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4+80];" : "=r"(ret.s0.s1.s0.s1.x), "=r"(ret.s0.s1.s0.s1.y), "=r"(ret.s0.s1.s0.s1.z), "=r"(ret.s0.s1.s0.s1.w) : __LDG_PTR(ptr)); - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4+96];" : "=r"(ret.s0.s1.s1.s0.x), "=r"(ret.s0.s1.s1.s0.y), "=r"(ret.s0.s1.s1.s0.z), "=r"(ret.s0.s1.s1.s0.w) : __LDG_PTR(ptr)); - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4+112];" : "=r"(ret.s0.s1.s1.s1.x), "=r"(ret.s0.s1.s1.s1.y), "=r"(ret.s0.s1.s1.s1.z), "=r"(ret.s0.s1.s1.s1.w) : __LDG_PTR(ptr)); - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4+128];" : "=r"(ret.s1.s0.s0.s0.x), "=r"(ret.s1.s0.s0.s0.y), "=r"(ret.s1.s0.s0.s0.z), "=r"(ret.s1.s0.s0.s0.w) : __LDG_PTR(ptr)); - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4+144];" : "=r"(ret.s1.s0.s0.s1.x), "=r"(ret.s1.s0.s0.s1.y), "=r"(ret.s1.s0.s0.s1.z), "=r"(ret.s1.s0.s0.s1.w) : __LDG_PTR(ptr)); - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4+160];" : "=r"(ret.s1.s0.s1.s0.x), "=r"(ret.s1.s0.s1.s0.y), "=r"(ret.s1.s0.s1.s0.z), "=r"(ret.s1.s0.s1.s0.w) : __LDG_PTR(ptr)); - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4+176];" : "=r"(ret.s1.s0.s1.s1.x), "=r"(ret.s1.s0.s1.s1.y), "=r"(ret.s1.s0.s1.s1.z), "=r"(ret.s1.s0.s1.s1.w) : __LDG_PTR(ptr)); - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4+192];" : "=r"(ret.s1.s1.s0.s0.x), "=r"(ret.s1.s1.s0.s0.y), "=r"(ret.s1.s1.s0.s0.z), "=r"(ret.s1.s1.s0.s0.w) : __LDG_PTR(ptr)); - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4+208];" : "=r"(ret.s1.s1.s0.s1.x), "=r"(ret.s1.s1.s0.s1.y), "=r"(ret.s1.s1.s0.s1.z), "=r"(ret.s1.s1.s0.s1.w) : __LDG_PTR(ptr)); - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4+224];" : "=r"(ret.s1.s1.s1.s0.x), "=r"(ret.s1.s1.s1.s0.y), "=r"(ret.s1.s1.s1.s0.z), "=r"(ret.s1.s1.s1.s0.w) : __LDG_PTR(ptr)); - asm("ld.global.nc.v4.u32 {%0,%1,%2,%3}, [%4+240];" : "=r"(ret.s1.s1.s1.s1.x), "=r"(ret.s1.s1.s1.s1.y), "=r"(ret.s1.s1.s1.s1.z), "=r"(ret.s1.s1.s1.s1.w) : __LDG_PTR(ptr)); - return ret; -} -#endif - -#endif // #ifndef CUDA_VECTOR_H diff --git a/neoscrypt/neoscrypt-cpu.c b/neoscrypt/neoscrypt-cpu.c deleted file mode 100644 index d1ef2ff3..00000000 --- a/neoscrypt/neoscrypt-cpu.c +++ /dev/null @@ -1,989 +0,0 @@ -/* - * Copyright (c) 2009 Colin Percival, 2011 ArtForz - * Copyright (c) 2012 Andrew Moon (floodyberry) - * Copyright (c) 2012 Samuel Neves - * Copyright (c) 2014 John Doering - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - - -#include -#include -#include - -#include "neoscrypt.h" - -#ifdef WIN32 -/* sizeof(unsigned long) = 4 for MinGW64 */ -typedef unsigned long long ulong; -#else -typedef unsigned long ulong; -#endif -typedef unsigned int uint; -typedef unsigned char uchar; -typedef unsigned int bool; - -#define MIN(a, b) ((a) < (b) ? a : b) -#define MAX(a, b) ((a) > (b) ? a : b) - -/* SHA-256 */ - -static const uint32_t sha256_constants[64] = { - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -}; - -#define Ch(x,y,z) (z ^ (x & (y ^ z))) -#define Maj(x,y,z) (((x | y) & z) | (x & y)) -#define S0(x) (ROTR32(x, 2) ^ ROTR32(x, 13) ^ ROTR32(x, 22)) -#define S1(x) (ROTR32(x, 6) ^ ROTR32(x, 11) ^ ROTR32(x, 25)) -#define G0(x) (ROTR32(x, 7) ^ ROTR32(x, 18) ^ (x >> 3)) -#define G1(x) (ROTR32(x, 17) ^ ROTR32(x, 19) ^ (x >> 10)) -#define W0(in,i) (U8TO32_BE(&in[i * 4])) -#define W1(i) (G1(w[i - 2]) + w[i - 7] + G0(w[i - 15]) + w[i - 16]) -#define STEP(i) \ - t1 = S0(r[0]) + Maj(r[0], r[1], r[2]); \ - t0 = r[7] + S1(r[4]) + Ch(r[4], r[5], r[6]) + sha256_constants[i] + w[i]; \ - r[7] = r[6]; \ - r[6] = r[5]; \ - r[5] = r[4]; \ - r[4] = r[3] + t0; \ - r[3] = r[2]; \ - r[2] = r[1]; \ - r[1] = r[0]; \ - r[0] = t0 + t1; - - -typedef struct sha256_hash_state_t { - uint32_t H[8]; - uint64_t T; - uint32_t leftover; - uint8_t buffer[SCRYPT_HASH_BLOCK_SIZE]; -} sha256_hash_state; - - -static void sha256_blocks(sha256_hash_state *S, const uint8_t *in, size_t blocks) -{ - uint32_t r[8], w[64], t0, t1; - size_t i; - - for (i = 0; i < 8; i++) - r[i] = S->H[i]; - - while (blocks--) { - for (i = 0U; i < 16; i++) { - w[i] = W0(in, i); - } - for (i = 16; i < 64; i++) { - w[i] = W1(i); - } - for (i = 0U; i < 64; i++) { - STEP(i); - } - for (i = 0U; i < 8U; i++) { - r[i] += S->H[i]; - S->H[i] = r[i]; - } - S->T += SCRYPT_HASH_BLOCK_SIZE * 8; - in += SCRYPT_HASH_BLOCK_SIZE; - } -} - -static void neoscrypt_hash_init_sha256(sha256_hash_state *S) -{ - S->H[0] = 0x6a09e667; - S->H[1] = 0xbb67ae85; - S->H[2] = 0x3c6ef372; - S->H[3] = 0xa54ff53a; - S->H[4] = 0x510e527f; - S->H[5] = 0x9b05688c; - S->H[6] = 0x1f83d9ab; - S->H[7] = 0x5be0cd19; - S->T = 0; - S->leftover = 0; -} - -static void neoscrypt_hash_update_sha256(sha256_hash_state *S, const uint8_t *in, size_t inlen) -{ - size_t blocks, want; - - /* handle the previous data */ - if (S->leftover) { - want = (SCRYPT_HASH_BLOCK_SIZE - S->leftover); - want = (want < inlen) ? want : inlen; - memcpy(S->buffer + S->leftover, in, want); - S->leftover += (uint32_t)want; - if (S->leftover < SCRYPT_HASH_BLOCK_SIZE) - return; - in += want; - inlen -= want; - sha256_blocks(S, S->buffer, 1); - } - - /* handle the current data */ - blocks = (inlen & ~(SCRYPT_HASH_BLOCK_SIZE - 1)); - S->leftover = (uint32_t)(inlen - blocks); - if (blocks) { - sha256_blocks(S, in, blocks / SCRYPT_HASH_BLOCK_SIZE); - in += blocks; - } - - /* handle leftover data */ - if (S->leftover) - memcpy(S->buffer, in, S->leftover); -} - -static void neoscrypt_hash_finish_sha256(sha256_hash_state *S, uint8_t *hash) -{ - uint64_t t = S->T + (S->leftover * 8); - - S->buffer[S->leftover] = 0x80; - if (S->leftover <= 55) { - memset(S->buffer + S->leftover + 1, 0, 55 - S->leftover); - } else { - memset(S->buffer + S->leftover + 1, 0, 63 - S->leftover); - sha256_blocks(S, S->buffer, 1); - memset(S->buffer, 0, 56); - } - - U64TO8_BE(S->buffer + 56, t); - sha256_blocks(S, S->buffer, 1); - - U32TO8_BE(&hash[ 0], S->H[0]); - U32TO8_BE(&hash[ 4], S->H[1]); - U32TO8_BE(&hash[ 8], S->H[2]); - U32TO8_BE(&hash[12], S->H[3]); - U32TO8_BE(&hash[16], S->H[4]); - U32TO8_BE(&hash[20], S->H[5]); - U32TO8_BE(&hash[24], S->H[6]); - U32TO8_BE(&hash[28], S->H[7]); -} - -static void neoscrypt_hash_sha256(hash_digest hash, const uint8_t *m, size_t mlen) -{ - sha256_hash_state st; - neoscrypt_hash_init_sha256(&st); - neoscrypt_hash_update_sha256(&st, m, mlen); - neoscrypt_hash_finish_sha256(&st, hash); -} - - -/* HMAC for SHA-256 */ - -typedef struct sha256_hmac_state_t { - sha256_hash_state inner, outer; -} sha256_hmac_state; - -static void neoscrypt_hmac_init_sha256(sha256_hmac_state *st, const uint8_t *key, size_t keylen) -{ - uint8_t pad[SCRYPT_HASH_BLOCK_SIZE] = {0}; - size_t i; - - neoscrypt_hash_init_sha256(&st->inner); - neoscrypt_hash_init_sha256(&st->outer); - - if (keylen <= SCRYPT_HASH_BLOCK_SIZE) { - /* use the key directly if it's <= blocksize bytes */ - memcpy(pad, key, keylen); - } else { - /* if it's > blocksize bytes, hash it */ - neoscrypt_hash_sha256(pad, key, keylen); - } - - /* inner = (key ^ 0x36) */ - /* h(inner || ...) */ - for (i = 0; i < SCRYPT_HASH_BLOCK_SIZE; i++) - pad[i] ^= 0x36; - neoscrypt_hash_update_sha256(&st->inner, pad, SCRYPT_HASH_BLOCK_SIZE); - - /* outer = (key ^ 0x5c) */ - /* h(outer || ...) */ - for (i = 0; i < SCRYPT_HASH_BLOCK_SIZE; i++) - pad[i] ^= (0x5c ^ 0x36); - neoscrypt_hash_update_sha256(&st->outer, pad, SCRYPT_HASH_BLOCK_SIZE); -} - -static void neoscrypt_hmac_update_sha256(sha256_hmac_state *st, const uint8_t *m, size_t mlen) -{ - /* h(inner || m...) */ - neoscrypt_hash_update_sha256(&st->inner, m, mlen); -} - -static void neoscrypt_hmac_finish_sha256(sha256_hmac_state *st, hash_digest mac) -{ - /* h(inner || m) */ - hash_digest innerhash; - neoscrypt_hash_finish_sha256(&st->inner, innerhash); - - /* h(outer || h(inner || m)) */ - neoscrypt_hash_update_sha256(&st->outer, innerhash, sizeof(innerhash)); - neoscrypt_hash_finish_sha256(&st->outer, mac); -} - - -/* PBKDF2 for SHA-256 */ - -static void neoscrypt_pbkdf2_sha256(const uint8_t *password, size_t password_len, - const uint8_t *salt, size_t salt_len, uint64_t N, uint8_t *output, size_t output_len) -{ - sha256_hmac_state hmac_pw, hmac_pw_salt, work; - hash_digest ti, u; - uint8_t be[4]; - uint32_t i, j, k, blocks; - - /* bytes must be <= (0xffffffff - (SCRYPT_HASH_DIGEST_SIZE - 1)), which they will always be under scrypt */ - - /* hmac(password, ...) */ - neoscrypt_hmac_init_sha256(&hmac_pw, password, password_len); - - /* hmac(password, salt...) */ - hmac_pw_salt = hmac_pw; - neoscrypt_hmac_update_sha256(&hmac_pw_salt, salt, salt_len); - - blocks = ((uint32_t)output_len + (SCRYPT_HASH_DIGEST_SIZE - 1)) / SCRYPT_HASH_DIGEST_SIZE; - for(i = 1; i <= blocks; i++) { - /* U1 = hmac(password, salt || be(i)) */ - U32TO8_BE(be, i); - work = hmac_pw_salt; - neoscrypt_hmac_update_sha256(&work, be, 4); - neoscrypt_hmac_finish_sha256(&work, ti); - memcpy(u, ti, sizeof(u)); - - /* T[i] = U1 ^ U2 ^ U3... */ - for(j = 0; j < N - 1; j++) { - /* UX = hmac(password, U{X-1}) */ - work = hmac_pw; - neoscrypt_hmac_update_sha256(&work, u, SCRYPT_HASH_DIGEST_SIZE); - neoscrypt_hmac_finish_sha256(&work, u); - - /* T[i] ^= UX */ - for(k = 0; k < sizeof(u); k++) - ti[k] ^= u[k]; - } - - memcpy(output, ti, (output_len > SCRYPT_HASH_DIGEST_SIZE) ? SCRYPT_HASH_DIGEST_SIZE : output_len); - output += SCRYPT_HASH_DIGEST_SIZE; - output_len -= SCRYPT_HASH_DIGEST_SIZE; - } -} - - -/* NeoScrypt */ - -#if defined(ASM) - -extern void neoscrypt_salsa(uint *X, uint rounds); -extern void neoscrypt_salsa_tangle(uint *X, uint count); -extern void neoscrypt_chacha(uint *X, uint rounds); - -extern void neoscrypt_blkcpy(void *dstp, const void *srcp, uint len); -extern void neoscrypt_blkswp(void *blkAp, void *blkBp, uint len); -extern void neoscrypt_blkxor(void *dstp, const void *srcp, uint len); - -#else - -/* Salsa20, rounds must be a multiple of 2 */ -static void neoscrypt_salsa(uint *X, uint rounds) -{ - uint x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, t; - - x0 = X[0]; x1 = X[1]; x2 = X[2]; x3 = X[3]; - x4 = X[4]; x5 = X[5]; x6 = X[6]; x7 = X[7]; - x8 = X[8]; x9 = X[9]; x10 = X[10]; x11 = X[11]; - x12 = X[12]; x13 = X[13]; x14 = X[14]; x15 = X[15]; - -#define quarter(a, b, c, d) \ - t = a + d; t = ROTL32(t, 7); b ^= t; \ - t = b + a; t = ROTL32(t, 9); c ^= t; \ - t = c + b; t = ROTL32(t, 13); d ^= t; \ - t = d + c; t = ROTL32(t, 18); a ^= t; - - for(; rounds; rounds -= 2) { - quarter( x0, x4, x8, x12); - quarter( x5, x9, x13, x1); - quarter(x10, x14, x2, x6); - quarter(x15, x3, x7, x11); - quarter( x0, x1, x2, x3); - quarter( x5, x6, x7, x4); - quarter(x10, x11, x8, x9); - quarter(x15, x12, x13, x14); - } - - X[0] += x0; X[1] += x1; X[2] += x2; X[3] += x3; - X[4] += x4; X[5] += x5; X[6] += x6; X[7] += x7; - X[8] += x8; X[9] += x9; X[10] += x10; X[11] += x11; - X[12] += x12; X[13] += x13; X[14] += x14; X[15] += x15; - -#undef quarter -} - -/* ChaCha20, rounds must be a multiple of 2 */ -static void neoscrypt_chacha(uint *X, uint rounds) -{ - uint x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, t; - - x0 = X[0]; x1 = X[1]; x2 = X[2]; x3 = X[3]; - x4 = X[4]; x5 = X[5]; x6 = X[6]; x7 = X[7]; - x8 = X[8]; x9 = X[9]; x10 = X[10]; x11 = X[11]; - x12 = X[12]; x13 = X[13]; x14 = X[14]; x15 = X[15]; - -#define quarter(a,b,c,d) \ - a += b; t = d ^ a; d = ROTL32(t, 16); \ - c += d; t = b ^ c; b = ROTL32(t, 12); \ - a += b; t = d ^ a; d = ROTL32(t, 8); \ - c += d; t = b ^ c; b = ROTL32(t, 7); - - for(; rounds; rounds -= 2) { - quarter( x0, x4, x8, x12); - quarter( x1, x5, x9, x13); - quarter( x2, x6, x10, x14); - quarter( x3, x7, x11, x15); - quarter( x0, x5, x10, x15); - quarter( x1, x6, x11, x12); - quarter( x2, x7, x8, x13); - quarter( x3, x4, x9, x14); - } - - X[0] += x0; X[1] += x1; X[2] += x2; X[3] += x3; - X[4] += x4; X[5] += x5; X[6] += x6; X[7] += x7; - X[8] += x8; X[9] += x9; X[10] += x10; X[11] += x11; - X[12] += x12; X[13] += x13; X[14] += x14; X[15] += x15; - -#undef quarter -} - - -/* Fast 32-bit / 64-bit memcpy(); - * len must be a multiple of 32 bytes */ -static void neoscrypt_blkcpy(void *dstp, const void *srcp, uint len) -{ - ulong *dst = (ulong *) dstp; - ulong *src = (ulong *) srcp; - uint i; - - for(i = 0; i < (len / sizeof(ulong)); i += 4) { - dst[i] = src[i]; - dst[i + 1] = src[i + 1]; - dst[i + 2] = src[i + 2]; - dst[i + 3] = src[i + 3]; - } -} - -/* Fast 32-bit / 64-bit block swapper; - * len must be a multiple of 32 bytes */ -static void neoscrypt_blkswp(void *blkAp, void *blkBp, uint len) -{ - ulong *blkA = (ulong *) blkAp; - ulong *blkB = (ulong *) blkBp; - register ulong t0, t1, t2, t3; - uint i; - - for(i = 0; i < (len / sizeof(ulong)); i += 4) { - t0 = blkA[i]; - t1 = blkA[i + 1]; - t2 = blkA[i + 2]; - t3 = blkA[i + 3]; - blkA[i] = blkB[i]; - blkA[i + 1] = blkB[i + 1]; - blkA[i + 2] = blkB[i + 2]; - blkA[i + 3] = blkB[i + 3]; - blkB[i] = t0; - blkB[i + 1] = t1; - blkB[i + 2] = t2; - blkB[i + 3] = t3; - } -} - -/* Fast 32-bit / 64-bit block XOR engine; - * len must be a multiple of 32 bytes */ -static void neoscrypt_blkxor(void *dstp, const void *srcp, uint len) -{ - ulong *dst = (ulong *) dstp; - ulong *src = (ulong *) srcp; - uint i; - - for (i = 0; i < (len / sizeof(ulong)); i += 4) { - dst[i] ^= src[i]; - dst[i + 1] ^= src[i + 1]; - dst[i + 2] ^= src[i + 2]; - dst[i + 3] ^= src[i + 3]; - } -} - -#endif - -/* 32-bit / 64-bit optimised memcpy() */ -static void neoscrypt_copy(void *dstp, const void *srcp, uint len) -{ - ulong *dst = (ulong *) dstp; - ulong *src = (ulong *) srcp; - uint i, tail; - - for(i = 0; i < (len / sizeof(ulong)); i++) - dst[i] = src[i]; - - tail = len & (sizeof(ulong) - 1); - if(tail) { - uchar *dstb = (uchar *) dstp; - uchar *srcb = (uchar *) srcp; - - for(i = len - tail; i < len; i++) - dstb[i] = srcb[i]; - } -} - -/* 32-bit / 64-bit optimised memory erase aka memset() to zero */ -static void neoscrypt_erase(void *dstp, uint len) -{ - const ulong null = 0; - ulong *dst = (ulong *) dstp; - uint i, tail; - - for (i = 0; i < (len / sizeof(ulong)); i++) - dst[i] = null; - - tail = len & (sizeof(ulong) - 1); - if (tail) { - uchar *dstb = (uchar *) dstp; - - for(i = len - tail; i < len; i++) - dstb[i] = (uchar)null; - } -} - -/* 32-bit / 64-bit optimised XOR engine */ -static void neoscrypt_xor(void *dstp, const void *srcp, uint len) -{ - ulong *dst = (ulong *) dstp; - ulong *src = (ulong *) srcp; - uint i, tail; - - for (i = 0; i < (len / sizeof(ulong)); i++) - dst[i] ^= src[i]; - - tail = len & (sizeof(ulong) - 1); - if (tail) { - uchar *dstb = (uchar *) dstp; - uchar *srcb = (uchar *) srcp; - - for(i = len - tail; i < len; i++) - dstb[i] ^= srcb[i]; - } -} - - -/* BLAKE2s */ - -#define BLAKE2S_BLOCK_SIZE 64U -#define BLAKE2S_OUT_SIZE 32U -#define BLAKE2S_KEY_SIZE 32U - -/* Parameter block of 32 bytes */ -typedef struct blake2s_param_t { - uchar digest_length; - uchar key_length; - uchar fanout; - uchar depth; - uint leaf_length; - uchar node_offset[6]; - uchar node_depth; - uchar inner_length; - uchar salt[8]; - uchar personal[8]; -} blake2s_param; - -/* State block of 180 bytes */ -typedef struct blake2s_state_t { - uint h[8]; - uint t[2]; - uint f[2]; - uchar buf[2 * BLAKE2S_BLOCK_SIZE]; - uint buflen; -} blake2s_state; - -static const uint blake2s_IV[8] = { - 0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, - 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19 -}; - -static const uint8_t blake2s_sigma[10][16] = { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } , - { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } , - { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } , - { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } , - { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } , - { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } , - { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } , - { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } , - { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } , - { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 } , -}; - -static void blake2s_compress(blake2s_state *S, const uint *buf) -{ - uint i; - uint m[16]; - uint v[16]; - - neoscrypt_copy(m, buf, 64); - neoscrypt_copy(v, S, 32); - - v[ 8] = blake2s_IV[0]; - v[ 9] = blake2s_IV[1]; - v[10] = blake2s_IV[2]; - v[11] = blake2s_IV[3]; - v[12] = S->t[0] ^ blake2s_IV[4]; - v[13] = S->t[1] ^ blake2s_IV[5]; - v[14] = S->f[0] ^ blake2s_IV[6]; - v[15] = S->f[1] ^ blake2s_IV[7]; - -#define G(r,i,a,b,c,d) do { \ - a = a + b + m[blake2s_sigma[r][2*i+0]]; \ - d = ROTR32(d ^ a, 16); \ - c = c + d; \ - b = ROTR32(b ^ c, 12); \ - a = a + b + m[blake2s_sigma[r][2*i+1]]; \ - d = ROTR32(d ^ a, 8); \ - c = c + d; \ - b = ROTR32(b ^ c, 7); \ -} while(0) - -#define ROUND(r) do { \ - G(r, 0, v[ 0], v[ 4], v[ 8], v[12]); \ - G(r, 1, v[ 1], v[ 5], v[ 9], v[13]); \ - G(r, 2, v[ 2], v[ 6], v[10], v[14]); \ - G(r, 3, v[ 3], v[ 7], v[11], v[15]); \ - G(r, 4, v[ 0], v[ 5], v[10], v[15]); \ - G(r, 5, v[ 1], v[ 6], v[11], v[12]); \ - G(r, 6, v[ 2], v[ 7], v[ 8], v[13]); \ - G(r, 7, v[ 3], v[ 4], v[ 9], v[14]); \ -} while(0) - - ROUND(0); - ROUND(1); - ROUND(2); - ROUND(3); - ROUND(4); - ROUND(5); - ROUND(6); - ROUND(7); - ROUND(8); - ROUND(9); - - for (i = 0; i < 8; i++) - S->h[i] = S->h[i] ^ v[i] ^ v[i + 8]; - -#undef G -#undef ROUND -} - -static void blake2s_update(blake2s_state *S, const uchar *input, uint input_size) -{ - uint left, fill; - - while(input_size > 0) { - left = S->buflen; - fill = 2 * BLAKE2S_BLOCK_SIZE - left; - if(input_size > fill) { - /* Buffer fill */ - neoscrypt_copy(S->buf + left, input, fill); - S->buflen += fill; - /* Counter increment */ - S->t[0] += BLAKE2S_BLOCK_SIZE; - /* Compress */ - blake2s_compress(S, (uint *) S->buf); - /* Shift buffer left */ - neoscrypt_copy(S->buf, S->buf + BLAKE2S_BLOCK_SIZE, BLAKE2S_BLOCK_SIZE); - S->buflen -= BLAKE2S_BLOCK_SIZE; - input += fill; - input_size -= fill; - } else { - neoscrypt_copy(S->buf + left, input, input_size); - S->buflen += input_size; - /* Do not compress */ - input += input_size; - input_size = 0; - } - } -} - -static void neoscrypt_blake2s(const void *input, const uint input_size, const void *key, const uchar key_size, - void *output, const uchar output_size) -{ - uchar block[BLAKE2S_BLOCK_SIZE]; - blake2s_param P[1]; - blake2s_state S[1]; - - /* Initialise */ - neoscrypt_erase(P, 32); - P->digest_length = output_size; - P->key_length = key_size; - P->fanout = 1; - P->depth = 1; - - neoscrypt_erase(S, 180); - neoscrypt_copy(S, blake2s_IV, 32); - neoscrypt_xor(S, P, 32); - - neoscrypt_erase(block, BLAKE2S_BLOCK_SIZE); - neoscrypt_copy(block, key, key_size); - blake2s_update(S, (uchar *) block, BLAKE2S_BLOCK_SIZE); - - /* Update */ - blake2s_update(S, (uchar *) input, input_size); - - /* Finish */ - if(S->buflen > BLAKE2S_BLOCK_SIZE) { - S->t[0] += BLAKE2S_BLOCK_SIZE; - blake2s_compress(S, (uint *) S->buf); - S->buflen -= BLAKE2S_BLOCK_SIZE; - neoscrypt_copy(S->buf, S->buf + BLAKE2S_BLOCK_SIZE, S->buflen); - } - S->t[0] += S->buflen; - S->f[0] = ~0U; - neoscrypt_erase(S->buf + S->buflen, 2 * BLAKE2S_BLOCK_SIZE - S->buflen); - blake2s_compress(S, (uint *) S->buf); - - /* Write back */ - neoscrypt_copy(output, S, output_size); - - //for (int k = 0; k<4; k++) { printf("cpu blake %d %08x %08x\n", k, ((unsigned int*)output)[2 * k], ((unsigned int*)output)[2 * k + 1]); } -} - - -#define FASTKDF_BUFFER_SIZE 256U - -/* FastKDF, a fast buffered key derivation function: - * FASTKDF_BUFFER_SIZE must be a power of 2; - * password_len, salt_len and output_len should not exceed FASTKDF_BUFFER_SIZE; - * prf_output_size must be <= prf_key_size; */ -static void neoscrypt_fastkdf(const uchar *password, uint password_len, const uchar *salt, uint salt_len, - uint N, uchar *output, uint output_len) -{ - //for (int i = 0; i<10; i++) { printf("cpu password %d %08x %08x\n", i, ((unsigned int*)password)[2 * i], ((unsigned int*)password)[2 * i+1]); } - const uint stack_align = 0x40; - const uint kdf_buf_size = 256U; //FASTKDF_BUFFER_SIZE - const uint prf_input_size = 64U; //BLAKE2S_BLOCK_SIZE - const uint prf_key_size = 32U; //BLAKE2S_KEY_SIZE - const uint prf_output_size = 32U; //BLAKE2S_OUT_SIZE - uint bufptr, a, b, i, j; - uchar *A, *B, *prf_input, *prf_key, *prf_output; - uchar *stack; - stack = (uchar*)malloc(sizeof(uchar) * 2 * kdf_buf_size + prf_input_size + prf_key_size + prf_output_size + stack_align); - /* Align and set up the buffers in stack */ - //uchar stack[2 * kdf_buf_size + prf_input_size + prf_key_size + prf_output_size + stack_align]; - - A = &stack[stack_align & ~(stack_align - 1)]; - B = &A[kdf_buf_size + prf_input_size]; - prf_output = &A[2 * kdf_buf_size + prf_input_size + prf_key_size]; - - /* Initialise the password buffer */ - if(password_len > kdf_buf_size) - password_len = kdf_buf_size; - - a = kdf_buf_size / password_len; - for(i = 0; i < a; i++) - neoscrypt_copy(&A[i * password_len], &password[0], password_len); - b = kdf_buf_size - a * password_len; - if(b) - neoscrypt_copy(&A[a * password_len], &password[0], b); - neoscrypt_copy(&A[kdf_buf_size], &password[0], prf_input_size); - - /* Initialise the salt buffer */ - if(salt_len > kdf_buf_size) - salt_len = kdf_buf_size; - - a = kdf_buf_size / salt_len; - for(i = 0; i < a; i++) - neoscrypt_copy(&B[i * salt_len], &salt[0], salt_len); - b = kdf_buf_size - a * salt_len; - if(b) - neoscrypt_copy(&B[a * salt_len], &salt[0], b); - neoscrypt_copy(&B[kdf_buf_size], &salt[0], prf_key_size); - - /* The primary iteration */ - for(i = 0, bufptr = 0; i < N; i++) { - - /* Map the PRF input buffer */ - prf_input = &A[bufptr]; - - /* Map the PRF key buffer */ - prf_key = &B[bufptr]; - - /* PRF */ - // for (int k = 0; k<(prf_input_size/4); k++) { printf("cpu bufptr %08x before blake %d %d %08x \n",bufptr, i, k, ((unsigned int*)prf_input)[k]); } - neoscrypt_blake2s(prf_input, prf_input_size, prf_key, prf_key_size, prf_output, prf_output_size); - // for (int k = 0; k<(prf_output_size/4); k++) { printf("cpu after blake %d %d %08x \n", i, k, ((unsigned int*)prf_output)[k]); } - - /* Calculate the next buffer pointer */ - for(j = 0, bufptr = 0; j < prf_output_size; j++) - bufptr += prf_output[j]; - bufptr &= (kdf_buf_size - 1); - - /* Modify the salt buffer */ - neoscrypt_xor(&B[bufptr], &prf_output[0], prf_output_size); - - /* Head modified, tail updated */ - if(bufptr < prf_key_size) - neoscrypt_copy(&B[kdf_buf_size + bufptr], &B[bufptr], MIN(prf_output_size, prf_key_size - bufptr)); - - /* Tail modified, head updated */ - if((kdf_buf_size - bufptr) < prf_output_size) - neoscrypt_copy(&B[0], &B[kdf_buf_size], prf_output_size - (kdf_buf_size - bufptr)); - } - - /* Modify and copy into the output buffer */ - if(output_len > kdf_buf_size) - output_len = kdf_buf_size; - - a = kdf_buf_size - bufptr; - if(a >= output_len) { - neoscrypt_xor(&B[bufptr], &A[0], output_len); - neoscrypt_copy(&output[0], &B[bufptr], output_len); - } else { - neoscrypt_xor(&B[bufptr], &A[0], a); - neoscrypt_xor(&B[0], &A[a], output_len - a); - neoscrypt_copy(&output[0], &B[bufptr], a); - neoscrypt_copy(&output[a], &B[0], output_len - a); - } - // for (int i = 0; i<10; i++) { printf("cpu fastkdf %d %08x %08x\n", i, ((unsigned int*)output)[2 * i], ((unsigned int*)output)[2 * i + 1]); } -} - - -/* Configurable optimised block mixer */ -static void neoscrypt_blkmix(uint *X, uint *Y, uint r, uint mixmode) -{ - uint i, mixer, rounds; - - mixer = mixmode >> 8; - rounds = mixmode & 0xFF; - - /* NeoScrypt flow: Scrypt flow: - Xa ^= Xd; M(Xa'); Ya = Xa"; Xa ^= Xb; M(Xa'); Ya = Xa"; - Xb ^= Xa"; M(Xb'); Yb = Xb"; Xb ^= Xa"; M(Xb'); Yb = Xb"; - Xc ^= Xb"; M(Xc'); Yc = Xc"; Xa" = Ya; - Xd ^= Xc"; M(Xd'); Yd = Xd"; Xb" = Yb; - Xa" = Ya; Xb" = Yc; - Xc" = Yb; Xd" = Yd; */ - - if (r == 1) { - neoscrypt_blkxor(&X[0], &X[16], SCRYPT_BLOCK_SIZE); - if(mixer) - neoscrypt_chacha(&X[0], rounds); - else - neoscrypt_salsa(&X[0], rounds); - neoscrypt_blkxor(&X[16], &X[0], SCRYPT_BLOCK_SIZE); - if(mixer) - neoscrypt_chacha(&X[16], rounds); - else - neoscrypt_salsa(&X[16], rounds); - return; - } - - if (r == 2) { - neoscrypt_blkxor(&X[0], &X[48], SCRYPT_BLOCK_SIZE); - if(mixer) - neoscrypt_chacha(&X[0], rounds); - else - neoscrypt_salsa(&X[0], rounds); - neoscrypt_blkxor(&X[16], &X[0], SCRYPT_BLOCK_SIZE); - if(mixer) - neoscrypt_chacha(&X[16], rounds); - else - neoscrypt_salsa(&X[16], rounds); - neoscrypt_blkxor(&X[32], &X[16], SCRYPT_BLOCK_SIZE); - if(mixer) - neoscrypt_chacha(&X[32], rounds); - else - neoscrypt_salsa(&X[32], rounds); - neoscrypt_blkxor(&X[48], &X[32], SCRYPT_BLOCK_SIZE); - if(mixer) - neoscrypt_chacha(&X[48], rounds); - else - neoscrypt_salsa(&X[48], rounds); - neoscrypt_blkswp(&X[16], &X[32], SCRYPT_BLOCK_SIZE); - return; - } - - /* Reference code for any reasonable r */ - for (i = 0; i < 2 * r; i++) { - if(i) neoscrypt_blkxor(&X[16 * i], &X[16 * (i - 1)], SCRYPT_BLOCK_SIZE); - else neoscrypt_blkxor(&X[0], &X[16 * (2 * r - 1)], SCRYPT_BLOCK_SIZE); - if(mixer) - neoscrypt_chacha(&X[16 * i], rounds); - else - neoscrypt_salsa(&X[16 * i], rounds); - neoscrypt_blkcpy(&Y[16 * i], &X[16 * i], SCRYPT_BLOCK_SIZE); - } - for (i = 0; i < r; i++) - neoscrypt_blkcpy(&X[16 * i], &Y[16 * 2 * i], SCRYPT_BLOCK_SIZE); - for (i = 0; i < r; i++) - neoscrypt_blkcpy(&X[16 * (i + r)], &Y[16 * (2 * i + 1)], SCRYPT_BLOCK_SIZE); -} - -/* NeoScrypt core engine: - * p = 1, salt = password; - * Basic customisation (required): - * profile bit 0: - * 0 = NeoScrypt(128, 2, 1) with Salsa20/20 and ChaCha20/20; - * 1 = Scrypt(1024, 1, 1) with Salsa20/8; - * profile bits 4 to 1: - * 0000 = FastKDF-BLAKE2s; - * 0001 = PBKDF2-HMAC-SHA256; - * Extended customisation (optional): - * profile bit 31: - * 0 = extended customisation absent; - * 1 = extended customisation present; - * profile bits 7 to 5 (rfactor): - * 000 = r of 1; - * 001 = r of 2; - * 010 = r of 4; - * ... - * 111 = r of 128; - * profile bits 12 to 8 (Nfactor): - * 00000 = N of 2; - * 00001 = N of 4; - * 00010 = N of 8; - * ..... - * 00110 = N of 128; - * ..... - * 01001 = N of 1024; - * ..... - * 11110 = N of 2147483648; - * profile bits 30 to 13 are reserved */ -void neoscrypt(unsigned char *output, const unsigned char *input, unsigned int profile) -{ - uint N = 128, r = 2, dblmix = 1, mixmode = 0x14, stack_align = 0x40; - uint kdf, i, j; - uint *X, *Y, *Z, *V; - - if(profile & 0x1) { - N = 1024; /* N = (1 << (Nfactor + 1)); */ - r = 1; /* r = (1 << rfactor); */ - dblmix = 0; /* Salsa only */ - mixmode = 0x08; /* 8 rounds */ - } - - if(profile >> 31) { - N = (1 << (((profile >> 8) & 0x1F) + 1)); - r = (1 << ((profile >> 5) & 0x7)); - } - uchar *stack; - stack = (uchar*)malloc(((N + 3) * r * 2 * SCRYPT_BLOCK_SIZE + stack_align)*sizeof(uchar)); - /* X = r * 2 * SCRYPT_BLOCK_SIZE */ - X = (uint *) &stack[stack_align & ~(stack_align - 1)]; - /* Z is a copy of X for ChaCha */ - Z = &X[32 * r]; - /* Y is an X sized temporal space */ - Y = &X[64 * r]; - /* V = N * r * 2 * SCRYPT_BLOCK_SIZE */ - V = &X[96 * r]; - - /* X = KDF(password, salt) */ - kdf = (profile >> 1) & 0xF; - - switch(kdf) { - - default: - case(0x0): - neoscrypt_fastkdf(input, 80, input, 80, 32, (uchar *) X, r * 2 * SCRYPT_BLOCK_SIZE); - break; - - case(0x1): - neoscrypt_pbkdf2_sha256(input, 80, input, 80, 1, (uchar *) X, r * 2 * SCRYPT_BLOCK_SIZE); - break; - } - - /* Process ChaCha 1st, Salsa 2nd and XOR them into FastKDF; otherwise Salsa only */ - - if(dblmix) { - /* blkcpy(Z, X) */ - neoscrypt_blkcpy(&Z[0], &X[0], r * 2 * SCRYPT_BLOCK_SIZE); - - /* Z = SMix(Z) */ - for(i = 0; i < N; i++) { - /* blkcpy(V, Z) */ - neoscrypt_blkcpy(&V[i * (32 * r)], &Z[0], r * 2 * SCRYPT_BLOCK_SIZE); - /* blkmix(Z, Y) */ - neoscrypt_blkmix(&Z[0], &Y[0], r, (mixmode | 0x0100)); - } - for(i = 0; i < N; i++) { - /* integerify(Z) mod N */ - j = (32 * r) * (Z[16 * (2 * r - 1)] & (N - 1)); - /* blkxor(Z, V) */ - neoscrypt_blkxor(&Z[0], &V[j], r * 2 * SCRYPT_BLOCK_SIZE); - /* blkmix(Z, Y) */ - neoscrypt_blkmix(&Z[0], &Y[0], r, (mixmode | 0x0100)); - } - } - -#if (ASM) - /* Must be called before and after SSE2 Salsa */ - neoscrypt_salsa_tangle(&X[0], r * 2); -#endif - - /* X = SMix(X) */ - for(i = 0; i < N; i++) { - /* blkcpy(V, X) */ - neoscrypt_blkcpy(&V[i * (32 * r)], &X[0], r * 2 * SCRYPT_BLOCK_SIZE); - /* blkmix(X, Y) */ - neoscrypt_blkmix(&X[0], &Y[0], r, mixmode); - } - for(i = 0; i < N; i++) { - /* integerify(X) mod N */ - j = (32 * r) * (X[16 * (2 * r - 1)] & (N - 1)); - /* blkxor(X, V) */ - neoscrypt_blkxor(&X[0], &V[j], r * 2 * SCRYPT_BLOCK_SIZE); - /* blkmix(X, Y) */ - neoscrypt_blkmix(&X[0], &Y[0], r, mixmode); - } - -#if (ASM) - neoscrypt_salsa_tangle(&X[0], r * 2); -#endif - - if(dblmix) - /* blkxor(X, Z) */ - neoscrypt_blkxor(&X[0], &Z[0], r * 2 * SCRYPT_BLOCK_SIZE); - - /* output = KDF(password, X) */ - switch(kdf) { - - default: - case(0x0): - neoscrypt_fastkdf(input, 80, (uchar *) X, r * 2 * SCRYPT_BLOCK_SIZE, 32, output, 32); - break; - - case(0x1): - neoscrypt_pbkdf2_sha256(input, 80, (uchar *) X, r * 2 * SCRYPT_BLOCK_SIZE, 1, output, 32); - break; - } -} - diff --git a/neoscrypt/neoscrypt.cpp b/neoscrypt/neoscrypt.cpp deleted file mode 100644 index ba8c63a6..00000000 --- a/neoscrypt/neoscrypt.cpp +++ /dev/null @@ -1,121 +0,0 @@ -#include -#include -#include - -#include "neoscrypt.h" - -extern void neoscrypt_setBlockTarget(uint32_t* const data, uint32_t* const ptarget); - -extern void neoscrypt_init(int thr_id, uint32_t threads); -extern void neoscrypt_free(int thr_id); -extern void neoscrypt_hash_k4(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *resNonces, bool stratum); - -static bool init[MAX_GPUS] = { 0 }; - -int scanhash_neoscrypt(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t _ALIGN(64) endiandata[20]; - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - - int dev_id = device_map[thr_id]; - int intensity = is_windows() ? 18 : 19; - if (strstr(device_name[dev_id], "GTX 10")) intensity = 21; // >= 20 need more than 2GB - if (strstr(device_name[dev_id], "TITAN")) intensity = 21; - - uint32_t throughput = cuda_default_throughput(thr_id, 1U << intensity); - throughput = throughput / 32; /* set for max intensity ~= 20 */ - api_set_throughput(thr_id, throughput); - - if (opt_benchmark) - ptarget[7] = 0x00ff; - - if (!init[thr_id]) - { - cudaDeviceSynchronize(); - cudaSetDevice(dev_id); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - cudaGetLastError(); // reset errors if device is not "reset" - } - if (device_sm[dev_id] <= 300) { - gpulog(LOG_ERR, thr_id, "Sorry neoscrypt is not supported on SM 3.0 devices"); - proper_exit(EXIT_CODE_CUDA_ERROR); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g (+5), %u cuda threads", throughput2intensity(throughput), throughput); - - neoscrypt_init(thr_id, throughput); - - init[thr_id] = true; - } - - if (have_stratum) { - for (int k = 0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - } else { - for (int k = 0; k < 20; k++) - endiandata[k] = pdata[k]; - } - - neoscrypt_setBlockTarget(endiandata,ptarget); - - do { - memset(work->nonces, 0xff, sizeof(work->nonces)); - neoscrypt_hash_k4(thr_id, throughput, pdata[19], work->nonces, have_stratum); - - *hashes_done = pdata[19] - first_nonce + throughput; - - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - - if (have_stratum) { - be32enc(&endiandata[19], work->nonces[0]); - } else { - endiandata[19] = work->nonces[0]; - } - neoscrypt((uchar*)vhash, (uchar*) endiandata, 0x80000620U); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - pdata[19] = work->nonces[0] + 1; // cursor - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "nonce %08x does not validate on CPU!", work->nonces[0]); - } - } - - if ((uint64_t)throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - return 0; -} - -// cleanup -void free_neoscrypt(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - neoscrypt_free(thr_id); - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/neoscrypt/neoscrypt.h b/neoscrypt/neoscrypt.h deleted file mode 100644 index fc4d7e7c..00000000 --- a/neoscrypt/neoscrypt.h +++ /dev/null @@ -1,33 +0,0 @@ -#if (__cplusplus) -extern "C" { -#endif - -void neoscrypt(unsigned char *output, const unsigned char *input, unsigned int profile); - -#if (__cplusplus) -} -#else - -#define SCRYPT_BLOCK_SIZE 64 -#define SCRYPT_HASH_BLOCK_SIZE 64 -#define SCRYPT_HASH_DIGEST_SIZE 32 - -typedef uint8_t hash_digest[SCRYPT_HASH_DIGEST_SIZE]; - -#define ROTL32(a,b) (((a) << (b)) | ((a) >> (32 - b))) -#define ROTR32(a,b) (((a) >> (b)) | ((a) << (32 - b))) - -#define U8TO32_BE(p) \ - (((uint32_t)((p)[0]) << 24) | ((uint32_t)((p)[1]) << 16) | \ - ((uint32_t)((p)[2]) << 8) | ((uint32_t)((p)[3]))) - -#define U32TO8_BE(p, v) \ - (p)[0] = (uint8_t)((v) >> 24); (p)[1] = (uint8_t)((v) >> 16); \ - (p)[2] = (uint8_t)((v) >> 8); (p)[3] = (uint8_t)((v) ); - -#define U64TO8_BE(p, v) \ - U32TO8_BE((p), (uint32_t)((v) >> 32)); \ - U32TO8_BE((p) + 4, (uint32_t)((v) )); - -#endif - diff --git a/pentablake.cu b/pentablake.cu deleted file mode 100644 index 5c63d4a4..00000000 --- a/pentablake.cu +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Penta Blake - */ - -#include -#include -#include "miner.h" - -extern "C" { -#include "sph/sph_blake.h" -} - -/* hash by cpu with blake 256 */ -extern "C" void pentablakehash(void *output, const void *input) -{ - unsigned char _ALIGN(128) hash[64]; - - sph_blake512_context ctx; - - sph_blake512_init(&ctx); - sph_blake512(&ctx, input, 80); - sph_blake512_close(&ctx, hash); - - sph_blake512(&ctx, hash, 64); - sph_blake512_close(&ctx, hash); - - sph_blake512(&ctx, hash, 64); - sph_blake512_close(&ctx, hash); - - sph_blake512(&ctx, hash, 64); - sph_blake512_close(&ctx, hash); - - sph_blake512(&ctx, hash, 64); - sph_blake512_close(&ctx, hash); - - memcpy(output, hash, 32); -} - -#include "cuda_helper.h" - -static uint32_t *d_hash[MAX_GPUS]; - -extern void quark_blake512_cpu_init(int thr_id, uint32_t threads); -extern void quark_blake512_cpu_free(int thr_id); -extern void quark_blake512_cpu_setBlock_80(int thr_id, uint32_t *pdata); -extern void quark_blake512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash); -extern void quark_blake512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_pentablake(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t _ALIGN(64) endiandata[20]; - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - int rc = 0; - uint32_t throughput = cuda_default_throughput(thr_id, 1U << 19); - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ptarget[7] = 0x000F; - - if (!init[thr_id]) { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - CUDA_SAFE_CALL(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput)); - - quark_blake512_cpu_init(thr_id, throughput); - cuda_check_cpu_init(thr_id, throughput); - CUDA_LOG_ERROR(); - - init[thr_id] = true; - } - - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - quark_blake512_cpu_setBlock_80(thr_id, endiandata); - cuda_check_cpu_setTarget(ptarget); - - do { - int order = 0; - - // GPU HASH - quark_blake512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - quark_blake512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_blake512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_blake512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_blake512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - - *hashes_done = pdata[19] - first_nonce + throughput; - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - - be32enc(&endiandata[19], work->nonces[0]); - pentablakehash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - pentablakehash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - return rc; -} - -// cleanup -void free_pentablake(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - - quark_blake512_cpu_free(thr_id); - cuda_check_cpu_free(thr_id); - - cudaDeviceSynchronize(); - - init[thr_id] = false; -} diff --git a/pools.cpp b/pools.cpp index b94828bc..bada8e9a 100644 --- a/pools.cpp +++ b/pools.cpp @@ -253,8 +253,7 @@ bool pool_switch(int thr_id, int pooln) // temporary... until stratum code cleanup stratum = p->stratum; stratum.pooln = cur_pooln; - stratum.rpc2 = (p->algo == ALGO_WILDKECCAK || p->algo == ALGO_CRYPTONIGHT); - stratum.rpc2 |= p->algo == ALGO_CRYPTOLIGHT; + stratum.rpc2 = false; // unlock the stratum thread tq_push(thr_info[stratum_thr_id].q, strdup(rpc_url)); @@ -277,8 +276,7 @@ bool pool_switch(int thr_id, int pooln) } - stratum.rpc2 = (p->algo == ALGO_WILDKECCAK || p->algo == ALGO_CRYPTONIGHT); - stratum.rpc2 |= p->algo == ALGO_CRYPTOLIGHT; + stratum.rpc2 = false; return true; } diff --git a/quark/cuda_bmw512.cu b/quark/cuda_bmw512.cu deleted file mode 100644 index 6011beb5..00000000 --- a/quark/cuda_bmw512.cu +++ /dev/null @@ -1,491 +0,0 @@ -#include -#include - -#define WANT_BMW512_80 - -#include "cuda_helper.h" - -__constant__ uint64_t c_PaddedMessage80[16]; // padded message (80 bytes + padding) - -#include "cuda_bmw512_sm3.cuh" - -#ifdef __INTELLISENSE__ -/* just for vstudio code colors */ -#define __CUDA_ARCH__ 500 -#endif - -#undef SHL -#undef SHR -#undef CONST_EXP2 - -#define SHR(x, n) SHR2(x, n) -#define SHL(x, n) SHL2(x, n) -#define ROL(x, n) ROL2(x, n) - -#define CONST_EXP2(i) \ - q[i+0] + ROL(q[i+1], 5) + q[i+2] + ROL(q[i+3], 11) + \ - q[i+4] + ROL(q[i+5], 27) + q[i+6] + SWAPUINT2(q[i+7]) + \ - q[i+8] + ROL(q[i+9], 37) + q[i+10] + ROL(q[i+11], 43) + \ - q[i+12] + ROL(q[i+13], 53) + (SHR(q[i+14],1) ^ q[i+14]) + (SHR(q[i+15],2) ^ q[i+15]) - -__device__ -void Compression512_64_first(uint2 *msg, uint2 *hash) -{ - // Compression ref. implementation - uint2 q[32]; - uint2 tmp; - - tmp = (msg[5] ^ hash[5]) - (msg[7] ^ hash[7]) + (hash[10]) + (hash[13]) + (hash[14]); - q[0] = (SHR(tmp, 1) ^ SHL(tmp, 3) ^ ROL(tmp, 4) ^ ROL(tmp, 37)) + hash[1]; - - tmp = (msg[6] ^ hash[6]) - (msg[8] ^ hash[8]) + (hash[11]) + (hash[14]) - (msg[15] ^ hash[15]); - q[1] = (SHR(tmp, 1) ^ SHL(tmp, 2) ^ ROL(tmp, 13) ^ ROL(tmp, 43)) + hash[2]; - tmp = (msg[0] ^ hash[0]) + (msg[7] ^ hash[7]) + (hash[9]) - (hash[12]) + (msg[15] ^ hash[15]); - q[2] = (SHR(tmp, 2) ^ SHL(tmp, 1) ^ ROL(tmp, 19) ^ ROL(tmp, 53)) + hash[3]; - tmp = (msg[0] ^ hash[0]) - (msg[1] ^ hash[1]) + (msg[8] ^ hash[8]) - (hash[10]) + (hash[13]); - q[3] = (SHR(tmp, 2) ^ SHL(tmp, 2) ^ ROL(tmp, 28) ^ ROL(tmp, 59)) + hash[4]; - tmp = (msg[1] ^ hash[1]) + (msg[2] ^ hash[2]) + (hash[9]) - (hash[11]) - (hash[14]); - q[4] = (SHR(tmp, 1) ^ tmp) + hash[5]; - tmp = (msg[3] ^ hash[3]) - (msg[2] ^ hash[2]) + (hash[10]) - (hash[12]) + (msg[15] ^ hash[15]); - q[5] = (SHR(tmp, 1) ^ SHL(tmp, 3) ^ ROL(tmp, 4) ^ ROL(tmp, 37)) + hash[6]; - tmp = (msg[4] ^ hash[4]) - (msg[0] ^ hash[0]) - (msg[3] ^ hash[3]) - (hash[11]) + (hash[13]); - q[6] = (SHR(tmp, 1) ^ SHL(tmp, 2) ^ ROL(tmp, 13) ^ ROL(tmp, 43)) + hash[7]; - tmp = (msg[1] ^ hash[1]) - (msg[4] ^ hash[4]) - (msg[5] ^ hash[5]) - (hash[12]) - (hash[14]); - q[7] = (SHR(tmp, 2) ^ SHL(tmp, 1) ^ ROL(tmp, 19) ^ ROL(tmp, 53)) + hash[8]; - - tmp = (msg[2] ^ hash[2]) - (msg[5] ^ hash[5]) - (msg[6] ^ hash[6]) + (hash[13]) - (msg[15] ^ hash[15]); - q[8] = (SHR(tmp, 2) ^ SHL(tmp, 2) ^ ROL(tmp, 28) ^ ROL(tmp, 59)) + hash[9]; - tmp = (msg[0] ^ hash[0]) - (msg[3] ^ hash[3]) + (msg[6] ^ hash[6]) - (msg[7] ^ hash[7]) + (hash[14]); - q[9] = (SHR(tmp, 1) ^ tmp) + hash[10]; - tmp = (msg[8] ^ hash[8]) - (msg[1] ^ hash[1]) - (msg[4] ^ hash[4]) - (msg[7] ^ hash[7]) + (msg[15] ^ hash[15]); - q[10] = (SHR(tmp, 1) ^ SHL(tmp, 3) ^ ROL(tmp, 4) ^ ROL(tmp, 37)) + hash[11]; - tmp = (msg[8] ^ hash[8]) - (msg[0] ^ hash[0]) - (msg[2] ^ hash[2]) - (msg[5] ^ hash[5]) + (hash[9]); - q[11] = (SHR(tmp, 1) ^ SHL(tmp, 2) ^ ROL(tmp, 13) ^ ROL(tmp, 43)) + hash[12]; - tmp = (msg[1] ^ hash[1]) + (msg[3] ^ hash[3]) - (msg[6] ^ hash[6]) - (hash[9]) + (hash[10]); - q[12] = (SHR(tmp, 2) ^ SHL(tmp, 1) ^ ROL(tmp, 19) ^ ROL(tmp, 53)) + hash[13]; - tmp = (msg[2] ^ hash[2]) + (msg[4] ^ hash[4]) + (msg[7] ^ hash[7]) + (hash[10]) + (hash[11]); - q[13] = (SHR(tmp, 2) ^ SHL(tmp, 2) ^ ROL(tmp, 28) ^ ROL(tmp, 59)) + hash[14]; - tmp = (msg[3] ^ hash[3]) - (msg[5] ^ hash[5]) + (msg[8] ^ hash[8]) - (hash[11]) - (hash[12]); - q[14] = (SHR(tmp, 1) ^ tmp) + hash[15]; - tmp = (msg[12] ^ hash[12]) - (msg[4] ^ hash[4]) - (msg[6] ^ hash[6]) - (hash[9]) + (hash[13]); - q[15] = (SHR(tmp, 1) ^ SHL(tmp, 3) ^ ROL(tmp, 4) ^ ROL(tmp, 37)) + hash[0]; - - q[0 + 16] = - (SHR(q[0], 1) ^ SHL(q[0], 2) ^ ROL(q[0], 13) ^ ROL(q[0], 43)) + - (SHR(q[0 + 1], 2) ^ SHL(q[0 + 1], 1) ^ ROL(q[0 + 1], 19) ^ ROL(q[0 + 1], 53)) + - (SHR(q[0 + 2], 2) ^ SHL(q[0 + 2], 2) ^ ROL(q[0 + 2], 28) ^ ROL(q[0 + 2], 59)) + - (SHR(q[0 + 3], 1) ^ SHL(q[0 + 3], 3) ^ ROL(q[0 + 3], 4) ^ ROL(q[0 + 3], 37)) + - (SHR(q[0 + 4], 1) ^ SHL(q[0 + 4], 2) ^ ROL(q[0 + 4], 13) ^ ROL(q[0 + 4], 43)) + - (SHR(q[0 + 5], 2) ^ SHL(q[0 + 5], 1) ^ ROL(q[0 + 5], 19) ^ ROL(q[0 + 5], 53)) + - (SHR(q[0 + 6], 2) ^ SHL(q[0 + 6], 2) ^ ROL(q[0 + 6], 28) ^ ROL(q[0 + 6], 59)) + - (SHR(q[0 + 7], 1) ^ SHL(q[0 + 7], 3) ^ ROL(q[0 + 7], 4) ^ ROL(q[0 + 7], 37)) + - (SHR(q[0 + 8], 1) ^ SHL(q[0 + 8], 2) ^ ROL(q[0 + 8], 13) ^ ROL(q[0 + 8], 43)) + - (SHR(q[0 + 9], 2) ^ SHL(q[0 + 9], 1) ^ ROL(q[0 + 9], 19) ^ ROL(q[0 + 9], 53)) + - (SHR(q[0 + 10], 2) ^ SHL(q[0 + 10], 2) ^ ROL(q[0 + 10], 28) ^ ROL(q[0 + 10], 59)) + - (SHR(q[0 + 11], 1) ^ SHL(q[0 + 11], 3) ^ ROL(q[0 + 11], 4) ^ ROL(q[0 + 11], 37)) + - (SHR(q[0 + 12], 1) ^ SHL(q[0 + 12], 2) ^ ROL(q[0 + 12], 13) ^ ROL(q[0 + 12], 43)) + - (SHR(q[0 + 13], 2) ^ SHL(q[0 + 13], 1) ^ ROL(q[0 + 13], 19) ^ ROL(q[0 + 13], 53)) + - (SHR(q[0 + 14], 2) ^ SHL(q[0 + 14], 2) ^ ROL(q[0 + 14], 28) ^ ROL(q[0 + 14], 59)) + - (SHR(q[0 + 15], 1) ^ SHL(q[0 + 15], 3) ^ ROL(q[0 + 15], 4) ^ ROL(q[0 + 15], 37)) + - ((make_uint2(0x55555550ul,0x55555555) + ROL(msg[0], 0 + 1) + - ROL(msg[0 + 3], 0 + 4)) ^ hash[0 + 7]); - - q[1 + 16] = - (SHR(q[1], 1) ^ SHL(q[1], 2) ^ ROL(q[1], 13) ^ ROL(q[1], 43)) + - (SHR(q[1 + 1], 2) ^ SHL(q[1 + 1], 1) ^ ROL(q[1 + 1], 19) ^ ROL(q[1 + 1], 53)) + - (SHR(q[1 + 2], 2) ^ SHL(q[1 + 2], 2) ^ ROL(q[1 + 2], 28) ^ ROL(q[1 + 2], 59)) + - (SHR(q[1 + 3], 1) ^ SHL(q[1 + 3], 3) ^ ROL(q[1 + 3], 4) ^ ROL(q[1 + 3], 37)) + - (SHR(q[1 + 4], 1) ^ SHL(q[1 + 4], 2) ^ ROL(q[1 + 4], 13) ^ ROL(q[1 + 4], 43)) + - (SHR(q[1 + 5], 2) ^ SHL(q[1 + 5], 1) ^ ROL(q[1 + 5], 19) ^ ROL(q[1 + 5], 53)) + - (SHR(q[1 + 6], 2) ^ SHL(q[1 + 6], 2) ^ ROL(q[1 + 6], 28) ^ ROL(q[1 + 6], 59)) + - (SHR(q[1 + 7], 1) ^ SHL(q[1 + 7], 3) ^ ROL(q[1 + 7], 4) ^ ROL(q[1 + 7], 37)) + - (SHR(q[1 + 8], 1) ^ SHL(q[1 + 8], 2) ^ ROL(q[1 + 8], 13) ^ ROL(q[1 + 8], 43)) + - (SHR(q[1 + 9], 2) ^ SHL(q[1 + 9], 1) ^ ROL(q[1 + 9], 19) ^ ROL(q[1 + 9], 53)) + - (SHR(q[1 + 10], 2) ^ SHL(q[1 + 10], 2) ^ ROL(q[1 + 10], 28) ^ ROL(q[1 + 10], 59)) + - (SHR(q[1 + 11], 1) ^ SHL(q[1 + 11], 3) ^ ROL(q[1 + 11], 4) ^ ROL(q[1 + 11], 37)) + - (SHR(q[1 + 12], 1) ^ SHL(q[1 + 12], 2) ^ ROL(q[1 + 12], 13) ^ ROL(q[1 + 12], 43)) + - (SHR(q[1 + 13], 2) ^ SHL(q[1 + 13], 1) ^ ROL(q[1 + 13], 19) ^ ROL(q[1 + 13], 53)) + - (SHR(q[1 + 14], 2) ^ SHL(q[1 + 14], 2) ^ ROL(q[1 + 14], 28) ^ ROL(q[1 + 14], 59)) + - (SHR(q[1 + 15], 1) ^ SHL(q[1 + 15], 3) ^ ROL(q[1 + 15], 4) ^ ROL(q[1 + 15], 37)) + - ((make_uint2(0xAAAAAAA5, 0x5AAAAAAA) + ROL(msg[1], 1 + 1) + - ROL(msg[1 + 3], 1 + 4)) ^ hash[1 + 7]); - - q[2 + 16] = CONST_EXP2(2) + - ((make_uint2(0xFFFFFFFA, 0x5FFFFFFF) + ROL(msg[2], 2 + 1) + - ROL(msg[2 + 3], 2 + 4) - ROL(msg[2 + 10], 2 + 11)) ^ hash[2 + 7]); - q[3 + 16] = CONST_EXP2(3) + - ((make_uint2(0x5555554F, 0x65555555) + ROL(msg[3], 3 + 1) + - ROL(msg[3 + 3], 3 + 4) - ROL(msg[3 + 10], 3 + 11)) ^ hash[3 + 7]); - q[4 + 16] = CONST_EXP2(4) + - ((make_uint2(0xAAAAAAA4, 0x6AAAAAAA) +ROL(msg[4], 4 + 1) + - ROL(msg[4 + 3], 4 + 4) - ROL(msg[4 + 10], 4 + 11)) ^ hash[4 + 7]); - q[5 + 16] = CONST_EXP2(5) + - ((make_uint2(0xFFFFFFF9, 0x6FFFFFFF) + ROL(msg[5], 5 + 1) + - ROL(msg[5 + 3], 5 + 4) - ROL(msg[5 + 10], 5 + 11)) ^ hash[5 + 7]); - - #pragma unroll 3 - for (int i = 6; i<9; i++) { - q[i + 16] = CONST_EXP2(i) + - ((vectorize((i + 16)*(0x0555555555555555ull)) + ROL(msg[i], i + 1) - - ROL(msg[i - 6], (i - 6) + 1)) ^ hash[i + 7]); - } - - #pragma unroll 4 - for (int i = 9; i<13; i++) { - q[i + 16] = CONST_EXP2(i) + - ((vectorize((i + 16)*(0x0555555555555555ull)) + - ROL(msg[i + 3], i + 4) - ROL(msg[i - 6], (i - 6) + 1)) ^ hash[i - 9]); - } - - q[13 + 16] = CONST_EXP2(13) + - ((make_uint2(0xAAAAAAA1, 0x9AAAAAAA) + ROL(msg[13], 13 + 1) + - ROL(msg[13 - 13], (13 - 13) + 1) - ROL(msg[13 - 6], (13 - 6) + 1)) ^ hash[13 - 9]); - q[14 + 16] = CONST_EXP2(14) + - ((make_uint2(0xFFFFFFF6, 0x9FFFFFFF) + ROL(msg[14], 14 + 1) + - ROL(msg[14 - 13], (14 - 13) + 1) - ROL(msg[14 - 6], (14 - 6) + 1)) ^ hash[14 - 9]); - q[15 + 16] = CONST_EXP2(15) + - ((make_uint2(0x5555554B, 0xA5555555) + ROL(msg[15], 15 + 1) + - ROL(msg[15 - 13], (15 - 13) + 1) - ROL(msg[15 - 6], (15 - 6) + 1)) ^ hash[15 - 9]); - - - uint2 XL64 = q[16] ^ q[17] ^ q[18] ^ q[19] ^ q[20] ^ q[21] ^ q[22] ^ q[23]; - uint2 XH64 = XL64^q[24] ^ q[25] ^ q[26] ^ q[27] ^ q[28] ^ q[29] ^ q[30] ^ q[31]; - - hash[0] = (SHL(XH64, 5) ^ SHR(q[16], 5) ^ msg[0]) + (XL64 ^ q[24] ^ q[0]); - hash[1] = (SHR(XH64, 7) ^ SHL(q[17], 8) ^ msg[1]) + (XL64 ^ q[25] ^ q[1]); - hash[2] = (SHR(XH64, 5) ^ SHL(q[18], 5) ^ msg[2]) + (XL64 ^ q[26] ^ q[2]); - hash[3] = (SHR(XH64, 1) ^ SHL(q[19], 5) ^ msg[3]) + (XL64 ^ q[27] ^ q[3]); - hash[4] = (SHR(XH64, 3) ^ q[20] ^ msg[4]) + (XL64 ^ q[28] ^ q[4]); - hash[5] = (SHL(XH64, 6) ^ SHR(q[21], 6) ^ msg[5]) + (XL64 ^ q[29] ^ q[5]); - hash[6] = (SHR(XH64, 4) ^ SHL(q[22], 6) ^ msg[6]) + (XL64 ^ q[30] ^ q[6]); - hash[7] = (SHR(XH64, 11) ^ SHL(q[23], 2) ^ msg[7]) + (XL64 ^ q[31] ^ q[7]); - - hash[8] = ROL(hash[4], 9) + (XH64 ^ q[24] ^ msg[8]) + (SHL(XL64, 8) ^ q[23] ^ q[8]); - hash[9] = ROL(hash[5], 10) + (XH64 ^ q[25]) + (SHR(XL64, 6) ^ q[16] ^ q[9]); - hash[10] = ROL(hash[6], 11) + (XH64 ^ q[26]) + (SHL(XL64, 6) ^ q[17] ^ q[10]); - hash[11] = ROL(hash[7], 12) + (XH64 ^ q[27]) + (SHL(XL64, 4) ^ q[18] ^ q[11]); - hash[12] = ROL(hash[0], 13) + (XH64 ^ q[28]) + (SHR(XL64, 3) ^ q[19] ^ q[12]); - hash[13] = ROL(hash[1], 14) + (XH64 ^ q[29]) + (SHR(XL64, 4) ^ q[20] ^ q[13]); - hash[14] = ROL(hash[2], 15) + (XH64 ^ q[30]) + (SHR(XL64, 7) ^ q[21] ^ q[14]); - hash[15] = ROL(hash[3], 16) + (XH64 ^ q[31] ^ msg[15]) + (SHR(XL64, 2) ^ q[22] ^ q[15]); -} - -__device__ -void Compression512(uint2 *msg, uint2 *hash) -{ - // Compression ref. implementation - uint2 q[32]; - uint2 tmp; - - tmp = (msg[ 5] ^ hash[ 5]) - (msg[ 7] ^ hash[ 7]) + (msg[10] ^ hash[10]) + (msg[13] ^ hash[13]) + (msg[14] ^ hash[14]); - q[0] = (SHR(tmp, 1) ^ SHL(tmp, 3) ^ ROL(tmp, 4) ^ ROL(tmp, 37)) + hash[1]; - tmp = (msg[ 6] ^ hash[ 6]) - (msg[ 8] ^ hash[ 8]) + (msg[11] ^ hash[11]) + (msg[14] ^ hash[14]) - (msg[15] ^ hash[15]); - q[1] = (SHR(tmp, 1) ^ SHL(tmp, 2) ^ ROL(tmp, 13) ^ ROL(tmp, 43)) + hash[2]; - tmp = (msg[ 0] ^ hash[ 0]) + (msg[ 7] ^ hash[ 7]) + (msg[ 9] ^ hash[ 9]) - (msg[12] ^ hash[12]) + (msg[15] ^ hash[15]); - q[2] = (SHR(tmp, 2) ^ SHL(tmp, 1) ^ ROL(tmp, 19) ^ ROL(tmp, 53)) + hash[3]; - tmp = (msg[ 0] ^ hash[ 0]) - (msg[ 1] ^ hash[ 1]) + (msg[ 8] ^ hash[ 8]) - (msg[10] ^ hash[10]) + (msg[13] ^ hash[13]); - q[3] = (SHR(tmp, 2) ^ SHL(tmp, 2) ^ ROL(tmp, 28) ^ ROL(tmp, 59)) + hash[4]; - tmp = (msg[ 1] ^ hash[ 1]) + (msg[ 2] ^ hash[ 2]) + (msg[ 9] ^ hash[ 9]) - (msg[11] ^ hash[11]) - (msg[14] ^ hash[14]); - q[4] = (SHR(tmp, 1) ^ tmp) + hash[5]; - tmp = (msg[ 3] ^ hash[ 3]) - (msg[ 2] ^ hash[ 2]) + (msg[10] ^ hash[10]) - (msg[12] ^ hash[12]) + (msg[15] ^ hash[15]); - q[5] = (SHR(tmp, 1) ^ SHL(tmp, 3) ^ ROL(tmp, 4) ^ ROL(tmp, 37)) + hash[6]; - tmp = (msg[ 4] ^ hash[ 4]) - (msg[ 0] ^ hash[ 0]) - (msg[ 3] ^ hash[ 3]) - (msg[11] ^ hash[11]) + (msg[13] ^ hash[13]); - q[6] = (SHR(tmp, 1) ^ SHL(tmp, 2) ^ ROL(tmp, 13) ^ ROL(tmp, 43)) + hash[7]; - tmp = (msg[ 1] ^ hash[ 1]) - (msg[ 4] ^ hash[ 4]) - (msg[ 5] ^ hash[ 5]) - (msg[12] ^ hash[12]) - (msg[14] ^ hash[14]); - q[7] = (SHR(tmp, 2) ^ SHL(tmp, 1) ^ ROL(tmp, 19) ^ ROL(tmp, 53)) + hash[8]; - tmp = (msg[ 2] ^ hash[ 2]) - (msg[ 5] ^ hash[ 5]) - (msg[ 6] ^ hash[ 6]) + (msg[13] ^ hash[13]) - (msg[15] ^ hash[15]); - q[8] = (SHR(tmp, 2) ^ SHL(tmp, 2) ^ ROL(tmp, 28) ^ ROL(tmp, 59)) + hash[9]; - tmp = (msg[ 0] ^ hash[ 0]) - (msg[ 3] ^ hash[ 3]) + (msg[ 6] ^ hash[ 6]) - (msg[ 7] ^ hash[ 7]) + (msg[14] ^ hash[14]); - q[9] = (SHR(tmp, 1) ^ tmp) + hash[10]; - tmp = (msg[ 8] ^ hash[ 8]) - (msg[ 1] ^ hash[ 1]) - (msg[ 4] ^ hash[ 4]) - (msg[ 7] ^ hash[ 7]) + (msg[15] ^ hash[15]); - q[10] = (SHR(tmp, 1) ^ SHL(tmp, 3) ^ ROL(tmp, 4) ^ ROL(tmp, 37)) + hash[11]; - tmp = (msg[ 8] ^ hash[ 8]) - (msg[ 0] ^ hash[ 0]) - (msg[ 2] ^ hash[ 2]) - (msg[ 5] ^ hash[ 5]) + (msg[ 9] ^ hash[ 9]); - q[11] = (SHR(tmp, 1) ^ SHL(tmp, 2) ^ ROL(tmp, 13) ^ ROL(tmp, 43)) + hash[12]; - tmp = (msg[ 1] ^ hash[ 1]) + (msg[ 3] ^ hash[ 3]) - (msg[ 6] ^ hash[ 6]) - (msg[ 9] ^ hash[ 9]) + (msg[10] ^ hash[10]); - q[12] = (SHR(tmp, 2) ^ SHL(tmp, 1) ^ ROL(tmp, 19) ^ ROL(tmp, 53)) + hash[13]; - tmp = (msg[ 2] ^ hash[ 2]) + (msg[ 4] ^ hash[ 4]) + (msg[ 7] ^ hash[ 7]) + (msg[10] ^ hash[10]) + (msg[11] ^ hash[11]); - q[13] = (SHR(tmp, 2) ^ SHL(tmp, 2) ^ ROL(tmp, 28) ^ ROL(tmp, 59)) + hash[14]; - tmp = (msg[ 3] ^ hash[ 3]) - (msg[ 5] ^ hash[ 5]) + (msg[ 8] ^ hash[ 8]) - (msg[11] ^ hash[11]) - (msg[12] ^ hash[12]); - q[14] = (SHR(tmp, 1) ^ tmp) + hash[15]; - tmp = (msg[12] ^ hash[12]) - (msg[ 4] ^ hash[ 4]) - (msg[ 6] ^ hash[ 6]) - (msg[ 9] ^ hash[ 9]) + (msg[13] ^ hash[13]); - q[15] = (SHR(tmp, 1) ^ SHL(tmp, 3) ^ ROL(tmp, 4) ^ ROL(tmp, 37)) + hash[0]; - - q[0+16] = - (SHR(q[0], 1) ^ SHL(q[0], 2) ^ ROL(q[0], 13) ^ ROL(q[0], 43)) + - (SHR(q[0+1], 2) ^ SHL(q[0+1], 1) ^ ROL(q[0+1], 19) ^ ROL(q[0+1], 53)) + - (SHR(q[0+2], 2) ^ SHL(q[0+2], 2) ^ ROL(q[0+2], 28) ^ ROL(q[0+2], 59)) + - (SHR(q[0+3], 1) ^ SHL(q[0+3], 3) ^ ROL(q[0+3], 4) ^ ROL(q[0+3], 37)) + - (SHR(q[0+4], 1) ^ SHL(q[0+4], 2) ^ ROL(q[0+4], 13) ^ ROL(q[0+4], 43)) + - (SHR(q[0+5], 2) ^ SHL(q[0+5], 1) ^ ROL(q[0+5], 19) ^ ROL(q[0+5], 53)) + - (SHR(q[0+6], 2) ^ SHL(q[0+6], 2) ^ ROL(q[0+6], 28) ^ ROL(q[0+6], 59)) + - (SHR(q[0+7], 1) ^ SHL(q[0+7], 3) ^ ROL(q[0+7], 4) ^ ROL(q[0+7], 37)) + - (SHR(q[0+8], 1) ^ SHL(q[0+8], 2) ^ ROL(q[0+8], 13) ^ ROL(q[0+8], 43)) + - (SHR(q[0+9], 2) ^ SHL(q[0+9], 1) ^ ROL(q[0+9], 19) ^ ROL(q[0+9], 53)) + - (SHR(q[0+10], 2) ^ SHL(q[0+10], 2) ^ ROL(q[0+10], 28) ^ ROL(q[0+10], 59)) + - (SHR(q[0+11], 1) ^ SHL(q[0+11], 3) ^ ROL(q[0+11], 4) ^ ROL(q[0+11], 37)) + - (SHR(q[0+12], 1) ^ SHL(q[0+12], 2) ^ ROL(q[0+12], 13) ^ ROL(q[0+12], 43)) + - (SHR(q[0+13], 2) ^ SHL(q[0+13], 1) ^ ROL(q[0+13], 19) ^ ROL(q[0+13], 53)) + - (SHR(q[0+14], 2) ^ SHL(q[0+14], 2) ^ ROL(q[0+14], 28) ^ ROL(q[0+14], 59)) + - (SHR(q[0+15], 1) ^ SHL(q[0+15], 3) ^ ROL(q[0+15], 4) ^ ROL(q[0+15], 37)) + - ((make_uint2(0x55555550ul, 0x55555555) + ROL(msg[0], 0 + 1) + - ROL(msg[0+3], 0+4) - ROL(msg[0+10], 0+11) ) ^ hash[0+7]); - - q[1 + 16] = - (SHR(q[1], 1) ^ SHL(q[1], 2) ^ ROL(q[1], 13) ^ ROL(q[1], 43)) + - (SHR(q[1 + 1], 2) ^ SHL(q[1 + 1], 1) ^ ROL(q[1 + 1], 19) ^ ROL(q[1 + 1], 53)) + - (SHR(q[1 + 2], 2) ^ SHL(q[1 + 2], 2) ^ ROL(q[1 + 2], 28) ^ ROL(q[1 + 2], 59)) + - (SHR(q[1 + 3], 1) ^ SHL(q[1 + 3], 3) ^ ROL(q[1 + 3], 4) ^ ROL(q[1 + 3], 37)) + - (SHR(q[1 + 4], 1) ^ SHL(q[1 + 4], 2) ^ ROL(q[1 + 4], 13) ^ ROL(q[1 + 4], 43)) + - (SHR(q[1 + 5], 2) ^ SHL(q[1 + 5], 1) ^ ROL(q[1 + 5], 19) ^ ROL(q[1 + 5], 53)) + - (SHR(q[1 + 6], 2) ^ SHL(q[1 + 6], 2) ^ ROL(q[1 + 6], 28) ^ ROL(q[1 + 6], 59)) + - (SHR(q[1 + 7], 1) ^ SHL(q[1 + 7], 3) ^ ROL(q[1 + 7], 4) ^ ROL(q[1 + 7], 37)) + - (SHR(q[1 + 8], 1) ^ SHL(q[1 + 8], 2) ^ ROL(q[1 + 8], 13) ^ ROL(q[1 + 8], 43)) + - (SHR(q[1 + 9], 2) ^ SHL(q[1 + 9], 1) ^ ROL(q[1 + 9], 19) ^ ROL(q[1 + 9], 53)) + - (SHR(q[1 + 10], 2) ^ SHL(q[1 + 10], 2) ^ ROL(q[1 + 10], 28) ^ ROL(q[1 + 10], 59)) + - (SHR(q[1 + 11], 1) ^ SHL(q[1 + 11], 3) ^ ROL(q[1 + 11], 4) ^ ROL(q[1 + 11], 37)) + - (SHR(q[1 + 12], 1) ^ SHL(q[1 + 12], 2) ^ ROL(q[1 + 12], 13) ^ ROL(q[1 + 12], 43)) + - (SHR(q[1 + 13], 2) ^ SHL(q[1 + 13], 1) ^ ROL(q[1 + 13], 19) ^ ROL(q[1 + 13], 53)) + - (SHR(q[1 + 14], 2) ^ SHL(q[1 + 14], 2) ^ ROL(q[1 + 14], 28) ^ ROL(q[1 + 14], 59)) + - (SHR(q[1 + 15], 1) ^ SHL(q[1 + 15], 3) ^ ROL(q[1 + 15], 4) ^ ROL(q[1 + 15], 37)) + - ((make_uint2(0xAAAAAAA5, 0x5AAAAAAA) + ROL(msg[1], 1 + 1) + - ROL(msg[1 + 3], 1 + 4) - ROL(msg[1 + 10], 1 + 11)) ^ hash[1 + 7]); - - q[2 + 16] = CONST_EXP2(2) + - ((make_uint2(0xFFFFFFFA, 0x5FFFFFFF) + ROL(msg[2], 2 + 1) + - ROL(msg[2+3], 2+4) - ROL(msg[2+10], 2+11) ) ^ hash[2+7]); - q[3 + 16] = CONST_EXP2(3) + - ((make_uint2(0x5555554F, 0x65555555) + ROL(msg[3], 3 + 1) + - ROL(msg[3 + 3], 3 + 4) - ROL(msg[3 + 10], 3 + 11)) ^ hash[3 + 7]); - q[4 + 16] = CONST_EXP2(4) + - ((make_uint2(0xAAAAAAA4, 0x6AAAAAAA) + ROL(msg[4], 4 + 1) + - ROL(msg[4 + 3], 4 + 4) - ROL(msg[4 + 10], 4 + 11)) ^ hash[4 + 7]); - q[5 + 16] = CONST_EXP2(5) + - ((make_uint2(0xFFFFFFF9, 0x6FFFFFFF) + ROL(msg[5], 5 + 1) + - ROL(msg[5 + 3], 5 + 4) - ROL(msg[5 + 10], 5 + 11)) ^ hash[5 + 7]); - q[6 + 16] = CONST_EXP2(6) + - ((make_uint2(0x5555554E, 0x75555555)+ ROL(msg[6], 6 + 1) + - ROL(msg[6 + 3], 6 + 4) - ROL(msg[6 - 6], (6 - 6) + 1)) ^ hash[6 + 7]); - q[7 + 16] = CONST_EXP2(7) + - ((make_uint2(0xAAAAAAA3, 0x7AAAAAAA) + ROL(msg[7], 7 + 1) + - ROL(msg[7 + 3], 7 + 4) - ROL(msg[7 - 6], (7 - 6) + 1)) ^ hash[7 + 7]); - q[8 + 16] = CONST_EXP2(8) + - ((make_uint2(0xFFFFFFF8, 0x7FFFFFFF) + ROL(msg[8], 8 + 1) + - ROL(msg[8 + 3], 8 + 4) - ROL(msg[8 - 6], (8 - 6) + 1)) ^ hash[8 + 7]); - q[9 + 16] = CONST_EXP2(9) + - ((make_uint2(0x5555554D, 0x85555555) + ROL(msg[9], 9 + 1) + - ROL(msg[9 + 3], 9 + 4) - ROL(msg[9 - 6], (9 - 6) + 1)) ^ hash[9 - 9]); - q[10 + 16] = CONST_EXP2(10) + - ((make_uint2(0xAAAAAAA2, 0x8AAAAAAA) + ROL(msg[10], 10 + 1) + - ROL(msg[10 + 3], 10 + 4) - ROL(msg[10 - 6], (10 - 6) + 1)) ^ hash[10 - 9]); - q[11 + 16] = CONST_EXP2(11) + - ((make_uint2(0xFFFFFFF7, 0x8FFFFFFF) + ROL(msg[11], 11 + 1) + - ROL(msg[11 + 3], 11 + 4) - ROL(msg[11 - 6], (11 - 6) + 1)) ^ hash[11 - 9]); - q[12 + 16] = CONST_EXP2(12) + - ((make_uint2(0x5555554C, 0x95555555) + ROL(msg[12], 12 + 1) + - ROL(msg[12 + 3], 12 + 4) - ROL(msg[12 - 6], (12 - 6) + 1)) ^ hash[12 - 9]); - q[13 + 16] = CONST_EXP2(13) + - ((make_uint2(0xAAAAAAA1, 0x9AAAAAAA) + ROL(msg[13], 13 + 1) + - ROL(msg[13 - 13], (13 - 13) + 1) - ROL(msg[13 - 6], (13 - 6) + 1)) ^ hash[13 - 9]); - q[14 + 16] = CONST_EXP2(14) + - ((make_uint2(0xFFFFFFF6, 0x9FFFFFFF) + ROL(msg[14], 14 + 1) + - ROL(msg[14 - 13], (14 - 13) + 1) - ROL(msg[14 - 6], (14 - 6) + 1)) ^ hash[14 - 9]); - q[15 + 16] = CONST_EXP2(15) + - ((make_uint2(0x5555554B, 0xA5555555) + ROL(msg[15], 15 + 1) + - ROL(msg[15 - 13], (15 - 13) + 1) - ROL(msg[15 - 6], (15 - 6) + 1)) ^ hash[15 - 9]); - - uint2 XL64 = q[16]^q[17]^q[18]^q[19]^q[20]^q[21]^q[22]^q[23]; - uint2 XH64 = XL64^q[24] ^ q[25] ^ q[26] ^ q[27] ^ q[28] ^ q[29] ^ q[30] ^ q[31]; - - hash[0] = (SHL(XH64, 5) ^ SHR(q[16],5) ^ msg[ 0]) + (XL64 ^ q[24] ^ q[ 0]); - hash[1] = (SHR(XH64, 7) ^ SHL(q[17],8) ^ msg[ 1]) + (XL64 ^ q[25] ^ q[ 1]); - hash[2] = (SHR(XH64, 5) ^ SHL(q[18],5) ^ msg[ 2]) + (XL64 ^ q[26] ^ q[ 2]); - hash[3] = (SHR(XH64, 1) ^ SHL(q[19],5) ^ msg[ 3]) + (XL64 ^ q[27] ^ q[ 3]); - hash[4] = (SHR(XH64, 3) ^ q[20] ^ msg[ 4]) + (XL64 ^ q[28] ^ q[ 4]); - hash[5] = (SHL(XH64, 6) ^ SHR(q[21],6) ^ msg[ 5]) + (XL64 ^ q[29] ^ q[ 5]); - hash[6] = (SHR(XH64, 4) ^ SHL(q[22],6) ^ msg[ 6]) + (XL64 ^ q[30] ^ q[ 6]); - hash[7] = (SHR(XH64,11) ^ SHL(q[23],2) ^ msg[ 7]) + (XL64 ^ q[31] ^ q[ 7]); - - hash[ 8] = ROL(hash[4], 9) + (XH64 ^ q[24] ^ msg[ 8]) + (SHL(XL64,8) ^ q[23] ^ q[ 8]); - hash[ 9] = ROL(hash[5],10) + (XH64 ^ q[25] ^ msg[ 9]) + (SHR(XL64,6) ^ q[16] ^ q[ 9]); - hash[10] = ROL(hash[6],11) + (XH64 ^ q[26] ^ msg[10]) + (SHL(XL64,6) ^ q[17] ^ q[10]); - hash[11] = ROL(hash[7],12) + (XH64 ^ q[27] ^ msg[11]) + (SHL(XL64,4) ^ q[18] ^ q[11]); - hash[12] = ROL(hash[0],13) + (XH64 ^ q[28] ^ msg[12]) + (SHR(XL64,3) ^ q[19] ^ q[12]); - hash[13] = ROL(hash[1],14) + (XH64 ^ q[29] ^ msg[13]) + (SHR(XL64,4) ^ q[20] ^ q[13]); - hash[14] = ROL(hash[2],15) + (XH64 ^ q[30] ^ msg[14]) + (SHR(XL64,7) ^ q[21] ^ q[14]); - hash[15] = ROL(hash[3],16) + (XH64 ^ q[31] ^ msg[15]) + (SHR(XL64, 2) ^ q[22] ^ q[15]); -} - -__global__ -#if __CUDA_ARCH__ > 500 -__launch_bounds__(32, 16) -#else -__launch_bounds__(64, 8) -#endif -void quark_bmw512_gpu_hash_64(uint32_t threads, uint32_t startNounce, uint64_t *g_hash, uint32_t *g_nonceVector) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t nounce = (g_nonceVector != NULL) ? g_nonceVector[thread] : (startNounce + thread); - - uint32_t hashPosition = nounce - startNounce; - uint64_t *inpHash = &g_hash[hashPosition * 8]; - - // Init - uint2 h[16] = { - { 0x84858687UL, 0x80818283UL }, - { 0x8C8D8E8FUL, 0x88898A8BUL }, - { 0x94959697UL, 0x90919293UL }, - { 0x9C9D9E9FUL, 0x98999A9BUL }, - { 0xA4A5A6A7UL, 0xA0A1A2A3UL }, - { 0xACADAEAFUL, 0xA8A9AAABUL }, - { 0xB4B5B6B7UL, 0xB0B1B2B3UL }, - { 0xBCBDBEBFUL, 0xB8B9BABBUL }, - { 0xC4C5C6C7UL, 0xC0C1C2C3UL }, - { 0xCCCDCECFUL, 0xC8C9CACBUL }, - { 0xD4D5D6D7UL, 0xD0D1D2D3UL }, - { 0xDCDDDEDFUL, 0xD8D9DADBUL }, - { 0xE4E5E6E7UL, 0xE0E1E2E3UL }, - { 0xECEDEEEFUL, 0xE8E9EAEBUL }, - { 0xF4F5F6F7UL, 0xF0F1F2F3UL }, - { 0xFCFDFEFFUL, 0xF8F9FAFBUL } - }; - - // Nachricht kopieren (Achtung, die Nachricht hat 64 Byte, - // BMW arbeitet mit 128 Byte!!! - uint2 message[16]; - #pragma unroll - for(int i=0;i<8;i++) - message[i] = vectorize(inpHash[i]); - - #pragma unroll 6 - for(int i=9;i<15;i++) - message[i] = make_uint2(0,0); - - // Padding einfügen (Byteorder?!?) - message[8] = make_uint2(0x80,0); - // Länge (in Bits, d.h. 64 Byte * 8 = 512 Bits - message[15] = make_uint2(512,0); - - // Compression 1 - Compression512_64_first(message, h); - - // Final - #pragma unroll - for(int i=0;i<16;i++) - { - message[i].y = 0xaaaaaaaa; - message[i].x = 0xaaaaaaa0ul + (uint32_t)i; - } - Compression512(h, message); - - // fertig - uint64_t *outpHash = &g_hash[hashPosition * 8]; - - #pragma unroll - for(int i=0;i<8;i++) - outpHash[i] = devectorize(message[i+8]); - } -} - -__global__ __launch_bounds__(256, 2) -void quark_bmw512_gpu_hash_80(uint32_t threads, uint32_t startNounce, uint64_t *g_hash) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t nounce = startNounce + thread; - - // Init - uint2 h[16] = { - { 0x84858687UL, 0x80818283UL }, - { 0x8C8D8E8FUL, 0x88898A8BUL }, - { 0x94959697UL, 0x90919293UL }, - { 0x9C9D9E9FUL, 0x98999A9BUL }, - { 0xA4A5A6A7UL, 0xA0A1A2A3UL }, - { 0xACADAEAFUL, 0xA8A9AAABUL }, - { 0xB4B5B6B7UL, 0xB0B1B2B3UL }, - { 0xBCBDBEBFUL, 0xB8B9BABBUL }, - { 0xC4C5C6C7UL, 0xC0C1C2C3UL }, - { 0xCCCDCECFUL, 0xC8C9CACBUL }, - { 0xD4D5D6D7UL, 0xD0D1D2D3UL }, - { 0xDCDDDEDFUL, 0xD8D9DADBUL }, - { 0xE4E5E6E7UL, 0xE0E1E2E3UL }, - { 0xECEDEEEFUL, 0xE8E9EAEBUL }, - { 0xF4F5F6F7UL, 0xF0F1F2F3UL }, - { 0xFCFDFEFFUL, 0xF8F9FAFBUL } - }; - // Nachricht kopieren (Achtung, die Nachricht hat 64 Byte, - // BMW arbeitet mit 128 Byte!!! - uint2 message[16]; -#pragma unroll 16 - for(int i=0;i<16;i++) - message[i] = vectorize(c_PaddedMessage80[i]); - - // die Nounce durch die thread-spezifische ersetzen - message[9].y = cuda_swab32(nounce); //REPLACE_HIDWORD(message[9], cuda_swab32(nounce)); - - // Compression 1 - Compression512(message, h); - -#pragma unroll 16 - for(int i=0;i<16;i++) - message[i] = make_uint2(0xaaaaaaa0+i,0xaaaaaaaa); - - - Compression512(h, message); - - // fertig - uint64_t *outpHash = &g_hash[thread * 8]; - -#pragma unroll 8 - for(int i=0;i<8;i++) - outpHash[i] = devectorize(message[i+8]); - } -} - -__host__ -void quark_bmw512_cpu_setBlock_80(void *pdata) -{ - unsigned char PaddedMessage[128]; - memcpy(PaddedMessage, pdata, 80); - memset(PaddedMessage+80, 0, 48); - uint64_t *message = (uint64_t*)PaddedMessage; - message[10] = SPH_C64(0x80); - message[15] = SPH_C64(640); - cudaMemcpyToSymbol(c_PaddedMessage80, PaddedMessage, 16*sizeof(uint64_t), 0, cudaMemcpyHostToDevice); -} - -__host__ -void quark_bmw512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, int order) -{ - const uint32_t threadsperblock = 128; - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - int dev_id = device_map[thr_id]; - - if (device_sm[dev_id] > 300 && cuda_arch[dev_id] > 300) - quark_bmw512_gpu_hash_80<<>>(threads, startNounce, (uint64_t*)d_hash); - else - quark_bmw512_gpu_hash_80_30<<>>(threads, startNounce, (uint64_t*)d_hash); -} - -__host__ -void quark_bmw512_cpu_init(int thr_id, uint32_t threads) -{ - cuda_get_arch(thr_id); -} - -__host__ -void quark_bmw512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order) -{ - const uint32_t threadsperblock = 32; - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - int dev_id = device_map[thr_id]; - if (device_sm[dev_id] > 300 && cuda_arch[dev_id] > 300) - quark_bmw512_gpu_hash_64<<>>(threads, startNounce, (uint64_t*)d_hash, d_nonceVector); - else - quark_bmw512_gpu_hash_64_30<<>>(threads, startNounce, (uint64_t*)d_hash, d_nonceVector); -} diff --git a/quark/cuda_bmw512_sm3.cuh b/quark/cuda_bmw512_sm3.cuh deleted file mode 100644 index 1298b13c..00000000 --- a/quark/cuda_bmw512_sm3.cuh +++ /dev/null @@ -1,271 +0,0 @@ -#include -#include - -#ifdef __INTELLISENSE__ -/* for vstudio code colors */ -#define __CUDA_ARCH__ 300 -#endif - -#include "cuda_helper.h" - -#define SHL(x, n) ((x) << (n)) -#define SHR(x, n) ((x) >> (n)) - -#define CONST_EXP2 \ - q[i+0] + ROTL64(q[i+1], 5) + q[i+2] + ROTL64(q[i+3], 11) + \ - q[i+4] + ROTL64(q[i+5], 27) + q[i+6] + SWAPDWORDS(q[i+7]) + \ - q[i+8] + ROTL64(q[i+9], 37) + q[i+10] + ROTL64(q[i+11], 43) + \ - q[i+12] + ROTL64(q[i+13], 53) + (SHR(q[i+14],1) ^ q[i+14]) + (SHR(q[i+15],2) ^ q[i+15]) - -#if !defined(__CUDA_ARCH__) || (__CUDA_ARCH__ >= 200 && __CUDA_ARCH__ < 500) || defined(_DEBUG) -__constant__ uint64_t d_constMem[16] = { - SPH_C64(0x8081828384858687), - SPH_C64(0x88898A8B8C8D8E8F), - SPH_C64(0x9091929394959697), - SPH_C64(0x98999A9B9C9D9E9F), - SPH_C64(0xA0A1A2A3A4A5A6A7), - SPH_C64(0xA8A9AAABACADAEAF), - SPH_C64(0xB0B1B2B3B4B5B6B7), - SPH_C64(0xB8B9BABBBCBDBEBF), - SPH_C64(0xC0C1C2C3C4C5C6C7), - SPH_C64(0xC8C9CACBCCCDCECF), - SPH_C64(0xD0D1D2D3D4D5D6D7), - SPH_C64(0xD8D9DADBDCDDDEDF), - SPH_C64(0xE0E1E2E3E4E5E6E7), - SPH_C64(0xE8E9EAEBECEDEEEF), - SPH_C64(0xF0F1F2F3F4F5F6F7), - SPH_C64(0xF8F9FAFBFCFDFEFF) -}; -# ifdef __GNUC__ -// windows and linux doesnt require the same ifdef for __constant__ -# pragma GCC diagnostic ignored "-Wunused-variable" -# endif -#endif - -#if defined(__CUDA_ARCH__) && (__CUDA_ARCH__ < 500 || defined(_DEBUG)) - -__device__ -void Compression512_30(uint64_t *msg, uint64_t *hash) -{ - // Compression ref. implementation - uint64_t tmp; - uint64_t q[32]; - - tmp = (msg[ 5] ^ hash[ 5]) - (msg[ 7] ^ hash[ 7]) + (msg[10] ^ hash[10]) + (msg[13] ^ hash[13]) + (msg[14] ^ hash[14]); - q[0] = (SHR(tmp, 1) ^ SHL(tmp, 3) ^ ROTL64(tmp, 4) ^ ROTL64(tmp, 37)) + hash[1]; - tmp = (msg[ 6] ^ hash[ 6]) - (msg[ 8] ^ hash[ 8]) + (msg[11] ^ hash[11]) + (msg[14] ^ hash[14]) - (msg[15] ^ hash[15]); - q[1] = (SHR(tmp, 1) ^ SHL(tmp, 2) ^ ROTL64(tmp, 13) ^ ROTL64(tmp, 43)) + hash[2]; - tmp = (msg[ 0] ^ hash[ 0]) + (msg[ 7] ^ hash[ 7]) + (msg[ 9] ^ hash[ 9]) - (msg[12] ^ hash[12]) + (msg[15] ^ hash[15]); - q[2] = (SHR(tmp, 2) ^ SHL(tmp, 1) ^ ROTL64(tmp, 19) ^ ROTL64(tmp, 53)) + hash[3]; - tmp = (msg[ 0] ^ hash[ 0]) - (msg[ 1] ^ hash[ 1]) + (msg[ 8] ^ hash[ 8]) - (msg[10] ^ hash[10]) + (msg[13] ^ hash[13]); - q[3] = (SHR(tmp, 2) ^ SHL(tmp, 2) ^ ROTL64(tmp, 28) ^ ROTL64(tmp, 59)) + hash[4]; - tmp = (msg[ 1] ^ hash[ 1]) + (msg[ 2] ^ hash[ 2]) + (msg[ 9] ^ hash[ 9]) - (msg[11] ^ hash[11]) - (msg[14] ^ hash[14]); - q[4] = (SHR(tmp, 1) ^ tmp) + hash[5]; - tmp = (msg[ 3] ^ hash[ 3]) - (msg[ 2] ^ hash[ 2]) + (msg[10] ^ hash[10]) - (msg[12] ^ hash[12]) + (msg[15] ^ hash[15]); - q[5] = (SHR(tmp, 1) ^ SHL(tmp, 3) ^ ROTL64(tmp, 4) ^ ROTL64(tmp, 37)) + hash[6]; - tmp = (msg[ 4] ^ hash[ 4]) - (msg[ 0] ^ hash[ 0]) - (msg[ 3] ^ hash[ 3]) - (msg[11] ^ hash[11]) + (msg[13] ^ hash[13]); - q[6] = (SHR(tmp, 1) ^ SHL(tmp, 2) ^ ROTL64(tmp, 13) ^ ROTL64(tmp, 43)) + hash[7]; - tmp = (msg[ 1] ^ hash[ 1]) - (msg[ 4] ^ hash[ 4]) - (msg[ 5] ^ hash[ 5]) - (msg[12] ^ hash[12]) - (msg[14] ^ hash[14]); - q[7] = (SHR(tmp, 2) ^ SHL(tmp, 1) ^ ROTL64(tmp, 19) ^ ROTL64(tmp, 53)) + hash[8]; - tmp = (msg[ 2] ^ hash[ 2]) - (msg[ 5] ^ hash[ 5]) - (msg[ 6] ^ hash[ 6]) + (msg[13] ^ hash[13]) - (msg[15] ^ hash[15]); - q[8] = (SHR(tmp, 2) ^ SHL(tmp, 2) ^ ROTL64(tmp, 28) ^ ROTL64(tmp, 59)) + hash[9]; - tmp = (msg[ 0] ^ hash[ 0]) - (msg[ 3] ^ hash[ 3]) + (msg[ 6] ^ hash[ 6]) - (msg[ 7] ^ hash[ 7]) + (msg[14] ^ hash[14]); - q[9] = (SHR(tmp, 1) ^ tmp) + hash[10]; - tmp = (msg[ 8] ^ hash[ 8]) - (msg[ 1] ^ hash[ 1]) - (msg[ 4] ^ hash[ 4]) - (msg[ 7] ^ hash[ 7]) + (msg[15] ^ hash[15]); - q[10] = (SHR(tmp, 1) ^ SHL(tmp, 3) ^ ROTL64(tmp, 4) ^ ROTL64(tmp, 37)) + hash[11]; - tmp = (msg[ 8] ^ hash[ 8]) - (msg[ 0] ^ hash[ 0]) - (msg[ 2] ^ hash[ 2]) - (msg[ 5] ^ hash[ 5]) + (msg[ 9] ^ hash[ 9]); - q[11] = (SHR(tmp, 1) ^ SHL(tmp, 2) ^ ROTL64(tmp, 13) ^ ROTL64(tmp, 43)) + hash[12]; - tmp = (msg[ 1] ^ hash[ 1]) + (msg[ 3] ^ hash[ 3]) - (msg[ 6] ^ hash[ 6]) - (msg[ 9] ^ hash[ 9]) + (msg[10] ^ hash[10]); - q[12] = (SHR(tmp, 2) ^ SHL(tmp, 1) ^ ROTL64(tmp, 19) ^ ROTL64(tmp, 53)) + hash[13]; - tmp = (msg[ 2] ^ hash[ 2]) + (msg[ 4] ^ hash[ 4]) + (msg[ 7] ^ hash[ 7]) + (msg[10] ^ hash[10]) + (msg[11] ^ hash[11]); - q[13] = (SHR(tmp, 2) ^ SHL(tmp, 2) ^ ROTL64(tmp, 28) ^ ROTL64(tmp, 59)) + hash[14]; - tmp = (msg[ 3] ^ hash[ 3]) - (msg[ 5] ^ hash[ 5]) + (msg[ 8] ^ hash[ 8]) - (msg[11] ^ hash[11]) - (msg[12] ^ hash[12]); - q[14] = (SHR(tmp, 1) ^ tmp) + hash[15]; - tmp = (msg[12] ^ hash[12]) - (msg[ 4] ^ hash[ 4]) - (msg[ 6] ^ hash[ 6]) - (msg[ 9] ^ hash[ 9]) + (msg[13] ^ hash[13]); - q[15] = (SHR(tmp, 1) ^ SHL(tmp, 3) ^ ROTL64(tmp, 4) ^ ROTL64(tmp, 37)) + hash[0]; - - // Expand 1 -#pragma unroll 2 - for(int i=0;i<2;i++) - { - q[i+16] = - (SHR(q[i], 1) ^ SHL(q[i], 2) ^ ROTL64(q[i], 13) ^ ROTL64(q[i], 43)) + - (SHR(q[i+1], 2) ^ SHL(q[i+1], 1) ^ ROTL64(q[i+1], 19) ^ ROTL64(q[i+1], 53)) + - (SHR(q[i+2], 2) ^ SHL(q[i+2], 2) ^ ROTL64(q[i+2], 28) ^ ROTL64(q[i+2], 59)) + - (SHR(q[i+3], 1) ^ SHL(q[i+3], 3) ^ ROTL64(q[i+3], 4) ^ ROTL64(q[i+3], 37)) + - (SHR(q[i+4], 1) ^ SHL(q[i+4], 2) ^ ROTL64(q[i+4], 13) ^ ROTL64(q[i+4], 43)) + - (SHR(q[i+5], 2) ^ SHL(q[i+5], 1) ^ ROTL64(q[i+5], 19) ^ ROTL64(q[i+5], 53)) + - (SHR(q[i+6], 2) ^ SHL(q[i+6], 2) ^ ROTL64(q[i+6], 28) ^ ROTL64(q[i+6], 59)) + - (SHR(q[i+7], 1) ^ SHL(q[i+7], 3) ^ ROTL64(q[i+7], 4) ^ ROTL64(q[i+7], 37)) + - (SHR(q[i+8], 1) ^ SHL(q[i+8], 2) ^ ROTL64(q[i+8], 13) ^ ROTL64(q[i+8], 43)) + - (SHR(q[i+9], 2) ^ SHL(q[i+9], 1) ^ ROTL64(q[i+9], 19) ^ ROTL64(q[i+9], 53)) + - (SHR(q[i+10], 2) ^ SHL(q[i+10], 2) ^ ROTL64(q[i+10], 28) ^ ROTL64(q[i+10], 59)) + - (SHR(q[i+11], 1) ^ SHL(q[i+11], 3) ^ ROTL64(q[i+11], 4) ^ ROTL64(q[i+11], 37)) + - (SHR(q[i+12], 1) ^ SHL(q[i+12], 2) ^ ROTL64(q[i+12], 13) ^ ROTL64(q[i+12], 43)) + - (SHR(q[i+13], 2) ^ SHL(q[i+13], 1) ^ ROTL64(q[i+13], 19) ^ ROTL64(q[i+13], 53)) + - (SHR(q[i+14], 2) ^ SHL(q[i+14], 2) ^ ROTL64(q[i+14], 28) ^ ROTL64(q[i+14], 59)) + - (SHR(q[i+15], 1) ^ SHL(q[i+15], 3) ^ ROTL64(q[i+15], 4) ^ ROTL64(q[i+15], 37)) + - (( ((i+16)*(0x0555555555555555ull)) + ROTL64(msg[i], i+1) + - ROTL64(msg[i+3], i+4) - ROTL64(msg[i+10], i+11) ) ^ hash[i+7]); - } - -#pragma unroll 4 - for(int i=2;i<6;i++) { - q[i+16] = CONST_EXP2 + - (( ((i+16)*(0x0555555555555555ull)) + ROTL64(msg[i], i+1) + - ROTL64(msg[i+3], i+4) - ROTL64(msg[i+10], i+11) ) ^ hash[i+7]); - } -#pragma unroll 3 - for(int i=6;i<9;i++) { - q[i+16] = CONST_EXP2 + - (( ((i+16)*(0x0555555555555555ull)) + ROTL64(msg[i], i+1) + - ROTL64(msg[i+3], i+4) - ROTL64(msg[i-6], (i-6)+1) ) ^ hash[i+7]); - } -#pragma unroll 4 - for(int i=9;i<13;i++) { - q[i+16] = CONST_EXP2 + - (( ((i+16)*(0x0555555555555555ull)) + ROTL64(msg[i], i+1) + - ROTL64(msg[i+3], i+4) - ROTL64(msg[i-6], (i-6)+1) ) ^ hash[i-9]); - } -#pragma unroll 3 - for(int i=13;i<16;i++) { - q[i+16] = CONST_EXP2 + - (( ((i+16)*(0x0555555555555555ull)) + ROTL64(msg[i], i+1) + - ROTL64(msg[i-13], (i-13)+1) - ROTL64(msg[i-6], (i-6)+1) ) ^ hash[i-9]); - } - - uint64_t XL64 = q[16]^q[17]^q[18]^q[19]^q[20]^q[21]^q[22]^q[23]; - uint64_t XH64 = XL64^q[24]^q[25]^q[26]^q[27]^q[28]^q[29]^q[30]^q[31]; - - hash[0] = (SHL(XH64, 5) ^ SHR(q[16],5) ^ msg[ 0]) + ( XL64 ^ q[24] ^ q[ 0]); - hash[1] = (SHR(XH64, 7) ^ SHL(q[17],8) ^ msg[ 1]) + ( XL64 ^ q[25] ^ q[ 1]); - hash[2] = (SHR(XH64, 5) ^ SHL(q[18],5) ^ msg[ 2]) + ( XL64 ^ q[26] ^ q[ 2]); - hash[3] = (SHR(XH64, 1) ^ SHL(q[19],5) ^ msg[ 3]) + ( XL64 ^ q[27] ^ q[ 3]); - hash[4] = (SHR(XH64, 3) ^ q[20] ^ msg[ 4]) + ( XL64 ^ q[28] ^ q[ 4]); - hash[5] = (SHL(XH64, 6) ^ SHR(q[21],6) ^ msg[ 5]) + ( XL64 ^ q[29] ^ q[ 5]); - hash[6] = (SHR(XH64, 4) ^ SHL(q[22],6) ^ msg[ 6]) + ( XL64 ^ q[30] ^ q[ 6]); - hash[7] = (SHR(XH64,11) ^ SHL(q[23],2) ^ msg[ 7]) + ( XL64 ^ q[31] ^ q[ 7]); - - hash[ 8] = ROTL64(hash[4], 9) + ( XH64 ^ q[24] ^ msg[ 8]) + (SHL(XL64,8) ^ q[23] ^ q[ 8]); - hash[ 9] = ROTL64(hash[5],10) + ( XH64 ^ q[25] ^ msg[ 9]) + (SHR(XL64,6) ^ q[16] ^ q[ 9]); - hash[10] = ROTL64(hash[6],11) + ( XH64 ^ q[26] ^ msg[10]) + (SHL(XL64,6) ^ q[17] ^ q[10]); - hash[11] = ROTL64(hash[7],12) + ( XH64 ^ q[27] ^ msg[11]) + (SHL(XL64,4) ^ q[18] ^ q[11]); - hash[12] = ROTL64(hash[0],13) + ( XH64 ^ q[28] ^ msg[12]) + (SHR(XL64,3) ^ q[19] ^ q[12]); - hash[13] = ROTL64(hash[1],14) + ( XH64 ^ q[29] ^ msg[13]) + (SHR(XL64,4) ^ q[20] ^ q[13]); - hash[14] = ROTL64(hash[2],15) + ( XH64 ^ q[30] ^ msg[14]) + (SHR(XL64,7) ^ q[21] ^ q[14]); - hash[15] = ROTL64(hash[3],16) + ( XH64 ^ q[31] ^ msg[15]) + (SHR(XL64,2) ^ q[22] ^ q[15]); -} - -__global__ -void quark_bmw512_gpu_hash_64_30(uint32_t threads, uint32_t startNounce, uint64_t *g_hash, uint32_t *g_nonceVector) -{ - int thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t nounce = (g_nonceVector != NULL) ? g_nonceVector[thread] : (startNounce + thread); - - uint32_t hashPosition = nounce - startNounce; - uint64_t *inpHash = &g_hash[hashPosition * 8]; - - // Init - uint64_t h[16]; - /* - h[ 0] = SPH_C64(0x8081828384858687); - h[ 1] = SPH_C64(0x88898A8B8C8D8E8F); - h[ 2] = SPH_C64(0x9091929394959697); - h[ 3] = SPH_C64(0x98999A9B9C9D9E9F); - h[ 4] = SPH_C64(0xA0A1A2A3A4A5A6A7); - h[ 5] = SPH_C64(0xA8A9AAABACADAEAF); - h[ 6] = SPH_C64(0xB0B1B2B3B4B5B6B7); - h[ 7] = SPH_C64(0xB8B9BABBBCBDBEBF); - h[ 8] = SPH_C64(0xC0C1C2C3C4C5C6C7); - h[ 9] = SPH_C64(0xC8C9CACBCCCDCECF); - h[10] = SPH_C64(0xD0D1D2D3D4D5D6D7); - h[11] = SPH_C64(0xD8D9DADBDCDDDEDF); - h[12] = SPH_C64(0xE0E1E2E3E4E5E6E7); - h[13] = SPH_C64(0xE8E9EAEBECEDEEEF); - h[14] = SPH_C64(0xF0F1F2F3F4F5F6F7); - h[15] = SPH_C64(0xF8F9FAFBFCFDFEFF); - */ - - // Nachricht kopieren (Achtung, die Nachricht hat 64 Byte, - // BMW arbeitet mit 128 Byte!!! - uint64_t message[16]; - - #pragma unroll 8 - for(int i=0;i<8;i++) - message[i] = inpHash[i]; - - #pragma unroll 6 - for(int i=9;i<15;i++) - message[i] = 0; - - message[8] = SPH_C64(0x80); - // 64 Bytes * 8 = 512 Bits - message[15] = SPH_C64(512); - - #pragma unroll 16 - for(int i=0;i<16;i++) - h[i] = d_constMem[i]; - - // Compression 1 - Compression512_30(message, h); - - // Final - #pragma unroll 16 - for(int i=0;i<16;i++) - message[i] = 0xaaaaaaaaaaaaaaa0ull + (uint64_t)i; - - Compression512_30(h, message); - - uint64_t *outpHash = &g_hash[hashPosition * 8]; - - #pragma unroll 8 - for(int i=0;i<8;i++) - outpHash[i] = message[i+8]; - } -} - -__global__ -void quark_bmw512_gpu_hash_80_30(uint32_t threads, uint32_t startNounce, uint64_t *g_hash) -{ - int thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t nounce = startNounce + thread; - - // Init - uint64_t h[16]; - #pragma unroll 16 - for(int i=0;i<16;i++) - h[i] = d_constMem[i]; - - uint64_t message[16]; - #pragma unroll 16 - for(int i=0;i<16;i++) - message[i] = c_PaddedMessage80[i]; - - message[9] = REPLACE_HIDWORD(message[9], cuda_swab32(nounce)); - - // Compression 1 - Compression512_30(message, h); - - // Final - #pragma unroll 16 - for(int i=0;i<16;i++) - message[i] = 0xaaaaaaaaaaaaaaa0ull + (uint64_t)i; - - Compression512_30(h, message); - - uint2 *outpHash = (uint2*) (&g_hash[thread * 8U]); - #pragma unroll 8 - for(int i=0;i<8;i++) - outpHash[i] = ((uint2*)message)[i+8]; - } -} - -#else /* stripped stubs for other archs */ -__global__ void quark_bmw512_gpu_hash_64_30(uint32_t threads, uint32_t startNounce, uint64_t *g_hash, uint32_t *g_nonceVector) {} -__global__ void quark_bmw512_gpu_hash_80_30(uint32_t threads, uint32_t startNounce, uint64_t *g_hash) {} -#endif - diff --git a/quark/cuda_jh512.cu b/quark/cuda_jh512.cu deleted file mode 100644 index 3a1bbabe..00000000 --- a/quark/cuda_jh512.cu +++ /dev/null @@ -1,508 +0,0 @@ -/** - * JH512 64 and 80 kernels - * - * JH80 by tpruvot - 2017 - under GPLv3 - **/ -#include - -// #include // printf -// #include // sleep - -/* 1344 bytes, align 16 is there to allow ld.const.v4 (made auto. by the compiler) */ -__constant__ static __align__(16) uint32_t c_E8_bslice32[42][8] = { - // Round 0 (Function0) - { 0xa2ded572, 0x90d6ab81, 0x67f815df, 0xf6875a4d, 0x0a15847b, 0xc54f9f4e, 0x571523b7, 0x402bd1c3 }, - { 0xe03a98ea, 0xb4960266, 0x9cfa455c, 0x8a53bbf2, 0x99d2c503, 0x1a1456b5, 0x9a99b266, 0x31a2db88 }, // 1 - { 0x5c5aa303, 0x8019051c, 0xdb0e199a, 0x1d959e84, 0x0ab23f40, 0xadeb336f, 0x1044c187, 0xdccde75e }, // 2 - { 0x9213ba10, 0x39812c0a, 0x416bbf02, 0x5078aa37, 0x156578dc, 0xd2bf1a3f, 0xd027bbf7, 0xd3910041 }, // 3 - { 0x0d5a2d42, 0x0ba75c18, 0x907eccf6, 0xac442bc7, 0x9c9f62dd, 0xd665dfd1, 0xce97c092, 0x23fcc663 }, // 4 - { 0x036c6e97, 0xbb03f1ee, 0x1ab8e09e, 0xfa618e5d, 0x7e450521, 0xb29796fd, 0xa8ec6c44, 0x97818394 }, // 5 - { 0x37858e4a, 0x8173fe8a, 0x2f3003db, 0x6c69b8f8, 0x2d8d672a, 0x4672c78a, 0x956a9ffb, 0x14427fc0 }, // 6 - // Round 7 (Function0) - { 0x8f15f4c5, 0xb775de52, 0xc45ec7bd, 0xbc88e4ae, 0xa76f4475, 0x1e00b882, 0x80bb118f, 0xf4a3a698 }, - { 0x338ff48e, 0x20edf1b6, 0x1563a3a9, 0xfde05a7c, 0x24565faa, 0x5ae9ca36, 0x89f9b7d5, 0x362c4206 }, - { 0x433529ce, 0x591ff5d0, 0x3d98fe4e, 0x86814e6f, 0x74f93a53, 0x81ad9d0e, 0xa74b9a73, 0x9f5ad8af }, - { 0x670605a7, 0x26077447, 0x6a6234ee, 0x3f1080c6, 0xbe280b8b, 0x6f7ea0e0, 0x2717b96e, 0x7b487ec6 }, - { 0xa50a550d, 0x81727686, 0xc0a4f84a, 0xd48d6050, 0x9fe7e391, 0x415a9e7e, 0x9ef18e97, 0x62b0e5f3 }, - { 0xec1f9ffc, 0xf594d74f, 0x7a205440, 0xd895fa9d, 0x001ae4e3, 0x117e2e55, 0x84c9f4ce, 0xa554c324 }, - { 0x2872df5b, 0xef7c8905, 0x286efebd, 0x2ed349ee, 0xe27ff578, 0x85937e44, 0xb2c4a50f, 0x7f5928eb }, - // Round 14 (Function0) - { 0x37695f70, 0x04771bc7, 0x4a3124b3, 0xe720b951, 0xf128865e, 0xe843fe74, 0x65e4d61d, 0x8a87d423 }, - { 0xa3e8297d, 0xfb301b1d, 0xf2947692, 0xe01bdc5b, 0x097acbdd, 0x4f4924da, 0xc1d9309b, 0xbf829cf2 }, - { 0x31bae7a4, 0x32fcae3b, 0xffbf70b4, 0x39d3bb53, 0x0544320d, 0xc1c39f45, 0x48bcf8de, 0xa08b29e0 }, - { 0xfd05c9e5, 0x01b771a2, 0x0f09aef7, 0x95ed44e3, 0x12347094, 0x368e3be9, 0x34f19042, 0x4a982f4f }, - { 0x631d4088, 0xf14abb7e, 0x15f66ca0, 0x30c60ae2, 0x4b44c147, 0xc5b67046, 0xffaf5287, 0xe68c6ecc }, - { 0x56a4d5a4, 0x45ce5773, 0x00ca4fbd, 0xadd16430, 0x4b849dda, 0x68cea6e8, 0xae183ec8, 0x67255c14 }, - { 0xf28cdaa3, 0x20b2601f, 0x16e10ecb, 0x7b846fc2, 0x5806e933, 0x7facced1, 0x9a99949a, 0x1885d1a0 }, - // Round 21 (Function0) - { 0xa15b5932, 0x67633d9f, 0xd319dd8d, 0xba6b04e4, 0xc01c9a50, 0xab19caf6, 0x46b4a5aa, 0x7eee560b }, - { 0xea79b11f, 0x5aac571d, 0x742128a9, 0x76d35075, 0x35f7bde9, 0xfec2463a, 0xee51363b, 0x01707da3 }, - { 0xafc135f7, 0x15638341, 0x42d8a498, 0xa8db3aea, 0x20eced78, 0x4d3bc3fa, 0x79676b9e, 0x832c8332 }, - { 0x1f3b40a7, 0x6c4e3ee7, 0xf347271c, 0xfd4f21d2, 0x34f04059, 0x398dfdb8, 0x9a762db7, 0xef5957dc }, - { 0x490c9b8d, 0xd0ae3b7d, 0xdaeb492b, 0x84558d7a, 0x49d7a25b, 0xf0e9a5f5, 0x0d70f368, 0x658ef8e4 }, - { 0xf4a2b8a0, 0x92946891, 0x533b1036, 0x4f88e856, 0x9e07a80c, 0x555cb05b, 0x5aec3e75, 0x4cbcbaf8 }, - { 0x993bbbe3, 0x28acae64, 0x7b9487f3, 0x6db334dc, 0xd6f4da75, 0x50a5346c, 0x5d1c6b72, 0x71db28b8 }, - // Round 28 (Function0) - { 0xf2e261f8, 0xf1bcac1c, 0x2a518d10, 0xa23fce43, 0x3364dbe3, 0x3cd1bb67, 0xfc75dd59, 0xb043e802 }, - { 0xca5b0a33, 0xc3943b92, 0x75a12988, 0x1e4d790e, 0x4d19347f, 0xd7757479, 0x5c5316b4, 0x3fafeeb6 }, - { 0xf7d4a8ea, 0x5324a326, 0x21391abe, 0xd23c32ba, 0x097ef45c, 0x4a17a344, 0x5127234c, 0xadd5a66d }, - { 0xa63e1db5, 0xa17cf84c, 0x08c9f2af, 0x4d608672, 0x983d5983, 0xcc3ee246, 0x563c6b91, 0xf6c76e08 }, - { 0xb333982f, 0xe8b6f406, 0x5e76bcb1, 0x36d4c1be, 0xa566d62b, 0x1582ee74, 0x2ae6c4ef, 0x6321efbc }, - { 0x0d4ec1fd, 0x1614c17e, 0x69c953f4, 0x16fae006, 0xc45a7da7, 0x3daf907e, 0x26585806, 0x3f9d6328 }, - { 0xe3f2c9d2, 0x16512a74, 0x0cd29b00, 0x9832e0f2, 0x30ceaa5f, 0xd830eb0d, 0x300cd4b7, 0x9af8cee3 }, - // Round 35 (Function0) - { 0x7b9ec54b, 0x574d239b, 0x9279f1b5, 0x316796e6, 0x6ee651ff, 0xf3a6e6cc, 0xd3688604, 0x05750a17 }, - { 0xd98176b1, 0xb3cb2bf4, 0xce6c3213, 0x47154778, 0x8452173c, 0x825446ff, 0x62a205f8, 0x486a9323 }, - { 0x0758df38, 0x442e7031, 0x65655e4e, 0x86ca0bd0, 0x897cfcf2, 0xa20940f0, 0x8e5086fc, 0x4e477830 }, - { 0x39eea065, 0x26b29721, 0x8338f7d1, 0x6ff81301, 0x37e95ef7, 0xd1ed44a3, 0xbd3a2ce4, 0xe7de9fef }, - { 0x15dfa08b, 0x7ceca7d8, 0xd9922576, 0x7eb027ab, 0xf6f7853c, 0xda7d8d53, 0xbe42dc12, 0xdea83eaa }, - { 0x93ce25aa, 0xdaef5fc0, 0xd86902bd, 0xa5194a17, 0xfd43f65a, 0x33664d97, 0xf908731a, 0x6a21fd4c }, - { 0x3198b435, 0xa163d09a, 0x701541db, 0x72409751, 0xbb0f1eea, 0xbf9d75f6, 0x9b54cded, 0xe26f4791 } - // 42 rounds... -}; - -/*swapping bits 32i||32i+1||......||32i+15 with bits 32i+16||32i+17||......||32i+31 of 32-bit x*/ -//#define SWAP16(x) (x) = ((((x) & 0x0000ffffUL) << 16) | (((x) & 0xffff0000UL) >> 16)); -#define SWAP16(x) (x) = __byte_perm(x, 0, 0x1032); - -/*swapping bits 16i||16i+1||......||16i+7 with bits 16i+8||16i+9||......||16i+15 of 32-bit x*/ -//#define SWAP8(x) (x) = ((((x) & 0x00ff00ffUL) << 8) | (((x) & 0xff00ff00UL) >> 8)); -#define SWAP8(x) (x) = __byte_perm(x, 0, 0x2301); - -/* -__device__ __forceinline__ -static void SWAP4(uint32_t &x) { - uint32_t y = x & 0xF0F0F0F0; - x = (x ^ y) << 4; - x |= y >> 4; -} -__device__ __forceinline__ -static void SWAP2(uint32_t &x) { - uint32_t y = (x & 0xCCCCCCCC); - x = (x ^ y) << 2; - x |= y >> 2; -} -__device__ __forceinline__ -static void SWAP1(uint32_t &x) { - uint32_t y = (x & 0xAAAAAAAA); - x = (x ^ y) << 1; - x |= y >> 1; -} -*/ - -__device__ __forceinline__ -static void SWAP4x4(uint32_t *x) { - #pragma nounroll - // y is used as tmp register too - for (uint32_t y=0; y<4; y++, ++x) { - asm("and.b32 %1, %0, 0xF0F0F0F0;\n\t" - "xor.b32 %0, %0, %1; shr.b32 %1, %1, 4;\n\t" - "vshl.u32.u32.u32.clamp.add %0, %0, 4, %1;" - : "+r"(*x) : "r"(y)); - } -} - -__device__ __forceinline__ -static void SWAP2x4(uint32_t *x) { - #pragma nounroll - // y is used as tmp register too - for (uint32_t y=0; y<4; y++, ++x) { - asm("and.b32 %1, %0, 0xCCCCCCCC;\n\t" - "xor.b32 %0, %0, %1; shr.b32 %1, %1, 2; \n\t" - "vshl.u32.u32.u32.clamp.add %0, %0, 2, %1;" - : "+r"(*x) : "r"(y)); - } -} - -__device__ __forceinline__ -static void SWAP1x4(uint32_t *x) { - #pragma nounroll - // y is used as tmp register too - for (uint32_t y=0; y<4; y++, ++x) { - asm("and.b32 %1, %0, 0xAAAAAAAA;\n\t" - "xor.b32 %0, %0, %1; shr.b32 %1, %1, 1; \n\t" - "vshl.u32.u32.u32.clamp.add %0, %0, 1, %1;" - : "+r"(*x) : "r"(y)); - } -} - -/* The MDS transform */ -#define L(m0,m1,m2,m3,m4,m5,m6,m7) \ - m4 ^= m1; \ - m5 ^= m2; \ - m6 ^= m0 ^ m3; \ - m7 ^= m0; \ - m0 ^= m5; \ - m1 ^= m6; \ - m2 ^= m4 ^ m7; \ - m3 ^= m4; - -/* The Sbox */ -#define Sbox(m0, m1, m2, m3, cc) \ - m3 = ~(m3); \ - m0 ^= (~(m2)) & cc; \ - temp0 = cc ^ (m0 & m1); \ - m0 ^= m2 & m3; \ - m3 ^= (~(m1)) & m2; \ - m1 ^= m0 & m2; \ - m2 ^= m0 & (~(m3)); \ - m0 ^= m1 | m3; \ - m3 ^= m1 & m2; \ - m1 ^= temp0 & m0; \ - m2 ^= temp0; - -__device__ __forceinline__ -static void Sbox_and_MDS_layer(uint32_t x[8][4], const int rnd) -{ - uint2* cc = (uint2*) &c_E8_bslice32[rnd]; - - // Sbox and MDS layer - #pragma unroll - for (int i = 0; i < 4; i++, ++cc) { - uint32_t temp0; - Sbox(x[0][i], x[2][i], x[4][i], x[6][i], cc->x); - Sbox(x[1][i], x[3][i], x[5][i], x[7][i], cc->y); - L(x[0][i], x[2][i], x[4][i], x[6][i], x[1][i], x[3][i], x[5][i], x[7][i]); - } -} - -__device__ __forceinline__ -static void RoundFunction0(uint32_t x[8][4], const int rnd) -{ - Sbox_and_MDS_layer(x, rnd + 0); // 0, 7, 14 .. 35 - #pragma unroll 4 - for (int j = 1; j < 8; j += 2) { // 1, 3, 5, 7 (Even) - SWAP1x4(x[j]); - // SWAP1(x[j][0]); SWAP1(x[j][1]); SWAP1(x[j][2]); SWAP1(x[j][3]); - } -} - -__device__ __forceinline__ -static void RoundFunction1(uint32_t x[8][4], const int rnd) -{ - Sbox_and_MDS_layer(x, rnd + 1); - - #pragma unroll 4 - for (int j = 1; j < 8; j += 2) { - SWAP2x4(x[j]); - // SWAP2(x[j][0]); SWAP2(x[j][1]); SWAP2(x[j][2]); SWAP2(x[j][3]); - } -} - -__device__ __forceinline__ -static void RoundFunction2(uint32_t x[8][4], const int rnd) -{ - Sbox_and_MDS_layer(x, rnd + 2); - - #pragma unroll 4 - for (int j = 1; j < 8; j += 2) { - SWAP4x4(x[j]); - // SWAP4(x[j][0]); SWAP4(x[j][1]); SWAP4(x[j][2]); SWAP4(x[j][3]); - } -} - -__device__ __forceinline__ -static void RoundFunction3(uint32_t x[8][4], const int rnd) -{ - Sbox_and_MDS_layer(x, rnd + 3); - - //uint32_t* xj = x[j]; - #pragma unroll 4 - for (int j = 1; j < 8; j += 2) { - SWAP8(x[j][0]); - SWAP8(x[j][1]); - SWAP8(x[j][2]); - SWAP8(x[j][3]); - } -} - -__device__ __forceinline__ -static void RoundFunction4(uint32_t x[8][4], const int rnd) -{ - Sbox_and_MDS_layer(x, rnd + 4); - - #pragma unroll 4 - for (int j = 1; j < 8; j += 2) - { - //uint32_t* xj = x[j]; - #pragma unroll - for (int i = 0; i < 4; i++) - SWAP16(x[j][i]); - } -} - -__device__ __forceinline__ -static void RoundFunction5(uint32_t x[8][4], const int rnd) -{ - Sbox_and_MDS_layer(x, rnd + 5); - - #pragma unroll 4 - for (int j = 1; j < 8; j += 2) - { - xchg(x[j][0], x[j][1]); - xchg(x[j][2], x[j][3]); - } -} - -__device__ __forceinline__ -static void RoundFunction6(uint32_t x[8][4], const int rnd) -{ - Sbox_and_MDS_layer(x, rnd + 6); - - #pragma unroll 4 - for (int j = 1; j < 8; j += 2) - { - xchg(x[j][0], x[j][2]); - xchg(x[j][1], x[j][3]); - } -} - -/* The bijective function E8, in bitslice form */ -__device__ -static void E8(uint32_t x[8][4]) -{ - /* perform 6 loops of 7 rounds */ - for (int r = 0; r < 42; r += 7) - { - RoundFunction0(x, r); - RoundFunction1(x, r); - RoundFunction2(x, r); - RoundFunction3(x, r); - RoundFunction4(x, r); - RoundFunction5(x, r); - RoundFunction6(x, r); - } -} - -__global__ -//__launch_bounds__(256,2) -void quark_jh512_gpu_hash_64(const uint32_t threads, const uint32_t startNounce, uint32_t* g_hash, uint32_t * g_nonceVector) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const uint32_t nounce = (g_nonceVector != NULL) ? g_nonceVector[thread] : (startNounce + thread); - const uint32_t hashPosition = nounce - startNounce; - uint32_t *Hash = &g_hash[(size_t)16 * hashPosition]; - - uint32_t h[16]; - AS_UINT4(&h[ 0]) = AS_UINT4(&Hash[ 0]); - AS_UINT4(&h[ 4]) = AS_UINT4(&Hash[ 4]); - AS_UINT4(&h[ 8]) = AS_UINT4(&Hash[ 8]); - AS_UINT4(&h[12]) = AS_UINT4(&Hash[12]); - - uint32_t x[8][4] = { /* init */ - { 0x964bd16f, 0x17aa003e, 0x052e6a63, 0x43d5157a }, - { 0x8d5e228a, 0x0bef970c, 0x591234e9, 0x61c3b3f2 }, - { 0xc1a01d89, 0x1e806f53, 0x6b05a92a, 0x806d2bea }, - { 0xdbcc8e58, 0xa6ba7520, 0x763a0fa9, 0xf73bf8ba }, - { 0x05e66901, 0x694ae341, 0x8e8ab546, 0x5ae66f2e }, - { 0xd0a74710, 0x243c84c1, 0xb1716e3b, 0x99c15a2d }, - { 0xecf657cf, 0x56f8b19d, 0x7c8806a7, 0x56b11657 }, - { 0xdffcc2e3, 0xfb1785e6, 0x78465a54, 0x4bdd8ccc } - }; - - #pragma unroll - for (int i = 0; i < 16; i++) - x[i/4][i & 3] ^= h[i]; - - E8(x); - - #pragma unroll - for (int i = 0; i < 16; i++) - x[(i+16)/4][(i+16) & 3] ^= h[i]; - - x[0][0] ^= 0x80U; - x[3][3] ^= 0x00020000U; - - E8(x); - - x[4][0] ^= 0x80U; - x[7][3] ^= 0x00020000U; - - AS_UINT4(&Hash[ 0]) = AS_UINT4(&x[4][0]); - AS_UINT4(&Hash[ 4]) = AS_UINT4(&x[5][0]); - AS_UINT4(&Hash[ 8]) = AS_UINT4(&x[6][0]); - AS_UINT4(&Hash[12]) = AS_UINT4(&x[7][0]); - } -} - -__host__ -void quark_jh512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order) -{ - const uint32_t threadsperblock = 256; - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - quark_jh512_gpu_hash_64<<>>(threads, startNounce, d_hash, d_nonceVector); -} - -// Setup function -__host__ void quark_jh512_cpu_init(int thr_id, uint32_t threads) {} - -#define WANT_JH80_MIDSTATE -#ifdef WANT_JH80 - -__constant__ -static uint32_t c_PaddedMessage80[20]; // padded message (80 bytes) - -__host__ -void jh512_setBlock_80(int thr_id, uint32_t *endiandata) -{ - cudaMemcpyToSymbol(c_PaddedMessage80, endiandata, sizeof(c_PaddedMessage80), 0, cudaMemcpyHostToDevice); -} - -__global__ -void jh512_gpu_hash_80(const uint32_t threads, const uint32_t startNounce, uint32_t * g_outhash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t h[20]; - AS_UINT4(&h[ 0]) = AS_UINT4(&c_PaddedMessage80[ 0]); - AS_UINT4(&h[ 4]) = AS_UINT4(&c_PaddedMessage80[ 4]); - AS_UINT4(&h[ 8]) = AS_UINT4(&c_PaddedMessage80[ 8]); - AS_UINT4(&h[12]) = AS_UINT4(&c_PaddedMessage80[12]); - AS_UINT2(&h[16]) = AS_UINT2(&c_PaddedMessage80[16]); - h[18] = c_PaddedMessage80[18]; - h[19] = cuda_swab32(startNounce + thread); - - uint32_t x[8][4] = { /* init */ - { 0x964bd16f, 0x17aa003e, 0x052e6a63, 0x43d5157a }, - { 0x8d5e228a, 0x0bef970c, 0x591234e9, 0x61c3b3f2 }, - { 0xc1a01d89, 0x1e806f53, 0x6b05a92a, 0x806d2bea }, - { 0xdbcc8e58, 0xa6ba7520, 0x763a0fa9, 0xf73bf8ba }, - { 0x05e66901, 0x694ae341, 0x8e8ab546, 0x5ae66f2e }, - { 0xd0a74710, 0x243c84c1, 0xb1716e3b, 0x99c15a2d }, - { 0xecf657cf, 0x56f8b19d, 0x7c8806a7, 0x56b11657 }, - { 0xdffcc2e3, 0xfb1785e6, 0x78465a54, 0x4bdd8ccc } - }; - - // 1 (could be precomputed) - #pragma unroll - for (int i = 0; i < 16; i++) - x[i/4][i & 3] ^= h[i]; - E8(x); - #pragma unroll - for (int i = 0; i < 16; i++) - x[(i+16)/4][(i+16) & 3] ^= h[i]; - - // 2 (16 bytes with nonce) - #pragma unroll - for (int i = 0; i < 4; i++) - x[0][i] ^= h[16+i]; - x[1][0] ^= 0x80U; - E8(x); - #pragma unroll - for (int i = 0; i < 4; i++) - x[4][i] ^= h[16+i]; - x[5][0] ^= 0x80U; - - // 3 close - x[3][3] ^= 0x80020000U; // 80 bytes = 640bits (0x280) - E8(x); - x[7][3] ^= 0x80020000U; - - uint32_t *Hash = &g_outhash[(size_t)16 * thread]; - AS_UINT4(&Hash[ 0]) = AS_UINT4(&x[4][0]); - AS_UINT4(&Hash[ 4]) = AS_UINT4(&x[5][0]); - AS_UINT4(&Hash[ 8]) = AS_UINT4(&x[6][0]); - AS_UINT4(&Hash[12]) = AS_UINT4(&x[7][0]); - } -} - -__host__ -void jh512_cuda_hash_80(const int thr_id, const uint32_t threads, const uint32_t startNounce, uint32_t *d_hash) -{ - const uint32_t threadsperblock = 256; - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - jh512_gpu_hash_80 <<>> (threads, startNounce, d_hash); -} - -#endif - -#ifdef WANT_JH80_MIDSTATE - -__constant__ static uint32_t c_JHState[32]; -__constant__ static uint32_t c_Message[4]; - -__global__ -void jh512_gpu_hash_80(const uint32_t threads, const uint32_t startNounce, uint32_t * g_outhash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - // 1 (precomputed state) - uint32_t x[8][4]; - AS_UINT4(&x[0][0]) = AS_UINT4(&c_JHState[ 0]); - AS_UINT4(&x[1][0]) = AS_UINT4(&c_JHState[ 4]); - AS_UINT4(&x[2][0]) = AS_UINT4(&c_JHState[ 8]); - AS_UINT4(&x[3][0]) = AS_UINT4(&c_JHState[12]); - - AS_UINT4(&x[4][0]) = AS_UINT4(&c_JHState[16]); - AS_UINT4(&x[5][0]) = AS_UINT4(&c_JHState[20]); - AS_UINT4(&x[6][0]) = AS_UINT4(&c_JHState[24]); - AS_UINT4(&x[7][0]) = AS_UINT4(&c_JHState[28]); - - // 2 (16 bytes with nonce) - uint32_t h[4]; - AS_UINT2(&h[0]) = AS_UINT2(&c_Message[0]); - h[2] = c_Message[2]; - h[3] = cuda_swab32(startNounce + thread); - - #pragma unroll - for (int i = 0; i < 4; i++) - x[0][i] ^= h[i]; - x[1][0] ^= 0x80U; - E8(x); - #pragma unroll - for (int i = 0; i < 4; i++) - x[4][i] ^= h[i]; - x[5][0] ^= 0x80U; - - // 3 close - x[3][3] ^= 0x80020000U; // 80 bytes = 640bits (0x280) - E8(x); - x[7][3] ^= 0x80020000U; - - uint32_t *Hash = &g_outhash[(size_t)16 * thread]; - AS_UINT4(&Hash[ 0]) = AS_UINT4(&x[4][0]); - AS_UINT4(&Hash[ 4]) = AS_UINT4(&x[5][0]); - AS_UINT4(&Hash[ 8]) = AS_UINT4(&x[6][0]); - AS_UINT4(&Hash[12]) = AS_UINT4(&x[7][0]); - } -} - -__host__ -void jh512_cuda_hash_80(const int thr_id, const uint32_t threads, const uint32_t startNounce, uint32_t *d_hash) -{ - const uint32_t threadsperblock = 256; - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - - jh512_gpu_hash_80 <<>> (threads, startNounce, d_hash); -} - -extern "C" { -#undef SPH_C32 -#undef SPH_T32 -#undef SPH_C64 -#undef SPH_T64 -#include -} - -__host__ -void jh512_setBlock_80(int thr_id, uint32_t *endiandata) -{ - sph_jh512_context ctx_jh; - - sph_jh512_init(&ctx_jh); - sph_jh512(&ctx_jh, endiandata, 64); - - cudaMemcpyToSymbol(c_JHState, ctx_jh.H.narrow, 128, 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(c_Message, &endiandata[16], sizeof(c_Message), 0, cudaMemcpyHostToDevice); -} - -#endif diff --git a/quark/cuda_quark.h b/quark/cuda_quark.h deleted file mode 100644 index fbb0c1da..00000000 --- a/quark/cuda_quark.h +++ /dev/null @@ -1,35 +0,0 @@ -#include "cuda_helper.h" - -/* commonly used cuda quark kernels prototypes */ - -extern void quark_blake512_cpu_init(int thr_id, uint32_t threads); -extern void quark_blake512_cpu_free(int thr_id); -extern void quark_blake512_cpu_setBlock_80(int thr_id, uint32_t *pdata); -extern void quark_blake512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash); -extern void quark_blake512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void quark_bmw512_cpu_init(int thr_id, uint32_t threads); -extern void quark_bmw512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void quark_groestl512_cpu_init(int thr_id, uint32_t threads); -extern void quark_groestl512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -extern void quark_doublegroestl512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -extern void quark_groestl512_cpu_free(int thr_id); - -extern void quark_skein512_cpu_init(int thr_id, uint32_t threads); -extern void quark_skein512_cpu_hash_64(int thr_id, const uint32_t threads, const uint32_t startNonce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void quark_keccak512_cpu_init(int thr_id, uint32_t threads); -extern void quark_keccak512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void quark_jh512_cpu_init(int thr_id, uint32_t threads); -extern void quark_jh512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void quark_compactTest_cpu_init(int thr_id, uint32_t threads); -extern void quark_compactTest_cpu_free(int thr_id); -extern void quark_compactTest_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable, - uint32_t *d_nonces1, uint32_t *nrm1, uint32_t *d_nonces2, uint32_t *nrm2, int order); -extern void quark_compactTest_single_false_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable, - uint32_t *d_nonces1, uint32_t *nrm1, int order); - -extern uint32_t cuda_check_hash_branch(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_inputHash, int order); diff --git a/quark/cuda_quark_blake512.cu b/quark/cuda_quark_blake512.cu deleted file mode 100644 index 24f6f6d5..00000000 --- a/quark/cuda_quark_blake512.cu +++ /dev/null @@ -1,319 +0,0 @@ -#include -#include -#include // off_t - -#include "miner.h" -#include "cuda_helper.h" - -#define ROTR(x,n) ROTR64(x,n) - -// use sp kernel on SM 5+ -#define SP_KERNEL - -#define USE_SHUFFLE 0 - -__constant__ -static uint64_t c_PaddedMessage80[16]; // padded message (80 bytes + padding) - -// ---------------------------- BEGIN CUDA quark_blake512 functions ------------------------------------ - -__device__ __constant__ -static const uint8_t c_sigma_big[16][16] = { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - {14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - {11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, - { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 }, - - {12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 }, - {13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 }, - { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 }, - {10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 }, - - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - {14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - {11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, - { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } -}; - -__device__ __constant__ -static const uint64_t c_u512[16] = -{ - 0x243f6a8885a308d3ULL, 0x13198a2e03707344ULL, - 0xa4093822299f31d0ULL, 0x082efa98ec4e6c89ULL, - 0x452821e638d01377ULL, 0xbe5466cf34e90c6cULL, - 0xc0ac29b7c97c50ddULL, 0x3f84d5b5b5470917ULL, - 0x9216d5d98979fb1bULL, 0xd1310ba698dfb5acULL, - 0x2ffd72dbd01adfb7ULL, 0xb8e1afed6a267e96ULL, - 0xba7c9045f12c7f99ULL, 0x24a19947b3916cf7ULL, - 0x0801f2e2858efc16ULL, 0x636920d871574e69ULL -}; - -#define G(a,b,c,d,x) { \ - uint32_t idx1 = sigma[i][x]; \ - uint32_t idx2 = sigma[i][x+1]; \ - v[a] += (m[idx1] ^ u512[idx2]) + v[b]; \ - v[d] = SWAPDWORDS(v[d] ^ v[a]); \ - v[c] += v[d]; \ - v[b] = ROTR( v[b] ^ v[c], 25); \ - v[a] += (m[idx2] ^ u512[idx1]) + v[b]; \ - v[d] = ROTR( v[d] ^ v[a], 16); \ - v[c] += v[d]; \ - v[b] = ROTR( v[b] ^ v[c], 11); \ -} - -__device__ __forceinline__ -void quark_blake512_compress(uint64_t *h, const uint64_t *block, const uint8_t ((*sigma)[16]), const uint64_t *u512, const int T0) -{ - uint64_t v[16]; - uint64_t m[16]; - - #pragma unroll - for(int i=0; i < 16; i++) { - m[i] = cuda_swab64(block[i]); - } - - //#pragma unroll 8 - for(int i=0; i < 8; i++) - v[i] = h[i]; - - v[ 8] = u512[0]; - v[ 9] = u512[1]; - v[10] = u512[2]; - v[11] = u512[3]; - v[12] = u512[4] ^ T0; - v[13] = u512[5] ^ T0; - v[14] = u512[6]; - v[15] = u512[7]; - - //#pragma unroll 16 - for(int i=0; i < 16; i++) - { - /* column step */ - G( 0, 4, 8, 12, 0 ); - G( 1, 5, 9, 13, 2 ); - G( 2, 6, 10, 14, 4 ); - G( 3, 7, 11, 15, 6 ); - /* diagonal step */ - G( 0, 5, 10, 15, 8 ); - G( 1, 6, 11, 12, 10 ); - G( 2, 7, 8, 13, 12 ); - G( 3, 4, 9, 14, 14 ); - } - - h[0] ^= v[0] ^ v[8]; - h[1] ^= v[1] ^ v[9]; - h[2] ^= v[2] ^ v[10]; - h[3] ^= v[3] ^ v[11]; - h[4] ^= v[4] ^ v[12]; - h[5] ^= v[5] ^ v[13]; - h[6] ^= v[6] ^ v[14]; - h[7] ^= v[7] ^ v[15]; -} - -__global__ __launch_bounds__(256, 4) -void quark_blake512_gpu_hash_64(uint32_t threads, uint32_t startNounce, uint32_t *g_nonceVector, uint64_t *g_hash) -{ -#if !defined(SP_KERNEL) || __CUDA_ARCH__ < 500 - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - -#if USE_SHUFFLE - const uint32_t warpBlockID = (thread + 15)>>4; // aufrunden auf volle Warp-Blöcke - - if (warpBlockID < ( (threads+15)>>4 )) -#else - if (thread < threads) -#endif - { - uint32_t nounce = (g_nonceVector != NULL) ? g_nonceVector[thread] : (startNounce + thread); - - off_t hashPosition = nounce - startNounce; - uint64_t *inpHash = &g_hash[hashPosition<<3]; // hashPosition * 8 - - // 128 Bytes - uint64_t buf[16]; - - // State - uint64_t h[8] = { - 0x6a09e667f3bcc908ULL, - 0xbb67ae8584caa73bULL, - 0x3c6ef372fe94f82bULL, - 0xa54ff53a5f1d36f1ULL, - 0x510e527fade682d1ULL, - 0x9b05688c2b3e6c1fULL, - 0x1f83d9abfb41bd6bULL, - 0x5be0cd19137e2179ULL - }; - - // Message for first round - #pragma unroll 8 - for (int i=0; i < 8; ++i) - buf[i] = inpHash[i]; - - // Hash Pad - buf[8] = 0x0000000000000080ull; - buf[9] = 0; - buf[10] = 0; - buf[11] = 0; - buf[12] = 0; - buf[13] = 0x0100000000000000ull; - buf[14] = 0; - buf[15] = 0x0002000000000000ull; - - // Ending round - quark_blake512_compress(h, buf, c_sigma_big, c_u512, 512); - -#if __CUDA_ARCH__ <= 350 - uint32_t *outHash = (uint32_t*)&g_hash[hashPosition * 8U]; - #pragma unroll 8 - for (int i=0; i < 8; i++) { - outHash[2*i+0] = cuda_swab32( _HIDWORD(h[i]) ); - outHash[2*i+1] = cuda_swab32( _LODWORD(h[i]) ); - } -#else - uint64_t *outHash = &g_hash[hashPosition * 8U]; - for (int i=0; i < 8; i++) { - outHash[i] = cuda_swab64(h[i]); - } -#endif - } -#endif /* SP */ -} - -__global__ __launch_bounds__(256,4) -void quark_blake512_gpu_hash_80(uint32_t threads, uint32_t startNounce, void *outputHash) -{ -//#if !defined(SP_KERNEL) || __CUDA_ARCH__ < 500 - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint64_t buf[16]; - #pragma unroll - for (int i=0; i < 16; ++i) - buf[i] = c_PaddedMessage80[i]; - - // The test Nonce - const uint32_t nounce = startNounce + thread; - ((uint32_t*)buf)[19] = cuda_swab32(nounce); - - uint64_t h[8] = { - 0x6a09e667f3bcc908ULL, - 0xbb67ae8584caa73bULL, - 0x3c6ef372fe94f82bULL, - 0xa54ff53a5f1d36f1ULL, - 0x510e527fade682d1ULL, - 0x9b05688c2b3e6c1fULL, - 0x1f83d9abfb41bd6bULL, - 0x5be0cd19137e2179ULL - }; - - quark_blake512_compress(h, buf, c_sigma_big, c_u512, 640); - -#if __CUDA_ARCH__ <= 350 - uint32_t *outHash = (uint32_t*)outputHash + (thread * 16U); - #pragma unroll 8 - for (uint32_t i=0; i < 8; i++) { - outHash[2*i] = cuda_swab32( _HIDWORD(h[i]) ); - outHash[2*i+1] = cuda_swab32( _LODWORD(h[i]) ); - } -#else - uint64_t *outHash = (uint64_t*)outputHash + (thread * 8U); - for (uint32_t i=0; i < 8; i++) { - outHash[i] = cuda_swab64( h[i] ); - } -#endif - } -//#endif -} - -#ifdef SP_KERNEL -#include "cuda_quark_blake512_sp.cuh" -#endif - -__host__ -void quark_blake512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_outputHash, int order) -{ -#ifdef SP_KERNEL - int dev_id = device_map[thr_id]; - if (device_sm[dev_id] >= 500 && cuda_arch[dev_id] >= 500) - quark_blake512_cpu_hash_64_sp(threads, startNounce, d_nonceVector, d_outputHash); - else -#endif - { - const uint32_t threadsperblock = 256; - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - quark_blake512_gpu_hash_64<<>>(threads, startNounce, d_nonceVector, (uint64_t*)d_outputHash); - } - //MyStreamSynchronize(NULL, order, thr_id); -} - -__host__ -void quark_blake512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_outputHash) -{ -#ifdef SP_KERNEL - int dev_id = device_map[thr_id]; - if (device_sm[dev_id] >= 500 && cuda_arch[dev_id] >= 500) - quark_blake512_cpu_hash_80_sp(threads, startNounce, d_outputHash); - else -#endif - { - const uint32_t threadsperblock = 256; - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - quark_blake512_gpu_hash_80<<>>(threads, startNounce, d_outputHash); - } -} - -// ---------------------------- END CUDA quark_blake512 functions ------------------------------------ - -__host__ -void quark_blake512_cpu_init(int thr_id, uint32_t threads) -{ - cuda_get_arch(thr_id); -} - -__host__ -void quark_blake512_cpu_free(int thr_id) -{ -} - -// ----------------------------- Host midstate for 80-bytes input ------------------------------------ - -#undef SPH_C32 -#undef SPH_T32 -#undef SPH_C64 -#undef SPH_T64 - -extern "C" { -#include "sph/sph_blake.h" -} - -__host__ -void quark_blake512_cpu_setBlock_80(int thr_id, uint32_t *endiandata) -{ -#ifdef SP_KERNEL - int dev_id = device_map[thr_id]; - if (device_sm[dev_id] >= 500 && cuda_arch[dev_id] >= 500) - quark_blake512_cpu_setBlock_80_sp(thr_id, (uint64_t*) endiandata); - else -#endif - { - uint64_t message[16]; - - memcpy(message, endiandata, 80); - message[10] = 0x80; - message[11] = 0; - message[12] = 0; - message[13] = 0x0100000000000000ull; - message[14] = 0; - message[15] = 0x8002000000000000ull; // 0x280 - - cudaMemcpyToSymbol(c_PaddedMessage80, message, sizeof(message), 0, cudaMemcpyHostToDevice); - } - CUDA_LOG_ERROR(); -} diff --git a/quark/cuda_quark_blake512_sp.cuh b/quark/cuda_quark_blake512_sp.cuh deleted file mode 100644 index 069620a6..00000000 --- a/quark/cuda_quark_blake512_sp.cuh +++ /dev/null @@ -1,670 +0,0 @@ -/* sp implementation of blake */ - -#include -#include -#include "miner.h" - -// Should stay outside the ifdef on WIN64 (wtf) -#include "cuda_vector_uint2x4.h" -__constant__ static uint2 c_PaddedM[16]; -__constant__ static uint2x4 c_Hostprecalc[4]; - -#if __CUDA_ARCH__ >= 500 || !defined(__CUDA_ARCH__) - -#undef G -#define vectorizelow(/* uint32_t*/ v) make_uint2(v,0) -#define vectorizehigh(/*uint32_t*/ v) make_uint2(0,v) - -static __device__ __forceinline__ uint2 cuda_swap(uint2 v) { - const uint32_t t = cuda_swab32(v.x); - v.x = cuda_swab32(v.y); - v.y = t; - return v; -} -static __device__ __forceinline__ uint2 eorswap32(uint2 u, uint2 v) { - uint2 result; - result.y = u.x ^ v.x; - result.x = u.y ^ v.y; - return result; -} - -__constant__ uint2 c_512_u2[16] = -{ - { 0x85a308d3UL, 0x243f6a88 }, { 0x03707344UL, 0x13198a2e }, - { 0x299f31d0UL, 0xa4093822 }, { 0xec4e6c89UL, 0x082efa98 }, - { 0x38d01377UL, 0x452821e6 }, { 0x34e90c6cUL, 0xbe5466cf }, - { 0xc97c50ddUL, 0xc0ac29b7 }, { 0xb5470917UL, 0x3f84d5b5 }, - { 0x8979fb1bUL, 0x9216d5d9 }, { 0x98dfb5acUL, 0xd1310ba6 }, - { 0xd01adfb7UL, 0x2ffd72db }, { 0x6a267e96UL, 0xb8e1afed }, - { 0xf12c7f99UL, 0xba7c9045 }, { 0xb3916cf7UL, 0x24a19947 }, - { 0x858efc16UL, 0x0801f2e2 }, { 0x71574e69UL, 0x636920d8 } -}; - -__constant__ uint8_t c_sigma[6][16] = { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, - { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } -}; - -// ---------------------------- BEGIN CUDA quark_blake512 functions ------------------------------------ - -#define Gprecalc(a,b,c,d,idx1,idx2) { \ - v[a] += (block[idx2] ^ c_512_u2[idx1]) + v[b]; \ - v[d] = eorswap32( v[d] , v[a]); \ - v[c] += v[d]; \ - v[b] = ROR2(v[b] ^ v[c], 25); \ - v[a] += (block[idx1] ^ c_512_u2[idx2]) + v[b]; \ - v[d] = ROR16(v[d] ^ v[a]); \ - v[c] += v[d]; \ - v[b] = ROR2(v[b] ^ v[c], 11); \ -} - -#define GprecalcHost(a,b,c,d,idx1,idx2) { \ - v[a] += (block[idx2] ^ u512[idx1]) + v[b]; \ - v[d] = ROTR64( v[d] ^ v[a],32); \ - v[c] += v[d]; \ - v[b] = ROTR64(v[b] ^ v[c], 25); \ - v[a] += (block[idx1] ^ u512[idx2]) + v[b]; \ - v[d] = ROTR64(v[d] ^ v[a],16); \ - v[c] += v[d]; \ - v[b] = ROTR64(v[b] ^ v[c], 11); \ -} - -#define G(a,b,c,d,x) { \ - uint32_t idx1 = c_sigma[i][x]; \ - uint32_t idx2 = c_sigma[i][x+1]; \ - v[a] += (block[idx1] ^ c_512_u2[idx2]) + v[b]; \ - v[d] = eorswap32(v[d] , v[a]); \ - v[c] += v[d]; \ - v[b] = ROR2( v[b] ^ v[c], 25); \ - v[a] += (block[idx2] ^ c_512_u2[idx1]) + v[b]; \ - v[d] = ROR16( v[d] ^ v[a]); \ - v[c] += v[d]; \ - v[b] = ROR2( v[b] ^ v[c], 11); \ -} - -__global__ -#if __CUDA_ARCH__ > 500 -__launch_bounds__(256, 1) -#endif -void quark_blake512_gpu_hash_64_sp(uint32_t threads, uint32_t startNounce, uint32_t *const __restrict__ g_nonceVector, uint2* g_hash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - - if (thread < threads) - { - const uint32_t nounce = (g_nonceVector != NULL) ? g_nonceVector[thread] : (startNounce + thread); - const uint32_t hashPosition = nounce - startNounce; - - uint2 msg[16]; - - uint2x4 *phash = (uint2x4*)&g_hash[hashPosition * 8U]; - uint2x4 *outpt = (uint2x4*)msg; - outpt[0] = phash[0]; - outpt[1] = phash[1]; - - uint2 block[16]; - block[0].x = cuda_swab32(msg[0].y); - block[0].y = cuda_swab32(msg[0].x); - block[1].x = cuda_swab32(msg[1].y); - block[1].y = cuda_swab32(msg[1].x); - block[2].x = cuda_swab32(msg[2].y); - block[2].y = cuda_swab32(msg[2].x); - block[3].x = cuda_swab32(msg[3].y); - block[3].y = cuda_swab32(msg[3].x); - block[4].x = cuda_swab32(msg[4].y); - block[4].y = cuda_swab32(msg[4].x); - block[5].x = cuda_swab32(msg[5].y); - block[5].y = cuda_swab32(msg[5].x); - block[6].x = cuda_swab32(msg[6].y); - block[6].y = cuda_swab32(msg[6].x); - block[7].x = cuda_swab32(msg[7].y); - block[7].y = cuda_swab32(msg[7].x); - - block[8] = vectorizehigh(0x80000000); - block[9] = vectorizelow(0x0); - block[10] = vectorizelow(0x0); - block[11] = vectorizelow(0x0); - block[12] = vectorizelow(0x0); - block[13] = vectorizelow(0x1); - block[14] = vectorizelow(0x0); - block[15] = vectorizelow(0x200); - - const uint2 h[8] = { - { 0xf3bcc908UL, 0x6a09e667UL }, - { 0x84caa73bUL, 0xbb67ae85UL }, - { 0xfe94f82bUL, 0x3c6ef372UL }, - { 0x5f1d36f1UL, 0xa54ff53aUL }, - { 0xade682d1UL, 0x510e527fUL }, - { 0x2b3e6c1fUL, 0x9b05688cUL }, - { 0xfb41bd6bUL, 0x1f83d9abUL }, - { 0x137e2179UL, 0x5be0cd19UL } - }; - - uint2 v[16] = { - h[0], h[1], h[2], h[3], h[4], h[5], h[6], h[7], - c_512_u2[0], c_512_u2[1], c_512_u2[2], c_512_u2[3], - c_512_u2[4], c_512_u2[5], c_512_u2[6], c_512_u2[7] - }; - v[12].x ^= 512U; - v[13].x ^= 512U; - - Gprecalc(0, 4, 8, 12, 0x1, 0x0) - Gprecalc(1, 5, 9, 13, 0x3, 0x2) - Gprecalc(2, 6, 10, 14, 0x5, 0x4) - Gprecalc(3, 7, 11, 15, 0x7, 0x6) - Gprecalc(0, 5, 10, 15, 0x9, 0x8) - Gprecalc(1, 6, 11, 12, 0xb, 0xa) - Gprecalc(2, 7, 8, 13, 0xd, 0xc) - Gprecalc(3, 4, 9, 14, 0xf, 0xe) - - Gprecalc(0, 4, 8, 12, 0xa, 0xe) - Gprecalc(1, 5, 9, 13, 0x8, 0x4) - Gprecalc(2, 6, 10, 14, 0xf, 0x9) - Gprecalc(3, 7, 11, 15, 0x6, 0xd) - Gprecalc(0, 5, 10, 15, 0xc, 0x1) - Gprecalc(1, 6, 11, 12, 0x2, 0x0) - Gprecalc(2, 7, 8, 13, 0x7, 0xb) - Gprecalc(3, 4, 9, 14, 0x3, 0x5) - - Gprecalc(0, 4, 8, 12, 0x8, 0xb) - Gprecalc(1, 5, 9, 13, 0x0, 0xc) - Gprecalc(2, 6, 10, 14, 0x2, 0x5) - Gprecalc(3, 7, 11, 15, 0xd, 0xf) - Gprecalc(0, 5, 10, 15, 0xe, 0xa) - Gprecalc(1, 6, 11, 12, 0x6, 0x3) - Gprecalc(2, 7, 8, 13, 0x1, 0x7) - Gprecalc(3, 4, 9, 14, 0x4, 0x9) - - Gprecalc(0, 4, 8, 12, 0x9, 0x7) - Gprecalc(1, 5, 9, 13, 0x1, 0x3) - Gprecalc(2, 6, 10, 14, 0xc, 0xd) - Gprecalc(3, 7, 11, 15, 0xe, 0xb) - Gprecalc(0, 5, 10, 15, 0x6, 0x2) - Gprecalc(1, 6, 11, 12, 0xa, 0x5) - Gprecalc(2, 7, 8, 13, 0x0, 0x4) - Gprecalc(3, 4, 9, 14, 0x8, 0xf) - - Gprecalc(0, 4, 8, 12, 0x0, 0x9) - Gprecalc(1, 5, 9, 13, 0x7, 0x5) - Gprecalc(2, 6, 10, 14, 0x4, 0x2) - Gprecalc(3, 7, 11, 15, 0xf, 0xa) - Gprecalc(0, 5, 10, 15, 0x1, 0xe) - Gprecalc(1, 6, 11, 12, 0xc, 0xb) - Gprecalc(2, 7, 8, 13, 0x8, 0x6) - Gprecalc(3, 4, 9, 14, 0xd, 0x3) - - Gprecalc(0, 4, 8, 12, 0xc, 0x2) - Gprecalc(1, 5, 9, 13, 0xa, 0x6) - Gprecalc(2, 6, 10, 14, 0xb, 0x0) - Gprecalc(3, 7, 11, 15, 0x3, 0x8) - Gprecalc(0, 5, 10, 15, 0xd, 0x4) - Gprecalc(1, 6, 11, 12, 0x5, 0x7) - Gprecalc(2, 7, 8, 13, 0xe, 0xf) - Gprecalc(3, 4, 9, 14, 0x9, 0x1) - - Gprecalc(0, 4, 8, 12, 0x5, 0xc) - Gprecalc(1, 5, 9, 13, 0xf, 0x1) - Gprecalc(2, 6, 10, 14, 0xd, 0xe) - Gprecalc(3, 7, 11, 15, 0xa, 0x4) - Gprecalc(0, 5, 10, 15, 0x7, 0x0) - Gprecalc(1, 6, 11, 12, 0x3, 0x6) - Gprecalc(2, 7, 8, 13, 0x2, 0x9) - Gprecalc(3, 4, 9, 14, 0xb, 0x8) - - Gprecalc(0, 4, 8, 12, 0xb, 0xd) - Gprecalc(1, 5, 9, 13, 0xe, 0x7) - Gprecalc(2, 6, 10, 14, 0x1, 0xc) - Gprecalc(3, 7, 11, 15, 0x9, 0x3) - Gprecalc(0, 5, 10, 15, 0x0, 0x5) - Gprecalc(1, 6, 11, 12, 0x4, 0xf) - Gprecalc(2, 7, 8, 13, 0x6, 0x8) - Gprecalc(3, 4, 9, 14, 0xa, 0x2) - - Gprecalc(0, 4, 8, 12, 0xf, 0x6) - Gprecalc(1, 5, 9, 13, 0x9, 0xe) - Gprecalc(2, 6, 10, 14, 0x3, 0xb) - Gprecalc(3, 7, 11, 15, 0x8, 0x0) - Gprecalc(0, 5, 10, 15, 0x2, 0xc) - Gprecalc(1, 6, 11, 12, 0x7, 0xd) - Gprecalc(2, 7, 8, 13, 0x4, 0x1) - Gprecalc(3, 4, 9, 14, 0x5, 0xa) - - Gprecalc(0, 4, 8, 12, 0x2, 0xa) - Gprecalc(1, 5, 9, 13, 0x4, 0x8) - Gprecalc(2, 6, 10, 14, 0x6, 0x7) - Gprecalc(3, 7, 11, 15, 0x5, 0x1) - Gprecalc(0, 5, 10, 15, 0xb, 0xf) - Gprecalc(1, 6, 11, 12, 0xe, 0x9) - Gprecalc(2, 7, 8, 13, 0xc, 0x3) - Gprecalc(3, 4, 9, 14, 0x0, 0xd) - - #if __CUDA_ARCH__ == 500 - - Gprecalc(0, 4, 8, 12, 0x1, 0x0) - Gprecalc(1, 5, 9, 13, 0x3, 0x2) - Gprecalc(2, 6, 10, 14, 0x5, 0x4) - Gprecalc(3, 7, 11, 15, 0x7, 0x6) - Gprecalc(0, 5, 10, 15, 0x9, 0x8) - Gprecalc(1, 6, 11, 12, 0xb, 0xa) - Gprecalc(2, 7, 8, 13, 0xd, 0xc) - Gprecalc(3, 4, 9, 14, 0xf, 0xe) - - Gprecalc(0, 4, 8, 12, 0xa, 0xe) - Gprecalc(1, 5, 9, 13, 0x8, 0x4) - Gprecalc(2, 6, 10, 14, 0xf, 0x9) - Gprecalc(3, 7, 11, 15, 0x6, 0xd) - Gprecalc(0, 5, 10, 15, 0xc, 0x1) - Gprecalc(1, 6, 11, 12, 0x2, 0x0) - Gprecalc(2, 7, 8, 13, 0x7, 0xb) - Gprecalc(3, 4, 9, 14, 0x3, 0x5) - - Gprecalc(0, 4, 8, 12, 0x8, 0xb) - Gprecalc(1, 5, 9, 13, 0x0, 0xc) - Gprecalc(2, 6, 10, 14, 0x2, 0x5) - Gprecalc(3, 7, 11, 15, 0xd, 0xf) - Gprecalc(0, 5, 10, 15, 0xe, 0xa) - Gprecalc(1, 6, 11, 12, 0x6, 0x3) - Gprecalc(2, 7, 8, 13, 0x1, 0x7) - Gprecalc(3, 4, 9, 14, 0x4, 0x9) - - Gprecalc(0, 4, 8, 12, 0x9, 0x7) - Gprecalc(1, 5, 9, 13, 0x1, 0x3) - Gprecalc(2, 6, 10, 14, 0xc, 0xd) - Gprecalc(3, 7, 11, 15, 0xe, 0xb) - Gprecalc(0, 5, 10, 15, 0x6, 0x2) - Gprecalc(1, 6, 11, 12, 0xa, 0x5) - Gprecalc(2, 7, 8, 13, 0x0, 0x4) - Gprecalc(3, 4, 9, 14, 0x8, 0xf) - - Gprecalc(0, 4, 8, 12, 0x0, 0x9) - Gprecalc(1, 5, 9, 13, 0x7, 0x5) - Gprecalc(2, 6, 10, 14, 0x4, 0x2) - Gprecalc(3, 7, 11, 15, 0xf, 0xa) - Gprecalc(0, 5, 10, 15, 0x1, 0xe) - Gprecalc(1, 6, 11, 12, 0xc, 0xb) - Gprecalc(2, 7, 8, 13, 0x8, 0x6) - Gprecalc(3, 4, 9, 14, 0xd, 0x3) - - Gprecalc(0, 4, 8, 12, 0xc, 0x2) - Gprecalc(1, 5, 9, 13, 0xa, 0x6) - Gprecalc(2, 6, 10, 14, 0xb, 0x0) - Gprecalc(3, 7, 11, 15, 0x3, 0x8) - Gprecalc(0, 5, 10, 15, 0xd, 0x4) - Gprecalc(1, 6, 11, 12, 0x5, 0x7) - Gprecalc(2, 7, 8, 13, 0xe, 0xf) - Gprecalc(3, 4, 9, 14, 0x9, 0x1) - - #else - - for (int i = 0; i < 6; i++) - { - /* column step */ - G(0, 4, 8, 12, 0); - G(1, 5, 9, 13, 2); - G(2, 6, 10, 14, 4); - G(3, 7, 11, 15, 6); - /* diagonal step */ - G(0, 5, 10, 15, 8); - G(1, 6, 11, 12, 10); - G(2, 7, 8, 13, 12); - G(3, 4, 9, 14, 14); - } - #endif - - v[0] = cuda_swap(h[0] ^ v[0] ^ v[8]); - v[1] = cuda_swap(h[1] ^ v[1] ^ v[9]); - v[2] = cuda_swap(h[2] ^ v[2] ^ v[10]); - v[3] = cuda_swap(h[3] ^ v[3] ^ v[11]); - v[4] = cuda_swap(h[4] ^ v[4] ^ v[12]); - v[5] = cuda_swap(h[5] ^ v[5] ^ v[13]); - v[6] = cuda_swap(h[6] ^ v[6] ^ v[14]); - v[7] = cuda_swap(h[7] ^ v[7] ^ v[15]); - - phash = (uint2x4*)v; - outpt = (uint2x4*)&g_hash[hashPosition * 8U]; - outpt[0] = phash[0]; - outpt[1] = phash[1]; - } -} - - -__global__ -__launch_bounds__(128, 8) -void quark_blake512_gpu_hash_80_sp(uint32_t threads, uint32_t startNounce, uint2 *outputHash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const uint32_t nounce = startNounce + thread; - uint2 block[16]; - - block[0] = c_PaddedM[0]; - block[1] = c_PaddedM[1]; - block[2] = c_PaddedM[2]; - block[3] = c_PaddedM[3]; - block[4] = c_PaddedM[4]; - block[5] = c_PaddedM[5]; - block[6] = c_PaddedM[6]; - block[7] = c_PaddedM[7]; - block[8] = c_PaddedM[8]; - block[9].y = c_PaddedM[9].y; - - block[10] = vectorizehigh(0x80000000); - block[11] = vectorizelow(0); - block[12] = vectorizelow(0); - block[13] = vectorizelow(0x1); - block[14] = vectorizelow(0); - block[15] = vectorizelow(0x280); - block[9].x = nounce; - - const uint2 h[8] = { - { 0xf3bcc908UL, 0x6a09e667UL }, - { 0x84caa73bUL, 0xbb67ae85UL }, - { 0xfe94f82bUL, 0x3c6ef372UL }, - { 0x5f1d36f1UL, 0xa54ff53aUL }, - { 0xade682d1UL, 0x510e527fUL }, - { 0x2b3e6c1fUL, 0x9b05688cUL }, - { 0xfb41bd6bUL, 0x1f83d9abUL }, - { 0x137e2179UL, 0x5be0cd19UL } - }; - - uint2 v[16]; - uint2x4 *outpt = (uint2x4*)v; - - outpt[0] = c_Hostprecalc[0]; - outpt[1] = c_Hostprecalc[1]; - outpt[2] = c_Hostprecalc[2]; - outpt[3] = c_Hostprecalc[3]; - - v[0] += (block[9] ^ c_512_u2[8]); - v[15] = ROR16(v[15] ^ v[0]); - v[10] += v[15]; - v[5] = ROR2(v[5] ^ v[10], 11); - - Gprecalc(0, 4, 8, 12, 0xa, 0xe) - -// Gprecalc(1, 5, 9, 13, 0x8, 0x4) - v[1] += v[5]; - v[13] = eorswap32(v[13], v[1]); - v[9] += v[13]; - - v[5] = ROR2(v[5] ^ v[9], 25); - v[1] += (block[8] ^ c_512_u2[4]) + v[5]; - v[13] = ROR16(v[13] ^ v[1]); - v[9] += v[13]; - v[5] = ROR2(v[5] ^ v[9], 11); - -// Gprecalc(2, 6, 10, 14, 0xf, 0x9) - v[2] += (block[9] ^ c_512_u2[0xf]); - v[14] = eorswap32(v[14], v[2]); - v[10] += v[14]; - v[6] = ROR2(v[6] ^ v[10], 25); - v[2] += (block[0xf] ^ c_512_u2[9]) + v[6]; - v[14] = ROR16(v[14] ^ v[2]); - v[10] += v[14]; - v[6] = ROR2(v[6] ^ v[10], 11); - -// Gprecalc(3, 7, 11, 15, 0x6, 0xd) - v[15] = eorswap32( v[15] , v[3]); - v[11] += v[15]; - v[7] = ROR2(v[7] ^ v[11], 25); - v[3] += (block[6] ^ c_512_u2[0xd]) + v[7]; - v[15] = ROR16(v[15] ^ v[3]); - v[11] += v[15]; - v[7] = ROR2(v[7] ^ v[11], 11); - - Gprecalc(0, 5, 10, 15, 0xc, 0x1) - Gprecalc(1, 6, 11, 12, 0x2, 0x0) - Gprecalc(2, 7, 8, 13, 0x7, 0xb) - Gprecalc(3, 4, 9, 14, 0x3, 0x5) - - Gprecalc(0, 4, 8, 12, 0x8, 0xb) - Gprecalc(1, 5, 9, 13, 0x0, 0xc) - Gprecalc(2, 6, 10, 14, 0x2, 0x5) - Gprecalc(3, 7, 11, 15, 0xd, 0xf) - Gprecalc(0, 5, 10, 15, 0xe, 0xa) - Gprecalc(1, 6, 11, 12, 0x6, 0x3) - Gprecalc(2, 7, 8, 13, 0x1, 0x7) - Gprecalc(3, 4, 9, 14, 0x4, 0x9) - - Gprecalc(0, 4, 8, 12, 0x9, 0x7) - Gprecalc(1, 5, 9, 13, 0x1, 0x3) - Gprecalc(2, 6, 10, 14, 0xc, 0xd) - Gprecalc(3, 7, 11, 15, 0xe, 0xb) - Gprecalc(0, 5, 10, 15, 0x6, 0x2) - Gprecalc(1, 6, 11, 12, 0xa, 0x5) - Gprecalc(2, 7, 8, 13, 0x0, 0x4) - Gprecalc(3, 4, 9, 14, 0x8, 0xf) - - Gprecalc(0, 4, 8, 12, 0x0, 0x9) - Gprecalc(1, 5, 9, 13, 0x7, 0x5) - Gprecalc(2, 6, 10, 14, 0x4, 0x2) - Gprecalc(3, 7, 11, 15, 0xf, 0xa) - Gprecalc(0, 5, 10, 15, 0x1, 0xe) - Gprecalc(1, 6, 11, 12, 0xc, 0xb) - Gprecalc(2, 7, 8, 13, 0x8, 0x6) - Gprecalc(3, 4, 9, 14, 0xd, 0x3) - - Gprecalc(0, 4, 8, 12, 0xc, 0x2) - Gprecalc(1, 5, 9, 13, 0xa, 0x6) - Gprecalc(2, 6, 10, 14, 0xb, 0x0) - Gprecalc(3, 7, 11, 15, 0x3, 0x8) - Gprecalc(0, 5, 10, 15, 0xd, 0x4) - Gprecalc(1, 6, 11, 12, 0x5, 0x7) - Gprecalc(2, 7, 8, 13, 0xe, 0xf) - Gprecalc(3, 4, 9, 14, 0x9, 0x1) - - Gprecalc(0, 4, 8, 12, 0x5, 0xc) - Gprecalc(1, 5, 9, 13, 0xf, 0x1) - Gprecalc(2, 6, 10, 14, 0xd, 0xe) - Gprecalc(3, 7, 11, 15, 0xa, 0x4) - Gprecalc(0, 5, 10, 15, 0x7, 0x0) - Gprecalc(1, 6, 11, 12, 0x3, 0x6) - Gprecalc(2, 7, 8, 13, 0x2, 0x9) - Gprecalc(3, 4, 9, 14, 0xb, 0x8) - - Gprecalc(0, 4, 8, 12, 0xb, 0xd) - Gprecalc(1, 5, 9, 13, 0xe, 0x7) - Gprecalc(2, 6, 10, 14, 0x1, 0xc) - Gprecalc(3, 7, 11, 15, 0x9, 0x3) - Gprecalc(0, 5, 10, 15, 0x0, 0x5) - Gprecalc(1, 6, 11, 12, 0x4, 0xf) - Gprecalc(2, 7, 8, 13, 0x6, 0x8) - Gprecalc(3, 4, 9, 14, 0xa, 0x2) - - Gprecalc(0, 4, 8, 12, 0xf, 0x6) - Gprecalc(1, 5, 9, 13, 0x9, 0xe) - Gprecalc(2, 6, 10, 14, 0x3, 0xb) - Gprecalc(3, 7, 11, 15, 0x8, 0x0) - Gprecalc(0, 5, 10, 15, 0x2, 0xc) - Gprecalc(1, 6, 11, 12, 0x7, 0xd) - Gprecalc(2, 7, 8, 13, 0x4, 0x1) - Gprecalc(3, 4, 9, 14, 0x5, 0xa) - - Gprecalc(0, 4, 8, 12, 0x2, 0xa) - Gprecalc(1, 5, 9, 13, 0x4, 0x8) - Gprecalc(2, 6, 10, 14, 0x6, 0x7) - Gprecalc(3, 7, 11, 15, 0x5, 0x1) - Gprecalc(0, 5, 10, 15, 0xb, 0xf) - Gprecalc(1, 6, 11, 12, 0xe, 0x9) - Gprecalc(2, 7, 8, 13, 0xc, 0x3) - Gprecalc(3, 4, 9, 14, 0x0, 0xd) - - Gprecalc(0, 4, 8, 12, 0x1, 0x0) - Gprecalc(1, 5, 9, 13, 0x3, 0x2) - Gprecalc(2, 6, 10, 14, 0x5, 0x4) - Gprecalc(3, 7, 11, 15, 0x7, 0x6) - Gprecalc(0, 5, 10, 15, 0x9, 0x8) - Gprecalc(1, 6, 11, 12, 0xb, 0xa) - Gprecalc(2, 7, 8, 13, 0xd, 0xc) - Gprecalc(3, 4, 9, 14, 0xf, 0xe) - - Gprecalc(0, 4, 8, 12, 0xa, 0xe) - Gprecalc(1, 5, 9, 13, 0x8, 0x4) - Gprecalc(2, 6, 10, 14, 0xf, 0x9) - Gprecalc(3, 7, 11, 15, 0x6, 0xd) - Gprecalc(0, 5, 10, 15, 0xc, 0x1) - Gprecalc(1, 6, 11, 12, 0x2, 0x0) - Gprecalc(2, 7, 8, 13, 0x7, 0xb) - Gprecalc(3, 4, 9, 14, 0x3, 0x5) - - Gprecalc(0, 4, 8, 12, 0x8, 0xb) - Gprecalc(1, 5, 9, 13, 0x0, 0xc) - Gprecalc(2, 6, 10, 14, 0x2, 0x5) - Gprecalc(3, 7, 11, 15, 0xd, 0xf) - Gprecalc(0, 5, 10, 15, 0xe, 0xa) - Gprecalc(1, 6, 11, 12, 0x6, 0x3) - Gprecalc(2, 7, 8, 13, 0x1, 0x7) - Gprecalc(3, 4, 9, 14, 0x4, 0x9) - - Gprecalc(0, 4, 8, 12, 0x9, 0x7) - Gprecalc(1, 5, 9, 13, 0x1, 0x3) - Gprecalc(2, 6, 10, 14, 0xc, 0xd) - Gprecalc(3, 7, 11, 15, 0xe, 0xb) - Gprecalc(0, 5, 10, 15, 0x6, 0x2) - Gprecalc(1, 6, 11, 12, 0xa, 0x5) - Gprecalc(2, 7, 8, 13, 0x0, 0x4) - Gprecalc(3, 4, 9, 14, 0x8, 0xf) - - Gprecalc(0, 4, 8, 12, 0x0, 0x9) - Gprecalc(1, 5, 9, 13, 0x7, 0x5) - Gprecalc(2, 6, 10, 14, 0x4, 0x2) - Gprecalc(3, 7, 11, 15, 0xf, 0xa) - Gprecalc(0, 5, 10, 15, 0x1, 0xe) - Gprecalc(1, 6, 11, 12, 0xc, 0xb) - Gprecalc(2, 7, 8, 13, 0x8, 0x6) - Gprecalc(3, 4, 9, 14, 0xd, 0x3) - - Gprecalc(0, 4, 8, 12, 0xc, 0x2) - Gprecalc(1, 5, 9, 13, 0xa, 0x6) - Gprecalc(2, 6, 10, 14, 0xb, 0x0) - Gprecalc(3, 7, 11, 15, 0x3, 0x8) - Gprecalc(0, 5, 10, 15, 0xd, 0x4) - Gprecalc(1, 6, 11, 12, 0x5, 0x7) - Gprecalc(2, 7, 8, 13, 0xe, 0xf) - Gprecalc(3, 4, 9, 14, 0x9, 0x1) - - v[0] = cuda_swap(h[0] ^ v[0] ^ v[8]); - v[1] = cuda_swap(h[1] ^ v[1] ^ v[9]); - v[2] = cuda_swap(h[2] ^ v[2] ^ v[10]); - v[3] = cuda_swap(h[3] ^ v[3] ^ v[11]); - v[4] = cuda_swap(h[4] ^ v[4] ^ v[12]); - v[5] = cuda_swap(h[5] ^ v[5] ^ v[13]); - v[6] = cuda_swap(h[6] ^ v[6] ^ v[14]); - v[7] = cuda_swap(h[7] ^ v[7] ^ v[15]); - - uint2x4 *phash = (uint2x4*)v; - outpt = (uint2x4*) &outputHash[thread * 8U]; - outpt[0] = phash[0]; - outpt[1] = phash[1]; - } -} - -// ---------------------------- END CUDA quark_blake512 functions ------------------------------------ - -__host__ void quark_blake512_cpu_setBlock_80_sp(int thr_id, uint64_t *pdata) -{ - uint64_t block[16]; - uint64_t PaddedMessage[10]; - uint64_t *peker = (uint64_t*) &PaddedMessage[0]; - for (int i = 0; i < 10; i++) - PaddedMessage[i] = cuda_swab64(pdata[i]); - - CUDA_SAFE_CALL(cudaMemcpyToSymbol((c_PaddedM), PaddedMessage, 10 * sizeof(uint64_t))); - - block[0] = peker[0]; - block[1] = peker[1]; - block[2] = peker[2]; - block[3] = peker[3]; - block[4] = peker[4]; - block[5] = peker[5]; - block[6] = peker[6]; - block[7] = peker[7]; - block[8] = peker[8]; - block[9] = peker[9]; - block[10] = 0x8000000000000000; - block[11] = 0; - block[12] = 0; - block[13] = 1; - block[14] = 0; - block[15] = 0x280; - - const uint64_t u512[16] = { - 0x243f6a8885a308d3ULL, 0x13198a2e03707344ULL, - 0xa4093822299f31d0ULL, 0x082efa98ec4e6c89ULL, - 0x452821e638d01377ULL, 0xbe5466cf34e90c6cULL, - 0xc0ac29b7c97c50ddULL, 0x3f84d5b5b5470917ULL, - 0x9216d5d98979fb1bULL, 0xd1310ba698dfb5acULL, - 0x2ffd72dbd01adfb7ULL, 0xb8e1afed6a267e96ULL, - 0xba7c9045f12c7f99ULL, 0x24a19947b3916cf7ULL, - 0x0801f2e2858efc16ULL, 0x636920d871574e69ULL - }; - - uint64_t h[8] = { - 0x6a09e667f3bcc908ULL, - 0xbb67ae8584caa73bULL, - 0x3c6ef372fe94f82bULL, - 0xa54ff53a5f1d36f1ULL, - 0x510e527fade682d1ULL, - 0x9b05688c2b3e6c1fULL, - 0x1f83d9abfb41bd6bULL, - 0x5be0cd19137e2179ULL - }; - - uint64_t v[16] = { - h[0], h[1], h[2], h[3], h[4], h[5], h[6], h[7], - u512[0], u512[1], u512[2], u512[3], u512[4] ^ 640U, u512[5] ^ 640U, u512[6], u512[7] - }; - - GprecalcHost(0, 4, 8, 12, 0x1, 0x0) - GprecalcHost(1, 5, 9, 13, 0x3, 0x2) - GprecalcHost(2, 6, 10, 14, 0x5, 0x4) - GprecalcHost(3, 7, 11, 15, 0x7, 0x6) - - GprecalcHost(1, 6, 11, 12, 0xb, 0xa) - GprecalcHost(2, 7, 8, 13, 0xd, 0xc) - - v[0] += (block[8] ^ u512[9]) + v[5]; - v[15] = ROTR64(v[15] ^ v[0], 32); \ - v[10] += v[15]; - v[5] = ROTR64(v[5] ^ v[10], 25); - v[0] += v[5]; - - GprecalcHost(3, 4, 9, 14, 0xf, 0xe); - - v[1] += (block[0x4] ^ u512[0x8]); - v[2] += v[6]; - - v[3] += (block[0xd] ^ u512[6]) + v[7]; - - CUDA_SAFE_CALL(cudaMemcpyToSymbol(c_Hostprecalc, v, 128, 0, cudaMemcpyHostToDevice)); -} - -#else -// __CUDA_ARCH__ < 500 -__host__ void quark_blake512_cpu_setBlock_80_sp(int thr_id, uint64_t *pdata) {} -__global__ void quark_blake512_gpu_hash_64_sp(uint32_t, uint32_t startNounce, uint32_t *const __restrict__ g_nonceVector, uint2 *const __restrict__ g_hash) {} -__global__ void quark_blake512_gpu_hash_80_sp(uint32_t, uint32_t startNounce, uint2 *outputHash) {} -#endif - -__host__ -void quark_blake512_cpu_hash_64_sp(uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_outputHash) -{ - const uint32_t threadsperblock = 32; - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - quark_blake512_gpu_hash_64_sp <<>>(threads, startNounce, d_nonceVector, (uint2*)d_outputHash); -} - -__host__ -void quark_blake512_cpu_hash_80_sp(uint32_t threads, uint32_t startNounce, uint32_t *d_outputHash) -{ - const uint32_t threadsperblock = 64; - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - quark_blake512_gpu_hash_80_sp <<>>(threads, startNounce, (uint2*)d_outputHash); -} diff --git a/quark/cuda_quark_compactionTest.cu b/quark/cuda_quark_compactionTest.cu deleted file mode 100644 index 3c9137ea..00000000 --- a/quark/cuda_quark_compactionTest.cu +++ /dev/null @@ -1,398 +0,0 @@ -/** - * __shfl_up require SM 3.0 arch! - * - * SM 2 alternative method by tpruvot@github 2015 - */ -#include -#include - -#include "cuda_helper.h" - -#ifdef __INTELLISENSE__ -/* just for vstudio code colors */ -#define __CUDA_ARCH__ 300 -#define __shfl_up(var, delta, width) (0) -#endif - -static uint32_t *h_numValid[MAX_GPUS]; -static uint32_t *d_tempBranch1Nonces[MAX_GPUS]; -static uint32_t *d_partSum[2][MAX_GPUS]; // für bis zu vier partielle Summen - -// True/False tester -typedef uint32_t(*cuda_compactTestFunction_t)(uint32_t *inpHash); - -__device__ uint32_t QuarkTrueTest(uint32_t *inpHash) -{ - return ((inpHash[0] & 0x08) == 0x08); -} - -__device__ uint32_t QuarkFalseTest(uint32_t *inpHash) -{ - return ((inpHash[0] & 0x08) == 0); -} - -__device__ cuda_compactTestFunction_t d_QuarkTrueFunction = QuarkTrueTest, d_QuarkFalseFunction = QuarkFalseTest; - -cuda_compactTestFunction_t h_QuarkTrueFunction[MAX_GPUS], h_QuarkFalseFunction[MAX_GPUS]; - -// Setup/Alloc Function -__host__ -void quark_compactTest_cpu_init(int thr_id, uint32_t threads) -{ - int dev_id = device_map[thr_id]; - cuda_get_arch(thr_id); - - cudaMemcpyFromSymbol(&h_QuarkTrueFunction[thr_id], d_QuarkTrueFunction, sizeof(cuda_compactTestFunction_t)); - cudaMemcpyFromSymbol(&h_QuarkFalseFunction[thr_id], d_QuarkFalseFunction, sizeof(cuda_compactTestFunction_t)); - - if (cuda_arch[dev_id] >= 300) { - uint32_t s1 = (threads / 256) * 2; - CUDA_SAFE_CALL(cudaMalloc(&d_tempBranch1Nonces[thr_id], sizeof(uint32_t) * threads * 2)); - CUDA_SAFE_CALL(cudaMalloc(&d_partSum[0][thr_id], sizeof(uint32_t) * s1)); // BLOCKSIZE (Threads/Block) - CUDA_SAFE_CALL(cudaMalloc(&d_partSum[1][thr_id], sizeof(uint32_t) * s1)); // BLOCKSIZE (Threads/Block) - } else { - CUDA_SAFE_CALL(cudaMalloc(&d_tempBranch1Nonces[thr_id], sizeof(uint32_t) * threads)); - } - - cudaMallocHost(&h_numValid[thr_id], 2*sizeof(uint32_t)); -} - -// Because all alloc should have a free... -__host__ -void quark_compactTest_cpu_free(int thr_id) -{ - int dev_id = device_map[thr_id]; - - cudaFreeHost(h_numValid[thr_id]); - - if (cuda_arch[dev_id] >= 300) { - cudaFree(d_tempBranch1Nonces[thr_id]); - cudaFree(d_partSum[0][thr_id]); - cudaFree(d_partSum[1][thr_id]); - } else { - cudaFree(d_tempBranch1Nonces[thr_id]); - } -} - -__global__ -void quark_compactTest_gpu_SCAN(uint32_t *data, const int width, uint32_t *partial_sums=NULL, cuda_compactTestFunction_t testFunc=NULL, - uint32_t threads=0, uint32_t startNounce=0, uint32_t *inpHashes=NULL, uint32_t *d_validNonceTable=NULL) -{ -#if __CUDA_ARCH__ >= 300 - __shared__ uint32_t sums[32]; - int id = ((blockIdx.x * blockDim.x) + threadIdx.x); - //int lane_id = id % warpSize; - int lane_id = id % width; - // determine a warp_id within a block - //int warp_id = threadIdx.x / warpSize; - int warp_id = threadIdx.x / width; - - sums[lane_id] = 0; - - // Below is the basic structure of using a shfl instruction - // for a scan. - // Record "value" as a variable - we accumulate it along the way - uint32_t value; - if(testFunc != NULL) - { - if (id < threads) - { - uint32_t *inpHash; - if(d_validNonceTable == NULL) - { - // keine Nonce-Liste - inpHash = &inpHashes[id<<4]; - } else { - // Nonce-Liste verfügbar - int nonce = d_validNonceTable[id] - startNounce; - inpHash = &inpHashes[nonce<<4]; - } - value = (*testFunc)(inpHash); - } else { - value = 0; - } - } else { - value = data[id]; - } - - __syncthreads(); - - // Now accumulate in log steps up the chain - // compute sums, with another thread's value who is - // distance delta away (i). Note - // those threads where the thread 'i' away would have - // been out of bounds of the warp are unaffected. This - // creates the scan sum. - - #pragma unroll - for (int i=1; i<=width; i*=2) - { - uint32_t n = __shfl_up((int)value, i, width); - if (lane_id >= i) value += n; - } - - // value now holds the scan value for the individual thread - // next sum the largest values for each warp - - // write the sum of the warp to smem - //if (threadIdx.x % warpSize == warpSize-1) - if (threadIdx.x % width == width-1) - { - sums[warp_id] = value; - } - - __syncthreads(); - - // - // scan sum the warp sums - // the same shfl scan operation, but performed on warp sums - // - if (warp_id == 0) - { - uint32_t warp_sum = sums[lane_id]; - - for (int i=1; i<=width; i*=2) - { - uint32_t n = __shfl_up((int)warp_sum, i, width); - if (lane_id >= i) warp_sum += n; - } - - sums[lane_id] = warp_sum; - } - - __syncthreads(); - - // perform a uniform add across warps in the block - // read neighbouring warp's sum and add it to threads value - uint32_t blockSum = 0; - - if (warp_id > 0) - { - blockSum = sums[warp_id-1]; - } - - value += blockSum; - - // Now write out our result - data[id] = value; - - // last thread has sum, write write out the block's sum - if (partial_sums != NULL && threadIdx.x == blockDim.x-1) - { - partial_sums[blockIdx.x] = value; - } -#endif // SM3+ -} - -// Uniform add: add partial sums array -__global__ -void quark_compactTest_gpu_ADD(uint32_t *data, uint32_t *partial_sums, int len) -{ - __shared__ uint32_t buf; - int id = ((blockIdx.x * blockDim.x) + threadIdx.x); - - if (id > len) return; - - if (threadIdx.x == 0) - { - buf = partial_sums[blockIdx.x]; - } - - __syncthreads(); - data[id] += buf; -} - -__global__ -void quark_compactTest_gpu_SCATTER(uint32_t *sum, uint32_t *outp, cuda_compactTestFunction_t testFunc, - uint32_t threads=0, uint32_t startNounce=0, uint32_t *inpHashes=NULL, uint32_t *d_validNonceTable=NULL) -{ - int id = ((blockIdx.x * blockDim.x) + threadIdx.x); - uint32_t actNounce = id; - uint32_t value; - if (id < threads) - { - uint32_t *inpHash; - if(d_validNonceTable == NULL) - { - // keine Nonce-Liste - inpHash = &inpHashes[id<<4]; - } else { - // Nonce-Liste verfügbar - int nonce = d_validNonceTable[id] - startNounce; - actNounce = nonce; - inpHash = &inpHashes[nonce<<4]; - } - - value = (*testFunc)(inpHash); - } else { - value = 0; - } - - if (value) { - int idx = sum[id]; - if(idx > 0) - outp[idx-1] = startNounce + actNounce; - } -} - -__host__ static uint32_t quark_compactTest_roundUpExp(uint32_t val) -{ - if(val == 0) - return 0; - - uint32_t mask = 0x80000000; - while( (val & mask) == 0 ) mask = mask >> 1; - - if( (val & (~mask)) != 0 ) - return mask << 1; - - return mask; -} - -__host__ -void quark_compactTest_cpu_singleCompaction(int thr_id, uint32_t threads, uint32_t *nrm,uint32_t *d_nonces1, - cuda_compactTestFunction_t function, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable) -{ - int orgThreads = threads; - threads = quark_compactTest_roundUpExp(threads); - // threadsPerBlock ausrechnen - int blockSize = 256; - int nSummen = threads / blockSize; - - int thr1 = (threads+blockSize-1) / blockSize; - int thr2 = threads / (blockSize*blockSize); - int blockSize2 = (nSummen < blockSize) ? nSummen : blockSize; - int thr3 = (nSummen + blockSize2-1) / blockSize2; - - bool callThrid = (thr2 > 0) ? true : false; - - // Erster Initialscan - quark_compactTest_gpu_SCAN <<>>( - d_tempBranch1Nonces[thr_id], 32, d_partSum[0][thr_id], function, orgThreads, startNounce, inpHashes, d_validNonceTable); - - // weitere Scans - if(callThrid) { - quark_compactTest_gpu_SCAN<<>>(d_partSum[0][thr_id], 32, d_partSum[1][thr_id]); - quark_compactTest_gpu_SCAN<<<1, thr2>>>(d_partSum[1][thr_id], (thr2>32) ? 32 : thr2); - } else { - quark_compactTest_gpu_SCAN<<>>(d_partSum[0][thr_id], (blockSize2>32) ? 32 : blockSize2); - } - - // Sync + Anzahl merken - cudaStreamSynchronize(NULL); - - if(callThrid) - cudaMemcpy(nrm, &(d_partSum[1][thr_id])[thr2-1], sizeof(uint32_t), cudaMemcpyDeviceToHost); - else - cudaMemcpy(nrm, &(d_partSum[0][thr_id])[nSummen-1], sizeof(uint32_t), cudaMemcpyDeviceToHost); - - if(callThrid) { - quark_compactTest_gpu_ADD<<>>(d_partSum[0][thr_id]+blockSize, d_partSum[1][thr_id], blockSize*thr2); - } - quark_compactTest_gpu_ADD<<>>(d_tempBranch1Nonces[thr_id]+blockSize, d_partSum[0][thr_id], threads); - - quark_compactTest_gpu_SCATTER<<>>(d_tempBranch1Nonces[thr_id], d_nonces1, - function, orgThreads, startNounce, inpHashes, d_validNonceTable); - - // Sync - cudaStreamSynchronize(NULL); -} - -#if __CUDA_ARCH__ < 300 -__global__ __launch_bounds__(128, 8) -void quark_filter_gpu_sm2(const uint32_t threads, const uint32_t* d_hash, uint32_t* d_branch2, uint32_t* d_NonceBranch) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const uint32_t offset = thread * 16U; // 64U / sizeof(uint32_t); - uint4 *psrc = (uint4*) (&d_hash[offset]); - d_NonceBranch[thread] = ((uint8_t*)psrc)[0] & 0x8; - if (d_NonceBranch[thread]) return; - // uint4 = 4x uint32_t = 16 bytes - uint4 *pdst = (uint4*) (&d_branch2[offset]); - pdst[0] = psrc[0]; - pdst[1] = psrc[1]; - pdst[2] = psrc[2]; - pdst[3] = psrc[3]; - } -} - -__global__ __launch_bounds__(128, 8) -void quark_merge_gpu_sm2(const uint32_t threads, uint32_t* d_hash, uint32_t* d_branch2, uint32_t* const d_NonceBranch) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads && !d_NonceBranch[thread]) - { - const uint32_t offset = thread * 16U; - uint4 *pdst = (uint4*) (&d_hash[offset]); - uint4 *psrc = (uint4*) (&d_branch2[offset]); - pdst[0] = psrc[0]; - pdst[1] = psrc[1]; - pdst[2] = psrc[2]; - pdst[3] = psrc[3]; - } -} -#else -__global__ void quark_filter_gpu_sm2(const uint32_t threads, const uint32_t* d_hash, uint32_t* d_branch2, uint32_t* d_NonceBranch) {} -__global__ void quark_merge_gpu_sm2(const uint32_t threads, uint32_t* d_hash, uint32_t* d_branch2, uint32_t* const d_NonceBranch) {} -#endif - -__host__ -uint32_t quark_filter_cpu_sm2(const int thr_id, const uint32_t threads, const uint32_t *inpHashes, uint32_t* d_branch2) -{ - const uint32_t threadsperblock = 128; - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - // extract algo permution hashes to a second branch buffer - quark_filter_gpu_sm2 <<>> (threads, inpHashes, d_branch2, d_tempBranch1Nonces[thr_id]); - return threads; -} - -__host__ -void quark_merge_cpu_sm2(const int thr_id, const uint32_t threads, uint32_t *outpHashes, uint32_t* d_branch2) -{ - const uint32_t threadsperblock = 128; - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - // put back second branch hashes to the common buffer d_hash - quark_merge_gpu_sm2 <<>> (threads, outpHashes, d_branch2, d_tempBranch1Nonces[thr_id]); -} - -////// ACHTUNG: Diese funktion geht aktuell nur mit threads > 65536 (Am besten 256 * 1024 oder 256*2048) -__host__ -void quark_compactTest_cpu_dualCompaction(int thr_id, uint32_t threads, uint32_t *nrm, uint32_t *d_nonces1, - uint32_t *d_nonces2, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable) -{ - quark_compactTest_cpu_singleCompaction(thr_id, threads, &nrm[0], d_nonces1, h_QuarkTrueFunction[thr_id], startNounce, inpHashes, d_validNonceTable); - quark_compactTest_cpu_singleCompaction(thr_id, threads, &nrm[1], d_nonces2, h_QuarkFalseFunction[thr_id], startNounce, inpHashes, d_validNonceTable); -} - -__host__ -void quark_compactTest_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *inpHashes, - uint32_t *d_validNonceTable, uint32_t *d_nonces1, uint32_t *nrm1, uint32_t *d_nonces2, uint32_t *nrm2, int order) -{ - // Wenn validNonceTable genutzt wird, dann werden auch nur die Nonces betrachtet, die dort enthalten sind - // "threads" ist in diesem Fall auf die Länge dieses Array's zu setzen! - - quark_compactTest_cpu_dualCompaction(thr_id, threads, - h_numValid[thr_id], d_nonces1, d_nonces2, - startNounce, inpHashes, d_validNonceTable); - - cudaStreamSynchronize(NULL); // Das original braucht zwar etwas CPU-Last, ist an dieser Stelle aber evtl besser - *nrm1 = h_numValid[thr_id][0]; - *nrm2 = h_numValid[thr_id][1]; -} - -__host__ -void quark_compactTest_single_false_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *inpHashes, - uint32_t *d_validNonceTable, uint32_t *d_nonces1, uint32_t *nrm1, int order) -{ - // Wenn validNonceTable genutzt wird, dann werden auch nur die Nonces betrachtet, die dort enthalten sind - // "threads" ist in diesem Fall auf die Länge dieses Array's zu setzen! - - quark_compactTest_cpu_singleCompaction(thr_id, threads, h_numValid[thr_id], d_nonces1, h_QuarkFalseFunction[thr_id], startNounce, inpHashes, d_validNonceTable); - - cudaStreamSynchronize(NULL); - *nrm1 = h_numValid[thr_id][0]; -} \ No newline at end of file diff --git a/quark/cuda_quark_groestl512.cu b/quark/cuda_quark_groestl512.cu deleted file mode 100644 index 91903ace..00000000 --- a/quark/cuda_quark_groestl512.cu +++ /dev/null @@ -1,211 +0,0 @@ -// Auf QuarkCoin spezialisierte Version von Groestl inkl. Bitslice - -#include -#include -#include // off_t - -#include - -#ifdef __INTELLISENSE__ -#define __CUDA_ARCH__ 500 -#endif - -#define TPB 256 -#define THF 4U - -#if __CUDA_ARCH__ >= 300 -#include "groestl_functions_quad.h" -#include "groestl_transf_quad.h" -#endif - -#define WANT_GROESTL80 -#ifdef WANT_GROESTL80 -__constant__ static uint32_t c_Message80[20]; -#endif - -#include "cuda_quark_groestl512_sm2.cuh" - -__global__ __launch_bounds__(TPB, THF) -void quark_groestl512_gpu_hash_64_quad(const uint32_t threads, const uint32_t startNounce, uint32_t * g_hash, uint32_t * __restrict g_nonceVector) -{ -#if __CUDA_ARCH__ >= 300 - - // BEWARE : 4-WAY CODE (one hash need 4 threads) - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x) >> 2; - - if (thread < threads) - { - uint32_t message[8]; - uint32_t state[8]; - - uint32_t nounce = g_nonceVector ? g_nonceVector[thread] : (startNounce + thread); - off_t hashPosition = nounce - startNounce; - uint32_t *pHash = &g_hash[hashPosition << 4]; - - const uint32_t thr = threadIdx.x & 0x3; // % THF - - /*| M0 M1 M2 M3 | M4 M5 M6 M7 | (input) - --|-------------|-------------| - T0| 0 4 8 12 | 80 | - T1| 1 5 13 | | - T2| 2 6 14 | | - T3| 3 7 15 | 01 | - --|-------------|-------------| */ - - #pragma unroll - for(int k=0;k<4;k++) message[k] = pHash[thr + (k * THF)]; - - #pragma unroll - for(int k=4;k<8;k++) message[k] = 0; - - if (thr == 0) message[4] = 0x80U; // end of data tag - if (thr == 3) message[7] = 0x01000000U; - - uint32_t msgBitsliced[8]; - to_bitslice_quad(message, msgBitsliced); - - groestl512_progressMessage_quad(state, msgBitsliced); - - uint32_t hash[16]; - from_bitslice_quad(state, hash); - - // uint4 = 4x4 uint32_t = 16 bytes - if (thr == 0) { - uint4 *phash = (uint4*) hash; - uint4 *outpt = (uint4*) pHash; - outpt[0] = phash[0]; - outpt[1] = phash[1]; - outpt[2] = phash[2]; - outpt[3] = phash[3]; - } - } -#endif -} - -__host__ -void quark_groestl512_cpu_init(int thr_id, uint32_t threads) -{ - int dev_id = device_map[thr_id]; - cuda_get_arch(thr_id); - if (device_sm[dev_id] < 300 || cuda_arch[dev_id] < 300) - quark_groestl512_sm20_init(thr_id, threads); -} - -__host__ -void quark_groestl512_cpu_free(int thr_id) -{ - int dev_id = device_map[thr_id]; - if (device_sm[dev_id] < 300 || cuda_arch[dev_id] < 300) - quark_groestl512_sm20_free(thr_id); -} - -__host__ -void quark_groestl512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order) -{ - uint32_t threadsperblock = TPB; - - // Compute 3.0 benutzt die registeroptimierte Quad Variante mit Warp Shuffle - // mit den Quad Funktionen brauchen wir jetzt 4 threads pro Hash, daher Faktor 4 bei der Blockzahl - const uint32_t factor = THF; - - dim3 grid(factor*((threads + threadsperblock-1)/threadsperblock)); - dim3 block(threadsperblock); - - int dev_id = device_map[thr_id]; - - if (device_sm[dev_id] >= 300 && cuda_arch[dev_id] >= 300) - quark_groestl512_gpu_hash_64_quad<<>>(threads, startNounce, d_hash, d_nonceVector); - else - quark_groestl512_sm20_hash_64(thr_id, threads, startNounce, d_nonceVector, d_hash, order); -} - -// -------------------------------------------------------------------------------------------------------------------------------------------- - -#ifdef WANT_GROESTL80 - -__host__ -void groestl512_setBlock_80(int thr_id, uint32_t *endiandata) -{ - cudaMemcpyToSymbol(c_Message80, endiandata, sizeof(c_Message80), 0, cudaMemcpyHostToDevice); -} - -__global__ __launch_bounds__(TPB, THF) -void groestl512_gpu_hash_80_quad(const uint32_t threads, const uint32_t startNounce, uint32_t * g_outhash) -{ -#if __CUDA_ARCH__ >= 300 - // BEWARE : 4-WAY CODE (one hash need 4 threads) - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x) >> 2; - if (thread < threads) - { - const uint32_t thr = threadIdx.x & 0x3; // % THF - - /*| M0 M1 M2 M3 M4 | M5 M6 M7 | (input) - --|----------------|----------| - T0| 0 4 8 12 16 | 80 | - T1| 1 5 17 | | - T2| 2 6 18 | | - T3| 3 7 Nc | 01 | - --|----------------|----------| TPR */ - - uint32_t message[8]; - - #pragma unroll 5 - for(int k=0; k<5; k++) message[k] = c_Message80[thr + (k * THF)]; - - #pragma unroll 3 - for(int k=5; k<8; k++) message[k] = 0; - - if (thr == 0) message[5] = 0x80U; - if (thr == 3) { - message[4] = cuda_swab32(startNounce + thread); - message[7] = 0x01000000U; - } - - uint32_t msgBitsliced[8]; - to_bitslice_quad(message, msgBitsliced); - - uint32_t state[8]; - groestl512_progressMessage_quad(state, msgBitsliced); - - uint32_t hash[16]; - from_bitslice_quad(state, hash); - - if (thr == 0) { /* 4 threads were done */ - const off_t hashPosition = thread; - //if (!thread) hash[15] = 0xFFFFFFFF; - uint4 *outpt = (uint4*) &g_outhash[hashPosition << 4]; - uint4 *phash = (uint4*) hash; - outpt[0] = phash[0]; - outpt[1] = phash[1]; - outpt[2] = phash[2]; - outpt[3] = phash[3]; - } - } -#endif -} - -__host__ -void groestl512_cuda_hash_80(const int thr_id, const uint32_t threads, const uint32_t startNounce, uint32_t *d_hash) -{ - int dev_id = device_map[thr_id]; - - if (device_sm[dev_id] >= 300 && cuda_arch[dev_id] >= 300) { - const uint32_t threadsperblock = TPB; - const uint32_t factor = THF; - - dim3 grid(factor*((threads + threadsperblock-1)/threadsperblock)); - dim3 block(threadsperblock); - - groestl512_gpu_hash_80_quad <<>> (threads, startNounce, d_hash); - - } else { - - const uint32_t threadsperblock = 256; - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - groestl512_gpu_hash_80_sm2 <<>> (threads, startNounce, d_hash); - } -} - -#endif diff --git a/quark/cuda_quark_groestl512_sm2.cuh b/quark/cuda_quark_groestl512_sm2.cuh deleted file mode 100644 index c07340d8..00000000 --- a/quark/cuda_quark_groestl512_sm2.cuh +++ /dev/null @@ -1,359 +0,0 @@ -// SM 2.x variant (tpruvot) - -#ifdef __INTELLISENSE__ -//#define __CUDA_ARCH__ 210 -#define __CUDACC__ -#include -#include -#define __byte_perm(a,b,c) (a) -#define tex1Dfetch(t, n) (n) -#endif - -#define USE_SHARED 1 - -static unsigned int *d_textures[MAX_GPUS][8]; - -#define PC32up(j, r) ((uint32_t)((j) + (r))) -#define PC32dn(j, r) 0 -#define QC32up(j, r) 0xFFFFFFFF -#define QC32dn(j, r) (((uint32_t)(r) << 24) ^ SPH_T32(~((uint32_t)(j) << 24))) - -#define B32_0(x) __byte_perm(x, 0, 0x4440) -//((x) & 0xFF) -#define B32_1(x) __byte_perm(x, 0, 0x4441) -//(((x) >> 8) & 0xFF) -#define B32_2(x) __byte_perm(x, 0, 0x4442) -//(((x) >> 16) & 0xFF) -#define B32_3(x) __byte_perm(x, 0, 0x4443) -//((x) >> 24) - -#define T0up(x) (*((uint32_t*)mixtabs + ( (x)))) -#define T0dn(x) (*((uint32_t*)mixtabs + ( 256+(x)))) -#define T1up(x) (*((uint32_t*)mixtabs + ( 512+(x)))) -#define T1dn(x) (*((uint32_t*)mixtabs + ( 768+(x)))) -#define T2up(x) (*((uint32_t*)mixtabs + (1024+(x)))) -#define T2dn(x) (*((uint32_t*)mixtabs + (1280+(x)))) -#define T3up(x) (*((uint32_t*)mixtabs + (1536+(x)))) -#define T3dn(x) (*((uint32_t*)mixtabs + (1792+(x)))) - -texture t0up1; -texture t0dn1; -texture t1up1; -texture t1dn1; -texture t2up1; -texture t2dn1; -texture t3up1; -texture t3dn1; - -extern uint32_t T0up_cpu[]; -extern uint32_t T0dn_cpu[]; -extern uint32_t T1up_cpu[]; -extern uint32_t T1dn_cpu[]; -extern uint32_t T2up_cpu[]; -extern uint32_t T2dn_cpu[]; -extern uint32_t T3up_cpu[]; -extern uint32_t T3dn_cpu[]; - -#if __CUDA_ARCH__ < 300 || defined(_DEBUG) - -#if (!USE_SHARED) -#include "groestl_simple.cuh" -#endif - -__device__ __forceinline__ -void quark_groestl512_perm_P(uint32_t *a, char *mixtabs) -{ - #pragma unroll 1 - for(int r=0; r<14; r++) - { - uint32_t t[32]; - - #pragma unroll 16 - for (int k=0; k<16; k++) - a[(k*2)+0] ^= PC32up(k<< 4, r); - - #pragma unroll 16 - for(int k=0;k<32;k+=2) { - uint32_t t0_0 = B32_0(a[(k ) & 0x1f]), t9_0 = B32_0(a[(k + 9) & 0x1f]); - uint32_t t2_1 = B32_1(a[(k + 2) & 0x1f]), t11_1 = B32_1(a[(k + 11) & 0x1f]); - uint32_t t4_2 = B32_2(a[(k + 4) & 0x1f]), t13_2 = B32_2(a[(k + 13) & 0x1f]); - uint32_t t6_3 = B32_3(a[(k + 6) & 0x1f]), t23_3 = B32_3(a[(k + 23) & 0x1f]); - - t[k + 0] = T0up( t0_0 ) ^ T1up( t2_1 ) ^ T2up( t4_2 ) ^ T3up( t6_3 ) ^ - T0dn( t9_0 ) ^ T1dn( t11_1 ) ^ T2dn( t13_2 ) ^ T3dn( t23_3 ); - - t[k + 1] = T0dn( t0_0 ) ^ T1dn( t2_1 ) ^ T2dn( t4_2 ) ^ T3dn( t6_3 ) ^ - T0up( t9_0 ) ^ T1up( t11_1 ) ^ T2up( t13_2 ) ^ T3up( t23_3 ); - } - - #pragma unroll 32 - for(int k=0; k<32; k++) - a[k] = t[k]; - } -} - -__device__ __forceinline__ -void quark_groestl512_perm_Q(uint32_t *a, char *mixtabs) -{ - #pragma unroll 1 - for(int r=0; r<14; r++) - { - uint32_t t[32]; - - #pragma unroll 16 - for (int k=0; k<16; k++) { - a[(k*2)+0] ^= QC32up(k << 4, r); - a[(k*2)+1] ^= QC32dn(k << 4, r); - } - - #pragma unroll 16 - for(int k=0;k<32;k+=2) - { - uint32_t t2_0 = B32_0(a[(k + 2) & 0x1f]), t1_0 = B32_0(a[(k + 1) & 0x1f]); - uint32_t t6_1 = B32_1(a[(k + 6) & 0x1f]), t5_1 = B32_1(a[(k + 5) & 0x1f]); - uint32_t t10_2 = B32_2(a[(k + 10) & 0x1f]), t9_2 = B32_2(a[(k + 9) & 0x1f]); - uint32_t t22_3 = B32_3(a[(k + 22) & 0x1f]), t13_3 = B32_3(a[(k + 13) & 0x1f]); - - t[k + 0] = T0up( t2_0 ) ^ T1up( t6_1 ) ^ T2up( t10_2 ) ^ T3up( t22_3 ) ^ - T0dn( t1_0 ) ^ T1dn( t5_1 ) ^ T2dn( t9_2 ) ^ T3dn( t13_3 ); - - t[k + 1] = T0dn( t2_0 ) ^ T1dn( t6_1 ) ^ T2dn( t10_2 ) ^ T3dn( t22_3 ) ^ - T0up( t1_0 ) ^ T1up( t5_1 ) ^ T2up( t9_2 ) ^ T3up( t13_3 ); - } - #pragma unroll 32 - for(int k=0; k<32; k++) - a[k] = t[k]; - } -} - -#endif - -__global__ -void quark_groestl512_gpu_hash_64(uint32_t threads, uint32_t startNounce, uint32_t *g_hash, uint32_t *g_nonceVector) -{ -#if __CUDA_ARCH__ < 300 || defined(_DEBUG) - -#if USE_SHARED - __shared__ char mixtabs[8 * 1024]; - if (threadIdx.x < 256) { - *((uint32_t*)mixtabs + ( threadIdx.x)) = tex1Dfetch(t0up1, threadIdx.x); - *((uint32_t*)mixtabs + ( 256+threadIdx.x)) = tex1Dfetch(t0dn1, threadIdx.x); - *((uint32_t*)mixtabs + ( 512+threadIdx.x)) = tex1Dfetch(t1up1, threadIdx.x); - *((uint32_t*)mixtabs + ( 768+threadIdx.x)) = tex1Dfetch(t1dn1, threadIdx.x); - *((uint32_t*)mixtabs + (1024+threadIdx.x)) = tex1Dfetch(t2up1, threadIdx.x); - *((uint32_t*)mixtabs + (1280+threadIdx.x)) = tex1Dfetch(t2dn1, threadIdx.x); - *((uint32_t*)mixtabs + (1536+threadIdx.x)) = tex1Dfetch(t3up1, threadIdx.x); - *((uint32_t*)mixtabs + (1792+threadIdx.x)) = tex1Dfetch(t3dn1, threadIdx.x); - } - __syncthreads(); -#endif - - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - // GROESTL - uint32_t message[32]; - uint32_t state[32]; - - uint32_t nounce = (g_nonceVector != NULL) ? g_nonceVector[thread] : (startNounce + thread); - - off_t hashPosition = nounce - startNounce; - uint32_t *pHash = &g_hash[hashPosition * 16]; - - #pragma unroll 4 - for (int i=0; i<16; i += 4) - AS_UINT4(&message[i]) = AS_UINT4(&pHash[i]); - - message[16] = 0x80U; - #pragma unroll 14 - for(int i=17; i<31; i++) message[i] = 0; - message[31] = 0x01000000U; - - #pragma unroll 32 - for(int i=0; i<32; i++) state[i] = message[i]; - state[31] ^= 0x20000U; - - // Perm -#if USE_SHARED - quark_groestl512_perm_P(state, mixtabs); - state[31] ^= 0x20000U; - quark_groestl512_perm_Q(message, mixtabs); - #pragma unroll 32 - for(int i=0; i<32; i++) state[i] ^= message[i]; - #pragma unroll 16 - for(int i=16; i<32; i++) message[i] = state[i]; - quark_groestl512_perm_P(state, mixtabs); -#else - tex_groestl512_perm_P(state); - state[31] ^= 0x20000U; - tex_groestl512_perm_Q(message); - #pragma unroll 32 - for(int i=0; i<32; i++) state[i] ^= message[i]; - #pragma unroll 16 - for(int i=16; i<32; i++) message[i] = state[i]; - tex_groestl512_perm_P(state); -#endif - - #pragma unroll 16 - for(int i=16; i<32; i++) state[i] ^= message[i]; - - uint4 *outpt = (uint4*)(pHash); - uint4 *phash = (uint4*)(&state[16]); - outpt[0] = phash[0]; - outpt[1] = phash[1]; - outpt[2] = phash[2]; - outpt[3] = phash[3]; - } -#endif -} - -#define texDef(id, texname, texmem, texsource, texsize) { \ - unsigned int *texmem; \ - cudaMalloc(&texmem, texsize); \ - d_textures[thr_id][id] = texmem; \ - cudaMemcpy(texmem, texsource, texsize, cudaMemcpyHostToDevice); \ - texname.normalized = 0; \ - texname.filterMode = cudaFilterModePoint; \ - texname.addressMode[0] = cudaAddressModeClamp; \ - { cudaChannelFormatDesc channelDesc = cudaCreateChannelDesc(); \ - cudaBindTexture(NULL, &texname, texmem, &channelDesc, texsize ); \ - } \ -} - -__host__ -void quark_groestl512_sm20_init(int thr_id, uint32_t threads) -{ - // Texturen mit obigem Makro initialisieren - texDef(0, t0up1, d_T0up, T0up_cpu, sizeof(uint32_t)*256); - texDef(1, t0dn1, d_T0dn, T0dn_cpu, sizeof(uint32_t)*256); - texDef(2, t1up1, d_T1up, T1up_cpu, sizeof(uint32_t)*256); - texDef(3, t1dn1, d_T1dn, T1dn_cpu, sizeof(uint32_t)*256); - texDef(4, t2up1, d_T2up, T2up_cpu, sizeof(uint32_t)*256); - texDef(5, t2dn1, d_T2dn, T2dn_cpu, sizeof(uint32_t)*256); - texDef(6, t3up1, d_T3up, T3up_cpu, sizeof(uint32_t)*256); - texDef(7, t3dn1, d_T3dn, T3dn_cpu, sizeof(uint32_t)*256); -} - -__host__ -void quark_groestl512_sm20_free(int thr_id) -{ - if (!d_textures[thr_id][0]) return; - for (int i=0; i<8; i++) - cudaFree(d_textures[thr_id][i]); - d_textures[thr_id][0] = NULL; -} - -__host__ -void quark_groestl512_sm20_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order) -{ - int threadsperblock = 512; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - quark_groestl512_gpu_hash_64<<>>(threads, startNounce, d_hash, d_nonceVector); -} - -__host__ -void quark_doublegroestl512_sm20_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order) -{ - int threadsperblock = 512; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - quark_groestl512_gpu_hash_64<<>>(threads, startNounce, d_hash, d_nonceVector); - quark_groestl512_gpu_hash_64<<>>(threads, startNounce, d_hash, d_nonceVector); -} - -// -------------------------------------------------------------------------------------------------------------------------------------------- - -#ifdef WANT_GROESTL80 - -// defined in groest512.cu -// __constant__ static uint32_t c_Message80[20]; - -__global__ -//__launch_bounds__(256) -void groestl512_gpu_hash_80_sm2(const uint32_t threads, const uint32_t startNounce, uint32_t * g_outhash) -{ -#if __CUDA_ARCH__ < 300 || defined(_DEBUG) - -#if USE_SHARED - __shared__ char mixtabs[8 * 1024]; - if (threadIdx.x < 256) { - *((uint32_t*)mixtabs + ( threadIdx.x)) = tex1Dfetch(t0up1, threadIdx.x); - *((uint32_t*)mixtabs + ( 256+threadIdx.x)) = tex1Dfetch(t0dn1, threadIdx.x); - *((uint32_t*)mixtabs + ( 512+threadIdx.x)) = tex1Dfetch(t1up1, threadIdx.x); - *((uint32_t*)mixtabs + ( 768+threadIdx.x)) = tex1Dfetch(t1dn1, threadIdx.x); - *((uint32_t*)mixtabs + (1024+threadIdx.x)) = tex1Dfetch(t2up1, threadIdx.x); - *((uint32_t*)mixtabs + (1280+threadIdx.x)) = tex1Dfetch(t2dn1, threadIdx.x); - *((uint32_t*)mixtabs + (1536+threadIdx.x)) = tex1Dfetch(t3up1, threadIdx.x); - *((uint32_t*)mixtabs + (1792+threadIdx.x)) = tex1Dfetch(t3dn1, threadIdx.x); - } - __syncthreads(); -#endif - - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t message[32]; - - #pragma unroll 5 - for (int i=0; i < 20; i += 4) - AS_UINT4(&message[i]) = AS_UINT4(&c_Message80[i]); - - message[19] = cuda_swab32(startNounce + thread); - message[20] = 0x80U; // end tag - - #pragma unroll - for(int i=21; i<31; i++) message[i] = 0U; - message[31] = 0x01000000U; // end block - - uint32_t state[32]; - #pragma unroll - for(int i=0; i<32; i++) state[i] = message[i]; - state[31] ^= 0x00020000U; // "...00000201" - -#if USE_SHARED - quark_groestl512_perm_P(state, mixtabs); - quark_groestl512_perm_Q(message, mixtabs); - - state[31] ^= 0x00020000U; - #pragma unroll 32 - for(int i=0; i<32; i++) state[i] ^= message[i]; - - #pragma unroll 16 - for(int i=16; i<32; i++) message[i] = state[i]; - - quark_groestl512_perm_P(state, mixtabs); -#else - tex_groestl512_perm_P(state); - tex_groestl512_perm_Q(message); - - state[31] ^= 0x00020000U; - #pragma unroll 32 - for(int i=0; i<32; i++) state[i] ^= message[i]; - - #pragma unroll 16 - for(int i=16; i<32; i++) message[i] = state[i]; - - tex_groestl512_perm_P(state); -#endif - #pragma unroll 16 - for(int i=16; i<32; i++) state[i] ^= message[i]; - - // uint4 = 4 x uint32_t = 16 bytes, x 4 => 64 bytes - const off_t hashPosition = thread; - - uint4 *outpt = (uint4*) (&g_outhash[hashPosition << 4]); - uint4 *phash = (uint4*) (&state[16]); - outpt[0] = phash[0]; - outpt[1] = phash[1]; - outpt[2] = phash[2]; - outpt[3] = phash[3]; - } -#endif -} - -#endif // WANT_GROESTL80 diff --git a/quark/cuda_quark_keccak512.cu b/quark/cuda_quark_keccak512.cu deleted file mode 100644 index a80e22d0..00000000 --- a/quark/cuda_quark_keccak512.cu +++ /dev/null @@ -1,277 +0,0 @@ -#include -#include -#include // off_t - -#include "cuda_helper.h" - -#define U32TO64_LE(p) \ - (((uint64_t)(*p)) | (((uint64_t)(*(p + 1))) << 32)) - -#define U64TO32_LE(p, v) \ - *p = (uint32_t)((v)); *(p+1) = (uint32_t)((v) >> 32); - -static const uint64_t host_keccak_round_constants[24] = { - 0x0000000000000001ull, 0x0000000000008082ull, - 0x800000000000808aull, 0x8000000080008000ull, - 0x000000000000808bull, 0x0000000080000001ull, - 0x8000000080008081ull, 0x8000000000008009ull, - 0x000000000000008aull, 0x0000000000000088ull, - 0x0000000080008009ull, 0x000000008000000aull, - 0x000000008000808bull, 0x800000000000008bull, - 0x8000000000008089ull, 0x8000000000008003ull, - 0x8000000000008002ull, 0x8000000000000080ull, - 0x000000000000800aull, 0x800000008000000aull, - 0x8000000080008081ull, 0x8000000000008080ull, - 0x0000000080000001ull, 0x8000000080008008ull -}; - -__constant__ uint64_t d_keccak_round_constants[24]; - -__device__ __forceinline__ -static void keccak_block(uint2 *s) -{ - size_t i; - uint2 t[5], u[5], v, w; - - for (i = 0; i < 24; i++) { - /* theta: c = a[0,i] ^ a[1,i] ^ .. a[4,i] */ - t[0] = s[0] ^ s[5] ^ s[10] ^ s[15] ^ s[20]; - t[1] = s[1] ^ s[6] ^ s[11] ^ s[16] ^ s[21]; - t[2] = s[2] ^ s[7] ^ s[12] ^ s[17] ^ s[22]; - t[3] = s[3] ^ s[8] ^ s[13] ^ s[18] ^ s[23]; - t[4] = s[4] ^ s[9] ^ s[14] ^ s[19] ^ s[24]; - - /* theta: d[i] = c[i+4] ^ rotl(c[i+1],1) */ - u[0] = t[4] ^ ROL2(t[1], 1); - u[1] = t[0] ^ ROL2(t[2], 1); - u[2] = t[1] ^ ROL2(t[3], 1); - u[3] = t[2] ^ ROL2(t[4], 1); - u[4] = t[3] ^ ROL2(t[0], 1); - - /* theta: a[0,i], a[1,i], .. a[4,i] ^= d[i] */ - s[0] ^= u[0]; s[5] ^= u[0]; s[10] ^= u[0]; s[15] ^= u[0]; s[20] ^= u[0]; - s[1] ^= u[1]; s[6] ^= u[1]; s[11] ^= u[1]; s[16] ^= u[1]; s[21] ^= u[1]; - s[2] ^= u[2]; s[7] ^= u[2]; s[12] ^= u[2]; s[17] ^= u[2]; s[22] ^= u[2]; - s[3] ^= u[3]; s[8] ^= u[3]; s[13] ^= u[3]; s[18] ^= u[3]; s[23] ^= u[3]; - s[4] ^= u[4]; s[9] ^= u[4]; s[14] ^= u[4]; s[19] ^= u[4]; s[24] ^= u[4]; - - /* rho pi: b[..] = rotl(a[..], ..) */ - v = s[1]; - s[1] = ROL2(s[6], 44); - s[6] = ROL2(s[9], 20); - s[9] = ROL2(s[22], 61); - s[22] = ROL2(s[14], 39); - s[14] = ROL2(s[20], 18); - s[20] = ROL2(s[2], 62); - s[2] = ROL2(s[12], 43); - s[12] = ROL2(s[13], 25); - s[13] = ROL2(s[19], 8); - s[19] = ROL2(s[23], 56); - s[23] = ROL2(s[15], 41); - s[15] = ROL2(s[4], 27); - s[4] = ROL2(s[24], 14); - s[24] = ROL2(s[21], 2); - s[21] = ROL2(s[8], 55); - s[8] = ROL2(s[16], 45); - s[16] = ROL2(s[5], 36); - s[5] = ROL2(s[3], 28); - s[3] = ROL2(s[18], 21); - s[18] = ROL2(s[17], 15); - s[17] = ROL2(s[11], 10); - s[11] = ROL2(s[7], 6); - s[7] = ROL2(s[10], 3); - s[10] = ROL2(v, 1); - - /* chi: a[i,j] ^= ~b[i,j+1] & b[i,j+2] */ - v = s[0]; w = s[1]; s[0] ^= (~w) & s[2]; s[1] ^= (~s[2]) & s[3]; s[2] ^= (~s[3]) & s[4]; s[3] ^= (~s[4]) & v; s[4] ^= (~v) & w; - v = s[5]; w = s[6]; s[5] ^= (~w) & s[7]; s[6] ^= (~s[7]) & s[8]; s[7] ^= (~s[8]) & s[9]; s[8] ^= (~s[9]) & v; s[9] ^= (~v) & w; - v = s[10]; w = s[11]; s[10] ^= (~w) & s[12]; s[11] ^= (~s[12]) & s[13]; s[12] ^= (~s[13]) & s[14]; s[13] ^= (~s[14]) & v; s[14] ^= (~v) & w; - v = s[15]; w = s[16]; s[15] ^= (~w) & s[17]; s[16] ^= (~s[17]) & s[18]; s[17] ^= (~s[18]) & s[19]; s[18] ^= (~s[19]) & v; s[19] ^= (~v) & w; - v = s[20]; w = s[21]; s[20] ^= (~w) & s[22]; s[21] ^= (~s[22]) & s[23]; s[22] ^= (~s[23]) & s[24]; s[23] ^= (~s[24]) & v; s[24] ^= (~v) & w; - - /* iota: a[0,0] ^= round constant */ - s[0] ^= vectorize(d_keccak_round_constants[i]); - } -} - -__global__ -void quark_keccak512_gpu_hash_64(uint32_t threads, uint32_t startNounce, uint64_t *g_hash, uint32_t *g_nonceVector) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t nounce = (g_nonceVector != NULL) ? g_nonceVector[thread] : (startNounce + thread); - - off_t hashPosition = nounce - startNounce; - uint64_t *inpHash = &g_hash[hashPosition * 8]; - uint2 keccak_gpu_state[25]; - - for (int i = 0; i<8; i++) { - keccak_gpu_state[i] = vectorize(inpHash[i]); - } - keccak_gpu_state[8] = vectorize(0x8000000000000001ULL); - - for (int i=9; i<25; i++) { - keccak_gpu_state[i] = make_uint2(0, 0); - } - keccak_block(keccak_gpu_state); - - for(int i=0; i<8; i++) { - inpHash[i] = devectorize(keccak_gpu_state[i]); - } - } -} - -__device__ __forceinline__ -static void keccak_block_v30(uint64_t *s, const uint32_t *in) -{ - size_t i; - uint64_t t[5], u[5], v, w; - - #pragma unroll 9 - for (i = 0; i < 72 / 8; i++, in += 2) - s[i] ^= U32TO64_LE(in); - - for (i = 0; i < 24; i++) { - /* theta: c = a[0,i] ^ a[1,i] ^ .. a[4,i] */ - t[0] = s[0] ^ s[5] ^ s[10] ^ s[15] ^ s[20]; - t[1] = s[1] ^ s[6] ^ s[11] ^ s[16] ^ s[21]; - t[2] = s[2] ^ s[7] ^ s[12] ^ s[17] ^ s[22]; - t[3] = s[3] ^ s[8] ^ s[13] ^ s[18] ^ s[23]; - t[4] = s[4] ^ s[9] ^ s[14] ^ s[19] ^ s[24]; - - /* theta: d[i] = c[i+4] ^ rotl(c[i+1],1) */ - u[0] = t[4] ^ ROTL64(t[1], 1); - u[1] = t[0] ^ ROTL64(t[2], 1); - u[2] = t[1] ^ ROTL64(t[3], 1); - u[3] = t[2] ^ ROTL64(t[4], 1); - u[4] = t[3] ^ ROTL64(t[0], 1); - - /* theta: a[0,i], a[1,i], .. a[4,i] ^= d[i] */ - s[0] ^= u[0]; s[5] ^= u[0]; s[10] ^= u[0]; s[15] ^= u[0]; s[20] ^= u[0]; - s[1] ^= u[1]; s[6] ^= u[1]; s[11] ^= u[1]; s[16] ^= u[1]; s[21] ^= u[1]; - s[2] ^= u[2]; s[7] ^= u[2]; s[12] ^= u[2]; s[17] ^= u[2]; s[22] ^= u[2]; - s[3] ^= u[3]; s[8] ^= u[3]; s[13] ^= u[3]; s[18] ^= u[3]; s[23] ^= u[3]; - s[4] ^= u[4]; s[9] ^= u[4]; s[14] ^= u[4]; s[19] ^= u[4]; s[24] ^= u[4]; - - /* rho pi: b[..] = rotl(a[..], ..) */ - v = s[ 1]; - s[ 1] = ROTL64(s[ 6], 44); - s[ 6] = ROTL64(s[ 9], 20); - s[ 9] = ROTL64(s[22], 61); - s[22] = ROTL64(s[14], 39); - s[14] = ROTL64(s[20], 18); - s[20] = ROTL64(s[ 2], 62); - s[ 2] = ROTL64(s[12], 43); - s[12] = ROTL64(s[13], 25); - s[13] = ROTL64(s[19], 8); - s[19] = ROTL64(s[23], 56); - s[23] = ROTL64(s[15], 41); - s[15] = ROTL64(s[ 4], 27); - s[ 4] = ROTL64(s[24], 14); - s[24] = ROTL64(s[21], 2); - s[21] = ROTL64(s[ 8], 55); - s[ 8] = ROTL64(s[16], 45); - s[16] = ROTL64(s[ 5], 36); - s[ 5] = ROTL64(s[ 3], 28); - s[ 3] = ROTL64(s[18], 21); - s[18] = ROTL64(s[17], 15); - s[17] = ROTL64(s[11], 10); - s[11] = ROTL64(s[ 7], 6); - s[ 7] = ROTL64(s[10], 3); - s[10] = ROTL64( v, 1); - - /* chi: a[i,j] ^= ~b[i,j+1] & b[i,j+2] */ - v = s[ 0]; w = s[ 1]; s[ 0] ^= (~w) & s[ 2]; s[ 1] ^= (~s[ 2]) & s[ 3]; s[ 2] ^= (~s[ 3]) & s[ 4]; s[ 3] ^= (~s[ 4]) & v; s[ 4] ^= (~v) & w; - v = s[ 5]; w = s[ 6]; s[ 5] ^= (~w) & s[ 7]; s[ 6] ^= (~s[ 7]) & s[ 8]; s[ 7] ^= (~s[ 8]) & s[ 9]; s[ 8] ^= (~s[ 9]) & v; s[ 9] ^= (~v) & w; - v = s[10]; w = s[11]; s[10] ^= (~w) & s[12]; s[11] ^= (~s[12]) & s[13]; s[12] ^= (~s[13]) & s[14]; s[13] ^= (~s[14]) & v; s[14] ^= (~v) & w; - v = s[15]; w = s[16]; s[15] ^= (~w) & s[17]; s[16] ^= (~s[17]) & s[18]; s[17] ^= (~s[18]) & s[19]; s[18] ^= (~s[19]) & v; s[19] ^= (~v) & w; - v = s[20]; w = s[21]; s[20] ^= (~w) & s[22]; s[21] ^= (~s[22]) & s[23]; s[22] ^= (~s[23]) & s[24]; s[23] ^= (~s[24]) & v; s[24] ^= (~v) & w; - - /* iota: a[0,0] ^= round constant */ - s[0] ^= d_keccak_round_constants[i]; - } -} - -__global__ -void quark_keccak512_gpu_hash_64_v30(uint32_t threads, uint32_t startNounce, uint64_t *g_hash, uint32_t *g_nonceVector) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t nounce = (g_nonceVector != NULL) ? g_nonceVector[thread] : (startNounce + thread); - - off_t hashPosition = nounce - startNounce; - uint32_t *inpHash = (uint32_t*)&g_hash[hashPosition * 8]; - - uint32_t message[18]; - #pragma unroll 16 - for(int i=0;i<16;i++) - message[i] = inpHash[i]; - - message[16] = 0x01; - message[17] = 0x80000000; - - uint64_t keccak_gpu_state[25]; - #pragma unroll 25 - for (int i=0; i<25; i++) - keccak_gpu_state[i] = 0; - - keccak_block_v30(keccak_gpu_state, message); - - uint32_t hash[16]; - #pragma unroll 8 - for (size_t i = 0; i < 64; i += 8) { - U64TO32_LE((&hash[i/4]), keccak_gpu_state[i / 8]); - } - - uint32_t *outpHash = (uint32_t*)&g_hash[hashPosition * 8]; - #pragma unroll 16 - for(int i=0; i<16; i++) - outpHash[i] = hash[i]; - } -} - -__host__ -void quark_keccak512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order) -{ - const uint32_t threadsperblock = 256; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - int dev_id = device_map[thr_id]; - - if (device_sm[dev_id] >= 320) - quark_keccak512_gpu_hash_64<<>>(threads, startNounce, (uint64_t*)d_hash, d_nonceVector); - else - quark_keccak512_gpu_hash_64_v30<<>>(threads, startNounce, (uint64_t*)d_hash, d_nonceVector); - - //MyStreamSynchronize(NULL, order, thr_id); -} - -void jackpot_keccak512_cpu_init(int thr_id, uint32_t threads); -void jackpot_keccak512_cpu_setBlock(void *pdata, size_t inlen); -void jackpot_keccak512_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, int order); - -__host__ -void quark_keccak512_cpu_init(int thr_id, uint32_t threads) -{ - // required for the 64 bytes one - cudaMemcpyToSymbol(d_keccak_round_constants, host_keccak_round_constants, - sizeof(host_keccak_round_constants), 0, cudaMemcpyHostToDevice); - - jackpot_keccak512_cpu_init(thr_id, threads); -} - -__host__ -void keccak512_setBlock_80(int thr_id, uint32_t *endiandata) -{ - jackpot_keccak512_cpu_setBlock((void*)endiandata, 80); -} - -__host__ -void keccak512_cuda_hash_80(const int thr_id, const uint32_t threads, const uint32_t startNounce, uint32_t *d_hash) -{ - jackpot_keccak512_cpu_hash(thr_id, threads, startNounce, d_hash, 0); -} diff --git a/quark/cuda_skein512.cu b/quark/cuda_skein512.cu deleted file mode 100644 index 7c4d99ab..00000000 --- a/quark/cuda_skein512.cu +++ /dev/null @@ -1,1103 +0,0 @@ -/* SKEIN 64 and 80 based on Alexis Provos version */ - -#define TPB52 512 -#define TPB50 256 - -#include -#include -#include - -/* ************************ */ - -/* - * M9_ ## s ## _ ## i evaluates to s+i mod 9 (0 <= s <= 18, 0 <= i <= 7). - */ - -#define M9_0_0 0 -#define M9_0_1 1 -#define M9_0_2 2 -#define M9_0_3 3 -#define M9_0_4 4 -#define M9_0_5 5 -#define M9_0_6 6 -#define M9_0_7 7 - -#define M9_1_0 1 -#define M9_1_1 2 -#define M9_1_2 3 -#define M9_1_3 4 -#define M9_1_4 5 -#define M9_1_5 6 -#define M9_1_6 7 -#define M9_1_7 8 - -#define M9_2_0 2 -#define M9_2_1 3 -#define M9_2_2 4 -#define M9_2_3 5 -#define M9_2_4 6 -#define M9_2_5 7 -#define M9_2_6 8 -#define M9_2_7 0 - -#define M9_3_0 3 -#define M9_3_1 4 -#define M9_3_2 5 -#define M9_3_3 6 -#define M9_3_4 7 -#define M9_3_5 8 -#define M9_3_6 0 -#define M9_3_7 1 - -#define M9_4_0 4 -#define M9_4_1 5 -#define M9_4_2 6 -#define M9_4_3 7 -#define M9_4_4 8 -#define M9_4_5 0 -#define M9_4_6 1 -#define M9_4_7 2 - -#define M9_5_0 5 -#define M9_5_1 6 -#define M9_5_2 7 -#define M9_5_3 8 -#define M9_5_4 0 -#define M9_5_5 1 -#define M9_5_6 2 -#define M9_5_7 3 - -#define M9_6_0 6 -#define M9_6_1 7 -#define M9_6_2 8 -#define M9_6_3 0 -#define M9_6_4 1 -#define M9_6_5 2 -#define M9_6_6 3 -#define M9_6_7 4 - -#define M9_7_0 7 -#define M9_7_1 8 -#define M9_7_2 0 -#define M9_7_3 1 -#define M9_7_4 2 -#define M9_7_5 3 -#define M9_7_6 4 -#define M9_7_7 5 - -#define M9_8_0 8 -#define M9_8_1 0 -#define M9_8_2 1 -#define M9_8_3 2 -#define M9_8_4 3 -#define M9_8_5 4 -#define M9_8_6 5 -#define M9_8_7 6 - -#define M9_9_0 0 -#define M9_9_1 1 -#define M9_9_2 2 -#define M9_9_3 3 -#define M9_9_4 4 -#define M9_9_5 5 -#define M9_9_6 6 -#define M9_9_7 7 - -#define M9_10_0 1 -#define M9_10_1 2 -#define M9_10_2 3 -#define M9_10_3 4 -#define M9_10_4 5 -#define M9_10_5 6 -#define M9_10_6 7 -#define M9_10_7 8 - -#define M9_11_0 2 -#define M9_11_1 3 -#define M9_11_2 4 -#define M9_11_3 5 -#define M9_11_4 6 -#define M9_11_5 7 -#define M9_11_6 8 -#define M9_11_7 0 - -#define M9_12_0 3 -#define M9_12_1 4 -#define M9_12_2 5 -#define M9_12_3 6 -#define M9_12_4 7 -#define M9_12_5 8 -#define M9_12_6 0 -#define M9_12_7 1 - -#define M9_13_0 4 -#define M9_13_1 5 -#define M9_13_2 6 -#define M9_13_3 7 -#define M9_13_4 8 -#define M9_13_5 0 -#define M9_13_6 1 -#define M9_13_7 2 - -#define M9_14_0 5 -#define M9_14_1 6 -#define M9_14_2 7 -#define M9_14_3 8 -#define M9_14_4 0 -#define M9_14_5 1 -#define M9_14_6 2 -#define M9_14_7 3 - -#define M9_15_0 6 -#define M9_15_1 7 -#define M9_15_2 8 -#define M9_15_3 0 -#define M9_15_4 1 -#define M9_15_5 2 -#define M9_15_6 3 -#define M9_15_7 4 - -#define M9_16_0 7 -#define M9_16_1 8 -#define M9_16_2 0 -#define M9_16_3 1 -#define M9_16_4 2 -#define M9_16_5 3 -#define M9_16_6 4 -#define M9_16_7 5 - -#define M9_17_0 8 -#define M9_17_1 0 -#define M9_17_2 1 -#define M9_17_3 2 -#define M9_17_4 3 -#define M9_17_5 4 -#define M9_17_6 5 -#define M9_17_7 6 - -#define M9_18_0 0 -#define M9_18_1 1 -#define M9_18_2 2 -#define M9_18_3 3 -#define M9_18_4 4 -#define M9_18_5 5 -#define M9_18_6 6 -#define M9_18_7 7 - -/* - * M3_ ## s ## _ ## i evaluates to s+i mod 3 (0 <= s <= 18, 0 <= i <= 1). - */ - -#define M3_0_0 0 -#define M3_0_1 1 -#define M3_1_0 1 -#define M3_1_1 2 -#define M3_2_0 2 -#define M3_2_1 0 -#define M3_3_0 0 -#define M3_3_1 1 -#define M3_4_0 1 -#define M3_4_1 2 -#define M3_5_0 2 -#define M3_5_1 0 -#define M3_6_0 0 -#define M3_6_1 1 -#define M3_7_0 1 -#define M3_7_1 2 -#define M3_8_0 2 -#define M3_8_1 0 -#define M3_9_0 0 -#define M3_9_1 1 -#define M3_10_0 1 -#define M3_10_1 2 -#define M3_11_0 2 -#define M3_11_1 0 -#define M3_12_0 0 -#define M3_12_1 1 -#define M3_13_0 1 -#define M3_13_1 2 -#define M3_14_0 2 -#define M3_14_1 0 -#define M3_15_0 0 -#define M3_15_1 1 -#define M3_16_0 1 -#define M3_16_1 2 -#define M3_17_0 2 -#define M3_17_1 0 -#define M3_18_0 0 -#define M3_18_1 1 - -#define XCAT(x, y) XCAT_(x, y) -#define XCAT_(x, y) x ## y - -#define SKBI(k, s, i) XCAT(k, XCAT(XCAT(XCAT(M9_, s), _), i)) -#define SKBT(t, s, v) XCAT(t, XCAT(XCAT(XCAT(M3_, s), _), v)) - -#define TFBIG_ADDKEY(w0, w1, w2, w3, w4, w5, w6, w7, k, t, s) { \ - w0 = (w0 + SKBI(k, s, 0)); \ - w1 = (w1 + SKBI(k, s, 1)); \ - w2 = (w2 + SKBI(k, s, 2)); \ - w3 = (w3 + SKBI(k, s, 3)); \ - w4 = (w4 + SKBI(k, s, 4)); \ - w5 = (w5 + SKBI(k, s, 5) + SKBT(t, s, 0)); \ - w6 = (w6 + SKBI(k, s, 6) + SKBT(t, s, 1)); \ - w7 = (w7 + SKBI(k, s, 7) + make_uint2(s,0); \ -} - -#define TFBIG_MIX(x0, x1, rc) { \ - x0 = x0 + x1; \ - x1 = ROL2(x1, rc) ^ x0; \ -} - -#define TFBIG_MIX8(w0, w1, w2, w3, w4, w5, w6, w7, rc0, rc1, rc2, rc3) { \ - TFBIG_MIX(w0, w1, rc0); \ - TFBIG_MIX(w2, w3, rc1); \ - TFBIG_MIX(w4, w5, rc2); \ - TFBIG_MIX(w6, w7, rc3); \ -} - -#define TFBIG_4e(s) { \ - TFBIG_ADDKEY(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, s); \ - TFBIG_MIX8(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], 46, 36, 19, 37); \ - TFBIG_MIX8(p[2], p[1], p[4], p[7], p[6], p[5], p[0], p[3], 33, 27, 14, 42); \ - TFBIG_MIX8(p[4], p[1], p[6], p[3], p[0], p[5], p[2], p[7], 17, 49, 36, 39); \ - TFBIG_MIX8(p[6], p[1], p[0], p[7], p[2], p[5], p[4], p[3], 44, 9, 54, 56); \ -} - -#define TFBIG_4o(s) { \ - TFBIG_ADDKEY(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, s); \ - TFBIG_MIX8(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], 39, 30, 34, 24); \ - TFBIG_MIX8(p[2], p[1], p[4], p[7], p[6], p[5], p[0], p[3], 13, 50, 10, 17); \ - TFBIG_MIX8(p[4], p[1], p[6], p[3], p[0], p[5], p[2], p[7], 25, 29, 39, 43); \ - TFBIG_MIX8(p[6], p[1], p[0], p[7], p[2], p[5], p[4], p[3], 8, 35, 56, 22); \ -} - -/* uint2 variant for SM3.2+ */ - -#define TFBIG_KINIT_UI2(k0, k1, k2, k3, k4, k5, k6, k7, k8, t0, t1, t2) { \ - k8 = ((k0 ^ k1) ^ (k2 ^ k3)) ^ ((k4 ^ k5) ^ (k6 ^ k7)) \ - ^ vectorize(0x1BD11BDAA9FC1A22); \ - t2 = t0 ^ t1; \ -} - -#define TFBIG_ADDKEY_UI2(w0, w1, w2, w3, w4, w5, w6, w7, k, t, s) { \ - w0 = (w0 + SKBI(k, s, 0)); \ - w1 = (w1 + SKBI(k, s, 1)); \ - w2 = (w2 + SKBI(k, s, 2)); \ - w3 = (w3 + SKBI(k, s, 3)); \ - w4 = (w4 + SKBI(k, s, 4)); \ - w5 = (w5 + SKBI(k, s, 5) + SKBT(t, s, 0)); \ - w6 = (w6 + SKBI(k, s, 6) + SKBT(t, s, 1)); \ - w7 = (w7 + SKBI(k, s, 7) + vectorize(s)); \ -} - -#define TFBIG_ADDKEY_PRE(w0, w1, w2, w3, w4, w5, w6, w7, k, t, s) { \ - w0 = (w0 + SKBI(k, s, 0)); \ - w1 = (w1 + SKBI(k, s, 1)); \ - w2 = (w2 + SKBI(k, s, 2)); \ - w3 = (w3 + SKBI(k, s, 3)); \ - w4 = (w4 + SKBI(k, s, 4)); \ - w5 = (w5 + SKBI(k, s, 5) + SKBT(t, s, 0)); \ - w6 = (w6 + SKBI(k, s, 6) + SKBT(t, s, 1)); \ - w7 = (w7 + SKBI(k, s, 7) + (s)); \ -} - -#define TFBIG_MIX_UI2(x0, x1, rc) { \ - x0 = x0 + x1; \ - x1 = ROL2(x1, rc) ^ x0; \ -} - -#define TFBIG_MIX_PRE(x0, x1, rc) { \ - x0 = x0 + x1; \ - x1 = ROTL64(x1, rc) ^ x0; \ -} - -#define TFBIG_MIX8_UI2(w0, w1, w2, w3, w4, w5, w6, w7, rc0, rc1, rc2, rc3) { \ - TFBIG_MIX_UI2(w0, w1, rc0); \ - TFBIG_MIX_UI2(w2, w3, rc1); \ - TFBIG_MIX_UI2(w4, w5, rc2); \ - TFBIG_MIX_UI2(w6, w7, rc3); \ -} - -#define TFBIG_MIX8_PRE(w0, w1, w2, w3, w4, w5, w6, w7, rc0, rc1, rc2, rc3) { \ - TFBIG_MIX_PRE(w0, w1, rc0); \ - TFBIG_MIX_PRE(w2, w3, rc1); \ - TFBIG_MIX_PRE(w4, w5, rc2); \ - TFBIG_MIX_PRE(w6, w7, rc3); \ -} - -#define TFBIG_4e_UI2(s) { \ - TFBIG_ADDKEY_UI2(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, s); \ - TFBIG_MIX8_UI2(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], 46, 36, 19, 37); \ - TFBIG_MIX8_UI2(p[2], p[1], p[4], p[7], p[6], p[5], p[0], p[3], 33, 27, 14, 42); \ - TFBIG_MIX8_UI2(p[4], p[1], p[6], p[3], p[0], p[5], p[2], p[7], 17, 49, 36, 39); \ - TFBIG_MIX8_UI2(p[6], p[1], p[0], p[7], p[2], p[5], p[4], p[3], 44, 9, 54, 56); \ -} - -#define TFBIG_4e_PRE(s) { \ - TFBIG_ADDKEY_PRE(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, s); \ - TFBIG_MIX8_PRE(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], 46, 36, 19, 37); \ - TFBIG_MIX8_PRE(p[2], p[1], p[4], p[7], p[6], p[5], p[0], p[3], 33, 27, 14, 42); \ - TFBIG_MIX8_PRE(p[4], p[1], p[6], p[3], p[0], p[5], p[2], p[7], 17, 49, 36, 39); \ - TFBIG_MIX8_PRE(p[6], p[1], p[0], p[7], p[2], p[5], p[4], p[3], 44, 9, 54, 56); \ -} - -#define TFBIG_4o_UI2(s) { \ - TFBIG_ADDKEY_UI2(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, s); \ - TFBIG_MIX8_UI2(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], 39, 30, 34, 24); \ - TFBIG_MIX8_UI2(p[2], p[1], p[4], p[7], p[6], p[5], p[0], p[3], 13, 50, 10, 17); \ - TFBIG_MIX8_UI2(p[4], p[1], p[6], p[3], p[0], p[5], p[2], p[7], 25, 29, 39, 43); \ - TFBIG_MIX8_UI2(p[6], p[1], p[0], p[7], p[2], p[5], p[4], p[3], 8, 35, 56, 22); \ -} - -#define TFBIG_4o_PRE(s) { \ - TFBIG_ADDKEY_PRE(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, s); \ - TFBIG_MIX8_PRE(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], 39, 30, 34, 24); \ - TFBIG_MIX8_PRE(p[2], p[1], p[4], p[7], p[6], p[5], p[0], p[3], 13, 50, 10, 17); \ - TFBIG_MIX8_PRE(p[4], p[1], p[6], p[3], p[0], p[5], p[2], p[7], 25, 29, 39, 43); \ - TFBIG_MIX8_PRE(p[6], p[1], p[0], p[7], p[2], p[5], p[4], p[3], 8, 35, 56, 22); \ -} - -#define macro1() {\ - p[0] += p[1]; p[2] += p[3]; p[4] += p[5]; p[6] += p[7]; p[1] = ROL2(p[1],46) ^ p[0]; \ - p[3] = ROL2(p[3],36) ^ p[2]; p[5] = ROL2(p[5],19) ^ p[4]; p[7] = ROL2(p[7], 37) ^ p[6]; \ - p[2] += p[1]; p[4] += p[7]; p[6] += p[5]; p[0] += p[3]; p[1] = ROL2(p[1],33) ^ p[2]; \ - p[7] = ROL2(p[7],27) ^ p[4]; p[5] = ROL2(p[5],14) ^ p[6]; p[3] = ROL2(p[3], 42) ^ p[0]; \ - p[4] += p[1]; p[6] += p[3]; p[0] += p[5]; p[2] += p[7]; p[1] = ROL2(p[1],17) ^ p[4]; \ - p[3] = ROL2(p[3],49) ^ p[6]; p[5] = ROL2(p[5],36) ^ p[0]; p[7] = ROL2(p[7], 39) ^ p[2]; \ - p[6] += p[1]; p[0] += p[7]; p[2] += p[5]; p[4] += p[3]; p[1] = ROL2(p[1],44) ^ p[6]; \ - p[7] = ROL2(p[7], 9) ^ p[0]; p[5] = ROL2(p[5],54) ^ p[2]; p[3] = ROR8(p[3]) ^ p[4]; \ -} - -#define macro2() { \ - p[0] += p[1]; p[2] += p[3]; p[4] += p[5]; p[6] += p[7]; p[1] = ROL2(p[1], 39) ^ p[0]; \ - p[3] = ROL2(p[3], 30) ^ p[2]; p[5] = ROL2(p[5], 34) ^ p[4]; p[7] = ROL24(p[7]) ^ p[6]; \ - p[2] += p[1]; p[4] += p[7]; p[6] += p[5]; p[0] += p[3]; p[1] = ROL2(p[1], 13) ^ p[2]; \ - p[7] = ROL2(p[7], 50) ^ p[4]; p[5] = ROL2(p[5], 10) ^ p[6]; p[3] = ROL2(p[3], 17) ^ p[0]; \ - p[4] += p[1]; p[6] += p[3]; p[0] += p[5]; p[2] += p[7]; p[1] = ROL2(p[1], 25) ^ p[4]; \ - p[3] = ROL2(p[3], 29) ^ p[6]; p[5] = ROL2(p[5], 39) ^ p[0]; p[7] = ROL2(p[7], 43) ^ p[2]; \ - p[6] += p[1]; p[0] += p[7]; p[2] += p[5]; p[4] += p[3]; p[1] = ROL8(p[1]) ^ p[6]; \ - p[7] = ROL2(p[7], 35) ^ p[0]; p[5] = ROR8(p[5]) ^ p[2]; p[3] = ROL2(p[3], 22) ^ p[4]; \ -} - -#define macro3() { \ - hash64[0]+= hash64[1]; hash64[2]+= hash64[3]; hash64[4]+= hash64[5]; hash64[6]+= hash64[7]; \ - hash64[1] = ROL2(hash64[1], 39) ^ hash64[0]; \ - hash64[3] = ROL2(hash64[3], 30) ^ hash64[2]; \ - hash64[5] = ROL2(hash64[5], 34) ^ hash64[4]; \ - hash64[7] = ROL24(hash64[7]) ^ hash64[6]; \ - hash64[2]+= hash64[1]; hash64[4]+= hash64[7]; hash64[6]+= hash64[5]; hash64[0]+= hash64[3]; \ - hash64[1] = ROL2(hash64[1], 13) ^ hash64[2]; \ - hash64[7] = ROL2(hash64[7], 50) ^ hash64[4]; \ - hash64[5] = ROL2(hash64[5], 10) ^ hash64[6]; \ - hash64[3] = ROL2(hash64[3], 17) ^ hash64[0]; \ - hash64[4]+= hash64[1]; hash64[6]+= hash64[3]; hash64[0]+= hash64[5]; hash64[2]+= hash64[7]; \ - hash64[1] = ROL2(hash64[1], 25) ^ hash64[4]; \ - hash64[3] = ROL2(hash64[3], 29) ^ hash64[6]; \ - hash64[5] = ROL2(hash64[5], 39) ^ hash64[0]; \ - hash64[7] = ROL2(hash64[7], 43) ^ hash64[2]; \ - hash64[6]+= hash64[1]; hash64[0]+= hash64[7]; hash64[2]+= hash64[5]; hash64[4]+= hash64[3]; \ - hash64[1] = ROL8(hash64[1]) ^ hash64[6]; \ - hash64[7] = ROL2(hash64[7], 35) ^ hash64[0]; \ - hash64[5] = ROR8(hash64[5]) ^ hash64[2]; \ - hash64[3] = ROL2(hash64[3], 22) ^ hash64[4]; \ -} - -#define macro4() {\ - hash64[0]+= hash64[1]; hash64[2]+= hash64[3]; hash64[4]+= hash64[5]; hash64[6]+= hash64[7]; \ - hash64[1] = ROL2(hash64[1], 46) ^ hash64[0]; \ - hash64[3] = ROL2(hash64[3], 36) ^ hash64[2]; \ - hash64[5] = ROL2(hash64[5], 19) ^ hash64[4]; \ - hash64[7] = ROL2(hash64[7], 37) ^ hash64[6]; \ - hash64[2]+= hash64[1]; hash64[4]+= hash64[7]; hash64[6]+= hash64[5]; hash64[0]+= hash64[3]; \ - hash64[1] = ROL2(hash64[1], 33) ^ hash64[2]; \ - hash64[7] = ROL2(hash64[7], 27) ^ hash64[4]; \ - hash64[5] = ROL2(hash64[5], 14) ^ hash64[6]; \ - hash64[3] = ROL2(hash64[3], 42) ^ hash64[0]; \ - hash64[4]+= hash64[1]; hash64[6]+= hash64[3]; hash64[0]+= hash64[5]; hash64[2]+= hash64[7]; \ - hash64[1] = ROL2(hash64[1], 17) ^ hash64[4]; \ - hash64[3] = ROL2(hash64[3], 49) ^ hash64[6]; \ - hash64[5] = ROL2(hash64[5], 36) ^ hash64[0]; \ - hash64[7] = ROL2(hash64[7], 39) ^ hash64[2]; \ - hash64[6]+= hash64[1]; hash64[0]+= hash64[7]; hash64[2]+= hash64[5]; hash64[4]+= hash64[3]; \ - hash64[1] = ROL2(hash64[1], 44) ^ hash64[6]; \ - hash64[7] = ROL2(hash64[7], 9) ^ hash64[0]; \ - hash64[5] = ROL2(hash64[5], 54) ^ hash64[2]; \ - hash64[3] = ROR8(hash64[3]) ^ hash64[4]; \ -} - -__constant__ const uint2 buffer[112] = { - {0x749C51CE, 0x4903ADFF}, {0x9746DF03, 0x0D95DE39}, {0x27C79BCE, 0x8FD19341}, {0xFF352CB1, 0x9A255629}, - {0xDF6CA7B0, 0x5DB62599}, {0xA9D5C434, 0xEABE394C}, {0x1A75B523, 0x891112C7}, {0x660FCC33, 0xAE18A40B}, - {0x9746DF03, 0x0D95DE39}, {0x27C79BCE, 0x8FD19341}, {0xFF352CB1, 0x9A255629}, {0xDF6CA7B0, 0x5DB62599}, - {0xA9D5C3F4, 0xEABE394C}, {0x1A75B523, 0x891112C7}, {0x660FCC73, 0x9E18A40B}, {0x98173EC5, 0xCAB2076D}, - {0x27C79BCE, 0x8FD19341}, {0xFF352CB1, 0x9A255629}, {0xDF6CA7B0, 0x5DB62599}, {0xA9D5C3F4, 0xEABE394C}, - {0x1A75B523, 0x991112C7}, {0x660FCC73, 0x9E18A40B}, {0x98173F04, 0xCAB2076D}, {0x749C51D0, 0x4903ADFF}, - {0xFF352CB1, 0x9A255629}, {0xDF6CA7B0, 0x5DB62599}, {0xA9D5C3F4, 0xEABE394C}, {0x1A75B523, 0x991112C7}, - {0x660FCC33, 0xAE18A40B}, {0x98173F04, 0xCAB2076D}, {0x749C51CE, 0x3903ADFF}, {0x9746DF06, 0x0D95DE39}, - {0xDF6CA7B0, 0x5DB62599}, {0xA9D5C3F4, 0xEABE394C}, {0x1A75B523, 0x991112C7}, {0x660FCC33, 0xAE18A40B}, - {0x98173EC4, 0xCAB2076D}, {0x749C51CE, 0x3903ADFF}, {0x9746DF43, 0xFD95DE39}, {0x27C79BD2, 0x8FD19341}, - {0xA9D5C3F4, 0xEABE394C}, {0x1A75B523, 0x991112C7}, {0x660FCC33, 0xAE18A40B}, {0x98173EC4, 0xCAB2076D}, - {0x749C51CE, 0x4903ADFF}, {0x9746DF43, 0xFD95DE39}, {0x27C79C0E, 0x8FD19341}, {0xFF352CB6, 0x9A255629}, - {0x1A75B523, 0x991112C7}, {0x660FCC33, 0xAE18A40B}, {0x98173EC4, 0xCAB2076D}, {0x749C51CE, 0x4903ADFF}, - {0x9746DF03, 0x0D95DE39}, {0x27C79C0E, 0x8FD19341}, {0xFF352CB1, 0x8A255629}, {0xDF6CA7B6, 0x5DB62599}, - {0x660FCC33, 0xAE18A40B}, {0x98173EC4, 0xCAB2076D}, {0x749C51CE, 0x4903ADFF}, {0x9746DF03, 0x0D95DE39}, - {0x27C79BCE, 0x8FD19341}, {0xFF352CB1, 0x8A255629}, {0xDF6CA7F0, 0x4DB62599}, {0xA9D5C3FB, 0xEABE394C}, - {0x98173EC4, 0xCAB2076D}, {0x749C51CE, 0x4903ADFF}, {0x9746DF03, 0x0D95DE39}, {0x27C79BCE, 0x8FD19341}, - {0xFF352CB1, 0x9A255629}, {0xDF6CA7F0, 0x4DB62599}, {0xA9D5C434, 0xEABE394C}, {0x1A75B52B, 0x991112C7}, - {0x749C51CE, 0x4903ADFF}, {0x9746DF03, 0x0D95DE39}, {0x27C79BCE, 0x8FD19341}, {0xFF352CB1, 0x9A255629}, - {0xDF6CA7B0, 0x5DB62599}, {0xA9D5C434, 0xEABE394C}, {0x1A75B523, 0x891112C7}, {0x660FCC3C, 0xAE18A40B}, - {0x9746DF03, 0x0D95DE39}, {0x27C79BCE, 0x8FD19341}, {0xFF352CB1, 0x9A255629}, {0xDF6CA7B0, 0x5DB62599}, - {0xA9D5C3F4, 0xEABE394C}, {0x1A75B523, 0x891112C7}, {0x660FCC73, 0x9E18A40B}, {0x98173ece, 0xcab2076d}, - {0x27C79BCE, 0x8FD19341}, {0xFF352CB1, 0x9A255629}, {0xDF6CA7B0, 0x5DB62599}, {0xA9D5C3F4, 0xEABE394C}, - {0x1A75B523, 0x991112C7}, {0x660FCC73, 0x9E18A40B}, {0x98173F04, 0xCAB2076D}, {0x749C51D9, 0x4903ADFF}, - {0xFF352CB1, 0x9A255629}, {0xDF6CA7B0, 0x5DB62599}, {0xA9D5C3F4, 0xEABE394C}, {0x1A75B523, 0x991112C7}, - {0x660FCC33, 0xAE18A40B}, {0x98173F04, 0xCAB2076D}, {0x749C51CE, 0x3903ADFF}, {0x9746DF0F, 0x0D95DE39}, - {0xDF6CA7B0, 0x5DB62599}, {0xA9D5C3F4, 0xEABE394C}, {0x1A75B523, 0x991112C7}, {0x660FCC33, 0xAE18A40B}, - {0x98173EC4, 0xCAB2076D}, {0x749C51CE, 0x3903ADFF}, {0x9746DF43, 0xFD95DE39}, {0x27C79BDB, 0x8FD19341} -}; - -__global__ -#if __CUDA_ARCH__ > 500 -__launch_bounds__(TPB52, 3) -#else -__launch_bounds__(TPB50, 5) -#endif -void quark_skein512_gpu_hash_64(const uint32_t threads, const uint32_t startNonce, uint64_t* __restrict__ g_hash, const uint32_t *const __restrict__ g_nonceVector) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - - if (thread < threads){ - - // Skein - uint2 p[8], h[9]; - - const uint32_t hashPosition = (g_nonceVector == NULL) ? thread : g_nonceVector[thread] - startNonce; - - uint64_t *Hash = &g_hash[hashPosition<<3]; - - uint2x4 *phash = (uint2x4*)Hash; - *(uint2x4*)&p[0] = __ldg4(&phash[0]); - *(uint2x4*)&p[4] = __ldg4(&phash[1]); - - h[0] = p[0]; h[1] = p[1]; h[2] = p[2]; h[3] = p[3]; - h[4] = p[4]; h[5] = p[5]; h[6] = p[6]; h[7] = p[7]; - - p[0] += buffer[ 0]; p[1] += buffer[ 1]; p[2] += buffer[ 2]; p[3] += buffer[3]; - p[4] += buffer[ 4]; p[5] += buffer[ 5]; p[6] += buffer[ 6]; p[7] += buffer[7]; - macro1(); - p[0] += buffer[ 8]; p[1] += buffer[ 9]; p[2] += buffer[ 10]; p[3] += buffer[11]; - p[4] += buffer[ 12]; p[5] += buffer[ 13]; p[6] += buffer[ 14]; p[7] += buffer[15]; - macro2(); - p[0] += buffer[ 16]; p[1] += buffer[ 17]; p[2] += buffer[ 18]; p[3] += buffer[19]; - p[4] += buffer[ 20]; p[5] += buffer[ 21]; p[6] += buffer[ 22]; p[7] += buffer[23]; - macro1(); - p[0] += buffer[ 24]; p[1] += buffer[ 25]; p[2] += buffer[ 26]; p[3] += buffer[27]; - p[4] += buffer[ 28]; p[5] += buffer[ 29]; p[6] += buffer[ 30]; p[7] += buffer[31]; - macro2(); - p[0] += buffer[ 32]; p[1] += buffer[ 33]; p[2] += buffer[ 34]; p[3] += buffer[35]; - p[4] += buffer[ 36]; p[5] += buffer[ 37]; p[6] += buffer[ 38]; p[7] += buffer[39]; - macro1(); - p[0] += buffer[ 40]; p[1] += buffer[ 41]; p[2] += buffer[ 42]; p[3] += buffer[43]; - p[4] += buffer[ 44]; p[5] += buffer[ 45]; p[6] += buffer[ 46]; p[7] += buffer[47]; - macro2(); - p[0] += buffer[ 48]; p[1] += buffer[ 49]; p[2] += buffer[ 50]; p[3] += buffer[51]; - p[4] += buffer[ 52]; p[5] += buffer[ 53]; p[6] += buffer[ 54]; p[7] += buffer[55]; - macro1(); - p[0] += buffer[ 56]; p[1] += buffer[ 57]; p[2] += buffer[ 58]; p[3] += buffer[59]; - p[4] += buffer[ 60]; p[5] += buffer[ 61]; p[6] += buffer[ 62]; p[7] += buffer[63]; - macro2(); - p[0] += buffer[ 64]; p[1] += buffer[ 65]; p[2] += buffer[ 66]; p[3] += buffer[67]; - p[4] += buffer[ 68]; p[5] += buffer[ 69]; p[6] += buffer[ 70]; p[7] += buffer[71]; - macro1(); - p[0] += buffer[ 72]; p[1] += buffer[ 73]; p[2] += buffer[ 74]; p[3] += buffer[75]; - p[4] += buffer[ 76]; p[5] += buffer[ 77]; p[6] += buffer[ 78]; p[7] += buffer[79]; - macro2(); - p[0] += buffer[ 80]; p[1] += buffer[ 81]; p[2] += buffer[ 82]; p[3] += buffer[83]; - p[4] += buffer[ 84]; p[5] += buffer[ 85]; p[6] += buffer[ 86]; p[7] += buffer[87]; - macro1(); - p[0] += buffer[ 88]; p[1] += buffer[ 89]; p[2] += buffer[ 90]; p[3] += buffer[91]; - p[4] += buffer[ 92]; p[5] += buffer[ 93]; p[6] += buffer[ 94]; p[7] += buffer[95]; - macro2(); - p[0] += buffer[ 96]; p[1] += buffer[ 97]; p[2] += buffer[ 98]; p[3] += buffer[99]; - p[4] += buffer[100]; p[5] += buffer[101]; p[6] += buffer[102]; p[7] += buffer[103]; - macro1(); - p[0] += buffer[104]; p[1] += buffer[105]; p[2] += buffer[106]; p[3] += buffer[107]; - p[4] += buffer[108]; p[5] += buffer[109]; p[6] += buffer[110]; p[7] += buffer[111]; - macro2(); - p[0]+= make_uint2(0xA9D5C3F4, 0xEABE394C); p[1]+= make_uint2(0x1A75B523, 0x991112C7); - p[2]+= make_uint2(0x660FCC33, 0xAE18A40B); p[3]+= make_uint2(0x98173EC4, 0xCAB2076D); - p[4]+= make_uint2(0x749C51CE, 0x4903ADFF); p[5]+= make_uint2(0x9746DF43, 0xFD95DE39); - p[6]+= make_uint2(0x27C79C0E, 0x8FD19341); p[7]+= make_uint2(0xFF352CBF, 0x9A255629); - macro1(); - p[0]+= make_uint2(0x1A75B523, 0x991112C7); p[1]+= make_uint2(0x660FCC33, 0xAE18A40B); - p[2]+= make_uint2(0x98173EC4, 0xCAB2076D); p[3]+= make_uint2(0x749C51CE, 0x4903ADFF); - p[4]+= make_uint2(0x9746DF03, 0x0D95DE39); p[5]+= make_uint2(0x27C79C0E, 0x8FD19341); - p[6]+= make_uint2(0xFF352CB1, 0x8A255629); p[7]+= make_uint2(0xDF6CA7BF, 0x5DB62599); - macro2(); - p[0] += vectorize(0xAE18A40B660FCC33); p[1] += vectorize(0xcab2076d98173ec4); - p[2] += vectorize(0x4903ADFF749C51CE); p[3] += vectorize(0x0D95DE399746DF03); - p[4] += vectorize(0x8FD1934127C79BCE); p[5] += vectorize(0x8A255629FF352CB1); - p[6] += vectorize(0x4DB62599DF6CA7F0); p[7] += vectorize(0xEABE394CA9D5C3F4 + 16); - macro1(); - p[0] += vectorize(0xcab2076d98173ec4); p[1] += vectorize(0x4903ADFF749C51CE); - p[2] += vectorize(0x0D95DE399746DF03); p[3] += vectorize(0x8FD1934127C79BCE); - p[4] += vectorize(0x9A255629FF352CB1); p[5] += vectorize(0x4DB62599DF6CA7F0); - p[6] += vectorize(0xEABE394CA9D5C3F4 + 0x0000000000000040); - p[7] += vectorize(0x991112C71A75B523 + 17); - macro2(); - p[0] += vectorize(0x4903ADFF749C51CE); p[1] += vectorize(0x0D95DE399746DF03); - p[2] += vectorize(0x8FD1934127C79BCE); p[3] += vectorize(0x9A255629FF352CB1); - p[4] += vectorize(0x5DB62599DF6CA7B0); p[5] += vectorize(0xEABE394CA9D5C3F4 + 0x0000000000000040); - p[6] += vectorize(0x891112C71A75B523); p[7] += vectorize(0xAE18A40B660FCC33 + 18); - - #define h0 p[0] - #define h1 p[1] - #define h2 p[2] - #define h3 p[3] - #define h4 p[4] - #define h5 p[5] - #define h6 p[6] - #define h7 p[7] - - h0 ^= h[0]; h1 ^= h[1]; h2 ^= h[2]; h3 ^= h[3]; - h4 ^= h[4]; h5 ^= h[5]; h6 ^= h[6]; h7 ^= h[7]; - - uint2 skein_h8 = h0 ^ h1 ^ h2 ^ h3 ^ h4 ^ h5 ^ h6 ^ h7 ^ vectorize(0x1BD11BDAA9FC1A22); - - uint2 hash64[8]; - - hash64[5] = h5 + 8; - - hash64[0] = h0 + h1; - hash64[1] = ROL2(h1, 46) ^ hash64[0]; - hash64[2] = h2 + h3; - hash64[3] = ROL2(h3, 36) ^ hash64[2]; - hash64[4] = h4 + hash64[5]; - hash64[5] = ROL2(hash64[5], 19) ^ hash64[4]; - hash64[6] = (h6 + h7 + make_uint2(0,0xff000000)); - hash64[7] = ROL2(h7, 37) ^ hash64[6]; - hash64[2]+= hash64[1]; - hash64[1] = ROL2(hash64[1], 33) ^ hash64[2]; - hash64[4]+= hash64[7]; - hash64[7] = ROL2(hash64[7], 27) ^ hash64[4]; - hash64[6]+= hash64[5]; - hash64[5] = ROL2(hash64[5], 14) ^ hash64[6]; - hash64[0]+= hash64[3]; - hash64[3] = ROL2(hash64[3], 42) ^ hash64[0]; - hash64[4]+= hash64[1]; - hash64[1] = ROL2(hash64[1], 17) ^ hash64[4]; - hash64[6]+= hash64[3]; - hash64[3] = ROL2(hash64[3], 49) ^ hash64[6]; - hash64[0]+= hash64[5]; - hash64[5] = ROL2(hash64[5], 36) ^ hash64[0]; - hash64[2]+= hash64[7]; - hash64[7] = ROL2(hash64[7], 39) ^ hash64[2]; - hash64[6]+= hash64[1]; - hash64[1] = ROL2(hash64[1], 44) ^ hash64[6]; - hash64[0]+= hash64[7]; - hash64[7] = ROL2(hash64[7], 9) ^ hash64[0]; - hash64[2]+= hash64[5]; - hash64[5] = ROL2(hash64[5], 54) ^ hash64[2]; - hash64[4]+= hash64[3]; - hash64[3] = ROR8(hash64[3]) ^ hash64[4]; - - hash64[0]+= h1; hash64[1]+= h2; hash64[2]+= h3; hash64[3]+= h4; - hash64[4]+= h5; - hash64[5]+= h6 + make_uint2(0,0xff000000); - hash64[6]+= h7 + vectorize(0xff00000000000008); - hash64[7]+= skein_h8 + 1; - macro3(); - hash64[0]+= h2; hash64[1]+= h3; hash64[2]+= h4; hash64[3]+= h5; - hash64[4]+= h6; - hash64[5]+= h7 + vectorize(0xff00000000000008); - hash64[6]+= skein_h8 + 8; - hash64[7]+= h0 + 2; - macro4(); - hash64[0] = (hash64[0] + h3); hash64[1] = (hash64[1] + h4); - hash64[2] = (hash64[2] + h5); hash64[3] = (hash64[3] + h6); - hash64[4] = (hash64[4] + h7); hash64[5] = (hash64[5] + skein_h8 + 8); - hash64[6] = (hash64[6] + h0 + make_uint2(0,0xff000000)); - hash64[7] = (hash64[7] + h1 + 3); - macro3(); - hash64[0] = (hash64[0] + h4); hash64[1] = (hash64[1] + h5); - hash64[2] = (hash64[2] + h6); hash64[3] = (hash64[3] + h7); - hash64[4] = (hash64[4] + skein_h8); hash64[5] = (hash64[5] + h0 + make_uint2(0,0xff000000)); - hash64[6] = (hash64[6] + h1 + vectorize(0xff00000000000008)); - hash64[7] = (hash64[7] + h2 + 4); - macro4(); - hash64[0] = (hash64[0] + h5); hash64[1] = (hash64[1] + h6); - hash64[2] = (hash64[2] + h7); hash64[3] = (hash64[3] + skein_h8); - hash64[4] = (hash64[4] + h0); hash64[5] = (hash64[5] + h1 + vectorize(0xff00000000000008)); - hash64[6] = (hash64[6] + h2 + 8); hash64[7] = (hash64[7] + h3 + 5); - macro3(); - hash64[0] = (hash64[0] + h6); hash64[1] = (hash64[1] + h7); - hash64[2] = (hash64[2] + skein_h8); hash64[3] = (hash64[3] + h0); - hash64[4] = (hash64[4] + h1); hash64[5] = (hash64[5] + h2 + 8); - hash64[6] = (hash64[6] + h3 + make_uint2(0,0xff000000)); - hash64[7] = (hash64[7] + h4 + 6); - macro4(); - hash64[0] = (hash64[0] + h7); hash64[1] = (hash64[1] + skein_h8); - hash64[2] = (hash64[2] + h0); hash64[3] = (hash64[3] + h1); - hash64[4] = (hash64[4] + h2); hash64[5] = (hash64[5] + h3 + make_uint2(0,0xff000000)); - hash64[6] = (hash64[6] + h4 + vectorize(0xff00000000000008)); - hash64[7] = (hash64[7] + h5 + 7); - macro3(); - hash64[0] = (hash64[0] + skein_h8); hash64[1] = (hash64[1] + h0); - hash64[2] = (hash64[2] + h1); hash64[3] = (hash64[3] + h2); - hash64[4] = (hash64[4] + h3); hash64[5] = (hash64[5] + h4 + vectorize(0xff00000000000008)); - hash64[6] = (hash64[6] + h5 + 8); hash64[7] = (hash64[7] + h6 + 8); - macro4(); - hash64[0] = vectorize(devectorize(hash64[0]) + devectorize(h0)); - hash64[1] = vectorize(devectorize(hash64[1]) + devectorize(h1)); - hash64[2] = vectorize(devectorize(hash64[2]) + devectorize(h2)); - hash64[3] = vectorize(devectorize(hash64[3]) + devectorize(h3)); - hash64[4] = vectorize(devectorize(hash64[4]) + devectorize(h4)); - hash64[5] = vectorize(devectorize(hash64[5]) + devectorize(h5) + 8); - hash64[6] = vectorize(devectorize(hash64[6]) + devectorize(h6) + 0xff00000000000000); - hash64[7] = vectorize(devectorize(hash64[7]) + devectorize(h7) + 9); - macro3(); - hash64[0] = vectorize(devectorize(hash64[0]) + devectorize(h1)); - hash64[1] = vectorize(devectorize(hash64[1]) + devectorize(h2)); - hash64[2] = vectorize(devectorize(hash64[2]) + devectorize(h3)); - hash64[3] = vectorize(devectorize(hash64[3]) + devectorize(h4)); - hash64[4] = vectorize(devectorize(hash64[4]) + devectorize(h5)); - hash64[5] = vectorize(devectorize(hash64[5]) + devectorize(h6) + 0xff00000000000000); - hash64[6] = vectorize(devectorize(hash64[6]) + devectorize(h7) + 0xff00000000000008); - hash64[7] = vectorize(devectorize(hash64[7]) + devectorize(skein_h8) + 10); - macro4(); - hash64[0] = vectorize(devectorize(hash64[0]) + devectorize(h2)); - hash64[1] = vectorize(devectorize(hash64[1]) + devectorize(h3)); - hash64[2] = vectorize(devectorize(hash64[2]) + devectorize(h4)); - hash64[3] = vectorize(devectorize(hash64[3]) + devectorize(h5)); - hash64[4] = vectorize(devectorize(hash64[4]) + devectorize(h6)); - hash64[5] = vectorize(devectorize(hash64[5]) + devectorize(h7) + 0xff00000000000008); - hash64[6] = vectorize(devectorize(hash64[6]) + devectorize(skein_h8) + 8); - hash64[7] = vectorize(devectorize(hash64[7]) + devectorize(h0) + 11); - macro3(); - hash64[0] = vectorize(devectorize(hash64[0]) + devectorize(h3)); - hash64[1] = vectorize(devectorize(hash64[1]) + devectorize(h4)); - hash64[2] = vectorize(devectorize(hash64[2]) + devectorize(h5)); - hash64[3] = vectorize(devectorize(hash64[3]) + devectorize(h6)); - hash64[4] = vectorize(devectorize(hash64[4]) + devectorize(h7)); - hash64[5] = vectorize(devectorize(hash64[5]) + devectorize(skein_h8) + 8); - hash64[6] = vectorize(devectorize(hash64[6]) + devectorize(h0) + 0xff00000000000000); - hash64[7] = vectorize(devectorize(hash64[7]) + devectorize(h1) + 12); - macro4(); - hash64[0] = vectorize(devectorize(hash64[0]) + devectorize(h4)); - hash64[1] = vectorize(devectorize(hash64[1]) + devectorize(h5)); - hash64[2] = vectorize(devectorize(hash64[2]) + devectorize(h6)); - hash64[3] = vectorize(devectorize(hash64[3]) + devectorize(h7)); - hash64[4] = vectorize(devectorize(hash64[4]) + devectorize(skein_h8)); - hash64[5] = vectorize(devectorize(hash64[5]) + devectorize(h0) + 0xff00000000000000); - hash64[6] = vectorize(devectorize(hash64[6]) + devectorize(h1) + 0xff00000000000008); - hash64[7] = vectorize(devectorize(hash64[7]) + devectorize(h2) + 13); - macro3(); - hash64[0] = vectorize(devectorize(hash64[0]) + devectorize(h5)); - hash64[1] = vectorize(devectorize(hash64[1]) + devectorize(h6)); - hash64[2] = vectorize(devectorize(hash64[2]) + devectorize(h7)); - hash64[3] = vectorize(devectorize(hash64[3]) + devectorize(skein_h8)); - hash64[4] = vectorize(devectorize(hash64[4]) + devectorize(h0)); - hash64[5] = vectorize(devectorize(hash64[5]) + devectorize(h1) + 0xff00000000000008); - hash64[6] = vectorize(devectorize(hash64[6]) + devectorize(h2) + 8); - hash64[7] = vectorize(devectorize(hash64[7]) + devectorize(h3) + 14); - macro4(); - hash64[0] = vectorize(devectorize(hash64[0]) + devectorize(h6)); - hash64[1] = vectorize(devectorize(hash64[1]) + devectorize(h7)); - hash64[2] = vectorize(devectorize(hash64[2]) + devectorize(skein_h8)); - hash64[3] = vectorize(devectorize(hash64[3]) + devectorize(h0)); - hash64[4] = vectorize(devectorize(hash64[4]) + devectorize(h1)); - hash64[5] = vectorize(devectorize(hash64[5]) + devectorize(h2) + 8); - hash64[6] = vectorize(devectorize(hash64[6]) + devectorize(h3) + 0xff00000000000000); - hash64[7] = vectorize(devectorize(hash64[7]) + devectorize(h4) + 15); - macro3(); - hash64[0] = vectorize(devectorize(hash64[0]) + devectorize(h7)); - hash64[1] = vectorize(devectorize(hash64[1]) + devectorize(skein_h8)); - hash64[2] = vectorize(devectorize(hash64[2]) + devectorize(h0)); - hash64[3] = vectorize(devectorize(hash64[3]) + devectorize(h1)); - hash64[4] = vectorize(devectorize(hash64[4]) + devectorize(h2)); - hash64[5] = vectorize(devectorize(hash64[5]) + devectorize(h3) + 0xff00000000000000); - hash64[6] = vectorize(devectorize(hash64[6]) + devectorize(h4) + 0xff00000000000008); - hash64[7] = vectorize(devectorize(hash64[7]) + devectorize(h5) + 16); - macro4(); - hash64[0] = vectorize(devectorize(hash64[0]) + devectorize(skein_h8)); - hash64[1] = vectorize(devectorize(hash64[1]) + devectorize(h0)); - hash64[2] = vectorize(devectorize(hash64[2]) + devectorize(h1)); - hash64[3] = vectorize(devectorize(hash64[3]) + devectorize(h2)); - hash64[4] = vectorize(devectorize(hash64[4]) + devectorize(h3)); - hash64[5] = vectorize(devectorize(hash64[5]) + devectorize(h4) + 0xff00000000000008); - hash64[6] = vectorize(devectorize(hash64[6]) + devectorize(h5) + 8); - hash64[7] = vectorize(devectorize(hash64[7]) + devectorize(h6) + 17); - macro3(); - hash64[0] = vectorize(devectorize(hash64[0]) + devectorize(h0)); - hash64[1] = vectorize(devectorize(hash64[1]) + devectorize(h1)); - hash64[2] = vectorize(devectorize(hash64[2]) + devectorize(h2)); - hash64[3] = vectorize(devectorize(hash64[3]) + devectorize(h3)); - hash64[4] = vectorize(devectorize(hash64[4]) + devectorize(h4)); - hash64[5] = vectorize(devectorize(hash64[5]) + devectorize(h5) + 8); - hash64[6] = vectorize(devectorize(hash64[6]) + devectorize(h6) + 0xff00000000000000); - hash64[7] = vectorize(devectorize(hash64[7]) + devectorize(h7) + 18); - - phash = (uint2x4*)hash64; - uint2x4 *outpt = (uint2x4*)Hash; - outpt[0] = phash[0]; - outpt[1] = phash[1]; - - #undef h0 - #undef h1 - #undef h2 - #undef h3 - #undef h4 - #undef h5 - #undef h6 - #undef h7 - } -} - -__host__ -//void quark_skein512_cpu_hash_64(int thr_id,uint32_t threads, uint32_t *d_nonceVector, uint32_t *d_hash) -void quark_skein512_cpu_hash_64(int thr_id, const uint32_t threads, const uint32_t startNonce, uint32_t *d_nonceVector, uint32_t *d_hash, int order) -{ - uint32_t tpb = TPB52; - int dev_id = device_map[thr_id]; - - if (device_sm[dev_id] <= 500) tpb = TPB50; - const dim3 grid((threads + tpb-1)/tpb); - const dim3 block(tpb); - quark_skein512_gpu_hash_64 <<>>(threads, startNonce, (uint64_t*)d_hash, d_nonceVector); - -} - -// 120 * 8 = 960 ... too big ? -static __constant__ uint2 c_buffer[120]; // padded message (80 bytes + 72*8 bytes midstate + align) - -__global__ -#if __CUDA_ARCH__ > 500 -__launch_bounds__(TPB52, 3) -#else -__launch_bounds__(TPB50, 5) -#endif -void skein512_gpu_hash_80(uint32_t threads, uint32_t startNounce, uint64_t *output64) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - // Skein - uint2 h0, h1, h2, h3, h4, h5, h6, h7, h8; - uint2 t0, t1, t2; - - uint32_t nonce = cuda_swab32(startNounce + thread); - uint2 nonce2 = make_uint2(c_buffer[0].x, nonce); - - uint2 p[8]; - p[1] = nonce2; - - h0 = c_buffer[ 1]; - h1 = c_buffer[ 2]; - h2 = c_buffer[ 3]; - h3 = c_buffer[ 4]; - h4 = c_buffer[ 5]; - h5 = c_buffer[ 6]; - h6 = c_buffer[ 7]; - h7 = c_buffer[ 8]; - h8 = c_buffer[ 9]; - - t0 = vectorize(0x50ull); - t1 = vectorize(0xB000000000000000ull); - t2 = t0^t1; - - p[1]=nonce2 + h1; p[0]= c_buffer[10] + p[1]; - p[2]=c_buffer[11]; - p[3]=c_buffer[12]; - p[4]=c_buffer[13]; - p[5]=c_buffer[14]; - p[6]=c_buffer[15]; - p[7]=c_buffer[16]; - -// macro1(); - p[1] = ROL2(p[1], 46) ^ p[0]; - p[2] += p[1]; - p[0] += p[3]; - p[1] = ROL2(p[1], 33) ^ p[2]; - p[3] = c_buffer[17] ^ p[0]; - p[4] += p[1]; - p[6] += p[3]; - p[0] += p[5]; - p[2] += p[7]; - p[1] = ROL2(p[1], 17) ^ p[4]; - p[3] = ROL2(p[3], 49) ^ p[6]; - p[5] = c_buffer[18] ^ p[0]; - p[7] = c_buffer[19] ^ p[2]; - p[6] += p[1]; - p[0] += p[7]; - p[2] += p[5]; - p[4] += p[3]; - p[1] = ROL2(p[1], 44) ^ p[6]; - p[7] = ROL2(p[7], 9) ^ p[0]; - p[5] = ROL2(p[5], 54) ^ p[2]; - p[3] = ROR8(p[3]) ^ p[4]; - - p[0]+=h1; p[1]+=h2; p[2]+=h3; p[3]+=h4; p[4]+=h5; - p[5]+=c_buffer[20]; p[7]+=c_buffer[21]; p[6]+=c_buffer[22]; - macro2(); - p[0]+=h2; p[1]+=h3; p[2]+=h4; p[3]+=h5; p[4]+=h6; - p[5]+=c_buffer[22]; p[7]+=c_buffer[23]; p[6]+=c_buffer[24]; - macro1(); - p[0]+=h3; p[1]+=h4; p[2]+=h5; p[3]+=h6; p[4]+=h7; - p[5]+=c_buffer[24]; p[7]+=c_buffer[25]; p[6]+=c_buffer[26]; - macro2(); - p[0]+=h4; p[1]+=h5; p[2]+=h6; p[3]+=h7; p[4]+=h8; - p[5]+=c_buffer[26]; p[7]+=c_buffer[27]; p[6]+=c_buffer[28]; - macro1(); - p[0]+=h5; p[1]+=h6; p[2]+=h7; p[3]+=h8; p[4]+=h0; - p[5]+=c_buffer[28]; p[7]+=c_buffer[29]; p[6]+=c_buffer[30]; - macro2(); - p[0]+=h6; p[1]+=h7; p[2]+=h8; p[3]+=h0; p[4]+=h1; - p[5]+=c_buffer[30]; p[7]+=c_buffer[31]; p[6]+=c_buffer[32]; - macro1(); - p[0]+=h7; p[1]+=h8; p[2]+=h0; p[3]+=h1; p[4]+=h2; - p[5]+=c_buffer[32]; p[7]+=c_buffer[33]; p[6]+=c_buffer[34]; - macro2(); - p[0]+=h8; p[1]+=h0; p[2]+=h1; p[3]+=h2; p[4]+=h3; - p[5]+=c_buffer[34]; p[7]+=c_buffer[35]; p[6]+=c_buffer[36]; - macro1(); - p[0]+=h0; p[1]+=h1; p[2]+=h2; p[3]+=h3; p[4]+=h4; - p[5]+=c_buffer[36]; p[7]+=c_buffer[37]; p[6]+=c_buffer[38]; - macro2(); - p[0]+=h1; p[1]+=h2; p[2]+=h3; p[3]+=h4; p[4]+=h5; - p[5]+=c_buffer[38]; p[7]+=c_buffer[39]; p[6]+=c_buffer[40]; - macro1(); - p[0]+=h2; p[1]+=h3; p[2]+=h4; p[3]+=h5; p[4]+=h6; - p[5]+=c_buffer[40]; p[7]+=c_buffer[41]; p[6]+=c_buffer[42]; - macro2(); - p[0]+=h3; p[1]+=h4; p[2]+=h5; p[3]+=h6; p[4]+=h7; - p[5]+=c_buffer[42]; p[7]+=c_buffer[43]; p[6]+=c_buffer[44]; - macro1(); - p[0]+=h4; p[1]+=h5; p[2]+=h6; p[3]+=h7; p[4]+=h8; - p[5]+=c_buffer[44]; p[7]+=c_buffer[45]; p[6]+=c_buffer[46]; - macro2(); - p[0]+=h5; p[1]+=h6; p[2]+=h7; p[3]+=h8; p[4]+=h0; - p[5]+=c_buffer[46]; p[7]+=c_buffer[47]; p[6]+=c_buffer[48]; - macro1(); - p[0]+=h6; p[1]+=h7; p[2]+=h8; p[3]+=h0; p[4]+=h1; - p[5]+=c_buffer[48]; p[7]+=c_buffer[49]; p[6]+=c_buffer[50]; - macro2(); - p[0]+=h7; p[1]+=h8; p[2]+=h0; p[3]+=h1; p[4]+=h2; - p[5]+=c_buffer[50]; p[7]+=c_buffer[51]; p[6]+=c_buffer[52]; - macro1(); - p[0]+=h8; p[1]+=h0; p[2]+=h1; p[3]+=h2; p[4]+=h3; - p[5]+=c_buffer[52]; p[7]+=c_buffer[53]; p[6]+=c_buffer[54]; - macro2(); - p[0]+=h0; p[1]+=h1; p[2]+=h2; p[3]+=h3; p[4]+=h4; - p[5]+=c_buffer[54]; p[7]+=c_buffer[55]; p[6]+=c_buffer[56]; - - p[0]^= c_buffer[57]; - p[1]^= nonce2; - - t0 = vectorize(8); // extra - t1 = vectorize(0xFF00000000000000ull); // etype -// t2 = vectorize(0xB000000000000050ull); - - h0 = p[0]; - h1 = p[1]; - h2 = p[2]; - h3 = p[3]; - h4 = p[4]; - h5 = p[5]; - h6 = p[6]; - h7 = p[7]; - - TFBIG_KINIT_UI2(h0, h1, h2, h3, h4, h5, h6, h7, h8, t0, t1, t2); - - p[0] = p[1] = p[2] = p[3] = p[4] =p[5] =p[6] = p[7] = vectorize(0); - - TFBIG_4e_UI2(0); - TFBIG_4o_UI2(1); - TFBIG_4e_UI2(2); - TFBIG_4o_UI2(3); - TFBIG_4e_UI2(4); - TFBIG_4o_UI2(5); - TFBIG_4e_UI2(6); - TFBIG_4o_UI2(7); - TFBIG_4e_UI2(8); - TFBIG_4o_UI2(9); - TFBIG_4e_UI2(10); - TFBIG_4o_UI2(11); - TFBIG_4e_UI2(12); - TFBIG_4o_UI2(13); - TFBIG_4e_UI2(14); - TFBIG_4o_UI2(15); - TFBIG_4e_UI2(16); - TFBIG_4o_UI2(17); - TFBIG_ADDKEY_UI2(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, 18); - - uint64_t *outpHash = &output64[thread<<3]; - #pragma unroll 8 - for (int i = 0; i < 8; i++) - outpHash[i] = devectorize(p[i]); - } -} - -__host__ -void skein512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, int swap) -{ - uint32_t tpb = TPB52; - int dev_id = device_map[thr_id]; - if (device_sm[dev_id] <= 500) tpb = TPB50; - - const dim3 grid((threads + tpb-1)/tpb); - const dim3 block(tpb); - - // hash function is cut in 2 parts to reduce kernel size - skein512_gpu_hash_80 <<< grid, block >>> (threads, startNounce, (uint64_t*)d_hash); -} - -__host__ -void skein512_cpu_setBlock_80(void *pdata) -{ - uint64_t message[20]; - memcpy(&message[0], pdata, 80); - - uint64_t p[8]; - uint64_t h0, h1, h2, h3, h4, h5, h6, h7, h8; - uint64_t t0, t1, t2; - - h0 = 0x4903ADFF749C51CEull; - h1 = 0x0D95DE399746DF03ull; - h2 = 0x8FD1934127C79BCEull; - h3 = 0x9A255629FF352CB1ull; - h4 = 0x5DB62599DF6CA7B0ull; - h5 = 0xEABE394CA9D5C3F4ull; - h6 = 0x991112C71A75B523ull; - h7 = 0xAE18A40B660FCC33ull; - // h8 = h0 ^ h1 ^ h2 ^ h3 ^ h4 ^ h5 ^ h6 ^ h7 ^ SPH_C64(0x1BD11BDAA9FC1A22); - h8 = 0xcab2076d98173ec4ULL; - - t0 = 64; // ptr - t1 = 0x7000000000000000ull; - t2 = 0x7000000000000040ull; - - memcpy(&p[0], &message[0], 64); - - TFBIG_4e_PRE(0); - TFBIG_4o_PRE(1); - TFBIG_4e_PRE(2); - TFBIG_4o_PRE(3); - TFBIG_4e_PRE(4); - TFBIG_4o_PRE(5); - TFBIG_4e_PRE(6); - TFBIG_4o_PRE(7); - TFBIG_4e_PRE(8); - TFBIG_4o_PRE(9); - TFBIG_4e_PRE(10); - TFBIG_4o_PRE(11); - TFBIG_4e_PRE(12); - TFBIG_4o_PRE(13); - TFBIG_4e_PRE(14); - TFBIG_4o_PRE(15); - TFBIG_4e_PRE(16); - TFBIG_4o_PRE(17); - TFBIG_ADDKEY_PRE(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, 18); - - message[10] = message[0] ^ p[0]; - message[11] = message[1] ^ p[1]; - message[12] = message[2] ^ p[2]; - message[13] = message[3] ^ p[3]; - message[14] = message[4] ^ p[4]; - message[15] = message[5] ^ p[5]; - message[16] = message[6] ^ p[6]; - message[17] = message[7] ^ p[7]; - - message[18] = t2; - - uint64_t buffer[128]; - -// buffer[ 0] = message[ 8]; - buffer[ 0] = message[ 9]; - h0 = buffer[ 1] = message[10]; - h1 = buffer[ 2] = message[11]; - h2 = buffer[ 3] = message[12]; - h3 = buffer[ 4] = message[13]; - h4 = buffer[ 5] = message[14]; - h5 = buffer[ 6] = message[15]; - h6 = buffer[ 7] = message[16]; - h7 = buffer[ 8] = message[17]; - h8 = buffer[ 9] = h0^h1^h2^h3^h4^h5^h6^h7^0x1BD11BDAA9FC1A22ULL; - - t0 = 0x50ull; - t1 = 0xB000000000000000ull; - t2 = t0^t1; - - p[0] = message[ 8] + h0; - p[2] = h2; p[3] = h3; p[4] = h4; - p[5] = h5 + t0; p[6] = h6 + t1; p[7] = h7; - p[2] += p[3]; p[4] += p[5]; p[6] += p[7]; - p[3] = ROTL64(p[3], 36) ^ p[2]; - p[5] = ROTL64(p[5], 19) ^ p[4]; - p[7] = ROTL64(p[7], 37) ^ p[6]; - p[4] += p[7]; - p[6] += p[5]; - p[7] = ROTL64(p[7], 27) ^ p[4]; - p[5] = ROTL64(p[5], 14) ^ p[6]; - - buffer[10] = p[0]; - buffer[11] = p[2]; - buffer[12] = p[3]; - buffer[13] = p[4]; - buffer[14] = p[5]; - buffer[15] = p[6]; - buffer[16] = p[7]; - buffer[17] = ROTL64(p[3], 42); - buffer[18] = ROTL64(p[5], 36); - buffer[19] = ROTL64(p[7], 39); - - buffer[20] = h6+t1; - buffer[21] = h8+1; - buffer[22] = h7+t2; - buffer[23] = h0+2; - buffer[24] = h8+t0; - buffer[25] = h1+3; - buffer[26] = h0+t1; - buffer[27] = h2+4; - buffer[28] = h1+t2; - buffer[29] = h3+5; - buffer[30] = h2+t0; - buffer[31] = h4+6; - buffer[32] = h3+t1; - buffer[33] = h5+7; - buffer[34] = h4+t2; - buffer[35] = h6+8; - buffer[36] = h5+t0; - buffer[37] = h7+9; - buffer[38] = h6+t1; - buffer[39] = h8+10; - buffer[40] = h7+t2; - buffer[41] = h0+11; - buffer[42] = h8+t0; - buffer[43] = h1+12; - buffer[44] = h0+t1; - buffer[45] = h2+13; - buffer[46] = h1+t2; - buffer[47] = h3+14; - buffer[48] = h2+t0; - buffer[49] = h4+15; - buffer[50] = h3+t1; - buffer[51] = h5+16; - buffer[52] = h4+t2; - buffer[53] = h6+17; - buffer[54] = h5+t0; - buffer[55] = h7+18; - buffer[56] = h6+t1; - - buffer[57] = message[8]; - - cudaMemcpyToSymbol(c_buffer, buffer, sizeof(c_buffer), 0, cudaMemcpyHostToDevice); - CUDA_SAFE_CALL(cudaGetLastError()); -} - -__host__ -void quark_skein512_cpu_init(int thr_id, uint32_t threads) -{ - cuda_get_arch(thr_id); -} - diff --git a/quark/groestl_functions_quad.h b/quark/groestl_functions_quad.h deleted file mode 100644 index 7688839b..00000000 --- a/quark/groestl_functions_quad.h +++ /dev/null @@ -1,350 +0,0 @@ -#include "cuda_helper.h" - -__device__ __forceinline__ -void G256_Mul2(uint32_t *regs) -{ - uint32_t tmp = regs[7]; - regs[7] = regs[6]; - regs[6] = regs[5]; - regs[5] = regs[4]; - regs[4] = regs[3] ^ tmp; - regs[3] = regs[2] ^ tmp; - regs[2] = regs[1]; - regs[1] = regs[0] ^ tmp; - regs[0] = tmp; -} - -__device__ __forceinline__ -void G256_AddRoundConstantQ_quad(uint32_t &x7, uint32_t &x6, uint32_t &x5, uint32_t &x4, uint32_t &x3, uint32_t &x2, uint32_t &x1, uint32_t &x0, int rnd) -{ - x0 = ~x0; - x1 = ~x1; - x2 = ~x2; - x3 = ~x3; - x4 = ~x4; - x5 = ~x5; - x6 = ~x6; - x7 = ~x7; - -#if 0 - if ((threadIdx.x & 3) != 3) - return; - - int andmask = 0xFFFF0000; -#else - /* from sp: faster (branching problem with if ?) */ - uint32_t andmask = -((threadIdx.x & 3) == 3) & 0xFFFF0000U; -#endif - - x0 ^= ((- (rnd & 0x01) ) & andmask); - x1 ^= ((-((rnd & 0x02)>>1)) & andmask); - x2 ^= ((-((rnd & 0x04)>>2)) & andmask); - x3 ^= ((-((rnd & 0x08)>>3)) & andmask); - - x4 ^= (0xAAAA0000 & andmask); - x5 ^= (0xCCCC0000 & andmask); - x6 ^= (0xF0F00000 & andmask); - x7 ^= (0xFF000000 & andmask); -} - -__device__ __forceinline__ -void G256_AddRoundConstantP_quad(uint32_t &x7, uint32_t &x6, uint32_t &x5, uint32_t &x4, uint32_t &x3, uint32_t &x2, uint32_t &x1, uint32_t &x0, int rnd) -{ - if (threadIdx.x & 3) - return; - - int andmask = 0xFFFF; - - x0 ^= ((- (rnd & 0x01) ) & andmask); - x1 ^= ((-((rnd & 0x02)>>1)) & andmask); - x2 ^= ((-((rnd & 0x04)>>2)) & andmask); - x3 ^= ((-((rnd & 0x08)>>3)) & andmask); - - x4 ^= 0xAAAAU; - x5 ^= 0xCCCCU; - x6 ^= 0xF0F0U; - x7 ^= 0xFF00U; -} - -__device__ __forceinline__ -void G16mul_quad(uint32_t &x3, uint32_t &x2, uint32_t &x1, uint32_t &x0, - uint32_t &y3, uint32_t &y2, uint32_t &y1, uint32_t &y0) -{ - uint32_t t0,t1,t2; - - t0 = ((x2 ^ x0) ^ (x3 ^ x1)) & ((y2 ^ y0) ^ (y3 ^ y1)); - t1 = ((x2 ^ x0) & (y2 ^ y0)) ^ t0; - t2 = ((x3 ^ x1) & (y3 ^ y1)) ^ t0 ^ t1; - - t0 = (x2^x3) & (y2^y3); - x3 = (x3 & y3) ^ t0 ^ t1; - x2 = (x2 & y2) ^ t0 ^ t2; - - t0 = (x0^x1) & (y0^y1); - x1 = (x1 & y1) ^ t0 ^ t1; - x0 = (x0 & y0) ^ t0 ^ t2; -} - -__device__ __forceinline__ -void G256_inv_quad(uint32_t &x7, uint32_t &x6, uint32_t &x5, uint32_t &x4, uint32_t &x3, uint32_t &x2, uint32_t &x1, uint32_t &x0) -{ - uint32_t t0,t1,t2,t3,t4,t5,t6,a,b; - - t3 = x7; - t2 = x6; - t1 = x5; - t0 = x4; - - G16mul_quad(t3, t2, t1, t0, x3, x2, x1, x0); - - a = (x4 ^ x0); - t0 ^= a; - t2 ^= (x7 ^ x3) ^ (x5 ^ x1); - t1 ^= (x5 ^ x1) ^ a; - t3 ^= (x6 ^ x2) ^ a; - - b = t0 ^ t1; - t4 = (t2 ^ t3) & b; - a = t4 ^ t3 ^ t1; - t5 = (t3 & t1) ^ a; - t6 = (t2 & t0) ^ a ^ (t2 ^ t0); - - t4 = (t5 ^ t6) & b; - t1 = (t6 & t1) ^ t4; - t0 = (t5 & t0) ^ t4; - - t4 = (t5 ^ t6) & (t2^t3); - t3 = (t6 & t3) ^ t4; - t2 = (t5 & t2) ^ t4; - - G16mul_quad(x3, x2, x1, x0, t1, t0, t3, t2); - - G16mul_quad(x7, x6, x5, x4, t1, t0, t3, t2); -} - -__device__ __forceinline__ -void transAtoX_quad(uint32_t &x0, uint32_t &x1, uint32_t &x2, uint32_t &x3, uint32_t &x4, uint32_t &x5, uint32_t &x6, uint32_t &x7) -{ - uint32_t t0, t1; - t0 = x0 ^ x1 ^ x2; - t1 = x5 ^ x6; - x2 = t0 ^ t1 ^ x7; - x6 = t0 ^ x3 ^ x6; - x3 = x0 ^ x1 ^ x3 ^ x4 ^ x7; - x4 = x0 ^ x4 ^ t1; - x2 = t0 ^ t1 ^ x7; - x1 = x0 ^ x1 ^ t1; - x7 = x0 ^ t1 ^ x7; - x5 = x0 ^ t1; -} - -__device__ __forceinline__ -void transXtoA_quad(uint32_t &x0, uint32_t &x1, uint32_t &x2, uint32_t &x3, uint32_t &x4, uint32_t &x5, uint32_t &x6, uint32_t &x7) -{ - uint32_t t0,t2,t3,t5; - - x1 ^= x4; - t0 = x1 ^ x6; - x1 ^= x5; - - t2 = x0 ^ x2; - x2 = x3 ^ x5; - t2 ^= x2 ^ x6; - x2 ^= x7; - t3 = x4 ^ x2 ^ x6; - - t5 = x0 ^ x6; - x4 = x3 ^ x7; - x0 = x3 ^ x5; - - x6 = t0; - x3 = t2; - x7 = t3; - x5 = t5; -} - -__device__ __forceinline__ -void sbox_quad(uint32_t *r) -{ - transAtoX_quad(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7]); - - G256_inv_quad(r[2], r[4], r[1], r[7], r[3], r[0], r[5], r[6]); - - transXtoA_quad(r[7], r[1], r[4], r[2], r[6], r[5], r[0], r[3]); - - r[0] = ~r[0]; - r[1] = ~r[1]; - r[5] = ~r[5]; - r[6] = ~r[6]; -} - -__device__ __forceinline__ -void G256_ShiftBytesP_quad(uint32_t &x7, uint32_t &x6, uint32_t &x5, uint32_t &x4, uint32_t &x3, uint32_t &x2, uint32_t &x1, uint32_t &x0) -{ - uint32_t t0,t1; - - int tpos = threadIdx.x & 0x03; - int shift1 = tpos << 1; - int shift2 = shift1+1 + ((tpos == 3)<<2); - - t0 = __byte_perm(x0, 0, 0x1010)>>shift1; - t1 = __byte_perm(x0, 0, 0x3232)>>shift2; - x0 = __byte_perm(t0, t1, 0x5410); - - t0 = __byte_perm(x1, 0, 0x1010)>>shift1; - t1 = __byte_perm(x1, 0, 0x3232)>>shift2; - x1 = __byte_perm(t0, t1, 0x5410); - - t0 = __byte_perm(x2, 0, 0x1010)>>shift1; - t1 = __byte_perm(x2, 0, 0x3232)>>shift2; - x2 = __byte_perm(t0, t1, 0x5410); - - t0 = __byte_perm(x3, 0, 0x1010)>>shift1; - t1 = __byte_perm(x3, 0, 0x3232)>>shift2; - x3 = __byte_perm(t0, t1, 0x5410); - - t0 = __byte_perm(x4, 0, 0x1010)>>shift1; - t1 = __byte_perm(x4, 0, 0x3232)>>shift2; - x4 = __byte_perm(t0, t1, 0x5410); - - t0 = __byte_perm(x5, 0, 0x1010)>>shift1; - t1 = __byte_perm(x5, 0, 0x3232)>>shift2; - x5 = __byte_perm(t0, t1, 0x5410); - - t0 = __byte_perm(x6, 0, 0x1010)>>shift1; - t1 = __byte_perm(x6, 0, 0x3232)>>shift2; - x6 = __byte_perm(t0, t1, 0x5410); - - t0 = __byte_perm(x7, 0, 0x1010)>>shift1; - t1 = __byte_perm(x7, 0, 0x3232)>>shift2; - x7 = __byte_perm(t0, t1, 0x5410); -} - -__device__ __forceinline__ -void G256_ShiftBytesQ_quad(uint32_t &x7, uint32_t &x6, uint32_t &x5, uint32_t &x4, uint32_t &x3, uint32_t &x2, uint32_t &x1, uint32_t &x0) -{ - uint32_t t0,t1; - - int tpos = threadIdx.x & 0x03; - int shift1 = (1-(tpos>>1)) + ((tpos & 0x01)<<2); - int shift2 = shift1+2 + ((tpos == 1)<<2); - - t0 = __byte_perm(x0, 0, 0x1010)>>shift1; - t1 = __byte_perm(x0, 0, 0x3232)>>shift2; - x0 = __byte_perm(t0, t1, 0x5410); - - t0 = __byte_perm(x1, 0, 0x1010)>>shift1; - t1 = __byte_perm(x1, 0, 0x3232)>>shift2; - x1 = __byte_perm(t0, t1, 0x5410); - - t0 = __byte_perm(x2, 0, 0x1010)>>shift1; - t1 = __byte_perm(x2, 0, 0x3232)>>shift2; - x2 = __byte_perm(t0, t1, 0x5410); - - t0 = __byte_perm(x3, 0, 0x1010)>>shift1; - t1 = __byte_perm(x3, 0, 0x3232)>>shift2; - x3 = __byte_perm(t0, t1, 0x5410); - - t0 = __byte_perm(x4, 0, 0x1010)>>shift1; - t1 = __byte_perm(x4, 0, 0x3232)>>shift2; - x4 = __byte_perm(t0, t1, 0x5410); - - t0 = __byte_perm(x5, 0, 0x1010)>>shift1; - t1 = __byte_perm(x5, 0, 0x3232)>>shift2; - x5 = __byte_perm(t0, t1, 0x5410); - - t0 = __byte_perm(x6, 0, 0x1010)>>shift1; - t1 = __byte_perm(x6, 0, 0x3232)>>shift2; - x6 = __byte_perm(t0, t1, 0x5410); - - t0 = __byte_perm(x7, 0, 0x1010)>>shift1; - t1 = __byte_perm(x7, 0, 0x3232)>>shift2; - x7 = __byte_perm(t0, t1, 0x5410); -} - -#if __CUDA_ARCH__ < 300 -/** - * __shfl() returns the value of var held by the thread whose ID is given by srcLane. - * If srcLane is outside the range 0..width-1, the thread’s own value of var is returned. - */ -#undef __shfl -#define __shfl(var, srcLane, width) (uint32_t)(var) -#endif - -__device__ __forceinline__ -void G256_MixFunction_quad(uint32_t *r) -{ -#define SHIFT64_16(hi, lo) __byte_perm(lo, hi, 0x5432) -#define A(v, u) __shfl((int)r[v], ((threadIdx.x+u)&0x03), 4) -#define S(idx, l) SHIFT64_16( A(idx, (l+1)), A(idx, l) ) - -#define DOUBLE_ODD(i, bc) ( S(i, (bc)) ^ A(i, (bc) + 1) ) -#define DOUBLE_EVEN(i, bc) ( S(i, (bc)) ^ A(i, (bc) ) ) - -#define SINGLE_ODD(i, bc) ( S(i, (bc)) ) -#define SINGLE_EVEN(i, bc) ( A(i, (bc)) ) - uint32_t b[8]; - -#pragma unroll 8 - for(int i=0;i<8;i++) - b[i] = DOUBLE_ODD(i, 1) ^ DOUBLE_EVEN(i, 3); - - G256_Mul2(b); -#pragma unroll 8 - for(int i=0;i<8;i++) - b[i] = b[i] ^ DOUBLE_ODD(i, 3) ^ DOUBLE_ODD(i, 4) ^ SINGLE_ODD(i, 6); - - G256_Mul2(b); -#pragma unroll 8 - for(int i=0;i<8;i++) - r[i] = b[i] ^ DOUBLE_EVEN(i, 2) ^ DOUBLE_EVEN(i, 3) ^ SINGLE_EVEN(i, 5); - -#undef S -#undef A -#undef SHIFT64_16 -#undef t -#undef X -} - -__device__ __forceinline__ -void groestl512_perm_P_quad(uint32_t *r) -{ - for(int round=0;round<14;round++) - { - G256_AddRoundConstantP_quad(r[7], r[6], r[5], r[4], r[3], r[2], r[1], r[0], round); - sbox_quad(r); - G256_ShiftBytesP_quad(r[7], r[6], r[5], r[4], r[3], r[2], r[1], r[0]); - G256_MixFunction_quad(r); - } -} - -__device__ __forceinline__ -void groestl512_perm_Q_quad(uint32_t *r) -{ - for(int round=0;round<14;round++) - { - G256_AddRoundConstantQ_quad(r[7], r[6], r[5], r[4], r[3], r[2], r[1], r[0], round); - sbox_quad(r); - G256_ShiftBytesQ_quad(r[7], r[6], r[5], r[4], r[3], r[2], r[1], r[0]); - G256_MixFunction_quad(r); - } -} - -__device__ __forceinline__ -void groestl512_progressMessage_quad(uint32_t *state, uint32_t *message) -{ -#pragma unroll 8 - for(int u=0;u<8;u++) state[u] = message[u]; - - if ((threadIdx.x & 0x03) == 3) state[ 1] ^= 0x00008000; - groestl512_perm_P_quad(state); - if ((threadIdx.x & 0x03) == 3) state[ 1] ^= 0x00008000; - groestl512_perm_Q_quad(message); -#pragma unroll 8 - for(int u=0;u<8;u++) state[u] ^= message[u]; -#pragma unroll 8 - for(int u=0;u<8;u++) message[u] = state[u]; - groestl512_perm_P_quad(message); -#pragma unroll 8 - for(int u=0;u<8;u++) state[u] ^= message[u]; -} diff --git a/quark/groestl_simple.cuh b/quark/groestl_simple.cuh deleted file mode 100644 index f1c7a1f7..00000000 --- a/quark/groestl_simple.cuh +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Simplified groestl512 big perm code - * tpruvot - 2017 - */ - -#ifdef __INTELLISENSE__ -#define __CUDA_ARCH__ 210 -#define __CUDACC__ -#include -#include -#define __byte_perm(a,b,c) (a) -#define tex1Dfetch(t, n) (n) -#endif - -// todo: merge with cuda_quark_groestl512_sm20.cu (used for groestl512-80) - -#if __CUDA_ARCH__ < 300 || defined(_DEBUG) - -#ifndef SPH_C32 -#define SPH_C32(x) ((uint32_t)(x ## U)) -#define SPH_T32(x) ((x) & SPH_C32(0xFFFFFFFF)) -#endif - -#ifndef PC32up -#define PC32up(j, r) ((uint32_t)((j) + (r))) -#define PC32dn(j, r) 0 -#define QC32up(j, r) 0xFFFFFFFF -#define QC32dn(j, r) (((uint32_t)(r) << 24) ^ SPH_T32(~((uint32_t)(j) << 24))) -#endif - -#define tT0up(x) tex1Dfetch(t0up1, x) -#define tT0dn(x) tex1Dfetch(t0dn1, x) -#define tT1up(x) tex1Dfetch(t1up1, x) -#define tT1dn(x) tex1Dfetch(t1dn1, x) -#define tT2up(x) tex1Dfetch(t2up1, x) -#define tT2dn(x) tex1Dfetch(t2dn1, x) -#define tT3up(x) tex1Dfetch(t3up1, x) -#define tT3dn(x) tex1Dfetch(t3dn1, x) - -#undef B32_0 -#define B32_0(x) ((x) & 0xFFu) - -__device__ __forceinline__ -static void tex_groestl512_perm_P(uint32_t *a) -{ - #pragma unroll 1 - for(int r=0; r<14; r++) - { - uint32_t t[32]; - - #pragma unroll 16 - for (int k=0; k<16; k++) - a[(k*2)+0] ^= PC32up(k<< 4, r); - - #pragma unroll 16 - for(int k=0; k<32; k+=2) - { - uint32_t t0_0 = B32_0(a[(k ) & 0x1f]), t9_0 = B32_0(a[(k + 9) & 0x1f]); - uint32_t t2_1 = B32_1(a[(k + 2) & 0x1f]), t11_1 = B32_1(a[(k + 11) & 0x1f]); - uint32_t t4_2 = B32_2(a[(k + 4) & 0x1f]), t13_2 = B32_2(a[(k + 13) & 0x1f]); - uint32_t t6_3 = B32_3(a[(k + 6) & 0x1f]), t23_3 = B32_3(a[(k + 23) & 0x1f]); - - t[k + 0] = tT0up( t0_0 ) ^ tT1up( t2_1 ) ^ tT2up( t4_2 ) ^ tT3up( t6_3 ) ^ - tT0dn( t9_0 ) ^ tT1dn( t11_1 ) ^ tT2dn( t13_2 ) ^ tT3dn( t23_3 ); - - t[k + 1] = tT0dn( t0_0 ) ^ tT1dn( t2_1 ) ^ tT2dn( t4_2 ) ^ tT3dn( t6_3 ) ^ - tT0up( t9_0 ) ^ tT1up( t11_1 ) ^ tT2up( t13_2 ) ^ tT3up( t23_3 ); - } - - #pragma unroll 32 - for(int k=0; k<32; k++) - a[k] = t[k]; - } -} - -__device__ __forceinline__ -static void tex_groestl512_perm_Q(uint32_t *a) -{ - #pragma unroll 1 - for(int r=0; r<14; r++) - { - uint32_t t[32]; - - #pragma unroll 16 - for (int k=0; k<16; k++) { - a[(k*2)+0] ^= QC32up(k<< 4, r); - a[(k*2)+1] ^= QC32dn(k<< 4, r); - } - - #pragma unroll 16 - for(int k=0; k<32; k+=2) - { - uint32_t t2_0 = B32_0(a[(k + 2) & 0x1f]), t1_0 = B32_0(a[(k + 1) & 0x1f]); - uint32_t t6_1 = B32_1(a[(k + 6) & 0x1f]), t5_1 = B32_1(a[(k + 5) & 0x1f]); - uint32_t t10_2 = B32_2(a[(k + 10) & 0x1f]), t9_2 = B32_2(a[(k + 9) & 0x1f]); - uint32_t t22_3 = B32_3(a[(k + 22) & 0x1f]), t13_3 = B32_3(a[(k + 13) & 0x1f]); - - t[k + 0] = tT0up( t2_0 ) ^ tT1up( t6_1 ) ^ tT2up( t10_2 ) ^ tT3up( t22_3 ) ^ - tT0dn( t1_0 ) ^ tT1dn( t5_1 ) ^ tT2dn( t9_2 ) ^ tT3dn( t13_3 ); - - t[k + 1] = tT0dn( t2_0 ) ^ tT1dn( t6_1 ) ^ tT2dn( t10_2 ) ^ tT3dn( t22_3 ) ^ - tT0up( t1_0 ) ^ tT1up( t5_1 ) ^ tT2up( t9_2 ) ^ tT3up( t13_3 ); - } - - #pragma unroll 32 - for(int k=0; k<32; k++) - a[k] = t[k]; - } -} - -#endif diff --git a/quark/groestl_transf_quad.h b/quark/groestl_transf_quad.h deleted file mode 100644 index 545a5e68..00000000 --- a/quark/groestl_transf_quad.h +++ /dev/null @@ -1,133 +0,0 @@ -/* File included in quark/groestl (quark/jha,nist5/X11+) and groest/myriad coins for SM 3+ */ - -#define merge8(z,x,y)\ - z=__byte_perm(x, y, 0x5140); \ - -#define SWAP8(x,y)\ - x=__byte_perm(x, y, 0x5410); \ - y=__byte_perm(x, y, 0x7632); - -#define SWAP4(x,y)\ - t = (y<<4); \ - t = (x ^ t); \ - t = 0xf0f0f0f0UL & t; \ - x = (x ^ t); \ - t= t>>4;\ - y= y ^ t; - -#define SWAP2(x,y)\ - t = (y<<2); \ - t = (x ^ t); \ - t = 0xccccccccUL & t; \ - x = (x ^ t); \ - t= t>>2;\ - y= y ^ t; - -#define SWAP1(x,y)\ - t = (y+y); \ - t = (x ^ t); \ - t = 0xaaaaaaaaUL & t; \ - x = (x ^ t); \ - t= t>>1;\ - y= y ^ t; - - -__device__ __forceinline__ -void to_bitslice_quad(uint32_t *const __restrict__ input, uint32_t *const __restrict__ output) -{ - uint32_t other[8]; - uint32_t d[8]; - uint32_t t; - const unsigned int n = threadIdx.x & 3; - - #pragma unroll - for (int i = 0; i < 8; i++) { - input[i] = __shfl((int)input[i], n ^ (3*(n >=1 && n <=2)), 4); - other[i] = __shfl((int)input[i], (threadIdx.x + 1) & 3, 4); - input[i] = __shfl((int)input[i], threadIdx.x & 2, 4); - other[i] = __shfl((int)other[i], threadIdx.x & 2, 4); - if (threadIdx.x & 1) { - input[i] = __byte_perm(input[i], 0, 0x1032); - other[i] = __byte_perm(other[i], 0, 0x1032); - } - } - - merge8(d[0], input[0], input[4]); - merge8(d[1], other[0], other[4]); - merge8(d[2], input[1], input[5]); - merge8(d[3], other[1], other[5]); - merge8(d[4], input[2], input[6]); - merge8(d[5], other[2], other[6]); - merge8(d[6], input[3], input[7]); - merge8(d[7], other[3], other[7]); - - SWAP1(d[0], d[1]); - SWAP1(d[2], d[3]); - SWAP1(d[4], d[5]); - SWAP1(d[6], d[7]); - - SWAP2(d[0], d[2]); - SWAP2(d[1], d[3]); - SWAP2(d[4], d[6]); - SWAP2(d[5], d[7]); - - SWAP4(d[0], d[4]); - SWAP4(d[1], d[5]); - SWAP4(d[2], d[6]); - SWAP4(d[3], d[7]); - - output[0] = d[0]; - output[1] = d[1]; - output[2] = d[2]; - output[3] = d[3]; - output[4] = d[4]; - output[5] = d[5]; - output[6] = d[6]; - output[7] = d[7]; -} - -__device__ __forceinline__ -void from_bitslice_quad(const uint32_t *const __restrict__ input, uint32_t *const __restrict__ output) -{ - uint32_t d[8]; - uint32_t t; - - d[0] = __byte_perm(input[0], input[4], 0x7531); - d[1] = __byte_perm(input[1], input[5], 0x7531); - d[2] = __byte_perm(input[2], input[6], 0x7531); - d[3] = __byte_perm(input[3], input[7], 0x7531); - - SWAP1(d[0], d[1]); - SWAP1(d[2], d[3]); - - SWAP2(d[0], d[2]); - SWAP2(d[1], d[3]); - - t = __byte_perm(d[0], d[2], 0x5410); - d[2] = __byte_perm(d[0], d[2], 0x7632); - d[0] = t; - - t = __byte_perm(d[1], d[3], 0x5410); - d[3] = __byte_perm(d[1], d[3], 0x7632); - d[1] = t; - - SWAP4(d[0], d[2]); - SWAP4(d[1], d[3]); - - output[0] = d[0]; - output[2] = d[1]; - output[4] = d[0] >> 16; - output[6] = d[1] >> 16; - output[8] = d[2]; - output[10] = d[3]; - output[12] = d[2] >> 16; - output[14] = d[3] >> 16; - - #pragma unroll 8 - for (int i = 0; i < 16; i+=2) { - if (threadIdx.x & 1) output[i] = __byte_perm(output[i], 0, 0x1032); - output[i] = __byte_perm(output[i], __shfl((int)output[i], (threadIdx.x+1)&3, 4), 0x7610); - output[i+1] = __shfl((int)output[i], (threadIdx.x+2)&3, 4); - if (threadIdx.x & 3) output[i] = output[i+1] = 0; - } -} diff --git a/quark/nist5.cu b/quark/nist5.cu deleted file mode 100644 index 25aff743..00000000 --- a/quark/nist5.cu +++ /dev/null @@ -1,184 +0,0 @@ -extern "C" -{ -#include "sph/sph_blake.h" -#include "sph/sph_groestl.h" -#include "sph/sph_skein.h" -#include "sph/sph_jh.h" -#include "sph/sph_keccak.h" -} - -#include "miner.h" - -#include "cuda_helper.h" -#include "quark/cuda_quark.h" - -static uint32_t *d_hash[MAX_GPUS]; - -// Original nist5hash Funktion aus einem miner Quelltext -extern "C" void nist5hash(void *state, const void *input) -{ - sph_blake512_context ctx_blake; - sph_groestl512_context ctx_groestl; - sph_jh512_context ctx_jh; - sph_keccak512_context ctx_keccak; - sph_skein512_context ctx_skein; - - uint8_t hash[64]; - - sph_blake512_init(&ctx_blake); - sph_blake512 (&ctx_blake, input, 80); - sph_blake512_close(&ctx_blake, (void*) hash); - - sph_groestl512_init(&ctx_groestl); - sph_groestl512 (&ctx_groestl, (const void*) hash, 64); - sph_groestl512_close(&ctx_groestl, (void*) hash); - - sph_jh512_init(&ctx_jh); - sph_jh512 (&ctx_jh, (const void*) hash, 64); - sph_jh512_close(&ctx_jh, (void*) hash); - - sph_keccak512_init(&ctx_keccak); - sph_keccak512 (&ctx_keccak, (const void*) hash, 64); - sph_keccak512_close(&ctx_keccak, (void*) hash); - - sph_skein512_init(&ctx_skein); - sph_skein512 (&ctx_skein, (const void*) hash, 64); - sph_skein512_close(&ctx_skein, (void*) hash); - - memcpy(state, hash, 32); -} - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_nist5(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t _ALIGN(64) endiandata[20]; - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - - uint32_t throughput = cuda_default_throughput(thr_id, 1 << 20); // 256*256*16 - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ((uint32_t*)ptarget)[7] = 0x00FF; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - // Constants copy/init (no device alloc in these algos) - quark_blake512_cpu_init(thr_id, throughput); - quark_groestl512_cpu_init(thr_id, throughput); - quark_jh512_cpu_init(thr_id, throughput); - quark_keccak512_cpu_init(thr_id, throughput); - quark_skein512_cpu_init(thr_id, throughput); - - // char[64] work space for hashes results - CUDA_SAFE_CALL(cudaMalloc(&d_hash[thr_id], (size_t)64 * throughput)); - - cuda_check_cpu_init(thr_id, throughput); - init[thr_id] = true; - } - -#ifdef USE_STREAMS - cudaStream_t stream[5]; - for (int i = 0; i < 5; i++) - cudaStreamCreate(&stream[i]); -#endif - - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - quark_blake512_cpu_setBlock_80(thr_id, endiandata); - cuda_check_cpu_setTarget(ptarget); - - work->valid_nonces = 0; - - do { - int order = 0; - - // Hash with CUDA - quark_blake512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - quark_groestl512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_jh512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_keccak512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - - *hashes_done = pdata[19] - first_nonce + throughput; - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - be32enc(&endiandata[19], work->nonces[0]); - nist5hash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - nist5hash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - goto out; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - -out: -// *hashes_done = pdata[19] - first_nonce; -#ifdef USE_STREAMS - for (int i = 0; i < 5; i++) - cudaStreamDestroy(stream[i]); -#endif - - return work->valid_nonces; -} - -// ressources cleanup -extern "C" void free_nist5(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - - quark_blake512_cpu_free(thr_id); - quark_groestl512_cpu_free(thr_id); - cuda_check_cpu_free(thr_id); - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/quark/quarkcoin.cu b/quark/quarkcoin.cu deleted file mode 100644 index 445b1cfe..00000000 --- a/quark/quarkcoin.cu +++ /dev/null @@ -1,339 +0,0 @@ -extern "C" -{ -#include "sph/sph_blake.h" -#include "sph/sph_bmw.h" -#include "sph/sph_groestl.h" -#include "sph/sph_skein.h" -#include "sph/sph_jh.h" -#include "sph/sph_keccak.h" -} - -#include "miner.h" - -#include "cuda_helper.h" -#include "cuda_quark.h" - -#include - -extern uint32_t quark_filter_cpu_sm2(const int thr_id, const uint32_t threads, const uint32_t *inpHashes, uint32_t* d_branch2); -extern void quark_merge_cpu_sm2(const int thr_id, const uint32_t threads, uint32_t *outpHashes, uint32_t* d_branch2); - -static uint32_t *d_hash[MAX_GPUS]; -static uint32_t* d_hash_br2[MAX_GPUS]; // SM 2 - -// Speicher zur Generierung der Noncevektoren für die bedingten Hashes -static uint32_t *d_branch1Nonces[MAX_GPUS]; -static uint32_t *d_branch2Nonces[MAX_GPUS]; -static uint32_t *d_branch3Nonces[MAX_GPUS]; - -// Original Quarkhash Funktion aus einem miner Quelltext -extern "C" void quarkhash(void *state, const void *input) -{ - unsigned char _ALIGN(128) hash[64]; - - sph_blake512_context ctx_blake; - sph_bmw512_context ctx_bmw; - sph_groestl512_context ctx_groestl; - sph_jh512_context ctx_jh; - sph_keccak512_context ctx_keccak; - sph_skein512_context ctx_skein; - - sph_blake512_init(&ctx_blake); - sph_blake512 (&ctx_blake, input, 80); - sph_blake512_close(&ctx_blake, (void*) hash); - - sph_bmw512_init(&ctx_bmw); - sph_bmw512 (&ctx_bmw, (const void*) hash, 64); - sph_bmw512_close(&ctx_bmw, (void*) hash); - - if (hash[0] & 0x8) - { - sph_groestl512_init(&ctx_groestl); - sph_groestl512 (&ctx_groestl, (const void*) hash, 64); - sph_groestl512_close(&ctx_groestl, (void*) hash); - } - else - { - sph_skein512_init(&ctx_skein); - sph_skein512 (&ctx_skein, (const void*) hash, 64); - sph_skein512_close(&ctx_skein, (void*) hash); - } - - sph_groestl512_init(&ctx_groestl); - sph_groestl512 (&ctx_groestl, (const void*) hash, 64); - sph_groestl512_close(&ctx_groestl, (void*) hash); - - sph_jh512_init(&ctx_jh); - sph_jh512 (&ctx_jh, (const void*) hash, 64); - sph_jh512_close(&ctx_jh, (void*) hash); - - if (hash[0] & 0x8) - { - sph_blake512_init(&ctx_blake); - sph_blake512 (&ctx_blake, (const void*) hash, 64); - sph_blake512_close(&ctx_blake, (void*) hash); - } - else - { - sph_bmw512_init(&ctx_bmw); - sph_bmw512 (&ctx_bmw, (const void*) hash, 64); - sph_bmw512_close(&ctx_bmw, (void*) hash); - } - - sph_keccak512_init(&ctx_keccak); - sph_keccak512 (&ctx_keccak, (const void*) hash, 64); - sph_keccak512_close(&ctx_keccak, (void*) hash); - - sph_skein512_init(&ctx_skein); - sph_skein512 (&ctx_skein, (const void*) hash, 64); - sph_skein512_close(&ctx_skein, (void*) hash); - - if (hash[0] & 0x8) - { - sph_keccak512_init(&ctx_keccak); - sph_keccak512 (&ctx_keccak, (const void*) hash, 64); - sph_keccak512_close(&ctx_keccak, (void*) hash); - } - else - { - sph_jh512_init(&ctx_jh); - sph_jh512 (&ctx_jh, (const void*) hash, 64); - sph_jh512_close(&ctx_jh, (void*) hash); - } - - memcpy(state, hash, 32); -} - -#ifdef _DEBUG -#define TRACE(algo) { \ - if (max_nonce == 1 && pdata[19] <= 1) { \ - uint32_t* debugbuf = NULL; \ - cudaMallocHost(&debugbuf, 32); \ - cudaMemcpy(debugbuf, d_hash[thr_id], 32, cudaMemcpyDeviceToHost); \ - printf("quark %s %08x %08x %08x %08x...%08x... \n", algo, swab32(debugbuf[0]), swab32(debugbuf[1]), \ - swab32(debugbuf[2]), swab32(debugbuf[3]), swab32(debugbuf[7])); \ - cudaFreeHost(debugbuf); \ - } \ -} -#else -#define TRACE(algo) {} -#endif - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_quark(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t _ALIGN(64) endiandata[20]; - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - - int dev_id = device_map[thr_id]; - uint32_t def_thr = 1U << 20; // 256*4096 - uint32_t throughput = cuda_default_throughput(thr_id, def_thr); - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ptarget[7] = 0x00F; - - if (!init[thr_id]) - { - cudaSetDevice(dev_id); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - cudaGetLastError(); - CUDA_SAFE_CALL(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput)); - - quark_blake512_cpu_init(thr_id, throughput); - quark_groestl512_cpu_init(thr_id, throughput); - quark_skein512_cpu_init(thr_id, throughput); - quark_bmw512_cpu_init(thr_id, throughput); - quark_keccak512_cpu_init(thr_id, throughput); - quark_jh512_cpu_init(thr_id, throughput); - quark_compactTest_cpu_init(thr_id, throughput); - - if (cuda_arch[dev_id] >= 300) { - cudaMalloc(&d_branch1Nonces[thr_id], sizeof(uint32_t)*throughput); - cudaMalloc(&d_branch2Nonces[thr_id], sizeof(uint32_t)*throughput); - cudaMalloc(&d_branch3Nonces[thr_id], sizeof(uint32_t)*throughput); - } else { - cudaMalloc(&d_hash_br2[thr_id], (size_t) 64 * throughput); - } - - cuda_check_cpu_init(thr_id, throughput); - CUDA_SAFE_CALL(cudaGetLastError()); - - init[thr_id] = true; - } - - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - quark_blake512_cpu_setBlock_80(thr_id, endiandata); - cuda_check_cpu_setTarget(ptarget); - - do { - int order = 0; - uint32_t nrm1=0, nrm2=0, nrm3=0; - - quark_blake512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("blake :"); - quark_bmw512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("bmw :"); - - if (cuda_arch[dev_id] >= 300) { - - quark_compactTest_single_false_cpu_hash_64(thr_id, throughput, pdata[19], d_hash[thr_id], NULL, - d_branch3Nonces[thr_id], &nrm3, order++); - - // nur den Skein Branch weiterverfolgen - quark_skein512_cpu_hash_64(thr_id, nrm3, pdata[19], d_branch3Nonces[thr_id], d_hash[thr_id], order++); - - // das ist der unbedingte Branch für Groestl512 - quark_groestl512_cpu_hash_64(thr_id, nrm3, pdata[19], d_branch3Nonces[thr_id], d_hash[thr_id], order++); - - // das ist der unbedingte Branch für JH512 - quark_jh512_cpu_hash_64(thr_id, nrm3, pdata[19], d_branch3Nonces[thr_id], d_hash[thr_id], order++); - - // quarkNonces in branch1 und branch2 aufsplitten gemäss if (hash[0] & 0x8) - quark_compactTest_cpu_hash_64(thr_id, nrm3, pdata[19], d_hash[thr_id], d_branch3Nonces[thr_id], - d_branch1Nonces[thr_id], &nrm1, - d_branch2Nonces[thr_id], &nrm2, - order++); - - // das ist der bedingte Branch für Blake512 - quark_blake512_cpu_hash_64(thr_id, nrm1, pdata[19], d_branch1Nonces[thr_id], d_hash[thr_id], order++); - - // das ist der bedingte Branch für Bmw512 - quark_bmw512_cpu_hash_64(thr_id, nrm2, pdata[19], d_branch2Nonces[thr_id], d_hash[thr_id], order++); - - // das ist der unbedingte Branch für Keccak512 - quark_keccak512_cpu_hash_64(thr_id, nrm3, pdata[19], d_branch3Nonces[thr_id], d_hash[thr_id], order++); - - // das ist der unbedingte Branch für Skein512 - quark_skein512_cpu_hash_64(thr_id, nrm3, pdata[19], d_branch3Nonces[thr_id], d_hash[thr_id], order++); - - // quarkNonces in branch1 und branch2 aufsplitten gemäss if (hash[0] & 0x8) - quark_compactTest_cpu_hash_64(thr_id, nrm3, pdata[19], d_hash[thr_id], d_branch3Nonces[thr_id], - d_branch1Nonces[thr_id], &nrm1, - d_branch2Nonces[thr_id], &nrm2, - order++); - - quark_keccak512_cpu_hash_64(thr_id, nrm1, pdata[19], d_branch1Nonces[thr_id], d_hash[thr_id], order++); - quark_jh512_cpu_hash_64(thr_id, nrm2, pdata[19], d_branch2Nonces[thr_id], d_hash[thr_id], order++); - - work->nonces[0] = cuda_check_hash_branch(thr_id, nrm3, pdata[19], d_branch3Nonces[thr_id], d_hash[thr_id], order++); - work->nonces[1] = 0; - } else { - /* algo permutations are made with 2 different buffers */ - - quark_filter_cpu_sm2(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - quark_groestl512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash_br2[thr_id], order++); - quark_merge_cpu_sm2(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - TRACE("perm1 :"); - - quark_groestl512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("groestl:"); - quark_jh512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("jh512 :"); - - quark_filter_cpu_sm2(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - quark_blake512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_bmw512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash_br2[thr_id], order++); - quark_merge_cpu_sm2(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - TRACE("perm2 :"); - - quark_keccak512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("keccak :"); - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("skein :"); - - quark_filter_cpu_sm2(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - quark_keccak512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_jh512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash_br2[thr_id], order++); - quark_merge_cpu_sm2(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - TRACE("perm3 :"); - - CUDA_LOG_ERROR(); - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - } - - *hashes_done = pdata[19] - first_nonce + throughput; - - if (work->nonces[0] != UINT32_MAX) - { - uint32_t _ALIGN(64) vhash[8]; - be32enc(&endiandata[19], work->nonces[0]); - quarkhash(vhash, endiandata); - - if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - quarkhash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > ptarget[7]) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - return 0; -} - -// cleanup -extern "C" void free_quark(int thr_id) -{ - int dev_id = device_map[thr_id]; - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - - if (cuda_arch[dev_id] >= 300) { - cudaFree(d_branch1Nonces[thr_id]); - cudaFree(d_branch2Nonces[thr_id]); - cudaFree(d_branch3Nonces[thr_id]); - } else { - cudaFree(d_hash_br2[thr_id]); - } - - quark_blake512_cpu_free(thr_id); - quark_groestl512_cpu_free(thr_id); - quark_compactTest_cpu_free(thr_id); - - cuda_check_cpu_free(thr_id); - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/qubit/deep.cu b/qubit/deep.cu deleted file mode 100644 index 0de2a9ce..00000000 --- a/qubit/deep.cu +++ /dev/null @@ -1,157 +0,0 @@ -/* - * deepcoin algorithm - * - */ -extern "C" { -#include "sph/sph_luffa.h" -#include "sph/sph_cubehash.h" -#include "sph/sph_shavite.h" -#include "sph/sph_simd.h" -#include "sph/sph_echo.h" -} - -#include "miner.h" - -#include "cuda_helper.h" -#include "x11/cuda_x11.h" - -static uint32_t *d_hash[MAX_GPUS]; - -extern void qubit_luffa512_cpu_init(int thr_id, uint32_t threads); -extern void qubit_luffa512_cpu_setBlock_80(void *pdata); -extern void qubit_luffa512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, int order); - -extern "C" void deephash(void *state, const void *input) -{ - uint8_t _ALIGN(64) hash[64]; - - // luffa-80 cubehash-64 echo-64 - sph_luffa512_context ctx_luffa; - sph_cubehash512_context ctx_cubehash; - sph_echo512_context ctx_echo; - - sph_luffa512_init(&ctx_luffa); - sph_luffa512 (&ctx_luffa, input, 80); - sph_luffa512_close(&ctx_luffa, (void*) hash); - - sph_cubehash512_init(&ctx_cubehash); - sph_cubehash512 (&ctx_cubehash, (const void*) hash, 64); - sph_cubehash512_close(&ctx_cubehash, (void*) hash); - - sph_echo512_init(&ctx_echo); - sph_echo512 (&ctx_echo, (const void*) hash, 64); - sph_echo512_close(&ctx_echo, (void*) hash); - - memcpy(state, hash, 32); -} - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_deep(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t _ALIGN(64) endiandata[20]; - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - uint32_t throughput = cuda_default_throughput(thr_id, 1U << 19); // 256*256*8 - if (init[thr_id]) throughput = min(throughput, (max_nonce - first_nonce)); - - if (opt_benchmark) - ((uint32_t*)ptarget)[7] = 0x0000f; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - CUDA_SAFE_CALL(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput)); - - qubit_luffa512_cpu_init(thr_id, throughput); - x11_cubehash512_cpu_init(thr_id, throughput); - x11_echo512_cpu_init(thr_id, throughput); - - cuda_check_cpu_init(thr_id, throughput); - - init[thr_id] = true; - } - - for (int k=0; k < 19; k++) - be32enc(&endiandata[k], pdata[k]); - - qubit_luffa512_cpu_setBlock_80((void*)endiandata); - cuda_check_cpu_setTarget(ptarget); - - do { - int order = 0; - - qubit_luffa512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - x11_cubehash512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - - *hashes_done = pdata[19] - first_nonce + throughput; - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - be32enc(&endiandata[19], work->nonces[0]); - deephash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - deephash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t)throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce + 1; - return 0; -} - -// cleanup -extern "C" void free_deep(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - - cuda_check_cpu_free(thr_id); - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/qubit/luffa.cu b/qubit/luffa.cu deleted file mode 100644 index 057dbada..00000000 --- a/qubit/luffa.cu +++ /dev/null @@ -1,133 +0,0 @@ -/* - * luffa 80 algo (Introduced by Doomcoin) - */ -extern "C" { -#include "sph/sph_luffa.h" -} - -#include "miner.h" - -#include "cuda_helper.h" - -static uint32_t *d_hash[MAX_GPUS]; - -extern void qubit_luffa512_cpu_init(int thr_id, uint32_t threads); -extern void qubit_luffa512_cpu_setBlock_80(void *pdata); -extern void qubit_luffa512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, int order); - -extern "C" void luffa_hash(void *state, const void *input) -{ - uint8_t _ALIGN(64) hash[64]; - - sph_luffa512_context ctx_luffa; - - sph_luffa512_init(&ctx_luffa); - sph_luffa512 (&ctx_luffa, input, 80); - sph_luffa512_close(&ctx_luffa, (void*) hash); - - memcpy(state, hash, 32); -} - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_luffa(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t _ALIGN(64) endiandata[20]; - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - uint32_t throughput = cuda_default_throughput(thr_id, 1U << 21); - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ptarget[7] = 0x0000f; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - CUDA_SAFE_CALL(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput)); - - qubit_luffa512_cpu_init(thr_id, throughput); - cuda_check_cpu_init(thr_id, throughput); - - init[thr_id] = true; - } - - for (int k=0; k < 19; k++) - be32enc(&endiandata[k], pdata[k]); - - qubit_luffa512_cpu_setBlock_80((void*)endiandata); - cuda_check_cpu_setTarget(ptarget); - - do { - qubit_luffa512_cpu_hash_80(thr_id, (int) throughput, pdata[19], d_hash[thr_id], 0); - - *hashes_done = pdata[19] - first_nonce + throughput; - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - be32enc(&endiandata[19], work->nonces[0]); - luffa_hash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - luffa_hash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t)throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - return 0; -} - -// cleanup -extern "C" void free_luffa(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - - cuda_check_cpu_free(thr_id); - - init[thr_id] = false; - cudaDeviceSynchronize(); -} diff --git a/qubit/qubit.cu b/qubit/qubit.cu deleted file mode 100644 index 9520ea36..00000000 --- a/qubit/qubit.cu +++ /dev/null @@ -1,175 +0,0 @@ -/* - * qubit algorithm - * - */ -extern "C" { -#include "sph/sph_luffa.h" -#include "sph/sph_cubehash.h" -#include "sph/sph_shavite.h" -#include "sph/sph_simd.h" -#include "sph/sph_echo.h" -} - -#include "miner.h" - -#include "cuda_helper.h" -#include "x11/cuda_x11.h" - -static uint32_t *d_hash[MAX_GPUS]; - -extern void qubit_luffa512_cpu_init(int thr_id, uint32_t threads); -extern void qubit_luffa512_cpu_setBlock_80(void *pdata); -extern void qubit_luffa512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, int order); - -extern "C" void qubithash(void *state, const void *input) -{ - uint8_t _ALIGN(128) hash[64]; - - // luffa1-cubehash2-shavite3-simd4-echo5 - - sph_luffa512_context ctx_luffa; - sph_cubehash512_context ctx_cubehash; - sph_shavite512_context ctx_shavite; - sph_simd512_context ctx_simd; - sph_echo512_context ctx_echo; - - sph_luffa512_init(&ctx_luffa); - sph_luffa512 (&ctx_luffa, input, 80); - sph_luffa512_close(&ctx_luffa, (void*) hash); - - sph_cubehash512_init(&ctx_cubehash); - sph_cubehash512 (&ctx_cubehash, (const void*) hash, 64); - sph_cubehash512_close(&ctx_cubehash, (void*) hash); - - sph_shavite512_init(&ctx_shavite); - sph_shavite512 (&ctx_shavite, (const void*) hash, 64); - sph_shavite512_close(&ctx_shavite, (void*) hash); - - sph_simd512_init(&ctx_simd); - sph_simd512 (&ctx_simd, (const void*) hash, 64); - sph_simd512_close(&ctx_simd, (void*) hash); - - sph_echo512_init(&ctx_echo); - sph_echo512 (&ctx_echo, (const void*) hash, 64); - sph_echo512_close(&ctx_echo, (void*) hash); - - memcpy(state, hash, 32); -} - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_qubit(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t _ALIGN(64) endiandata[20]; - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - uint32_t throughput = cuda_default_throughput(thr_id, 1U << 19); // 256*256*8 - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ptarget[7] = 0x007f; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - qubit_luffa512_cpu_init(thr_id, throughput); - x11_cubehash512_cpu_init(thr_id, throughput); - x11_shavite512_cpu_init(thr_id, throughput); - x11_simd512_cpu_init(thr_id, throughput); - x11_echo512_cpu_init(thr_id, throughput); - - CUDA_CALL_OR_RET_X(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput), 0); - - cuda_check_cpu_init(thr_id, throughput); - - init[thr_id] = true; - } - - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - qubit_luffa512_cpu_setBlock_80((void*)endiandata); - cuda_check_cpu_setTarget(ptarget); - - do { - int order = 0; - - // Hash with CUDA - qubit_luffa512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - x11_cubehash512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_shavite512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_simd512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - - *hashes_done = pdata[19] - first_nonce + throughput; - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - be32enc(&endiandata[19], work->nonces[0]); - qubithash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - qubithash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - return 0; -} - -// cleanup -extern "C" void free_qubit(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - - x11_simd512_cpu_free(thr_id); - - cuda_check_cpu_free(thr_id); - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/qubit/qubit_luffa512.cu b/qubit/qubit_luffa512.cu deleted file mode 100644 index 57584ee6..00000000 --- a/qubit/qubit_luffa512.cu +++ /dev/null @@ -1,516 +0,0 @@ -/******************************************************************************* - * luffa512 for 80-bytes input (with midstate precalc by klausT) - */ - -#include -#include -#include - -#include "cuda_helper.h" - -static __constant__ uint64_t c_PaddedMessage80[16]; // padded message (80 bytes + padding) -static __constant__ uint32_t statebufferpre[8]; -static __constant__ uint32_t statechainvpre[40]; - -#define MULT2(a,j) {\ - tmp = a[7+(8*j)];\ - a[7+(8*j)] = a[6+(8*j)];\ - a[6+(8*j)] = a[5+(8*j)];\ - a[5+(8*j)] = a[4+(8*j)];\ - a[4+(8*j)] = a[3+(8*j)] ^ tmp;\ - a[3+(8*j)] = a[2+(8*j)] ^ tmp;\ - a[2+(8*j)] = a[1+(8*j)];\ - a[1+(8*j)] = a[0+(8*j)] ^ tmp;\ - a[0+(8*j)] = tmp;\ -} - -#define TWEAK(a0,a1,a2,a3,j) { \ - a0 = (a0<<(j))|(a0>>(32-j));\ - a1 = (a1<<(j))|(a1>>(32-j));\ - a2 = (a2<<(j))|(a2>>(32-j));\ - a3 = (a3<<(j))|(a3>>(32-j));\ -} - -#define STEP(c0,c1) { \ - SUBCRUMB(chainv[0],chainv[1],chainv[2],chainv[3],tmp);\ - SUBCRUMB(chainv[5],chainv[6],chainv[7],chainv[4],tmp);\ - MIXWORD(chainv[0],chainv[4]);\ - MIXWORD(chainv[1],chainv[5]);\ - MIXWORD(chainv[2],chainv[6]);\ - MIXWORD(chainv[3],chainv[7]);\ - ADD_CONSTANT(chainv[0],chainv[4],c0,c1);\ -} - -#define SUBCRUMB(a0,a1,a2,a3,a4)\ - a4 = a0;\ - a0 |= a1;\ - a2 ^= a3;\ - a1 = ~a1;\ - a0 ^= a3;\ - a3 &= a4;\ - a1 ^= a3;\ - a3 ^= a2;\ - a2 &= a0;\ - a0 = ~a0;\ - a2 ^= a1;\ - a1 |= a3;\ - a4 ^= a1;\ - a3 ^= a2;\ - a2 &= a1;\ - a1 ^= a0;\ - a0 = a4; - -#define MIXWORD(a0,a4)\ - a4 ^= a0;\ - a0 = (a0<<2) | (a0>>(30));\ - a0 ^= a4;\ - a4 = (a4<<14) | (a4>>(18));\ - a4 ^= a0;\ - a0 = (a0<<10) | (a0>>(22));\ - a0 ^= a4;\ - a4 = (a4<<1) | (a4>>(31)); - -#define ADD_CONSTANT(a0,b0,c0,c1)\ - a0 ^= c0;\ - b0 ^= c1; - -/* initial values of chaining variables */ -__constant__ uint32_t c_IV[40]; -static const uint32_t h_IV[40] = { - 0x6d251e69,0x44b051e0,0x4eaa6fb4,0xdbf78465, - 0x6e292011,0x90152df4,0xee058139,0xdef610bb, - 0xc3b44b95,0xd9d2f256,0x70eee9a0,0xde099fa3, - 0x5d9b0557,0x8fc944b3,0xcf1ccf0e,0x746cd581, - 0xf7efc89d,0x5dba5781,0x04016ce5,0xad659c05, - 0x0306194f,0x666d1836,0x24aa230a,0x8b264ae7, - 0x858075d5,0x36d79cce,0xe571f7d7,0x204b1f67, - 0x35870c6a,0x57e9e923,0x14bcb808,0x7cde72ce, - 0x6c68e9be,0x5ec41e22,0xc825b7c7,0xaffb4363, - 0xf5df3999,0x0fc688f1,0xb07224cc,0x03e86cea}; - -__constant__ uint32_t c_CNS[80]; -static const uint32_t h_CNS[80] = { - 0x303994a6,0xe0337818,0xc0e65299,0x441ba90d, - 0x6cc33a12,0x7f34d442,0xdc56983e,0x9389217f, - 0x1e00108f,0xe5a8bce6,0x7800423d,0x5274baf4, - 0x8f5b7882,0x26889ba7,0x96e1db12,0x9a226e9d, - 0xb6de10ed,0x01685f3d,0x70f47aae,0x05a17cf4, - 0x0707a3d4,0xbd09caca,0x1c1e8f51,0xf4272b28, - 0x707a3d45,0x144ae5cc,0xaeb28562,0xfaa7ae2b, - 0xbaca1589,0x2e48f1c1,0x40a46f3e,0xb923c704, - 0xfc20d9d2,0xe25e72c1,0x34552e25,0xe623bb72, - 0x7ad8818f,0x5c58a4a4,0x8438764a,0x1e38e2e7, - 0xbb6de032,0x78e38b9d,0xedb780c8,0x27586719, - 0xd9847356,0x36eda57f,0xa2c78434,0x703aace7, - 0xb213afa5,0xe028c9bf,0xc84ebe95,0x44756f91, - 0x4e608a22,0x7e8fce32,0x56d858fe,0x956548be, - 0x343b138f,0xfe191be2,0xd0ec4e3d,0x3cb226e5, - 0x2ceb4882,0x5944a28e,0xb3ad2208,0xa1c4c355, - 0xf0d2e9e3,0x5090d577,0xac11d7fa,0x2d1925ab, - 0x1bcb66f2,0xb46496ac,0x6f2d9bc9,0xd1925ab0, - 0x78602649,0x29131ab6,0x8edae952,0x0fc053c3, - 0x3b6ba548,0x3f014f0c,0xedae9520,0xfc053c31}; - - -/***************************************************/ -__device__ __forceinline__ -void rnd512(uint32_t *statebuffer, uint32_t *statechainv) -{ - int i,j; - uint32_t t[40]; - uint32_t chainv[8]; - uint32_t tmp; - - #pragma unroll 8 - for(i=0; i<8; i++) { - t[i]=0; - #pragma unroll 5 - for(j=0; j<5; j++) - t[i] ^= statechainv[i+8*j]; - } - - MULT2(t, 0); - - #pragma unroll 5 - for(j=0; j<5; j++) { - #pragma unroll 8 - for(i=0; i<8; i++) - statechainv[i+8*j] ^= t[i]; - } - - #pragma unroll 5 - for(j=0; j<5; j++) { - #pragma unroll 8 - for(i=0; i<8; i++) - t[i+8*j] = statechainv[i+8*j]; - } - - #pragma unroll - for(j=0; j<5; j++) - MULT2(statechainv, j); - - #pragma unroll 5 - for(j=0; j<5; j++) { - #pragma unroll 8 - for(i=0; i<8; i++) - statechainv[8*j+i] ^= t[8*((j+1)%5)+i]; - } - - #pragma unroll 5 - for(j=0; j<5; j++) { - #pragma unroll 8 - for(i=0; i<8; i++) - t[i+8*j] = statechainv[i+8*j]; - } - - #pragma unroll - for(j=0; j<5; j++) - MULT2(statechainv, j); - - #pragma unroll 5 - for(j=0; j<5; j++) { - #pragma unroll 8 - for(i=0; i<8; i++) - statechainv[8*j+i] ^= t[8*((j+4)%5)+i]; - } - - #pragma unroll 5 - for(j=0; j<5; j++) { - #pragma unroll 8 - for(i=0; i<8; i++) - statechainv[i+8*j] ^= statebuffer[i]; - MULT2(statebuffer, 0); - } - - #pragma unroll - for(i=0; i<8; i++) - chainv[i] = statechainv[i]; - - #pragma unroll - for(i=0; i<8; i++) - STEP(c_CNS[(2*i)], c_CNS[(2*i)+1]); - - #pragma unroll - for(i=0; i<8; i++) { - statechainv[i] = chainv[i]; - chainv[i] = statechainv[i+8]; - } - - TWEAK(chainv[4],chainv[5],chainv[6],chainv[7],1); - - #pragma unroll - for(i=0; i<8; i++) - STEP(c_CNS[(2*i)+16], c_CNS[(2*i)+16+1]); - - #pragma unroll - for(i=0; i<8; i++) { - statechainv[i+8] = chainv[i]; - chainv[i] = statechainv[i+16]; - } - - TWEAK(chainv[4],chainv[5],chainv[6],chainv[7],2); - - #pragma unroll - for(i=0; i<8; i++) - STEP(c_CNS[(2*i)+32],c_CNS[(2*i)+32+1]); - - #pragma unroll - for(i=0; i<8; i++) { - statechainv[i+16] = chainv[i]; - chainv[i] = statechainv[i+24]; - } - - TWEAK(chainv[4],chainv[5],chainv[6],chainv[7],3); - - #pragma unroll - for(i=0; i<8; i++) - STEP(c_CNS[(2*i)+48],c_CNS[(2*i)+48+1]); - - #pragma unroll - for(i=0; i<8; i++) { - statechainv[i+24] = chainv[i]; - chainv[i] = statechainv[i+32]; - } - - TWEAK(chainv[4],chainv[5],chainv[6],chainv[7],4); - - #pragma unroll - for(i=0; i<8; i++) - STEP(c_CNS[(2*i)+64],c_CNS[(2*i)+64+1]); - - #pragma unroll 8 - for(i=0; i<8; i++) - statechainv[i+32] = chainv[i]; -} - -static void rnd512_cpu(uint32_t *statebuffer, uint32_t *statechainv) -{ - int i, j; - uint32_t t[40]; - uint32_t chainv[8]; - uint32_t tmp; - - for (i = 0; i<8; i++) { - t[i] = statechainv[i]; - for (j = 1; j<5; j++) - t[i] ^= statechainv[i + 8 * j]; - } - - MULT2(t, 0); - - for (j = 0; j<5; j++) { - for (i = 0; i<8; i++) - statechainv[i + 8 * j] ^= t[i]; - } - - for (j = 0; j<5; j++) { - for (i = 0; i<8; i++) - t[i + 8 * j] = statechainv[i + 8 * j]; - } - - for (j = 0; j<5; j++) - MULT2(statechainv, j); - - for (j = 0; j<5; j++) { - for (i = 0; i<8; i++) - statechainv[8 * j + i] ^= t[8 * ((j + 1) % 5) + i]; - } - - for (j = 0; j<5; j++) { - for (i = 0; i<8; i++) - t[i + 8 * j] = statechainv[i + 8 * j]; - } - - for (j = 0; j<5; j++) - MULT2(statechainv, j); - - for (j = 0; j<5; j++) { - for (i = 0; i<8; i++) - statechainv[8 * j + i] ^= t[8 * ((j + 4) % 5) + i]; - } - - for (j = 0; j<5; j++) { - for (i = 0; i<8; i++) - statechainv[i + 8 * j] ^= statebuffer[i]; - MULT2(statebuffer, 0); - } - - for (i = 0; i<8; i++) - chainv[i] = statechainv[i]; - - for (i = 0; i<8; i++) - STEP(h_CNS[(2 * i)], h_CNS[(2 * i) + 1]); - - for (i = 0; i<8; i++) { - statechainv[i] = chainv[i]; - chainv[i] = statechainv[i + 8]; - } - - TWEAK(chainv[4], chainv[5], chainv[6], chainv[7], 1); - - for (i = 0; i<8; i++) - STEP(h_CNS[(2 * i) + 16], h_CNS[(2 * i) + 16 + 1]); - - for (i = 0; i<8; i++) { - statechainv[i + 8] = chainv[i]; - chainv[i] = statechainv[i + 16]; - } - - TWEAK(chainv[4], chainv[5], chainv[6], chainv[7], 2); - - for (i = 0; i<8; i++) - STEP(h_CNS[(2 * i) + 32], h_CNS[(2 * i) + 32 + 1]); - - for (i = 0; i<8; i++) { - statechainv[i + 16] = chainv[i]; - chainv[i] = statechainv[i + 24]; - } - - TWEAK(chainv[4], chainv[5], chainv[6], chainv[7], 3); - - for (i = 0; i<8; i++) - STEP(h_CNS[(2 * i) + 48], h_CNS[(2 * i) + 48 + 1]); - - for (i = 0; i<8; i++) { - statechainv[i + 24] = chainv[i]; - chainv[i] = statechainv[i + 32]; - } - - TWEAK(chainv[4], chainv[5], chainv[6], chainv[7], 4); - - for (i = 0; i<8; i++) - STEP(h_CNS[(2 * i) + 64], h_CNS[(2 * i) + 64 + 1]); - - for (i = 0; i<8; i++) - statechainv[i + 32] = chainv[i]; -} - -/***************************************************/ -__device__ __forceinline__ -void Update512(uint32_t* statebuffer, uint32_t *statechainv, const uint32_t *const __restrict__ data) -{ - #pragma unroll - for (int i = 0; i<8; i++) - statebuffer[i] = cuda_swab32((data[i])); - rnd512(statebuffer, statechainv); - - #pragma unroll - for(int i=0; i<8; i++) - statebuffer[i] = cuda_swab32((data[i+8])); - rnd512(statebuffer, statechainv); - - #pragma unroll - for(int i=0; i<4; i++) - statebuffer[i] = cuda_swab32((data[i+16])); -} - - -/***************************************************/ -__device__ __forceinline__ -void finalization512(uint32_t* statebuffer, uint32_t *statechainv, uint32_t *b) -{ - int i,j; - - statebuffer[4] = 0x80000000U; - - #pragma unroll 3 - for(int i=5; i<8; i++) - statebuffer[i] = 0; - rnd512(statebuffer, statechainv); - - /*---- blank round with m=0 ----*/ - #pragma unroll - for(i=0; i<8; i++) - statebuffer[i] =0; - rnd512(statebuffer, statechainv); - - #pragma unroll - for(i=0; i<8; i++) { - b[i] = 0; - #pragma unroll 5 - for(j=0; j<5; j++) - b[i] ^= statechainv[i+8*j]; - b[i] = cuda_swab32((b[i])); - } - - #pragma unroll - for(i=0; i<8; i++) - statebuffer[i]=0; - rnd512(statebuffer, statechainv); - - #pragma unroll - for(i=0; i<8; i++) - { - b[8+i] = 0; - #pragma unroll 5 - for(j=0; j<5; j++) - b[8+i] ^= statechainv[i+8*j]; - b[8+i] = cuda_swab32((b[8+i])); - } -} - - -/***************************************************/ -__global__ -void qubit_luffa512_gpu_hash_80(uint32_t threads, uint32_t startNounce, uint32_t *outputHash) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t nounce = startNounce + thread; - union { - uint64_t buf64[16]; - uint32_t buf32[32]; - } buff; - - #pragma unroll 8 - for (int i=8; i < 16; i++) - buff.buf64[i] = c_PaddedMessage80[i]; - - // die Nounce durch die thread-spezifische ersetzen - buff.buf64[9] = REPLACE_HIDWORD(buff.buf64[9], cuda_swab32(nounce)); - - uint32_t statebuffer[8], statechainv[40]; - - #pragma unroll - for (int i = 0; i<4; i++) - statebuffer[i] = cuda_swab32(buff.buf32[i + 16]); - - #pragma unroll 4 - for (int i = 4; i<8; i++) - statebuffer[i] = statebufferpre[i]; - - #pragma unroll - for (int i = 0; i<40; i++) - statechainv[i] = statechainvpre[i]; - - uint32_t *outHash = &outputHash[thread * 16]; - finalization512(statebuffer, statechainv, outHash); - } -} - -__host__ -void qubit_luffa512_cpu_init(int thr_id, uint32_t threads) -{ - CUDA_SAFE_CALL(cudaMemcpyToSymbol(c_IV, h_IV, sizeof(h_IV), 0, cudaMemcpyHostToDevice)); - CUDA_SAFE_CALL(cudaMemcpyToSymbol(c_CNS, h_CNS, sizeof(h_CNS), 0, cudaMemcpyHostToDevice)); -} - -__host__ -void qubit_luffa512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_outputHash,int order) -{ - const uint32_t threadsperblock = 256; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - size_t shared_size = 0; - - qubit_luffa512_gpu_hash_80 <<>> (threads, startNounce, d_outputHash); -} - -__host__ -static void qubit_cpu_precalc(uint32_t* message) -{ - uint32_t statebuffer[8]; - uint32_t statechainv[40] = - { - 0x6d251e69, 0x44b051e0, 0x4eaa6fb4, 0xdbf78465, - 0x6e292011, 0x90152df4, 0xee058139, 0xdef610bb, - 0xc3b44b95, 0xd9d2f256, 0x70eee9a0, 0xde099fa3, - 0x5d9b0557, 0x8fc944b3, 0xcf1ccf0e, 0x746cd581, - 0xf7efc89d, 0x5dba5781, 0x04016ce5, 0xad659c05, - 0x0306194f, 0x666d1836, 0x24aa230a, 0x8b264ae7, - 0x858075d5, 0x36d79cce, 0xe571f7d7, 0x204b1f67, - 0x35870c6a, 0x57e9e923, 0x14bcb808, 0x7cde72ce, - 0x6c68e9be, 0x5ec41e22, 0xc825b7c7, 0xaffb4363, - 0xf5df3999, 0x0fc688f1, 0xb07224cc, 0x03e86cea - }; - - for (int i = 0; i<8; i++) - statebuffer[i] = cuda_swab32(message[i]); - rnd512_cpu(statebuffer, statechainv); - - for (int i = 0; i<8; i++) - statebuffer[i] = cuda_swab32(message[i+8]); - - rnd512_cpu(statebuffer, statechainv); - - cudaMemcpyToSymbol(statebufferpre, statebuffer, sizeof(statebuffer), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(statechainvpre, statechainv, sizeof(statechainv), 0, cudaMemcpyHostToDevice); -} - -__host__ -void qubit_luffa512_cpu_setBlock_80(void *pdata) -{ - unsigned char PaddedMessage[128]; - - memcpy(PaddedMessage, pdata, 80); - memset(PaddedMessage+80, 0, 48); - PaddedMessage[80] = 0x80; - PaddedMessage[111] = 1; - PaddedMessage[126] = 0x02; - PaddedMessage[127] = 0x80; - - CUDA_SAFE_CALL(cudaMemcpyToSymbol(c_PaddedMessage80, PaddedMessage, sizeof(PaddedMessage), 0, cudaMemcpyHostToDevice)); - qubit_cpu_precalc((uint32_t*) PaddedMessage); -} diff --git a/qubit/qubit_luffa512_alexis.cu b/qubit/qubit_luffa512_alexis.cu deleted file mode 100644 index 085ba399..00000000 --- a/qubit/qubit_luffa512_alexis.cu +++ /dev/null @@ -1,841 +0,0 @@ -/******************************************************************************* - * luffa512 for 80-bytes input (with midstate precalc based on the work of klausT and SP) - */ - -#include -#include "cuda_helper.h" -#include "cuda_vectors_alexis.h" - -static unsigned char PaddedMessage[128]; -__constant__ uint64_t c_PaddedMessage80[10]; // padded message (80 bytes + padding) -__constant__ uint32_t _ALIGN(8) statebufferpre[8]; -__constant__ uint32_t _ALIGN(8) statechainvpre[40]; - -#define MULT0(a) {\ - tmp = a[7]; \ - a[7] = a[6]; \ - a[6] = a[5]; \ - a[5] = a[4]; \ - a[4] = a[3] ^ tmp; \ - a[3] = a[2] ^ tmp; \ - a[2] = a[1]; \ - a[1] = a[0] ^ tmp; \ - a[0] = tmp; \ -} - -#define MULT2(a,j) {\ - tmp = a[7+(8*j)];\ - a[7+(8*j)] = a[6+(8*j)];\ - a[6+(8*j)] = a[5+(8*j)];\ - a[5+(8*j)] = a[4+(8*j)];\ - a[4+(8*j)] = a[3+(8*j)] ^ tmp;\ - a[3+(8*j)] = a[2+(8*j)] ^ tmp;\ - a[2+(8*j)] = a[1+(8*j)];\ - a[1+(8*j)] = a[0+(8*j)] ^ tmp;\ - a[0+(8*j)] = tmp;\ -} - -#define TWEAK(a0,a1,a2,a3,j)\ - a0 = ROTL32(a0,j);\ - a1 = ROTL32(a1,j);\ - a2 = ROTL32(a2,j);\ - a3 = ROTL32(a3,j); - -#define STEP(c0,c1) {\ -\ - uint32_t temp[ 2];\ - temp[ 0] = chainv[0];\ - temp[ 1] = chainv[ 5];\ - chainv[ 2] ^= chainv[ 3];\ - chainv[ 7] ^= chainv[ 4];\ - chainv[ 0] |= chainv[ 1];\ - chainv[ 5] |= chainv[ 6];\ - chainv[ 1] = ~chainv[ 1];\ - chainv[ 6] = ~chainv[ 6];\ - chainv[ 0] ^= chainv[ 3];\ - chainv[ 5] ^= chainv[ 4];\ - chainv[ 3] &= temp[ 0];\ - chainv[ 4] &= temp[ 1];\ - chainv[ 1] ^= chainv[ 3];\ - chainv[ 6] ^= chainv[ 4];\ - chainv[ 3] ^= chainv[ 2];\ - chainv[ 4] ^= chainv[ 7];\ - chainv[ 2] &= chainv[ 0];\ - chainv[ 7] &= chainv[ 5];\ - chainv[ 0] = ~chainv[ 0];\ - chainv[ 5] = ~chainv[ 5];\ - chainv[ 2] ^= chainv[ 1];\ - chainv[ 7] ^= chainv[ 6];\ - chainv[ 1] |= chainv[ 3];\ - chainv[ 6] |= chainv[ 4];\ - temp[ 0] ^= chainv[ 1];\ - temp[ 1] ^= chainv[ 6];\ - chainv[ 3] ^= chainv[ 2];\ - chainv[ 4] ^= chainv[ 7] ^ temp[ 0];\ - chainv[ 2] &= chainv[ 1];\ - chainv[ 7] = (chainv[ 7] & chainv[ 6]) ^ chainv[ 3];\ - chainv[ 1] ^= chainv[ 0];\ - chainv[ 6] ^= chainv[ 5] ^ chainv[ 2];\ - chainv[ 5] = chainv[ 1] ^ temp[ 1];\ - chainv[ 0] = chainv[ 4] ^ ROTL32(temp[ 0],2); \ - chainv[ 1] = chainv[ 5] ^ ROTL32(chainv[ 1],2); \ - chainv[ 2] = chainv[ 6] ^ ROTL32(chainv[ 2],2); \ - chainv[ 3] = chainv[ 7] ^ ROTL32(chainv[ 3],2); \ - chainv[ 4] = chainv[ 0] ^ ROTL32(chainv[ 4],14); \ - chainv[ 5] = chainv[ 1] ^ ROTL32(chainv[ 5],14); \ - chainv[ 6] = chainv[ 2] ^ ROTL32(chainv[ 6],14); \ - chainv[ 7] = chainv[ 3] ^ ROTL32(chainv[ 7],14); \ - chainv[ 0] = chainv[ 4] ^ ROTL32(chainv[ 0],10) ^ c0; \ - chainv[ 1] = chainv[ 5] ^ ROTL32(chainv[ 1],10); \ - chainv[ 2] = chainv[ 6] ^ ROTL32(chainv[ 2],10); \ - chainv[ 3] = chainv[ 7] ^ ROTL32(chainv[ 3],10); \ - chainv[ 4] = ROTL32(chainv[ 4],1) ^ c1; \ - chainv[ 5] = ROTL32(chainv[ 5],1); \ - chainv[ 6] = ROTL32(chainv[ 6],1); \ - chainv[ 7] = ROTL32(chainv[ 7],1); \ -} - -__device__ __forceinline__ -void STEP2(uint32_t *t, const uint2 c0, const uint2 c1){ - uint32_t temp[ 4]; - temp[ 0] = t[ 0]; - temp[ 1] = t[ 5]; - temp[ 2] = t[0+8]; - temp[ 3] = t[8+5]; - t[ 2] ^= t[ 3]; - t[ 7] ^= t[ 4]; - t[8+2] ^= t[8+3]; - t[8+7] ^= t[8+4]; - t[ 0] |= t[ 1]; - t[ 5] |= t[ 6]; - t[8+0]|= t[8+1]; - t[8+5]|= t[8+6]; - t[ 1] = ~t[ 1]; - t[ 6] = ~t[ 6]; - t[8+1] = ~t[8+1]; - t[8+6] = ~t[8+6]; - t[ 0] ^= t[ 3]; - t[ 5] ^= t[ 4]; - t[8+0]^= t[8+3]; - t[8+5]^= t[8+4]; - t[ 3] &= temp[ 0]; - t[ 4] &= temp[ 1]; - t[8+3]&= temp[ 2]; - t[8+4]&= temp[ 3]; - t[ 1] ^= t[ 3]; - t[ 6] ^= t[ 4]; - t[8+1]^= t[8+3]; - t[8+6]^= t[8+4]; - t[ 3] ^= t[ 2]; - t[ 4] ^= t[ 7]; - t[8+3]^= t[8+2]; - t[8+4]^= t[8+7]; - t[ 2] &= t[ 0]; - t[ 7] &= t[ 5]; - t[8+2]&= t[8+0]; - t[8+7]&= t[8+5]; - t[ 0] = ~t[ 0]; - t[ 5] = ~t[ 5]; - t[8+0] = ~t[8+0]; - t[8+5] = ~t[8+5]; - t[ 2] ^= t[ 1]; - t[ 7] ^= t[ 6]; - t[8+2]^= t[8+1]; - t[8+7]^= t[8+6]; - t[ 1] |= t[ 3]; - t[ 6] |= t[ 4]; - t[8+1]|= t[8+3]; - t[8+6]|= t[8+4]; - - temp[ 0] ^= t[ 1]; - temp[ 1] ^= t[ 6]; - temp[ 2] ^= t[8+1]; - temp[ 3] ^= t[8+6]; - - t[ 3] ^= t[ 2]; - t[ 4] ^= t[ 7] ^ temp[ 0]; - t[8+3]^= t[8+2]; - t[8+4]^= t[8+7] ^ temp[ 2]; - t[ 2] &= t[ 1]; - t[ 7] = (t[ 7] & t[ 6]) ^ t[ 3]; - t[8+2]&= t[8+1]; - t[ 1] ^= t[ 0]; - t[8+7] = (t[8+6] & t[8+7]) ^ t[8+3]; - t[ 6] ^= t[ 5] ^ t[ 2]; - t[8+1]^= t[8+0]; - t[8+6]^= t[8+2]^ t[8+5]; - t[ 5] = t[ 1] ^ temp[ 1]; - t[ 0] = t[ 4] ^ ROTL32(temp[ 0],2); - t[8+5] = t[8+1]^ temp[ 3]; - t[8+0] = t[8+4]^ ROTL32(temp[ 2],2); - t[ 1] = t[ 5] ^ ROTL32(t[ 1],2); - t[ 2] = t[ 6] ^ ROTL32(t[ 2],2); - t[8+1] = t[8+5]^ ROTL32(t[8+1],2); - t[8+2] = t[8+6]^ ROTL32(t[8+2],2); - t[ 3] = t[ 7] ^ ROTL32(t[ 3],2); - t[ 4] = t[ 0] ^ ROTL32(t[ 4],14); - t[8+3] = t[8+7] ^ ROTL32(t[8+3],2); - t[8+4] = t[8+0] ^ ROTL32(t[8+4],14); - t[ 5] = t[ 1] ^ ROTL32(t[ 5],14); - t[ 6] = t[ 2] ^ ROTL32(t[ 6],14); - t[8+5] = t[8+1] ^ ROTL32(t[8+5],14); - t[8+6] = t[8+2] ^ ROTL32(t[8+6],14); - t[ 7] = t[ 3] ^ ROTL32(t[ 7],14); - t[ 0] = t[ 4] ^ ROTL32(t[ 0],10) ^ c0.x; - t[8+7] = t[8+3]^ ROTL32(t[8+7],14); - t[8+0] = t[8+4]^ ROTL32(t[8+0],10) ^ c1.x; - t[ 1] = t[ 5] ^ ROTL32(t[ 1],10); - t[ 2] = t[ 6] ^ ROTL32(t[ 2],10); - t[8+1] = t[8+5]^ ROTL32(t[8+1],10); - t[8+2] = t[8+6]^ ROTL32(t[8+2],10); - t[ 3] = t[ 7] ^ ROTL32(t[ 3],10); - t[ 4] = ROTL32(t[ 4],1) ^ c0.y; - t[8+3] = t[8+7] ^ ROTL32(t[8+3],10); - t[8+4] = ROTL32(t[8+4],1) ^ c1.y; - t[ 5] = ROTL32(t[ 5],1); - t[ 6] = ROTL32(t[ 6],1); - t[8+5] = ROTL32(t[8+5],1); - t[8+6] = ROTL32(t[8+6],1); - t[ 7] = ROTL32(t[ 7],1); - t[8+7] = ROTL32(t[8+7],1); -} - -__device__ __forceinline__ -void STEP1(uint32_t *t, const uint2 c){ - uint32_t temp[ 2]; - temp[ 0] = t[ 0]; temp[ 1] = t[ 5]; - t[ 2] ^= t[ 3]; t[ 7] ^= t[ 4]; - t[ 0] |= t[ 1]; t[ 5] |= t[ 6]; - t[ 1] = ~t[ 1]; t[ 6] = ~t[ 6]; - t[ 0] ^= t[ 3]; t[ 5] ^= t[ 4]; - t[ 3] &= temp[ 0]; t[ 4] &= temp[ 1]; - t[ 1] ^= t[ 3]; t[ 6] ^= t[ 4]; - t[ 3] ^= t[ 2]; t[ 4] ^= t[ 7]; - t[ 2] &= t[ 0]; t[ 7] &= t[ 5]; - t[ 0] = ~t[ 0]; t[ 5] = ~t[ 5]; - t[ 2] ^= t[ 1]; t[ 7] ^= t[ 6]; - t[ 1] |= t[ 3]; t[ 6] |= t[ 4]; - temp[ 0] ^= t[ 1]; temp[ 1] ^= t[ 6]; - t[ 3] ^= t[ 2]; t[ 4] ^= t[ 7] ^ temp[ 0]; - t[ 2] &= t[ 1]; t[ 7] = (t[ 7] & t[ 6]) ^ t[ 3]; - t[ 1] ^= t[ 0]; t[ 6] ^= t[ 5] ^ t[ 2]; - t[ 5] = t[ 1] ^ temp[ 1]; t[ 0] = t[ 4] ^ ROTL32(temp[ 0],2); - t[ 1] = t[ 5] ^ ROTL32(t[ 1],2); t[ 2] = t[ 6] ^ ROTL32(t[ 2],2); - t[ 3] = t[ 7] ^ ROTL32(t[ 3],2); t[ 4] = t[ 0] ^ ROTL32(t[ 4],14); - t[ 5] = t[ 1] ^ ROTL32(t[ 5],14); t[ 6] = t[ 2] ^ ROTL32(t[ 6],14); - t[ 7] = t[ 3] ^ ROTL32(t[ 7],14); t[ 0] = t[ 4] ^ ROTL32(t[ 0],10) ^ c.x; - t[ 1] = t[ 5] ^ ROTL32(t[ 1],10); t[ 2] = t[ 6] ^ ROTL32(t[ 2],10); - t[ 3] = t[ 7] ^ ROTL32(t[ 3],10); t[ 4] = ROTL32(t[ 4],1) ^ c.y; - t[ 5] = ROTL32(t[ 5],1); t[ 6] = ROTL32(t[ 6],1); - t[ 7] = ROTL32(t[ 7],1); -} - -/* initial values of chaining variables */ -__constant__ const uint32_t c_CNS[80] = { - 0x303994a6,0xe0337818,0xc0e65299,0x441ba90d, 0x6cc33a12,0x7f34d442,0xdc56983e,0x9389217f, 0x1e00108f,0xe5a8bce6,0x7800423d,0x5274baf4, 0x8f5b7882,0x26889ba7,0x96e1db12,0x9a226e9d, - 0xb6de10ed,0x01685f3d,0x70f47aae,0x05a17cf4, 0x0707a3d4,0xbd09caca,0x1c1e8f51,0xf4272b28, 0x707a3d45,0x144ae5cc,0xaeb28562,0xfaa7ae2b, 0xbaca1589,0x2e48f1c1,0x40a46f3e,0xb923c704, - 0xfc20d9d2,0xe25e72c1,0x34552e25,0xe623bb72, 0x7ad8818f,0x5c58a4a4,0x8438764a,0x1e38e2e7, 0xbb6de032,0x78e38b9d,0xedb780c8,0x27586719, 0xd9847356,0x36eda57f,0xa2c78434,0x703aace7, - 0xb213afa5,0xe028c9bf,0xc84ebe95,0x44756f91, 0x4e608a22,0x7e8fce32,0x56d858fe,0x956548be, 0x343b138f,0xfe191be2,0xd0ec4e3d,0x3cb226e5, 0x2ceb4882,0x5944a28e,0xb3ad2208,0xa1c4c355, - 0xf0d2e9e3,0x5090d577,0xac11d7fa,0x2d1925ab, 0x1bcb66f2,0xb46496ac,0x6f2d9bc9,0xd1925ab0, 0x78602649,0x29131ab6,0x8edae952,0x0fc053c3, 0x3b6ba548,0x3f014f0c,0xedae9520,0xfc053c31 - }; - -static uint32_t h_CNS[80] = { - 0x303994a6,0xe0337818,0xc0e65299,0x441ba90d, 0x6cc33a12,0x7f34d442,0xdc56983e,0x9389217f, 0x1e00108f,0xe5a8bce6,0x7800423d,0x5274baf4, 0x8f5b7882,0x26889ba7,0x96e1db12,0x9a226e9d, - 0xb6de10ed,0x01685f3d,0x70f47aae,0x05a17cf4, 0x0707a3d4,0xbd09caca,0x1c1e8f51,0xf4272b28, 0x707a3d45,0x144ae5cc,0xaeb28562,0xfaa7ae2b, 0xbaca1589,0x2e48f1c1,0x40a46f3e,0xb923c704, - 0xfc20d9d2,0xe25e72c1,0x34552e25,0xe623bb72, 0x7ad8818f,0x5c58a4a4,0x8438764a,0x1e38e2e7, 0xbb6de032,0x78e38b9d,0xedb780c8,0x27586719, 0xd9847356,0x36eda57f,0xa2c78434,0x703aace7, - 0xb213afa5,0xe028c9bf,0xc84ebe95,0x44756f91, 0x4e608a22,0x7e8fce32,0x56d858fe,0x956548be, 0x343b138f,0xfe191be2,0xd0ec4e3d,0x3cb226e5, 0x2ceb4882,0x5944a28e,0xb3ad2208,0xa1c4c355, - 0xf0d2e9e3,0x5090d577,0xac11d7fa,0x2d1925ab, 0x1bcb66f2,0xb46496ac,0x6f2d9bc9,0xd1925ab0, 0x78602649,0x29131ab6,0x8edae952,0x0fc053c3, 0x3b6ba548,0x3f014f0c,0xedae9520,0xfc053c31 - }; - - -__device__ -static void rnd512(uint32_t *const __restrict__ statebuffer, uint32_t *const __restrict__ statechainv){ - uint32_t t[40]; - uint32_t tmp; - - tmp = statechainv[ 7] ^ statechainv[7 + 8] ^ statechainv[7 +16] ^ statechainv[7 +24] ^ statechainv[7 +32]; - t[7] = statechainv[ 6] ^ statechainv[6 + 8] ^ statechainv[6 +16] ^ statechainv[6 +24] ^ statechainv[6 +32]; - t[6] = statechainv[ 5] ^ statechainv[5 + 8] ^ statechainv[5 +16] ^ statechainv[5 +24] ^ statechainv[5 +32]; - t[5] = statechainv[ 4] ^ statechainv[4 + 8] ^ statechainv[4 +16] ^ statechainv[4 +24] ^ statechainv[4 +32]; - t[4] = statechainv[ 3] ^ statechainv[3 + 8] ^ statechainv[3 +16] ^ statechainv[3 +24] ^ statechainv[3 +32] ^ tmp; - t[3] = statechainv[ 2] ^ statechainv[2 + 8] ^ statechainv[2 +16] ^ statechainv[2 +24] ^ statechainv[2 +32] ^ tmp; - t[2] = statechainv[ 1] ^ statechainv[1 + 8] ^ statechainv[1 +16] ^ statechainv[1 +24] ^ statechainv[1 +32]; - t[1] = statechainv[ 0] ^ statechainv[0 + 8] ^ statechainv[0 +16] ^ statechainv[0 +24] ^ statechainv[0 +32] ^ tmp; - t[0] = tmp; - -// *(uint2x4*)statechainv ^= *(uint2x4*)t; - #pragma unroll 8 - for(int i=0;i<8;i++) - statechainv[i] ^= t[i]; - - #pragma unroll 4 - for (int j=1;j<5;j++) { - #pragma unroll 8 - for(int i=0;i<8;i++) - statechainv[i+(j<<3)] ^= t[i]; -// *(uint2x4*)&statechainv[8*j] ^= *(uint2x4*)t; - #pragma unroll 8 - for(int i=0;i<8;i++) - t[i+(j<<3)] = statechainv[i+(j<<3)]; -// *(uint2x4*)&t[8*j] = *(uint2x4*)&statechainv[8*j]; - } - -// *(uint2x4*)t = *(uint2x4*)statechainv; - #pragma unroll 8 - for(int i=0;i<8;i++) - t[i] = statechainv[i]; - - MULT0(statechainv); - - #pragma unroll 4 - for (int j=1;j<5;j++) - MULT2(statechainv, j); - - #pragma unroll 5 - for (int j=0;j<5;j++) - #pragma unroll 8 - for(int i=0;i<8;i++) - statechainv[i+8*j] ^= t[i+(8*((j+1)%5))]; -// *(uint2x4*)&statechainv[8*j] ^= *(uint2x4*)&t[8*((j+1)%5)]; - - #pragma unroll 5 - for (int j=0;j<5;j++) - *(uint2x4*)&t[8*j] = *(uint2x4*)&statechainv[8*j]; - - MULT0(statechainv); - #pragma unroll 4 - for (int j=1;j<5;j++) - MULT2(statechainv, j); - - #pragma unroll 5 - for (int j=0;j<5;j++) - *(uint2x4*)&statechainv[8*j] ^= *(uint2x4*)&t[8*((j+4)%5)]; - - #pragma unroll 5 - for (int j=0;j<5;j++) { - *(uint2x4*)&statechainv[8*j] ^= *(uint2x4*)statebuffer; - MULT0(statebuffer); - } - - TWEAK(statechainv[12], statechainv[13], statechainv[14], statechainv[15], 1); - TWEAK(statechainv[20], statechainv[21], statechainv[22], statechainv[23], 2); - TWEAK(statechainv[28], statechainv[29], statechainv[30], statechainv[31], 3); - TWEAK(statechainv[36], statechainv[37], statechainv[38], statechainv[39], 4); - - for (int i = 0; i<8; i++){ - STEP2( statechainv ,*(uint2*)&c_CNS[(2 * i) + 0], *(uint2*)&c_CNS[(2 * i) + 16]); - STEP2(&statechainv[16],*(uint2*)&c_CNS[(2 * i) + 32], *(uint2*)&c_CNS[(2 * i) + 48]); - STEP1(&statechainv[32],*(uint2*)&c_CNS[(2 * i) + 64]); - } -} - -__device__ -static void rnd512_first(uint32_t *const __restrict__ state, uint32_t *const __restrict__ buffer) -{ - #pragma unroll 5 - for (int j = 0; j<5; j++) { - uint32_t tmp; - #pragma unroll 8 - for(int i=0;i<8;i++) - state[i+(j<<3)] ^= buffer[i]; - MULT0(buffer); - } - TWEAK(state[12], state[13], state[14], state[15], 1); - TWEAK(state[20], state[21], state[22], state[23], 2); - TWEAK(state[28], state[29], state[30], state[31], 3); - TWEAK(state[36], state[37], state[38], state[39], 4); - - for (int i = 0; i<8; i++) { - STEP2(&state[ 0],*(uint2*)&c_CNS[(2 * i) + 0],*(uint2*)&c_CNS[(2 * i) + 16]); - STEP2(&state[16],*(uint2*)&c_CNS[(2 * i) + 32],*(uint2*)&c_CNS[(2 * i) + 48]); - STEP1(&state[32],*(uint2*)&c_CNS[(2 * i) + 64]); - } -} - -__device__ -static void qubit_rnd512_first(uint32_t *const __restrict__ statebuffer, uint32_t *const __restrict__ statechainv){ - - *(uint4*)&statechainv[ 0] ^= *(uint4*)&statebuffer[ 0]; - statechainv[ 4] ^= statebuffer[4]; - - *(uint4*)&statechainv[ 9] ^= *(uint4*)&statebuffer[ 0]; - statechainv[13] ^= statebuffer[4]; - - *(uint4*)&statechainv[18] ^= *(uint4*)&statebuffer[ 0]; - statechainv[22] ^= statebuffer[4]; - - *(uint4*)&statechainv[27] ^= *(uint4*)&statebuffer[ 0]; - statechainv[31] ^= statebuffer[4]; - - statechainv[0 + 8 * 4] ^= statebuffer[4]; - statechainv[1 + 8 * 4] ^= statebuffer[4]; - statechainv[3 + 8 * 4] ^= statebuffer[4]; - statechainv[4 + 8 * 4] ^= statebuffer[4]; - *(uint4*)&statechainv[4 + 8*4] ^= *(uint4*)&statebuffer[ 0]; - - TWEAK(statechainv[12], statechainv[13], statechainv[14], statechainv[15], 1); - TWEAK(statechainv[20], statechainv[21], statechainv[22], statechainv[23], 2); - TWEAK(statechainv[28], statechainv[29], statechainv[30], statechainv[31], 3); - TWEAK(statechainv[36], statechainv[37], statechainv[38], statechainv[39], 4); - - #pragma unroll 8 - for (uint32_t i = 0; i<8; i++){ - STEP2(&statechainv[ 0],*(uint2*)&c_CNS[(2 * i) + 0],*(uint2*)&c_CNS[(2 * i) + 16]); - STEP2(&statechainv[16],*(uint2*)&c_CNS[(2 * i) + 32],*(uint2*)&c_CNS[(2 * i) + 48]); - STEP1(&statechainv[32],*(uint2*)&c_CNS[(2 * i) + 64]); - } -} - - -void rnd512cpu(uint32_t *statebuffer, uint32_t *statechainv) -{ - int i, j; - uint32_t t[40]; - uint32_t chainv[8]; - uint32_t tmp; - - for (i = 0; i<8; i++) - { - t[i] = statechainv[i]; - for (j = 1; j<5; j++) - { - t[i] ^= statechainv[i + 8 * j]; - } - } - - MULT2(t, 0); - - for (j = 0; j<5; j++) - { - for (i = 0; i<8; i++) - { - statechainv[i + 8 * j] ^= t[i]; - } - } - - for (j = 0; j<5; j++) - { - for (i = 0; i<8; i++) - { - t[i + 8 * j] = statechainv[i + 8 * j]; - } - } - - for (j = 0; j<5; j++) - { - MULT2(statechainv, j); - } - - for (j = 0; j<5; j++) - { - for (i = 0; i<8; i++) - { - statechainv[8 * j + i] ^= t[8 * ((j + 1) % 5) + i]; - } - } - - for (j = 0; j<5; j++) - { - for (i = 0; i<8; i++) - { - t[i + 8 * j] = statechainv[i + 8 * j]; - } - } - - for (j = 0; j<5; j++) - { - MULT2(statechainv, j); - } - - for (j = 0; j<5; j++) - { - for (i = 0; i<8; i++) - { - statechainv[8 * j + i] ^= t[8 * ((j + 4) % 5) + i]; - } - } - - for (j = 0; j<5; j++) - { - for (i = 0; i<8; i++) - { - statechainv[i + 8 * j] ^= statebuffer[i]; - } - MULT2(statebuffer, 0); - } - - for (i = 0; i<8; i++) - { - chainv[i] = statechainv[i]; - } - - for (i = 0; i<8; i++) - { - STEP(h_CNS[(2 * i)], h_CNS[(2 * i) + 1]); - } - - for (i = 0; i<8; i++) - { - statechainv[i] = chainv[i]; - chainv[i] = statechainv[i + 8]; - } - - TWEAK(chainv[4], chainv[5], chainv[6], chainv[7], 1); - - - for (i = 0; i<8; i++) - { - STEP(h_CNS[(2 * i) + 16], h_CNS[(2 * i) + 16 + 1]); - } - - for (i = 0; i<8; i++) - { - statechainv[i + 8] = chainv[i]; - chainv[i] = statechainv[i + 16]; - } - - TWEAK(chainv[4], chainv[5], chainv[6], chainv[7], 2); - - for (i = 0; i<8; i++) - { - STEP(h_CNS[(2 * i) + 32], h_CNS[(2 * i) + 32 + 1]); - } - - for (i = 0; i<8; i++) - { - statechainv[i + 16] = chainv[i]; - chainv[i] = statechainv[i + 24]; - } - - TWEAK(chainv[4], chainv[5], chainv[6], chainv[7], 3); - - for (i = 0; i<8; i++) - { - STEP(h_CNS[(2 * i) + 48], h_CNS[(2 * i) + 48 + 1]); - } - - for (i = 0; i<8; i++) - { - statechainv[i + 24] = chainv[i]; - chainv[i] = statechainv[i + 32]; - } - - TWEAK(chainv[4], chainv[5], chainv[6], chainv[7], 4); - - for (i = 0; i<8; i++) - { - STEP(h_CNS[(2 * i) + 64], h_CNS[(2 * i) + 64 + 1]); - } - - for (i = 0; i<8; i++) - { - statechainv[i + 32] = chainv[i]; - } -} - -/***************************************************/ -__device__ __forceinline__ -static void rnd512_nullhash(uint32_t *const __restrict__ state){ - - uint32_t t[40]; - uint32_t tmp; - - tmp = state[ 7] ^ state[7 + 8] ^ state[7 +16] ^ state[7 +24] ^ state[7 +32]; - t[7] = state[ 6] ^ state[6 + 8] ^ state[6 +16] ^ state[6 +24] ^ state[6 +32]; - t[6] = state[ 5] ^ state[5 + 8] ^ state[5 +16] ^ state[5 +24] ^ state[5 +32]; - t[5] = state[ 4] ^ state[4 + 8] ^ state[4 +16] ^ state[4 +24] ^ state[4 +32]; - t[4] = state[ 3] ^ state[3 + 8] ^ state[3 +16] ^ state[3 +24] ^ state[3 +32] ^ tmp; - t[3] = state[ 2] ^ state[2 + 8] ^ state[2 +16] ^ state[2 +24] ^ state[2 +32] ^ tmp; - t[2] = state[ 1] ^ state[1 + 8] ^ state[1 +16] ^ state[1 +24] ^ state[1 +32]; - t[1] = state[ 0] ^ state[0 + 8] ^ state[0 +16] ^ state[0 +24] ^ state[0 +32] ^ tmp; - t[0] = tmp; - - #pragma unroll 5 - for (int j = 0; j<5; j++){ -// #pragma unroll 8 -// for(int i=0;i<8;i++) -// state[i+(j<<3)] ^= t[i]; - *(uint2x4*)&state[8*j] ^= *(uint2x4*)t; - } - - #pragma unroll 5 - for (int j = 0; j<5; j++){ -/// #pragma unroll 8 -/// for(int i=0;i<8;i++) -// t[i+(j<<3)] = state[i+(j<<3)]; - *(uint2x4*)&t[8*j] = *(uint2x4*)&state[8*j]; - } - #pragma unroll 5 - for (int j = 0; j<5; j++) { - MULT2(state, j); - } - - #pragma unroll 5 - for (int j = 0; j<5; j++) { -// #pragma unroll 8 -// for(int i=0;i<8;i++) -// state[i+(j<<3)] ^= t[i + (((j + 1) % 5)<<3)]; - *(uint2x4*)&state[8*j] ^= *(uint2x4*)&t[8 * ((j + 1) % 5)]; - } - - #pragma unroll 5 - for (int j = 0; j<5; j++) { -// #pragma unroll 8 -// for(int i=0;i<8;i++) -// t[i+8*j] = state[i+8*j]; - *(uint2x4*)&t[8*j] = *(uint2x4*)&state[8*j]; - } - - #pragma unroll 5 - for (int j = 0; j<5; j++) { - MULT2(state, j); - } - - #pragma unroll 5 - for (int j = 0; j<5; j++) { - #pragma unroll 8 - for(int i=0;i<8;i++) - state[i+8*j] ^= t[i+(8 * ((j + 4) % 5))]; -// *(uint2x4*)&state[8*j] ^= *(uint2x4*)&t[8 * ((j + 4) % 5)]; - } - - TWEAK(state[12], state[13], state[14], state[15], 1); - TWEAK(state[20], state[21], state[22], state[23], 2); - TWEAK(state[28], state[29], state[30], state[31], 3); - TWEAK(state[36], state[37], state[38], state[39], 4); - -// #pragma unroll 8 - for (int i = 0; i<8; i++) { - STEP2(&state[ 0],*(uint2*)&c_CNS[(2 * i) + 0],*(uint2*)&c_CNS[(2 * i) + 16]); - STEP2(&state[16],*(uint2*)&c_CNS[(2 * i) + 32],*(uint2*)&c_CNS[(2 * i) + 48]); - STEP1(&state[32],*(uint2*)&c_CNS[(2 * i) + 64]); - } -} - - -/***************************************************/ -// Die Hash-Funktion -//#if __CUDA_ARCH__ == 500 -//__launch_bounds__(256, 4) -//#endif - - -__global__ __launch_bounds__(256, 4) -void qubit_luffa512_gpu_hash_80_alexis(const uint32_t threads,const uint32_t startNounce, uint32_t *outputHash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const uint32_t nounce = startNounce + thread; - uint64_t buff[16] = {0}; - - buff[ 8] = c_PaddedMessage80[8]; - buff[ 9] = c_PaddedMessage80[9]; - buff[10] = 0x80; - buff[11] = 0x0100; - buff[15] = 0x8002000000000000; - - // die Nounce durch die thread-spezifische ersetzen - buff[9] = REPLACE_HIDWORD(buff[9], cuda_swab32(nounce)); - - uint32_t statebuffer[8]; - uint32_t statechainv[40]; - - #pragma unroll 4 - for (int i = 0; i<4; i++) - statebuffer[i] = cuda_swab32(((uint32_t*)buff)[i + 16]); - - *(uint4*)&statebuffer[ 4] = *(uint4*)&statebufferpre[ 4]; - - #pragma unroll 40 - for (int i = 0; i<40; i++) - statechainv[i] = statechainvpre[i]; - - statebuffer[4] = 0x80000000; - - qubit_rnd512_first(statebuffer, statechainv); - - uint32_t *outHash = outputHash + (thread<<4); - - rnd512_nullhash(statechainv); - *(uint2x4*)&outHash[ 0] = swapvec(*(uint2x4*)&statechainv[ 0] ^ *(uint2x4*)&statechainv[ 8] ^ *(uint2x4*)&statechainv[16] ^ *(uint2x4*)&statechainv[24] ^ *(uint2x4*)&statechainv[32]); - - rnd512_nullhash(statechainv); - *(uint2x4*)&outHash[ 8] = swapvec(*(uint2x4*)&statechainv[ 0] ^ *(uint2x4*)&statechainv[ 8] ^ *(uint2x4*)&statechainv[16] ^ *(uint2x4*)&statechainv[24] ^ *(uint2x4*)&statechainv[32]); - - - } -} - -__host__ -void qubit_luffa512_cpu_hash_80_alexis(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_outputHash){ - - const uint32_t threadsperblock = 256; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - qubit_luffa512_gpu_hash_80_alexis<<>> (threads, startNounce, d_outputHash); -} - -//#if __CUDA_ARCH__ == 500 -// #define __ldg(x) (*x) -//#endif - -__global__ -__launch_bounds__(384,2) -void x11_luffa512_gpu_hash_64_alexis(uint32_t threads, uint32_t *g_hash){ - - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - uint32_t statebuffer[8]; - - if (thread < threads) - { - uint32_t statechainv[40] = { - 0x8bb0a761, 0xc2e4aa8b, 0x2d539bc9, 0x381408f8, 0x478f6633, 0x255a46ff, 0x581c37f7, 0x601c2e8e, - 0x266c5f9d, 0xc34715d8, 0x8900670e, 0x51a540be, 0xe4ce69fb, 0x5089f4d4, 0x3cc0a506, 0x609bcb02, - 0xa4e3cd82, 0xd24fd6ca, 0xc0f196dc, 0xcf41eafe, 0x0ff2e673, 0x303804f2, 0xa7b3cd48, 0x677addd4, - 0x66e66a8a, 0x2303208f, 0x486dafb4, 0xc0d37dc6, 0x634d15af, 0xe5af6747, 0x10af7e38, 0xee7e6428, - 0x01262e5d, 0xc92c2e64, 0x82fee966, 0xcea738d3, 0x867de2b0, 0xe0714818, 0xda6e831f, 0xa7062529 - }; - uint2x4* Hash = (uint2x4*)&g_hash[thread<<4]; - - uint32_t hash[16]; - - *(uint2x4*)&hash[0] = __ldg4(&Hash[0]); - *(uint2x4*)&hash[8] = __ldg4(&Hash[1]); - - #pragma unroll 8 - for(int i=0;i<8;i++){ - statebuffer[i] = cuda_swab32(hash[i]); - } - - rnd512_first(statechainv, statebuffer); - - #pragma unroll 8 - for(int i=0;i<8;i++){ - statebuffer[i] = cuda_swab32(hash[8+i]); - } - - rnd512(statebuffer, statechainv); - - statebuffer[0] = 0x80000000; - #pragma unroll 7 - for(uint32_t i=1;i<8;i++) - statebuffer[i] = 0; - - rnd512(statebuffer, statechainv); - - /*---- blank round with m=0 ----*/ - rnd512_nullhash(statechainv); - - #pragma unroll 8 - for(int i=0;i<8;i++) - hash[i] = cuda_swab32(statechainv[i] ^ statechainv[i+8] ^ statechainv[i+16] ^ statechainv[i+24] ^ statechainv[i+32]); - - rnd512_nullhash(statechainv); - - #pragma unroll 8 - for(int i=0;i<8;i++) - hash[8+i] = cuda_swab32(statechainv[i] ^ statechainv[i+8] ^ statechainv[i+16] ^ statechainv[i+24] ^ statechainv[i+32]); - - Hash[ 0] = *(uint2x4*)&hash[ 0]; - Hash[ 1] = *(uint2x4*)&hash[ 8]; - } -} - -__host__ void qubit_cpu_precalc() -{ - uint32_t tmp,i,j; - uint32_t statebuffer[8]; - uint32_t t[40]; - uint32_t statechainv[40] = - { - 0x6d251e69, 0x44b051e0, 0x4eaa6fb4, 0xdbf78465, 0x6e292011, 0x90152df4, 0xee058139, 0xdef610bb, - 0xc3b44b95, 0xd9d2f256, 0x70eee9a0, 0xde099fa3, 0x5d9b0557, 0x8fc944b3, 0xcf1ccf0e, 0x746cd581, - 0xf7efc89d, 0x5dba5781, 0x04016ce5, 0xad659c05, 0x0306194f, 0x666d1836, 0x24aa230a, 0x8b264ae7, - 0x858075d5, 0x36d79cce, 0xe571f7d7, 0x204b1f67, 0x35870c6a, 0x57e9e923, 0x14bcb808, 0x7cde72ce, - 0x6c68e9be, 0x5ec41e22, 0xc825b7c7, 0xaffb4363, 0xf5df3999, 0x0fc688f1, 0xb07224cc, 0x03e86cea - }; - - for (int i = 0; i<8; i++) - statebuffer[i] = cuda_swab32(*(((uint32_t*)PaddedMessage) + i)); - rnd512cpu(statebuffer, statechainv); - - for (int i = 0; i<8; i++) - statebuffer[i] = cuda_swab32(*(((uint32_t*)PaddedMessage) + i + 8)); - - rnd512cpu(statebuffer, statechainv); - - - for (int i = 0; i<8; i++) - { - t[i] = statechainv[i]; - for (int j = 1; j<5; j++) - { - t[i] ^= statechainv[i + 8 * j]; - } - } - - MULT2(t, 0); - - for (int j = 0; j<5; j++) { - for (int i = 0; i<8; i++) { - statechainv[i + 8 * j] ^= t[i]; - } - } - for (j = 0; j<5; j++) { - for (i = 0; i<8; i++) { - t[i + 8 * j] = statechainv[i + 8 * j]; - } - } - - for (j = 0; j<5; j++) { - MULT2(statechainv, j); - } - - for (j = 0; j<5; j++) { - for (i = 0; i<8; i++) { - statechainv[8 * j + i] ^= t[8 * ((j + 1) % 5) + i]; - } - } - - for (j = 0; j<5; j++) { - for (i = 0; i<8; i++) { - t[i + 8 * j] = statechainv[i + 8 * j]; - } - } - - for (j = 0; j<5; j++) { - MULT2(statechainv, j); - } - - for (j = 0; j<5; j++) { - for (i = 0; i<8; i++) { - statechainv[8 * j + i] ^= t[8 * ((j + 4) % 5) + i]; - } - } - cudaMemcpyToSymbol(statebufferpre, statebuffer, 8 * sizeof(uint32_t), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(statechainvpre, statechainv, 40 * sizeof(uint32_t), 0, cudaMemcpyHostToDevice); -} - -__host__ -void qubit_luffa512_cpu_setBlock_80_alexis(void *pdata) -{ - memcpy(PaddedMessage, pdata, 80); - - CUDA_SAFE_CALL(cudaMemcpyToSymbol( c_PaddedMessage80, PaddedMessage, 10*sizeof(uint64_t), 0, cudaMemcpyHostToDevice)); - qubit_cpu_precalc(); -} - -__host__ -void x11_luffa512_cpu_hash_64_alexis(int thr_id, uint32_t threads,uint32_t *d_hash) -{ - const uint32_t threadsperblock = 384; - - // berechne wie viele Thread Blocks wir brauchen - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - x11_luffa512_gpu_hash_64_alexis<<>>(threads,d_hash); -} diff --git a/scrypt-jane.cpp b/scrypt-jane.cpp deleted file mode 100644 index 89e74726..00000000 --- a/scrypt-jane.cpp +++ /dev/null @@ -1,713 +0,0 @@ -/* - * scrypt-jane by Andrew M, https://github.com/floodyberry/scrypt-jane - * - * Public Domain or MIT License, whichever is easier - * - * Adapted to ccminer by tpruvot@github (2015) - */ - -#include "miner.h" - -#include "scrypt/scrypt-jane.h" -#include "scrypt/code/scrypt-jane-portable.h" -#include "scrypt/code/scrypt-jane-chacha.h" -#include "scrypt/keccak.h" - -#include "scrypt/salsa_kernel.h" - -#define scrypt_maxN 30 /* (1 << (30 + 1)) = ~2 billion */ -#define scrypt_r_32kb 8 /* (1 << 8) = 256 * 2 blocks in a chunk * 64 bytes = Max of 32kb in a chunk */ -#define scrypt_maxr scrypt_r_32kb /* 32kb */ -#define scrypt_maxp 25 /* (1 << 25) = ~33 million */ - -// ---------------------------- BEGIN keccak functions ------------------------------------ - -#define SCRYPT_HASH "Keccak-512" -#define SCRYPT_HASH_DIGEST_SIZE 64 -#define SCRYPT_KECCAK_F 1600 -#define SCRYPT_KECCAK_C (SCRYPT_HASH_DIGEST_SIZE * 8 * 2) /* 1024 */ -#define SCRYPT_KECCAK_R (SCRYPT_KECCAK_F - SCRYPT_KECCAK_C) /* 576 */ -#define SCRYPT_HASH_BLOCK_SIZE (SCRYPT_KECCAK_R / 8) - -typedef uint8_t scrypt_hash_digest[SCRYPT_HASH_DIGEST_SIZE]; - -typedef struct scrypt_hash_state_t { - uint64_t state[SCRYPT_KECCAK_F / 64]; - uint32_t leftover; - uint8_t buffer[SCRYPT_HASH_BLOCK_SIZE]; -} scrypt_hash_state; - -static const uint64_t keccak_round_constants[24] = { - 0x0000000000000001ull, 0x0000000000008082ull, - 0x800000000000808aull, 0x8000000080008000ull, - 0x000000000000808bull, 0x0000000080000001ull, - 0x8000000080008081ull, 0x8000000000008009ull, - 0x000000000000008aull, 0x0000000000000088ull, - 0x0000000080008009ull, 0x000000008000000aull, - 0x000000008000808bull, 0x800000000000008bull, - 0x8000000000008089ull, 0x8000000000008003ull, - 0x8000000000008002ull, 0x8000000000000080ull, - 0x000000000000800aull, 0x800000008000000aull, - 0x8000000080008081ull, 0x8000000000008080ull, - 0x0000000080000001ull, 0x8000000080008008ull -}; - -static void keccak_block(scrypt_hash_state *S, const uint8_t *in) -{ - size_t i; - uint64_t *s = S->state, t[5], u[5], v, w; - - /* absorb input */ - for (i = 0; i < SCRYPT_HASH_BLOCK_SIZE / 8; i++, in += 8) - s[i] ^= U8TO64_LE(in); - - for (i = 0; i < 24; i++) { - /* theta: c = a[0,i] ^ a[1,i] ^ .. a[4,i] */ - t[0] = s[0] ^ s[5] ^ s[10] ^ s[15] ^ s[20]; - t[1] = s[1] ^ s[6] ^ s[11] ^ s[16] ^ s[21]; - t[2] = s[2] ^ s[7] ^ s[12] ^ s[17] ^ s[22]; - t[3] = s[3] ^ s[8] ^ s[13] ^ s[18] ^ s[23]; - t[4] = s[4] ^ s[9] ^ s[14] ^ s[19] ^ s[24]; - - /* theta: d[i] = c[i+4] ^ rotl(c[i+1],1) */ - u[0] = t[4] ^ ROTL64(t[1], 1); - u[1] = t[0] ^ ROTL64(t[2], 1); - u[2] = t[1] ^ ROTL64(t[3], 1); - u[3] = t[2] ^ ROTL64(t[4], 1); - u[4] = t[3] ^ ROTL64(t[0], 1); - - /* theta: a[0,i], a[1,i], .. a[4,i] ^= d[i] */ - s[0] ^= u[0]; s[5] ^= u[0]; s[10] ^= u[0]; s[15] ^= u[0]; s[20] ^= u[0]; - s[1] ^= u[1]; s[6] ^= u[1]; s[11] ^= u[1]; s[16] ^= u[1]; s[21] ^= u[1]; - s[2] ^= u[2]; s[7] ^= u[2]; s[12] ^= u[2]; s[17] ^= u[2]; s[22] ^= u[2]; - s[3] ^= u[3]; s[8] ^= u[3]; s[13] ^= u[3]; s[18] ^= u[3]; s[23] ^= u[3]; - s[4] ^= u[4]; s[9] ^= u[4]; s[14] ^= u[4]; s[19] ^= u[4]; s[24] ^= u[4]; - - /* rho pi: b[..] = rotl(a[..], ..) */ - v = s[ 1]; - s[ 1] = ROTL64(s[ 6], 44); - s[ 6] = ROTL64(s[ 9], 20); - s[ 9] = ROTL64(s[22], 61); - s[22] = ROTL64(s[14], 39); - s[14] = ROTL64(s[20], 18); - s[20] = ROTL64(s[ 2], 62); - s[ 2] = ROTL64(s[12], 43); - s[12] = ROTL64(s[13], 25); - s[13] = ROTL64(s[19], 8); - s[19] = ROTL64(s[23], 56); - s[23] = ROTL64(s[15], 41); - s[15] = ROTL64(s[ 4], 27); - s[ 4] = ROTL64(s[24], 14); - s[24] = ROTL64(s[21], 2); - s[21] = ROTL64(s[ 8], 55); - s[ 8] = ROTL64(s[16], 45); - s[16] = ROTL64(s[ 5], 36); - s[ 5] = ROTL64(s[ 3], 28); - s[ 3] = ROTL64(s[18], 21); - s[18] = ROTL64(s[17], 15); - s[17] = ROTL64(s[11], 10); - s[11] = ROTL64(s[ 7], 6); - s[ 7] = ROTL64(s[10], 3); - s[10] = ROTL64( v, 1); - - /* chi: a[i,j] ^= ~b[i,j+1] & b[i,j+2] */ - v = s[ 0]; w = s[ 1]; s[ 0] ^= (~w) & s[ 2]; s[ 1] ^= (~s[ 2]) & s[ 3]; s[ 2] ^= (~s[ 3]) & s[ 4]; s[ 3] ^= (~s[ 4]) & v; s[ 4] ^= (~v) & w; - v = s[ 5]; w = s[ 6]; s[ 5] ^= (~w) & s[ 7]; s[ 6] ^= (~s[ 7]) & s[ 8]; s[ 7] ^= (~s[ 8]) & s[ 9]; s[ 8] ^= (~s[ 9]) & v; s[ 9] ^= (~v) & w; - v = s[10]; w = s[11]; s[10] ^= (~w) & s[12]; s[11] ^= (~s[12]) & s[13]; s[12] ^= (~s[13]) & s[14]; s[13] ^= (~s[14]) & v; s[14] ^= (~v) & w; - v = s[15]; w = s[16]; s[15] ^= (~w) & s[17]; s[16] ^= (~s[17]) & s[18]; s[17] ^= (~s[18]) & s[19]; s[18] ^= (~s[19]) & v; s[19] ^= (~v) & w; - v = s[20]; w = s[21]; s[20] ^= (~w) & s[22]; s[21] ^= (~s[22]) & s[23]; s[22] ^= (~s[23]) & s[24]; s[23] ^= (~s[24]) & v; s[24] ^= (~v) & w; - - /* iota: a[0,0] ^= round constant */ - s[0] ^= keccak_round_constants[i]; - } -} - -static void scrypt_hash_init(scrypt_hash_state *S) { - memset(S, 0, sizeof(*S)); -} - -static void scrypt_hash_update(scrypt_hash_state *S, const uint8_t *in, size_t inlen) -{ - size_t want; - - /* handle the previous data */ - if (S->leftover) { - want = (SCRYPT_HASH_BLOCK_SIZE - S->leftover); - want = (want < inlen) ? want : inlen; - memcpy(S->buffer + S->leftover, in, want); - S->leftover += (uint32_t)want; - if (S->leftover < SCRYPT_HASH_BLOCK_SIZE) - return; - in += want; - inlen -= want; - keccak_block(S, S->buffer); - } - - /* handle the current data */ - while (inlen >= SCRYPT_HASH_BLOCK_SIZE) { - keccak_block(S, in); - in += SCRYPT_HASH_BLOCK_SIZE; - inlen -= SCRYPT_HASH_BLOCK_SIZE; - } - - /* handle leftover data */ - S->leftover = (uint32_t)inlen; - if (S->leftover) - memcpy(S->buffer, in, S->leftover); -} - -static void scrypt_hash_finish(scrypt_hash_state *S, uint8_t *hash) -{ - size_t i; - - S->buffer[S->leftover] = 0x01; - memset(S->buffer + (S->leftover + 1), 0, SCRYPT_HASH_BLOCK_SIZE - (S->leftover + 1)); - S->buffer[SCRYPT_HASH_BLOCK_SIZE - 1] |= 0x80; - keccak_block(S, S->buffer); - - for (i = 0; i < SCRYPT_HASH_DIGEST_SIZE; i += 8) { - U64TO8_LE(&hash[i], S->state[i / 8]); - } -} - -// ---------------------------- END keccak functions ------------------------------------ - -// ---------------------------- BEGIN PBKDF2 functions ------------------------------------ - -typedef struct scrypt_hmac_state_t { - scrypt_hash_state inner, outer; -} scrypt_hmac_state; - - -static void scrypt_hash(scrypt_hash_digest hash, const uint8_t *m, size_t mlen) -{ - scrypt_hash_state st; - - scrypt_hash_init(&st); - scrypt_hash_update(&st, m, mlen); - scrypt_hash_finish(&st, hash); -} - -/* hmac */ -static void scrypt_hmac_init(scrypt_hmac_state *st, const uint8_t *key, size_t keylen) -{ - uint8_t pad[SCRYPT_HASH_BLOCK_SIZE] = {0}; - size_t i; - - scrypt_hash_init(&st->inner); - scrypt_hash_init(&st->outer); - - if (keylen <= SCRYPT_HASH_BLOCK_SIZE) { - /* use the key directly if it's <= blocksize bytes */ - memcpy(pad, key, keylen); - } else { - /* if it's > blocksize bytes, hash it */ - scrypt_hash(pad, key, keylen); - } - - /* inner = (key ^ 0x36) */ - /* h(inner || ...) */ - for (i = 0; i < SCRYPT_HASH_BLOCK_SIZE; i++) - pad[i] ^= 0x36; - scrypt_hash_update(&st->inner, pad, SCRYPT_HASH_BLOCK_SIZE); - - /* outer = (key ^ 0x5c) */ - /* h(outer || ...) */ - for (i = 0; i < SCRYPT_HASH_BLOCK_SIZE; i++) - pad[i] ^= (0x5c ^ 0x36); - scrypt_hash_update(&st->outer, pad, SCRYPT_HASH_BLOCK_SIZE); -} - -static void scrypt_hmac_update(scrypt_hmac_state *st, const uint8_t *m, size_t mlen) -{ - /* h(inner || m...) */ - scrypt_hash_update(&st->inner, m, mlen); -} - -static void scrypt_hmac_finish(scrypt_hmac_state *st, scrypt_hash_digest mac) -{ - /* h(inner || m) */ - scrypt_hash_digest innerhash; - scrypt_hash_finish(&st->inner, innerhash); - - /* h(outer || h(inner || m)) */ - scrypt_hash_update(&st->outer, innerhash, sizeof(innerhash)); - scrypt_hash_finish(&st->outer, mac); -} - -/* - * Special version where N = 1 - * - mikaelh - */ -static void scrypt_pbkdf2_1(const uint8_t *password, size_t password_len, - const uint8_t *salt, size_t salt_len, uint8_t *out, uint64_t bytes) -{ - scrypt_hmac_state hmac_pw, hmac_pw_salt, work; - scrypt_hash_digest ti, u; - uint8_t be[4]; - uint32_t i, blocks; - - /* bytes must be <= (0xffffffff - (SCRYPT_HASH_DIGEST_SIZE - 1)), which they will always be under scrypt */ - - /* hmac(password, ...) */ - scrypt_hmac_init(&hmac_pw, password, password_len); - - /* hmac(password, salt...) */ - hmac_pw_salt = hmac_pw; - scrypt_hmac_update(&hmac_pw_salt, salt, salt_len); - - blocks = ((uint32_t)bytes + (SCRYPT_HASH_DIGEST_SIZE - 1)) / SCRYPT_HASH_DIGEST_SIZE; - for (i = 1; i <= blocks; i++) { - /* U1 = hmac(password, salt || be(i)) */ - U32TO8_BE(be, i); - work = hmac_pw_salt; - scrypt_hmac_update(&work, be, 4); - scrypt_hmac_finish(&work, ti); - memcpy(u, ti, sizeof(u)); - - memcpy(out, ti, (size_t) (bytes > SCRYPT_HASH_DIGEST_SIZE ? SCRYPT_HASH_DIGEST_SIZE : bytes)); - out += SCRYPT_HASH_DIGEST_SIZE; - bytes -= SCRYPT_HASH_DIGEST_SIZE; - } -} - -// ---------------------------- END PBKDF2 functions ------------------------------------ - -static void scrypt_fatal_error_default(const char *msg) { - fprintf(stderr, "%s\n", msg); - exit(1); -} - -static scrypt_fatal_errorfn scrypt_fatal_error = scrypt_fatal_error_default; - -void scrypt_set_fatal_error_default(scrypt_fatal_errorfn fn) { - scrypt_fatal_error = fn; -} - -typedef struct scrypt_aligned_alloc_t { - uint8_t *mem, *ptr; -} scrypt_aligned_alloc; - -#if defined(SCRYPT_TEST_SPEED) -static uint8_t *mem_base = (uint8_t *)0; -static size_t mem_bump = 0; - -/* allocations are assumed to be multiples of 64 bytes and total allocations not to exceed ~1.01gb */ -static scrypt_aligned_alloc scrypt_alloc(uint64_t size) -{ - scrypt_aligned_alloc aa; - if (!mem_base) { - mem_base = (uint8_t *)malloc((1024 * 1024 * 1024) + (1024 * 1024) + (SCRYPT_BLOCK_BYTES - 1)); - if (!mem_base) - scrypt_fatal_error("scrypt: out of memory"); - mem_base = (uint8_t *)(((size_t)mem_base + (SCRYPT_BLOCK_BYTES - 1)) & ~(SCRYPT_BLOCK_BYTES - 1)); - } - aa.mem = mem_base + mem_bump; - aa.ptr = aa.mem; - mem_bump += (size_t)size; - return aa; -} - -static void scrypt_free(scrypt_aligned_alloc *aa) -{ - mem_bump = 0; -} -#else -static scrypt_aligned_alloc scrypt_alloc(uint64_t size) -{ - static const size_t max_alloc = (size_t)-1; - scrypt_aligned_alloc aa; - size += (SCRYPT_BLOCK_BYTES - 1); - if (size > max_alloc) - scrypt_fatal_error("scrypt: not enough address space on this CPU to allocate required memory"); - aa.mem = (uint8_t *)malloc((size_t)size); - aa.ptr = (uint8_t *)(((size_t)aa.mem + (SCRYPT_BLOCK_BYTES - 1)) & ~(SCRYPT_BLOCK_BYTES - 1)); - if (!aa.mem) - scrypt_fatal_error("scrypt: out of memory"); - return aa; -} - -static void scrypt_free(scrypt_aligned_alloc *aa) -{ - free(aa->mem); -} -#endif - - -// yacoin: increasing Nfactor gradually -unsigned char GetNfactor(unsigned int nTimestamp) -{ - int l = 0; - - unsigned int Nfactor = 0; - - // Yacoin defaults - unsigned int Ntimestamp = 1367991200; - unsigned int minN = 4; - unsigned int maxN = 30; - - if (strlen(jane_params) > 0) { - if (!strcmp(jane_params, "YAC") || !strcasecmp(jane_params, "Yacoin")) {} // No-Op - // - // NO WARRANTY FOR CORRECTNESS. Look for the int64 nChainStartTime constant - // in the src/main.cpp file of the official wallet clients as well as the - // const unsigned char minNfactor and const unsigned char maxNfactor - // - else if (!strcmp(jane_params, "YBC") || !strcasecmp(jane_params, "YBCoin")) { - // YBCoin: 1372386273, minN: 4, maxN: 30 - Ntimestamp = 1372386273; minN= 4; maxN= 30; - } else if (!strcmp(jane_params, "ZZC") || !strcasecmp(jane_params, "ZZCoin")) { - // ZcCoin: 1375817223, minN: 12, maxN: 30 - Ntimestamp = 1375817223; minN= 12; maxN= 30; - } else if (!strcmp(jane_params, "FEC") || !strcasecmp(jane_params, "FreeCoin")) { - // FreeCoin: 1375801200, minN: 6, maxN: 32 - Ntimestamp = 1375801200; minN= 6; maxN= 32; - } else if (!strcmp(jane_params, "ONC") || !strcasecmp(jane_params, "OneCoin")) { - // OneCoin: 1371119462, minN: 6, maxN: 30 - Ntimestamp = 1371119462; minN= 6; maxN= 30; - } else if (!strcmp(jane_params, "QQC") || !strcasecmp(jane_params, "QQCoin")) { - // QQCoin: 1387769316, minN: 4, maxN: 30 - Ntimestamp = 1387769316; minN= 4; maxN= 30; - } else if (!strcmp(jane_params, "GPL") || !strcasecmp(jane_params, "GoldPressedLatinum")) { - // GoldPressedLatinum:1377557832, minN: 4, maxN: 30 - Ntimestamp = 1377557832; minN= 4; maxN= 30; - } else if (!strcmp(jane_params, "MRC") || !strcasecmp(jane_params, "MicroCoin")) { - // MicroCoin:1389028879, minN: 4, maxN: 30 - Ntimestamp = 1389028879; minN= 4; maxN= 30; - } else if (!strcmp(jane_params, "APC") || !strcasecmp(jane_params, "AppleCoin")) { - // AppleCoin:1384720832, minN: 4, maxN: 30 - Ntimestamp = 1384720832; minN= 4; maxN= 30; - } else if (!strcmp(jane_params, "CPR") || !strcasecmp(jane_params, "Copperbars")) { - // Copperbars:1376184687, minN: 4, maxN: 30 - Ntimestamp = 1376184687; minN= 4; maxN= 30; - } else if (!strcmp(jane_params, "CACH") || !strcasecmp(jane_params, "CacheCoin")) { - // CacheCoin:1388949883, minN: 4, maxN: 30 - Ntimestamp = 1388949883; minN= 4; maxN= 30; - } else if (!strcmp(jane_params, "UTC") || !strcasecmp(jane_params, "UltraCoin")) { - // MicroCoin:1388361600, minN: 4, maxN: 30 - Ntimestamp = 1388361600; minN= 4; maxN= 30; - } else if (!strcmp(jane_params, "VEL") || !strcasecmp(jane_params, "VelocityCoin")) { - // VelocityCoin:1387769316, minN: 4, maxN: 30 - Ntimestamp = 1387769316; minN= 4; maxN= 30; - } else if (!strcmp(jane_params, "ITC") || !strcasecmp(jane_params, "InternetCoin")) { - // InternetCoin:1388385602, minN: 4, maxN: 30 - Ntimestamp = 1388385602; minN= 4; maxN= 30; - } else if (!strcmp(jane_params, "RAD") || !strcasecmp(jane_params, "RadioactiveCoin")) { - // InternetCoin:1389196388, minN: 4, maxN: 30 - Ntimestamp = 1389196388; minN= 4; maxN= 30; - } else if (!strcmp(jane_params, "LEO") || !strcasecmp(jane_params, "LEOCoin")) { - // LEOCoin:1402845776, minN: 4, maxN: 30 - Ntimestamp = 1402845776; minN= 4; maxN= 30; - } else { - if (sscanf(jane_params, "%u,%u,%u", &Ntimestamp, &minN, &maxN) != 3) - if (sscanf(jane_params, "%u", &Nfactor) == 1) return Nfactor; // skip bounding against minN, maxN - else applog(LOG_INFO, "Unable to parse scrypt-jane parameters: '%s'. Defaulting to Yacoin.", jane_params); - } - } - // determination based on the constants determined above - if (nTimestamp <= Ntimestamp) - return minN; - - unsigned long int s = nTimestamp - Ntimestamp; - while ((s >> 1) > 3) { - l += 1; - s >>= 1; - } - - s &= 3; - - int n = (l * 170 + s * 25 - 2320) / 100; - - if (n < 0) n = 0; - - if (n > 255) - printf("GetNfactor(%d) - something wrong(n == %d)\n", nTimestamp, n); - - Nfactor = n; - if (NfactormaxN) return maxN; - return Nfactor; -} - -static bool init[MAX_GPUS] = { 0 }; - -// cleanup -void free_scrypt_jane(int thr_id) -{ - int dev_id = device_map[thr_id]; - - if (!init[thr_id]) - return; - - cudaSetDevice(dev_id); - cudaDeviceSynchronize(); - cudaDeviceReset(); // well, simple way to free ;) - - init[thr_id] = false; -} - -#define bswap_32x4(x) ((((x) << 24) & 0xff000000u) | (((x) << 8) & 0x00ff0000u) \ - | (((x) >> 8) & 0x0000ff00u) | (((x) >> 24) & 0x000000ffu)) -static int s_Nfactor = 0; - -int scanhash_scrypt_jane(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done, - unsigned char *scratchbuf, struct timeval *tv_start, struct timeval *tv_end) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t Htarg = ptarget[7]; - uint32_t N; - - if (s_Nfactor == 0 && strlen(jane_params) > 0) - applog(LOG_INFO, "Given scrypt-jane parameters: %s", jane_params); - - int Nfactor = GetNfactor(bswap_32x4(pdata[17])); - if (Nfactor > scrypt_maxN) { - scrypt_fatal_error("scrypt: N out of range"); - } - N = (1 << (Nfactor + 1)); - - if (Nfactor != s_Nfactor) - { - opt_nfactor = Nfactor; - applog(LOG_INFO, "N-factor is %d (%d)!", Nfactor, N); - if (s_Nfactor != 0) { - // handle N-factor increase at runtime - // by adjusting the lookup_gap by factor 2 - if (s_Nfactor == Nfactor-1) - for (int i=0; i < 8; ++i) - device_lookup_gap[i] *= 2; - } - s_Nfactor = Nfactor; - } - - static __thread int throughput = 0; - if(!init[thr_id]) { - int dev_id = device_map[thr_id]; - - cudaSetDevice(dev_id); - cudaDeviceSynchronize(); - cudaDeviceReset(); - cudaSetDevice(dev_id); - - throughput = cuda_throughput(thr_id); - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - init[thr_id] = true; - } - - if(throughput == 0) - return -1; - - gettimeofday(tv_start, NULL); - - uint32_t *data[2] = { new uint32_t[20*throughput], new uint32_t[20*throughput] }; - uint32_t* hash[2] = { cuda_hashbuffer(thr_id,0), cuda_hashbuffer(thr_id,1) }; - - uint32_t n = pdata[19]; - - /* byte swap pdata into data[0]/[1] arrays */ - for (int k=0; k<2; ++k) { - for(int z=0;z<20;z++) data[k][z] = bswap_32x4(pdata[z]); - for(int i=1;i 0) fprintf(stderr, "%d out of %d hashes differ.\n", err, throughput); - } -#endif - } else { - - // all on gpu - - n += throughput; - if (opt_debug && (iteration % 64 == 0)) - applog(LOG_DEBUG, "GPU #%d: n=%x", device_map[thr_id], n); - - cuda_scrypt_serialize(thr_id, nxt); - pre_keccak512(thr_id, nxt, nonce[nxt], throughput); - cuda_scrypt_core(thr_id, nxt, N); - //cuda_scrypt_flush(thr_id, nxt); - if (!cuda_scrypt_sync(thr_id, nxt)) { - break; - } - - post_keccak512(thr_id, nxt, nonce[nxt], throughput); - cuda_scrypt_done(thr_id, nxt); - - cuda_scrypt_DtoH(thr_id, hash[nxt], nxt, true); - //cuda_scrypt_flush(thr_id, nxt); // made by cuda_scrypt_sync - if (!cuda_scrypt_sync(thr_id, nxt)) { - break; - } - } - - for (int i=0; iteration > 0 && i -using namespace Concurrency; -#else -#include -#endif - -#include "miner.h" -#include "scrypt/salsa_kernel.h" -#include "scrypt/sha256.h" - -#include -#include -#include - -#include -#ifndef __APPLE__ -#include -#endif -#include - -#if _MSC_VER > 1800 -#undef _THROW1 -#define _THROW1(x) throw(std::bad_alloc) -#endif - -// A thin wrapper around the builtin __m128i type -class uint32x4_t -{ -public: -#if WIN32 - void * operator new(size_t size) _THROW1(_STD bad_alloc) { void *p; if ((p = _aligned_malloc(size, 16)) == 0) { static const std::bad_alloc nomem; _RAISE(nomem); } return (p); } - void operator delete(void *p) { _aligned_free(p); } - void * operator new[](size_t size) _THROW1(_STD bad_alloc) { void *p; if ((p = _aligned_malloc(size, 16)) == 0) { static const std::bad_alloc nomem; _RAISE(nomem); } return (p); } - void operator delete[](void *p) { _aligned_free(p); } -#else - void * operator new(size_t size) throw(std::bad_alloc) { void *p; if (posix_memalign(&p, 16, size) < 0) { static const std::bad_alloc nomem; throw nomem; } return (p); } - void operator delete(void *p) { free(p); } - void * operator new[](size_t size) throw(std::bad_alloc) { void *p; if (posix_memalign(&p, 16, size) < 0) { static const std::bad_alloc nomem; throw nomem; } return (p); } - void operator delete[](void *p) { free(p); } -#endif - uint32x4_t() { }; - uint32x4_t(const __m128i init) { val = init; } - uint32x4_t(const uint32_t init) { val = _mm_set1_epi32((int)init); } - uint32x4_t(const uint32_t a, const uint32_t b, const uint32_t c, const uint32_t d) { val = _mm_setr_epi32((int)a,(int)b,(int)c,(int)d); } - inline operator const __m128i() const { return val; } - inline const uint32x4_t operator+(const uint32x4_t &other) const { return _mm_add_epi32(val, other); } - inline const uint32x4_t operator+(const uint32_t other) const { return _mm_add_epi32(val, _mm_set1_epi32((int)other)); } - inline uint32x4_t& operator+=(const uint32x4_t other) { val = _mm_add_epi32(val, other); return *this; } - inline uint32x4_t& operator+=(const uint32_t other) { val = _mm_add_epi32(val, _mm_set1_epi32((int)other)); return *this; } - inline const uint32x4_t operator&(const uint32_t other) const { return _mm_and_si128(val, _mm_set1_epi32((int)other)); } - inline const uint32x4_t operator&(const uint32x4_t &other) const { return _mm_and_si128(val, other); } - inline const uint32x4_t operator|(const uint32x4_t &other) const { return _mm_or_si128(val, other); } - inline const uint32x4_t operator^(const uint32x4_t &other) const { return _mm_xor_si128(val, other); } - inline const uint32x4_t operator<<(const int num) const { return _mm_slli_epi32(val, num); } - inline const uint32x4_t operator>>(const int num) const { return _mm_srli_epi32(val, num); } - inline const uint32_t operator[](const int num) const { return ((uint32_t*)&val)[num]; } - protected: - __m128i val; -}; - -// non-member overload -inline const uint32x4_t operator+(const uint32_t left, const uint32x4_t &right) { return _mm_add_epi32(_mm_set1_epi32((int)left), right); } - - -// -// Code taken from sha2.cpp and vectorized, with minimal changes where required -// Not all subroutines are actually used. -// - -#define bswap_32x4(x) ((((x) << 24) & 0xff000000u) | (((x) << 8) & 0x00ff0000u) \ - | (((x) >> 8) & 0x0000ff00u) | (((x) >> 24) & 0x000000ffu)) - -static __inline uint32x4_t swab32x4(const uint32x4_t &v) -{ - return bswap_32x4(v); -} - -static const uint32_t sha256_h[8] = { - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, - 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 -}; - -static const uint32_t sha256_k[64] = { - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, - 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, - 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, - 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, - 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, - 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, - 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, - 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, - 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -}; - -void sha256_initx4(uint32x4_t *statex4) -{ - for (int i=0; i<8; ++i) - statex4[i] = sha256_h[i]; -} - -/* Elementary functions used by SHA256 */ -#define Ch(x, y, z) ((x & (y ^ z)) ^ z) -#define Maj(x, y, z) ((x & (y | z)) | (y & z)) -#define ROTR(x, n) ((x >> n) | (x << (32 - n))) -#define S0(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22)) -#define S1(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25)) -#define s0(x) (ROTR(x, 7) ^ ROTR(x, 18) ^ (x >> 3)) -#define s1(x) (ROTR(x, 17) ^ ROTR(x, 19) ^ (x >> 10)) - -/* SHA256 round function */ -#define RND(a, b, c, d, e, f, g, h, k) \ - do { \ - t0 = h + S1(e) + Ch(e, f, g) + k; \ - t1 = S0(a) + Maj(a, b, c); \ - d += t0; \ - h = t0 + t1; \ - } while (0) - -/* Adjusted round function for rotating state */ -#define RNDr(S, W, i) \ - RND(S[(64 - i) % 8], S[(65 - i) % 8], \ - S[(66 - i) % 8], S[(67 - i) % 8], \ - S[(68 - i) % 8], S[(69 - i) % 8], \ - S[(70 - i) % 8], S[(71 - i) % 8], \ - W[i] + sha256_k[i]) - -/* - * SHA256 block compression function. The 256-bit state is transformed via - * the 512-bit input block to produce a new state. - */ -void sha256_transformx4(uint32x4_t *state, const uint32x4_t *block, int swap) -{ - uint32x4_t W[64]; - uint32x4_t S[8]; - uint32x4_t t0, t1; - int i; - - /* 1. Prepare message schedule W. */ - if (swap) { - for (i = 0; i < 16; i++) - W[i] = swab32x4(block[i]); - } else - memcpy(W, block, 4*64); - for (i = 16; i < 64; i += 2) { - W[i] = s1(W[i - 2]) + W[i - 7] + s0(W[i - 15]) + W[i - 16]; - W[i+1] = s1(W[i - 1]) + W[i - 6] + s0(W[i - 14]) + W[i - 15]; - } - - /* 2. Initialize working variables. */ - memcpy(S, state, 4*32); - - /* 3. Mix. */ - RNDr(S, W, 0); - RNDr(S, W, 1); - RNDr(S, W, 2); - RNDr(S, W, 3); - RNDr(S, W, 4); - RNDr(S, W, 5); - RNDr(S, W, 6); - RNDr(S, W, 7); - RNDr(S, W, 8); - RNDr(S, W, 9); - RNDr(S, W, 10); - RNDr(S, W, 11); - RNDr(S, W, 12); - RNDr(S, W, 13); - RNDr(S, W, 14); - RNDr(S, W, 15); - RNDr(S, W, 16); - RNDr(S, W, 17); - RNDr(S, W, 18); - RNDr(S, W, 19); - RNDr(S, W, 20); - RNDr(S, W, 21); - RNDr(S, W, 22); - RNDr(S, W, 23); - RNDr(S, W, 24); - RNDr(S, W, 25); - RNDr(S, W, 26); - RNDr(S, W, 27); - RNDr(S, W, 28); - RNDr(S, W, 29); - RNDr(S, W, 30); - RNDr(S, W, 31); - RNDr(S, W, 32); - RNDr(S, W, 33); - RNDr(S, W, 34); - RNDr(S, W, 35); - RNDr(S, W, 36); - RNDr(S, W, 37); - RNDr(S, W, 38); - RNDr(S, W, 39); - RNDr(S, W, 40); - RNDr(S, W, 41); - RNDr(S, W, 42); - RNDr(S, W, 43); - RNDr(S, W, 44); - RNDr(S, W, 45); - RNDr(S, W, 46); - RNDr(S, W, 47); - RNDr(S, W, 48); - RNDr(S, W, 49); - RNDr(S, W, 50); - RNDr(S, W, 51); - RNDr(S, W, 52); - RNDr(S, W, 53); - RNDr(S, W, 54); - RNDr(S, W, 55); - RNDr(S, W, 56); - RNDr(S, W, 57); - RNDr(S, W, 58); - RNDr(S, W, 59); - RNDr(S, W, 60); - RNDr(S, W, 61); - RNDr(S, W, 62); - RNDr(S, W, 63); - - /* 4. Mix local working variables into global state */ - for (i = 0; i < 8; i++) - state[i] += S[i]; -} - -static const uint32_t sha256d_hash1[16] = { - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x80000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000100 -}; - -static void sha256dx4(uint32x4_t *hash, uint32x4_t *data) -{ - uint32x4_t S[16]; - - sha256_initx4(S); - sha256_transformx4(S, data, 0); - sha256_transformx4(S, data + 16, 0); - for (int i=8; i<16; ++i) - S[i] = sha256d_hash1[i]; - sha256_initx4(hash); - sha256_transformx4(hash, S, 0); -} - -static inline void sha256d_preextendx4(uint32x4_t *W) -{ - W[16] = s1(W[14]) + W[ 9] + s0(W[ 1]) + W[ 0]; - W[17] = s1(W[15]) + W[10] + s0(W[ 2]) + W[ 1]; - W[18] = s1(W[16]) + W[11] + W[ 2]; - W[19] = s1(W[17]) + W[12] + s0(W[ 4]); - W[20] = W[13] + s0(W[ 5]) + W[ 4]; - W[21] = W[14] + s0(W[ 6]) + W[ 5]; - W[22] = W[15] + s0(W[ 7]) + W[ 6]; - W[23] = W[16] + s0(W[ 8]) + W[ 7]; - W[24] = W[17] + s0(W[ 9]) + W[ 8]; - W[25] = s0(W[10]) + W[ 9]; - W[26] = s0(W[11]) + W[10]; - W[27] = s0(W[12]) + W[11]; - W[28] = s0(W[13]) + W[12]; - W[29] = s0(W[14]) + W[13]; - W[30] = s0(W[15]) + W[14]; - W[31] = s0(W[16]) + W[15]; -} - -static inline void sha256d_prehashx4(uint32x4_t *S, const uint32x4_t *W) -{ - uint32x4_t t0, t1; - RNDr(S, W, 0); - RNDr(S, W, 1); - RNDr(S, W, 2); -} - -static inline void sha256d_msx4(uint32x4_t *hash, uint32x4_t *W, - const uint32_t *midstate, const uint32_t *prehash) -{ - uint32x4_t S[64]; - uint32x4_t t0, t1; - int i; - - S[18] = W[18]; - S[19] = W[19]; - S[20] = W[20]; - S[22] = W[22]; - S[23] = W[23]; - S[24] = W[24]; - S[30] = W[30]; - S[31] = W[31]; - - W[18] += s0(W[3]); - W[19] += W[3]; - W[20] += s1(W[18]); - W[21] = s1(W[19]); - W[22] += s1(W[20]); - W[23] += s1(W[21]); - W[24] += s1(W[22]); - W[25] = s1(W[23]) + W[18]; - W[26] = s1(W[24]) + W[19]; - W[27] = s1(W[25]) + W[20]; - W[28] = s1(W[26]) + W[21]; - W[29] = s1(W[27]) + W[22]; - W[30] += s1(W[28]) + W[23]; - W[31] += s1(W[29]) + W[24]; - for (i = 32; i < 64; i += 2) { - W[i] = s1(W[i - 2]) + W[i - 7] + s0(W[i - 15]) + W[i - 16]; - W[i+1] = s1(W[i - 1]) + W[i - 6] + s0(W[i - 14]) + W[i - 15]; - } - - for (i=0; i<8; ++i) - S[i] = prehash[i]; - - RNDr(S, W, 3); - RNDr(S, W, 4); - RNDr(S, W, 5); - RNDr(S, W, 6); - RNDr(S, W, 7); - RNDr(S, W, 8); - RNDr(S, W, 9); - RNDr(S, W, 10); - RNDr(S, W, 11); - RNDr(S, W, 12); - RNDr(S, W, 13); - RNDr(S, W, 14); - RNDr(S, W, 15); - RNDr(S, W, 16); - RNDr(S, W, 17); - RNDr(S, W, 18); - RNDr(S, W, 19); - RNDr(S, W, 20); - RNDr(S, W, 21); - RNDr(S, W, 22); - RNDr(S, W, 23); - RNDr(S, W, 24); - RNDr(S, W, 25); - RNDr(S, W, 26); - RNDr(S, W, 27); - RNDr(S, W, 28); - RNDr(S, W, 29); - RNDr(S, W, 30); - RNDr(S, W, 31); - RNDr(S, W, 32); - RNDr(S, W, 33); - RNDr(S, W, 34); - RNDr(S, W, 35); - RNDr(S, W, 36); - RNDr(S, W, 37); - RNDr(S, W, 38); - RNDr(S, W, 39); - RNDr(S, W, 40); - RNDr(S, W, 41); - RNDr(S, W, 42); - RNDr(S, W, 43); - RNDr(S, W, 44); - RNDr(S, W, 45); - RNDr(S, W, 46); - RNDr(S, W, 47); - RNDr(S, W, 48); - RNDr(S, W, 49); - RNDr(S, W, 50); - RNDr(S, W, 51); - RNDr(S, W, 52); - RNDr(S, W, 53); - RNDr(S, W, 54); - RNDr(S, W, 55); - RNDr(S, W, 56); - RNDr(S, W, 57); - RNDr(S, W, 58); - RNDr(S, W, 59); - RNDr(S, W, 60); - RNDr(S, W, 61); - RNDr(S, W, 62); - RNDr(S, W, 63); - - for (i = 0; i < 8; i++) - S[i] += midstate[i]; - - W[18] = S[18]; - W[19] = S[19]; - W[20] = S[20]; - W[22] = S[22]; - W[23] = S[23]; - W[24] = S[24]; - W[30] = S[30]; - W[31] = S[31]; - - for (i=8; i<16; ++i) - S[i] = sha256d_hash1[i]; - S[16] = s1(sha256d_hash1[14]) + sha256d_hash1[ 9] + s0(S[ 1]) + S[ 0]; - S[17] = s1(sha256d_hash1[15]) + sha256d_hash1[10] + s0(S[ 2]) + S[ 1]; - S[18] = s1(S[16]) + sha256d_hash1[11] + s0(S[ 3]) + S[ 2]; - S[19] = s1(S[17]) + sha256d_hash1[12] + s0(S[ 4]) + S[ 3]; - S[20] = s1(S[18]) + sha256d_hash1[13] + s0(S[ 5]) + S[ 4]; - S[21] = s1(S[19]) + sha256d_hash1[14] + s0(S[ 6]) + S[ 5]; - S[22] = s1(S[20]) + sha256d_hash1[15] + s0(S[ 7]) + S[ 6]; - S[23] = s1(S[21]) + S[16] + s0(sha256d_hash1[ 8]) + S[ 7]; - S[24] = s1(S[22]) + S[17] + s0(sha256d_hash1[ 9]) + sha256d_hash1[ 8]; - S[25] = s1(S[23]) + S[18] + s0(sha256d_hash1[10]) + sha256d_hash1[ 9]; - S[26] = s1(S[24]) + S[19] + s0(sha256d_hash1[11]) + sha256d_hash1[10]; - S[27] = s1(S[25]) + S[20] + s0(sha256d_hash1[12]) + sha256d_hash1[11]; - S[28] = s1(S[26]) + S[21] + s0(sha256d_hash1[13]) + sha256d_hash1[12]; - S[29] = s1(S[27]) + S[22] + s0(sha256d_hash1[14]) + sha256d_hash1[13]; - S[30] = s1(S[28]) + S[23] + s0(sha256d_hash1[15]) + sha256d_hash1[14]; - S[31] = s1(S[29]) + S[24] + s0(S[16]) + sha256d_hash1[15]; - for (i = 32; i < 60; i += 2) { - S[i] = s1(S[i - 2]) + S[i - 7] + s0(S[i - 15]) + S[i - 16]; - S[i+1] = s1(S[i - 1]) + S[i - 6] + s0(S[i - 14]) + S[i - 15]; - } - S[60] = s1(S[58]) + S[53] + s0(S[45]) + S[44]; - - sha256_initx4(hash); - - RNDr(hash, S, 0); - RNDr(hash, S, 1); - RNDr(hash, S, 2); - RNDr(hash, S, 3); - RNDr(hash, S, 4); - RNDr(hash, S, 5); - RNDr(hash, S, 6); - RNDr(hash, S, 7); - RNDr(hash, S, 8); - RNDr(hash, S, 9); - RNDr(hash, S, 10); - RNDr(hash, S, 11); - RNDr(hash, S, 12); - RNDr(hash, S, 13); - RNDr(hash, S, 14); - RNDr(hash, S, 15); - RNDr(hash, S, 16); - RNDr(hash, S, 17); - RNDr(hash, S, 18); - RNDr(hash, S, 19); - RNDr(hash, S, 20); - RNDr(hash, S, 21); - RNDr(hash, S, 22); - RNDr(hash, S, 23); - RNDr(hash, S, 24); - RNDr(hash, S, 25); - RNDr(hash, S, 26); - RNDr(hash, S, 27); - RNDr(hash, S, 28); - RNDr(hash, S, 29); - RNDr(hash, S, 30); - RNDr(hash, S, 31); - RNDr(hash, S, 32); - RNDr(hash, S, 33); - RNDr(hash, S, 34); - RNDr(hash, S, 35); - RNDr(hash, S, 36); - RNDr(hash, S, 37); - RNDr(hash, S, 38); - RNDr(hash, S, 39); - RNDr(hash, S, 40); - RNDr(hash, S, 41); - RNDr(hash, S, 42); - RNDr(hash, S, 43); - RNDr(hash, S, 44); - RNDr(hash, S, 45); - RNDr(hash, S, 46); - RNDr(hash, S, 47); - RNDr(hash, S, 48); - RNDr(hash, S, 49); - RNDr(hash, S, 50); - RNDr(hash, S, 51); - RNDr(hash, S, 52); - RNDr(hash, S, 53); - RNDr(hash, S, 54); - RNDr(hash, S, 55); - RNDr(hash, S, 56); - - hash[2] += hash[6] + S1(hash[3]) + Ch(hash[3], hash[4], hash[5]) - + S[57] + sha256_k[57]; - hash[1] += hash[5] + S1(hash[2]) + Ch(hash[2], hash[3], hash[4]) - + S[58] + sha256_k[58]; - hash[0] += hash[4] + S1(hash[1]) + Ch(hash[1], hash[2], hash[3]) - + S[59] + sha256_k[59]; - hash[7] += hash[3] + S1(hash[0]) + Ch(hash[0], hash[1], hash[2]) - + S[60] + sha256_k[60] - + sha256_h[7]; -} - -// -// Code taken from original scrypt.cpp and vectorized with minimal changes. -// - -static const uint32x4_t keypadx4[12] = { - 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000280 -}; -static const uint32x4_t innerpadx4[11] = { - 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x000004a0 -}; -static const uint32x4_t outerpadx4[8] = { - 0x80000000, 0, 0, 0, 0, 0, 0, 0x00000300 -}; -static const uint32x4_t finalblkx4[16] = { - 0x00000001, 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000620 -}; - -static inline void HMAC_SHA256_80_initx4(const uint32x4_t *key, - uint32x4_t *tstate, uint32x4_t *ostate) -{ - uint32x4_t ihash[8]; - uint32x4_t pad[16]; - int i; - - /* tstate is assumed to contain the midstate of key */ - memcpy(pad, key + 16, 4*16); - memcpy(pad + 4, keypadx4, 4*48); - sha256_transformx4(tstate, pad, 0); - memcpy(ihash, tstate, 4*32); - - sha256_initx4(ostate); - for (i = 0; i < 8; i++) - pad[i] = ihash[i] ^ 0x5c5c5c5c; - for (; i < 16; i++) - pad[i] = 0x5c5c5c5c; - sha256_transformx4(ostate, pad, 0); - - sha256_initx4(tstate); - for (i = 0; i < 8; i++) - pad[i] = ihash[i] ^ 0x36363636; - for (; i < 16; i++) - pad[i] = 0x36363636; - sha256_transformx4(tstate, pad, 0); -} - -static inline void PBKDF2_SHA256_80_128x4(const uint32x4_t *tstate, - const uint32x4_t *ostate, const uint32x4_t *salt, uint32x4_t *output) -{ - uint32x4_t istate[8], ostate2[8]; - uint32x4_t ibuf[16], obuf[16]; - int i, j; - - memcpy(istate, tstate, 4*32); - sha256_transformx4(istate, salt, 0); - - memcpy(ibuf, salt + 16, 4*16); - memcpy(ibuf + 5, innerpadx4, 4*44); - memcpy(obuf + 8, outerpadx4, 4*32); - - for (i = 0; i < 4; i++) { - memcpy(obuf, istate, 4*32); - ibuf[4] = i + 1; - sha256_transformx4(obuf, ibuf, 0); - - memcpy(ostate2, ostate, 4*32); - sha256_transformx4(ostate2, obuf, 0); - for (j = 0; j < 8; j++) - output[8 * i + j] = swab32x4(ostate2[j]); - } -} - -static inline void PBKDF2_SHA256_128_32x4(uint32x4_t *tstate, uint32x4_t *ostate, - const uint32x4_t *salt, uint32x4_t *output) -{ - uint32x4_t buf[16]; - int i; - - sha256_transformx4(tstate, salt, 1); - sha256_transformx4(tstate, salt + 16, 1); - sha256_transformx4(tstate, finalblkx4, 0); - memcpy(buf, tstate, 4*32); - memcpy(buf + 8, outerpadx4, 4*32); - - sha256_transformx4(ostate, buf, 0); - for (i = 0; i < 8; i++) - output[i] = swab32x4(ostate[i]); -} - - -// -// Original scrypt.cpp HMAC SHA256 functions -// - -static const uint32_t keypad[12] = { - 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000280 -}; -static const uint32_t innerpad[11] = { - 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x000004a0 -}; -static const uint32_t outerpad[8] = { - 0x80000000, 0, 0, 0, 0, 0, 0, 0x00000300 -}; -static const uint32_t finalblk[16] = { - 0x00000001, 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000620 -}; - -static inline void HMAC_SHA256_80_init(const uint32_t *key, - uint32_t *tstate, uint32_t *ostate) -{ - uint32_t ihash[8]; - uint32_t pad[16]; - int i; - - /* tstate is assumed to contain the midstate of key */ - memcpy(pad, key + 16, 16); - memcpy(pad + 4, keypad, 48); - sha256_transform(tstate, pad, 0); - memcpy(ihash, tstate, 32); - - sha256_init(ostate); - for (i = 0; i < 8; i++) - pad[i] = ihash[i] ^ 0x5c5c5c5c; - for (; i < 16; i++) - pad[i] = 0x5c5c5c5c; - sha256_transform(ostate, pad, 0); - - sha256_init(tstate); - for (i = 0; i < 8; i++) - pad[i] = ihash[i] ^ 0x36363636; - for (; i < 16; i++) - pad[i] = 0x36363636; - sha256_transform(tstate, pad, 0); -} - -static inline void PBKDF2_SHA256_80_128(const uint32_t *tstate, - const uint32_t *ostate, const uint32_t *salt, uint32_t *output) -{ - uint32_t istate[8], ostate2[8]; - uint32_t ibuf[16], obuf[16]; - int i, j; - - memcpy(istate, tstate, 32); - sha256_transform(istate, salt, 0); - - memcpy(ibuf, salt + 16, 16); - memcpy(ibuf + 5, innerpad, 44); - memcpy(obuf + 8, outerpad, 32); - - for (i = 0; i < 4; i++) { - memcpy(obuf, istate, 32); - ibuf[4] = i + 1; - sha256_transform(obuf, ibuf, 0); - - memcpy(ostate2, ostate, 32); - sha256_transform(ostate2, obuf, 0); - for (j = 0; j < 8; j++) - output[8 * i + j] = swab32(ostate2[j]); - } -} - -static inline void PBKDF2_SHA256_128_32(uint32_t *tstate, uint32_t *ostate, - const uint32_t *salt, uint32_t *output) -{ - uint32_t buf[16]; - - sha256_transform(tstate, salt, 1); - sha256_transform(tstate, salt + 16, 1); - sha256_transform(tstate, finalblk, 0); - memcpy(buf, tstate, 32); - memcpy(buf + 8, outerpad, 32); - - sha256_transform(ostate, buf, 0); - for (int i = 0; i < 8; i++) - output[i] = swab32(ostate[i]); -} - -static int lastFactor = 0; - -static void computeGold(uint32_t* const input, uint32_t *reference, uchar *scratchpad); - -static bool init[MAX_GPUS] = { 0 }; - -// cleanup -void free_scrypt(int thr_id) -{ - int dev_id = device_map[thr_id]; - - if (!init[thr_id]) - return; - - // trivial way to free all... - cudaSetDevice(dev_id); - cudaDeviceSynchronize(); - cudaDeviceReset(); - - init[thr_id] = false; -} - -// Scrypt proof of work algorithm -// using SSE2 vectorized HMAC SHA256 on CPU and -// a salsa core implementation on GPU with CUDA -// -int scanhash_scrypt(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done, - unsigned char *scratchbuf, struct timeval *tv_start, struct timeval *tv_end) -{ - int result = 0; - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - static __thread int throughput = 0; - - if (!init[thr_id]) { - int dev_id = device_map[thr_id]; - cudaSetDevice(dev_id); - cudaDeviceSynchronize(); - cudaDeviceReset(); - cudaSetDevice(dev_id); - - throughput = cuda_throughput(thr_id); - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - init[thr_id] = true; - } - - if (throughput == 0) - return -1; - - gettimeofday(tv_start, NULL); - - uint32_t n = pdata[19]; - const uint32_t Htarg = ptarget[7]; - - // no default set with --cputest - if (opt_nfactor == 0) opt_nfactor = 9; - uint32_t N = (1UL<<(opt_nfactor+1)); - uint32_t *scratch = new uint32_t[N*32]; // scratchbuffer for CPU based validation - - uint32_t nonce[2]; - uint32_t* hash[2] = { cuda_hashbuffer(thr_id,0), cuda_hashbuffer(thr_id,1) }; - uint32_t* X[2] = { cuda_transferbuffer(thr_id,0), cuda_transferbuffer(thr_id,1) }; - - bool sha_on_cpu = (parallel < 2); - bool sha_multithreaded = (parallel == 1); - uint32x4_t* datax4[2] = { sha_on_cpu ? new uint32x4_t[throughput/4 * 20] : NULL, sha_on_cpu ? new uint32x4_t[throughput/4 * 20] : NULL }; - uint32x4_t* hashx4[2] = { sha_on_cpu ? new uint32x4_t[throughput/4 * 8] : NULL, sha_on_cpu ? new uint32x4_t[throughput/4 * 8] : NULL }; - uint32x4_t* tstatex4[2] = { sha_on_cpu ? new uint32x4_t[throughput/4 * 8] : NULL, sha_on_cpu ? new uint32x4_t[throughput/4 * 8] : NULL }; - uint32x4_t* ostatex4[2] = { sha_on_cpu ? new uint32x4_t[throughput/4 * 8] : NULL, sha_on_cpu ? new uint32x4_t[throughput/4 * 8] : NULL }; - uint32x4_t* Xx4[2] = { sha_on_cpu ? new uint32x4_t[throughput/4 * 32] : NULL, sha_on_cpu ? new uint32x4_t[throughput/4 * 32] : NULL }; - - // log n-factor - if (!opt_quiet && lastFactor != opt_nfactor) { - applog(LOG_WARNING, "scrypt factor set to %d (%u)", opt_nfactor, N); - lastFactor = opt_nfactor; - } - - uint32_t _ALIGN(64) midstate[8]; - sha256_init(midstate); - sha256_transform(midstate, pdata, 0); - - if (sha_on_cpu) { - for (int i = 0; i < throughput/4; ++i) { - for (int j = 0; j < 20; j++) { - datax4[0][20*i+j] = uint32x4_t(pdata[j]); - datax4[1][20*i+j] = uint32x4_t(pdata[j]); - } - } - } - else prepare_sha256(thr_id, pdata, midstate); - - int cur = 1, nxt = 0; - int iteration = 0; - int num_shares = (4*opt_n_threads) || 1; // opt_n_threads can be 0 with --cputest - int share_workload = ((((throughput + num_shares-1) / num_shares) + 3) / 4) * 4; - - do { - nonce[nxt] = n; - - if (sha_on_cpu) - { - for (int i = 0; i < throughput/4; i++) { - datax4[nxt][i * 20 + 19] = uint32x4_t(n+0, n+1, n+2, n+3); - n += 4; - } - if (sha_multithreaded) - { -#ifdef WIN32 - parallel_for (0, num_shares, [&](int share) { - for (int k = (share_workload*share)/4; k < (share_workload*(share+1))/4 && k < throughput/4; k++) { - for (int l = 0; l < 8; l++) - tstatex4[nxt][k * 8 + l] = uint32x4_t(midstate[l]); - HMAC_SHA256_80_initx4(&datax4[nxt][k * 20], &tstatex4[nxt][k * 8], &ostatex4[nxt][k * 8]); - PBKDF2_SHA256_80_128x4(&tstatex4[nxt][k * 8], &ostatex4[nxt][k * 8], &datax4[nxt][k * 20], &Xx4[nxt][k * 32]); - } - } ); -#else - #pragma omp parallel for - for (int share = 0; share < num_shares; share++) { - for (int k = (share_workload*share)/4; k < (share_workload*(share+1))/4 && k < throughput/4; k++) { - for (int l = 0; l < 8; l++) - tstatex4[nxt][k * 8 + l] = uint32x4_t(midstate[l]); - HMAC_SHA256_80_initx4(&datax4[nxt][k * 20], &tstatex4[nxt][k * 8], &ostatex4[nxt][k * 8]); - PBKDF2_SHA256_80_128x4(&tstatex4[nxt][k * 8], &ostatex4[nxt][k * 8], &datax4[nxt][k * 20], &Xx4[nxt][k * 32]); - } - } -#endif - } - else /* sha_multithreaded */ - { - for (int k = 0; k < throughput/4; k++) { - for (int l = 0; l < 8; l++) - tstatex4[nxt][k * 8 + l] = uint32x4_t(midstate[l]); - HMAC_SHA256_80_initx4(&datax4[nxt][k * 20], &tstatex4[nxt][k * 8], &ostatex4[nxt][k * 8]); - PBKDF2_SHA256_80_128x4(&tstatex4[nxt][k * 8], &ostatex4[nxt][k * 8], &datax4[nxt][k * 20], &Xx4[nxt][k * 32]); - } - } - - for (int i = 0; i < throughput/4; i++) { - for (int j = 0; j < 32; j++) { - uint32x4_t &t = Xx4[nxt][i * 32 + j]; - X[nxt][(4*i+0)*32+j] = t[0]; X[nxt][(4*i+1)*32+j] = t[1]; - X[nxt][(4*i+2)*32+j] = t[2]; X[nxt][(4*i+3)*32+j] = t[3]; - } - } - - cuda_scrypt_serialize(thr_id, nxt); - cuda_scrypt_HtoD(thr_id, X[nxt], nxt); - - cuda_scrypt_core(thr_id, nxt, N); - cuda_scrypt_done(thr_id, nxt); - - cuda_scrypt_DtoH(thr_id, X[nxt], nxt, false); - //cuda_scrypt_flush(thr_id, nxt); - if(!cuda_scrypt_sync(thr_id, nxt)) - { - result = -1; - break; - } - - for (int i = 0; i < throughput/4; i++) { - for (int j = 0; j < 32; j++) { - Xx4[cur][i * 32 + j] = uint32x4_t( - X[cur][(4*i+0)*32+j], X[cur][(4*i+1)*32+j], - X[cur][(4*i+2)*32+j], X[cur][(4*i+3)*32+j] - ); - } - } - - if (sha_multithreaded) - { -#ifdef WIN32 - parallel_for (0, num_shares, [&](int share) { - for (int k = (share_workload*share)/4; k < (share_workload*(share+1))/4 && k < throughput/4; k++) { - PBKDF2_SHA256_128_32x4(&tstatex4[cur][k * 8], &ostatex4[cur][k * 8], &Xx4[cur][k * 32], &hashx4[cur][k * 8]); - } - } ); -#else - #pragma omp parallel for - for (int share = 0; share < num_shares; share++) { - for (int k = (share_workload*share)/4; k < (share_workload*(share+1))/4 && k < throughput/4; k++) { - PBKDF2_SHA256_128_32x4(&tstatex4[cur][k * 8], &ostatex4[cur][k * 8], &Xx4[cur][k * 32], &hashx4[cur][k * 8]); - } - } -#endif - } else { - - for (int k = 0; k < throughput/4; k++) { - PBKDF2_SHA256_128_32x4(&tstatex4[cur][k * 8], &ostatex4[cur][k * 8], &Xx4[cur][k * 32], &hashx4[cur][k * 8]); - } - } - - for (int i = 0; i < throughput/4; i++) { - for (int j = 0; j < 8; j++) { - uint32x4_t &t = hashx4[cur][i * 8 + j]; - hash[cur][(4*i+0)*8+j] = t[0]; hash[cur][(4*i+1)*8+j] = t[1]; - hash[cur][(4*i+2)*8+j] = t[2]; hash[cur][(4*i+3)*8+j] = t[3]; - } - } - } - else /* sha_on_cpu */ - { - n += throughput; - - cuda_scrypt_serialize(thr_id, nxt); - pre_sha256(thr_id, nxt, nonce[nxt], throughput); - - cuda_scrypt_core(thr_id, nxt, N); - // cuda_scrypt_flush(thr_id, nxt); - if (!cuda_scrypt_sync(thr_id, nxt)) { - printf("error\n"); - result = -1; - break; - } - - post_sha256(thr_id, nxt, throughput); - cuda_scrypt_done(thr_id, nxt); - - cuda_scrypt_DtoH(thr_id, hash[nxt], nxt, true); - // cuda_scrypt_flush(thr_id, nxt); - if (!cuda_scrypt_sync(thr_id, nxt)) { - printf("error\n"); - result = -1; - break; - } - } - - if (iteration > 0 || opt_n_threads == 0) - { - for (int i = 0; i < throughput; i++) - { - if (hash[cur][i * 8 + 7] <= Htarg && fulltest(hash[cur] + i * 8, ptarget)) - { - // CPU based validation to rule out GPU errors (scalar CPU code) - uint32_t _ALIGN(64) inp[32], ref[32], tstate[8], ostate[8], refhash[8], ldata[20]; - - memcpy(ldata, pdata, 80); ldata[19] = nonce[cur] + i; - memcpy(tstate, midstate, 32); - HMAC_SHA256_80_init(ldata, tstate, ostate); - PBKDF2_SHA256_80_128(tstate, ostate, ldata, inp); - computeGold(inp, ref, (uchar*)scratch); - bool good = true; - - if (sha_on_cpu) { - if (memcmp(&X[cur][i * 32], ref, 32*sizeof(uint32_t)) != 0) good = false; - } else { - PBKDF2_SHA256_128_32(tstate, ostate, ref, refhash); - if (memcmp(&hash[cur][i * 8], refhash, 32) != 0) good = false; - } - - if (!good) { - gpulog(LOG_WARNING, thr_id, "result does not validate on CPU! (i=%d, s=%d)", i, cur); - } else { - *hashes_done = n - pdata[19]; - work_set_target_ratio(work, refhash); - pdata[19] = nonce[cur] + i; - result = 1; - goto byebye; - } - } - } - } - - cur = (cur+1)&1; - nxt = (nxt+1)&1; - ++iteration; - - //printf("n=%d, thr=%d, max=%d, rest=%d\n", n, throughput, max_nonce, work_restart[thr_id].restart); - } while (n <= max_nonce && !work_restart[thr_id].restart); - - *hashes_done = n - pdata[19]; - pdata[19] = n; -byebye: - delete[] datax4[0]; delete[] datax4[1]; delete[] hashx4[0]; delete[] hashx4[1]; - delete[] tstatex4[0]; delete[] tstatex4[1]; delete[] ostatex4[0]; delete[] ostatex4[1]; - delete[] Xx4[0]; delete[] Xx4[1]; - delete [] scratch; - gettimeofday(tv_end, NULL); - return result; -} - -#define ROTL(a, b) (((a) << (b)) | ((a) >> (32 - (b)))) - -static void xor_salsa8(uint32_t * const B, const uint32_t * const C) -{ - uint32_t x0 = (B[ 0] ^= C[ 0]), x1 = (B[ 1] ^= C[ 1]), x2 = (B[ 2] ^= C[ 2]), x3 = (B[ 3] ^= C[ 3]); - uint32_t x4 = (B[ 4] ^= C[ 4]), x5 = (B[ 5] ^= C[ 5]), x6 = (B[ 6] ^= C[ 6]), x7 = (B[ 7] ^= C[ 7]); - uint32_t x8 = (B[ 8] ^= C[ 8]), x9 = (B[ 9] ^= C[ 9]), xa = (B[10] ^= C[10]), xb = (B[11] ^= C[11]); - uint32_t xc = (B[12] ^= C[12]), xd = (B[13] ^= C[13]), xe = (B[14] ^= C[14]), xf = (B[15] ^= C[15]); - - /* Operate on columns. */ - x4 ^= ROTL(x0 + xc, 7); x9 ^= ROTL(x5 + x1, 7); xe ^= ROTL(xa + x6, 7); x3 ^= ROTL(xf + xb, 7); - x8 ^= ROTL(x4 + x0, 9); xd ^= ROTL(x9 + x5, 9); x2 ^= ROTL(xe + xa, 9); x7 ^= ROTL(x3 + xf, 9); - xc ^= ROTL(x8 + x4, 13); x1 ^= ROTL(xd + x9, 13); x6 ^= ROTL(x2 + xe, 13); xb ^= ROTL(x7 + x3, 13); - x0 ^= ROTL(xc + x8, 18); x5 ^= ROTL(x1 + xd, 18); xa ^= ROTL(x6 + x2, 18); xf ^= ROTL(xb + x7, 18); - - /* Operate on rows. */ - x1 ^= ROTL(x0 + x3, 7); x6 ^= ROTL(x5 + x4, 7); xb ^= ROTL(xa + x9, 7); xc ^= ROTL(xf + xe, 7); - x2 ^= ROTL(x1 + x0, 9); x7 ^= ROTL(x6 + x5, 9); x8 ^= ROTL(xb + xa, 9); xd ^= ROTL(xc + xf, 9); - x3 ^= ROTL(x2 + x1, 13); x4 ^= ROTL(x7 + x6, 13); x9 ^= ROTL(x8 + xb, 13); xe ^= ROTL(xd + xc, 13); - x0 ^= ROTL(x3 + x2, 18); x5 ^= ROTL(x4 + x7, 18); xa ^= ROTL(x9 + x8, 18); xf ^= ROTL(xe + xd, 18); - - /* Operate on columns. */ - x4 ^= ROTL(x0 + xc, 7); x9 ^= ROTL(x5 + x1, 7); xe ^= ROTL(xa + x6, 7); x3 ^= ROTL(xf + xb, 7); - x8 ^= ROTL(x4 + x0, 9); xd ^= ROTL(x9 + x5, 9); x2 ^= ROTL(xe + xa, 9); x7 ^= ROTL(x3 + xf, 9); - xc ^= ROTL(x8 + x4, 13); x1 ^= ROTL(xd + x9, 13); x6 ^= ROTL(x2 + xe, 13); xb ^= ROTL(x7 + x3, 13); - x0 ^= ROTL(xc + x8, 18); x5 ^= ROTL(x1 + xd, 18); xa ^= ROTL(x6 + x2, 18); xf ^= ROTL(xb + x7, 18); - - /* Operate on rows. */ - x1 ^= ROTL(x0 + x3, 7); x6 ^= ROTL(x5 + x4, 7); xb ^= ROTL(xa + x9, 7); xc ^= ROTL(xf + xe, 7); - x2 ^= ROTL(x1 + x0, 9); x7 ^= ROTL(x6 + x5, 9); x8 ^= ROTL(xb + xa, 9); xd ^= ROTL(xc + xf, 9); - x3 ^= ROTL(x2 + x1, 13); x4 ^= ROTL(x7 + x6, 13); x9 ^= ROTL(x8 + xb, 13); xe ^= ROTL(xd + xc, 13); - x0 ^= ROTL(x3 + x2, 18); x5 ^= ROTL(x4 + x7, 18); xa ^= ROTL(x9 + x8, 18); xf ^= ROTL(xe + xd, 18); - - /* Operate on columns. */ - x4 ^= ROTL(x0 + xc, 7); x9 ^= ROTL(x5 + x1, 7); xe ^= ROTL(xa + x6, 7); x3 ^= ROTL(xf + xb, 7); - x8 ^= ROTL(x4 + x0, 9); xd ^= ROTL(x9 + x5, 9); x2 ^= ROTL(xe + xa, 9); x7 ^= ROTL(x3 + xf, 9); - xc ^= ROTL(x8 + x4, 13); x1 ^= ROTL(xd + x9, 13); x6 ^= ROTL(x2 + xe, 13); xb ^= ROTL(x7 + x3, 13); - x0 ^= ROTL(xc + x8, 18); x5 ^= ROTL(x1 + xd, 18); xa ^= ROTL(x6 + x2, 18); xf ^= ROTL(xb + x7, 18); - - /* Operate on rows. */ - x1 ^= ROTL(x0 + x3, 7); x6 ^= ROTL(x5 + x4, 7); xb ^= ROTL(xa + x9, 7); xc ^= ROTL(xf + xe, 7); - x2 ^= ROTL(x1 + x0, 9); x7 ^= ROTL(x6 + x5, 9); x8 ^= ROTL(xb + xa, 9); xd ^= ROTL(xc + xf, 9); - x3 ^= ROTL(x2 + x1, 13); x4 ^= ROTL(x7 + x6, 13); x9 ^= ROTL(x8 + xb, 13); xe ^= ROTL(xd + xc, 13); - x0 ^= ROTL(x3 + x2, 18); x5 ^= ROTL(x4 + x7, 18); xa ^= ROTL(x9 + x8, 18); xf ^= ROTL(xe + xd, 18); - - /* Operate on columns. */ - x4 ^= ROTL(x0 + xc, 7); x9 ^= ROTL(x5 + x1, 7); xe ^= ROTL(xa + x6, 7); x3 ^= ROTL(xf + xb, 7); - x8 ^= ROTL(x4 + x0, 9); xd ^= ROTL(x9 + x5, 9); x2 ^= ROTL(xe + xa, 9); x7 ^= ROTL(x3 + xf, 9); - xc ^= ROTL(x8 + x4, 13); x1 ^= ROTL(xd + x9, 13); x6 ^= ROTL(x2 + xe, 13); xb ^= ROTL(x7 + x3, 13); - x0 ^= ROTL(xc + x8, 18); x5 ^= ROTL(x1 + xd, 18); xa ^= ROTL(x6 + x2, 18); xf ^= ROTL(xb + x7, 18); - - /* Operate on rows. */ - x1 ^= ROTL(x0 + x3, 7); x6 ^= ROTL(x5 + x4, 7); xb ^= ROTL(xa + x9, 7); xc ^= ROTL(xf + xe, 7); - x2 ^= ROTL(x1 + x0, 9); x7 ^= ROTL(x6 + x5, 9); x8 ^= ROTL(xb + xa, 9); xd ^= ROTL(xc + xf, 9); - x3 ^= ROTL(x2 + x1, 13); x4 ^= ROTL(x7 + x6, 13); x9 ^= ROTL(x8 + xb, 13); xe ^= ROTL(xd + xc, 13); - x0 ^= ROTL(x3 + x2, 18); x5 ^= ROTL(x4 + x7, 18); xa ^= ROTL(x9 + x8, 18); xf ^= ROTL(xe + xd, 18); - - B[ 0] += x0; B[ 1] += x1; B[ 2] += x2; B[ 3] += x3; B[ 4] += x4; B[ 5] += x5; B[ 6] += x6; B[ 7] += x7; - B[ 8] += x8; B[ 9] += x9; B[10] += xa; B[11] += xb; B[12] += xc; B[13] += xd; B[14] += xe; B[15] += xf; -} - -/** - * @param X input/ouput - * @param V scratch buffer - * @param N factor (def. 1024) - */ -static void scrypt_core(uint32_t *X, uint32_t *V, uint32_t N) -{ - for (uint32_t i = 0; i < N; i++) { - memcpy(&V[i * 32], X, 128); - xor_salsa8(&X[0], &X[16]); - xor_salsa8(&X[16], &X[0]); - } - for (uint32_t i = 0; i < N; i++) { - uint32_t j = 32 * (X[16] & (N - 1)); - for (uint8_t k = 0; k < 32; k++) - X[k] ^= V[j + k]; - xor_salsa8(&X[0], &X[16]); - xor_salsa8(&X[16], &X[0]); - } -} - -/** - * Compute reference data set on the CPU - * @param input input data as provided to device - * @param reference reference data, computed but preallocated - * @param scratchpad scrypt scratchpad - **/ -static void computeGold(uint32_t* const input, uint32_t *reference, uchar *scratchpad) -{ - uint32_t X[32] = { 0 }; - uint32_t *V = (uint32_t*) scratchpad; - uint32_t N = (1<<(opt_nfactor+1)); // default 9 = 1024 - - for (int k = 0; k < 32; k++) - X[k] = input[k]; - - scrypt_core(X, V, N); - - for (int k = 0; k < 32; k++) - reference[k] = X[k]; -} - -/* cputest */ -void scrypthash(void* output, const void* input) -{ - uint32_t _ALIGN(64) X[32], ref[32] = { 0 }, tstate[8], ostate[8], midstate[8]; - uint32_t _ALIGN(64) data[20]; - uchar *scratchbuf; - - // no default set with --cputest - if (opt_nfactor == 0) opt_nfactor = 9; - - scratchbuf = (uchar*) calloc(4 * 128 + 63, 1UL << (opt_nfactor+1)); - - memcpy(data, input, 80); - - sha256_init(midstate); - sha256_transform(midstate, data, 0); /* ok */ - - memcpy(tstate, midstate, 32); - HMAC_SHA256_80_init(data, tstate, ostate); - PBKDF2_SHA256_80_128(tstate, ostate, data, X); /* ok */ - - if (scratchbuf) { - computeGold(X, ref, scratchbuf); - PBKDF2_SHA256_128_32(tstate, ostate, ref, (uint32_t*) output); - } else { - memset(output, 0, 32); - } - - free(scratchbuf); -} diff --git a/scrypt/blake.cu b/scrypt/blake.cu deleted file mode 100644 index 5e8443a9..00000000 --- a/scrypt/blake.cu +++ /dev/null @@ -1,453 +0,0 @@ -// -// =============== BLAKE part on nVidia GPU ====================== -// -// This is the generic "default" implementation when no architecture -// specific implementation is available in the kernel. -// -// NOTE: compile this .cu module for compute_10,sm_10 with --maxrregcount=64 -// -// TODO: CUDA porting work remains to be done. -// - -#include -#include - -#include "miner.h" -#include "salsa_kernel.h" - -#include "cuda_helper.h" -typedef uint32_t sph_u32; -#define SPH_ROTL32 ROTL32 -#define SPH_ROTR32 ROTR32 - -__constant__ uint64_t ptarget64[4]; -__constant__ uint32_t pdata[20]; - -// define some error checking macros -#define DELIMITER '/' -#define __FILENAME__ ( strrchr(__FILE__, DELIMITER) != NULL ? strrchr(__FILE__, DELIMITER)+1 : __FILE__ ) - -#undef checkCudaErrors -#define checkCudaErrors(x) \ -{ \ - cudaGetLastError(); \ - x; \ - cudaError_t err = cudaGetLastError(); \ - if (err != cudaSuccess && !abort_flag) \ - applog(LOG_ERR, "GPU #%d: cudaError %d (%s) (%s line %d)\n", device_map[thr_id], err, cudaGetErrorString(err), __FILENAME__, __LINE__); \ -} - -// from salsa_kernel.cu -extern std::map context_idata[2]; -extern std::map context_odata[2]; -extern std::map context_streams[2]; -extern std::map context_hash[2]; - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -/** - * Encode a 32-bit value into the provided buffer (big endian convention). - * - * @param dst the destination buffer - * @param val the 32-bit value to encode - */ -static __device__ void -cuda_sph_enc32be(void *dst, sph_u32 val) -{ - *(sph_u32 *)dst = cuda_swab32(val); -} - -#define Z00 0 -#define Z01 1 -#define Z02 2 -#define Z03 3 -#define Z04 4 -#define Z05 5 -#define Z06 6 -#define Z07 7 -#define Z08 8 -#define Z09 9 -#define Z0A A -#define Z0B B -#define Z0C C -#define Z0D D -#define Z0E E -#define Z0F F - -#define Z10 E -#define Z11 A -#define Z12 4 -#define Z13 8 -#define Z14 9 -#define Z15 F -#define Z16 D -#define Z17 6 -#define Z18 1 -#define Z19 C -#define Z1A 0 -#define Z1B 2 -#define Z1C B -#define Z1D 7 -#define Z1E 5 -#define Z1F 3 - -#define Z20 B -#define Z21 8 -#define Z22 C -#define Z23 0 -#define Z24 5 -#define Z25 2 -#define Z26 F -#define Z27 D -#define Z28 A -#define Z29 E -#define Z2A 3 -#define Z2B 6 -#define Z2C 7 -#define Z2D 1 -#define Z2E 9 -#define Z2F 4 - -#define Z30 7 -#define Z31 9 -#define Z32 3 -#define Z33 1 -#define Z34 D -#define Z35 C -#define Z36 B -#define Z37 E -#define Z38 2 -#define Z39 6 -#define Z3A 5 -#define Z3B A -#define Z3C 4 -#define Z3D 0 -#define Z3E F -#define Z3F 8 - -#define Z40 9 -#define Z41 0 -#define Z42 5 -#define Z43 7 -#define Z44 2 -#define Z45 4 -#define Z46 A -#define Z47 F -#define Z48 E -#define Z49 1 -#define Z4A B -#define Z4B C -#define Z4C 6 -#define Z4D 8 -#define Z4E 3 -#define Z4F D - -#define Z50 2 -#define Z51 C -#define Z52 6 -#define Z53 A -#define Z54 0 -#define Z55 B -#define Z56 8 -#define Z57 3 -#define Z58 4 -#define Z59 D -#define Z5A 7 -#define Z5B 5 -#define Z5C F -#define Z5D E -#define Z5E 1 -#define Z5F 9 - -#define Z60 C -#define Z61 5 -#define Z62 1 -#define Z63 F -#define Z64 E -#define Z65 D -#define Z66 4 -#define Z67 A -#define Z68 0 -#define Z69 7 -#define Z6A 6 -#define Z6B 3 -#define Z6C 9 -#define Z6D 2 -#define Z6E 8 -#define Z6F B - -#define Z70 D -#define Z71 B -#define Z72 7 -#define Z73 E -#define Z74 C -#define Z75 1 -#define Z76 3 -#define Z77 9 -#define Z78 5 -#define Z79 0 -#define Z7A F -#define Z7B 4 -#define Z7C 8 -#define Z7D 6 -#define Z7E 2 -#define Z7F A - -#define Z80 6 -#define Z81 F -#define Z82 E -#define Z83 9 -#define Z84 B -#define Z85 3 -#define Z86 0 -#define Z87 8 -#define Z88 C -#define Z89 2 -#define Z8A D -#define Z8B 7 -#define Z8C 1 -#define Z8D 4 -#define Z8E A -#define Z8F 5 - -#define Z90 A -#define Z91 2 -#define Z92 8 -#define Z93 4 -#define Z94 7 -#define Z95 6 -#define Z96 1 -#define Z97 5 -#define Z98 F -#define Z99 B -#define Z9A 9 -#define Z9B E -#define Z9C 3 -#define Z9D C -#define Z9E D -#define Z9F 0 - -#define Mx(r, i) Mx_(Z ## r ## i) -#define Mx_(n) Mx__(n) -#define Mx__(n) M ## n - -#define CSx(r, i) CSx_(Z ## r ## i) -#define CSx_(n) CSx__(n) -#define CSx__(n) CS ## n - -#define CS0 SPH_C32(0x243F6A88) -#define CS1 SPH_C32(0x85A308D3) -#define CS2 SPH_C32(0x13198A2E) -#define CS3 SPH_C32(0x03707344) -#define CS4 SPH_C32(0xA4093822) -#define CS5 SPH_C32(0x299F31D0) -#define CS6 SPH_C32(0x082EFA98) -#define CS7 SPH_C32(0xEC4E6C89) -#define CS8 SPH_C32(0x452821E6) -#define CS9 SPH_C32(0x38D01377) -#define CSA SPH_C32(0xBE5466CF) -#define CSB SPH_C32(0x34E90C6C) -#define CSC SPH_C32(0xC0AC29B7) -#define CSD SPH_C32(0xC97C50DD) -#define CSE SPH_C32(0x3F84D5B5) -#define CSF SPH_C32(0xB5470917) - -#define GS(m0, m1, c0, c1, a, b, c, d) do { \ - a = SPH_T32(a + b + (m0 ^ c1)); \ - d = SPH_ROTR32(d ^ a, 16); \ - c = SPH_T32(c + d); \ - b = SPH_ROTR32(b ^ c, 12); \ - a = SPH_T32(a + b + (m1 ^ c0)); \ - d = SPH_ROTR32(d ^ a, 8); \ - c = SPH_T32(c + d); \ - b = SPH_ROTR32(b ^ c, 7); \ - } while (0) - -#define ROUND_S(r) do { \ - GS(Mx(r, 0), Mx(r, 1), CSx(r, 0), CSx(r, 1), V0, V4, V8, VC); \ - GS(Mx(r, 2), Mx(r, 3), CSx(r, 2), CSx(r, 3), V1, V5, V9, VD); \ - GS(Mx(r, 4), Mx(r, 5), CSx(r, 4), CSx(r, 5), V2, V6, VA, VE); \ - GS(Mx(r, 6), Mx(r, 7), CSx(r, 6), CSx(r, 7), V3, V7, VB, VF); \ - GS(Mx(r, 8), Mx(r, 9), CSx(r, 8), CSx(r, 9), V0, V5, VA, VF); \ - GS(Mx(r, A), Mx(r, B), CSx(r, A), CSx(r, B), V1, V6, VB, VC); \ - GS(Mx(r, C), Mx(r, D), CSx(r, C), CSx(r, D), V2, V7, V8, VD); \ - GS(Mx(r, E), Mx(r, F), CSx(r, E), CSx(r, F), V3, V4, V9, VE); \ - } while (0) - -#define COMPRESS32 do { \ - sph_u32 M0, M1, M2, M3, M4, M5, M6, M7; \ - sph_u32 M8, M9, MA, MB, MC, MD, ME, MF; \ - sph_u32 V0, V1, V2, V3, V4, V5, V6, V7; \ - sph_u32 V8, V9, VA, VB, VC, VD, VE, VF; \ - V0 = H0; \ - V1 = H1; \ - V2 = H2; \ - V3 = H3; \ - V4 = H4; \ - V5 = H5; \ - V6 = H6; \ - V7 = H7; \ - V8 = S0 ^ CS0; \ - V9 = S1 ^ CS1; \ - VA = S2 ^ CS2; \ - VB = S3 ^ CS3; \ - VC = T0 ^ CS4; \ - VD = T0 ^ CS5; \ - VE = T1 ^ CS6; \ - VF = T1 ^ CS7; \ - M0 = input[0]; \ - M1 = input[1]; \ - M2 = input[2]; \ - M3 = input[3]; \ - M4 = input[4]; \ - M5 = input[5]; \ - M6 = input[6]; \ - M7 = input[7]; \ - M8 = input[8]; \ - M9 = input[9]; \ - MA = input[10]; \ - MB = input[11]; \ - MC = input[12]; \ - MD = input[13]; \ - ME = input[14]; \ - MF = input[15]; \ - ROUND_S(0); \ - ROUND_S(1); \ - ROUND_S(2); \ - ROUND_S(3); \ - ROUND_S(4); \ - ROUND_S(5); \ - ROUND_S(6); \ - ROUND_S(7); \ - H0 ^= S0 ^ V0 ^ V8; \ - H1 ^= S1 ^ V1 ^ V9; \ - H2 ^= S2 ^ V2 ^ VA; \ - H3 ^= S3 ^ V3 ^ VB; \ - H4 ^= S0 ^ V4 ^ VC; \ - H5 ^= S1 ^ V5 ^ VD; \ - H6 ^= S2 ^ V6 ^ VE; \ - H7 ^= S3 ^ V7 ^ VF; \ - } while (0) - -__global__ -void cuda_blake256_hash( uint64_t *g_out, uint32_t nonce, uint32_t *g_good, bool validate ) -{ - uint32_t input[16]; - uint64_t output[4]; - - #pragma unroll - for (int i=0; i < 16; ++i) input[i] = pdata[i]; - - sph_u32 H0 = 0x6A09E667; - sph_u32 H1 = 0xBB67AE85; - sph_u32 H2 = 0x3C6EF372; - sph_u32 H3 = 0xA54FF53A; - sph_u32 H4 = 0x510E527F; - sph_u32 H5 = 0x9B05688C; - sph_u32 H6 = 0x1F83D9AB; - sph_u32 H7 = 0x5BE0CD19; - sph_u32 S0 = 0; - sph_u32 S1 = 0; - sph_u32 S2 = 0; - sph_u32 S3 = 0; - sph_u32 T0 = 0; - sph_u32 T1 = 0; - T0 = SPH_T32(T0 + 512); - COMPRESS32; - - #pragma unroll - for (int i=0; i < 3; ++i) input[i] = pdata[16+i]; - input[3] = nonce + ((blockIdx.x * blockDim.x) + threadIdx.x); - input[4] = 0x80000000; - #pragma unroll 8 - for (int i=5; i < 13; ++i) input[i] = 0; - input[13] = 0x00000001; - input[14] = T1; - input[15] = T0 + 128; - - T0 = SPH_T32(T0 + 128); - COMPRESS32; - - cuda_sph_enc32be((unsigned char*)output + 4*6, H6); - cuda_sph_enc32be((unsigned char*)output + 4*7, H7); - if (validate || output[3] <= ptarget64[3]) - { - // this data is only needed when we actually need to save the hashes - cuda_sph_enc32be((unsigned char*)output + 4*0, H0); - cuda_sph_enc32be((unsigned char*)output + 4*1, H1); - cuda_sph_enc32be((unsigned char*)output + 4*2, H2); - cuda_sph_enc32be((unsigned char*)output + 4*3, H3); - cuda_sph_enc32be((unsigned char*)output + 4*4, H4); - cuda_sph_enc32be((unsigned char*)output + 4*5, H5); - } - - if (validate) - { - g_out += 4 * ((blockIdx.x * blockDim.x) + threadIdx.x); - #pragma unroll - for (int i=0; i < 4; ++i) g_out[i] = output[i]; - } - - if (output[3] <= ptarget64[3]) { - uint64_t *g_good64 = (uint64_t*)g_good; - if (output[3] < g_good64[3]) { - g_good64[3] = output[3]; - g_good64[2] = output[2]; - g_good64[1] = output[1]; - g_good64[0] = output[0]; - g_good[8] = nonce + ((blockIdx.x * blockDim.x) + threadIdx.x); - } - } -} - -static std::map context_good[2]; - -static bool init[MAX_GPUS] = { 0 }; - -bool default_prepare_blake256(int thr_id, const uint32_t host_pdata[20], const uint32_t host_ptarget[8]) -{ - if (!init[thr_id]) - { - // allocate pinned host memory for good hashes - uint32_t *tmp; - checkCudaErrors(cudaMalloc((void **) &tmp, 9*sizeof(uint32_t))); context_good[0][thr_id] = tmp; - checkCudaErrors(cudaMalloc((void **) &tmp, 9*sizeof(uint32_t))); context_good[1][thr_id] = tmp; - - init[thr_id] = true; - } - checkCudaErrors(cudaMemcpyToSymbol(pdata, host_pdata, 80, 0, cudaMemcpyHostToDevice)); - checkCudaErrors(cudaMemcpyToSymbol(ptarget64, host_ptarget, 32, 0, cudaMemcpyHostToDevice)); - - return context_good[0][thr_id] && context_good[1][thr_id]; -} - -void default_do_blake256(dim3 grid, dim3 threads, int thr_id, int stream, uint32_t *hash, uint32_t nonce, int throughput, bool do_d2h) -{ - checkCudaErrors(cudaMemsetAsync(context_good[stream][thr_id], 0xff, 9 * sizeof(uint32_t), context_streams[stream][thr_id])); - - cuda_blake256_hash<<>>((uint64_t*)context_hash[stream][thr_id], nonce, context_good[stream][thr_id], do_d2h); - - // copy hashes from device memory to host (ALL hashes, lots of data...) - if (do_d2h && hash != NULL) { - size_t mem_size = throughput * sizeof(uint32_t) * 8; - checkCudaErrors(cudaMemcpyAsync(hash, context_hash[stream][thr_id], mem_size, - cudaMemcpyDeviceToHost, context_streams[stream][thr_id])); - } - else if (hash != NULL) { - // asynchronous copy of winning nonce (just 4 bytes...) - checkCudaErrors(cudaMemcpyAsync(hash, context_good[stream][thr_id]+8, sizeof(uint32_t), - cudaMemcpyDeviceToHost, context_streams[stream][thr_id])); - } -} - -void default_free_blake256(int thr_id) -{ - if (init[thr_id]) { - cudaFree(context_good[0][thr_id]); - cudaFree(context_good[1][thr_id]); - init[thr_id] = false; - } -} - diff --git a/scrypt/code/scrypt-conf.h b/scrypt/code/scrypt-conf.h deleted file mode 100644 index 46685a51..00000000 --- a/scrypt/code/scrypt-conf.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - pick the best algo at runtime or compile time? - ---------------------------------------------- - SCRYPT_CHOOSE_COMPILETIME (gcc only!) - SCRYPT_CHOOSE_RUNTIME -*/ -#define SCRYPT_CHOOSE_RUNTIME - - -/* - hash function to use - ------------------------------- - SCRYPT_BLAKE256 - SCRYPT_BLAKE512 - SCRYPT_SHA256 - SCRYPT_SHA512 - SCRYPT_SKEIN512 -*/ -//#define SCRYPT_SHA256 - - -/* - block mixer to use - ----------------------------- - SCRYPT_CHACHA - SCRYPT_SALSA -*/ -//#define SCRYPT_SALSA diff --git a/scrypt/code/scrypt-jane-chacha.h b/scrypt/code/scrypt-jane-chacha.h deleted file mode 100644 index a4017e01..00000000 --- a/scrypt/code/scrypt-jane-chacha.h +++ /dev/null @@ -1,60 +0,0 @@ -#define SCRYPT_MIX_BASE "ChaCha20/8" - -typedef uint32_t scrypt_mix_word_t; - -#define SCRYPT_WORDTO8_LE U32TO8_LE -#define SCRYPT_WORD_ENDIAN_SWAP U32_SWAP - -#define SCRYPT_P 1 -#define SCRYPT_R 1 -#define SCRYPT_BLOCK_BYTES 64 -#define SCRYPT_BLOCK_WORDS (SCRYPT_BLOCK_BYTES / sizeof(scrypt_mix_word_t)) - -/* must have these here in case block bytes is ever != 64 */ -#include "scrypt-jane-romix-basic.h" - -#include "scrypt-jane-mix_chacha.h" - -/* cpu agnostic */ -#define SCRYPT_ROMIX_FN scrypt_ROMix_basic -#define SCRYPT_MIX_FN chacha_core_basic -#define SCRYPT_ROMIX_TANGLE_FN scrypt_romix_convert_endian -#define SCRYPT_ROMIX_UNTANGLE_FN scrypt_romix_convert_endian -#include "scrypt-jane-romix-template.h" - -#if !defined(SCRYPT_CHOOSE_COMPILETIME) -static scrypt_ROMixfn -scrypt_getROMix() { - size_t cpuflags = detect_cpu(); - - return scrypt_ROMix_basic; -} -#endif - - -#if defined(SCRYPT_TEST_SPEED) -static size_t -available_implementations() { - size_t cpuflags = detect_cpu(); - size_t flags = 0; - - return flags; -} -#endif - -static int -scrypt_test_mix() { - static const uint8_t expected[16] = { - 0x48,0x2b,0x2d,0xb8,0xa1,0x33,0x22,0x73,0xcd,0x16,0xc4,0xb4,0xb0,0x7f,0xb1,0x8a, - }; - - int ret = 1; - size_t cpuflags = detect_cpu(); - -#if defined(SCRYPT_CHACHA_BASIC) - ret &= scrypt_test_mix_instance(scrypt_ChunkMix_basic, scrypt_romix_convert_endian, scrypt_romix_convert_endian, expected); -#endif - - return ret; -} - diff --git a/scrypt/code/scrypt-jane-mix_chacha.h b/scrypt/code/scrypt-jane-mix_chacha.h deleted file mode 100644 index 85ee9c1c..00000000 --- a/scrypt/code/scrypt-jane-mix_chacha.h +++ /dev/null @@ -1,69 +0,0 @@ -#if !defined(SCRYPT_CHOOSE_COMPILETIME) || !defined(SCRYPT_CHACHA_INCLUDED) - -#undef SCRYPT_MIX -#define SCRYPT_MIX "ChaCha20/8 Ref" - -#undef SCRYPT_CHACHA_INCLUDED -#define SCRYPT_CHACHA_INCLUDED -#define SCRYPT_CHACHA_BASIC - -static void -chacha_core_basic(uint32_t state[16]) { - size_t rounds = 8; - uint32_t x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,t; - - x0 = state[0]; - x1 = state[1]; - x2 = state[2]; - x3 = state[3]; - x4 = state[4]; - x5 = state[5]; - x6 = state[6]; - x7 = state[7]; - x8 = state[8]; - x9 = state[9]; - x10 = state[10]; - x11 = state[11]; - x12 = state[12]; - x13 = state[13]; - x14 = state[14]; - x15 = state[15]; - - #define quarter(a,b,c,d) \ - a += b; t = d^a; d = ROTL32(t,16); \ - c += d; t = b^c; b = ROTL32(t,12); \ - a += b; t = d^a; d = ROTL32(t, 8); \ - c += d; t = b^c; b = ROTL32(t, 7); - - for (; rounds; rounds -= 2) { - quarter( x0, x4, x8,x12) - quarter( x1, x5, x9,x13) - quarter( x2, x6,x10,x14) - quarter( x3, x7,x11,x15) - quarter( x0, x5,x10,x15) - quarter( x1, x6,x11,x12) - quarter( x2, x7, x8,x13) - quarter( x3, x4, x9,x14) - } - - state[0] += x0; - state[1] += x1; - state[2] += x2; - state[3] += x3; - state[4] += x4; - state[5] += x5; - state[6] += x6; - state[7] += x7; - state[8] += x8; - state[9] += x9; - state[10] += x10; - state[11] += x11; - state[12] += x12; - state[13] += x13; - state[14] += x14; - state[15] += x15; - - #undef quarter -} - -#endif \ No newline at end of file diff --git a/scrypt/code/scrypt-jane-portable-x86.h b/scrypt/code/scrypt-jane-portable-x86.h deleted file mode 100644 index 44f97f99..00000000 --- a/scrypt/code/scrypt-jane-portable-x86.h +++ /dev/null @@ -1,32 +0,0 @@ - -typedef enum cpu_flags_x86_t { }cpu_flags_x86; - -typedef enum cpu_vendors_x86_t { - cpu_nobody, - cpu_intel, - cpu_amd -} cpu_vendors_x86; - -typedef struct x86_regs_t { - uint32_t eax, ebx, ecx, edx; -} x86_regs; - - -#if defined(SCRYPT_TEST_SPEED) -size_t cpu_detect_mask = (size_t)-1; -#endif - -static size_t -detect_cpu(void) { - size_t cpu_flags = 0; - return cpu_flags; -} - -#if defined(SCRYPT_TEST_SPEED) -static const char * -get_top_cpuflag_desc(size_t flag) { - return "Basic"; -} -#endif - -#define asm_calling_convention diff --git a/scrypt/code/scrypt-jane-portable.h b/scrypt/code/scrypt-jane-portable.h deleted file mode 100644 index ef5b93d4..00000000 --- a/scrypt/code/scrypt-jane-portable.h +++ /dev/null @@ -1,284 +0,0 @@ -/* determine os */ -#if defined(_WIN32) || defined(_WIN64) || defined(__TOS_WIN__) || defined(__WINDOWS__) - #include - #include - #define OS_WINDOWS -#elif defined(sun) || defined(__sun) || defined(__SVR4) || defined(__svr4__) - #include - #include - #include - - #define OS_SOLARIS -#else - #include - #include - #include /* need this to define BSD */ - #include - #include - - #define OS_NIX - #if defined(__linux__) - #include - #define OS_LINUX - #elif defined(BSD) - #define OS_BSD - - #if defined(MACOS_X) || (defined(__APPLE__) & defined(__MACH__)) - #define OS_OSX - #elif defined(macintosh) || defined(Macintosh) - #define OS_MAC - #elif defined(__OpenBSD__) - #define OS_OPENBSD - #endif - #endif -#endif - - -/* determine compiler */ -#if defined(_MSC_VER) - #define COMPILER_MSVC _MSC_VER - #if ((COMPILER_MSVC > 1200) || defined(_mm_free)) - #define COMPILER_MSVC6PP_AND_LATER - #endif - #if (COMPILER_MSVC >= 1500) - #define COMPILER_HAS_TMMINTRIN - #endif - - #pragma warning(disable : 4127) /* conditional expression is constant */ - #pragma warning(disable : 4100) /* unreferenced formal parameter */ - - #ifndef _CRT_SECURE_NO_WARNINGS - #define _CRT_SECURE_NO_WARNINGS - #endif - - #include - #include /* _rotl */ - #include - - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; - typedef signed int int32_t; - typedef unsigned __int64 uint64_t; - typedef signed __int64 int64_t; - - #define ROTL32(a,b) _rotl(a,b) - #define ROTR32(a,b) _rotr(a,b) - #define ROTL64(a,b) _rotl64(a,b) - #define ROTR64(a,b) _rotr64(a,b) - #undef NOINLINE - #define NOINLINE __declspec(noinline) - #undef INLINE - #define INLINE __forceinline - #undef FASTCALL - #define FASTCALL __fastcall - #undef CDECL - #define CDECL __cdecl - #undef STDCALL - #define STDCALL __stdcall - #undef NAKED - #define NAKED __declspec(naked) - #define MM16 __declspec(align(16)) -#endif -#if defined(__ICC) - #define COMPILER_INTEL -#endif -#if defined(__GNUC__) - #if (__GNUC__ >= 3) - #define COMPILER_GCC_PATCHLEVEL __GNUC_PATCHLEVEL__ - #else - #define COMPILER_GCC_PATCHLEVEL 0 - #endif - #define COMPILER_GCC (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + COMPILER_GCC_PATCHLEVEL) - #define ROTL32(a,b) (((a) << (b)) | ((a) >> (32 - b))) - #define ROTR32(a,b) (((a) >> (b)) | ((a) << (32 - b))) - #define ROTL64(a,b) (((a) << (b)) | ((a) >> (64 - b))) - #define ROTR64(a,b) (((a) >> (b)) | ((a) << (64 - b))) - #undef NOINLINE - #if (COMPILER_GCC >= 30000) - #define NOINLINE __attribute__((noinline)) - #else - #define NOINLINE - #endif - #undef INLINE - #if (COMPILER_GCC >= 30000) - #define INLINE __attribute__((always_inline)) - #else - #define INLINE inline - #endif - #undef FASTCALL - #if (COMPILER_GCC >= 30400) - #define FASTCALL __attribute__((fastcall)) - #else - #define FASTCALL - #endif - #undef CDECL - #define CDECL __attribute__((cdecl)) - #undef STDCALL - #define STDCALL __attribute__((stdcall)) - #define MM16 __attribute__((aligned(16))) - #include -#endif -#if defined(__MINGW32__) || defined(__MINGW64__) - #define COMPILER_MINGW -#endif -#if defined(__PATHCC__) - #define COMPILER_PATHCC -#endif - -#define OPTIONAL_INLINE -#if defined(OPTIONAL_INLINE) - #undef OPTIONAL_INLINE - #define OPTIONAL_INLINE INLINE -#else - #define OPTIONAL_INLINE -#endif - -#define CRYPTO_FN NOINLINE STDCALL - -/* determine cpu */ -#if defined(__amd64__) || defined(__amd64) || defined(__x86_64__ ) || defined(_M_X64) - #define CPU_X86_64 -#elif defined(__i586__) || defined(__i686__) || (defined(_M_IX86) && (_M_IX86 >= 500)) - #define CPU_X86 500 -#elif defined(__i486__) || (defined(_M_IX86) && (_M_IX86 >= 400)) - #define CPU_X86 400 -#elif defined(__i386__) || (defined(_M_IX86) && (_M_IX86 >= 300)) || defined(__X86__) || defined(_X86_) || defined(__I86__) - #define CPU_X86 300 -#elif defined(__ia64__) || defined(_IA64) || defined(__IA64__) || defined(_M_IA64) || defined(__ia64) - #define CPU_IA64 -#endif - -#if defined(__sparc__) || defined(__sparc) || defined(__sparcv9) - #define CPU_SPARC - #if defined(__sparcv9) - #define CPU_SPARC64 - #endif -#endif - -#if defined(CPU_X86_64) || defined(CPU_IA64) || defined(CPU_SPARC64) || defined(__64BIT__) || defined(__LP64__) || defined(_LP64) || (defined(_MIPS_SZLONG) && (_MIPS_SZLONG == 64)) - #define CPU_64BITS - #undef FASTCALL - #define FASTCALL - #undef CDECL - #define CDECL - #undef STDCALL - #define STDCALL -#endif - -#if defined(powerpc) || defined(__PPC__) || defined(__ppc__) || defined(_ARCH_PPC) || defined(__powerpc__) || defined(__powerpc) || defined(POWERPC) || defined(_M_PPC) - #define CPU_PPC - #if defined(_ARCH_PWR7) - #define CPU_POWER7 - #elif defined(__64BIT__) - #define CPU_PPC64 - #else - #define CPU_PPC32 - #endif -#endif - -#if defined(__hppa__) || defined(__hppa) - #define CPU_HPPA -#endif - -#if defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA) - #define CPU_ALPHA -#endif - -/* endian */ - -#if ((defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && (__BYTE_ORDER == __LITTLE_ENDIAN)) || \ - (defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && (BYTE_ORDER == LITTLE_ENDIAN)) || \ - (defined(CPU_X86) || defined(CPU_X86_64)) || \ - (defined(vax) || defined(MIPSEL) || defined(_MIPSEL))) -#define CPU_LE -#elif ((defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && (__BYTE_ORDER == __BIG_ENDIAN)) || \ - (defined(BYTE_ORDER) && defined(BIG_ENDIAN) && (BYTE_ORDER == BIG_ENDIAN)) || \ - (defined(CPU_SPARC) || defined(CPU_PPC) || defined(mc68000) || defined(sel)) || defined(_MIPSEB)) -#define CPU_BE -#else - /* unknown endian! */ -#endif - - -#define U8TO32_BE(p) \ - (((uint32_t)((p)[0]) << 24) | ((uint32_t)((p)[1]) << 16) | \ - ((uint32_t)((p)[2]) << 8) | ((uint32_t)((p)[3]) )) - -#define U8TO32_LE(p) \ - (((uint32_t)((p)[0]) ) | ((uint32_t)((p)[1]) << 8) | \ - ((uint32_t)((p)[2]) << 16) | ((uint32_t)((p)[3]) << 24)) - -#define U32TO8_BE(p, v) \ - (p)[0] = (uint8_t)((v) >> 24); (p)[1] = (uint8_t)((v) >> 16); \ - (p)[2] = (uint8_t)((v) >> 8); (p)[3] = (uint8_t)((v) ); - -#define U32TO8_LE(p, v) \ - (p)[0] = (uint8_t)((v) ); (p)[1] = (uint8_t)((v) >> 8); \ - (p)[2] = (uint8_t)((v) >> 16); (p)[3] = (uint8_t)((v) >> 24); - -#define U8TO64_BE(p) \ - (((uint64_t)U8TO32_BE(p) << 32) | (uint64_t)U8TO32_BE((p) + 4)) - -#define U8TO64_LE(p) \ - (((uint64_t)U8TO32_LE(p)) | ((uint64_t)U8TO32_LE((p) + 4) << 32)) - -#define U64TO8_BE(p, v) \ - U32TO8_BE((p), (uint32_t)((v) >> 32)); \ - U32TO8_BE((p) + 4, (uint32_t)((v) )); - -#define U64TO8_LE(p, v) \ - U32TO8_LE((p), (uint32_t)((v) )); \ - U32TO8_LE((p) + 4, (uint32_t)((v) >> 32)); - -#define U32_SWAP(v) { \ - (v) = (((v) << 8) & 0xFF00FF00 ) | (((v) >> 8) & 0xFF00FF ); \ - (v) = ((v) << 16) | ((v) >> 16); \ -} - -#define U64_SWAP(v) { \ - (v) = (((v) << 8) & 0xFF00FF00FF00FF00ull ) | (((v) >> 8) & 0x00FF00FF00FF00FFull ); \ - (v) = (((v) << 16) & 0xFFFF0000FFFF0000ull ) | (((v) >> 16) & 0x0000FFFF0000FFFFull ); \ - (v) = ((v) << 32) | ((v) >> 32); \ -} - -static int -scrypt_verify(const uint8_t *x, const uint8_t *y, size_t len) { - uint32_t differentbits = 0; - while (len--) - differentbits |= (*x++ ^ *y++); - return (1 & ((differentbits - 1) >> 8)); -} - -void -scrypt_ensure_zero(void *p, size_t len) { -#if ((defined(CPU_X86) || defined(CPU_X86_64)) && defined(COMPILER_MSVC)) - __stosb((unsigned char *)p, 0, len); -#elif (defined(CPU_X86) && defined(COMPILER_GCC)) - __asm__ __volatile__( - "pushl %%edi;\n" - "pushl %%ecx;\n" - "rep stosb;\n" - "popl %%ecx;\n" - "popl %%edi;\n" - :: "a"(0), "D"(p), "c"(len) : "cc", "memory" - ); -#elif (defined(CPU_X86_64) && defined(COMPILER_GCC)) - __asm__ __volatile__( - "pushq %%rdi;\n" - "pushq %%rcx;\n" - "rep stosb;\n" - "popq %%rcx;\n" - "popq %%rdi;\n" - :: "a"(0), "D"(p), "c"(len) : "cc", "memory" - ); -#else - volatile uint8_t *b = (volatile uint8_t *)p; - size_t i; - for (i = 0; i < len; i++) - b[i] = 0; -#endif -} - -#include "scrypt-jane-portable-x86.h" - diff --git a/scrypt/code/scrypt-jane-romix-basic.h b/scrypt/code/scrypt-jane-romix-basic.h deleted file mode 100644 index 1cdb3fb0..00000000 --- a/scrypt/code/scrypt-jane-romix-basic.h +++ /dev/null @@ -1,67 +0,0 @@ -#if !defined(SCRYPT_CHOOSE_COMPILETIME) -/* function type returned by scrypt_getROMix, used with cpu detection */ -typedef void (FASTCALL *scrypt_ROMixfn)(scrypt_mix_word_t *X/*[chunkWords]*/, scrypt_mix_word_t *Y/*[chunkWords]*/, scrypt_mix_word_t *V/*[chunkWords * N]*/, uint32_t N, uint32_t r); -#endif - -/* romix pre/post nop function */ -static void asm_calling_convention -scrypt_romix_nop(scrypt_mix_word_t *blocks, size_t nblocks) { -} - -/* romix pre/post endian conversion function */ -static void asm_calling_convention -scrypt_romix_convert_endian(scrypt_mix_word_t *blocks, size_t nblocks) { -#if !defined(CPU_LE) - static const union { uint8_t b[2]; uint16_t w; } endian_test = {{1,0}}; - size_t i; - if (endian_test.w == 0x100) { - nblocks *= SCRYPT_BLOCK_WORDS; - for (i = 0; i < nblocks; i++) { - SCRYPT_WORD_ENDIAN_SWAP(blocks[i]); - } - } -#endif -} - -/* chunkmix test function */ -typedef void (asm_calling_convention *chunkmixfn)(scrypt_mix_word_t *Bout/*[chunkWords]*/, scrypt_mix_word_t *Bin/*[chunkWords]*/, scrypt_mix_word_t *Bxor/*[chunkWords]*/, uint32_t r); -typedef void (asm_calling_convention *blockfixfn)(scrypt_mix_word_t *blocks, size_t nblocks); - -static int -scrypt_test_mix_instance(chunkmixfn mixfn, blockfixfn prefn, blockfixfn postfn, const uint8_t expected[16]) { - /* r = 2, (2 * r) = 4 blocks in a chunk, 4 * SCRYPT_BLOCK_WORDS total */ - const uint32_t r = 2, blocks = 2 * r, words = blocks * SCRYPT_BLOCK_WORDS; - scrypt_mix_word_t MM16 chunk[2][4 * SCRYPT_BLOCK_WORDS], v; - uint8_t final[16]; - size_t i; - - for (i = 0; i < words; i++) { - v = (scrypt_mix_word_t)i; - v = (v << 8) | v; - v = (v << 16) | v; - chunk[0][i] = v; - } - - prefn(chunk[0], blocks); - mixfn(chunk[1], chunk[0], NULL, r); - postfn(chunk[1], blocks); - - /* grab the last 16 bytes of the final block */ - for (i = 0; i < 16; i += sizeof(scrypt_mix_word_t)) { - SCRYPT_WORDTO8_LE(final + i, chunk[1][words - (16 / sizeof(scrypt_mix_word_t)) + (i / sizeof(scrypt_mix_word_t))]); - } - - return scrypt_verify(expected, final, 16); -} - -/* returns a pointer to item i, where item is len scrypt_mix_word_t's long */ -static scrypt_mix_word_t * -scrypt_item(scrypt_mix_word_t *base, scrypt_mix_word_t i, scrypt_mix_word_t len) { - return base + (i * len); -} - -/* returns a pointer to block i */ -static scrypt_mix_word_t * -scrypt_block(scrypt_mix_word_t *base, scrypt_mix_word_t i) { - return base + (i * SCRYPT_BLOCK_WORDS); -} diff --git a/scrypt/code/scrypt-jane-romix-template.h b/scrypt/code/scrypt-jane-romix-template.h deleted file mode 100644 index 7879c58f..00000000 --- a/scrypt/code/scrypt-jane-romix-template.h +++ /dev/null @@ -1,179 +0,0 @@ -#if !defined(SCRYPT_CHOOSE_COMPILETIME) || !defined(SCRYPT_HAVE_ROMIX) - -#if defined(SCRYPT_CHOOSE_COMPILETIME) -#undef SCRYPT_ROMIX_FN -#define SCRYPT_ROMIX_FN scrypt_ROMix -#endif - -#undef SCRYPT_HAVE_ROMIX -#define SCRYPT_HAVE_ROMIX - -#if !defined(SCRYPT_CHUNKMIX_FN) - -#define SCRYPT_CHUNKMIX_FN scrypt_ChunkMix_basic - -/* - Bout = ChunkMix(Bin) - - 2*r: number of blocks in the chunk -*/ -static void asm_calling_convention -SCRYPT_CHUNKMIX_FN(scrypt_mix_word_t *Bout/*[chunkWords]*/, scrypt_mix_word_t *Bin/*[chunkWords]*/, scrypt_mix_word_t *Bxor/*[chunkWords]*/, uint32_t r) { - scrypt_mix_word_t MM16 X[SCRYPT_BLOCK_WORDS], *block; - uint32_t i, j, blocksPerChunk = r * 2, half = 0; - - /* 1: X = B_{2r - 1} */ - block = scrypt_block(Bin, blocksPerChunk - 1); - for (i = 0; i < SCRYPT_BLOCK_WORDS; i++) - X[i] = block[i]; - - if (Bxor) { - block = scrypt_block(Bxor, blocksPerChunk - 1); - for (i = 0; i < SCRYPT_BLOCK_WORDS; i++) - X[i] ^= block[i]; - } - - /* 2: for i = 0 to 2r - 1 do */ - for (i = 0; i < blocksPerChunk; i++, half ^= r) { - /* 3: X = H(X ^ B_i) */ - block = scrypt_block(Bin, i); - for (j = 0; j < SCRYPT_BLOCK_WORDS; j++) - X[j] ^= block[j]; - - if (Bxor) { - block = scrypt_block(Bxor, i); - for (j = 0; j < SCRYPT_BLOCK_WORDS; j++) - X[j] ^= block[j]; - } - SCRYPT_MIX_FN(X); - - /* 4: Y_i = X */ - /* 6: B'[0..r-1] = Y_even */ - /* 6: B'[r..2r-1] = Y_odd */ - block = scrypt_block(Bout, (i / 2) + half); - for (j = 0; j < SCRYPT_BLOCK_WORDS; j++) - block[j] = X[j]; - } -} -#endif - -/* - X = ROMix(X) - - X: chunk to mix - Y: scratch chunk - N: number of rounds - V[N]: array of chunks to randomly index in to - 2*r: number of blocks in a chunk -*/ - -static void NOINLINE FASTCALL -SCRYPT_ROMIX_FN(scrypt_mix_word_t *X/*[chunkWords]*/, scrypt_mix_word_t *Y/*[chunkWords]*/, scrypt_mix_word_t *V/*[N * chunkWords]*/, uint32_t N, uint32_t r) { - uint32_t i, j, chunkWords = SCRYPT_BLOCK_WORDS * r * 2; - scrypt_mix_word_t *block = V; - - SCRYPT_ROMIX_TANGLE_FN(X, r * 2); - - /* 1: X = B */ - /* implicit */ - - /* 2: for i = 0 to N - 1 do */ - memcpy(block, X, chunkWords * sizeof(scrypt_mix_word_t)); - for (i = 0; i < N - 1; i++, block += chunkWords) { - /* 3: V_i = X */ - /* 4: X = H(X) */ - SCRYPT_CHUNKMIX_FN(block + chunkWords, block, NULL, r); - } - SCRYPT_CHUNKMIX_FN(X, block, NULL, r); - - /* 6: for i = 0 to N - 1 do */ - for (i = 0; i < N; i += 2) { - /* 7: j = Integerify(X) % N */ - j = X[chunkWords - SCRYPT_BLOCK_WORDS] & (N - 1); - - /* 8: X = H(Y ^ V_j) */ - SCRYPT_CHUNKMIX_FN(Y, X, scrypt_item(V, j, chunkWords), r); - - /* 7: j = Integerify(Y) % N */ - j = Y[chunkWords - SCRYPT_BLOCK_WORDS] & (N - 1); - - /* 8: X = H(Y ^ V_j) */ - SCRYPT_CHUNKMIX_FN(X, Y, scrypt_item(V, j, chunkWords), r); - } - - /* 10: B' = X */ - /* implicit */ - - SCRYPT_ROMIX_UNTANGLE_FN(X, r * 2); -} - -/* - * Special version with hard-coded r = 1 - * - mikaelh - */ -static void NOINLINE FASTCALL -scrypt_ROMix_1(scrypt_mix_word_t *X/*[chunkWords]*/, scrypt_mix_word_t *Y/*[chunkWords]*/, scrypt_mix_word_t *V/*[N * chunkWords]*/, uint32_t N) { - const uint32_t r = 1; - uint32_t i, j, chunkWords = SCRYPT_BLOCK_WORDS * r * 2; - scrypt_mix_word_t *block = V; - - SCRYPT_ROMIX_TANGLE_FN(X, r * 2); - - /* 1: X = B */ - /* implicit */ - - /* 2: for i = 0 to N - 1 do */ - memcpy(block, X, chunkWords * sizeof(scrypt_mix_word_t)); - for (i = 0; i < N - 1; i++, block += chunkWords) { - /* 3: V_i = X */ - /* 4: X = H(X) */ -#ifdef SCRYPT_CHUNKMIX_1_FN - SCRYPT_CHUNKMIX_1_FN(block + chunkWords, block); -#else - SCRYPT_CHUNKMIX_FN(block + chunkWords, block, NULL, r); -#endif - } -#ifdef SCRYPT_CHUNKMIX_1_FN - SCRYPT_CHUNKMIX_1_FN(X, block); -#else - SCRYPT_CHUNKMIX_FN(X, block, NULL, r); -#endif - - /* 6: for i = 0 to N - 1 do */ - for (i = 0; i < N; i += 2) { - /* 7: j = Integerify(X) % N */ - j = X[chunkWords - SCRYPT_BLOCK_WORDS] & (N - 1); - - /* 8: X = H(Y ^ V_j) */ -#ifdef SCRYPT_CHUNKMIX_1_XOR_FN - SCRYPT_CHUNKMIX_1_XOR_FN(Y, X, scrypt_item(V, j, chunkWords)); -#else - SCRYPT_CHUNKMIX_FN(Y, X, scrypt_item(V, j, chunkWords), r); -#endif - - /* 7: j = Integerify(Y) % N */ - j = Y[chunkWords - SCRYPT_BLOCK_WORDS] & (N - 1); - - /* 8: X = H(Y ^ V_j) */ -#ifdef SCRYPT_CHUNKMIX_1_XOR_FN - SCRYPT_CHUNKMIX_1_XOR_FN(X, Y, scrypt_item(V, j, chunkWords)); -#else - SCRYPT_CHUNKMIX_FN(X, Y, scrypt_item(V, j, chunkWords), r); -#endif - } - - /* 10: B' = X */ - /* implicit */ - - SCRYPT_ROMIX_UNTANGLE_FN(X, r * 2); -} - -#endif /* !defined(SCRYPT_CHOOSE_COMPILETIME) || !defined(SCRYPT_HAVE_ROMIX) */ - - -#undef SCRYPT_CHUNKMIX_FN -#undef SCRYPT_ROMIX_FN -#undef SCRYPT_MIX_FN -#undef SCRYPT_ROMIX_TANGLE_FN -#undef SCRYPT_ROMIX_UNTANGLE_FN - diff --git a/scrypt/fermi_kernel.cu b/scrypt/fermi_kernel.cu deleted file mode 100644 index d58bd7f4..00000000 --- a/scrypt/fermi_kernel.cu +++ /dev/null @@ -1,907 +0,0 @@ -// -// Kernel that runs best on Fermi devices -// -// - shared memory use reduced by nearly factor 2 over legacy kernel -// by transferring only half work units (16 x uint32_t) at once. -// - uses ulong2/uint4 based memory transfers (each thread moves 16 bytes), -// allowing for shorter unrolled loops. This relies on Fermi's better -// memory controllers to get high memory troughput. -// -// NOTE: compile this .cu module for compute_20,sm_20 with --maxrregcount=63 -// -// TODO: batch-size support for this kernel -// - -#include - -#include -#include "miner.h" - -#include "salsa_kernel.h" -#include "fermi_kernel.h" - -#define THREADS_PER_WU 1 // single thread per hash - -#define TEXWIDTH 32768 - -// forward references -template __global__ void fermi_scrypt_core_kernelA(uint32_t *g_idata, unsigned int N); -template __global__ void fermi_scrypt_core_kernelB(uint32_t *g_odata, unsigned int N); -template __global__ void fermi_scrypt_core_kernelB_tex(uint32_t *g_odata, unsigned int N); -template __global__ void fermi_scrypt_core_kernelA_LG(uint32_t *g_idata, unsigned int N, unsigned int LOOKUP_GAP); -template __global__ void fermi_scrypt_core_kernelB_LG(uint32_t *g_odata, unsigned int N, unsigned int LOOKUP_GAP); -template __global__ void fermi_scrypt_core_kernelB_LG_tex(uint32_t *g_odata, unsigned int N, unsigned int LOOKUP_GAP); - -// scratchbuf constants (pointers to scratch buffer for each warp, i.e. 32 hashes) -__constant__ uint32_t* c_V[TOTAL_WARP_LIMIT]; - -// using texture references for the "tex" variants of the B kernels -texture texRef1D_4_V; -texture texRef2D_4_V; - -FermiKernel::FermiKernel() : KernelInterface() -{ -} - -bool FermiKernel::bindtexture_1D(uint32_t *d_V, size_t size) -{ - cudaChannelFormatDesc channelDesc4 = cudaCreateChannelDesc(); - texRef1D_4_V.normalized = 0; - texRef1D_4_V.filterMode = cudaFilterModePoint; - texRef1D_4_V.addressMode[0] = cudaAddressModeClamp; - checkCudaErrors(cudaBindTexture(NULL, &texRef1D_4_V, d_V, &channelDesc4, size)); - return true; -} - -bool FermiKernel::bindtexture_2D(uint32_t *d_V, int width, int height, size_t pitch) -{ - cudaChannelFormatDesc channelDesc4 = cudaCreateChannelDesc(); - texRef2D_4_V.normalized = 0; - texRef2D_4_V.filterMode = cudaFilterModePoint; - texRef2D_4_V.addressMode[0] = cudaAddressModeClamp; - texRef2D_4_V.addressMode[1] = cudaAddressModeClamp; - // maintain texture width of TEXWIDTH (max. limit is 65000) - while (width > TEXWIDTH) { width /= 2; height *= 2; pitch /= 2; } - while (width < TEXWIDTH) { width *= 2; height = (height+1)/2; pitch *= 2; } -// fprintf(stderr, "total size: %u, %u bytes\n", pitch * height, width * sizeof(uint32_t) * 4 * height); -// fprintf(stderr, "binding width width=%d, height=%d, pitch=%d\n", width, height,pitch); - checkCudaErrors(cudaBindTexture2D(NULL, &texRef2D_4_V, d_V, &channelDesc4, width, height, pitch)); - return true; -} - -bool FermiKernel::unbindtexture_1D() -{ - checkCudaErrors(cudaUnbindTexture(texRef1D_4_V)); - return true; -} - -bool FermiKernel::unbindtexture_2D() -{ - checkCudaErrors(cudaUnbindTexture(texRef2D_4_V)); - return true; -} - -void FermiKernel::set_scratchbuf_constants(int MAXWARPS, uint32_t** h_V) -{ - checkCudaErrors(cudaMemcpyToSymbol(c_V, h_V, MAXWARPS*sizeof(uint32_t*), 0, cudaMemcpyHostToDevice)); -} - -bool FermiKernel::run_kernel(dim3 grid, dim3 threads, int WARPS_PER_BLOCK, int thr_id, cudaStream_t stream, uint32_t* d_idata, uint32_t* d_odata, unsigned int N, unsigned int LOOKUP_GAP, bool interactive, bool benchmark, int texture_cache) -{ - bool success = true; - - int shared = WARPS_PER_BLOCK * WU_PER_WARP * (16+4) * sizeof(uint32_t); - - // First phase: Sequential writes to scratchpad. - - if (LOOKUP_GAP == 1) { - if (IS_SCRYPT()) fermi_scrypt_core_kernelA<<< grid, threads, shared, stream >>>(d_idata, N); - if (IS_SCRYPT_JANE()) fermi_scrypt_core_kernelA<<< grid, threads, shared, stream >>>(d_idata, N); - } else { - if (IS_SCRYPT()) fermi_scrypt_core_kernelA_LG<<< grid, threads, shared, stream >>>(d_idata, N, LOOKUP_GAP); - if (IS_SCRYPT_JANE()) fermi_scrypt_core_kernelA_LG<<< grid, threads, shared, stream >>>(d_idata, N, LOOKUP_GAP); - } - - // Second phase: Random read access from scratchpad. - - if (LOOKUP_GAP == 1) { - if (texture_cache) { - if (texture_cache == 1) { - if (IS_SCRYPT()) fermi_scrypt_core_kernelB_tex<<< grid, threads, shared, stream >>>(d_odata, N); - if (IS_SCRYPT_JANE()) fermi_scrypt_core_kernelB_tex<<< grid, threads, shared, stream >>>(d_odata, N); - } else if (texture_cache == 2) { - if (IS_SCRYPT()) fermi_scrypt_core_kernelB_tex<<< grid, threads, shared, stream >>>(d_odata, N); - if (IS_SCRYPT_JANE()) fermi_scrypt_core_kernelB_tex<<< grid, threads, shared, stream >>>(d_odata, N); - } - else success = false; - } else { - if (IS_SCRYPT()) fermi_scrypt_core_kernelB<<< grid, threads, shared, stream >>>(d_odata, N); - if (IS_SCRYPT_JANE()) fermi_scrypt_core_kernelB<<< grid, threads, shared, stream >>>(d_odata, N); - } - } else { - if (texture_cache) { - if (texture_cache == 1) { - if (IS_SCRYPT()) fermi_scrypt_core_kernelB_LG_tex<<< grid, threads, shared, stream >>>(d_odata, N, LOOKUP_GAP); - if (IS_SCRYPT_JANE()) fermi_scrypt_core_kernelB_LG_tex<<< grid, threads, shared, stream >>>(d_odata, N, LOOKUP_GAP); - } else if (texture_cache == 2) { - if (IS_SCRYPT()) fermi_scrypt_core_kernelB_LG_tex<<< grid, threads, shared, stream >>>(d_odata, N, LOOKUP_GAP); - if (IS_SCRYPT_JANE()) fermi_scrypt_core_kernelB_LG_tex<<< grid, threads, shared, stream >>>(d_odata, N, LOOKUP_GAP); - } - else success = false; - } else { - if (IS_SCRYPT()) fermi_scrypt_core_kernelB_LG<<< grid, threads, shared, stream >>>(d_odata, N, LOOKUP_GAP); - if (IS_SCRYPT_JANE()) fermi_scrypt_core_kernelB_LG<<< grid, threads, shared, stream >>>(d_odata, N, LOOKUP_GAP); - } - } - - return success; -} - -#if 0 - -#define ROTL(a, b) (((a) << (b)) | ((a) >> (32 - (b)))) - -#define QUARTER(a,b,c,d) \ - a += b; d ^= a; d = ROTL(d,16); \ - c += d; b ^= c; b = ROTL(b,12); \ - a += b; d ^= a; d = ROTL(d,8); \ - c += d; b ^= c; b = ROTL(b,7); - -static __device__ void xor_chacha8(uint4 *B, uint4 *C) -{ - uint32_t x[16]; - x[0]=(B[0].x ^= C[0].x); - x[1]=(B[0].y ^= C[0].y); - x[2]=(B[0].z ^= C[0].z); - x[3]=(B[0].w ^= C[0].w); - x[4]=(B[1].x ^= C[1].x); - x[5]=(B[1].y ^= C[1].y); - x[6]=(B[1].z ^= C[1].z); - x[7]=(B[1].w ^= C[1].w); - x[8]=(B[2].x ^= C[2].x); - x[9]=(B[2].y ^= C[2].y); - x[10]=(B[2].z ^= C[2].z); - x[11]=(B[2].w ^= C[2].w); - x[12]=(B[3].x ^= C[3].x); - x[13]=(B[3].y ^= C[3].y); - x[14]=(B[3].z ^= C[3].z); - x[15]=(B[3].w ^= C[3].w); - - /* Operate on columns. */ - QUARTER( x[0], x[4], x[ 8], x[12] ) - QUARTER( x[1], x[5], x[ 9], x[13] ) - QUARTER( x[2], x[6], x[10], x[14] ) - QUARTER( x[3], x[7], x[11], x[15] ) - - /* Operate on diagonals */ - QUARTER( x[0], x[5], x[10], x[15] ) - QUARTER( x[1], x[6], x[11], x[12] ) - QUARTER( x[2], x[7], x[ 8], x[13] ) - QUARTER( x[3], x[4], x[ 9], x[14] ) - - /* Operate on columns. */ - QUARTER( x[0], x[4], x[ 8], x[12] ) - QUARTER( x[1], x[5], x[ 9], x[13] ) - QUARTER( x[2], x[6], x[10], x[14] ) - QUARTER( x[3], x[7], x[11], x[15] ) - - /* Operate on diagonals */ - QUARTER( x[0], x[5], x[10], x[15] ) - QUARTER( x[1], x[6], x[11], x[12] ) - QUARTER( x[2], x[7], x[ 8], x[13] ) - QUARTER( x[3], x[4], x[ 9], x[14] ) - - /* Operate on columns. */ - QUARTER( x[0], x[4], x[ 8], x[12] ) - QUARTER( x[1], x[5], x[ 9], x[13] ) - QUARTER( x[2], x[6], x[10], x[14] ) - QUARTER( x[3], x[7], x[11], x[15] ) - - /* Operate on diagonals */ - QUARTER( x[0], x[5], x[10], x[15] ) - QUARTER( x[1], x[6], x[11], x[12] ) - QUARTER( x[2], x[7], x[ 8], x[13] ) - QUARTER( x[3], x[4], x[ 9], x[14] ) - - /* Operate on columns. */ - QUARTER( x[0], x[4], x[ 8], x[12] ) - QUARTER( x[1], x[5], x[ 9], x[13] ) - QUARTER( x[2], x[6], x[10], x[14] ) - QUARTER( x[3], x[7], x[11], x[15] ) - - /* Operate on diagonals */ - QUARTER( x[0], x[5], x[10], x[15] ) - QUARTER( x[1], x[6], x[11], x[12] ) - QUARTER( x[2], x[7], x[ 8], x[13] ) - QUARTER( x[3], x[4], x[ 9], x[14] ) - - B[0].x += x[0]; B[0].y += x[1]; B[0].z += x[2]; B[0].w += x[3]; B[1].x += x[4]; B[1].y += x[5]; B[1].z += x[6]; B[1].w += x[7]; - B[2].x += x[8]; B[2].y += x[9]; B[2].z += x[10]; B[2].w += x[11]; B[3].x += x[12]; B[3].y += x[13]; B[3].z += x[14]; B[3].w += x[15]; -} - -#else - -#define ROTL(a, b) (((a) << (b)) | ((a) >> (32 - (b)))) - -#define ADD4(d1,d2,d3,d4,s1,s2,s3,s4) \ - d1 += s1; d2 += s2; d3 += s3; d4 += s4; - -#define XOR4(d1,d2,d3,d4,s1,s2,s3,s4) \ - d1 ^= s1; d2 ^= s2; d3 ^= s3; d4 ^= s4; - -#define ROTL4(d1,d2,d3,d4,amt) \ - d1 = ROTL(d1, amt); d2 = ROTL(d2, amt); d3 = ROTL(d3, amt); d4 = ROTL(d4, amt); - -#define QROUND(a1,a2,a3,a4, b1,b2,b3,b4, c1,c2,c3,c4, amt) \ - ADD4 (a1,a2,a3,a4, c1,c2,c3,c4) \ - XOR4 (b1,b2,b3,b4, a1,a2,a3,a4) \ - ROTL4(b1,b2,b3,b4, amt) - -static __device__ void xor_chacha8(uint4 *B, uint4 *C) -{ - uint32_t x[16]; - x[0]=(B[0].x ^= C[0].x); - x[1]=(B[0].y ^= C[0].y); - x[2]=(B[0].z ^= C[0].z); - x[3]=(B[0].w ^= C[0].w); - x[4]=(B[1].x ^= C[1].x); - x[5]=(B[1].y ^= C[1].y); - x[6]=(B[1].z ^= C[1].z); - x[7]=(B[1].w ^= C[1].w); - x[8]=(B[2].x ^= C[2].x); - x[9]=(B[2].y ^= C[2].y); - x[10]=(B[2].z ^= C[2].z); - x[11]=(B[2].w ^= C[2].w); - x[12]=(B[3].x ^= C[3].x); - x[13]=(B[3].y ^= C[3].y); - x[14]=(B[3].z ^= C[3].z); - x[15]=(B[3].w ^= C[3].w); - - /* Operate on columns. */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 16); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 8); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 7); - - /* Operate on diagonals */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 16); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 8); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 7); - - /* Operate on columns. */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 16); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 8); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 7); - - /* Operate on diagonals */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 16); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 8); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 7); - - /* Operate on columns. */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 16); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 8); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 7); - - /* Operate on diagonals */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 16); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 8); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 7); - - /* Operate on columns. */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 16); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 8); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 7); - - /* Operate on diagonals */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 16); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 8); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 7); - - B[0].x += x[0]; B[0].y += x[1]; B[0].z += x[2]; B[0].w += x[3]; B[1].x += x[4]; B[1].y += x[5]; B[1].z += x[6]; B[1].w += x[7]; - B[2].x += x[8]; B[2].y += x[9]; B[2].z += x[10]; B[2].w += x[11]; B[3].x += x[12]; B[3].y += x[13]; B[3].z += x[14]; B[3].w += x[15]; -} - -#endif - -#define ROTL7(a0,a1,a2,a3,a00,a10,a20,a30){\ -a0^=(((a00)<<7) | ((a00)>>25) );\ -a1^=(((a10)<<7) | ((a10)>>25) );\ -a2^=(((a20)<<7) | ((a20)>>25) );\ -a3^=(((a30)<<7) | ((a30)>>25) );\ -};\ - -#define ROTL9(a0,a1,a2,a3,a00,a10,a20,a30){\ -a0^=(((a00)<<9) | ((a00)>>23) );\ -a1^=(((a10)<<9) | ((a10)>>23) );\ -a2^=(((a20)<<9) | ((a20)>>23) );\ -a3^=(((a30)<<9) | ((a30)>>23) );\ -};\ - -#define ROTL13(a0,a1,a2,a3,a00,a10,a20,a30){\ -a0^=(((a00)<<13) | ((a00)>>19) );\ -a1^=(((a10)<<13) | ((a10)>>19) );\ -a2^=(((a20)<<13) | ((a20)>>19) );\ -a3^=(((a30)<<13) | ((a30)>>19) );\ -};\ - -#define ROTL18(a0,a1,a2,a3,a00,a10,a20,a30){\ -a0^=(((a00)<<18) | ((a00)>>14) );\ -a1^=(((a10)<<18) | ((a10)>>14) );\ -a2^=(((a20)<<18) | ((a20)>>14) );\ -a3^=(((a30)<<18) | ((a30)>>14) );\ -};\ - -static __device__ void xor_salsa8(uint4 *B, uint4 *C) -{ - uint32_t x[16]; - x[0]=(B[0].x ^= C[0].x); - x[1]=(B[0].y ^= C[0].y); - x[2]=(B[0].z ^= C[0].z); - x[3]=(B[0].w ^= C[0].w); - x[4]=(B[1].x ^= C[1].x); - x[5]=(B[1].y ^= C[1].y); - x[6]=(B[1].z ^= C[1].z); - x[7]=(B[1].w ^= C[1].w); - x[8]=(B[2].x ^= C[2].x); - x[9]=(B[2].y ^= C[2].y); - x[10]=(B[2].z ^= C[2].z); - x[11]=(B[2].w ^= C[2].w); - x[12]=(B[3].x ^= C[3].x); - x[13]=(B[3].y ^= C[3].y); - x[14]=(B[3].z ^= C[3].z); - x[15]=(B[3].w ^= C[3].w); - - /* Operate on columns. */ - ROTL7(x[4],x[9],x[14],x[3],x[0]+x[12],x[1]+x[5],x[6]+x[10],x[11]+x[15]); - ROTL9(x[8],x[13],x[2],x[7],x[0]+x[4],x[5]+x[9],x[10]+x[14],x[3]+x[15]); - ROTL13(x[12],x[1],x[6],x[11],x[4]+x[8],x[9]+x[13],x[2]+x[14],x[3]+x[7]); - ROTL18(x[0],x[5],x[10],x[15],x[8]+x[12],x[1]+x[13],x[2]+x[6],x[7]+x[11]); - - /* Operate on rows. */ - ROTL7(x[1],x[6],x[11],x[12],x[0]+x[3],x[4]+x[5],x[9]+x[10],x[14]+x[15]); - ROTL9(x[2],x[7],x[8],x[13],x[0]+x[1],x[5]+x[6],x[10]+x[11],x[12]+x[15]); - ROTL13(x[3],x[4],x[9],x[14],x[1]+x[2],x[6]+x[7],x[8]+x[11],x[12]+x[13]); - ROTL18(x[0],x[5],x[10],x[15],x[2]+x[3],x[4]+x[7],x[8]+x[9],x[13]+x[14]); - - /* Operate on columns. */ - ROTL7(x[4],x[9],x[14],x[3],x[0]+x[12],x[1]+x[5],x[6]+x[10],x[11]+x[15]); - ROTL9(x[8],x[13],x[2],x[7],x[0]+x[4],x[5]+x[9],x[10]+x[14],x[3]+x[15]); - ROTL13(x[12],x[1],x[6],x[11],x[4]+x[8],x[9]+x[13],x[2]+x[14],x[3]+x[7]); - ROTL18(x[0],x[5],x[10],x[15],x[8]+x[12],x[1]+x[13],x[2]+x[6],x[7]+x[11]); - - /* Operate on rows. */ - ROTL7(x[1],x[6],x[11],x[12],x[0]+x[3],x[4]+x[5],x[9]+x[10],x[14]+x[15]); - ROTL9(x[2],x[7],x[8],x[13],x[0]+x[1],x[5]+x[6],x[10]+x[11],x[12]+x[15]); - ROTL13(x[3],x[4],x[9],x[14],x[1]+x[2],x[6]+x[7],x[8]+x[11],x[12]+x[13]); - ROTL18(x[0],x[5],x[10],x[15],x[2]+x[3],x[4]+x[7],x[8]+x[9],x[13]+x[14]); - - /* Operate on columns. */ - ROTL7(x[4],x[9],x[14],x[3],x[0]+x[12],x[1]+x[5],x[6]+x[10],x[11]+x[15]); - ROTL9(x[8],x[13],x[2],x[7],x[0]+x[4],x[5]+x[9],x[10]+x[14],x[3]+x[15]); - ROTL13(x[12],x[1],x[6],x[11],x[4]+x[8],x[9]+x[13],x[2]+x[14],x[3]+x[7]); - ROTL18(x[0],x[5],x[10],x[15],x[8]+x[12],x[1]+x[13],x[2]+x[6],x[7]+x[11]); - - /* Operate on rows. */ - ROTL7(x[1],x[6],x[11],x[12],x[0]+x[3],x[4]+x[5],x[9]+x[10],x[14]+x[15]); - ROTL9(x[2],x[7],x[8],x[13],x[0]+x[1],x[5]+x[6],x[10]+x[11],x[12]+x[15]); - ROTL13(x[3],x[4],x[9],x[14],x[1]+x[2],x[6]+x[7],x[8]+x[11],x[12]+x[13]); - ROTL18(x[0],x[5],x[10],x[15],x[2]+x[3],x[4]+x[7],x[8]+x[9],x[13]+x[14]); - - /* Operate on columns. */ - ROTL7(x[4],x[9],x[14],x[3],x[0]+x[12],x[1]+x[5],x[6]+x[10],x[11]+x[15]); - ROTL9(x[8],x[13],x[2],x[7],x[0]+x[4],x[5]+x[9],x[10]+x[14],x[3]+x[15]); - ROTL13(x[12],x[1],x[6],x[11],x[4]+x[8],x[9]+x[13],x[2]+x[14],x[3]+x[7]); - ROTL18(x[0],x[5],x[10],x[15],x[8]+x[12],x[1]+x[13],x[2]+x[6],x[7]+x[11]); - - /* Operate on rows. */ - ROTL7(x[1],x[6],x[11],x[12],x[0]+x[3],x[4]+x[5],x[9]+x[10],x[14]+x[15]); - ROTL9(x[2],x[7],x[8],x[13],x[0]+x[1],x[5]+x[6],x[10]+x[11],x[12]+x[15]); - ROTL13(x[3],x[4],x[9],x[14],x[1]+x[2],x[6]+x[7],x[8]+x[11],x[12]+x[13]); - ROTL18(x[0],x[5],x[10],x[15],x[2]+x[3],x[4]+x[7],x[8]+x[9],x[13]+x[14]); - - B[0].x += x[0]; B[0].y += x[1]; B[0].z += x[2]; B[0].w += x[3]; B[1].x += x[4]; B[1].y += x[5]; B[1].z += x[6]; B[1].w += x[7]; - B[2].x += x[8]; B[2].y += x[9]; B[2].z += x[10]; B[2].w += x[11]; B[3].x += x[12]; B[3].y += x[13]; B[3].z += x[14]; B[3].w += x[15]; -} - -static __device__ __forceinline__ uint4& operator^=(uint4& left, const uint4& right) -{ - left.x ^= right.x; - left.y ^= right.y; - left.z ^= right.z; - left.w ^= right.w; - return left; -} - -//////////////////////////////////////////////////////////////////////////////// -//! Scrypt core kernel for Fermi class devices. -//! @param g_idata input data in global memory -//! @param g_odata output data in global memory -//////////////////////////////////////////////////////////////////////////////// -template __global__ -void fermi_scrypt_core_kernelA(uint32_t *g_idata, unsigned int N) -{ - extern __shared__ unsigned char x[]; - uint32_t ((*X)[WU_PER_WARP][16+4]) = (uint32_t (*)[WU_PER_WARP][16+4]) x; - - int warpIdx = threadIdx.x / warpSize; - int warpThread = threadIdx.x % warpSize; - const unsigned int LOOKUP_GAP = 1; - - // variables supporting the large memory transaction magic - unsigned int Y = warpThread/4; - unsigned int Z = 4*(warpThread%4); - - // add block specific offsets - int WARPS_PER_BLOCK = blockDim.x / 32; - int offset = blockIdx.x * WU_PER_BLOCK + warpIdx * WU_PER_WARP; - g_idata += 32 * offset; - uint32_t * V = c_V[offset / WU_PER_WARP] + SCRATCH*Y + Z; - - // registers to store an entire work unit - uint4 B[4], C[4]; - - uint32_t ((*XB)[16+4]) = (uint32_t (*)[16+4])&X[warpIdx][Y][Z]; - uint32_t *XX = X[warpIdx][warpThread]; - -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)(&V[SCRATCH*wu])) = *((ulonglong2*)XB[wu]) = *((ulonglong2*)(&g_idata[32*(wu+Y)+Z])); -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) B[idx] = *((uint4*)&XX[4*idx]); - -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)(&V[SCRATCH*wu+16])) = *((ulonglong2*)XB[wu]) = *((ulonglong2*)(&g_idata[32*(wu+Y)+16+Z])); -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) C[idx] = *((uint4*)&XX[4*idx]); - - for (int i = 1; i < N; i++) { - - switch(ALGO) { - case A_SCRYPT: xor_salsa8(B, C); xor_salsa8(C, B); break; - case A_SCRYPT_JANE: xor_chacha8(B, C); xor_chacha8(C, B); break; - } - -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) *((uint4*)&XX[4*idx]) = B[idx]; -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)(&V[SCRATCH*wu + i*32])) = *((ulonglong2*)XB[wu]); - -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) *((uint4*)&XX[4*idx]) = C[idx]; -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)(&V[SCRATCH*wu + i*32 + 16])) = *((ulonglong2*)XB[wu]); - } -} - -template __global__ -void fermi_scrypt_core_kernelB(uint32_t *g_odata, unsigned int N) -{ - extern __shared__ unsigned char x[]; - uint32_t ((*X)[WU_PER_WARP][16+4]) = (uint32_t (*)[WU_PER_WARP][16+4]) x; - - int warpIdx = threadIdx.x / warpSize; - int warpThread = threadIdx.x % warpSize; - const unsigned int LOOKUP_GAP = 1; - - // variables supporting the large memory transaction magic - unsigned int Y = warpThread/4; - unsigned int Z = 4*(warpThread%4); - - // add block specific offsets - int WARPS_PER_BLOCK = blockDim.x / 32; - int offset = blockIdx.x * WU_PER_BLOCK + warpIdx * WU_PER_WARP; - g_odata += 32 * offset; - uint32_t * V = c_V[offset / WU_PER_WARP] + SCRATCH*Y + Z; - - // registers to store an entire work unit - uint4 B[4], C[4]; - - uint32_t ((*XB)[16+4]) = (uint32_t (*)[16+4])&X[warpIdx][Y][Z]; - uint32_t *XX = X[warpIdx][warpThread]; - -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)XB[wu]) = *((ulonglong2*)(&V[SCRATCH*wu + (N-1)*32])); -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) B[idx] = *((uint4*)&XX[4*idx]); - -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)XB[wu]) = *((ulonglong2*)(&V[SCRATCH*wu + (N-1)*32 + 16])); -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) C[idx] = *((uint4*)&XX[4*idx]); - - switch(ALGO) { - case A_SCRYPT: xor_salsa8(B, C); xor_salsa8(C, B); break; - case A_SCRYPT_JANE: xor_chacha8(B, C); xor_chacha8(C, B); break; - } - - for (int i = 0; i < N; i++) { - - XX[16] = 32 * (C[0].x & (N-1)); - -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)XB[wu]) = *((ulonglong2*)(&V[SCRATCH*wu + XB[wu][16-Z]])); -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) B[idx] ^= *((uint4*)&XX[4*idx]); - -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)XB[wu]) = *((ulonglong2*)(&V[SCRATCH*wu + XB[wu][16-Z] + 16])); -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) C[idx] ^= *((uint4*)&XX[4*idx]); - - switch(ALGO) { - case A_SCRYPT: xor_salsa8(B, C); xor_salsa8(C, B); break; - case A_SCRYPT_JANE: xor_chacha8(B, C); xor_chacha8(C, B); break; - } - } - -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) *((uint4*)&XX[4*idx]) = B[idx]; -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)(&g_odata[32*(wu+Y)+Z])) = *((ulonglong2*)XB[wu]); - -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) *((uint4*)&XX[4*idx]) = C[idx]; -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)(&g_odata[32*(wu+Y)+16+Z])) = *((ulonglong2*)XB[wu]); - -} - -template __global__ void -fermi_scrypt_core_kernelB_tex(uint32_t *g_odata, unsigned int N) -{ - extern __shared__ unsigned char x[]; - uint32_t ((*X)[WU_PER_WARP][16+4]) = (uint32_t (*)[WU_PER_WARP][16+4]) x; - - int warpIdx = threadIdx.x / warpSize; - int warpThread = threadIdx.x % warpSize; - const unsigned int LOOKUP_GAP = 1; - - // variables supporting the large memory transaction magic - unsigned int Y = warpThread/4; - unsigned int Z = 4*(warpThread%4); - - // add block specific offsets - int WARPS_PER_BLOCK = blockDim.x / 32; - int offset = blockIdx.x * WU_PER_BLOCK + warpIdx * WU_PER_WARP; - g_odata += 32 * offset; - - // registers to store an entire work unit - uint4 B[4], C[4]; - - uint32_t ((*XB)[16+4]) = (uint32_t (*)[16+4])&X[warpIdx][Y][Z]; - uint32_t *XX = X[warpIdx][warpThread]; - -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) { unsigned int loc = (SCRATCH*(offset+wu+Y) + (N-1)*32 + Z)/4; - *((uint4*)XB[wu]) = ((TEX_DIM == 1) ? - tex1Dfetch(texRef1D_4_V, loc) : - tex2D(texRef2D_4_V, 0.5f + (loc%TEXWIDTH), 0.5f + (loc/TEXWIDTH))); } -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) B[idx] = *((uint4*)&XX[4*idx]); - -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) { unsigned int loc = (SCRATCH*(offset+wu+Y) + (N-1)*32 + 16+Z)/4; - *((uint4*)XB[wu]) = ((TEX_DIM == 1) ? - tex1Dfetch(texRef1D_4_V, loc) : - tex2D(texRef2D_4_V, 0.5f + (loc%TEXWIDTH), 0.5f + (loc/TEXWIDTH))); } -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) C[idx] = *((uint4*)&XX[4*idx]); - - switch(ALGO) { - case A_SCRYPT: xor_salsa8(B, C); xor_salsa8(C, B); break; - case A_SCRYPT_JANE: xor_chacha8(B, C); xor_chacha8(C, B); break; - } - - for (int i = 0; i < N; i++) { - - XX[16] = 32 * (C[0].x & (N-1)); - -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) { unsigned int loc = (SCRATCH*(offset+wu+Y) + XB[wu][16-Z] + Z)/4; - *((uint4*)XB[wu]) = ((TEX_DIM == 1) ? - tex1Dfetch(texRef1D_4_V, loc) : - tex2D(texRef2D_4_V, 0.5f + (loc%TEXWIDTH), 0.5f + (loc/TEXWIDTH))); } -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) B[idx] ^= *((uint4*)&XX[4*idx]); - -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) { unsigned int loc = (SCRATCH*(offset+wu+Y) + XB[wu][16-Z] + 16+Z)/4; - *((uint4*)XB[wu]) = ((TEX_DIM == 1) ? - tex1Dfetch(texRef1D_4_V, loc) : - tex2D(texRef2D_4_V, 0.5f + (loc%TEXWIDTH), 0.5f + (loc/TEXWIDTH))); } -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) C[idx] ^= *((uint4*)&XX[4*idx]); - - switch(ALGO) { - case A_SCRYPT: xor_salsa8(B, C); xor_salsa8(C, B); break; - case A_SCRYPT_JANE: xor_chacha8(B, C); xor_chacha8(C, B); break; - } - } - -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) *((uint4*)&XX[4*idx]) = B[idx]; -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)(&g_odata[32*(wu+Y)+Z])) = *((ulonglong2*)XB[wu]); - -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) *((uint4*)&XX[4*idx]) = C[idx]; -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)(&g_odata[32*(wu+Y)+16+Z])) = *((ulonglong2*)XB[wu]); -} - -// -// Lookup-Gap variations of the above functions -// - -template __global__ void -fermi_scrypt_core_kernelA_LG(uint32_t *g_idata, unsigned int N, unsigned int LOOKUP_GAP) -{ - extern __shared__ unsigned char x[]; - uint32_t ((*X)[WU_PER_WARP][16+4]) = (uint32_t (*)[WU_PER_WARP][16+4]) x; - - int warpIdx = threadIdx.x / warpSize; - int warpThread = threadIdx.x % warpSize; - - // variables supporting the large memory transaction magic - unsigned int Y = warpThread/4; - unsigned int Z = 4*(warpThread%4); - - // add block specific offsets - int WARPS_PER_BLOCK = blockDim.x / 32; - int offset = blockIdx.x * WU_PER_BLOCK + warpIdx * WU_PER_WARP; - g_idata += 32 * offset; - uint32_t * V = c_V[offset / WU_PER_WARP] + SCRATCH*Y + Z; - - // registers to store an entire work unit - uint4 B[4], C[4]; - - uint32_t ((*XB)[16+4]) = (uint32_t (*)[16+4])&X[warpIdx][Y][Z]; - uint32_t *XX = X[warpIdx][warpThread]; - -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)(&V[SCRATCH*wu])) = *((ulonglong2*)XB[wu]) = *((ulonglong2*)(&g_idata[32*(wu+Y)+Z])); -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) B[idx] = *((uint4*)&XX[4*idx]); - -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)(&V[SCRATCH*wu+16])) = *((ulonglong2*)XB[wu]) = *((ulonglong2*)(&g_idata[32*(wu+Y)+16+Z])); -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) C[idx] = *((uint4*)&XX[4*idx]); - - for (int i = 1; i < N; i++) { - - switch(ALGO) { - case A_SCRYPT: xor_salsa8(B, C); xor_salsa8(C, B); break; - case A_SCRYPT_JANE: xor_chacha8(B, C); xor_chacha8(C, B); break; - } - - if (i % LOOKUP_GAP == 0) { -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) *((uint4*)&XX[4*idx]) = B[idx]; -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)(&V[SCRATCH*wu + (i/LOOKUP_GAP)*32])) = *((ulonglong2*)XB[wu]); - -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) *((uint4*)&XX[4*idx]) = C[idx]; -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)(&V[SCRATCH*wu + (i/LOOKUP_GAP)*32 + 16])) = *((ulonglong2*)XB[wu]); - } - } -} - -template __global__ void -fermi_scrypt_core_kernelB_LG(uint32_t *g_odata, unsigned int N, unsigned int LOOKUP_GAP) -{ - extern __shared__ unsigned char x[]; - uint32_t ((*X)[WU_PER_WARP][16+4]) = (uint32_t (*)[WU_PER_WARP][16+4]) x; - - int warpIdx = threadIdx.x / warpSize; - int warpThread = threadIdx.x % warpSize; - - // variables supporting the large memory transaction magic - unsigned int Y = warpThread/4; - unsigned int Z = 4*(warpThread%4); - - // add block specific offsets - int WARPS_PER_BLOCK = blockDim.x / 32; - int offset = blockIdx.x * WU_PER_BLOCK + warpIdx * WU_PER_WARP; - g_odata += 32 * offset; - uint32_t * V = c_V[offset / WU_PER_WARP] + SCRATCH*Y + Z; - - // registers to store an entire work unit - uint4 B[4], C[4]; - - uint32_t ((*XB)[16+4]) = (uint32_t (*)[16+4])&X[warpIdx][Y][Z]; - uint32_t *XX = X[warpIdx][warpThread]; - - uint32_t pos = (N-1)/LOOKUP_GAP; uint32_t loop = 1 + (N-1)-pos*LOOKUP_GAP; -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)XB[wu]) = *((ulonglong2*)(&V[SCRATCH*wu + pos*32])); -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) B[idx] = *((uint4*)&XX[4*idx]); - -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)XB[wu]) = *((ulonglong2*)(&V[SCRATCH*wu + pos*32 + 16])); -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) C[idx] = *((uint4*)&XX[4*idx]); - - while (loop--) - switch(ALGO) { - case A_SCRYPT: xor_salsa8(B, C); xor_salsa8(C, B); break; - case A_SCRYPT_JANE: xor_chacha8(B, C); xor_chacha8(C, B); break; - } - - for (int i = 0; i < N; i++) { - - uint32_t j = C[0].x & (N-1); - uint32_t pos = j / LOOKUP_GAP; uint32_t loop = j - pos*LOOKUP_GAP; - XX[16] = 32 * pos; - - uint4 b[4], c[4]; -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)XB[wu]) = *((ulonglong2*)(&V[SCRATCH*wu + XB[wu][16-Z]])); -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) b[idx] = *((uint4*)&XX[4*idx]); - -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)XB[wu]) = *((ulonglong2*)(&V[SCRATCH*wu + XB[wu][16-Z] + 16])); -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) c[idx] = *((uint4*)&XX[4*idx]); - - while (loop--) - switch(ALGO) { - case A_SCRYPT: xor_salsa8(b, c); xor_salsa8(c, b); break; - case A_SCRYPT_JANE: xor_chacha8(b, c); xor_chacha8(c, b); break; - } - -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) B[idx] ^= b[idx]; -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) C[idx] ^= c[idx]; - - switch(ALGO) { - case A_SCRYPT: xor_salsa8(B, C); xor_salsa8(C, B); break; - case A_SCRYPT_JANE: xor_chacha8(B, C); xor_chacha8(C, B); break; - } - } - -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) *((uint4*)&XX[4*idx]) = B[idx]; -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)(&g_odata[32*(wu+Y)+Z])) = *((ulonglong2*)XB[wu]); - -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) *((uint4*)&XX[4*idx]) = C[idx]; -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)(&g_odata[32*(wu+Y)+16+Z])) = *((ulonglong2*)XB[wu]); - -} - -template __global__ void -fermi_scrypt_core_kernelB_LG_tex(uint32_t *g_odata, unsigned int N, unsigned int LOOKUP_GAP) -{ - extern __shared__ unsigned char x[]; - uint32_t ((*X)[WU_PER_WARP][16+4]) = (uint32_t (*)[WU_PER_WARP][16+4]) x; - - int warpIdx = threadIdx.x / warpSize; - int warpThread = threadIdx.x % warpSize; - - // variables supporting the large memory transaction magic - unsigned int Y = warpThread/4; - unsigned int Z = 4*(warpThread%4); - - // add block specific offsets - int WARPS_PER_BLOCK = blockDim.x / 32; - int offset = blockIdx.x * WU_PER_BLOCK + warpIdx * WU_PER_WARP; - g_odata += 32 * offset; - - // registers to store an entire work unit - uint4 B[4], C[4]; - - uint32_t ((*XB)[16+4]) = (uint32_t (*)[16+4])&X[warpIdx][Y][Z]; - uint32_t *XX = X[warpIdx][warpThread]; - - uint32_t pos = (N-1)/LOOKUP_GAP; uint32_t loop = 1 + (N-1)-pos*LOOKUP_GAP; -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) { unsigned int loc = (SCRATCH*(offset+wu+Y) + pos*32 + Z)/4; - *((uint4*)XB[wu]) = ((TEX_DIM == 1) ? - tex1Dfetch(texRef1D_4_V, loc) : - tex2D(texRef2D_4_V, 0.5f + (loc%TEXWIDTH), 0.5f + (loc/TEXWIDTH))); } -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) B[idx] = *((uint4*)&XX[4*idx]); - -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) { unsigned int loc = (SCRATCH*(offset+wu+Y) + pos*32 + 16+Z)/4; - *((uint4*)XB[wu]) = ((TEX_DIM == 1) ? - tex1Dfetch(texRef1D_4_V, loc) : - tex2D(texRef2D_4_V, 0.5f + (loc%TEXWIDTH), 0.5f + (loc/TEXWIDTH))); } -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) C[idx] = *((uint4*)&XX[4*idx]); - - while (loop--) - switch(ALGO) { - case A_SCRYPT: xor_salsa8(B, C); xor_salsa8(C, B); break; - case A_SCRYPT_JANE: xor_chacha8(B, C); xor_chacha8(C, B); break; - } - - for (int i = 0; i < N; i++) { - - uint32_t j = C[0].x & (N-1); - uint32_t pos = j / LOOKUP_GAP; uint32_t loop = j - pos*LOOKUP_GAP; - XX[16] = 32 * pos; - - uint4 b[4], c[4]; -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) { unsigned int loc = (SCRATCH*(offset+wu+Y) + XB[wu][16-Z] + Z)/4; - *((uint4*)XB[wu]) = ((TEX_DIM == 1) ? - tex1Dfetch(texRef1D_4_V, loc) : - tex2D(texRef2D_4_V, 0.5f + (loc%TEXWIDTH), 0.5f + (loc/TEXWIDTH))); } -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) b[idx] = *((uint4*)&XX[4*idx]); - -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) { unsigned int loc = (SCRATCH*(offset+wu+Y) + XB[wu][16-Z] + 16+Z)/4; - *((uint4*)XB[wu]) = ((TEX_DIM == 1) ? - tex1Dfetch(texRef1D_4_V, loc) : - tex2D(texRef2D_4_V, 0.5f + (loc%TEXWIDTH), 0.5f + (loc/TEXWIDTH))); } -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) c[idx] = *((uint4*)&XX[4*idx]); - - while (loop--) - switch(ALGO) { - case A_SCRYPT: xor_salsa8(b, c); xor_salsa8(c, b); break; - case A_SCRYPT_JANE: xor_chacha8(b, c); xor_chacha8(c, b); break; - } - -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) B[idx] ^= b[idx]; -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) C[idx] ^= c[idx]; - - switch(ALGO) { - case A_SCRYPT: xor_salsa8(B, C); xor_salsa8(C, B); break; - case A_SCRYPT_JANE: xor_chacha8(B, C); xor_chacha8(C, B); break; - } - } - -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) *((uint4*)&XX[4*idx]) = B[idx]; -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)(&g_odata[32*(wu+Y)+Z])) = *((ulonglong2*)XB[wu]); - -#pragma unroll 4 - for (int idx=0; idx < 4; idx++) *((uint4*)&XX[4*idx]) = C[idx]; -#pragma unroll 4 - for (int wu=0; wu < 32; wu+=8) - *((ulonglong2*)(&g_odata[32*(wu+Y)+16+Z])) = *((ulonglong2*)XB[wu]); -} diff --git a/scrypt/fermi_kernel.h b/scrypt/fermi_kernel.h deleted file mode 100644 index 54f822d2..00000000 --- a/scrypt/fermi_kernel.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef FERMI_KERNEL_H -#define FERMI_KERNEL_H - -#include "salsa_kernel.h" - -class FermiKernel : public KernelInterface -{ -public: - FermiKernel(); - - virtual void set_scratchbuf_constants(int MAXWARPS, uint32_t** h_V); - virtual bool run_kernel(dim3 grid, dim3 threads, int WARPS_PER_BLOCK, int thr_id, cudaStream_t stream, uint32_t* d_idata, uint32_t* d_odata, unsigned int N, unsigned int LOOKUP_GAP, bool interactive, bool benchmark, int texture_cache); - virtual bool bindtexture_1D(uint32_t *d_V, size_t size); - virtual bool bindtexture_2D(uint32_t *d_V, int width, int height, size_t pitch); - virtual bool unbindtexture_1D(); - virtual bool unbindtexture_2D(); - - virtual char get_identifier() { return 'F'; }; - virtual int get_major_version() { return 1; } - virtual int get_minor_version() { return 0; } - virtual int max_warps_per_block() { return 16; }; - virtual int get_texel_width() { return 4; }; - virtual bool support_lookup_gap() { return true; } - virtual cudaSharedMemConfig shared_mem_config() { return cudaSharedMemBankSizeFourByte; } - virtual cudaFuncCache cache_config() { return cudaFuncCachePreferShared; } -}; - -#endif // #ifndef FERMI_KERNEL_H diff --git a/scrypt/kepler_kernel.cu b/scrypt/kepler_kernel.cu deleted file mode 100644 index 247fdb8c..00000000 --- a/scrypt/kepler_kernel.cu +++ /dev/null @@ -1,791 +0,0 @@ -/* Copyright (C) 2013 David G. Andersen. All rights reserved. - * with modifications by Christian Buchner - * - * Use of this code is covered under the Apache 2.0 license, which - * can be found in the file "LICENSE" - */ - -// TODO: attempt V.Volkov style ILP (factor 4) - -#include - -#include -#include - -#include "miner.h" - -#include "salsa_kernel.h" -#include "kepler_kernel.h" - -#define TEXWIDTH 32768 -#define THREADS_PER_WU 4 // four threads per hash - -#if CUDA_VERSION >= 9000 && __CUDA_ARCH__ >= 300 -#define __shfl2(var, srcLane) __shfl_sync(0xFFFFFFFFu, var, srcLane) -#else -#define __shfl2 __shfl -#endif - -typedef enum -{ - ANDERSEN, - SIMPLE -} MemoryAccess; - -// scratchbuf constants (pointers to scratch buffer for each warp, i.e. 32 hashes) -__constant__ uint32_t* c_V[TOTAL_WARP_LIMIT]; - -// iteration count N -__constant__ uint32_t c_N; -__constant__ uint32_t c_N_1; // N-1 -// scratch buffer size SCRATCH -__constant__ uint32_t c_SCRATCH; -__constant__ uint32_t c_SCRATCH_WU_PER_WARP; // (SCRATCH * WU_PER_WARP) -__constant__ uint32_t c_SCRATCH_WU_PER_WARP_1; // (SCRATCH * WU_PER_WARP) - 1 - -// using texture references for the "tex" variants of the B kernels -texture texRef1D_4_V; -texture texRef2D_4_V; - -template __device__ __forceinline__ void block_mixer(uint4 &b, uint4 &bx, const int x1, const int x2, const int x3); - -static __host__ __device__ uint4& operator ^= (uint4& left, const uint4& right) { - left.x ^= right.x; - left.y ^= right.y; - left.z ^= right.z; - left.w ^= right.w; - return left; -} - -static __host__ __device__ uint4& operator += (uint4& left, const uint4& right) { - left.x += right.x; - left.y += right.y; - left.z += right.z; - left.w += right.w; - return left; -} - -static __device__ uint4 shfl4(const uint4 bx, int target_thread) { - return make_uint4( - __shfl2((int)bx.x, target_thread), - __shfl2((int)bx.y, target_thread), - __shfl2((int)bx.z, target_thread), - __shfl2((int)bx.w, target_thread) - ); -} - -/* write_keys writes the 8 keys being processed by a warp to the global - * scratchpad. To effectively use memory bandwidth, it performs the writes - * (and reads, for read_keys) 128 bytes at a time per memory location - * by __shfl'ing the 4 entries in bx to the threads in the next-up - * thread group. It then has eight threads together perform uint4 - * (128 bit) writes to the destination region. This seems to make - * quite effective use of memory bandwidth. An approach that spread - * uint32s across more threads was slower because of the increased - * computation it required. - * - * "start" is the loop iteration producing the write - the offset within - * the block's memory. - * - * Internally, this algorithm first __shfl's the 4 bx entries to - * the next up thread group, and then uses a conditional move to - * ensure that odd-numbered thread groups exchange the b/bx ordering - * so that the right parts are written together. - * - * Thanks to Babu for helping design the 128-bit-per-write version. - * - * _direct lets the caller specify the absolute start location instead of - * the relative start location, as an attempt to reduce some recomputation. - */ - -template __device__ __forceinline__ -void write_keys_direct(const uint4 &b, const uint4 &bx, uint32_t start) -{ - uint32_t *scratch = c_V[(blockIdx.x*blockDim.x + threadIdx.x)/32]; - - if (SCHEME == ANDERSEN) { - int target_thread = (threadIdx.x + 4)%32; - uint4 t = b, t2 = shfl4(bx, target_thread); - int t2_start = __shfl2((int)start, target_thread) + 4; - bool c = (threadIdx.x & 0x4); - *((uint4 *)(&scratch[c ? t2_start : start])) = (c ? t2 : t); - *((uint4 *)(&scratch[c ? start : t2_start])) = (c ? t : t2); - } else if (SCHEME == SIMPLE) { - *((uint4 *)(&scratch[start ])) = b; - *((uint4 *)(&scratch[start+16])) = bx; - } -} - -template __device__ __forceinline__ -void read_keys_direct(uint4 &b, uint4 &bx, uint32_t start) -{ - uint32_t *scratch; - - if (TEX_DIM == 0) scratch = c_V[(blockIdx.x*blockDim.x + threadIdx.x)/32]; - if (SCHEME == ANDERSEN) { - int t2_start = __shfl2((int)start, (threadIdx.x + 4)%32) + 4; - if (TEX_DIM > 0) { start /= 4; t2_start /= 4; } - bool c = (threadIdx.x & 0x4); - if (TEX_DIM == 0) { - b = *((uint4 *)(&scratch[c ? t2_start : start])); - bx = *((uint4 *)(&scratch[c ? start : t2_start])); - } else if (TEX_DIM == 1) { - b = tex1Dfetch(texRef1D_4_V, c ? t2_start : start); - bx = tex1Dfetch(texRef1D_4_V, c ? start : t2_start); - } else if (TEX_DIM == 2) { - b = tex2D(texRef2D_4_V, 0.5f + ((c ? t2_start : start)%TEXWIDTH), 0.5f + ((c ? t2_start : start)/TEXWIDTH)); - bx = tex2D(texRef2D_4_V, 0.5f + ((c ? start : t2_start)%TEXWIDTH), 0.5f + ((c ? start : t2_start)/TEXWIDTH)); - } - uint4 tmp = b; b = (c ? bx : b); bx = (c ? tmp : bx); - bx = shfl4(bx, (threadIdx.x + 28)%32); - } else { - if (TEX_DIM == 0) b = *((uint4 *)(&scratch[start])); - else if (TEX_DIM == 1) b = tex1Dfetch(texRef1D_4_V, start/4); - else if (TEX_DIM == 2) b = tex2D(texRef2D_4_V, 0.5f + ((start/4)%TEXWIDTH), 0.5f + ((start/4)/TEXWIDTH)); - if (TEX_DIM == 0) bx = *((uint4 *)(&scratch[start+16])); - else if (TEX_DIM == 1) bx = tex1Dfetch(texRef1D_4_V, (start+16)/4); - else if (TEX_DIM == 2) bx = tex2D(texRef2D_4_V, 0.5f + (((start+16)/4)%TEXWIDTH), 0.5f + (((start+16)/4)/TEXWIDTH)); - } -} - - -__device__ __forceinline__ -void primary_order_shuffle(uint4 &b, uint4 &bx) -{ - /* Inner loop shuffle targets */ - int x1 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+1)&0x3); - int x2 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+2)&0x3); - int x3 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+3)&0x3); - - b.w = __shfl2((int)b.w, x1); - b.z = __shfl2((int)b.z, x2); - b.y = __shfl2((int)b.y, x3); - - uint32_t tmp = b.y; b.y = b.w; b.w = tmp; - - bx.w = __shfl2((int)bx.w, x1); - bx.z = __shfl2((int)bx.z, x2); - bx.y = __shfl2((int)bx.y, x3); - tmp = bx.y; bx.y = bx.w; bx.w = tmp; -} - -/* - * load_key loads a 32*32bit key from a contiguous region of memory in B. - * The input keys are in external order (i.e., 0, 1, 2, 3, ...). - * After loading, each thread has its four b and four bx keys stored - * in internal processing order. - */ - -__device__ __forceinline__ -void load_key_salsa(const uint32_t *B, uint4 &b, uint4 &bx) -{ - int scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - int key_offset = scrypt_block * 32; - uint32_t thread_in_block = threadIdx.x % 4; - - // Read in permuted order. Key loads are not our bottleneck right now. - b.x = B[key_offset + 4*thread_in_block + (thread_in_block+0)%4]; - b.y = B[key_offset + 4*thread_in_block + (thread_in_block+1)%4]; - b.z = B[key_offset + 4*thread_in_block + (thread_in_block+2)%4]; - b.w = B[key_offset + 4*thread_in_block + (thread_in_block+3)%4]; - bx.x = B[key_offset + 4*thread_in_block + (thread_in_block+0)%4 + 16]; - bx.y = B[key_offset + 4*thread_in_block + (thread_in_block+1)%4 + 16]; - bx.z = B[key_offset + 4*thread_in_block + (thread_in_block+2)%4 + 16]; - bx.w = B[key_offset + 4*thread_in_block + (thread_in_block+3)%4 + 16]; - - primary_order_shuffle(b, bx); -} - -/* - * store_key performs the opposite transform as load_key, taking - * internally-ordered b and bx and storing them into a contiguous - * region of B in external order. - */ - -__device__ __forceinline__ -void store_key_salsa(uint32_t *B, uint4 &b, uint4 &bx) -{ - int scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - int key_offset = scrypt_block * 32; - uint32_t thread_in_block = threadIdx.x % 4; - - primary_order_shuffle(b, bx); - - B[key_offset + 4*thread_in_block + (thread_in_block+0)%4] = b.x; - B[key_offset + 4*thread_in_block + (thread_in_block+1)%4] = b.y; - B[key_offset + 4*thread_in_block + (thread_in_block+2)%4] = b.z; - B[key_offset + 4*thread_in_block + (thread_in_block+3)%4] = b.w; - B[key_offset + 4*thread_in_block + (thread_in_block+0)%4 + 16] = bx.x; - B[key_offset + 4*thread_in_block + (thread_in_block+1)%4 + 16] = bx.y; - B[key_offset + 4*thread_in_block + (thread_in_block+2)%4 + 16] = bx.z; - B[key_offset + 4*thread_in_block + (thread_in_block+3)%4 + 16] = bx.w; -} - - -/* - * load_key loads a 32*32bit key from a contiguous region of memory in B. - * The input keys are in external order (i.e., 0, 1, 2, 3, ...). - * After loading, each thread has its four b and four bx keys stored - * in internal processing order. - */ - -__device__ __forceinline__ -void load_key_chacha(const uint32_t *B, uint4 &b, uint4 &bx) -{ - int scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - int key_offset = scrypt_block * 32; - uint32_t thread_in_block = threadIdx.x % 4; - - // Read in permuted order. Key loads are not our bottleneck right now. - b.x = B[key_offset + 4*0 + thread_in_block%4]; - b.y = B[key_offset + 4*1 + thread_in_block%4]; - b.z = B[key_offset + 4*2 + thread_in_block%4]; - b.w = B[key_offset + 4*3 + thread_in_block%4]; - bx.x = B[key_offset + 4*0 + thread_in_block%4 + 16]; - bx.y = B[key_offset + 4*1 + thread_in_block%4 + 16]; - bx.z = B[key_offset + 4*2 + thread_in_block%4 + 16]; - bx.w = B[key_offset + 4*3 + thread_in_block%4 + 16]; -} - -/* - * store_key performs the opposite transform as load_key, taking - * internally-ordered b and bx and storing them into a contiguous - * region of B in external order. - */ - -__device__ __forceinline__ -void store_key_chacha(uint32_t *B, const uint4 &b, const uint4 &bx) -{ - int scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - int key_offset = scrypt_block * 32; - uint32_t thread_in_block = threadIdx.x % 4; - - B[key_offset + 4*0 + thread_in_block%4] = b.x; - B[key_offset + 4*1 + thread_in_block%4] = b.y; - B[key_offset + 4*2 + thread_in_block%4] = b.z; - B[key_offset + 4*3 + thread_in_block%4] = b.w; - B[key_offset + 4*0 + thread_in_block%4 + 16] = bx.x; - B[key_offset + 4*1 + thread_in_block%4 + 16] = bx.y; - B[key_offset + 4*2 + thread_in_block%4 + 16] = bx.z; - B[key_offset + 4*3 + thread_in_block%4 + 16] = bx.w; -} - - -template __device__ __forceinline__ -void load_key(const uint32_t *B, uint4 &b, uint4 &bx) -{ - switch(ALGO) { - case A_SCRYPT: load_key_salsa(B, b, bx); break; - case A_SCRYPT_JANE: load_key_chacha(B, b, bx); break; - } -} - -template __device__ __forceinline__ -void store_key(uint32_t *B, uint4 &b, uint4 &bx) -{ - switch(ALGO) { - case A_SCRYPT: store_key_salsa(B, b, bx); break; - case A_SCRYPT_JANE: store_key_chacha(B, b, bx); break; - } -} - - -/* - * salsa_xor_core (Salsa20/8 cypher) - * The original scrypt called: - * xor_salsa8(&X[0], &X[16]); <-- the "b" loop - * xor_salsa8(&X[16], &X[0]); <-- the "bx" loop - * This version is unrolled to handle both of these loops in a single - * call to avoid unnecessary data movement. - */ - -#define XOR_ROTATE_ADD(dst, s1, s2, amt) { uint32_t tmp = s1+s2; dst ^= ((tmp<>(32-amt))); } - -__device__ __forceinline__ -void salsa_xor_core(uint4 &b, uint4 &bx, const int x1, const int x2, const int x3) -{ - uint4 x; - - b ^= bx; - x = b; - - // Enter in "primary order" (t0 has 0, 4, 8, 12) - // (t1 has 5, 9, 13, 1) - // (t2 has 10, 14, 2, 6) - // (t3 has 15, 3, 7, 11) - - #pragma unroll - for (int j = 0; j < 4; j++) { - - // Mixing phase of salsa - XOR_ROTATE_ADD(x.y, x.x, x.w, 7); - XOR_ROTATE_ADD(x.z, x.y, x.x, 9); - XOR_ROTATE_ADD(x.w, x.z, x.y, 13); - XOR_ROTATE_ADD(x.x, x.w, x.z, 18); - - /* Transpose rows and columns. */ - /* Unclear if this optimization is needed: These are ordered based - * upon the dependencies needed in the later xors. Compiler should be - * able to figure this out, but might as well give it a hand. */ - x.y = __shfl2((int)x.y, x3); - x.w = __shfl2((int)x.w, x1); - x.z = __shfl2((int)x.z, x2); - - /* The next XOR_ROTATE_ADDS could be written to be a copy-paste of the first, - * but the register targets are rewritten here to swap x[1] and x[3] so that - * they can be directly shuffled to and from our peer threads without - * reassignment. The reverse shuffle then puts them back in the right place. - */ - - XOR_ROTATE_ADD(x.w, x.x, x.y, 7); - XOR_ROTATE_ADD(x.z, x.w, x.x, 9); - XOR_ROTATE_ADD(x.y, x.z, x.w, 13); - XOR_ROTATE_ADD(x.x, x.y, x.z, 18); - - x.w = __shfl2((int)x.w, x3); - x.y = __shfl2((int)x.y, x1); - x.z = __shfl2((int)x.z, x2); - } - - b += x; - // The next two lines are the beginning of the BX-centric loop iteration - bx ^= b; - x = bx; - - // This is a copy of the same loop above, identical but stripped of comments. - // Duplicated so that we can complete a bx-based loop with fewer register moves. - #pragma unroll - for (int j = 0; j < 4; j++) { - XOR_ROTATE_ADD(x.y, x.x, x.w, 7); - XOR_ROTATE_ADD(x.z, x.y, x.x, 9); - XOR_ROTATE_ADD(x.w, x.z, x.y, 13); - XOR_ROTATE_ADD(x.x, x.w, x.z, 18); - - x.y = __shfl2((int)x.y, x3); - x.w = __shfl2((int)x.w, x1); - x.z = __shfl2((int)x.z, x2); - - XOR_ROTATE_ADD(x.w, x.x, x.y, 7); - XOR_ROTATE_ADD(x.z, x.w, x.x, 9); - XOR_ROTATE_ADD(x.y, x.z, x.w, 13); - XOR_ROTATE_ADD(x.x, x.y, x.z, 18); - - x.w = __shfl2((int)x.w, x3); - x.y = __shfl2((int)x.y, x1); - x.z = __shfl2((int)x.z, x2); - } - - // At the end of these iterations, the data is in primary order again. -#undef XOR_ROTATE_ADD - - bx += x; -} - - -/* - * chacha_xor_core (ChaCha20/8 cypher) - * This version is unrolled to handle both of these loops in a single - * call to avoid unnecessary data movement. - * - * load_key and store_key must not use primary order when - * using ChaCha20/8, but rather the basic transposed order - * (referred to as "column mode" below) - */ - -#define CHACHA_PRIMITIVE(pt, rt, ps, amt) { uint32_t tmp = rt ^ (pt += ps); rt = ((tmp<>(32-amt))); } - -__device__ __forceinline__ -void chacha_xor_core(uint4 &b, uint4 &bx, const int x1, const int x2, const int x3) -{ - uint4 x; - - b ^= bx; - x = b; - - // Enter in "column" mode (t0 has 0, 4, 8, 12) - // (t1 has 1, 5, 9, 13) - // (t2 has 2, 6, 10, 14) - // (t3 has 3, 7, 11, 15) - - #pragma unroll - for (int j = 0; j < 4; j++) { - - // Column Mixing phase of chacha - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 16) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 12) - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 8) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 7) - - x.y = __shfl2((int)x.y, x1); - x.z = __shfl2((int)x.z, x2); - x.w = __shfl2((int)x.w, x3); - - // Diagonal Mixing phase of chacha - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 16) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 12) - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 8) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 7) - - x.y = __shfl2((int)x.y, x3); - x.z = __shfl2((int)x.z, x2); - x.w = __shfl2((int)x.w, x1); - } - - b += x; - // The next two lines are the beginning of the BX-centric loop iteration - bx ^= b; - x = bx; - - #pragma unroll - for (int j = 0; j < 4; j++) { - - // Column Mixing phase of chacha - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 16) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 12) - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 8) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 7) - - x.y = __shfl2((int)x.y, x1); - x.z = __shfl2((int)x.z, x2); - x.w = __shfl2((int)x.w, x3); - - // Diagonal Mixing phase of chacha - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 16) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 12) - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 8) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 7) - - x.y = __shfl2((int)x.y, x3); - x.z = __shfl2((int)x.z, x2); - x.w = __shfl2((int)x.w, x1); - } - -#undef CHACHA_PRIMITIVE - - bx += x; -} - - -template __device__ __forceinline__ -void block_mixer(uint4 &b, uint4 &bx, const int x1, const int x2, const int x3) -{ - switch(ALGO) { - case A_SCRYPT: salsa_xor_core(b, bx, x1, x2, x3); break; - case A_SCRYPT_JANE: chacha_xor_core(b, bx, x1, x2, x3); break; - } -} - - -/* - * The hasher_gen_kernel operates on a group of 1024-bit input keys - * in B, stored as: - * B = { k1B k1Bx k2B k2Bx ... } - * and fills up the scratchpad with the iterative hashes derived from - * those keys: - * scratch { k1h1B k1h1Bx K1h2B K1h2Bx ... K2h1B K2h1Bx K2h2B K2h2Bx ... } - * scratch is 1024 times larger than the input keys B. - * It is extremely important to stream writes effectively into scratch; - * less important to coalesce the reads from B. - * - * Key ordering note: Keys are input from B in "original" order: - * K = {k1, k2, k3, k4, k5, ..., kx15, kx16, kx17, ..., kx31 } - * After inputting into kernel_gen, each component k and kx of the - * key is transmuted into a permuted internal order to make processing faster: - * K = k, kx with: - * k = 0, 4, 8, 12, 5, 9, 13, 1, 10, 14, 2, 6, 15, 3, 7, 11 - * and similarly for kx. - */ - -template __global__ -void kepler_scrypt_core_kernelA(const uint32_t *d_idata, int begin, int end) -{ - uint4 b, bx; - - int x1 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+1)&0x3); - int x2 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+2)&0x3); - int x3 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+3)&0x3); - - int scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - int start = (scrypt_block*c_SCRATCH + (SCHEME==ANDERSEN?8:4)*(threadIdx.x%4)) % c_SCRATCH_WU_PER_WARP; - - int i=begin; - - if (i == 0) { - load_key(d_idata, b, bx); - write_keys_direct(b, bx, start); - ++i; - } else read_keys_direct(b, bx, start+32*(i-1)); - - while (i < end) { - block_mixer(b, bx, x1, x2, x3); - write_keys_direct(b, bx, start+32*i); - ++i; - } -} - -template __global__ -void kepler_scrypt_core_kernelA_LG(const uint32_t *d_idata, int begin, int end, unsigned int LOOKUP_GAP) -{ - uint4 b, bx; - - int x1 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+1)&0x3); - int x2 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+2)&0x3); - int x3 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+3)&0x3); - - int scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - int start = (scrypt_block*c_SCRATCH + (SCHEME==ANDERSEN?8:4)*(threadIdx.x%4)) % c_SCRATCH_WU_PER_WARP; - - int i=begin; - - if (i == 0) { - load_key(d_idata, b, bx); - write_keys_direct(b, bx, start); - ++i; - } else { - int pos = (i-1)/LOOKUP_GAP, loop = (i-1)-pos*LOOKUP_GAP; - read_keys_direct(b, bx, start+32*pos); - while(loop--) block_mixer(b, bx, x1, x2, x3); - } - - while (i < end) { - block_mixer(b, bx, x1, x2, x3); - if (i % LOOKUP_GAP == 0) - write_keys_direct(b, bx, start+32*(i/LOOKUP_GAP)); - ++i; - } -} - - -/* - * hasher_hash_kernel runs the second phase of scrypt after the scratch - * buffer is filled with the iterative hashes: It bounces through - * the scratch buffer in pseudorandom order, mixing the key as it goes. - */ - -template __global__ -void kepler_scrypt_core_kernelB(uint32_t *d_odata, int begin, int end) -{ - uint4 b, bx; - - int scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - int start = (scrypt_block*c_SCRATCH) + (SCHEME==ANDERSEN?8:4)*(threadIdx.x%4); - if (TEX_DIM == 0) start %= c_SCRATCH_WU_PER_WARP; - - int x1 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+1)&0x3); - int x2 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+2)&0x3); - int x3 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+3)&0x3); - - if (begin == 0) { - read_keys_direct(b, bx, start+32*c_N_1); - block_mixer(b, bx, x1, x2, x3); - } else load_key(d_odata, b, bx); - - for (int i = begin; i < end; i++) { - int j = (__shfl2((int)bx.x, (threadIdx.x & 0x1c)) & (c_N_1)); - uint4 t, tx; read_keys_direct(t, tx, start+32*j); - b ^= t; bx ^= tx; - block_mixer(b, bx, x1, x2, x3); - } - - store_key(d_odata, b, bx); -} - -template __global__ -void kepler_scrypt_core_kernelB_LG(uint32_t *d_odata, int begin, int end, unsigned int LOOKUP_GAP) -{ - uint4 b, bx; - - int scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - int start = (scrypt_block*c_SCRATCH) + (SCHEME==ANDERSEN?8:4)*(threadIdx.x%4); - if (TEX_DIM == 0) start %= c_SCRATCH_WU_PER_WARP; - - int x1 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+1)&0x3); - int x2 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+2)&0x3); - int x3 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+3)&0x3); - - if (begin == 0) { - int pos = c_N_1/LOOKUP_GAP, loop = 1 + (c_N_1-pos*LOOKUP_GAP); - read_keys_direct(b, bx, start+32*pos); - while(loop--) block_mixer(b, bx, x1, x2, x3); - } else load_key(d_odata, b, bx); - - if (SCHEME == SIMPLE) - { - // better divergent thread handling submitted by nVidia engineers, but - // supposedly this does not run with the ANDERSEN memory access scheme - int j = (__shfl2((int)bx.x, (threadIdx.x & 0x1c)) & (c_N_1)); - int pos = j/LOOKUP_GAP; - int loop = -1; - uint4 t, tx; - - int i = begin; - while(i < end) { - if (loop==-1) { - j = (__shfl2((int)bx.x, (threadIdx.x & 0x1c)) & (c_N_1)); - pos = j/LOOKUP_GAP; - loop = j-pos*LOOKUP_GAP; - read_keys_direct(t, tx, start+32*pos); - } - if (loop==0) { - b ^= t; bx ^= tx; - t=b;tx=bx; - } - block_mixer(t, tx, x1, x2, x3); - if (loop==0) { - b=t;bx=tx; - i++; - } - loop--; - } - } - else - { - // this is my original implementation, now used with the ANDERSEN - // memory access scheme only. - for (int i = begin; i < end; i++) { - int j = (__shfl2((int)bx.x, (threadIdx.x & 0x1c)) & (c_N_1)); - int pos = j/LOOKUP_GAP, loop = j-pos*LOOKUP_GAP; - uint4 t, tx; read_keys_direct(t, tx, start+32*pos); - while(loop--) block_mixer(t, tx, x1, x2, x3); - b ^= t; bx ^= tx; - block_mixer(b, bx, x1, x2, x3); - } - } - -//for (int i = begin; i < end; i++) { -// int j = (__shfl2((int)bx.x, (threadIdx.x & 0x1c)) & (c_N_1)); -// int pos = j/LOOKUP_GAP, loop = j-pos*LOOKUP_GAP; -// uint4 t, tx; read_keys_direct(t, tx, start+32*pos); -// while(loop--) block_mixer(t, tx, x1, x2, x3); -// b ^= t; bx ^= tx; -// block_mixer(b, bx, x1, x2, x3); -//} - - store_key(d_odata, b, bx); -} - -KeplerKernel::KeplerKernel() : KernelInterface() -{ -} - -bool KeplerKernel::bindtexture_1D(uint32_t *d_V, size_t size) -{ - cudaChannelFormatDesc channelDesc4 = cudaCreateChannelDesc(); - texRef1D_4_V.normalized = 0; - texRef1D_4_V.filterMode = cudaFilterModePoint; - texRef1D_4_V.addressMode[0] = cudaAddressModeClamp; - checkCudaErrors(cudaBindTexture(NULL, &texRef1D_4_V, d_V, &channelDesc4, size)); - return true; -} - -bool KeplerKernel::bindtexture_2D(uint32_t *d_V, int width, int height, size_t pitch) -{ - cudaChannelFormatDesc channelDesc4 = cudaCreateChannelDesc(); - texRef2D_4_V.normalized = 0; - texRef2D_4_V.filterMode = cudaFilterModePoint; - texRef2D_4_V.addressMode[0] = cudaAddressModeClamp; - texRef2D_4_V.addressMode[1] = cudaAddressModeClamp; - // maintain texture width of TEXWIDTH (max. limit is 65000) - while (width > TEXWIDTH) { width /= 2; height *= 2; pitch /= 2; } - while (width < TEXWIDTH) { width *= 2; height = (height+1)/2; pitch *= 2; } - checkCudaErrors(cudaBindTexture2D(NULL, &texRef2D_4_V, d_V, &channelDesc4, width, height, pitch)); - return true; -} - -bool KeplerKernel::unbindtexture_1D() -{ - checkCudaErrors(cudaUnbindTexture(texRef1D_4_V)); - return true; -} - -bool KeplerKernel::unbindtexture_2D() -{ - checkCudaErrors(cudaUnbindTexture(texRef2D_4_V)); - return true; -} - -void KeplerKernel::set_scratchbuf_constants(int MAXWARPS, uint32_t** h_V) -{ - checkCudaErrors(cudaMemcpyToSymbol(c_V, h_V, MAXWARPS*sizeof(uint32_t*), 0, cudaMemcpyHostToDevice)); -} - -bool KeplerKernel::run_kernel(dim3 grid, dim3 threads, int WARPS_PER_BLOCK, int thr_id, cudaStream_t stream, - uint32_t* d_idata, uint32_t* d_odata, unsigned int N, unsigned int LOOKUP_GAP, bool interactive, bool benchmark, int texture_cache) -{ - bool success = true; - - // make some constants available to kernel, update only initially and when changing - static uint32_t prev_N[MAX_GPUS] = { 0 }; - - if (N != prev_N[thr_id]) { - uint32_t h_N = N; - uint32_t h_N_1 = N-1; - uint32_t h_SCRATCH = SCRATCH; - uint32_t h_SCRATCH_WU_PER_WARP = (SCRATCH * WU_PER_WARP); - uint32_t h_SCRATCH_WU_PER_WARP_1 = (SCRATCH * WU_PER_WARP) - 1; - - cudaMemcpyToSymbolAsync(c_N, &h_N, sizeof(uint32_t), 0, cudaMemcpyHostToDevice, stream); - cudaMemcpyToSymbolAsync(c_N_1, &h_N_1, sizeof(uint32_t), 0, cudaMemcpyHostToDevice, stream); - cudaMemcpyToSymbolAsync(c_SCRATCH, &h_SCRATCH, sizeof(uint32_t), 0, cudaMemcpyHostToDevice, stream); - cudaMemcpyToSymbolAsync(c_SCRATCH_WU_PER_WARP, &h_SCRATCH_WU_PER_WARP, sizeof(uint32_t), 0, cudaMemcpyHostToDevice, stream); - cudaMemcpyToSymbolAsync(c_SCRATCH_WU_PER_WARP_1, &h_SCRATCH_WU_PER_WARP_1, sizeof(uint32_t), 0, cudaMemcpyHostToDevice, stream); - - prev_N[thr_id] = N; - } - - // First phase: Sequential writes to scratchpad. - - int batch = device_batchsize[thr_id]; - //int num_sleeps = 2* ((N + (batch-1)) / batch); - //int sleeptime = 100; - - unsigned int pos = 0; - do - { - if (LOOKUP_GAP == 1) { - if (IS_SCRYPT()) kepler_scrypt_core_kernelA <<< grid, threads, 0, stream >>>(d_idata, pos, min(pos+batch, N)); - if (IS_SCRYPT_JANE()) kepler_scrypt_core_kernelA <<< grid, threads, 0, stream >>>(d_idata, pos, min(pos+batch, N)); - } else { - if (IS_SCRYPT()) kepler_scrypt_core_kernelA_LG <<< grid, threads, 0, stream >>>(d_idata, pos, min(pos+batch, N), LOOKUP_GAP); - if (IS_SCRYPT_JANE()) kepler_scrypt_core_kernelA_LG <<< grid, threads, 0, stream >>>(d_idata, pos, min(pos+batch, N), LOOKUP_GAP); - } - pos += batch; - } while (pos < N); - - // Second phase: Random read access from scratchpad. - - pos = 0; - do - { - if (LOOKUP_GAP == 1) { - - if (texture_cache == 0) { - if (IS_SCRYPT()) kepler_scrypt_core_kernelB<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N)); - if (IS_SCRYPT_JANE()) kepler_scrypt_core_kernelB<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N)); - } else if (texture_cache == 1) { - if (IS_SCRYPT()) kepler_scrypt_core_kernelB<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N)); - if (IS_SCRYPT_JANE()) kepler_scrypt_core_kernelB<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N)); - } else if (texture_cache == 2) { - if (IS_SCRYPT()) kepler_scrypt_core_kernelB<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N)); - if (IS_SCRYPT_JANE()) kepler_scrypt_core_kernelB<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N)); - } - - } else { - - if (texture_cache == 0) { - if (IS_SCRYPT()) kepler_scrypt_core_kernelB_LG<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N), LOOKUP_GAP); - if (IS_SCRYPT_JANE()) kepler_scrypt_core_kernelB_LG<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N), LOOKUP_GAP); - } else if (texture_cache == 1) { - if (IS_SCRYPT()) kepler_scrypt_core_kernelB_LG<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N), LOOKUP_GAP); - if (IS_SCRYPT_JANE()) kepler_scrypt_core_kernelB_LG<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N), LOOKUP_GAP); - } else if (texture_cache == 2) { - if (IS_SCRYPT()) kepler_scrypt_core_kernelB_LG<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N), LOOKUP_GAP); - if (IS_SCRYPT_JANE()) kepler_scrypt_core_kernelB_LG<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N), LOOKUP_GAP); - } - } - - pos += batch; - } while (pos < N); - - return success; -} diff --git a/scrypt/kepler_kernel.h b/scrypt/kepler_kernel.h deleted file mode 100644 index afe78dab..00000000 --- a/scrypt/kepler_kernel.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef KEPLER_KERNEL_H -#define KEPLER_KERNEL_H - -#include "salsa_kernel.h" - -class KeplerKernel : public KernelInterface -{ -public: - KeplerKernel(); - - virtual void set_scratchbuf_constants(int MAXWARPS, uint32_t** h_V); - virtual bool run_kernel(dim3 grid, dim3 threads, int WARPS_PER_BLOCK, int thr_id, cudaStream_t stream, uint32_t* d_idata, uint32_t* d_odata, unsigned int N, unsigned int LOOKUP_GAP, bool interactive, bool benchmark, int texture_cache); - virtual bool bindtexture_1D(uint32_t *d_V, size_t size); - virtual bool bindtexture_2D(uint32_t *d_V, int width, int height, size_t pitch); - virtual bool unbindtexture_1D(); - virtual bool unbindtexture_2D(); - - virtual char get_identifier() { return 'k'; }; - virtual int get_major_version() { return 3; }; - virtual int get_minor_version() { return 0; }; - - virtual int max_warps_per_block() { return 32; }; - virtual int get_texel_width() { return 4; }; - virtual int threads_per_wu() { return 4; } - virtual bool support_lookup_gap() { return true; } - virtual cudaFuncCache cache_config() { return cudaFuncCachePreferL1; } -}; - -#endif // #ifndef KEPLER_KERNEL_H diff --git a/scrypt/nv_kernel.cu b/scrypt/nv_kernel.cu deleted file mode 100644 index 90b4c8a7..00000000 --- a/scrypt/nv_kernel.cu +++ /dev/null @@ -1,712 +0,0 @@ -// -// Experimental Kernel for Kepler (Compute 3.5) devices -// code submitted by nVidia performance engineer Alexey Panteleev -// with modifications by Christian Buchner -// -// for Compute 3.5 -// NOTE: compile this .cu module for compute_35,sm_35 with --maxrregcount=80 -// for Compute 3.0 -// NOTE: compile this .cu module for compute_30,sm_30 with --maxrregcount=63 -// - -#include - -#include -#include - -#include "miner.h" -#include "salsa_kernel.h" -#include "nv_kernel.h" - -#define THREADS_PER_WU 1 // single thread per hash - -#define TEXWIDTH 32768 - -#if __CUDA_ARCH__ < 350 - // Kepler (Compute 3.0) - #define __ldg(x) (*(x)) -#endif - -// grab lane ID -static __device__ __inline__ unsigned int __laneId() { unsigned int laneId; asm( "mov.u32 %0, %%laneid;" : "=r"( laneId ) ); return laneId; } - -// forward references -template __global__ void nv_scrypt_core_kernelA(uint32_t *g_idata, int begin, int end); -template __global__ void nv_scrypt_core_kernelB(uint32_t *g_odata, int begin, int end); -template __global__ void nv_scrypt_core_kernelA_LG(uint32_t *g_idata, int begin, int end, unsigned int LOOKUP_GAP); -template __global__ void nv_scrypt_core_kernelB_LG(uint32_t *g_odata, int begin, int end, unsigned int LOOKUP_GAP); - -// scratchbuf constants (pointers to scratch buffer for each work unit) -__constant__ uint32_t* c_V[TOTAL_WARP_LIMIT]; - -// using texture references for the "tex" variants of the B kernels -texture texRef1D_4_V; -texture texRef2D_4_V; - -// iteration count N -__constant__ uint32_t c_N; -__constant__ uint32_t c_N_1; // N - 1 -__constant__ uint32_t c_spacing; // (N+LOOKUP_GAP-1)/LOOKUP_GAP - -NVKernel::NVKernel() : KernelInterface() -{ -} - -bool NVKernel::bindtexture_1D(uint32_t *d_V, size_t size) -{ - cudaChannelFormatDesc channelDesc4 = cudaCreateChannelDesc(); - texRef1D_4_V.normalized = 0; - texRef1D_4_V.filterMode = cudaFilterModePoint; - texRef1D_4_V.addressMode[0] = cudaAddressModeClamp; - checkCudaErrors(cudaBindTexture(NULL, &texRef1D_4_V, d_V, &channelDesc4, size)); - return true; -} - -bool NVKernel::bindtexture_2D(uint32_t *d_V, int width, int height, size_t pitch) -{ - cudaChannelFormatDesc channelDesc4 = cudaCreateChannelDesc(); - texRef2D_4_V.normalized = 0; - texRef2D_4_V.filterMode = cudaFilterModePoint; - texRef2D_4_V.addressMode[0] = cudaAddressModeClamp; - texRef2D_4_V.addressMode[1] = cudaAddressModeClamp; - // maintain texture width of TEXWIDTH (max. limit is 65000) - while (width > TEXWIDTH) { width /= 2; height *= 2; pitch /= 2; } - while (width < TEXWIDTH) { width *= 2; height = (height+1)/2; pitch *= 2; } - checkCudaErrors(cudaBindTexture2D(NULL, &texRef2D_4_V, d_V, &channelDesc4, width, height, pitch)); - return true; -} - -bool NVKernel::unbindtexture_1D() -{ - checkCudaErrors(cudaUnbindTexture(texRef1D_4_V)); - return true; -} - -bool NVKernel::unbindtexture_2D() -{ - checkCudaErrors(cudaUnbindTexture(texRef2D_4_V)); - return true; -} - -void NVKernel::set_scratchbuf_constants(int MAXWARPS, uint32_t** h_V) -{ - checkCudaErrors(cudaMemcpyToSymbol(c_V, h_V, MAXWARPS*sizeof(uint32_t*), 0, cudaMemcpyHostToDevice)); -} - -bool NVKernel::run_kernel(dim3 grid, dim3 threads, int WARPS_PER_BLOCK, int thr_id, cudaStream_t stream, uint32_t* d_idata, uint32_t* d_odata, unsigned int N, unsigned int LOOKUP_GAP, bool interactive, bool benchmark, int texture_cache) -{ - bool success = true; - - // make some constants available to kernel, update only initially and when changing - static uint32_t prev_N[MAX_GPUS] = { 0 }; - - if (N != prev_N[thr_id]) { - uint32_t h_N = N; - uint32_t h_N_1 = N-1; - uint32_t h_spacing = (N+LOOKUP_GAP-1)/LOOKUP_GAP; - - cudaMemcpyToSymbolAsync(c_N, &h_N, sizeof(uint32_t), 0, cudaMemcpyHostToDevice, stream); - cudaMemcpyToSymbolAsync(c_N_1, &h_N_1, sizeof(uint32_t), 0, cudaMemcpyHostToDevice, stream); - cudaMemcpyToSymbolAsync(c_spacing, &h_spacing, sizeof(uint32_t), 0, cudaMemcpyHostToDevice, stream); - - prev_N[thr_id] = N; - } - - // First phase: Sequential writes to scratchpad. - const int batch = device_batchsize[thr_id]; - unsigned int pos = 0; - - do - { - if (LOOKUP_GAP == 1) { - if (IS_SCRYPT()) nv_scrypt_core_kernelA <<< grid, threads, 0, stream >>>(d_idata, pos, min(pos+batch, N)); - if (IS_SCRYPT_JANE()) nv_scrypt_core_kernelA<<< grid, threads, 0, stream >>>(d_idata, pos, min(pos+batch, N)); - } - else { - if (IS_SCRYPT()) nv_scrypt_core_kernelA_LG <<< grid, threads, 0, stream >>>(d_idata, pos, min(pos+batch, N), LOOKUP_GAP); - if (IS_SCRYPT_JANE()) nv_scrypt_core_kernelA_LG<<< grid, threads, 0, stream >>>(d_idata, pos, min(pos+batch, N), LOOKUP_GAP); - } - - pos += batch; - } while (pos < N); - - // Second phase: Random read access from scratchpad. - pos = 0; - do - { - if (LOOKUP_GAP == 1) { - if (texture_cache == 0) { - if (IS_SCRYPT()) nv_scrypt_core_kernelB<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N)); - if (IS_SCRYPT_JANE()) nv_scrypt_core_kernelB<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N)); - } - else if (texture_cache == 1) { - if (IS_SCRYPT()) nv_scrypt_core_kernelB<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N)); - if (IS_SCRYPT_JANE()) nv_scrypt_core_kernelB<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N)); - } - else if (texture_cache == 2) { - if (IS_SCRYPT()) nv_scrypt_core_kernelB<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N)); - if (IS_SCRYPT_JANE()) nv_scrypt_core_kernelB<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N)); - } - } else { - if (texture_cache == 0) { - if (IS_SCRYPT()) nv_scrypt_core_kernelB_LG<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N), LOOKUP_GAP); - if (IS_SCRYPT_JANE()) nv_scrypt_core_kernelB_LG<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N), LOOKUP_GAP); - } - else if (texture_cache == 1) { - if (IS_SCRYPT()) nv_scrypt_core_kernelB_LG<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N), LOOKUP_GAP); - if (IS_SCRYPT_JANE()) nv_scrypt_core_kernelB_LG<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N), LOOKUP_GAP); - } - else if (texture_cache == 2) { - if (IS_SCRYPT()) nv_scrypt_core_kernelB_LG<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N), LOOKUP_GAP); - if (IS_SCRYPT_JANE()) nv_scrypt_core_kernelB_LG<<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N), LOOKUP_GAP); - } - } - - pos += batch; - } while (pos < N); - - return success; -} - -static __device__ uint4& operator^=(uint4& left, const uint4& right) -{ - left.x ^= right.x; - left.y ^= right.y; - left.z ^= right.z; - left.w ^= right.w; - return left; -} - -__device__ __forceinline__ uint4 shfl4(const uint4 val, unsigned int lane, unsigned int width) -{ - return make_uint4( - (unsigned int)__shfl((int)val.x, lane, width), - (unsigned int)__shfl((int)val.y, lane, width), - (unsigned int)__shfl((int)val.z, lane, width), - (unsigned int)__shfl((int)val.w, lane, width) - ); -} - -__device__ __forceinline__ void __transposed_write_BC(uint4 (&B)[4], uint4 (&C)[4], uint4 *D, int spacing) -{ - unsigned int laneId = __laneId(); - - unsigned int lane8 = laneId%8; - unsigned int tile = laneId/8; - - uint4 T1[8], T2[8]; - - /* Source matrix, A-H are threads, 0-7 are data items, thread A is marked with `*`: - - *A0 B0 C0 D0 E0 F0 G0 H0 - *A1 B1 C1 D1 E1 F1 G1 H1 - *A2 B2 C2 D2 E2 F2 G2 H2 - *A3 B3 C3 D3 E3 F3 G3 H3 - *A4 B4 C4 D4 E4 F4 G4 H4 - *A5 B5 C5 D5 E5 F5 G5 H5 - *A6 B6 C6 D6 E6 F6 G6 H6 - *A7 B7 C7 D7 E7 F7 G7 H7 - */ - - // rotate rows - T1[0] = B[0]; - T1[1] = shfl4(B[1], lane8 + 7, 8); - T1[2] = shfl4(B[2], lane8 + 6, 8); - T1[3] = shfl4(B[3], lane8 + 5, 8); - T1[4] = shfl4(C[0], lane8 + 4, 8); - T1[5] = shfl4(C[1], lane8 + 3, 8); - T1[6] = shfl4(C[2], lane8 + 2, 8); - T1[7] = shfl4(C[3], lane8 + 1, 8); - - /* Matrix after row rotates: - - *A0 B0 C0 D0 E0 F0 G0 H0 - H1 *A1 B1 C1 D1 E1 F1 G1 - G2 H2 *A2 B2 C2 D2 E2 F2 - F3 G3 H3 *A3 B3 C3 D3 E3 - E4 F4 G4 H4 *A4 B4 C4 D4 - D5 E5 F5 G5 H5 *A5 B5 C5 - C6 D6 E6 F6 G6 H6 *A6 B6 - B7 C7 D7 E7 F7 G7 H7 *A7 - */ - - // rotate columns up using a barrel shifter simulation - // column X is rotated up by (X+1) items -#pragma unroll 8 - for(int n = 0; n < 8; n++) T2[n] = ((lane8+1) & 1) ? T1[(n+1) % 8] : T1[n]; -#pragma unroll 8 - for(int n = 0; n < 8; n++) T1[n] = ((lane8+1) & 2) ? T2[(n+2) % 8] : T2[n]; -#pragma unroll 8 - for(int n = 0; n < 8; n++) T2[n] = ((lane8+1) & 4) ? T1[(n+4) % 8] : T1[n]; - - /* Matrix after column rotates: - - H1 H2 H3 H4 H5 H6 H7 H0 - G2 G3 G4 G5 G6 G7 G0 G1 - F3 F4 F5 F6 F7 F0 F1 F2 - E4 E5 E6 E7 E0 E1 E2 E3 - D5 D6 D7 D0 D1 D2 D3 D4 - C6 C7 C0 C1 C2 C3 C4 C5 - B7 B0 B1 B2 B3 B4 B5 B6 - *A0 *A1 *A2 *A3 *A4 *A5 *A6 *A7 - */ - - // rotate rows again using address math and write to D, in reverse row order - D[spacing*2*(32*tile )+ lane8 ] = T2[7]; - D[spacing*2*(32*tile+4 )+(lane8+7)%8] = T2[6]; - D[spacing*2*(32*tile+8 )+(lane8+6)%8] = T2[5]; - D[spacing*2*(32*tile+12)+(lane8+5)%8] = T2[4]; - D[spacing*2*(32*tile+16)+(lane8+4)%8] = T2[3]; - D[spacing*2*(32*tile+20)+(lane8+3)%8] = T2[2]; - D[spacing*2*(32*tile+24)+(lane8+2)%8] = T2[1]; - D[spacing*2*(32*tile+28)+(lane8+1)%8] = T2[0]; -} - -template __device__ __forceinline__ void __transposed_read_BC(const uint4 *S, uint4 (&B)[4], uint4 (&C)[4], int spacing, int row) -{ - unsigned int laneId = __laneId(); - - unsigned int lane8 = laneId%8; - unsigned int tile = laneId/8; - - // Perform the same transposition as in __transposed_write_BC, but in reverse order. - // See the illustrations in comments for __transposed_write_BC. - - // read and rotate rows, in reverse row order - uint4 T1[8], T2[8]; - const uint4 *loc; - loc = &S[(spacing*2*(32*tile ) + lane8 + 8*__shfl(row, 0, 8))]; - T1[7] = TEX_DIM==0 ? __ldg(loc) : TEX_DIM==1 ? tex1Dfetch(texRef1D_4_V, loc-(uint4*)c_V[0]) : tex2D(texRef2D_4_V, 0.5f + ((loc-(uint4*)c_V[0])%TEXWIDTH), 0.5f + ((loc-(uint4*)c_V[0])/TEXWIDTH)); - loc = &S[(spacing*2*(32*tile+4 ) + (lane8+7)%8 + 8*__shfl(row, 1, 8))]; - T1[6] = TEX_DIM==0 ? __ldg(loc) : TEX_DIM==1 ? tex1Dfetch(texRef1D_4_V, loc-(uint4*)c_V[0]) : tex2D(texRef2D_4_V, 0.5f + ((loc-(uint4*)c_V[0])%TEXWIDTH), 0.5f + ((loc-(uint4*)c_V[0])/TEXWIDTH)); - loc = &S[(spacing*2*(32*tile+8 ) + (lane8+6)%8 + 8*__shfl(row, 2, 8))]; - T1[5] = TEX_DIM==0 ? __ldg(loc) : TEX_DIM==1 ? tex1Dfetch(texRef1D_4_V, loc-(uint4*)c_V[0]) : tex2D(texRef2D_4_V, 0.5f + ((loc-(uint4*)c_V[0])%TEXWIDTH), 0.5f + ((loc-(uint4*)c_V[0])/TEXWIDTH)); - loc = &S[(spacing*2*(32*tile+12) + (lane8+5)%8 + 8*__shfl(row, 3, 8))]; - T1[4] = TEX_DIM==0 ? __ldg(loc) : TEX_DIM==1 ? tex1Dfetch(texRef1D_4_V, loc-(uint4*)c_V[0]) : tex2D(texRef2D_4_V, 0.5f + ((loc-(uint4*)c_V[0])%TEXWIDTH), 0.5f + ((loc-(uint4*)c_V[0])/TEXWIDTH)); - loc = &S[(spacing*2*(32*tile+16) + (lane8+4)%8 + 8*__shfl(row, 4, 8))]; - T1[3] = TEX_DIM==0 ? __ldg(loc) : TEX_DIM==1 ? tex1Dfetch(texRef1D_4_V, loc-(uint4*)c_V[0]) : tex2D(texRef2D_4_V, 0.5f + ((loc-(uint4*)c_V[0])%TEXWIDTH), 0.5f + ((loc-(uint4*)c_V[0])/TEXWIDTH)); - loc = &S[(spacing*2*(32*tile+20) + (lane8+3)%8 + 8*__shfl(row, 5, 8))]; - T1[2] = TEX_DIM==0 ? __ldg(loc) : TEX_DIM==1 ? tex1Dfetch(texRef1D_4_V, loc-(uint4*)c_V[0]) : tex2D(texRef2D_4_V, 0.5f + ((loc-(uint4*)c_V[0])%TEXWIDTH), 0.5f + ((loc-(uint4*)c_V[0])/TEXWIDTH)); - loc = &S[(spacing*2*(32*tile+24) + (lane8+2)%8 + 8*__shfl(row, 6, 8))]; - T1[1] = TEX_DIM==0 ? __ldg(loc) : TEX_DIM==1 ? tex1Dfetch(texRef1D_4_V, loc-(uint4*)c_V[0]) : tex2D(texRef2D_4_V, 0.5f + ((loc-(uint4*)c_V[0])%TEXWIDTH), 0.5f + ((loc-(uint4*)c_V[0])/TEXWIDTH)); - loc = &S[(spacing*2*(32*tile+28) + (lane8+1)%8 + 8*__shfl(row, 7, 8))]; - T1[0] = TEX_DIM==0 ? __ldg(loc) : TEX_DIM==1 ? tex1Dfetch(texRef1D_4_V, loc-(uint4*)c_V[0]) : tex2D(texRef2D_4_V, 0.5f + ((loc-(uint4*)c_V[0])%TEXWIDTH), 0.5f + ((loc-(uint4*)c_V[0])/TEXWIDTH)); - - // rotate columns down using a barrel shifter simulation - // column X is rotated down by (X+1) items, or up by (8-(X+1)) = (7-X) items -#pragma unroll 8 - for(int n = 0; n < 8; n++) T2[n] = ((7-lane8) & 1) ? T1[(n+1) % 8] : T1[n]; -#pragma unroll 8 - for(int n = 0; n < 8; n++) T1[n] = ((7-lane8) & 2) ? T2[(n+2) % 8] : T2[n]; -#pragma unroll 8 - for(int n = 0; n < 8; n++) T2[n] = ((7-lane8) & 4) ? T1[(n+4) % 8] : T1[n]; - - // rotate rows - B[0] = T2[0]; - B[1] = shfl4(T2[1], lane8 + 1, 8); - B[2] = shfl4(T2[2], lane8 + 2, 8); - B[3] = shfl4(T2[3], lane8 + 3, 8); - C[0] = shfl4(T2[4], lane8 + 4, 8); - C[1] = shfl4(T2[5], lane8 + 5, 8); - C[2] = shfl4(T2[6], lane8 + 6, 8); - C[3] = shfl4(T2[7], lane8 + 7, 8); - -} - -template __device__ __forceinline__ void __transposed_xor_BC(const uint4 *S, uint4 (&B)[4], uint4 (&C)[4], int spacing, int row) -{ - uint4 BT[4], CT[4]; - __transposed_read_BC(S, BT, CT, spacing, row); - -#pragma unroll 4 - for(int n = 0; n < 4; n++) - { - B[n] ^= BT[n]; - C[n] ^= CT[n]; - } -} - -#if __CUDA_ARCH__ < 350 - // Kepler (Compute 3.0) - #define ROTL(a, b) ((a)<<(b))|((a)>>(32-(b))) -#else - // Kepler (Compute 3.5) - #define ROTL(a, b) __funnelshift_l( a, a, b ); -#endif - - - -#if 0 - -#define QUARTER(a,b,c,d) \ - a += b; d ^= a; d = ROTL(d,16); \ - c += d; b ^= c; b = ROTL(b,12); \ - a += b; d ^= a; d = ROTL(d,8); \ - c += d; b ^= c; b = ROTL(b,7); - -static __device__ void xor_chacha8(uint4 *B, uint4 *C) -{ - uint32_t x[16]; - x[0]=(B[0].x ^= C[0].x); - x[1]=(B[0].y ^= C[0].y); - x[2]=(B[0].z ^= C[0].z); - x[3]=(B[0].w ^= C[0].w); - x[4]=(B[1].x ^= C[1].x); - x[5]=(B[1].y ^= C[1].y); - x[6]=(B[1].z ^= C[1].z); - x[7]=(B[1].w ^= C[1].w); - x[8]=(B[2].x ^= C[2].x); - x[9]=(B[2].y ^= C[2].y); - x[10]=(B[2].z ^= C[2].z); - x[11]=(B[2].w ^= C[2].w); - x[12]=(B[3].x ^= C[3].x); - x[13]=(B[3].y ^= C[3].y); - x[14]=(B[3].z ^= C[3].z); - x[15]=(B[3].w ^= C[3].w); - - /* Operate on columns. */ - QUARTER( x[0], x[4], x[ 8], x[12] ) - QUARTER( x[1], x[5], x[ 9], x[13] ) - QUARTER( x[2], x[6], x[10], x[14] ) - QUARTER( x[3], x[7], x[11], x[15] ) - - /* Operate on diagonals */ - QUARTER( x[0], x[5], x[10], x[15] ) - QUARTER( x[1], x[6], x[11], x[12] ) - QUARTER( x[2], x[7], x[ 8], x[13] ) - QUARTER( x[3], x[4], x[ 9], x[14] ) - - /* Operate on columns. */ - QUARTER( x[0], x[4], x[ 8], x[12] ) - QUARTER( x[1], x[5], x[ 9], x[13] ) - QUARTER( x[2], x[6], x[10], x[14] ) - QUARTER( x[3], x[7], x[11], x[15] ) - - /* Operate on diagonals */ - QUARTER( x[0], x[5], x[10], x[15] ) - QUARTER( x[1], x[6], x[11], x[12] ) - QUARTER( x[2], x[7], x[ 8], x[13] ) - QUARTER( x[3], x[4], x[ 9], x[14] ) - - /* Operate on columns. */ - QUARTER( x[0], x[4], x[ 8], x[12] ) - QUARTER( x[1], x[5], x[ 9], x[13] ) - QUARTER( x[2], x[6], x[10], x[14] ) - QUARTER( x[3], x[7], x[11], x[15] ) - - /* Operate on diagonals */ - QUARTER( x[0], x[5], x[10], x[15] ) - QUARTER( x[1], x[6], x[11], x[12] ) - QUARTER( x[2], x[7], x[ 8], x[13] ) - QUARTER( x[3], x[4], x[ 9], x[14] ) - - /* Operate on columns. */ - QUARTER( x[0], x[4], x[ 8], x[12] ) - QUARTER( x[1], x[5], x[ 9], x[13] ) - QUARTER( x[2], x[6], x[10], x[14] ) - QUARTER( x[3], x[7], x[11], x[15] ) - - /* Operate on diagonals */ - QUARTER( x[0], x[5], x[10], x[15] ) - QUARTER( x[1], x[6], x[11], x[12] ) - QUARTER( x[2], x[7], x[ 8], x[13] ) - QUARTER( x[3], x[4], x[ 9], x[14] ) - - B[0].x += x[0]; B[0].y += x[1]; B[0].z += x[2]; B[0].w += x[3]; B[1].x += x[4]; B[1].y += x[5]; B[1].z += x[6]; B[1].w += x[7]; - B[2].x += x[8]; B[2].y += x[9]; B[2].z += x[10]; B[2].w += x[11]; B[3].x += x[12]; B[3].y += x[13]; B[3].z += x[14]; B[3].w += x[15]; -} - -#else - -#define ADD4(d1,d2,d3,d4,s1,s2,s3,s4) \ - d1 += s1; d2 += s2; d3 += s3; d4 += s4; - -#define XOR4(d1,d2,d3,d4,s1,s2,s3,s4) \ - d1 ^= s1; d2 ^= s2; d3 ^= s3; d4 ^= s4; - -#define ROTL4(d1,d2,d3,d4,amt) \ - d1 = ROTL(d1, amt); d2 = ROTL(d2, amt); d3 = ROTL(d3, amt); d4 = ROTL(d4, amt); - -#define QROUND(a1,a2,a3,a4, b1,b2,b3,b4, c1,c2,c3,c4, amt) \ - ADD4 (a1,a2,a3,a4, c1,c2,c3,c4) \ - XOR4 (b1,b2,b3,b4, a1,a2,a3,a4) \ - ROTL4(b1,b2,b3,b4, amt) - -static __device__ void xor_chacha8(uint4 *B, uint4 *C) -{ - uint32_t x[16]; - x[0]=(B[0].x ^= C[0].x); - x[1]=(B[0].y ^= C[0].y); - x[2]=(B[0].z ^= C[0].z); - x[3]=(B[0].w ^= C[0].w); - x[4]=(B[1].x ^= C[1].x); - x[5]=(B[1].y ^= C[1].y); - x[6]=(B[1].z ^= C[1].z); - x[7]=(B[1].w ^= C[1].w); - x[8]=(B[2].x ^= C[2].x); - x[9]=(B[2].y ^= C[2].y); - x[10]=(B[2].z ^= C[2].z); - x[11]=(B[2].w ^= C[2].w); - x[12]=(B[3].x ^= C[3].x); - x[13]=(B[3].y ^= C[3].y); - x[14]=(B[3].z ^= C[3].z); - x[15]=(B[3].w ^= C[3].w); - - /* Operate on columns. */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 16); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 8); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 7); - - /* Operate on diagonals */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 16); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 8); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 7); - - /* Operate on columns. */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 16); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 8); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 7); - - /* Operate on diagonals */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 16); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 8); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 7); - - /* Operate on columns. */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 16); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 8); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 7); - - /* Operate on diagonals */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 16); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 8); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 7); - - /* Operate on columns. */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 16); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 8); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 7); - - /* Operate on diagonals */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 16); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 8); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 7); - - B[0].x += x[0]; B[0].y += x[1]; B[0].z += x[2]; B[0].w += x[3]; B[1].x += x[4]; B[1].y += x[5]; B[1].z += x[6]; B[1].w += x[7]; - B[2].x += x[8]; B[2].y += x[9]; B[2].z += x[10]; B[2].w += x[11]; B[3].x += x[12]; B[3].y += x[13]; B[3].z += x[14]; B[3].w += x[15]; -} - -#endif - - -#define ROTL7(a0,a1,a2,a3,a00,a10,a20,a30){\ -a0^=ROTL(a00, 7); a1^=ROTL(a10, 7); a2^=ROTL(a20, 7); a3^=ROTL(a30, 7);\ -};\ - -#define ROTL9(a0,a1,a2,a3,a00,a10,a20,a30){\ -a0^=ROTL(a00, 9); a1^=ROTL(a10, 9); a2^=ROTL(a20, 9); a3^=ROTL(a30, 9);\ -};\ - -#define ROTL13(a0,a1,a2,a3,a00,a10,a20,a30){\ -a0^=ROTL(a00, 13); a1^=ROTL(a10, 13); a2^=ROTL(a20, 13); a3^=ROTL(a30, 13);\ -};\ - -#define ROTL18(a0,a1,a2,a3,a00,a10,a20,a30){\ -a0^=ROTL(a00, 18); a1^=ROTL(a10, 18); a2^=ROTL(a20, 18); a3^=ROTL(a30, 18);\ -};\ - -static __device__ void xor_salsa8(uint4 *B, uint4 *C) -{ - uint32_t x[16]; - x[0]=(B[0].x ^= C[0].x); - x[1]=(B[0].y ^= C[0].y); - x[2]=(B[0].z ^= C[0].z); - x[3]=(B[0].w ^= C[0].w); - x[4]=(B[1].x ^= C[1].x); - x[5]=(B[1].y ^= C[1].y); - x[6]=(B[1].z ^= C[1].z); - x[7]=(B[1].w ^= C[1].w); - x[8]=(B[2].x ^= C[2].x); - x[9]=(B[2].y ^= C[2].y); - x[10]=(B[2].z ^= C[2].z); - x[11]=(B[2].w ^= C[2].w); - x[12]=(B[3].x ^= C[3].x); - x[13]=(B[3].y ^= C[3].y); - x[14]=(B[3].z ^= C[3].z); - x[15]=(B[3].w ^= C[3].w); - - /* Operate on columns. */ - ROTL7(x[4],x[9],x[14],x[3],x[0]+x[12],x[1]+x[5],x[6]+x[10],x[11]+x[15]); - ROTL9(x[8],x[13],x[2],x[7],x[0]+x[4],x[5]+x[9],x[10]+x[14],x[3]+x[15]); - ROTL13(x[12],x[1],x[6],x[11],x[4]+x[8],x[9]+x[13],x[2]+x[14],x[3]+x[7]); - ROTL18(x[0],x[5],x[10],x[15],x[8]+x[12],x[1]+x[13],x[2]+x[6],x[7]+x[11]); - - /* Operate on rows. */ - ROTL7(x[1],x[6],x[11],x[12],x[0]+x[3],x[4]+x[5],x[9]+x[10],x[14]+x[15]); - ROTL9(x[2],x[7],x[8],x[13],x[0]+x[1],x[5]+x[6],x[10]+x[11],x[12]+x[15]); - ROTL13(x[3],x[4],x[9],x[14],x[1]+x[2],x[6]+x[7],x[8]+x[11],x[12]+x[13]); - ROTL18(x[0],x[5],x[10],x[15],x[2]+x[3],x[4]+x[7],x[8]+x[9],x[13]+x[14]); - - /* Operate on columns. */ - ROTL7(x[4],x[9],x[14],x[3],x[0]+x[12],x[1]+x[5],x[6]+x[10],x[11]+x[15]); - ROTL9(x[8],x[13],x[2],x[7],x[0]+x[4],x[5]+x[9],x[10]+x[14],x[3]+x[15]); - ROTL13(x[12],x[1],x[6],x[11],x[4]+x[8],x[9]+x[13],x[2]+x[14],x[3]+x[7]); - ROTL18(x[0],x[5],x[10],x[15],x[8]+x[12],x[1]+x[13],x[2]+x[6],x[7]+x[11]); - - /* Operate on rows. */ - ROTL7(x[1],x[6],x[11],x[12],x[0]+x[3],x[4]+x[5],x[9]+x[10],x[14]+x[15]); - ROTL9(x[2],x[7],x[8],x[13],x[0]+x[1],x[5]+x[6],x[10]+x[11],x[12]+x[15]); - ROTL13(x[3],x[4],x[9],x[14],x[1]+x[2],x[6]+x[7],x[8]+x[11],x[12]+x[13]); - ROTL18(x[0],x[5],x[10],x[15],x[2]+x[3],x[4]+x[7],x[8]+x[9],x[13]+x[14]); - - /* Operate on columns. */ - ROTL7(x[4],x[9],x[14],x[3],x[0]+x[12],x[1]+x[5],x[6]+x[10],x[11]+x[15]); - ROTL9(x[8],x[13],x[2],x[7],x[0]+x[4],x[5]+x[9],x[10]+x[14],x[3]+x[15]); - ROTL13(x[12],x[1],x[6],x[11],x[4]+x[8],x[9]+x[13],x[2]+x[14],x[3]+x[7]); - ROTL18(x[0],x[5],x[10],x[15],x[8]+x[12],x[1]+x[13],x[2]+x[6],x[7]+x[11]); - - /* Operate on rows. */ - ROTL7(x[1],x[6],x[11],x[12],x[0]+x[3],x[4]+x[5],x[9]+x[10],x[14]+x[15]); - ROTL9(x[2],x[7],x[8],x[13],x[0]+x[1],x[5]+x[6],x[10]+x[11],x[12]+x[15]); - ROTL13(x[3],x[4],x[9],x[14],x[1]+x[2],x[6]+x[7],x[8]+x[11],x[12]+x[13]); - ROTL18(x[0],x[5],x[10],x[15],x[2]+x[3],x[4]+x[7],x[8]+x[9],x[13]+x[14]); - - /* Operate on columns. */ - ROTL7(x[4],x[9],x[14],x[3],x[0]+x[12],x[1]+x[5],x[6]+x[10],x[11]+x[15]); - ROTL9(x[8],x[13],x[2],x[7],x[0]+x[4],x[5]+x[9],x[10]+x[14],x[3]+x[15]); - ROTL13(x[12],x[1],x[6],x[11],x[4]+x[8],x[9]+x[13],x[2]+x[14],x[3]+x[7]); - ROTL18(x[0],x[5],x[10],x[15],x[8]+x[12],x[1]+x[13],x[2]+x[6],x[7]+x[11]); - - /* Operate on rows. */ - ROTL7(x[1],x[6],x[11],x[12],x[0]+x[3],x[4]+x[5],x[9]+x[10],x[14]+x[15]); - ROTL9(x[2],x[7],x[8],x[13],x[0]+x[1],x[5]+x[6],x[10]+x[11],x[12]+x[15]); - ROTL13(x[3],x[4],x[9],x[14],x[1]+x[2],x[6]+x[7],x[8]+x[11],x[12]+x[13]); - ROTL18(x[0],x[5],x[10],x[15],x[2]+x[3],x[4]+x[7],x[8]+x[9],x[13]+x[14]); - - B[0].x += x[0]; B[0].y += x[1]; B[0].z += x[2]; B[0].w += x[3]; B[1].x += x[4]; B[1].y += x[5]; B[1].z += x[6]; B[1].w += x[7]; - B[2].x += x[8]; B[2].y += x[9]; B[2].z += x[10]; B[2].w += x[11]; B[3].x += x[12]; B[3].y += x[13]; B[3].z += x[14]; B[3].w += x[15]; -} - - -template static __device__ void block_mixer(uint4 *B, uint4 *C) -{ - switch (ALGO) { - case A_SCRYPT: xor_salsa8(B, C); break; - case A_SCRYPT_JANE: xor_chacha8(B, C); break; - } -} - -//////////////////////////////////////////////////////////////////////////////// -//! Experimental Scrypt core kernel for Kepler devices. -//! @param g_idata input data in global memory -//! @param g_odata output data in global memory -//////////////////////////////////////////////////////////////////////////////// -template __global__ -void nv_scrypt_core_kernelA(uint32_t *g_idata, int begin, int end) -{ - int offset = blockIdx.x * blockDim.x + threadIdx.x / warpSize * warpSize; - g_idata += 32 * offset; - uint32_t * V = c_V[offset / warpSize]; - uint4 B[4], C[4]; - int i = begin; - - if(i == 0) { - __transposed_read_BC<0>((uint4*)g_idata, B, C, 1, 0); - __transposed_write_BC(B, C, (uint4*)V, c_N); - ++i; - } else - __transposed_read_BC<0>((uint4*)(V + (i-1)*32), B, C, c_N, 0); - - while(i < end) { - block_mixer(B, C); block_mixer(C, B); - __transposed_write_BC(B, C, (uint4*)(V + i*32), c_N); - ++i; - } -} - -template __global__ -void nv_scrypt_core_kernelA_LG(uint32_t *g_idata, int begin, int end, unsigned int LOOKUP_GAP) -{ - int offset = blockIdx.x * blockDim.x + threadIdx.x / warpSize * warpSize; - g_idata += 32 * offset; - uint32_t * V = c_V[offset / warpSize]; - uint4 B[4], C[4]; - int i = begin; - - if(i == 0) { - __transposed_read_BC<0>((uint4*)g_idata, B, C, 1, 0); - __transposed_write_BC(B, C, (uint4*)V, c_spacing); - ++i; - } else { - int pos = (i-1)/LOOKUP_GAP, loop = (i-1)-pos*LOOKUP_GAP; - __transposed_read_BC<0>((uint4*)(V + pos*32), B, C, c_spacing, 0); - while(loop--) { block_mixer(B, C); block_mixer(C, B); } - } - - while(i < end) { - block_mixer(B, C); block_mixer(C, B); - if (i % LOOKUP_GAP == 0) - __transposed_write_BC(B, C, (uint4*)(V + (i/LOOKUP_GAP)*32), c_spacing); - ++i; - } -} - -template __global__ -void nv_scrypt_core_kernelB(uint32_t *g_odata, int begin, int end) -{ - int offset = blockIdx.x * blockDim.x + threadIdx.x / warpSize * warpSize; - g_odata += 32 * offset; - uint32_t * V = c_V[offset / warpSize]; - uint4 B[4], C[4]; - - if(begin == 0) { - __transposed_read_BC((uint4*)V, B, C, c_N, c_N_1); - block_mixer(B, C); block_mixer(C, B); - } else - __transposed_read_BC<0>((uint4*)g_odata, B, C, 1, 0); - - for (int i = begin; i < end; i++) { - int slot = C[0].x & c_N_1; - __transposed_xor_BC((uint4*)(V), B, C, c_N, slot); - block_mixer(B, C); block_mixer(C, B); - } - - __transposed_write_BC(B, C, (uint4*)(g_odata), 1); -} - -template __global__ -void nv_scrypt_core_kernelB_LG(uint32_t *g_odata, int begin, int end, unsigned int LOOKUP_GAP) -{ - int offset = blockIdx.x * blockDim.x + threadIdx.x / warpSize * warpSize; - g_odata += 32 * offset; - uint32_t * V = c_V[offset / warpSize]; - uint4 B[4], C[4]; - - if(begin == 0) { - int pos = c_N_1/LOOKUP_GAP, loop = 1 + (c_N_1-pos*LOOKUP_GAP); - __transposed_read_BC((uint4*)V, B, C, c_spacing, pos); - while(loop--) { block_mixer(B, C); block_mixer(C, B); } - } else { - __transposed_read_BC((uint4*)g_odata, B, C, 1, 0); - } - - for (int i = begin; i < end; i++) { - int slot = C[0].x & c_N_1; - int pos = slot/LOOKUP_GAP, loop = slot-pos*LOOKUP_GAP; - uint4 b[4], c[4]; __transposed_read_BC((uint4*)(V), b, c, c_spacing, pos); - while(loop--) { block_mixer(b, c); block_mixer(c, b); } -#pragma unroll 4 - for(int n = 0; n < 4; n++) { B[n] ^= b[n]; C[n] ^= c[n]; } - block_mixer(B, C); block_mixer(C, B); - } - - __transposed_write_BC(B, C, (uint4*)(g_odata), 1); -} diff --git a/scrypt/nv_kernel.h b/scrypt/nv_kernel.h deleted file mode 100644 index fa839cfb..00000000 --- a/scrypt/nv_kernel.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef NV_KERNEL_H -#define NV_KERNEL_H - -#include "salsa_kernel.h" - -class NVKernel : public KernelInterface -{ -public: - NVKernel(); - - virtual void set_scratchbuf_constants(int MAXWARPS, uint32_t** h_V); - virtual bool run_kernel(dim3 grid, dim3 threads, int WARPS_PER_BLOCK, int thr_id, cudaStream_t stream, uint32_t* d_idata, uint32_t* d_odata, unsigned int N, unsigned int LOOKUP_GAP, bool interactive, bool benchmark, int texture_cache); - - virtual bool bindtexture_1D(uint32_t *d_V, size_t size); - virtual bool bindtexture_2D(uint32_t *d_V, int width, int height, size_t pitch); - virtual bool unbindtexture_1D(); - virtual bool unbindtexture_2D(); - - virtual char get_identifier() { return 'K'; }; - virtual int get_major_version() { return 3; }; - virtual int get_minor_version() { return 0; }; - - virtual int max_warps_per_block() { return 32; }; - virtual int get_texel_width() { return 4; }; - virtual bool support_lookup_gap() { return true; } - virtual cudaSharedMemConfig shared_mem_config() { return cudaSharedMemBankSizeFourByte; } - virtual cudaFuncCache cache_config() { return cudaFuncCachePreferL1; } -}; - -#endif // #ifndef NV_KERNEL_H diff --git a/scrypt/nv_kernel2.cu b/scrypt/nv_kernel2.cu deleted file mode 100644 index 5f4e2c8c..00000000 --- a/scrypt/nv_kernel2.cu +++ /dev/null @@ -1,644 +0,0 @@ -// -// Experimental Kernel for Kepler (Compute 3.5) devices -// code submitted by nVidia performance engineer Alexey Panteleev -// with modifications by Christian Buchner -// -// for Compute 3.5 -// NOTE: compile this .cu module for compute_35,sm_35 with --maxrregcount=80 -// for Compute 3.0 -// NOTE: compile this .cu module for compute_30,sm_30 with --maxrregcount=63 -// - -#include - -#include -#include -#include "miner.h" - -#include "salsa_kernel.h" -#include "nv_kernel2.h" - -#define THREADS_PER_WU 1 // single thread per hash - -#if __CUDA_ARCH__ < 350 - // Kepler (Compute 3.0) - #define __ldg(x) (*(x)) -#endif - -#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 300 - -// grab lane ID -static __device__ __inline__ unsigned int __laneId() { unsigned int laneId; asm( "mov.u32 %0, %%laneid;" : "=r"( laneId ) ); return laneId; } - -// forward references -template __global__ void nv2_scrypt_core_kernelA(uint32_t *g_idata, int begin, int end); -template __global__ void nv2_scrypt_core_kernelB(uint32_t *g_odata, int begin, int end); -template __global__ void nv2_scrypt_core_kernelA_LG(uint32_t *g_idata, int begin, int end, unsigned int LOOKUP_GAP); -template __global__ void nv2_scrypt_core_kernelB_LG(uint32_t *g_odata, int begin, int end, unsigned int LOOKUP_GAP); - -// scratchbuf constants (pointers to scratch buffer for each work unit) -__constant__ uint32_t* c_V[TOTAL_WARP_LIMIT]; - -// iteration count N -__constant__ uint32_t c_N; -__constant__ uint32_t c_N_1; // N - 1 -__constant__ uint32_t c_spacing; // (N+LOOKUP_GAP-1)/LOOKUP_GAP - - -NV2Kernel::NV2Kernel() : KernelInterface() -{ -} - -void NV2Kernel::set_scratchbuf_constants(int MAXWARPS, uint32_t** h_V) -{ - checkCudaErrors(cudaMemcpyToSymbol(c_V, h_V, MAXWARPS*sizeof(uint32_t*), 0, cudaMemcpyHostToDevice)); -} - -bool NV2Kernel::run_kernel(dim3 grid, dim3 threads, int WARPS_PER_BLOCK, int thr_id, cudaStream_t stream, uint32_t* d_idata, uint32_t* d_odata, unsigned int N, unsigned int LOOKUP_GAP, bool interactive, bool benchmark, int texture_cache) -{ - bool success = true; - bool scrypt = IS_SCRYPT(); - bool chacha = IS_SCRYPT_JANE(); - - // make some constants available to kernel, update only initially and when changing - static uint32_t prev_N[MAX_GPUS] = { 0 }; - - if (N != prev_N[thr_id]) { - uint32_t h_N = N; - uint32_t h_N_1 = N-1; - uint32_t h_spacing = (N+LOOKUP_GAP-1)/LOOKUP_GAP; - - cudaMemcpyToSymbolAsync(c_N, &h_N, sizeof(uint32_t), 0, cudaMemcpyHostToDevice, stream); - cudaMemcpyToSymbolAsync(c_N_1, &h_N_1, sizeof(uint32_t), 0, cudaMemcpyHostToDevice, stream); - cudaMemcpyToSymbolAsync(c_spacing, &h_spacing, sizeof(uint32_t), 0, cudaMemcpyHostToDevice, stream); - - prev_N[thr_id] = N; - } - - // First phase: Sequential writes to scratchpad. - const int batch = device_batchsize[thr_id]; - unsigned int pos = 0; - - do - { - if (LOOKUP_GAP == 1) { - if (scrypt) nv2_scrypt_core_kernelA <<< grid, threads, 0, stream >>>(d_idata, pos, min(pos+batch, N)); - if (chacha) nv2_scrypt_core_kernelA<<< grid, threads, 0, stream >>>(d_idata, pos, min(pos+batch, N)); - } else { - if (scrypt) nv2_scrypt_core_kernelA_LG <<< grid, threads, 0, stream >>>(d_idata, pos, min(pos+batch, N), LOOKUP_GAP); - if (chacha) nv2_scrypt_core_kernelA_LG<<< grid, threads, 0, stream >>>(d_idata, pos, min(pos+batch, N), LOOKUP_GAP); - } - pos += batch; - } while (pos < N); - - // Second phase: Random read access from scratchpad. - pos = 0; - do - { - if (LOOKUP_GAP == 1) { - if (scrypt) nv2_scrypt_core_kernelB <<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N)); - if (chacha) nv2_scrypt_core_kernelB <<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N)); - } else { - if (scrypt) nv2_scrypt_core_kernelB_LG <<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N), LOOKUP_GAP); - if (chacha) nv2_scrypt_core_kernelB_LG <<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N), LOOKUP_GAP); - } - - pos += batch; - } while (pos < N); - - return success; -} - -static __device__ uint4& operator^=(uint4& left, const uint4& right) -{ - left.x ^= right.x; - left.y ^= right.y; - left.z ^= right.z; - left.w ^= right.w; - return left; -} - -__device__ __forceinline__ uint4 shfl4(const uint4 val, unsigned int lane, unsigned int width) -{ - return make_uint4( - (unsigned int)__shfl((int)val.x, lane, width), - (unsigned int)__shfl((int)val.y, lane, width), - (unsigned int)__shfl((int)val.z, lane, width), - (unsigned int)__shfl((int)val.w, lane, width) - ); -} - -__device__ __forceinline__ void __transposed_write_BC(uint4 (&B)[4], uint4 (&C)[4], uint4 *D, int spacing) -{ - unsigned int laneId = __laneId(); - - unsigned int lane8 = laneId%8; - unsigned int tile = laneId/8; - - uint4 T1[8], T2[8]; - - /* Source matrix, A-H are threads, 0-7 are data items, thread A is marked with `*`: - - *A0 B0 C0 D0 E0 F0 G0 H0 - *A1 B1 C1 D1 E1 F1 G1 H1 - *A2 B2 C2 D2 E2 F2 G2 H2 - *A3 B3 C3 D3 E3 F3 G3 H3 - *A4 B4 C4 D4 E4 F4 G4 H4 - *A5 B5 C5 D5 E5 F5 G5 H5 - *A6 B6 C6 D6 E6 F6 G6 H6 - *A7 B7 C7 D7 E7 F7 G7 H7 - */ - - // rotate rows - T1[0] = B[0]; - T1[1] = shfl4(B[1], lane8 + 7, 8); - T1[2] = shfl4(B[2], lane8 + 6, 8); - T1[3] = shfl4(B[3], lane8 + 5, 8); - T1[4] = shfl4(C[0], lane8 + 4, 8); - T1[5] = shfl4(C[1], lane8 + 3, 8); - T1[6] = shfl4(C[2], lane8 + 2, 8); - T1[7] = shfl4(C[3], lane8 + 1, 8); - - /* Matrix after row rotates: - - *A0 B0 C0 D0 E0 F0 G0 H0 - H1 *A1 B1 C1 D1 E1 F1 G1 - G2 H2 *A2 B2 C2 D2 E2 F2 - F3 G3 H3 *A3 B3 C3 D3 E3 - E4 F4 G4 H4 *A4 B4 C4 D4 - D5 E5 F5 G5 H5 *A5 B5 C5 - C6 D6 E6 F6 G6 H6 *A6 B6 - B7 C7 D7 E7 F7 G7 H7 *A7 - */ - - // rotate columns up using a barrel shifter simulation - // column X is rotated up by (X+1) items -#pragma unroll 8 - for(int n = 0; n < 8; n++) T2[n] = ((lane8+1) & 1) ? T1[(n+1) % 8] : T1[n]; -#pragma unroll 8 - for(int n = 0; n < 8; n++) T1[n] = ((lane8+1) & 2) ? T2[(n+2) % 8] : T2[n]; -#pragma unroll 8 - for(int n = 0; n < 8; n++) T2[n] = ((lane8+1) & 4) ? T1[(n+4) % 8] : T1[n]; - - /* Matrix after column rotates: - - H1 H2 H3 H4 H5 H6 H7 H0 - G2 G3 G4 G5 G6 G7 G0 G1 - F3 F4 F5 F6 F7 F0 F1 F2 - E4 E5 E6 E7 E0 E1 E2 E3 - D5 D6 D7 D0 D1 D2 D3 D4 - C6 C7 C0 C1 C2 C3 C4 C5 - B7 B0 B1 B2 B3 B4 B5 B6 - *A0 *A1 *A2 *A3 *A4 *A5 *A6 *A7 - */ - - // rotate rows again using address math and write to D, in reverse row order - D[spacing*2*(32*tile )+ lane8 ] = T2[7]; - D[spacing*2*(32*tile+4 )+(lane8+7)%8] = T2[6]; - D[spacing*2*(32*tile+8 )+(lane8+6)%8] = T2[5]; - D[spacing*2*(32*tile+12)+(lane8+5)%8] = T2[4]; - D[spacing*2*(32*tile+16)+(lane8+4)%8] = T2[3]; - D[spacing*2*(32*tile+20)+(lane8+3)%8] = T2[2]; - D[spacing*2*(32*tile+24)+(lane8+2)%8] = T2[1]; - D[spacing*2*(32*tile+28)+(lane8+1)%8] = T2[0]; -} - -__device__ __forceinline__ void __transposed_read_BC(const uint4 *S, uint4 (&B)[4], uint4 (&C)[4], int spacing, int row) -{ - unsigned int laneId = __laneId(); - - unsigned int lane8 = laneId%8; - unsigned int tile = laneId/8; - - // Perform the same transposition as in __transposed_write_BC, but in reverse order. - // See the illustrations in comments for __transposed_write_BC. - - // read and rotate rows, in reverse row order - uint4 T1[8], T2[8]; - T1[7] = __ldg(&S[(spacing*2*(32*tile ) + lane8 + 8*__shfl(row, 0, 8))]); - T1[6] = __ldg(&S[(spacing*2*(32*tile+4 ) + (lane8+7)%8 + 8*__shfl(row, 1, 8))]); - T1[5] = __ldg(&S[(spacing*2*(32*tile+8 ) + (lane8+6)%8 + 8*__shfl(row, 2, 8))]); - T1[4] = __ldg(&S[(spacing*2*(32*tile+12) + (lane8+5)%8 + 8*__shfl(row, 3, 8))]); - T1[3] = __ldg(&S[(spacing*2*(32*tile+16) + (lane8+4)%8 + 8*__shfl(row, 4, 8))]); - T1[2] = __ldg(&S[(spacing*2*(32*tile+20) + (lane8+3)%8 + 8*__shfl(row, 5, 8))]); - T1[1] = __ldg(&S[(spacing*2*(32*tile+24) + (lane8+2)%8 + 8*__shfl(row, 6, 8))]); - T1[0] = __ldg(&S[(spacing*2*(32*tile+28) + (lane8+1)%8 + 8*__shfl(row, 7, 8))]); - - // rotate columns down using a barrel shifter simulation - // column X is rotated down by (X+1) items, or up by (8-(X+1)) = (7-X) items -#pragma unroll 8 - for(int n = 0; n < 8; n++) T2[n] = ((7-lane8) & 1) ? T1[(n+1) % 8] : T1[n]; -#pragma unroll 8 - for(int n = 0; n < 8; n++) T1[n] = ((7-lane8) & 2) ? T2[(n+2) % 8] : T2[n]; -#pragma unroll 8 - for(int n = 0; n < 8; n++) T2[n] = ((7-lane8) & 4) ? T1[(n+4) % 8] : T1[n]; - - // rotate rows - B[0] = T2[0]; - B[1] = shfl4(T2[1], lane8 + 1, 8); - B[2] = shfl4(T2[2], lane8 + 2, 8); - B[3] = shfl4(T2[3], lane8 + 3, 8); - C[0] = shfl4(T2[4], lane8 + 4, 8); - C[1] = shfl4(T2[5], lane8 + 5, 8); - C[2] = shfl4(T2[6], lane8 + 6, 8); - C[3] = shfl4(T2[7], lane8 + 7, 8); - -} - -__device__ __forceinline__ void __transposed_xor_BC(const uint4 *S, uint4 (&B)[4], uint4 (&C)[4], int spacing, int row) -{ - uint4 BT[4], CT[4]; - __transposed_read_BC(S, BT, CT, spacing, row); - -#pragma unroll 4 - for(int n = 0; n < 4; n++) - { - B[n] ^= BT[n]; - C[n] ^= CT[n]; - } -} - -#if __CUDA_ARCH__ < 350 - // Kepler (Compute 3.0) - #define ROTL(a, b) ((a)<<(b))|((a)>>(32-(b))) -#else - // Kepler (Compute 3.5) - #define ROTL(a, b) __funnelshift_l( a, a, b ); -#endif - - - -#if 0 - -#define QUARTER(a,b,c,d) \ - a += b; d ^= a; d = ROTL(d,16); \ - c += d; b ^= c; b = ROTL(b,12); \ - a += b; d ^= a; d = ROTL(d,8); \ - c += d; b ^= c; b = ROTL(b,7); - -static __device__ void xor_chacha8(uint4 *B, uint4 *C) -{ - uint32_t x[16]; - x[0]=(B[0].x ^= C[0].x); - x[1]=(B[0].y ^= C[0].y); - x[2]=(B[0].z ^= C[0].z); - x[3]=(B[0].w ^= C[0].w); - x[4]=(B[1].x ^= C[1].x); - x[5]=(B[1].y ^= C[1].y); - x[6]=(B[1].z ^= C[1].z); - x[7]=(B[1].w ^= C[1].w); - x[8]=(B[2].x ^= C[2].x); - x[9]=(B[2].y ^= C[2].y); - x[10]=(B[2].z ^= C[2].z); - x[11]=(B[2].w ^= C[2].w); - x[12]=(B[3].x ^= C[3].x); - x[13]=(B[3].y ^= C[3].y); - x[14]=(B[3].z ^= C[3].z); - x[15]=(B[3].w ^= C[3].w); - - /* Operate on columns. */ - QUARTER( x[0], x[4], x[ 8], x[12] ) - QUARTER( x[1], x[5], x[ 9], x[13] ) - QUARTER( x[2], x[6], x[10], x[14] ) - QUARTER( x[3], x[7], x[11], x[15] ) - - /* Operate on diagonals */ - QUARTER( x[0], x[5], x[10], x[15] ) - QUARTER( x[1], x[6], x[11], x[12] ) - QUARTER( x[2], x[7], x[ 8], x[13] ) - QUARTER( x[3], x[4], x[ 9], x[14] ) - - /* Operate on columns. */ - QUARTER( x[0], x[4], x[ 8], x[12] ) - QUARTER( x[1], x[5], x[ 9], x[13] ) - QUARTER( x[2], x[6], x[10], x[14] ) - QUARTER( x[3], x[7], x[11], x[15] ) - - /* Operate on diagonals */ - QUARTER( x[0], x[5], x[10], x[15] ) - QUARTER( x[1], x[6], x[11], x[12] ) - QUARTER( x[2], x[7], x[ 8], x[13] ) - QUARTER( x[3], x[4], x[ 9], x[14] ) - - /* Operate on columns. */ - QUARTER( x[0], x[4], x[ 8], x[12] ) - QUARTER( x[1], x[5], x[ 9], x[13] ) - QUARTER( x[2], x[6], x[10], x[14] ) - QUARTER( x[3], x[7], x[11], x[15] ) - - /* Operate on diagonals */ - QUARTER( x[0], x[5], x[10], x[15] ) - QUARTER( x[1], x[6], x[11], x[12] ) - QUARTER( x[2], x[7], x[ 8], x[13] ) - QUARTER( x[3], x[4], x[ 9], x[14] ) - - /* Operate on columns. */ - QUARTER( x[0], x[4], x[ 8], x[12] ) - QUARTER( x[1], x[5], x[ 9], x[13] ) - QUARTER( x[2], x[6], x[10], x[14] ) - QUARTER( x[3], x[7], x[11], x[15] ) - - /* Operate on diagonals */ - QUARTER( x[0], x[5], x[10], x[15] ) - QUARTER( x[1], x[6], x[11], x[12] ) - QUARTER( x[2], x[7], x[ 8], x[13] ) - QUARTER( x[3], x[4], x[ 9], x[14] ) - - B[0].x += x[0]; B[0].y += x[1]; B[0].z += x[2]; B[0].w += x[3]; B[1].x += x[4]; B[1].y += x[5]; B[1].z += x[6]; B[1].w += x[7]; - B[2].x += x[8]; B[2].y += x[9]; B[2].z += x[10]; B[2].w += x[11]; B[3].x += x[12]; B[3].y += x[13]; B[3].z += x[14]; B[3].w += x[15]; -} - -#else - -#define ADD4(d1,d2,d3,d4,s1,s2,s3,s4) \ - d1 += s1; d2 += s2; d3 += s3; d4 += s4; - -#define XOR4(d1,d2,d3,d4,s1,s2,s3,s4) \ - d1 ^= s1; d2 ^= s2; d3 ^= s3; d4 ^= s4; - -#define ROTL4(d1,d2,d3,d4,amt) \ - d1 = ROTL(d1, amt); d2 = ROTL(d2, amt); d3 = ROTL(d3, amt); d4 = ROTL(d4, amt); - -#define QROUND(a1,a2,a3,a4, b1,b2,b3,b4, c1,c2,c3,c4, amt) \ - ADD4 (a1,a2,a3,a4, c1,c2,c3,c4) \ - XOR4 (b1,b2,b3,b4, a1,a2,a3,a4) \ - ROTL4(b1,b2,b3,b4, amt) - -static __device__ void xor_chacha8(uint4 *B, uint4 *C) -{ - uint32_t x[16]; - x[0]=(B[0].x ^= C[0].x); - x[1]=(B[0].y ^= C[0].y); - x[2]=(B[0].z ^= C[0].z); - x[3]=(B[0].w ^= C[0].w); - x[4]=(B[1].x ^= C[1].x); - x[5]=(B[1].y ^= C[1].y); - x[6]=(B[1].z ^= C[1].z); - x[7]=(B[1].w ^= C[1].w); - x[8]=(B[2].x ^= C[2].x); - x[9]=(B[2].y ^= C[2].y); - x[10]=(B[2].z ^= C[2].z); - x[11]=(B[2].w ^= C[2].w); - x[12]=(B[3].x ^= C[3].x); - x[13]=(B[3].y ^= C[3].y); - x[14]=(B[3].z ^= C[3].z); - x[15]=(B[3].w ^= C[3].w); - - /* Operate on columns. */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 16); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 8); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 7); - - /* Operate on diagonals */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 16); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 8); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 7); - - /* Operate on columns. */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 16); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 8); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 7); - - /* Operate on diagonals */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 16); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 8); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 7); - - /* Operate on columns. */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 16); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 8); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 7); - - /* Operate on diagonals */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 16); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 8); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 7); - - /* Operate on columns. */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 16); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[12],x[13],x[14],x[15], x[ 4],x[ 5],x[ 6],x[ 7], 8); - QROUND(x[ 8],x[ 9],x[10],x[11], x[ 4],x[ 5],x[ 6],x[ 7], x[12],x[13],x[14],x[15], 7); - - /* Operate on diagonals */ - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 16); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 12); - QROUND(x[ 0],x[ 1],x[ 2],x[ 3], x[15],x[12],x[13],x[14], x[ 5],x[ 6],x[ 7],x[ 4], 8); - QROUND(x[10],x[11],x[ 8],x[ 9], x[ 5],x[ 6],x[ 7],x[ 4], x[15],x[12],x[13],x[14], 7); - - B[0].x += x[0]; B[0].y += x[1]; B[0].z += x[2]; B[0].w += x[3]; B[1].x += x[4]; B[1].y += x[5]; B[1].z += x[6]; B[1].w += x[7]; - B[2].x += x[8]; B[2].y += x[9]; B[2].z += x[10]; B[2].w += x[11]; B[3].x += x[12]; B[3].y += x[13]; B[3].z += x[14]; B[3].w += x[15]; -} - -#endif - - -#define ROTL7(a0,a1,a2,a3,a00,a10,a20,a30){\ -a0^=ROTL(a00, 7); a1^=ROTL(a10, 7); a2^=ROTL(a20, 7); a3^=ROTL(a30, 7);\ -};\ - -#define ROTL9(a0,a1,a2,a3,a00,a10,a20,a30){\ -a0^=ROTL(a00, 9); a1^=ROTL(a10, 9); a2^=ROTL(a20, 9); a3^=ROTL(a30, 9);\ -};\ - -#define ROTL13(a0,a1,a2,a3,a00,a10,a20,a30){\ -a0^=ROTL(a00, 13); a1^=ROTL(a10, 13); a2^=ROTL(a20, 13); a3^=ROTL(a30, 13);\ -};\ - -#define ROTL18(a0,a1,a2,a3,a00,a10,a20,a30){\ -a0^=ROTL(a00, 18); a1^=ROTL(a10, 18); a2^=ROTL(a20, 18); a3^=ROTL(a30, 18);\ -};\ - -static __device__ void xor_salsa8(uint4 *B, uint4 *C) -{ - uint32_t x[16]; - x[0]=(B[0].x ^= C[0].x); - x[1]=(B[0].y ^= C[0].y); - x[2]=(B[0].z ^= C[0].z); - x[3]=(B[0].w ^= C[0].w); - x[4]=(B[1].x ^= C[1].x); - x[5]=(B[1].y ^= C[1].y); - x[6]=(B[1].z ^= C[1].z); - x[7]=(B[1].w ^= C[1].w); - x[8]=(B[2].x ^= C[2].x); - x[9]=(B[2].y ^= C[2].y); - x[10]=(B[2].z ^= C[2].z); - x[11]=(B[2].w ^= C[2].w); - x[12]=(B[3].x ^= C[3].x); - x[13]=(B[3].y ^= C[3].y); - x[14]=(B[3].z ^= C[3].z); - x[15]=(B[3].w ^= C[3].w); - - /* Operate on columns. */ - ROTL7(x[4],x[9],x[14],x[3],x[0]+x[12],x[1]+x[5],x[6]+x[10],x[11]+x[15]); - ROTL9(x[8],x[13],x[2],x[7],x[0]+x[4],x[5]+x[9],x[10]+x[14],x[3]+x[15]); - ROTL13(x[12],x[1],x[6],x[11],x[4]+x[8],x[9]+x[13],x[2]+x[14],x[3]+x[7]); - ROTL18(x[0],x[5],x[10],x[15],x[8]+x[12],x[1]+x[13],x[2]+x[6],x[7]+x[11]); - - /* Operate on rows. */ - ROTL7(x[1],x[6],x[11],x[12],x[0]+x[3],x[4]+x[5],x[9]+x[10],x[14]+x[15]); - ROTL9(x[2],x[7],x[8],x[13],x[0]+x[1],x[5]+x[6],x[10]+x[11],x[12]+x[15]); - ROTL13(x[3],x[4],x[9],x[14],x[1]+x[2],x[6]+x[7],x[8]+x[11],x[12]+x[13]); - ROTL18(x[0],x[5],x[10],x[15],x[2]+x[3],x[4]+x[7],x[8]+x[9],x[13]+x[14]); - - /* Operate on columns. */ - ROTL7(x[4],x[9],x[14],x[3],x[0]+x[12],x[1]+x[5],x[6]+x[10],x[11]+x[15]); - ROTL9(x[8],x[13],x[2],x[7],x[0]+x[4],x[5]+x[9],x[10]+x[14],x[3]+x[15]); - ROTL13(x[12],x[1],x[6],x[11],x[4]+x[8],x[9]+x[13],x[2]+x[14],x[3]+x[7]); - ROTL18(x[0],x[5],x[10],x[15],x[8]+x[12],x[1]+x[13],x[2]+x[6],x[7]+x[11]); - - /* Operate on rows. */ - ROTL7(x[1],x[6],x[11],x[12],x[0]+x[3],x[4]+x[5],x[9]+x[10],x[14]+x[15]); - ROTL9(x[2],x[7],x[8],x[13],x[0]+x[1],x[5]+x[6],x[10]+x[11],x[12]+x[15]); - ROTL13(x[3],x[4],x[9],x[14],x[1]+x[2],x[6]+x[7],x[8]+x[11],x[12]+x[13]); - ROTL18(x[0],x[5],x[10],x[15],x[2]+x[3],x[4]+x[7],x[8]+x[9],x[13]+x[14]); - - /* Operate on columns. */ - ROTL7(x[4],x[9],x[14],x[3],x[0]+x[12],x[1]+x[5],x[6]+x[10],x[11]+x[15]); - ROTL9(x[8],x[13],x[2],x[7],x[0]+x[4],x[5]+x[9],x[10]+x[14],x[3]+x[15]); - ROTL13(x[12],x[1],x[6],x[11],x[4]+x[8],x[9]+x[13],x[2]+x[14],x[3]+x[7]); - ROTL18(x[0],x[5],x[10],x[15],x[8]+x[12],x[1]+x[13],x[2]+x[6],x[7]+x[11]); - - /* Operate on rows. */ - ROTL7(x[1],x[6],x[11],x[12],x[0]+x[3],x[4]+x[5],x[9]+x[10],x[14]+x[15]); - ROTL9(x[2],x[7],x[8],x[13],x[0]+x[1],x[5]+x[6],x[10]+x[11],x[12]+x[15]); - ROTL13(x[3],x[4],x[9],x[14],x[1]+x[2],x[6]+x[7],x[8]+x[11],x[12]+x[13]); - ROTL18(x[0],x[5],x[10],x[15],x[2]+x[3],x[4]+x[7],x[8]+x[9],x[13]+x[14]); - - /* Operate on columns. */ - ROTL7(x[4],x[9],x[14],x[3],x[0]+x[12],x[1]+x[5],x[6]+x[10],x[11]+x[15]); - ROTL9(x[8],x[13],x[2],x[7],x[0]+x[4],x[5]+x[9],x[10]+x[14],x[3]+x[15]); - ROTL13(x[12],x[1],x[6],x[11],x[4]+x[8],x[9]+x[13],x[2]+x[14],x[3]+x[7]); - ROTL18(x[0],x[5],x[10],x[15],x[8]+x[12],x[1]+x[13],x[2]+x[6],x[7]+x[11]); - - /* Operate on rows. */ - ROTL7(x[1],x[6],x[11],x[12],x[0]+x[3],x[4]+x[5],x[9]+x[10],x[14]+x[15]); - ROTL9(x[2],x[7],x[8],x[13],x[0]+x[1],x[5]+x[6],x[10]+x[11],x[12]+x[15]); - ROTL13(x[3],x[4],x[9],x[14],x[1]+x[2],x[6]+x[7],x[8]+x[11],x[12]+x[13]); - ROTL18(x[0],x[5],x[10],x[15],x[2]+x[3],x[4]+x[7],x[8]+x[9],x[13]+x[14]); - - B[0].x += x[0]; B[0].y += x[1]; B[0].z += x[2]; B[0].w += x[3]; B[1].x += x[4]; B[1].y += x[5]; B[1].z += x[6]; B[1].w += x[7]; - B[2].x += x[8]; B[2].y += x[9]; B[2].z += x[10]; B[2].w += x[11]; B[3].x += x[12]; B[3].y += x[13]; B[3].z += x[14]; B[3].w += x[15]; -} - - -template static __device__ void block_mixer(uint4 *B, uint4 *C) -{ - switch (ALGO) - { - case A_SCRYPT: xor_salsa8(B, C); break; - case A_SCRYPT_JANE: xor_chacha8(B, C); break; - } -} - -//////////////////////////////////////////////////////////////////////////////// -//! Experimental Scrypt core kernel for Titan devices. -//! @param g_idata input data in global memory -//! @param g_odata output data in global memory -//////////////////////////////////////////////////////////////////////////////// -template __global__ void nv2_scrypt_core_kernelA(uint32_t *g_idata, int begin, int end) -{ - int offset = blockIdx.x * blockDim.x + threadIdx.x / warpSize * warpSize; - g_idata += 32 * offset; - uint32_t * V = c_V[offset / warpSize]; - uint4 B[4], C[4]; - int i = begin; - - if(i == 0) { - __transposed_read_BC((uint4*)g_idata, B, C, 1, 0); - __transposed_write_BC(B, C, (uint4*)V, c_N); - ++i; - } else - __transposed_read_BC((uint4*)(V + (i-1)*32), B, C, c_N, 0); - - while(i < end) { - block_mixer(B, C); block_mixer(C, B); - __transposed_write_BC(B, C, (uint4*)(V + i*32), c_N); - ++i; - } -} - -template __global__ void nv2_scrypt_core_kernelA_LG(uint32_t *g_idata, int begin, int end, unsigned int LOOKUP_GAP) -{ - int offset = blockIdx.x * blockDim.x + threadIdx.x / warpSize * warpSize; - g_idata += 32 * offset; - uint32_t * V = c_V[offset / warpSize]; - uint4 B[4], C[4]; - int i = begin; - - if(i == 0) { - __transposed_read_BC((uint4*)g_idata, B, C, 1, 0); - __transposed_write_BC(B, C, (uint4*)V, c_spacing); - ++i; - } else { - int pos = (i-1)/LOOKUP_GAP, loop = (i-1)-pos*LOOKUP_GAP; - __transposed_read_BC((uint4*)(V + pos*32), B, C, c_spacing, 0); - while(loop--) { block_mixer(B, C); block_mixer(C, B); } - } - - while(i < end) { - block_mixer(B, C); block_mixer(C, B); - if (i % LOOKUP_GAP == 0) - __transposed_write_BC(B, C, (uint4*)(V + (i/LOOKUP_GAP)*32), c_spacing); - ++i; - } -} - -template __global__ void nv2_scrypt_core_kernelB(uint32_t *g_odata, int begin, int end) -{ - int offset = blockIdx.x * blockDim.x + threadIdx.x / warpSize * warpSize; - g_odata += 32 * offset; - uint32_t * V = c_V[offset / warpSize]; - uint4 B[4], C[4]; - - if(begin == 0) { - __transposed_read_BC((uint4*)V, B, C, c_N, c_N_1); - block_mixer(B, C); block_mixer(C, B); - } else - __transposed_read_BC((uint4*)g_odata, B, C, 1, 0); - - for (int i = begin; i < end; i++) { - int slot = C[0].x & c_N_1; - __transposed_xor_BC((uint4*)(V), B, C, c_N, slot); - block_mixer(B, C); block_mixer(C, B); - } - - __transposed_write_BC(B, C, (uint4*)(g_odata), 1); -} - -template __global__ void nv2_scrypt_core_kernelB_LG(uint32_t *g_odata, int begin, int end, unsigned int LOOKUP_GAP) -{ - int offset = blockIdx.x * blockDim.x + threadIdx.x / warpSize * warpSize; - g_odata += 32 * offset; - uint32_t * V = c_V[offset / warpSize]; - uint4 B[4], C[4]; - - if(begin == 0) { - int pos = c_N_1/LOOKUP_GAP, loop = 1 + (c_N_1-pos*LOOKUP_GAP); - __transposed_read_BC((uint4*)V, B, C, c_spacing, pos); - while(loop--) { block_mixer(B, C); block_mixer(C, B); } - } else { - __transposed_read_BC((uint4*)g_odata, B, C, 1, 0); - } - - for (int i = begin; i < end; i++) { - int slot = C[0].x & c_N_1; - int pos = slot/LOOKUP_GAP, loop = slot-pos*LOOKUP_GAP; - uint4 b[4], c[4]; __transposed_read_BC((uint4*)(V), b, c, c_spacing, pos); - while(loop--) { block_mixer(b, c); block_mixer(c, b); } -#pragma unroll 4 - for(int n = 0; n < 4; n++) { B[n] ^= b[n]; C[n] ^= c[n]; } - block_mixer(B, C); block_mixer(C, B); - } - - __transposed_write_BC(B, C, (uint4*)(g_odata), 1); -} - -#endif /* prevent SM 2 */ - diff --git a/scrypt/nv_kernel2.h b/scrypt/nv_kernel2.h deleted file mode 100644 index 79e1b1c8..00000000 --- a/scrypt/nv_kernel2.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef NV2_KERNEL_H -#define NV2_KERNEL_H - -#include "miner.h" -#include - -#include "salsa_kernel.h" - -class NV2Kernel : public KernelInterface -{ -public: - NV2Kernel(); - - virtual void set_scratchbuf_constants(int MAXWARPS, uint32_t** h_V); - virtual bool run_kernel(dim3 grid, dim3 threads, int WARPS_PER_BLOCK, int thr_id, cudaStream_t stream, uint32_t* d_idata, uint32_t* d_odata, unsigned int N, unsigned int LOOKUP_GAP, bool interactive, bool benchmark, int texture_cache); - - virtual char get_identifier() { return 'T'; }; - virtual int get_major_version() { return 3; }; - virtual int get_minor_version() { return 5; }; - - virtual int max_warps_per_block() { return 24; }; - virtual int get_texel_width() { return 4; }; - virtual bool no_textures() { return true; } - virtual bool support_lookup_gap() { return true; } - - virtual cudaSharedMemConfig shared_mem_config() { return cudaSharedMemBankSizeFourByte; } - virtual cudaFuncCache cache_config() { return cudaFuncCachePreferL1; } -}; - -#endif // #ifndef NV2_KERNEL_H diff --git a/scrypt/salsa_kernel.cu b/scrypt/salsa_kernel.cu deleted file mode 100644 index 9fb3c444..00000000 --- a/scrypt/salsa_kernel.cu +++ /dev/null @@ -1,868 +0,0 @@ -// -// Contains the autotuning logic and some utility functions. -// Note that all CUDA kernels have been moved to other .cu files -// - -#include -#include -#include -#include // usleep -#include // tolower -#include "cuda_helper.h" - -#include "salsa_kernel.h" - -#include "nv_kernel2.h" -#include "titan_kernel.h" -#include "nv_kernel.h" -#include "kepler_kernel.h" -#include "fermi_kernel.h" -#include "test_kernel.h" - -#include "miner.h" - -#if defined(_WIN64) || defined(__x86_64__) || defined(__64BIT__) -#define MAXMEM 0x300000000ULL // 12 GB (the largest Kepler) -#else -#define MAXMEM 0xFFFFFFFFULL // nearly 4 GB (32 bit limitations) -#endif - -// require CUDA 5.5 driver API -#define DMAJ 5 -#define DMIN 5 - -// define some error checking macros -#define DELIMITER '/' -#define __FILENAME__ ( strrchr(__FILE__, DELIMITER) != NULL ? strrchr(__FILE__, DELIMITER)+1 : __FILE__ ) - -#undef checkCudaErrors -#define checkCudaErrors(x) \ -{ \ - cudaGetLastError(); \ - x; \ - cudaError_t err = cudaGetLastError(); \ - if (err != cudaSuccess && !abort_flag) \ - applog(LOG_ERR, "GPU #%d: Err %d: %s (%s:%d)", device_map[thr_id], err, cudaGetErrorString(err), __FILENAME__, __LINE__); \ -} - -// some globals containing pointers to device memory (for chunked allocation) -// [MAX_GPUS] indexes up to MAX_GPUS threads (0...MAX_GPUS-1) -int MAXWARPS[MAX_GPUS]; -uint32_t* h_V[MAX_GPUS][TOTAL_WARP_LIMIT*64]; // NOTE: the *64 prevents buffer overflow for --keccak -uint32_t h_V_extra[MAX_GPUS][TOTAL_WARP_LIMIT*64]; // with really large kernel launch configurations - -KernelInterface *Best_Kernel_Heuristics(cudaDeviceProp *props) -{ - KernelInterface *kernel = NULL; - uint64_t N = 1UL << (opt_nfactor+1); - - if (IS_SCRYPT() || (IS_SCRYPT_JANE() && N <= 8192)) - { - // high register count kernels (scrypt, low N-factor scrypt-jane) - if (props->major > 3 || (props->major == 3 && props->minor >= 5)) - kernel = new NV2Kernel(); // we don't want this for Keccak though - else if (props->major == 3 && props->minor == 0) - kernel = new NVKernel(); - else - kernel = new FermiKernel(); - } - else - { - // high N-factor scrypt-jane = low registers count kernels - if (props->major > 3 || (props->major == 3 && props->minor >= 5)) - kernel = new TitanKernel(); - else if (props->major == 3 && props->minor == 0) - kernel = new KeplerKernel(); - else - kernel = new TestKernel(); - } - return kernel; -} - - -bool validate_config(char *config, int &b, int &w, KernelInterface **kernel = NULL, cudaDeviceProp *props = NULL) -{ - bool success = false; - char kernelid = ' '; - if (config != NULL) - { - if (config[0] == 'T' || config[0] == 'K' || config[0] == 'F' || config[0] == 'L' || - config[0] == 't' || config[0] == 'k' || config[0] == 'f' || - config[0] == 'Z' || config[0] == 'Y' || config[0] == 'X') { - kernelid = config[0]; - config++; - } - - if (config[0] >= '0' && config[0] <= '9') - if (sscanf(config, "%dx%d", &b, &w) == 2) - success = true; - - if (success && kernel != NULL) - { - switch (kernelid) - { - case 'T': case 'Z': *kernel = new NV2Kernel(); break; - case 't': *kernel = new TitanKernel(); break; - case 'K': case 'Y': *kernel = new NVKernel(); break; - case 'k': *kernel = new KeplerKernel(); break; - case 'F': case 'L': *kernel = new FermiKernel(); break; - case 'f': case 'X': *kernel = new TestKernel(); break; - case ' ': // choose based on device architecture - *kernel = Best_Kernel_Heuristics(props); - break; - } - } - } - return success; -} - -std::map context_blocks; -std::map context_wpb; -std::map context_concurrent; -std::map context_kernel; -std::map context_idata[2]; -std::map context_odata[2]; -std::map context_streams[2]; -std::map context_X[2]; -std::map context_H[2]; -std::map context_serialize[2]; - -// for SHA256 hashing on GPU -std::map context_tstate[2]; -std::map context_ostate[2]; -std::map context_hash[2]; - -int find_optimal_blockcount(int thr_id, KernelInterface* &kernel, bool &concurrent, int &wpb); - -int cuda_throughput(int thr_id) -{ - int GRID_BLOCKS, WARPS_PER_BLOCK; - if (context_blocks.find(thr_id) == context_blocks.end()) - { -#if 0 - CUcontext ctx; - cuCtxCreate( &ctx, CU_CTX_SCHED_YIELD, device_map[thr_id] ); - cuCtxSetCurrent(ctx); -#else - checkCudaErrors(cudaSetDevice(device_map[thr_id])); - checkCudaErrors(cudaSetDeviceFlags(cudaDeviceScheduleYield)); -#endif - - KernelInterface *kernel; - bool concurrent; - GRID_BLOCKS = find_optimal_blockcount(thr_id, kernel, concurrent, WARPS_PER_BLOCK); - - if(GRID_BLOCKS == 0) - return 0; - - unsigned int THREADS_PER_WU = kernel->threads_per_wu(); - unsigned int mem_size = WU_PER_LAUNCH * sizeof(uint32_t) * 32; - unsigned int state_size = WU_PER_LAUNCH * sizeof(uint32_t) * 8; - - // allocate device memory for scrypt_core inputs and outputs - uint32_t *tmp; - checkCudaErrors(cudaMalloc((void **) &tmp, mem_size)); context_idata[0][thr_id] = tmp; - checkCudaErrors(cudaMalloc((void **) &tmp, mem_size)); context_idata[1][thr_id] = tmp; - checkCudaErrors(cudaMalloc((void **) &tmp, mem_size)); context_odata[0][thr_id] = tmp; - checkCudaErrors(cudaMalloc((void **) &tmp, mem_size)); context_odata[1][thr_id] = tmp; - - // allocate pinned host memory for scrypt hashes - checkCudaErrors(cudaHostAlloc((void **) &tmp, state_size, cudaHostAllocDefault)); context_H[0][thr_id] = tmp; - checkCudaErrors(cudaHostAlloc((void **) &tmp, state_size, cudaHostAllocDefault)); context_H[1][thr_id] = tmp; - - if (IS_SCRYPT()) - { - if (parallel < 2) - { - // allocate pinned host memory for scrypt_core input/output - checkCudaErrors(cudaHostAlloc((void **) &tmp, mem_size, cudaHostAllocDefault)); context_X[0][thr_id] = tmp; - checkCudaErrors(cudaHostAlloc((void **) &tmp, mem_size, cudaHostAllocDefault)); context_X[1][thr_id] = tmp; - } - else - { - // allocate tstate, ostate, scrypt hash device memory - checkCudaErrors(cudaMalloc((void **) &tmp, state_size)); context_tstate[0][thr_id] = tmp; - checkCudaErrors(cudaMalloc((void **) &tmp, state_size)); context_tstate[1][thr_id] = tmp; - checkCudaErrors(cudaMalloc((void **) &tmp, state_size)); context_ostate[0][thr_id] = tmp; - checkCudaErrors(cudaMalloc((void **) &tmp, state_size)); context_ostate[1][thr_id] = tmp; - checkCudaErrors(cudaMalloc((void **) &tmp, state_size)); context_hash[0][thr_id] = tmp; - checkCudaErrors(cudaMalloc((void **) &tmp, state_size)); context_hash[1][thr_id] = tmp; - } - } - else /* if (IS_SCRYPT_JANE()) */ - { - // allocate pinned host memory for scrypt_core input/output - checkCudaErrors(cudaHostAlloc((void **) &tmp, mem_size, cudaHostAllocDefault)); context_X[0][thr_id] = tmp; - checkCudaErrors(cudaHostAlloc((void **) &tmp, mem_size, cudaHostAllocDefault)); context_X[1][thr_id] = tmp; - - checkCudaErrors(cudaMalloc((void **) &tmp, state_size)); context_hash[0][thr_id] = tmp; - checkCudaErrors(cudaMalloc((void **) &tmp, state_size)); context_hash[1][thr_id] = tmp; - } - - // create two CUDA streams - cudaStream_t tmp2; - checkCudaErrors( cudaStreamCreate(&tmp2) ); context_streams[0][thr_id] = tmp2; - checkCudaErrors( cudaStreamCreate(&tmp2) ); context_streams[1][thr_id] = tmp2; - - // events used to serialize the kernel launches (we don't want any overlapping of kernels) - cudaEvent_t tmp4; - checkCudaErrors(cudaEventCreateWithFlags(&tmp4, cudaEventDisableTiming)); context_serialize[0][thr_id] = tmp4; - checkCudaErrors(cudaEventCreateWithFlags(&tmp4, cudaEventDisableTiming)); context_serialize[1][thr_id] = tmp4; - checkCudaErrors(cudaEventRecord(context_serialize[1][thr_id])); - - context_kernel[thr_id] = kernel; - context_concurrent[thr_id] = concurrent; - context_blocks[thr_id] = GRID_BLOCKS; - context_wpb[thr_id] = WARPS_PER_BLOCK; - } - - GRID_BLOCKS = context_blocks[thr_id]; - WARPS_PER_BLOCK = context_wpb[thr_id]; - unsigned int THREADS_PER_WU = context_kernel[thr_id]->threads_per_wu(); - return WU_PER_LAUNCH; -} - -// Beginning of GPU Architecture definitions -inline int _ConvertSMVer2Cores(int major, int minor) -{ - // Defines for GPU Architecture types (using the SM version to determine the # of cores per SM - typedef struct { - int SM; // 0xMm (hexidecimal notation), M = SM Major version, and m = SM minor version - int Cores; - } sSMtoCores; - - sSMtoCores nGpuArchCoresPerSM[] = { - { 0x10, 8 }, // Tesla Generation (SM 1.0) G80 class - { 0x11, 8 }, // Tesla Generation (SM 1.1) G8x class - { 0x12, 8 }, // Tesla Generation (SM 1.2) G9x class - { 0x13, 8 }, // Tesla Generation (SM 1.3) GT200 class - { 0x20, 32 }, // Fermi Generation (SM 2.0) GF100 class - { 0x21, 48 }, // Fermi Generation (SM 2.1) GF10x class - { 0x30, 192 }, // Kepler Generation (SM 3.0) GK10x class - GK104 = 1536 cores / 8 SMs - { 0x35, 192 }, // Kepler Generation (SM 3.5) GK11x class - { 0x50, 128 }, // Maxwell Generation (SM 5.0) GTX750/750Ti - { 0x52, 128 }, // Maxwell Second Generation (SM 5.2) GTX980 = 2048 cores / 16 SMs - GTX970 1664 cores / 13 SMs - { -1, -1 }, - }; - - int index = 0; - while (nGpuArchCoresPerSM[index].SM != -1) - { - if (nGpuArchCoresPerSM[index].SM == ((major << 4) + minor)) { - return nGpuArchCoresPerSM[index].Cores; - } - index++; - } - - // If we don't find the values, we default use the previous one to run properly - applog(LOG_WARNING, "MapSMtoCores for SM %d.%d is undefined. Default to use %d Cores/SM", major, minor, 128); - return 128; -} - -#ifdef WIN32 -#include -static int console_width() { - CONSOLE_SCREEN_BUFFER_INFO csbi; - GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi); - return csbi.srWindow.Right - csbi.srWindow.Left + 1; -} -#else -static inline int console_width() { - return 999; -} -#endif - -int find_optimal_blockcount(int thr_id, KernelInterface* &kernel, bool &concurrent, int &WARPS_PER_BLOCK) -{ - int cw = console_width(); - int optimal_blocks = 0; - - cudaDeviceProp props; - checkCudaErrors(cudaGetDeviceProperties(&props, device_map[thr_id])); - concurrent = (props.concurrentKernels > 0); - - WARPS_PER_BLOCK = -1; - - // if not specified, use interactive mode for devices that have the watchdog timer enabled - if (device_interactive[thr_id] == -1) - device_interactive[thr_id] = props.kernelExecTimeoutEnabled; - - // turn off texture cache if not otherwise specified - if (device_texturecache[thr_id] == -1) - device_texturecache[thr_id] = 0; - - // if not otherwise specified or required, turn single memory allocations off as they reduce - // the amount of memory that we can allocate on Windows Vista, 7 and 8 (WDDM driver model issue) - if (device_singlememory[thr_id] == -1) device_singlememory[thr_id] = 0; - - // figure out which kernel implementation to use - if (!validate_config(device_config[thr_id], optimal_blocks, WARPS_PER_BLOCK, &kernel, &props)) { - kernel = NULL; - if (device_config[thr_id] != NULL) { - if (device_config[thr_id][0] == 'T' || device_config[thr_id][0] == 'Z') - kernel = new NV2Kernel(); - else if (device_config[thr_id][0] == 't') - kernel = new TitanKernel(); - else if (device_config[thr_id][0] == 'K' || device_config[thr_id][0] == 'Y') - kernel = new NVKernel(); - else if (device_config[thr_id][0] == 'k') - kernel = new KeplerKernel(); - else if (device_config[thr_id][0] == 'F' || device_config[thr_id][0] == 'L') - kernel = new FermiKernel(); - else if (device_config[thr_id][0] == 'f' || device_config[thr_id][0] == 'X') - kernel = new TestKernel(); - } - if (kernel == NULL) kernel = Best_Kernel_Heuristics(&props); - } - - if (kernel->get_major_version() > props.major || kernel->get_major_version() == props.major && kernel->get_minor_version() > props.minor) - { - applog(LOG_ERR, "GPU #%d: FATAL: the '%c' kernel requires %d.%d capability!", device_map[thr_id], kernel->get_identifier(), kernel->get_major_version(), kernel->get_minor_version()); - return 0; - } - - // set whatever cache configuration and shared memory bank mode the kernel prefers - checkCudaErrors(cudaDeviceSetCacheConfig(kernel->cache_config())); - checkCudaErrors(cudaDeviceSetSharedMemConfig(kernel->shared_mem_config())); - - // some kernels (e.g. Titan) do not support the texture cache - if (kernel->no_textures() && device_texturecache[thr_id]) { - applog(LOG_WARNING, "GPU #%d: the '%c' kernel ignores the texture cache argument", device_map[thr_id], kernel->get_identifier()); - device_texturecache[thr_id] = 0; - } - - // Texture caching only works with single memory allocation - if (device_texturecache[thr_id]) device_singlememory[thr_id] = 1; - - if (kernel->single_memory() && !device_singlememory[thr_id]) { - applog(LOG_WARNING, "GPU #%d: the '%c' kernel requires single memory allocation", device_map[thr_id], kernel->get_identifier()); - device_singlememory[thr_id] = 1; - } - - if (device_lookup_gap[thr_id] == 0) device_lookup_gap[thr_id] = 1; - if (!kernel->support_lookup_gap() && device_lookup_gap[thr_id] > 1) - { - applog(LOG_WARNING, "GPU #%d: the '%c' kernel does not support a lookup gap", device_map[thr_id], kernel->get_identifier()); - device_lookup_gap[thr_id] = 1; - } - - if (opt_debug) { - applog(LOG_INFO, "GPU #%d: interactive: %d, tex-cache: %d%s, single-alloc: %d", device_map[thr_id], - (device_interactive[thr_id] != 0) ? 1 : 0, - (device_texturecache[thr_id] != 0) ? device_texturecache[thr_id] : 0, (device_texturecache[thr_id] != 0) ? "D" : "", - (device_singlememory[thr_id] != 0) ? 1 : 0 ); - } - - // number of threads collaborating on one work unit (hash) - unsigned int THREADS_PER_WU = kernel->threads_per_wu(); - unsigned int LOOKUP_GAP = device_lookup_gap[thr_id]; - unsigned int BACKOFF = device_backoff[thr_id]; - unsigned int N = (1 << (opt_nfactor+1)); - double szPerWarp = (double)(SCRATCH * WU_PER_WARP * sizeof(uint32_t)); - //applog(LOG_INFO, "WU_PER_WARP=%u, THREADS_PER_WU=%u, LOOKUP_GAP=%u, BACKOFF=%u, SCRATCH=%u", WU_PER_WARP, THREADS_PER_WU, LOOKUP_GAP, BACKOFF, SCRATCH); - applog(LOG_INFO, "GPU #%d: %d hashes / %.1f MB per warp.", device_map[thr_id], WU_PER_WARP, szPerWarp / (1024.0 * 1024.0)); - - // compute highest MAXWARPS numbers for kernels allowing cudaBindTexture to succeed - int MW_1D_4 = 134217728 / (SCRATCH * WU_PER_WARP / 4); // for uint4_t textures - int MW_1D_2 = 134217728 / (SCRATCH * WU_PER_WARP / 2); // for uint2_t textures - int MW_1D = kernel->get_texel_width() == 2 ? MW_1D_2 : MW_1D_4; - - uint32_t *d_V = NULL; - if (device_singlememory[thr_id]) - { - // if no launch config was specified, we simply - // allocate the single largest memory chunk on the device that we can get - if (validate_config(device_config[thr_id], optimal_blocks, WARPS_PER_BLOCK)) { - MAXWARPS[thr_id] = optimal_blocks * WARPS_PER_BLOCK; - } - else { - // compute no. of warps to allocate the largest number producing a single memory block - // PROBLEM: one some devices, ALL allocations will fail if the first one failed. This sucks. - size_t MEM_LIMIT = (size_t)min((unsigned long long)MAXMEM, (unsigned long long)props.totalGlobalMem); - int warpmax = (int)min((unsigned long long)TOTAL_WARP_LIMIT, (unsigned long long)(MEM_LIMIT / szPerWarp)); - - // run a bisection algorithm for memory allocation (way more reliable than the previous approach) - int best = 0; - int warp = (warpmax+1)/2; - int interval = (warpmax+1)/2; - while (interval > 0) - { - cudaGetLastError(); // clear the error state - cudaMalloc((void **)&d_V, (size_t)(szPerWarp * warp)); - if (cudaGetLastError() == cudaSuccess) { - checkCudaErrors(cudaFree(d_V)); d_V = NULL; - if (warp > best) best = warp; - if (warp == warpmax) break; - interval = (interval+1)/2; - warp += interval; - if (warp > warpmax) warp = warpmax; - } - else - { - interval = interval/2; - warp -= interval; - if (warp < 1) warp = 1; - } - } - // back off a bit from the largest possible allocation size - MAXWARPS[thr_id] = ((100-BACKOFF)*best+50)/100; - } - - // now allocate a buffer for determined MAXWARPS setting - cudaGetLastError(); // clear the error state - cudaMalloc((void **)&d_V, (size_t)SCRATCH * WU_PER_WARP * MAXWARPS[thr_id] * sizeof(uint32_t)); - if (cudaGetLastError() == cudaSuccess) { - for (int i=0; i < MAXWARPS[thr_id]; ++i) - h_V[thr_id][i] = d_V + SCRATCH * WU_PER_WARP * i; - - if (device_texturecache[thr_id] == 1) - { - if (validate_config(device_config[thr_id], optimal_blocks, WARPS_PER_BLOCK)) - { - if ( optimal_blocks * WARPS_PER_BLOCK > MW_1D ) { - applog(LOG_ERR, "GPU #%d: '%s' exceeds limits for 1D cache. Using 2D cache instead.", device_map[thr_id], device_config[thr_id]); - device_texturecache[thr_id] = 2; - } - } - // bind linear memory to a 1D texture reference - if (kernel->get_texel_width() == 2) - kernel->bindtexture_1D(d_V, SCRATCH * WU_PER_WARP * min(MAXWARPS[thr_id],MW_1D_2) * sizeof(uint32_t)); - else - kernel->bindtexture_1D(d_V, SCRATCH * WU_PER_WARP * min(MAXWARPS[thr_id],MW_1D_4) * sizeof(uint32_t)); - } - else if (device_texturecache[thr_id] == 2) - { - // bind pitch linear memory to a 2D texture reference - if (kernel->get_texel_width() == 2) - kernel->bindtexture_2D(d_V, SCRATCH/2, WU_PER_WARP * MAXWARPS[thr_id], SCRATCH*sizeof(uint32_t)); - else - kernel->bindtexture_2D(d_V, SCRATCH/4, WU_PER_WARP * MAXWARPS[thr_id], SCRATCH*sizeof(uint32_t)); - } - } - else - { - applog(LOG_ERR, "GPU #%d: FATAL: Launch config '%s' requires too much memory!", device_map[thr_id], device_config[thr_id]); - return 0; - } - } - else - { - if (validate_config(device_config[thr_id], optimal_blocks, WARPS_PER_BLOCK)) - MAXWARPS[thr_id] = optimal_blocks * WARPS_PER_BLOCK; - else - MAXWARPS[thr_id] = TOTAL_WARP_LIMIT; - - // chunked memory allocation up to device limits - int warp; - for (warp = 0; warp < MAXWARPS[thr_id]; ++warp) { - // work around partition camping problems by adding a random start address offset to each allocation - h_V_extra[thr_id][warp] = (props.major == 1) ? (16 * (rand()%(16384/16))) : 0; - cudaGetLastError(); // clear the error state - cudaMalloc((void **) &h_V[thr_id][warp], (SCRATCH * WU_PER_WARP + h_V_extra[thr_id][warp])*sizeof(uint32_t)); - if (cudaGetLastError() == cudaSuccess) h_V[thr_id][warp] += h_V_extra[thr_id][warp]; - else { - h_V_extra[thr_id][warp] = 0; - - // back off by several warp allocations to have some breathing room - int remove = (BACKOFF*warp+50)/100; - for (int i=0; warp > 0 && i < remove; ++i) { - warp--; - checkCudaErrors(cudaFree(h_V[thr_id][warp]-h_V_extra[thr_id][warp])); - h_V[thr_id][warp] = NULL; h_V_extra[thr_id][warp] = 0; - } - - break; - } - } - MAXWARPS[thr_id] = warp; - } - kernel->set_scratchbuf_constants(MAXWARPS[thr_id], h_V[thr_id]); - - if (validate_config(device_config[thr_id], optimal_blocks, WARPS_PER_BLOCK)) - { - if (optimal_blocks * WARPS_PER_BLOCK > MAXWARPS[thr_id]) - { - applog(LOG_ERR, "GPU #%d: FATAL: Given launch config '%s' requires too much memory.", device_map[thr_id], device_config[thr_id]); - return 0; - } - - if (WARPS_PER_BLOCK > kernel->max_warps_per_block()) - { - applog(LOG_ERR, "GPU #%d: FATAL: Given launch config '%s' exceeds warp limit for '%c' kernel.", device_map[thr_id], device_config[thr_id], kernel->get_identifier()); - return 0; - } - } - else - { - if (device_config[thr_id] != NULL && strcasecmp("auto", device_config[thr_id])) - applog(LOG_WARNING, "GPU #%d: Given launch config '%s' does not validate.", device_map[thr_id], device_config[thr_id]); - - if (opt_autotune) - { - applog(LOG_INFO, "GPU #%d: Performing auto-tuning, please wait 2 minutes...", device_map[thr_id]); - - // allocate device memory - uint32_t *d_idata = NULL, *d_odata = NULL; - unsigned int mem_size = MAXWARPS[thr_id] * WU_PER_WARP * sizeof(uint32_t) * 32; - checkCudaErrors(cudaMalloc((void **) &d_idata, mem_size)); - checkCudaErrors(cudaMalloc((void **) &d_odata, mem_size)); - - // pre-initialize some device memory - uint32_t *h_idata = (uint32_t*)malloc(mem_size); - for (unsigned int i=0; i < mem_size/sizeof(uint32_t); ++i) h_idata[i] = i*2654435761UL; // knuth's method - checkCudaErrors(cudaMemcpy(d_idata, h_idata, mem_size, cudaMemcpyHostToDevice)); - free(h_idata); - - double best_hash_sec = 0.0; - int best_wpb = 0; - - // auto-tuning loop - { - // we want to have enough total warps for half the multiprocessors at least - // compute highest MAXWARPS number that we can support based on texture cache mode - int MINTW = props.multiProcessorCount / 2; - int MAXTW = (device_texturecache[thr_id] == 1) ? min(MAXWARPS[thr_id],MW_1D) : MAXWARPS[thr_id]; - - // we want to have blocks for half the multiprocessors at least - int MINB = props.multiProcessorCount / 2; - int MAXB = MAXTW; - - double tmin = 0.05; - - applog(LOG_INFO, "GPU #%d: maximum total warps (BxW): %d", (int) device_map[thr_id], MAXTW); - - for (int GRID_BLOCKS = MINB; !abort_flag && GRID_BLOCKS <= MAXB; ++GRID_BLOCKS) - { - double Hash[32+1] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; - for (WARPS_PER_BLOCK = 1; !abort_flag && WARPS_PER_BLOCK <= kernel->max_warps_per_block(); ++WARPS_PER_BLOCK) - { - double hash_sec = 0; - if (GRID_BLOCKS * WARPS_PER_BLOCK >= MINTW && - GRID_BLOCKS * WARPS_PER_BLOCK <= MAXTW) - { - // setup execution parameters - dim3 grid(WU_PER_LAUNCH/WU_PER_BLOCK, 1, 1); - dim3 threads(THREADS_PER_WU*WU_PER_BLOCK, 1, 1); - - struct timeval tv_start, tv_end; - double tdelta = 0; - - checkCudaErrors(cudaDeviceSynchronize()); - gettimeofday(&tv_start, NULL); - int repeat = 0; - do // average several measurements for better exactness - { - kernel->run_kernel( - grid, threads, WARPS_PER_BLOCK, thr_id, NULL, d_idata, d_odata, N, - LOOKUP_GAP, device_interactive[thr_id], true, device_texturecache[thr_id] - ); - if(cudaDeviceSynchronize() != cudaSuccess) - break; - ++repeat; - gettimeofday(&tv_end, NULL); - // for a better result averaging, measure for at least 50ms (10ms for Keccak) - } while ((tdelta=(1e-6 * (tv_end.tv_usec-tv_start.tv_usec) + (tv_end.tv_sec-tv_start.tv_sec))) < tmin); - if (cudaGetLastError() != cudaSuccess) continue; - - tdelta /= repeat; // BUGFIX: this averaging over multiple measurements was missing - - // for scrypt: in interactive mode only find launch configs where kernel launch times are short enough - // TODO: instead we could reduce the batchsize parameter to meet the launch time requirement. - if (IS_SCRYPT() && device_interactive[thr_id] - && GRID_BLOCKS > 2*props.multiProcessorCount && tdelta > 1.0/30) - { - if (WARPS_PER_BLOCK == 1) goto skip; else goto skip2; - } - - hash_sec = (double)WU_PER_LAUNCH / tdelta; - Hash[WARPS_PER_BLOCK] = hash_sec; - if (hash_sec > best_hash_sec) { - optimal_blocks = GRID_BLOCKS; - best_hash_sec = hash_sec; - best_wpb = WARPS_PER_BLOCK; - } - } - } -skip2: - if (opt_debug) { - - if (GRID_BLOCKS == MINB) { - char line[512] = " "; - for (int i=1; i<=kernel->max_warps_per_block(); ++i) { - char tmp[16]; sprintf(tmp, i < 10 ? " x%-2d" : " x%-2d ", i); - strcat(line, tmp); - if (cw == 80 && (i % 8 == 0 && i != kernel->max_warps_per_block())) - strcat(line, "\n "); - } - applog(LOG_DEBUG, line); - } - - char kMGT = ' '; bool flag; - for (int j=0; j < 4; ++j) { - flag=false; for (int i=1; i<=kernel->max_warps_per_block(); flag|=Hash[i] >= 1000, i++); - if (flag) for (int i=1; i<=kernel->max_warps_per_block(); Hash[i] /= 1000, i++); - else break; - if (kMGT == ' ') kMGT = 'k'; - else if (kMGT == 'k') kMGT = 'M'; - else if (kMGT == 'M') kMGT = 'G'; - else if (kMGT == 'G') kMGT = 'T'; - } - const char *format = "%5.4f%c"; - flag = false; for (int i=1; i<=kernel->max_warps_per_block(); flag|=Hash[i] >= 1, i++); if (flag) format = "%5.3f%c"; - flag = false; for (int i=1; i<=kernel->max_warps_per_block(); flag|=Hash[i] >= 10, i++); if (flag) format = "%5.2f%c"; - flag = false; for (int i=1; i<=kernel->max_warps_per_block(); flag|=Hash[i] >= 100, i++); if (flag) format = "%5.1f%c"; - - char line[512]; sprintf(line, "%3d:", GRID_BLOCKS); - for (int i=1; i<=kernel->max_warps_per_block(); ++i) { - char tmp[16]; - if (Hash[i]>0) - sprintf(tmp, format, Hash[i], (imax_warps_per_block())?'|':' '); - else - sprintf(tmp, " %c", (imax_warps_per_block())?'|':' '); - strcat(line, tmp); - if (cw == 80 && (i % 8 == 0 && i != kernel->max_warps_per_block())) - strcat(line, "\n "); - } - int n = strlen(line)-1; line[n++] = '|'; line[n++] = ' '; line[n++] = kMGT; line[n++] = '\0'; - strcat(line, "H/s"); - applog(LOG_DEBUG, line); - } - } -skip: ; - } - - checkCudaErrors(cudaFree(d_odata)); - checkCudaErrors(cudaFree(d_idata)); - - WARPS_PER_BLOCK = best_wpb; - applog(LOG_INFO, "GPU #%d: %7.2f hash/s with configuration %c%dx%d", device_map[thr_id], best_hash_sec, kernel->get_identifier(), optimal_blocks, WARPS_PER_BLOCK); - } - else - { - // Heuristics to find a good kernel launch configuration - - // base the initial block estimate on the number of multiprocessors - int device_cores = props.multiProcessorCount * _ConvertSMVer2Cores(props.major, props.minor); - - // defaults, in case nothing else is chosen below - optimal_blocks = 4 * device_cores / WU_PER_WARP; - WARPS_PER_BLOCK = 2; - - // Based on compute capability, pick a known good block x warp configuration. - if (props.major >= 3) - { - if (props.major == 3 && props.minor == 5) // GK110 (Tesla K20X, K20, GeForce GTX TITAN) - { - // TODO: what to do with Titan and Tesla K20(X)? - // for now, do the same as for GTX 660Ti (2GB) - optimal_blocks = (int)(optimal_blocks * 0.8809524); - WARPS_PER_BLOCK = 2; - } - else // GK104, GK106, GK107 ... - { - if (MAXWARPS[thr_id] > (int)(optimal_blocks * 1.7261905) * 2) - { - // this results in 290x2 configuration on GTX 660Ti (3GB) - // but it requires 3GB memory on the card! - optimal_blocks = (int)(optimal_blocks * 1.7261905); - WARPS_PER_BLOCK = 2; - } - else - { - // this results in 148x2 configuration on GTX 660Ti (2GB) - optimal_blocks = (int)(optimal_blocks * 0.8809524); - WARPS_PER_BLOCK = 2; - } - } - } - // 1st generation Fermi (compute 2.0) GF100, GF110 - else if (props.major == 2 && props.minor == 0) - { - // this results in a 60x4 configuration on GTX 570 - optimal_blocks = 4 * device_cores / WU_PER_WARP; - WARPS_PER_BLOCK = 4; - } - // 2nd generation Fermi (compute 2.1) GF104,106,108,114,116 - else if (props.major == 2 && props.minor == 1) - { - // this results in a 56x2 configuration on GTX 460 - optimal_blocks = props.multiProcessorCount * 8; - WARPS_PER_BLOCK = 2; - } - - // in case we run out of memory with the automatically chosen configuration, - // first back off with WARPS_PER_BLOCK, then reduce optimal_blocks. - if (WARPS_PER_BLOCK==3 && optimal_blocks * WARPS_PER_BLOCK > MAXWARPS[thr_id]) - WARPS_PER_BLOCK = 2; - while (optimal_blocks > 0 && optimal_blocks * WARPS_PER_BLOCK > MAXWARPS[thr_id]) - optimal_blocks--; - } - } - - applog(LOG_INFO, "GPU #%d: using launch configuration %c%dx%d", device_map[thr_id], kernel->get_identifier(), optimal_blocks, WARPS_PER_BLOCK); - - if (device_singlememory[thr_id]) - { - if (MAXWARPS[thr_id] != optimal_blocks * WARPS_PER_BLOCK) - { - MAXWARPS[thr_id] = optimal_blocks * WARPS_PER_BLOCK; - if (device_texturecache[thr_id] == 1) - kernel->unbindtexture_1D(); - else if (device_texturecache[thr_id] == 2) - kernel->unbindtexture_2D(); - checkCudaErrors(cudaFree(d_V)); d_V = NULL; - - cudaGetLastError(); // clear the error state - cudaMalloc((void **)&d_V, (size_t)SCRATCH * WU_PER_WARP * MAXWARPS[thr_id] * sizeof(uint32_t)); - if (cudaGetLastError() == cudaSuccess) { - for (int i=0; i < MAXWARPS[thr_id]; ++i) - h_V[thr_id][i] = d_V + SCRATCH * WU_PER_WARP * i; - - if (device_texturecache[thr_id] == 1) - { - // bind linear memory to a 1D texture reference - if (kernel->get_texel_width() == 2) - kernel->bindtexture_1D(d_V, SCRATCH * WU_PER_WARP * MAXWARPS[thr_id] * sizeof(uint32_t)); - else - kernel->bindtexture_1D(d_V, SCRATCH * WU_PER_WARP * MAXWARPS[thr_id] * sizeof(uint32_t)); - } - else if (device_texturecache[thr_id] == 2) - { - // bind pitch linear memory to a 2D texture reference - if (kernel->get_texel_width() == 2) - kernel->bindtexture_2D(d_V, SCRATCH/2, WU_PER_WARP * MAXWARPS[thr_id], SCRATCH*sizeof(uint32_t)); - else - kernel->bindtexture_2D(d_V, SCRATCH/4, WU_PER_WARP * MAXWARPS[thr_id], SCRATCH*sizeof(uint32_t)); - } - - // update pointers to scratch buffer in constant memory after reallocation - kernel->set_scratchbuf_constants(MAXWARPS[thr_id], h_V[thr_id]); - } - else - { - applog(LOG_ERR, "GPU #%d: Unable to allocate enough memory for launch config '%s'.", device_map[thr_id], device_config[thr_id]); - } - } - } - else - { - // back off unnecessary memory allocations to have some breathing room - while (MAXWARPS[thr_id] > 0 && MAXWARPS[thr_id] > optimal_blocks * WARPS_PER_BLOCK) { - (MAXWARPS[thr_id])--; - checkCudaErrors(cudaFree(h_V[thr_id][MAXWARPS[thr_id]]-h_V_extra[thr_id][MAXWARPS[thr_id]])); - h_V[thr_id][MAXWARPS[thr_id]] = NULL; h_V_extra[thr_id][MAXWARPS[thr_id]] = 0; - } - } - - return optimal_blocks; -} - -void cuda_scrypt_HtoD(int thr_id, uint32_t *X, int stream) -{ - unsigned int GRID_BLOCKS = context_blocks[thr_id]; - unsigned int WARPS_PER_BLOCK = context_wpb[thr_id]; - unsigned int THREADS_PER_WU = context_kernel[thr_id]->threads_per_wu(); - unsigned int mem_size = WU_PER_LAUNCH * sizeof(uint32_t) * 32; - - // copy host memory to device - cudaMemcpyAsync(context_idata[stream][thr_id], X, mem_size, cudaMemcpyHostToDevice, context_streams[stream][thr_id]); -} - -void cuda_scrypt_serialize(int thr_id, int stream) -{ - // if the device can concurrently execute multiple kernels, then we must - // wait for the serialization event recorded by the other stream - if (context_concurrent[thr_id] || device_interactive[thr_id]) - cudaStreamWaitEvent(context_streams[stream][thr_id], context_serialize[(stream+1)&1][thr_id], 0); -} - -void cuda_scrypt_done(int thr_id, int stream) -{ - // record the serialization event in the current stream - cudaEventRecord(context_serialize[stream][thr_id], context_streams[stream][thr_id]); -} - -void cuda_scrypt_flush(int thr_id, int stream) -{ - // flush the work queue (required for WDDM drivers) - cudaStreamSynchronize(context_streams[stream][thr_id]); -} - -void cuda_scrypt_core(int thr_id, int stream, unsigned int N) -{ - unsigned int GRID_BLOCKS = context_blocks[thr_id]; - unsigned int WARPS_PER_BLOCK = context_wpb[thr_id]; - unsigned int THREADS_PER_WU = context_kernel[thr_id]->threads_per_wu(); - unsigned int LOOKUP_GAP = device_lookup_gap[thr_id]; - - // setup execution parameters - dim3 grid(WU_PER_LAUNCH/WU_PER_BLOCK, 1, 1); - dim3 threads(THREADS_PER_WU*WU_PER_BLOCK, 1, 1); - - context_kernel[thr_id]->run_kernel(grid, threads, WARPS_PER_BLOCK, thr_id, - context_streams[stream][thr_id], context_idata[stream][thr_id], context_odata[stream][thr_id], - N, LOOKUP_GAP, device_interactive[thr_id], opt_benchmark, device_texturecache[thr_id] - ); -} - -void cuda_scrypt_DtoH(int thr_id, uint32_t *X, int stream, bool postSHA) -{ - unsigned int GRID_BLOCKS = context_blocks[thr_id]; - unsigned int WARPS_PER_BLOCK = context_wpb[thr_id]; - unsigned int THREADS_PER_WU = context_kernel[thr_id]->threads_per_wu(); - unsigned int mem_size = WU_PER_LAUNCH * sizeof(uint32_t) * (postSHA ? 8 : 32); - // copy result from device to host (asynchronously) - checkCudaErrors(cudaMemcpyAsync(X, postSHA ? context_hash[stream][thr_id] : context_odata[stream][thr_id], mem_size, cudaMemcpyDeviceToHost, context_streams[stream][thr_id])); -} - -bool cuda_scrypt_sync(int thr_id, int stream) -{ - cudaError_t err; - uint32_t wait_us = 0; - - if (device_interactive[thr_id] && !opt_benchmark) - { - // For devices that also do desktop rendering or compositing, we want to free up some time slots. - // That requires making a pause in work submission when there is no active task on the GPU, - // and Device Synchronize ensures that. - - // this call was replaced by the loop below to workaround the high CPU usage issue - //err = cudaDeviceSynchronize(); - - while((err = cudaStreamQuery(context_streams[0][thr_id])) == cudaErrorNotReady || - (err == cudaSuccess && (err = cudaStreamQuery(context_streams[1][thr_id])) == cudaErrorNotReady)) { - usleep(50); wait_us+=50; - } - - usleep(50); wait_us+=50; - } else { - // this call was replaced by the loop below to workaround the high CPU usage issue - //err = cudaStreamSynchronize(context_streams[stream][thr_id]); - - while((err = cudaStreamQuery(context_streams[stream][thr_id])) == cudaErrorNotReady) { - usleep(50); wait_us+=50; - } - } - - if (err != cudaSuccess) { - if (!abort_flag) - applog(LOG_ERR, "GPU #%d: CUDA error `%s` while waiting the kernel.", device_map[thr_id], cudaGetErrorString(err)); - return false; - } - - //if (opt_debug) { - // applog(LOG_DEBUG, "GPU #%d: %s %u us", device_map[thr_id], __FUNCTION__, wait_us); - //} - - return true; -} - -uint32_t* cuda_transferbuffer(int thr_id, int stream) -{ - return context_X[stream][thr_id]; -} - -uint32_t* cuda_hashbuffer(int thr_id, int stream) -{ - return context_H[stream][thr_id]; -} diff --git a/scrypt/salsa_kernel.h b/scrypt/salsa_kernel.h deleted file mode 100644 index f0ea15ae..00000000 --- a/scrypt/salsa_kernel.h +++ /dev/null @@ -1,109 +0,0 @@ -#ifndef SALSA_KERNEL_H -#define SALSA_KERNEL_H - -#include -#include -#include -#ifndef __APPLE__ -#include -#endif -#include -#include - -#include "miner.h" - -// from ccminer.cpp -extern short device_map[MAX_GPUS]; -extern int device_batchsize[MAX_GPUS]; // cudaminer -b -extern int device_interactive[MAX_GPUS]; // cudaminer -i -extern int device_texturecache[MAX_GPUS]; // cudaminer -C -extern int device_singlememory[MAX_GPUS]; // cudaminer -m -extern int device_lookup_gap[MAX_GPUS]; // -L -extern int device_backoff[MAX_GPUS]; // WIN32/LINUX var -extern char *device_config[MAX_GPUS]; // -l -extern char *device_name[MAX_GPUS]; - -extern bool opt_autotune; -extern int opt_nfactor; -extern char *jane_params; -extern int parallel; - -extern void get_currentalgo(char* buf, int sz); - -typedef unsigned int uint32_t; // define this as 32 bit type derived from int - -// scrypt variants -#define A_SCRYPT 0 -#define A_SCRYPT_JANE 1 -static char algo[64] = { 0 }; -static int scrypt_algo = -1; -static __inline int get_scrypt_type() { - if (scrypt_algo != -1) return scrypt_algo; - get_currentalgo(algo, 64); - if (!strncasecmp(algo,"scrypt-jane",11)) scrypt_algo = A_SCRYPT_JANE; - else if (!strncasecmp(algo,"scrypt",6)) scrypt_algo = A_SCRYPT; - return scrypt_algo; -} -static __inline bool IS_SCRYPT() { get_scrypt_type(); return (scrypt_algo == A_SCRYPT); } -static __inline bool IS_SCRYPT_JANE() { get_scrypt_type(); return (scrypt_algo == A_SCRYPT_JANE); } - -// CUDA externals -extern int cuda_throughput(int thr_id); -extern uint32_t *cuda_transferbuffer(int thr_id, int stream); -extern uint32_t *cuda_hashbuffer(int thr_id, int stream); - -extern void cuda_scrypt_HtoD(int thr_id, uint32_t *X, int stream); -extern void cuda_scrypt_serialize(int thr_id, int stream); -extern void cuda_scrypt_core(int thr_id, int stream, unsigned int N); -extern void cuda_scrypt_done(int thr_id, int stream); -extern void cuda_scrypt_DtoH(int thr_id, uint32_t *X, int stream, bool postSHA); -extern bool cuda_scrypt_sync(int thr_id, int stream); -extern void cuda_scrypt_flush(int thr_id, int stream); - -// If we're in C++ mode, we're either compiling .cu files or scrypt.cpp - -#ifdef __NVCC__ - -/** - * An pure virtual interface for a CUDA kernel implementation. - * TODO: encapsulate the kernel launch parameters in some kind of wrapper. - */ -class KernelInterface -{ -public: - virtual void set_scratchbuf_constants(int MAXWARPS, uint32_t** h_V) = 0; - virtual bool run_kernel(dim3 grid, dim3 threads, int WARPS_PER_BLOCK, int thr_id, cudaStream_t stream, uint32_t* d_idata, uint32_t* d_odata, unsigned int N, unsigned int LOOKUP_GAP, bool interactive, bool benchmark, int texture_cache) = 0; - virtual bool bindtexture_1D(uint32_t *d_V, size_t size) { return true; } - virtual bool bindtexture_2D(uint32_t *d_V, int width, int height, size_t pitch) { return true; } - virtual bool unbindtexture_1D() { return true; } - virtual bool unbindtexture_2D() { return true; } - - virtual char get_identifier() = 0; - virtual int get_major_version() { return 1; } - virtual int get_minor_version() { return 0; } - virtual int max_warps_per_block() = 0; - virtual int get_texel_width() = 0; - virtual bool no_textures() { return false; }; - virtual bool single_memory() { return false; }; - virtual int threads_per_wu() { return 1; } - virtual bool support_lookup_gap() { return false; } - virtual cudaSharedMemConfig shared_mem_config() { return cudaSharedMemBankSizeDefault; } - virtual cudaFuncCache cache_config() { return cudaFuncCachePreferNone; } -}; - -// Not performing error checking is actually bad, but... -#define checkCudaErrors(x) x -#define getLastCudaError(x) - -#endif // #ifdef __NVCC__ - -// Define work unit size -#define TOTAL_WARP_LIMIT 4096 -#define WU_PER_WARP (32 / THREADS_PER_WU) -#define WU_PER_BLOCK (WU_PER_WARP*WARPS_PER_BLOCK) -#define WU_PER_LAUNCH (GRID_BLOCKS*WU_PER_BLOCK) - -// make scratchpad size dependent on N and LOOKUP_GAP -#define SCRATCH (((N+LOOKUP_GAP-1)/LOOKUP_GAP)*32) - -#endif // #ifndef SALSA_KERNEL_H diff --git a/scrypt/scrypt-jane.h b/scrypt/scrypt-jane.h deleted file mode 100644 index e8c270bf..00000000 --- a/scrypt/scrypt-jane.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef SCRYPT_JANE_H -#define SCRYPT_JANE_H - -/* - Nfactor: Increases CPU & Memory Hardness - N = (1 << (Nfactor + 1)): How many times to mix a chunk and how many temporary chunks are used - - rfactor: Increases Memory Hardness - r = (1 << rfactor): How large a chunk is - - pfactor: Increases CPU Hardness - p = (1 << pfactor): Number of times to mix the main chunk - - A block is the basic mixing unit (salsa/chacha block = 64 bytes) - A chunk is (2 * r) blocks - - ~Memory used = (N + 2) * ((2 * r) * block size) -*/ - -#include -#include -#include - -typedef void (*scrypt_fatal_errorfn)(const char *msg); -void scrypt_set_fatal_error(scrypt_fatal_errorfn fn); - -void scrypt_N_1_1(const unsigned char *password, size_t password_len, const unsigned char *salt, size_t salt_len, uint32_t N, unsigned char *out, size_t bytes, uint8_t *X, uint8_t *Y, uint8_t *V); - -#endif /* SCRYPT_JANE_H */ diff --git a/scrypt/test_kernel.cu b/scrypt/test_kernel.cu deleted file mode 100644 index e4467d1f..00000000 --- a/scrypt/test_kernel.cu +++ /dev/null @@ -1,782 +0,0 @@ -/* Copyright (C) 2013 David G. Andersen. All rights reserved. - * with modifications by Christian Buchner - * - * Use of this code is covered under the Apache 2.0 license, which - * can be found in the file "LICENSE" - * - * The array notation for b[] and bx[] arrays was converted to uint4, - * in preparation for some experimental changes to memory access patterns. - * Also this kernel is going to be a testbed for adaptation to Fermi devices. - */ - -// TODO: experiment with different memory access patterns in write/read_keys_direct functions -// TODO: attempt V.Volkov style ILP (factor 4) - -#include - -#include -#include "miner.h" - -#include "salsa_kernel.h" -#include "test_kernel.h" - -#define TEXWIDTH 32768 -#define THREADS_PER_WU 4 // four threads per hash - -typedef enum -{ - ANDERSEN, - SIMPLE -} MemoryAccess; - - -// scratchbuf constants (pointers to scratch buffer for each warp, i.e. 32 hashes) -__constant__ uint32_t* c_V[TOTAL_WARP_LIMIT]; - -// iteration count N -__constant__ uint32_t c_N; -__constant__ uint32_t c_N_1; // N-1 -// scratch buffer size SCRATCH -__constant__ uint32_t c_SCRATCH; -__constant__ uint32_t c_SCRATCH_WU_PER_WARP; // (SCRATCH * WU_PER_WARP) -__constant__ uint32_t c_SCRATCH_WU_PER_WARP_1; // (SCRATCH * WU_PER_WARP) - 1 - -// using texture references for the "tex" variants of the B kernels -texture texRef1D_4_V; -texture texRef2D_4_V; - -template __device__ __forceinline__ void block_mixer(uint4 &b, uint4 &bx, const int x1, const int x2, const int x3); - -static __host__ __device__ uint4& operator^=(uint4& left, const uint4& right) { - left.x ^= right.x; - left.y ^= right.y; - left.z ^= right.z; - left.w ^= right.w; - return left; -} - -static __host__ __device__ uint4& operator+=(uint4& left, const uint4& right) { - left.x += right.x; - left.y += right.y; - left.z += right.z; - left.w += right.w; - return left; -} - - -/* write_keys writes the 8 keys being processed by a warp to the global - * scratchpad. To effectively use memory bandwidth, it performs the writes - * (and reads, for read_keys) 128 bytes at a time per memory location - * by __shfl'ing the 4 entries in bx to the threads in the next-up - * thread group. It then has eight threads together perform uint4 - * (128 bit) writes to the destination region. This seems to make - * quite effective use of memory bandwidth. An approach that spread - * uint32s across more threads was slower because of the increased - * computation it required. - * - * "start" is the loop iteration producing the write - the offset within - * the block's memory. - * - * Internally, this algorithm first __shfl's the 4 bx entries to - * the next up thread group, and then uses a conditional move to - * ensure that odd-numbered thread groups exchange the b/bx ordering - * so that the right parts are written together. - * - * Thanks to Babu for helping design the 128-bit-per-write version. - * - * _direct lets the caller specify the absolute start location instead of - * the relative start location, as an attempt to reduce some recomputation. - */ - -template __device__ __forceinline__ -void write_keys_direct(const uint4 &b, const uint4 &bx, uint32_t start) -{ - uint32_t *scratch = c_V[(blockIdx.x*blockDim.x + threadIdx.x)/32]; - - if (SCHEME == ANDERSEN) { - uint4 t=b, t2; - extern __shared__ unsigned char shared[]; - uint32_t (*tmp)[32+1] = (uint32_t (*)[32+1])(shared); - uint32_t *s = &tmp[threadIdx.x/32][threadIdx.x%32]; - uint32_t *st = &tmp[threadIdx.x/32][(threadIdx.x + 4)%32]; - *s = bx.x; t2.x = *st; - *s = bx.y; t2.y = *st; - *s = bx.z; t2.z = *st; - *s = bx.w; t2.w = *st; - *s = start; int t2_start = *st + 4; - bool c = (threadIdx.x & 0x4); - *((uint4 *)(&scratch[c ? t2_start : start])) = (c ? t2 : t); - *((uint4 *)(&scratch[c ? start : t2_start])) = (c ? t : t2); - } else { - *((uint4 *)(&scratch[start ])) = b; - *((uint4 *)(&scratch[start+16])) = bx; - } -} - -template __device__ __forceinline__ -void read_keys_direct(uint4 &b, uint4 &bx, uint32_t start) -{ - uint32_t *scratch; - - if (TEX_DIM == 0) scratch = c_V[(blockIdx.x*blockDim.x + threadIdx.x)/32]; - if (SCHEME == ANDERSEN) { - extern __shared__ unsigned char shared[]; - uint32_t (*tmp)[32+1] = (uint32_t (*)[32+1])(shared); - uint32_t *s = &tmp[threadIdx.x/32][threadIdx.x%32]; - *s = start; int t2_start = tmp[threadIdx.x/32][(threadIdx.x + 4)%32] + 4; - if (TEX_DIM > 0) { start /= 4; t2_start /= 4; } - bool c = (threadIdx.x & 0x4); - if (TEX_DIM == 0) { - b = *((uint4 *)(&scratch[c ? t2_start : start])); - bx = *((uint4 *)(&scratch[c ? start : t2_start])); - } else if (TEX_DIM == 1) { - b = tex1Dfetch(texRef1D_4_V, c ? t2_start : start); - bx = tex1Dfetch(texRef1D_4_V, c ? start : t2_start); - } else if (TEX_DIM == 2) { - b = tex2D(texRef2D_4_V, 0.5f + ((c ? t2_start : start)%TEXWIDTH), 0.5f + ((c ? t2_start : start)/TEXWIDTH)); - bx = tex2D(texRef2D_4_V, 0.5f + ((c ? start : t2_start)%TEXWIDTH), 0.5f + ((c ? start : t2_start)/TEXWIDTH)); - } - uint4 temp = b; b = (c ? bx : b); bx = (c ? temp : bx); - uint32_t *st = &tmp[threadIdx.x/32][(threadIdx.x + 28)%32]; - *s = bx.x; bx.x = *st; - *s = bx.y; bx.y = *st; - *s = bx.z; bx.z = *st; - *s = bx.w; bx.w = *st; - } else { - if (TEX_DIM == 0) b = *((uint4 *)(&scratch[start])); - else if (TEX_DIM == 1) b = tex1Dfetch(texRef1D_4_V, start/4); - else if (TEX_DIM == 2) b = tex2D(texRef2D_4_V, 0.5f + ((start/4)%TEXWIDTH), 0.5f + ((start/4)/TEXWIDTH)); - if (TEX_DIM == 0) bx = *((uint4 *)(&scratch[start+16])); - else if (TEX_DIM == 1) bx = tex1Dfetch(texRef1D_4_V, (start+16)/4); - else if (TEX_DIM == 2) bx = tex2D(texRef2D_4_V, 0.5f + (((start+16)/4)%TEXWIDTH), 0.5f + (((start+16)/4)/TEXWIDTH)); - } -} - - -__device__ __forceinline__ -void primary_order_shuffle(uint4 &b, uint4 &bx) -{ - /* Inner loop shuffle targets */ - int x1 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+1)&0x3); - int x2 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+2)&0x3); - int x3 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+3)&0x3); - - extern __shared__ unsigned char shared[]; - uint32_t (*tmp)[32+1] = (uint32_t (*)[32+1])(shared); - unsigned int wrp = threadIdx.x/32, lane = threadIdx.x%32; - uint32_t *s = &tmp[wrp][lane]; - uint32_t *s1 = &tmp[wrp][x1]; - uint32_t *s2 = &tmp[wrp][x2]; - uint32_t *s3 = &tmp[wrp][x3]; - - *s = b.w; b.w = *s1; - *s = b.z; b.z = *s2; - *s = b.y; b.y = *s3; - uint32_t temp = b.y; b.y = b.w; b.w = temp; - - *s = bx.w; bx.w = *s1; - *s = bx.z; bx.z = *s2; - *s = bx.y; bx.y = *s3; - temp = bx.y; bx.y = bx.w; bx.w = temp; -} - -/* - * load_key loads a 32*32bit key from a contiguous region of memory in B. - * The input keys are in external order (i.e., 0, 1, 2, 3, ...). - * After loading, each thread has its four b and four bx keys stored - * in internal processing order. - */ - -__device__ __forceinline__ -void load_key_salsa(const uint32_t *B, uint4 &b, uint4 &bx) -{ - int scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - int key_offset = scrypt_block * 32; - uint32_t thread_in_block = threadIdx.x % 4; - - // Read in permuted order. Key loads are not our bottleneck right now. - b.x = B[key_offset + 4*thread_in_block + (thread_in_block+0)%4]; - b.y = B[key_offset + 4*thread_in_block + (thread_in_block+1)%4]; - b.z = B[key_offset + 4*thread_in_block + (thread_in_block+2)%4]; - b.w = B[key_offset + 4*thread_in_block + (thread_in_block+3)%4]; - bx.x = B[key_offset + 4*thread_in_block + (thread_in_block+0)%4 + 16]; - bx.y = B[key_offset + 4*thread_in_block + (thread_in_block+1)%4 + 16]; - bx.z = B[key_offset + 4*thread_in_block + (thread_in_block+2)%4 + 16]; - bx.w = B[key_offset + 4*thread_in_block + (thread_in_block+3)%4 + 16]; - - primary_order_shuffle(b, bx); - -} - -/* - * store_key performs the opposite transform as load_key, taking - * internally-ordered b and bx and storing them into a contiguous - * region of B in external order. - */ - -__device__ __forceinline__ -void store_key_salsa(uint32_t *B, uint4 &b, uint4 &bx) -{ - int scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - int key_offset = scrypt_block * 32; - uint32_t thread_in_block = threadIdx.x % 4; - - primary_order_shuffle(b, bx); - - B[key_offset + 4*thread_in_block + (thread_in_block+0)%4] = b.x; - B[key_offset + 4*thread_in_block + (thread_in_block+1)%4] = b.y; - B[key_offset + 4*thread_in_block + (thread_in_block+2)%4] = b.z; - B[key_offset + 4*thread_in_block + (thread_in_block+3)%4] = b.w; - B[key_offset + 4*thread_in_block + (thread_in_block+0)%4 + 16] = bx.x; - B[key_offset + 4*thread_in_block + (thread_in_block+1)%4 + 16] = bx.y; - B[key_offset + 4*thread_in_block + (thread_in_block+2)%4 + 16] = bx.z; - B[key_offset + 4*thread_in_block + (thread_in_block+3)%4 + 16] = bx.w; -} - - -/* - * load_key loads a 32*32bit key from a contiguous region of memory in B. - * The input keys are in external order (i.e., 0, 1, 2, 3, ...). - * After loading, each thread has its four b and four bx keys stored - * in internal processing order. - */ - -__device__ __forceinline__ -void load_key_chacha(const uint32_t *B, uint4 &b, uint4 &bx) -{ - int scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - int key_offset = scrypt_block * 32; - uint32_t thread_in_block = threadIdx.x % 4; - - // Read in permuted order. Key loads are not our bottleneck right now. - b.x = B[key_offset + 4*0 + thread_in_block%4]; - b.y = B[key_offset + 4*1 + thread_in_block%4]; - b.z = B[key_offset + 4*2 + thread_in_block%4]; - b.w = B[key_offset + 4*3 + thread_in_block%4]; - bx.x = B[key_offset + 4*0 + thread_in_block%4 + 16]; - bx.y = B[key_offset + 4*1 + thread_in_block%4 + 16]; - bx.z = B[key_offset + 4*2 + thread_in_block%4 + 16]; - bx.w = B[key_offset + 4*3 + thread_in_block%4 + 16]; -} - -/* - * store_key performs the opposite transform as load_key, taking - * internally-ordered b and bx and storing them into a contiguous - * region of B in external order. - */ - -__device__ __forceinline__ -void store_key_chacha(uint32_t *B, const uint4 &b, const uint4 &bx) -{ - int scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - int key_offset = scrypt_block * 32; - uint32_t thread_in_block = threadIdx.x % 4; - - B[key_offset + 4*0 + thread_in_block%4] = b.x; - B[key_offset + 4*1 + thread_in_block%4] = b.y; - B[key_offset + 4*2 + thread_in_block%4] = b.z; - B[key_offset + 4*3 + thread_in_block%4] = b.w; - B[key_offset + 4*0 + thread_in_block%4 + 16] = bx.x; - B[key_offset + 4*1 + thread_in_block%4 + 16] = bx.y; - B[key_offset + 4*2 + thread_in_block%4 + 16] = bx.z; - B[key_offset + 4*3 + thread_in_block%4 + 16] = bx.w; -} - - -template __device__ __forceinline__ -void load_key(const uint32_t *B, uint4 &b, uint4 &bx) -{ - switch(ALGO) { - case A_SCRYPT: load_key_salsa(B, b, bx); break; - case A_SCRYPT_JANE: load_key_chacha(B, b, bx); break; - } -} - -template __device__ __forceinline__ -void store_key(uint32_t *B, uint4 &b, uint4 &bx) -{ - switch(ALGO) { - case A_SCRYPT: store_key_salsa(B, b, bx); break; - case A_SCRYPT_JANE: store_key_chacha(B, b, bx); break; - } -} - - -/* - * salsa_xor_core (Salsa20/8 cypher) - * The original scrypt called: - * xor_salsa8(&X[0], &X[16]); <-- the "b" loop - * xor_salsa8(&X[16], &X[0]); <-- the "bx" loop - * This version is unrolled to handle both of these loops in a single - * call to avoid unnecessary data movement. - */ - -#define XOR_ROTATE_ADD(dst, s1, s2, amt) { uint32_t tmp = s1+s2; dst ^= ((tmp<>(32-amt))); } - -__device__ __forceinline__ -void salsa_xor_core(uint4 &b, uint4 &bx, const int x1, const int x2, const int x3) -{ - extern __shared__ unsigned char shared[]; - uint32_t (*tmp)[32+1] = (uint32_t (*)[32+1])(shared); - unsigned int wrp = threadIdx.x/32, lane = threadIdx.x%32; - uint32_t *s = &tmp[wrp][lane]; - uint32_t *s1 = &tmp[wrp][x1]; - uint32_t *s2 = &tmp[wrp][x2]; - uint32_t *s3 = &tmp[wrp][x3]; - - uint4 x; - - b ^= bx; - x = b; - - // Enter in "primary order" (t0 has 0, 4, 8, 12) - // (t1 has 5, 9, 13, 1) - // (t2 has 10, 14, 2, 6) - // (t3 has 15, 3, 7, 11) - - #pragma unroll - for (int j = 0; j < 4; j++) { - - // Mixing phase of salsa - XOR_ROTATE_ADD(x.y, x.x, x.w, 7); - XOR_ROTATE_ADD(x.z, x.y, x.x, 9); - XOR_ROTATE_ADD(x.w, x.z, x.y, 13); - XOR_ROTATE_ADD(x.x, x.w, x.z, 18); - - /* Transpose rows and columns. */ - /* Unclear if this optimization is needed: These are ordered based - * upon the dependencies needed in the later xors. Compiler should be - * able to figure this out, but might as well give it a hand. */ - *s = x.y; x.y = *s3; - *s = x.w; x.w = *s1; - *s = x.z; x.z = *s2; - - /* The next XOR_ROTATE_ADDS could be written to be a copy-paste of the first, - * but the register targets are rewritten here to swap x[1] and x[3] so that - * they can be directly shuffled to and from our peer threads without - * reassignment. The reverse shuffle then puts them back in the right place. - */ - - XOR_ROTATE_ADD(x.w, x.x, x.y, 7); - XOR_ROTATE_ADD(x.z, x.w, x.x, 9); - XOR_ROTATE_ADD(x.y, x.z, x.w, 13); - XOR_ROTATE_ADD(x.x, x.y, x.z, 18); - - *s = x.w; x.w = *s3; - *s = x.y; x.y = *s1; - *s = x.z; x.z = *s2; - } - - b += x; - // The next two lines are the beginning of the BX-centric loop iteration - bx ^= b; - x = bx; - - // This is a copy of the same loop above, identical but stripped of comments. - // Duplicated so that we can complete a bx-based loop with fewer register moves. - #pragma unroll - for (int j = 0; j < 4; j++) { - XOR_ROTATE_ADD(x.y, x.x, x.w, 7); - XOR_ROTATE_ADD(x.z, x.y, x.x, 9); - XOR_ROTATE_ADD(x.w, x.z, x.y, 13); - XOR_ROTATE_ADD(x.x, x.w, x.z, 18); - - *s = x.y; x.y = *s3; - *s = x.w; x.w = *s1; - *s = x.z; x.z = *s2; - - XOR_ROTATE_ADD(x.w, x.x, x.y, 7); - XOR_ROTATE_ADD(x.z, x.w, x.x, 9); - XOR_ROTATE_ADD(x.y, x.z, x.w, 13); - XOR_ROTATE_ADD(x.x, x.y, x.z, 18); - - *s = x.w; x.w = *s3; - *s = x.y; x.y = *s1; - *s = x.z; x.z = *s2; - } - - // At the end of these iterations, the data is in primary order again. -#undef XOR_ROTATE_ADD - - bx += x; -} - - -/* - * chacha_xor_core (ChaCha20/8 cypher) - * This version is unrolled to handle both of these loops in a single - * call to avoid unnecessary data movement. - * - * load_key and store_key must not use primary order when - * using ChaCha20/8, but rather the basic transposed order - * (referred to as "column mode" below) - */ - -#define CHACHA_PRIMITIVE(pt, rt, ps, amt) { uint32_t tmp = rt ^ (pt += ps); rt = ((tmp<>(32-amt))); } - -__device__ __forceinline__ -void chacha_xor_core(uint4 &b, uint4 &bx, const int x1, const int x2, const int x3) -{ - extern __shared__ unsigned char shared[]; - uint32_t (*tmp)[32+1] = (uint32_t (*)[32+1])(shared); - unsigned int wrp = threadIdx.x/32, lane = threadIdx.x%32; - uint32_t *s = &tmp[wrp][lane]; - uint32_t *s1 = &tmp[wrp][x1]; - uint32_t *s2 = &tmp[wrp][x2]; - uint32_t *s3 = &tmp[wrp][x3]; - - uint4 x; - - b ^= bx; - x = b; - - // Enter in "column" mode (t0 has 0, 4, 8, 12) - // (t1 has 1, 5, 9, 13) - // (t2 has 2, 6, 10, 14) - // (t3 has 3, 7, 11, 15) - - #pragma unroll - for (int j = 0; j < 4; j++) { - - // Column Mixing phase of chacha - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 16) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 12) - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 8) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 7) - - *s = x.y; x.y = *s1; - *s = x.z; x.z = *s2; - *s = x.w; x.w = *s3; - - // Diagonal Mixing phase of chacha - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 16) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 12) - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 8) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 7) - - *s = x.y; x.y = *s3; - *s = x.z; x.z = *s2; - *s = x.w; x.w = *s1; - } - - b += x; - // The next two lines are the beginning of the BX-centric loop iteration - bx ^= b; - x = bx; - - #pragma unroll - for (int j = 0; j < 4; j++) { - - // Column Mixing phase of chacha - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 16) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 12) - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 8) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 7) - - *s = x.y; x.y = *s1; - *s = x.z; x.z = *s2; - *s = x.w; x.w = *s3; - - // Diagonal Mixing phase of chacha - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 16) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 12) - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 8) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 7) - - *s = x.y; x.y = *s3; - *s = x.z; x.z = *s2; - *s = x.w; x.w = *s1; - } - -#undef CHACHA_PRIMITIVE - - bx += x; -} - -template __device__ __forceinline__ -void block_mixer(uint4 &b, uint4 &bx, const int x1, const int x2, const int x3) -{ - switch(ALGO) { - case A_SCRYPT: salsa_xor_core(b, bx, x1, x2, x3); break; - case A_SCRYPT_JANE: chacha_xor_core(b, bx, x1, x2, x3); break; - } -} - - -/* - * The hasher_gen_kernel operates on a group of 1024-bit input keys - * in B, stored as: - * B = { k1B k1Bx k2B k2Bx ... } - * and fills up the scratchpad with the iterative hashes derived from - * those keys: - * scratch { k1h1B k1h1Bx K1h2B K1h2Bx ... K2h1B K2h1Bx K2h2B K2h2Bx ... } - * scratch is 1024 times larger than the input keys B. - * It is extremely important to stream writes effectively into scratch; - * less important to coalesce the reads from B. - * - * Key ordering note: Keys are input from B in "original" order: - * K = {k1, k2, k3, k4, k5, ..., kx15, kx16, kx17, ..., kx31 } - * After inputting into kernel_gen, each component k and kx of the - * key is transmuted into a permuted internal order to make processing faster: - * K = k, kx with: - * k = 0, 4, 8, 12, 5, 9, 13, 1, 10, 14, 2, 6, 15, 3, 7, 11 - * and similarly for kx. - */ - -template __global__ -void test_scrypt_core_kernelA(const uint32_t *d_idata, int begin, int end) -{ - uint4 b, bx; - - int x1 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+1)&0x3); - int x2 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+2)&0x3); - int x3 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+3)&0x3); - - int scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - int start = (scrypt_block*c_SCRATCH + (SCHEME==ANDERSEN?8:4)*(threadIdx.x%4)) % c_SCRATCH_WU_PER_WARP; - - int i=begin; - - if (i == 0) { - load_key(d_idata, b, bx); - write_keys_direct(b, bx, start); - ++i; - } else read_keys_direct(b, bx, start+32*(i-1)); - - while (i < end) { - block_mixer(b, bx, x1, x2, x3); - write_keys_direct(b, bx, start+32*i); - ++i; - } -} - -template __global__ -void test_scrypt_core_kernelA_LG(const uint32_t *d_idata, int begin, int end, unsigned int LOOKUP_GAP) -{ - uint4 b, bx; - - int x1 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+1)&0x3); - int x2 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+2)&0x3); - int x3 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+3)&0x3); - - int scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - int start = (scrypt_block*c_SCRATCH + (SCHEME==ANDERSEN?8:4)*(threadIdx.x%4)) % c_SCRATCH_WU_PER_WARP; - - int i=begin; - - if (i == 0) { - load_key(d_idata, b, bx); - write_keys_direct(b, bx, start); - ++i; - } else { - int pos = (i-1)/LOOKUP_GAP, loop = (i-1)-pos*LOOKUP_GAP; - read_keys_direct(b, bx, start+32*pos); - while(loop--) block_mixer(b, bx, x1, x2, x3); - } - - while (i < end) { - block_mixer(b, bx, x1, x2, x3); - if (i % LOOKUP_GAP == 0) - write_keys_direct(b, bx, start+32*(i/LOOKUP_GAP)); - ++i; - } -} - - -/* - * hasher_hash_kernel runs the second phase of scrypt after the scratch - * buffer is filled with the iterative hashes: It bounces through - * the scratch buffer in pseudorandom order, mixing the key as it goes. - */ - -template __global__ -void test_scrypt_core_kernelB(uint32_t *d_odata, int begin, int end) -{ - extern __shared__ unsigned char shared[]; - uint32_t (*tmp)[32+1] = (uint32_t (*)[32+1])(shared); - - uint4 b, bx; - - int scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - int start = (scrypt_block*c_SCRATCH) + (SCHEME==ANDERSEN?8:4)*(threadIdx.x%4); - if (TEX_DIM == 0) start %= c_SCRATCH_WU_PER_WARP; - - int x1 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+1)&0x3); - int x2 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+2)&0x3); - int x3 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+3)&0x3); - - if (begin == 0) { - read_keys_direct(b, bx, start+32*c_N_1); - block_mixer(b, bx, x1, x2, x3); - } else load_key(d_odata, b, bx); - - for (int i = begin; i < end; i++) { - tmp[threadIdx.x/32][threadIdx.x%32] = bx.x; - int j = (tmp[threadIdx.x/32][(threadIdx.x & 0x1c)] & (c_N_1)); - uint4 t, tx; read_keys_direct(t, tx, start+32*j); - b ^= t; bx ^= tx; - block_mixer(b, bx, x1, x2, x3); - } - - store_key(d_odata, b, bx); -} - -template __global__ -void test_scrypt_core_kernelB_LG(uint32_t *d_odata, int begin, int end, unsigned int LOOKUP_GAP) -{ - extern __shared__ unsigned char shared[]; - uint32_t (*tmp)[32+1] = (uint32_t (*)[32+1])(shared); - - uint4 b, bx; - - int scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - int start = (scrypt_block*c_SCRATCH) + (SCHEME==ANDERSEN?8:4)*(threadIdx.x%4); - if (TEX_DIM == 0) start %= c_SCRATCH_WU_PER_WARP; - - int x1 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+1)&0x3); - int x2 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+2)&0x3); - int x3 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+3)&0x3); - - if (begin == 0) { - int pos = c_N_1/LOOKUP_GAP, loop = 1 + (c_N_1-pos*LOOKUP_GAP); - read_keys_direct(b, bx, start+32*pos); - while(loop--) block_mixer(b, bx, x1, x2, x3); - } else load_key(d_odata, b, bx); - - for (int i = begin; i < end; i++) { - tmp[threadIdx.x/32][threadIdx.x%32] = bx.x; - int j = (tmp[threadIdx.x/32][(threadIdx.x & 0x1c)] & (c_N_1)); - int pos = j/LOOKUP_GAP, loop = j-pos*LOOKUP_GAP; - uint4 t, tx; read_keys_direct(t, tx, start+32*pos); - while(loop--) block_mixer(t, tx, x1, x2, x3); - b ^= t; bx ^= tx; - block_mixer(b, bx, x1, x2, x3); - } - - store_key(d_odata, b, bx); -} - - -TestKernel::TestKernel() : KernelInterface() -{ -} - -bool TestKernel::bindtexture_1D(uint32_t *d_V, size_t size) -{ - cudaChannelFormatDesc channelDesc4 = cudaCreateChannelDesc(); - texRef1D_4_V.normalized = 0; - texRef1D_4_V.filterMode = cudaFilterModePoint; - texRef1D_4_V.addressMode[0] = cudaAddressModeClamp; - checkCudaErrors(cudaBindTexture(NULL, &texRef1D_4_V, d_V, &channelDesc4, size)); - return true; -} - -bool TestKernel::bindtexture_2D(uint32_t *d_V, int width, int height, size_t pitch) -{ - cudaChannelFormatDesc channelDesc4 = cudaCreateChannelDesc(); - texRef2D_4_V.normalized = 0; - texRef2D_4_V.filterMode = cudaFilterModePoint; - texRef2D_4_V.addressMode[0] = cudaAddressModeClamp; - texRef2D_4_V.addressMode[1] = cudaAddressModeClamp; - // maintain texture width of TEXWIDTH (max. limit is 65000) - while (width > TEXWIDTH) { width /= 2; height *= 2; pitch /= 2; } - while (width < TEXWIDTH) { width *= 2; height = (height+1)/2; pitch *= 2; } - checkCudaErrors(cudaBindTexture2D(NULL, &texRef2D_4_V, d_V, &channelDesc4, width, height, pitch)); - return true; -} - -bool TestKernel::unbindtexture_1D() -{ - checkCudaErrors(cudaUnbindTexture(texRef1D_4_V)); - return true; -} - -bool TestKernel::unbindtexture_2D() -{ - checkCudaErrors(cudaUnbindTexture(texRef2D_4_V)); - return true; -} - -void TestKernel::set_scratchbuf_constants(int MAXWARPS, uint32_t** h_V) -{ - checkCudaErrors(cudaMemcpyToSymbol(c_V, h_V, MAXWARPS*sizeof(uint32_t*), 0, cudaMemcpyHostToDevice)); -} - -bool TestKernel::run_kernel(dim3 grid, dim3 threads, int WARPS_PER_BLOCK, int thr_id, cudaStream_t stream, uint32_t* d_idata, uint32_t* d_odata, unsigned int N, unsigned int LOOKUP_GAP, bool interactive, bool benchmark, int texture_cache) -{ - bool success = true; - - // compute required shared memory per block for __shfl() emulation - size_t shared = ((threads.x + 31) / 32) * (32+1) * sizeof(uint32_t); - - // make some constants available to kernel, update only initially and when changing - static uint32_t prev_N[MAX_GPUS] = { 0 }; - - if (N != prev_N[thr_id]) { - uint32_t h_N = N; - uint32_t h_N_1 = N-1; - uint32_t h_SCRATCH = SCRATCH; - uint32_t h_SCRATCH_WU_PER_WARP = (SCRATCH * WU_PER_WARP); - uint32_t h_SCRATCH_WU_PER_WARP_1 = (SCRATCH * WU_PER_WARP) - 1; - - cudaMemcpyToSymbolAsync(c_N, &h_N, sizeof(uint32_t), 0, cudaMemcpyHostToDevice, stream); - cudaMemcpyToSymbolAsync(c_N_1, &h_N_1, sizeof(uint32_t), 0, cudaMemcpyHostToDevice, stream); - cudaMemcpyToSymbolAsync(c_SCRATCH, &h_SCRATCH, sizeof(uint32_t), 0, cudaMemcpyHostToDevice, stream); - cudaMemcpyToSymbolAsync(c_SCRATCH_WU_PER_WARP, &h_SCRATCH_WU_PER_WARP, sizeof(uint32_t), 0, cudaMemcpyHostToDevice, stream); - cudaMemcpyToSymbolAsync(c_SCRATCH_WU_PER_WARP_1, &h_SCRATCH_WU_PER_WARP_1, sizeof(uint32_t), 0, cudaMemcpyHostToDevice, stream); - - prev_N[thr_id] = N; - } - - // First phase: Sequential writes to scratchpad. - - int batch = device_batchsize[thr_id]; - - unsigned int pos = 0; - do { - if (LOOKUP_GAP == 1) { - if (IS_SCRYPT()) test_scrypt_core_kernelA <<< grid, threads, shared, stream >>>(d_idata, pos, min(pos+batch, N)); - if (IS_SCRYPT_JANE()) test_scrypt_core_kernelA <<< grid, threads, shared, stream >>>(d_idata, pos, min(pos+batch, N)); - } else { - if (IS_SCRYPT()) test_scrypt_core_kernelA_LG <<< grid, threads, shared, stream >>>(d_idata, pos, min(pos+batch, N), LOOKUP_GAP); - if (IS_SCRYPT_JANE()) test_scrypt_core_kernelA_LG <<< grid, threads, shared, stream >>>(d_idata, pos, min(pos+batch, N), LOOKUP_GAP); - } - pos += batch; - } while (pos < N); - - // Second phase: Random read access from scratchpad. - pos = 0; - do { - if (LOOKUP_GAP == 1) { - if (texture_cache == 0) { - if (IS_SCRYPT()) test_scrypt_core_kernelB<<< grid, threads, shared, stream >>>(d_odata, pos, min(pos+batch, N)); - if (IS_SCRYPT_JANE()) test_scrypt_core_kernelB<<< grid, threads, shared, stream >>>(d_odata, pos, min(pos+batch, N)); - } - else if (texture_cache == 1) { - if (IS_SCRYPT()) test_scrypt_core_kernelB<<< grid, threads, shared, stream >>>(d_odata, pos, min(pos+batch, N)); - if (IS_SCRYPT_JANE()) test_scrypt_core_kernelB<<< grid, threads, shared, stream >>>(d_odata, pos, min(pos+batch, N)); - } - else if (texture_cache == 2) { - if (IS_SCRYPT()) test_scrypt_core_kernelB<<< grid, threads, shared, stream >>>(d_odata, pos, min(pos+batch, N)); - if (IS_SCRYPT_JANE()) test_scrypt_core_kernelB<<< grid, threads, shared, stream >>>(d_odata, pos, min(pos+batch, N)); - } - } else { - if (texture_cache == 0) { - if (IS_SCRYPT()) test_scrypt_core_kernelB_LG<<< grid, threads, shared, stream >>>(d_odata, pos, min(pos+batch, N), LOOKUP_GAP); - if (IS_SCRYPT_JANE()) test_scrypt_core_kernelB_LG<<< grid, threads, shared, stream >>>(d_odata, pos, min(pos+batch, N), LOOKUP_GAP); - } - else if (texture_cache == 1) { - if (IS_SCRYPT()) test_scrypt_core_kernelB_LG<<< grid, threads, shared, stream >>>(d_odata, pos, min(pos+batch, N), LOOKUP_GAP); - if (IS_SCRYPT_JANE()) test_scrypt_core_kernelB_LG<<< grid, threads, shared, stream >>>(d_odata, pos, min(pos+batch, N), LOOKUP_GAP); - } - else if (texture_cache == 2) { - if (IS_SCRYPT()) test_scrypt_core_kernelB_LG<<< grid, threads, shared, stream >>>(d_odata, pos, min(pos+batch, N), LOOKUP_GAP); - if (IS_SCRYPT_JANE()) test_scrypt_core_kernelB_LG<<< grid, threads, shared, stream >>>(d_odata, pos, min(pos+batch, N), LOOKUP_GAP); - } - } - - pos += batch; - } while (pos < N); - - return success; -} diff --git a/scrypt/test_kernel.h b/scrypt/test_kernel.h deleted file mode 100644 index e084f72a..00000000 --- a/scrypt/test_kernel.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef TEST_KERNEL_H -#define TEST_KERNEL_H - -#include "salsa_kernel.h" - -class TestKernel : public KernelInterface -{ -public: - TestKernel(); - - virtual void set_scratchbuf_constants(int MAXWARPS, uint32_t** h_V); - virtual bool run_kernel(dim3 grid, dim3 threads, int WARPS_PER_BLOCK, int thr_id, cudaStream_t stream, uint32_t* d_idata, uint32_t* d_odata, unsigned int N, unsigned int LOOKUP_GAP, bool interactive, bool benchmark, int texture_cache); - virtual bool bindtexture_1D(uint32_t *d_V, size_t size); - virtual bool bindtexture_2D(uint32_t *d_V, int width, int height, size_t pitch); - virtual bool unbindtexture_1D(); - virtual bool unbindtexture_2D(); - - virtual char get_identifier() { return 'f'; }; - virtual int get_major_version() { return 1; }; - virtual int get_minor_version() { return 0; }; - - virtual int max_warps_per_block() { return 32; }; - virtual int get_texel_width() { return 4; }; - virtual int threads_per_wu() { return 4; } - virtual bool support_lookup_gap() { return true; } - virtual cudaSharedMemConfig shared_mem_config() { return cudaSharedMemBankSizeFourByte; } - virtual cudaFuncCache cache_config() { return cudaFuncCachePreferL1; } -}; - -#endif // #ifndef TEST_KERNEL_H diff --git a/scrypt/titan_kernel.cu b/scrypt/titan_kernel.cu deleted file mode 100644 index 17587229..00000000 --- a/scrypt/titan_kernel.cu +++ /dev/null @@ -1,753 +0,0 @@ -/* Copyright (C) 2013 David G. Andersen. All rights reserved. - * with modifications by Christian Buchner - * - * Use of this code is covered under the Apache 2.0 license, which - * can be found in the file "LICENSE" - */ - -// attempt V.Volkov style ILP (factor 4) - -#include - -#include -#include -#include "miner.h" - -#include "salsa_kernel.h" -#include "titan_kernel.h" - -#define THREADS_PER_WU 4 // four threads per hash - -typedef enum -{ - ANDERSEN, - SIMPLE -} MemoryAccess; - -#if __CUDA_ARCH__ < 320 - // Kepler (Compute 3.0) - #define __ldg(x) (*(x)) -#endif - -#if CUDA_VERSION >= 9000 && __CUDA_ARCH__ >= 300 -#define __shfl2(var, srcLane) __shfl_sync(0xFFFFFFFFu, var, srcLane) -#else -#define __shfl2 __shfl -#endif - -#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 300 - -// scratchbuf constants (pointers to scratch buffer for each warp, i.e. 32 hashes) -__constant__ uint32_t* c_V[TOTAL_WARP_LIMIT]; - -// iteration count N -__constant__ uint32_t c_N; -__constant__ uint32_t c_N_1; // N-1 -// scratch buffer size SCRATCH -__constant__ uint32_t c_SCRATCH; -__constant__ uint32_t c_SCRATCH_WU_PER_WARP; // (SCRATCH * WU_PER_WARP) -__constant__ uint32_t c_SCRATCH_WU_PER_WARP_1; // (SCRATCH * WU_PER_WARP)-1 - -template __device__ __forceinline__ void block_mixer(uint4 &b, uint4 &bx, const int x1, const int x2, const int x3); - -static __host__ __device__ uint4& operator ^= (uint4& left, const uint4& right) { - left.x ^= right.x; - left.y ^= right.y; - left.z ^= right.z; - left.w ^= right.w; - return left; -} - -static __host__ __device__ uint4& operator += (uint4& left, const uint4& right) { - left.x += right.x; - left.y += right.y; - left.z += right.z; - left.w += right.w; - return left; -} - - -static __device__ uint4 shfl4(const uint4 bx, int target_thread) { - return make_uint4( - __shfl2((int)bx.x, target_thread), __shfl2((int)bx.y, target_thread), - __shfl2((int)bx.z, target_thread), __shfl2((int)bx.w, target_thread) - ); -} - -/* write_keys writes the 8 keys being processed by a warp to the global - * scratchpad. To effectively use memory bandwidth, it performs the writes - * (and reads, for read_keys) 128 bytes at a time per memory location - * by __shfl'ing the 4 entries in bx to the threads in the next-up - * thread group. It then has eight threads together perform uint4 - * (128 bit) writes to the destination region. This seems to make - * quite effective use of memory bandwidth. An approach that spread - * uint32s across more threads was slower because of the increased - * computation it required. - * - * "start" is the loop iteration producing the write - the offset within - * the block's memory. - * - * Internally, this algorithm first __shfl's the 4 bx entries to - * the next up thread group, and then uses a conditional move to - * ensure that odd-numbered thread groups exchange the b/bx ordering - * so that the right parts are written together. - * - * Thanks to Babu for helping design the 128-bit-per-write version. - * - * _direct lets the caller specify the absolute start location instead of - * the relative start location, as an attempt to reduce some recomputation. - */ - -template __device__ __forceinline__ -void write_keys_direct(const uint4 &b, const uint4 &bx, uint32_t start) -{ - uint32_t *scratch = c_V[(blockIdx.x*blockDim.x + threadIdx.x)/32]; - if (SCHEME == ANDERSEN) { - int target_thread = (threadIdx.x + 4)&31; - uint4 t = b, t2 = shfl4(bx, target_thread); - int t2_start = __shfl2((int)start, target_thread) + 4; - bool c = (threadIdx.x & 0x4); - *((uint4 *)(&scratch[c ? t2_start : start])) = (c ? t2 : t); - *((uint4 *)(&scratch[c ? start : t2_start])) = (c ? t : t2); - } else { - *((uint4 *)(&scratch[start ])) = b; - *((uint4 *)(&scratch[start+16])) = bx; - } -} - -template __device__ __forceinline__ -void read_keys_direct(uint4 &b, uint4 &bx, uint32_t start) -{ - uint32_t *scratch = c_V[(blockIdx.x*blockDim.x + threadIdx.x)/32]; - if (SCHEME == ANDERSEN) { - int t2_start = __shfl2((int)start, (threadIdx.x + 4)&31) + 4; - bool c = (threadIdx.x & 0x4); - b = __ldg((uint4 *)(&scratch[c ? t2_start : start])); - bx = __ldg((uint4 *)(&scratch[c ? start : t2_start])); - uint4 tmp = b; b = (c ? bx : b); bx = (c ? tmp : bx); - bx = shfl4(bx, (threadIdx.x + 28)&31); - } else { - b = *((uint4 *)(&scratch[start])); - bx = *((uint4 *)(&scratch[start+16])); - } -} - -__device__ __forceinline__ -void primary_order_shuffle(uint32_t b[4], uint32_t bx[4]) { - /* Inner loop shuffle targets */ - int x1 = (threadIdx.x & 0xfc) + (((threadIdx.x & 3)+1)&3); - int x2 = (threadIdx.x & 0xfc) + (((threadIdx.x & 3)+2)&3); - int x3 = (threadIdx.x & 0xfc) + (((threadIdx.x & 3)+3)&3); - - b[3] = __shfl2((int)b[3], x1); - b[2] = __shfl2((int)b[2], x2); - b[1] = __shfl2((int)b[1], x3); - uint32_t tmp = b[1]; b[1] = b[3]; b[3] = tmp; - - bx[3] = __shfl2((int)bx[3], x1); - bx[2] = __shfl2((int)bx[2], x2); - bx[1] = __shfl2((int)bx[1], x3); - tmp = bx[1]; bx[1] = bx[3]; bx[3] = tmp; -} - -__device__ __forceinline__ -void primary_order_shuffle(uint4 &b, uint4 &bx) { - /* Inner loop shuffle targets */ - int x1 = (threadIdx.x & 0x1c) + (((threadIdx.x & 3)+1)&3); - int x2 = (threadIdx.x & 0x1c) + (((threadIdx.x & 3)+2)&3); - int x3 = (threadIdx.x & 0x1c) + (((threadIdx.x & 3)+3)&3); - - b.w = __shfl2((int)b.w, x1); - b.z = __shfl2((int)b.z, x2); - b.y = __shfl2((int)b.y, x3); - uint32_t tmp = b.y; b.y = b.w; b.w = tmp; - - bx.w = __shfl2((int)bx.w, x1); - bx.z = __shfl2((int)bx.z, x2); - bx.y = __shfl2((int)bx.y, x3); - tmp = bx.y; bx.y = bx.w; bx.w = tmp; -} - -/* - * load_key loads a 32*32bit key from a contiguous region of memory in B. - * The input keys are in external order (i.e., 0, 1, 2, 3, ...). - * After loading, each thread has its four b and four bx keys stored - * in internal processing order. - */ -__device__ __forceinline__ -void load_key_salsa(const uint32_t *B, uint4 &b, uint4 &bx) -{ - uint32_t scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - uint32_t thread_in_block = threadIdx.x & 3U; - uint32_t key_offset = scrypt_block * 32 + (thread_in_block*4); - - // Read in permuted order. Key loads are not our bottleneck right now. - b.x = B[key_offset + (thread_in_block+0) & 3U]; - b.y = B[key_offset + (thread_in_block+1) & 3U]; - b.z = B[key_offset + (thread_in_block+2) & 3U]; - b.w = B[key_offset + (thread_in_block+3) & 3U]; - - key_offset += 16; - bx.x = B[key_offset + (thread_in_block+0) & 3U]; - bx.y = B[key_offset + (thread_in_block+1) & 3U]; - bx.z = B[key_offset + (thread_in_block+2) & 3U]; - bx.w = B[key_offset + (thread_in_block+3) & 3U]; - - primary_order_shuffle(b, bx); -} - -/* - * store_key performs the opposite transform as load_key, taking - * internally-ordered b and bx and storing them into a contiguous - * region of B in external order. - */ -__device__ __forceinline__ -void store_key_salsa(uint32_t *B, uint4 &b, uint4 &bx) -{ - uint32_t scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - uint32_t thread_in_block = threadIdx.x & 3U; - uint32_t key_offset = scrypt_block * 32 + (thread_in_block*4); - - primary_order_shuffle(b, bx); - - B[key_offset + (thread_in_block+0) & 3U] = b.x; - B[key_offset + (thread_in_block+1) & 3U] = b.y; - B[key_offset + (thread_in_block+2) & 3U] = b.z; - B[key_offset + (thread_in_block+3) & 3U] = b.w; - - key_offset += 16; - B[key_offset + (thread_in_block+0) & 3U] = bx.x; - B[key_offset + (thread_in_block+1) & 3U] = bx.y; - B[key_offset + (thread_in_block+2) & 3U] = bx.z; - B[key_offset + (thread_in_block+3) & 3U] = bx.w; -} - - -/* - * load_key loads a 32*32bit key from a contiguous region of memory in B. - * The input keys are in external order (i.e., 0, 1, 2, 3, ...). - * After loading, each thread has its four b and four bx keys stored - * in internal processing order. - */ -__device__ __forceinline__ -void load_key_chacha(const uint32_t *B, uint4 &b, uint4 &bx) -{ - uint32_t scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - uint32_t thread_in_block = threadIdx.x & 3U; - uint32_t key_offset = scrypt_block * 32 + thread_in_block; - - // Read in permuted order. Key loads are not our bottleneck right now. - b.x = B[key_offset ]; - b.y = B[key_offset + 4*1]; - b.z = B[key_offset + 4*2]; - b.w = B[key_offset + 4*3]; - - key_offset += 16; - bx.x = B[key_offset ]; - bx.y = B[key_offset + 4 ]; - bx.z = B[key_offset + 4*2]; - bx.w = B[key_offset + 4*3]; -} - -/* - * store_key performs the opposite transform as load_key, taking - * internally-ordered b and bx and storing them into a contiguous - * region of B in external order. - */ -__device__ __forceinline__ -void store_key_chacha(uint32_t *B, const uint4 &b, const uint4 &bx) -{ - uint32_t scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - uint32_t thread_in_block = threadIdx.x & 3U; - uint32_t key_offset = scrypt_block * 32U + thread_in_block; - - B[key_offset ] = b.x; - B[key_offset + 4 ] = b.y; - B[key_offset + 4*2] = b.z; - B[key_offset + 4*3] = b.w; - - key_offset += 16; - B[key_offset ] = bx.x; - B[key_offset + 4 ] = bx.y; - B[key_offset + 4*2] = bx.z; - B[key_offset + 4*3] = bx.w; -} - - -template __device__ __forceinline__ -void load_key(const uint32_t *B, uint4 &b, uint4 &bx) -{ - switch(ALGO) { - case A_SCRYPT: load_key_salsa(B, b, bx); break; - case A_SCRYPT_JANE: load_key_chacha(B, b, bx); break; - } -} - -template __device__ __forceinline__ -void store_key(uint32_t *B, uint4 &b, uint4 &bx) -{ - switch(ALGO) { - case A_SCRYPT: store_key_salsa(B, b, bx); break; - case A_SCRYPT_JANE: store_key_chacha(B, b, bx); break; - } -} - - -/* - * salsa_xor_core (Salsa20/8 cypher) - * The original scrypt called: - * xor_salsa8(&X[0], &X[16]); <-- the "b" loop - * xor_salsa8(&X[16], &X[0]); <-- the "bx" loop - * This version is unrolled to handle both of these loops in a single - * call to avoid unnecessary data movement. - */ - -#if __CUDA_ARCH__ < 350 - // Kepler (Compute 3.0) - #define XOR_ROTATE_ADD(dst, s1, s2, amt) { uint32_t tmp = s1+s2; dst ^= ((tmp<>(32-amt))); } -#else - // Kepler (Compute 3.5) - #define ROTL(a, b) __funnelshift_l( a, a, b ); - #define XOR_ROTATE_ADD(dst, s1, s2, amt) dst ^= ROTL(s1+s2, amt); -#endif - - -__device__ __forceinline__ -void salsa_xor_core(uint4 &b, uint4 &bx, const int x1, const int x2, const int x3) -{ - uint4 x; - - b ^= bx; - x = b; - - // Enter in "primary order" (t0 has 0, 4, 8, 12) - // (t1 has 5, 9, 13, 1) - // (t2 has 10, 14, 2, 6) - // (t3 has 15, 3, 7, 11) - - #pragma unroll - for (int j = 0; j < 4; j++) - { - // Mixing phase of salsa - XOR_ROTATE_ADD(x.y, x.x, x.w, 7); - XOR_ROTATE_ADD(x.z, x.y, x.x, 9); - XOR_ROTATE_ADD(x.w, x.z, x.y, 13); - XOR_ROTATE_ADD(x.x, x.w, x.z, 18); - - /* Transpose rows and columns. */ - /* Unclear if this optimization is needed: These are ordered based - * upon the dependencies needed in the later xors. Compiler should be - * able to figure this out, but might as well give it a hand. */ - x.y = __shfl2((int)x.y, x3); - x.w = __shfl2((int)x.w, x1); - x.z = __shfl2((int)x.z, x2); - - /* The next XOR_ROTATE_ADDS could be written to be a copy-paste of the first, - * but the register targets are rewritten here to swap x[1] and x[3] so that - * they can be directly shuffled to and from our peer threads without - * reassignment. The reverse shuffle then puts them back in the right place. - */ - - XOR_ROTATE_ADD(x.w, x.x, x.y, 7); - XOR_ROTATE_ADD(x.z, x.w, x.x, 9); - XOR_ROTATE_ADD(x.y, x.z, x.w, 13); - XOR_ROTATE_ADD(x.x, x.y, x.z, 18); - - x.w = __shfl2((int)x.w, x3); - x.y = __shfl2((int)x.y, x1); - x.z = __shfl2((int)x.z, x2); - } - - b += x; - // The next two lines are the beginning of the BX-centric loop iteration - bx ^= b; - x = bx; - - // This is a copy of the same loop above, identical but stripped of comments. - // Duplicated so that we can complete a bx-based loop with fewer register moves. - #pragma unroll 4 - for (int j = 0; j < 4; j++) - { - XOR_ROTATE_ADD(x.y, x.x, x.w, 7); - XOR_ROTATE_ADD(x.z, x.y, x.x, 9); - XOR_ROTATE_ADD(x.w, x.z, x.y, 13); - XOR_ROTATE_ADD(x.x, x.w, x.z, 18); - - x.y = __shfl2((int)x.y, x3); - x.w = __shfl2((int)x.w, x1); - x.z = __shfl2((int)x.z, x2); - - XOR_ROTATE_ADD(x.w, x.x, x.y, 7); - XOR_ROTATE_ADD(x.z, x.w, x.x, 9); - XOR_ROTATE_ADD(x.y, x.z, x.w, 13); - XOR_ROTATE_ADD(x.x, x.y, x.z, 18); - - x.w = __shfl2((int)x.w, x3); - x.y = __shfl2((int)x.y, x1); - x.z = __shfl2((int)x.z, x2); - } - - // At the end of these iterations, the data is in primary order again. -#undef XOR_ROTATE_ADD - - bx += x; -} - - -/* - * chacha_xor_core (ChaCha20/8 cypher) - * This version is unrolled to handle both of these loops in a single - * call to avoid unnecessary data movement. - * - * load_key and store_key must not use primary order when - * using ChaCha20/8, but rather the basic transposed order - * (referred to as "column mode" below) - */ - -#if __CUDA_ARCH__ < 320 - // Kepler (Compute 3.0) - #define CHACHA_PRIMITIVE(pt, rt, ps, amt) { uint32_t tmp = rt ^ (pt += ps); rt = ((tmp<>(32-amt))); } -#else - // Kepler (Compute 3.5) - #define ROTL(a, b) __funnelshift_l( a, a, b ); - #define CHACHA_PRIMITIVE(pt, rt, ps, amt) { pt += ps; rt = ROTL(rt ^ pt,amt); } -#endif - -__device__ __forceinline__ -void chacha_xor_core(uint4 &b, uint4 &bx, const int x1, const int x2, const int x3) -{ - uint4 x = b ^= bx; - - //b ^= bx; - //x = b; - - // Enter in "column" mode (t0 has 0, 4, 8, 12) - // (t1 has 1, 5, 9, 13) - // (t2 has 2, 6, 10, 14) - // (t3 has 3, 7, 11, 15) - - //#pragma unroll - for (int j = 0; j < 4; j++) { - - // Column Mixing phase of chacha - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 16) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 12) - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 8) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 7) - - x.y = __shfl2((int)x.y, x1); - x.z = __shfl2((int)x.z, x2); - x.w = __shfl2((int)x.w, x3); - - // Diagonal Mixing phase of chacha - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 16) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 12) - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 8) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 7) - - x.y = __shfl2((int)x.y, x3); - x.z = __shfl2((int)x.z, x2); - x.w = __shfl2((int)x.w, x1); - } - - b += x; - // The next two lines are the beginning of the BX-centric loop iteration - bx ^= b; - x = bx; - - //#pragma unroll - for (int j = 0; j < 4; j++) - { - - // Column Mixing phase of chacha - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 16) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 12) - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 8) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 7) - - x.y = __shfl2((int)x.y, x1); - x.z = __shfl2((int)x.z, x2); - x.w = __shfl2((int)x.w, x3); - - // Diagonal Mixing phase of chacha - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 16) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 12) - CHACHA_PRIMITIVE(x.x ,x.w, x.y, 8) - CHACHA_PRIMITIVE(x.z ,x.y, x.w, 7) - - x.y = __shfl2((int)x.y, x3); - x.z = __shfl2((int)x.z, x2); - x.w = __shfl2((int)x.w, x1); - } - -#undef CHACHA_PRIMITIVE - - bx += x; -} - - -template __device__ __forceinline__ -void block_mixer(uint4 &b, uint4 &bx, const int x1, const int x2, const int x3) -{ - switch(ALGO) { - case A_SCRYPT: salsa_xor_core(b, bx, x1, x2, x3); break; - case A_SCRYPT_JANE: chacha_xor_core(b, bx, x1, x2, x3); break; - } -} - - -/* - * The hasher_gen_kernel operates on a group of 1024-bit input keys - * in B, stored as: - * B = { k1B k1Bx k2B k2Bx ... } - * and fills up the scratchpad with the iterative hashes derived from - * those keys: - * scratch { k1h1B k1h1Bx K1h2B K1h2Bx ... K2h1B K2h1Bx K2h2B K2h2Bx ... } - * scratch is 1024 times larger than the input keys B. - * It is extremely important to stream writes effectively into scratch; - * less important to coalesce the reads from B. - * - * Key ordering note: Keys are input from B in "original" order: - * K = {k1, k2, k3, k4, k5, ..., kx15, kx16, kx17, ..., kx31 } - * After inputting into kernel_gen, each component k and kx of the - * key is transmuted into a permuted internal order to make processing faster: - * K = k, kx with: - * k = 0, 4, 8, 12, 5, 9, 13, 1, 10, 14, 2, 6, 15, 3, 7, 11 - * and similarly for kx. - */ - -template __global__ -void titan_scrypt_core_kernelA(const uint32_t *d_idata, int begin, int end) -{ - uint4 b, bx; - - int x1 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+1)&0x3); - int x2 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+2)&0x3); - int x3 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+3)&0x3); - - int scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - int start = (scrypt_block*c_SCRATCH + (SCHEME==ANDERSEN?8:4)*(threadIdx.x%4)) % c_SCRATCH_WU_PER_WARP; - - int i=begin; - - if (i == 0) { - load_key(d_idata, b, bx); - write_keys_direct(b, bx, start); - ++i; - } else read_keys_direct(b, bx, start+32*(i-1)); - - while (i < end) { - block_mixer(b, bx, x1, x2, x3); - write_keys_direct(b, bx, start+32*i); - ++i; - } -} - -template __global__ -void titan_scrypt_core_kernelA_LG(const uint32_t *d_idata, int begin, int end, unsigned int LOOKUP_GAP) -{ - uint4 b, bx; - - int x1 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+1)&0x3); - int x2 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+2)&0x3); - int x3 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+3)&0x3); - - int scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - int start = (scrypt_block*c_SCRATCH + (SCHEME==ANDERSEN?8:4)*(threadIdx.x%4)) % c_SCRATCH_WU_PER_WARP; - - int i=begin; - - if (i == 0) { - load_key(d_idata, b, bx); - write_keys_direct(b, bx, start); - ++i; - } else { - int pos = (i-1)/LOOKUP_GAP, loop = (i-1)-pos*LOOKUP_GAP; - read_keys_direct(b, bx, start+32*pos); - while(loop--) block_mixer(b, bx, x1, x2, x3); - } - - while (i < end) { - block_mixer(b, bx, x1, x2, x3); - if (i % LOOKUP_GAP == 0) - write_keys_direct(b, bx, start+32*(i/LOOKUP_GAP)); - ++i; - } -} - - -/* - * hasher_hash_kernel runs the second phase of scrypt after the scratch - * buffer is filled with the iterative hashes: It bounces through - * the scratch buffer in pseudorandom order, mixing the key as it goes. - */ - -template __global__ -void titan_scrypt_core_kernelB(uint32_t *d_odata, int begin, int end) -{ - uint4 b, bx; - - int scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - int start = ((scrypt_block*c_SCRATCH) + (SCHEME==ANDERSEN?8:4)*(threadIdx.x%4)) % c_SCRATCH_WU_PER_WARP; - - int x1 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+1)&0x3); - int x2 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+2)&0x3); - int x3 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+3)&0x3); - - if (begin == 0) { - read_keys_direct(b, bx, start+32*c_N_1); - block_mixer(b, bx, x1, x2, x3); - } else load_key(d_odata, b, bx); - - for (int i = begin; i < end; i++) { - int j = (__shfl2((int)bx.x, (threadIdx.x & 0x1c)) & (c_N_1)); - uint4 t, tx; read_keys_direct(t, tx, start+32*j); - b ^= t; bx ^= tx; - block_mixer(b, bx, x1, x2, x3); - } - - store_key(d_odata, b, bx); -} - -template __global__ -void titan_scrypt_core_kernelB_LG(uint32_t *d_odata, int begin, int end, unsigned int LOOKUP_GAP) -{ - uint4 b, bx; - - int scrypt_block = (blockIdx.x*blockDim.x + threadIdx.x)/THREADS_PER_WU; - int start = ((scrypt_block*c_SCRATCH) + (SCHEME==ANDERSEN?8:4)*(threadIdx.x%4)) % c_SCRATCH_WU_PER_WARP; - - int x1 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+1)&0x3); - int x2 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+2)&0x3); - int x3 = (threadIdx.x & 0x1c) + (((threadIdx.x & 0x03)+3)&0x3); - - if (begin == 0) { - int pos = c_N_1/LOOKUP_GAP, loop = 1 + (c_N_1-pos*LOOKUP_GAP); - read_keys_direct(b, bx, start+32*pos); - while(loop--) - block_mixer(b, bx, x1, x2, x3); - } - else - load_key(d_odata, b, bx); - - if (SCHEME == SIMPLE) - { - // better divergent thread handling submitted by nVidia engineers, but - // supposedly this does not run with the ANDERSEN memory access scheme - int j = (__shfl2((int)bx.x, (threadIdx.x & 0x1c)) & (c_N_1)); - int pos = j/LOOKUP_GAP; - int loop = -1; - uint4 t, tx; - - int i = begin; - while(i < end) - { - if (loop == -1) { - j = (__shfl2((int)bx.x, (threadIdx.x & 0x1c)) & (c_N_1)); - pos = j/LOOKUP_GAP; - loop = j-pos*LOOKUP_GAP; - read_keys_direct(t, tx, start+32*pos); - } - if (loop == 0) { - b ^= t; bx ^= tx; - t=b;tx=bx; - } - - block_mixer(t, tx, x1, x2, x3); - if (loop == 0) { - b=t;bx=tx; - i++; - } - loop--; - } - } - else - { - // this is my original implementation, now used with the ANDERSEN - // memory access scheme only. - for (int i = begin; i < end; i++) { - int j = (__shfl2((int)bx.x, (threadIdx.x & 0x1c)) & (c_N_1)); - int pos = j/LOOKUP_GAP, loop = j-pos*LOOKUP_GAP; - uint4 t, tx; read_keys_direct(t, tx, start+32*pos); - while (loop--) - block_mixer(t, tx, x1, x2, x3); - b ^= t; bx ^= tx; - block_mixer(b, bx, x1, x2, x3); - } - } - - store_key(d_odata, b, bx); -} - - -TitanKernel::TitanKernel() : KernelInterface() -{ -} - -void TitanKernel::set_scratchbuf_constants(int MAXWARPS, uint32_t** h_V) -{ - checkCudaErrors(cudaMemcpyToSymbol(c_V, h_V, MAXWARPS*sizeof(uint32_t*), 0, cudaMemcpyHostToDevice)); -} - -bool TitanKernel::run_kernel(dim3 grid, dim3 threads, int WARPS_PER_BLOCK, int thr_id, cudaStream_t stream, - uint32_t* d_idata, uint32_t* d_odata, unsigned int N, unsigned int LOOKUP_GAP, bool interactive, bool benchmark, int texture_cache) -{ - bool success = true; - bool scrypt = IS_SCRYPT(); - bool chacha = IS_SCRYPT_JANE(); - - // make some constants available to kernel, update only initially and when changing - static uint32_t prev_N[MAX_GPUS] = { 0 }; - - if (N != prev_N[thr_id]) { - uint32_t h_N = N; - uint32_t h_N_1 = N-1; - uint32_t h_SCRATCH = SCRATCH; - uint32_t h_SCRATCH_WU_PER_WARP = (SCRATCH * WU_PER_WARP); - uint32_t h_SCRATCH_WU_PER_WARP_1 = (SCRATCH * WU_PER_WARP) - 1; - - cudaMemcpyToSymbolAsync(c_N, &h_N, sizeof(uint32_t), 0, cudaMemcpyHostToDevice, stream); - cudaMemcpyToSymbolAsync(c_N_1, &h_N_1, sizeof(uint32_t), 0, cudaMemcpyHostToDevice, stream); - cudaMemcpyToSymbolAsync(c_SCRATCH, &h_SCRATCH, sizeof(uint32_t), 0, cudaMemcpyHostToDevice, stream); - cudaMemcpyToSymbolAsync(c_SCRATCH_WU_PER_WARP, &h_SCRATCH_WU_PER_WARP, sizeof(uint32_t), 0, cudaMemcpyHostToDevice, stream); - cudaMemcpyToSymbolAsync(c_SCRATCH_WU_PER_WARP_1, &h_SCRATCH_WU_PER_WARP_1, sizeof(uint32_t), 0, cudaMemcpyHostToDevice, stream); - - prev_N[thr_id] = N; - } - - // First phase: Sequential writes to scratchpad. - - int batch = device_batchsize[thr_id]; - - unsigned int pos = 0; - do { - if (LOOKUP_GAP == 1) { - if (scrypt) titan_scrypt_core_kernelA <<< grid, threads, 0, stream >>>(d_idata, pos, min(pos+batch, N)); - if (chacha) titan_scrypt_core_kernelA <<< grid, threads, 0, stream >>>(d_idata, pos, min(pos+batch, N)); - } else { - if (scrypt) titan_scrypt_core_kernelA_LG <<< grid, threads, 0, stream >>>(d_idata, pos, min(pos+batch, N), LOOKUP_GAP); - if (chacha) titan_scrypt_core_kernelA_LG <<< grid, threads, 0, stream >>>(d_idata, pos, min(pos+batch, N), LOOKUP_GAP); - } - pos += batch; - - } while (pos < N); - - // Second phase: Random read access from scratchpad. - - pos = 0; - do { - if (LOOKUP_GAP == 1) { - if (scrypt) titan_scrypt_core_kernelB <<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N)); - if (chacha) titan_scrypt_core_kernelB <<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N)); - } else { - if (scrypt) titan_scrypt_core_kernelB_LG <<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N), LOOKUP_GAP); - if (chacha) titan_scrypt_core_kernelB_LG <<< grid, threads, 0, stream >>>(d_odata, pos, min(pos+batch, N), LOOKUP_GAP); - } - pos += batch; - - } while (pos < N); - - return success; -} - -#endif /* prevent SM 2 */ diff --git a/scrypt/titan_kernel.h b/scrypt/titan_kernel.h deleted file mode 100644 index 720b9a3a..00000000 --- a/scrypt/titan_kernel.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef TITAN_KERNEL_H -#define TITAN_KERNEL_H - -#include "salsa_kernel.h" - -class TitanKernel : public KernelInterface -{ -public: - TitanKernel(); - - virtual void set_scratchbuf_constants(int MAXWARPS, uint32_t** h_V); - virtual bool run_kernel(dim3 grid, dim3 threads, int WARPS_PER_BLOCK, int thr_id, cudaStream_t stream, uint32_t* d_idata, uint32_t* d_odata, unsigned int N, unsigned int LOOKUP_GAP, bool interactive, bool benchmark, int texture_cache); - - virtual char get_identifier() { return 't'; } - virtual int get_major_version() { return 3; } - virtual int get_minor_version() { return 5; } - - virtual int max_warps_per_block() { return 32; } - virtual int get_texel_width() { return 4; } - virtual bool no_textures() { return true; } - virtual int threads_per_wu() { return 4; } - virtual bool support_lookup_gap() { return true; } - virtual cudaFuncCache cache_config() { return cudaFuncCachePreferL1; } -}; - -#endif // #ifndef TITAN_KERNEL_H diff --git a/sha256/cuda_sha256t.cu b/sha256/cuda_sha256t.cu deleted file mode 100644 index 95689947..00000000 --- a/sha256/cuda_sha256t.cu +++ /dev/null @@ -1,491 +0,0 @@ -/* - * sha256(-t) CUDA implementation. - * tpruvot 2017 - */ - -#include -#include -#include - -#include -#include - -__constant__ static uint32_t __align__(8) c_midstate76[8]; -__constant__ static uint32_t __align__(8) c_dataEnd80[4]; - -const __constant__ uint32_t __align__(8) c_H256[8] = { - 0x6A09E667U, 0xBB67AE85U, 0x3C6EF372U, 0xA54FF53AU, - 0x510E527FU, 0x9B05688CU, 0x1F83D9ABU, 0x5BE0CD19U -}; -__constant__ static uint32_t __align__(8) c_K[64]; -__constant__ static uint32_t __align__(8) c_target[2]; -__device__ uint64_t d_target[1]; - -static uint32_t* d_resNonces[MAX_GPUS] = { 0 }; - -// ------------------------------------------------------------------------------------------------ - -static const uint32_t cpu_H256[8] = { - 0x6A09E667U, 0xBB67AE85U, 0x3C6EF372U, 0xA54FF53AU, - 0x510E527FU, 0x9B05688CU, 0x1F83D9ABU, 0x5BE0CD19U -}; - -static const uint32_t cpu_K[64] = { - 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, - 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, - 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC, 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, - 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967, - 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, - 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, - 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, - 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2 -}; - -#define ROTR ROTR32 - -__host__ -static void sha256_step1_host(uint32_t a, uint32_t b, uint32_t c, uint32_t &d, - uint32_t e, uint32_t f, uint32_t g, uint32_t &h, - uint32_t in, const uint32_t Kshared) -{ - uint32_t t1,t2; - uint32_t vxandx = (((f) ^ (g)) & (e)) ^ (g); // xandx(e, f, g); - uint32_t bsg21 = ROTR(e, 6) ^ ROTR(e, 11) ^ ROTR(e, 25); // bsg2_1(e); - uint32_t bsg20 = ROTR(a, 2) ^ ROTR(a, 13) ^ ROTR(a, 22); //bsg2_0(a); - uint32_t andorv = ((b) & (c)) | (((b) | (c)) & (a)); //andor32(a,b,c); - - t1 = h + bsg21 + vxandx + Kshared + in; - t2 = bsg20 + andorv; - d = d + t1; - h = t1 + t2; -} - -__host__ -static void sha256_step2_host(uint32_t a, uint32_t b, uint32_t c, uint32_t &d, - uint32_t e, uint32_t f, uint32_t g, uint32_t &h, - uint32_t* in, uint32_t pc, const uint32_t Kshared) -{ - uint32_t t1,t2; - - int pcidx1 = (pc-2) & 0xF; - int pcidx2 = (pc-7) & 0xF; - int pcidx3 = (pc-15) & 0xF; - - uint32_t inx0 = in[pc]; - uint32_t inx1 = in[pcidx1]; - uint32_t inx2 = in[pcidx2]; - uint32_t inx3 = in[pcidx3]; - - uint32_t ssg21 = ROTR(inx1, 17) ^ ROTR(inx1, 19) ^ SPH_T32((inx1) >> 10); //ssg2_1(inx1); - uint32_t ssg20 = ROTR(inx3, 7) ^ ROTR(inx3, 18) ^ SPH_T32((inx3) >> 3); //ssg2_0(inx3); - uint32_t vxandx = (((f) ^ (g)) & (e)) ^ (g); // xandx(e, f, g); - uint32_t bsg21 = ROTR(e, 6) ^ ROTR(e, 11) ^ ROTR(e, 25); // bsg2_1(e); - uint32_t bsg20 = ROTR(a, 2) ^ ROTR(a, 13) ^ ROTR(a, 22); //bsg2_0(a); - uint32_t andorv = ((b) & (c)) | (((b) | (c)) & (a)); //andor32(a,b,c); - - in[pc] = ssg21 + inx2 + ssg20 + inx0; - - t1 = h + bsg21 + vxandx + Kshared + in[pc]; - t2 = bsg20 + andorv; - d = d + t1; - h = t1 + t2; -} - -__host__ -static void sha256_round_body_host(uint32_t* in, uint32_t* state, const uint32_t* Kshared) -{ - uint32_t a = state[0]; - uint32_t b = state[1]; - uint32_t c = state[2]; - uint32_t d = state[3]; - uint32_t e = state[4]; - uint32_t f = state[5]; - uint32_t g = state[6]; - uint32_t h = state[7]; - - sha256_step1_host(a,b,c,d,e,f,g,h,in[ 0], Kshared[ 0]); - sha256_step1_host(h,a,b,c,d,e,f,g,in[ 1], Kshared[ 1]); - sha256_step1_host(g,h,a,b,c,d,e,f,in[ 2], Kshared[ 2]); - sha256_step1_host(f,g,h,a,b,c,d,e,in[ 3], Kshared[ 3]); - sha256_step1_host(e,f,g,h,a,b,c,d,in[ 4], Kshared[ 4]); - sha256_step1_host(d,e,f,g,h,a,b,c,in[ 5], Kshared[ 5]); - sha256_step1_host(c,d,e,f,g,h,a,b,in[ 6], Kshared[ 6]); - sha256_step1_host(b,c,d,e,f,g,h,a,in[ 7], Kshared[ 7]); - sha256_step1_host(a,b,c,d,e,f,g,h,in[ 8], Kshared[ 8]); - sha256_step1_host(h,a,b,c,d,e,f,g,in[ 9], Kshared[ 9]); - sha256_step1_host(g,h,a,b,c,d,e,f,in[10], Kshared[10]); - sha256_step1_host(f,g,h,a,b,c,d,e,in[11], Kshared[11]); - sha256_step1_host(e,f,g,h,a,b,c,d,in[12], Kshared[12]); - sha256_step1_host(d,e,f,g,h,a,b,c,in[13], Kshared[13]); - sha256_step1_host(c,d,e,f,g,h,a,b,in[14], Kshared[14]); - sha256_step1_host(b,c,d,e,f,g,h,a,in[15], Kshared[15]); - - for (int i=0; i<3; i++) - { - sha256_step2_host(a,b,c,d,e,f,g,h,in,0, Kshared[16+16*i]); - sha256_step2_host(h,a,b,c,d,e,f,g,in,1, Kshared[17+16*i]); - sha256_step2_host(g,h,a,b,c,d,e,f,in,2, Kshared[18+16*i]); - sha256_step2_host(f,g,h,a,b,c,d,e,in,3, Kshared[19+16*i]); - sha256_step2_host(e,f,g,h,a,b,c,d,in,4, Kshared[20+16*i]); - sha256_step2_host(d,e,f,g,h,a,b,c,in,5, Kshared[21+16*i]); - sha256_step2_host(c,d,e,f,g,h,a,b,in,6, Kshared[22+16*i]); - sha256_step2_host(b,c,d,e,f,g,h,a,in,7, Kshared[23+16*i]); - sha256_step2_host(a,b,c,d,e,f,g,h,in,8, Kshared[24+16*i]); - sha256_step2_host(h,a,b,c,d,e,f,g,in,9, Kshared[25+16*i]); - sha256_step2_host(g,h,a,b,c,d,e,f,in,10,Kshared[26+16*i]); - sha256_step2_host(f,g,h,a,b,c,d,e,in,11,Kshared[27+16*i]); - sha256_step2_host(e,f,g,h,a,b,c,d,in,12,Kshared[28+16*i]); - sha256_step2_host(d,e,f,g,h,a,b,c,in,13,Kshared[29+16*i]); - sha256_step2_host(c,d,e,f,g,h,a,b,in,14,Kshared[30+16*i]); - sha256_step2_host(b,c,d,e,f,g,h,a,in,15,Kshared[31+16*i]); - } - - state[0] += a; - state[1] += b; - state[2] += c; - state[3] += d; - state[4] += e; - state[5] += f; - state[6] += g; - state[7] += h; -} - -#define xor3b(a,b,c) (a ^ b ^ c) - -__device__ __forceinline__ uint32_t bsg2_0(const uint32_t x) -{ - return xor3b(ROTR32(x,2),ROTR32(x,13),ROTR32(x,22)); -} - -__device__ __forceinline__ uint32_t bsg2_1(const uint32_t x) -{ - return xor3b(ROTR32(x,6),ROTR32(x,11),ROTR32(x,25)); -} - -__device__ __forceinline__ uint32_t ssg2_0(const uint32_t x) -{ - return xor3b(ROTR32(x,7),ROTR32(x,18),(x>>3)); -} - -__device__ __forceinline__ uint32_t ssg2_1(const uint32_t x) -{ - return xor3b(ROTR32(x,17),ROTR32(x,19),(x>>10)); -} - -__device__ __forceinline__ uint32_t andor32(const uint32_t a, const uint32_t b, const uint32_t c) -{ - uint32_t result; - asm("{\n\t" - ".reg .u32 m,n,o;\n\t" - "and.b32 m, %1, %2;\n\t" - " or.b32 n, %1, %2;\n\t" - "and.b32 o, n, %3;\n\t" - " or.b32 %0, m, o ;\n\t" - "}\n\t" : "=r"(result) : "r"(a), "r"(b), "r"(c) - ); - return result; -} - -__device__ __forceinline__ uint2 vectorizeswap(uint64_t v) { - uint2 result; - asm("mov.b64 {%0,%1},%2; \n\t" - : "=r"(result.y), "=r"(result.x) : "l"(v)); - return result; -} - -__device__ -static void sha2_step1(uint32_t a, uint32_t b, uint32_t c, uint32_t &d, uint32_t e, uint32_t f, uint32_t g, uint32_t &h, - uint32_t in, const uint32_t Kshared) -{ - uint32_t t1,t2; - uint32_t vxandx = xandx(e, f, g); - uint32_t bsg21 = bsg2_1(e); - uint32_t bsg20 = bsg2_0(a); - uint32_t andorv = andor32(a,b,c); - - t1 = h + bsg21 + vxandx + Kshared + in; - t2 = bsg20 + andorv; - d = d + t1; - h = t1 + t2; -} - -__device__ -static void sha2_step2(uint32_t a, uint32_t b, uint32_t c, uint32_t &d, uint32_t e, uint32_t f, uint32_t g, uint32_t &h, - uint32_t* in, uint32_t pc, const uint32_t Kshared) -{ - uint32_t t1,t2; - - int pcidx1 = (pc-2) & 0xF; - int pcidx2 = (pc-7) & 0xF; - int pcidx3 = (pc-15) & 0xF; - - uint32_t inx0 = in[pc]; - uint32_t inx1 = in[pcidx1]; - uint32_t inx2 = in[pcidx2]; - uint32_t inx3 = in[pcidx3]; - - uint32_t ssg21 = ssg2_1(inx1); - uint32_t ssg20 = ssg2_0(inx3); - uint32_t vxandx = xandx(e, f, g); - uint32_t bsg21 = bsg2_1(e); - uint32_t bsg20 = bsg2_0(a); - uint32_t andorv = andor32(a,b,c); - - in[pc] = ssg21 + inx2 + ssg20 + inx0; - - t1 = h + bsg21 + vxandx + Kshared + in[pc]; - t2 = bsg20 + andorv; - d = d + t1; - h = t1 + t2; -} - -__device__ -static void sha256_round_body(uint32_t* in, uint32_t* state, uint32_t* const Kshared) -{ - uint32_t a = state[0]; - uint32_t b = state[1]; - uint32_t c = state[2]; - uint32_t d = state[3]; - uint32_t e = state[4]; - uint32_t f = state[5]; - uint32_t g = state[6]; - uint32_t h = state[7]; - - sha2_step1(a,b,c,d,e,f,g,h,in[ 0], Kshared[ 0]); - sha2_step1(h,a,b,c,d,e,f,g,in[ 1], Kshared[ 1]); - sha2_step1(g,h,a,b,c,d,e,f,in[ 2], Kshared[ 2]); - sha2_step1(f,g,h,a,b,c,d,e,in[ 3], Kshared[ 3]); - sha2_step1(e,f,g,h,a,b,c,d,in[ 4], Kshared[ 4]); - sha2_step1(d,e,f,g,h,a,b,c,in[ 5], Kshared[ 5]); - sha2_step1(c,d,e,f,g,h,a,b,in[ 6], Kshared[ 6]); - sha2_step1(b,c,d,e,f,g,h,a,in[ 7], Kshared[ 7]); - sha2_step1(a,b,c,d,e,f,g,h,in[ 8], Kshared[ 8]); - sha2_step1(h,a,b,c,d,e,f,g,in[ 9], Kshared[ 9]); - sha2_step1(g,h,a,b,c,d,e,f,in[10], Kshared[10]); - sha2_step1(f,g,h,a,b,c,d,e,in[11], Kshared[11]); - sha2_step1(e,f,g,h,a,b,c,d,in[12], Kshared[12]); - sha2_step1(d,e,f,g,h,a,b,c,in[13], Kshared[13]); - sha2_step1(c,d,e,f,g,h,a,b,in[14], Kshared[14]); - sha2_step1(b,c,d,e,f,g,h,a,in[15], Kshared[15]); - - #pragma unroll - for (int i=0; i<3; i++) - { - sha2_step2(a,b,c,d,e,f,g,h,in,0, Kshared[16+16*i]); - sha2_step2(h,a,b,c,d,e,f,g,in,1, Kshared[17+16*i]); - sha2_step2(g,h,a,b,c,d,e,f,in,2, Kshared[18+16*i]); - sha2_step2(f,g,h,a,b,c,d,e,in,3, Kshared[19+16*i]); - sha2_step2(e,f,g,h,a,b,c,d,in,4, Kshared[20+16*i]); - sha2_step2(d,e,f,g,h,a,b,c,in,5, Kshared[21+16*i]); - sha2_step2(c,d,e,f,g,h,a,b,in,6, Kshared[22+16*i]); - sha2_step2(b,c,d,e,f,g,h,a,in,7, Kshared[23+16*i]); - sha2_step2(a,b,c,d,e,f,g,h,in,8, Kshared[24+16*i]); - sha2_step2(h,a,b,c,d,e,f,g,in,9, Kshared[25+16*i]); - sha2_step2(g,h,a,b,c,d,e,f,in,10,Kshared[26+16*i]); - sha2_step2(f,g,h,a,b,c,d,e,in,11,Kshared[27+16*i]); - sha2_step2(e,f,g,h,a,b,c,d,in,12,Kshared[28+16*i]); - sha2_step2(d,e,f,g,h,a,b,c,in,13,Kshared[29+16*i]); - sha2_step2(c,d,e,f,g,h,a,b,in,14,Kshared[30+16*i]); - sha2_step2(b,c,d,e,f,g,h,a,in,15,Kshared[31+16*i]); - } - - state[0] += a; - state[1] += b; - state[2] += c; - state[3] += d; - state[4] += e; - state[5] += f; - state[6] += g; - state[7] += h; -} - -__device__ -static void sha256_round_last(uint32_t* in, uint32_t* state, uint32_t* const Kshared) -{ - uint32_t a = state[0]; - uint32_t b = state[1]; - uint32_t c = state[2]; - uint32_t d = state[3]; - uint32_t e = state[4]; - uint32_t f = state[5]; - uint32_t g = state[6]; - uint32_t h = state[7]; - - sha2_step1(a,b,c,d, e,f,g,h, in[ 0], Kshared[ 0]); - sha2_step1(h,a,b,c, d,e,f,g, in[ 1], Kshared[ 1]); - sha2_step1(g,h,a,b, c,d,e,f, in[ 2], Kshared[ 2]); - sha2_step1(f,g,h,a, b,c,d,e, in[ 3], Kshared[ 3]); - sha2_step1(e,f,g,h, a,b,c,d, in[ 4], Kshared[ 4]); - sha2_step1(d,e,f,g, h,a,b,c, in[ 5], Kshared[ 5]); - sha2_step1(c,d,e,f, g,h,a,b, in[ 6], Kshared[ 6]); - sha2_step1(b,c,d,e, f,g,h,a, in[ 7], Kshared[ 7]); - sha2_step1(a,b,c,d, e,f,g,h, in[ 8], Kshared[ 8]); - sha2_step1(h,a,b,c, d,e,f,g, in[ 9], Kshared[ 9]); - sha2_step1(g,h,a,b, c,d,e,f, in[10], Kshared[10]); - sha2_step1(f,g,h,a, b,c,d,e, in[11], Kshared[11]); - sha2_step1(e,f,g,h, a,b,c,d, in[12], Kshared[12]); - sha2_step1(d,e,f,g, h,a,b,c, in[13], Kshared[13]); - sha2_step1(c,d,e,f, g,h,a,b, in[14], Kshared[14]); - sha2_step1(b,c,d,e, f,g,h,a, in[15], Kshared[15]); - - #pragma unroll - for (int i=0; i<2; i++) - { - sha2_step2(a,b,c,d, e,f,g,h, in, 0, Kshared[16+16*i]); - sha2_step2(h,a,b,c, d,e,f,g, in, 1, Kshared[17+16*i]); - sha2_step2(g,h,a,b, c,d,e,f, in, 2, Kshared[18+16*i]); - sha2_step2(f,g,h,a, b,c,d,e, in, 3, Kshared[19+16*i]); - sha2_step2(e,f,g,h, a,b,c,d, in, 4, Kshared[20+16*i]); - sha2_step2(d,e,f,g, h,a,b,c, in, 5, Kshared[21+16*i]); - sha2_step2(c,d,e,f, g,h,a,b, in, 6, Kshared[22+16*i]); - sha2_step2(b,c,d,e, f,g,h,a, in, 7, Kshared[23+16*i]); - sha2_step2(a,b,c,d, e,f,g,h, in, 8, Kshared[24+16*i]); - sha2_step2(h,a,b,c, d,e,f,g, in, 9, Kshared[25+16*i]); - sha2_step2(g,h,a,b, c,d,e,f, in,10, Kshared[26+16*i]); - sha2_step2(f,g,h,a, b,c,d,e, in,11, Kshared[27+16*i]); - sha2_step2(e,f,g,h, a,b,c,d, in,12, Kshared[28+16*i]); - sha2_step2(d,e,f,g, h,a,b,c, in,13, Kshared[29+16*i]); - sha2_step2(c,d,e,f, g,h,a,b, in,14, Kshared[30+16*i]); - sha2_step2(b,c,d,e, f,g,h,a, in,15, Kshared[31+16*i]); - } - - sha2_step2(a,b,c,d, e,f,g,h, in, 0, Kshared[16+16*2]); - sha2_step2(h,a,b,c, d,e,f,g, in, 1, Kshared[17+16*2]); - sha2_step2(g,h,a,b, c,d,e,f, in, 2, Kshared[18+16*2]); - sha2_step2(f,g,h,a, b,c,d,e, in, 3, Kshared[19+16*2]); - sha2_step2(e,f,g,h, a,b,c,d, in, 4, Kshared[20+16*2]); - sha2_step2(d,e,f,g, h,a,b,c, in, 5, Kshared[21+16*2]); - sha2_step2(c,d,e,f, g,h,a,b, in, 6, Kshared[22+16*2]); - sha2_step2(b,c,d,e, f,g,h,a, in, 7, Kshared[23+16*2]); - sha2_step2(a,b,c,d, e,f,g,h, in, 8, Kshared[24+16*2]); - sha2_step2(h,a,b,c, d,e,f,g, in, 9, Kshared[25+16*2]); - sha2_step2(g,h,a,b, c,d,e,f, in,10, Kshared[26+16*2]); - sha2_step2(f,g,h,a, b,c,d,e, in,11, Kshared[27+16*2]); - sha2_step2(e,f,g,h, a,b,c,d, in,12, Kshared[28+16*2]); - sha2_step2(d,e,f,g, h,a,b,c, in,13, Kshared[29+16*2]); - - state[6] += g; - state[7] += h; -} - -__device__ __forceinline__ -uint64_t cuda_swab32ll(uint64_t x) { - return MAKE_ULONGLONG(cuda_swab32(_LODWORD(x)), cuda_swab32(_HIDWORD(x))); -} - -__global__ -/*__launch_bounds__(256,3)*/ -void sha256t_gpu_hash_shared(const uint32_t threads, const uint32_t startNonce, uint32_t *resNonces) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - - __shared__ uint32_t s_K[64*4]; - //s_K[thread & 63] = c_K[thread & 63]; - if (threadIdx.x < 64U) s_K[threadIdx.x] = c_K[threadIdx.x]; - - if (thread < threads) - { - const uint32_t nonce = startNonce + thread; - - uint32_t dat[16]; - AS_UINT2(dat) = AS_UINT2(c_dataEnd80); - dat[ 2] = c_dataEnd80[2]; - dat[ 3] = nonce; - dat[ 4] = 0x80000000; - dat[15] = 0x280; - #pragma unroll - for (int i=5; i<15; i++) dat[i] = 0; - - uint32_t buf[8]; - #pragma unroll - for (int i=0; i<8; i+=2) AS_UINT2(&buf[i]) = AS_UINT2(&c_midstate76[i]); - //for (int i=0; i<8; i++) buf[i] = c_midstate76[i]; - - sha256_round_body(dat, buf, s_K); - - // second sha256 - - #pragma unroll - for (int i=0; i<8; i++) dat[i] = buf[i]; - dat[8] = 0x80000000; - #pragma unroll - for (int i=9; i<15; i++) dat[i] = 0; - dat[15] = 0x100; - - #pragma unroll - for (int i=0; i<8; i++) buf[i] = c_H256[i]; - - sha256_round_body(dat, buf, s_K); - - // last sha256 - - #pragma unroll - for (int i=0; i<8; i++) dat[i] = buf[i]; - dat[8] = 0x80000000; - #pragma unroll - for (int i=9; i<15; i++) dat[i] = 0; - dat[15] = 0x100; - - #pragma unroll - for (int i=0; i<8; i++) buf[i] = c_H256[i]; - - sha256_round_last(dat, buf, s_K); - - // valid nonces - uint64_t high = cuda_swab32ll(((uint64_t*)buf)[3]); - if (high <= c_target[0]) { - //printf("%08x %08x - %016llx %016llx - %08x %08x\n", buf[7], buf[6], high, d_target[0], c_target[1], c_target[0]); - resNonces[1] = atomicExch(resNonces, nonce); - //d_target[0] = high; - } - } -} - -__host__ -void sha256t_init(int thr_id) -{ - cuda_get_arch(thr_id); - cudaMemcpyToSymbol(c_K, cpu_K, sizeof(cpu_K), 0, cudaMemcpyHostToDevice); - CUDA_SAFE_CALL(cudaMalloc(&d_resNonces[thr_id], 2*sizeof(uint32_t))); -} - -__host__ -void sha256t_free(int thr_id) -{ - if (d_resNonces[thr_id]) cudaFree(d_resNonces[thr_id]); - d_resNonces[thr_id] = NULL; -} - -__host__ -void sha256t_setBlock_80(uint32_t *pdata, uint32_t *ptarget) -{ - uint32_t _ALIGN(64) in[16], buf[8], end[4]; - for (int i=0;i<16;i++) in[i] = cuda_swab32(pdata[i]); - for (int i=0;i<8;i++) buf[i] = cpu_H256[i]; - for (int i=0;i<4;i++) end[i] = cuda_swab32(pdata[16+i]); - sha256_round_body_host(in, buf, cpu_K); - - CUDA_SAFE_CALL(cudaMemcpyToSymbol(c_midstate76, buf, 32, 0, cudaMemcpyHostToDevice)); - CUDA_SAFE_CALL(cudaMemcpyToSymbol(c_dataEnd80, end, sizeof(end), 0, cudaMemcpyHostToDevice)); - CUDA_SAFE_CALL(cudaMemcpyToSymbol(c_target, &ptarget[6], 8, 0, cudaMemcpyHostToDevice)); - CUDA_SAFE_CALL(cudaMemcpyToSymbol(d_target, &ptarget[6], 8, 0, cudaMemcpyHostToDevice)); -} - -__host__ -void sha256t_hash_80(int thr_id, uint32_t threads, uint32_t startNonce, uint32_t *resNonces) -{ - const uint32_t threadsperblock = 128; - - dim3 grid(threads/threadsperblock); - dim3 block(threadsperblock); - - CUDA_SAFE_CALL(cudaMemset(d_resNonces[thr_id], 0xFF, 2 * sizeof(uint32_t))); - cudaThreadSynchronize(); - sha256t_gpu_hash_shared <<>> (threads, startNonce, d_resNonces[thr_id]); - cudaThreadSynchronize(); - - CUDA_SAFE_CALL(cudaMemcpy(resNonces, d_resNonces[thr_id], 2 * sizeof(uint32_t), cudaMemcpyDeviceToHost)); - if (resNonces[0] == resNonces[1]) { - resNonces[1] = UINT32_MAX; - } -} diff --git a/sha256/sha256t.cu b/sha256/sha256t.cu deleted file mode 100644 index 2defb008..00000000 --- a/sha256/sha256t.cu +++ /dev/null @@ -1,131 +0,0 @@ -/** - * SHA256 3x - * by tpruvot@github - 2017 - */ - -#include -#include -#include - -// CPU Check -extern "C" void sha256t_hash(void *output, const void *input) -{ - unsigned char _ALIGN(64) hash[64]; - SHA256_CTX sha256; - - SHA256_Init(&sha256); - SHA256_Update(&sha256, (unsigned char *)input, 80); - SHA256_Final(hash, &sha256); - - SHA256_Init(&sha256); - SHA256_Update(&sha256, hash, 32); - SHA256_Final(hash, &sha256); - - SHA256_Init(&sha256); - SHA256_Update(&sha256, hash, 32); - SHA256_Final((unsigned char *)output, &sha256); -} - -static bool init[MAX_GPUS] = { 0 }; -extern void sha256t_init(int thr_id); -extern void sha256t_free(int thr_id); -extern void sha256t_setBlock_80(uint32_t *pdata, uint32_t *ptarget); -extern void sha256t_hash_80(int thr_id, uint32_t threads, uint32_t startNonce, uint32_t *resNonces); - -extern "C" int scanhash_sha256t(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t _ALIGN(64) endiandata[20]; - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - uint32_t throughput = cuda_default_throughput(thr_id, 1U << 23); - if (init[thr_id]) throughput = min(throughput, (max_nonce - first_nonce)); - - if (opt_benchmark) - ((uint32_t*)ptarget)[7] = 0x03; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - sha256t_init(thr_id); - - init[thr_id] = true; - } - - for (int k=0; k < 19; k++) - be32enc(&endiandata[k], pdata[k]); - - sha256t_setBlock_80(endiandata, ptarget); - - do { - // Hash with CUDA - *hashes_done = pdata[19] - first_nonce + throughput; - - sha256t_hash_80(thr_id, throughput, pdata[19], work->nonces); - if (work->nonces[0] != UINT32_MAX) - { - uint32_t _ALIGN(64) vhash[8]; - - endiandata[19] = swab32(work->nonces[0]); - sha256t_hash(vhash, endiandata); - if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - if (work->nonces[1] != UINT32_MAX) { - endiandata[19] = swab32(work->nonces[1]); - sha256t_hash(vhash, endiandata); - if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { - work->valid_nonces++; - bn_set_target_ratio(work, vhash, 1); - } - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; - } - return work->valid_nonces; - } - else if (vhash[7] > ptarget[7]) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - - return 0; -} - -// cleanup -extern "C" void free_sha256t(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - sha256t_free(thr_id); - - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/sia/sia-rpc.cpp b/sia/sia-rpc.cpp deleted file mode 100644 index 5eafe9ee..00000000 --- a/sia/sia-rpc.cpp +++ /dev/null @@ -1,203 +0,0 @@ -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "sia-rpc.h" - -static bool sia_debug_diff = false; - -extern int share_result(int result, int pooln, double sharediff, const char *reason); - -/* compute nbits to get the network diff */ -static void calc_network_diff(struct work *work) -{ - uint32_t nbits = work->data[11]; // unsure if correct - uint32_t bits = (nbits & 0xffffff); - int16_t shift = (swab32(nbits) & 0xff); // 0x1c = 28 - - uint64_t diffone = 0x0000FFFF00000000ull; - double d = (double)0x0000ffff / (double)bits; - - for (int m=shift; m < 29; m++) d *= 256.0; - for (int m=29; m < shift; m++) d /= 256.0; - if (sia_debug_diff) - applog(LOG_DEBUG, "net diff: %f -> shift %u, bits %08x", d, shift, bits); - - net_diff = d; -} - -// ---- SIA LONGPOLL -------------------------------------------------------------------------------- - -struct data_buffer { - void *buf; - size_t len; -}; - -static size_t sia_data_cb(const void *ptr, size_t size, size_t nmemb, - void *user_data) -{ - struct data_buffer *db = (struct data_buffer *)user_data; - size_t len = size * nmemb; - size_t oldlen, newlen; - void *newmem; - static const uchar zero = 0; - - oldlen = db->len; - newlen = oldlen + len; - - newmem = realloc(db->buf, newlen + 1); - if (!newmem) - return 0; - - db->buf = newmem; - db->len = newlen; - memcpy((char*)db->buf + oldlen, ptr, len); - memcpy((char*)db->buf + newlen, &zero, 1); /* null terminate */ - - return len; -} - -char* sia_getheader(CURL *curl, struct pool_infos *pool) -{ - char curl_err_str[CURL_ERROR_SIZE] = { 0 }; - struct data_buffer all_data = { 0 }; - struct curl_slist *headers = NULL; - char data[256] = { 0 }; - char url[512]; - - // nanopool - snprintf(url, 512, "%s/miner/header?address=%s&worker=%s", //&longpoll - pool->url, pool->user, pool->pass); - - if (opt_protocol) - curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); - curl_easy_setopt(curl, CURLOPT_URL, url); - curl_easy_setopt(curl, CURLOPT_POST, 0); - curl_easy_setopt(curl, CURLOPT_ENCODING, ""); - curl_easy_setopt(curl, CURLOPT_FAILONERROR, 0); - curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); - curl_easy_setopt(curl, CURLOPT_TCP_NODELAY, 1); - curl_easy_setopt(curl, CURLOPT_TIMEOUT, opt_timeout); - curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); - curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_err_str); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, sia_data_cb); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, &all_data); - - headers = curl_slist_append(headers, "Accept: application/octet-stream"); - headers = curl_slist_append(headers, "Expect:"); // disable Expect hdr - headers = curl_slist_append(headers, "User-Agent: Sia-Agent"); // required for now -// headers = curl_slist_append(headers, "User-Agent: " USER_AGENT); -// headers = curl_slist_append(headers, "X-Mining-Extensions: longpoll"); - - curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); - - int rc = curl_easy_perform(curl); - if (rc && strlen(curl_err_str)) { - applog(LOG_WARNING, "%s", curl_err_str); - } - - if (all_data.len >= 112) - cbin2hex(data, (const char*) all_data.buf, 112); - if (opt_protocol || all_data.len != 112) - applog(LOG_DEBUG, "received %d bytes: %s", (int) all_data.len, data); - - curl_slist_free_all(headers); - - return rc == 0 && all_data.len ? strdup(data) : NULL; -} - -bool sia_work_decode(const char *hexdata, struct work *work) -{ - uint8_t target[32]; - if (!work) return false; - - hex2bin((uchar*)target, &hexdata[0], 32); - swab256(work->target, target); - work->targetdiff = target_to_diff(work->target); - - hex2bin((uchar*)work->data, &hexdata[64], 80); - // high 16 bits of the 64 bits nonce - work->data[9] = rand() << 16; - - // use work ntime as job id - cbin2hex(work->job_id, (const char*)&work->data[10], 4); - calc_network_diff(work); - - if (stratum_diff != work->targetdiff) { - stratum_diff = work->targetdiff; - applog(LOG_WARNING, "Pool diff set to %g", stratum_diff); - } - - return true; -} - -bool sia_submit(CURL *curl, struct pool_infos *pool, struct work *work) -{ - char curl_err_str[CURL_ERROR_SIZE] = { 0 }; - struct data_buffer all_data = { 0 }; - struct curl_slist *headers = NULL; - char buf[256] = { 0 }; - char url[512]; - - if (opt_protocol) - applog_hex(work->data, 80); - //applog_hex(&work->data[8], 16); - //applog_hex(&work->data[10], 4); - - // nanopool - snprintf(url, 512, "%s/miner/header?address=%s&worker=%s", - pool->url, pool->user, pool->pass); - - if (opt_protocol) - curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); - curl_easy_setopt(curl, CURLOPT_URL, url); - curl_easy_setopt(curl, CURLOPT_ENCODING, ""); - curl_easy_setopt(curl, CURLOPT_FAILONERROR, 0); - curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); - curl_easy_setopt(curl, CURLOPT_TCP_NODELAY, 1); - curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_err_str); - curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); - curl_easy_setopt(curl, CURLOPT_TIMEOUT, 10); - - curl_easy_setopt(curl, CURLOPT_WRITEDATA, &all_data); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, sia_data_cb); - - memcpy(buf, work->data, 80); - curl_easy_setopt(curl, CURLOPT_POST, 1); - curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 80); - curl_easy_setopt(curl, CURLOPT_POSTFIELDS, (void*) buf); - -// headers = curl_slist_append(headers, "Content-Type: application/octet-stream"); -// headers = curl_slist_append(headers, "Content-Length: 80"); - headers = curl_slist_append(headers, "Accept:"); // disable Accept hdr - headers = curl_slist_append(headers, "Expect:"); // disable Expect hdr - headers = curl_slist_append(headers, "User-Agent: Sia-Agent"); -// headers = curl_slist_append(headers, "User-Agent: " USER_AGENT); - curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); - - int res = curl_easy_perform(curl) == 0; - long errcode; - CURLcode c = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &errcode); - if (errcode != 204) { - if (strlen(curl_err_str)) - applog(LOG_ERR, "submit err %ld %s", errcode, curl_err_str); - res = 0; - } - share_result(res, work->pooln, work->sharediff[0], res ? NULL : (char*) all_data.buf); - - curl_slist_free_all(headers); - return true; -} - -// ---- END SIA LONGPOLL ---------------------------------------------------------------------------- diff --git a/sia/sia-rpc.h b/sia/sia-rpc.h deleted file mode 100644 index 0b427e47..00000000 --- a/sia/sia-rpc.h +++ /dev/null @@ -1,6 +0,0 @@ -#include - -char* sia_getheader(CURL *curl, struct pool_infos *pool); -bool sia_work_decode(const char *hexdata, struct work *work); -bool sia_submit(CURL *curl, struct pool_infos *pool, struct work *work); - diff --git a/sia/sia.cu b/sia/sia.cu deleted file mode 100644 index 8e4f483e..00000000 --- a/sia/sia.cu +++ /dev/null @@ -1,304 +0,0 @@ -/** - * Blake2-B CUDA Implementation - * - * tpruvot@github July 2016 - * - */ - -#include - -#include -#include - -#include - -#include -#include - -#define TPB 512 -#define NBN 2 - -static uint32_t *d_resNonces[MAX_GPUS]; - -__device__ uint64_t d_data[10]; - -static __constant__ const int8_t blake2b_sigma[12][16] = { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } , - { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } , - { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } , - { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } , - { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } , - { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } , - { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } , - { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } , - { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } , - { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 } , - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } , - { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } -}; - -// host mem align -#define A 64 - -extern "C" void blake2b_hash(void *output, const void *input) -{ - uint8_t _ALIGN(A) hash[32]; - blake2b_ctx ctx; - - blake2b_init(&ctx, 32, NULL, 0); - blake2b_update(&ctx, input, 80); - blake2b_final(&ctx, hash); - - memcpy(output, hash, 32); -} - -// ---------------------------------------------------------------- - -__device__ __forceinline__ -static void G(const int r, const int i, uint64_t &a, uint64_t &b, uint64_t &c, uint64_t &d, uint64_t const m[16]) -{ - a = a + b + m[ blake2b_sigma[r][2*i] ]; - ((uint2*)&d)[0] = SWAPUINT2( ((uint2*)&d)[0] ^ ((uint2*)&a)[0] ); - c = c + d; - ((uint2*)&b)[0] = ROR24( ((uint2*)&b)[0] ^ ((uint2*)&c)[0] ); - a = a + b + m[ blake2b_sigma[r][2*i+1] ]; - ((uint2*)&d)[0] = ROR16( ((uint2*)&d)[0] ^ ((uint2*)&a)[0] ); - c = c + d; - ((uint2*)&b)[0] = ROR2( ((uint2*)&b)[0] ^ ((uint2*)&c)[0], 63U); -} - -#define ROUND(r) \ - G(r, 0, v[0], v[4], v[ 8], v[12], m); \ - G(r, 1, v[1], v[5], v[ 9], v[13], m); \ - G(r, 2, v[2], v[6], v[10], v[14], m); \ - G(r, 3, v[3], v[7], v[11], v[15], m); \ - G(r, 4, v[0], v[5], v[10], v[15], m); \ - G(r, 5, v[1], v[6], v[11], v[12], m); \ - G(r, 6, v[2], v[7], v[ 8], v[13], m); \ - G(r, 7, v[3], v[4], v[ 9], v[14], m); - -// simplified for the last round -__device__ __forceinline__ -static void H(const int r, const int i, uint64_t &a, uint64_t &b, uint64_t &c, uint64_t &d, uint64_t const m[16]) -{ - a = a + b + m[ blake2b_sigma[r][2*i] ]; - ((uint2*)&d)[0] = SWAPUINT2( ((uint2*)&d)[0] ^ ((uint2*)&a)[0] ); - c = c + d; - ((uint2*)&b)[0] = ROR24( ((uint2*)&b)[0] ^ ((uint2*)&c)[0] ); - a = a + b + m[ blake2b_sigma[r][2*i+1] ]; - ((uint2*)&d)[0] = ROR16( ((uint2*)&d)[0] ^ ((uint2*)&a)[0] ); - c = c + d; -} - -// we only check v[0] and v[8] -#define ROUND_F(r) \ - G(r, 0, v[0], v[4], v[ 8], v[12], m); \ - G(r, 1, v[1], v[5], v[ 9], v[13], m); \ - G(r, 2, v[2], v[6], v[10], v[14], m); \ - G(r, 3, v[3], v[7], v[11], v[15], m); \ - G(r, 4, v[0], v[5], v[10], v[15], m); \ - G(r, 5, v[1], v[6], v[11], v[12], m); \ - H(r, 6, v[2], v[7], v[ 8], v[13], m); - -__global__ -//__launch_bounds__(128, 8) /* to force 64 regs */ -void blake2b_gpu_hash(const uint32_t threads, const uint32_t startNonce, uint32_t *resNonce, const uint2 target2) -{ - const uint32_t nonce = (blockDim.x * blockIdx.x + threadIdx.x) + startNonce; - __shared__ uint64_t s_target; - if (!threadIdx.x) s_target = devectorize(target2); - - uint64_t m[16]; - - m[0] = d_data[0]; - m[1] = d_data[1]; - m[2] = d_data[2]; - m[3] = d_data[3]; - m[4] = d_data[4] | nonce; - m[5] = d_data[5]; - m[6] = d_data[6]; - m[7] = d_data[7]; - m[8] = d_data[8]; - m[9] = d_data[9]; - - m[10] = m[11] = 0; - m[12] = m[13] = m[14] = m[15] = 0; - - uint64_t v[16] = { - 0x6a09e667f2bdc928, 0xbb67ae8584caa73b, 0x3c6ef372fe94f82b, 0xa54ff53a5f1d36f1, - 0x510e527fade682d1, 0x9b05688c2b3e6c1f, 0x1f83d9abfb41bd6b, 0x5be0cd19137e2179, - 0x6a09e667f3bcc908, 0xbb67ae8584caa73b, 0x3c6ef372fe94f82b, 0xa54ff53a5f1d36f1, - 0x510e527fade68281, 0x9b05688c2b3e6c1f, 0xe07c265404be4294, 0x5be0cd19137e2179 - }; - - ROUND( 0 ); - ROUND( 1 ); - ROUND( 2 ); - ROUND( 3 ); - ROUND( 4 ); - ROUND( 5 ); - ROUND( 6 ); - ROUND( 7 ); - ROUND( 8 ); - ROUND( 9 ); - ROUND( 10 ); - ROUND_F( 11 ); - - uint64_t h64 = cuda_swab64(0x6a09e667f2bdc928 ^ v[0] ^ v[8]); - if (h64 <= s_target) { - resNonce[1] = resNonce[0]; - resNonce[0] = nonce; - s_target = h64; - } - // if (!nonce) printf("%016lx ", s_target); -} - -__host__ -uint32_t blake2b_hash_cuda(const int thr_id, const uint32_t threads, const uint32_t startNonce, const uint2 target2, uint32_t &secNonce) -{ - uint32_t resNonces[NBN] = { UINT32_MAX, UINT32_MAX }; - uint32_t result = UINT32_MAX; - - dim3 grid((threads + TPB-1)/TPB); - dim3 block(TPB); - - /* Check error on Ctrl+C or kill to prevent segfaults on exit */ - if (cudaMemset(d_resNonces[thr_id], 0xff, NBN*sizeof(uint32_t)) != cudaSuccess) - return result; - - blake2b_gpu_hash <<>> (threads, startNonce, d_resNonces[thr_id], target2); - cudaThreadSynchronize(); - - if (cudaSuccess == cudaMemcpy(resNonces, d_resNonces[thr_id], NBN*sizeof(uint32_t), cudaMemcpyDeviceToHost)) { - result = resNonces[0]; - secNonce = resNonces[1]; - if (secNonce == result) secNonce = UINT32_MAX; - } - return result; -} - -__host__ -void blake2b_setBlock(uint32_t *data) -{ - CUDA_SAFE_CALL(cudaMemcpyToSymbol(d_data, data, 80, 0, cudaMemcpyHostToDevice)); -} - -static bool init[MAX_GPUS] = { 0 }; - -int scanhash_sia(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t _ALIGN(A) hash[8]; - uint32_t _ALIGN(A) vhashcpu[8]; - uint32_t _ALIGN(A) inputdata[20]; - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - - const uint32_t Htarg = ptarget[7]; - const uint32_t first_nonce = pdata[8]; - - int dev_id = device_map[thr_id]; - int intensity = (device_sm[dev_id] >= 500 && !is_windows()) ? 28 : 25; - if (device_sm[dev_id] >= 520 && is_windows()) intensity = 26; - if (device_sm[dev_id] < 350) intensity = 22; - - uint32_t throughput = cuda_default_throughput(thr_id, 1U << intensity); - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (!init[thr_id]) - { - cudaSetDevice(dev_id); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage (linux) - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - CUDA_CALL_OR_RET_X(cudaMalloc(&d_resNonces[thr_id], NBN * sizeof(uint32_t)), -1); - init[thr_id] = true; - } - - memcpy(inputdata, pdata, 80); - inputdata[11] = 0; // nbits - - const uint2 target = make_uint2(ptarget[6], ptarget[7]); - - blake2b_setBlock(inputdata); - - do { - work->nonces[0] = blake2b_hash_cuda(thr_id, throughput, pdata[8], target, work->nonces[1]); - - *hashes_done = pdata[8] - first_nonce + throughput; - - if (work->nonces[0] != UINT32_MAX) - { - work->valid_nonces = 0; - inputdata[8] = work->nonces[0]; - blake2b_hash(hash, inputdata); - if (swab32(hash[0]) <= Htarg) { - // sia hash target is reversed (start of hash) - swab256(vhashcpu, hash); - if (fulltest(vhashcpu, ptarget)) { - work_set_target_ratio(work, vhashcpu); - work->valid_nonces++; - pdata[8] = work->nonces[0] + 1; - } - } else { - gpu_increment_reject(thr_id); - } - - if (work->nonces[1] != UINT32_MAX) { - inputdata[8] = work->nonces[1]; - blake2b_hash(hash, inputdata); - if (swab32(hash[0]) <= Htarg) { - swab256(vhashcpu, hash); - if (fulltest(vhashcpu, ptarget)) { - if (bn_hash_target_ratio(vhashcpu, ptarget) > work->shareratio[0]) { - work->sharediff[1] = work->sharediff[0]; - work->shareratio[1] = work->shareratio[0]; - xchg(work->nonces[1], work->nonces[0]); - work_set_target_ratio(work, vhashcpu); - } else { - bn_set_target_ratio(work, vhashcpu, 1); - } - work->valid_nonces++; - pdata[8] = work->nonces[1] + 1; - } - } else { - gpu_increment_reject(thr_id); - } - } - if (work->valid_nonces) { - return work->valid_nonces; - } - } - - if ((uint64_t) throughput + pdata[8] >= max_nonce) { - pdata[8] = max_nonce; - break; - } - - pdata[8] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[8] - first_nonce; - - return 0; -} - -// cleanup -extern "C" void free_sia(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_resNonces[thr_id]); - - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/skein.cu b/skein.cu deleted file mode 100644 index 568839f8..00000000 --- a/skein.cu +++ /dev/null @@ -1,484 +0,0 @@ -/** - * SKEIN512 80 + SHA256 64 - * by tpruvot@github - 2015 - */ - -#include "sph/sph_skein.h" - -#include "miner.h" -#include "cuda_helper.h" - -#include - -static uint32_t *d_hash[MAX_GPUS]; -static __thread bool sm5 = true; - -extern void quark_skein512_cpu_init(int thr_id, uint32_t threads); -extern void skein512_cpu_setBlock_80(void *pdata); -extern void skein512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, int swap); - -extern void skeincoin_init(int thr_id); -extern void skeincoin_free(int thr_id); -extern void skeincoin_setBlock_80(int thr_id, void *pdata); -extern uint32_t skeincoin_hash_sm5(int thr_id, uint32_t threads, uint32_t startNounce, int swap, uint64_t target64, uint32_t *secNonce); - -static __device__ uint32_t sha256_hashTable[] = { - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 -}; - -static __device__ __constant__ uint32_t sha256_constantTable[64] = { - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -}; - -static __device__ __constant__ uint32_t sha256_endingTable[] = { - 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000200, - 0x80000000, 0x01400000, 0x00205000, 0x00005088, 0x22000800, 0x22550014, 0x05089742, 0xa0000020, - 0x5a880000, 0x005c9400, 0x0016d49d, 0xfa801f00, 0xd33225d0, 0x11675959, 0xf6e6bfda, 0xb30c1549, - 0x08b2b050, 0x9d7c4c27, 0x0ce2a393, 0x88e6e1ea, 0xa52b4335, 0x67a16f49, 0xd732016f, 0x4eeb2e91, - 0x5dbf55e5, 0x8eee2335, 0xe2bc5ec2, 0xa83f4394, 0x45ad78f7, 0x36f3d0cd, 0xd99c05e8, 0xb0511dc7, - 0x69bc7ac4, 0xbd11375b, 0xe3ba71e5, 0x3b209ff2, 0x18feee17, 0xe25ad9e7, 0x13375046, 0x0515089d, - 0x4f0d0f04, 0x2627484e, 0x310128d2, 0xc668b434, 0x420841cc, 0x62d311b8, 0xe59ba771, 0x85a7a484 -}; - -/* Elementary functions used by SHA256 */ -#define SWAB32(x) cuda_swab32(x) -//#define ROTR32(x,n) SPH_ROTR32(x,n) - -#define R(x, n) ((x) >> (n)) -#define Ch(x, y, z) ((x & (y ^ z)) ^ z) -#define Maj(x, y, z) ((x & (y | z)) | (y & z)) -#define S0(x) (ROTR32(x, 2) ^ ROTR32(x, 13) ^ ROTR32(x, 22)) -#define S1(x) (ROTR32(x, 6) ^ ROTR32(x, 11) ^ ROTR32(x, 25)) -#define s0(x) (ROTR32(x, 7) ^ ROTR32(x, 18) ^ R(x, 3)) -#define s1(x) (ROTR32(x, 17) ^ ROTR32(x, 19) ^ R(x, 10)) - -#define ADVANCED_SHA2 - -#ifndef ADVANCED_SHA2 - -/* SHA256 round function */ -#define RND(a, b, c, d, e, f, g, h, k) \ - do { \ - t0 = h + S1(e) + Ch(e, f, g) + k; \ - t1 = S0(a) + Maj(a, b, c); \ - d += t0; \ - h = t0 + t1; \ - } while (0) - -/* Adjusted round function for rotating state */ -#define RNDr(S, W, i) \ - RND(S[(64 - i) & 7], S[(65 - i) & 7], \ - S[(66 - i) & 7], S[(67 - i) & 7], \ - S[(68 - i) & 7], S[(69 - i) & 7], \ - S[(70 - i) & 7], S[(71 - i) & 7], \ - W[i] + sha256_constantTable[i]) - -static __constant__ uint32_t sha256_ending[16] = { - 0x80000000UL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x200UL -}; -__device__ -void sha256_transform_gpu(uint32_t *state, uint32_t *message) -{ - uint32_t S[8]; - uint32_t W[64]; - uint32_t t0, t1; - - /* Initialize work variables. */ - for (int i = 0; i < 8; i++) { - S[i] = state[i]; - } - - for (int i = 0; i < 16; i++) { - W[i] = message[i]; - } - - for (int i = 16; i < 64; i += 2) { - W[i] = s1(W[i - 2]) + W[i - 7] + s0(W[i - 15]) + W[i - 16]; - W[i + 1] = s1(W[i - 1]) + W[i - 6] + s0(W[i - 14]) + W[i - 15]; - } - - /* 3. Mix. */ - #pragma unroll - for (int i = 0; i < 64; i++) { - RNDr(S, W, i); - } - - for (int i = 0; i < 8; i++) - state[i] += S[i]; -} -#endif - -#ifdef ADVANCED_SHA2 -__device__ -void skeincoin_gpu_sha256(uint32_t *message) -{ - uint32_t W1[16]; - uint32_t W2[16]; - - uint32_t regs[8]; - uint32_t hash[8]; - - // Init with Hash-Table - #pragma unroll 8 - for (int k=0; k < 8; k++) { - hash[k] = regs[k] = sha256_hashTable[k]; - } - - #pragma unroll 16 - for (int k = 0; k<16; k++) - W1[k] = SWAB32(message[k]); - - // Progress W1 - #pragma unroll 16 - for (int j = 0; j<16; j++) - { - uint32_t T1, T2; - T1 = regs[7] + S1(regs[4]) + Ch(regs[4], regs[5], regs[6]) + sha256_constantTable[j] + W1[j]; - T2 = S0(regs[0]) + Maj(regs[0], regs[1], regs[2]); - - #pragma unroll 7 - for (int k = 6; k >= 0; k--) regs[k + 1] = regs[k]; - regs[0] = T1 + T2; - regs[4] += T1; - } - - // Progress W2...W3 - - ////// PART 1 - #pragma unroll 2 - for (int j = 0; j<2; j++) - W2[j] = s1(W1[14 + j]) + W1[9 + j] + s0(W1[1 + j]) + W1[j]; - #pragma unroll 5 - for (int j = 2; j<7; j++) - W2[j] = s1(W2[j - 2]) + W1[9 + j] + s0(W1[1 + j]) + W1[j]; - - #pragma unroll 8 - for (int j = 7; j<15; j++) - W2[j] = s1(W2[j - 2]) + W2[j - 7] + s0(W1[1 + j]) + W1[j]; - - W2[15] = s1(W2[13]) + W2[8] + s0(W2[0]) + W1[15]; - - // Round function - #pragma unroll 16 - for (int j = 0; j<16; j++) - { - uint32_t T1, T2; - T1 = regs[7] + S1(regs[4]) + Ch(regs[4], regs[5], regs[6]) + sha256_constantTable[j + 16] + W2[j]; - T2 = S0(regs[0]) + Maj(regs[0], regs[1], regs[2]); - - #pragma unroll 7 - for (int l = 6; l >= 0; l--) regs[l + 1] = regs[l]; - regs[0] = T1 + T2; - regs[4] += T1; - } - - ////// PART 2 - #pragma unroll 2 - for (int j = 0; j<2; j++) - W1[j] = s1(W2[14 + j]) + W2[9 + j] + s0(W2[1 + j]) + W2[j]; - - #pragma unroll 5 - for (int j = 2; j<7; j++) - W1[j] = s1(W1[j - 2]) + W2[9 + j] + s0(W2[1 + j]) + W2[j]; - - #pragma unroll 8 - for (int j = 7; j<15; j++) - W1[j] = s1(W1[j - 2]) + W1[j - 7] + s0(W2[1 + j]) + W2[j]; - - W1[15] = s1(W1[13]) + W1[8] + s0(W1[0]) + W2[15]; - - // Round function - #pragma unroll 16 - for (int j = 0; j<16; j++) - { - uint32_t T1, T2; - T1 = regs[7] + S1(regs[4]) + Ch(regs[4], regs[5], regs[6]) + sha256_constantTable[j + 32] + W1[j]; - T2 = S0(regs[0]) + Maj(regs[0], regs[1], regs[2]); - - #pragma unroll 7 - for (int l = 6; l >= 0; l--) regs[l + 1] = regs[l]; - regs[0] = T1 + T2; - regs[4] += T1; - } - - ////// PART 3 - #pragma unroll 2 - for (int j = 0; j<2; j++) - W2[j] = s1(W1[14 + j]) + W1[9 + j] + s0(W1[1 + j]) + W1[j]; - - #pragma unroll 5 - for (int j = 2; j<7; j++) - W2[j] = s1(W2[j - 2]) + W1[9 + j] + s0(W1[1 + j]) + W1[j]; - - #pragma unroll 8 - for (int j = 7; j<15; j++) - W2[j] = s1(W2[j - 2]) + W2[j - 7] + s0(W1[1 + j]) + W1[j]; - - W2[15] = s1(W2[13]) + W2[8] + s0(W2[0]) + W1[15]; - - // Round function - #pragma unroll 16 - for (int j = 0; j<16; j++) - { - uint32_t T1, T2; - T1 = regs[7] + S1(regs[4]) + Ch(regs[4], regs[5], regs[6]) + sha256_constantTable[j + 48] + W2[j]; - T2 = S0(regs[0]) + Maj(regs[0], regs[1], regs[2]); - - #pragma unroll 7 - for (int l = 6; l >= 0; l--) regs[l + 1] = regs[l]; - regs[0] = T1 + T2; - regs[4] += T1; - } - - #pragma unroll 8 - for (int k = 0; k<8; k++) - hash[k] += regs[k]; - -#if 1 - ///// - ///// Second Pass (ending) - ///// - #pragma unroll 8 - for (int k = 0; k<8; k++) - regs[k] = hash[k]; - - // Progress W1 - #pragma unroll 64 - for (int j = 0; j<64; j++) - { - uint32_t T1, T2; - T1 = regs[7] + S1(regs[4]) + Ch(regs[4], regs[5], regs[6]) + sha256_constantTable[j] + sha256_endingTable[j]; - T2 = S0(regs[0]) + Maj(regs[0], regs[1], regs[2]); - - #pragma unroll 7 - for (int k = 6; k >= 0; k--) regs[k + 1] = regs[k]; - regs[0] = T1 + T2; - regs[4] += T1; - } - - #pragma unroll 8 - for (int k = 0; k<8; k++) - hash[k] += regs[k]; - - // Final Hash - #pragma unroll 8 - for (int k = 0; k<8; k++) - message[k] = SWAB32(hash[k]); -#else - // sha256_transform only, require an additional sha256_transform_gpu() call - #pragma unroll 8 - for (int k = 0; k<8; k++) - message[k] = hash[k]; -#endif -} -#endif - -__global__ -void sha2_gpu_hash_64(uint32_t threads, uint32_t startNounce, uint32_t *hashBuffer) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t *hash = &hashBuffer[thread << 4]; -#ifdef ADVANCED_SHA2 - skeincoin_gpu_sha256(hash); -#else - uint32_t state[16]; - uint32_t msg[16]; - #pragma unroll - for (int i = 0; i < 8; i++) - state[i] = sha256_hashTable[i]; - - #pragma unroll - for (int i = 0; i < 16; i++) - msg[i] = SWAB32(hash[i]); - - sha256_transform_gpu(state, msg); - sha256_transform_gpu(state, sha256_ending); - - #pragma unroll - for (int i = 0; i < 8; i++) - hash[i] = SWAB32(state[i]); -#endif - } -} - -__host__ -void sha2_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_outputHashes) -{ - uint32_t threadsperblock = 128; - dim3 block(threadsperblock); - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - - sha2_gpu_hash_64 <<< grid, block >>>(threads, startNounce, d_outputHashes); - - // required once per scan loop to prevent cpu 100% usage (linux) - MyStreamSynchronize(NULL, 0, thr_id); -} - -extern "C" void skeincoinhash(void *output, const void *input) -{ - sph_skein512_context ctx_skein; - SHA256_CTX sha256; - - uint32_t hash[16]; - - sph_skein512_init(&ctx_skein); - sph_skein512(&ctx_skein, input, 80); - sph_skein512_close(&ctx_skein, hash); - - SHA256_Init(&sha256); - SHA256_Update(&sha256, (unsigned char *)hash, 64); - SHA256_Final((unsigned char *)hash, &sha256); - - memcpy(output, hash, 32); -} - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_skeincoin(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t _ALIGN(64) endiandata[20]; - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - - const uint32_t first_nonce = pdata[19]; - - sm5 = (device_sm[device_map[thr_id]] >= 500); - bool checkSecnonce = (have_stratum || have_longpoll) && !sm5; - - uint32_t throughput = cuda_default_throughput(thr_id, 1U << 20); - if (init[thr_id]) throughput = min(throughput, (max_nonce - first_nonce)); - - uint64_t target64 = 0; - - if (opt_benchmark) - ((uint32_t*)ptarget)[7] = 0x03; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - cuda_get_arch(thr_id); - - if (sm5) { - skeincoin_init(thr_id); - } else { - cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput); - quark_skein512_cpu_init(thr_id, throughput); - cuda_check_cpu_init(thr_id, throughput); - CUDA_SAFE_CALL(cudaDeviceSynchronize()); - } - - init[thr_id] = true; - } - - for (int k=0; k < 19; k++) - be32enc(&endiandata[k], pdata[k]); - - if (sm5) { - skeincoin_setBlock_80(thr_id, (void*)endiandata); - target64 = ((uint64_t*)ptarget)[3]; - } else { - skein512_cpu_setBlock_80((void*)endiandata); - cuda_check_cpu_setTarget(ptarget); - } - - do { - // Hash with CUDA - *hashes_done = pdata[19] - first_nonce + throughput; - - if (sm5) { - /* cuda_skeincoin.cu */ - work->nonces[0] = skeincoin_hash_sm5(thr_id, throughput, pdata[19], 1, target64, &work->nonces[1]); - } else { - /* quark/cuda_skein512.cu */ - skein512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - sha2_cpu_hash_64(thr_id, throughput, pdata[19], d_hash[thr_id]); - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - } - - if (work->nonces[0] != UINT32_MAX) - { - uint32_t _ALIGN(64) vhash[8]; - - endiandata[19] = swab32(work->nonces[0]); - skeincoinhash(vhash, endiandata); - if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - if (checkSecnonce) { - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], work->valid_nonces); - if (work->nonces[1] != 0) { - endiandata[19] = swab32(work->nonces[1]); - skeincoinhash(vhash, endiandata); - if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { - work->valid_nonces++; - bn_set_target_ratio(work, vhash, 1); - } - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; - } - } else { - pdata[19] = work->nonces[0] + 1; // cursor for next scan - } - return work->valid_nonces; - } - else if (vhash[7] > ptarget[7]) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - - return 0; -} - -// cleanup -extern "C" void free_skeincoin(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - if (sm5) - skeincoin_free(thr_id); - else { - cudaFree(d_hash[thr_id]); - cuda_check_cpu_free(thr_id); - } - - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/skein2.cpp b/skein2.cpp deleted file mode 100644 index 2d57f2d4..00000000 --- a/skein2.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/** - * SKEIN512 80 + SKEIN512 64 (Woodcoin) - * by tpruvot@github - 2015 - */ -#include - -#include "sph/sph_skein.h" - -#include "miner.h" -#include "cuda_helper.h" - -static uint32_t *d_hash[MAX_GPUS]; - -extern void skein512_cpu_setBlock_80(void *pdata); -extern void skein512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, int swap); - -extern void quark_skein512_cpu_init(int thr_id, uint32_t threads); -extern void quark_skein512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -void skein2hash(void *output, const void *input) -{ - uint32_t _ALIGN(64) hash[16]; - sph_skein512_context ctx_skein; - - sph_skein512_init(&ctx_skein); - sph_skein512(&ctx_skein, input, 80); - sph_skein512_close(&ctx_skein, hash); - - sph_skein512_init(&ctx_skein); - sph_skein512(&ctx_skein, hash, 64); - sph_skein512_close(&ctx_skein, hash); - - memcpy(output, (void*) hash, 32); -} - -static bool init[MAX_GPUS] = { 0 }; - -int scanhash_skein2(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - int dev_id = device_map[thr_id]; - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - - uint32_t throughput = cuda_default_throughput(thr_id, 1U << 19); // 256*256*8 - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ((uint32_t*)ptarget)[7] = 0; - - if (!init[thr_id]) - { - cudaSetDevice(dev_id); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput); - - quark_skein512_cpu_init(thr_id, throughput); - cuda_check_cpu_init(thr_id, throughput); - - CUDA_SAFE_CALL(cudaDeviceSynchronize()); - - init[thr_id] = true; - } - - uint32_t endiandata[20]; - for (int k=0; k < 19; k++) - be32enc(&endiandata[k], pdata[k]); - - skein512_cpu_setBlock_80((void*)endiandata); - cuda_check_cpu_setTarget(ptarget); - - do { - int order = 0; - - // Hash with CUDA - skein512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - - *hashes_done = pdata[19] - first_nonce + throughput; - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - if (work->nonces[0] != UINT32_MAX) - { - uint32_t _ALIGN(64) vhash[8]; - - endiandata[19] = swab32(work->nonces[0]); - skein2hash(vhash, endiandata); - - if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - work_set_target_ratio(work, vhash); - if (work->nonces[1] != 0) { - endiandata[19] = swab32(work->nonces[1]); - skein2hash(vhash, endiandata); - work->valid_nonces++; - bn_set_target_ratio(work, vhash, 1); - gpulog(LOG_DEBUG, thr_id, "found second nonce %08x!", endiandata[19]); - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor for next scan - } - return work->valid_nonces; - } - else if (vhash[7] > ptarget[7]) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - - return 0; -} - -// cleanup -void free_skein2(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - - cuda_check_cpu_free(thr_id); - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/skunk/cuda_skunk.cu b/skunk/cuda_skunk.cu deleted file mode 100644 index cd4c269f..00000000 --- a/skunk/cuda_skunk.cu +++ /dev/null @@ -1,701 +0,0 @@ -/** - * skein + cube + fugue merged kernel, based on krnlx work - * - * based on alexis78 sib kernels, final touch by tpruvot - */ - -#include -#include -#include "skunk/skein_header.h" -#include - -#define TPB 512 - -/* ************************ */ -static __constant__ uint2 c_buffer[120]; // padded message (80 bytes + 72 bytes midstate + align) - -#define SWAP(a,b) { uint32_t u = a; a = b; b = u; } - -__device__ __forceinline__ -static void rrounds(uint32_t *x){ - #pragma unroll 2 - for (int r = 0; r < 16; r++) { - /* "add x_0jklm into x_1jklmn modulo 2^32 rotate x_0jklm upwards by 7 bits" */ - x[16] = x[16] + x[ 0]; x[ 0] = ROTL32(x[ 0], 7);x[17] = x[17] + x[ 1];x[ 1] = ROTL32(x[ 1], 7); - x[18] = x[18] + x[ 2]; x[ 2] = ROTL32(x[ 2], 7);x[19] = x[19] + x[ 3];x[ 3] = ROTL32(x[ 3], 7); - x[20] = x[20] + x[ 4]; x[ 4] = ROTL32(x[ 4], 7);x[21] = x[21] + x[ 5];x[ 5] = ROTL32(x[ 5], 7); - x[22] = x[22] + x[ 6]; x[ 6] = ROTL32(x[ 6], 7);x[23] = x[23] + x[ 7];x[ 7] = ROTL32(x[ 7], 7); - x[24] = x[24] + x[ 8]; x[ 8] = ROTL32(x[ 8], 7);x[25] = x[25] + x[ 9];x[ 9] = ROTL32(x[ 9], 7); - x[26] = x[26] + x[10]; x[10] = ROTL32(x[10], 7);x[27] = x[27] + x[11];x[11] = ROTL32(x[11], 7); - x[28] = x[28] + x[12]; x[12] = ROTL32(x[12], 7);x[29] = x[29] + x[13];x[13] = ROTL32(x[13], 7); - x[30] = x[30] + x[14]; x[14] = ROTL32(x[14], 7);x[31] = x[31] + x[15];x[15] = ROTL32(x[15], 7); - /* "swap x_00klm with x_01klm" */ - SWAP(x[ 0], x[ 8]);x[ 0] ^= x[16];x[ 8] ^= x[24];SWAP(x[ 1], x[ 9]);x[ 1] ^= x[17];x[ 9] ^= x[25]; - SWAP(x[ 2], x[10]);x[ 2] ^= x[18];x[10] ^= x[26];SWAP(x[ 3], x[11]);x[ 3] ^= x[19];x[11] ^= x[27]; - SWAP(x[ 4], x[12]);x[ 4] ^= x[20];x[12] ^= x[28];SWAP(x[ 5], x[13]);x[ 5] ^= x[21];x[13] ^= x[29]; - SWAP(x[ 6], x[14]);x[ 6] ^= x[22];x[14] ^= x[30];SWAP(x[ 7], x[15]);x[ 7] ^= x[23];x[15] ^= x[31]; - /* "swap x_1jk0m with x_1jk1m" */ - SWAP(x[16], x[18]); SWAP(x[17], x[19]); SWAP(x[20], x[22]); SWAP(x[21], x[23]); - SWAP(x[24], x[26]); SWAP(x[25], x[27]); SWAP(x[28], x[30]); SWAP(x[29], x[31]); - /* "add x_0jklm into x_1jklm modulo 2^32 rotate x_0jklm upwards by 11 bits" */ - x[16] = x[16] + x[ 0]; x[ 0] = ROTL32(x[ 0],11);x[17] = x[17] + x[ 1];x[ 1] = ROTL32(x[ 1],11); - x[18] = x[18] + x[ 2]; x[ 2] = ROTL32(x[ 2],11);x[19] = x[19] + x[ 3];x[ 3] = ROTL32(x[ 3],11); - x[20] = x[20] + x[ 4]; x[ 4] = ROTL32(x[ 4],11);x[21] = x[21] + x[ 5];x[ 5] = ROTL32(x[ 5],11); - x[22] = x[22] + x[ 6]; x[ 6] = ROTL32(x[ 6],11);x[23] = x[23] + x[ 7];x[ 7] = ROTL32(x[ 7],11); - x[24] = x[24] + x[ 8]; x[ 8] = ROTL32(x[ 8],11);x[25] = x[25] + x[ 9];x[ 9] = ROTL32(x[ 9],11); - x[26] = x[26] + x[10]; x[10] = ROTL32(x[10],11);x[27] = x[27] + x[11];x[11] = ROTL32(x[11],11); - x[28] = x[28] + x[12]; x[12] = ROTL32(x[12],11);x[29] = x[29] + x[13];x[13] = ROTL32(x[13],11); - x[30] = x[30] + x[14]; x[14] = ROTL32(x[14],11);x[31] = x[31] + x[15];x[15] = ROTL32(x[15],11); - /* "swap x_0j0lm with x_0j1lm" */ - SWAP(x[ 0], x[ 4]); x[ 0] ^= x[16]; x[ 4] ^= x[20]; SWAP(x[ 1], x[ 5]); x[ 1] ^= x[17]; x[ 5] ^= x[21]; - SWAP(x[ 2], x[ 6]); x[ 2] ^= x[18]; x[ 6] ^= x[22]; SWAP(x[ 3], x[ 7]); x[ 3] ^= x[19]; x[ 7] ^= x[23]; - SWAP(x[ 8], x[12]); x[ 8] ^= x[24]; x[12] ^= x[28]; SWAP(x[ 9], x[13]); x[ 9] ^= x[25]; x[13] ^= x[29]; - SWAP(x[10], x[14]); x[10] ^= x[26]; x[14] ^= x[30]; SWAP(x[11], x[15]); x[11] ^= x[27]; x[15] ^= x[31]; - /* "swap x_1jkl0 with x_1jkl1" */ - SWAP(x[16], x[17]); SWAP(x[18], x[19]); SWAP(x[20], x[21]); SWAP(x[22], x[23]); - SWAP(x[24], x[25]); SWAP(x[26], x[27]); SWAP(x[28], x[29]); SWAP(x[30], x[31]); - } -} - -// fugue -static __constant__ const uint32_t c_S[16] = { - 0x8807a57e, 0xe616af75, 0xc5d3e4db, 0xac9ab027, - 0xd915f117, 0xb6eecc54, 0x06e8020b, 0x4a92efd1, - 0xaac6e2c9, 0xddb21398, 0xcae65838, 0x437f203f, - 0x25ea78e7, 0x951fddd6, 0xda6ed11d, 0xe13e3567 -}; - -static __device__ uint32_t mixtab0[256] = { - 0x63633297, 0x7c7c6feb, 0x77775ec7, 0x7b7b7af7, 0xf2f2e8e5, 0x6b6b0ab7, 0x6f6f16a7, 0xc5c56d39, - 0x303090c0, 0x01010704, 0x67672e87, 0x2b2bd1ac, 0xfefeccd5, 0xd7d71371, 0xabab7c9a, 0x767659c3, - 0xcaca4005, 0x8282a33e, 0xc9c94909, 0x7d7d68ef, 0xfafad0c5, 0x5959947f, 0x4747ce07, 0xf0f0e6ed, - 0xadad6e82, 0xd4d41a7d, 0xa2a243be, 0xafaf608a, 0x9c9cf946, 0xa4a451a6, 0x727245d3, 0xc0c0762d, - 0xb7b728ea, 0xfdfdc5d9, 0x9393d47a, 0x2626f298, 0x363682d8, 0x3f3fbdfc, 0xf7f7f3f1, 0xcccc521d, - 0x34348cd0, 0xa5a556a2, 0xe5e58db9, 0xf1f1e1e9, 0x71714cdf, 0xd8d83e4d, 0x313197c4, 0x15156b54, - 0x04041c10, 0xc7c76331, 0x2323e98c, 0xc3c37f21, 0x18184860, 0x9696cf6e, 0x05051b14, 0x9a9aeb5e, - 0x0707151c, 0x12127e48, 0x8080ad36, 0xe2e298a5, 0xebeba781, 0x2727f59c, 0xb2b233fe, 0x757550cf, - 0x09093f24, 0x8383a43a, 0x2c2cc4b0, 0x1a1a4668, 0x1b1b416c, 0x6e6e11a3, 0x5a5a9d73, 0xa0a04db6, - 0x5252a553, 0x3b3ba1ec, 0xd6d61475, 0xb3b334fa, 0x2929dfa4, 0xe3e39fa1, 0x2f2fcdbc, 0x8484b126, - 0x5353a257, 0xd1d10169, 0x00000000, 0xededb599, 0x2020e080, 0xfcfcc2dd, 0xb1b13af2, 0x5b5b9a77, - 0x6a6a0db3, 0xcbcb4701, 0xbebe17ce, 0x3939afe4, 0x4a4aed33, 0x4c4cff2b, 0x5858937b, 0xcfcf5b11, - 0xd0d0066d, 0xefefbb91, 0xaaaa7b9e, 0xfbfbd7c1, 0x4343d217, 0x4d4df82f, 0x333399cc, 0x8585b622, - 0x4545c00f, 0xf9f9d9c9, 0x02020e08, 0x7f7f66e7, 0x5050ab5b, 0x3c3cb4f0, 0x9f9ff04a, 0xa8a87596, - 0x5151ac5f, 0xa3a344ba, 0x4040db1b, 0x8f8f800a, 0x9292d37e, 0x9d9dfe42, 0x3838a8e0, 0xf5f5fdf9, - 0xbcbc19c6, 0xb6b62fee, 0xdada3045, 0x2121e784, 0x10107040, 0xffffcbd1, 0xf3f3efe1, 0xd2d20865, - 0xcdcd5519, 0x0c0c2430, 0x1313794c, 0xececb29d, 0x5f5f8667, 0x9797c86a, 0x4444c70b, 0x1717655c, - 0xc4c46a3d, 0xa7a758aa, 0x7e7e61e3, 0x3d3db3f4, 0x6464278b, 0x5d5d886f, 0x19194f64, 0x737342d7, - 0x60603b9b, 0x8181aa32, 0x4f4ff627, 0xdcdc225d, 0x2222ee88, 0x2a2ad6a8, 0x9090dd76, 0x88889516, - 0x4646c903, 0xeeeebc95, 0xb8b805d6, 0x14146c50, 0xdede2c55, 0x5e5e8163, 0x0b0b312c, 0xdbdb3741, - 0xe0e096ad, 0x32329ec8, 0x3a3aa6e8, 0x0a0a3628, 0x4949e43f, 0x06061218, 0x2424fc90, 0x5c5c8f6b, - 0xc2c27825, 0xd3d30f61, 0xacac6986, 0x62623593, 0x9191da72, 0x9595c662, 0xe4e48abd, 0x797974ff, - 0xe7e783b1, 0xc8c84e0d, 0x373785dc, 0x6d6d18af, 0x8d8d8e02, 0xd5d51d79, 0x4e4ef123, 0xa9a97292, - 0x6c6c1fab, 0x5656b943, 0xf4f4fafd, 0xeaeaa085, 0x6565208f, 0x7a7a7df3, 0xaeae678e, 0x08083820, - 0xbaba0bde, 0x787873fb, 0x2525fb94, 0x2e2ecab8, 0x1c1c5470, 0xa6a65fae, 0xb4b421e6, 0xc6c66435, - 0xe8e8ae8d, 0xdddd2559, 0x747457cb, 0x1f1f5d7c, 0x4b4bea37, 0xbdbd1ec2, 0x8b8b9c1a, 0x8a8a9b1e, - 0x70704bdb, 0x3e3ebaf8, 0xb5b526e2, 0x66662983, 0x4848e33b, 0x0303090c, 0xf6f6f4f5, 0x0e0e2a38, - 0x61613c9f, 0x35358bd4, 0x5757be47, 0xb9b902d2, 0x8686bf2e, 0xc1c17129, 0x1d1d5374, 0x9e9ef74e, - 0xe1e191a9, 0xf8f8decd, 0x9898e556, 0x11117744, 0x696904bf, 0xd9d93949, 0x8e8e870e, 0x9494c166, - 0x9b9bec5a, 0x1e1e5a78, 0x8787b82a, 0xe9e9a989, 0xcece5c15, 0x5555b04f, 0x2828d8a0, 0xdfdf2b51, - 0x8c8c8906, 0xa1a14ab2, 0x89899212, 0x0d0d2334, 0xbfbf10ca, 0xe6e684b5, 0x4242d513, 0x686803bb, - 0x4141dc1f, 0x9999e252, 0x2d2dc3b4, 0x0f0f2d3c, 0xb0b03df6, 0x5454b74b, 0xbbbb0cda, 0x16166258 -}; - -__device__ __forceinline__ -uint32_t ROL8X(const uint32_t a){ - return __byte_perm(a, 0, 0x2103); -} -__device__ __forceinline__ -uint32_t ROL16X(const uint32_t a){ - return __byte_perm(a, 0, 0x1032); -} -__device__ __forceinline__ -uint32_t ROR8X(const uint32_t a){ - return __byte_perm(a, 0, 0x0321); -} - -#define mixtab0(x) shared[0][x] -#define mixtab1(x) shared[1][x] -#define mixtab2(x) shared[2][x] -#define mixtab3(x) shared[3][x] - -#define TIX4(q, x00, x01, x04, x07, x08, x22, x24, x27, x30) { \ - x22 ^= x00; \ - x00 = (q); \ - x08 ^= (q); \ - x01 ^= x24; \ - x04 ^= x27; \ - x07 ^= x30; \ - } - -#define CMIX36(x00, x01, x02, x04, x05, x06, x18, x19, x20) { \ - x00 ^= x04; \ - x01 ^= x05; \ - x02 ^= x06; \ - x18 ^= x04; \ - x19 ^= x05; \ - x20 ^= x06; \ - } - -__device__ __forceinline__ -static void SMIX(const uint32_t shared[4][256], uint32_t &x0,uint32_t &x1,uint32_t &x2,uint32_t &x3){ - uint32_t c0 = mixtab0(__byte_perm(x0,0,0x4443)); - uint32_t r1 = mixtab1(__byte_perm(x0,0,0x4442)); - uint32_t r2 = mixtab2(__byte_perm(x0,0,0x4441)); - uint32_t r3 = mixtab3(__byte_perm(x0,0,0x4440)); - c0 = c0 ^ r1 ^ r2 ^ r3; - uint32_t r0 = mixtab0(__byte_perm(x1,0,0x4443)); - uint32_t c1 = r0 ^ mixtab1(__byte_perm(x1,0,0x4442)); - uint32_t tmp = mixtab2(__byte_perm(x1,0,0x4441)); - c1 ^= tmp; - r2 ^= tmp; - tmp = mixtab3(__byte_perm(x1,0,0x4440)); - c1 ^= tmp; - r3 ^= tmp; - uint32_t c2 = mixtab0(__byte_perm(x2,0,0x4443)); - r0 ^= c2; - tmp = mixtab1(__byte_perm(x2,0,0x4442)); - c2 ^= tmp; - r1 ^= tmp; - tmp = mixtab2(__byte_perm(x2,0,0x4441)); - c2 ^= tmp; - tmp = mixtab3(__byte_perm(x2,0,0x4440)); - c2 ^= tmp; - r3 ^= tmp; - uint32_t c3 = mixtab0(__byte_perm(x3,0,0x4443)); - r0 ^= c3; - tmp = mixtab1(__byte_perm(x3,0,0x4442)); - c3 ^= tmp; - r1 ^= tmp; - tmp = mixtab2(__byte_perm(x3,0,0x4441)); - c3 ^= tmp; - r2 ^= tmp; - tmp = mixtab3(__byte_perm(x3,0,0x4440)); - c3 ^= tmp; - x0 = ((c0 ^ (r0 << 0)) & 0xFF000000) | ((c1 ^ (r1 << 0)) & 0x00FF0000) | ((c2 ^ (r2 << 0)) & 0x0000FF00) | ((c3 ^ (r3 << 0)) & 0x000000FF); - x1 = ((c1 ^ (r0 << 8)) & 0xFF000000) | ((c2 ^ (r1 << 8)) & 0x00FF0000) | ((c3 ^ (r2 << 8)) & 0x0000FF00) | ((c0 ^ (r3 >>24)) & 0x000000FF); - x2 = ((c2 ^ (r0 <<16)) & 0xFF000000) | ((c3 ^ (r1 <<16)) & 0x00FF0000) | ((c0 ^ (r2 >>16)) & 0x0000FF00) | ((c1 ^ (r3 >>16)) & 0x000000FF); - x3 = ((c3 ^ (r0 <<24)) & 0xFF000000) | ((c0 ^ (r1 >> 8)) & 0x00FF0000) | ((c1 ^ (r2 >> 8)) & 0x0000FF00) | ((c2 ^ (r3 >> 8)) & 0x000000FF); -} - -__device__ -static void SMIX_LDG(const uint32_t shared[4][256], uint32_t &x0,uint32_t &x1,uint32_t &x2,uint32_t &x3){ - uint32_t c0 = __ldg(&mixtab0[__byte_perm(x0,0,0x4443)]); - uint32_t r1 = mixtab1(__byte_perm(x0,0,0x4442)); - uint32_t r2 = mixtab2(__byte_perm(x0,0,0x4441)); - uint32_t r3 = mixtab3(__byte_perm(x0,0,0x4440)); - c0 = c0 ^ r1 ^ r2 ^ r3; - uint32_t r0 = __ldg(&mixtab0[__byte_perm(x1,0,0x4443)]); - uint32_t c1 = r0 ^ mixtab1(__byte_perm(x1,0,0x4442)); - uint32_t tmp = mixtab2(__byte_perm(x1,0,0x4441)); - c1 ^= tmp; - r2 ^= tmp; - tmp = mixtab3(__byte_perm(x1,0,0x4440)); - c1 ^= tmp; - r3 ^= tmp; - uint32_t c2 = __ldg(&mixtab0[__byte_perm(x2,0,0x4443)]); - r0 ^= c2; - tmp = mixtab1(__byte_perm(x2,0,0x4442)); - c2 ^= tmp; - r1 ^= tmp; - tmp = mixtab2(__byte_perm(x2,0,0x4441)); - c2 ^= tmp; - tmp = mixtab3(__byte_perm(x2,0,0x4440)); - c2 ^= tmp; - r3 ^= tmp; - uint32_t c3 = __ldg(&mixtab0[__byte_perm(x3,0,0x4443)]); - r0 ^= c3; - tmp = mixtab1(__byte_perm(x3,0,0x4442)); - c3 ^= tmp; - r1 ^= tmp; - tmp = mixtab2(__byte_perm(x3,0,0x4441)); - c3 ^= tmp; - r2 ^= tmp; - tmp = ROL8X(__ldg(&mixtab0[__byte_perm(x3,0,0x4440)])); - c3 ^= tmp; - x0 = ((c0 ^ (r0 << 0)) & 0xFF000000) | ((c1 ^ (r1 << 0)) & 0x00FF0000) | ((c2 ^ (r2 << 0)) & 0x0000FF00) | ((c3 ^ (r3 << 0)) & 0x000000FF); - x1 = ((c1 ^ (r0 << 8)) & 0xFF000000) | ((c2 ^ (r1 << 8)) & 0x00FF0000) | ((c3 ^ (r2 << 8)) & 0x0000FF00) | ((c0 ^ (r3 >>24)) & 0x000000FF); - x2 = ((c2 ^ (r0 <<16)) & 0xFF000000) | ((c3 ^ (r1 <<16)) & 0x00FF0000) | ((c0 ^ (r2 >>16)) & 0x0000FF00) | ((c1 ^ (r3 >>16)) & 0x000000FF); - x3 = ((c3 ^ (r0 <<24)) & 0xFF000000) | ((c0 ^ (r1 >> 8)) & 0x00FF0000) | ((c1 ^ (r2 >> 8)) & 0x0000FF00) | ((c2 ^ (r3 >> 8)) & 0x000000FF); -} - -#define mROR3 { \ - B[ 6] = S[33], B[ 7] = S[34], B[ 8] = S[35]; \ - S[35] = S[32]; S[34] = S[31]; S[33] = S[30]; S[32] = S[29]; S[31] = S[28]; S[30] = S[27]; S[29] = S[26]; S[28] = S[25]; S[27] = S[24]; \ - S[26] = S[23]; S[25] = S[22]; S[24] = S[21]; S[23] = S[20]; S[22] = S[19]; S[21] = S[18]; S[20] = S[17]; S[19] = S[16]; S[18] = S[15]; \ - S[17] = S[14]; S[16] = S[13]; S[15] = S[12]; S[14] = S[11]; S[13] = S[10]; S[12] = S[ 9]; S[11] = S[ 8]; S[10] = S[ 7]; S[ 9] = S[ 6]; \ - S[ 8] = S[ 5]; S[ 7] = S[ 4]; S[ 6] = S[ 3]; S[ 5] = S[ 2]; S[ 4] = S[ 1]; S[ 3] = S[ 0]; S[ 2] = B[ 8]; S[ 1] = B[ 7]; S[ 0] = B[ 6]; \ - } - -#define mROR8 { \ - B[ 1] = S[28], B[ 2] = S[29], B[ 3] = S[30], B[ 4] = S[31], B[ 5] = S[32], B[ 6] = S[33], B[ 7] = S[34], B[ 8] = S[35]; \ - S[35] = S[27]; S[34] = S[26]; S[33] = S[25]; S[32] = S[24]; S[31] = S[23]; S[30] = S[22]; S[29] = S[21]; S[28] = S[20]; S[27] = S[19]; \ - S[26] = S[18]; S[25] = S[17]; S[24] = S[16]; S[23] = S[15]; S[22] = S[14]; S[21] = S[13]; S[20] = S[12]; S[19] = S[11]; S[18] = S[10]; \ - S[17] = S[ 9]; S[16] = S[ 8]; S[15] = S[ 7]; S[14] = S[ 6]; S[13] = S[ 5]; S[12] = S[ 4]; S[11] = S[ 3]; S[10] = S[ 2]; S[ 9] = S[ 1]; \ - S[ 8] = S[ 0]; S[ 7] = B[ 8]; S[ 6] = B[ 7]; S[ 5] = B[ 6]; S[ 4] = B[ 5]; S[ 3] = B[ 4]; S[ 2] = B[ 3]; S[ 1] = B[ 2]; S[ 0] = B[ 1]; \ - } - -#define mROR9 { \ - B[ 0] = S[27], B[ 1] = S[28], B[ 2] = S[29], B[ 3] = S[30], B[ 4] = S[31], B[ 5] = S[32], B[ 6] = S[33], B[ 7] = S[34], B[ 8] = S[35]; \ - S[35] = S[26]; S[34] = S[25]; S[33] = S[24]; S[32] = S[23]; S[31] = S[22]; S[30] = S[21]; S[29] = S[20]; S[28] = S[19]; S[27] = S[18]; \ - S[26] = S[17]; S[25] = S[16]; S[24] = S[15]; S[23] = S[14]; S[22] = S[13]; S[21] = S[12]; S[20] = S[11]; S[19] = S[10]; S[18] = S[ 9]; \ - S[17] = S[ 8]; S[16] = S[ 7]; S[15] = S[ 6]; S[14] = S[ 5]; S[13] = S[ 4]; S[12] = S[ 3]; S[11] = S[ 2]; S[10] = S[ 1]; S[ 9] = S[ 0]; \ - S[ 8] = B[ 8]; S[ 7] = B[ 7]; S[ 6] = B[ 6]; S[ 5] = B[ 5]; S[ 4] = B[ 4]; S[ 3] = B[ 3]; S[ 2] = B[ 2]; S[ 1] = B[ 1]; S[ 0] = B[ 0]; \ - } - -#define FUGUE512_3(x, y, z) { \ - TIX4(x, S[ 0], S[ 1], S[ 4], S[ 7], S[ 8], S[22], S[24], S[27], S[30]); \ - CMIX36(S[33], S[34], S[35], S[ 1], S[ 2], S[ 3], S[15], S[16], S[17]); \ - SMIX_LDG(shared, S[33], S[34], S[35], S[ 0]); \ - CMIX36(S[30], S[31], S[32], S[34], S[35], S[ 0], S[12], S[13], S[14]); \ - SMIX_LDG(shared, S[30], S[31], S[32], S[33]); \ - CMIX36(S[27], S[28], S[29], S[31], S[32], S[33], S[ 9], S[10], S[11]); \ - SMIX(shared, S[27], S[28], S[29], S[30]); \ - CMIX36(S[24], S[25], S[26], S[28], S[29], S[30], S[ 6], S[ 7], S[ 8]); \ - SMIX_LDG(shared, S[24], S[25], S[26], S[27]); \ - \ - TIX4(y, S[24], S[25], S[28], S[31], S[32], S[10], S[12], S[15], S[18]); \ - CMIX36(S[21], S[22], S[23], S[25], S[26], S[27], S[ 3], S[ 4], S[ 5]); \ - SMIX(shared, S[21], S[22], S[23], S[24]); \ - CMIX36(S[18], S[19], S[20], S[22], S[23], S[24], S[ 0], S[ 1], S[ 2]); \ - SMIX_LDG(shared, S[18], S[19], S[20], S[21]); \ - CMIX36(S[15], S[16], S[17], S[19], S[20], S[21], S[33], S[34], S[35]); \ - SMIX_LDG(shared, S[15], S[16], S[17], S[18]); \ - CMIX36(S[12], S[13], S[14], S[16], S[17], S[18], S[30], S[31], S[32]); \ - SMIX(shared, S[12], S[13], S[14], S[15]); \ - \ - TIX4(z, S[12], S[13], S[16], S[19], S[20], S[34], S[ 0], S[ 3], S[ 6]); \ - CMIX36(S[ 9], S[10], S[11], S[13], S[14], S[15], S[27], S[28], S[29]); \ - SMIX_LDG(shared, S[ 9], S[10], S[11], S[12]); \ - CMIX36(S[ 6], S[ 7], S[ 8], S[10], S[11], S[12], S[24], S[25], S[26]); \ - SMIX_LDG(shared, S[ 6], S[ 7], S[ 8], S[ 9]); \ - CMIX36(S[ 3], S[ 4], S[ 5], S[ 7], S[ 8], S[ 9], S[21], S[22], S[23]); \ - SMIX_LDG(shared, S[ 3], S[ 4], S[ 5], S[ 6]); \ - CMIX36(S[ 0], S[ 1], S[ 2], S[ 4], S[ 5], S[ 6], S[18], S[19], S[20]); \ - SMIX_LDG(shared, S[ 0], S[ 1], S[ 2], S[ 3]); \ - } - -__global__ -__launch_bounds__(TPB, 2) -void skunk_gpu_hash_80(uint32_t threads, uint32_t startNounce, uint64_t *output64) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - - __shared__ uint32_t shared[4][256]; - - if(threadIdx.x<256) { - const uint32_t tmp = __ldg(&mixtab0[threadIdx.x]); - shared[0][threadIdx.x] = tmp; - shared[1][threadIdx.x] = ROR8X(tmp); - shared[2][threadIdx.x] = ROL16X(tmp); - shared[3][threadIdx.x] = ROL8X(tmp); - } - __syncthreads(); - - if (thread < threads) - { - // Skein - uint2 h[9]; - uint2 t0, t1, t2; - - uint32_t nonce = cuda_swab32(startNounce + thread); - uint2 nonce2 = make_uint2(c_buffer[0].x, nonce); - - uint2 p[8]; - p[1] = nonce2; - - h[0] = c_buffer[ 1]; - h[1] = c_buffer[ 2]; - h[2] = c_buffer[ 3]; - h[3] = c_buffer[ 4]; - h[4] = c_buffer[ 5]; - h[5] = c_buffer[ 6]; - h[6] = c_buffer[ 7]; - h[7] = c_buffer[ 8]; - h[8] = c_buffer[ 9]; - - t0 = vectorize(0x50ull); - t1 = vectorize(0xB000000000000000ull); - t2 = t0^t1; - - p[ 1]=nonce2 + h[1]; p[ 0]= c_buffer[10] + p[ 1]; - p[ 2]=c_buffer[11]; - p[ 3]=c_buffer[12]; - p[ 4]=c_buffer[13]; - p[ 5]=c_buffer[14]; - p[ 6]=c_buffer[15]; - p[ 7]=c_buffer[16]; - -// TFBIGMIX8e(); - p[1] = ROL2(p[1], 46) ^ p[0]; - p[2] += p[1]; - p[0] += p[3]; - p[1] = ROL2(p[1], 33) ^ p[2]; - p[3] = c_buffer[17] ^ p[0]; - p[4] += p[1]; - p[6] += p[3]; - p[0] += p[5]; - p[2] += p[7]; - p[1] = ROL2(p[1], 17) ^ p[4]; - p[3] = ROL2(p[3], 49) ^ p[6]; - p[5] = c_buffer[18] ^ p[0]; - p[7] = c_buffer[19] ^ p[2]; - p[6] += p[1]; - p[0] += p[7]; - p[2] += p[5]; - p[4] += p[3]; - p[1] = ROL2(p[1], 44) ^ p[6]; - p[7] = ROL2(p[7], 9) ^ p[0]; - p[5] = ROL2(p[5], 54) ^ p[2]; - p[3] = ROR8(p[3]) ^ p[4]; - - p[ 0]+=h[1]; p[ 1]+=h[2]; p[ 2]+=h[3]; p[ 3]+=h[4]; p[ 4]+=h[5]; p[ 5]+=c_buffer[20]; p[ 7]+=c_buffer[21]; p[ 6]+=c_buffer[22]; - TFBIGMIX8o(); - p[ 0]+=h[2]; p[ 1]+=h[3]; p[ 2]+=h[4]; p[ 3]+=h[5]; p[ 4]+=h[6]; p[ 5]+=c_buffer[22]; p[ 7]+=c_buffer[23]; p[ 6]+=c_buffer[24]; - TFBIGMIX8e(); - p[ 0]+=h[3]; p[ 1]+=h[4]; p[ 2]+=h[5]; p[ 3]+=h[6]; p[ 4]+=h[7]; p[ 5]+=c_buffer[24]; p[ 7]+=c_buffer[25]; p[ 6]+=c_buffer[26]; - TFBIGMIX8o(); - p[ 0]+=h[4]; p[ 1]+=h[5]; p[ 2]+=h[6]; p[ 3]+=h[7]; p[ 4]+=h[8]; p[ 5]+=c_buffer[26]; p[ 7]+=c_buffer[27]; p[ 6]+=c_buffer[28]; - TFBIGMIX8e(); - p[ 0]+=h[5]; p[ 1]+=h[6]; p[ 2]+=h[7]; p[ 3]+=h[8]; p[ 4]+=h[0]; p[ 5]+=c_buffer[28]; p[ 7]+=c_buffer[29]; p[ 6]+=c_buffer[30]; - TFBIGMIX8o(); - p[ 0]+=h[6]; p[ 1]+=h[7]; p[ 2]+=h[8]; p[ 3]+=h[0]; p[ 4]+=h[1]; p[ 5]+=c_buffer[30]; p[ 7]+=c_buffer[31]; p[ 6]+=c_buffer[32]; - TFBIGMIX8e(); - p[ 0]+=h[7]; p[ 1]+=h[8]; p[ 2]+=h[0]; p[ 3]+=h[1]; p[ 4]+=h[2]; p[ 5]+=c_buffer[32]; p[ 7]+=c_buffer[33]; p[ 6]+=c_buffer[34]; - TFBIGMIX8o(); - p[ 0]+=h[8]; p[ 1]+=h[0]; p[ 2]+=h[1]; p[ 3]+=h[2]; p[ 4]+=h[3]; p[ 5]+=c_buffer[34]; p[ 7]+=c_buffer[35]; p[ 6]+=c_buffer[36]; - TFBIGMIX8e(); - p[ 0]+=h[0]; p[ 1]+=h[1]; p[ 2]+=h[2]; p[ 3]+=h[3]; p[ 4]+=h[4]; p[ 5]+=c_buffer[36]; p[ 7]+=c_buffer[37]; p[ 6]+=c_buffer[38]; - TFBIGMIX8o(); - p[ 0]+=h[1]; p[ 1]+=h[2]; p[ 2]+=h[3]; p[ 3]+=h[4]; p[ 4]+=h[5]; p[ 5]+=c_buffer[38]; p[ 7]+=c_buffer[39]; p[ 6]+=c_buffer[40]; - TFBIGMIX8e(); - p[ 0]+=h[2]; p[ 1]+=h[3]; p[ 2]+=h[4]; p[ 3]+=h[5]; p[ 4]+=h[6]; p[ 5]+=c_buffer[40]; p[ 7]+=c_buffer[41]; p[ 6]+=c_buffer[42]; - TFBIGMIX8o(); - p[ 0]+=h[3]; p[ 1]+=h[4]; p[ 2]+=h[5]; p[ 3]+=h[6]; p[ 4]+=h[7]; p[ 5]+=c_buffer[42]; p[ 7]+=c_buffer[43]; p[ 6]+=c_buffer[44]; - TFBIGMIX8e(); - p[ 0]+=h[4]; p[ 1]+=h[5]; p[ 2]+=h[6]; p[ 3]+=h[7]; p[ 4]+=h[8]; p[ 5]+=c_buffer[44]; p[ 7]+=c_buffer[45]; p[ 6]+=c_buffer[46]; - TFBIGMIX8o(); - p[ 0]+=h[5]; p[ 1]+=h[6]; p[ 2]+=h[7]; p[ 3]+=h[8]; p[ 4]+=h[0]; p[ 5]+=c_buffer[46]; p[ 7]+=c_buffer[47]; p[ 6]+=c_buffer[48]; - TFBIGMIX8e(); - p[ 0]+=h[6]; p[ 1]+=h[7]; p[ 2]+=h[8]; p[ 3]+=h[0]; p[ 4]+=h[1]; p[ 5]+=c_buffer[48]; p[ 7]+=c_buffer[49]; p[ 6]+=c_buffer[50]; - TFBIGMIX8o(); - p[ 0]+=h[7]; p[ 1]+=h[8]; p[ 2]+=h[0]; p[ 3]+=h[1]; p[ 4]+=h[2]; p[ 5]+=c_buffer[50]; p[ 7]+=c_buffer[51]; p[ 6]+=c_buffer[52]; - TFBIGMIX8e(); - p[ 0]+=h[8]; p[ 1]+=h[0]; p[ 2]+=h[1]; p[ 3]+=h[2]; p[ 4]+=h[3]; p[ 5]+=c_buffer[52]; p[ 7]+=c_buffer[53]; p[ 6]+=c_buffer[54]; - TFBIGMIX8o(); - p[ 0]+=h[0]; p[ 1]+=h[1]; p[ 2]+=h[2]; p[ 3]+=h[3]; p[ 4]+=h[4]; p[ 5]+=c_buffer[54]; p[ 7]+=c_buffer[55]; p[ 6]+=c_buffer[56]; - - p[0]^= c_buffer[57]; - p[1]^= nonce2; - - t0 = vectorize(8); // extra - t1 = vectorize(0xFF00000000000000ull); // etype - t2 = t0^t1; - - h[0] = p[ 0]; - h[1] = p[ 1]; - h[2] = p[ 2]; - h[3] = p[ 3]; - h[4] = p[ 4]; - h[5] = p[ 5]; - h[6] = p[ 6]; - h[7] = p[ 7]; - - h[8] = h[0] ^ h[1] ^ h[2] ^ h[3] ^ h[4] ^ h[5] ^ h[6] ^ h[7] ^ vectorize(0x1BD11BDAA9FC1A22); - p[ 0] = p[ 1] = p[ 2] = p[ 3] = p[ 4] =p[ 5] =p[ 6] = p[ 7] = vectorize(0); - - #define h0 h[0] - #define h1 h[1] - #define h2 h[2] - #define h3 h[3] - #define h4 h[4] - #define h5 h[5] - #define h6 h[6] - #define h7 h[7] - #define h8 h[8] - - TFBIG_4e_UI2(0); - TFBIG_4o_UI2(1); - TFBIG_4e_UI2(2); - TFBIG_4o_UI2(3); - TFBIG_4e_UI2(4); - TFBIG_4o_UI2(5); - TFBIG_4e_UI2(6); - TFBIG_4o_UI2(7); - TFBIG_4e_UI2(8); - TFBIG_4o_UI2(9); - TFBIG_4e_UI2(10); - TFBIG_4o_UI2(11); - TFBIG_4e_UI2(12); - TFBIG_4o_UI2(13); - TFBIG_4e_UI2(14); - TFBIG_4o_UI2(15); - TFBIG_4e_UI2(16); - TFBIG_4o_UI2(17); - TFBIG_ADDKEY_UI2(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, 18); - - // cubehash512 - uint32_t x[32] = { - 0x2AEA2A61, 0x50F494D4, 0x2D538B8B, 0x4167D83E, - 0x3FEE2313, 0xC701CF8C, 0xCC39968E, 0x50AC5695, - 0x4D42C787, 0xA647A8B3, 0x97CF0BEF, 0x825B4537, - 0xEEF864D2, 0xF22090C4, 0xD0E5CD33, 0xA23911AE, - 0xFCD398D9, 0x148FE485, 0x1B017BEF, 0xB6444532, - 0x6A536159, 0x2FF5781C, 0x91FA7934, 0x0DBADEA9, - 0xD65C8A2B, 0xA5A70E75, 0xB1C62456, 0xBC796576, - 0x1921C8F7, 0xE7989AF1, 0x7795D246, 0xD43E3B44 - }; - -// *(uint2x4*)&x[ 0] ^= *((uint2x4*)&p[0]); - #pragma unroll 4 - for(int i=0;i<4;i++){ - x[i*2] ^= p[i].x; - x[i*2+1] ^= p[i].y; - } - rrounds(x); - -// *(uint2x4*)&x[ 0] ^= *((uint2x4*)&p[4]); - #pragma unroll 4 - for(int i=0;i<4;i++){ - x[i*2] ^= p[i+4].x; - x[i*2+1] ^= p[i+4].y; - } - rrounds(x); - - // Padding Block - x[ 0] ^= 0x80; - rrounds(x); - -// Final(x, (BitSequence*)Hash); - x[31] ^= 1; - - /* "the state is then transformed invertibly through 10r identical rounds" */ - #pragma unroll 10 - for (int i = 0;i < 10;++i) - rrounds(x); - - // fugue512 - uint32_t Hash[16]; - #pragma unroll 16 - for(int i = 0; i < 16; i++) - Hash[i] = cuda_swab32(x[i]); - - uint32_t S[36]; - uint32_t B[ 9]; - - S[ 0] = S[ 1] = S[ 2] = S[ 3] = S[ 4] = S[ 5] = S[ 6] = S[ 7] = S[ 8] = S[ 9] = S[10] = S[11] = S[12] = S[13] = S[14] = S[15] = S[16] = S[17] = S[18] = S[19] = 0; - *(uint2x4*)&S[20] = *(uint2x4*)&c_S[ 0]; - *(uint2x4*)&S[28] = *(uint2x4*)&c_S[ 8]; - - FUGUE512_3(Hash[0x0], Hash[0x1], Hash[0x2]); - FUGUE512_3(Hash[0x3], Hash[0x4], Hash[0x5]); - FUGUE512_3(Hash[0x6], Hash[0x7], Hash[0x8]); - FUGUE512_3(Hash[0x9], Hash[0xA], Hash[0xB]); - FUGUE512_3(Hash[0xC], Hash[0xD], Hash[0xE]); - FUGUE512_3(Hash[0xF], 0U, 512U); - - //#pragma unroll 16 - for (uint32_t i = 0; i < 32; i+=2){ - mROR3; - CMIX36(S[ 0], S[ 1], S[ 2], S[ 4], S[ 5], S[ 6], S[18], S[19], S[20]); - SMIX_LDG(shared, S[ 0], S[ 1], S[ 2], S[ 3]); - mROR3; - CMIX36(S[ 0], S[ 1], S[ 2], S[ 4], S[ 5], S[ 6], S[18], S[19], S[20]); - SMIX_LDG(shared, S[ 0], S[ 1], S[ 2], S[ 3]); - } - //#pragma unroll 13 - for (uint32_t i = 0; i < 13; i ++) { - S[ 4] ^= S[ 0]; S[ 9] ^= S[ 0]; S[18] ^= S[ 0]; S[27] ^= S[ 0]; - mROR9; - SMIX_LDG(shared, S[ 0], S[ 1], S[ 2], S[ 3]); - S[ 4] ^= S[ 0]; S[10] ^= S[ 0]; S[18] ^= S[ 0]; S[27] ^= S[ 0]; - mROR9; - SMIX_LDG(shared, S[ 0], S[ 1], S[ 2], S[ 3]); - S[ 4] ^= S[ 0]; S[10] ^= S[ 0]; S[19] ^= S[ 0]; S[27] ^= S[ 0]; - mROR9; - SMIX_LDG(shared, S[ 0], S[ 1], S[ 2], S[ 3]); - S[ 4] ^= S[ 0]; S[10] ^= S[ 0]; S[19] ^= S[ 0]; S[28] ^= S[ 0]; - mROR8; - SMIX_LDG(shared, S[ 0], S[ 1], S[ 2], S[ 3]); - } - S[ 4] ^= S[ 0]; S[ 9] ^= S[ 0]; S[18] ^= S[ 0]; S[27] ^= S[ 0]; - - S[ 0] = cuda_swab32(S[ 1]); S[ 1] = cuda_swab32(S[ 2]); - S[ 2] = cuda_swab32(S[ 3]); S[ 3] = cuda_swab32(S[ 4]); - S[ 4] = cuda_swab32(S[ 9]); S[ 5] = cuda_swab32(S[10]); - S[ 6] = cuda_swab32(S[11]); S[ 7] = cuda_swab32(S[12]); - S[ 8] = cuda_swab32(S[18]); S[ 9] = cuda_swab32(S[19]); - S[10] = cuda_swab32(S[20]); S[11] = cuda_swab32(S[21]); - S[12] = cuda_swab32(S[27]); S[13] = cuda_swab32(S[28]); - S[14] = cuda_swab32(S[29]); S[15] = cuda_swab32(S[30]); - - uint64_t *outpHash = &output64[thread<<3]; - *(uint2x4*)&outpHash[ 0] = *(uint2x4*)&S[ 0]; - *(uint2x4*)&outpHash[ 4] = *(uint2x4*)&S[ 8]; - } -} - -__host__ -void skunk_cuda_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *g_hash) -{ - const dim3 grid((threads + TPB - 1) / TPB); - const dim3 block(TPB); - - uint64_t *d_hash = (uint64_t*) g_hash; - skunk_gpu_hash_80 <<< grid, block >>> (threads, startNounce, d_hash); - - MyStreamSynchronize(NULL, 1, thr_id); -} - -__host__ -void skunk_setBlock_80(int thr_id, void *pdata) -{ - uint64_t message[20]; - memcpy(&message[0], pdata, 80); - - uint64_t p[8]; - uint64_t h[9]; - uint64_t t0, t1, t2; - - h[0] = 0x4903ADFF749C51CEull; - h[1] = 0x0D95DE399746DF03ull; - h[2] = 0x8FD1934127C79BCEull; - h[3] = 0x9A255629FF352CB1ull; - h[4] = 0x5DB62599DF6CA7B0ull; - h[5] = 0xEABE394CA9D5C3F4ull; - h[6] = 0x991112C71A75B523ull; - h[7] = 0xAE18A40B660FCC33ull; - // h[8] = h[0] ^ h[1] ^ h[2] ^ h[3] ^ h[4] ^ h[5] ^ h[6] ^ h[7] ^ SPH_C64(0x1BD11BDAA9FC1A22); - h[8] = 0xcab2076d98173ec4ULL; - - t0 = 64; // ptr - t1 = 0x7000000000000000ull; - t2 = 0x7000000000000040ull; - - memcpy(&p[0], &message[0], 64); - - TFBIG_4e_PRE(0); - TFBIG_4o_PRE(1); - TFBIG_4e_PRE(2); - TFBIG_4o_PRE(3); - TFBIG_4e_PRE(4); - TFBIG_4o_PRE(5); - TFBIG_4e_PRE(6); - TFBIG_4o_PRE(7); - TFBIG_4e_PRE(8); - TFBIG_4o_PRE(9); - TFBIG_4e_PRE(10); - TFBIG_4o_PRE(11); - TFBIG_4e_PRE(12); - TFBIG_4o_PRE(13); - TFBIG_4e_PRE(14); - TFBIG_4o_PRE(15); - TFBIG_4e_PRE(16); - TFBIG_4o_PRE(17); - TFBIG_ADDKEY_PRE(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, 18); - - message[10] = message[0] ^ p[0]; - message[11] = message[1] ^ p[1]; - message[12] = message[2] ^ p[2]; - message[13] = message[3] ^ p[3]; - message[14] = message[4] ^ p[4]; - message[15] = message[5] ^ p[5]; - message[16] = message[6] ^ p[6]; - message[17] = message[7] ^ p[7]; - message[18] = t2; - - uint64_t buffer[128]; - -// buffer[ 0] = message[ 8]; - buffer[ 0] = message[ 9]; - h[0] = buffer[ 1] = message[10]; - h[1] = buffer[ 2] = message[11]; - h[2] = buffer[ 3] = message[12]; - h[3] = buffer[ 4] = message[13]; - h[4] = buffer[ 5] = message[14]; - h[5] = buffer[ 6] = message[15]; - h[6] = buffer[ 7] = message[16]; - h[7] = buffer[ 8] = message[17]; - h[8] = buffer[ 9] = h[0]^h[1]^h[2]^h[3]^h[4]^h[5]^h[6]^h[7]^0x1BD11BDAA9FC1A22ULL; - - t0 = 0x50ull; - t1 = 0xB000000000000000ull; - t2 = t0^t1; - - p[0] = message[ 8] + h[0]; - p[2] = h[2]; p[3] = h[3]; p[4] = h[4]; - p[5] = h[5] + t0; - p[6] = h[6] + t1; - p[7] = h[7]; - - p[2] += p[3]; - p[4] += p[5]; p[6] += p[7]; - - p[3] = ROTL64(p[3], 36) ^ p[2]; - p[5] = ROTL64(p[5], 19) ^ p[4]; - p[7] = ROTL64(p[7], 37) ^ p[6]; - p[4] += p[7]; p[6] += p[5]; - - p[7] = ROTL64(p[7], 27) ^ p[4]; - p[5] = ROTL64(p[5], 14) ^ p[6]; - - buffer[10] = p[ 0]; - buffer[11] = p[ 2]; - buffer[12] = p[ 3]; - buffer[13] = p[ 4]; - buffer[14] = p[ 5]; - buffer[15] = p[ 6]; - buffer[16] = p[ 7]; - buffer[17] = ROTL64(p[3], 42); - buffer[18] = ROTL64(p[5], 36); - buffer[19] = ROTL64(p[7], 39); - - buffer[20] = h[6]+t1; - buffer[21] = h[8]+1; - buffer[22] = h[7]+t2; - buffer[23] = h[0]+2; - buffer[24] = h[8]+t0; - buffer[25] = h[1]+3; - buffer[26] = h[0]+t1; - buffer[27] = h[2]+4; - buffer[28] = h[1]+t2; - buffer[29] = h[3]+5; - buffer[30] = h[2]+t0; - buffer[31] = h[4]+6; - buffer[32] = h[3]+t1; - buffer[33] = h[5]+7; - buffer[34] = h[4]+t2; - buffer[35] = h[6]+8; - buffer[36] = h[5]+t0; - buffer[37] = h[7]+9; - buffer[38] = h[6]+t1; - buffer[39] = h[8]+10; - buffer[40] = h[7]+t2; - buffer[41] = h[0]+11; - buffer[42] = h[8]+t0; - buffer[43] = h[1]+12; - buffer[44] = h[0]+t1; - buffer[45] = h[2]+13; - buffer[46] = h[1]+t2; - buffer[47] = h[3]+14; - buffer[48] = h[2]+t0; - buffer[49] = h[4]+15; - buffer[50] = h[3]+t1; - buffer[51] = h[5]+16; - buffer[52] = h[4]+t2; - buffer[53] = h[6]+17; - buffer[54] = h[5]+t0; - buffer[55] = h[7]+18; - buffer[56] = h[6]+t1; - - buffer[57] = message[ 8]; - - cudaMemcpyToSymbol(c_buffer, buffer, sizeof(c_buffer), 0, cudaMemcpyHostToDevice); - CUDA_LOG_ERROR(); -} - -__host__ -void skunk_cpu_init(int thr_id, uint32_t threads) -{ - cuda_get_arch(thr_id); -} - diff --git a/skunk/cuda_skunk_streebog.cu b/skunk/cuda_skunk_streebog.cu deleted file mode 100644 index 36ec7923..00000000 --- a/skunk/cuda_skunk_streebog.cu +++ /dev/null @@ -1,371 +0,0 @@ -/* - * Streebog GOST R 34.10-2012 stripped CUDA implementation for final hash - * - * https://tools.ietf.org/html/rfc6986 - * https://en.wikipedia.org/wiki/Streebog - * - * ==========================(LICENSE BEGIN)============================ - * - * @author Tanguy Pruvot - 2017 - * @author Alexis Provos - 2016 - */ - -// Further improved with shared memory partial utilization -// Tested under CUDA7.5 toolkit for cp 5.0/5.2 - -#include -#include -#include -#include - -#include "x11/streebog_arrays.cuh" - -//#define FULL_UNROLL -__device__ __forceinline__ -static void GOST_FS(const uint2 shared[8][256],const uint2 *const __restrict__ state,uint2* return_state) -{ - return_state[0] = __ldg(&T02[__byte_perm(state[7].x,0,0x44440)]) - ^ shared[1][__byte_perm(state[6].x,0,0x44440)] - ^ shared[2][__byte_perm(state[5].x,0,0x44440)] - ^ shared[3][__byte_perm(state[4].x,0,0x44440)] - ^ shared[4][__byte_perm(state[3].x,0,0x44440)] - ^ shared[5][__byte_perm(state[2].x,0,0x44440)] - ^ shared[6][__byte_perm(state[1].x,0,0x44440)] - ^ __ldg(&T72[__byte_perm(state[0].x,0,0x44440)]); - - return_state[1] = __ldg(&T02[__byte_perm(state[7].x,0,0x44441)]) - ^ __ldg(&T12[__byte_perm(state[6].x,0,0x44441)]) - ^ shared[2][__byte_perm(state[5].x,0,0x44441)] - ^ shared[3][__byte_perm(state[4].x,0,0x44441)] - ^ shared[4][__byte_perm(state[3].x,0,0x44441)] - ^ shared[5][__byte_perm(state[2].x,0,0x44441)] - ^ shared[6][__byte_perm(state[1].x,0,0x44441)] - ^ __ldg(&T72[__byte_perm(state[0].x,0,0x44441)]); - - return_state[2] = __ldg(&T02[__byte_perm(state[7].x,0,0x44442)]) - ^ __ldg(&T12[__byte_perm(state[6].x,0,0x44442)]) - ^ shared[2][__byte_perm(state[5].x,0,0x44442)] - ^ shared[3][__byte_perm(state[4].x,0,0x44442)] - ^ shared[4][__byte_perm(state[3].x,0,0x44442)] - ^ shared[5][__byte_perm(state[2].x,0,0x44442)] - ^ __ldg(&T72[__byte_perm(state[0].x,0,0x44442)]) - ^ shared[6][__byte_perm(state[1].x,0,0x44442)]; - - return_state[3] = __ldg(&T02[__byte_perm(state[7].x,0,0x44443)]) - ^ shared[1][__byte_perm(state[6].x,0,0x44443)] - ^ shared[2][__byte_perm(state[5].x,0,0x44443)] - ^ shared[3][__byte_perm(state[4].x,0,0x44443)] - ^ __ldg(&T42[__byte_perm(state[3].x,0,0x44443)]) - ^ shared[5][__byte_perm(state[2].x,0,0x44443)] - ^ __ldg(&T72[__byte_perm(state[0].x,0,0x44443)]) - ^ shared[6][__byte_perm(state[1].x,0,0x44443)]; - - return_state[4] = __ldg(&T02[__byte_perm(state[7].y,0,0x44440)]) - ^ shared[1][__byte_perm(state[6].y,0,0x44440)] - ^ __ldg(&T22[__byte_perm(state[5].y,0,0x44440)]) - ^ shared[3][__byte_perm(state[4].y,0,0x44440)] - ^ shared[4][__byte_perm(state[3].y,0,0x44440)] - ^ __ldg(&T62[__byte_perm(state[1].y,0,0x44440)]) - ^ shared[5][__byte_perm(state[2].y,0,0x44440)] - ^ __ldg(&T72[__byte_perm(state[0].y,0,0x44440)]); - - return_state[5] = __ldg(&T02[__byte_perm(state[7].y,0,0x44441)]) - ^ shared[2][__byte_perm(state[5].y,0,0x44441)] - ^ __ldg(&T12[__byte_perm(state[6].y,0,0x44441)]) - ^ shared[3][__byte_perm(state[4].y,0,0x44441)] - ^ shared[4][__byte_perm(state[3].y,0,0x44441)] - ^ shared[5][__byte_perm(state[2].y,0,0x44441)] - ^ __ldg(&T62[__byte_perm(state[1].y,0,0x44441)]) - ^ __ldg(&T72[__byte_perm(state[0].y,0,0x44441)]); - - return_state[6] = __ldg(&T02[__byte_perm(state[7].y,0,0x44442)]) - ^ shared[1][__byte_perm(state[6].y,0,0x44442)] - ^ shared[2][__byte_perm(state[5].y,0,0x44442)] - ^ shared[3][__byte_perm(state[4].y,0,0x44442)] - ^ shared[4][__byte_perm(state[3].y,0,0x44442)] - ^ shared[5][__byte_perm(state[2].y,0,0x44442)] - ^ __ldg(&T62[__byte_perm(state[1].y,0,0x44442)]) - ^ __ldg(&T72[__byte_perm(state[0].y,0,0x44442)]); - - return_state[7] = __ldg(&T02[__byte_perm(state[7].y,0,0x44443)]) - ^ __ldg(&T12[__byte_perm(state[6].y,0,0x44443)]) - ^ shared[2][__byte_perm(state[5].y,0,0x44443)] - ^ shared[3][__byte_perm(state[4].y,0,0x44443)] - ^ shared[4][__byte_perm(state[3].y,0,0x44443)] - ^ shared[5][__byte_perm(state[2].y,0,0x44443)] - ^ __ldg(&T62[__byte_perm(state[1].y,0,0x44443)]) - ^ __ldg(&T72[__byte_perm(state[0].y,0,0x44443)]); -} - -__device__ __forceinline__ -static void GOST_FS_LDG(const uint2 shared[8][256],const uint2 *const __restrict__ state,uint2* return_state) -{ - return_state[0] = __ldg(&T02[__byte_perm(state[7].x,0,0x44440)]) - ^ __ldg(&T12[__byte_perm(state[6].x,0,0x44440)]) - ^ shared[2][__byte_perm(state[5].x,0,0x44440)] - ^ shared[3][__byte_perm(state[4].x,0,0x44440)] - ^ shared[4][__byte_perm(state[3].x,0,0x44440)] - ^ shared[5][__byte_perm(state[2].x,0,0x44440)] - ^ shared[6][__byte_perm(state[1].x,0,0x44440)] - ^ __ldg(&T72[__byte_perm(state[0].x,0,0x44440)]); - - return_state[1] = __ldg(&T02[__byte_perm(state[7].x,0,0x44441)]) - ^ __ldg(&T12[__byte_perm(state[6].x,0,0x44441)]) - ^ shared[2][__byte_perm(state[5].x,0,0x44441)] - ^ shared[3][__byte_perm(state[4].x,0,0x44441)] - ^ shared[4][__byte_perm(state[3].x,0,0x44441)] - ^ shared[5][__byte_perm(state[2].x,0,0x44441)] - ^ __ldg(&T72[__byte_perm(state[0].x,0,0x44441)]) - ^ shared[6][__byte_perm(state[1].x,0,0x44441)]; - - return_state[2] = __ldg(&T02[__byte_perm(state[7].x,0,0x44442)]) - ^ __ldg(&T12[__byte_perm(state[6].x,0,0x44442)]) - ^ shared[2][__byte_perm(state[5].x,0,0x44442)] - ^ shared[3][__byte_perm(state[4].x,0,0x44442)] - ^ shared[4][__byte_perm(state[3].x,0,0x44442)] - ^ shared[5][__byte_perm(state[2].x,0,0x44442)] - ^ shared[6][__byte_perm(state[1].x,0,0x44442)] - ^ __ldg(&T72[__byte_perm(state[0].x,0,0x44442)]); - - return_state[3] = __ldg(&T02[__byte_perm(state[7].x,0,0x44443)]) - ^ __ldg(&T12[__byte_perm(state[6].x,0,0x44443)]) - ^ shared[2][__byte_perm(state[5].x,0,0x44443)] - ^ shared[3][__byte_perm(state[4].x,0,0x44443)] - ^ shared[4][__byte_perm(state[3].x,0,0x44443)] - ^ shared[5][__byte_perm(state[2].x,0,0x44443)] - ^ shared[6][__byte_perm(state[1].x,0,0x44443)] - ^ __ldg(&T72[__byte_perm(state[0].x,0,0x44443)]); - - return_state[4] = __ldg(&T02[__byte_perm(state[7].y,0,0x44440)]) - ^ shared[1][__byte_perm(state[6].y,0,0x44440)] - ^ __ldg(&T22[__byte_perm(state[5].y,0,0x44440)]) - ^ shared[3][__byte_perm(state[4].y,0,0x44440)] - ^ shared[4][__byte_perm(state[3].y,0,0x44440)] - ^ shared[5][__byte_perm(state[2].y,0,0x44440)] - ^ __ldg(&T72[__byte_perm(state[0].y,0,0x44440)]) - ^ __ldg(&T62[__byte_perm(state[1].y,0,0x44440)]); - - return_state[5] = __ldg(&T02[__byte_perm(state[7].y,0,0x44441)]) - ^ __ldg(&T12[__byte_perm(state[6].y,0,0x44441)]) - ^ shared[2][__byte_perm(state[5].y,0,0x44441)] - ^ shared[3][__byte_perm(state[4].y,0,0x44441)] - ^ shared[4][__byte_perm(state[3].y,0,0x44441)] - ^ shared[5][__byte_perm(state[2].y,0,0x44441)] - ^ __ldg(&T72[__byte_perm(state[0].y,0,0x44441)]) - ^ __ldg(&T62[__byte_perm(state[1].y,0,0x44441)]); - - return_state[6] = __ldg(&T02[__byte_perm(state[7].y,0,0x44442)]) - ^ __ldg(&T12[__byte_perm(state[6].y,0,0x44442)]) - ^ __ldg(&T22[__byte_perm(state[5].y,0,0x44442)]) - ^ shared[3][__byte_perm(state[4].y,0,0x44442)] - ^ shared[4][__byte_perm(state[3].y,0,0x44442)] - ^ shared[5][__byte_perm(state[2].y,0,0x44442)] - ^ __ldg(&T72[__byte_perm(state[0].y,0,0x44442)]) - ^ __ldg(&T62[__byte_perm(state[1].y,0,0x44442)]); - - return_state[7] = __ldg(&T02[__byte_perm(state[7].y,0,0x44443)]) - ^ shared[1][__byte_perm(state[6].y,0,0x44443)] - ^ __ldg(&T22[__byte_perm(state[5].y,0,0x44443)]) - ^ shared[3][__byte_perm(state[4].y,0,0x44443)] - ^ shared[4][__byte_perm(state[3].y,0,0x44443)] - ^ shared[5][__byte_perm(state[2].y,0,0x44443)] - ^ __ldg(&T72[__byte_perm(state[0].y,0,0x44443)]) - ^ __ldg(&T62[__byte_perm(state[1].y,0,0x44443)]); -} - -__device__ __forceinline__ -static void GOST_E12(const uint2 shared[8][256],uint2 *const __restrict__ K, uint2 *const __restrict__ state) -{ - uint2 t[ 8]; - //#pragma unroll 12 - for(int i=0; i<12; i++){ - GOST_FS(shared,state, t); - - #pragma unroll 8 - for(int j=0;j<8;j++) - K[ j] ^= *(uint2*)&CC[i][j]; - - #pragma unroll 8 - for(int j=0;j<8;j++) - state[ j] = t[ j]; - - GOST_FS_LDG(shared,K, t); - - #pragma unroll 8 - for(int j=0;j<8;j++) - state[ j]^= t[ j]; - - #pragma unroll 8 - for(int j=0;j<8;j++) - K[ j] = t[ j]; - } -} - -__constant__ uint64_t target64[4]; - -__host__ -void skunk_streebog_set_target(uint32_t* ptarget) -{ - cudaMemcpyToSymbol(target64, ptarget, 4*sizeof(uint64_t), 0, cudaMemcpyHostToDevice); -} - -#define TPB 256 -__global__ -__launch_bounds__(TPB, 2) -void skunk_streebog_gpu_final_64(uint64_t *g_hash, uint32_t* resNonce) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - uint2 buf[8], t[8], temp[8], K0[8], hash[8]; - - __shared__ uint2 shared[8][256]; - shared[0][threadIdx.x] = __ldg(&T02[threadIdx.x]); - shared[1][threadIdx.x] = __ldg(&T12[threadIdx.x]); - shared[2][threadIdx.x] = __ldg(&T22[threadIdx.x]); - shared[3][threadIdx.x] = __ldg(&T32[threadIdx.x]); - shared[4][threadIdx.x] = __ldg(&T42[threadIdx.x]); - shared[5][threadIdx.x] = __ldg(&T52[threadIdx.x]); - shared[6][threadIdx.x] = __ldg(&T62[threadIdx.x]); - shared[7][threadIdx.x] = __ldg(&T72[threadIdx.x]); - -// if (thread < threads) -// { - uint64_t* inout = &g_hash[thread<<3]; - *(uint2x4*)&hash[0] = __ldg4((uint2x4*)&inout[0]); - *(uint2x4*)&hash[4] = __ldg4((uint2x4*)&inout[4]); - - __threadfence_block(); - - K0[0] = vectorize(0x74a5d4ce2efc83b3); - - #pragma unroll 8 - for(uint32_t i=0;i<8;i++){ - buf[ i] = hash[ i] ^ K0[ 0]; - } - //#pragma unroll 12 - for(int i=0; i<12; i++){ - GOST_FS(shared, buf, temp); - #pragma unroll 8 - for(uint32_t j=0;j<8;j++){ - buf[ j] = temp[ j] ^ *(uint2*)&precomputed_values[i][j]; - } - } - #pragma unroll 8 - for(int j=0;j<8;j++){ - buf[ j]^= hash[ j]; - } - #pragma unroll 8 - for(int j=0;j<8;j++){ - K0[ j] = buf[ j]; - } - - K0[7].y ^= 0x00020000; - - GOST_FS(shared, K0, t); - - #pragma unroll 8 - for(uint32_t i=0;i<8;i++) - K0[ i] = t[ i]; - - t[7].y ^= 0x01000000; - GOST_E12(shared, K0, t); - - #pragma unroll 8 - for(int j=0;j<8;j++) - buf[ j] ^= t[ j]; - - buf[7].y ^= 0x01000000; - - GOST_FS(shared, buf,K0); - - buf[7].y ^= 0x00020000; - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++) - t[ j] = K0[ j]; - - t[7].y ^= 0x00020000; - GOST_E12(shared, K0, t); - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++) - buf[ j] ^= t[ j]; - - GOST_FS(shared, buf,K0); // K = F(h) - - hash[7]+= vectorize(0x0100000000000000); - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++) - t[ j] = K0[ j] ^ hash[ j]; - -// #pragma unroll - for(uint32_t i=0; i<10; i++){ - GOST_FS(shared, t, temp); - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++){ - t[ j] = temp[ j]; - K0[ j] = K0[ j] ^ *(uint2*)&CC[ i][ j]; - } - - GOST_FS(shared, K0, temp); - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++){ - K0[ j] = temp[ j]; - t[ j]^= temp[ j]; - } - } - - GOST_FS(shared, t, temp); - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++){ - t[ j] = temp[ j]; - K0[ j] = K0[ j] ^ *(uint2*)&CC[10][ j]; - } - - GOST_FS(shared, K0, temp); - - #pragma unroll 8 - for(int i=7;i>=0;i--){ - t[i].x = t[i].x ^ temp[i].x; - temp[i].x = temp[i].x ^ ((uint32_t*)&CC[11])[i<<1]; - } - - uint2 last[2]; - -#define T0(x) shared[0][x] -#define T1(x) shared[1][x] -#define T2(x) shared[2][x] -#define T3(x) shared[3][x] -#define T4(x) shared[4][x] -#define T5(x) shared[5][x] -#define T6(x) shared[6][x] -#define T7(x) shared[7][x] - - last[ 0] = T0(__byte_perm(t[7].x,0,0x44443)) ^ T1(__byte_perm(t[6].x,0,0x44443)) - ^ T2(__byte_perm(t[5].x,0,0x44443)) ^ T3(__byte_perm(t[4].x,0,0x44443)) - ^ T4(__byte_perm(t[3].x,0,0x44443)) ^ T5(__byte_perm(t[2].x,0,0x44443)) - ^ T6(__byte_perm(t[1].x,0,0x44443)) ^ T7(__byte_perm(t[0].x,0,0x44443)); - - last[ 1] = T0(__byte_perm(temp[7].x,0,0x44443)) ^ T1(__byte_perm(temp[6].x,0,0x44443)) - ^ T2(__byte_perm(temp[5].x,0,0x44443)) ^ T3(__byte_perm(temp[4].x,0,0x44443)) - ^ T4(__byte_perm(temp[3].x,0,0x44443)) ^ T5(__byte_perm(temp[2].x,0,0x44443)) - ^ T6(__byte_perm(temp[1].x,0,0x44443)) ^ T7(__byte_perm(temp[0].x,0,0x44443)); - - if(devectorize(buf[3] ^ hash[3] ^ last[ 0] ^ last[ 1]) <= target64[3]){ - uint32_t tmp = atomicExch(&resNonce[0], thread); - if (tmp != UINT32_MAX) - resNonce[1] = tmp; - } -} - -__host__ -void skunk_cuda_streebog(int thr_id, uint32_t threads, uint32_t *d_hash, uint32_t* d_resNonce) -{ - dim3 grid((threads + TPB-1) / TPB); - dim3 block(TPB); - - skunk_streebog_gpu_final_64 <<< grid, block >>> ((uint64_t*)d_hash, d_resNonce); -} diff --git a/skunk/skein_header.h b/skunk/skein_header.h deleted file mode 100644 index 460b311f..00000000 --- a/skunk/skein_header.h +++ /dev/null @@ -1,385 +0,0 @@ -/* Elementary defines for SKEIN */ - -/* - * M9_ ## s ## _ ## i evaluates to s+i mod 9 (0 <= s <= 18, 0 <= i <= 7). - */ - -#define M9_0_0 0 -#define M9_0_1 1 -#define M9_0_2 2 -#define M9_0_3 3 -#define M9_0_4 4 -#define M9_0_5 5 -#define M9_0_6 6 -#define M9_0_7 7 - -#define M9_1_0 1 -#define M9_1_1 2 -#define M9_1_2 3 -#define M9_1_3 4 -#define M9_1_4 5 -#define M9_1_5 6 -#define M9_1_6 7 -#define M9_1_7 8 - -#define M9_2_0 2 -#define M9_2_1 3 -#define M9_2_2 4 -#define M9_2_3 5 -#define M9_2_4 6 -#define M9_2_5 7 -#define M9_2_6 8 -#define M9_2_7 0 - -#define M9_3_0 3 -#define M9_3_1 4 -#define M9_3_2 5 -#define M9_3_3 6 -#define M9_3_4 7 -#define M9_3_5 8 -#define M9_3_6 0 -#define M9_3_7 1 - -#define M9_4_0 4 -#define M9_4_1 5 -#define M9_4_2 6 -#define M9_4_3 7 -#define M9_4_4 8 -#define M9_4_5 0 -#define M9_4_6 1 -#define M9_4_7 2 - -#define M9_5_0 5 -#define M9_5_1 6 -#define M9_5_2 7 -#define M9_5_3 8 -#define M9_5_4 0 -#define M9_5_5 1 -#define M9_5_6 2 -#define M9_5_7 3 - -#define M9_6_0 6 -#define M9_6_1 7 -#define M9_6_2 8 -#define M9_6_3 0 -#define M9_6_4 1 -#define M9_6_5 2 -#define M9_6_6 3 -#define M9_6_7 4 - -#define M9_7_0 7 -#define M9_7_1 8 -#define M9_7_2 0 -#define M9_7_3 1 -#define M9_7_4 2 -#define M9_7_5 3 -#define M9_7_6 4 -#define M9_7_7 5 - -#define M9_8_0 8 -#define M9_8_1 0 -#define M9_8_2 1 -#define M9_8_3 2 -#define M9_8_4 3 -#define M9_8_5 4 -#define M9_8_6 5 -#define M9_8_7 6 - -#define M9_9_0 0 -#define M9_9_1 1 -#define M9_9_2 2 -#define M9_9_3 3 -#define M9_9_4 4 -#define M9_9_5 5 -#define M9_9_6 6 -#define M9_9_7 7 - -#define M9_10_0 1 -#define M9_10_1 2 -#define M9_10_2 3 -#define M9_10_3 4 -#define M9_10_4 5 -#define M9_10_5 6 -#define M9_10_6 7 -#define M9_10_7 8 - -#define M9_11_0 2 -#define M9_11_1 3 -#define M9_11_2 4 -#define M9_11_3 5 -#define M9_11_4 6 -#define M9_11_5 7 -#define M9_11_6 8 -#define M9_11_7 0 - -#define M9_12_0 3 -#define M9_12_1 4 -#define M9_12_2 5 -#define M9_12_3 6 -#define M9_12_4 7 -#define M9_12_5 8 -#define M9_12_6 0 -#define M9_12_7 1 - -#define M9_13_0 4 -#define M9_13_1 5 -#define M9_13_2 6 -#define M9_13_3 7 -#define M9_13_4 8 -#define M9_13_5 0 -#define M9_13_6 1 -#define M9_13_7 2 - -#define M9_14_0 5 -#define M9_14_1 6 -#define M9_14_2 7 -#define M9_14_3 8 -#define M9_14_4 0 -#define M9_14_5 1 -#define M9_14_6 2 -#define M9_14_7 3 - -#define M9_15_0 6 -#define M9_15_1 7 -#define M9_15_2 8 -#define M9_15_3 0 -#define M9_15_4 1 -#define M9_15_5 2 -#define M9_15_6 3 -#define M9_15_7 4 - -#define M9_16_0 7 -#define M9_16_1 8 -#define M9_16_2 0 -#define M9_16_3 1 -#define M9_16_4 2 -#define M9_16_5 3 -#define M9_16_6 4 -#define M9_16_7 5 - -#define M9_17_0 8 -#define M9_17_1 0 -#define M9_17_2 1 -#define M9_17_3 2 -#define M9_17_4 3 -#define M9_17_5 4 -#define M9_17_6 5 -#define M9_17_7 6 - -#define M9_18_0 0 -#define M9_18_1 1 -#define M9_18_2 2 -#define M9_18_3 3 -#define M9_18_4 4 -#define M9_18_5 5 -#define M9_18_6 6 -#define M9_18_7 7 - -/* - * M3_ ## s ## _ ## i evaluates to s+i mod 3 (0 <= s <= 18, 0 <= i <= 1). - */ - -#define M3_0_0 0 -#define M3_0_1 1 -#define M3_1_0 1 -#define M3_1_1 2 -#define M3_2_0 2 -#define M3_2_1 0 -#define M3_3_0 0 -#define M3_3_1 1 -#define M3_4_0 1 -#define M3_4_1 2 -#define M3_5_0 2 -#define M3_5_1 0 -#define M3_6_0 0 -#define M3_6_1 1 -#define M3_7_0 1 -#define M3_7_1 2 -#define M3_8_0 2 -#define M3_8_1 0 -#define M3_9_0 0 -#define M3_9_1 1 -#define M3_10_0 1 -#define M3_10_1 2 -#define M3_11_0 2 -#define M3_11_1 0 -#define M3_12_0 0 -#define M3_12_1 1 -#define M3_13_0 1 -#define M3_13_1 2 -#define M3_14_0 2 -#define M3_14_1 0 -#define M3_15_0 0 -#define M3_15_1 1 -#define M3_16_0 1 -#define M3_16_1 2 -#define M3_17_0 2 -#define M3_17_1 0 -#define M3_18_0 0 -#define M3_18_1 1 - -#define XCAT(x, y) XCAT_(x, y) -#define XCAT_(x, y) x ## y - -#define SKBI(k, s, i) XCAT(k, XCAT(XCAT(XCAT(M9_, s), _), i)) -#define SKBT(t, s, v) XCAT(t, XCAT(XCAT(XCAT(M3_, s), _), v)) - -#define TFBIG_ADDKEY(w0, w1, w2, w3, w4, w5, w6, w7, k, t, s) { \ - w0 = (w0 + SKBI(k, s, 0)); \ - w1 = (w1 + SKBI(k, s, 1)); \ - w2 = (w2 + SKBI(k, s, 2)); \ - w3 = (w3 + SKBI(k, s, 3)); \ - w4 = (w4 + SKBI(k, s, 4)); \ - w5 = (w5 + SKBI(k, s, 5) + SKBT(t, s, 0)); \ - w6 = (w6 + SKBI(k, s, 6) + SKBT(t, s, 1)); \ - w7 = (w7 + SKBI(k, s, 7) + make_uint2(s,0); \ - } - -#define TFBIG_MIX(x0, x1, rc) { \ - x0 = x0 + x1; \ - x1 = ROL2(x1, rc) ^ x0; \ - } - -#define TFBIG_MIX8(w0, w1, w2, w3, w4, w5, w6, w7, rc0, rc1, rc2, rc3) { \ - TFBIG_MIX(w0, w1, rc0); \ - TFBIG_MIX(w2, w3, rc1); \ - TFBIG_MIX(w4, w5, rc2); \ - TFBIG_MIX(w6, w7, rc3); \ - } - -#define TFBIG_4e(s) { \ - TFBIG_ADDKEY(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, s); \ - TFBIG_MIX8(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], 46, 36, 19, 37); \ - TFBIG_MIX8(p[2], p[1], p[4], p[7], p[6], p[5], p[0], p[3], 33, 27, 14, 42); \ - TFBIG_MIX8(p[4], p[1], p[6], p[3], p[0], p[5], p[2], p[7], 17, 49, 36, 39); \ - TFBIG_MIX8(p[6], p[1], p[0], p[7], p[2], p[5], p[4], p[3], 44, 9, 54, 56); \ - } - -#define TFBIG_4o(s) { \ - TFBIG_ADDKEY(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, s); \ - TFBIG_MIX8(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], 39, 30, 34, 24); \ - TFBIG_MIX8(p[2], p[1], p[4], p[7], p[6], p[5], p[0], p[3], 13, 50, 10, 17); \ - TFBIG_MIX8(p[4], p[1], p[6], p[3], p[0], p[5], p[2], p[7], 25, 29, 39, 43); \ - TFBIG_MIX8(p[6], p[1], p[0], p[7], p[2], p[5], p[4], p[3], 8, 35, 56, 22); \ - } - -#define TFBIG_KINIT_UI2(k0, k1, k2, k3, k4, k5, k6, k7, k8, t0, t1, t2) { \ - k8 = ((k0 ^ k1) ^ (k2 ^ k3)) ^ ((k4 ^ k5) ^ (k6 ^ k7)) \ - ^ vectorize(0x1BD11BDAA9FC1A22); \ - t2 = t0 ^ t1; \ - } - -#define TFBIG_ADDKEY_UI2(w0, w1, w2, w3, w4, w5, w6, w7, k, t, s) { \ - w0 = (w0 + SKBI(k, s, 0)); \ - w1 = (w1 + SKBI(k, s, 1)); \ - w2 = (w2 + SKBI(k, s, 2)); \ - w3 = (w3 + SKBI(k, s, 3)); \ - w4 = (w4 + SKBI(k, s, 4)); \ - w5 = (w5 + SKBI(k, s, 5) + SKBT(t, s, 0)); \ - w6 = (w6 + SKBI(k, s, 6) + SKBT(t, s, 1)); \ - w7 = (w7 + SKBI(k, s, 7) + vectorize(s)); \ - } - -#define TFBIG_ADDKEY_PRE(w0, w1, w2, w3, w4, w5, w6, w7, k, t, s) { \ - w0 = (w0 + SKBI(k, s, 0)); \ - w1 = (w1 + SKBI(k, s, 1)); \ - w2 = (w2 + SKBI(k, s, 2)); \ - w3 = (w3 + SKBI(k, s, 3)); \ - w4 = (w4 + SKBI(k, s, 4)); \ - w5 = (w5 + SKBI(k, s, 5) + SKBT(t, s, 0)); \ - w6 = (w6 + SKBI(k, s, 6) + SKBT(t, s, 1)); \ - w7 = (w7 + SKBI(k, s, 7) + (s)); \ - } - -#define TFBIG_MIX_UI2(x0, x1, rc) { \ - x0 = x0 + x1; \ - x1 = ROL2(x1, rc) ^ x0; \ - } - -#define TFBIG_MIX_PRE(x0, x1, rc) { \ - x0 = x0 + x1; \ - x1 = ROTL64(x1, rc) ^ x0; \ - } - -#define TFBIG_MIX8_UI2(w0, w1, w2, w3, w4, w5, w6, w7, rc0, rc1, rc2, rc3) { \ - TFBIG_MIX_UI2(w0, w1, rc0); \ - TFBIG_MIX_UI2(w2, w3, rc1); \ - TFBIG_MIX_UI2(w4, w5, rc2); \ - TFBIG_MIX_UI2(w6, w7, rc3); \ - } - -#define TFBIG_MIX8_PRE(w0, w1, w2, w3, w4, w5, w6, w7, rc0, rc1, rc2, rc3) { \ - TFBIG_MIX_PRE(w0, w1, rc0); \ - TFBIG_MIX_PRE(w2, w3, rc1); \ - TFBIG_MIX_PRE(w4, w5, rc2); \ - TFBIG_MIX_PRE(w6, w7, rc3); \ - } - -#define TFBIG_4e_UI2(s) { \ - TFBIG_ADDKEY_UI2(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, s); \ - TFBIG_MIX8_UI2(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], 46, 36, 19, 37); \ - TFBIG_MIX8_UI2(p[2], p[1], p[4], p[7], p[6], p[5], p[0], p[3], 33, 27, 14, 42); \ - TFBIG_MIX8_UI2(p[4], p[1], p[6], p[3], p[0], p[5], p[2], p[7], 17, 49, 36, 39); \ - TFBIG_MIX8_UI2(p[6], p[1], p[0], p[7], p[2], p[5], p[4], p[3], 44, 9, 54, 56); \ - } - -#define TFBIG_4e_PRE(s) { \ - TFBIG_ADDKEY_PRE(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, s); \ - TFBIG_MIX8_PRE(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], 46, 36, 19, 37); \ - TFBIG_MIX8_PRE(p[2], p[1], p[4], p[7], p[6], p[5], p[0], p[3], 33, 27, 14, 42); \ - TFBIG_MIX8_PRE(p[4], p[1], p[6], p[3], p[0], p[5], p[2], p[7], 17, 49, 36, 39); \ - TFBIG_MIX8_PRE(p[6], p[1], p[0], p[7], p[2], p[5], p[4], p[3], 44, 9, 54, 56); \ - } - -#define TFBIG_4o_UI2(s) { \ - TFBIG_ADDKEY_UI2(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, s); \ - TFBIG_MIX8_UI2(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], 39, 30, 34, 24); \ - TFBIG_MIX8_UI2(p[2], p[1], p[4], p[7], p[6], p[5], p[0], p[3], 13, 50, 10, 17); \ - TFBIG_MIX8_UI2(p[4], p[1], p[6], p[3], p[0], p[5], p[2], p[7], 25, 29, 39, 43); \ - TFBIG_MIX8_UI2(p[6], p[1], p[0], p[7], p[2], p[5], p[4], p[3], 8, 35, 56, 22); \ - } - -#define TFBIG_4o_PRE(s) { \ - TFBIG_ADDKEY_PRE(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, s); \ - TFBIG_MIX8_PRE(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], 39, 30, 34, 24); \ - TFBIG_MIX8_PRE(p[2], p[1], p[4], p[7], p[6], p[5], p[0], p[3], 13, 50, 10, 17); \ - TFBIG_MIX8_PRE(p[4], p[1], p[6], p[3], p[0], p[5], p[2], p[7], 25, 29, 39, 43); \ - TFBIG_MIX8_PRE(p[6], p[1], p[0], p[7], p[2], p[5], p[4], p[3], 8, 35, 56, 22); \ - } - -#define TFBIGMIX8e(){\ - p[ 0]+=p[ 1];p[ 2]+=p[ 3];p[ 4]+=p[ 5];p[ 6]+=p[ 7];p[ 1]=ROL2(p[ 1],46) ^ p[ 0];p[ 3]=ROL2(p[ 3],36) ^ p[ 2];p[ 5]=ROL2(p[ 5],19) ^ p[ 4];p[ 7]=ROL2(p[ 7],37) ^ p[ 6];\ - p[ 2]+=p[ 1];p[ 4]+=p[ 7];p[ 6]+=p[ 5];p[ 0]+=p[ 3];p[ 1]=ROL2(p[ 1],33) ^ p[ 2];p[ 7]=ROL2(p[ 7],27) ^ p[ 4];p[ 5]=ROL2(p[ 5],14) ^ p[ 6];p[ 3]=ROL2(p[ 3],42) ^ p[ 0];\ - p[ 4]+=p[ 1];p[ 6]+=p[ 3];p[ 0]+=p[ 5];p[ 2]+=p[ 7];p[ 1]=ROL2(p[ 1],17) ^ p[ 4];p[ 3]=ROL2(p[ 3],49) ^ p[ 6];p[ 5]=ROL2(p[ 5],36) ^ p[ 0];p[ 7]=ROL2(p[ 7],39) ^ p[ 2];\ - p[ 6]+=p[ 1];p[ 0]+=p[ 7];p[ 2]+=p[ 5];p[ 4]+=p[ 3];p[ 1]=ROL2(p[ 1],44) ^ p[ 6];p[ 7]=ROL2(p[ 7], 9) ^ p[ 0];p[ 5]=ROL2(p[ 5],54) ^ p[ 2];p[ 3]=ROR8(p[ 3]) ^ p[ 4];\ -} -#define TFBIGMIX8o(){\ - p[ 0]+=p[ 1];p[ 2]+=p[ 3];p[ 4]+=p[ 5];p[ 6]+=p[ 7];p[ 1]=ROL2(p[ 1],39) ^ p[ 0];p[ 3]=ROL2(p[ 3],30) ^ p[ 2];p[ 5]=ROL2(p[ 5],34) ^ p[ 4];p[ 7]=ROL24(p[ 7]) ^ p[ 6];\ - p[ 2]+=p[ 1];p[ 4]+=p[ 7];p[ 6]+=p[ 5];p[ 0]+=p[ 3];p[ 1]=ROL2(p[ 1],13) ^ p[ 2];p[ 7]=ROL2(p[ 7],50) ^ p[ 4];p[ 5]=ROL2(p[ 5],10) ^ p[ 6];p[ 3]=ROL2(p[ 3],17) ^ p[ 0];\ - p[ 4]+=p[ 1];p[ 6]+=p[ 3];p[ 0]+=p[ 5];p[ 2]+=p[ 7];p[ 1]=ROL2(p[ 1],25) ^ p[ 4];p[ 3]=ROL2(p[ 3],29) ^ p[ 6];p[ 5]=ROL2(p[ 5],39) ^ p[ 0];p[ 7]=ROL2(p[ 7],43) ^ p[ 2];\ - p[ 6]+=p[ 1];p[ 0]+=p[ 7];p[ 2]+=p[ 5];p[ 4]+=p[ 3];p[ 1]=ROL8(p[ 1]) ^ p[ 6];p[ 7]=ROL2(p[ 7],35) ^ p[ 0];p[ 5]=ROR8(p[ 5]) ^ p[ 2];p[ 3]=ROL2(p[ 3],22) ^ p[ 4];\ -} - -#define addwBuff(x0,x1,x2,x3,x4){\ - p[ 0]+=h[x0];\ - p[ 1]+=h[x1];\ - p[ 2]+=h[x2];\ - p[ 3]+=h[x3];\ - p[ 4]+=h[x4];\ - p[ 5]+=c_buffer[i++];\ - p[ 7]+=c_buffer[i++];\ - p[ 6]+=c_buffer[i];\ -} - -#define addwCon(x0,x1,x2,x3,x4,x5,x6,x7,y0,y1,y2){\ - p[ 0]+= h[x0];\ - p[ 1]+= h[x1];\ - p[ 2]+= h[x2];\ - p[ 3]+= h[x3];\ - p[ 4]+= h[x4];\ - p[ 5]+= h[x5] + c_t[y0];\ - p[ 6]+= h[x6] + c_t[y1];\ - p[ 7]+= h[x7] + c_add[y2];\ -} - - diff --git a/skunk/skunk.cu b/skunk/skunk.cu deleted file mode 100644 index c1add503..00000000 --- a/skunk/skunk.cu +++ /dev/null @@ -1,211 +0,0 @@ -/** - * Skunk Algo for Signatum - * (skein, cube, fugue, gost streebog) - * - * tpruvot@github 08 2017 - GPLv3 - */ -extern "C" { -#include "sph/sph_skein.h" -#include "sph/sph_cubehash.h" -#include "sph/sph_fugue.h" -#include "sph/sph_streebog.h" -} - -#include "miner.h" -#include "cuda_helper.h" - -//#define WANT_COMPAT_KERNEL - -// compatibility kernels -extern void skein512_cpu_setBlock_80(void *pdata); -extern void skein512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, int swap); -extern void x11_cubehash512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -extern void x13_fugue512_cpu_init(int thr_id, uint32_t threads); -extern void x13_fugue512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -extern void x13_fugue512_cpu_free(int thr_id); -extern void streebog_sm3_set_target(uint32_t* ptarget); -extern void streebog_sm3_hash_64_final(int thr_id, uint32_t threads, uint32_t *d_hash, uint32_t* d_resNonce); - -// krnlx merged kernel (for high-end cards only) -extern void skunk_cpu_init(int thr_id, uint32_t threads); -extern void skunk_streebog_set_target(uint32_t* ptarget); -extern void skunk_setBlock_80(int thr_id, void *pdata); -extern void skunk_cuda_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash); -extern void skunk_cuda_streebog(int thr_id, uint32_t threads, uint32_t *d_hash, uint32_t* d_resNonce); - -#include -#include - -#define NBN 2 -static uint32_t *d_hash[MAX_GPUS]; -static uint32_t *d_resNonce[MAX_GPUS]; - -// CPU Hash -extern "C" void skunk_hash(void *output, const void *input) -{ - unsigned char _ALIGN(128) hash[128] = { 0 }; - - sph_skein512_context ctx_skein; - sph_cubehash512_context ctx_cubehash; - sph_fugue512_context ctx_fugue; - sph_gost512_context ctx_gost; - - sph_skein512_init(&ctx_skein); - sph_skein512(&ctx_skein, input, 80); - sph_skein512_close(&ctx_skein, (void*) hash); - - sph_cubehash512_init(&ctx_cubehash); - sph_cubehash512(&ctx_cubehash, (const void*) hash, 64); - sph_cubehash512_close(&ctx_cubehash, (void*) hash); - - sph_fugue512_init(&ctx_fugue); - sph_fugue512(&ctx_fugue, (const void*) hash, 64); - sph_fugue512_close(&ctx_fugue, (void*) hash); - - sph_gost512_init(&ctx_gost); - sph_gost512(&ctx_gost, (const void*) hash, 64); - sph_gost512_close(&ctx_gost, (void*) hash); - - memcpy(output, hash, 32); -} - -static bool init[MAX_GPUS] = { 0 }; -static bool use_compat_kernels[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_skunk(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - int dev_id = device_map[thr_id]; - - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - int intensity = (device_sm[device_map[thr_id]] > 500) ? 18 : 17; - if (strstr(device_name[dev_id], "GTX 10")) intensity = 20; - if (strstr(device_name[dev_id], "GTX 1080")) intensity = 21; - uint32_t throughput = cuda_default_throughput(thr_id, 1U << intensity); - //if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ptarget[7] = 0xf; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - skunk_cpu_init(thr_id, throughput); - use_compat_kernels[thr_id] = (cuda_arch[dev_id] < 500); - if (use_compat_kernels[thr_id]) x13_fugue512_cpu_init(thr_id, throughput); - - CUDA_CALL_OR_RET_X(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput), 0); - CUDA_CALL_OR_RET_X(cudaMalloc(&d_resNonce[thr_id], NBN * sizeof(uint32_t)), -1); - - init[thr_id] = true; - } - - uint32_t _ALIGN(64) h_resNonce[NBN]; - uint32_t _ALIGN(64) endiandata[20]; - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - cudaMemset(d_resNonce[thr_id], 0xff, NBN*sizeof(uint32_t)); - if (use_compat_kernels[thr_id]) { - skein512_cpu_setBlock_80(endiandata); - streebog_sm3_set_target(ptarget); - } else { - skunk_setBlock_80(thr_id, endiandata); - skunk_streebog_set_target(ptarget); - } - - do { - int order = 0; - if (use_compat_kernels[thr_id]) { - skein512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - x11_cubehash512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x13_fugue512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - streebog_sm3_hash_64_final(thr_id, throughput, d_hash[thr_id], d_resNonce[thr_id]); - } else { - skunk_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); - skunk_cuda_streebog(thr_id, throughput, d_hash[thr_id], d_resNonce[thr_id]); - } - cudaMemcpy(h_resNonce, d_resNonce[thr_id], NBN*sizeof(uint32_t), cudaMemcpyDeviceToHost); - - *hashes_done = pdata[19] - first_nonce + throughput; - - if (h_resNonce[0] != UINT32_MAX) - { - uint32_t _ALIGN(64) vhash[8]; - const uint32_t Htarg = ptarget[7]; - const uint32_t startNounce = pdata[19]; - - be32enc(&endiandata[19], startNounce + h_resNonce[0]); - skunk_hash(vhash, endiandata); - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) - { - work->nonces[0] = startNounce + h_resNonce[0]; - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - if (h_resNonce[1] != UINT32_MAX) - { - uint32_t secNonce = work->nonces[1] = startNounce + h_resNonce[1]; - be32enc(&endiandata[19], secNonce); - skunk_hash(vhash, endiandata); - if (bn_hash_target_ratio(vhash, ptarget) > work->shareratio[0]) { - work_set_target_ratio(work, vhash); - xchg(work->nonces[1], work->nonces[0]); - } else { - bn_set_target_ratio(work, vhash, work->valid_nonces); - } - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - cudaMemset(d_resNonce[thr_id], 0xff, NBN*sizeof(uint32_t)); - gpulog(LOG_WARNING, thr_id, "result does not validate on CPU!"); - pdata[19] = startNounce + h_resNonce[0] + 1; - continue; - } - } - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - - return 0; -} - -// cleanup -extern "C" void free_skunk(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - if (use_compat_kernels[thr_id]) - x13_fugue512_cpu_free(thr_id); - - cudaFree(d_hash[thr_id]); - cudaFree(d_resNonce[thr_id]); - - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/sph/aes_helper.c b/sph/aes_helper.c deleted file mode 100644 index 75b7cc69..00000000 --- a/sph/aes_helper.c +++ /dev/null @@ -1,392 +0,0 @@ -/* $Id: aes_helper.c 220 2010-06-09 09:21:50Z tp $ */ -/* - * AES tables. This file is not meant to be compiled by itself; it - * is included by some hash function implementations. It contains - * the precomputed tables and helper macros for evaluating an AES - * round, optionally with a final XOR with a subkey. - * - * By default, this file defines the tables and macros for little-endian - * processing (i.e. it is assumed that the input bytes have been read - * from memory and assembled with the little-endian convention). If - * the 'AES_BIG_ENDIAN' macro is defined (to a non-zero integer value) - * when this file is included, then the tables and macros for big-endian - * processing are defined instead. The big-endian tables and macros have - * names distinct from the little-endian tables and macros, hence it is - * possible to have both simultaneously, by including this file twice - * (with and without the AES_BIG_ENDIAN macro). - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include "sph_types.h" -#ifdef __cplusplus -extern "C"{ -#endif -#if AES_BIG_ENDIAN - -#define AESx(x) ( ((SPH_C32(x) >> 24) & SPH_C32(0x000000FF)) \ - | ((SPH_C32(x) >> 8) & SPH_C32(0x0000FF00)) \ - | ((SPH_C32(x) << 8) & SPH_C32(0x00FF0000)) \ - | ((SPH_C32(x) << 24) & SPH_C32(0xFF000000))) - -#define AES0 AES0_BE -#define AES1 AES1_BE -#define AES2 AES2_BE -#define AES3 AES3_BE - -#define AES_ROUND_BE(X0, X1, X2, X3, K0, K1, K2, K3, Y0, Y1, Y2, Y3) do { \ - (Y0) = AES0[((X0) >> 24) & 0xFF] \ - ^ AES1[((X1) >> 16) & 0xFF] \ - ^ AES2[((X2) >> 8) & 0xFF] \ - ^ AES3[(X3) & 0xFF] ^ (K0); \ - (Y1) = AES0[((X1) >> 24) & 0xFF] \ - ^ AES1[((X2) >> 16) & 0xFF] \ - ^ AES2[((X3) >> 8) & 0xFF] \ - ^ AES3[(X0) & 0xFF] ^ (K1); \ - (Y2) = AES0[((X2) >> 24) & 0xFF] \ - ^ AES1[((X3) >> 16) & 0xFF] \ - ^ AES2[((X0) >> 8) & 0xFF] \ - ^ AES3[(X1) & 0xFF] ^ (K2); \ - (Y3) = AES0[((X3) >> 24) & 0xFF] \ - ^ AES1[((X0) >> 16) & 0xFF] \ - ^ AES2[((X1) >> 8) & 0xFF] \ - ^ AES3[(X2) & 0xFF] ^ (K3); \ - } while (0) - -#define AES_ROUND_NOKEY_BE(X0, X1, X2, X3, Y0, Y1, Y2, Y3) \ - AES_ROUND_BE(X0, X1, X2, X3, 0, 0, 0, 0, Y0, Y1, Y2, Y3) - -#else - -#define AESx(x) SPH_C32(x) -#define AES0 AES0_LE -#define AES1 AES1_LE -#define AES2 AES2_LE -#define AES3 AES3_LE - -#define AES_ROUND_LE(X0, X1, X2, X3, K0, K1, K2, K3, Y0, Y1, Y2, Y3) do { \ - (Y0) = AES0[(X0) & 0xFF] \ - ^ AES1[((X1) >> 8) & 0xFF] \ - ^ AES2[((X2) >> 16) & 0xFF] \ - ^ AES3[((X3) >> 24) & 0xFF] ^ (K0); \ - (Y1) = AES0[(X1) & 0xFF] \ - ^ AES1[((X2) >> 8) & 0xFF] \ - ^ AES2[((X3) >> 16) & 0xFF] \ - ^ AES3[((X0) >> 24) & 0xFF] ^ (K1); \ - (Y2) = AES0[(X2) & 0xFF] \ - ^ AES1[((X3) >> 8) & 0xFF] \ - ^ AES2[((X0) >> 16) & 0xFF] \ - ^ AES3[((X1) >> 24) & 0xFF] ^ (K2); \ - (Y3) = AES0[(X3) & 0xFF] \ - ^ AES1[((X0) >> 8) & 0xFF] \ - ^ AES2[((X1) >> 16) & 0xFF] \ - ^ AES3[((X2) >> 24) & 0xFF] ^ (K3); \ - } while (0) - -#define AES_ROUND_NOKEY_LE(X0, X1, X2, X3, Y0, Y1, Y2, Y3) \ - AES_ROUND_LE(X0, X1, X2, X3, 0, 0, 0, 0, Y0, Y1, Y2, Y3) - -#endif - -/* - * The AES*[] tables allow us to perform a fast evaluation of an AES - * round; table AESi[] combines SubBytes for a byte at row i, and - * MixColumns for the column where that byte goes after ShiftRows. - */ - -static const sph_u32 AES0[256] = { - AESx(0xA56363C6), AESx(0x847C7CF8), AESx(0x997777EE), AESx(0x8D7B7BF6), - AESx(0x0DF2F2FF), AESx(0xBD6B6BD6), AESx(0xB16F6FDE), AESx(0x54C5C591), - AESx(0x50303060), AESx(0x03010102), AESx(0xA96767CE), AESx(0x7D2B2B56), - AESx(0x19FEFEE7), AESx(0x62D7D7B5), AESx(0xE6ABAB4D), AESx(0x9A7676EC), - AESx(0x45CACA8F), AESx(0x9D82821F), AESx(0x40C9C989), AESx(0x877D7DFA), - AESx(0x15FAFAEF), AESx(0xEB5959B2), AESx(0xC947478E), AESx(0x0BF0F0FB), - AESx(0xECADAD41), AESx(0x67D4D4B3), AESx(0xFDA2A25F), AESx(0xEAAFAF45), - AESx(0xBF9C9C23), AESx(0xF7A4A453), AESx(0x967272E4), AESx(0x5BC0C09B), - AESx(0xC2B7B775), AESx(0x1CFDFDE1), AESx(0xAE93933D), AESx(0x6A26264C), - AESx(0x5A36366C), AESx(0x413F3F7E), AESx(0x02F7F7F5), AESx(0x4FCCCC83), - AESx(0x5C343468), AESx(0xF4A5A551), AESx(0x34E5E5D1), AESx(0x08F1F1F9), - AESx(0x937171E2), AESx(0x73D8D8AB), AESx(0x53313162), AESx(0x3F15152A), - AESx(0x0C040408), AESx(0x52C7C795), AESx(0x65232346), AESx(0x5EC3C39D), - AESx(0x28181830), AESx(0xA1969637), AESx(0x0F05050A), AESx(0xB59A9A2F), - AESx(0x0907070E), AESx(0x36121224), AESx(0x9B80801B), AESx(0x3DE2E2DF), - AESx(0x26EBEBCD), AESx(0x6927274E), AESx(0xCDB2B27F), AESx(0x9F7575EA), - AESx(0x1B090912), AESx(0x9E83831D), AESx(0x742C2C58), AESx(0x2E1A1A34), - AESx(0x2D1B1B36), AESx(0xB26E6EDC), AESx(0xEE5A5AB4), AESx(0xFBA0A05B), - AESx(0xF65252A4), AESx(0x4D3B3B76), AESx(0x61D6D6B7), AESx(0xCEB3B37D), - AESx(0x7B292952), AESx(0x3EE3E3DD), AESx(0x712F2F5E), AESx(0x97848413), - AESx(0xF55353A6), AESx(0x68D1D1B9), AESx(0x00000000), AESx(0x2CEDEDC1), - AESx(0x60202040), AESx(0x1FFCFCE3), AESx(0xC8B1B179), AESx(0xED5B5BB6), - AESx(0xBE6A6AD4), AESx(0x46CBCB8D), AESx(0xD9BEBE67), AESx(0x4B393972), - AESx(0xDE4A4A94), AESx(0xD44C4C98), AESx(0xE85858B0), AESx(0x4ACFCF85), - AESx(0x6BD0D0BB), AESx(0x2AEFEFC5), AESx(0xE5AAAA4F), AESx(0x16FBFBED), - AESx(0xC5434386), AESx(0xD74D4D9A), AESx(0x55333366), AESx(0x94858511), - AESx(0xCF45458A), AESx(0x10F9F9E9), AESx(0x06020204), AESx(0x817F7FFE), - AESx(0xF05050A0), AESx(0x443C3C78), AESx(0xBA9F9F25), AESx(0xE3A8A84B), - AESx(0xF35151A2), AESx(0xFEA3A35D), AESx(0xC0404080), AESx(0x8A8F8F05), - AESx(0xAD92923F), AESx(0xBC9D9D21), AESx(0x48383870), AESx(0x04F5F5F1), - AESx(0xDFBCBC63), AESx(0xC1B6B677), AESx(0x75DADAAF), AESx(0x63212142), - AESx(0x30101020), AESx(0x1AFFFFE5), AESx(0x0EF3F3FD), AESx(0x6DD2D2BF), - AESx(0x4CCDCD81), AESx(0x140C0C18), AESx(0x35131326), AESx(0x2FECECC3), - AESx(0xE15F5FBE), AESx(0xA2979735), AESx(0xCC444488), AESx(0x3917172E), - AESx(0x57C4C493), AESx(0xF2A7A755), AESx(0x827E7EFC), AESx(0x473D3D7A), - AESx(0xAC6464C8), AESx(0xE75D5DBA), AESx(0x2B191932), AESx(0x957373E6), - AESx(0xA06060C0), AESx(0x98818119), AESx(0xD14F4F9E), AESx(0x7FDCDCA3), - AESx(0x66222244), AESx(0x7E2A2A54), AESx(0xAB90903B), AESx(0x8388880B), - AESx(0xCA46468C), AESx(0x29EEEEC7), AESx(0xD3B8B86B), AESx(0x3C141428), - AESx(0x79DEDEA7), AESx(0xE25E5EBC), AESx(0x1D0B0B16), AESx(0x76DBDBAD), - AESx(0x3BE0E0DB), AESx(0x56323264), AESx(0x4E3A3A74), AESx(0x1E0A0A14), - AESx(0xDB494992), AESx(0x0A06060C), AESx(0x6C242448), AESx(0xE45C5CB8), - AESx(0x5DC2C29F), AESx(0x6ED3D3BD), AESx(0xEFACAC43), AESx(0xA66262C4), - AESx(0xA8919139), AESx(0xA4959531), AESx(0x37E4E4D3), AESx(0x8B7979F2), - AESx(0x32E7E7D5), AESx(0x43C8C88B), AESx(0x5937376E), AESx(0xB76D6DDA), - AESx(0x8C8D8D01), AESx(0x64D5D5B1), AESx(0xD24E4E9C), AESx(0xE0A9A949), - AESx(0xB46C6CD8), AESx(0xFA5656AC), AESx(0x07F4F4F3), AESx(0x25EAEACF), - AESx(0xAF6565CA), AESx(0x8E7A7AF4), AESx(0xE9AEAE47), AESx(0x18080810), - AESx(0xD5BABA6F), AESx(0x887878F0), AESx(0x6F25254A), AESx(0x722E2E5C), - AESx(0x241C1C38), AESx(0xF1A6A657), AESx(0xC7B4B473), AESx(0x51C6C697), - AESx(0x23E8E8CB), AESx(0x7CDDDDA1), AESx(0x9C7474E8), AESx(0x211F1F3E), - AESx(0xDD4B4B96), AESx(0xDCBDBD61), AESx(0x868B8B0D), AESx(0x858A8A0F), - AESx(0x907070E0), AESx(0x423E3E7C), AESx(0xC4B5B571), AESx(0xAA6666CC), - AESx(0xD8484890), AESx(0x05030306), AESx(0x01F6F6F7), AESx(0x120E0E1C), - AESx(0xA36161C2), AESx(0x5F35356A), AESx(0xF95757AE), AESx(0xD0B9B969), - AESx(0x91868617), AESx(0x58C1C199), AESx(0x271D1D3A), AESx(0xB99E9E27), - AESx(0x38E1E1D9), AESx(0x13F8F8EB), AESx(0xB398982B), AESx(0x33111122), - AESx(0xBB6969D2), AESx(0x70D9D9A9), AESx(0x898E8E07), AESx(0xA7949433), - AESx(0xB69B9B2D), AESx(0x221E1E3C), AESx(0x92878715), AESx(0x20E9E9C9), - AESx(0x49CECE87), AESx(0xFF5555AA), AESx(0x78282850), AESx(0x7ADFDFA5), - AESx(0x8F8C8C03), AESx(0xF8A1A159), AESx(0x80898909), AESx(0x170D0D1A), - AESx(0xDABFBF65), AESx(0x31E6E6D7), AESx(0xC6424284), AESx(0xB86868D0), - AESx(0xC3414182), AESx(0xB0999929), AESx(0x772D2D5A), AESx(0x110F0F1E), - AESx(0xCBB0B07B), AESx(0xFC5454A8), AESx(0xD6BBBB6D), AESx(0x3A16162C) -}; - -static const sph_u32 AES1[256] = { - AESx(0x6363C6A5), AESx(0x7C7CF884), AESx(0x7777EE99), AESx(0x7B7BF68D), - AESx(0xF2F2FF0D), AESx(0x6B6BD6BD), AESx(0x6F6FDEB1), AESx(0xC5C59154), - AESx(0x30306050), AESx(0x01010203), AESx(0x6767CEA9), AESx(0x2B2B567D), - AESx(0xFEFEE719), AESx(0xD7D7B562), AESx(0xABAB4DE6), AESx(0x7676EC9A), - AESx(0xCACA8F45), AESx(0x82821F9D), AESx(0xC9C98940), AESx(0x7D7DFA87), - AESx(0xFAFAEF15), AESx(0x5959B2EB), AESx(0x47478EC9), AESx(0xF0F0FB0B), - AESx(0xADAD41EC), AESx(0xD4D4B367), AESx(0xA2A25FFD), AESx(0xAFAF45EA), - AESx(0x9C9C23BF), AESx(0xA4A453F7), AESx(0x7272E496), AESx(0xC0C09B5B), - AESx(0xB7B775C2), AESx(0xFDFDE11C), AESx(0x93933DAE), AESx(0x26264C6A), - AESx(0x36366C5A), AESx(0x3F3F7E41), AESx(0xF7F7F502), AESx(0xCCCC834F), - AESx(0x3434685C), AESx(0xA5A551F4), AESx(0xE5E5D134), AESx(0xF1F1F908), - AESx(0x7171E293), AESx(0xD8D8AB73), AESx(0x31316253), AESx(0x15152A3F), - AESx(0x0404080C), AESx(0xC7C79552), AESx(0x23234665), AESx(0xC3C39D5E), - AESx(0x18183028), AESx(0x969637A1), AESx(0x05050A0F), AESx(0x9A9A2FB5), - AESx(0x07070E09), AESx(0x12122436), AESx(0x80801B9B), AESx(0xE2E2DF3D), - AESx(0xEBEBCD26), AESx(0x27274E69), AESx(0xB2B27FCD), AESx(0x7575EA9F), - AESx(0x0909121B), AESx(0x83831D9E), AESx(0x2C2C5874), AESx(0x1A1A342E), - AESx(0x1B1B362D), AESx(0x6E6EDCB2), AESx(0x5A5AB4EE), AESx(0xA0A05BFB), - AESx(0x5252A4F6), AESx(0x3B3B764D), AESx(0xD6D6B761), AESx(0xB3B37DCE), - AESx(0x2929527B), AESx(0xE3E3DD3E), AESx(0x2F2F5E71), AESx(0x84841397), - AESx(0x5353A6F5), AESx(0xD1D1B968), AESx(0x00000000), AESx(0xEDEDC12C), - AESx(0x20204060), AESx(0xFCFCE31F), AESx(0xB1B179C8), AESx(0x5B5BB6ED), - AESx(0x6A6AD4BE), AESx(0xCBCB8D46), AESx(0xBEBE67D9), AESx(0x3939724B), - AESx(0x4A4A94DE), AESx(0x4C4C98D4), AESx(0x5858B0E8), AESx(0xCFCF854A), - AESx(0xD0D0BB6B), AESx(0xEFEFC52A), AESx(0xAAAA4FE5), AESx(0xFBFBED16), - AESx(0x434386C5), AESx(0x4D4D9AD7), AESx(0x33336655), AESx(0x85851194), - AESx(0x45458ACF), AESx(0xF9F9E910), AESx(0x02020406), AESx(0x7F7FFE81), - AESx(0x5050A0F0), AESx(0x3C3C7844), AESx(0x9F9F25BA), AESx(0xA8A84BE3), - AESx(0x5151A2F3), AESx(0xA3A35DFE), AESx(0x404080C0), AESx(0x8F8F058A), - AESx(0x92923FAD), AESx(0x9D9D21BC), AESx(0x38387048), AESx(0xF5F5F104), - AESx(0xBCBC63DF), AESx(0xB6B677C1), AESx(0xDADAAF75), AESx(0x21214263), - AESx(0x10102030), AESx(0xFFFFE51A), AESx(0xF3F3FD0E), AESx(0xD2D2BF6D), - AESx(0xCDCD814C), AESx(0x0C0C1814), AESx(0x13132635), AESx(0xECECC32F), - AESx(0x5F5FBEE1), AESx(0x979735A2), AESx(0x444488CC), AESx(0x17172E39), - AESx(0xC4C49357), AESx(0xA7A755F2), AESx(0x7E7EFC82), AESx(0x3D3D7A47), - AESx(0x6464C8AC), AESx(0x5D5DBAE7), AESx(0x1919322B), AESx(0x7373E695), - AESx(0x6060C0A0), AESx(0x81811998), AESx(0x4F4F9ED1), AESx(0xDCDCA37F), - AESx(0x22224466), AESx(0x2A2A547E), AESx(0x90903BAB), AESx(0x88880B83), - AESx(0x46468CCA), AESx(0xEEEEC729), AESx(0xB8B86BD3), AESx(0x1414283C), - AESx(0xDEDEA779), AESx(0x5E5EBCE2), AESx(0x0B0B161D), AESx(0xDBDBAD76), - AESx(0xE0E0DB3B), AESx(0x32326456), AESx(0x3A3A744E), AESx(0x0A0A141E), - AESx(0x494992DB), AESx(0x06060C0A), AESx(0x2424486C), AESx(0x5C5CB8E4), - AESx(0xC2C29F5D), AESx(0xD3D3BD6E), AESx(0xACAC43EF), AESx(0x6262C4A6), - AESx(0x919139A8), AESx(0x959531A4), AESx(0xE4E4D337), AESx(0x7979F28B), - AESx(0xE7E7D532), AESx(0xC8C88B43), AESx(0x37376E59), AESx(0x6D6DDAB7), - AESx(0x8D8D018C), AESx(0xD5D5B164), AESx(0x4E4E9CD2), AESx(0xA9A949E0), - AESx(0x6C6CD8B4), AESx(0x5656ACFA), AESx(0xF4F4F307), AESx(0xEAEACF25), - AESx(0x6565CAAF), AESx(0x7A7AF48E), AESx(0xAEAE47E9), AESx(0x08081018), - AESx(0xBABA6FD5), AESx(0x7878F088), AESx(0x25254A6F), AESx(0x2E2E5C72), - AESx(0x1C1C3824), AESx(0xA6A657F1), AESx(0xB4B473C7), AESx(0xC6C69751), - AESx(0xE8E8CB23), AESx(0xDDDDA17C), AESx(0x7474E89C), AESx(0x1F1F3E21), - AESx(0x4B4B96DD), AESx(0xBDBD61DC), AESx(0x8B8B0D86), AESx(0x8A8A0F85), - AESx(0x7070E090), AESx(0x3E3E7C42), AESx(0xB5B571C4), AESx(0x6666CCAA), - AESx(0x484890D8), AESx(0x03030605), AESx(0xF6F6F701), AESx(0x0E0E1C12), - AESx(0x6161C2A3), AESx(0x35356A5F), AESx(0x5757AEF9), AESx(0xB9B969D0), - AESx(0x86861791), AESx(0xC1C19958), AESx(0x1D1D3A27), AESx(0x9E9E27B9), - AESx(0xE1E1D938), AESx(0xF8F8EB13), AESx(0x98982BB3), AESx(0x11112233), - AESx(0x6969D2BB), AESx(0xD9D9A970), AESx(0x8E8E0789), AESx(0x949433A7), - AESx(0x9B9B2DB6), AESx(0x1E1E3C22), AESx(0x87871592), AESx(0xE9E9C920), - AESx(0xCECE8749), AESx(0x5555AAFF), AESx(0x28285078), AESx(0xDFDFA57A), - AESx(0x8C8C038F), AESx(0xA1A159F8), AESx(0x89890980), AESx(0x0D0D1A17), - AESx(0xBFBF65DA), AESx(0xE6E6D731), AESx(0x424284C6), AESx(0x6868D0B8), - AESx(0x414182C3), AESx(0x999929B0), AESx(0x2D2D5A77), AESx(0x0F0F1E11), - AESx(0xB0B07BCB), AESx(0x5454A8FC), AESx(0xBBBB6DD6), AESx(0x16162C3A) -}; - -static const sph_u32 AES2[256] = { - AESx(0x63C6A563), AESx(0x7CF8847C), AESx(0x77EE9977), AESx(0x7BF68D7B), - AESx(0xF2FF0DF2), AESx(0x6BD6BD6B), AESx(0x6FDEB16F), AESx(0xC59154C5), - AESx(0x30605030), AESx(0x01020301), AESx(0x67CEA967), AESx(0x2B567D2B), - AESx(0xFEE719FE), AESx(0xD7B562D7), AESx(0xAB4DE6AB), AESx(0x76EC9A76), - AESx(0xCA8F45CA), AESx(0x821F9D82), AESx(0xC98940C9), AESx(0x7DFA877D), - AESx(0xFAEF15FA), AESx(0x59B2EB59), AESx(0x478EC947), AESx(0xF0FB0BF0), - AESx(0xAD41ECAD), AESx(0xD4B367D4), AESx(0xA25FFDA2), AESx(0xAF45EAAF), - AESx(0x9C23BF9C), AESx(0xA453F7A4), AESx(0x72E49672), AESx(0xC09B5BC0), - AESx(0xB775C2B7), AESx(0xFDE11CFD), AESx(0x933DAE93), AESx(0x264C6A26), - AESx(0x366C5A36), AESx(0x3F7E413F), AESx(0xF7F502F7), AESx(0xCC834FCC), - AESx(0x34685C34), AESx(0xA551F4A5), AESx(0xE5D134E5), AESx(0xF1F908F1), - AESx(0x71E29371), AESx(0xD8AB73D8), AESx(0x31625331), AESx(0x152A3F15), - AESx(0x04080C04), AESx(0xC79552C7), AESx(0x23466523), AESx(0xC39D5EC3), - AESx(0x18302818), AESx(0x9637A196), AESx(0x050A0F05), AESx(0x9A2FB59A), - AESx(0x070E0907), AESx(0x12243612), AESx(0x801B9B80), AESx(0xE2DF3DE2), - AESx(0xEBCD26EB), AESx(0x274E6927), AESx(0xB27FCDB2), AESx(0x75EA9F75), - AESx(0x09121B09), AESx(0x831D9E83), AESx(0x2C58742C), AESx(0x1A342E1A), - AESx(0x1B362D1B), AESx(0x6EDCB26E), AESx(0x5AB4EE5A), AESx(0xA05BFBA0), - AESx(0x52A4F652), AESx(0x3B764D3B), AESx(0xD6B761D6), AESx(0xB37DCEB3), - AESx(0x29527B29), AESx(0xE3DD3EE3), AESx(0x2F5E712F), AESx(0x84139784), - AESx(0x53A6F553), AESx(0xD1B968D1), AESx(0x00000000), AESx(0xEDC12CED), - AESx(0x20406020), AESx(0xFCE31FFC), AESx(0xB179C8B1), AESx(0x5BB6ED5B), - AESx(0x6AD4BE6A), AESx(0xCB8D46CB), AESx(0xBE67D9BE), AESx(0x39724B39), - AESx(0x4A94DE4A), AESx(0x4C98D44C), AESx(0x58B0E858), AESx(0xCF854ACF), - AESx(0xD0BB6BD0), AESx(0xEFC52AEF), AESx(0xAA4FE5AA), AESx(0xFBED16FB), - AESx(0x4386C543), AESx(0x4D9AD74D), AESx(0x33665533), AESx(0x85119485), - AESx(0x458ACF45), AESx(0xF9E910F9), AESx(0x02040602), AESx(0x7FFE817F), - AESx(0x50A0F050), AESx(0x3C78443C), AESx(0x9F25BA9F), AESx(0xA84BE3A8), - AESx(0x51A2F351), AESx(0xA35DFEA3), AESx(0x4080C040), AESx(0x8F058A8F), - AESx(0x923FAD92), AESx(0x9D21BC9D), AESx(0x38704838), AESx(0xF5F104F5), - AESx(0xBC63DFBC), AESx(0xB677C1B6), AESx(0xDAAF75DA), AESx(0x21426321), - AESx(0x10203010), AESx(0xFFE51AFF), AESx(0xF3FD0EF3), AESx(0xD2BF6DD2), - AESx(0xCD814CCD), AESx(0x0C18140C), AESx(0x13263513), AESx(0xECC32FEC), - AESx(0x5FBEE15F), AESx(0x9735A297), AESx(0x4488CC44), AESx(0x172E3917), - AESx(0xC49357C4), AESx(0xA755F2A7), AESx(0x7EFC827E), AESx(0x3D7A473D), - AESx(0x64C8AC64), AESx(0x5DBAE75D), AESx(0x19322B19), AESx(0x73E69573), - AESx(0x60C0A060), AESx(0x81199881), AESx(0x4F9ED14F), AESx(0xDCA37FDC), - AESx(0x22446622), AESx(0x2A547E2A), AESx(0x903BAB90), AESx(0x880B8388), - AESx(0x468CCA46), AESx(0xEEC729EE), AESx(0xB86BD3B8), AESx(0x14283C14), - AESx(0xDEA779DE), AESx(0x5EBCE25E), AESx(0x0B161D0B), AESx(0xDBAD76DB), - AESx(0xE0DB3BE0), AESx(0x32645632), AESx(0x3A744E3A), AESx(0x0A141E0A), - AESx(0x4992DB49), AESx(0x060C0A06), AESx(0x24486C24), AESx(0x5CB8E45C), - AESx(0xC29F5DC2), AESx(0xD3BD6ED3), AESx(0xAC43EFAC), AESx(0x62C4A662), - AESx(0x9139A891), AESx(0x9531A495), AESx(0xE4D337E4), AESx(0x79F28B79), - AESx(0xE7D532E7), AESx(0xC88B43C8), AESx(0x376E5937), AESx(0x6DDAB76D), - AESx(0x8D018C8D), AESx(0xD5B164D5), AESx(0x4E9CD24E), AESx(0xA949E0A9), - AESx(0x6CD8B46C), AESx(0x56ACFA56), AESx(0xF4F307F4), AESx(0xEACF25EA), - AESx(0x65CAAF65), AESx(0x7AF48E7A), AESx(0xAE47E9AE), AESx(0x08101808), - AESx(0xBA6FD5BA), AESx(0x78F08878), AESx(0x254A6F25), AESx(0x2E5C722E), - AESx(0x1C38241C), AESx(0xA657F1A6), AESx(0xB473C7B4), AESx(0xC69751C6), - AESx(0xE8CB23E8), AESx(0xDDA17CDD), AESx(0x74E89C74), AESx(0x1F3E211F), - AESx(0x4B96DD4B), AESx(0xBD61DCBD), AESx(0x8B0D868B), AESx(0x8A0F858A), - AESx(0x70E09070), AESx(0x3E7C423E), AESx(0xB571C4B5), AESx(0x66CCAA66), - AESx(0x4890D848), AESx(0x03060503), AESx(0xF6F701F6), AESx(0x0E1C120E), - AESx(0x61C2A361), AESx(0x356A5F35), AESx(0x57AEF957), AESx(0xB969D0B9), - AESx(0x86179186), AESx(0xC19958C1), AESx(0x1D3A271D), AESx(0x9E27B99E), - AESx(0xE1D938E1), AESx(0xF8EB13F8), AESx(0x982BB398), AESx(0x11223311), - AESx(0x69D2BB69), AESx(0xD9A970D9), AESx(0x8E07898E), AESx(0x9433A794), - AESx(0x9B2DB69B), AESx(0x1E3C221E), AESx(0x87159287), AESx(0xE9C920E9), - AESx(0xCE8749CE), AESx(0x55AAFF55), AESx(0x28507828), AESx(0xDFA57ADF), - AESx(0x8C038F8C), AESx(0xA159F8A1), AESx(0x89098089), AESx(0x0D1A170D), - AESx(0xBF65DABF), AESx(0xE6D731E6), AESx(0x4284C642), AESx(0x68D0B868), - AESx(0x4182C341), AESx(0x9929B099), AESx(0x2D5A772D), AESx(0x0F1E110F), - AESx(0xB07BCBB0), AESx(0x54A8FC54), AESx(0xBB6DD6BB), AESx(0x162C3A16) -}; - -static const sph_u32 AES3[256] = { - AESx(0xC6A56363), AESx(0xF8847C7C), AESx(0xEE997777), AESx(0xF68D7B7B), - AESx(0xFF0DF2F2), AESx(0xD6BD6B6B), AESx(0xDEB16F6F), AESx(0x9154C5C5), - AESx(0x60503030), AESx(0x02030101), AESx(0xCEA96767), AESx(0x567D2B2B), - AESx(0xE719FEFE), AESx(0xB562D7D7), AESx(0x4DE6ABAB), AESx(0xEC9A7676), - AESx(0x8F45CACA), AESx(0x1F9D8282), AESx(0x8940C9C9), AESx(0xFA877D7D), - AESx(0xEF15FAFA), AESx(0xB2EB5959), AESx(0x8EC94747), AESx(0xFB0BF0F0), - AESx(0x41ECADAD), AESx(0xB367D4D4), AESx(0x5FFDA2A2), AESx(0x45EAAFAF), - AESx(0x23BF9C9C), AESx(0x53F7A4A4), AESx(0xE4967272), AESx(0x9B5BC0C0), - AESx(0x75C2B7B7), AESx(0xE11CFDFD), AESx(0x3DAE9393), AESx(0x4C6A2626), - AESx(0x6C5A3636), AESx(0x7E413F3F), AESx(0xF502F7F7), AESx(0x834FCCCC), - AESx(0x685C3434), AESx(0x51F4A5A5), AESx(0xD134E5E5), AESx(0xF908F1F1), - AESx(0xE2937171), AESx(0xAB73D8D8), AESx(0x62533131), AESx(0x2A3F1515), - AESx(0x080C0404), AESx(0x9552C7C7), AESx(0x46652323), AESx(0x9D5EC3C3), - AESx(0x30281818), AESx(0x37A19696), AESx(0x0A0F0505), AESx(0x2FB59A9A), - AESx(0x0E090707), AESx(0x24361212), AESx(0x1B9B8080), AESx(0xDF3DE2E2), - AESx(0xCD26EBEB), AESx(0x4E692727), AESx(0x7FCDB2B2), AESx(0xEA9F7575), - AESx(0x121B0909), AESx(0x1D9E8383), AESx(0x58742C2C), AESx(0x342E1A1A), - AESx(0x362D1B1B), AESx(0xDCB26E6E), AESx(0xB4EE5A5A), AESx(0x5BFBA0A0), - AESx(0xA4F65252), AESx(0x764D3B3B), AESx(0xB761D6D6), AESx(0x7DCEB3B3), - AESx(0x527B2929), AESx(0xDD3EE3E3), AESx(0x5E712F2F), AESx(0x13978484), - AESx(0xA6F55353), AESx(0xB968D1D1), AESx(0x00000000), AESx(0xC12CEDED), - AESx(0x40602020), AESx(0xE31FFCFC), AESx(0x79C8B1B1), AESx(0xB6ED5B5B), - AESx(0xD4BE6A6A), AESx(0x8D46CBCB), AESx(0x67D9BEBE), AESx(0x724B3939), - AESx(0x94DE4A4A), AESx(0x98D44C4C), AESx(0xB0E85858), AESx(0x854ACFCF), - AESx(0xBB6BD0D0), AESx(0xC52AEFEF), AESx(0x4FE5AAAA), AESx(0xED16FBFB), - AESx(0x86C54343), AESx(0x9AD74D4D), AESx(0x66553333), AESx(0x11948585), - AESx(0x8ACF4545), AESx(0xE910F9F9), AESx(0x04060202), AESx(0xFE817F7F), - AESx(0xA0F05050), AESx(0x78443C3C), AESx(0x25BA9F9F), AESx(0x4BE3A8A8), - AESx(0xA2F35151), AESx(0x5DFEA3A3), AESx(0x80C04040), AESx(0x058A8F8F), - AESx(0x3FAD9292), AESx(0x21BC9D9D), AESx(0x70483838), AESx(0xF104F5F5), - AESx(0x63DFBCBC), AESx(0x77C1B6B6), AESx(0xAF75DADA), AESx(0x42632121), - AESx(0x20301010), AESx(0xE51AFFFF), AESx(0xFD0EF3F3), AESx(0xBF6DD2D2), - AESx(0x814CCDCD), AESx(0x18140C0C), AESx(0x26351313), AESx(0xC32FECEC), - AESx(0xBEE15F5F), AESx(0x35A29797), AESx(0x88CC4444), AESx(0x2E391717), - AESx(0x9357C4C4), AESx(0x55F2A7A7), AESx(0xFC827E7E), AESx(0x7A473D3D), - AESx(0xC8AC6464), AESx(0xBAE75D5D), AESx(0x322B1919), AESx(0xE6957373), - AESx(0xC0A06060), AESx(0x19988181), AESx(0x9ED14F4F), AESx(0xA37FDCDC), - AESx(0x44662222), AESx(0x547E2A2A), AESx(0x3BAB9090), AESx(0x0B838888), - AESx(0x8CCA4646), AESx(0xC729EEEE), AESx(0x6BD3B8B8), AESx(0x283C1414), - AESx(0xA779DEDE), AESx(0xBCE25E5E), AESx(0x161D0B0B), AESx(0xAD76DBDB), - AESx(0xDB3BE0E0), AESx(0x64563232), AESx(0x744E3A3A), AESx(0x141E0A0A), - AESx(0x92DB4949), AESx(0x0C0A0606), AESx(0x486C2424), AESx(0xB8E45C5C), - AESx(0x9F5DC2C2), AESx(0xBD6ED3D3), AESx(0x43EFACAC), AESx(0xC4A66262), - AESx(0x39A89191), AESx(0x31A49595), AESx(0xD337E4E4), AESx(0xF28B7979), - AESx(0xD532E7E7), AESx(0x8B43C8C8), AESx(0x6E593737), AESx(0xDAB76D6D), - AESx(0x018C8D8D), AESx(0xB164D5D5), AESx(0x9CD24E4E), AESx(0x49E0A9A9), - AESx(0xD8B46C6C), AESx(0xACFA5656), AESx(0xF307F4F4), AESx(0xCF25EAEA), - AESx(0xCAAF6565), AESx(0xF48E7A7A), AESx(0x47E9AEAE), AESx(0x10180808), - AESx(0x6FD5BABA), AESx(0xF0887878), AESx(0x4A6F2525), AESx(0x5C722E2E), - AESx(0x38241C1C), AESx(0x57F1A6A6), AESx(0x73C7B4B4), AESx(0x9751C6C6), - AESx(0xCB23E8E8), AESx(0xA17CDDDD), AESx(0xE89C7474), AESx(0x3E211F1F), - AESx(0x96DD4B4B), AESx(0x61DCBDBD), AESx(0x0D868B8B), AESx(0x0F858A8A), - AESx(0xE0907070), AESx(0x7C423E3E), AESx(0x71C4B5B5), AESx(0xCCAA6666), - AESx(0x90D84848), AESx(0x06050303), AESx(0xF701F6F6), AESx(0x1C120E0E), - AESx(0xC2A36161), AESx(0x6A5F3535), AESx(0xAEF95757), AESx(0x69D0B9B9), - AESx(0x17918686), AESx(0x9958C1C1), AESx(0x3A271D1D), AESx(0x27B99E9E), - AESx(0xD938E1E1), AESx(0xEB13F8F8), AESx(0x2BB39898), AESx(0x22331111), - AESx(0xD2BB6969), AESx(0xA970D9D9), AESx(0x07898E8E), AESx(0x33A79494), - AESx(0x2DB69B9B), AESx(0x3C221E1E), AESx(0x15928787), AESx(0xC920E9E9), - AESx(0x8749CECE), AESx(0xAAFF5555), AESx(0x50782828), AESx(0xA57ADFDF), - AESx(0x038F8C8C), AESx(0x59F8A1A1), AESx(0x09808989), AESx(0x1A170D0D), - AESx(0x65DABFBF), AESx(0xD731E6E6), AESx(0x84C64242), AESx(0xD0B86868), - AESx(0x82C34141), AESx(0x29B09999), AESx(0x5A772D2D), AESx(0x1E110F0F), - AESx(0x7BCBB0B0), AESx(0xA8FC5454), AESx(0x6DD6BBBB), AESx(0x2C3A1616) -}; - -#ifdef __cplusplus -} -#endif diff --git a/sph/blake.c b/sph/blake.c deleted file mode 100644 index 5863cf59..00000000 --- a/sph/blake.c +++ /dev/null @@ -1,1131 +0,0 @@ -/* $Id: blake.c 252 2011-06-07 17:55:14Z tp $ */ -/* - * BLAKE implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include -#include - -#include "sph_blake.h" - -int blake256_rounds = 14; - -#ifdef __cplusplus -extern "C"{ -#endif - -#if SPH_SMALL_FOOTPRINT && !defined SPH_SMALL_FOOTPRINT_BLAKE -#define SPH_SMALL_FOOTPRINT_BLAKE 1 -#endif - -#if SPH_SMALL_FOOTPRINT_BLAKE -#define SPH_COMPACT_BLAKE_32 1 -#endif - -#if SPH_64 && (SPH_SMALL_FOOTPRINT_BLAKE || !SPH_64_TRUE) -#define SPH_COMPACT_BLAKE_64 1 -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -static const sph_u32 IV224[8] = { - SPH_C32(0xC1059ED8), SPH_C32(0x367CD507), - SPH_C32(0x3070DD17), SPH_C32(0xF70E5939), - SPH_C32(0xFFC00B31), SPH_C32(0x68581511), - SPH_C32(0x64F98FA7), SPH_C32(0xBEFA4FA4) -}; - -static const sph_u32 IV256[8] = { - SPH_C32(0x6A09E667), SPH_C32(0xBB67AE85), - SPH_C32(0x3C6EF372), SPH_C32(0xA54FF53A), - SPH_C32(0x510E527F), SPH_C32(0x9B05688C), - SPH_C32(0x1F83D9AB), SPH_C32(0x5BE0CD19) -}; - -#if SPH_64 - -static const sph_u64 IV384[8] = { - SPH_C64(0xCBBB9D5DC1059ED8), SPH_C64(0x629A292A367CD507), - SPH_C64(0x9159015A3070DD17), SPH_C64(0x152FECD8F70E5939), - SPH_C64(0x67332667FFC00B31), SPH_C64(0x8EB44A8768581511), - SPH_C64(0xDB0C2E0D64F98FA7), SPH_C64(0x47B5481DBEFA4FA4) -}; - -static const sph_u64 IV512[8] = { - SPH_C64(0x6A09E667F3BCC908), SPH_C64(0xBB67AE8584CAA73B), - SPH_C64(0x3C6EF372FE94F82B), SPH_C64(0xA54FF53A5F1D36F1), - SPH_C64(0x510E527FADE682D1), SPH_C64(0x9B05688C2B3E6C1F), - SPH_C64(0x1F83D9ABFB41BD6B), SPH_C64(0x5BE0CD19137E2179) -}; - -#endif - -#if SPH_COMPACT_BLAKE_32 || SPH_COMPACT_BLAKE_64 - -static const unsigned sigma[16][16] = { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, - { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 }, - { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 }, - { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 }, - { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 }, - { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 }, - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, - { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } -}; - -/* - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - 14 10 4 8 9 15 13 6 1 12 0 2 11 7 5 3 - 11 8 12 0 5 2 15 13 10 14 3 6 7 1 9 4 - 7 9 3 1 13 12 11 14 2 6 5 10 4 0 15 8 - 9 0 5 7 2 4 10 15 14 1 11 12 6 8 3 13 - 2 12 6 10 0 11 8 3 4 13 7 5 15 14 1 9 - 12 5 1 15 14 13 4 10 0 7 6 3 9 2 8 11 - 13 11 7 14 12 1 3 9 5 0 15 4 8 6 2 10 - 6 15 14 9 11 3 0 8 12 2 13 7 1 4 10 5 - 10 2 8 4 7 6 1 5 15 11 9 14 3 12 13 0 -*/ -#endif - -#define Z00 0 -#define Z01 1 -#define Z02 2 -#define Z03 3 -#define Z04 4 -#define Z05 5 -#define Z06 6 -#define Z07 7 -#define Z08 8 -#define Z09 9 -#define Z0A A -#define Z0B B -#define Z0C C -#define Z0D D -#define Z0E E -#define Z0F F - -#define Z10 E -#define Z11 A -#define Z12 4 -#define Z13 8 -#define Z14 9 -#define Z15 F -#define Z16 D -#define Z17 6 -#define Z18 1 -#define Z19 C -#define Z1A 0 -#define Z1B 2 -#define Z1C B -#define Z1D 7 -#define Z1E 5 -#define Z1F 3 - -#define Z20 B -#define Z21 8 -#define Z22 C -#define Z23 0 -#define Z24 5 -#define Z25 2 -#define Z26 F -#define Z27 D -#define Z28 A -#define Z29 E -#define Z2A 3 -#define Z2B 6 -#define Z2C 7 -#define Z2D 1 -#define Z2E 9 -#define Z2F 4 - -#define Z30 7 -#define Z31 9 -#define Z32 3 -#define Z33 1 -#define Z34 D -#define Z35 C -#define Z36 B -#define Z37 E -#define Z38 2 -#define Z39 6 -#define Z3A 5 -#define Z3B A -#define Z3C 4 -#define Z3D 0 -#define Z3E F -#define Z3F 8 - -#define Z40 9 -#define Z41 0 -#define Z42 5 -#define Z43 7 -#define Z44 2 -#define Z45 4 -#define Z46 A -#define Z47 F -#define Z48 E -#define Z49 1 -#define Z4A B -#define Z4B C -#define Z4C 6 -#define Z4D 8 -#define Z4E 3 -#define Z4F D - -#define Z50 2 -#define Z51 C -#define Z52 6 -#define Z53 A -#define Z54 0 -#define Z55 B -#define Z56 8 -#define Z57 3 -#define Z58 4 -#define Z59 D -#define Z5A 7 -#define Z5B 5 -#define Z5C F -#define Z5D E -#define Z5E 1 -#define Z5F 9 - -#define Z60 C -#define Z61 5 -#define Z62 1 -#define Z63 F -#define Z64 E -#define Z65 D -#define Z66 4 -#define Z67 A -#define Z68 0 -#define Z69 7 -#define Z6A 6 -#define Z6B 3 -#define Z6C 9 -#define Z6D 2 -#define Z6E 8 -#define Z6F B - -#define Z70 D -#define Z71 B -#define Z72 7 -#define Z73 E -#define Z74 C -#define Z75 1 -#define Z76 3 -#define Z77 9 -#define Z78 5 -#define Z79 0 -#define Z7A F -#define Z7B 4 -#define Z7C 8 -#define Z7D 6 -#define Z7E 2 -#define Z7F A - -#define Z80 6 -#define Z81 F -#define Z82 E -#define Z83 9 -#define Z84 B -#define Z85 3 -#define Z86 0 -#define Z87 8 -#define Z88 C -#define Z89 2 -#define Z8A D -#define Z8B 7 -#define Z8C 1 -#define Z8D 4 -#define Z8E A -#define Z8F 5 - -#define Z90 A -#define Z91 2 -#define Z92 8 -#define Z93 4 -#define Z94 7 -#define Z95 6 -#define Z96 1 -#define Z97 5 -#define Z98 F -#define Z99 B -#define Z9A 9 -#define Z9B E -#define Z9C 3 -#define Z9D C -#define Z9E D -#define Z9F 0 - -#define Mx(r, i) Mx_(Z ## r ## i) -#define Mx_(n) Mx__(n) -#define Mx__(n) M ## n - -#define CSx(r, i) CSx_(Z ## r ## i) -#define CSx_(n) CSx__(n) -#define CSx__(n) CS ## n - -#define CS0 SPH_C32(0x243F6A88) -#define CS1 SPH_C32(0x85A308D3) -#define CS2 SPH_C32(0x13198A2E) -#define CS3 SPH_C32(0x03707344) -#define CS4 SPH_C32(0xA4093822) -#define CS5 SPH_C32(0x299F31D0) -#define CS6 SPH_C32(0x082EFA98) -#define CS7 SPH_C32(0xEC4E6C89) -#define CS8 SPH_C32(0x452821E6) -#define CS9 SPH_C32(0x38D01377) -#define CSA SPH_C32(0xBE5466CF) -#define CSB SPH_C32(0x34E90C6C) -#define CSC SPH_C32(0xC0AC29B7) -#define CSD SPH_C32(0xC97C50DD) -#define CSE SPH_C32(0x3F84D5B5) -#define CSF SPH_C32(0xB5470917) - -#if SPH_COMPACT_BLAKE_32 - -static const sph_u32 CS[16] = { - SPH_C32(0x243F6A88), SPH_C32(0x85A308D3), - SPH_C32(0x13198A2E), SPH_C32(0x03707344), - SPH_C32(0xA4093822), SPH_C32(0x299F31D0), - SPH_C32(0x082EFA98), SPH_C32(0xEC4E6C89), - SPH_C32(0x452821E6), SPH_C32(0x38D01377), - SPH_C32(0xBE5466CF), SPH_C32(0x34E90C6C), - SPH_C32(0xC0AC29B7), SPH_C32(0xC97C50DD), - SPH_C32(0x3F84D5B5), SPH_C32(0xB5470917) -}; - -#endif - -#if SPH_64 - -#define CBx(r, i) CBx_(Z ## r ## i) -#define CBx_(n) CBx__(n) -#define CBx__(n) CB ## n - -#define CB0 SPH_C64(0x243F6A8885A308D3) -#define CB1 SPH_C64(0x13198A2E03707344) -#define CB2 SPH_C64(0xA4093822299F31D0) -#define CB3 SPH_C64(0x082EFA98EC4E6C89) -#define CB4 SPH_C64(0x452821E638D01377) -#define CB5 SPH_C64(0xBE5466CF34E90C6C) -#define CB6 SPH_C64(0xC0AC29B7C97C50DD) -#define CB7 SPH_C64(0x3F84D5B5B5470917) -#define CB8 SPH_C64(0x9216D5D98979FB1B) -#define CB9 SPH_C64(0xD1310BA698DFB5AC) -#define CBA SPH_C64(0x2FFD72DBD01ADFB7) -#define CBB SPH_C64(0xB8E1AFED6A267E96) -#define CBC SPH_C64(0xBA7C9045F12C7F99) -#define CBD SPH_C64(0x24A19947B3916CF7) -#define CBE SPH_C64(0x0801F2E2858EFC16) -#define CBF SPH_C64(0x636920D871574E69) - -#if SPH_COMPACT_BLAKE_64 - -static const sph_u64 CB[16] = { - SPH_C64(0x243F6A8885A308D3), SPH_C64(0x13198A2E03707344), - SPH_C64(0xA4093822299F31D0), SPH_C64(0x082EFA98EC4E6C89), - SPH_C64(0x452821E638D01377), SPH_C64(0xBE5466CF34E90C6C), - SPH_C64(0xC0AC29B7C97C50DD), SPH_C64(0x3F84D5B5B5470917), - SPH_C64(0x9216D5D98979FB1B), SPH_C64(0xD1310BA698DFB5AC), - SPH_C64(0x2FFD72DBD01ADFB7), SPH_C64(0xB8E1AFED6A267E96), - SPH_C64(0xBA7C9045F12C7F99), SPH_C64(0x24A19947B3916CF7), - SPH_C64(0x0801F2E2858EFC16), SPH_C64(0x636920D871574E69) -}; - -#endif - -#endif - -#define GS(m0, m1, c0, c1, a, b, c, d) do { \ - a = SPH_T32(a + b + (m0 ^ c1)); \ - d = SPH_ROTR32(d ^ a, 16); \ - c = SPH_T32(c + d); \ - b = SPH_ROTR32(b ^ c, 12); \ - a = SPH_T32(a + b + (m1 ^ c0)); \ - d = SPH_ROTR32(d ^ a, 8); \ - c = SPH_T32(c + d); \ - b = SPH_ROTR32(b ^ c, 7); \ - } while (0) - -#if SPH_COMPACT_BLAKE_32 - -#define ROUND_S(r) do { \ - GS(M[sigma[r][0x0]], M[sigma[r][0x1]], \ - CS[sigma[r][0x0]], CS[sigma[r][0x1]], V0, V4, V8, VC); \ - GS(M[sigma[r][0x2]], M[sigma[r][0x3]], \ - CS[sigma[r][0x2]], CS[sigma[r][0x3]], V1, V5, V9, VD); \ - GS(M[sigma[r][0x4]], M[sigma[r][0x5]], \ - CS[sigma[r][0x4]], CS[sigma[r][0x5]], V2, V6, VA, VE); \ - GS(M[sigma[r][0x6]], M[sigma[r][0x7]], \ - CS[sigma[r][0x6]], CS[sigma[r][0x7]], V3, V7, VB, VF); \ - GS(M[sigma[r][0x8]], M[sigma[r][0x9]], \ - CS[sigma[r][0x8]], CS[sigma[r][0x9]], V0, V5, VA, VF); \ - GS(M[sigma[r][0xA]], M[sigma[r][0xB]], \ - CS[sigma[r][0xA]], CS[sigma[r][0xB]], V1, V6, VB, VC); \ - GS(M[sigma[r][0xC]], M[sigma[r][0xD]], \ - CS[sigma[r][0xC]], CS[sigma[r][0xD]], V2, V7, V8, VD); \ - GS(M[sigma[r][0xE]], M[sigma[r][0xF]], \ - CS[sigma[r][0xE]], CS[sigma[r][0xF]], V3, V4, V9, VE); \ - } while (0) - -#else - -#define ROUND_S(r) do { \ - GS(Mx(r, 0), Mx(r, 1), CSx(r, 0), CSx(r, 1), V0, V4, V8, VC); \ - GS(Mx(r, 2), Mx(r, 3), CSx(r, 2), CSx(r, 3), V1, V5, V9, VD); \ - GS(Mx(r, 4), Mx(r, 5), CSx(r, 4), CSx(r, 5), V2, V6, VA, VE); \ - GS(Mx(r, 6), Mx(r, 7), CSx(r, 6), CSx(r, 7), V3, V7, VB, VF); \ - GS(Mx(r, 8), Mx(r, 9), CSx(r, 8), CSx(r, 9), V0, V5, VA, VF); \ - GS(Mx(r, A), Mx(r, B), CSx(r, A), CSx(r, B), V1, V6, VB, VC); \ - GS(Mx(r, C), Mx(r, D), CSx(r, C), CSx(r, D), V2, V7, V8, VD); \ - GS(Mx(r, E), Mx(r, F), CSx(r, E), CSx(r, F), V3, V4, V9, VE); \ - } while (0) - -#endif - -#if SPH_64 - -#define GB(m0, m1, c0, c1, a, b, c, d) do { \ - a = SPH_T64(a + b + (m0 ^ c1)); \ - d = SPH_ROTR64(d ^ a, 32); \ - c = SPH_T64(c + d); \ - b = SPH_ROTR64(b ^ c, 25); \ - a = SPH_T64(a + b + (m1 ^ c0)); \ - d = SPH_ROTR64(d ^ a, 16); \ - c = SPH_T64(c + d); \ - b = SPH_ROTR64(b ^ c, 11); \ - } while (0) - -#if SPH_COMPACT_BLAKE_64 - -#define ROUND_B(r) do { \ - GB(M[sigma[r][0x0]], M[sigma[r][0x1]], \ - CB[sigma[r][0x0]], CB[sigma[r][0x1]], V0, V4, V8, VC); \ - GB(M[sigma[r][0x2]], M[sigma[r][0x3]], \ - CB[sigma[r][0x2]], CB[sigma[r][0x3]], V1, V5, V9, VD); \ - GB(M[sigma[r][0x4]], M[sigma[r][0x5]], \ - CB[sigma[r][0x4]], CB[sigma[r][0x5]], V2, V6, VA, VE); \ - GB(M[sigma[r][0x6]], M[sigma[r][0x7]], \ - CB[sigma[r][0x6]], CB[sigma[r][0x7]], V3, V7, VB, VF); \ - GB(M[sigma[r][0x8]], M[sigma[r][0x9]], \ - CB[sigma[r][0x8]], CB[sigma[r][0x9]], V0, V5, VA, VF); \ - GB(M[sigma[r][0xA]], M[sigma[r][0xB]], \ - CB[sigma[r][0xA]], CB[sigma[r][0xB]], V1, V6, VB, VC); \ - GB(M[sigma[r][0xC]], M[sigma[r][0xD]], \ - CB[sigma[r][0xC]], CB[sigma[r][0xD]], V2, V7, V8, VD); \ - GB(M[sigma[r][0xE]], M[sigma[r][0xF]], \ - CB[sigma[r][0xE]], CB[sigma[r][0xF]], V3, V4, V9, VE); \ - } while (0) - -#else - -#define ROUND_B(r) do { \ - GB(Mx(r, 0), Mx(r, 1), CBx(r, 0), CBx(r, 1), V0, V4, V8, VC); \ - GB(Mx(r, 2), Mx(r, 3), CBx(r, 2), CBx(r, 3), V1, V5, V9, VD); \ - GB(Mx(r, 4), Mx(r, 5), CBx(r, 4), CBx(r, 5), V2, V6, VA, VE); \ - GB(Mx(r, 6), Mx(r, 7), CBx(r, 6), CBx(r, 7), V3, V7, VB, VF); \ - GB(Mx(r, 8), Mx(r, 9), CBx(r, 8), CBx(r, 9), V0, V5, VA, VF); \ - GB(Mx(r, A), Mx(r, B), CBx(r, A), CBx(r, B), V1, V6, VB, VC); \ - GB(Mx(r, C), Mx(r, D), CBx(r, C), CBx(r, D), V2, V7, V8, VD); \ - GB(Mx(r, E), Mx(r, F), CBx(r, E), CBx(r, F), V3, V4, V9, VE); \ - } while (0) - -#endif - -#endif - -#define DECL_STATE32 \ - sph_u32 H0, H1, H2, H3, H4, H5, H6, H7; \ - sph_u32 S0, S1, S2, S3, T0, T1; - -#define READ_STATE32(state) do { \ - H0 = (state)->H[0]; \ - H1 = (state)->H[1]; \ - H2 = (state)->H[2]; \ - H3 = (state)->H[3]; \ - H4 = (state)->H[4]; \ - H5 = (state)->H[5]; \ - H6 = (state)->H[6]; \ - H7 = (state)->H[7]; \ - S0 = (state)->S[0]; \ - S1 = (state)->S[1]; \ - S2 = (state)->S[2]; \ - S3 = (state)->S[3]; \ - T0 = (state)->T0; \ - T1 = (state)->T1; \ - } while (0) - -#define WRITE_STATE32(state) do { \ - (state)->H[0] = H0; \ - (state)->H[1] = H1; \ - (state)->H[2] = H2; \ - (state)->H[3] = H3; \ - (state)->H[4] = H4; \ - (state)->H[5] = H5; \ - (state)->H[6] = H6; \ - (state)->H[7] = H7; \ - (state)->S[0] = S0; \ - (state)->S[1] = S1; \ - (state)->S[2] = S2; \ - (state)->S[3] = S3; \ - (state)->T0 = T0; \ - (state)->T1 = T1; \ - } while (0) - -#if SPH_COMPACT_BLAKE_32 - -#define COMPRESS32 do { \ - sph_u32 M[16]; \ - sph_u32 V0, V1, V2, V3, V4, V5, V6, V7; \ - sph_u32 V8, V9, VA, VB, VC, VD, VE, VF; \ - unsigned r; \ - V0 = H0; \ - V1 = H1; \ - V2 = H2; \ - V3 = H3; \ - V4 = H4; \ - V5 = H5; \ - V6 = H6; \ - V7 = H7; \ - V8 = S0 ^ CS0; \ - V9 = S1 ^ CS1; \ - VA = S2 ^ CS2; \ - VB = S3 ^ CS3; \ - VC = T0 ^ CS4; \ - VD = T0 ^ CS5; \ - VE = T1 ^ CS6; \ - VF = T1 ^ CS7; \ - M[0x0] = sph_dec32be_aligned(buf + 0); \ - M[0x1] = sph_dec32be_aligned(buf + 4); \ - M[0x2] = sph_dec32be_aligned(buf + 8); \ - M[0x3] = sph_dec32be_aligned(buf + 12); \ - M[0x4] = sph_dec32be_aligned(buf + 16); \ - M[0x5] = sph_dec32be_aligned(buf + 20); \ - M[0x6] = sph_dec32be_aligned(buf + 24); \ - M[0x7] = sph_dec32be_aligned(buf + 28); \ - M[0x8] = sph_dec32be_aligned(buf + 32); \ - M[0x9] = sph_dec32be_aligned(buf + 36); \ - M[0xA] = sph_dec32be_aligned(buf + 40); \ - M[0xB] = sph_dec32be_aligned(buf + 44); \ - M[0xC] = sph_dec32be_aligned(buf + 48); \ - M[0xD] = sph_dec32be_aligned(buf + 52); \ - M[0xE] = sph_dec32be_aligned(buf + 56); \ - M[0xF] = sph_dec32be_aligned(buf + 60); \ - for (r = 0; r < blake256_rounds; r ++) \ - ROUND_S(r); \ - H0 ^= S0 ^ V0 ^ V8; \ - H1 ^= S1 ^ V1 ^ V9; \ - H2 ^= S2 ^ V2 ^ VA; \ - H3 ^= S3 ^ V3 ^ VB; \ - H4 ^= S0 ^ V4 ^ VC; \ - H5 ^= S1 ^ V5 ^ VD; \ - H6 ^= S2 ^ V6 ^ VE; \ - H7 ^= S3 ^ V7 ^ VF; \ - } while (0) - -#else - -#define COMPRESS32 do { \ - sph_u32 M0, M1, M2, M3, M4, M5, M6, M7; \ - sph_u32 M8, M9, MA, MB, MC, MD, ME, MF; \ - sph_u32 V0, V1, V2, V3, V4, V5, V6, V7; \ - sph_u32 V8, V9, VA, VB, VC, VD, VE, VF; \ - V0 = H0; \ - V1 = H1; \ - V2 = H2; \ - V3 = H3; \ - V4 = H4; \ - V5 = H5; \ - V6 = H6; \ - V7 = H7; \ - V8 = S0 ^ CS0; \ - V9 = S1 ^ CS1; \ - VA = S2 ^ CS2; \ - VB = S3 ^ CS3; \ - VC = T0 ^ CS4; \ - VD = T0 ^ CS5; \ - VE = T1 ^ CS6; \ - VF = T1 ^ CS7; \ - M0 = sph_dec32be_aligned(buf + 0); \ - M1 = sph_dec32be_aligned(buf + 4); \ - M2 = sph_dec32be_aligned(buf + 8); \ - M3 = sph_dec32be_aligned(buf + 12); \ - M4 = sph_dec32be_aligned(buf + 16); \ - M5 = sph_dec32be_aligned(buf + 20); \ - M6 = sph_dec32be_aligned(buf + 24); \ - M7 = sph_dec32be_aligned(buf + 28); \ - M8 = sph_dec32be_aligned(buf + 32); \ - M9 = sph_dec32be_aligned(buf + 36); \ - MA = sph_dec32be_aligned(buf + 40); \ - MB = sph_dec32be_aligned(buf + 44); \ - MC = sph_dec32be_aligned(buf + 48); \ - MD = sph_dec32be_aligned(buf + 52); \ - ME = sph_dec32be_aligned(buf + 56); \ - MF = sph_dec32be_aligned(buf + 60); \ - ROUND_S(0); \ - ROUND_S(1); \ - ROUND_S(2); \ - ROUND_S(3); \ - ROUND_S(4); \ - ROUND_S(5); \ - ROUND_S(6); \ - ROUND_S(7); \ - if (blake256_rounds == 14) { \ - ROUND_S(8); \ - ROUND_S(9); \ - ROUND_S(0); \ - ROUND_S(1); \ - ROUND_S(2); \ - ROUND_S(3); \ - } \ - H0 ^= S0 ^ V0 ^ V8; \ - H1 ^= S1 ^ V1 ^ V9; \ - H2 ^= S2 ^ V2 ^ VA; \ - H3 ^= S3 ^ V3 ^ VB; \ - H4 ^= S0 ^ V4 ^ VC; \ - H5 ^= S1 ^ V5 ^ VD; \ - H6 ^= S2 ^ V6 ^ VE; \ - H7 ^= S3 ^ V7 ^ VF; \ - } while (0) - -#endif - -#if SPH_64 - -#define DECL_STATE64 \ - sph_u64 H0, H1, H2, H3, H4, H5, H6, H7; \ - sph_u64 S0, S1, S2, S3, T0, T1; - -#define READ_STATE64(state) do { \ - H0 = (state)->H[0]; \ - H1 = (state)->H[1]; \ - H2 = (state)->H[2]; \ - H3 = (state)->H[3]; \ - H4 = (state)->H[4]; \ - H5 = (state)->H[5]; \ - H6 = (state)->H[6]; \ - H7 = (state)->H[7]; \ - S0 = (state)->S[0]; \ - S1 = (state)->S[1]; \ - S2 = (state)->S[2]; \ - S3 = (state)->S[3]; \ - T0 = (state)->T0; \ - T1 = (state)->T1; \ - } while (0) - -#define WRITE_STATE64(state) do { \ - (state)->H[0] = H0; \ - (state)->H[1] = H1; \ - (state)->H[2] = H2; \ - (state)->H[3] = H3; \ - (state)->H[4] = H4; \ - (state)->H[5] = H5; \ - (state)->H[6] = H6; \ - (state)->H[7] = H7; \ - (state)->S[0] = S0; \ - (state)->S[1] = S1; \ - (state)->S[2] = S2; \ - (state)->S[3] = S3; \ - (state)->T0 = T0; \ - (state)->T1 = T1; \ - } while (0) - -#if SPH_COMPACT_BLAKE_64 - -#define COMPRESS64 do { \ - sph_u64 M[16]; \ - sph_u64 V0, V1, V2, V3, V4, V5, V6, V7; \ - sph_u64 V8, V9, VA, VB, VC, VD, VE, VF; \ - unsigned r; \ - V0 = H0; \ - V1 = H1; \ - V2 = H2; \ - V3 = H3; \ - V4 = H4; \ - V5 = H5; \ - V6 = H6; \ - V7 = H7; \ - V8 = S0 ^ CB0; \ - V9 = S1 ^ CB1; \ - VA = S2 ^ CB2; \ - VB = S3 ^ CB3; \ - VC = T0 ^ CB4; \ - VD = T0 ^ CB5; \ - VE = T1 ^ CB6; \ - VF = T1 ^ CB7; \ - M[0x0] = sph_dec64be_aligned(buf + 0); \ - M[0x1] = sph_dec64be_aligned(buf + 8); \ - M[0x2] = sph_dec64be_aligned(buf + 16); \ - M[0x3] = sph_dec64be_aligned(buf + 24); \ - M[0x4] = sph_dec64be_aligned(buf + 32); \ - M[0x5] = sph_dec64be_aligned(buf + 40); \ - M[0x6] = sph_dec64be_aligned(buf + 48); \ - M[0x7] = sph_dec64be_aligned(buf + 56); \ - M[0x8] = sph_dec64be_aligned(buf + 64); \ - M[0x9] = sph_dec64be_aligned(buf + 72); \ - M[0xA] = sph_dec64be_aligned(buf + 80); \ - M[0xB] = sph_dec64be_aligned(buf + 88); \ - M[0xC] = sph_dec64be_aligned(buf + 96); \ - M[0xD] = sph_dec64be_aligned(buf + 104); \ - M[0xE] = sph_dec64be_aligned(buf + 112); \ - M[0xF] = sph_dec64be_aligned(buf + 120); \ - for (r = 0; r < 16; r ++) \ - ROUND_B(r); \ - H0 ^= S0 ^ V0 ^ V8; \ - H1 ^= S1 ^ V1 ^ V9; \ - H2 ^= S2 ^ V2 ^ VA; \ - H3 ^= S3 ^ V3 ^ VB; \ - H4 ^= S0 ^ V4 ^ VC; \ - H5 ^= S1 ^ V5 ^ VD; \ - H6 ^= S2 ^ V6 ^ VE; \ - H7 ^= S3 ^ V7 ^ VF; \ - } while (0) - -#else - -#define COMPRESS64 do { \ - sph_u64 M0, M1, M2, M3, M4, M5, M6, M7; \ - sph_u64 M8, M9, MA, MB, MC, MD, ME, MF; \ - sph_u64 V0, V1, V2, V3, V4, V5, V6, V7; \ - sph_u64 V8, V9, VA, VB, VC, VD, VE, VF; \ - V0 = H0; \ - V1 = H1; \ - V2 = H2; \ - V3 = H3; \ - V4 = H4; \ - V5 = H5; \ - V6 = H6; \ - V7 = H7; \ - V8 = S0 ^ CB0; \ - V9 = S1 ^ CB1; \ - VA = S2 ^ CB2; \ - VB = S3 ^ CB3; \ - VC = T0 ^ CB4; \ - VD = T0 ^ CB5; \ - VE = T1 ^ CB6; \ - VF = T1 ^ CB7; \ - M0 = sph_dec64be_aligned(buf + 0); \ - M1 = sph_dec64be_aligned(buf + 8); \ - M2 = sph_dec64be_aligned(buf + 16); \ - M3 = sph_dec64be_aligned(buf + 24); \ - M4 = sph_dec64be_aligned(buf + 32); \ - M5 = sph_dec64be_aligned(buf + 40); \ - M6 = sph_dec64be_aligned(buf + 48); \ - M7 = sph_dec64be_aligned(buf + 56); \ - M8 = sph_dec64be_aligned(buf + 64); \ - M9 = sph_dec64be_aligned(buf + 72); \ - MA = sph_dec64be_aligned(buf + 80); \ - MB = sph_dec64be_aligned(buf + 88); \ - MC = sph_dec64be_aligned(buf + 96); \ - MD = sph_dec64be_aligned(buf + 104); \ - ME = sph_dec64be_aligned(buf + 112); \ - MF = sph_dec64be_aligned(buf + 120); \ - ROUND_B(0); \ - ROUND_B(1); \ - ROUND_B(2); \ - ROUND_B(3); \ - ROUND_B(4); \ - ROUND_B(5); \ - ROUND_B(6); \ - ROUND_B(7); \ - ROUND_B(8); \ - ROUND_B(9); \ - ROUND_B(0); \ - ROUND_B(1); \ - ROUND_B(2); \ - ROUND_B(3); \ - ROUND_B(4); \ - ROUND_B(5); \ - H0 ^= S0 ^ V0 ^ V8; \ - H1 ^= S1 ^ V1 ^ V9; \ - H2 ^= S2 ^ V2 ^ VA; \ - H3 ^= S3 ^ V3 ^ VB; \ - H4 ^= S0 ^ V4 ^ VC; \ - H5 ^= S1 ^ V5 ^ VD; \ - H6 ^= S2 ^ V6 ^ VE; \ - H7 ^= S3 ^ V7 ^ VF; \ - } while (0) - -#endif - -#endif - -static const sph_u32 salt_zero_small[4] = { 0, 0, 0, 0 }; - -static void -blake32_init(sph_blake_small_context *sc, - const sph_u32 *iv, const sph_u32 *salt) -{ - memcpy(sc->H, iv, 8 * sizeof(sph_u32)); - memcpy(sc->S, salt, 4 * sizeof(sph_u32)); - sc->T0 = sc->T1 = 0; - sc->ptr = 0; -} - -static void -blake32(sph_blake_small_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - DECL_STATE32 - - buf = sc->buf; - ptr = sc->ptr; - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - READ_STATE32(sc); - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data = (const unsigned char *)data + clen; - len -= clen; - if (ptr == sizeof sc->buf) { - if ((T0 = SPH_T32(T0 + 512)) < 512) - T1 = SPH_T32(T1 + 1); - COMPRESS32; - ptr = 0; - } - } - WRITE_STATE32(sc); - sc->ptr = ptr; -} - -static void -blake32_close(sph_blake_small_context *sc, - unsigned ub, unsigned n, void *dst, size_t out_size_w32) -{ - union { - unsigned char buf[64]; - sph_u32 dummy; - } u; - size_t ptr, k; - unsigned bit_len; - unsigned z; - sph_u32 th, tl; - unsigned char *out; - - ptr = sc->ptr; - bit_len = ((unsigned)ptr << 3) + n; - z = 0x80 >> n; - u.buf[ptr] = ((ub & -z) | z) & 0xFF; - tl = sc->T0 + bit_len; - th = sc->T1; - if (ptr == 0 && n == 0) { - sc->T0 = SPH_C32(0xFFFFFE00); - sc->T1 = SPH_C32(0xFFFFFFFF); - } else if (sc->T0 == 0) { - sc->T0 = SPH_C32(0xFFFFFE00) + bit_len; - sc->T1 = SPH_T32(sc->T1 - 1); - } else { - sc->T0 -= 512 - bit_len; - } - if (bit_len <= 446) { - memset(u.buf + ptr + 1, 0, 55 - ptr); - if (out_size_w32 == 8) - u.buf[55] |= 1; - sph_enc32be_aligned(u.buf + 56, th); - sph_enc32be_aligned(u.buf + 60, tl); - blake32(sc, u.buf + ptr, 64 - ptr); - } else { - memset(u.buf + ptr + 1, 0, 63 - ptr); - blake32(sc, u.buf + ptr, 64 - ptr); - sc->T0 = SPH_C32(0xFFFFFE00); - sc->T1 = SPH_C32(0xFFFFFFFF); - memset(u.buf, 0, 56); - if (out_size_w32 == 8) - u.buf[55] = 1; - sph_enc32be_aligned(u.buf + 56, th); - sph_enc32be_aligned(u.buf + 60, tl); - blake32(sc, u.buf, 64); - } - out = dst; - for (k = 0; k < out_size_w32; k ++) - sph_enc32be(out + (k << 2), sc->H[k]); -} - -#if SPH_64 - -static const sph_u64 salt_zero_big[4] = { 0, 0, 0, 0 }; - -static void -blake64_init(sph_blake_big_context *sc, - const sph_u64 *iv, const sph_u64 *salt) -{ - memcpy(sc->H, iv, 8 * sizeof(sph_u64)); - memcpy(sc->S, salt, 4 * sizeof(sph_u64)); - sc->T0 = sc->T1 = 0; - sc->ptr = 0; -} - -static void -blake64(sph_blake_big_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - DECL_STATE64 - - buf = sc->buf; - ptr = sc->ptr; - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - READ_STATE64(sc); - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data = (const unsigned char *)data + clen; - len -= clen; - if (ptr == sizeof sc->buf) { - if ((T0 = SPH_T64(T0 + 1024)) < 1024) - T1 = SPH_T64(T1 + 1); - COMPRESS64; - ptr = 0; - } - } - WRITE_STATE64(sc); - sc->ptr = ptr; -} - -static void -blake64_close(sph_blake_big_context *sc, - unsigned ub, unsigned n, void *dst, size_t out_size_w64) -{ - union { - unsigned char buf[128]; - sph_u64 dummy; - } u; - size_t ptr, k; - unsigned bit_len; - unsigned z; - sph_u64 th, tl; - unsigned char *out; - - ptr = sc->ptr; - bit_len = ((unsigned)ptr << 3) + n; - z = 0x80 >> n; - u.buf[ptr] = ((ub & -z) | z) & 0xFF; - tl = sc->T0 + bit_len; - th = sc->T1; - if (ptr == 0 && n == 0) { - sc->T0 = SPH_C64(0xFFFFFFFFFFFFFC00); - sc->T1 = SPH_C64(0xFFFFFFFFFFFFFFFF); - } else if (sc->T0 == 0) { - sc->T0 = SPH_C64(0xFFFFFFFFFFFFFC00) + bit_len; - sc->T1 = SPH_T64(sc->T1 - 1); - } else { - sc->T0 -= 1024 - bit_len; - } - if (bit_len <= 894) { - memset(u.buf + ptr + 1, 0, 111 - ptr); - if (out_size_w64 == 8) - u.buf[111] |= 1; - sph_enc64be_aligned(u.buf + 112, th); - sph_enc64be_aligned(u.buf + 120, tl); - blake64(sc, u.buf + ptr, 128 - ptr); - } else { - memset(u.buf + ptr + 1, 0, 127 - ptr); - blake64(sc, u.buf + ptr, 128 - ptr); - sc->T0 = SPH_C64(0xFFFFFFFFFFFFFC00); - sc->T1 = SPH_C64(0xFFFFFFFFFFFFFFFF); - memset(u.buf, 0, 112); - if (out_size_w64 == 8) - u.buf[111] = 1; - sph_enc64be_aligned(u.buf + 112, th); - sph_enc64be_aligned(u.buf + 120, tl); - blake64(sc, u.buf, 128); - } - out = dst; - for (k = 0; k < out_size_w64; k ++) - sph_enc64be(out + (k << 3), sc->H[k]); -} - -#endif - -/* see sph_blake.h */ -void -sph_blake224_init(void *cc) -{ - blake32_init(cc, IV224, salt_zero_small); -} - -/* see sph_blake.h */ -void -sph_blake224(void *cc, const void *data, size_t len) -{ - blake32(cc, data, len); -} - -/* see sph_blake.h */ -void -sph_blake224_close(void *cc, void *dst) -{ - sph_blake224_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_blake.h */ -void -sph_blake224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - blake32_close(cc, ub, n, dst, 7); - sph_blake224_init(cc); -} - -/* see sph_blake.h */ -void -sph_blake256_init(void *cc) -{ - blake32_init(cc, IV256, salt_zero_small); -} - -/* see sph_blake.h */ -void -sph_blake256(void *cc, const void *data, size_t len) -{ - blake32(cc, data, len); -} - -/* see sph_blake.h */ -void -sph_blake256_close(void *cc, void *dst) -{ - sph_blake256_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_blake.h */ -void -sph_blake256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - blake32_close(cc, ub, n, dst, 8); - sph_blake256_init(cc); -} - -/* see sph_blake.h */ -void -sph_blake256_set_rounds(int rounds) -{ - blake256_rounds = rounds; -} - -#if SPH_64 - -/* see sph_blake.h */ -void -sph_blake384_init(void *cc) -{ - blake64_init(cc, IV384, salt_zero_big); -} - -/* see sph_blake.h */ -void -sph_blake384(void *cc, const void *data, size_t len) -{ - blake64(cc, data, len); -} - -/* see sph_blake.h */ -void -sph_blake384_close(void *cc, void *dst) -{ - sph_blake384_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_blake.h */ -void -sph_blake384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - blake64_close(cc, ub, n, dst, 6); - sph_blake384_init(cc); -} - -/* see sph_blake.h */ -void -sph_blake512_init(void *cc) -{ - blake64_init(cc, IV512, salt_zero_big); -} - -/* see sph_blake.h */ -void -sph_blake512(void *cc, const void *data, size_t len) -{ - blake64(cc, data, len); -} - -/* see sph_blake.h */ -void -sph_blake512_close(void *cc, void *dst) -{ - sph_blake512_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_blake.h */ -void -sph_blake512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - blake64_close(cc, ub, n, dst, 8); - sph_blake512_init(cc); -} - -#endif - -#ifdef __cplusplus -} -#endif diff --git a/sph/blake2b.c b/sph/blake2b.c deleted file mode 100644 index f85c9771..00000000 --- a/sph/blake2b.c +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright 2009 Colin Percival, 2014 savale - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file was originally written by Colin Percival as part of the Tarsnap - * online backup system. - */ - -#include -#include -#include - -#include "sph_types.h" -#include "blake2b.h" - -// Cyclic right rotation. - -#ifndef ROTR64 -#define ROTR64(x, y) (((x) >> (y)) ^ ((x) << (64 - (y)))) -#endif - -// Little-endian byte access. - -#define B2B_GET64(p) \ - (((uint64_t) ((uint8_t *) (p))[0]) ^ \ - (((uint64_t) ((uint8_t *) (p))[1]) << 8) ^ \ - (((uint64_t) ((uint8_t *) (p))[2]) << 16) ^ \ - (((uint64_t) ((uint8_t *) (p))[3]) << 24) ^ \ - (((uint64_t) ((uint8_t *) (p))[4]) << 32) ^ \ - (((uint64_t) ((uint8_t *) (p))[5]) << 40) ^ \ - (((uint64_t) ((uint8_t *) (p))[6]) << 48) ^ \ - (((uint64_t) ((uint8_t *) (p))[7]) << 56)) - -// G Mixing function. - -#define B2B_G(a, b, c, d, x, y) { \ - v[a] = v[a] + v[b] + x; \ - v[d] = ROTR64(v[d] ^ v[a], 32); \ - v[c] = v[c] + v[d]; \ - v[b] = ROTR64(v[b] ^ v[c], 24); \ - v[a] = v[a] + v[b] + y; \ - v[d] = ROTR64(v[d] ^ v[a], 16); \ - v[c] = v[c] + v[d]; \ - v[b] = ROTR64(v[b] ^ v[c], 63); } - -// Initialization Vector. - -static const uint64_t blake2b_iv[8] = { - 0x6A09E667F3BCC908, 0xBB67AE8584CAA73B, - 0x3C6EF372FE94F82B, 0xA54FF53A5F1D36F1, - 0x510E527FADE682D1, 0x9B05688C2B3E6C1F, - 0x1F83D9ABFB41BD6B, 0x5BE0CD19137E2179 -}; - -// Compression function. "last" flag indicates last block. - -static void blake2b_compress(blake2b_ctx *ctx, int last) -{ - const uint8_t sigma[12][16] = { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, - { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 }, - { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 }, - { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 }, - { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 }, - { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 }, - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } - }; - int i; - uint64_t v[16], m[16]; - - for (i = 0; i < 8; i++) { // init work variables - v[i] = ctx->h[i]; - v[i + 8] = blake2b_iv[i]; - } - - v[12] ^= ctx->t[0]; // low 64 bits of offset - v[13] ^= ctx->t[1]; // high 64 bits - if (last) // last block flag set ? - v[14] = ~v[14]; - - for (i = 0; i < 16; i++) // get little-endian words - m[i] = B2B_GET64(&ctx->b[8 * i]); - - for (i = 0; i < 12; i++) { // twelve rounds - B2B_G( 0, 4, 8, 12, m[sigma[i][ 0]], m[sigma[i][ 1]]); - B2B_G( 1, 5, 9, 13, m[sigma[i][ 2]], m[sigma[i][ 3]]); - B2B_G( 2, 6, 10, 14, m[sigma[i][ 4]], m[sigma[i][ 5]]); - B2B_G( 3, 7, 11, 15, m[sigma[i][ 6]], m[sigma[i][ 7]]); - B2B_G( 0, 5, 10, 15, m[sigma[i][ 8]], m[sigma[i][ 9]]); - B2B_G( 1, 6, 11, 12, m[sigma[i][10]], m[sigma[i][11]]); - B2B_G( 2, 7, 8, 13, m[sigma[i][12]], m[sigma[i][13]]); - B2B_G( 3, 4, 9, 14, m[sigma[i][14]], m[sigma[i][15]]); - } - - for( i = 0; i < 8; ++i ) - ctx->h[i] ^= v[i] ^ v[i + 8]; -} - -// Initialize the hashing context "ctx" with optional key "key". -// 1 <= outlen <= 64 gives the digest size in bytes. -// Secret key (also <= 64 bytes) is optional (keylen = 0). - -int blake2b_init(blake2b_ctx *ctx, size_t outlen, - const void *key, size_t keylen) // (keylen=0: no key) -{ - size_t i; - - if (outlen == 0 || outlen > 64 || keylen > 64) - return -1; // illegal parameters - - for (i = 0; i < 8; i++) // state, "param block" - ctx->h[i] = blake2b_iv[i]; - ctx->h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen; - - ctx->t[0] = 0; // input count low word - ctx->t[1] = 0; // input count high word - ctx->c = 0; // pointer within buffer - ctx->outlen = outlen; - - for (i = keylen; i < 128; i++) // zero input block - ctx->b[i] = 0; - if (keylen > 0) { - blake2b_update(ctx, key, keylen); - ctx->c = 128; // at the end - } - - return 0; -} - -// Add "inlen" bytes from "in" into the hash. - -void blake2b_update(blake2b_ctx *ctx, - const void *in, size_t inlen) // data bytes -{ - size_t i; - - for (i = 0; i < inlen; i++) { - if (ctx->c == 128) { // buffer full ? - ctx->t[0] += ctx->c; // add counters - if (ctx->t[0] < ctx->c) // carry overflow ? - ctx->t[1]++; // high word - blake2b_compress(ctx, 0); // compress (not last) - ctx->c = 0; // counter to zero - } - ctx->b[ctx->c++] = ((const uint8_t *) in)[i]; - } -} - -// Generate the message digest (size given in init). -// Result placed in "out". - -void blake2b_final(blake2b_ctx *ctx, void *out) -{ - size_t i; - - ctx->t[0] += ctx->c; // mark last block offset - if (ctx->t[0] < ctx->c) // carry overflow - ctx->t[1]++; // high word - - while (ctx->c < 128) // fill up with zeros - ctx->b[ctx->c++] = 0; - blake2b_compress(ctx, 1); // final block flag = 1 - - // little endian convert and store - for (i = 0; i < ctx->outlen; i++) { - ((uint8_t *) out)[i] = - (ctx->h[i >> 3] >> (8 * (i & 7))) & 0xFF; - } -} - diff --git a/sph/blake2b.h b/sph/blake2b.h deleted file mode 100644 index f8652c18..00000000 --- a/sph/blake2b.h +++ /dev/null @@ -1,41 +0,0 @@ -#pragma once -#ifndef __BLAKE2B_H__ -#define __BLAKE2B_H__ - -#include -#include - -#if defined(_MSC_VER) -#include -#define inline __inline -#define ALIGN(x) __declspec(align(x)) -#else -#define ALIGN(x) __attribute__((aligned(x))) -#endif - -#if defined(_MSC_VER) || defined(__x86_64__) || defined(__x86__) -#define NATIVE_LITTLE_ENDIAN -#endif - -// state context -ALIGN(64) typedef struct { - uint8_t b[128]; // input buffer - uint64_t h[8]; // chained state - uint64_t t[2]; // total number of bytes - size_t c; // pointer for b[] - size_t outlen; // digest size -} blake2b_ctx; - -#if defined(__cplusplus) -extern "C" { -#endif - -int blake2b_init(blake2b_ctx *ctx, size_t outlen, const void *key, size_t keylen); -void blake2b_update(blake2b_ctx *ctx, const void *in, size_t inlen); -void blake2b_final(blake2b_ctx *ctx, void *out); - -#if defined(__cplusplus) -} -#endif - -#endif diff --git a/sph/blake2s.c b/sph/blake2s.c deleted file mode 100644 index 62b5a395..00000000 --- a/sph/blake2s.c +++ /dev/null @@ -1,387 +0,0 @@ -/** - * BLAKE2 reference source code package - reference C implementations - * - * Written in 2012 by Samuel Neves - * - * To the extent possible under law, the author(s) have dedicated all copyright - * and related and neighboring rights to this software to the public domain - * worldwide. This software is distributed without any warranty. - * - * You should have received a copy of the CC0 Public Domain Dedication along with - * this software. If not, see . - */ - -#include -#include -#include - -#if defined(__cplusplus) -extern "C" { -#endif - -#include "sph_types.h" -#include "blake2s.h" - -static const uint32_t blake2s_IV[8] = -{ - 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL, - 0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL -}; - -static const uint8_t blake2s_sigma[10][16] = -{ - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } , - { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } , - { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } , - { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } , - { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } , - { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } , - { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } , - { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } , - { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } , - { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 } , -}; - -static inline int blake2s_set_lastnode( blake2s_state *S ) -{ - S->f[1] = ~0U; - return 0; -} - -static inline int blake2s_clear_lastnode( blake2s_state *S ) -{ - S->f[1] = 0U; - return 0; -} - -/* Some helper functions, not necessarily useful */ -static inline int blake2s_set_lastblock( blake2s_state *S ) -{ - if( S->last_node ) blake2s_set_lastnode( S ); - - S->f[0] = ~0U; - return 0; -} - -static inline int blake2s_clear_lastblock( blake2s_state *S ) -{ - if( S->last_node ) blake2s_clear_lastnode( S ); - - S->f[0] = 0U; - return 0; -} - -static inline int blake2s_increment_counter( blake2s_state *S, const uint32_t inc ) -{ - S->t[0] += inc; - S->t[1] += ( S->t[0] < inc ); - return 0; -} - -// Parameter-related functions -static inline int blake2s_param_set_digest_length( blake2s_param *P, const uint8_t digest_length ) -{ - P->digest_length = digest_length; - return 0; -} - -static inline int blake2s_param_set_fanout( blake2s_param *P, const uint8_t fanout ) -{ - P->fanout = fanout; - return 0; -} - -static inline int blake2s_param_set_max_depth( blake2s_param *P, const uint8_t depth ) -{ - P->depth = depth; - return 0; -} - -static inline int blake2s_param_set_leaf_length( blake2s_param *P, const uint32_t leaf_length ) -{ - store32( &P->leaf_length, leaf_length ); - return 0; -} - -static inline int blake2s_param_set_node_offset( blake2s_param *P, const uint64_t node_offset ) -{ - store48( P->node_offset, node_offset ); - return 0; -} - -static inline int blake2s_param_set_node_depth( blake2s_param *P, const uint8_t node_depth ) -{ - P->node_depth = node_depth; - return 0; -} - -static inline int blake2s_param_set_inner_length( blake2s_param *P, const uint8_t inner_length ) -{ - P->inner_length = inner_length; - return 0; -} - -static inline int blake2s_param_set_salt( blake2s_param *P, const uint8_t salt[BLAKE2S_SALTBYTES] ) -{ - memcpy( P->salt, salt, BLAKE2S_SALTBYTES ); - return 0; -} - -static inline int blake2s_param_set_personal( blake2s_param *P, const uint8_t personal[BLAKE2S_PERSONALBYTES] ) -{ - memcpy( P->personal, personal, BLAKE2S_PERSONALBYTES ); - return 0; -} - -static inline int blake2s_init0( blake2s_state *S ) -{ - memset( S, 0, sizeof( blake2s_state ) ); - - for( int i = 0; i < 8; ++i ) S->h[i] = blake2s_IV[i]; - - return 0; -} - -/* init2 xors IV with input parameter block */ -int blake2s_init_param( blake2s_state *S, const blake2s_param *P ) -{ - blake2s_init0( S ); - uint32_t *p = ( uint32_t * )( P ); - - /* IV XOR ParamBlock */ - for( size_t i = 0; i < 8; ++i ) - S->h[i] ^= load32( &p[i] ); - - return 0; -} - - -// Sequential blake2s initialization -int blake2s_init( blake2s_state *S, const uint8_t outlen ) -{ - blake2s_param P[1]; - - /* Move interval verification here? */ - if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1; - - P->digest_length = outlen; - P->key_length = 0; - P->fanout = 1; - P->depth = 1; - store32( &P->leaf_length, 0 ); - store48( &P->node_offset, 0 ); - P->node_depth = 0; - P->inner_length = 0; - // memset(P->reserved, 0, sizeof(P->reserved) ); - memset( P->salt, 0, sizeof( P->salt ) ); - memset( P->personal, 0, sizeof( P->personal ) ); - return blake2s_init_param( S, P ); -} - -int blake2s_init_key( blake2s_state *S, const uint8_t outlen, const void *key, const uint8_t keylen ) -{ - blake2s_param P[1]; - - if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1; - - if ( !key || !keylen || keylen > BLAKE2S_KEYBYTES ) return -1; - - P->digest_length = outlen; - P->key_length = keylen; - P->fanout = 1; - P->depth = 1; - store32( &P->leaf_length, 0 ); - store48( &P->node_offset, 0 ); - P->node_depth = 0; - P->inner_length = 0; - // memset(P->reserved, 0, sizeof(P->reserved) ); - memset( P->salt, 0, sizeof( P->salt ) ); - memset( P->personal, 0, sizeof( P->personal ) ); - - if( blake2s_init_param( S, P ) < 0 ) return -1; - - { - uint8_t block[BLAKE2S_BLOCKBYTES]; - memset( block, 0, BLAKE2S_BLOCKBYTES ); - memcpy( block, key, keylen ); - blake2s_update( S, block, BLAKE2S_BLOCKBYTES ); - secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */ - } - return 0; -} - -int blake2s_compress( blake2s_state *S, const uint8_t block[BLAKE2S_BLOCKBYTES] ) -{ - uint32_t m[16]; - uint32_t v[16]; - - for( size_t i = 0; i < 16; ++i ) - m[i] = load32( block + i * sizeof( m[i] ) ); - - for( size_t i = 0; i < 8; ++i ) - v[i] = S->h[i]; - - v[ 8] = blake2s_IV[0]; - v[ 9] = blake2s_IV[1]; - v[10] = blake2s_IV[2]; - v[11] = blake2s_IV[3]; - v[12] = S->t[0] ^ blake2s_IV[4]; - v[13] = S->t[1] ^ blake2s_IV[5]; - v[14] = S->f[0] ^ blake2s_IV[6]; - v[15] = S->f[1] ^ blake2s_IV[7]; -#define G(r,i,a,b,c,d) \ - do { \ - a = a + b + m[blake2s_sigma[r][2*i+0]]; \ - d = SPH_ROTR32(d ^ a, 16); \ - c = c + d; \ - b = SPH_ROTR32(b ^ c, 12); \ - a = a + b + m[blake2s_sigma[r][2*i+1]]; \ - d = SPH_ROTR32(d ^ a, 8); \ - c = c + d; \ - b = SPH_ROTR32(b ^ c, 7); \ - } while(0) -#define ROUND(r) \ - do { \ - G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \ - G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \ - G(r,2,v[ 2],v[ 6],v[10],v[14]); \ - G(r,3,v[ 3],v[ 7],v[11],v[15]); \ - G(r,4,v[ 0],v[ 5],v[10],v[15]); \ - G(r,5,v[ 1],v[ 6],v[11],v[12]); \ - G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \ - G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \ - } while(0) - ROUND( 0 ); - ROUND( 1 ); - ROUND( 2 ); - ROUND( 3 ); - ROUND( 4 ); - ROUND( 5 ); - ROUND( 6 ); - ROUND( 7 ); - ROUND( 8 ); - ROUND( 9 ); - - for( size_t i = 0; i < 8; ++i ) - S->h[i] = S->h[i] ^ v[i] ^ v[i + 8]; - -#undef G -#undef ROUND - return 0; -} - - -int blake2s_update( blake2s_state *S, const uint8_t *in, uint64_t inlen ) -{ - while( inlen > 0 ) - { - size_t left = S->buflen; - size_t fill = 2 * BLAKE2S_BLOCKBYTES - left; - - if( inlen > fill ) - { - memcpy( S->buf + left, in, fill ); // Fill buffer - S->buflen += fill; - blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES ); - blake2s_compress( S, S->buf ); // Compress - memcpy( S->buf, S->buf + BLAKE2S_BLOCKBYTES, BLAKE2S_BLOCKBYTES ); // Shift buffer left - S->buflen -= BLAKE2S_BLOCKBYTES; - in += fill; - inlen -= fill; - } - else // inlen <= fill - { - memcpy(S->buf + left, in, (size_t) inlen); - S->buflen += (size_t) inlen; // Be lazy, do not compress - in += inlen; - inlen -= inlen; - } - } - - return 0; -} - -int blake2s_final( blake2s_state *S, uint8_t *out, uint8_t outlen ) -{ - uint8_t buffer[BLAKE2S_OUTBYTES]; - - if( S->buflen > BLAKE2S_BLOCKBYTES ) - { - blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES ); - blake2s_compress( S, S->buf ); - S->buflen -= BLAKE2S_BLOCKBYTES; - memcpy( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen ); - } - - blake2s_increment_counter( S, ( uint32_t )S->buflen ); - blake2s_set_lastblock( S ); - memset( S->buf + S->buflen, 0, 2 * BLAKE2S_BLOCKBYTES - S->buflen ); /* Padding */ - blake2s_compress( S, S->buf ); - - for( int i = 0; i < 8; ++i ) /* Output full hash to temp buffer */ - store32( buffer + sizeof( S->h[i] ) * i, S->h[i] ); - - memcpy( out, buffer, outlen ); - return 0; -} - -int blake2s( uint8_t *out, const void *in, const void *key, const uint8_t outlen, const uint64_t inlen, uint8_t keylen ) -{ - blake2s_state S[1]; - - /* Verify parameters */ - if ( NULL == in ) return -1; - - if ( NULL == out ) return -1; - - if ( NULL == key ) keylen = 0; /* Fail here instead if keylen != 0 and key == NULL? */ - - if( keylen > 0 ) - { - if( blake2s_init_key( S, outlen, key, keylen ) < 0 ) return -1; - } - else - { - if( blake2s_init( S, outlen ) < 0 ) return -1; - } - - blake2s_update( S, ( uint8_t * )in, inlen ); - blake2s_final( S, out, outlen ); - return 0; -} - -#if defined(__cplusplus) -} -#endif - - -#if defined(BLAKE2S_SELFTEST) -#include -#include "blake2-kat.h" /* test data not included */ -int main( int argc, char **argv ) -{ - uint8_t key[BLAKE2S_KEYBYTES]; - uint8_t buf[KAT_LENGTH]; - - for( size_t i = 0; i < BLAKE2S_KEYBYTES; ++i ) - key[i] = ( uint8_t )i; - - for( size_t i = 0; i < KAT_LENGTH; ++i ) - buf[i] = ( uint8_t )i; - - for( size_t i = 0; i < KAT_LENGTH; ++i ) - { - uint8_t hash[BLAKE2S_OUTBYTES]; - blake2s( hash, buf, key, BLAKE2S_OUTBYTES, i, BLAKE2S_KEYBYTES ); - - if( 0 != memcmp( hash, blake2s_keyed_kat[i], BLAKE2S_OUTBYTES ) ) - { - puts( "error" ); - return -1; - } - } - - puts( "ok" ); - return 0; -} -#endif diff --git a/sph/blake2s.h b/sph/blake2s.h deleted file mode 100644 index 64aa25b5..00000000 --- a/sph/blake2s.h +++ /dev/null @@ -1,150 +0,0 @@ -/** - * BLAKE2 reference source code package - reference C implementations - * - * Written in 2012 by Samuel Neves - * - * To the extent possible under law, the author(s) have dedicated all copyright - * and related and neighboring rights to this software to the public domain - * worldwide. This software is distributed without any warranty. - * - * You should have received a copy of the CC0 Public Domain Dedication along with - * this software. If not, see . - */ -#pragma once -#ifndef __BLAKE2_H__ -#define __BLAKE2_H__ - -#include -#include - -#if defined(_MSC_VER) -#include -#define inline __inline -#define ALIGN(x) __declspec(align(x)) -#else -#define ALIGN(x) __attribute__((aligned(x))) -#endif - -/* blake2-impl.h */ - -static inline uint32_t load32(const void *src) -{ -#if defined(NATIVE_LITTLE_ENDIAN) - return *(uint32_t *)(src); -#else - const uint8_t *p = (uint8_t *)src; - uint32_t w = *p++; - w |= (uint32_t)(*p++) << 8; - w |= (uint32_t)(*p++) << 16; - w |= (uint32_t)(*p++) << 24; - return w; -#endif -} - -static inline void store32(void *dst, uint32_t w) -{ -#if defined(NATIVE_LITTLE_ENDIAN) - *(uint32_t *)(dst) = w; -#else - uint8_t *p = (uint8_t *)dst; - *p++ = (uint8_t)w; w >>= 8; - *p++ = (uint8_t)w; w >>= 8; - *p++ = (uint8_t)w; w >>= 8; - *p++ = (uint8_t)w; -#endif -} - -static inline uint64_t load48(const void *src) -{ - const uint8_t *p = (const uint8_t *)src; - uint64_t w = *p++; - w |= (uint64_t)(*p++) << 8; - w |= (uint64_t)(*p++) << 16; - w |= (uint64_t)(*p++) << 24; - w |= (uint64_t)(*p++) << 32; - w |= (uint64_t)(*p++) << 40; - return w; -} - -static inline void store48(void *dst, uint64_t w) -{ - uint8_t *p = (uint8_t *)dst; - *p++ = (uint8_t)w; w >>= 8; - *p++ = (uint8_t)w; w >>= 8; - *p++ = (uint8_t)w; w >>= 8; - *p++ = (uint8_t)w; w >>= 8; - *p++ = (uint8_t)w; w >>= 8; - *p++ = (uint8_t)w; -} - -/* prevents compiler optimizing out memset() */ -static inline void secure_zero_memory(void *v, size_t n) -{ - volatile uint8_t *p = ( volatile uint8_t * )v; - - while( n-- ) *p++ = 0; -} - -/* blake2.h */ - -enum blake2s_constant -{ - BLAKE2S_BLOCKBYTES = 64, - BLAKE2S_OUTBYTES = 32, - BLAKE2S_KEYBYTES = 32, - BLAKE2S_SALTBYTES = 8, - BLAKE2S_PERSONALBYTES = 8 -}; - -#pragma pack(push, 1) -typedef struct __blake2s_param -{ - uint8_t digest_length; // 1 - uint8_t key_length; // 2 - uint8_t fanout; // 3 - uint8_t depth; // 4 - uint32_t leaf_length; // 8 - uint8_t node_offset[6];// 14 - uint8_t node_depth; // 15 - uint8_t inner_length; // 16 - // uint8_t reserved[0]; - uint8_t salt[BLAKE2S_SALTBYTES]; // 24 - uint8_t personal[BLAKE2S_PERSONALBYTES]; // 32 -} blake2s_param; - -ALIGN( 64 ) typedef struct __blake2s_state -{ - uint32_t h[8]; - uint32_t t[2]; - uint32_t f[2]; - uint8_t buf[2 * BLAKE2S_BLOCKBYTES]; - size_t buflen; - uint8_t last_node; -} blake2s_state; -#pragma pack(pop) - -#if defined(__cplusplus) -extern "C" { -#endif - - int blake2s_compress( blake2s_state *S, const uint8_t block[BLAKE2S_BLOCKBYTES] ); - - // Streaming API - int blake2s_init( blake2s_state *S, const uint8_t outlen ); - int blake2s_init_key( blake2s_state *S, const uint8_t outlen, const void *key, const uint8_t keylen ); - int blake2s_init_param( blake2s_state *S, const blake2s_param *P ); - int blake2s_update( blake2s_state *S, const uint8_t *in, uint64_t inlen ); - int blake2s_final( blake2s_state *S, uint8_t *out, uint8_t outlen ); - - // Simple API - int blake2s( uint8_t *out, const void *in, const void *key, const uint8_t outlen, const uint64_t inlen, uint8_t keylen ); - - // Direct Hash Mining Helpers - #define blake2s_salt32(out, in, inlen, key32) blake2s(out, in, key32, 32, inlen, 32) /* neoscrypt */ - #define blake2s_simple(out, in, inlen) blake2s(out, in, NULL, 32, inlen, 0) - -#if defined(__cplusplus) -} -#endif - -#endif diff --git a/sph/bmw.c b/sph/bmw.c deleted file mode 100644 index 718191d0..00000000 --- a/sph/bmw.c +++ /dev/null @@ -1,957 +0,0 @@ -/* $Id: bmw.c 227 2010-06-16 17:28:38Z tp $ */ -/* - * BMW implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include -#include - -#include "sph_bmw.h" - -#if SPH_SMALL_FOOTPRINT && !defined SPH_SMALL_FOOTPRINT_BMW -#define SPH_SMALL_FOOTPRINT_BMW 1 -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -static const sph_u32 IV224[] = { - SPH_C32(0x00010203), SPH_C32(0x04050607), - SPH_C32(0x08090A0B), SPH_C32(0x0C0D0E0F), - SPH_C32(0x10111213), SPH_C32(0x14151617), - SPH_C32(0x18191A1B), SPH_C32(0x1C1D1E1F), - SPH_C32(0x20212223), SPH_C32(0x24252627), - SPH_C32(0x28292A2B), SPH_C32(0x2C2D2E2F), - SPH_C32(0x30313233), SPH_C32(0x34353637), - SPH_C32(0x38393A3B), SPH_C32(0x3C3D3E3F) -}; - -static const sph_u32 IV256[] = { - SPH_C32(0x40414243), SPH_C32(0x44454647), - SPH_C32(0x48494A4B), SPH_C32(0x4C4D4E4F), - SPH_C32(0x50515253), SPH_C32(0x54555657), - SPH_C32(0x58595A5B), SPH_C32(0x5C5D5E5F), - SPH_C32(0x60616263), SPH_C32(0x64656667), - SPH_C32(0x68696A6B), SPH_C32(0x6C6D6E6F), - SPH_C32(0x70717273), SPH_C32(0x74757677), - SPH_C32(0x78797A7B), SPH_C32(0x7C7D7E7F) -}; - -#if SPH_64 - -static const sph_u64 IV384[] = { - SPH_C64(0x0001020304050607), SPH_C64(0x08090A0B0C0D0E0F), - SPH_C64(0x1011121314151617), SPH_C64(0x18191A1B1C1D1E1F), - SPH_C64(0x2021222324252627), SPH_C64(0x28292A2B2C2D2E2F), - SPH_C64(0x3031323334353637), SPH_C64(0x38393A3B3C3D3E3F), - SPH_C64(0x4041424344454647), SPH_C64(0x48494A4B4C4D4E4F), - SPH_C64(0x5051525354555657), SPH_C64(0x58595A5B5C5D5E5F), - SPH_C64(0x6061626364656667), SPH_C64(0x68696A6B6C6D6E6F), - SPH_C64(0x7071727374757677), SPH_C64(0x78797A7B7C7D7E7F) -}; - -static const sph_u64 IV512[] = { - SPH_C64(0x8081828384858687), SPH_C64(0x88898A8B8C8D8E8F), - SPH_C64(0x9091929394959697), SPH_C64(0x98999A9B9C9D9E9F), - SPH_C64(0xA0A1A2A3A4A5A6A7), SPH_C64(0xA8A9AAABACADAEAF), - SPH_C64(0xB0B1B2B3B4B5B6B7), SPH_C64(0xB8B9BABBBCBDBEBF), - SPH_C64(0xC0C1C2C3C4C5C6C7), SPH_C64(0xC8C9CACBCCCDCECF), - SPH_C64(0xD0D1D2D3D4D5D6D7), SPH_C64(0xD8D9DADBDCDDDEDF), - SPH_C64(0xE0E1E2E3E4E5E6E7), SPH_C64(0xE8E9EAEBECEDEEEF), - SPH_C64(0xF0F1F2F3F4F5F6F7), SPH_C64(0xF8F9FAFBFCFDFEFF) -}; - -#endif - -#define XCAT(x, y) XCAT_(x, y) -#define XCAT_(x, y) x ## y - -#define LPAR ( - -#define I16_16 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 -#define I16_17 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 -#define I16_18 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 -#define I16_19 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 -#define I16_20 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 -#define I16_21 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 -#define I16_22 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 -#define I16_23 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 -#define I16_24 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 -#define I16_25 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 -#define I16_26 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 -#define I16_27 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -#define I16_28 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 -#define I16_29 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28 -#define I16_30 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 -#define I16_31 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 - -#define M16_16 0, 1, 3, 4, 7, 10, 11 -#define M16_17 1, 2, 4, 5, 8, 11, 12 -#define M16_18 2, 3, 5, 6, 9, 12, 13 -#define M16_19 3, 4, 6, 7, 10, 13, 14 -#define M16_20 4, 5, 7, 8, 11, 14, 15 -#define M16_21 5, 6, 8, 9, 12, 15, 16 -#define M16_22 6, 7, 9, 10, 13, 0, 1 -#define M16_23 7, 8, 10, 11, 14, 1, 2 -#define M16_24 8, 9, 11, 12, 15, 2, 3 -#define M16_25 9, 10, 12, 13, 0, 3, 4 -#define M16_26 10, 11, 13, 14, 1, 4, 5 -#define M16_27 11, 12, 14, 15, 2, 5, 6 -#define M16_28 12, 13, 15, 16, 3, 6, 7 -#define M16_29 13, 14, 0, 1, 4, 7, 8 -#define M16_30 14, 15, 1, 2, 5, 8, 9 -#define M16_31 15, 16, 2, 3, 6, 9, 10 - -#define ss0(x) (((x) >> 1) ^ SPH_T32((x) << 3) \ - ^ SPH_ROTL32(x, 4) ^ SPH_ROTL32(x, 19)) -#define ss1(x) (((x) >> 1) ^ SPH_T32((x) << 2) \ - ^ SPH_ROTL32(x, 8) ^ SPH_ROTL32(x, 23)) -#define ss2(x) (((x) >> 2) ^ SPH_T32((x) << 1) \ - ^ SPH_ROTL32(x, 12) ^ SPH_ROTL32(x, 25)) -#define ss3(x) (((x) >> 2) ^ SPH_T32((x) << 2) \ - ^ SPH_ROTL32(x, 15) ^ SPH_ROTL32(x, 29)) -#define ss4(x) (((x) >> 1) ^ (x)) -#define ss5(x) (((x) >> 2) ^ (x)) -#define rs1(x) SPH_ROTL32(x, 3) -#define rs2(x) SPH_ROTL32(x, 7) -#define rs3(x) SPH_ROTL32(x, 13) -#define rs4(x) SPH_ROTL32(x, 16) -#define rs5(x) SPH_ROTL32(x, 19) -#define rs6(x) SPH_ROTL32(x, 23) -#define rs7(x) SPH_ROTL32(x, 27) - -#define Ks(j) SPH_T32((sph_u32)(j) * SPH_C32(0x05555555)) - -#define add_elt_s(mf, hf, j0m, j1m, j3m, j4m, j7m, j10m, j11m, j16) \ - (SPH_T32(SPH_ROTL32(mf(j0m), j1m) + SPH_ROTL32(mf(j3m), j4m) \ - - SPH_ROTL32(mf(j10m), j11m) + Ks(j16)) ^ hf(j7m)) - -#define expand1s_inner(qf, mf, hf, i16, \ - i0, i1, i2, i3, i4, i5, i6, i7, i8, \ - i9, i10, i11, i12, i13, i14, i15, \ - i0m, i1m, i3m, i4m, i7m, i10m, i11m) \ - SPH_T32(ss1(qf(i0)) + ss2(qf(i1)) + ss3(qf(i2)) + ss0(qf(i3)) \ - + ss1(qf(i4)) + ss2(qf(i5)) + ss3(qf(i6)) + ss0(qf(i7)) \ - + ss1(qf(i8)) + ss2(qf(i9)) + ss3(qf(i10)) + ss0(qf(i11)) \ - + ss1(qf(i12)) + ss2(qf(i13)) + ss3(qf(i14)) + ss0(qf(i15)) \ - + add_elt_s(mf, hf, i0m, i1m, i3m, i4m, i7m, i10m, i11m, i16)) - -#define expand1s(qf, mf, hf, i16) \ - expand1s_(qf, mf, hf, i16, I16_ ## i16, M16_ ## i16) -#define expand1s_(qf, mf, hf, i16, ix, iy) \ - expand1s_inner LPAR qf, mf, hf, i16, ix, iy) - -#define expand2s_inner(qf, mf, hf, i16, \ - i0, i1, i2, i3, i4, i5, i6, i7, i8, \ - i9, i10, i11, i12, i13, i14, i15, \ - i0m, i1m, i3m, i4m, i7m, i10m, i11m) \ - SPH_T32(qf(i0) + rs1(qf(i1)) + qf(i2) + rs2(qf(i3)) \ - + qf(i4) + rs3(qf(i5)) + qf(i6) + rs4(qf(i7)) \ - + qf(i8) + rs5(qf(i9)) + qf(i10) + rs6(qf(i11)) \ - + qf(i12) + rs7(qf(i13)) + ss4(qf(i14)) + ss5(qf(i15)) \ - + add_elt_s(mf, hf, i0m, i1m, i3m, i4m, i7m, i10m, i11m, i16)) - -#define expand2s(qf, mf, hf, i16) \ - expand2s_(qf, mf, hf, i16, I16_ ## i16, M16_ ## i16) -#define expand2s_(qf, mf, hf, i16, ix, iy) \ - expand2s_inner LPAR qf, mf, hf, i16, ix, iy) - -#if SPH_64 - -#define sb0(x) (((x) >> 1) ^ SPH_T64((x) << 3) \ - ^ SPH_ROTL64(x, 4) ^ SPH_ROTL64(x, 37)) -#define sb1(x) (((x) >> 1) ^ SPH_T64((x) << 2) \ - ^ SPH_ROTL64(x, 13) ^ SPH_ROTL64(x, 43)) -#define sb2(x) (((x) >> 2) ^ SPH_T64((x) << 1) \ - ^ SPH_ROTL64(x, 19) ^ SPH_ROTL64(x, 53)) -#define sb3(x) (((x) >> 2) ^ SPH_T64((x) << 2) \ - ^ SPH_ROTL64(x, 28) ^ SPH_ROTL64(x, 59)) -#define sb4(x) (((x) >> 1) ^ (x)) -#define sb5(x) (((x) >> 2) ^ (x)) -#define rb1(x) SPH_ROTL64(x, 5) -#define rb2(x) SPH_ROTL64(x, 11) -#define rb3(x) SPH_ROTL64(x, 27) -#define rb4(x) SPH_ROTL64(x, 32) -#define rb5(x) SPH_ROTL64(x, 37) -#define rb6(x) SPH_ROTL64(x, 43) -#define rb7(x) SPH_ROTL64(x, 53) - -#define Kb(j) SPH_T64((sph_u64)(j) * SPH_C64(0x0555555555555555)) - -#if SPH_SMALL_FOOTPRINT_BMW - -static const sph_u64 Kb_tab[] = { - Kb(16), Kb(17), Kb(18), Kb(19), Kb(20), Kb(21), Kb(22), Kb(23), - Kb(24), Kb(25), Kb(26), Kb(27), Kb(28), Kb(29), Kb(30), Kb(31) -}; - -#define rol_off(mf, j, off) \ - SPH_ROTL64(mf(((j) + (off)) & 15), (((j) + (off)) & 15) + 1) - -#define add_elt_b(mf, hf, j) \ - (SPH_T64(rol_off(mf, j, 0) + rol_off(mf, j, 3) \ - - rol_off(mf, j, 10) + Kb_tab[j]) ^ hf(((j) + 7) & 15)) - -#define expand1b(qf, mf, hf, i) \ - SPH_T64(sb1(qf((i) - 16)) + sb2(qf((i) - 15)) \ - + sb3(qf((i) - 14)) + sb0(qf((i) - 13)) \ - + sb1(qf((i) - 12)) + sb2(qf((i) - 11)) \ - + sb3(qf((i) - 10)) + sb0(qf((i) - 9)) \ - + sb1(qf((i) - 8)) + sb2(qf((i) - 7)) \ - + sb3(qf((i) - 6)) + sb0(qf((i) - 5)) \ - + sb1(qf((i) - 4)) + sb2(qf((i) - 3)) \ - + sb3(qf((i) - 2)) + sb0(qf((i) - 1)) \ - + add_elt_b(mf, hf, (i) - 16)) - -#define expand2b(qf, mf, hf, i) \ - SPH_T64(qf((i) - 16) + rb1(qf((i) - 15)) \ - + qf((i) - 14) + rb2(qf((i) - 13)) \ - + qf((i) - 12) + rb3(qf((i) - 11)) \ - + qf((i) - 10) + rb4(qf((i) - 9)) \ - + qf((i) - 8) + rb5(qf((i) - 7)) \ - + qf((i) - 6) + rb6(qf((i) - 5)) \ - + qf((i) - 4) + rb7(qf((i) - 3)) \ - + sb4(qf((i) - 2)) + sb5(qf((i) - 1)) \ - + add_elt_b(mf, hf, (i) - 16)) - -#else - -#define add_elt_b(mf, hf, j0m, j1m, j3m, j4m, j7m, j10m, j11m, j16) \ - (SPH_T64(SPH_ROTL64(mf(j0m), j1m) + SPH_ROTL64(mf(j3m), j4m) \ - - SPH_ROTL64(mf(j10m), j11m) + Kb(j16)) ^ hf(j7m)) - -#define expand1b_inner(qf, mf, hf, i16, \ - i0, i1, i2, i3, i4, i5, i6, i7, i8, \ - i9, i10, i11, i12, i13, i14, i15, \ - i0m, i1m, i3m, i4m, i7m, i10m, i11m) \ - SPH_T64(sb1(qf(i0)) + sb2(qf(i1)) + sb3(qf(i2)) + sb0(qf(i3)) \ - + sb1(qf(i4)) + sb2(qf(i5)) + sb3(qf(i6)) + sb0(qf(i7)) \ - + sb1(qf(i8)) + sb2(qf(i9)) + sb3(qf(i10)) + sb0(qf(i11)) \ - + sb1(qf(i12)) + sb2(qf(i13)) + sb3(qf(i14)) + sb0(qf(i15)) \ - + add_elt_b(mf, hf, i0m, i1m, i3m, i4m, i7m, i10m, i11m, i16)) - -#define expand1b(qf, mf, hf, i16) \ - expand1b_(qf, mf, hf, i16, I16_ ## i16, M16_ ## i16) -#define expand1b_(qf, mf, hf, i16, ix, iy) \ - expand1b_inner LPAR qf, mf, hf, i16, ix, iy) - -#define expand2b_inner(qf, mf, hf, i16, \ - i0, i1, i2, i3, i4, i5, i6, i7, i8, \ - i9, i10, i11, i12, i13, i14, i15, \ - i0m, i1m, i3m, i4m, i7m, i10m, i11m) \ - SPH_T64(qf(i0) + rb1(qf(i1)) + qf(i2) + rb2(qf(i3)) \ - + qf(i4) + rb3(qf(i5)) + qf(i6) + rb4(qf(i7)) \ - + qf(i8) + rb5(qf(i9)) + qf(i10) + rb6(qf(i11)) \ - + qf(i12) + rb7(qf(i13)) + sb4(qf(i14)) + sb5(qf(i15)) \ - + add_elt_b(mf, hf, i0m, i1m, i3m, i4m, i7m, i10m, i11m, i16)) - -#define expand2b(qf, mf, hf, i16) \ - expand2b_(qf, mf, hf, i16, I16_ ## i16, M16_ ## i16) -#define expand2b_(qf, mf, hf, i16, ix, iy) \ - expand2b_inner LPAR qf, mf, hf, i16, ix, iy) - -#endif - -#endif - -#define MAKE_W(tt, i0, op01, i1, op12, i2, op23, i3, op34, i4) \ - tt((M(i0) ^ H(i0)) op01 (M(i1) ^ H(i1)) op12 (M(i2) ^ H(i2)) \ - op23 (M(i3) ^ H(i3)) op34 (M(i4) ^ H(i4))) - -#define Ws0 MAKE_W(SPH_T32, 5, -, 7, +, 10, +, 13, +, 14) -#define Ws1 MAKE_W(SPH_T32, 6, -, 8, +, 11, +, 14, -, 15) -#define Ws2 MAKE_W(SPH_T32, 0, +, 7, +, 9, -, 12, +, 15) -#define Ws3 MAKE_W(SPH_T32, 0, -, 1, +, 8, -, 10, +, 13) -#define Ws4 MAKE_W(SPH_T32, 1, +, 2, +, 9, -, 11, -, 14) -#define Ws5 MAKE_W(SPH_T32, 3, -, 2, +, 10, -, 12, +, 15) -#define Ws6 MAKE_W(SPH_T32, 4, -, 0, -, 3, -, 11, +, 13) -#define Ws7 MAKE_W(SPH_T32, 1, -, 4, -, 5, -, 12, -, 14) -#define Ws8 MAKE_W(SPH_T32, 2, -, 5, -, 6, +, 13, -, 15) -#define Ws9 MAKE_W(SPH_T32, 0, -, 3, +, 6, -, 7, +, 14) -#define Ws10 MAKE_W(SPH_T32, 8, -, 1, -, 4, -, 7, +, 15) -#define Ws11 MAKE_W(SPH_T32, 8, -, 0, -, 2, -, 5, +, 9) -#define Ws12 MAKE_W(SPH_T32, 1, +, 3, -, 6, -, 9, +, 10) -#define Ws13 MAKE_W(SPH_T32, 2, +, 4, +, 7, +, 10, +, 11) -#define Ws14 MAKE_W(SPH_T32, 3, -, 5, +, 8, -, 11, -, 12) -#define Ws15 MAKE_W(SPH_T32, 12, -, 4, -, 6, -, 9, +, 13) - -#if SPH_SMALL_FOOTPRINT_BMW - -#define MAKE_Qas do { \ - unsigned u; \ - sph_u32 Ws[16]; \ - Ws[ 0] = Ws0; \ - Ws[ 1] = Ws1; \ - Ws[ 2] = Ws2; \ - Ws[ 3] = Ws3; \ - Ws[ 4] = Ws4; \ - Ws[ 5] = Ws5; \ - Ws[ 6] = Ws6; \ - Ws[ 7] = Ws7; \ - Ws[ 8] = Ws8; \ - Ws[ 9] = Ws9; \ - Ws[10] = Ws10; \ - Ws[11] = Ws11; \ - Ws[12] = Ws12; \ - Ws[13] = Ws13; \ - Ws[14] = Ws14; \ - Ws[15] = Ws15; \ - for (u = 0; u < 15; u += 5) { \ - qt[u + 0] = SPH_T32(ss0(Ws[u + 0]) + H(u + 1)); \ - qt[u + 1] = SPH_T32(ss1(Ws[u + 1]) + H(u + 2)); \ - qt[u + 2] = SPH_T32(ss2(Ws[u + 2]) + H(u + 3)); \ - qt[u + 3] = SPH_T32(ss3(Ws[u + 3]) + H(u + 4)); \ - qt[u + 4] = SPH_T32(ss4(Ws[u + 4]) + H(u + 5)); \ - } \ - qt[15] = SPH_T32(ss0(Ws[15]) + H(0)); \ - } while (0) - -#define MAKE_Qbs do { \ - qt[16] = expand1s(Qs, M, H, 16); \ - qt[17] = expand1s(Qs, M, H, 17); \ - qt[18] = expand2s(Qs, M, H, 18); \ - qt[19] = expand2s(Qs, M, H, 19); \ - qt[20] = expand2s(Qs, M, H, 20); \ - qt[21] = expand2s(Qs, M, H, 21); \ - qt[22] = expand2s(Qs, M, H, 22); \ - qt[23] = expand2s(Qs, M, H, 23); \ - qt[24] = expand2s(Qs, M, H, 24); \ - qt[25] = expand2s(Qs, M, H, 25); \ - qt[26] = expand2s(Qs, M, H, 26); \ - qt[27] = expand2s(Qs, M, H, 27); \ - qt[28] = expand2s(Qs, M, H, 28); \ - qt[29] = expand2s(Qs, M, H, 29); \ - qt[30] = expand2s(Qs, M, H, 30); \ - qt[31] = expand2s(Qs, M, H, 31); \ - } while (0) - -#else - -#define MAKE_Qas do { \ - qt[ 0] = SPH_T32(ss0(Ws0 ) + H( 1)); \ - qt[ 1] = SPH_T32(ss1(Ws1 ) + H( 2)); \ - qt[ 2] = SPH_T32(ss2(Ws2 ) + H( 3)); \ - qt[ 3] = SPH_T32(ss3(Ws3 ) + H( 4)); \ - qt[ 4] = SPH_T32(ss4(Ws4 ) + H( 5)); \ - qt[ 5] = SPH_T32(ss0(Ws5 ) + H( 6)); \ - qt[ 6] = SPH_T32(ss1(Ws6 ) + H( 7)); \ - qt[ 7] = SPH_T32(ss2(Ws7 ) + H( 8)); \ - qt[ 8] = SPH_T32(ss3(Ws8 ) + H( 9)); \ - qt[ 9] = SPH_T32(ss4(Ws9 ) + H(10)); \ - qt[10] = SPH_T32(ss0(Ws10) + H(11)); \ - qt[11] = SPH_T32(ss1(Ws11) + H(12)); \ - qt[12] = SPH_T32(ss2(Ws12) + H(13)); \ - qt[13] = SPH_T32(ss3(Ws13) + H(14)); \ - qt[14] = SPH_T32(ss4(Ws14) + H(15)); \ - qt[15] = SPH_T32(ss0(Ws15) + H( 0)); \ - } while (0) - -#define MAKE_Qbs do { \ - qt[16] = expand1s(Qs, M, H, 16); \ - qt[17] = expand1s(Qs, M, H, 17); \ - qt[18] = expand2s(Qs, M, H, 18); \ - qt[19] = expand2s(Qs, M, H, 19); \ - qt[20] = expand2s(Qs, M, H, 20); \ - qt[21] = expand2s(Qs, M, H, 21); \ - qt[22] = expand2s(Qs, M, H, 22); \ - qt[23] = expand2s(Qs, M, H, 23); \ - qt[24] = expand2s(Qs, M, H, 24); \ - qt[25] = expand2s(Qs, M, H, 25); \ - qt[26] = expand2s(Qs, M, H, 26); \ - qt[27] = expand2s(Qs, M, H, 27); \ - qt[28] = expand2s(Qs, M, H, 28); \ - qt[29] = expand2s(Qs, M, H, 29); \ - qt[30] = expand2s(Qs, M, H, 30); \ - qt[31] = expand2s(Qs, M, H, 31); \ - } while (0) - -#endif - -#define MAKE_Qs do { \ - MAKE_Qas; \ - MAKE_Qbs; \ - } while (0) - -#define Qs(j) (qt[j]) - -#if SPH_64 - -#define Wb0 MAKE_W(SPH_T64, 5, -, 7, +, 10, +, 13, +, 14) -#define Wb1 MAKE_W(SPH_T64, 6, -, 8, +, 11, +, 14, -, 15) -#define Wb2 MAKE_W(SPH_T64, 0, +, 7, +, 9, -, 12, +, 15) -#define Wb3 MAKE_W(SPH_T64, 0, -, 1, +, 8, -, 10, +, 13) -#define Wb4 MAKE_W(SPH_T64, 1, +, 2, +, 9, -, 11, -, 14) -#define Wb5 MAKE_W(SPH_T64, 3, -, 2, +, 10, -, 12, +, 15) -#define Wb6 MAKE_W(SPH_T64, 4, -, 0, -, 3, -, 11, +, 13) -#define Wb7 MAKE_W(SPH_T64, 1, -, 4, -, 5, -, 12, -, 14) -#define Wb8 MAKE_W(SPH_T64, 2, -, 5, -, 6, +, 13, -, 15) -#define Wb9 MAKE_W(SPH_T64, 0, -, 3, +, 6, -, 7, +, 14) -#define Wb10 MAKE_W(SPH_T64, 8, -, 1, -, 4, -, 7, +, 15) -#define Wb11 MAKE_W(SPH_T64, 8, -, 0, -, 2, -, 5, +, 9) -#define Wb12 MAKE_W(SPH_T64, 1, +, 3, -, 6, -, 9, +, 10) -#define Wb13 MAKE_W(SPH_T64, 2, +, 4, +, 7, +, 10, +, 11) -#define Wb14 MAKE_W(SPH_T64, 3, -, 5, +, 8, -, 11, -, 12) -#define Wb15 MAKE_W(SPH_T64, 12, -, 4, -, 6, -, 9, +, 13) - -#if SPH_SMALL_FOOTPRINT_BMW - -#define MAKE_Qab do { \ - unsigned u; \ - sph_u64 Wb[16]; \ - Wb[ 0] = Wb0; \ - Wb[ 1] = Wb1; \ - Wb[ 2] = Wb2; \ - Wb[ 3] = Wb3; \ - Wb[ 4] = Wb4; \ - Wb[ 5] = Wb5; \ - Wb[ 6] = Wb6; \ - Wb[ 7] = Wb7; \ - Wb[ 8] = Wb8; \ - Wb[ 9] = Wb9; \ - Wb[10] = Wb10; \ - Wb[11] = Wb11; \ - Wb[12] = Wb12; \ - Wb[13] = Wb13; \ - Wb[14] = Wb14; \ - Wb[15] = Wb15; \ - for (u = 0; u < 15; u += 5) { \ - qt[u + 0] = SPH_T64(sb0(Wb[u + 0]) + H(u + 1)); \ - qt[u + 1] = SPH_T64(sb1(Wb[u + 1]) + H(u + 2)); \ - qt[u + 2] = SPH_T64(sb2(Wb[u + 2]) + H(u + 3)); \ - qt[u + 3] = SPH_T64(sb3(Wb[u + 3]) + H(u + 4)); \ - qt[u + 4] = SPH_T64(sb4(Wb[u + 4]) + H(u + 5)); \ - } \ - qt[15] = SPH_T64(sb0(Wb[15]) + H(0)); \ - } while (0) - -#define MAKE_Qbb do { \ - unsigned u; \ - for (u = 16; u < 18; u ++) \ - qt[u] = expand1b(Qb, M, H, u); \ - for (u = 18; u < 32; u ++) \ - qt[u] = expand2b(Qb, M, H, u); \ - } while (0) - -#else - -#define MAKE_Qab do { \ - qt[ 0] = SPH_T64(sb0(Wb0 ) + H( 1)); \ - qt[ 1] = SPH_T64(sb1(Wb1 ) + H( 2)); \ - qt[ 2] = SPH_T64(sb2(Wb2 ) + H( 3)); \ - qt[ 3] = SPH_T64(sb3(Wb3 ) + H( 4)); \ - qt[ 4] = SPH_T64(sb4(Wb4 ) + H( 5)); \ - qt[ 5] = SPH_T64(sb0(Wb5 ) + H( 6)); \ - qt[ 6] = SPH_T64(sb1(Wb6 ) + H( 7)); \ - qt[ 7] = SPH_T64(sb2(Wb7 ) + H( 8)); \ - qt[ 8] = SPH_T64(sb3(Wb8 ) + H( 9)); \ - qt[ 9] = SPH_T64(sb4(Wb9 ) + H(10)); \ - qt[10] = SPH_T64(sb0(Wb10) + H(11)); \ - qt[11] = SPH_T64(sb1(Wb11) + H(12)); \ - qt[12] = SPH_T64(sb2(Wb12) + H(13)); \ - qt[13] = SPH_T64(sb3(Wb13) + H(14)); \ - qt[14] = SPH_T64(sb4(Wb14) + H(15)); \ - qt[15] = SPH_T64(sb0(Wb15) + H( 0)); \ - } while (0) - -#define MAKE_Qbb do { \ - qt[16] = expand1b(Qb, M, H, 16); \ - qt[17] = expand1b(Qb, M, H, 17); \ - qt[18] = expand2b(Qb, M, H, 18); \ - qt[19] = expand2b(Qb, M, H, 19); \ - qt[20] = expand2b(Qb, M, H, 20); \ - qt[21] = expand2b(Qb, M, H, 21); \ - qt[22] = expand2b(Qb, M, H, 22); \ - qt[23] = expand2b(Qb, M, H, 23); \ - qt[24] = expand2b(Qb, M, H, 24); \ - qt[25] = expand2b(Qb, M, H, 25); \ - qt[26] = expand2b(Qb, M, H, 26); \ - qt[27] = expand2b(Qb, M, H, 27); \ - qt[28] = expand2b(Qb, M, H, 28); \ - qt[29] = expand2b(Qb, M, H, 29); \ - qt[30] = expand2b(Qb, M, H, 30); \ - qt[31] = expand2b(Qb, M, H, 31); \ - } while (0) - -#endif - -#define MAKE_Qb do { \ - MAKE_Qab; \ - MAKE_Qbb; \ - } while (0) - -#define Qb(j) (qt[j]) - -#endif - -#define FOLD(type, mkQ, tt, rol, mf, qf, dhf) do { \ - type qt[32], xl, xh; \ - mkQ; \ - xl = qf(16) ^ qf(17) ^ qf(18) ^ qf(19) \ - ^ qf(20) ^ qf(21) ^ qf(22) ^ qf(23); \ - xh = xl ^ qf(24) ^ qf(25) ^ qf(26) ^ qf(27) \ - ^ qf(28) ^ qf(29) ^ qf(30) ^ qf(31); \ - dhf( 0) = tt(((xh << 5) ^ (qf(16) >> 5) ^ mf( 0)) \ - + (xl ^ qf(24) ^ qf( 0))); \ - dhf( 1) = tt(((xh >> 7) ^ (qf(17) << 8) ^ mf( 1)) \ - + (xl ^ qf(25) ^ qf( 1))); \ - dhf( 2) = tt(((xh >> 5) ^ (qf(18) << 5) ^ mf( 2)) \ - + (xl ^ qf(26) ^ qf( 2))); \ - dhf( 3) = tt(((xh >> 1) ^ (qf(19) << 5) ^ mf( 3)) \ - + (xl ^ qf(27) ^ qf( 3))); \ - dhf( 4) = tt(((xh >> 3) ^ (qf(20) << 0) ^ mf( 4)) \ - + (xl ^ qf(28) ^ qf( 4))); \ - dhf( 5) = tt(((xh << 6) ^ (qf(21) >> 6) ^ mf( 5)) \ - + (xl ^ qf(29) ^ qf( 5))); \ - dhf( 6) = tt(((xh >> 4) ^ (qf(22) << 6) ^ mf( 6)) \ - + (xl ^ qf(30) ^ qf( 6))); \ - dhf( 7) = tt(((xh >> 11) ^ (qf(23) << 2) ^ mf( 7)) \ - + (xl ^ qf(31) ^ qf( 7))); \ - dhf( 8) = tt(rol(dhf(4), 9) + (xh ^ qf(24) ^ mf( 8)) \ - + ((xl << 8) ^ qf(23) ^ qf( 8))); \ - dhf( 9) = tt(rol(dhf(5), 10) + (xh ^ qf(25) ^ mf( 9)) \ - + ((xl >> 6) ^ qf(16) ^ qf( 9))); \ - dhf(10) = tt(rol(dhf(6), 11) + (xh ^ qf(26) ^ mf(10)) \ - + ((xl << 6) ^ qf(17) ^ qf(10))); \ - dhf(11) = tt(rol(dhf(7), 12) + (xh ^ qf(27) ^ mf(11)) \ - + ((xl << 4) ^ qf(18) ^ qf(11))); \ - dhf(12) = tt(rol(dhf(0), 13) + (xh ^ qf(28) ^ mf(12)) \ - + ((xl >> 3) ^ qf(19) ^ qf(12))); \ - dhf(13) = tt(rol(dhf(1), 14) + (xh ^ qf(29) ^ mf(13)) \ - + ((xl >> 4) ^ qf(20) ^ qf(13))); \ - dhf(14) = tt(rol(dhf(2), 15) + (xh ^ qf(30) ^ mf(14)) \ - + ((xl >> 7) ^ qf(21) ^ qf(14))); \ - dhf(15) = tt(rol(dhf(3), 16) + (xh ^ qf(31) ^ mf(15)) \ - + ((xl >> 2) ^ qf(22) ^ qf(15))); \ - } while (0) - -#define FOLDs FOLD(sph_u32, MAKE_Qs, SPH_T32, SPH_ROTL32, M, Qs, dH) - -#if SPH_64 - -#define FOLDb FOLD(sph_u64, MAKE_Qb, SPH_T64, SPH_ROTL64, M, Qb, dH) - -#endif - -static void -compress_small(const unsigned char *data, const sph_u32 h[16], sph_u32 dh[16]) -{ -#if SPH_LITTLE_FAST -#define M(x) sph_dec32le_aligned(data + 4 * (x)) -#else - sph_u32 mv[16]; - - mv[ 0] = sph_dec32le_aligned(data + 0); - mv[ 1] = sph_dec32le_aligned(data + 4); - mv[ 2] = sph_dec32le_aligned(data + 8); - mv[ 3] = sph_dec32le_aligned(data + 12); - mv[ 4] = sph_dec32le_aligned(data + 16); - mv[ 5] = sph_dec32le_aligned(data + 20); - mv[ 6] = sph_dec32le_aligned(data + 24); - mv[ 7] = sph_dec32le_aligned(data + 28); - mv[ 8] = sph_dec32le_aligned(data + 32); - mv[ 9] = sph_dec32le_aligned(data + 36); - mv[10] = sph_dec32le_aligned(data + 40); - mv[11] = sph_dec32le_aligned(data + 44); - mv[12] = sph_dec32le_aligned(data + 48); - mv[13] = sph_dec32le_aligned(data + 52); - mv[14] = sph_dec32le_aligned(data + 56); - mv[15] = sph_dec32le_aligned(data + 60); -#define M(x) (mv[x]) -#endif -#define H(x) (h[x]) -#define dH(x) (dh[x]) - - FOLDs; - -#undef M -#undef H -#undef dH -} - -static const sph_u32 final_s[16] = { - SPH_C32(0xaaaaaaa0), SPH_C32(0xaaaaaaa1), SPH_C32(0xaaaaaaa2), - SPH_C32(0xaaaaaaa3), SPH_C32(0xaaaaaaa4), SPH_C32(0xaaaaaaa5), - SPH_C32(0xaaaaaaa6), SPH_C32(0xaaaaaaa7), SPH_C32(0xaaaaaaa8), - SPH_C32(0xaaaaaaa9), SPH_C32(0xaaaaaaaa), SPH_C32(0xaaaaaaab), - SPH_C32(0xaaaaaaac), SPH_C32(0xaaaaaaad), SPH_C32(0xaaaaaaae), - SPH_C32(0xaaaaaaaf) -}; - -static void -bmw32_init(sph_bmw_small_context *sc, const sph_u32 *iv) -{ - memcpy(sc->H, iv, sizeof sc->H); - sc->ptr = 0; -#if SPH_64 - sc->bit_count = 0; -#else - sc->bit_count_high = 0; - sc->bit_count_low = 0; -#endif -} - -static void -bmw32(sph_bmw_small_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - sph_u32 htmp[16]; - sph_u32 *h1, *h2; -#if !SPH_64 - sph_u32 tmp; -#endif - -#if SPH_64 - sc->bit_count += (sph_u64)len << 3; -#else - tmp = sc->bit_count_low; - sc->bit_count_low = SPH_T32(tmp + ((sph_u32)len << 3)); - if (sc->bit_count_low < tmp) - sc->bit_count_high ++; - sc->bit_count_high += len >> 29; -#endif - buf = sc->buf; - ptr = sc->ptr; - h1 = sc->H; - h2 = htmp; - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - data = (const unsigned char *)data + clen; - len -= clen; - ptr += clen; - if (ptr == sizeof sc->buf) { - sph_u32 *ht; - - compress_small(buf, h1, h2); - ht = h1; - h1 = h2; - h2 = ht; - ptr = 0; - } - } - sc->ptr = ptr; - if (h1 != sc->H) - memcpy(sc->H, h1, sizeof sc->H); -} - -static void -bmw32_close(sph_bmw_small_context *sc, unsigned ub, unsigned n, - void *dst, size_t out_size_w32) -{ - unsigned char *buf, *out; - size_t ptr, u, v; - unsigned z; - sph_u32 h1[16], h2[16], *h; - - buf = sc->buf; - ptr = sc->ptr; - z = 0x80 >> n; - buf[ptr ++] = ((ub & -z) | z) & 0xFF; - h = sc->H; - if (ptr > (sizeof sc->buf) - 8) { - memset(buf + ptr, 0, (sizeof sc->buf) - ptr); - compress_small(buf, h, h1); - ptr = 0; - h = h1; - } - memset(buf + ptr, 0, (sizeof sc->buf) - 8 - ptr); -#if SPH_64 - sph_enc64le_aligned(buf + (sizeof sc->buf) - 8, - SPH_T64(sc->bit_count + n)); -#else - sph_enc32le_aligned(buf + (sizeof sc->buf) - 8, - sc->bit_count_low + n); - sph_enc32le_aligned(buf + (sizeof sc->buf) - 4, - SPH_T32(sc->bit_count_high)); -#endif - compress_small(buf, h, h2); - for (u = 0; u < 16; u ++) - sph_enc32le_aligned(buf + 4 * u, h2[u]); - compress_small(buf, final_s, h1); - out = dst; - for (u = 0, v = 16 - out_size_w32; u < out_size_w32; u ++, v ++) - sph_enc32le(out + 4 * u, h1[v]); -} - -#if SPH_64 - -static void -compress_big(const unsigned char *data, const sph_u64 h[16], sph_u64 dh[16]) -{ -#if SPH_LITTLE_FAST -#define M(x) sph_dec64le_aligned(data + 8 * (x)) -#else - sph_u64 mv[16]; - - mv[ 0] = sph_dec64le_aligned(data + 0); - mv[ 1] = sph_dec64le_aligned(data + 8); - mv[ 2] = sph_dec64le_aligned(data + 16); - mv[ 3] = sph_dec64le_aligned(data + 24); - mv[ 4] = sph_dec64le_aligned(data + 32); - mv[ 5] = sph_dec64le_aligned(data + 40); - mv[ 6] = sph_dec64le_aligned(data + 48); - mv[ 7] = sph_dec64le_aligned(data + 56); - mv[ 8] = sph_dec64le_aligned(data + 64); - mv[ 9] = sph_dec64le_aligned(data + 72); - mv[10] = sph_dec64le_aligned(data + 80); - mv[11] = sph_dec64le_aligned(data + 88); - mv[12] = sph_dec64le_aligned(data + 96); - mv[13] = sph_dec64le_aligned(data + 104); - mv[14] = sph_dec64le_aligned(data + 112); - mv[15] = sph_dec64le_aligned(data + 120); -#define M(x) (mv[x]) -#endif -#define H(x) (h[x]) -#define dH(x) (dh[x]) - - FOLDb; - -#undef M -#undef H -#undef dH -} - -static const sph_u64 final_b[16] = { - SPH_C64(0xaaaaaaaaaaaaaaa0), SPH_C64(0xaaaaaaaaaaaaaaa1), - SPH_C64(0xaaaaaaaaaaaaaaa2), SPH_C64(0xaaaaaaaaaaaaaaa3), - SPH_C64(0xaaaaaaaaaaaaaaa4), SPH_C64(0xaaaaaaaaaaaaaaa5), - SPH_C64(0xaaaaaaaaaaaaaaa6), SPH_C64(0xaaaaaaaaaaaaaaa7), - SPH_C64(0xaaaaaaaaaaaaaaa8), SPH_C64(0xaaaaaaaaaaaaaaa9), - SPH_C64(0xaaaaaaaaaaaaaaaa), SPH_C64(0xaaaaaaaaaaaaaaab), - SPH_C64(0xaaaaaaaaaaaaaaac), SPH_C64(0xaaaaaaaaaaaaaaad), - SPH_C64(0xaaaaaaaaaaaaaaae), SPH_C64(0xaaaaaaaaaaaaaaaf) -}; - -static void -bmw64_init(sph_bmw_big_context *sc, const sph_u64 *iv) -{ - memcpy(sc->H, iv, sizeof sc->H); - sc->ptr = 0; - sc->bit_count = 0; -} - -static void -bmw64(sph_bmw_big_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - sph_u64 htmp[16]; - sph_u64 *h1, *h2; - - sc->bit_count += (sph_u64)len << 3; - buf = sc->buf; - ptr = sc->ptr; - h1 = sc->H; - h2 = htmp; - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - data = (const unsigned char *)data + clen; - len -= clen; - ptr += clen; - if (ptr == sizeof sc->buf) { - sph_u64 *ht; - - compress_big(buf, h1, h2); - ht = h1; - h1 = h2; - h2 = ht; - ptr = 0; - } - } - sc->ptr = ptr; - if (h1 != sc->H) - memcpy(sc->H, h1, sizeof sc->H); -} - -static void -bmw64_close(sph_bmw_big_context *sc, unsigned ub, unsigned n, - void *dst, size_t out_size_w64) -{ - unsigned char *buf, *out; - size_t ptr, u, v; - unsigned z; - sph_u64 h1[16], h2[16], *h; - - buf = sc->buf; - ptr = sc->ptr; - z = 0x80 >> n; - buf[ptr ++] = ((ub & -z) | z) & 0xFF; - h = sc->H; - if (ptr > (sizeof sc->buf) - 8) { - memset(buf + ptr, 0, (sizeof sc->buf) - ptr); - compress_big(buf, h, h1); - ptr = 0; - h = h1; - } - memset(buf + ptr, 0, (sizeof sc->buf) - 8 - ptr); - sph_enc64le_aligned(buf + (sizeof sc->buf) - 8, - SPH_T64(sc->bit_count + n)); - compress_big(buf, h, h2); - for (u = 0; u < 16; u ++) - sph_enc64le_aligned(buf + 8 * u, h2[u]); - compress_big(buf, final_b, h1); - out = dst; - for (u = 0, v = 16 - out_size_w64; u < out_size_w64; u ++, v ++) - sph_enc64le(out + 8 * u, h1[v]); -} - -#endif - -/* see sph_bmw.h */ -void -sph_bmw224_init(void *cc) -{ - bmw32_init(cc, IV224); -} - -/* see sph_bmw.h */ -void -sph_bmw224(void *cc, const void *data, size_t len) -{ - bmw32(cc, data, len); -} - -/* see sph_bmw.h */ -void -sph_bmw224_close(void *cc, void *dst) -{ - sph_bmw224_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_bmw.h */ -void -sph_bmw224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - bmw32_close(cc, ub, n, dst, 7); - sph_bmw224_init(cc); -} - -/* see sph_bmw.h */ -void -sph_bmw256_init(void *cc) -{ - bmw32_init(cc, IV256); -} - -/* see sph_bmw.h */ -void -sph_bmw256(void *cc, const void *data, size_t len) -{ - bmw32(cc, data, len); -} - -/* see sph_bmw.h */ -void -sph_bmw256_close(void *cc, void *dst) -{ - sph_bmw256_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_bmw.h */ -void -sph_bmw256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - bmw32_close(cc, ub, n, dst, 8); - sph_bmw256_init(cc); -} - -#if SPH_64 - -/* see sph_bmw.h */ -void -sph_bmw384_init(void *cc) -{ - bmw64_init(cc, IV384); -} - -/* see sph_bmw.h */ -void -sph_bmw384(void *cc, const void *data, size_t len) -{ - bmw64(cc, data, len); -} - -/* see sph_bmw.h */ -void -sph_bmw384_close(void *cc, void *dst) -{ - sph_bmw384_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_bmw.h */ -void -sph_bmw384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - bmw64_close(cc, ub, n, dst, 6); - sph_bmw384_init(cc); -} - -/* see sph_bmw.h */ -void -sph_bmw512_init(void *cc) -{ - bmw64_init(cc, IV512); -} - -/* see sph_bmw.h */ -void -sph_bmw512(void *cc, const void *data, size_t len) -{ - bmw64(cc, data, len); -} - -/* see sph_bmw.h */ -void -sph_bmw512_close(void *cc, void *dst) -{ - sph_bmw512_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_bmw.h */ -void -sph_bmw512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - bmw64_close(cc, ub, n, dst, 8); - sph_bmw512_init(cc); -} - -#endif diff --git a/sph/cubehash.c b/sph/cubehash.c deleted file mode 100644 index 9322fe14..00000000 --- a/sph/cubehash.c +++ /dev/null @@ -1,723 +0,0 @@ -/* $Id: cubehash.c 227 2010-06-16 17:28:38Z tp $ */ -/* - * CubeHash implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include -#include - -#include "sph_cubehash.h" -#ifdef __cplusplus -extern "C"{ -#endif - -#if SPH_SMALL_FOOTPRINT && !defined SPH_SMALL_FOOTPRINT_CUBEHASH -#define SPH_SMALL_FOOTPRINT_CUBEHASH 1 -#endif - -/* - * Some tests were conducted on an Intel Core2 Q6600 (32-bit and 64-bit - * mode), a PowerPC G3, and a MIPS-compatible CPU (Broadcom BCM3302). - * It appears that the optimal settings are: - * -- full unroll, no state copy on the "big" systems (x86, PowerPC) - * -- unroll to 4 or 8, state copy on the "small" system (MIPS) - */ - -#if SPH_SMALL_FOOTPRINT_CUBEHASH - -#if !defined SPH_CUBEHASH_UNROLL -#define SPH_CUBEHASH_UNROLL 4 -#endif -#if !defined SPH_CUBEHASH_NOCOPY -#define SPH_CUBEHASH_NOCOPY 1 -#endif - -#else - -#if !defined SPH_CUBEHASH_UNROLL -#define SPH_CUBEHASH_UNROLL 0 -#endif -#if !defined SPH_CUBEHASH_NOCOPY -#define SPH_CUBEHASH_NOCOPY 0 -#endif - -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -static const sph_u32 IV224[] = { - SPH_C32(0xB0FC8217), SPH_C32(0x1BEE1A90), SPH_C32(0x829E1A22), - SPH_C32(0x6362C342), SPH_C32(0x24D91C30), SPH_C32(0x03A7AA24), - SPH_C32(0xA63721C8), SPH_C32(0x85B0E2EF), SPH_C32(0xF35D13F3), - SPH_C32(0x41DA807D), SPH_C32(0x21A70CA6), SPH_C32(0x1F4E9774), - SPH_C32(0xB3E1C932), SPH_C32(0xEB0A79A8), SPH_C32(0xCDDAAA66), - SPH_C32(0xE2F6ECAA), SPH_C32(0x0A713362), SPH_C32(0xAA3080E0), - SPH_C32(0xD8F23A32), SPH_C32(0xCEF15E28), SPH_C32(0xDB086314), - SPH_C32(0x7F709DF7), SPH_C32(0xACD228A4), SPH_C32(0x704D6ECE), - SPH_C32(0xAA3EC95F), SPH_C32(0xE387C214), SPH_C32(0x3A6445FF), - SPH_C32(0x9CAB81C3), SPH_C32(0xC73D4B98), SPH_C32(0xD277AEBE), - SPH_C32(0xFD20151C), SPH_C32(0x00CB573E) -}; - -static const sph_u32 IV256[] = { - SPH_C32(0xEA2BD4B4), SPH_C32(0xCCD6F29F), SPH_C32(0x63117E71), - SPH_C32(0x35481EAE), SPH_C32(0x22512D5B), SPH_C32(0xE5D94E63), - SPH_C32(0x7E624131), SPH_C32(0xF4CC12BE), SPH_C32(0xC2D0B696), - SPH_C32(0x42AF2070), SPH_C32(0xD0720C35), SPH_C32(0x3361DA8C), - SPH_C32(0x28CCECA4), SPH_C32(0x8EF8AD83), SPH_C32(0x4680AC00), - SPH_C32(0x40E5FBAB), SPH_C32(0xD89041C3), SPH_C32(0x6107FBD5), - SPH_C32(0x6C859D41), SPH_C32(0xF0B26679), SPH_C32(0x09392549), - SPH_C32(0x5FA25603), SPH_C32(0x65C892FD), SPH_C32(0x93CB6285), - SPH_C32(0x2AF2B5AE), SPH_C32(0x9E4B4E60), SPH_C32(0x774ABFDD), - SPH_C32(0x85254725), SPH_C32(0x15815AEB), SPH_C32(0x4AB6AAD6), - SPH_C32(0x9CDAF8AF), SPH_C32(0xD6032C0A) -}; - -static const sph_u32 IV384[] = { - SPH_C32(0xE623087E), SPH_C32(0x04C00C87), SPH_C32(0x5EF46453), - SPH_C32(0x69524B13), SPH_C32(0x1A05C7A9), SPH_C32(0x3528DF88), - SPH_C32(0x6BDD01B5), SPH_C32(0x5057B792), SPH_C32(0x6AA7A922), - SPH_C32(0x649C7EEE), SPH_C32(0xF426309F), SPH_C32(0xCB629052), - SPH_C32(0xFC8E20ED), SPH_C32(0xB3482BAB), SPH_C32(0xF89E5E7E), - SPH_C32(0xD83D4DE4), SPH_C32(0x44BFC10D), SPH_C32(0x5FC1E63D), - SPH_C32(0x2104E6CB), SPH_C32(0x17958F7F), SPH_C32(0xDBEAEF70), - SPH_C32(0xB4B97E1E), SPH_C32(0x32C195F6), SPH_C32(0x6184A8E4), - SPH_C32(0x796C2543), SPH_C32(0x23DE176D), SPH_C32(0xD33BBAEC), - SPH_C32(0x0C12E5D2), SPH_C32(0x4EB95A7B), SPH_C32(0x2D18BA01), - SPH_C32(0x04EE475F), SPH_C32(0x1FC5F22E) -}; - -static const sph_u32 IV512[] = { - SPH_C32(0x2AEA2A61), SPH_C32(0x50F494D4), SPH_C32(0x2D538B8B), - SPH_C32(0x4167D83E), SPH_C32(0x3FEE2313), SPH_C32(0xC701CF8C), - SPH_C32(0xCC39968E), SPH_C32(0x50AC5695), SPH_C32(0x4D42C787), - SPH_C32(0xA647A8B3), SPH_C32(0x97CF0BEF), SPH_C32(0x825B4537), - SPH_C32(0xEEF864D2), SPH_C32(0xF22090C4), SPH_C32(0xD0E5CD33), - SPH_C32(0xA23911AE), SPH_C32(0xFCD398D9), SPH_C32(0x148FE485), - SPH_C32(0x1B017BEF), SPH_C32(0xB6444532), SPH_C32(0x6A536159), - SPH_C32(0x2FF5781C), SPH_C32(0x91FA7934), SPH_C32(0x0DBADEA9), - SPH_C32(0xD65C8A2B), SPH_C32(0xA5A70E75), SPH_C32(0xB1C62456), - SPH_C32(0xBC796576), SPH_C32(0x1921C8F7), SPH_C32(0xE7989AF1), - SPH_C32(0x7795D246), SPH_C32(0xD43E3B44) -}; - -#define T32 SPH_T32 -#define ROTL32 SPH_ROTL32 - -#if SPH_CUBEHASH_NOCOPY - -#define DECL_STATE -#define READ_STATE(cc) -#define WRITE_STATE(cc) - -#define x0 ((sc)->state[ 0]) -#define x1 ((sc)->state[ 1]) -#define x2 ((sc)->state[ 2]) -#define x3 ((sc)->state[ 3]) -#define x4 ((sc)->state[ 4]) -#define x5 ((sc)->state[ 5]) -#define x6 ((sc)->state[ 6]) -#define x7 ((sc)->state[ 7]) -#define x8 ((sc)->state[ 8]) -#define x9 ((sc)->state[ 9]) -#define xa ((sc)->state[10]) -#define xb ((sc)->state[11]) -#define xc ((sc)->state[12]) -#define xd ((sc)->state[13]) -#define xe ((sc)->state[14]) -#define xf ((sc)->state[15]) -#define xg ((sc)->state[16]) -#define xh ((sc)->state[17]) -#define xi ((sc)->state[18]) -#define xj ((sc)->state[19]) -#define xk ((sc)->state[20]) -#define xl ((sc)->state[21]) -#define xm ((sc)->state[22]) -#define xn ((sc)->state[23]) -#define xo ((sc)->state[24]) -#define xp ((sc)->state[25]) -#define xq ((sc)->state[26]) -#define xr ((sc)->state[27]) -#define xs ((sc)->state[28]) -#define xt ((sc)->state[29]) -#define xu ((sc)->state[30]) -#define xv ((sc)->state[31]) - -#else - -#define DECL_STATE \ - sph_u32 x0, x1, x2, x3, x4, x5, x6, x7; \ - sph_u32 x8, x9, xa, xb, xc, xd, xe, xf; \ - sph_u32 xg, xh, xi, xj, xk, xl, xm, xn; \ - sph_u32 xo, xp, xq, xr, xs, xt, xu, xv; - -#define READ_STATE(cc) do { \ - x0 = (cc)->state[ 0]; \ - x1 = (cc)->state[ 1]; \ - x2 = (cc)->state[ 2]; \ - x3 = (cc)->state[ 3]; \ - x4 = (cc)->state[ 4]; \ - x5 = (cc)->state[ 5]; \ - x6 = (cc)->state[ 6]; \ - x7 = (cc)->state[ 7]; \ - x8 = (cc)->state[ 8]; \ - x9 = (cc)->state[ 9]; \ - xa = (cc)->state[10]; \ - xb = (cc)->state[11]; \ - xc = (cc)->state[12]; \ - xd = (cc)->state[13]; \ - xe = (cc)->state[14]; \ - xf = (cc)->state[15]; \ - xg = (cc)->state[16]; \ - xh = (cc)->state[17]; \ - xi = (cc)->state[18]; \ - xj = (cc)->state[19]; \ - xk = (cc)->state[20]; \ - xl = (cc)->state[21]; \ - xm = (cc)->state[22]; \ - xn = (cc)->state[23]; \ - xo = (cc)->state[24]; \ - xp = (cc)->state[25]; \ - xq = (cc)->state[26]; \ - xr = (cc)->state[27]; \ - xs = (cc)->state[28]; \ - xt = (cc)->state[29]; \ - xu = (cc)->state[30]; \ - xv = (cc)->state[31]; \ - } while (0) - -#define WRITE_STATE(cc) do { \ - (cc)->state[ 0] = x0; \ - (cc)->state[ 1] = x1; \ - (cc)->state[ 2] = x2; \ - (cc)->state[ 3] = x3; \ - (cc)->state[ 4] = x4; \ - (cc)->state[ 5] = x5; \ - (cc)->state[ 6] = x6; \ - (cc)->state[ 7] = x7; \ - (cc)->state[ 8] = x8; \ - (cc)->state[ 9] = x9; \ - (cc)->state[10] = xa; \ - (cc)->state[11] = xb; \ - (cc)->state[12] = xc; \ - (cc)->state[13] = xd; \ - (cc)->state[14] = xe; \ - (cc)->state[15] = xf; \ - (cc)->state[16] = xg; \ - (cc)->state[17] = xh; \ - (cc)->state[18] = xi; \ - (cc)->state[19] = xj; \ - (cc)->state[20] = xk; \ - (cc)->state[21] = xl; \ - (cc)->state[22] = xm; \ - (cc)->state[23] = xn; \ - (cc)->state[24] = xo; \ - (cc)->state[25] = xp; \ - (cc)->state[26] = xq; \ - (cc)->state[27] = xr; \ - (cc)->state[28] = xs; \ - (cc)->state[29] = xt; \ - (cc)->state[30] = xu; \ - (cc)->state[31] = xv; \ - } while (0) - -#endif - -#define INPUT_BLOCK do { \ - x0 ^= sph_dec32le_aligned(buf + 0); \ - x1 ^= sph_dec32le_aligned(buf + 4); \ - x2 ^= sph_dec32le_aligned(buf + 8); \ - x3 ^= sph_dec32le_aligned(buf + 12); \ - x4 ^= sph_dec32le_aligned(buf + 16); \ - x5 ^= sph_dec32le_aligned(buf + 20); \ - x6 ^= sph_dec32le_aligned(buf + 24); \ - x7 ^= sph_dec32le_aligned(buf + 28); \ - } while (0) - -#define ROUND_EVEN do { \ - xg = T32(x0 + xg); \ - x0 = ROTL32(x0, 7); \ - xh = T32(x1 + xh); \ - x1 = ROTL32(x1, 7); \ - xi = T32(x2 + xi); \ - x2 = ROTL32(x2, 7); \ - xj = T32(x3 + xj); \ - x3 = ROTL32(x3, 7); \ - xk = T32(x4 + xk); \ - x4 = ROTL32(x4, 7); \ - xl = T32(x5 + xl); \ - x5 = ROTL32(x5, 7); \ - xm = T32(x6 + xm); \ - x6 = ROTL32(x6, 7); \ - xn = T32(x7 + xn); \ - x7 = ROTL32(x7, 7); \ - xo = T32(x8 + xo); \ - x8 = ROTL32(x8, 7); \ - xp = T32(x9 + xp); \ - x9 = ROTL32(x9, 7); \ - xq = T32(xa + xq); \ - xa = ROTL32(xa, 7); \ - xr = T32(xb + xr); \ - xb = ROTL32(xb, 7); \ - xs = T32(xc + xs); \ - xc = ROTL32(xc, 7); \ - xt = T32(xd + xt); \ - xd = ROTL32(xd, 7); \ - xu = T32(xe + xu); \ - xe = ROTL32(xe, 7); \ - xv = T32(xf + xv); \ - xf = ROTL32(xf, 7); \ - x8 ^= xg; \ - x9 ^= xh; \ - xa ^= xi; \ - xb ^= xj; \ - xc ^= xk; \ - xd ^= xl; \ - xe ^= xm; \ - xf ^= xn; \ - x0 ^= xo; \ - x1 ^= xp; \ - x2 ^= xq; \ - x3 ^= xr; \ - x4 ^= xs; \ - x5 ^= xt; \ - x6 ^= xu; \ - x7 ^= xv; \ - xi = T32(x8 + xi); \ - x8 = ROTL32(x8, 11); \ - xj = T32(x9 + xj); \ - x9 = ROTL32(x9, 11); \ - xg = T32(xa + xg); \ - xa = ROTL32(xa, 11); \ - xh = T32(xb + xh); \ - xb = ROTL32(xb, 11); \ - xm = T32(xc + xm); \ - xc = ROTL32(xc, 11); \ - xn = T32(xd + xn); \ - xd = ROTL32(xd, 11); \ - xk = T32(xe + xk); \ - xe = ROTL32(xe, 11); \ - xl = T32(xf + xl); \ - xf = ROTL32(xf, 11); \ - xq = T32(x0 + xq); \ - x0 = ROTL32(x0, 11); \ - xr = T32(x1 + xr); \ - x1 = ROTL32(x1, 11); \ - xo = T32(x2 + xo); \ - x2 = ROTL32(x2, 11); \ - xp = T32(x3 + xp); \ - x3 = ROTL32(x3, 11); \ - xu = T32(x4 + xu); \ - x4 = ROTL32(x4, 11); \ - xv = T32(x5 + xv); \ - x5 = ROTL32(x5, 11); \ - xs = T32(x6 + xs); \ - x6 = ROTL32(x6, 11); \ - xt = T32(x7 + xt); \ - x7 = ROTL32(x7, 11); \ - xc ^= xi; \ - xd ^= xj; \ - xe ^= xg; \ - xf ^= xh; \ - x8 ^= xm; \ - x9 ^= xn; \ - xa ^= xk; \ - xb ^= xl; \ - x4 ^= xq; \ - x5 ^= xr; \ - x6 ^= xo; \ - x7 ^= xp; \ - x0 ^= xu; \ - x1 ^= xv; \ - x2 ^= xs; \ - x3 ^= xt; \ - } while (0) - -#define ROUND_ODD do { \ - xj = T32(xc + xj); \ - xc = ROTL32(xc, 7); \ - xi = T32(xd + xi); \ - xd = ROTL32(xd, 7); \ - xh = T32(xe + xh); \ - xe = ROTL32(xe, 7); \ - xg = T32(xf + xg); \ - xf = ROTL32(xf, 7); \ - xn = T32(x8 + xn); \ - x8 = ROTL32(x8, 7); \ - xm = T32(x9 + xm); \ - x9 = ROTL32(x9, 7); \ - xl = T32(xa + xl); \ - xa = ROTL32(xa, 7); \ - xk = T32(xb + xk); \ - xb = ROTL32(xb, 7); \ - xr = T32(x4 + xr); \ - x4 = ROTL32(x4, 7); \ - xq = T32(x5 + xq); \ - x5 = ROTL32(x5, 7); \ - xp = T32(x6 + xp); \ - x6 = ROTL32(x6, 7); \ - xo = T32(x7 + xo); \ - x7 = ROTL32(x7, 7); \ - xv = T32(x0 + xv); \ - x0 = ROTL32(x0, 7); \ - xu = T32(x1 + xu); \ - x1 = ROTL32(x1, 7); \ - xt = T32(x2 + xt); \ - x2 = ROTL32(x2, 7); \ - xs = T32(x3 + xs); \ - x3 = ROTL32(x3, 7); \ - x4 ^= xj; \ - x5 ^= xi; \ - x6 ^= xh; \ - x7 ^= xg; \ - x0 ^= xn; \ - x1 ^= xm; \ - x2 ^= xl; \ - x3 ^= xk; \ - xc ^= xr; \ - xd ^= xq; \ - xe ^= xp; \ - xf ^= xo; \ - x8 ^= xv; \ - x9 ^= xu; \ - xa ^= xt; \ - xb ^= xs; \ - xh = T32(x4 + xh); \ - x4 = ROTL32(x4, 11); \ - xg = T32(x5 + xg); \ - x5 = ROTL32(x5, 11); \ - xj = T32(x6 + xj); \ - x6 = ROTL32(x6, 11); \ - xi = T32(x7 + xi); \ - x7 = ROTL32(x7, 11); \ - xl = T32(x0 + xl); \ - x0 = ROTL32(x0, 11); \ - xk = T32(x1 + xk); \ - x1 = ROTL32(x1, 11); \ - xn = T32(x2 + xn); \ - x2 = ROTL32(x2, 11); \ - xm = T32(x3 + xm); \ - x3 = ROTL32(x3, 11); \ - xp = T32(xc + xp); \ - xc = ROTL32(xc, 11); \ - xo = T32(xd + xo); \ - xd = ROTL32(xd, 11); \ - xr = T32(xe + xr); \ - xe = ROTL32(xe, 11); \ - xq = T32(xf + xq); \ - xf = ROTL32(xf, 11); \ - xt = T32(x8 + xt); \ - x8 = ROTL32(x8, 11); \ - xs = T32(x9 + xs); \ - x9 = ROTL32(x9, 11); \ - xv = T32(xa + xv); \ - xa = ROTL32(xa, 11); \ - xu = T32(xb + xu); \ - xb = ROTL32(xb, 11); \ - x0 ^= xh; \ - x1 ^= xg; \ - x2 ^= xj; \ - x3 ^= xi; \ - x4 ^= xl; \ - x5 ^= xk; \ - x6 ^= xn; \ - x7 ^= xm; \ - x8 ^= xp; \ - x9 ^= xo; \ - xa ^= xr; \ - xb ^= xq; \ - xc ^= xt; \ - xd ^= xs; \ - xe ^= xv; \ - xf ^= xu; \ - } while (0) - -/* - * There is no need to unroll all 16 rounds. The word-swapping permutation - * is an involution, so we need to unroll an even number of rounds. On - * "big" systems, unrolling 4 rounds yields about 97% of the speed - * achieved with full unrolling; and it keeps the code more compact - * for small architectures. - */ - -#if SPH_CUBEHASH_UNROLL == 2 - -#define SIXTEEN_ROUNDS do { \ - int j; \ - for (j = 0; j < 8; j ++) { \ - ROUND_EVEN; \ - ROUND_ODD; \ - } \ - } while (0) - -#elif SPH_CUBEHASH_UNROLL == 4 - -#define SIXTEEN_ROUNDS do { \ - int j; \ - for (j = 0; j < 4; j ++) { \ - ROUND_EVEN; \ - ROUND_ODD; \ - ROUND_EVEN; \ - ROUND_ODD; \ - } \ - } while (0) - -#elif SPH_CUBEHASH_UNROLL == 8 - -#define SIXTEEN_ROUNDS do { \ - int j; \ - for (j = 0; j < 2; j ++) { \ - ROUND_EVEN; \ - ROUND_ODD; \ - ROUND_EVEN; \ - ROUND_ODD; \ - ROUND_EVEN; \ - ROUND_ODD; \ - ROUND_EVEN; \ - ROUND_ODD; \ - } \ - } while (0) - -#else - -#define SIXTEEN_ROUNDS do { \ - ROUND_EVEN; \ - ROUND_ODD; \ - ROUND_EVEN; \ - ROUND_ODD; \ - ROUND_EVEN; \ - ROUND_ODD; \ - ROUND_EVEN; \ - ROUND_ODD; \ - ROUND_EVEN; \ - ROUND_ODD; \ - ROUND_EVEN; \ - ROUND_ODD; \ - ROUND_EVEN; \ - ROUND_ODD; \ - ROUND_EVEN; \ - ROUND_ODD; \ - } while (0) - -#endif - -static void -cubehash_init(sph_cubehash_context *sc, const sph_u32 *iv) -{ - memcpy(sc->state, iv, sizeof sc->state); - sc->ptr = 0; -} - -static void -cubehash_core(sph_cubehash_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - DECL_STATE - - buf = sc->buf; - ptr = sc->ptr; - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - READ_STATE(sc); - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data = (const unsigned char *)data + clen; - len -= clen; - if (ptr == sizeof sc->buf) { - INPUT_BLOCK; - SIXTEEN_ROUNDS; - ptr = 0; - } - } - WRITE_STATE(sc); - sc->ptr = ptr; -} - -static void -cubehash_close(sph_cubehash_context *sc, unsigned ub, unsigned n, - void *dst, size_t out_size_w32) -{ - unsigned char *buf, *out; - size_t ptr; - unsigned z; - int i; - DECL_STATE - - buf = sc->buf; - ptr = sc->ptr; - z = 0x80 >> n; - buf[ptr ++] = ((ub & -z) | z) & 0xFF; - memset(buf + ptr, 0, (sizeof sc->buf) - ptr); - READ_STATE(sc); - INPUT_BLOCK; - for (i = 0; i < 11; i ++) { - SIXTEEN_ROUNDS; - if (i == 0) - xv ^= SPH_C32(1); - } - WRITE_STATE(sc); - out = dst; - for (z = 0; z < out_size_w32; z ++) - sph_enc32le(out + (z << 2), sc->state[z]); -} - -/* see sph_cubehash.h */ -void -sph_cubehash224_init(void *cc) -{ - cubehash_init(cc, IV224); -} - -/* see sph_cubehash.h */ -void -sph_cubehash224(void *cc, const void *data, size_t len) -{ - cubehash_core(cc, data, len); -} - -/* see sph_cubehash.h */ -void -sph_cubehash224_close(void *cc, void *dst) -{ - sph_cubehash224_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_cubehash.h */ -void -sph_cubehash224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - cubehash_close(cc, ub, n, dst, 7); - sph_cubehash224_init(cc); -} - -/* see sph_cubehash.h */ -void -sph_cubehash256_init(void *cc) -{ - cubehash_init(cc, IV256); -} - -/* see sph_cubehash.h */ -void -sph_cubehash256(void *cc, const void *data, size_t len) -{ - cubehash_core(cc, data, len); -} - -/* see sph_cubehash.h */ -void -sph_cubehash256_close(void *cc, void *dst) -{ - sph_cubehash256_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_cubehash.h */ -void -sph_cubehash256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - cubehash_close(cc, ub, n, dst, 8); - sph_cubehash256_init(cc); -} - -/* see sph_cubehash.h */ -void -sph_cubehash384_init(void *cc) -{ - cubehash_init(cc, IV384); -} - -/* see sph_cubehash.h */ -void -sph_cubehash384(void *cc, const void *data, size_t len) -{ - cubehash_core(cc, data, len); -} - -/* see sph_cubehash.h */ -void -sph_cubehash384_close(void *cc, void *dst) -{ - sph_cubehash384_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_cubehash.h */ -void -sph_cubehash384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - cubehash_close(cc, ub, n, dst, 12); - sph_cubehash384_init(cc); -} - -/* see sph_cubehash.h */ -void -sph_cubehash512_init(void *cc) -{ - cubehash_init(cc, IV512); -} - -/* see sph_cubehash.h */ -void -sph_cubehash512(void *cc, const void *data, size_t len) -{ - cubehash_core(cc, data, len); -} - -/* see sph_cubehash.h */ -void -sph_cubehash512_close(void *cc, void *dst) -{ - sph_cubehash512_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_cubehash.h */ -void -sph_cubehash512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - cubehash_close(cc, ub, n, dst, 16); - sph_cubehash512_init(cc); -} -#ifdef __cplusplus -} -#endif diff --git a/sph/echo.c b/sph/echo.c deleted file mode 100644 index 667e3f35..00000000 --- a/sph/echo.c +++ /dev/null @@ -1,1031 +0,0 @@ -/* $Id: echo.c 227 2010-06-16 17:28:38Z tp $ */ -/* - * ECHO implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include -#include - -#include "sph_echo.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -#if SPH_SMALL_FOOTPRINT && !defined SPH_SMALL_FOOTPRINT_ECHO -#define SPH_SMALL_FOOTPRINT_ECHO 1 -#endif - -/* - * Some measures tend to show that the 64-bit implementation offers - * better performance only on a "64-bit architectures", those which have - * actual 64-bit registers. - */ -#if !defined SPH_ECHO_64 && SPH_64_TRUE -#define SPH_ECHO_64 1 -#endif - -/* - * We can use a 64-bit implementation only if a 64-bit type is available. - */ -#if !SPH_64 -#undef SPH_ECHO_64 -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -#define T32 SPH_T32 -#define C32 SPH_C32 -#if SPH_64 -#define C64 SPH_C64 -#endif - -#define AES_BIG_ENDIAN 0 -#include "aes_helper.c" - -#if SPH_ECHO_64 - -#define DECL_STATE_SMALL \ - sph_u64 W[16][2]; - -#define DECL_STATE_BIG \ - sph_u64 W[16][2]; - -#define INPUT_BLOCK_SMALL(sc) do { \ - unsigned u; \ - memcpy(W, sc->u.Vb, 8 * sizeof(sph_u64)); \ - for (u = 0; u < 12; u ++) { \ - W[u + 4][0] = sph_dec64le_aligned( \ - sc->buf + 16 * u); \ - W[u + 4][1] = sph_dec64le_aligned( \ - sc->buf + 16 * u + 8); \ - } \ - } while (0) - -#define INPUT_BLOCK_BIG(sc) do { \ - unsigned u; \ - memcpy(W, sc->u.Vb, 16 * sizeof(sph_u64)); \ - for (u = 0; u < 8; u ++) { \ - W[u + 8][0] = sph_dec64le_aligned( \ - sc->buf + 16 * u); \ - W[u + 8][1] = sph_dec64le_aligned( \ - sc->buf + 16 * u + 8); \ - } \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_ECHO - -static void -aes_2rounds_all(sph_u64 W[16][2], - sph_u32 *pK0, sph_u32 *pK1, sph_u32 *pK2, sph_u32 *pK3) -{ - int n; - sph_u32 K0 = *pK0; - sph_u32 K1 = *pK1; - sph_u32 K2 = *pK2; - sph_u32 K3 = *pK3; - - for (n = 0; n < 16; n ++) { - sph_u64 Wl = W[n][0]; - sph_u64 Wh = W[n][1]; - sph_u32 X0 = (sph_u32)Wl; - sph_u32 X1 = (sph_u32)(Wl >> 32); - sph_u32 X2 = (sph_u32)Wh; - sph_u32 X3 = (sph_u32)(Wh >> 32); - sph_u32 Y0, Y1, Y2, Y3; \ - AES_ROUND_LE(X0, X1, X2, X3, K0, K1, K2, K3, Y0, Y1, Y2, Y3); - AES_ROUND_NOKEY_LE(Y0, Y1, Y2, Y3, X0, X1, X2, X3); - W[n][0] = (sph_u64)X0 | ((sph_u64)X1 << 32); - W[n][1] = (sph_u64)X2 | ((sph_u64)X3 << 32); - if ((K0 = T32(K0 + 1)) == 0) { - if ((K1 = T32(K1 + 1)) == 0) - if ((K2 = T32(K2 + 1)) == 0) - K3 = T32(K3 + 1); - } - } - *pK0 = K0; - *pK1 = K1; - *pK2 = K2; - *pK3 = K3; -} - -#define BIG_SUB_WORDS do { \ - aes_2rounds_all(W, &K0, &K1, &K2, &K3); \ - } while (0) - -#else - -#define AES_2ROUNDS(X) do { \ - sph_u32 X0 = (sph_u32)(X[0]); \ - sph_u32 X1 = (sph_u32)(X[0] >> 32); \ - sph_u32 X2 = (sph_u32)(X[1]); \ - sph_u32 X3 = (sph_u32)(X[1] >> 32); \ - sph_u32 Y0, Y1, Y2, Y3; \ - AES_ROUND_LE(X0, X1, X2, X3, K0, K1, K2, K3, Y0, Y1, Y2, Y3); \ - AES_ROUND_NOKEY_LE(Y0, Y1, Y2, Y3, X0, X1, X2, X3); \ - X[0] = (sph_u64)X0 | ((sph_u64)X1 << 32); \ - X[1] = (sph_u64)X2 | ((sph_u64)X3 << 32); \ - if ((K0 = T32(K0 + 1)) == 0) { \ - if ((K1 = T32(K1 + 1)) == 0) \ - if ((K2 = T32(K2 + 1)) == 0) \ - K3 = T32(K3 + 1); \ - } \ - } while (0) - -#define BIG_SUB_WORDS do { \ - AES_2ROUNDS(W[ 0]); \ - AES_2ROUNDS(W[ 1]); \ - AES_2ROUNDS(W[ 2]); \ - AES_2ROUNDS(W[ 3]); \ - AES_2ROUNDS(W[ 4]); \ - AES_2ROUNDS(W[ 5]); \ - AES_2ROUNDS(W[ 6]); \ - AES_2ROUNDS(W[ 7]); \ - AES_2ROUNDS(W[ 8]); \ - AES_2ROUNDS(W[ 9]); \ - AES_2ROUNDS(W[10]); \ - AES_2ROUNDS(W[11]); \ - AES_2ROUNDS(W[12]); \ - AES_2ROUNDS(W[13]); \ - AES_2ROUNDS(W[14]); \ - AES_2ROUNDS(W[15]); \ - } while (0) - -#endif - -#define SHIFT_ROW1(a, b, c, d) do { \ - sph_u64 tmp; \ - tmp = W[a][0]; \ - W[a][0] = W[b][0]; \ - W[b][0] = W[c][0]; \ - W[c][0] = W[d][0]; \ - W[d][0] = tmp; \ - tmp = W[a][1]; \ - W[a][1] = W[b][1]; \ - W[b][1] = W[c][1]; \ - W[c][1] = W[d][1]; \ - W[d][1] = tmp; \ - } while (0) - -#define SHIFT_ROW2(a, b, c, d) do { \ - sph_u64 tmp; \ - tmp = W[a][0]; \ - W[a][0] = W[c][0]; \ - W[c][0] = tmp; \ - tmp = W[b][0]; \ - W[b][0] = W[d][0]; \ - W[d][0] = tmp; \ - tmp = W[a][1]; \ - W[a][1] = W[c][1]; \ - W[c][1] = tmp; \ - tmp = W[b][1]; \ - W[b][1] = W[d][1]; \ - W[d][1] = tmp; \ - } while (0) - -#define SHIFT_ROW3(a, b, c, d) SHIFT_ROW1(d, c, b, a) - -#define BIG_SHIFT_ROWS do { \ - SHIFT_ROW1(1, 5, 9, 13); \ - SHIFT_ROW2(2, 6, 10, 14); \ - SHIFT_ROW3(3, 7, 11, 15); \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_ECHO - -static void -mix_column(sph_u64 W[16][2], int ia, int ib, int ic, int id) -{ - int n; - - for (n = 0; n < 2; n ++) { - sph_u64 a = W[ia][n]; - sph_u64 b = W[ib][n]; - sph_u64 c = W[ic][n]; - sph_u64 d = W[id][n]; - sph_u64 ab = a ^ b; - sph_u64 bc = b ^ c; - sph_u64 cd = c ^ d; - sph_u64 abx = ((ab & C64(0x8080808080808080)) >> 7) * 27U - ^ ((ab & C64(0x7F7F7F7F7F7F7F7F)) << 1); - sph_u64 bcx = ((bc & C64(0x8080808080808080)) >> 7) * 27U - ^ ((bc & C64(0x7F7F7F7F7F7F7F7F)) << 1); - sph_u64 cdx = ((cd & C64(0x8080808080808080)) >> 7) * 27U - ^ ((cd & C64(0x7F7F7F7F7F7F7F7F)) << 1); - W[ia][n] = abx ^ bc ^ d; - W[ib][n] = bcx ^ a ^ cd; - W[ic][n] = cdx ^ ab ^ d; - W[id][n] = abx ^ bcx ^ cdx ^ ab ^ c; - } -} - -#define MIX_COLUMN(a, b, c, d) mix_column(W, a, b, c, d) - -#else - -#define MIX_COLUMN1(ia, ib, ic, id, n) do { \ - sph_u64 a = W[ia][n]; \ - sph_u64 b = W[ib][n]; \ - sph_u64 c = W[ic][n]; \ - sph_u64 d = W[id][n]; \ - sph_u64 ab = a ^ b; \ - sph_u64 bc = b ^ c; \ - sph_u64 cd = c ^ d; \ - sph_u64 abx = ((ab & C64(0x8080808080808080)) >> 7) * 27U \ - ^ ((ab & C64(0x7F7F7F7F7F7F7F7F)) << 1); \ - sph_u64 bcx = ((bc & C64(0x8080808080808080)) >> 7) * 27U \ - ^ ((bc & C64(0x7F7F7F7F7F7F7F7F)) << 1); \ - sph_u64 cdx = ((cd & C64(0x8080808080808080)) >> 7) * 27U \ - ^ ((cd & C64(0x7F7F7F7F7F7F7F7F)) << 1); \ - W[ia][n] = abx ^ bc ^ d; \ - W[ib][n] = bcx ^ a ^ cd; \ - W[ic][n] = cdx ^ ab ^ d; \ - W[id][n] = abx ^ bcx ^ cdx ^ ab ^ c; \ - } while (0) - -#define MIX_COLUMN(a, b, c, d) do { \ - MIX_COLUMN1(a, b, c, d, 0); \ - MIX_COLUMN1(a, b, c, d, 1); \ - } while (0) - -#endif - -#define BIG_MIX_COLUMNS do { \ - MIX_COLUMN(0, 1, 2, 3); \ - MIX_COLUMN(4, 5, 6, 7); \ - MIX_COLUMN(8, 9, 10, 11); \ - MIX_COLUMN(12, 13, 14, 15); \ - } while (0) - -#define BIG_ROUND do { \ - BIG_SUB_WORDS; \ - BIG_SHIFT_ROWS; \ - BIG_MIX_COLUMNS; \ - } while (0) - -#define FINAL_SMALL do { \ - unsigned u; \ - sph_u64 *VV = &sc->u.Vb[0][0]; \ - sph_u64 *WW = &W[0][0]; \ - for (u = 0; u < 8; u ++) { \ - VV[u] ^= sph_dec64le_aligned(sc->buf + (u * 8)) \ - ^ sph_dec64le_aligned(sc->buf + (u * 8) + 64) \ - ^ sph_dec64le_aligned(sc->buf + (u * 8) + 128) \ - ^ WW[u] ^ WW[u + 8] \ - ^ WW[u + 16] ^ WW[u + 24]; \ - } \ - } while (0) - -#define FINAL_BIG do { \ - unsigned u; \ - sph_u64 *VV = &sc->u.Vb[0][0]; \ - sph_u64 *WW = &W[0][0]; \ - for (u = 0; u < 16; u ++) { \ - VV[u] ^= sph_dec64le_aligned(sc->buf + (u * 8)) \ - ^ WW[u] ^ WW[u + 16]; \ - } \ - } while (0) - -#define COMPRESS_SMALL(sc) do { \ - sph_u32 K0 = sc->C0; \ - sph_u32 K1 = sc->C1; \ - sph_u32 K2 = sc->C2; \ - sph_u32 K3 = sc->C3; \ - unsigned u; \ - INPUT_BLOCK_SMALL(sc); \ - for (u = 0; u < 8; u ++) { \ - BIG_ROUND; \ - } \ - FINAL_SMALL; \ - } while (0) - -#define COMPRESS_BIG(sc) do { \ - sph_u32 K0 = sc->C0; \ - sph_u32 K1 = sc->C1; \ - sph_u32 K2 = sc->C2; \ - sph_u32 K3 = sc->C3; \ - unsigned u; \ - INPUT_BLOCK_BIG(sc); \ - for (u = 0; u < 10; u ++) { \ - BIG_ROUND; \ - } \ - FINAL_BIG; \ - } while (0) - -#else - -#define DECL_STATE_SMALL \ - sph_u32 W[16][4]; - -#define DECL_STATE_BIG \ - sph_u32 W[16][4]; - -#define INPUT_BLOCK_SMALL(sc) do { \ - unsigned u; \ - memcpy(W, sc->u.Vs, 16 * sizeof(sph_u32)); \ - for (u = 0; u < 12; u ++) { \ - W[u + 4][0] = sph_dec32le_aligned( \ - sc->buf + 16 * u); \ - W[u + 4][1] = sph_dec32le_aligned( \ - sc->buf + 16 * u + 4); \ - W[u + 4][2] = sph_dec32le_aligned( \ - sc->buf + 16 * u + 8); \ - W[u + 4][3] = sph_dec32le_aligned( \ - sc->buf + 16 * u + 12); \ - } \ - } while (0) - -#define INPUT_BLOCK_BIG(sc) do { \ - unsigned u; \ - memcpy(W, sc->u.Vs, 32 * sizeof(sph_u32)); \ - for (u = 0; u < 8; u ++) { \ - W[u + 8][0] = sph_dec32le_aligned( \ - sc->buf + 16 * u); \ - W[u + 8][1] = sph_dec32le_aligned( \ - sc->buf + 16 * u + 4); \ - W[u + 8][2] = sph_dec32le_aligned( \ - sc->buf + 16 * u + 8); \ - W[u + 8][3] = sph_dec32le_aligned( \ - sc->buf + 16 * u + 12); \ - } \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_ECHO - -static void -aes_2rounds_all(sph_u32 W[16][4], - sph_u32 *pK0, sph_u32 *pK1, sph_u32 *pK2, sph_u32 *pK3) -{ - int n; - sph_u32 K0 = *pK0; - sph_u32 K1 = *pK1; - sph_u32 K2 = *pK2; - sph_u32 K3 = *pK3; - - for (n = 0; n < 16; n ++) { - sph_u32 *X = W[n]; - sph_u32 Y0, Y1, Y2, Y3; - AES_ROUND_LE(X[0], X[1], X[2], X[3], - K0, K1, K2, K3, Y0, Y1, Y2, Y3); - AES_ROUND_NOKEY_LE(Y0, Y1, Y2, Y3, X[0], X[1], X[2], X[3]); - if ((K0 = T32(K0 + 1)) == 0) { - if ((K1 = T32(K1 + 1)) == 0) - if ((K2 = T32(K2 + 1)) == 0) - K3 = T32(K3 + 1); - } - } - *pK0 = K0; - *pK1 = K1; - *pK2 = K2; - *pK3 = K3; -} - -#define BIG_SUB_WORDS do { \ - aes_2rounds_all(W, &K0, &K1, &K2, &K3); \ - } while (0) - -#else - -#define AES_2ROUNDS(X) do { \ - sph_u32 Y0, Y1, Y2, Y3; \ - AES_ROUND_LE(X[0], X[1], X[2], X[3], \ - K0, K1, K2, K3, Y0, Y1, Y2, Y3); \ - AES_ROUND_NOKEY_LE(Y0, Y1, Y2, Y3, X[0], X[1], X[2], X[3]); \ - if ((K0 = T32(K0 + 1)) == 0) { \ - if ((K1 = T32(K1 + 1)) == 0) \ - if ((K2 = T32(K2 + 1)) == 0) \ - K3 = T32(K3 + 1); \ - } \ - } while (0) - -#define BIG_SUB_WORDS do { \ - AES_2ROUNDS(W[ 0]); \ - AES_2ROUNDS(W[ 1]); \ - AES_2ROUNDS(W[ 2]); \ - AES_2ROUNDS(W[ 3]); \ - AES_2ROUNDS(W[ 4]); \ - AES_2ROUNDS(W[ 5]); \ - AES_2ROUNDS(W[ 6]); \ - AES_2ROUNDS(W[ 7]); \ - AES_2ROUNDS(W[ 8]); \ - AES_2ROUNDS(W[ 9]); \ - AES_2ROUNDS(W[10]); \ - AES_2ROUNDS(W[11]); \ - AES_2ROUNDS(W[12]); \ - AES_2ROUNDS(W[13]); \ - AES_2ROUNDS(W[14]); \ - AES_2ROUNDS(W[15]); \ - } while (0) - -#endif - -#define SHIFT_ROW1(a, b, c, d) do { \ - sph_u32 tmp; \ - tmp = W[a][0]; \ - W[a][0] = W[b][0]; \ - W[b][0] = W[c][0]; \ - W[c][0] = W[d][0]; \ - W[d][0] = tmp; \ - tmp = W[a][1]; \ - W[a][1] = W[b][1]; \ - W[b][1] = W[c][1]; \ - W[c][1] = W[d][1]; \ - W[d][1] = tmp; \ - tmp = W[a][2]; \ - W[a][2] = W[b][2]; \ - W[b][2] = W[c][2]; \ - W[c][2] = W[d][2]; \ - W[d][2] = tmp; \ - tmp = W[a][3]; \ - W[a][3] = W[b][3]; \ - W[b][3] = W[c][3]; \ - W[c][3] = W[d][3]; \ - W[d][3] = tmp; \ - } while (0) - -#define SHIFT_ROW2(a, b, c, d) do { \ - sph_u32 tmp; \ - tmp = W[a][0]; \ - W[a][0] = W[c][0]; \ - W[c][0] = tmp; \ - tmp = W[b][0]; \ - W[b][0] = W[d][0]; \ - W[d][0] = tmp; \ - tmp = W[a][1]; \ - W[a][1] = W[c][1]; \ - W[c][1] = tmp; \ - tmp = W[b][1]; \ - W[b][1] = W[d][1]; \ - W[d][1] = tmp; \ - tmp = W[a][2]; \ - W[a][2] = W[c][2]; \ - W[c][2] = tmp; \ - tmp = W[b][2]; \ - W[b][2] = W[d][2]; \ - W[d][2] = tmp; \ - tmp = W[a][3]; \ - W[a][3] = W[c][3]; \ - W[c][3] = tmp; \ - tmp = W[b][3]; \ - W[b][3] = W[d][3]; \ - W[d][3] = tmp; \ - } while (0) - -#define SHIFT_ROW3(a, b, c, d) SHIFT_ROW1(d, c, b, a) - -#define BIG_SHIFT_ROWS do { \ - SHIFT_ROW1(1, 5, 9, 13); \ - SHIFT_ROW2(2, 6, 10, 14); \ - SHIFT_ROW3(3, 7, 11, 15); \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_ECHO - -static void -mix_column(sph_u32 W[16][4], int ia, int ib, int ic, int id) -{ - int n; - - for (n = 0; n < 4; n ++) { - sph_u32 a = W[ia][n]; - sph_u32 b = W[ib][n]; - sph_u32 c = W[ic][n]; - sph_u32 d = W[id][n]; - sph_u32 ab = a ^ b; - sph_u32 bc = b ^ c; - sph_u32 cd = c ^ d; - sph_u32 abx = ((ab & C32(0x80808080)) >> 7) * 27U - ^ ((ab & C32(0x7F7F7F7F)) << 1); - sph_u32 bcx = ((bc & C32(0x80808080)) >> 7) * 27U - ^ ((bc & C32(0x7F7F7F7F)) << 1); - sph_u32 cdx = ((cd & C32(0x80808080)) >> 7) * 27U - ^ ((cd & C32(0x7F7F7F7F)) << 1); - W[ia][n] = abx ^ bc ^ d; - W[ib][n] = bcx ^ a ^ cd; - W[ic][n] = cdx ^ ab ^ d; - W[id][n] = abx ^ bcx ^ cdx ^ ab ^ c; - } -} - -#define MIX_COLUMN(a, b, c, d) mix_column(W, a, b, c, d) - -#else - -#define MIX_COLUMN1(ia, ib, ic, id, n) do { \ - sph_u32 a = W[ia][n]; \ - sph_u32 b = W[ib][n]; \ - sph_u32 c = W[ic][n]; \ - sph_u32 d = W[id][n]; \ - sph_u32 ab = a ^ b; \ - sph_u32 bc = b ^ c; \ - sph_u32 cd = c ^ d; \ - sph_u32 abx = ((ab & C32(0x80808080)) >> 7) * 27U \ - ^ ((ab & C32(0x7F7F7F7F)) << 1); \ - sph_u32 bcx = ((bc & C32(0x80808080)) >> 7) * 27U \ - ^ ((bc & C32(0x7F7F7F7F)) << 1); \ - sph_u32 cdx = ((cd & C32(0x80808080)) >> 7) * 27U \ - ^ ((cd & C32(0x7F7F7F7F)) << 1); \ - W[ia][n] = abx ^ bc ^ d; \ - W[ib][n] = bcx ^ a ^ cd; \ - W[ic][n] = cdx ^ ab ^ d; \ - W[id][n] = abx ^ bcx ^ cdx ^ ab ^ c; \ - } while (0) - -#define MIX_COLUMN(a, b, c, d) do { \ - MIX_COLUMN1(a, b, c, d, 0); \ - MIX_COLUMN1(a, b, c, d, 1); \ - MIX_COLUMN1(a, b, c, d, 2); \ - MIX_COLUMN1(a, b, c, d, 3); \ - } while (0) - -#endif - -#define BIG_MIX_COLUMNS do { \ - MIX_COLUMN(0, 1, 2, 3); \ - MIX_COLUMN(4, 5, 6, 7); \ - MIX_COLUMN(8, 9, 10, 11); \ - MIX_COLUMN(12, 13, 14, 15); \ - } while (0) - -#define BIG_ROUND do { \ - BIG_SUB_WORDS; \ - BIG_SHIFT_ROWS; \ - BIG_MIX_COLUMNS; \ - } while (0) - -#define FINAL_SMALL do { \ - unsigned u; \ - sph_u32 *VV = &sc->u.Vs[0][0]; \ - sph_u32 *WW = &W[0][0]; \ - for (u = 0; u < 16; u ++) { \ - VV[u] ^= sph_dec32le_aligned(sc->buf + (u * 4)) \ - ^ sph_dec32le_aligned(sc->buf + (u * 4) + 64) \ - ^ sph_dec32le_aligned(sc->buf + (u * 4) + 128) \ - ^ WW[u] ^ WW[u + 16] \ - ^ WW[u + 32] ^ WW[u + 48]; \ - } \ - } while (0) - -#define FINAL_BIG do { \ - unsigned u; \ - sph_u32 *VV = &sc->u.Vs[0][0]; \ - sph_u32 *WW = &W[0][0]; \ - for (u = 0; u < 32; u ++) { \ - VV[u] ^= sph_dec32le_aligned(sc->buf + (u * 4)) \ - ^ WW[u] ^ WW[u + 32]; \ - } \ - } while (0) - -#define COMPRESS_SMALL(sc) do { \ - sph_u32 K0 = sc->C0; \ - sph_u32 K1 = sc->C1; \ - sph_u32 K2 = sc->C2; \ - sph_u32 K3 = sc->C3; \ - unsigned u; \ - INPUT_BLOCK_SMALL(sc); \ - for (u = 0; u < 8; u ++) { \ - BIG_ROUND; \ - } \ - FINAL_SMALL; \ - } while (0) - -#define COMPRESS_BIG(sc) do { \ - sph_u32 K0 = sc->C0; \ - sph_u32 K1 = sc->C1; \ - sph_u32 K2 = sc->C2; \ - sph_u32 K3 = sc->C3; \ - unsigned u; \ - INPUT_BLOCK_BIG(sc); \ - for (u = 0; u < 10; u ++) { \ - BIG_ROUND; \ - } \ - FINAL_BIG; \ - } while (0) - -#endif - -#define INCR_COUNTER(sc, val) do { \ - sc->C0 = T32(sc->C0 + (sph_u32)(val)); \ - if (sc->C0 < (sph_u32)(val)) { \ - if ((sc->C1 = T32(sc->C1 + 1)) == 0) \ - if ((sc->C2 = T32(sc->C2 + 1)) == 0) \ - sc->C3 = T32(sc->C3 + 1); \ - } \ - } while (0) - -static void -echo_small_init(sph_echo_small_context *sc, unsigned out_len) -{ -#if SPH_ECHO_64 - sc->u.Vb[0][0] = (sph_u64)out_len; - sc->u.Vb[0][1] = 0; - sc->u.Vb[1][0] = (sph_u64)out_len; - sc->u.Vb[1][1] = 0; - sc->u.Vb[2][0] = (sph_u64)out_len; - sc->u.Vb[2][1] = 0; - sc->u.Vb[3][0] = (sph_u64)out_len; - sc->u.Vb[3][1] = 0; -#else - sc->u.Vs[0][0] = (sph_u32)out_len; - sc->u.Vs[0][1] = sc->u.Vs[0][2] = sc->u.Vs[0][3] = 0; - sc->u.Vs[1][0] = (sph_u32)out_len; - sc->u.Vs[1][1] = sc->u.Vs[1][2] = sc->u.Vs[1][3] = 0; - sc->u.Vs[2][0] = (sph_u32)out_len; - sc->u.Vs[2][1] = sc->u.Vs[2][2] = sc->u.Vs[2][3] = 0; - sc->u.Vs[3][0] = (sph_u32)out_len; - sc->u.Vs[3][1] = sc->u.Vs[3][2] = sc->u.Vs[3][3] = 0; -#endif - sc->ptr = 0; - sc->C0 = sc->C1 = sc->C2 = sc->C3 = 0; -} - -static void -echo_big_init(sph_echo_big_context *sc, unsigned out_len) -{ -#if SPH_ECHO_64 - sc->u.Vb[0][0] = (sph_u64)out_len; - sc->u.Vb[0][1] = 0; - sc->u.Vb[1][0] = (sph_u64)out_len; - sc->u.Vb[1][1] = 0; - sc->u.Vb[2][0] = (sph_u64)out_len; - sc->u.Vb[2][1] = 0; - sc->u.Vb[3][0] = (sph_u64)out_len; - sc->u.Vb[3][1] = 0; - sc->u.Vb[4][0] = (sph_u64)out_len; - sc->u.Vb[4][1] = 0; - sc->u.Vb[5][0] = (sph_u64)out_len; - sc->u.Vb[5][1] = 0; - sc->u.Vb[6][0] = (sph_u64)out_len; - sc->u.Vb[6][1] = 0; - sc->u.Vb[7][0] = (sph_u64)out_len; - sc->u.Vb[7][1] = 0; -#else - sc->u.Vs[0][0] = (sph_u32)out_len; - sc->u.Vs[0][1] = sc->u.Vs[0][2] = sc->u.Vs[0][3] = 0; - sc->u.Vs[1][0] = (sph_u32)out_len; - sc->u.Vs[1][1] = sc->u.Vs[1][2] = sc->u.Vs[1][3] = 0; - sc->u.Vs[2][0] = (sph_u32)out_len; - sc->u.Vs[2][1] = sc->u.Vs[2][2] = sc->u.Vs[2][3] = 0; - sc->u.Vs[3][0] = (sph_u32)out_len; - sc->u.Vs[3][1] = sc->u.Vs[3][2] = sc->u.Vs[3][3] = 0; - sc->u.Vs[4][0] = (sph_u32)out_len; - sc->u.Vs[4][1] = sc->u.Vs[4][2] = sc->u.Vs[4][3] = 0; - sc->u.Vs[5][0] = (sph_u32)out_len; - sc->u.Vs[5][1] = sc->u.Vs[5][2] = sc->u.Vs[5][3] = 0; - sc->u.Vs[6][0] = (sph_u32)out_len; - sc->u.Vs[6][1] = sc->u.Vs[6][2] = sc->u.Vs[6][3] = 0; - sc->u.Vs[7][0] = (sph_u32)out_len; - sc->u.Vs[7][1] = sc->u.Vs[7][2] = sc->u.Vs[7][3] = 0; -#endif - sc->ptr = 0; - sc->C0 = sc->C1 = sc->C2 = sc->C3 = 0; -} - -static void -echo_small_compress(sph_echo_small_context *sc) -{ - DECL_STATE_SMALL - - COMPRESS_SMALL(sc); -} - -static void -echo_big_compress(sph_echo_big_context *sc) -{ - DECL_STATE_BIG - - COMPRESS_BIG(sc); -} - -static void -echo_small_core(sph_echo_small_context *sc, - const unsigned char *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - - buf = sc->buf; - ptr = sc->ptr; - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data += clen; - len -= clen; - if (ptr == sizeof sc->buf) { - INCR_COUNTER(sc, 1536); - echo_small_compress(sc); - ptr = 0; - } - } - sc->ptr = ptr; -} - -static void -echo_big_core(sph_echo_big_context *sc, - const unsigned char *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - - buf = sc->buf; - ptr = sc->ptr; - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data += clen; - len -= clen; - if (ptr == sizeof sc->buf) { - INCR_COUNTER(sc, 1024); - echo_big_compress(sc); - ptr = 0; - } - } - sc->ptr = ptr; -} - -static void -echo_small_close(sph_echo_small_context *sc, unsigned ub, unsigned n, - void *dst, unsigned out_size_w32) -{ - unsigned char *buf; - size_t ptr; - unsigned z; - unsigned elen; - union { - unsigned char tmp[32]; - sph_u32 dummy; -#if SPH_ECHO_64 - sph_u64 dummy2; -#endif - } u; -#if SPH_ECHO_64 - sph_u64 *VV; -#else - sph_u32 *VV; -#endif - unsigned k; - - buf = sc->buf; - ptr = sc->ptr; - elen = ((unsigned)ptr << 3) + n; - INCR_COUNTER(sc, elen); - sph_enc32le_aligned(u.tmp, sc->C0); - sph_enc32le_aligned(u.tmp + 4, sc->C1); - sph_enc32le_aligned(u.tmp + 8, sc->C2); - sph_enc32le_aligned(u.tmp + 12, sc->C3); - /* - * If elen is zero, then this block actually contains no message - * bit, only the first padding bit. - */ - if (elen == 0) { - sc->C0 = sc->C1 = sc->C2 = sc->C3 = 0; - } - z = 0x80 >> n; - buf[ptr ++] = ((ub & -z) | z) & 0xFF; - memset(buf + ptr, 0, (sizeof sc->buf) - ptr); - if (ptr > ((sizeof sc->buf) - 18)) { - echo_small_compress(sc); - sc->C0 = sc->C1 = sc->C2 = sc->C3 = 0; - memset(buf, 0, sizeof sc->buf); - } - sph_enc16le(buf + (sizeof sc->buf) - 18, out_size_w32 << 5); - memcpy(buf + (sizeof sc->buf) - 16, u.tmp, 16); - echo_small_compress(sc); -#if SPH_ECHO_64 - for (VV = &sc->u.Vb[0][0], k = 0; k < ((out_size_w32 + 1) >> 1); k ++) - sph_enc64le_aligned(u.tmp + (k << 3), VV[k]); -#else - for (VV = &sc->u.Vs[0][0], k = 0; k < out_size_w32; k ++) - sph_enc32le_aligned(u.tmp + (k << 2), VV[k]); -#endif - memcpy(dst, u.tmp, out_size_w32 << 2); - echo_small_init(sc, out_size_w32 << 5); -} - -static void -echo_big_close(sph_echo_big_context *sc, unsigned ub, unsigned n, - void *dst, unsigned out_size_w32) -{ - unsigned char *buf; - size_t ptr; - unsigned z; - unsigned elen; - union { - unsigned char tmp[64]; - sph_u32 dummy; -#if SPH_ECHO_64 - sph_u64 dummy2; -#endif - } u; -#if SPH_ECHO_64 - sph_u64 *VV; -#else - sph_u32 *VV; -#endif - unsigned k; - - buf = sc->buf; - ptr = sc->ptr; - elen = ((unsigned)ptr << 3) + n; - INCR_COUNTER(sc, elen); - sph_enc32le_aligned(u.tmp, sc->C0); - sph_enc32le_aligned(u.tmp + 4, sc->C1); - sph_enc32le_aligned(u.tmp + 8, sc->C2); - sph_enc32le_aligned(u.tmp + 12, sc->C3); - /* - * If elen is zero, then this block actually contains no message - * bit, only the first padding bit. - */ - if (elen == 0) { - sc->C0 = sc->C1 = sc->C2 = sc->C3 = 0; - } - z = 0x80 >> n; - buf[ptr ++] = ((ub & -z) | z) & 0xFF; - memset(buf + ptr, 0, (sizeof sc->buf) - ptr); - if (ptr > ((sizeof sc->buf) - 18)) { - echo_big_compress(sc); - sc->C0 = sc->C1 = sc->C2 = sc->C3 = 0; - memset(buf, 0, sizeof sc->buf); - } - sph_enc16le(buf + (sizeof sc->buf) - 18, out_size_w32 << 5); - memcpy(buf + (sizeof sc->buf) - 16, u.tmp, 16); - echo_big_compress(sc); -#if SPH_ECHO_64 - for (VV = &sc->u.Vb[0][0], k = 0; k < ((out_size_w32 + 1) >> 1); k ++) - sph_enc64le_aligned(u.tmp + (k << 3), VV[k]); -#else - for (VV = &sc->u.Vs[0][0], k = 0; k < out_size_w32; k ++) - sph_enc32le_aligned(u.tmp + (k << 2), VV[k]); -#endif - memcpy(dst, u.tmp, out_size_w32 << 2); - echo_big_init(sc, out_size_w32 << 5); -} - -/* see sph_echo.h */ -void -sph_echo224_init(void *cc) -{ - echo_small_init(cc, 224); -} - -/* see sph_echo.h */ -void -sph_echo224(void *cc, const void *data, size_t len) -{ - echo_small_core(cc, data, len); -} - -/* see sph_echo.h */ -void -sph_echo224_close(void *cc, void *dst) -{ - echo_small_close(cc, 0, 0, dst, 7); -} - -/* see sph_echo.h */ -void -sph_echo224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - echo_small_close(cc, ub, n, dst, 7); -} - -/* see sph_echo.h */ -void -sph_echo256_init(void *cc) -{ - echo_small_init(cc, 256); -} - -/* see sph_echo.h */ -void -sph_echo256(void *cc, const void *data, size_t len) -{ - echo_small_core(cc, data, len); -} - -/* see sph_echo.h */ -void -sph_echo256_close(void *cc, void *dst) -{ - echo_small_close(cc, 0, 0, dst, 8); -} - -/* see sph_echo.h */ -void -sph_echo256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - echo_small_close(cc, ub, n, dst, 8); -} - -/* see sph_echo.h */ -void -sph_echo384_init(void *cc) -{ - echo_big_init(cc, 384); -} - -/* see sph_echo.h */ -void -sph_echo384(void *cc, const void *data, size_t len) -{ - echo_big_core(cc, data, len); -} - -/* see sph_echo.h */ -void -sph_echo384_close(void *cc, void *dst) -{ - echo_big_close(cc, 0, 0, dst, 12); -} - -/* see sph_echo.h */ -void -sph_echo384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - echo_big_close(cc, ub, n, dst, 12); -} - -/* see sph_echo.h */ -void -sph_echo512_init(void *cc) -{ - echo_big_init(cc, 512); -} - -/* see sph_echo.h */ -void -sph_echo512(void *cc, const void *data, size_t len) -{ - echo_big_core(cc, data, len); -} - -/* see sph_echo.h */ -void -sph_echo512_close(void *cc, void *dst) -{ - echo_big_close(cc, 0, 0, dst, 16); -} - -/* see sph_echo.h */ -void -sph_echo512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - echo_big_close(cc, ub, n, dst, 16); -} -#ifdef __cplusplus -} -#endif diff --git a/sph/fugue.c b/sph/fugue.c deleted file mode 100644 index 85767c98..00000000 --- a/sph/fugue.c +++ /dev/null @@ -1,1208 +0,0 @@ -#include -#include - -#include "sph_fugue.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -static const sph_u32 IV224[] = { - SPH_C32(0xf4c9120d), SPH_C32(0x6286f757), SPH_C32(0xee39e01c), - SPH_C32(0xe074e3cb), SPH_C32(0xa1127c62), SPH_C32(0x9a43d215), - SPH_C32(0xbd8d679a) -}; - -static const sph_u32 IV256[] = { - SPH_C32(0xe952bdde), SPH_C32(0x6671135f), SPH_C32(0xe0d4f668), - SPH_C32(0xd2b0b594), SPH_C32(0xf96c621d), SPH_C32(0xfbf929de), - SPH_C32(0x9149e899), SPH_C32(0x34f8c248) -}; - -static const sph_u32 IV384[] = { - SPH_C32(0xaa61ec0d), SPH_C32(0x31252e1f), SPH_C32(0xa01db4c7), - SPH_C32(0x00600985), SPH_C32(0x215ef44a), SPH_C32(0x741b5e9c), - SPH_C32(0xfa693e9a), SPH_C32(0x473eb040), SPH_C32(0xe502ae8a), - SPH_C32(0xa99c25e0), SPH_C32(0xbc95517c), SPH_C32(0x5c1095a1) -}; - -static const sph_u32 IV512[] = { - SPH_C32(0x8807a57e), SPH_C32(0xe616af75), SPH_C32(0xc5d3e4db), - SPH_C32(0xac9ab027), SPH_C32(0xd915f117), SPH_C32(0xb6eecc54), - SPH_C32(0x06e8020b), SPH_C32(0x4a92efd1), SPH_C32(0xaac6e2c9), - SPH_C32(0xddb21398), SPH_C32(0xcae65838), SPH_C32(0x437f203f), - SPH_C32(0x25ea78e7), SPH_C32(0x951fddd6), SPH_C32(0xda6ed11d), - SPH_C32(0xe13e3567) -}; - -static const sph_u32 mixtab0[] = { - SPH_C32(0x63633297), SPH_C32(0x7c7c6feb), SPH_C32(0x77775ec7), - SPH_C32(0x7b7b7af7), SPH_C32(0xf2f2e8e5), SPH_C32(0x6b6b0ab7), - SPH_C32(0x6f6f16a7), SPH_C32(0xc5c56d39), SPH_C32(0x303090c0), - SPH_C32(0x01010704), SPH_C32(0x67672e87), SPH_C32(0x2b2bd1ac), - SPH_C32(0xfefeccd5), SPH_C32(0xd7d71371), SPH_C32(0xabab7c9a), - SPH_C32(0x767659c3), SPH_C32(0xcaca4005), SPH_C32(0x8282a33e), - SPH_C32(0xc9c94909), SPH_C32(0x7d7d68ef), SPH_C32(0xfafad0c5), - SPH_C32(0x5959947f), SPH_C32(0x4747ce07), SPH_C32(0xf0f0e6ed), - SPH_C32(0xadad6e82), SPH_C32(0xd4d41a7d), SPH_C32(0xa2a243be), - SPH_C32(0xafaf608a), SPH_C32(0x9c9cf946), SPH_C32(0xa4a451a6), - SPH_C32(0x727245d3), SPH_C32(0xc0c0762d), SPH_C32(0xb7b728ea), - SPH_C32(0xfdfdc5d9), SPH_C32(0x9393d47a), SPH_C32(0x2626f298), - SPH_C32(0x363682d8), SPH_C32(0x3f3fbdfc), SPH_C32(0xf7f7f3f1), - SPH_C32(0xcccc521d), SPH_C32(0x34348cd0), SPH_C32(0xa5a556a2), - SPH_C32(0xe5e58db9), SPH_C32(0xf1f1e1e9), SPH_C32(0x71714cdf), - SPH_C32(0xd8d83e4d), SPH_C32(0x313197c4), SPH_C32(0x15156b54), - SPH_C32(0x04041c10), SPH_C32(0xc7c76331), SPH_C32(0x2323e98c), - SPH_C32(0xc3c37f21), SPH_C32(0x18184860), SPH_C32(0x9696cf6e), - SPH_C32(0x05051b14), SPH_C32(0x9a9aeb5e), SPH_C32(0x0707151c), - SPH_C32(0x12127e48), SPH_C32(0x8080ad36), SPH_C32(0xe2e298a5), - SPH_C32(0xebeba781), SPH_C32(0x2727f59c), SPH_C32(0xb2b233fe), - SPH_C32(0x757550cf), SPH_C32(0x09093f24), SPH_C32(0x8383a43a), - SPH_C32(0x2c2cc4b0), SPH_C32(0x1a1a4668), SPH_C32(0x1b1b416c), - SPH_C32(0x6e6e11a3), SPH_C32(0x5a5a9d73), SPH_C32(0xa0a04db6), - SPH_C32(0x5252a553), SPH_C32(0x3b3ba1ec), SPH_C32(0xd6d61475), - SPH_C32(0xb3b334fa), SPH_C32(0x2929dfa4), SPH_C32(0xe3e39fa1), - SPH_C32(0x2f2fcdbc), SPH_C32(0x8484b126), SPH_C32(0x5353a257), - SPH_C32(0xd1d10169), SPH_C32(0x00000000), SPH_C32(0xededb599), - SPH_C32(0x2020e080), SPH_C32(0xfcfcc2dd), SPH_C32(0xb1b13af2), - SPH_C32(0x5b5b9a77), SPH_C32(0x6a6a0db3), SPH_C32(0xcbcb4701), - SPH_C32(0xbebe17ce), SPH_C32(0x3939afe4), SPH_C32(0x4a4aed33), - SPH_C32(0x4c4cff2b), SPH_C32(0x5858937b), SPH_C32(0xcfcf5b11), - SPH_C32(0xd0d0066d), SPH_C32(0xefefbb91), SPH_C32(0xaaaa7b9e), - SPH_C32(0xfbfbd7c1), SPH_C32(0x4343d217), SPH_C32(0x4d4df82f), - SPH_C32(0x333399cc), SPH_C32(0x8585b622), SPH_C32(0x4545c00f), - SPH_C32(0xf9f9d9c9), SPH_C32(0x02020e08), SPH_C32(0x7f7f66e7), - SPH_C32(0x5050ab5b), SPH_C32(0x3c3cb4f0), SPH_C32(0x9f9ff04a), - SPH_C32(0xa8a87596), SPH_C32(0x5151ac5f), SPH_C32(0xa3a344ba), - SPH_C32(0x4040db1b), SPH_C32(0x8f8f800a), SPH_C32(0x9292d37e), - SPH_C32(0x9d9dfe42), SPH_C32(0x3838a8e0), SPH_C32(0xf5f5fdf9), - SPH_C32(0xbcbc19c6), SPH_C32(0xb6b62fee), SPH_C32(0xdada3045), - SPH_C32(0x2121e784), SPH_C32(0x10107040), SPH_C32(0xffffcbd1), - SPH_C32(0xf3f3efe1), SPH_C32(0xd2d20865), SPH_C32(0xcdcd5519), - SPH_C32(0x0c0c2430), SPH_C32(0x1313794c), SPH_C32(0xececb29d), - SPH_C32(0x5f5f8667), SPH_C32(0x9797c86a), SPH_C32(0x4444c70b), - SPH_C32(0x1717655c), SPH_C32(0xc4c46a3d), SPH_C32(0xa7a758aa), - SPH_C32(0x7e7e61e3), SPH_C32(0x3d3db3f4), SPH_C32(0x6464278b), - SPH_C32(0x5d5d886f), SPH_C32(0x19194f64), SPH_C32(0x737342d7), - SPH_C32(0x60603b9b), SPH_C32(0x8181aa32), SPH_C32(0x4f4ff627), - SPH_C32(0xdcdc225d), SPH_C32(0x2222ee88), SPH_C32(0x2a2ad6a8), - SPH_C32(0x9090dd76), SPH_C32(0x88889516), SPH_C32(0x4646c903), - SPH_C32(0xeeeebc95), SPH_C32(0xb8b805d6), SPH_C32(0x14146c50), - SPH_C32(0xdede2c55), SPH_C32(0x5e5e8163), SPH_C32(0x0b0b312c), - SPH_C32(0xdbdb3741), SPH_C32(0xe0e096ad), SPH_C32(0x32329ec8), - SPH_C32(0x3a3aa6e8), SPH_C32(0x0a0a3628), SPH_C32(0x4949e43f), - SPH_C32(0x06061218), SPH_C32(0x2424fc90), SPH_C32(0x5c5c8f6b), - SPH_C32(0xc2c27825), SPH_C32(0xd3d30f61), SPH_C32(0xacac6986), - SPH_C32(0x62623593), SPH_C32(0x9191da72), SPH_C32(0x9595c662), - SPH_C32(0xe4e48abd), SPH_C32(0x797974ff), SPH_C32(0xe7e783b1), - SPH_C32(0xc8c84e0d), SPH_C32(0x373785dc), SPH_C32(0x6d6d18af), - SPH_C32(0x8d8d8e02), SPH_C32(0xd5d51d79), SPH_C32(0x4e4ef123), - SPH_C32(0xa9a97292), SPH_C32(0x6c6c1fab), SPH_C32(0x5656b943), - SPH_C32(0xf4f4fafd), SPH_C32(0xeaeaa085), SPH_C32(0x6565208f), - SPH_C32(0x7a7a7df3), SPH_C32(0xaeae678e), SPH_C32(0x08083820), - SPH_C32(0xbaba0bde), SPH_C32(0x787873fb), SPH_C32(0x2525fb94), - SPH_C32(0x2e2ecab8), SPH_C32(0x1c1c5470), SPH_C32(0xa6a65fae), - SPH_C32(0xb4b421e6), SPH_C32(0xc6c66435), SPH_C32(0xe8e8ae8d), - SPH_C32(0xdddd2559), SPH_C32(0x747457cb), SPH_C32(0x1f1f5d7c), - SPH_C32(0x4b4bea37), SPH_C32(0xbdbd1ec2), SPH_C32(0x8b8b9c1a), - SPH_C32(0x8a8a9b1e), SPH_C32(0x70704bdb), SPH_C32(0x3e3ebaf8), - SPH_C32(0xb5b526e2), SPH_C32(0x66662983), SPH_C32(0x4848e33b), - SPH_C32(0x0303090c), SPH_C32(0xf6f6f4f5), SPH_C32(0x0e0e2a38), - SPH_C32(0x61613c9f), SPH_C32(0x35358bd4), SPH_C32(0x5757be47), - SPH_C32(0xb9b902d2), SPH_C32(0x8686bf2e), SPH_C32(0xc1c17129), - SPH_C32(0x1d1d5374), SPH_C32(0x9e9ef74e), SPH_C32(0xe1e191a9), - SPH_C32(0xf8f8decd), SPH_C32(0x9898e556), SPH_C32(0x11117744), - SPH_C32(0x696904bf), SPH_C32(0xd9d93949), SPH_C32(0x8e8e870e), - SPH_C32(0x9494c166), SPH_C32(0x9b9bec5a), SPH_C32(0x1e1e5a78), - SPH_C32(0x8787b82a), SPH_C32(0xe9e9a989), SPH_C32(0xcece5c15), - SPH_C32(0x5555b04f), SPH_C32(0x2828d8a0), SPH_C32(0xdfdf2b51), - SPH_C32(0x8c8c8906), SPH_C32(0xa1a14ab2), SPH_C32(0x89899212), - SPH_C32(0x0d0d2334), SPH_C32(0xbfbf10ca), SPH_C32(0xe6e684b5), - SPH_C32(0x4242d513), SPH_C32(0x686803bb), SPH_C32(0x4141dc1f), - SPH_C32(0x9999e252), SPH_C32(0x2d2dc3b4), SPH_C32(0x0f0f2d3c), - SPH_C32(0xb0b03df6), SPH_C32(0x5454b74b), SPH_C32(0xbbbb0cda), - SPH_C32(0x16166258) -}; - -static const sph_u32 mixtab1[] = { - SPH_C32(0x97636332), SPH_C32(0xeb7c7c6f), SPH_C32(0xc777775e), - SPH_C32(0xf77b7b7a), SPH_C32(0xe5f2f2e8), SPH_C32(0xb76b6b0a), - SPH_C32(0xa76f6f16), SPH_C32(0x39c5c56d), SPH_C32(0xc0303090), - SPH_C32(0x04010107), SPH_C32(0x8767672e), SPH_C32(0xac2b2bd1), - SPH_C32(0xd5fefecc), SPH_C32(0x71d7d713), SPH_C32(0x9aabab7c), - SPH_C32(0xc3767659), SPH_C32(0x05caca40), SPH_C32(0x3e8282a3), - SPH_C32(0x09c9c949), SPH_C32(0xef7d7d68), SPH_C32(0xc5fafad0), - SPH_C32(0x7f595994), SPH_C32(0x074747ce), SPH_C32(0xedf0f0e6), - SPH_C32(0x82adad6e), SPH_C32(0x7dd4d41a), SPH_C32(0xbea2a243), - SPH_C32(0x8aafaf60), SPH_C32(0x469c9cf9), SPH_C32(0xa6a4a451), - SPH_C32(0xd3727245), SPH_C32(0x2dc0c076), SPH_C32(0xeab7b728), - SPH_C32(0xd9fdfdc5), SPH_C32(0x7a9393d4), SPH_C32(0x982626f2), - SPH_C32(0xd8363682), SPH_C32(0xfc3f3fbd), SPH_C32(0xf1f7f7f3), - SPH_C32(0x1dcccc52), SPH_C32(0xd034348c), SPH_C32(0xa2a5a556), - SPH_C32(0xb9e5e58d), SPH_C32(0xe9f1f1e1), SPH_C32(0xdf71714c), - SPH_C32(0x4dd8d83e), SPH_C32(0xc4313197), SPH_C32(0x5415156b), - SPH_C32(0x1004041c), SPH_C32(0x31c7c763), SPH_C32(0x8c2323e9), - SPH_C32(0x21c3c37f), SPH_C32(0x60181848), SPH_C32(0x6e9696cf), - SPH_C32(0x1405051b), SPH_C32(0x5e9a9aeb), SPH_C32(0x1c070715), - SPH_C32(0x4812127e), SPH_C32(0x368080ad), SPH_C32(0xa5e2e298), - SPH_C32(0x81ebeba7), SPH_C32(0x9c2727f5), SPH_C32(0xfeb2b233), - SPH_C32(0xcf757550), SPH_C32(0x2409093f), SPH_C32(0x3a8383a4), - SPH_C32(0xb02c2cc4), SPH_C32(0x681a1a46), SPH_C32(0x6c1b1b41), - SPH_C32(0xa36e6e11), SPH_C32(0x735a5a9d), SPH_C32(0xb6a0a04d), - SPH_C32(0x535252a5), SPH_C32(0xec3b3ba1), SPH_C32(0x75d6d614), - SPH_C32(0xfab3b334), SPH_C32(0xa42929df), SPH_C32(0xa1e3e39f), - SPH_C32(0xbc2f2fcd), SPH_C32(0x268484b1), SPH_C32(0x575353a2), - SPH_C32(0x69d1d101), SPH_C32(0x00000000), SPH_C32(0x99ededb5), - SPH_C32(0x802020e0), SPH_C32(0xddfcfcc2), SPH_C32(0xf2b1b13a), - SPH_C32(0x775b5b9a), SPH_C32(0xb36a6a0d), SPH_C32(0x01cbcb47), - SPH_C32(0xcebebe17), SPH_C32(0xe43939af), SPH_C32(0x334a4aed), - SPH_C32(0x2b4c4cff), SPH_C32(0x7b585893), SPH_C32(0x11cfcf5b), - SPH_C32(0x6dd0d006), SPH_C32(0x91efefbb), SPH_C32(0x9eaaaa7b), - SPH_C32(0xc1fbfbd7), SPH_C32(0x174343d2), SPH_C32(0x2f4d4df8), - SPH_C32(0xcc333399), SPH_C32(0x228585b6), SPH_C32(0x0f4545c0), - SPH_C32(0xc9f9f9d9), SPH_C32(0x0802020e), SPH_C32(0xe77f7f66), - SPH_C32(0x5b5050ab), SPH_C32(0xf03c3cb4), SPH_C32(0x4a9f9ff0), - SPH_C32(0x96a8a875), SPH_C32(0x5f5151ac), SPH_C32(0xbaa3a344), - SPH_C32(0x1b4040db), SPH_C32(0x0a8f8f80), SPH_C32(0x7e9292d3), - SPH_C32(0x429d9dfe), SPH_C32(0xe03838a8), SPH_C32(0xf9f5f5fd), - SPH_C32(0xc6bcbc19), SPH_C32(0xeeb6b62f), SPH_C32(0x45dada30), - SPH_C32(0x842121e7), SPH_C32(0x40101070), SPH_C32(0xd1ffffcb), - SPH_C32(0xe1f3f3ef), SPH_C32(0x65d2d208), SPH_C32(0x19cdcd55), - SPH_C32(0x300c0c24), SPH_C32(0x4c131379), SPH_C32(0x9dececb2), - SPH_C32(0x675f5f86), SPH_C32(0x6a9797c8), SPH_C32(0x0b4444c7), - SPH_C32(0x5c171765), SPH_C32(0x3dc4c46a), SPH_C32(0xaaa7a758), - SPH_C32(0xe37e7e61), SPH_C32(0xf43d3db3), SPH_C32(0x8b646427), - SPH_C32(0x6f5d5d88), SPH_C32(0x6419194f), SPH_C32(0xd7737342), - SPH_C32(0x9b60603b), SPH_C32(0x328181aa), SPH_C32(0x274f4ff6), - SPH_C32(0x5ddcdc22), SPH_C32(0x882222ee), SPH_C32(0xa82a2ad6), - SPH_C32(0x769090dd), SPH_C32(0x16888895), SPH_C32(0x034646c9), - SPH_C32(0x95eeeebc), SPH_C32(0xd6b8b805), SPH_C32(0x5014146c), - SPH_C32(0x55dede2c), SPH_C32(0x635e5e81), SPH_C32(0x2c0b0b31), - SPH_C32(0x41dbdb37), SPH_C32(0xade0e096), SPH_C32(0xc832329e), - SPH_C32(0xe83a3aa6), SPH_C32(0x280a0a36), SPH_C32(0x3f4949e4), - SPH_C32(0x18060612), SPH_C32(0x902424fc), SPH_C32(0x6b5c5c8f), - SPH_C32(0x25c2c278), SPH_C32(0x61d3d30f), SPH_C32(0x86acac69), - SPH_C32(0x93626235), SPH_C32(0x729191da), SPH_C32(0x629595c6), - SPH_C32(0xbde4e48a), SPH_C32(0xff797974), SPH_C32(0xb1e7e783), - SPH_C32(0x0dc8c84e), SPH_C32(0xdc373785), SPH_C32(0xaf6d6d18), - SPH_C32(0x028d8d8e), SPH_C32(0x79d5d51d), SPH_C32(0x234e4ef1), - SPH_C32(0x92a9a972), SPH_C32(0xab6c6c1f), SPH_C32(0x435656b9), - SPH_C32(0xfdf4f4fa), SPH_C32(0x85eaeaa0), SPH_C32(0x8f656520), - SPH_C32(0xf37a7a7d), SPH_C32(0x8eaeae67), SPH_C32(0x20080838), - SPH_C32(0xdebaba0b), SPH_C32(0xfb787873), SPH_C32(0x942525fb), - SPH_C32(0xb82e2eca), SPH_C32(0x701c1c54), SPH_C32(0xaea6a65f), - SPH_C32(0xe6b4b421), SPH_C32(0x35c6c664), SPH_C32(0x8de8e8ae), - SPH_C32(0x59dddd25), SPH_C32(0xcb747457), SPH_C32(0x7c1f1f5d), - SPH_C32(0x374b4bea), SPH_C32(0xc2bdbd1e), SPH_C32(0x1a8b8b9c), - SPH_C32(0x1e8a8a9b), SPH_C32(0xdb70704b), SPH_C32(0xf83e3eba), - SPH_C32(0xe2b5b526), SPH_C32(0x83666629), SPH_C32(0x3b4848e3), - SPH_C32(0x0c030309), SPH_C32(0xf5f6f6f4), SPH_C32(0x380e0e2a), - SPH_C32(0x9f61613c), SPH_C32(0xd435358b), SPH_C32(0x475757be), - SPH_C32(0xd2b9b902), SPH_C32(0x2e8686bf), SPH_C32(0x29c1c171), - SPH_C32(0x741d1d53), SPH_C32(0x4e9e9ef7), SPH_C32(0xa9e1e191), - SPH_C32(0xcdf8f8de), SPH_C32(0x569898e5), SPH_C32(0x44111177), - SPH_C32(0xbf696904), SPH_C32(0x49d9d939), SPH_C32(0x0e8e8e87), - SPH_C32(0x669494c1), SPH_C32(0x5a9b9bec), SPH_C32(0x781e1e5a), - SPH_C32(0x2a8787b8), SPH_C32(0x89e9e9a9), SPH_C32(0x15cece5c), - SPH_C32(0x4f5555b0), SPH_C32(0xa02828d8), SPH_C32(0x51dfdf2b), - SPH_C32(0x068c8c89), SPH_C32(0xb2a1a14a), SPH_C32(0x12898992), - SPH_C32(0x340d0d23), SPH_C32(0xcabfbf10), SPH_C32(0xb5e6e684), - SPH_C32(0x134242d5), SPH_C32(0xbb686803), SPH_C32(0x1f4141dc), - SPH_C32(0x529999e2), SPH_C32(0xb42d2dc3), SPH_C32(0x3c0f0f2d), - SPH_C32(0xf6b0b03d), SPH_C32(0x4b5454b7), SPH_C32(0xdabbbb0c), - SPH_C32(0x58161662) -}; - -static const sph_u32 mixtab2[] = { - SPH_C32(0x32976363), SPH_C32(0x6feb7c7c), SPH_C32(0x5ec77777), - SPH_C32(0x7af77b7b), SPH_C32(0xe8e5f2f2), SPH_C32(0x0ab76b6b), - SPH_C32(0x16a76f6f), SPH_C32(0x6d39c5c5), SPH_C32(0x90c03030), - SPH_C32(0x07040101), SPH_C32(0x2e876767), SPH_C32(0xd1ac2b2b), - SPH_C32(0xccd5fefe), SPH_C32(0x1371d7d7), SPH_C32(0x7c9aabab), - SPH_C32(0x59c37676), SPH_C32(0x4005caca), SPH_C32(0xa33e8282), - SPH_C32(0x4909c9c9), SPH_C32(0x68ef7d7d), SPH_C32(0xd0c5fafa), - SPH_C32(0x947f5959), SPH_C32(0xce074747), SPH_C32(0xe6edf0f0), - SPH_C32(0x6e82adad), SPH_C32(0x1a7dd4d4), SPH_C32(0x43bea2a2), - SPH_C32(0x608aafaf), SPH_C32(0xf9469c9c), SPH_C32(0x51a6a4a4), - SPH_C32(0x45d37272), SPH_C32(0x762dc0c0), SPH_C32(0x28eab7b7), - SPH_C32(0xc5d9fdfd), SPH_C32(0xd47a9393), SPH_C32(0xf2982626), - SPH_C32(0x82d83636), SPH_C32(0xbdfc3f3f), SPH_C32(0xf3f1f7f7), - SPH_C32(0x521dcccc), SPH_C32(0x8cd03434), SPH_C32(0x56a2a5a5), - SPH_C32(0x8db9e5e5), SPH_C32(0xe1e9f1f1), SPH_C32(0x4cdf7171), - SPH_C32(0x3e4dd8d8), SPH_C32(0x97c43131), SPH_C32(0x6b541515), - SPH_C32(0x1c100404), SPH_C32(0x6331c7c7), SPH_C32(0xe98c2323), - SPH_C32(0x7f21c3c3), SPH_C32(0x48601818), SPH_C32(0xcf6e9696), - SPH_C32(0x1b140505), SPH_C32(0xeb5e9a9a), SPH_C32(0x151c0707), - SPH_C32(0x7e481212), SPH_C32(0xad368080), SPH_C32(0x98a5e2e2), - SPH_C32(0xa781ebeb), SPH_C32(0xf59c2727), SPH_C32(0x33feb2b2), - SPH_C32(0x50cf7575), SPH_C32(0x3f240909), SPH_C32(0xa43a8383), - SPH_C32(0xc4b02c2c), SPH_C32(0x46681a1a), SPH_C32(0x416c1b1b), - SPH_C32(0x11a36e6e), SPH_C32(0x9d735a5a), SPH_C32(0x4db6a0a0), - SPH_C32(0xa5535252), SPH_C32(0xa1ec3b3b), SPH_C32(0x1475d6d6), - SPH_C32(0x34fab3b3), SPH_C32(0xdfa42929), SPH_C32(0x9fa1e3e3), - SPH_C32(0xcdbc2f2f), SPH_C32(0xb1268484), SPH_C32(0xa2575353), - SPH_C32(0x0169d1d1), SPH_C32(0x00000000), SPH_C32(0xb599eded), - SPH_C32(0xe0802020), SPH_C32(0xc2ddfcfc), SPH_C32(0x3af2b1b1), - SPH_C32(0x9a775b5b), SPH_C32(0x0db36a6a), SPH_C32(0x4701cbcb), - SPH_C32(0x17cebebe), SPH_C32(0xafe43939), SPH_C32(0xed334a4a), - SPH_C32(0xff2b4c4c), SPH_C32(0x937b5858), SPH_C32(0x5b11cfcf), - SPH_C32(0x066dd0d0), SPH_C32(0xbb91efef), SPH_C32(0x7b9eaaaa), - SPH_C32(0xd7c1fbfb), SPH_C32(0xd2174343), SPH_C32(0xf82f4d4d), - SPH_C32(0x99cc3333), SPH_C32(0xb6228585), SPH_C32(0xc00f4545), - SPH_C32(0xd9c9f9f9), SPH_C32(0x0e080202), SPH_C32(0x66e77f7f), - SPH_C32(0xab5b5050), SPH_C32(0xb4f03c3c), SPH_C32(0xf04a9f9f), - SPH_C32(0x7596a8a8), SPH_C32(0xac5f5151), SPH_C32(0x44baa3a3), - SPH_C32(0xdb1b4040), SPH_C32(0x800a8f8f), SPH_C32(0xd37e9292), - SPH_C32(0xfe429d9d), SPH_C32(0xa8e03838), SPH_C32(0xfdf9f5f5), - SPH_C32(0x19c6bcbc), SPH_C32(0x2feeb6b6), SPH_C32(0x3045dada), - SPH_C32(0xe7842121), SPH_C32(0x70401010), SPH_C32(0xcbd1ffff), - SPH_C32(0xefe1f3f3), SPH_C32(0x0865d2d2), SPH_C32(0x5519cdcd), - SPH_C32(0x24300c0c), SPH_C32(0x794c1313), SPH_C32(0xb29decec), - SPH_C32(0x86675f5f), SPH_C32(0xc86a9797), SPH_C32(0xc70b4444), - SPH_C32(0x655c1717), SPH_C32(0x6a3dc4c4), SPH_C32(0x58aaa7a7), - SPH_C32(0x61e37e7e), SPH_C32(0xb3f43d3d), SPH_C32(0x278b6464), - SPH_C32(0x886f5d5d), SPH_C32(0x4f641919), SPH_C32(0x42d77373), - SPH_C32(0x3b9b6060), SPH_C32(0xaa328181), SPH_C32(0xf6274f4f), - SPH_C32(0x225ddcdc), SPH_C32(0xee882222), SPH_C32(0xd6a82a2a), - SPH_C32(0xdd769090), SPH_C32(0x95168888), SPH_C32(0xc9034646), - SPH_C32(0xbc95eeee), SPH_C32(0x05d6b8b8), SPH_C32(0x6c501414), - SPH_C32(0x2c55dede), SPH_C32(0x81635e5e), SPH_C32(0x312c0b0b), - SPH_C32(0x3741dbdb), SPH_C32(0x96ade0e0), SPH_C32(0x9ec83232), - SPH_C32(0xa6e83a3a), SPH_C32(0x36280a0a), SPH_C32(0xe43f4949), - SPH_C32(0x12180606), SPH_C32(0xfc902424), SPH_C32(0x8f6b5c5c), - SPH_C32(0x7825c2c2), SPH_C32(0x0f61d3d3), SPH_C32(0x6986acac), - SPH_C32(0x35936262), SPH_C32(0xda729191), SPH_C32(0xc6629595), - SPH_C32(0x8abde4e4), SPH_C32(0x74ff7979), SPH_C32(0x83b1e7e7), - SPH_C32(0x4e0dc8c8), SPH_C32(0x85dc3737), SPH_C32(0x18af6d6d), - SPH_C32(0x8e028d8d), SPH_C32(0x1d79d5d5), SPH_C32(0xf1234e4e), - SPH_C32(0x7292a9a9), SPH_C32(0x1fab6c6c), SPH_C32(0xb9435656), - SPH_C32(0xfafdf4f4), SPH_C32(0xa085eaea), SPH_C32(0x208f6565), - SPH_C32(0x7df37a7a), SPH_C32(0x678eaeae), SPH_C32(0x38200808), - SPH_C32(0x0bdebaba), SPH_C32(0x73fb7878), SPH_C32(0xfb942525), - SPH_C32(0xcab82e2e), SPH_C32(0x54701c1c), SPH_C32(0x5faea6a6), - SPH_C32(0x21e6b4b4), SPH_C32(0x6435c6c6), SPH_C32(0xae8de8e8), - SPH_C32(0x2559dddd), SPH_C32(0x57cb7474), SPH_C32(0x5d7c1f1f), - SPH_C32(0xea374b4b), SPH_C32(0x1ec2bdbd), SPH_C32(0x9c1a8b8b), - SPH_C32(0x9b1e8a8a), SPH_C32(0x4bdb7070), SPH_C32(0xbaf83e3e), - SPH_C32(0x26e2b5b5), SPH_C32(0x29836666), SPH_C32(0xe33b4848), - SPH_C32(0x090c0303), SPH_C32(0xf4f5f6f6), SPH_C32(0x2a380e0e), - SPH_C32(0x3c9f6161), SPH_C32(0x8bd43535), SPH_C32(0xbe475757), - SPH_C32(0x02d2b9b9), SPH_C32(0xbf2e8686), SPH_C32(0x7129c1c1), - SPH_C32(0x53741d1d), SPH_C32(0xf74e9e9e), SPH_C32(0x91a9e1e1), - SPH_C32(0xdecdf8f8), SPH_C32(0xe5569898), SPH_C32(0x77441111), - SPH_C32(0x04bf6969), SPH_C32(0x3949d9d9), SPH_C32(0x870e8e8e), - SPH_C32(0xc1669494), SPH_C32(0xec5a9b9b), SPH_C32(0x5a781e1e), - SPH_C32(0xb82a8787), SPH_C32(0xa989e9e9), SPH_C32(0x5c15cece), - SPH_C32(0xb04f5555), SPH_C32(0xd8a02828), SPH_C32(0x2b51dfdf), - SPH_C32(0x89068c8c), SPH_C32(0x4ab2a1a1), SPH_C32(0x92128989), - SPH_C32(0x23340d0d), SPH_C32(0x10cabfbf), SPH_C32(0x84b5e6e6), - SPH_C32(0xd5134242), SPH_C32(0x03bb6868), SPH_C32(0xdc1f4141), - SPH_C32(0xe2529999), SPH_C32(0xc3b42d2d), SPH_C32(0x2d3c0f0f), - SPH_C32(0x3df6b0b0), SPH_C32(0xb74b5454), SPH_C32(0x0cdabbbb), - SPH_C32(0x62581616) -}; - -static const sph_u32 mixtab3[] = { - SPH_C32(0x63329763), SPH_C32(0x7c6feb7c), SPH_C32(0x775ec777), - SPH_C32(0x7b7af77b), SPH_C32(0xf2e8e5f2), SPH_C32(0x6b0ab76b), - SPH_C32(0x6f16a76f), SPH_C32(0xc56d39c5), SPH_C32(0x3090c030), - SPH_C32(0x01070401), SPH_C32(0x672e8767), SPH_C32(0x2bd1ac2b), - SPH_C32(0xfeccd5fe), SPH_C32(0xd71371d7), SPH_C32(0xab7c9aab), - SPH_C32(0x7659c376), SPH_C32(0xca4005ca), SPH_C32(0x82a33e82), - SPH_C32(0xc94909c9), SPH_C32(0x7d68ef7d), SPH_C32(0xfad0c5fa), - SPH_C32(0x59947f59), SPH_C32(0x47ce0747), SPH_C32(0xf0e6edf0), - SPH_C32(0xad6e82ad), SPH_C32(0xd41a7dd4), SPH_C32(0xa243bea2), - SPH_C32(0xaf608aaf), SPH_C32(0x9cf9469c), SPH_C32(0xa451a6a4), - SPH_C32(0x7245d372), SPH_C32(0xc0762dc0), SPH_C32(0xb728eab7), - SPH_C32(0xfdc5d9fd), SPH_C32(0x93d47a93), SPH_C32(0x26f29826), - SPH_C32(0x3682d836), SPH_C32(0x3fbdfc3f), SPH_C32(0xf7f3f1f7), - SPH_C32(0xcc521dcc), SPH_C32(0x348cd034), SPH_C32(0xa556a2a5), - SPH_C32(0xe58db9e5), SPH_C32(0xf1e1e9f1), SPH_C32(0x714cdf71), - SPH_C32(0xd83e4dd8), SPH_C32(0x3197c431), SPH_C32(0x156b5415), - SPH_C32(0x041c1004), SPH_C32(0xc76331c7), SPH_C32(0x23e98c23), - SPH_C32(0xc37f21c3), SPH_C32(0x18486018), SPH_C32(0x96cf6e96), - SPH_C32(0x051b1405), SPH_C32(0x9aeb5e9a), SPH_C32(0x07151c07), - SPH_C32(0x127e4812), SPH_C32(0x80ad3680), SPH_C32(0xe298a5e2), - SPH_C32(0xeba781eb), SPH_C32(0x27f59c27), SPH_C32(0xb233feb2), - SPH_C32(0x7550cf75), SPH_C32(0x093f2409), SPH_C32(0x83a43a83), - SPH_C32(0x2cc4b02c), SPH_C32(0x1a46681a), SPH_C32(0x1b416c1b), - SPH_C32(0x6e11a36e), SPH_C32(0x5a9d735a), SPH_C32(0xa04db6a0), - SPH_C32(0x52a55352), SPH_C32(0x3ba1ec3b), SPH_C32(0xd61475d6), - SPH_C32(0xb334fab3), SPH_C32(0x29dfa429), SPH_C32(0xe39fa1e3), - SPH_C32(0x2fcdbc2f), SPH_C32(0x84b12684), SPH_C32(0x53a25753), - SPH_C32(0xd10169d1), SPH_C32(0x00000000), SPH_C32(0xedb599ed), - SPH_C32(0x20e08020), SPH_C32(0xfcc2ddfc), SPH_C32(0xb13af2b1), - SPH_C32(0x5b9a775b), SPH_C32(0x6a0db36a), SPH_C32(0xcb4701cb), - SPH_C32(0xbe17cebe), SPH_C32(0x39afe439), SPH_C32(0x4aed334a), - SPH_C32(0x4cff2b4c), SPH_C32(0x58937b58), SPH_C32(0xcf5b11cf), - SPH_C32(0xd0066dd0), SPH_C32(0xefbb91ef), SPH_C32(0xaa7b9eaa), - SPH_C32(0xfbd7c1fb), SPH_C32(0x43d21743), SPH_C32(0x4df82f4d), - SPH_C32(0x3399cc33), SPH_C32(0x85b62285), SPH_C32(0x45c00f45), - SPH_C32(0xf9d9c9f9), SPH_C32(0x020e0802), SPH_C32(0x7f66e77f), - SPH_C32(0x50ab5b50), SPH_C32(0x3cb4f03c), SPH_C32(0x9ff04a9f), - SPH_C32(0xa87596a8), SPH_C32(0x51ac5f51), SPH_C32(0xa344baa3), - SPH_C32(0x40db1b40), SPH_C32(0x8f800a8f), SPH_C32(0x92d37e92), - SPH_C32(0x9dfe429d), SPH_C32(0x38a8e038), SPH_C32(0xf5fdf9f5), - SPH_C32(0xbc19c6bc), SPH_C32(0xb62feeb6), SPH_C32(0xda3045da), - SPH_C32(0x21e78421), SPH_C32(0x10704010), SPH_C32(0xffcbd1ff), - SPH_C32(0xf3efe1f3), SPH_C32(0xd20865d2), SPH_C32(0xcd5519cd), - SPH_C32(0x0c24300c), SPH_C32(0x13794c13), SPH_C32(0xecb29dec), - SPH_C32(0x5f86675f), SPH_C32(0x97c86a97), SPH_C32(0x44c70b44), - SPH_C32(0x17655c17), SPH_C32(0xc46a3dc4), SPH_C32(0xa758aaa7), - SPH_C32(0x7e61e37e), SPH_C32(0x3db3f43d), SPH_C32(0x64278b64), - SPH_C32(0x5d886f5d), SPH_C32(0x194f6419), SPH_C32(0x7342d773), - SPH_C32(0x603b9b60), SPH_C32(0x81aa3281), SPH_C32(0x4ff6274f), - SPH_C32(0xdc225ddc), SPH_C32(0x22ee8822), SPH_C32(0x2ad6a82a), - SPH_C32(0x90dd7690), SPH_C32(0x88951688), SPH_C32(0x46c90346), - SPH_C32(0xeebc95ee), SPH_C32(0xb805d6b8), SPH_C32(0x146c5014), - SPH_C32(0xde2c55de), SPH_C32(0x5e81635e), SPH_C32(0x0b312c0b), - SPH_C32(0xdb3741db), SPH_C32(0xe096ade0), SPH_C32(0x329ec832), - SPH_C32(0x3aa6e83a), SPH_C32(0x0a36280a), SPH_C32(0x49e43f49), - SPH_C32(0x06121806), SPH_C32(0x24fc9024), SPH_C32(0x5c8f6b5c), - SPH_C32(0xc27825c2), SPH_C32(0xd30f61d3), SPH_C32(0xac6986ac), - SPH_C32(0x62359362), SPH_C32(0x91da7291), SPH_C32(0x95c66295), - SPH_C32(0xe48abde4), SPH_C32(0x7974ff79), SPH_C32(0xe783b1e7), - SPH_C32(0xc84e0dc8), SPH_C32(0x3785dc37), SPH_C32(0x6d18af6d), - SPH_C32(0x8d8e028d), SPH_C32(0xd51d79d5), SPH_C32(0x4ef1234e), - SPH_C32(0xa97292a9), SPH_C32(0x6c1fab6c), SPH_C32(0x56b94356), - SPH_C32(0xf4fafdf4), SPH_C32(0xeaa085ea), SPH_C32(0x65208f65), - SPH_C32(0x7a7df37a), SPH_C32(0xae678eae), SPH_C32(0x08382008), - SPH_C32(0xba0bdeba), SPH_C32(0x7873fb78), SPH_C32(0x25fb9425), - SPH_C32(0x2ecab82e), SPH_C32(0x1c54701c), SPH_C32(0xa65faea6), - SPH_C32(0xb421e6b4), SPH_C32(0xc66435c6), SPH_C32(0xe8ae8de8), - SPH_C32(0xdd2559dd), SPH_C32(0x7457cb74), SPH_C32(0x1f5d7c1f), - SPH_C32(0x4bea374b), SPH_C32(0xbd1ec2bd), SPH_C32(0x8b9c1a8b), - SPH_C32(0x8a9b1e8a), SPH_C32(0x704bdb70), SPH_C32(0x3ebaf83e), - SPH_C32(0xb526e2b5), SPH_C32(0x66298366), SPH_C32(0x48e33b48), - SPH_C32(0x03090c03), SPH_C32(0xf6f4f5f6), SPH_C32(0x0e2a380e), - SPH_C32(0x613c9f61), SPH_C32(0x358bd435), SPH_C32(0x57be4757), - SPH_C32(0xb902d2b9), SPH_C32(0x86bf2e86), SPH_C32(0xc17129c1), - SPH_C32(0x1d53741d), SPH_C32(0x9ef74e9e), SPH_C32(0xe191a9e1), - SPH_C32(0xf8decdf8), SPH_C32(0x98e55698), SPH_C32(0x11774411), - SPH_C32(0x6904bf69), SPH_C32(0xd93949d9), SPH_C32(0x8e870e8e), - SPH_C32(0x94c16694), SPH_C32(0x9bec5a9b), SPH_C32(0x1e5a781e), - SPH_C32(0x87b82a87), SPH_C32(0xe9a989e9), SPH_C32(0xce5c15ce), - SPH_C32(0x55b04f55), SPH_C32(0x28d8a028), SPH_C32(0xdf2b51df), - SPH_C32(0x8c89068c), SPH_C32(0xa14ab2a1), SPH_C32(0x89921289), - SPH_C32(0x0d23340d), SPH_C32(0xbf10cabf), SPH_C32(0xe684b5e6), - SPH_C32(0x42d51342), SPH_C32(0x6803bb68), SPH_C32(0x41dc1f41), - SPH_C32(0x99e25299), SPH_C32(0x2dc3b42d), SPH_C32(0x0f2d3c0f), - SPH_C32(0xb03df6b0), SPH_C32(0x54b74b54), SPH_C32(0xbb0cdabb), - SPH_C32(0x16625816) -}; - -#define TIX2(q, x00, x01, x08, x10, x24) do { \ - x10 ^= x00; \ - x00 = (q); \ - x08 ^= x00; \ - x01 ^= x24; \ - } while (0) - -#define TIX3(q, x00, x01, x04, x08, x16, x27, x30) do { \ - x16 ^= x00; \ - x00 = (q); \ - x08 ^= x00; \ - x01 ^= x27; \ - x04 ^= x30; \ - } while (0) - -#define TIX4(q, x00, x01, x04, x07, x08, x22, x24, x27, x30) do { \ - x22 ^= x00; \ - x00 = (q); \ - x08 ^= x00; \ - x01 ^= x24; \ - x04 ^= x27; \ - x07 ^= x30; \ - } while (0) - -#define CMIX30(x00, x01, x02, x04, x05, x06, x15, x16, x17) do { \ - x00 ^= x04; \ - x01 ^= x05; \ - x02 ^= x06; \ - x15 ^= x04; \ - x16 ^= x05; \ - x17 ^= x06; \ - } while (0) - -#define CMIX36(x00, x01, x02, x04, x05, x06, x18, x19, x20) do { \ - x00 ^= x04; \ - x01 ^= x05; \ - x02 ^= x06; \ - x18 ^= x04; \ - x19 ^= x05; \ - x20 ^= x06; \ - } while (0) - -#define SMIX(x0, x1, x2, x3) do { \ - sph_u32 c0 = 0; \ - sph_u32 c1 = 0; \ - sph_u32 c2 = 0; \ - sph_u32 c3 = 0; \ - sph_u32 r0 = 0; \ - sph_u32 r1 = 0; \ - sph_u32 r2 = 0; \ - sph_u32 r3 = 0; \ - sph_u32 tmp; \ - tmp = mixtab0[x0 >> 24]; \ - c0 ^= tmp; \ - tmp = mixtab1[(x0 >> 16) & 0xFF]; \ - c0 ^= tmp; \ - r1 ^= tmp; \ - tmp = mixtab2[(x0 >> 8) & 0xFF]; \ - c0 ^= tmp; \ - r2 ^= tmp; \ - tmp = mixtab3[x0 & 0xFF]; \ - c0 ^= tmp; \ - r3 ^= tmp; \ - tmp = mixtab0[x1 >> 24]; \ - c1 ^= tmp; \ - r0 ^= tmp; \ - tmp = mixtab1[(x1 >> 16) & 0xFF]; \ - c1 ^= tmp; \ - tmp = mixtab2[(x1 >> 8) & 0xFF]; \ - c1 ^= tmp; \ - r2 ^= tmp; \ - tmp = mixtab3[x1 & 0xFF]; \ - c1 ^= tmp; \ - r3 ^= tmp; \ - tmp = mixtab0[x2 >> 24]; \ - c2 ^= tmp; \ - r0 ^= tmp; \ - tmp = mixtab1[(x2 >> 16) & 0xFF]; \ - c2 ^= tmp; \ - r1 ^= tmp; \ - tmp = mixtab2[(x2 >> 8) & 0xFF]; \ - c2 ^= tmp; \ - tmp = mixtab3[x2 & 0xFF]; \ - c2 ^= tmp; \ - r3 ^= tmp; \ - tmp = mixtab0[x3 >> 24]; \ - c3 ^= tmp; \ - r0 ^= tmp; \ - tmp = mixtab1[(x3 >> 16) & 0xFF]; \ - c3 ^= tmp; \ - r1 ^= tmp; \ - tmp = mixtab2[(x3 >> 8) & 0xFF]; \ - c3 ^= tmp; \ - r2 ^= tmp; \ - tmp = mixtab3[x3 & 0xFF]; \ - c3 ^= tmp; \ - x0 = ((c0 ^ r0) & SPH_C32(0xFF000000)) \ - | ((c1 ^ r1) & SPH_C32(0x00FF0000)) \ - | ((c2 ^ r2) & SPH_C32(0x0000FF00)) \ - | ((c3 ^ r3) & SPH_C32(0x000000FF)); \ - x1 = ((c1 ^ (r0 << 8)) & SPH_C32(0xFF000000)) \ - | ((c2 ^ (r1 << 8)) & SPH_C32(0x00FF0000)) \ - | ((c3 ^ (r2 << 8)) & SPH_C32(0x0000FF00)) \ - | ((c0 ^ (r3 >> 24)) & SPH_C32(0x000000FF)); \ - x2 = ((c2 ^ (r0 << 16)) & SPH_C32(0xFF000000)) \ - | ((c3 ^ (r1 << 16)) & SPH_C32(0x00FF0000)) \ - | ((c0 ^ (r2 >> 16)) & SPH_C32(0x0000FF00)) \ - | ((c1 ^ (r3 >> 16)) & SPH_C32(0x000000FF)); \ - x3 = ((c3 ^ (r0 << 24)) & SPH_C32(0xFF000000)) \ - | ((c0 ^ (r1 >> 8)) & SPH_C32(0x00FF0000)) \ - | ((c1 ^ (r2 >> 8)) & SPH_C32(0x0000FF00)) \ - | ((c2 ^ (r3 >> 8)) & SPH_C32(0x000000FF)); \ - /* */ \ - } while (0) - -#if SPH_FUGUE_NOCOPY - -#define DECL_STATE_SMALL -#define READ_STATE_SMALL(state) -#define WRITE_STATE_SMALL(state) -#define DECL_STATE_BIG -#define READ_STATE_BIG(state) -#define WRITE_STATE_BIG(state) - -#define S00 ((sc)->S[ 0]) -#define S01 ((sc)->S[ 1]) -#define S02 ((sc)->S[ 2]) -#define S03 ((sc)->S[ 3]) -#define S04 ((sc)->S[ 4]) -#define S05 ((sc)->S[ 5]) -#define S06 ((sc)->S[ 6]) -#define S07 ((sc)->S[ 7]) -#define S08 ((sc)->S[ 8]) -#define S09 ((sc)->S[ 9]) -#define S10 ((sc)->S[10]) -#define S11 ((sc)->S[11]) -#define S12 ((sc)->S[12]) -#define S13 ((sc)->S[13]) -#define S14 ((sc)->S[14]) -#define S15 ((sc)->S[15]) -#define S16 ((sc)->S[16]) -#define S17 ((sc)->S[17]) -#define S18 ((sc)->S[18]) -#define S19 ((sc)->S[19]) -#define S20 ((sc)->S[20]) -#define S21 ((sc)->S[21]) -#define S22 ((sc)->S[22]) -#define S23 ((sc)->S[23]) -#define S24 ((sc)->S[24]) -#define S25 ((sc)->S[25]) -#define S26 ((sc)->S[26]) -#define S27 ((sc)->S[27]) -#define S28 ((sc)->S[28]) -#define S29 ((sc)->S[29]) -#define S30 ((sc)->S[30]) -#define S31 ((sc)->S[31]) -#define S32 ((sc)->S[32]) -#define S33 ((sc)->S[33]) -#define S34 ((sc)->S[34]) -#define S35 ((sc)->S[35]) - -#else - -#define DECL_STATE_SMALL \ - sph_u32 S00, S01, S02, S03, S04, S05, S06, S07, S08, S09; \ - sph_u32 S10, S11, S12, S13, S14, S15, S16, S17, S18, S19; \ - sph_u32 S20, S21, S22, S23, S24, S25, S26, S27, S28, S29; - -#define DECL_STATE_BIG \ - DECL_STATE_SMALL \ - sph_u32 S30, S31, S32, S33, S34, S35; - -#define READ_STATE_SMALL(state) do { \ - S00 = (state)->S[ 0]; \ - S01 = (state)->S[ 1]; \ - S02 = (state)->S[ 2]; \ - S03 = (state)->S[ 3]; \ - S04 = (state)->S[ 4]; \ - S05 = (state)->S[ 5]; \ - S06 = (state)->S[ 6]; \ - S07 = (state)->S[ 7]; \ - S08 = (state)->S[ 8]; \ - S09 = (state)->S[ 9]; \ - S10 = (state)->S[10]; \ - S11 = (state)->S[11]; \ - S12 = (state)->S[12]; \ - S13 = (state)->S[13]; \ - S14 = (state)->S[14]; \ - S15 = (state)->S[15]; \ - S16 = (state)->S[16]; \ - S17 = (state)->S[17]; \ - S18 = (state)->S[18]; \ - S19 = (state)->S[19]; \ - S20 = (state)->S[20]; \ - S21 = (state)->S[21]; \ - S22 = (state)->S[22]; \ - S23 = (state)->S[23]; \ - S24 = (state)->S[24]; \ - S25 = (state)->S[25]; \ - S26 = (state)->S[26]; \ - S27 = (state)->S[27]; \ - S28 = (state)->S[28]; \ - S29 = (state)->S[29]; \ - } while (0) - -#define READ_STATE_BIG(state) do { \ - READ_STATE_SMALL(state); \ - S30 = (state)->S[30]; \ - S31 = (state)->S[31]; \ - S32 = (state)->S[32]; \ - S33 = (state)->S[33]; \ - S34 = (state)->S[34]; \ - S35 = (state)->S[35]; \ - } while (0) - -#define WRITE_STATE_SMALL(state) do { \ - (state)->S[ 0] = S00; \ - (state)->S[ 1] = S01; \ - (state)->S[ 2] = S02; \ - (state)->S[ 3] = S03; \ - (state)->S[ 4] = S04; \ - (state)->S[ 5] = S05; \ - (state)->S[ 6] = S06; \ - (state)->S[ 7] = S07; \ - (state)->S[ 8] = S08; \ - (state)->S[ 9] = S09; \ - (state)->S[10] = S10; \ - (state)->S[11] = S11; \ - (state)->S[12] = S12; \ - (state)->S[13] = S13; \ - (state)->S[14] = S14; \ - (state)->S[15] = S15; \ - (state)->S[16] = S16; \ - (state)->S[17] = S17; \ - (state)->S[18] = S18; \ - (state)->S[19] = S19; \ - (state)->S[20] = S20; \ - (state)->S[21] = S21; \ - (state)->S[22] = S22; \ - (state)->S[23] = S23; \ - (state)->S[24] = S24; \ - (state)->S[25] = S25; \ - (state)->S[26] = S26; \ - (state)->S[27] = S27; \ - (state)->S[28] = S28; \ - (state)->S[29] = S29; \ - } while (0) - -#define WRITE_STATE_BIG(state) do { \ - WRITE_STATE_SMALL(state); \ - (state)->S[30] = S30; \ - (state)->S[31] = S31; \ - (state)->S[32] = S32; \ - (state)->S[33] = S33; \ - (state)->S[34] = S34; \ - (state)->S[35] = S35; \ - } while (0) - -#endif - -static void -fugue_init(sph_fugue_context *sc, size_t z_len, - const sph_u32 *iv, size_t iv_len) -{ - size_t u; - - for (u = 0; u < z_len; u ++) - sc->S[u] = 0; - memcpy(&sc->S[z_len], iv, iv_len * sizeof *iv); - sc->partial = 0; - sc->partial_len = 0; - sc->round_shift = 0; -#if SPH_64 - sc->bit_count = 0; -#else - sc->bit_count_high = 0; - sc->bit_count_low = 0; -#endif -} - -#if SPH_64 - -#define INCR_COUNTER do { \ - sc->bit_count += (sph_u64)len << 3; \ - } while (0) - -#else - -#define INCR_COUNTER do { \ - sph_u32 tmp = SPH_T32((sph_u32)len << 3); \ - sc->bit_count_low = SPH_T32(sc->bit_count_low + tmp); \ - if (sc->bit_count_low < tmp) \ - sc->bit_count_high ++; \ - sc->bit_count_high = SPH_T32(sc->bit_count_high \ - + ((sph_u32)len >> 29)); \ - } while (0) - -#endif - -#define CORE_ENTRY \ - sph_u32 p; \ - unsigned plen, rshift; \ - INCR_COUNTER; \ - p = sc->partial; \ - plen = sc->partial_len; \ - if (plen < 4) { \ - unsigned count = 4 - plen; \ - if (len < count) \ - count = len; \ - plen += count; \ - while (count -- > 0) { \ - p = (p << 8) | *(const unsigned char *)data; \ - data = (const unsigned char *)data + 1; \ - len --; \ - } \ - if (len == 0) { \ - sc->partial = p; \ - sc->partial_len = plen; \ - return; \ - } \ - } - -#define CORE_EXIT \ - p = 0; \ - sc->partial_len = (unsigned)len; \ - while (len -- > 0) { \ - p = (p << 8) | *(const unsigned char *)data; \ - data = (const unsigned char *)data + 1; \ - } \ - sc->partial = p; \ - sc->round_shift = rshift; - -/* - * Not in a do..while: the 'break' must exit the outer loop. - */ -#define NEXT(rc) \ - if (len <= 4) { \ - rshift = (rc); \ - break; \ - } \ - p = sph_dec32be(data); \ - data = (const unsigned char *)data + 4; \ - len -= 4 - -static void -fugue2_core(sph_fugue_context *sc, const void *data, size_t len) -{ - DECL_STATE_SMALL - CORE_ENTRY - READ_STATE_SMALL(sc); - rshift = sc->round_shift; - switch (rshift) { - for (;;) { - sph_u32 q; - - case 0: - q = p; - TIX2(q, S00, S01, S08, S10, S24); - CMIX30(S27, S28, S29, S01, S02, S03, S12, S13, S14); - SMIX(S27, S28, S29, S00); - CMIX30(S24, S25, S26, S28, S29, S00, S09, S10, S11); - SMIX(S24, S25, S26, S27); - NEXT(1); - /* fall through */ - case 1: - q = p; - TIX2(q, S24, S25, S02, S04, S18); - CMIX30(S21, S22, S23, S25, S26, S27, S06, S07, S08); - SMIX(S21, S22, S23, S24); - CMIX30(S18, S19, S20, S22, S23, S24, S03, S04, S05); - SMIX(S18, S19, S20, S21); - NEXT(2); - /* fall through */ - case 2: - q = p; - TIX2(q, S18, S19, S26, S28, S12); - CMIX30(S15, S16, S17, S19, S20, S21, S00, S01, S02); - SMIX(S15, S16, S17, S18); - CMIX30(S12, S13, S14, S16, S17, S18, S27, S28, S29); - SMIX(S12, S13, S14, S15); - NEXT(3); - /* fall through */ - case 3: - q = p; - TIX2(q, S12, S13, S20, S22, S06); - CMIX30(S09, S10, S11, S13, S14, S15, S24, S25, S26); - SMIX(S09, S10, S11, S12); - CMIX30(S06, S07, S08, S10, S11, S12, S21, S22, S23); - SMIX(S06, S07, S08, S09); - NEXT(4); - /* fall through */ - case 4: - q = p; - TIX2(q, S06, S07, S14, S16, S00); - CMIX30(S03, S04, S05, S07, S08, S09, S18, S19, S20); - SMIX(S03, S04, S05, S06); - CMIX30(S00, S01, S02, S04, S05, S06, S15, S16, S17); - SMIX(S00, S01, S02, S03); - NEXT(0); - } - } - CORE_EXIT - WRITE_STATE_SMALL(sc); -} - -static void -fugue3_core(sph_fugue_context *sc, const void *data, size_t len) -{ - DECL_STATE_BIG - CORE_ENTRY - READ_STATE_BIG(sc); - rshift = sc->round_shift; - switch (rshift) { - for (;;) { - sph_u32 q; - - case 0: - q = p; - TIX3(q, S00, S01, S04, S08, S16, S27, S30); - CMIX36(S33, S34, S35, S01, S02, S03, S15, S16, S17); - SMIX(S33, S34, S35, S00); - CMIX36(S30, S31, S32, S34, S35, S00, S12, S13, S14); - SMIX(S30, S31, S32, S33); - CMIX36(S27, S28, S29, S31, S32, S33, S09, S10, S11); - SMIX(S27, S28, S29, S30); - NEXT(1); - /* fall through */ - case 1: - q = p; - TIX3(q, S27, S28, S31, S35, S07, S18, S21); - CMIX36(S24, S25, S26, S28, S29, S30, S06, S07, S08); - SMIX(S24, S25, S26, S27); - CMIX36(S21, S22, S23, S25, S26, S27, S03, S04, S05); - SMIX(S21, S22, S23, S24); - CMIX36(S18, S19, S20, S22, S23, S24, S00, S01, S02); - SMIX(S18, S19, S20, S21); - NEXT(2); - /* fall through */ - case 2: - q = p; - TIX3(q, S18, S19, S22, S26, S34, S09, S12); - CMIX36(S15, S16, S17, S19, S20, S21, S33, S34, S35); - SMIX(S15, S16, S17, S18); - CMIX36(S12, S13, S14, S16, S17, S18, S30, S31, S32); - SMIX(S12, S13, S14, S15); - CMIX36(S09, S10, S11, S13, S14, S15, S27, S28, S29); - SMIX(S09, S10, S11, S12); - NEXT(3); - /* fall through */ - case 3: - q = p; - TIX3(q, S09, S10, S13, S17, S25, S00, S03); - CMIX36(S06, S07, S08, S10, S11, S12, S24, S25, S26); - SMIX(S06, S07, S08, S09); - CMIX36(S03, S04, S05, S07, S08, S09, S21, S22, S23); - SMIX(S03, S04, S05, S06); - CMIX36(S00, S01, S02, S04, S05, S06, S18, S19, S20); - SMIX(S00, S01, S02, S03); - NEXT(0); - } - } - CORE_EXIT - WRITE_STATE_BIG(sc); -} - -static void -fugue4_core(sph_fugue_context *sc, const void *data, size_t len) -{ - DECL_STATE_BIG - CORE_ENTRY - READ_STATE_BIG(sc); - rshift = sc->round_shift; - switch (rshift) { - for (;;) { - sph_u32 q; - - case 0: - q = p; - TIX4(q, S00, S01, S04, S07, S08, S22, S24, S27, S30); - CMIX36(S33, S34, S35, S01, S02, S03, S15, S16, S17); - SMIX(S33, S34, S35, S00); - CMIX36(S30, S31, S32, S34, S35, S00, S12, S13, S14); - SMIX(S30, S31, S32, S33); - CMIX36(S27, S28, S29, S31, S32, S33, S09, S10, S11); - SMIX(S27, S28, S29, S30); - CMIX36(S24, S25, S26, S28, S29, S30, S06, S07, S08); - SMIX(S24, S25, S26, S27); - NEXT(1); - /* fall through */ - case 1: - q = p; - TIX4(q, S24, S25, S28, S31, S32, S10, S12, S15, S18); - CMIX36(S21, S22, S23, S25, S26, S27, S03, S04, S05); - SMIX(S21, S22, S23, S24); - CMIX36(S18, S19, S20, S22, S23, S24, S00, S01, S02); - SMIX(S18, S19, S20, S21); - CMIX36(S15, S16, S17, S19, S20, S21, S33, S34, S35); - SMIX(S15, S16, S17, S18); - CMIX36(S12, S13, S14, S16, S17, S18, S30, S31, S32); - SMIX(S12, S13, S14, S15); - NEXT(2); - /* fall through */ - case 2: - q = p; - TIX4(q, S12, S13, S16, S19, S20, S34, S00, S03, S06); - CMIX36(S09, S10, S11, S13, S14, S15, S27, S28, S29); - SMIX(S09, S10, S11, S12); - CMIX36(S06, S07, S08, S10, S11, S12, S24, S25, S26); - SMIX(S06, S07, S08, S09); - CMIX36(S03, S04, S05, S07, S08, S09, S21, S22, S23); - SMIX(S03, S04, S05, S06); - CMIX36(S00, S01, S02, S04, S05, S06, S18, S19, S20); - SMIX(S00, S01, S02, S03); - NEXT(0); - } - } - CORE_EXIT - WRITE_STATE_BIG(sc); -} - -#if SPH_64 - -#define WRITE_COUNTER do { \ - sph_enc64be(buf + 4, sc->bit_count + n); \ - } while (0) - -#else - -#define WRITE_COUNTER do { \ - sph_enc32be(buf + 4, sc->bit_count_high); \ - sph_enc32be(buf + 8, sc->bit_count_low + n); \ - } while (0) - -#endif - -#define CLOSE_ENTRY(s, rcm, core) \ - unsigned char buf[16]; \ - unsigned plen, rms; \ - unsigned char *out; \ - sph_u32 S[s]; \ - plen = sc->partial_len; \ - WRITE_COUNTER; \ - if (plen == 0 && n == 0) { \ - plen = 4; \ - } else if (plen < 4 || n != 0) { \ - unsigned u; \ - \ - if (plen == 4) \ - plen = 0; \ - buf[plen] = ub & ~(0xFFU >> n); \ - for (u = plen + 1; u < 4; u ++) \ - buf[u] = 0; \ - } \ - core(sc, buf + plen, (sizeof buf) - plen); \ - rms = sc->round_shift * (rcm); \ - memcpy(S, sc->S + (s) - rms, rms * sizeof(sph_u32)); \ - memcpy(S + rms, sc->S, ((s) - rms) * sizeof(sph_u32)); - -#define ROR(n, s) do { \ - sph_u32 tmp[n]; \ - memcpy(tmp, S + ((s) - (n)), (n) * sizeof(sph_u32)); \ - memmove(S + (n), S, ((s) - (n)) * sizeof(sph_u32)); \ - memcpy(S, tmp, (n) * sizeof(sph_u32)); \ - } while (0) - -static void -fugue2_close(sph_fugue_context *sc, unsigned ub, unsigned n, - void *dst, size_t out_size_w32) -{ - int i; - - CLOSE_ENTRY(30, 6, fugue2_core) - for (i = 0; i < 10; i ++) { - ROR(3, 30); - CMIX30(S[0], S[1], S[2], S[4], S[5], S[6], S[15], S[16], S[17]); - SMIX(S[0], S[1], S[2], S[3]); - } - for (i = 0; i < 13; i ++) { - S[4] ^= S[0]; - S[15] ^= S[0]; - ROR(15, 30); - SMIX(S[0], S[1], S[2], S[3]); - S[4] ^= S[0]; - S[16] ^= S[0]; - ROR(14, 30); - SMIX(S[0], S[1], S[2], S[3]); - } - S[4] ^= S[0]; - S[15] ^= S[0]; - out = dst; - sph_enc32be(out + 0, S[ 1]); - sph_enc32be(out + 4, S[ 2]); - sph_enc32be(out + 8, S[ 3]); - sph_enc32be(out + 12, S[ 4]); - sph_enc32be(out + 16, S[15]); - sph_enc32be(out + 20, S[16]); - sph_enc32be(out + 24, S[17]); - if (out_size_w32 == 8) { - sph_enc32be(out + 28, S[18]); - sph_fugue256_init(sc); - } else { - sph_fugue224_init(sc); - } -} - -static void -fugue3_close(sph_fugue_context *sc, unsigned ub, unsigned n, void *dst) -{ - int i; - - CLOSE_ENTRY(36, 9, fugue3_core) - for (i = 0; i < 18; i ++) { - ROR(3, 36); - CMIX36(S[0], S[1], S[2], S[4], S[5], S[6], S[18], S[19], S[20]); - SMIX(S[0], S[1], S[2], S[3]); - } - for (i = 0; i < 13; i ++) { - S[4] ^= S[0]; - S[12] ^= S[0]; - S[24] ^= S[0]; - ROR(12, 36); - SMIX(S[0], S[1], S[2], S[3]); - S[4] ^= S[0]; - S[13] ^= S[0]; - S[24] ^= S[0]; - ROR(12, 36); - SMIX(S[0], S[1], S[2], S[3]); - S[4] ^= S[0]; - S[13] ^= S[0]; - S[25] ^= S[0]; - ROR(11, 36); - SMIX(S[0], S[1], S[2], S[3]); - } - S[4] ^= S[0]; - S[12] ^= S[0]; - S[24] ^= S[0]; - out = dst; - sph_enc32be(out + 0, S[ 1]); - sph_enc32be(out + 4, S[ 2]); - sph_enc32be(out + 8, S[ 3]); - sph_enc32be(out + 12, S[ 4]); - sph_enc32be(out + 16, S[12]); - sph_enc32be(out + 20, S[13]); - sph_enc32be(out + 24, S[14]); - sph_enc32be(out + 28, S[15]); - sph_enc32be(out + 32, S[24]); - sph_enc32be(out + 36, S[25]); - sph_enc32be(out + 40, S[26]); - sph_enc32be(out + 44, S[27]); - sph_fugue384_init(sc); -} - -static void -fugue4_close(sph_fugue_context *sc, unsigned ub, unsigned n, void *dst) -{ - int i; - - CLOSE_ENTRY(36, 12, fugue4_core) - for (i = 0; i < 32; i ++) { - ROR(3, 36); - CMIX36(S[0], S[1], S[2], S[4], S[5], S[6], S[18], S[19], S[20]); - SMIX(S[0], S[1], S[2], S[3]); - } - for (i = 0; i < 13; i ++) { - S[4] ^= S[0]; - S[9] ^= S[0]; - S[18] ^= S[0]; - S[27] ^= S[0]; - ROR(9, 36); - SMIX(S[0], S[1], S[2], S[3]); - S[4] ^= S[0]; - S[10] ^= S[0]; - S[18] ^= S[0]; - S[27] ^= S[0]; - ROR(9, 36); - SMIX(S[0], S[1], S[2], S[3]); - S[4] ^= S[0]; - S[10] ^= S[0]; - S[19] ^= S[0]; - S[27] ^= S[0]; - ROR(9, 36); - SMIX(S[0], S[1], S[2], S[3]); - S[4] ^= S[0]; - S[10] ^= S[0]; - S[19] ^= S[0]; - S[28] ^= S[0]; - ROR(8, 36); - SMIX(S[0], S[1], S[2], S[3]); - } - S[4] ^= S[0]; - S[9] ^= S[0]; - S[18] ^= S[0]; - S[27] ^= S[0]; - out = dst; - sph_enc32be(out + 0, S[ 1]); - sph_enc32be(out + 4, S[ 2]); - sph_enc32be(out + 8, S[ 3]); - sph_enc32be(out + 12, S[ 4]); - sph_enc32be(out + 16, S[ 9]); - sph_enc32be(out + 20, S[10]); - sph_enc32be(out + 24, S[11]); - sph_enc32be(out + 28, S[12]); - sph_enc32be(out + 32, S[18]); - sph_enc32be(out + 36, S[19]); - sph_enc32be(out + 40, S[20]); - sph_enc32be(out + 44, S[21]); - sph_enc32be(out + 48, S[27]); - sph_enc32be(out + 52, S[28]); - sph_enc32be(out + 56, S[29]); - sph_enc32be(out + 60, S[30]); - sph_fugue512_init(sc); -} - -void -sph_fugue224_init(void *cc) -{ - fugue_init(cc, 23, IV224, 7); -} - -void -sph_fugue224(void *cc, const void *data, size_t len) -{ - fugue2_core(cc, data, len); -} - -void -sph_fugue224_close(void *cc, void *dst) -{ - fugue2_close(cc, 0, 0, dst, 7); -} - -void -sph_fugue224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - fugue2_close(cc, ub, n, dst, 7); -} - -void -sph_fugue256_init(void *cc) -{ - fugue_init(cc, 22, IV256, 8); -} - -void -sph_fugue256(void *cc, const void *data, size_t len) -{ - fugue2_core(cc, data, len); -} - -void -sph_fugue256_close(void *cc, void *dst) -{ - fugue2_close(cc, 0, 0, dst, 8); -} - -void -sph_fugue256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - fugue2_close(cc, ub, n, dst, 8); -} - -void -sph_fugue384_init(void *cc) -{ - fugue_init(cc, 24, IV384, 12); -} - -void -sph_fugue384(void *cc, const void *data, size_t len) -{ - fugue3_core(cc, data, len); -} - -void -sph_fugue384_close(void *cc, void *dst) -{ - fugue3_close(cc, 0, 0, dst); -} - -void -sph_fugue384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - fugue3_close(cc, ub, n, dst); -} - -void -sph_fugue512_init(void *cc) -{ - fugue_init(cc, 20, IV512, 16); -} - -void -sph_fugue512(void *cc, const void *data, size_t len) -{ - fugue4_core(cc, data, len); -} - -void -sph_fugue512_close(void *cc, void *dst) -{ - fugue4_close(cc, 0, 0, dst); -} - -void -sph_fugue512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - fugue4_close(cc, ub, n, dst); -} -#ifdef __cplusplus -} -#endif diff --git a/sph/groestl.c b/sph/groestl.c deleted file mode 100644 index 31b7b038..00000000 --- a/sph/groestl.c +++ /dev/null @@ -1,3124 +0,0 @@ -/* $Id: groestl.c 260 2011-07-21 01:02:38Z tp $ */ -/* - * Groestl implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ -#include -#include -#include - -#include "sph_groestl.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -#if SPH_SMALL_FOOTPRINT && !defined SPH_SMALL_FOOTPRINT_GROESTL -#define SPH_SMALL_FOOTPRINT_GROESTL 1 -#endif - -/* - * Apparently, the 32-bit-only version is not faster than the 64-bit - * version unless using the "small footprint" code on a 32-bit machine. - */ -#if !defined SPH_GROESTL_64 -#if SPH_SMALL_FOOTPRINT_GROESTL && !SPH_64_TRUE -#define SPH_GROESTL_64 0 -#else -#define SPH_GROESTL_64 1 -#endif -#endif - -#if !SPH_64 -#undef SPH_GROESTL_64 -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -/* - * The internal representation may use either big-endian or - * little-endian. Using the platform default representation speeds up - * encoding and decoding between bytes and the matrix columns. - */ - -#undef USE_LE -#if SPH_GROESTL_LITTLE_ENDIAN -#define USE_LE 1 -#elif SPH_GROESTL_BIG_ENDIAN -#define USE_LE 0 -#elif SPH_LITTLE_ENDIAN -#define USE_LE 1 -#endif - -#if USE_LE - -#define C32e(x) ((SPH_C32(x) >> 24) \ - | ((SPH_C32(x) >> 8) & SPH_C32(0x0000FF00)) \ - | ((SPH_C32(x) << 8) & SPH_C32(0x00FF0000)) \ - | ((SPH_C32(x) << 24) & SPH_C32(0xFF000000))) -#define dec32e_aligned sph_dec32le_aligned -#define enc32e sph_enc32le -#define B32_0(x) ((x) & 0xFF) -#define B32_1(x) (((x) >> 8) & 0xFF) -#define B32_2(x) (((x) >> 16) & 0xFF) -#define B32_3(x) ((x) >> 24) - -#define R32u(u, d) SPH_T32(((u) << 16) | ((d) >> 16)) -#define R32d(u, d) SPH_T32(((u) >> 16) | ((d) << 16)) - -#define PC32up(j, r) ((sph_u32)((j) + (r))) -#define PC32dn(j, r) 0 -#define QC32up(j, r) SPH_C32(0xFFFFFFFF) -#define QC32dn(j, r) (((sph_u32)(r) << 24) ^ SPH_T32(~((sph_u32)(j) << 24))) - -#if SPH_64 -#define C64e(x) ((SPH_C64(x) >> 56) \ - | ((SPH_C64(x) >> 40) & SPH_C64(0x000000000000FF00)) \ - | ((SPH_C64(x) >> 24) & SPH_C64(0x0000000000FF0000)) \ - | ((SPH_C64(x) >> 8) & SPH_C64(0x00000000FF000000)) \ - | ((SPH_C64(x) << 8) & SPH_C64(0x000000FF00000000)) \ - | ((SPH_C64(x) << 24) & SPH_C64(0x0000FF0000000000)) \ - | ((SPH_C64(x) << 40) & SPH_C64(0x00FF000000000000)) \ - | ((SPH_C64(x) << 56) & SPH_C64(0xFF00000000000000))) -#define dec64e_aligned sph_dec64le_aligned -#define enc64e sph_enc64le -#define B64_0(x) ((x) & 0xFF) -#define B64_1(x) (((x) >> 8) & 0xFF) -#define B64_2(x) (((x) >> 16) & 0xFF) -#define B64_3(x) (((x) >> 24) & 0xFF) -#define B64_4(x) (((x) >> 32) & 0xFF) -#define B64_5(x) (((x) >> 40) & 0xFF) -#define B64_6(x) (((x) >> 48) & 0xFF) -#define B64_7(x) ((x) >> 56) -#define R64 SPH_ROTL64 -#define PC64(j, r) ((sph_u64)((j) + (r))) -#define QC64(j, r) (((sph_u64)(r) << 56) ^ SPH_T64(~((sph_u64)(j) << 56))) -#endif - -#else - -#define C32e(x) SPH_C32(x) -#define dec32e_aligned sph_dec32be_aligned -#define enc32e sph_enc32be -#define B32_0(x) ((x) >> 24) -#define B32_1(x) (((x) >> 16) & 0xFF) -#define B32_2(x) (((x) >> 8) & 0xFF) -#define B32_3(x) ((x) & 0xFF) - -#define R32u(u, d) SPH_T32(((u) >> 16) | ((d) << 16)) -#define R32d(u, d) SPH_T32(((u) << 16) | ((d) >> 16)) - -#define PC32up(j, r) ((sph_u32)((j) + (r)) << 24) -#define PC32dn(j, r) 0 -#define QC32up(j, r) SPH_C32(0xFFFFFFFF) -#define QC32dn(j, r) ((sph_u32)(r) ^ SPH_T32(~(sph_u32)(j))) - -#if SPH_64 -#define C64e(x) SPH_C64(x) -#define dec64e_aligned sph_dec64be_aligned -#define enc64e sph_enc64be -#define B64_0(x) ((x) >> 56) -#define B64_1(x) (((x) >> 48) & 0xFF) -#define B64_2(x) (((x) >> 40) & 0xFF) -#define B64_3(x) (((x) >> 32) & 0xFF) -#define B64_4(x) (((x) >> 24) & 0xFF) -#define B64_5(x) (((x) >> 16) & 0xFF) -#define B64_6(x) (((x) >> 8) & 0xFF) -#define B64_7(x) ((x) & 0xFF) -#define R64 SPH_ROTR64 -#define PC64(j, r) ((sph_u64)((j) + (r)) << 56) -#define QC64(j, r) ((sph_u64)(r) ^ SPH_T64(~(sph_u64)(j))) -#endif - -#endif - -#if SPH_GROESTL_64 - -static const sph_u64 T0[] = { - C64e(0xc632f4a5f497a5c6), C64e(0xf86f978497eb84f8), - C64e(0xee5eb099b0c799ee), C64e(0xf67a8c8d8cf78df6), - C64e(0xffe8170d17e50dff), C64e(0xd60adcbddcb7bdd6), - C64e(0xde16c8b1c8a7b1de), C64e(0x916dfc54fc395491), - C64e(0x6090f050f0c05060), C64e(0x0207050305040302), - C64e(0xce2ee0a9e087a9ce), C64e(0x56d1877d87ac7d56), - C64e(0xe7cc2b192bd519e7), C64e(0xb513a662a67162b5), - C64e(0x4d7c31e6319ae64d), C64e(0xec59b59ab5c39aec), - C64e(0x8f40cf45cf05458f), C64e(0x1fa3bc9dbc3e9d1f), - C64e(0x8949c040c0094089), C64e(0xfa68928792ef87fa), - C64e(0xefd03f153fc515ef), C64e(0xb29426eb267febb2), - C64e(0x8ece40c94007c98e), C64e(0xfbe61d0b1ded0bfb), - C64e(0x416e2fec2f82ec41), C64e(0xb31aa967a97d67b3), - C64e(0x5f431cfd1cbefd5f), C64e(0x456025ea258aea45), - C64e(0x23f9dabfda46bf23), C64e(0x535102f702a6f753), - C64e(0xe445a196a1d396e4), C64e(0x9b76ed5bed2d5b9b), - C64e(0x75285dc25deac275), C64e(0xe1c5241c24d91ce1), - C64e(0x3dd4e9aee97aae3d), C64e(0x4cf2be6abe986a4c), - C64e(0x6c82ee5aeed85a6c), C64e(0x7ebdc341c3fc417e), - C64e(0xf5f3060206f102f5), C64e(0x8352d14fd11d4f83), - C64e(0x688ce45ce4d05c68), C64e(0x515607f407a2f451), - C64e(0xd18d5c345cb934d1), C64e(0xf9e1180818e908f9), - C64e(0xe24cae93aedf93e2), C64e(0xab3e9573954d73ab), - C64e(0x6297f553f5c45362), C64e(0x2a6b413f41543f2a), - C64e(0x081c140c14100c08), C64e(0x9563f652f6315295), - C64e(0x46e9af65af8c6546), C64e(0x9d7fe25ee2215e9d), - C64e(0x3048782878602830), C64e(0x37cff8a1f86ea137), - C64e(0x0a1b110f11140f0a), C64e(0x2febc4b5c45eb52f), - C64e(0x0e151b091b1c090e), C64e(0x247e5a365a483624), - C64e(0x1badb69bb6369b1b), C64e(0xdf98473d47a53ddf), - C64e(0xcda76a266a8126cd), C64e(0x4ef5bb69bb9c694e), - C64e(0x7f334ccd4cfecd7f), C64e(0xea50ba9fbacf9fea), - C64e(0x123f2d1b2d241b12), C64e(0x1da4b99eb93a9e1d), - C64e(0x58c49c749cb07458), C64e(0x3446722e72682e34), - C64e(0x3641772d776c2d36), C64e(0xdc11cdb2cda3b2dc), - C64e(0xb49d29ee2973eeb4), C64e(0x5b4d16fb16b6fb5b), - C64e(0xa4a501f60153f6a4), C64e(0x76a1d74dd7ec4d76), - C64e(0xb714a361a37561b7), C64e(0x7d3449ce49face7d), - C64e(0x52df8d7b8da47b52), C64e(0xdd9f423e42a13edd), - C64e(0x5ecd937193bc715e), C64e(0x13b1a297a2269713), - C64e(0xa6a204f50457f5a6), C64e(0xb901b868b86968b9), - C64e(0x0000000000000000), C64e(0xc1b5742c74992cc1), - C64e(0x40e0a060a0806040), C64e(0xe3c2211f21dd1fe3), - C64e(0x793a43c843f2c879), C64e(0xb69a2ced2c77edb6), - C64e(0xd40dd9bed9b3bed4), C64e(0x8d47ca46ca01468d), - C64e(0x671770d970ced967), C64e(0x72afdd4bdde44b72), - C64e(0x94ed79de7933de94), C64e(0x98ff67d4672bd498), - C64e(0xb09323e8237be8b0), C64e(0x855bde4ade114a85), - C64e(0xbb06bd6bbd6d6bbb), C64e(0xc5bb7e2a7e912ac5), - C64e(0x4f7b34e5349ee54f), C64e(0xedd73a163ac116ed), - C64e(0x86d254c55417c586), C64e(0x9af862d7622fd79a), - C64e(0x6699ff55ffcc5566), C64e(0x11b6a794a7229411), - C64e(0x8ac04acf4a0fcf8a), C64e(0xe9d9301030c910e9), - C64e(0x040e0a060a080604), C64e(0xfe66988198e781fe), - C64e(0xa0ab0bf00b5bf0a0), C64e(0x78b4cc44ccf04478), - C64e(0x25f0d5bad54aba25), C64e(0x4b753ee33e96e34b), - C64e(0xa2ac0ef30e5ff3a2), C64e(0x5d4419fe19bafe5d), - C64e(0x80db5bc05b1bc080), C64e(0x0580858a850a8a05), - C64e(0x3fd3ecadec7ead3f), C64e(0x21fedfbcdf42bc21), - C64e(0x70a8d848d8e04870), C64e(0xf1fd0c040cf904f1), - C64e(0x63197adf7ac6df63), C64e(0x772f58c158eec177), - C64e(0xaf309f759f4575af), C64e(0x42e7a563a5846342), - C64e(0x2070503050403020), C64e(0xe5cb2e1a2ed11ae5), - C64e(0xfdef120e12e10efd), C64e(0xbf08b76db7656dbf), - C64e(0x8155d44cd4194c81), C64e(0x18243c143c301418), - C64e(0x26795f355f4c3526), C64e(0xc3b2712f719d2fc3), - C64e(0xbe8638e13867e1be), C64e(0x35c8fda2fd6aa235), - C64e(0x88c74fcc4f0bcc88), C64e(0x2e654b394b5c392e), - C64e(0x936af957f93d5793), C64e(0x55580df20daaf255), - C64e(0xfc619d829de382fc), C64e(0x7ab3c947c9f4477a), - C64e(0xc827efacef8bacc8), C64e(0xba8832e7326fe7ba), - C64e(0x324f7d2b7d642b32), C64e(0xe642a495a4d795e6), - C64e(0xc03bfba0fb9ba0c0), C64e(0x19aab398b3329819), - C64e(0x9ef668d16827d19e), C64e(0xa322817f815d7fa3), - C64e(0x44eeaa66aa886644), C64e(0x54d6827e82a87e54), - C64e(0x3bdde6abe676ab3b), C64e(0x0b959e839e16830b), - C64e(0x8cc945ca4503ca8c), C64e(0xc7bc7b297b9529c7), - C64e(0x6b056ed36ed6d36b), C64e(0x286c443c44503c28), - C64e(0xa72c8b798b5579a7), C64e(0xbc813de23d63e2bc), - C64e(0x1631271d272c1d16), C64e(0xad379a769a4176ad), - C64e(0xdb964d3b4dad3bdb), C64e(0x649efa56fac85664), - C64e(0x74a6d24ed2e84e74), C64e(0x1436221e22281e14), - C64e(0x92e476db763fdb92), C64e(0x0c121e0a1e180a0c), - C64e(0x48fcb46cb4906c48), C64e(0xb88f37e4376be4b8), - C64e(0x9f78e75de7255d9f), C64e(0xbd0fb26eb2616ebd), - C64e(0x43692aef2a86ef43), C64e(0xc435f1a6f193a6c4), - C64e(0x39dae3a8e372a839), C64e(0x31c6f7a4f762a431), - C64e(0xd38a593759bd37d3), C64e(0xf274868b86ff8bf2), - C64e(0xd583563256b132d5), C64e(0x8b4ec543c50d438b), - C64e(0x6e85eb59ebdc596e), C64e(0xda18c2b7c2afb7da), - C64e(0x018e8f8c8f028c01), C64e(0xb11dac64ac7964b1), - C64e(0x9cf16dd26d23d29c), C64e(0x49723be03b92e049), - C64e(0xd81fc7b4c7abb4d8), C64e(0xacb915fa1543faac), - C64e(0xf3fa090709fd07f3), C64e(0xcfa06f256f8525cf), - C64e(0xca20eaafea8fafca), C64e(0xf47d898e89f38ef4), - C64e(0x476720e9208ee947), C64e(0x1038281828201810), - C64e(0x6f0b64d564ded56f), C64e(0xf073838883fb88f0), - C64e(0x4afbb16fb1946f4a), C64e(0x5cca967296b8725c), - C64e(0x38546c246c702438), C64e(0x575f08f108aef157), - C64e(0x732152c752e6c773), C64e(0x9764f351f3355197), - C64e(0xcbae6523658d23cb), C64e(0xa125847c84597ca1), - C64e(0xe857bf9cbfcb9ce8), C64e(0x3e5d6321637c213e), - C64e(0x96ea7cdd7c37dd96), C64e(0x611e7fdc7fc2dc61), - C64e(0x0d9c9186911a860d), C64e(0x0f9b9485941e850f), - C64e(0xe04bab90abdb90e0), C64e(0x7cbac642c6f8427c), - C64e(0x712657c457e2c471), C64e(0xcc29e5aae583aacc), - C64e(0x90e373d8733bd890), C64e(0x06090f050f0c0506), - C64e(0xf7f4030103f501f7), C64e(0x1c2a36123638121c), - C64e(0xc23cfea3fe9fa3c2), C64e(0x6a8be15fe1d45f6a), - C64e(0xaebe10f91047f9ae), C64e(0x69026bd06bd2d069), - C64e(0x17bfa891a82e9117), C64e(0x9971e858e8295899), - C64e(0x3a5369276974273a), C64e(0x27f7d0b9d04eb927), - C64e(0xd991483848a938d9), C64e(0xebde351335cd13eb), - C64e(0x2be5ceb3ce56b32b), C64e(0x2277553355443322), - C64e(0xd204d6bbd6bfbbd2), C64e(0xa9399070904970a9), - C64e(0x07878089800e8907), C64e(0x33c1f2a7f266a733), - C64e(0x2decc1b6c15ab62d), C64e(0x3c5a66226678223c), - C64e(0x15b8ad92ad2a9215), C64e(0xc9a96020608920c9), - C64e(0x875cdb49db154987), C64e(0xaab01aff1a4fffaa), - C64e(0x50d8887888a07850), C64e(0xa52b8e7a8e517aa5), - C64e(0x03898a8f8a068f03), C64e(0x594a13f813b2f859), - C64e(0x09929b809b128009), C64e(0x1a2339173934171a), - C64e(0x651075da75cada65), C64e(0xd784533153b531d7), - C64e(0x84d551c65113c684), C64e(0xd003d3b8d3bbb8d0), - C64e(0x82dc5ec35e1fc382), C64e(0x29e2cbb0cb52b029), - C64e(0x5ac3997799b4775a), C64e(0x1e2d3311333c111e), - C64e(0x7b3d46cb46f6cb7b), C64e(0xa8b71ffc1f4bfca8), - C64e(0x6d0c61d661dad66d), C64e(0x2c624e3a4e583a2c) -}; - -#if !SPH_SMALL_FOOTPRINT_GROESTL - -static const sph_u64 T1[] = { - C64e(0xc6c632f4a5f497a5), C64e(0xf8f86f978497eb84), - C64e(0xeeee5eb099b0c799), C64e(0xf6f67a8c8d8cf78d), - C64e(0xffffe8170d17e50d), C64e(0xd6d60adcbddcb7bd), - C64e(0xdede16c8b1c8a7b1), C64e(0x91916dfc54fc3954), - C64e(0x606090f050f0c050), C64e(0x0202070503050403), - C64e(0xcece2ee0a9e087a9), C64e(0x5656d1877d87ac7d), - C64e(0xe7e7cc2b192bd519), C64e(0xb5b513a662a67162), - C64e(0x4d4d7c31e6319ae6), C64e(0xecec59b59ab5c39a), - C64e(0x8f8f40cf45cf0545), C64e(0x1f1fa3bc9dbc3e9d), - C64e(0x898949c040c00940), C64e(0xfafa68928792ef87), - C64e(0xefefd03f153fc515), C64e(0xb2b29426eb267feb), - C64e(0x8e8ece40c94007c9), C64e(0xfbfbe61d0b1ded0b), - C64e(0x41416e2fec2f82ec), C64e(0xb3b31aa967a97d67), - C64e(0x5f5f431cfd1cbefd), C64e(0x45456025ea258aea), - C64e(0x2323f9dabfda46bf), C64e(0x53535102f702a6f7), - C64e(0xe4e445a196a1d396), C64e(0x9b9b76ed5bed2d5b), - C64e(0x7575285dc25deac2), C64e(0xe1e1c5241c24d91c), - C64e(0x3d3dd4e9aee97aae), C64e(0x4c4cf2be6abe986a), - C64e(0x6c6c82ee5aeed85a), C64e(0x7e7ebdc341c3fc41), - C64e(0xf5f5f3060206f102), C64e(0x838352d14fd11d4f), - C64e(0x68688ce45ce4d05c), C64e(0x51515607f407a2f4), - C64e(0xd1d18d5c345cb934), C64e(0xf9f9e1180818e908), - C64e(0xe2e24cae93aedf93), C64e(0xabab3e9573954d73), - C64e(0x626297f553f5c453), C64e(0x2a2a6b413f41543f), - C64e(0x08081c140c14100c), C64e(0x959563f652f63152), - C64e(0x4646e9af65af8c65), C64e(0x9d9d7fe25ee2215e), - C64e(0x3030487828786028), C64e(0x3737cff8a1f86ea1), - C64e(0x0a0a1b110f11140f), C64e(0x2f2febc4b5c45eb5), - C64e(0x0e0e151b091b1c09), C64e(0x24247e5a365a4836), - C64e(0x1b1badb69bb6369b), C64e(0xdfdf98473d47a53d), - C64e(0xcdcda76a266a8126), C64e(0x4e4ef5bb69bb9c69), - C64e(0x7f7f334ccd4cfecd), C64e(0xeaea50ba9fbacf9f), - C64e(0x12123f2d1b2d241b), C64e(0x1d1da4b99eb93a9e), - C64e(0x5858c49c749cb074), C64e(0x343446722e72682e), - C64e(0x363641772d776c2d), C64e(0xdcdc11cdb2cda3b2), - C64e(0xb4b49d29ee2973ee), C64e(0x5b5b4d16fb16b6fb), - C64e(0xa4a4a501f60153f6), C64e(0x7676a1d74dd7ec4d), - C64e(0xb7b714a361a37561), C64e(0x7d7d3449ce49face), - C64e(0x5252df8d7b8da47b), C64e(0xdddd9f423e42a13e), - C64e(0x5e5ecd937193bc71), C64e(0x1313b1a297a22697), - C64e(0xa6a6a204f50457f5), C64e(0xb9b901b868b86968), - C64e(0x0000000000000000), C64e(0xc1c1b5742c74992c), - C64e(0x4040e0a060a08060), C64e(0xe3e3c2211f21dd1f), - C64e(0x79793a43c843f2c8), C64e(0xb6b69a2ced2c77ed), - C64e(0xd4d40dd9bed9b3be), C64e(0x8d8d47ca46ca0146), - C64e(0x67671770d970ced9), C64e(0x7272afdd4bdde44b), - C64e(0x9494ed79de7933de), C64e(0x9898ff67d4672bd4), - C64e(0xb0b09323e8237be8), C64e(0x85855bde4ade114a), - C64e(0xbbbb06bd6bbd6d6b), C64e(0xc5c5bb7e2a7e912a), - C64e(0x4f4f7b34e5349ee5), C64e(0xededd73a163ac116), - C64e(0x8686d254c55417c5), C64e(0x9a9af862d7622fd7), - C64e(0x666699ff55ffcc55), C64e(0x1111b6a794a72294), - C64e(0x8a8ac04acf4a0fcf), C64e(0xe9e9d9301030c910), - C64e(0x04040e0a060a0806), C64e(0xfefe66988198e781), - C64e(0xa0a0ab0bf00b5bf0), C64e(0x7878b4cc44ccf044), - C64e(0x2525f0d5bad54aba), C64e(0x4b4b753ee33e96e3), - C64e(0xa2a2ac0ef30e5ff3), C64e(0x5d5d4419fe19bafe), - C64e(0x8080db5bc05b1bc0), C64e(0x050580858a850a8a), - C64e(0x3f3fd3ecadec7ead), C64e(0x2121fedfbcdf42bc), - C64e(0x7070a8d848d8e048), C64e(0xf1f1fd0c040cf904), - C64e(0x6363197adf7ac6df), C64e(0x77772f58c158eec1), - C64e(0xafaf309f759f4575), C64e(0x4242e7a563a58463), - C64e(0x2020705030504030), C64e(0xe5e5cb2e1a2ed11a), - C64e(0xfdfdef120e12e10e), C64e(0xbfbf08b76db7656d), - C64e(0x818155d44cd4194c), C64e(0x1818243c143c3014), - C64e(0x2626795f355f4c35), C64e(0xc3c3b2712f719d2f), - C64e(0xbebe8638e13867e1), C64e(0x3535c8fda2fd6aa2), - C64e(0x8888c74fcc4f0bcc), C64e(0x2e2e654b394b5c39), - C64e(0x93936af957f93d57), C64e(0x5555580df20daaf2), - C64e(0xfcfc619d829de382), C64e(0x7a7ab3c947c9f447), - C64e(0xc8c827efacef8bac), C64e(0xbaba8832e7326fe7), - C64e(0x32324f7d2b7d642b), C64e(0xe6e642a495a4d795), - C64e(0xc0c03bfba0fb9ba0), C64e(0x1919aab398b33298), - C64e(0x9e9ef668d16827d1), C64e(0xa3a322817f815d7f), - C64e(0x4444eeaa66aa8866), C64e(0x5454d6827e82a87e), - C64e(0x3b3bdde6abe676ab), C64e(0x0b0b959e839e1683), - C64e(0x8c8cc945ca4503ca), C64e(0xc7c7bc7b297b9529), - C64e(0x6b6b056ed36ed6d3), C64e(0x28286c443c44503c), - C64e(0xa7a72c8b798b5579), C64e(0xbcbc813de23d63e2), - C64e(0x161631271d272c1d), C64e(0xadad379a769a4176), - C64e(0xdbdb964d3b4dad3b), C64e(0x64649efa56fac856), - C64e(0x7474a6d24ed2e84e), C64e(0x141436221e22281e), - C64e(0x9292e476db763fdb), C64e(0x0c0c121e0a1e180a), - C64e(0x4848fcb46cb4906c), C64e(0xb8b88f37e4376be4), - C64e(0x9f9f78e75de7255d), C64e(0xbdbd0fb26eb2616e), - C64e(0x4343692aef2a86ef), C64e(0xc4c435f1a6f193a6), - C64e(0x3939dae3a8e372a8), C64e(0x3131c6f7a4f762a4), - C64e(0xd3d38a593759bd37), C64e(0xf2f274868b86ff8b), - C64e(0xd5d583563256b132), C64e(0x8b8b4ec543c50d43), - C64e(0x6e6e85eb59ebdc59), C64e(0xdada18c2b7c2afb7), - C64e(0x01018e8f8c8f028c), C64e(0xb1b11dac64ac7964), - C64e(0x9c9cf16dd26d23d2), C64e(0x4949723be03b92e0), - C64e(0xd8d81fc7b4c7abb4), C64e(0xacacb915fa1543fa), - C64e(0xf3f3fa090709fd07), C64e(0xcfcfa06f256f8525), - C64e(0xcaca20eaafea8faf), C64e(0xf4f47d898e89f38e), - C64e(0x47476720e9208ee9), C64e(0x1010382818282018), - C64e(0x6f6f0b64d564ded5), C64e(0xf0f073838883fb88), - C64e(0x4a4afbb16fb1946f), C64e(0x5c5cca967296b872), - C64e(0x3838546c246c7024), C64e(0x57575f08f108aef1), - C64e(0x73732152c752e6c7), C64e(0x979764f351f33551), - C64e(0xcbcbae6523658d23), C64e(0xa1a125847c84597c), - C64e(0xe8e857bf9cbfcb9c), C64e(0x3e3e5d6321637c21), - C64e(0x9696ea7cdd7c37dd), C64e(0x61611e7fdc7fc2dc), - C64e(0x0d0d9c9186911a86), C64e(0x0f0f9b9485941e85), - C64e(0xe0e04bab90abdb90), C64e(0x7c7cbac642c6f842), - C64e(0x71712657c457e2c4), C64e(0xcccc29e5aae583aa), - C64e(0x9090e373d8733bd8), C64e(0x0606090f050f0c05), - C64e(0xf7f7f4030103f501), C64e(0x1c1c2a3612363812), - C64e(0xc2c23cfea3fe9fa3), C64e(0x6a6a8be15fe1d45f), - C64e(0xaeaebe10f91047f9), C64e(0x6969026bd06bd2d0), - C64e(0x1717bfa891a82e91), C64e(0x999971e858e82958), - C64e(0x3a3a536927697427), C64e(0x2727f7d0b9d04eb9), - C64e(0xd9d991483848a938), C64e(0xebebde351335cd13), - C64e(0x2b2be5ceb3ce56b3), C64e(0x2222775533554433), - C64e(0xd2d204d6bbd6bfbb), C64e(0xa9a9399070904970), - C64e(0x0707878089800e89), C64e(0x3333c1f2a7f266a7), - C64e(0x2d2decc1b6c15ab6), C64e(0x3c3c5a6622667822), - C64e(0x1515b8ad92ad2a92), C64e(0xc9c9a96020608920), - C64e(0x87875cdb49db1549), C64e(0xaaaab01aff1a4fff), - C64e(0x5050d8887888a078), C64e(0xa5a52b8e7a8e517a), - C64e(0x0303898a8f8a068f), C64e(0x59594a13f813b2f8), - C64e(0x0909929b809b1280), C64e(0x1a1a233917393417), - C64e(0x65651075da75cada), C64e(0xd7d784533153b531), - C64e(0x8484d551c65113c6), C64e(0xd0d003d3b8d3bbb8), - C64e(0x8282dc5ec35e1fc3), C64e(0x2929e2cbb0cb52b0), - C64e(0x5a5ac3997799b477), C64e(0x1e1e2d3311333c11), - C64e(0x7b7b3d46cb46f6cb), C64e(0xa8a8b71ffc1f4bfc), - C64e(0x6d6d0c61d661dad6), C64e(0x2c2c624e3a4e583a) -}; - -static const sph_u64 T2[] = { - C64e(0xa5c6c632f4a5f497), C64e(0x84f8f86f978497eb), - C64e(0x99eeee5eb099b0c7), C64e(0x8df6f67a8c8d8cf7), - C64e(0x0dffffe8170d17e5), C64e(0xbdd6d60adcbddcb7), - C64e(0xb1dede16c8b1c8a7), C64e(0x5491916dfc54fc39), - C64e(0x50606090f050f0c0), C64e(0x0302020705030504), - C64e(0xa9cece2ee0a9e087), C64e(0x7d5656d1877d87ac), - C64e(0x19e7e7cc2b192bd5), C64e(0x62b5b513a662a671), - C64e(0xe64d4d7c31e6319a), C64e(0x9aecec59b59ab5c3), - C64e(0x458f8f40cf45cf05), C64e(0x9d1f1fa3bc9dbc3e), - C64e(0x40898949c040c009), C64e(0x87fafa68928792ef), - C64e(0x15efefd03f153fc5), C64e(0xebb2b29426eb267f), - C64e(0xc98e8ece40c94007), C64e(0x0bfbfbe61d0b1ded), - C64e(0xec41416e2fec2f82), C64e(0x67b3b31aa967a97d), - C64e(0xfd5f5f431cfd1cbe), C64e(0xea45456025ea258a), - C64e(0xbf2323f9dabfda46), C64e(0xf753535102f702a6), - C64e(0x96e4e445a196a1d3), C64e(0x5b9b9b76ed5bed2d), - C64e(0xc27575285dc25dea), C64e(0x1ce1e1c5241c24d9), - C64e(0xae3d3dd4e9aee97a), C64e(0x6a4c4cf2be6abe98), - C64e(0x5a6c6c82ee5aeed8), C64e(0x417e7ebdc341c3fc), - C64e(0x02f5f5f3060206f1), C64e(0x4f838352d14fd11d), - C64e(0x5c68688ce45ce4d0), C64e(0xf451515607f407a2), - C64e(0x34d1d18d5c345cb9), C64e(0x08f9f9e1180818e9), - C64e(0x93e2e24cae93aedf), C64e(0x73abab3e9573954d), - C64e(0x53626297f553f5c4), C64e(0x3f2a2a6b413f4154), - C64e(0x0c08081c140c1410), C64e(0x52959563f652f631), - C64e(0x654646e9af65af8c), C64e(0x5e9d9d7fe25ee221), - C64e(0x2830304878287860), C64e(0xa13737cff8a1f86e), - C64e(0x0f0a0a1b110f1114), C64e(0xb52f2febc4b5c45e), - C64e(0x090e0e151b091b1c), C64e(0x3624247e5a365a48), - C64e(0x9b1b1badb69bb636), C64e(0x3ddfdf98473d47a5), - C64e(0x26cdcda76a266a81), C64e(0x694e4ef5bb69bb9c), - C64e(0xcd7f7f334ccd4cfe), C64e(0x9feaea50ba9fbacf), - C64e(0x1b12123f2d1b2d24), C64e(0x9e1d1da4b99eb93a), - C64e(0x745858c49c749cb0), C64e(0x2e343446722e7268), - C64e(0x2d363641772d776c), C64e(0xb2dcdc11cdb2cda3), - C64e(0xeeb4b49d29ee2973), C64e(0xfb5b5b4d16fb16b6), - C64e(0xf6a4a4a501f60153), C64e(0x4d7676a1d74dd7ec), - C64e(0x61b7b714a361a375), C64e(0xce7d7d3449ce49fa), - C64e(0x7b5252df8d7b8da4), C64e(0x3edddd9f423e42a1), - C64e(0x715e5ecd937193bc), C64e(0x971313b1a297a226), - C64e(0xf5a6a6a204f50457), C64e(0x68b9b901b868b869), - C64e(0x0000000000000000), C64e(0x2cc1c1b5742c7499), - C64e(0x604040e0a060a080), C64e(0x1fe3e3c2211f21dd), - C64e(0xc879793a43c843f2), C64e(0xedb6b69a2ced2c77), - C64e(0xbed4d40dd9bed9b3), C64e(0x468d8d47ca46ca01), - C64e(0xd967671770d970ce), C64e(0x4b7272afdd4bdde4), - C64e(0xde9494ed79de7933), C64e(0xd49898ff67d4672b), - C64e(0xe8b0b09323e8237b), C64e(0x4a85855bde4ade11), - C64e(0x6bbbbb06bd6bbd6d), C64e(0x2ac5c5bb7e2a7e91), - C64e(0xe54f4f7b34e5349e), C64e(0x16ededd73a163ac1), - C64e(0xc58686d254c55417), C64e(0xd79a9af862d7622f), - C64e(0x55666699ff55ffcc), C64e(0x941111b6a794a722), - C64e(0xcf8a8ac04acf4a0f), C64e(0x10e9e9d9301030c9), - C64e(0x0604040e0a060a08), C64e(0x81fefe66988198e7), - C64e(0xf0a0a0ab0bf00b5b), C64e(0x447878b4cc44ccf0), - C64e(0xba2525f0d5bad54a), C64e(0xe34b4b753ee33e96), - C64e(0xf3a2a2ac0ef30e5f), C64e(0xfe5d5d4419fe19ba), - C64e(0xc08080db5bc05b1b), C64e(0x8a050580858a850a), - C64e(0xad3f3fd3ecadec7e), C64e(0xbc2121fedfbcdf42), - C64e(0x487070a8d848d8e0), C64e(0x04f1f1fd0c040cf9), - C64e(0xdf6363197adf7ac6), C64e(0xc177772f58c158ee), - C64e(0x75afaf309f759f45), C64e(0x634242e7a563a584), - C64e(0x3020207050305040), C64e(0x1ae5e5cb2e1a2ed1), - C64e(0x0efdfdef120e12e1), C64e(0x6dbfbf08b76db765), - C64e(0x4c818155d44cd419), C64e(0x141818243c143c30), - C64e(0x352626795f355f4c), C64e(0x2fc3c3b2712f719d), - C64e(0xe1bebe8638e13867), C64e(0xa23535c8fda2fd6a), - C64e(0xcc8888c74fcc4f0b), C64e(0x392e2e654b394b5c), - C64e(0x5793936af957f93d), C64e(0xf25555580df20daa), - C64e(0x82fcfc619d829de3), C64e(0x477a7ab3c947c9f4), - C64e(0xacc8c827efacef8b), C64e(0xe7baba8832e7326f), - C64e(0x2b32324f7d2b7d64), C64e(0x95e6e642a495a4d7), - C64e(0xa0c0c03bfba0fb9b), C64e(0x981919aab398b332), - C64e(0xd19e9ef668d16827), C64e(0x7fa3a322817f815d), - C64e(0x664444eeaa66aa88), C64e(0x7e5454d6827e82a8), - C64e(0xab3b3bdde6abe676), C64e(0x830b0b959e839e16), - C64e(0xca8c8cc945ca4503), C64e(0x29c7c7bc7b297b95), - C64e(0xd36b6b056ed36ed6), C64e(0x3c28286c443c4450), - C64e(0x79a7a72c8b798b55), C64e(0xe2bcbc813de23d63), - C64e(0x1d161631271d272c), C64e(0x76adad379a769a41), - C64e(0x3bdbdb964d3b4dad), C64e(0x5664649efa56fac8), - C64e(0x4e7474a6d24ed2e8), C64e(0x1e141436221e2228), - C64e(0xdb9292e476db763f), C64e(0x0a0c0c121e0a1e18), - C64e(0x6c4848fcb46cb490), C64e(0xe4b8b88f37e4376b), - C64e(0x5d9f9f78e75de725), C64e(0x6ebdbd0fb26eb261), - C64e(0xef4343692aef2a86), C64e(0xa6c4c435f1a6f193), - C64e(0xa83939dae3a8e372), C64e(0xa43131c6f7a4f762), - C64e(0x37d3d38a593759bd), C64e(0x8bf2f274868b86ff), - C64e(0x32d5d583563256b1), C64e(0x438b8b4ec543c50d), - C64e(0x596e6e85eb59ebdc), C64e(0xb7dada18c2b7c2af), - C64e(0x8c01018e8f8c8f02), C64e(0x64b1b11dac64ac79), - C64e(0xd29c9cf16dd26d23), C64e(0xe04949723be03b92), - C64e(0xb4d8d81fc7b4c7ab), C64e(0xfaacacb915fa1543), - C64e(0x07f3f3fa090709fd), C64e(0x25cfcfa06f256f85), - C64e(0xafcaca20eaafea8f), C64e(0x8ef4f47d898e89f3), - C64e(0xe947476720e9208e), C64e(0x1810103828182820), - C64e(0xd56f6f0b64d564de), C64e(0x88f0f073838883fb), - C64e(0x6f4a4afbb16fb194), C64e(0x725c5cca967296b8), - C64e(0x243838546c246c70), C64e(0xf157575f08f108ae), - C64e(0xc773732152c752e6), C64e(0x51979764f351f335), - C64e(0x23cbcbae6523658d), C64e(0x7ca1a125847c8459), - C64e(0x9ce8e857bf9cbfcb), C64e(0x213e3e5d6321637c), - C64e(0xdd9696ea7cdd7c37), C64e(0xdc61611e7fdc7fc2), - C64e(0x860d0d9c9186911a), C64e(0x850f0f9b9485941e), - C64e(0x90e0e04bab90abdb), C64e(0x427c7cbac642c6f8), - C64e(0xc471712657c457e2), C64e(0xaacccc29e5aae583), - C64e(0xd89090e373d8733b), C64e(0x050606090f050f0c), - C64e(0x01f7f7f4030103f5), C64e(0x121c1c2a36123638), - C64e(0xa3c2c23cfea3fe9f), C64e(0x5f6a6a8be15fe1d4), - C64e(0xf9aeaebe10f91047), C64e(0xd06969026bd06bd2), - C64e(0x911717bfa891a82e), C64e(0x58999971e858e829), - C64e(0x273a3a5369276974), C64e(0xb92727f7d0b9d04e), - C64e(0x38d9d991483848a9), C64e(0x13ebebde351335cd), - C64e(0xb32b2be5ceb3ce56), C64e(0x3322227755335544), - C64e(0xbbd2d204d6bbd6bf), C64e(0x70a9a93990709049), - C64e(0x890707878089800e), C64e(0xa73333c1f2a7f266), - C64e(0xb62d2decc1b6c15a), C64e(0x223c3c5a66226678), - C64e(0x921515b8ad92ad2a), C64e(0x20c9c9a960206089), - C64e(0x4987875cdb49db15), C64e(0xffaaaab01aff1a4f), - C64e(0x785050d8887888a0), C64e(0x7aa5a52b8e7a8e51), - C64e(0x8f0303898a8f8a06), C64e(0xf859594a13f813b2), - C64e(0x800909929b809b12), C64e(0x171a1a2339173934), - C64e(0xda65651075da75ca), C64e(0x31d7d784533153b5), - C64e(0xc68484d551c65113), C64e(0xb8d0d003d3b8d3bb), - C64e(0xc38282dc5ec35e1f), C64e(0xb02929e2cbb0cb52), - C64e(0x775a5ac3997799b4), C64e(0x111e1e2d3311333c), - C64e(0xcb7b7b3d46cb46f6), C64e(0xfca8a8b71ffc1f4b), - C64e(0xd66d6d0c61d661da), C64e(0x3a2c2c624e3a4e58) -}; - -static const sph_u64 T3[] = { - C64e(0x97a5c6c632f4a5f4), C64e(0xeb84f8f86f978497), - C64e(0xc799eeee5eb099b0), C64e(0xf78df6f67a8c8d8c), - C64e(0xe50dffffe8170d17), C64e(0xb7bdd6d60adcbddc), - C64e(0xa7b1dede16c8b1c8), C64e(0x395491916dfc54fc), - C64e(0xc050606090f050f0), C64e(0x0403020207050305), - C64e(0x87a9cece2ee0a9e0), C64e(0xac7d5656d1877d87), - C64e(0xd519e7e7cc2b192b), C64e(0x7162b5b513a662a6), - C64e(0x9ae64d4d7c31e631), C64e(0xc39aecec59b59ab5), - C64e(0x05458f8f40cf45cf), C64e(0x3e9d1f1fa3bc9dbc), - C64e(0x0940898949c040c0), C64e(0xef87fafa68928792), - C64e(0xc515efefd03f153f), C64e(0x7febb2b29426eb26), - C64e(0x07c98e8ece40c940), C64e(0xed0bfbfbe61d0b1d), - C64e(0x82ec41416e2fec2f), C64e(0x7d67b3b31aa967a9), - C64e(0xbefd5f5f431cfd1c), C64e(0x8aea45456025ea25), - C64e(0x46bf2323f9dabfda), C64e(0xa6f753535102f702), - C64e(0xd396e4e445a196a1), C64e(0x2d5b9b9b76ed5bed), - C64e(0xeac27575285dc25d), C64e(0xd91ce1e1c5241c24), - C64e(0x7aae3d3dd4e9aee9), C64e(0x986a4c4cf2be6abe), - C64e(0xd85a6c6c82ee5aee), C64e(0xfc417e7ebdc341c3), - C64e(0xf102f5f5f3060206), C64e(0x1d4f838352d14fd1), - C64e(0xd05c68688ce45ce4), C64e(0xa2f451515607f407), - C64e(0xb934d1d18d5c345c), C64e(0xe908f9f9e1180818), - C64e(0xdf93e2e24cae93ae), C64e(0x4d73abab3e957395), - C64e(0xc453626297f553f5), C64e(0x543f2a2a6b413f41), - C64e(0x100c08081c140c14), C64e(0x3152959563f652f6), - C64e(0x8c654646e9af65af), C64e(0x215e9d9d7fe25ee2), - C64e(0x6028303048782878), C64e(0x6ea13737cff8a1f8), - C64e(0x140f0a0a1b110f11), C64e(0x5eb52f2febc4b5c4), - C64e(0x1c090e0e151b091b), C64e(0x483624247e5a365a), - C64e(0x369b1b1badb69bb6), C64e(0xa53ddfdf98473d47), - C64e(0x8126cdcda76a266a), C64e(0x9c694e4ef5bb69bb), - C64e(0xfecd7f7f334ccd4c), C64e(0xcf9feaea50ba9fba), - C64e(0x241b12123f2d1b2d), C64e(0x3a9e1d1da4b99eb9), - C64e(0xb0745858c49c749c), C64e(0x682e343446722e72), - C64e(0x6c2d363641772d77), C64e(0xa3b2dcdc11cdb2cd), - C64e(0x73eeb4b49d29ee29), C64e(0xb6fb5b5b4d16fb16), - C64e(0x53f6a4a4a501f601), C64e(0xec4d7676a1d74dd7), - C64e(0x7561b7b714a361a3), C64e(0xface7d7d3449ce49), - C64e(0xa47b5252df8d7b8d), C64e(0xa13edddd9f423e42), - C64e(0xbc715e5ecd937193), C64e(0x26971313b1a297a2), - C64e(0x57f5a6a6a204f504), C64e(0x6968b9b901b868b8), - C64e(0x0000000000000000), C64e(0x992cc1c1b5742c74), - C64e(0x80604040e0a060a0), C64e(0xdd1fe3e3c2211f21), - C64e(0xf2c879793a43c843), C64e(0x77edb6b69a2ced2c), - C64e(0xb3bed4d40dd9bed9), C64e(0x01468d8d47ca46ca), - C64e(0xced967671770d970), C64e(0xe44b7272afdd4bdd), - C64e(0x33de9494ed79de79), C64e(0x2bd49898ff67d467), - C64e(0x7be8b0b09323e823), C64e(0x114a85855bde4ade), - C64e(0x6d6bbbbb06bd6bbd), C64e(0x912ac5c5bb7e2a7e), - C64e(0x9ee54f4f7b34e534), C64e(0xc116ededd73a163a), - C64e(0x17c58686d254c554), C64e(0x2fd79a9af862d762), - C64e(0xcc55666699ff55ff), C64e(0x22941111b6a794a7), - C64e(0x0fcf8a8ac04acf4a), C64e(0xc910e9e9d9301030), - C64e(0x080604040e0a060a), C64e(0xe781fefe66988198), - C64e(0x5bf0a0a0ab0bf00b), C64e(0xf0447878b4cc44cc), - C64e(0x4aba2525f0d5bad5), C64e(0x96e34b4b753ee33e), - C64e(0x5ff3a2a2ac0ef30e), C64e(0xbafe5d5d4419fe19), - C64e(0x1bc08080db5bc05b), C64e(0x0a8a050580858a85), - C64e(0x7ead3f3fd3ecadec), C64e(0x42bc2121fedfbcdf), - C64e(0xe0487070a8d848d8), C64e(0xf904f1f1fd0c040c), - C64e(0xc6df6363197adf7a), C64e(0xeec177772f58c158), - C64e(0x4575afaf309f759f), C64e(0x84634242e7a563a5), - C64e(0x4030202070503050), C64e(0xd11ae5e5cb2e1a2e), - C64e(0xe10efdfdef120e12), C64e(0x656dbfbf08b76db7), - C64e(0x194c818155d44cd4), C64e(0x30141818243c143c), - C64e(0x4c352626795f355f), C64e(0x9d2fc3c3b2712f71), - C64e(0x67e1bebe8638e138), C64e(0x6aa23535c8fda2fd), - C64e(0x0bcc8888c74fcc4f), C64e(0x5c392e2e654b394b), - C64e(0x3d5793936af957f9), C64e(0xaaf25555580df20d), - C64e(0xe382fcfc619d829d), C64e(0xf4477a7ab3c947c9), - C64e(0x8bacc8c827efacef), C64e(0x6fe7baba8832e732), - C64e(0x642b32324f7d2b7d), C64e(0xd795e6e642a495a4), - C64e(0x9ba0c0c03bfba0fb), C64e(0x32981919aab398b3), - C64e(0x27d19e9ef668d168), C64e(0x5d7fa3a322817f81), - C64e(0x88664444eeaa66aa), C64e(0xa87e5454d6827e82), - C64e(0x76ab3b3bdde6abe6), C64e(0x16830b0b959e839e), - C64e(0x03ca8c8cc945ca45), C64e(0x9529c7c7bc7b297b), - C64e(0xd6d36b6b056ed36e), C64e(0x503c28286c443c44), - C64e(0x5579a7a72c8b798b), C64e(0x63e2bcbc813de23d), - C64e(0x2c1d161631271d27), C64e(0x4176adad379a769a), - C64e(0xad3bdbdb964d3b4d), C64e(0xc85664649efa56fa), - C64e(0xe84e7474a6d24ed2), C64e(0x281e141436221e22), - C64e(0x3fdb9292e476db76), C64e(0x180a0c0c121e0a1e), - C64e(0x906c4848fcb46cb4), C64e(0x6be4b8b88f37e437), - C64e(0x255d9f9f78e75de7), C64e(0x616ebdbd0fb26eb2), - C64e(0x86ef4343692aef2a), C64e(0x93a6c4c435f1a6f1), - C64e(0x72a83939dae3a8e3), C64e(0x62a43131c6f7a4f7), - C64e(0xbd37d3d38a593759), C64e(0xff8bf2f274868b86), - C64e(0xb132d5d583563256), C64e(0x0d438b8b4ec543c5), - C64e(0xdc596e6e85eb59eb), C64e(0xafb7dada18c2b7c2), - C64e(0x028c01018e8f8c8f), C64e(0x7964b1b11dac64ac), - C64e(0x23d29c9cf16dd26d), C64e(0x92e04949723be03b), - C64e(0xabb4d8d81fc7b4c7), C64e(0x43faacacb915fa15), - C64e(0xfd07f3f3fa090709), C64e(0x8525cfcfa06f256f), - C64e(0x8fafcaca20eaafea), C64e(0xf38ef4f47d898e89), - C64e(0x8ee947476720e920), C64e(0x2018101038281828), - C64e(0xded56f6f0b64d564), C64e(0xfb88f0f073838883), - C64e(0x946f4a4afbb16fb1), C64e(0xb8725c5cca967296), - C64e(0x70243838546c246c), C64e(0xaef157575f08f108), - C64e(0xe6c773732152c752), C64e(0x3551979764f351f3), - C64e(0x8d23cbcbae652365), C64e(0x597ca1a125847c84), - C64e(0xcb9ce8e857bf9cbf), C64e(0x7c213e3e5d632163), - C64e(0x37dd9696ea7cdd7c), C64e(0xc2dc61611e7fdc7f), - C64e(0x1a860d0d9c918691), C64e(0x1e850f0f9b948594), - C64e(0xdb90e0e04bab90ab), C64e(0xf8427c7cbac642c6), - C64e(0xe2c471712657c457), C64e(0x83aacccc29e5aae5), - C64e(0x3bd89090e373d873), C64e(0x0c050606090f050f), - C64e(0xf501f7f7f4030103), C64e(0x38121c1c2a361236), - C64e(0x9fa3c2c23cfea3fe), C64e(0xd45f6a6a8be15fe1), - C64e(0x47f9aeaebe10f910), C64e(0xd2d06969026bd06b), - C64e(0x2e911717bfa891a8), C64e(0x2958999971e858e8), - C64e(0x74273a3a53692769), C64e(0x4eb92727f7d0b9d0), - C64e(0xa938d9d991483848), C64e(0xcd13ebebde351335), - C64e(0x56b32b2be5ceb3ce), C64e(0x4433222277553355), - C64e(0xbfbbd2d204d6bbd6), C64e(0x4970a9a939907090), - C64e(0x0e89070787808980), C64e(0x66a73333c1f2a7f2), - C64e(0x5ab62d2decc1b6c1), C64e(0x78223c3c5a662266), - C64e(0x2a921515b8ad92ad), C64e(0x8920c9c9a9602060), - C64e(0x154987875cdb49db), C64e(0x4fffaaaab01aff1a), - C64e(0xa0785050d8887888), C64e(0x517aa5a52b8e7a8e), - C64e(0x068f0303898a8f8a), C64e(0xb2f859594a13f813), - C64e(0x12800909929b809b), C64e(0x34171a1a23391739), - C64e(0xcada65651075da75), C64e(0xb531d7d784533153), - C64e(0x13c68484d551c651), C64e(0xbbb8d0d003d3b8d3), - C64e(0x1fc38282dc5ec35e), C64e(0x52b02929e2cbb0cb), - C64e(0xb4775a5ac3997799), C64e(0x3c111e1e2d331133), - C64e(0xf6cb7b7b3d46cb46), C64e(0x4bfca8a8b71ffc1f), - C64e(0xdad66d6d0c61d661), C64e(0x583a2c2c624e3a4e) -}; - -#endif - -static const sph_u64 T4[] = { - C64e(0xf497a5c6c632f4a5), C64e(0x97eb84f8f86f9784), - C64e(0xb0c799eeee5eb099), C64e(0x8cf78df6f67a8c8d), - C64e(0x17e50dffffe8170d), C64e(0xdcb7bdd6d60adcbd), - C64e(0xc8a7b1dede16c8b1), C64e(0xfc395491916dfc54), - C64e(0xf0c050606090f050), C64e(0x0504030202070503), - C64e(0xe087a9cece2ee0a9), C64e(0x87ac7d5656d1877d), - C64e(0x2bd519e7e7cc2b19), C64e(0xa67162b5b513a662), - C64e(0x319ae64d4d7c31e6), C64e(0xb5c39aecec59b59a), - C64e(0xcf05458f8f40cf45), C64e(0xbc3e9d1f1fa3bc9d), - C64e(0xc00940898949c040), C64e(0x92ef87fafa689287), - C64e(0x3fc515efefd03f15), C64e(0x267febb2b29426eb), - C64e(0x4007c98e8ece40c9), C64e(0x1ded0bfbfbe61d0b), - C64e(0x2f82ec41416e2fec), C64e(0xa97d67b3b31aa967), - C64e(0x1cbefd5f5f431cfd), C64e(0x258aea45456025ea), - C64e(0xda46bf2323f9dabf), C64e(0x02a6f753535102f7), - C64e(0xa1d396e4e445a196), C64e(0xed2d5b9b9b76ed5b), - C64e(0x5deac27575285dc2), C64e(0x24d91ce1e1c5241c), - C64e(0xe97aae3d3dd4e9ae), C64e(0xbe986a4c4cf2be6a), - C64e(0xeed85a6c6c82ee5a), C64e(0xc3fc417e7ebdc341), - C64e(0x06f102f5f5f30602), C64e(0xd11d4f838352d14f), - C64e(0xe4d05c68688ce45c), C64e(0x07a2f451515607f4), - C64e(0x5cb934d1d18d5c34), C64e(0x18e908f9f9e11808), - C64e(0xaedf93e2e24cae93), C64e(0x954d73abab3e9573), - C64e(0xf5c453626297f553), C64e(0x41543f2a2a6b413f), - C64e(0x14100c08081c140c), C64e(0xf63152959563f652), - C64e(0xaf8c654646e9af65), C64e(0xe2215e9d9d7fe25e), - C64e(0x7860283030487828), C64e(0xf86ea13737cff8a1), - C64e(0x11140f0a0a1b110f), C64e(0xc45eb52f2febc4b5), - C64e(0x1b1c090e0e151b09), C64e(0x5a483624247e5a36), - C64e(0xb6369b1b1badb69b), C64e(0x47a53ddfdf98473d), - C64e(0x6a8126cdcda76a26), C64e(0xbb9c694e4ef5bb69), - C64e(0x4cfecd7f7f334ccd), C64e(0xbacf9feaea50ba9f), - C64e(0x2d241b12123f2d1b), C64e(0xb93a9e1d1da4b99e), - C64e(0x9cb0745858c49c74), C64e(0x72682e343446722e), - C64e(0x776c2d363641772d), C64e(0xcda3b2dcdc11cdb2), - C64e(0x2973eeb4b49d29ee), C64e(0x16b6fb5b5b4d16fb), - C64e(0x0153f6a4a4a501f6), C64e(0xd7ec4d7676a1d74d), - C64e(0xa37561b7b714a361), C64e(0x49face7d7d3449ce), - C64e(0x8da47b5252df8d7b), C64e(0x42a13edddd9f423e), - C64e(0x93bc715e5ecd9371), C64e(0xa226971313b1a297), - C64e(0x0457f5a6a6a204f5), C64e(0xb86968b9b901b868), - C64e(0x0000000000000000), C64e(0x74992cc1c1b5742c), - C64e(0xa080604040e0a060), C64e(0x21dd1fe3e3c2211f), - C64e(0x43f2c879793a43c8), C64e(0x2c77edb6b69a2ced), - C64e(0xd9b3bed4d40dd9be), C64e(0xca01468d8d47ca46), - C64e(0x70ced967671770d9), C64e(0xdde44b7272afdd4b), - C64e(0x7933de9494ed79de), C64e(0x672bd49898ff67d4), - C64e(0x237be8b0b09323e8), C64e(0xde114a85855bde4a), - C64e(0xbd6d6bbbbb06bd6b), C64e(0x7e912ac5c5bb7e2a), - C64e(0x349ee54f4f7b34e5), C64e(0x3ac116ededd73a16), - C64e(0x5417c58686d254c5), C64e(0x622fd79a9af862d7), - C64e(0xffcc55666699ff55), C64e(0xa722941111b6a794), - C64e(0x4a0fcf8a8ac04acf), C64e(0x30c910e9e9d93010), - C64e(0x0a080604040e0a06), C64e(0x98e781fefe669881), - C64e(0x0b5bf0a0a0ab0bf0), C64e(0xccf0447878b4cc44), - C64e(0xd54aba2525f0d5ba), C64e(0x3e96e34b4b753ee3), - C64e(0x0e5ff3a2a2ac0ef3), C64e(0x19bafe5d5d4419fe), - C64e(0x5b1bc08080db5bc0), C64e(0x850a8a050580858a), - C64e(0xec7ead3f3fd3ecad), C64e(0xdf42bc2121fedfbc), - C64e(0xd8e0487070a8d848), C64e(0x0cf904f1f1fd0c04), - C64e(0x7ac6df6363197adf), C64e(0x58eec177772f58c1), - C64e(0x9f4575afaf309f75), C64e(0xa584634242e7a563), - C64e(0x5040302020705030), C64e(0x2ed11ae5e5cb2e1a), - C64e(0x12e10efdfdef120e), C64e(0xb7656dbfbf08b76d), - C64e(0xd4194c818155d44c), C64e(0x3c30141818243c14), - C64e(0x5f4c352626795f35), C64e(0x719d2fc3c3b2712f), - C64e(0x3867e1bebe8638e1), C64e(0xfd6aa23535c8fda2), - C64e(0x4f0bcc8888c74fcc), C64e(0x4b5c392e2e654b39), - C64e(0xf93d5793936af957), C64e(0x0daaf25555580df2), - C64e(0x9de382fcfc619d82), C64e(0xc9f4477a7ab3c947), - C64e(0xef8bacc8c827efac), C64e(0x326fe7baba8832e7), - C64e(0x7d642b32324f7d2b), C64e(0xa4d795e6e642a495), - C64e(0xfb9ba0c0c03bfba0), C64e(0xb332981919aab398), - C64e(0x6827d19e9ef668d1), C64e(0x815d7fa3a322817f), - C64e(0xaa88664444eeaa66), C64e(0x82a87e5454d6827e), - C64e(0xe676ab3b3bdde6ab), C64e(0x9e16830b0b959e83), - C64e(0x4503ca8c8cc945ca), C64e(0x7b9529c7c7bc7b29), - C64e(0x6ed6d36b6b056ed3), C64e(0x44503c28286c443c), - C64e(0x8b5579a7a72c8b79), C64e(0x3d63e2bcbc813de2), - C64e(0x272c1d161631271d), C64e(0x9a4176adad379a76), - C64e(0x4dad3bdbdb964d3b), C64e(0xfac85664649efa56), - C64e(0xd2e84e7474a6d24e), C64e(0x22281e141436221e), - C64e(0x763fdb9292e476db), C64e(0x1e180a0c0c121e0a), - C64e(0xb4906c4848fcb46c), C64e(0x376be4b8b88f37e4), - C64e(0xe7255d9f9f78e75d), C64e(0xb2616ebdbd0fb26e), - C64e(0x2a86ef4343692aef), C64e(0xf193a6c4c435f1a6), - C64e(0xe372a83939dae3a8), C64e(0xf762a43131c6f7a4), - C64e(0x59bd37d3d38a5937), C64e(0x86ff8bf2f274868b), - C64e(0x56b132d5d5835632), C64e(0xc50d438b8b4ec543), - C64e(0xebdc596e6e85eb59), C64e(0xc2afb7dada18c2b7), - C64e(0x8f028c01018e8f8c), C64e(0xac7964b1b11dac64), - C64e(0x6d23d29c9cf16dd2), C64e(0x3b92e04949723be0), - C64e(0xc7abb4d8d81fc7b4), C64e(0x1543faacacb915fa), - C64e(0x09fd07f3f3fa0907), C64e(0x6f8525cfcfa06f25), - C64e(0xea8fafcaca20eaaf), C64e(0x89f38ef4f47d898e), - C64e(0x208ee947476720e9), C64e(0x2820181010382818), - C64e(0x64ded56f6f0b64d5), C64e(0x83fb88f0f0738388), - C64e(0xb1946f4a4afbb16f), C64e(0x96b8725c5cca9672), - C64e(0x6c70243838546c24), C64e(0x08aef157575f08f1), - C64e(0x52e6c773732152c7), C64e(0xf33551979764f351), - C64e(0x658d23cbcbae6523), C64e(0x84597ca1a125847c), - C64e(0xbfcb9ce8e857bf9c), C64e(0x637c213e3e5d6321), - C64e(0x7c37dd9696ea7cdd), C64e(0x7fc2dc61611e7fdc), - C64e(0x911a860d0d9c9186), C64e(0x941e850f0f9b9485), - C64e(0xabdb90e0e04bab90), C64e(0xc6f8427c7cbac642), - C64e(0x57e2c471712657c4), C64e(0xe583aacccc29e5aa), - C64e(0x733bd89090e373d8), C64e(0x0f0c050606090f05), - C64e(0x03f501f7f7f40301), C64e(0x3638121c1c2a3612), - C64e(0xfe9fa3c2c23cfea3), C64e(0xe1d45f6a6a8be15f), - C64e(0x1047f9aeaebe10f9), C64e(0x6bd2d06969026bd0), - C64e(0xa82e911717bfa891), C64e(0xe82958999971e858), - C64e(0x6974273a3a536927), C64e(0xd04eb92727f7d0b9), - C64e(0x48a938d9d9914838), C64e(0x35cd13ebebde3513), - C64e(0xce56b32b2be5ceb3), C64e(0x5544332222775533), - C64e(0xd6bfbbd2d204d6bb), C64e(0x904970a9a9399070), - C64e(0x800e890707878089), C64e(0xf266a73333c1f2a7), - C64e(0xc15ab62d2decc1b6), C64e(0x6678223c3c5a6622), - C64e(0xad2a921515b8ad92), C64e(0x608920c9c9a96020), - C64e(0xdb154987875cdb49), C64e(0x1a4fffaaaab01aff), - C64e(0x88a0785050d88878), C64e(0x8e517aa5a52b8e7a), - C64e(0x8a068f0303898a8f), C64e(0x13b2f859594a13f8), - C64e(0x9b12800909929b80), C64e(0x3934171a1a233917), - C64e(0x75cada65651075da), C64e(0x53b531d7d7845331), - C64e(0x5113c68484d551c6), C64e(0xd3bbb8d0d003d3b8), - C64e(0x5e1fc38282dc5ec3), C64e(0xcb52b02929e2cbb0), - C64e(0x99b4775a5ac39977), C64e(0x333c111e1e2d3311), - C64e(0x46f6cb7b7b3d46cb), C64e(0x1f4bfca8a8b71ffc), - C64e(0x61dad66d6d0c61d6), C64e(0x4e583a2c2c624e3a) -}; - -#if !SPH_SMALL_FOOTPRINT_GROESTL - -static const sph_u64 T5[] = { - C64e(0xa5f497a5c6c632f4), C64e(0x8497eb84f8f86f97), - C64e(0x99b0c799eeee5eb0), C64e(0x8d8cf78df6f67a8c), - C64e(0x0d17e50dffffe817), C64e(0xbddcb7bdd6d60adc), - C64e(0xb1c8a7b1dede16c8), C64e(0x54fc395491916dfc), - C64e(0x50f0c050606090f0), C64e(0x0305040302020705), - C64e(0xa9e087a9cece2ee0), C64e(0x7d87ac7d5656d187), - C64e(0x192bd519e7e7cc2b), C64e(0x62a67162b5b513a6), - C64e(0xe6319ae64d4d7c31), C64e(0x9ab5c39aecec59b5), - C64e(0x45cf05458f8f40cf), C64e(0x9dbc3e9d1f1fa3bc), - C64e(0x40c00940898949c0), C64e(0x8792ef87fafa6892), - C64e(0x153fc515efefd03f), C64e(0xeb267febb2b29426), - C64e(0xc94007c98e8ece40), C64e(0x0b1ded0bfbfbe61d), - C64e(0xec2f82ec41416e2f), C64e(0x67a97d67b3b31aa9), - C64e(0xfd1cbefd5f5f431c), C64e(0xea258aea45456025), - C64e(0xbfda46bf2323f9da), C64e(0xf702a6f753535102), - C64e(0x96a1d396e4e445a1), C64e(0x5bed2d5b9b9b76ed), - C64e(0xc25deac27575285d), C64e(0x1c24d91ce1e1c524), - C64e(0xaee97aae3d3dd4e9), C64e(0x6abe986a4c4cf2be), - C64e(0x5aeed85a6c6c82ee), C64e(0x41c3fc417e7ebdc3), - C64e(0x0206f102f5f5f306), C64e(0x4fd11d4f838352d1), - C64e(0x5ce4d05c68688ce4), C64e(0xf407a2f451515607), - C64e(0x345cb934d1d18d5c), C64e(0x0818e908f9f9e118), - C64e(0x93aedf93e2e24cae), C64e(0x73954d73abab3e95), - C64e(0x53f5c453626297f5), C64e(0x3f41543f2a2a6b41), - C64e(0x0c14100c08081c14), C64e(0x52f63152959563f6), - C64e(0x65af8c654646e9af), C64e(0x5ee2215e9d9d7fe2), - C64e(0x2878602830304878), C64e(0xa1f86ea13737cff8), - C64e(0x0f11140f0a0a1b11), C64e(0xb5c45eb52f2febc4), - C64e(0x091b1c090e0e151b), C64e(0x365a483624247e5a), - C64e(0x9bb6369b1b1badb6), C64e(0x3d47a53ddfdf9847), - C64e(0x266a8126cdcda76a), C64e(0x69bb9c694e4ef5bb), - C64e(0xcd4cfecd7f7f334c), C64e(0x9fbacf9feaea50ba), - C64e(0x1b2d241b12123f2d), C64e(0x9eb93a9e1d1da4b9), - C64e(0x749cb0745858c49c), C64e(0x2e72682e34344672), - C64e(0x2d776c2d36364177), C64e(0xb2cda3b2dcdc11cd), - C64e(0xee2973eeb4b49d29), C64e(0xfb16b6fb5b5b4d16), - C64e(0xf60153f6a4a4a501), C64e(0x4dd7ec4d7676a1d7), - C64e(0x61a37561b7b714a3), C64e(0xce49face7d7d3449), - C64e(0x7b8da47b5252df8d), C64e(0x3e42a13edddd9f42), - C64e(0x7193bc715e5ecd93), C64e(0x97a226971313b1a2), - C64e(0xf50457f5a6a6a204), C64e(0x68b86968b9b901b8), - C64e(0x0000000000000000), C64e(0x2c74992cc1c1b574), - C64e(0x60a080604040e0a0), C64e(0x1f21dd1fe3e3c221), - C64e(0xc843f2c879793a43), C64e(0xed2c77edb6b69a2c), - C64e(0xbed9b3bed4d40dd9), C64e(0x46ca01468d8d47ca), - C64e(0xd970ced967671770), C64e(0x4bdde44b7272afdd), - C64e(0xde7933de9494ed79), C64e(0xd4672bd49898ff67), - C64e(0xe8237be8b0b09323), C64e(0x4ade114a85855bde), - C64e(0x6bbd6d6bbbbb06bd), C64e(0x2a7e912ac5c5bb7e), - C64e(0xe5349ee54f4f7b34), C64e(0x163ac116ededd73a), - C64e(0xc55417c58686d254), C64e(0xd7622fd79a9af862), - C64e(0x55ffcc55666699ff), C64e(0x94a722941111b6a7), - C64e(0xcf4a0fcf8a8ac04a), C64e(0x1030c910e9e9d930), - C64e(0x060a080604040e0a), C64e(0x8198e781fefe6698), - C64e(0xf00b5bf0a0a0ab0b), C64e(0x44ccf0447878b4cc), - C64e(0xbad54aba2525f0d5), C64e(0xe33e96e34b4b753e), - C64e(0xf30e5ff3a2a2ac0e), C64e(0xfe19bafe5d5d4419), - C64e(0xc05b1bc08080db5b), C64e(0x8a850a8a05058085), - C64e(0xadec7ead3f3fd3ec), C64e(0xbcdf42bc2121fedf), - C64e(0x48d8e0487070a8d8), C64e(0x040cf904f1f1fd0c), - C64e(0xdf7ac6df6363197a), C64e(0xc158eec177772f58), - C64e(0x759f4575afaf309f), C64e(0x63a584634242e7a5), - C64e(0x3050403020207050), C64e(0x1a2ed11ae5e5cb2e), - C64e(0x0e12e10efdfdef12), C64e(0x6db7656dbfbf08b7), - C64e(0x4cd4194c818155d4), C64e(0x143c30141818243c), - C64e(0x355f4c352626795f), C64e(0x2f719d2fc3c3b271), - C64e(0xe13867e1bebe8638), C64e(0xa2fd6aa23535c8fd), - C64e(0xcc4f0bcc8888c74f), C64e(0x394b5c392e2e654b), - C64e(0x57f93d5793936af9), C64e(0xf20daaf25555580d), - C64e(0x829de382fcfc619d), C64e(0x47c9f4477a7ab3c9), - C64e(0xacef8bacc8c827ef), C64e(0xe7326fe7baba8832), - C64e(0x2b7d642b32324f7d), C64e(0x95a4d795e6e642a4), - C64e(0xa0fb9ba0c0c03bfb), C64e(0x98b332981919aab3), - C64e(0xd16827d19e9ef668), C64e(0x7f815d7fa3a32281), - C64e(0x66aa88664444eeaa), C64e(0x7e82a87e5454d682), - C64e(0xabe676ab3b3bdde6), C64e(0x839e16830b0b959e), - C64e(0xca4503ca8c8cc945), C64e(0x297b9529c7c7bc7b), - C64e(0xd36ed6d36b6b056e), C64e(0x3c44503c28286c44), - C64e(0x798b5579a7a72c8b), C64e(0xe23d63e2bcbc813d), - C64e(0x1d272c1d16163127), C64e(0x769a4176adad379a), - C64e(0x3b4dad3bdbdb964d), C64e(0x56fac85664649efa), - C64e(0x4ed2e84e7474a6d2), C64e(0x1e22281e14143622), - C64e(0xdb763fdb9292e476), C64e(0x0a1e180a0c0c121e), - C64e(0x6cb4906c4848fcb4), C64e(0xe4376be4b8b88f37), - C64e(0x5de7255d9f9f78e7), C64e(0x6eb2616ebdbd0fb2), - C64e(0xef2a86ef4343692a), C64e(0xa6f193a6c4c435f1), - C64e(0xa8e372a83939dae3), C64e(0xa4f762a43131c6f7), - C64e(0x3759bd37d3d38a59), C64e(0x8b86ff8bf2f27486), - C64e(0x3256b132d5d58356), C64e(0x43c50d438b8b4ec5), - C64e(0x59ebdc596e6e85eb), C64e(0xb7c2afb7dada18c2), - C64e(0x8c8f028c01018e8f), C64e(0x64ac7964b1b11dac), - C64e(0xd26d23d29c9cf16d), C64e(0xe03b92e04949723b), - C64e(0xb4c7abb4d8d81fc7), C64e(0xfa1543faacacb915), - C64e(0x0709fd07f3f3fa09), C64e(0x256f8525cfcfa06f), - C64e(0xafea8fafcaca20ea), C64e(0x8e89f38ef4f47d89), - C64e(0xe9208ee947476720), C64e(0x1828201810103828), - C64e(0xd564ded56f6f0b64), C64e(0x8883fb88f0f07383), - C64e(0x6fb1946f4a4afbb1), C64e(0x7296b8725c5cca96), - C64e(0x246c70243838546c), C64e(0xf108aef157575f08), - C64e(0xc752e6c773732152), C64e(0x51f33551979764f3), - C64e(0x23658d23cbcbae65), C64e(0x7c84597ca1a12584), - C64e(0x9cbfcb9ce8e857bf), C64e(0x21637c213e3e5d63), - C64e(0xdd7c37dd9696ea7c), C64e(0xdc7fc2dc61611e7f), - C64e(0x86911a860d0d9c91), C64e(0x85941e850f0f9b94), - C64e(0x90abdb90e0e04bab), C64e(0x42c6f8427c7cbac6), - C64e(0xc457e2c471712657), C64e(0xaae583aacccc29e5), - C64e(0xd8733bd89090e373), C64e(0x050f0c050606090f), - C64e(0x0103f501f7f7f403), C64e(0x123638121c1c2a36), - C64e(0xa3fe9fa3c2c23cfe), C64e(0x5fe1d45f6a6a8be1), - C64e(0xf91047f9aeaebe10), C64e(0xd06bd2d06969026b), - C64e(0x91a82e911717bfa8), C64e(0x58e82958999971e8), - C64e(0x276974273a3a5369), C64e(0xb9d04eb92727f7d0), - C64e(0x3848a938d9d99148), C64e(0x1335cd13ebebde35), - C64e(0xb3ce56b32b2be5ce), C64e(0x3355443322227755), - C64e(0xbbd6bfbbd2d204d6), C64e(0x70904970a9a93990), - C64e(0x89800e8907078780), C64e(0xa7f266a73333c1f2), - C64e(0xb6c15ab62d2decc1), C64e(0x226678223c3c5a66), - C64e(0x92ad2a921515b8ad), C64e(0x20608920c9c9a960), - C64e(0x49db154987875cdb), C64e(0xff1a4fffaaaab01a), - C64e(0x7888a0785050d888), C64e(0x7a8e517aa5a52b8e), - C64e(0x8f8a068f0303898a), C64e(0xf813b2f859594a13), - C64e(0x809b12800909929b), C64e(0x173934171a1a2339), - C64e(0xda75cada65651075), C64e(0x3153b531d7d78453), - C64e(0xc65113c68484d551), C64e(0xb8d3bbb8d0d003d3), - C64e(0xc35e1fc38282dc5e), C64e(0xb0cb52b02929e2cb), - C64e(0x7799b4775a5ac399), C64e(0x11333c111e1e2d33), - C64e(0xcb46f6cb7b7b3d46), C64e(0xfc1f4bfca8a8b71f), - C64e(0xd661dad66d6d0c61), C64e(0x3a4e583a2c2c624e) -}; - -static const sph_u64 T6[] = { - C64e(0xf4a5f497a5c6c632), C64e(0x978497eb84f8f86f), - C64e(0xb099b0c799eeee5e), C64e(0x8c8d8cf78df6f67a), - C64e(0x170d17e50dffffe8), C64e(0xdcbddcb7bdd6d60a), - C64e(0xc8b1c8a7b1dede16), C64e(0xfc54fc395491916d), - C64e(0xf050f0c050606090), C64e(0x0503050403020207), - C64e(0xe0a9e087a9cece2e), C64e(0x877d87ac7d5656d1), - C64e(0x2b192bd519e7e7cc), C64e(0xa662a67162b5b513), - C64e(0x31e6319ae64d4d7c), C64e(0xb59ab5c39aecec59), - C64e(0xcf45cf05458f8f40), C64e(0xbc9dbc3e9d1f1fa3), - C64e(0xc040c00940898949), C64e(0x928792ef87fafa68), - C64e(0x3f153fc515efefd0), C64e(0x26eb267febb2b294), - C64e(0x40c94007c98e8ece), C64e(0x1d0b1ded0bfbfbe6), - C64e(0x2fec2f82ec41416e), C64e(0xa967a97d67b3b31a), - C64e(0x1cfd1cbefd5f5f43), C64e(0x25ea258aea454560), - C64e(0xdabfda46bf2323f9), C64e(0x02f702a6f7535351), - C64e(0xa196a1d396e4e445), C64e(0xed5bed2d5b9b9b76), - C64e(0x5dc25deac2757528), C64e(0x241c24d91ce1e1c5), - C64e(0xe9aee97aae3d3dd4), C64e(0xbe6abe986a4c4cf2), - C64e(0xee5aeed85a6c6c82), C64e(0xc341c3fc417e7ebd), - C64e(0x060206f102f5f5f3), C64e(0xd14fd11d4f838352), - C64e(0xe45ce4d05c68688c), C64e(0x07f407a2f4515156), - C64e(0x5c345cb934d1d18d), C64e(0x180818e908f9f9e1), - C64e(0xae93aedf93e2e24c), C64e(0x9573954d73abab3e), - C64e(0xf553f5c453626297), C64e(0x413f41543f2a2a6b), - C64e(0x140c14100c08081c), C64e(0xf652f63152959563), - C64e(0xaf65af8c654646e9), C64e(0xe25ee2215e9d9d7f), - C64e(0x7828786028303048), C64e(0xf8a1f86ea13737cf), - C64e(0x110f11140f0a0a1b), C64e(0xc4b5c45eb52f2feb), - C64e(0x1b091b1c090e0e15), C64e(0x5a365a483624247e), - C64e(0xb69bb6369b1b1bad), C64e(0x473d47a53ddfdf98), - C64e(0x6a266a8126cdcda7), C64e(0xbb69bb9c694e4ef5), - C64e(0x4ccd4cfecd7f7f33), C64e(0xba9fbacf9feaea50), - C64e(0x2d1b2d241b12123f), C64e(0xb99eb93a9e1d1da4), - C64e(0x9c749cb0745858c4), C64e(0x722e72682e343446), - C64e(0x772d776c2d363641), C64e(0xcdb2cda3b2dcdc11), - C64e(0x29ee2973eeb4b49d), C64e(0x16fb16b6fb5b5b4d), - C64e(0x01f60153f6a4a4a5), C64e(0xd74dd7ec4d7676a1), - C64e(0xa361a37561b7b714), C64e(0x49ce49face7d7d34), - C64e(0x8d7b8da47b5252df), C64e(0x423e42a13edddd9f), - C64e(0x937193bc715e5ecd), C64e(0xa297a226971313b1), - C64e(0x04f50457f5a6a6a2), C64e(0xb868b86968b9b901), - C64e(0x0000000000000000), C64e(0x742c74992cc1c1b5), - C64e(0xa060a080604040e0), C64e(0x211f21dd1fe3e3c2), - C64e(0x43c843f2c879793a), C64e(0x2ced2c77edb6b69a), - C64e(0xd9bed9b3bed4d40d), C64e(0xca46ca01468d8d47), - C64e(0x70d970ced9676717), C64e(0xdd4bdde44b7272af), - C64e(0x79de7933de9494ed), C64e(0x67d4672bd49898ff), - C64e(0x23e8237be8b0b093), C64e(0xde4ade114a85855b), - C64e(0xbd6bbd6d6bbbbb06), C64e(0x7e2a7e912ac5c5bb), - C64e(0x34e5349ee54f4f7b), C64e(0x3a163ac116ededd7), - C64e(0x54c55417c58686d2), C64e(0x62d7622fd79a9af8), - C64e(0xff55ffcc55666699), C64e(0xa794a722941111b6), - C64e(0x4acf4a0fcf8a8ac0), C64e(0x301030c910e9e9d9), - C64e(0x0a060a080604040e), C64e(0x988198e781fefe66), - C64e(0x0bf00b5bf0a0a0ab), C64e(0xcc44ccf0447878b4), - C64e(0xd5bad54aba2525f0), C64e(0x3ee33e96e34b4b75), - C64e(0x0ef30e5ff3a2a2ac), C64e(0x19fe19bafe5d5d44), - C64e(0x5bc05b1bc08080db), C64e(0x858a850a8a050580), - C64e(0xecadec7ead3f3fd3), C64e(0xdfbcdf42bc2121fe), - C64e(0xd848d8e0487070a8), C64e(0x0c040cf904f1f1fd), - C64e(0x7adf7ac6df636319), C64e(0x58c158eec177772f), - C64e(0x9f759f4575afaf30), C64e(0xa563a584634242e7), - C64e(0x5030504030202070), C64e(0x2e1a2ed11ae5e5cb), - C64e(0x120e12e10efdfdef), C64e(0xb76db7656dbfbf08), - C64e(0xd44cd4194c818155), C64e(0x3c143c3014181824), - C64e(0x5f355f4c35262679), C64e(0x712f719d2fc3c3b2), - C64e(0x38e13867e1bebe86), C64e(0xfda2fd6aa23535c8), - C64e(0x4fcc4f0bcc8888c7), C64e(0x4b394b5c392e2e65), - C64e(0xf957f93d5793936a), C64e(0x0df20daaf2555558), - C64e(0x9d829de382fcfc61), C64e(0xc947c9f4477a7ab3), - C64e(0xefacef8bacc8c827), C64e(0x32e7326fe7baba88), - C64e(0x7d2b7d642b32324f), C64e(0xa495a4d795e6e642), - C64e(0xfba0fb9ba0c0c03b), C64e(0xb398b332981919aa), - C64e(0x68d16827d19e9ef6), C64e(0x817f815d7fa3a322), - C64e(0xaa66aa88664444ee), C64e(0x827e82a87e5454d6), - C64e(0xe6abe676ab3b3bdd), C64e(0x9e839e16830b0b95), - C64e(0x45ca4503ca8c8cc9), C64e(0x7b297b9529c7c7bc), - C64e(0x6ed36ed6d36b6b05), C64e(0x443c44503c28286c), - C64e(0x8b798b5579a7a72c), C64e(0x3de23d63e2bcbc81), - C64e(0x271d272c1d161631), C64e(0x9a769a4176adad37), - C64e(0x4d3b4dad3bdbdb96), C64e(0xfa56fac85664649e), - C64e(0xd24ed2e84e7474a6), C64e(0x221e22281e141436), - C64e(0x76db763fdb9292e4), C64e(0x1e0a1e180a0c0c12), - C64e(0xb46cb4906c4848fc), C64e(0x37e4376be4b8b88f), - C64e(0xe75de7255d9f9f78), C64e(0xb26eb2616ebdbd0f), - C64e(0x2aef2a86ef434369), C64e(0xf1a6f193a6c4c435), - C64e(0xe3a8e372a83939da), C64e(0xf7a4f762a43131c6), - C64e(0x593759bd37d3d38a), C64e(0x868b86ff8bf2f274), - C64e(0x563256b132d5d583), C64e(0xc543c50d438b8b4e), - C64e(0xeb59ebdc596e6e85), C64e(0xc2b7c2afb7dada18), - C64e(0x8f8c8f028c01018e), C64e(0xac64ac7964b1b11d), - C64e(0x6dd26d23d29c9cf1), C64e(0x3be03b92e0494972), - C64e(0xc7b4c7abb4d8d81f), C64e(0x15fa1543faacacb9), - C64e(0x090709fd07f3f3fa), C64e(0x6f256f8525cfcfa0), - C64e(0xeaafea8fafcaca20), C64e(0x898e89f38ef4f47d), - C64e(0x20e9208ee9474767), C64e(0x2818282018101038), - C64e(0x64d564ded56f6f0b), C64e(0x838883fb88f0f073), - C64e(0xb16fb1946f4a4afb), C64e(0x967296b8725c5cca), - C64e(0x6c246c7024383854), C64e(0x08f108aef157575f), - C64e(0x52c752e6c7737321), C64e(0xf351f33551979764), - C64e(0x6523658d23cbcbae), C64e(0x847c84597ca1a125), - C64e(0xbf9cbfcb9ce8e857), C64e(0x6321637c213e3e5d), - C64e(0x7cdd7c37dd9696ea), C64e(0x7fdc7fc2dc61611e), - C64e(0x9186911a860d0d9c), C64e(0x9485941e850f0f9b), - C64e(0xab90abdb90e0e04b), C64e(0xc642c6f8427c7cba), - C64e(0x57c457e2c4717126), C64e(0xe5aae583aacccc29), - C64e(0x73d8733bd89090e3), C64e(0x0f050f0c05060609), - C64e(0x030103f501f7f7f4), C64e(0x36123638121c1c2a), - C64e(0xfea3fe9fa3c2c23c), C64e(0xe15fe1d45f6a6a8b), - C64e(0x10f91047f9aeaebe), C64e(0x6bd06bd2d0696902), - C64e(0xa891a82e911717bf), C64e(0xe858e82958999971), - C64e(0x69276974273a3a53), C64e(0xd0b9d04eb92727f7), - C64e(0x483848a938d9d991), C64e(0x351335cd13ebebde), - C64e(0xceb3ce56b32b2be5), C64e(0x5533554433222277), - C64e(0xd6bbd6bfbbd2d204), C64e(0x9070904970a9a939), - C64e(0x8089800e89070787), C64e(0xf2a7f266a73333c1), - C64e(0xc1b6c15ab62d2dec), C64e(0x66226678223c3c5a), - C64e(0xad92ad2a921515b8), C64e(0x6020608920c9c9a9), - C64e(0xdb49db154987875c), C64e(0x1aff1a4fffaaaab0), - C64e(0x887888a0785050d8), C64e(0x8e7a8e517aa5a52b), - C64e(0x8a8f8a068f030389), C64e(0x13f813b2f859594a), - C64e(0x9b809b1280090992), C64e(0x39173934171a1a23), - C64e(0x75da75cada656510), C64e(0x533153b531d7d784), - C64e(0x51c65113c68484d5), C64e(0xd3b8d3bbb8d0d003), - C64e(0x5ec35e1fc38282dc), C64e(0xcbb0cb52b02929e2), - C64e(0x997799b4775a5ac3), C64e(0x3311333c111e1e2d), - C64e(0x46cb46f6cb7b7b3d), C64e(0x1ffc1f4bfca8a8b7), - C64e(0x61d661dad66d6d0c), C64e(0x4e3a4e583a2c2c62) -}; - -static const sph_u64 T7[] = { - C64e(0x32f4a5f497a5c6c6), C64e(0x6f978497eb84f8f8), - C64e(0x5eb099b0c799eeee), C64e(0x7a8c8d8cf78df6f6), - C64e(0xe8170d17e50dffff), C64e(0x0adcbddcb7bdd6d6), - C64e(0x16c8b1c8a7b1dede), C64e(0x6dfc54fc39549191), - C64e(0x90f050f0c0506060), C64e(0x0705030504030202), - C64e(0x2ee0a9e087a9cece), C64e(0xd1877d87ac7d5656), - C64e(0xcc2b192bd519e7e7), C64e(0x13a662a67162b5b5), - C64e(0x7c31e6319ae64d4d), C64e(0x59b59ab5c39aecec), - C64e(0x40cf45cf05458f8f), C64e(0xa3bc9dbc3e9d1f1f), - C64e(0x49c040c009408989), C64e(0x68928792ef87fafa), - C64e(0xd03f153fc515efef), C64e(0x9426eb267febb2b2), - C64e(0xce40c94007c98e8e), C64e(0xe61d0b1ded0bfbfb), - C64e(0x6e2fec2f82ec4141), C64e(0x1aa967a97d67b3b3), - C64e(0x431cfd1cbefd5f5f), C64e(0x6025ea258aea4545), - C64e(0xf9dabfda46bf2323), C64e(0x5102f702a6f75353), - C64e(0x45a196a1d396e4e4), C64e(0x76ed5bed2d5b9b9b), - C64e(0x285dc25deac27575), C64e(0xc5241c24d91ce1e1), - C64e(0xd4e9aee97aae3d3d), C64e(0xf2be6abe986a4c4c), - C64e(0x82ee5aeed85a6c6c), C64e(0xbdc341c3fc417e7e), - C64e(0xf3060206f102f5f5), C64e(0x52d14fd11d4f8383), - C64e(0x8ce45ce4d05c6868), C64e(0x5607f407a2f45151), - C64e(0x8d5c345cb934d1d1), C64e(0xe1180818e908f9f9), - C64e(0x4cae93aedf93e2e2), C64e(0x3e9573954d73abab), - C64e(0x97f553f5c4536262), C64e(0x6b413f41543f2a2a), - C64e(0x1c140c14100c0808), C64e(0x63f652f631529595), - C64e(0xe9af65af8c654646), C64e(0x7fe25ee2215e9d9d), - C64e(0x4878287860283030), C64e(0xcff8a1f86ea13737), - C64e(0x1b110f11140f0a0a), C64e(0xebc4b5c45eb52f2f), - C64e(0x151b091b1c090e0e), C64e(0x7e5a365a48362424), - C64e(0xadb69bb6369b1b1b), C64e(0x98473d47a53ddfdf), - C64e(0xa76a266a8126cdcd), C64e(0xf5bb69bb9c694e4e), - C64e(0x334ccd4cfecd7f7f), C64e(0x50ba9fbacf9feaea), - C64e(0x3f2d1b2d241b1212), C64e(0xa4b99eb93a9e1d1d), - C64e(0xc49c749cb0745858), C64e(0x46722e72682e3434), - C64e(0x41772d776c2d3636), C64e(0x11cdb2cda3b2dcdc), - C64e(0x9d29ee2973eeb4b4), C64e(0x4d16fb16b6fb5b5b), - C64e(0xa501f60153f6a4a4), C64e(0xa1d74dd7ec4d7676), - C64e(0x14a361a37561b7b7), C64e(0x3449ce49face7d7d), - C64e(0xdf8d7b8da47b5252), C64e(0x9f423e42a13edddd), - C64e(0xcd937193bc715e5e), C64e(0xb1a297a226971313), - C64e(0xa204f50457f5a6a6), C64e(0x01b868b86968b9b9), - C64e(0x0000000000000000), C64e(0xb5742c74992cc1c1), - C64e(0xe0a060a080604040), C64e(0xc2211f21dd1fe3e3), - C64e(0x3a43c843f2c87979), C64e(0x9a2ced2c77edb6b6), - C64e(0x0dd9bed9b3bed4d4), C64e(0x47ca46ca01468d8d), - C64e(0x1770d970ced96767), C64e(0xafdd4bdde44b7272), - C64e(0xed79de7933de9494), C64e(0xff67d4672bd49898), - C64e(0x9323e8237be8b0b0), C64e(0x5bde4ade114a8585), - C64e(0x06bd6bbd6d6bbbbb), C64e(0xbb7e2a7e912ac5c5), - C64e(0x7b34e5349ee54f4f), C64e(0xd73a163ac116eded), - C64e(0xd254c55417c58686), C64e(0xf862d7622fd79a9a), - C64e(0x99ff55ffcc556666), C64e(0xb6a794a722941111), - C64e(0xc04acf4a0fcf8a8a), C64e(0xd9301030c910e9e9), - C64e(0x0e0a060a08060404), C64e(0x66988198e781fefe), - C64e(0xab0bf00b5bf0a0a0), C64e(0xb4cc44ccf0447878), - C64e(0xf0d5bad54aba2525), C64e(0x753ee33e96e34b4b), - C64e(0xac0ef30e5ff3a2a2), C64e(0x4419fe19bafe5d5d), - C64e(0xdb5bc05b1bc08080), C64e(0x80858a850a8a0505), - C64e(0xd3ecadec7ead3f3f), C64e(0xfedfbcdf42bc2121), - C64e(0xa8d848d8e0487070), C64e(0xfd0c040cf904f1f1), - C64e(0x197adf7ac6df6363), C64e(0x2f58c158eec17777), - C64e(0x309f759f4575afaf), C64e(0xe7a563a584634242), - C64e(0x7050305040302020), C64e(0xcb2e1a2ed11ae5e5), - C64e(0xef120e12e10efdfd), C64e(0x08b76db7656dbfbf), - C64e(0x55d44cd4194c8181), C64e(0x243c143c30141818), - C64e(0x795f355f4c352626), C64e(0xb2712f719d2fc3c3), - C64e(0x8638e13867e1bebe), C64e(0xc8fda2fd6aa23535), - C64e(0xc74fcc4f0bcc8888), C64e(0x654b394b5c392e2e), - C64e(0x6af957f93d579393), C64e(0x580df20daaf25555), - C64e(0x619d829de382fcfc), C64e(0xb3c947c9f4477a7a), - C64e(0x27efacef8bacc8c8), C64e(0x8832e7326fe7baba), - C64e(0x4f7d2b7d642b3232), C64e(0x42a495a4d795e6e6), - C64e(0x3bfba0fb9ba0c0c0), C64e(0xaab398b332981919), - C64e(0xf668d16827d19e9e), C64e(0x22817f815d7fa3a3), - C64e(0xeeaa66aa88664444), C64e(0xd6827e82a87e5454), - C64e(0xdde6abe676ab3b3b), C64e(0x959e839e16830b0b), - C64e(0xc945ca4503ca8c8c), C64e(0xbc7b297b9529c7c7), - C64e(0x056ed36ed6d36b6b), C64e(0x6c443c44503c2828), - C64e(0x2c8b798b5579a7a7), C64e(0x813de23d63e2bcbc), - C64e(0x31271d272c1d1616), C64e(0x379a769a4176adad), - C64e(0x964d3b4dad3bdbdb), C64e(0x9efa56fac8566464), - C64e(0xa6d24ed2e84e7474), C64e(0x36221e22281e1414), - C64e(0xe476db763fdb9292), C64e(0x121e0a1e180a0c0c), - C64e(0xfcb46cb4906c4848), C64e(0x8f37e4376be4b8b8), - C64e(0x78e75de7255d9f9f), C64e(0x0fb26eb2616ebdbd), - C64e(0x692aef2a86ef4343), C64e(0x35f1a6f193a6c4c4), - C64e(0xdae3a8e372a83939), C64e(0xc6f7a4f762a43131), - C64e(0x8a593759bd37d3d3), C64e(0x74868b86ff8bf2f2), - C64e(0x83563256b132d5d5), C64e(0x4ec543c50d438b8b), - C64e(0x85eb59ebdc596e6e), C64e(0x18c2b7c2afb7dada), - C64e(0x8e8f8c8f028c0101), C64e(0x1dac64ac7964b1b1), - C64e(0xf16dd26d23d29c9c), C64e(0x723be03b92e04949), - C64e(0x1fc7b4c7abb4d8d8), C64e(0xb915fa1543faacac), - C64e(0xfa090709fd07f3f3), C64e(0xa06f256f8525cfcf), - C64e(0x20eaafea8fafcaca), C64e(0x7d898e89f38ef4f4), - C64e(0x6720e9208ee94747), C64e(0x3828182820181010), - C64e(0x0b64d564ded56f6f), C64e(0x73838883fb88f0f0), - C64e(0xfbb16fb1946f4a4a), C64e(0xca967296b8725c5c), - C64e(0x546c246c70243838), C64e(0x5f08f108aef15757), - C64e(0x2152c752e6c77373), C64e(0x64f351f335519797), - C64e(0xae6523658d23cbcb), C64e(0x25847c84597ca1a1), - C64e(0x57bf9cbfcb9ce8e8), C64e(0x5d6321637c213e3e), - C64e(0xea7cdd7c37dd9696), C64e(0x1e7fdc7fc2dc6161), - C64e(0x9c9186911a860d0d), C64e(0x9b9485941e850f0f), - C64e(0x4bab90abdb90e0e0), C64e(0xbac642c6f8427c7c), - C64e(0x2657c457e2c47171), C64e(0x29e5aae583aacccc), - C64e(0xe373d8733bd89090), C64e(0x090f050f0c050606), - C64e(0xf4030103f501f7f7), C64e(0x2a36123638121c1c), - C64e(0x3cfea3fe9fa3c2c2), C64e(0x8be15fe1d45f6a6a), - C64e(0xbe10f91047f9aeae), C64e(0x026bd06bd2d06969), - C64e(0xbfa891a82e911717), C64e(0x71e858e829589999), - C64e(0x5369276974273a3a), C64e(0xf7d0b9d04eb92727), - C64e(0x91483848a938d9d9), C64e(0xde351335cd13ebeb), - C64e(0xe5ceb3ce56b32b2b), C64e(0x7755335544332222), - C64e(0x04d6bbd6bfbbd2d2), C64e(0x399070904970a9a9), - C64e(0x878089800e890707), C64e(0xc1f2a7f266a73333), - C64e(0xecc1b6c15ab62d2d), C64e(0x5a66226678223c3c), - C64e(0xb8ad92ad2a921515), C64e(0xa96020608920c9c9), - C64e(0x5cdb49db15498787), C64e(0xb01aff1a4fffaaaa), - C64e(0xd8887888a0785050), C64e(0x2b8e7a8e517aa5a5), - C64e(0x898a8f8a068f0303), C64e(0x4a13f813b2f85959), - C64e(0x929b809b12800909), C64e(0x2339173934171a1a), - C64e(0x1075da75cada6565), C64e(0x84533153b531d7d7), - C64e(0xd551c65113c68484), C64e(0x03d3b8d3bbb8d0d0), - C64e(0xdc5ec35e1fc38282), C64e(0xe2cbb0cb52b02929), - C64e(0xc3997799b4775a5a), C64e(0x2d3311333c111e1e), - C64e(0x3d46cb46f6cb7b7b), C64e(0xb71ffc1f4bfca8a8), - C64e(0x0c61d661dad66d6d), C64e(0x624e3a4e583a2c2c) -}; - -#endif - -#define DECL_STATE_SMALL \ - sph_u64 H[8]; - -#define READ_STATE_SMALL(sc) do { \ - memcpy(H, (sc)->state.wide, sizeof H); \ - } while (0) - -#define WRITE_STATE_SMALL(sc) do { \ - memcpy((sc)->state.wide, H, sizeof H); \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_GROESTL - -#define RSTT(d, a, b0, b1, b2, b3, b4, b5, b6, b7) do { \ - t[d] = T0[B64_0(a[b0])] \ - ^ R64(T0[B64_1(a[b1])], 8) \ - ^ R64(T0[B64_2(a[b2])], 16) \ - ^ R64(T0[B64_3(a[b3])], 24) \ - ^ T4[B64_4(a[b4])] \ - ^ R64(T4[B64_5(a[b5])], 8) \ - ^ R64(T4[B64_6(a[b6])], 16) \ - ^ R64(T4[B64_7(a[b7])], 24); \ - } while (0) - -#else - -#define RSTT(d, a, b0, b1, b2, b3, b4, b5, b6, b7) do { \ - t[d] = T0[B64_0(a[b0])] \ - ^ T1[B64_1(a[b1])] \ - ^ T2[B64_2(a[b2])] \ - ^ T3[B64_3(a[b3])] \ - ^ T4[B64_4(a[b4])] \ - ^ T5[B64_5(a[b5])] \ - ^ T6[B64_6(a[b6])] \ - ^ T7[B64_7(a[b7])]; \ - } while (0) - -#endif - -#define ROUND_SMALL_P(a, r) do { \ - sph_u64 t[8]; \ - a[0] ^= PC64(0x00, r); \ - a[1] ^= PC64(0x10, r); \ - a[2] ^= PC64(0x20, r); \ - a[3] ^= PC64(0x30, r); \ - a[4] ^= PC64(0x40, r); \ - a[5] ^= PC64(0x50, r); \ - a[6] ^= PC64(0x60, r); \ - a[7] ^= PC64(0x70, r); \ - RSTT(0, a, 0, 1, 2, 3, 4, 5, 6, 7); \ - RSTT(1, a, 1, 2, 3, 4, 5, 6, 7, 0); \ - RSTT(2, a, 2, 3, 4, 5, 6, 7, 0, 1); \ - RSTT(3, a, 3, 4, 5, 6, 7, 0, 1, 2); \ - RSTT(4, a, 4, 5, 6, 7, 0, 1, 2, 3); \ - RSTT(5, a, 5, 6, 7, 0, 1, 2, 3, 4); \ - RSTT(6, a, 6, 7, 0, 1, 2, 3, 4, 5); \ - RSTT(7, a, 7, 0, 1, 2, 3, 4, 5, 6); \ - a[0] = t[0]; \ - a[1] = t[1]; \ - a[2] = t[2]; \ - a[3] = t[3]; \ - a[4] = t[4]; \ - a[5] = t[5]; \ - a[6] = t[6]; \ - a[7] = t[7]; \ - } while (0) - -#define ROUND_SMALL_Q(a, r) do { \ - sph_u64 t[8]; \ - a[0] ^= QC64(0x00, r); \ - a[1] ^= QC64(0x10, r); \ - a[2] ^= QC64(0x20, r); \ - a[3] ^= QC64(0x30, r); \ - a[4] ^= QC64(0x40, r); \ - a[5] ^= QC64(0x50, r); \ - a[6] ^= QC64(0x60, r); \ - a[7] ^= QC64(0x70, r); \ - RSTT(0, a, 1, 3, 5, 7, 0, 2, 4, 6); \ - RSTT(1, a, 2, 4, 6, 0, 1, 3, 5, 7); \ - RSTT(2, a, 3, 5, 7, 1, 2, 4, 6, 0); \ - RSTT(3, a, 4, 6, 0, 2, 3, 5, 7, 1); \ - RSTT(4, a, 5, 7, 1, 3, 4, 6, 0, 2); \ - RSTT(5, a, 6, 0, 2, 4, 5, 7, 1, 3); \ - RSTT(6, a, 7, 1, 3, 5, 6, 0, 2, 4); \ - RSTT(7, a, 0, 2, 4, 6, 7, 1, 3, 5); \ - a[0] = t[0]; \ - a[1] = t[1]; \ - a[2] = t[2]; \ - a[3] = t[3]; \ - a[4] = t[4]; \ - a[5] = t[5]; \ - a[6] = t[6]; \ - a[7] = t[7]; \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_GROESTL - -#define PERM_SMALL_P(a) do { \ - int r; \ - for (r = 0; r < 10; r ++) \ - ROUND_SMALL_P(a, r); \ - } while (0) - -#define PERM_SMALL_Q(a) do { \ - int r; \ - for (r = 0; r < 10; r ++) \ - ROUND_SMALL_Q(a, r); \ - } while (0) - -#else - -/* - * Apparently, unrolling more than that confuses GCC, resulting in - * lower performance, even though L1 cache would be no problem. - */ -#define PERM_SMALL_P(a) do { \ - int r; \ - for (r = 0; r < 10; r += 2) { \ - ROUND_SMALL_P(a, r + 0); \ - ROUND_SMALL_P(a, r + 1); \ - } \ - } while (0) - -#define PERM_SMALL_Q(a) do { \ - int r; \ - for (r = 0; r < 10; r += 2) { \ - ROUND_SMALL_Q(a, r + 0); \ - ROUND_SMALL_Q(a, r + 1); \ - } \ - } while (0) - -#endif - -#define COMPRESS_SMALL do { \ - sph_u64 g[8], m[8]; \ - size_t u; \ - for (u = 0; u < 8; u ++) { \ - m[u] = dec64e_aligned(buf + (u << 3)); \ - g[u] = m[u] ^ H[u]; \ - } \ - PERM_SMALL_P(g); \ - PERM_SMALL_Q(m); \ - for (u = 0; u < 8; u ++) \ - H[u] ^= g[u] ^ m[u]; \ - } while (0) - -#define FINAL_SMALL do { \ - sph_u64 x[8]; \ - size_t u; \ - memcpy(x, H, sizeof x); \ - PERM_SMALL_P(x); \ - for (u = 0; u < 8; u ++) \ - H[u] ^= x[u]; \ - } while (0) - -#define DECL_STATE_BIG \ - sph_u64 H[16]; - -#define READ_STATE_BIG(sc) do { \ - memcpy(H, (sc)->state.wide, sizeof H); \ - } while (0) - -#define WRITE_STATE_BIG(sc) do { \ - memcpy((sc)->state.wide, H, sizeof H); \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_GROESTL - -#define RBTT(d, a, b0, b1, b2, b3, b4, b5, b6, b7) do { \ - t[d] = T0[B64_0(a[b0])] \ - ^ R64(T0[B64_1(a[b1])], 8) \ - ^ R64(T0[B64_2(a[b2])], 16) \ - ^ R64(T0[B64_3(a[b3])], 24) \ - ^ T4[B64_4(a[b4])] \ - ^ R64(T4[B64_5(a[b5])], 8) \ - ^ R64(T4[B64_6(a[b6])], 16) \ - ^ R64(T4[B64_7(a[b7])], 24); \ - } while (0) - -#else - -#define RBTT(d, a, b0, b1, b2, b3, b4, b5, b6, b7) do { \ - t[d] = T0[B64_0(a[b0])] \ - ^ T1[B64_1(a[b1])] \ - ^ T2[B64_2(a[b2])] \ - ^ T3[B64_3(a[b3])] \ - ^ T4[B64_4(a[b4])] \ - ^ T5[B64_5(a[b5])] \ - ^ T6[B64_6(a[b6])] \ - ^ T7[B64_7(a[b7])]; \ - } while (0) - -#endif - -#if SPH_SMALL_FOOTPRINT_GROESTL - -#define ROUND_BIG_P(a, r) do { \ - sph_u64 t[16]; \ - size_t u; \ - a[0x0] ^= PC64(0x00, r); \ - a[0x1] ^= PC64(0x10, r); \ - a[0x2] ^= PC64(0x20, r); \ - a[0x3] ^= PC64(0x30, r); \ - a[0x4] ^= PC64(0x40, r); \ - a[0x5] ^= PC64(0x50, r); \ - a[0x6] ^= PC64(0x60, r); \ - a[0x7] ^= PC64(0x70, r); \ - a[0x8] ^= PC64(0x80, r); \ - a[0x9] ^= PC64(0x90, r); \ - a[0xA] ^= PC64(0xA0, r); \ - a[0xB] ^= PC64(0xB0, r); \ - a[0xC] ^= PC64(0xC0, r); \ - a[0xD] ^= PC64(0xD0, r); \ - a[0xE] ^= PC64(0xE0, r); \ - a[0xF] ^= PC64(0xF0, r); \ - for (u = 0; u < 16; u += 4) { \ - RBTT(u + 0, a, u + 0, (u + 1) & 0xF, \ - (u + 2) & 0xF, (u + 3) & 0xF, (u + 4) & 0xF, \ - (u + 5) & 0xF, (u + 6) & 0xF, (u + 11) & 0xF); \ - RBTT(u + 1, a, u + 1, (u + 2) & 0xF, \ - (u + 3) & 0xF, (u + 4) & 0xF, (u + 5) & 0xF, \ - (u + 6) & 0xF, (u + 7) & 0xF, (u + 12) & 0xF); \ - RBTT(u + 2, a, u + 2, (u + 3) & 0xF, \ - (u + 4) & 0xF, (u + 5) & 0xF, (u + 6) & 0xF, \ - (u + 7) & 0xF, (u + 8) & 0xF, (u + 13) & 0xF); \ - RBTT(u + 3, a, u + 3, (u + 4) & 0xF, \ - (u + 5) & 0xF, (u + 6) & 0xF, (u + 7) & 0xF, \ - (u + 8) & 0xF, (u + 9) & 0xF, (u + 14) & 0xF); \ - } \ - memcpy(a, t, sizeof t); \ - } while (0) - -#define ROUND_BIG_Q(a, r) do { \ - sph_u64 t[16]; \ - size_t u; \ - a[0x0] ^= QC64(0x00, r); \ - a[0x1] ^= QC64(0x10, r); \ - a[0x2] ^= QC64(0x20, r); \ - a[0x3] ^= QC64(0x30, r); \ - a[0x4] ^= QC64(0x40, r); \ - a[0x5] ^= QC64(0x50, r); \ - a[0x6] ^= QC64(0x60, r); \ - a[0x7] ^= QC64(0x70, r); \ - a[0x8] ^= QC64(0x80, r); \ - a[0x9] ^= QC64(0x90, r); \ - a[0xA] ^= QC64(0xA0, r); \ - a[0xB] ^= QC64(0xB0, r); \ - a[0xC] ^= QC64(0xC0, r); \ - a[0xD] ^= QC64(0xD0, r); \ - a[0xE] ^= QC64(0xE0, r); \ - a[0xF] ^= QC64(0xF0, r); \ - for (u = 0; u < 16; u += 4) { \ - RBTT(u + 0, a, (u + 1) & 0xF, (u + 3) & 0xF, \ - (u + 5) & 0xF, (u + 11) & 0xF, (u + 0) & 0xF, \ - (u + 2) & 0xF, (u + 4) & 0xF, (u + 6) & 0xF); \ - RBTT(u + 1, a, (u + 2) & 0xF, (u + 4) & 0xF, \ - (u + 6) & 0xF, (u + 12) & 0xF, (u + 1) & 0xF, \ - (u + 3) & 0xF, (u + 5) & 0xF, (u + 7) & 0xF); \ - RBTT(u + 2, a, (u + 3) & 0xF, (u + 5) & 0xF, \ - (u + 7) & 0xF, (u + 13) & 0xF, (u + 2) & 0xF, \ - (u + 4) & 0xF, (u + 6) & 0xF, (u + 8) & 0xF); \ - RBTT(u + 3, a, (u + 4) & 0xF, (u + 6) & 0xF, \ - (u + 8) & 0xF, (u + 14) & 0xF, (u + 3) & 0xF, \ - (u + 5) & 0xF, (u + 7) & 0xF, (u + 9) & 0xF); \ - } \ - memcpy(a, t, sizeof t); \ - } while (0) - -#else - -#define ROUND_BIG_P(a, r) do { \ - sph_u64 t[16]; \ - a[0x0] ^= PC64(0x00, r); \ - a[0x1] ^= PC64(0x10, r); \ - a[0x2] ^= PC64(0x20, r); \ - a[0x3] ^= PC64(0x30, r); \ - a[0x4] ^= PC64(0x40, r); \ - a[0x5] ^= PC64(0x50, r); \ - a[0x6] ^= PC64(0x60, r); \ - a[0x7] ^= PC64(0x70, r); \ - a[0x8] ^= PC64(0x80, r); \ - a[0x9] ^= PC64(0x90, r); \ - a[0xA] ^= PC64(0xA0, r); \ - a[0xB] ^= PC64(0xB0, r); \ - a[0xC] ^= PC64(0xC0, r); \ - a[0xD] ^= PC64(0xD0, r); \ - a[0xE] ^= PC64(0xE0, r); \ - a[0xF] ^= PC64(0xF0, r); \ - RBTT(0x0, a, 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0xB); \ - RBTT(0x1, a, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0xC); \ - RBTT(0x2, a, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0xD); \ - RBTT(0x3, a, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xE); \ - RBTT(0x4, a, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xF); \ - RBTT(0x5, a, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0x0); \ - RBTT(0x6, a, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0x1); \ - RBTT(0x7, a, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0x2); \ - RBTT(0x8, a, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0x3); \ - RBTT(0x9, a, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x4); \ - RBTT(0xA, a, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x0, 0x5); \ - RBTT(0xB, a, 0xB, 0xC, 0xD, 0xE, 0xF, 0x0, 0x1, 0x6); \ - RBTT(0xC, a, 0xC, 0xD, 0xE, 0xF, 0x0, 0x1, 0x2, 0x7); \ - RBTT(0xD, a, 0xD, 0xE, 0xF, 0x0, 0x1, 0x2, 0x3, 0x8); \ - RBTT(0xE, a, 0xE, 0xF, 0x0, 0x1, 0x2, 0x3, 0x4, 0x9); \ - RBTT(0xF, a, 0xF, 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0xA); \ - a[0x0] = t[0x0]; \ - a[0x1] = t[0x1]; \ - a[0x2] = t[0x2]; \ - a[0x3] = t[0x3]; \ - a[0x4] = t[0x4]; \ - a[0x5] = t[0x5]; \ - a[0x6] = t[0x6]; \ - a[0x7] = t[0x7]; \ - a[0x8] = t[0x8]; \ - a[0x9] = t[0x9]; \ - a[0xA] = t[0xA]; \ - a[0xB] = t[0xB]; \ - a[0xC] = t[0xC]; \ - a[0xD] = t[0xD]; \ - a[0xE] = t[0xE]; \ - a[0xF] = t[0xF]; \ - } while (0) - -#define ROUND_BIG_Q(a, r) do { \ - sph_u64 t[16]; \ - a[0x0] ^= QC64(0x00, r); \ - a[0x1] ^= QC64(0x10, r); \ - a[0x2] ^= QC64(0x20, r); \ - a[0x3] ^= QC64(0x30, r); \ - a[0x4] ^= QC64(0x40, r); \ - a[0x5] ^= QC64(0x50, r); \ - a[0x6] ^= QC64(0x60, r); \ - a[0x7] ^= QC64(0x70, r); \ - a[0x8] ^= QC64(0x80, r); \ - a[0x9] ^= QC64(0x90, r); \ - a[0xA] ^= QC64(0xA0, r); \ - a[0xB] ^= QC64(0xB0, r); \ - a[0xC] ^= QC64(0xC0, r); \ - a[0xD] ^= QC64(0xD0, r); \ - a[0xE] ^= QC64(0xE0, r); \ - a[0xF] ^= QC64(0xF0, r); \ - RBTT(0x0, a, 0x1, 0x3, 0x5, 0xB, 0x0, 0x2, 0x4, 0x6); \ - RBTT(0x1, a, 0x2, 0x4, 0x6, 0xC, 0x1, 0x3, 0x5, 0x7); \ - RBTT(0x2, a, 0x3, 0x5, 0x7, 0xD, 0x2, 0x4, 0x6, 0x8); \ - RBTT(0x3, a, 0x4, 0x6, 0x8, 0xE, 0x3, 0x5, 0x7, 0x9); \ - RBTT(0x4, a, 0x5, 0x7, 0x9, 0xF, 0x4, 0x6, 0x8, 0xA); \ - RBTT(0x5, a, 0x6, 0x8, 0xA, 0x0, 0x5, 0x7, 0x9, 0xB); \ - RBTT(0x6, a, 0x7, 0x9, 0xB, 0x1, 0x6, 0x8, 0xA, 0xC); \ - RBTT(0x7, a, 0x8, 0xA, 0xC, 0x2, 0x7, 0x9, 0xB, 0xD); \ - RBTT(0x8, a, 0x9, 0xB, 0xD, 0x3, 0x8, 0xA, 0xC, 0xE); \ - RBTT(0x9, a, 0xA, 0xC, 0xE, 0x4, 0x9, 0xB, 0xD, 0xF); \ - RBTT(0xA, a, 0xB, 0xD, 0xF, 0x5, 0xA, 0xC, 0xE, 0x0); \ - RBTT(0xB, a, 0xC, 0xE, 0x0, 0x6, 0xB, 0xD, 0xF, 0x1); \ - RBTT(0xC, a, 0xD, 0xF, 0x1, 0x7, 0xC, 0xE, 0x0, 0x2); \ - RBTT(0xD, a, 0xE, 0x0, 0x2, 0x8, 0xD, 0xF, 0x1, 0x3); \ - RBTT(0xE, a, 0xF, 0x1, 0x3, 0x9, 0xE, 0x0, 0x2, 0x4); \ - RBTT(0xF, a, 0x0, 0x2, 0x4, 0xA, 0xF, 0x1, 0x3, 0x5); \ - a[0x0] = t[0x0]; \ - a[0x1] = t[0x1]; \ - a[0x2] = t[0x2]; \ - a[0x3] = t[0x3]; \ - a[0x4] = t[0x4]; \ - a[0x5] = t[0x5]; \ - a[0x6] = t[0x6]; \ - a[0x7] = t[0x7]; \ - a[0x8] = t[0x8]; \ - a[0x9] = t[0x9]; \ - a[0xA] = t[0xA]; \ - a[0xB] = t[0xB]; \ - a[0xC] = t[0xC]; \ - a[0xD] = t[0xD]; \ - a[0xE] = t[0xE]; \ - a[0xF] = t[0xF]; \ - } while (0) - -#endif - -#define PERM_BIG_P(a) do { \ - int r; \ - for (r = 0; r < 14; r += 2) { \ - ROUND_BIG_P(a, r + 0); \ - ROUND_BIG_P(a, r + 1); \ - } \ - } while (0) - -#define PERM_BIG_Q(a) do { \ - int r; \ - for (r = 0; r < 14; r += 2) { \ - ROUND_BIG_Q(a, r + 0); \ - ROUND_BIG_Q(a, r + 1); \ - } \ - } while (0) - -/* obsolete -#if SPH_SMALL_FOOTPRINT_GROESTL - -#define COMPRESS_BIG do { \ - sph_u64 g[16], m[16], *ya; \ - const sph_u64 *yc; \ - size_t u; \ - int i; \ - for (u = 0; u < 16; u ++) { \ - m[u] = dec64e_aligned(buf + (u << 3)); \ - g[u] = m[u] ^ H[u]; \ - } \ - ya = g; \ - yc = CP; \ - for (i = 0; i < 2; i ++) { \ - PERM_BIG(ya, yc); \ - ya = m; \ - yc = CQ; \ - } \ - for (u = 0; u < 16; u ++) { \ - H[u] ^= g[u] ^ m[u]; \ - } \ - } while (0) - -#else -*/ - -#define COMPRESS_BIG do { \ - sph_u64 g[16], m[16]; \ - size_t u; \ - for (u = 0; u < 16; u ++) { \ - m[u] = dec64e_aligned(buf + (u << 3)); \ - g[u] = m[u] ^ H[u]; \ - } \ - PERM_BIG_P(g); \ - PERM_BIG_Q(m); \ - for (u = 0; u < 16; u ++) { \ - H[u] ^= g[u] ^ m[u]; \ - } \ - } while (0) - -/* obsolete -#endif -*/ - -#define FINAL_BIG do { \ - sph_u64 x[16]; \ - size_t u; \ - memcpy(x, H, sizeof x); \ - PERM_BIG_P(x); \ - for (u = 0; u < 16; u ++) \ - H[u] ^= x[u]; \ - } while (0) - -#else - -static const sph_u32 T0up[] = { - C32e(0xc632f4a5), C32e(0xf86f9784), C32e(0xee5eb099), C32e(0xf67a8c8d), - C32e(0xffe8170d), C32e(0xd60adcbd), C32e(0xde16c8b1), C32e(0x916dfc54), - C32e(0x6090f050), C32e(0x02070503), C32e(0xce2ee0a9), C32e(0x56d1877d), - C32e(0xe7cc2b19), C32e(0xb513a662), C32e(0x4d7c31e6), C32e(0xec59b59a), - C32e(0x8f40cf45), C32e(0x1fa3bc9d), C32e(0x8949c040), C32e(0xfa689287), - C32e(0xefd03f15), C32e(0xb29426eb), C32e(0x8ece40c9), C32e(0xfbe61d0b), - C32e(0x416e2fec), C32e(0xb31aa967), C32e(0x5f431cfd), C32e(0x456025ea), - C32e(0x23f9dabf), C32e(0x535102f7), C32e(0xe445a196), C32e(0x9b76ed5b), - C32e(0x75285dc2), C32e(0xe1c5241c), C32e(0x3dd4e9ae), C32e(0x4cf2be6a), - C32e(0x6c82ee5a), C32e(0x7ebdc341), C32e(0xf5f30602), C32e(0x8352d14f), - C32e(0x688ce45c), C32e(0x515607f4), C32e(0xd18d5c34), C32e(0xf9e11808), - C32e(0xe24cae93), C32e(0xab3e9573), C32e(0x6297f553), C32e(0x2a6b413f), - C32e(0x081c140c), C32e(0x9563f652), C32e(0x46e9af65), C32e(0x9d7fe25e), - C32e(0x30487828), C32e(0x37cff8a1), C32e(0x0a1b110f), C32e(0x2febc4b5), - C32e(0x0e151b09), C32e(0x247e5a36), C32e(0x1badb69b), C32e(0xdf98473d), - C32e(0xcda76a26), C32e(0x4ef5bb69), C32e(0x7f334ccd), C32e(0xea50ba9f), - C32e(0x123f2d1b), C32e(0x1da4b99e), C32e(0x58c49c74), C32e(0x3446722e), - C32e(0x3641772d), C32e(0xdc11cdb2), C32e(0xb49d29ee), C32e(0x5b4d16fb), - C32e(0xa4a501f6), C32e(0x76a1d74d), C32e(0xb714a361), C32e(0x7d3449ce), - C32e(0x52df8d7b), C32e(0xdd9f423e), C32e(0x5ecd9371), C32e(0x13b1a297), - C32e(0xa6a204f5), C32e(0xb901b868), C32e(0x00000000), C32e(0xc1b5742c), - C32e(0x40e0a060), C32e(0xe3c2211f), C32e(0x793a43c8), C32e(0xb69a2ced), - C32e(0xd40dd9be), C32e(0x8d47ca46), C32e(0x671770d9), C32e(0x72afdd4b), - C32e(0x94ed79de), C32e(0x98ff67d4), C32e(0xb09323e8), C32e(0x855bde4a), - C32e(0xbb06bd6b), C32e(0xc5bb7e2a), C32e(0x4f7b34e5), C32e(0xedd73a16), - C32e(0x86d254c5), C32e(0x9af862d7), C32e(0x6699ff55), C32e(0x11b6a794), - C32e(0x8ac04acf), C32e(0xe9d93010), C32e(0x040e0a06), C32e(0xfe669881), - C32e(0xa0ab0bf0), C32e(0x78b4cc44), C32e(0x25f0d5ba), C32e(0x4b753ee3), - C32e(0xa2ac0ef3), C32e(0x5d4419fe), C32e(0x80db5bc0), C32e(0x0580858a), - C32e(0x3fd3ecad), C32e(0x21fedfbc), C32e(0x70a8d848), C32e(0xf1fd0c04), - C32e(0x63197adf), C32e(0x772f58c1), C32e(0xaf309f75), C32e(0x42e7a563), - C32e(0x20705030), C32e(0xe5cb2e1a), C32e(0xfdef120e), C32e(0xbf08b76d), - C32e(0x8155d44c), C32e(0x18243c14), C32e(0x26795f35), C32e(0xc3b2712f), - C32e(0xbe8638e1), C32e(0x35c8fda2), C32e(0x88c74fcc), C32e(0x2e654b39), - C32e(0x936af957), C32e(0x55580df2), C32e(0xfc619d82), C32e(0x7ab3c947), - C32e(0xc827efac), C32e(0xba8832e7), C32e(0x324f7d2b), C32e(0xe642a495), - C32e(0xc03bfba0), C32e(0x19aab398), C32e(0x9ef668d1), C32e(0xa322817f), - C32e(0x44eeaa66), C32e(0x54d6827e), C32e(0x3bdde6ab), C32e(0x0b959e83), - C32e(0x8cc945ca), C32e(0xc7bc7b29), C32e(0x6b056ed3), C32e(0x286c443c), - C32e(0xa72c8b79), C32e(0xbc813de2), C32e(0x1631271d), C32e(0xad379a76), - C32e(0xdb964d3b), C32e(0x649efa56), C32e(0x74a6d24e), C32e(0x1436221e), - C32e(0x92e476db), C32e(0x0c121e0a), C32e(0x48fcb46c), C32e(0xb88f37e4), - C32e(0x9f78e75d), C32e(0xbd0fb26e), C32e(0x43692aef), C32e(0xc435f1a6), - C32e(0x39dae3a8), C32e(0x31c6f7a4), C32e(0xd38a5937), C32e(0xf274868b), - C32e(0xd5835632), C32e(0x8b4ec543), C32e(0x6e85eb59), C32e(0xda18c2b7), - C32e(0x018e8f8c), C32e(0xb11dac64), C32e(0x9cf16dd2), C32e(0x49723be0), - C32e(0xd81fc7b4), C32e(0xacb915fa), C32e(0xf3fa0907), C32e(0xcfa06f25), - C32e(0xca20eaaf), C32e(0xf47d898e), C32e(0x476720e9), C32e(0x10382818), - C32e(0x6f0b64d5), C32e(0xf0738388), C32e(0x4afbb16f), C32e(0x5cca9672), - C32e(0x38546c24), C32e(0x575f08f1), C32e(0x732152c7), C32e(0x9764f351), - C32e(0xcbae6523), C32e(0xa125847c), C32e(0xe857bf9c), C32e(0x3e5d6321), - C32e(0x96ea7cdd), C32e(0x611e7fdc), C32e(0x0d9c9186), C32e(0x0f9b9485), - C32e(0xe04bab90), C32e(0x7cbac642), C32e(0x712657c4), C32e(0xcc29e5aa), - C32e(0x90e373d8), C32e(0x06090f05), C32e(0xf7f40301), C32e(0x1c2a3612), - C32e(0xc23cfea3), C32e(0x6a8be15f), C32e(0xaebe10f9), C32e(0x69026bd0), - C32e(0x17bfa891), C32e(0x9971e858), C32e(0x3a536927), C32e(0x27f7d0b9), - C32e(0xd9914838), C32e(0xebde3513), C32e(0x2be5ceb3), C32e(0x22775533), - C32e(0xd204d6bb), C32e(0xa9399070), C32e(0x07878089), C32e(0x33c1f2a7), - C32e(0x2decc1b6), C32e(0x3c5a6622), C32e(0x15b8ad92), C32e(0xc9a96020), - C32e(0x875cdb49), C32e(0xaab01aff), C32e(0x50d88878), C32e(0xa52b8e7a), - C32e(0x03898a8f), C32e(0x594a13f8), C32e(0x09929b80), C32e(0x1a233917), - C32e(0x651075da), C32e(0xd7845331), C32e(0x84d551c6), C32e(0xd003d3b8), - C32e(0x82dc5ec3), C32e(0x29e2cbb0), C32e(0x5ac39977), C32e(0x1e2d3311), - C32e(0x7b3d46cb), C32e(0xa8b71ffc), C32e(0x6d0c61d6), C32e(0x2c624e3a) -}; - -static const sph_u32 T0dn[] = { - C32e(0xf497a5c6), C32e(0x97eb84f8), C32e(0xb0c799ee), C32e(0x8cf78df6), - C32e(0x17e50dff), C32e(0xdcb7bdd6), C32e(0xc8a7b1de), C32e(0xfc395491), - C32e(0xf0c05060), C32e(0x05040302), C32e(0xe087a9ce), C32e(0x87ac7d56), - C32e(0x2bd519e7), C32e(0xa67162b5), C32e(0x319ae64d), C32e(0xb5c39aec), - C32e(0xcf05458f), C32e(0xbc3e9d1f), C32e(0xc0094089), C32e(0x92ef87fa), - C32e(0x3fc515ef), C32e(0x267febb2), C32e(0x4007c98e), C32e(0x1ded0bfb), - C32e(0x2f82ec41), C32e(0xa97d67b3), C32e(0x1cbefd5f), C32e(0x258aea45), - C32e(0xda46bf23), C32e(0x02a6f753), C32e(0xa1d396e4), C32e(0xed2d5b9b), - C32e(0x5deac275), C32e(0x24d91ce1), C32e(0xe97aae3d), C32e(0xbe986a4c), - C32e(0xeed85a6c), C32e(0xc3fc417e), C32e(0x06f102f5), C32e(0xd11d4f83), - C32e(0xe4d05c68), C32e(0x07a2f451), C32e(0x5cb934d1), C32e(0x18e908f9), - C32e(0xaedf93e2), C32e(0x954d73ab), C32e(0xf5c45362), C32e(0x41543f2a), - C32e(0x14100c08), C32e(0xf6315295), C32e(0xaf8c6546), C32e(0xe2215e9d), - C32e(0x78602830), C32e(0xf86ea137), C32e(0x11140f0a), C32e(0xc45eb52f), - C32e(0x1b1c090e), C32e(0x5a483624), C32e(0xb6369b1b), C32e(0x47a53ddf), - C32e(0x6a8126cd), C32e(0xbb9c694e), C32e(0x4cfecd7f), C32e(0xbacf9fea), - C32e(0x2d241b12), C32e(0xb93a9e1d), C32e(0x9cb07458), C32e(0x72682e34), - C32e(0x776c2d36), C32e(0xcda3b2dc), C32e(0x2973eeb4), C32e(0x16b6fb5b), - C32e(0x0153f6a4), C32e(0xd7ec4d76), C32e(0xa37561b7), C32e(0x49face7d), - C32e(0x8da47b52), C32e(0x42a13edd), C32e(0x93bc715e), C32e(0xa2269713), - C32e(0x0457f5a6), C32e(0xb86968b9), C32e(0x00000000), C32e(0x74992cc1), - C32e(0xa0806040), C32e(0x21dd1fe3), C32e(0x43f2c879), C32e(0x2c77edb6), - C32e(0xd9b3bed4), C32e(0xca01468d), C32e(0x70ced967), C32e(0xdde44b72), - C32e(0x7933de94), C32e(0x672bd498), C32e(0x237be8b0), C32e(0xde114a85), - C32e(0xbd6d6bbb), C32e(0x7e912ac5), C32e(0x349ee54f), C32e(0x3ac116ed), - C32e(0x5417c586), C32e(0x622fd79a), C32e(0xffcc5566), C32e(0xa7229411), - C32e(0x4a0fcf8a), C32e(0x30c910e9), C32e(0x0a080604), C32e(0x98e781fe), - C32e(0x0b5bf0a0), C32e(0xccf04478), C32e(0xd54aba25), C32e(0x3e96e34b), - C32e(0x0e5ff3a2), C32e(0x19bafe5d), C32e(0x5b1bc080), C32e(0x850a8a05), - C32e(0xec7ead3f), C32e(0xdf42bc21), C32e(0xd8e04870), C32e(0x0cf904f1), - C32e(0x7ac6df63), C32e(0x58eec177), C32e(0x9f4575af), C32e(0xa5846342), - C32e(0x50403020), C32e(0x2ed11ae5), C32e(0x12e10efd), C32e(0xb7656dbf), - C32e(0xd4194c81), C32e(0x3c301418), C32e(0x5f4c3526), C32e(0x719d2fc3), - C32e(0x3867e1be), C32e(0xfd6aa235), C32e(0x4f0bcc88), C32e(0x4b5c392e), - C32e(0xf93d5793), C32e(0x0daaf255), C32e(0x9de382fc), C32e(0xc9f4477a), - C32e(0xef8bacc8), C32e(0x326fe7ba), C32e(0x7d642b32), C32e(0xa4d795e6), - C32e(0xfb9ba0c0), C32e(0xb3329819), C32e(0x6827d19e), C32e(0x815d7fa3), - C32e(0xaa886644), C32e(0x82a87e54), C32e(0xe676ab3b), C32e(0x9e16830b), - C32e(0x4503ca8c), C32e(0x7b9529c7), C32e(0x6ed6d36b), C32e(0x44503c28), - C32e(0x8b5579a7), C32e(0x3d63e2bc), C32e(0x272c1d16), C32e(0x9a4176ad), - C32e(0x4dad3bdb), C32e(0xfac85664), C32e(0xd2e84e74), C32e(0x22281e14), - C32e(0x763fdb92), C32e(0x1e180a0c), C32e(0xb4906c48), C32e(0x376be4b8), - C32e(0xe7255d9f), C32e(0xb2616ebd), C32e(0x2a86ef43), C32e(0xf193a6c4), - C32e(0xe372a839), C32e(0xf762a431), C32e(0x59bd37d3), C32e(0x86ff8bf2), - C32e(0x56b132d5), C32e(0xc50d438b), C32e(0xebdc596e), C32e(0xc2afb7da), - C32e(0x8f028c01), C32e(0xac7964b1), C32e(0x6d23d29c), C32e(0x3b92e049), - C32e(0xc7abb4d8), C32e(0x1543faac), C32e(0x09fd07f3), C32e(0x6f8525cf), - C32e(0xea8fafca), C32e(0x89f38ef4), C32e(0x208ee947), C32e(0x28201810), - C32e(0x64ded56f), C32e(0x83fb88f0), C32e(0xb1946f4a), C32e(0x96b8725c), - C32e(0x6c702438), C32e(0x08aef157), C32e(0x52e6c773), C32e(0xf3355197), - C32e(0x658d23cb), C32e(0x84597ca1), C32e(0xbfcb9ce8), C32e(0x637c213e), - C32e(0x7c37dd96), C32e(0x7fc2dc61), C32e(0x911a860d), C32e(0x941e850f), - C32e(0xabdb90e0), C32e(0xc6f8427c), C32e(0x57e2c471), C32e(0xe583aacc), - C32e(0x733bd890), C32e(0x0f0c0506), C32e(0x03f501f7), C32e(0x3638121c), - C32e(0xfe9fa3c2), C32e(0xe1d45f6a), C32e(0x1047f9ae), C32e(0x6bd2d069), - C32e(0xa82e9117), C32e(0xe8295899), C32e(0x6974273a), C32e(0xd04eb927), - C32e(0x48a938d9), C32e(0x35cd13eb), C32e(0xce56b32b), C32e(0x55443322), - C32e(0xd6bfbbd2), C32e(0x904970a9), C32e(0x800e8907), C32e(0xf266a733), - C32e(0xc15ab62d), C32e(0x6678223c), C32e(0xad2a9215), C32e(0x608920c9), - C32e(0xdb154987), C32e(0x1a4fffaa), C32e(0x88a07850), C32e(0x8e517aa5), - C32e(0x8a068f03), C32e(0x13b2f859), C32e(0x9b128009), C32e(0x3934171a), - C32e(0x75cada65), C32e(0x53b531d7), C32e(0x5113c684), C32e(0xd3bbb8d0), - C32e(0x5e1fc382), C32e(0xcb52b029), C32e(0x99b4775a), C32e(0x333c111e), - C32e(0x46f6cb7b), C32e(0x1f4bfca8), C32e(0x61dad66d), C32e(0x4e583a2c) -}; - -static const sph_u32 T1up[] = { - C32e(0xc6c632f4), C32e(0xf8f86f97), C32e(0xeeee5eb0), C32e(0xf6f67a8c), - C32e(0xffffe817), C32e(0xd6d60adc), C32e(0xdede16c8), C32e(0x91916dfc), - C32e(0x606090f0), C32e(0x02020705), C32e(0xcece2ee0), C32e(0x5656d187), - C32e(0xe7e7cc2b), C32e(0xb5b513a6), C32e(0x4d4d7c31), C32e(0xecec59b5), - C32e(0x8f8f40cf), C32e(0x1f1fa3bc), C32e(0x898949c0), C32e(0xfafa6892), - C32e(0xefefd03f), C32e(0xb2b29426), C32e(0x8e8ece40), C32e(0xfbfbe61d), - C32e(0x41416e2f), C32e(0xb3b31aa9), C32e(0x5f5f431c), C32e(0x45456025), - C32e(0x2323f9da), C32e(0x53535102), C32e(0xe4e445a1), C32e(0x9b9b76ed), - C32e(0x7575285d), C32e(0xe1e1c524), C32e(0x3d3dd4e9), C32e(0x4c4cf2be), - C32e(0x6c6c82ee), C32e(0x7e7ebdc3), C32e(0xf5f5f306), C32e(0x838352d1), - C32e(0x68688ce4), C32e(0x51515607), C32e(0xd1d18d5c), C32e(0xf9f9e118), - C32e(0xe2e24cae), C32e(0xabab3e95), C32e(0x626297f5), C32e(0x2a2a6b41), - C32e(0x08081c14), C32e(0x959563f6), C32e(0x4646e9af), C32e(0x9d9d7fe2), - C32e(0x30304878), C32e(0x3737cff8), C32e(0x0a0a1b11), C32e(0x2f2febc4), - C32e(0x0e0e151b), C32e(0x24247e5a), C32e(0x1b1badb6), C32e(0xdfdf9847), - C32e(0xcdcda76a), C32e(0x4e4ef5bb), C32e(0x7f7f334c), C32e(0xeaea50ba), - C32e(0x12123f2d), C32e(0x1d1da4b9), C32e(0x5858c49c), C32e(0x34344672), - C32e(0x36364177), C32e(0xdcdc11cd), C32e(0xb4b49d29), C32e(0x5b5b4d16), - C32e(0xa4a4a501), C32e(0x7676a1d7), C32e(0xb7b714a3), C32e(0x7d7d3449), - C32e(0x5252df8d), C32e(0xdddd9f42), C32e(0x5e5ecd93), C32e(0x1313b1a2), - C32e(0xa6a6a204), C32e(0xb9b901b8), C32e(0x00000000), C32e(0xc1c1b574), - C32e(0x4040e0a0), C32e(0xe3e3c221), C32e(0x79793a43), C32e(0xb6b69a2c), - C32e(0xd4d40dd9), C32e(0x8d8d47ca), C32e(0x67671770), C32e(0x7272afdd), - C32e(0x9494ed79), C32e(0x9898ff67), C32e(0xb0b09323), C32e(0x85855bde), - C32e(0xbbbb06bd), C32e(0xc5c5bb7e), C32e(0x4f4f7b34), C32e(0xededd73a), - C32e(0x8686d254), C32e(0x9a9af862), C32e(0x666699ff), C32e(0x1111b6a7), - C32e(0x8a8ac04a), C32e(0xe9e9d930), C32e(0x04040e0a), C32e(0xfefe6698), - C32e(0xa0a0ab0b), C32e(0x7878b4cc), C32e(0x2525f0d5), C32e(0x4b4b753e), - C32e(0xa2a2ac0e), C32e(0x5d5d4419), C32e(0x8080db5b), C32e(0x05058085), - C32e(0x3f3fd3ec), C32e(0x2121fedf), C32e(0x7070a8d8), C32e(0xf1f1fd0c), - C32e(0x6363197a), C32e(0x77772f58), C32e(0xafaf309f), C32e(0x4242e7a5), - C32e(0x20207050), C32e(0xe5e5cb2e), C32e(0xfdfdef12), C32e(0xbfbf08b7), - C32e(0x818155d4), C32e(0x1818243c), C32e(0x2626795f), C32e(0xc3c3b271), - C32e(0xbebe8638), C32e(0x3535c8fd), C32e(0x8888c74f), C32e(0x2e2e654b), - C32e(0x93936af9), C32e(0x5555580d), C32e(0xfcfc619d), C32e(0x7a7ab3c9), - C32e(0xc8c827ef), C32e(0xbaba8832), C32e(0x32324f7d), C32e(0xe6e642a4), - C32e(0xc0c03bfb), C32e(0x1919aab3), C32e(0x9e9ef668), C32e(0xa3a32281), - C32e(0x4444eeaa), C32e(0x5454d682), C32e(0x3b3bdde6), C32e(0x0b0b959e), - C32e(0x8c8cc945), C32e(0xc7c7bc7b), C32e(0x6b6b056e), C32e(0x28286c44), - C32e(0xa7a72c8b), C32e(0xbcbc813d), C32e(0x16163127), C32e(0xadad379a), - C32e(0xdbdb964d), C32e(0x64649efa), C32e(0x7474a6d2), C32e(0x14143622), - C32e(0x9292e476), C32e(0x0c0c121e), C32e(0x4848fcb4), C32e(0xb8b88f37), - C32e(0x9f9f78e7), C32e(0xbdbd0fb2), C32e(0x4343692a), C32e(0xc4c435f1), - C32e(0x3939dae3), C32e(0x3131c6f7), C32e(0xd3d38a59), C32e(0xf2f27486), - C32e(0xd5d58356), C32e(0x8b8b4ec5), C32e(0x6e6e85eb), C32e(0xdada18c2), - C32e(0x01018e8f), C32e(0xb1b11dac), C32e(0x9c9cf16d), C32e(0x4949723b), - C32e(0xd8d81fc7), C32e(0xacacb915), C32e(0xf3f3fa09), C32e(0xcfcfa06f), - C32e(0xcaca20ea), C32e(0xf4f47d89), C32e(0x47476720), C32e(0x10103828), - C32e(0x6f6f0b64), C32e(0xf0f07383), C32e(0x4a4afbb1), C32e(0x5c5cca96), - C32e(0x3838546c), C32e(0x57575f08), C32e(0x73732152), C32e(0x979764f3), - C32e(0xcbcbae65), C32e(0xa1a12584), C32e(0xe8e857bf), C32e(0x3e3e5d63), - C32e(0x9696ea7c), C32e(0x61611e7f), C32e(0x0d0d9c91), C32e(0x0f0f9b94), - C32e(0xe0e04bab), C32e(0x7c7cbac6), C32e(0x71712657), C32e(0xcccc29e5), - C32e(0x9090e373), C32e(0x0606090f), C32e(0xf7f7f403), C32e(0x1c1c2a36), - C32e(0xc2c23cfe), C32e(0x6a6a8be1), C32e(0xaeaebe10), C32e(0x6969026b), - C32e(0x1717bfa8), C32e(0x999971e8), C32e(0x3a3a5369), C32e(0x2727f7d0), - C32e(0xd9d99148), C32e(0xebebde35), C32e(0x2b2be5ce), C32e(0x22227755), - C32e(0xd2d204d6), C32e(0xa9a93990), C32e(0x07078780), C32e(0x3333c1f2), - C32e(0x2d2decc1), C32e(0x3c3c5a66), C32e(0x1515b8ad), C32e(0xc9c9a960), - C32e(0x87875cdb), C32e(0xaaaab01a), C32e(0x5050d888), C32e(0xa5a52b8e), - C32e(0x0303898a), C32e(0x59594a13), C32e(0x0909929b), C32e(0x1a1a2339), - C32e(0x65651075), C32e(0xd7d78453), C32e(0x8484d551), C32e(0xd0d003d3), - C32e(0x8282dc5e), C32e(0x2929e2cb), C32e(0x5a5ac399), C32e(0x1e1e2d33), - C32e(0x7b7b3d46), C32e(0xa8a8b71f), C32e(0x6d6d0c61), C32e(0x2c2c624e) -}; - -static const sph_u32 T1dn[] = { - C32e(0xa5f497a5), C32e(0x8497eb84), C32e(0x99b0c799), C32e(0x8d8cf78d), - C32e(0x0d17e50d), C32e(0xbddcb7bd), C32e(0xb1c8a7b1), C32e(0x54fc3954), - C32e(0x50f0c050), C32e(0x03050403), C32e(0xa9e087a9), C32e(0x7d87ac7d), - C32e(0x192bd519), C32e(0x62a67162), C32e(0xe6319ae6), C32e(0x9ab5c39a), - C32e(0x45cf0545), C32e(0x9dbc3e9d), C32e(0x40c00940), C32e(0x8792ef87), - C32e(0x153fc515), C32e(0xeb267feb), C32e(0xc94007c9), C32e(0x0b1ded0b), - C32e(0xec2f82ec), C32e(0x67a97d67), C32e(0xfd1cbefd), C32e(0xea258aea), - C32e(0xbfda46bf), C32e(0xf702a6f7), C32e(0x96a1d396), C32e(0x5bed2d5b), - C32e(0xc25deac2), C32e(0x1c24d91c), C32e(0xaee97aae), C32e(0x6abe986a), - C32e(0x5aeed85a), C32e(0x41c3fc41), C32e(0x0206f102), C32e(0x4fd11d4f), - C32e(0x5ce4d05c), C32e(0xf407a2f4), C32e(0x345cb934), C32e(0x0818e908), - C32e(0x93aedf93), C32e(0x73954d73), C32e(0x53f5c453), C32e(0x3f41543f), - C32e(0x0c14100c), C32e(0x52f63152), C32e(0x65af8c65), C32e(0x5ee2215e), - C32e(0x28786028), C32e(0xa1f86ea1), C32e(0x0f11140f), C32e(0xb5c45eb5), - C32e(0x091b1c09), C32e(0x365a4836), C32e(0x9bb6369b), C32e(0x3d47a53d), - C32e(0x266a8126), C32e(0x69bb9c69), C32e(0xcd4cfecd), C32e(0x9fbacf9f), - C32e(0x1b2d241b), C32e(0x9eb93a9e), C32e(0x749cb074), C32e(0x2e72682e), - C32e(0x2d776c2d), C32e(0xb2cda3b2), C32e(0xee2973ee), C32e(0xfb16b6fb), - C32e(0xf60153f6), C32e(0x4dd7ec4d), C32e(0x61a37561), C32e(0xce49face), - C32e(0x7b8da47b), C32e(0x3e42a13e), C32e(0x7193bc71), C32e(0x97a22697), - C32e(0xf50457f5), C32e(0x68b86968), C32e(0x00000000), C32e(0x2c74992c), - C32e(0x60a08060), C32e(0x1f21dd1f), C32e(0xc843f2c8), C32e(0xed2c77ed), - C32e(0xbed9b3be), C32e(0x46ca0146), C32e(0xd970ced9), C32e(0x4bdde44b), - C32e(0xde7933de), C32e(0xd4672bd4), C32e(0xe8237be8), C32e(0x4ade114a), - C32e(0x6bbd6d6b), C32e(0x2a7e912a), C32e(0xe5349ee5), C32e(0x163ac116), - C32e(0xc55417c5), C32e(0xd7622fd7), C32e(0x55ffcc55), C32e(0x94a72294), - C32e(0xcf4a0fcf), C32e(0x1030c910), C32e(0x060a0806), C32e(0x8198e781), - C32e(0xf00b5bf0), C32e(0x44ccf044), C32e(0xbad54aba), C32e(0xe33e96e3), - C32e(0xf30e5ff3), C32e(0xfe19bafe), C32e(0xc05b1bc0), C32e(0x8a850a8a), - C32e(0xadec7ead), C32e(0xbcdf42bc), C32e(0x48d8e048), C32e(0x040cf904), - C32e(0xdf7ac6df), C32e(0xc158eec1), C32e(0x759f4575), C32e(0x63a58463), - C32e(0x30504030), C32e(0x1a2ed11a), C32e(0x0e12e10e), C32e(0x6db7656d), - C32e(0x4cd4194c), C32e(0x143c3014), C32e(0x355f4c35), C32e(0x2f719d2f), - C32e(0xe13867e1), C32e(0xa2fd6aa2), C32e(0xcc4f0bcc), C32e(0x394b5c39), - C32e(0x57f93d57), C32e(0xf20daaf2), C32e(0x829de382), C32e(0x47c9f447), - C32e(0xacef8bac), C32e(0xe7326fe7), C32e(0x2b7d642b), C32e(0x95a4d795), - C32e(0xa0fb9ba0), C32e(0x98b33298), C32e(0xd16827d1), C32e(0x7f815d7f), - C32e(0x66aa8866), C32e(0x7e82a87e), C32e(0xabe676ab), C32e(0x839e1683), - C32e(0xca4503ca), C32e(0x297b9529), C32e(0xd36ed6d3), C32e(0x3c44503c), - C32e(0x798b5579), C32e(0xe23d63e2), C32e(0x1d272c1d), C32e(0x769a4176), - C32e(0x3b4dad3b), C32e(0x56fac856), C32e(0x4ed2e84e), C32e(0x1e22281e), - C32e(0xdb763fdb), C32e(0x0a1e180a), C32e(0x6cb4906c), C32e(0xe4376be4), - C32e(0x5de7255d), C32e(0x6eb2616e), C32e(0xef2a86ef), C32e(0xa6f193a6), - C32e(0xa8e372a8), C32e(0xa4f762a4), C32e(0x3759bd37), C32e(0x8b86ff8b), - C32e(0x3256b132), C32e(0x43c50d43), C32e(0x59ebdc59), C32e(0xb7c2afb7), - C32e(0x8c8f028c), C32e(0x64ac7964), C32e(0xd26d23d2), C32e(0xe03b92e0), - C32e(0xb4c7abb4), C32e(0xfa1543fa), C32e(0x0709fd07), C32e(0x256f8525), - C32e(0xafea8faf), C32e(0x8e89f38e), C32e(0xe9208ee9), C32e(0x18282018), - C32e(0xd564ded5), C32e(0x8883fb88), C32e(0x6fb1946f), C32e(0x7296b872), - C32e(0x246c7024), C32e(0xf108aef1), C32e(0xc752e6c7), C32e(0x51f33551), - C32e(0x23658d23), C32e(0x7c84597c), C32e(0x9cbfcb9c), C32e(0x21637c21), - C32e(0xdd7c37dd), C32e(0xdc7fc2dc), C32e(0x86911a86), C32e(0x85941e85), - C32e(0x90abdb90), C32e(0x42c6f842), C32e(0xc457e2c4), C32e(0xaae583aa), - C32e(0xd8733bd8), C32e(0x050f0c05), C32e(0x0103f501), C32e(0x12363812), - C32e(0xa3fe9fa3), C32e(0x5fe1d45f), C32e(0xf91047f9), C32e(0xd06bd2d0), - C32e(0x91a82e91), C32e(0x58e82958), C32e(0x27697427), C32e(0xb9d04eb9), - C32e(0x3848a938), C32e(0x1335cd13), C32e(0xb3ce56b3), C32e(0x33554433), - C32e(0xbbd6bfbb), C32e(0x70904970), C32e(0x89800e89), C32e(0xa7f266a7), - C32e(0xb6c15ab6), C32e(0x22667822), C32e(0x92ad2a92), C32e(0x20608920), - C32e(0x49db1549), C32e(0xff1a4fff), C32e(0x7888a078), C32e(0x7a8e517a), - C32e(0x8f8a068f), C32e(0xf813b2f8), C32e(0x809b1280), C32e(0x17393417), - C32e(0xda75cada), C32e(0x3153b531), C32e(0xc65113c6), C32e(0xb8d3bbb8), - C32e(0xc35e1fc3), C32e(0xb0cb52b0), C32e(0x7799b477), C32e(0x11333c11), - C32e(0xcb46f6cb), C32e(0xfc1f4bfc), C32e(0xd661dad6), C32e(0x3a4e583a) -}; - -static const sph_u32 T2up[] = { - C32e(0xa5c6c632), C32e(0x84f8f86f), C32e(0x99eeee5e), C32e(0x8df6f67a), - C32e(0x0dffffe8), C32e(0xbdd6d60a), C32e(0xb1dede16), C32e(0x5491916d), - C32e(0x50606090), C32e(0x03020207), C32e(0xa9cece2e), C32e(0x7d5656d1), - C32e(0x19e7e7cc), C32e(0x62b5b513), C32e(0xe64d4d7c), C32e(0x9aecec59), - C32e(0x458f8f40), C32e(0x9d1f1fa3), C32e(0x40898949), C32e(0x87fafa68), - C32e(0x15efefd0), C32e(0xebb2b294), C32e(0xc98e8ece), C32e(0x0bfbfbe6), - C32e(0xec41416e), C32e(0x67b3b31a), C32e(0xfd5f5f43), C32e(0xea454560), - C32e(0xbf2323f9), C32e(0xf7535351), C32e(0x96e4e445), C32e(0x5b9b9b76), - C32e(0xc2757528), C32e(0x1ce1e1c5), C32e(0xae3d3dd4), C32e(0x6a4c4cf2), - C32e(0x5a6c6c82), C32e(0x417e7ebd), C32e(0x02f5f5f3), C32e(0x4f838352), - C32e(0x5c68688c), C32e(0xf4515156), C32e(0x34d1d18d), C32e(0x08f9f9e1), - C32e(0x93e2e24c), C32e(0x73abab3e), C32e(0x53626297), C32e(0x3f2a2a6b), - C32e(0x0c08081c), C32e(0x52959563), C32e(0x654646e9), C32e(0x5e9d9d7f), - C32e(0x28303048), C32e(0xa13737cf), C32e(0x0f0a0a1b), C32e(0xb52f2feb), - C32e(0x090e0e15), C32e(0x3624247e), C32e(0x9b1b1bad), C32e(0x3ddfdf98), - C32e(0x26cdcda7), C32e(0x694e4ef5), C32e(0xcd7f7f33), C32e(0x9feaea50), - C32e(0x1b12123f), C32e(0x9e1d1da4), C32e(0x745858c4), C32e(0x2e343446), - C32e(0x2d363641), C32e(0xb2dcdc11), C32e(0xeeb4b49d), C32e(0xfb5b5b4d), - C32e(0xf6a4a4a5), C32e(0x4d7676a1), C32e(0x61b7b714), C32e(0xce7d7d34), - C32e(0x7b5252df), C32e(0x3edddd9f), C32e(0x715e5ecd), C32e(0x971313b1), - C32e(0xf5a6a6a2), C32e(0x68b9b901), C32e(0x00000000), C32e(0x2cc1c1b5), - C32e(0x604040e0), C32e(0x1fe3e3c2), C32e(0xc879793a), C32e(0xedb6b69a), - C32e(0xbed4d40d), C32e(0x468d8d47), C32e(0xd9676717), C32e(0x4b7272af), - C32e(0xde9494ed), C32e(0xd49898ff), C32e(0xe8b0b093), C32e(0x4a85855b), - C32e(0x6bbbbb06), C32e(0x2ac5c5bb), C32e(0xe54f4f7b), C32e(0x16ededd7), - C32e(0xc58686d2), C32e(0xd79a9af8), C32e(0x55666699), C32e(0x941111b6), - C32e(0xcf8a8ac0), C32e(0x10e9e9d9), C32e(0x0604040e), C32e(0x81fefe66), - C32e(0xf0a0a0ab), C32e(0x447878b4), C32e(0xba2525f0), C32e(0xe34b4b75), - C32e(0xf3a2a2ac), C32e(0xfe5d5d44), C32e(0xc08080db), C32e(0x8a050580), - C32e(0xad3f3fd3), C32e(0xbc2121fe), C32e(0x487070a8), C32e(0x04f1f1fd), - C32e(0xdf636319), C32e(0xc177772f), C32e(0x75afaf30), C32e(0x634242e7), - C32e(0x30202070), C32e(0x1ae5e5cb), C32e(0x0efdfdef), C32e(0x6dbfbf08), - C32e(0x4c818155), C32e(0x14181824), C32e(0x35262679), C32e(0x2fc3c3b2), - C32e(0xe1bebe86), C32e(0xa23535c8), C32e(0xcc8888c7), C32e(0x392e2e65), - C32e(0x5793936a), C32e(0xf2555558), C32e(0x82fcfc61), C32e(0x477a7ab3), - C32e(0xacc8c827), C32e(0xe7baba88), C32e(0x2b32324f), C32e(0x95e6e642), - C32e(0xa0c0c03b), C32e(0x981919aa), C32e(0xd19e9ef6), C32e(0x7fa3a322), - C32e(0x664444ee), C32e(0x7e5454d6), C32e(0xab3b3bdd), C32e(0x830b0b95), - C32e(0xca8c8cc9), C32e(0x29c7c7bc), C32e(0xd36b6b05), C32e(0x3c28286c), - C32e(0x79a7a72c), C32e(0xe2bcbc81), C32e(0x1d161631), C32e(0x76adad37), - C32e(0x3bdbdb96), C32e(0x5664649e), C32e(0x4e7474a6), C32e(0x1e141436), - C32e(0xdb9292e4), C32e(0x0a0c0c12), C32e(0x6c4848fc), C32e(0xe4b8b88f), - C32e(0x5d9f9f78), C32e(0x6ebdbd0f), C32e(0xef434369), C32e(0xa6c4c435), - C32e(0xa83939da), C32e(0xa43131c6), C32e(0x37d3d38a), C32e(0x8bf2f274), - C32e(0x32d5d583), C32e(0x438b8b4e), C32e(0x596e6e85), C32e(0xb7dada18), - C32e(0x8c01018e), C32e(0x64b1b11d), C32e(0xd29c9cf1), C32e(0xe0494972), - C32e(0xb4d8d81f), C32e(0xfaacacb9), C32e(0x07f3f3fa), C32e(0x25cfcfa0), - C32e(0xafcaca20), C32e(0x8ef4f47d), C32e(0xe9474767), C32e(0x18101038), - C32e(0xd56f6f0b), C32e(0x88f0f073), C32e(0x6f4a4afb), C32e(0x725c5cca), - C32e(0x24383854), C32e(0xf157575f), C32e(0xc7737321), C32e(0x51979764), - C32e(0x23cbcbae), C32e(0x7ca1a125), C32e(0x9ce8e857), C32e(0x213e3e5d), - C32e(0xdd9696ea), C32e(0xdc61611e), C32e(0x860d0d9c), C32e(0x850f0f9b), - C32e(0x90e0e04b), C32e(0x427c7cba), C32e(0xc4717126), C32e(0xaacccc29), - C32e(0xd89090e3), C32e(0x05060609), C32e(0x01f7f7f4), C32e(0x121c1c2a), - C32e(0xa3c2c23c), C32e(0x5f6a6a8b), C32e(0xf9aeaebe), C32e(0xd0696902), - C32e(0x911717bf), C32e(0x58999971), C32e(0x273a3a53), C32e(0xb92727f7), - C32e(0x38d9d991), C32e(0x13ebebde), C32e(0xb32b2be5), C32e(0x33222277), - C32e(0xbbd2d204), C32e(0x70a9a939), C32e(0x89070787), C32e(0xa73333c1), - C32e(0xb62d2dec), C32e(0x223c3c5a), C32e(0x921515b8), C32e(0x20c9c9a9), - C32e(0x4987875c), C32e(0xffaaaab0), C32e(0x785050d8), C32e(0x7aa5a52b), - C32e(0x8f030389), C32e(0xf859594a), C32e(0x80090992), C32e(0x171a1a23), - C32e(0xda656510), C32e(0x31d7d784), C32e(0xc68484d5), C32e(0xb8d0d003), - C32e(0xc38282dc), C32e(0xb02929e2), C32e(0x775a5ac3), C32e(0x111e1e2d), - C32e(0xcb7b7b3d), C32e(0xfca8a8b7), C32e(0xd66d6d0c), C32e(0x3a2c2c62) -}; - -static const sph_u32 T2dn[] = { - C32e(0xf4a5f497), C32e(0x978497eb), C32e(0xb099b0c7), C32e(0x8c8d8cf7), - C32e(0x170d17e5), C32e(0xdcbddcb7), C32e(0xc8b1c8a7), C32e(0xfc54fc39), - C32e(0xf050f0c0), C32e(0x05030504), C32e(0xe0a9e087), C32e(0x877d87ac), - C32e(0x2b192bd5), C32e(0xa662a671), C32e(0x31e6319a), C32e(0xb59ab5c3), - C32e(0xcf45cf05), C32e(0xbc9dbc3e), C32e(0xc040c009), C32e(0x928792ef), - C32e(0x3f153fc5), C32e(0x26eb267f), C32e(0x40c94007), C32e(0x1d0b1ded), - C32e(0x2fec2f82), C32e(0xa967a97d), C32e(0x1cfd1cbe), C32e(0x25ea258a), - C32e(0xdabfda46), C32e(0x02f702a6), C32e(0xa196a1d3), C32e(0xed5bed2d), - C32e(0x5dc25dea), C32e(0x241c24d9), C32e(0xe9aee97a), C32e(0xbe6abe98), - C32e(0xee5aeed8), C32e(0xc341c3fc), C32e(0x060206f1), C32e(0xd14fd11d), - C32e(0xe45ce4d0), C32e(0x07f407a2), C32e(0x5c345cb9), C32e(0x180818e9), - C32e(0xae93aedf), C32e(0x9573954d), C32e(0xf553f5c4), C32e(0x413f4154), - C32e(0x140c1410), C32e(0xf652f631), C32e(0xaf65af8c), C32e(0xe25ee221), - C32e(0x78287860), C32e(0xf8a1f86e), C32e(0x110f1114), C32e(0xc4b5c45e), - C32e(0x1b091b1c), C32e(0x5a365a48), C32e(0xb69bb636), C32e(0x473d47a5), - C32e(0x6a266a81), C32e(0xbb69bb9c), C32e(0x4ccd4cfe), C32e(0xba9fbacf), - C32e(0x2d1b2d24), C32e(0xb99eb93a), C32e(0x9c749cb0), C32e(0x722e7268), - C32e(0x772d776c), C32e(0xcdb2cda3), C32e(0x29ee2973), C32e(0x16fb16b6), - C32e(0x01f60153), C32e(0xd74dd7ec), C32e(0xa361a375), C32e(0x49ce49fa), - C32e(0x8d7b8da4), C32e(0x423e42a1), C32e(0x937193bc), C32e(0xa297a226), - C32e(0x04f50457), C32e(0xb868b869), C32e(0x00000000), C32e(0x742c7499), - C32e(0xa060a080), C32e(0x211f21dd), C32e(0x43c843f2), C32e(0x2ced2c77), - C32e(0xd9bed9b3), C32e(0xca46ca01), C32e(0x70d970ce), C32e(0xdd4bdde4), - C32e(0x79de7933), C32e(0x67d4672b), C32e(0x23e8237b), C32e(0xde4ade11), - C32e(0xbd6bbd6d), C32e(0x7e2a7e91), C32e(0x34e5349e), C32e(0x3a163ac1), - C32e(0x54c55417), C32e(0x62d7622f), C32e(0xff55ffcc), C32e(0xa794a722), - C32e(0x4acf4a0f), C32e(0x301030c9), C32e(0x0a060a08), C32e(0x988198e7), - C32e(0x0bf00b5b), C32e(0xcc44ccf0), C32e(0xd5bad54a), C32e(0x3ee33e96), - C32e(0x0ef30e5f), C32e(0x19fe19ba), C32e(0x5bc05b1b), C32e(0x858a850a), - C32e(0xecadec7e), C32e(0xdfbcdf42), C32e(0xd848d8e0), C32e(0x0c040cf9), - C32e(0x7adf7ac6), C32e(0x58c158ee), C32e(0x9f759f45), C32e(0xa563a584), - C32e(0x50305040), C32e(0x2e1a2ed1), C32e(0x120e12e1), C32e(0xb76db765), - C32e(0xd44cd419), C32e(0x3c143c30), C32e(0x5f355f4c), C32e(0x712f719d), - C32e(0x38e13867), C32e(0xfda2fd6a), C32e(0x4fcc4f0b), C32e(0x4b394b5c), - C32e(0xf957f93d), C32e(0x0df20daa), C32e(0x9d829de3), C32e(0xc947c9f4), - C32e(0xefacef8b), C32e(0x32e7326f), C32e(0x7d2b7d64), C32e(0xa495a4d7), - C32e(0xfba0fb9b), C32e(0xb398b332), C32e(0x68d16827), C32e(0x817f815d), - C32e(0xaa66aa88), C32e(0x827e82a8), C32e(0xe6abe676), C32e(0x9e839e16), - C32e(0x45ca4503), C32e(0x7b297b95), C32e(0x6ed36ed6), C32e(0x443c4450), - C32e(0x8b798b55), C32e(0x3de23d63), C32e(0x271d272c), C32e(0x9a769a41), - C32e(0x4d3b4dad), C32e(0xfa56fac8), C32e(0xd24ed2e8), C32e(0x221e2228), - C32e(0x76db763f), C32e(0x1e0a1e18), C32e(0xb46cb490), C32e(0x37e4376b), - C32e(0xe75de725), C32e(0xb26eb261), C32e(0x2aef2a86), C32e(0xf1a6f193), - C32e(0xe3a8e372), C32e(0xf7a4f762), C32e(0x593759bd), C32e(0x868b86ff), - C32e(0x563256b1), C32e(0xc543c50d), C32e(0xeb59ebdc), C32e(0xc2b7c2af), - C32e(0x8f8c8f02), C32e(0xac64ac79), C32e(0x6dd26d23), C32e(0x3be03b92), - C32e(0xc7b4c7ab), C32e(0x15fa1543), C32e(0x090709fd), C32e(0x6f256f85), - C32e(0xeaafea8f), C32e(0x898e89f3), C32e(0x20e9208e), C32e(0x28182820), - C32e(0x64d564de), C32e(0x838883fb), C32e(0xb16fb194), C32e(0x967296b8), - C32e(0x6c246c70), C32e(0x08f108ae), C32e(0x52c752e6), C32e(0xf351f335), - C32e(0x6523658d), C32e(0x847c8459), C32e(0xbf9cbfcb), C32e(0x6321637c), - C32e(0x7cdd7c37), C32e(0x7fdc7fc2), C32e(0x9186911a), C32e(0x9485941e), - C32e(0xab90abdb), C32e(0xc642c6f8), C32e(0x57c457e2), C32e(0xe5aae583), - C32e(0x73d8733b), C32e(0x0f050f0c), C32e(0x030103f5), C32e(0x36123638), - C32e(0xfea3fe9f), C32e(0xe15fe1d4), C32e(0x10f91047), C32e(0x6bd06bd2), - C32e(0xa891a82e), C32e(0xe858e829), C32e(0x69276974), C32e(0xd0b9d04e), - C32e(0x483848a9), C32e(0x351335cd), C32e(0xceb3ce56), C32e(0x55335544), - C32e(0xd6bbd6bf), C32e(0x90709049), C32e(0x8089800e), C32e(0xf2a7f266), - C32e(0xc1b6c15a), C32e(0x66226678), C32e(0xad92ad2a), C32e(0x60206089), - C32e(0xdb49db15), C32e(0x1aff1a4f), C32e(0x887888a0), C32e(0x8e7a8e51), - C32e(0x8a8f8a06), C32e(0x13f813b2), C32e(0x9b809b12), C32e(0x39173934), - C32e(0x75da75ca), C32e(0x533153b5), C32e(0x51c65113), C32e(0xd3b8d3bb), - C32e(0x5ec35e1f), C32e(0xcbb0cb52), C32e(0x997799b4), C32e(0x3311333c), - C32e(0x46cb46f6), C32e(0x1ffc1f4b), C32e(0x61d661da), C32e(0x4e3a4e58) -}; - -static const sph_u32 T3up[] = { - C32e(0x97a5c6c6), C32e(0xeb84f8f8), C32e(0xc799eeee), C32e(0xf78df6f6), - C32e(0xe50dffff), C32e(0xb7bdd6d6), C32e(0xa7b1dede), C32e(0x39549191), - C32e(0xc0506060), C32e(0x04030202), C32e(0x87a9cece), C32e(0xac7d5656), - C32e(0xd519e7e7), C32e(0x7162b5b5), C32e(0x9ae64d4d), C32e(0xc39aecec), - C32e(0x05458f8f), C32e(0x3e9d1f1f), C32e(0x09408989), C32e(0xef87fafa), - C32e(0xc515efef), C32e(0x7febb2b2), C32e(0x07c98e8e), C32e(0xed0bfbfb), - C32e(0x82ec4141), C32e(0x7d67b3b3), C32e(0xbefd5f5f), C32e(0x8aea4545), - C32e(0x46bf2323), C32e(0xa6f75353), C32e(0xd396e4e4), C32e(0x2d5b9b9b), - C32e(0xeac27575), C32e(0xd91ce1e1), C32e(0x7aae3d3d), C32e(0x986a4c4c), - C32e(0xd85a6c6c), C32e(0xfc417e7e), C32e(0xf102f5f5), C32e(0x1d4f8383), - C32e(0xd05c6868), C32e(0xa2f45151), C32e(0xb934d1d1), C32e(0xe908f9f9), - C32e(0xdf93e2e2), C32e(0x4d73abab), C32e(0xc4536262), C32e(0x543f2a2a), - C32e(0x100c0808), C32e(0x31529595), C32e(0x8c654646), C32e(0x215e9d9d), - C32e(0x60283030), C32e(0x6ea13737), C32e(0x140f0a0a), C32e(0x5eb52f2f), - C32e(0x1c090e0e), C32e(0x48362424), C32e(0x369b1b1b), C32e(0xa53ddfdf), - C32e(0x8126cdcd), C32e(0x9c694e4e), C32e(0xfecd7f7f), C32e(0xcf9feaea), - C32e(0x241b1212), C32e(0x3a9e1d1d), C32e(0xb0745858), C32e(0x682e3434), - C32e(0x6c2d3636), C32e(0xa3b2dcdc), C32e(0x73eeb4b4), C32e(0xb6fb5b5b), - C32e(0x53f6a4a4), C32e(0xec4d7676), C32e(0x7561b7b7), C32e(0xface7d7d), - C32e(0xa47b5252), C32e(0xa13edddd), C32e(0xbc715e5e), C32e(0x26971313), - C32e(0x57f5a6a6), C32e(0x6968b9b9), C32e(0x00000000), C32e(0x992cc1c1), - C32e(0x80604040), C32e(0xdd1fe3e3), C32e(0xf2c87979), C32e(0x77edb6b6), - C32e(0xb3bed4d4), C32e(0x01468d8d), C32e(0xced96767), C32e(0xe44b7272), - C32e(0x33de9494), C32e(0x2bd49898), C32e(0x7be8b0b0), C32e(0x114a8585), - C32e(0x6d6bbbbb), C32e(0x912ac5c5), C32e(0x9ee54f4f), C32e(0xc116eded), - C32e(0x17c58686), C32e(0x2fd79a9a), C32e(0xcc556666), C32e(0x22941111), - C32e(0x0fcf8a8a), C32e(0xc910e9e9), C32e(0x08060404), C32e(0xe781fefe), - C32e(0x5bf0a0a0), C32e(0xf0447878), C32e(0x4aba2525), C32e(0x96e34b4b), - C32e(0x5ff3a2a2), C32e(0xbafe5d5d), C32e(0x1bc08080), C32e(0x0a8a0505), - C32e(0x7ead3f3f), C32e(0x42bc2121), C32e(0xe0487070), C32e(0xf904f1f1), - C32e(0xc6df6363), C32e(0xeec17777), C32e(0x4575afaf), C32e(0x84634242), - C32e(0x40302020), C32e(0xd11ae5e5), C32e(0xe10efdfd), C32e(0x656dbfbf), - C32e(0x194c8181), C32e(0x30141818), C32e(0x4c352626), C32e(0x9d2fc3c3), - C32e(0x67e1bebe), C32e(0x6aa23535), C32e(0x0bcc8888), C32e(0x5c392e2e), - C32e(0x3d579393), C32e(0xaaf25555), C32e(0xe382fcfc), C32e(0xf4477a7a), - C32e(0x8bacc8c8), C32e(0x6fe7baba), C32e(0x642b3232), C32e(0xd795e6e6), - C32e(0x9ba0c0c0), C32e(0x32981919), C32e(0x27d19e9e), C32e(0x5d7fa3a3), - C32e(0x88664444), C32e(0xa87e5454), C32e(0x76ab3b3b), C32e(0x16830b0b), - C32e(0x03ca8c8c), C32e(0x9529c7c7), C32e(0xd6d36b6b), C32e(0x503c2828), - C32e(0x5579a7a7), C32e(0x63e2bcbc), C32e(0x2c1d1616), C32e(0x4176adad), - C32e(0xad3bdbdb), C32e(0xc8566464), C32e(0xe84e7474), C32e(0x281e1414), - C32e(0x3fdb9292), C32e(0x180a0c0c), C32e(0x906c4848), C32e(0x6be4b8b8), - C32e(0x255d9f9f), C32e(0x616ebdbd), C32e(0x86ef4343), C32e(0x93a6c4c4), - C32e(0x72a83939), C32e(0x62a43131), C32e(0xbd37d3d3), C32e(0xff8bf2f2), - C32e(0xb132d5d5), C32e(0x0d438b8b), C32e(0xdc596e6e), C32e(0xafb7dada), - C32e(0x028c0101), C32e(0x7964b1b1), C32e(0x23d29c9c), C32e(0x92e04949), - C32e(0xabb4d8d8), C32e(0x43faacac), C32e(0xfd07f3f3), C32e(0x8525cfcf), - C32e(0x8fafcaca), C32e(0xf38ef4f4), C32e(0x8ee94747), C32e(0x20181010), - C32e(0xded56f6f), C32e(0xfb88f0f0), C32e(0x946f4a4a), C32e(0xb8725c5c), - C32e(0x70243838), C32e(0xaef15757), C32e(0xe6c77373), C32e(0x35519797), - C32e(0x8d23cbcb), C32e(0x597ca1a1), C32e(0xcb9ce8e8), C32e(0x7c213e3e), - C32e(0x37dd9696), C32e(0xc2dc6161), C32e(0x1a860d0d), C32e(0x1e850f0f), - C32e(0xdb90e0e0), C32e(0xf8427c7c), C32e(0xe2c47171), C32e(0x83aacccc), - C32e(0x3bd89090), C32e(0x0c050606), C32e(0xf501f7f7), C32e(0x38121c1c), - C32e(0x9fa3c2c2), C32e(0xd45f6a6a), C32e(0x47f9aeae), C32e(0xd2d06969), - C32e(0x2e911717), C32e(0x29589999), C32e(0x74273a3a), C32e(0x4eb92727), - C32e(0xa938d9d9), C32e(0xcd13ebeb), C32e(0x56b32b2b), C32e(0x44332222), - C32e(0xbfbbd2d2), C32e(0x4970a9a9), C32e(0x0e890707), C32e(0x66a73333), - C32e(0x5ab62d2d), C32e(0x78223c3c), C32e(0x2a921515), C32e(0x8920c9c9), - C32e(0x15498787), C32e(0x4fffaaaa), C32e(0xa0785050), C32e(0x517aa5a5), - C32e(0x068f0303), C32e(0xb2f85959), C32e(0x12800909), C32e(0x34171a1a), - C32e(0xcada6565), C32e(0xb531d7d7), C32e(0x13c68484), C32e(0xbbb8d0d0), - C32e(0x1fc38282), C32e(0x52b02929), C32e(0xb4775a5a), C32e(0x3c111e1e), - C32e(0xf6cb7b7b), C32e(0x4bfca8a8), C32e(0xdad66d6d), C32e(0x583a2c2c) -}; - -static const sph_u32 T3dn[] = { - C32e(0x32f4a5f4), C32e(0x6f978497), C32e(0x5eb099b0), C32e(0x7a8c8d8c), - C32e(0xe8170d17), C32e(0x0adcbddc), C32e(0x16c8b1c8), C32e(0x6dfc54fc), - C32e(0x90f050f0), C32e(0x07050305), C32e(0x2ee0a9e0), C32e(0xd1877d87), - C32e(0xcc2b192b), C32e(0x13a662a6), C32e(0x7c31e631), C32e(0x59b59ab5), - C32e(0x40cf45cf), C32e(0xa3bc9dbc), C32e(0x49c040c0), C32e(0x68928792), - C32e(0xd03f153f), C32e(0x9426eb26), C32e(0xce40c940), C32e(0xe61d0b1d), - C32e(0x6e2fec2f), C32e(0x1aa967a9), C32e(0x431cfd1c), C32e(0x6025ea25), - C32e(0xf9dabfda), C32e(0x5102f702), C32e(0x45a196a1), C32e(0x76ed5bed), - C32e(0x285dc25d), C32e(0xc5241c24), C32e(0xd4e9aee9), C32e(0xf2be6abe), - C32e(0x82ee5aee), C32e(0xbdc341c3), C32e(0xf3060206), C32e(0x52d14fd1), - C32e(0x8ce45ce4), C32e(0x5607f407), C32e(0x8d5c345c), C32e(0xe1180818), - C32e(0x4cae93ae), C32e(0x3e957395), C32e(0x97f553f5), C32e(0x6b413f41), - C32e(0x1c140c14), C32e(0x63f652f6), C32e(0xe9af65af), C32e(0x7fe25ee2), - C32e(0x48782878), C32e(0xcff8a1f8), C32e(0x1b110f11), C32e(0xebc4b5c4), - C32e(0x151b091b), C32e(0x7e5a365a), C32e(0xadb69bb6), C32e(0x98473d47), - C32e(0xa76a266a), C32e(0xf5bb69bb), C32e(0x334ccd4c), C32e(0x50ba9fba), - C32e(0x3f2d1b2d), C32e(0xa4b99eb9), C32e(0xc49c749c), C32e(0x46722e72), - C32e(0x41772d77), C32e(0x11cdb2cd), C32e(0x9d29ee29), C32e(0x4d16fb16), - C32e(0xa501f601), C32e(0xa1d74dd7), C32e(0x14a361a3), C32e(0x3449ce49), - C32e(0xdf8d7b8d), C32e(0x9f423e42), C32e(0xcd937193), C32e(0xb1a297a2), - C32e(0xa204f504), C32e(0x01b868b8), C32e(0x00000000), C32e(0xb5742c74), - C32e(0xe0a060a0), C32e(0xc2211f21), C32e(0x3a43c843), C32e(0x9a2ced2c), - C32e(0x0dd9bed9), C32e(0x47ca46ca), C32e(0x1770d970), C32e(0xafdd4bdd), - C32e(0xed79de79), C32e(0xff67d467), C32e(0x9323e823), C32e(0x5bde4ade), - C32e(0x06bd6bbd), C32e(0xbb7e2a7e), C32e(0x7b34e534), C32e(0xd73a163a), - C32e(0xd254c554), C32e(0xf862d762), C32e(0x99ff55ff), C32e(0xb6a794a7), - C32e(0xc04acf4a), C32e(0xd9301030), C32e(0x0e0a060a), C32e(0x66988198), - C32e(0xab0bf00b), C32e(0xb4cc44cc), C32e(0xf0d5bad5), C32e(0x753ee33e), - C32e(0xac0ef30e), C32e(0x4419fe19), C32e(0xdb5bc05b), C32e(0x80858a85), - C32e(0xd3ecadec), C32e(0xfedfbcdf), C32e(0xa8d848d8), C32e(0xfd0c040c), - C32e(0x197adf7a), C32e(0x2f58c158), C32e(0x309f759f), C32e(0xe7a563a5), - C32e(0x70503050), C32e(0xcb2e1a2e), C32e(0xef120e12), C32e(0x08b76db7), - C32e(0x55d44cd4), C32e(0x243c143c), C32e(0x795f355f), C32e(0xb2712f71), - C32e(0x8638e138), C32e(0xc8fda2fd), C32e(0xc74fcc4f), C32e(0x654b394b), - C32e(0x6af957f9), C32e(0x580df20d), C32e(0x619d829d), C32e(0xb3c947c9), - C32e(0x27efacef), C32e(0x8832e732), C32e(0x4f7d2b7d), C32e(0x42a495a4), - C32e(0x3bfba0fb), C32e(0xaab398b3), C32e(0xf668d168), C32e(0x22817f81), - C32e(0xeeaa66aa), C32e(0xd6827e82), C32e(0xdde6abe6), C32e(0x959e839e), - C32e(0xc945ca45), C32e(0xbc7b297b), C32e(0x056ed36e), C32e(0x6c443c44), - C32e(0x2c8b798b), C32e(0x813de23d), C32e(0x31271d27), C32e(0x379a769a), - C32e(0x964d3b4d), C32e(0x9efa56fa), C32e(0xa6d24ed2), C32e(0x36221e22), - C32e(0xe476db76), C32e(0x121e0a1e), C32e(0xfcb46cb4), C32e(0x8f37e437), - C32e(0x78e75de7), C32e(0x0fb26eb2), C32e(0x692aef2a), C32e(0x35f1a6f1), - C32e(0xdae3a8e3), C32e(0xc6f7a4f7), C32e(0x8a593759), C32e(0x74868b86), - C32e(0x83563256), C32e(0x4ec543c5), C32e(0x85eb59eb), C32e(0x18c2b7c2), - C32e(0x8e8f8c8f), C32e(0x1dac64ac), C32e(0xf16dd26d), C32e(0x723be03b), - C32e(0x1fc7b4c7), C32e(0xb915fa15), C32e(0xfa090709), C32e(0xa06f256f), - C32e(0x20eaafea), C32e(0x7d898e89), C32e(0x6720e920), C32e(0x38281828), - C32e(0x0b64d564), C32e(0x73838883), C32e(0xfbb16fb1), C32e(0xca967296), - C32e(0x546c246c), C32e(0x5f08f108), C32e(0x2152c752), C32e(0x64f351f3), - C32e(0xae652365), C32e(0x25847c84), C32e(0x57bf9cbf), C32e(0x5d632163), - C32e(0xea7cdd7c), C32e(0x1e7fdc7f), C32e(0x9c918691), C32e(0x9b948594), - C32e(0x4bab90ab), C32e(0xbac642c6), C32e(0x2657c457), C32e(0x29e5aae5), - C32e(0xe373d873), C32e(0x090f050f), C32e(0xf4030103), C32e(0x2a361236), - C32e(0x3cfea3fe), C32e(0x8be15fe1), C32e(0xbe10f910), C32e(0x026bd06b), - C32e(0xbfa891a8), C32e(0x71e858e8), C32e(0x53692769), C32e(0xf7d0b9d0), - C32e(0x91483848), C32e(0xde351335), C32e(0xe5ceb3ce), C32e(0x77553355), - C32e(0x04d6bbd6), C32e(0x39907090), C32e(0x87808980), C32e(0xc1f2a7f2), - C32e(0xecc1b6c1), C32e(0x5a662266), C32e(0xb8ad92ad), C32e(0xa9602060), - C32e(0x5cdb49db), C32e(0xb01aff1a), C32e(0xd8887888), C32e(0x2b8e7a8e), - C32e(0x898a8f8a), C32e(0x4a13f813), C32e(0x929b809b), C32e(0x23391739), - C32e(0x1075da75), C32e(0x84533153), C32e(0xd551c651), C32e(0x03d3b8d3), - C32e(0xdc5ec35e), C32e(0xe2cbb0cb), C32e(0xc3997799), C32e(0x2d331133), - C32e(0x3d46cb46), C32e(0xb71ffc1f), C32e(0x0c61d661), C32e(0x624e3a4e) -}; - -#define DECL_STATE_SMALL \ - sph_u32 H[16]; - -#define READ_STATE_SMALL(sc) do { \ - memcpy(H, (sc)->state.narrow, sizeof H); \ - } while (0) - -#define WRITE_STATE_SMALL(sc) do { \ - memcpy((sc)->state.narrow, H, sizeof H); \ - } while (0) - -#define XCAT(x, y) XCAT_(x, y) -#define XCAT_(x, y) x ## y - -#define RSTT(d0, d1, a, b0, b1, b2, b3, b4, b5, b6, b7) do { \ - t[d0] = T0up[B32_0(a[b0])] \ - ^ T1up[B32_1(a[b1])] \ - ^ T2up[B32_2(a[b2])] \ - ^ T3up[B32_3(a[b3])] \ - ^ T0dn[B32_0(a[b4])] \ - ^ T1dn[B32_1(a[b5])] \ - ^ T2dn[B32_2(a[b6])] \ - ^ T3dn[B32_3(a[b7])]; \ - t[d1] = T0dn[B32_0(a[b0])] \ - ^ T1dn[B32_1(a[b1])] \ - ^ T2dn[B32_2(a[b2])] \ - ^ T3dn[B32_3(a[b3])] \ - ^ T0up[B32_0(a[b4])] \ - ^ T1up[B32_1(a[b5])] \ - ^ T2up[B32_2(a[b6])] \ - ^ T3up[B32_3(a[b7])]; \ - } while (0) - -#define ROUND_SMALL_P(a, r) do { \ - sph_u32 t[16]; \ - a[0x0] ^= PC32up(0x00, r); \ - a[0x1] ^= PC32dn(0x00, r); \ - a[0x2] ^= PC32up(0x10, r); \ - a[0x3] ^= PC32dn(0x10, r); \ - a[0x4] ^= PC32up(0x20, r); \ - a[0x5] ^= PC32dn(0x20, r); \ - a[0x6] ^= PC32up(0x30, r); \ - a[0x7] ^= PC32dn(0x30, r); \ - a[0x8] ^= PC32up(0x40, r); \ - a[0x9] ^= PC32dn(0x40, r); \ - a[0xA] ^= PC32up(0x50, r); \ - a[0xB] ^= PC32dn(0x50, r); \ - a[0xC] ^= PC32up(0x60, r); \ - a[0xD] ^= PC32dn(0x60, r); \ - a[0xE] ^= PC32up(0x70, r); \ - a[0xF] ^= PC32dn(0x70, r); \ - RSTT(0x0, 0x1, a, 0x0, 0x2, 0x4, 0x6, 0x9, 0xB, 0xD, 0xF); \ - RSTT(0x2, 0x3, a, 0x2, 0x4, 0x6, 0x8, 0xB, 0xD, 0xF, 0x1); \ - RSTT(0x4, 0x5, a, 0x4, 0x6, 0x8, 0xA, 0xD, 0xF, 0x1, 0x3); \ - RSTT(0x6, 0x7, a, 0x6, 0x8, 0xA, 0xC, 0xF, 0x1, 0x3, 0x5); \ - RSTT(0x8, 0x9, a, 0x8, 0xA, 0xC, 0xE, 0x1, 0x3, 0x5, 0x7); \ - RSTT(0xA, 0xB, a, 0xA, 0xC, 0xE, 0x0, 0x3, 0x5, 0x7, 0x9); \ - RSTT(0xC, 0xD, a, 0xC, 0xE, 0x0, 0x2, 0x5, 0x7, 0x9, 0xB); \ - RSTT(0xE, 0xF, a, 0xE, 0x0, 0x2, 0x4, 0x7, 0x9, 0xB, 0xD); \ - memcpy(a, t, sizeof t); \ - } while (0) - -#define ROUND_SMALL_Q(a, r) do { \ - sph_u32 t[16]; \ - a[0x0] ^= QC32up(0x00, r); \ - a[0x1] ^= QC32dn(0x00, r); \ - a[0x2] ^= QC32up(0x10, r); \ - a[0x3] ^= QC32dn(0x10, r); \ - a[0x4] ^= QC32up(0x20, r); \ - a[0x5] ^= QC32dn(0x20, r); \ - a[0x6] ^= QC32up(0x30, r); \ - a[0x7] ^= QC32dn(0x30, r); \ - a[0x8] ^= QC32up(0x40, r); \ - a[0x9] ^= QC32dn(0x40, r); \ - a[0xA] ^= QC32up(0x50, r); \ - a[0xB] ^= QC32dn(0x50, r); \ - a[0xC] ^= QC32up(0x60, r); \ - a[0xD] ^= QC32dn(0x60, r); \ - a[0xE] ^= QC32up(0x70, r); \ - a[0xF] ^= QC32dn(0x70, r); \ - RSTT(0x0, 0x1, a, 0x2, 0x6, 0xA, 0xE, 0x1, 0x5, 0x9, 0xD); \ - RSTT(0x2, 0x3, a, 0x4, 0x8, 0xC, 0x0, 0x3, 0x7, 0xB, 0xF); \ - RSTT(0x4, 0x5, a, 0x6, 0xA, 0xE, 0x2, 0x5, 0x9, 0xD, 0x1); \ - RSTT(0x6, 0x7, a, 0x8, 0xC, 0x0, 0x4, 0x7, 0xB, 0xF, 0x3); \ - RSTT(0x8, 0x9, a, 0xA, 0xE, 0x2, 0x6, 0x9, 0xD, 0x1, 0x5); \ - RSTT(0xA, 0xB, a, 0xC, 0x0, 0x4, 0x8, 0xB, 0xF, 0x3, 0x7); \ - RSTT(0xC, 0xD, a, 0xE, 0x2, 0x6, 0xA, 0xD, 0x1, 0x5, 0x9); \ - RSTT(0xE, 0xF, a, 0x0, 0x4, 0x8, 0xC, 0xF, 0x3, 0x7, 0xB); \ - memcpy(a, t, sizeof t); \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_GROESTL - -#define PERM_SMALL_P(a) do { \ - int r; \ - for (r = 0; r < 10; r ++) \ - ROUND_SMALL_P(a, r); \ - } while (0) - -#define PERM_SMALL_Q(a) do { \ - int r; \ - for (r = 0; r < 10; r ++) \ - ROUND_SMALL_Q(a, r); \ - } while (0) - -#else - -#define PERM_SMALL_P(a) do { \ - int r; \ - for (r = 0; r < 10; r += 2) { \ - ROUND_SMALL_P(a, r + 0); \ - ROUND_SMALL_P(a, r + 1); \ - } \ - } while (0) - -#define PERM_SMALL_Q(a) do { \ - int r; \ - for (r = 0; r < 10; r += 2) { \ - ROUND_SMALL_Q(a, r + 0); \ - ROUND_SMALL_Q(a, r + 1); \ - } \ - } while (0) - -#endif - -#define COMPRESS_SMALL do { \ - sph_u32 g[16], m[16]; \ - size_t u; \ - for (u = 0; u < 16; u ++) { \ - m[u] = dec32e_aligned(buf + (u << 2)); \ - g[u] = m[u] ^ H[u]; \ - } \ - PERM_SMALL_P(g); \ - PERM_SMALL_Q(m); \ - for (u = 0; u < 16; u ++) \ - H[u] ^= g[u] ^ m[u]; \ - } while (0) - -#define FINAL_SMALL do { \ - sph_u32 x[16]; \ - size_t u; \ - memcpy(x, H, sizeof x); \ - PERM_SMALL_P(x); \ - for (u = 0; u < 16; u ++) \ - H[u] ^= x[u]; \ - } while (0) - -#define DECL_STATE_BIG \ - sph_u32 H[32]; - -#define READ_STATE_BIG(sc) do { \ - memcpy(H, (sc)->state.narrow, sizeof H); \ - } while (0) - -#define WRITE_STATE_BIG(sc) do { \ - memcpy((sc)->state.narrow, H, sizeof H); \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_GROESTL - -#define RBTT(d0, d1, a, b0, b1, b2, b3, b4, b5, b6, b7) do { \ - sph_u32 fu2 = T0up[B32_2(a[b2])]; \ - sph_u32 fd2 = T0dn[B32_2(a[b2])]; \ - sph_u32 fu3 = T1up[B32_3(a[b3])]; \ - sph_u32 fd3 = T1dn[B32_3(a[b3])]; \ - sph_u32 fu6 = T0up[B32_2(a[b6])]; \ - sph_u32 fd6 = T0dn[B32_2(a[b6])]; \ - sph_u32 fu7 = T1up[B32_3(a[b7])]; \ - sph_u32 fd7 = T1dn[B32_3(a[b7])]; \ - t[d0] = T0up[B32_0(a[b0])] \ - ^ T1up[B32_1(a[b1])] \ - ^ R32u(fu2, fd2) \ - ^ R32u(fu3, fd3) \ - ^ T0dn[B32_0(a[b4])] \ - ^ T1dn[B32_1(a[b5])] \ - ^ R32d(fu6, fd6) \ - ^ R32d(fu7, fd7); \ - t[d1] = T0dn[B32_0(a[b0])] \ - ^ T1dn[B32_1(a[b1])] \ - ^ R32d(fu2, fd2) \ - ^ R32d(fu3, fd3) \ - ^ T0up[B32_0(a[b4])] \ - ^ T1up[B32_1(a[b5])] \ - ^ R32u(fu6, fd6) \ - ^ R32u(fu7, fd7); \ - } while (0) - -#else - -#define RBTT(d0, d1, a, b0, b1, b2, b3, b4, b5, b6, b7) do { \ - t[d0] = T0up[B32_0(a[b0])] \ - ^ T1up[B32_1(a[b1])] \ - ^ T2up[B32_2(a[b2])] \ - ^ T3up[B32_3(a[b3])] \ - ^ T0dn[B32_0(a[b4])] \ - ^ T1dn[B32_1(a[b5])] \ - ^ T2dn[B32_2(a[b6])] \ - ^ T3dn[B32_3(a[b7])]; \ - t[d1] = T0dn[B32_0(a[b0])] \ - ^ T1dn[B32_1(a[b1])] \ - ^ T2dn[B32_2(a[b2])] \ - ^ T3dn[B32_3(a[b3])] \ - ^ T0up[B32_0(a[b4])] \ - ^ T1up[B32_1(a[b5])] \ - ^ T2up[B32_2(a[b6])] \ - ^ T3up[B32_3(a[b7])]; \ - } while (0) - -#endif - -#if SPH_SMALL_FOOTPRINT_GROESTL - -#define ROUND_BIG_P(a, r) do { \ - sph_u32 t[32]; \ - size_t u; \ - a[0x00] ^= PC32up(0x00, r); \ - a[0x01] ^= PC32dn(0x00, r); \ - a[0x02] ^= PC32up(0x10, r); \ - a[0x03] ^= PC32dn(0x10, r); \ - a[0x04] ^= PC32up(0x20, r); \ - a[0x05] ^= PC32dn(0x20, r); \ - a[0x06] ^= PC32up(0x30, r); \ - a[0x07] ^= PC32dn(0x30, r); \ - a[0x08] ^= PC32up(0x40, r); \ - a[0x09] ^= PC32dn(0x40, r); \ - a[0x0A] ^= PC32up(0x50, r); \ - a[0x0B] ^= PC32dn(0x50, r); \ - a[0x0C] ^= PC32up(0x60, r); \ - a[0x0D] ^= PC32dn(0x60, r); \ - a[0x0E] ^= PC32up(0x70, r); \ - a[0x0F] ^= PC32dn(0x70, r); \ - a[0x10] ^= PC32up(0x80, r); \ - a[0x11] ^= PC32dn(0x80, r); \ - a[0x12] ^= PC32up(0x90, r); \ - a[0x13] ^= PC32dn(0x90, r); \ - a[0x14] ^= PC32up(0xA0, r); \ - a[0x15] ^= PC32dn(0xA0, r); \ - a[0x16] ^= PC32up(0xB0, r); \ - a[0x17] ^= PC32dn(0xB0, r); \ - a[0x18] ^= PC32up(0xC0, r); \ - a[0x19] ^= PC32dn(0xC0, r); \ - a[0x1A] ^= PC32up(0xD0, r); \ - a[0x1B] ^= PC32dn(0xD0, r); \ - a[0x1C] ^= PC32up(0xE0, r); \ - a[0x1D] ^= PC32dn(0xE0, r); \ - a[0x1E] ^= PC32up(0xF0, r); \ - a[0x1F] ^= PC32dn(0xF0, r); \ - for (u = 0; u < 32; u += 8) { \ - RBTT(u + 0x00, (u + 0x01) & 0x1F, a, \ - u + 0x00, (u + 0x02) & 0x1F, \ - (u + 0x04) & 0x1F, (u + 0x06) & 0x1F, \ - (u + 0x09) & 0x1F, (u + 0x0B) & 0x1F, \ - (u + 0x0D) & 0x1F, (u + 0x17) & 0x1F); \ - RBTT(u + 0x02, (u + 0x03) & 0x1F, a, \ - u + 0x02, (u + 0x04) & 0x1F, \ - (u + 0x06) & 0x1F, (u + 0x08) & 0x1F, \ - (u + 0x0B) & 0x1F, (u + 0x0D) & 0x1F, \ - (u + 0x0F) & 0x1F, (u + 0x19) & 0x1F); \ - RBTT(u + 0x04, (u + 0x05) & 0x1F, a, \ - u + 0x04, (u + 0x06) & 0x1F, \ - (u + 0x08) & 0x1F, (u + 0x0A) & 0x1F, \ - (u + 0x0D) & 0x1F, (u + 0x0F) & 0x1F, \ - (u + 0x11) & 0x1F, (u + 0x1B) & 0x1F); \ - RBTT(u + 0x06, (u + 0x07) & 0x1F, a, \ - u + 0x06, (u + 0x08) & 0x1F, \ - (u + 0x0A) & 0x1F, (u + 0x0C) & 0x1F, \ - (u + 0x0F) & 0x1F, (u + 0x11) & 0x1F, \ - (u + 0x13) & 0x1F, (u + 0x1D) & 0x1F); \ - } \ - memcpy(a, t, sizeof t); \ - } while (0) - -#define ROUND_BIG_Q(a, r) do { \ - sph_u32 t[32]; \ - size_t u; \ - a[0x00] ^= QC32up(0x00, r); \ - a[0x01] ^= QC32dn(0x00, r); \ - a[0x02] ^= QC32up(0x10, r); \ - a[0x03] ^= QC32dn(0x10, r); \ - a[0x04] ^= QC32up(0x20, r); \ - a[0x05] ^= QC32dn(0x20, r); \ - a[0x06] ^= QC32up(0x30, r); \ - a[0x07] ^= QC32dn(0x30, r); \ - a[0x08] ^= QC32up(0x40, r); \ - a[0x09] ^= QC32dn(0x40, r); \ - a[0x0A] ^= QC32up(0x50, r); \ - a[0x0B] ^= QC32dn(0x50, r); \ - a[0x0C] ^= QC32up(0x60, r); \ - a[0x0D] ^= QC32dn(0x60, r); \ - a[0x0E] ^= QC32up(0x70, r); \ - a[0x0F] ^= QC32dn(0x70, r); \ - a[0x10] ^= QC32up(0x80, r); \ - a[0x11] ^= QC32dn(0x80, r); \ - a[0x12] ^= QC32up(0x90, r); \ - a[0x13] ^= QC32dn(0x90, r); \ - a[0x14] ^= QC32up(0xA0, r); \ - a[0x15] ^= QC32dn(0xA0, r); \ - a[0x16] ^= QC32up(0xB0, r); \ - a[0x17] ^= QC32dn(0xB0, r); \ - a[0x18] ^= QC32up(0xC0, r); \ - a[0x19] ^= QC32dn(0xC0, r); \ - a[0x1A] ^= QC32up(0xD0, r); \ - a[0x1B] ^= QC32dn(0xD0, r); \ - a[0x1C] ^= QC32up(0xE0, r); \ - a[0x1D] ^= QC32dn(0xE0, r); \ - a[0x1E] ^= QC32up(0xF0, r); \ - a[0x1F] ^= QC32dn(0xF0, r); \ - for (u = 0; u < 32; u += 8) { \ - RBTT(u + 0x00, (u + 0x01) & 0x1F, a, \ - (u + 0x02) & 0x1F, (u + 0x06) & 0x1F, \ - (u + 0x0A) & 0x1F, (u + 0x16) & 0x1F, \ - (u + 0x01) & 0x1F, (u + 0x05) & 0x1F, \ - (u + 0x09) & 0x1F, (u + 0x0D) & 0x1F); \ - RBTT(u + 0x02, (u + 0x03) & 0x1F, a, \ - (u + 0x04) & 0x1F, (u + 0x08) & 0x1F, \ - (u + 0x0C) & 0x1F, (u + 0x18) & 0x1F, \ - (u + 0x03) & 0x1F, (u + 0x07) & 0x1F, \ - (u + 0x0B) & 0x1F, (u + 0x0F) & 0x1F); \ - RBTT(u + 0x04, (u + 0x05) & 0x1F, a, \ - (u + 0x06) & 0x1F, (u + 0x0A) & 0x1F, \ - (u + 0x0E) & 0x1F, (u + 0x1A) & 0x1F, \ - (u + 0x05) & 0x1F, (u + 0x09) & 0x1F, \ - (u + 0x0D) & 0x1F, (u + 0x11) & 0x1F); \ - RBTT(u + 0x06, (u + 0x07) & 0x1F, a, \ - (u + 0x08) & 0x1F, (u + 0x0C) & 0x1F, \ - (u + 0x10) & 0x1F, (u + 0x1C) & 0x1F, \ - (u + 0x07) & 0x1F, (u + 0x0B) & 0x1F, \ - (u + 0x0F) & 0x1F, (u + 0x13) & 0x1F); \ - } \ - memcpy(a, t, sizeof t); \ - } while (0) - -#else - -#define ROUND_BIG_P(a, r) do { \ - sph_u32 t[32]; \ - a[0x00] ^= PC32up(0x00, r); \ - a[0x01] ^= PC32dn(0x00, r); \ - a[0x02] ^= PC32up(0x10, r); \ - a[0x03] ^= PC32dn(0x10, r); \ - a[0x04] ^= PC32up(0x20, r); \ - a[0x05] ^= PC32dn(0x20, r); \ - a[0x06] ^= PC32up(0x30, r); \ - a[0x07] ^= PC32dn(0x30, r); \ - a[0x08] ^= PC32up(0x40, r); \ - a[0x09] ^= PC32dn(0x40, r); \ - a[0x0A] ^= PC32up(0x50, r); \ - a[0x0B] ^= PC32dn(0x50, r); \ - a[0x0C] ^= PC32up(0x60, r); \ - a[0x0D] ^= PC32dn(0x60, r); \ - a[0x0E] ^= PC32up(0x70, r); \ - a[0x0F] ^= PC32dn(0x70, r); \ - a[0x10] ^= PC32up(0x80, r); \ - a[0x11] ^= PC32dn(0x80, r); \ - a[0x12] ^= PC32up(0x90, r); \ - a[0x13] ^= PC32dn(0x90, r); \ - a[0x14] ^= PC32up(0xA0, r); \ - a[0x15] ^= PC32dn(0xA0, r); \ - a[0x16] ^= PC32up(0xB0, r); \ - a[0x17] ^= PC32dn(0xB0, r); \ - a[0x18] ^= PC32up(0xC0, r); \ - a[0x19] ^= PC32dn(0xC0, r); \ - a[0x1A] ^= PC32up(0xD0, r); \ - a[0x1B] ^= PC32dn(0xD0, r); \ - a[0x1C] ^= PC32up(0xE0, r); \ - a[0x1D] ^= PC32dn(0xE0, r); \ - a[0x1E] ^= PC32up(0xF0, r); \ - a[0x1F] ^= PC32dn(0xF0, r); \ - RBTT(0x00, 0x01, a, \ - 0x00, 0x02, 0x04, 0x06, 0x09, 0x0B, 0x0D, 0x17); \ - RBTT(0x02, 0x03, a, \ - 0x02, 0x04, 0x06, 0x08, 0x0B, 0x0D, 0x0F, 0x19); \ - RBTT(0x04, 0x05, a, \ - 0x04, 0x06, 0x08, 0x0A, 0x0D, 0x0F, 0x11, 0x1B); \ - RBTT(0x06, 0x07, a, \ - 0x06, 0x08, 0x0A, 0x0C, 0x0F, 0x11, 0x13, 0x1D); \ - RBTT(0x08, 0x09, a, \ - 0x08, 0x0A, 0x0C, 0x0E, 0x11, 0x13, 0x15, 0x1F); \ - RBTT(0x0A, 0x0B, a, \ - 0x0A, 0x0C, 0x0E, 0x10, 0x13, 0x15, 0x17, 0x01); \ - RBTT(0x0C, 0x0D, a, \ - 0x0C, 0x0E, 0x10, 0x12, 0x15, 0x17, 0x19, 0x03); \ - RBTT(0x0E, 0x0F, a, \ - 0x0E, 0x10, 0x12, 0x14, 0x17, 0x19, 0x1B, 0x05); \ - RBTT(0x10, 0x11, a, \ - 0x10, 0x12, 0x14, 0x16, 0x19, 0x1B, 0x1D, 0x07); \ - RBTT(0x12, 0x13, a, \ - 0x12, 0x14, 0x16, 0x18, 0x1B, 0x1D, 0x1F, 0x09); \ - RBTT(0x14, 0x15, a, \ - 0x14, 0x16, 0x18, 0x1A, 0x1D, 0x1F, 0x01, 0x0B); \ - RBTT(0x16, 0x17, a, \ - 0x16, 0x18, 0x1A, 0x1C, 0x1F, 0x01, 0x03, 0x0D); \ - RBTT(0x18, 0x19, a, \ - 0x18, 0x1A, 0x1C, 0x1E, 0x01, 0x03, 0x05, 0x0F); \ - RBTT(0x1A, 0x1B, a, \ - 0x1A, 0x1C, 0x1E, 0x00, 0x03, 0x05, 0x07, 0x11); \ - RBTT(0x1C, 0x1D, a, \ - 0x1C, 0x1E, 0x00, 0x02, 0x05, 0x07, 0x09, 0x13); \ - RBTT(0x1E, 0x1F, a, \ - 0x1E, 0x00, 0x02, 0x04, 0x07, 0x09, 0x0B, 0x15); \ - memcpy(a, t, sizeof t); \ - } while (0) - -#define ROUND_BIG_Q(a, r) do { \ - sph_u32 t[32]; \ - a[0x00] ^= QC32up(0x00, r); \ - a[0x01] ^= QC32dn(0x00, r); \ - a[0x02] ^= QC32up(0x10, r); \ - a[0x03] ^= QC32dn(0x10, r); \ - a[0x04] ^= QC32up(0x20, r); \ - a[0x05] ^= QC32dn(0x20, r); \ - a[0x06] ^= QC32up(0x30, r); \ - a[0x07] ^= QC32dn(0x30, r); \ - a[0x08] ^= QC32up(0x40, r); \ - a[0x09] ^= QC32dn(0x40, r); \ - a[0x0A] ^= QC32up(0x50, r); \ - a[0x0B] ^= QC32dn(0x50, r); \ - a[0x0C] ^= QC32up(0x60, r); \ - a[0x0D] ^= QC32dn(0x60, r); \ - a[0x0E] ^= QC32up(0x70, r); \ - a[0x0F] ^= QC32dn(0x70, r); \ - a[0x10] ^= QC32up(0x80, r); \ - a[0x11] ^= QC32dn(0x80, r); \ - a[0x12] ^= QC32up(0x90, r); \ - a[0x13] ^= QC32dn(0x90, r); \ - a[0x14] ^= QC32up(0xA0, r); \ - a[0x15] ^= QC32dn(0xA0, r); \ - a[0x16] ^= QC32up(0xB0, r); \ - a[0x17] ^= QC32dn(0xB0, r); \ - a[0x18] ^= QC32up(0xC0, r); \ - a[0x19] ^= QC32dn(0xC0, r); \ - a[0x1A] ^= QC32up(0xD0, r); \ - a[0x1B] ^= QC32dn(0xD0, r); \ - a[0x1C] ^= QC32up(0xE0, r); \ - a[0x1D] ^= QC32dn(0xE0, r); \ - a[0x1E] ^= QC32up(0xF0, r); \ - a[0x1F] ^= QC32dn(0xF0, r); \ - RBTT(0x00, 0x01, a, \ - 0x02, 0x06, 0x0A, 0x16, 0x01, 0x05, 0x09, 0x0D); \ - RBTT(0x02, 0x03, a, \ - 0x04, 0x08, 0x0C, 0x18, 0x03, 0x07, 0x0B, 0x0F); \ - RBTT(0x04, 0x05, a, \ - 0x06, 0x0A, 0x0E, 0x1A, 0x05, 0x09, 0x0D, 0x11); \ - RBTT(0x06, 0x07, a, \ - 0x08, 0x0C, 0x10, 0x1C, 0x07, 0x0B, 0x0F, 0x13); \ - RBTT(0x08, 0x09, a, \ - 0x0A, 0x0E, 0x12, 0x1E, 0x09, 0x0D, 0x11, 0x15); \ - RBTT(0x0A, 0x0B, a, \ - 0x0C, 0x10, 0x14, 0x00, 0x0B, 0x0F, 0x13, 0x17); \ - RBTT(0x0C, 0x0D, a, \ - 0x0E, 0x12, 0x16, 0x02, 0x0D, 0x11, 0x15, 0x19); \ - RBTT(0x0E, 0x0F, a, \ - 0x10, 0x14, 0x18, 0x04, 0x0F, 0x13, 0x17, 0x1B); \ - RBTT(0x10, 0x11, a, \ - 0x12, 0x16, 0x1A, 0x06, 0x11, 0x15, 0x19, 0x1D); \ - RBTT(0x12, 0x13, a, \ - 0x14, 0x18, 0x1C, 0x08, 0x13, 0x17, 0x1B, 0x1F); \ - RBTT(0x14, 0x15, a, \ - 0x16, 0x1A, 0x1E, 0x0A, 0x15, 0x19, 0x1D, 0x01); \ - RBTT(0x16, 0x17, a, \ - 0x18, 0x1C, 0x00, 0x0C, 0x17, 0x1B, 0x1F, 0x03); \ - RBTT(0x18, 0x19, a, \ - 0x1A, 0x1E, 0x02, 0x0E, 0x19, 0x1D, 0x01, 0x05); \ - RBTT(0x1A, 0x1B, a, \ - 0x1C, 0x00, 0x04, 0x10, 0x1B, 0x1F, 0x03, 0x07); \ - RBTT(0x1C, 0x1D, a, \ - 0x1E, 0x02, 0x06, 0x12, 0x1D, 0x01, 0x05, 0x09); \ - RBTT(0x1E, 0x1F, a, \ - 0x00, 0x04, 0x08, 0x14, 0x1F, 0x03, 0x07, 0x0B); \ - memcpy(a, t, sizeof t); \ - } while (0) - -#endif - -#if SPH_SMALL_FOOTPRINT_GROESTL - -#define PERM_BIG_P(a) do { \ - int r; \ - for (r = 0; r < 14; r ++) \ - ROUND_BIG_P(a, r); \ - } while (0) - -#define PERM_BIG_Q(a) do { \ - int r; \ - for (r = 0; r < 14; r ++) \ - ROUND_BIG_Q(a, r); \ - } while (0) - -#else - -#define PERM_BIG_P(a) do { \ - int r; \ - for (r = 0; r < 14; r += 2) { \ - ROUND_BIG_P(a, r + 0); \ - ROUND_BIG_P(a, r + 1); \ - } \ - } while (0) - -#define PERM_BIG_Q(a) do { \ - int r; \ - for (r = 0; r < 14; r += 2) { \ - ROUND_BIG_Q(a, r + 0); \ - ROUND_BIG_Q(a, r + 1); \ - } \ - } while (0) - -#endif - -#define COMPRESS_BIG do { \ - sph_u32 g[32], m[32]; \ - size_t u; \ - for (u = 0; u < 32; u ++) { \ - m[u] = dec32e_aligned(buf + (u << 2)); \ - g[u] = m[u] ^ H[u]; \ - } \ - PERM_BIG_P(g); \ - PERM_BIG_Q(m); \ - for (u = 0; u < 32; u ++) \ - H[u] ^= g[u] ^ m[u]; \ - } while (0) - -#define FINAL_BIG do { \ - sph_u32 x[32]; \ - size_t u; \ - memcpy(x, H, sizeof x); \ - PERM_BIG_P(x); \ - for (u = 0; u < 32; u ++) \ - H[u] ^= x[u]; \ - } while (0) - -#endif - -static void -groestl_small_init(sph_groestl_small_context *sc, unsigned out_size) -{ - size_t u; - - sc->ptr = 0; -#if SPH_GROESTL_64 - for (u = 0; u < 7; u ++) - sc->state.wide[u] = 0; -#if USE_LE - sc->state.wide[7] = ((sph_u64)(out_size & 0xFF) << 56) - | ((sph_u64)(out_size & 0xFF00) << 40); -#else - sc->state.wide[7] = (sph_u64)out_size; -#endif -#else - for (u = 0; u < 15; u ++) - sc->state.narrow[u] = 0; -#if USE_LE - sc->state.narrow[15] = ((sph_u32)(out_size & 0xFF) << 24) - | ((sph_u32)(out_size & 0xFF00) << 8); -#else - sc->state.narrow[15] = (sph_u32)out_size; -#endif -#endif -#if SPH_64 - sc->count = 0; -#else - sc->count_high = 0; - sc->count_low = 0; -#endif -} - -static void -groestl_small_core(sph_groestl_small_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - DECL_STATE_SMALL - - buf = sc->buf; - ptr = sc->ptr; - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - READ_STATE_SMALL(sc); - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data = (const unsigned char *)data + clen; - len -= clen; - if (ptr == sizeof sc->buf) { - COMPRESS_SMALL; -#if SPH_64 - sc->count ++; -#else - if ((sc->count_low = SPH_T32(sc->count_low + 1)) == 0) - sc->count_high = SPH_T32(sc->count_high + 1); -#endif - ptr = 0; - } - } - WRITE_STATE_SMALL(sc); - sc->ptr = ptr; -} - -static void -groestl_small_close(sph_groestl_small_context *sc, - unsigned ub, unsigned n, void *dst, size_t out_len) -{ - unsigned char *buf; - unsigned char pad[72]; - size_t u, ptr, pad_len; -#if SPH_64 - sph_u64 count; -#else - sph_u32 count_high, count_low; -#endif - unsigned z; - DECL_STATE_SMALL - - buf = sc->buf; - ptr = sc->ptr; - z = 0x80 >> n; - pad[0] = ((ub & -z) | z) & 0xFF; - if (ptr < 56) { - pad_len = 64 - ptr; -#if SPH_64 - count = SPH_T64(sc->count + 1); -#else - count_low = SPH_T32(sc->count_low + 1); - count_high = SPH_T32(sc->count_high); - if (count_low == 0) - count_high = SPH_T32(count_high + 1); -#endif - } else { - pad_len = 128 - ptr; -#if SPH_64 - count = SPH_T64(sc->count + 2); -#else - count_low = SPH_T32(sc->count_low + 2); - count_high = SPH_T32(sc->count_high); - if (count_low <= 1) - count_high = SPH_T32(count_high + 1); -#endif - } - memset(pad + 1, 0, pad_len - 9); -#if SPH_64 - sph_enc64be(pad + pad_len - 8, count); -#else - sph_enc64be(pad + pad_len - 8, count_high); - sph_enc64be(pad + pad_len - 4, count_low); -#endif - groestl_small_core(sc, pad, pad_len); - READ_STATE_SMALL(sc); - FINAL_SMALL; -#if SPH_GROESTL_64 - for (u = 0; u < 4; u ++) - enc64e(pad + (u << 3), H[u + 4]); -#else - for (u = 0; u < 8; u ++) - enc32e(pad + (u << 2), H[u + 8]); -#endif - memcpy(dst, pad + 32 - out_len, out_len); - groestl_small_init(sc, (unsigned)out_len << 3); -} - -static void -groestl_big_init(sph_groestl_big_context *sc, unsigned out_size) -{ - size_t u; - - sc->ptr = 0; -#if SPH_GROESTL_64 - for (u = 0; u < 15; u ++) - sc->state.wide[u] = 0; -#if USE_LE - sc->state.wide[15] = ((sph_u64)(out_size & 0xFF) << 56) - | ((sph_u64)(out_size & 0xFF00) << 40); -#else - sc->state.wide[15] = (sph_u64)out_size; -#endif -#else - for (u = 0; u < 31; u ++) - sc->state.narrow[u] = 0; -#if USE_LE - sc->state.narrow[31] = ((sph_u32)(out_size & 0xFF) << 24) - | ((sph_u32)(out_size & 0xFF00) << 8); -#else - sc->state.narrow[31] = (sph_u32)out_size; -#endif -#endif -#if SPH_64 - sc->count = 0; -#else - sc->count_high = 0; - sc->count_low = 0; -#endif -} - -static void -groestl_big_core(sph_groestl_big_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - DECL_STATE_BIG - - buf = sc->buf; - ptr = sc->ptr; - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - READ_STATE_BIG(sc); - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data = (const unsigned char *)data + clen; - len -= clen; - if (ptr == sizeof sc->buf) { - COMPRESS_BIG; -#if SPH_64 - sc->count ++; -#else - if ((sc->count_low = SPH_T32(sc->count_low + 1)) == 0) - sc->count_high = SPH_T32(sc->count_high + 1); -#endif - ptr = 0; - } - } - WRITE_STATE_BIG(sc); - sc->ptr = ptr; -} - -static void -groestl_big_close(sph_groestl_big_context *sc, - unsigned ub, unsigned n, void *dst, size_t out_len) -{ - unsigned char *buf; - unsigned char pad[136]; - size_t ptr, pad_len, u; -#if SPH_64 - sph_u64 count; -#else - sph_u32 count_high, count_low; -#endif - unsigned z; - DECL_STATE_BIG - - buf = sc->buf; - ptr = sc->ptr; - z = 0x80 >> n; - pad[0] = ((ub & -z) | z) & 0xFF; - if (ptr < 120) { - pad_len = 128 - ptr; -#if SPH_64 - count = SPH_T64(sc->count + 1); -#else - count_low = SPH_T32(sc->count_low + 1); - count_high = SPH_T32(sc->count_high); - if (count_low == 0) - count_high = SPH_T32(count_high + 1); -#endif - } else { - pad_len = 256 - ptr; -#if SPH_64 - count = SPH_T64(sc->count + 2); -#else - count_low = SPH_T32(sc->count_low + 2); - count_high = SPH_T32(sc->count_high); - if (count_low <= 1) - count_high = SPH_T32(count_high + 1); -#endif - } - memset(pad + 1, 0, pad_len - 9); - //fprintf(stderr, "%x\n", pad_len); -#if SPH_64 - sph_enc64be(pad + pad_len - 8, count); -#else - sph_enc64be(pad + pad_len - 8, count_high); - sph_enc64be(pad + pad_len - 4, count_low); -#endif - groestl_big_core(sc, pad, pad_len); - READ_STATE_BIG(sc); - FINAL_BIG; -#if SPH_GROESTL_64 - for (u = 0; u < 8; u ++) - enc64e(pad + (u << 3), H[u + 8]); -#else - for (u = 0; u < 16; u ++) - enc32e(pad + (u << 2), H[u + 16]); -#endif - memcpy(dst, pad + 64 - out_len, out_len); - groestl_big_init(sc, (unsigned)out_len << 3); -} - -/* see sph_groestl.h */ -void -sph_groestl224_init(void *cc) -{ - groestl_small_init(cc, 224); -} - -/* see sph_groestl.h */ -void -sph_groestl224(void *cc, const void *data, size_t len) -{ - groestl_small_core(cc, data, len); -} - -/* see sph_groestl.h */ -void -sph_groestl224_close(void *cc, void *dst) -{ - groestl_small_close(cc, 0, 0, dst, 28); -} - -/* see sph_groestl.h */ -void -sph_groestl224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - groestl_small_close(cc, ub, n, dst, 28); -} - -/* see sph_groestl.h */ -void -sph_groestl256_init(void *cc) -{ - groestl_small_init(cc, 256); -} - -/* see sph_groestl.h */ -void -sph_groestl256(void *cc, const void *data, size_t len) -{ - groestl_small_core(cc, data, len); -} - -/* see sph_groestl.h */ -void -sph_groestl256_close(void *cc, void *dst) -{ - groestl_small_close(cc, 0, 0, dst, 32); -} - -/* see sph_groestl.h */ -void -sph_groestl256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - groestl_small_close(cc, ub, n, dst, 32); -} - -/* see sph_groestl.h */ -void -sph_groestl384_init(void *cc) -{ - groestl_big_init(cc, 384); -} - -/* see sph_groestl.h */ -void -sph_groestl384(void *cc, const void *data, size_t len) -{ - groestl_big_core(cc, data, len); -} - -/* see sph_groestl.h */ -void -sph_groestl384_close(void *cc, void *dst) -{ - groestl_big_close(cc, 0, 0, dst, 48); -} - -/* see sph_groestl.h */ -void -sph_groestl384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - groestl_big_close(cc, ub, n, dst, 48); -} - -/* see sph_groestl.h */ -void -sph_groestl512_init(void *cc) -{ - groestl_big_init(cc, 512); -} - -/* see sph_groestl.h */ -void -sph_groestl512(void *cc, const void *data, size_t len) -{ - groestl_big_core(cc, data, len); -} - -/* see sph_groestl.h */ -void -sph_groestl512_close(void *cc, void *dst) -{ - groestl_big_close(cc, 0, 0, dst, 64); -} - -/* see sph_groestl.h */ -void -sph_groestl512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - groestl_big_close(cc, ub, n, dst, 64); -} - -#ifdef __cplusplus -} -#endif diff --git a/sph/hamsi.c b/sph/hamsi.c deleted file mode 100644 index 4fdc3bf7..00000000 --- a/sph/hamsi.c +++ /dev/null @@ -1,867 +0,0 @@ -/* $Id: hamsi.c 251 2010-10-19 14:31:51Z tp $ */ -/* - * Hamsi implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include - -#include "sph_hamsi.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -#if SPH_SMALL_FOOTPRINT && !defined SPH_SMALL_FOOTPRINT_HAMSI -#define SPH_SMALL_FOOTPRINT_HAMSI 1 -#endif - -/* - * The SPH_HAMSI_EXPAND_* define how many input bits we handle in one - * table lookup during message expansion (1 to 8, inclusive). If we note - * w the number of bits per message word (w=32 for Hamsi-224/256, w=64 - * for Hamsi-384/512), r the size of a "row" in 32-bit words (r=8 for - * Hamsi-224/256, r=16 for Hamsi-384/512), and n the expansion level, - * then we will get t tables (where t=ceil(w/n)) of individual size - * 2^n*r*4 (in bytes). The last table may be shorter (e.g. with w=32 and - * n=5, there are 7 tables, but the last one uses only two bits on - * input, not five). - * - * Also, we read t rows of r words from RAM. Words in a given row are - * concatenated in RAM in that order, so most of the cost is about - * reading the first row word; comparatively, cache misses are thus - * less expensive with Hamsi-512 (r=16) than with Hamsi-256 (r=8). - * - * When n=1, tables are "special" in that we omit the first entry of - * each table (which always contains 0), so that total table size is - * halved. - * - * We thus have the following (size1 is the cumulative table size of - * Hamsi-224/256; size2 is for Hamsi-384/512; similarly, t1 and t2 - * are for Hamsi-224/256 and Hamsi-384/512, respectively). - * - * n size1 size2 t1 t2 - * --------------------------------------- - * 1 1024 4096 32 64 - * 2 2048 8192 16 32 - * 3 2688 10880 11 22 - * 4 4096 16384 8 16 - * 5 6272 25600 7 13 - * 6 10368 41984 6 11 - * 7 16896 73856 5 10 - * 8 32768 131072 4 8 - * - * So there is a trade-off: a lower n makes the tables fit better in - * L1 cache, but increases the number of memory accesses. The optimal - * value depends on the amount of available L1 cache and the relative - * impact of a cache miss. - * - * Experimentally, in ideal benchmark conditions (which are not necessarily - * realistic with regards to L1 cache contention), it seems that n=8 is - * the best value on "big" architectures (those with 32 kB or more of L1 - * cache), while n=4 is better on "small" architectures. This was tested - * on an Intel Core2 Q6600 (both 32-bit and 64-bit mode), a PowerPC G3 - * (32 kB L1 cache, hence "big"), and a MIPS-compatible Broadcom BCM3302 - * (8 kB L1 cache). - * - * Note: with n=1, the 32 tables (actually implemented as one big table) - * are read entirely and sequentially, regardless of the input data, - * thus avoiding any data-dependent table access pattern. - */ - -#if !defined SPH_HAMSI_EXPAND_SMALL -#if SPH_SMALL_FOOTPRINT_HAMSI -#define SPH_HAMSI_EXPAND_SMALL 4 -#else -#define SPH_HAMSI_EXPAND_SMALL 8 -#endif -#endif - -#if !defined SPH_HAMSI_EXPAND_BIG -#define SPH_HAMSI_EXPAND_BIG 8 -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -#include "hamsi_helper.c" - -static const sph_u32 IV224[] = { - SPH_C32(0xc3967a67), SPH_C32(0xc3bc6c20), SPH_C32(0x4bc3bcc3), - SPH_C32(0xa7c3bc6b), SPH_C32(0x2c204b61), SPH_C32(0x74686f6c), - SPH_C32(0x69656b65), SPH_C32(0x20556e69) -}; - -/* - * This version is the one used in the Hamsi submission package for - * round 2 of the SHA-3 competition; the UTF-8 encoding is wrong and - * shall soon be corrected in the official Hamsi specification. - * -static const sph_u32 IV224[] = { - SPH_C32(0x3c967a67), SPH_C32(0x3cbc6c20), SPH_C32(0xb4c343c3), - SPH_C32(0xa73cbc6b), SPH_C32(0x2c204b61), SPH_C32(0x74686f6c), - SPH_C32(0x69656b65), SPH_C32(0x20556e69) -}; - */ - -static const sph_u32 IV256[] = { - SPH_C32(0x76657273), SPH_C32(0x69746569), SPH_C32(0x74204c65), - SPH_C32(0x7576656e), SPH_C32(0x2c204465), SPH_C32(0x70617274), - SPH_C32(0x656d656e), SPH_C32(0x7420456c) -}; - -static const sph_u32 IV384[] = { - SPH_C32(0x656b7472), SPH_C32(0x6f746563), SPH_C32(0x686e6965), - SPH_C32(0x6b2c2043), SPH_C32(0x6f6d7075), SPH_C32(0x74657220), - SPH_C32(0x53656375), SPH_C32(0x72697479), SPH_C32(0x20616e64), - SPH_C32(0x20496e64), SPH_C32(0x75737472), SPH_C32(0x69616c20), - SPH_C32(0x43727970), SPH_C32(0x746f6772), SPH_C32(0x61706879), - SPH_C32(0x2c204b61) -}; - -static const sph_u32 IV512[] = { - SPH_C32(0x73746565), SPH_C32(0x6c706172), SPH_C32(0x6b204172), - SPH_C32(0x656e6265), SPH_C32(0x72672031), SPH_C32(0x302c2062), - SPH_C32(0x75732032), SPH_C32(0x3434362c), SPH_C32(0x20422d33), - SPH_C32(0x30303120), SPH_C32(0x4c657576), SPH_C32(0x656e2d48), - SPH_C32(0x65766572), SPH_C32(0x6c65652c), SPH_C32(0x2042656c), - SPH_C32(0x6769756d) -}; - -static const sph_u32 alpha_n[] = { - SPH_C32(0xff00f0f0), SPH_C32(0xccccaaaa), SPH_C32(0xf0f0cccc), - SPH_C32(0xff00aaaa), SPH_C32(0xccccaaaa), SPH_C32(0xf0f0ff00), - SPH_C32(0xaaaacccc), SPH_C32(0xf0f0ff00), SPH_C32(0xf0f0cccc), - SPH_C32(0xaaaaff00), SPH_C32(0xccccff00), SPH_C32(0xaaaaf0f0), - SPH_C32(0xaaaaf0f0), SPH_C32(0xff00cccc), SPH_C32(0xccccf0f0), - SPH_C32(0xff00aaaa), SPH_C32(0xccccaaaa), SPH_C32(0xff00f0f0), - SPH_C32(0xff00aaaa), SPH_C32(0xf0f0cccc), SPH_C32(0xf0f0ff00), - SPH_C32(0xccccaaaa), SPH_C32(0xf0f0ff00), SPH_C32(0xaaaacccc), - SPH_C32(0xaaaaff00), SPH_C32(0xf0f0cccc), SPH_C32(0xaaaaf0f0), - SPH_C32(0xccccff00), SPH_C32(0xff00cccc), SPH_C32(0xaaaaf0f0), - SPH_C32(0xff00aaaa), SPH_C32(0xccccf0f0) -}; - -static const sph_u32 alpha_f[] = { - SPH_C32(0xcaf9639c), SPH_C32(0x0ff0f9c0), SPH_C32(0x639c0ff0), - SPH_C32(0xcaf9f9c0), SPH_C32(0x0ff0f9c0), SPH_C32(0x639ccaf9), - SPH_C32(0xf9c00ff0), SPH_C32(0x639ccaf9), SPH_C32(0x639c0ff0), - SPH_C32(0xf9c0caf9), SPH_C32(0x0ff0caf9), SPH_C32(0xf9c0639c), - SPH_C32(0xf9c0639c), SPH_C32(0xcaf90ff0), SPH_C32(0x0ff0639c), - SPH_C32(0xcaf9f9c0), SPH_C32(0x0ff0f9c0), SPH_C32(0xcaf9639c), - SPH_C32(0xcaf9f9c0), SPH_C32(0x639c0ff0), SPH_C32(0x639ccaf9), - SPH_C32(0x0ff0f9c0), SPH_C32(0x639ccaf9), SPH_C32(0xf9c00ff0), - SPH_C32(0xf9c0caf9), SPH_C32(0x639c0ff0), SPH_C32(0xf9c0639c), - SPH_C32(0x0ff0caf9), SPH_C32(0xcaf90ff0), SPH_C32(0xf9c0639c), - SPH_C32(0xcaf9f9c0), SPH_C32(0x0ff0639c) -}; - -#define DECL_STATE_SMALL \ - sph_u32 c0, c1, c2, c3, c4, c5, c6, c7; - -#define READ_STATE_SMALL(sc) do { \ - c0 = sc->h[0x0]; \ - c1 = sc->h[0x1]; \ - c2 = sc->h[0x2]; \ - c3 = sc->h[0x3]; \ - c4 = sc->h[0x4]; \ - c5 = sc->h[0x5]; \ - c6 = sc->h[0x6]; \ - c7 = sc->h[0x7]; \ - } while (0) - -#define WRITE_STATE_SMALL(sc) do { \ - sc->h[0x0] = c0; \ - sc->h[0x1] = c1; \ - sc->h[0x2] = c2; \ - sc->h[0x3] = c3; \ - sc->h[0x4] = c4; \ - sc->h[0x5] = c5; \ - sc->h[0x6] = c6; \ - sc->h[0x7] = c7; \ - } while (0) - -#define s0 m0 -#define s1 m1 -#define s2 c0 -#define s3 c1 -#define s4 c2 -#define s5 c3 -#define s6 m2 -#define s7 m3 -#define s8 m4 -#define s9 m5 -#define sA c4 -#define sB c5 -#define sC c6 -#define sD c7 -#define sE m6 -#define sF m7 - -#define SBOX(a, b, c, d) do { \ - sph_u32 t; \ - t = (a); \ - (a) &= (c); \ - (a) ^= (d); \ - (c) ^= (b); \ - (c) ^= (a); \ - (d) |= t; \ - (d) ^= (b); \ - t ^= (c); \ - (b) = (d); \ - (d) |= t; \ - (d) ^= (a); \ - (a) &= (b); \ - t ^= (a); \ - (b) ^= (d); \ - (b) ^= t; \ - (a) = (c); \ - (c) = (b); \ - (b) = (d); \ - (d) = SPH_T32(~t); \ - } while (0) - -#define L(a, b, c, d) do { \ - (a) = SPH_ROTL32(a, 13); \ - (c) = SPH_ROTL32(c, 3); \ - (b) ^= (a) ^ (c); \ - (d) ^= (c) ^ SPH_T32((a) << 3); \ - (b) = SPH_ROTL32(b, 1); \ - (d) = SPH_ROTL32(d, 7); \ - (a) ^= (b) ^ (d); \ - (c) ^= (d) ^ SPH_T32((b) << 7); \ - (a) = SPH_ROTL32(a, 5); \ - (c) = SPH_ROTL32(c, 22); \ - } while (0) - -#define ROUND_SMALL(rc, alpha) do { \ - s0 ^= alpha[0x00]; \ - s1 ^= alpha[0x01] ^ (sph_u32)(rc); \ - s2 ^= alpha[0x02]; \ - s3 ^= alpha[0x03]; \ - s4 ^= alpha[0x08]; \ - s5 ^= alpha[0x09]; \ - s6 ^= alpha[0x0A]; \ - s7 ^= alpha[0x0B]; \ - s8 ^= alpha[0x10]; \ - s9 ^= alpha[0x11]; \ - sA ^= alpha[0x12]; \ - sB ^= alpha[0x13]; \ - sC ^= alpha[0x18]; \ - sD ^= alpha[0x19]; \ - sE ^= alpha[0x1A]; \ - sF ^= alpha[0x1B]; \ - SBOX(s0, s4, s8, sC); \ - SBOX(s1, s5, s9, sD); \ - SBOX(s2, s6, sA, sE); \ - SBOX(s3, s7, sB, sF); \ - L(s0, s5, sA, sF); \ - L(s1, s6, sB, sC); \ - L(s2, s7, s8, sD); \ - L(s3, s4, s9, sE); \ - } while (0) - -#define P_SMALL do { \ - ROUND_SMALL(0, alpha_n); \ - ROUND_SMALL(1, alpha_n); \ - ROUND_SMALL(2, alpha_n); \ - } while (0) - -#define PF_SMALL do { \ - ROUND_SMALL(0, alpha_f); \ - ROUND_SMALL(1, alpha_f); \ - ROUND_SMALL(2, alpha_f); \ - ROUND_SMALL(3, alpha_f); \ - ROUND_SMALL(4, alpha_f); \ - ROUND_SMALL(5, alpha_f); \ - } while (0) - -#define T_SMALL do { \ - /* order is important */ \ - c7 = (sc->h[7] ^= sB); \ - c6 = (sc->h[6] ^= sA); \ - c5 = (sc->h[5] ^= s9); \ - c4 = (sc->h[4] ^= s8); \ - c3 = (sc->h[3] ^= s3); \ - c2 = (sc->h[2] ^= s2); \ - c1 = (sc->h[1] ^= s1); \ - c0 = (sc->h[0] ^= s0); \ - } while (0) - -static void -hamsi_small(sph_hamsi_small_context *sc, const unsigned char *buf, size_t num) -{ - DECL_STATE_SMALL -#if !SPH_64 - sph_u32 tmp; -#endif - -#if SPH_64 - sc->count += (sph_u64)num << 5; -#else - tmp = SPH_T32((sph_u32)num << 5); - sc->count_low = SPH_T32(sc->count_low + tmp); - sc->count_high += (sph_u32)((num >> 13) >> 14); - if (sc->count_low < tmp) - sc->count_high ++; -#endif - READ_STATE_SMALL(sc); - while (num -- > 0) { - sph_u32 m0, m1, m2, m3, m4, m5, m6, m7; - - INPUT_SMALL; - P_SMALL; - T_SMALL; - buf += 4; - } - WRITE_STATE_SMALL(sc); -} - -static void -hamsi_small_final(sph_hamsi_small_context *sc, const unsigned char *buf) -{ - sph_u32 m0, m1, m2, m3, m4, m5, m6, m7; - DECL_STATE_SMALL - - READ_STATE_SMALL(sc); - INPUT_SMALL; - PF_SMALL; - T_SMALL; - WRITE_STATE_SMALL(sc); -} - -static void -hamsi_small_init(sph_hamsi_small_context *sc, const sph_u32 *iv) -{ - sc->partial_len = 0; - memcpy(sc->h, iv, sizeof sc->h); -#if SPH_64 - sc->count = 0; -#else - sc->count_high = sc->count_low = 0; -#endif -} - -static void -hamsi_small_core(sph_hamsi_small_context *sc, const void *data, size_t len) -{ - if (sc->partial_len != 0) { - size_t mlen; - - mlen = 4 - sc->partial_len; - if (len < mlen) { - memcpy(sc->partial + sc->partial_len, data, len); - sc->partial_len += len; - return; - } else { - memcpy(sc->partial + sc->partial_len, data, mlen); - len -= mlen; - data = (const unsigned char *)data + mlen; - hamsi_small(sc, sc->partial, 1); - sc->partial_len = 0; - } - } - - hamsi_small(sc, data, (len >> 2)); - data = (const unsigned char *)data + (len & ~(size_t)3); - len &= (size_t)3; - memcpy(sc->partial, data, len); - sc->partial_len = len; -} - -static void -hamsi_small_close(sph_hamsi_small_context *sc, - unsigned ub, unsigned n, void *dst, size_t out_size_w32) -{ - unsigned char pad[12]; - size_t ptr, u; - unsigned z; - unsigned char *out; - - ptr = sc->partial_len; - memcpy(pad, sc->partial, ptr); -#if SPH_64 - sph_enc64be(pad + 4, sc->count + (ptr << 3) + n); -#else - sph_enc32be(pad + 4, sc->count_high); - sph_enc32be(pad + 8, sc->count_low + (ptr << 3) + n); -#endif - z = 0x80 >> n; - pad[ptr ++] = ((ub & -z) | z) & 0xFF; - while (ptr < 4) - pad[ptr ++] = 0; - hamsi_small(sc, pad, 2); - hamsi_small_final(sc, pad + 8); - out = dst; - for (u = 0; u < out_size_w32; u ++) - sph_enc32be(out + (u << 2), sc->h[u]); -} - -#define DECL_STATE_BIG \ - sph_u32 c0, c1, c2, c3, c4, c5, c6, c7; \ - sph_u32 c8, c9, cA, cB, cC, cD, cE, cF; - -#define READ_STATE_BIG(sc) do { \ - c0 = sc->h[0x0]; \ - c1 = sc->h[0x1]; \ - c2 = sc->h[0x2]; \ - c3 = sc->h[0x3]; \ - c4 = sc->h[0x4]; \ - c5 = sc->h[0x5]; \ - c6 = sc->h[0x6]; \ - c7 = sc->h[0x7]; \ - c8 = sc->h[0x8]; \ - c9 = sc->h[0x9]; \ - cA = sc->h[0xA]; \ - cB = sc->h[0xB]; \ - cC = sc->h[0xC]; \ - cD = sc->h[0xD]; \ - cE = sc->h[0xE]; \ - cF = sc->h[0xF]; \ - } while (0) - -#define WRITE_STATE_BIG(sc) do { \ - sc->h[0x0] = c0; \ - sc->h[0x1] = c1; \ - sc->h[0x2] = c2; \ - sc->h[0x3] = c3; \ - sc->h[0x4] = c4; \ - sc->h[0x5] = c5; \ - sc->h[0x6] = c6; \ - sc->h[0x7] = c7; \ - sc->h[0x8] = c8; \ - sc->h[0x9] = c9; \ - sc->h[0xA] = cA; \ - sc->h[0xB] = cB; \ - sc->h[0xC] = cC; \ - sc->h[0xD] = cD; \ - sc->h[0xE] = cE; \ - sc->h[0xF] = cF; \ - } while (0) - -#define s00 m0 -#define s01 m1 -#define s02 c0 -#define s03 c1 -#define s04 m2 -#define s05 m3 -#define s06 c2 -#define s07 c3 -#define s08 c4 -#define s09 c5 -#define s0A m4 -#define s0B m5 -#define s0C c6 -#define s0D c7 -#define s0E m6 -#define s0F m7 -#define s10 m8 -#define s11 m9 -#define s12 c8 -#define s13 c9 -#define s14 mA -#define s15 mB -#define s16 cA -#define s17 cB -#define s18 cC -#define s19 cD -#define s1A mC -#define s1B mD -#define s1C cE -#define s1D cF -#define s1E mE -#define s1F mF - -#define ROUND_BIG(rc, alpha) do { \ - s00 ^= alpha[0x00]; \ - s01 ^= alpha[0x01] ^ (sph_u32)(rc); \ - s02 ^= alpha[0x02]; \ - s03 ^= alpha[0x03]; \ - s04 ^= alpha[0x04]; \ - s05 ^= alpha[0x05]; \ - s06 ^= alpha[0x06]; \ - s07 ^= alpha[0x07]; \ - s08 ^= alpha[0x08]; \ - s09 ^= alpha[0x09]; \ - s0A ^= alpha[0x0A]; \ - s0B ^= alpha[0x0B]; \ - s0C ^= alpha[0x0C]; \ - s0D ^= alpha[0x0D]; \ - s0E ^= alpha[0x0E]; \ - s0F ^= alpha[0x0F]; \ - s10 ^= alpha[0x10]; \ - s11 ^= alpha[0x11]; \ - s12 ^= alpha[0x12]; \ - s13 ^= alpha[0x13]; \ - s14 ^= alpha[0x14]; \ - s15 ^= alpha[0x15]; \ - s16 ^= alpha[0x16]; \ - s17 ^= alpha[0x17]; \ - s18 ^= alpha[0x18]; \ - s19 ^= alpha[0x19]; \ - s1A ^= alpha[0x1A]; \ - s1B ^= alpha[0x1B]; \ - s1C ^= alpha[0x1C]; \ - s1D ^= alpha[0x1D]; \ - s1E ^= alpha[0x1E]; \ - s1F ^= alpha[0x1F]; \ - SBOX(s00, s08, s10, s18); \ - SBOX(s01, s09, s11, s19); \ - SBOX(s02, s0A, s12, s1A); \ - SBOX(s03, s0B, s13, s1B); \ - SBOX(s04, s0C, s14, s1C); \ - SBOX(s05, s0D, s15, s1D); \ - SBOX(s06, s0E, s16, s1E); \ - SBOX(s07, s0F, s17, s1F); \ - L(s00, s09, s12, s1B); \ - L(s01, s0A, s13, s1C); \ - L(s02, s0B, s14, s1D); \ - L(s03, s0C, s15, s1E); \ - L(s04, s0D, s16, s1F); \ - L(s05, s0E, s17, s18); \ - L(s06, s0F, s10, s19); \ - L(s07, s08, s11, s1A); \ - L(s00, s02, s05, s07); \ - L(s10, s13, s15, s16); \ - L(s09, s0B, s0C, s0E); \ - L(s19, s1A, s1C, s1F); \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_HAMSI - -#define P_BIG do { \ - unsigned r; \ - for (r = 0; r < 6; r ++) \ - ROUND_BIG(r, alpha_n); \ - } while (0) - -#define PF_BIG do { \ - unsigned r; \ - for (r = 0; r < 12; r ++) \ - ROUND_BIG(r, alpha_f); \ - } while (0) - -#else - -#define P_BIG do { \ - ROUND_BIG(0, alpha_n); \ - ROUND_BIG(1, alpha_n); \ - ROUND_BIG(2, alpha_n); \ - ROUND_BIG(3, alpha_n); \ - ROUND_BIG(4, alpha_n); \ - ROUND_BIG(5, alpha_n); \ - } while (0) - -#define PF_BIG do { \ - ROUND_BIG(0, alpha_f); \ - ROUND_BIG(1, alpha_f); \ - ROUND_BIG(2, alpha_f); \ - ROUND_BIG(3, alpha_f); \ - ROUND_BIG(4, alpha_f); \ - ROUND_BIG(5, alpha_f); \ - ROUND_BIG(6, alpha_f); \ - ROUND_BIG(7, alpha_f); \ - ROUND_BIG(8, alpha_f); \ - ROUND_BIG(9, alpha_f); \ - ROUND_BIG(10, alpha_f); \ - ROUND_BIG(11, alpha_f); \ - } while (0) - -#endif - -#define T_BIG do { \ - /* order is important */ \ - cF = (sc->h[0xF] ^= s17); \ - cE = (sc->h[0xE] ^= s16); \ - cD = (sc->h[0xD] ^= s15); \ - cC = (sc->h[0xC] ^= s14); \ - cB = (sc->h[0xB] ^= s13); \ - cA = (sc->h[0xA] ^= s12); \ - c9 = (sc->h[0x9] ^= s11); \ - c8 = (sc->h[0x8] ^= s10); \ - c7 = (sc->h[0x7] ^= s07); \ - c6 = (sc->h[0x6] ^= s06); \ - c5 = (sc->h[0x5] ^= s05); \ - c4 = (sc->h[0x4] ^= s04); \ - c3 = (sc->h[0x3] ^= s03); \ - c2 = (sc->h[0x2] ^= s02); \ - c1 = (sc->h[0x1] ^= s01); \ - c0 = (sc->h[0x0] ^= s00); \ - } while (0) - -static void -hamsi_big(sph_hamsi_big_context *sc, const unsigned char *buf, size_t num) -{ - DECL_STATE_BIG -#if !SPH_64 - sph_u32 tmp; -#endif - -#if SPH_64 - sc->count += (sph_u64)num << 6; -#else - tmp = SPH_T32((sph_u32)num << 6); - sc->count_low = SPH_T32(sc->count_low + tmp); - sc->count_high += (sph_u32)((num >> 13) >> 13); - if (sc->count_low < tmp) - sc->count_high ++; -#endif - READ_STATE_BIG(sc); - while (num -- > 0) { - sph_u32 m0, m1, m2, m3, m4, m5, m6, m7; - sph_u32 m8, m9, mA, mB, mC, mD, mE, mF; - - INPUT_BIG; - P_BIG; - T_BIG; - buf += 8; - } - WRITE_STATE_BIG(sc); -} - -static void -hamsi_big_final(sph_hamsi_big_context *sc, const unsigned char *buf) -{ - sph_u32 m0, m1, m2, m3, m4, m5, m6, m7; - sph_u32 m8, m9, mA, mB, mC, mD, mE, mF; - DECL_STATE_BIG - - READ_STATE_BIG(sc); - INPUT_BIG; - PF_BIG; - T_BIG; - WRITE_STATE_BIG(sc); -} - -static void -hamsi_big_init(sph_hamsi_big_context *sc, const sph_u32 *iv) -{ - sc->partial_len = 0; - memcpy(sc->h, iv, sizeof sc->h); -#if SPH_64 - sc->count = 0; -#else - sc->count_high = sc->count_low = 0; -#endif -} - -static void -hamsi_big_core(sph_hamsi_big_context *sc, const void *data, size_t len) -{ - if (sc->partial_len != 0) { - size_t mlen; - - mlen = 8 - sc->partial_len; - if (len < mlen) { - memcpy(sc->partial + sc->partial_len, data, len); - sc->partial_len += len; - return; - } else { - memcpy(sc->partial + sc->partial_len, data, mlen); - len -= mlen; - data = (const unsigned char *)data + mlen; - hamsi_big(sc, sc->partial, 1); - sc->partial_len = 0; - } - } - - hamsi_big(sc, data, (len >> 3)); - data = (const unsigned char *)data + (len & ~(size_t)7); - len &= (size_t)7; - memcpy(sc->partial, data, len); - sc->partial_len = len; -} - -static void -hamsi_big_close(sph_hamsi_big_context *sc, - unsigned ub, unsigned n, void *dst, size_t out_size_w32) -{ - unsigned char pad[8]; - size_t ptr, u; - unsigned z; - unsigned char *out; - - ptr = sc->partial_len; -#if SPH_64 - sph_enc64be(pad, sc->count + (ptr << 3) + n); -#else - sph_enc32be(pad, sc->count_high); - sph_enc32be(pad + 4, sc->count_low + (ptr << 3) + n); -#endif - z = 0x80 >> n; - sc->partial[ptr ++] = ((ub & -z) | z) & 0xFF; - while (ptr < 8) - sc->partial[ptr ++] = 0; - hamsi_big(sc, sc->partial, 1); - hamsi_big_final(sc, pad); - out = dst; - if (out_size_w32 == 12) { - sph_enc32be(out + 0, sc->h[ 0]); - sph_enc32be(out + 4, sc->h[ 1]); - sph_enc32be(out + 8, sc->h[ 3]); - sph_enc32be(out + 12, sc->h[ 4]); - sph_enc32be(out + 16, sc->h[ 5]); - sph_enc32be(out + 20, sc->h[ 6]); - sph_enc32be(out + 24, sc->h[ 8]); - sph_enc32be(out + 28, sc->h[ 9]); - sph_enc32be(out + 32, sc->h[10]); - sph_enc32be(out + 36, sc->h[12]); - sph_enc32be(out + 40, sc->h[13]); - sph_enc32be(out + 44, sc->h[15]); - } else { - for (u = 0; u < 16; u ++) - sph_enc32be(out + (u << 2), sc->h[u]); - } -} - -/* see sph_hamsi.h */ -void -sph_hamsi224_init(void *cc) -{ - hamsi_small_init(cc, IV224); -} - -/* see sph_hamsi.h */ -void -sph_hamsi224(void *cc, const void *data, size_t len) -{ - hamsi_small_core(cc, data, len); -} - -/* see sph_hamsi.h */ -void -sph_hamsi224_close(void *cc, void *dst) -{ - hamsi_small_close(cc, 0, 0, dst, 7); - hamsi_small_init(cc, IV224); -} - -/* see sph_hamsi.h */ -void -sph_hamsi224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - hamsi_small_close(cc, ub, n, dst, 7); - hamsi_small_init(cc, IV224); -} - -/* see sph_hamsi.h */ -void -sph_hamsi256_init(void *cc) -{ - hamsi_small_init(cc, IV256); -} - -/* see sph_hamsi.h */ -void -sph_hamsi256(void *cc, const void *data, size_t len) -{ - hamsi_small_core(cc, data, len); -} - -/* see sph_hamsi.h */ -void -sph_hamsi256_close(void *cc, void *dst) -{ - hamsi_small_close(cc, 0, 0, dst, 8); - hamsi_small_init(cc, IV256); -} - -/* see sph_hamsi.h */ -void -sph_hamsi256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - hamsi_small_close(cc, ub, n, dst, 8); - hamsi_small_init(cc, IV256); -} - -/* see sph_hamsi.h */ -void -sph_hamsi384_init(void *cc) -{ - hamsi_big_init(cc, IV384); -} - -/* see sph_hamsi.h */ -void -sph_hamsi384(void *cc, const void *data, size_t len) -{ - hamsi_big_core(cc, data, len); -} - -/* see sph_hamsi.h */ -void -sph_hamsi384_close(void *cc, void *dst) -{ - hamsi_big_close(cc, 0, 0, dst, 12); - hamsi_big_init(cc, IV384); -} - -/* see sph_hamsi.h */ -void -sph_hamsi384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - hamsi_big_close(cc, ub, n, dst, 12); - hamsi_big_init(cc, IV384); -} - -/* see sph_hamsi.h */ -void -sph_hamsi512_init(void *cc) -{ - hamsi_big_init(cc, IV512); -} - -/* see sph_hamsi.h */ -void -sph_hamsi512(void *cc, const void *data, size_t len) -{ - hamsi_big_core(cc, data, len); -} - -/* see sph_hamsi.h */ -void -sph_hamsi512_close(void *cc, void *dst) -{ - hamsi_big_close(cc, 0, 0, dst, 16); - hamsi_big_init(cc, IV512); -} - -/* see sph_hamsi.h */ -void -sph_hamsi512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - hamsi_big_close(cc, ub, n, dst, 16); - hamsi_big_init(cc, IV512); -} - -#ifdef __cplusplus -} -#endif diff --git a/sph/hamsi_helper.c b/sph/hamsi_helper.c deleted file mode 100644 index cdf2fc9f..00000000 --- a/sph/hamsi_helper.c +++ /dev/null @@ -1,39648 +0,0 @@ -/* $Id: hamsi_helper.c 202 2010-05-31 15:46:48Z tp $ */ -/* - * Helper code for Hamsi (input block expansion). This code is - * automatically generated and includes precomputed tables for - * expansion code which handles 2 to 8 bits at a time. - * - * This file is included from hamsi.c, and is not meant to be compiled - * independently. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#ifdef __cplusplus -extern "C"{ -#endif - -#if SPH_HAMSI_EXPAND_SMALL == 1 - -/* Note: this table lists bits within each byte from least - siginificant to most significant. */ -static const sph_u32 T256[32][8] = { - { SPH_C32(0x74951000), SPH_C32(0x5a2b467e), SPH_C32(0x88fd1d2b), - SPH_C32(0x1ee68292), SPH_C32(0xcba90000), SPH_C32(0x90273769), - SPH_C32(0xbbdcf407), SPH_C32(0xd0f4af61) }, - { SPH_C32(0xcba90000), SPH_C32(0x90273769), SPH_C32(0xbbdcf407), - SPH_C32(0xd0f4af61), SPH_C32(0xbf3c1000), SPH_C32(0xca0c7117), - SPH_C32(0x3321e92c), SPH_C32(0xce122df3) }, - { SPH_C32(0xe92a2000), SPH_C32(0xb4578cfc), SPH_C32(0x11fa3a57), - SPH_C32(0x3dc90524), SPH_C32(0x97530000), SPH_C32(0x204f6ed3), - SPH_C32(0x77b9e80f), SPH_C32(0xa1ec5ec1) }, - { SPH_C32(0x97530000), SPH_C32(0x204f6ed3), SPH_C32(0x77b9e80f), - SPH_C32(0xa1ec5ec1), SPH_C32(0x7e792000), SPH_C32(0x9418e22f), - SPH_C32(0x6643d258), SPH_C32(0x9c255be5) }, - { SPH_C32(0x121b4000), SPH_C32(0x5b17d9e8), SPH_C32(0x8dfacfab), - SPH_C32(0xce36cc72), SPH_C32(0xe6570000), SPH_C32(0x4bb33a25), - SPH_C32(0x848598ba), SPH_C32(0x1041003e) }, - { SPH_C32(0xe6570000), SPH_C32(0x4bb33a25), SPH_C32(0x848598ba), - SPH_C32(0x1041003e), SPH_C32(0xf44c4000), SPH_C32(0x10a4e3cd), - SPH_C32(0x097f5711), SPH_C32(0xde77cc4c) }, - { SPH_C32(0xe4788000), SPH_C32(0x859673c1), SPH_C32(0xb5fb2452), - SPH_C32(0x29cc5edf), SPH_C32(0x045f0000), SPH_C32(0x9c4a93c9), - SPH_C32(0x62fc79d0), SPH_C32(0x731ebdc2) }, - { SPH_C32(0x045f0000), SPH_C32(0x9c4a93c9), SPH_C32(0x62fc79d0), - SPH_C32(0x731ebdc2), SPH_C32(0xe0278000), SPH_C32(0x19dce008), - SPH_C32(0xd7075d82), SPH_C32(0x5ad2e31d) }, - { SPH_C32(0xb7a40100), SPH_C32(0x8a1f31d8), SPH_C32(0x8589d8ab), - SPH_C32(0xe6c46464), SPH_C32(0x734c0000), SPH_C32(0x956fa7d6), - SPH_C32(0xa29d1297), SPH_C32(0x6ee56854) }, - { SPH_C32(0x734c0000), SPH_C32(0x956fa7d6), SPH_C32(0xa29d1297), - SPH_C32(0x6ee56854), SPH_C32(0xc4e80100), SPH_C32(0x1f70960e), - SPH_C32(0x2714ca3c), SPH_C32(0x88210c30) }, - { SPH_C32(0xa7b80200), SPH_C32(0x1f128433), SPH_C32(0x60e5f9f2), - SPH_C32(0x9e147576), SPH_C32(0xee260000), SPH_C32(0x124b683e), - SPH_C32(0x80c2d68f), SPH_C32(0x3bf3ab2c) }, - { SPH_C32(0xee260000), SPH_C32(0x124b683e), SPH_C32(0x80c2d68f), - SPH_C32(0x3bf3ab2c), SPH_C32(0x499e0200), SPH_C32(0x0d59ec0d), - SPH_C32(0xe0272f7d), SPH_C32(0xa5e7de5a) }, - { SPH_C32(0x8f3e0400), SPH_C32(0x0d9dc877), SPH_C32(0x6fc548e1), - SPH_C32(0x898d2cd6), SPH_C32(0x14bd0000), SPH_C32(0x2fba37ff), - SPH_C32(0x6a72e5bb), SPH_C32(0x247febe6) }, - { SPH_C32(0x14bd0000), SPH_C32(0x2fba37ff), SPH_C32(0x6a72e5bb), - SPH_C32(0x247febe6), SPH_C32(0x9b830400), SPH_C32(0x2227ff88), - SPH_C32(0x05b7ad5a), SPH_C32(0xadf2c730) }, - { SPH_C32(0xde320800), SPH_C32(0x288350fe), SPH_C32(0x71852ac7), - SPH_C32(0xa6bf9f96), SPH_C32(0xe18b0000), SPH_C32(0x5459887d), - SPH_C32(0xbf1283d3), SPH_C32(0x1b666a73) }, - { SPH_C32(0xe18b0000), SPH_C32(0x5459887d), SPH_C32(0xbf1283d3), - SPH_C32(0x1b666a73), SPH_C32(0x3fb90800), SPH_C32(0x7cdad883), - SPH_C32(0xce97a914), SPH_C32(0xbdd9f5e5) }, - { SPH_C32(0x515c0010), SPH_C32(0x40f372fb), SPH_C32(0xfce72602), - SPH_C32(0x71575061), SPH_C32(0x2e390000), SPH_C32(0x64dd6689), - SPH_C32(0x3cd406fc), SPH_C32(0xb1f490bc) }, - { SPH_C32(0x2e390000), SPH_C32(0x64dd6689), SPH_C32(0x3cd406fc), - SPH_C32(0xb1f490bc), SPH_C32(0x7f650010), SPH_C32(0x242e1472), - SPH_C32(0xc03320fe), SPH_C32(0xc0a3c0dd) }, - { SPH_C32(0xa2b80020), SPH_C32(0x81e7e5f6), SPH_C32(0xf9ce4c04), - SPH_C32(0xe2afa0c0), SPH_C32(0x5c720000), SPH_C32(0xc9bacd12), - SPH_C32(0x79a90df9), SPH_C32(0x63e92178) }, - { SPH_C32(0x5c720000), SPH_C32(0xc9bacd12), SPH_C32(0x79a90df9), - SPH_C32(0x63e92178), SPH_C32(0xfeca0020), SPH_C32(0x485d28e4), - SPH_C32(0x806741fd), SPH_C32(0x814681b8) }, - { SPH_C32(0x4dce0040), SPH_C32(0x3b5bec7e), SPH_C32(0x36656ba8), - SPH_C32(0x23633a05), SPH_C32(0x78ab0000), SPH_C32(0xa0cd5a34), - SPH_C32(0x5d5ca0f7), SPH_C32(0x727784cb) }, - { SPH_C32(0x78ab0000), SPH_C32(0xa0cd5a34), SPH_C32(0x5d5ca0f7), - SPH_C32(0x727784cb), SPH_C32(0x35650040), SPH_C32(0x9b96b64a), - SPH_C32(0x6b39cb5f), SPH_C32(0x5114bece) }, - { SPH_C32(0x5bd20080), SPH_C32(0x450f18ec), SPH_C32(0xc2c46c55), - SPH_C32(0xf362b233), SPH_C32(0x39a60000), SPH_C32(0x4ab753eb), - SPH_C32(0xd14e094b), SPH_C32(0xb772b42b) }, - { SPH_C32(0x39a60000), SPH_C32(0x4ab753eb), SPH_C32(0xd14e094b), - SPH_C32(0xb772b42b), SPH_C32(0x62740080), SPH_C32(0x0fb84b07), - SPH_C32(0x138a651e), SPH_C32(0x44100618) }, - { SPH_C32(0xc04e0001), SPH_C32(0x33b9c010), SPH_C32(0xae0ebb05), - SPH_C32(0xb5a4c63b), SPH_C32(0xc8f10000), SPH_C32(0x0b2de782), - SPH_C32(0x6bf648a4), SPH_C32(0x539cbdbf) }, - { SPH_C32(0xc8f10000), SPH_C32(0x0b2de782), SPH_C32(0x6bf648a4), - SPH_C32(0x539cbdbf), SPH_C32(0x08bf0001), SPH_C32(0x38942792), - SPH_C32(0xc5f8f3a1), SPH_C32(0xe6387b84) }, - { SPH_C32(0x88230002), SPH_C32(0x5fe7a7b3), SPH_C32(0x99e585aa), - SPH_C32(0x8d75f7f1), SPH_C32(0x51ac0000), SPH_C32(0x25e30f14), - SPH_C32(0x79e22a4c), SPH_C32(0x1298bd46) }, - { SPH_C32(0x51ac0000), SPH_C32(0x25e30f14), SPH_C32(0x79e22a4c), - SPH_C32(0x1298bd46), SPH_C32(0xd98f0002), SPH_C32(0x7a04a8a7), - SPH_C32(0xe007afe6), SPH_C32(0x9fed4ab7) }, - { SPH_C32(0xd0080004), SPH_C32(0x8c768f77), SPH_C32(0x9dc5b050), - SPH_C32(0xaf4a29da), SPH_C32(0x6ba90000), SPH_C32(0x40ebf9aa), - SPH_C32(0x98321c3d), SPH_C32(0x76acc733) }, - { SPH_C32(0x6ba90000), SPH_C32(0x40ebf9aa), SPH_C32(0x98321c3d), - SPH_C32(0x76acc733), SPH_C32(0xbba10004), SPH_C32(0xcc9d76dd), - SPH_C32(0x05f7ac6d), SPH_C32(0xd9e6eee9) }, - { SPH_C32(0xa8ae0008), SPH_C32(0x2079397d), SPH_C32(0xfe739301), - SPH_C32(0xb8a92831), SPH_C32(0x171c0000), SPH_C32(0xb26e3344), - SPH_C32(0x9e6a837e), SPH_C32(0x58f8485f) }, - { SPH_C32(0x171c0000), SPH_C32(0xb26e3344), SPH_C32(0x9e6a837e), - SPH_C32(0x58f8485f), SPH_C32(0xbfb20008), SPH_C32(0x92170a39), - SPH_C32(0x6019107f), SPH_C32(0xe051606e) } -}; - -#define INPUT_SMALL do { \ - const sph_u32 *tp = &T256[0][0]; \ - unsigned u, v; \ - m0 = 0; \ - m1 = 0; \ - m2 = 0; \ - m3 = 0; \ - m4 = 0; \ - m5 = 0; \ - m6 = 0; \ - m7 = 0; \ - for (u = 0; u < 4; u ++) { \ - unsigned db = buf[u]; \ - for (v = 0; v < 8; v ++, db >>= 1) { \ - sph_u32 dm = SPH_T32(-(sph_u32)(db & 1)); \ - m0 ^= dm & *tp ++; \ - m1 ^= dm & *tp ++; \ - m2 ^= dm & *tp ++; \ - m3 ^= dm & *tp ++; \ - m4 ^= dm & *tp ++; \ - m5 ^= dm & *tp ++; \ - m6 ^= dm & *tp ++; \ - m7 ^= dm & *tp ++; \ - } \ - } \ - } while (0) - -#endif - -#if SPH_HAMSI_EXPAND_SMALL == 2 - -static const sph_u32 T256_0[4][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xe4788000), SPH_C32(0x859673c1), SPH_C32(0xb5fb2452), - SPH_C32(0x29cc5edf), SPH_C32(0x045f0000), SPH_C32(0x9c4a93c9), - SPH_C32(0x62fc79d0), SPH_C32(0x731ebdc2) }, - { SPH_C32(0x045f0000), SPH_C32(0x9c4a93c9), SPH_C32(0x62fc79d0), - SPH_C32(0x731ebdc2), SPH_C32(0xe0278000), SPH_C32(0x19dce008), - SPH_C32(0xd7075d82), SPH_C32(0x5ad2e31d) }, - { SPH_C32(0xe0278000), SPH_C32(0x19dce008), SPH_C32(0xd7075d82), - SPH_C32(0x5ad2e31d), SPH_C32(0xe4788000), SPH_C32(0x859673c1), - SPH_C32(0xb5fb2452), SPH_C32(0x29cc5edf) } -}; - -static const sph_u32 T256_2[4][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x121b4000), SPH_C32(0x5b17d9e8), SPH_C32(0x8dfacfab), - SPH_C32(0xce36cc72), SPH_C32(0xe6570000), SPH_C32(0x4bb33a25), - SPH_C32(0x848598ba), SPH_C32(0x1041003e) }, - { SPH_C32(0xe6570000), SPH_C32(0x4bb33a25), SPH_C32(0x848598ba), - SPH_C32(0x1041003e), SPH_C32(0xf44c4000), SPH_C32(0x10a4e3cd), - SPH_C32(0x097f5711), SPH_C32(0xde77cc4c) }, - { SPH_C32(0xf44c4000), SPH_C32(0x10a4e3cd), SPH_C32(0x097f5711), - SPH_C32(0xde77cc4c), SPH_C32(0x121b4000), SPH_C32(0x5b17d9e8), - SPH_C32(0x8dfacfab), SPH_C32(0xce36cc72) } -}; - -static const sph_u32 T256_4[4][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xe92a2000), SPH_C32(0xb4578cfc), SPH_C32(0x11fa3a57), - SPH_C32(0x3dc90524), SPH_C32(0x97530000), SPH_C32(0x204f6ed3), - SPH_C32(0x77b9e80f), SPH_C32(0xa1ec5ec1) }, - { SPH_C32(0x97530000), SPH_C32(0x204f6ed3), SPH_C32(0x77b9e80f), - SPH_C32(0xa1ec5ec1), SPH_C32(0x7e792000), SPH_C32(0x9418e22f), - SPH_C32(0x6643d258), SPH_C32(0x9c255be5) }, - { SPH_C32(0x7e792000), SPH_C32(0x9418e22f), SPH_C32(0x6643d258), - SPH_C32(0x9c255be5), SPH_C32(0xe92a2000), SPH_C32(0xb4578cfc), - SPH_C32(0x11fa3a57), SPH_C32(0x3dc90524) } -}; - -static const sph_u32 T256_6[4][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x74951000), SPH_C32(0x5a2b467e), SPH_C32(0x88fd1d2b), - SPH_C32(0x1ee68292), SPH_C32(0xcba90000), SPH_C32(0x90273769), - SPH_C32(0xbbdcf407), SPH_C32(0xd0f4af61) }, - { SPH_C32(0xcba90000), SPH_C32(0x90273769), SPH_C32(0xbbdcf407), - SPH_C32(0xd0f4af61), SPH_C32(0xbf3c1000), SPH_C32(0xca0c7117), - SPH_C32(0x3321e92c), SPH_C32(0xce122df3) }, - { SPH_C32(0xbf3c1000), SPH_C32(0xca0c7117), SPH_C32(0x3321e92c), - SPH_C32(0xce122df3), SPH_C32(0x74951000), SPH_C32(0x5a2b467e), - SPH_C32(0x88fd1d2b), SPH_C32(0x1ee68292) } -}; - -static const sph_u32 T256_8[4][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xde320800), SPH_C32(0x288350fe), SPH_C32(0x71852ac7), - SPH_C32(0xa6bf9f96), SPH_C32(0xe18b0000), SPH_C32(0x5459887d), - SPH_C32(0xbf1283d3), SPH_C32(0x1b666a73) }, - { SPH_C32(0xe18b0000), SPH_C32(0x5459887d), SPH_C32(0xbf1283d3), - SPH_C32(0x1b666a73), SPH_C32(0x3fb90800), SPH_C32(0x7cdad883), - SPH_C32(0xce97a914), SPH_C32(0xbdd9f5e5) }, - { SPH_C32(0x3fb90800), SPH_C32(0x7cdad883), SPH_C32(0xce97a914), - SPH_C32(0xbdd9f5e5), SPH_C32(0xde320800), SPH_C32(0x288350fe), - SPH_C32(0x71852ac7), SPH_C32(0xa6bf9f96) } -}; - -static const sph_u32 T256_10[4][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x8f3e0400), SPH_C32(0x0d9dc877), SPH_C32(0x6fc548e1), - SPH_C32(0x898d2cd6), SPH_C32(0x14bd0000), SPH_C32(0x2fba37ff), - SPH_C32(0x6a72e5bb), SPH_C32(0x247febe6) }, - { SPH_C32(0x14bd0000), SPH_C32(0x2fba37ff), SPH_C32(0x6a72e5bb), - SPH_C32(0x247febe6), SPH_C32(0x9b830400), SPH_C32(0x2227ff88), - SPH_C32(0x05b7ad5a), SPH_C32(0xadf2c730) }, - { SPH_C32(0x9b830400), SPH_C32(0x2227ff88), SPH_C32(0x05b7ad5a), - SPH_C32(0xadf2c730), SPH_C32(0x8f3e0400), SPH_C32(0x0d9dc877), - SPH_C32(0x6fc548e1), SPH_C32(0x898d2cd6) } -}; - -static const sph_u32 T256_12[4][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xa7b80200), SPH_C32(0x1f128433), SPH_C32(0x60e5f9f2), - SPH_C32(0x9e147576), SPH_C32(0xee260000), SPH_C32(0x124b683e), - SPH_C32(0x80c2d68f), SPH_C32(0x3bf3ab2c) }, - { SPH_C32(0xee260000), SPH_C32(0x124b683e), SPH_C32(0x80c2d68f), - SPH_C32(0x3bf3ab2c), SPH_C32(0x499e0200), SPH_C32(0x0d59ec0d), - SPH_C32(0xe0272f7d), SPH_C32(0xa5e7de5a) }, - { SPH_C32(0x499e0200), SPH_C32(0x0d59ec0d), SPH_C32(0xe0272f7d), - SPH_C32(0xa5e7de5a), SPH_C32(0xa7b80200), SPH_C32(0x1f128433), - SPH_C32(0x60e5f9f2), SPH_C32(0x9e147576) } -}; - -static const sph_u32 T256_14[4][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xb7a40100), SPH_C32(0x8a1f31d8), SPH_C32(0x8589d8ab), - SPH_C32(0xe6c46464), SPH_C32(0x734c0000), SPH_C32(0x956fa7d6), - SPH_C32(0xa29d1297), SPH_C32(0x6ee56854) }, - { SPH_C32(0x734c0000), SPH_C32(0x956fa7d6), SPH_C32(0xa29d1297), - SPH_C32(0x6ee56854), SPH_C32(0xc4e80100), SPH_C32(0x1f70960e), - SPH_C32(0x2714ca3c), SPH_C32(0x88210c30) }, - { SPH_C32(0xc4e80100), SPH_C32(0x1f70960e), SPH_C32(0x2714ca3c), - SPH_C32(0x88210c30), SPH_C32(0xb7a40100), SPH_C32(0x8a1f31d8), - SPH_C32(0x8589d8ab), SPH_C32(0xe6c46464) } -}; - -static const sph_u32 T256_16[4][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x5bd20080), SPH_C32(0x450f18ec), SPH_C32(0xc2c46c55), - SPH_C32(0xf362b233), SPH_C32(0x39a60000), SPH_C32(0x4ab753eb), - SPH_C32(0xd14e094b), SPH_C32(0xb772b42b) }, - { SPH_C32(0x39a60000), SPH_C32(0x4ab753eb), SPH_C32(0xd14e094b), - SPH_C32(0xb772b42b), SPH_C32(0x62740080), SPH_C32(0x0fb84b07), - SPH_C32(0x138a651e), SPH_C32(0x44100618) }, - { SPH_C32(0x62740080), SPH_C32(0x0fb84b07), SPH_C32(0x138a651e), - SPH_C32(0x44100618), SPH_C32(0x5bd20080), SPH_C32(0x450f18ec), - SPH_C32(0xc2c46c55), SPH_C32(0xf362b233) } -}; - -static const sph_u32 T256_18[4][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x4dce0040), SPH_C32(0x3b5bec7e), SPH_C32(0x36656ba8), - SPH_C32(0x23633a05), SPH_C32(0x78ab0000), SPH_C32(0xa0cd5a34), - SPH_C32(0x5d5ca0f7), SPH_C32(0x727784cb) }, - { SPH_C32(0x78ab0000), SPH_C32(0xa0cd5a34), SPH_C32(0x5d5ca0f7), - SPH_C32(0x727784cb), SPH_C32(0x35650040), SPH_C32(0x9b96b64a), - SPH_C32(0x6b39cb5f), SPH_C32(0x5114bece) }, - { SPH_C32(0x35650040), SPH_C32(0x9b96b64a), SPH_C32(0x6b39cb5f), - SPH_C32(0x5114bece), SPH_C32(0x4dce0040), SPH_C32(0x3b5bec7e), - SPH_C32(0x36656ba8), SPH_C32(0x23633a05) } -}; - -static const sph_u32 T256_20[4][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xa2b80020), SPH_C32(0x81e7e5f6), SPH_C32(0xf9ce4c04), - SPH_C32(0xe2afa0c0), SPH_C32(0x5c720000), SPH_C32(0xc9bacd12), - SPH_C32(0x79a90df9), SPH_C32(0x63e92178) }, - { SPH_C32(0x5c720000), SPH_C32(0xc9bacd12), SPH_C32(0x79a90df9), - SPH_C32(0x63e92178), SPH_C32(0xfeca0020), SPH_C32(0x485d28e4), - SPH_C32(0x806741fd), SPH_C32(0x814681b8) }, - { SPH_C32(0xfeca0020), SPH_C32(0x485d28e4), SPH_C32(0x806741fd), - SPH_C32(0x814681b8), SPH_C32(0xa2b80020), SPH_C32(0x81e7e5f6), - SPH_C32(0xf9ce4c04), SPH_C32(0xe2afa0c0) } -}; - -static const sph_u32 T256_22[4][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x515c0010), SPH_C32(0x40f372fb), SPH_C32(0xfce72602), - SPH_C32(0x71575061), SPH_C32(0x2e390000), SPH_C32(0x64dd6689), - SPH_C32(0x3cd406fc), SPH_C32(0xb1f490bc) }, - { SPH_C32(0x2e390000), SPH_C32(0x64dd6689), SPH_C32(0x3cd406fc), - SPH_C32(0xb1f490bc), SPH_C32(0x7f650010), SPH_C32(0x242e1472), - SPH_C32(0xc03320fe), SPH_C32(0xc0a3c0dd) }, - { SPH_C32(0x7f650010), SPH_C32(0x242e1472), SPH_C32(0xc03320fe), - SPH_C32(0xc0a3c0dd), SPH_C32(0x515c0010), SPH_C32(0x40f372fb), - SPH_C32(0xfce72602), SPH_C32(0x71575061) } -}; - -static const sph_u32 T256_24[4][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xa8ae0008), SPH_C32(0x2079397d), SPH_C32(0xfe739301), - SPH_C32(0xb8a92831), SPH_C32(0x171c0000), SPH_C32(0xb26e3344), - SPH_C32(0x9e6a837e), SPH_C32(0x58f8485f) }, - { SPH_C32(0x171c0000), SPH_C32(0xb26e3344), SPH_C32(0x9e6a837e), - SPH_C32(0x58f8485f), SPH_C32(0xbfb20008), SPH_C32(0x92170a39), - SPH_C32(0x6019107f), SPH_C32(0xe051606e) }, - { SPH_C32(0xbfb20008), SPH_C32(0x92170a39), SPH_C32(0x6019107f), - SPH_C32(0xe051606e), SPH_C32(0xa8ae0008), SPH_C32(0x2079397d), - SPH_C32(0xfe739301), SPH_C32(0xb8a92831) } -}; - -static const sph_u32 T256_26[4][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xd0080004), SPH_C32(0x8c768f77), SPH_C32(0x9dc5b050), - SPH_C32(0xaf4a29da), SPH_C32(0x6ba90000), SPH_C32(0x40ebf9aa), - SPH_C32(0x98321c3d), SPH_C32(0x76acc733) }, - { SPH_C32(0x6ba90000), SPH_C32(0x40ebf9aa), SPH_C32(0x98321c3d), - SPH_C32(0x76acc733), SPH_C32(0xbba10004), SPH_C32(0xcc9d76dd), - SPH_C32(0x05f7ac6d), SPH_C32(0xd9e6eee9) }, - { SPH_C32(0xbba10004), SPH_C32(0xcc9d76dd), SPH_C32(0x05f7ac6d), - SPH_C32(0xd9e6eee9), SPH_C32(0xd0080004), SPH_C32(0x8c768f77), - SPH_C32(0x9dc5b050), SPH_C32(0xaf4a29da) } -}; - -static const sph_u32 T256_28[4][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x88230002), SPH_C32(0x5fe7a7b3), SPH_C32(0x99e585aa), - SPH_C32(0x8d75f7f1), SPH_C32(0x51ac0000), SPH_C32(0x25e30f14), - SPH_C32(0x79e22a4c), SPH_C32(0x1298bd46) }, - { SPH_C32(0x51ac0000), SPH_C32(0x25e30f14), SPH_C32(0x79e22a4c), - SPH_C32(0x1298bd46), SPH_C32(0xd98f0002), SPH_C32(0x7a04a8a7), - SPH_C32(0xe007afe6), SPH_C32(0x9fed4ab7) }, - { SPH_C32(0xd98f0002), SPH_C32(0x7a04a8a7), SPH_C32(0xe007afe6), - SPH_C32(0x9fed4ab7), SPH_C32(0x88230002), SPH_C32(0x5fe7a7b3), - SPH_C32(0x99e585aa), SPH_C32(0x8d75f7f1) } -}; - -static const sph_u32 T256_30[4][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xc04e0001), SPH_C32(0x33b9c010), SPH_C32(0xae0ebb05), - SPH_C32(0xb5a4c63b), SPH_C32(0xc8f10000), SPH_C32(0x0b2de782), - SPH_C32(0x6bf648a4), SPH_C32(0x539cbdbf) }, - { SPH_C32(0xc8f10000), SPH_C32(0x0b2de782), SPH_C32(0x6bf648a4), - SPH_C32(0x539cbdbf), SPH_C32(0x08bf0001), SPH_C32(0x38942792), - SPH_C32(0xc5f8f3a1), SPH_C32(0xe6387b84) }, - { SPH_C32(0x08bf0001), SPH_C32(0x38942792), SPH_C32(0xc5f8f3a1), - SPH_C32(0xe6387b84), SPH_C32(0xc04e0001), SPH_C32(0x33b9c010), - SPH_C32(0xae0ebb05), SPH_C32(0xb5a4c63b) } -}; - -#define INPUT_SMALL do { \ - unsigned acc = buf[0]; \ - const sph_u32 *rp; \ - rp = &T256_0[acc >> 6][0]; \ - m0 = rp[0]; \ - m1 = rp[1]; \ - m2 = rp[2]; \ - m3 = rp[3]; \ - m4 = rp[4]; \ - m5 = rp[5]; \ - m6 = rp[6]; \ - m7 = rp[7]; \ - rp = &T256_2[(acc >> 4) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_4[(acc >> 2) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_6[acc & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - acc = buf[1]; \ - rp = &T256_8[acc >> 6][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_10[(acc >> 4) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_12[(acc >> 2) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_14[acc & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - acc = buf[2]; \ - rp = &T256_16[acc >> 6][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_18[(acc >> 4) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_20[(acc >> 2) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_22[acc & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - acc = buf[3]; \ - rp = &T256_24[acc >> 6][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_26[(acc >> 4) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_28[(acc >> 2) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_30[acc & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - } while (0) - -#endif - -#if SPH_HAMSI_EXPAND_SMALL == 3 - -static const sph_u32 T256_0[8][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xe6570000), SPH_C32(0x4bb33a25), SPH_C32(0x848598ba), - SPH_C32(0x1041003e), SPH_C32(0xf44c4000), SPH_C32(0x10a4e3cd), - SPH_C32(0x097f5711), SPH_C32(0xde77cc4c) }, - { SPH_C32(0xe4788000), SPH_C32(0x859673c1), SPH_C32(0xb5fb2452), - SPH_C32(0x29cc5edf), SPH_C32(0x045f0000), SPH_C32(0x9c4a93c9), - SPH_C32(0x62fc79d0), SPH_C32(0x731ebdc2) }, - { SPH_C32(0x022f8000), SPH_C32(0xce2549e4), SPH_C32(0x317ebce8), - SPH_C32(0x398d5ee1), SPH_C32(0xf0134000), SPH_C32(0x8cee7004), - SPH_C32(0x6b832ec1), SPH_C32(0xad69718e) }, - { SPH_C32(0x045f0000), SPH_C32(0x9c4a93c9), SPH_C32(0x62fc79d0), - SPH_C32(0x731ebdc2), SPH_C32(0xe0278000), SPH_C32(0x19dce008), - SPH_C32(0xd7075d82), SPH_C32(0x5ad2e31d) }, - { SPH_C32(0xe2080000), SPH_C32(0xd7f9a9ec), SPH_C32(0xe679e16a), - SPH_C32(0x635fbdfc), SPH_C32(0x146bc000), SPH_C32(0x097803c5), - SPH_C32(0xde780a93), SPH_C32(0x84a52f51) }, - { SPH_C32(0xe0278000), SPH_C32(0x19dce008), SPH_C32(0xd7075d82), - SPH_C32(0x5ad2e31d), SPH_C32(0xe4788000), SPH_C32(0x859673c1), - SPH_C32(0xb5fb2452), SPH_C32(0x29cc5edf) }, - { SPH_C32(0x06708000), SPH_C32(0x526fda2d), SPH_C32(0x5382c538), - SPH_C32(0x4a93e323), SPH_C32(0x1034c000), SPH_C32(0x9532900c), - SPH_C32(0xbc847343), SPH_C32(0xf7bb9293) } -}; - -static const sph_u32 T256_3[8][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xe92a2000), SPH_C32(0xb4578cfc), SPH_C32(0x11fa3a57), - SPH_C32(0x3dc90524), SPH_C32(0x97530000), SPH_C32(0x204f6ed3), - SPH_C32(0x77b9e80f), SPH_C32(0xa1ec5ec1) }, - { SPH_C32(0x97530000), SPH_C32(0x204f6ed3), SPH_C32(0x77b9e80f), - SPH_C32(0xa1ec5ec1), SPH_C32(0x7e792000), SPH_C32(0x9418e22f), - SPH_C32(0x6643d258), SPH_C32(0x9c255be5) }, - { SPH_C32(0x7e792000), SPH_C32(0x9418e22f), SPH_C32(0x6643d258), - SPH_C32(0x9c255be5), SPH_C32(0xe92a2000), SPH_C32(0xb4578cfc), - SPH_C32(0x11fa3a57), SPH_C32(0x3dc90524) }, - { SPH_C32(0x121b4000), SPH_C32(0x5b17d9e8), SPH_C32(0x8dfacfab), - SPH_C32(0xce36cc72), SPH_C32(0xe6570000), SPH_C32(0x4bb33a25), - SPH_C32(0x848598ba), SPH_C32(0x1041003e) }, - { SPH_C32(0xfb316000), SPH_C32(0xef405514), SPH_C32(0x9c00f5fc), - SPH_C32(0xf3ffc956), SPH_C32(0x71040000), SPH_C32(0x6bfc54f6), - SPH_C32(0xf33c70b5), SPH_C32(0xb1ad5eff) }, - { SPH_C32(0x85484000), SPH_C32(0x7b58b73b), SPH_C32(0xfa4327a4), - SPH_C32(0x6fda92b3), SPH_C32(0x982e2000), SPH_C32(0xdfabd80a), - SPH_C32(0xe2c64ae2), SPH_C32(0x8c645bdb) }, - { SPH_C32(0x6c626000), SPH_C32(0xcf0f3bc7), SPH_C32(0xebb91df3), - SPH_C32(0x52139797), SPH_C32(0x0f7d2000), SPH_C32(0xffe4b6d9), - SPH_C32(0x957fa2ed), SPH_C32(0x2d88051a) } -}; - -static const sph_u32 T256_6[8][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xe18b0000), SPH_C32(0x5459887d), SPH_C32(0xbf1283d3), - SPH_C32(0x1b666a73), SPH_C32(0x3fb90800), SPH_C32(0x7cdad883), - SPH_C32(0xce97a914), SPH_C32(0xbdd9f5e5) }, - { SPH_C32(0x74951000), SPH_C32(0x5a2b467e), SPH_C32(0x88fd1d2b), - SPH_C32(0x1ee68292), SPH_C32(0xcba90000), SPH_C32(0x90273769), - SPH_C32(0xbbdcf407), SPH_C32(0xd0f4af61) }, - { SPH_C32(0x951e1000), SPH_C32(0x0e72ce03), SPH_C32(0x37ef9ef8), - SPH_C32(0x0580e8e1), SPH_C32(0xf4100800), SPH_C32(0xecfdefea), - SPH_C32(0x754b5d13), SPH_C32(0x6d2d5a84) }, - { SPH_C32(0xcba90000), SPH_C32(0x90273769), SPH_C32(0xbbdcf407), - SPH_C32(0xd0f4af61), SPH_C32(0xbf3c1000), SPH_C32(0xca0c7117), - SPH_C32(0x3321e92c), SPH_C32(0xce122df3) }, - { SPH_C32(0x2a220000), SPH_C32(0xc47ebf14), SPH_C32(0x04ce77d4), - SPH_C32(0xcb92c512), SPH_C32(0x80851800), SPH_C32(0xb6d6a994), - SPH_C32(0xfdb64038), SPH_C32(0x73cbd816) }, - { SPH_C32(0xbf3c1000), SPH_C32(0xca0c7117), SPH_C32(0x3321e92c), - SPH_C32(0xce122df3), SPH_C32(0x74951000), SPH_C32(0x5a2b467e), - SPH_C32(0x88fd1d2b), SPH_C32(0x1ee68292) }, - { SPH_C32(0x5eb71000), SPH_C32(0x9e55f96a), SPH_C32(0x8c336aff), - SPH_C32(0xd5744780), SPH_C32(0x4b2c1800), SPH_C32(0x26f19efd), - SPH_C32(0x466ab43f), SPH_C32(0xa33f7777) } -}; - -static const sph_u32 T256_9[8][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x8f3e0400), SPH_C32(0x0d9dc877), SPH_C32(0x6fc548e1), - SPH_C32(0x898d2cd6), SPH_C32(0x14bd0000), SPH_C32(0x2fba37ff), - SPH_C32(0x6a72e5bb), SPH_C32(0x247febe6) }, - { SPH_C32(0x14bd0000), SPH_C32(0x2fba37ff), SPH_C32(0x6a72e5bb), - SPH_C32(0x247febe6), SPH_C32(0x9b830400), SPH_C32(0x2227ff88), - SPH_C32(0x05b7ad5a), SPH_C32(0xadf2c730) }, - { SPH_C32(0x9b830400), SPH_C32(0x2227ff88), SPH_C32(0x05b7ad5a), - SPH_C32(0xadf2c730), SPH_C32(0x8f3e0400), SPH_C32(0x0d9dc877), - SPH_C32(0x6fc548e1), SPH_C32(0x898d2cd6) }, - { SPH_C32(0xde320800), SPH_C32(0x288350fe), SPH_C32(0x71852ac7), - SPH_C32(0xa6bf9f96), SPH_C32(0xe18b0000), SPH_C32(0x5459887d), - SPH_C32(0xbf1283d3), SPH_C32(0x1b666a73) }, - { SPH_C32(0x510c0c00), SPH_C32(0x251e9889), SPH_C32(0x1e406226), - SPH_C32(0x2f32b340), SPH_C32(0xf5360000), SPH_C32(0x7be3bf82), - SPH_C32(0xd5606668), SPH_C32(0x3f198195) }, - { SPH_C32(0xca8f0800), SPH_C32(0x07396701), SPH_C32(0x1bf7cf7c), - SPH_C32(0x82c07470), SPH_C32(0x7a080400), SPH_C32(0x767e77f5), - SPH_C32(0xbaa52e89), SPH_C32(0xb694ad43) }, - { SPH_C32(0x45b10c00), SPH_C32(0x0aa4af76), SPH_C32(0x7432879d), - SPH_C32(0x0b4d58a6), SPH_C32(0x6eb50400), SPH_C32(0x59c4400a), - SPH_C32(0xd0d7cb32), SPH_C32(0x92eb46a5) } -}; - -static const sph_u32 T256_12[8][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x734c0000), SPH_C32(0x956fa7d6), SPH_C32(0xa29d1297), - SPH_C32(0x6ee56854), SPH_C32(0xc4e80100), SPH_C32(0x1f70960e), - SPH_C32(0x2714ca3c), SPH_C32(0x88210c30) }, - { SPH_C32(0xa7b80200), SPH_C32(0x1f128433), SPH_C32(0x60e5f9f2), - SPH_C32(0x9e147576), SPH_C32(0xee260000), SPH_C32(0x124b683e), - SPH_C32(0x80c2d68f), SPH_C32(0x3bf3ab2c) }, - { SPH_C32(0xd4f40200), SPH_C32(0x8a7d23e5), SPH_C32(0xc278eb65), - SPH_C32(0xf0f11d22), SPH_C32(0x2ace0100), SPH_C32(0x0d3bfe30), - SPH_C32(0xa7d61cb3), SPH_C32(0xb3d2a71c) }, - { SPH_C32(0xee260000), SPH_C32(0x124b683e), SPH_C32(0x80c2d68f), - SPH_C32(0x3bf3ab2c), SPH_C32(0x499e0200), SPH_C32(0x0d59ec0d), - SPH_C32(0xe0272f7d), SPH_C32(0xa5e7de5a) }, - { SPH_C32(0x9d6a0000), SPH_C32(0x8724cfe8), SPH_C32(0x225fc418), - SPH_C32(0x5516c378), SPH_C32(0x8d760300), SPH_C32(0x12297a03), - SPH_C32(0xc733e541), SPH_C32(0x2dc6d26a) }, - { SPH_C32(0x499e0200), SPH_C32(0x0d59ec0d), SPH_C32(0xe0272f7d), - SPH_C32(0xa5e7de5a), SPH_C32(0xa7b80200), SPH_C32(0x1f128433), - SPH_C32(0x60e5f9f2), SPH_C32(0x9e147576) }, - { SPH_C32(0x3ad20200), SPH_C32(0x98364bdb), SPH_C32(0x42ba3dea), - SPH_C32(0xcb02b60e), SPH_C32(0x63500300), SPH_C32(0x0062123d), - SPH_C32(0x47f133ce), SPH_C32(0x16357946) } -}; - -static const sph_u32 T256_15[8][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x5bd20080), SPH_C32(0x450f18ec), SPH_C32(0xc2c46c55), - SPH_C32(0xf362b233), SPH_C32(0x39a60000), SPH_C32(0x4ab753eb), - SPH_C32(0xd14e094b), SPH_C32(0xb772b42b) }, - { SPH_C32(0x39a60000), SPH_C32(0x4ab753eb), SPH_C32(0xd14e094b), - SPH_C32(0xb772b42b), SPH_C32(0x62740080), SPH_C32(0x0fb84b07), - SPH_C32(0x138a651e), SPH_C32(0x44100618) }, - { SPH_C32(0x62740080), SPH_C32(0x0fb84b07), SPH_C32(0x138a651e), - SPH_C32(0x44100618), SPH_C32(0x5bd20080), SPH_C32(0x450f18ec), - SPH_C32(0xc2c46c55), SPH_C32(0xf362b233) }, - { SPH_C32(0xb7a40100), SPH_C32(0x8a1f31d8), SPH_C32(0x8589d8ab), - SPH_C32(0xe6c46464), SPH_C32(0x734c0000), SPH_C32(0x956fa7d6), - SPH_C32(0xa29d1297), SPH_C32(0x6ee56854) }, - { SPH_C32(0xec760180), SPH_C32(0xcf102934), SPH_C32(0x474db4fe), - SPH_C32(0x15a6d657), SPH_C32(0x4aea0000), SPH_C32(0xdfd8f43d), - SPH_C32(0x73d31bdc), SPH_C32(0xd997dc7f) }, - { SPH_C32(0x8e020100), SPH_C32(0xc0a86233), SPH_C32(0x54c7d1e0), - SPH_C32(0x51b6d04f), SPH_C32(0x11380080), SPH_C32(0x9ad7ecd1), - SPH_C32(0xb1177789), SPH_C32(0x2af56e4c) }, - { SPH_C32(0xd5d00180), SPH_C32(0x85a77adf), SPH_C32(0x9603bdb5), - SPH_C32(0xa2d4627c), SPH_C32(0x289e0080), SPH_C32(0xd060bf3a), - SPH_C32(0x60597ec2), SPH_C32(0x9d87da67) } -}; - -static const sph_u32 T256_18[8][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x5c720000), SPH_C32(0xc9bacd12), SPH_C32(0x79a90df9), - SPH_C32(0x63e92178), SPH_C32(0xfeca0020), SPH_C32(0x485d28e4), - SPH_C32(0x806741fd), SPH_C32(0x814681b8) }, - { SPH_C32(0x4dce0040), SPH_C32(0x3b5bec7e), SPH_C32(0x36656ba8), - SPH_C32(0x23633a05), SPH_C32(0x78ab0000), SPH_C32(0xa0cd5a34), - SPH_C32(0x5d5ca0f7), SPH_C32(0x727784cb) }, - { SPH_C32(0x11bc0040), SPH_C32(0xf2e1216c), SPH_C32(0x4fcc6651), - SPH_C32(0x408a1b7d), SPH_C32(0x86610020), SPH_C32(0xe89072d0), - SPH_C32(0xdd3be10a), SPH_C32(0xf3310573) }, - { SPH_C32(0x78ab0000), SPH_C32(0xa0cd5a34), SPH_C32(0x5d5ca0f7), - SPH_C32(0x727784cb), SPH_C32(0x35650040), SPH_C32(0x9b96b64a), - SPH_C32(0x6b39cb5f), SPH_C32(0x5114bece) }, - { SPH_C32(0x24d90000), SPH_C32(0x69779726), SPH_C32(0x24f5ad0e), - SPH_C32(0x119ea5b3), SPH_C32(0xcbaf0060), SPH_C32(0xd3cb9eae), - SPH_C32(0xeb5e8aa2), SPH_C32(0xd0523f76) }, - { SPH_C32(0x35650040), SPH_C32(0x9b96b64a), SPH_C32(0x6b39cb5f), - SPH_C32(0x5114bece), SPH_C32(0x4dce0040), SPH_C32(0x3b5bec7e), - SPH_C32(0x36656ba8), SPH_C32(0x23633a05) }, - { SPH_C32(0x69170040), SPH_C32(0x522c7b58), SPH_C32(0x1290c6a6), - SPH_C32(0x32fd9fb6), SPH_C32(0xb3040060), SPH_C32(0x7306c49a), - SPH_C32(0xb6022a55), SPH_C32(0xa225bbbd) } -}; - -static const sph_u32 T256_21[8][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x515c0010), SPH_C32(0x40f372fb), SPH_C32(0xfce72602), - SPH_C32(0x71575061), SPH_C32(0x2e390000), SPH_C32(0x64dd6689), - SPH_C32(0x3cd406fc), SPH_C32(0xb1f490bc) }, - { SPH_C32(0x2e390000), SPH_C32(0x64dd6689), SPH_C32(0x3cd406fc), - SPH_C32(0xb1f490bc), SPH_C32(0x7f650010), SPH_C32(0x242e1472), - SPH_C32(0xc03320fe), SPH_C32(0xc0a3c0dd) }, - { SPH_C32(0x7f650010), SPH_C32(0x242e1472), SPH_C32(0xc03320fe), - SPH_C32(0xc0a3c0dd), SPH_C32(0x515c0010), SPH_C32(0x40f372fb), - SPH_C32(0xfce72602), SPH_C32(0x71575061) }, - { SPH_C32(0xa2b80020), SPH_C32(0x81e7e5f6), SPH_C32(0xf9ce4c04), - SPH_C32(0xe2afa0c0), SPH_C32(0x5c720000), SPH_C32(0xc9bacd12), - SPH_C32(0x79a90df9), SPH_C32(0x63e92178) }, - { SPH_C32(0xf3e40030), SPH_C32(0xc114970d), SPH_C32(0x05296a06), - SPH_C32(0x93f8f0a1), SPH_C32(0x724b0000), SPH_C32(0xad67ab9b), - SPH_C32(0x457d0b05), SPH_C32(0xd21db1c4) }, - { SPH_C32(0x8c810020), SPH_C32(0xe53a837f), SPH_C32(0xc51a4af8), - SPH_C32(0x535b307c), SPH_C32(0x23170010), SPH_C32(0xed94d960), - SPH_C32(0xb99a2d07), SPH_C32(0xa34ae1a5) }, - { SPH_C32(0xdddd0030), SPH_C32(0xa5c9f184), SPH_C32(0x39fd6cfa), - SPH_C32(0x220c601d), SPH_C32(0x0d2e0010), SPH_C32(0x8949bfe9), - SPH_C32(0x854e2bfb), SPH_C32(0x12be7119) } -}; - -static const sph_u32 T256_24[8][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x6ba90000), SPH_C32(0x40ebf9aa), SPH_C32(0x98321c3d), - SPH_C32(0x76acc733), SPH_C32(0xbba10004), SPH_C32(0xcc9d76dd), - SPH_C32(0x05f7ac6d), SPH_C32(0xd9e6eee9) }, - { SPH_C32(0xa8ae0008), SPH_C32(0x2079397d), SPH_C32(0xfe739301), - SPH_C32(0xb8a92831), SPH_C32(0x171c0000), SPH_C32(0xb26e3344), - SPH_C32(0x9e6a837e), SPH_C32(0x58f8485f) }, - { SPH_C32(0xc3070008), SPH_C32(0x6092c0d7), SPH_C32(0x66418f3c), - SPH_C32(0xce05ef02), SPH_C32(0xacbd0004), SPH_C32(0x7ef34599), - SPH_C32(0x9b9d2f13), SPH_C32(0x811ea6b6) }, - { SPH_C32(0x171c0000), SPH_C32(0xb26e3344), SPH_C32(0x9e6a837e), - SPH_C32(0x58f8485f), SPH_C32(0xbfb20008), SPH_C32(0x92170a39), - SPH_C32(0x6019107f), SPH_C32(0xe051606e) }, - { SPH_C32(0x7cb50000), SPH_C32(0xf285caee), SPH_C32(0x06589f43), - SPH_C32(0x2e548f6c), SPH_C32(0x0413000c), SPH_C32(0x5e8a7ce4), - SPH_C32(0x65eebc12), SPH_C32(0x39b78e87) }, - { SPH_C32(0xbfb20008), SPH_C32(0x92170a39), SPH_C32(0x6019107f), - SPH_C32(0xe051606e), SPH_C32(0xa8ae0008), SPH_C32(0x2079397d), - SPH_C32(0xfe739301), SPH_C32(0xb8a92831) }, - { SPH_C32(0xd41b0008), SPH_C32(0xd2fcf393), SPH_C32(0xf82b0c42), - SPH_C32(0x96fda75d), SPH_C32(0x130f000c), SPH_C32(0xece44fa0), - SPH_C32(0xfb843f6c), SPH_C32(0x614fc6d8) } -}; - -static const sph_u32 T256_27[8][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x88230002), SPH_C32(0x5fe7a7b3), SPH_C32(0x99e585aa), - SPH_C32(0x8d75f7f1), SPH_C32(0x51ac0000), SPH_C32(0x25e30f14), - SPH_C32(0x79e22a4c), SPH_C32(0x1298bd46) }, - { SPH_C32(0x51ac0000), SPH_C32(0x25e30f14), SPH_C32(0x79e22a4c), - SPH_C32(0x1298bd46), SPH_C32(0xd98f0002), SPH_C32(0x7a04a8a7), - SPH_C32(0xe007afe6), SPH_C32(0x9fed4ab7) }, - { SPH_C32(0xd98f0002), SPH_C32(0x7a04a8a7), SPH_C32(0xe007afe6), - SPH_C32(0x9fed4ab7), SPH_C32(0x88230002), SPH_C32(0x5fe7a7b3), - SPH_C32(0x99e585aa), SPH_C32(0x8d75f7f1) }, - { SPH_C32(0xd0080004), SPH_C32(0x8c768f77), SPH_C32(0x9dc5b050), - SPH_C32(0xaf4a29da), SPH_C32(0x6ba90000), SPH_C32(0x40ebf9aa), - SPH_C32(0x98321c3d), SPH_C32(0x76acc733) }, - { SPH_C32(0x582b0006), SPH_C32(0xd39128c4), SPH_C32(0x042035fa), - SPH_C32(0x223fde2b), SPH_C32(0x3a050000), SPH_C32(0x6508f6be), - SPH_C32(0xe1d03671), SPH_C32(0x64347a75) }, - { SPH_C32(0x81a40004), SPH_C32(0xa9958063), SPH_C32(0xe4279a1c), - SPH_C32(0xbdd2949c), SPH_C32(0xb2260002), SPH_C32(0x3aef510d), - SPH_C32(0x7835b3db), SPH_C32(0xe9418d84) }, - { SPH_C32(0x09870006), SPH_C32(0xf67227d0), SPH_C32(0x7dc21fb6), - SPH_C32(0x30a7636d), SPH_C32(0xe38a0002), SPH_C32(0x1f0c5e19), - SPH_C32(0x01d79997), SPH_C32(0xfbd930c2) } -}; - -static const sph_u32 T256_30[4][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xc04e0001), SPH_C32(0x33b9c010), SPH_C32(0xae0ebb05), - SPH_C32(0xb5a4c63b), SPH_C32(0xc8f10000), SPH_C32(0x0b2de782), - SPH_C32(0x6bf648a4), SPH_C32(0x539cbdbf) }, - { SPH_C32(0xc8f10000), SPH_C32(0x0b2de782), SPH_C32(0x6bf648a4), - SPH_C32(0x539cbdbf), SPH_C32(0x08bf0001), SPH_C32(0x38942792), - SPH_C32(0xc5f8f3a1), SPH_C32(0xe6387b84) }, - { SPH_C32(0x08bf0001), SPH_C32(0x38942792), SPH_C32(0xc5f8f3a1), - SPH_C32(0xe6387b84), SPH_C32(0xc04e0001), SPH_C32(0x33b9c010), - SPH_C32(0xae0ebb05), SPH_C32(0xb5a4c63b) } -}; - -#define INPUT_SMALL do { \ - unsigned acc = buf[0]; \ - const sph_u32 *rp; \ - rp = &T256_0[acc >> 5][0]; \ - m0 = rp[0]; \ - m1 = rp[1]; \ - m2 = rp[2]; \ - m3 = rp[3]; \ - m4 = rp[4]; \ - m5 = rp[5]; \ - m6 = rp[6]; \ - m7 = rp[7]; \ - rp = &T256_3[(acc >> 2) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - acc = (acc << 8) | buf[1]; \ - rp = &T256_6[(acc >> 7) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_9[(acc >> 4) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_12[(acc >> 1) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - acc = (acc << 8) | buf[2]; \ - rp = &T256_15[(acc >> 6) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_18[(acc >> 3) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_21[acc & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - acc = buf[3]; \ - rp = &T256_24[acc >> 5][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_27[(acc >> 2) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_30[acc & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - } while (0) - -#endif - -#if SPH_HAMSI_EXPAND_SMALL == 4 - -static const sph_u32 T256_0[16][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x121b4000), SPH_C32(0x5b17d9e8), SPH_C32(0x8dfacfab), - SPH_C32(0xce36cc72), SPH_C32(0xe6570000), SPH_C32(0x4bb33a25), - SPH_C32(0x848598ba), SPH_C32(0x1041003e) }, - { SPH_C32(0xe6570000), SPH_C32(0x4bb33a25), SPH_C32(0x848598ba), - SPH_C32(0x1041003e), SPH_C32(0xf44c4000), SPH_C32(0x10a4e3cd), - SPH_C32(0x097f5711), SPH_C32(0xde77cc4c) }, - { SPH_C32(0xf44c4000), SPH_C32(0x10a4e3cd), SPH_C32(0x097f5711), - SPH_C32(0xde77cc4c), SPH_C32(0x121b4000), SPH_C32(0x5b17d9e8), - SPH_C32(0x8dfacfab), SPH_C32(0xce36cc72) }, - { SPH_C32(0xe4788000), SPH_C32(0x859673c1), SPH_C32(0xb5fb2452), - SPH_C32(0x29cc5edf), SPH_C32(0x045f0000), SPH_C32(0x9c4a93c9), - SPH_C32(0x62fc79d0), SPH_C32(0x731ebdc2) }, - { SPH_C32(0xf663c000), SPH_C32(0xde81aa29), SPH_C32(0x3801ebf9), - SPH_C32(0xe7fa92ad), SPH_C32(0xe2080000), SPH_C32(0xd7f9a9ec), - SPH_C32(0xe679e16a), SPH_C32(0x635fbdfc) }, - { SPH_C32(0x022f8000), SPH_C32(0xce2549e4), SPH_C32(0x317ebce8), - SPH_C32(0x398d5ee1), SPH_C32(0xf0134000), SPH_C32(0x8cee7004), - SPH_C32(0x6b832ec1), SPH_C32(0xad69718e) }, - { SPH_C32(0x1034c000), SPH_C32(0x9532900c), SPH_C32(0xbc847343), - SPH_C32(0xf7bb9293), SPH_C32(0x16444000), SPH_C32(0xc75d4a21), - SPH_C32(0xef06b67b), SPH_C32(0xbd2871b0) }, - { SPH_C32(0x045f0000), SPH_C32(0x9c4a93c9), SPH_C32(0x62fc79d0), - SPH_C32(0x731ebdc2), SPH_C32(0xe0278000), SPH_C32(0x19dce008), - SPH_C32(0xd7075d82), SPH_C32(0x5ad2e31d) }, - { SPH_C32(0x16444000), SPH_C32(0xc75d4a21), SPH_C32(0xef06b67b), - SPH_C32(0xbd2871b0), SPH_C32(0x06708000), SPH_C32(0x526fda2d), - SPH_C32(0x5382c538), SPH_C32(0x4a93e323) }, - { SPH_C32(0xe2080000), SPH_C32(0xd7f9a9ec), SPH_C32(0xe679e16a), - SPH_C32(0x635fbdfc), SPH_C32(0x146bc000), SPH_C32(0x097803c5), - SPH_C32(0xde780a93), SPH_C32(0x84a52f51) }, - { SPH_C32(0xf0134000), SPH_C32(0x8cee7004), SPH_C32(0x6b832ec1), - SPH_C32(0xad69718e), SPH_C32(0xf23cc000), SPH_C32(0x42cb39e0), - SPH_C32(0x5afd9229), SPH_C32(0x94e42f6f) }, - { SPH_C32(0xe0278000), SPH_C32(0x19dce008), SPH_C32(0xd7075d82), - SPH_C32(0x5ad2e31d), SPH_C32(0xe4788000), SPH_C32(0x859673c1), - SPH_C32(0xb5fb2452), SPH_C32(0x29cc5edf) }, - { SPH_C32(0xf23cc000), SPH_C32(0x42cb39e0), SPH_C32(0x5afd9229), - SPH_C32(0x94e42f6f), SPH_C32(0x022f8000), SPH_C32(0xce2549e4), - SPH_C32(0x317ebce8), SPH_C32(0x398d5ee1) }, - { SPH_C32(0x06708000), SPH_C32(0x526fda2d), SPH_C32(0x5382c538), - SPH_C32(0x4a93e323), SPH_C32(0x1034c000), SPH_C32(0x9532900c), - SPH_C32(0xbc847343), SPH_C32(0xf7bb9293) }, - { SPH_C32(0x146bc000), SPH_C32(0x097803c5), SPH_C32(0xde780a93), - SPH_C32(0x84a52f51), SPH_C32(0xf663c000), SPH_C32(0xde81aa29), - SPH_C32(0x3801ebf9), SPH_C32(0xe7fa92ad) } -}; - -static const sph_u32 T256_4[16][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x74951000), SPH_C32(0x5a2b467e), SPH_C32(0x88fd1d2b), - SPH_C32(0x1ee68292), SPH_C32(0xcba90000), SPH_C32(0x90273769), - SPH_C32(0xbbdcf407), SPH_C32(0xd0f4af61) }, - { SPH_C32(0xcba90000), SPH_C32(0x90273769), SPH_C32(0xbbdcf407), - SPH_C32(0xd0f4af61), SPH_C32(0xbf3c1000), SPH_C32(0xca0c7117), - SPH_C32(0x3321e92c), SPH_C32(0xce122df3) }, - { SPH_C32(0xbf3c1000), SPH_C32(0xca0c7117), SPH_C32(0x3321e92c), - SPH_C32(0xce122df3), SPH_C32(0x74951000), SPH_C32(0x5a2b467e), - SPH_C32(0x88fd1d2b), SPH_C32(0x1ee68292) }, - { SPH_C32(0xe92a2000), SPH_C32(0xb4578cfc), SPH_C32(0x11fa3a57), - SPH_C32(0x3dc90524), SPH_C32(0x97530000), SPH_C32(0x204f6ed3), - SPH_C32(0x77b9e80f), SPH_C32(0xa1ec5ec1) }, - { SPH_C32(0x9dbf3000), SPH_C32(0xee7cca82), SPH_C32(0x9907277c), - SPH_C32(0x232f87b6), SPH_C32(0x5cfa0000), SPH_C32(0xb06859ba), - SPH_C32(0xcc651c08), SPH_C32(0x7118f1a0) }, - { SPH_C32(0x22832000), SPH_C32(0x2470bb95), SPH_C32(0xaa26ce50), - SPH_C32(0xed3daa45), SPH_C32(0x286f1000), SPH_C32(0xea431fc4), - SPH_C32(0x44980123), SPH_C32(0x6ffe7332) }, - { SPH_C32(0x56163000), SPH_C32(0x7e5bfdeb), SPH_C32(0x22dbd37b), - SPH_C32(0xf3db28d7), SPH_C32(0xe3c61000), SPH_C32(0x7a6428ad), - SPH_C32(0xff44f524), SPH_C32(0xbf0adc53) }, - { SPH_C32(0x97530000), SPH_C32(0x204f6ed3), SPH_C32(0x77b9e80f), - SPH_C32(0xa1ec5ec1), SPH_C32(0x7e792000), SPH_C32(0x9418e22f), - SPH_C32(0x6643d258), SPH_C32(0x9c255be5) }, - { SPH_C32(0xe3c61000), SPH_C32(0x7a6428ad), SPH_C32(0xff44f524), - SPH_C32(0xbf0adc53), SPH_C32(0xb5d02000), SPH_C32(0x043fd546), - SPH_C32(0xdd9f265f), SPH_C32(0x4cd1f484) }, - { SPH_C32(0x5cfa0000), SPH_C32(0xb06859ba), SPH_C32(0xcc651c08), - SPH_C32(0x7118f1a0), SPH_C32(0xc1453000), SPH_C32(0x5e149338), - SPH_C32(0x55623b74), SPH_C32(0x52377616) }, - { SPH_C32(0x286f1000), SPH_C32(0xea431fc4), SPH_C32(0x44980123), - SPH_C32(0x6ffe7332), SPH_C32(0x0aec3000), SPH_C32(0xce33a451), - SPH_C32(0xeebecf73), SPH_C32(0x82c3d977) }, - { SPH_C32(0x7e792000), SPH_C32(0x9418e22f), SPH_C32(0x6643d258), - SPH_C32(0x9c255be5), SPH_C32(0xe92a2000), SPH_C32(0xb4578cfc), - SPH_C32(0x11fa3a57), SPH_C32(0x3dc90524) }, - { SPH_C32(0x0aec3000), SPH_C32(0xce33a451), SPH_C32(0xeebecf73), - SPH_C32(0x82c3d977), SPH_C32(0x22832000), SPH_C32(0x2470bb95), - SPH_C32(0xaa26ce50), SPH_C32(0xed3daa45) }, - { SPH_C32(0xb5d02000), SPH_C32(0x043fd546), SPH_C32(0xdd9f265f), - SPH_C32(0x4cd1f484), SPH_C32(0x56163000), SPH_C32(0x7e5bfdeb), - SPH_C32(0x22dbd37b), SPH_C32(0xf3db28d7) }, - { SPH_C32(0xc1453000), SPH_C32(0x5e149338), SPH_C32(0x55623b74), - SPH_C32(0x52377616), SPH_C32(0x9dbf3000), SPH_C32(0xee7cca82), - SPH_C32(0x9907277c), SPH_C32(0x232f87b6) } -}; - -static const sph_u32 T256_8[16][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x8f3e0400), SPH_C32(0x0d9dc877), SPH_C32(0x6fc548e1), - SPH_C32(0x898d2cd6), SPH_C32(0x14bd0000), SPH_C32(0x2fba37ff), - SPH_C32(0x6a72e5bb), SPH_C32(0x247febe6) }, - { SPH_C32(0x14bd0000), SPH_C32(0x2fba37ff), SPH_C32(0x6a72e5bb), - SPH_C32(0x247febe6), SPH_C32(0x9b830400), SPH_C32(0x2227ff88), - SPH_C32(0x05b7ad5a), SPH_C32(0xadf2c730) }, - { SPH_C32(0x9b830400), SPH_C32(0x2227ff88), SPH_C32(0x05b7ad5a), - SPH_C32(0xadf2c730), SPH_C32(0x8f3e0400), SPH_C32(0x0d9dc877), - SPH_C32(0x6fc548e1), SPH_C32(0x898d2cd6) }, - { SPH_C32(0xde320800), SPH_C32(0x288350fe), SPH_C32(0x71852ac7), - SPH_C32(0xa6bf9f96), SPH_C32(0xe18b0000), SPH_C32(0x5459887d), - SPH_C32(0xbf1283d3), SPH_C32(0x1b666a73) }, - { SPH_C32(0x510c0c00), SPH_C32(0x251e9889), SPH_C32(0x1e406226), - SPH_C32(0x2f32b340), SPH_C32(0xf5360000), SPH_C32(0x7be3bf82), - SPH_C32(0xd5606668), SPH_C32(0x3f198195) }, - { SPH_C32(0xca8f0800), SPH_C32(0x07396701), SPH_C32(0x1bf7cf7c), - SPH_C32(0x82c07470), SPH_C32(0x7a080400), SPH_C32(0x767e77f5), - SPH_C32(0xbaa52e89), SPH_C32(0xb694ad43) }, - { SPH_C32(0x45b10c00), SPH_C32(0x0aa4af76), SPH_C32(0x7432879d), - SPH_C32(0x0b4d58a6), SPH_C32(0x6eb50400), SPH_C32(0x59c4400a), - SPH_C32(0xd0d7cb32), SPH_C32(0x92eb46a5) }, - { SPH_C32(0xe18b0000), SPH_C32(0x5459887d), SPH_C32(0xbf1283d3), - SPH_C32(0x1b666a73), SPH_C32(0x3fb90800), SPH_C32(0x7cdad883), - SPH_C32(0xce97a914), SPH_C32(0xbdd9f5e5) }, - { SPH_C32(0x6eb50400), SPH_C32(0x59c4400a), SPH_C32(0xd0d7cb32), - SPH_C32(0x92eb46a5), SPH_C32(0x2b040800), SPH_C32(0x5360ef7c), - SPH_C32(0xa4e54caf), SPH_C32(0x99a61e03) }, - { SPH_C32(0xf5360000), SPH_C32(0x7be3bf82), SPH_C32(0xd5606668), - SPH_C32(0x3f198195), SPH_C32(0xa43a0c00), SPH_C32(0x5efd270b), - SPH_C32(0xcb20044e), SPH_C32(0x102b32d5) }, - { SPH_C32(0x7a080400), SPH_C32(0x767e77f5), SPH_C32(0xbaa52e89), - SPH_C32(0xb694ad43), SPH_C32(0xb0870c00), SPH_C32(0x714710f4), - SPH_C32(0xa152e1f5), SPH_C32(0x3454d933) }, - { SPH_C32(0x3fb90800), SPH_C32(0x7cdad883), SPH_C32(0xce97a914), - SPH_C32(0xbdd9f5e5), SPH_C32(0xde320800), SPH_C32(0x288350fe), - SPH_C32(0x71852ac7), SPH_C32(0xa6bf9f96) }, - { SPH_C32(0xb0870c00), SPH_C32(0x714710f4), SPH_C32(0xa152e1f5), - SPH_C32(0x3454d933), SPH_C32(0xca8f0800), SPH_C32(0x07396701), - SPH_C32(0x1bf7cf7c), SPH_C32(0x82c07470) }, - { SPH_C32(0x2b040800), SPH_C32(0x5360ef7c), SPH_C32(0xa4e54caf), - SPH_C32(0x99a61e03), SPH_C32(0x45b10c00), SPH_C32(0x0aa4af76), - SPH_C32(0x7432879d), SPH_C32(0x0b4d58a6) }, - { SPH_C32(0xa43a0c00), SPH_C32(0x5efd270b), SPH_C32(0xcb20044e), - SPH_C32(0x102b32d5), SPH_C32(0x510c0c00), SPH_C32(0x251e9889), - SPH_C32(0x1e406226), SPH_C32(0x2f32b340) } -}; - -static const sph_u32 T256_12[16][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xb7a40100), SPH_C32(0x8a1f31d8), SPH_C32(0x8589d8ab), - SPH_C32(0xe6c46464), SPH_C32(0x734c0000), SPH_C32(0x956fa7d6), - SPH_C32(0xa29d1297), SPH_C32(0x6ee56854) }, - { SPH_C32(0x734c0000), SPH_C32(0x956fa7d6), SPH_C32(0xa29d1297), - SPH_C32(0x6ee56854), SPH_C32(0xc4e80100), SPH_C32(0x1f70960e), - SPH_C32(0x2714ca3c), SPH_C32(0x88210c30) }, - { SPH_C32(0xc4e80100), SPH_C32(0x1f70960e), SPH_C32(0x2714ca3c), - SPH_C32(0x88210c30), SPH_C32(0xb7a40100), SPH_C32(0x8a1f31d8), - SPH_C32(0x8589d8ab), SPH_C32(0xe6c46464) }, - { SPH_C32(0xa7b80200), SPH_C32(0x1f128433), SPH_C32(0x60e5f9f2), - SPH_C32(0x9e147576), SPH_C32(0xee260000), SPH_C32(0x124b683e), - SPH_C32(0x80c2d68f), SPH_C32(0x3bf3ab2c) }, - { SPH_C32(0x101c0300), SPH_C32(0x950db5eb), SPH_C32(0xe56c2159), - SPH_C32(0x78d01112), SPH_C32(0x9d6a0000), SPH_C32(0x8724cfe8), - SPH_C32(0x225fc418), SPH_C32(0x5516c378) }, - { SPH_C32(0xd4f40200), SPH_C32(0x8a7d23e5), SPH_C32(0xc278eb65), - SPH_C32(0xf0f11d22), SPH_C32(0x2ace0100), SPH_C32(0x0d3bfe30), - SPH_C32(0xa7d61cb3), SPH_C32(0xb3d2a71c) }, - { SPH_C32(0x63500300), SPH_C32(0x0062123d), SPH_C32(0x47f133ce), - SPH_C32(0x16357946), SPH_C32(0x59820100), SPH_C32(0x985459e6), - SPH_C32(0x054b0e24), SPH_C32(0xdd37cf48) }, - { SPH_C32(0xee260000), SPH_C32(0x124b683e), SPH_C32(0x80c2d68f), - SPH_C32(0x3bf3ab2c), SPH_C32(0x499e0200), SPH_C32(0x0d59ec0d), - SPH_C32(0xe0272f7d), SPH_C32(0xa5e7de5a) }, - { SPH_C32(0x59820100), SPH_C32(0x985459e6), SPH_C32(0x054b0e24), - SPH_C32(0xdd37cf48), SPH_C32(0x3ad20200), SPH_C32(0x98364bdb), - SPH_C32(0x42ba3dea), SPH_C32(0xcb02b60e) }, - { SPH_C32(0x9d6a0000), SPH_C32(0x8724cfe8), SPH_C32(0x225fc418), - SPH_C32(0x5516c378), SPH_C32(0x8d760300), SPH_C32(0x12297a03), - SPH_C32(0xc733e541), SPH_C32(0x2dc6d26a) }, - { SPH_C32(0x2ace0100), SPH_C32(0x0d3bfe30), SPH_C32(0xa7d61cb3), - SPH_C32(0xb3d2a71c), SPH_C32(0xfe3a0300), SPH_C32(0x8746ddd5), - SPH_C32(0x65aef7d6), SPH_C32(0x4323ba3e) }, - { SPH_C32(0x499e0200), SPH_C32(0x0d59ec0d), SPH_C32(0xe0272f7d), - SPH_C32(0xa5e7de5a), SPH_C32(0xa7b80200), SPH_C32(0x1f128433), - SPH_C32(0x60e5f9f2), SPH_C32(0x9e147576) }, - { SPH_C32(0xfe3a0300), SPH_C32(0x8746ddd5), SPH_C32(0x65aef7d6), - SPH_C32(0x4323ba3e), SPH_C32(0xd4f40200), SPH_C32(0x8a7d23e5), - SPH_C32(0xc278eb65), SPH_C32(0xf0f11d22) }, - { SPH_C32(0x3ad20200), SPH_C32(0x98364bdb), SPH_C32(0x42ba3dea), - SPH_C32(0xcb02b60e), SPH_C32(0x63500300), SPH_C32(0x0062123d), - SPH_C32(0x47f133ce), SPH_C32(0x16357946) }, - { SPH_C32(0x8d760300), SPH_C32(0x12297a03), SPH_C32(0xc733e541), - SPH_C32(0x2dc6d26a), SPH_C32(0x101c0300), SPH_C32(0x950db5eb), - SPH_C32(0xe56c2159), SPH_C32(0x78d01112) } -}; - -static const sph_u32 T256_16[16][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x4dce0040), SPH_C32(0x3b5bec7e), SPH_C32(0x36656ba8), - SPH_C32(0x23633a05), SPH_C32(0x78ab0000), SPH_C32(0xa0cd5a34), - SPH_C32(0x5d5ca0f7), SPH_C32(0x727784cb) }, - { SPH_C32(0x78ab0000), SPH_C32(0xa0cd5a34), SPH_C32(0x5d5ca0f7), - SPH_C32(0x727784cb), SPH_C32(0x35650040), SPH_C32(0x9b96b64a), - SPH_C32(0x6b39cb5f), SPH_C32(0x5114bece) }, - { SPH_C32(0x35650040), SPH_C32(0x9b96b64a), SPH_C32(0x6b39cb5f), - SPH_C32(0x5114bece), SPH_C32(0x4dce0040), SPH_C32(0x3b5bec7e), - SPH_C32(0x36656ba8), SPH_C32(0x23633a05) }, - { SPH_C32(0x5bd20080), SPH_C32(0x450f18ec), SPH_C32(0xc2c46c55), - SPH_C32(0xf362b233), SPH_C32(0x39a60000), SPH_C32(0x4ab753eb), - SPH_C32(0xd14e094b), SPH_C32(0xb772b42b) }, - { SPH_C32(0x161c00c0), SPH_C32(0x7e54f492), SPH_C32(0xf4a107fd), - SPH_C32(0xd0018836), SPH_C32(0x410d0000), SPH_C32(0xea7a09df), - SPH_C32(0x8c12a9bc), SPH_C32(0xc50530e0) }, - { SPH_C32(0x23790080), SPH_C32(0xe5c242d8), SPH_C32(0x9f98cca2), - SPH_C32(0x811536f8), SPH_C32(0x0cc30040), SPH_C32(0xd121e5a1), - SPH_C32(0xba77c214), SPH_C32(0xe6660ae5) }, - { SPH_C32(0x6eb700c0), SPH_C32(0xde99aea6), SPH_C32(0xa9fda70a), - SPH_C32(0xa2760cfd), SPH_C32(0x74680040), SPH_C32(0x71ecbf95), - SPH_C32(0xe72b62e3), SPH_C32(0x94118e2e) }, - { SPH_C32(0x39a60000), SPH_C32(0x4ab753eb), SPH_C32(0xd14e094b), - SPH_C32(0xb772b42b), SPH_C32(0x62740080), SPH_C32(0x0fb84b07), - SPH_C32(0x138a651e), SPH_C32(0x44100618) }, - { SPH_C32(0x74680040), SPH_C32(0x71ecbf95), SPH_C32(0xe72b62e3), - SPH_C32(0x94118e2e), SPH_C32(0x1adf0080), SPH_C32(0xaf751133), - SPH_C32(0x4ed6c5e9), SPH_C32(0x366782d3) }, - { SPH_C32(0x410d0000), SPH_C32(0xea7a09df), SPH_C32(0x8c12a9bc), - SPH_C32(0xc50530e0), SPH_C32(0x571100c0), SPH_C32(0x942efd4d), - SPH_C32(0x78b3ae41), SPH_C32(0x1504b8d6) }, - { SPH_C32(0x0cc30040), SPH_C32(0xd121e5a1), SPH_C32(0xba77c214), - SPH_C32(0xe6660ae5), SPH_C32(0x2fba00c0), SPH_C32(0x34e3a779), - SPH_C32(0x25ef0eb6), SPH_C32(0x67733c1d) }, - { SPH_C32(0x62740080), SPH_C32(0x0fb84b07), SPH_C32(0x138a651e), - SPH_C32(0x44100618), SPH_C32(0x5bd20080), SPH_C32(0x450f18ec), - SPH_C32(0xc2c46c55), SPH_C32(0xf362b233) }, - { SPH_C32(0x2fba00c0), SPH_C32(0x34e3a779), SPH_C32(0x25ef0eb6), - SPH_C32(0x67733c1d), SPH_C32(0x23790080), SPH_C32(0xe5c242d8), - SPH_C32(0x9f98cca2), SPH_C32(0x811536f8) }, - { SPH_C32(0x1adf0080), SPH_C32(0xaf751133), SPH_C32(0x4ed6c5e9), - SPH_C32(0x366782d3), SPH_C32(0x6eb700c0), SPH_C32(0xde99aea6), - SPH_C32(0xa9fda70a), SPH_C32(0xa2760cfd) }, - { SPH_C32(0x571100c0), SPH_C32(0x942efd4d), SPH_C32(0x78b3ae41), - SPH_C32(0x1504b8d6), SPH_C32(0x161c00c0), SPH_C32(0x7e54f492), - SPH_C32(0xf4a107fd), SPH_C32(0xd0018836) } -}; - -static const sph_u32 T256_20[16][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x515c0010), SPH_C32(0x40f372fb), SPH_C32(0xfce72602), - SPH_C32(0x71575061), SPH_C32(0x2e390000), SPH_C32(0x64dd6689), - SPH_C32(0x3cd406fc), SPH_C32(0xb1f490bc) }, - { SPH_C32(0x2e390000), SPH_C32(0x64dd6689), SPH_C32(0x3cd406fc), - SPH_C32(0xb1f490bc), SPH_C32(0x7f650010), SPH_C32(0x242e1472), - SPH_C32(0xc03320fe), SPH_C32(0xc0a3c0dd) }, - { SPH_C32(0x7f650010), SPH_C32(0x242e1472), SPH_C32(0xc03320fe), - SPH_C32(0xc0a3c0dd), SPH_C32(0x515c0010), SPH_C32(0x40f372fb), - SPH_C32(0xfce72602), SPH_C32(0x71575061) }, - { SPH_C32(0xa2b80020), SPH_C32(0x81e7e5f6), SPH_C32(0xf9ce4c04), - SPH_C32(0xe2afa0c0), SPH_C32(0x5c720000), SPH_C32(0xc9bacd12), - SPH_C32(0x79a90df9), SPH_C32(0x63e92178) }, - { SPH_C32(0xf3e40030), SPH_C32(0xc114970d), SPH_C32(0x05296a06), - SPH_C32(0x93f8f0a1), SPH_C32(0x724b0000), SPH_C32(0xad67ab9b), - SPH_C32(0x457d0b05), SPH_C32(0xd21db1c4) }, - { SPH_C32(0x8c810020), SPH_C32(0xe53a837f), SPH_C32(0xc51a4af8), - SPH_C32(0x535b307c), SPH_C32(0x23170010), SPH_C32(0xed94d960), - SPH_C32(0xb99a2d07), SPH_C32(0xa34ae1a5) }, - { SPH_C32(0xdddd0030), SPH_C32(0xa5c9f184), SPH_C32(0x39fd6cfa), - SPH_C32(0x220c601d), SPH_C32(0x0d2e0010), SPH_C32(0x8949bfe9), - SPH_C32(0x854e2bfb), SPH_C32(0x12be7119) }, - { SPH_C32(0x5c720000), SPH_C32(0xc9bacd12), SPH_C32(0x79a90df9), - SPH_C32(0x63e92178), SPH_C32(0xfeca0020), SPH_C32(0x485d28e4), - SPH_C32(0x806741fd), SPH_C32(0x814681b8) }, - { SPH_C32(0x0d2e0010), SPH_C32(0x8949bfe9), SPH_C32(0x854e2bfb), - SPH_C32(0x12be7119), SPH_C32(0xd0f30020), SPH_C32(0x2c804e6d), - SPH_C32(0xbcb34701), SPH_C32(0x30b21104) }, - { SPH_C32(0x724b0000), SPH_C32(0xad67ab9b), SPH_C32(0x457d0b05), - SPH_C32(0xd21db1c4), SPH_C32(0x81af0030), SPH_C32(0x6c733c96), - SPH_C32(0x40546103), SPH_C32(0x41e54165) }, - { SPH_C32(0x23170010), SPH_C32(0xed94d960), SPH_C32(0xb99a2d07), - SPH_C32(0xa34ae1a5), SPH_C32(0xaf960030), SPH_C32(0x08ae5a1f), - SPH_C32(0x7c8067ff), SPH_C32(0xf011d1d9) }, - { SPH_C32(0xfeca0020), SPH_C32(0x485d28e4), SPH_C32(0x806741fd), - SPH_C32(0x814681b8), SPH_C32(0xa2b80020), SPH_C32(0x81e7e5f6), - SPH_C32(0xf9ce4c04), SPH_C32(0xe2afa0c0) }, - { SPH_C32(0xaf960030), SPH_C32(0x08ae5a1f), SPH_C32(0x7c8067ff), - SPH_C32(0xf011d1d9), SPH_C32(0x8c810020), SPH_C32(0xe53a837f), - SPH_C32(0xc51a4af8), SPH_C32(0x535b307c) }, - { SPH_C32(0xd0f30020), SPH_C32(0x2c804e6d), SPH_C32(0xbcb34701), - SPH_C32(0x30b21104), SPH_C32(0xdddd0030), SPH_C32(0xa5c9f184), - SPH_C32(0x39fd6cfa), SPH_C32(0x220c601d) }, - { SPH_C32(0x81af0030), SPH_C32(0x6c733c96), SPH_C32(0x40546103), - SPH_C32(0x41e54165), SPH_C32(0xf3e40030), SPH_C32(0xc114970d), - SPH_C32(0x05296a06), SPH_C32(0x93f8f0a1) } -}; - -static const sph_u32 T256_24[16][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xd0080004), SPH_C32(0x8c768f77), SPH_C32(0x9dc5b050), - SPH_C32(0xaf4a29da), SPH_C32(0x6ba90000), SPH_C32(0x40ebf9aa), - SPH_C32(0x98321c3d), SPH_C32(0x76acc733) }, - { SPH_C32(0x6ba90000), SPH_C32(0x40ebf9aa), SPH_C32(0x98321c3d), - SPH_C32(0x76acc733), SPH_C32(0xbba10004), SPH_C32(0xcc9d76dd), - SPH_C32(0x05f7ac6d), SPH_C32(0xd9e6eee9) }, - { SPH_C32(0xbba10004), SPH_C32(0xcc9d76dd), SPH_C32(0x05f7ac6d), - SPH_C32(0xd9e6eee9), SPH_C32(0xd0080004), SPH_C32(0x8c768f77), - SPH_C32(0x9dc5b050), SPH_C32(0xaf4a29da) }, - { SPH_C32(0xa8ae0008), SPH_C32(0x2079397d), SPH_C32(0xfe739301), - SPH_C32(0xb8a92831), SPH_C32(0x171c0000), SPH_C32(0xb26e3344), - SPH_C32(0x9e6a837e), SPH_C32(0x58f8485f) }, - { SPH_C32(0x78a6000c), SPH_C32(0xac0fb60a), SPH_C32(0x63b62351), - SPH_C32(0x17e301eb), SPH_C32(0x7cb50000), SPH_C32(0xf285caee), - SPH_C32(0x06589f43), SPH_C32(0x2e548f6c) }, - { SPH_C32(0xc3070008), SPH_C32(0x6092c0d7), SPH_C32(0x66418f3c), - SPH_C32(0xce05ef02), SPH_C32(0xacbd0004), SPH_C32(0x7ef34599), - SPH_C32(0x9b9d2f13), SPH_C32(0x811ea6b6) }, - { SPH_C32(0x130f000c), SPH_C32(0xece44fa0), SPH_C32(0xfb843f6c), - SPH_C32(0x614fc6d8), SPH_C32(0xc7140004), SPH_C32(0x3e18bc33), - SPH_C32(0x03af332e), SPH_C32(0xf7b26185) }, - { SPH_C32(0x171c0000), SPH_C32(0xb26e3344), SPH_C32(0x9e6a837e), - SPH_C32(0x58f8485f), SPH_C32(0xbfb20008), SPH_C32(0x92170a39), - SPH_C32(0x6019107f), SPH_C32(0xe051606e) }, - { SPH_C32(0xc7140004), SPH_C32(0x3e18bc33), SPH_C32(0x03af332e), - SPH_C32(0xf7b26185), SPH_C32(0xd41b0008), SPH_C32(0xd2fcf393), - SPH_C32(0xf82b0c42), SPH_C32(0x96fda75d) }, - { SPH_C32(0x7cb50000), SPH_C32(0xf285caee), SPH_C32(0x06589f43), - SPH_C32(0x2e548f6c), SPH_C32(0x0413000c), SPH_C32(0x5e8a7ce4), - SPH_C32(0x65eebc12), SPH_C32(0x39b78e87) }, - { SPH_C32(0xacbd0004), SPH_C32(0x7ef34599), SPH_C32(0x9b9d2f13), - SPH_C32(0x811ea6b6), SPH_C32(0x6fba000c), SPH_C32(0x1e61854e), - SPH_C32(0xfddca02f), SPH_C32(0x4f1b49b4) }, - { SPH_C32(0xbfb20008), SPH_C32(0x92170a39), SPH_C32(0x6019107f), - SPH_C32(0xe051606e), SPH_C32(0xa8ae0008), SPH_C32(0x2079397d), - SPH_C32(0xfe739301), SPH_C32(0xb8a92831) }, - { SPH_C32(0x6fba000c), SPH_C32(0x1e61854e), SPH_C32(0xfddca02f), - SPH_C32(0x4f1b49b4), SPH_C32(0xc3070008), SPH_C32(0x6092c0d7), - SPH_C32(0x66418f3c), SPH_C32(0xce05ef02) }, - { SPH_C32(0xd41b0008), SPH_C32(0xd2fcf393), SPH_C32(0xf82b0c42), - SPH_C32(0x96fda75d), SPH_C32(0x130f000c), SPH_C32(0xece44fa0), - SPH_C32(0xfb843f6c), SPH_C32(0x614fc6d8) }, - { SPH_C32(0x0413000c), SPH_C32(0x5e8a7ce4), SPH_C32(0x65eebc12), - SPH_C32(0x39b78e87), SPH_C32(0x78a6000c), SPH_C32(0xac0fb60a), - SPH_C32(0x63b62351), SPH_C32(0x17e301eb) } -}; - -static const sph_u32 T256_28[16][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xc04e0001), SPH_C32(0x33b9c010), SPH_C32(0xae0ebb05), - SPH_C32(0xb5a4c63b), SPH_C32(0xc8f10000), SPH_C32(0x0b2de782), - SPH_C32(0x6bf648a4), SPH_C32(0x539cbdbf) }, - { SPH_C32(0xc8f10000), SPH_C32(0x0b2de782), SPH_C32(0x6bf648a4), - SPH_C32(0x539cbdbf), SPH_C32(0x08bf0001), SPH_C32(0x38942792), - SPH_C32(0xc5f8f3a1), SPH_C32(0xe6387b84) }, - { SPH_C32(0x08bf0001), SPH_C32(0x38942792), SPH_C32(0xc5f8f3a1), - SPH_C32(0xe6387b84), SPH_C32(0xc04e0001), SPH_C32(0x33b9c010), - SPH_C32(0xae0ebb05), SPH_C32(0xb5a4c63b) }, - { SPH_C32(0x88230002), SPH_C32(0x5fe7a7b3), SPH_C32(0x99e585aa), - SPH_C32(0x8d75f7f1), SPH_C32(0x51ac0000), SPH_C32(0x25e30f14), - SPH_C32(0x79e22a4c), SPH_C32(0x1298bd46) }, - { SPH_C32(0x486d0003), SPH_C32(0x6c5e67a3), SPH_C32(0x37eb3eaf), - SPH_C32(0x38d131ca), SPH_C32(0x995d0000), SPH_C32(0x2ecee896), - SPH_C32(0x121462e8), SPH_C32(0x410400f9) }, - { SPH_C32(0x40d20002), SPH_C32(0x54ca4031), SPH_C32(0xf213cd0e), - SPH_C32(0xdee94a4e), SPH_C32(0x59130001), SPH_C32(0x1d772886), - SPH_C32(0xbc1ad9ed), SPH_C32(0xf4a0c6c2) }, - { SPH_C32(0x809c0003), SPH_C32(0x67738021), SPH_C32(0x5c1d760b), - SPH_C32(0x6b4d8c75), SPH_C32(0x91e20001), SPH_C32(0x165acf04), - SPH_C32(0xd7ec9149), SPH_C32(0xa73c7b7d) }, - { SPH_C32(0x51ac0000), SPH_C32(0x25e30f14), SPH_C32(0x79e22a4c), - SPH_C32(0x1298bd46), SPH_C32(0xd98f0002), SPH_C32(0x7a04a8a7), - SPH_C32(0xe007afe6), SPH_C32(0x9fed4ab7) }, - { SPH_C32(0x91e20001), SPH_C32(0x165acf04), SPH_C32(0xd7ec9149), - SPH_C32(0xa73c7b7d), SPH_C32(0x117e0002), SPH_C32(0x71294f25), - SPH_C32(0x8bf1e742), SPH_C32(0xcc71f708) }, - { SPH_C32(0x995d0000), SPH_C32(0x2ecee896), SPH_C32(0x121462e8), - SPH_C32(0x410400f9), SPH_C32(0xd1300003), SPH_C32(0x42908f35), - SPH_C32(0x25ff5c47), SPH_C32(0x79d53133) }, - { SPH_C32(0x59130001), SPH_C32(0x1d772886), SPH_C32(0xbc1ad9ed), - SPH_C32(0xf4a0c6c2), SPH_C32(0x19c10003), SPH_C32(0x49bd68b7), - SPH_C32(0x4e0914e3), SPH_C32(0x2a498c8c) }, - { SPH_C32(0xd98f0002), SPH_C32(0x7a04a8a7), SPH_C32(0xe007afe6), - SPH_C32(0x9fed4ab7), SPH_C32(0x88230002), SPH_C32(0x5fe7a7b3), - SPH_C32(0x99e585aa), SPH_C32(0x8d75f7f1) }, - { SPH_C32(0x19c10003), SPH_C32(0x49bd68b7), SPH_C32(0x4e0914e3), - SPH_C32(0x2a498c8c), SPH_C32(0x40d20002), SPH_C32(0x54ca4031), - SPH_C32(0xf213cd0e), SPH_C32(0xdee94a4e) }, - { SPH_C32(0x117e0002), SPH_C32(0x71294f25), SPH_C32(0x8bf1e742), - SPH_C32(0xcc71f708), SPH_C32(0x809c0003), SPH_C32(0x67738021), - SPH_C32(0x5c1d760b), SPH_C32(0x6b4d8c75) }, - { SPH_C32(0xd1300003), SPH_C32(0x42908f35), SPH_C32(0x25ff5c47), - SPH_C32(0x79d53133), SPH_C32(0x486d0003), SPH_C32(0x6c5e67a3), - SPH_C32(0x37eb3eaf), SPH_C32(0x38d131ca) } -}; - -#define INPUT_SMALL do { \ - unsigned acc = buf[0]; \ - const sph_u32 *rp; \ - rp = &T256_0[acc >> 4][0]; \ - m0 = rp[0]; \ - m1 = rp[1]; \ - m2 = rp[2]; \ - m3 = rp[3]; \ - m4 = rp[4]; \ - m5 = rp[5]; \ - m6 = rp[6]; \ - m7 = rp[7]; \ - rp = &T256_4[acc & 0x0f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - acc = buf[1]; \ - rp = &T256_8[acc >> 4][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_12[acc & 0x0f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - acc = buf[2]; \ - rp = &T256_16[acc >> 4][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_20[acc & 0x0f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - acc = buf[3]; \ - rp = &T256_24[acc >> 4][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_28[acc & 0x0f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - } while (0) - -#endif - -#if SPH_HAMSI_EXPAND_SMALL == 5 - -static const sph_u32 T256_0[32][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x97530000), SPH_C32(0x204f6ed3), SPH_C32(0x77b9e80f), - SPH_C32(0xa1ec5ec1), SPH_C32(0x7e792000), SPH_C32(0x9418e22f), - SPH_C32(0x6643d258), SPH_C32(0x9c255be5) }, - { SPH_C32(0x121b4000), SPH_C32(0x5b17d9e8), SPH_C32(0x8dfacfab), - SPH_C32(0xce36cc72), SPH_C32(0xe6570000), SPH_C32(0x4bb33a25), - SPH_C32(0x848598ba), SPH_C32(0x1041003e) }, - { SPH_C32(0x85484000), SPH_C32(0x7b58b73b), SPH_C32(0xfa4327a4), - SPH_C32(0x6fda92b3), SPH_C32(0x982e2000), SPH_C32(0xdfabd80a), - SPH_C32(0xe2c64ae2), SPH_C32(0x8c645bdb) }, - { SPH_C32(0xe6570000), SPH_C32(0x4bb33a25), SPH_C32(0x848598ba), - SPH_C32(0x1041003e), SPH_C32(0xf44c4000), SPH_C32(0x10a4e3cd), - SPH_C32(0x097f5711), SPH_C32(0xde77cc4c) }, - { SPH_C32(0x71040000), SPH_C32(0x6bfc54f6), SPH_C32(0xf33c70b5), - SPH_C32(0xb1ad5eff), SPH_C32(0x8a356000), SPH_C32(0x84bc01e2), - SPH_C32(0x6f3c8549), SPH_C32(0x425297a9) }, - { SPH_C32(0xf44c4000), SPH_C32(0x10a4e3cd), SPH_C32(0x097f5711), - SPH_C32(0xde77cc4c), SPH_C32(0x121b4000), SPH_C32(0x5b17d9e8), - SPH_C32(0x8dfacfab), SPH_C32(0xce36cc72) }, - { SPH_C32(0x631f4000), SPH_C32(0x30eb8d1e), SPH_C32(0x7ec6bf1e), - SPH_C32(0x7f9b928d), SPH_C32(0x6c626000), SPH_C32(0xcf0f3bc7), - SPH_C32(0xebb91df3), SPH_C32(0x52139797) }, - { SPH_C32(0xe4788000), SPH_C32(0x859673c1), SPH_C32(0xb5fb2452), - SPH_C32(0x29cc5edf), SPH_C32(0x045f0000), SPH_C32(0x9c4a93c9), - SPH_C32(0x62fc79d0), SPH_C32(0x731ebdc2) }, - { SPH_C32(0x732b8000), SPH_C32(0xa5d91d12), SPH_C32(0xc242cc5d), - SPH_C32(0x8820001e), SPH_C32(0x7a262000), SPH_C32(0x085271e6), - SPH_C32(0x04bfab88), SPH_C32(0xef3be627) }, - { SPH_C32(0xf663c000), SPH_C32(0xde81aa29), SPH_C32(0x3801ebf9), - SPH_C32(0xe7fa92ad), SPH_C32(0xe2080000), SPH_C32(0xd7f9a9ec), - SPH_C32(0xe679e16a), SPH_C32(0x635fbdfc) }, - { SPH_C32(0x6130c000), SPH_C32(0xfecec4fa), SPH_C32(0x4fb803f6), - SPH_C32(0x4616cc6c), SPH_C32(0x9c712000), SPH_C32(0x43e14bc3), - SPH_C32(0x803a3332), SPH_C32(0xff7ae619) }, - { SPH_C32(0x022f8000), SPH_C32(0xce2549e4), SPH_C32(0x317ebce8), - SPH_C32(0x398d5ee1), SPH_C32(0xf0134000), SPH_C32(0x8cee7004), - SPH_C32(0x6b832ec1), SPH_C32(0xad69718e) }, - { SPH_C32(0x957c8000), SPH_C32(0xee6a2737), SPH_C32(0x46c754e7), - SPH_C32(0x98610020), SPH_C32(0x8e6a6000), SPH_C32(0x18f6922b), - SPH_C32(0x0dc0fc99), SPH_C32(0x314c2a6b) }, - { SPH_C32(0x1034c000), SPH_C32(0x9532900c), SPH_C32(0xbc847343), - SPH_C32(0xf7bb9293), SPH_C32(0x16444000), SPH_C32(0xc75d4a21), - SPH_C32(0xef06b67b), SPH_C32(0xbd2871b0) }, - { SPH_C32(0x8767c000), SPH_C32(0xb57dfedf), SPH_C32(0xcb3d9b4c), - SPH_C32(0x5657cc52), SPH_C32(0x683d6000), SPH_C32(0x5345a80e), - SPH_C32(0x89456423), SPH_C32(0x210d2a55) }, - { SPH_C32(0x045f0000), SPH_C32(0x9c4a93c9), SPH_C32(0x62fc79d0), - SPH_C32(0x731ebdc2), SPH_C32(0xe0278000), SPH_C32(0x19dce008), - SPH_C32(0xd7075d82), SPH_C32(0x5ad2e31d) }, - { SPH_C32(0x930c0000), SPH_C32(0xbc05fd1a), SPH_C32(0x154591df), - SPH_C32(0xd2f2e303), SPH_C32(0x9e5ea000), SPH_C32(0x8dc40227), - SPH_C32(0xb1448fda), SPH_C32(0xc6f7b8f8) }, - { SPH_C32(0x16444000), SPH_C32(0xc75d4a21), SPH_C32(0xef06b67b), - SPH_C32(0xbd2871b0), SPH_C32(0x06708000), SPH_C32(0x526fda2d), - SPH_C32(0x5382c538), SPH_C32(0x4a93e323) }, - { SPH_C32(0x81174000), SPH_C32(0xe71224f2), SPH_C32(0x98bf5e74), - SPH_C32(0x1cc42f71), SPH_C32(0x7809a000), SPH_C32(0xc6773802), - SPH_C32(0x35c11760), SPH_C32(0xd6b6b8c6) }, - { SPH_C32(0xe2080000), SPH_C32(0xd7f9a9ec), SPH_C32(0xe679e16a), - SPH_C32(0x635fbdfc), SPH_C32(0x146bc000), SPH_C32(0x097803c5), - SPH_C32(0xde780a93), SPH_C32(0x84a52f51) }, - { SPH_C32(0x755b0000), SPH_C32(0xf7b6c73f), SPH_C32(0x91c00965), - SPH_C32(0xc2b3e33d), SPH_C32(0x6a12e000), SPH_C32(0x9d60e1ea), - SPH_C32(0xb83bd8cb), SPH_C32(0x188074b4) }, - { SPH_C32(0xf0134000), SPH_C32(0x8cee7004), SPH_C32(0x6b832ec1), - SPH_C32(0xad69718e), SPH_C32(0xf23cc000), SPH_C32(0x42cb39e0), - SPH_C32(0x5afd9229), SPH_C32(0x94e42f6f) }, - { SPH_C32(0x67404000), SPH_C32(0xaca11ed7), SPH_C32(0x1c3ac6ce), - SPH_C32(0x0c852f4f), SPH_C32(0x8c45e000), SPH_C32(0xd6d3dbcf), - SPH_C32(0x3cbe4071), SPH_C32(0x08c1748a) }, - { SPH_C32(0xe0278000), SPH_C32(0x19dce008), SPH_C32(0xd7075d82), - SPH_C32(0x5ad2e31d), SPH_C32(0xe4788000), SPH_C32(0x859673c1), - SPH_C32(0xb5fb2452), SPH_C32(0x29cc5edf) }, - { SPH_C32(0x77748000), SPH_C32(0x39938edb), SPH_C32(0xa0beb58d), - SPH_C32(0xfb3ebddc), SPH_C32(0x9a01a000), SPH_C32(0x118e91ee), - SPH_C32(0xd3b8f60a), SPH_C32(0xb5e9053a) }, - { SPH_C32(0xf23cc000), SPH_C32(0x42cb39e0), SPH_C32(0x5afd9229), - SPH_C32(0x94e42f6f), SPH_C32(0x022f8000), SPH_C32(0xce2549e4), - SPH_C32(0x317ebce8), SPH_C32(0x398d5ee1) }, - { SPH_C32(0x656fc000), SPH_C32(0x62845733), SPH_C32(0x2d447a26), - SPH_C32(0x350871ae), SPH_C32(0x7c56a000), SPH_C32(0x5a3dabcb), - SPH_C32(0x573d6eb0), SPH_C32(0xa5a80504) }, - { SPH_C32(0x06708000), SPH_C32(0x526fda2d), SPH_C32(0x5382c538), - SPH_C32(0x4a93e323), SPH_C32(0x1034c000), SPH_C32(0x9532900c), - SPH_C32(0xbc847343), SPH_C32(0xf7bb9293) }, - { SPH_C32(0x91238000), SPH_C32(0x7220b4fe), SPH_C32(0x243b2d37), - SPH_C32(0xeb7fbde2), SPH_C32(0x6e4de000), SPH_C32(0x012a7223), - SPH_C32(0xdac7a11b), SPH_C32(0x6b9ec976) }, - { SPH_C32(0x146bc000), SPH_C32(0x097803c5), SPH_C32(0xde780a93), - SPH_C32(0x84a52f51), SPH_C32(0xf663c000), SPH_C32(0xde81aa29), - SPH_C32(0x3801ebf9), SPH_C32(0xe7fa92ad) }, - { SPH_C32(0x8338c000), SPH_C32(0x29376d16), SPH_C32(0xa9c1e29c), - SPH_C32(0x25497190), SPH_C32(0x881ae000), SPH_C32(0x4a994806), - SPH_C32(0x5e4239a1), SPH_C32(0x7bdfc948) } -}; - -static const sph_u32 T256_5[32][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xde320800), SPH_C32(0x288350fe), SPH_C32(0x71852ac7), - SPH_C32(0xa6bf9f96), SPH_C32(0xe18b0000), SPH_C32(0x5459887d), - SPH_C32(0xbf1283d3), SPH_C32(0x1b666a73) }, - { SPH_C32(0xe18b0000), SPH_C32(0x5459887d), SPH_C32(0xbf1283d3), - SPH_C32(0x1b666a73), SPH_C32(0x3fb90800), SPH_C32(0x7cdad883), - SPH_C32(0xce97a914), SPH_C32(0xbdd9f5e5) }, - { SPH_C32(0x3fb90800), SPH_C32(0x7cdad883), SPH_C32(0xce97a914), - SPH_C32(0xbdd9f5e5), SPH_C32(0xde320800), SPH_C32(0x288350fe), - SPH_C32(0x71852ac7), SPH_C32(0xa6bf9f96) }, - { SPH_C32(0x74951000), SPH_C32(0x5a2b467e), SPH_C32(0x88fd1d2b), - SPH_C32(0x1ee68292), SPH_C32(0xcba90000), SPH_C32(0x90273769), - SPH_C32(0xbbdcf407), SPH_C32(0xd0f4af61) }, - { SPH_C32(0xaaa71800), SPH_C32(0x72a81680), SPH_C32(0xf97837ec), - SPH_C32(0xb8591d04), SPH_C32(0x2a220000), SPH_C32(0xc47ebf14), - SPH_C32(0x04ce77d4), SPH_C32(0xcb92c512) }, - { SPH_C32(0x951e1000), SPH_C32(0x0e72ce03), SPH_C32(0x37ef9ef8), - SPH_C32(0x0580e8e1), SPH_C32(0xf4100800), SPH_C32(0xecfdefea), - SPH_C32(0x754b5d13), SPH_C32(0x6d2d5a84) }, - { SPH_C32(0x4b2c1800), SPH_C32(0x26f19efd), SPH_C32(0x466ab43f), - SPH_C32(0xa33f7777), SPH_C32(0x159b0800), SPH_C32(0xb8a46797), - SPH_C32(0xca59dec0), SPH_C32(0x764b30f7) }, - { SPH_C32(0xcba90000), SPH_C32(0x90273769), SPH_C32(0xbbdcf407), - SPH_C32(0xd0f4af61), SPH_C32(0xbf3c1000), SPH_C32(0xca0c7117), - SPH_C32(0x3321e92c), SPH_C32(0xce122df3) }, - { SPH_C32(0x159b0800), SPH_C32(0xb8a46797), SPH_C32(0xca59dec0), - SPH_C32(0x764b30f7), SPH_C32(0x5eb71000), SPH_C32(0x9e55f96a), - SPH_C32(0x8c336aff), SPH_C32(0xd5744780) }, - { SPH_C32(0x2a220000), SPH_C32(0xc47ebf14), SPH_C32(0x04ce77d4), - SPH_C32(0xcb92c512), SPH_C32(0x80851800), SPH_C32(0xb6d6a994), - SPH_C32(0xfdb64038), SPH_C32(0x73cbd816) }, - { SPH_C32(0xf4100800), SPH_C32(0xecfdefea), SPH_C32(0x754b5d13), - SPH_C32(0x6d2d5a84), SPH_C32(0x610e1800), SPH_C32(0xe28f21e9), - SPH_C32(0x42a4c3eb), SPH_C32(0x68adb265) }, - { SPH_C32(0xbf3c1000), SPH_C32(0xca0c7117), SPH_C32(0x3321e92c), - SPH_C32(0xce122df3), SPH_C32(0x74951000), SPH_C32(0x5a2b467e), - SPH_C32(0x88fd1d2b), SPH_C32(0x1ee68292) }, - { SPH_C32(0x610e1800), SPH_C32(0xe28f21e9), SPH_C32(0x42a4c3eb), - SPH_C32(0x68adb265), SPH_C32(0x951e1000), SPH_C32(0x0e72ce03), - SPH_C32(0x37ef9ef8), SPH_C32(0x0580e8e1) }, - { SPH_C32(0x5eb71000), SPH_C32(0x9e55f96a), SPH_C32(0x8c336aff), - SPH_C32(0xd5744780), SPH_C32(0x4b2c1800), SPH_C32(0x26f19efd), - SPH_C32(0x466ab43f), SPH_C32(0xa33f7777) }, - { SPH_C32(0x80851800), SPH_C32(0xb6d6a994), SPH_C32(0xfdb64038), - SPH_C32(0x73cbd816), SPH_C32(0xaaa71800), SPH_C32(0x72a81680), - SPH_C32(0xf97837ec), SPH_C32(0xb8591d04) }, - { SPH_C32(0xe92a2000), SPH_C32(0xb4578cfc), SPH_C32(0x11fa3a57), - SPH_C32(0x3dc90524), SPH_C32(0x97530000), SPH_C32(0x204f6ed3), - SPH_C32(0x77b9e80f), SPH_C32(0xa1ec5ec1) }, - { SPH_C32(0x37182800), SPH_C32(0x9cd4dc02), SPH_C32(0x607f1090), - SPH_C32(0x9b769ab2), SPH_C32(0x76d80000), SPH_C32(0x7416e6ae), - SPH_C32(0xc8ab6bdc), SPH_C32(0xba8a34b2) }, - { SPH_C32(0x08a12000), SPH_C32(0xe00e0481), SPH_C32(0xaee8b984), - SPH_C32(0x26af6f57), SPH_C32(0xa8ea0800), SPH_C32(0x5c95b650), - SPH_C32(0xb92e411b), SPH_C32(0x1c35ab24) }, - { SPH_C32(0xd6932800), SPH_C32(0xc88d547f), SPH_C32(0xdf6d9343), - SPH_C32(0x8010f0c1), SPH_C32(0x49610800), SPH_C32(0x08cc3e2d), - SPH_C32(0x063cc2c8), SPH_C32(0x0753c157) }, - { SPH_C32(0x9dbf3000), SPH_C32(0xee7cca82), SPH_C32(0x9907277c), - SPH_C32(0x232f87b6), SPH_C32(0x5cfa0000), SPH_C32(0xb06859ba), - SPH_C32(0xcc651c08), SPH_C32(0x7118f1a0) }, - { SPH_C32(0x438d3800), SPH_C32(0xc6ff9a7c), SPH_C32(0xe8820dbb), - SPH_C32(0x85901820), SPH_C32(0xbd710000), SPH_C32(0xe431d1c7), - SPH_C32(0x73779fdb), SPH_C32(0x6a7e9bd3) }, - { SPH_C32(0x7c343000), SPH_C32(0xba2542ff), SPH_C32(0x2615a4af), - SPH_C32(0x3849edc5), SPH_C32(0x63430800), SPH_C32(0xccb28139), - SPH_C32(0x02f2b51c), SPH_C32(0xccc10445) }, - { SPH_C32(0xa2063800), SPH_C32(0x92a61201), SPH_C32(0x57908e68), - SPH_C32(0x9ef67253), SPH_C32(0x82c80800), SPH_C32(0x98eb0944), - SPH_C32(0xbde036cf), SPH_C32(0xd7a76e36) }, - { SPH_C32(0x22832000), SPH_C32(0x2470bb95), SPH_C32(0xaa26ce50), - SPH_C32(0xed3daa45), SPH_C32(0x286f1000), SPH_C32(0xea431fc4), - SPH_C32(0x44980123), SPH_C32(0x6ffe7332) }, - { SPH_C32(0xfcb12800), SPH_C32(0x0cf3eb6b), SPH_C32(0xdba3e497), - SPH_C32(0x4b8235d3), SPH_C32(0xc9e41000), SPH_C32(0xbe1a97b9), - SPH_C32(0xfb8a82f0), SPH_C32(0x74981941) }, - { SPH_C32(0xc3082000), SPH_C32(0x702933e8), SPH_C32(0x15344d83), - SPH_C32(0xf65bc036), SPH_C32(0x17d61800), SPH_C32(0x9699c747), - SPH_C32(0x8a0fa837), SPH_C32(0xd22786d7) }, - { SPH_C32(0x1d3a2800), SPH_C32(0x58aa6316), SPH_C32(0x64b16744), - SPH_C32(0x50e45fa0), SPH_C32(0xf65d1800), SPH_C32(0xc2c04f3a), - SPH_C32(0x351d2be4), SPH_C32(0xc941eca4) }, - { SPH_C32(0x56163000), SPH_C32(0x7e5bfdeb), SPH_C32(0x22dbd37b), - SPH_C32(0xf3db28d7), SPH_C32(0xe3c61000), SPH_C32(0x7a6428ad), - SPH_C32(0xff44f524), SPH_C32(0xbf0adc53) }, - { SPH_C32(0x88243800), SPH_C32(0x56d8ad15), SPH_C32(0x535ef9bc), - SPH_C32(0x5564b741), SPH_C32(0x024d1000), SPH_C32(0x2e3da0d0), - SPH_C32(0x405676f7), SPH_C32(0xa46cb620) }, - { SPH_C32(0xb79d3000), SPH_C32(0x2a027596), SPH_C32(0x9dc950a8), - SPH_C32(0xe8bd42a4), SPH_C32(0xdc7f1800), SPH_C32(0x06bef02e), - SPH_C32(0x31d35c30), SPH_C32(0x02d329b6) }, - { SPH_C32(0x69af3800), SPH_C32(0x02812568), SPH_C32(0xec4c7a6f), - SPH_C32(0x4e02dd32), SPH_C32(0x3df41800), SPH_C32(0x52e77853), - SPH_C32(0x8ec1dfe3), SPH_C32(0x19b543c5) } -}; - -static const sph_u32 T256_10[32][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x734c0000), SPH_C32(0x956fa7d6), SPH_C32(0xa29d1297), - SPH_C32(0x6ee56854), SPH_C32(0xc4e80100), SPH_C32(0x1f70960e), - SPH_C32(0x2714ca3c), SPH_C32(0x88210c30) }, - { SPH_C32(0xa7b80200), SPH_C32(0x1f128433), SPH_C32(0x60e5f9f2), - SPH_C32(0x9e147576), SPH_C32(0xee260000), SPH_C32(0x124b683e), - SPH_C32(0x80c2d68f), SPH_C32(0x3bf3ab2c) }, - { SPH_C32(0xd4f40200), SPH_C32(0x8a7d23e5), SPH_C32(0xc278eb65), - SPH_C32(0xf0f11d22), SPH_C32(0x2ace0100), SPH_C32(0x0d3bfe30), - SPH_C32(0xa7d61cb3), SPH_C32(0xb3d2a71c) }, - { SPH_C32(0xee260000), SPH_C32(0x124b683e), SPH_C32(0x80c2d68f), - SPH_C32(0x3bf3ab2c), SPH_C32(0x499e0200), SPH_C32(0x0d59ec0d), - SPH_C32(0xe0272f7d), SPH_C32(0xa5e7de5a) }, - { SPH_C32(0x9d6a0000), SPH_C32(0x8724cfe8), SPH_C32(0x225fc418), - SPH_C32(0x5516c378), SPH_C32(0x8d760300), SPH_C32(0x12297a03), - SPH_C32(0xc733e541), SPH_C32(0x2dc6d26a) }, - { SPH_C32(0x499e0200), SPH_C32(0x0d59ec0d), SPH_C32(0xe0272f7d), - SPH_C32(0xa5e7de5a), SPH_C32(0xa7b80200), SPH_C32(0x1f128433), - SPH_C32(0x60e5f9f2), SPH_C32(0x9e147576) }, - { SPH_C32(0x3ad20200), SPH_C32(0x98364bdb), SPH_C32(0x42ba3dea), - SPH_C32(0xcb02b60e), SPH_C32(0x63500300), SPH_C32(0x0062123d), - SPH_C32(0x47f133ce), SPH_C32(0x16357946) }, - { SPH_C32(0x8f3e0400), SPH_C32(0x0d9dc877), SPH_C32(0x6fc548e1), - SPH_C32(0x898d2cd6), SPH_C32(0x14bd0000), SPH_C32(0x2fba37ff), - SPH_C32(0x6a72e5bb), SPH_C32(0x247febe6) }, - { SPH_C32(0xfc720400), SPH_C32(0x98f26fa1), SPH_C32(0xcd585a76), - SPH_C32(0xe7684482), SPH_C32(0xd0550100), SPH_C32(0x30caa1f1), - SPH_C32(0x4d662f87), SPH_C32(0xac5ee7d6) }, - { SPH_C32(0x28860600), SPH_C32(0x128f4c44), SPH_C32(0x0f20b113), - SPH_C32(0x179959a0), SPH_C32(0xfa9b0000), SPH_C32(0x3df15fc1), - SPH_C32(0xeab03334), SPH_C32(0x1f8c40ca) }, - { SPH_C32(0x5bca0600), SPH_C32(0x87e0eb92), SPH_C32(0xadbda384), - SPH_C32(0x797c31f4), SPH_C32(0x3e730100), SPH_C32(0x2281c9cf), - SPH_C32(0xcda4f908), SPH_C32(0x97ad4cfa) }, - { SPH_C32(0x61180400), SPH_C32(0x1fd6a049), SPH_C32(0xef079e6e), - SPH_C32(0xb27e87fa), SPH_C32(0x5d230200), SPH_C32(0x22e3dbf2), - SPH_C32(0x8a55cac6), SPH_C32(0x819835bc) }, - { SPH_C32(0x12540400), SPH_C32(0x8ab9079f), SPH_C32(0x4d9a8cf9), - SPH_C32(0xdc9befae), SPH_C32(0x99cb0300), SPH_C32(0x3d934dfc), - SPH_C32(0xad4100fa), SPH_C32(0x09b9398c) }, - { SPH_C32(0xc6a00600), SPH_C32(0x00c4247a), SPH_C32(0x8fe2679c), - SPH_C32(0x2c6af28c), SPH_C32(0xb3050200), SPH_C32(0x30a8b3cc), - SPH_C32(0x0a971c49), SPH_C32(0xba6b9e90) }, - { SPH_C32(0xb5ec0600), SPH_C32(0x95ab83ac), SPH_C32(0x2d7f750b), - SPH_C32(0x428f9ad8), SPH_C32(0x77ed0300), SPH_C32(0x2fd825c2), - SPH_C32(0x2d83d675), SPH_C32(0x324a92a0) }, - { SPH_C32(0x14bd0000), SPH_C32(0x2fba37ff), SPH_C32(0x6a72e5bb), - SPH_C32(0x247febe6), SPH_C32(0x9b830400), SPH_C32(0x2227ff88), - SPH_C32(0x05b7ad5a), SPH_C32(0xadf2c730) }, - { SPH_C32(0x67f10000), SPH_C32(0xbad59029), SPH_C32(0xc8eff72c), - SPH_C32(0x4a9a83b2), SPH_C32(0x5f6b0500), SPH_C32(0x3d576986), - SPH_C32(0x22a36766), SPH_C32(0x25d3cb00) }, - { SPH_C32(0xb3050200), SPH_C32(0x30a8b3cc), SPH_C32(0x0a971c49), - SPH_C32(0xba6b9e90), SPH_C32(0x75a50400), SPH_C32(0x306c97b6), - SPH_C32(0x85757bd5), SPH_C32(0x96016c1c) }, - { SPH_C32(0xc0490200), SPH_C32(0xa5c7141a), SPH_C32(0xa80a0ede), - SPH_C32(0xd48ef6c4), SPH_C32(0xb14d0500), SPH_C32(0x2f1c01b8), - SPH_C32(0xa261b1e9), SPH_C32(0x1e20602c) }, - { SPH_C32(0xfa9b0000), SPH_C32(0x3df15fc1), SPH_C32(0xeab03334), - SPH_C32(0x1f8c40ca), SPH_C32(0xd21d0600), SPH_C32(0x2f7e1385), - SPH_C32(0xe5908227), SPH_C32(0x0815196a) }, - { SPH_C32(0x89d70000), SPH_C32(0xa89ef817), SPH_C32(0x482d21a3), - SPH_C32(0x7169289e), SPH_C32(0x16f50700), SPH_C32(0x300e858b), - SPH_C32(0xc284481b), SPH_C32(0x8034155a) }, - { SPH_C32(0x5d230200), SPH_C32(0x22e3dbf2), SPH_C32(0x8a55cac6), - SPH_C32(0x819835bc), SPH_C32(0x3c3b0600), SPH_C32(0x3d357bbb), - SPH_C32(0x655254a8), SPH_C32(0x33e6b246) }, - { SPH_C32(0x2e6f0200), SPH_C32(0xb78c7c24), SPH_C32(0x28c8d851), - SPH_C32(0xef7d5de8), SPH_C32(0xf8d30700), SPH_C32(0x2245edb5), - SPH_C32(0x42469e94), SPH_C32(0xbbc7be76) }, - { SPH_C32(0x9b830400), SPH_C32(0x2227ff88), SPH_C32(0x05b7ad5a), - SPH_C32(0xadf2c730), SPH_C32(0x8f3e0400), SPH_C32(0x0d9dc877), - SPH_C32(0x6fc548e1), SPH_C32(0x898d2cd6) }, - { SPH_C32(0xe8cf0400), SPH_C32(0xb748585e), SPH_C32(0xa72abfcd), - SPH_C32(0xc317af64), SPH_C32(0x4bd60500), SPH_C32(0x12ed5e79), - SPH_C32(0x48d182dd), SPH_C32(0x01ac20e6) }, - { SPH_C32(0x3c3b0600), SPH_C32(0x3d357bbb), SPH_C32(0x655254a8), - SPH_C32(0x33e6b246), SPH_C32(0x61180400), SPH_C32(0x1fd6a049), - SPH_C32(0xef079e6e), SPH_C32(0xb27e87fa) }, - { SPH_C32(0x4f770600), SPH_C32(0xa85adc6d), SPH_C32(0xc7cf463f), - SPH_C32(0x5d03da12), SPH_C32(0xa5f00500), SPH_C32(0x00a63647), - SPH_C32(0xc8135452), SPH_C32(0x3a5f8bca) }, - { SPH_C32(0x75a50400), SPH_C32(0x306c97b6), SPH_C32(0x85757bd5), - SPH_C32(0x96016c1c), SPH_C32(0xc6a00600), SPH_C32(0x00c4247a), - SPH_C32(0x8fe2679c), SPH_C32(0x2c6af28c) }, - { SPH_C32(0x06e90400), SPH_C32(0xa5033060), SPH_C32(0x27e86942), - SPH_C32(0xf8e40448), SPH_C32(0x02480700), SPH_C32(0x1fb4b274), - SPH_C32(0xa8f6ada0), SPH_C32(0xa44bfebc) }, - { SPH_C32(0xd21d0600), SPH_C32(0x2f7e1385), SPH_C32(0xe5908227), - SPH_C32(0x0815196a), SPH_C32(0x28860600), SPH_C32(0x128f4c44), - SPH_C32(0x0f20b113), SPH_C32(0x179959a0) }, - { SPH_C32(0xa1510600), SPH_C32(0xba11b453), SPH_C32(0x470d90b0), - SPH_C32(0x66f0713e), SPH_C32(0xec6e0700), SPH_C32(0x0dffda4a), - SPH_C32(0x28347b2f), SPH_C32(0x9fb85590) } -}; - -static const sph_u32 T256_15[32][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x4dce0040), SPH_C32(0x3b5bec7e), SPH_C32(0x36656ba8), - SPH_C32(0x23633a05), SPH_C32(0x78ab0000), SPH_C32(0xa0cd5a34), - SPH_C32(0x5d5ca0f7), SPH_C32(0x727784cb) }, - { SPH_C32(0x78ab0000), SPH_C32(0xa0cd5a34), SPH_C32(0x5d5ca0f7), - SPH_C32(0x727784cb), SPH_C32(0x35650040), SPH_C32(0x9b96b64a), - SPH_C32(0x6b39cb5f), SPH_C32(0x5114bece) }, - { SPH_C32(0x35650040), SPH_C32(0x9b96b64a), SPH_C32(0x6b39cb5f), - SPH_C32(0x5114bece), SPH_C32(0x4dce0040), SPH_C32(0x3b5bec7e), - SPH_C32(0x36656ba8), SPH_C32(0x23633a05) }, - { SPH_C32(0x5bd20080), SPH_C32(0x450f18ec), SPH_C32(0xc2c46c55), - SPH_C32(0xf362b233), SPH_C32(0x39a60000), SPH_C32(0x4ab753eb), - SPH_C32(0xd14e094b), SPH_C32(0xb772b42b) }, - { SPH_C32(0x161c00c0), SPH_C32(0x7e54f492), SPH_C32(0xf4a107fd), - SPH_C32(0xd0018836), SPH_C32(0x410d0000), SPH_C32(0xea7a09df), - SPH_C32(0x8c12a9bc), SPH_C32(0xc50530e0) }, - { SPH_C32(0x23790080), SPH_C32(0xe5c242d8), SPH_C32(0x9f98cca2), - SPH_C32(0x811536f8), SPH_C32(0x0cc30040), SPH_C32(0xd121e5a1), - SPH_C32(0xba77c214), SPH_C32(0xe6660ae5) }, - { SPH_C32(0x6eb700c0), SPH_C32(0xde99aea6), SPH_C32(0xa9fda70a), - SPH_C32(0xa2760cfd), SPH_C32(0x74680040), SPH_C32(0x71ecbf95), - SPH_C32(0xe72b62e3), SPH_C32(0x94118e2e) }, - { SPH_C32(0x39a60000), SPH_C32(0x4ab753eb), SPH_C32(0xd14e094b), - SPH_C32(0xb772b42b), SPH_C32(0x62740080), SPH_C32(0x0fb84b07), - SPH_C32(0x138a651e), SPH_C32(0x44100618) }, - { SPH_C32(0x74680040), SPH_C32(0x71ecbf95), SPH_C32(0xe72b62e3), - SPH_C32(0x94118e2e), SPH_C32(0x1adf0080), SPH_C32(0xaf751133), - SPH_C32(0x4ed6c5e9), SPH_C32(0x366782d3) }, - { SPH_C32(0x410d0000), SPH_C32(0xea7a09df), SPH_C32(0x8c12a9bc), - SPH_C32(0xc50530e0), SPH_C32(0x571100c0), SPH_C32(0x942efd4d), - SPH_C32(0x78b3ae41), SPH_C32(0x1504b8d6) }, - { SPH_C32(0x0cc30040), SPH_C32(0xd121e5a1), SPH_C32(0xba77c214), - SPH_C32(0xe6660ae5), SPH_C32(0x2fba00c0), SPH_C32(0x34e3a779), - SPH_C32(0x25ef0eb6), SPH_C32(0x67733c1d) }, - { SPH_C32(0x62740080), SPH_C32(0x0fb84b07), SPH_C32(0x138a651e), - SPH_C32(0x44100618), SPH_C32(0x5bd20080), SPH_C32(0x450f18ec), - SPH_C32(0xc2c46c55), SPH_C32(0xf362b233) }, - { SPH_C32(0x2fba00c0), SPH_C32(0x34e3a779), SPH_C32(0x25ef0eb6), - SPH_C32(0x67733c1d), SPH_C32(0x23790080), SPH_C32(0xe5c242d8), - SPH_C32(0x9f98cca2), SPH_C32(0x811536f8) }, - { SPH_C32(0x1adf0080), SPH_C32(0xaf751133), SPH_C32(0x4ed6c5e9), - SPH_C32(0x366782d3), SPH_C32(0x6eb700c0), SPH_C32(0xde99aea6), - SPH_C32(0xa9fda70a), SPH_C32(0xa2760cfd) }, - { SPH_C32(0x571100c0), SPH_C32(0x942efd4d), SPH_C32(0x78b3ae41), - SPH_C32(0x1504b8d6), SPH_C32(0x161c00c0), SPH_C32(0x7e54f492), - SPH_C32(0xf4a107fd), SPH_C32(0xd0018836) }, - { SPH_C32(0xb7a40100), SPH_C32(0x8a1f31d8), SPH_C32(0x8589d8ab), - SPH_C32(0xe6c46464), SPH_C32(0x734c0000), SPH_C32(0x956fa7d6), - SPH_C32(0xa29d1297), SPH_C32(0x6ee56854) }, - { SPH_C32(0xfa6a0140), SPH_C32(0xb144dda6), SPH_C32(0xb3ecb303), - SPH_C32(0xc5a75e61), SPH_C32(0x0be70000), SPH_C32(0x35a2fde2), - SPH_C32(0xffc1b260), SPH_C32(0x1c92ec9f) }, - { SPH_C32(0xcf0f0100), SPH_C32(0x2ad26bec), SPH_C32(0xd8d5785c), - SPH_C32(0x94b3e0af), SPH_C32(0x46290040), SPH_C32(0x0ef9119c), - SPH_C32(0xc9a4d9c8), SPH_C32(0x3ff1d69a) }, - { SPH_C32(0x82c10140), SPH_C32(0x11898792), SPH_C32(0xeeb013f4), - SPH_C32(0xb7d0daaa), SPH_C32(0x3e820040), SPH_C32(0xae344ba8), - SPH_C32(0x94f8793f), SPH_C32(0x4d865251) }, - { SPH_C32(0xec760180), SPH_C32(0xcf102934), SPH_C32(0x474db4fe), - SPH_C32(0x15a6d657), SPH_C32(0x4aea0000), SPH_C32(0xdfd8f43d), - SPH_C32(0x73d31bdc), SPH_C32(0xd997dc7f) }, - { SPH_C32(0xa1b801c0), SPH_C32(0xf44bc54a), SPH_C32(0x7128df56), - SPH_C32(0x36c5ec52), SPH_C32(0x32410000), SPH_C32(0x7f15ae09), - SPH_C32(0x2e8fbb2b), SPH_C32(0xabe058b4) }, - { SPH_C32(0x94dd0180), SPH_C32(0x6fdd7300), SPH_C32(0x1a111409), - SPH_C32(0x67d1529c), SPH_C32(0x7f8f0040), SPH_C32(0x444e4277), - SPH_C32(0x18ead083), SPH_C32(0x888362b1) }, - { SPH_C32(0xd91301c0), SPH_C32(0x54869f7e), SPH_C32(0x2c747fa1), - SPH_C32(0x44b26899), SPH_C32(0x07240040), SPH_C32(0xe4831843), - SPH_C32(0x45b67074), SPH_C32(0xfaf4e67a) }, - { SPH_C32(0x8e020100), SPH_C32(0xc0a86233), SPH_C32(0x54c7d1e0), - SPH_C32(0x51b6d04f), SPH_C32(0x11380080), SPH_C32(0x9ad7ecd1), - SPH_C32(0xb1177789), SPH_C32(0x2af56e4c) }, - { SPH_C32(0xc3cc0140), SPH_C32(0xfbf38e4d), SPH_C32(0x62a2ba48), - SPH_C32(0x72d5ea4a), SPH_C32(0x69930080), SPH_C32(0x3a1ab6e5), - SPH_C32(0xec4bd77e), SPH_C32(0x5882ea87) }, - { SPH_C32(0xf6a90100), SPH_C32(0x60653807), SPH_C32(0x099b7117), - SPH_C32(0x23c15484), SPH_C32(0x245d00c0), SPH_C32(0x01415a9b), - SPH_C32(0xda2ebcd6), SPH_C32(0x7be1d082) }, - { SPH_C32(0xbb670140), SPH_C32(0x5b3ed479), SPH_C32(0x3ffe1abf), - SPH_C32(0x00a26e81), SPH_C32(0x5cf600c0), SPH_C32(0xa18c00af), - SPH_C32(0x87721c21), SPH_C32(0x09965449) }, - { SPH_C32(0xd5d00180), SPH_C32(0x85a77adf), SPH_C32(0x9603bdb5), - SPH_C32(0xa2d4627c), SPH_C32(0x289e0080), SPH_C32(0xd060bf3a), - SPH_C32(0x60597ec2), SPH_C32(0x9d87da67) }, - { SPH_C32(0x981e01c0), SPH_C32(0xbefc96a1), SPH_C32(0xa066d61d), - SPH_C32(0x81b75879), SPH_C32(0x50350080), SPH_C32(0x70ade50e), - SPH_C32(0x3d05de35), SPH_C32(0xeff05eac) }, - { SPH_C32(0xad7b0180), SPH_C32(0x256a20eb), SPH_C32(0xcb5f1d42), - SPH_C32(0xd0a3e6b7), SPH_C32(0x1dfb00c0), SPH_C32(0x4bf60970), - SPH_C32(0x0b60b59d), SPH_C32(0xcc9364a9) }, - { SPH_C32(0xe0b501c0), SPH_C32(0x1e31cc95), SPH_C32(0xfd3a76ea), - SPH_C32(0xf3c0dcb2), SPH_C32(0x655000c0), SPH_C32(0xeb3b5344), - SPH_C32(0x563c156a), SPH_C32(0xbee4e062) } -}; - -static const sph_u32 T256_20[32][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x171c0000), SPH_C32(0xb26e3344), SPH_C32(0x9e6a837e), - SPH_C32(0x58f8485f), SPH_C32(0xbfb20008), SPH_C32(0x92170a39), - SPH_C32(0x6019107f), SPH_C32(0xe051606e) }, - { SPH_C32(0x515c0010), SPH_C32(0x40f372fb), SPH_C32(0xfce72602), - SPH_C32(0x71575061), SPH_C32(0x2e390000), SPH_C32(0x64dd6689), - SPH_C32(0x3cd406fc), SPH_C32(0xb1f490bc) }, - { SPH_C32(0x46400010), SPH_C32(0xf29d41bf), SPH_C32(0x628da57c), - SPH_C32(0x29af183e), SPH_C32(0x918b0008), SPH_C32(0xf6ca6cb0), - SPH_C32(0x5ccd1683), SPH_C32(0x51a5f0d2) }, - { SPH_C32(0x2e390000), SPH_C32(0x64dd6689), SPH_C32(0x3cd406fc), - SPH_C32(0xb1f490bc), SPH_C32(0x7f650010), SPH_C32(0x242e1472), - SPH_C32(0xc03320fe), SPH_C32(0xc0a3c0dd) }, - { SPH_C32(0x39250000), SPH_C32(0xd6b355cd), SPH_C32(0xa2be8582), - SPH_C32(0xe90cd8e3), SPH_C32(0xc0d70018), SPH_C32(0xb6391e4b), - SPH_C32(0xa02a3081), SPH_C32(0x20f2a0b3) }, - { SPH_C32(0x7f650010), SPH_C32(0x242e1472), SPH_C32(0xc03320fe), - SPH_C32(0xc0a3c0dd), SPH_C32(0x515c0010), SPH_C32(0x40f372fb), - SPH_C32(0xfce72602), SPH_C32(0x71575061) }, - { SPH_C32(0x68790010), SPH_C32(0x96402736), SPH_C32(0x5e59a380), - SPH_C32(0x985b8882), SPH_C32(0xeeee0018), SPH_C32(0xd2e478c2), - SPH_C32(0x9cfe367d), SPH_C32(0x9106300f) }, - { SPH_C32(0xa2b80020), SPH_C32(0x81e7e5f6), SPH_C32(0xf9ce4c04), - SPH_C32(0xe2afa0c0), SPH_C32(0x5c720000), SPH_C32(0xc9bacd12), - SPH_C32(0x79a90df9), SPH_C32(0x63e92178) }, - { SPH_C32(0xb5a40020), SPH_C32(0x3389d6b2), SPH_C32(0x67a4cf7a), - SPH_C32(0xba57e89f), SPH_C32(0xe3c00008), SPH_C32(0x5badc72b), - SPH_C32(0x19b01d86), SPH_C32(0x83b84116) }, - { SPH_C32(0xf3e40030), SPH_C32(0xc114970d), SPH_C32(0x05296a06), - SPH_C32(0x93f8f0a1), SPH_C32(0x724b0000), SPH_C32(0xad67ab9b), - SPH_C32(0x457d0b05), SPH_C32(0xd21db1c4) }, - { SPH_C32(0xe4f80030), SPH_C32(0x737aa449), SPH_C32(0x9b43e978), - SPH_C32(0xcb00b8fe), SPH_C32(0xcdf90008), SPH_C32(0x3f70a1a2), - SPH_C32(0x25641b7a), SPH_C32(0x324cd1aa) }, - { SPH_C32(0x8c810020), SPH_C32(0xe53a837f), SPH_C32(0xc51a4af8), - SPH_C32(0x535b307c), SPH_C32(0x23170010), SPH_C32(0xed94d960), - SPH_C32(0xb99a2d07), SPH_C32(0xa34ae1a5) }, - { SPH_C32(0x9b9d0020), SPH_C32(0x5754b03b), SPH_C32(0x5b70c986), - SPH_C32(0x0ba37823), SPH_C32(0x9ca50018), SPH_C32(0x7f83d359), - SPH_C32(0xd9833d78), SPH_C32(0x431b81cb) }, - { SPH_C32(0xdddd0030), SPH_C32(0xa5c9f184), SPH_C32(0x39fd6cfa), - SPH_C32(0x220c601d), SPH_C32(0x0d2e0010), SPH_C32(0x8949bfe9), - SPH_C32(0x854e2bfb), SPH_C32(0x12be7119) }, - { SPH_C32(0xcac10030), SPH_C32(0x17a7c2c0), SPH_C32(0xa797ef84), - SPH_C32(0x7af42842), SPH_C32(0xb29c0018), SPH_C32(0x1b5eb5d0), - SPH_C32(0xe5573b84), SPH_C32(0xf2ef1177) }, - { SPH_C32(0x5c720000), SPH_C32(0xc9bacd12), SPH_C32(0x79a90df9), - SPH_C32(0x63e92178), SPH_C32(0xfeca0020), SPH_C32(0x485d28e4), - SPH_C32(0x806741fd), SPH_C32(0x814681b8) }, - { SPH_C32(0x4b6e0000), SPH_C32(0x7bd4fe56), SPH_C32(0xe7c38e87), - SPH_C32(0x3b116927), SPH_C32(0x41780028), SPH_C32(0xda4a22dd), - SPH_C32(0xe07e5182), SPH_C32(0x6117e1d6) }, - { SPH_C32(0x0d2e0010), SPH_C32(0x8949bfe9), SPH_C32(0x854e2bfb), - SPH_C32(0x12be7119), SPH_C32(0xd0f30020), SPH_C32(0x2c804e6d), - SPH_C32(0xbcb34701), SPH_C32(0x30b21104) }, - { SPH_C32(0x1a320010), SPH_C32(0x3b278cad), SPH_C32(0x1b24a885), - SPH_C32(0x4a463946), SPH_C32(0x6f410028), SPH_C32(0xbe974454), - SPH_C32(0xdcaa577e), SPH_C32(0xd0e3716a) }, - { SPH_C32(0x724b0000), SPH_C32(0xad67ab9b), SPH_C32(0x457d0b05), - SPH_C32(0xd21db1c4), SPH_C32(0x81af0030), SPH_C32(0x6c733c96), - SPH_C32(0x40546103), SPH_C32(0x41e54165) }, - { SPH_C32(0x65570000), SPH_C32(0x1f0998df), SPH_C32(0xdb17887b), - SPH_C32(0x8ae5f99b), SPH_C32(0x3e1d0038), SPH_C32(0xfe6436af), - SPH_C32(0x204d717c), SPH_C32(0xa1b4210b) }, - { SPH_C32(0x23170010), SPH_C32(0xed94d960), SPH_C32(0xb99a2d07), - SPH_C32(0xa34ae1a5), SPH_C32(0xaf960030), SPH_C32(0x08ae5a1f), - SPH_C32(0x7c8067ff), SPH_C32(0xf011d1d9) }, - { SPH_C32(0x340b0010), SPH_C32(0x5ffaea24), SPH_C32(0x27f0ae79), - SPH_C32(0xfbb2a9fa), SPH_C32(0x10240038), SPH_C32(0x9ab95026), - SPH_C32(0x1c997780), SPH_C32(0x1040b1b7) }, - { SPH_C32(0xfeca0020), SPH_C32(0x485d28e4), SPH_C32(0x806741fd), - SPH_C32(0x814681b8), SPH_C32(0xa2b80020), SPH_C32(0x81e7e5f6), - SPH_C32(0xf9ce4c04), SPH_C32(0xe2afa0c0) }, - { SPH_C32(0xe9d60020), SPH_C32(0xfa331ba0), SPH_C32(0x1e0dc283), - SPH_C32(0xd9bec9e7), SPH_C32(0x1d0a0028), SPH_C32(0x13f0efcf), - SPH_C32(0x99d75c7b), SPH_C32(0x02fec0ae) }, - { SPH_C32(0xaf960030), SPH_C32(0x08ae5a1f), SPH_C32(0x7c8067ff), - SPH_C32(0xf011d1d9), SPH_C32(0x8c810020), SPH_C32(0xe53a837f), - SPH_C32(0xc51a4af8), SPH_C32(0x535b307c) }, - { SPH_C32(0xb88a0030), SPH_C32(0xbac0695b), SPH_C32(0xe2eae481), - SPH_C32(0xa8e99986), SPH_C32(0x33330028), SPH_C32(0x772d8946), - SPH_C32(0xa5035a87), SPH_C32(0xb30a5012) }, - { SPH_C32(0xd0f30020), SPH_C32(0x2c804e6d), SPH_C32(0xbcb34701), - SPH_C32(0x30b21104), SPH_C32(0xdddd0030), SPH_C32(0xa5c9f184), - SPH_C32(0x39fd6cfa), SPH_C32(0x220c601d) }, - { SPH_C32(0xc7ef0020), SPH_C32(0x9eee7d29), SPH_C32(0x22d9c47f), - SPH_C32(0x684a595b), SPH_C32(0x626f0038), SPH_C32(0x37defbbd), - SPH_C32(0x59e47c85), SPH_C32(0xc25d0073) }, - { SPH_C32(0x81af0030), SPH_C32(0x6c733c96), SPH_C32(0x40546103), - SPH_C32(0x41e54165), SPH_C32(0xf3e40030), SPH_C32(0xc114970d), - SPH_C32(0x05296a06), SPH_C32(0x93f8f0a1) }, - { SPH_C32(0x96b30030), SPH_C32(0xde1d0fd2), SPH_C32(0xde3ee27d), - SPH_C32(0x191d093a), SPH_C32(0x4c560038), SPH_C32(0x53039d34), - SPH_C32(0x65307a79), SPH_C32(0x73a990cf) } -}; - -static const sph_u32 T256_25[32][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x88230002), SPH_C32(0x5fe7a7b3), SPH_C32(0x99e585aa), - SPH_C32(0x8d75f7f1), SPH_C32(0x51ac0000), SPH_C32(0x25e30f14), - SPH_C32(0x79e22a4c), SPH_C32(0x1298bd46) }, - { SPH_C32(0x51ac0000), SPH_C32(0x25e30f14), SPH_C32(0x79e22a4c), - SPH_C32(0x1298bd46), SPH_C32(0xd98f0002), SPH_C32(0x7a04a8a7), - SPH_C32(0xe007afe6), SPH_C32(0x9fed4ab7) }, - { SPH_C32(0xd98f0002), SPH_C32(0x7a04a8a7), SPH_C32(0xe007afe6), - SPH_C32(0x9fed4ab7), SPH_C32(0x88230002), SPH_C32(0x5fe7a7b3), - SPH_C32(0x99e585aa), SPH_C32(0x8d75f7f1) }, - { SPH_C32(0xd0080004), SPH_C32(0x8c768f77), SPH_C32(0x9dc5b050), - SPH_C32(0xaf4a29da), SPH_C32(0x6ba90000), SPH_C32(0x40ebf9aa), - SPH_C32(0x98321c3d), SPH_C32(0x76acc733) }, - { SPH_C32(0x582b0006), SPH_C32(0xd39128c4), SPH_C32(0x042035fa), - SPH_C32(0x223fde2b), SPH_C32(0x3a050000), SPH_C32(0x6508f6be), - SPH_C32(0xe1d03671), SPH_C32(0x64347a75) }, - { SPH_C32(0x81a40004), SPH_C32(0xa9958063), SPH_C32(0xe4279a1c), - SPH_C32(0xbdd2949c), SPH_C32(0xb2260002), SPH_C32(0x3aef510d), - SPH_C32(0x7835b3db), SPH_C32(0xe9418d84) }, - { SPH_C32(0x09870006), SPH_C32(0xf67227d0), SPH_C32(0x7dc21fb6), - SPH_C32(0x30a7636d), SPH_C32(0xe38a0002), SPH_C32(0x1f0c5e19), - SPH_C32(0x01d79997), SPH_C32(0xfbd930c2) }, - { SPH_C32(0x6ba90000), SPH_C32(0x40ebf9aa), SPH_C32(0x98321c3d), - SPH_C32(0x76acc733), SPH_C32(0xbba10004), SPH_C32(0xcc9d76dd), - SPH_C32(0x05f7ac6d), SPH_C32(0xd9e6eee9) }, - { SPH_C32(0xe38a0002), SPH_C32(0x1f0c5e19), SPH_C32(0x01d79997), - SPH_C32(0xfbd930c2), SPH_C32(0xea0d0004), SPH_C32(0xe97e79c9), - SPH_C32(0x7c158621), SPH_C32(0xcb7e53af) }, - { SPH_C32(0x3a050000), SPH_C32(0x6508f6be), SPH_C32(0xe1d03671), - SPH_C32(0x64347a75), SPH_C32(0x622e0006), SPH_C32(0xb699de7a), - SPH_C32(0xe5f0038b), SPH_C32(0x460ba45e) }, - { SPH_C32(0xb2260002), SPH_C32(0x3aef510d), SPH_C32(0x7835b3db), - SPH_C32(0xe9418d84), SPH_C32(0x33820006), SPH_C32(0x937ad16e), - SPH_C32(0x9c1229c7), SPH_C32(0x54931918) }, - { SPH_C32(0xbba10004), SPH_C32(0xcc9d76dd), SPH_C32(0x05f7ac6d), - SPH_C32(0xd9e6eee9), SPH_C32(0xd0080004), SPH_C32(0x8c768f77), - SPH_C32(0x9dc5b050), SPH_C32(0xaf4a29da) }, - { SPH_C32(0x33820006), SPH_C32(0x937ad16e), SPH_C32(0x9c1229c7), - SPH_C32(0x54931918), SPH_C32(0x81a40004), SPH_C32(0xa9958063), - SPH_C32(0xe4279a1c), SPH_C32(0xbdd2949c) }, - { SPH_C32(0xea0d0004), SPH_C32(0xe97e79c9), SPH_C32(0x7c158621), - SPH_C32(0xcb7e53af), SPH_C32(0x09870006), SPH_C32(0xf67227d0), - SPH_C32(0x7dc21fb6), SPH_C32(0x30a7636d) }, - { SPH_C32(0x622e0006), SPH_C32(0xb699de7a), SPH_C32(0xe5f0038b), - SPH_C32(0x460ba45e), SPH_C32(0x582b0006), SPH_C32(0xd39128c4), - SPH_C32(0x042035fa), SPH_C32(0x223fde2b) }, - { SPH_C32(0xa8ae0008), SPH_C32(0x2079397d), SPH_C32(0xfe739301), - SPH_C32(0xb8a92831), SPH_C32(0x171c0000), SPH_C32(0xb26e3344), - SPH_C32(0x9e6a837e), SPH_C32(0x58f8485f) }, - { SPH_C32(0x208d000a), SPH_C32(0x7f9e9ece), SPH_C32(0x679616ab), - SPH_C32(0x35dcdfc0), SPH_C32(0x46b00000), SPH_C32(0x978d3c50), - SPH_C32(0xe788a932), SPH_C32(0x4a60f519) }, - { SPH_C32(0xf9020008), SPH_C32(0x059a3669), SPH_C32(0x8791b94d), - SPH_C32(0xaa319577), SPH_C32(0xce930002), SPH_C32(0xc86a9be3), - SPH_C32(0x7e6d2c98), SPH_C32(0xc71502e8) }, - { SPH_C32(0x7121000a), SPH_C32(0x5a7d91da), SPH_C32(0x1e743ce7), - SPH_C32(0x27446286), SPH_C32(0x9f3f0002), SPH_C32(0xed8994f7), - SPH_C32(0x078f06d4), SPH_C32(0xd58dbfae) }, - { SPH_C32(0x78a6000c), SPH_C32(0xac0fb60a), SPH_C32(0x63b62351), - SPH_C32(0x17e301eb), SPH_C32(0x7cb50000), SPH_C32(0xf285caee), - SPH_C32(0x06589f43), SPH_C32(0x2e548f6c) }, - { SPH_C32(0xf085000e), SPH_C32(0xf3e811b9), SPH_C32(0xfa53a6fb), - SPH_C32(0x9a96f61a), SPH_C32(0x2d190000), SPH_C32(0xd766c5fa), - SPH_C32(0x7fbab50f), SPH_C32(0x3ccc322a) }, - { SPH_C32(0x290a000c), SPH_C32(0x89ecb91e), SPH_C32(0x1a54091d), - SPH_C32(0x057bbcad), SPH_C32(0xa53a0002), SPH_C32(0x88816249), - SPH_C32(0xe65f30a5), SPH_C32(0xb1b9c5db) }, - { SPH_C32(0xa129000e), SPH_C32(0xd60b1ead), SPH_C32(0x83b18cb7), - SPH_C32(0x880e4b5c), SPH_C32(0xf4960002), SPH_C32(0xad626d5d), - SPH_C32(0x9fbd1ae9), SPH_C32(0xa321789d) }, - { SPH_C32(0xc3070008), SPH_C32(0x6092c0d7), SPH_C32(0x66418f3c), - SPH_C32(0xce05ef02), SPH_C32(0xacbd0004), SPH_C32(0x7ef34599), - SPH_C32(0x9b9d2f13), SPH_C32(0x811ea6b6) }, - { SPH_C32(0x4b24000a), SPH_C32(0x3f756764), SPH_C32(0xffa40a96), - SPH_C32(0x437018f3), SPH_C32(0xfd110004), SPH_C32(0x5b104a8d), - SPH_C32(0xe27f055f), SPH_C32(0x93861bf0) }, - { SPH_C32(0x92ab0008), SPH_C32(0x4571cfc3), SPH_C32(0x1fa3a570), - SPH_C32(0xdc9d5244), SPH_C32(0x75320006), SPH_C32(0x04f7ed3e), - SPH_C32(0x7b9a80f5), SPH_C32(0x1ef3ec01) }, - { SPH_C32(0x1a88000a), SPH_C32(0x1a966870), SPH_C32(0x864620da), - SPH_C32(0x51e8a5b5), SPH_C32(0x249e0006), SPH_C32(0x2114e22a), - SPH_C32(0x0278aab9), SPH_C32(0x0c6b5147) }, - { SPH_C32(0x130f000c), SPH_C32(0xece44fa0), SPH_C32(0xfb843f6c), - SPH_C32(0x614fc6d8), SPH_C32(0xc7140004), SPH_C32(0x3e18bc33), - SPH_C32(0x03af332e), SPH_C32(0xf7b26185) }, - { SPH_C32(0x9b2c000e), SPH_C32(0xb303e813), SPH_C32(0x6261bac6), - SPH_C32(0xec3a3129), SPH_C32(0x96b80004), SPH_C32(0x1bfbb327), - SPH_C32(0x7a4d1962), SPH_C32(0xe52adcc3) }, - { SPH_C32(0x42a3000c), SPH_C32(0xc90740b4), SPH_C32(0x82661520), - SPH_C32(0x73d77b9e), SPH_C32(0x1e9b0006), SPH_C32(0x441c1494), - SPH_C32(0xe3a89cc8), SPH_C32(0x685f2b32) }, - { SPH_C32(0xca80000e), SPH_C32(0x96e0e707), SPH_C32(0x1b83908a), - SPH_C32(0xfea28c6f), SPH_C32(0x4f370006), SPH_C32(0x61ff1b80), - SPH_C32(0x9a4ab684), SPH_C32(0x7ac79674) } -}; - -static const sph_u32 T256_30[4][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xc04e0001), SPH_C32(0x33b9c010), SPH_C32(0xae0ebb05), - SPH_C32(0xb5a4c63b), SPH_C32(0xc8f10000), SPH_C32(0x0b2de782), - SPH_C32(0x6bf648a4), SPH_C32(0x539cbdbf) }, - { SPH_C32(0xc8f10000), SPH_C32(0x0b2de782), SPH_C32(0x6bf648a4), - SPH_C32(0x539cbdbf), SPH_C32(0x08bf0001), SPH_C32(0x38942792), - SPH_C32(0xc5f8f3a1), SPH_C32(0xe6387b84) }, - { SPH_C32(0x08bf0001), SPH_C32(0x38942792), SPH_C32(0xc5f8f3a1), - SPH_C32(0xe6387b84), SPH_C32(0xc04e0001), SPH_C32(0x33b9c010), - SPH_C32(0xae0ebb05), SPH_C32(0xb5a4c63b) } -}; - -#define INPUT_SMALL do { \ - unsigned acc = buf[0]; \ - const sph_u32 *rp; \ - rp = &T256_0[acc >> 3][0]; \ - m0 = rp[0]; \ - m1 = rp[1]; \ - m2 = rp[2]; \ - m3 = rp[3]; \ - m4 = rp[4]; \ - m5 = rp[5]; \ - m6 = rp[6]; \ - m7 = rp[7]; \ - acc = (acc << 8) | buf[1]; \ - rp = &T256_5[(acc >> 6) & 0x1f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_10[(acc >> 1) & 0x1f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - acc = (acc << 8) | buf[2]; \ - rp = &T256_15[(acc >> 4) & 0x1f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - acc = (acc << 8) | buf[3]; \ - rp = &T256_20[(acc >> 7) & 0x1f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_25[(acc >> 2) & 0x1f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_30[acc & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - } while (0) - -#endif - -#if SPH_HAMSI_EXPAND_SMALL == 6 - -static const sph_u32 T256_0[64][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xe92a2000), SPH_C32(0xb4578cfc), SPH_C32(0x11fa3a57), - SPH_C32(0x3dc90524), SPH_C32(0x97530000), SPH_C32(0x204f6ed3), - SPH_C32(0x77b9e80f), SPH_C32(0xa1ec5ec1) }, - { SPH_C32(0x97530000), SPH_C32(0x204f6ed3), SPH_C32(0x77b9e80f), - SPH_C32(0xa1ec5ec1), SPH_C32(0x7e792000), SPH_C32(0x9418e22f), - SPH_C32(0x6643d258), SPH_C32(0x9c255be5) }, - { SPH_C32(0x7e792000), SPH_C32(0x9418e22f), SPH_C32(0x6643d258), - SPH_C32(0x9c255be5), SPH_C32(0xe92a2000), SPH_C32(0xb4578cfc), - SPH_C32(0x11fa3a57), SPH_C32(0x3dc90524) }, - { SPH_C32(0x121b4000), SPH_C32(0x5b17d9e8), SPH_C32(0x8dfacfab), - SPH_C32(0xce36cc72), SPH_C32(0xe6570000), SPH_C32(0x4bb33a25), - SPH_C32(0x848598ba), SPH_C32(0x1041003e) }, - { SPH_C32(0xfb316000), SPH_C32(0xef405514), SPH_C32(0x9c00f5fc), - SPH_C32(0xf3ffc956), SPH_C32(0x71040000), SPH_C32(0x6bfc54f6), - SPH_C32(0xf33c70b5), SPH_C32(0xb1ad5eff) }, - { SPH_C32(0x85484000), SPH_C32(0x7b58b73b), SPH_C32(0xfa4327a4), - SPH_C32(0x6fda92b3), SPH_C32(0x982e2000), SPH_C32(0xdfabd80a), - SPH_C32(0xe2c64ae2), SPH_C32(0x8c645bdb) }, - { SPH_C32(0x6c626000), SPH_C32(0xcf0f3bc7), SPH_C32(0xebb91df3), - SPH_C32(0x52139797), SPH_C32(0x0f7d2000), SPH_C32(0xffe4b6d9), - SPH_C32(0x957fa2ed), SPH_C32(0x2d88051a) }, - { SPH_C32(0xe6570000), SPH_C32(0x4bb33a25), SPH_C32(0x848598ba), - SPH_C32(0x1041003e), SPH_C32(0xf44c4000), SPH_C32(0x10a4e3cd), - SPH_C32(0x097f5711), SPH_C32(0xde77cc4c) }, - { SPH_C32(0x0f7d2000), SPH_C32(0xffe4b6d9), SPH_C32(0x957fa2ed), - SPH_C32(0x2d88051a), SPH_C32(0x631f4000), SPH_C32(0x30eb8d1e), - SPH_C32(0x7ec6bf1e), SPH_C32(0x7f9b928d) }, - { SPH_C32(0x71040000), SPH_C32(0x6bfc54f6), SPH_C32(0xf33c70b5), - SPH_C32(0xb1ad5eff), SPH_C32(0x8a356000), SPH_C32(0x84bc01e2), - SPH_C32(0x6f3c8549), SPH_C32(0x425297a9) }, - { SPH_C32(0x982e2000), SPH_C32(0xdfabd80a), SPH_C32(0xe2c64ae2), - SPH_C32(0x8c645bdb), SPH_C32(0x1d666000), SPH_C32(0xa4f36f31), - SPH_C32(0x18856d46), SPH_C32(0xe3bec968) }, - { SPH_C32(0xf44c4000), SPH_C32(0x10a4e3cd), SPH_C32(0x097f5711), - SPH_C32(0xde77cc4c), SPH_C32(0x121b4000), SPH_C32(0x5b17d9e8), - SPH_C32(0x8dfacfab), SPH_C32(0xce36cc72) }, - { SPH_C32(0x1d666000), SPH_C32(0xa4f36f31), SPH_C32(0x18856d46), - SPH_C32(0xe3bec968), SPH_C32(0x85484000), SPH_C32(0x7b58b73b), - SPH_C32(0xfa4327a4), SPH_C32(0x6fda92b3) }, - { SPH_C32(0x631f4000), SPH_C32(0x30eb8d1e), SPH_C32(0x7ec6bf1e), - SPH_C32(0x7f9b928d), SPH_C32(0x6c626000), SPH_C32(0xcf0f3bc7), - SPH_C32(0xebb91df3), SPH_C32(0x52139797) }, - { SPH_C32(0x8a356000), SPH_C32(0x84bc01e2), SPH_C32(0x6f3c8549), - SPH_C32(0x425297a9), SPH_C32(0xfb316000), SPH_C32(0xef405514), - SPH_C32(0x9c00f5fc), SPH_C32(0xf3ffc956) }, - { SPH_C32(0xe4788000), SPH_C32(0x859673c1), SPH_C32(0xb5fb2452), - SPH_C32(0x29cc5edf), SPH_C32(0x045f0000), SPH_C32(0x9c4a93c9), - SPH_C32(0x62fc79d0), SPH_C32(0x731ebdc2) }, - { SPH_C32(0x0d52a000), SPH_C32(0x31c1ff3d), SPH_C32(0xa4011e05), - SPH_C32(0x14055bfb), SPH_C32(0x930c0000), SPH_C32(0xbc05fd1a), - SPH_C32(0x154591df), SPH_C32(0xd2f2e303) }, - { SPH_C32(0x732b8000), SPH_C32(0xa5d91d12), SPH_C32(0xc242cc5d), - SPH_C32(0x8820001e), SPH_C32(0x7a262000), SPH_C32(0x085271e6), - SPH_C32(0x04bfab88), SPH_C32(0xef3be627) }, - { SPH_C32(0x9a01a000), SPH_C32(0x118e91ee), SPH_C32(0xd3b8f60a), - SPH_C32(0xb5e9053a), SPH_C32(0xed752000), SPH_C32(0x281d1f35), - SPH_C32(0x73064387), SPH_C32(0x4ed7b8e6) }, - { SPH_C32(0xf663c000), SPH_C32(0xde81aa29), SPH_C32(0x3801ebf9), - SPH_C32(0xe7fa92ad), SPH_C32(0xe2080000), SPH_C32(0xd7f9a9ec), - SPH_C32(0xe679e16a), SPH_C32(0x635fbdfc) }, - { SPH_C32(0x1f49e000), SPH_C32(0x6ad626d5), SPH_C32(0x29fbd1ae), - SPH_C32(0xda339789), SPH_C32(0x755b0000), SPH_C32(0xf7b6c73f), - SPH_C32(0x91c00965), SPH_C32(0xc2b3e33d) }, - { SPH_C32(0x6130c000), SPH_C32(0xfecec4fa), SPH_C32(0x4fb803f6), - SPH_C32(0x4616cc6c), SPH_C32(0x9c712000), SPH_C32(0x43e14bc3), - SPH_C32(0x803a3332), SPH_C32(0xff7ae619) }, - { SPH_C32(0x881ae000), SPH_C32(0x4a994806), SPH_C32(0x5e4239a1), - SPH_C32(0x7bdfc948), SPH_C32(0x0b222000), SPH_C32(0x63ae2510), - SPH_C32(0xf783db3d), SPH_C32(0x5e96b8d8) }, - { SPH_C32(0x022f8000), SPH_C32(0xce2549e4), SPH_C32(0x317ebce8), - SPH_C32(0x398d5ee1), SPH_C32(0xf0134000), SPH_C32(0x8cee7004), - SPH_C32(0x6b832ec1), SPH_C32(0xad69718e) }, - { SPH_C32(0xeb05a000), SPH_C32(0x7a72c518), SPH_C32(0x208486bf), - SPH_C32(0x04445bc5), SPH_C32(0x67404000), SPH_C32(0xaca11ed7), - SPH_C32(0x1c3ac6ce), SPH_C32(0x0c852f4f) }, - { SPH_C32(0x957c8000), SPH_C32(0xee6a2737), SPH_C32(0x46c754e7), - SPH_C32(0x98610020), SPH_C32(0x8e6a6000), SPH_C32(0x18f6922b), - SPH_C32(0x0dc0fc99), SPH_C32(0x314c2a6b) }, - { SPH_C32(0x7c56a000), SPH_C32(0x5a3dabcb), SPH_C32(0x573d6eb0), - SPH_C32(0xa5a80504), SPH_C32(0x19396000), SPH_C32(0x38b9fcf8), - SPH_C32(0x7a791496), SPH_C32(0x90a074aa) }, - { SPH_C32(0x1034c000), SPH_C32(0x9532900c), SPH_C32(0xbc847343), - SPH_C32(0xf7bb9293), SPH_C32(0x16444000), SPH_C32(0xc75d4a21), - SPH_C32(0xef06b67b), SPH_C32(0xbd2871b0) }, - { SPH_C32(0xf91ee000), SPH_C32(0x21651cf0), SPH_C32(0xad7e4914), - SPH_C32(0xca7297b7), SPH_C32(0x81174000), SPH_C32(0xe71224f2), - SPH_C32(0x98bf5e74), SPH_C32(0x1cc42f71) }, - { SPH_C32(0x8767c000), SPH_C32(0xb57dfedf), SPH_C32(0xcb3d9b4c), - SPH_C32(0x5657cc52), SPH_C32(0x683d6000), SPH_C32(0x5345a80e), - SPH_C32(0x89456423), SPH_C32(0x210d2a55) }, - { SPH_C32(0x6e4de000), SPH_C32(0x012a7223), SPH_C32(0xdac7a11b), - SPH_C32(0x6b9ec976), SPH_C32(0xff6e6000), SPH_C32(0x730ac6dd), - SPH_C32(0xfefc8c2c), SPH_C32(0x80e17494) }, - { SPH_C32(0x045f0000), SPH_C32(0x9c4a93c9), SPH_C32(0x62fc79d0), - SPH_C32(0x731ebdc2), SPH_C32(0xe0278000), SPH_C32(0x19dce008), - SPH_C32(0xd7075d82), SPH_C32(0x5ad2e31d) }, - { SPH_C32(0xed752000), SPH_C32(0x281d1f35), SPH_C32(0x73064387), - SPH_C32(0x4ed7b8e6), SPH_C32(0x77748000), SPH_C32(0x39938edb), - SPH_C32(0xa0beb58d), SPH_C32(0xfb3ebddc) }, - { SPH_C32(0x930c0000), SPH_C32(0xbc05fd1a), SPH_C32(0x154591df), - SPH_C32(0xd2f2e303), SPH_C32(0x9e5ea000), SPH_C32(0x8dc40227), - SPH_C32(0xb1448fda), SPH_C32(0xc6f7b8f8) }, - { SPH_C32(0x7a262000), SPH_C32(0x085271e6), SPH_C32(0x04bfab88), - SPH_C32(0xef3be627), SPH_C32(0x090da000), SPH_C32(0xad8b6cf4), - SPH_C32(0xc6fd67d5), SPH_C32(0x671be639) }, - { SPH_C32(0x16444000), SPH_C32(0xc75d4a21), SPH_C32(0xef06b67b), - SPH_C32(0xbd2871b0), SPH_C32(0x06708000), SPH_C32(0x526fda2d), - SPH_C32(0x5382c538), SPH_C32(0x4a93e323) }, - { SPH_C32(0xff6e6000), SPH_C32(0x730ac6dd), SPH_C32(0xfefc8c2c), - SPH_C32(0x80e17494), SPH_C32(0x91238000), SPH_C32(0x7220b4fe), - SPH_C32(0x243b2d37), SPH_C32(0xeb7fbde2) }, - { SPH_C32(0x81174000), SPH_C32(0xe71224f2), SPH_C32(0x98bf5e74), - SPH_C32(0x1cc42f71), SPH_C32(0x7809a000), SPH_C32(0xc6773802), - SPH_C32(0x35c11760), SPH_C32(0xd6b6b8c6) }, - { SPH_C32(0x683d6000), SPH_C32(0x5345a80e), SPH_C32(0x89456423), - SPH_C32(0x210d2a55), SPH_C32(0xef5aa000), SPH_C32(0xe63856d1), - SPH_C32(0x4278ff6f), SPH_C32(0x775ae607) }, - { SPH_C32(0xe2080000), SPH_C32(0xd7f9a9ec), SPH_C32(0xe679e16a), - SPH_C32(0x635fbdfc), SPH_C32(0x146bc000), SPH_C32(0x097803c5), - SPH_C32(0xde780a93), SPH_C32(0x84a52f51) }, - { SPH_C32(0x0b222000), SPH_C32(0x63ae2510), SPH_C32(0xf783db3d), - SPH_C32(0x5e96b8d8), SPH_C32(0x8338c000), SPH_C32(0x29376d16), - SPH_C32(0xa9c1e29c), SPH_C32(0x25497190) }, - { SPH_C32(0x755b0000), SPH_C32(0xf7b6c73f), SPH_C32(0x91c00965), - SPH_C32(0xc2b3e33d), SPH_C32(0x6a12e000), SPH_C32(0x9d60e1ea), - SPH_C32(0xb83bd8cb), SPH_C32(0x188074b4) }, - { SPH_C32(0x9c712000), SPH_C32(0x43e14bc3), SPH_C32(0x803a3332), - SPH_C32(0xff7ae619), SPH_C32(0xfd41e000), SPH_C32(0xbd2f8f39), - SPH_C32(0xcf8230c4), SPH_C32(0xb96c2a75) }, - { SPH_C32(0xf0134000), SPH_C32(0x8cee7004), SPH_C32(0x6b832ec1), - SPH_C32(0xad69718e), SPH_C32(0xf23cc000), SPH_C32(0x42cb39e0), - SPH_C32(0x5afd9229), SPH_C32(0x94e42f6f) }, - { SPH_C32(0x19396000), SPH_C32(0x38b9fcf8), SPH_C32(0x7a791496), - SPH_C32(0x90a074aa), SPH_C32(0x656fc000), SPH_C32(0x62845733), - SPH_C32(0x2d447a26), SPH_C32(0x350871ae) }, - { SPH_C32(0x67404000), SPH_C32(0xaca11ed7), SPH_C32(0x1c3ac6ce), - SPH_C32(0x0c852f4f), SPH_C32(0x8c45e000), SPH_C32(0xd6d3dbcf), - SPH_C32(0x3cbe4071), SPH_C32(0x08c1748a) }, - { SPH_C32(0x8e6a6000), SPH_C32(0x18f6922b), SPH_C32(0x0dc0fc99), - SPH_C32(0x314c2a6b), SPH_C32(0x1b16e000), SPH_C32(0xf69cb51c), - SPH_C32(0x4b07a87e), SPH_C32(0xa92d2a4b) }, - { SPH_C32(0xe0278000), SPH_C32(0x19dce008), SPH_C32(0xd7075d82), - SPH_C32(0x5ad2e31d), SPH_C32(0xe4788000), SPH_C32(0x859673c1), - SPH_C32(0xb5fb2452), SPH_C32(0x29cc5edf) }, - { SPH_C32(0x090da000), SPH_C32(0xad8b6cf4), SPH_C32(0xc6fd67d5), - SPH_C32(0x671be639), SPH_C32(0x732b8000), SPH_C32(0xa5d91d12), - SPH_C32(0xc242cc5d), SPH_C32(0x8820001e) }, - { SPH_C32(0x77748000), SPH_C32(0x39938edb), SPH_C32(0xa0beb58d), - SPH_C32(0xfb3ebddc), SPH_C32(0x9a01a000), SPH_C32(0x118e91ee), - SPH_C32(0xd3b8f60a), SPH_C32(0xb5e9053a) }, - { SPH_C32(0x9e5ea000), SPH_C32(0x8dc40227), SPH_C32(0xb1448fda), - SPH_C32(0xc6f7b8f8), SPH_C32(0x0d52a000), SPH_C32(0x31c1ff3d), - SPH_C32(0xa4011e05), SPH_C32(0x14055bfb) }, - { SPH_C32(0xf23cc000), SPH_C32(0x42cb39e0), SPH_C32(0x5afd9229), - SPH_C32(0x94e42f6f), SPH_C32(0x022f8000), SPH_C32(0xce2549e4), - SPH_C32(0x317ebce8), SPH_C32(0x398d5ee1) }, - { SPH_C32(0x1b16e000), SPH_C32(0xf69cb51c), SPH_C32(0x4b07a87e), - SPH_C32(0xa92d2a4b), SPH_C32(0x957c8000), SPH_C32(0xee6a2737), - SPH_C32(0x46c754e7), SPH_C32(0x98610020) }, - { SPH_C32(0x656fc000), SPH_C32(0x62845733), SPH_C32(0x2d447a26), - SPH_C32(0x350871ae), SPH_C32(0x7c56a000), SPH_C32(0x5a3dabcb), - SPH_C32(0x573d6eb0), SPH_C32(0xa5a80504) }, - { SPH_C32(0x8c45e000), SPH_C32(0xd6d3dbcf), SPH_C32(0x3cbe4071), - SPH_C32(0x08c1748a), SPH_C32(0xeb05a000), SPH_C32(0x7a72c518), - SPH_C32(0x208486bf), SPH_C32(0x04445bc5) }, - { SPH_C32(0x06708000), SPH_C32(0x526fda2d), SPH_C32(0x5382c538), - SPH_C32(0x4a93e323), SPH_C32(0x1034c000), SPH_C32(0x9532900c), - SPH_C32(0xbc847343), SPH_C32(0xf7bb9293) }, - { SPH_C32(0xef5aa000), SPH_C32(0xe63856d1), SPH_C32(0x4278ff6f), - SPH_C32(0x775ae607), SPH_C32(0x8767c000), SPH_C32(0xb57dfedf), - SPH_C32(0xcb3d9b4c), SPH_C32(0x5657cc52) }, - { SPH_C32(0x91238000), SPH_C32(0x7220b4fe), SPH_C32(0x243b2d37), - SPH_C32(0xeb7fbde2), SPH_C32(0x6e4de000), SPH_C32(0x012a7223), - SPH_C32(0xdac7a11b), SPH_C32(0x6b9ec976) }, - { SPH_C32(0x7809a000), SPH_C32(0xc6773802), SPH_C32(0x35c11760), - SPH_C32(0xd6b6b8c6), SPH_C32(0xf91ee000), SPH_C32(0x21651cf0), - SPH_C32(0xad7e4914), SPH_C32(0xca7297b7) }, - { SPH_C32(0x146bc000), SPH_C32(0x097803c5), SPH_C32(0xde780a93), - SPH_C32(0x84a52f51), SPH_C32(0xf663c000), SPH_C32(0xde81aa29), - SPH_C32(0x3801ebf9), SPH_C32(0xe7fa92ad) }, - { SPH_C32(0xfd41e000), SPH_C32(0xbd2f8f39), SPH_C32(0xcf8230c4), - SPH_C32(0xb96c2a75), SPH_C32(0x6130c000), SPH_C32(0xfecec4fa), - SPH_C32(0x4fb803f6), SPH_C32(0x4616cc6c) }, - { SPH_C32(0x8338c000), SPH_C32(0x29376d16), SPH_C32(0xa9c1e29c), - SPH_C32(0x25497190), SPH_C32(0x881ae000), SPH_C32(0x4a994806), - SPH_C32(0x5e4239a1), SPH_C32(0x7bdfc948) }, - { SPH_C32(0x6a12e000), SPH_C32(0x9d60e1ea), SPH_C32(0xb83bd8cb), - SPH_C32(0x188074b4), SPH_C32(0x1f49e000), SPH_C32(0x6ad626d5), - SPH_C32(0x29fbd1ae), SPH_C32(0xda339789) } -}; - -static const sph_u32 T256_6[64][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x8f3e0400), SPH_C32(0x0d9dc877), SPH_C32(0x6fc548e1), - SPH_C32(0x898d2cd6), SPH_C32(0x14bd0000), SPH_C32(0x2fba37ff), - SPH_C32(0x6a72e5bb), SPH_C32(0x247febe6) }, - { SPH_C32(0x14bd0000), SPH_C32(0x2fba37ff), SPH_C32(0x6a72e5bb), - SPH_C32(0x247febe6), SPH_C32(0x9b830400), SPH_C32(0x2227ff88), - SPH_C32(0x05b7ad5a), SPH_C32(0xadf2c730) }, - { SPH_C32(0x9b830400), SPH_C32(0x2227ff88), SPH_C32(0x05b7ad5a), - SPH_C32(0xadf2c730), SPH_C32(0x8f3e0400), SPH_C32(0x0d9dc877), - SPH_C32(0x6fc548e1), SPH_C32(0x898d2cd6) }, - { SPH_C32(0xde320800), SPH_C32(0x288350fe), SPH_C32(0x71852ac7), - SPH_C32(0xa6bf9f96), SPH_C32(0xe18b0000), SPH_C32(0x5459887d), - SPH_C32(0xbf1283d3), SPH_C32(0x1b666a73) }, - { SPH_C32(0x510c0c00), SPH_C32(0x251e9889), SPH_C32(0x1e406226), - SPH_C32(0x2f32b340), SPH_C32(0xf5360000), SPH_C32(0x7be3bf82), - SPH_C32(0xd5606668), SPH_C32(0x3f198195) }, - { SPH_C32(0xca8f0800), SPH_C32(0x07396701), SPH_C32(0x1bf7cf7c), - SPH_C32(0x82c07470), SPH_C32(0x7a080400), SPH_C32(0x767e77f5), - SPH_C32(0xbaa52e89), SPH_C32(0xb694ad43) }, - { SPH_C32(0x45b10c00), SPH_C32(0x0aa4af76), SPH_C32(0x7432879d), - SPH_C32(0x0b4d58a6), SPH_C32(0x6eb50400), SPH_C32(0x59c4400a), - SPH_C32(0xd0d7cb32), SPH_C32(0x92eb46a5) }, - { SPH_C32(0xe18b0000), SPH_C32(0x5459887d), SPH_C32(0xbf1283d3), - SPH_C32(0x1b666a73), SPH_C32(0x3fb90800), SPH_C32(0x7cdad883), - SPH_C32(0xce97a914), SPH_C32(0xbdd9f5e5) }, - { SPH_C32(0x6eb50400), SPH_C32(0x59c4400a), SPH_C32(0xd0d7cb32), - SPH_C32(0x92eb46a5), SPH_C32(0x2b040800), SPH_C32(0x5360ef7c), - SPH_C32(0xa4e54caf), SPH_C32(0x99a61e03) }, - { SPH_C32(0xf5360000), SPH_C32(0x7be3bf82), SPH_C32(0xd5606668), - SPH_C32(0x3f198195), SPH_C32(0xa43a0c00), SPH_C32(0x5efd270b), - SPH_C32(0xcb20044e), SPH_C32(0x102b32d5) }, - { SPH_C32(0x7a080400), SPH_C32(0x767e77f5), SPH_C32(0xbaa52e89), - SPH_C32(0xb694ad43), SPH_C32(0xb0870c00), SPH_C32(0x714710f4), - SPH_C32(0xa152e1f5), SPH_C32(0x3454d933) }, - { SPH_C32(0x3fb90800), SPH_C32(0x7cdad883), SPH_C32(0xce97a914), - SPH_C32(0xbdd9f5e5), SPH_C32(0xde320800), SPH_C32(0x288350fe), - SPH_C32(0x71852ac7), SPH_C32(0xa6bf9f96) }, - { SPH_C32(0xb0870c00), SPH_C32(0x714710f4), SPH_C32(0xa152e1f5), - SPH_C32(0x3454d933), SPH_C32(0xca8f0800), SPH_C32(0x07396701), - SPH_C32(0x1bf7cf7c), SPH_C32(0x82c07470) }, - { SPH_C32(0x2b040800), SPH_C32(0x5360ef7c), SPH_C32(0xa4e54caf), - SPH_C32(0x99a61e03), SPH_C32(0x45b10c00), SPH_C32(0x0aa4af76), - SPH_C32(0x7432879d), SPH_C32(0x0b4d58a6) }, - { SPH_C32(0xa43a0c00), SPH_C32(0x5efd270b), SPH_C32(0xcb20044e), - SPH_C32(0x102b32d5), SPH_C32(0x510c0c00), SPH_C32(0x251e9889), - SPH_C32(0x1e406226), SPH_C32(0x2f32b340) }, - { SPH_C32(0x74951000), SPH_C32(0x5a2b467e), SPH_C32(0x88fd1d2b), - SPH_C32(0x1ee68292), SPH_C32(0xcba90000), SPH_C32(0x90273769), - SPH_C32(0xbbdcf407), SPH_C32(0xd0f4af61) }, - { SPH_C32(0xfbab1400), SPH_C32(0x57b68e09), SPH_C32(0xe73855ca), - SPH_C32(0x976bae44), SPH_C32(0xdf140000), SPH_C32(0xbf9d0096), - SPH_C32(0xd1ae11bc), SPH_C32(0xf48b4487) }, - { SPH_C32(0x60281000), SPH_C32(0x75917181), SPH_C32(0xe28ff890), - SPH_C32(0x3a996974), SPH_C32(0x502a0400), SPH_C32(0xb200c8e1), - SPH_C32(0xbe6b595d), SPH_C32(0x7d066851) }, - { SPH_C32(0xef161400), SPH_C32(0x780cb9f6), SPH_C32(0x8d4ab071), - SPH_C32(0xb31445a2), SPH_C32(0x44970400), SPH_C32(0x9dbaff1e), - SPH_C32(0xd419bce6), SPH_C32(0x597983b7) }, - { SPH_C32(0xaaa71800), SPH_C32(0x72a81680), SPH_C32(0xf97837ec), - SPH_C32(0xb8591d04), SPH_C32(0x2a220000), SPH_C32(0xc47ebf14), - SPH_C32(0x04ce77d4), SPH_C32(0xcb92c512) }, - { SPH_C32(0x25991c00), SPH_C32(0x7f35def7), SPH_C32(0x96bd7f0d), - SPH_C32(0x31d431d2), SPH_C32(0x3e9f0000), SPH_C32(0xebc488eb), - SPH_C32(0x6ebc926f), SPH_C32(0xefed2ef4) }, - { SPH_C32(0xbe1a1800), SPH_C32(0x5d12217f), SPH_C32(0x930ad257), - SPH_C32(0x9c26f6e2), SPH_C32(0xb1a10400), SPH_C32(0xe659409c), - SPH_C32(0x0179da8e), SPH_C32(0x66600222) }, - { SPH_C32(0x31241c00), SPH_C32(0x508fe908), SPH_C32(0xfccf9ab6), - SPH_C32(0x15abda34), SPH_C32(0xa51c0400), SPH_C32(0xc9e37763), - SPH_C32(0x6b0b3f35), SPH_C32(0x421fe9c4) }, - { SPH_C32(0x951e1000), SPH_C32(0x0e72ce03), SPH_C32(0x37ef9ef8), - SPH_C32(0x0580e8e1), SPH_C32(0xf4100800), SPH_C32(0xecfdefea), - SPH_C32(0x754b5d13), SPH_C32(0x6d2d5a84) }, - { SPH_C32(0x1a201400), SPH_C32(0x03ef0674), SPH_C32(0x582ad619), - SPH_C32(0x8c0dc437), SPH_C32(0xe0ad0800), SPH_C32(0xc347d815), - SPH_C32(0x1f39b8a8), SPH_C32(0x4952b162) }, - { SPH_C32(0x81a31000), SPH_C32(0x21c8f9fc), SPH_C32(0x5d9d7b43), - SPH_C32(0x21ff0307), SPH_C32(0x6f930c00), SPH_C32(0xceda1062), - SPH_C32(0x70fcf049), SPH_C32(0xc0df9db4) }, - { SPH_C32(0x0e9d1400), SPH_C32(0x2c55318b), SPH_C32(0x325833a2), - SPH_C32(0xa8722fd1), SPH_C32(0x7b2e0c00), SPH_C32(0xe160279d), - SPH_C32(0x1a8e15f2), SPH_C32(0xe4a07652) }, - { SPH_C32(0x4b2c1800), SPH_C32(0x26f19efd), SPH_C32(0x466ab43f), - SPH_C32(0xa33f7777), SPH_C32(0x159b0800), SPH_C32(0xb8a46797), - SPH_C32(0xca59dec0), SPH_C32(0x764b30f7) }, - { SPH_C32(0xc4121c00), SPH_C32(0x2b6c568a), SPH_C32(0x29affcde), - SPH_C32(0x2ab25ba1), SPH_C32(0x01260800), SPH_C32(0x971e5068), - SPH_C32(0xa02b3b7b), SPH_C32(0x5234db11) }, - { SPH_C32(0x5f911800), SPH_C32(0x094ba902), SPH_C32(0x2c185184), - SPH_C32(0x87409c91), SPH_C32(0x8e180c00), SPH_C32(0x9a83981f), - SPH_C32(0xcfee739a), SPH_C32(0xdbb9f7c7) }, - { SPH_C32(0xd0af1c00), SPH_C32(0x04d66175), SPH_C32(0x43dd1965), - SPH_C32(0x0ecdb047), SPH_C32(0x9aa50c00), SPH_C32(0xb539afe0), - SPH_C32(0xa59c9621), SPH_C32(0xffc61c21) }, - { SPH_C32(0xcba90000), SPH_C32(0x90273769), SPH_C32(0xbbdcf407), - SPH_C32(0xd0f4af61), SPH_C32(0xbf3c1000), SPH_C32(0xca0c7117), - SPH_C32(0x3321e92c), SPH_C32(0xce122df3) }, - { SPH_C32(0x44970400), SPH_C32(0x9dbaff1e), SPH_C32(0xd419bce6), - SPH_C32(0x597983b7), SPH_C32(0xab811000), SPH_C32(0xe5b646e8), - SPH_C32(0x59530c97), SPH_C32(0xea6dc615) }, - { SPH_C32(0xdf140000), SPH_C32(0xbf9d0096), SPH_C32(0xd1ae11bc), - SPH_C32(0xf48b4487), SPH_C32(0x24bf1400), SPH_C32(0xe82b8e9f), - SPH_C32(0x36964476), SPH_C32(0x63e0eac3) }, - { SPH_C32(0x502a0400), SPH_C32(0xb200c8e1), SPH_C32(0xbe6b595d), - SPH_C32(0x7d066851), SPH_C32(0x30021400), SPH_C32(0xc791b960), - SPH_C32(0x5ce4a1cd), SPH_C32(0x479f0125) }, - { SPH_C32(0x159b0800), SPH_C32(0xb8a46797), SPH_C32(0xca59dec0), - SPH_C32(0x764b30f7), SPH_C32(0x5eb71000), SPH_C32(0x9e55f96a), - SPH_C32(0x8c336aff), SPH_C32(0xd5744780) }, - { SPH_C32(0x9aa50c00), SPH_C32(0xb539afe0), SPH_C32(0xa59c9621), - SPH_C32(0xffc61c21), SPH_C32(0x4a0a1000), SPH_C32(0xb1efce95), - SPH_C32(0xe6418f44), SPH_C32(0xf10bac66) }, - { SPH_C32(0x01260800), SPH_C32(0x971e5068), SPH_C32(0xa02b3b7b), - SPH_C32(0x5234db11), SPH_C32(0xc5341400), SPH_C32(0xbc7206e2), - SPH_C32(0x8984c7a5), SPH_C32(0x788680b0) }, - { SPH_C32(0x8e180c00), SPH_C32(0x9a83981f), SPH_C32(0xcfee739a), - SPH_C32(0xdbb9f7c7), SPH_C32(0xd1891400), SPH_C32(0x93c8311d), - SPH_C32(0xe3f6221e), SPH_C32(0x5cf96b56) }, - { SPH_C32(0x2a220000), SPH_C32(0xc47ebf14), SPH_C32(0x04ce77d4), - SPH_C32(0xcb92c512), SPH_C32(0x80851800), SPH_C32(0xb6d6a994), - SPH_C32(0xfdb64038), SPH_C32(0x73cbd816) }, - { SPH_C32(0xa51c0400), SPH_C32(0xc9e37763), SPH_C32(0x6b0b3f35), - SPH_C32(0x421fe9c4), SPH_C32(0x94381800), SPH_C32(0x996c9e6b), - SPH_C32(0x97c4a583), SPH_C32(0x57b433f0) }, - { SPH_C32(0x3e9f0000), SPH_C32(0xebc488eb), SPH_C32(0x6ebc926f), - SPH_C32(0xefed2ef4), SPH_C32(0x1b061c00), SPH_C32(0x94f1561c), - SPH_C32(0xf801ed62), SPH_C32(0xde391f26) }, - { SPH_C32(0xb1a10400), SPH_C32(0xe659409c), SPH_C32(0x0179da8e), - SPH_C32(0x66600222), SPH_C32(0x0fbb1c00), SPH_C32(0xbb4b61e3), - SPH_C32(0x927308d9), SPH_C32(0xfa46f4c0) }, - { SPH_C32(0xf4100800), SPH_C32(0xecfdefea), SPH_C32(0x754b5d13), - SPH_C32(0x6d2d5a84), SPH_C32(0x610e1800), SPH_C32(0xe28f21e9), - SPH_C32(0x42a4c3eb), SPH_C32(0x68adb265) }, - { SPH_C32(0x7b2e0c00), SPH_C32(0xe160279d), SPH_C32(0x1a8e15f2), - SPH_C32(0xe4a07652), SPH_C32(0x75b31800), SPH_C32(0xcd351616), - SPH_C32(0x28d62650), SPH_C32(0x4cd25983) }, - { SPH_C32(0xe0ad0800), SPH_C32(0xc347d815), SPH_C32(0x1f39b8a8), - SPH_C32(0x4952b162), SPH_C32(0xfa8d1c00), SPH_C32(0xc0a8de61), - SPH_C32(0x47136eb1), SPH_C32(0xc55f7555) }, - { SPH_C32(0x6f930c00), SPH_C32(0xceda1062), SPH_C32(0x70fcf049), - SPH_C32(0xc0df9db4), SPH_C32(0xee301c00), SPH_C32(0xef12e99e), - SPH_C32(0x2d618b0a), SPH_C32(0xe1209eb3) }, - { SPH_C32(0xbf3c1000), SPH_C32(0xca0c7117), SPH_C32(0x3321e92c), - SPH_C32(0xce122df3), SPH_C32(0x74951000), SPH_C32(0x5a2b467e), - SPH_C32(0x88fd1d2b), SPH_C32(0x1ee68292) }, - { SPH_C32(0x30021400), SPH_C32(0xc791b960), SPH_C32(0x5ce4a1cd), - SPH_C32(0x479f0125), SPH_C32(0x60281000), SPH_C32(0x75917181), - SPH_C32(0xe28ff890), SPH_C32(0x3a996974) }, - { SPH_C32(0xab811000), SPH_C32(0xe5b646e8), SPH_C32(0x59530c97), - SPH_C32(0xea6dc615), SPH_C32(0xef161400), SPH_C32(0x780cb9f6), - SPH_C32(0x8d4ab071), SPH_C32(0xb31445a2) }, - { SPH_C32(0x24bf1400), SPH_C32(0xe82b8e9f), SPH_C32(0x36964476), - SPH_C32(0x63e0eac3), SPH_C32(0xfbab1400), SPH_C32(0x57b68e09), - SPH_C32(0xe73855ca), SPH_C32(0x976bae44) }, - { SPH_C32(0x610e1800), SPH_C32(0xe28f21e9), SPH_C32(0x42a4c3eb), - SPH_C32(0x68adb265), SPH_C32(0x951e1000), SPH_C32(0x0e72ce03), - SPH_C32(0x37ef9ef8), SPH_C32(0x0580e8e1) }, - { SPH_C32(0xee301c00), SPH_C32(0xef12e99e), SPH_C32(0x2d618b0a), - SPH_C32(0xe1209eb3), SPH_C32(0x81a31000), SPH_C32(0x21c8f9fc), - SPH_C32(0x5d9d7b43), SPH_C32(0x21ff0307) }, - { SPH_C32(0x75b31800), SPH_C32(0xcd351616), SPH_C32(0x28d62650), - SPH_C32(0x4cd25983), SPH_C32(0x0e9d1400), SPH_C32(0x2c55318b), - SPH_C32(0x325833a2), SPH_C32(0xa8722fd1) }, - { SPH_C32(0xfa8d1c00), SPH_C32(0xc0a8de61), SPH_C32(0x47136eb1), - SPH_C32(0xc55f7555), SPH_C32(0x1a201400), SPH_C32(0x03ef0674), - SPH_C32(0x582ad619), SPH_C32(0x8c0dc437) }, - { SPH_C32(0x5eb71000), SPH_C32(0x9e55f96a), SPH_C32(0x8c336aff), - SPH_C32(0xd5744780), SPH_C32(0x4b2c1800), SPH_C32(0x26f19efd), - SPH_C32(0x466ab43f), SPH_C32(0xa33f7777) }, - { SPH_C32(0xd1891400), SPH_C32(0x93c8311d), SPH_C32(0xe3f6221e), - SPH_C32(0x5cf96b56), SPH_C32(0x5f911800), SPH_C32(0x094ba902), - SPH_C32(0x2c185184), SPH_C32(0x87409c91) }, - { SPH_C32(0x4a0a1000), SPH_C32(0xb1efce95), SPH_C32(0xe6418f44), - SPH_C32(0xf10bac66), SPH_C32(0xd0af1c00), SPH_C32(0x04d66175), - SPH_C32(0x43dd1965), SPH_C32(0x0ecdb047) }, - { SPH_C32(0xc5341400), SPH_C32(0xbc7206e2), SPH_C32(0x8984c7a5), - SPH_C32(0x788680b0), SPH_C32(0xc4121c00), SPH_C32(0x2b6c568a), - SPH_C32(0x29affcde), SPH_C32(0x2ab25ba1) }, - { SPH_C32(0x80851800), SPH_C32(0xb6d6a994), SPH_C32(0xfdb64038), - SPH_C32(0x73cbd816), SPH_C32(0xaaa71800), SPH_C32(0x72a81680), - SPH_C32(0xf97837ec), SPH_C32(0xb8591d04) }, - { SPH_C32(0x0fbb1c00), SPH_C32(0xbb4b61e3), SPH_C32(0x927308d9), - SPH_C32(0xfa46f4c0), SPH_C32(0xbe1a1800), SPH_C32(0x5d12217f), - SPH_C32(0x930ad257), SPH_C32(0x9c26f6e2) }, - { SPH_C32(0x94381800), SPH_C32(0x996c9e6b), SPH_C32(0x97c4a583), - SPH_C32(0x57b433f0), SPH_C32(0x31241c00), SPH_C32(0x508fe908), - SPH_C32(0xfccf9ab6), SPH_C32(0x15abda34) }, - { SPH_C32(0x1b061c00), SPH_C32(0x94f1561c), SPH_C32(0xf801ed62), - SPH_C32(0xde391f26), SPH_C32(0x25991c00), SPH_C32(0x7f35def7), - SPH_C32(0x96bd7f0d), SPH_C32(0x31d431d2) } -}; - -static const sph_u32 T256_12[64][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x5bd20080), SPH_C32(0x450f18ec), SPH_C32(0xc2c46c55), - SPH_C32(0xf362b233), SPH_C32(0x39a60000), SPH_C32(0x4ab753eb), - SPH_C32(0xd14e094b), SPH_C32(0xb772b42b) }, - { SPH_C32(0x39a60000), SPH_C32(0x4ab753eb), SPH_C32(0xd14e094b), - SPH_C32(0xb772b42b), SPH_C32(0x62740080), SPH_C32(0x0fb84b07), - SPH_C32(0x138a651e), SPH_C32(0x44100618) }, - { SPH_C32(0x62740080), SPH_C32(0x0fb84b07), SPH_C32(0x138a651e), - SPH_C32(0x44100618), SPH_C32(0x5bd20080), SPH_C32(0x450f18ec), - SPH_C32(0xc2c46c55), SPH_C32(0xf362b233) }, - { SPH_C32(0xb7a40100), SPH_C32(0x8a1f31d8), SPH_C32(0x8589d8ab), - SPH_C32(0xe6c46464), SPH_C32(0x734c0000), SPH_C32(0x956fa7d6), - SPH_C32(0xa29d1297), SPH_C32(0x6ee56854) }, - { SPH_C32(0xec760180), SPH_C32(0xcf102934), SPH_C32(0x474db4fe), - SPH_C32(0x15a6d657), SPH_C32(0x4aea0000), SPH_C32(0xdfd8f43d), - SPH_C32(0x73d31bdc), SPH_C32(0xd997dc7f) }, - { SPH_C32(0x8e020100), SPH_C32(0xc0a86233), SPH_C32(0x54c7d1e0), - SPH_C32(0x51b6d04f), SPH_C32(0x11380080), SPH_C32(0x9ad7ecd1), - SPH_C32(0xb1177789), SPH_C32(0x2af56e4c) }, - { SPH_C32(0xd5d00180), SPH_C32(0x85a77adf), SPH_C32(0x9603bdb5), - SPH_C32(0xa2d4627c), SPH_C32(0x289e0080), SPH_C32(0xd060bf3a), - SPH_C32(0x60597ec2), SPH_C32(0x9d87da67) }, - { SPH_C32(0x734c0000), SPH_C32(0x956fa7d6), SPH_C32(0xa29d1297), - SPH_C32(0x6ee56854), SPH_C32(0xc4e80100), SPH_C32(0x1f70960e), - SPH_C32(0x2714ca3c), SPH_C32(0x88210c30) }, - { SPH_C32(0x289e0080), SPH_C32(0xd060bf3a), SPH_C32(0x60597ec2), - SPH_C32(0x9d87da67), SPH_C32(0xfd4e0100), SPH_C32(0x55c7c5e5), - SPH_C32(0xf65ac377), SPH_C32(0x3f53b81b) }, - { SPH_C32(0x4aea0000), SPH_C32(0xdfd8f43d), SPH_C32(0x73d31bdc), - SPH_C32(0xd997dc7f), SPH_C32(0xa69c0180), SPH_C32(0x10c8dd09), - SPH_C32(0x349eaf22), SPH_C32(0xcc310a28) }, - { SPH_C32(0x11380080), SPH_C32(0x9ad7ecd1), SPH_C32(0xb1177789), - SPH_C32(0x2af56e4c), SPH_C32(0x9f3a0180), SPH_C32(0x5a7f8ee2), - SPH_C32(0xe5d0a669), SPH_C32(0x7b43be03) }, - { SPH_C32(0xc4e80100), SPH_C32(0x1f70960e), SPH_C32(0x2714ca3c), - SPH_C32(0x88210c30), SPH_C32(0xb7a40100), SPH_C32(0x8a1f31d8), - SPH_C32(0x8589d8ab), SPH_C32(0xe6c46464) }, - { SPH_C32(0x9f3a0180), SPH_C32(0x5a7f8ee2), SPH_C32(0xe5d0a669), - SPH_C32(0x7b43be03), SPH_C32(0x8e020100), SPH_C32(0xc0a86233), - SPH_C32(0x54c7d1e0), SPH_C32(0x51b6d04f) }, - { SPH_C32(0xfd4e0100), SPH_C32(0x55c7c5e5), SPH_C32(0xf65ac377), - SPH_C32(0x3f53b81b), SPH_C32(0xd5d00180), SPH_C32(0x85a77adf), - SPH_C32(0x9603bdb5), SPH_C32(0xa2d4627c) }, - { SPH_C32(0xa69c0180), SPH_C32(0x10c8dd09), SPH_C32(0x349eaf22), - SPH_C32(0xcc310a28), SPH_C32(0xec760180), SPH_C32(0xcf102934), - SPH_C32(0x474db4fe), SPH_C32(0x15a6d657) }, - { SPH_C32(0xa7b80200), SPH_C32(0x1f128433), SPH_C32(0x60e5f9f2), - SPH_C32(0x9e147576), SPH_C32(0xee260000), SPH_C32(0x124b683e), - SPH_C32(0x80c2d68f), SPH_C32(0x3bf3ab2c) }, - { SPH_C32(0xfc6a0280), SPH_C32(0x5a1d9cdf), SPH_C32(0xa22195a7), - SPH_C32(0x6d76c745), SPH_C32(0xd7800000), SPH_C32(0x58fc3bd5), - SPH_C32(0x518cdfc4), SPH_C32(0x8c811f07) }, - { SPH_C32(0x9e1e0200), SPH_C32(0x55a5d7d8), SPH_C32(0xb1abf0b9), - SPH_C32(0x2966c15d), SPH_C32(0x8c520080), SPH_C32(0x1df32339), - SPH_C32(0x9348b391), SPH_C32(0x7fe3ad34) }, - { SPH_C32(0xc5cc0280), SPH_C32(0x10aacf34), SPH_C32(0x736f9cec), - SPH_C32(0xda04736e), SPH_C32(0xb5f40080), SPH_C32(0x574470d2), - SPH_C32(0x4206bada), SPH_C32(0xc891191f) }, - { SPH_C32(0x101c0300), SPH_C32(0x950db5eb), SPH_C32(0xe56c2159), - SPH_C32(0x78d01112), SPH_C32(0x9d6a0000), SPH_C32(0x8724cfe8), - SPH_C32(0x225fc418), SPH_C32(0x5516c378) }, - { SPH_C32(0x4bce0380), SPH_C32(0xd002ad07), SPH_C32(0x27a84d0c), - SPH_C32(0x8bb2a321), SPH_C32(0xa4cc0000), SPH_C32(0xcd939c03), - SPH_C32(0xf311cd53), SPH_C32(0xe2647753) }, - { SPH_C32(0x29ba0300), SPH_C32(0xdfbae600), SPH_C32(0x34222812), - SPH_C32(0xcfa2a539), SPH_C32(0xff1e0080), SPH_C32(0x889c84ef), - SPH_C32(0x31d5a106), SPH_C32(0x1106c560) }, - { SPH_C32(0x72680380), SPH_C32(0x9ab5feec), SPH_C32(0xf6e64447), - SPH_C32(0x3cc0170a), SPH_C32(0xc6b80080), SPH_C32(0xc22bd704), - SPH_C32(0xe09ba84d), SPH_C32(0xa674714b) }, - { SPH_C32(0xd4f40200), SPH_C32(0x8a7d23e5), SPH_C32(0xc278eb65), - SPH_C32(0xf0f11d22), SPH_C32(0x2ace0100), SPH_C32(0x0d3bfe30), - SPH_C32(0xa7d61cb3), SPH_C32(0xb3d2a71c) }, - { SPH_C32(0x8f260280), SPH_C32(0xcf723b09), SPH_C32(0x00bc8730), - SPH_C32(0x0393af11), SPH_C32(0x13680100), SPH_C32(0x478caddb), - SPH_C32(0x769815f8), SPH_C32(0x04a01337) }, - { SPH_C32(0xed520200), SPH_C32(0xc0ca700e), SPH_C32(0x1336e22e), - SPH_C32(0x4783a909), SPH_C32(0x48ba0180), SPH_C32(0x0283b537), - SPH_C32(0xb45c79ad), SPH_C32(0xf7c2a104) }, - { SPH_C32(0xb6800280), SPH_C32(0x85c568e2), SPH_C32(0xd1f28e7b), - SPH_C32(0xb4e11b3a), SPH_C32(0x711c0180), SPH_C32(0x4834e6dc), - SPH_C32(0x651270e6), SPH_C32(0x40b0152f) }, - { SPH_C32(0x63500300), SPH_C32(0x0062123d), SPH_C32(0x47f133ce), - SPH_C32(0x16357946), SPH_C32(0x59820100), SPH_C32(0x985459e6), - SPH_C32(0x054b0e24), SPH_C32(0xdd37cf48) }, - { SPH_C32(0x38820380), SPH_C32(0x456d0ad1), SPH_C32(0x85355f9b), - SPH_C32(0xe557cb75), SPH_C32(0x60240100), SPH_C32(0xd2e30a0d), - SPH_C32(0xd405076f), SPH_C32(0x6a457b63) }, - { SPH_C32(0x5af60300), SPH_C32(0x4ad541d6), SPH_C32(0x96bf3a85), - SPH_C32(0xa147cd6d), SPH_C32(0x3bf60180), SPH_C32(0x97ec12e1), - SPH_C32(0x16c16b3a), SPH_C32(0x9927c950) }, - { SPH_C32(0x01240380), SPH_C32(0x0fda593a), SPH_C32(0x547b56d0), - SPH_C32(0x52257f5e), SPH_C32(0x02500180), SPH_C32(0xdd5b410a), - SPH_C32(0xc78f6271), SPH_C32(0x2e557d7b) }, - { SPH_C32(0xee260000), SPH_C32(0x124b683e), SPH_C32(0x80c2d68f), - SPH_C32(0x3bf3ab2c), SPH_C32(0x499e0200), SPH_C32(0x0d59ec0d), - SPH_C32(0xe0272f7d), SPH_C32(0xa5e7de5a) }, - { SPH_C32(0xb5f40080), SPH_C32(0x574470d2), SPH_C32(0x4206bada), - SPH_C32(0xc891191f), SPH_C32(0x70380200), SPH_C32(0x47eebfe6), - SPH_C32(0x31692636), SPH_C32(0x12956a71) }, - { SPH_C32(0xd7800000), SPH_C32(0x58fc3bd5), SPH_C32(0x518cdfc4), - SPH_C32(0x8c811f07), SPH_C32(0x2bea0280), SPH_C32(0x02e1a70a), - SPH_C32(0xf3ad4a63), SPH_C32(0xe1f7d842) }, - { SPH_C32(0x8c520080), SPH_C32(0x1df32339), SPH_C32(0x9348b391), - SPH_C32(0x7fe3ad34), SPH_C32(0x124c0280), SPH_C32(0x4856f4e1), - SPH_C32(0x22e34328), SPH_C32(0x56856c69) }, - { SPH_C32(0x59820100), SPH_C32(0x985459e6), SPH_C32(0x054b0e24), - SPH_C32(0xdd37cf48), SPH_C32(0x3ad20200), SPH_C32(0x98364bdb), - SPH_C32(0x42ba3dea), SPH_C32(0xcb02b60e) }, - { SPH_C32(0x02500180), SPH_C32(0xdd5b410a), SPH_C32(0xc78f6271), - SPH_C32(0x2e557d7b), SPH_C32(0x03740200), SPH_C32(0xd2811830), - SPH_C32(0x93f434a1), SPH_C32(0x7c700225) }, - { SPH_C32(0x60240100), SPH_C32(0xd2e30a0d), SPH_C32(0xd405076f), - SPH_C32(0x6a457b63), SPH_C32(0x58a60280), SPH_C32(0x978e00dc), - SPH_C32(0x513058f4), SPH_C32(0x8f12b016) }, - { SPH_C32(0x3bf60180), SPH_C32(0x97ec12e1), SPH_C32(0x16c16b3a), - SPH_C32(0x9927c950), SPH_C32(0x61000280), SPH_C32(0xdd395337), - SPH_C32(0x807e51bf), SPH_C32(0x3860043d) }, - { SPH_C32(0x9d6a0000), SPH_C32(0x8724cfe8), SPH_C32(0x225fc418), - SPH_C32(0x5516c378), SPH_C32(0x8d760300), SPH_C32(0x12297a03), - SPH_C32(0xc733e541), SPH_C32(0x2dc6d26a) }, - { SPH_C32(0xc6b80080), SPH_C32(0xc22bd704), SPH_C32(0xe09ba84d), - SPH_C32(0xa674714b), SPH_C32(0xb4d00300), SPH_C32(0x589e29e8), - SPH_C32(0x167dec0a), SPH_C32(0x9ab46641) }, - { SPH_C32(0xa4cc0000), SPH_C32(0xcd939c03), SPH_C32(0xf311cd53), - SPH_C32(0xe2647753), SPH_C32(0xef020380), SPH_C32(0x1d913104), - SPH_C32(0xd4b9805f), SPH_C32(0x69d6d472) }, - { SPH_C32(0xff1e0080), SPH_C32(0x889c84ef), SPH_C32(0x31d5a106), - SPH_C32(0x1106c560), SPH_C32(0xd6a40380), SPH_C32(0x572662ef), - SPH_C32(0x05f78914), SPH_C32(0xdea46059) }, - { SPH_C32(0x2ace0100), SPH_C32(0x0d3bfe30), SPH_C32(0xa7d61cb3), - SPH_C32(0xb3d2a71c), SPH_C32(0xfe3a0300), SPH_C32(0x8746ddd5), - SPH_C32(0x65aef7d6), SPH_C32(0x4323ba3e) }, - { SPH_C32(0x711c0180), SPH_C32(0x4834e6dc), SPH_C32(0x651270e6), - SPH_C32(0x40b0152f), SPH_C32(0xc79c0300), SPH_C32(0xcdf18e3e), - SPH_C32(0xb4e0fe9d), SPH_C32(0xf4510e15) }, - { SPH_C32(0x13680100), SPH_C32(0x478caddb), SPH_C32(0x769815f8), - SPH_C32(0x04a01337), SPH_C32(0x9c4e0380), SPH_C32(0x88fe96d2), - SPH_C32(0x762492c8), SPH_C32(0x0733bc26) }, - { SPH_C32(0x48ba0180), SPH_C32(0x0283b537), SPH_C32(0xb45c79ad), - SPH_C32(0xf7c2a104), SPH_C32(0xa5e80380), SPH_C32(0xc249c539), - SPH_C32(0xa76a9b83), SPH_C32(0xb041080d) }, - { SPH_C32(0x499e0200), SPH_C32(0x0d59ec0d), SPH_C32(0xe0272f7d), - SPH_C32(0xa5e7de5a), SPH_C32(0xa7b80200), SPH_C32(0x1f128433), - SPH_C32(0x60e5f9f2), SPH_C32(0x9e147576) }, - { SPH_C32(0x124c0280), SPH_C32(0x4856f4e1), SPH_C32(0x22e34328), - SPH_C32(0x56856c69), SPH_C32(0x9e1e0200), SPH_C32(0x55a5d7d8), - SPH_C32(0xb1abf0b9), SPH_C32(0x2966c15d) }, - { SPH_C32(0x70380200), SPH_C32(0x47eebfe6), SPH_C32(0x31692636), - SPH_C32(0x12956a71), SPH_C32(0xc5cc0280), SPH_C32(0x10aacf34), - SPH_C32(0x736f9cec), SPH_C32(0xda04736e) }, - { SPH_C32(0x2bea0280), SPH_C32(0x02e1a70a), SPH_C32(0xf3ad4a63), - SPH_C32(0xe1f7d842), SPH_C32(0xfc6a0280), SPH_C32(0x5a1d9cdf), - SPH_C32(0xa22195a7), SPH_C32(0x6d76c745) }, - { SPH_C32(0xfe3a0300), SPH_C32(0x8746ddd5), SPH_C32(0x65aef7d6), - SPH_C32(0x4323ba3e), SPH_C32(0xd4f40200), SPH_C32(0x8a7d23e5), - SPH_C32(0xc278eb65), SPH_C32(0xf0f11d22) }, - { SPH_C32(0xa5e80380), SPH_C32(0xc249c539), SPH_C32(0xa76a9b83), - SPH_C32(0xb041080d), SPH_C32(0xed520200), SPH_C32(0xc0ca700e), - SPH_C32(0x1336e22e), SPH_C32(0x4783a909) }, - { SPH_C32(0xc79c0300), SPH_C32(0xcdf18e3e), SPH_C32(0xb4e0fe9d), - SPH_C32(0xf4510e15), SPH_C32(0xb6800280), SPH_C32(0x85c568e2), - SPH_C32(0xd1f28e7b), SPH_C32(0xb4e11b3a) }, - { SPH_C32(0x9c4e0380), SPH_C32(0x88fe96d2), SPH_C32(0x762492c8), - SPH_C32(0x0733bc26), SPH_C32(0x8f260280), SPH_C32(0xcf723b09), - SPH_C32(0x00bc8730), SPH_C32(0x0393af11) }, - { SPH_C32(0x3ad20200), SPH_C32(0x98364bdb), SPH_C32(0x42ba3dea), - SPH_C32(0xcb02b60e), SPH_C32(0x63500300), SPH_C32(0x0062123d), - SPH_C32(0x47f133ce), SPH_C32(0x16357946) }, - { SPH_C32(0x61000280), SPH_C32(0xdd395337), SPH_C32(0x807e51bf), - SPH_C32(0x3860043d), SPH_C32(0x5af60300), SPH_C32(0x4ad541d6), - SPH_C32(0x96bf3a85), SPH_C32(0xa147cd6d) }, - { SPH_C32(0x03740200), SPH_C32(0xd2811830), SPH_C32(0x93f434a1), - SPH_C32(0x7c700225), SPH_C32(0x01240380), SPH_C32(0x0fda593a), - SPH_C32(0x547b56d0), SPH_C32(0x52257f5e) }, - { SPH_C32(0x58a60280), SPH_C32(0x978e00dc), SPH_C32(0x513058f4), - SPH_C32(0x8f12b016), SPH_C32(0x38820380), SPH_C32(0x456d0ad1), - SPH_C32(0x85355f9b), SPH_C32(0xe557cb75) }, - { SPH_C32(0x8d760300), SPH_C32(0x12297a03), SPH_C32(0xc733e541), - SPH_C32(0x2dc6d26a), SPH_C32(0x101c0300), SPH_C32(0x950db5eb), - SPH_C32(0xe56c2159), SPH_C32(0x78d01112) }, - { SPH_C32(0xd6a40380), SPH_C32(0x572662ef), SPH_C32(0x05f78914), - SPH_C32(0xdea46059), SPH_C32(0x29ba0300), SPH_C32(0xdfbae600), - SPH_C32(0x34222812), SPH_C32(0xcfa2a539) }, - { SPH_C32(0xb4d00300), SPH_C32(0x589e29e8), SPH_C32(0x167dec0a), - SPH_C32(0x9ab46641), SPH_C32(0x72680380), SPH_C32(0x9ab5feec), - SPH_C32(0xf6e64447), SPH_C32(0x3cc0170a) }, - { SPH_C32(0xef020380), SPH_C32(0x1d913104), SPH_C32(0xd4b9805f), - SPH_C32(0x69d6d472), SPH_C32(0x4bce0380), SPH_C32(0xd002ad07), - SPH_C32(0x27a84d0c), SPH_C32(0x8bb2a321) } -}; - -static const sph_u32 T256_18[64][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x515c0010), SPH_C32(0x40f372fb), SPH_C32(0xfce72602), - SPH_C32(0x71575061), SPH_C32(0x2e390000), SPH_C32(0x64dd6689), - SPH_C32(0x3cd406fc), SPH_C32(0xb1f490bc) }, - { SPH_C32(0x2e390000), SPH_C32(0x64dd6689), SPH_C32(0x3cd406fc), - SPH_C32(0xb1f490bc), SPH_C32(0x7f650010), SPH_C32(0x242e1472), - SPH_C32(0xc03320fe), SPH_C32(0xc0a3c0dd) }, - { SPH_C32(0x7f650010), SPH_C32(0x242e1472), SPH_C32(0xc03320fe), - SPH_C32(0xc0a3c0dd), SPH_C32(0x515c0010), SPH_C32(0x40f372fb), - SPH_C32(0xfce72602), SPH_C32(0x71575061) }, - { SPH_C32(0xa2b80020), SPH_C32(0x81e7e5f6), SPH_C32(0xf9ce4c04), - SPH_C32(0xe2afa0c0), SPH_C32(0x5c720000), SPH_C32(0xc9bacd12), - SPH_C32(0x79a90df9), SPH_C32(0x63e92178) }, - { SPH_C32(0xf3e40030), SPH_C32(0xc114970d), SPH_C32(0x05296a06), - SPH_C32(0x93f8f0a1), SPH_C32(0x724b0000), SPH_C32(0xad67ab9b), - SPH_C32(0x457d0b05), SPH_C32(0xd21db1c4) }, - { SPH_C32(0x8c810020), SPH_C32(0xe53a837f), SPH_C32(0xc51a4af8), - SPH_C32(0x535b307c), SPH_C32(0x23170010), SPH_C32(0xed94d960), - SPH_C32(0xb99a2d07), SPH_C32(0xa34ae1a5) }, - { SPH_C32(0xdddd0030), SPH_C32(0xa5c9f184), SPH_C32(0x39fd6cfa), - SPH_C32(0x220c601d), SPH_C32(0x0d2e0010), SPH_C32(0x8949bfe9), - SPH_C32(0x854e2bfb), SPH_C32(0x12be7119) }, - { SPH_C32(0x5c720000), SPH_C32(0xc9bacd12), SPH_C32(0x79a90df9), - SPH_C32(0x63e92178), SPH_C32(0xfeca0020), SPH_C32(0x485d28e4), - SPH_C32(0x806741fd), SPH_C32(0x814681b8) }, - { SPH_C32(0x0d2e0010), SPH_C32(0x8949bfe9), SPH_C32(0x854e2bfb), - SPH_C32(0x12be7119), SPH_C32(0xd0f30020), SPH_C32(0x2c804e6d), - SPH_C32(0xbcb34701), SPH_C32(0x30b21104) }, - { SPH_C32(0x724b0000), SPH_C32(0xad67ab9b), SPH_C32(0x457d0b05), - SPH_C32(0xd21db1c4), SPH_C32(0x81af0030), SPH_C32(0x6c733c96), - SPH_C32(0x40546103), SPH_C32(0x41e54165) }, - { SPH_C32(0x23170010), SPH_C32(0xed94d960), SPH_C32(0xb99a2d07), - SPH_C32(0xa34ae1a5), SPH_C32(0xaf960030), SPH_C32(0x08ae5a1f), - SPH_C32(0x7c8067ff), SPH_C32(0xf011d1d9) }, - { SPH_C32(0xfeca0020), SPH_C32(0x485d28e4), SPH_C32(0x806741fd), - SPH_C32(0x814681b8), SPH_C32(0xa2b80020), SPH_C32(0x81e7e5f6), - SPH_C32(0xf9ce4c04), SPH_C32(0xe2afa0c0) }, - { SPH_C32(0xaf960030), SPH_C32(0x08ae5a1f), SPH_C32(0x7c8067ff), - SPH_C32(0xf011d1d9), SPH_C32(0x8c810020), SPH_C32(0xe53a837f), - SPH_C32(0xc51a4af8), SPH_C32(0x535b307c) }, - { SPH_C32(0xd0f30020), SPH_C32(0x2c804e6d), SPH_C32(0xbcb34701), - SPH_C32(0x30b21104), SPH_C32(0xdddd0030), SPH_C32(0xa5c9f184), - SPH_C32(0x39fd6cfa), SPH_C32(0x220c601d) }, - { SPH_C32(0x81af0030), SPH_C32(0x6c733c96), SPH_C32(0x40546103), - SPH_C32(0x41e54165), SPH_C32(0xf3e40030), SPH_C32(0xc114970d), - SPH_C32(0x05296a06), SPH_C32(0x93f8f0a1) }, - { SPH_C32(0x4dce0040), SPH_C32(0x3b5bec7e), SPH_C32(0x36656ba8), - SPH_C32(0x23633a05), SPH_C32(0x78ab0000), SPH_C32(0xa0cd5a34), - SPH_C32(0x5d5ca0f7), SPH_C32(0x727784cb) }, - { SPH_C32(0x1c920050), SPH_C32(0x7ba89e85), SPH_C32(0xca824daa), - SPH_C32(0x52346a64), SPH_C32(0x56920000), SPH_C32(0xc4103cbd), - SPH_C32(0x6188a60b), SPH_C32(0xc3831477) }, - { SPH_C32(0x63f70040), SPH_C32(0x5f868af7), SPH_C32(0x0ab16d54), - SPH_C32(0x9297aab9), SPH_C32(0x07ce0010), SPH_C32(0x84e34e46), - SPH_C32(0x9d6f8009), SPH_C32(0xb2d44416) }, - { SPH_C32(0x32ab0050), SPH_C32(0x1f75f80c), SPH_C32(0xf6564b56), - SPH_C32(0xe3c0fad8), SPH_C32(0x29f70010), SPH_C32(0xe03e28cf), - SPH_C32(0xa1bb86f5), SPH_C32(0x0320d4aa) }, - { SPH_C32(0xef760060), SPH_C32(0xbabc0988), SPH_C32(0xcfab27ac), - SPH_C32(0xc1cc9ac5), SPH_C32(0x24d90000), SPH_C32(0x69779726), - SPH_C32(0x24f5ad0e), SPH_C32(0x119ea5b3) }, - { SPH_C32(0xbe2a0070), SPH_C32(0xfa4f7b73), SPH_C32(0x334c01ae), - SPH_C32(0xb09bcaa4), SPH_C32(0x0ae00000), SPH_C32(0x0daaf1af), - SPH_C32(0x1821abf2), SPH_C32(0xa06a350f) }, - { SPH_C32(0xc14f0060), SPH_C32(0xde616f01), SPH_C32(0xf37f2150), - SPH_C32(0x70380a79), SPH_C32(0x5bbc0010), SPH_C32(0x4d598354), - SPH_C32(0xe4c68df0), SPH_C32(0xd13d656e) }, - { SPH_C32(0x90130070), SPH_C32(0x9e921dfa), SPH_C32(0x0f980752), - SPH_C32(0x016f5a18), SPH_C32(0x75850010), SPH_C32(0x2984e5dd), - SPH_C32(0xd8128b0c), SPH_C32(0x60c9f5d2) }, - { SPH_C32(0x11bc0040), SPH_C32(0xf2e1216c), SPH_C32(0x4fcc6651), - SPH_C32(0x408a1b7d), SPH_C32(0x86610020), SPH_C32(0xe89072d0), - SPH_C32(0xdd3be10a), SPH_C32(0xf3310573) }, - { SPH_C32(0x40e00050), SPH_C32(0xb2125397), SPH_C32(0xb32b4053), - SPH_C32(0x31dd4b1c), SPH_C32(0xa8580020), SPH_C32(0x8c4d1459), - SPH_C32(0xe1efe7f6), SPH_C32(0x42c595cf) }, - { SPH_C32(0x3f850040), SPH_C32(0x963c47e5), SPH_C32(0x731860ad), - SPH_C32(0xf17e8bc1), SPH_C32(0xf9040030), SPH_C32(0xccbe66a2), - SPH_C32(0x1d08c1f4), SPH_C32(0x3392c5ae) }, - { SPH_C32(0x6ed90050), SPH_C32(0xd6cf351e), SPH_C32(0x8fff46af), - SPH_C32(0x8029dba0), SPH_C32(0xd73d0030), SPH_C32(0xa863002b), - SPH_C32(0x21dcc708), SPH_C32(0x82665512) }, - { SPH_C32(0xb3040060), SPH_C32(0x7306c49a), SPH_C32(0xb6022a55), - SPH_C32(0xa225bbbd), SPH_C32(0xda130020), SPH_C32(0x212abfc2), - SPH_C32(0xa492ecf3), SPH_C32(0x90d8240b) }, - { SPH_C32(0xe2580070), SPH_C32(0x33f5b661), SPH_C32(0x4ae50c57), - SPH_C32(0xd372ebdc), SPH_C32(0xf42a0020), SPH_C32(0x45f7d94b), - SPH_C32(0x9846ea0f), SPH_C32(0x212cb4b7) }, - { SPH_C32(0x9d3d0060), SPH_C32(0x17dba213), SPH_C32(0x8ad62ca9), - SPH_C32(0x13d12b01), SPH_C32(0xa5760030), SPH_C32(0x0504abb0), - SPH_C32(0x64a1cc0d), SPH_C32(0x507be4d6) }, - { SPH_C32(0xcc610070), SPH_C32(0x5728d0e8), SPH_C32(0x76310aab), - SPH_C32(0x62867b60), SPH_C32(0x8b4f0030), SPH_C32(0x61d9cd39), - SPH_C32(0x5875caf1), SPH_C32(0xe18f746a) }, - { SPH_C32(0x78ab0000), SPH_C32(0xa0cd5a34), SPH_C32(0x5d5ca0f7), - SPH_C32(0x727784cb), SPH_C32(0x35650040), SPH_C32(0x9b96b64a), - SPH_C32(0x6b39cb5f), SPH_C32(0x5114bece) }, - { SPH_C32(0x29f70010), SPH_C32(0xe03e28cf), SPH_C32(0xa1bb86f5), - SPH_C32(0x0320d4aa), SPH_C32(0x1b5c0040), SPH_C32(0xff4bd0c3), - SPH_C32(0x57edcda3), SPH_C32(0xe0e02e72) }, - { SPH_C32(0x56920000), SPH_C32(0xc4103cbd), SPH_C32(0x6188a60b), - SPH_C32(0xc3831477), SPH_C32(0x4a000050), SPH_C32(0xbfb8a238), - SPH_C32(0xab0aeba1), SPH_C32(0x91b77e13) }, - { SPH_C32(0x07ce0010), SPH_C32(0x84e34e46), SPH_C32(0x9d6f8009), - SPH_C32(0xb2d44416), SPH_C32(0x64390050), SPH_C32(0xdb65c4b1), - SPH_C32(0x97deed5d), SPH_C32(0x2043eeaf) }, - { SPH_C32(0xda130020), SPH_C32(0x212abfc2), SPH_C32(0xa492ecf3), - SPH_C32(0x90d8240b), SPH_C32(0x69170040), SPH_C32(0x522c7b58), - SPH_C32(0x1290c6a6), SPH_C32(0x32fd9fb6) }, - { SPH_C32(0x8b4f0030), SPH_C32(0x61d9cd39), SPH_C32(0x5875caf1), - SPH_C32(0xe18f746a), SPH_C32(0x472e0040), SPH_C32(0x36f11dd1), - SPH_C32(0x2e44c05a), SPH_C32(0x83090f0a) }, - { SPH_C32(0xf42a0020), SPH_C32(0x45f7d94b), SPH_C32(0x9846ea0f), - SPH_C32(0x212cb4b7), SPH_C32(0x16720050), SPH_C32(0x76026f2a), - SPH_C32(0xd2a3e658), SPH_C32(0xf25e5f6b) }, - { SPH_C32(0xa5760030), SPH_C32(0x0504abb0), SPH_C32(0x64a1cc0d), - SPH_C32(0x507be4d6), SPH_C32(0x384b0050), SPH_C32(0x12df09a3), - SPH_C32(0xee77e0a4), SPH_C32(0x43aacfd7) }, - { SPH_C32(0x24d90000), SPH_C32(0x69779726), SPH_C32(0x24f5ad0e), - SPH_C32(0x119ea5b3), SPH_C32(0xcbaf0060), SPH_C32(0xd3cb9eae), - SPH_C32(0xeb5e8aa2), SPH_C32(0xd0523f76) }, - { SPH_C32(0x75850010), SPH_C32(0x2984e5dd), SPH_C32(0xd8128b0c), - SPH_C32(0x60c9f5d2), SPH_C32(0xe5960060), SPH_C32(0xb716f827), - SPH_C32(0xd78a8c5e), SPH_C32(0x61a6afca) }, - { SPH_C32(0x0ae00000), SPH_C32(0x0daaf1af), SPH_C32(0x1821abf2), - SPH_C32(0xa06a350f), SPH_C32(0xb4ca0070), SPH_C32(0xf7e58adc), - SPH_C32(0x2b6daa5c), SPH_C32(0x10f1ffab) }, - { SPH_C32(0x5bbc0010), SPH_C32(0x4d598354), SPH_C32(0xe4c68df0), - SPH_C32(0xd13d656e), SPH_C32(0x9af30070), SPH_C32(0x9338ec55), - SPH_C32(0x17b9aca0), SPH_C32(0xa1056f17) }, - { SPH_C32(0x86610020), SPH_C32(0xe89072d0), SPH_C32(0xdd3be10a), - SPH_C32(0xf3310573), SPH_C32(0x97dd0060), SPH_C32(0x1a7153bc), - SPH_C32(0x92f7875b), SPH_C32(0xb3bb1e0e) }, - { SPH_C32(0xd73d0030), SPH_C32(0xa863002b), SPH_C32(0x21dcc708), - SPH_C32(0x82665512), SPH_C32(0xb9e40060), SPH_C32(0x7eac3535), - SPH_C32(0xae2381a7), SPH_C32(0x024f8eb2) }, - { SPH_C32(0xa8580020), SPH_C32(0x8c4d1459), SPH_C32(0xe1efe7f6), - SPH_C32(0x42c595cf), SPH_C32(0xe8b80070), SPH_C32(0x3e5f47ce), - SPH_C32(0x52c4a7a5), SPH_C32(0x7318ded3) }, - { SPH_C32(0xf9040030), SPH_C32(0xccbe66a2), SPH_C32(0x1d08c1f4), - SPH_C32(0x3392c5ae), SPH_C32(0xc6810070), SPH_C32(0x5a822147), - SPH_C32(0x6e10a159), SPH_C32(0xc2ec4e6f) }, - { SPH_C32(0x35650040), SPH_C32(0x9b96b64a), SPH_C32(0x6b39cb5f), - SPH_C32(0x5114bece), SPH_C32(0x4dce0040), SPH_C32(0x3b5bec7e), - SPH_C32(0x36656ba8), SPH_C32(0x23633a05) }, - { SPH_C32(0x64390050), SPH_C32(0xdb65c4b1), SPH_C32(0x97deed5d), - SPH_C32(0x2043eeaf), SPH_C32(0x63f70040), SPH_C32(0x5f868af7), - SPH_C32(0x0ab16d54), SPH_C32(0x9297aab9) }, - { SPH_C32(0x1b5c0040), SPH_C32(0xff4bd0c3), SPH_C32(0x57edcda3), - SPH_C32(0xe0e02e72), SPH_C32(0x32ab0050), SPH_C32(0x1f75f80c), - SPH_C32(0xf6564b56), SPH_C32(0xe3c0fad8) }, - { SPH_C32(0x4a000050), SPH_C32(0xbfb8a238), SPH_C32(0xab0aeba1), - SPH_C32(0x91b77e13), SPH_C32(0x1c920050), SPH_C32(0x7ba89e85), - SPH_C32(0xca824daa), SPH_C32(0x52346a64) }, - { SPH_C32(0x97dd0060), SPH_C32(0x1a7153bc), SPH_C32(0x92f7875b), - SPH_C32(0xb3bb1e0e), SPH_C32(0x11bc0040), SPH_C32(0xf2e1216c), - SPH_C32(0x4fcc6651), SPH_C32(0x408a1b7d) }, - { SPH_C32(0xc6810070), SPH_C32(0x5a822147), SPH_C32(0x6e10a159), - SPH_C32(0xc2ec4e6f), SPH_C32(0x3f850040), SPH_C32(0x963c47e5), - SPH_C32(0x731860ad), SPH_C32(0xf17e8bc1) }, - { SPH_C32(0xb9e40060), SPH_C32(0x7eac3535), SPH_C32(0xae2381a7), - SPH_C32(0x024f8eb2), SPH_C32(0x6ed90050), SPH_C32(0xd6cf351e), - SPH_C32(0x8fff46af), SPH_C32(0x8029dba0) }, - { SPH_C32(0xe8b80070), SPH_C32(0x3e5f47ce), SPH_C32(0x52c4a7a5), - SPH_C32(0x7318ded3), SPH_C32(0x40e00050), SPH_C32(0xb2125397), - SPH_C32(0xb32b4053), SPH_C32(0x31dd4b1c) }, - { SPH_C32(0x69170040), SPH_C32(0x522c7b58), SPH_C32(0x1290c6a6), - SPH_C32(0x32fd9fb6), SPH_C32(0xb3040060), SPH_C32(0x7306c49a), - SPH_C32(0xb6022a55), SPH_C32(0xa225bbbd) }, - { SPH_C32(0x384b0050), SPH_C32(0x12df09a3), SPH_C32(0xee77e0a4), - SPH_C32(0x43aacfd7), SPH_C32(0x9d3d0060), SPH_C32(0x17dba213), - SPH_C32(0x8ad62ca9), SPH_C32(0x13d12b01) }, - { SPH_C32(0x472e0040), SPH_C32(0x36f11dd1), SPH_C32(0x2e44c05a), - SPH_C32(0x83090f0a), SPH_C32(0xcc610070), SPH_C32(0x5728d0e8), - SPH_C32(0x76310aab), SPH_C32(0x62867b60) }, - { SPH_C32(0x16720050), SPH_C32(0x76026f2a), SPH_C32(0xd2a3e658), - SPH_C32(0xf25e5f6b), SPH_C32(0xe2580070), SPH_C32(0x33f5b661), - SPH_C32(0x4ae50c57), SPH_C32(0xd372ebdc) }, - { SPH_C32(0xcbaf0060), SPH_C32(0xd3cb9eae), SPH_C32(0xeb5e8aa2), - SPH_C32(0xd0523f76), SPH_C32(0xef760060), SPH_C32(0xbabc0988), - SPH_C32(0xcfab27ac), SPH_C32(0xc1cc9ac5) }, - { SPH_C32(0x9af30070), SPH_C32(0x9338ec55), SPH_C32(0x17b9aca0), - SPH_C32(0xa1056f17), SPH_C32(0xc14f0060), SPH_C32(0xde616f01), - SPH_C32(0xf37f2150), SPH_C32(0x70380a79) }, - { SPH_C32(0xe5960060), SPH_C32(0xb716f827), SPH_C32(0xd78a8c5e), - SPH_C32(0x61a6afca), SPH_C32(0x90130070), SPH_C32(0x9e921dfa), - SPH_C32(0x0f980752), SPH_C32(0x016f5a18) }, - { SPH_C32(0xb4ca0070), SPH_C32(0xf7e58adc), SPH_C32(0x2b6daa5c), - SPH_C32(0x10f1ffab), SPH_C32(0xbe2a0070), SPH_C32(0xfa4f7b73), - SPH_C32(0x334c01ae), SPH_C32(0xb09bcaa4) } -}; - -static const sph_u32 T256_24[64][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x88230002), SPH_C32(0x5fe7a7b3), SPH_C32(0x99e585aa), - SPH_C32(0x8d75f7f1), SPH_C32(0x51ac0000), SPH_C32(0x25e30f14), - SPH_C32(0x79e22a4c), SPH_C32(0x1298bd46) }, - { SPH_C32(0x51ac0000), SPH_C32(0x25e30f14), SPH_C32(0x79e22a4c), - SPH_C32(0x1298bd46), SPH_C32(0xd98f0002), SPH_C32(0x7a04a8a7), - SPH_C32(0xe007afe6), SPH_C32(0x9fed4ab7) }, - { SPH_C32(0xd98f0002), SPH_C32(0x7a04a8a7), SPH_C32(0xe007afe6), - SPH_C32(0x9fed4ab7), SPH_C32(0x88230002), SPH_C32(0x5fe7a7b3), - SPH_C32(0x99e585aa), SPH_C32(0x8d75f7f1) }, - { SPH_C32(0xd0080004), SPH_C32(0x8c768f77), SPH_C32(0x9dc5b050), - SPH_C32(0xaf4a29da), SPH_C32(0x6ba90000), SPH_C32(0x40ebf9aa), - SPH_C32(0x98321c3d), SPH_C32(0x76acc733) }, - { SPH_C32(0x582b0006), SPH_C32(0xd39128c4), SPH_C32(0x042035fa), - SPH_C32(0x223fde2b), SPH_C32(0x3a050000), SPH_C32(0x6508f6be), - SPH_C32(0xe1d03671), SPH_C32(0x64347a75) }, - { SPH_C32(0x81a40004), SPH_C32(0xa9958063), SPH_C32(0xe4279a1c), - SPH_C32(0xbdd2949c), SPH_C32(0xb2260002), SPH_C32(0x3aef510d), - SPH_C32(0x7835b3db), SPH_C32(0xe9418d84) }, - { SPH_C32(0x09870006), SPH_C32(0xf67227d0), SPH_C32(0x7dc21fb6), - SPH_C32(0x30a7636d), SPH_C32(0xe38a0002), SPH_C32(0x1f0c5e19), - SPH_C32(0x01d79997), SPH_C32(0xfbd930c2) }, - { SPH_C32(0x6ba90000), SPH_C32(0x40ebf9aa), SPH_C32(0x98321c3d), - SPH_C32(0x76acc733), SPH_C32(0xbba10004), SPH_C32(0xcc9d76dd), - SPH_C32(0x05f7ac6d), SPH_C32(0xd9e6eee9) }, - { SPH_C32(0xe38a0002), SPH_C32(0x1f0c5e19), SPH_C32(0x01d79997), - SPH_C32(0xfbd930c2), SPH_C32(0xea0d0004), SPH_C32(0xe97e79c9), - SPH_C32(0x7c158621), SPH_C32(0xcb7e53af) }, - { SPH_C32(0x3a050000), SPH_C32(0x6508f6be), SPH_C32(0xe1d03671), - SPH_C32(0x64347a75), SPH_C32(0x622e0006), SPH_C32(0xb699de7a), - SPH_C32(0xe5f0038b), SPH_C32(0x460ba45e) }, - { SPH_C32(0xb2260002), SPH_C32(0x3aef510d), SPH_C32(0x7835b3db), - SPH_C32(0xe9418d84), SPH_C32(0x33820006), SPH_C32(0x937ad16e), - SPH_C32(0x9c1229c7), SPH_C32(0x54931918) }, - { SPH_C32(0xbba10004), SPH_C32(0xcc9d76dd), SPH_C32(0x05f7ac6d), - SPH_C32(0xd9e6eee9), SPH_C32(0xd0080004), SPH_C32(0x8c768f77), - SPH_C32(0x9dc5b050), SPH_C32(0xaf4a29da) }, - { SPH_C32(0x33820006), SPH_C32(0x937ad16e), SPH_C32(0x9c1229c7), - SPH_C32(0x54931918), SPH_C32(0x81a40004), SPH_C32(0xa9958063), - SPH_C32(0xe4279a1c), SPH_C32(0xbdd2949c) }, - { SPH_C32(0xea0d0004), SPH_C32(0xe97e79c9), SPH_C32(0x7c158621), - SPH_C32(0xcb7e53af), SPH_C32(0x09870006), SPH_C32(0xf67227d0), - SPH_C32(0x7dc21fb6), SPH_C32(0x30a7636d) }, - { SPH_C32(0x622e0006), SPH_C32(0xb699de7a), SPH_C32(0xe5f0038b), - SPH_C32(0x460ba45e), SPH_C32(0x582b0006), SPH_C32(0xd39128c4), - SPH_C32(0x042035fa), SPH_C32(0x223fde2b) }, - { SPH_C32(0xa8ae0008), SPH_C32(0x2079397d), SPH_C32(0xfe739301), - SPH_C32(0xb8a92831), SPH_C32(0x171c0000), SPH_C32(0xb26e3344), - SPH_C32(0x9e6a837e), SPH_C32(0x58f8485f) }, - { SPH_C32(0x208d000a), SPH_C32(0x7f9e9ece), SPH_C32(0x679616ab), - SPH_C32(0x35dcdfc0), SPH_C32(0x46b00000), SPH_C32(0x978d3c50), - SPH_C32(0xe788a932), SPH_C32(0x4a60f519) }, - { SPH_C32(0xf9020008), SPH_C32(0x059a3669), SPH_C32(0x8791b94d), - SPH_C32(0xaa319577), SPH_C32(0xce930002), SPH_C32(0xc86a9be3), - SPH_C32(0x7e6d2c98), SPH_C32(0xc71502e8) }, - { SPH_C32(0x7121000a), SPH_C32(0x5a7d91da), SPH_C32(0x1e743ce7), - SPH_C32(0x27446286), SPH_C32(0x9f3f0002), SPH_C32(0xed8994f7), - SPH_C32(0x078f06d4), SPH_C32(0xd58dbfae) }, - { SPH_C32(0x78a6000c), SPH_C32(0xac0fb60a), SPH_C32(0x63b62351), - SPH_C32(0x17e301eb), SPH_C32(0x7cb50000), SPH_C32(0xf285caee), - SPH_C32(0x06589f43), SPH_C32(0x2e548f6c) }, - { SPH_C32(0xf085000e), SPH_C32(0xf3e811b9), SPH_C32(0xfa53a6fb), - SPH_C32(0x9a96f61a), SPH_C32(0x2d190000), SPH_C32(0xd766c5fa), - SPH_C32(0x7fbab50f), SPH_C32(0x3ccc322a) }, - { SPH_C32(0x290a000c), SPH_C32(0x89ecb91e), SPH_C32(0x1a54091d), - SPH_C32(0x057bbcad), SPH_C32(0xa53a0002), SPH_C32(0x88816249), - SPH_C32(0xe65f30a5), SPH_C32(0xb1b9c5db) }, - { SPH_C32(0xa129000e), SPH_C32(0xd60b1ead), SPH_C32(0x83b18cb7), - SPH_C32(0x880e4b5c), SPH_C32(0xf4960002), SPH_C32(0xad626d5d), - SPH_C32(0x9fbd1ae9), SPH_C32(0xa321789d) }, - { SPH_C32(0xc3070008), SPH_C32(0x6092c0d7), SPH_C32(0x66418f3c), - SPH_C32(0xce05ef02), SPH_C32(0xacbd0004), SPH_C32(0x7ef34599), - SPH_C32(0x9b9d2f13), SPH_C32(0x811ea6b6) }, - { SPH_C32(0x4b24000a), SPH_C32(0x3f756764), SPH_C32(0xffa40a96), - SPH_C32(0x437018f3), SPH_C32(0xfd110004), SPH_C32(0x5b104a8d), - SPH_C32(0xe27f055f), SPH_C32(0x93861bf0) }, - { SPH_C32(0x92ab0008), SPH_C32(0x4571cfc3), SPH_C32(0x1fa3a570), - SPH_C32(0xdc9d5244), SPH_C32(0x75320006), SPH_C32(0x04f7ed3e), - SPH_C32(0x7b9a80f5), SPH_C32(0x1ef3ec01) }, - { SPH_C32(0x1a88000a), SPH_C32(0x1a966870), SPH_C32(0x864620da), - SPH_C32(0x51e8a5b5), SPH_C32(0x249e0006), SPH_C32(0x2114e22a), - SPH_C32(0x0278aab9), SPH_C32(0x0c6b5147) }, - { SPH_C32(0x130f000c), SPH_C32(0xece44fa0), SPH_C32(0xfb843f6c), - SPH_C32(0x614fc6d8), SPH_C32(0xc7140004), SPH_C32(0x3e18bc33), - SPH_C32(0x03af332e), SPH_C32(0xf7b26185) }, - { SPH_C32(0x9b2c000e), SPH_C32(0xb303e813), SPH_C32(0x6261bac6), - SPH_C32(0xec3a3129), SPH_C32(0x96b80004), SPH_C32(0x1bfbb327), - SPH_C32(0x7a4d1962), SPH_C32(0xe52adcc3) }, - { SPH_C32(0x42a3000c), SPH_C32(0xc90740b4), SPH_C32(0x82661520), - SPH_C32(0x73d77b9e), SPH_C32(0x1e9b0006), SPH_C32(0x441c1494), - SPH_C32(0xe3a89cc8), SPH_C32(0x685f2b32) }, - { SPH_C32(0xca80000e), SPH_C32(0x96e0e707), SPH_C32(0x1b83908a), - SPH_C32(0xfea28c6f), SPH_C32(0x4f370006), SPH_C32(0x61ff1b80), - SPH_C32(0x9a4ab684), SPH_C32(0x7ac79674) }, - { SPH_C32(0x171c0000), SPH_C32(0xb26e3344), SPH_C32(0x9e6a837e), - SPH_C32(0x58f8485f), SPH_C32(0xbfb20008), SPH_C32(0x92170a39), - SPH_C32(0x6019107f), SPH_C32(0xe051606e) }, - { SPH_C32(0x9f3f0002), SPH_C32(0xed8994f7), SPH_C32(0x078f06d4), - SPH_C32(0xd58dbfae), SPH_C32(0xee1e0008), SPH_C32(0xb7f4052d), - SPH_C32(0x19fb3a33), SPH_C32(0xf2c9dd28) }, - { SPH_C32(0x46b00000), SPH_C32(0x978d3c50), SPH_C32(0xe788a932), - SPH_C32(0x4a60f519), SPH_C32(0x663d000a), SPH_C32(0xe813a29e), - SPH_C32(0x801ebf99), SPH_C32(0x7fbc2ad9) }, - { SPH_C32(0xce930002), SPH_C32(0xc86a9be3), SPH_C32(0x7e6d2c98), - SPH_C32(0xc71502e8), SPH_C32(0x3791000a), SPH_C32(0xcdf0ad8a), - SPH_C32(0xf9fc95d5), SPH_C32(0x6d24979f) }, - { SPH_C32(0xc7140004), SPH_C32(0x3e18bc33), SPH_C32(0x03af332e), - SPH_C32(0xf7b26185), SPH_C32(0xd41b0008), SPH_C32(0xd2fcf393), - SPH_C32(0xf82b0c42), SPH_C32(0x96fda75d) }, - { SPH_C32(0x4f370006), SPH_C32(0x61ff1b80), SPH_C32(0x9a4ab684), - SPH_C32(0x7ac79674), SPH_C32(0x85b70008), SPH_C32(0xf71ffc87), - SPH_C32(0x81c9260e), SPH_C32(0x84651a1b) }, - { SPH_C32(0x96b80004), SPH_C32(0x1bfbb327), SPH_C32(0x7a4d1962), - SPH_C32(0xe52adcc3), SPH_C32(0x0d94000a), SPH_C32(0xa8f85b34), - SPH_C32(0x182ca3a4), SPH_C32(0x0910edea) }, - { SPH_C32(0x1e9b0006), SPH_C32(0x441c1494), SPH_C32(0xe3a89cc8), - SPH_C32(0x685f2b32), SPH_C32(0x5c38000a), SPH_C32(0x8d1b5420), - SPH_C32(0x61ce89e8), SPH_C32(0x1b8850ac) }, - { SPH_C32(0x7cb50000), SPH_C32(0xf285caee), SPH_C32(0x06589f43), - SPH_C32(0x2e548f6c), SPH_C32(0x0413000c), SPH_C32(0x5e8a7ce4), - SPH_C32(0x65eebc12), SPH_C32(0x39b78e87) }, - { SPH_C32(0xf4960002), SPH_C32(0xad626d5d), SPH_C32(0x9fbd1ae9), - SPH_C32(0xa321789d), SPH_C32(0x55bf000c), SPH_C32(0x7b6973f0), - SPH_C32(0x1c0c965e), SPH_C32(0x2b2f33c1) }, - { SPH_C32(0x2d190000), SPH_C32(0xd766c5fa), SPH_C32(0x7fbab50f), - SPH_C32(0x3ccc322a), SPH_C32(0xdd9c000e), SPH_C32(0x248ed443), - SPH_C32(0x85e913f4), SPH_C32(0xa65ac430) }, - { SPH_C32(0xa53a0002), SPH_C32(0x88816249), SPH_C32(0xe65f30a5), - SPH_C32(0xb1b9c5db), SPH_C32(0x8c30000e), SPH_C32(0x016ddb57), - SPH_C32(0xfc0b39b8), SPH_C32(0xb4c27976) }, - { SPH_C32(0xacbd0004), SPH_C32(0x7ef34599), SPH_C32(0x9b9d2f13), - SPH_C32(0x811ea6b6), SPH_C32(0x6fba000c), SPH_C32(0x1e61854e), - SPH_C32(0xfddca02f), SPH_C32(0x4f1b49b4) }, - { SPH_C32(0x249e0006), SPH_C32(0x2114e22a), SPH_C32(0x0278aab9), - SPH_C32(0x0c6b5147), SPH_C32(0x3e16000c), SPH_C32(0x3b828a5a), - SPH_C32(0x843e8a63), SPH_C32(0x5d83f4f2) }, - { SPH_C32(0xfd110004), SPH_C32(0x5b104a8d), SPH_C32(0xe27f055f), - SPH_C32(0x93861bf0), SPH_C32(0xb635000e), SPH_C32(0x64652de9), - SPH_C32(0x1ddb0fc9), SPH_C32(0xd0f60303) }, - { SPH_C32(0x75320006), SPH_C32(0x04f7ed3e), SPH_C32(0x7b9a80f5), - SPH_C32(0x1ef3ec01), SPH_C32(0xe799000e), SPH_C32(0x418622fd), - SPH_C32(0x64392585), SPH_C32(0xc26ebe45) }, - { SPH_C32(0xbfb20008), SPH_C32(0x92170a39), SPH_C32(0x6019107f), - SPH_C32(0xe051606e), SPH_C32(0xa8ae0008), SPH_C32(0x2079397d), - SPH_C32(0xfe739301), SPH_C32(0xb8a92831) }, - { SPH_C32(0x3791000a), SPH_C32(0xcdf0ad8a), SPH_C32(0xf9fc95d5), - SPH_C32(0x6d24979f), SPH_C32(0xf9020008), SPH_C32(0x059a3669), - SPH_C32(0x8791b94d), SPH_C32(0xaa319577) }, - { SPH_C32(0xee1e0008), SPH_C32(0xb7f4052d), SPH_C32(0x19fb3a33), - SPH_C32(0xf2c9dd28), SPH_C32(0x7121000a), SPH_C32(0x5a7d91da), - SPH_C32(0x1e743ce7), SPH_C32(0x27446286) }, - { SPH_C32(0x663d000a), SPH_C32(0xe813a29e), SPH_C32(0x801ebf99), - SPH_C32(0x7fbc2ad9), SPH_C32(0x208d000a), SPH_C32(0x7f9e9ece), - SPH_C32(0x679616ab), SPH_C32(0x35dcdfc0) }, - { SPH_C32(0x6fba000c), SPH_C32(0x1e61854e), SPH_C32(0xfddca02f), - SPH_C32(0x4f1b49b4), SPH_C32(0xc3070008), SPH_C32(0x6092c0d7), - SPH_C32(0x66418f3c), SPH_C32(0xce05ef02) }, - { SPH_C32(0xe799000e), SPH_C32(0x418622fd), SPH_C32(0x64392585), - SPH_C32(0xc26ebe45), SPH_C32(0x92ab0008), SPH_C32(0x4571cfc3), - SPH_C32(0x1fa3a570), SPH_C32(0xdc9d5244) }, - { SPH_C32(0x3e16000c), SPH_C32(0x3b828a5a), SPH_C32(0x843e8a63), - SPH_C32(0x5d83f4f2), SPH_C32(0x1a88000a), SPH_C32(0x1a966870), - SPH_C32(0x864620da), SPH_C32(0x51e8a5b5) }, - { SPH_C32(0xb635000e), SPH_C32(0x64652de9), SPH_C32(0x1ddb0fc9), - SPH_C32(0xd0f60303), SPH_C32(0x4b24000a), SPH_C32(0x3f756764), - SPH_C32(0xffa40a96), SPH_C32(0x437018f3) }, - { SPH_C32(0xd41b0008), SPH_C32(0xd2fcf393), SPH_C32(0xf82b0c42), - SPH_C32(0x96fda75d), SPH_C32(0x130f000c), SPH_C32(0xece44fa0), - SPH_C32(0xfb843f6c), SPH_C32(0x614fc6d8) }, - { SPH_C32(0x5c38000a), SPH_C32(0x8d1b5420), SPH_C32(0x61ce89e8), - SPH_C32(0x1b8850ac), SPH_C32(0x42a3000c), SPH_C32(0xc90740b4), - SPH_C32(0x82661520), SPH_C32(0x73d77b9e) }, - { SPH_C32(0x85b70008), SPH_C32(0xf71ffc87), SPH_C32(0x81c9260e), - SPH_C32(0x84651a1b), SPH_C32(0xca80000e), SPH_C32(0x96e0e707), - SPH_C32(0x1b83908a), SPH_C32(0xfea28c6f) }, - { SPH_C32(0x0d94000a), SPH_C32(0xa8f85b34), SPH_C32(0x182ca3a4), - SPH_C32(0x0910edea), SPH_C32(0x9b2c000e), SPH_C32(0xb303e813), - SPH_C32(0x6261bac6), SPH_C32(0xec3a3129) }, - { SPH_C32(0x0413000c), SPH_C32(0x5e8a7ce4), SPH_C32(0x65eebc12), - SPH_C32(0x39b78e87), SPH_C32(0x78a6000c), SPH_C32(0xac0fb60a), - SPH_C32(0x63b62351), SPH_C32(0x17e301eb) }, - { SPH_C32(0x8c30000e), SPH_C32(0x016ddb57), SPH_C32(0xfc0b39b8), - SPH_C32(0xb4c27976), SPH_C32(0x290a000c), SPH_C32(0x89ecb91e), - SPH_C32(0x1a54091d), SPH_C32(0x057bbcad) }, - { SPH_C32(0x55bf000c), SPH_C32(0x7b6973f0), SPH_C32(0x1c0c965e), - SPH_C32(0x2b2f33c1), SPH_C32(0xa129000e), SPH_C32(0xd60b1ead), - SPH_C32(0x83b18cb7), SPH_C32(0x880e4b5c) }, - { SPH_C32(0xdd9c000e), SPH_C32(0x248ed443), SPH_C32(0x85e913f4), - SPH_C32(0xa65ac430), SPH_C32(0xf085000e), SPH_C32(0xf3e811b9), - SPH_C32(0xfa53a6fb), SPH_C32(0x9a96f61a) } -}; - -static const sph_u32 T256_30[4][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xc04e0001), SPH_C32(0x33b9c010), SPH_C32(0xae0ebb05), - SPH_C32(0xb5a4c63b), SPH_C32(0xc8f10000), SPH_C32(0x0b2de782), - SPH_C32(0x6bf648a4), SPH_C32(0x539cbdbf) }, - { SPH_C32(0xc8f10000), SPH_C32(0x0b2de782), SPH_C32(0x6bf648a4), - SPH_C32(0x539cbdbf), SPH_C32(0x08bf0001), SPH_C32(0x38942792), - SPH_C32(0xc5f8f3a1), SPH_C32(0xe6387b84) }, - { SPH_C32(0x08bf0001), SPH_C32(0x38942792), SPH_C32(0xc5f8f3a1), - SPH_C32(0xe6387b84), SPH_C32(0xc04e0001), SPH_C32(0x33b9c010), - SPH_C32(0xae0ebb05), SPH_C32(0xb5a4c63b) } -}; - -#define INPUT_SMALL do { \ - unsigned acc = buf[0]; \ - const sph_u32 *rp; \ - rp = &T256_0[acc >> 2][0]; \ - m0 = rp[0]; \ - m1 = rp[1]; \ - m2 = rp[2]; \ - m3 = rp[3]; \ - m4 = rp[4]; \ - m5 = rp[5]; \ - m6 = rp[6]; \ - m7 = rp[7]; \ - acc = (acc << 8) | buf[1]; \ - rp = &T256_6[(acc >> 4) & 0x3f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - acc = (acc << 8) | buf[2]; \ - rp = &T256_12[(acc >> 6) & 0x3f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_18[acc & 0x3f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - acc = buf[3]; \ - rp = &T256_24[acc >> 2][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_30[acc & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - } while (0) - -#endif - -#if SPH_HAMSI_EXPAND_SMALL == 7 - -static const sph_u32 T256_0[128][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xcba90000), SPH_C32(0x90273769), SPH_C32(0xbbdcf407), - SPH_C32(0xd0f4af61), SPH_C32(0xbf3c1000), SPH_C32(0xca0c7117), - SPH_C32(0x3321e92c), SPH_C32(0xce122df3) }, - { SPH_C32(0xe92a2000), SPH_C32(0xb4578cfc), SPH_C32(0x11fa3a57), - SPH_C32(0x3dc90524), SPH_C32(0x97530000), SPH_C32(0x204f6ed3), - SPH_C32(0x77b9e80f), SPH_C32(0xa1ec5ec1) }, - { SPH_C32(0x22832000), SPH_C32(0x2470bb95), SPH_C32(0xaa26ce50), - SPH_C32(0xed3daa45), SPH_C32(0x286f1000), SPH_C32(0xea431fc4), - SPH_C32(0x44980123), SPH_C32(0x6ffe7332) }, - { SPH_C32(0x97530000), SPH_C32(0x204f6ed3), SPH_C32(0x77b9e80f), - SPH_C32(0xa1ec5ec1), SPH_C32(0x7e792000), SPH_C32(0x9418e22f), - SPH_C32(0x6643d258), SPH_C32(0x9c255be5) }, - { SPH_C32(0x5cfa0000), SPH_C32(0xb06859ba), SPH_C32(0xcc651c08), - SPH_C32(0x7118f1a0), SPH_C32(0xc1453000), SPH_C32(0x5e149338), - SPH_C32(0x55623b74), SPH_C32(0x52377616) }, - { SPH_C32(0x7e792000), SPH_C32(0x9418e22f), SPH_C32(0x6643d258), - SPH_C32(0x9c255be5), SPH_C32(0xe92a2000), SPH_C32(0xb4578cfc), - SPH_C32(0x11fa3a57), SPH_C32(0x3dc90524) }, - { SPH_C32(0xb5d02000), SPH_C32(0x043fd546), SPH_C32(0xdd9f265f), - SPH_C32(0x4cd1f484), SPH_C32(0x56163000), SPH_C32(0x7e5bfdeb), - SPH_C32(0x22dbd37b), SPH_C32(0xf3db28d7) }, - { SPH_C32(0x121b4000), SPH_C32(0x5b17d9e8), SPH_C32(0x8dfacfab), - SPH_C32(0xce36cc72), SPH_C32(0xe6570000), SPH_C32(0x4bb33a25), - SPH_C32(0x848598ba), SPH_C32(0x1041003e) }, - { SPH_C32(0xd9b24000), SPH_C32(0xcb30ee81), SPH_C32(0x36263bac), - SPH_C32(0x1ec26313), SPH_C32(0x596b1000), SPH_C32(0x81bf4b32), - SPH_C32(0xb7a47196), SPH_C32(0xde532dcd) }, - { SPH_C32(0xfb316000), SPH_C32(0xef405514), SPH_C32(0x9c00f5fc), - SPH_C32(0xf3ffc956), SPH_C32(0x71040000), SPH_C32(0x6bfc54f6), - SPH_C32(0xf33c70b5), SPH_C32(0xb1ad5eff) }, - { SPH_C32(0x30986000), SPH_C32(0x7f67627d), SPH_C32(0x27dc01fb), - SPH_C32(0x230b6637), SPH_C32(0xce381000), SPH_C32(0xa1f025e1), - SPH_C32(0xc01d9999), SPH_C32(0x7fbf730c) }, - { SPH_C32(0x85484000), SPH_C32(0x7b58b73b), SPH_C32(0xfa4327a4), - SPH_C32(0x6fda92b3), SPH_C32(0x982e2000), SPH_C32(0xdfabd80a), - SPH_C32(0xe2c64ae2), SPH_C32(0x8c645bdb) }, - { SPH_C32(0x4ee14000), SPH_C32(0xeb7f8052), SPH_C32(0x419fd3a3), - SPH_C32(0xbf2e3dd2), SPH_C32(0x27123000), SPH_C32(0x15a7a91d), - SPH_C32(0xd1e7a3ce), SPH_C32(0x42767628) }, - { SPH_C32(0x6c626000), SPH_C32(0xcf0f3bc7), SPH_C32(0xebb91df3), - SPH_C32(0x52139797), SPH_C32(0x0f7d2000), SPH_C32(0xffe4b6d9), - SPH_C32(0x957fa2ed), SPH_C32(0x2d88051a) }, - { SPH_C32(0xa7cb6000), SPH_C32(0x5f280cae), SPH_C32(0x5065e9f4), - SPH_C32(0x82e738f6), SPH_C32(0xb0413000), SPH_C32(0x35e8c7ce), - SPH_C32(0xa65e4bc1), SPH_C32(0xe39a28e9) }, - { SPH_C32(0xe6570000), SPH_C32(0x4bb33a25), SPH_C32(0x848598ba), - SPH_C32(0x1041003e), SPH_C32(0xf44c4000), SPH_C32(0x10a4e3cd), - SPH_C32(0x097f5711), SPH_C32(0xde77cc4c) }, - { SPH_C32(0x2dfe0000), SPH_C32(0xdb940d4c), SPH_C32(0x3f596cbd), - SPH_C32(0xc0b5af5f), SPH_C32(0x4b705000), SPH_C32(0xdaa892da), - SPH_C32(0x3a5ebe3d), SPH_C32(0x1065e1bf) }, - { SPH_C32(0x0f7d2000), SPH_C32(0xffe4b6d9), SPH_C32(0x957fa2ed), - SPH_C32(0x2d88051a), SPH_C32(0x631f4000), SPH_C32(0x30eb8d1e), - SPH_C32(0x7ec6bf1e), SPH_C32(0x7f9b928d) }, - { SPH_C32(0xc4d42000), SPH_C32(0x6fc381b0), SPH_C32(0x2ea356ea), - SPH_C32(0xfd7caa7b), SPH_C32(0xdc235000), SPH_C32(0xfae7fc09), - SPH_C32(0x4de75632), SPH_C32(0xb189bf7e) }, - { SPH_C32(0x71040000), SPH_C32(0x6bfc54f6), SPH_C32(0xf33c70b5), - SPH_C32(0xb1ad5eff), SPH_C32(0x8a356000), SPH_C32(0x84bc01e2), - SPH_C32(0x6f3c8549), SPH_C32(0x425297a9) }, - { SPH_C32(0xbaad0000), SPH_C32(0xfbdb639f), SPH_C32(0x48e084b2), - SPH_C32(0x6159f19e), SPH_C32(0x35097000), SPH_C32(0x4eb070f5), - SPH_C32(0x5c1d6c65), SPH_C32(0x8c40ba5a) }, - { SPH_C32(0x982e2000), SPH_C32(0xdfabd80a), SPH_C32(0xe2c64ae2), - SPH_C32(0x8c645bdb), SPH_C32(0x1d666000), SPH_C32(0xa4f36f31), - SPH_C32(0x18856d46), SPH_C32(0xe3bec968) }, - { SPH_C32(0x53872000), SPH_C32(0x4f8cef63), SPH_C32(0x591abee5), - SPH_C32(0x5c90f4ba), SPH_C32(0xa25a7000), SPH_C32(0x6eff1e26), - SPH_C32(0x2ba4846a), SPH_C32(0x2dace49b) }, - { SPH_C32(0xf44c4000), SPH_C32(0x10a4e3cd), SPH_C32(0x097f5711), - SPH_C32(0xde77cc4c), SPH_C32(0x121b4000), SPH_C32(0x5b17d9e8), - SPH_C32(0x8dfacfab), SPH_C32(0xce36cc72) }, - { SPH_C32(0x3fe54000), SPH_C32(0x8083d4a4), SPH_C32(0xb2a3a316), - SPH_C32(0x0e83632d), SPH_C32(0xad275000), SPH_C32(0x911ba8ff), - SPH_C32(0xbedb2687), SPH_C32(0x0024e181) }, - { SPH_C32(0x1d666000), SPH_C32(0xa4f36f31), SPH_C32(0x18856d46), - SPH_C32(0xe3bec968), SPH_C32(0x85484000), SPH_C32(0x7b58b73b), - SPH_C32(0xfa4327a4), SPH_C32(0x6fda92b3) }, - { SPH_C32(0xd6cf6000), SPH_C32(0x34d45858), SPH_C32(0xa3599941), - SPH_C32(0x334a6609), SPH_C32(0x3a745000), SPH_C32(0xb154c62c), - SPH_C32(0xc962ce88), SPH_C32(0xa1c8bf40) }, - { SPH_C32(0x631f4000), SPH_C32(0x30eb8d1e), SPH_C32(0x7ec6bf1e), - SPH_C32(0x7f9b928d), SPH_C32(0x6c626000), SPH_C32(0xcf0f3bc7), - SPH_C32(0xebb91df3), SPH_C32(0x52139797) }, - { SPH_C32(0xa8b64000), SPH_C32(0xa0ccba77), SPH_C32(0xc51a4b19), - SPH_C32(0xaf6f3dec), SPH_C32(0xd35e7000), SPH_C32(0x05034ad0), - SPH_C32(0xd898f4df), SPH_C32(0x9c01ba64) }, - { SPH_C32(0x8a356000), SPH_C32(0x84bc01e2), SPH_C32(0x6f3c8549), - SPH_C32(0x425297a9), SPH_C32(0xfb316000), SPH_C32(0xef405514), - SPH_C32(0x9c00f5fc), SPH_C32(0xf3ffc956) }, - { SPH_C32(0x419c6000), SPH_C32(0x149b368b), SPH_C32(0xd4e0714e), - SPH_C32(0x92a638c8), SPH_C32(0x440d7000), SPH_C32(0x254c2403), - SPH_C32(0xaf211cd0), SPH_C32(0x3dede4a5) }, - { SPH_C32(0xe4788000), SPH_C32(0x859673c1), SPH_C32(0xb5fb2452), - SPH_C32(0x29cc5edf), SPH_C32(0x045f0000), SPH_C32(0x9c4a93c9), - SPH_C32(0x62fc79d0), SPH_C32(0x731ebdc2) }, - { SPH_C32(0x2fd18000), SPH_C32(0x15b144a8), SPH_C32(0x0e27d055), - SPH_C32(0xf938f1be), SPH_C32(0xbb631000), SPH_C32(0x5646e2de), - SPH_C32(0x51dd90fc), SPH_C32(0xbd0c9031) }, - { SPH_C32(0x0d52a000), SPH_C32(0x31c1ff3d), SPH_C32(0xa4011e05), - SPH_C32(0x14055bfb), SPH_C32(0x930c0000), SPH_C32(0xbc05fd1a), - SPH_C32(0x154591df), SPH_C32(0xd2f2e303) }, - { SPH_C32(0xc6fba000), SPH_C32(0xa1e6c854), SPH_C32(0x1fddea02), - SPH_C32(0xc4f1f49a), SPH_C32(0x2c301000), SPH_C32(0x76098c0d), - SPH_C32(0x266478f3), SPH_C32(0x1ce0cef0) }, - { SPH_C32(0x732b8000), SPH_C32(0xa5d91d12), SPH_C32(0xc242cc5d), - SPH_C32(0x8820001e), SPH_C32(0x7a262000), SPH_C32(0x085271e6), - SPH_C32(0x04bfab88), SPH_C32(0xef3be627) }, - { SPH_C32(0xb8828000), SPH_C32(0x35fe2a7b), SPH_C32(0x799e385a), - SPH_C32(0x58d4af7f), SPH_C32(0xc51a3000), SPH_C32(0xc25e00f1), - SPH_C32(0x379e42a4), SPH_C32(0x2129cbd4) }, - { SPH_C32(0x9a01a000), SPH_C32(0x118e91ee), SPH_C32(0xd3b8f60a), - SPH_C32(0xb5e9053a), SPH_C32(0xed752000), SPH_C32(0x281d1f35), - SPH_C32(0x73064387), SPH_C32(0x4ed7b8e6) }, - { SPH_C32(0x51a8a000), SPH_C32(0x81a9a687), SPH_C32(0x6864020d), - SPH_C32(0x651daa5b), SPH_C32(0x52493000), SPH_C32(0xe2116e22), - SPH_C32(0x4027aaab), SPH_C32(0x80c59515) }, - { SPH_C32(0xf663c000), SPH_C32(0xde81aa29), SPH_C32(0x3801ebf9), - SPH_C32(0xe7fa92ad), SPH_C32(0xe2080000), SPH_C32(0xd7f9a9ec), - SPH_C32(0xe679e16a), SPH_C32(0x635fbdfc) }, - { SPH_C32(0x3dcac000), SPH_C32(0x4ea69d40), SPH_C32(0x83dd1ffe), - SPH_C32(0x370e3dcc), SPH_C32(0x5d341000), SPH_C32(0x1df5d8fb), - SPH_C32(0xd5580846), SPH_C32(0xad4d900f) }, - { SPH_C32(0x1f49e000), SPH_C32(0x6ad626d5), SPH_C32(0x29fbd1ae), - SPH_C32(0xda339789), SPH_C32(0x755b0000), SPH_C32(0xf7b6c73f), - SPH_C32(0x91c00965), SPH_C32(0xc2b3e33d) }, - { SPH_C32(0xd4e0e000), SPH_C32(0xfaf111bc), SPH_C32(0x922725a9), - SPH_C32(0x0ac738e8), SPH_C32(0xca671000), SPH_C32(0x3dbab628), - SPH_C32(0xa2e1e049), SPH_C32(0x0ca1cece) }, - { SPH_C32(0x6130c000), SPH_C32(0xfecec4fa), SPH_C32(0x4fb803f6), - SPH_C32(0x4616cc6c), SPH_C32(0x9c712000), SPH_C32(0x43e14bc3), - SPH_C32(0x803a3332), SPH_C32(0xff7ae619) }, - { SPH_C32(0xaa99c000), SPH_C32(0x6ee9f393), SPH_C32(0xf464f7f1), - SPH_C32(0x96e2630d), SPH_C32(0x234d3000), SPH_C32(0x89ed3ad4), - SPH_C32(0xb31bda1e), SPH_C32(0x3168cbea) }, - { SPH_C32(0x881ae000), SPH_C32(0x4a994806), SPH_C32(0x5e4239a1), - SPH_C32(0x7bdfc948), SPH_C32(0x0b222000), SPH_C32(0x63ae2510), - SPH_C32(0xf783db3d), SPH_C32(0x5e96b8d8) }, - { SPH_C32(0x43b3e000), SPH_C32(0xdabe7f6f), SPH_C32(0xe59ecda6), - SPH_C32(0xab2b6629), SPH_C32(0xb41e3000), SPH_C32(0xa9a25407), - SPH_C32(0xc4a23211), SPH_C32(0x9084952b) }, - { SPH_C32(0x022f8000), SPH_C32(0xce2549e4), SPH_C32(0x317ebce8), - SPH_C32(0x398d5ee1), SPH_C32(0xf0134000), SPH_C32(0x8cee7004), - SPH_C32(0x6b832ec1), SPH_C32(0xad69718e) }, - { SPH_C32(0xc9868000), SPH_C32(0x5e027e8d), SPH_C32(0x8aa248ef), - SPH_C32(0xe979f180), SPH_C32(0x4f2f5000), SPH_C32(0x46e20113), - SPH_C32(0x58a2c7ed), SPH_C32(0x637b5c7d) }, - { SPH_C32(0xeb05a000), SPH_C32(0x7a72c518), SPH_C32(0x208486bf), - SPH_C32(0x04445bc5), SPH_C32(0x67404000), SPH_C32(0xaca11ed7), - SPH_C32(0x1c3ac6ce), SPH_C32(0x0c852f4f) }, - { SPH_C32(0x20aca000), SPH_C32(0xea55f271), SPH_C32(0x9b5872b8), - SPH_C32(0xd4b0f4a4), SPH_C32(0xd87c5000), SPH_C32(0x66ad6fc0), - SPH_C32(0x2f1b2fe2), SPH_C32(0xc29702bc) }, - { SPH_C32(0x957c8000), SPH_C32(0xee6a2737), SPH_C32(0x46c754e7), - SPH_C32(0x98610020), SPH_C32(0x8e6a6000), SPH_C32(0x18f6922b), - SPH_C32(0x0dc0fc99), SPH_C32(0x314c2a6b) }, - { SPH_C32(0x5ed58000), SPH_C32(0x7e4d105e), SPH_C32(0xfd1ba0e0), - SPH_C32(0x4895af41), SPH_C32(0x31567000), SPH_C32(0xd2fae33c), - SPH_C32(0x3ee115b5), SPH_C32(0xff5e0798) }, - { SPH_C32(0x7c56a000), SPH_C32(0x5a3dabcb), SPH_C32(0x573d6eb0), - SPH_C32(0xa5a80504), SPH_C32(0x19396000), SPH_C32(0x38b9fcf8), - SPH_C32(0x7a791496), SPH_C32(0x90a074aa) }, - { SPH_C32(0xb7ffa000), SPH_C32(0xca1a9ca2), SPH_C32(0xece19ab7), - SPH_C32(0x755caa65), SPH_C32(0xa6057000), SPH_C32(0xf2b58def), - SPH_C32(0x4958fdba), SPH_C32(0x5eb25959) }, - { SPH_C32(0x1034c000), SPH_C32(0x9532900c), SPH_C32(0xbc847343), - SPH_C32(0xf7bb9293), SPH_C32(0x16444000), SPH_C32(0xc75d4a21), - SPH_C32(0xef06b67b), SPH_C32(0xbd2871b0) }, - { SPH_C32(0xdb9dc000), SPH_C32(0x0515a765), SPH_C32(0x07588744), - SPH_C32(0x274f3df2), SPH_C32(0xa9785000), SPH_C32(0x0d513b36), - SPH_C32(0xdc275f57), SPH_C32(0x733a5c43) }, - { SPH_C32(0xf91ee000), SPH_C32(0x21651cf0), SPH_C32(0xad7e4914), - SPH_C32(0xca7297b7), SPH_C32(0x81174000), SPH_C32(0xe71224f2), - SPH_C32(0x98bf5e74), SPH_C32(0x1cc42f71) }, - { SPH_C32(0x32b7e000), SPH_C32(0xb1422b99), SPH_C32(0x16a2bd13), - SPH_C32(0x1a8638d6), SPH_C32(0x3e2b5000), SPH_C32(0x2d1e55e5), - SPH_C32(0xab9eb758), SPH_C32(0xd2d60282) }, - { SPH_C32(0x8767c000), SPH_C32(0xb57dfedf), SPH_C32(0xcb3d9b4c), - SPH_C32(0x5657cc52), SPH_C32(0x683d6000), SPH_C32(0x5345a80e), - SPH_C32(0x89456423), SPH_C32(0x210d2a55) }, - { SPH_C32(0x4ccec000), SPH_C32(0x255ac9b6), SPH_C32(0x70e16f4b), - SPH_C32(0x86a36333), SPH_C32(0xd7017000), SPH_C32(0x9949d919), - SPH_C32(0xba648d0f), SPH_C32(0xef1f07a6) }, - { SPH_C32(0x6e4de000), SPH_C32(0x012a7223), SPH_C32(0xdac7a11b), - SPH_C32(0x6b9ec976), SPH_C32(0xff6e6000), SPH_C32(0x730ac6dd), - SPH_C32(0xfefc8c2c), SPH_C32(0x80e17494) }, - { SPH_C32(0xa5e4e000), SPH_C32(0x910d454a), SPH_C32(0x611b551c), - SPH_C32(0xbb6a6617), SPH_C32(0x40527000), SPH_C32(0xb906b7ca), - SPH_C32(0xcddd6500), SPH_C32(0x4ef35967) }, - { SPH_C32(0x045f0000), SPH_C32(0x9c4a93c9), SPH_C32(0x62fc79d0), - SPH_C32(0x731ebdc2), SPH_C32(0xe0278000), SPH_C32(0x19dce008), - SPH_C32(0xd7075d82), SPH_C32(0x5ad2e31d) }, - { SPH_C32(0xcff60000), SPH_C32(0x0c6da4a0), SPH_C32(0xd9208dd7), - SPH_C32(0xa3ea12a3), SPH_C32(0x5f1b9000), SPH_C32(0xd3d0911f), - SPH_C32(0xe426b4ae), SPH_C32(0x94c0ceee) }, - { SPH_C32(0xed752000), SPH_C32(0x281d1f35), SPH_C32(0x73064387), - SPH_C32(0x4ed7b8e6), SPH_C32(0x77748000), SPH_C32(0x39938edb), - SPH_C32(0xa0beb58d), SPH_C32(0xfb3ebddc) }, - { SPH_C32(0x26dc2000), SPH_C32(0xb83a285c), SPH_C32(0xc8dab780), - SPH_C32(0x9e231787), SPH_C32(0xc8489000), SPH_C32(0xf39fffcc), - SPH_C32(0x939f5ca1), SPH_C32(0x352c902f) }, - { SPH_C32(0x930c0000), SPH_C32(0xbc05fd1a), SPH_C32(0x154591df), - SPH_C32(0xd2f2e303), SPH_C32(0x9e5ea000), SPH_C32(0x8dc40227), - SPH_C32(0xb1448fda), SPH_C32(0xc6f7b8f8) }, - { SPH_C32(0x58a50000), SPH_C32(0x2c22ca73), SPH_C32(0xae9965d8), - SPH_C32(0x02064c62), SPH_C32(0x2162b000), SPH_C32(0x47c87330), - SPH_C32(0x826566f6), SPH_C32(0x08e5950b) }, - { SPH_C32(0x7a262000), SPH_C32(0x085271e6), SPH_C32(0x04bfab88), - SPH_C32(0xef3be627), SPH_C32(0x090da000), SPH_C32(0xad8b6cf4), - SPH_C32(0xc6fd67d5), SPH_C32(0x671be639) }, - { SPH_C32(0xb18f2000), SPH_C32(0x9875468f), SPH_C32(0xbf635f8f), - SPH_C32(0x3fcf4946), SPH_C32(0xb631b000), SPH_C32(0x67871de3), - SPH_C32(0xf5dc8ef9), SPH_C32(0xa909cbca) }, - { SPH_C32(0x16444000), SPH_C32(0xc75d4a21), SPH_C32(0xef06b67b), - SPH_C32(0xbd2871b0), SPH_C32(0x06708000), SPH_C32(0x526fda2d), - SPH_C32(0x5382c538), SPH_C32(0x4a93e323) }, - { SPH_C32(0xdded4000), SPH_C32(0x577a7d48), SPH_C32(0x54da427c), - SPH_C32(0x6ddcded1), SPH_C32(0xb94c9000), SPH_C32(0x9863ab3a), - SPH_C32(0x60a32c14), SPH_C32(0x8481ced0) }, - { SPH_C32(0xff6e6000), SPH_C32(0x730ac6dd), SPH_C32(0xfefc8c2c), - SPH_C32(0x80e17494), SPH_C32(0x91238000), SPH_C32(0x7220b4fe), - SPH_C32(0x243b2d37), SPH_C32(0xeb7fbde2) }, - { SPH_C32(0x34c76000), SPH_C32(0xe32df1b4), SPH_C32(0x4520782b), - SPH_C32(0x5015dbf5), SPH_C32(0x2e1f9000), SPH_C32(0xb82cc5e9), - SPH_C32(0x171ac41b), SPH_C32(0x256d9011) }, - { SPH_C32(0x81174000), SPH_C32(0xe71224f2), SPH_C32(0x98bf5e74), - SPH_C32(0x1cc42f71), SPH_C32(0x7809a000), SPH_C32(0xc6773802), - SPH_C32(0x35c11760), SPH_C32(0xd6b6b8c6) }, - { SPH_C32(0x4abe4000), SPH_C32(0x7735139b), SPH_C32(0x2363aa73), - SPH_C32(0xcc308010), SPH_C32(0xc735b000), SPH_C32(0x0c7b4915), - SPH_C32(0x06e0fe4c), SPH_C32(0x18a49535) }, - { SPH_C32(0x683d6000), SPH_C32(0x5345a80e), SPH_C32(0x89456423), - SPH_C32(0x210d2a55), SPH_C32(0xef5aa000), SPH_C32(0xe63856d1), - SPH_C32(0x4278ff6f), SPH_C32(0x775ae607) }, - { SPH_C32(0xa3946000), SPH_C32(0xc3629f67), SPH_C32(0x32999024), - SPH_C32(0xf1f98534), SPH_C32(0x5066b000), SPH_C32(0x2c3427c6), - SPH_C32(0x71591643), SPH_C32(0xb948cbf4) }, - { SPH_C32(0xe2080000), SPH_C32(0xd7f9a9ec), SPH_C32(0xe679e16a), - SPH_C32(0x635fbdfc), SPH_C32(0x146bc000), SPH_C32(0x097803c5), - SPH_C32(0xde780a93), SPH_C32(0x84a52f51) }, - { SPH_C32(0x29a10000), SPH_C32(0x47de9e85), SPH_C32(0x5da5156d), - SPH_C32(0xb3ab129d), SPH_C32(0xab57d000), SPH_C32(0xc37472d2), - SPH_C32(0xed59e3bf), SPH_C32(0x4ab702a2) }, - { SPH_C32(0x0b222000), SPH_C32(0x63ae2510), SPH_C32(0xf783db3d), - SPH_C32(0x5e96b8d8), SPH_C32(0x8338c000), SPH_C32(0x29376d16), - SPH_C32(0xa9c1e29c), SPH_C32(0x25497190) }, - { SPH_C32(0xc08b2000), SPH_C32(0xf3891279), SPH_C32(0x4c5f2f3a), - SPH_C32(0x8e6217b9), SPH_C32(0x3c04d000), SPH_C32(0xe33b1c01), - SPH_C32(0x9ae00bb0), SPH_C32(0xeb5b5c63) }, - { SPH_C32(0x755b0000), SPH_C32(0xf7b6c73f), SPH_C32(0x91c00965), - SPH_C32(0xc2b3e33d), SPH_C32(0x6a12e000), SPH_C32(0x9d60e1ea), - SPH_C32(0xb83bd8cb), SPH_C32(0x188074b4) }, - { SPH_C32(0xbef20000), SPH_C32(0x6791f056), SPH_C32(0x2a1cfd62), - SPH_C32(0x12474c5c), SPH_C32(0xd52ef000), SPH_C32(0x576c90fd), - SPH_C32(0x8b1a31e7), SPH_C32(0xd6925947) }, - { SPH_C32(0x9c712000), SPH_C32(0x43e14bc3), SPH_C32(0x803a3332), - SPH_C32(0xff7ae619), SPH_C32(0xfd41e000), SPH_C32(0xbd2f8f39), - SPH_C32(0xcf8230c4), SPH_C32(0xb96c2a75) }, - { SPH_C32(0x57d82000), SPH_C32(0xd3c67caa), SPH_C32(0x3be6c735), - SPH_C32(0x2f8e4978), SPH_C32(0x427df000), SPH_C32(0x7723fe2e), - SPH_C32(0xfca3d9e8), SPH_C32(0x777e0786) }, - { SPH_C32(0xf0134000), SPH_C32(0x8cee7004), SPH_C32(0x6b832ec1), - SPH_C32(0xad69718e), SPH_C32(0xf23cc000), SPH_C32(0x42cb39e0), - SPH_C32(0x5afd9229), SPH_C32(0x94e42f6f) }, - { SPH_C32(0x3bba4000), SPH_C32(0x1cc9476d), SPH_C32(0xd05fdac6), - SPH_C32(0x7d9ddeef), SPH_C32(0x4d00d000), SPH_C32(0x88c748f7), - SPH_C32(0x69dc7b05), SPH_C32(0x5af6029c) }, - { SPH_C32(0x19396000), SPH_C32(0x38b9fcf8), SPH_C32(0x7a791496), - SPH_C32(0x90a074aa), SPH_C32(0x656fc000), SPH_C32(0x62845733), - SPH_C32(0x2d447a26), SPH_C32(0x350871ae) }, - { SPH_C32(0xd2906000), SPH_C32(0xa89ecb91), SPH_C32(0xc1a5e091), - SPH_C32(0x4054dbcb), SPH_C32(0xda53d000), SPH_C32(0xa8882624), - SPH_C32(0x1e65930a), SPH_C32(0xfb1a5c5d) }, - { SPH_C32(0x67404000), SPH_C32(0xaca11ed7), SPH_C32(0x1c3ac6ce), - SPH_C32(0x0c852f4f), SPH_C32(0x8c45e000), SPH_C32(0xd6d3dbcf), - SPH_C32(0x3cbe4071), SPH_C32(0x08c1748a) }, - { SPH_C32(0xace94000), SPH_C32(0x3c8629be), SPH_C32(0xa7e632c9), - SPH_C32(0xdc71802e), SPH_C32(0x3379f000), SPH_C32(0x1cdfaad8), - SPH_C32(0x0f9fa95d), SPH_C32(0xc6d35979) }, - { SPH_C32(0x8e6a6000), SPH_C32(0x18f6922b), SPH_C32(0x0dc0fc99), - SPH_C32(0x314c2a6b), SPH_C32(0x1b16e000), SPH_C32(0xf69cb51c), - SPH_C32(0x4b07a87e), SPH_C32(0xa92d2a4b) }, - { SPH_C32(0x45c36000), SPH_C32(0x88d1a542), SPH_C32(0xb61c089e), - SPH_C32(0xe1b8850a), SPH_C32(0xa42af000), SPH_C32(0x3c90c40b), - SPH_C32(0x78264152), SPH_C32(0x673f07b8) }, - { SPH_C32(0xe0278000), SPH_C32(0x19dce008), SPH_C32(0xd7075d82), - SPH_C32(0x5ad2e31d), SPH_C32(0xe4788000), SPH_C32(0x859673c1), - SPH_C32(0xb5fb2452), SPH_C32(0x29cc5edf) }, - { SPH_C32(0x2b8e8000), SPH_C32(0x89fbd761), SPH_C32(0x6cdba985), - SPH_C32(0x8a264c7c), SPH_C32(0x5b449000), SPH_C32(0x4f9a02d6), - SPH_C32(0x86dacd7e), SPH_C32(0xe7de732c) }, - { SPH_C32(0x090da000), SPH_C32(0xad8b6cf4), SPH_C32(0xc6fd67d5), - SPH_C32(0x671be639), SPH_C32(0x732b8000), SPH_C32(0xa5d91d12), - SPH_C32(0xc242cc5d), SPH_C32(0x8820001e) }, - { SPH_C32(0xc2a4a000), SPH_C32(0x3dac5b9d), SPH_C32(0x7d2193d2), - SPH_C32(0xb7ef4958), SPH_C32(0xcc179000), SPH_C32(0x6fd56c05), - SPH_C32(0xf1632571), SPH_C32(0x46322ded) }, - { SPH_C32(0x77748000), SPH_C32(0x39938edb), SPH_C32(0xa0beb58d), - SPH_C32(0xfb3ebddc), SPH_C32(0x9a01a000), SPH_C32(0x118e91ee), - SPH_C32(0xd3b8f60a), SPH_C32(0xb5e9053a) }, - { SPH_C32(0xbcdd8000), SPH_C32(0xa9b4b9b2), SPH_C32(0x1b62418a), - SPH_C32(0x2bca12bd), SPH_C32(0x253db000), SPH_C32(0xdb82e0f9), - SPH_C32(0xe0991f26), SPH_C32(0x7bfb28c9) }, - { SPH_C32(0x9e5ea000), SPH_C32(0x8dc40227), SPH_C32(0xb1448fda), - SPH_C32(0xc6f7b8f8), SPH_C32(0x0d52a000), SPH_C32(0x31c1ff3d), - SPH_C32(0xa4011e05), SPH_C32(0x14055bfb) }, - { SPH_C32(0x55f7a000), SPH_C32(0x1de3354e), SPH_C32(0x0a987bdd), - SPH_C32(0x16031799), SPH_C32(0xb26eb000), SPH_C32(0xfbcd8e2a), - SPH_C32(0x9720f729), SPH_C32(0xda177608) }, - { SPH_C32(0xf23cc000), SPH_C32(0x42cb39e0), SPH_C32(0x5afd9229), - SPH_C32(0x94e42f6f), SPH_C32(0x022f8000), SPH_C32(0xce2549e4), - SPH_C32(0x317ebce8), SPH_C32(0x398d5ee1) }, - { SPH_C32(0x3995c000), SPH_C32(0xd2ec0e89), SPH_C32(0xe121662e), - SPH_C32(0x4410800e), SPH_C32(0xbd139000), SPH_C32(0x042938f3), - SPH_C32(0x025f55c4), SPH_C32(0xf79f7312) }, - { SPH_C32(0x1b16e000), SPH_C32(0xf69cb51c), SPH_C32(0x4b07a87e), - SPH_C32(0xa92d2a4b), SPH_C32(0x957c8000), SPH_C32(0xee6a2737), - SPH_C32(0x46c754e7), SPH_C32(0x98610020) }, - { SPH_C32(0xd0bfe000), SPH_C32(0x66bb8275), SPH_C32(0xf0db5c79), - SPH_C32(0x79d9852a), SPH_C32(0x2a409000), SPH_C32(0x24665620), - SPH_C32(0x75e6bdcb), SPH_C32(0x56732dd3) }, - { SPH_C32(0x656fc000), SPH_C32(0x62845733), SPH_C32(0x2d447a26), - SPH_C32(0x350871ae), SPH_C32(0x7c56a000), SPH_C32(0x5a3dabcb), - SPH_C32(0x573d6eb0), SPH_C32(0xa5a80504) }, - { SPH_C32(0xaec6c000), SPH_C32(0xf2a3605a), SPH_C32(0x96988e21), - SPH_C32(0xe5fcdecf), SPH_C32(0xc36ab000), SPH_C32(0x9031dadc), - SPH_C32(0x641c879c), SPH_C32(0x6bba28f7) }, - { SPH_C32(0x8c45e000), SPH_C32(0xd6d3dbcf), SPH_C32(0x3cbe4071), - SPH_C32(0x08c1748a), SPH_C32(0xeb05a000), SPH_C32(0x7a72c518), - SPH_C32(0x208486bf), SPH_C32(0x04445bc5) }, - { SPH_C32(0x47ece000), SPH_C32(0x46f4eca6), SPH_C32(0x8762b476), - SPH_C32(0xd835dbeb), SPH_C32(0x5439b000), SPH_C32(0xb07eb40f), - SPH_C32(0x13a56f93), SPH_C32(0xca567636) }, - { SPH_C32(0x06708000), SPH_C32(0x526fda2d), SPH_C32(0x5382c538), - SPH_C32(0x4a93e323), SPH_C32(0x1034c000), SPH_C32(0x9532900c), - SPH_C32(0xbc847343), SPH_C32(0xf7bb9293) }, - { SPH_C32(0xcdd98000), SPH_C32(0xc248ed44), SPH_C32(0xe85e313f), - SPH_C32(0x9a674c42), SPH_C32(0xaf08d000), SPH_C32(0x5f3ee11b), - SPH_C32(0x8fa59a6f), SPH_C32(0x39a9bf60) }, - { SPH_C32(0xef5aa000), SPH_C32(0xe63856d1), SPH_C32(0x4278ff6f), - SPH_C32(0x775ae607), SPH_C32(0x8767c000), SPH_C32(0xb57dfedf), - SPH_C32(0xcb3d9b4c), SPH_C32(0x5657cc52) }, - { SPH_C32(0x24f3a000), SPH_C32(0x761f61b8), SPH_C32(0xf9a40b68), - SPH_C32(0xa7ae4966), SPH_C32(0x385bd000), SPH_C32(0x7f718fc8), - SPH_C32(0xf81c7260), SPH_C32(0x9845e1a1) }, - { SPH_C32(0x91238000), SPH_C32(0x7220b4fe), SPH_C32(0x243b2d37), - SPH_C32(0xeb7fbde2), SPH_C32(0x6e4de000), SPH_C32(0x012a7223), - SPH_C32(0xdac7a11b), SPH_C32(0x6b9ec976) }, - { SPH_C32(0x5a8a8000), SPH_C32(0xe2078397), SPH_C32(0x9fe7d930), - SPH_C32(0x3b8b1283), SPH_C32(0xd171f000), SPH_C32(0xcb260334), - SPH_C32(0xe9e64837), SPH_C32(0xa58ce485) }, - { SPH_C32(0x7809a000), SPH_C32(0xc6773802), SPH_C32(0x35c11760), - SPH_C32(0xd6b6b8c6), SPH_C32(0xf91ee000), SPH_C32(0x21651cf0), - SPH_C32(0xad7e4914), SPH_C32(0xca7297b7) }, - { SPH_C32(0xb3a0a000), SPH_C32(0x56500f6b), SPH_C32(0x8e1de367), - SPH_C32(0x064217a7), SPH_C32(0x4622f000), SPH_C32(0xeb696de7), - SPH_C32(0x9e5fa038), SPH_C32(0x0460ba44) }, - { SPH_C32(0x146bc000), SPH_C32(0x097803c5), SPH_C32(0xde780a93), - SPH_C32(0x84a52f51), SPH_C32(0xf663c000), SPH_C32(0xde81aa29), - SPH_C32(0x3801ebf9), SPH_C32(0xe7fa92ad) }, - { SPH_C32(0xdfc2c000), SPH_C32(0x995f34ac), SPH_C32(0x65a4fe94), - SPH_C32(0x54518030), SPH_C32(0x495fd000), SPH_C32(0x148ddb3e), - SPH_C32(0x0b2002d5), SPH_C32(0x29e8bf5e) }, - { SPH_C32(0xfd41e000), SPH_C32(0xbd2f8f39), SPH_C32(0xcf8230c4), - SPH_C32(0xb96c2a75), SPH_C32(0x6130c000), SPH_C32(0xfecec4fa), - SPH_C32(0x4fb803f6), SPH_C32(0x4616cc6c) }, - { SPH_C32(0x36e8e000), SPH_C32(0x2d08b850), SPH_C32(0x745ec4c3), - SPH_C32(0x69988514), SPH_C32(0xde0cd000), SPH_C32(0x34c2b5ed), - SPH_C32(0x7c99eada), SPH_C32(0x8804e19f) }, - { SPH_C32(0x8338c000), SPH_C32(0x29376d16), SPH_C32(0xa9c1e29c), - SPH_C32(0x25497190), SPH_C32(0x881ae000), SPH_C32(0x4a994806), - SPH_C32(0x5e4239a1), SPH_C32(0x7bdfc948) }, - { SPH_C32(0x4891c000), SPH_C32(0xb9105a7f), SPH_C32(0x121d169b), - SPH_C32(0xf5bddef1), SPH_C32(0x3726f000), SPH_C32(0x80953911), - SPH_C32(0x6d63d08d), SPH_C32(0xb5cde4bb) }, - { SPH_C32(0x6a12e000), SPH_C32(0x9d60e1ea), SPH_C32(0xb83bd8cb), - SPH_C32(0x188074b4), SPH_C32(0x1f49e000), SPH_C32(0x6ad626d5), - SPH_C32(0x29fbd1ae), SPH_C32(0xda339789) }, - { SPH_C32(0xa1bbe000), SPH_C32(0x0d47d683), SPH_C32(0x03e72ccc), - SPH_C32(0xc874dbd5), SPH_C32(0xa075f000), SPH_C32(0xa0da57c2), - SPH_C32(0x1ada3882), SPH_C32(0x1421ba7a) } -}; - -static const sph_u32 T256_7[128][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xa7b80200), SPH_C32(0x1f128433), SPH_C32(0x60e5f9f2), - SPH_C32(0x9e147576), SPH_C32(0xee260000), SPH_C32(0x124b683e), - SPH_C32(0x80c2d68f), SPH_C32(0x3bf3ab2c) }, - { SPH_C32(0xee260000), SPH_C32(0x124b683e), SPH_C32(0x80c2d68f), - SPH_C32(0x3bf3ab2c), SPH_C32(0x499e0200), SPH_C32(0x0d59ec0d), - SPH_C32(0xe0272f7d), SPH_C32(0xa5e7de5a) }, - { SPH_C32(0x499e0200), SPH_C32(0x0d59ec0d), SPH_C32(0xe0272f7d), - SPH_C32(0xa5e7de5a), SPH_C32(0xa7b80200), SPH_C32(0x1f128433), - SPH_C32(0x60e5f9f2), SPH_C32(0x9e147576) }, - { SPH_C32(0x8f3e0400), SPH_C32(0x0d9dc877), SPH_C32(0x6fc548e1), - SPH_C32(0x898d2cd6), SPH_C32(0x14bd0000), SPH_C32(0x2fba37ff), - SPH_C32(0x6a72e5bb), SPH_C32(0x247febe6) }, - { SPH_C32(0x28860600), SPH_C32(0x128f4c44), SPH_C32(0x0f20b113), - SPH_C32(0x179959a0), SPH_C32(0xfa9b0000), SPH_C32(0x3df15fc1), - SPH_C32(0xeab03334), SPH_C32(0x1f8c40ca) }, - { SPH_C32(0x61180400), SPH_C32(0x1fd6a049), SPH_C32(0xef079e6e), - SPH_C32(0xb27e87fa), SPH_C32(0x5d230200), SPH_C32(0x22e3dbf2), - SPH_C32(0x8a55cac6), SPH_C32(0x819835bc) }, - { SPH_C32(0xc6a00600), SPH_C32(0x00c4247a), SPH_C32(0x8fe2679c), - SPH_C32(0x2c6af28c), SPH_C32(0xb3050200), SPH_C32(0x30a8b3cc), - SPH_C32(0x0a971c49), SPH_C32(0xba6b9e90) }, - { SPH_C32(0x14bd0000), SPH_C32(0x2fba37ff), SPH_C32(0x6a72e5bb), - SPH_C32(0x247febe6), SPH_C32(0x9b830400), SPH_C32(0x2227ff88), - SPH_C32(0x05b7ad5a), SPH_C32(0xadf2c730) }, - { SPH_C32(0xb3050200), SPH_C32(0x30a8b3cc), SPH_C32(0x0a971c49), - SPH_C32(0xba6b9e90), SPH_C32(0x75a50400), SPH_C32(0x306c97b6), - SPH_C32(0x85757bd5), SPH_C32(0x96016c1c) }, - { SPH_C32(0xfa9b0000), SPH_C32(0x3df15fc1), SPH_C32(0xeab03334), - SPH_C32(0x1f8c40ca), SPH_C32(0xd21d0600), SPH_C32(0x2f7e1385), - SPH_C32(0xe5908227), SPH_C32(0x0815196a) }, - { SPH_C32(0x5d230200), SPH_C32(0x22e3dbf2), SPH_C32(0x8a55cac6), - SPH_C32(0x819835bc), SPH_C32(0x3c3b0600), SPH_C32(0x3d357bbb), - SPH_C32(0x655254a8), SPH_C32(0x33e6b246) }, - { SPH_C32(0x9b830400), SPH_C32(0x2227ff88), SPH_C32(0x05b7ad5a), - SPH_C32(0xadf2c730), SPH_C32(0x8f3e0400), SPH_C32(0x0d9dc877), - SPH_C32(0x6fc548e1), SPH_C32(0x898d2cd6) }, - { SPH_C32(0x3c3b0600), SPH_C32(0x3d357bbb), SPH_C32(0x655254a8), - SPH_C32(0x33e6b246), SPH_C32(0x61180400), SPH_C32(0x1fd6a049), - SPH_C32(0xef079e6e), SPH_C32(0xb27e87fa) }, - { SPH_C32(0x75a50400), SPH_C32(0x306c97b6), SPH_C32(0x85757bd5), - SPH_C32(0x96016c1c), SPH_C32(0xc6a00600), SPH_C32(0x00c4247a), - SPH_C32(0x8fe2679c), SPH_C32(0x2c6af28c) }, - { SPH_C32(0xd21d0600), SPH_C32(0x2f7e1385), SPH_C32(0xe5908227), - SPH_C32(0x0815196a), SPH_C32(0x28860600), SPH_C32(0x128f4c44), - SPH_C32(0x0f20b113), SPH_C32(0x179959a0) }, - { SPH_C32(0xde320800), SPH_C32(0x288350fe), SPH_C32(0x71852ac7), - SPH_C32(0xa6bf9f96), SPH_C32(0xe18b0000), SPH_C32(0x5459887d), - SPH_C32(0xbf1283d3), SPH_C32(0x1b666a73) }, - { SPH_C32(0x798a0a00), SPH_C32(0x3791d4cd), SPH_C32(0x1160d335), - SPH_C32(0x38abeae0), SPH_C32(0x0fad0000), SPH_C32(0x4612e043), - SPH_C32(0x3fd0555c), SPH_C32(0x2095c15f) }, - { SPH_C32(0x30140800), SPH_C32(0x3ac838c0), SPH_C32(0xf147fc48), - SPH_C32(0x9d4c34ba), SPH_C32(0xa8150200), SPH_C32(0x59006470), - SPH_C32(0x5f35acae), SPH_C32(0xbe81b429) }, - { SPH_C32(0x97ac0a00), SPH_C32(0x25dabcf3), SPH_C32(0x91a205ba), - SPH_C32(0x035841cc), SPH_C32(0x46330200), SPH_C32(0x4b4b0c4e), - SPH_C32(0xdff77a21), SPH_C32(0x85721f05) }, - { SPH_C32(0x510c0c00), SPH_C32(0x251e9889), SPH_C32(0x1e406226), - SPH_C32(0x2f32b340), SPH_C32(0xf5360000), SPH_C32(0x7be3bf82), - SPH_C32(0xd5606668), SPH_C32(0x3f198195) }, - { SPH_C32(0xf6b40e00), SPH_C32(0x3a0c1cba), SPH_C32(0x7ea59bd4), - SPH_C32(0xb126c636), SPH_C32(0x1b100000), SPH_C32(0x69a8d7bc), - SPH_C32(0x55a2b0e7), SPH_C32(0x04ea2ab9) }, - { SPH_C32(0xbf2a0c00), SPH_C32(0x3755f0b7), SPH_C32(0x9e82b4a9), - SPH_C32(0x14c1186c), SPH_C32(0xbca80200), SPH_C32(0x76ba538f), - SPH_C32(0x35474915), SPH_C32(0x9afe5fcf) }, - { SPH_C32(0x18920e00), SPH_C32(0x28477484), SPH_C32(0xfe674d5b), - SPH_C32(0x8ad56d1a), SPH_C32(0x528e0200), SPH_C32(0x64f13bb1), - SPH_C32(0xb5859f9a), SPH_C32(0xa10df4e3) }, - { SPH_C32(0xca8f0800), SPH_C32(0x07396701), SPH_C32(0x1bf7cf7c), - SPH_C32(0x82c07470), SPH_C32(0x7a080400), SPH_C32(0x767e77f5), - SPH_C32(0xbaa52e89), SPH_C32(0xb694ad43) }, - { SPH_C32(0x6d370a00), SPH_C32(0x182be332), SPH_C32(0x7b12368e), - SPH_C32(0x1cd40106), SPH_C32(0x942e0400), SPH_C32(0x64351fcb), - SPH_C32(0x3a67f806), SPH_C32(0x8d67066f) }, - { SPH_C32(0x24a90800), SPH_C32(0x15720f3f), SPH_C32(0x9b3519f3), - SPH_C32(0xb933df5c), SPH_C32(0x33960600), SPH_C32(0x7b279bf8), - SPH_C32(0x5a8201f4), SPH_C32(0x13737319) }, - { SPH_C32(0x83110a00), SPH_C32(0x0a608b0c), SPH_C32(0xfbd0e001), - SPH_C32(0x2727aa2a), SPH_C32(0xddb00600), SPH_C32(0x696cf3c6), - SPH_C32(0xda40d77b), SPH_C32(0x2880d835) }, - { SPH_C32(0x45b10c00), SPH_C32(0x0aa4af76), SPH_C32(0x7432879d), - SPH_C32(0x0b4d58a6), SPH_C32(0x6eb50400), SPH_C32(0x59c4400a), - SPH_C32(0xd0d7cb32), SPH_C32(0x92eb46a5) }, - { SPH_C32(0xe2090e00), SPH_C32(0x15b62b45), SPH_C32(0x14d77e6f), - SPH_C32(0x95592dd0), SPH_C32(0x80930400), SPH_C32(0x4b8f2834), - SPH_C32(0x50151dbd), SPH_C32(0xa918ed89) }, - { SPH_C32(0xab970c00), SPH_C32(0x18efc748), SPH_C32(0xf4f05112), - SPH_C32(0x30bef38a), SPH_C32(0x272b0600), SPH_C32(0x549dac07), - SPH_C32(0x30f0e44f), SPH_C32(0x370c98ff) }, - { SPH_C32(0x0c2f0e00), SPH_C32(0x07fd437b), SPH_C32(0x9415a8e0), - SPH_C32(0xaeaa86fc), SPH_C32(0xc90d0600), SPH_C32(0x46d6c439), - SPH_C32(0xb03232c0), SPH_C32(0x0cff33d3) }, - { SPH_C32(0xe18b0000), SPH_C32(0x5459887d), SPH_C32(0xbf1283d3), - SPH_C32(0x1b666a73), SPH_C32(0x3fb90800), SPH_C32(0x7cdad883), - SPH_C32(0xce97a914), SPH_C32(0xbdd9f5e5) }, - { SPH_C32(0x46330200), SPH_C32(0x4b4b0c4e), SPH_C32(0xdff77a21), - SPH_C32(0x85721f05), SPH_C32(0xd19f0800), SPH_C32(0x6e91b0bd), - SPH_C32(0x4e557f9b), SPH_C32(0x862a5ec9) }, - { SPH_C32(0x0fad0000), SPH_C32(0x4612e043), SPH_C32(0x3fd0555c), - SPH_C32(0x2095c15f), SPH_C32(0x76270a00), SPH_C32(0x7183348e), - SPH_C32(0x2eb08669), SPH_C32(0x183e2bbf) }, - { SPH_C32(0xa8150200), SPH_C32(0x59006470), SPH_C32(0x5f35acae), - SPH_C32(0xbe81b429), SPH_C32(0x98010a00), SPH_C32(0x63c85cb0), - SPH_C32(0xae7250e6), SPH_C32(0x23cd8093) }, - { SPH_C32(0x6eb50400), SPH_C32(0x59c4400a), SPH_C32(0xd0d7cb32), - SPH_C32(0x92eb46a5), SPH_C32(0x2b040800), SPH_C32(0x5360ef7c), - SPH_C32(0xa4e54caf), SPH_C32(0x99a61e03) }, - { SPH_C32(0xc90d0600), SPH_C32(0x46d6c439), SPH_C32(0xb03232c0), - SPH_C32(0x0cff33d3), SPH_C32(0xc5220800), SPH_C32(0x412b8742), - SPH_C32(0x24279a20), SPH_C32(0xa255b52f) }, - { SPH_C32(0x80930400), SPH_C32(0x4b8f2834), SPH_C32(0x50151dbd), - SPH_C32(0xa918ed89), SPH_C32(0x629a0a00), SPH_C32(0x5e390371), - SPH_C32(0x44c263d2), SPH_C32(0x3c41c059) }, - { SPH_C32(0x272b0600), SPH_C32(0x549dac07), SPH_C32(0x30f0e44f), - SPH_C32(0x370c98ff), SPH_C32(0x8cbc0a00), SPH_C32(0x4c726b4f), - SPH_C32(0xc400b55d), SPH_C32(0x07b26b75) }, - { SPH_C32(0xf5360000), SPH_C32(0x7be3bf82), SPH_C32(0xd5606668), - SPH_C32(0x3f198195), SPH_C32(0xa43a0c00), SPH_C32(0x5efd270b), - SPH_C32(0xcb20044e), SPH_C32(0x102b32d5) }, - { SPH_C32(0x528e0200), SPH_C32(0x64f13bb1), SPH_C32(0xb5859f9a), - SPH_C32(0xa10df4e3), SPH_C32(0x4a1c0c00), SPH_C32(0x4cb64f35), - SPH_C32(0x4be2d2c1), SPH_C32(0x2bd899f9) }, - { SPH_C32(0x1b100000), SPH_C32(0x69a8d7bc), SPH_C32(0x55a2b0e7), - SPH_C32(0x04ea2ab9), SPH_C32(0xeda40e00), SPH_C32(0x53a4cb06), - SPH_C32(0x2b072b33), SPH_C32(0xb5ccec8f) }, - { SPH_C32(0xbca80200), SPH_C32(0x76ba538f), SPH_C32(0x35474915), - SPH_C32(0x9afe5fcf), SPH_C32(0x03820e00), SPH_C32(0x41efa338), - SPH_C32(0xabc5fdbc), SPH_C32(0x8e3f47a3) }, - { SPH_C32(0x7a080400), SPH_C32(0x767e77f5), SPH_C32(0xbaa52e89), - SPH_C32(0xb694ad43), SPH_C32(0xb0870c00), SPH_C32(0x714710f4), - SPH_C32(0xa152e1f5), SPH_C32(0x3454d933) }, - { SPH_C32(0xddb00600), SPH_C32(0x696cf3c6), SPH_C32(0xda40d77b), - SPH_C32(0x2880d835), SPH_C32(0x5ea10c00), SPH_C32(0x630c78ca), - SPH_C32(0x2190377a), SPH_C32(0x0fa7721f) }, - { SPH_C32(0x942e0400), SPH_C32(0x64351fcb), SPH_C32(0x3a67f806), - SPH_C32(0x8d67066f), SPH_C32(0xf9190e00), SPH_C32(0x7c1efcf9), - SPH_C32(0x4175ce88), SPH_C32(0x91b30769) }, - { SPH_C32(0x33960600), SPH_C32(0x7b279bf8), SPH_C32(0x5a8201f4), - SPH_C32(0x13737319), SPH_C32(0x173f0e00), SPH_C32(0x6e5594c7), - SPH_C32(0xc1b71807), SPH_C32(0xaa40ac45) }, - { SPH_C32(0x3fb90800), SPH_C32(0x7cdad883), SPH_C32(0xce97a914), - SPH_C32(0xbdd9f5e5), SPH_C32(0xde320800), SPH_C32(0x288350fe), - SPH_C32(0x71852ac7), SPH_C32(0xa6bf9f96) }, - { SPH_C32(0x98010a00), SPH_C32(0x63c85cb0), SPH_C32(0xae7250e6), - SPH_C32(0x23cd8093), SPH_C32(0x30140800), SPH_C32(0x3ac838c0), - SPH_C32(0xf147fc48), SPH_C32(0x9d4c34ba) }, - { SPH_C32(0xd19f0800), SPH_C32(0x6e91b0bd), SPH_C32(0x4e557f9b), - SPH_C32(0x862a5ec9), SPH_C32(0x97ac0a00), SPH_C32(0x25dabcf3), - SPH_C32(0x91a205ba), SPH_C32(0x035841cc) }, - { SPH_C32(0x76270a00), SPH_C32(0x7183348e), SPH_C32(0x2eb08669), - SPH_C32(0x183e2bbf), SPH_C32(0x798a0a00), SPH_C32(0x3791d4cd), - SPH_C32(0x1160d335), SPH_C32(0x38abeae0) }, - { SPH_C32(0xb0870c00), SPH_C32(0x714710f4), SPH_C32(0xa152e1f5), - SPH_C32(0x3454d933), SPH_C32(0xca8f0800), SPH_C32(0x07396701), - SPH_C32(0x1bf7cf7c), SPH_C32(0x82c07470) }, - { SPH_C32(0x173f0e00), SPH_C32(0x6e5594c7), SPH_C32(0xc1b71807), - SPH_C32(0xaa40ac45), SPH_C32(0x24a90800), SPH_C32(0x15720f3f), - SPH_C32(0x9b3519f3), SPH_C32(0xb933df5c) }, - { SPH_C32(0x5ea10c00), SPH_C32(0x630c78ca), SPH_C32(0x2190377a), - SPH_C32(0x0fa7721f), SPH_C32(0x83110a00), SPH_C32(0x0a608b0c), - SPH_C32(0xfbd0e001), SPH_C32(0x2727aa2a) }, - { SPH_C32(0xf9190e00), SPH_C32(0x7c1efcf9), SPH_C32(0x4175ce88), - SPH_C32(0x91b30769), SPH_C32(0x6d370a00), SPH_C32(0x182be332), - SPH_C32(0x7b12368e), SPH_C32(0x1cd40106) }, - { SPH_C32(0x2b040800), SPH_C32(0x5360ef7c), SPH_C32(0xa4e54caf), - SPH_C32(0x99a61e03), SPH_C32(0x45b10c00), SPH_C32(0x0aa4af76), - SPH_C32(0x7432879d), SPH_C32(0x0b4d58a6) }, - { SPH_C32(0x8cbc0a00), SPH_C32(0x4c726b4f), SPH_C32(0xc400b55d), - SPH_C32(0x07b26b75), SPH_C32(0xab970c00), SPH_C32(0x18efc748), - SPH_C32(0xf4f05112), SPH_C32(0x30bef38a) }, - { SPH_C32(0xc5220800), SPH_C32(0x412b8742), SPH_C32(0x24279a20), - SPH_C32(0xa255b52f), SPH_C32(0x0c2f0e00), SPH_C32(0x07fd437b), - SPH_C32(0x9415a8e0), SPH_C32(0xaeaa86fc) }, - { SPH_C32(0x629a0a00), SPH_C32(0x5e390371), SPH_C32(0x44c263d2), - SPH_C32(0x3c41c059), SPH_C32(0xe2090e00), SPH_C32(0x15b62b45), - SPH_C32(0x14d77e6f), SPH_C32(0x95592dd0) }, - { SPH_C32(0xa43a0c00), SPH_C32(0x5efd270b), SPH_C32(0xcb20044e), - SPH_C32(0x102b32d5), SPH_C32(0x510c0c00), SPH_C32(0x251e9889), - SPH_C32(0x1e406226), SPH_C32(0x2f32b340) }, - { SPH_C32(0x03820e00), SPH_C32(0x41efa338), SPH_C32(0xabc5fdbc), - SPH_C32(0x8e3f47a3), SPH_C32(0xbf2a0c00), SPH_C32(0x3755f0b7), - SPH_C32(0x9e82b4a9), SPH_C32(0x14c1186c) }, - { SPH_C32(0x4a1c0c00), SPH_C32(0x4cb64f35), SPH_C32(0x4be2d2c1), - SPH_C32(0x2bd899f9), SPH_C32(0x18920e00), SPH_C32(0x28477484), - SPH_C32(0xfe674d5b), SPH_C32(0x8ad56d1a) }, - { SPH_C32(0xeda40e00), SPH_C32(0x53a4cb06), SPH_C32(0x2b072b33), - SPH_C32(0xb5ccec8f), SPH_C32(0xf6b40e00), SPH_C32(0x3a0c1cba), - SPH_C32(0x7ea59bd4), SPH_C32(0xb126c636) }, - { SPH_C32(0x74951000), SPH_C32(0x5a2b467e), SPH_C32(0x88fd1d2b), - SPH_C32(0x1ee68292), SPH_C32(0xcba90000), SPH_C32(0x90273769), - SPH_C32(0xbbdcf407), SPH_C32(0xd0f4af61) }, - { SPH_C32(0xd32d1200), SPH_C32(0x4539c24d), SPH_C32(0xe818e4d9), - SPH_C32(0x80f2f7e4), SPH_C32(0x258f0000), SPH_C32(0x826c5f57), - SPH_C32(0x3b1e2288), SPH_C32(0xeb07044d) }, - { SPH_C32(0x9ab31000), SPH_C32(0x48602e40), SPH_C32(0x083fcba4), - SPH_C32(0x251529be), SPH_C32(0x82370200), SPH_C32(0x9d7edb64), - SPH_C32(0x5bfbdb7a), SPH_C32(0x7513713b) }, - { SPH_C32(0x3d0b1200), SPH_C32(0x5772aa73), SPH_C32(0x68da3256), - SPH_C32(0xbb015cc8), SPH_C32(0x6c110200), SPH_C32(0x8f35b35a), - SPH_C32(0xdb390df5), SPH_C32(0x4ee0da17) }, - { SPH_C32(0xfbab1400), SPH_C32(0x57b68e09), SPH_C32(0xe73855ca), - SPH_C32(0x976bae44), SPH_C32(0xdf140000), SPH_C32(0xbf9d0096), - SPH_C32(0xd1ae11bc), SPH_C32(0xf48b4487) }, - { SPH_C32(0x5c131600), SPH_C32(0x48a40a3a), SPH_C32(0x87ddac38), - SPH_C32(0x097fdb32), SPH_C32(0x31320000), SPH_C32(0xadd668a8), - SPH_C32(0x516cc733), SPH_C32(0xcf78efab) }, - { SPH_C32(0x158d1400), SPH_C32(0x45fde637), SPH_C32(0x67fa8345), - SPH_C32(0xac980568), SPH_C32(0x968a0200), SPH_C32(0xb2c4ec9b), - SPH_C32(0x31893ec1), SPH_C32(0x516c9add) }, - { SPH_C32(0xb2351600), SPH_C32(0x5aef6204), SPH_C32(0x071f7ab7), - SPH_C32(0x328c701e), SPH_C32(0x78ac0200), SPH_C32(0xa08f84a5), - SPH_C32(0xb14be84e), SPH_C32(0x6a9f31f1) }, - { SPH_C32(0x60281000), SPH_C32(0x75917181), SPH_C32(0xe28ff890), - SPH_C32(0x3a996974), SPH_C32(0x502a0400), SPH_C32(0xb200c8e1), - SPH_C32(0xbe6b595d), SPH_C32(0x7d066851) }, - { SPH_C32(0xc7901200), SPH_C32(0x6a83f5b2), SPH_C32(0x826a0162), - SPH_C32(0xa48d1c02), SPH_C32(0xbe0c0400), SPH_C32(0xa04ba0df), - SPH_C32(0x3ea98fd2), SPH_C32(0x46f5c37d) }, - { SPH_C32(0x8e0e1000), SPH_C32(0x67da19bf), SPH_C32(0x624d2e1f), - SPH_C32(0x016ac258), SPH_C32(0x19b40600), SPH_C32(0xbf5924ec), - SPH_C32(0x5e4c7620), SPH_C32(0xd8e1b60b) }, - { SPH_C32(0x29b61200), SPH_C32(0x78c89d8c), SPH_C32(0x02a8d7ed), - SPH_C32(0x9f7eb72e), SPH_C32(0xf7920600), SPH_C32(0xad124cd2), - SPH_C32(0xde8ea0af), SPH_C32(0xe3121d27) }, - { SPH_C32(0xef161400), SPH_C32(0x780cb9f6), SPH_C32(0x8d4ab071), - SPH_C32(0xb31445a2), SPH_C32(0x44970400), SPH_C32(0x9dbaff1e), - SPH_C32(0xd419bce6), SPH_C32(0x597983b7) }, - { SPH_C32(0x48ae1600), SPH_C32(0x671e3dc5), SPH_C32(0xedaf4983), - SPH_C32(0x2d0030d4), SPH_C32(0xaab10400), SPH_C32(0x8ff19720), - SPH_C32(0x54db6a69), SPH_C32(0x628a289b) }, - { SPH_C32(0x01301400), SPH_C32(0x6a47d1c8), SPH_C32(0x0d8866fe), - SPH_C32(0x88e7ee8e), SPH_C32(0x0d090600), SPH_C32(0x90e31313), - SPH_C32(0x343e939b), SPH_C32(0xfc9e5ded) }, - { SPH_C32(0xa6881600), SPH_C32(0x755555fb), SPH_C32(0x6d6d9f0c), - SPH_C32(0x16f39bf8), SPH_C32(0xe32f0600), SPH_C32(0x82a87b2d), - SPH_C32(0xb4fc4514), SPH_C32(0xc76df6c1) }, - { SPH_C32(0xaaa71800), SPH_C32(0x72a81680), SPH_C32(0xf97837ec), - SPH_C32(0xb8591d04), SPH_C32(0x2a220000), SPH_C32(0xc47ebf14), - SPH_C32(0x04ce77d4), SPH_C32(0xcb92c512) }, - { SPH_C32(0x0d1f1a00), SPH_C32(0x6dba92b3), SPH_C32(0x999dce1e), - SPH_C32(0x264d6872), SPH_C32(0xc4040000), SPH_C32(0xd635d72a), - SPH_C32(0x840ca15b), SPH_C32(0xf0616e3e) }, - { SPH_C32(0x44811800), SPH_C32(0x60e37ebe), SPH_C32(0x79bae163), - SPH_C32(0x83aab628), SPH_C32(0x63bc0200), SPH_C32(0xc9275319), - SPH_C32(0xe4e958a9), SPH_C32(0x6e751b48) }, - { SPH_C32(0xe3391a00), SPH_C32(0x7ff1fa8d), SPH_C32(0x195f1891), - SPH_C32(0x1dbec35e), SPH_C32(0x8d9a0200), SPH_C32(0xdb6c3b27), - SPH_C32(0x642b8e26), SPH_C32(0x5586b064) }, - { SPH_C32(0x25991c00), SPH_C32(0x7f35def7), SPH_C32(0x96bd7f0d), - SPH_C32(0x31d431d2), SPH_C32(0x3e9f0000), SPH_C32(0xebc488eb), - SPH_C32(0x6ebc926f), SPH_C32(0xefed2ef4) }, - { SPH_C32(0x82211e00), SPH_C32(0x60275ac4), SPH_C32(0xf65886ff), - SPH_C32(0xafc044a4), SPH_C32(0xd0b90000), SPH_C32(0xf98fe0d5), - SPH_C32(0xee7e44e0), SPH_C32(0xd41e85d8) }, - { SPH_C32(0xcbbf1c00), SPH_C32(0x6d7eb6c9), SPH_C32(0x167fa982), - SPH_C32(0x0a279afe), SPH_C32(0x77010200), SPH_C32(0xe69d64e6), - SPH_C32(0x8e9bbd12), SPH_C32(0x4a0af0ae) }, - { SPH_C32(0x6c071e00), SPH_C32(0x726c32fa), SPH_C32(0x769a5070), - SPH_C32(0x9433ef88), SPH_C32(0x99270200), SPH_C32(0xf4d60cd8), - SPH_C32(0x0e596b9d), SPH_C32(0x71f95b82) }, - { SPH_C32(0xbe1a1800), SPH_C32(0x5d12217f), SPH_C32(0x930ad257), - SPH_C32(0x9c26f6e2), SPH_C32(0xb1a10400), SPH_C32(0xe659409c), - SPH_C32(0x0179da8e), SPH_C32(0x66600222) }, - { SPH_C32(0x19a21a00), SPH_C32(0x4200a54c), SPH_C32(0xf3ef2ba5), - SPH_C32(0x02328394), SPH_C32(0x5f870400), SPH_C32(0xf41228a2), - SPH_C32(0x81bb0c01), SPH_C32(0x5d93a90e) }, - { SPH_C32(0x503c1800), SPH_C32(0x4f594941), SPH_C32(0x13c804d8), - SPH_C32(0xa7d55dce), SPH_C32(0xf83f0600), SPH_C32(0xeb00ac91), - SPH_C32(0xe15ef5f3), SPH_C32(0xc387dc78) }, - { SPH_C32(0xf7841a00), SPH_C32(0x504bcd72), SPH_C32(0x732dfd2a), - SPH_C32(0x39c128b8), SPH_C32(0x16190600), SPH_C32(0xf94bc4af), - SPH_C32(0x619c237c), SPH_C32(0xf8747754) }, - { SPH_C32(0x31241c00), SPH_C32(0x508fe908), SPH_C32(0xfccf9ab6), - SPH_C32(0x15abda34), SPH_C32(0xa51c0400), SPH_C32(0xc9e37763), - SPH_C32(0x6b0b3f35), SPH_C32(0x421fe9c4) }, - { SPH_C32(0x969c1e00), SPH_C32(0x4f9d6d3b), SPH_C32(0x9c2a6344), - SPH_C32(0x8bbfaf42), SPH_C32(0x4b3a0400), SPH_C32(0xdba81f5d), - SPH_C32(0xebc9e9ba), SPH_C32(0x79ec42e8) }, - { SPH_C32(0xdf021c00), SPH_C32(0x42c48136), SPH_C32(0x7c0d4c39), - SPH_C32(0x2e587118), SPH_C32(0xec820600), SPH_C32(0xc4ba9b6e), - SPH_C32(0x8b2c1048), SPH_C32(0xe7f8379e) }, - { SPH_C32(0x78ba1e00), SPH_C32(0x5dd60505), SPH_C32(0x1ce8b5cb), - SPH_C32(0xb04c046e), SPH_C32(0x02a40600), SPH_C32(0xd6f1f350), - SPH_C32(0x0beec6c7), SPH_C32(0xdc0b9cb2) }, - { SPH_C32(0x951e1000), SPH_C32(0x0e72ce03), SPH_C32(0x37ef9ef8), - SPH_C32(0x0580e8e1), SPH_C32(0xf4100800), SPH_C32(0xecfdefea), - SPH_C32(0x754b5d13), SPH_C32(0x6d2d5a84) }, - { SPH_C32(0x32a61200), SPH_C32(0x11604a30), SPH_C32(0x570a670a), - SPH_C32(0x9b949d97), SPH_C32(0x1a360800), SPH_C32(0xfeb687d4), - SPH_C32(0xf5898b9c), SPH_C32(0x56def1a8) }, - { SPH_C32(0x7b381000), SPH_C32(0x1c39a63d), SPH_C32(0xb72d4877), - SPH_C32(0x3e7343cd), SPH_C32(0xbd8e0a00), SPH_C32(0xe1a403e7), - SPH_C32(0x956c726e), SPH_C32(0xc8ca84de) }, - { SPH_C32(0xdc801200), SPH_C32(0x032b220e), SPH_C32(0xd7c8b185), - SPH_C32(0xa06736bb), SPH_C32(0x53a80a00), SPH_C32(0xf3ef6bd9), - SPH_C32(0x15aea4e1), SPH_C32(0xf3392ff2) }, - { SPH_C32(0x1a201400), SPH_C32(0x03ef0674), SPH_C32(0x582ad619), - SPH_C32(0x8c0dc437), SPH_C32(0xe0ad0800), SPH_C32(0xc347d815), - SPH_C32(0x1f39b8a8), SPH_C32(0x4952b162) }, - { SPH_C32(0xbd981600), SPH_C32(0x1cfd8247), SPH_C32(0x38cf2feb), - SPH_C32(0x1219b141), SPH_C32(0x0e8b0800), SPH_C32(0xd10cb02b), - SPH_C32(0x9ffb6e27), SPH_C32(0x72a11a4e) }, - { SPH_C32(0xf4061400), SPH_C32(0x11a46e4a), SPH_C32(0xd8e80096), - SPH_C32(0xb7fe6f1b), SPH_C32(0xa9330a00), SPH_C32(0xce1e3418), - SPH_C32(0xff1e97d5), SPH_C32(0xecb56f38) }, - { SPH_C32(0x53be1600), SPH_C32(0x0eb6ea79), SPH_C32(0xb80df964), - SPH_C32(0x29ea1a6d), SPH_C32(0x47150a00), SPH_C32(0xdc555c26), - SPH_C32(0x7fdc415a), SPH_C32(0xd746c414) }, - { SPH_C32(0x81a31000), SPH_C32(0x21c8f9fc), SPH_C32(0x5d9d7b43), - SPH_C32(0x21ff0307), SPH_C32(0x6f930c00), SPH_C32(0xceda1062), - SPH_C32(0x70fcf049), SPH_C32(0xc0df9db4) }, - { SPH_C32(0x261b1200), SPH_C32(0x3eda7dcf), SPH_C32(0x3d7882b1), - SPH_C32(0xbfeb7671), SPH_C32(0x81b50c00), SPH_C32(0xdc91785c), - SPH_C32(0xf03e26c6), SPH_C32(0xfb2c3698) }, - { SPH_C32(0x6f851000), SPH_C32(0x338391c2), SPH_C32(0xdd5fadcc), - SPH_C32(0x1a0ca82b), SPH_C32(0x260d0e00), SPH_C32(0xc383fc6f), - SPH_C32(0x90dbdf34), SPH_C32(0x653843ee) }, - { SPH_C32(0xc83d1200), SPH_C32(0x2c9115f1), SPH_C32(0xbdba543e), - SPH_C32(0x8418dd5d), SPH_C32(0xc82b0e00), SPH_C32(0xd1c89451), - SPH_C32(0x101909bb), SPH_C32(0x5ecbe8c2) }, - { SPH_C32(0x0e9d1400), SPH_C32(0x2c55318b), SPH_C32(0x325833a2), - SPH_C32(0xa8722fd1), SPH_C32(0x7b2e0c00), SPH_C32(0xe160279d), - SPH_C32(0x1a8e15f2), SPH_C32(0xe4a07652) }, - { SPH_C32(0xa9251600), SPH_C32(0x3347b5b8), SPH_C32(0x52bdca50), - SPH_C32(0x36665aa7), SPH_C32(0x95080c00), SPH_C32(0xf32b4fa3), - SPH_C32(0x9a4cc37d), SPH_C32(0xdf53dd7e) }, - { SPH_C32(0xe0bb1400), SPH_C32(0x3e1e59b5), SPH_C32(0xb29ae52d), - SPH_C32(0x938184fd), SPH_C32(0x32b00e00), SPH_C32(0xec39cb90), - SPH_C32(0xfaa93a8f), SPH_C32(0x4147a808) }, - { SPH_C32(0x47031600), SPH_C32(0x210cdd86), SPH_C32(0xd27f1cdf), - SPH_C32(0x0d95f18b), SPH_C32(0xdc960e00), SPH_C32(0xfe72a3ae), - SPH_C32(0x7a6bec00), SPH_C32(0x7ab40324) }, - { SPH_C32(0x4b2c1800), SPH_C32(0x26f19efd), SPH_C32(0x466ab43f), - SPH_C32(0xa33f7777), SPH_C32(0x159b0800), SPH_C32(0xb8a46797), - SPH_C32(0xca59dec0), SPH_C32(0x764b30f7) }, - { SPH_C32(0xec941a00), SPH_C32(0x39e31ace), SPH_C32(0x268f4dcd), - SPH_C32(0x3d2b0201), SPH_C32(0xfbbd0800), SPH_C32(0xaaef0fa9), - SPH_C32(0x4a9b084f), SPH_C32(0x4db89bdb) }, - { SPH_C32(0xa50a1800), SPH_C32(0x34baf6c3), SPH_C32(0xc6a862b0), - SPH_C32(0x98ccdc5b), SPH_C32(0x5c050a00), SPH_C32(0xb5fd8b9a), - SPH_C32(0x2a7ef1bd), SPH_C32(0xd3aceead) }, - { SPH_C32(0x02b21a00), SPH_C32(0x2ba872f0), SPH_C32(0xa64d9b42), - SPH_C32(0x06d8a92d), SPH_C32(0xb2230a00), SPH_C32(0xa7b6e3a4), - SPH_C32(0xaabc2732), SPH_C32(0xe85f4581) }, - { SPH_C32(0xc4121c00), SPH_C32(0x2b6c568a), SPH_C32(0x29affcde), - SPH_C32(0x2ab25ba1), SPH_C32(0x01260800), SPH_C32(0x971e5068), - SPH_C32(0xa02b3b7b), SPH_C32(0x5234db11) }, - { SPH_C32(0x63aa1e00), SPH_C32(0x347ed2b9), SPH_C32(0x494a052c), - SPH_C32(0xb4a62ed7), SPH_C32(0xef000800), SPH_C32(0x85553856), - SPH_C32(0x20e9edf4), SPH_C32(0x69c7703d) }, - { SPH_C32(0x2a341c00), SPH_C32(0x39273eb4), SPH_C32(0xa96d2a51), - SPH_C32(0x1141f08d), SPH_C32(0x48b80a00), SPH_C32(0x9a47bc65), - SPH_C32(0x400c1406), SPH_C32(0xf7d3054b) }, - { SPH_C32(0x8d8c1e00), SPH_C32(0x2635ba87), SPH_C32(0xc988d3a3), - SPH_C32(0x8f5585fb), SPH_C32(0xa69e0a00), SPH_C32(0x880cd45b), - SPH_C32(0xc0cec289), SPH_C32(0xcc20ae67) }, - { SPH_C32(0x5f911800), SPH_C32(0x094ba902), SPH_C32(0x2c185184), - SPH_C32(0x87409c91), SPH_C32(0x8e180c00), SPH_C32(0x9a83981f), - SPH_C32(0xcfee739a), SPH_C32(0xdbb9f7c7) }, - { SPH_C32(0xf8291a00), SPH_C32(0x16592d31), SPH_C32(0x4cfda876), - SPH_C32(0x1954e9e7), SPH_C32(0x603e0c00), SPH_C32(0x88c8f021), - SPH_C32(0x4f2ca515), SPH_C32(0xe04a5ceb) }, - { SPH_C32(0xb1b71800), SPH_C32(0x1b00c13c), SPH_C32(0xacda870b), - SPH_C32(0xbcb337bd), SPH_C32(0xc7860e00), SPH_C32(0x97da7412), - SPH_C32(0x2fc95ce7), SPH_C32(0x7e5e299d) }, - { SPH_C32(0x160f1a00), SPH_C32(0x0412450f), SPH_C32(0xcc3f7ef9), - SPH_C32(0x22a742cb), SPH_C32(0x29a00e00), SPH_C32(0x85911c2c), - SPH_C32(0xaf0b8a68), SPH_C32(0x45ad82b1) }, - { SPH_C32(0xd0af1c00), SPH_C32(0x04d66175), SPH_C32(0x43dd1965), - SPH_C32(0x0ecdb047), SPH_C32(0x9aa50c00), SPH_C32(0xb539afe0), - SPH_C32(0xa59c9621), SPH_C32(0xffc61c21) }, - { SPH_C32(0x77171e00), SPH_C32(0x1bc4e546), SPH_C32(0x2338e097), - SPH_C32(0x90d9c531), SPH_C32(0x74830c00), SPH_C32(0xa772c7de), - SPH_C32(0x255e40ae), SPH_C32(0xc435b70d) }, - { SPH_C32(0x3e891c00), SPH_C32(0x169d094b), SPH_C32(0xc31fcfea), - SPH_C32(0x353e1b6b), SPH_C32(0xd33b0e00), SPH_C32(0xb86043ed), - SPH_C32(0x45bbb95c), SPH_C32(0x5a21c27b) }, - { SPH_C32(0x99311e00), SPH_C32(0x098f8d78), SPH_C32(0xa3fa3618), - SPH_C32(0xab2a6e1d), SPH_C32(0x3d1d0e00), SPH_C32(0xaa2b2bd3), - SPH_C32(0xc5796fd3), SPH_C32(0x61d26957) } -}; - -static const sph_u32 T256_14[128][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x5c720000), SPH_C32(0xc9bacd12), SPH_C32(0x79a90df9), - SPH_C32(0x63e92178), SPH_C32(0xfeca0020), SPH_C32(0x485d28e4), - SPH_C32(0x806741fd), SPH_C32(0x814681b8) }, - { SPH_C32(0x4dce0040), SPH_C32(0x3b5bec7e), SPH_C32(0x36656ba8), - SPH_C32(0x23633a05), SPH_C32(0x78ab0000), SPH_C32(0xa0cd5a34), - SPH_C32(0x5d5ca0f7), SPH_C32(0x727784cb) }, - { SPH_C32(0x11bc0040), SPH_C32(0xf2e1216c), SPH_C32(0x4fcc6651), - SPH_C32(0x408a1b7d), SPH_C32(0x86610020), SPH_C32(0xe89072d0), - SPH_C32(0xdd3be10a), SPH_C32(0xf3310573) }, - { SPH_C32(0x78ab0000), SPH_C32(0xa0cd5a34), SPH_C32(0x5d5ca0f7), - SPH_C32(0x727784cb), SPH_C32(0x35650040), SPH_C32(0x9b96b64a), - SPH_C32(0x6b39cb5f), SPH_C32(0x5114bece) }, - { SPH_C32(0x24d90000), SPH_C32(0x69779726), SPH_C32(0x24f5ad0e), - SPH_C32(0x119ea5b3), SPH_C32(0xcbaf0060), SPH_C32(0xd3cb9eae), - SPH_C32(0xeb5e8aa2), SPH_C32(0xd0523f76) }, - { SPH_C32(0x35650040), SPH_C32(0x9b96b64a), SPH_C32(0x6b39cb5f), - SPH_C32(0x5114bece), SPH_C32(0x4dce0040), SPH_C32(0x3b5bec7e), - SPH_C32(0x36656ba8), SPH_C32(0x23633a05) }, - { SPH_C32(0x69170040), SPH_C32(0x522c7b58), SPH_C32(0x1290c6a6), - SPH_C32(0x32fd9fb6), SPH_C32(0xb3040060), SPH_C32(0x7306c49a), - SPH_C32(0xb6022a55), SPH_C32(0xa225bbbd) }, - { SPH_C32(0x5bd20080), SPH_C32(0x450f18ec), SPH_C32(0xc2c46c55), - SPH_C32(0xf362b233), SPH_C32(0x39a60000), SPH_C32(0x4ab753eb), - SPH_C32(0xd14e094b), SPH_C32(0xb772b42b) }, - { SPH_C32(0x07a00080), SPH_C32(0x8cb5d5fe), SPH_C32(0xbb6d61ac), - SPH_C32(0x908b934b), SPH_C32(0xc76c0020), SPH_C32(0x02ea7b0f), - SPH_C32(0x512948b6), SPH_C32(0x36343593) }, - { SPH_C32(0x161c00c0), SPH_C32(0x7e54f492), SPH_C32(0xf4a107fd), - SPH_C32(0xd0018836), SPH_C32(0x410d0000), SPH_C32(0xea7a09df), - SPH_C32(0x8c12a9bc), SPH_C32(0xc50530e0) }, - { SPH_C32(0x4a6e00c0), SPH_C32(0xb7ee3980), SPH_C32(0x8d080a04), - SPH_C32(0xb3e8a94e), SPH_C32(0xbfc70020), SPH_C32(0xa227213b), - SPH_C32(0x0c75e841), SPH_C32(0x4443b158) }, - { SPH_C32(0x23790080), SPH_C32(0xe5c242d8), SPH_C32(0x9f98cca2), - SPH_C32(0x811536f8), SPH_C32(0x0cc30040), SPH_C32(0xd121e5a1), - SPH_C32(0xba77c214), SPH_C32(0xe6660ae5) }, - { SPH_C32(0x7f0b0080), SPH_C32(0x2c788fca), SPH_C32(0xe631c15b), - SPH_C32(0xe2fc1780), SPH_C32(0xf2090060), SPH_C32(0x997ccd45), - SPH_C32(0x3a1083e9), SPH_C32(0x67208b5d) }, - { SPH_C32(0x6eb700c0), SPH_C32(0xde99aea6), SPH_C32(0xa9fda70a), - SPH_C32(0xa2760cfd), SPH_C32(0x74680040), SPH_C32(0x71ecbf95), - SPH_C32(0xe72b62e3), SPH_C32(0x94118e2e) }, - { SPH_C32(0x32c500c0), SPH_C32(0x172363b4), SPH_C32(0xd054aaf3), - SPH_C32(0xc19f2d85), SPH_C32(0x8aa20060), SPH_C32(0x39b19771), - SPH_C32(0x674c231e), SPH_C32(0x15570f96) }, - { SPH_C32(0x39a60000), SPH_C32(0x4ab753eb), SPH_C32(0xd14e094b), - SPH_C32(0xb772b42b), SPH_C32(0x62740080), SPH_C32(0x0fb84b07), - SPH_C32(0x138a651e), SPH_C32(0x44100618) }, - { SPH_C32(0x65d40000), SPH_C32(0x830d9ef9), SPH_C32(0xa8e704b2), - SPH_C32(0xd49b9553), SPH_C32(0x9cbe00a0), SPH_C32(0x47e563e3), - SPH_C32(0x93ed24e3), SPH_C32(0xc55687a0) }, - { SPH_C32(0x74680040), SPH_C32(0x71ecbf95), SPH_C32(0xe72b62e3), - SPH_C32(0x94118e2e), SPH_C32(0x1adf0080), SPH_C32(0xaf751133), - SPH_C32(0x4ed6c5e9), SPH_C32(0x366782d3) }, - { SPH_C32(0x281a0040), SPH_C32(0xb8567287), SPH_C32(0x9e826f1a), - SPH_C32(0xf7f8af56), SPH_C32(0xe41500a0), SPH_C32(0xe72839d7), - SPH_C32(0xceb18414), SPH_C32(0xb721036b) }, - { SPH_C32(0x410d0000), SPH_C32(0xea7a09df), SPH_C32(0x8c12a9bc), - SPH_C32(0xc50530e0), SPH_C32(0x571100c0), SPH_C32(0x942efd4d), - SPH_C32(0x78b3ae41), SPH_C32(0x1504b8d6) }, - { SPH_C32(0x1d7f0000), SPH_C32(0x23c0c4cd), SPH_C32(0xf5bba445), - SPH_C32(0xa6ec1198), SPH_C32(0xa9db00e0), SPH_C32(0xdc73d5a9), - SPH_C32(0xf8d4efbc), SPH_C32(0x9442396e) }, - { SPH_C32(0x0cc30040), SPH_C32(0xd121e5a1), SPH_C32(0xba77c214), - SPH_C32(0xe6660ae5), SPH_C32(0x2fba00c0), SPH_C32(0x34e3a779), - SPH_C32(0x25ef0eb6), SPH_C32(0x67733c1d) }, - { SPH_C32(0x50b10040), SPH_C32(0x189b28b3), SPH_C32(0xc3decfed), - SPH_C32(0x858f2b9d), SPH_C32(0xd17000e0), SPH_C32(0x7cbe8f9d), - SPH_C32(0xa5884f4b), SPH_C32(0xe635bda5) }, - { SPH_C32(0x62740080), SPH_C32(0x0fb84b07), SPH_C32(0x138a651e), - SPH_C32(0x44100618), SPH_C32(0x5bd20080), SPH_C32(0x450f18ec), - SPH_C32(0xc2c46c55), SPH_C32(0xf362b233) }, - { SPH_C32(0x3e060080), SPH_C32(0xc6028615), SPH_C32(0x6a2368e7), - SPH_C32(0x27f92760), SPH_C32(0xa51800a0), SPH_C32(0x0d523008), - SPH_C32(0x42a32da8), SPH_C32(0x7224338b) }, - { SPH_C32(0x2fba00c0), SPH_C32(0x34e3a779), SPH_C32(0x25ef0eb6), - SPH_C32(0x67733c1d), SPH_C32(0x23790080), SPH_C32(0xe5c242d8), - SPH_C32(0x9f98cca2), SPH_C32(0x811536f8) }, - { SPH_C32(0x73c800c0), SPH_C32(0xfd596a6b), SPH_C32(0x5c46034f), - SPH_C32(0x049a1d65), SPH_C32(0xddb300a0), SPH_C32(0xad9f6a3c), - SPH_C32(0x1fff8d5f), SPH_C32(0x0053b740) }, - { SPH_C32(0x1adf0080), SPH_C32(0xaf751133), SPH_C32(0x4ed6c5e9), - SPH_C32(0x366782d3), SPH_C32(0x6eb700c0), SPH_C32(0xde99aea6), - SPH_C32(0xa9fda70a), SPH_C32(0xa2760cfd) }, - { SPH_C32(0x46ad0080), SPH_C32(0x66cfdc21), SPH_C32(0x377fc810), - SPH_C32(0x558ea3ab), SPH_C32(0x907d00e0), SPH_C32(0x96c48642), - SPH_C32(0x299ae6f7), SPH_C32(0x23308d45) }, - { SPH_C32(0x571100c0), SPH_C32(0x942efd4d), SPH_C32(0x78b3ae41), - SPH_C32(0x1504b8d6), SPH_C32(0x161c00c0), SPH_C32(0x7e54f492), - SPH_C32(0xf4a107fd), SPH_C32(0xd0018836) }, - { SPH_C32(0x0b6300c0), SPH_C32(0x5d94305f), SPH_C32(0x011aa3b8), - SPH_C32(0x76ed99ae), SPH_C32(0xe8d600e0), SPH_C32(0x3609dc76), - SPH_C32(0x74c64600), SPH_C32(0x5147098e) }, - { SPH_C32(0xb7a40100), SPH_C32(0x8a1f31d8), SPH_C32(0x8589d8ab), - SPH_C32(0xe6c46464), SPH_C32(0x734c0000), SPH_C32(0x956fa7d6), - SPH_C32(0xa29d1297), SPH_C32(0x6ee56854) }, - { SPH_C32(0xebd60100), SPH_C32(0x43a5fcca), SPH_C32(0xfc20d552), - SPH_C32(0x852d451c), SPH_C32(0x8d860020), SPH_C32(0xdd328f32), - SPH_C32(0x22fa536a), SPH_C32(0xefa3e9ec) }, - { SPH_C32(0xfa6a0140), SPH_C32(0xb144dda6), SPH_C32(0xb3ecb303), - SPH_C32(0xc5a75e61), SPH_C32(0x0be70000), SPH_C32(0x35a2fde2), - SPH_C32(0xffc1b260), SPH_C32(0x1c92ec9f) }, - { SPH_C32(0xa6180140), SPH_C32(0x78fe10b4), SPH_C32(0xca45befa), - SPH_C32(0xa64e7f19), SPH_C32(0xf52d0020), SPH_C32(0x7dffd506), - SPH_C32(0x7fa6f39d), SPH_C32(0x9dd46d27) }, - { SPH_C32(0xcf0f0100), SPH_C32(0x2ad26bec), SPH_C32(0xd8d5785c), - SPH_C32(0x94b3e0af), SPH_C32(0x46290040), SPH_C32(0x0ef9119c), - SPH_C32(0xc9a4d9c8), SPH_C32(0x3ff1d69a) }, - { SPH_C32(0x937d0100), SPH_C32(0xe368a6fe), SPH_C32(0xa17c75a5), - SPH_C32(0xf75ac1d7), SPH_C32(0xb8e30060), SPH_C32(0x46a43978), - SPH_C32(0x49c39835), SPH_C32(0xbeb75722) }, - { SPH_C32(0x82c10140), SPH_C32(0x11898792), SPH_C32(0xeeb013f4), - SPH_C32(0xb7d0daaa), SPH_C32(0x3e820040), SPH_C32(0xae344ba8), - SPH_C32(0x94f8793f), SPH_C32(0x4d865251) }, - { SPH_C32(0xdeb30140), SPH_C32(0xd8334a80), SPH_C32(0x97191e0d), - SPH_C32(0xd439fbd2), SPH_C32(0xc0480060), SPH_C32(0xe669634c), - SPH_C32(0x149f38c2), SPH_C32(0xccc0d3e9) }, - { SPH_C32(0xec760180), SPH_C32(0xcf102934), SPH_C32(0x474db4fe), - SPH_C32(0x15a6d657), SPH_C32(0x4aea0000), SPH_C32(0xdfd8f43d), - SPH_C32(0x73d31bdc), SPH_C32(0xd997dc7f) }, - { SPH_C32(0xb0040180), SPH_C32(0x06aae426), SPH_C32(0x3ee4b907), - SPH_C32(0x764ff72f), SPH_C32(0xb4200020), SPH_C32(0x9785dcd9), - SPH_C32(0xf3b45a21), SPH_C32(0x58d15dc7) }, - { SPH_C32(0xa1b801c0), SPH_C32(0xf44bc54a), SPH_C32(0x7128df56), - SPH_C32(0x36c5ec52), SPH_C32(0x32410000), SPH_C32(0x7f15ae09), - SPH_C32(0x2e8fbb2b), SPH_C32(0xabe058b4) }, - { SPH_C32(0xfdca01c0), SPH_C32(0x3df10858), SPH_C32(0x0881d2af), - SPH_C32(0x552ccd2a), SPH_C32(0xcc8b0020), SPH_C32(0x374886ed), - SPH_C32(0xaee8fad6), SPH_C32(0x2aa6d90c) }, - { SPH_C32(0x94dd0180), SPH_C32(0x6fdd7300), SPH_C32(0x1a111409), - SPH_C32(0x67d1529c), SPH_C32(0x7f8f0040), SPH_C32(0x444e4277), - SPH_C32(0x18ead083), SPH_C32(0x888362b1) }, - { SPH_C32(0xc8af0180), SPH_C32(0xa667be12), SPH_C32(0x63b819f0), - SPH_C32(0x043873e4), SPH_C32(0x81450060), SPH_C32(0x0c136a93), - SPH_C32(0x988d917e), SPH_C32(0x09c5e309) }, - { SPH_C32(0xd91301c0), SPH_C32(0x54869f7e), SPH_C32(0x2c747fa1), - SPH_C32(0x44b26899), SPH_C32(0x07240040), SPH_C32(0xe4831843), - SPH_C32(0x45b67074), SPH_C32(0xfaf4e67a) }, - { SPH_C32(0x856101c0), SPH_C32(0x9d3c526c), SPH_C32(0x55dd7258), - SPH_C32(0x275b49e1), SPH_C32(0xf9ee0060), SPH_C32(0xacde30a7), - SPH_C32(0xc5d13189), SPH_C32(0x7bb267c2) }, - { SPH_C32(0x8e020100), SPH_C32(0xc0a86233), SPH_C32(0x54c7d1e0), - SPH_C32(0x51b6d04f), SPH_C32(0x11380080), SPH_C32(0x9ad7ecd1), - SPH_C32(0xb1177789), SPH_C32(0x2af56e4c) }, - { SPH_C32(0xd2700100), SPH_C32(0x0912af21), SPH_C32(0x2d6edc19), - SPH_C32(0x325ff137), SPH_C32(0xeff200a0), SPH_C32(0xd28ac435), - SPH_C32(0x31703674), SPH_C32(0xabb3eff4) }, - { SPH_C32(0xc3cc0140), SPH_C32(0xfbf38e4d), SPH_C32(0x62a2ba48), - SPH_C32(0x72d5ea4a), SPH_C32(0x69930080), SPH_C32(0x3a1ab6e5), - SPH_C32(0xec4bd77e), SPH_C32(0x5882ea87) }, - { SPH_C32(0x9fbe0140), SPH_C32(0x3249435f), SPH_C32(0x1b0bb7b1), - SPH_C32(0x113ccb32), SPH_C32(0x975900a0), SPH_C32(0x72479e01), - SPH_C32(0x6c2c9683), SPH_C32(0xd9c46b3f) }, - { SPH_C32(0xf6a90100), SPH_C32(0x60653807), SPH_C32(0x099b7117), - SPH_C32(0x23c15484), SPH_C32(0x245d00c0), SPH_C32(0x01415a9b), - SPH_C32(0xda2ebcd6), SPH_C32(0x7be1d082) }, - { SPH_C32(0xaadb0100), SPH_C32(0xa9dff515), SPH_C32(0x70327cee), - SPH_C32(0x402875fc), SPH_C32(0xda9700e0), SPH_C32(0x491c727f), - SPH_C32(0x5a49fd2b), SPH_C32(0xfaa7513a) }, - { SPH_C32(0xbb670140), SPH_C32(0x5b3ed479), SPH_C32(0x3ffe1abf), - SPH_C32(0x00a26e81), SPH_C32(0x5cf600c0), SPH_C32(0xa18c00af), - SPH_C32(0x87721c21), SPH_C32(0x09965449) }, - { SPH_C32(0xe7150140), SPH_C32(0x9284196b), SPH_C32(0x46571746), - SPH_C32(0x634b4ff9), SPH_C32(0xa23c00e0), SPH_C32(0xe9d1284b), - SPH_C32(0x07155ddc), SPH_C32(0x88d0d5f1) }, - { SPH_C32(0xd5d00180), SPH_C32(0x85a77adf), SPH_C32(0x9603bdb5), - SPH_C32(0xa2d4627c), SPH_C32(0x289e0080), SPH_C32(0xd060bf3a), - SPH_C32(0x60597ec2), SPH_C32(0x9d87da67) }, - { SPH_C32(0x89a20180), SPH_C32(0x4c1db7cd), SPH_C32(0xefaab04c), - SPH_C32(0xc13d4304), SPH_C32(0xd65400a0), SPH_C32(0x983d97de), - SPH_C32(0xe03e3f3f), SPH_C32(0x1cc15bdf) }, - { SPH_C32(0x981e01c0), SPH_C32(0xbefc96a1), SPH_C32(0xa066d61d), - SPH_C32(0x81b75879), SPH_C32(0x50350080), SPH_C32(0x70ade50e), - SPH_C32(0x3d05de35), SPH_C32(0xeff05eac) }, - { SPH_C32(0xc46c01c0), SPH_C32(0x77465bb3), SPH_C32(0xd9cfdbe4), - SPH_C32(0xe25e7901), SPH_C32(0xaeff00a0), SPH_C32(0x38f0cdea), - SPH_C32(0xbd629fc8), SPH_C32(0x6eb6df14) }, - { SPH_C32(0xad7b0180), SPH_C32(0x256a20eb), SPH_C32(0xcb5f1d42), - SPH_C32(0xd0a3e6b7), SPH_C32(0x1dfb00c0), SPH_C32(0x4bf60970), - SPH_C32(0x0b60b59d), SPH_C32(0xcc9364a9) }, - { SPH_C32(0xf1090180), SPH_C32(0xecd0edf9), SPH_C32(0xb2f610bb), - SPH_C32(0xb34ac7cf), SPH_C32(0xe33100e0), SPH_C32(0x03ab2194), - SPH_C32(0x8b07f460), SPH_C32(0x4dd5e511) }, - { SPH_C32(0xe0b501c0), SPH_C32(0x1e31cc95), SPH_C32(0xfd3a76ea), - SPH_C32(0xf3c0dcb2), SPH_C32(0x655000c0), SPH_C32(0xeb3b5344), - SPH_C32(0x563c156a), SPH_C32(0xbee4e062) }, - { SPH_C32(0xbcc701c0), SPH_C32(0xd78b0187), SPH_C32(0x84937b13), - SPH_C32(0x9029fdca), SPH_C32(0x9b9a00e0), SPH_C32(0xa3667ba0), - SPH_C32(0xd65b5497), SPH_C32(0x3fa261da) }, - { SPH_C32(0x734c0000), SPH_C32(0x956fa7d6), SPH_C32(0xa29d1297), - SPH_C32(0x6ee56854), SPH_C32(0xc4e80100), SPH_C32(0x1f70960e), - SPH_C32(0x2714ca3c), SPH_C32(0x88210c30) }, - { SPH_C32(0x2f3e0000), SPH_C32(0x5cd56ac4), SPH_C32(0xdb341f6e), - SPH_C32(0x0d0c492c), SPH_C32(0x3a220120), SPH_C32(0x572dbeea), - SPH_C32(0xa7738bc1), SPH_C32(0x09678d88) }, - { SPH_C32(0x3e820040), SPH_C32(0xae344ba8), SPH_C32(0x94f8793f), - SPH_C32(0x4d865251), SPH_C32(0xbc430100), SPH_C32(0xbfbdcc3a), - SPH_C32(0x7a486acb), SPH_C32(0xfa5688fb) }, - { SPH_C32(0x62f00040), SPH_C32(0x678e86ba), SPH_C32(0xed5174c6), - SPH_C32(0x2e6f7329), SPH_C32(0x42890120), SPH_C32(0xf7e0e4de), - SPH_C32(0xfa2f2b36), SPH_C32(0x7b100943) }, - { SPH_C32(0x0be70000), SPH_C32(0x35a2fde2), SPH_C32(0xffc1b260), - SPH_C32(0x1c92ec9f), SPH_C32(0xf18d0140), SPH_C32(0x84e62044), - SPH_C32(0x4c2d0163), SPH_C32(0xd935b2fe) }, - { SPH_C32(0x57950000), SPH_C32(0xfc1830f0), SPH_C32(0x8668bf99), - SPH_C32(0x7f7bcde7), SPH_C32(0x0f470160), SPH_C32(0xccbb08a0), - SPH_C32(0xcc4a409e), SPH_C32(0x58733346) }, - { SPH_C32(0x46290040), SPH_C32(0x0ef9119c), SPH_C32(0xc9a4d9c8), - SPH_C32(0x3ff1d69a), SPH_C32(0x89260140), SPH_C32(0x242b7a70), - SPH_C32(0x1171a194), SPH_C32(0xab423635) }, - { SPH_C32(0x1a5b0040), SPH_C32(0xc743dc8e), SPH_C32(0xb00dd431), - SPH_C32(0x5c18f7e2), SPH_C32(0x77ec0160), SPH_C32(0x6c765294), - SPH_C32(0x9116e069), SPH_C32(0x2a04b78d) }, - { SPH_C32(0x289e0080), SPH_C32(0xd060bf3a), SPH_C32(0x60597ec2), - SPH_C32(0x9d87da67), SPH_C32(0xfd4e0100), SPH_C32(0x55c7c5e5), - SPH_C32(0xf65ac377), SPH_C32(0x3f53b81b) }, - { SPH_C32(0x74ec0080), SPH_C32(0x19da7228), SPH_C32(0x19f0733b), - SPH_C32(0xfe6efb1f), SPH_C32(0x03840120), SPH_C32(0x1d9aed01), - SPH_C32(0x763d828a), SPH_C32(0xbe1539a3) }, - { SPH_C32(0x655000c0), SPH_C32(0xeb3b5344), SPH_C32(0x563c156a), - SPH_C32(0xbee4e062), SPH_C32(0x85e50100), SPH_C32(0xf50a9fd1), - SPH_C32(0xab066380), SPH_C32(0x4d243cd0) }, - { SPH_C32(0x392200c0), SPH_C32(0x22819e56), SPH_C32(0x2f951893), - SPH_C32(0xdd0dc11a), SPH_C32(0x7b2f0120), SPH_C32(0xbd57b735), - SPH_C32(0x2b61227d), SPH_C32(0xcc62bd68) }, - { SPH_C32(0x50350080), SPH_C32(0x70ade50e), SPH_C32(0x3d05de35), - SPH_C32(0xeff05eac), SPH_C32(0xc82b0140), SPH_C32(0xce5173af), - SPH_C32(0x9d630828), SPH_C32(0x6e4706d5) }, - { SPH_C32(0x0c470080), SPH_C32(0xb917281c), SPH_C32(0x44acd3cc), - SPH_C32(0x8c197fd4), SPH_C32(0x36e10160), SPH_C32(0x860c5b4b), - SPH_C32(0x1d0449d5), SPH_C32(0xef01876d) }, - { SPH_C32(0x1dfb00c0), SPH_C32(0x4bf60970), SPH_C32(0x0b60b59d), - SPH_C32(0xcc9364a9), SPH_C32(0xb0800140), SPH_C32(0x6e9c299b), - SPH_C32(0xc03fa8df), SPH_C32(0x1c30821e) }, - { SPH_C32(0x418900c0), SPH_C32(0x824cc462), SPH_C32(0x72c9b864), - SPH_C32(0xaf7a45d1), SPH_C32(0x4e4a0160), SPH_C32(0x26c1017f), - SPH_C32(0x4058e922), SPH_C32(0x9d7603a6) }, - { SPH_C32(0x4aea0000), SPH_C32(0xdfd8f43d), SPH_C32(0x73d31bdc), - SPH_C32(0xd997dc7f), SPH_C32(0xa69c0180), SPH_C32(0x10c8dd09), - SPH_C32(0x349eaf22), SPH_C32(0xcc310a28) }, - { SPH_C32(0x16980000), SPH_C32(0x1662392f), SPH_C32(0x0a7a1625), - SPH_C32(0xba7efd07), SPH_C32(0x585601a0), SPH_C32(0x5895f5ed), - SPH_C32(0xb4f9eedf), SPH_C32(0x4d778b90) }, - { SPH_C32(0x07240040), SPH_C32(0xe4831843), SPH_C32(0x45b67074), - SPH_C32(0xfaf4e67a), SPH_C32(0xde370180), SPH_C32(0xb005873d), - SPH_C32(0x69c20fd5), SPH_C32(0xbe468ee3) }, - { SPH_C32(0x5b560040), SPH_C32(0x2d39d551), SPH_C32(0x3c1f7d8d), - SPH_C32(0x991dc702), SPH_C32(0x20fd01a0), SPH_C32(0xf858afd9), - SPH_C32(0xe9a54e28), SPH_C32(0x3f000f5b) }, - { SPH_C32(0x32410000), SPH_C32(0x7f15ae09), SPH_C32(0x2e8fbb2b), - SPH_C32(0xabe058b4), SPH_C32(0x93f901c0), SPH_C32(0x8b5e6b43), - SPH_C32(0x5fa7647d), SPH_C32(0x9d25b4e6) }, - { SPH_C32(0x6e330000), SPH_C32(0xb6af631b), SPH_C32(0x5726b6d2), - SPH_C32(0xc80979cc), SPH_C32(0x6d3301e0), SPH_C32(0xc30343a7), - SPH_C32(0xdfc02580), SPH_C32(0x1c63355e) }, - { SPH_C32(0x7f8f0040), SPH_C32(0x444e4277), SPH_C32(0x18ead083), - SPH_C32(0x888362b1), SPH_C32(0xeb5201c0), SPH_C32(0x2b933177), - SPH_C32(0x02fbc48a), SPH_C32(0xef52302d) }, - { SPH_C32(0x23fd0040), SPH_C32(0x8df48f65), SPH_C32(0x6143dd7a), - SPH_C32(0xeb6a43c9), SPH_C32(0x159801e0), SPH_C32(0x63ce1993), - SPH_C32(0x829c8577), SPH_C32(0x6e14b195) }, - { SPH_C32(0x11380080), SPH_C32(0x9ad7ecd1), SPH_C32(0xb1177789), - SPH_C32(0x2af56e4c), SPH_C32(0x9f3a0180), SPH_C32(0x5a7f8ee2), - SPH_C32(0xe5d0a669), SPH_C32(0x7b43be03) }, - { SPH_C32(0x4d4a0080), SPH_C32(0x536d21c3), SPH_C32(0xc8be7a70), - SPH_C32(0x491c4f34), SPH_C32(0x61f001a0), SPH_C32(0x1222a606), - SPH_C32(0x65b7e794), SPH_C32(0xfa053fbb) }, - { SPH_C32(0x5cf600c0), SPH_C32(0xa18c00af), SPH_C32(0x87721c21), - SPH_C32(0x09965449), SPH_C32(0xe7910180), SPH_C32(0xfab2d4d6), - SPH_C32(0xb88c069e), SPH_C32(0x09343ac8) }, - { SPH_C32(0x008400c0), SPH_C32(0x6836cdbd), SPH_C32(0xfedb11d8), - SPH_C32(0x6a7f7531), SPH_C32(0x195b01a0), SPH_C32(0xb2effc32), - SPH_C32(0x38eb4763), SPH_C32(0x8872bb70) }, - { SPH_C32(0x69930080), SPH_C32(0x3a1ab6e5), SPH_C32(0xec4bd77e), - SPH_C32(0x5882ea87), SPH_C32(0xaa5f01c0), SPH_C32(0xc1e938a8), - SPH_C32(0x8ee96d36), SPH_C32(0x2a5700cd) }, - { SPH_C32(0x35e10080), SPH_C32(0xf3a07bf7), SPH_C32(0x95e2da87), - SPH_C32(0x3b6bcbff), SPH_C32(0x549501e0), SPH_C32(0x89b4104c), - SPH_C32(0x0e8e2ccb), SPH_C32(0xab118175) }, - { SPH_C32(0x245d00c0), SPH_C32(0x01415a9b), SPH_C32(0xda2ebcd6), - SPH_C32(0x7be1d082), SPH_C32(0xd2f401c0), SPH_C32(0x6124629c), - SPH_C32(0xd3b5cdc1), SPH_C32(0x58208406) }, - { SPH_C32(0x782f00c0), SPH_C32(0xc8fb9789), SPH_C32(0xa387b12f), - SPH_C32(0x1808f1fa), SPH_C32(0x2c3e01e0), SPH_C32(0x29794a78), - SPH_C32(0x53d28c3c), SPH_C32(0xd96605be) }, - { SPH_C32(0xc4e80100), SPH_C32(0x1f70960e), SPH_C32(0x2714ca3c), - SPH_C32(0x88210c30), SPH_C32(0xb7a40100), SPH_C32(0x8a1f31d8), - SPH_C32(0x8589d8ab), SPH_C32(0xe6c46464) }, - { SPH_C32(0x989a0100), SPH_C32(0xd6ca5b1c), SPH_C32(0x5ebdc7c5), - SPH_C32(0xebc82d48), SPH_C32(0x496e0120), SPH_C32(0xc242193c), - SPH_C32(0x05ee9956), SPH_C32(0x6782e5dc) }, - { SPH_C32(0x89260140), SPH_C32(0x242b7a70), SPH_C32(0x1171a194), - SPH_C32(0xab423635), SPH_C32(0xcf0f0100), SPH_C32(0x2ad26bec), - SPH_C32(0xd8d5785c), SPH_C32(0x94b3e0af) }, - { SPH_C32(0xd5540140), SPH_C32(0xed91b762), SPH_C32(0x68d8ac6d), - SPH_C32(0xc8ab174d), SPH_C32(0x31c50120), SPH_C32(0x628f4308), - SPH_C32(0x58b239a1), SPH_C32(0x15f56117) }, - { SPH_C32(0xbc430100), SPH_C32(0xbfbdcc3a), SPH_C32(0x7a486acb), - SPH_C32(0xfa5688fb), SPH_C32(0x82c10140), SPH_C32(0x11898792), - SPH_C32(0xeeb013f4), SPH_C32(0xb7d0daaa) }, - { SPH_C32(0xe0310100), SPH_C32(0x76070128), SPH_C32(0x03e16732), - SPH_C32(0x99bfa983), SPH_C32(0x7c0b0160), SPH_C32(0x59d4af76), - SPH_C32(0x6ed75209), SPH_C32(0x36965b12) }, - { SPH_C32(0xf18d0140), SPH_C32(0x84e62044), SPH_C32(0x4c2d0163), - SPH_C32(0xd935b2fe), SPH_C32(0xfa6a0140), SPH_C32(0xb144dda6), - SPH_C32(0xb3ecb303), SPH_C32(0xc5a75e61) }, - { SPH_C32(0xadff0140), SPH_C32(0x4d5ced56), SPH_C32(0x35840c9a), - SPH_C32(0xbadc9386), SPH_C32(0x04a00160), SPH_C32(0xf919f542), - SPH_C32(0x338bf2fe), SPH_C32(0x44e1dfd9) }, - { SPH_C32(0x9f3a0180), SPH_C32(0x5a7f8ee2), SPH_C32(0xe5d0a669), - SPH_C32(0x7b43be03), SPH_C32(0x8e020100), SPH_C32(0xc0a86233), - SPH_C32(0x54c7d1e0), SPH_C32(0x51b6d04f) }, - { SPH_C32(0xc3480180), SPH_C32(0x93c543f0), SPH_C32(0x9c79ab90), - SPH_C32(0x18aa9f7b), SPH_C32(0x70c80120), SPH_C32(0x88f54ad7), - SPH_C32(0xd4a0901d), SPH_C32(0xd0f051f7) }, - { SPH_C32(0xd2f401c0), SPH_C32(0x6124629c), SPH_C32(0xd3b5cdc1), - SPH_C32(0x58208406), SPH_C32(0xf6a90100), SPH_C32(0x60653807), - SPH_C32(0x099b7117), SPH_C32(0x23c15484) }, - { SPH_C32(0x8e8601c0), SPH_C32(0xa89eaf8e), SPH_C32(0xaa1cc038), - SPH_C32(0x3bc9a57e), SPH_C32(0x08630120), SPH_C32(0x283810e3), - SPH_C32(0x89fc30ea), SPH_C32(0xa287d53c) }, - { SPH_C32(0xe7910180), SPH_C32(0xfab2d4d6), SPH_C32(0xb88c069e), - SPH_C32(0x09343ac8), SPH_C32(0xbb670140), SPH_C32(0x5b3ed479), - SPH_C32(0x3ffe1abf), SPH_C32(0x00a26e81) }, - { SPH_C32(0xbbe30180), SPH_C32(0x330819c4), SPH_C32(0xc1250b67), - SPH_C32(0x6add1bb0), SPH_C32(0x45ad0160), SPH_C32(0x1363fc9d), - SPH_C32(0xbf995b42), SPH_C32(0x81e4ef39) }, - { SPH_C32(0xaa5f01c0), SPH_C32(0xc1e938a8), SPH_C32(0x8ee96d36), - SPH_C32(0x2a5700cd), SPH_C32(0xc3cc0140), SPH_C32(0xfbf38e4d), - SPH_C32(0x62a2ba48), SPH_C32(0x72d5ea4a) }, - { SPH_C32(0xf62d01c0), SPH_C32(0x0853f5ba), SPH_C32(0xf74060cf), - SPH_C32(0x49be21b5), SPH_C32(0x3d060160), SPH_C32(0xb3aea6a9), - SPH_C32(0xe2c5fbb5), SPH_C32(0xf3936bf2) }, - { SPH_C32(0xfd4e0100), SPH_C32(0x55c7c5e5), SPH_C32(0xf65ac377), - SPH_C32(0x3f53b81b), SPH_C32(0xd5d00180), SPH_C32(0x85a77adf), - SPH_C32(0x9603bdb5), SPH_C32(0xa2d4627c) }, - { SPH_C32(0xa13c0100), SPH_C32(0x9c7d08f7), SPH_C32(0x8ff3ce8e), - SPH_C32(0x5cba9963), SPH_C32(0x2b1a01a0), SPH_C32(0xcdfa523b), - SPH_C32(0x1664fc48), SPH_C32(0x2392e3c4) }, - { SPH_C32(0xb0800140), SPH_C32(0x6e9c299b), SPH_C32(0xc03fa8df), - SPH_C32(0x1c30821e), SPH_C32(0xad7b0180), SPH_C32(0x256a20eb), - SPH_C32(0xcb5f1d42), SPH_C32(0xd0a3e6b7) }, - { SPH_C32(0xecf20140), SPH_C32(0xa726e489), SPH_C32(0xb996a526), - SPH_C32(0x7fd9a366), SPH_C32(0x53b101a0), SPH_C32(0x6d37080f), - SPH_C32(0x4b385cbf), SPH_C32(0x51e5670f) }, - { SPH_C32(0x85e50100), SPH_C32(0xf50a9fd1), SPH_C32(0xab066380), - SPH_C32(0x4d243cd0), SPH_C32(0xe0b501c0), SPH_C32(0x1e31cc95), - SPH_C32(0xfd3a76ea), SPH_C32(0xf3c0dcb2) }, - { SPH_C32(0xd9970100), SPH_C32(0x3cb052c3), SPH_C32(0xd2af6e79), - SPH_C32(0x2ecd1da8), SPH_C32(0x1e7f01e0), SPH_C32(0x566ce471), - SPH_C32(0x7d5d3717), SPH_C32(0x72865d0a) }, - { SPH_C32(0xc82b0140), SPH_C32(0xce5173af), SPH_C32(0x9d630828), - SPH_C32(0x6e4706d5), SPH_C32(0x981e01c0), SPH_C32(0xbefc96a1), - SPH_C32(0xa066d61d), SPH_C32(0x81b75879) }, - { SPH_C32(0x94590140), SPH_C32(0x07ebbebd), SPH_C32(0xe4ca05d1), - SPH_C32(0x0dae27ad), SPH_C32(0x66d401e0), SPH_C32(0xf6a1be45), - SPH_C32(0x200197e0), SPH_C32(0x00f1d9c1) }, - { SPH_C32(0xa69c0180), SPH_C32(0x10c8dd09), SPH_C32(0x349eaf22), - SPH_C32(0xcc310a28), SPH_C32(0xec760180), SPH_C32(0xcf102934), - SPH_C32(0x474db4fe), SPH_C32(0x15a6d657) }, - { SPH_C32(0xfaee0180), SPH_C32(0xd972101b), SPH_C32(0x4d37a2db), - SPH_C32(0xafd82b50), SPH_C32(0x12bc01a0), SPH_C32(0x874d01d0), - SPH_C32(0xc72af503), SPH_C32(0x94e057ef) }, - { SPH_C32(0xeb5201c0), SPH_C32(0x2b933177), SPH_C32(0x02fbc48a), - SPH_C32(0xef52302d), SPH_C32(0x94dd0180), SPH_C32(0x6fdd7300), - SPH_C32(0x1a111409), SPH_C32(0x67d1529c) }, - { SPH_C32(0xb72001c0), SPH_C32(0xe229fc65), SPH_C32(0x7b52c973), - SPH_C32(0x8cbb1155), SPH_C32(0x6a1701a0), SPH_C32(0x27805be4), - SPH_C32(0x9a7655f4), SPH_C32(0xe697d324) }, - { SPH_C32(0xde370180), SPH_C32(0xb005873d), SPH_C32(0x69c20fd5), - SPH_C32(0xbe468ee3), SPH_C32(0xd91301c0), SPH_C32(0x54869f7e), - SPH_C32(0x2c747fa1), SPH_C32(0x44b26899) }, - { SPH_C32(0x82450180), SPH_C32(0x79bf4a2f), SPH_C32(0x106b022c), - SPH_C32(0xddafaf9b), SPH_C32(0x27d901e0), SPH_C32(0x1cdbb79a), - SPH_C32(0xac133e5c), SPH_C32(0xc5f4e921) }, - { SPH_C32(0x93f901c0), SPH_C32(0x8b5e6b43), SPH_C32(0x5fa7647d), - SPH_C32(0x9d25b4e6), SPH_C32(0xa1b801c0), SPH_C32(0xf44bc54a), - SPH_C32(0x7128df56), SPH_C32(0x36c5ec52) }, - { SPH_C32(0xcf8b01c0), SPH_C32(0x42e4a651), SPH_C32(0x260e6984), - SPH_C32(0xfecc959e), SPH_C32(0x5f7201e0), SPH_C32(0xbc16edae), - SPH_C32(0xf14f9eab), SPH_C32(0xb7836dea) } -}; - -static const sph_u32 T256_21[128][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xd0080004), SPH_C32(0x8c768f77), SPH_C32(0x9dc5b050), - SPH_C32(0xaf4a29da), SPH_C32(0x6ba90000), SPH_C32(0x40ebf9aa), - SPH_C32(0x98321c3d), SPH_C32(0x76acc733) }, - { SPH_C32(0x6ba90000), SPH_C32(0x40ebf9aa), SPH_C32(0x98321c3d), - SPH_C32(0x76acc733), SPH_C32(0xbba10004), SPH_C32(0xcc9d76dd), - SPH_C32(0x05f7ac6d), SPH_C32(0xd9e6eee9) }, - { SPH_C32(0xbba10004), SPH_C32(0xcc9d76dd), SPH_C32(0x05f7ac6d), - SPH_C32(0xd9e6eee9), SPH_C32(0xd0080004), SPH_C32(0x8c768f77), - SPH_C32(0x9dc5b050), SPH_C32(0xaf4a29da) }, - { SPH_C32(0xa8ae0008), SPH_C32(0x2079397d), SPH_C32(0xfe739301), - SPH_C32(0xb8a92831), SPH_C32(0x171c0000), SPH_C32(0xb26e3344), - SPH_C32(0x9e6a837e), SPH_C32(0x58f8485f) }, - { SPH_C32(0x78a6000c), SPH_C32(0xac0fb60a), SPH_C32(0x63b62351), - SPH_C32(0x17e301eb), SPH_C32(0x7cb50000), SPH_C32(0xf285caee), - SPH_C32(0x06589f43), SPH_C32(0x2e548f6c) }, - { SPH_C32(0xc3070008), SPH_C32(0x6092c0d7), SPH_C32(0x66418f3c), - SPH_C32(0xce05ef02), SPH_C32(0xacbd0004), SPH_C32(0x7ef34599), - SPH_C32(0x9b9d2f13), SPH_C32(0x811ea6b6) }, - { SPH_C32(0x130f000c), SPH_C32(0xece44fa0), SPH_C32(0xfb843f6c), - SPH_C32(0x614fc6d8), SPH_C32(0xc7140004), SPH_C32(0x3e18bc33), - SPH_C32(0x03af332e), SPH_C32(0xf7b26185) }, - { SPH_C32(0x171c0000), SPH_C32(0xb26e3344), SPH_C32(0x9e6a837e), - SPH_C32(0x58f8485f), SPH_C32(0xbfb20008), SPH_C32(0x92170a39), - SPH_C32(0x6019107f), SPH_C32(0xe051606e) }, - { SPH_C32(0xc7140004), SPH_C32(0x3e18bc33), SPH_C32(0x03af332e), - SPH_C32(0xf7b26185), SPH_C32(0xd41b0008), SPH_C32(0xd2fcf393), - SPH_C32(0xf82b0c42), SPH_C32(0x96fda75d) }, - { SPH_C32(0x7cb50000), SPH_C32(0xf285caee), SPH_C32(0x06589f43), - SPH_C32(0x2e548f6c), SPH_C32(0x0413000c), SPH_C32(0x5e8a7ce4), - SPH_C32(0x65eebc12), SPH_C32(0x39b78e87) }, - { SPH_C32(0xacbd0004), SPH_C32(0x7ef34599), SPH_C32(0x9b9d2f13), - SPH_C32(0x811ea6b6), SPH_C32(0x6fba000c), SPH_C32(0x1e61854e), - SPH_C32(0xfddca02f), SPH_C32(0x4f1b49b4) }, - { SPH_C32(0xbfb20008), SPH_C32(0x92170a39), SPH_C32(0x6019107f), - SPH_C32(0xe051606e), SPH_C32(0xa8ae0008), SPH_C32(0x2079397d), - SPH_C32(0xfe739301), SPH_C32(0xb8a92831) }, - { SPH_C32(0x6fba000c), SPH_C32(0x1e61854e), SPH_C32(0xfddca02f), - SPH_C32(0x4f1b49b4), SPH_C32(0xc3070008), SPH_C32(0x6092c0d7), - SPH_C32(0x66418f3c), SPH_C32(0xce05ef02) }, - { SPH_C32(0xd41b0008), SPH_C32(0xd2fcf393), SPH_C32(0xf82b0c42), - SPH_C32(0x96fda75d), SPH_C32(0x130f000c), SPH_C32(0xece44fa0), - SPH_C32(0xfb843f6c), SPH_C32(0x614fc6d8) }, - { SPH_C32(0x0413000c), SPH_C32(0x5e8a7ce4), SPH_C32(0x65eebc12), - SPH_C32(0x39b78e87), SPH_C32(0x78a6000c), SPH_C32(0xac0fb60a), - SPH_C32(0x63b62351), SPH_C32(0x17e301eb) }, - { SPH_C32(0x515c0010), SPH_C32(0x40f372fb), SPH_C32(0xfce72602), - SPH_C32(0x71575061), SPH_C32(0x2e390000), SPH_C32(0x64dd6689), - SPH_C32(0x3cd406fc), SPH_C32(0xb1f490bc) }, - { SPH_C32(0x81540014), SPH_C32(0xcc85fd8c), SPH_C32(0x61229652), - SPH_C32(0xde1d79bb), SPH_C32(0x45900000), SPH_C32(0x24369f23), - SPH_C32(0xa4e61ac1), SPH_C32(0xc758578f) }, - { SPH_C32(0x3af50010), SPH_C32(0x00188b51), SPH_C32(0x64d53a3f), - SPH_C32(0x07fb9752), SPH_C32(0x95980004), SPH_C32(0xa8401054), - SPH_C32(0x3923aa91), SPH_C32(0x68127e55) }, - { SPH_C32(0xeafd0014), SPH_C32(0x8c6e0426), SPH_C32(0xf9108a6f), - SPH_C32(0xa8b1be88), SPH_C32(0xfe310004), SPH_C32(0xe8abe9fe), - SPH_C32(0xa111b6ac), SPH_C32(0x1ebeb966) }, - { SPH_C32(0xf9f20018), SPH_C32(0x608a4b86), SPH_C32(0x0294b503), - SPH_C32(0xc9fe7850), SPH_C32(0x39250000), SPH_C32(0xd6b355cd), - SPH_C32(0xa2be8582), SPH_C32(0xe90cd8e3) }, - { SPH_C32(0x29fa001c), SPH_C32(0xecfcc4f1), SPH_C32(0x9f510553), - SPH_C32(0x66b4518a), SPH_C32(0x528c0000), SPH_C32(0x9658ac67), - SPH_C32(0x3a8c99bf), SPH_C32(0x9fa01fd0) }, - { SPH_C32(0x925b0018), SPH_C32(0x2061b22c), SPH_C32(0x9aa6a93e), - SPH_C32(0xbf52bf63), SPH_C32(0x82840004), SPH_C32(0x1a2e2310), - SPH_C32(0xa74929ef), SPH_C32(0x30ea360a) }, - { SPH_C32(0x4253001c), SPH_C32(0xac173d5b), SPH_C32(0x0763196e), - SPH_C32(0x101896b9), SPH_C32(0xe92d0004), SPH_C32(0x5ac5daba), - SPH_C32(0x3f7b35d2), SPH_C32(0x4646f139) }, - { SPH_C32(0x46400010), SPH_C32(0xf29d41bf), SPH_C32(0x628da57c), - SPH_C32(0x29af183e), SPH_C32(0x918b0008), SPH_C32(0xf6ca6cb0), - SPH_C32(0x5ccd1683), SPH_C32(0x51a5f0d2) }, - { SPH_C32(0x96480014), SPH_C32(0x7eebcec8), SPH_C32(0xff48152c), - SPH_C32(0x86e531e4), SPH_C32(0xfa220008), SPH_C32(0xb621951a), - SPH_C32(0xc4ff0abe), SPH_C32(0x270937e1) }, - { SPH_C32(0x2de90010), SPH_C32(0xb276b815), SPH_C32(0xfabfb941), - SPH_C32(0x5f03df0d), SPH_C32(0x2a2a000c), SPH_C32(0x3a571a6d), - SPH_C32(0x593abaee), SPH_C32(0x88431e3b) }, - { SPH_C32(0xfde10014), SPH_C32(0x3e003762), SPH_C32(0x677a0911), - SPH_C32(0xf049f6d7), SPH_C32(0x4183000c), SPH_C32(0x7abce3c7), - SPH_C32(0xc108a6d3), SPH_C32(0xfeefd908) }, - { SPH_C32(0xeeee0018), SPH_C32(0xd2e478c2), SPH_C32(0x9cfe367d), - SPH_C32(0x9106300f), SPH_C32(0x86970008), SPH_C32(0x44a45ff4), - SPH_C32(0xc2a795fd), SPH_C32(0x095db88d) }, - { SPH_C32(0x3ee6001c), SPH_C32(0x5e92f7b5), SPH_C32(0x013b862d), - SPH_C32(0x3e4c19d5), SPH_C32(0xed3e0008), SPH_C32(0x044fa65e), - SPH_C32(0x5a9589c0), SPH_C32(0x7ff17fbe) }, - { SPH_C32(0x85470018), SPH_C32(0x920f8168), SPH_C32(0x04cc2a40), - SPH_C32(0xe7aaf73c), SPH_C32(0x3d36000c), SPH_C32(0x88392929), - SPH_C32(0xc7503990), SPH_C32(0xd0bb5664) }, - { SPH_C32(0x554f001c), SPH_C32(0x1e790e1f), SPH_C32(0x99099a10), - SPH_C32(0x48e0dee6), SPH_C32(0x569f000c), SPH_C32(0xc8d2d083), - SPH_C32(0x5f6225ad), SPH_C32(0xa6179157) }, - { SPH_C32(0x2e390000), SPH_C32(0x64dd6689), SPH_C32(0x3cd406fc), - SPH_C32(0xb1f490bc), SPH_C32(0x7f650010), SPH_C32(0x242e1472), - SPH_C32(0xc03320fe), SPH_C32(0xc0a3c0dd) }, - { SPH_C32(0xfe310004), SPH_C32(0xe8abe9fe), SPH_C32(0xa111b6ac), - SPH_C32(0x1ebeb966), SPH_C32(0x14cc0010), SPH_C32(0x64c5edd8), - SPH_C32(0x58013cc3), SPH_C32(0xb60f07ee) }, - { SPH_C32(0x45900000), SPH_C32(0x24369f23), SPH_C32(0xa4e61ac1), - SPH_C32(0xc758578f), SPH_C32(0xc4c40014), SPH_C32(0xe8b362af), - SPH_C32(0xc5c48c93), SPH_C32(0x19452e34) }, - { SPH_C32(0x95980004), SPH_C32(0xa8401054), SPH_C32(0x3923aa91), - SPH_C32(0x68127e55), SPH_C32(0xaf6d0014), SPH_C32(0xa8589b05), - SPH_C32(0x5df690ae), SPH_C32(0x6fe9e907) }, - { SPH_C32(0x86970008), SPH_C32(0x44a45ff4), SPH_C32(0xc2a795fd), - SPH_C32(0x095db88d), SPH_C32(0x68790010), SPH_C32(0x96402736), - SPH_C32(0x5e59a380), SPH_C32(0x985b8882) }, - { SPH_C32(0x569f000c), SPH_C32(0xc8d2d083), SPH_C32(0x5f6225ad), - SPH_C32(0xa6179157), SPH_C32(0x03d00010), SPH_C32(0xd6abde9c), - SPH_C32(0xc66bbfbd), SPH_C32(0xeef74fb1) }, - { SPH_C32(0xed3e0008), SPH_C32(0x044fa65e), SPH_C32(0x5a9589c0), - SPH_C32(0x7ff17fbe), SPH_C32(0xd3d80014), SPH_C32(0x5add51eb), - SPH_C32(0x5bae0fed), SPH_C32(0x41bd666b) }, - { SPH_C32(0x3d36000c), SPH_C32(0x88392929), SPH_C32(0xc7503990), - SPH_C32(0xd0bb5664), SPH_C32(0xb8710014), SPH_C32(0x1a36a841), - SPH_C32(0xc39c13d0), SPH_C32(0x3711a158) }, - { SPH_C32(0x39250000), SPH_C32(0xd6b355cd), SPH_C32(0xa2be8582), - SPH_C32(0xe90cd8e3), SPH_C32(0xc0d70018), SPH_C32(0xb6391e4b), - SPH_C32(0xa02a3081), SPH_C32(0x20f2a0b3) }, - { SPH_C32(0xe92d0004), SPH_C32(0x5ac5daba), SPH_C32(0x3f7b35d2), - SPH_C32(0x4646f139), SPH_C32(0xab7e0018), SPH_C32(0xf6d2e7e1), - SPH_C32(0x38182cbc), SPH_C32(0x565e6780) }, - { SPH_C32(0x528c0000), SPH_C32(0x9658ac67), SPH_C32(0x3a8c99bf), - SPH_C32(0x9fa01fd0), SPH_C32(0x7b76001c), SPH_C32(0x7aa46896), - SPH_C32(0xa5dd9cec), SPH_C32(0xf9144e5a) }, - { SPH_C32(0x82840004), SPH_C32(0x1a2e2310), SPH_C32(0xa74929ef), - SPH_C32(0x30ea360a), SPH_C32(0x10df001c), SPH_C32(0x3a4f913c), - SPH_C32(0x3def80d1), SPH_C32(0x8fb88969) }, - { SPH_C32(0x918b0008), SPH_C32(0xf6ca6cb0), SPH_C32(0x5ccd1683), - SPH_C32(0x51a5f0d2), SPH_C32(0xd7cb0018), SPH_C32(0x04572d0f), - SPH_C32(0x3e40b3ff), SPH_C32(0x780ae8ec) }, - { SPH_C32(0x4183000c), SPH_C32(0x7abce3c7), SPH_C32(0xc108a6d3), - SPH_C32(0xfeefd908), SPH_C32(0xbc620018), SPH_C32(0x44bcd4a5), - SPH_C32(0xa672afc2), SPH_C32(0x0ea62fdf) }, - { SPH_C32(0xfa220008), SPH_C32(0xb621951a), SPH_C32(0xc4ff0abe), - SPH_C32(0x270937e1), SPH_C32(0x6c6a001c), SPH_C32(0xc8ca5bd2), - SPH_C32(0x3bb71f92), SPH_C32(0xa1ec0605) }, - { SPH_C32(0x2a2a000c), SPH_C32(0x3a571a6d), SPH_C32(0x593abaee), - SPH_C32(0x88431e3b), SPH_C32(0x07c3001c), SPH_C32(0x8821a278), - SPH_C32(0xa38503af), SPH_C32(0xd740c136) }, - { SPH_C32(0x7f650010), SPH_C32(0x242e1472), SPH_C32(0xc03320fe), - SPH_C32(0xc0a3c0dd), SPH_C32(0x515c0010), SPH_C32(0x40f372fb), - SPH_C32(0xfce72602), SPH_C32(0x71575061) }, - { SPH_C32(0xaf6d0014), SPH_C32(0xa8589b05), SPH_C32(0x5df690ae), - SPH_C32(0x6fe9e907), SPH_C32(0x3af50010), SPH_C32(0x00188b51), - SPH_C32(0x64d53a3f), SPH_C32(0x07fb9752) }, - { SPH_C32(0x14cc0010), SPH_C32(0x64c5edd8), SPH_C32(0x58013cc3), - SPH_C32(0xb60f07ee), SPH_C32(0xeafd0014), SPH_C32(0x8c6e0426), - SPH_C32(0xf9108a6f), SPH_C32(0xa8b1be88) }, - { SPH_C32(0xc4c40014), SPH_C32(0xe8b362af), SPH_C32(0xc5c48c93), - SPH_C32(0x19452e34), SPH_C32(0x81540014), SPH_C32(0xcc85fd8c), - SPH_C32(0x61229652), SPH_C32(0xde1d79bb) }, - { SPH_C32(0xd7cb0018), SPH_C32(0x04572d0f), SPH_C32(0x3e40b3ff), - SPH_C32(0x780ae8ec), SPH_C32(0x46400010), SPH_C32(0xf29d41bf), - SPH_C32(0x628da57c), SPH_C32(0x29af183e) }, - { SPH_C32(0x07c3001c), SPH_C32(0x8821a278), SPH_C32(0xa38503af), - SPH_C32(0xd740c136), SPH_C32(0x2de90010), SPH_C32(0xb276b815), - SPH_C32(0xfabfb941), SPH_C32(0x5f03df0d) }, - { SPH_C32(0xbc620018), SPH_C32(0x44bcd4a5), SPH_C32(0xa672afc2), - SPH_C32(0x0ea62fdf), SPH_C32(0xfde10014), SPH_C32(0x3e003762), - SPH_C32(0x677a0911), SPH_C32(0xf049f6d7) }, - { SPH_C32(0x6c6a001c), SPH_C32(0xc8ca5bd2), SPH_C32(0x3bb71f92), - SPH_C32(0xa1ec0605), SPH_C32(0x96480014), SPH_C32(0x7eebcec8), - SPH_C32(0xff48152c), SPH_C32(0x86e531e4) }, - { SPH_C32(0x68790010), SPH_C32(0x96402736), SPH_C32(0x5e59a380), - SPH_C32(0x985b8882), SPH_C32(0xeeee0018), SPH_C32(0xd2e478c2), - SPH_C32(0x9cfe367d), SPH_C32(0x9106300f) }, - { SPH_C32(0xb8710014), SPH_C32(0x1a36a841), SPH_C32(0xc39c13d0), - SPH_C32(0x3711a158), SPH_C32(0x85470018), SPH_C32(0x920f8168), - SPH_C32(0x04cc2a40), SPH_C32(0xe7aaf73c) }, - { SPH_C32(0x03d00010), SPH_C32(0xd6abde9c), SPH_C32(0xc66bbfbd), - SPH_C32(0xeef74fb1), SPH_C32(0x554f001c), SPH_C32(0x1e790e1f), - SPH_C32(0x99099a10), SPH_C32(0x48e0dee6) }, - { SPH_C32(0xd3d80014), SPH_C32(0x5add51eb), SPH_C32(0x5bae0fed), - SPH_C32(0x41bd666b), SPH_C32(0x3ee6001c), SPH_C32(0x5e92f7b5), - SPH_C32(0x013b862d), SPH_C32(0x3e4c19d5) }, - { SPH_C32(0xc0d70018), SPH_C32(0xb6391e4b), SPH_C32(0xa02a3081), - SPH_C32(0x20f2a0b3), SPH_C32(0xf9f20018), SPH_C32(0x608a4b86), - SPH_C32(0x0294b503), SPH_C32(0xc9fe7850) }, - { SPH_C32(0x10df001c), SPH_C32(0x3a4f913c), SPH_C32(0x3def80d1), - SPH_C32(0x8fb88969), SPH_C32(0x925b0018), SPH_C32(0x2061b22c), - SPH_C32(0x9aa6a93e), SPH_C32(0xbf52bf63) }, - { SPH_C32(0xab7e0018), SPH_C32(0xf6d2e7e1), SPH_C32(0x38182cbc), - SPH_C32(0x565e6780), SPH_C32(0x4253001c), SPH_C32(0xac173d5b), - SPH_C32(0x0763196e), SPH_C32(0x101896b9) }, - { SPH_C32(0x7b76001c), SPH_C32(0x7aa46896), SPH_C32(0xa5dd9cec), - SPH_C32(0xf9144e5a), SPH_C32(0x29fa001c), SPH_C32(0xecfcc4f1), - SPH_C32(0x9f510553), SPH_C32(0x66b4518a) }, - { SPH_C32(0xa2b80020), SPH_C32(0x81e7e5f6), SPH_C32(0xf9ce4c04), - SPH_C32(0xe2afa0c0), SPH_C32(0x5c720000), SPH_C32(0xc9bacd12), - SPH_C32(0x79a90df9), SPH_C32(0x63e92178) }, - { SPH_C32(0x72b00024), SPH_C32(0x0d916a81), SPH_C32(0x640bfc54), - SPH_C32(0x4de5891a), SPH_C32(0x37db0000), SPH_C32(0x895134b8), - SPH_C32(0xe19b11c4), SPH_C32(0x1545e64b) }, - { SPH_C32(0xc9110020), SPH_C32(0xc10c1c5c), SPH_C32(0x61fc5039), - SPH_C32(0x940367f3), SPH_C32(0xe7d30004), SPH_C32(0x0527bbcf), - SPH_C32(0x7c5ea194), SPH_C32(0xba0fcf91) }, - { SPH_C32(0x19190024), SPH_C32(0x4d7a932b), SPH_C32(0xfc39e069), - SPH_C32(0x3b494e29), SPH_C32(0x8c7a0004), SPH_C32(0x45cc4265), - SPH_C32(0xe46cbda9), SPH_C32(0xcca308a2) }, - { SPH_C32(0x0a160028), SPH_C32(0xa19edc8b), SPH_C32(0x07bddf05), - SPH_C32(0x5a0688f1), SPH_C32(0x4b6e0000), SPH_C32(0x7bd4fe56), - SPH_C32(0xe7c38e87), SPH_C32(0x3b116927) }, - { SPH_C32(0xda1e002c), SPH_C32(0x2de853fc), SPH_C32(0x9a786f55), - SPH_C32(0xf54ca12b), SPH_C32(0x20c70000), SPH_C32(0x3b3f07fc), - SPH_C32(0x7ff192ba), SPH_C32(0x4dbdae14) }, - { SPH_C32(0x61bf0028), SPH_C32(0xe1752521), SPH_C32(0x9f8fc338), - SPH_C32(0x2caa4fc2), SPH_C32(0xf0cf0004), SPH_C32(0xb749888b), - SPH_C32(0xe23422ea), SPH_C32(0xe2f787ce) }, - { SPH_C32(0xb1b7002c), SPH_C32(0x6d03aa56), SPH_C32(0x024a7368), - SPH_C32(0x83e06618), SPH_C32(0x9b660004), SPH_C32(0xf7a27121), - SPH_C32(0x7a063ed7), SPH_C32(0x945b40fd) }, - { SPH_C32(0xb5a40020), SPH_C32(0x3389d6b2), SPH_C32(0x67a4cf7a), - SPH_C32(0xba57e89f), SPH_C32(0xe3c00008), SPH_C32(0x5badc72b), - SPH_C32(0x19b01d86), SPH_C32(0x83b84116) }, - { SPH_C32(0x65ac0024), SPH_C32(0xbfff59c5), SPH_C32(0xfa617f2a), - SPH_C32(0x151dc145), SPH_C32(0x88690008), SPH_C32(0x1b463e81), - SPH_C32(0x818201bb), SPH_C32(0xf5148625) }, - { SPH_C32(0xde0d0020), SPH_C32(0x73622f18), SPH_C32(0xff96d347), - SPH_C32(0xccfb2fac), SPH_C32(0x5861000c), SPH_C32(0x9730b1f6), - SPH_C32(0x1c47b1eb), SPH_C32(0x5a5eafff) }, - { SPH_C32(0x0e050024), SPH_C32(0xff14a06f), SPH_C32(0x62536317), - SPH_C32(0x63b10676), SPH_C32(0x33c8000c), SPH_C32(0xd7db485c), - SPH_C32(0x8475add6), SPH_C32(0x2cf268cc) }, - { SPH_C32(0x1d0a0028), SPH_C32(0x13f0efcf), SPH_C32(0x99d75c7b), - SPH_C32(0x02fec0ae), SPH_C32(0xf4dc0008), SPH_C32(0xe9c3f46f), - SPH_C32(0x87da9ef8), SPH_C32(0xdb400949) }, - { SPH_C32(0xcd02002c), SPH_C32(0x9f8660b8), SPH_C32(0x0412ec2b), - SPH_C32(0xadb4e974), SPH_C32(0x9f750008), SPH_C32(0xa9280dc5), - SPH_C32(0x1fe882c5), SPH_C32(0xadecce7a) }, - { SPH_C32(0x76a30028), SPH_C32(0x531b1665), SPH_C32(0x01e54046), - SPH_C32(0x7452079d), SPH_C32(0x4f7d000c), SPH_C32(0x255e82b2), - SPH_C32(0x822d3295), SPH_C32(0x02a6e7a0) }, - { SPH_C32(0xa6ab002c), SPH_C32(0xdf6d9912), SPH_C32(0x9c20f016), - SPH_C32(0xdb182e47), SPH_C32(0x24d4000c), SPH_C32(0x65b57b18), - SPH_C32(0x1a1f2ea8), SPH_C32(0x740a2093) }, - { SPH_C32(0xf3e40030), SPH_C32(0xc114970d), SPH_C32(0x05296a06), - SPH_C32(0x93f8f0a1), SPH_C32(0x724b0000), SPH_C32(0xad67ab9b), - SPH_C32(0x457d0b05), SPH_C32(0xd21db1c4) }, - { SPH_C32(0x23ec0034), SPH_C32(0x4d62187a), SPH_C32(0x98ecda56), - SPH_C32(0x3cb2d97b), SPH_C32(0x19e20000), SPH_C32(0xed8c5231), - SPH_C32(0xdd4f1738), SPH_C32(0xa4b176f7) }, - { SPH_C32(0x984d0030), SPH_C32(0x81ff6ea7), SPH_C32(0x9d1b763b), - SPH_C32(0xe5543792), SPH_C32(0xc9ea0004), SPH_C32(0x61fadd46), - SPH_C32(0x408aa768), SPH_C32(0x0bfb5f2d) }, - { SPH_C32(0x48450034), SPH_C32(0x0d89e1d0), SPH_C32(0x00dec66b), - SPH_C32(0x4a1e1e48), SPH_C32(0xa2430004), SPH_C32(0x211124ec), - SPH_C32(0xd8b8bb55), SPH_C32(0x7d57981e) }, - { SPH_C32(0x5b4a0038), SPH_C32(0xe16dae70), SPH_C32(0xfb5af907), - SPH_C32(0x2b51d890), SPH_C32(0x65570000), SPH_C32(0x1f0998df), - SPH_C32(0xdb17887b), SPH_C32(0x8ae5f99b) }, - { SPH_C32(0x8b42003c), SPH_C32(0x6d1b2107), SPH_C32(0x669f4957), - SPH_C32(0x841bf14a), SPH_C32(0x0efe0000), SPH_C32(0x5fe26175), - SPH_C32(0x43259446), SPH_C32(0xfc493ea8) }, - { SPH_C32(0x30e30038), SPH_C32(0xa18657da), SPH_C32(0x6368e53a), - SPH_C32(0x5dfd1fa3), SPH_C32(0xdef60004), SPH_C32(0xd394ee02), - SPH_C32(0xdee02416), SPH_C32(0x53031772) }, - { SPH_C32(0xe0eb003c), SPH_C32(0x2df0d8ad), SPH_C32(0xfead556a), - SPH_C32(0xf2b73679), SPH_C32(0xb55f0004), SPH_C32(0x937f17a8), - SPH_C32(0x46d2382b), SPH_C32(0x25afd041) }, - { SPH_C32(0xe4f80030), SPH_C32(0x737aa449), SPH_C32(0x9b43e978), - SPH_C32(0xcb00b8fe), SPH_C32(0xcdf90008), SPH_C32(0x3f70a1a2), - SPH_C32(0x25641b7a), SPH_C32(0x324cd1aa) }, - { SPH_C32(0x34f00034), SPH_C32(0xff0c2b3e), SPH_C32(0x06865928), - SPH_C32(0x644a9124), SPH_C32(0xa6500008), SPH_C32(0x7f9b5808), - SPH_C32(0xbd560747), SPH_C32(0x44e01699) }, - { SPH_C32(0x8f510030), SPH_C32(0x33915de3), SPH_C32(0x0371f545), - SPH_C32(0xbdac7fcd), SPH_C32(0x7658000c), SPH_C32(0xf3edd77f), - SPH_C32(0x2093b717), SPH_C32(0xebaa3f43) }, - { SPH_C32(0x5f590034), SPH_C32(0xbfe7d294), SPH_C32(0x9eb44515), - SPH_C32(0x12e65617), SPH_C32(0x1df1000c), SPH_C32(0xb3062ed5), - SPH_C32(0xb8a1ab2a), SPH_C32(0x9d06f870) }, - { SPH_C32(0x4c560038), SPH_C32(0x53039d34), SPH_C32(0x65307a79), - SPH_C32(0x73a990cf), SPH_C32(0xdae50008), SPH_C32(0x8d1e92e6), - SPH_C32(0xbb0e9804), SPH_C32(0x6ab499f5) }, - { SPH_C32(0x9c5e003c), SPH_C32(0xdf751243), SPH_C32(0xf8f5ca29), - SPH_C32(0xdce3b915), SPH_C32(0xb14c0008), SPH_C32(0xcdf56b4c), - SPH_C32(0x233c8439), SPH_C32(0x1c185ec6) }, - { SPH_C32(0x27ff0038), SPH_C32(0x13e8649e), SPH_C32(0xfd026644), - SPH_C32(0x050557fc), SPH_C32(0x6144000c), SPH_C32(0x4183e43b), - SPH_C32(0xbef93469), SPH_C32(0xb352771c) }, - { SPH_C32(0xf7f7003c), SPH_C32(0x9f9eebe9), SPH_C32(0x60c7d614), - SPH_C32(0xaa4f7e26), SPH_C32(0x0aed000c), SPH_C32(0x01681d91), - SPH_C32(0x26cb2854), SPH_C32(0xc5feb02f) }, - { SPH_C32(0x8c810020), SPH_C32(0xe53a837f), SPH_C32(0xc51a4af8), - SPH_C32(0x535b307c), SPH_C32(0x23170010), SPH_C32(0xed94d960), - SPH_C32(0xb99a2d07), SPH_C32(0xa34ae1a5) }, - { SPH_C32(0x5c890024), SPH_C32(0x694c0c08), SPH_C32(0x58dffaa8), - SPH_C32(0xfc1119a6), SPH_C32(0x48be0010), SPH_C32(0xad7f20ca), - SPH_C32(0x21a8313a), SPH_C32(0xd5e62696) }, - { SPH_C32(0xe7280020), SPH_C32(0xa5d17ad5), SPH_C32(0x5d2856c5), - SPH_C32(0x25f7f74f), SPH_C32(0x98b60014), SPH_C32(0x2109afbd), - SPH_C32(0xbc6d816a), SPH_C32(0x7aac0f4c) }, - { SPH_C32(0x37200024), SPH_C32(0x29a7f5a2), SPH_C32(0xc0ede695), - SPH_C32(0x8abdde95), SPH_C32(0xf31f0014), SPH_C32(0x61e25617), - SPH_C32(0x245f9d57), SPH_C32(0x0c00c87f) }, - { SPH_C32(0x242f0028), SPH_C32(0xc543ba02), SPH_C32(0x3b69d9f9), - SPH_C32(0xebf2184d), SPH_C32(0x340b0010), SPH_C32(0x5ffaea24), - SPH_C32(0x27f0ae79), SPH_C32(0xfbb2a9fa) }, - { SPH_C32(0xf427002c), SPH_C32(0x49353575), SPH_C32(0xa6ac69a9), - SPH_C32(0x44b83197), SPH_C32(0x5fa20010), SPH_C32(0x1f11138e), - SPH_C32(0xbfc2b244), SPH_C32(0x8d1e6ec9) }, - { SPH_C32(0x4f860028), SPH_C32(0x85a843a8), SPH_C32(0xa35bc5c4), - SPH_C32(0x9d5edf7e), SPH_C32(0x8faa0014), SPH_C32(0x93679cf9), - SPH_C32(0x22070214), SPH_C32(0x22544713) }, - { SPH_C32(0x9f8e002c), SPH_C32(0x09deccdf), SPH_C32(0x3e9e7594), - SPH_C32(0x3214f6a4), SPH_C32(0xe4030014), SPH_C32(0xd38c6553), - SPH_C32(0xba351e29), SPH_C32(0x54f88020) }, - { SPH_C32(0x9b9d0020), SPH_C32(0x5754b03b), SPH_C32(0x5b70c986), - SPH_C32(0x0ba37823), SPH_C32(0x9ca50018), SPH_C32(0x7f83d359), - SPH_C32(0xd9833d78), SPH_C32(0x431b81cb) }, - { SPH_C32(0x4b950024), SPH_C32(0xdb223f4c), SPH_C32(0xc6b579d6), - SPH_C32(0xa4e951f9), SPH_C32(0xf70c0018), SPH_C32(0x3f682af3), - SPH_C32(0x41b12145), SPH_C32(0x35b746f8) }, - { SPH_C32(0xf0340020), SPH_C32(0x17bf4991), SPH_C32(0xc342d5bb), - SPH_C32(0x7d0fbf10), SPH_C32(0x2704001c), SPH_C32(0xb31ea584), - SPH_C32(0xdc749115), SPH_C32(0x9afd6f22) }, - { SPH_C32(0x203c0024), SPH_C32(0x9bc9c6e6), SPH_C32(0x5e8765eb), - SPH_C32(0xd24596ca), SPH_C32(0x4cad001c), SPH_C32(0xf3f55c2e), - SPH_C32(0x44468d28), SPH_C32(0xec51a811) }, - { SPH_C32(0x33330028), SPH_C32(0x772d8946), SPH_C32(0xa5035a87), - SPH_C32(0xb30a5012), SPH_C32(0x8bb90018), SPH_C32(0xcdede01d), - SPH_C32(0x47e9be06), SPH_C32(0x1be3c994) }, - { SPH_C32(0xe33b002c), SPH_C32(0xfb5b0631), SPH_C32(0x38c6ead7), - SPH_C32(0x1c4079c8), SPH_C32(0xe0100018), SPH_C32(0x8d0619b7), - SPH_C32(0xdfdba23b), SPH_C32(0x6d4f0ea7) }, - { SPH_C32(0x589a0028), SPH_C32(0x37c670ec), SPH_C32(0x3d3146ba), - SPH_C32(0xc5a69721), SPH_C32(0x3018001c), SPH_C32(0x017096c0), - SPH_C32(0x421e126b), SPH_C32(0xc205277d) }, - { SPH_C32(0x8892002c), SPH_C32(0xbbb0ff9b), SPH_C32(0xa0f4f6ea), - SPH_C32(0x6aecbefb), SPH_C32(0x5bb1001c), SPH_C32(0x419b6f6a), - SPH_C32(0xda2c0e56), SPH_C32(0xb4a9e04e) }, - { SPH_C32(0xdddd0030), SPH_C32(0xa5c9f184), SPH_C32(0x39fd6cfa), - SPH_C32(0x220c601d), SPH_C32(0x0d2e0010), SPH_C32(0x8949bfe9), - SPH_C32(0x854e2bfb), SPH_C32(0x12be7119) }, - { SPH_C32(0x0dd50034), SPH_C32(0x29bf7ef3), SPH_C32(0xa438dcaa), - SPH_C32(0x8d4649c7), SPH_C32(0x66870010), SPH_C32(0xc9a24643), - SPH_C32(0x1d7c37c6), SPH_C32(0x6412b62a) }, - { SPH_C32(0xb6740030), SPH_C32(0xe522082e), SPH_C32(0xa1cf70c7), - SPH_C32(0x54a0a72e), SPH_C32(0xb68f0014), SPH_C32(0x45d4c934), - SPH_C32(0x80b98796), SPH_C32(0xcb589ff0) }, - { SPH_C32(0x667c0034), SPH_C32(0x69548759), SPH_C32(0x3c0ac097), - SPH_C32(0xfbea8ef4), SPH_C32(0xdd260014), SPH_C32(0x053f309e), - SPH_C32(0x188b9bab), SPH_C32(0xbdf458c3) }, - { SPH_C32(0x75730038), SPH_C32(0x85b0c8f9), SPH_C32(0xc78efffb), - SPH_C32(0x9aa5482c), SPH_C32(0x1a320010), SPH_C32(0x3b278cad), - SPH_C32(0x1b24a885), SPH_C32(0x4a463946) }, - { SPH_C32(0xa57b003c), SPH_C32(0x09c6478e), SPH_C32(0x5a4b4fab), - SPH_C32(0x35ef61f6), SPH_C32(0x719b0010), SPH_C32(0x7bcc7507), - SPH_C32(0x8316b4b8), SPH_C32(0x3ceafe75) }, - { SPH_C32(0x1eda0038), SPH_C32(0xc55b3153), SPH_C32(0x5fbce3c6), - SPH_C32(0xec098f1f), SPH_C32(0xa1930014), SPH_C32(0xf7bafa70), - SPH_C32(0x1ed304e8), SPH_C32(0x93a0d7af) }, - { SPH_C32(0xced2003c), SPH_C32(0x492dbe24), SPH_C32(0xc2795396), - SPH_C32(0x4343a6c5), SPH_C32(0xca3a0014), SPH_C32(0xb75103da), - SPH_C32(0x86e118d5), SPH_C32(0xe50c109c) }, - { SPH_C32(0xcac10030), SPH_C32(0x17a7c2c0), SPH_C32(0xa797ef84), - SPH_C32(0x7af42842), SPH_C32(0xb29c0018), SPH_C32(0x1b5eb5d0), - SPH_C32(0xe5573b84), SPH_C32(0xf2ef1177) }, - { SPH_C32(0x1ac90034), SPH_C32(0x9bd14db7), SPH_C32(0x3a525fd4), - SPH_C32(0xd5be0198), SPH_C32(0xd9350018), SPH_C32(0x5bb54c7a), - SPH_C32(0x7d6527b9), SPH_C32(0x8443d644) }, - { SPH_C32(0xa1680030), SPH_C32(0x574c3b6a), SPH_C32(0x3fa5f3b9), - SPH_C32(0x0c58ef71), SPH_C32(0x093d001c), SPH_C32(0xd7c3c30d), - SPH_C32(0xe0a097e9), SPH_C32(0x2b09ff9e) }, - { SPH_C32(0x71600034), SPH_C32(0xdb3ab41d), SPH_C32(0xa26043e9), - SPH_C32(0xa312c6ab), SPH_C32(0x6294001c), SPH_C32(0x97283aa7), - SPH_C32(0x78928bd4), SPH_C32(0x5da538ad) }, - { SPH_C32(0x626f0038), SPH_C32(0x37defbbd), SPH_C32(0x59e47c85), - SPH_C32(0xc25d0073), SPH_C32(0xa5800018), SPH_C32(0xa9308694), - SPH_C32(0x7b3db8fa), SPH_C32(0xaa175928) }, - { SPH_C32(0xb267003c), SPH_C32(0xbba874ca), SPH_C32(0xc421ccd5), - SPH_C32(0x6d1729a9), SPH_C32(0xce290018), SPH_C32(0xe9db7f3e), - SPH_C32(0xe30fa4c7), SPH_C32(0xdcbb9e1b) }, - { SPH_C32(0x09c60038), SPH_C32(0x77350217), SPH_C32(0xc1d660b8), - SPH_C32(0xb4f1c740), SPH_C32(0x1e21001c), SPH_C32(0x65adf049), - SPH_C32(0x7eca1497), SPH_C32(0x73f1b7c1) }, - { SPH_C32(0xd9ce003c), SPH_C32(0xfb438d60), SPH_C32(0x5c13d0e8), - SPH_C32(0x1bbbee9a), SPH_C32(0x7588001c), SPH_C32(0x254609e3), - SPH_C32(0xe6f808aa), SPH_C32(0x055d70f2) } -}; - -static const sph_u32 T256_28[16][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xc04e0001), SPH_C32(0x33b9c010), SPH_C32(0xae0ebb05), - SPH_C32(0xb5a4c63b), SPH_C32(0xc8f10000), SPH_C32(0x0b2de782), - SPH_C32(0x6bf648a4), SPH_C32(0x539cbdbf) }, - { SPH_C32(0xc8f10000), SPH_C32(0x0b2de782), SPH_C32(0x6bf648a4), - SPH_C32(0x539cbdbf), SPH_C32(0x08bf0001), SPH_C32(0x38942792), - SPH_C32(0xc5f8f3a1), SPH_C32(0xe6387b84) }, - { SPH_C32(0x08bf0001), SPH_C32(0x38942792), SPH_C32(0xc5f8f3a1), - SPH_C32(0xe6387b84), SPH_C32(0xc04e0001), SPH_C32(0x33b9c010), - SPH_C32(0xae0ebb05), SPH_C32(0xb5a4c63b) }, - { SPH_C32(0x88230002), SPH_C32(0x5fe7a7b3), SPH_C32(0x99e585aa), - SPH_C32(0x8d75f7f1), SPH_C32(0x51ac0000), SPH_C32(0x25e30f14), - SPH_C32(0x79e22a4c), SPH_C32(0x1298bd46) }, - { SPH_C32(0x486d0003), SPH_C32(0x6c5e67a3), SPH_C32(0x37eb3eaf), - SPH_C32(0x38d131ca), SPH_C32(0x995d0000), SPH_C32(0x2ecee896), - SPH_C32(0x121462e8), SPH_C32(0x410400f9) }, - { SPH_C32(0x40d20002), SPH_C32(0x54ca4031), SPH_C32(0xf213cd0e), - SPH_C32(0xdee94a4e), SPH_C32(0x59130001), SPH_C32(0x1d772886), - SPH_C32(0xbc1ad9ed), SPH_C32(0xf4a0c6c2) }, - { SPH_C32(0x809c0003), SPH_C32(0x67738021), SPH_C32(0x5c1d760b), - SPH_C32(0x6b4d8c75), SPH_C32(0x91e20001), SPH_C32(0x165acf04), - SPH_C32(0xd7ec9149), SPH_C32(0xa73c7b7d) }, - { SPH_C32(0x51ac0000), SPH_C32(0x25e30f14), SPH_C32(0x79e22a4c), - SPH_C32(0x1298bd46), SPH_C32(0xd98f0002), SPH_C32(0x7a04a8a7), - SPH_C32(0xe007afe6), SPH_C32(0x9fed4ab7) }, - { SPH_C32(0x91e20001), SPH_C32(0x165acf04), SPH_C32(0xd7ec9149), - SPH_C32(0xa73c7b7d), SPH_C32(0x117e0002), SPH_C32(0x71294f25), - SPH_C32(0x8bf1e742), SPH_C32(0xcc71f708) }, - { SPH_C32(0x995d0000), SPH_C32(0x2ecee896), SPH_C32(0x121462e8), - SPH_C32(0x410400f9), SPH_C32(0xd1300003), SPH_C32(0x42908f35), - SPH_C32(0x25ff5c47), SPH_C32(0x79d53133) }, - { SPH_C32(0x59130001), SPH_C32(0x1d772886), SPH_C32(0xbc1ad9ed), - SPH_C32(0xf4a0c6c2), SPH_C32(0x19c10003), SPH_C32(0x49bd68b7), - SPH_C32(0x4e0914e3), SPH_C32(0x2a498c8c) }, - { SPH_C32(0xd98f0002), SPH_C32(0x7a04a8a7), SPH_C32(0xe007afe6), - SPH_C32(0x9fed4ab7), SPH_C32(0x88230002), SPH_C32(0x5fe7a7b3), - SPH_C32(0x99e585aa), SPH_C32(0x8d75f7f1) }, - { SPH_C32(0x19c10003), SPH_C32(0x49bd68b7), SPH_C32(0x4e0914e3), - SPH_C32(0x2a498c8c), SPH_C32(0x40d20002), SPH_C32(0x54ca4031), - SPH_C32(0xf213cd0e), SPH_C32(0xdee94a4e) }, - { SPH_C32(0x117e0002), SPH_C32(0x71294f25), SPH_C32(0x8bf1e742), - SPH_C32(0xcc71f708), SPH_C32(0x809c0003), SPH_C32(0x67738021), - SPH_C32(0x5c1d760b), SPH_C32(0x6b4d8c75) }, - { SPH_C32(0xd1300003), SPH_C32(0x42908f35), SPH_C32(0x25ff5c47), - SPH_C32(0x79d53133), SPH_C32(0x486d0003), SPH_C32(0x6c5e67a3), - SPH_C32(0x37eb3eaf), SPH_C32(0x38d131ca) } -}; - -#define INPUT_SMALL do { \ - unsigned acc = buf[0]; \ - const sph_u32 *rp; \ - rp = &T256_0[acc >> 1][0]; \ - m0 = rp[0]; \ - m1 = rp[1]; \ - m2 = rp[2]; \ - m3 = rp[3]; \ - m4 = rp[4]; \ - m5 = rp[5]; \ - m6 = rp[6]; \ - m7 = rp[7]; \ - acc = (acc << 8) | buf[1]; \ - rp = &T256_7[(acc >> 2) & 0x7f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - acc = (acc << 8) | buf[2]; \ - rp = &T256_14[(acc >> 3) & 0x7f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - acc = (acc << 8) | buf[3]; \ - rp = &T256_21[(acc >> 4) & 0x7f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - rp = &T256_28[acc & 0x0f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - } while (0) - -#endif - -#if SPH_HAMSI_EXPAND_SMALL == 8 - -static const sph_u32 T256_0[256][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x74951000), SPH_C32(0x5a2b467e), SPH_C32(0x88fd1d2b), - SPH_C32(0x1ee68292), SPH_C32(0xcba90000), SPH_C32(0x90273769), - SPH_C32(0xbbdcf407), SPH_C32(0xd0f4af61) }, - { SPH_C32(0xcba90000), SPH_C32(0x90273769), SPH_C32(0xbbdcf407), - SPH_C32(0xd0f4af61), SPH_C32(0xbf3c1000), SPH_C32(0xca0c7117), - SPH_C32(0x3321e92c), SPH_C32(0xce122df3) }, - { SPH_C32(0xbf3c1000), SPH_C32(0xca0c7117), SPH_C32(0x3321e92c), - SPH_C32(0xce122df3), SPH_C32(0x74951000), SPH_C32(0x5a2b467e), - SPH_C32(0x88fd1d2b), SPH_C32(0x1ee68292) }, - { SPH_C32(0xe92a2000), SPH_C32(0xb4578cfc), SPH_C32(0x11fa3a57), - SPH_C32(0x3dc90524), SPH_C32(0x97530000), SPH_C32(0x204f6ed3), - SPH_C32(0x77b9e80f), SPH_C32(0xa1ec5ec1) }, - { SPH_C32(0x9dbf3000), SPH_C32(0xee7cca82), SPH_C32(0x9907277c), - SPH_C32(0x232f87b6), SPH_C32(0x5cfa0000), SPH_C32(0xb06859ba), - SPH_C32(0xcc651c08), SPH_C32(0x7118f1a0) }, - { SPH_C32(0x22832000), SPH_C32(0x2470bb95), SPH_C32(0xaa26ce50), - SPH_C32(0xed3daa45), SPH_C32(0x286f1000), SPH_C32(0xea431fc4), - SPH_C32(0x44980123), SPH_C32(0x6ffe7332) }, - { SPH_C32(0x56163000), SPH_C32(0x7e5bfdeb), SPH_C32(0x22dbd37b), - SPH_C32(0xf3db28d7), SPH_C32(0xe3c61000), SPH_C32(0x7a6428ad), - SPH_C32(0xff44f524), SPH_C32(0xbf0adc53) }, - { SPH_C32(0x97530000), SPH_C32(0x204f6ed3), SPH_C32(0x77b9e80f), - SPH_C32(0xa1ec5ec1), SPH_C32(0x7e792000), SPH_C32(0x9418e22f), - SPH_C32(0x6643d258), SPH_C32(0x9c255be5) }, - { SPH_C32(0xe3c61000), SPH_C32(0x7a6428ad), SPH_C32(0xff44f524), - SPH_C32(0xbf0adc53), SPH_C32(0xb5d02000), SPH_C32(0x043fd546), - SPH_C32(0xdd9f265f), SPH_C32(0x4cd1f484) }, - { SPH_C32(0x5cfa0000), SPH_C32(0xb06859ba), SPH_C32(0xcc651c08), - SPH_C32(0x7118f1a0), SPH_C32(0xc1453000), SPH_C32(0x5e149338), - SPH_C32(0x55623b74), SPH_C32(0x52377616) }, - { SPH_C32(0x286f1000), SPH_C32(0xea431fc4), SPH_C32(0x44980123), - SPH_C32(0x6ffe7332), SPH_C32(0x0aec3000), SPH_C32(0xce33a451), - SPH_C32(0xeebecf73), SPH_C32(0x82c3d977) }, - { SPH_C32(0x7e792000), SPH_C32(0x9418e22f), SPH_C32(0x6643d258), - SPH_C32(0x9c255be5), SPH_C32(0xe92a2000), SPH_C32(0xb4578cfc), - SPH_C32(0x11fa3a57), SPH_C32(0x3dc90524) }, - { SPH_C32(0x0aec3000), SPH_C32(0xce33a451), SPH_C32(0xeebecf73), - SPH_C32(0x82c3d977), SPH_C32(0x22832000), SPH_C32(0x2470bb95), - SPH_C32(0xaa26ce50), SPH_C32(0xed3daa45) }, - { SPH_C32(0xb5d02000), SPH_C32(0x043fd546), SPH_C32(0xdd9f265f), - SPH_C32(0x4cd1f484), SPH_C32(0x56163000), SPH_C32(0x7e5bfdeb), - SPH_C32(0x22dbd37b), SPH_C32(0xf3db28d7) }, - { SPH_C32(0xc1453000), SPH_C32(0x5e149338), SPH_C32(0x55623b74), - SPH_C32(0x52377616), SPH_C32(0x9dbf3000), SPH_C32(0xee7cca82), - SPH_C32(0x9907277c), SPH_C32(0x232f87b6) }, - { SPH_C32(0x121b4000), SPH_C32(0x5b17d9e8), SPH_C32(0x8dfacfab), - SPH_C32(0xce36cc72), SPH_C32(0xe6570000), SPH_C32(0x4bb33a25), - SPH_C32(0x848598ba), SPH_C32(0x1041003e) }, - { SPH_C32(0x668e5000), SPH_C32(0x013c9f96), SPH_C32(0x0507d280), - SPH_C32(0xd0d04ee0), SPH_C32(0x2dfe0000), SPH_C32(0xdb940d4c), - SPH_C32(0x3f596cbd), SPH_C32(0xc0b5af5f) }, - { SPH_C32(0xd9b24000), SPH_C32(0xcb30ee81), SPH_C32(0x36263bac), - SPH_C32(0x1ec26313), SPH_C32(0x596b1000), SPH_C32(0x81bf4b32), - SPH_C32(0xb7a47196), SPH_C32(0xde532dcd) }, - { SPH_C32(0xad275000), SPH_C32(0x911ba8ff), SPH_C32(0xbedb2687), - SPH_C32(0x0024e181), SPH_C32(0x92c21000), SPH_C32(0x11987c5b), - SPH_C32(0x0c788591), SPH_C32(0x0ea782ac) }, - { SPH_C32(0xfb316000), SPH_C32(0xef405514), SPH_C32(0x9c00f5fc), - SPH_C32(0xf3ffc956), SPH_C32(0x71040000), SPH_C32(0x6bfc54f6), - SPH_C32(0xf33c70b5), SPH_C32(0xb1ad5eff) }, - { SPH_C32(0x8fa47000), SPH_C32(0xb56b136a), SPH_C32(0x14fde8d7), - SPH_C32(0xed194bc4), SPH_C32(0xbaad0000), SPH_C32(0xfbdb639f), - SPH_C32(0x48e084b2), SPH_C32(0x6159f19e) }, - { SPH_C32(0x30986000), SPH_C32(0x7f67627d), SPH_C32(0x27dc01fb), - SPH_C32(0x230b6637), SPH_C32(0xce381000), SPH_C32(0xa1f025e1), - SPH_C32(0xc01d9999), SPH_C32(0x7fbf730c) }, - { SPH_C32(0x440d7000), SPH_C32(0x254c2403), SPH_C32(0xaf211cd0), - SPH_C32(0x3dede4a5), SPH_C32(0x05911000), SPH_C32(0x31d71288), - SPH_C32(0x7bc16d9e), SPH_C32(0xaf4bdc6d) }, - { SPH_C32(0x85484000), SPH_C32(0x7b58b73b), SPH_C32(0xfa4327a4), - SPH_C32(0x6fda92b3), SPH_C32(0x982e2000), SPH_C32(0xdfabd80a), - SPH_C32(0xe2c64ae2), SPH_C32(0x8c645bdb) }, - { SPH_C32(0xf1dd5000), SPH_C32(0x2173f145), SPH_C32(0x72be3a8f), - SPH_C32(0x713c1021), SPH_C32(0x53872000), SPH_C32(0x4f8cef63), - SPH_C32(0x591abee5), SPH_C32(0x5c90f4ba) }, - { SPH_C32(0x4ee14000), SPH_C32(0xeb7f8052), SPH_C32(0x419fd3a3), - SPH_C32(0xbf2e3dd2), SPH_C32(0x27123000), SPH_C32(0x15a7a91d), - SPH_C32(0xd1e7a3ce), SPH_C32(0x42767628) }, - { SPH_C32(0x3a745000), SPH_C32(0xb154c62c), SPH_C32(0xc962ce88), - SPH_C32(0xa1c8bf40), SPH_C32(0xecbb3000), SPH_C32(0x85809e74), - SPH_C32(0x6a3b57c9), SPH_C32(0x9282d949) }, - { SPH_C32(0x6c626000), SPH_C32(0xcf0f3bc7), SPH_C32(0xebb91df3), - SPH_C32(0x52139797), SPH_C32(0x0f7d2000), SPH_C32(0xffe4b6d9), - SPH_C32(0x957fa2ed), SPH_C32(0x2d88051a) }, - { SPH_C32(0x18f77000), SPH_C32(0x95247db9), SPH_C32(0x634400d8), - SPH_C32(0x4cf51505), SPH_C32(0xc4d42000), SPH_C32(0x6fc381b0), - SPH_C32(0x2ea356ea), SPH_C32(0xfd7caa7b) }, - { SPH_C32(0xa7cb6000), SPH_C32(0x5f280cae), SPH_C32(0x5065e9f4), - SPH_C32(0x82e738f6), SPH_C32(0xb0413000), SPH_C32(0x35e8c7ce), - SPH_C32(0xa65e4bc1), SPH_C32(0xe39a28e9) }, - { SPH_C32(0xd35e7000), SPH_C32(0x05034ad0), SPH_C32(0xd898f4df), - SPH_C32(0x9c01ba64), SPH_C32(0x7be83000), SPH_C32(0xa5cff0a7), - SPH_C32(0x1d82bfc6), SPH_C32(0x336e8788) }, - { SPH_C32(0xe6570000), SPH_C32(0x4bb33a25), SPH_C32(0x848598ba), - SPH_C32(0x1041003e), SPH_C32(0xf44c4000), SPH_C32(0x10a4e3cd), - SPH_C32(0x097f5711), SPH_C32(0xde77cc4c) }, - { SPH_C32(0x92c21000), SPH_C32(0x11987c5b), SPH_C32(0x0c788591), - SPH_C32(0x0ea782ac), SPH_C32(0x3fe54000), SPH_C32(0x8083d4a4), - SPH_C32(0xb2a3a316), SPH_C32(0x0e83632d) }, - { SPH_C32(0x2dfe0000), SPH_C32(0xdb940d4c), SPH_C32(0x3f596cbd), - SPH_C32(0xc0b5af5f), SPH_C32(0x4b705000), SPH_C32(0xdaa892da), - SPH_C32(0x3a5ebe3d), SPH_C32(0x1065e1bf) }, - { SPH_C32(0x596b1000), SPH_C32(0x81bf4b32), SPH_C32(0xb7a47196), - SPH_C32(0xde532dcd), SPH_C32(0x80d95000), SPH_C32(0x4a8fa5b3), - SPH_C32(0x81824a3a), SPH_C32(0xc0914ede) }, - { SPH_C32(0x0f7d2000), SPH_C32(0xffe4b6d9), SPH_C32(0x957fa2ed), - SPH_C32(0x2d88051a), SPH_C32(0x631f4000), SPH_C32(0x30eb8d1e), - SPH_C32(0x7ec6bf1e), SPH_C32(0x7f9b928d) }, - { SPH_C32(0x7be83000), SPH_C32(0xa5cff0a7), SPH_C32(0x1d82bfc6), - SPH_C32(0x336e8788), SPH_C32(0xa8b64000), SPH_C32(0xa0ccba77), - SPH_C32(0xc51a4b19), SPH_C32(0xaf6f3dec) }, - { SPH_C32(0xc4d42000), SPH_C32(0x6fc381b0), SPH_C32(0x2ea356ea), - SPH_C32(0xfd7caa7b), SPH_C32(0xdc235000), SPH_C32(0xfae7fc09), - SPH_C32(0x4de75632), SPH_C32(0xb189bf7e) }, - { SPH_C32(0xb0413000), SPH_C32(0x35e8c7ce), SPH_C32(0xa65e4bc1), - SPH_C32(0xe39a28e9), SPH_C32(0x178a5000), SPH_C32(0x6ac0cb60), - SPH_C32(0xf63ba235), SPH_C32(0x617d101f) }, - { SPH_C32(0x71040000), SPH_C32(0x6bfc54f6), SPH_C32(0xf33c70b5), - SPH_C32(0xb1ad5eff), SPH_C32(0x8a356000), SPH_C32(0x84bc01e2), - SPH_C32(0x6f3c8549), SPH_C32(0x425297a9) }, - { SPH_C32(0x05911000), SPH_C32(0x31d71288), SPH_C32(0x7bc16d9e), - SPH_C32(0xaf4bdc6d), SPH_C32(0x419c6000), SPH_C32(0x149b368b), - SPH_C32(0xd4e0714e), SPH_C32(0x92a638c8) }, - { SPH_C32(0xbaad0000), SPH_C32(0xfbdb639f), SPH_C32(0x48e084b2), - SPH_C32(0x6159f19e), SPH_C32(0x35097000), SPH_C32(0x4eb070f5), - SPH_C32(0x5c1d6c65), SPH_C32(0x8c40ba5a) }, - { SPH_C32(0xce381000), SPH_C32(0xa1f025e1), SPH_C32(0xc01d9999), - SPH_C32(0x7fbf730c), SPH_C32(0xfea07000), SPH_C32(0xde97479c), - SPH_C32(0xe7c19862), SPH_C32(0x5cb4153b) }, - { SPH_C32(0x982e2000), SPH_C32(0xdfabd80a), SPH_C32(0xe2c64ae2), - SPH_C32(0x8c645bdb), SPH_C32(0x1d666000), SPH_C32(0xa4f36f31), - SPH_C32(0x18856d46), SPH_C32(0xe3bec968) }, - { SPH_C32(0xecbb3000), SPH_C32(0x85809e74), SPH_C32(0x6a3b57c9), - SPH_C32(0x9282d949), SPH_C32(0xd6cf6000), SPH_C32(0x34d45858), - SPH_C32(0xa3599941), SPH_C32(0x334a6609) }, - { SPH_C32(0x53872000), SPH_C32(0x4f8cef63), SPH_C32(0x591abee5), - SPH_C32(0x5c90f4ba), SPH_C32(0xa25a7000), SPH_C32(0x6eff1e26), - SPH_C32(0x2ba4846a), SPH_C32(0x2dace49b) }, - { SPH_C32(0x27123000), SPH_C32(0x15a7a91d), SPH_C32(0xd1e7a3ce), - SPH_C32(0x42767628), SPH_C32(0x69f37000), SPH_C32(0xfed8294f), - SPH_C32(0x9078706d), SPH_C32(0xfd584bfa) }, - { SPH_C32(0xf44c4000), SPH_C32(0x10a4e3cd), SPH_C32(0x097f5711), - SPH_C32(0xde77cc4c), SPH_C32(0x121b4000), SPH_C32(0x5b17d9e8), - SPH_C32(0x8dfacfab), SPH_C32(0xce36cc72) }, - { SPH_C32(0x80d95000), SPH_C32(0x4a8fa5b3), SPH_C32(0x81824a3a), - SPH_C32(0xc0914ede), SPH_C32(0xd9b24000), SPH_C32(0xcb30ee81), - SPH_C32(0x36263bac), SPH_C32(0x1ec26313) }, - { SPH_C32(0x3fe54000), SPH_C32(0x8083d4a4), SPH_C32(0xb2a3a316), - SPH_C32(0x0e83632d), SPH_C32(0xad275000), SPH_C32(0x911ba8ff), - SPH_C32(0xbedb2687), SPH_C32(0x0024e181) }, - { SPH_C32(0x4b705000), SPH_C32(0xdaa892da), SPH_C32(0x3a5ebe3d), - SPH_C32(0x1065e1bf), SPH_C32(0x668e5000), SPH_C32(0x013c9f96), - SPH_C32(0x0507d280), SPH_C32(0xd0d04ee0) }, - { SPH_C32(0x1d666000), SPH_C32(0xa4f36f31), SPH_C32(0x18856d46), - SPH_C32(0xe3bec968), SPH_C32(0x85484000), SPH_C32(0x7b58b73b), - SPH_C32(0xfa4327a4), SPH_C32(0x6fda92b3) }, - { SPH_C32(0x69f37000), SPH_C32(0xfed8294f), SPH_C32(0x9078706d), - SPH_C32(0xfd584bfa), SPH_C32(0x4ee14000), SPH_C32(0xeb7f8052), - SPH_C32(0x419fd3a3), SPH_C32(0xbf2e3dd2) }, - { SPH_C32(0xd6cf6000), SPH_C32(0x34d45858), SPH_C32(0xa3599941), - SPH_C32(0x334a6609), SPH_C32(0x3a745000), SPH_C32(0xb154c62c), - SPH_C32(0xc962ce88), SPH_C32(0xa1c8bf40) }, - { SPH_C32(0xa25a7000), SPH_C32(0x6eff1e26), SPH_C32(0x2ba4846a), - SPH_C32(0x2dace49b), SPH_C32(0xf1dd5000), SPH_C32(0x2173f145), - SPH_C32(0x72be3a8f), SPH_C32(0x713c1021) }, - { SPH_C32(0x631f4000), SPH_C32(0x30eb8d1e), SPH_C32(0x7ec6bf1e), - SPH_C32(0x7f9b928d), SPH_C32(0x6c626000), SPH_C32(0xcf0f3bc7), - SPH_C32(0xebb91df3), SPH_C32(0x52139797) }, - { SPH_C32(0x178a5000), SPH_C32(0x6ac0cb60), SPH_C32(0xf63ba235), - SPH_C32(0x617d101f), SPH_C32(0xa7cb6000), SPH_C32(0x5f280cae), - SPH_C32(0x5065e9f4), SPH_C32(0x82e738f6) }, - { SPH_C32(0xa8b64000), SPH_C32(0xa0ccba77), SPH_C32(0xc51a4b19), - SPH_C32(0xaf6f3dec), SPH_C32(0xd35e7000), SPH_C32(0x05034ad0), - SPH_C32(0xd898f4df), SPH_C32(0x9c01ba64) }, - { SPH_C32(0xdc235000), SPH_C32(0xfae7fc09), SPH_C32(0x4de75632), - SPH_C32(0xb189bf7e), SPH_C32(0x18f77000), SPH_C32(0x95247db9), - SPH_C32(0x634400d8), SPH_C32(0x4cf51505) }, - { SPH_C32(0x8a356000), SPH_C32(0x84bc01e2), SPH_C32(0x6f3c8549), - SPH_C32(0x425297a9), SPH_C32(0xfb316000), SPH_C32(0xef405514), - SPH_C32(0x9c00f5fc), SPH_C32(0xf3ffc956) }, - { SPH_C32(0xfea07000), SPH_C32(0xde97479c), SPH_C32(0xe7c19862), - SPH_C32(0x5cb4153b), SPH_C32(0x30986000), SPH_C32(0x7f67627d), - SPH_C32(0x27dc01fb), SPH_C32(0x230b6637) }, - { SPH_C32(0x419c6000), SPH_C32(0x149b368b), SPH_C32(0xd4e0714e), - SPH_C32(0x92a638c8), SPH_C32(0x440d7000), SPH_C32(0x254c2403), - SPH_C32(0xaf211cd0), SPH_C32(0x3dede4a5) }, - { SPH_C32(0x35097000), SPH_C32(0x4eb070f5), SPH_C32(0x5c1d6c65), - SPH_C32(0x8c40ba5a), SPH_C32(0x8fa47000), SPH_C32(0xb56b136a), - SPH_C32(0x14fde8d7), SPH_C32(0xed194bc4) }, - { SPH_C32(0xe4788000), SPH_C32(0x859673c1), SPH_C32(0xb5fb2452), - SPH_C32(0x29cc5edf), SPH_C32(0x045f0000), SPH_C32(0x9c4a93c9), - SPH_C32(0x62fc79d0), SPH_C32(0x731ebdc2) }, - { SPH_C32(0x90ed9000), SPH_C32(0xdfbd35bf), SPH_C32(0x3d063979), - SPH_C32(0x372adc4d), SPH_C32(0xcff60000), SPH_C32(0x0c6da4a0), - SPH_C32(0xd9208dd7), SPH_C32(0xa3ea12a3) }, - { SPH_C32(0x2fd18000), SPH_C32(0x15b144a8), SPH_C32(0x0e27d055), - SPH_C32(0xf938f1be), SPH_C32(0xbb631000), SPH_C32(0x5646e2de), - SPH_C32(0x51dd90fc), SPH_C32(0xbd0c9031) }, - { SPH_C32(0x5b449000), SPH_C32(0x4f9a02d6), SPH_C32(0x86dacd7e), - SPH_C32(0xe7de732c), SPH_C32(0x70ca1000), SPH_C32(0xc661d5b7), - SPH_C32(0xea0164fb), SPH_C32(0x6df83f50) }, - { SPH_C32(0x0d52a000), SPH_C32(0x31c1ff3d), SPH_C32(0xa4011e05), - SPH_C32(0x14055bfb), SPH_C32(0x930c0000), SPH_C32(0xbc05fd1a), - SPH_C32(0x154591df), SPH_C32(0xd2f2e303) }, - { SPH_C32(0x79c7b000), SPH_C32(0x6beab943), SPH_C32(0x2cfc032e), - SPH_C32(0x0ae3d969), SPH_C32(0x58a50000), SPH_C32(0x2c22ca73), - SPH_C32(0xae9965d8), SPH_C32(0x02064c62) }, - { SPH_C32(0xc6fba000), SPH_C32(0xa1e6c854), SPH_C32(0x1fddea02), - SPH_C32(0xc4f1f49a), SPH_C32(0x2c301000), SPH_C32(0x76098c0d), - SPH_C32(0x266478f3), SPH_C32(0x1ce0cef0) }, - { SPH_C32(0xb26eb000), SPH_C32(0xfbcd8e2a), SPH_C32(0x9720f729), - SPH_C32(0xda177608), SPH_C32(0xe7991000), SPH_C32(0xe62ebb64), - SPH_C32(0x9db88cf4), SPH_C32(0xcc146191) }, - { SPH_C32(0x732b8000), SPH_C32(0xa5d91d12), SPH_C32(0xc242cc5d), - SPH_C32(0x8820001e), SPH_C32(0x7a262000), SPH_C32(0x085271e6), - SPH_C32(0x04bfab88), SPH_C32(0xef3be627) }, - { SPH_C32(0x07be9000), SPH_C32(0xfff25b6c), SPH_C32(0x4abfd176), - SPH_C32(0x96c6828c), SPH_C32(0xb18f2000), SPH_C32(0x9875468f), - SPH_C32(0xbf635f8f), SPH_C32(0x3fcf4946) }, - { SPH_C32(0xb8828000), SPH_C32(0x35fe2a7b), SPH_C32(0x799e385a), - SPH_C32(0x58d4af7f), SPH_C32(0xc51a3000), SPH_C32(0xc25e00f1), - SPH_C32(0x379e42a4), SPH_C32(0x2129cbd4) }, - { SPH_C32(0xcc179000), SPH_C32(0x6fd56c05), SPH_C32(0xf1632571), - SPH_C32(0x46322ded), SPH_C32(0x0eb33000), SPH_C32(0x52793798), - SPH_C32(0x8c42b6a3), SPH_C32(0xf1dd64b5) }, - { SPH_C32(0x9a01a000), SPH_C32(0x118e91ee), SPH_C32(0xd3b8f60a), - SPH_C32(0xb5e9053a), SPH_C32(0xed752000), SPH_C32(0x281d1f35), - SPH_C32(0x73064387), SPH_C32(0x4ed7b8e6) }, - { SPH_C32(0xee94b000), SPH_C32(0x4ba5d790), SPH_C32(0x5b45eb21), - SPH_C32(0xab0f87a8), SPH_C32(0x26dc2000), SPH_C32(0xb83a285c), - SPH_C32(0xc8dab780), SPH_C32(0x9e231787) }, - { SPH_C32(0x51a8a000), SPH_C32(0x81a9a687), SPH_C32(0x6864020d), - SPH_C32(0x651daa5b), SPH_C32(0x52493000), SPH_C32(0xe2116e22), - SPH_C32(0x4027aaab), SPH_C32(0x80c59515) }, - { SPH_C32(0x253db000), SPH_C32(0xdb82e0f9), SPH_C32(0xe0991f26), - SPH_C32(0x7bfb28c9), SPH_C32(0x99e03000), SPH_C32(0x7236594b), - SPH_C32(0xfbfb5eac), SPH_C32(0x50313a74) }, - { SPH_C32(0xf663c000), SPH_C32(0xde81aa29), SPH_C32(0x3801ebf9), - SPH_C32(0xe7fa92ad), SPH_C32(0xe2080000), SPH_C32(0xd7f9a9ec), - SPH_C32(0xe679e16a), SPH_C32(0x635fbdfc) }, - { SPH_C32(0x82f6d000), SPH_C32(0x84aaec57), SPH_C32(0xb0fcf6d2), - SPH_C32(0xf91c103f), SPH_C32(0x29a10000), SPH_C32(0x47de9e85), - SPH_C32(0x5da5156d), SPH_C32(0xb3ab129d) }, - { SPH_C32(0x3dcac000), SPH_C32(0x4ea69d40), SPH_C32(0x83dd1ffe), - SPH_C32(0x370e3dcc), SPH_C32(0x5d341000), SPH_C32(0x1df5d8fb), - SPH_C32(0xd5580846), SPH_C32(0xad4d900f) }, - { SPH_C32(0x495fd000), SPH_C32(0x148ddb3e), SPH_C32(0x0b2002d5), - SPH_C32(0x29e8bf5e), SPH_C32(0x969d1000), SPH_C32(0x8dd2ef92), - SPH_C32(0x6e84fc41), SPH_C32(0x7db93f6e) }, - { SPH_C32(0x1f49e000), SPH_C32(0x6ad626d5), SPH_C32(0x29fbd1ae), - SPH_C32(0xda339789), SPH_C32(0x755b0000), SPH_C32(0xf7b6c73f), - SPH_C32(0x91c00965), SPH_C32(0xc2b3e33d) }, - { SPH_C32(0x6bdcf000), SPH_C32(0x30fd60ab), SPH_C32(0xa106cc85), - SPH_C32(0xc4d5151b), SPH_C32(0xbef20000), SPH_C32(0x6791f056), - SPH_C32(0x2a1cfd62), SPH_C32(0x12474c5c) }, - { SPH_C32(0xd4e0e000), SPH_C32(0xfaf111bc), SPH_C32(0x922725a9), - SPH_C32(0x0ac738e8), SPH_C32(0xca671000), SPH_C32(0x3dbab628), - SPH_C32(0xa2e1e049), SPH_C32(0x0ca1cece) }, - { SPH_C32(0xa075f000), SPH_C32(0xa0da57c2), SPH_C32(0x1ada3882), - SPH_C32(0x1421ba7a), SPH_C32(0x01ce1000), SPH_C32(0xad9d8141), - SPH_C32(0x193d144e), SPH_C32(0xdc5561af) }, - { SPH_C32(0x6130c000), SPH_C32(0xfecec4fa), SPH_C32(0x4fb803f6), - SPH_C32(0x4616cc6c), SPH_C32(0x9c712000), SPH_C32(0x43e14bc3), - SPH_C32(0x803a3332), SPH_C32(0xff7ae619) }, - { SPH_C32(0x15a5d000), SPH_C32(0xa4e58284), SPH_C32(0xc7451edd), - SPH_C32(0x58f04efe), SPH_C32(0x57d82000), SPH_C32(0xd3c67caa), - SPH_C32(0x3be6c735), SPH_C32(0x2f8e4978) }, - { SPH_C32(0xaa99c000), SPH_C32(0x6ee9f393), SPH_C32(0xf464f7f1), - SPH_C32(0x96e2630d), SPH_C32(0x234d3000), SPH_C32(0x89ed3ad4), - SPH_C32(0xb31bda1e), SPH_C32(0x3168cbea) }, - { SPH_C32(0xde0cd000), SPH_C32(0x34c2b5ed), SPH_C32(0x7c99eada), - SPH_C32(0x8804e19f), SPH_C32(0xe8e43000), SPH_C32(0x19ca0dbd), - SPH_C32(0x08c72e19), SPH_C32(0xe19c648b) }, - { SPH_C32(0x881ae000), SPH_C32(0x4a994806), SPH_C32(0x5e4239a1), - SPH_C32(0x7bdfc948), SPH_C32(0x0b222000), SPH_C32(0x63ae2510), - SPH_C32(0xf783db3d), SPH_C32(0x5e96b8d8) }, - { SPH_C32(0xfc8ff000), SPH_C32(0x10b20e78), SPH_C32(0xd6bf248a), - SPH_C32(0x65394bda), SPH_C32(0xc08b2000), SPH_C32(0xf3891279), - SPH_C32(0x4c5f2f3a), SPH_C32(0x8e6217b9) }, - { SPH_C32(0x43b3e000), SPH_C32(0xdabe7f6f), SPH_C32(0xe59ecda6), - SPH_C32(0xab2b6629), SPH_C32(0xb41e3000), SPH_C32(0xa9a25407), - SPH_C32(0xc4a23211), SPH_C32(0x9084952b) }, - { SPH_C32(0x3726f000), SPH_C32(0x80953911), SPH_C32(0x6d63d08d), - SPH_C32(0xb5cde4bb), SPH_C32(0x7fb73000), SPH_C32(0x3985636e), - SPH_C32(0x7f7ec616), SPH_C32(0x40703a4a) }, - { SPH_C32(0x022f8000), SPH_C32(0xce2549e4), SPH_C32(0x317ebce8), - SPH_C32(0x398d5ee1), SPH_C32(0xf0134000), SPH_C32(0x8cee7004), - SPH_C32(0x6b832ec1), SPH_C32(0xad69718e) }, - { SPH_C32(0x76ba9000), SPH_C32(0x940e0f9a), SPH_C32(0xb983a1c3), - SPH_C32(0x276bdc73), SPH_C32(0x3bba4000), SPH_C32(0x1cc9476d), - SPH_C32(0xd05fdac6), SPH_C32(0x7d9ddeef) }, - { SPH_C32(0xc9868000), SPH_C32(0x5e027e8d), SPH_C32(0x8aa248ef), - SPH_C32(0xe979f180), SPH_C32(0x4f2f5000), SPH_C32(0x46e20113), - SPH_C32(0x58a2c7ed), SPH_C32(0x637b5c7d) }, - { SPH_C32(0xbd139000), SPH_C32(0x042938f3), SPH_C32(0x025f55c4), - SPH_C32(0xf79f7312), SPH_C32(0x84865000), SPH_C32(0xd6c5367a), - SPH_C32(0xe37e33ea), SPH_C32(0xb38ff31c) }, - { SPH_C32(0xeb05a000), SPH_C32(0x7a72c518), SPH_C32(0x208486bf), - SPH_C32(0x04445bc5), SPH_C32(0x67404000), SPH_C32(0xaca11ed7), - SPH_C32(0x1c3ac6ce), SPH_C32(0x0c852f4f) }, - { SPH_C32(0x9f90b000), SPH_C32(0x20598366), SPH_C32(0xa8799b94), - SPH_C32(0x1aa2d957), SPH_C32(0xace94000), SPH_C32(0x3c8629be), - SPH_C32(0xa7e632c9), SPH_C32(0xdc71802e) }, - { SPH_C32(0x20aca000), SPH_C32(0xea55f271), SPH_C32(0x9b5872b8), - SPH_C32(0xd4b0f4a4), SPH_C32(0xd87c5000), SPH_C32(0x66ad6fc0), - SPH_C32(0x2f1b2fe2), SPH_C32(0xc29702bc) }, - { SPH_C32(0x5439b000), SPH_C32(0xb07eb40f), SPH_C32(0x13a56f93), - SPH_C32(0xca567636), SPH_C32(0x13d55000), SPH_C32(0xf68a58a9), - SPH_C32(0x94c7dbe5), SPH_C32(0x1263addd) }, - { SPH_C32(0x957c8000), SPH_C32(0xee6a2737), SPH_C32(0x46c754e7), - SPH_C32(0x98610020), SPH_C32(0x8e6a6000), SPH_C32(0x18f6922b), - SPH_C32(0x0dc0fc99), SPH_C32(0x314c2a6b) }, - { SPH_C32(0xe1e99000), SPH_C32(0xb4416149), SPH_C32(0xce3a49cc), - SPH_C32(0x868782b2), SPH_C32(0x45c36000), SPH_C32(0x88d1a542), - SPH_C32(0xb61c089e), SPH_C32(0xe1b8850a) }, - { SPH_C32(0x5ed58000), SPH_C32(0x7e4d105e), SPH_C32(0xfd1ba0e0), - SPH_C32(0x4895af41), SPH_C32(0x31567000), SPH_C32(0xd2fae33c), - SPH_C32(0x3ee115b5), SPH_C32(0xff5e0798) }, - { SPH_C32(0x2a409000), SPH_C32(0x24665620), SPH_C32(0x75e6bdcb), - SPH_C32(0x56732dd3), SPH_C32(0xfaff7000), SPH_C32(0x42ddd455), - SPH_C32(0x853de1b2), SPH_C32(0x2faaa8f9) }, - { SPH_C32(0x7c56a000), SPH_C32(0x5a3dabcb), SPH_C32(0x573d6eb0), - SPH_C32(0xa5a80504), SPH_C32(0x19396000), SPH_C32(0x38b9fcf8), - SPH_C32(0x7a791496), SPH_C32(0x90a074aa) }, - { SPH_C32(0x08c3b000), SPH_C32(0x0016edb5), SPH_C32(0xdfc0739b), - SPH_C32(0xbb4e8796), SPH_C32(0xd2906000), SPH_C32(0xa89ecb91), - SPH_C32(0xc1a5e091), SPH_C32(0x4054dbcb) }, - { SPH_C32(0xb7ffa000), SPH_C32(0xca1a9ca2), SPH_C32(0xece19ab7), - SPH_C32(0x755caa65), SPH_C32(0xa6057000), SPH_C32(0xf2b58def), - SPH_C32(0x4958fdba), SPH_C32(0x5eb25959) }, - { SPH_C32(0xc36ab000), SPH_C32(0x9031dadc), SPH_C32(0x641c879c), - SPH_C32(0x6bba28f7), SPH_C32(0x6dac7000), SPH_C32(0x6292ba86), - SPH_C32(0xf28409bd), SPH_C32(0x8e46f638) }, - { SPH_C32(0x1034c000), SPH_C32(0x9532900c), SPH_C32(0xbc847343), - SPH_C32(0xf7bb9293), SPH_C32(0x16444000), SPH_C32(0xc75d4a21), - SPH_C32(0xef06b67b), SPH_C32(0xbd2871b0) }, - { SPH_C32(0x64a1d000), SPH_C32(0xcf19d672), SPH_C32(0x34796e68), - SPH_C32(0xe95d1001), SPH_C32(0xdded4000), SPH_C32(0x577a7d48), - SPH_C32(0x54da427c), SPH_C32(0x6ddcded1) }, - { SPH_C32(0xdb9dc000), SPH_C32(0x0515a765), SPH_C32(0x07588744), - SPH_C32(0x274f3df2), SPH_C32(0xa9785000), SPH_C32(0x0d513b36), - SPH_C32(0xdc275f57), SPH_C32(0x733a5c43) }, - { SPH_C32(0xaf08d000), SPH_C32(0x5f3ee11b), SPH_C32(0x8fa59a6f), - SPH_C32(0x39a9bf60), SPH_C32(0x62d15000), SPH_C32(0x9d760c5f), - SPH_C32(0x67fbab50), SPH_C32(0xa3cef322) }, - { SPH_C32(0xf91ee000), SPH_C32(0x21651cf0), SPH_C32(0xad7e4914), - SPH_C32(0xca7297b7), SPH_C32(0x81174000), SPH_C32(0xe71224f2), - SPH_C32(0x98bf5e74), SPH_C32(0x1cc42f71) }, - { SPH_C32(0x8d8bf000), SPH_C32(0x7b4e5a8e), SPH_C32(0x2583543f), - SPH_C32(0xd4941525), SPH_C32(0x4abe4000), SPH_C32(0x7735139b), - SPH_C32(0x2363aa73), SPH_C32(0xcc308010) }, - { SPH_C32(0x32b7e000), SPH_C32(0xb1422b99), SPH_C32(0x16a2bd13), - SPH_C32(0x1a8638d6), SPH_C32(0x3e2b5000), SPH_C32(0x2d1e55e5), - SPH_C32(0xab9eb758), SPH_C32(0xd2d60282) }, - { SPH_C32(0x4622f000), SPH_C32(0xeb696de7), SPH_C32(0x9e5fa038), - SPH_C32(0x0460ba44), SPH_C32(0xf5825000), SPH_C32(0xbd39628c), - SPH_C32(0x1042435f), SPH_C32(0x0222ade3) }, - { SPH_C32(0x8767c000), SPH_C32(0xb57dfedf), SPH_C32(0xcb3d9b4c), - SPH_C32(0x5657cc52), SPH_C32(0x683d6000), SPH_C32(0x5345a80e), - SPH_C32(0x89456423), SPH_C32(0x210d2a55) }, - { SPH_C32(0xf3f2d000), SPH_C32(0xef56b8a1), SPH_C32(0x43c08667), - SPH_C32(0x48b14ec0), SPH_C32(0xa3946000), SPH_C32(0xc3629f67), - SPH_C32(0x32999024), SPH_C32(0xf1f98534) }, - { SPH_C32(0x4ccec000), SPH_C32(0x255ac9b6), SPH_C32(0x70e16f4b), - SPH_C32(0x86a36333), SPH_C32(0xd7017000), SPH_C32(0x9949d919), - SPH_C32(0xba648d0f), SPH_C32(0xef1f07a6) }, - { SPH_C32(0x385bd000), SPH_C32(0x7f718fc8), SPH_C32(0xf81c7260), - SPH_C32(0x9845e1a1), SPH_C32(0x1ca87000), SPH_C32(0x096eee70), - SPH_C32(0x01b87908), SPH_C32(0x3feba8c7) }, - { SPH_C32(0x6e4de000), SPH_C32(0x012a7223), SPH_C32(0xdac7a11b), - SPH_C32(0x6b9ec976), SPH_C32(0xff6e6000), SPH_C32(0x730ac6dd), - SPH_C32(0xfefc8c2c), SPH_C32(0x80e17494) }, - { SPH_C32(0x1ad8f000), SPH_C32(0x5b01345d), SPH_C32(0x523abc30), - SPH_C32(0x75784be4), SPH_C32(0x34c76000), SPH_C32(0xe32df1b4), - SPH_C32(0x4520782b), SPH_C32(0x5015dbf5) }, - { SPH_C32(0xa5e4e000), SPH_C32(0x910d454a), SPH_C32(0x611b551c), - SPH_C32(0xbb6a6617), SPH_C32(0x40527000), SPH_C32(0xb906b7ca), - SPH_C32(0xcddd6500), SPH_C32(0x4ef35967) }, - { SPH_C32(0xd171f000), SPH_C32(0xcb260334), SPH_C32(0xe9e64837), - SPH_C32(0xa58ce485), SPH_C32(0x8bfb7000), SPH_C32(0x292180a3), - SPH_C32(0x76019107), SPH_C32(0x9e07f606) }, - { SPH_C32(0x045f0000), SPH_C32(0x9c4a93c9), SPH_C32(0x62fc79d0), - SPH_C32(0x731ebdc2), SPH_C32(0xe0278000), SPH_C32(0x19dce008), - SPH_C32(0xd7075d82), SPH_C32(0x5ad2e31d) }, - { SPH_C32(0x70ca1000), SPH_C32(0xc661d5b7), SPH_C32(0xea0164fb), - SPH_C32(0x6df83f50), SPH_C32(0x2b8e8000), SPH_C32(0x89fbd761), - SPH_C32(0x6cdba985), SPH_C32(0x8a264c7c) }, - { SPH_C32(0xcff60000), SPH_C32(0x0c6da4a0), SPH_C32(0xd9208dd7), - SPH_C32(0xa3ea12a3), SPH_C32(0x5f1b9000), SPH_C32(0xd3d0911f), - SPH_C32(0xe426b4ae), SPH_C32(0x94c0ceee) }, - { SPH_C32(0xbb631000), SPH_C32(0x5646e2de), SPH_C32(0x51dd90fc), - SPH_C32(0xbd0c9031), SPH_C32(0x94b29000), SPH_C32(0x43f7a676), - SPH_C32(0x5ffa40a9), SPH_C32(0x4434618f) }, - { SPH_C32(0xed752000), SPH_C32(0x281d1f35), SPH_C32(0x73064387), - SPH_C32(0x4ed7b8e6), SPH_C32(0x77748000), SPH_C32(0x39938edb), - SPH_C32(0xa0beb58d), SPH_C32(0xfb3ebddc) }, - { SPH_C32(0x99e03000), SPH_C32(0x7236594b), SPH_C32(0xfbfb5eac), - SPH_C32(0x50313a74), SPH_C32(0xbcdd8000), SPH_C32(0xa9b4b9b2), - SPH_C32(0x1b62418a), SPH_C32(0x2bca12bd) }, - { SPH_C32(0x26dc2000), SPH_C32(0xb83a285c), SPH_C32(0xc8dab780), - SPH_C32(0x9e231787), SPH_C32(0xc8489000), SPH_C32(0xf39fffcc), - SPH_C32(0x939f5ca1), SPH_C32(0x352c902f) }, - { SPH_C32(0x52493000), SPH_C32(0xe2116e22), SPH_C32(0x4027aaab), - SPH_C32(0x80c59515), SPH_C32(0x03e19000), SPH_C32(0x63b8c8a5), - SPH_C32(0x2843a8a6), SPH_C32(0xe5d83f4e) }, - { SPH_C32(0x930c0000), SPH_C32(0xbc05fd1a), SPH_C32(0x154591df), - SPH_C32(0xd2f2e303), SPH_C32(0x9e5ea000), SPH_C32(0x8dc40227), - SPH_C32(0xb1448fda), SPH_C32(0xc6f7b8f8) }, - { SPH_C32(0xe7991000), SPH_C32(0xe62ebb64), SPH_C32(0x9db88cf4), - SPH_C32(0xcc146191), SPH_C32(0x55f7a000), SPH_C32(0x1de3354e), - SPH_C32(0x0a987bdd), SPH_C32(0x16031799) }, - { SPH_C32(0x58a50000), SPH_C32(0x2c22ca73), SPH_C32(0xae9965d8), - SPH_C32(0x02064c62), SPH_C32(0x2162b000), SPH_C32(0x47c87330), - SPH_C32(0x826566f6), SPH_C32(0x08e5950b) }, - { SPH_C32(0x2c301000), SPH_C32(0x76098c0d), SPH_C32(0x266478f3), - SPH_C32(0x1ce0cef0), SPH_C32(0xeacbb000), SPH_C32(0xd7ef4459), - SPH_C32(0x39b992f1), SPH_C32(0xd8113a6a) }, - { SPH_C32(0x7a262000), SPH_C32(0x085271e6), SPH_C32(0x04bfab88), - SPH_C32(0xef3be627), SPH_C32(0x090da000), SPH_C32(0xad8b6cf4), - SPH_C32(0xc6fd67d5), SPH_C32(0x671be639) }, - { SPH_C32(0x0eb33000), SPH_C32(0x52793798), SPH_C32(0x8c42b6a3), - SPH_C32(0xf1dd64b5), SPH_C32(0xc2a4a000), SPH_C32(0x3dac5b9d), - SPH_C32(0x7d2193d2), SPH_C32(0xb7ef4958) }, - { SPH_C32(0xb18f2000), SPH_C32(0x9875468f), SPH_C32(0xbf635f8f), - SPH_C32(0x3fcf4946), SPH_C32(0xb631b000), SPH_C32(0x67871de3), - SPH_C32(0xf5dc8ef9), SPH_C32(0xa909cbca) }, - { SPH_C32(0xc51a3000), SPH_C32(0xc25e00f1), SPH_C32(0x379e42a4), - SPH_C32(0x2129cbd4), SPH_C32(0x7d98b000), SPH_C32(0xf7a02a8a), - SPH_C32(0x4e007afe), SPH_C32(0x79fd64ab) }, - { SPH_C32(0x16444000), SPH_C32(0xc75d4a21), SPH_C32(0xef06b67b), - SPH_C32(0xbd2871b0), SPH_C32(0x06708000), SPH_C32(0x526fda2d), - SPH_C32(0x5382c538), SPH_C32(0x4a93e323) }, - { SPH_C32(0x62d15000), SPH_C32(0x9d760c5f), SPH_C32(0x67fbab50), - SPH_C32(0xa3cef322), SPH_C32(0xcdd98000), SPH_C32(0xc248ed44), - SPH_C32(0xe85e313f), SPH_C32(0x9a674c42) }, - { SPH_C32(0xdded4000), SPH_C32(0x577a7d48), SPH_C32(0x54da427c), - SPH_C32(0x6ddcded1), SPH_C32(0xb94c9000), SPH_C32(0x9863ab3a), - SPH_C32(0x60a32c14), SPH_C32(0x8481ced0) }, - { SPH_C32(0xa9785000), SPH_C32(0x0d513b36), SPH_C32(0xdc275f57), - SPH_C32(0x733a5c43), SPH_C32(0x72e59000), SPH_C32(0x08449c53), - SPH_C32(0xdb7fd813), SPH_C32(0x547561b1) }, - { SPH_C32(0xff6e6000), SPH_C32(0x730ac6dd), SPH_C32(0xfefc8c2c), - SPH_C32(0x80e17494), SPH_C32(0x91238000), SPH_C32(0x7220b4fe), - SPH_C32(0x243b2d37), SPH_C32(0xeb7fbde2) }, - { SPH_C32(0x8bfb7000), SPH_C32(0x292180a3), SPH_C32(0x76019107), - SPH_C32(0x9e07f606), SPH_C32(0x5a8a8000), SPH_C32(0xe2078397), - SPH_C32(0x9fe7d930), SPH_C32(0x3b8b1283) }, - { SPH_C32(0x34c76000), SPH_C32(0xe32df1b4), SPH_C32(0x4520782b), - SPH_C32(0x5015dbf5), SPH_C32(0x2e1f9000), SPH_C32(0xb82cc5e9), - SPH_C32(0x171ac41b), SPH_C32(0x256d9011) }, - { SPH_C32(0x40527000), SPH_C32(0xb906b7ca), SPH_C32(0xcddd6500), - SPH_C32(0x4ef35967), SPH_C32(0xe5b69000), SPH_C32(0x280bf280), - SPH_C32(0xacc6301c), SPH_C32(0xf5993f70) }, - { SPH_C32(0x81174000), SPH_C32(0xe71224f2), SPH_C32(0x98bf5e74), - SPH_C32(0x1cc42f71), SPH_C32(0x7809a000), SPH_C32(0xc6773802), - SPH_C32(0x35c11760), SPH_C32(0xd6b6b8c6) }, - { SPH_C32(0xf5825000), SPH_C32(0xbd39628c), SPH_C32(0x1042435f), - SPH_C32(0x0222ade3), SPH_C32(0xb3a0a000), SPH_C32(0x56500f6b), - SPH_C32(0x8e1de367), SPH_C32(0x064217a7) }, - { SPH_C32(0x4abe4000), SPH_C32(0x7735139b), SPH_C32(0x2363aa73), - SPH_C32(0xcc308010), SPH_C32(0xc735b000), SPH_C32(0x0c7b4915), - SPH_C32(0x06e0fe4c), SPH_C32(0x18a49535) }, - { SPH_C32(0x3e2b5000), SPH_C32(0x2d1e55e5), SPH_C32(0xab9eb758), - SPH_C32(0xd2d60282), SPH_C32(0x0c9cb000), SPH_C32(0x9c5c7e7c), - SPH_C32(0xbd3c0a4b), SPH_C32(0xc8503a54) }, - { SPH_C32(0x683d6000), SPH_C32(0x5345a80e), SPH_C32(0x89456423), - SPH_C32(0x210d2a55), SPH_C32(0xef5aa000), SPH_C32(0xe63856d1), - SPH_C32(0x4278ff6f), SPH_C32(0x775ae607) }, - { SPH_C32(0x1ca87000), SPH_C32(0x096eee70), SPH_C32(0x01b87908), - SPH_C32(0x3feba8c7), SPH_C32(0x24f3a000), SPH_C32(0x761f61b8), - SPH_C32(0xf9a40b68), SPH_C32(0xa7ae4966) }, - { SPH_C32(0xa3946000), SPH_C32(0xc3629f67), SPH_C32(0x32999024), - SPH_C32(0xf1f98534), SPH_C32(0x5066b000), SPH_C32(0x2c3427c6), - SPH_C32(0x71591643), SPH_C32(0xb948cbf4) }, - { SPH_C32(0xd7017000), SPH_C32(0x9949d919), SPH_C32(0xba648d0f), - SPH_C32(0xef1f07a6), SPH_C32(0x9bcfb000), SPH_C32(0xbc1310af), - SPH_C32(0xca85e244), SPH_C32(0x69bc6495) }, - { SPH_C32(0xe2080000), SPH_C32(0xd7f9a9ec), SPH_C32(0xe679e16a), - SPH_C32(0x635fbdfc), SPH_C32(0x146bc000), SPH_C32(0x097803c5), - SPH_C32(0xde780a93), SPH_C32(0x84a52f51) }, - { SPH_C32(0x969d1000), SPH_C32(0x8dd2ef92), SPH_C32(0x6e84fc41), - SPH_C32(0x7db93f6e), SPH_C32(0xdfc2c000), SPH_C32(0x995f34ac), - SPH_C32(0x65a4fe94), SPH_C32(0x54518030) }, - { SPH_C32(0x29a10000), SPH_C32(0x47de9e85), SPH_C32(0x5da5156d), - SPH_C32(0xb3ab129d), SPH_C32(0xab57d000), SPH_C32(0xc37472d2), - SPH_C32(0xed59e3bf), SPH_C32(0x4ab702a2) }, - { SPH_C32(0x5d341000), SPH_C32(0x1df5d8fb), SPH_C32(0xd5580846), - SPH_C32(0xad4d900f), SPH_C32(0x60fed000), SPH_C32(0x535345bb), - SPH_C32(0x568517b8), SPH_C32(0x9a43adc3) }, - { SPH_C32(0x0b222000), SPH_C32(0x63ae2510), SPH_C32(0xf783db3d), - SPH_C32(0x5e96b8d8), SPH_C32(0x8338c000), SPH_C32(0x29376d16), - SPH_C32(0xa9c1e29c), SPH_C32(0x25497190) }, - { SPH_C32(0x7fb73000), SPH_C32(0x3985636e), SPH_C32(0x7f7ec616), - SPH_C32(0x40703a4a), SPH_C32(0x4891c000), SPH_C32(0xb9105a7f), - SPH_C32(0x121d169b), SPH_C32(0xf5bddef1) }, - { SPH_C32(0xc08b2000), SPH_C32(0xf3891279), SPH_C32(0x4c5f2f3a), - SPH_C32(0x8e6217b9), SPH_C32(0x3c04d000), SPH_C32(0xe33b1c01), - SPH_C32(0x9ae00bb0), SPH_C32(0xeb5b5c63) }, - { SPH_C32(0xb41e3000), SPH_C32(0xa9a25407), SPH_C32(0xc4a23211), - SPH_C32(0x9084952b), SPH_C32(0xf7add000), SPH_C32(0x731c2b68), - SPH_C32(0x213cffb7), SPH_C32(0x3baff302) }, - { SPH_C32(0x755b0000), SPH_C32(0xf7b6c73f), SPH_C32(0x91c00965), - SPH_C32(0xc2b3e33d), SPH_C32(0x6a12e000), SPH_C32(0x9d60e1ea), - SPH_C32(0xb83bd8cb), SPH_C32(0x188074b4) }, - { SPH_C32(0x01ce1000), SPH_C32(0xad9d8141), SPH_C32(0x193d144e), - SPH_C32(0xdc5561af), SPH_C32(0xa1bbe000), SPH_C32(0x0d47d683), - SPH_C32(0x03e72ccc), SPH_C32(0xc874dbd5) }, - { SPH_C32(0xbef20000), SPH_C32(0x6791f056), SPH_C32(0x2a1cfd62), - SPH_C32(0x12474c5c), SPH_C32(0xd52ef000), SPH_C32(0x576c90fd), - SPH_C32(0x8b1a31e7), SPH_C32(0xd6925947) }, - { SPH_C32(0xca671000), SPH_C32(0x3dbab628), SPH_C32(0xa2e1e049), - SPH_C32(0x0ca1cece), SPH_C32(0x1e87f000), SPH_C32(0xc74ba794), - SPH_C32(0x30c6c5e0), SPH_C32(0x0666f626) }, - { SPH_C32(0x9c712000), SPH_C32(0x43e14bc3), SPH_C32(0x803a3332), - SPH_C32(0xff7ae619), SPH_C32(0xfd41e000), SPH_C32(0xbd2f8f39), - SPH_C32(0xcf8230c4), SPH_C32(0xb96c2a75) }, - { SPH_C32(0xe8e43000), SPH_C32(0x19ca0dbd), SPH_C32(0x08c72e19), - SPH_C32(0xe19c648b), SPH_C32(0x36e8e000), SPH_C32(0x2d08b850), - SPH_C32(0x745ec4c3), SPH_C32(0x69988514) }, - { SPH_C32(0x57d82000), SPH_C32(0xd3c67caa), SPH_C32(0x3be6c735), - SPH_C32(0x2f8e4978), SPH_C32(0x427df000), SPH_C32(0x7723fe2e), - SPH_C32(0xfca3d9e8), SPH_C32(0x777e0786) }, - { SPH_C32(0x234d3000), SPH_C32(0x89ed3ad4), SPH_C32(0xb31bda1e), - SPH_C32(0x3168cbea), SPH_C32(0x89d4f000), SPH_C32(0xe704c947), - SPH_C32(0x477f2def), SPH_C32(0xa78aa8e7) }, - { SPH_C32(0xf0134000), SPH_C32(0x8cee7004), SPH_C32(0x6b832ec1), - SPH_C32(0xad69718e), SPH_C32(0xf23cc000), SPH_C32(0x42cb39e0), - SPH_C32(0x5afd9229), SPH_C32(0x94e42f6f) }, - { SPH_C32(0x84865000), SPH_C32(0xd6c5367a), SPH_C32(0xe37e33ea), - SPH_C32(0xb38ff31c), SPH_C32(0x3995c000), SPH_C32(0xd2ec0e89), - SPH_C32(0xe121662e), SPH_C32(0x4410800e) }, - { SPH_C32(0x3bba4000), SPH_C32(0x1cc9476d), SPH_C32(0xd05fdac6), - SPH_C32(0x7d9ddeef), SPH_C32(0x4d00d000), SPH_C32(0x88c748f7), - SPH_C32(0x69dc7b05), SPH_C32(0x5af6029c) }, - { SPH_C32(0x4f2f5000), SPH_C32(0x46e20113), SPH_C32(0x58a2c7ed), - SPH_C32(0x637b5c7d), SPH_C32(0x86a9d000), SPH_C32(0x18e07f9e), - SPH_C32(0xd2008f02), SPH_C32(0x8a02adfd) }, - { SPH_C32(0x19396000), SPH_C32(0x38b9fcf8), SPH_C32(0x7a791496), - SPH_C32(0x90a074aa), SPH_C32(0x656fc000), SPH_C32(0x62845733), - SPH_C32(0x2d447a26), SPH_C32(0x350871ae) }, - { SPH_C32(0x6dac7000), SPH_C32(0x6292ba86), SPH_C32(0xf28409bd), - SPH_C32(0x8e46f638), SPH_C32(0xaec6c000), SPH_C32(0xf2a3605a), - SPH_C32(0x96988e21), SPH_C32(0xe5fcdecf) }, - { SPH_C32(0xd2906000), SPH_C32(0xa89ecb91), SPH_C32(0xc1a5e091), - SPH_C32(0x4054dbcb), SPH_C32(0xda53d000), SPH_C32(0xa8882624), - SPH_C32(0x1e65930a), SPH_C32(0xfb1a5c5d) }, - { SPH_C32(0xa6057000), SPH_C32(0xf2b58def), SPH_C32(0x4958fdba), - SPH_C32(0x5eb25959), SPH_C32(0x11fad000), SPH_C32(0x38af114d), - SPH_C32(0xa5b9670d), SPH_C32(0x2beef33c) }, - { SPH_C32(0x67404000), SPH_C32(0xaca11ed7), SPH_C32(0x1c3ac6ce), - SPH_C32(0x0c852f4f), SPH_C32(0x8c45e000), SPH_C32(0xd6d3dbcf), - SPH_C32(0x3cbe4071), SPH_C32(0x08c1748a) }, - { SPH_C32(0x13d55000), SPH_C32(0xf68a58a9), SPH_C32(0x94c7dbe5), - SPH_C32(0x1263addd), SPH_C32(0x47ece000), SPH_C32(0x46f4eca6), - SPH_C32(0x8762b476), SPH_C32(0xd835dbeb) }, - { SPH_C32(0xace94000), SPH_C32(0x3c8629be), SPH_C32(0xa7e632c9), - SPH_C32(0xdc71802e), SPH_C32(0x3379f000), SPH_C32(0x1cdfaad8), - SPH_C32(0x0f9fa95d), SPH_C32(0xc6d35979) }, - { SPH_C32(0xd87c5000), SPH_C32(0x66ad6fc0), SPH_C32(0x2f1b2fe2), - SPH_C32(0xc29702bc), SPH_C32(0xf8d0f000), SPH_C32(0x8cf89db1), - SPH_C32(0xb4435d5a), SPH_C32(0x1627f618) }, - { SPH_C32(0x8e6a6000), SPH_C32(0x18f6922b), SPH_C32(0x0dc0fc99), - SPH_C32(0x314c2a6b), SPH_C32(0x1b16e000), SPH_C32(0xf69cb51c), - SPH_C32(0x4b07a87e), SPH_C32(0xa92d2a4b) }, - { SPH_C32(0xfaff7000), SPH_C32(0x42ddd455), SPH_C32(0x853de1b2), - SPH_C32(0x2faaa8f9), SPH_C32(0xd0bfe000), SPH_C32(0x66bb8275), - SPH_C32(0xf0db5c79), SPH_C32(0x79d9852a) }, - { SPH_C32(0x45c36000), SPH_C32(0x88d1a542), SPH_C32(0xb61c089e), - SPH_C32(0xe1b8850a), SPH_C32(0xa42af000), SPH_C32(0x3c90c40b), - SPH_C32(0x78264152), SPH_C32(0x673f07b8) }, - { SPH_C32(0x31567000), SPH_C32(0xd2fae33c), SPH_C32(0x3ee115b5), - SPH_C32(0xff5e0798), SPH_C32(0x6f83f000), SPH_C32(0xacb7f362), - SPH_C32(0xc3fab555), SPH_C32(0xb7cba8d9) }, - { SPH_C32(0xe0278000), SPH_C32(0x19dce008), SPH_C32(0xd7075d82), - SPH_C32(0x5ad2e31d), SPH_C32(0xe4788000), SPH_C32(0x859673c1), - SPH_C32(0xb5fb2452), SPH_C32(0x29cc5edf) }, - { SPH_C32(0x94b29000), SPH_C32(0x43f7a676), SPH_C32(0x5ffa40a9), - SPH_C32(0x4434618f), SPH_C32(0x2fd18000), SPH_C32(0x15b144a8), - SPH_C32(0x0e27d055), SPH_C32(0xf938f1be) }, - { SPH_C32(0x2b8e8000), SPH_C32(0x89fbd761), SPH_C32(0x6cdba985), - SPH_C32(0x8a264c7c), SPH_C32(0x5b449000), SPH_C32(0x4f9a02d6), - SPH_C32(0x86dacd7e), SPH_C32(0xe7de732c) }, - { SPH_C32(0x5f1b9000), SPH_C32(0xd3d0911f), SPH_C32(0xe426b4ae), - SPH_C32(0x94c0ceee), SPH_C32(0x90ed9000), SPH_C32(0xdfbd35bf), - SPH_C32(0x3d063979), SPH_C32(0x372adc4d) }, - { SPH_C32(0x090da000), SPH_C32(0xad8b6cf4), SPH_C32(0xc6fd67d5), - SPH_C32(0x671be639), SPH_C32(0x732b8000), SPH_C32(0xa5d91d12), - SPH_C32(0xc242cc5d), SPH_C32(0x8820001e) }, - { SPH_C32(0x7d98b000), SPH_C32(0xf7a02a8a), SPH_C32(0x4e007afe), - SPH_C32(0x79fd64ab), SPH_C32(0xb8828000), SPH_C32(0x35fe2a7b), - SPH_C32(0x799e385a), SPH_C32(0x58d4af7f) }, - { SPH_C32(0xc2a4a000), SPH_C32(0x3dac5b9d), SPH_C32(0x7d2193d2), - SPH_C32(0xb7ef4958), SPH_C32(0xcc179000), SPH_C32(0x6fd56c05), - SPH_C32(0xf1632571), SPH_C32(0x46322ded) }, - { SPH_C32(0xb631b000), SPH_C32(0x67871de3), SPH_C32(0xf5dc8ef9), - SPH_C32(0xa909cbca), SPH_C32(0x07be9000), SPH_C32(0xfff25b6c), - SPH_C32(0x4abfd176), SPH_C32(0x96c6828c) }, - { SPH_C32(0x77748000), SPH_C32(0x39938edb), SPH_C32(0xa0beb58d), - SPH_C32(0xfb3ebddc), SPH_C32(0x9a01a000), SPH_C32(0x118e91ee), - SPH_C32(0xd3b8f60a), SPH_C32(0xb5e9053a) }, - { SPH_C32(0x03e19000), SPH_C32(0x63b8c8a5), SPH_C32(0x2843a8a6), - SPH_C32(0xe5d83f4e), SPH_C32(0x51a8a000), SPH_C32(0x81a9a687), - SPH_C32(0x6864020d), SPH_C32(0x651daa5b) }, - { SPH_C32(0xbcdd8000), SPH_C32(0xa9b4b9b2), SPH_C32(0x1b62418a), - SPH_C32(0x2bca12bd), SPH_C32(0x253db000), SPH_C32(0xdb82e0f9), - SPH_C32(0xe0991f26), SPH_C32(0x7bfb28c9) }, - { SPH_C32(0xc8489000), SPH_C32(0xf39fffcc), SPH_C32(0x939f5ca1), - SPH_C32(0x352c902f), SPH_C32(0xee94b000), SPH_C32(0x4ba5d790), - SPH_C32(0x5b45eb21), SPH_C32(0xab0f87a8) }, - { SPH_C32(0x9e5ea000), SPH_C32(0x8dc40227), SPH_C32(0xb1448fda), - SPH_C32(0xc6f7b8f8), SPH_C32(0x0d52a000), SPH_C32(0x31c1ff3d), - SPH_C32(0xa4011e05), SPH_C32(0x14055bfb) }, - { SPH_C32(0xeacbb000), SPH_C32(0xd7ef4459), SPH_C32(0x39b992f1), - SPH_C32(0xd8113a6a), SPH_C32(0xc6fba000), SPH_C32(0xa1e6c854), - SPH_C32(0x1fddea02), SPH_C32(0xc4f1f49a) }, - { SPH_C32(0x55f7a000), SPH_C32(0x1de3354e), SPH_C32(0x0a987bdd), - SPH_C32(0x16031799), SPH_C32(0xb26eb000), SPH_C32(0xfbcd8e2a), - SPH_C32(0x9720f729), SPH_C32(0xda177608) }, - { SPH_C32(0x2162b000), SPH_C32(0x47c87330), SPH_C32(0x826566f6), - SPH_C32(0x08e5950b), SPH_C32(0x79c7b000), SPH_C32(0x6beab943), - SPH_C32(0x2cfc032e), SPH_C32(0x0ae3d969) }, - { SPH_C32(0xf23cc000), SPH_C32(0x42cb39e0), SPH_C32(0x5afd9229), - SPH_C32(0x94e42f6f), SPH_C32(0x022f8000), SPH_C32(0xce2549e4), - SPH_C32(0x317ebce8), SPH_C32(0x398d5ee1) }, - { SPH_C32(0x86a9d000), SPH_C32(0x18e07f9e), SPH_C32(0xd2008f02), - SPH_C32(0x8a02adfd), SPH_C32(0xc9868000), SPH_C32(0x5e027e8d), - SPH_C32(0x8aa248ef), SPH_C32(0xe979f180) }, - { SPH_C32(0x3995c000), SPH_C32(0xd2ec0e89), SPH_C32(0xe121662e), - SPH_C32(0x4410800e), SPH_C32(0xbd139000), SPH_C32(0x042938f3), - SPH_C32(0x025f55c4), SPH_C32(0xf79f7312) }, - { SPH_C32(0x4d00d000), SPH_C32(0x88c748f7), SPH_C32(0x69dc7b05), - SPH_C32(0x5af6029c), SPH_C32(0x76ba9000), SPH_C32(0x940e0f9a), - SPH_C32(0xb983a1c3), SPH_C32(0x276bdc73) }, - { SPH_C32(0x1b16e000), SPH_C32(0xf69cb51c), SPH_C32(0x4b07a87e), - SPH_C32(0xa92d2a4b), SPH_C32(0x957c8000), SPH_C32(0xee6a2737), - SPH_C32(0x46c754e7), SPH_C32(0x98610020) }, - { SPH_C32(0x6f83f000), SPH_C32(0xacb7f362), SPH_C32(0xc3fab555), - SPH_C32(0xb7cba8d9), SPH_C32(0x5ed58000), SPH_C32(0x7e4d105e), - SPH_C32(0xfd1ba0e0), SPH_C32(0x4895af41) }, - { SPH_C32(0xd0bfe000), SPH_C32(0x66bb8275), SPH_C32(0xf0db5c79), - SPH_C32(0x79d9852a), SPH_C32(0x2a409000), SPH_C32(0x24665620), - SPH_C32(0x75e6bdcb), SPH_C32(0x56732dd3) }, - { SPH_C32(0xa42af000), SPH_C32(0x3c90c40b), SPH_C32(0x78264152), - SPH_C32(0x673f07b8), SPH_C32(0xe1e99000), SPH_C32(0xb4416149), - SPH_C32(0xce3a49cc), SPH_C32(0x868782b2) }, - { SPH_C32(0x656fc000), SPH_C32(0x62845733), SPH_C32(0x2d447a26), - SPH_C32(0x350871ae), SPH_C32(0x7c56a000), SPH_C32(0x5a3dabcb), - SPH_C32(0x573d6eb0), SPH_C32(0xa5a80504) }, - { SPH_C32(0x11fad000), SPH_C32(0x38af114d), SPH_C32(0xa5b9670d), - SPH_C32(0x2beef33c), SPH_C32(0xb7ffa000), SPH_C32(0xca1a9ca2), - SPH_C32(0xece19ab7), SPH_C32(0x755caa65) }, - { SPH_C32(0xaec6c000), SPH_C32(0xf2a3605a), SPH_C32(0x96988e21), - SPH_C32(0xe5fcdecf), SPH_C32(0xc36ab000), SPH_C32(0x9031dadc), - SPH_C32(0x641c879c), SPH_C32(0x6bba28f7) }, - { SPH_C32(0xda53d000), SPH_C32(0xa8882624), SPH_C32(0x1e65930a), - SPH_C32(0xfb1a5c5d), SPH_C32(0x08c3b000), SPH_C32(0x0016edb5), - SPH_C32(0xdfc0739b), SPH_C32(0xbb4e8796) }, - { SPH_C32(0x8c45e000), SPH_C32(0xd6d3dbcf), SPH_C32(0x3cbe4071), - SPH_C32(0x08c1748a), SPH_C32(0xeb05a000), SPH_C32(0x7a72c518), - SPH_C32(0x208486bf), SPH_C32(0x04445bc5) }, - { SPH_C32(0xf8d0f000), SPH_C32(0x8cf89db1), SPH_C32(0xb4435d5a), - SPH_C32(0x1627f618), SPH_C32(0x20aca000), SPH_C32(0xea55f271), - SPH_C32(0x9b5872b8), SPH_C32(0xd4b0f4a4) }, - { SPH_C32(0x47ece000), SPH_C32(0x46f4eca6), SPH_C32(0x8762b476), - SPH_C32(0xd835dbeb), SPH_C32(0x5439b000), SPH_C32(0xb07eb40f), - SPH_C32(0x13a56f93), SPH_C32(0xca567636) }, - { SPH_C32(0x3379f000), SPH_C32(0x1cdfaad8), SPH_C32(0x0f9fa95d), - SPH_C32(0xc6d35979), SPH_C32(0x9f90b000), SPH_C32(0x20598366), - SPH_C32(0xa8799b94), SPH_C32(0x1aa2d957) }, - { SPH_C32(0x06708000), SPH_C32(0x526fda2d), SPH_C32(0x5382c538), - SPH_C32(0x4a93e323), SPH_C32(0x1034c000), SPH_C32(0x9532900c), - SPH_C32(0xbc847343), SPH_C32(0xf7bb9293) }, - { SPH_C32(0x72e59000), SPH_C32(0x08449c53), SPH_C32(0xdb7fd813), - SPH_C32(0x547561b1), SPH_C32(0xdb9dc000), SPH_C32(0x0515a765), - SPH_C32(0x07588744), SPH_C32(0x274f3df2) }, - { SPH_C32(0xcdd98000), SPH_C32(0xc248ed44), SPH_C32(0xe85e313f), - SPH_C32(0x9a674c42), SPH_C32(0xaf08d000), SPH_C32(0x5f3ee11b), - SPH_C32(0x8fa59a6f), SPH_C32(0x39a9bf60) }, - { SPH_C32(0xb94c9000), SPH_C32(0x9863ab3a), SPH_C32(0x60a32c14), - SPH_C32(0x8481ced0), SPH_C32(0x64a1d000), SPH_C32(0xcf19d672), - SPH_C32(0x34796e68), SPH_C32(0xe95d1001) }, - { SPH_C32(0xef5aa000), SPH_C32(0xe63856d1), SPH_C32(0x4278ff6f), - SPH_C32(0x775ae607), SPH_C32(0x8767c000), SPH_C32(0xb57dfedf), - SPH_C32(0xcb3d9b4c), SPH_C32(0x5657cc52) }, - { SPH_C32(0x9bcfb000), SPH_C32(0xbc1310af), SPH_C32(0xca85e244), - SPH_C32(0x69bc6495), SPH_C32(0x4ccec000), SPH_C32(0x255ac9b6), - SPH_C32(0x70e16f4b), SPH_C32(0x86a36333) }, - { SPH_C32(0x24f3a000), SPH_C32(0x761f61b8), SPH_C32(0xf9a40b68), - SPH_C32(0xa7ae4966), SPH_C32(0x385bd000), SPH_C32(0x7f718fc8), - SPH_C32(0xf81c7260), SPH_C32(0x9845e1a1) }, - { SPH_C32(0x5066b000), SPH_C32(0x2c3427c6), SPH_C32(0x71591643), - SPH_C32(0xb948cbf4), SPH_C32(0xf3f2d000), SPH_C32(0xef56b8a1), - SPH_C32(0x43c08667), SPH_C32(0x48b14ec0) }, - { SPH_C32(0x91238000), SPH_C32(0x7220b4fe), SPH_C32(0x243b2d37), - SPH_C32(0xeb7fbde2), SPH_C32(0x6e4de000), SPH_C32(0x012a7223), - SPH_C32(0xdac7a11b), SPH_C32(0x6b9ec976) }, - { SPH_C32(0xe5b69000), SPH_C32(0x280bf280), SPH_C32(0xacc6301c), - SPH_C32(0xf5993f70), SPH_C32(0xa5e4e000), SPH_C32(0x910d454a), - SPH_C32(0x611b551c), SPH_C32(0xbb6a6617) }, - { SPH_C32(0x5a8a8000), SPH_C32(0xe2078397), SPH_C32(0x9fe7d930), - SPH_C32(0x3b8b1283), SPH_C32(0xd171f000), SPH_C32(0xcb260334), - SPH_C32(0xe9e64837), SPH_C32(0xa58ce485) }, - { SPH_C32(0x2e1f9000), SPH_C32(0xb82cc5e9), SPH_C32(0x171ac41b), - SPH_C32(0x256d9011), SPH_C32(0x1ad8f000), SPH_C32(0x5b01345d), - SPH_C32(0x523abc30), SPH_C32(0x75784be4) }, - { SPH_C32(0x7809a000), SPH_C32(0xc6773802), SPH_C32(0x35c11760), - SPH_C32(0xd6b6b8c6), SPH_C32(0xf91ee000), SPH_C32(0x21651cf0), - SPH_C32(0xad7e4914), SPH_C32(0xca7297b7) }, - { SPH_C32(0x0c9cb000), SPH_C32(0x9c5c7e7c), SPH_C32(0xbd3c0a4b), - SPH_C32(0xc8503a54), SPH_C32(0x32b7e000), SPH_C32(0xb1422b99), - SPH_C32(0x16a2bd13), SPH_C32(0x1a8638d6) }, - { SPH_C32(0xb3a0a000), SPH_C32(0x56500f6b), SPH_C32(0x8e1de367), - SPH_C32(0x064217a7), SPH_C32(0x4622f000), SPH_C32(0xeb696de7), - SPH_C32(0x9e5fa038), SPH_C32(0x0460ba44) }, - { SPH_C32(0xc735b000), SPH_C32(0x0c7b4915), SPH_C32(0x06e0fe4c), - SPH_C32(0x18a49535), SPH_C32(0x8d8bf000), SPH_C32(0x7b4e5a8e), - SPH_C32(0x2583543f), SPH_C32(0xd4941525) }, - { SPH_C32(0x146bc000), SPH_C32(0x097803c5), SPH_C32(0xde780a93), - SPH_C32(0x84a52f51), SPH_C32(0xf663c000), SPH_C32(0xde81aa29), - SPH_C32(0x3801ebf9), SPH_C32(0xe7fa92ad) }, - { SPH_C32(0x60fed000), SPH_C32(0x535345bb), SPH_C32(0x568517b8), - SPH_C32(0x9a43adc3), SPH_C32(0x3dcac000), SPH_C32(0x4ea69d40), - SPH_C32(0x83dd1ffe), SPH_C32(0x370e3dcc) }, - { SPH_C32(0xdfc2c000), SPH_C32(0x995f34ac), SPH_C32(0x65a4fe94), - SPH_C32(0x54518030), SPH_C32(0x495fd000), SPH_C32(0x148ddb3e), - SPH_C32(0x0b2002d5), SPH_C32(0x29e8bf5e) }, - { SPH_C32(0xab57d000), SPH_C32(0xc37472d2), SPH_C32(0xed59e3bf), - SPH_C32(0x4ab702a2), SPH_C32(0x82f6d000), SPH_C32(0x84aaec57), - SPH_C32(0xb0fcf6d2), SPH_C32(0xf91c103f) }, - { SPH_C32(0xfd41e000), SPH_C32(0xbd2f8f39), SPH_C32(0xcf8230c4), - SPH_C32(0xb96c2a75), SPH_C32(0x6130c000), SPH_C32(0xfecec4fa), - SPH_C32(0x4fb803f6), SPH_C32(0x4616cc6c) }, - { SPH_C32(0x89d4f000), SPH_C32(0xe704c947), SPH_C32(0x477f2def), - SPH_C32(0xa78aa8e7), SPH_C32(0xaa99c000), SPH_C32(0x6ee9f393), - SPH_C32(0xf464f7f1), SPH_C32(0x96e2630d) }, - { SPH_C32(0x36e8e000), SPH_C32(0x2d08b850), SPH_C32(0x745ec4c3), - SPH_C32(0x69988514), SPH_C32(0xde0cd000), SPH_C32(0x34c2b5ed), - SPH_C32(0x7c99eada), SPH_C32(0x8804e19f) }, - { SPH_C32(0x427df000), SPH_C32(0x7723fe2e), SPH_C32(0xfca3d9e8), - SPH_C32(0x777e0786), SPH_C32(0x15a5d000), SPH_C32(0xa4e58284), - SPH_C32(0xc7451edd), SPH_C32(0x58f04efe) }, - { SPH_C32(0x8338c000), SPH_C32(0x29376d16), SPH_C32(0xa9c1e29c), - SPH_C32(0x25497190), SPH_C32(0x881ae000), SPH_C32(0x4a994806), - SPH_C32(0x5e4239a1), SPH_C32(0x7bdfc948) }, - { SPH_C32(0xf7add000), SPH_C32(0x731c2b68), SPH_C32(0x213cffb7), - SPH_C32(0x3baff302), SPH_C32(0x43b3e000), SPH_C32(0xdabe7f6f), - SPH_C32(0xe59ecda6), SPH_C32(0xab2b6629) }, - { SPH_C32(0x4891c000), SPH_C32(0xb9105a7f), SPH_C32(0x121d169b), - SPH_C32(0xf5bddef1), SPH_C32(0x3726f000), SPH_C32(0x80953911), - SPH_C32(0x6d63d08d), SPH_C32(0xb5cde4bb) }, - { SPH_C32(0x3c04d000), SPH_C32(0xe33b1c01), SPH_C32(0x9ae00bb0), - SPH_C32(0xeb5b5c63), SPH_C32(0xfc8ff000), SPH_C32(0x10b20e78), - SPH_C32(0xd6bf248a), SPH_C32(0x65394bda) }, - { SPH_C32(0x6a12e000), SPH_C32(0x9d60e1ea), SPH_C32(0xb83bd8cb), - SPH_C32(0x188074b4), SPH_C32(0x1f49e000), SPH_C32(0x6ad626d5), - SPH_C32(0x29fbd1ae), SPH_C32(0xda339789) }, - { SPH_C32(0x1e87f000), SPH_C32(0xc74ba794), SPH_C32(0x30c6c5e0), - SPH_C32(0x0666f626), SPH_C32(0xd4e0e000), SPH_C32(0xfaf111bc), - SPH_C32(0x922725a9), SPH_C32(0x0ac738e8) }, - { SPH_C32(0xa1bbe000), SPH_C32(0x0d47d683), SPH_C32(0x03e72ccc), - SPH_C32(0xc874dbd5), SPH_C32(0xa075f000), SPH_C32(0xa0da57c2), - SPH_C32(0x1ada3882), SPH_C32(0x1421ba7a) }, - { SPH_C32(0xd52ef000), SPH_C32(0x576c90fd), SPH_C32(0x8b1a31e7), - SPH_C32(0xd6925947), SPH_C32(0x6bdcf000), SPH_C32(0x30fd60ab), - SPH_C32(0xa106cc85), SPH_C32(0xc4d5151b) } -}; - -static const sph_u32 T256_8[256][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xb7a40100), SPH_C32(0x8a1f31d8), SPH_C32(0x8589d8ab), - SPH_C32(0xe6c46464), SPH_C32(0x734c0000), SPH_C32(0x956fa7d6), - SPH_C32(0xa29d1297), SPH_C32(0x6ee56854) }, - { SPH_C32(0x734c0000), SPH_C32(0x956fa7d6), SPH_C32(0xa29d1297), - SPH_C32(0x6ee56854), SPH_C32(0xc4e80100), SPH_C32(0x1f70960e), - SPH_C32(0x2714ca3c), SPH_C32(0x88210c30) }, - { SPH_C32(0xc4e80100), SPH_C32(0x1f70960e), SPH_C32(0x2714ca3c), - SPH_C32(0x88210c30), SPH_C32(0xb7a40100), SPH_C32(0x8a1f31d8), - SPH_C32(0x8589d8ab), SPH_C32(0xe6c46464) }, - { SPH_C32(0xa7b80200), SPH_C32(0x1f128433), SPH_C32(0x60e5f9f2), - SPH_C32(0x9e147576), SPH_C32(0xee260000), SPH_C32(0x124b683e), - SPH_C32(0x80c2d68f), SPH_C32(0x3bf3ab2c) }, - { SPH_C32(0x101c0300), SPH_C32(0x950db5eb), SPH_C32(0xe56c2159), - SPH_C32(0x78d01112), SPH_C32(0x9d6a0000), SPH_C32(0x8724cfe8), - SPH_C32(0x225fc418), SPH_C32(0x5516c378) }, - { SPH_C32(0xd4f40200), SPH_C32(0x8a7d23e5), SPH_C32(0xc278eb65), - SPH_C32(0xf0f11d22), SPH_C32(0x2ace0100), SPH_C32(0x0d3bfe30), - SPH_C32(0xa7d61cb3), SPH_C32(0xb3d2a71c) }, - { SPH_C32(0x63500300), SPH_C32(0x0062123d), SPH_C32(0x47f133ce), - SPH_C32(0x16357946), SPH_C32(0x59820100), SPH_C32(0x985459e6), - SPH_C32(0x054b0e24), SPH_C32(0xdd37cf48) }, - { SPH_C32(0xee260000), SPH_C32(0x124b683e), SPH_C32(0x80c2d68f), - SPH_C32(0x3bf3ab2c), SPH_C32(0x499e0200), SPH_C32(0x0d59ec0d), - SPH_C32(0xe0272f7d), SPH_C32(0xa5e7de5a) }, - { SPH_C32(0x59820100), SPH_C32(0x985459e6), SPH_C32(0x054b0e24), - SPH_C32(0xdd37cf48), SPH_C32(0x3ad20200), SPH_C32(0x98364bdb), - SPH_C32(0x42ba3dea), SPH_C32(0xcb02b60e) }, - { SPH_C32(0x9d6a0000), SPH_C32(0x8724cfe8), SPH_C32(0x225fc418), - SPH_C32(0x5516c378), SPH_C32(0x8d760300), SPH_C32(0x12297a03), - SPH_C32(0xc733e541), SPH_C32(0x2dc6d26a) }, - { SPH_C32(0x2ace0100), SPH_C32(0x0d3bfe30), SPH_C32(0xa7d61cb3), - SPH_C32(0xb3d2a71c), SPH_C32(0xfe3a0300), SPH_C32(0x8746ddd5), - SPH_C32(0x65aef7d6), SPH_C32(0x4323ba3e) }, - { SPH_C32(0x499e0200), SPH_C32(0x0d59ec0d), SPH_C32(0xe0272f7d), - SPH_C32(0xa5e7de5a), SPH_C32(0xa7b80200), SPH_C32(0x1f128433), - SPH_C32(0x60e5f9f2), SPH_C32(0x9e147576) }, - { SPH_C32(0xfe3a0300), SPH_C32(0x8746ddd5), SPH_C32(0x65aef7d6), - SPH_C32(0x4323ba3e), SPH_C32(0xd4f40200), SPH_C32(0x8a7d23e5), - SPH_C32(0xc278eb65), SPH_C32(0xf0f11d22) }, - { SPH_C32(0x3ad20200), SPH_C32(0x98364bdb), SPH_C32(0x42ba3dea), - SPH_C32(0xcb02b60e), SPH_C32(0x63500300), SPH_C32(0x0062123d), - SPH_C32(0x47f133ce), SPH_C32(0x16357946) }, - { SPH_C32(0x8d760300), SPH_C32(0x12297a03), SPH_C32(0xc733e541), - SPH_C32(0x2dc6d26a), SPH_C32(0x101c0300), SPH_C32(0x950db5eb), - SPH_C32(0xe56c2159), SPH_C32(0x78d01112) }, - { SPH_C32(0x8f3e0400), SPH_C32(0x0d9dc877), SPH_C32(0x6fc548e1), - SPH_C32(0x898d2cd6), SPH_C32(0x14bd0000), SPH_C32(0x2fba37ff), - SPH_C32(0x6a72e5bb), SPH_C32(0x247febe6) }, - { SPH_C32(0x389a0500), SPH_C32(0x8782f9af), SPH_C32(0xea4c904a), - SPH_C32(0x6f4948b2), SPH_C32(0x67f10000), SPH_C32(0xbad59029), - SPH_C32(0xc8eff72c), SPH_C32(0x4a9a83b2) }, - { SPH_C32(0xfc720400), SPH_C32(0x98f26fa1), SPH_C32(0xcd585a76), - SPH_C32(0xe7684482), SPH_C32(0xd0550100), SPH_C32(0x30caa1f1), - SPH_C32(0x4d662f87), SPH_C32(0xac5ee7d6) }, - { SPH_C32(0x4bd60500), SPH_C32(0x12ed5e79), SPH_C32(0x48d182dd), - SPH_C32(0x01ac20e6), SPH_C32(0xa3190100), SPH_C32(0xa5a50627), - SPH_C32(0xeffb3d10), SPH_C32(0xc2bb8f82) }, - { SPH_C32(0x28860600), SPH_C32(0x128f4c44), SPH_C32(0x0f20b113), - SPH_C32(0x179959a0), SPH_C32(0xfa9b0000), SPH_C32(0x3df15fc1), - SPH_C32(0xeab03334), SPH_C32(0x1f8c40ca) }, - { SPH_C32(0x9f220700), SPH_C32(0x98907d9c), SPH_C32(0x8aa969b8), - SPH_C32(0xf15d3dc4), SPH_C32(0x89d70000), SPH_C32(0xa89ef817), - SPH_C32(0x482d21a3), SPH_C32(0x7169289e) }, - { SPH_C32(0x5bca0600), SPH_C32(0x87e0eb92), SPH_C32(0xadbda384), - SPH_C32(0x797c31f4), SPH_C32(0x3e730100), SPH_C32(0x2281c9cf), - SPH_C32(0xcda4f908), SPH_C32(0x97ad4cfa) }, - { SPH_C32(0xec6e0700), SPH_C32(0x0dffda4a), SPH_C32(0x28347b2f), - SPH_C32(0x9fb85590), SPH_C32(0x4d3f0100), SPH_C32(0xb7ee6e19), - SPH_C32(0x6f39eb9f), SPH_C32(0xf94824ae) }, - { SPH_C32(0x61180400), SPH_C32(0x1fd6a049), SPH_C32(0xef079e6e), - SPH_C32(0xb27e87fa), SPH_C32(0x5d230200), SPH_C32(0x22e3dbf2), - SPH_C32(0x8a55cac6), SPH_C32(0x819835bc) }, - { SPH_C32(0xd6bc0500), SPH_C32(0x95c99191), SPH_C32(0x6a8e46c5), - SPH_C32(0x54bae39e), SPH_C32(0x2e6f0200), SPH_C32(0xb78c7c24), - SPH_C32(0x28c8d851), SPH_C32(0xef7d5de8) }, - { SPH_C32(0x12540400), SPH_C32(0x8ab9079f), SPH_C32(0x4d9a8cf9), - SPH_C32(0xdc9befae), SPH_C32(0x99cb0300), SPH_C32(0x3d934dfc), - SPH_C32(0xad4100fa), SPH_C32(0x09b9398c) }, - { SPH_C32(0xa5f00500), SPH_C32(0x00a63647), SPH_C32(0xc8135452), - SPH_C32(0x3a5f8bca), SPH_C32(0xea870300), SPH_C32(0xa8fcea2a), - SPH_C32(0x0fdc126d), SPH_C32(0x675c51d8) }, - { SPH_C32(0xc6a00600), SPH_C32(0x00c4247a), SPH_C32(0x8fe2679c), - SPH_C32(0x2c6af28c), SPH_C32(0xb3050200), SPH_C32(0x30a8b3cc), - SPH_C32(0x0a971c49), SPH_C32(0xba6b9e90) }, - { SPH_C32(0x71040700), SPH_C32(0x8adb15a2), SPH_C32(0x0a6bbf37), - SPH_C32(0xcaae96e8), SPH_C32(0xc0490200), SPH_C32(0xa5c7141a), - SPH_C32(0xa80a0ede), SPH_C32(0xd48ef6c4) }, - { SPH_C32(0xb5ec0600), SPH_C32(0x95ab83ac), SPH_C32(0x2d7f750b), - SPH_C32(0x428f9ad8), SPH_C32(0x77ed0300), SPH_C32(0x2fd825c2), - SPH_C32(0x2d83d675), SPH_C32(0x324a92a0) }, - { SPH_C32(0x02480700), SPH_C32(0x1fb4b274), SPH_C32(0xa8f6ada0), - SPH_C32(0xa44bfebc), SPH_C32(0x04a10300), SPH_C32(0xbab78214), - SPH_C32(0x8f1ec4e2), SPH_C32(0x5caffaf4) }, - { SPH_C32(0x14bd0000), SPH_C32(0x2fba37ff), SPH_C32(0x6a72e5bb), - SPH_C32(0x247febe6), SPH_C32(0x9b830400), SPH_C32(0x2227ff88), - SPH_C32(0x05b7ad5a), SPH_C32(0xadf2c730) }, - { SPH_C32(0xa3190100), SPH_C32(0xa5a50627), SPH_C32(0xeffb3d10), - SPH_C32(0xc2bb8f82), SPH_C32(0xe8cf0400), SPH_C32(0xb748585e), - SPH_C32(0xa72abfcd), SPH_C32(0xc317af64) }, - { SPH_C32(0x67f10000), SPH_C32(0xbad59029), SPH_C32(0xc8eff72c), - SPH_C32(0x4a9a83b2), SPH_C32(0x5f6b0500), SPH_C32(0x3d576986), - SPH_C32(0x22a36766), SPH_C32(0x25d3cb00) }, - { SPH_C32(0xd0550100), SPH_C32(0x30caa1f1), SPH_C32(0x4d662f87), - SPH_C32(0xac5ee7d6), SPH_C32(0x2c270500), SPH_C32(0xa838ce50), - SPH_C32(0x803e75f1), SPH_C32(0x4b36a354) }, - { SPH_C32(0xb3050200), SPH_C32(0x30a8b3cc), SPH_C32(0x0a971c49), - SPH_C32(0xba6b9e90), SPH_C32(0x75a50400), SPH_C32(0x306c97b6), - SPH_C32(0x85757bd5), SPH_C32(0x96016c1c) }, - { SPH_C32(0x04a10300), SPH_C32(0xbab78214), SPH_C32(0x8f1ec4e2), - SPH_C32(0x5caffaf4), SPH_C32(0x06e90400), SPH_C32(0xa5033060), - SPH_C32(0x27e86942), SPH_C32(0xf8e40448) }, - { SPH_C32(0xc0490200), SPH_C32(0xa5c7141a), SPH_C32(0xa80a0ede), - SPH_C32(0xd48ef6c4), SPH_C32(0xb14d0500), SPH_C32(0x2f1c01b8), - SPH_C32(0xa261b1e9), SPH_C32(0x1e20602c) }, - { SPH_C32(0x77ed0300), SPH_C32(0x2fd825c2), SPH_C32(0x2d83d675), - SPH_C32(0x324a92a0), SPH_C32(0xc2010500), SPH_C32(0xba73a66e), - SPH_C32(0x00fca37e), SPH_C32(0x70c50878) }, - { SPH_C32(0xfa9b0000), SPH_C32(0x3df15fc1), SPH_C32(0xeab03334), - SPH_C32(0x1f8c40ca), SPH_C32(0xd21d0600), SPH_C32(0x2f7e1385), - SPH_C32(0xe5908227), SPH_C32(0x0815196a) }, - { SPH_C32(0x4d3f0100), SPH_C32(0xb7ee6e19), SPH_C32(0x6f39eb9f), - SPH_C32(0xf94824ae), SPH_C32(0xa1510600), SPH_C32(0xba11b453), - SPH_C32(0x470d90b0), SPH_C32(0x66f0713e) }, - { SPH_C32(0x89d70000), SPH_C32(0xa89ef817), SPH_C32(0x482d21a3), - SPH_C32(0x7169289e), SPH_C32(0x16f50700), SPH_C32(0x300e858b), - SPH_C32(0xc284481b), SPH_C32(0x8034155a) }, - { SPH_C32(0x3e730100), SPH_C32(0x2281c9cf), SPH_C32(0xcda4f908), - SPH_C32(0x97ad4cfa), SPH_C32(0x65b90700), SPH_C32(0xa561225d), - SPH_C32(0x60195a8c), SPH_C32(0xeed17d0e) }, - { SPH_C32(0x5d230200), SPH_C32(0x22e3dbf2), SPH_C32(0x8a55cac6), - SPH_C32(0x819835bc), SPH_C32(0x3c3b0600), SPH_C32(0x3d357bbb), - SPH_C32(0x655254a8), SPH_C32(0x33e6b246) }, - { SPH_C32(0xea870300), SPH_C32(0xa8fcea2a), SPH_C32(0x0fdc126d), - SPH_C32(0x675c51d8), SPH_C32(0x4f770600), SPH_C32(0xa85adc6d), - SPH_C32(0xc7cf463f), SPH_C32(0x5d03da12) }, - { SPH_C32(0x2e6f0200), SPH_C32(0xb78c7c24), SPH_C32(0x28c8d851), - SPH_C32(0xef7d5de8), SPH_C32(0xf8d30700), SPH_C32(0x2245edb5), - SPH_C32(0x42469e94), SPH_C32(0xbbc7be76) }, - { SPH_C32(0x99cb0300), SPH_C32(0x3d934dfc), SPH_C32(0xad4100fa), - SPH_C32(0x09b9398c), SPH_C32(0x8b9f0700), SPH_C32(0xb72a4a63), - SPH_C32(0xe0db8c03), SPH_C32(0xd522d622) }, - { SPH_C32(0x9b830400), SPH_C32(0x2227ff88), SPH_C32(0x05b7ad5a), - SPH_C32(0xadf2c730), SPH_C32(0x8f3e0400), SPH_C32(0x0d9dc877), - SPH_C32(0x6fc548e1), SPH_C32(0x898d2cd6) }, - { SPH_C32(0x2c270500), SPH_C32(0xa838ce50), SPH_C32(0x803e75f1), - SPH_C32(0x4b36a354), SPH_C32(0xfc720400), SPH_C32(0x98f26fa1), - SPH_C32(0xcd585a76), SPH_C32(0xe7684482) }, - { SPH_C32(0xe8cf0400), SPH_C32(0xb748585e), SPH_C32(0xa72abfcd), - SPH_C32(0xc317af64), SPH_C32(0x4bd60500), SPH_C32(0x12ed5e79), - SPH_C32(0x48d182dd), SPH_C32(0x01ac20e6) }, - { SPH_C32(0x5f6b0500), SPH_C32(0x3d576986), SPH_C32(0x22a36766), - SPH_C32(0x25d3cb00), SPH_C32(0x389a0500), SPH_C32(0x8782f9af), - SPH_C32(0xea4c904a), SPH_C32(0x6f4948b2) }, - { SPH_C32(0x3c3b0600), SPH_C32(0x3d357bbb), SPH_C32(0x655254a8), - SPH_C32(0x33e6b246), SPH_C32(0x61180400), SPH_C32(0x1fd6a049), - SPH_C32(0xef079e6e), SPH_C32(0xb27e87fa) }, - { SPH_C32(0x8b9f0700), SPH_C32(0xb72a4a63), SPH_C32(0xe0db8c03), - SPH_C32(0xd522d622), SPH_C32(0x12540400), SPH_C32(0x8ab9079f), - SPH_C32(0x4d9a8cf9), SPH_C32(0xdc9befae) }, - { SPH_C32(0x4f770600), SPH_C32(0xa85adc6d), SPH_C32(0xc7cf463f), - SPH_C32(0x5d03da12), SPH_C32(0xa5f00500), SPH_C32(0x00a63647), - SPH_C32(0xc8135452), SPH_C32(0x3a5f8bca) }, - { SPH_C32(0xf8d30700), SPH_C32(0x2245edb5), SPH_C32(0x42469e94), - SPH_C32(0xbbc7be76), SPH_C32(0xd6bc0500), SPH_C32(0x95c99191), - SPH_C32(0x6a8e46c5), SPH_C32(0x54bae39e) }, - { SPH_C32(0x75a50400), SPH_C32(0x306c97b6), SPH_C32(0x85757bd5), - SPH_C32(0x96016c1c), SPH_C32(0xc6a00600), SPH_C32(0x00c4247a), - SPH_C32(0x8fe2679c), SPH_C32(0x2c6af28c) }, - { SPH_C32(0xc2010500), SPH_C32(0xba73a66e), SPH_C32(0x00fca37e), - SPH_C32(0x70c50878), SPH_C32(0xb5ec0600), SPH_C32(0x95ab83ac), - SPH_C32(0x2d7f750b), SPH_C32(0x428f9ad8) }, - { SPH_C32(0x06e90400), SPH_C32(0xa5033060), SPH_C32(0x27e86942), - SPH_C32(0xf8e40448), SPH_C32(0x02480700), SPH_C32(0x1fb4b274), - SPH_C32(0xa8f6ada0), SPH_C32(0xa44bfebc) }, - { SPH_C32(0xb14d0500), SPH_C32(0x2f1c01b8), SPH_C32(0xa261b1e9), - SPH_C32(0x1e20602c), SPH_C32(0x71040700), SPH_C32(0x8adb15a2), - SPH_C32(0x0a6bbf37), SPH_C32(0xcaae96e8) }, - { SPH_C32(0xd21d0600), SPH_C32(0x2f7e1385), SPH_C32(0xe5908227), - SPH_C32(0x0815196a), SPH_C32(0x28860600), SPH_C32(0x128f4c44), - SPH_C32(0x0f20b113), SPH_C32(0x179959a0) }, - { SPH_C32(0x65b90700), SPH_C32(0xa561225d), SPH_C32(0x60195a8c), - SPH_C32(0xeed17d0e), SPH_C32(0x5bca0600), SPH_C32(0x87e0eb92), - SPH_C32(0xadbda384), SPH_C32(0x797c31f4) }, - { SPH_C32(0xa1510600), SPH_C32(0xba11b453), SPH_C32(0x470d90b0), - SPH_C32(0x66f0713e), SPH_C32(0xec6e0700), SPH_C32(0x0dffda4a), - SPH_C32(0x28347b2f), SPH_C32(0x9fb85590) }, - { SPH_C32(0x16f50700), SPH_C32(0x300e858b), SPH_C32(0xc284481b), - SPH_C32(0x8034155a), SPH_C32(0x9f220700), SPH_C32(0x98907d9c), - SPH_C32(0x8aa969b8), SPH_C32(0xf15d3dc4) }, - { SPH_C32(0xde320800), SPH_C32(0x288350fe), SPH_C32(0x71852ac7), - SPH_C32(0xa6bf9f96), SPH_C32(0xe18b0000), SPH_C32(0x5459887d), - SPH_C32(0xbf1283d3), SPH_C32(0x1b666a73) }, - { SPH_C32(0x69960900), SPH_C32(0xa29c6126), SPH_C32(0xf40cf26c), - SPH_C32(0x407bfbf2), SPH_C32(0x92c70000), SPH_C32(0xc1362fab), - SPH_C32(0x1d8f9144), SPH_C32(0x75830227) }, - { SPH_C32(0xad7e0800), SPH_C32(0xbdecf728), SPH_C32(0xd3183850), - SPH_C32(0xc85af7c2), SPH_C32(0x25630100), SPH_C32(0x4b291e73), - SPH_C32(0x980649ef), SPH_C32(0x93476643) }, - { SPH_C32(0x1ada0900), SPH_C32(0x37f3c6f0), SPH_C32(0x5691e0fb), - SPH_C32(0x2e9e93a6), SPH_C32(0x562f0100), SPH_C32(0xde46b9a5), - SPH_C32(0x3a9b5b78), SPH_C32(0xfda20e17) }, - { SPH_C32(0x798a0a00), SPH_C32(0x3791d4cd), SPH_C32(0x1160d335), - SPH_C32(0x38abeae0), SPH_C32(0x0fad0000), SPH_C32(0x4612e043), - SPH_C32(0x3fd0555c), SPH_C32(0x2095c15f) }, - { SPH_C32(0xce2e0b00), SPH_C32(0xbd8ee515), SPH_C32(0x94e90b9e), - SPH_C32(0xde6f8e84), SPH_C32(0x7ce10000), SPH_C32(0xd37d4795), - SPH_C32(0x9d4d47cb), SPH_C32(0x4e70a90b) }, - { SPH_C32(0x0ac60a00), SPH_C32(0xa2fe731b), SPH_C32(0xb3fdc1a2), - SPH_C32(0x564e82b4), SPH_C32(0xcb450100), SPH_C32(0x5962764d), - SPH_C32(0x18c49f60), SPH_C32(0xa8b4cd6f) }, - { SPH_C32(0xbd620b00), SPH_C32(0x28e142c3), SPH_C32(0x36741909), - SPH_C32(0xb08ae6d0), SPH_C32(0xb8090100), SPH_C32(0xcc0dd19b), - SPH_C32(0xba598df7), SPH_C32(0xc651a53b) }, - { SPH_C32(0x30140800), SPH_C32(0x3ac838c0), SPH_C32(0xf147fc48), - SPH_C32(0x9d4c34ba), SPH_C32(0xa8150200), SPH_C32(0x59006470), - SPH_C32(0x5f35acae), SPH_C32(0xbe81b429) }, - { SPH_C32(0x87b00900), SPH_C32(0xb0d70918), SPH_C32(0x74ce24e3), - SPH_C32(0x7b8850de), SPH_C32(0xdb590200), SPH_C32(0xcc6fc3a6), - SPH_C32(0xfda8be39), SPH_C32(0xd064dc7d) }, - { SPH_C32(0x43580800), SPH_C32(0xafa79f16), SPH_C32(0x53daeedf), - SPH_C32(0xf3a95cee), SPH_C32(0x6cfd0300), SPH_C32(0x4670f27e), - SPH_C32(0x78216692), SPH_C32(0x36a0b819) }, - { SPH_C32(0xf4fc0900), SPH_C32(0x25b8aece), SPH_C32(0xd6533674), - SPH_C32(0x156d388a), SPH_C32(0x1fb10300), SPH_C32(0xd31f55a8), - SPH_C32(0xdabc7405), SPH_C32(0x5845d04d) }, - { SPH_C32(0x97ac0a00), SPH_C32(0x25dabcf3), SPH_C32(0x91a205ba), - SPH_C32(0x035841cc), SPH_C32(0x46330200), SPH_C32(0x4b4b0c4e), - SPH_C32(0xdff77a21), SPH_C32(0x85721f05) }, - { SPH_C32(0x20080b00), SPH_C32(0xafc58d2b), SPH_C32(0x142bdd11), - SPH_C32(0xe59c25a8), SPH_C32(0x357f0200), SPH_C32(0xde24ab98), - SPH_C32(0x7d6a68b6), SPH_C32(0xeb977751) }, - { SPH_C32(0xe4e00a00), SPH_C32(0xb0b51b25), SPH_C32(0x333f172d), - SPH_C32(0x6dbd2998), SPH_C32(0x82db0300), SPH_C32(0x543b9a40), - SPH_C32(0xf8e3b01d), SPH_C32(0x0d531335) }, - { SPH_C32(0x53440b00), SPH_C32(0x3aaa2afd), SPH_C32(0xb6b6cf86), - SPH_C32(0x8b794dfc), SPH_C32(0xf1970300), SPH_C32(0xc1543d96), - SPH_C32(0x5a7ea28a), SPH_C32(0x63b67b61) }, - { SPH_C32(0x510c0c00), SPH_C32(0x251e9889), SPH_C32(0x1e406226), - SPH_C32(0x2f32b340), SPH_C32(0xf5360000), SPH_C32(0x7be3bf82), - SPH_C32(0xd5606668), SPH_C32(0x3f198195) }, - { SPH_C32(0xe6a80d00), SPH_C32(0xaf01a951), SPH_C32(0x9bc9ba8d), - SPH_C32(0xc9f6d724), SPH_C32(0x867a0000), SPH_C32(0xee8c1854), - SPH_C32(0x77fd74ff), SPH_C32(0x51fce9c1) }, - { SPH_C32(0x22400c00), SPH_C32(0xb0713f5f), SPH_C32(0xbcdd70b1), - SPH_C32(0x41d7db14), SPH_C32(0x31de0100), SPH_C32(0x6493298c), - SPH_C32(0xf274ac54), SPH_C32(0xb7388da5) }, - { SPH_C32(0x95e40d00), SPH_C32(0x3a6e0e87), SPH_C32(0x3954a81a), - SPH_C32(0xa713bf70), SPH_C32(0x42920100), SPH_C32(0xf1fc8e5a), - SPH_C32(0x50e9bec3), SPH_C32(0xd9dde5f1) }, - { SPH_C32(0xf6b40e00), SPH_C32(0x3a0c1cba), SPH_C32(0x7ea59bd4), - SPH_C32(0xb126c636), SPH_C32(0x1b100000), SPH_C32(0x69a8d7bc), - SPH_C32(0x55a2b0e7), SPH_C32(0x04ea2ab9) }, - { SPH_C32(0x41100f00), SPH_C32(0xb0132d62), SPH_C32(0xfb2c437f), - SPH_C32(0x57e2a252), SPH_C32(0x685c0000), SPH_C32(0xfcc7706a), - SPH_C32(0xf73fa270), SPH_C32(0x6a0f42ed) }, - { SPH_C32(0x85f80e00), SPH_C32(0xaf63bb6c), SPH_C32(0xdc388943), - SPH_C32(0xdfc3ae62), SPH_C32(0xdff80100), SPH_C32(0x76d841b2), - SPH_C32(0x72b67adb), SPH_C32(0x8ccb2689) }, - { SPH_C32(0x325c0f00), SPH_C32(0x257c8ab4), SPH_C32(0x59b151e8), - SPH_C32(0x3907ca06), SPH_C32(0xacb40100), SPH_C32(0xe3b7e664), - SPH_C32(0xd02b684c), SPH_C32(0xe22e4edd) }, - { SPH_C32(0xbf2a0c00), SPH_C32(0x3755f0b7), SPH_C32(0x9e82b4a9), - SPH_C32(0x14c1186c), SPH_C32(0xbca80200), SPH_C32(0x76ba538f), - SPH_C32(0x35474915), SPH_C32(0x9afe5fcf) }, - { SPH_C32(0x088e0d00), SPH_C32(0xbd4ac16f), SPH_C32(0x1b0b6c02), - SPH_C32(0xf2057c08), SPH_C32(0xcfe40200), SPH_C32(0xe3d5f459), - SPH_C32(0x97da5b82), SPH_C32(0xf41b379b) }, - { SPH_C32(0xcc660c00), SPH_C32(0xa23a5761), SPH_C32(0x3c1fa63e), - SPH_C32(0x7a247038), SPH_C32(0x78400300), SPH_C32(0x69cac581), - SPH_C32(0x12538329), SPH_C32(0x12df53ff) }, - { SPH_C32(0x7bc20d00), SPH_C32(0x282566b9), SPH_C32(0xb9967e95), - SPH_C32(0x9ce0145c), SPH_C32(0x0b0c0300), SPH_C32(0xfca56257), - SPH_C32(0xb0ce91be), SPH_C32(0x7c3a3bab) }, - { SPH_C32(0x18920e00), SPH_C32(0x28477484), SPH_C32(0xfe674d5b), - SPH_C32(0x8ad56d1a), SPH_C32(0x528e0200), SPH_C32(0x64f13bb1), - SPH_C32(0xb5859f9a), SPH_C32(0xa10df4e3) }, - { SPH_C32(0xaf360f00), SPH_C32(0xa258455c), SPH_C32(0x7bee95f0), - SPH_C32(0x6c11097e), SPH_C32(0x21c20200), SPH_C32(0xf19e9c67), - SPH_C32(0x17188d0d), SPH_C32(0xcfe89cb7) }, - { SPH_C32(0x6bde0e00), SPH_C32(0xbd28d352), SPH_C32(0x5cfa5fcc), - SPH_C32(0xe430054e), SPH_C32(0x96660300), SPH_C32(0x7b81adbf), - SPH_C32(0x929155a6), SPH_C32(0x292cf8d3) }, - { SPH_C32(0xdc7a0f00), SPH_C32(0x3737e28a), SPH_C32(0xd9738767), - SPH_C32(0x02f4612a), SPH_C32(0xe52a0300), SPH_C32(0xeeee0a69), - SPH_C32(0x300c4731), SPH_C32(0x47c99087) }, - { SPH_C32(0xca8f0800), SPH_C32(0x07396701), SPH_C32(0x1bf7cf7c), - SPH_C32(0x82c07470), SPH_C32(0x7a080400), SPH_C32(0x767e77f5), - SPH_C32(0xbaa52e89), SPH_C32(0xb694ad43) }, - { SPH_C32(0x7d2b0900), SPH_C32(0x8d2656d9), SPH_C32(0x9e7e17d7), - SPH_C32(0x64041014), SPH_C32(0x09440400), SPH_C32(0xe311d023), - SPH_C32(0x18383c1e), SPH_C32(0xd871c517) }, - { SPH_C32(0xb9c30800), SPH_C32(0x9256c0d7), SPH_C32(0xb96addeb), - SPH_C32(0xec251c24), SPH_C32(0xbee00500), SPH_C32(0x690ee1fb), - SPH_C32(0x9db1e4b5), SPH_C32(0x3eb5a173) }, - { SPH_C32(0x0e670900), SPH_C32(0x1849f10f), SPH_C32(0x3ce30540), - SPH_C32(0x0ae17840), SPH_C32(0xcdac0500), SPH_C32(0xfc61462d), - SPH_C32(0x3f2cf622), SPH_C32(0x5050c927) }, - { SPH_C32(0x6d370a00), SPH_C32(0x182be332), SPH_C32(0x7b12368e), - SPH_C32(0x1cd40106), SPH_C32(0x942e0400), SPH_C32(0x64351fcb), - SPH_C32(0x3a67f806), SPH_C32(0x8d67066f) }, - { SPH_C32(0xda930b00), SPH_C32(0x9234d2ea), SPH_C32(0xfe9bee25), - SPH_C32(0xfa106562), SPH_C32(0xe7620400), SPH_C32(0xf15ab81d), - SPH_C32(0x98faea91), SPH_C32(0xe3826e3b) }, - { SPH_C32(0x1e7b0a00), SPH_C32(0x8d4444e4), SPH_C32(0xd98f2419), - SPH_C32(0x72316952), SPH_C32(0x50c60500), SPH_C32(0x7b4589c5), - SPH_C32(0x1d73323a), SPH_C32(0x05460a5f) }, - { SPH_C32(0xa9df0b00), SPH_C32(0x075b753c), SPH_C32(0x5c06fcb2), - SPH_C32(0x94f50d36), SPH_C32(0x238a0500), SPH_C32(0xee2a2e13), - SPH_C32(0xbfee20ad), SPH_C32(0x6ba3620b) }, - { SPH_C32(0x24a90800), SPH_C32(0x15720f3f), SPH_C32(0x9b3519f3), - SPH_C32(0xb933df5c), SPH_C32(0x33960600), SPH_C32(0x7b279bf8), - SPH_C32(0x5a8201f4), SPH_C32(0x13737319) }, - { SPH_C32(0x930d0900), SPH_C32(0x9f6d3ee7), SPH_C32(0x1ebcc158), - SPH_C32(0x5ff7bb38), SPH_C32(0x40da0600), SPH_C32(0xee483c2e), - SPH_C32(0xf81f1363), SPH_C32(0x7d961b4d) }, - { SPH_C32(0x57e50800), SPH_C32(0x801da8e9), SPH_C32(0x39a80b64), - SPH_C32(0xd7d6b708), SPH_C32(0xf77e0700), SPH_C32(0x64570df6), - SPH_C32(0x7d96cbc8), SPH_C32(0x9b527f29) }, - { SPH_C32(0xe0410900), SPH_C32(0x0a029931), SPH_C32(0xbc21d3cf), - SPH_C32(0x3112d36c), SPH_C32(0x84320700), SPH_C32(0xf138aa20), - SPH_C32(0xdf0bd95f), SPH_C32(0xf5b7177d) }, - { SPH_C32(0x83110a00), SPH_C32(0x0a608b0c), SPH_C32(0xfbd0e001), - SPH_C32(0x2727aa2a), SPH_C32(0xddb00600), SPH_C32(0x696cf3c6), - SPH_C32(0xda40d77b), SPH_C32(0x2880d835) }, - { SPH_C32(0x34b50b00), SPH_C32(0x807fbad4), SPH_C32(0x7e5938aa), - SPH_C32(0xc1e3ce4e), SPH_C32(0xaefc0600), SPH_C32(0xfc035410), - SPH_C32(0x78ddc5ec), SPH_C32(0x4665b061) }, - { SPH_C32(0xf05d0a00), SPH_C32(0x9f0f2cda), SPH_C32(0x594df296), - SPH_C32(0x49c2c27e), SPH_C32(0x19580700), SPH_C32(0x761c65c8), - SPH_C32(0xfd541d47), SPH_C32(0xa0a1d405) }, - { SPH_C32(0x47f90b00), SPH_C32(0x15101d02), SPH_C32(0xdcc42a3d), - SPH_C32(0xaf06a61a), SPH_C32(0x6a140700), SPH_C32(0xe373c21e), - SPH_C32(0x5fc90fd0), SPH_C32(0xce44bc51) }, - { SPH_C32(0x45b10c00), SPH_C32(0x0aa4af76), SPH_C32(0x7432879d), - SPH_C32(0x0b4d58a6), SPH_C32(0x6eb50400), SPH_C32(0x59c4400a), - SPH_C32(0xd0d7cb32), SPH_C32(0x92eb46a5) }, - { SPH_C32(0xf2150d00), SPH_C32(0x80bb9eae), SPH_C32(0xf1bb5f36), - SPH_C32(0xed893cc2), SPH_C32(0x1df90400), SPH_C32(0xccabe7dc), - SPH_C32(0x724ad9a5), SPH_C32(0xfc0e2ef1) }, - { SPH_C32(0x36fd0c00), SPH_C32(0x9fcb08a0), SPH_C32(0xd6af950a), - SPH_C32(0x65a830f2), SPH_C32(0xaa5d0500), SPH_C32(0x46b4d604), - SPH_C32(0xf7c3010e), SPH_C32(0x1aca4a95) }, - { SPH_C32(0x81590d00), SPH_C32(0x15d43978), SPH_C32(0x53264da1), - SPH_C32(0x836c5496), SPH_C32(0xd9110500), SPH_C32(0xd3db71d2), - SPH_C32(0x555e1399), SPH_C32(0x742f22c1) }, - { SPH_C32(0xe2090e00), SPH_C32(0x15b62b45), SPH_C32(0x14d77e6f), - SPH_C32(0x95592dd0), SPH_C32(0x80930400), SPH_C32(0x4b8f2834), - SPH_C32(0x50151dbd), SPH_C32(0xa918ed89) }, - { SPH_C32(0x55ad0f00), SPH_C32(0x9fa91a9d), SPH_C32(0x915ea6c4), - SPH_C32(0x739d49b4), SPH_C32(0xf3df0400), SPH_C32(0xdee08fe2), - SPH_C32(0xf2880f2a), SPH_C32(0xc7fd85dd) }, - { SPH_C32(0x91450e00), SPH_C32(0x80d98c93), SPH_C32(0xb64a6cf8), - SPH_C32(0xfbbc4584), SPH_C32(0x447b0500), SPH_C32(0x54ffbe3a), - SPH_C32(0x7701d781), SPH_C32(0x2139e1b9) }, - { SPH_C32(0x26e10f00), SPH_C32(0x0ac6bd4b), SPH_C32(0x33c3b453), - SPH_C32(0x1d7821e0), SPH_C32(0x37370500), SPH_C32(0xc19019ec), - SPH_C32(0xd59cc516), SPH_C32(0x4fdc89ed) }, - { SPH_C32(0xab970c00), SPH_C32(0x18efc748), SPH_C32(0xf4f05112), - SPH_C32(0x30bef38a), SPH_C32(0x272b0600), SPH_C32(0x549dac07), - SPH_C32(0x30f0e44f), SPH_C32(0x370c98ff) }, - { SPH_C32(0x1c330d00), SPH_C32(0x92f0f690), SPH_C32(0x717989b9), - SPH_C32(0xd67a97ee), SPH_C32(0x54670600), SPH_C32(0xc1f20bd1), - SPH_C32(0x926df6d8), SPH_C32(0x59e9f0ab) }, - { SPH_C32(0xd8db0c00), SPH_C32(0x8d80609e), SPH_C32(0x566d4385), - SPH_C32(0x5e5b9bde), SPH_C32(0xe3c30700), SPH_C32(0x4bed3a09), - SPH_C32(0x17e42e73), SPH_C32(0xbf2d94cf) }, - { SPH_C32(0x6f7f0d00), SPH_C32(0x079f5146), SPH_C32(0xd3e49b2e), - SPH_C32(0xb89fffba), SPH_C32(0x908f0700), SPH_C32(0xde829ddf), - SPH_C32(0xb5793ce4), SPH_C32(0xd1c8fc9b) }, - { SPH_C32(0x0c2f0e00), SPH_C32(0x07fd437b), SPH_C32(0x9415a8e0), - SPH_C32(0xaeaa86fc), SPH_C32(0xc90d0600), SPH_C32(0x46d6c439), - SPH_C32(0xb03232c0), SPH_C32(0x0cff33d3) }, - { SPH_C32(0xbb8b0f00), SPH_C32(0x8de272a3), SPH_C32(0x119c704b), - SPH_C32(0x486ee298), SPH_C32(0xba410600), SPH_C32(0xd3b963ef), - SPH_C32(0x12af2057), SPH_C32(0x621a5b87) }, - { SPH_C32(0x7f630e00), SPH_C32(0x9292e4ad), SPH_C32(0x3688ba77), - SPH_C32(0xc04feea8), SPH_C32(0x0de50700), SPH_C32(0x59a65237), - SPH_C32(0x9726f8fc), SPH_C32(0x84de3fe3) }, - { SPH_C32(0xc8c70f00), SPH_C32(0x188dd575), SPH_C32(0xb30162dc), - SPH_C32(0x268b8acc), SPH_C32(0x7ea90700), SPH_C32(0xccc9f5e1), - SPH_C32(0x35bbea6b), SPH_C32(0xea3b57b7) }, - { SPH_C32(0xe18b0000), SPH_C32(0x5459887d), SPH_C32(0xbf1283d3), - SPH_C32(0x1b666a73), SPH_C32(0x3fb90800), SPH_C32(0x7cdad883), - SPH_C32(0xce97a914), SPH_C32(0xbdd9f5e5) }, - { SPH_C32(0x562f0100), SPH_C32(0xde46b9a5), SPH_C32(0x3a9b5b78), - SPH_C32(0xfda20e17), SPH_C32(0x4cf50800), SPH_C32(0xe9b57f55), - SPH_C32(0x6c0abb83), SPH_C32(0xd33c9db1) }, - { SPH_C32(0x92c70000), SPH_C32(0xc1362fab), SPH_C32(0x1d8f9144), - SPH_C32(0x75830227), SPH_C32(0xfb510900), SPH_C32(0x63aa4e8d), - SPH_C32(0xe9836328), SPH_C32(0x35f8f9d5) }, - { SPH_C32(0x25630100), SPH_C32(0x4b291e73), SPH_C32(0x980649ef), - SPH_C32(0x93476643), SPH_C32(0x881d0900), SPH_C32(0xf6c5e95b), - SPH_C32(0x4b1e71bf), SPH_C32(0x5b1d9181) }, - { SPH_C32(0x46330200), SPH_C32(0x4b4b0c4e), SPH_C32(0xdff77a21), - SPH_C32(0x85721f05), SPH_C32(0xd19f0800), SPH_C32(0x6e91b0bd), - SPH_C32(0x4e557f9b), SPH_C32(0x862a5ec9) }, - { SPH_C32(0xf1970300), SPH_C32(0xc1543d96), SPH_C32(0x5a7ea28a), - SPH_C32(0x63b67b61), SPH_C32(0xa2d30800), SPH_C32(0xfbfe176b), - SPH_C32(0xecc86d0c), SPH_C32(0xe8cf369d) }, - { SPH_C32(0x357f0200), SPH_C32(0xde24ab98), SPH_C32(0x7d6a68b6), - SPH_C32(0xeb977751), SPH_C32(0x15770900), SPH_C32(0x71e126b3), - SPH_C32(0x6941b5a7), SPH_C32(0x0e0b52f9) }, - { SPH_C32(0x82db0300), SPH_C32(0x543b9a40), SPH_C32(0xf8e3b01d), - SPH_C32(0x0d531335), SPH_C32(0x663b0900), SPH_C32(0xe48e8165), - SPH_C32(0xcbdca730), SPH_C32(0x60ee3aad) }, - { SPH_C32(0x0fad0000), SPH_C32(0x4612e043), SPH_C32(0x3fd0555c), - SPH_C32(0x2095c15f), SPH_C32(0x76270a00), SPH_C32(0x7183348e), - SPH_C32(0x2eb08669), SPH_C32(0x183e2bbf) }, - { SPH_C32(0xb8090100), SPH_C32(0xcc0dd19b), SPH_C32(0xba598df7), - SPH_C32(0xc651a53b), SPH_C32(0x056b0a00), SPH_C32(0xe4ec9358), - SPH_C32(0x8c2d94fe), SPH_C32(0x76db43eb) }, - { SPH_C32(0x7ce10000), SPH_C32(0xd37d4795), SPH_C32(0x9d4d47cb), - SPH_C32(0x4e70a90b), SPH_C32(0xb2cf0b00), SPH_C32(0x6ef3a280), - SPH_C32(0x09a44c55), SPH_C32(0x901f278f) }, - { SPH_C32(0xcb450100), SPH_C32(0x5962764d), SPH_C32(0x18c49f60), - SPH_C32(0xa8b4cd6f), SPH_C32(0xc1830b00), SPH_C32(0xfb9c0556), - SPH_C32(0xab395ec2), SPH_C32(0xfefa4fdb) }, - { SPH_C32(0xa8150200), SPH_C32(0x59006470), SPH_C32(0x5f35acae), - SPH_C32(0xbe81b429), SPH_C32(0x98010a00), SPH_C32(0x63c85cb0), - SPH_C32(0xae7250e6), SPH_C32(0x23cd8093) }, - { SPH_C32(0x1fb10300), SPH_C32(0xd31f55a8), SPH_C32(0xdabc7405), - SPH_C32(0x5845d04d), SPH_C32(0xeb4d0a00), SPH_C32(0xf6a7fb66), - SPH_C32(0x0cef4271), SPH_C32(0x4d28e8c7) }, - { SPH_C32(0xdb590200), SPH_C32(0xcc6fc3a6), SPH_C32(0xfda8be39), - SPH_C32(0xd064dc7d), SPH_C32(0x5ce90b00), SPH_C32(0x7cb8cabe), - SPH_C32(0x89669ada), SPH_C32(0xabec8ca3) }, - { SPH_C32(0x6cfd0300), SPH_C32(0x4670f27e), SPH_C32(0x78216692), - SPH_C32(0x36a0b819), SPH_C32(0x2fa50b00), SPH_C32(0xe9d76d68), - SPH_C32(0x2bfb884d), SPH_C32(0xc509e4f7) }, - { SPH_C32(0x6eb50400), SPH_C32(0x59c4400a), SPH_C32(0xd0d7cb32), - SPH_C32(0x92eb46a5), SPH_C32(0x2b040800), SPH_C32(0x5360ef7c), - SPH_C32(0xa4e54caf), SPH_C32(0x99a61e03) }, - { SPH_C32(0xd9110500), SPH_C32(0xd3db71d2), SPH_C32(0x555e1399), - SPH_C32(0x742f22c1), SPH_C32(0x58480800), SPH_C32(0xc60f48aa), - SPH_C32(0x06785e38), SPH_C32(0xf7437657) }, - { SPH_C32(0x1df90400), SPH_C32(0xccabe7dc), SPH_C32(0x724ad9a5), - SPH_C32(0xfc0e2ef1), SPH_C32(0xefec0900), SPH_C32(0x4c107972), - SPH_C32(0x83f18693), SPH_C32(0x11871233) }, - { SPH_C32(0xaa5d0500), SPH_C32(0x46b4d604), SPH_C32(0xf7c3010e), - SPH_C32(0x1aca4a95), SPH_C32(0x9ca00900), SPH_C32(0xd97fdea4), - SPH_C32(0x216c9404), SPH_C32(0x7f627a67) }, - { SPH_C32(0xc90d0600), SPH_C32(0x46d6c439), SPH_C32(0xb03232c0), - SPH_C32(0x0cff33d3), SPH_C32(0xc5220800), SPH_C32(0x412b8742), - SPH_C32(0x24279a20), SPH_C32(0xa255b52f) }, - { SPH_C32(0x7ea90700), SPH_C32(0xccc9f5e1), SPH_C32(0x35bbea6b), - SPH_C32(0xea3b57b7), SPH_C32(0xb66e0800), SPH_C32(0xd4442094), - SPH_C32(0x86ba88b7), SPH_C32(0xccb0dd7b) }, - { SPH_C32(0xba410600), SPH_C32(0xd3b963ef), SPH_C32(0x12af2057), - SPH_C32(0x621a5b87), SPH_C32(0x01ca0900), SPH_C32(0x5e5b114c), - SPH_C32(0x0333501c), SPH_C32(0x2a74b91f) }, - { SPH_C32(0x0de50700), SPH_C32(0x59a65237), SPH_C32(0x9726f8fc), - SPH_C32(0x84de3fe3), SPH_C32(0x72860900), SPH_C32(0xcb34b69a), - SPH_C32(0xa1ae428b), SPH_C32(0x4491d14b) }, - { SPH_C32(0x80930400), SPH_C32(0x4b8f2834), SPH_C32(0x50151dbd), - SPH_C32(0xa918ed89), SPH_C32(0x629a0a00), SPH_C32(0x5e390371), - SPH_C32(0x44c263d2), SPH_C32(0x3c41c059) }, - { SPH_C32(0x37370500), SPH_C32(0xc19019ec), SPH_C32(0xd59cc516), - SPH_C32(0x4fdc89ed), SPH_C32(0x11d60a00), SPH_C32(0xcb56a4a7), - SPH_C32(0xe65f7145), SPH_C32(0x52a4a80d) }, - { SPH_C32(0xf3df0400), SPH_C32(0xdee08fe2), SPH_C32(0xf2880f2a), - SPH_C32(0xc7fd85dd), SPH_C32(0xa6720b00), SPH_C32(0x4149957f), - SPH_C32(0x63d6a9ee), SPH_C32(0xb460cc69) }, - { SPH_C32(0x447b0500), SPH_C32(0x54ffbe3a), SPH_C32(0x7701d781), - SPH_C32(0x2139e1b9), SPH_C32(0xd53e0b00), SPH_C32(0xd42632a9), - SPH_C32(0xc14bbb79), SPH_C32(0xda85a43d) }, - { SPH_C32(0x272b0600), SPH_C32(0x549dac07), SPH_C32(0x30f0e44f), - SPH_C32(0x370c98ff), SPH_C32(0x8cbc0a00), SPH_C32(0x4c726b4f), - SPH_C32(0xc400b55d), SPH_C32(0x07b26b75) }, - { SPH_C32(0x908f0700), SPH_C32(0xde829ddf), SPH_C32(0xb5793ce4), - SPH_C32(0xd1c8fc9b), SPH_C32(0xfff00a00), SPH_C32(0xd91dcc99), - SPH_C32(0x669da7ca), SPH_C32(0x69570321) }, - { SPH_C32(0x54670600), SPH_C32(0xc1f20bd1), SPH_C32(0x926df6d8), - SPH_C32(0x59e9f0ab), SPH_C32(0x48540b00), SPH_C32(0x5302fd41), - SPH_C32(0xe3147f61), SPH_C32(0x8f936745) }, - { SPH_C32(0xe3c30700), SPH_C32(0x4bed3a09), SPH_C32(0x17e42e73), - SPH_C32(0xbf2d94cf), SPH_C32(0x3b180b00), SPH_C32(0xc66d5a97), - SPH_C32(0x41896df6), SPH_C32(0xe1760f11) }, - { SPH_C32(0xf5360000), SPH_C32(0x7be3bf82), SPH_C32(0xd5606668), - SPH_C32(0x3f198195), SPH_C32(0xa43a0c00), SPH_C32(0x5efd270b), - SPH_C32(0xcb20044e), SPH_C32(0x102b32d5) }, - { SPH_C32(0x42920100), SPH_C32(0xf1fc8e5a), SPH_C32(0x50e9bec3), - SPH_C32(0xd9dde5f1), SPH_C32(0xd7760c00), SPH_C32(0xcb9280dd), - SPH_C32(0x69bd16d9), SPH_C32(0x7ece5a81) }, - { SPH_C32(0x867a0000), SPH_C32(0xee8c1854), SPH_C32(0x77fd74ff), - SPH_C32(0x51fce9c1), SPH_C32(0x60d20d00), SPH_C32(0x418db105), - SPH_C32(0xec34ce72), SPH_C32(0x980a3ee5) }, - { SPH_C32(0x31de0100), SPH_C32(0x6493298c), SPH_C32(0xf274ac54), - SPH_C32(0xb7388da5), SPH_C32(0x139e0d00), SPH_C32(0xd4e216d3), - SPH_C32(0x4ea9dce5), SPH_C32(0xf6ef56b1) }, - { SPH_C32(0x528e0200), SPH_C32(0x64f13bb1), SPH_C32(0xb5859f9a), - SPH_C32(0xa10df4e3), SPH_C32(0x4a1c0c00), SPH_C32(0x4cb64f35), - SPH_C32(0x4be2d2c1), SPH_C32(0x2bd899f9) }, - { SPH_C32(0xe52a0300), SPH_C32(0xeeee0a69), SPH_C32(0x300c4731), - SPH_C32(0x47c99087), SPH_C32(0x39500c00), SPH_C32(0xd9d9e8e3), - SPH_C32(0xe97fc056), SPH_C32(0x453df1ad) }, - { SPH_C32(0x21c20200), SPH_C32(0xf19e9c67), SPH_C32(0x17188d0d), - SPH_C32(0xcfe89cb7), SPH_C32(0x8ef40d00), SPH_C32(0x53c6d93b), - SPH_C32(0x6cf618fd), SPH_C32(0xa3f995c9) }, - { SPH_C32(0x96660300), SPH_C32(0x7b81adbf), SPH_C32(0x929155a6), - SPH_C32(0x292cf8d3), SPH_C32(0xfdb80d00), SPH_C32(0xc6a97eed), - SPH_C32(0xce6b0a6a), SPH_C32(0xcd1cfd9d) }, - { SPH_C32(0x1b100000), SPH_C32(0x69a8d7bc), SPH_C32(0x55a2b0e7), - SPH_C32(0x04ea2ab9), SPH_C32(0xeda40e00), SPH_C32(0x53a4cb06), - SPH_C32(0x2b072b33), SPH_C32(0xb5ccec8f) }, - { SPH_C32(0xacb40100), SPH_C32(0xe3b7e664), SPH_C32(0xd02b684c), - SPH_C32(0xe22e4edd), SPH_C32(0x9ee80e00), SPH_C32(0xc6cb6cd0), - SPH_C32(0x899a39a4), SPH_C32(0xdb2984db) }, - { SPH_C32(0x685c0000), SPH_C32(0xfcc7706a), SPH_C32(0xf73fa270), - SPH_C32(0x6a0f42ed), SPH_C32(0x294c0f00), SPH_C32(0x4cd45d08), - SPH_C32(0x0c13e10f), SPH_C32(0x3dede0bf) }, - { SPH_C32(0xdff80100), SPH_C32(0x76d841b2), SPH_C32(0x72b67adb), - SPH_C32(0x8ccb2689), SPH_C32(0x5a000f00), SPH_C32(0xd9bbfade), - SPH_C32(0xae8ef398), SPH_C32(0x530888eb) }, - { SPH_C32(0xbca80200), SPH_C32(0x76ba538f), SPH_C32(0x35474915), - SPH_C32(0x9afe5fcf), SPH_C32(0x03820e00), SPH_C32(0x41efa338), - SPH_C32(0xabc5fdbc), SPH_C32(0x8e3f47a3) }, - { SPH_C32(0x0b0c0300), SPH_C32(0xfca56257), SPH_C32(0xb0ce91be), - SPH_C32(0x7c3a3bab), SPH_C32(0x70ce0e00), SPH_C32(0xd48004ee), - SPH_C32(0x0958ef2b), SPH_C32(0xe0da2ff7) }, - { SPH_C32(0xcfe40200), SPH_C32(0xe3d5f459), SPH_C32(0x97da5b82), - SPH_C32(0xf41b379b), SPH_C32(0xc76a0f00), SPH_C32(0x5e9f3536), - SPH_C32(0x8cd13780), SPH_C32(0x061e4b93) }, - { SPH_C32(0x78400300), SPH_C32(0x69cac581), SPH_C32(0x12538329), - SPH_C32(0x12df53ff), SPH_C32(0xb4260f00), SPH_C32(0xcbf092e0), - SPH_C32(0x2e4c2517), SPH_C32(0x68fb23c7) }, - { SPH_C32(0x7a080400), SPH_C32(0x767e77f5), SPH_C32(0xbaa52e89), - SPH_C32(0xb694ad43), SPH_C32(0xb0870c00), SPH_C32(0x714710f4), - SPH_C32(0xa152e1f5), SPH_C32(0x3454d933) }, - { SPH_C32(0xcdac0500), SPH_C32(0xfc61462d), SPH_C32(0x3f2cf622), - SPH_C32(0x5050c927), SPH_C32(0xc3cb0c00), SPH_C32(0xe428b722), - SPH_C32(0x03cff362), SPH_C32(0x5ab1b167) }, - { SPH_C32(0x09440400), SPH_C32(0xe311d023), SPH_C32(0x18383c1e), - SPH_C32(0xd871c517), SPH_C32(0x746f0d00), SPH_C32(0x6e3786fa), - SPH_C32(0x86462bc9), SPH_C32(0xbc75d503) }, - { SPH_C32(0xbee00500), SPH_C32(0x690ee1fb), SPH_C32(0x9db1e4b5), - SPH_C32(0x3eb5a173), SPH_C32(0x07230d00), SPH_C32(0xfb58212c), - SPH_C32(0x24db395e), SPH_C32(0xd290bd57) }, - { SPH_C32(0xddb00600), SPH_C32(0x696cf3c6), SPH_C32(0xda40d77b), - SPH_C32(0x2880d835), SPH_C32(0x5ea10c00), SPH_C32(0x630c78ca), - SPH_C32(0x2190377a), SPH_C32(0x0fa7721f) }, - { SPH_C32(0x6a140700), SPH_C32(0xe373c21e), SPH_C32(0x5fc90fd0), - SPH_C32(0xce44bc51), SPH_C32(0x2ded0c00), SPH_C32(0xf663df1c), - SPH_C32(0x830d25ed), SPH_C32(0x61421a4b) }, - { SPH_C32(0xaefc0600), SPH_C32(0xfc035410), SPH_C32(0x78ddc5ec), - SPH_C32(0x4665b061), SPH_C32(0x9a490d00), SPH_C32(0x7c7ceec4), - SPH_C32(0x0684fd46), SPH_C32(0x87867e2f) }, - { SPH_C32(0x19580700), SPH_C32(0x761c65c8), SPH_C32(0xfd541d47), - SPH_C32(0xa0a1d405), SPH_C32(0xe9050d00), SPH_C32(0xe9134912), - SPH_C32(0xa419efd1), SPH_C32(0xe963167b) }, - { SPH_C32(0x942e0400), SPH_C32(0x64351fcb), SPH_C32(0x3a67f806), - SPH_C32(0x8d67066f), SPH_C32(0xf9190e00), SPH_C32(0x7c1efcf9), - SPH_C32(0x4175ce88), SPH_C32(0x91b30769) }, - { SPH_C32(0x238a0500), SPH_C32(0xee2a2e13), SPH_C32(0xbfee20ad), - SPH_C32(0x6ba3620b), SPH_C32(0x8a550e00), SPH_C32(0xe9715b2f), - SPH_C32(0xe3e8dc1f), SPH_C32(0xff566f3d) }, - { SPH_C32(0xe7620400), SPH_C32(0xf15ab81d), SPH_C32(0x98faea91), - SPH_C32(0xe3826e3b), SPH_C32(0x3df10f00), SPH_C32(0x636e6af7), - SPH_C32(0x666104b4), SPH_C32(0x19920b59) }, - { SPH_C32(0x50c60500), SPH_C32(0x7b4589c5), SPH_C32(0x1d73323a), - SPH_C32(0x05460a5f), SPH_C32(0x4ebd0f00), SPH_C32(0xf601cd21), - SPH_C32(0xc4fc1623), SPH_C32(0x7777630d) }, - { SPH_C32(0x33960600), SPH_C32(0x7b279bf8), SPH_C32(0x5a8201f4), - SPH_C32(0x13737319), SPH_C32(0x173f0e00), SPH_C32(0x6e5594c7), - SPH_C32(0xc1b71807), SPH_C32(0xaa40ac45) }, - { SPH_C32(0x84320700), SPH_C32(0xf138aa20), SPH_C32(0xdf0bd95f), - SPH_C32(0xf5b7177d), SPH_C32(0x64730e00), SPH_C32(0xfb3a3311), - SPH_C32(0x632a0a90), SPH_C32(0xc4a5c411) }, - { SPH_C32(0x40da0600), SPH_C32(0xee483c2e), SPH_C32(0xf81f1363), - SPH_C32(0x7d961b4d), SPH_C32(0xd3d70f00), SPH_C32(0x712502c9), - SPH_C32(0xe6a3d23b), SPH_C32(0x2261a075) }, - { SPH_C32(0xf77e0700), SPH_C32(0x64570df6), SPH_C32(0x7d96cbc8), - SPH_C32(0x9b527f29), SPH_C32(0xa09b0f00), SPH_C32(0xe44aa51f), - SPH_C32(0x443ec0ac), SPH_C32(0x4c84c821) }, - { SPH_C32(0x3fb90800), SPH_C32(0x7cdad883), SPH_C32(0xce97a914), - SPH_C32(0xbdd9f5e5), SPH_C32(0xde320800), SPH_C32(0x288350fe), - SPH_C32(0x71852ac7), SPH_C32(0xa6bf9f96) }, - { SPH_C32(0x881d0900), SPH_C32(0xf6c5e95b), SPH_C32(0x4b1e71bf), - SPH_C32(0x5b1d9181), SPH_C32(0xad7e0800), SPH_C32(0xbdecf728), - SPH_C32(0xd3183850), SPH_C32(0xc85af7c2) }, - { SPH_C32(0x4cf50800), SPH_C32(0xe9b57f55), SPH_C32(0x6c0abb83), - SPH_C32(0xd33c9db1), SPH_C32(0x1ada0900), SPH_C32(0x37f3c6f0), - SPH_C32(0x5691e0fb), SPH_C32(0x2e9e93a6) }, - { SPH_C32(0xfb510900), SPH_C32(0x63aa4e8d), SPH_C32(0xe9836328), - SPH_C32(0x35f8f9d5), SPH_C32(0x69960900), SPH_C32(0xa29c6126), - SPH_C32(0xf40cf26c), SPH_C32(0x407bfbf2) }, - { SPH_C32(0x98010a00), SPH_C32(0x63c85cb0), SPH_C32(0xae7250e6), - SPH_C32(0x23cd8093), SPH_C32(0x30140800), SPH_C32(0x3ac838c0), - SPH_C32(0xf147fc48), SPH_C32(0x9d4c34ba) }, - { SPH_C32(0x2fa50b00), SPH_C32(0xe9d76d68), SPH_C32(0x2bfb884d), - SPH_C32(0xc509e4f7), SPH_C32(0x43580800), SPH_C32(0xafa79f16), - SPH_C32(0x53daeedf), SPH_C32(0xf3a95cee) }, - { SPH_C32(0xeb4d0a00), SPH_C32(0xf6a7fb66), SPH_C32(0x0cef4271), - SPH_C32(0x4d28e8c7), SPH_C32(0xf4fc0900), SPH_C32(0x25b8aece), - SPH_C32(0xd6533674), SPH_C32(0x156d388a) }, - { SPH_C32(0x5ce90b00), SPH_C32(0x7cb8cabe), SPH_C32(0x89669ada), - SPH_C32(0xabec8ca3), SPH_C32(0x87b00900), SPH_C32(0xb0d70918), - SPH_C32(0x74ce24e3), SPH_C32(0x7b8850de) }, - { SPH_C32(0xd19f0800), SPH_C32(0x6e91b0bd), SPH_C32(0x4e557f9b), - SPH_C32(0x862a5ec9), SPH_C32(0x97ac0a00), SPH_C32(0x25dabcf3), - SPH_C32(0x91a205ba), SPH_C32(0x035841cc) }, - { SPH_C32(0x663b0900), SPH_C32(0xe48e8165), SPH_C32(0xcbdca730), - SPH_C32(0x60ee3aad), SPH_C32(0xe4e00a00), SPH_C32(0xb0b51b25), - SPH_C32(0x333f172d), SPH_C32(0x6dbd2998) }, - { SPH_C32(0xa2d30800), SPH_C32(0xfbfe176b), SPH_C32(0xecc86d0c), - SPH_C32(0xe8cf369d), SPH_C32(0x53440b00), SPH_C32(0x3aaa2afd), - SPH_C32(0xb6b6cf86), SPH_C32(0x8b794dfc) }, - { SPH_C32(0x15770900), SPH_C32(0x71e126b3), SPH_C32(0x6941b5a7), - SPH_C32(0x0e0b52f9), SPH_C32(0x20080b00), SPH_C32(0xafc58d2b), - SPH_C32(0x142bdd11), SPH_C32(0xe59c25a8) }, - { SPH_C32(0x76270a00), SPH_C32(0x7183348e), SPH_C32(0x2eb08669), - SPH_C32(0x183e2bbf), SPH_C32(0x798a0a00), SPH_C32(0x3791d4cd), - SPH_C32(0x1160d335), SPH_C32(0x38abeae0) }, - { SPH_C32(0xc1830b00), SPH_C32(0xfb9c0556), SPH_C32(0xab395ec2), - SPH_C32(0xfefa4fdb), SPH_C32(0x0ac60a00), SPH_C32(0xa2fe731b), - SPH_C32(0xb3fdc1a2), SPH_C32(0x564e82b4) }, - { SPH_C32(0x056b0a00), SPH_C32(0xe4ec9358), SPH_C32(0x8c2d94fe), - SPH_C32(0x76db43eb), SPH_C32(0xbd620b00), SPH_C32(0x28e142c3), - SPH_C32(0x36741909), SPH_C32(0xb08ae6d0) }, - { SPH_C32(0xb2cf0b00), SPH_C32(0x6ef3a280), SPH_C32(0x09a44c55), - SPH_C32(0x901f278f), SPH_C32(0xce2e0b00), SPH_C32(0xbd8ee515), - SPH_C32(0x94e90b9e), SPH_C32(0xde6f8e84) }, - { SPH_C32(0xb0870c00), SPH_C32(0x714710f4), SPH_C32(0xa152e1f5), - SPH_C32(0x3454d933), SPH_C32(0xca8f0800), SPH_C32(0x07396701), - SPH_C32(0x1bf7cf7c), SPH_C32(0x82c07470) }, - { SPH_C32(0x07230d00), SPH_C32(0xfb58212c), SPH_C32(0x24db395e), - SPH_C32(0xd290bd57), SPH_C32(0xb9c30800), SPH_C32(0x9256c0d7), - SPH_C32(0xb96addeb), SPH_C32(0xec251c24) }, - { SPH_C32(0xc3cb0c00), SPH_C32(0xe428b722), SPH_C32(0x03cff362), - SPH_C32(0x5ab1b167), SPH_C32(0x0e670900), SPH_C32(0x1849f10f), - SPH_C32(0x3ce30540), SPH_C32(0x0ae17840) }, - { SPH_C32(0x746f0d00), SPH_C32(0x6e3786fa), SPH_C32(0x86462bc9), - SPH_C32(0xbc75d503), SPH_C32(0x7d2b0900), SPH_C32(0x8d2656d9), - SPH_C32(0x9e7e17d7), SPH_C32(0x64041014) }, - { SPH_C32(0x173f0e00), SPH_C32(0x6e5594c7), SPH_C32(0xc1b71807), - SPH_C32(0xaa40ac45), SPH_C32(0x24a90800), SPH_C32(0x15720f3f), - SPH_C32(0x9b3519f3), SPH_C32(0xb933df5c) }, - { SPH_C32(0xa09b0f00), SPH_C32(0xe44aa51f), SPH_C32(0x443ec0ac), - SPH_C32(0x4c84c821), SPH_C32(0x57e50800), SPH_C32(0x801da8e9), - SPH_C32(0x39a80b64), SPH_C32(0xd7d6b708) }, - { SPH_C32(0x64730e00), SPH_C32(0xfb3a3311), SPH_C32(0x632a0a90), - SPH_C32(0xc4a5c411), SPH_C32(0xe0410900), SPH_C32(0x0a029931), - SPH_C32(0xbc21d3cf), SPH_C32(0x3112d36c) }, - { SPH_C32(0xd3d70f00), SPH_C32(0x712502c9), SPH_C32(0xe6a3d23b), - SPH_C32(0x2261a075), SPH_C32(0x930d0900), SPH_C32(0x9f6d3ee7), - SPH_C32(0x1ebcc158), SPH_C32(0x5ff7bb38) }, - { SPH_C32(0x5ea10c00), SPH_C32(0x630c78ca), SPH_C32(0x2190377a), - SPH_C32(0x0fa7721f), SPH_C32(0x83110a00), SPH_C32(0x0a608b0c), - SPH_C32(0xfbd0e001), SPH_C32(0x2727aa2a) }, - { SPH_C32(0xe9050d00), SPH_C32(0xe9134912), SPH_C32(0xa419efd1), - SPH_C32(0xe963167b), SPH_C32(0xf05d0a00), SPH_C32(0x9f0f2cda), - SPH_C32(0x594df296), SPH_C32(0x49c2c27e) }, - { SPH_C32(0x2ded0c00), SPH_C32(0xf663df1c), SPH_C32(0x830d25ed), - SPH_C32(0x61421a4b), SPH_C32(0x47f90b00), SPH_C32(0x15101d02), - SPH_C32(0xdcc42a3d), SPH_C32(0xaf06a61a) }, - { SPH_C32(0x9a490d00), SPH_C32(0x7c7ceec4), SPH_C32(0x0684fd46), - SPH_C32(0x87867e2f), SPH_C32(0x34b50b00), SPH_C32(0x807fbad4), - SPH_C32(0x7e5938aa), SPH_C32(0xc1e3ce4e) }, - { SPH_C32(0xf9190e00), SPH_C32(0x7c1efcf9), SPH_C32(0x4175ce88), - SPH_C32(0x91b30769), SPH_C32(0x6d370a00), SPH_C32(0x182be332), - SPH_C32(0x7b12368e), SPH_C32(0x1cd40106) }, - { SPH_C32(0x4ebd0f00), SPH_C32(0xf601cd21), SPH_C32(0xc4fc1623), - SPH_C32(0x7777630d), SPH_C32(0x1e7b0a00), SPH_C32(0x8d4444e4), - SPH_C32(0xd98f2419), SPH_C32(0x72316952) }, - { SPH_C32(0x8a550e00), SPH_C32(0xe9715b2f), SPH_C32(0xe3e8dc1f), - SPH_C32(0xff566f3d), SPH_C32(0xa9df0b00), SPH_C32(0x075b753c), - SPH_C32(0x5c06fcb2), SPH_C32(0x94f50d36) }, - { SPH_C32(0x3df10f00), SPH_C32(0x636e6af7), SPH_C32(0x666104b4), - SPH_C32(0x19920b59), SPH_C32(0xda930b00), SPH_C32(0x9234d2ea), - SPH_C32(0xfe9bee25), SPH_C32(0xfa106562) }, - { SPH_C32(0x2b040800), SPH_C32(0x5360ef7c), SPH_C32(0xa4e54caf), - SPH_C32(0x99a61e03), SPH_C32(0x45b10c00), SPH_C32(0x0aa4af76), - SPH_C32(0x7432879d), SPH_C32(0x0b4d58a6) }, - { SPH_C32(0x9ca00900), SPH_C32(0xd97fdea4), SPH_C32(0x216c9404), - SPH_C32(0x7f627a67), SPH_C32(0x36fd0c00), SPH_C32(0x9fcb08a0), - SPH_C32(0xd6af950a), SPH_C32(0x65a830f2) }, - { SPH_C32(0x58480800), SPH_C32(0xc60f48aa), SPH_C32(0x06785e38), - SPH_C32(0xf7437657), SPH_C32(0x81590d00), SPH_C32(0x15d43978), - SPH_C32(0x53264da1), SPH_C32(0x836c5496) }, - { SPH_C32(0xefec0900), SPH_C32(0x4c107972), SPH_C32(0x83f18693), - SPH_C32(0x11871233), SPH_C32(0xf2150d00), SPH_C32(0x80bb9eae), - SPH_C32(0xf1bb5f36), SPH_C32(0xed893cc2) }, - { SPH_C32(0x8cbc0a00), SPH_C32(0x4c726b4f), SPH_C32(0xc400b55d), - SPH_C32(0x07b26b75), SPH_C32(0xab970c00), SPH_C32(0x18efc748), - SPH_C32(0xf4f05112), SPH_C32(0x30bef38a) }, - { SPH_C32(0x3b180b00), SPH_C32(0xc66d5a97), SPH_C32(0x41896df6), - SPH_C32(0xe1760f11), SPH_C32(0xd8db0c00), SPH_C32(0x8d80609e), - SPH_C32(0x566d4385), SPH_C32(0x5e5b9bde) }, - { SPH_C32(0xfff00a00), SPH_C32(0xd91dcc99), SPH_C32(0x669da7ca), - SPH_C32(0x69570321), SPH_C32(0x6f7f0d00), SPH_C32(0x079f5146), - SPH_C32(0xd3e49b2e), SPH_C32(0xb89fffba) }, - { SPH_C32(0x48540b00), SPH_C32(0x5302fd41), SPH_C32(0xe3147f61), - SPH_C32(0x8f936745), SPH_C32(0x1c330d00), SPH_C32(0x92f0f690), - SPH_C32(0x717989b9), SPH_C32(0xd67a97ee) }, - { SPH_C32(0xc5220800), SPH_C32(0x412b8742), SPH_C32(0x24279a20), - SPH_C32(0xa255b52f), SPH_C32(0x0c2f0e00), SPH_C32(0x07fd437b), - SPH_C32(0x9415a8e0), SPH_C32(0xaeaa86fc) }, - { SPH_C32(0x72860900), SPH_C32(0xcb34b69a), SPH_C32(0xa1ae428b), - SPH_C32(0x4491d14b), SPH_C32(0x7f630e00), SPH_C32(0x9292e4ad), - SPH_C32(0x3688ba77), SPH_C32(0xc04feea8) }, - { SPH_C32(0xb66e0800), SPH_C32(0xd4442094), SPH_C32(0x86ba88b7), - SPH_C32(0xccb0dd7b), SPH_C32(0xc8c70f00), SPH_C32(0x188dd575), - SPH_C32(0xb30162dc), SPH_C32(0x268b8acc) }, - { SPH_C32(0x01ca0900), SPH_C32(0x5e5b114c), SPH_C32(0x0333501c), - SPH_C32(0x2a74b91f), SPH_C32(0xbb8b0f00), SPH_C32(0x8de272a3), - SPH_C32(0x119c704b), SPH_C32(0x486ee298) }, - { SPH_C32(0x629a0a00), SPH_C32(0x5e390371), SPH_C32(0x44c263d2), - SPH_C32(0x3c41c059), SPH_C32(0xe2090e00), SPH_C32(0x15b62b45), - SPH_C32(0x14d77e6f), SPH_C32(0x95592dd0) }, - { SPH_C32(0xd53e0b00), SPH_C32(0xd42632a9), SPH_C32(0xc14bbb79), - SPH_C32(0xda85a43d), SPH_C32(0x91450e00), SPH_C32(0x80d98c93), - SPH_C32(0xb64a6cf8), SPH_C32(0xfbbc4584) }, - { SPH_C32(0x11d60a00), SPH_C32(0xcb56a4a7), SPH_C32(0xe65f7145), - SPH_C32(0x52a4a80d), SPH_C32(0x26e10f00), SPH_C32(0x0ac6bd4b), - SPH_C32(0x33c3b453), SPH_C32(0x1d7821e0) }, - { SPH_C32(0xa6720b00), SPH_C32(0x4149957f), SPH_C32(0x63d6a9ee), - SPH_C32(0xb460cc69), SPH_C32(0x55ad0f00), SPH_C32(0x9fa91a9d), - SPH_C32(0x915ea6c4), SPH_C32(0x739d49b4) }, - { SPH_C32(0xa43a0c00), SPH_C32(0x5efd270b), SPH_C32(0xcb20044e), - SPH_C32(0x102b32d5), SPH_C32(0x510c0c00), SPH_C32(0x251e9889), - SPH_C32(0x1e406226), SPH_C32(0x2f32b340) }, - { SPH_C32(0x139e0d00), SPH_C32(0xd4e216d3), SPH_C32(0x4ea9dce5), - SPH_C32(0xf6ef56b1), SPH_C32(0x22400c00), SPH_C32(0xb0713f5f), - SPH_C32(0xbcdd70b1), SPH_C32(0x41d7db14) }, - { SPH_C32(0xd7760c00), SPH_C32(0xcb9280dd), SPH_C32(0x69bd16d9), - SPH_C32(0x7ece5a81), SPH_C32(0x95e40d00), SPH_C32(0x3a6e0e87), - SPH_C32(0x3954a81a), SPH_C32(0xa713bf70) }, - { SPH_C32(0x60d20d00), SPH_C32(0x418db105), SPH_C32(0xec34ce72), - SPH_C32(0x980a3ee5), SPH_C32(0xe6a80d00), SPH_C32(0xaf01a951), - SPH_C32(0x9bc9ba8d), SPH_C32(0xc9f6d724) }, - { SPH_C32(0x03820e00), SPH_C32(0x41efa338), SPH_C32(0xabc5fdbc), - SPH_C32(0x8e3f47a3), SPH_C32(0xbf2a0c00), SPH_C32(0x3755f0b7), - SPH_C32(0x9e82b4a9), SPH_C32(0x14c1186c) }, - { SPH_C32(0xb4260f00), SPH_C32(0xcbf092e0), SPH_C32(0x2e4c2517), - SPH_C32(0x68fb23c7), SPH_C32(0xcc660c00), SPH_C32(0xa23a5761), - SPH_C32(0x3c1fa63e), SPH_C32(0x7a247038) }, - { SPH_C32(0x70ce0e00), SPH_C32(0xd48004ee), SPH_C32(0x0958ef2b), - SPH_C32(0xe0da2ff7), SPH_C32(0x7bc20d00), SPH_C32(0x282566b9), - SPH_C32(0xb9967e95), SPH_C32(0x9ce0145c) }, - { SPH_C32(0xc76a0f00), SPH_C32(0x5e9f3536), SPH_C32(0x8cd13780), - SPH_C32(0x061e4b93), SPH_C32(0x088e0d00), SPH_C32(0xbd4ac16f), - SPH_C32(0x1b0b6c02), SPH_C32(0xf2057c08) }, - { SPH_C32(0x4a1c0c00), SPH_C32(0x4cb64f35), SPH_C32(0x4be2d2c1), - SPH_C32(0x2bd899f9), SPH_C32(0x18920e00), SPH_C32(0x28477484), - SPH_C32(0xfe674d5b), SPH_C32(0x8ad56d1a) }, - { SPH_C32(0xfdb80d00), SPH_C32(0xc6a97eed), SPH_C32(0xce6b0a6a), - SPH_C32(0xcd1cfd9d), SPH_C32(0x6bde0e00), SPH_C32(0xbd28d352), - SPH_C32(0x5cfa5fcc), SPH_C32(0xe430054e) }, - { SPH_C32(0x39500c00), SPH_C32(0xd9d9e8e3), SPH_C32(0xe97fc056), - SPH_C32(0x453df1ad), SPH_C32(0xdc7a0f00), SPH_C32(0x3737e28a), - SPH_C32(0xd9738767), SPH_C32(0x02f4612a) }, - { SPH_C32(0x8ef40d00), SPH_C32(0x53c6d93b), SPH_C32(0x6cf618fd), - SPH_C32(0xa3f995c9), SPH_C32(0xaf360f00), SPH_C32(0xa258455c), - SPH_C32(0x7bee95f0), SPH_C32(0x6c11097e) }, - { SPH_C32(0xeda40e00), SPH_C32(0x53a4cb06), SPH_C32(0x2b072b33), - SPH_C32(0xb5ccec8f), SPH_C32(0xf6b40e00), SPH_C32(0x3a0c1cba), - SPH_C32(0x7ea59bd4), SPH_C32(0xb126c636) }, - { SPH_C32(0x5a000f00), SPH_C32(0xd9bbfade), SPH_C32(0xae8ef398), - SPH_C32(0x530888eb), SPH_C32(0x85f80e00), SPH_C32(0xaf63bb6c), - SPH_C32(0xdc388943), SPH_C32(0xdfc3ae62) }, - { SPH_C32(0x9ee80e00), SPH_C32(0xc6cb6cd0), SPH_C32(0x899a39a4), - SPH_C32(0xdb2984db), SPH_C32(0x325c0f00), SPH_C32(0x257c8ab4), - SPH_C32(0x59b151e8), SPH_C32(0x3907ca06) }, - { SPH_C32(0x294c0f00), SPH_C32(0x4cd45d08), SPH_C32(0x0c13e10f), - SPH_C32(0x3dede0bf), SPH_C32(0x41100f00), SPH_C32(0xb0132d62), - SPH_C32(0xfb2c437f), SPH_C32(0x57e2a252) } -}; - -static const sph_u32 T256_16[256][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0x515c0010), SPH_C32(0x40f372fb), SPH_C32(0xfce72602), - SPH_C32(0x71575061), SPH_C32(0x2e390000), SPH_C32(0x64dd6689), - SPH_C32(0x3cd406fc), SPH_C32(0xb1f490bc) }, - { SPH_C32(0x2e390000), SPH_C32(0x64dd6689), SPH_C32(0x3cd406fc), - SPH_C32(0xb1f490bc), SPH_C32(0x7f650010), SPH_C32(0x242e1472), - SPH_C32(0xc03320fe), SPH_C32(0xc0a3c0dd) }, - { SPH_C32(0x7f650010), SPH_C32(0x242e1472), SPH_C32(0xc03320fe), - SPH_C32(0xc0a3c0dd), SPH_C32(0x515c0010), SPH_C32(0x40f372fb), - SPH_C32(0xfce72602), SPH_C32(0x71575061) }, - { SPH_C32(0xa2b80020), SPH_C32(0x81e7e5f6), SPH_C32(0xf9ce4c04), - SPH_C32(0xe2afa0c0), SPH_C32(0x5c720000), SPH_C32(0xc9bacd12), - SPH_C32(0x79a90df9), SPH_C32(0x63e92178) }, - { SPH_C32(0xf3e40030), SPH_C32(0xc114970d), SPH_C32(0x05296a06), - SPH_C32(0x93f8f0a1), SPH_C32(0x724b0000), SPH_C32(0xad67ab9b), - SPH_C32(0x457d0b05), SPH_C32(0xd21db1c4) }, - { SPH_C32(0x8c810020), SPH_C32(0xe53a837f), SPH_C32(0xc51a4af8), - SPH_C32(0x535b307c), SPH_C32(0x23170010), SPH_C32(0xed94d960), - SPH_C32(0xb99a2d07), SPH_C32(0xa34ae1a5) }, - { SPH_C32(0xdddd0030), SPH_C32(0xa5c9f184), SPH_C32(0x39fd6cfa), - SPH_C32(0x220c601d), SPH_C32(0x0d2e0010), SPH_C32(0x8949bfe9), - SPH_C32(0x854e2bfb), SPH_C32(0x12be7119) }, - { SPH_C32(0x5c720000), SPH_C32(0xc9bacd12), SPH_C32(0x79a90df9), - SPH_C32(0x63e92178), SPH_C32(0xfeca0020), SPH_C32(0x485d28e4), - SPH_C32(0x806741fd), SPH_C32(0x814681b8) }, - { SPH_C32(0x0d2e0010), SPH_C32(0x8949bfe9), SPH_C32(0x854e2bfb), - SPH_C32(0x12be7119), SPH_C32(0xd0f30020), SPH_C32(0x2c804e6d), - SPH_C32(0xbcb34701), SPH_C32(0x30b21104) }, - { SPH_C32(0x724b0000), SPH_C32(0xad67ab9b), SPH_C32(0x457d0b05), - SPH_C32(0xd21db1c4), SPH_C32(0x81af0030), SPH_C32(0x6c733c96), - SPH_C32(0x40546103), SPH_C32(0x41e54165) }, - { SPH_C32(0x23170010), SPH_C32(0xed94d960), SPH_C32(0xb99a2d07), - SPH_C32(0xa34ae1a5), SPH_C32(0xaf960030), SPH_C32(0x08ae5a1f), - SPH_C32(0x7c8067ff), SPH_C32(0xf011d1d9) }, - { SPH_C32(0xfeca0020), SPH_C32(0x485d28e4), SPH_C32(0x806741fd), - SPH_C32(0x814681b8), SPH_C32(0xa2b80020), SPH_C32(0x81e7e5f6), - SPH_C32(0xf9ce4c04), SPH_C32(0xe2afa0c0) }, - { SPH_C32(0xaf960030), SPH_C32(0x08ae5a1f), SPH_C32(0x7c8067ff), - SPH_C32(0xf011d1d9), SPH_C32(0x8c810020), SPH_C32(0xe53a837f), - SPH_C32(0xc51a4af8), SPH_C32(0x535b307c) }, - { SPH_C32(0xd0f30020), SPH_C32(0x2c804e6d), SPH_C32(0xbcb34701), - SPH_C32(0x30b21104), SPH_C32(0xdddd0030), SPH_C32(0xa5c9f184), - SPH_C32(0x39fd6cfa), SPH_C32(0x220c601d) }, - { SPH_C32(0x81af0030), SPH_C32(0x6c733c96), SPH_C32(0x40546103), - SPH_C32(0x41e54165), SPH_C32(0xf3e40030), SPH_C32(0xc114970d), - SPH_C32(0x05296a06), SPH_C32(0x93f8f0a1) }, - { SPH_C32(0x4dce0040), SPH_C32(0x3b5bec7e), SPH_C32(0x36656ba8), - SPH_C32(0x23633a05), SPH_C32(0x78ab0000), SPH_C32(0xa0cd5a34), - SPH_C32(0x5d5ca0f7), SPH_C32(0x727784cb) }, - { SPH_C32(0x1c920050), SPH_C32(0x7ba89e85), SPH_C32(0xca824daa), - SPH_C32(0x52346a64), SPH_C32(0x56920000), SPH_C32(0xc4103cbd), - SPH_C32(0x6188a60b), SPH_C32(0xc3831477) }, - { SPH_C32(0x63f70040), SPH_C32(0x5f868af7), SPH_C32(0x0ab16d54), - SPH_C32(0x9297aab9), SPH_C32(0x07ce0010), SPH_C32(0x84e34e46), - SPH_C32(0x9d6f8009), SPH_C32(0xb2d44416) }, - { SPH_C32(0x32ab0050), SPH_C32(0x1f75f80c), SPH_C32(0xf6564b56), - SPH_C32(0xe3c0fad8), SPH_C32(0x29f70010), SPH_C32(0xe03e28cf), - SPH_C32(0xa1bb86f5), SPH_C32(0x0320d4aa) }, - { SPH_C32(0xef760060), SPH_C32(0xbabc0988), SPH_C32(0xcfab27ac), - SPH_C32(0xc1cc9ac5), SPH_C32(0x24d90000), SPH_C32(0x69779726), - SPH_C32(0x24f5ad0e), SPH_C32(0x119ea5b3) }, - { SPH_C32(0xbe2a0070), SPH_C32(0xfa4f7b73), SPH_C32(0x334c01ae), - SPH_C32(0xb09bcaa4), SPH_C32(0x0ae00000), SPH_C32(0x0daaf1af), - SPH_C32(0x1821abf2), SPH_C32(0xa06a350f) }, - { SPH_C32(0xc14f0060), SPH_C32(0xde616f01), SPH_C32(0xf37f2150), - SPH_C32(0x70380a79), SPH_C32(0x5bbc0010), SPH_C32(0x4d598354), - SPH_C32(0xe4c68df0), SPH_C32(0xd13d656e) }, - { SPH_C32(0x90130070), SPH_C32(0x9e921dfa), SPH_C32(0x0f980752), - SPH_C32(0x016f5a18), SPH_C32(0x75850010), SPH_C32(0x2984e5dd), - SPH_C32(0xd8128b0c), SPH_C32(0x60c9f5d2) }, - { SPH_C32(0x11bc0040), SPH_C32(0xf2e1216c), SPH_C32(0x4fcc6651), - SPH_C32(0x408a1b7d), SPH_C32(0x86610020), SPH_C32(0xe89072d0), - SPH_C32(0xdd3be10a), SPH_C32(0xf3310573) }, - { SPH_C32(0x40e00050), SPH_C32(0xb2125397), SPH_C32(0xb32b4053), - SPH_C32(0x31dd4b1c), SPH_C32(0xa8580020), SPH_C32(0x8c4d1459), - SPH_C32(0xe1efe7f6), SPH_C32(0x42c595cf) }, - { SPH_C32(0x3f850040), SPH_C32(0x963c47e5), SPH_C32(0x731860ad), - SPH_C32(0xf17e8bc1), SPH_C32(0xf9040030), SPH_C32(0xccbe66a2), - SPH_C32(0x1d08c1f4), SPH_C32(0x3392c5ae) }, - { SPH_C32(0x6ed90050), SPH_C32(0xd6cf351e), SPH_C32(0x8fff46af), - SPH_C32(0x8029dba0), SPH_C32(0xd73d0030), SPH_C32(0xa863002b), - SPH_C32(0x21dcc708), SPH_C32(0x82665512) }, - { SPH_C32(0xb3040060), SPH_C32(0x7306c49a), SPH_C32(0xb6022a55), - SPH_C32(0xa225bbbd), SPH_C32(0xda130020), SPH_C32(0x212abfc2), - SPH_C32(0xa492ecf3), SPH_C32(0x90d8240b) }, - { SPH_C32(0xe2580070), SPH_C32(0x33f5b661), SPH_C32(0x4ae50c57), - SPH_C32(0xd372ebdc), SPH_C32(0xf42a0020), SPH_C32(0x45f7d94b), - SPH_C32(0x9846ea0f), SPH_C32(0x212cb4b7) }, - { SPH_C32(0x9d3d0060), SPH_C32(0x17dba213), SPH_C32(0x8ad62ca9), - SPH_C32(0x13d12b01), SPH_C32(0xa5760030), SPH_C32(0x0504abb0), - SPH_C32(0x64a1cc0d), SPH_C32(0x507be4d6) }, - { SPH_C32(0xcc610070), SPH_C32(0x5728d0e8), SPH_C32(0x76310aab), - SPH_C32(0x62867b60), SPH_C32(0x8b4f0030), SPH_C32(0x61d9cd39), - SPH_C32(0x5875caf1), SPH_C32(0xe18f746a) }, - { SPH_C32(0x78ab0000), SPH_C32(0xa0cd5a34), SPH_C32(0x5d5ca0f7), - SPH_C32(0x727784cb), SPH_C32(0x35650040), SPH_C32(0x9b96b64a), - SPH_C32(0x6b39cb5f), SPH_C32(0x5114bece) }, - { SPH_C32(0x29f70010), SPH_C32(0xe03e28cf), SPH_C32(0xa1bb86f5), - SPH_C32(0x0320d4aa), SPH_C32(0x1b5c0040), SPH_C32(0xff4bd0c3), - SPH_C32(0x57edcda3), SPH_C32(0xe0e02e72) }, - { SPH_C32(0x56920000), SPH_C32(0xc4103cbd), SPH_C32(0x6188a60b), - SPH_C32(0xc3831477), SPH_C32(0x4a000050), SPH_C32(0xbfb8a238), - SPH_C32(0xab0aeba1), SPH_C32(0x91b77e13) }, - { SPH_C32(0x07ce0010), SPH_C32(0x84e34e46), SPH_C32(0x9d6f8009), - SPH_C32(0xb2d44416), SPH_C32(0x64390050), SPH_C32(0xdb65c4b1), - SPH_C32(0x97deed5d), SPH_C32(0x2043eeaf) }, - { SPH_C32(0xda130020), SPH_C32(0x212abfc2), SPH_C32(0xa492ecf3), - SPH_C32(0x90d8240b), SPH_C32(0x69170040), SPH_C32(0x522c7b58), - SPH_C32(0x1290c6a6), SPH_C32(0x32fd9fb6) }, - { SPH_C32(0x8b4f0030), SPH_C32(0x61d9cd39), SPH_C32(0x5875caf1), - SPH_C32(0xe18f746a), SPH_C32(0x472e0040), SPH_C32(0x36f11dd1), - SPH_C32(0x2e44c05a), SPH_C32(0x83090f0a) }, - { SPH_C32(0xf42a0020), SPH_C32(0x45f7d94b), SPH_C32(0x9846ea0f), - SPH_C32(0x212cb4b7), SPH_C32(0x16720050), SPH_C32(0x76026f2a), - SPH_C32(0xd2a3e658), SPH_C32(0xf25e5f6b) }, - { SPH_C32(0xa5760030), SPH_C32(0x0504abb0), SPH_C32(0x64a1cc0d), - SPH_C32(0x507be4d6), SPH_C32(0x384b0050), SPH_C32(0x12df09a3), - SPH_C32(0xee77e0a4), SPH_C32(0x43aacfd7) }, - { SPH_C32(0x24d90000), SPH_C32(0x69779726), SPH_C32(0x24f5ad0e), - SPH_C32(0x119ea5b3), SPH_C32(0xcbaf0060), SPH_C32(0xd3cb9eae), - SPH_C32(0xeb5e8aa2), SPH_C32(0xd0523f76) }, - { SPH_C32(0x75850010), SPH_C32(0x2984e5dd), SPH_C32(0xd8128b0c), - SPH_C32(0x60c9f5d2), SPH_C32(0xe5960060), SPH_C32(0xb716f827), - SPH_C32(0xd78a8c5e), SPH_C32(0x61a6afca) }, - { SPH_C32(0x0ae00000), SPH_C32(0x0daaf1af), SPH_C32(0x1821abf2), - SPH_C32(0xa06a350f), SPH_C32(0xb4ca0070), SPH_C32(0xf7e58adc), - SPH_C32(0x2b6daa5c), SPH_C32(0x10f1ffab) }, - { SPH_C32(0x5bbc0010), SPH_C32(0x4d598354), SPH_C32(0xe4c68df0), - SPH_C32(0xd13d656e), SPH_C32(0x9af30070), SPH_C32(0x9338ec55), - SPH_C32(0x17b9aca0), SPH_C32(0xa1056f17) }, - { SPH_C32(0x86610020), SPH_C32(0xe89072d0), SPH_C32(0xdd3be10a), - SPH_C32(0xf3310573), SPH_C32(0x97dd0060), SPH_C32(0x1a7153bc), - SPH_C32(0x92f7875b), SPH_C32(0xb3bb1e0e) }, - { SPH_C32(0xd73d0030), SPH_C32(0xa863002b), SPH_C32(0x21dcc708), - SPH_C32(0x82665512), SPH_C32(0xb9e40060), SPH_C32(0x7eac3535), - SPH_C32(0xae2381a7), SPH_C32(0x024f8eb2) }, - { SPH_C32(0xa8580020), SPH_C32(0x8c4d1459), SPH_C32(0xe1efe7f6), - SPH_C32(0x42c595cf), SPH_C32(0xe8b80070), SPH_C32(0x3e5f47ce), - SPH_C32(0x52c4a7a5), SPH_C32(0x7318ded3) }, - { SPH_C32(0xf9040030), SPH_C32(0xccbe66a2), SPH_C32(0x1d08c1f4), - SPH_C32(0x3392c5ae), SPH_C32(0xc6810070), SPH_C32(0x5a822147), - SPH_C32(0x6e10a159), SPH_C32(0xc2ec4e6f) }, - { SPH_C32(0x35650040), SPH_C32(0x9b96b64a), SPH_C32(0x6b39cb5f), - SPH_C32(0x5114bece), SPH_C32(0x4dce0040), SPH_C32(0x3b5bec7e), - SPH_C32(0x36656ba8), SPH_C32(0x23633a05) }, - { SPH_C32(0x64390050), SPH_C32(0xdb65c4b1), SPH_C32(0x97deed5d), - SPH_C32(0x2043eeaf), SPH_C32(0x63f70040), SPH_C32(0x5f868af7), - SPH_C32(0x0ab16d54), SPH_C32(0x9297aab9) }, - { SPH_C32(0x1b5c0040), SPH_C32(0xff4bd0c3), SPH_C32(0x57edcda3), - SPH_C32(0xe0e02e72), SPH_C32(0x32ab0050), SPH_C32(0x1f75f80c), - SPH_C32(0xf6564b56), SPH_C32(0xe3c0fad8) }, - { SPH_C32(0x4a000050), SPH_C32(0xbfb8a238), SPH_C32(0xab0aeba1), - SPH_C32(0x91b77e13), SPH_C32(0x1c920050), SPH_C32(0x7ba89e85), - SPH_C32(0xca824daa), SPH_C32(0x52346a64) }, - { SPH_C32(0x97dd0060), SPH_C32(0x1a7153bc), SPH_C32(0x92f7875b), - SPH_C32(0xb3bb1e0e), SPH_C32(0x11bc0040), SPH_C32(0xf2e1216c), - SPH_C32(0x4fcc6651), SPH_C32(0x408a1b7d) }, - { SPH_C32(0xc6810070), SPH_C32(0x5a822147), SPH_C32(0x6e10a159), - SPH_C32(0xc2ec4e6f), SPH_C32(0x3f850040), SPH_C32(0x963c47e5), - SPH_C32(0x731860ad), SPH_C32(0xf17e8bc1) }, - { SPH_C32(0xb9e40060), SPH_C32(0x7eac3535), SPH_C32(0xae2381a7), - SPH_C32(0x024f8eb2), SPH_C32(0x6ed90050), SPH_C32(0xd6cf351e), - SPH_C32(0x8fff46af), SPH_C32(0x8029dba0) }, - { SPH_C32(0xe8b80070), SPH_C32(0x3e5f47ce), SPH_C32(0x52c4a7a5), - SPH_C32(0x7318ded3), SPH_C32(0x40e00050), SPH_C32(0xb2125397), - SPH_C32(0xb32b4053), SPH_C32(0x31dd4b1c) }, - { SPH_C32(0x69170040), SPH_C32(0x522c7b58), SPH_C32(0x1290c6a6), - SPH_C32(0x32fd9fb6), SPH_C32(0xb3040060), SPH_C32(0x7306c49a), - SPH_C32(0xb6022a55), SPH_C32(0xa225bbbd) }, - { SPH_C32(0x384b0050), SPH_C32(0x12df09a3), SPH_C32(0xee77e0a4), - SPH_C32(0x43aacfd7), SPH_C32(0x9d3d0060), SPH_C32(0x17dba213), - SPH_C32(0x8ad62ca9), SPH_C32(0x13d12b01) }, - { SPH_C32(0x472e0040), SPH_C32(0x36f11dd1), SPH_C32(0x2e44c05a), - SPH_C32(0x83090f0a), SPH_C32(0xcc610070), SPH_C32(0x5728d0e8), - SPH_C32(0x76310aab), SPH_C32(0x62867b60) }, - { SPH_C32(0x16720050), SPH_C32(0x76026f2a), SPH_C32(0xd2a3e658), - SPH_C32(0xf25e5f6b), SPH_C32(0xe2580070), SPH_C32(0x33f5b661), - SPH_C32(0x4ae50c57), SPH_C32(0xd372ebdc) }, - { SPH_C32(0xcbaf0060), SPH_C32(0xd3cb9eae), SPH_C32(0xeb5e8aa2), - SPH_C32(0xd0523f76), SPH_C32(0xef760060), SPH_C32(0xbabc0988), - SPH_C32(0xcfab27ac), SPH_C32(0xc1cc9ac5) }, - { SPH_C32(0x9af30070), SPH_C32(0x9338ec55), SPH_C32(0x17b9aca0), - SPH_C32(0xa1056f17), SPH_C32(0xc14f0060), SPH_C32(0xde616f01), - SPH_C32(0xf37f2150), SPH_C32(0x70380a79) }, - { SPH_C32(0xe5960060), SPH_C32(0xb716f827), SPH_C32(0xd78a8c5e), - SPH_C32(0x61a6afca), SPH_C32(0x90130070), SPH_C32(0x9e921dfa), - SPH_C32(0x0f980752), SPH_C32(0x016f5a18) }, - { SPH_C32(0xb4ca0070), SPH_C32(0xf7e58adc), SPH_C32(0x2b6daa5c), - SPH_C32(0x10f1ffab), SPH_C32(0xbe2a0070), SPH_C32(0xfa4f7b73), - SPH_C32(0x334c01ae), SPH_C32(0xb09bcaa4) }, - { SPH_C32(0x5bd20080), SPH_C32(0x450f18ec), SPH_C32(0xc2c46c55), - SPH_C32(0xf362b233), SPH_C32(0x39a60000), SPH_C32(0x4ab753eb), - SPH_C32(0xd14e094b), SPH_C32(0xb772b42b) }, - { SPH_C32(0x0a8e0090), SPH_C32(0x05fc6a17), SPH_C32(0x3e234a57), - SPH_C32(0x8235e252), SPH_C32(0x179f0000), SPH_C32(0x2e6a3562), - SPH_C32(0xed9a0fb7), SPH_C32(0x06862497) }, - { SPH_C32(0x75eb0080), SPH_C32(0x21d27e65), SPH_C32(0xfe106aa9), - SPH_C32(0x4296228f), SPH_C32(0x46c30010), SPH_C32(0x6e994799), - SPH_C32(0x117d29b5), SPH_C32(0x77d174f6) }, - { SPH_C32(0x24b70090), SPH_C32(0x61210c9e), SPH_C32(0x02f74cab), - SPH_C32(0x33c172ee), SPH_C32(0x68fa0010), SPH_C32(0x0a442110), - SPH_C32(0x2da92f49), SPH_C32(0xc625e44a) }, - { SPH_C32(0xf96a00a0), SPH_C32(0xc4e8fd1a), SPH_C32(0x3b0a2051), - SPH_C32(0x11cd12f3), SPH_C32(0x65d40000), SPH_C32(0x830d9ef9), - SPH_C32(0xa8e704b2), SPH_C32(0xd49b9553) }, - { SPH_C32(0xa83600b0), SPH_C32(0x841b8fe1), SPH_C32(0xc7ed0653), - SPH_C32(0x609a4292), SPH_C32(0x4bed0000), SPH_C32(0xe7d0f870), - SPH_C32(0x9433024e), SPH_C32(0x656f05ef) }, - { SPH_C32(0xd75300a0), SPH_C32(0xa0359b93), SPH_C32(0x07de26ad), - SPH_C32(0xa039824f), SPH_C32(0x1ab10010), SPH_C32(0xa7238a8b), - SPH_C32(0x68d4244c), SPH_C32(0x1438558e) }, - { SPH_C32(0x860f00b0), SPH_C32(0xe0c6e968), SPH_C32(0xfb3900af), - SPH_C32(0xd16ed22e), SPH_C32(0x34880010), SPH_C32(0xc3feec02), - SPH_C32(0x540022b0), SPH_C32(0xa5ccc532) }, - { SPH_C32(0x07a00080), SPH_C32(0x8cb5d5fe), SPH_C32(0xbb6d61ac), - SPH_C32(0x908b934b), SPH_C32(0xc76c0020), SPH_C32(0x02ea7b0f), - SPH_C32(0x512948b6), SPH_C32(0x36343593) }, - { SPH_C32(0x56fc0090), SPH_C32(0xcc46a705), SPH_C32(0x478a47ae), - SPH_C32(0xe1dcc32a), SPH_C32(0xe9550020), SPH_C32(0x66371d86), - SPH_C32(0x6dfd4e4a), SPH_C32(0x87c0a52f) }, - { SPH_C32(0x29990080), SPH_C32(0xe868b377), SPH_C32(0x87b96750), - SPH_C32(0x217f03f7), SPH_C32(0xb8090030), SPH_C32(0x26c46f7d), - SPH_C32(0x911a6848), SPH_C32(0xf697f54e) }, - { SPH_C32(0x78c50090), SPH_C32(0xa89bc18c), SPH_C32(0x7b5e4152), - SPH_C32(0x50285396), SPH_C32(0x96300030), SPH_C32(0x421909f4), - SPH_C32(0xadce6eb4), SPH_C32(0x476365f2) }, - { SPH_C32(0xa51800a0), SPH_C32(0x0d523008), SPH_C32(0x42a32da8), - SPH_C32(0x7224338b), SPH_C32(0x9b1e0020), SPH_C32(0xcb50b61d), - SPH_C32(0x2880454f), SPH_C32(0x55dd14eb) }, - { SPH_C32(0xf44400b0), SPH_C32(0x4da142f3), SPH_C32(0xbe440baa), - SPH_C32(0x037363ea), SPH_C32(0xb5270020), SPH_C32(0xaf8dd094), - SPH_C32(0x145443b3), SPH_C32(0xe4298457) }, - { SPH_C32(0x8b2100a0), SPH_C32(0x698f5681), SPH_C32(0x7e772b54), - SPH_C32(0xc3d0a337), SPH_C32(0xe47b0030), SPH_C32(0xef7ea26f), - SPH_C32(0xe8b365b1), SPH_C32(0x957ed436) }, - { SPH_C32(0xda7d00b0), SPH_C32(0x297c247a), SPH_C32(0x82900d56), - SPH_C32(0xb287f356), SPH_C32(0xca420030), SPH_C32(0x8ba3c4e6), - SPH_C32(0xd467634d), SPH_C32(0x248a448a) }, - { SPH_C32(0x161c00c0), SPH_C32(0x7e54f492), SPH_C32(0xf4a107fd), - SPH_C32(0xd0018836), SPH_C32(0x410d0000), SPH_C32(0xea7a09df), - SPH_C32(0x8c12a9bc), SPH_C32(0xc50530e0) }, - { SPH_C32(0x474000d0), SPH_C32(0x3ea78669), SPH_C32(0x084621ff), - SPH_C32(0xa156d857), SPH_C32(0x6f340000), SPH_C32(0x8ea76f56), - SPH_C32(0xb0c6af40), SPH_C32(0x74f1a05c) }, - { SPH_C32(0x382500c0), SPH_C32(0x1a89921b), SPH_C32(0xc8750101), - SPH_C32(0x61f5188a), SPH_C32(0x3e680010), SPH_C32(0xce541dad), - SPH_C32(0x4c218942), SPH_C32(0x05a6f03d) }, - { SPH_C32(0x697900d0), SPH_C32(0x5a7ae0e0), SPH_C32(0x34922703), - SPH_C32(0x10a248eb), SPH_C32(0x10510010), SPH_C32(0xaa897b24), - SPH_C32(0x70f58fbe), SPH_C32(0xb4526081) }, - { SPH_C32(0xb4a400e0), SPH_C32(0xffb31164), SPH_C32(0x0d6f4bf9), - SPH_C32(0x32ae28f6), SPH_C32(0x1d7f0000), SPH_C32(0x23c0c4cd), - SPH_C32(0xf5bba445), SPH_C32(0xa6ec1198) }, - { SPH_C32(0xe5f800f0), SPH_C32(0xbf40639f), SPH_C32(0xf1886dfb), - SPH_C32(0x43f97897), SPH_C32(0x33460000), SPH_C32(0x471da244), - SPH_C32(0xc96fa2b9), SPH_C32(0x17188124) }, - { SPH_C32(0x9a9d00e0), SPH_C32(0x9b6e77ed), SPH_C32(0x31bb4d05), - SPH_C32(0x835ab84a), SPH_C32(0x621a0010), SPH_C32(0x07eed0bf), - SPH_C32(0x358884bb), SPH_C32(0x664fd145) }, - { SPH_C32(0xcbc100f0), SPH_C32(0xdb9d0516), SPH_C32(0xcd5c6b07), - SPH_C32(0xf20de82b), SPH_C32(0x4c230010), SPH_C32(0x6333b636), - SPH_C32(0x095c8247), SPH_C32(0xd7bb41f9) }, - { SPH_C32(0x4a6e00c0), SPH_C32(0xb7ee3980), SPH_C32(0x8d080a04), - SPH_C32(0xb3e8a94e), SPH_C32(0xbfc70020), SPH_C32(0xa227213b), - SPH_C32(0x0c75e841), SPH_C32(0x4443b158) }, - { SPH_C32(0x1b3200d0), SPH_C32(0xf71d4b7b), SPH_C32(0x71ef2c06), - SPH_C32(0xc2bff92f), SPH_C32(0x91fe0020), SPH_C32(0xc6fa47b2), - SPH_C32(0x30a1eebd), SPH_C32(0xf5b721e4) }, - { SPH_C32(0x645700c0), SPH_C32(0xd3335f09), SPH_C32(0xb1dc0cf8), - SPH_C32(0x021c39f2), SPH_C32(0xc0a20030), SPH_C32(0x86093549), - SPH_C32(0xcc46c8bf), SPH_C32(0x84e07185) }, - { SPH_C32(0x350b00d0), SPH_C32(0x93c02df2), SPH_C32(0x4d3b2afa), - SPH_C32(0x734b6993), SPH_C32(0xee9b0030), SPH_C32(0xe2d453c0), - SPH_C32(0xf092ce43), SPH_C32(0x3514e139) }, - { SPH_C32(0xe8d600e0), SPH_C32(0x3609dc76), SPH_C32(0x74c64600), - SPH_C32(0x5147098e), SPH_C32(0xe3b50020), SPH_C32(0x6b9dec29), - SPH_C32(0x75dce5b8), SPH_C32(0x27aa9020) }, - { SPH_C32(0xb98a00f0), SPH_C32(0x76faae8d), SPH_C32(0x88216002), - SPH_C32(0x201059ef), SPH_C32(0xcd8c0020), SPH_C32(0x0f408aa0), - SPH_C32(0x4908e344), SPH_C32(0x965e009c) }, - { SPH_C32(0xc6ef00e0), SPH_C32(0x52d4baff), SPH_C32(0x481240fc), - SPH_C32(0xe0b39932), SPH_C32(0x9cd00030), SPH_C32(0x4fb3f85b), - SPH_C32(0xb5efc546), SPH_C32(0xe70950fd) }, - { SPH_C32(0x97b300f0), SPH_C32(0x1227c804), SPH_C32(0xb4f566fe), - SPH_C32(0x91e4c953), SPH_C32(0xb2e90030), SPH_C32(0x2b6e9ed2), - SPH_C32(0x893bc3ba), SPH_C32(0x56fdc041) }, - { SPH_C32(0x23790080), SPH_C32(0xe5c242d8), SPH_C32(0x9f98cca2), - SPH_C32(0x811536f8), SPH_C32(0x0cc30040), SPH_C32(0xd121e5a1), - SPH_C32(0xba77c214), SPH_C32(0xe6660ae5) }, - { SPH_C32(0x72250090), SPH_C32(0xa5313023), SPH_C32(0x637feaa0), - SPH_C32(0xf0426699), SPH_C32(0x22fa0040), SPH_C32(0xb5fc8328), - SPH_C32(0x86a3c4e8), SPH_C32(0x57929a59) }, - { SPH_C32(0x0d400080), SPH_C32(0x811f2451), SPH_C32(0xa34cca5e), - SPH_C32(0x30e1a644), SPH_C32(0x73a60050), SPH_C32(0xf50ff1d3), - SPH_C32(0x7a44e2ea), SPH_C32(0x26c5ca38) }, - { SPH_C32(0x5c1c0090), SPH_C32(0xc1ec56aa), SPH_C32(0x5fabec5c), - SPH_C32(0x41b6f625), SPH_C32(0x5d9f0050), SPH_C32(0x91d2975a), - SPH_C32(0x4690e416), SPH_C32(0x97315a84) }, - { SPH_C32(0x81c100a0), SPH_C32(0x6425a72e), SPH_C32(0x665680a6), - SPH_C32(0x63ba9638), SPH_C32(0x50b10040), SPH_C32(0x189b28b3), - SPH_C32(0xc3decfed), SPH_C32(0x858f2b9d) }, - { SPH_C32(0xd09d00b0), SPH_C32(0x24d6d5d5), SPH_C32(0x9ab1a6a4), - SPH_C32(0x12edc659), SPH_C32(0x7e880040), SPH_C32(0x7c464e3a), - SPH_C32(0xff0ac911), SPH_C32(0x347bbb21) }, - { SPH_C32(0xaff800a0), SPH_C32(0x00f8c1a7), SPH_C32(0x5a82865a), - SPH_C32(0xd24e0684), SPH_C32(0x2fd40050), SPH_C32(0x3cb53cc1), - SPH_C32(0x03edef13), SPH_C32(0x452ceb40) }, - { SPH_C32(0xfea400b0), SPH_C32(0x400bb35c), SPH_C32(0xa665a058), - SPH_C32(0xa31956e5), SPH_C32(0x01ed0050), SPH_C32(0x58685a48), - SPH_C32(0x3f39e9ef), SPH_C32(0xf4d87bfc) }, - { SPH_C32(0x7f0b0080), SPH_C32(0x2c788fca), SPH_C32(0xe631c15b), - SPH_C32(0xe2fc1780), SPH_C32(0xf2090060), SPH_C32(0x997ccd45), - SPH_C32(0x3a1083e9), SPH_C32(0x67208b5d) }, - { SPH_C32(0x2e570090), SPH_C32(0x6c8bfd31), SPH_C32(0x1ad6e759), - SPH_C32(0x93ab47e1), SPH_C32(0xdc300060), SPH_C32(0xfda1abcc), - SPH_C32(0x06c48515), SPH_C32(0xd6d41be1) }, - { SPH_C32(0x51320080), SPH_C32(0x48a5e943), SPH_C32(0xdae5c7a7), - SPH_C32(0x5308873c), SPH_C32(0x8d6c0070), SPH_C32(0xbd52d937), - SPH_C32(0xfa23a317), SPH_C32(0xa7834b80) }, - { SPH_C32(0x006e0090), SPH_C32(0x08569bb8), SPH_C32(0x2602e1a5), - SPH_C32(0x225fd75d), SPH_C32(0xa3550070), SPH_C32(0xd98fbfbe), - SPH_C32(0xc6f7a5eb), SPH_C32(0x1677db3c) }, - { SPH_C32(0xddb300a0), SPH_C32(0xad9f6a3c), SPH_C32(0x1fff8d5f), - SPH_C32(0x0053b740), SPH_C32(0xae7b0060), SPH_C32(0x50c60057), - SPH_C32(0x43b98e10), SPH_C32(0x04c9aa25) }, - { SPH_C32(0x8cef00b0), SPH_C32(0xed6c18c7), SPH_C32(0xe318ab5d), - SPH_C32(0x7104e721), SPH_C32(0x80420060), SPH_C32(0x341b66de), - SPH_C32(0x7f6d88ec), SPH_C32(0xb53d3a99) }, - { SPH_C32(0xf38a00a0), SPH_C32(0xc9420cb5), SPH_C32(0x232b8ba3), - SPH_C32(0xb1a727fc), SPH_C32(0xd11e0070), SPH_C32(0x74e81425), - SPH_C32(0x838aaeee), SPH_C32(0xc46a6af8) }, - { SPH_C32(0xa2d600b0), SPH_C32(0x89b17e4e), SPH_C32(0xdfccada1), - SPH_C32(0xc0f0779d), SPH_C32(0xff270070), SPH_C32(0x103572ac), - SPH_C32(0xbf5ea812), SPH_C32(0x759efa44) }, - { SPH_C32(0x6eb700c0), SPH_C32(0xde99aea6), SPH_C32(0xa9fda70a), - SPH_C32(0xa2760cfd), SPH_C32(0x74680040), SPH_C32(0x71ecbf95), - SPH_C32(0xe72b62e3), SPH_C32(0x94118e2e) }, - { SPH_C32(0x3feb00d0), SPH_C32(0x9e6adc5d), SPH_C32(0x551a8108), - SPH_C32(0xd3215c9c), SPH_C32(0x5a510040), SPH_C32(0x1531d91c), - SPH_C32(0xdbff641f), SPH_C32(0x25e51e92) }, - { SPH_C32(0x408e00c0), SPH_C32(0xba44c82f), SPH_C32(0x9529a1f6), - SPH_C32(0x13829c41), SPH_C32(0x0b0d0050), SPH_C32(0x55c2abe7), - SPH_C32(0x2718421d), SPH_C32(0x54b24ef3) }, - { SPH_C32(0x11d200d0), SPH_C32(0xfab7bad4), SPH_C32(0x69ce87f4), - SPH_C32(0x62d5cc20), SPH_C32(0x25340050), SPH_C32(0x311fcd6e), - SPH_C32(0x1bcc44e1), SPH_C32(0xe546de4f) }, - { SPH_C32(0xcc0f00e0), SPH_C32(0x5f7e4b50), SPH_C32(0x5033eb0e), - SPH_C32(0x40d9ac3d), SPH_C32(0x281a0040), SPH_C32(0xb8567287), - SPH_C32(0x9e826f1a), SPH_C32(0xf7f8af56) }, - { SPH_C32(0x9d5300f0), SPH_C32(0x1f8d39ab), SPH_C32(0xacd4cd0c), - SPH_C32(0x318efc5c), SPH_C32(0x06230040), SPH_C32(0xdc8b140e), - SPH_C32(0xa25669e6), SPH_C32(0x460c3fea) }, - { SPH_C32(0xe23600e0), SPH_C32(0x3ba32dd9), SPH_C32(0x6ce7edf2), - SPH_C32(0xf12d3c81), SPH_C32(0x577f0050), SPH_C32(0x9c7866f5), - SPH_C32(0x5eb14fe4), SPH_C32(0x375b6f8b) }, - { SPH_C32(0xb36a00f0), SPH_C32(0x7b505f22), SPH_C32(0x9000cbf0), - SPH_C32(0x807a6ce0), SPH_C32(0x79460050), SPH_C32(0xf8a5007c), - SPH_C32(0x62654918), SPH_C32(0x86afff37) }, - { SPH_C32(0x32c500c0), SPH_C32(0x172363b4), SPH_C32(0xd054aaf3), - SPH_C32(0xc19f2d85), SPH_C32(0x8aa20060), SPH_C32(0x39b19771), - SPH_C32(0x674c231e), SPH_C32(0x15570f96) }, - { SPH_C32(0x639900d0), SPH_C32(0x57d0114f), SPH_C32(0x2cb38cf1), - SPH_C32(0xb0c87de4), SPH_C32(0xa49b0060), SPH_C32(0x5d6cf1f8), - SPH_C32(0x5b9825e2), SPH_C32(0xa4a39f2a) }, - { SPH_C32(0x1cfc00c0), SPH_C32(0x73fe053d), SPH_C32(0xec80ac0f), - SPH_C32(0x706bbd39), SPH_C32(0xf5c70070), SPH_C32(0x1d9f8303), - SPH_C32(0xa77f03e0), SPH_C32(0xd5f4cf4b) }, - { SPH_C32(0x4da000d0), SPH_C32(0x330d77c6), SPH_C32(0x10678a0d), - SPH_C32(0x013ced58), SPH_C32(0xdbfe0070), SPH_C32(0x7942e58a), - SPH_C32(0x9bab051c), SPH_C32(0x64005ff7) }, - { SPH_C32(0x907d00e0), SPH_C32(0x96c48642), SPH_C32(0x299ae6f7), - SPH_C32(0x23308d45), SPH_C32(0xd6d00060), SPH_C32(0xf00b5a63), - SPH_C32(0x1ee52ee7), SPH_C32(0x76be2eee) }, - { SPH_C32(0xc12100f0), SPH_C32(0xd637f4b9), SPH_C32(0xd57dc0f5), - SPH_C32(0x5267dd24), SPH_C32(0xf8e90060), SPH_C32(0x94d63cea), - SPH_C32(0x2231281b), SPH_C32(0xc74abe52) }, - { SPH_C32(0xbe4400e0), SPH_C32(0xf219e0cb), SPH_C32(0x154ee00b), - SPH_C32(0x92c41df9), SPH_C32(0xa9b50070), SPH_C32(0xd4254e11), - SPH_C32(0xded60e19), SPH_C32(0xb61dee33) }, - { SPH_C32(0xef1800f0), SPH_C32(0xb2ea9230), SPH_C32(0xe9a9c609), - SPH_C32(0xe3934d98), SPH_C32(0x878c0070), SPH_C32(0xb0f82898), - SPH_C32(0xe20208e5), SPH_C32(0x07e97e8f) }, - { SPH_C32(0x39a60000), SPH_C32(0x4ab753eb), SPH_C32(0xd14e094b), - SPH_C32(0xb772b42b), SPH_C32(0x62740080), SPH_C32(0x0fb84b07), - SPH_C32(0x138a651e), SPH_C32(0x44100618) }, - { SPH_C32(0x68fa0010), SPH_C32(0x0a442110), SPH_C32(0x2da92f49), - SPH_C32(0xc625e44a), SPH_C32(0x4c4d0080), SPH_C32(0x6b652d8e), - SPH_C32(0x2f5e63e2), SPH_C32(0xf5e496a4) }, - { SPH_C32(0x179f0000), SPH_C32(0x2e6a3562), SPH_C32(0xed9a0fb7), - SPH_C32(0x06862497), SPH_C32(0x1d110090), SPH_C32(0x2b965f75), - SPH_C32(0xd3b945e0), SPH_C32(0x84b3c6c5) }, - { SPH_C32(0x46c30010), SPH_C32(0x6e994799), SPH_C32(0x117d29b5), - SPH_C32(0x77d174f6), SPH_C32(0x33280090), SPH_C32(0x4f4b39fc), - SPH_C32(0xef6d431c), SPH_C32(0x35475679) }, - { SPH_C32(0x9b1e0020), SPH_C32(0xcb50b61d), SPH_C32(0x2880454f), - SPH_C32(0x55dd14eb), SPH_C32(0x3e060080), SPH_C32(0xc6028615), - SPH_C32(0x6a2368e7), SPH_C32(0x27f92760) }, - { SPH_C32(0xca420030), SPH_C32(0x8ba3c4e6), SPH_C32(0xd467634d), - SPH_C32(0x248a448a), SPH_C32(0x103f0080), SPH_C32(0xa2dfe09c), - SPH_C32(0x56f76e1b), SPH_C32(0x960db7dc) }, - { SPH_C32(0xb5270020), SPH_C32(0xaf8dd094), SPH_C32(0x145443b3), - SPH_C32(0xe4298457), SPH_C32(0x41630090), SPH_C32(0xe22c9267), - SPH_C32(0xaa104819), SPH_C32(0xe75ae7bd) }, - { SPH_C32(0xe47b0030), SPH_C32(0xef7ea26f), SPH_C32(0xe8b365b1), - SPH_C32(0x957ed436), SPH_C32(0x6f5a0090), SPH_C32(0x86f1f4ee), - SPH_C32(0x96c44ee5), SPH_C32(0x56ae7701) }, - { SPH_C32(0x65d40000), SPH_C32(0x830d9ef9), SPH_C32(0xa8e704b2), - SPH_C32(0xd49b9553), SPH_C32(0x9cbe00a0), SPH_C32(0x47e563e3), - SPH_C32(0x93ed24e3), SPH_C32(0xc55687a0) }, - { SPH_C32(0x34880010), SPH_C32(0xc3feec02), SPH_C32(0x540022b0), - SPH_C32(0xa5ccc532), SPH_C32(0xb28700a0), SPH_C32(0x2338056a), - SPH_C32(0xaf39221f), SPH_C32(0x74a2171c) }, - { SPH_C32(0x4bed0000), SPH_C32(0xe7d0f870), SPH_C32(0x9433024e), - SPH_C32(0x656f05ef), SPH_C32(0xe3db00b0), SPH_C32(0x63cb7791), - SPH_C32(0x53de041d), SPH_C32(0x05f5477d) }, - { SPH_C32(0x1ab10010), SPH_C32(0xa7238a8b), SPH_C32(0x68d4244c), - SPH_C32(0x1438558e), SPH_C32(0xcde200b0), SPH_C32(0x07161118), - SPH_C32(0x6f0a02e1), SPH_C32(0xb401d7c1) }, - { SPH_C32(0xc76c0020), SPH_C32(0x02ea7b0f), SPH_C32(0x512948b6), - SPH_C32(0x36343593), SPH_C32(0xc0cc00a0), SPH_C32(0x8e5faef1), - SPH_C32(0xea44291a), SPH_C32(0xa6bfa6d8) }, - { SPH_C32(0x96300030), SPH_C32(0x421909f4), SPH_C32(0xadce6eb4), - SPH_C32(0x476365f2), SPH_C32(0xeef500a0), SPH_C32(0xea82c878), - SPH_C32(0xd6902fe6), SPH_C32(0x174b3664) }, - { SPH_C32(0xe9550020), SPH_C32(0x66371d86), SPH_C32(0x6dfd4e4a), - SPH_C32(0x87c0a52f), SPH_C32(0xbfa900b0), SPH_C32(0xaa71ba83), - SPH_C32(0x2a7709e4), SPH_C32(0x661c6605) }, - { SPH_C32(0xb8090030), SPH_C32(0x26c46f7d), SPH_C32(0x911a6848), - SPH_C32(0xf697f54e), SPH_C32(0x919000b0), SPH_C32(0xceacdc0a), - SPH_C32(0x16a30f18), SPH_C32(0xd7e8f6b9) }, - { SPH_C32(0x74680040), SPH_C32(0x71ecbf95), SPH_C32(0xe72b62e3), - SPH_C32(0x94118e2e), SPH_C32(0x1adf0080), SPH_C32(0xaf751133), - SPH_C32(0x4ed6c5e9), SPH_C32(0x366782d3) }, - { SPH_C32(0x25340050), SPH_C32(0x311fcd6e), SPH_C32(0x1bcc44e1), - SPH_C32(0xe546de4f), SPH_C32(0x34e60080), SPH_C32(0xcba877ba), - SPH_C32(0x7202c315), SPH_C32(0x8793126f) }, - { SPH_C32(0x5a510040), SPH_C32(0x1531d91c), SPH_C32(0xdbff641f), - SPH_C32(0x25e51e92), SPH_C32(0x65ba0090), SPH_C32(0x8b5b0541), - SPH_C32(0x8ee5e517), SPH_C32(0xf6c4420e) }, - { SPH_C32(0x0b0d0050), SPH_C32(0x55c2abe7), SPH_C32(0x2718421d), - SPH_C32(0x54b24ef3), SPH_C32(0x4b830090), SPH_C32(0xef8663c8), - SPH_C32(0xb231e3eb), SPH_C32(0x4730d2b2) }, - { SPH_C32(0xd6d00060), SPH_C32(0xf00b5a63), SPH_C32(0x1ee52ee7), - SPH_C32(0x76be2eee), SPH_C32(0x46ad0080), SPH_C32(0x66cfdc21), - SPH_C32(0x377fc810), SPH_C32(0x558ea3ab) }, - { SPH_C32(0x878c0070), SPH_C32(0xb0f82898), SPH_C32(0xe20208e5), - SPH_C32(0x07e97e8f), SPH_C32(0x68940080), SPH_C32(0x0212baa8), - SPH_C32(0x0babceec), SPH_C32(0xe47a3317) }, - { SPH_C32(0xf8e90060), SPH_C32(0x94d63cea), SPH_C32(0x2231281b), - SPH_C32(0xc74abe52), SPH_C32(0x39c80090), SPH_C32(0x42e1c853), - SPH_C32(0xf74ce8ee), SPH_C32(0x952d6376) }, - { SPH_C32(0xa9b50070), SPH_C32(0xd4254e11), SPH_C32(0xded60e19), - SPH_C32(0xb61dee33), SPH_C32(0x17f10090), SPH_C32(0x263caeda), - SPH_C32(0xcb98ee12), SPH_C32(0x24d9f3ca) }, - { SPH_C32(0x281a0040), SPH_C32(0xb8567287), SPH_C32(0x9e826f1a), - SPH_C32(0xf7f8af56), SPH_C32(0xe41500a0), SPH_C32(0xe72839d7), - SPH_C32(0xceb18414), SPH_C32(0xb721036b) }, - { SPH_C32(0x79460050), SPH_C32(0xf8a5007c), SPH_C32(0x62654918), - SPH_C32(0x86afff37), SPH_C32(0xca2c00a0), SPH_C32(0x83f55f5e), - SPH_C32(0xf26582e8), SPH_C32(0x06d593d7) }, - { SPH_C32(0x06230040), SPH_C32(0xdc8b140e), SPH_C32(0xa25669e6), - SPH_C32(0x460c3fea), SPH_C32(0x9b7000b0), SPH_C32(0xc3062da5), - SPH_C32(0x0e82a4ea), SPH_C32(0x7782c3b6) }, - { SPH_C32(0x577f0050), SPH_C32(0x9c7866f5), SPH_C32(0x5eb14fe4), - SPH_C32(0x375b6f8b), SPH_C32(0xb54900b0), SPH_C32(0xa7db4b2c), - SPH_C32(0x3256a216), SPH_C32(0xc676530a) }, - { SPH_C32(0x8aa20060), SPH_C32(0x39b19771), SPH_C32(0x674c231e), - SPH_C32(0x15570f96), SPH_C32(0xb86700a0), SPH_C32(0x2e92f4c5), - SPH_C32(0xb71889ed), SPH_C32(0xd4c82213) }, - { SPH_C32(0xdbfe0070), SPH_C32(0x7942e58a), SPH_C32(0x9bab051c), - SPH_C32(0x64005ff7), SPH_C32(0x965e00a0), SPH_C32(0x4a4f924c), - SPH_C32(0x8bcc8f11), SPH_C32(0x653cb2af) }, - { SPH_C32(0xa49b0060), SPH_C32(0x5d6cf1f8), SPH_C32(0x5b9825e2), - SPH_C32(0xa4a39f2a), SPH_C32(0xc70200b0), SPH_C32(0x0abce0b7), - SPH_C32(0x772ba913), SPH_C32(0x146be2ce) }, - { SPH_C32(0xf5c70070), SPH_C32(0x1d9f8303), SPH_C32(0xa77f03e0), - SPH_C32(0xd5f4cf4b), SPH_C32(0xe93b00b0), SPH_C32(0x6e61863e), - SPH_C32(0x4bffafef), SPH_C32(0xa59f7272) }, - { SPH_C32(0x410d0000), SPH_C32(0xea7a09df), SPH_C32(0x8c12a9bc), - SPH_C32(0xc50530e0), SPH_C32(0x571100c0), SPH_C32(0x942efd4d), - SPH_C32(0x78b3ae41), SPH_C32(0x1504b8d6) }, - { SPH_C32(0x10510010), SPH_C32(0xaa897b24), SPH_C32(0x70f58fbe), - SPH_C32(0xb4526081), SPH_C32(0x792800c0), SPH_C32(0xf0f39bc4), - SPH_C32(0x4467a8bd), SPH_C32(0xa4f0286a) }, - { SPH_C32(0x6f340000), SPH_C32(0x8ea76f56), SPH_C32(0xb0c6af40), - SPH_C32(0x74f1a05c), SPH_C32(0x287400d0), SPH_C32(0xb000e93f), - SPH_C32(0xb8808ebf), SPH_C32(0xd5a7780b) }, - { SPH_C32(0x3e680010), SPH_C32(0xce541dad), SPH_C32(0x4c218942), - SPH_C32(0x05a6f03d), SPH_C32(0x064d00d0), SPH_C32(0xd4dd8fb6), - SPH_C32(0x84548843), SPH_C32(0x6453e8b7) }, - { SPH_C32(0xe3b50020), SPH_C32(0x6b9dec29), SPH_C32(0x75dce5b8), - SPH_C32(0x27aa9020), SPH_C32(0x0b6300c0), SPH_C32(0x5d94305f), - SPH_C32(0x011aa3b8), SPH_C32(0x76ed99ae) }, - { SPH_C32(0xb2e90030), SPH_C32(0x2b6e9ed2), SPH_C32(0x893bc3ba), - SPH_C32(0x56fdc041), SPH_C32(0x255a00c0), SPH_C32(0x394956d6), - SPH_C32(0x3dcea544), SPH_C32(0xc7190912) }, - { SPH_C32(0xcd8c0020), SPH_C32(0x0f408aa0), SPH_C32(0x4908e344), - SPH_C32(0x965e009c), SPH_C32(0x740600d0), SPH_C32(0x79ba242d), - SPH_C32(0xc1298346), SPH_C32(0xb64e5973) }, - { SPH_C32(0x9cd00030), SPH_C32(0x4fb3f85b), SPH_C32(0xb5efc546), - SPH_C32(0xe70950fd), SPH_C32(0x5a3f00d0), SPH_C32(0x1d6742a4), - SPH_C32(0xfdfd85ba), SPH_C32(0x07bac9cf) }, - { SPH_C32(0x1d7f0000), SPH_C32(0x23c0c4cd), SPH_C32(0xf5bba445), - SPH_C32(0xa6ec1198), SPH_C32(0xa9db00e0), SPH_C32(0xdc73d5a9), - SPH_C32(0xf8d4efbc), SPH_C32(0x9442396e) }, - { SPH_C32(0x4c230010), SPH_C32(0x6333b636), SPH_C32(0x095c8247), - SPH_C32(0xd7bb41f9), SPH_C32(0x87e200e0), SPH_C32(0xb8aeb320), - SPH_C32(0xc400e940), SPH_C32(0x25b6a9d2) }, - { SPH_C32(0x33460000), SPH_C32(0x471da244), SPH_C32(0xc96fa2b9), - SPH_C32(0x17188124), SPH_C32(0xd6be00f0), SPH_C32(0xf85dc1db), - SPH_C32(0x38e7cf42), SPH_C32(0x54e1f9b3) }, - { SPH_C32(0x621a0010), SPH_C32(0x07eed0bf), SPH_C32(0x358884bb), - SPH_C32(0x664fd145), SPH_C32(0xf88700f0), SPH_C32(0x9c80a752), - SPH_C32(0x0433c9be), SPH_C32(0xe515690f) }, - { SPH_C32(0xbfc70020), SPH_C32(0xa227213b), SPH_C32(0x0c75e841), - SPH_C32(0x4443b158), SPH_C32(0xf5a900e0), SPH_C32(0x15c918bb), - SPH_C32(0x817de245), SPH_C32(0xf7ab1816) }, - { SPH_C32(0xee9b0030), SPH_C32(0xe2d453c0), SPH_C32(0xf092ce43), - SPH_C32(0x3514e139), SPH_C32(0xdb9000e0), SPH_C32(0x71147e32), - SPH_C32(0xbda9e4b9), SPH_C32(0x465f88aa) }, - { SPH_C32(0x91fe0020), SPH_C32(0xc6fa47b2), SPH_C32(0x30a1eebd), - SPH_C32(0xf5b721e4), SPH_C32(0x8acc00f0), SPH_C32(0x31e70cc9), - SPH_C32(0x414ec2bb), SPH_C32(0x3708d8cb) }, - { SPH_C32(0xc0a20030), SPH_C32(0x86093549), SPH_C32(0xcc46c8bf), - SPH_C32(0x84e07185), SPH_C32(0xa4f500f0), SPH_C32(0x553a6a40), - SPH_C32(0x7d9ac447), SPH_C32(0x86fc4877) }, - { SPH_C32(0x0cc30040), SPH_C32(0xd121e5a1), SPH_C32(0xba77c214), - SPH_C32(0xe6660ae5), SPH_C32(0x2fba00c0), SPH_C32(0x34e3a779), - SPH_C32(0x25ef0eb6), SPH_C32(0x67733c1d) }, - { SPH_C32(0x5d9f0050), SPH_C32(0x91d2975a), SPH_C32(0x4690e416), - SPH_C32(0x97315a84), SPH_C32(0x018300c0), SPH_C32(0x503ec1f0), - SPH_C32(0x193b084a), SPH_C32(0xd687aca1) }, - { SPH_C32(0x22fa0040), SPH_C32(0xb5fc8328), SPH_C32(0x86a3c4e8), - SPH_C32(0x57929a59), SPH_C32(0x50df00d0), SPH_C32(0x10cdb30b), - SPH_C32(0xe5dc2e48), SPH_C32(0xa7d0fcc0) }, - { SPH_C32(0x73a60050), SPH_C32(0xf50ff1d3), SPH_C32(0x7a44e2ea), - SPH_C32(0x26c5ca38), SPH_C32(0x7ee600d0), SPH_C32(0x7410d582), - SPH_C32(0xd90828b4), SPH_C32(0x16246c7c) }, - { SPH_C32(0xae7b0060), SPH_C32(0x50c60057), SPH_C32(0x43b98e10), - SPH_C32(0x04c9aa25), SPH_C32(0x73c800c0), SPH_C32(0xfd596a6b), - SPH_C32(0x5c46034f), SPH_C32(0x049a1d65) }, - { SPH_C32(0xff270070), SPH_C32(0x103572ac), SPH_C32(0xbf5ea812), - SPH_C32(0x759efa44), SPH_C32(0x5df100c0), SPH_C32(0x99840ce2), - SPH_C32(0x609205b3), SPH_C32(0xb56e8dd9) }, - { SPH_C32(0x80420060), SPH_C32(0x341b66de), SPH_C32(0x7f6d88ec), - SPH_C32(0xb53d3a99), SPH_C32(0x0cad00d0), SPH_C32(0xd9777e19), - SPH_C32(0x9c7523b1), SPH_C32(0xc439ddb8) }, - { SPH_C32(0xd11e0070), SPH_C32(0x74e81425), SPH_C32(0x838aaeee), - SPH_C32(0xc46a6af8), SPH_C32(0x229400d0), SPH_C32(0xbdaa1890), - SPH_C32(0xa0a1254d), SPH_C32(0x75cd4d04) }, - { SPH_C32(0x50b10040), SPH_C32(0x189b28b3), SPH_C32(0xc3decfed), - SPH_C32(0x858f2b9d), SPH_C32(0xd17000e0), SPH_C32(0x7cbe8f9d), - SPH_C32(0xa5884f4b), SPH_C32(0xe635bda5) }, - { SPH_C32(0x01ed0050), SPH_C32(0x58685a48), SPH_C32(0x3f39e9ef), - SPH_C32(0xf4d87bfc), SPH_C32(0xff4900e0), SPH_C32(0x1863e914), - SPH_C32(0x995c49b7), SPH_C32(0x57c12d19) }, - { SPH_C32(0x7e880040), SPH_C32(0x7c464e3a), SPH_C32(0xff0ac911), - SPH_C32(0x347bbb21), SPH_C32(0xae1500f0), SPH_C32(0x58909bef), - SPH_C32(0x65bb6fb5), SPH_C32(0x26967d78) }, - { SPH_C32(0x2fd40050), SPH_C32(0x3cb53cc1), SPH_C32(0x03edef13), - SPH_C32(0x452ceb40), SPH_C32(0x802c00f0), SPH_C32(0x3c4dfd66), - SPH_C32(0x596f6949), SPH_C32(0x9762edc4) }, - { SPH_C32(0xf2090060), SPH_C32(0x997ccd45), SPH_C32(0x3a1083e9), - SPH_C32(0x67208b5d), SPH_C32(0x8d0200e0), SPH_C32(0xb504428f), - SPH_C32(0xdc2142b2), SPH_C32(0x85dc9cdd) }, - { SPH_C32(0xa3550070), SPH_C32(0xd98fbfbe), SPH_C32(0xc6f7a5eb), - SPH_C32(0x1677db3c), SPH_C32(0xa33b00e0), SPH_C32(0xd1d92406), - SPH_C32(0xe0f5444e), SPH_C32(0x34280c61) }, - { SPH_C32(0xdc300060), SPH_C32(0xfda1abcc), SPH_C32(0x06c48515), - SPH_C32(0xd6d41be1), SPH_C32(0xf26700f0), SPH_C32(0x912a56fd), - SPH_C32(0x1c12624c), SPH_C32(0x457f5c00) }, - { SPH_C32(0x8d6c0070), SPH_C32(0xbd52d937), SPH_C32(0xfa23a317), - SPH_C32(0xa7834b80), SPH_C32(0xdc5e00f0), SPH_C32(0xf5f73074), - SPH_C32(0x20c664b0), SPH_C32(0xf48bccbc) }, - { SPH_C32(0x62740080), SPH_C32(0x0fb84b07), SPH_C32(0x138a651e), - SPH_C32(0x44100618), SPH_C32(0x5bd20080), SPH_C32(0x450f18ec), - SPH_C32(0xc2c46c55), SPH_C32(0xf362b233) }, - { SPH_C32(0x33280090), SPH_C32(0x4f4b39fc), SPH_C32(0xef6d431c), - SPH_C32(0x35475679), SPH_C32(0x75eb0080), SPH_C32(0x21d27e65), - SPH_C32(0xfe106aa9), SPH_C32(0x4296228f) }, - { SPH_C32(0x4c4d0080), SPH_C32(0x6b652d8e), SPH_C32(0x2f5e63e2), - SPH_C32(0xf5e496a4), SPH_C32(0x24b70090), SPH_C32(0x61210c9e), - SPH_C32(0x02f74cab), SPH_C32(0x33c172ee) }, - { SPH_C32(0x1d110090), SPH_C32(0x2b965f75), SPH_C32(0xd3b945e0), - SPH_C32(0x84b3c6c5), SPH_C32(0x0a8e0090), SPH_C32(0x05fc6a17), - SPH_C32(0x3e234a57), SPH_C32(0x8235e252) }, - { SPH_C32(0xc0cc00a0), SPH_C32(0x8e5faef1), SPH_C32(0xea44291a), - SPH_C32(0xa6bfa6d8), SPH_C32(0x07a00080), SPH_C32(0x8cb5d5fe), - SPH_C32(0xbb6d61ac), SPH_C32(0x908b934b) }, - { SPH_C32(0x919000b0), SPH_C32(0xceacdc0a), SPH_C32(0x16a30f18), - SPH_C32(0xd7e8f6b9), SPH_C32(0x29990080), SPH_C32(0xe868b377), - SPH_C32(0x87b96750), SPH_C32(0x217f03f7) }, - { SPH_C32(0xeef500a0), SPH_C32(0xea82c878), SPH_C32(0xd6902fe6), - SPH_C32(0x174b3664), SPH_C32(0x78c50090), SPH_C32(0xa89bc18c), - SPH_C32(0x7b5e4152), SPH_C32(0x50285396) }, - { SPH_C32(0xbfa900b0), SPH_C32(0xaa71ba83), SPH_C32(0x2a7709e4), - SPH_C32(0x661c6605), SPH_C32(0x56fc0090), SPH_C32(0xcc46a705), - SPH_C32(0x478a47ae), SPH_C32(0xe1dcc32a) }, - { SPH_C32(0x3e060080), SPH_C32(0xc6028615), SPH_C32(0x6a2368e7), - SPH_C32(0x27f92760), SPH_C32(0xa51800a0), SPH_C32(0x0d523008), - SPH_C32(0x42a32da8), SPH_C32(0x7224338b) }, - { SPH_C32(0x6f5a0090), SPH_C32(0x86f1f4ee), SPH_C32(0x96c44ee5), - SPH_C32(0x56ae7701), SPH_C32(0x8b2100a0), SPH_C32(0x698f5681), - SPH_C32(0x7e772b54), SPH_C32(0xc3d0a337) }, - { SPH_C32(0x103f0080), SPH_C32(0xa2dfe09c), SPH_C32(0x56f76e1b), - SPH_C32(0x960db7dc), SPH_C32(0xda7d00b0), SPH_C32(0x297c247a), - SPH_C32(0x82900d56), SPH_C32(0xb287f356) }, - { SPH_C32(0x41630090), SPH_C32(0xe22c9267), SPH_C32(0xaa104819), - SPH_C32(0xe75ae7bd), SPH_C32(0xf44400b0), SPH_C32(0x4da142f3), - SPH_C32(0xbe440baa), SPH_C32(0x037363ea) }, - { SPH_C32(0x9cbe00a0), SPH_C32(0x47e563e3), SPH_C32(0x93ed24e3), - SPH_C32(0xc55687a0), SPH_C32(0xf96a00a0), SPH_C32(0xc4e8fd1a), - SPH_C32(0x3b0a2051), SPH_C32(0x11cd12f3) }, - { SPH_C32(0xcde200b0), SPH_C32(0x07161118), SPH_C32(0x6f0a02e1), - SPH_C32(0xb401d7c1), SPH_C32(0xd75300a0), SPH_C32(0xa0359b93), - SPH_C32(0x07de26ad), SPH_C32(0xa039824f) }, - { SPH_C32(0xb28700a0), SPH_C32(0x2338056a), SPH_C32(0xaf39221f), - SPH_C32(0x74a2171c), SPH_C32(0x860f00b0), SPH_C32(0xe0c6e968), - SPH_C32(0xfb3900af), SPH_C32(0xd16ed22e) }, - { SPH_C32(0xe3db00b0), SPH_C32(0x63cb7791), SPH_C32(0x53de041d), - SPH_C32(0x05f5477d), SPH_C32(0xa83600b0), SPH_C32(0x841b8fe1), - SPH_C32(0xc7ed0653), SPH_C32(0x609a4292) }, - { SPH_C32(0x2fba00c0), SPH_C32(0x34e3a779), SPH_C32(0x25ef0eb6), - SPH_C32(0x67733c1d), SPH_C32(0x23790080), SPH_C32(0xe5c242d8), - SPH_C32(0x9f98cca2), SPH_C32(0x811536f8) }, - { SPH_C32(0x7ee600d0), SPH_C32(0x7410d582), SPH_C32(0xd90828b4), - SPH_C32(0x16246c7c), SPH_C32(0x0d400080), SPH_C32(0x811f2451), - SPH_C32(0xa34cca5e), SPH_C32(0x30e1a644) }, - { SPH_C32(0x018300c0), SPH_C32(0x503ec1f0), SPH_C32(0x193b084a), - SPH_C32(0xd687aca1), SPH_C32(0x5c1c0090), SPH_C32(0xc1ec56aa), - SPH_C32(0x5fabec5c), SPH_C32(0x41b6f625) }, - { SPH_C32(0x50df00d0), SPH_C32(0x10cdb30b), SPH_C32(0xe5dc2e48), - SPH_C32(0xa7d0fcc0), SPH_C32(0x72250090), SPH_C32(0xa5313023), - SPH_C32(0x637feaa0), SPH_C32(0xf0426699) }, - { SPH_C32(0x8d0200e0), SPH_C32(0xb504428f), SPH_C32(0xdc2142b2), - SPH_C32(0x85dc9cdd), SPH_C32(0x7f0b0080), SPH_C32(0x2c788fca), - SPH_C32(0xe631c15b), SPH_C32(0xe2fc1780) }, - { SPH_C32(0xdc5e00f0), SPH_C32(0xf5f73074), SPH_C32(0x20c664b0), - SPH_C32(0xf48bccbc), SPH_C32(0x51320080), SPH_C32(0x48a5e943), - SPH_C32(0xdae5c7a7), SPH_C32(0x5308873c) }, - { SPH_C32(0xa33b00e0), SPH_C32(0xd1d92406), SPH_C32(0xe0f5444e), - SPH_C32(0x34280c61), SPH_C32(0x006e0090), SPH_C32(0x08569bb8), - SPH_C32(0x2602e1a5), SPH_C32(0x225fd75d) }, - { SPH_C32(0xf26700f0), SPH_C32(0x912a56fd), SPH_C32(0x1c12624c), - SPH_C32(0x457f5c00), SPH_C32(0x2e570090), SPH_C32(0x6c8bfd31), - SPH_C32(0x1ad6e759), SPH_C32(0x93ab47e1) }, - { SPH_C32(0x73c800c0), SPH_C32(0xfd596a6b), SPH_C32(0x5c46034f), - SPH_C32(0x049a1d65), SPH_C32(0xddb300a0), SPH_C32(0xad9f6a3c), - SPH_C32(0x1fff8d5f), SPH_C32(0x0053b740) }, - { SPH_C32(0x229400d0), SPH_C32(0xbdaa1890), SPH_C32(0xa0a1254d), - SPH_C32(0x75cd4d04), SPH_C32(0xf38a00a0), SPH_C32(0xc9420cb5), - SPH_C32(0x232b8ba3), SPH_C32(0xb1a727fc) }, - { SPH_C32(0x5df100c0), SPH_C32(0x99840ce2), SPH_C32(0x609205b3), - SPH_C32(0xb56e8dd9), SPH_C32(0xa2d600b0), SPH_C32(0x89b17e4e), - SPH_C32(0xdfccada1), SPH_C32(0xc0f0779d) }, - { SPH_C32(0x0cad00d0), SPH_C32(0xd9777e19), SPH_C32(0x9c7523b1), - SPH_C32(0xc439ddb8), SPH_C32(0x8cef00b0), SPH_C32(0xed6c18c7), - SPH_C32(0xe318ab5d), SPH_C32(0x7104e721) }, - { SPH_C32(0xd17000e0), SPH_C32(0x7cbe8f9d), SPH_C32(0xa5884f4b), - SPH_C32(0xe635bda5), SPH_C32(0x81c100a0), SPH_C32(0x6425a72e), - SPH_C32(0x665680a6), SPH_C32(0x63ba9638) }, - { SPH_C32(0x802c00f0), SPH_C32(0x3c4dfd66), SPH_C32(0x596f6949), - SPH_C32(0x9762edc4), SPH_C32(0xaff800a0), SPH_C32(0x00f8c1a7), - SPH_C32(0x5a82865a), SPH_C32(0xd24e0684) }, - { SPH_C32(0xff4900e0), SPH_C32(0x1863e914), SPH_C32(0x995c49b7), - SPH_C32(0x57c12d19), SPH_C32(0xfea400b0), SPH_C32(0x400bb35c), - SPH_C32(0xa665a058), SPH_C32(0xa31956e5) }, - { SPH_C32(0xae1500f0), SPH_C32(0x58909bef), SPH_C32(0x65bb6fb5), - SPH_C32(0x26967d78), SPH_C32(0xd09d00b0), SPH_C32(0x24d6d5d5), - SPH_C32(0x9ab1a6a4), SPH_C32(0x12edc659) }, - { SPH_C32(0x1adf0080), SPH_C32(0xaf751133), SPH_C32(0x4ed6c5e9), - SPH_C32(0x366782d3), SPH_C32(0x6eb700c0), SPH_C32(0xde99aea6), - SPH_C32(0xa9fda70a), SPH_C32(0xa2760cfd) }, - { SPH_C32(0x4b830090), SPH_C32(0xef8663c8), SPH_C32(0xb231e3eb), - SPH_C32(0x4730d2b2), SPH_C32(0x408e00c0), SPH_C32(0xba44c82f), - SPH_C32(0x9529a1f6), SPH_C32(0x13829c41) }, - { SPH_C32(0x34e60080), SPH_C32(0xcba877ba), SPH_C32(0x7202c315), - SPH_C32(0x8793126f), SPH_C32(0x11d200d0), SPH_C32(0xfab7bad4), - SPH_C32(0x69ce87f4), SPH_C32(0x62d5cc20) }, - { SPH_C32(0x65ba0090), SPH_C32(0x8b5b0541), SPH_C32(0x8ee5e517), - SPH_C32(0xf6c4420e), SPH_C32(0x3feb00d0), SPH_C32(0x9e6adc5d), - SPH_C32(0x551a8108), SPH_C32(0xd3215c9c) }, - { SPH_C32(0xb86700a0), SPH_C32(0x2e92f4c5), SPH_C32(0xb71889ed), - SPH_C32(0xd4c82213), SPH_C32(0x32c500c0), SPH_C32(0x172363b4), - SPH_C32(0xd054aaf3), SPH_C32(0xc19f2d85) }, - { SPH_C32(0xe93b00b0), SPH_C32(0x6e61863e), SPH_C32(0x4bffafef), - SPH_C32(0xa59f7272), SPH_C32(0x1cfc00c0), SPH_C32(0x73fe053d), - SPH_C32(0xec80ac0f), SPH_C32(0x706bbd39) }, - { SPH_C32(0x965e00a0), SPH_C32(0x4a4f924c), SPH_C32(0x8bcc8f11), - SPH_C32(0x653cb2af), SPH_C32(0x4da000d0), SPH_C32(0x330d77c6), - SPH_C32(0x10678a0d), SPH_C32(0x013ced58) }, - { SPH_C32(0xc70200b0), SPH_C32(0x0abce0b7), SPH_C32(0x772ba913), - SPH_C32(0x146be2ce), SPH_C32(0x639900d0), SPH_C32(0x57d0114f), - SPH_C32(0x2cb38cf1), SPH_C32(0xb0c87de4) }, - { SPH_C32(0x46ad0080), SPH_C32(0x66cfdc21), SPH_C32(0x377fc810), - SPH_C32(0x558ea3ab), SPH_C32(0x907d00e0), SPH_C32(0x96c48642), - SPH_C32(0x299ae6f7), SPH_C32(0x23308d45) }, - { SPH_C32(0x17f10090), SPH_C32(0x263caeda), SPH_C32(0xcb98ee12), - SPH_C32(0x24d9f3ca), SPH_C32(0xbe4400e0), SPH_C32(0xf219e0cb), - SPH_C32(0x154ee00b), SPH_C32(0x92c41df9) }, - { SPH_C32(0x68940080), SPH_C32(0x0212baa8), SPH_C32(0x0babceec), - SPH_C32(0xe47a3317), SPH_C32(0xef1800f0), SPH_C32(0xb2ea9230), - SPH_C32(0xe9a9c609), SPH_C32(0xe3934d98) }, - { SPH_C32(0x39c80090), SPH_C32(0x42e1c853), SPH_C32(0xf74ce8ee), - SPH_C32(0x952d6376), SPH_C32(0xc12100f0), SPH_C32(0xd637f4b9), - SPH_C32(0xd57dc0f5), SPH_C32(0x5267dd24) }, - { SPH_C32(0xe41500a0), SPH_C32(0xe72839d7), SPH_C32(0xceb18414), - SPH_C32(0xb721036b), SPH_C32(0xcc0f00e0), SPH_C32(0x5f7e4b50), - SPH_C32(0x5033eb0e), SPH_C32(0x40d9ac3d) }, - { SPH_C32(0xb54900b0), SPH_C32(0xa7db4b2c), SPH_C32(0x3256a216), - SPH_C32(0xc676530a), SPH_C32(0xe23600e0), SPH_C32(0x3ba32dd9), - SPH_C32(0x6ce7edf2), SPH_C32(0xf12d3c81) }, - { SPH_C32(0xca2c00a0), SPH_C32(0x83f55f5e), SPH_C32(0xf26582e8), - SPH_C32(0x06d593d7), SPH_C32(0xb36a00f0), SPH_C32(0x7b505f22), - SPH_C32(0x9000cbf0), SPH_C32(0x807a6ce0) }, - { SPH_C32(0x9b7000b0), SPH_C32(0xc3062da5), SPH_C32(0x0e82a4ea), - SPH_C32(0x7782c3b6), SPH_C32(0x9d5300f0), SPH_C32(0x1f8d39ab), - SPH_C32(0xacd4cd0c), SPH_C32(0x318efc5c) }, - { SPH_C32(0x571100c0), SPH_C32(0x942efd4d), SPH_C32(0x78b3ae41), - SPH_C32(0x1504b8d6), SPH_C32(0x161c00c0), SPH_C32(0x7e54f492), - SPH_C32(0xf4a107fd), SPH_C32(0xd0018836) }, - { SPH_C32(0x064d00d0), SPH_C32(0xd4dd8fb6), SPH_C32(0x84548843), - SPH_C32(0x6453e8b7), SPH_C32(0x382500c0), SPH_C32(0x1a89921b), - SPH_C32(0xc8750101), SPH_C32(0x61f5188a) }, - { SPH_C32(0x792800c0), SPH_C32(0xf0f39bc4), SPH_C32(0x4467a8bd), - SPH_C32(0xa4f0286a), SPH_C32(0x697900d0), SPH_C32(0x5a7ae0e0), - SPH_C32(0x34922703), SPH_C32(0x10a248eb) }, - { SPH_C32(0x287400d0), SPH_C32(0xb000e93f), SPH_C32(0xb8808ebf), - SPH_C32(0xd5a7780b), SPH_C32(0x474000d0), SPH_C32(0x3ea78669), - SPH_C32(0x084621ff), SPH_C32(0xa156d857) }, - { SPH_C32(0xf5a900e0), SPH_C32(0x15c918bb), SPH_C32(0x817de245), - SPH_C32(0xf7ab1816), SPH_C32(0x4a6e00c0), SPH_C32(0xb7ee3980), - SPH_C32(0x8d080a04), SPH_C32(0xb3e8a94e) }, - { SPH_C32(0xa4f500f0), SPH_C32(0x553a6a40), SPH_C32(0x7d9ac447), - SPH_C32(0x86fc4877), SPH_C32(0x645700c0), SPH_C32(0xd3335f09), - SPH_C32(0xb1dc0cf8), SPH_C32(0x021c39f2) }, - { SPH_C32(0xdb9000e0), SPH_C32(0x71147e32), SPH_C32(0xbda9e4b9), - SPH_C32(0x465f88aa), SPH_C32(0x350b00d0), SPH_C32(0x93c02df2), - SPH_C32(0x4d3b2afa), SPH_C32(0x734b6993) }, - { SPH_C32(0x8acc00f0), SPH_C32(0x31e70cc9), SPH_C32(0x414ec2bb), - SPH_C32(0x3708d8cb), SPH_C32(0x1b3200d0), SPH_C32(0xf71d4b7b), - SPH_C32(0x71ef2c06), SPH_C32(0xc2bff92f) }, - { SPH_C32(0x0b6300c0), SPH_C32(0x5d94305f), SPH_C32(0x011aa3b8), - SPH_C32(0x76ed99ae), SPH_C32(0xe8d600e0), SPH_C32(0x3609dc76), - SPH_C32(0x74c64600), SPH_C32(0x5147098e) }, - { SPH_C32(0x5a3f00d0), SPH_C32(0x1d6742a4), SPH_C32(0xfdfd85ba), - SPH_C32(0x07bac9cf), SPH_C32(0xc6ef00e0), SPH_C32(0x52d4baff), - SPH_C32(0x481240fc), SPH_C32(0xe0b39932) }, - { SPH_C32(0x255a00c0), SPH_C32(0x394956d6), SPH_C32(0x3dcea544), - SPH_C32(0xc7190912), SPH_C32(0x97b300f0), SPH_C32(0x1227c804), - SPH_C32(0xb4f566fe), SPH_C32(0x91e4c953) }, - { SPH_C32(0x740600d0), SPH_C32(0x79ba242d), SPH_C32(0xc1298346), - SPH_C32(0xb64e5973), SPH_C32(0xb98a00f0), SPH_C32(0x76faae8d), - SPH_C32(0x88216002), SPH_C32(0x201059ef) }, - { SPH_C32(0xa9db00e0), SPH_C32(0xdc73d5a9), SPH_C32(0xf8d4efbc), - SPH_C32(0x9442396e), SPH_C32(0xb4a400e0), SPH_C32(0xffb31164), - SPH_C32(0x0d6f4bf9), SPH_C32(0x32ae28f6) }, - { SPH_C32(0xf88700f0), SPH_C32(0x9c80a752), SPH_C32(0x0433c9be), - SPH_C32(0xe515690f), SPH_C32(0x9a9d00e0), SPH_C32(0x9b6e77ed), - SPH_C32(0x31bb4d05), SPH_C32(0x835ab84a) }, - { SPH_C32(0x87e200e0), SPH_C32(0xb8aeb320), SPH_C32(0xc400e940), - SPH_C32(0x25b6a9d2), SPH_C32(0xcbc100f0), SPH_C32(0xdb9d0516), - SPH_C32(0xcd5c6b07), SPH_C32(0xf20de82b) }, - { SPH_C32(0xd6be00f0), SPH_C32(0xf85dc1db), SPH_C32(0x38e7cf42), - SPH_C32(0x54e1f9b3), SPH_C32(0xe5f800f0), SPH_C32(0xbf40639f), - SPH_C32(0xf1886dfb), SPH_C32(0x43f97897) } -}; - -static const sph_u32 T256_24[256][8] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000) }, - { SPH_C32(0xc04e0001), SPH_C32(0x33b9c010), SPH_C32(0xae0ebb05), - SPH_C32(0xb5a4c63b), SPH_C32(0xc8f10000), SPH_C32(0x0b2de782), - SPH_C32(0x6bf648a4), SPH_C32(0x539cbdbf) }, - { SPH_C32(0xc8f10000), SPH_C32(0x0b2de782), SPH_C32(0x6bf648a4), - SPH_C32(0x539cbdbf), SPH_C32(0x08bf0001), SPH_C32(0x38942792), - SPH_C32(0xc5f8f3a1), SPH_C32(0xe6387b84) }, - { SPH_C32(0x08bf0001), SPH_C32(0x38942792), SPH_C32(0xc5f8f3a1), - SPH_C32(0xe6387b84), SPH_C32(0xc04e0001), SPH_C32(0x33b9c010), - SPH_C32(0xae0ebb05), SPH_C32(0xb5a4c63b) }, - { SPH_C32(0x88230002), SPH_C32(0x5fe7a7b3), SPH_C32(0x99e585aa), - SPH_C32(0x8d75f7f1), SPH_C32(0x51ac0000), SPH_C32(0x25e30f14), - SPH_C32(0x79e22a4c), SPH_C32(0x1298bd46) }, - { SPH_C32(0x486d0003), SPH_C32(0x6c5e67a3), SPH_C32(0x37eb3eaf), - SPH_C32(0x38d131ca), SPH_C32(0x995d0000), SPH_C32(0x2ecee896), - SPH_C32(0x121462e8), SPH_C32(0x410400f9) }, - { SPH_C32(0x40d20002), SPH_C32(0x54ca4031), SPH_C32(0xf213cd0e), - SPH_C32(0xdee94a4e), SPH_C32(0x59130001), SPH_C32(0x1d772886), - SPH_C32(0xbc1ad9ed), SPH_C32(0xf4a0c6c2) }, - { SPH_C32(0x809c0003), SPH_C32(0x67738021), SPH_C32(0x5c1d760b), - SPH_C32(0x6b4d8c75), SPH_C32(0x91e20001), SPH_C32(0x165acf04), - SPH_C32(0xd7ec9149), SPH_C32(0xa73c7b7d) }, - { SPH_C32(0x51ac0000), SPH_C32(0x25e30f14), SPH_C32(0x79e22a4c), - SPH_C32(0x1298bd46), SPH_C32(0xd98f0002), SPH_C32(0x7a04a8a7), - SPH_C32(0xe007afe6), SPH_C32(0x9fed4ab7) }, - { SPH_C32(0x91e20001), SPH_C32(0x165acf04), SPH_C32(0xd7ec9149), - SPH_C32(0xa73c7b7d), SPH_C32(0x117e0002), SPH_C32(0x71294f25), - SPH_C32(0x8bf1e742), SPH_C32(0xcc71f708) }, - { SPH_C32(0x995d0000), SPH_C32(0x2ecee896), SPH_C32(0x121462e8), - SPH_C32(0x410400f9), SPH_C32(0xd1300003), SPH_C32(0x42908f35), - SPH_C32(0x25ff5c47), SPH_C32(0x79d53133) }, - { SPH_C32(0x59130001), SPH_C32(0x1d772886), SPH_C32(0xbc1ad9ed), - SPH_C32(0xf4a0c6c2), SPH_C32(0x19c10003), SPH_C32(0x49bd68b7), - SPH_C32(0x4e0914e3), SPH_C32(0x2a498c8c) }, - { SPH_C32(0xd98f0002), SPH_C32(0x7a04a8a7), SPH_C32(0xe007afe6), - SPH_C32(0x9fed4ab7), SPH_C32(0x88230002), SPH_C32(0x5fe7a7b3), - SPH_C32(0x99e585aa), SPH_C32(0x8d75f7f1) }, - { SPH_C32(0x19c10003), SPH_C32(0x49bd68b7), SPH_C32(0x4e0914e3), - SPH_C32(0x2a498c8c), SPH_C32(0x40d20002), SPH_C32(0x54ca4031), - SPH_C32(0xf213cd0e), SPH_C32(0xdee94a4e) }, - { SPH_C32(0x117e0002), SPH_C32(0x71294f25), SPH_C32(0x8bf1e742), - SPH_C32(0xcc71f708), SPH_C32(0x809c0003), SPH_C32(0x67738021), - SPH_C32(0x5c1d760b), SPH_C32(0x6b4d8c75) }, - { SPH_C32(0xd1300003), SPH_C32(0x42908f35), SPH_C32(0x25ff5c47), - SPH_C32(0x79d53133), SPH_C32(0x486d0003), SPH_C32(0x6c5e67a3), - SPH_C32(0x37eb3eaf), SPH_C32(0x38d131ca) }, - { SPH_C32(0xd0080004), SPH_C32(0x8c768f77), SPH_C32(0x9dc5b050), - SPH_C32(0xaf4a29da), SPH_C32(0x6ba90000), SPH_C32(0x40ebf9aa), - SPH_C32(0x98321c3d), SPH_C32(0x76acc733) }, - { SPH_C32(0x10460005), SPH_C32(0xbfcf4f67), SPH_C32(0x33cb0b55), - SPH_C32(0x1aeeefe1), SPH_C32(0xa3580000), SPH_C32(0x4bc61e28), - SPH_C32(0xf3c45499), SPH_C32(0x25307a8c) }, - { SPH_C32(0x18f90004), SPH_C32(0x875b68f5), SPH_C32(0xf633f8f4), - SPH_C32(0xfcd69465), SPH_C32(0x63160001), SPH_C32(0x787fde38), - SPH_C32(0x5dcaef9c), SPH_C32(0x9094bcb7) }, - { SPH_C32(0xd8b70005), SPH_C32(0xb4e2a8e5), SPH_C32(0x583d43f1), - SPH_C32(0x4972525e), SPH_C32(0xabe70001), SPH_C32(0x735239ba), - SPH_C32(0x363ca738), SPH_C32(0xc3080108) }, - { SPH_C32(0x582b0006), SPH_C32(0xd39128c4), SPH_C32(0x042035fa), - SPH_C32(0x223fde2b), SPH_C32(0x3a050000), SPH_C32(0x6508f6be), - SPH_C32(0xe1d03671), SPH_C32(0x64347a75) }, - { SPH_C32(0x98650007), SPH_C32(0xe028e8d4), SPH_C32(0xaa2e8eff), - SPH_C32(0x979b1810), SPH_C32(0xf2f40000), SPH_C32(0x6e25113c), - SPH_C32(0x8a267ed5), SPH_C32(0x37a8c7ca) }, - { SPH_C32(0x90da0006), SPH_C32(0xd8bccf46), SPH_C32(0x6fd67d5e), - SPH_C32(0x71a36394), SPH_C32(0x32ba0001), SPH_C32(0x5d9cd12c), - SPH_C32(0x2428c5d0), SPH_C32(0x820c01f1) }, - { SPH_C32(0x50940007), SPH_C32(0xeb050f56), SPH_C32(0xc1d8c65b), - SPH_C32(0xc407a5af), SPH_C32(0xfa4b0001), SPH_C32(0x56b136ae), - SPH_C32(0x4fde8d74), SPH_C32(0xd190bc4e) }, - { SPH_C32(0x81a40004), SPH_C32(0xa9958063), SPH_C32(0xe4279a1c), - SPH_C32(0xbdd2949c), SPH_C32(0xb2260002), SPH_C32(0x3aef510d), - SPH_C32(0x7835b3db), SPH_C32(0xe9418d84) }, - { SPH_C32(0x41ea0005), SPH_C32(0x9a2c4073), SPH_C32(0x4a292119), - SPH_C32(0x087652a7), SPH_C32(0x7ad70002), SPH_C32(0x31c2b68f), - SPH_C32(0x13c3fb7f), SPH_C32(0xbadd303b) }, - { SPH_C32(0x49550004), SPH_C32(0xa2b867e1), SPH_C32(0x8fd1d2b8), - SPH_C32(0xee4e2923), SPH_C32(0xba990003), SPH_C32(0x027b769f), - SPH_C32(0xbdcd407a), SPH_C32(0x0f79f600) }, - { SPH_C32(0x891b0005), SPH_C32(0x9101a7f1), SPH_C32(0x21df69bd), - SPH_C32(0x5beaef18), SPH_C32(0x72680003), SPH_C32(0x0956911d), - SPH_C32(0xd63b08de), SPH_C32(0x5ce54bbf) }, - { SPH_C32(0x09870006), SPH_C32(0xf67227d0), SPH_C32(0x7dc21fb6), - SPH_C32(0x30a7636d), SPH_C32(0xe38a0002), SPH_C32(0x1f0c5e19), - SPH_C32(0x01d79997), SPH_C32(0xfbd930c2) }, - { SPH_C32(0xc9c90007), SPH_C32(0xc5cbe7c0), SPH_C32(0xd3cca4b3), - SPH_C32(0x8503a556), SPH_C32(0x2b7b0002), SPH_C32(0x1421b99b), - SPH_C32(0x6a21d133), SPH_C32(0xa8458d7d) }, - { SPH_C32(0xc1760006), SPH_C32(0xfd5fc052), SPH_C32(0x16345712), - SPH_C32(0x633bded2), SPH_C32(0xeb350003), SPH_C32(0x2798798b), - SPH_C32(0xc42f6a36), SPH_C32(0x1de14b46) }, - { SPH_C32(0x01380007), SPH_C32(0xcee60042), SPH_C32(0xb83aec17), - SPH_C32(0xd69f18e9), SPH_C32(0x23c40003), SPH_C32(0x2cb59e09), - SPH_C32(0xafd92292), SPH_C32(0x4e7df6f9) }, - { SPH_C32(0x6ba90000), SPH_C32(0x40ebf9aa), SPH_C32(0x98321c3d), - SPH_C32(0x76acc733), SPH_C32(0xbba10004), SPH_C32(0xcc9d76dd), - SPH_C32(0x05f7ac6d), SPH_C32(0xd9e6eee9) }, - { SPH_C32(0xabe70001), SPH_C32(0x735239ba), SPH_C32(0x363ca738), - SPH_C32(0xc3080108), SPH_C32(0x73500004), SPH_C32(0xc7b0915f), - SPH_C32(0x6e01e4c9), SPH_C32(0x8a7a5356) }, - { SPH_C32(0xa3580000), SPH_C32(0x4bc61e28), SPH_C32(0xf3c45499), - SPH_C32(0x25307a8c), SPH_C32(0xb31e0005), SPH_C32(0xf409514f), - SPH_C32(0xc00f5fcc), SPH_C32(0x3fde956d) }, - { SPH_C32(0x63160001), SPH_C32(0x787fde38), SPH_C32(0x5dcaef9c), - SPH_C32(0x9094bcb7), SPH_C32(0x7bef0005), SPH_C32(0xff24b6cd), - SPH_C32(0xabf91768), SPH_C32(0x6c4228d2) }, - { SPH_C32(0xe38a0002), SPH_C32(0x1f0c5e19), SPH_C32(0x01d79997), - SPH_C32(0xfbd930c2), SPH_C32(0xea0d0004), SPH_C32(0xe97e79c9), - SPH_C32(0x7c158621), SPH_C32(0xcb7e53af) }, - { SPH_C32(0x23c40003), SPH_C32(0x2cb59e09), SPH_C32(0xafd92292), - SPH_C32(0x4e7df6f9), SPH_C32(0x22fc0004), SPH_C32(0xe2539e4b), - SPH_C32(0x17e3ce85), SPH_C32(0x98e2ee10) }, - { SPH_C32(0x2b7b0002), SPH_C32(0x1421b99b), SPH_C32(0x6a21d133), - SPH_C32(0xa8458d7d), SPH_C32(0xe2b20005), SPH_C32(0xd1ea5e5b), - SPH_C32(0xb9ed7580), SPH_C32(0x2d46282b) }, - { SPH_C32(0xeb350003), SPH_C32(0x2798798b), SPH_C32(0xc42f6a36), - SPH_C32(0x1de14b46), SPH_C32(0x2a430005), SPH_C32(0xdac7b9d9), - SPH_C32(0xd21b3d24), SPH_C32(0x7eda9594) }, - { SPH_C32(0x3a050000), SPH_C32(0x6508f6be), SPH_C32(0xe1d03671), - SPH_C32(0x64347a75), SPH_C32(0x622e0006), SPH_C32(0xb699de7a), - SPH_C32(0xe5f0038b), SPH_C32(0x460ba45e) }, - { SPH_C32(0xfa4b0001), SPH_C32(0x56b136ae), SPH_C32(0x4fde8d74), - SPH_C32(0xd190bc4e), SPH_C32(0xaadf0006), SPH_C32(0xbdb439f8), - SPH_C32(0x8e064b2f), SPH_C32(0x159719e1) }, - { SPH_C32(0xf2f40000), SPH_C32(0x6e25113c), SPH_C32(0x8a267ed5), - SPH_C32(0x37a8c7ca), SPH_C32(0x6a910007), SPH_C32(0x8e0df9e8), - SPH_C32(0x2008f02a), SPH_C32(0xa033dfda) }, - { SPH_C32(0x32ba0001), SPH_C32(0x5d9cd12c), SPH_C32(0x2428c5d0), - SPH_C32(0x820c01f1), SPH_C32(0xa2600007), SPH_C32(0x85201e6a), - SPH_C32(0x4bfeb88e), SPH_C32(0xf3af6265) }, - { SPH_C32(0xb2260002), SPH_C32(0x3aef510d), SPH_C32(0x7835b3db), - SPH_C32(0xe9418d84), SPH_C32(0x33820006), SPH_C32(0x937ad16e), - SPH_C32(0x9c1229c7), SPH_C32(0x54931918) }, - { SPH_C32(0x72680003), SPH_C32(0x0956911d), SPH_C32(0xd63b08de), - SPH_C32(0x5ce54bbf), SPH_C32(0xfb730006), SPH_C32(0x985736ec), - SPH_C32(0xf7e46163), SPH_C32(0x070fa4a7) }, - { SPH_C32(0x7ad70002), SPH_C32(0x31c2b68f), SPH_C32(0x13c3fb7f), - SPH_C32(0xbadd303b), SPH_C32(0x3b3d0007), SPH_C32(0xabeef6fc), - SPH_C32(0x59eada66), SPH_C32(0xb2ab629c) }, - { SPH_C32(0xba990003), SPH_C32(0x027b769f), SPH_C32(0xbdcd407a), - SPH_C32(0x0f79f600), SPH_C32(0xf3cc0007), SPH_C32(0xa0c3117e), - SPH_C32(0x321c92c2), SPH_C32(0xe137df23) }, - { SPH_C32(0xbba10004), SPH_C32(0xcc9d76dd), SPH_C32(0x05f7ac6d), - SPH_C32(0xd9e6eee9), SPH_C32(0xd0080004), SPH_C32(0x8c768f77), - SPH_C32(0x9dc5b050), SPH_C32(0xaf4a29da) }, - { SPH_C32(0x7bef0005), SPH_C32(0xff24b6cd), SPH_C32(0xabf91768), - SPH_C32(0x6c4228d2), SPH_C32(0x18f90004), SPH_C32(0x875b68f5), - SPH_C32(0xf633f8f4), SPH_C32(0xfcd69465) }, - { SPH_C32(0x73500004), SPH_C32(0xc7b0915f), SPH_C32(0x6e01e4c9), - SPH_C32(0x8a7a5356), SPH_C32(0xd8b70005), SPH_C32(0xb4e2a8e5), - SPH_C32(0x583d43f1), SPH_C32(0x4972525e) }, - { SPH_C32(0xb31e0005), SPH_C32(0xf409514f), SPH_C32(0xc00f5fcc), - SPH_C32(0x3fde956d), SPH_C32(0x10460005), SPH_C32(0xbfcf4f67), - SPH_C32(0x33cb0b55), SPH_C32(0x1aeeefe1) }, - { SPH_C32(0x33820006), SPH_C32(0x937ad16e), SPH_C32(0x9c1229c7), - SPH_C32(0x54931918), SPH_C32(0x81a40004), SPH_C32(0xa9958063), - SPH_C32(0xe4279a1c), SPH_C32(0xbdd2949c) }, - { SPH_C32(0xf3cc0007), SPH_C32(0xa0c3117e), SPH_C32(0x321c92c2), - SPH_C32(0xe137df23), SPH_C32(0x49550004), SPH_C32(0xa2b867e1), - SPH_C32(0x8fd1d2b8), SPH_C32(0xee4e2923) }, - { SPH_C32(0xfb730006), SPH_C32(0x985736ec), SPH_C32(0xf7e46163), - SPH_C32(0x070fa4a7), SPH_C32(0x891b0005), SPH_C32(0x9101a7f1), - SPH_C32(0x21df69bd), SPH_C32(0x5beaef18) }, - { SPH_C32(0x3b3d0007), SPH_C32(0xabeef6fc), SPH_C32(0x59eada66), - SPH_C32(0xb2ab629c), SPH_C32(0x41ea0005), SPH_C32(0x9a2c4073), - SPH_C32(0x4a292119), SPH_C32(0x087652a7) }, - { SPH_C32(0xea0d0004), SPH_C32(0xe97e79c9), SPH_C32(0x7c158621), - SPH_C32(0xcb7e53af), SPH_C32(0x09870006), SPH_C32(0xf67227d0), - SPH_C32(0x7dc21fb6), SPH_C32(0x30a7636d) }, - { SPH_C32(0x2a430005), SPH_C32(0xdac7b9d9), SPH_C32(0xd21b3d24), - SPH_C32(0x7eda9594), SPH_C32(0xc1760006), SPH_C32(0xfd5fc052), - SPH_C32(0x16345712), SPH_C32(0x633bded2) }, - { SPH_C32(0x22fc0004), SPH_C32(0xe2539e4b), SPH_C32(0x17e3ce85), - SPH_C32(0x98e2ee10), SPH_C32(0x01380007), SPH_C32(0xcee60042), - SPH_C32(0xb83aec17), SPH_C32(0xd69f18e9) }, - { SPH_C32(0xe2b20005), SPH_C32(0xd1ea5e5b), SPH_C32(0xb9ed7580), - SPH_C32(0x2d46282b), SPH_C32(0xc9c90007), SPH_C32(0xc5cbe7c0), - SPH_C32(0xd3cca4b3), SPH_C32(0x8503a556) }, - { SPH_C32(0x622e0006), SPH_C32(0xb699de7a), SPH_C32(0xe5f0038b), - SPH_C32(0x460ba45e), SPH_C32(0x582b0006), SPH_C32(0xd39128c4), - SPH_C32(0x042035fa), SPH_C32(0x223fde2b) }, - { SPH_C32(0xa2600007), SPH_C32(0x85201e6a), SPH_C32(0x4bfeb88e), - SPH_C32(0xf3af6265), SPH_C32(0x90da0006), SPH_C32(0xd8bccf46), - SPH_C32(0x6fd67d5e), SPH_C32(0x71a36394) }, - { SPH_C32(0xaadf0006), SPH_C32(0xbdb439f8), SPH_C32(0x8e064b2f), - SPH_C32(0x159719e1), SPH_C32(0x50940007), SPH_C32(0xeb050f56), - SPH_C32(0xc1d8c65b), SPH_C32(0xc407a5af) }, - { SPH_C32(0x6a910007), SPH_C32(0x8e0df9e8), SPH_C32(0x2008f02a), - SPH_C32(0xa033dfda), SPH_C32(0x98650007), SPH_C32(0xe028e8d4), - SPH_C32(0xaa2e8eff), SPH_C32(0x979b1810) }, - { SPH_C32(0xa8ae0008), SPH_C32(0x2079397d), SPH_C32(0xfe739301), - SPH_C32(0xb8a92831), SPH_C32(0x171c0000), SPH_C32(0xb26e3344), - SPH_C32(0x9e6a837e), SPH_C32(0x58f8485f) }, - { SPH_C32(0x68e00009), SPH_C32(0x13c0f96d), SPH_C32(0x507d2804), - SPH_C32(0x0d0dee0a), SPH_C32(0xdfed0000), SPH_C32(0xb943d4c6), - SPH_C32(0xf59ccbda), SPH_C32(0x0b64f5e0) }, - { SPH_C32(0x605f0008), SPH_C32(0x2b54deff), SPH_C32(0x9585dba5), - SPH_C32(0xeb35958e), SPH_C32(0x1fa30001), SPH_C32(0x8afa14d6), - SPH_C32(0x5b9270df), SPH_C32(0xbec033db) }, - { SPH_C32(0xa0110009), SPH_C32(0x18ed1eef), SPH_C32(0x3b8b60a0), - SPH_C32(0x5e9153b5), SPH_C32(0xd7520001), SPH_C32(0x81d7f354), - SPH_C32(0x3064387b), SPH_C32(0xed5c8e64) }, - { SPH_C32(0x208d000a), SPH_C32(0x7f9e9ece), SPH_C32(0x679616ab), - SPH_C32(0x35dcdfc0), SPH_C32(0x46b00000), SPH_C32(0x978d3c50), - SPH_C32(0xe788a932), SPH_C32(0x4a60f519) }, - { SPH_C32(0xe0c3000b), SPH_C32(0x4c275ede), SPH_C32(0xc998adae), - SPH_C32(0x807819fb), SPH_C32(0x8e410000), SPH_C32(0x9ca0dbd2), - SPH_C32(0x8c7ee196), SPH_C32(0x19fc48a6) }, - { SPH_C32(0xe87c000a), SPH_C32(0x74b3794c), SPH_C32(0x0c605e0f), - SPH_C32(0x6640627f), SPH_C32(0x4e0f0001), SPH_C32(0xaf191bc2), - SPH_C32(0x22705a93), SPH_C32(0xac588e9d) }, - { SPH_C32(0x2832000b), SPH_C32(0x470ab95c), SPH_C32(0xa26ee50a), - SPH_C32(0xd3e4a444), SPH_C32(0x86fe0001), SPH_C32(0xa434fc40), - SPH_C32(0x49861237), SPH_C32(0xffc43322) }, - { SPH_C32(0xf9020008), SPH_C32(0x059a3669), SPH_C32(0x8791b94d), - SPH_C32(0xaa319577), SPH_C32(0xce930002), SPH_C32(0xc86a9be3), - SPH_C32(0x7e6d2c98), SPH_C32(0xc71502e8) }, - { SPH_C32(0x394c0009), SPH_C32(0x3623f679), SPH_C32(0x299f0248), - SPH_C32(0x1f95534c), SPH_C32(0x06620002), SPH_C32(0xc3477c61), - SPH_C32(0x159b643c), SPH_C32(0x9489bf57) }, - { SPH_C32(0x31f30008), SPH_C32(0x0eb7d1eb), SPH_C32(0xec67f1e9), - SPH_C32(0xf9ad28c8), SPH_C32(0xc62c0003), SPH_C32(0xf0febc71), - SPH_C32(0xbb95df39), SPH_C32(0x212d796c) }, - { SPH_C32(0xf1bd0009), SPH_C32(0x3d0e11fb), SPH_C32(0x42694aec), - SPH_C32(0x4c09eef3), SPH_C32(0x0edd0003), SPH_C32(0xfbd35bf3), - SPH_C32(0xd063979d), SPH_C32(0x72b1c4d3) }, - { SPH_C32(0x7121000a), SPH_C32(0x5a7d91da), SPH_C32(0x1e743ce7), - SPH_C32(0x27446286), SPH_C32(0x9f3f0002), SPH_C32(0xed8994f7), - SPH_C32(0x078f06d4), SPH_C32(0xd58dbfae) }, - { SPH_C32(0xb16f000b), SPH_C32(0x69c451ca), SPH_C32(0xb07a87e2), - SPH_C32(0x92e0a4bd), SPH_C32(0x57ce0002), SPH_C32(0xe6a47375), - SPH_C32(0x6c794e70), SPH_C32(0x86110211) }, - { SPH_C32(0xb9d0000a), SPH_C32(0x51507658), SPH_C32(0x75827443), - SPH_C32(0x74d8df39), SPH_C32(0x97800003), SPH_C32(0xd51db365), - SPH_C32(0xc277f575), SPH_C32(0x33b5c42a) }, - { SPH_C32(0x799e000b), SPH_C32(0x62e9b648), SPH_C32(0xdb8ccf46), - SPH_C32(0xc17c1902), SPH_C32(0x5f710003), SPH_C32(0xde3054e7), - SPH_C32(0xa981bdd1), SPH_C32(0x60297995) }, - { SPH_C32(0x78a6000c), SPH_C32(0xac0fb60a), SPH_C32(0x63b62351), - SPH_C32(0x17e301eb), SPH_C32(0x7cb50000), SPH_C32(0xf285caee), - SPH_C32(0x06589f43), SPH_C32(0x2e548f6c) }, - { SPH_C32(0xb8e8000d), SPH_C32(0x9fb6761a), SPH_C32(0xcdb89854), - SPH_C32(0xa247c7d0), SPH_C32(0xb4440000), SPH_C32(0xf9a82d6c), - SPH_C32(0x6daed7e7), SPH_C32(0x7dc832d3) }, - { SPH_C32(0xb057000c), SPH_C32(0xa7225188), SPH_C32(0x08406bf5), - SPH_C32(0x447fbc54), SPH_C32(0x740a0001), SPH_C32(0xca11ed7c), - SPH_C32(0xc3a06ce2), SPH_C32(0xc86cf4e8) }, - { SPH_C32(0x7019000d), SPH_C32(0x949b9198), SPH_C32(0xa64ed0f0), - SPH_C32(0xf1db7a6f), SPH_C32(0xbcfb0001), SPH_C32(0xc13c0afe), - SPH_C32(0xa8562446), SPH_C32(0x9bf04957) }, - { SPH_C32(0xf085000e), SPH_C32(0xf3e811b9), SPH_C32(0xfa53a6fb), - SPH_C32(0x9a96f61a), SPH_C32(0x2d190000), SPH_C32(0xd766c5fa), - SPH_C32(0x7fbab50f), SPH_C32(0x3ccc322a) }, - { SPH_C32(0x30cb000f), SPH_C32(0xc051d1a9), SPH_C32(0x545d1dfe), - SPH_C32(0x2f323021), SPH_C32(0xe5e80000), SPH_C32(0xdc4b2278), - SPH_C32(0x144cfdab), SPH_C32(0x6f508f95) }, - { SPH_C32(0x3874000e), SPH_C32(0xf8c5f63b), SPH_C32(0x91a5ee5f), - SPH_C32(0xc90a4ba5), SPH_C32(0x25a60001), SPH_C32(0xeff2e268), - SPH_C32(0xba4246ae), SPH_C32(0xdaf449ae) }, - { SPH_C32(0xf83a000f), SPH_C32(0xcb7c362b), SPH_C32(0x3fab555a), - SPH_C32(0x7cae8d9e), SPH_C32(0xed570001), SPH_C32(0xe4df05ea), - SPH_C32(0xd1b40e0a), SPH_C32(0x8968f411) }, - { SPH_C32(0x290a000c), SPH_C32(0x89ecb91e), SPH_C32(0x1a54091d), - SPH_C32(0x057bbcad), SPH_C32(0xa53a0002), SPH_C32(0x88816249), - SPH_C32(0xe65f30a5), SPH_C32(0xb1b9c5db) }, - { SPH_C32(0xe944000d), SPH_C32(0xba55790e), SPH_C32(0xb45ab218), - SPH_C32(0xb0df7a96), SPH_C32(0x6dcb0002), SPH_C32(0x83ac85cb), - SPH_C32(0x8da97801), SPH_C32(0xe2257864) }, - { SPH_C32(0xe1fb000c), SPH_C32(0x82c15e9c), SPH_C32(0x71a241b9), - SPH_C32(0x56e70112), SPH_C32(0xad850003), SPH_C32(0xb01545db), - SPH_C32(0x23a7c304), SPH_C32(0x5781be5f) }, - { SPH_C32(0x21b5000d), SPH_C32(0xb1789e8c), SPH_C32(0xdfacfabc), - SPH_C32(0xe343c729), SPH_C32(0x65740003), SPH_C32(0xbb38a259), - SPH_C32(0x48518ba0), SPH_C32(0x041d03e0) }, - { SPH_C32(0xa129000e), SPH_C32(0xd60b1ead), SPH_C32(0x83b18cb7), - SPH_C32(0x880e4b5c), SPH_C32(0xf4960002), SPH_C32(0xad626d5d), - SPH_C32(0x9fbd1ae9), SPH_C32(0xa321789d) }, - { SPH_C32(0x6167000f), SPH_C32(0xe5b2debd), SPH_C32(0x2dbf37b2), - SPH_C32(0x3daa8d67), SPH_C32(0x3c670002), SPH_C32(0xa64f8adf), - SPH_C32(0xf44b524d), SPH_C32(0xf0bdc522) }, - { SPH_C32(0x69d8000e), SPH_C32(0xdd26f92f), SPH_C32(0xe847c413), - SPH_C32(0xdb92f6e3), SPH_C32(0xfc290003), SPH_C32(0x95f64acf), - SPH_C32(0x5a45e948), SPH_C32(0x45190319) }, - { SPH_C32(0xa996000f), SPH_C32(0xee9f393f), SPH_C32(0x46497f16), - SPH_C32(0x6e3630d8), SPH_C32(0x34d80003), SPH_C32(0x9edbad4d), - SPH_C32(0x31b3a1ec), SPH_C32(0x1685bea6) }, - { SPH_C32(0xc3070008), SPH_C32(0x6092c0d7), SPH_C32(0x66418f3c), - SPH_C32(0xce05ef02), SPH_C32(0xacbd0004), SPH_C32(0x7ef34599), - SPH_C32(0x9b9d2f13), SPH_C32(0x811ea6b6) }, - { SPH_C32(0x03490009), SPH_C32(0x532b00c7), SPH_C32(0xc84f3439), - SPH_C32(0x7ba12939), SPH_C32(0x644c0004), SPH_C32(0x75dea21b), - SPH_C32(0xf06b67b7), SPH_C32(0xd2821b09) }, - { SPH_C32(0x0bf60008), SPH_C32(0x6bbf2755), SPH_C32(0x0db7c798), - SPH_C32(0x9d9952bd), SPH_C32(0xa4020005), SPH_C32(0x4667620b), - SPH_C32(0x5e65dcb2), SPH_C32(0x6726dd32) }, - { SPH_C32(0xcbb80009), SPH_C32(0x5806e745), SPH_C32(0xa3b97c9d), - SPH_C32(0x283d9486), SPH_C32(0x6cf30005), SPH_C32(0x4d4a8589), - SPH_C32(0x35939416), SPH_C32(0x34ba608d) }, - { SPH_C32(0x4b24000a), SPH_C32(0x3f756764), SPH_C32(0xffa40a96), - SPH_C32(0x437018f3), SPH_C32(0xfd110004), SPH_C32(0x5b104a8d), - SPH_C32(0xe27f055f), SPH_C32(0x93861bf0) }, - { SPH_C32(0x8b6a000b), SPH_C32(0x0ccca774), SPH_C32(0x51aab193), - SPH_C32(0xf6d4dec8), SPH_C32(0x35e00004), SPH_C32(0x503dad0f), - SPH_C32(0x89894dfb), SPH_C32(0xc01aa64f) }, - { SPH_C32(0x83d5000a), SPH_C32(0x345880e6), SPH_C32(0x94524232), - SPH_C32(0x10eca54c), SPH_C32(0xf5ae0005), SPH_C32(0x63846d1f), - SPH_C32(0x2787f6fe), SPH_C32(0x75be6074) }, - { SPH_C32(0x439b000b), SPH_C32(0x07e140f6), SPH_C32(0x3a5cf937), - SPH_C32(0xa5486377), SPH_C32(0x3d5f0005), SPH_C32(0x68a98a9d), - SPH_C32(0x4c71be5a), SPH_C32(0x2622ddcb) }, - { SPH_C32(0x92ab0008), SPH_C32(0x4571cfc3), SPH_C32(0x1fa3a570), - SPH_C32(0xdc9d5244), SPH_C32(0x75320006), SPH_C32(0x04f7ed3e), - SPH_C32(0x7b9a80f5), SPH_C32(0x1ef3ec01) }, - { SPH_C32(0x52e50009), SPH_C32(0x76c80fd3), SPH_C32(0xb1ad1e75), - SPH_C32(0x6939947f), SPH_C32(0xbdc30006), SPH_C32(0x0fda0abc), - SPH_C32(0x106cc851), SPH_C32(0x4d6f51be) }, - { SPH_C32(0x5a5a0008), SPH_C32(0x4e5c2841), SPH_C32(0x7455edd4), - SPH_C32(0x8f01effb), SPH_C32(0x7d8d0007), SPH_C32(0x3c63caac), - SPH_C32(0xbe627354), SPH_C32(0xf8cb9785) }, - { SPH_C32(0x9a140009), SPH_C32(0x7de5e851), SPH_C32(0xda5b56d1), - SPH_C32(0x3aa529c0), SPH_C32(0xb57c0007), SPH_C32(0x374e2d2e), - SPH_C32(0xd5943bf0), SPH_C32(0xab572a3a) }, - { SPH_C32(0x1a88000a), SPH_C32(0x1a966870), SPH_C32(0x864620da), - SPH_C32(0x51e8a5b5), SPH_C32(0x249e0006), SPH_C32(0x2114e22a), - SPH_C32(0x0278aab9), SPH_C32(0x0c6b5147) }, - { SPH_C32(0xdac6000b), SPH_C32(0x292fa860), SPH_C32(0x28489bdf), - SPH_C32(0xe44c638e), SPH_C32(0xec6f0006), SPH_C32(0x2a3905a8), - SPH_C32(0x698ee21d), SPH_C32(0x5ff7ecf8) }, - { SPH_C32(0xd279000a), SPH_C32(0x11bb8ff2), SPH_C32(0xedb0687e), - SPH_C32(0x0274180a), SPH_C32(0x2c210007), SPH_C32(0x1980c5b8), - SPH_C32(0xc7805918), SPH_C32(0xea532ac3) }, - { SPH_C32(0x1237000b), SPH_C32(0x22024fe2), SPH_C32(0x43bed37b), - SPH_C32(0xb7d0de31), SPH_C32(0xe4d00007), SPH_C32(0x12ad223a), - SPH_C32(0xac7611bc), SPH_C32(0xb9cf977c) }, - { SPH_C32(0x130f000c), SPH_C32(0xece44fa0), SPH_C32(0xfb843f6c), - SPH_C32(0x614fc6d8), SPH_C32(0xc7140004), SPH_C32(0x3e18bc33), - SPH_C32(0x03af332e), SPH_C32(0xf7b26185) }, - { SPH_C32(0xd341000d), SPH_C32(0xdf5d8fb0), SPH_C32(0x558a8469), - SPH_C32(0xd4eb00e3), SPH_C32(0x0fe50004), SPH_C32(0x35355bb1), - SPH_C32(0x68597b8a), SPH_C32(0xa42edc3a) }, - { SPH_C32(0xdbfe000c), SPH_C32(0xe7c9a822), SPH_C32(0x907277c8), - SPH_C32(0x32d37b67), SPH_C32(0xcfab0005), SPH_C32(0x068c9ba1), - SPH_C32(0xc657c08f), SPH_C32(0x118a1a01) }, - { SPH_C32(0x1bb0000d), SPH_C32(0xd4706832), SPH_C32(0x3e7ccccd), - SPH_C32(0x8777bd5c), SPH_C32(0x075a0005), SPH_C32(0x0da17c23), - SPH_C32(0xada1882b), SPH_C32(0x4216a7be) }, - { SPH_C32(0x9b2c000e), SPH_C32(0xb303e813), SPH_C32(0x6261bac6), - SPH_C32(0xec3a3129), SPH_C32(0x96b80004), SPH_C32(0x1bfbb327), - SPH_C32(0x7a4d1962), SPH_C32(0xe52adcc3) }, - { SPH_C32(0x5b62000f), SPH_C32(0x80ba2803), SPH_C32(0xcc6f01c3), - SPH_C32(0x599ef712), SPH_C32(0x5e490004), SPH_C32(0x10d654a5), - SPH_C32(0x11bb51c6), SPH_C32(0xb6b6617c) }, - { SPH_C32(0x53dd000e), SPH_C32(0xb82e0f91), SPH_C32(0x0997f262), - SPH_C32(0xbfa68c96), SPH_C32(0x9e070005), SPH_C32(0x236f94b5), - SPH_C32(0xbfb5eac3), SPH_C32(0x0312a747) }, - { SPH_C32(0x9393000f), SPH_C32(0x8b97cf81), SPH_C32(0xa7994967), - SPH_C32(0x0a024aad), SPH_C32(0x56f60005), SPH_C32(0x28427337), - SPH_C32(0xd443a267), SPH_C32(0x508e1af8) }, - { SPH_C32(0x42a3000c), SPH_C32(0xc90740b4), SPH_C32(0x82661520), - SPH_C32(0x73d77b9e), SPH_C32(0x1e9b0006), SPH_C32(0x441c1494), - SPH_C32(0xe3a89cc8), SPH_C32(0x685f2b32) }, - { SPH_C32(0x82ed000d), SPH_C32(0xfabe80a4), SPH_C32(0x2c68ae25), - SPH_C32(0xc673bda5), SPH_C32(0xd66a0006), SPH_C32(0x4f31f316), - SPH_C32(0x885ed46c), SPH_C32(0x3bc3968d) }, - { SPH_C32(0x8a52000c), SPH_C32(0xc22aa736), SPH_C32(0xe9905d84), - SPH_C32(0x204bc621), SPH_C32(0x16240007), SPH_C32(0x7c883306), - SPH_C32(0x26506f69), SPH_C32(0x8e6750b6) }, - { SPH_C32(0x4a1c000d), SPH_C32(0xf1936726), SPH_C32(0x479ee681), - SPH_C32(0x95ef001a), SPH_C32(0xded50007), SPH_C32(0x77a5d484), - SPH_C32(0x4da627cd), SPH_C32(0xddfbed09) }, - { SPH_C32(0xca80000e), SPH_C32(0x96e0e707), SPH_C32(0x1b83908a), - SPH_C32(0xfea28c6f), SPH_C32(0x4f370006), SPH_C32(0x61ff1b80), - SPH_C32(0x9a4ab684), SPH_C32(0x7ac79674) }, - { SPH_C32(0x0ace000f), SPH_C32(0xa5592717), SPH_C32(0xb58d2b8f), - SPH_C32(0x4b064a54), SPH_C32(0x87c60006), SPH_C32(0x6ad2fc02), - SPH_C32(0xf1bcfe20), SPH_C32(0x295b2bcb) }, - { SPH_C32(0x0271000e), SPH_C32(0x9dcd0085), SPH_C32(0x7075d82e), - SPH_C32(0xad3e31d0), SPH_C32(0x47880007), SPH_C32(0x596b3c12), - SPH_C32(0x5fb24525), SPH_C32(0x9cffedf0) }, - { SPH_C32(0xc23f000f), SPH_C32(0xae74c095), SPH_C32(0xde7b632b), - SPH_C32(0x189af7eb), SPH_C32(0x8f790007), SPH_C32(0x5246db90), - SPH_C32(0x34440d81), SPH_C32(0xcf63504f) }, - { SPH_C32(0x171c0000), SPH_C32(0xb26e3344), SPH_C32(0x9e6a837e), - SPH_C32(0x58f8485f), SPH_C32(0xbfb20008), SPH_C32(0x92170a39), - SPH_C32(0x6019107f), SPH_C32(0xe051606e) }, - { SPH_C32(0xd7520001), SPH_C32(0x81d7f354), SPH_C32(0x3064387b), - SPH_C32(0xed5c8e64), SPH_C32(0x77430008), SPH_C32(0x993aedbb), - SPH_C32(0x0bef58db), SPH_C32(0xb3cdddd1) }, - { SPH_C32(0xdfed0000), SPH_C32(0xb943d4c6), SPH_C32(0xf59ccbda), - SPH_C32(0x0b64f5e0), SPH_C32(0xb70d0009), SPH_C32(0xaa832dab), - SPH_C32(0xa5e1e3de), SPH_C32(0x06691bea) }, - { SPH_C32(0x1fa30001), SPH_C32(0x8afa14d6), SPH_C32(0x5b9270df), - SPH_C32(0xbec033db), SPH_C32(0x7ffc0009), SPH_C32(0xa1aeca29), - SPH_C32(0xce17ab7a), SPH_C32(0x55f5a655) }, - { SPH_C32(0x9f3f0002), SPH_C32(0xed8994f7), SPH_C32(0x078f06d4), - SPH_C32(0xd58dbfae), SPH_C32(0xee1e0008), SPH_C32(0xb7f4052d), - SPH_C32(0x19fb3a33), SPH_C32(0xf2c9dd28) }, - { SPH_C32(0x5f710003), SPH_C32(0xde3054e7), SPH_C32(0xa981bdd1), - SPH_C32(0x60297995), SPH_C32(0x26ef0008), SPH_C32(0xbcd9e2af), - SPH_C32(0x720d7297), SPH_C32(0xa1556097) }, - { SPH_C32(0x57ce0002), SPH_C32(0xe6a47375), SPH_C32(0x6c794e70), - SPH_C32(0x86110211), SPH_C32(0xe6a10009), SPH_C32(0x8f6022bf), - SPH_C32(0xdc03c992), SPH_C32(0x14f1a6ac) }, - { SPH_C32(0x97800003), SPH_C32(0xd51db365), SPH_C32(0xc277f575), - SPH_C32(0x33b5c42a), SPH_C32(0x2e500009), SPH_C32(0x844dc53d), - SPH_C32(0xb7f58136), SPH_C32(0x476d1b13) }, - { SPH_C32(0x46b00000), SPH_C32(0x978d3c50), SPH_C32(0xe788a932), - SPH_C32(0x4a60f519), SPH_C32(0x663d000a), SPH_C32(0xe813a29e), - SPH_C32(0x801ebf99), SPH_C32(0x7fbc2ad9) }, - { SPH_C32(0x86fe0001), SPH_C32(0xa434fc40), SPH_C32(0x49861237), - SPH_C32(0xffc43322), SPH_C32(0xaecc000a), SPH_C32(0xe33e451c), - SPH_C32(0xebe8f73d), SPH_C32(0x2c209766) }, - { SPH_C32(0x8e410000), SPH_C32(0x9ca0dbd2), SPH_C32(0x8c7ee196), - SPH_C32(0x19fc48a6), SPH_C32(0x6e82000b), SPH_C32(0xd087850c), - SPH_C32(0x45e64c38), SPH_C32(0x9984515d) }, - { SPH_C32(0x4e0f0001), SPH_C32(0xaf191bc2), SPH_C32(0x22705a93), - SPH_C32(0xac588e9d), SPH_C32(0xa673000b), SPH_C32(0xdbaa628e), - SPH_C32(0x2e10049c), SPH_C32(0xca18ece2) }, - { SPH_C32(0xce930002), SPH_C32(0xc86a9be3), SPH_C32(0x7e6d2c98), - SPH_C32(0xc71502e8), SPH_C32(0x3791000a), SPH_C32(0xcdf0ad8a), - SPH_C32(0xf9fc95d5), SPH_C32(0x6d24979f) }, - { SPH_C32(0x0edd0003), SPH_C32(0xfbd35bf3), SPH_C32(0xd063979d), - SPH_C32(0x72b1c4d3), SPH_C32(0xff60000a), SPH_C32(0xc6dd4a08), - SPH_C32(0x920add71), SPH_C32(0x3eb82a20) }, - { SPH_C32(0x06620002), SPH_C32(0xc3477c61), SPH_C32(0x159b643c), - SPH_C32(0x9489bf57), SPH_C32(0x3f2e000b), SPH_C32(0xf5648a18), - SPH_C32(0x3c046674), SPH_C32(0x8b1cec1b) }, - { SPH_C32(0xc62c0003), SPH_C32(0xf0febc71), SPH_C32(0xbb95df39), - SPH_C32(0x212d796c), SPH_C32(0xf7df000b), SPH_C32(0xfe496d9a), - SPH_C32(0x57f22ed0), SPH_C32(0xd88051a4) }, - { SPH_C32(0xc7140004), SPH_C32(0x3e18bc33), SPH_C32(0x03af332e), - SPH_C32(0xf7b26185), SPH_C32(0xd41b0008), SPH_C32(0xd2fcf393), - SPH_C32(0xf82b0c42), SPH_C32(0x96fda75d) }, - { SPH_C32(0x075a0005), SPH_C32(0x0da17c23), SPH_C32(0xada1882b), - SPH_C32(0x4216a7be), SPH_C32(0x1cea0008), SPH_C32(0xd9d11411), - SPH_C32(0x93dd44e6), SPH_C32(0xc5611ae2) }, - { SPH_C32(0x0fe50004), SPH_C32(0x35355bb1), SPH_C32(0x68597b8a), - SPH_C32(0xa42edc3a), SPH_C32(0xdca40009), SPH_C32(0xea68d401), - SPH_C32(0x3dd3ffe3), SPH_C32(0x70c5dcd9) }, - { SPH_C32(0xcfab0005), SPH_C32(0x068c9ba1), SPH_C32(0xc657c08f), - SPH_C32(0x118a1a01), SPH_C32(0x14550009), SPH_C32(0xe1453383), - SPH_C32(0x5625b747), SPH_C32(0x23596166) }, - { SPH_C32(0x4f370006), SPH_C32(0x61ff1b80), SPH_C32(0x9a4ab684), - SPH_C32(0x7ac79674), SPH_C32(0x85b70008), SPH_C32(0xf71ffc87), - SPH_C32(0x81c9260e), SPH_C32(0x84651a1b) }, - { SPH_C32(0x8f790007), SPH_C32(0x5246db90), SPH_C32(0x34440d81), - SPH_C32(0xcf63504f), SPH_C32(0x4d460008), SPH_C32(0xfc321b05), - SPH_C32(0xea3f6eaa), SPH_C32(0xd7f9a7a4) }, - { SPH_C32(0x87c60006), SPH_C32(0x6ad2fc02), SPH_C32(0xf1bcfe20), - SPH_C32(0x295b2bcb), SPH_C32(0x8d080009), SPH_C32(0xcf8bdb15), - SPH_C32(0x4431d5af), SPH_C32(0x625d619f) }, - { SPH_C32(0x47880007), SPH_C32(0x596b3c12), SPH_C32(0x5fb24525), - SPH_C32(0x9cffedf0), SPH_C32(0x45f90009), SPH_C32(0xc4a63c97), - SPH_C32(0x2fc79d0b), SPH_C32(0x31c1dc20) }, - { SPH_C32(0x96b80004), SPH_C32(0x1bfbb327), SPH_C32(0x7a4d1962), - SPH_C32(0xe52adcc3), SPH_C32(0x0d94000a), SPH_C32(0xa8f85b34), - SPH_C32(0x182ca3a4), SPH_C32(0x0910edea) }, - { SPH_C32(0x56f60005), SPH_C32(0x28427337), SPH_C32(0xd443a267), - SPH_C32(0x508e1af8), SPH_C32(0xc565000a), SPH_C32(0xa3d5bcb6), - SPH_C32(0x73daeb00), SPH_C32(0x5a8c5055) }, - { SPH_C32(0x5e490004), SPH_C32(0x10d654a5), SPH_C32(0x11bb51c6), - SPH_C32(0xb6b6617c), SPH_C32(0x052b000b), SPH_C32(0x906c7ca6), - SPH_C32(0xddd45005), SPH_C32(0xef28966e) }, - { SPH_C32(0x9e070005), SPH_C32(0x236f94b5), SPH_C32(0xbfb5eac3), - SPH_C32(0x0312a747), SPH_C32(0xcdda000b), SPH_C32(0x9b419b24), - SPH_C32(0xb62218a1), SPH_C32(0xbcb42bd1) }, - { SPH_C32(0x1e9b0006), SPH_C32(0x441c1494), SPH_C32(0xe3a89cc8), - SPH_C32(0x685f2b32), SPH_C32(0x5c38000a), SPH_C32(0x8d1b5420), - SPH_C32(0x61ce89e8), SPH_C32(0x1b8850ac) }, - { SPH_C32(0xded50007), SPH_C32(0x77a5d484), SPH_C32(0x4da627cd), - SPH_C32(0xddfbed09), SPH_C32(0x94c9000a), SPH_C32(0x8636b3a2), - SPH_C32(0x0a38c14c), SPH_C32(0x4814ed13) }, - { SPH_C32(0xd66a0006), SPH_C32(0x4f31f316), SPH_C32(0x885ed46c), - SPH_C32(0x3bc3968d), SPH_C32(0x5487000b), SPH_C32(0xb58f73b2), - SPH_C32(0xa4367a49), SPH_C32(0xfdb02b28) }, - { SPH_C32(0x16240007), SPH_C32(0x7c883306), SPH_C32(0x26506f69), - SPH_C32(0x8e6750b6), SPH_C32(0x9c76000b), SPH_C32(0xbea29430), - SPH_C32(0xcfc032ed), SPH_C32(0xae2c9697) }, - { SPH_C32(0x7cb50000), SPH_C32(0xf285caee), SPH_C32(0x06589f43), - SPH_C32(0x2e548f6c), SPH_C32(0x0413000c), SPH_C32(0x5e8a7ce4), - SPH_C32(0x65eebc12), SPH_C32(0x39b78e87) }, - { SPH_C32(0xbcfb0001), SPH_C32(0xc13c0afe), SPH_C32(0xa8562446), - SPH_C32(0x9bf04957), SPH_C32(0xcce2000c), SPH_C32(0x55a79b66), - SPH_C32(0x0e18f4b6), SPH_C32(0x6a2b3338) }, - { SPH_C32(0xb4440000), SPH_C32(0xf9a82d6c), SPH_C32(0x6daed7e7), - SPH_C32(0x7dc832d3), SPH_C32(0x0cac000d), SPH_C32(0x661e5b76), - SPH_C32(0xa0164fb3), SPH_C32(0xdf8ff503) }, - { SPH_C32(0x740a0001), SPH_C32(0xca11ed7c), SPH_C32(0xc3a06ce2), - SPH_C32(0xc86cf4e8), SPH_C32(0xc45d000d), SPH_C32(0x6d33bcf4), - SPH_C32(0xcbe00717), SPH_C32(0x8c1348bc) }, - { SPH_C32(0xf4960002), SPH_C32(0xad626d5d), SPH_C32(0x9fbd1ae9), - SPH_C32(0xa321789d), SPH_C32(0x55bf000c), SPH_C32(0x7b6973f0), - SPH_C32(0x1c0c965e), SPH_C32(0x2b2f33c1) }, - { SPH_C32(0x34d80003), SPH_C32(0x9edbad4d), SPH_C32(0x31b3a1ec), - SPH_C32(0x1685bea6), SPH_C32(0x9d4e000c), SPH_C32(0x70449472), - SPH_C32(0x77fadefa), SPH_C32(0x78b38e7e) }, - { SPH_C32(0x3c670002), SPH_C32(0xa64f8adf), SPH_C32(0xf44b524d), - SPH_C32(0xf0bdc522), SPH_C32(0x5d00000d), SPH_C32(0x43fd5462), - SPH_C32(0xd9f465ff), SPH_C32(0xcd174845) }, - { SPH_C32(0xfc290003), SPH_C32(0x95f64acf), SPH_C32(0x5a45e948), - SPH_C32(0x45190319), SPH_C32(0x95f1000d), SPH_C32(0x48d0b3e0), - SPH_C32(0xb2022d5b), SPH_C32(0x9e8bf5fa) }, - { SPH_C32(0x2d190000), SPH_C32(0xd766c5fa), SPH_C32(0x7fbab50f), - SPH_C32(0x3ccc322a), SPH_C32(0xdd9c000e), SPH_C32(0x248ed443), - SPH_C32(0x85e913f4), SPH_C32(0xa65ac430) }, - { SPH_C32(0xed570001), SPH_C32(0xe4df05ea), SPH_C32(0xd1b40e0a), - SPH_C32(0x8968f411), SPH_C32(0x156d000e), SPH_C32(0x2fa333c1), - SPH_C32(0xee1f5b50), SPH_C32(0xf5c6798f) }, - { SPH_C32(0xe5e80000), SPH_C32(0xdc4b2278), SPH_C32(0x144cfdab), - SPH_C32(0x6f508f95), SPH_C32(0xd523000f), SPH_C32(0x1c1af3d1), - SPH_C32(0x4011e055), SPH_C32(0x4062bfb4) }, - { SPH_C32(0x25a60001), SPH_C32(0xeff2e268), SPH_C32(0xba4246ae), - SPH_C32(0xdaf449ae), SPH_C32(0x1dd2000f), SPH_C32(0x17371453), - SPH_C32(0x2be7a8f1), SPH_C32(0x13fe020b) }, - { SPH_C32(0xa53a0002), SPH_C32(0x88816249), SPH_C32(0xe65f30a5), - SPH_C32(0xb1b9c5db), SPH_C32(0x8c30000e), SPH_C32(0x016ddb57), - SPH_C32(0xfc0b39b8), SPH_C32(0xb4c27976) }, - { SPH_C32(0x65740003), SPH_C32(0xbb38a259), SPH_C32(0x48518ba0), - SPH_C32(0x041d03e0), SPH_C32(0x44c1000e), SPH_C32(0x0a403cd5), - SPH_C32(0x97fd711c), SPH_C32(0xe75ec4c9) }, - { SPH_C32(0x6dcb0002), SPH_C32(0x83ac85cb), SPH_C32(0x8da97801), - SPH_C32(0xe2257864), SPH_C32(0x848f000f), SPH_C32(0x39f9fcc5), - SPH_C32(0x39f3ca19), SPH_C32(0x52fa02f2) }, - { SPH_C32(0xad850003), SPH_C32(0xb01545db), SPH_C32(0x23a7c304), - SPH_C32(0x5781be5f), SPH_C32(0x4c7e000f), SPH_C32(0x32d41b47), - SPH_C32(0x520582bd), SPH_C32(0x0166bf4d) }, - { SPH_C32(0xacbd0004), SPH_C32(0x7ef34599), SPH_C32(0x9b9d2f13), - SPH_C32(0x811ea6b6), SPH_C32(0x6fba000c), SPH_C32(0x1e61854e), - SPH_C32(0xfddca02f), SPH_C32(0x4f1b49b4) }, - { SPH_C32(0x6cf30005), SPH_C32(0x4d4a8589), SPH_C32(0x35939416), - SPH_C32(0x34ba608d), SPH_C32(0xa74b000c), SPH_C32(0x154c62cc), - SPH_C32(0x962ae88b), SPH_C32(0x1c87f40b) }, - { SPH_C32(0x644c0004), SPH_C32(0x75dea21b), SPH_C32(0xf06b67b7), - SPH_C32(0xd2821b09), SPH_C32(0x6705000d), SPH_C32(0x26f5a2dc), - SPH_C32(0x3824538e), SPH_C32(0xa9233230) }, - { SPH_C32(0xa4020005), SPH_C32(0x4667620b), SPH_C32(0x5e65dcb2), - SPH_C32(0x6726dd32), SPH_C32(0xaff4000d), SPH_C32(0x2dd8455e), - SPH_C32(0x53d21b2a), SPH_C32(0xfabf8f8f) }, - { SPH_C32(0x249e0006), SPH_C32(0x2114e22a), SPH_C32(0x0278aab9), - SPH_C32(0x0c6b5147), SPH_C32(0x3e16000c), SPH_C32(0x3b828a5a), - SPH_C32(0x843e8a63), SPH_C32(0x5d83f4f2) }, - { SPH_C32(0xe4d00007), SPH_C32(0x12ad223a), SPH_C32(0xac7611bc), - SPH_C32(0xb9cf977c), SPH_C32(0xf6e7000c), SPH_C32(0x30af6dd8), - SPH_C32(0xefc8c2c7), SPH_C32(0x0e1f494d) }, - { SPH_C32(0xec6f0006), SPH_C32(0x2a3905a8), SPH_C32(0x698ee21d), - SPH_C32(0x5ff7ecf8), SPH_C32(0x36a9000d), SPH_C32(0x0316adc8), - SPH_C32(0x41c679c2), SPH_C32(0xbbbb8f76) }, - { SPH_C32(0x2c210007), SPH_C32(0x1980c5b8), SPH_C32(0xc7805918), - SPH_C32(0xea532ac3), SPH_C32(0xfe58000d), SPH_C32(0x083b4a4a), - SPH_C32(0x2a303166), SPH_C32(0xe82732c9) }, - { SPH_C32(0xfd110004), SPH_C32(0x5b104a8d), SPH_C32(0xe27f055f), - SPH_C32(0x93861bf0), SPH_C32(0xb635000e), SPH_C32(0x64652de9), - SPH_C32(0x1ddb0fc9), SPH_C32(0xd0f60303) }, - { SPH_C32(0x3d5f0005), SPH_C32(0x68a98a9d), SPH_C32(0x4c71be5a), - SPH_C32(0x2622ddcb), SPH_C32(0x7ec4000e), SPH_C32(0x6f48ca6b), - SPH_C32(0x762d476d), SPH_C32(0x836abebc) }, - { SPH_C32(0x35e00004), SPH_C32(0x503dad0f), SPH_C32(0x89894dfb), - SPH_C32(0xc01aa64f), SPH_C32(0xbe8a000f), SPH_C32(0x5cf10a7b), - SPH_C32(0xd823fc68), SPH_C32(0x36ce7887) }, - { SPH_C32(0xf5ae0005), SPH_C32(0x63846d1f), SPH_C32(0x2787f6fe), - SPH_C32(0x75be6074), SPH_C32(0x767b000f), SPH_C32(0x57dcedf9), - SPH_C32(0xb3d5b4cc), SPH_C32(0x6552c538) }, - { SPH_C32(0x75320006), SPH_C32(0x04f7ed3e), SPH_C32(0x7b9a80f5), - SPH_C32(0x1ef3ec01), SPH_C32(0xe799000e), SPH_C32(0x418622fd), - SPH_C32(0x64392585), SPH_C32(0xc26ebe45) }, - { SPH_C32(0xb57c0007), SPH_C32(0x374e2d2e), SPH_C32(0xd5943bf0), - SPH_C32(0xab572a3a), SPH_C32(0x2f68000e), SPH_C32(0x4aabc57f), - SPH_C32(0x0fcf6d21), SPH_C32(0x91f203fa) }, - { SPH_C32(0xbdc30006), SPH_C32(0x0fda0abc), SPH_C32(0x106cc851), - SPH_C32(0x4d6f51be), SPH_C32(0xef26000f), SPH_C32(0x7912056f), - SPH_C32(0xa1c1d624), SPH_C32(0x2456c5c1) }, - { SPH_C32(0x7d8d0007), SPH_C32(0x3c63caac), SPH_C32(0xbe627354), - SPH_C32(0xf8cb9785), SPH_C32(0x27d7000f), SPH_C32(0x723fe2ed), - SPH_C32(0xca379e80), SPH_C32(0x77ca787e) }, - { SPH_C32(0xbfb20008), SPH_C32(0x92170a39), SPH_C32(0x6019107f), - SPH_C32(0xe051606e), SPH_C32(0xa8ae0008), SPH_C32(0x2079397d), - SPH_C32(0xfe739301), SPH_C32(0xb8a92831) }, - { SPH_C32(0x7ffc0009), SPH_C32(0xa1aeca29), SPH_C32(0xce17ab7a), - SPH_C32(0x55f5a655), SPH_C32(0x605f0008), SPH_C32(0x2b54deff), - SPH_C32(0x9585dba5), SPH_C32(0xeb35958e) }, - { SPH_C32(0x77430008), SPH_C32(0x993aedbb), SPH_C32(0x0bef58db), - SPH_C32(0xb3cdddd1), SPH_C32(0xa0110009), SPH_C32(0x18ed1eef), - SPH_C32(0x3b8b60a0), SPH_C32(0x5e9153b5) }, - { SPH_C32(0xb70d0009), SPH_C32(0xaa832dab), SPH_C32(0xa5e1e3de), - SPH_C32(0x06691bea), SPH_C32(0x68e00009), SPH_C32(0x13c0f96d), - SPH_C32(0x507d2804), SPH_C32(0x0d0dee0a) }, - { SPH_C32(0x3791000a), SPH_C32(0xcdf0ad8a), SPH_C32(0xf9fc95d5), - SPH_C32(0x6d24979f), SPH_C32(0xf9020008), SPH_C32(0x059a3669), - SPH_C32(0x8791b94d), SPH_C32(0xaa319577) }, - { SPH_C32(0xf7df000b), SPH_C32(0xfe496d9a), SPH_C32(0x57f22ed0), - SPH_C32(0xd88051a4), SPH_C32(0x31f30008), SPH_C32(0x0eb7d1eb), - SPH_C32(0xec67f1e9), SPH_C32(0xf9ad28c8) }, - { SPH_C32(0xff60000a), SPH_C32(0xc6dd4a08), SPH_C32(0x920add71), - SPH_C32(0x3eb82a20), SPH_C32(0xf1bd0009), SPH_C32(0x3d0e11fb), - SPH_C32(0x42694aec), SPH_C32(0x4c09eef3) }, - { SPH_C32(0x3f2e000b), SPH_C32(0xf5648a18), SPH_C32(0x3c046674), - SPH_C32(0x8b1cec1b), SPH_C32(0x394c0009), SPH_C32(0x3623f679), - SPH_C32(0x299f0248), SPH_C32(0x1f95534c) }, - { SPH_C32(0xee1e0008), SPH_C32(0xb7f4052d), SPH_C32(0x19fb3a33), - SPH_C32(0xf2c9dd28), SPH_C32(0x7121000a), SPH_C32(0x5a7d91da), - SPH_C32(0x1e743ce7), SPH_C32(0x27446286) }, - { SPH_C32(0x2e500009), SPH_C32(0x844dc53d), SPH_C32(0xb7f58136), - SPH_C32(0x476d1b13), SPH_C32(0xb9d0000a), SPH_C32(0x51507658), - SPH_C32(0x75827443), SPH_C32(0x74d8df39) }, - { SPH_C32(0x26ef0008), SPH_C32(0xbcd9e2af), SPH_C32(0x720d7297), - SPH_C32(0xa1556097), SPH_C32(0x799e000b), SPH_C32(0x62e9b648), - SPH_C32(0xdb8ccf46), SPH_C32(0xc17c1902) }, - { SPH_C32(0xe6a10009), SPH_C32(0x8f6022bf), SPH_C32(0xdc03c992), - SPH_C32(0x14f1a6ac), SPH_C32(0xb16f000b), SPH_C32(0x69c451ca), - SPH_C32(0xb07a87e2), SPH_C32(0x92e0a4bd) }, - { SPH_C32(0x663d000a), SPH_C32(0xe813a29e), SPH_C32(0x801ebf99), - SPH_C32(0x7fbc2ad9), SPH_C32(0x208d000a), SPH_C32(0x7f9e9ece), - SPH_C32(0x679616ab), SPH_C32(0x35dcdfc0) }, - { SPH_C32(0xa673000b), SPH_C32(0xdbaa628e), SPH_C32(0x2e10049c), - SPH_C32(0xca18ece2), SPH_C32(0xe87c000a), SPH_C32(0x74b3794c), - SPH_C32(0x0c605e0f), SPH_C32(0x6640627f) }, - { SPH_C32(0xaecc000a), SPH_C32(0xe33e451c), SPH_C32(0xebe8f73d), - SPH_C32(0x2c209766), SPH_C32(0x2832000b), SPH_C32(0x470ab95c), - SPH_C32(0xa26ee50a), SPH_C32(0xd3e4a444) }, - { SPH_C32(0x6e82000b), SPH_C32(0xd087850c), SPH_C32(0x45e64c38), - SPH_C32(0x9984515d), SPH_C32(0xe0c3000b), SPH_C32(0x4c275ede), - SPH_C32(0xc998adae), SPH_C32(0x807819fb) }, - { SPH_C32(0x6fba000c), SPH_C32(0x1e61854e), SPH_C32(0xfddca02f), - SPH_C32(0x4f1b49b4), SPH_C32(0xc3070008), SPH_C32(0x6092c0d7), - SPH_C32(0x66418f3c), SPH_C32(0xce05ef02) }, - { SPH_C32(0xaff4000d), SPH_C32(0x2dd8455e), SPH_C32(0x53d21b2a), - SPH_C32(0xfabf8f8f), SPH_C32(0x0bf60008), SPH_C32(0x6bbf2755), - SPH_C32(0x0db7c798), SPH_C32(0x9d9952bd) }, - { SPH_C32(0xa74b000c), SPH_C32(0x154c62cc), SPH_C32(0x962ae88b), - SPH_C32(0x1c87f40b), SPH_C32(0xcbb80009), SPH_C32(0x5806e745), - SPH_C32(0xa3b97c9d), SPH_C32(0x283d9486) }, - { SPH_C32(0x6705000d), SPH_C32(0x26f5a2dc), SPH_C32(0x3824538e), - SPH_C32(0xa9233230), SPH_C32(0x03490009), SPH_C32(0x532b00c7), - SPH_C32(0xc84f3439), SPH_C32(0x7ba12939) }, - { SPH_C32(0xe799000e), SPH_C32(0x418622fd), SPH_C32(0x64392585), - SPH_C32(0xc26ebe45), SPH_C32(0x92ab0008), SPH_C32(0x4571cfc3), - SPH_C32(0x1fa3a570), SPH_C32(0xdc9d5244) }, - { SPH_C32(0x27d7000f), SPH_C32(0x723fe2ed), SPH_C32(0xca379e80), - SPH_C32(0x77ca787e), SPH_C32(0x5a5a0008), SPH_C32(0x4e5c2841), - SPH_C32(0x7455edd4), SPH_C32(0x8f01effb) }, - { SPH_C32(0x2f68000e), SPH_C32(0x4aabc57f), SPH_C32(0x0fcf6d21), - SPH_C32(0x91f203fa), SPH_C32(0x9a140009), SPH_C32(0x7de5e851), - SPH_C32(0xda5b56d1), SPH_C32(0x3aa529c0) }, - { SPH_C32(0xef26000f), SPH_C32(0x7912056f), SPH_C32(0xa1c1d624), - SPH_C32(0x2456c5c1), SPH_C32(0x52e50009), SPH_C32(0x76c80fd3), - SPH_C32(0xb1ad1e75), SPH_C32(0x6939947f) }, - { SPH_C32(0x3e16000c), SPH_C32(0x3b828a5a), SPH_C32(0x843e8a63), - SPH_C32(0x5d83f4f2), SPH_C32(0x1a88000a), SPH_C32(0x1a966870), - SPH_C32(0x864620da), SPH_C32(0x51e8a5b5) }, - { SPH_C32(0xfe58000d), SPH_C32(0x083b4a4a), SPH_C32(0x2a303166), - SPH_C32(0xe82732c9), SPH_C32(0xd279000a), SPH_C32(0x11bb8ff2), - SPH_C32(0xedb0687e), SPH_C32(0x0274180a) }, - { SPH_C32(0xf6e7000c), SPH_C32(0x30af6dd8), SPH_C32(0xefc8c2c7), - SPH_C32(0x0e1f494d), SPH_C32(0x1237000b), SPH_C32(0x22024fe2), - SPH_C32(0x43bed37b), SPH_C32(0xb7d0de31) }, - { SPH_C32(0x36a9000d), SPH_C32(0x0316adc8), SPH_C32(0x41c679c2), - SPH_C32(0xbbbb8f76), SPH_C32(0xdac6000b), SPH_C32(0x292fa860), - SPH_C32(0x28489bdf), SPH_C32(0xe44c638e) }, - { SPH_C32(0xb635000e), SPH_C32(0x64652de9), SPH_C32(0x1ddb0fc9), - SPH_C32(0xd0f60303), SPH_C32(0x4b24000a), SPH_C32(0x3f756764), - SPH_C32(0xffa40a96), SPH_C32(0x437018f3) }, - { SPH_C32(0x767b000f), SPH_C32(0x57dcedf9), SPH_C32(0xb3d5b4cc), - SPH_C32(0x6552c538), SPH_C32(0x83d5000a), SPH_C32(0x345880e6), - SPH_C32(0x94524232), SPH_C32(0x10eca54c) }, - { SPH_C32(0x7ec4000e), SPH_C32(0x6f48ca6b), SPH_C32(0x762d476d), - SPH_C32(0x836abebc), SPH_C32(0x439b000b), SPH_C32(0x07e140f6), - SPH_C32(0x3a5cf937), SPH_C32(0xa5486377) }, - { SPH_C32(0xbe8a000f), SPH_C32(0x5cf10a7b), SPH_C32(0xd823fc68), - SPH_C32(0x36ce7887), SPH_C32(0x8b6a000b), SPH_C32(0x0ccca774), - SPH_C32(0x51aab193), SPH_C32(0xf6d4dec8) }, - { SPH_C32(0xd41b0008), SPH_C32(0xd2fcf393), SPH_C32(0xf82b0c42), - SPH_C32(0x96fda75d), SPH_C32(0x130f000c), SPH_C32(0xece44fa0), - SPH_C32(0xfb843f6c), SPH_C32(0x614fc6d8) }, - { SPH_C32(0x14550009), SPH_C32(0xe1453383), SPH_C32(0x5625b747), - SPH_C32(0x23596166), SPH_C32(0xdbfe000c), SPH_C32(0xe7c9a822), - SPH_C32(0x907277c8), SPH_C32(0x32d37b67) }, - { SPH_C32(0x1cea0008), SPH_C32(0xd9d11411), SPH_C32(0x93dd44e6), - SPH_C32(0xc5611ae2), SPH_C32(0x1bb0000d), SPH_C32(0xd4706832), - SPH_C32(0x3e7ccccd), SPH_C32(0x8777bd5c) }, - { SPH_C32(0xdca40009), SPH_C32(0xea68d401), SPH_C32(0x3dd3ffe3), - SPH_C32(0x70c5dcd9), SPH_C32(0xd341000d), SPH_C32(0xdf5d8fb0), - SPH_C32(0x558a8469), SPH_C32(0xd4eb00e3) }, - { SPH_C32(0x5c38000a), SPH_C32(0x8d1b5420), SPH_C32(0x61ce89e8), - SPH_C32(0x1b8850ac), SPH_C32(0x42a3000c), SPH_C32(0xc90740b4), - SPH_C32(0x82661520), SPH_C32(0x73d77b9e) }, - { SPH_C32(0x9c76000b), SPH_C32(0xbea29430), SPH_C32(0xcfc032ed), - SPH_C32(0xae2c9697), SPH_C32(0x8a52000c), SPH_C32(0xc22aa736), - SPH_C32(0xe9905d84), SPH_C32(0x204bc621) }, - { SPH_C32(0x94c9000a), SPH_C32(0x8636b3a2), SPH_C32(0x0a38c14c), - SPH_C32(0x4814ed13), SPH_C32(0x4a1c000d), SPH_C32(0xf1936726), - SPH_C32(0x479ee681), SPH_C32(0x95ef001a) }, - { SPH_C32(0x5487000b), SPH_C32(0xb58f73b2), SPH_C32(0xa4367a49), - SPH_C32(0xfdb02b28), SPH_C32(0x82ed000d), SPH_C32(0xfabe80a4), - SPH_C32(0x2c68ae25), SPH_C32(0xc673bda5) }, - { SPH_C32(0x85b70008), SPH_C32(0xf71ffc87), SPH_C32(0x81c9260e), - SPH_C32(0x84651a1b), SPH_C32(0xca80000e), SPH_C32(0x96e0e707), - SPH_C32(0x1b83908a), SPH_C32(0xfea28c6f) }, - { SPH_C32(0x45f90009), SPH_C32(0xc4a63c97), SPH_C32(0x2fc79d0b), - SPH_C32(0x31c1dc20), SPH_C32(0x0271000e), SPH_C32(0x9dcd0085), - SPH_C32(0x7075d82e), SPH_C32(0xad3e31d0) }, - { SPH_C32(0x4d460008), SPH_C32(0xfc321b05), SPH_C32(0xea3f6eaa), - SPH_C32(0xd7f9a7a4), SPH_C32(0xc23f000f), SPH_C32(0xae74c095), - SPH_C32(0xde7b632b), SPH_C32(0x189af7eb) }, - { SPH_C32(0x8d080009), SPH_C32(0xcf8bdb15), SPH_C32(0x4431d5af), - SPH_C32(0x625d619f), SPH_C32(0x0ace000f), SPH_C32(0xa5592717), - SPH_C32(0xb58d2b8f), SPH_C32(0x4b064a54) }, - { SPH_C32(0x0d94000a), SPH_C32(0xa8f85b34), SPH_C32(0x182ca3a4), - SPH_C32(0x0910edea), SPH_C32(0x9b2c000e), SPH_C32(0xb303e813), - SPH_C32(0x6261bac6), SPH_C32(0xec3a3129) }, - { SPH_C32(0xcdda000b), SPH_C32(0x9b419b24), SPH_C32(0xb62218a1), - SPH_C32(0xbcb42bd1), SPH_C32(0x53dd000e), SPH_C32(0xb82e0f91), - SPH_C32(0x0997f262), SPH_C32(0xbfa68c96) }, - { SPH_C32(0xc565000a), SPH_C32(0xa3d5bcb6), SPH_C32(0x73daeb00), - SPH_C32(0x5a8c5055), SPH_C32(0x9393000f), SPH_C32(0x8b97cf81), - SPH_C32(0xa7994967), SPH_C32(0x0a024aad) }, - { SPH_C32(0x052b000b), SPH_C32(0x906c7ca6), SPH_C32(0xddd45005), - SPH_C32(0xef28966e), SPH_C32(0x5b62000f), SPH_C32(0x80ba2803), - SPH_C32(0xcc6f01c3), SPH_C32(0x599ef712) }, - { SPH_C32(0x0413000c), SPH_C32(0x5e8a7ce4), SPH_C32(0x65eebc12), - SPH_C32(0x39b78e87), SPH_C32(0x78a6000c), SPH_C32(0xac0fb60a), - SPH_C32(0x63b62351), SPH_C32(0x17e301eb) }, - { SPH_C32(0xc45d000d), SPH_C32(0x6d33bcf4), SPH_C32(0xcbe00717), - SPH_C32(0x8c1348bc), SPH_C32(0xb057000c), SPH_C32(0xa7225188), - SPH_C32(0x08406bf5), SPH_C32(0x447fbc54) }, - { SPH_C32(0xcce2000c), SPH_C32(0x55a79b66), SPH_C32(0x0e18f4b6), - SPH_C32(0x6a2b3338), SPH_C32(0x7019000d), SPH_C32(0x949b9198), - SPH_C32(0xa64ed0f0), SPH_C32(0xf1db7a6f) }, - { SPH_C32(0x0cac000d), SPH_C32(0x661e5b76), SPH_C32(0xa0164fb3), - SPH_C32(0xdf8ff503), SPH_C32(0xb8e8000d), SPH_C32(0x9fb6761a), - SPH_C32(0xcdb89854), SPH_C32(0xa247c7d0) }, - { SPH_C32(0x8c30000e), SPH_C32(0x016ddb57), SPH_C32(0xfc0b39b8), - SPH_C32(0xb4c27976), SPH_C32(0x290a000c), SPH_C32(0x89ecb91e), - SPH_C32(0x1a54091d), SPH_C32(0x057bbcad) }, - { SPH_C32(0x4c7e000f), SPH_C32(0x32d41b47), SPH_C32(0x520582bd), - SPH_C32(0x0166bf4d), SPH_C32(0xe1fb000c), SPH_C32(0x82c15e9c), - SPH_C32(0x71a241b9), SPH_C32(0x56e70112) }, - { SPH_C32(0x44c1000e), SPH_C32(0x0a403cd5), SPH_C32(0x97fd711c), - SPH_C32(0xe75ec4c9), SPH_C32(0x21b5000d), SPH_C32(0xb1789e8c), - SPH_C32(0xdfacfabc), SPH_C32(0xe343c729) }, - { SPH_C32(0x848f000f), SPH_C32(0x39f9fcc5), SPH_C32(0x39f3ca19), - SPH_C32(0x52fa02f2), SPH_C32(0xe944000d), SPH_C32(0xba55790e), - SPH_C32(0xb45ab218), SPH_C32(0xb0df7a96) }, - { SPH_C32(0x55bf000c), SPH_C32(0x7b6973f0), SPH_C32(0x1c0c965e), - SPH_C32(0x2b2f33c1), SPH_C32(0xa129000e), SPH_C32(0xd60b1ead), - SPH_C32(0x83b18cb7), SPH_C32(0x880e4b5c) }, - { SPH_C32(0x95f1000d), SPH_C32(0x48d0b3e0), SPH_C32(0xb2022d5b), - SPH_C32(0x9e8bf5fa), SPH_C32(0x69d8000e), SPH_C32(0xdd26f92f), - SPH_C32(0xe847c413), SPH_C32(0xdb92f6e3) }, - { SPH_C32(0x9d4e000c), SPH_C32(0x70449472), SPH_C32(0x77fadefa), - SPH_C32(0x78b38e7e), SPH_C32(0xa996000f), SPH_C32(0xee9f393f), - SPH_C32(0x46497f16), SPH_C32(0x6e3630d8) }, - { SPH_C32(0x5d00000d), SPH_C32(0x43fd5462), SPH_C32(0xd9f465ff), - SPH_C32(0xcd174845), SPH_C32(0x6167000f), SPH_C32(0xe5b2debd), - SPH_C32(0x2dbf37b2), SPH_C32(0x3daa8d67) }, - { SPH_C32(0xdd9c000e), SPH_C32(0x248ed443), SPH_C32(0x85e913f4), - SPH_C32(0xa65ac430), SPH_C32(0xf085000e), SPH_C32(0xf3e811b9), - SPH_C32(0xfa53a6fb), SPH_C32(0x9a96f61a) }, - { SPH_C32(0x1dd2000f), SPH_C32(0x17371453), SPH_C32(0x2be7a8f1), - SPH_C32(0x13fe020b), SPH_C32(0x3874000e), SPH_C32(0xf8c5f63b), - SPH_C32(0x91a5ee5f), SPH_C32(0xc90a4ba5) }, - { SPH_C32(0x156d000e), SPH_C32(0x2fa333c1), SPH_C32(0xee1f5b50), - SPH_C32(0xf5c6798f), SPH_C32(0xf83a000f), SPH_C32(0xcb7c362b), - SPH_C32(0x3fab555a), SPH_C32(0x7cae8d9e) }, - { SPH_C32(0xd523000f), SPH_C32(0x1c1af3d1), SPH_C32(0x4011e055), - SPH_C32(0x4062bfb4), SPH_C32(0x30cb000f), SPH_C32(0xc051d1a9), - SPH_C32(0x545d1dfe), SPH_C32(0x2f323021) } -}; - -#define INPUT_SMALL do { \ - unsigned acc = buf[0]; \ - const sph_u32 *rp; \ - rp = &T256_0[acc][0]; \ - m0 = rp[0]; \ - m1 = rp[1]; \ - m2 = rp[2]; \ - m3 = rp[3]; \ - m4 = rp[4]; \ - m5 = rp[5]; \ - m6 = rp[6]; \ - m7 = rp[7]; \ - acc = buf[1]; \ - rp = &T256_8[acc][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - acc = buf[2]; \ - rp = &T256_16[acc][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - acc = buf[3]; \ - rp = &T256_24[acc][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - } while (0) - -#endif - -#if SPH_HAMSI_EXPAND_BIG == 1 - -/* Note: this table lists bits within each byte from least - siginificant to most significant. */ -static const sph_u32 T512[64][16] = { - { SPH_C32(0xef0b0270), SPH_C32(0x3afd0000), SPH_C32(0x5dae0000), - SPH_C32(0x69490000), SPH_C32(0x9b0f3c06), SPH_C32(0x4405b5f9), - SPH_C32(0x66140a51), SPH_C32(0x924f5d0a), SPH_C32(0xc96b0030), - SPH_C32(0xe7250000), SPH_C32(0x2f840000), SPH_C32(0x264f0000), - SPH_C32(0x08695bf9), SPH_C32(0x6dfcf137), SPH_C32(0x509f6984), - SPH_C32(0x9e69af68) }, - { SPH_C32(0xc96b0030), SPH_C32(0xe7250000), SPH_C32(0x2f840000), - SPH_C32(0x264f0000), SPH_C32(0x08695bf9), SPH_C32(0x6dfcf137), - SPH_C32(0x509f6984), SPH_C32(0x9e69af68), SPH_C32(0x26600240), - SPH_C32(0xddd80000), SPH_C32(0x722a0000), SPH_C32(0x4f060000), - SPH_C32(0x936667ff), SPH_C32(0x29f944ce), SPH_C32(0x368b63d5), - SPH_C32(0x0c26f262) }, - { SPH_C32(0x145a3c00), SPH_C32(0xb9e90000), SPH_C32(0x61270000), - SPH_C32(0xf1610000), SPH_C32(0xce613d6c), SPH_C32(0xb0493d78), - SPH_C32(0x47a96720), SPH_C32(0xe18e24c5), SPH_C32(0x23671400), - SPH_C32(0xc8b90000), SPH_C32(0xf4c70000), SPH_C32(0xfb750000), - SPH_C32(0x73cd2465), SPH_C32(0xf8a6a549), SPH_C32(0x02c40a3f), - SPH_C32(0xdc24e61f) }, - { SPH_C32(0x23671400), SPH_C32(0xc8b90000), SPH_C32(0xf4c70000), - SPH_C32(0xfb750000), SPH_C32(0x73cd2465), SPH_C32(0xf8a6a549), - SPH_C32(0x02c40a3f), SPH_C32(0xdc24e61f), SPH_C32(0x373d2800), - SPH_C32(0x71500000), SPH_C32(0x95e00000), SPH_C32(0x0a140000), - SPH_C32(0xbdac1909), SPH_C32(0x48ef9831), SPH_C32(0x456d6d1f), - SPH_C32(0x3daac2da) }, - { SPH_C32(0x54285c00), SPH_C32(0xeaed0000), SPH_C32(0xc5d60000), - SPH_C32(0xa1c50000), SPH_C32(0xb3a26770), SPH_C32(0x94a5c4e1), - SPH_C32(0x6bb0419d), SPH_C32(0x551b3782), SPH_C32(0x9cbb1800), - SPH_C32(0xb0d30000), SPH_C32(0x92510000), SPH_C32(0xed930000), - SPH_C32(0x593a4345), SPH_C32(0xe114d5f4), SPH_C32(0x430633da), - SPH_C32(0x78cace29) }, - { SPH_C32(0x9cbb1800), SPH_C32(0xb0d30000), SPH_C32(0x92510000), - SPH_C32(0xed930000), SPH_C32(0x593a4345), SPH_C32(0xe114d5f4), - SPH_C32(0x430633da), SPH_C32(0x78cace29), SPH_C32(0xc8934400), - SPH_C32(0x5a3e0000), SPH_C32(0x57870000), SPH_C32(0x4c560000), - SPH_C32(0xea982435), SPH_C32(0x75b11115), SPH_C32(0x28b67247), - SPH_C32(0x2dd1f9ab) }, - { SPH_C32(0x29449c00), SPH_C32(0x64e70000), SPH_C32(0xf24b0000), - SPH_C32(0xc2f30000), SPH_C32(0x0ede4e8f), SPH_C32(0x56c23745), - SPH_C32(0xf3e04259), SPH_C32(0x8d0d9ec4), SPH_C32(0x466d0c00), - SPH_C32(0x08620000), SPH_C32(0xdd5d0000), SPH_C32(0xbadd0000), - SPH_C32(0x6a927942), SPH_C32(0x441f2b93), SPH_C32(0x218ace6f), - SPH_C32(0xbf2c0be2) }, - { SPH_C32(0x466d0c00), SPH_C32(0x08620000), SPH_C32(0xdd5d0000), - SPH_C32(0xbadd0000), SPH_C32(0x6a927942), SPH_C32(0x441f2b93), - SPH_C32(0x218ace6f), SPH_C32(0xbf2c0be2), SPH_C32(0x6f299000), - SPH_C32(0x6c850000), SPH_C32(0x2f160000), SPH_C32(0x782e0000), - SPH_C32(0x644c37cd), SPH_C32(0x12dd1cd6), SPH_C32(0xd26a8c36), - SPH_C32(0x32219526) }, - { SPH_C32(0xf6800005), SPH_C32(0x3443c000), SPH_C32(0x24070000), - SPH_C32(0x8f3d0000), SPH_C32(0x21373bfb), SPH_C32(0x0ab8d5ae), - SPH_C32(0xcdc58b19), SPH_C32(0xd795ba31), SPH_C32(0xa67f0001), - SPH_C32(0x71378000), SPH_C32(0x19fc0000), SPH_C32(0x96db0000), - SPH_C32(0x3a8b6dfd), SPH_C32(0xebcaaef3), SPH_C32(0x2c6d478f), - SPH_C32(0xac8e6c88) }, - { SPH_C32(0xa67f0001), SPH_C32(0x71378000), SPH_C32(0x19fc0000), - SPH_C32(0x96db0000), SPH_C32(0x3a8b6dfd), SPH_C32(0xebcaaef3), - SPH_C32(0x2c6d478f), SPH_C32(0xac8e6c88), SPH_C32(0x50ff0004), - SPH_C32(0x45744000), SPH_C32(0x3dfb0000), SPH_C32(0x19e60000), - SPH_C32(0x1bbc5606), SPH_C32(0xe1727b5d), SPH_C32(0xe1a8cc96), - SPH_C32(0x7b1bd6b9) }, - { SPH_C32(0xf7750009), SPH_C32(0xcf3cc000), SPH_C32(0xc3d60000), - SPH_C32(0x04920000), SPH_C32(0x029519a9), SPH_C32(0xf8e836ba), - SPH_C32(0x7a87f14e), SPH_C32(0x9e16981a), SPH_C32(0xd46a0000), - SPH_C32(0x8dc8c000), SPH_C32(0xa5af0000), SPH_C32(0x4a290000), - SPH_C32(0xfc4e427a), SPH_C32(0xc9b4866c), SPH_C32(0x98369604), - SPH_C32(0xf746c320) }, - { SPH_C32(0xd46a0000), SPH_C32(0x8dc8c000), SPH_C32(0xa5af0000), - SPH_C32(0x4a290000), SPH_C32(0xfc4e427a), SPH_C32(0xc9b4866c), - SPH_C32(0x98369604), SPH_C32(0xf746c320), SPH_C32(0x231f0009), - SPH_C32(0x42f40000), SPH_C32(0x66790000), SPH_C32(0x4ebb0000), - SPH_C32(0xfedb5bd3), SPH_C32(0x315cb0d6), SPH_C32(0xe2b1674a), - SPH_C32(0x69505b3a) }, - { SPH_C32(0x774400f0), SPH_C32(0xf15a0000), SPH_C32(0xf5b20000), - SPH_C32(0x34140000), SPH_C32(0x89377e8c), SPH_C32(0x5a8bec25), - SPH_C32(0x0bc3cd1e), SPH_C32(0xcf3775cb), SPH_C32(0xf46c0050), - SPH_C32(0x96180000), SPH_C32(0x14a50000), SPH_C32(0x031f0000), - SPH_C32(0x42947eb8), SPH_C32(0x66bf7e19), SPH_C32(0x9ca470d2), - SPH_C32(0x8a341574) }, - { SPH_C32(0xf46c0050), SPH_C32(0x96180000), SPH_C32(0x14a50000), - SPH_C32(0x031f0000), SPH_C32(0x42947eb8), SPH_C32(0x66bf7e19), - SPH_C32(0x9ca470d2), SPH_C32(0x8a341574), SPH_C32(0x832800a0), - SPH_C32(0x67420000), SPH_C32(0xe1170000), SPH_C32(0x370b0000), - SPH_C32(0xcba30034), SPH_C32(0x3c34923c), SPH_C32(0x9767bdcc), - SPH_C32(0x450360bf) }, - { SPH_C32(0xe8870170), SPH_C32(0x9d720000), SPH_C32(0x12db0000), - SPH_C32(0xd4220000), SPH_C32(0xf2886b27), SPH_C32(0xa921e543), - SPH_C32(0x4ef8b518), SPH_C32(0x618813b1), SPH_C32(0xb4370060), - SPH_C32(0x0c4c0000), SPH_C32(0x56c20000), SPH_C32(0x5cae0000), - SPH_C32(0x94541f3f), SPH_C32(0x3b3ef825), SPH_C32(0x1b365f3d), - SPH_C32(0xf3d45758) }, - { SPH_C32(0xb4370060), SPH_C32(0x0c4c0000), SPH_C32(0x56c20000), - SPH_C32(0x5cae0000), SPH_C32(0x94541f3f), SPH_C32(0x3b3ef825), - SPH_C32(0x1b365f3d), SPH_C32(0xf3d45758), SPH_C32(0x5cb00110), - SPH_C32(0x913e0000), SPH_C32(0x44190000), SPH_C32(0x888c0000), - SPH_C32(0x66dc7418), SPH_C32(0x921f1d66), SPH_C32(0x55ceea25), - SPH_C32(0x925c44e9) }, - { SPH_C32(0x0c720000), SPH_C32(0x49e50f00), SPH_C32(0x42790000), - SPH_C32(0x5cea0000), SPH_C32(0x33aa301a), SPH_C32(0x15822514), - SPH_C32(0x95a34b7b), SPH_C32(0xb44b0090), SPH_C32(0xfe220000), - SPH_C32(0xa7580500), SPH_C32(0x25d10000), SPH_C32(0xf7600000), - SPH_C32(0x893178da), SPH_C32(0x1fd4f860), SPH_C32(0x4ed0a315), - SPH_C32(0xa123ff9f) }, - { SPH_C32(0xfe220000), SPH_C32(0xa7580500), SPH_C32(0x25d10000), - SPH_C32(0xf7600000), SPH_C32(0x893178da), SPH_C32(0x1fd4f860), - SPH_C32(0x4ed0a315), SPH_C32(0xa123ff9f), SPH_C32(0xf2500000), - SPH_C32(0xeebd0a00), SPH_C32(0x67a80000), SPH_C32(0xab8a0000), - SPH_C32(0xba9b48c0), SPH_C32(0x0a56dd74), SPH_C32(0xdb73e86e), - SPH_C32(0x1568ff0f) }, - { SPH_C32(0x45180000), SPH_C32(0xa5b51700), SPH_C32(0xf96a0000), - SPH_C32(0x3b480000), SPH_C32(0x1ecc142c), SPH_C32(0x231395d6), - SPH_C32(0x16bca6b0), SPH_C32(0xdf33f4df), SPH_C32(0xb83d0000), - SPH_C32(0x16710600), SPH_C32(0x379a0000), SPH_C32(0xf5b10000), - SPH_C32(0x228161ac), SPH_C32(0xae48f145), SPH_C32(0x66241616), - SPH_C32(0xc5c1eb3e) }, - { SPH_C32(0xb83d0000), SPH_C32(0x16710600), SPH_C32(0x379a0000), - SPH_C32(0xf5b10000), SPH_C32(0x228161ac), SPH_C32(0xae48f145), - SPH_C32(0x66241616), SPH_C32(0xc5c1eb3e), SPH_C32(0xfd250000), - SPH_C32(0xb3c41100), SPH_C32(0xcef00000), SPH_C32(0xcef90000), - SPH_C32(0x3c4d7580), SPH_C32(0x8d5b6493), SPH_C32(0x7098b0a6), - SPH_C32(0x1af21fe1) }, - { SPH_C32(0x75a40000), SPH_C32(0xc28b2700), SPH_C32(0x94a40000), - SPH_C32(0x90f50000), SPH_C32(0xfb7857e0), SPH_C32(0x49ce0bae), - SPH_C32(0x1767c483), SPH_C32(0xaedf667e), SPH_C32(0xd1660000), - SPH_C32(0x1bbc0300), SPH_C32(0x9eec0000), SPH_C32(0xf6940000), - SPH_C32(0x03024527), SPH_C32(0xcf70fcf2), SPH_C32(0xb4431b17), - SPH_C32(0x857f3c2b) }, - { SPH_C32(0xd1660000), SPH_C32(0x1bbc0300), SPH_C32(0x9eec0000), - SPH_C32(0xf6940000), SPH_C32(0x03024527), SPH_C32(0xcf70fcf2), - SPH_C32(0xb4431b17), SPH_C32(0x857f3c2b), SPH_C32(0xa4c20000), - SPH_C32(0xd9372400), SPH_C32(0x0a480000), SPH_C32(0x66610000), - SPH_C32(0xf87a12c7), SPH_C32(0x86bef75c), SPH_C32(0xa324df94), - SPH_C32(0x2ba05a55) }, - { SPH_C32(0x75c90003), SPH_C32(0x0e10c000), SPH_C32(0xd1200000), - SPH_C32(0xbaea0000), SPH_C32(0x8bc42f3e), SPH_C32(0x8758b757), - SPH_C32(0xbb28761d), SPH_C32(0x00b72e2b), SPH_C32(0xeecf0001), - SPH_C32(0x6f564000), SPH_C32(0xf33e0000), SPH_C32(0xa79e0000), - SPH_C32(0xbdb57219), SPH_C32(0xb711ebc5), SPH_C32(0x4a3b40ba), - SPH_C32(0xfeabf254) }, - { SPH_C32(0xeecf0001), SPH_C32(0x6f564000), SPH_C32(0xf33e0000), - SPH_C32(0xa79e0000), SPH_C32(0xbdb57219), SPH_C32(0xb711ebc5), - SPH_C32(0x4a3b40ba), SPH_C32(0xfeabf254), SPH_C32(0x9b060002), - SPH_C32(0x61468000), SPH_C32(0x221e0000), SPH_C32(0x1d740000), - SPH_C32(0x36715d27), SPH_C32(0x30495c92), SPH_C32(0xf11336a7), - SPH_C32(0xfe1cdc7f) }, - { SPH_C32(0x86790000), SPH_C32(0x3f390002), SPH_C32(0xe19ae000), - SPH_C32(0x98560000), SPH_C32(0x9565670e), SPH_C32(0x4e88c8ea), - SPH_C32(0xd3dd4944), SPH_C32(0x161ddab9), SPH_C32(0x30b70000), - SPH_C32(0xe5d00000), SPH_C32(0xf4f46000), SPH_C32(0x42c40000), - SPH_C32(0x63b83d6a), SPH_C32(0x78ba9460), SPH_C32(0x21afa1ea), - SPH_C32(0xb0a51834) }, - { SPH_C32(0x30b70000), SPH_C32(0xe5d00000), SPH_C32(0xf4f46000), - SPH_C32(0x42c40000), SPH_C32(0x63b83d6a), SPH_C32(0x78ba9460), - SPH_C32(0x21afa1ea), SPH_C32(0xb0a51834), SPH_C32(0xb6ce0000), - SPH_C32(0xdae90002), SPH_C32(0x156e8000), SPH_C32(0xda920000), - SPH_C32(0xf6dd5a64), SPH_C32(0x36325c8a), SPH_C32(0xf272e8ae), - SPH_C32(0xa6b8c28d) }, - { SPH_C32(0x14190000), SPH_C32(0x23ca003c), SPH_C32(0x50df0000), - SPH_C32(0x44b60000), SPH_C32(0x1b6c67b0), SPH_C32(0x3cf3ac75), - SPH_C32(0x61e610b0), SPH_C32(0xdbcadb80), SPH_C32(0xe3430000), - SPH_C32(0x3a4e0014), SPH_C32(0xf2c60000), SPH_C32(0xaa4e0000), - SPH_C32(0xdb1e42a6), SPH_C32(0x256bbe15), SPH_C32(0x123db156), - SPH_C32(0x3a4e99d7) }, - { SPH_C32(0xe3430000), SPH_C32(0x3a4e0014), SPH_C32(0xf2c60000), - SPH_C32(0xaa4e0000), SPH_C32(0xdb1e42a6), SPH_C32(0x256bbe15), - SPH_C32(0x123db156), SPH_C32(0x3a4e99d7), SPH_C32(0xf75a0000), - SPH_C32(0x19840028), SPH_C32(0xa2190000), SPH_C32(0xeef80000), - SPH_C32(0xc0722516), SPH_C32(0x19981260), SPH_C32(0x73dba1e6), - SPH_C32(0xe1844257) }, - { SPH_C32(0x54500000), SPH_C32(0x0671005c), SPH_C32(0x25ae0000), - SPH_C32(0x6a1e0000), SPH_C32(0x2ea54edf), SPH_C32(0x664e8512), - SPH_C32(0xbfba18c3), SPH_C32(0x7e715d17), SPH_C32(0xbc8d0000), - SPH_C32(0xfc3b0018), SPH_C32(0x19830000), SPH_C32(0xd10b0000), - SPH_C32(0xae1878c4), SPH_C32(0x42a69856), SPH_C32(0x0012da37), - SPH_C32(0x2c3b504e) }, - { SPH_C32(0xbc8d0000), SPH_C32(0xfc3b0018), SPH_C32(0x19830000), - SPH_C32(0xd10b0000), SPH_C32(0xae1878c4), SPH_C32(0x42a69856), - SPH_C32(0x0012da37), SPH_C32(0x2c3b504e), SPH_C32(0xe8dd0000), - SPH_C32(0xfa4a0044), SPH_C32(0x3c2d0000), SPH_C32(0xbb150000), - SPH_C32(0x80bd361b), SPH_C32(0x24e81d44), SPH_C32(0xbfa8c2f4), - SPH_C32(0x524a0d59) }, - { SPH_C32(0x69510000), SPH_C32(0xd4e1009c), SPH_C32(0xc3230000), - SPH_C32(0xac2f0000), SPH_C32(0xe4950bae), SPH_C32(0xcea415dc), - SPH_C32(0x87ec287c), SPH_C32(0xbce1a3ce), SPH_C32(0xc6730000), - SPH_C32(0xaf8d000c), SPH_C32(0xa4c10000), SPH_C32(0x218d0000), - SPH_C32(0x23111587), SPH_C32(0x7913512f), SPH_C32(0x1d28ac88), - SPH_C32(0x378dd173) }, - { SPH_C32(0xc6730000), SPH_C32(0xaf8d000c), SPH_C32(0xa4c10000), - SPH_C32(0x218d0000), SPH_C32(0x23111587), SPH_C32(0x7913512f), - SPH_C32(0x1d28ac88), SPH_C32(0x378dd173), SPH_C32(0xaf220000), - SPH_C32(0x7b6c0090), SPH_C32(0x67e20000), SPH_C32(0x8da20000), - SPH_C32(0xc7841e29), SPH_C32(0xb7b744f3), SPH_C32(0x9ac484f4), - SPH_C32(0x8b6c72bd) }, - { SPH_C32(0xcc140000), SPH_C32(0xa5630000), SPH_C32(0x5ab90780), - SPH_C32(0x3b500000), SPH_C32(0x4bd013ff), SPH_C32(0x879b3418), - SPH_C32(0x694348c1), SPH_C32(0xca5a87fe), SPH_C32(0x819e0000), - SPH_C32(0xec570000), SPH_C32(0x66320280), SPH_C32(0x95f30000), - SPH_C32(0x5da92802), SPH_C32(0x48f43cbc), SPH_C32(0xe65aa22d), - SPH_C32(0x8e67b7fa) }, - { SPH_C32(0x819e0000), SPH_C32(0xec570000), SPH_C32(0x66320280), - SPH_C32(0x95f30000), SPH_C32(0x5da92802), SPH_C32(0x48f43cbc), - SPH_C32(0xe65aa22d), SPH_C32(0x8e67b7fa), SPH_C32(0x4d8a0000), - SPH_C32(0x49340000), SPH_C32(0x3c8b0500), SPH_C32(0xaea30000), - SPH_C32(0x16793bfd), SPH_C32(0xcf6f08a4), SPH_C32(0x8f19eaec), - SPH_C32(0x443d3004) }, - { SPH_C32(0x78230000), SPH_C32(0x12fc0000), SPH_C32(0xa93a0b80), - SPH_C32(0x90a50000), SPH_C32(0x713e2879), SPH_C32(0x7ee98924), - SPH_C32(0xf08ca062), SPH_C32(0x636f8bab), SPH_C32(0x02af0000), - SPH_C32(0xb7280000), SPH_C32(0xba1c0300), SPH_C32(0x56980000), - SPH_C32(0xba8d45d3), SPH_C32(0x8048c667), SPH_C32(0xa95c149a), - SPH_C32(0xf4f6ea7b) }, - { SPH_C32(0x02af0000), SPH_C32(0xb7280000), SPH_C32(0xba1c0300), - SPH_C32(0x56980000), SPH_C32(0xba8d45d3), SPH_C32(0x8048c667), - SPH_C32(0xa95c149a), SPH_C32(0xf4f6ea7b), SPH_C32(0x7a8c0000), - SPH_C32(0xa5d40000), SPH_C32(0x13260880), SPH_C32(0xc63d0000), - SPH_C32(0xcbb36daa), SPH_C32(0xfea14f43), SPH_C32(0x59d0b4f8), - SPH_C32(0x979961d0) }, - { SPH_C32(0xac480000), SPH_C32(0x1ba60000), SPH_C32(0x45fb1380), - SPH_C32(0x03430000), SPH_C32(0x5a85316a), SPH_C32(0x1fb250b6), - SPH_C32(0xfe72c7fe), SPH_C32(0x91e478f6), SPH_C32(0x1e4e0000), - SPH_C32(0xdecf0000), SPH_C32(0x6df80180), SPH_C32(0x77240000), - SPH_C32(0xec47079e), SPH_C32(0xf4a0694e), SPH_C32(0xcda31812), - SPH_C32(0x98aa496e) }, - { SPH_C32(0x1e4e0000), SPH_C32(0xdecf0000), SPH_C32(0x6df80180), - SPH_C32(0x77240000), SPH_C32(0xec47079e), SPH_C32(0xf4a0694e), - SPH_C32(0xcda31812), SPH_C32(0x98aa496e), SPH_C32(0xb2060000), - SPH_C32(0xc5690000), SPH_C32(0x28031200), SPH_C32(0x74670000), - SPH_C32(0xb6c236f4), SPH_C32(0xeb1239f8), SPH_C32(0x33d1dfec), - SPH_C32(0x094e3198) }, - { SPH_C32(0xaec30000), SPH_C32(0x9c4f0001), SPH_C32(0x79d1e000), - SPH_C32(0x2c150000), SPH_C32(0x45cc75b3), SPH_C32(0x6650b736), - SPH_C32(0xab92f78f), SPH_C32(0xa312567b), SPH_C32(0xdb250000), - SPH_C32(0x09290000), SPH_C32(0x49aac000), SPH_C32(0x81e10000), - SPH_C32(0xcafe6b59), SPH_C32(0x42793431), SPH_C32(0x43566b76), - SPH_C32(0xe86cba2e) }, - { SPH_C32(0xdb250000), SPH_C32(0x09290000), SPH_C32(0x49aac000), - SPH_C32(0x81e10000), SPH_C32(0xcafe6b59), SPH_C32(0x42793431), - SPH_C32(0x43566b76), SPH_C32(0xe86cba2e), SPH_C32(0x75e60000), - SPH_C32(0x95660001), SPH_C32(0x307b2000), SPH_C32(0xadf40000), - SPH_C32(0x8f321eea), SPH_C32(0x24298307), SPH_C32(0xe8c49cf9), - SPH_C32(0x4b7eec55) }, - { SPH_C32(0x58430000), SPH_C32(0x807e0000), SPH_C32(0x78330001), - SPH_C32(0xc66b3800), SPH_C32(0xe7375cdc), SPH_C32(0x79ad3fdd), - SPH_C32(0xac73fe6f), SPH_C32(0x3a4479b1), SPH_C32(0x1d5a0000), - SPH_C32(0x2b720000), SPH_C32(0x488d0000), SPH_C32(0xaf611800), - SPH_C32(0x25cb2ec5), SPH_C32(0xc879bfd0), SPH_C32(0x81a20429), - SPH_C32(0x1e7536a6) }, - { SPH_C32(0x1d5a0000), SPH_C32(0x2b720000), SPH_C32(0x488d0000), - SPH_C32(0xaf611800), SPH_C32(0x25cb2ec5), SPH_C32(0xc879bfd0), - SPH_C32(0x81a20429), SPH_C32(0x1e7536a6), SPH_C32(0x45190000), - SPH_C32(0xab0c0000), SPH_C32(0x30be0001), SPH_C32(0x690a2000), - SPH_C32(0xc2fc7219), SPH_C32(0xb1d4800d), SPH_C32(0x2dd1fa46), - SPH_C32(0x24314f17) }, - { SPH_C32(0xa53b0000), SPH_C32(0x14260000), SPH_C32(0x4e30001e), - SPH_C32(0x7cae0000), SPH_C32(0x8f9e0dd5), SPH_C32(0x78dfaa3d), - SPH_C32(0xf73168d8), SPH_C32(0x0b1b4946), SPH_C32(0x07ed0000), - SPH_C32(0xb2500000), SPH_C32(0x8774000a), SPH_C32(0x970d0000), - SPH_C32(0x437223ae), SPH_C32(0x48c76ea4), SPH_C32(0xf4786222), - SPH_C32(0x9075b1ce) }, - { SPH_C32(0x07ed0000), SPH_C32(0xb2500000), SPH_C32(0x8774000a), - SPH_C32(0x970d0000), SPH_C32(0x437223ae), SPH_C32(0x48c76ea4), - SPH_C32(0xf4786222), SPH_C32(0x9075b1ce), SPH_C32(0xa2d60000), - SPH_C32(0xa6760000), SPH_C32(0xc9440014), SPH_C32(0xeba30000), - SPH_C32(0xccec2e7b), SPH_C32(0x3018c499), SPH_C32(0x03490afa), - SPH_C32(0x9b6ef888) }, - { SPH_C32(0x88980000), SPH_C32(0x1f940000), SPH_C32(0x7fcf002e), - SPH_C32(0xfb4e0000), SPH_C32(0xf158079a), SPH_C32(0x61ae9167), - SPH_C32(0xa895706c), SPH_C32(0xe6107494), SPH_C32(0x0bc20000), - SPH_C32(0xdb630000), SPH_C32(0x7e88000c), SPH_C32(0x15860000), - SPH_C32(0x91fd48f3), SPH_C32(0x7581bb43), SPH_C32(0xf460449e), - SPH_C32(0xd8b61463) }, - { SPH_C32(0x0bc20000), SPH_C32(0xdb630000), SPH_C32(0x7e88000c), - SPH_C32(0x15860000), SPH_C32(0x91fd48f3), SPH_C32(0x7581bb43), - SPH_C32(0xf460449e), SPH_C32(0xd8b61463), SPH_C32(0x835a0000), - SPH_C32(0xc4f70000), SPH_C32(0x01470022), SPH_C32(0xeec80000), - SPH_C32(0x60a54f69), SPH_C32(0x142f2a24), SPH_C32(0x5cf534f2), - SPH_C32(0x3ea660f7) }, - { SPH_C32(0x52500000), SPH_C32(0x29540000), SPH_C32(0x6a61004e), - SPH_C32(0xf0ff0000), SPH_C32(0x9a317eec), SPH_C32(0x452341ce), - SPH_C32(0xcf568fe5), SPH_C32(0x5303130f), SPH_C32(0x538d0000), - SPH_C32(0xa9fc0000), SPH_C32(0x9ef70006), SPH_C32(0x56ff0000), - SPH_C32(0x0ae4004e), SPH_C32(0x92c5cdf9), SPH_C32(0xa9444018), - SPH_C32(0x7f975691) }, - { SPH_C32(0x538d0000), SPH_C32(0xa9fc0000), SPH_C32(0x9ef70006), - SPH_C32(0x56ff0000), SPH_C32(0x0ae4004e), SPH_C32(0x92c5cdf9), - SPH_C32(0xa9444018), SPH_C32(0x7f975691), SPH_C32(0x01dd0000), - SPH_C32(0x80a80000), SPH_C32(0xf4960048), SPH_C32(0xa6000000), - SPH_C32(0x90d57ea2), SPH_C32(0xd7e68c37), SPH_C32(0x6612cffd), - SPH_C32(0x2c94459e) }, - { SPH_C32(0xe6280000), SPH_C32(0x4c4b0000), SPH_C32(0xa8550000), - SPH_C32(0xd3d002e0), SPH_C32(0xd86130b8), SPH_C32(0x98a7b0da), - SPH_C32(0x289506b4), SPH_C32(0xd75a4897), SPH_C32(0xf0c50000), - SPH_C32(0x59230000), SPH_C32(0x45820000), SPH_C32(0xe18d00c0), - SPH_C32(0x3b6d0631), SPH_C32(0xc2ed5699), SPH_C32(0xcbe0fe1c), - SPH_C32(0x56a7b19f) }, - { SPH_C32(0xf0c50000), SPH_C32(0x59230000), SPH_C32(0x45820000), - SPH_C32(0xe18d00c0), SPH_C32(0x3b6d0631), SPH_C32(0xc2ed5699), - SPH_C32(0xcbe0fe1c), SPH_C32(0x56a7b19f), SPH_C32(0x16ed0000), - SPH_C32(0x15680000), SPH_C32(0xedd70000), SPH_C32(0x325d0220), - SPH_C32(0xe30c3689), SPH_C32(0x5a4ae643), SPH_C32(0xe375f8a8), - SPH_C32(0x81fdf908) }, - { SPH_C32(0xb4310000), SPH_C32(0x77330000), SPH_C32(0xb15d0000), - SPH_C32(0x7fd004e0), SPH_C32(0x78a26138), SPH_C32(0xd116c35d), - SPH_C32(0xd256d489), SPH_C32(0x4e6f74de), SPH_C32(0xe3060000), - SPH_C32(0xbdc10000), SPH_C32(0x87130000), SPH_C32(0xbff20060), - SPH_C32(0x2eba0a1a), SPH_C32(0x8db53751), SPH_C32(0x73c5ab06), - SPH_C32(0x5bd61539) }, - { SPH_C32(0xe3060000), SPH_C32(0xbdc10000), SPH_C32(0x87130000), - SPH_C32(0xbff20060), SPH_C32(0x2eba0a1a), SPH_C32(0x8db53751), - SPH_C32(0x73c5ab06), SPH_C32(0x5bd61539), SPH_C32(0x57370000), - SPH_C32(0xcaf20000), SPH_C32(0x364e0000), SPH_C32(0xc0220480), - SPH_C32(0x56186b22), SPH_C32(0x5ca3f40c), SPH_C32(0xa1937f8f), - SPH_C32(0x15b961e7) }, - { SPH_C32(0x02f20000), SPH_C32(0xa2810000), SPH_C32(0x873f0000), - SPH_C32(0xe36c7800), SPH_C32(0x1e1d74ef), SPH_C32(0x073d2bd6), - SPH_C32(0xc4c23237), SPH_C32(0x7f32259e), SPH_C32(0xbadd0000), - SPH_C32(0x13ad0000), SPH_C32(0xb7e70000), SPH_C32(0xf7282800), - SPH_C32(0xdf45144d), SPH_C32(0x361ac33a), SPH_C32(0xea5a8d14), - SPH_C32(0x2a2c18f0) }, - { SPH_C32(0xbadd0000), SPH_C32(0x13ad0000), SPH_C32(0xb7e70000), - SPH_C32(0xf7282800), SPH_C32(0xdf45144d), SPH_C32(0x361ac33a), - SPH_C32(0xea5a8d14), SPH_C32(0x2a2c18f0), SPH_C32(0xb82f0000), - SPH_C32(0xb12c0000), SPH_C32(0x30d80000), SPH_C32(0x14445000), - SPH_C32(0xc15860a2), SPH_C32(0x3127e8ec), SPH_C32(0x2e98bf23), - SPH_C32(0x551e3d6e) }, - { SPH_C32(0x1e6c0000), SPH_C32(0xc4420000), SPH_C32(0x8a2e0000), - SPH_C32(0xbcb6b800), SPH_C32(0x2c4413b6), SPH_C32(0x8bfdd3da), - SPH_C32(0x6a0c1bc8), SPH_C32(0xb99dc2eb), SPH_C32(0x92560000), - SPH_C32(0x1eda0000), SPH_C32(0xea510000), SPH_C32(0xe8b13000), - SPH_C32(0xa93556a5), SPH_C32(0xebfb6199), SPH_C32(0xb15c2254), - SPH_C32(0x33c5244f) }, - { SPH_C32(0x92560000), SPH_C32(0x1eda0000), SPH_C32(0xea510000), - SPH_C32(0xe8b13000), SPH_C32(0xa93556a5), SPH_C32(0xebfb6199), - SPH_C32(0xb15c2254), SPH_C32(0x33c5244f), SPH_C32(0x8c3a0000), - SPH_C32(0xda980000), SPH_C32(0x607f0000), SPH_C32(0x54078800), - SPH_C32(0x85714513), SPH_C32(0x6006b243), SPH_C32(0xdb50399c), - SPH_C32(0x8a58e6a4) }, - { SPH_C32(0x033d0000), SPH_C32(0x08b30000), SPH_C32(0xf33a0000), - SPH_C32(0x3ac20007), SPH_C32(0x51298a50), SPH_C32(0x6b6e661f), - SPH_C32(0x0ea5cfe3), SPH_C32(0xe6da7ffe), SPH_C32(0xa8da0000), - SPH_C32(0x96be0000), SPH_C32(0x5c1d0000), SPH_C32(0x07da0002), - SPH_C32(0x7d669583), SPH_C32(0x1f98708a), SPH_C32(0xbb668808), - SPH_C32(0xda878000) }, - { SPH_C32(0xa8da0000), SPH_C32(0x96be0000), SPH_C32(0x5c1d0000), - SPH_C32(0x07da0002), SPH_C32(0x7d669583), SPH_C32(0x1f98708a), - SPH_C32(0xbb668808), SPH_C32(0xda878000), SPH_C32(0xabe70000), - SPH_C32(0x9e0d0000), SPH_C32(0xaf270000), SPH_C32(0x3d180005), - SPH_C32(0x2c4f1fd3), SPH_C32(0x74f61695), SPH_C32(0xb5c347eb), - SPH_C32(0x3c5dfffe) }, - { SPH_C32(0x01930000), SPH_C32(0xe7820000), SPH_C32(0xedfb0000), - SPH_C32(0xcf0c000b), SPH_C32(0x8dd08d58), SPH_C32(0xbca3b42e), - SPH_C32(0x063661e1), SPH_C32(0x536f9e7b), SPH_C32(0x92280000), - SPH_C32(0xdc850000), SPH_C32(0x57fa0000), SPH_C32(0x56dc0003), - SPH_C32(0xbae92316), SPH_C32(0x5aefa30c), SPH_C32(0x90cef752), - SPH_C32(0x7b1675d7) }, - { SPH_C32(0x92280000), SPH_C32(0xdc850000), SPH_C32(0x57fa0000), - SPH_C32(0x56dc0003), SPH_C32(0xbae92316), SPH_C32(0x5aefa30c), - SPH_C32(0x90cef752), SPH_C32(0x7b1675d7), SPH_C32(0x93bb0000), - SPH_C32(0x3b070000), SPH_C32(0xba010000), SPH_C32(0x99d00008), - SPH_C32(0x3739ae4e), SPH_C32(0xe64c1722), SPH_C32(0x96f896b3), - SPH_C32(0x2879ebac) }, - { SPH_C32(0x5fa80000), SPH_C32(0x56030000), SPH_C32(0x43ae0000), - SPH_C32(0x64f30013), SPH_C32(0x257e86bf), SPH_C32(0x1311944e), - SPH_C32(0x541e95bf), SPH_C32(0x8ea4db69), SPH_C32(0x00440000), - SPH_C32(0x7f480000), SPH_C32(0xda7c0000), SPH_C32(0x2a230001), - SPH_C32(0x3badc9cc), SPH_C32(0xa9b69c87), SPH_C32(0x030a9e60), - SPH_C32(0xbe0a679e) }, - { SPH_C32(0x00440000), SPH_C32(0x7f480000), SPH_C32(0xda7c0000), - SPH_C32(0x2a230001), SPH_C32(0x3badc9cc), SPH_C32(0xa9b69c87), - SPH_C32(0x030a9e60), SPH_C32(0xbe0a679e), SPH_C32(0x5fec0000), - SPH_C32(0x294b0000), SPH_C32(0x99d20000), SPH_C32(0x4ed00012), - SPH_C32(0x1ed34f73), SPH_C32(0xbaa708c9), SPH_C32(0x57140bdf), - SPH_C32(0x30aebcf7) }, - { SPH_C32(0xee930000), SPH_C32(0xd6070000), SPH_C32(0x92c10000), - SPH_C32(0x2b9801e0), SPH_C32(0x9451287c), SPH_C32(0x3b6cfb57), - SPH_C32(0x45312374), SPH_C32(0x201f6a64), SPH_C32(0x7b280000), - SPH_C32(0x57420000), SPH_C32(0xa9e50000), SPH_C32(0x634300a0), - SPH_C32(0x9edb442f), SPH_C32(0x6d9995bb), SPH_C32(0x27f83b03), - SPH_C32(0xc7ff60f0) }, - { SPH_C32(0x7b280000), SPH_C32(0x57420000), SPH_C32(0xa9e50000), - SPH_C32(0x634300a0), SPH_C32(0x9edb442f), SPH_C32(0x6d9995bb), - SPH_C32(0x27f83b03), SPH_C32(0xc7ff60f0), SPH_C32(0x95bb0000), - SPH_C32(0x81450000), SPH_C32(0x3b240000), SPH_C32(0x48db0140), - SPH_C32(0x0a8a6c53), SPH_C32(0x56f56eec), SPH_C32(0x62c91877), - SPH_C32(0xe7e00a94) } -}; - -#define INPUT_BIG do { \ - const sph_u32 *tp = &T512[0][0]; \ - unsigned u, v; \ - m0 = 0; \ - m1 = 0; \ - m2 = 0; \ - m3 = 0; \ - m4 = 0; \ - m5 = 0; \ - m6 = 0; \ - m7 = 0; \ - m8 = 0; \ - m9 = 0; \ - mA = 0; \ - mB = 0; \ - mC = 0; \ - mD = 0; \ - mE = 0; \ - mF = 0; \ - for (u = 0; u < 8; u ++) { \ - unsigned db = buf[u]; \ - for (v = 0; v < 8; v ++, db >>= 1) { \ - sph_u32 dm = SPH_T32(-(sph_u32)(db & 1)); \ - m0 ^= dm & *tp ++; \ - m1 ^= dm & *tp ++; \ - m2 ^= dm & *tp ++; \ - m3 ^= dm & *tp ++; \ - m4 ^= dm & *tp ++; \ - m5 ^= dm & *tp ++; \ - m6 ^= dm & *tp ++; \ - m7 ^= dm & *tp ++; \ - m8 ^= dm & *tp ++; \ - m9 ^= dm & *tp ++; \ - mA ^= dm & *tp ++; \ - mB ^= dm & *tp ++; \ - mC ^= dm & *tp ++; \ - mD ^= dm & *tp ++; \ - mE ^= dm & *tp ++; \ - mF ^= dm & *tp ++; \ - } \ - } \ - } while (0) - -#endif - -#if SPH_HAMSI_EXPAND_BIG == 2 - -static const sph_u32 T512_0[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x29449c00), SPH_C32(0x64e70000), SPH_C32(0xf24b0000), - SPH_C32(0xc2f30000), SPH_C32(0x0ede4e8f), SPH_C32(0x56c23745), - SPH_C32(0xf3e04259), SPH_C32(0x8d0d9ec4), SPH_C32(0x466d0c00), - SPH_C32(0x08620000), SPH_C32(0xdd5d0000), SPH_C32(0xbadd0000), - SPH_C32(0x6a927942), SPH_C32(0x441f2b93), SPH_C32(0x218ace6f), - SPH_C32(0xbf2c0be2) }, - { SPH_C32(0x466d0c00), SPH_C32(0x08620000), SPH_C32(0xdd5d0000), - SPH_C32(0xbadd0000), SPH_C32(0x6a927942), SPH_C32(0x441f2b93), - SPH_C32(0x218ace6f), SPH_C32(0xbf2c0be2), SPH_C32(0x6f299000), - SPH_C32(0x6c850000), SPH_C32(0x2f160000), SPH_C32(0x782e0000), - SPH_C32(0x644c37cd), SPH_C32(0x12dd1cd6), SPH_C32(0xd26a8c36), - SPH_C32(0x32219526) }, - { SPH_C32(0x6f299000), SPH_C32(0x6c850000), SPH_C32(0x2f160000), - SPH_C32(0x782e0000), SPH_C32(0x644c37cd), SPH_C32(0x12dd1cd6), - SPH_C32(0xd26a8c36), SPH_C32(0x32219526), SPH_C32(0x29449c00), - SPH_C32(0x64e70000), SPH_C32(0xf24b0000), SPH_C32(0xc2f30000), - SPH_C32(0x0ede4e8f), SPH_C32(0x56c23745), SPH_C32(0xf3e04259), - SPH_C32(0x8d0d9ec4) } -}; - -static const sph_u32 T512_2[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x54285c00), SPH_C32(0xeaed0000), SPH_C32(0xc5d60000), - SPH_C32(0xa1c50000), SPH_C32(0xb3a26770), SPH_C32(0x94a5c4e1), - SPH_C32(0x6bb0419d), SPH_C32(0x551b3782), SPH_C32(0x9cbb1800), - SPH_C32(0xb0d30000), SPH_C32(0x92510000), SPH_C32(0xed930000), - SPH_C32(0x593a4345), SPH_C32(0xe114d5f4), SPH_C32(0x430633da), - SPH_C32(0x78cace29) }, - { SPH_C32(0x9cbb1800), SPH_C32(0xb0d30000), SPH_C32(0x92510000), - SPH_C32(0xed930000), SPH_C32(0x593a4345), SPH_C32(0xe114d5f4), - SPH_C32(0x430633da), SPH_C32(0x78cace29), SPH_C32(0xc8934400), - SPH_C32(0x5a3e0000), SPH_C32(0x57870000), SPH_C32(0x4c560000), - SPH_C32(0xea982435), SPH_C32(0x75b11115), SPH_C32(0x28b67247), - SPH_C32(0x2dd1f9ab) }, - { SPH_C32(0xc8934400), SPH_C32(0x5a3e0000), SPH_C32(0x57870000), - SPH_C32(0x4c560000), SPH_C32(0xea982435), SPH_C32(0x75b11115), - SPH_C32(0x28b67247), SPH_C32(0x2dd1f9ab), SPH_C32(0x54285c00), - SPH_C32(0xeaed0000), SPH_C32(0xc5d60000), SPH_C32(0xa1c50000), - SPH_C32(0xb3a26770), SPH_C32(0x94a5c4e1), SPH_C32(0x6bb0419d), - SPH_C32(0x551b3782) } -}; - -static const sph_u32 T512_4[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x145a3c00), SPH_C32(0xb9e90000), SPH_C32(0x61270000), - SPH_C32(0xf1610000), SPH_C32(0xce613d6c), SPH_C32(0xb0493d78), - SPH_C32(0x47a96720), SPH_C32(0xe18e24c5), SPH_C32(0x23671400), - SPH_C32(0xc8b90000), SPH_C32(0xf4c70000), SPH_C32(0xfb750000), - SPH_C32(0x73cd2465), SPH_C32(0xf8a6a549), SPH_C32(0x02c40a3f), - SPH_C32(0xdc24e61f) }, - { SPH_C32(0x23671400), SPH_C32(0xc8b90000), SPH_C32(0xf4c70000), - SPH_C32(0xfb750000), SPH_C32(0x73cd2465), SPH_C32(0xf8a6a549), - SPH_C32(0x02c40a3f), SPH_C32(0xdc24e61f), SPH_C32(0x373d2800), - SPH_C32(0x71500000), SPH_C32(0x95e00000), SPH_C32(0x0a140000), - SPH_C32(0xbdac1909), SPH_C32(0x48ef9831), SPH_C32(0x456d6d1f), - SPH_C32(0x3daac2da) }, - { SPH_C32(0x373d2800), SPH_C32(0x71500000), SPH_C32(0x95e00000), - SPH_C32(0x0a140000), SPH_C32(0xbdac1909), SPH_C32(0x48ef9831), - SPH_C32(0x456d6d1f), SPH_C32(0x3daac2da), SPH_C32(0x145a3c00), - SPH_C32(0xb9e90000), SPH_C32(0x61270000), SPH_C32(0xf1610000), - SPH_C32(0xce613d6c), SPH_C32(0xb0493d78), SPH_C32(0x47a96720), - SPH_C32(0xe18e24c5) } -}; - -static const sph_u32 T512_6[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xef0b0270), SPH_C32(0x3afd0000), SPH_C32(0x5dae0000), - SPH_C32(0x69490000), SPH_C32(0x9b0f3c06), SPH_C32(0x4405b5f9), - SPH_C32(0x66140a51), SPH_C32(0x924f5d0a), SPH_C32(0xc96b0030), - SPH_C32(0xe7250000), SPH_C32(0x2f840000), SPH_C32(0x264f0000), - SPH_C32(0x08695bf9), SPH_C32(0x6dfcf137), SPH_C32(0x509f6984), - SPH_C32(0x9e69af68) }, - { SPH_C32(0xc96b0030), SPH_C32(0xe7250000), SPH_C32(0x2f840000), - SPH_C32(0x264f0000), SPH_C32(0x08695bf9), SPH_C32(0x6dfcf137), - SPH_C32(0x509f6984), SPH_C32(0x9e69af68), SPH_C32(0x26600240), - SPH_C32(0xddd80000), SPH_C32(0x722a0000), SPH_C32(0x4f060000), - SPH_C32(0x936667ff), SPH_C32(0x29f944ce), SPH_C32(0x368b63d5), - SPH_C32(0x0c26f262) }, - { SPH_C32(0x26600240), SPH_C32(0xddd80000), SPH_C32(0x722a0000), - SPH_C32(0x4f060000), SPH_C32(0x936667ff), SPH_C32(0x29f944ce), - SPH_C32(0x368b63d5), SPH_C32(0x0c26f262), SPH_C32(0xef0b0270), - SPH_C32(0x3afd0000), SPH_C32(0x5dae0000), SPH_C32(0x69490000), - SPH_C32(0x9b0f3c06), SPH_C32(0x4405b5f9), SPH_C32(0x66140a51), - SPH_C32(0x924f5d0a) } -}; - -static const sph_u32 T512_8[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xe8870170), SPH_C32(0x9d720000), SPH_C32(0x12db0000), - SPH_C32(0xd4220000), SPH_C32(0xf2886b27), SPH_C32(0xa921e543), - SPH_C32(0x4ef8b518), SPH_C32(0x618813b1), SPH_C32(0xb4370060), - SPH_C32(0x0c4c0000), SPH_C32(0x56c20000), SPH_C32(0x5cae0000), - SPH_C32(0x94541f3f), SPH_C32(0x3b3ef825), SPH_C32(0x1b365f3d), - SPH_C32(0xf3d45758) }, - { SPH_C32(0xb4370060), SPH_C32(0x0c4c0000), SPH_C32(0x56c20000), - SPH_C32(0x5cae0000), SPH_C32(0x94541f3f), SPH_C32(0x3b3ef825), - SPH_C32(0x1b365f3d), SPH_C32(0xf3d45758), SPH_C32(0x5cb00110), - SPH_C32(0x913e0000), SPH_C32(0x44190000), SPH_C32(0x888c0000), - SPH_C32(0x66dc7418), SPH_C32(0x921f1d66), SPH_C32(0x55ceea25), - SPH_C32(0x925c44e9) }, - { SPH_C32(0x5cb00110), SPH_C32(0x913e0000), SPH_C32(0x44190000), - SPH_C32(0x888c0000), SPH_C32(0x66dc7418), SPH_C32(0x921f1d66), - SPH_C32(0x55ceea25), SPH_C32(0x925c44e9), SPH_C32(0xe8870170), - SPH_C32(0x9d720000), SPH_C32(0x12db0000), SPH_C32(0xd4220000), - SPH_C32(0xf2886b27), SPH_C32(0xa921e543), SPH_C32(0x4ef8b518), - SPH_C32(0x618813b1) } -}; - -static const sph_u32 T512_10[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x774400f0), SPH_C32(0xf15a0000), SPH_C32(0xf5b20000), - SPH_C32(0x34140000), SPH_C32(0x89377e8c), SPH_C32(0x5a8bec25), - SPH_C32(0x0bc3cd1e), SPH_C32(0xcf3775cb), SPH_C32(0xf46c0050), - SPH_C32(0x96180000), SPH_C32(0x14a50000), SPH_C32(0x031f0000), - SPH_C32(0x42947eb8), SPH_C32(0x66bf7e19), SPH_C32(0x9ca470d2), - SPH_C32(0x8a341574) }, - { SPH_C32(0xf46c0050), SPH_C32(0x96180000), SPH_C32(0x14a50000), - SPH_C32(0x031f0000), SPH_C32(0x42947eb8), SPH_C32(0x66bf7e19), - SPH_C32(0x9ca470d2), SPH_C32(0x8a341574), SPH_C32(0x832800a0), - SPH_C32(0x67420000), SPH_C32(0xe1170000), SPH_C32(0x370b0000), - SPH_C32(0xcba30034), SPH_C32(0x3c34923c), SPH_C32(0x9767bdcc), - SPH_C32(0x450360bf) }, - { SPH_C32(0x832800a0), SPH_C32(0x67420000), SPH_C32(0xe1170000), - SPH_C32(0x370b0000), SPH_C32(0xcba30034), SPH_C32(0x3c34923c), - SPH_C32(0x9767bdcc), SPH_C32(0x450360bf), SPH_C32(0x774400f0), - SPH_C32(0xf15a0000), SPH_C32(0xf5b20000), SPH_C32(0x34140000), - SPH_C32(0x89377e8c), SPH_C32(0x5a8bec25), SPH_C32(0x0bc3cd1e), - SPH_C32(0xcf3775cb) } -}; - -static const sph_u32 T512_12[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xf7750009), SPH_C32(0xcf3cc000), SPH_C32(0xc3d60000), - SPH_C32(0x04920000), SPH_C32(0x029519a9), SPH_C32(0xf8e836ba), - SPH_C32(0x7a87f14e), SPH_C32(0x9e16981a), SPH_C32(0xd46a0000), - SPH_C32(0x8dc8c000), SPH_C32(0xa5af0000), SPH_C32(0x4a290000), - SPH_C32(0xfc4e427a), SPH_C32(0xc9b4866c), SPH_C32(0x98369604), - SPH_C32(0xf746c320) }, - { SPH_C32(0xd46a0000), SPH_C32(0x8dc8c000), SPH_C32(0xa5af0000), - SPH_C32(0x4a290000), SPH_C32(0xfc4e427a), SPH_C32(0xc9b4866c), - SPH_C32(0x98369604), SPH_C32(0xf746c320), SPH_C32(0x231f0009), - SPH_C32(0x42f40000), SPH_C32(0x66790000), SPH_C32(0x4ebb0000), - SPH_C32(0xfedb5bd3), SPH_C32(0x315cb0d6), SPH_C32(0xe2b1674a), - SPH_C32(0x69505b3a) }, - { SPH_C32(0x231f0009), SPH_C32(0x42f40000), SPH_C32(0x66790000), - SPH_C32(0x4ebb0000), SPH_C32(0xfedb5bd3), SPH_C32(0x315cb0d6), - SPH_C32(0xe2b1674a), SPH_C32(0x69505b3a), SPH_C32(0xf7750009), - SPH_C32(0xcf3cc000), SPH_C32(0xc3d60000), SPH_C32(0x04920000), - SPH_C32(0x029519a9), SPH_C32(0xf8e836ba), SPH_C32(0x7a87f14e), - SPH_C32(0x9e16981a) } -}; - -static const sph_u32 T512_14[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xf6800005), SPH_C32(0x3443c000), SPH_C32(0x24070000), - SPH_C32(0x8f3d0000), SPH_C32(0x21373bfb), SPH_C32(0x0ab8d5ae), - SPH_C32(0xcdc58b19), SPH_C32(0xd795ba31), SPH_C32(0xa67f0001), - SPH_C32(0x71378000), SPH_C32(0x19fc0000), SPH_C32(0x96db0000), - SPH_C32(0x3a8b6dfd), SPH_C32(0xebcaaef3), SPH_C32(0x2c6d478f), - SPH_C32(0xac8e6c88) }, - { SPH_C32(0xa67f0001), SPH_C32(0x71378000), SPH_C32(0x19fc0000), - SPH_C32(0x96db0000), SPH_C32(0x3a8b6dfd), SPH_C32(0xebcaaef3), - SPH_C32(0x2c6d478f), SPH_C32(0xac8e6c88), SPH_C32(0x50ff0004), - SPH_C32(0x45744000), SPH_C32(0x3dfb0000), SPH_C32(0x19e60000), - SPH_C32(0x1bbc5606), SPH_C32(0xe1727b5d), SPH_C32(0xe1a8cc96), - SPH_C32(0x7b1bd6b9) }, - { SPH_C32(0x50ff0004), SPH_C32(0x45744000), SPH_C32(0x3dfb0000), - SPH_C32(0x19e60000), SPH_C32(0x1bbc5606), SPH_C32(0xe1727b5d), - SPH_C32(0xe1a8cc96), SPH_C32(0x7b1bd6b9), SPH_C32(0xf6800005), - SPH_C32(0x3443c000), SPH_C32(0x24070000), SPH_C32(0x8f3d0000), - SPH_C32(0x21373bfb), SPH_C32(0x0ab8d5ae), SPH_C32(0xcdc58b19), - SPH_C32(0xd795ba31) } -}; - -static const sph_u32 T512_16[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x75c90003), SPH_C32(0x0e10c000), SPH_C32(0xd1200000), - SPH_C32(0xbaea0000), SPH_C32(0x8bc42f3e), SPH_C32(0x8758b757), - SPH_C32(0xbb28761d), SPH_C32(0x00b72e2b), SPH_C32(0xeecf0001), - SPH_C32(0x6f564000), SPH_C32(0xf33e0000), SPH_C32(0xa79e0000), - SPH_C32(0xbdb57219), SPH_C32(0xb711ebc5), SPH_C32(0x4a3b40ba), - SPH_C32(0xfeabf254) }, - { SPH_C32(0xeecf0001), SPH_C32(0x6f564000), SPH_C32(0xf33e0000), - SPH_C32(0xa79e0000), SPH_C32(0xbdb57219), SPH_C32(0xb711ebc5), - SPH_C32(0x4a3b40ba), SPH_C32(0xfeabf254), SPH_C32(0x9b060002), - SPH_C32(0x61468000), SPH_C32(0x221e0000), SPH_C32(0x1d740000), - SPH_C32(0x36715d27), SPH_C32(0x30495c92), SPH_C32(0xf11336a7), - SPH_C32(0xfe1cdc7f) }, - { SPH_C32(0x9b060002), SPH_C32(0x61468000), SPH_C32(0x221e0000), - SPH_C32(0x1d740000), SPH_C32(0x36715d27), SPH_C32(0x30495c92), - SPH_C32(0xf11336a7), SPH_C32(0xfe1cdc7f), SPH_C32(0x75c90003), - SPH_C32(0x0e10c000), SPH_C32(0xd1200000), SPH_C32(0xbaea0000), - SPH_C32(0x8bc42f3e), SPH_C32(0x8758b757), SPH_C32(0xbb28761d), - SPH_C32(0x00b72e2b) } -}; - -static const sph_u32 T512_18[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x75a40000), SPH_C32(0xc28b2700), SPH_C32(0x94a40000), - SPH_C32(0x90f50000), SPH_C32(0xfb7857e0), SPH_C32(0x49ce0bae), - SPH_C32(0x1767c483), SPH_C32(0xaedf667e), SPH_C32(0xd1660000), - SPH_C32(0x1bbc0300), SPH_C32(0x9eec0000), SPH_C32(0xf6940000), - SPH_C32(0x03024527), SPH_C32(0xcf70fcf2), SPH_C32(0xb4431b17), - SPH_C32(0x857f3c2b) }, - { SPH_C32(0xd1660000), SPH_C32(0x1bbc0300), SPH_C32(0x9eec0000), - SPH_C32(0xf6940000), SPH_C32(0x03024527), SPH_C32(0xcf70fcf2), - SPH_C32(0xb4431b17), SPH_C32(0x857f3c2b), SPH_C32(0xa4c20000), - SPH_C32(0xd9372400), SPH_C32(0x0a480000), SPH_C32(0x66610000), - SPH_C32(0xf87a12c7), SPH_C32(0x86bef75c), SPH_C32(0xa324df94), - SPH_C32(0x2ba05a55) }, - { SPH_C32(0xa4c20000), SPH_C32(0xd9372400), SPH_C32(0x0a480000), - SPH_C32(0x66610000), SPH_C32(0xf87a12c7), SPH_C32(0x86bef75c), - SPH_C32(0xa324df94), SPH_C32(0x2ba05a55), SPH_C32(0x75a40000), - SPH_C32(0xc28b2700), SPH_C32(0x94a40000), SPH_C32(0x90f50000), - SPH_C32(0xfb7857e0), SPH_C32(0x49ce0bae), SPH_C32(0x1767c483), - SPH_C32(0xaedf667e) } -}; - -static const sph_u32 T512_20[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x45180000), SPH_C32(0xa5b51700), SPH_C32(0xf96a0000), - SPH_C32(0x3b480000), SPH_C32(0x1ecc142c), SPH_C32(0x231395d6), - SPH_C32(0x16bca6b0), SPH_C32(0xdf33f4df), SPH_C32(0xb83d0000), - SPH_C32(0x16710600), SPH_C32(0x379a0000), SPH_C32(0xf5b10000), - SPH_C32(0x228161ac), SPH_C32(0xae48f145), SPH_C32(0x66241616), - SPH_C32(0xc5c1eb3e) }, - { SPH_C32(0xb83d0000), SPH_C32(0x16710600), SPH_C32(0x379a0000), - SPH_C32(0xf5b10000), SPH_C32(0x228161ac), SPH_C32(0xae48f145), - SPH_C32(0x66241616), SPH_C32(0xc5c1eb3e), SPH_C32(0xfd250000), - SPH_C32(0xb3c41100), SPH_C32(0xcef00000), SPH_C32(0xcef90000), - SPH_C32(0x3c4d7580), SPH_C32(0x8d5b6493), SPH_C32(0x7098b0a6), - SPH_C32(0x1af21fe1) }, - { SPH_C32(0xfd250000), SPH_C32(0xb3c41100), SPH_C32(0xcef00000), - SPH_C32(0xcef90000), SPH_C32(0x3c4d7580), SPH_C32(0x8d5b6493), - SPH_C32(0x7098b0a6), SPH_C32(0x1af21fe1), SPH_C32(0x45180000), - SPH_C32(0xa5b51700), SPH_C32(0xf96a0000), SPH_C32(0x3b480000), - SPH_C32(0x1ecc142c), SPH_C32(0x231395d6), SPH_C32(0x16bca6b0), - SPH_C32(0xdf33f4df) } -}; - -static const sph_u32 T512_22[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x0c720000), SPH_C32(0x49e50f00), SPH_C32(0x42790000), - SPH_C32(0x5cea0000), SPH_C32(0x33aa301a), SPH_C32(0x15822514), - SPH_C32(0x95a34b7b), SPH_C32(0xb44b0090), SPH_C32(0xfe220000), - SPH_C32(0xa7580500), SPH_C32(0x25d10000), SPH_C32(0xf7600000), - SPH_C32(0x893178da), SPH_C32(0x1fd4f860), SPH_C32(0x4ed0a315), - SPH_C32(0xa123ff9f) }, - { SPH_C32(0xfe220000), SPH_C32(0xa7580500), SPH_C32(0x25d10000), - SPH_C32(0xf7600000), SPH_C32(0x893178da), SPH_C32(0x1fd4f860), - SPH_C32(0x4ed0a315), SPH_C32(0xa123ff9f), SPH_C32(0xf2500000), - SPH_C32(0xeebd0a00), SPH_C32(0x67a80000), SPH_C32(0xab8a0000), - SPH_C32(0xba9b48c0), SPH_C32(0x0a56dd74), SPH_C32(0xdb73e86e), - SPH_C32(0x1568ff0f) }, - { SPH_C32(0xf2500000), SPH_C32(0xeebd0a00), SPH_C32(0x67a80000), - SPH_C32(0xab8a0000), SPH_C32(0xba9b48c0), SPH_C32(0x0a56dd74), - SPH_C32(0xdb73e86e), SPH_C32(0x1568ff0f), SPH_C32(0x0c720000), - SPH_C32(0x49e50f00), SPH_C32(0x42790000), SPH_C32(0x5cea0000), - SPH_C32(0x33aa301a), SPH_C32(0x15822514), SPH_C32(0x95a34b7b), - SPH_C32(0xb44b0090) } -}; - -static const sph_u32 T512_24[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x69510000), SPH_C32(0xd4e1009c), SPH_C32(0xc3230000), - SPH_C32(0xac2f0000), SPH_C32(0xe4950bae), SPH_C32(0xcea415dc), - SPH_C32(0x87ec287c), SPH_C32(0xbce1a3ce), SPH_C32(0xc6730000), - SPH_C32(0xaf8d000c), SPH_C32(0xa4c10000), SPH_C32(0x218d0000), - SPH_C32(0x23111587), SPH_C32(0x7913512f), SPH_C32(0x1d28ac88), - SPH_C32(0x378dd173) }, - { SPH_C32(0xc6730000), SPH_C32(0xaf8d000c), SPH_C32(0xa4c10000), - SPH_C32(0x218d0000), SPH_C32(0x23111587), SPH_C32(0x7913512f), - SPH_C32(0x1d28ac88), SPH_C32(0x378dd173), SPH_C32(0xaf220000), - SPH_C32(0x7b6c0090), SPH_C32(0x67e20000), SPH_C32(0x8da20000), - SPH_C32(0xc7841e29), SPH_C32(0xb7b744f3), SPH_C32(0x9ac484f4), - SPH_C32(0x8b6c72bd) }, - { SPH_C32(0xaf220000), SPH_C32(0x7b6c0090), SPH_C32(0x67e20000), - SPH_C32(0x8da20000), SPH_C32(0xc7841e29), SPH_C32(0xb7b744f3), - SPH_C32(0x9ac484f4), SPH_C32(0x8b6c72bd), SPH_C32(0x69510000), - SPH_C32(0xd4e1009c), SPH_C32(0xc3230000), SPH_C32(0xac2f0000), - SPH_C32(0xe4950bae), SPH_C32(0xcea415dc), SPH_C32(0x87ec287c), - SPH_C32(0xbce1a3ce) } -}; - -static const sph_u32 T512_26[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x54500000), SPH_C32(0x0671005c), SPH_C32(0x25ae0000), - SPH_C32(0x6a1e0000), SPH_C32(0x2ea54edf), SPH_C32(0x664e8512), - SPH_C32(0xbfba18c3), SPH_C32(0x7e715d17), SPH_C32(0xbc8d0000), - SPH_C32(0xfc3b0018), SPH_C32(0x19830000), SPH_C32(0xd10b0000), - SPH_C32(0xae1878c4), SPH_C32(0x42a69856), SPH_C32(0x0012da37), - SPH_C32(0x2c3b504e) }, - { SPH_C32(0xbc8d0000), SPH_C32(0xfc3b0018), SPH_C32(0x19830000), - SPH_C32(0xd10b0000), SPH_C32(0xae1878c4), SPH_C32(0x42a69856), - SPH_C32(0x0012da37), SPH_C32(0x2c3b504e), SPH_C32(0xe8dd0000), - SPH_C32(0xfa4a0044), SPH_C32(0x3c2d0000), SPH_C32(0xbb150000), - SPH_C32(0x80bd361b), SPH_C32(0x24e81d44), SPH_C32(0xbfa8c2f4), - SPH_C32(0x524a0d59) }, - { SPH_C32(0xe8dd0000), SPH_C32(0xfa4a0044), SPH_C32(0x3c2d0000), - SPH_C32(0xbb150000), SPH_C32(0x80bd361b), SPH_C32(0x24e81d44), - SPH_C32(0xbfa8c2f4), SPH_C32(0x524a0d59), SPH_C32(0x54500000), - SPH_C32(0x0671005c), SPH_C32(0x25ae0000), SPH_C32(0x6a1e0000), - SPH_C32(0x2ea54edf), SPH_C32(0x664e8512), SPH_C32(0xbfba18c3), - SPH_C32(0x7e715d17) } -}; - -static const sph_u32 T512_28[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x14190000), SPH_C32(0x23ca003c), SPH_C32(0x50df0000), - SPH_C32(0x44b60000), SPH_C32(0x1b6c67b0), SPH_C32(0x3cf3ac75), - SPH_C32(0x61e610b0), SPH_C32(0xdbcadb80), SPH_C32(0xe3430000), - SPH_C32(0x3a4e0014), SPH_C32(0xf2c60000), SPH_C32(0xaa4e0000), - SPH_C32(0xdb1e42a6), SPH_C32(0x256bbe15), SPH_C32(0x123db156), - SPH_C32(0x3a4e99d7) }, - { SPH_C32(0xe3430000), SPH_C32(0x3a4e0014), SPH_C32(0xf2c60000), - SPH_C32(0xaa4e0000), SPH_C32(0xdb1e42a6), SPH_C32(0x256bbe15), - SPH_C32(0x123db156), SPH_C32(0x3a4e99d7), SPH_C32(0xf75a0000), - SPH_C32(0x19840028), SPH_C32(0xa2190000), SPH_C32(0xeef80000), - SPH_C32(0xc0722516), SPH_C32(0x19981260), SPH_C32(0x73dba1e6), - SPH_C32(0xe1844257) }, - { SPH_C32(0xf75a0000), SPH_C32(0x19840028), SPH_C32(0xa2190000), - SPH_C32(0xeef80000), SPH_C32(0xc0722516), SPH_C32(0x19981260), - SPH_C32(0x73dba1e6), SPH_C32(0xe1844257), SPH_C32(0x14190000), - SPH_C32(0x23ca003c), SPH_C32(0x50df0000), SPH_C32(0x44b60000), - SPH_C32(0x1b6c67b0), SPH_C32(0x3cf3ac75), SPH_C32(0x61e610b0), - SPH_C32(0xdbcadb80) } -}; - -static const sph_u32 T512_30[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x86790000), SPH_C32(0x3f390002), SPH_C32(0xe19ae000), - SPH_C32(0x98560000), SPH_C32(0x9565670e), SPH_C32(0x4e88c8ea), - SPH_C32(0xd3dd4944), SPH_C32(0x161ddab9), SPH_C32(0x30b70000), - SPH_C32(0xe5d00000), SPH_C32(0xf4f46000), SPH_C32(0x42c40000), - SPH_C32(0x63b83d6a), SPH_C32(0x78ba9460), SPH_C32(0x21afa1ea), - SPH_C32(0xb0a51834) }, - { SPH_C32(0x30b70000), SPH_C32(0xe5d00000), SPH_C32(0xf4f46000), - SPH_C32(0x42c40000), SPH_C32(0x63b83d6a), SPH_C32(0x78ba9460), - SPH_C32(0x21afa1ea), SPH_C32(0xb0a51834), SPH_C32(0xb6ce0000), - SPH_C32(0xdae90002), SPH_C32(0x156e8000), SPH_C32(0xda920000), - SPH_C32(0xf6dd5a64), SPH_C32(0x36325c8a), SPH_C32(0xf272e8ae), - SPH_C32(0xa6b8c28d) }, - { SPH_C32(0xb6ce0000), SPH_C32(0xdae90002), SPH_C32(0x156e8000), - SPH_C32(0xda920000), SPH_C32(0xf6dd5a64), SPH_C32(0x36325c8a), - SPH_C32(0xf272e8ae), SPH_C32(0xa6b8c28d), SPH_C32(0x86790000), - SPH_C32(0x3f390002), SPH_C32(0xe19ae000), SPH_C32(0x98560000), - SPH_C32(0x9565670e), SPH_C32(0x4e88c8ea), SPH_C32(0xd3dd4944), - SPH_C32(0x161ddab9) } -}; - -static const sph_u32 T512_32[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xaec30000), SPH_C32(0x9c4f0001), SPH_C32(0x79d1e000), - SPH_C32(0x2c150000), SPH_C32(0x45cc75b3), SPH_C32(0x6650b736), - SPH_C32(0xab92f78f), SPH_C32(0xa312567b), SPH_C32(0xdb250000), - SPH_C32(0x09290000), SPH_C32(0x49aac000), SPH_C32(0x81e10000), - SPH_C32(0xcafe6b59), SPH_C32(0x42793431), SPH_C32(0x43566b76), - SPH_C32(0xe86cba2e) }, - { SPH_C32(0xdb250000), SPH_C32(0x09290000), SPH_C32(0x49aac000), - SPH_C32(0x81e10000), SPH_C32(0xcafe6b59), SPH_C32(0x42793431), - SPH_C32(0x43566b76), SPH_C32(0xe86cba2e), SPH_C32(0x75e60000), - SPH_C32(0x95660001), SPH_C32(0x307b2000), SPH_C32(0xadf40000), - SPH_C32(0x8f321eea), SPH_C32(0x24298307), SPH_C32(0xe8c49cf9), - SPH_C32(0x4b7eec55) }, - { SPH_C32(0x75e60000), SPH_C32(0x95660001), SPH_C32(0x307b2000), - SPH_C32(0xadf40000), SPH_C32(0x8f321eea), SPH_C32(0x24298307), - SPH_C32(0xe8c49cf9), SPH_C32(0x4b7eec55), SPH_C32(0xaec30000), - SPH_C32(0x9c4f0001), SPH_C32(0x79d1e000), SPH_C32(0x2c150000), - SPH_C32(0x45cc75b3), SPH_C32(0x6650b736), SPH_C32(0xab92f78f), - SPH_C32(0xa312567b) } -}; - -static const sph_u32 T512_34[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xac480000), SPH_C32(0x1ba60000), SPH_C32(0x45fb1380), - SPH_C32(0x03430000), SPH_C32(0x5a85316a), SPH_C32(0x1fb250b6), - SPH_C32(0xfe72c7fe), SPH_C32(0x91e478f6), SPH_C32(0x1e4e0000), - SPH_C32(0xdecf0000), SPH_C32(0x6df80180), SPH_C32(0x77240000), - SPH_C32(0xec47079e), SPH_C32(0xf4a0694e), SPH_C32(0xcda31812), - SPH_C32(0x98aa496e) }, - { SPH_C32(0x1e4e0000), SPH_C32(0xdecf0000), SPH_C32(0x6df80180), - SPH_C32(0x77240000), SPH_C32(0xec47079e), SPH_C32(0xf4a0694e), - SPH_C32(0xcda31812), SPH_C32(0x98aa496e), SPH_C32(0xb2060000), - SPH_C32(0xc5690000), SPH_C32(0x28031200), SPH_C32(0x74670000), - SPH_C32(0xb6c236f4), SPH_C32(0xeb1239f8), SPH_C32(0x33d1dfec), - SPH_C32(0x094e3198) }, - { SPH_C32(0xb2060000), SPH_C32(0xc5690000), SPH_C32(0x28031200), - SPH_C32(0x74670000), SPH_C32(0xb6c236f4), SPH_C32(0xeb1239f8), - SPH_C32(0x33d1dfec), SPH_C32(0x094e3198), SPH_C32(0xac480000), - SPH_C32(0x1ba60000), SPH_C32(0x45fb1380), SPH_C32(0x03430000), - SPH_C32(0x5a85316a), SPH_C32(0x1fb250b6), SPH_C32(0xfe72c7fe), - SPH_C32(0x91e478f6) } -}; - -static const sph_u32 T512_36[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x78230000), SPH_C32(0x12fc0000), SPH_C32(0xa93a0b80), - SPH_C32(0x90a50000), SPH_C32(0x713e2879), SPH_C32(0x7ee98924), - SPH_C32(0xf08ca062), SPH_C32(0x636f8bab), SPH_C32(0x02af0000), - SPH_C32(0xb7280000), SPH_C32(0xba1c0300), SPH_C32(0x56980000), - SPH_C32(0xba8d45d3), SPH_C32(0x8048c667), SPH_C32(0xa95c149a), - SPH_C32(0xf4f6ea7b) }, - { SPH_C32(0x02af0000), SPH_C32(0xb7280000), SPH_C32(0xba1c0300), - SPH_C32(0x56980000), SPH_C32(0xba8d45d3), SPH_C32(0x8048c667), - SPH_C32(0xa95c149a), SPH_C32(0xf4f6ea7b), SPH_C32(0x7a8c0000), - SPH_C32(0xa5d40000), SPH_C32(0x13260880), SPH_C32(0xc63d0000), - SPH_C32(0xcbb36daa), SPH_C32(0xfea14f43), SPH_C32(0x59d0b4f8), - SPH_C32(0x979961d0) }, - { SPH_C32(0x7a8c0000), SPH_C32(0xa5d40000), SPH_C32(0x13260880), - SPH_C32(0xc63d0000), SPH_C32(0xcbb36daa), SPH_C32(0xfea14f43), - SPH_C32(0x59d0b4f8), SPH_C32(0x979961d0), SPH_C32(0x78230000), - SPH_C32(0x12fc0000), SPH_C32(0xa93a0b80), SPH_C32(0x90a50000), - SPH_C32(0x713e2879), SPH_C32(0x7ee98924), SPH_C32(0xf08ca062), - SPH_C32(0x636f8bab) } -}; - -static const sph_u32 T512_38[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xcc140000), SPH_C32(0xa5630000), SPH_C32(0x5ab90780), - SPH_C32(0x3b500000), SPH_C32(0x4bd013ff), SPH_C32(0x879b3418), - SPH_C32(0x694348c1), SPH_C32(0xca5a87fe), SPH_C32(0x819e0000), - SPH_C32(0xec570000), SPH_C32(0x66320280), SPH_C32(0x95f30000), - SPH_C32(0x5da92802), SPH_C32(0x48f43cbc), SPH_C32(0xe65aa22d), - SPH_C32(0x8e67b7fa) }, - { SPH_C32(0x819e0000), SPH_C32(0xec570000), SPH_C32(0x66320280), - SPH_C32(0x95f30000), SPH_C32(0x5da92802), SPH_C32(0x48f43cbc), - SPH_C32(0xe65aa22d), SPH_C32(0x8e67b7fa), SPH_C32(0x4d8a0000), - SPH_C32(0x49340000), SPH_C32(0x3c8b0500), SPH_C32(0xaea30000), - SPH_C32(0x16793bfd), SPH_C32(0xcf6f08a4), SPH_C32(0x8f19eaec), - SPH_C32(0x443d3004) }, - { SPH_C32(0x4d8a0000), SPH_C32(0x49340000), SPH_C32(0x3c8b0500), - SPH_C32(0xaea30000), SPH_C32(0x16793bfd), SPH_C32(0xcf6f08a4), - SPH_C32(0x8f19eaec), SPH_C32(0x443d3004), SPH_C32(0xcc140000), - SPH_C32(0xa5630000), SPH_C32(0x5ab90780), SPH_C32(0x3b500000), - SPH_C32(0x4bd013ff), SPH_C32(0x879b3418), SPH_C32(0x694348c1), - SPH_C32(0xca5a87fe) } -}; - -static const sph_u32 T512_40[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x52500000), SPH_C32(0x29540000), SPH_C32(0x6a61004e), - SPH_C32(0xf0ff0000), SPH_C32(0x9a317eec), SPH_C32(0x452341ce), - SPH_C32(0xcf568fe5), SPH_C32(0x5303130f), SPH_C32(0x538d0000), - SPH_C32(0xa9fc0000), SPH_C32(0x9ef70006), SPH_C32(0x56ff0000), - SPH_C32(0x0ae4004e), SPH_C32(0x92c5cdf9), SPH_C32(0xa9444018), - SPH_C32(0x7f975691) }, - { SPH_C32(0x538d0000), SPH_C32(0xa9fc0000), SPH_C32(0x9ef70006), - SPH_C32(0x56ff0000), SPH_C32(0x0ae4004e), SPH_C32(0x92c5cdf9), - SPH_C32(0xa9444018), SPH_C32(0x7f975691), SPH_C32(0x01dd0000), - SPH_C32(0x80a80000), SPH_C32(0xf4960048), SPH_C32(0xa6000000), - SPH_C32(0x90d57ea2), SPH_C32(0xd7e68c37), SPH_C32(0x6612cffd), - SPH_C32(0x2c94459e) }, - { SPH_C32(0x01dd0000), SPH_C32(0x80a80000), SPH_C32(0xf4960048), - SPH_C32(0xa6000000), SPH_C32(0x90d57ea2), SPH_C32(0xd7e68c37), - SPH_C32(0x6612cffd), SPH_C32(0x2c94459e), SPH_C32(0x52500000), - SPH_C32(0x29540000), SPH_C32(0x6a61004e), SPH_C32(0xf0ff0000), - SPH_C32(0x9a317eec), SPH_C32(0x452341ce), SPH_C32(0xcf568fe5), - SPH_C32(0x5303130f) } -}; - -static const sph_u32 T512_42[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x88980000), SPH_C32(0x1f940000), SPH_C32(0x7fcf002e), - SPH_C32(0xfb4e0000), SPH_C32(0xf158079a), SPH_C32(0x61ae9167), - SPH_C32(0xa895706c), SPH_C32(0xe6107494), SPH_C32(0x0bc20000), - SPH_C32(0xdb630000), SPH_C32(0x7e88000c), SPH_C32(0x15860000), - SPH_C32(0x91fd48f3), SPH_C32(0x7581bb43), SPH_C32(0xf460449e), - SPH_C32(0xd8b61463) }, - { SPH_C32(0x0bc20000), SPH_C32(0xdb630000), SPH_C32(0x7e88000c), - SPH_C32(0x15860000), SPH_C32(0x91fd48f3), SPH_C32(0x7581bb43), - SPH_C32(0xf460449e), SPH_C32(0xd8b61463), SPH_C32(0x835a0000), - SPH_C32(0xc4f70000), SPH_C32(0x01470022), SPH_C32(0xeec80000), - SPH_C32(0x60a54f69), SPH_C32(0x142f2a24), SPH_C32(0x5cf534f2), - SPH_C32(0x3ea660f7) }, - { SPH_C32(0x835a0000), SPH_C32(0xc4f70000), SPH_C32(0x01470022), - SPH_C32(0xeec80000), SPH_C32(0x60a54f69), SPH_C32(0x142f2a24), - SPH_C32(0x5cf534f2), SPH_C32(0x3ea660f7), SPH_C32(0x88980000), - SPH_C32(0x1f940000), SPH_C32(0x7fcf002e), SPH_C32(0xfb4e0000), - SPH_C32(0xf158079a), SPH_C32(0x61ae9167), SPH_C32(0xa895706c), - SPH_C32(0xe6107494) } -}; - -static const sph_u32 T512_44[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xa53b0000), SPH_C32(0x14260000), SPH_C32(0x4e30001e), - SPH_C32(0x7cae0000), SPH_C32(0x8f9e0dd5), SPH_C32(0x78dfaa3d), - SPH_C32(0xf73168d8), SPH_C32(0x0b1b4946), SPH_C32(0x07ed0000), - SPH_C32(0xb2500000), SPH_C32(0x8774000a), SPH_C32(0x970d0000), - SPH_C32(0x437223ae), SPH_C32(0x48c76ea4), SPH_C32(0xf4786222), - SPH_C32(0x9075b1ce) }, - { SPH_C32(0x07ed0000), SPH_C32(0xb2500000), SPH_C32(0x8774000a), - SPH_C32(0x970d0000), SPH_C32(0x437223ae), SPH_C32(0x48c76ea4), - SPH_C32(0xf4786222), SPH_C32(0x9075b1ce), SPH_C32(0xa2d60000), - SPH_C32(0xa6760000), SPH_C32(0xc9440014), SPH_C32(0xeba30000), - SPH_C32(0xccec2e7b), SPH_C32(0x3018c499), SPH_C32(0x03490afa), - SPH_C32(0x9b6ef888) }, - { SPH_C32(0xa2d60000), SPH_C32(0xa6760000), SPH_C32(0xc9440014), - SPH_C32(0xeba30000), SPH_C32(0xccec2e7b), SPH_C32(0x3018c499), - SPH_C32(0x03490afa), SPH_C32(0x9b6ef888), SPH_C32(0xa53b0000), - SPH_C32(0x14260000), SPH_C32(0x4e30001e), SPH_C32(0x7cae0000), - SPH_C32(0x8f9e0dd5), SPH_C32(0x78dfaa3d), SPH_C32(0xf73168d8), - SPH_C32(0x0b1b4946) } -}; - -static const sph_u32 T512_46[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x58430000), SPH_C32(0x807e0000), SPH_C32(0x78330001), - SPH_C32(0xc66b3800), SPH_C32(0xe7375cdc), SPH_C32(0x79ad3fdd), - SPH_C32(0xac73fe6f), SPH_C32(0x3a4479b1), SPH_C32(0x1d5a0000), - SPH_C32(0x2b720000), SPH_C32(0x488d0000), SPH_C32(0xaf611800), - SPH_C32(0x25cb2ec5), SPH_C32(0xc879bfd0), SPH_C32(0x81a20429), - SPH_C32(0x1e7536a6) }, - { SPH_C32(0x1d5a0000), SPH_C32(0x2b720000), SPH_C32(0x488d0000), - SPH_C32(0xaf611800), SPH_C32(0x25cb2ec5), SPH_C32(0xc879bfd0), - SPH_C32(0x81a20429), SPH_C32(0x1e7536a6), SPH_C32(0x45190000), - SPH_C32(0xab0c0000), SPH_C32(0x30be0001), SPH_C32(0x690a2000), - SPH_C32(0xc2fc7219), SPH_C32(0xb1d4800d), SPH_C32(0x2dd1fa46), - SPH_C32(0x24314f17) }, - { SPH_C32(0x45190000), SPH_C32(0xab0c0000), SPH_C32(0x30be0001), - SPH_C32(0x690a2000), SPH_C32(0xc2fc7219), SPH_C32(0xb1d4800d), - SPH_C32(0x2dd1fa46), SPH_C32(0x24314f17), SPH_C32(0x58430000), - SPH_C32(0x807e0000), SPH_C32(0x78330001), SPH_C32(0xc66b3800), - SPH_C32(0xe7375cdc), SPH_C32(0x79ad3fdd), SPH_C32(0xac73fe6f), - SPH_C32(0x3a4479b1) } -}; - -static const sph_u32 T512_48[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x1e6c0000), SPH_C32(0xc4420000), SPH_C32(0x8a2e0000), - SPH_C32(0xbcb6b800), SPH_C32(0x2c4413b6), SPH_C32(0x8bfdd3da), - SPH_C32(0x6a0c1bc8), SPH_C32(0xb99dc2eb), SPH_C32(0x92560000), - SPH_C32(0x1eda0000), SPH_C32(0xea510000), SPH_C32(0xe8b13000), - SPH_C32(0xa93556a5), SPH_C32(0xebfb6199), SPH_C32(0xb15c2254), - SPH_C32(0x33c5244f) }, - { SPH_C32(0x92560000), SPH_C32(0x1eda0000), SPH_C32(0xea510000), - SPH_C32(0xe8b13000), SPH_C32(0xa93556a5), SPH_C32(0xebfb6199), - SPH_C32(0xb15c2254), SPH_C32(0x33c5244f), SPH_C32(0x8c3a0000), - SPH_C32(0xda980000), SPH_C32(0x607f0000), SPH_C32(0x54078800), - SPH_C32(0x85714513), SPH_C32(0x6006b243), SPH_C32(0xdb50399c), - SPH_C32(0x8a58e6a4) }, - { SPH_C32(0x8c3a0000), SPH_C32(0xda980000), SPH_C32(0x607f0000), - SPH_C32(0x54078800), SPH_C32(0x85714513), SPH_C32(0x6006b243), - SPH_C32(0xdb50399c), SPH_C32(0x8a58e6a4), SPH_C32(0x1e6c0000), - SPH_C32(0xc4420000), SPH_C32(0x8a2e0000), SPH_C32(0xbcb6b800), - SPH_C32(0x2c4413b6), SPH_C32(0x8bfdd3da), SPH_C32(0x6a0c1bc8), - SPH_C32(0xb99dc2eb) } -}; - -static const sph_u32 T512_50[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x02f20000), SPH_C32(0xa2810000), SPH_C32(0x873f0000), - SPH_C32(0xe36c7800), SPH_C32(0x1e1d74ef), SPH_C32(0x073d2bd6), - SPH_C32(0xc4c23237), SPH_C32(0x7f32259e), SPH_C32(0xbadd0000), - SPH_C32(0x13ad0000), SPH_C32(0xb7e70000), SPH_C32(0xf7282800), - SPH_C32(0xdf45144d), SPH_C32(0x361ac33a), SPH_C32(0xea5a8d14), - SPH_C32(0x2a2c18f0) }, - { SPH_C32(0xbadd0000), SPH_C32(0x13ad0000), SPH_C32(0xb7e70000), - SPH_C32(0xf7282800), SPH_C32(0xdf45144d), SPH_C32(0x361ac33a), - SPH_C32(0xea5a8d14), SPH_C32(0x2a2c18f0), SPH_C32(0xb82f0000), - SPH_C32(0xb12c0000), SPH_C32(0x30d80000), SPH_C32(0x14445000), - SPH_C32(0xc15860a2), SPH_C32(0x3127e8ec), SPH_C32(0x2e98bf23), - SPH_C32(0x551e3d6e) }, - { SPH_C32(0xb82f0000), SPH_C32(0xb12c0000), SPH_C32(0x30d80000), - SPH_C32(0x14445000), SPH_C32(0xc15860a2), SPH_C32(0x3127e8ec), - SPH_C32(0x2e98bf23), SPH_C32(0x551e3d6e), SPH_C32(0x02f20000), - SPH_C32(0xa2810000), SPH_C32(0x873f0000), SPH_C32(0xe36c7800), - SPH_C32(0x1e1d74ef), SPH_C32(0x073d2bd6), SPH_C32(0xc4c23237), - SPH_C32(0x7f32259e) } -}; - -static const sph_u32 T512_52[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xb4310000), SPH_C32(0x77330000), SPH_C32(0xb15d0000), - SPH_C32(0x7fd004e0), SPH_C32(0x78a26138), SPH_C32(0xd116c35d), - SPH_C32(0xd256d489), SPH_C32(0x4e6f74de), SPH_C32(0xe3060000), - SPH_C32(0xbdc10000), SPH_C32(0x87130000), SPH_C32(0xbff20060), - SPH_C32(0x2eba0a1a), SPH_C32(0x8db53751), SPH_C32(0x73c5ab06), - SPH_C32(0x5bd61539) }, - { SPH_C32(0xe3060000), SPH_C32(0xbdc10000), SPH_C32(0x87130000), - SPH_C32(0xbff20060), SPH_C32(0x2eba0a1a), SPH_C32(0x8db53751), - SPH_C32(0x73c5ab06), SPH_C32(0x5bd61539), SPH_C32(0x57370000), - SPH_C32(0xcaf20000), SPH_C32(0x364e0000), SPH_C32(0xc0220480), - SPH_C32(0x56186b22), SPH_C32(0x5ca3f40c), SPH_C32(0xa1937f8f), - SPH_C32(0x15b961e7) }, - { SPH_C32(0x57370000), SPH_C32(0xcaf20000), SPH_C32(0x364e0000), - SPH_C32(0xc0220480), SPH_C32(0x56186b22), SPH_C32(0x5ca3f40c), - SPH_C32(0xa1937f8f), SPH_C32(0x15b961e7), SPH_C32(0xb4310000), - SPH_C32(0x77330000), SPH_C32(0xb15d0000), SPH_C32(0x7fd004e0), - SPH_C32(0x78a26138), SPH_C32(0xd116c35d), SPH_C32(0xd256d489), - SPH_C32(0x4e6f74de) } -}; - -static const sph_u32 T512_54[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xe6280000), SPH_C32(0x4c4b0000), SPH_C32(0xa8550000), - SPH_C32(0xd3d002e0), SPH_C32(0xd86130b8), SPH_C32(0x98a7b0da), - SPH_C32(0x289506b4), SPH_C32(0xd75a4897), SPH_C32(0xf0c50000), - SPH_C32(0x59230000), SPH_C32(0x45820000), SPH_C32(0xe18d00c0), - SPH_C32(0x3b6d0631), SPH_C32(0xc2ed5699), SPH_C32(0xcbe0fe1c), - SPH_C32(0x56a7b19f) }, - { SPH_C32(0xf0c50000), SPH_C32(0x59230000), SPH_C32(0x45820000), - SPH_C32(0xe18d00c0), SPH_C32(0x3b6d0631), SPH_C32(0xc2ed5699), - SPH_C32(0xcbe0fe1c), SPH_C32(0x56a7b19f), SPH_C32(0x16ed0000), - SPH_C32(0x15680000), SPH_C32(0xedd70000), SPH_C32(0x325d0220), - SPH_C32(0xe30c3689), SPH_C32(0x5a4ae643), SPH_C32(0xe375f8a8), - SPH_C32(0x81fdf908) }, - { SPH_C32(0x16ed0000), SPH_C32(0x15680000), SPH_C32(0xedd70000), - SPH_C32(0x325d0220), SPH_C32(0xe30c3689), SPH_C32(0x5a4ae643), - SPH_C32(0xe375f8a8), SPH_C32(0x81fdf908), SPH_C32(0xe6280000), - SPH_C32(0x4c4b0000), SPH_C32(0xa8550000), SPH_C32(0xd3d002e0), - SPH_C32(0xd86130b8), SPH_C32(0x98a7b0da), SPH_C32(0x289506b4), - SPH_C32(0xd75a4897) } -}; - -static const sph_u32 T512_56[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xee930000), SPH_C32(0xd6070000), SPH_C32(0x92c10000), - SPH_C32(0x2b9801e0), SPH_C32(0x9451287c), SPH_C32(0x3b6cfb57), - SPH_C32(0x45312374), SPH_C32(0x201f6a64), SPH_C32(0x7b280000), - SPH_C32(0x57420000), SPH_C32(0xa9e50000), SPH_C32(0x634300a0), - SPH_C32(0x9edb442f), SPH_C32(0x6d9995bb), SPH_C32(0x27f83b03), - SPH_C32(0xc7ff60f0) }, - { SPH_C32(0x7b280000), SPH_C32(0x57420000), SPH_C32(0xa9e50000), - SPH_C32(0x634300a0), SPH_C32(0x9edb442f), SPH_C32(0x6d9995bb), - SPH_C32(0x27f83b03), SPH_C32(0xc7ff60f0), SPH_C32(0x95bb0000), - SPH_C32(0x81450000), SPH_C32(0x3b240000), SPH_C32(0x48db0140), - SPH_C32(0x0a8a6c53), SPH_C32(0x56f56eec), SPH_C32(0x62c91877), - SPH_C32(0xe7e00a94) }, - { SPH_C32(0x95bb0000), SPH_C32(0x81450000), SPH_C32(0x3b240000), - SPH_C32(0x48db0140), SPH_C32(0x0a8a6c53), SPH_C32(0x56f56eec), - SPH_C32(0x62c91877), SPH_C32(0xe7e00a94), SPH_C32(0xee930000), - SPH_C32(0xd6070000), SPH_C32(0x92c10000), SPH_C32(0x2b9801e0), - SPH_C32(0x9451287c), SPH_C32(0x3b6cfb57), SPH_C32(0x45312374), - SPH_C32(0x201f6a64) } -}; - -static const sph_u32 T512_58[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x5fa80000), SPH_C32(0x56030000), SPH_C32(0x43ae0000), - SPH_C32(0x64f30013), SPH_C32(0x257e86bf), SPH_C32(0x1311944e), - SPH_C32(0x541e95bf), SPH_C32(0x8ea4db69), SPH_C32(0x00440000), - SPH_C32(0x7f480000), SPH_C32(0xda7c0000), SPH_C32(0x2a230001), - SPH_C32(0x3badc9cc), SPH_C32(0xa9b69c87), SPH_C32(0x030a9e60), - SPH_C32(0xbe0a679e) }, - { SPH_C32(0x00440000), SPH_C32(0x7f480000), SPH_C32(0xda7c0000), - SPH_C32(0x2a230001), SPH_C32(0x3badc9cc), SPH_C32(0xa9b69c87), - SPH_C32(0x030a9e60), SPH_C32(0xbe0a679e), SPH_C32(0x5fec0000), - SPH_C32(0x294b0000), SPH_C32(0x99d20000), SPH_C32(0x4ed00012), - SPH_C32(0x1ed34f73), SPH_C32(0xbaa708c9), SPH_C32(0x57140bdf), - SPH_C32(0x30aebcf7) }, - { SPH_C32(0x5fec0000), SPH_C32(0x294b0000), SPH_C32(0x99d20000), - SPH_C32(0x4ed00012), SPH_C32(0x1ed34f73), SPH_C32(0xbaa708c9), - SPH_C32(0x57140bdf), SPH_C32(0x30aebcf7), SPH_C32(0x5fa80000), - SPH_C32(0x56030000), SPH_C32(0x43ae0000), SPH_C32(0x64f30013), - SPH_C32(0x257e86bf), SPH_C32(0x1311944e), SPH_C32(0x541e95bf), - SPH_C32(0x8ea4db69) } -}; - -static const sph_u32 T512_60[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x01930000), SPH_C32(0xe7820000), SPH_C32(0xedfb0000), - SPH_C32(0xcf0c000b), SPH_C32(0x8dd08d58), SPH_C32(0xbca3b42e), - SPH_C32(0x063661e1), SPH_C32(0x536f9e7b), SPH_C32(0x92280000), - SPH_C32(0xdc850000), SPH_C32(0x57fa0000), SPH_C32(0x56dc0003), - SPH_C32(0xbae92316), SPH_C32(0x5aefa30c), SPH_C32(0x90cef752), - SPH_C32(0x7b1675d7) }, - { SPH_C32(0x92280000), SPH_C32(0xdc850000), SPH_C32(0x57fa0000), - SPH_C32(0x56dc0003), SPH_C32(0xbae92316), SPH_C32(0x5aefa30c), - SPH_C32(0x90cef752), SPH_C32(0x7b1675d7), SPH_C32(0x93bb0000), - SPH_C32(0x3b070000), SPH_C32(0xba010000), SPH_C32(0x99d00008), - SPH_C32(0x3739ae4e), SPH_C32(0xe64c1722), SPH_C32(0x96f896b3), - SPH_C32(0x2879ebac) }, - { SPH_C32(0x93bb0000), SPH_C32(0x3b070000), SPH_C32(0xba010000), - SPH_C32(0x99d00008), SPH_C32(0x3739ae4e), SPH_C32(0xe64c1722), - SPH_C32(0x96f896b3), SPH_C32(0x2879ebac), SPH_C32(0x01930000), - SPH_C32(0xe7820000), SPH_C32(0xedfb0000), SPH_C32(0xcf0c000b), - SPH_C32(0x8dd08d58), SPH_C32(0xbca3b42e), SPH_C32(0x063661e1), - SPH_C32(0x536f9e7b) } -}; - -static const sph_u32 T512_62[4][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x033d0000), SPH_C32(0x08b30000), SPH_C32(0xf33a0000), - SPH_C32(0x3ac20007), SPH_C32(0x51298a50), SPH_C32(0x6b6e661f), - SPH_C32(0x0ea5cfe3), SPH_C32(0xe6da7ffe), SPH_C32(0xa8da0000), - SPH_C32(0x96be0000), SPH_C32(0x5c1d0000), SPH_C32(0x07da0002), - SPH_C32(0x7d669583), SPH_C32(0x1f98708a), SPH_C32(0xbb668808), - SPH_C32(0xda878000) }, - { SPH_C32(0xa8da0000), SPH_C32(0x96be0000), SPH_C32(0x5c1d0000), - SPH_C32(0x07da0002), SPH_C32(0x7d669583), SPH_C32(0x1f98708a), - SPH_C32(0xbb668808), SPH_C32(0xda878000), SPH_C32(0xabe70000), - SPH_C32(0x9e0d0000), SPH_C32(0xaf270000), SPH_C32(0x3d180005), - SPH_C32(0x2c4f1fd3), SPH_C32(0x74f61695), SPH_C32(0xb5c347eb), - SPH_C32(0x3c5dfffe) }, - { SPH_C32(0xabe70000), SPH_C32(0x9e0d0000), SPH_C32(0xaf270000), - SPH_C32(0x3d180005), SPH_C32(0x2c4f1fd3), SPH_C32(0x74f61695), - SPH_C32(0xb5c347eb), SPH_C32(0x3c5dfffe), SPH_C32(0x033d0000), - SPH_C32(0x08b30000), SPH_C32(0xf33a0000), SPH_C32(0x3ac20007), - SPH_C32(0x51298a50), SPH_C32(0x6b6e661f), SPH_C32(0x0ea5cfe3), - SPH_C32(0xe6da7ffe) } -}; - -#define INPUT_BIG do { \ - unsigned acc = buf[0]; \ - const sph_u32 *rp; \ - rp = &T512_0[acc >> 6][0]; \ - m0 = rp[0]; \ - m1 = rp[1]; \ - m2 = rp[2]; \ - m3 = rp[3]; \ - m4 = rp[4]; \ - m5 = rp[5]; \ - m6 = rp[6]; \ - m7 = rp[7]; \ - m8 = rp[8]; \ - m9 = rp[9]; \ - mA = rp[10]; \ - mB = rp[11]; \ - mC = rp[12]; \ - mD = rp[13]; \ - mE = rp[14]; \ - mF = rp[15]; \ - rp = &T512_2[(acc >> 4) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_4[(acc >> 2) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_6[acc & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[1]; \ - rp = &T512_8[acc >> 6][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_10[(acc >> 4) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_12[(acc >> 2) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_14[acc & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[2]; \ - rp = &T512_16[acc >> 6][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_18[(acc >> 4) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_20[(acc >> 2) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_22[acc & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[3]; \ - rp = &T512_24[acc >> 6][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_26[(acc >> 4) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_28[(acc >> 2) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_30[acc & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[4]; \ - rp = &T512_32[acc >> 6][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_34[(acc >> 4) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_36[(acc >> 2) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_38[acc & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[5]; \ - rp = &T512_40[acc >> 6][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_42[(acc >> 4) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_44[(acc >> 2) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_46[acc & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[6]; \ - rp = &T512_48[acc >> 6][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_50[(acc >> 4) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_52[(acc >> 2) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_54[acc & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[7]; \ - rp = &T512_56[acc >> 6][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_58[(acc >> 4) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_60[(acc >> 2) & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_62[acc & 0x03][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - } while (0) - -#endif - -#if SPH_HAMSI_EXPAND_BIG == 3 - -static const sph_u32 T512_0[8][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x9cbb1800), SPH_C32(0xb0d30000), SPH_C32(0x92510000), - SPH_C32(0xed930000), SPH_C32(0x593a4345), SPH_C32(0xe114d5f4), - SPH_C32(0x430633da), SPH_C32(0x78cace29), SPH_C32(0xc8934400), - SPH_C32(0x5a3e0000), SPH_C32(0x57870000), SPH_C32(0x4c560000), - SPH_C32(0xea982435), SPH_C32(0x75b11115), SPH_C32(0x28b67247), - SPH_C32(0x2dd1f9ab) }, - { SPH_C32(0x29449c00), SPH_C32(0x64e70000), SPH_C32(0xf24b0000), - SPH_C32(0xc2f30000), SPH_C32(0x0ede4e8f), SPH_C32(0x56c23745), - SPH_C32(0xf3e04259), SPH_C32(0x8d0d9ec4), SPH_C32(0x466d0c00), - SPH_C32(0x08620000), SPH_C32(0xdd5d0000), SPH_C32(0xbadd0000), - SPH_C32(0x6a927942), SPH_C32(0x441f2b93), SPH_C32(0x218ace6f), - SPH_C32(0xbf2c0be2) }, - { SPH_C32(0xb5ff8400), SPH_C32(0xd4340000), SPH_C32(0x601a0000), - SPH_C32(0x2f600000), SPH_C32(0x57e40dca), SPH_C32(0xb7d6e2b1), - SPH_C32(0xb0e67183), SPH_C32(0xf5c750ed), SPH_C32(0x8efe4800), - SPH_C32(0x525c0000), SPH_C32(0x8ada0000), SPH_C32(0xf68b0000), - SPH_C32(0x800a5d77), SPH_C32(0x31ae3a86), SPH_C32(0x093cbc28), - SPH_C32(0x92fdf249) }, - { SPH_C32(0x466d0c00), SPH_C32(0x08620000), SPH_C32(0xdd5d0000), - SPH_C32(0xbadd0000), SPH_C32(0x6a927942), SPH_C32(0x441f2b93), - SPH_C32(0x218ace6f), SPH_C32(0xbf2c0be2), SPH_C32(0x6f299000), - SPH_C32(0x6c850000), SPH_C32(0x2f160000), SPH_C32(0x782e0000), - SPH_C32(0x644c37cd), SPH_C32(0x12dd1cd6), SPH_C32(0xd26a8c36), - SPH_C32(0x32219526) }, - { SPH_C32(0xdad61400), SPH_C32(0xb8b10000), SPH_C32(0x4f0c0000), - SPH_C32(0x574e0000), SPH_C32(0x33a83a07), SPH_C32(0xa50bfe67), - SPH_C32(0x628cfdb5), SPH_C32(0xc7e6c5cb), SPH_C32(0xa7bad400), - SPH_C32(0x36bb0000), SPH_C32(0x78910000), SPH_C32(0x34780000), - SPH_C32(0x8ed413f8), SPH_C32(0x676c0dc3), SPH_C32(0xfadcfe71), - SPH_C32(0x1ff06c8d) }, - { SPH_C32(0x6f299000), SPH_C32(0x6c850000), SPH_C32(0x2f160000), - SPH_C32(0x782e0000), SPH_C32(0x644c37cd), SPH_C32(0x12dd1cd6), - SPH_C32(0xd26a8c36), SPH_C32(0x32219526), SPH_C32(0x29449c00), - SPH_C32(0x64e70000), SPH_C32(0xf24b0000), SPH_C32(0xc2f30000), - SPH_C32(0x0ede4e8f), SPH_C32(0x56c23745), SPH_C32(0xf3e04259), - SPH_C32(0x8d0d9ec4) }, - { SPH_C32(0xf3928800), SPH_C32(0xdc560000), SPH_C32(0xbd470000), - SPH_C32(0x95bd0000), SPH_C32(0x3d767488), SPH_C32(0xf3c9c922), - SPH_C32(0x916cbfec), SPH_C32(0x4aeb5b0f), SPH_C32(0xe1d7d800), - SPH_C32(0x3ed90000), SPH_C32(0xa5cc0000), SPH_C32(0x8ea50000), - SPH_C32(0xe4466aba), SPH_C32(0x23732650), SPH_C32(0xdb56301e), - SPH_C32(0xa0dc676f) } -}; - -static const sph_u32 T512_3[8][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x145a3c00), SPH_C32(0xb9e90000), SPH_C32(0x61270000), - SPH_C32(0xf1610000), SPH_C32(0xce613d6c), SPH_C32(0xb0493d78), - SPH_C32(0x47a96720), SPH_C32(0xe18e24c5), SPH_C32(0x23671400), - SPH_C32(0xc8b90000), SPH_C32(0xf4c70000), SPH_C32(0xfb750000), - SPH_C32(0x73cd2465), SPH_C32(0xf8a6a549), SPH_C32(0x02c40a3f), - SPH_C32(0xdc24e61f) }, - { SPH_C32(0x23671400), SPH_C32(0xc8b90000), SPH_C32(0xf4c70000), - SPH_C32(0xfb750000), SPH_C32(0x73cd2465), SPH_C32(0xf8a6a549), - SPH_C32(0x02c40a3f), SPH_C32(0xdc24e61f), SPH_C32(0x373d2800), - SPH_C32(0x71500000), SPH_C32(0x95e00000), SPH_C32(0x0a140000), - SPH_C32(0xbdac1909), SPH_C32(0x48ef9831), SPH_C32(0x456d6d1f), - SPH_C32(0x3daac2da) }, - { SPH_C32(0x373d2800), SPH_C32(0x71500000), SPH_C32(0x95e00000), - SPH_C32(0x0a140000), SPH_C32(0xbdac1909), SPH_C32(0x48ef9831), - SPH_C32(0x456d6d1f), SPH_C32(0x3daac2da), SPH_C32(0x145a3c00), - SPH_C32(0xb9e90000), SPH_C32(0x61270000), SPH_C32(0xf1610000), - SPH_C32(0xce613d6c), SPH_C32(0xb0493d78), SPH_C32(0x47a96720), - SPH_C32(0xe18e24c5) }, - { SPH_C32(0x54285c00), SPH_C32(0xeaed0000), SPH_C32(0xc5d60000), - SPH_C32(0xa1c50000), SPH_C32(0xb3a26770), SPH_C32(0x94a5c4e1), - SPH_C32(0x6bb0419d), SPH_C32(0x551b3782), SPH_C32(0x9cbb1800), - SPH_C32(0xb0d30000), SPH_C32(0x92510000), SPH_C32(0xed930000), - SPH_C32(0x593a4345), SPH_C32(0xe114d5f4), SPH_C32(0x430633da), - SPH_C32(0x78cace29) }, - { SPH_C32(0x40726000), SPH_C32(0x53040000), SPH_C32(0xa4f10000), - SPH_C32(0x50a40000), SPH_C32(0x7dc35a1c), SPH_C32(0x24ecf999), - SPH_C32(0x2c1926bd), SPH_C32(0xb4951347), SPH_C32(0xbfdc0c00), - SPH_C32(0x786a0000), SPH_C32(0x66960000), SPH_C32(0x16e60000), - SPH_C32(0x2af76720), SPH_C32(0x19b270bd), SPH_C32(0x41c239e5), - SPH_C32(0xa4ee2836) }, - { SPH_C32(0x774f4800), SPH_C32(0x22540000), SPH_C32(0x31110000), - SPH_C32(0x5ab00000), SPH_C32(0xc06f4315), SPH_C32(0x6c0361a8), - SPH_C32(0x69744ba2), SPH_C32(0x893fd19d), SPH_C32(0xab863000), - SPH_C32(0xc1830000), SPH_C32(0x07b10000), SPH_C32(0xe7870000), - SPH_C32(0xe4965a4c), SPH_C32(0xa9fb4dc5), SPH_C32(0x066b5ec5), - SPH_C32(0x45600cf3) }, - { SPH_C32(0x63157400), SPH_C32(0x9bbd0000), SPH_C32(0x50360000), - SPH_C32(0xabd10000), SPH_C32(0x0e0e7e79), SPH_C32(0xdc4a5cd0), - SPH_C32(0x2edd2c82), SPH_C32(0x68b1f558), SPH_C32(0x88e12400), - SPH_C32(0x093a0000), SPH_C32(0xf3760000), SPH_C32(0x1cf20000), - SPH_C32(0x975b7e29), SPH_C32(0x515de88c), SPH_C32(0x04af54fa), - SPH_C32(0x9944eaec) } -}; - -static const sph_u32 T512_6[8][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xb4370060), SPH_C32(0x0c4c0000), SPH_C32(0x56c20000), - SPH_C32(0x5cae0000), SPH_C32(0x94541f3f), SPH_C32(0x3b3ef825), - SPH_C32(0x1b365f3d), SPH_C32(0xf3d45758), SPH_C32(0x5cb00110), - SPH_C32(0x913e0000), SPH_C32(0x44190000), SPH_C32(0x888c0000), - SPH_C32(0x66dc7418), SPH_C32(0x921f1d66), SPH_C32(0x55ceea25), - SPH_C32(0x925c44e9) }, - { SPH_C32(0xef0b0270), SPH_C32(0x3afd0000), SPH_C32(0x5dae0000), - SPH_C32(0x69490000), SPH_C32(0x9b0f3c06), SPH_C32(0x4405b5f9), - SPH_C32(0x66140a51), SPH_C32(0x924f5d0a), SPH_C32(0xc96b0030), - SPH_C32(0xe7250000), SPH_C32(0x2f840000), SPH_C32(0x264f0000), - SPH_C32(0x08695bf9), SPH_C32(0x6dfcf137), SPH_C32(0x509f6984), - SPH_C32(0x9e69af68) }, - { SPH_C32(0x5b3c0210), SPH_C32(0x36b10000), SPH_C32(0x0b6c0000), - SPH_C32(0x35e70000), SPH_C32(0x0f5b2339), SPH_C32(0x7f3b4ddc), - SPH_C32(0x7d22556c), SPH_C32(0x619b0a52), SPH_C32(0x95db0120), - SPH_C32(0x761b0000), SPH_C32(0x6b9d0000), SPH_C32(0xaec30000), - SPH_C32(0x6eb52fe1), SPH_C32(0xffe3ec51), SPH_C32(0x055183a1), - SPH_C32(0x0c35eb81) }, - { SPH_C32(0xc96b0030), SPH_C32(0xe7250000), SPH_C32(0x2f840000), - SPH_C32(0x264f0000), SPH_C32(0x08695bf9), SPH_C32(0x6dfcf137), - SPH_C32(0x509f6984), SPH_C32(0x9e69af68), SPH_C32(0x26600240), - SPH_C32(0xddd80000), SPH_C32(0x722a0000), SPH_C32(0x4f060000), - SPH_C32(0x936667ff), SPH_C32(0x29f944ce), SPH_C32(0x368b63d5), - SPH_C32(0x0c26f262) }, - { SPH_C32(0x7d5c0050), SPH_C32(0xeb690000), SPH_C32(0x79460000), - SPH_C32(0x7ae10000), SPH_C32(0x9c3d44c6), SPH_C32(0x56c20912), - SPH_C32(0x4ba936b9), SPH_C32(0x6dbdf830), SPH_C32(0x7ad00350), - SPH_C32(0x4ce60000), SPH_C32(0x36330000), SPH_C32(0xc78a0000), - SPH_C32(0xf5ba13e7), SPH_C32(0xbbe659a8), SPH_C32(0x634589f0), - SPH_C32(0x9e7ab68b) }, - { SPH_C32(0x26600240), SPH_C32(0xddd80000), SPH_C32(0x722a0000), - SPH_C32(0x4f060000), SPH_C32(0x936667ff), SPH_C32(0x29f944ce), - SPH_C32(0x368b63d5), SPH_C32(0x0c26f262), SPH_C32(0xef0b0270), - SPH_C32(0x3afd0000), SPH_C32(0x5dae0000), SPH_C32(0x69490000), - SPH_C32(0x9b0f3c06), SPH_C32(0x4405b5f9), SPH_C32(0x66140a51), - SPH_C32(0x924f5d0a) }, - { SPH_C32(0x92570220), SPH_C32(0xd1940000), SPH_C32(0x24e80000), - SPH_C32(0x13a80000), SPH_C32(0x073278c0), SPH_C32(0x12c7bceb), - SPH_C32(0x2dbd3ce8), SPH_C32(0xfff2a53a), SPH_C32(0xb3bb0360), - SPH_C32(0xabc30000), SPH_C32(0x19b70000), SPH_C32(0xe1c50000), - SPH_C32(0xfdd3481e), SPH_C32(0xd61aa89f), SPH_C32(0x33dae074), - SPH_C32(0x001319e3) } -}; - -static const sph_u32 T512_9[8][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x774400f0), SPH_C32(0xf15a0000), SPH_C32(0xf5b20000), - SPH_C32(0x34140000), SPH_C32(0x89377e8c), SPH_C32(0x5a8bec25), - SPH_C32(0x0bc3cd1e), SPH_C32(0xcf3775cb), SPH_C32(0xf46c0050), - SPH_C32(0x96180000), SPH_C32(0x14a50000), SPH_C32(0x031f0000), - SPH_C32(0x42947eb8), SPH_C32(0x66bf7e19), SPH_C32(0x9ca470d2), - SPH_C32(0x8a341574) }, - { SPH_C32(0xf46c0050), SPH_C32(0x96180000), SPH_C32(0x14a50000), - SPH_C32(0x031f0000), SPH_C32(0x42947eb8), SPH_C32(0x66bf7e19), - SPH_C32(0x9ca470d2), SPH_C32(0x8a341574), SPH_C32(0x832800a0), - SPH_C32(0x67420000), SPH_C32(0xe1170000), SPH_C32(0x370b0000), - SPH_C32(0xcba30034), SPH_C32(0x3c34923c), SPH_C32(0x9767bdcc), - SPH_C32(0x450360bf) }, - { SPH_C32(0x832800a0), SPH_C32(0x67420000), SPH_C32(0xe1170000), - SPH_C32(0x370b0000), SPH_C32(0xcba30034), SPH_C32(0x3c34923c), - SPH_C32(0x9767bdcc), SPH_C32(0x450360bf), SPH_C32(0x774400f0), - SPH_C32(0xf15a0000), SPH_C32(0xf5b20000), SPH_C32(0x34140000), - SPH_C32(0x89377e8c), SPH_C32(0x5a8bec25), SPH_C32(0x0bc3cd1e), - SPH_C32(0xcf3775cb) }, - { SPH_C32(0xe8870170), SPH_C32(0x9d720000), SPH_C32(0x12db0000), - SPH_C32(0xd4220000), SPH_C32(0xf2886b27), SPH_C32(0xa921e543), - SPH_C32(0x4ef8b518), SPH_C32(0x618813b1), SPH_C32(0xb4370060), - SPH_C32(0x0c4c0000), SPH_C32(0x56c20000), SPH_C32(0x5cae0000), - SPH_C32(0x94541f3f), SPH_C32(0x3b3ef825), SPH_C32(0x1b365f3d), - SPH_C32(0xf3d45758) }, - { SPH_C32(0x9fc30180), SPH_C32(0x6c280000), SPH_C32(0xe7690000), - SPH_C32(0xe0360000), SPH_C32(0x7bbf15ab), SPH_C32(0xf3aa0966), - SPH_C32(0x453b7806), SPH_C32(0xaebf667a), SPH_C32(0x405b0030), - SPH_C32(0x9a540000), SPH_C32(0x42670000), SPH_C32(0x5fb10000), - SPH_C32(0xd6c06187), SPH_C32(0x5d81863c), SPH_C32(0x87922fef), - SPH_C32(0x79e0422c) }, - { SPH_C32(0x1ceb0120), SPH_C32(0x0b6a0000), SPH_C32(0x067e0000), - SPH_C32(0xd73d0000), SPH_C32(0xb01c159f), SPH_C32(0xcf9e9b5a), - SPH_C32(0xd25cc5ca), SPH_C32(0xebbc06c5), SPH_C32(0x371f00c0), - SPH_C32(0x6b0e0000), SPH_C32(0xb7d50000), SPH_C32(0x6ba50000), - SPH_C32(0x5ff71f0b), SPH_C32(0x070a6a19), SPH_C32(0x8c51e2f1), - SPH_C32(0xb6d737e7) }, - { SPH_C32(0x6baf01d0), SPH_C32(0xfa300000), SPH_C32(0xf3cc0000), - SPH_C32(0xe3290000), SPH_C32(0x392b6b13), SPH_C32(0x9515777f), - SPH_C32(0xd99f08d4), SPH_C32(0x248b730e), SPH_C32(0xc3730090), - SPH_C32(0xfd160000), SPH_C32(0xa3700000), SPH_C32(0x68ba0000), - SPH_C32(0x1d6361b3), SPH_C32(0x61b51400), SPH_C32(0x10f59223), - SPH_C32(0x3ce32293) } -}; - -static const sph_u32 T512_12[8][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xa67f0001), SPH_C32(0x71378000), SPH_C32(0x19fc0000), - SPH_C32(0x96db0000), SPH_C32(0x3a8b6dfd), SPH_C32(0xebcaaef3), - SPH_C32(0x2c6d478f), SPH_C32(0xac8e6c88), SPH_C32(0x50ff0004), - SPH_C32(0x45744000), SPH_C32(0x3dfb0000), SPH_C32(0x19e60000), - SPH_C32(0x1bbc5606), SPH_C32(0xe1727b5d), SPH_C32(0xe1a8cc96), - SPH_C32(0x7b1bd6b9) }, - { SPH_C32(0xf7750009), SPH_C32(0xcf3cc000), SPH_C32(0xc3d60000), - SPH_C32(0x04920000), SPH_C32(0x029519a9), SPH_C32(0xf8e836ba), - SPH_C32(0x7a87f14e), SPH_C32(0x9e16981a), SPH_C32(0xd46a0000), - SPH_C32(0x8dc8c000), SPH_C32(0xa5af0000), SPH_C32(0x4a290000), - SPH_C32(0xfc4e427a), SPH_C32(0xc9b4866c), SPH_C32(0x98369604), - SPH_C32(0xf746c320) }, - { SPH_C32(0x510a0008), SPH_C32(0xbe0b4000), SPH_C32(0xda2a0000), - SPH_C32(0x92490000), SPH_C32(0x381e7454), SPH_C32(0x13229849), - SPH_C32(0x56eab6c1), SPH_C32(0x3298f492), SPH_C32(0x84950004), - SPH_C32(0xc8bc8000), SPH_C32(0x98540000), SPH_C32(0x53cf0000), - SPH_C32(0xe7f2147c), SPH_C32(0x28c6fd31), SPH_C32(0x799e5a92), - SPH_C32(0x8c5d1599) }, - { SPH_C32(0xd46a0000), SPH_C32(0x8dc8c000), SPH_C32(0xa5af0000), - SPH_C32(0x4a290000), SPH_C32(0xfc4e427a), SPH_C32(0xc9b4866c), - SPH_C32(0x98369604), SPH_C32(0xf746c320), SPH_C32(0x231f0009), - SPH_C32(0x42f40000), SPH_C32(0x66790000), SPH_C32(0x4ebb0000), - SPH_C32(0xfedb5bd3), SPH_C32(0x315cb0d6), SPH_C32(0xe2b1674a), - SPH_C32(0x69505b3a) }, - { SPH_C32(0x72150001), SPH_C32(0xfcff4000), SPH_C32(0xbc530000), - SPH_C32(0xdcf20000), SPH_C32(0xc6c52f87), SPH_C32(0x227e289f), - SPH_C32(0xb45bd18b), SPH_C32(0x5bc8afa8), SPH_C32(0x73e0000d), - SPH_C32(0x07804000), SPH_C32(0x5b820000), SPH_C32(0x575d0000), - SPH_C32(0xe5670dd5), SPH_C32(0xd02ecb8b), SPH_C32(0x0319abdc), - SPH_C32(0x124b8d83) }, - { SPH_C32(0x231f0009), SPH_C32(0x42f40000), SPH_C32(0x66790000), - SPH_C32(0x4ebb0000), SPH_C32(0xfedb5bd3), SPH_C32(0x315cb0d6), - SPH_C32(0xe2b1674a), SPH_C32(0x69505b3a), SPH_C32(0xf7750009), - SPH_C32(0xcf3cc000), SPH_C32(0xc3d60000), SPH_C32(0x04920000), - SPH_C32(0x029519a9), SPH_C32(0xf8e836ba), SPH_C32(0x7a87f14e), - SPH_C32(0x9e16981a) }, - { SPH_C32(0x85600008), SPH_C32(0x33c38000), SPH_C32(0x7f850000), - SPH_C32(0xd8600000), SPH_C32(0xc450362e), SPH_C32(0xda961e25), - SPH_C32(0xcedc20c5), SPH_C32(0xc5de37b2), SPH_C32(0xa78a000d), - SPH_C32(0x8a488000), SPH_C32(0xfe2d0000), SPH_C32(0x1d740000), - SPH_C32(0x19294faf), SPH_C32(0x199a4de7), SPH_C32(0x9b2f3dd8), - SPH_C32(0xe50d4ea3) } -}; - -static const sph_u32 T512_15[8][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x75c90003), SPH_C32(0x0e10c000), SPH_C32(0xd1200000), - SPH_C32(0xbaea0000), SPH_C32(0x8bc42f3e), SPH_C32(0x8758b757), - SPH_C32(0xbb28761d), SPH_C32(0x00b72e2b), SPH_C32(0xeecf0001), - SPH_C32(0x6f564000), SPH_C32(0xf33e0000), SPH_C32(0xa79e0000), - SPH_C32(0xbdb57219), SPH_C32(0xb711ebc5), SPH_C32(0x4a3b40ba), - SPH_C32(0xfeabf254) }, - { SPH_C32(0xeecf0001), SPH_C32(0x6f564000), SPH_C32(0xf33e0000), - SPH_C32(0xa79e0000), SPH_C32(0xbdb57219), SPH_C32(0xb711ebc5), - SPH_C32(0x4a3b40ba), SPH_C32(0xfeabf254), SPH_C32(0x9b060002), - SPH_C32(0x61468000), SPH_C32(0x221e0000), SPH_C32(0x1d740000), - SPH_C32(0x36715d27), SPH_C32(0x30495c92), SPH_C32(0xf11336a7), - SPH_C32(0xfe1cdc7f) }, - { SPH_C32(0x9b060002), SPH_C32(0x61468000), SPH_C32(0x221e0000), - SPH_C32(0x1d740000), SPH_C32(0x36715d27), SPH_C32(0x30495c92), - SPH_C32(0xf11336a7), SPH_C32(0xfe1cdc7f), SPH_C32(0x75c90003), - SPH_C32(0x0e10c000), SPH_C32(0xd1200000), SPH_C32(0xbaea0000), - SPH_C32(0x8bc42f3e), SPH_C32(0x8758b757), SPH_C32(0xbb28761d), - SPH_C32(0x00b72e2b) }, - { SPH_C32(0xf6800005), SPH_C32(0x3443c000), SPH_C32(0x24070000), - SPH_C32(0x8f3d0000), SPH_C32(0x21373bfb), SPH_C32(0x0ab8d5ae), - SPH_C32(0xcdc58b19), SPH_C32(0xd795ba31), SPH_C32(0xa67f0001), - SPH_C32(0x71378000), SPH_C32(0x19fc0000), SPH_C32(0x96db0000), - SPH_C32(0x3a8b6dfd), SPH_C32(0xebcaaef3), SPH_C32(0x2c6d478f), - SPH_C32(0xac8e6c88) }, - { SPH_C32(0x83490006), SPH_C32(0x3a530000), SPH_C32(0xf5270000), - SPH_C32(0x35d70000), SPH_C32(0xaaf314c5), SPH_C32(0x8de062f9), - SPH_C32(0x76edfd04), SPH_C32(0xd722941a), SPH_C32(0x48b00000), - SPH_C32(0x1e61c000), SPH_C32(0xeac20000), SPH_C32(0x31450000), - SPH_C32(0x873e1fe4), SPH_C32(0x5cdb4536), SPH_C32(0x66560735), - SPH_C32(0x52259edc) }, - { SPH_C32(0x184f0004), SPH_C32(0x5b158000), SPH_C32(0xd7390000), - SPH_C32(0x28a30000), SPH_C32(0x9c8249e2), SPH_C32(0xbda93e6b), - SPH_C32(0x87fecba3), SPH_C32(0x293e4865), SPH_C32(0x3d790003), - SPH_C32(0x10710000), SPH_C32(0x3be20000), SPH_C32(0x8baf0000), - SPH_C32(0x0cfa30da), SPH_C32(0xdb83f261), SPH_C32(0xdd7e7128), - SPH_C32(0x5292b0f7) }, - { SPH_C32(0x6d860007), SPH_C32(0x55054000), SPH_C32(0x06190000), - SPH_C32(0x92490000), SPH_C32(0x174666dc), SPH_C32(0x3af1893c), - SPH_C32(0x3cd6bdbe), SPH_C32(0x2989664e), SPH_C32(0xd3b60002), - SPH_C32(0x7f274000), SPH_C32(0xc8dc0000), SPH_C32(0x2c310000), - SPH_C32(0xb14f42c3), SPH_C32(0x6c9219a4), SPH_C32(0x97453192), - SPH_C32(0xac3942a3) } -}; - -static const sph_u32 T512_18[8][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xb83d0000), SPH_C32(0x16710600), SPH_C32(0x379a0000), - SPH_C32(0xf5b10000), SPH_C32(0x228161ac), SPH_C32(0xae48f145), - SPH_C32(0x66241616), SPH_C32(0xc5c1eb3e), SPH_C32(0xfd250000), - SPH_C32(0xb3c41100), SPH_C32(0xcef00000), SPH_C32(0xcef90000), - SPH_C32(0x3c4d7580), SPH_C32(0x8d5b6493), SPH_C32(0x7098b0a6), - SPH_C32(0x1af21fe1) }, - { SPH_C32(0x75a40000), SPH_C32(0xc28b2700), SPH_C32(0x94a40000), - SPH_C32(0x90f50000), SPH_C32(0xfb7857e0), SPH_C32(0x49ce0bae), - SPH_C32(0x1767c483), SPH_C32(0xaedf667e), SPH_C32(0xd1660000), - SPH_C32(0x1bbc0300), SPH_C32(0x9eec0000), SPH_C32(0xf6940000), - SPH_C32(0x03024527), SPH_C32(0xcf70fcf2), SPH_C32(0xb4431b17), - SPH_C32(0x857f3c2b) }, - { SPH_C32(0xcd990000), SPH_C32(0xd4fa2100), SPH_C32(0xa33e0000), - SPH_C32(0x65440000), SPH_C32(0xd9f9364c), SPH_C32(0xe786faeb), - SPH_C32(0x7143d295), SPH_C32(0x6b1e8d40), SPH_C32(0x2c430000), - SPH_C32(0xa8781200), SPH_C32(0x501c0000), SPH_C32(0x386d0000), - SPH_C32(0x3f4f30a7), SPH_C32(0x422b9861), SPH_C32(0xc4dbabb1), - SPH_C32(0x9f8d23ca) }, - { SPH_C32(0xd1660000), SPH_C32(0x1bbc0300), SPH_C32(0x9eec0000), - SPH_C32(0xf6940000), SPH_C32(0x03024527), SPH_C32(0xcf70fcf2), - SPH_C32(0xb4431b17), SPH_C32(0x857f3c2b), SPH_C32(0xa4c20000), - SPH_C32(0xd9372400), SPH_C32(0x0a480000), SPH_C32(0x66610000), - SPH_C32(0xf87a12c7), SPH_C32(0x86bef75c), SPH_C32(0xa324df94), - SPH_C32(0x2ba05a55) }, - { SPH_C32(0x695b0000), SPH_C32(0x0dcd0500), SPH_C32(0xa9760000), - SPH_C32(0x03250000), SPH_C32(0x2183248b), SPH_C32(0x61380db7), - SPH_C32(0xd2670d01), SPH_C32(0x40bed715), SPH_C32(0x59e70000), - SPH_C32(0x6af33500), SPH_C32(0xc4b80000), SPH_C32(0xa8980000), - SPH_C32(0xc4376747), SPH_C32(0x0be593cf), SPH_C32(0xd3bc6f32), - SPH_C32(0x315245b4) }, - { SPH_C32(0xa4c20000), SPH_C32(0xd9372400), SPH_C32(0x0a480000), - SPH_C32(0x66610000), SPH_C32(0xf87a12c7), SPH_C32(0x86bef75c), - SPH_C32(0xa324df94), SPH_C32(0x2ba05a55), SPH_C32(0x75a40000), - SPH_C32(0xc28b2700), SPH_C32(0x94a40000), SPH_C32(0x90f50000), - SPH_C32(0xfb7857e0), SPH_C32(0x49ce0bae), SPH_C32(0x1767c483), - SPH_C32(0xaedf667e) }, - { SPH_C32(0x1cff0000), SPH_C32(0xcf462200), SPH_C32(0x3dd20000), - SPH_C32(0x93d00000), SPH_C32(0xdafb736b), SPH_C32(0x28f60619), - SPH_C32(0xc500c982), SPH_C32(0xee61b16b), SPH_C32(0x88810000), - SPH_C32(0x714f3600), SPH_C32(0x5a540000), SPH_C32(0x5e0c0000), - SPH_C32(0xc7352260), SPH_C32(0xc4956f3d), SPH_C32(0x67ff7425), - SPH_C32(0xb42d799f) } -}; - -static const sph_u32 T512_21[8][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x0c720000), SPH_C32(0x49e50f00), SPH_C32(0x42790000), - SPH_C32(0x5cea0000), SPH_C32(0x33aa301a), SPH_C32(0x15822514), - SPH_C32(0x95a34b7b), SPH_C32(0xb44b0090), SPH_C32(0xfe220000), - SPH_C32(0xa7580500), SPH_C32(0x25d10000), SPH_C32(0xf7600000), - SPH_C32(0x893178da), SPH_C32(0x1fd4f860), SPH_C32(0x4ed0a315), - SPH_C32(0xa123ff9f) }, - { SPH_C32(0xfe220000), SPH_C32(0xa7580500), SPH_C32(0x25d10000), - SPH_C32(0xf7600000), SPH_C32(0x893178da), SPH_C32(0x1fd4f860), - SPH_C32(0x4ed0a315), SPH_C32(0xa123ff9f), SPH_C32(0xf2500000), - SPH_C32(0xeebd0a00), SPH_C32(0x67a80000), SPH_C32(0xab8a0000), - SPH_C32(0xba9b48c0), SPH_C32(0x0a56dd74), SPH_C32(0xdb73e86e), - SPH_C32(0x1568ff0f) }, - { SPH_C32(0xf2500000), SPH_C32(0xeebd0a00), SPH_C32(0x67a80000), - SPH_C32(0xab8a0000), SPH_C32(0xba9b48c0), SPH_C32(0x0a56dd74), - SPH_C32(0xdb73e86e), SPH_C32(0x1568ff0f), SPH_C32(0x0c720000), - SPH_C32(0x49e50f00), SPH_C32(0x42790000), SPH_C32(0x5cea0000), - SPH_C32(0x33aa301a), SPH_C32(0x15822514), SPH_C32(0x95a34b7b), - SPH_C32(0xb44b0090) }, - { SPH_C32(0x45180000), SPH_C32(0xa5b51700), SPH_C32(0xf96a0000), - SPH_C32(0x3b480000), SPH_C32(0x1ecc142c), SPH_C32(0x231395d6), - SPH_C32(0x16bca6b0), SPH_C32(0xdf33f4df), SPH_C32(0xb83d0000), - SPH_C32(0x16710600), SPH_C32(0x379a0000), SPH_C32(0xf5b10000), - SPH_C32(0x228161ac), SPH_C32(0xae48f145), SPH_C32(0x66241616), - SPH_C32(0xc5c1eb3e) }, - { SPH_C32(0x496a0000), SPH_C32(0xec501800), SPH_C32(0xbb130000), - SPH_C32(0x67a20000), SPH_C32(0x2d662436), SPH_C32(0x3691b0c2), - SPH_C32(0x831fedcb), SPH_C32(0x6b78f44f), SPH_C32(0x461f0000), - SPH_C32(0xb1290300), SPH_C32(0x124b0000), SPH_C32(0x02d10000), - SPH_C32(0xabb01976), SPH_C32(0xb19c0925), SPH_C32(0x28f4b503), - SPH_C32(0x64e214a1) }, - { SPH_C32(0xbb3a0000), SPH_C32(0x02ed1200), SPH_C32(0xdcbb0000), - SPH_C32(0xcc280000), SPH_C32(0x97fd6cf6), SPH_C32(0x3cc76db6), - SPH_C32(0x586c05a5), SPH_C32(0x7e100b40), SPH_C32(0x4a6d0000), - SPH_C32(0xf8cc0c00), SPH_C32(0x50320000), SPH_C32(0x5e3b0000), - SPH_C32(0x981a296c), SPH_C32(0xa41e2c31), SPH_C32(0xbd57fe78), - SPH_C32(0xd0a91431) }, - { SPH_C32(0xb7480000), SPH_C32(0x4b081d00), SPH_C32(0x9ec20000), - SPH_C32(0x90c20000), SPH_C32(0xa4575cec), SPH_C32(0x294548a2), - SPH_C32(0xcdcf4ede), SPH_C32(0xca5b0bd0), SPH_C32(0xb44f0000), - SPH_C32(0x5f940900), SPH_C32(0x75e30000), SPH_C32(0xa95b0000), - SPH_C32(0x112b51b6), SPH_C32(0xbbcad451), SPH_C32(0xf3875d6d), - SPH_C32(0x718aebae) } -}; - -static const sph_u32 T512_24[8][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xbc8d0000), SPH_C32(0xfc3b0018), SPH_C32(0x19830000), - SPH_C32(0xd10b0000), SPH_C32(0xae1878c4), SPH_C32(0x42a69856), - SPH_C32(0x0012da37), SPH_C32(0x2c3b504e), SPH_C32(0xe8dd0000), - SPH_C32(0xfa4a0044), SPH_C32(0x3c2d0000), SPH_C32(0xbb150000), - SPH_C32(0x80bd361b), SPH_C32(0x24e81d44), SPH_C32(0xbfa8c2f4), - SPH_C32(0x524a0d59) }, - { SPH_C32(0x69510000), SPH_C32(0xd4e1009c), SPH_C32(0xc3230000), - SPH_C32(0xac2f0000), SPH_C32(0xe4950bae), SPH_C32(0xcea415dc), - SPH_C32(0x87ec287c), SPH_C32(0xbce1a3ce), SPH_C32(0xc6730000), - SPH_C32(0xaf8d000c), SPH_C32(0xa4c10000), SPH_C32(0x218d0000), - SPH_C32(0x23111587), SPH_C32(0x7913512f), SPH_C32(0x1d28ac88), - SPH_C32(0x378dd173) }, - { SPH_C32(0xd5dc0000), SPH_C32(0x28da0084), SPH_C32(0xdaa00000), - SPH_C32(0x7d240000), SPH_C32(0x4a8d736a), SPH_C32(0x8c028d8a), - SPH_C32(0x87fef24b), SPH_C32(0x90daf380), SPH_C32(0x2eae0000), - SPH_C32(0x55c70048), SPH_C32(0x98ec0000), SPH_C32(0x9a980000), - SPH_C32(0xa3ac239c), SPH_C32(0x5dfb4c6b), SPH_C32(0xa2806e7c), - SPH_C32(0x65c7dc2a) }, - { SPH_C32(0xc6730000), SPH_C32(0xaf8d000c), SPH_C32(0xa4c10000), - SPH_C32(0x218d0000), SPH_C32(0x23111587), SPH_C32(0x7913512f), - SPH_C32(0x1d28ac88), SPH_C32(0x378dd173), SPH_C32(0xaf220000), - SPH_C32(0x7b6c0090), SPH_C32(0x67e20000), SPH_C32(0x8da20000), - SPH_C32(0xc7841e29), SPH_C32(0xb7b744f3), SPH_C32(0x9ac484f4), - SPH_C32(0x8b6c72bd) }, - { SPH_C32(0x7afe0000), SPH_C32(0x53b60014), SPH_C32(0xbd420000), - SPH_C32(0xf0860000), SPH_C32(0x8d096d43), SPH_C32(0x3bb5c979), - SPH_C32(0x1d3a76bf), SPH_C32(0x1bb6813d), SPH_C32(0x47ff0000), - SPH_C32(0x812600d4), SPH_C32(0x5bcf0000), SPH_C32(0x36b70000), - SPH_C32(0x47392832), SPH_C32(0x935f59b7), SPH_C32(0x256c4600), - SPH_C32(0xd9267fe4) }, - { SPH_C32(0xaf220000), SPH_C32(0x7b6c0090), SPH_C32(0x67e20000), - SPH_C32(0x8da20000), SPH_C32(0xc7841e29), SPH_C32(0xb7b744f3), - SPH_C32(0x9ac484f4), SPH_C32(0x8b6c72bd), SPH_C32(0x69510000), - SPH_C32(0xd4e1009c), SPH_C32(0xc3230000), SPH_C32(0xac2f0000), - SPH_C32(0xe4950bae), SPH_C32(0xcea415dc), SPH_C32(0x87ec287c), - SPH_C32(0xbce1a3ce) }, - { SPH_C32(0x13af0000), SPH_C32(0x87570088), SPH_C32(0x7e610000), - SPH_C32(0x5ca90000), SPH_C32(0x699c66ed), SPH_C32(0xf511dca5), - SPH_C32(0x9ad65ec3), SPH_C32(0xa75722f3), SPH_C32(0x818c0000), - SPH_C32(0x2eab00d8), SPH_C32(0xff0e0000), SPH_C32(0x173a0000), - SPH_C32(0x64283db5), SPH_C32(0xea4c0898), SPH_C32(0x3844ea88), - SPH_C32(0xeeabae97) } -}; - -static const sph_u32 T512_27[8][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x14190000), SPH_C32(0x23ca003c), SPH_C32(0x50df0000), - SPH_C32(0x44b60000), SPH_C32(0x1b6c67b0), SPH_C32(0x3cf3ac75), - SPH_C32(0x61e610b0), SPH_C32(0xdbcadb80), SPH_C32(0xe3430000), - SPH_C32(0x3a4e0014), SPH_C32(0xf2c60000), SPH_C32(0xaa4e0000), - SPH_C32(0xdb1e42a6), SPH_C32(0x256bbe15), SPH_C32(0x123db156), - SPH_C32(0x3a4e99d7) }, - { SPH_C32(0xe3430000), SPH_C32(0x3a4e0014), SPH_C32(0xf2c60000), - SPH_C32(0xaa4e0000), SPH_C32(0xdb1e42a6), SPH_C32(0x256bbe15), - SPH_C32(0x123db156), SPH_C32(0x3a4e99d7), SPH_C32(0xf75a0000), - SPH_C32(0x19840028), SPH_C32(0xa2190000), SPH_C32(0xeef80000), - SPH_C32(0xc0722516), SPH_C32(0x19981260), SPH_C32(0x73dba1e6), - SPH_C32(0xe1844257) }, - { SPH_C32(0xf75a0000), SPH_C32(0x19840028), SPH_C32(0xa2190000), - SPH_C32(0xeef80000), SPH_C32(0xc0722516), SPH_C32(0x19981260), - SPH_C32(0x73dba1e6), SPH_C32(0xe1844257), SPH_C32(0x14190000), - SPH_C32(0x23ca003c), SPH_C32(0x50df0000), SPH_C32(0x44b60000), - SPH_C32(0x1b6c67b0), SPH_C32(0x3cf3ac75), SPH_C32(0x61e610b0), - SPH_C32(0xdbcadb80) }, - { SPH_C32(0x54500000), SPH_C32(0x0671005c), SPH_C32(0x25ae0000), - SPH_C32(0x6a1e0000), SPH_C32(0x2ea54edf), SPH_C32(0x664e8512), - SPH_C32(0xbfba18c3), SPH_C32(0x7e715d17), SPH_C32(0xbc8d0000), - SPH_C32(0xfc3b0018), SPH_C32(0x19830000), SPH_C32(0xd10b0000), - SPH_C32(0xae1878c4), SPH_C32(0x42a69856), SPH_C32(0x0012da37), - SPH_C32(0x2c3b504e) }, - { SPH_C32(0x40490000), SPH_C32(0x25bb0060), SPH_C32(0x75710000), - SPH_C32(0x2ea80000), SPH_C32(0x35c9296f), SPH_C32(0x5abd2967), - SPH_C32(0xde5c0873), SPH_C32(0xa5bb8697), SPH_C32(0x5fce0000), - SPH_C32(0xc675000c), SPH_C32(0xeb450000), SPH_C32(0x7b450000), - SPH_C32(0x75063a62), SPH_C32(0x67cd2643), SPH_C32(0x122f6b61), - SPH_C32(0x1675c999) }, - { SPH_C32(0xb7130000), SPH_C32(0x3c3f0048), SPH_C32(0xd7680000), - SPH_C32(0xc0500000), SPH_C32(0xf5bb0c79), SPH_C32(0x43253b07), - SPH_C32(0xad87a995), SPH_C32(0x443fc4c0), SPH_C32(0x4bd70000), - SPH_C32(0xe5bf0030), SPH_C32(0xbb9a0000), SPH_C32(0x3ff30000), - SPH_C32(0x6e6a5dd2), SPH_C32(0x5b3e8a36), SPH_C32(0x73c97bd1), - SPH_C32(0xcdbf1219) }, - { SPH_C32(0xa30a0000), SPH_C32(0x1ff50074), SPH_C32(0x87b70000), - SPH_C32(0x84e60000), SPH_C32(0xeed76bc9), SPH_C32(0x7fd69772), - SPH_C32(0xcc61b925), SPH_C32(0x9ff51f40), SPH_C32(0xa8940000), - SPH_C32(0xdff10024), SPH_C32(0x495c0000), SPH_C32(0x95bd0000), - SPH_C32(0xb5741f74), SPH_C32(0x7e553423), SPH_C32(0x61f4ca87), - SPH_C32(0xf7f18bce) } -}; - -static const sph_u32 T512_30[8][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xdb250000), SPH_C32(0x09290000), SPH_C32(0x49aac000), - SPH_C32(0x81e10000), SPH_C32(0xcafe6b59), SPH_C32(0x42793431), - SPH_C32(0x43566b76), SPH_C32(0xe86cba2e), SPH_C32(0x75e60000), - SPH_C32(0x95660001), SPH_C32(0x307b2000), SPH_C32(0xadf40000), - SPH_C32(0x8f321eea), SPH_C32(0x24298307), SPH_C32(0xe8c49cf9), - SPH_C32(0x4b7eec55) }, - { SPH_C32(0x86790000), SPH_C32(0x3f390002), SPH_C32(0xe19ae000), - SPH_C32(0x98560000), SPH_C32(0x9565670e), SPH_C32(0x4e88c8ea), - SPH_C32(0xd3dd4944), SPH_C32(0x161ddab9), SPH_C32(0x30b70000), - SPH_C32(0xe5d00000), SPH_C32(0xf4f46000), SPH_C32(0x42c40000), - SPH_C32(0x63b83d6a), SPH_C32(0x78ba9460), SPH_C32(0x21afa1ea), - SPH_C32(0xb0a51834) }, - { SPH_C32(0x5d5c0000), SPH_C32(0x36100002), SPH_C32(0xa8302000), - SPH_C32(0x19b70000), SPH_C32(0x5f9b0c57), SPH_C32(0x0cf1fcdb), - SPH_C32(0x908b2232), SPH_C32(0xfe716097), SPH_C32(0x45510000), - SPH_C32(0x70b60001), SPH_C32(0xc48f4000), SPH_C32(0xef300000), - SPH_C32(0xec8a2380), SPH_C32(0x5c931767), SPH_C32(0xc96b3d13), - SPH_C32(0xfbdbf461) }, - { SPH_C32(0x30b70000), SPH_C32(0xe5d00000), SPH_C32(0xf4f46000), - SPH_C32(0x42c40000), SPH_C32(0x63b83d6a), SPH_C32(0x78ba9460), - SPH_C32(0x21afa1ea), SPH_C32(0xb0a51834), SPH_C32(0xb6ce0000), - SPH_C32(0xdae90002), SPH_C32(0x156e8000), SPH_C32(0xda920000), - SPH_C32(0xf6dd5a64), SPH_C32(0x36325c8a), SPH_C32(0xf272e8ae), - SPH_C32(0xa6b8c28d) }, - { SPH_C32(0xeb920000), SPH_C32(0xecf90000), SPH_C32(0xbd5ea000), - SPH_C32(0xc3250000), SPH_C32(0xa9465633), SPH_C32(0x3ac3a051), - SPH_C32(0x62f9ca9c), SPH_C32(0x58c9a21a), SPH_C32(0xc3280000), - SPH_C32(0x4f8f0003), SPH_C32(0x2515a000), SPH_C32(0x77660000), - SPH_C32(0x79ef448e), SPH_C32(0x121bdf8d), SPH_C32(0x1ab67457), - SPH_C32(0xedc62ed8) }, - { SPH_C32(0xb6ce0000), SPH_C32(0xdae90002), SPH_C32(0x156e8000), - SPH_C32(0xda920000), SPH_C32(0xf6dd5a64), SPH_C32(0x36325c8a), - SPH_C32(0xf272e8ae), SPH_C32(0xa6b8c28d), SPH_C32(0x86790000), - SPH_C32(0x3f390002), SPH_C32(0xe19ae000), SPH_C32(0x98560000), - SPH_C32(0x9565670e), SPH_C32(0x4e88c8ea), SPH_C32(0xd3dd4944), - SPH_C32(0x161ddab9) }, - { SPH_C32(0x6deb0000), SPH_C32(0xd3c00002), SPH_C32(0x5cc44000), - SPH_C32(0x5b730000), SPH_C32(0x3c23313d), SPH_C32(0x744b68bb), - SPH_C32(0xb12483d8), SPH_C32(0x4ed478a3), SPH_C32(0xf39f0000), - SPH_C32(0xaa5f0003), SPH_C32(0xd1e1c000), SPH_C32(0x35a20000), - SPH_C32(0x1a5779e4), SPH_C32(0x6aa14bed), SPH_C32(0x3b19d5bd), - SPH_C32(0x5d6336ec) } -}; - -static const sph_u32 T512_33[8][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xac480000), SPH_C32(0x1ba60000), SPH_C32(0x45fb1380), - SPH_C32(0x03430000), SPH_C32(0x5a85316a), SPH_C32(0x1fb250b6), - SPH_C32(0xfe72c7fe), SPH_C32(0x91e478f6), SPH_C32(0x1e4e0000), - SPH_C32(0xdecf0000), SPH_C32(0x6df80180), SPH_C32(0x77240000), - SPH_C32(0xec47079e), SPH_C32(0xf4a0694e), SPH_C32(0xcda31812), - SPH_C32(0x98aa496e) }, - { SPH_C32(0x1e4e0000), SPH_C32(0xdecf0000), SPH_C32(0x6df80180), - SPH_C32(0x77240000), SPH_C32(0xec47079e), SPH_C32(0xf4a0694e), - SPH_C32(0xcda31812), SPH_C32(0x98aa496e), SPH_C32(0xb2060000), - SPH_C32(0xc5690000), SPH_C32(0x28031200), SPH_C32(0x74670000), - SPH_C32(0xb6c236f4), SPH_C32(0xeb1239f8), SPH_C32(0x33d1dfec), - SPH_C32(0x094e3198) }, - { SPH_C32(0xb2060000), SPH_C32(0xc5690000), SPH_C32(0x28031200), - SPH_C32(0x74670000), SPH_C32(0xb6c236f4), SPH_C32(0xeb1239f8), - SPH_C32(0x33d1dfec), SPH_C32(0x094e3198), SPH_C32(0xac480000), - SPH_C32(0x1ba60000), SPH_C32(0x45fb1380), SPH_C32(0x03430000), - SPH_C32(0x5a85316a), SPH_C32(0x1fb250b6), SPH_C32(0xfe72c7fe), - SPH_C32(0x91e478f6) }, - { SPH_C32(0xaec30000), SPH_C32(0x9c4f0001), SPH_C32(0x79d1e000), - SPH_C32(0x2c150000), SPH_C32(0x45cc75b3), SPH_C32(0x6650b736), - SPH_C32(0xab92f78f), SPH_C32(0xa312567b), SPH_C32(0xdb250000), - SPH_C32(0x09290000), SPH_C32(0x49aac000), SPH_C32(0x81e10000), - SPH_C32(0xcafe6b59), SPH_C32(0x42793431), SPH_C32(0x43566b76), - SPH_C32(0xe86cba2e) }, - { SPH_C32(0x028b0000), SPH_C32(0x87e90001), SPH_C32(0x3c2af380), - SPH_C32(0x2f560000), SPH_C32(0x1f4944d9), SPH_C32(0x79e2e780), - SPH_C32(0x55e03071), SPH_C32(0x32f62e8d), SPH_C32(0xc56b0000), - SPH_C32(0xd7e60000), SPH_C32(0x2452c180), SPH_C32(0xf6c50000), - SPH_C32(0x26b96cc7), SPH_C32(0xb6d95d7f), SPH_C32(0x8ef57364), - SPH_C32(0x70c6f340) }, - { SPH_C32(0xb08d0000), SPH_C32(0x42800001), SPH_C32(0x1429e180), - SPH_C32(0x5b310000), SPH_C32(0xa98b722d), SPH_C32(0x92f0de78), - SPH_C32(0x6631ef9d), SPH_C32(0x3bb81f15), SPH_C32(0x69230000), - SPH_C32(0xcc400000), SPH_C32(0x61a9d200), SPH_C32(0xf5860000), - SPH_C32(0x7c3c5dad), SPH_C32(0xa96b0dc9), SPH_C32(0x7087b49a), - SPH_C32(0xe1228bb6) }, - { SPH_C32(0x1cc50000), SPH_C32(0x59260001), SPH_C32(0x51d2f200), - SPH_C32(0x58720000), SPH_C32(0xf30e4347), SPH_C32(0x8d428ece), - SPH_C32(0x98432863), SPH_C32(0xaa5c67e3), SPH_C32(0x776d0000), - SPH_C32(0x128f0000), SPH_C32(0x0c51d380), SPH_C32(0x82a20000), - SPH_C32(0x907b5a33), SPH_C32(0x5dcb6487), SPH_C32(0xbd24ac88), - SPH_C32(0x7988c2d8) } -}; - -static const sph_u32 T512_36[8][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x819e0000), SPH_C32(0xec570000), SPH_C32(0x66320280), - SPH_C32(0x95f30000), SPH_C32(0x5da92802), SPH_C32(0x48f43cbc), - SPH_C32(0xe65aa22d), SPH_C32(0x8e67b7fa), SPH_C32(0x4d8a0000), - SPH_C32(0x49340000), SPH_C32(0x3c8b0500), SPH_C32(0xaea30000), - SPH_C32(0x16793bfd), SPH_C32(0xcf6f08a4), SPH_C32(0x8f19eaec), - SPH_C32(0x443d3004) }, - { SPH_C32(0x78230000), SPH_C32(0x12fc0000), SPH_C32(0xa93a0b80), - SPH_C32(0x90a50000), SPH_C32(0x713e2879), SPH_C32(0x7ee98924), - SPH_C32(0xf08ca062), SPH_C32(0x636f8bab), SPH_C32(0x02af0000), - SPH_C32(0xb7280000), SPH_C32(0xba1c0300), SPH_C32(0x56980000), - SPH_C32(0xba8d45d3), SPH_C32(0x8048c667), SPH_C32(0xa95c149a), - SPH_C32(0xf4f6ea7b) }, - { SPH_C32(0xf9bd0000), SPH_C32(0xfeab0000), SPH_C32(0xcf080900), - SPH_C32(0x05560000), SPH_C32(0x2c97007b), SPH_C32(0x361db598), - SPH_C32(0x16d6024f), SPH_C32(0xed083c51), SPH_C32(0x4f250000), - SPH_C32(0xfe1c0000), SPH_C32(0x86970600), SPH_C32(0xf83b0000), - SPH_C32(0xacf47e2e), SPH_C32(0x4f27cec3), SPH_C32(0x2645fe76), - SPH_C32(0xb0cbda7f) }, - { SPH_C32(0x02af0000), SPH_C32(0xb7280000), SPH_C32(0xba1c0300), - SPH_C32(0x56980000), SPH_C32(0xba8d45d3), SPH_C32(0x8048c667), - SPH_C32(0xa95c149a), SPH_C32(0xf4f6ea7b), SPH_C32(0x7a8c0000), - SPH_C32(0xa5d40000), SPH_C32(0x13260880), SPH_C32(0xc63d0000), - SPH_C32(0xcbb36daa), SPH_C32(0xfea14f43), SPH_C32(0x59d0b4f8), - SPH_C32(0x979961d0) }, - { SPH_C32(0x83310000), SPH_C32(0x5b7f0000), SPH_C32(0xdc2e0180), - SPH_C32(0xc36b0000), SPH_C32(0xe7246dd1), SPH_C32(0xc8bcfadb), - SPH_C32(0x4f06b6b7), SPH_C32(0x7a915d81), SPH_C32(0x37060000), - SPH_C32(0xece00000), SPH_C32(0x2fad0d80), SPH_C32(0x689e0000), - SPH_C32(0xddca5657), SPH_C32(0x31ce47e7), SPH_C32(0xd6c95e14), - SPH_C32(0xd3a451d4) }, - { SPH_C32(0x7a8c0000), SPH_C32(0xa5d40000), SPH_C32(0x13260880), - SPH_C32(0xc63d0000), SPH_C32(0xcbb36daa), SPH_C32(0xfea14f43), - SPH_C32(0x59d0b4f8), SPH_C32(0x979961d0), SPH_C32(0x78230000), - SPH_C32(0x12fc0000), SPH_C32(0xa93a0b80), SPH_C32(0x90a50000), - SPH_C32(0x713e2879), SPH_C32(0x7ee98924), SPH_C32(0xf08ca062), - SPH_C32(0x636f8bab) }, - { SPH_C32(0xfb120000), SPH_C32(0x49830000), SPH_C32(0x75140a00), - SPH_C32(0x53ce0000), SPH_C32(0x961a45a8), SPH_C32(0xb65573ff), - SPH_C32(0xbf8a16d5), SPH_C32(0x19fed62a), SPH_C32(0x35a90000), - SPH_C32(0x5bc80000), SPH_C32(0x95b10e80), SPH_C32(0x3e060000), - SPH_C32(0x67471384), SPH_C32(0xb1868180), SPH_C32(0x7f954a8e), - SPH_C32(0x2752bbaf) } -}; - -static const sph_u32 T512_39[8][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x52500000), SPH_C32(0x29540000), SPH_C32(0x6a61004e), - SPH_C32(0xf0ff0000), SPH_C32(0x9a317eec), SPH_C32(0x452341ce), - SPH_C32(0xcf568fe5), SPH_C32(0x5303130f), SPH_C32(0x538d0000), - SPH_C32(0xa9fc0000), SPH_C32(0x9ef70006), SPH_C32(0x56ff0000), - SPH_C32(0x0ae4004e), SPH_C32(0x92c5cdf9), SPH_C32(0xa9444018), - SPH_C32(0x7f975691) }, - { SPH_C32(0x538d0000), SPH_C32(0xa9fc0000), SPH_C32(0x9ef70006), - SPH_C32(0x56ff0000), SPH_C32(0x0ae4004e), SPH_C32(0x92c5cdf9), - SPH_C32(0xa9444018), SPH_C32(0x7f975691), SPH_C32(0x01dd0000), - SPH_C32(0x80a80000), SPH_C32(0xf4960048), SPH_C32(0xa6000000), - SPH_C32(0x90d57ea2), SPH_C32(0xd7e68c37), SPH_C32(0x6612cffd), - SPH_C32(0x2c94459e) }, - { SPH_C32(0x01dd0000), SPH_C32(0x80a80000), SPH_C32(0xf4960048), - SPH_C32(0xa6000000), SPH_C32(0x90d57ea2), SPH_C32(0xd7e68c37), - SPH_C32(0x6612cffd), SPH_C32(0x2c94459e), SPH_C32(0x52500000), - SPH_C32(0x29540000), SPH_C32(0x6a61004e), SPH_C32(0xf0ff0000), - SPH_C32(0x9a317eec), SPH_C32(0x452341ce), SPH_C32(0xcf568fe5), - SPH_C32(0x5303130f) }, - { SPH_C32(0xcc140000), SPH_C32(0xa5630000), SPH_C32(0x5ab90780), - SPH_C32(0x3b500000), SPH_C32(0x4bd013ff), SPH_C32(0x879b3418), - SPH_C32(0x694348c1), SPH_C32(0xca5a87fe), SPH_C32(0x819e0000), - SPH_C32(0xec570000), SPH_C32(0x66320280), SPH_C32(0x95f30000), - SPH_C32(0x5da92802), SPH_C32(0x48f43cbc), SPH_C32(0xe65aa22d), - SPH_C32(0x8e67b7fa) }, - { SPH_C32(0x9e440000), SPH_C32(0x8c370000), SPH_C32(0x30d807ce), - SPH_C32(0xcbaf0000), SPH_C32(0xd1e16d13), SPH_C32(0xc2b875d6), - SPH_C32(0xa615c724), SPH_C32(0x995994f1), SPH_C32(0xd2130000), - SPH_C32(0x45ab0000), SPH_C32(0xf8c50286), SPH_C32(0xc30c0000), - SPH_C32(0x574d284c), SPH_C32(0xda31f145), SPH_C32(0x4f1ee235), - SPH_C32(0xf1f0e16b) }, - { SPH_C32(0x9f990000), SPH_C32(0x0c9f0000), SPH_C32(0xc44e0786), - SPH_C32(0x6daf0000), SPH_C32(0x413413b1), SPH_C32(0x155ef9e1), - SPH_C32(0xc00708d9), SPH_C32(0xb5cdd16f), SPH_C32(0x80430000), - SPH_C32(0x6cff0000), SPH_C32(0x92a402c8), SPH_C32(0x33f30000), - SPH_C32(0xcd7c56a0), SPH_C32(0x9f12b08b), SPH_C32(0x80486dd0), - SPH_C32(0xa2f3f264) }, - { SPH_C32(0xcdc90000), SPH_C32(0x25cb0000), SPH_C32(0xae2f07c8), - SPH_C32(0x9d500000), SPH_C32(0xdb056d5d), SPH_C32(0x507db82f), - SPH_C32(0x0f51873c), SPH_C32(0xe6cec260), SPH_C32(0xd3ce0000), - SPH_C32(0xc5030000), SPH_C32(0x0c5302ce), SPH_C32(0x650c0000), - SPH_C32(0xc79856ee), SPH_C32(0x0dd77d72), SPH_C32(0x290c2dc8), - SPH_C32(0xdd64a4f5) } -}; - -static const sph_u32 T512_42[8][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x07ed0000), SPH_C32(0xb2500000), SPH_C32(0x8774000a), - SPH_C32(0x970d0000), SPH_C32(0x437223ae), SPH_C32(0x48c76ea4), - SPH_C32(0xf4786222), SPH_C32(0x9075b1ce), SPH_C32(0xa2d60000), - SPH_C32(0xa6760000), SPH_C32(0xc9440014), SPH_C32(0xeba30000), - SPH_C32(0xccec2e7b), SPH_C32(0x3018c499), SPH_C32(0x03490afa), - SPH_C32(0x9b6ef888) }, - { SPH_C32(0x88980000), SPH_C32(0x1f940000), SPH_C32(0x7fcf002e), - SPH_C32(0xfb4e0000), SPH_C32(0xf158079a), SPH_C32(0x61ae9167), - SPH_C32(0xa895706c), SPH_C32(0xe6107494), SPH_C32(0x0bc20000), - SPH_C32(0xdb630000), SPH_C32(0x7e88000c), SPH_C32(0x15860000), - SPH_C32(0x91fd48f3), SPH_C32(0x7581bb43), SPH_C32(0xf460449e), - SPH_C32(0xd8b61463) }, - { SPH_C32(0x8f750000), SPH_C32(0xadc40000), SPH_C32(0xf8bb0024), - SPH_C32(0x6c430000), SPH_C32(0xb22a2434), SPH_C32(0x2969ffc3), - SPH_C32(0x5ced124e), SPH_C32(0x7665c55a), SPH_C32(0xa9140000), - SPH_C32(0x7d150000), SPH_C32(0xb7cc0018), SPH_C32(0xfe250000), - SPH_C32(0x5d116688), SPH_C32(0x45997fda), SPH_C32(0xf7294e64), - SPH_C32(0x43d8eceb) }, - { SPH_C32(0x0bc20000), SPH_C32(0xdb630000), SPH_C32(0x7e88000c), - SPH_C32(0x15860000), SPH_C32(0x91fd48f3), SPH_C32(0x7581bb43), - SPH_C32(0xf460449e), SPH_C32(0xd8b61463), SPH_C32(0x835a0000), - SPH_C32(0xc4f70000), SPH_C32(0x01470022), SPH_C32(0xeec80000), - SPH_C32(0x60a54f69), SPH_C32(0x142f2a24), SPH_C32(0x5cf534f2), - SPH_C32(0x3ea660f7) }, - { SPH_C32(0x0c2f0000), SPH_C32(0x69330000), SPH_C32(0xf9fc0006), - SPH_C32(0x828b0000), SPH_C32(0xd28f6b5d), SPH_C32(0x3d46d5e7), - SPH_C32(0x001826bc), SPH_C32(0x48c3a5ad), SPH_C32(0x218c0000), - SPH_C32(0x62810000), SPH_C32(0xc8030036), SPH_C32(0x056b0000), - SPH_C32(0xac496112), SPH_C32(0x2437eebd), SPH_C32(0x5fbc3e08), - SPH_C32(0xa5c8987f) }, - { SPH_C32(0x835a0000), SPH_C32(0xc4f70000), SPH_C32(0x01470022), - SPH_C32(0xeec80000), SPH_C32(0x60a54f69), SPH_C32(0x142f2a24), - SPH_C32(0x5cf534f2), SPH_C32(0x3ea660f7), SPH_C32(0x88980000), - SPH_C32(0x1f940000), SPH_C32(0x7fcf002e), SPH_C32(0xfb4e0000), - SPH_C32(0xf158079a), SPH_C32(0x61ae9167), SPH_C32(0xa895706c), - SPH_C32(0xe6107494) }, - { SPH_C32(0x84b70000), SPH_C32(0x76a70000), SPH_C32(0x86330028), - SPH_C32(0x79c50000), SPH_C32(0x23d76cc7), SPH_C32(0x5ce84480), - SPH_C32(0xa88d56d0), SPH_C32(0xaed3d139), SPH_C32(0x2a4e0000), - SPH_C32(0xb9e20000), SPH_C32(0xb68b003a), SPH_C32(0x10ed0000), - SPH_C32(0x3db429e1), SPH_C32(0x51b655fe), SPH_C32(0xabdc7a96), - SPH_C32(0x7d7e8c1c) } -}; - -static const sph_u32 T512_45[8][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x58430000), SPH_C32(0x807e0000), SPH_C32(0x78330001), - SPH_C32(0xc66b3800), SPH_C32(0xe7375cdc), SPH_C32(0x79ad3fdd), - SPH_C32(0xac73fe6f), SPH_C32(0x3a4479b1), SPH_C32(0x1d5a0000), - SPH_C32(0x2b720000), SPH_C32(0x488d0000), SPH_C32(0xaf611800), - SPH_C32(0x25cb2ec5), SPH_C32(0xc879bfd0), SPH_C32(0x81a20429), - SPH_C32(0x1e7536a6) }, - { SPH_C32(0x1d5a0000), SPH_C32(0x2b720000), SPH_C32(0x488d0000), - SPH_C32(0xaf611800), SPH_C32(0x25cb2ec5), SPH_C32(0xc879bfd0), - SPH_C32(0x81a20429), SPH_C32(0x1e7536a6), SPH_C32(0x45190000), - SPH_C32(0xab0c0000), SPH_C32(0x30be0001), SPH_C32(0x690a2000), - SPH_C32(0xc2fc7219), SPH_C32(0xb1d4800d), SPH_C32(0x2dd1fa46), - SPH_C32(0x24314f17) }, - { SPH_C32(0x45190000), SPH_C32(0xab0c0000), SPH_C32(0x30be0001), - SPH_C32(0x690a2000), SPH_C32(0xc2fc7219), SPH_C32(0xb1d4800d), - SPH_C32(0x2dd1fa46), SPH_C32(0x24314f17), SPH_C32(0x58430000), - SPH_C32(0x807e0000), SPH_C32(0x78330001), SPH_C32(0xc66b3800), - SPH_C32(0xe7375cdc), SPH_C32(0x79ad3fdd), SPH_C32(0xac73fe6f), - SPH_C32(0x3a4479b1) }, - { SPH_C32(0xa53b0000), SPH_C32(0x14260000), SPH_C32(0x4e30001e), - SPH_C32(0x7cae0000), SPH_C32(0x8f9e0dd5), SPH_C32(0x78dfaa3d), - SPH_C32(0xf73168d8), SPH_C32(0x0b1b4946), SPH_C32(0x07ed0000), - SPH_C32(0xb2500000), SPH_C32(0x8774000a), SPH_C32(0x970d0000), - SPH_C32(0x437223ae), SPH_C32(0x48c76ea4), SPH_C32(0xf4786222), - SPH_C32(0x9075b1ce) }, - { SPH_C32(0xfd780000), SPH_C32(0x94580000), SPH_C32(0x3603001f), - SPH_C32(0xbac53800), SPH_C32(0x68a95109), SPH_C32(0x017295e0), - SPH_C32(0x5b4296b7), SPH_C32(0x315f30f7), SPH_C32(0x1ab70000), - SPH_C32(0x99220000), SPH_C32(0xcff9000a), SPH_C32(0x386c1800), - SPH_C32(0x66b90d6b), SPH_C32(0x80bed174), SPH_C32(0x75da660b), - SPH_C32(0x8e008768) }, - { SPH_C32(0xb8610000), SPH_C32(0x3f540000), SPH_C32(0x06bd001e), - SPH_C32(0xd3cf1800), SPH_C32(0xaa552310), SPH_C32(0xb0a615ed), - SPH_C32(0x76936cf1), SPH_C32(0x156e7fe0), SPH_C32(0x42f40000), - SPH_C32(0x195c0000), SPH_C32(0xb7ca000b), SPH_C32(0xfe072000), - SPH_C32(0x818e51b7), SPH_C32(0xf913eea9), SPH_C32(0xd9a99864), - SPH_C32(0xb444fed9) }, - { SPH_C32(0xe0220000), SPH_C32(0xbf2a0000), SPH_C32(0x7e8e001f), - SPH_C32(0x15a42000), SPH_C32(0x4d627fcc), SPH_C32(0xc90b2a30), - SPH_C32(0xdae0929e), SPH_C32(0x2f2a0651), SPH_C32(0x5fae0000), - SPH_C32(0x322e0000), SPH_C32(0xff47000b), SPH_C32(0x51663800), - SPH_C32(0xa4457f72), SPH_C32(0x316a5179), SPH_C32(0x580b9c4d), - SPH_C32(0xaa31c87f) } -}; - -static const sph_u32 T512_48[8][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xbadd0000), SPH_C32(0x13ad0000), SPH_C32(0xb7e70000), - SPH_C32(0xf7282800), SPH_C32(0xdf45144d), SPH_C32(0x361ac33a), - SPH_C32(0xea5a8d14), SPH_C32(0x2a2c18f0), SPH_C32(0xb82f0000), - SPH_C32(0xb12c0000), SPH_C32(0x30d80000), SPH_C32(0x14445000), - SPH_C32(0xc15860a2), SPH_C32(0x3127e8ec), SPH_C32(0x2e98bf23), - SPH_C32(0x551e3d6e) }, - { SPH_C32(0x1e6c0000), SPH_C32(0xc4420000), SPH_C32(0x8a2e0000), - SPH_C32(0xbcb6b800), SPH_C32(0x2c4413b6), SPH_C32(0x8bfdd3da), - SPH_C32(0x6a0c1bc8), SPH_C32(0xb99dc2eb), SPH_C32(0x92560000), - SPH_C32(0x1eda0000), SPH_C32(0xea510000), SPH_C32(0xe8b13000), - SPH_C32(0xa93556a5), SPH_C32(0xebfb6199), SPH_C32(0xb15c2254), - SPH_C32(0x33c5244f) }, - { SPH_C32(0xa4b10000), SPH_C32(0xd7ef0000), SPH_C32(0x3dc90000), - SPH_C32(0x4b9e9000), SPH_C32(0xf30107fb), SPH_C32(0xbde710e0), - SPH_C32(0x805696dc), SPH_C32(0x93b1da1b), SPH_C32(0x2a790000), - SPH_C32(0xaff60000), SPH_C32(0xda890000), SPH_C32(0xfcf56000), - SPH_C32(0x686d3607), SPH_C32(0xdadc8975), SPH_C32(0x9fc49d77), - SPH_C32(0x66db1921) }, - { SPH_C32(0x92560000), SPH_C32(0x1eda0000), SPH_C32(0xea510000), - SPH_C32(0xe8b13000), SPH_C32(0xa93556a5), SPH_C32(0xebfb6199), - SPH_C32(0xb15c2254), SPH_C32(0x33c5244f), SPH_C32(0x8c3a0000), - SPH_C32(0xda980000), SPH_C32(0x607f0000), SPH_C32(0x54078800), - SPH_C32(0x85714513), SPH_C32(0x6006b243), SPH_C32(0xdb50399c), - SPH_C32(0x8a58e6a4) }, - { SPH_C32(0x288b0000), SPH_C32(0x0d770000), SPH_C32(0x5db60000), - SPH_C32(0x1f991800), SPH_C32(0x767042e8), SPH_C32(0xdde1a2a3), - SPH_C32(0x5b06af40), SPH_C32(0x19e93cbf), SPH_C32(0x34150000), - SPH_C32(0x6bb40000), SPH_C32(0x50a70000), SPH_C32(0x4043d800), - SPH_C32(0x442925b1), SPH_C32(0x51215aaf), SPH_C32(0xf5c886bf), - SPH_C32(0xdf46dbca) }, - { SPH_C32(0x8c3a0000), SPH_C32(0xda980000), SPH_C32(0x607f0000), - SPH_C32(0x54078800), SPH_C32(0x85714513), SPH_C32(0x6006b243), - SPH_C32(0xdb50399c), SPH_C32(0x8a58e6a4), SPH_C32(0x1e6c0000), - SPH_C32(0xc4420000), SPH_C32(0x8a2e0000), SPH_C32(0xbcb6b800), - SPH_C32(0x2c4413b6), SPH_C32(0x8bfdd3da), SPH_C32(0x6a0c1bc8), - SPH_C32(0xb99dc2eb) }, - { SPH_C32(0x36e70000), SPH_C32(0xc9350000), SPH_C32(0xd7980000), - SPH_C32(0xa32fa000), SPH_C32(0x5a34515e), SPH_C32(0x561c7179), - SPH_C32(0x310ab488), SPH_C32(0xa074fe54), SPH_C32(0xa6430000), - SPH_C32(0x756e0000), SPH_C32(0xbaf60000), SPH_C32(0xa8f2e800), - SPH_C32(0xed1c7314), SPH_C32(0xbada3b36), SPH_C32(0x4494a4eb), - SPH_C32(0xec83ff85) } -}; - -static const sph_u32 T512_51[8][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xb4310000), SPH_C32(0x77330000), SPH_C32(0xb15d0000), - SPH_C32(0x7fd004e0), SPH_C32(0x78a26138), SPH_C32(0xd116c35d), - SPH_C32(0xd256d489), SPH_C32(0x4e6f74de), SPH_C32(0xe3060000), - SPH_C32(0xbdc10000), SPH_C32(0x87130000), SPH_C32(0xbff20060), - SPH_C32(0x2eba0a1a), SPH_C32(0x8db53751), SPH_C32(0x73c5ab06), - SPH_C32(0x5bd61539) }, - { SPH_C32(0xe3060000), SPH_C32(0xbdc10000), SPH_C32(0x87130000), - SPH_C32(0xbff20060), SPH_C32(0x2eba0a1a), SPH_C32(0x8db53751), - SPH_C32(0x73c5ab06), SPH_C32(0x5bd61539), SPH_C32(0x57370000), - SPH_C32(0xcaf20000), SPH_C32(0x364e0000), SPH_C32(0xc0220480), - SPH_C32(0x56186b22), SPH_C32(0x5ca3f40c), SPH_C32(0xa1937f8f), - SPH_C32(0x15b961e7) }, - { SPH_C32(0x57370000), SPH_C32(0xcaf20000), SPH_C32(0x364e0000), - SPH_C32(0xc0220480), SPH_C32(0x56186b22), SPH_C32(0x5ca3f40c), - SPH_C32(0xa1937f8f), SPH_C32(0x15b961e7), SPH_C32(0xb4310000), - SPH_C32(0x77330000), SPH_C32(0xb15d0000), SPH_C32(0x7fd004e0), - SPH_C32(0x78a26138), SPH_C32(0xd116c35d), SPH_C32(0xd256d489), - SPH_C32(0x4e6f74de) }, - { SPH_C32(0x02f20000), SPH_C32(0xa2810000), SPH_C32(0x873f0000), - SPH_C32(0xe36c7800), SPH_C32(0x1e1d74ef), SPH_C32(0x073d2bd6), - SPH_C32(0xc4c23237), SPH_C32(0x7f32259e), SPH_C32(0xbadd0000), - SPH_C32(0x13ad0000), SPH_C32(0xb7e70000), SPH_C32(0xf7282800), - SPH_C32(0xdf45144d), SPH_C32(0x361ac33a), SPH_C32(0xea5a8d14), - SPH_C32(0x2a2c18f0) }, - { SPH_C32(0xb6c30000), SPH_C32(0xd5b20000), SPH_C32(0x36620000), - SPH_C32(0x9cbc7ce0), SPH_C32(0x66bf15d7), SPH_C32(0xd62be88b), - SPH_C32(0x1694e6be), SPH_C32(0x315d5140), SPH_C32(0x59db0000), - SPH_C32(0xae6c0000), SPH_C32(0x30f40000), SPH_C32(0x48da2860), - SPH_C32(0xf1ff1e57), SPH_C32(0xbbaff46b), SPH_C32(0x999f2612), - SPH_C32(0x71fa0dc9) }, - { SPH_C32(0xe1f40000), SPH_C32(0x1f400000), SPH_C32(0x002c0000), - SPH_C32(0x5c9e7860), SPH_C32(0x30a77ef5), SPH_C32(0x8a881c87), - SPH_C32(0xb7079931), SPH_C32(0x24e430a7), SPH_C32(0xedea0000), - SPH_C32(0xd95f0000), SPH_C32(0x81a90000), SPH_C32(0x370a2c80), - SPH_C32(0x895d7f6f), SPH_C32(0x6ab93736), SPH_C32(0x4bc9f29b), - SPH_C32(0x3f957917) }, - { SPH_C32(0x55c50000), SPH_C32(0x68730000), SPH_C32(0xb1710000), - SPH_C32(0x234e7c80), SPH_C32(0x48051fcd), SPH_C32(0x5b9edfda), - SPH_C32(0x65514db8), SPH_C32(0x6a8b4479), SPH_C32(0x0eec0000), - SPH_C32(0x649e0000), SPH_C32(0x06ba0000), SPH_C32(0x88f82ce0), - SPH_C32(0xa7e77575), SPH_C32(0xe70c0067), SPH_C32(0x380c599d), - SPH_C32(0x64436c2e) } -}; - -static const sph_u32 T512_54[8][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x7b280000), SPH_C32(0x57420000), SPH_C32(0xa9e50000), - SPH_C32(0x634300a0), SPH_C32(0x9edb442f), SPH_C32(0x6d9995bb), - SPH_C32(0x27f83b03), SPH_C32(0xc7ff60f0), SPH_C32(0x95bb0000), - SPH_C32(0x81450000), SPH_C32(0x3b240000), SPH_C32(0x48db0140), - SPH_C32(0x0a8a6c53), SPH_C32(0x56f56eec), SPH_C32(0x62c91877), - SPH_C32(0xe7e00a94) }, - { SPH_C32(0xe6280000), SPH_C32(0x4c4b0000), SPH_C32(0xa8550000), - SPH_C32(0xd3d002e0), SPH_C32(0xd86130b8), SPH_C32(0x98a7b0da), - SPH_C32(0x289506b4), SPH_C32(0xd75a4897), SPH_C32(0xf0c50000), - SPH_C32(0x59230000), SPH_C32(0x45820000), SPH_C32(0xe18d00c0), - SPH_C32(0x3b6d0631), SPH_C32(0xc2ed5699), SPH_C32(0xcbe0fe1c), - SPH_C32(0x56a7b19f) }, - { SPH_C32(0x9d000000), SPH_C32(0x1b090000), SPH_C32(0x01b00000), - SPH_C32(0xb0930240), SPH_C32(0x46ba7497), SPH_C32(0xf53e2561), - SPH_C32(0x0f6d3db7), SPH_C32(0x10a52867), SPH_C32(0x657e0000), - SPH_C32(0xd8660000), SPH_C32(0x7ea60000), SPH_C32(0xa9560180), - SPH_C32(0x31e76a62), SPH_C32(0x94183875), SPH_C32(0xa929e66b), - SPH_C32(0xb147bb0b) }, - { SPH_C32(0xf0c50000), SPH_C32(0x59230000), SPH_C32(0x45820000), - SPH_C32(0xe18d00c0), SPH_C32(0x3b6d0631), SPH_C32(0xc2ed5699), - SPH_C32(0xcbe0fe1c), SPH_C32(0x56a7b19f), SPH_C32(0x16ed0000), - SPH_C32(0x15680000), SPH_C32(0xedd70000), SPH_C32(0x325d0220), - SPH_C32(0xe30c3689), SPH_C32(0x5a4ae643), SPH_C32(0xe375f8a8), - SPH_C32(0x81fdf908) }, - { SPH_C32(0x8bed0000), SPH_C32(0x0e610000), SPH_C32(0xec670000), - SPH_C32(0x82ce0060), SPH_C32(0xa5b6421e), SPH_C32(0xaf74c322), - SPH_C32(0xec18c51f), SPH_C32(0x9158d16f), SPH_C32(0x83560000), - SPH_C32(0x942d0000), SPH_C32(0xd6f30000), SPH_C32(0x7a860360), - SPH_C32(0xe9865ada), SPH_C32(0x0cbf88af), SPH_C32(0x81bce0df), - SPH_C32(0x661df39c) }, - { SPH_C32(0x16ed0000), SPH_C32(0x15680000), SPH_C32(0xedd70000), - SPH_C32(0x325d0220), SPH_C32(0xe30c3689), SPH_C32(0x5a4ae643), - SPH_C32(0xe375f8a8), SPH_C32(0x81fdf908), SPH_C32(0xe6280000), - SPH_C32(0x4c4b0000), SPH_C32(0xa8550000), SPH_C32(0xd3d002e0), - SPH_C32(0xd86130b8), SPH_C32(0x98a7b0da), SPH_C32(0x289506b4), - SPH_C32(0xd75a4897) }, - { SPH_C32(0x6dc50000), SPH_C32(0x422a0000), SPH_C32(0x44320000), - SPH_C32(0x511e0280), SPH_C32(0x7dd772a6), SPH_C32(0x37d373f8), - SPH_C32(0xc48dc3ab), SPH_C32(0x460299f8), SPH_C32(0x73930000), - SPH_C32(0xcd0e0000), SPH_C32(0x93710000), SPH_C32(0x9b0b03a0), - SPH_C32(0xd2eb5ceb), SPH_C32(0xce52de36), SPH_C32(0x4a5c1ec3), - SPH_C32(0x30ba4203) } -}; - -static const sph_u32 T512_57[8][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x5fa80000), SPH_C32(0x56030000), SPH_C32(0x43ae0000), - SPH_C32(0x64f30013), SPH_C32(0x257e86bf), SPH_C32(0x1311944e), - SPH_C32(0x541e95bf), SPH_C32(0x8ea4db69), SPH_C32(0x00440000), - SPH_C32(0x7f480000), SPH_C32(0xda7c0000), SPH_C32(0x2a230001), - SPH_C32(0x3badc9cc), SPH_C32(0xa9b69c87), SPH_C32(0x030a9e60), - SPH_C32(0xbe0a679e) }, - { SPH_C32(0x00440000), SPH_C32(0x7f480000), SPH_C32(0xda7c0000), - SPH_C32(0x2a230001), SPH_C32(0x3badc9cc), SPH_C32(0xa9b69c87), - SPH_C32(0x030a9e60), SPH_C32(0xbe0a679e), SPH_C32(0x5fec0000), - SPH_C32(0x294b0000), SPH_C32(0x99d20000), SPH_C32(0x4ed00012), - SPH_C32(0x1ed34f73), SPH_C32(0xbaa708c9), SPH_C32(0x57140bdf), - SPH_C32(0x30aebcf7) }, - { SPH_C32(0x5fec0000), SPH_C32(0x294b0000), SPH_C32(0x99d20000), - SPH_C32(0x4ed00012), SPH_C32(0x1ed34f73), SPH_C32(0xbaa708c9), - SPH_C32(0x57140bdf), SPH_C32(0x30aebcf7), SPH_C32(0x5fa80000), - SPH_C32(0x56030000), SPH_C32(0x43ae0000), SPH_C32(0x64f30013), - SPH_C32(0x257e86bf), SPH_C32(0x1311944e), SPH_C32(0x541e95bf), - SPH_C32(0x8ea4db69) }, - { SPH_C32(0xee930000), SPH_C32(0xd6070000), SPH_C32(0x92c10000), - SPH_C32(0x2b9801e0), SPH_C32(0x9451287c), SPH_C32(0x3b6cfb57), - SPH_C32(0x45312374), SPH_C32(0x201f6a64), SPH_C32(0x7b280000), - SPH_C32(0x57420000), SPH_C32(0xa9e50000), SPH_C32(0x634300a0), - SPH_C32(0x9edb442f), SPH_C32(0x6d9995bb), SPH_C32(0x27f83b03), - SPH_C32(0xc7ff60f0) }, - { SPH_C32(0xb13b0000), SPH_C32(0x80040000), SPH_C32(0xd16f0000), - SPH_C32(0x4f6b01f3), SPH_C32(0xb12faec3), SPH_C32(0x287d6f19), - SPH_C32(0x112fb6cb), SPH_C32(0xaebbb10d), SPH_C32(0x7b6c0000), - SPH_C32(0x280a0000), SPH_C32(0x73990000), SPH_C32(0x496000a1), - SPH_C32(0xa5768de3), SPH_C32(0xc42f093c), SPH_C32(0x24f2a563), - SPH_C32(0x79f5076e) }, - { SPH_C32(0xeed70000), SPH_C32(0xa94f0000), SPH_C32(0x48bd0000), - SPH_C32(0x01bb01e1), SPH_C32(0xaffce1b0), SPH_C32(0x92da67d0), - SPH_C32(0x463bbd14), SPH_C32(0x9e150dfa), SPH_C32(0x24c40000), - SPH_C32(0x7e090000), SPH_C32(0x30370000), SPH_C32(0x2d9300b2), - SPH_C32(0x80080b5c), SPH_C32(0xd73e9d72), SPH_C32(0x70ec30dc), - SPH_C32(0xf751dc07) }, - { SPH_C32(0xb17f0000), SPH_C32(0xff4c0000), SPH_C32(0x0b130000), - SPH_C32(0x654801f2), SPH_C32(0x8a82670f), SPH_C32(0x81cbf39e), - SPH_C32(0x122528ab), SPH_C32(0x10b1d693), SPH_C32(0x24800000), - SPH_C32(0x01410000), SPH_C32(0xea4b0000), SPH_C32(0x07b000b3), - SPH_C32(0xbba5c290), SPH_C32(0x7e8801f5), SPH_C32(0x73e6aebc), - SPH_C32(0x495bbb99) } -}; - -static const sph_u32 T512_60[8][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xa8da0000), SPH_C32(0x96be0000), SPH_C32(0x5c1d0000), - SPH_C32(0x07da0002), SPH_C32(0x7d669583), SPH_C32(0x1f98708a), - SPH_C32(0xbb668808), SPH_C32(0xda878000), SPH_C32(0xabe70000), - SPH_C32(0x9e0d0000), SPH_C32(0xaf270000), SPH_C32(0x3d180005), - SPH_C32(0x2c4f1fd3), SPH_C32(0x74f61695), SPH_C32(0xb5c347eb), - SPH_C32(0x3c5dfffe) }, - { SPH_C32(0x01930000), SPH_C32(0xe7820000), SPH_C32(0xedfb0000), - SPH_C32(0xcf0c000b), SPH_C32(0x8dd08d58), SPH_C32(0xbca3b42e), - SPH_C32(0x063661e1), SPH_C32(0x536f9e7b), SPH_C32(0x92280000), - SPH_C32(0xdc850000), SPH_C32(0x57fa0000), SPH_C32(0x56dc0003), - SPH_C32(0xbae92316), SPH_C32(0x5aefa30c), SPH_C32(0x90cef752), - SPH_C32(0x7b1675d7) }, - { SPH_C32(0xa9490000), SPH_C32(0x713c0000), SPH_C32(0xb1e60000), - SPH_C32(0xc8d60009), SPH_C32(0xf0b618db), SPH_C32(0xa33bc4a4), - SPH_C32(0xbd50e9e9), SPH_C32(0x89e81e7b), SPH_C32(0x39cf0000), - SPH_C32(0x42880000), SPH_C32(0xf8dd0000), SPH_C32(0x6bc40006), - SPH_C32(0x96a63cc5), SPH_C32(0x2e19b599), SPH_C32(0x250db0b9), - SPH_C32(0x474b8a29) }, - { SPH_C32(0x92280000), SPH_C32(0xdc850000), SPH_C32(0x57fa0000), - SPH_C32(0x56dc0003), SPH_C32(0xbae92316), SPH_C32(0x5aefa30c), - SPH_C32(0x90cef752), SPH_C32(0x7b1675d7), SPH_C32(0x93bb0000), - SPH_C32(0x3b070000), SPH_C32(0xba010000), SPH_C32(0x99d00008), - SPH_C32(0x3739ae4e), SPH_C32(0xe64c1722), SPH_C32(0x96f896b3), - SPH_C32(0x2879ebac) }, - { SPH_C32(0x3af20000), SPH_C32(0x4a3b0000), SPH_C32(0x0be70000), - SPH_C32(0x51060001), SPH_C32(0xc78fb695), SPH_C32(0x4577d386), - SPH_C32(0x2ba87f5a), SPH_C32(0xa191f5d7), SPH_C32(0x385c0000), - SPH_C32(0xa50a0000), SPH_C32(0x15260000), SPH_C32(0xa4c8000d), - SPH_C32(0x1b76b19d), SPH_C32(0x92ba01b7), SPH_C32(0x233bd158), - SPH_C32(0x14241452) }, - { SPH_C32(0x93bb0000), SPH_C32(0x3b070000), SPH_C32(0xba010000), - SPH_C32(0x99d00008), SPH_C32(0x3739ae4e), SPH_C32(0xe64c1722), - SPH_C32(0x96f896b3), SPH_C32(0x2879ebac), SPH_C32(0x01930000), - SPH_C32(0xe7820000), SPH_C32(0xedfb0000), SPH_C32(0xcf0c000b), - SPH_C32(0x8dd08d58), SPH_C32(0xbca3b42e), SPH_C32(0x063661e1), - SPH_C32(0x536f9e7b) }, - { SPH_C32(0x3b610000), SPH_C32(0xadb90000), SPH_C32(0xe61c0000), - SPH_C32(0x9e0a000a), SPH_C32(0x4a5f3bcd), SPH_C32(0xf9d467a8), - SPH_C32(0x2d9e1ebb), SPH_C32(0xf2fe6bac), SPH_C32(0xaa740000), - SPH_C32(0x798f0000), SPH_C32(0x42dc0000), SPH_C32(0xf214000e), - SPH_C32(0xa19f928b), SPH_C32(0xc855a2bb), SPH_C32(0xb3f5260a), - SPH_C32(0x6f326185) } -}; - -static const sph_u32 T512_63[2][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x033d0000), SPH_C32(0x08b30000), SPH_C32(0xf33a0000), - SPH_C32(0x3ac20007), SPH_C32(0x51298a50), SPH_C32(0x6b6e661f), - SPH_C32(0x0ea5cfe3), SPH_C32(0xe6da7ffe), SPH_C32(0xa8da0000), - SPH_C32(0x96be0000), SPH_C32(0x5c1d0000), SPH_C32(0x07da0002), - SPH_C32(0x7d669583), SPH_C32(0x1f98708a), SPH_C32(0xbb668808), - SPH_C32(0xda878000) } -}; - -#define INPUT_BIG do { \ - unsigned acc = buf[0]; \ - const sph_u32 *rp; \ - rp = &T512_0[acc >> 5][0]; \ - m0 = rp[0]; \ - m1 = rp[1]; \ - m2 = rp[2]; \ - m3 = rp[3]; \ - m4 = rp[4]; \ - m5 = rp[5]; \ - m6 = rp[6]; \ - m7 = rp[7]; \ - m8 = rp[8]; \ - m9 = rp[9]; \ - mA = rp[10]; \ - mB = rp[11]; \ - mC = rp[12]; \ - mD = rp[13]; \ - mE = rp[14]; \ - mF = rp[15]; \ - rp = &T512_3[(acc >> 2) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = (acc << 8) | buf[1]; \ - rp = &T512_6[(acc >> 7) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_9[(acc >> 4) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_12[(acc >> 1) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = (acc << 8) | buf[2]; \ - rp = &T512_15[(acc >> 6) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_18[(acc >> 3) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_21[acc & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[3]; \ - rp = &T512_24[acc >> 5][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_27[(acc >> 2) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = (acc << 8) | buf[4]; \ - rp = &T512_30[(acc >> 7) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_33[(acc >> 4) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_36[(acc >> 1) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = (acc << 8) | buf[5]; \ - rp = &T512_39[(acc >> 6) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_42[(acc >> 3) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_45[acc & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[6]; \ - rp = &T512_48[acc >> 5][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_51[(acc >> 2) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = (acc << 8) | buf[7]; \ - rp = &T512_54[(acc >> 7) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_57[(acc >> 4) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_60[(acc >> 1) & 0x07][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_63[acc & 0x01][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - } while (0) - -#endif - -#if SPH_HAMSI_EXPAND_BIG == 4 - -static const sph_u32 T512_0[16][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x54285c00), SPH_C32(0xeaed0000), SPH_C32(0xc5d60000), - SPH_C32(0xa1c50000), SPH_C32(0xb3a26770), SPH_C32(0x94a5c4e1), - SPH_C32(0x6bb0419d), SPH_C32(0x551b3782), SPH_C32(0x9cbb1800), - SPH_C32(0xb0d30000), SPH_C32(0x92510000), SPH_C32(0xed930000), - SPH_C32(0x593a4345), SPH_C32(0xe114d5f4), SPH_C32(0x430633da), - SPH_C32(0x78cace29) }, - { SPH_C32(0x9cbb1800), SPH_C32(0xb0d30000), SPH_C32(0x92510000), - SPH_C32(0xed930000), SPH_C32(0x593a4345), SPH_C32(0xe114d5f4), - SPH_C32(0x430633da), SPH_C32(0x78cace29), SPH_C32(0xc8934400), - SPH_C32(0x5a3e0000), SPH_C32(0x57870000), SPH_C32(0x4c560000), - SPH_C32(0xea982435), SPH_C32(0x75b11115), SPH_C32(0x28b67247), - SPH_C32(0x2dd1f9ab) }, - { SPH_C32(0xc8934400), SPH_C32(0x5a3e0000), SPH_C32(0x57870000), - SPH_C32(0x4c560000), SPH_C32(0xea982435), SPH_C32(0x75b11115), - SPH_C32(0x28b67247), SPH_C32(0x2dd1f9ab), SPH_C32(0x54285c00), - SPH_C32(0xeaed0000), SPH_C32(0xc5d60000), SPH_C32(0xa1c50000), - SPH_C32(0xb3a26770), SPH_C32(0x94a5c4e1), SPH_C32(0x6bb0419d), - SPH_C32(0x551b3782) }, - { SPH_C32(0x29449c00), SPH_C32(0x64e70000), SPH_C32(0xf24b0000), - SPH_C32(0xc2f30000), SPH_C32(0x0ede4e8f), SPH_C32(0x56c23745), - SPH_C32(0xf3e04259), SPH_C32(0x8d0d9ec4), SPH_C32(0x466d0c00), - SPH_C32(0x08620000), SPH_C32(0xdd5d0000), SPH_C32(0xbadd0000), - SPH_C32(0x6a927942), SPH_C32(0x441f2b93), SPH_C32(0x218ace6f), - SPH_C32(0xbf2c0be2) }, - { SPH_C32(0x7d6cc000), SPH_C32(0x8e0a0000), SPH_C32(0x379d0000), - SPH_C32(0x63360000), SPH_C32(0xbd7c29ff), SPH_C32(0xc267f3a4), - SPH_C32(0x985003c4), SPH_C32(0xd816a946), SPH_C32(0xdad61400), - SPH_C32(0xb8b10000), SPH_C32(0x4f0c0000), SPH_C32(0x574e0000), - SPH_C32(0x33a83a07), SPH_C32(0xa50bfe67), SPH_C32(0x628cfdb5), - SPH_C32(0xc7e6c5cb) }, - { SPH_C32(0xb5ff8400), SPH_C32(0xd4340000), SPH_C32(0x601a0000), - SPH_C32(0x2f600000), SPH_C32(0x57e40dca), SPH_C32(0xb7d6e2b1), - SPH_C32(0xb0e67183), SPH_C32(0xf5c750ed), SPH_C32(0x8efe4800), - SPH_C32(0x525c0000), SPH_C32(0x8ada0000), SPH_C32(0xf68b0000), - SPH_C32(0x800a5d77), SPH_C32(0x31ae3a86), SPH_C32(0x093cbc28), - SPH_C32(0x92fdf249) }, - { SPH_C32(0xe1d7d800), SPH_C32(0x3ed90000), SPH_C32(0xa5cc0000), - SPH_C32(0x8ea50000), SPH_C32(0xe4466aba), SPH_C32(0x23732650), - SPH_C32(0xdb56301e), SPH_C32(0xa0dc676f), SPH_C32(0x12455000), - SPH_C32(0xe28f0000), SPH_C32(0x188b0000), SPH_C32(0x1b180000), - SPH_C32(0xd9301e32), SPH_C32(0xd0baef72), SPH_C32(0x4a3a8ff2), - SPH_C32(0xea373c60) }, - { SPH_C32(0x466d0c00), SPH_C32(0x08620000), SPH_C32(0xdd5d0000), - SPH_C32(0xbadd0000), SPH_C32(0x6a927942), SPH_C32(0x441f2b93), - SPH_C32(0x218ace6f), SPH_C32(0xbf2c0be2), SPH_C32(0x6f299000), - SPH_C32(0x6c850000), SPH_C32(0x2f160000), SPH_C32(0x782e0000), - SPH_C32(0x644c37cd), SPH_C32(0x12dd1cd6), SPH_C32(0xd26a8c36), - SPH_C32(0x32219526) }, - { SPH_C32(0x12455000), SPH_C32(0xe28f0000), SPH_C32(0x188b0000), - SPH_C32(0x1b180000), SPH_C32(0xd9301e32), SPH_C32(0xd0baef72), - SPH_C32(0x4a3a8ff2), SPH_C32(0xea373c60), SPH_C32(0xf3928800), - SPH_C32(0xdc560000), SPH_C32(0xbd470000), SPH_C32(0x95bd0000), - SPH_C32(0x3d767488), SPH_C32(0xf3c9c922), SPH_C32(0x916cbfec), - SPH_C32(0x4aeb5b0f) }, - { SPH_C32(0xdad61400), SPH_C32(0xb8b10000), SPH_C32(0x4f0c0000), - SPH_C32(0x574e0000), SPH_C32(0x33a83a07), SPH_C32(0xa50bfe67), - SPH_C32(0x628cfdb5), SPH_C32(0xc7e6c5cb), SPH_C32(0xa7bad400), - SPH_C32(0x36bb0000), SPH_C32(0x78910000), SPH_C32(0x34780000), - SPH_C32(0x8ed413f8), SPH_C32(0x676c0dc3), SPH_C32(0xfadcfe71), - SPH_C32(0x1ff06c8d) }, - { SPH_C32(0x8efe4800), SPH_C32(0x525c0000), SPH_C32(0x8ada0000), - SPH_C32(0xf68b0000), SPH_C32(0x800a5d77), SPH_C32(0x31ae3a86), - SPH_C32(0x093cbc28), SPH_C32(0x92fdf249), SPH_C32(0x3b01cc00), - SPH_C32(0x86680000), SPH_C32(0xeac00000), SPH_C32(0xd9eb0000), - SPH_C32(0xd7ee50bd), SPH_C32(0x8678d837), SPH_C32(0xb9dacdab), - SPH_C32(0x673aa2a4) }, - { SPH_C32(0x6f299000), SPH_C32(0x6c850000), SPH_C32(0x2f160000), - SPH_C32(0x782e0000), SPH_C32(0x644c37cd), SPH_C32(0x12dd1cd6), - SPH_C32(0xd26a8c36), SPH_C32(0x32219526), SPH_C32(0x29449c00), - SPH_C32(0x64e70000), SPH_C32(0xf24b0000), SPH_C32(0xc2f30000), - SPH_C32(0x0ede4e8f), SPH_C32(0x56c23745), SPH_C32(0xf3e04259), - SPH_C32(0x8d0d9ec4) }, - { SPH_C32(0x3b01cc00), SPH_C32(0x86680000), SPH_C32(0xeac00000), - SPH_C32(0xd9eb0000), SPH_C32(0xd7ee50bd), SPH_C32(0x8678d837), - SPH_C32(0xb9dacdab), SPH_C32(0x673aa2a4), SPH_C32(0xb5ff8400), - SPH_C32(0xd4340000), SPH_C32(0x601a0000), SPH_C32(0x2f600000), - SPH_C32(0x57e40dca), SPH_C32(0xb7d6e2b1), SPH_C32(0xb0e67183), - SPH_C32(0xf5c750ed) }, - { SPH_C32(0xf3928800), SPH_C32(0xdc560000), SPH_C32(0xbd470000), - SPH_C32(0x95bd0000), SPH_C32(0x3d767488), SPH_C32(0xf3c9c922), - SPH_C32(0x916cbfec), SPH_C32(0x4aeb5b0f), SPH_C32(0xe1d7d800), - SPH_C32(0x3ed90000), SPH_C32(0xa5cc0000), SPH_C32(0x8ea50000), - SPH_C32(0xe4466aba), SPH_C32(0x23732650), SPH_C32(0xdb56301e), - SPH_C32(0xa0dc676f) }, - { SPH_C32(0xa7bad400), SPH_C32(0x36bb0000), SPH_C32(0x78910000), - SPH_C32(0x34780000), SPH_C32(0x8ed413f8), SPH_C32(0x676c0dc3), - SPH_C32(0xfadcfe71), SPH_C32(0x1ff06c8d), SPH_C32(0x7d6cc000), - SPH_C32(0x8e0a0000), SPH_C32(0x379d0000), SPH_C32(0x63360000), - SPH_C32(0xbd7c29ff), SPH_C32(0xc267f3a4), SPH_C32(0x985003c4), - SPH_C32(0xd816a946) } -}; - -static const sph_u32 T512_4[16][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xef0b0270), SPH_C32(0x3afd0000), SPH_C32(0x5dae0000), - SPH_C32(0x69490000), SPH_C32(0x9b0f3c06), SPH_C32(0x4405b5f9), - SPH_C32(0x66140a51), SPH_C32(0x924f5d0a), SPH_C32(0xc96b0030), - SPH_C32(0xe7250000), SPH_C32(0x2f840000), SPH_C32(0x264f0000), - SPH_C32(0x08695bf9), SPH_C32(0x6dfcf137), SPH_C32(0x509f6984), - SPH_C32(0x9e69af68) }, - { SPH_C32(0xc96b0030), SPH_C32(0xe7250000), SPH_C32(0x2f840000), - SPH_C32(0x264f0000), SPH_C32(0x08695bf9), SPH_C32(0x6dfcf137), - SPH_C32(0x509f6984), SPH_C32(0x9e69af68), SPH_C32(0x26600240), - SPH_C32(0xddd80000), SPH_C32(0x722a0000), SPH_C32(0x4f060000), - SPH_C32(0x936667ff), SPH_C32(0x29f944ce), SPH_C32(0x368b63d5), - SPH_C32(0x0c26f262) }, - { SPH_C32(0x26600240), SPH_C32(0xddd80000), SPH_C32(0x722a0000), - SPH_C32(0x4f060000), SPH_C32(0x936667ff), SPH_C32(0x29f944ce), - SPH_C32(0x368b63d5), SPH_C32(0x0c26f262), SPH_C32(0xef0b0270), - SPH_C32(0x3afd0000), SPH_C32(0x5dae0000), SPH_C32(0x69490000), - SPH_C32(0x9b0f3c06), SPH_C32(0x4405b5f9), SPH_C32(0x66140a51), - SPH_C32(0x924f5d0a) }, - { SPH_C32(0x145a3c00), SPH_C32(0xb9e90000), SPH_C32(0x61270000), - SPH_C32(0xf1610000), SPH_C32(0xce613d6c), SPH_C32(0xb0493d78), - SPH_C32(0x47a96720), SPH_C32(0xe18e24c5), SPH_C32(0x23671400), - SPH_C32(0xc8b90000), SPH_C32(0xf4c70000), SPH_C32(0xfb750000), - SPH_C32(0x73cd2465), SPH_C32(0xf8a6a549), SPH_C32(0x02c40a3f), - SPH_C32(0xdc24e61f) }, - { SPH_C32(0xfb513e70), SPH_C32(0x83140000), SPH_C32(0x3c890000), - SPH_C32(0x98280000), SPH_C32(0x556e016a), SPH_C32(0xf44c8881), - SPH_C32(0x21bd6d71), SPH_C32(0x73c179cf), SPH_C32(0xea0c1430), - SPH_C32(0x2f9c0000), SPH_C32(0xdb430000), SPH_C32(0xdd3a0000), - SPH_C32(0x7ba47f9c), SPH_C32(0x955a547e), SPH_C32(0x525b63bb), - SPH_C32(0x424d4977) }, - { SPH_C32(0xdd313c30), SPH_C32(0x5ecc0000), SPH_C32(0x4ea30000), - SPH_C32(0xd72e0000), SPH_C32(0xc6086695), SPH_C32(0xddb5cc4f), - SPH_C32(0x17360ea4), SPH_C32(0x7fe78bad), SPH_C32(0x05071640), - SPH_C32(0x15610000), SPH_C32(0x86ed0000), SPH_C32(0xb4730000), - SPH_C32(0xe0ab439a), SPH_C32(0xd15fe187), SPH_C32(0x344f69ea), - SPH_C32(0xd002147d) }, - { SPH_C32(0x323a3e40), SPH_C32(0x64310000), SPH_C32(0x130d0000), - SPH_C32(0xbe670000), SPH_C32(0x5d075a93), SPH_C32(0x99b079b6), - SPH_C32(0x712204f5), SPH_C32(0xeda8d6a7), SPH_C32(0xcc6c1670), - SPH_C32(0xf2440000), SPH_C32(0xa9690000), SPH_C32(0x923c0000), - SPH_C32(0xe8c21863), SPH_C32(0xbca310b0), SPH_C32(0x64d0006e), - SPH_C32(0x4e6bbb15) }, - { SPH_C32(0x23671400), SPH_C32(0xc8b90000), SPH_C32(0xf4c70000), - SPH_C32(0xfb750000), SPH_C32(0x73cd2465), SPH_C32(0xf8a6a549), - SPH_C32(0x02c40a3f), SPH_C32(0xdc24e61f), SPH_C32(0x373d2800), - SPH_C32(0x71500000), SPH_C32(0x95e00000), SPH_C32(0x0a140000), - SPH_C32(0xbdac1909), SPH_C32(0x48ef9831), SPH_C32(0x456d6d1f), - SPH_C32(0x3daac2da) }, - { SPH_C32(0xcc6c1670), SPH_C32(0xf2440000), SPH_C32(0xa9690000), - SPH_C32(0x923c0000), SPH_C32(0xe8c21863), SPH_C32(0xbca310b0), - SPH_C32(0x64d0006e), SPH_C32(0x4e6bbb15), SPH_C32(0xfe562830), - SPH_C32(0x96750000), SPH_C32(0xba640000), SPH_C32(0x2c5b0000), - SPH_C32(0xb5c542f0), SPH_C32(0x25136906), SPH_C32(0x15f2049b), - SPH_C32(0xa3c36db2) }, - { SPH_C32(0xea0c1430), SPH_C32(0x2f9c0000), SPH_C32(0xdb430000), - SPH_C32(0xdd3a0000), SPH_C32(0x7ba47f9c), SPH_C32(0x955a547e), - SPH_C32(0x525b63bb), SPH_C32(0x424d4977), SPH_C32(0x115d2a40), - SPH_C32(0xac880000), SPH_C32(0xe7ca0000), SPH_C32(0x45120000), - SPH_C32(0x2eca7ef6), SPH_C32(0x6116dcff), SPH_C32(0x73e60eca), - SPH_C32(0x318c30b8) }, - { SPH_C32(0x05071640), SPH_C32(0x15610000), SPH_C32(0x86ed0000), - SPH_C32(0xb4730000), SPH_C32(0xe0ab439a), SPH_C32(0xd15fe187), - SPH_C32(0x344f69ea), SPH_C32(0xd002147d), SPH_C32(0xd8362a70), - SPH_C32(0x4bad0000), SPH_C32(0xc84e0000), SPH_C32(0x635d0000), - SPH_C32(0x26a3250f), SPH_C32(0x0cea2dc8), SPH_C32(0x2379674e), - SPH_C32(0xafe59fd0) }, - { SPH_C32(0x373d2800), SPH_C32(0x71500000), SPH_C32(0x95e00000), - SPH_C32(0x0a140000), SPH_C32(0xbdac1909), SPH_C32(0x48ef9831), - SPH_C32(0x456d6d1f), SPH_C32(0x3daac2da), SPH_C32(0x145a3c00), - SPH_C32(0xb9e90000), SPH_C32(0x61270000), SPH_C32(0xf1610000), - SPH_C32(0xce613d6c), SPH_C32(0xb0493d78), SPH_C32(0x47a96720), - SPH_C32(0xe18e24c5) }, - { SPH_C32(0xd8362a70), SPH_C32(0x4bad0000), SPH_C32(0xc84e0000), - SPH_C32(0x635d0000), SPH_C32(0x26a3250f), SPH_C32(0x0cea2dc8), - SPH_C32(0x2379674e), SPH_C32(0xafe59fd0), SPH_C32(0xdd313c30), - SPH_C32(0x5ecc0000), SPH_C32(0x4ea30000), SPH_C32(0xd72e0000), - SPH_C32(0xc6086695), SPH_C32(0xddb5cc4f), SPH_C32(0x17360ea4), - SPH_C32(0x7fe78bad) }, - { SPH_C32(0xfe562830), SPH_C32(0x96750000), SPH_C32(0xba640000), - SPH_C32(0x2c5b0000), SPH_C32(0xb5c542f0), SPH_C32(0x25136906), - SPH_C32(0x15f2049b), SPH_C32(0xa3c36db2), SPH_C32(0x323a3e40), - SPH_C32(0x64310000), SPH_C32(0x130d0000), SPH_C32(0xbe670000), - SPH_C32(0x5d075a93), SPH_C32(0x99b079b6), SPH_C32(0x712204f5), - SPH_C32(0xeda8d6a7) }, - { SPH_C32(0x115d2a40), SPH_C32(0xac880000), SPH_C32(0xe7ca0000), - SPH_C32(0x45120000), SPH_C32(0x2eca7ef6), SPH_C32(0x6116dcff), - SPH_C32(0x73e60eca), SPH_C32(0x318c30b8), SPH_C32(0xfb513e70), - SPH_C32(0x83140000), SPH_C32(0x3c890000), SPH_C32(0x98280000), - SPH_C32(0x556e016a), SPH_C32(0xf44c8881), SPH_C32(0x21bd6d71), - SPH_C32(0x73c179cf) } -}; - -static const sph_u32 T512_8[16][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x774400f0), SPH_C32(0xf15a0000), SPH_C32(0xf5b20000), - SPH_C32(0x34140000), SPH_C32(0x89377e8c), SPH_C32(0x5a8bec25), - SPH_C32(0x0bc3cd1e), SPH_C32(0xcf3775cb), SPH_C32(0xf46c0050), - SPH_C32(0x96180000), SPH_C32(0x14a50000), SPH_C32(0x031f0000), - SPH_C32(0x42947eb8), SPH_C32(0x66bf7e19), SPH_C32(0x9ca470d2), - SPH_C32(0x8a341574) }, - { SPH_C32(0xf46c0050), SPH_C32(0x96180000), SPH_C32(0x14a50000), - SPH_C32(0x031f0000), SPH_C32(0x42947eb8), SPH_C32(0x66bf7e19), - SPH_C32(0x9ca470d2), SPH_C32(0x8a341574), SPH_C32(0x832800a0), - SPH_C32(0x67420000), SPH_C32(0xe1170000), SPH_C32(0x370b0000), - SPH_C32(0xcba30034), SPH_C32(0x3c34923c), SPH_C32(0x9767bdcc), - SPH_C32(0x450360bf) }, - { SPH_C32(0x832800a0), SPH_C32(0x67420000), SPH_C32(0xe1170000), - SPH_C32(0x370b0000), SPH_C32(0xcba30034), SPH_C32(0x3c34923c), - SPH_C32(0x9767bdcc), SPH_C32(0x450360bf), SPH_C32(0x774400f0), - SPH_C32(0xf15a0000), SPH_C32(0xf5b20000), SPH_C32(0x34140000), - SPH_C32(0x89377e8c), SPH_C32(0x5a8bec25), SPH_C32(0x0bc3cd1e), - SPH_C32(0xcf3775cb) }, - { SPH_C32(0xe8870170), SPH_C32(0x9d720000), SPH_C32(0x12db0000), - SPH_C32(0xd4220000), SPH_C32(0xf2886b27), SPH_C32(0xa921e543), - SPH_C32(0x4ef8b518), SPH_C32(0x618813b1), SPH_C32(0xb4370060), - SPH_C32(0x0c4c0000), SPH_C32(0x56c20000), SPH_C32(0x5cae0000), - SPH_C32(0x94541f3f), SPH_C32(0x3b3ef825), SPH_C32(0x1b365f3d), - SPH_C32(0xf3d45758) }, - { SPH_C32(0x9fc30180), SPH_C32(0x6c280000), SPH_C32(0xe7690000), - SPH_C32(0xe0360000), SPH_C32(0x7bbf15ab), SPH_C32(0xf3aa0966), - SPH_C32(0x453b7806), SPH_C32(0xaebf667a), SPH_C32(0x405b0030), - SPH_C32(0x9a540000), SPH_C32(0x42670000), SPH_C32(0x5fb10000), - SPH_C32(0xd6c06187), SPH_C32(0x5d81863c), SPH_C32(0x87922fef), - SPH_C32(0x79e0422c) }, - { SPH_C32(0x1ceb0120), SPH_C32(0x0b6a0000), SPH_C32(0x067e0000), - SPH_C32(0xd73d0000), SPH_C32(0xb01c159f), SPH_C32(0xcf9e9b5a), - SPH_C32(0xd25cc5ca), SPH_C32(0xebbc06c5), SPH_C32(0x371f00c0), - SPH_C32(0x6b0e0000), SPH_C32(0xb7d50000), SPH_C32(0x6ba50000), - SPH_C32(0x5ff71f0b), SPH_C32(0x070a6a19), SPH_C32(0x8c51e2f1), - SPH_C32(0xb6d737e7) }, - { SPH_C32(0x6baf01d0), SPH_C32(0xfa300000), SPH_C32(0xf3cc0000), - SPH_C32(0xe3290000), SPH_C32(0x392b6b13), SPH_C32(0x9515777f), - SPH_C32(0xd99f08d4), SPH_C32(0x248b730e), SPH_C32(0xc3730090), - SPH_C32(0xfd160000), SPH_C32(0xa3700000), SPH_C32(0x68ba0000), - SPH_C32(0x1d6361b3), SPH_C32(0x61b51400), SPH_C32(0x10f59223), - SPH_C32(0x3ce32293) }, - { SPH_C32(0xb4370060), SPH_C32(0x0c4c0000), SPH_C32(0x56c20000), - SPH_C32(0x5cae0000), SPH_C32(0x94541f3f), SPH_C32(0x3b3ef825), - SPH_C32(0x1b365f3d), SPH_C32(0xf3d45758), SPH_C32(0x5cb00110), - SPH_C32(0x913e0000), SPH_C32(0x44190000), SPH_C32(0x888c0000), - SPH_C32(0x66dc7418), SPH_C32(0x921f1d66), SPH_C32(0x55ceea25), - SPH_C32(0x925c44e9) }, - { SPH_C32(0xc3730090), SPH_C32(0xfd160000), SPH_C32(0xa3700000), - SPH_C32(0x68ba0000), SPH_C32(0x1d6361b3), SPH_C32(0x61b51400), - SPH_C32(0x10f59223), SPH_C32(0x3ce32293), SPH_C32(0xa8dc0140), - SPH_C32(0x07260000), SPH_C32(0x50bc0000), SPH_C32(0x8b930000), - SPH_C32(0x24480aa0), SPH_C32(0xf4a0637f), SPH_C32(0xc96a9af7), - SPH_C32(0x1868519d) }, - { SPH_C32(0x405b0030), SPH_C32(0x9a540000), SPH_C32(0x42670000), - SPH_C32(0x5fb10000), SPH_C32(0xd6c06187), SPH_C32(0x5d81863c), - SPH_C32(0x87922fef), SPH_C32(0x79e0422c), SPH_C32(0xdf9801b0), - SPH_C32(0xf67c0000), SPH_C32(0xa50e0000), SPH_C32(0xbf870000), - SPH_C32(0xad7f742c), SPH_C32(0xae2b8f5a), SPH_C32(0xc2a957e9), - SPH_C32(0xd75f2456) }, - { SPH_C32(0x371f00c0), SPH_C32(0x6b0e0000), SPH_C32(0xb7d50000), - SPH_C32(0x6ba50000), SPH_C32(0x5ff71f0b), SPH_C32(0x070a6a19), - SPH_C32(0x8c51e2f1), SPH_C32(0xb6d737e7), SPH_C32(0x2bf401e0), - SPH_C32(0x60640000), SPH_C32(0xb1ab0000), SPH_C32(0xbc980000), - SPH_C32(0xefeb0a94), SPH_C32(0xc894f143), SPH_C32(0x5e0d273b), - SPH_C32(0x5d6b3122) }, - { SPH_C32(0x5cb00110), SPH_C32(0x913e0000), SPH_C32(0x44190000), - SPH_C32(0x888c0000), SPH_C32(0x66dc7418), SPH_C32(0x921f1d66), - SPH_C32(0x55ceea25), SPH_C32(0x925c44e9), SPH_C32(0xe8870170), - SPH_C32(0x9d720000), SPH_C32(0x12db0000), SPH_C32(0xd4220000), - SPH_C32(0xf2886b27), SPH_C32(0xa921e543), SPH_C32(0x4ef8b518), - SPH_C32(0x618813b1) }, - { SPH_C32(0x2bf401e0), SPH_C32(0x60640000), SPH_C32(0xb1ab0000), - SPH_C32(0xbc980000), SPH_C32(0xefeb0a94), SPH_C32(0xc894f143), - SPH_C32(0x5e0d273b), SPH_C32(0x5d6b3122), SPH_C32(0x1ceb0120), - SPH_C32(0x0b6a0000), SPH_C32(0x067e0000), SPH_C32(0xd73d0000), - SPH_C32(0xb01c159f), SPH_C32(0xcf9e9b5a), SPH_C32(0xd25cc5ca), - SPH_C32(0xebbc06c5) }, - { SPH_C32(0xa8dc0140), SPH_C32(0x07260000), SPH_C32(0x50bc0000), - SPH_C32(0x8b930000), SPH_C32(0x24480aa0), SPH_C32(0xf4a0637f), - SPH_C32(0xc96a9af7), SPH_C32(0x1868519d), SPH_C32(0x6baf01d0), - SPH_C32(0xfa300000), SPH_C32(0xf3cc0000), SPH_C32(0xe3290000), - SPH_C32(0x392b6b13), SPH_C32(0x9515777f), SPH_C32(0xd99f08d4), - SPH_C32(0x248b730e) }, - { SPH_C32(0xdf9801b0), SPH_C32(0xf67c0000), SPH_C32(0xa50e0000), - SPH_C32(0xbf870000), SPH_C32(0xad7f742c), SPH_C32(0xae2b8f5a), - SPH_C32(0xc2a957e9), SPH_C32(0xd75f2456), SPH_C32(0x9fc30180), - SPH_C32(0x6c280000), SPH_C32(0xe7690000), SPH_C32(0xe0360000), - SPH_C32(0x7bbf15ab), SPH_C32(0xf3aa0966), SPH_C32(0x453b7806), - SPH_C32(0xaebf667a) } -}; - -static const sph_u32 T512_12[16][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xf6800005), SPH_C32(0x3443c000), SPH_C32(0x24070000), - SPH_C32(0x8f3d0000), SPH_C32(0x21373bfb), SPH_C32(0x0ab8d5ae), - SPH_C32(0xcdc58b19), SPH_C32(0xd795ba31), SPH_C32(0xa67f0001), - SPH_C32(0x71378000), SPH_C32(0x19fc0000), SPH_C32(0x96db0000), - SPH_C32(0x3a8b6dfd), SPH_C32(0xebcaaef3), SPH_C32(0x2c6d478f), - SPH_C32(0xac8e6c88) }, - { SPH_C32(0xa67f0001), SPH_C32(0x71378000), SPH_C32(0x19fc0000), - SPH_C32(0x96db0000), SPH_C32(0x3a8b6dfd), SPH_C32(0xebcaaef3), - SPH_C32(0x2c6d478f), SPH_C32(0xac8e6c88), SPH_C32(0x50ff0004), - SPH_C32(0x45744000), SPH_C32(0x3dfb0000), SPH_C32(0x19e60000), - SPH_C32(0x1bbc5606), SPH_C32(0xe1727b5d), SPH_C32(0xe1a8cc96), - SPH_C32(0x7b1bd6b9) }, - { SPH_C32(0x50ff0004), SPH_C32(0x45744000), SPH_C32(0x3dfb0000), - SPH_C32(0x19e60000), SPH_C32(0x1bbc5606), SPH_C32(0xe1727b5d), - SPH_C32(0xe1a8cc96), SPH_C32(0x7b1bd6b9), SPH_C32(0xf6800005), - SPH_C32(0x3443c000), SPH_C32(0x24070000), SPH_C32(0x8f3d0000), - SPH_C32(0x21373bfb), SPH_C32(0x0ab8d5ae), SPH_C32(0xcdc58b19), - SPH_C32(0xd795ba31) }, - { SPH_C32(0xf7750009), SPH_C32(0xcf3cc000), SPH_C32(0xc3d60000), - SPH_C32(0x04920000), SPH_C32(0x029519a9), SPH_C32(0xf8e836ba), - SPH_C32(0x7a87f14e), SPH_C32(0x9e16981a), SPH_C32(0xd46a0000), - SPH_C32(0x8dc8c000), SPH_C32(0xa5af0000), SPH_C32(0x4a290000), - SPH_C32(0xfc4e427a), SPH_C32(0xc9b4866c), SPH_C32(0x98369604), - SPH_C32(0xf746c320) }, - { SPH_C32(0x01f5000c), SPH_C32(0xfb7f0000), SPH_C32(0xe7d10000), - SPH_C32(0x8baf0000), SPH_C32(0x23a22252), SPH_C32(0xf250e314), - SPH_C32(0xb7427a57), SPH_C32(0x4983222b), SPH_C32(0x72150001), - SPH_C32(0xfcff4000), SPH_C32(0xbc530000), SPH_C32(0xdcf20000), - SPH_C32(0xc6c52f87), SPH_C32(0x227e289f), SPH_C32(0xb45bd18b), - SPH_C32(0x5bc8afa8) }, - { SPH_C32(0x510a0008), SPH_C32(0xbe0b4000), SPH_C32(0xda2a0000), - SPH_C32(0x92490000), SPH_C32(0x381e7454), SPH_C32(0x13229849), - SPH_C32(0x56eab6c1), SPH_C32(0x3298f492), SPH_C32(0x84950004), - SPH_C32(0xc8bc8000), SPH_C32(0x98540000), SPH_C32(0x53cf0000), - SPH_C32(0xe7f2147c), SPH_C32(0x28c6fd31), SPH_C32(0x799e5a92), - SPH_C32(0x8c5d1599) }, - { SPH_C32(0xa78a000d), SPH_C32(0x8a488000), SPH_C32(0xfe2d0000), - SPH_C32(0x1d740000), SPH_C32(0x19294faf), SPH_C32(0x199a4de7), - SPH_C32(0x9b2f3dd8), SPH_C32(0xe50d4ea3), SPH_C32(0x22ea0005), - SPH_C32(0xb98b0000), SPH_C32(0x81a80000), SPH_C32(0xc5140000), - SPH_C32(0xdd797981), SPH_C32(0xc30c53c2), SPH_C32(0x55f31d1d), - SPH_C32(0x20d37911) }, - { SPH_C32(0xd46a0000), SPH_C32(0x8dc8c000), SPH_C32(0xa5af0000), - SPH_C32(0x4a290000), SPH_C32(0xfc4e427a), SPH_C32(0xc9b4866c), - SPH_C32(0x98369604), SPH_C32(0xf746c320), SPH_C32(0x231f0009), - SPH_C32(0x42f40000), SPH_C32(0x66790000), SPH_C32(0x4ebb0000), - SPH_C32(0xfedb5bd3), SPH_C32(0x315cb0d6), SPH_C32(0xe2b1674a), - SPH_C32(0x69505b3a) }, - { SPH_C32(0x22ea0005), SPH_C32(0xb98b0000), SPH_C32(0x81a80000), - SPH_C32(0xc5140000), SPH_C32(0xdd797981), SPH_C32(0xc30c53c2), - SPH_C32(0x55f31d1d), SPH_C32(0x20d37911), SPH_C32(0x85600008), - SPH_C32(0x33c38000), SPH_C32(0x7f850000), SPH_C32(0xd8600000), - SPH_C32(0xc450362e), SPH_C32(0xda961e25), SPH_C32(0xcedc20c5), - SPH_C32(0xc5de37b2) }, - { SPH_C32(0x72150001), SPH_C32(0xfcff4000), SPH_C32(0xbc530000), - SPH_C32(0xdcf20000), SPH_C32(0xc6c52f87), SPH_C32(0x227e289f), - SPH_C32(0xb45bd18b), SPH_C32(0x5bc8afa8), SPH_C32(0x73e0000d), - SPH_C32(0x07804000), SPH_C32(0x5b820000), SPH_C32(0x575d0000), - SPH_C32(0xe5670dd5), SPH_C32(0xd02ecb8b), SPH_C32(0x0319abdc), - SPH_C32(0x124b8d83) }, - { SPH_C32(0x84950004), SPH_C32(0xc8bc8000), SPH_C32(0x98540000), - SPH_C32(0x53cf0000), SPH_C32(0xe7f2147c), SPH_C32(0x28c6fd31), - SPH_C32(0x799e5a92), SPH_C32(0x8c5d1599), SPH_C32(0xd59f000c), - SPH_C32(0x76b7c000), SPH_C32(0x427e0000), SPH_C32(0xc1860000), - SPH_C32(0xdfec6028), SPH_C32(0x3be46578), SPH_C32(0x2f74ec53), - SPH_C32(0xbec5e10b) }, - { SPH_C32(0x231f0009), SPH_C32(0x42f40000), SPH_C32(0x66790000), - SPH_C32(0x4ebb0000), SPH_C32(0xfedb5bd3), SPH_C32(0x315cb0d6), - SPH_C32(0xe2b1674a), SPH_C32(0x69505b3a), SPH_C32(0xf7750009), - SPH_C32(0xcf3cc000), SPH_C32(0xc3d60000), SPH_C32(0x04920000), - SPH_C32(0x029519a9), SPH_C32(0xf8e836ba), SPH_C32(0x7a87f14e), - SPH_C32(0x9e16981a) }, - { SPH_C32(0xd59f000c), SPH_C32(0x76b7c000), SPH_C32(0x427e0000), - SPH_C32(0xc1860000), SPH_C32(0xdfec6028), SPH_C32(0x3be46578), - SPH_C32(0x2f74ec53), SPH_C32(0xbec5e10b), SPH_C32(0x510a0008), - SPH_C32(0xbe0b4000), SPH_C32(0xda2a0000), SPH_C32(0x92490000), - SPH_C32(0x381e7454), SPH_C32(0x13229849), SPH_C32(0x56eab6c1), - SPH_C32(0x3298f492) }, - { SPH_C32(0x85600008), SPH_C32(0x33c38000), SPH_C32(0x7f850000), - SPH_C32(0xd8600000), SPH_C32(0xc450362e), SPH_C32(0xda961e25), - SPH_C32(0xcedc20c5), SPH_C32(0xc5de37b2), SPH_C32(0xa78a000d), - SPH_C32(0x8a488000), SPH_C32(0xfe2d0000), SPH_C32(0x1d740000), - SPH_C32(0x19294faf), SPH_C32(0x199a4de7), SPH_C32(0x9b2f3dd8), - SPH_C32(0xe50d4ea3) }, - { SPH_C32(0x73e0000d), SPH_C32(0x07804000), SPH_C32(0x5b820000), - SPH_C32(0x575d0000), SPH_C32(0xe5670dd5), SPH_C32(0xd02ecb8b), - SPH_C32(0x0319abdc), SPH_C32(0x124b8d83), SPH_C32(0x01f5000c), - SPH_C32(0xfb7f0000), SPH_C32(0xe7d10000), SPH_C32(0x8baf0000), - SPH_C32(0x23a22252), SPH_C32(0xf250e314), SPH_C32(0xb7427a57), - SPH_C32(0x4983222b) } -}; - -static const sph_u32 T512_16[16][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x75a40000), SPH_C32(0xc28b2700), SPH_C32(0x94a40000), - SPH_C32(0x90f50000), SPH_C32(0xfb7857e0), SPH_C32(0x49ce0bae), - SPH_C32(0x1767c483), SPH_C32(0xaedf667e), SPH_C32(0xd1660000), - SPH_C32(0x1bbc0300), SPH_C32(0x9eec0000), SPH_C32(0xf6940000), - SPH_C32(0x03024527), SPH_C32(0xcf70fcf2), SPH_C32(0xb4431b17), - SPH_C32(0x857f3c2b) }, - { SPH_C32(0xd1660000), SPH_C32(0x1bbc0300), SPH_C32(0x9eec0000), - SPH_C32(0xf6940000), SPH_C32(0x03024527), SPH_C32(0xcf70fcf2), - SPH_C32(0xb4431b17), SPH_C32(0x857f3c2b), SPH_C32(0xa4c20000), - SPH_C32(0xd9372400), SPH_C32(0x0a480000), SPH_C32(0x66610000), - SPH_C32(0xf87a12c7), SPH_C32(0x86bef75c), SPH_C32(0xa324df94), - SPH_C32(0x2ba05a55) }, - { SPH_C32(0xa4c20000), SPH_C32(0xd9372400), SPH_C32(0x0a480000), - SPH_C32(0x66610000), SPH_C32(0xf87a12c7), SPH_C32(0x86bef75c), - SPH_C32(0xa324df94), SPH_C32(0x2ba05a55), SPH_C32(0x75a40000), - SPH_C32(0xc28b2700), SPH_C32(0x94a40000), SPH_C32(0x90f50000), - SPH_C32(0xfb7857e0), SPH_C32(0x49ce0bae), SPH_C32(0x1767c483), - SPH_C32(0xaedf667e) }, - { SPH_C32(0x75c90003), SPH_C32(0x0e10c000), SPH_C32(0xd1200000), - SPH_C32(0xbaea0000), SPH_C32(0x8bc42f3e), SPH_C32(0x8758b757), - SPH_C32(0xbb28761d), SPH_C32(0x00b72e2b), SPH_C32(0xeecf0001), - SPH_C32(0x6f564000), SPH_C32(0xf33e0000), SPH_C32(0xa79e0000), - SPH_C32(0xbdb57219), SPH_C32(0xb711ebc5), SPH_C32(0x4a3b40ba), - SPH_C32(0xfeabf254) }, - { SPH_C32(0x006d0003), SPH_C32(0xcc9be700), SPH_C32(0x45840000), - SPH_C32(0x2a1f0000), SPH_C32(0x70bc78de), SPH_C32(0xce96bcf9), - SPH_C32(0xac4fb29e), SPH_C32(0xae684855), SPH_C32(0x3fa90001), - SPH_C32(0x74ea4300), SPH_C32(0x6dd20000), SPH_C32(0x510a0000), - SPH_C32(0xbeb7373e), SPH_C32(0x78611737), SPH_C32(0xfe785bad), - SPH_C32(0x7bd4ce7f) }, - { SPH_C32(0xa4af0003), SPH_C32(0x15acc300), SPH_C32(0x4fcc0000), - SPH_C32(0x4c7e0000), SPH_C32(0x88c66a19), SPH_C32(0x48284ba5), - SPH_C32(0x0f6b6d0a), SPH_C32(0x85c81200), SPH_C32(0x4a0d0001), - SPH_C32(0xb6616400), SPH_C32(0xf9760000), SPH_C32(0xc1ff0000), - SPH_C32(0x45cf60de), SPH_C32(0x31af1c99), SPH_C32(0xe91f9f2e), - SPH_C32(0xd50ba801) }, - { SPH_C32(0xd10b0003), SPH_C32(0xd727e400), SPH_C32(0xdb680000), - SPH_C32(0xdc8b0000), SPH_C32(0x73be3df9), SPH_C32(0x01e6400b), - SPH_C32(0x180ca989), SPH_C32(0x2b17747e), SPH_C32(0x9b6b0001), - SPH_C32(0xaddd6700), SPH_C32(0x679a0000), SPH_C32(0x376b0000), - SPH_C32(0x46cd25f9), SPH_C32(0xfedfe06b), SPH_C32(0x5d5c8439), - SPH_C32(0x5074942a) }, - { SPH_C32(0xeecf0001), SPH_C32(0x6f564000), SPH_C32(0xf33e0000), - SPH_C32(0xa79e0000), SPH_C32(0xbdb57219), SPH_C32(0xb711ebc5), - SPH_C32(0x4a3b40ba), SPH_C32(0xfeabf254), SPH_C32(0x9b060002), - SPH_C32(0x61468000), SPH_C32(0x221e0000), SPH_C32(0x1d740000), - SPH_C32(0x36715d27), SPH_C32(0x30495c92), SPH_C32(0xf11336a7), - SPH_C32(0xfe1cdc7f) }, - { SPH_C32(0x9b6b0001), SPH_C32(0xaddd6700), SPH_C32(0x679a0000), - SPH_C32(0x376b0000), SPH_C32(0x46cd25f9), SPH_C32(0xfedfe06b), - SPH_C32(0x5d5c8439), SPH_C32(0x5074942a), SPH_C32(0x4a600002), - SPH_C32(0x7afa8300), SPH_C32(0xbcf20000), SPH_C32(0xebe00000), - SPH_C32(0x35731800), SPH_C32(0xff39a060), SPH_C32(0x45502db0), - SPH_C32(0x7b63e054) }, - { SPH_C32(0x3fa90001), SPH_C32(0x74ea4300), SPH_C32(0x6dd20000), - SPH_C32(0x510a0000), SPH_C32(0xbeb7373e), SPH_C32(0x78611737), - SPH_C32(0xfe785bad), SPH_C32(0x7bd4ce7f), SPH_C32(0x3fc40002), - SPH_C32(0xb871a400), SPH_C32(0x28560000), SPH_C32(0x7b150000), - SPH_C32(0xce0b4fe0), SPH_C32(0xb6f7abce), SPH_C32(0x5237e933), - SPH_C32(0xd5bc862a) }, - { SPH_C32(0x4a0d0001), SPH_C32(0xb6616400), SPH_C32(0xf9760000), - SPH_C32(0xc1ff0000), SPH_C32(0x45cf60de), SPH_C32(0x31af1c99), - SPH_C32(0xe91f9f2e), SPH_C32(0xd50ba801), SPH_C32(0xeea20002), - SPH_C32(0xa3cda700), SPH_C32(0xb6ba0000), SPH_C32(0x8d810000), - SPH_C32(0xcd090ac7), SPH_C32(0x7987573c), SPH_C32(0xe674f224), - SPH_C32(0x50c3ba01) }, - { SPH_C32(0x9b060002), SPH_C32(0x61468000), SPH_C32(0x221e0000), - SPH_C32(0x1d740000), SPH_C32(0x36715d27), SPH_C32(0x30495c92), - SPH_C32(0xf11336a7), SPH_C32(0xfe1cdc7f), SPH_C32(0x75c90003), - SPH_C32(0x0e10c000), SPH_C32(0xd1200000), SPH_C32(0xbaea0000), - SPH_C32(0x8bc42f3e), SPH_C32(0x8758b757), SPH_C32(0xbb28761d), - SPH_C32(0x00b72e2b) }, - { SPH_C32(0xeea20002), SPH_C32(0xa3cda700), SPH_C32(0xb6ba0000), - SPH_C32(0x8d810000), SPH_C32(0xcd090ac7), SPH_C32(0x7987573c), - SPH_C32(0xe674f224), SPH_C32(0x50c3ba01), SPH_C32(0xa4af0003), - SPH_C32(0x15acc300), SPH_C32(0x4fcc0000), SPH_C32(0x4c7e0000), - SPH_C32(0x88c66a19), SPH_C32(0x48284ba5), SPH_C32(0x0f6b6d0a), - SPH_C32(0x85c81200) }, - { SPH_C32(0x4a600002), SPH_C32(0x7afa8300), SPH_C32(0xbcf20000), - SPH_C32(0xebe00000), SPH_C32(0x35731800), SPH_C32(0xff39a060), - SPH_C32(0x45502db0), SPH_C32(0x7b63e054), SPH_C32(0xd10b0003), - SPH_C32(0xd727e400), SPH_C32(0xdb680000), SPH_C32(0xdc8b0000), - SPH_C32(0x73be3df9), SPH_C32(0x01e6400b), SPH_C32(0x180ca989), - SPH_C32(0x2b17747e) }, - { SPH_C32(0x3fc40002), SPH_C32(0xb871a400), SPH_C32(0x28560000), - SPH_C32(0x7b150000), SPH_C32(0xce0b4fe0), SPH_C32(0xb6f7abce), - SPH_C32(0x5237e933), SPH_C32(0xd5bc862a), SPH_C32(0x006d0003), - SPH_C32(0xcc9be700), SPH_C32(0x45840000), SPH_C32(0x2a1f0000), - SPH_C32(0x70bc78de), SPH_C32(0xce96bcf9), SPH_C32(0xac4fb29e), - SPH_C32(0xae684855) } -}; - -static const sph_u32 T512_20[16][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x0c720000), SPH_C32(0x49e50f00), SPH_C32(0x42790000), - SPH_C32(0x5cea0000), SPH_C32(0x33aa301a), SPH_C32(0x15822514), - SPH_C32(0x95a34b7b), SPH_C32(0xb44b0090), SPH_C32(0xfe220000), - SPH_C32(0xa7580500), SPH_C32(0x25d10000), SPH_C32(0xf7600000), - SPH_C32(0x893178da), SPH_C32(0x1fd4f860), SPH_C32(0x4ed0a315), - SPH_C32(0xa123ff9f) }, - { SPH_C32(0xfe220000), SPH_C32(0xa7580500), SPH_C32(0x25d10000), - SPH_C32(0xf7600000), SPH_C32(0x893178da), SPH_C32(0x1fd4f860), - SPH_C32(0x4ed0a315), SPH_C32(0xa123ff9f), SPH_C32(0xf2500000), - SPH_C32(0xeebd0a00), SPH_C32(0x67a80000), SPH_C32(0xab8a0000), - SPH_C32(0xba9b48c0), SPH_C32(0x0a56dd74), SPH_C32(0xdb73e86e), - SPH_C32(0x1568ff0f) }, - { SPH_C32(0xf2500000), SPH_C32(0xeebd0a00), SPH_C32(0x67a80000), - SPH_C32(0xab8a0000), SPH_C32(0xba9b48c0), SPH_C32(0x0a56dd74), - SPH_C32(0xdb73e86e), SPH_C32(0x1568ff0f), SPH_C32(0x0c720000), - SPH_C32(0x49e50f00), SPH_C32(0x42790000), SPH_C32(0x5cea0000), - SPH_C32(0x33aa301a), SPH_C32(0x15822514), SPH_C32(0x95a34b7b), - SPH_C32(0xb44b0090) }, - { SPH_C32(0x45180000), SPH_C32(0xa5b51700), SPH_C32(0xf96a0000), - SPH_C32(0x3b480000), SPH_C32(0x1ecc142c), SPH_C32(0x231395d6), - SPH_C32(0x16bca6b0), SPH_C32(0xdf33f4df), SPH_C32(0xb83d0000), - SPH_C32(0x16710600), SPH_C32(0x379a0000), SPH_C32(0xf5b10000), - SPH_C32(0x228161ac), SPH_C32(0xae48f145), SPH_C32(0x66241616), - SPH_C32(0xc5c1eb3e) }, - { SPH_C32(0x496a0000), SPH_C32(0xec501800), SPH_C32(0xbb130000), - SPH_C32(0x67a20000), SPH_C32(0x2d662436), SPH_C32(0x3691b0c2), - SPH_C32(0x831fedcb), SPH_C32(0x6b78f44f), SPH_C32(0x461f0000), - SPH_C32(0xb1290300), SPH_C32(0x124b0000), SPH_C32(0x02d10000), - SPH_C32(0xabb01976), SPH_C32(0xb19c0925), SPH_C32(0x28f4b503), - SPH_C32(0x64e214a1) }, - { SPH_C32(0xbb3a0000), SPH_C32(0x02ed1200), SPH_C32(0xdcbb0000), - SPH_C32(0xcc280000), SPH_C32(0x97fd6cf6), SPH_C32(0x3cc76db6), - SPH_C32(0x586c05a5), SPH_C32(0x7e100b40), SPH_C32(0x4a6d0000), - SPH_C32(0xf8cc0c00), SPH_C32(0x50320000), SPH_C32(0x5e3b0000), - SPH_C32(0x981a296c), SPH_C32(0xa41e2c31), SPH_C32(0xbd57fe78), - SPH_C32(0xd0a91431) }, - { SPH_C32(0xb7480000), SPH_C32(0x4b081d00), SPH_C32(0x9ec20000), - SPH_C32(0x90c20000), SPH_C32(0xa4575cec), SPH_C32(0x294548a2), - SPH_C32(0xcdcf4ede), SPH_C32(0xca5b0bd0), SPH_C32(0xb44f0000), - SPH_C32(0x5f940900), SPH_C32(0x75e30000), SPH_C32(0xa95b0000), - SPH_C32(0x112b51b6), SPH_C32(0xbbcad451), SPH_C32(0xf3875d6d), - SPH_C32(0x718aebae) }, - { SPH_C32(0xb83d0000), SPH_C32(0x16710600), SPH_C32(0x379a0000), - SPH_C32(0xf5b10000), SPH_C32(0x228161ac), SPH_C32(0xae48f145), - SPH_C32(0x66241616), SPH_C32(0xc5c1eb3e), SPH_C32(0xfd250000), - SPH_C32(0xb3c41100), SPH_C32(0xcef00000), SPH_C32(0xcef90000), - SPH_C32(0x3c4d7580), SPH_C32(0x8d5b6493), SPH_C32(0x7098b0a6), - SPH_C32(0x1af21fe1) }, - { SPH_C32(0xb44f0000), SPH_C32(0x5f940900), SPH_C32(0x75e30000), - SPH_C32(0xa95b0000), SPH_C32(0x112b51b6), SPH_C32(0xbbcad451), - SPH_C32(0xf3875d6d), SPH_C32(0x718aebae), SPH_C32(0x03070000), - SPH_C32(0x149c1400), SPH_C32(0xeb210000), SPH_C32(0x39990000), - SPH_C32(0xb57c0d5a), SPH_C32(0x928f9cf3), SPH_C32(0x3e4813b3), - SPH_C32(0xbbd1e07e) }, - { SPH_C32(0x461f0000), SPH_C32(0xb1290300), SPH_C32(0x124b0000), - SPH_C32(0x02d10000), SPH_C32(0xabb01976), SPH_C32(0xb19c0925), - SPH_C32(0x28f4b503), SPH_C32(0x64e214a1), SPH_C32(0x0f750000), - SPH_C32(0x5d791b00), SPH_C32(0xa9580000), SPH_C32(0x65730000), - SPH_C32(0x86d63d40), SPH_C32(0x870db9e7), SPH_C32(0xabeb58c8), - SPH_C32(0x0f9ae0ee) }, - { SPH_C32(0x4a6d0000), SPH_C32(0xf8cc0c00), SPH_C32(0x50320000), - SPH_C32(0x5e3b0000), SPH_C32(0x981a296c), SPH_C32(0xa41e2c31), - SPH_C32(0xbd57fe78), SPH_C32(0xd0a91431), SPH_C32(0xf1570000), - SPH_C32(0xfa211e00), SPH_C32(0x8c890000), SPH_C32(0x92130000), - SPH_C32(0x0fe7459a), SPH_C32(0x98d94187), SPH_C32(0xe53bfbdd), - SPH_C32(0xaeb91f71) }, - { SPH_C32(0xfd250000), SPH_C32(0xb3c41100), SPH_C32(0xcef00000), - SPH_C32(0xcef90000), SPH_C32(0x3c4d7580), SPH_C32(0x8d5b6493), - SPH_C32(0x7098b0a6), SPH_C32(0x1af21fe1), SPH_C32(0x45180000), - SPH_C32(0xa5b51700), SPH_C32(0xf96a0000), SPH_C32(0x3b480000), - SPH_C32(0x1ecc142c), SPH_C32(0x231395d6), SPH_C32(0x16bca6b0), - SPH_C32(0xdf33f4df) }, - { SPH_C32(0xf1570000), SPH_C32(0xfa211e00), SPH_C32(0x8c890000), - SPH_C32(0x92130000), SPH_C32(0x0fe7459a), SPH_C32(0x98d94187), - SPH_C32(0xe53bfbdd), SPH_C32(0xaeb91f71), SPH_C32(0xbb3a0000), - SPH_C32(0x02ed1200), SPH_C32(0xdcbb0000), SPH_C32(0xcc280000), - SPH_C32(0x97fd6cf6), SPH_C32(0x3cc76db6), SPH_C32(0x586c05a5), - SPH_C32(0x7e100b40) }, - { SPH_C32(0x03070000), SPH_C32(0x149c1400), SPH_C32(0xeb210000), - SPH_C32(0x39990000), SPH_C32(0xb57c0d5a), SPH_C32(0x928f9cf3), - SPH_C32(0x3e4813b3), SPH_C32(0xbbd1e07e), SPH_C32(0xb7480000), - SPH_C32(0x4b081d00), SPH_C32(0x9ec20000), SPH_C32(0x90c20000), - SPH_C32(0xa4575cec), SPH_C32(0x294548a2), SPH_C32(0xcdcf4ede), - SPH_C32(0xca5b0bd0) }, - { SPH_C32(0x0f750000), SPH_C32(0x5d791b00), SPH_C32(0xa9580000), - SPH_C32(0x65730000), SPH_C32(0x86d63d40), SPH_C32(0x870db9e7), - SPH_C32(0xabeb58c8), SPH_C32(0x0f9ae0ee), SPH_C32(0x496a0000), - SPH_C32(0xec501800), SPH_C32(0xbb130000), SPH_C32(0x67a20000), - SPH_C32(0x2d662436), SPH_C32(0x3691b0c2), SPH_C32(0x831fedcb), - SPH_C32(0x6b78f44f) } -}; - -static const sph_u32 T512_24[16][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x54500000), SPH_C32(0x0671005c), SPH_C32(0x25ae0000), - SPH_C32(0x6a1e0000), SPH_C32(0x2ea54edf), SPH_C32(0x664e8512), - SPH_C32(0xbfba18c3), SPH_C32(0x7e715d17), SPH_C32(0xbc8d0000), - SPH_C32(0xfc3b0018), SPH_C32(0x19830000), SPH_C32(0xd10b0000), - SPH_C32(0xae1878c4), SPH_C32(0x42a69856), SPH_C32(0x0012da37), - SPH_C32(0x2c3b504e) }, - { SPH_C32(0xbc8d0000), SPH_C32(0xfc3b0018), SPH_C32(0x19830000), - SPH_C32(0xd10b0000), SPH_C32(0xae1878c4), SPH_C32(0x42a69856), - SPH_C32(0x0012da37), SPH_C32(0x2c3b504e), SPH_C32(0xe8dd0000), - SPH_C32(0xfa4a0044), SPH_C32(0x3c2d0000), SPH_C32(0xbb150000), - SPH_C32(0x80bd361b), SPH_C32(0x24e81d44), SPH_C32(0xbfa8c2f4), - SPH_C32(0x524a0d59) }, - { SPH_C32(0xe8dd0000), SPH_C32(0xfa4a0044), SPH_C32(0x3c2d0000), - SPH_C32(0xbb150000), SPH_C32(0x80bd361b), SPH_C32(0x24e81d44), - SPH_C32(0xbfa8c2f4), SPH_C32(0x524a0d59), SPH_C32(0x54500000), - SPH_C32(0x0671005c), SPH_C32(0x25ae0000), SPH_C32(0x6a1e0000), - SPH_C32(0x2ea54edf), SPH_C32(0x664e8512), SPH_C32(0xbfba18c3), - SPH_C32(0x7e715d17) }, - { SPH_C32(0x69510000), SPH_C32(0xd4e1009c), SPH_C32(0xc3230000), - SPH_C32(0xac2f0000), SPH_C32(0xe4950bae), SPH_C32(0xcea415dc), - SPH_C32(0x87ec287c), SPH_C32(0xbce1a3ce), SPH_C32(0xc6730000), - SPH_C32(0xaf8d000c), SPH_C32(0xa4c10000), SPH_C32(0x218d0000), - SPH_C32(0x23111587), SPH_C32(0x7913512f), SPH_C32(0x1d28ac88), - SPH_C32(0x378dd173) }, - { SPH_C32(0x3d010000), SPH_C32(0xd29000c0), SPH_C32(0xe68d0000), - SPH_C32(0xc6310000), SPH_C32(0xca304571), SPH_C32(0xa8ea90ce), - SPH_C32(0x385630bf), SPH_C32(0xc290fed9), SPH_C32(0x7afe0000), - SPH_C32(0x53b60014), SPH_C32(0xbd420000), SPH_C32(0xf0860000), - SPH_C32(0x8d096d43), SPH_C32(0x3bb5c979), SPH_C32(0x1d3a76bf), - SPH_C32(0x1bb6813d) }, - { SPH_C32(0xd5dc0000), SPH_C32(0x28da0084), SPH_C32(0xdaa00000), - SPH_C32(0x7d240000), SPH_C32(0x4a8d736a), SPH_C32(0x8c028d8a), - SPH_C32(0x87fef24b), SPH_C32(0x90daf380), SPH_C32(0x2eae0000), - SPH_C32(0x55c70048), SPH_C32(0x98ec0000), SPH_C32(0x9a980000), - SPH_C32(0xa3ac239c), SPH_C32(0x5dfb4c6b), SPH_C32(0xa2806e7c), - SPH_C32(0x65c7dc2a) }, - { SPH_C32(0x818c0000), SPH_C32(0x2eab00d8), SPH_C32(0xff0e0000), - SPH_C32(0x173a0000), SPH_C32(0x64283db5), SPH_C32(0xea4c0898), - SPH_C32(0x3844ea88), SPH_C32(0xeeabae97), SPH_C32(0x92230000), - SPH_C32(0xa9fc0050), SPH_C32(0x816f0000), SPH_C32(0x4b930000), - SPH_C32(0x0db45b58), SPH_C32(0x1f5dd43d), SPH_C32(0xa292b44b), - SPH_C32(0x49fc8c64) }, - { SPH_C32(0xc6730000), SPH_C32(0xaf8d000c), SPH_C32(0xa4c10000), - SPH_C32(0x218d0000), SPH_C32(0x23111587), SPH_C32(0x7913512f), - SPH_C32(0x1d28ac88), SPH_C32(0x378dd173), SPH_C32(0xaf220000), - SPH_C32(0x7b6c0090), SPH_C32(0x67e20000), SPH_C32(0x8da20000), - SPH_C32(0xc7841e29), SPH_C32(0xb7b744f3), SPH_C32(0x9ac484f4), - SPH_C32(0x8b6c72bd) }, - { SPH_C32(0x92230000), SPH_C32(0xa9fc0050), SPH_C32(0x816f0000), - SPH_C32(0x4b930000), SPH_C32(0x0db45b58), SPH_C32(0x1f5dd43d), - SPH_C32(0xa292b44b), SPH_C32(0x49fc8c64), SPH_C32(0x13af0000), - SPH_C32(0x87570088), SPH_C32(0x7e610000), SPH_C32(0x5ca90000), - SPH_C32(0x699c66ed), SPH_C32(0xf511dca5), SPH_C32(0x9ad65ec3), - SPH_C32(0xa75722f3) }, - { SPH_C32(0x7afe0000), SPH_C32(0x53b60014), SPH_C32(0xbd420000), - SPH_C32(0xf0860000), SPH_C32(0x8d096d43), SPH_C32(0x3bb5c979), - SPH_C32(0x1d3a76bf), SPH_C32(0x1bb6813d), SPH_C32(0x47ff0000), - SPH_C32(0x812600d4), SPH_C32(0x5bcf0000), SPH_C32(0x36b70000), - SPH_C32(0x47392832), SPH_C32(0x935f59b7), SPH_C32(0x256c4600), - SPH_C32(0xd9267fe4) }, - { SPH_C32(0x2eae0000), SPH_C32(0x55c70048), SPH_C32(0x98ec0000), - SPH_C32(0x9a980000), SPH_C32(0xa3ac239c), SPH_C32(0x5dfb4c6b), - SPH_C32(0xa2806e7c), SPH_C32(0x65c7dc2a), SPH_C32(0xfb720000), - SPH_C32(0x7d1d00cc), SPH_C32(0x424c0000), SPH_C32(0xe7bc0000), - SPH_C32(0xe92150f6), SPH_C32(0xd1f9c1e1), SPH_C32(0x257e9c37), - SPH_C32(0xf51d2faa) }, - { SPH_C32(0xaf220000), SPH_C32(0x7b6c0090), SPH_C32(0x67e20000), - SPH_C32(0x8da20000), SPH_C32(0xc7841e29), SPH_C32(0xb7b744f3), - SPH_C32(0x9ac484f4), SPH_C32(0x8b6c72bd), SPH_C32(0x69510000), - SPH_C32(0xd4e1009c), SPH_C32(0xc3230000), SPH_C32(0xac2f0000), - SPH_C32(0xe4950bae), SPH_C32(0xcea415dc), SPH_C32(0x87ec287c), - SPH_C32(0xbce1a3ce) }, - { SPH_C32(0xfb720000), SPH_C32(0x7d1d00cc), SPH_C32(0x424c0000), - SPH_C32(0xe7bc0000), SPH_C32(0xe92150f6), SPH_C32(0xd1f9c1e1), - SPH_C32(0x257e9c37), SPH_C32(0xf51d2faa), SPH_C32(0xd5dc0000), - SPH_C32(0x28da0084), SPH_C32(0xdaa00000), SPH_C32(0x7d240000), - SPH_C32(0x4a8d736a), SPH_C32(0x8c028d8a), SPH_C32(0x87fef24b), - SPH_C32(0x90daf380) }, - { SPH_C32(0x13af0000), SPH_C32(0x87570088), SPH_C32(0x7e610000), - SPH_C32(0x5ca90000), SPH_C32(0x699c66ed), SPH_C32(0xf511dca5), - SPH_C32(0x9ad65ec3), SPH_C32(0xa75722f3), SPH_C32(0x818c0000), - SPH_C32(0x2eab00d8), SPH_C32(0xff0e0000), SPH_C32(0x173a0000), - SPH_C32(0x64283db5), SPH_C32(0xea4c0898), SPH_C32(0x3844ea88), - SPH_C32(0xeeabae97) }, - { SPH_C32(0x47ff0000), SPH_C32(0x812600d4), SPH_C32(0x5bcf0000), - SPH_C32(0x36b70000), SPH_C32(0x47392832), SPH_C32(0x935f59b7), - SPH_C32(0x256c4600), SPH_C32(0xd9267fe4), SPH_C32(0x3d010000), - SPH_C32(0xd29000c0), SPH_C32(0xe68d0000), SPH_C32(0xc6310000), - SPH_C32(0xca304571), SPH_C32(0xa8ea90ce), SPH_C32(0x385630bf), - SPH_C32(0xc290fed9) } -}; - -static const sph_u32 T512_28[16][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x86790000), SPH_C32(0x3f390002), SPH_C32(0xe19ae000), - SPH_C32(0x98560000), SPH_C32(0x9565670e), SPH_C32(0x4e88c8ea), - SPH_C32(0xd3dd4944), SPH_C32(0x161ddab9), SPH_C32(0x30b70000), - SPH_C32(0xe5d00000), SPH_C32(0xf4f46000), SPH_C32(0x42c40000), - SPH_C32(0x63b83d6a), SPH_C32(0x78ba9460), SPH_C32(0x21afa1ea), - SPH_C32(0xb0a51834) }, - { SPH_C32(0x30b70000), SPH_C32(0xe5d00000), SPH_C32(0xf4f46000), - SPH_C32(0x42c40000), SPH_C32(0x63b83d6a), SPH_C32(0x78ba9460), - SPH_C32(0x21afa1ea), SPH_C32(0xb0a51834), SPH_C32(0xb6ce0000), - SPH_C32(0xdae90002), SPH_C32(0x156e8000), SPH_C32(0xda920000), - SPH_C32(0xf6dd5a64), SPH_C32(0x36325c8a), SPH_C32(0xf272e8ae), - SPH_C32(0xa6b8c28d) }, - { SPH_C32(0xb6ce0000), SPH_C32(0xdae90002), SPH_C32(0x156e8000), - SPH_C32(0xda920000), SPH_C32(0xf6dd5a64), SPH_C32(0x36325c8a), - SPH_C32(0xf272e8ae), SPH_C32(0xa6b8c28d), SPH_C32(0x86790000), - SPH_C32(0x3f390002), SPH_C32(0xe19ae000), SPH_C32(0x98560000), - SPH_C32(0x9565670e), SPH_C32(0x4e88c8ea), SPH_C32(0xd3dd4944), - SPH_C32(0x161ddab9) }, - { SPH_C32(0x14190000), SPH_C32(0x23ca003c), SPH_C32(0x50df0000), - SPH_C32(0x44b60000), SPH_C32(0x1b6c67b0), SPH_C32(0x3cf3ac75), - SPH_C32(0x61e610b0), SPH_C32(0xdbcadb80), SPH_C32(0xe3430000), - SPH_C32(0x3a4e0014), SPH_C32(0xf2c60000), SPH_C32(0xaa4e0000), - SPH_C32(0xdb1e42a6), SPH_C32(0x256bbe15), SPH_C32(0x123db156), - SPH_C32(0x3a4e99d7) }, - { SPH_C32(0x92600000), SPH_C32(0x1cf3003e), SPH_C32(0xb145e000), - SPH_C32(0xdce00000), SPH_C32(0x8e0900be), SPH_C32(0x727b649f), - SPH_C32(0xb23b59f4), SPH_C32(0xcdd70139), SPH_C32(0xd3f40000), - SPH_C32(0xdf9e0014), SPH_C32(0x06326000), SPH_C32(0xe88a0000), - SPH_C32(0xb8a67fcc), SPH_C32(0x5dd12a75), SPH_C32(0x339210bc), - SPH_C32(0x8aeb81e3) }, - { SPH_C32(0x24ae0000), SPH_C32(0xc61a003c), SPH_C32(0xa42b6000), - SPH_C32(0x06720000), SPH_C32(0x78d45ada), SPH_C32(0x44493815), - SPH_C32(0x4049b15a), SPH_C32(0x6b6fc3b4), SPH_C32(0x558d0000), - SPH_C32(0xe0a70016), SPH_C32(0xe7a88000), SPH_C32(0x70dc0000), - SPH_C32(0x2dc318c2), SPH_C32(0x1359e29f), SPH_C32(0xe04f59f8), - SPH_C32(0x9cf65b5a) }, - { SPH_C32(0xa2d70000), SPH_C32(0xf923003e), SPH_C32(0x45b18000), - SPH_C32(0x9e240000), SPH_C32(0xedb13dd4), SPH_C32(0x0ac1f0ff), - SPH_C32(0x9394f81e), SPH_C32(0x7d72190d), SPH_C32(0x653a0000), - SPH_C32(0x05770016), SPH_C32(0x135ce000), SPH_C32(0x32180000), - SPH_C32(0x4e7b25a8), SPH_C32(0x6be376ff), SPH_C32(0xc1e0f812), - SPH_C32(0x2c53436e) }, - { SPH_C32(0xe3430000), SPH_C32(0x3a4e0014), SPH_C32(0xf2c60000), - SPH_C32(0xaa4e0000), SPH_C32(0xdb1e42a6), SPH_C32(0x256bbe15), - SPH_C32(0x123db156), SPH_C32(0x3a4e99d7), SPH_C32(0xf75a0000), - SPH_C32(0x19840028), SPH_C32(0xa2190000), SPH_C32(0xeef80000), - SPH_C32(0xc0722516), SPH_C32(0x19981260), SPH_C32(0x73dba1e6), - SPH_C32(0xe1844257) }, - { SPH_C32(0x653a0000), SPH_C32(0x05770016), SPH_C32(0x135ce000), - SPH_C32(0x32180000), SPH_C32(0x4e7b25a8), SPH_C32(0x6be376ff), - SPH_C32(0xc1e0f812), SPH_C32(0x2c53436e), SPH_C32(0xc7ed0000), - SPH_C32(0xfc540028), SPH_C32(0x56ed6000), SPH_C32(0xac3c0000), - SPH_C32(0xa3ca187c), SPH_C32(0x61228600), SPH_C32(0x5274000c), - SPH_C32(0x51215a63) }, - { SPH_C32(0xd3f40000), SPH_C32(0xdf9e0014), SPH_C32(0x06326000), - SPH_C32(0xe88a0000), SPH_C32(0xb8a67fcc), SPH_C32(0x5dd12a75), - SPH_C32(0x339210bc), SPH_C32(0x8aeb81e3), SPH_C32(0x41940000), - SPH_C32(0xc36d002a), SPH_C32(0xb7778000), SPH_C32(0x346a0000), - SPH_C32(0x36af7f72), SPH_C32(0x2faa4eea), SPH_C32(0x81a94948), - SPH_C32(0x473c80da) }, - { SPH_C32(0x558d0000), SPH_C32(0xe0a70016), SPH_C32(0xe7a88000), - SPH_C32(0x70dc0000), SPH_C32(0x2dc318c2), SPH_C32(0x1359e29f), - SPH_C32(0xe04f59f8), SPH_C32(0x9cf65b5a), SPH_C32(0x71230000), - SPH_C32(0x26bd002a), SPH_C32(0x4383e000), SPH_C32(0x76ae0000), - SPH_C32(0x55174218), SPH_C32(0x5710da8a), SPH_C32(0xa006e8a2), - SPH_C32(0xf79998ee) }, - { SPH_C32(0xf75a0000), SPH_C32(0x19840028), SPH_C32(0xa2190000), - SPH_C32(0xeef80000), SPH_C32(0xc0722516), SPH_C32(0x19981260), - SPH_C32(0x73dba1e6), SPH_C32(0xe1844257), SPH_C32(0x14190000), - SPH_C32(0x23ca003c), SPH_C32(0x50df0000), SPH_C32(0x44b60000), - SPH_C32(0x1b6c67b0), SPH_C32(0x3cf3ac75), SPH_C32(0x61e610b0), - SPH_C32(0xdbcadb80) }, - { SPH_C32(0x71230000), SPH_C32(0x26bd002a), SPH_C32(0x4383e000), - SPH_C32(0x76ae0000), SPH_C32(0x55174218), SPH_C32(0x5710da8a), - SPH_C32(0xa006e8a2), SPH_C32(0xf79998ee), SPH_C32(0x24ae0000), - SPH_C32(0xc61a003c), SPH_C32(0xa42b6000), SPH_C32(0x06720000), - SPH_C32(0x78d45ada), SPH_C32(0x44493815), SPH_C32(0x4049b15a), - SPH_C32(0x6b6fc3b4) }, - { SPH_C32(0xc7ed0000), SPH_C32(0xfc540028), SPH_C32(0x56ed6000), - SPH_C32(0xac3c0000), SPH_C32(0xa3ca187c), SPH_C32(0x61228600), - SPH_C32(0x5274000c), SPH_C32(0x51215a63), SPH_C32(0xa2d70000), - SPH_C32(0xf923003e), SPH_C32(0x45b18000), SPH_C32(0x9e240000), - SPH_C32(0xedb13dd4), SPH_C32(0x0ac1f0ff), SPH_C32(0x9394f81e), - SPH_C32(0x7d72190d) }, - { SPH_C32(0x41940000), SPH_C32(0xc36d002a), SPH_C32(0xb7778000), - SPH_C32(0x346a0000), SPH_C32(0x36af7f72), SPH_C32(0x2faa4eea), - SPH_C32(0x81a94948), SPH_C32(0x473c80da), SPH_C32(0x92600000), - SPH_C32(0x1cf3003e), SPH_C32(0xb145e000), SPH_C32(0xdce00000), - SPH_C32(0x8e0900be), SPH_C32(0x727b649f), SPH_C32(0xb23b59f4), - SPH_C32(0xcdd70139) } -}; - -static const sph_u32 T512_32[16][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xac480000), SPH_C32(0x1ba60000), SPH_C32(0x45fb1380), - SPH_C32(0x03430000), SPH_C32(0x5a85316a), SPH_C32(0x1fb250b6), - SPH_C32(0xfe72c7fe), SPH_C32(0x91e478f6), SPH_C32(0x1e4e0000), - SPH_C32(0xdecf0000), SPH_C32(0x6df80180), SPH_C32(0x77240000), - SPH_C32(0xec47079e), SPH_C32(0xf4a0694e), SPH_C32(0xcda31812), - SPH_C32(0x98aa496e) }, - { SPH_C32(0x1e4e0000), SPH_C32(0xdecf0000), SPH_C32(0x6df80180), - SPH_C32(0x77240000), SPH_C32(0xec47079e), SPH_C32(0xf4a0694e), - SPH_C32(0xcda31812), SPH_C32(0x98aa496e), SPH_C32(0xb2060000), - SPH_C32(0xc5690000), SPH_C32(0x28031200), SPH_C32(0x74670000), - SPH_C32(0xb6c236f4), SPH_C32(0xeb1239f8), SPH_C32(0x33d1dfec), - SPH_C32(0x094e3198) }, - { SPH_C32(0xb2060000), SPH_C32(0xc5690000), SPH_C32(0x28031200), - SPH_C32(0x74670000), SPH_C32(0xb6c236f4), SPH_C32(0xeb1239f8), - SPH_C32(0x33d1dfec), SPH_C32(0x094e3198), SPH_C32(0xac480000), - SPH_C32(0x1ba60000), SPH_C32(0x45fb1380), SPH_C32(0x03430000), - SPH_C32(0x5a85316a), SPH_C32(0x1fb250b6), SPH_C32(0xfe72c7fe), - SPH_C32(0x91e478f6) }, - { SPH_C32(0xaec30000), SPH_C32(0x9c4f0001), SPH_C32(0x79d1e000), - SPH_C32(0x2c150000), SPH_C32(0x45cc75b3), SPH_C32(0x6650b736), - SPH_C32(0xab92f78f), SPH_C32(0xa312567b), SPH_C32(0xdb250000), - SPH_C32(0x09290000), SPH_C32(0x49aac000), SPH_C32(0x81e10000), - SPH_C32(0xcafe6b59), SPH_C32(0x42793431), SPH_C32(0x43566b76), - SPH_C32(0xe86cba2e) }, - { SPH_C32(0x028b0000), SPH_C32(0x87e90001), SPH_C32(0x3c2af380), - SPH_C32(0x2f560000), SPH_C32(0x1f4944d9), SPH_C32(0x79e2e780), - SPH_C32(0x55e03071), SPH_C32(0x32f62e8d), SPH_C32(0xc56b0000), - SPH_C32(0xd7e60000), SPH_C32(0x2452c180), SPH_C32(0xf6c50000), - SPH_C32(0x26b96cc7), SPH_C32(0xb6d95d7f), SPH_C32(0x8ef57364), - SPH_C32(0x70c6f340) }, - { SPH_C32(0xb08d0000), SPH_C32(0x42800001), SPH_C32(0x1429e180), - SPH_C32(0x5b310000), SPH_C32(0xa98b722d), SPH_C32(0x92f0de78), - SPH_C32(0x6631ef9d), SPH_C32(0x3bb81f15), SPH_C32(0x69230000), - SPH_C32(0xcc400000), SPH_C32(0x61a9d200), SPH_C32(0xf5860000), - SPH_C32(0x7c3c5dad), SPH_C32(0xa96b0dc9), SPH_C32(0x7087b49a), - SPH_C32(0xe1228bb6) }, - { SPH_C32(0x1cc50000), SPH_C32(0x59260001), SPH_C32(0x51d2f200), - SPH_C32(0x58720000), SPH_C32(0xf30e4347), SPH_C32(0x8d428ece), - SPH_C32(0x98432863), SPH_C32(0xaa5c67e3), SPH_C32(0x776d0000), - SPH_C32(0x128f0000), SPH_C32(0x0c51d380), SPH_C32(0x82a20000), - SPH_C32(0x907b5a33), SPH_C32(0x5dcb6487), SPH_C32(0xbd24ac88), - SPH_C32(0x7988c2d8) }, - { SPH_C32(0xdb250000), SPH_C32(0x09290000), SPH_C32(0x49aac000), - SPH_C32(0x81e10000), SPH_C32(0xcafe6b59), SPH_C32(0x42793431), - SPH_C32(0x43566b76), SPH_C32(0xe86cba2e), SPH_C32(0x75e60000), - SPH_C32(0x95660001), SPH_C32(0x307b2000), SPH_C32(0xadf40000), - SPH_C32(0x8f321eea), SPH_C32(0x24298307), SPH_C32(0xe8c49cf9), - SPH_C32(0x4b7eec55) }, - { SPH_C32(0x776d0000), SPH_C32(0x128f0000), SPH_C32(0x0c51d380), - SPH_C32(0x82a20000), SPH_C32(0x907b5a33), SPH_C32(0x5dcb6487), - SPH_C32(0xbd24ac88), SPH_C32(0x7988c2d8), SPH_C32(0x6ba80000), - SPH_C32(0x4ba90001), SPH_C32(0x5d832180), SPH_C32(0xdad00000), - SPH_C32(0x63751974), SPH_C32(0xd089ea49), SPH_C32(0x256784eb), - SPH_C32(0xd3d4a53b) }, - { SPH_C32(0xc56b0000), SPH_C32(0xd7e60000), SPH_C32(0x2452c180), - SPH_C32(0xf6c50000), SPH_C32(0x26b96cc7), SPH_C32(0xb6d95d7f), - SPH_C32(0x8ef57364), SPH_C32(0x70c6f340), SPH_C32(0xc7e00000), - SPH_C32(0x500f0001), SPH_C32(0x18783200), SPH_C32(0xd9930000), - SPH_C32(0x39f0281e), SPH_C32(0xcf3bbaff), SPH_C32(0xdb154315), - SPH_C32(0x4230ddcd) }, - { SPH_C32(0x69230000), SPH_C32(0xcc400000), SPH_C32(0x61a9d200), - SPH_C32(0xf5860000), SPH_C32(0x7c3c5dad), SPH_C32(0xa96b0dc9), - SPH_C32(0x7087b49a), SPH_C32(0xe1228bb6), SPH_C32(0xd9ae0000), - SPH_C32(0x8ec00001), SPH_C32(0x75803380), SPH_C32(0xaeb70000), - SPH_C32(0xd5b72f80), SPH_C32(0x3b9bd3b1), SPH_C32(0x16b65b07), - SPH_C32(0xda9a94a3) }, - { SPH_C32(0x75e60000), SPH_C32(0x95660001), SPH_C32(0x307b2000), - SPH_C32(0xadf40000), SPH_C32(0x8f321eea), SPH_C32(0x24298307), - SPH_C32(0xe8c49cf9), SPH_C32(0x4b7eec55), SPH_C32(0xaec30000), - SPH_C32(0x9c4f0001), SPH_C32(0x79d1e000), SPH_C32(0x2c150000), - SPH_C32(0x45cc75b3), SPH_C32(0x6650b736), SPH_C32(0xab92f78f), - SPH_C32(0xa312567b) }, - { SPH_C32(0xd9ae0000), SPH_C32(0x8ec00001), SPH_C32(0x75803380), - SPH_C32(0xaeb70000), SPH_C32(0xd5b72f80), SPH_C32(0x3b9bd3b1), - SPH_C32(0x16b65b07), SPH_C32(0xda9a94a3), SPH_C32(0xb08d0000), - SPH_C32(0x42800001), SPH_C32(0x1429e180), SPH_C32(0x5b310000), - SPH_C32(0xa98b722d), SPH_C32(0x92f0de78), SPH_C32(0x6631ef9d), - SPH_C32(0x3bb81f15) }, - { SPH_C32(0x6ba80000), SPH_C32(0x4ba90001), SPH_C32(0x5d832180), - SPH_C32(0xdad00000), SPH_C32(0x63751974), SPH_C32(0xd089ea49), - SPH_C32(0x256784eb), SPH_C32(0xd3d4a53b), SPH_C32(0x1cc50000), - SPH_C32(0x59260001), SPH_C32(0x51d2f200), SPH_C32(0x58720000), - SPH_C32(0xf30e4347), SPH_C32(0x8d428ece), SPH_C32(0x98432863), - SPH_C32(0xaa5c67e3) }, - { SPH_C32(0xc7e00000), SPH_C32(0x500f0001), SPH_C32(0x18783200), - SPH_C32(0xd9930000), SPH_C32(0x39f0281e), SPH_C32(0xcf3bbaff), - SPH_C32(0xdb154315), SPH_C32(0x4230ddcd), SPH_C32(0x028b0000), - SPH_C32(0x87e90001), SPH_C32(0x3c2af380), SPH_C32(0x2f560000), - SPH_C32(0x1f4944d9), SPH_C32(0x79e2e780), SPH_C32(0x55e03071), - SPH_C32(0x32f62e8d) } -}; - -static const sph_u32 T512_36[16][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xcc140000), SPH_C32(0xa5630000), SPH_C32(0x5ab90780), - SPH_C32(0x3b500000), SPH_C32(0x4bd013ff), SPH_C32(0x879b3418), - SPH_C32(0x694348c1), SPH_C32(0xca5a87fe), SPH_C32(0x819e0000), - SPH_C32(0xec570000), SPH_C32(0x66320280), SPH_C32(0x95f30000), - SPH_C32(0x5da92802), SPH_C32(0x48f43cbc), SPH_C32(0xe65aa22d), - SPH_C32(0x8e67b7fa) }, - { SPH_C32(0x819e0000), SPH_C32(0xec570000), SPH_C32(0x66320280), - SPH_C32(0x95f30000), SPH_C32(0x5da92802), SPH_C32(0x48f43cbc), - SPH_C32(0xe65aa22d), SPH_C32(0x8e67b7fa), SPH_C32(0x4d8a0000), - SPH_C32(0x49340000), SPH_C32(0x3c8b0500), SPH_C32(0xaea30000), - SPH_C32(0x16793bfd), SPH_C32(0xcf6f08a4), SPH_C32(0x8f19eaec), - SPH_C32(0x443d3004) }, - { SPH_C32(0x4d8a0000), SPH_C32(0x49340000), SPH_C32(0x3c8b0500), - SPH_C32(0xaea30000), SPH_C32(0x16793bfd), SPH_C32(0xcf6f08a4), - SPH_C32(0x8f19eaec), SPH_C32(0x443d3004), SPH_C32(0xcc140000), - SPH_C32(0xa5630000), SPH_C32(0x5ab90780), SPH_C32(0x3b500000), - SPH_C32(0x4bd013ff), SPH_C32(0x879b3418), SPH_C32(0x694348c1), - SPH_C32(0xca5a87fe) }, - { SPH_C32(0x78230000), SPH_C32(0x12fc0000), SPH_C32(0xa93a0b80), - SPH_C32(0x90a50000), SPH_C32(0x713e2879), SPH_C32(0x7ee98924), - SPH_C32(0xf08ca062), SPH_C32(0x636f8bab), SPH_C32(0x02af0000), - SPH_C32(0xb7280000), SPH_C32(0xba1c0300), SPH_C32(0x56980000), - SPH_C32(0xba8d45d3), SPH_C32(0x8048c667), SPH_C32(0xa95c149a), - SPH_C32(0xf4f6ea7b) }, - { SPH_C32(0xb4370000), SPH_C32(0xb79f0000), SPH_C32(0xf3830c00), - SPH_C32(0xabf50000), SPH_C32(0x3aee3b86), SPH_C32(0xf972bd3c), - SPH_C32(0x99cfe8a3), SPH_C32(0xa9350c55), SPH_C32(0x83310000), - SPH_C32(0x5b7f0000), SPH_C32(0xdc2e0180), SPH_C32(0xc36b0000), - SPH_C32(0xe7246dd1), SPH_C32(0xc8bcfadb), SPH_C32(0x4f06b6b7), - SPH_C32(0x7a915d81) }, - { SPH_C32(0xf9bd0000), SPH_C32(0xfeab0000), SPH_C32(0xcf080900), - SPH_C32(0x05560000), SPH_C32(0x2c97007b), SPH_C32(0x361db598), - SPH_C32(0x16d6024f), SPH_C32(0xed083c51), SPH_C32(0x4f250000), - SPH_C32(0xfe1c0000), SPH_C32(0x86970600), SPH_C32(0xf83b0000), - SPH_C32(0xacf47e2e), SPH_C32(0x4f27cec3), SPH_C32(0x2645fe76), - SPH_C32(0xb0cbda7f) }, - { SPH_C32(0x35a90000), SPH_C32(0x5bc80000), SPH_C32(0x95b10e80), - SPH_C32(0x3e060000), SPH_C32(0x67471384), SPH_C32(0xb1868180), - SPH_C32(0x7f954a8e), SPH_C32(0x2752bbaf), SPH_C32(0xcebb0000), - SPH_C32(0x124b0000), SPH_C32(0xe0a50480), SPH_C32(0x6dc80000), - SPH_C32(0xf15d562c), SPH_C32(0x07d3f27f), SPH_C32(0xc01f5c5b), - SPH_C32(0x3eac6d85) }, - { SPH_C32(0x02af0000), SPH_C32(0xb7280000), SPH_C32(0xba1c0300), - SPH_C32(0x56980000), SPH_C32(0xba8d45d3), SPH_C32(0x8048c667), - SPH_C32(0xa95c149a), SPH_C32(0xf4f6ea7b), SPH_C32(0x7a8c0000), - SPH_C32(0xa5d40000), SPH_C32(0x13260880), SPH_C32(0xc63d0000), - SPH_C32(0xcbb36daa), SPH_C32(0xfea14f43), SPH_C32(0x59d0b4f8), - SPH_C32(0x979961d0) }, - { SPH_C32(0xcebb0000), SPH_C32(0x124b0000), SPH_C32(0xe0a50480), - SPH_C32(0x6dc80000), SPH_C32(0xf15d562c), SPH_C32(0x07d3f27f), - SPH_C32(0xc01f5c5b), SPH_C32(0x3eac6d85), SPH_C32(0xfb120000), - SPH_C32(0x49830000), SPH_C32(0x75140a00), SPH_C32(0x53ce0000), - SPH_C32(0x961a45a8), SPH_C32(0xb65573ff), SPH_C32(0xbf8a16d5), - SPH_C32(0x19fed62a) }, - { SPH_C32(0x83310000), SPH_C32(0x5b7f0000), SPH_C32(0xdc2e0180), - SPH_C32(0xc36b0000), SPH_C32(0xe7246dd1), SPH_C32(0xc8bcfadb), - SPH_C32(0x4f06b6b7), SPH_C32(0x7a915d81), SPH_C32(0x37060000), - SPH_C32(0xece00000), SPH_C32(0x2fad0d80), SPH_C32(0x689e0000), - SPH_C32(0xddca5657), SPH_C32(0x31ce47e7), SPH_C32(0xd6c95e14), - SPH_C32(0xd3a451d4) }, - { SPH_C32(0x4f250000), SPH_C32(0xfe1c0000), SPH_C32(0x86970600), - SPH_C32(0xf83b0000), SPH_C32(0xacf47e2e), SPH_C32(0x4f27cec3), - SPH_C32(0x2645fe76), SPH_C32(0xb0cbda7f), SPH_C32(0xb6980000), - SPH_C32(0x00b70000), SPH_C32(0x499f0f00), SPH_C32(0xfd6d0000), - SPH_C32(0x80637e55), SPH_C32(0x793a7b5b), SPH_C32(0x3093fc39), - SPH_C32(0x5dc3e62e) }, - { SPH_C32(0x7a8c0000), SPH_C32(0xa5d40000), SPH_C32(0x13260880), - SPH_C32(0xc63d0000), SPH_C32(0xcbb36daa), SPH_C32(0xfea14f43), - SPH_C32(0x59d0b4f8), SPH_C32(0x979961d0), SPH_C32(0x78230000), - SPH_C32(0x12fc0000), SPH_C32(0xa93a0b80), SPH_C32(0x90a50000), - SPH_C32(0x713e2879), SPH_C32(0x7ee98924), SPH_C32(0xf08ca062), - SPH_C32(0x636f8bab) }, - { SPH_C32(0xb6980000), SPH_C32(0x00b70000), SPH_C32(0x499f0f00), - SPH_C32(0xfd6d0000), SPH_C32(0x80637e55), SPH_C32(0x793a7b5b), - SPH_C32(0x3093fc39), SPH_C32(0x5dc3e62e), SPH_C32(0xf9bd0000), - SPH_C32(0xfeab0000), SPH_C32(0xcf080900), SPH_C32(0x05560000), - SPH_C32(0x2c97007b), SPH_C32(0x361db598), SPH_C32(0x16d6024f), - SPH_C32(0xed083c51) }, - { SPH_C32(0xfb120000), SPH_C32(0x49830000), SPH_C32(0x75140a00), - SPH_C32(0x53ce0000), SPH_C32(0x961a45a8), SPH_C32(0xb65573ff), - SPH_C32(0xbf8a16d5), SPH_C32(0x19fed62a), SPH_C32(0x35a90000), - SPH_C32(0x5bc80000), SPH_C32(0x95b10e80), SPH_C32(0x3e060000), - SPH_C32(0x67471384), SPH_C32(0xb1868180), SPH_C32(0x7f954a8e), - SPH_C32(0x2752bbaf) }, - { SPH_C32(0x37060000), SPH_C32(0xece00000), SPH_C32(0x2fad0d80), - SPH_C32(0x689e0000), SPH_C32(0xddca5657), SPH_C32(0x31ce47e7), - SPH_C32(0xd6c95e14), SPH_C32(0xd3a451d4), SPH_C32(0xb4370000), - SPH_C32(0xb79f0000), SPH_C32(0xf3830c00), SPH_C32(0xabf50000), - SPH_C32(0x3aee3b86), SPH_C32(0xf972bd3c), SPH_C32(0x99cfe8a3), - SPH_C32(0xa9350c55) } -}; - -static const sph_u32 T512_40[16][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x88980000), SPH_C32(0x1f940000), SPH_C32(0x7fcf002e), - SPH_C32(0xfb4e0000), SPH_C32(0xf158079a), SPH_C32(0x61ae9167), - SPH_C32(0xa895706c), SPH_C32(0xe6107494), SPH_C32(0x0bc20000), - SPH_C32(0xdb630000), SPH_C32(0x7e88000c), SPH_C32(0x15860000), - SPH_C32(0x91fd48f3), SPH_C32(0x7581bb43), SPH_C32(0xf460449e), - SPH_C32(0xd8b61463) }, - { SPH_C32(0x0bc20000), SPH_C32(0xdb630000), SPH_C32(0x7e88000c), - SPH_C32(0x15860000), SPH_C32(0x91fd48f3), SPH_C32(0x7581bb43), - SPH_C32(0xf460449e), SPH_C32(0xd8b61463), SPH_C32(0x835a0000), - SPH_C32(0xc4f70000), SPH_C32(0x01470022), SPH_C32(0xeec80000), - SPH_C32(0x60a54f69), SPH_C32(0x142f2a24), SPH_C32(0x5cf534f2), - SPH_C32(0x3ea660f7) }, - { SPH_C32(0x835a0000), SPH_C32(0xc4f70000), SPH_C32(0x01470022), - SPH_C32(0xeec80000), SPH_C32(0x60a54f69), SPH_C32(0x142f2a24), - SPH_C32(0x5cf534f2), SPH_C32(0x3ea660f7), SPH_C32(0x88980000), - SPH_C32(0x1f940000), SPH_C32(0x7fcf002e), SPH_C32(0xfb4e0000), - SPH_C32(0xf158079a), SPH_C32(0x61ae9167), SPH_C32(0xa895706c), - SPH_C32(0xe6107494) }, - { SPH_C32(0x52500000), SPH_C32(0x29540000), SPH_C32(0x6a61004e), - SPH_C32(0xf0ff0000), SPH_C32(0x9a317eec), SPH_C32(0x452341ce), - SPH_C32(0xcf568fe5), SPH_C32(0x5303130f), SPH_C32(0x538d0000), - SPH_C32(0xa9fc0000), SPH_C32(0x9ef70006), SPH_C32(0x56ff0000), - SPH_C32(0x0ae4004e), SPH_C32(0x92c5cdf9), SPH_C32(0xa9444018), - SPH_C32(0x7f975691) }, - { SPH_C32(0xdac80000), SPH_C32(0x36c00000), SPH_C32(0x15ae0060), - SPH_C32(0x0bb10000), SPH_C32(0x6b697976), SPH_C32(0x248dd0a9), - SPH_C32(0x67c3ff89), SPH_C32(0xb513679b), SPH_C32(0x584f0000), - SPH_C32(0x729f0000), SPH_C32(0xe07f000a), SPH_C32(0x43790000), - SPH_C32(0x9b1948bd), SPH_C32(0xe74476ba), SPH_C32(0x5d240486), - SPH_C32(0xa72142f2) }, - { SPH_C32(0x59920000), SPH_C32(0xf2370000), SPH_C32(0x14e90042), - SPH_C32(0xe5790000), SPH_C32(0x0bcc361f), SPH_C32(0x30a2fa8d), - SPH_C32(0x3b36cb7b), SPH_C32(0x8bb5076c), SPH_C32(0xd0d70000), - SPH_C32(0x6d0b0000), SPH_C32(0x9fb00024), SPH_C32(0xb8370000), - SPH_C32(0x6a414f27), SPH_C32(0x86eae7dd), SPH_C32(0xf5b174ea), - SPH_C32(0x41313666) }, - { SPH_C32(0xd10a0000), SPH_C32(0xeda30000), SPH_C32(0x6b26006c), - SPH_C32(0x1e370000), SPH_C32(0xfa943185), SPH_C32(0x510c6bea), - SPH_C32(0x93a3bb17), SPH_C32(0x6da573f8), SPH_C32(0xdb150000), - SPH_C32(0xb6680000), SPH_C32(0xe1380028), SPH_C32(0xadb10000), - SPH_C32(0xfbbc07d4), SPH_C32(0xf36b5c9e), SPH_C32(0x01d13074), - SPH_C32(0x99872205) }, - { SPH_C32(0x538d0000), SPH_C32(0xa9fc0000), SPH_C32(0x9ef70006), - SPH_C32(0x56ff0000), SPH_C32(0x0ae4004e), SPH_C32(0x92c5cdf9), - SPH_C32(0xa9444018), SPH_C32(0x7f975691), SPH_C32(0x01dd0000), - SPH_C32(0x80a80000), SPH_C32(0xf4960048), SPH_C32(0xa6000000), - SPH_C32(0x90d57ea2), SPH_C32(0xd7e68c37), SPH_C32(0x6612cffd), - SPH_C32(0x2c94459e) }, - { SPH_C32(0xdb150000), SPH_C32(0xb6680000), SPH_C32(0xe1380028), - SPH_C32(0xadb10000), SPH_C32(0xfbbc07d4), SPH_C32(0xf36b5c9e), - SPH_C32(0x01d13074), SPH_C32(0x99872205), SPH_C32(0x0a1f0000), - SPH_C32(0x5bcb0000), SPH_C32(0x8a1e0044), SPH_C32(0xb3860000), - SPH_C32(0x01283651), SPH_C32(0xa2673774), SPH_C32(0x92728b63), - SPH_C32(0xf42251fd) }, - { SPH_C32(0x584f0000), SPH_C32(0x729f0000), SPH_C32(0xe07f000a), - SPH_C32(0x43790000), SPH_C32(0x9b1948bd), SPH_C32(0xe74476ba), - SPH_C32(0x5d240486), SPH_C32(0xa72142f2), SPH_C32(0x82870000), - SPH_C32(0x445f0000), SPH_C32(0xf5d1006a), SPH_C32(0x48c80000), - SPH_C32(0xf07031cb), SPH_C32(0xc3c9a613), SPH_C32(0x3ae7fb0f), - SPH_C32(0x12322569) }, - { SPH_C32(0xd0d70000), SPH_C32(0x6d0b0000), SPH_C32(0x9fb00024), - SPH_C32(0xb8370000), SPH_C32(0x6a414f27), SPH_C32(0x86eae7dd), - SPH_C32(0xf5b174ea), SPH_C32(0x41313666), SPH_C32(0x89450000), - SPH_C32(0x9f3c0000), SPH_C32(0x8b590066), SPH_C32(0x5d4e0000), - SPH_C32(0x618d7938), SPH_C32(0xb6481d50), SPH_C32(0xce87bf91), - SPH_C32(0xca84310a) }, - { SPH_C32(0x01dd0000), SPH_C32(0x80a80000), SPH_C32(0xf4960048), - SPH_C32(0xa6000000), SPH_C32(0x90d57ea2), SPH_C32(0xd7e68c37), - SPH_C32(0x6612cffd), SPH_C32(0x2c94459e), SPH_C32(0x52500000), - SPH_C32(0x29540000), SPH_C32(0x6a61004e), SPH_C32(0xf0ff0000), - SPH_C32(0x9a317eec), SPH_C32(0x452341ce), SPH_C32(0xcf568fe5), - SPH_C32(0x5303130f) }, - { SPH_C32(0x89450000), SPH_C32(0x9f3c0000), SPH_C32(0x8b590066), - SPH_C32(0x5d4e0000), SPH_C32(0x618d7938), SPH_C32(0xb6481d50), - SPH_C32(0xce87bf91), SPH_C32(0xca84310a), SPH_C32(0x59920000), - SPH_C32(0xf2370000), SPH_C32(0x14e90042), SPH_C32(0xe5790000), - SPH_C32(0x0bcc361f), SPH_C32(0x30a2fa8d), SPH_C32(0x3b36cb7b), - SPH_C32(0x8bb5076c) }, - { SPH_C32(0x0a1f0000), SPH_C32(0x5bcb0000), SPH_C32(0x8a1e0044), - SPH_C32(0xb3860000), SPH_C32(0x01283651), SPH_C32(0xa2673774), - SPH_C32(0x92728b63), SPH_C32(0xf42251fd), SPH_C32(0xd10a0000), - SPH_C32(0xeda30000), SPH_C32(0x6b26006c), SPH_C32(0x1e370000), - SPH_C32(0xfa943185), SPH_C32(0x510c6bea), SPH_C32(0x93a3bb17), - SPH_C32(0x6da573f8) }, - { SPH_C32(0x82870000), SPH_C32(0x445f0000), SPH_C32(0xf5d1006a), - SPH_C32(0x48c80000), SPH_C32(0xf07031cb), SPH_C32(0xc3c9a613), - SPH_C32(0x3ae7fb0f), SPH_C32(0x12322569), SPH_C32(0xdac80000), - SPH_C32(0x36c00000), SPH_C32(0x15ae0060), SPH_C32(0x0bb10000), - SPH_C32(0x6b697976), SPH_C32(0x248dd0a9), SPH_C32(0x67c3ff89), - SPH_C32(0xb513679b) } -}; - -static const sph_u32 T512_44[16][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x58430000), SPH_C32(0x807e0000), SPH_C32(0x78330001), - SPH_C32(0xc66b3800), SPH_C32(0xe7375cdc), SPH_C32(0x79ad3fdd), - SPH_C32(0xac73fe6f), SPH_C32(0x3a4479b1), SPH_C32(0x1d5a0000), - SPH_C32(0x2b720000), SPH_C32(0x488d0000), SPH_C32(0xaf611800), - SPH_C32(0x25cb2ec5), SPH_C32(0xc879bfd0), SPH_C32(0x81a20429), - SPH_C32(0x1e7536a6) }, - { SPH_C32(0x1d5a0000), SPH_C32(0x2b720000), SPH_C32(0x488d0000), - SPH_C32(0xaf611800), SPH_C32(0x25cb2ec5), SPH_C32(0xc879bfd0), - SPH_C32(0x81a20429), SPH_C32(0x1e7536a6), SPH_C32(0x45190000), - SPH_C32(0xab0c0000), SPH_C32(0x30be0001), SPH_C32(0x690a2000), - SPH_C32(0xc2fc7219), SPH_C32(0xb1d4800d), SPH_C32(0x2dd1fa46), - SPH_C32(0x24314f17) }, - { SPH_C32(0x45190000), SPH_C32(0xab0c0000), SPH_C32(0x30be0001), - SPH_C32(0x690a2000), SPH_C32(0xc2fc7219), SPH_C32(0xb1d4800d), - SPH_C32(0x2dd1fa46), SPH_C32(0x24314f17), SPH_C32(0x58430000), - SPH_C32(0x807e0000), SPH_C32(0x78330001), SPH_C32(0xc66b3800), - SPH_C32(0xe7375cdc), SPH_C32(0x79ad3fdd), SPH_C32(0xac73fe6f), - SPH_C32(0x3a4479b1) }, - { SPH_C32(0xa53b0000), SPH_C32(0x14260000), SPH_C32(0x4e30001e), - SPH_C32(0x7cae0000), SPH_C32(0x8f9e0dd5), SPH_C32(0x78dfaa3d), - SPH_C32(0xf73168d8), SPH_C32(0x0b1b4946), SPH_C32(0x07ed0000), - SPH_C32(0xb2500000), SPH_C32(0x8774000a), SPH_C32(0x970d0000), - SPH_C32(0x437223ae), SPH_C32(0x48c76ea4), SPH_C32(0xf4786222), - SPH_C32(0x9075b1ce) }, - { SPH_C32(0xfd780000), SPH_C32(0x94580000), SPH_C32(0x3603001f), - SPH_C32(0xbac53800), SPH_C32(0x68a95109), SPH_C32(0x017295e0), - SPH_C32(0x5b4296b7), SPH_C32(0x315f30f7), SPH_C32(0x1ab70000), - SPH_C32(0x99220000), SPH_C32(0xcff9000a), SPH_C32(0x386c1800), - SPH_C32(0x66b90d6b), SPH_C32(0x80bed174), SPH_C32(0x75da660b), - SPH_C32(0x8e008768) }, - { SPH_C32(0xb8610000), SPH_C32(0x3f540000), SPH_C32(0x06bd001e), - SPH_C32(0xd3cf1800), SPH_C32(0xaa552310), SPH_C32(0xb0a615ed), - SPH_C32(0x76936cf1), SPH_C32(0x156e7fe0), SPH_C32(0x42f40000), - SPH_C32(0x195c0000), SPH_C32(0xb7ca000b), SPH_C32(0xfe072000), - SPH_C32(0x818e51b7), SPH_C32(0xf913eea9), SPH_C32(0xd9a99864), - SPH_C32(0xb444fed9) }, - { SPH_C32(0xe0220000), SPH_C32(0xbf2a0000), SPH_C32(0x7e8e001f), - SPH_C32(0x15a42000), SPH_C32(0x4d627fcc), SPH_C32(0xc90b2a30), - SPH_C32(0xdae0929e), SPH_C32(0x2f2a0651), SPH_C32(0x5fae0000), - SPH_C32(0x322e0000), SPH_C32(0xff47000b), SPH_C32(0x51663800), - SPH_C32(0xa4457f72), SPH_C32(0x316a5179), SPH_C32(0x580b9c4d), - SPH_C32(0xaa31c87f) }, - { SPH_C32(0x07ed0000), SPH_C32(0xb2500000), SPH_C32(0x8774000a), - SPH_C32(0x970d0000), SPH_C32(0x437223ae), SPH_C32(0x48c76ea4), - SPH_C32(0xf4786222), SPH_C32(0x9075b1ce), SPH_C32(0xa2d60000), - SPH_C32(0xa6760000), SPH_C32(0xc9440014), SPH_C32(0xeba30000), - SPH_C32(0xccec2e7b), SPH_C32(0x3018c499), SPH_C32(0x03490afa), - SPH_C32(0x9b6ef888) }, - { SPH_C32(0x5fae0000), SPH_C32(0x322e0000), SPH_C32(0xff47000b), - SPH_C32(0x51663800), SPH_C32(0xa4457f72), SPH_C32(0x316a5179), - SPH_C32(0x580b9c4d), SPH_C32(0xaa31c87f), SPH_C32(0xbf8c0000), - SPH_C32(0x8d040000), SPH_C32(0x81c90014), SPH_C32(0x44c21800), - SPH_C32(0xe92700be), SPH_C32(0xf8617b49), SPH_C32(0x82eb0ed3), - SPH_C32(0x851bce2e) }, - { SPH_C32(0x1ab70000), SPH_C32(0x99220000), SPH_C32(0xcff9000a), - SPH_C32(0x386c1800), SPH_C32(0x66b90d6b), SPH_C32(0x80bed174), - SPH_C32(0x75da660b), SPH_C32(0x8e008768), SPH_C32(0xe7cf0000), - SPH_C32(0x0d7a0000), SPH_C32(0xf9fa0015), SPH_C32(0x82a92000), - SPH_C32(0x0e105c62), SPH_C32(0x81cc4494), SPH_C32(0x2e98f0bc), - SPH_C32(0xbf5fb79f) }, - { SPH_C32(0x42f40000), SPH_C32(0x195c0000), SPH_C32(0xb7ca000b), - SPH_C32(0xfe072000), SPH_C32(0x818e51b7), SPH_C32(0xf913eea9), - SPH_C32(0xd9a99864), SPH_C32(0xb444fed9), SPH_C32(0xfa950000), - SPH_C32(0x26080000), SPH_C32(0xb1770015), SPH_C32(0x2dc83800), - SPH_C32(0x2bdb72a7), SPH_C32(0x49b5fb44), SPH_C32(0xaf3af495), - SPH_C32(0xa12a8139) }, - { SPH_C32(0xa2d60000), SPH_C32(0xa6760000), SPH_C32(0xc9440014), - SPH_C32(0xeba30000), SPH_C32(0xccec2e7b), SPH_C32(0x3018c499), - SPH_C32(0x03490afa), SPH_C32(0x9b6ef888), SPH_C32(0xa53b0000), - SPH_C32(0x14260000), SPH_C32(0x4e30001e), SPH_C32(0x7cae0000), - SPH_C32(0x8f9e0dd5), SPH_C32(0x78dfaa3d), SPH_C32(0xf73168d8), - SPH_C32(0x0b1b4946) }, - { SPH_C32(0xfa950000), SPH_C32(0x26080000), SPH_C32(0xb1770015), - SPH_C32(0x2dc83800), SPH_C32(0x2bdb72a7), SPH_C32(0x49b5fb44), - SPH_C32(0xaf3af495), SPH_C32(0xa12a8139), SPH_C32(0xb8610000), - SPH_C32(0x3f540000), SPH_C32(0x06bd001e), SPH_C32(0xd3cf1800), - SPH_C32(0xaa552310), SPH_C32(0xb0a615ed), SPH_C32(0x76936cf1), - SPH_C32(0x156e7fe0) }, - { SPH_C32(0xbf8c0000), SPH_C32(0x8d040000), SPH_C32(0x81c90014), - SPH_C32(0x44c21800), SPH_C32(0xe92700be), SPH_C32(0xf8617b49), - SPH_C32(0x82eb0ed3), SPH_C32(0x851bce2e), SPH_C32(0xe0220000), - SPH_C32(0xbf2a0000), SPH_C32(0x7e8e001f), SPH_C32(0x15a42000), - SPH_C32(0x4d627fcc), SPH_C32(0xc90b2a30), SPH_C32(0xdae0929e), - SPH_C32(0x2f2a0651) }, - { SPH_C32(0xe7cf0000), SPH_C32(0x0d7a0000), SPH_C32(0xf9fa0015), - SPH_C32(0x82a92000), SPH_C32(0x0e105c62), SPH_C32(0x81cc4494), - SPH_C32(0x2e98f0bc), SPH_C32(0xbf5fb79f), SPH_C32(0xfd780000), - SPH_C32(0x94580000), SPH_C32(0x3603001f), SPH_C32(0xbac53800), - SPH_C32(0x68a95109), SPH_C32(0x017295e0), SPH_C32(0x5b4296b7), - SPH_C32(0x315f30f7) } -}; - -static const sph_u32 T512_48[16][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x02f20000), SPH_C32(0xa2810000), SPH_C32(0x873f0000), - SPH_C32(0xe36c7800), SPH_C32(0x1e1d74ef), SPH_C32(0x073d2bd6), - SPH_C32(0xc4c23237), SPH_C32(0x7f32259e), SPH_C32(0xbadd0000), - SPH_C32(0x13ad0000), SPH_C32(0xb7e70000), SPH_C32(0xf7282800), - SPH_C32(0xdf45144d), SPH_C32(0x361ac33a), SPH_C32(0xea5a8d14), - SPH_C32(0x2a2c18f0) }, - { SPH_C32(0xbadd0000), SPH_C32(0x13ad0000), SPH_C32(0xb7e70000), - SPH_C32(0xf7282800), SPH_C32(0xdf45144d), SPH_C32(0x361ac33a), - SPH_C32(0xea5a8d14), SPH_C32(0x2a2c18f0), SPH_C32(0xb82f0000), - SPH_C32(0xb12c0000), SPH_C32(0x30d80000), SPH_C32(0x14445000), - SPH_C32(0xc15860a2), SPH_C32(0x3127e8ec), SPH_C32(0x2e98bf23), - SPH_C32(0x551e3d6e) }, - { SPH_C32(0xb82f0000), SPH_C32(0xb12c0000), SPH_C32(0x30d80000), - SPH_C32(0x14445000), SPH_C32(0xc15860a2), SPH_C32(0x3127e8ec), - SPH_C32(0x2e98bf23), SPH_C32(0x551e3d6e), SPH_C32(0x02f20000), - SPH_C32(0xa2810000), SPH_C32(0x873f0000), SPH_C32(0xe36c7800), - SPH_C32(0x1e1d74ef), SPH_C32(0x073d2bd6), SPH_C32(0xc4c23237), - SPH_C32(0x7f32259e) }, - { SPH_C32(0x1e6c0000), SPH_C32(0xc4420000), SPH_C32(0x8a2e0000), - SPH_C32(0xbcb6b800), SPH_C32(0x2c4413b6), SPH_C32(0x8bfdd3da), - SPH_C32(0x6a0c1bc8), SPH_C32(0xb99dc2eb), SPH_C32(0x92560000), - SPH_C32(0x1eda0000), SPH_C32(0xea510000), SPH_C32(0xe8b13000), - SPH_C32(0xa93556a5), SPH_C32(0xebfb6199), SPH_C32(0xb15c2254), - SPH_C32(0x33c5244f) }, - { SPH_C32(0x1c9e0000), SPH_C32(0x66c30000), SPH_C32(0x0d110000), - SPH_C32(0x5fdac000), SPH_C32(0x32596759), SPH_C32(0x8cc0f80c), - SPH_C32(0xaece29ff), SPH_C32(0xc6afe775), SPH_C32(0x288b0000), - SPH_C32(0x0d770000), SPH_C32(0x5db60000), SPH_C32(0x1f991800), - SPH_C32(0x767042e8), SPH_C32(0xdde1a2a3), SPH_C32(0x5b06af40), - SPH_C32(0x19e93cbf) }, - { SPH_C32(0xa4b10000), SPH_C32(0xd7ef0000), SPH_C32(0x3dc90000), - SPH_C32(0x4b9e9000), SPH_C32(0xf30107fb), SPH_C32(0xbde710e0), - SPH_C32(0x805696dc), SPH_C32(0x93b1da1b), SPH_C32(0x2a790000), - SPH_C32(0xaff60000), SPH_C32(0xda890000), SPH_C32(0xfcf56000), - SPH_C32(0x686d3607), SPH_C32(0xdadc8975), SPH_C32(0x9fc49d77), - SPH_C32(0x66db1921) }, - { SPH_C32(0xa6430000), SPH_C32(0x756e0000), SPH_C32(0xbaf60000), - SPH_C32(0xa8f2e800), SPH_C32(0xed1c7314), SPH_C32(0xbada3b36), - SPH_C32(0x4494a4eb), SPH_C32(0xec83ff85), SPH_C32(0x90a40000), - SPH_C32(0xbc5b0000), SPH_C32(0x6d6e0000), SPH_C32(0x0bdd4800), - SPH_C32(0xb728224a), SPH_C32(0xecc64a4f), SPH_C32(0x759e1063), - SPH_C32(0x4cf701d1) }, - { SPH_C32(0x92560000), SPH_C32(0x1eda0000), SPH_C32(0xea510000), - SPH_C32(0xe8b13000), SPH_C32(0xa93556a5), SPH_C32(0xebfb6199), - SPH_C32(0xb15c2254), SPH_C32(0x33c5244f), SPH_C32(0x8c3a0000), - SPH_C32(0xda980000), SPH_C32(0x607f0000), SPH_C32(0x54078800), - SPH_C32(0x85714513), SPH_C32(0x6006b243), SPH_C32(0xdb50399c), - SPH_C32(0x8a58e6a4) }, - { SPH_C32(0x90a40000), SPH_C32(0xbc5b0000), SPH_C32(0x6d6e0000), - SPH_C32(0x0bdd4800), SPH_C32(0xb728224a), SPH_C32(0xecc64a4f), - SPH_C32(0x759e1063), SPH_C32(0x4cf701d1), SPH_C32(0x36e70000), - SPH_C32(0xc9350000), SPH_C32(0xd7980000), SPH_C32(0xa32fa000), - SPH_C32(0x5a34515e), SPH_C32(0x561c7179), SPH_C32(0x310ab488), - SPH_C32(0xa074fe54) }, - { SPH_C32(0x288b0000), SPH_C32(0x0d770000), SPH_C32(0x5db60000), - SPH_C32(0x1f991800), SPH_C32(0x767042e8), SPH_C32(0xdde1a2a3), - SPH_C32(0x5b06af40), SPH_C32(0x19e93cbf), SPH_C32(0x34150000), - SPH_C32(0x6bb40000), SPH_C32(0x50a70000), SPH_C32(0x4043d800), - SPH_C32(0x442925b1), SPH_C32(0x51215aaf), SPH_C32(0xf5c886bf), - SPH_C32(0xdf46dbca) }, - { SPH_C32(0x2a790000), SPH_C32(0xaff60000), SPH_C32(0xda890000), - SPH_C32(0xfcf56000), SPH_C32(0x686d3607), SPH_C32(0xdadc8975), - SPH_C32(0x9fc49d77), SPH_C32(0x66db1921), SPH_C32(0x8ec80000), - SPH_C32(0x78190000), SPH_C32(0xe7400000), SPH_C32(0xb76bf000), - SPH_C32(0x9b6c31fc), SPH_C32(0x673b9995), SPH_C32(0x1f920bab), - SPH_C32(0xf56ac33a) }, - { SPH_C32(0x8c3a0000), SPH_C32(0xda980000), SPH_C32(0x607f0000), - SPH_C32(0x54078800), SPH_C32(0x85714513), SPH_C32(0x6006b243), - SPH_C32(0xdb50399c), SPH_C32(0x8a58e6a4), SPH_C32(0x1e6c0000), - SPH_C32(0xc4420000), SPH_C32(0x8a2e0000), SPH_C32(0xbcb6b800), - SPH_C32(0x2c4413b6), SPH_C32(0x8bfdd3da), SPH_C32(0x6a0c1bc8), - SPH_C32(0xb99dc2eb) }, - { SPH_C32(0x8ec80000), SPH_C32(0x78190000), SPH_C32(0xe7400000), - SPH_C32(0xb76bf000), SPH_C32(0x9b6c31fc), SPH_C32(0x673b9995), - SPH_C32(0x1f920bab), SPH_C32(0xf56ac33a), SPH_C32(0xa4b10000), - SPH_C32(0xd7ef0000), SPH_C32(0x3dc90000), SPH_C32(0x4b9e9000), - SPH_C32(0xf30107fb), SPH_C32(0xbde710e0), SPH_C32(0x805696dc), - SPH_C32(0x93b1da1b) }, - { SPH_C32(0x36e70000), SPH_C32(0xc9350000), SPH_C32(0xd7980000), - SPH_C32(0xa32fa000), SPH_C32(0x5a34515e), SPH_C32(0x561c7179), - SPH_C32(0x310ab488), SPH_C32(0xa074fe54), SPH_C32(0xa6430000), - SPH_C32(0x756e0000), SPH_C32(0xbaf60000), SPH_C32(0xa8f2e800), - SPH_C32(0xed1c7314), SPH_C32(0xbada3b36), SPH_C32(0x4494a4eb), - SPH_C32(0xec83ff85) }, - { SPH_C32(0x34150000), SPH_C32(0x6bb40000), SPH_C32(0x50a70000), - SPH_C32(0x4043d800), SPH_C32(0x442925b1), SPH_C32(0x51215aaf), - SPH_C32(0xf5c886bf), SPH_C32(0xdf46dbca), SPH_C32(0x1c9e0000), - SPH_C32(0x66c30000), SPH_C32(0x0d110000), SPH_C32(0x5fdac000), - SPH_C32(0x32596759), SPH_C32(0x8cc0f80c), SPH_C32(0xaece29ff), - SPH_C32(0xc6afe775) } -}; - -static const sph_u32 T512_52[16][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xe6280000), SPH_C32(0x4c4b0000), SPH_C32(0xa8550000), - SPH_C32(0xd3d002e0), SPH_C32(0xd86130b8), SPH_C32(0x98a7b0da), - SPH_C32(0x289506b4), SPH_C32(0xd75a4897), SPH_C32(0xf0c50000), - SPH_C32(0x59230000), SPH_C32(0x45820000), SPH_C32(0xe18d00c0), - SPH_C32(0x3b6d0631), SPH_C32(0xc2ed5699), SPH_C32(0xcbe0fe1c), - SPH_C32(0x56a7b19f) }, - { SPH_C32(0xf0c50000), SPH_C32(0x59230000), SPH_C32(0x45820000), - SPH_C32(0xe18d00c0), SPH_C32(0x3b6d0631), SPH_C32(0xc2ed5699), - SPH_C32(0xcbe0fe1c), SPH_C32(0x56a7b19f), SPH_C32(0x16ed0000), - SPH_C32(0x15680000), SPH_C32(0xedd70000), SPH_C32(0x325d0220), - SPH_C32(0xe30c3689), SPH_C32(0x5a4ae643), SPH_C32(0xe375f8a8), - SPH_C32(0x81fdf908) }, - { SPH_C32(0x16ed0000), SPH_C32(0x15680000), SPH_C32(0xedd70000), - SPH_C32(0x325d0220), SPH_C32(0xe30c3689), SPH_C32(0x5a4ae643), - SPH_C32(0xe375f8a8), SPH_C32(0x81fdf908), SPH_C32(0xe6280000), - SPH_C32(0x4c4b0000), SPH_C32(0xa8550000), SPH_C32(0xd3d002e0), - SPH_C32(0xd86130b8), SPH_C32(0x98a7b0da), SPH_C32(0x289506b4), - SPH_C32(0xd75a4897) }, - { SPH_C32(0xb4310000), SPH_C32(0x77330000), SPH_C32(0xb15d0000), - SPH_C32(0x7fd004e0), SPH_C32(0x78a26138), SPH_C32(0xd116c35d), - SPH_C32(0xd256d489), SPH_C32(0x4e6f74de), SPH_C32(0xe3060000), - SPH_C32(0xbdc10000), SPH_C32(0x87130000), SPH_C32(0xbff20060), - SPH_C32(0x2eba0a1a), SPH_C32(0x8db53751), SPH_C32(0x73c5ab06), - SPH_C32(0x5bd61539) }, - { SPH_C32(0x52190000), SPH_C32(0x3b780000), SPH_C32(0x19080000), - SPH_C32(0xac000600), SPH_C32(0xa0c35180), SPH_C32(0x49b17387), - SPH_C32(0xfac3d23d), SPH_C32(0x99353c49), SPH_C32(0x13c30000), - SPH_C32(0xe4e20000), SPH_C32(0xc2910000), SPH_C32(0x5e7f00a0), - SPH_C32(0x15d70c2b), SPH_C32(0x4f5861c8), SPH_C32(0xb825551a), - SPH_C32(0x0d71a4a6) }, - { SPH_C32(0x44f40000), SPH_C32(0x2e100000), SPH_C32(0xf4df0000), - SPH_C32(0x9e5d0420), SPH_C32(0x43cf6709), SPH_C32(0x13fb95c4), - SPH_C32(0x19b62a95), SPH_C32(0x18c8c541), SPH_C32(0xf5eb0000), - SPH_C32(0xa8a90000), SPH_C32(0x6ac40000), SPH_C32(0x8daf0240), - SPH_C32(0xcdb63c93), SPH_C32(0xd7ffd112), SPH_C32(0x90b053ae), - SPH_C32(0xda2bec31) }, - { SPH_C32(0xa2dc0000), SPH_C32(0x625b0000), SPH_C32(0x5c8a0000), - SPH_C32(0x4d8d06c0), SPH_C32(0x9bae57b1), SPH_C32(0x8b5c251e), - SPH_C32(0x31232c21), SPH_C32(0xcf928dd6), SPH_C32(0x052e0000), - SPH_C32(0xf18a0000), SPH_C32(0x2f460000), SPH_C32(0x6c220280), - SPH_C32(0xf6db3aa2), SPH_C32(0x1512878b), SPH_C32(0x5b50adb2), - SPH_C32(0x8c8c5dae) }, - { SPH_C32(0xe3060000), SPH_C32(0xbdc10000), SPH_C32(0x87130000), - SPH_C32(0xbff20060), SPH_C32(0x2eba0a1a), SPH_C32(0x8db53751), - SPH_C32(0x73c5ab06), SPH_C32(0x5bd61539), SPH_C32(0x57370000), - SPH_C32(0xcaf20000), SPH_C32(0x364e0000), SPH_C32(0xc0220480), - SPH_C32(0x56186b22), SPH_C32(0x5ca3f40c), SPH_C32(0xa1937f8f), - SPH_C32(0x15b961e7) }, - { SPH_C32(0x052e0000), SPH_C32(0xf18a0000), SPH_C32(0x2f460000), - SPH_C32(0x6c220280), SPH_C32(0xf6db3aa2), SPH_C32(0x1512878b), - SPH_C32(0x5b50adb2), SPH_C32(0x8c8c5dae), SPH_C32(0xa7f20000), - SPH_C32(0x93d10000), SPH_C32(0x73cc0000), SPH_C32(0x21af0440), - SPH_C32(0x6d756d13), SPH_C32(0x9e4ea295), SPH_C32(0x6a738193), - SPH_C32(0x431ed078) }, - { SPH_C32(0x13c30000), SPH_C32(0xe4e20000), SPH_C32(0xc2910000), - SPH_C32(0x5e7f00a0), SPH_C32(0x15d70c2b), SPH_C32(0x4f5861c8), - SPH_C32(0xb825551a), SPH_C32(0x0d71a4a6), SPH_C32(0x41da0000), - SPH_C32(0xdf9a0000), SPH_C32(0xdb990000), SPH_C32(0xf27f06a0), - SPH_C32(0xb5145dab), SPH_C32(0x06e9124f), SPH_C32(0x42e68727), - SPH_C32(0x944498ef) }, - { SPH_C32(0xf5eb0000), SPH_C32(0xa8a90000), SPH_C32(0x6ac40000), - SPH_C32(0x8daf0240), SPH_C32(0xcdb63c93), SPH_C32(0xd7ffd112), - SPH_C32(0x90b053ae), SPH_C32(0xda2bec31), SPH_C32(0xb11f0000), - SPH_C32(0x86b90000), SPH_C32(0x9e1b0000), SPH_C32(0x13f20660), - SPH_C32(0x8e795b9a), SPH_C32(0xc40444d6), SPH_C32(0x8906793b), - SPH_C32(0xc2e32970) }, - { SPH_C32(0x57370000), SPH_C32(0xcaf20000), SPH_C32(0x364e0000), - SPH_C32(0xc0220480), SPH_C32(0x56186b22), SPH_C32(0x5ca3f40c), - SPH_C32(0xa1937f8f), SPH_C32(0x15b961e7), SPH_C32(0xb4310000), - SPH_C32(0x77330000), SPH_C32(0xb15d0000), SPH_C32(0x7fd004e0), - SPH_C32(0x78a26138), SPH_C32(0xd116c35d), SPH_C32(0xd256d489), - SPH_C32(0x4e6f74de) }, - { SPH_C32(0xb11f0000), SPH_C32(0x86b90000), SPH_C32(0x9e1b0000), - SPH_C32(0x13f20660), SPH_C32(0x8e795b9a), SPH_C32(0xc40444d6), - SPH_C32(0x8906793b), SPH_C32(0xc2e32970), SPH_C32(0x44f40000), - SPH_C32(0x2e100000), SPH_C32(0xf4df0000), SPH_C32(0x9e5d0420), - SPH_C32(0x43cf6709), SPH_C32(0x13fb95c4), SPH_C32(0x19b62a95), - SPH_C32(0x18c8c541) }, - { SPH_C32(0xa7f20000), SPH_C32(0x93d10000), SPH_C32(0x73cc0000), - SPH_C32(0x21af0440), SPH_C32(0x6d756d13), SPH_C32(0x9e4ea295), - SPH_C32(0x6a738193), SPH_C32(0x431ed078), SPH_C32(0xa2dc0000), - SPH_C32(0x625b0000), SPH_C32(0x5c8a0000), SPH_C32(0x4d8d06c0), - SPH_C32(0x9bae57b1), SPH_C32(0x8b5c251e), SPH_C32(0x31232c21), - SPH_C32(0xcf928dd6) }, - { SPH_C32(0x41da0000), SPH_C32(0xdf9a0000), SPH_C32(0xdb990000), - SPH_C32(0xf27f06a0), SPH_C32(0xb5145dab), SPH_C32(0x06e9124f), - SPH_C32(0x42e68727), SPH_C32(0x944498ef), SPH_C32(0x52190000), - SPH_C32(0x3b780000), SPH_C32(0x19080000), SPH_C32(0xac000600), - SPH_C32(0xa0c35180), SPH_C32(0x49b17387), SPH_C32(0xfac3d23d), - SPH_C32(0x99353c49) } -}; - -static const sph_u32 T512_56[16][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x5fa80000), SPH_C32(0x56030000), SPH_C32(0x43ae0000), - SPH_C32(0x64f30013), SPH_C32(0x257e86bf), SPH_C32(0x1311944e), - SPH_C32(0x541e95bf), SPH_C32(0x8ea4db69), SPH_C32(0x00440000), - SPH_C32(0x7f480000), SPH_C32(0xda7c0000), SPH_C32(0x2a230001), - SPH_C32(0x3badc9cc), SPH_C32(0xa9b69c87), SPH_C32(0x030a9e60), - SPH_C32(0xbe0a679e) }, - { SPH_C32(0x00440000), SPH_C32(0x7f480000), SPH_C32(0xda7c0000), - SPH_C32(0x2a230001), SPH_C32(0x3badc9cc), SPH_C32(0xa9b69c87), - SPH_C32(0x030a9e60), SPH_C32(0xbe0a679e), SPH_C32(0x5fec0000), - SPH_C32(0x294b0000), SPH_C32(0x99d20000), SPH_C32(0x4ed00012), - SPH_C32(0x1ed34f73), SPH_C32(0xbaa708c9), SPH_C32(0x57140bdf), - SPH_C32(0x30aebcf7) }, - { SPH_C32(0x5fec0000), SPH_C32(0x294b0000), SPH_C32(0x99d20000), - SPH_C32(0x4ed00012), SPH_C32(0x1ed34f73), SPH_C32(0xbaa708c9), - SPH_C32(0x57140bdf), SPH_C32(0x30aebcf7), SPH_C32(0x5fa80000), - SPH_C32(0x56030000), SPH_C32(0x43ae0000), SPH_C32(0x64f30013), - SPH_C32(0x257e86bf), SPH_C32(0x1311944e), SPH_C32(0x541e95bf), - SPH_C32(0x8ea4db69) }, - { SPH_C32(0xee930000), SPH_C32(0xd6070000), SPH_C32(0x92c10000), - SPH_C32(0x2b9801e0), SPH_C32(0x9451287c), SPH_C32(0x3b6cfb57), - SPH_C32(0x45312374), SPH_C32(0x201f6a64), SPH_C32(0x7b280000), - SPH_C32(0x57420000), SPH_C32(0xa9e50000), SPH_C32(0x634300a0), - SPH_C32(0x9edb442f), SPH_C32(0x6d9995bb), SPH_C32(0x27f83b03), - SPH_C32(0xc7ff60f0) }, - { SPH_C32(0xb13b0000), SPH_C32(0x80040000), SPH_C32(0xd16f0000), - SPH_C32(0x4f6b01f3), SPH_C32(0xb12faec3), SPH_C32(0x287d6f19), - SPH_C32(0x112fb6cb), SPH_C32(0xaebbb10d), SPH_C32(0x7b6c0000), - SPH_C32(0x280a0000), SPH_C32(0x73990000), SPH_C32(0x496000a1), - SPH_C32(0xa5768de3), SPH_C32(0xc42f093c), SPH_C32(0x24f2a563), - SPH_C32(0x79f5076e) }, - { SPH_C32(0xeed70000), SPH_C32(0xa94f0000), SPH_C32(0x48bd0000), - SPH_C32(0x01bb01e1), SPH_C32(0xaffce1b0), SPH_C32(0x92da67d0), - SPH_C32(0x463bbd14), SPH_C32(0x9e150dfa), SPH_C32(0x24c40000), - SPH_C32(0x7e090000), SPH_C32(0x30370000), SPH_C32(0x2d9300b2), - SPH_C32(0x80080b5c), SPH_C32(0xd73e9d72), SPH_C32(0x70ec30dc), - SPH_C32(0xf751dc07) }, - { SPH_C32(0xb17f0000), SPH_C32(0xff4c0000), SPH_C32(0x0b130000), - SPH_C32(0x654801f2), SPH_C32(0x8a82670f), SPH_C32(0x81cbf39e), - SPH_C32(0x122528ab), SPH_C32(0x10b1d693), SPH_C32(0x24800000), - SPH_C32(0x01410000), SPH_C32(0xea4b0000), SPH_C32(0x07b000b3), - SPH_C32(0xbba5c290), SPH_C32(0x7e8801f5), SPH_C32(0x73e6aebc), - SPH_C32(0x495bbb99) }, - { SPH_C32(0x7b280000), SPH_C32(0x57420000), SPH_C32(0xa9e50000), - SPH_C32(0x634300a0), SPH_C32(0x9edb442f), SPH_C32(0x6d9995bb), - SPH_C32(0x27f83b03), SPH_C32(0xc7ff60f0), SPH_C32(0x95bb0000), - SPH_C32(0x81450000), SPH_C32(0x3b240000), SPH_C32(0x48db0140), - SPH_C32(0x0a8a6c53), SPH_C32(0x56f56eec), SPH_C32(0x62c91877), - SPH_C32(0xe7e00a94) }, - { SPH_C32(0x24800000), SPH_C32(0x01410000), SPH_C32(0xea4b0000), - SPH_C32(0x07b000b3), SPH_C32(0xbba5c290), SPH_C32(0x7e8801f5), - SPH_C32(0x73e6aebc), SPH_C32(0x495bbb99), SPH_C32(0x95ff0000), - SPH_C32(0xfe0d0000), SPH_C32(0xe1580000), SPH_C32(0x62f80141), - SPH_C32(0x3127a59f), SPH_C32(0xff43f26b), SPH_C32(0x61c38617), - SPH_C32(0x59ea6d0a) }, - { SPH_C32(0x7b6c0000), SPH_C32(0x280a0000), SPH_C32(0x73990000), - SPH_C32(0x496000a1), SPH_C32(0xa5768de3), SPH_C32(0xc42f093c), - SPH_C32(0x24f2a563), SPH_C32(0x79f5076e), SPH_C32(0xca570000), - SPH_C32(0xa80e0000), SPH_C32(0xa2f60000), SPH_C32(0x060b0152), - SPH_C32(0x14592320), SPH_C32(0xec526625), SPH_C32(0x35dd13a8), - SPH_C32(0xd74eb663) }, - { SPH_C32(0x24c40000), SPH_C32(0x7e090000), SPH_C32(0x30370000), - SPH_C32(0x2d9300b2), SPH_C32(0x80080b5c), SPH_C32(0xd73e9d72), - SPH_C32(0x70ec30dc), SPH_C32(0xf751dc07), SPH_C32(0xca130000), - SPH_C32(0xd7460000), SPH_C32(0x788a0000), SPH_C32(0x2c280153), - SPH_C32(0x2ff4eaec), SPH_C32(0x45e4faa2), SPH_C32(0x36d78dc8), - SPH_C32(0x6944d1fd) }, - { SPH_C32(0x95bb0000), SPH_C32(0x81450000), SPH_C32(0x3b240000), - SPH_C32(0x48db0140), SPH_C32(0x0a8a6c53), SPH_C32(0x56f56eec), - SPH_C32(0x62c91877), SPH_C32(0xe7e00a94), SPH_C32(0xee930000), - SPH_C32(0xd6070000), SPH_C32(0x92c10000), SPH_C32(0x2b9801e0), - SPH_C32(0x9451287c), SPH_C32(0x3b6cfb57), SPH_C32(0x45312374), - SPH_C32(0x201f6a64) }, - { SPH_C32(0xca130000), SPH_C32(0xd7460000), SPH_C32(0x788a0000), - SPH_C32(0x2c280153), SPH_C32(0x2ff4eaec), SPH_C32(0x45e4faa2), - SPH_C32(0x36d78dc8), SPH_C32(0x6944d1fd), SPH_C32(0xeed70000), - SPH_C32(0xa94f0000), SPH_C32(0x48bd0000), SPH_C32(0x01bb01e1), - SPH_C32(0xaffce1b0), SPH_C32(0x92da67d0), SPH_C32(0x463bbd14), - SPH_C32(0x9e150dfa) }, - { SPH_C32(0x95ff0000), SPH_C32(0xfe0d0000), SPH_C32(0xe1580000), - SPH_C32(0x62f80141), SPH_C32(0x3127a59f), SPH_C32(0xff43f26b), - SPH_C32(0x61c38617), SPH_C32(0x59ea6d0a), SPH_C32(0xb17f0000), - SPH_C32(0xff4c0000), SPH_C32(0x0b130000), SPH_C32(0x654801f2), - SPH_C32(0x8a82670f), SPH_C32(0x81cbf39e), SPH_C32(0x122528ab), - SPH_C32(0x10b1d693) }, - { SPH_C32(0xca570000), SPH_C32(0xa80e0000), SPH_C32(0xa2f60000), - SPH_C32(0x060b0152), SPH_C32(0x14592320), SPH_C32(0xec526625), - SPH_C32(0x35dd13a8), SPH_C32(0xd74eb663), SPH_C32(0xb13b0000), - SPH_C32(0x80040000), SPH_C32(0xd16f0000), SPH_C32(0x4f6b01f3), - SPH_C32(0xb12faec3), SPH_C32(0x287d6f19), SPH_C32(0x112fb6cb), - SPH_C32(0xaebbb10d) } -}; - -static const sph_u32 T512_60[16][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x033d0000), SPH_C32(0x08b30000), SPH_C32(0xf33a0000), - SPH_C32(0x3ac20007), SPH_C32(0x51298a50), SPH_C32(0x6b6e661f), - SPH_C32(0x0ea5cfe3), SPH_C32(0xe6da7ffe), SPH_C32(0xa8da0000), - SPH_C32(0x96be0000), SPH_C32(0x5c1d0000), SPH_C32(0x07da0002), - SPH_C32(0x7d669583), SPH_C32(0x1f98708a), SPH_C32(0xbb668808), - SPH_C32(0xda878000) }, - { SPH_C32(0xa8da0000), SPH_C32(0x96be0000), SPH_C32(0x5c1d0000), - SPH_C32(0x07da0002), SPH_C32(0x7d669583), SPH_C32(0x1f98708a), - SPH_C32(0xbb668808), SPH_C32(0xda878000), SPH_C32(0xabe70000), - SPH_C32(0x9e0d0000), SPH_C32(0xaf270000), SPH_C32(0x3d180005), - SPH_C32(0x2c4f1fd3), SPH_C32(0x74f61695), SPH_C32(0xb5c347eb), - SPH_C32(0x3c5dfffe) }, - { SPH_C32(0xabe70000), SPH_C32(0x9e0d0000), SPH_C32(0xaf270000), - SPH_C32(0x3d180005), SPH_C32(0x2c4f1fd3), SPH_C32(0x74f61695), - SPH_C32(0xb5c347eb), SPH_C32(0x3c5dfffe), SPH_C32(0x033d0000), - SPH_C32(0x08b30000), SPH_C32(0xf33a0000), SPH_C32(0x3ac20007), - SPH_C32(0x51298a50), SPH_C32(0x6b6e661f), SPH_C32(0x0ea5cfe3), - SPH_C32(0xe6da7ffe) }, - { SPH_C32(0x01930000), SPH_C32(0xe7820000), SPH_C32(0xedfb0000), - SPH_C32(0xcf0c000b), SPH_C32(0x8dd08d58), SPH_C32(0xbca3b42e), - SPH_C32(0x063661e1), SPH_C32(0x536f9e7b), SPH_C32(0x92280000), - SPH_C32(0xdc850000), SPH_C32(0x57fa0000), SPH_C32(0x56dc0003), - SPH_C32(0xbae92316), SPH_C32(0x5aefa30c), SPH_C32(0x90cef752), - SPH_C32(0x7b1675d7) }, - { SPH_C32(0x02ae0000), SPH_C32(0xef310000), SPH_C32(0x1ec10000), - SPH_C32(0xf5ce000c), SPH_C32(0xdcf90708), SPH_C32(0xd7cdd231), - SPH_C32(0x0893ae02), SPH_C32(0xb5b5e185), SPH_C32(0x3af20000), - SPH_C32(0x4a3b0000), SPH_C32(0x0be70000), SPH_C32(0x51060001), - SPH_C32(0xc78fb695), SPH_C32(0x4577d386), SPH_C32(0x2ba87f5a), - SPH_C32(0xa191f5d7) }, - { SPH_C32(0xa9490000), SPH_C32(0x713c0000), SPH_C32(0xb1e60000), - SPH_C32(0xc8d60009), SPH_C32(0xf0b618db), SPH_C32(0xa33bc4a4), - SPH_C32(0xbd50e9e9), SPH_C32(0x89e81e7b), SPH_C32(0x39cf0000), - SPH_C32(0x42880000), SPH_C32(0xf8dd0000), SPH_C32(0x6bc40006), - SPH_C32(0x96a63cc5), SPH_C32(0x2e19b599), SPH_C32(0x250db0b9), - SPH_C32(0x474b8a29) }, - { SPH_C32(0xaa740000), SPH_C32(0x798f0000), SPH_C32(0x42dc0000), - SPH_C32(0xf214000e), SPH_C32(0xa19f928b), SPH_C32(0xc855a2bb), - SPH_C32(0xb3f5260a), SPH_C32(0x6f326185), SPH_C32(0x91150000), - SPH_C32(0xd4360000), SPH_C32(0xa4c00000), SPH_C32(0x6c1e0004), - SPH_C32(0xebc0a946), SPH_C32(0x3181c513), SPH_C32(0x9e6b38b1), - SPH_C32(0x9dcc0a29) }, - { SPH_C32(0x92280000), SPH_C32(0xdc850000), SPH_C32(0x57fa0000), - SPH_C32(0x56dc0003), SPH_C32(0xbae92316), SPH_C32(0x5aefa30c), - SPH_C32(0x90cef752), SPH_C32(0x7b1675d7), SPH_C32(0x93bb0000), - SPH_C32(0x3b070000), SPH_C32(0xba010000), SPH_C32(0x99d00008), - SPH_C32(0x3739ae4e), SPH_C32(0xe64c1722), SPH_C32(0x96f896b3), - SPH_C32(0x2879ebac) }, - { SPH_C32(0x91150000), SPH_C32(0xd4360000), SPH_C32(0xa4c00000), - SPH_C32(0x6c1e0004), SPH_C32(0xebc0a946), SPH_C32(0x3181c513), - SPH_C32(0x9e6b38b1), SPH_C32(0x9dcc0a29), SPH_C32(0x3b610000), - SPH_C32(0xadb90000), SPH_C32(0xe61c0000), SPH_C32(0x9e0a000a), - SPH_C32(0x4a5f3bcd), SPH_C32(0xf9d467a8), SPH_C32(0x2d9e1ebb), - SPH_C32(0xf2fe6bac) }, - { SPH_C32(0x3af20000), SPH_C32(0x4a3b0000), SPH_C32(0x0be70000), - SPH_C32(0x51060001), SPH_C32(0xc78fb695), SPH_C32(0x4577d386), - SPH_C32(0x2ba87f5a), SPH_C32(0xa191f5d7), SPH_C32(0x385c0000), - SPH_C32(0xa50a0000), SPH_C32(0x15260000), SPH_C32(0xa4c8000d), - SPH_C32(0x1b76b19d), SPH_C32(0x92ba01b7), SPH_C32(0x233bd158), - SPH_C32(0x14241452) }, - { SPH_C32(0x39cf0000), SPH_C32(0x42880000), SPH_C32(0xf8dd0000), - SPH_C32(0x6bc40006), SPH_C32(0x96a63cc5), SPH_C32(0x2e19b599), - SPH_C32(0x250db0b9), SPH_C32(0x474b8a29), SPH_C32(0x90860000), - SPH_C32(0x33b40000), SPH_C32(0x493b0000), SPH_C32(0xa312000f), - SPH_C32(0x6610241e), SPH_C32(0x8d22713d), SPH_C32(0x985d5950), - SPH_C32(0xcea39452) }, - { SPH_C32(0x93bb0000), SPH_C32(0x3b070000), SPH_C32(0xba010000), - SPH_C32(0x99d00008), SPH_C32(0x3739ae4e), SPH_C32(0xe64c1722), - SPH_C32(0x96f896b3), SPH_C32(0x2879ebac), SPH_C32(0x01930000), - SPH_C32(0xe7820000), SPH_C32(0xedfb0000), SPH_C32(0xcf0c000b), - SPH_C32(0x8dd08d58), SPH_C32(0xbca3b42e), SPH_C32(0x063661e1), - SPH_C32(0x536f9e7b) }, - { SPH_C32(0x90860000), SPH_C32(0x33b40000), SPH_C32(0x493b0000), - SPH_C32(0xa312000f), SPH_C32(0x6610241e), SPH_C32(0x8d22713d), - SPH_C32(0x985d5950), SPH_C32(0xcea39452), SPH_C32(0xa9490000), - SPH_C32(0x713c0000), SPH_C32(0xb1e60000), SPH_C32(0xc8d60009), - SPH_C32(0xf0b618db), SPH_C32(0xa33bc4a4), SPH_C32(0xbd50e9e9), - SPH_C32(0x89e81e7b) }, - { SPH_C32(0x3b610000), SPH_C32(0xadb90000), SPH_C32(0xe61c0000), - SPH_C32(0x9e0a000a), SPH_C32(0x4a5f3bcd), SPH_C32(0xf9d467a8), - SPH_C32(0x2d9e1ebb), SPH_C32(0xf2fe6bac), SPH_C32(0xaa740000), - SPH_C32(0x798f0000), SPH_C32(0x42dc0000), SPH_C32(0xf214000e), - SPH_C32(0xa19f928b), SPH_C32(0xc855a2bb), SPH_C32(0xb3f5260a), - SPH_C32(0x6f326185) }, - { SPH_C32(0x385c0000), SPH_C32(0xa50a0000), SPH_C32(0x15260000), - SPH_C32(0xa4c8000d), SPH_C32(0x1b76b19d), SPH_C32(0x92ba01b7), - SPH_C32(0x233bd158), SPH_C32(0x14241452), SPH_C32(0x02ae0000), - SPH_C32(0xef310000), SPH_C32(0x1ec10000), SPH_C32(0xf5ce000c), - SPH_C32(0xdcf90708), SPH_C32(0xd7cdd231), SPH_C32(0x0893ae02), - SPH_C32(0xb5b5e185) } -}; - -#define INPUT_BIG do { \ - unsigned acc = buf[0]; \ - const sph_u32 *rp; \ - rp = &T512_0[acc >> 4][0]; \ - m0 = rp[0]; \ - m1 = rp[1]; \ - m2 = rp[2]; \ - m3 = rp[3]; \ - m4 = rp[4]; \ - m5 = rp[5]; \ - m6 = rp[6]; \ - m7 = rp[7]; \ - m8 = rp[8]; \ - m9 = rp[9]; \ - mA = rp[10]; \ - mB = rp[11]; \ - mC = rp[12]; \ - mD = rp[13]; \ - mE = rp[14]; \ - mF = rp[15]; \ - rp = &T512_4[acc & 0x0f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[1]; \ - rp = &T512_8[acc >> 4][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_12[acc & 0x0f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[2]; \ - rp = &T512_16[acc >> 4][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_20[acc & 0x0f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[3]; \ - rp = &T512_24[acc >> 4][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_28[acc & 0x0f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[4]; \ - rp = &T512_32[acc >> 4][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_36[acc & 0x0f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[5]; \ - rp = &T512_40[acc >> 4][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_44[acc & 0x0f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[6]; \ - rp = &T512_48[acc >> 4][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_52[acc & 0x0f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[7]; \ - rp = &T512_56[acc >> 4][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_60[acc & 0x0f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - } while (0) - -#endif - -#if SPH_HAMSI_EXPAND_BIG == 5 - -static const sph_u32 T512_0[32][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x23671400), SPH_C32(0xc8b90000), SPH_C32(0xf4c70000), - SPH_C32(0xfb750000), SPH_C32(0x73cd2465), SPH_C32(0xf8a6a549), - SPH_C32(0x02c40a3f), SPH_C32(0xdc24e61f), SPH_C32(0x373d2800), - SPH_C32(0x71500000), SPH_C32(0x95e00000), SPH_C32(0x0a140000), - SPH_C32(0xbdac1909), SPH_C32(0x48ef9831), SPH_C32(0x456d6d1f), - SPH_C32(0x3daac2da) }, - { SPH_C32(0x54285c00), SPH_C32(0xeaed0000), SPH_C32(0xc5d60000), - SPH_C32(0xa1c50000), SPH_C32(0xb3a26770), SPH_C32(0x94a5c4e1), - SPH_C32(0x6bb0419d), SPH_C32(0x551b3782), SPH_C32(0x9cbb1800), - SPH_C32(0xb0d30000), SPH_C32(0x92510000), SPH_C32(0xed930000), - SPH_C32(0x593a4345), SPH_C32(0xe114d5f4), SPH_C32(0x430633da), - SPH_C32(0x78cace29) }, - { SPH_C32(0x774f4800), SPH_C32(0x22540000), SPH_C32(0x31110000), - SPH_C32(0x5ab00000), SPH_C32(0xc06f4315), SPH_C32(0x6c0361a8), - SPH_C32(0x69744ba2), SPH_C32(0x893fd19d), SPH_C32(0xab863000), - SPH_C32(0xc1830000), SPH_C32(0x07b10000), SPH_C32(0xe7870000), - SPH_C32(0xe4965a4c), SPH_C32(0xa9fb4dc5), SPH_C32(0x066b5ec5), - SPH_C32(0x45600cf3) }, - { SPH_C32(0x9cbb1800), SPH_C32(0xb0d30000), SPH_C32(0x92510000), - SPH_C32(0xed930000), SPH_C32(0x593a4345), SPH_C32(0xe114d5f4), - SPH_C32(0x430633da), SPH_C32(0x78cace29), SPH_C32(0xc8934400), - SPH_C32(0x5a3e0000), SPH_C32(0x57870000), SPH_C32(0x4c560000), - SPH_C32(0xea982435), SPH_C32(0x75b11115), SPH_C32(0x28b67247), - SPH_C32(0x2dd1f9ab) }, - { SPH_C32(0xbfdc0c00), SPH_C32(0x786a0000), SPH_C32(0x66960000), - SPH_C32(0x16e60000), SPH_C32(0x2af76720), SPH_C32(0x19b270bd), - SPH_C32(0x41c239e5), SPH_C32(0xa4ee2836), SPH_C32(0xffae6c00), - SPH_C32(0x2b6e0000), SPH_C32(0xc2670000), SPH_C32(0x46420000), - SPH_C32(0x57343d3c), SPH_C32(0x3d5e8924), SPH_C32(0x6ddb1f58), - SPH_C32(0x107b3b71) }, - { SPH_C32(0xc8934400), SPH_C32(0x5a3e0000), SPH_C32(0x57870000), - SPH_C32(0x4c560000), SPH_C32(0xea982435), SPH_C32(0x75b11115), - SPH_C32(0x28b67247), SPH_C32(0x2dd1f9ab), SPH_C32(0x54285c00), - SPH_C32(0xeaed0000), SPH_C32(0xc5d60000), SPH_C32(0xa1c50000), - SPH_C32(0xb3a26770), SPH_C32(0x94a5c4e1), SPH_C32(0x6bb0419d), - SPH_C32(0x551b3782) }, - { SPH_C32(0xebf45000), SPH_C32(0x92870000), SPH_C32(0xa3400000), - SPH_C32(0xb7230000), SPH_C32(0x99550050), SPH_C32(0x8d17b45c), - SPH_C32(0x2a727878), SPH_C32(0xf1f51fb4), SPH_C32(0x63157400), - SPH_C32(0x9bbd0000), SPH_C32(0x50360000), SPH_C32(0xabd10000), - SPH_C32(0x0e0e7e79), SPH_C32(0xdc4a5cd0), SPH_C32(0x2edd2c82), - SPH_C32(0x68b1f558) }, - { SPH_C32(0x29449c00), SPH_C32(0x64e70000), SPH_C32(0xf24b0000), - SPH_C32(0xc2f30000), SPH_C32(0x0ede4e8f), SPH_C32(0x56c23745), - SPH_C32(0xf3e04259), SPH_C32(0x8d0d9ec4), SPH_C32(0x466d0c00), - SPH_C32(0x08620000), SPH_C32(0xdd5d0000), SPH_C32(0xbadd0000), - SPH_C32(0x6a927942), SPH_C32(0x441f2b93), SPH_C32(0x218ace6f), - SPH_C32(0xbf2c0be2) }, - { SPH_C32(0x0a238800), SPH_C32(0xac5e0000), SPH_C32(0x068c0000), - SPH_C32(0x39860000), SPH_C32(0x7d136aea), SPH_C32(0xae64920c), - SPH_C32(0xf1244866), SPH_C32(0x512978db), SPH_C32(0x71502400), - SPH_C32(0x79320000), SPH_C32(0x48bd0000), SPH_C32(0xb0c90000), - SPH_C32(0xd73e604b), SPH_C32(0x0cf0b3a2), SPH_C32(0x64e7a370), - SPH_C32(0x8286c938) }, - { SPH_C32(0x7d6cc000), SPH_C32(0x8e0a0000), SPH_C32(0x379d0000), - SPH_C32(0x63360000), SPH_C32(0xbd7c29ff), SPH_C32(0xc267f3a4), - SPH_C32(0x985003c4), SPH_C32(0xd816a946), SPH_C32(0xdad61400), - SPH_C32(0xb8b10000), SPH_C32(0x4f0c0000), SPH_C32(0x574e0000), - SPH_C32(0x33a83a07), SPH_C32(0xa50bfe67), SPH_C32(0x628cfdb5), - SPH_C32(0xc7e6c5cb) }, - { SPH_C32(0x5e0bd400), SPH_C32(0x46b30000), SPH_C32(0xc35a0000), - SPH_C32(0x98430000), SPH_C32(0xceb10d9a), SPH_C32(0x3ac156ed), - SPH_C32(0x9a9409fb), SPH_C32(0x04324f59), SPH_C32(0xedeb3c00), - SPH_C32(0xc9e10000), SPH_C32(0xdaec0000), SPH_C32(0x5d5a0000), - SPH_C32(0x8e04230e), SPH_C32(0xede46656), SPH_C32(0x27e190aa), - SPH_C32(0xfa4c0711) }, - { SPH_C32(0xb5ff8400), SPH_C32(0xd4340000), SPH_C32(0x601a0000), - SPH_C32(0x2f600000), SPH_C32(0x57e40dca), SPH_C32(0xb7d6e2b1), - SPH_C32(0xb0e67183), SPH_C32(0xf5c750ed), SPH_C32(0x8efe4800), - SPH_C32(0x525c0000), SPH_C32(0x8ada0000), SPH_C32(0xf68b0000), - SPH_C32(0x800a5d77), SPH_C32(0x31ae3a86), SPH_C32(0x093cbc28), - SPH_C32(0x92fdf249) }, - { SPH_C32(0x96989000), SPH_C32(0x1c8d0000), SPH_C32(0x94dd0000), - SPH_C32(0xd4150000), SPH_C32(0x242929af), SPH_C32(0x4f7047f8), - SPH_C32(0xb2227bbc), SPH_C32(0x29e3b6f2), SPH_C32(0xb9c36000), - SPH_C32(0x230c0000), SPH_C32(0x1f3a0000), SPH_C32(0xfc9f0000), - SPH_C32(0x3da6447e), SPH_C32(0x7941a2b7), SPH_C32(0x4c51d137), - SPH_C32(0xaf573093) }, - { SPH_C32(0xe1d7d800), SPH_C32(0x3ed90000), SPH_C32(0xa5cc0000), - SPH_C32(0x8ea50000), SPH_C32(0xe4466aba), SPH_C32(0x23732650), - SPH_C32(0xdb56301e), SPH_C32(0xa0dc676f), SPH_C32(0x12455000), - SPH_C32(0xe28f0000), SPH_C32(0x188b0000), SPH_C32(0x1b180000), - SPH_C32(0xd9301e32), SPH_C32(0xd0baef72), SPH_C32(0x4a3a8ff2), - SPH_C32(0xea373c60) }, - { SPH_C32(0xc2b0cc00), SPH_C32(0xf6600000), SPH_C32(0x510b0000), - SPH_C32(0x75d00000), SPH_C32(0x978b4edf), SPH_C32(0xdbd58319), - SPH_C32(0xd9923a21), SPH_C32(0x7cf88170), SPH_C32(0x25787800), - SPH_C32(0x93df0000), SPH_C32(0x8d6b0000), SPH_C32(0x110c0000), - SPH_C32(0x649c073b), SPH_C32(0x98557743), SPH_C32(0x0f57e2ed), - SPH_C32(0xd79dfeba) }, - { SPH_C32(0x466d0c00), SPH_C32(0x08620000), SPH_C32(0xdd5d0000), - SPH_C32(0xbadd0000), SPH_C32(0x6a927942), SPH_C32(0x441f2b93), - SPH_C32(0x218ace6f), SPH_C32(0xbf2c0be2), SPH_C32(0x6f299000), - SPH_C32(0x6c850000), SPH_C32(0x2f160000), SPH_C32(0x782e0000), - SPH_C32(0x644c37cd), SPH_C32(0x12dd1cd6), SPH_C32(0xd26a8c36), - SPH_C32(0x32219526) }, - { SPH_C32(0x650a1800), SPH_C32(0xc0db0000), SPH_C32(0x299a0000), - SPH_C32(0x41a80000), SPH_C32(0x195f5d27), SPH_C32(0xbcb98eda), - SPH_C32(0x234ec450), SPH_C32(0x6308edfd), SPH_C32(0x5814b800), - SPH_C32(0x1dd50000), SPH_C32(0xbaf60000), SPH_C32(0x723a0000), - SPH_C32(0xd9e02ec4), SPH_C32(0x5a3284e7), SPH_C32(0x9707e129), - SPH_C32(0x0f8b57fc) }, - { SPH_C32(0x12455000), SPH_C32(0xe28f0000), SPH_C32(0x188b0000), - SPH_C32(0x1b180000), SPH_C32(0xd9301e32), SPH_C32(0xd0baef72), - SPH_C32(0x4a3a8ff2), SPH_C32(0xea373c60), SPH_C32(0xf3928800), - SPH_C32(0xdc560000), SPH_C32(0xbd470000), SPH_C32(0x95bd0000), - SPH_C32(0x3d767488), SPH_C32(0xf3c9c922), SPH_C32(0x916cbfec), - SPH_C32(0x4aeb5b0f) }, - { SPH_C32(0x31224400), SPH_C32(0x2a360000), SPH_C32(0xec4c0000), - SPH_C32(0xe06d0000), SPH_C32(0xaafd3a57), SPH_C32(0x281c4a3b), - SPH_C32(0x48fe85cd), SPH_C32(0x3613da7f), SPH_C32(0xc4afa000), - SPH_C32(0xad060000), SPH_C32(0x28a70000), SPH_C32(0x9fa90000), - SPH_C32(0x80da6d81), SPH_C32(0xbb265113), SPH_C32(0xd401d2f3), - SPH_C32(0x774199d5) }, - { SPH_C32(0xdad61400), SPH_C32(0xb8b10000), SPH_C32(0x4f0c0000), - SPH_C32(0x574e0000), SPH_C32(0x33a83a07), SPH_C32(0xa50bfe67), - SPH_C32(0x628cfdb5), SPH_C32(0xc7e6c5cb), SPH_C32(0xa7bad400), - SPH_C32(0x36bb0000), SPH_C32(0x78910000), SPH_C32(0x34780000), - SPH_C32(0x8ed413f8), SPH_C32(0x676c0dc3), SPH_C32(0xfadcfe71), - SPH_C32(0x1ff06c8d) }, - { SPH_C32(0xf9b10000), SPH_C32(0x70080000), SPH_C32(0xbbcb0000), - SPH_C32(0xac3b0000), SPH_C32(0x40651e62), SPH_C32(0x5dad5b2e), - SPH_C32(0x6048f78a), SPH_C32(0x1bc223d4), SPH_C32(0x9087fc00), - SPH_C32(0x47eb0000), SPH_C32(0xed710000), SPH_C32(0x3e6c0000), - SPH_C32(0x33780af1), SPH_C32(0x2f8395f2), SPH_C32(0xbfb1936e), - SPH_C32(0x225aae57) }, - { SPH_C32(0x8efe4800), SPH_C32(0x525c0000), SPH_C32(0x8ada0000), - SPH_C32(0xf68b0000), SPH_C32(0x800a5d77), SPH_C32(0x31ae3a86), - SPH_C32(0x093cbc28), SPH_C32(0x92fdf249), SPH_C32(0x3b01cc00), - SPH_C32(0x86680000), SPH_C32(0xeac00000), SPH_C32(0xd9eb0000), - SPH_C32(0xd7ee50bd), SPH_C32(0x8678d837), SPH_C32(0xb9dacdab), - SPH_C32(0x673aa2a4) }, - { SPH_C32(0xad995c00), SPH_C32(0x9ae50000), SPH_C32(0x7e1d0000), - SPH_C32(0x0dfe0000), SPH_C32(0xf3c77912), SPH_C32(0xc9089fcf), - SPH_C32(0x0bf8b617), SPH_C32(0x4ed91456), SPH_C32(0x0c3ce400), - SPH_C32(0xf7380000), SPH_C32(0x7f200000), SPH_C32(0xd3ff0000), - SPH_C32(0x6a4249b4), SPH_C32(0xce974006), SPH_C32(0xfcb7a0b4), - SPH_C32(0x5a90607e) }, - { SPH_C32(0x6f299000), SPH_C32(0x6c850000), SPH_C32(0x2f160000), - SPH_C32(0x782e0000), SPH_C32(0x644c37cd), SPH_C32(0x12dd1cd6), - SPH_C32(0xd26a8c36), SPH_C32(0x32219526), SPH_C32(0x29449c00), - SPH_C32(0x64e70000), SPH_C32(0xf24b0000), SPH_C32(0xc2f30000), - SPH_C32(0x0ede4e8f), SPH_C32(0x56c23745), SPH_C32(0xf3e04259), - SPH_C32(0x8d0d9ec4) }, - { SPH_C32(0x4c4e8400), SPH_C32(0xa43c0000), SPH_C32(0xdbd10000), - SPH_C32(0x835b0000), SPH_C32(0x178113a8), SPH_C32(0xea7bb99f), - SPH_C32(0xd0ae8609), SPH_C32(0xee057339), SPH_C32(0x1e79b400), - SPH_C32(0x15b70000), SPH_C32(0x67ab0000), SPH_C32(0xc8e70000), - SPH_C32(0xb3725786), SPH_C32(0x1e2daf74), SPH_C32(0xb68d2f46), - SPH_C32(0xb0a75c1e) }, - { SPH_C32(0x3b01cc00), SPH_C32(0x86680000), SPH_C32(0xeac00000), - SPH_C32(0xd9eb0000), SPH_C32(0xd7ee50bd), SPH_C32(0x8678d837), - SPH_C32(0xb9dacdab), SPH_C32(0x673aa2a4), SPH_C32(0xb5ff8400), - SPH_C32(0xd4340000), SPH_C32(0x601a0000), SPH_C32(0x2f600000), - SPH_C32(0x57e40dca), SPH_C32(0xb7d6e2b1), SPH_C32(0xb0e67183), - SPH_C32(0xf5c750ed) }, - { SPH_C32(0x1866d800), SPH_C32(0x4ed10000), SPH_C32(0x1e070000), - SPH_C32(0x229e0000), SPH_C32(0xa42374d8), SPH_C32(0x7ede7d7e), - SPH_C32(0xbb1ec794), SPH_C32(0xbb1e44bb), SPH_C32(0x82c2ac00), - SPH_C32(0xa5640000), SPH_C32(0xf5fa0000), SPH_C32(0x25740000), - SPH_C32(0xea4814c3), SPH_C32(0xff397a80), SPH_C32(0xf58b1c9c), - SPH_C32(0xc86d9237) }, - { SPH_C32(0xf3928800), SPH_C32(0xdc560000), SPH_C32(0xbd470000), - SPH_C32(0x95bd0000), SPH_C32(0x3d767488), SPH_C32(0xf3c9c922), - SPH_C32(0x916cbfec), SPH_C32(0x4aeb5b0f), SPH_C32(0xe1d7d800), - SPH_C32(0x3ed90000), SPH_C32(0xa5cc0000), SPH_C32(0x8ea50000), - SPH_C32(0xe4466aba), SPH_C32(0x23732650), SPH_C32(0xdb56301e), - SPH_C32(0xa0dc676f) }, - { SPH_C32(0xd0f59c00), SPH_C32(0x14ef0000), SPH_C32(0x49800000), - SPH_C32(0x6ec80000), SPH_C32(0x4ebb50ed), SPH_C32(0x0b6f6c6b), - SPH_C32(0x93a8b5d3), SPH_C32(0x96cfbd10), SPH_C32(0xd6eaf000), - SPH_C32(0x4f890000), SPH_C32(0x302c0000), SPH_C32(0x84b10000), - SPH_C32(0x59ea73b3), SPH_C32(0x6b9cbe61), SPH_C32(0x9e3b5d01), - SPH_C32(0x9d76a5b5) }, - { SPH_C32(0xa7bad400), SPH_C32(0x36bb0000), SPH_C32(0x78910000), - SPH_C32(0x34780000), SPH_C32(0x8ed413f8), SPH_C32(0x676c0dc3), - SPH_C32(0xfadcfe71), SPH_C32(0x1ff06c8d), SPH_C32(0x7d6cc000), - SPH_C32(0x8e0a0000), SPH_C32(0x379d0000), SPH_C32(0x63360000), - SPH_C32(0xbd7c29ff), SPH_C32(0xc267f3a4), SPH_C32(0x985003c4), - SPH_C32(0xd816a946) }, - { SPH_C32(0x84ddc000), SPH_C32(0xfe020000), SPH_C32(0x8c560000), - SPH_C32(0xcf0d0000), SPH_C32(0xfd19379d), SPH_C32(0x9fcaa88a), - SPH_C32(0xf818f44e), SPH_C32(0xc3d48a92), SPH_C32(0x4a51e800), - SPH_C32(0xff5a0000), SPH_C32(0xa27d0000), SPH_C32(0x69220000), - SPH_C32(0x00d030f6), SPH_C32(0x8a886b95), SPH_C32(0xdd3d6edb), - SPH_C32(0xe5bc6b9c) } -}; - -static const sph_u32 T512_5[32][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xe8870170), SPH_C32(0x9d720000), SPH_C32(0x12db0000), - SPH_C32(0xd4220000), SPH_C32(0xf2886b27), SPH_C32(0xa921e543), - SPH_C32(0x4ef8b518), SPH_C32(0x618813b1), SPH_C32(0xb4370060), - SPH_C32(0x0c4c0000), SPH_C32(0x56c20000), SPH_C32(0x5cae0000), - SPH_C32(0x94541f3f), SPH_C32(0x3b3ef825), SPH_C32(0x1b365f3d), - SPH_C32(0xf3d45758) }, - { SPH_C32(0xb4370060), SPH_C32(0x0c4c0000), SPH_C32(0x56c20000), - SPH_C32(0x5cae0000), SPH_C32(0x94541f3f), SPH_C32(0x3b3ef825), - SPH_C32(0x1b365f3d), SPH_C32(0xf3d45758), SPH_C32(0x5cb00110), - SPH_C32(0x913e0000), SPH_C32(0x44190000), SPH_C32(0x888c0000), - SPH_C32(0x66dc7418), SPH_C32(0x921f1d66), SPH_C32(0x55ceea25), - SPH_C32(0x925c44e9) }, - { SPH_C32(0x5cb00110), SPH_C32(0x913e0000), SPH_C32(0x44190000), - SPH_C32(0x888c0000), SPH_C32(0x66dc7418), SPH_C32(0x921f1d66), - SPH_C32(0x55ceea25), SPH_C32(0x925c44e9), SPH_C32(0xe8870170), - SPH_C32(0x9d720000), SPH_C32(0x12db0000), SPH_C32(0xd4220000), - SPH_C32(0xf2886b27), SPH_C32(0xa921e543), SPH_C32(0x4ef8b518), - SPH_C32(0x618813b1) }, - { SPH_C32(0xef0b0270), SPH_C32(0x3afd0000), SPH_C32(0x5dae0000), - SPH_C32(0x69490000), SPH_C32(0x9b0f3c06), SPH_C32(0x4405b5f9), - SPH_C32(0x66140a51), SPH_C32(0x924f5d0a), SPH_C32(0xc96b0030), - SPH_C32(0xe7250000), SPH_C32(0x2f840000), SPH_C32(0x264f0000), - SPH_C32(0x08695bf9), SPH_C32(0x6dfcf137), SPH_C32(0x509f6984), - SPH_C32(0x9e69af68) }, - { SPH_C32(0x078c0300), SPH_C32(0xa78f0000), SPH_C32(0x4f750000), - SPH_C32(0xbd6b0000), SPH_C32(0x69875721), SPH_C32(0xed2450ba), - SPH_C32(0x28ecbf49), SPH_C32(0xf3c74ebb), SPH_C32(0x7d5c0050), - SPH_C32(0xeb690000), SPH_C32(0x79460000), SPH_C32(0x7ae10000), - SPH_C32(0x9c3d44c6), SPH_C32(0x56c20912), SPH_C32(0x4ba936b9), - SPH_C32(0x6dbdf830) }, - { SPH_C32(0x5b3c0210), SPH_C32(0x36b10000), SPH_C32(0x0b6c0000), - SPH_C32(0x35e70000), SPH_C32(0x0f5b2339), SPH_C32(0x7f3b4ddc), - SPH_C32(0x7d22556c), SPH_C32(0x619b0a52), SPH_C32(0x95db0120), - SPH_C32(0x761b0000), SPH_C32(0x6b9d0000), SPH_C32(0xaec30000), - SPH_C32(0x6eb52fe1), SPH_C32(0xffe3ec51), SPH_C32(0x055183a1), - SPH_C32(0x0c35eb81) }, - { SPH_C32(0xb3bb0360), SPH_C32(0xabc30000), SPH_C32(0x19b70000), - SPH_C32(0xe1c50000), SPH_C32(0xfdd3481e), SPH_C32(0xd61aa89f), - SPH_C32(0x33dae074), SPH_C32(0x001319e3), SPH_C32(0x21ec0140), - SPH_C32(0x7a570000), SPH_C32(0x3d5f0000), SPH_C32(0xf26d0000), - SPH_C32(0xfae130de), SPH_C32(0xc4dd1474), SPH_C32(0x1e67dc9c), - SPH_C32(0xffe1bcd9) }, - { SPH_C32(0xc96b0030), SPH_C32(0xe7250000), SPH_C32(0x2f840000), - SPH_C32(0x264f0000), SPH_C32(0x08695bf9), SPH_C32(0x6dfcf137), - SPH_C32(0x509f6984), SPH_C32(0x9e69af68), SPH_C32(0x26600240), - SPH_C32(0xddd80000), SPH_C32(0x722a0000), SPH_C32(0x4f060000), - SPH_C32(0x936667ff), SPH_C32(0x29f944ce), SPH_C32(0x368b63d5), - SPH_C32(0x0c26f262) }, - { SPH_C32(0x21ec0140), SPH_C32(0x7a570000), SPH_C32(0x3d5f0000), - SPH_C32(0xf26d0000), SPH_C32(0xfae130de), SPH_C32(0xc4dd1474), - SPH_C32(0x1e67dc9c), SPH_C32(0xffe1bcd9), SPH_C32(0x92570220), - SPH_C32(0xd1940000), SPH_C32(0x24e80000), SPH_C32(0x13a80000), - SPH_C32(0x073278c0), SPH_C32(0x12c7bceb), SPH_C32(0x2dbd3ce8), - SPH_C32(0xfff2a53a) }, - { SPH_C32(0x7d5c0050), SPH_C32(0xeb690000), SPH_C32(0x79460000), - SPH_C32(0x7ae10000), SPH_C32(0x9c3d44c6), SPH_C32(0x56c20912), - SPH_C32(0x4ba936b9), SPH_C32(0x6dbdf830), SPH_C32(0x7ad00350), - SPH_C32(0x4ce60000), SPH_C32(0x36330000), SPH_C32(0xc78a0000), - SPH_C32(0xf5ba13e7), SPH_C32(0xbbe659a8), SPH_C32(0x634589f0), - SPH_C32(0x9e7ab68b) }, - { SPH_C32(0x95db0120), SPH_C32(0x761b0000), SPH_C32(0x6b9d0000), - SPH_C32(0xaec30000), SPH_C32(0x6eb52fe1), SPH_C32(0xffe3ec51), - SPH_C32(0x055183a1), SPH_C32(0x0c35eb81), SPH_C32(0xcee70330), - SPH_C32(0x40aa0000), SPH_C32(0x60f10000), SPH_C32(0x9b240000), - SPH_C32(0x61ee0cd8), SPH_C32(0x80d8a18d), SPH_C32(0x7873d6cd), - SPH_C32(0x6daee1d3) }, - { SPH_C32(0x26600240), SPH_C32(0xddd80000), SPH_C32(0x722a0000), - SPH_C32(0x4f060000), SPH_C32(0x936667ff), SPH_C32(0x29f944ce), - SPH_C32(0x368b63d5), SPH_C32(0x0c26f262), SPH_C32(0xef0b0270), - SPH_C32(0x3afd0000), SPH_C32(0x5dae0000), SPH_C32(0x69490000), - SPH_C32(0x9b0f3c06), SPH_C32(0x4405b5f9), SPH_C32(0x66140a51), - SPH_C32(0x924f5d0a) }, - { SPH_C32(0xcee70330), SPH_C32(0x40aa0000), SPH_C32(0x60f10000), - SPH_C32(0x9b240000), SPH_C32(0x61ee0cd8), SPH_C32(0x80d8a18d), - SPH_C32(0x7873d6cd), SPH_C32(0x6daee1d3), SPH_C32(0x5b3c0210), - SPH_C32(0x36b10000), SPH_C32(0x0b6c0000), SPH_C32(0x35e70000), - SPH_C32(0x0f5b2339), SPH_C32(0x7f3b4ddc), SPH_C32(0x7d22556c), - SPH_C32(0x619b0a52) }, - { SPH_C32(0x92570220), SPH_C32(0xd1940000), SPH_C32(0x24e80000), - SPH_C32(0x13a80000), SPH_C32(0x073278c0), SPH_C32(0x12c7bceb), - SPH_C32(0x2dbd3ce8), SPH_C32(0xfff2a53a), SPH_C32(0xb3bb0360), - SPH_C32(0xabc30000), SPH_C32(0x19b70000), SPH_C32(0xe1c50000), - SPH_C32(0xfdd3481e), SPH_C32(0xd61aa89f), SPH_C32(0x33dae074), - SPH_C32(0x001319e3) }, - { SPH_C32(0x7ad00350), SPH_C32(0x4ce60000), SPH_C32(0x36330000), - SPH_C32(0xc78a0000), SPH_C32(0xf5ba13e7), SPH_C32(0xbbe659a8), - SPH_C32(0x634589f0), SPH_C32(0x9e7ab68b), SPH_C32(0x078c0300), - SPH_C32(0xa78f0000), SPH_C32(0x4f750000), SPH_C32(0xbd6b0000), - SPH_C32(0x69875721), SPH_C32(0xed2450ba), SPH_C32(0x28ecbf49), - SPH_C32(0xf3c74ebb) }, - { SPH_C32(0x145a3c00), SPH_C32(0xb9e90000), SPH_C32(0x61270000), - SPH_C32(0xf1610000), SPH_C32(0xce613d6c), SPH_C32(0xb0493d78), - SPH_C32(0x47a96720), SPH_C32(0xe18e24c5), SPH_C32(0x23671400), - SPH_C32(0xc8b90000), SPH_C32(0xf4c70000), SPH_C32(0xfb750000), - SPH_C32(0x73cd2465), SPH_C32(0xf8a6a549), SPH_C32(0x02c40a3f), - SPH_C32(0xdc24e61f) }, - { SPH_C32(0xfcdd3d70), SPH_C32(0x249b0000), SPH_C32(0x73fc0000), - SPH_C32(0x25430000), SPH_C32(0x3ce9564b), SPH_C32(0x1968d83b), - SPH_C32(0x0951d238), SPH_C32(0x80063774), SPH_C32(0x97501460), - SPH_C32(0xc4f50000), SPH_C32(0xa2050000), SPH_C32(0xa7db0000), - SPH_C32(0xe7993b5a), SPH_C32(0xc3985d6c), SPH_C32(0x19f25502), - SPH_C32(0x2ff0b147) }, - { SPH_C32(0xa06d3c60), SPH_C32(0xb5a50000), SPH_C32(0x37e50000), - SPH_C32(0xadcf0000), SPH_C32(0x5a352253), SPH_C32(0x8b77c55d), - SPH_C32(0x5c9f381d), SPH_C32(0x125a739d), SPH_C32(0x7fd71510), - SPH_C32(0x59870000), SPH_C32(0xb0de0000), SPH_C32(0x73f90000), - SPH_C32(0x1511507d), SPH_C32(0x6ab9b82f), SPH_C32(0x570ae01a), - SPH_C32(0x4e78a2f6) }, - { SPH_C32(0x48ea3d10), SPH_C32(0x28d70000), SPH_C32(0x253e0000), - SPH_C32(0x79ed0000), SPH_C32(0xa8bd4974), SPH_C32(0x2256201e), - SPH_C32(0x12678d05), SPH_C32(0x73d2602c), SPH_C32(0xcbe01570), - SPH_C32(0x55cb0000), SPH_C32(0xe61c0000), SPH_C32(0x2f570000), - SPH_C32(0x81454f42), SPH_C32(0x5187400a), SPH_C32(0x4c3cbf27), - SPH_C32(0xbdacf5ae) }, - { SPH_C32(0xfb513e70), SPH_C32(0x83140000), SPH_C32(0x3c890000), - SPH_C32(0x98280000), SPH_C32(0x556e016a), SPH_C32(0xf44c8881), - SPH_C32(0x21bd6d71), SPH_C32(0x73c179cf), SPH_C32(0xea0c1430), - SPH_C32(0x2f9c0000), SPH_C32(0xdb430000), SPH_C32(0xdd3a0000), - SPH_C32(0x7ba47f9c), SPH_C32(0x955a547e), SPH_C32(0x525b63bb), - SPH_C32(0x424d4977) }, - { SPH_C32(0x13d63f00), SPH_C32(0x1e660000), SPH_C32(0x2e520000), - SPH_C32(0x4c0a0000), SPH_C32(0xa7e66a4d), SPH_C32(0x5d6d6dc2), - SPH_C32(0x6f45d869), SPH_C32(0x12496a7e), SPH_C32(0x5e3b1450), - SPH_C32(0x23d00000), SPH_C32(0x8d810000), SPH_C32(0x81940000), - SPH_C32(0xeff060a3), SPH_C32(0xae64ac5b), SPH_C32(0x496d3c86), - SPH_C32(0xb1991e2f) }, - { SPH_C32(0x4f663e10), SPH_C32(0x8f580000), SPH_C32(0x6a4b0000), - SPH_C32(0xc4860000), SPH_C32(0xc13a1e55), SPH_C32(0xcf7270a4), - SPH_C32(0x3a8b324c), SPH_C32(0x80152e97), SPH_C32(0xb6bc1520), - SPH_C32(0xbea20000), SPH_C32(0x9f5a0000), SPH_C32(0x55b60000), - SPH_C32(0x1d780b84), SPH_C32(0x07454918), SPH_C32(0x0795899e), - SPH_C32(0xd0110d9e) }, - { SPH_C32(0xa7e13f60), SPH_C32(0x122a0000), SPH_C32(0x78900000), - SPH_C32(0x10a40000), SPH_C32(0x33b27572), SPH_C32(0x665395e7), - SPH_C32(0x74738754), SPH_C32(0xe19d3d26), SPH_C32(0x028b1540), - SPH_C32(0xb2ee0000), SPH_C32(0xc9980000), SPH_C32(0x09180000), - SPH_C32(0x892c14bb), SPH_C32(0x3c7bb13d), SPH_C32(0x1ca3d6a3), - SPH_C32(0x23c55ac6) }, - { SPH_C32(0xdd313c30), SPH_C32(0x5ecc0000), SPH_C32(0x4ea30000), - SPH_C32(0xd72e0000), SPH_C32(0xc6086695), SPH_C32(0xddb5cc4f), - SPH_C32(0x17360ea4), SPH_C32(0x7fe78bad), SPH_C32(0x05071640), - SPH_C32(0x15610000), SPH_C32(0x86ed0000), SPH_C32(0xb4730000), - SPH_C32(0xe0ab439a), SPH_C32(0xd15fe187), SPH_C32(0x344f69ea), - SPH_C32(0xd002147d) }, - { SPH_C32(0x35b63d40), SPH_C32(0xc3be0000), SPH_C32(0x5c780000), - SPH_C32(0x030c0000), SPH_C32(0x34800db2), SPH_C32(0x7494290c), - SPH_C32(0x59cebbbc), SPH_C32(0x1e6f981c), SPH_C32(0xb1301620), - SPH_C32(0x192d0000), SPH_C32(0xd02f0000), SPH_C32(0xe8dd0000), - SPH_C32(0x74ff5ca5), SPH_C32(0xea6119a2), SPH_C32(0x2f7936d7), - SPH_C32(0x23d64325) }, - { SPH_C32(0x69063c50), SPH_C32(0x52800000), SPH_C32(0x18610000), - SPH_C32(0x8b800000), SPH_C32(0x525c79aa), SPH_C32(0xe68b346a), - SPH_C32(0x0c005199), SPH_C32(0x8c33dcf5), SPH_C32(0x59b71750), - SPH_C32(0x845f0000), SPH_C32(0xc2f40000), SPH_C32(0x3cff0000), - SPH_C32(0x86773782), SPH_C32(0x4340fce1), SPH_C32(0x618183cf), - SPH_C32(0x425e5094) }, - { SPH_C32(0x81813d20), SPH_C32(0xcff20000), SPH_C32(0x0aba0000), - SPH_C32(0x5fa20000), SPH_C32(0xa0d4128d), SPH_C32(0x4faad129), - SPH_C32(0x42f8e481), SPH_C32(0xedbbcf44), SPH_C32(0xed801730), - SPH_C32(0x88130000), SPH_C32(0x94360000), SPH_C32(0x60510000), - SPH_C32(0x122328bd), SPH_C32(0x787e04c4), SPH_C32(0x7ab7dcf2), - SPH_C32(0xb18a07cc) }, - { SPH_C32(0x323a3e40), SPH_C32(0x64310000), SPH_C32(0x130d0000), - SPH_C32(0xbe670000), SPH_C32(0x5d075a93), SPH_C32(0x99b079b6), - SPH_C32(0x712204f5), SPH_C32(0xeda8d6a7), SPH_C32(0xcc6c1670), - SPH_C32(0xf2440000), SPH_C32(0xa9690000), SPH_C32(0x923c0000), - SPH_C32(0xe8c21863), SPH_C32(0xbca310b0), SPH_C32(0x64d0006e), - SPH_C32(0x4e6bbb15) }, - { SPH_C32(0xdabd3f30), SPH_C32(0xf9430000), SPH_C32(0x01d60000), - SPH_C32(0x6a450000), SPH_C32(0xaf8f31b4), SPH_C32(0x30919cf5), - SPH_C32(0x3fdab1ed), SPH_C32(0x8c20c516), SPH_C32(0x785b1610), - SPH_C32(0xfe080000), SPH_C32(0xffab0000), SPH_C32(0xce920000), - SPH_C32(0x7c96075c), SPH_C32(0x879de895), SPH_C32(0x7fe65f53), - SPH_C32(0xbdbfec4d) }, - { SPH_C32(0x860d3e20), SPH_C32(0x687d0000), SPH_C32(0x45cf0000), - SPH_C32(0xe2c90000), SPH_C32(0xc95345ac), SPH_C32(0xa28e8193), - SPH_C32(0x6a145bc8), SPH_C32(0x1e7c81ff), SPH_C32(0x90dc1760), - SPH_C32(0x637a0000), SPH_C32(0xed700000), SPH_C32(0x1ab00000), - SPH_C32(0x8e1e6c7b), SPH_C32(0x2ebc0dd6), SPH_C32(0x311eea4b), - SPH_C32(0xdc37fffc) }, - { SPH_C32(0x6e8a3f50), SPH_C32(0xf50f0000), SPH_C32(0x57140000), - SPH_C32(0x36eb0000), SPH_C32(0x3bdb2e8b), SPH_C32(0x0baf64d0), - SPH_C32(0x24eceed0), SPH_C32(0x7ff4924e), SPH_C32(0x24eb1700), - SPH_C32(0x6f360000), SPH_C32(0xbbb20000), SPH_C32(0x461e0000), - SPH_C32(0x1a4a7344), SPH_C32(0x1582f5f3), SPH_C32(0x2a28b576), - SPH_C32(0x2fe3a8a4) } -}; - -static const sph_u32 T512_10[32][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xa67f0001), SPH_C32(0x71378000), SPH_C32(0x19fc0000), - SPH_C32(0x96db0000), SPH_C32(0x3a8b6dfd), SPH_C32(0xebcaaef3), - SPH_C32(0x2c6d478f), SPH_C32(0xac8e6c88), SPH_C32(0x50ff0004), - SPH_C32(0x45744000), SPH_C32(0x3dfb0000), SPH_C32(0x19e60000), - SPH_C32(0x1bbc5606), SPH_C32(0xe1727b5d), SPH_C32(0xe1a8cc96), - SPH_C32(0x7b1bd6b9) }, - { SPH_C32(0xf7750009), SPH_C32(0xcf3cc000), SPH_C32(0xc3d60000), - SPH_C32(0x04920000), SPH_C32(0x029519a9), SPH_C32(0xf8e836ba), - SPH_C32(0x7a87f14e), SPH_C32(0x9e16981a), SPH_C32(0xd46a0000), - SPH_C32(0x8dc8c000), SPH_C32(0xa5af0000), SPH_C32(0x4a290000), - SPH_C32(0xfc4e427a), SPH_C32(0xc9b4866c), SPH_C32(0x98369604), - SPH_C32(0xf746c320) }, - { SPH_C32(0x510a0008), SPH_C32(0xbe0b4000), SPH_C32(0xda2a0000), - SPH_C32(0x92490000), SPH_C32(0x381e7454), SPH_C32(0x13229849), - SPH_C32(0x56eab6c1), SPH_C32(0x3298f492), SPH_C32(0x84950004), - SPH_C32(0xc8bc8000), SPH_C32(0x98540000), SPH_C32(0x53cf0000), - SPH_C32(0xe7f2147c), SPH_C32(0x28c6fd31), SPH_C32(0x799e5a92), - SPH_C32(0x8c5d1599) }, - { SPH_C32(0xd46a0000), SPH_C32(0x8dc8c000), SPH_C32(0xa5af0000), - SPH_C32(0x4a290000), SPH_C32(0xfc4e427a), SPH_C32(0xc9b4866c), - SPH_C32(0x98369604), SPH_C32(0xf746c320), SPH_C32(0x231f0009), - SPH_C32(0x42f40000), SPH_C32(0x66790000), SPH_C32(0x4ebb0000), - SPH_C32(0xfedb5bd3), SPH_C32(0x315cb0d6), SPH_C32(0xe2b1674a), - SPH_C32(0x69505b3a) }, - { SPH_C32(0x72150001), SPH_C32(0xfcff4000), SPH_C32(0xbc530000), - SPH_C32(0xdcf20000), SPH_C32(0xc6c52f87), SPH_C32(0x227e289f), - SPH_C32(0xb45bd18b), SPH_C32(0x5bc8afa8), SPH_C32(0x73e0000d), - SPH_C32(0x07804000), SPH_C32(0x5b820000), SPH_C32(0x575d0000), - SPH_C32(0xe5670dd5), SPH_C32(0xd02ecb8b), SPH_C32(0x0319abdc), - SPH_C32(0x124b8d83) }, - { SPH_C32(0x231f0009), SPH_C32(0x42f40000), SPH_C32(0x66790000), - SPH_C32(0x4ebb0000), SPH_C32(0xfedb5bd3), SPH_C32(0x315cb0d6), - SPH_C32(0xe2b1674a), SPH_C32(0x69505b3a), SPH_C32(0xf7750009), - SPH_C32(0xcf3cc000), SPH_C32(0xc3d60000), SPH_C32(0x04920000), - SPH_C32(0x029519a9), SPH_C32(0xf8e836ba), SPH_C32(0x7a87f14e), - SPH_C32(0x9e16981a) }, - { SPH_C32(0x85600008), SPH_C32(0x33c38000), SPH_C32(0x7f850000), - SPH_C32(0xd8600000), SPH_C32(0xc450362e), SPH_C32(0xda961e25), - SPH_C32(0xcedc20c5), SPH_C32(0xc5de37b2), SPH_C32(0xa78a000d), - SPH_C32(0x8a488000), SPH_C32(0xfe2d0000), SPH_C32(0x1d740000), - SPH_C32(0x19294faf), SPH_C32(0x199a4de7), SPH_C32(0x9b2f3dd8), - SPH_C32(0xe50d4ea3) }, - { SPH_C32(0x774400f0), SPH_C32(0xf15a0000), SPH_C32(0xf5b20000), - SPH_C32(0x34140000), SPH_C32(0x89377e8c), SPH_C32(0x5a8bec25), - SPH_C32(0x0bc3cd1e), SPH_C32(0xcf3775cb), SPH_C32(0xf46c0050), - SPH_C32(0x96180000), SPH_C32(0x14a50000), SPH_C32(0x031f0000), - SPH_C32(0x42947eb8), SPH_C32(0x66bf7e19), SPH_C32(0x9ca470d2), - SPH_C32(0x8a341574) }, - { SPH_C32(0xd13b00f1), SPH_C32(0x806d8000), SPH_C32(0xec4e0000), - SPH_C32(0xa2cf0000), SPH_C32(0xb3bc1371), SPH_C32(0xb14142d6), - SPH_C32(0x27ae8a91), SPH_C32(0x63b91943), SPH_C32(0xa4930054), - SPH_C32(0xd36c4000), SPH_C32(0x295e0000), SPH_C32(0x1af90000), - SPH_C32(0x592828be), SPH_C32(0x87cd0544), SPH_C32(0x7d0cbc44), - SPH_C32(0xf12fc3cd) }, - { SPH_C32(0x803100f9), SPH_C32(0x3e66c000), SPH_C32(0x36640000), - SPH_C32(0x30860000), SPH_C32(0x8ba26725), SPH_C32(0xa263da9f), - SPH_C32(0x71443c50), SPH_C32(0x5121edd1), SPH_C32(0x20060050), - SPH_C32(0x1bd0c000), SPH_C32(0xb10a0000), SPH_C32(0x49360000), - SPH_C32(0xbeda3cc2), SPH_C32(0xaf0bf875), SPH_C32(0x0492e6d6), - SPH_C32(0x7d72d654) }, - { SPH_C32(0x264e00f8), SPH_C32(0x4f514000), SPH_C32(0x2f980000), - SPH_C32(0xa65d0000), SPH_C32(0xb1290ad8), SPH_C32(0x49a9746c), - SPH_C32(0x5d297bdf), SPH_C32(0xfdaf8159), SPH_C32(0x70f90054), - SPH_C32(0x5ea48000), SPH_C32(0x8cf10000), SPH_C32(0x50d00000), - SPH_C32(0xa5666ac4), SPH_C32(0x4e798328), SPH_C32(0xe53a2a40), - SPH_C32(0x066900ed) }, - { SPH_C32(0xa32e00f0), SPH_C32(0x7c92c000), SPH_C32(0x501d0000), - SPH_C32(0x7e3d0000), SPH_C32(0x75793cf6), SPH_C32(0x933f6a49), - SPH_C32(0x93f55b1a), SPH_C32(0x3871b6eb), SPH_C32(0xd7730059), - SPH_C32(0xd4ec0000), SPH_C32(0x72dc0000), SPH_C32(0x4da40000), - SPH_C32(0xbc4f256b), SPH_C32(0x57e3cecf), SPH_C32(0x7e151798), - SPH_C32(0xe3644e4e) }, - { SPH_C32(0x055100f1), SPH_C32(0x0da54000), SPH_C32(0x49e10000), - SPH_C32(0xe8e60000), SPH_C32(0x4ff2510b), SPH_C32(0x78f5c4ba), - SPH_C32(0xbf981c95), SPH_C32(0x94ffda63), SPH_C32(0x878c005d), - SPH_C32(0x91984000), SPH_C32(0x4f270000), SPH_C32(0x54420000), - SPH_C32(0xa7f3736d), SPH_C32(0xb691b592), SPH_C32(0x9fbddb0e), - SPH_C32(0x987f98f7) }, - { SPH_C32(0x545b00f9), SPH_C32(0xb3ae0000), SPH_C32(0x93cb0000), - SPH_C32(0x7aaf0000), SPH_C32(0x77ec255f), SPH_C32(0x6bd75cf3), - SPH_C32(0xe972aa54), SPH_C32(0xa6672ef1), SPH_C32(0x03190059), - SPH_C32(0x5924c000), SPH_C32(0xd7730000), SPH_C32(0x078d0000), - SPH_C32(0x40016711), SPH_C32(0x9e5748a3), SPH_C32(0xe623819c), - SPH_C32(0x14228d6e) }, - { SPH_C32(0xf22400f8), SPH_C32(0xc2998000), SPH_C32(0x8a370000), - SPH_C32(0xec740000), SPH_C32(0x4d6748a2), SPH_C32(0x801df200), - SPH_C32(0xc51feddb), SPH_C32(0x0ae94279), SPH_C32(0x53e6005d), - SPH_C32(0x1c508000), SPH_C32(0xea880000), SPH_C32(0x1e6b0000), - SPH_C32(0x5bbd3117), SPH_C32(0x7f2533fe), SPH_C32(0x078b4d0a), - SPH_C32(0x6f395bd7) }, - { SPH_C32(0xf46c0050), SPH_C32(0x96180000), SPH_C32(0x14a50000), - SPH_C32(0x031f0000), SPH_C32(0x42947eb8), SPH_C32(0x66bf7e19), - SPH_C32(0x9ca470d2), SPH_C32(0x8a341574), SPH_C32(0x832800a0), - SPH_C32(0x67420000), SPH_C32(0xe1170000), SPH_C32(0x370b0000), - SPH_C32(0xcba30034), SPH_C32(0x3c34923c), SPH_C32(0x9767bdcc), - SPH_C32(0x450360bf) }, - { SPH_C32(0x52130051), SPH_C32(0xe72f8000), SPH_C32(0x0d590000), - SPH_C32(0x95c40000), SPH_C32(0x781f1345), SPH_C32(0x8d75d0ea), - SPH_C32(0xb0c9375d), SPH_C32(0x26ba79fc), SPH_C32(0xd3d700a4), - SPH_C32(0x22364000), SPH_C32(0xdcec0000), SPH_C32(0x2eed0000), - SPH_C32(0xd01f5632), SPH_C32(0xdd46e961), SPH_C32(0x76cf715a), - SPH_C32(0x3e18b606) }, - { SPH_C32(0x03190059), SPH_C32(0x5924c000), SPH_C32(0xd7730000), - SPH_C32(0x078d0000), SPH_C32(0x40016711), SPH_C32(0x9e5748a3), - SPH_C32(0xe623819c), SPH_C32(0x14228d6e), SPH_C32(0x574200a0), - SPH_C32(0xea8ac000), SPH_C32(0x44b80000), SPH_C32(0x7d220000), - SPH_C32(0x37ed424e), SPH_C32(0xf5801450), SPH_C32(0x0f512bc8), - SPH_C32(0xb245a39f) }, - { SPH_C32(0xa5660058), SPH_C32(0x28134000), SPH_C32(0xce8f0000), - SPH_C32(0x91560000), SPH_C32(0x7a8a0aec), SPH_C32(0x759de650), - SPH_C32(0xca4ec613), SPH_C32(0xb8ace1e6), SPH_C32(0x07bd00a4), - SPH_C32(0xaffe8000), SPH_C32(0x79430000), SPH_C32(0x64c40000), - SPH_C32(0x2c511448), SPH_C32(0x14f26f0d), SPH_C32(0xeef9e75e), - SPH_C32(0xc95e7526) }, - { SPH_C32(0x20060050), SPH_C32(0x1bd0c000), SPH_C32(0xb10a0000), - SPH_C32(0x49360000), SPH_C32(0xbeda3cc2), SPH_C32(0xaf0bf875), - SPH_C32(0x0492e6d6), SPH_C32(0x7d72d654), SPH_C32(0xa03700a9), - SPH_C32(0x25b60000), SPH_C32(0x876e0000), SPH_C32(0x79b00000), - SPH_C32(0x35785be7), SPH_C32(0x0d6822ea), SPH_C32(0x75d6da86), - SPH_C32(0x2c533b85) }, - { SPH_C32(0x86790051), SPH_C32(0x6ae74000), SPH_C32(0xa8f60000), - SPH_C32(0xdfed0000), SPH_C32(0x8451513f), SPH_C32(0x44c15686), - SPH_C32(0x28ffa159), SPH_C32(0xd1fcbadc), SPH_C32(0xf0c800ad), - SPH_C32(0x60c24000), SPH_C32(0xba950000), SPH_C32(0x60560000), - SPH_C32(0x2ec40de1), SPH_C32(0xec1a59b7), SPH_C32(0x947e1610), - SPH_C32(0x5748ed3c) }, - { SPH_C32(0xd7730059), SPH_C32(0xd4ec0000), SPH_C32(0x72dc0000), - SPH_C32(0x4da40000), SPH_C32(0xbc4f256b), SPH_C32(0x57e3cecf), - SPH_C32(0x7e151798), SPH_C32(0xe3644e4e), SPH_C32(0x745d00a9), - SPH_C32(0xa87ec000), SPH_C32(0x22c10000), SPH_C32(0x33990000), - SPH_C32(0xc936199d), SPH_C32(0xc4dca486), SPH_C32(0xede04c82), - SPH_C32(0xdb15f8a5) }, - { SPH_C32(0x710c0058), SPH_C32(0xa5db8000), SPH_C32(0x6b200000), - SPH_C32(0xdb7f0000), SPH_C32(0x86c44896), SPH_C32(0xbc29603c), - SPH_C32(0x52785017), SPH_C32(0x4fea22c6), SPH_C32(0x24a200ad), - SPH_C32(0xed0a8000), SPH_C32(0x1f3a0000), SPH_C32(0x2a7f0000), - SPH_C32(0xd28a4f9b), SPH_C32(0x25aedfdb), SPH_C32(0x0c488014), - SPH_C32(0xa00e2e1c) }, - { SPH_C32(0x832800a0), SPH_C32(0x67420000), SPH_C32(0xe1170000), - SPH_C32(0x370b0000), SPH_C32(0xcba30034), SPH_C32(0x3c34923c), - SPH_C32(0x9767bdcc), SPH_C32(0x450360bf), SPH_C32(0x774400f0), - SPH_C32(0xf15a0000), SPH_C32(0xf5b20000), SPH_C32(0x34140000), - SPH_C32(0x89377e8c), SPH_C32(0x5a8bec25), SPH_C32(0x0bc3cd1e), - SPH_C32(0xcf3775cb) }, - { SPH_C32(0x255700a1), SPH_C32(0x16758000), SPH_C32(0xf8eb0000), - SPH_C32(0xa1d00000), SPH_C32(0xf1286dc9), SPH_C32(0xd7fe3ccf), - SPH_C32(0xbb0afa43), SPH_C32(0xe98d0c37), SPH_C32(0x27bb00f4), - SPH_C32(0xb42e4000), SPH_C32(0xc8490000), SPH_C32(0x2df20000), - SPH_C32(0x928b288a), SPH_C32(0xbbf99778), SPH_C32(0xea6b0188), - SPH_C32(0xb42ca372) }, - { SPH_C32(0x745d00a9), SPH_C32(0xa87ec000), SPH_C32(0x22c10000), - SPH_C32(0x33990000), SPH_C32(0xc936199d), SPH_C32(0xc4dca486), - SPH_C32(0xede04c82), SPH_C32(0xdb15f8a5), SPH_C32(0xa32e00f0), - SPH_C32(0x7c92c000), SPH_C32(0x501d0000), SPH_C32(0x7e3d0000), - SPH_C32(0x75793cf6), SPH_C32(0x933f6a49), SPH_C32(0x93f55b1a), - SPH_C32(0x3871b6eb) }, - { SPH_C32(0xd22200a8), SPH_C32(0xd9494000), SPH_C32(0x3b3d0000), - SPH_C32(0xa5420000), SPH_C32(0xf3bd7460), SPH_C32(0x2f160a75), - SPH_C32(0xc18d0b0d), SPH_C32(0x779b942d), SPH_C32(0xf3d100f4), - SPH_C32(0x39e68000), SPH_C32(0x6de60000), SPH_C32(0x67db0000), - SPH_C32(0x6ec56af0), SPH_C32(0x724d1114), SPH_C32(0x725d978c), - SPH_C32(0x436a6052) }, - { SPH_C32(0x574200a0), SPH_C32(0xea8ac000), SPH_C32(0x44b80000), - SPH_C32(0x7d220000), SPH_C32(0x37ed424e), SPH_C32(0xf5801450), - SPH_C32(0x0f512bc8), SPH_C32(0xb245a39f), SPH_C32(0x545b00f9), - SPH_C32(0xb3ae0000), SPH_C32(0x93cb0000), SPH_C32(0x7aaf0000), - SPH_C32(0x77ec255f), SPH_C32(0x6bd75cf3), SPH_C32(0xe972aa54), - SPH_C32(0xa6672ef1) }, - { SPH_C32(0xf13d00a1), SPH_C32(0x9bbd4000), SPH_C32(0x5d440000), - SPH_C32(0xebf90000), SPH_C32(0x0d662fb3), SPH_C32(0x1e4abaa3), - SPH_C32(0x233c6c47), SPH_C32(0x1ecbcf17), SPH_C32(0x04a400fd), - SPH_C32(0xf6da4000), SPH_C32(0xae300000), SPH_C32(0x63490000), - SPH_C32(0x6c507359), SPH_C32(0x8aa527ae), SPH_C32(0x08da66c2), - SPH_C32(0xdd7cf848) }, - { SPH_C32(0xa03700a9), SPH_C32(0x25b60000), SPH_C32(0x876e0000), - SPH_C32(0x79b00000), SPH_C32(0x35785be7), SPH_C32(0x0d6822ea), - SPH_C32(0x75d6da86), SPH_C32(0x2c533b85), SPH_C32(0x803100f9), - SPH_C32(0x3e66c000), SPH_C32(0x36640000), SPH_C32(0x30860000), - SPH_C32(0x8ba26725), SPH_C32(0xa263da9f), SPH_C32(0x71443c50), - SPH_C32(0x5121edd1) }, - { SPH_C32(0x064800a8), SPH_C32(0x54818000), SPH_C32(0x9e920000), - SPH_C32(0xef6b0000), SPH_C32(0x0ff3361a), SPH_C32(0xe6a28c19), - SPH_C32(0x59bb9d09), SPH_C32(0x80dd570d), SPH_C32(0xd0ce00fd), - SPH_C32(0x7b128000), SPH_C32(0x0b9f0000), SPH_C32(0x29600000), - SPH_C32(0x901e3123), SPH_C32(0x4311a1c2), SPH_C32(0x90ecf0c6), - SPH_C32(0x2a3a3b68) } -}; - -static const sph_u32 T512_15[32][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x75a40000), SPH_C32(0xc28b2700), SPH_C32(0x94a40000), - SPH_C32(0x90f50000), SPH_C32(0xfb7857e0), SPH_C32(0x49ce0bae), - SPH_C32(0x1767c483), SPH_C32(0xaedf667e), SPH_C32(0xd1660000), - SPH_C32(0x1bbc0300), SPH_C32(0x9eec0000), SPH_C32(0xf6940000), - SPH_C32(0x03024527), SPH_C32(0xcf70fcf2), SPH_C32(0xb4431b17), - SPH_C32(0x857f3c2b) }, - { SPH_C32(0xd1660000), SPH_C32(0x1bbc0300), SPH_C32(0x9eec0000), - SPH_C32(0xf6940000), SPH_C32(0x03024527), SPH_C32(0xcf70fcf2), - SPH_C32(0xb4431b17), SPH_C32(0x857f3c2b), SPH_C32(0xa4c20000), - SPH_C32(0xd9372400), SPH_C32(0x0a480000), SPH_C32(0x66610000), - SPH_C32(0xf87a12c7), SPH_C32(0x86bef75c), SPH_C32(0xa324df94), - SPH_C32(0x2ba05a55) }, - { SPH_C32(0xa4c20000), SPH_C32(0xd9372400), SPH_C32(0x0a480000), - SPH_C32(0x66610000), SPH_C32(0xf87a12c7), SPH_C32(0x86bef75c), - SPH_C32(0xa324df94), SPH_C32(0x2ba05a55), SPH_C32(0x75a40000), - SPH_C32(0xc28b2700), SPH_C32(0x94a40000), SPH_C32(0x90f50000), - SPH_C32(0xfb7857e0), SPH_C32(0x49ce0bae), SPH_C32(0x1767c483), - SPH_C32(0xaedf667e) }, - { SPH_C32(0x75c90003), SPH_C32(0x0e10c000), SPH_C32(0xd1200000), - SPH_C32(0xbaea0000), SPH_C32(0x8bc42f3e), SPH_C32(0x8758b757), - SPH_C32(0xbb28761d), SPH_C32(0x00b72e2b), SPH_C32(0xeecf0001), - SPH_C32(0x6f564000), SPH_C32(0xf33e0000), SPH_C32(0xa79e0000), - SPH_C32(0xbdb57219), SPH_C32(0xb711ebc5), SPH_C32(0x4a3b40ba), - SPH_C32(0xfeabf254) }, - { SPH_C32(0x006d0003), SPH_C32(0xcc9be700), SPH_C32(0x45840000), - SPH_C32(0x2a1f0000), SPH_C32(0x70bc78de), SPH_C32(0xce96bcf9), - SPH_C32(0xac4fb29e), SPH_C32(0xae684855), SPH_C32(0x3fa90001), - SPH_C32(0x74ea4300), SPH_C32(0x6dd20000), SPH_C32(0x510a0000), - SPH_C32(0xbeb7373e), SPH_C32(0x78611737), SPH_C32(0xfe785bad), - SPH_C32(0x7bd4ce7f) }, - { SPH_C32(0xa4af0003), SPH_C32(0x15acc300), SPH_C32(0x4fcc0000), - SPH_C32(0x4c7e0000), SPH_C32(0x88c66a19), SPH_C32(0x48284ba5), - SPH_C32(0x0f6b6d0a), SPH_C32(0x85c81200), SPH_C32(0x4a0d0001), - SPH_C32(0xb6616400), SPH_C32(0xf9760000), SPH_C32(0xc1ff0000), - SPH_C32(0x45cf60de), SPH_C32(0x31af1c99), SPH_C32(0xe91f9f2e), - SPH_C32(0xd50ba801) }, - { SPH_C32(0xd10b0003), SPH_C32(0xd727e400), SPH_C32(0xdb680000), - SPH_C32(0xdc8b0000), SPH_C32(0x73be3df9), SPH_C32(0x01e6400b), - SPH_C32(0x180ca989), SPH_C32(0x2b17747e), SPH_C32(0x9b6b0001), - SPH_C32(0xaddd6700), SPH_C32(0x679a0000), SPH_C32(0x376b0000), - SPH_C32(0x46cd25f9), SPH_C32(0xfedfe06b), SPH_C32(0x5d5c8439), - SPH_C32(0x5074942a) }, - { SPH_C32(0xeecf0001), SPH_C32(0x6f564000), SPH_C32(0xf33e0000), - SPH_C32(0xa79e0000), SPH_C32(0xbdb57219), SPH_C32(0xb711ebc5), - SPH_C32(0x4a3b40ba), SPH_C32(0xfeabf254), SPH_C32(0x9b060002), - SPH_C32(0x61468000), SPH_C32(0x221e0000), SPH_C32(0x1d740000), - SPH_C32(0x36715d27), SPH_C32(0x30495c92), SPH_C32(0xf11336a7), - SPH_C32(0xfe1cdc7f) }, - { SPH_C32(0x9b6b0001), SPH_C32(0xaddd6700), SPH_C32(0x679a0000), - SPH_C32(0x376b0000), SPH_C32(0x46cd25f9), SPH_C32(0xfedfe06b), - SPH_C32(0x5d5c8439), SPH_C32(0x5074942a), SPH_C32(0x4a600002), - SPH_C32(0x7afa8300), SPH_C32(0xbcf20000), SPH_C32(0xebe00000), - SPH_C32(0x35731800), SPH_C32(0xff39a060), SPH_C32(0x45502db0), - SPH_C32(0x7b63e054) }, - { SPH_C32(0x3fa90001), SPH_C32(0x74ea4300), SPH_C32(0x6dd20000), - SPH_C32(0x510a0000), SPH_C32(0xbeb7373e), SPH_C32(0x78611737), - SPH_C32(0xfe785bad), SPH_C32(0x7bd4ce7f), SPH_C32(0x3fc40002), - SPH_C32(0xb871a400), SPH_C32(0x28560000), SPH_C32(0x7b150000), - SPH_C32(0xce0b4fe0), SPH_C32(0xb6f7abce), SPH_C32(0x5237e933), - SPH_C32(0xd5bc862a) }, - { SPH_C32(0x4a0d0001), SPH_C32(0xb6616400), SPH_C32(0xf9760000), - SPH_C32(0xc1ff0000), SPH_C32(0x45cf60de), SPH_C32(0x31af1c99), - SPH_C32(0xe91f9f2e), SPH_C32(0xd50ba801), SPH_C32(0xeea20002), - SPH_C32(0xa3cda700), SPH_C32(0xb6ba0000), SPH_C32(0x8d810000), - SPH_C32(0xcd090ac7), SPH_C32(0x7987573c), SPH_C32(0xe674f224), - SPH_C32(0x50c3ba01) }, - { SPH_C32(0x9b060002), SPH_C32(0x61468000), SPH_C32(0x221e0000), - SPH_C32(0x1d740000), SPH_C32(0x36715d27), SPH_C32(0x30495c92), - SPH_C32(0xf11336a7), SPH_C32(0xfe1cdc7f), SPH_C32(0x75c90003), - SPH_C32(0x0e10c000), SPH_C32(0xd1200000), SPH_C32(0xbaea0000), - SPH_C32(0x8bc42f3e), SPH_C32(0x8758b757), SPH_C32(0xbb28761d), - SPH_C32(0x00b72e2b) }, - { SPH_C32(0xeea20002), SPH_C32(0xa3cda700), SPH_C32(0xb6ba0000), - SPH_C32(0x8d810000), SPH_C32(0xcd090ac7), SPH_C32(0x7987573c), - SPH_C32(0xe674f224), SPH_C32(0x50c3ba01), SPH_C32(0xa4af0003), - SPH_C32(0x15acc300), SPH_C32(0x4fcc0000), SPH_C32(0x4c7e0000), - SPH_C32(0x88c66a19), SPH_C32(0x48284ba5), SPH_C32(0x0f6b6d0a), - SPH_C32(0x85c81200) }, - { SPH_C32(0x4a600002), SPH_C32(0x7afa8300), SPH_C32(0xbcf20000), - SPH_C32(0xebe00000), SPH_C32(0x35731800), SPH_C32(0xff39a060), - SPH_C32(0x45502db0), SPH_C32(0x7b63e054), SPH_C32(0xd10b0003), - SPH_C32(0xd727e400), SPH_C32(0xdb680000), SPH_C32(0xdc8b0000), - SPH_C32(0x73be3df9), SPH_C32(0x01e6400b), SPH_C32(0x180ca989), - SPH_C32(0x2b17747e) }, - { SPH_C32(0x3fc40002), SPH_C32(0xb871a400), SPH_C32(0x28560000), - SPH_C32(0x7b150000), SPH_C32(0xce0b4fe0), SPH_C32(0xb6f7abce), - SPH_C32(0x5237e933), SPH_C32(0xd5bc862a), SPH_C32(0x006d0003), - SPH_C32(0xcc9be700), SPH_C32(0x45840000), SPH_C32(0x2a1f0000), - SPH_C32(0x70bc78de), SPH_C32(0xce96bcf9), SPH_C32(0xac4fb29e), - SPH_C32(0xae684855) }, - { SPH_C32(0xf6800005), SPH_C32(0x3443c000), SPH_C32(0x24070000), - SPH_C32(0x8f3d0000), SPH_C32(0x21373bfb), SPH_C32(0x0ab8d5ae), - SPH_C32(0xcdc58b19), SPH_C32(0xd795ba31), SPH_C32(0xa67f0001), - SPH_C32(0x71378000), SPH_C32(0x19fc0000), SPH_C32(0x96db0000), - SPH_C32(0x3a8b6dfd), SPH_C32(0xebcaaef3), SPH_C32(0x2c6d478f), - SPH_C32(0xac8e6c88) }, - { SPH_C32(0x83240005), SPH_C32(0xf6c8e700), SPH_C32(0xb0a30000), - SPH_C32(0x1fc80000), SPH_C32(0xda4f6c1b), SPH_C32(0x4376de00), - SPH_C32(0xdaa24f9a), SPH_C32(0x794adc4f), SPH_C32(0x77190001), - SPH_C32(0x6a8b8300), SPH_C32(0x87100000), SPH_C32(0x604f0000), - SPH_C32(0x398928da), SPH_C32(0x24ba5201), SPH_C32(0x982e5c98), - SPH_C32(0x29f150a3) }, - { SPH_C32(0x27e60005), SPH_C32(0x2fffc300), SPH_C32(0xbaeb0000), - SPH_C32(0x79a90000), SPH_C32(0x22357edc), SPH_C32(0xc5c8295c), - SPH_C32(0x7986900e), SPH_C32(0x52ea861a), SPH_C32(0x02bd0001), - SPH_C32(0xa800a400), SPH_C32(0x13b40000), SPH_C32(0xf0ba0000), - SPH_C32(0xc2f17f3a), SPH_C32(0x6d7459af), SPH_C32(0x8f49981b), - SPH_C32(0x872e36dd) }, - { SPH_C32(0x52420005), SPH_C32(0xed74e400), SPH_C32(0x2e4f0000), - SPH_C32(0xe95c0000), SPH_C32(0xd94d293c), SPH_C32(0x8c0622f2), - SPH_C32(0x6ee1548d), SPH_C32(0xfc35e064), SPH_C32(0xd3db0001), - SPH_C32(0xb3bca700), SPH_C32(0x8d580000), SPH_C32(0x062e0000), - SPH_C32(0xc1f33a1d), SPH_C32(0xa204a55d), SPH_C32(0x3b0a830c), - SPH_C32(0x02510af6) }, - { SPH_C32(0x83490006), SPH_C32(0x3a530000), SPH_C32(0xf5270000), - SPH_C32(0x35d70000), SPH_C32(0xaaf314c5), SPH_C32(0x8de062f9), - SPH_C32(0x76edfd04), SPH_C32(0xd722941a), SPH_C32(0x48b00000), - SPH_C32(0x1e61c000), SPH_C32(0xeac20000), SPH_C32(0x31450000), - SPH_C32(0x873e1fe4), SPH_C32(0x5cdb4536), SPH_C32(0x66560735), - SPH_C32(0x52259edc) }, - { SPH_C32(0xf6ed0006), SPH_C32(0xf8d82700), SPH_C32(0x61830000), - SPH_C32(0xa5220000), SPH_C32(0x518b4325), SPH_C32(0xc42e6957), - SPH_C32(0x618a3987), SPH_C32(0x79fdf264), SPH_C32(0x99d60000), - SPH_C32(0x05ddc300), SPH_C32(0x742e0000), SPH_C32(0xc7d10000), - SPH_C32(0x843c5ac3), SPH_C32(0x93abb9c4), SPH_C32(0xd2151c22), - SPH_C32(0xd75aa2f7) }, - { SPH_C32(0x522f0006), SPH_C32(0x21ef0300), SPH_C32(0x6bcb0000), - SPH_C32(0xc3430000), SPH_C32(0xa9f151e2), SPH_C32(0x42909e0b), - SPH_C32(0xc2aee613), SPH_C32(0x525da831), SPH_C32(0xec720000), - SPH_C32(0xc756e400), SPH_C32(0xe08a0000), SPH_C32(0x57240000), - SPH_C32(0x7f440d23), SPH_C32(0xda65b26a), SPH_C32(0xc572d8a1), - SPH_C32(0x7985c489) }, - { SPH_C32(0x278b0006), SPH_C32(0xe3642400), SPH_C32(0xff6f0000), - SPH_C32(0x53b60000), SPH_C32(0x52890602), SPH_C32(0x0b5e95a5), - SPH_C32(0xd5c92290), SPH_C32(0xfc82ce4f), SPH_C32(0x3d140000), - SPH_C32(0xdceae700), SPH_C32(0x7e660000), SPH_C32(0xa1b00000), - SPH_C32(0x7c464804), SPH_C32(0x15154e98), SPH_C32(0x7131c3b6), - SPH_C32(0xfcfaf8a2) }, - { SPH_C32(0x184f0004), SPH_C32(0x5b158000), SPH_C32(0xd7390000), - SPH_C32(0x28a30000), SPH_C32(0x9c8249e2), SPH_C32(0xbda93e6b), - SPH_C32(0x87fecba3), SPH_C32(0x293e4865), SPH_C32(0x3d790003), - SPH_C32(0x10710000), SPH_C32(0x3be20000), SPH_C32(0x8baf0000), - SPH_C32(0x0cfa30da), SPH_C32(0xdb83f261), SPH_C32(0xdd7e7128), - SPH_C32(0x5292b0f7) }, - { SPH_C32(0x6deb0004), SPH_C32(0x999ea700), SPH_C32(0x439d0000), - SPH_C32(0xb8560000), SPH_C32(0x67fa1e02), SPH_C32(0xf46735c5), - SPH_C32(0x90990f20), SPH_C32(0x87e12e1b), SPH_C32(0xec1f0003), - SPH_C32(0x0bcd0300), SPH_C32(0xa50e0000), SPH_C32(0x7d3b0000), - SPH_C32(0x0ff875fd), SPH_C32(0x14f30e93), SPH_C32(0x693d6a3f), - SPH_C32(0xd7ed8cdc) }, - { SPH_C32(0xc9290004), SPH_C32(0x40a98300), SPH_C32(0x49d50000), - SPH_C32(0xde370000), SPH_C32(0x9f800cc5), SPH_C32(0x72d9c299), - SPH_C32(0x33bdd0b4), SPH_C32(0xac41744e), SPH_C32(0x99bb0003), - SPH_C32(0xc9462400), SPH_C32(0x31aa0000), SPH_C32(0xedce0000), - SPH_C32(0xf480221d), SPH_C32(0x5d3d053d), SPH_C32(0x7e5aaebc), - SPH_C32(0x7932eaa2) }, - { SPH_C32(0xbc8d0004), SPH_C32(0x8222a400), SPH_C32(0xdd710000), - SPH_C32(0x4ec20000), SPH_C32(0x64f85b25), SPH_C32(0x3b17c937), - SPH_C32(0x24da1437), SPH_C32(0x029e1230), SPH_C32(0x48dd0003), - SPH_C32(0xd2fa2700), SPH_C32(0xaf460000), SPH_C32(0x1b5a0000), - SPH_C32(0xf782673a), SPH_C32(0x924df9cf), SPH_C32(0xca19b5ab), - SPH_C32(0xfc4dd689) }, - { SPH_C32(0x6d860007), SPH_C32(0x55054000), SPH_C32(0x06190000), - SPH_C32(0x92490000), SPH_C32(0x174666dc), SPH_C32(0x3af1893c), - SPH_C32(0x3cd6bdbe), SPH_C32(0x2989664e), SPH_C32(0xd3b60002), - SPH_C32(0x7f274000), SPH_C32(0xc8dc0000), SPH_C32(0x2c310000), - SPH_C32(0xb14f42c3), SPH_C32(0x6c9219a4), SPH_C32(0x97453192), - SPH_C32(0xac3942a3) }, - { SPH_C32(0x18220007), SPH_C32(0x978e6700), SPH_C32(0x92bd0000), - SPH_C32(0x02bc0000), SPH_C32(0xec3e313c), SPH_C32(0x733f8292), - SPH_C32(0x2bb1793d), SPH_C32(0x87560030), SPH_C32(0x02d00002), - SPH_C32(0x649b4300), SPH_C32(0x56300000), SPH_C32(0xdaa50000), - SPH_C32(0xb24d07e4), SPH_C32(0xa3e2e556), SPH_C32(0x23062a85), - SPH_C32(0x29467e88) }, - { SPH_C32(0xbce00007), SPH_C32(0x4eb94300), SPH_C32(0x98f50000), - SPH_C32(0x64dd0000), SPH_C32(0x144423fb), SPH_C32(0xf58175ce), - SPH_C32(0x8895a6a9), SPH_C32(0xacf65a65), SPH_C32(0x77740002), - SPH_C32(0xa6106400), SPH_C32(0xc2940000), SPH_C32(0x4a500000), - SPH_C32(0x49355004), SPH_C32(0xea2ceef8), SPH_C32(0x3461ee06), - SPH_C32(0x879918f6) }, - { SPH_C32(0xc9440007), SPH_C32(0x8c326400), SPH_C32(0x0c510000), - SPH_C32(0xf4280000), SPH_C32(0xef3c741b), SPH_C32(0xbc4f7e60), - SPH_C32(0x9ff2622a), SPH_C32(0x02293c1b), SPH_C32(0xa6120002), - SPH_C32(0xbdac6700), SPH_C32(0x5c780000), SPH_C32(0xbcc40000), - SPH_C32(0x4a371523), SPH_C32(0x255c120a), SPH_C32(0x8022f511), - SPH_C32(0x02e624dd) } -}; - -static const sph_u32 T512_20[32][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xc6730000), SPH_C32(0xaf8d000c), SPH_C32(0xa4c10000), - SPH_C32(0x218d0000), SPH_C32(0x23111587), SPH_C32(0x7913512f), - SPH_C32(0x1d28ac88), SPH_C32(0x378dd173), SPH_C32(0xaf220000), - SPH_C32(0x7b6c0090), SPH_C32(0x67e20000), SPH_C32(0x8da20000), - SPH_C32(0xc7841e29), SPH_C32(0xb7b744f3), SPH_C32(0x9ac484f4), - SPH_C32(0x8b6c72bd) }, - { SPH_C32(0x0c720000), SPH_C32(0x49e50f00), SPH_C32(0x42790000), - SPH_C32(0x5cea0000), SPH_C32(0x33aa301a), SPH_C32(0x15822514), - SPH_C32(0x95a34b7b), SPH_C32(0xb44b0090), SPH_C32(0xfe220000), - SPH_C32(0xa7580500), SPH_C32(0x25d10000), SPH_C32(0xf7600000), - SPH_C32(0x893178da), SPH_C32(0x1fd4f860), SPH_C32(0x4ed0a315), - SPH_C32(0xa123ff9f) }, - { SPH_C32(0xca010000), SPH_C32(0xe6680f0c), SPH_C32(0xe6b80000), - SPH_C32(0x7d670000), SPH_C32(0x10bb259d), SPH_C32(0x6c91743b), - SPH_C32(0x888be7f3), SPH_C32(0x83c6d1e3), SPH_C32(0x51000000), - SPH_C32(0xdc340590), SPH_C32(0x42330000), SPH_C32(0x7ac20000), - SPH_C32(0x4eb566f3), SPH_C32(0xa863bc93), SPH_C32(0xd41427e1), - SPH_C32(0x2a4f8d22) }, - { SPH_C32(0xfe220000), SPH_C32(0xa7580500), SPH_C32(0x25d10000), - SPH_C32(0xf7600000), SPH_C32(0x893178da), SPH_C32(0x1fd4f860), - SPH_C32(0x4ed0a315), SPH_C32(0xa123ff9f), SPH_C32(0xf2500000), - SPH_C32(0xeebd0a00), SPH_C32(0x67a80000), SPH_C32(0xab8a0000), - SPH_C32(0xba9b48c0), SPH_C32(0x0a56dd74), SPH_C32(0xdb73e86e), - SPH_C32(0x1568ff0f) }, - { SPH_C32(0x38510000), SPH_C32(0x08d5050c), SPH_C32(0x81100000), - SPH_C32(0xd6ed0000), SPH_C32(0xaa206d5d), SPH_C32(0x66c7a94f), - SPH_C32(0x53f80f9d), SPH_C32(0x96ae2eec), SPH_C32(0x5d720000), - SPH_C32(0x95d10a90), SPH_C32(0x004a0000), SPH_C32(0x26280000), - SPH_C32(0x7d1f56e9), SPH_C32(0xbde19987), SPH_C32(0x41b76c9a), - SPH_C32(0x9e048db2) }, - { SPH_C32(0xf2500000), SPH_C32(0xeebd0a00), SPH_C32(0x67a80000), - SPH_C32(0xab8a0000), SPH_C32(0xba9b48c0), SPH_C32(0x0a56dd74), - SPH_C32(0xdb73e86e), SPH_C32(0x1568ff0f), SPH_C32(0x0c720000), - SPH_C32(0x49e50f00), SPH_C32(0x42790000), SPH_C32(0x5cea0000), - SPH_C32(0x33aa301a), SPH_C32(0x15822514), SPH_C32(0x95a34b7b), - SPH_C32(0xb44b0090) }, - { SPH_C32(0x34230000), SPH_C32(0x41300a0c), SPH_C32(0xc3690000), - SPH_C32(0x8a070000), SPH_C32(0x998a5d47), SPH_C32(0x73458c5b), - SPH_C32(0xc65b44e6), SPH_C32(0x22e52e7c), SPH_C32(0xa3500000), - SPH_C32(0x32890f90), SPH_C32(0x259b0000), SPH_C32(0xd1480000), - SPH_C32(0xf42e2e33), SPH_C32(0xa23561e7), SPH_C32(0x0f67cf8f), - SPH_C32(0x3f27722d) }, - { SPH_C32(0x45180000), SPH_C32(0xa5b51700), SPH_C32(0xf96a0000), - SPH_C32(0x3b480000), SPH_C32(0x1ecc142c), SPH_C32(0x231395d6), - SPH_C32(0x16bca6b0), SPH_C32(0xdf33f4df), SPH_C32(0xb83d0000), - SPH_C32(0x16710600), SPH_C32(0x379a0000), SPH_C32(0xf5b10000), - SPH_C32(0x228161ac), SPH_C32(0xae48f145), SPH_C32(0x66241616), - SPH_C32(0xc5c1eb3e) }, - { SPH_C32(0x836b0000), SPH_C32(0x0a38170c), SPH_C32(0x5dab0000), - SPH_C32(0x1ac50000), SPH_C32(0x3ddd01ab), SPH_C32(0x5a00c4f9), - SPH_C32(0x0b940a38), SPH_C32(0xe8be25ac), SPH_C32(0x171f0000), - SPH_C32(0x6d1d0690), SPH_C32(0x50780000), SPH_C32(0x78130000), - SPH_C32(0xe5057f85), SPH_C32(0x19ffb5b6), SPH_C32(0xfce092e2), - SPH_C32(0x4ead9983) }, - { SPH_C32(0x496a0000), SPH_C32(0xec501800), SPH_C32(0xbb130000), - SPH_C32(0x67a20000), SPH_C32(0x2d662436), SPH_C32(0x3691b0c2), - SPH_C32(0x831fedcb), SPH_C32(0x6b78f44f), SPH_C32(0x461f0000), - SPH_C32(0xb1290300), SPH_C32(0x124b0000), SPH_C32(0x02d10000), - SPH_C32(0xabb01976), SPH_C32(0xb19c0925), SPH_C32(0x28f4b503), - SPH_C32(0x64e214a1) }, - { SPH_C32(0x8f190000), SPH_C32(0x43dd180c), SPH_C32(0x1fd20000), - SPH_C32(0x462f0000), SPH_C32(0x0e7731b1), SPH_C32(0x4f82e1ed), - SPH_C32(0x9e374143), SPH_C32(0x5cf5253c), SPH_C32(0xe93d0000), - SPH_C32(0xca450390), SPH_C32(0x75a90000), SPH_C32(0x8f730000), - SPH_C32(0x6c34075f), SPH_C32(0x062b4dd6), SPH_C32(0xb23031f7), - SPH_C32(0xef8e661c) }, - { SPH_C32(0xbb3a0000), SPH_C32(0x02ed1200), SPH_C32(0xdcbb0000), - SPH_C32(0xcc280000), SPH_C32(0x97fd6cf6), SPH_C32(0x3cc76db6), - SPH_C32(0x586c05a5), SPH_C32(0x7e100b40), SPH_C32(0x4a6d0000), - SPH_C32(0xf8cc0c00), SPH_C32(0x50320000), SPH_C32(0x5e3b0000), - SPH_C32(0x981a296c), SPH_C32(0xa41e2c31), SPH_C32(0xbd57fe78), - SPH_C32(0xd0a91431) }, - { SPH_C32(0x7d490000), SPH_C32(0xad60120c), SPH_C32(0x787a0000), - SPH_C32(0xeda50000), SPH_C32(0xb4ec7971), SPH_C32(0x45d43c99), - SPH_C32(0x4544a92d), SPH_C32(0x499dda33), SPH_C32(0xe54f0000), - SPH_C32(0x83a00c90), SPH_C32(0x37d00000), SPH_C32(0xd3990000), - SPH_C32(0x5f9e3745), SPH_C32(0x13a968c2), SPH_C32(0x27937a8c), - SPH_C32(0x5bc5668c) }, - { SPH_C32(0xb7480000), SPH_C32(0x4b081d00), SPH_C32(0x9ec20000), - SPH_C32(0x90c20000), SPH_C32(0xa4575cec), SPH_C32(0x294548a2), - SPH_C32(0xcdcf4ede), SPH_C32(0xca5b0bd0), SPH_C32(0xb44f0000), - SPH_C32(0x5f940900), SPH_C32(0x75e30000), SPH_C32(0xa95b0000), - SPH_C32(0x112b51b6), SPH_C32(0xbbcad451), SPH_C32(0xf3875d6d), - SPH_C32(0x718aebae) }, - { SPH_C32(0x713b0000), SPH_C32(0xe4851d0c), SPH_C32(0x3a030000), - SPH_C32(0xb14f0000), SPH_C32(0x8746496b), SPH_C32(0x5056198d), - SPH_C32(0xd0e7e256), SPH_C32(0xfdd6daa3), SPH_C32(0x1b6d0000), - SPH_C32(0x24f80990), SPH_C32(0x12010000), SPH_C32(0x24f90000), - SPH_C32(0xd6af4f9f), SPH_C32(0x0c7d90a2), SPH_C32(0x6943d999), - SPH_C32(0xfae69913) }, - { SPH_C32(0xb83d0000), SPH_C32(0x16710600), SPH_C32(0x379a0000), - SPH_C32(0xf5b10000), SPH_C32(0x228161ac), SPH_C32(0xae48f145), - SPH_C32(0x66241616), SPH_C32(0xc5c1eb3e), SPH_C32(0xfd250000), - SPH_C32(0xb3c41100), SPH_C32(0xcef00000), SPH_C32(0xcef90000), - SPH_C32(0x3c4d7580), SPH_C32(0x8d5b6493), SPH_C32(0x7098b0a6), - SPH_C32(0x1af21fe1) }, - { SPH_C32(0x7e4e0000), SPH_C32(0xb9fc060c), SPH_C32(0x935b0000), - SPH_C32(0xd43c0000), SPH_C32(0x0190742b), SPH_C32(0xd75ba06a), - SPH_C32(0x7b0cba9e), SPH_C32(0xf24c3a4d), SPH_C32(0x52070000), - SPH_C32(0xc8a81190), SPH_C32(0xa9120000), SPH_C32(0x435b0000), - SPH_C32(0xfbc96ba9), SPH_C32(0x3aec2060), SPH_C32(0xea5c3452), - SPH_C32(0x919e6d5c) }, - { SPH_C32(0xb44f0000), SPH_C32(0x5f940900), SPH_C32(0x75e30000), - SPH_C32(0xa95b0000), SPH_C32(0x112b51b6), SPH_C32(0xbbcad451), - SPH_C32(0xf3875d6d), SPH_C32(0x718aebae), SPH_C32(0x03070000), - SPH_C32(0x149c1400), SPH_C32(0xeb210000), SPH_C32(0x39990000), - SPH_C32(0xb57c0d5a), SPH_C32(0x928f9cf3), SPH_C32(0x3e4813b3), - SPH_C32(0xbbd1e07e) }, - { SPH_C32(0x723c0000), SPH_C32(0xf019090c), SPH_C32(0xd1220000), - SPH_C32(0x88d60000), SPH_C32(0x323a4431), SPH_C32(0xc2d9857e), - SPH_C32(0xeeaff1e5), SPH_C32(0x46073add), SPH_C32(0xac250000), - SPH_C32(0x6ff01490), SPH_C32(0x8cc30000), SPH_C32(0xb43b0000), - SPH_C32(0x72f81373), SPH_C32(0x2538d800), SPH_C32(0xa48c9747), - SPH_C32(0x30bd92c3) }, - { SPH_C32(0x461f0000), SPH_C32(0xb1290300), SPH_C32(0x124b0000), - SPH_C32(0x02d10000), SPH_C32(0xabb01976), SPH_C32(0xb19c0925), - SPH_C32(0x28f4b503), SPH_C32(0x64e214a1), SPH_C32(0x0f750000), - SPH_C32(0x5d791b00), SPH_C32(0xa9580000), SPH_C32(0x65730000), - SPH_C32(0x86d63d40), SPH_C32(0x870db9e7), SPH_C32(0xabeb58c8), - SPH_C32(0x0f9ae0ee) }, - { SPH_C32(0x806c0000), SPH_C32(0x1ea4030c), SPH_C32(0xb68a0000), - SPH_C32(0x235c0000), SPH_C32(0x88a10cf1), SPH_C32(0xc88f580a), - SPH_C32(0x35dc198b), SPH_C32(0x536fc5d2), SPH_C32(0xa0570000), - SPH_C32(0x26151b90), SPH_C32(0xceba0000), SPH_C32(0xe8d10000), - SPH_C32(0x41522369), SPH_C32(0x30bafd14), SPH_C32(0x312fdc3c), - SPH_C32(0x84f69253) }, - { SPH_C32(0x4a6d0000), SPH_C32(0xf8cc0c00), SPH_C32(0x50320000), - SPH_C32(0x5e3b0000), SPH_C32(0x981a296c), SPH_C32(0xa41e2c31), - SPH_C32(0xbd57fe78), SPH_C32(0xd0a91431), SPH_C32(0xf1570000), - SPH_C32(0xfa211e00), SPH_C32(0x8c890000), SPH_C32(0x92130000), - SPH_C32(0x0fe7459a), SPH_C32(0x98d94187), SPH_C32(0xe53bfbdd), - SPH_C32(0xaeb91f71) }, - { SPH_C32(0x8c1e0000), SPH_C32(0x57410c0c), SPH_C32(0xf4f30000), - SPH_C32(0x7fb60000), SPH_C32(0xbb0b3ceb), SPH_C32(0xdd0d7d1e), - SPH_C32(0xa07f52f0), SPH_C32(0xe724c542), SPH_C32(0x5e750000), - SPH_C32(0x814d1e90), SPH_C32(0xeb6b0000), SPH_C32(0x1fb10000), - SPH_C32(0xc8635bb3), SPH_C32(0x2f6e0574), SPH_C32(0x7fff7f29), - SPH_C32(0x25d56dcc) }, - { SPH_C32(0xfd250000), SPH_C32(0xb3c41100), SPH_C32(0xcef00000), - SPH_C32(0xcef90000), SPH_C32(0x3c4d7580), SPH_C32(0x8d5b6493), - SPH_C32(0x7098b0a6), SPH_C32(0x1af21fe1), SPH_C32(0x45180000), - SPH_C32(0xa5b51700), SPH_C32(0xf96a0000), SPH_C32(0x3b480000), - SPH_C32(0x1ecc142c), SPH_C32(0x231395d6), SPH_C32(0x16bca6b0), - SPH_C32(0xdf33f4df) }, - { SPH_C32(0x3b560000), SPH_C32(0x1c49110c), SPH_C32(0x6a310000), - SPH_C32(0xef740000), SPH_C32(0x1f5c6007), SPH_C32(0xf44835bc), - SPH_C32(0x6db01c2e), SPH_C32(0x2d7fce92), SPH_C32(0xea3a0000), - SPH_C32(0xded91790), SPH_C32(0x9e880000), SPH_C32(0xb6ea0000), - SPH_C32(0xd9480a05), SPH_C32(0x94a4d125), SPH_C32(0x8c782244), - SPH_C32(0x545f8662) }, - { SPH_C32(0xf1570000), SPH_C32(0xfa211e00), SPH_C32(0x8c890000), - SPH_C32(0x92130000), SPH_C32(0x0fe7459a), SPH_C32(0x98d94187), - SPH_C32(0xe53bfbdd), SPH_C32(0xaeb91f71), SPH_C32(0xbb3a0000), - SPH_C32(0x02ed1200), SPH_C32(0xdcbb0000), SPH_C32(0xcc280000), - SPH_C32(0x97fd6cf6), SPH_C32(0x3cc76db6), SPH_C32(0x586c05a5), - SPH_C32(0x7e100b40) }, - { SPH_C32(0x37240000), SPH_C32(0x55ac1e0c), SPH_C32(0x28480000), - SPH_C32(0xb39e0000), SPH_C32(0x2cf6501d), SPH_C32(0xe1ca10a8), - SPH_C32(0xf8135755), SPH_C32(0x9934ce02), SPH_C32(0x14180000), - SPH_C32(0x79811290), SPH_C32(0xbb590000), SPH_C32(0x418a0000), - SPH_C32(0x507972df), SPH_C32(0x8b702945), SPH_C32(0xc2a88151), - SPH_C32(0xf57c79fd) }, - { SPH_C32(0x03070000), SPH_C32(0x149c1400), SPH_C32(0xeb210000), - SPH_C32(0x39990000), SPH_C32(0xb57c0d5a), SPH_C32(0x928f9cf3), - SPH_C32(0x3e4813b3), SPH_C32(0xbbd1e07e), SPH_C32(0xb7480000), - SPH_C32(0x4b081d00), SPH_C32(0x9ec20000), SPH_C32(0x90c20000), - SPH_C32(0xa4575cec), SPH_C32(0x294548a2), SPH_C32(0xcdcf4ede), - SPH_C32(0xca5b0bd0) }, - { SPH_C32(0xc5740000), SPH_C32(0xbb11140c), SPH_C32(0x4fe00000), - SPH_C32(0x18140000), SPH_C32(0x966d18dd), SPH_C32(0xeb9ccddc), - SPH_C32(0x2360bf3b), SPH_C32(0x8c5c310d), SPH_C32(0x186a0000), - SPH_C32(0x30641d90), SPH_C32(0xf9200000), SPH_C32(0x1d600000), - SPH_C32(0x63d342c5), SPH_C32(0x9ef20c51), SPH_C32(0x570bca2a), - SPH_C32(0x4137796d) }, - { SPH_C32(0x0f750000), SPH_C32(0x5d791b00), SPH_C32(0xa9580000), - SPH_C32(0x65730000), SPH_C32(0x86d63d40), SPH_C32(0x870db9e7), - SPH_C32(0xabeb58c8), SPH_C32(0x0f9ae0ee), SPH_C32(0x496a0000), - SPH_C32(0xec501800), SPH_C32(0xbb130000), SPH_C32(0x67a20000), - SPH_C32(0x2d662436), SPH_C32(0x3691b0c2), SPH_C32(0x831fedcb), - SPH_C32(0x6b78f44f) }, - { SPH_C32(0xc9060000), SPH_C32(0xf2f41b0c), SPH_C32(0x0d990000), - SPH_C32(0x44fe0000), SPH_C32(0xa5c728c7), SPH_C32(0xfe1ee8c8), - SPH_C32(0xb6c3f440), SPH_C32(0x3817319d), SPH_C32(0xe6480000), - SPH_C32(0x973c1890), SPH_C32(0xdcf10000), SPH_C32(0xea000000), - SPH_C32(0xeae23a1f), SPH_C32(0x8126f431), SPH_C32(0x19db693f), - SPH_C32(0xe01486f2) } -}; - -static const sph_u32 T512_25[32][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x14190000), SPH_C32(0x23ca003c), SPH_C32(0x50df0000), - SPH_C32(0x44b60000), SPH_C32(0x1b6c67b0), SPH_C32(0x3cf3ac75), - SPH_C32(0x61e610b0), SPH_C32(0xdbcadb80), SPH_C32(0xe3430000), - SPH_C32(0x3a4e0014), SPH_C32(0xf2c60000), SPH_C32(0xaa4e0000), - SPH_C32(0xdb1e42a6), SPH_C32(0x256bbe15), SPH_C32(0x123db156), - SPH_C32(0x3a4e99d7) }, - { SPH_C32(0xe3430000), SPH_C32(0x3a4e0014), SPH_C32(0xf2c60000), - SPH_C32(0xaa4e0000), SPH_C32(0xdb1e42a6), SPH_C32(0x256bbe15), - SPH_C32(0x123db156), SPH_C32(0x3a4e99d7), SPH_C32(0xf75a0000), - SPH_C32(0x19840028), SPH_C32(0xa2190000), SPH_C32(0xeef80000), - SPH_C32(0xc0722516), SPH_C32(0x19981260), SPH_C32(0x73dba1e6), - SPH_C32(0xe1844257) }, - { SPH_C32(0xf75a0000), SPH_C32(0x19840028), SPH_C32(0xa2190000), - SPH_C32(0xeef80000), SPH_C32(0xc0722516), SPH_C32(0x19981260), - SPH_C32(0x73dba1e6), SPH_C32(0xe1844257), SPH_C32(0x14190000), - SPH_C32(0x23ca003c), SPH_C32(0x50df0000), SPH_C32(0x44b60000), - SPH_C32(0x1b6c67b0), SPH_C32(0x3cf3ac75), SPH_C32(0x61e610b0), - SPH_C32(0xdbcadb80) }, - { SPH_C32(0x54500000), SPH_C32(0x0671005c), SPH_C32(0x25ae0000), - SPH_C32(0x6a1e0000), SPH_C32(0x2ea54edf), SPH_C32(0x664e8512), - SPH_C32(0xbfba18c3), SPH_C32(0x7e715d17), SPH_C32(0xbc8d0000), - SPH_C32(0xfc3b0018), SPH_C32(0x19830000), SPH_C32(0xd10b0000), - SPH_C32(0xae1878c4), SPH_C32(0x42a69856), SPH_C32(0x0012da37), - SPH_C32(0x2c3b504e) }, - { SPH_C32(0x40490000), SPH_C32(0x25bb0060), SPH_C32(0x75710000), - SPH_C32(0x2ea80000), SPH_C32(0x35c9296f), SPH_C32(0x5abd2967), - SPH_C32(0xde5c0873), SPH_C32(0xa5bb8697), SPH_C32(0x5fce0000), - SPH_C32(0xc675000c), SPH_C32(0xeb450000), SPH_C32(0x7b450000), - SPH_C32(0x75063a62), SPH_C32(0x67cd2643), SPH_C32(0x122f6b61), - SPH_C32(0x1675c999) }, - { SPH_C32(0xb7130000), SPH_C32(0x3c3f0048), SPH_C32(0xd7680000), - SPH_C32(0xc0500000), SPH_C32(0xf5bb0c79), SPH_C32(0x43253b07), - SPH_C32(0xad87a995), SPH_C32(0x443fc4c0), SPH_C32(0x4bd70000), - SPH_C32(0xe5bf0030), SPH_C32(0xbb9a0000), SPH_C32(0x3ff30000), - SPH_C32(0x6e6a5dd2), SPH_C32(0x5b3e8a36), SPH_C32(0x73c97bd1), - SPH_C32(0xcdbf1219) }, - { SPH_C32(0xa30a0000), SPH_C32(0x1ff50074), SPH_C32(0x87b70000), - SPH_C32(0x84e60000), SPH_C32(0xeed76bc9), SPH_C32(0x7fd69772), - SPH_C32(0xcc61b925), SPH_C32(0x9ff51f40), SPH_C32(0xa8940000), - SPH_C32(0xdff10024), SPH_C32(0x495c0000), SPH_C32(0x95bd0000), - SPH_C32(0xb5741f74), SPH_C32(0x7e553423), SPH_C32(0x61f4ca87), - SPH_C32(0xf7f18bce) }, - { SPH_C32(0xbc8d0000), SPH_C32(0xfc3b0018), SPH_C32(0x19830000), - SPH_C32(0xd10b0000), SPH_C32(0xae1878c4), SPH_C32(0x42a69856), - SPH_C32(0x0012da37), SPH_C32(0x2c3b504e), SPH_C32(0xe8dd0000), - SPH_C32(0xfa4a0044), SPH_C32(0x3c2d0000), SPH_C32(0xbb150000), - SPH_C32(0x80bd361b), SPH_C32(0x24e81d44), SPH_C32(0xbfa8c2f4), - SPH_C32(0x524a0d59) }, - { SPH_C32(0xa8940000), SPH_C32(0xdff10024), SPH_C32(0x495c0000), - SPH_C32(0x95bd0000), SPH_C32(0xb5741f74), SPH_C32(0x7e553423), - SPH_C32(0x61f4ca87), SPH_C32(0xf7f18bce), SPH_C32(0x0b9e0000), - SPH_C32(0xc0040050), SPH_C32(0xceeb0000), SPH_C32(0x115b0000), - SPH_C32(0x5ba374bd), SPH_C32(0x0183a351), SPH_C32(0xad9573a2), - SPH_C32(0x6804948e) }, - { SPH_C32(0x5fce0000), SPH_C32(0xc675000c), SPH_C32(0xeb450000), - SPH_C32(0x7b450000), SPH_C32(0x75063a62), SPH_C32(0x67cd2643), - SPH_C32(0x122f6b61), SPH_C32(0x1675c999), SPH_C32(0x1f870000), - SPH_C32(0xe3ce006c), SPH_C32(0x9e340000), SPH_C32(0x55ed0000), - SPH_C32(0x40cf130d), SPH_C32(0x3d700f24), SPH_C32(0xcc736312), - SPH_C32(0xb3ce4f0e) }, - { SPH_C32(0x4bd70000), SPH_C32(0xe5bf0030), SPH_C32(0xbb9a0000), - SPH_C32(0x3ff30000), SPH_C32(0x6e6a5dd2), SPH_C32(0x5b3e8a36), - SPH_C32(0x73c97bd1), SPH_C32(0xcdbf1219), SPH_C32(0xfcc40000), - SPH_C32(0xd9800078), SPH_C32(0x6cf20000), SPH_C32(0xffa30000), - SPH_C32(0x9bd151ab), SPH_C32(0x181bb131), SPH_C32(0xde4ed244), - SPH_C32(0x8980d6d9) }, - { SPH_C32(0xe8dd0000), SPH_C32(0xfa4a0044), SPH_C32(0x3c2d0000), - SPH_C32(0xbb150000), SPH_C32(0x80bd361b), SPH_C32(0x24e81d44), - SPH_C32(0xbfa8c2f4), SPH_C32(0x524a0d59), SPH_C32(0x54500000), - SPH_C32(0x0671005c), SPH_C32(0x25ae0000), SPH_C32(0x6a1e0000), - SPH_C32(0x2ea54edf), SPH_C32(0x664e8512), SPH_C32(0xbfba18c3), - SPH_C32(0x7e715d17) }, - { SPH_C32(0xfcc40000), SPH_C32(0xd9800078), SPH_C32(0x6cf20000), - SPH_C32(0xffa30000), SPH_C32(0x9bd151ab), SPH_C32(0x181bb131), - SPH_C32(0xde4ed244), SPH_C32(0x8980d6d9), SPH_C32(0xb7130000), - SPH_C32(0x3c3f0048), SPH_C32(0xd7680000), SPH_C32(0xc0500000), - SPH_C32(0xf5bb0c79), SPH_C32(0x43253b07), SPH_C32(0xad87a995), - SPH_C32(0x443fc4c0) }, - { SPH_C32(0x0b9e0000), SPH_C32(0xc0040050), SPH_C32(0xceeb0000), - SPH_C32(0x115b0000), SPH_C32(0x5ba374bd), SPH_C32(0x0183a351), - SPH_C32(0xad9573a2), SPH_C32(0x6804948e), SPH_C32(0xa30a0000), - SPH_C32(0x1ff50074), SPH_C32(0x87b70000), SPH_C32(0x84e60000), - SPH_C32(0xeed76bc9), SPH_C32(0x7fd69772), SPH_C32(0xcc61b925), - SPH_C32(0x9ff51f40) }, - { SPH_C32(0x1f870000), SPH_C32(0xe3ce006c), SPH_C32(0x9e340000), - SPH_C32(0x55ed0000), SPH_C32(0x40cf130d), SPH_C32(0x3d700f24), - SPH_C32(0xcc736312), SPH_C32(0xb3ce4f0e), SPH_C32(0x40490000), - SPH_C32(0x25bb0060), SPH_C32(0x75710000), SPH_C32(0x2ea80000), - SPH_C32(0x35c9296f), SPH_C32(0x5abd2967), SPH_C32(0xde5c0873), - SPH_C32(0xa5bb8697) }, - { SPH_C32(0x69510000), SPH_C32(0xd4e1009c), SPH_C32(0xc3230000), - SPH_C32(0xac2f0000), SPH_C32(0xe4950bae), SPH_C32(0xcea415dc), - SPH_C32(0x87ec287c), SPH_C32(0xbce1a3ce), SPH_C32(0xc6730000), - SPH_C32(0xaf8d000c), SPH_C32(0xa4c10000), SPH_C32(0x218d0000), - SPH_C32(0x23111587), SPH_C32(0x7913512f), SPH_C32(0x1d28ac88), - SPH_C32(0x378dd173) }, - { SPH_C32(0x7d480000), SPH_C32(0xf72b00a0), SPH_C32(0x93fc0000), - SPH_C32(0xe8990000), SPH_C32(0xfff96c1e), SPH_C32(0xf257b9a9), - SPH_C32(0xe60a38cc), SPH_C32(0x672b784e), SPH_C32(0x25300000), - SPH_C32(0x95c30018), SPH_C32(0x56070000), SPH_C32(0x8bc30000), - SPH_C32(0xf80f5721), SPH_C32(0x5c78ef3a), SPH_C32(0x0f151dde), - SPH_C32(0x0dc348a4) }, - { SPH_C32(0x8a120000), SPH_C32(0xeeaf0088), SPH_C32(0x31e50000), - SPH_C32(0x06610000), SPH_C32(0x3f8b4908), SPH_C32(0xebcfabc9), - SPH_C32(0x95d1992a), SPH_C32(0x86af3a19), SPH_C32(0x31290000), - SPH_C32(0xb6090024), SPH_C32(0x06d80000), SPH_C32(0xcf750000), - SPH_C32(0xe3633091), SPH_C32(0x608b434f), SPH_C32(0x6ef30d6e), - SPH_C32(0xd6099324) }, - { SPH_C32(0x9e0b0000), SPH_C32(0xcd6500b4), SPH_C32(0x613a0000), - SPH_C32(0x42d70000), SPH_C32(0x24e72eb8), SPH_C32(0xd73c07bc), - SPH_C32(0xf437899a), SPH_C32(0x5d65e199), SPH_C32(0xd26a0000), - SPH_C32(0x8c470030), SPH_C32(0xf41e0000), SPH_C32(0x653b0000), - SPH_C32(0x387d7237), SPH_C32(0x45e0fd5a), SPH_C32(0x7ccebc38), - SPH_C32(0xec470af3) }, - { SPH_C32(0x3d010000), SPH_C32(0xd29000c0), SPH_C32(0xe68d0000), - SPH_C32(0xc6310000), SPH_C32(0xca304571), SPH_C32(0xa8ea90ce), - SPH_C32(0x385630bf), SPH_C32(0xc290fed9), SPH_C32(0x7afe0000), - SPH_C32(0x53b60014), SPH_C32(0xbd420000), SPH_C32(0xf0860000), - SPH_C32(0x8d096d43), SPH_C32(0x3bb5c979), SPH_C32(0x1d3a76bf), - SPH_C32(0x1bb6813d) }, - { SPH_C32(0x29180000), SPH_C32(0xf15a00fc), SPH_C32(0xb6520000), - SPH_C32(0x82870000), SPH_C32(0xd15c22c1), SPH_C32(0x94193cbb), - SPH_C32(0x59b0200f), SPH_C32(0x195a2559), SPH_C32(0x99bd0000), - SPH_C32(0x69f80000), SPH_C32(0x4f840000), SPH_C32(0x5ac80000), - SPH_C32(0x56172fe5), SPH_C32(0x1ede776c), SPH_C32(0x0f07c7e9), - SPH_C32(0x21f818ea) }, - { SPH_C32(0xde420000), SPH_C32(0xe8de00d4), SPH_C32(0x144b0000), - SPH_C32(0x6c7f0000), SPH_C32(0x112e07d7), SPH_C32(0x8d812edb), - SPH_C32(0x2a6b81e9), SPH_C32(0xf8de670e), SPH_C32(0x8da40000), - SPH_C32(0x4a32003c), SPH_C32(0x1f5b0000), SPH_C32(0x1e7e0000), - SPH_C32(0x4d7b4855), SPH_C32(0x222ddb19), SPH_C32(0x6ee1d759), - SPH_C32(0xfa32c36a) }, - { SPH_C32(0xca5b0000), SPH_C32(0xcb1400e8), SPH_C32(0x44940000), - SPH_C32(0x28c90000), SPH_C32(0x0a426067), SPH_C32(0xb17282ae), - SPH_C32(0x4b8d9159), SPH_C32(0x2314bc8e), SPH_C32(0x6ee70000), - SPH_C32(0x707c0028), SPH_C32(0xed9d0000), SPH_C32(0xb4300000), - SPH_C32(0x96650af3), SPH_C32(0x0746650c), SPH_C32(0x7cdc660f), - SPH_C32(0xc07c5abd) }, - { SPH_C32(0xd5dc0000), SPH_C32(0x28da0084), SPH_C32(0xdaa00000), - SPH_C32(0x7d240000), SPH_C32(0x4a8d736a), SPH_C32(0x8c028d8a), - SPH_C32(0x87fef24b), SPH_C32(0x90daf380), SPH_C32(0x2eae0000), - SPH_C32(0x55c70048), SPH_C32(0x98ec0000), SPH_C32(0x9a980000), - SPH_C32(0xa3ac239c), SPH_C32(0x5dfb4c6b), SPH_C32(0xa2806e7c), - SPH_C32(0x65c7dc2a) }, - { SPH_C32(0xc1c50000), SPH_C32(0x0b1000b8), SPH_C32(0x8a7f0000), - SPH_C32(0x39920000), SPH_C32(0x51e114da), SPH_C32(0xb0f121ff), - SPH_C32(0xe618e2fb), SPH_C32(0x4b102800), SPH_C32(0xcded0000), - SPH_C32(0x6f89005c), SPH_C32(0x6a2a0000), SPH_C32(0x30d60000), - SPH_C32(0x78b2613a), SPH_C32(0x7890f27e), SPH_C32(0xb0bddf2a), - SPH_C32(0x5f8945fd) }, - { SPH_C32(0x369f0000), SPH_C32(0x12940090), SPH_C32(0x28660000), - SPH_C32(0xd76a0000), SPH_C32(0x919331cc), SPH_C32(0xa969339f), - SPH_C32(0x95c3431d), SPH_C32(0xaa946a57), SPH_C32(0xd9f40000), - SPH_C32(0x4c430060), SPH_C32(0x3af50000), SPH_C32(0x74600000), - SPH_C32(0x63de068a), SPH_C32(0x44635e0b), SPH_C32(0xd15bcf9a), - SPH_C32(0x84439e7d) }, - { SPH_C32(0x22860000), SPH_C32(0x315e00ac), SPH_C32(0x78b90000), - SPH_C32(0x93dc0000), SPH_C32(0x8aff567c), SPH_C32(0x959a9fea), - SPH_C32(0xf42553ad), SPH_C32(0x715eb1d7), SPH_C32(0x3ab70000), - SPH_C32(0x760d0074), SPH_C32(0xc8330000), SPH_C32(0xde2e0000), - SPH_C32(0xb8c0442c), SPH_C32(0x6108e01e), SPH_C32(0xc3667ecc), - SPH_C32(0xbe0d07aa) }, - { SPH_C32(0x818c0000), SPH_C32(0x2eab00d8), SPH_C32(0xff0e0000), - SPH_C32(0x173a0000), SPH_C32(0x64283db5), SPH_C32(0xea4c0898), - SPH_C32(0x3844ea88), SPH_C32(0xeeabae97), SPH_C32(0x92230000), - SPH_C32(0xa9fc0050), SPH_C32(0x816f0000), SPH_C32(0x4b930000), - SPH_C32(0x0db45b58), SPH_C32(0x1f5dd43d), SPH_C32(0xa292b44b), - SPH_C32(0x49fc8c64) }, - { SPH_C32(0x95950000), SPH_C32(0x0d6100e4), SPH_C32(0xafd10000), - SPH_C32(0x538c0000), SPH_C32(0x7f445a05), SPH_C32(0xd6bfa4ed), - SPH_C32(0x59a2fa38), SPH_C32(0x35617517), SPH_C32(0x71600000), - SPH_C32(0x93b20044), SPH_C32(0x73a90000), SPH_C32(0xe1dd0000), - SPH_C32(0xd6aa19fe), SPH_C32(0x3a366a28), SPH_C32(0xb0af051d), - SPH_C32(0x73b215b3) }, - { SPH_C32(0x62cf0000), SPH_C32(0x14e500cc), SPH_C32(0x0dc80000), - SPH_C32(0xbd740000), SPH_C32(0xbf367f13), SPH_C32(0xcf27b68d), - SPH_C32(0x2a795bde), SPH_C32(0xd4e53740), SPH_C32(0x65790000), - SPH_C32(0xb0780078), SPH_C32(0x23760000), SPH_C32(0xa56b0000), - SPH_C32(0xcdc67e4e), SPH_C32(0x06c5c65d), SPH_C32(0xd14915ad), - SPH_C32(0xa878ce33) }, - { SPH_C32(0x76d60000), SPH_C32(0x372f00f0), SPH_C32(0x5d170000), - SPH_C32(0xf9c20000), SPH_C32(0xa45a18a3), SPH_C32(0xf3d41af8), - SPH_C32(0x4b9f4b6e), SPH_C32(0x0f2fecc0), SPH_C32(0x863a0000), - SPH_C32(0x8a36006c), SPH_C32(0xd1b00000), SPH_C32(0x0f250000), - SPH_C32(0x16d83ce8), SPH_C32(0x23ae7848), SPH_C32(0xc374a4fb), - SPH_C32(0x923657e4) } -}; - -static const sph_u32 T512_30[32][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x1e4e0000), SPH_C32(0xdecf0000), SPH_C32(0x6df80180), - SPH_C32(0x77240000), SPH_C32(0xec47079e), SPH_C32(0xf4a0694e), - SPH_C32(0xcda31812), SPH_C32(0x98aa496e), SPH_C32(0xb2060000), - SPH_C32(0xc5690000), SPH_C32(0x28031200), SPH_C32(0x74670000), - SPH_C32(0xb6c236f4), SPH_C32(0xeb1239f8), SPH_C32(0x33d1dfec), - SPH_C32(0x094e3198) }, - { SPH_C32(0xaec30000), SPH_C32(0x9c4f0001), SPH_C32(0x79d1e000), - SPH_C32(0x2c150000), SPH_C32(0x45cc75b3), SPH_C32(0x6650b736), - SPH_C32(0xab92f78f), SPH_C32(0xa312567b), SPH_C32(0xdb250000), - SPH_C32(0x09290000), SPH_C32(0x49aac000), SPH_C32(0x81e10000), - SPH_C32(0xcafe6b59), SPH_C32(0x42793431), SPH_C32(0x43566b76), - SPH_C32(0xe86cba2e) }, - { SPH_C32(0xb08d0000), SPH_C32(0x42800001), SPH_C32(0x1429e180), - SPH_C32(0x5b310000), SPH_C32(0xa98b722d), SPH_C32(0x92f0de78), - SPH_C32(0x6631ef9d), SPH_C32(0x3bb81f15), SPH_C32(0x69230000), - SPH_C32(0xcc400000), SPH_C32(0x61a9d200), SPH_C32(0xf5860000), - SPH_C32(0x7c3c5dad), SPH_C32(0xa96b0dc9), SPH_C32(0x7087b49a), - SPH_C32(0xe1228bb6) }, - { SPH_C32(0xdb250000), SPH_C32(0x09290000), SPH_C32(0x49aac000), - SPH_C32(0x81e10000), SPH_C32(0xcafe6b59), SPH_C32(0x42793431), - SPH_C32(0x43566b76), SPH_C32(0xe86cba2e), SPH_C32(0x75e60000), - SPH_C32(0x95660001), SPH_C32(0x307b2000), SPH_C32(0xadf40000), - SPH_C32(0x8f321eea), SPH_C32(0x24298307), SPH_C32(0xe8c49cf9), - SPH_C32(0x4b7eec55) }, - { SPH_C32(0xc56b0000), SPH_C32(0xd7e60000), SPH_C32(0x2452c180), - SPH_C32(0xf6c50000), SPH_C32(0x26b96cc7), SPH_C32(0xb6d95d7f), - SPH_C32(0x8ef57364), SPH_C32(0x70c6f340), SPH_C32(0xc7e00000), - SPH_C32(0x500f0001), SPH_C32(0x18783200), SPH_C32(0xd9930000), - SPH_C32(0x39f0281e), SPH_C32(0xcf3bbaff), SPH_C32(0xdb154315), - SPH_C32(0x4230ddcd) }, - { SPH_C32(0x75e60000), SPH_C32(0x95660001), SPH_C32(0x307b2000), - SPH_C32(0xadf40000), SPH_C32(0x8f321eea), SPH_C32(0x24298307), - SPH_C32(0xe8c49cf9), SPH_C32(0x4b7eec55), SPH_C32(0xaec30000), - SPH_C32(0x9c4f0001), SPH_C32(0x79d1e000), SPH_C32(0x2c150000), - SPH_C32(0x45cc75b3), SPH_C32(0x6650b736), SPH_C32(0xab92f78f), - SPH_C32(0xa312567b) }, - { SPH_C32(0x6ba80000), SPH_C32(0x4ba90001), SPH_C32(0x5d832180), - SPH_C32(0xdad00000), SPH_C32(0x63751974), SPH_C32(0xd089ea49), - SPH_C32(0x256784eb), SPH_C32(0xd3d4a53b), SPH_C32(0x1cc50000), - SPH_C32(0x59260001), SPH_C32(0x51d2f200), SPH_C32(0x58720000), - SPH_C32(0xf30e4347), SPH_C32(0x8d428ece), SPH_C32(0x98432863), - SPH_C32(0xaa5c67e3) }, - { SPH_C32(0x86790000), SPH_C32(0x3f390002), SPH_C32(0xe19ae000), - SPH_C32(0x98560000), SPH_C32(0x9565670e), SPH_C32(0x4e88c8ea), - SPH_C32(0xd3dd4944), SPH_C32(0x161ddab9), SPH_C32(0x30b70000), - SPH_C32(0xe5d00000), SPH_C32(0xf4f46000), SPH_C32(0x42c40000), - SPH_C32(0x63b83d6a), SPH_C32(0x78ba9460), SPH_C32(0x21afa1ea), - SPH_C32(0xb0a51834) }, - { SPH_C32(0x98370000), SPH_C32(0xe1f60002), SPH_C32(0x8c62e180), - SPH_C32(0xef720000), SPH_C32(0x79226090), SPH_C32(0xba28a1a4), - SPH_C32(0x1e7e5156), SPH_C32(0x8eb793d7), SPH_C32(0x82b10000), - SPH_C32(0x20b90000), SPH_C32(0xdcf77200), SPH_C32(0x36a30000), - SPH_C32(0xd57a0b9e), SPH_C32(0x93a8ad98), SPH_C32(0x127e7e06), - SPH_C32(0xb9eb29ac) }, - { SPH_C32(0x28ba0000), SPH_C32(0xa3760003), SPH_C32(0x984b0000), - SPH_C32(0xb4430000), SPH_C32(0xd0a912bd), SPH_C32(0x28d87fdc), - SPH_C32(0x784fbecb), SPH_C32(0xb50f8cc2), SPH_C32(0xeb920000), - SPH_C32(0xecf90000), SPH_C32(0xbd5ea000), SPH_C32(0xc3250000), - SPH_C32(0xa9465633), SPH_C32(0x3ac3a051), SPH_C32(0x62f9ca9c), - SPH_C32(0x58c9a21a) }, - { SPH_C32(0x36f40000), SPH_C32(0x7db90003), SPH_C32(0xf5b30180), - SPH_C32(0xc3670000), SPH_C32(0x3cee1523), SPH_C32(0xdc781692), - SPH_C32(0xb5eca6d9), SPH_C32(0x2da5c5ac), SPH_C32(0x59940000), - SPH_C32(0x29900000), SPH_C32(0x955db200), SPH_C32(0xb7420000), - SPH_C32(0x1f8460c7), SPH_C32(0xd1d199a9), SPH_C32(0x51281570), - SPH_C32(0x51879382) }, - { SPH_C32(0x5d5c0000), SPH_C32(0x36100002), SPH_C32(0xa8302000), - SPH_C32(0x19b70000), SPH_C32(0x5f9b0c57), SPH_C32(0x0cf1fcdb), - SPH_C32(0x908b2232), SPH_C32(0xfe716097), SPH_C32(0x45510000), - SPH_C32(0x70b60001), SPH_C32(0xc48f4000), SPH_C32(0xef300000), - SPH_C32(0xec8a2380), SPH_C32(0x5c931767), SPH_C32(0xc96b3d13), - SPH_C32(0xfbdbf461) }, - { SPH_C32(0x43120000), SPH_C32(0xe8df0002), SPH_C32(0xc5c82180), - SPH_C32(0x6e930000), SPH_C32(0xb3dc0bc9), SPH_C32(0xf8519595), - SPH_C32(0x5d283a20), SPH_C32(0x66db29f9), SPH_C32(0xf7570000), - SPH_C32(0xb5df0001), SPH_C32(0xec8c5200), SPH_C32(0x9b570000), - SPH_C32(0x5a481574), SPH_C32(0xb7812e9f), SPH_C32(0xfabae2ff), - SPH_C32(0xf295c5f9) }, - { SPH_C32(0xf39f0000), SPH_C32(0xaa5f0003), SPH_C32(0xd1e1c000), - SPH_C32(0x35a20000), SPH_C32(0x1a5779e4), SPH_C32(0x6aa14bed), - SPH_C32(0x3b19d5bd), SPH_C32(0x5d6336ec), SPH_C32(0x9e740000), - SPH_C32(0x799f0001), SPH_C32(0x8d258000), SPH_C32(0x6ed10000), - SPH_C32(0x267448d9), SPH_C32(0x1eea2356), SPH_C32(0x8a3d5665), - SPH_C32(0x13b74e4f) }, - { SPH_C32(0xedd10000), SPH_C32(0x74900003), SPH_C32(0xbc19c180), - SPH_C32(0x42860000), SPH_C32(0xf6107e7a), SPH_C32(0x9e0122a3), - SPH_C32(0xf6bacdaf), SPH_C32(0xc5c97f82), SPH_C32(0x2c720000), - SPH_C32(0xbcf60001), SPH_C32(0xa5269200), SPH_C32(0x1ab60000), - SPH_C32(0x90b67e2d), SPH_C32(0xf5f81aae), SPH_C32(0xb9ec8989), - SPH_C32(0x1af97fd7) }, - { SPH_C32(0x30b70000), SPH_C32(0xe5d00000), SPH_C32(0xf4f46000), - SPH_C32(0x42c40000), SPH_C32(0x63b83d6a), SPH_C32(0x78ba9460), - SPH_C32(0x21afa1ea), SPH_C32(0xb0a51834), SPH_C32(0xb6ce0000), - SPH_C32(0xdae90002), SPH_C32(0x156e8000), SPH_C32(0xda920000), - SPH_C32(0xf6dd5a64), SPH_C32(0x36325c8a), SPH_C32(0xf272e8ae), - SPH_C32(0xa6b8c28d) }, - { SPH_C32(0x2ef90000), SPH_C32(0x3b1f0000), SPH_C32(0x990c6180), - SPH_C32(0x35e00000), SPH_C32(0x8fff3af4), SPH_C32(0x8c1afd2e), - SPH_C32(0xec0cb9f8), SPH_C32(0x280f515a), SPH_C32(0x04c80000), - SPH_C32(0x1f800002), SPH_C32(0x3d6d9200), SPH_C32(0xaef50000), - SPH_C32(0x401f6c90), SPH_C32(0xdd206572), SPH_C32(0xc1a33742), - SPH_C32(0xaff6f315) }, - { SPH_C32(0x9e740000), SPH_C32(0x799f0001), SPH_C32(0x8d258000), - SPH_C32(0x6ed10000), SPH_C32(0x267448d9), SPH_C32(0x1eea2356), - SPH_C32(0x8a3d5665), SPH_C32(0x13b74e4f), SPH_C32(0x6deb0000), - SPH_C32(0xd3c00002), SPH_C32(0x5cc44000), SPH_C32(0x5b730000), - SPH_C32(0x3c23313d), SPH_C32(0x744b68bb), SPH_C32(0xb12483d8), - SPH_C32(0x4ed478a3) }, - { SPH_C32(0x803a0000), SPH_C32(0xa7500001), SPH_C32(0xe0dd8180), - SPH_C32(0x19f50000), SPH_C32(0xca334f47), SPH_C32(0xea4a4a18), - SPH_C32(0x479e4e77), SPH_C32(0x8b1d0721), SPH_C32(0xdfed0000), - SPH_C32(0x16a90002), SPH_C32(0x74c75200), SPH_C32(0x2f140000), - SPH_C32(0x8ae107c9), SPH_C32(0x9f595143), SPH_C32(0x82f55c34), - SPH_C32(0x479a493b) }, - { SPH_C32(0xeb920000), SPH_C32(0xecf90000), SPH_C32(0xbd5ea000), - SPH_C32(0xc3250000), SPH_C32(0xa9465633), SPH_C32(0x3ac3a051), - SPH_C32(0x62f9ca9c), SPH_C32(0x58c9a21a), SPH_C32(0xc3280000), - SPH_C32(0x4f8f0003), SPH_C32(0x2515a000), SPH_C32(0x77660000), - SPH_C32(0x79ef448e), SPH_C32(0x121bdf8d), SPH_C32(0x1ab67457), - SPH_C32(0xedc62ed8) }, - { SPH_C32(0xf5dc0000), SPH_C32(0x32360000), SPH_C32(0xd0a6a180), - SPH_C32(0xb4010000), SPH_C32(0x450151ad), SPH_C32(0xce63c91f), - SPH_C32(0xaf5ad28e), SPH_C32(0xc063eb74), SPH_C32(0x712e0000), - SPH_C32(0x8ae60003), SPH_C32(0x0d16b200), SPH_C32(0x03010000), - SPH_C32(0xcf2d727a), SPH_C32(0xf909e675), SPH_C32(0x2967abbb), - SPH_C32(0xe4881f40) }, - { SPH_C32(0x45510000), SPH_C32(0x70b60001), SPH_C32(0xc48f4000), - SPH_C32(0xef300000), SPH_C32(0xec8a2380), SPH_C32(0x5c931767), - SPH_C32(0xc96b3d13), SPH_C32(0xfbdbf461), SPH_C32(0x180d0000), - SPH_C32(0x46a60003), SPH_C32(0x6cbf6000), SPH_C32(0xf6870000), - SPH_C32(0xb3112fd7), SPH_C32(0x5062ebbc), SPH_C32(0x59e01f21), - SPH_C32(0x05aa94f6) }, - { SPH_C32(0x5b1f0000), SPH_C32(0xae790001), SPH_C32(0xa9774180), - SPH_C32(0x98140000), SPH_C32(0x00cd241e), SPH_C32(0xa8337e29), - SPH_C32(0x04c82501), SPH_C32(0x6371bd0f), SPH_C32(0xaa0b0000), - SPH_C32(0x83cf0003), SPH_C32(0x44bc7200), SPH_C32(0x82e00000), - SPH_C32(0x05d31923), SPH_C32(0xbb70d244), SPH_C32(0x6a31c0cd), - SPH_C32(0x0ce4a56e) }, - { SPH_C32(0xb6ce0000), SPH_C32(0xdae90002), SPH_C32(0x156e8000), - SPH_C32(0xda920000), SPH_C32(0xf6dd5a64), SPH_C32(0x36325c8a), - SPH_C32(0xf272e8ae), SPH_C32(0xa6b8c28d), SPH_C32(0x86790000), - SPH_C32(0x3f390002), SPH_C32(0xe19ae000), SPH_C32(0x98560000), - SPH_C32(0x9565670e), SPH_C32(0x4e88c8ea), SPH_C32(0xd3dd4944), - SPH_C32(0x161ddab9) }, - { SPH_C32(0xa8800000), SPH_C32(0x04260002), SPH_C32(0x78968180), - SPH_C32(0xadb60000), SPH_C32(0x1a9a5dfa), SPH_C32(0xc29235c4), - SPH_C32(0x3fd1f0bc), SPH_C32(0x3e128be3), SPH_C32(0x347f0000), - SPH_C32(0xfa500002), SPH_C32(0xc999f200), SPH_C32(0xec310000), - SPH_C32(0x23a751fa), SPH_C32(0xa59af112), SPH_C32(0xe00c96a8), - SPH_C32(0x1f53eb21) }, - { SPH_C32(0x180d0000), SPH_C32(0x46a60003), SPH_C32(0x6cbf6000), - SPH_C32(0xf6870000), SPH_C32(0xb3112fd7), SPH_C32(0x5062ebbc), - SPH_C32(0x59e01f21), SPH_C32(0x05aa94f6), SPH_C32(0x5d5c0000), - SPH_C32(0x36100002), SPH_C32(0xa8302000), SPH_C32(0x19b70000), - SPH_C32(0x5f9b0c57), SPH_C32(0x0cf1fcdb), SPH_C32(0x908b2232), - SPH_C32(0xfe716097) }, - { SPH_C32(0x06430000), SPH_C32(0x98690003), SPH_C32(0x01476180), - SPH_C32(0x81a30000), SPH_C32(0x5f562849), SPH_C32(0xa4c282f2), - SPH_C32(0x94430733), SPH_C32(0x9d00dd98), SPH_C32(0xef5a0000), - SPH_C32(0xf3790002), SPH_C32(0x80333200), SPH_C32(0x6dd00000), - SPH_C32(0xe9593aa3), SPH_C32(0xe7e3c523), SPH_C32(0xa35afdde), - SPH_C32(0xf73f510f) }, - { SPH_C32(0x6deb0000), SPH_C32(0xd3c00002), SPH_C32(0x5cc44000), - SPH_C32(0x5b730000), SPH_C32(0x3c23313d), SPH_C32(0x744b68bb), - SPH_C32(0xb12483d8), SPH_C32(0x4ed478a3), SPH_C32(0xf39f0000), - SPH_C32(0xaa5f0003), SPH_C32(0xd1e1c000), SPH_C32(0x35a20000), - SPH_C32(0x1a5779e4), SPH_C32(0x6aa14bed), SPH_C32(0x3b19d5bd), - SPH_C32(0x5d6336ec) }, - { SPH_C32(0x73a50000), SPH_C32(0x0d0f0002), SPH_C32(0x313c4180), - SPH_C32(0x2c570000), SPH_C32(0xd06436a3), SPH_C32(0x80eb01f5), - SPH_C32(0x7c879bca), SPH_C32(0xd67e31cd), SPH_C32(0x41990000), - SPH_C32(0x6f360003), SPH_C32(0xf9e2d200), SPH_C32(0x41c50000), - SPH_C32(0xac954f10), SPH_C32(0x81b37215), SPH_C32(0x08c80a51), - SPH_C32(0x542d0774) }, - { SPH_C32(0xc3280000), SPH_C32(0x4f8f0003), SPH_C32(0x2515a000), - SPH_C32(0x77660000), SPH_C32(0x79ef448e), SPH_C32(0x121bdf8d), - SPH_C32(0x1ab67457), SPH_C32(0xedc62ed8), SPH_C32(0x28ba0000), - SPH_C32(0xa3760003), SPH_C32(0x984b0000), SPH_C32(0xb4430000), - SPH_C32(0xd0a912bd), SPH_C32(0x28d87fdc), SPH_C32(0x784fbecb), - SPH_C32(0xb50f8cc2) }, - { SPH_C32(0xdd660000), SPH_C32(0x91400003), SPH_C32(0x48eda180), - SPH_C32(0x00420000), SPH_C32(0x95a84310), SPH_C32(0xe6bbb6c3), - SPH_C32(0xd7156c45), SPH_C32(0x756c67b6), SPH_C32(0x9abc0000), - SPH_C32(0x661f0003), SPH_C32(0xb0481200), SPH_C32(0xc0240000), - SPH_C32(0x666b2449), SPH_C32(0xc3ca4624), SPH_C32(0x4b9e6127), - SPH_C32(0xbc41bd5a) } -}; - -static const sph_u32 T512_35[32][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xcc140000), SPH_C32(0xa5630000), SPH_C32(0x5ab90780), - SPH_C32(0x3b500000), SPH_C32(0x4bd013ff), SPH_C32(0x879b3418), - SPH_C32(0x694348c1), SPH_C32(0xca5a87fe), SPH_C32(0x819e0000), - SPH_C32(0xec570000), SPH_C32(0x66320280), SPH_C32(0x95f30000), - SPH_C32(0x5da92802), SPH_C32(0x48f43cbc), SPH_C32(0xe65aa22d), - SPH_C32(0x8e67b7fa) }, - { SPH_C32(0x819e0000), SPH_C32(0xec570000), SPH_C32(0x66320280), - SPH_C32(0x95f30000), SPH_C32(0x5da92802), SPH_C32(0x48f43cbc), - SPH_C32(0xe65aa22d), SPH_C32(0x8e67b7fa), SPH_C32(0x4d8a0000), - SPH_C32(0x49340000), SPH_C32(0x3c8b0500), SPH_C32(0xaea30000), - SPH_C32(0x16793bfd), SPH_C32(0xcf6f08a4), SPH_C32(0x8f19eaec), - SPH_C32(0x443d3004) }, - { SPH_C32(0x4d8a0000), SPH_C32(0x49340000), SPH_C32(0x3c8b0500), - SPH_C32(0xaea30000), SPH_C32(0x16793bfd), SPH_C32(0xcf6f08a4), - SPH_C32(0x8f19eaec), SPH_C32(0x443d3004), SPH_C32(0xcc140000), - SPH_C32(0xa5630000), SPH_C32(0x5ab90780), SPH_C32(0x3b500000), - SPH_C32(0x4bd013ff), SPH_C32(0x879b3418), SPH_C32(0x694348c1), - SPH_C32(0xca5a87fe) }, - { SPH_C32(0x78230000), SPH_C32(0x12fc0000), SPH_C32(0xa93a0b80), - SPH_C32(0x90a50000), SPH_C32(0x713e2879), SPH_C32(0x7ee98924), - SPH_C32(0xf08ca062), SPH_C32(0x636f8bab), SPH_C32(0x02af0000), - SPH_C32(0xb7280000), SPH_C32(0xba1c0300), SPH_C32(0x56980000), - SPH_C32(0xba8d45d3), SPH_C32(0x8048c667), SPH_C32(0xa95c149a), - SPH_C32(0xf4f6ea7b) }, - { SPH_C32(0xb4370000), SPH_C32(0xb79f0000), SPH_C32(0xf3830c00), - SPH_C32(0xabf50000), SPH_C32(0x3aee3b86), SPH_C32(0xf972bd3c), - SPH_C32(0x99cfe8a3), SPH_C32(0xa9350c55), SPH_C32(0x83310000), - SPH_C32(0x5b7f0000), SPH_C32(0xdc2e0180), SPH_C32(0xc36b0000), - SPH_C32(0xe7246dd1), SPH_C32(0xc8bcfadb), SPH_C32(0x4f06b6b7), - SPH_C32(0x7a915d81) }, - { SPH_C32(0xf9bd0000), SPH_C32(0xfeab0000), SPH_C32(0xcf080900), - SPH_C32(0x05560000), SPH_C32(0x2c97007b), SPH_C32(0x361db598), - SPH_C32(0x16d6024f), SPH_C32(0xed083c51), SPH_C32(0x4f250000), - SPH_C32(0xfe1c0000), SPH_C32(0x86970600), SPH_C32(0xf83b0000), - SPH_C32(0xacf47e2e), SPH_C32(0x4f27cec3), SPH_C32(0x2645fe76), - SPH_C32(0xb0cbda7f) }, - { SPH_C32(0x35a90000), SPH_C32(0x5bc80000), SPH_C32(0x95b10e80), - SPH_C32(0x3e060000), SPH_C32(0x67471384), SPH_C32(0xb1868180), - SPH_C32(0x7f954a8e), SPH_C32(0x2752bbaf), SPH_C32(0xcebb0000), - SPH_C32(0x124b0000), SPH_C32(0xe0a50480), SPH_C32(0x6dc80000), - SPH_C32(0xf15d562c), SPH_C32(0x07d3f27f), SPH_C32(0xc01f5c5b), - SPH_C32(0x3eac6d85) }, - { SPH_C32(0x02af0000), SPH_C32(0xb7280000), SPH_C32(0xba1c0300), - SPH_C32(0x56980000), SPH_C32(0xba8d45d3), SPH_C32(0x8048c667), - SPH_C32(0xa95c149a), SPH_C32(0xf4f6ea7b), SPH_C32(0x7a8c0000), - SPH_C32(0xa5d40000), SPH_C32(0x13260880), SPH_C32(0xc63d0000), - SPH_C32(0xcbb36daa), SPH_C32(0xfea14f43), SPH_C32(0x59d0b4f8), - SPH_C32(0x979961d0) }, - { SPH_C32(0xcebb0000), SPH_C32(0x124b0000), SPH_C32(0xe0a50480), - SPH_C32(0x6dc80000), SPH_C32(0xf15d562c), SPH_C32(0x07d3f27f), - SPH_C32(0xc01f5c5b), SPH_C32(0x3eac6d85), SPH_C32(0xfb120000), - SPH_C32(0x49830000), SPH_C32(0x75140a00), SPH_C32(0x53ce0000), - SPH_C32(0x961a45a8), SPH_C32(0xb65573ff), SPH_C32(0xbf8a16d5), - SPH_C32(0x19fed62a) }, - { SPH_C32(0x83310000), SPH_C32(0x5b7f0000), SPH_C32(0xdc2e0180), - SPH_C32(0xc36b0000), SPH_C32(0xe7246dd1), SPH_C32(0xc8bcfadb), - SPH_C32(0x4f06b6b7), SPH_C32(0x7a915d81), SPH_C32(0x37060000), - SPH_C32(0xece00000), SPH_C32(0x2fad0d80), SPH_C32(0x689e0000), - SPH_C32(0xddca5657), SPH_C32(0x31ce47e7), SPH_C32(0xd6c95e14), - SPH_C32(0xd3a451d4) }, - { SPH_C32(0x4f250000), SPH_C32(0xfe1c0000), SPH_C32(0x86970600), - SPH_C32(0xf83b0000), SPH_C32(0xacf47e2e), SPH_C32(0x4f27cec3), - SPH_C32(0x2645fe76), SPH_C32(0xb0cbda7f), SPH_C32(0xb6980000), - SPH_C32(0x00b70000), SPH_C32(0x499f0f00), SPH_C32(0xfd6d0000), - SPH_C32(0x80637e55), SPH_C32(0x793a7b5b), SPH_C32(0x3093fc39), - SPH_C32(0x5dc3e62e) }, - { SPH_C32(0x7a8c0000), SPH_C32(0xa5d40000), SPH_C32(0x13260880), - SPH_C32(0xc63d0000), SPH_C32(0xcbb36daa), SPH_C32(0xfea14f43), - SPH_C32(0x59d0b4f8), SPH_C32(0x979961d0), SPH_C32(0x78230000), - SPH_C32(0x12fc0000), SPH_C32(0xa93a0b80), SPH_C32(0x90a50000), - SPH_C32(0x713e2879), SPH_C32(0x7ee98924), SPH_C32(0xf08ca062), - SPH_C32(0x636f8bab) }, - { SPH_C32(0xb6980000), SPH_C32(0x00b70000), SPH_C32(0x499f0f00), - SPH_C32(0xfd6d0000), SPH_C32(0x80637e55), SPH_C32(0x793a7b5b), - SPH_C32(0x3093fc39), SPH_C32(0x5dc3e62e), SPH_C32(0xf9bd0000), - SPH_C32(0xfeab0000), SPH_C32(0xcf080900), SPH_C32(0x05560000), - SPH_C32(0x2c97007b), SPH_C32(0x361db598), SPH_C32(0x16d6024f), - SPH_C32(0xed083c51) }, - { SPH_C32(0xfb120000), SPH_C32(0x49830000), SPH_C32(0x75140a00), - SPH_C32(0x53ce0000), SPH_C32(0x961a45a8), SPH_C32(0xb65573ff), - SPH_C32(0xbf8a16d5), SPH_C32(0x19fed62a), SPH_C32(0x35a90000), - SPH_C32(0x5bc80000), SPH_C32(0x95b10e80), SPH_C32(0x3e060000), - SPH_C32(0x67471384), SPH_C32(0xb1868180), SPH_C32(0x7f954a8e), - SPH_C32(0x2752bbaf) }, - { SPH_C32(0x37060000), SPH_C32(0xece00000), SPH_C32(0x2fad0d80), - SPH_C32(0x689e0000), SPH_C32(0xddca5657), SPH_C32(0x31ce47e7), - SPH_C32(0xd6c95e14), SPH_C32(0xd3a451d4), SPH_C32(0xb4370000), - SPH_C32(0xb79f0000), SPH_C32(0xf3830c00), SPH_C32(0xabf50000), - SPH_C32(0x3aee3b86), SPH_C32(0xf972bd3c), SPH_C32(0x99cfe8a3), - SPH_C32(0xa9350c55) }, - { SPH_C32(0xac480000), SPH_C32(0x1ba60000), SPH_C32(0x45fb1380), - SPH_C32(0x03430000), SPH_C32(0x5a85316a), SPH_C32(0x1fb250b6), - SPH_C32(0xfe72c7fe), SPH_C32(0x91e478f6), SPH_C32(0x1e4e0000), - SPH_C32(0xdecf0000), SPH_C32(0x6df80180), SPH_C32(0x77240000), - SPH_C32(0xec47079e), SPH_C32(0xf4a0694e), SPH_C32(0xcda31812), - SPH_C32(0x98aa496e) }, - { SPH_C32(0x605c0000), SPH_C32(0xbec50000), SPH_C32(0x1f421400), - SPH_C32(0x38130000), SPH_C32(0x11552295), SPH_C32(0x982964ae), - SPH_C32(0x97318f3f), SPH_C32(0x5bbeff08), SPH_C32(0x9fd00000), - SPH_C32(0x32980000), SPH_C32(0x0bca0300), SPH_C32(0xe2d70000), - SPH_C32(0xb1ee2f9c), SPH_C32(0xbc5455f2), SPH_C32(0x2bf9ba3f), - SPH_C32(0x16cdfe94) }, - { SPH_C32(0x2dd60000), SPH_C32(0xf7f10000), SPH_C32(0x23c91100), - SPH_C32(0x96b00000), SPH_C32(0x072c1968), SPH_C32(0x57466c0a), - SPH_C32(0x182865d3), SPH_C32(0x1f83cf0c), SPH_C32(0x53c40000), - SPH_C32(0x97fb0000), SPH_C32(0x51730480), SPH_C32(0xd9870000), - SPH_C32(0xfa3e3c63), SPH_C32(0x3bcf61ea), SPH_C32(0x42baf2fe), - SPH_C32(0xdc97796a) }, - { SPH_C32(0xe1c20000), SPH_C32(0x52920000), SPH_C32(0x79701680), - SPH_C32(0xade00000), SPH_C32(0x4cfc0a97), SPH_C32(0xd0dd5812), - SPH_C32(0x716b2d12), SPH_C32(0xd5d948f2), SPH_C32(0xd25a0000), - SPH_C32(0x7bac0000), SPH_C32(0x37410600), SPH_C32(0x4c740000), - SPH_C32(0xa7971461), SPH_C32(0x733b5d56), SPH_C32(0xa4e050d3), - SPH_C32(0x52f0ce90) }, - { SPH_C32(0xd46b0000), SPH_C32(0x095a0000), SPH_C32(0xecc11800), - SPH_C32(0x93e60000), SPH_C32(0x2bbb1913), SPH_C32(0x615bd992), - SPH_C32(0x0efe679c), SPH_C32(0xf28bf35d), SPH_C32(0x1ce10000), - SPH_C32(0x69e70000), SPH_C32(0xd7e40280), SPH_C32(0x21bc0000), - SPH_C32(0x56ca424d), SPH_C32(0x74e8af29), SPH_C32(0x64ff0c88), - SPH_C32(0x6c5ca315) }, - { SPH_C32(0x187f0000), SPH_C32(0xac390000), SPH_C32(0xb6781f80), - SPH_C32(0xa8b60000), SPH_C32(0x606b0aec), SPH_C32(0xe6c0ed8a), - SPH_C32(0x67bd2f5d), SPH_C32(0x38d174a3), SPH_C32(0x9d7f0000), - SPH_C32(0x85b00000), SPH_C32(0xb1d60000), SPH_C32(0xb44f0000), - SPH_C32(0x0b636a4f), SPH_C32(0x3c1c9395), SPH_C32(0x82a5aea5), - SPH_C32(0xe23b14ef) }, - { SPH_C32(0x55f50000), SPH_C32(0xe50d0000), SPH_C32(0x8af31a80), - SPH_C32(0x06150000), SPH_C32(0x76123111), SPH_C32(0x29afe52e), - SPH_C32(0xe8a4c5b1), SPH_C32(0x7cec44a7), SPH_C32(0x516b0000), - SPH_C32(0x20d30000), SPH_C32(0xeb6f0780), SPH_C32(0x8f1f0000), - SPH_C32(0x40b379b0), SPH_C32(0xbb87a78d), SPH_C32(0xebe6e664), - SPH_C32(0x28619311) }, - { SPH_C32(0x99e10000), SPH_C32(0x406e0000), SPH_C32(0xd04a1d00), - SPH_C32(0x3d450000), SPH_C32(0x3dc222ee), SPH_C32(0xae34d136), - SPH_C32(0x81e78d70), SPH_C32(0xb6b6c359), SPH_C32(0xd0f50000), - SPH_C32(0xcc840000), SPH_C32(0x8d5d0500), SPH_C32(0x1aec0000), - SPH_C32(0x1d1a51b2), SPH_C32(0xf3739b31), SPH_C32(0x0dbc4449), - SPH_C32(0xa60624eb) }, - { SPH_C32(0xaee70000), SPH_C32(0xac8e0000), SPH_C32(0xffe71080), - SPH_C32(0x55db0000), SPH_C32(0xe00874b9), SPH_C32(0x9ffa96d1), - SPH_C32(0x572ed364), SPH_C32(0x6512928d), SPH_C32(0x64c20000), - SPH_C32(0x7b1b0000), SPH_C32(0x7ede0900), SPH_C32(0xb1190000), - SPH_C32(0x27f46a34), SPH_C32(0x0a01260d), SPH_C32(0x9473acea), - SPH_C32(0x0f3328be) }, - { SPH_C32(0x62f30000), SPH_C32(0x09ed0000), SPH_C32(0xa55e1700), - SPH_C32(0x6e8b0000), SPH_C32(0xabd86746), SPH_C32(0x1861a2c9), - SPH_C32(0x3e6d9ba5), SPH_C32(0xaf481573), SPH_C32(0xe55c0000), - SPH_C32(0x974c0000), SPH_C32(0x18ec0b80), SPH_C32(0x24ea0000), - SPH_C32(0x7a5d4236), SPH_C32(0x42f51ab1), SPH_C32(0x72290ec7), - SPH_C32(0x81549f44) }, - { SPH_C32(0x2f790000), SPH_C32(0x40d90000), SPH_C32(0x99d51200), - SPH_C32(0xc0280000), SPH_C32(0xbda15cbb), SPH_C32(0xd70eaa6d), - SPH_C32(0xb1747149), SPH_C32(0xeb752577), SPH_C32(0x29480000), - SPH_C32(0x322f0000), SPH_C32(0x42550c00), SPH_C32(0x1fba0000), - SPH_C32(0x318d51c9), SPH_C32(0xc56e2ea9), SPH_C32(0x1b6a4606), - SPH_C32(0x4b0e18ba) }, - { SPH_C32(0xe36d0000), SPH_C32(0xe5ba0000), SPH_C32(0xc36c1580), - SPH_C32(0xfb780000), SPH_C32(0xf6714f44), SPH_C32(0x50959e75), - SPH_C32(0xd8373988), SPH_C32(0x212fa289), SPH_C32(0xa8d60000), - SPH_C32(0xde780000), SPH_C32(0x24670e80), SPH_C32(0x8a490000), - SPH_C32(0x6c2479cb), SPH_C32(0x8d9a1215), SPH_C32(0xfd30e42b), - SPH_C32(0xc569af40) }, - { SPH_C32(0xd6c40000), SPH_C32(0xbe720000), SPH_C32(0x56dd1b00), - SPH_C32(0xc57e0000), SPH_C32(0x91365cc0), SPH_C32(0xe1131ff5), - SPH_C32(0xa7a27306), SPH_C32(0x067d1926), SPH_C32(0x666d0000), - SPH_C32(0xcc330000), SPH_C32(0xc4c20a00), SPH_C32(0xe7810000), - SPH_C32(0x9d792fe7), SPH_C32(0x8a49e06a), SPH_C32(0x3d2fb870), - SPH_C32(0xfbc5c2c5) }, - { SPH_C32(0x1ad00000), SPH_C32(0x1b110000), SPH_C32(0x0c641c80), - SPH_C32(0xfe2e0000), SPH_C32(0xdae64f3f), SPH_C32(0x66882bed), - SPH_C32(0xcee13bc7), SPH_C32(0xcc279ed8), SPH_C32(0xe7f30000), - SPH_C32(0x20640000), SPH_C32(0xa2f00880), SPH_C32(0x72720000), - SPH_C32(0xc0d007e5), SPH_C32(0xc2bddcd6), SPH_C32(0xdb751a5d), - SPH_C32(0x75a2753f) }, - { SPH_C32(0x575a0000), SPH_C32(0x52250000), SPH_C32(0x30ef1980), - SPH_C32(0x508d0000), SPH_C32(0xcc9f74c2), SPH_C32(0xa9e72349), - SPH_C32(0x41f8d12b), SPH_C32(0x881aaedc), SPH_C32(0x2be70000), - SPH_C32(0x85070000), SPH_C32(0xf8490f00), SPH_C32(0x49220000), - SPH_C32(0x8b00141a), SPH_C32(0x4526e8ce), SPH_C32(0xb236529c), - SPH_C32(0xbff8f2c1) }, - { SPH_C32(0x9b4e0000), SPH_C32(0xf7460000), SPH_C32(0x6a561e00), - SPH_C32(0x6bdd0000), SPH_C32(0x874f673d), SPH_C32(0x2e7c1751), - SPH_C32(0x28bb99ea), SPH_C32(0x42402922), SPH_C32(0xaa790000), - SPH_C32(0x69500000), SPH_C32(0x9e7b0d80), SPH_C32(0xdcd10000), - SPH_C32(0xd6a93c18), SPH_C32(0x0dd2d472), SPH_C32(0x546cf0b1), - SPH_C32(0x319f453b) } -}; - -static const sph_u32 T512_40[32][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x07ed0000), SPH_C32(0xb2500000), SPH_C32(0x8774000a), - SPH_C32(0x970d0000), SPH_C32(0x437223ae), SPH_C32(0x48c76ea4), - SPH_C32(0xf4786222), SPH_C32(0x9075b1ce), SPH_C32(0xa2d60000), - SPH_C32(0xa6760000), SPH_C32(0xc9440014), SPH_C32(0xeba30000), - SPH_C32(0xccec2e7b), SPH_C32(0x3018c499), SPH_C32(0x03490afa), - SPH_C32(0x9b6ef888) }, - { SPH_C32(0x88980000), SPH_C32(0x1f940000), SPH_C32(0x7fcf002e), - SPH_C32(0xfb4e0000), SPH_C32(0xf158079a), SPH_C32(0x61ae9167), - SPH_C32(0xa895706c), SPH_C32(0xe6107494), SPH_C32(0x0bc20000), - SPH_C32(0xdb630000), SPH_C32(0x7e88000c), SPH_C32(0x15860000), - SPH_C32(0x91fd48f3), SPH_C32(0x7581bb43), SPH_C32(0xf460449e), - SPH_C32(0xd8b61463) }, - { SPH_C32(0x8f750000), SPH_C32(0xadc40000), SPH_C32(0xf8bb0024), - SPH_C32(0x6c430000), SPH_C32(0xb22a2434), SPH_C32(0x2969ffc3), - SPH_C32(0x5ced124e), SPH_C32(0x7665c55a), SPH_C32(0xa9140000), - SPH_C32(0x7d150000), SPH_C32(0xb7cc0018), SPH_C32(0xfe250000), - SPH_C32(0x5d116688), SPH_C32(0x45997fda), SPH_C32(0xf7294e64), - SPH_C32(0x43d8eceb) }, - { SPH_C32(0x0bc20000), SPH_C32(0xdb630000), SPH_C32(0x7e88000c), - SPH_C32(0x15860000), SPH_C32(0x91fd48f3), SPH_C32(0x7581bb43), - SPH_C32(0xf460449e), SPH_C32(0xd8b61463), SPH_C32(0x835a0000), - SPH_C32(0xc4f70000), SPH_C32(0x01470022), SPH_C32(0xeec80000), - SPH_C32(0x60a54f69), SPH_C32(0x142f2a24), SPH_C32(0x5cf534f2), - SPH_C32(0x3ea660f7) }, - { SPH_C32(0x0c2f0000), SPH_C32(0x69330000), SPH_C32(0xf9fc0006), - SPH_C32(0x828b0000), SPH_C32(0xd28f6b5d), SPH_C32(0x3d46d5e7), - SPH_C32(0x001826bc), SPH_C32(0x48c3a5ad), SPH_C32(0x218c0000), - SPH_C32(0x62810000), SPH_C32(0xc8030036), SPH_C32(0x056b0000), - SPH_C32(0xac496112), SPH_C32(0x2437eebd), SPH_C32(0x5fbc3e08), - SPH_C32(0xa5c8987f) }, - { SPH_C32(0x835a0000), SPH_C32(0xc4f70000), SPH_C32(0x01470022), - SPH_C32(0xeec80000), SPH_C32(0x60a54f69), SPH_C32(0x142f2a24), - SPH_C32(0x5cf534f2), SPH_C32(0x3ea660f7), SPH_C32(0x88980000), - SPH_C32(0x1f940000), SPH_C32(0x7fcf002e), SPH_C32(0xfb4e0000), - SPH_C32(0xf158079a), SPH_C32(0x61ae9167), SPH_C32(0xa895706c), - SPH_C32(0xe6107494) }, - { SPH_C32(0x84b70000), SPH_C32(0x76a70000), SPH_C32(0x86330028), - SPH_C32(0x79c50000), SPH_C32(0x23d76cc7), SPH_C32(0x5ce84480), - SPH_C32(0xa88d56d0), SPH_C32(0xaed3d139), SPH_C32(0x2a4e0000), - SPH_C32(0xb9e20000), SPH_C32(0xb68b003a), SPH_C32(0x10ed0000), - SPH_C32(0x3db429e1), SPH_C32(0x51b655fe), SPH_C32(0xabdc7a96), - SPH_C32(0x7d7e8c1c) }, - { SPH_C32(0x52500000), SPH_C32(0x29540000), SPH_C32(0x6a61004e), - SPH_C32(0xf0ff0000), SPH_C32(0x9a317eec), SPH_C32(0x452341ce), - SPH_C32(0xcf568fe5), SPH_C32(0x5303130f), SPH_C32(0x538d0000), - SPH_C32(0xa9fc0000), SPH_C32(0x9ef70006), SPH_C32(0x56ff0000), - SPH_C32(0x0ae4004e), SPH_C32(0x92c5cdf9), SPH_C32(0xa9444018), - SPH_C32(0x7f975691) }, - { SPH_C32(0x55bd0000), SPH_C32(0x9b040000), SPH_C32(0xed150044), - SPH_C32(0x67f20000), SPH_C32(0xd9435d42), SPH_C32(0x0de42f6a), - SPH_C32(0x3b2eedc7), SPH_C32(0xc376a2c1), SPH_C32(0xf15b0000), - SPH_C32(0x0f8a0000), SPH_C32(0x57b30012), SPH_C32(0xbd5c0000), - SPH_C32(0xc6082e35), SPH_C32(0xa2dd0960), SPH_C32(0xaa0d4ae2), - SPH_C32(0xe4f9ae19) }, - { SPH_C32(0xdac80000), SPH_C32(0x36c00000), SPH_C32(0x15ae0060), - SPH_C32(0x0bb10000), SPH_C32(0x6b697976), SPH_C32(0x248dd0a9), - SPH_C32(0x67c3ff89), SPH_C32(0xb513679b), SPH_C32(0x584f0000), - SPH_C32(0x729f0000), SPH_C32(0xe07f000a), SPH_C32(0x43790000), - SPH_C32(0x9b1948bd), SPH_C32(0xe74476ba), SPH_C32(0x5d240486), - SPH_C32(0xa72142f2) }, - { SPH_C32(0xdd250000), SPH_C32(0x84900000), SPH_C32(0x92da006a), - SPH_C32(0x9cbc0000), SPH_C32(0x281b5ad8), SPH_C32(0x6c4abe0d), - SPH_C32(0x93bb9dab), SPH_C32(0x2566d655), SPH_C32(0xfa990000), - SPH_C32(0xd4e90000), SPH_C32(0x293b001e), SPH_C32(0xa8da0000), - SPH_C32(0x57f566c6), SPH_C32(0xd75cb223), SPH_C32(0x5e6d0e7c), - SPH_C32(0x3c4fba7a) }, - { SPH_C32(0x59920000), SPH_C32(0xf2370000), SPH_C32(0x14e90042), - SPH_C32(0xe5790000), SPH_C32(0x0bcc361f), SPH_C32(0x30a2fa8d), - SPH_C32(0x3b36cb7b), SPH_C32(0x8bb5076c), SPH_C32(0xd0d70000), - SPH_C32(0x6d0b0000), SPH_C32(0x9fb00024), SPH_C32(0xb8370000), - SPH_C32(0x6a414f27), SPH_C32(0x86eae7dd), SPH_C32(0xf5b174ea), - SPH_C32(0x41313666) }, - { SPH_C32(0x5e7f0000), SPH_C32(0x40670000), SPH_C32(0x939d0048), - SPH_C32(0x72740000), SPH_C32(0x48be15b1), SPH_C32(0x78659429), - SPH_C32(0xcf4ea959), SPH_C32(0x1bc0b6a2), SPH_C32(0x72010000), - SPH_C32(0xcb7d0000), SPH_C32(0x56f40030), SPH_C32(0x53940000), - SPH_C32(0xa6ad615c), SPH_C32(0xb6f22344), SPH_C32(0xf6f87e10), - SPH_C32(0xda5fceee) }, - { SPH_C32(0xd10a0000), SPH_C32(0xeda30000), SPH_C32(0x6b26006c), - SPH_C32(0x1e370000), SPH_C32(0xfa943185), SPH_C32(0x510c6bea), - SPH_C32(0x93a3bb17), SPH_C32(0x6da573f8), SPH_C32(0xdb150000), - SPH_C32(0xb6680000), SPH_C32(0xe1380028), SPH_C32(0xadb10000), - SPH_C32(0xfbbc07d4), SPH_C32(0xf36b5c9e), SPH_C32(0x01d13074), - SPH_C32(0x99872205) }, - { SPH_C32(0xd6e70000), SPH_C32(0x5ff30000), SPH_C32(0xec520066), - SPH_C32(0x893a0000), SPH_C32(0xb9e6122b), SPH_C32(0x19cb054e), - SPH_C32(0x67dbd935), SPH_C32(0xfdd0c236), SPH_C32(0x79c30000), - SPH_C32(0x101e0000), SPH_C32(0x287c003c), SPH_C32(0x46120000), - SPH_C32(0x375029af), SPH_C32(0xc3739807), SPH_C32(0x02983a8e), - SPH_C32(0x02e9da8d) }, - { SPH_C32(0x538d0000), SPH_C32(0xa9fc0000), SPH_C32(0x9ef70006), - SPH_C32(0x56ff0000), SPH_C32(0x0ae4004e), SPH_C32(0x92c5cdf9), - SPH_C32(0xa9444018), SPH_C32(0x7f975691), SPH_C32(0x01dd0000), - SPH_C32(0x80a80000), SPH_C32(0xf4960048), SPH_C32(0xa6000000), - SPH_C32(0x90d57ea2), SPH_C32(0xd7e68c37), SPH_C32(0x6612cffd), - SPH_C32(0x2c94459e) }, - { SPH_C32(0x54600000), SPH_C32(0x1bac0000), SPH_C32(0x1983000c), - SPH_C32(0xc1f20000), SPH_C32(0x499623e0), SPH_C32(0xda02a35d), - SPH_C32(0x5d3c223a), SPH_C32(0xefe2e75f), SPH_C32(0xa30b0000), - SPH_C32(0x26de0000), SPH_C32(0x3dd2005c), SPH_C32(0x4da30000), - SPH_C32(0x5c3950d9), SPH_C32(0xe7fe48ae), SPH_C32(0x655bc507), - SPH_C32(0xb7fabd16) }, - { SPH_C32(0xdb150000), SPH_C32(0xb6680000), SPH_C32(0xe1380028), - SPH_C32(0xadb10000), SPH_C32(0xfbbc07d4), SPH_C32(0xf36b5c9e), - SPH_C32(0x01d13074), SPH_C32(0x99872205), SPH_C32(0x0a1f0000), - SPH_C32(0x5bcb0000), SPH_C32(0x8a1e0044), SPH_C32(0xb3860000), - SPH_C32(0x01283651), SPH_C32(0xa2673774), SPH_C32(0x92728b63), - SPH_C32(0xf42251fd) }, - { SPH_C32(0xdcf80000), SPH_C32(0x04380000), SPH_C32(0x664c0022), - SPH_C32(0x3abc0000), SPH_C32(0xb8ce247a), SPH_C32(0xbbac323a), - SPH_C32(0xf5a95256), SPH_C32(0x09f293cb), SPH_C32(0xa8c90000), - SPH_C32(0xfdbd0000), SPH_C32(0x435a0050), SPH_C32(0x58250000), - SPH_C32(0xcdc4182a), SPH_C32(0x927ff3ed), SPH_C32(0x913b8199), - SPH_C32(0x6f4ca975) }, - { SPH_C32(0x584f0000), SPH_C32(0x729f0000), SPH_C32(0xe07f000a), - SPH_C32(0x43790000), SPH_C32(0x9b1948bd), SPH_C32(0xe74476ba), - SPH_C32(0x5d240486), SPH_C32(0xa72142f2), SPH_C32(0x82870000), - SPH_C32(0x445f0000), SPH_C32(0xf5d1006a), SPH_C32(0x48c80000), - SPH_C32(0xf07031cb), SPH_C32(0xc3c9a613), SPH_C32(0x3ae7fb0f), - SPH_C32(0x12322569) }, - { SPH_C32(0x5fa20000), SPH_C32(0xc0cf0000), SPH_C32(0x670b0000), - SPH_C32(0xd4740000), SPH_C32(0xd86b6b13), SPH_C32(0xaf83181e), - SPH_C32(0xa95c66a4), SPH_C32(0x3754f33c), SPH_C32(0x20510000), - SPH_C32(0xe2290000), SPH_C32(0x3c95007e), SPH_C32(0xa36b0000), - SPH_C32(0x3c9c1fb0), SPH_C32(0xf3d1628a), SPH_C32(0x39aef1f5), - SPH_C32(0x895cdde1) }, - { SPH_C32(0xd0d70000), SPH_C32(0x6d0b0000), SPH_C32(0x9fb00024), - SPH_C32(0xb8370000), SPH_C32(0x6a414f27), SPH_C32(0x86eae7dd), - SPH_C32(0xf5b174ea), SPH_C32(0x41313666), SPH_C32(0x89450000), - SPH_C32(0x9f3c0000), SPH_C32(0x8b590066), SPH_C32(0x5d4e0000), - SPH_C32(0x618d7938), SPH_C32(0xb6481d50), SPH_C32(0xce87bf91), - SPH_C32(0xca84310a) }, - { SPH_C32(0xd73a0000), SPH_C32(0xdf5b0000), SPH_C32(0x18c4002e), - SPH_C32(0x2f3a0000), SPH_C32(0x29336c89), SPH_C32(0xce2d8979), - SPH_C32(0x01c916c8), SPH_C32(0xd14487a8), SPH_C32(0x2b930000), - SPH_C32(0x394a0000), SPH_C32(0x421d0072), SPH_C32(0xb6ed0000), - SPH_C32(0xad615743), SPH_C32(0x8650d9c9), SPH_C32(0xcdceb56b), - SPH_C32(0x51eac982) }, - { SPH_C32(0x01dd0000), SPH_C32(0x80a80000), SPH_C32(0xf4960048), - SPH_C32(0xa6000000), SPH_C32(0x90d57ea2), SPH_C32(0xd7e68c37), - SPH_C32(0x6612cffd), SPH_C32(0x2c94459e), SPH_C32(0x52500000), - SPH_C32(0x29540000), SPH_C32(0x6a61004e), SPH_C32(0xf0ff0000), - SPH_C32(0x9a317eec), SPH_C32(0x452341ce), SPH_C32(0xcf568fe5), - SPH_C32(0x5303130f) }, - { SPH_C32(0x06300000), SPH_C32(0x32f80000), SPH_C32(0x73e20042), - SPH_C32(0x310d0000), SPH_C32(0xd3a75d0c), SPH_C32(0x9f21e293), - SPH_C32(0x926aaddf), SPH_C32(0xbce1f450), SPH_C32(0xf0860000), - SPH_C32(0x8f220000), SPH_C32(0xa325005a), SPH_C32(0x1b5c0000), - SPH_C32(0x56dd5097), SPH_C32(0x753b8557), SPH_C32(0xcc1f851f), - SPH_C32(0xc86deb87) }, - { SPH_C32(0x89450000), SPH_C32(0x9f3c0000), SPH_C32(0x8b590066), - SPH_C32(0x5d4e0000), SPH_C32(0x618d7938), SPH_C32(0xb6481d50), - SPH_C32(0xce87bf91), SPH_C32(0xca84310a), SPH_C32(0x59920000), - SPH_C32(0xf2370000), SPH_C32(0x14e90042), SPH_C32(0xe5790000), - SPH_C32(0x0bcc361f), SPH_C32(0x30a2fa8d), SPH_C32(0x3b36cb7b), - SPH_C32(0x8bb5076c) }, - { SPH_C32(0x8ea80000), SPH_C32(0x2d6c0000), SPH_C32(0x0c2d006c), - SPH_C32(0xca430000), SPH_C32(0x22ff5a96), SPH_C32(0xfe8f73f4), - SPH_C32(0x3affddb3), SPH_C32(0x5af180c4), SPH_C32(0xfb440000), - SPH_C32(0x54410000), SPH_C32(0xddad0056), SPH_C32(0x0eda0000), - SPH_C32(0xc7201864), SPH_C32(0x00ba3e14), SPH_C32(0x387fc181), - SPH_C32(0x10dbffe4) }, - { SPH_C32(0x0a1f0000), SPH_C32(0x5bcb0000), SPH_C32(0x8a1e0044), - SPH_C32(0xb3860000), SPH_C32(0x01283651), SPH_C32(0xa2673774), - SPH_C32(0x92728b63), SPH_C32(0xf42251fd), SPH_C32(0xd10a0000), - SPH_C32(0xeda30000), SPH_C32(0x6b26006c), SPH_C32(0x1e370000), - SPH_C32(0xfa943185), SPH_C32(0x510c6bea), SPH_C32(0x93a3bb17), - SPH_C32(0x6da573f8) }, - { SPH_C32(0x0df20000), SPH_C32(0xe99b0000), SPH_C32(0x0d6a004e), - SPH_C32(0x248b0000), SPH_C32(0x425a15ff), SPH_C32(0xeaa059d0), - SPH_C32(0x660ae941), SPH_C32(0x6457e033), SPH_C32(0x73dc0000), - SPH_C32(0x4bd50000), SPH_C32(0xa2620078), SPH_C32(0xf5940000), - SPH_C32(0x36781ffe), SPH_C32(0x6114af73), SPH_C32(0x90eab1ed), - SPH_C32(0xf6cb8b70) }, - { SPH_C32(0x82870000), SPH_C32(0x445f0000), SPH_C32(0xf5d1006a), - SPH_C32(0x48c80000), SPH_C32(0xf07031cb), SPH_C32(0xc3c9a613), - SPH_C32(0x3ae7fb0f), SPH_C32(0x12322569), SPH_C32(0xdac80000), - SPH_C32(0x36c00000), SPH_C32(0x15ae0060), SPH_C32(0x0bb10000), - SPH_C32(0x6b697976), SPH_C32(0x248dd0a9), SPH_C32(0x67c3ff89), - SPH_C32(0xb513679b) }, - { SPH_C32(0x856a0000), SPH_C32(0xf60f0000), SPH_C32(0x72a50060), - SPH_C32(0xdfc50000), SPH_C32(0xb3021265), SPH_C32(0x8b0ec8b7), - SPH_C32(0xce9f992d), SPH_C32(0x824794a7), SPH_C32(0x781e0000), - SPH_C32(0x90b60000), SPH_C32(0xdcea0074), SPH_C32(0xe0120000), - SPH_C32(0xa785570d), SPH_C32(0x14951430), SPH_C32(0x648af573), - SPH_C32(0x2e7d9f13) } -}; - -static const sph_u32 T512_45[32][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x1e6c0000), SPH_C32(0xc4420000), SPH_C32(0x8a2e0000), - SPH_C32(0xbcb6b800), SPH_C32(0x2c4413b6), SPH_C32(0x8bfdd3da), - SPH_C32(0x6a0c1bc8), SPH_C32(0xb99dc2eb), SPH_C32(0x92560000), - SPH_C32(0x1eda0000), SPH_C32(0xea510000), SPH_C32(0xe8b13000), - SPH_C32(0xa93556a5), SPH_C32(0xebfb6199), SPH_C32(0xb15c2254), - SPH_C32(0x33c5244f) }, - { SPH_C32(0x92560000), SPH_C32(0x1eda0000), SPH_C32(0xea510000), - SPH_C32(0xe8b13000), SPH_C32(0xa93556a5), SPH_C32(0xebfb6199), - SPH_C32(0xb15c2254), SPH_C32(0x33c5244f), SPH_C32(0x8c3a0000), - SPH_C32(0xda980000), SPH_C32(0x607f0000), SPH_C32(0x54078800), - SPH_C32(0x85714513), SPH_C32(0x6006b243), SPH_C32(0xdb50399c), - SPH_C32(0x8a58e6a4) }, - { SPH_C32(0x8c3a0000), SPH_C32(0xda980000), SPH_C32(0x607f0000), - SPH_C32(0x54078800), SPH_C32(0x85714513), SPH_C32(0x6006b243), - SPH_C32(0xdb50399c), SPH_C32(0x8a58e6a4), SPH_C32(0x1e6c0000), - SPH_C32(0xc4420000), SPH_C32(0x8a2e0000), SPH_C32(0xbcb6b800), - SPH_C32(0x2c4413b6), SPH_C32(0x8bfdd3da), SPH_C32(0x6a0c1bc8), - SPH_C32(0xb99dc2eb) }, - { SPH_C32(0x58430000), SPH_C32(0x807e0000), SPH_C32(0x78330001), - SPH_C32(0xc66b3800), SPH_C32(0xe7375cdc), SPH_C32(0x79ad3fdd), - SPH_C32(0xac73fe6f), SPH_C32(0x3a4479b1), SPH_C32(0x1d5a0000), - SPH_C32(0x2b720000), SPH_C32(0x488d0000), SPH_C32(0xaf611800), - SPH_C32(0x25cb2ec5), SPH_C32(0xc879bfd0), SPH_C32(0x81a20429), - SPH_C32(0x1e7536a6) }, - { SPH_C32(0x462f0000), SPH_C32(0x443c0000), SPH_C32(0xf21d0001), - SPH_C32(0x7add8000), SPH_C32(0xcb734f6a), SPH_C32(0xf250ec07), - SPH_C32(0xc67fe5a7), SPH_C32(0x83d9bb5a), SPH_C32(0x8f0c0000), - SPH_C32(0x35a80000), SPH_C32(0xa2dc0000), SPH_C32(0x47d02800), - SPH_C32(0x8cfe7860), SPH_C32(0x2382de49), SPH_C32(0x30fe267d), - SPH_C32(0x2db012e9) }, - { SPH_C32(0xca150000), SPH_C32(0x9ea40000), SPH_C32(0x92620001), - SPH_C32(0x2eda0800), SPH_C32(0x4e020a79), SPH_C32(0x92565e44), - SPH_C32(0x1d2fdc3b), SPH_C32(0x09815dfe), SPH_C32(0x91600000), - SPH_C32(0xf1ea0000), SPH_C32(0x28f20000), SPH_C32(0xfb669000), - SPH_C32(0xa0ba6bd6), SPH_C32(0xa87f0d93), SPH_C32(0x5af23db5), - SPH_C32(0x942dd002) }, - { SPH_C32(0xd4790000), SPH_C32(0x5ae60000), SPH_C32(0x184c0001), - SPH_C32(0x926cb000), SPH_C32(0x624619cf), SPH_C32(0x19ab8d9e), - SPH_C32(0x7723c7f3), SPH_C32(0xb01c9f15), SPH_C32(0x03360000), - SPH_C32(0xef300000), SPH_C32(0xc2a30000), SPH_C32(0x13d7a000), - SPH_C32(0x098f3d73), SPH_C32(0x43846c0a), SPH_C32(0xebae1fe1), - SPH_C32(0xa7e8f44d) }, - { SPH_C32(0x1d5a0000), SPH_C32(0x2b720000), SPH_C32(0x488d0000), - SPH_C32(0xaf611800), SPH_C32(0x25cb2ec5), SPH_C32(0xc879bfd0), - SPH_C32(0x81a20429), SPH_C32(0x1e7536a6), SPH_C32(0x45190000), - SPH_C32(0xab0c0000), SPH_C32(0x30be0001), SPH_C32(0x690a2000), - SPH_C32(0xc2fc7219), SPH_C32(0xb1d4800d), SPH_C32(0x2dd1fa46), - SPH_C32(0x24314f17) }, - { SPH_C32(0x03360000), SPH_C32(0xef300000), SPH_C32(0xc2a30000), - SPH_C32(0x13d7a000), SPH_C32(0x098f3d73), SPH_C32(0x43846c0a), - SPH_C32(0xebae1fe1), SPH_C32(0xa7e8f44d), SPH_C32(0xd74f0000), - SPH_C32(0xb5d60000), SPH_C32(0xdaef0001), SPH_C32(0x81bb1000), - SPH_C32(0x6bc924bc), SPH_C32(0x5a2fe194), SPH_C32(0x9c8dd812), - SPH_C32(0x17f46b58) }, - { SPH_C32(0x8f0c0000), SPH_C32(0x35a80000), SPH_C32(0xa2dc0000), - SPH_C32(0x47d02800), SPH_C32(0x8cfe7860), SPH_C32(0x2382de49), - SPH_C32(0x30fe267d), SPH_C32(0x2db012e9), SPH_C32(0xc9230000), - SPH_C32(0x71940000), SPH_C32(0x50c10001), SPH_C32(0x3d0da800), - SPH_C32(0x478d370a), SPH_C32(0xd1d2324e), SPH_C32(0xf681c3da), - SPH_C32(0xae69a9b3) }, - { SPH_C32(0x91600000), SPH_C32(0xf1ea0000), SPH_C32(0x28f20000), - SPH_C32(0xfb669000), SPH_C32(0xa0ba6bd6), SPH_C32(0xa87f0d93), - SPH_C32(0x5af23db5), SPH_C32(0x942dd002), SPH_C32(0x5b750000), - SPH_C32(0x6f4e0000), SPH_C32(0xba900001), SPH_C32(0xd5bc9800), - SPH_C32(0xeeb861af), SPH_C32(0x3a2953d7), SPH_C32(0x47dde18e), - SPH_C32(0x9dac8dfc) }, - { SPH_C32(0x45190000), SPH_C32(0xab0c0000), SPH_C32(0x30be0001), - SPH_C32(0x690a2000), SPH_C32(0xc2fc7219), SPH_C32(0xb1d4800d), - SPH_C32(0x2dd1fa46), SPH_C32(0x24314f17), SPH_C32(0x58430000), - SPH_C32(0x807e0000), SPH_C32(0x78330001), SPH_C32(0xc66b3800), - SPH_C32(0xe7375cdc), SPH_C32(0x79ad3fdd), SPH_C32(0xac73fe6f), - SPH_C32(0x3a4479b1) }, - { SPH_C32(0x5b750000), SPH_C32(0x6f4e0000), SPH_C32(0xba900001), - SPH_C32(0xd5bc9800), SPH_C32(0xeeb861af), SPH_C32(0x3a2953d7), - SPH_C32(0x47dde18e), SPH_C32(0x9dac8dfc), SPH_C32(0xca150000), - SPH_C32(0x9ea40000), SPH_C32(0x92620001), SPH_C32(0x2eda0800), - SPH_C32(0x4e020a79), SPH_C32(0x92565e44), SPH_C32(0x1d2fdc3b), - SPH_C32(0x09815dfe) }, - { SPH_C32(0xd74f0000), SPH_C32(0xb5d60000), SPH_C32(0xdaef0001), - SPH_C32(0x81bb1000), SPH_C32(0x6bc924bc), SPH_C32(0x5a2fe194), - SPH_C32(0x9c8dd812), SPH_C32(0x17f46b58), SPH_C32(0xd4790000), - SPH_C32(0x5ae60000), SPH_C32(0x184c0001), SPH_C32(0x926cb000), - SPH_C32(0x624619cf), SPH_C32(0x19ab8d9e), SPH_C32(0x7723c7f3), - SPH_C32(0xb01c9f15) }, - { SPH_C32(0xc9230000), SPH_C32(0x71940000), SPH_C32(0x50c10001), - SPH_C32(0x3d0da800), SPH_C32(0x478d370a), SPH_C32(0xd1d2324e), - SPH_C32(0xf681c3da), SPH_C32(0xae69a9b3), SPH_C32(0x462f0000), - SPH_C32(0x443c0000), SPH_C32(0xf21d0001), SPH_C32(0x7add8000), - SPH_C32(0xcb734f6a), SPH_C32(0xf250ec07), SPH_C32(0xc67fe5a7), - SPH_C32(0x83d9bb5a) }, - { SPH_C32(0xa53b0000), SPH_C32(0x14260000), SPH_C32(0x4e30001e), - SPH_C32(0x7cae0000), SPH_C32(0x8f9e0dd5), SPH_C32(0x78dfaa3d), - SPH_C32(0xf73168d8), SPH_C32(0x0b1b4946), SPH_C32(0x07ed0000), - SPH_C32(0xb2500000), SPH_C32(0x8774000a), SPH_C32(0x970d0000), - SPH_C32(0x437223ae), SPH_C32(0x48c76ea4), SPH_C32(0xf4786222), - SPH_C32(0x9075b1ce) }, - { SPH_C32(0xbb570000), SPH_C32(0xd0640000), SPH_C32(0xc41e001e), - SPH_C32(0xc018b800), SPH_C32(0xa3da1e63), SPH_C32(0xf32279e7), - SPH_C32(0x9d3d7310), SPH_C32(0xb2868bad), SPH_C32(0x95bb0000), - SPH_C32(0xac8a0000), SPH_C32(0x6d25000a), SPH_C32(0x7fbc3000), - SPH_C32(0xea47750b), SPH_C32(0xa33c0f3d), SPH_C32(0x45244076), - SPH_C32(0xa3b09581) }, - { SPH_C32(0x376d0000), SPH_C32(0x0afc0000), SPH_C32(0xa461001e), - SPH_C32(0x941f3000), SPH_C32(0x26ab5b70), SPH_C32(0x9324cba4), - SPH_C32(0x466d4a8c), SPH_C32(0x38de6d09), SPH_C32(0x8bd70000), - SPH_C32(0x68c80000), SPH_C32(0xe70b000a), SPH_C32(0xc30a8800), - SPH_C32(0xc60366bd), SPH_C32(0x28c1dce7), SPH_C32(0x2f285bbe), - SPH_C32(0x1a2d576a) }, - { SPH_C32(0x29010000), SPH_C32(0xcebe0000), SPH_C32(0x2e4f001e), - SPH_C32(0x28a98800), SPH_C32(0x0aef48c6), SPH_C32(0x18d9187e), - SPH_C32(0x2c615144), SPH_C32(0x8143afe2), SPH_C32(0x19810000), - SPH_C32(0x76120000), SPH_C32(0x0d5a000a), SPH_C32(0x2bbbb800), - SPH_C32(0x6f363018), SPH_C32(0xc33abd7e), SPH_C32(0x9e7479ea), - SPH_C32(0x29e87325) }, - { SPH_C32(0xfd780000), SPH_C32(0x94580000), SPH_C32(0x3603001f), - SPH_C32(0xbac53800), SPH_C32(0x68a95109), SPH_C32(0x017295e0), - SPH_C32(0x5b4296b7), SPH_C32(0x315f30f7), SPH_C32(0x1ab70000), - SPH_C32(0x99220000), SPH_C32(0xcff9000a), SPH_C32(0x386c1800), - SPH_C32(0x66b90d6b), SPH_C32(0x80bed174), SPH_C32(0x75da660b), - SPH_C32(0x8e008768) }, - { SPH_C32(0xe3140000), SPH_C32(0x501a0000), SPH_C32(0xbc2d001f), - SPH_C32(0x06738000), SPH_C32(0x44ed42bf), SPH_C32(0x8a8f463a), - SPH_C32(0x314e8d7f), SPH_C32(0x88c2f21c), SPH_C32(0x88e10000), - SPH_C32(0x87f80000), SPH_C32(0x25a8000a), SPH_C32(0xd0dd2800), - SPH_C32(0xcf8c5bce), SPH_C32(0x6b45b0ed), SPH_C32(0xc486445f), - SPH_C32(0xbdc5a327) }, - { SPH_C32(0x6f2e0000), SPH_C32(0x8a820000), SPH_C32(0xdc52001f), - SPH_C32(0x52740800), SPH_C32(0xc19c07ac), SPH_C32(0xea89f479), - SPH_C32(0xea1eb4e3), SPH_C32(0x029a14b8), SPH_C32(0x968d0000), - SPH_C32(0x43ba0000), SPH_C32(0xaf86000a), SPH_C32(0x6c6b9000), - SPH_C32(0xe3c84878), SPH_C32(0xe0b86337), SPH_C32(0xae8a5f97), - SPH_C32(0x045861cc) }, - { SPH_C32(0x71420000), SPH_C32(0x4ec00000), SPH_C32(0x567c001f), - SPH_C32(0xeec2b000), SPH_C32(0xedd8141a), SPH_C32(0x617427a3), - SPH_C32(0x8012af2b), SPH_C32(0xbb07d653), SPH_C32(0x04db0000), - SPH_C32(0x5d600000), SPH_C32(0x45d7000a), SPH_C32(0x84daa000), - SPH_C32(0x4afd1edd), SPH_C32(0x0b4302ae), SPH_C32(0x1fd67dc3), - SPH_C32(0x379d4583) }, - { SPH_C32(0xb8610000), SPH_C32(0x3f540000), SPH_C32(0x06bd001e), - SPH_C32(0xd3cf1800), SPH_C32(0xaa552310), SPH_C32(0xb0a615ed), - SPH_C32(0x76936cf1), SPH_C32(0x156e7fe0), SPH_C32(0x42f40000), - SPH_C32(0x195c0000), SPH_C32(0xb7ca000b), SPH_C32(0xfe072000), - SPH_C32(0x818e51b7), SPH_C32(0xf913eea9), SPH_C32(0xd9a99864), - SPH_C32(0xb444fed9) }, - { SPH_C32(0xa60d0000), SPH_C32(0xfb160000), SPH_C32(0x8c93001e), - SPH_C32(0x6f79a000), SPH_C32(0x861130a6), SPH_C32(0x3b5bc637), - SPH_C32(0x1c9f7739), SPH_C32(0xacf3bd0b), SPH_C32(0xd0a20000), - SPH_C32(0x07860000), SPH_C32(0x5d9b000b), SPH_C32(0x16b61000), - SPH_C32(0x28bb0712), SPH_C32(0x12e88f30), SPH_C32(0x68f5ba30), - SPH_C32(0x8781da96) }, - { SPH_C32(0x2a370000), SPH_C32(0x218e0000), SPH_C32(0xecec001e), - SPH_C32(0x3b7e2800), SPH_C32(0x036075b5), SPH_C32(0x5b5d7474), - SPH_C32(0xc7cf4ea5), SPH_C32(0x26ab5baf), SPH_C32(0xcece0000), - SPH_C32(0xc3c40000), SPH_C32(0xd7b5000b), SPH_C32(0xaa00a800), - SPH_C32(0x04ff14a4), SPH_C32(0x99155cea), SPH_C32(0x02f9a1f8), - SPH_C32(0x3e1c187d) }, - { SPH_C32(0x345b0000), SPH_C32(0xe5cc0000), SPH_C32(0x66c2001e), - SPH_C32(0x87c89000), SPH_C32(0x2f246603), SPH_C32(0xd0a0a7ae), - SPH_C32(0xadc3556d), SPH_C32(0x9f369944), SPH_C32(0x5c980000), - SPH_C32(0xdd1e0000), SPH_C32(0x3de4000b), SPH_C32(0x42b19800), - SPH_C32(0xadca4201), SPH_C32(0x72ee3d73), SPH_C32(0xb3a583ac), - SPH_C32(0x0dd93c32) }, - { SPH_C32(0xe0220000), SPH_C32(0xbf2a0000), SPH_C32(0x7e8e001f), - SPH_C32(0x15a42000), SPH_C32(0x4d627fcc), SPH_C32(0xc90b2a30), - SPH_C32(0xdae0929e), SPH_C32(0x2f2a0651), SPH_C32(0x5fae0000), - SPH_C32(0x322e0000), SPH_C32(0xff47000b), SPH_C32(0x51663800), - SPH_C32(0xa4457f72), SPH_C32(0x316a5179), SPH_C32(0x580b9c4d), - SPH_C32(0xaa31c87f) }, - { SPH_C32(0xfe4e0000), SPH_C32(0x7b680000), SPH_C32(0xf4a0001f), - SPH_C32(0xa9129800), SPH_C32(0x61266c7a), SPH_C32(0x42f6f9ea), - SPH_C32(0xb0ec8956), SPH_C32(0x96b7c4ba), SPH_C32(0xcdf80000), - SPH_C32(0x2cf40000), SPH_C32(0x1516000b), SPH_C32(0xb9d70800), - SPH_C32(0x0d7029d7), SPH_C32(0xda9130e0), SPH_C32(0xe957be19), - SPH_C32(0x99f4ec30) }, - { SPH_C32(0x72740000), SPH_C32(0xa1f00000), SPH_C32(0x94df001f), - SPH_C32(0xfd151000), SPH_C32(0xe4572969), SPH_C32(0x22f04ba9), - SPH_C32(0x6bbcb0ca), SPH_C32(0x1cef221e), SPH_C32(0xd3940000), - SPH_C32(0xe8b60000), SPH_C32(0x9f38000b), SPH_C32(0x0561b000), - SPH_C32(0x21343a61), SPH_C32(0x516ce33a), SPH_C32(0x835ba5d1), - SPH_C32(0x20692edb) }, - { SPH_C32(0x6c180000), SPH_C32(0x65b20000), SPH_C32(0x1ef1001f), - SPH_C32(0x41a3a800), SPH_C32(0xc8133adf), SPH_C32(0xa90d9873), - SPH_C32(0x01b0ab02), SPH_C32(0xa572e0f5), SPH_C32(0x41c20000), - SPH_C32(0xf66c0000), SPH_C32(0x7569000b), SPH_C32(0xedd08000), - SPH_C32(0x88016cc4), SPH_C32(0xba9782a3), SPH_C32(0x32078785), - SPH_C32(0x13ac0a94) } -}; - -static const sph_u32 T512_50[32][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xf0c50000), SPH_C32(0x59230000), SPH_C32(0x45820000), - SPH_C32(0xe18d00c0), SPH_C32(0x3b6d0631), SPH_C32(0xc2ed5699), - SPH_C32(0xcbe0fe1c), SPH_C32(0x56a7b19f), SPH_C32(0x16ed0000), - SPH_C32(0x15680000), SPH_C32(0xedd70000), SPH_C32(0x325d0220), - SPH_C32(0xe30c3689), SPH_C32(0x5a4ae643), SPH_C32(0xe375f8a8), - SPH_C32(0x81fdf908) }, - { SPH_C32(0xb4310000), SPH_C32(0x77330000), SPH_C32(0xb15d0000), - SPH_C32(0x7fd004e0), SPH_C32(0x78a26138), SPH_C32(0xd116c35d), - SPH_C32(0xd256d489), SPH_C32(0x4e6f74de), SPH_C32(0xe3060000), - SPH_C32(0xbdc10000), SPH_C32(0x87130000), SPH_C32(0xbff20060), - SPH_C32(0x2eba0a1a), SPH_C32(0x8db53751), SPH_C32(0x73c5ab06), - SPH_C32(0x5bd61539) }, - { SPH_C32(0x44f40000), SPH_C32(0x2e100000), SPH_C32(0xf4df0000), - SPH_C32(0x9e5d0420), SPH_C32(0x43cf6709), SPH_C32(0x13fb95c4), - SPH_C32(0x19b62a95), SPH_C32(0x18c8c541), SPH_C32(0xf5eb0000), - SPH_C32(0xa8a90000), SPH_C32(0x6ac40000), SPH_C32(0x8daf0240), - SPH_C32(0xcdb63c93), SPH_C32(0xd7ffd112), SPH_C32(0x90b053ae), - SPH_C32(0xda2bec31) }, - { SPH_C32(0xe3060000), SPH_C32(0xbdc10000), SPH_C32(0x87130000), - SPH_C32(0xbff20060), SPH_C32(0x2eba0a1a), SPH_C32(0x8db53751), - SPH_C32(0x73c5ab06), SPH_C32(0x5bd61539), SPH_C32(0x57370000), - SPH_C32(0xcaf20000), SPH_C32(0x364e0000), SPH_C32(0xc0220480), - SPH_C32(0x56186b22), SPH_C32(0x5ca3f40c), SPH_C32(0xa1937f8f), - SPH_C32(0x15b961e7) }, - { SPH_C32(0x13c30000), SPH_C32(0xe4e20000), SPH_C32(0xc2910000), - SPH_C32(0x5e7f00a0), SPH_C32(0x15d70c2b), SPH_C32(0x4f5861c8), - SPH_C32(0xb825551a), SPH_C32(0x0d71a4a6), SPH_C32(0x41da0000), - SPH_C32(0xdf9a0000), SPH_C32(0xdb990000), SPH_C32(0xf27f06a0), - SPH_C32(0xb5145dab), SPH_C32(0x06e9124f), SPH_C32(0x42e68727), - SPH_C32(0x944498ef) }, - { SPH_C32(0x57370000), SPH_C32(0xcaf20000), SPH_C32(0x364e0000), - SPH_C32(0xc0220480), SPH_C32(0x56186b22), SPH_C32(0x5ca3f40c), - SPH_C32(0xa1937f8f), SPH_C32(0x15b961e7), SPH_C32(0xb4310000), - SPH_C32(0x77330000), SPH_C32(0xb15d0000), SPH_C32(0x7fd004e0), - SPH_C32(0x78a26138), SPH_C32(0xd116c35d), SPH_C32(0xd256d489), - SPH_C32(0x4e6f74de) }, - { SPH_C32(0xa7f20000), SPH_C32(0x93d10000), SPH_C32(0x73cc0000), - SPH_C32(0x21af0440), SPH_C32(0x6d756d13), SPH_C32(0x9e4ea295), - SPH_C32(0x6a738193), SPH_C32(0x431ed078), SPH_C32(0xa2dc0000), - SPH_C32(0x625b0000), SPH_C32(0x5c8a0000), SPH_C32(0x4d8d06c0), - SPH_C32(0x9bae57b1), SPH_C32(0x8b5c251e), SPH_C32(0x31232c21), - SPH_C32(0xcf928dd6) }, - { SPH_C32(0x02f20000), SPH_C32(0xa2810000), SPH_C32(0x873f0000), - SPH_C32(0xe36c7800), SPH_C32(0x1e1d74ef), SPH_C32(0x073d2bd6), - SPH_C32(0xc4c23237), SPH_C32(0x7f32259e), SPH_C32(0xbadd0000), - SPH_C32(0x13ad0000), SPH_C32(0xb7e70000), SPH_C32(0xf7282800), - SPH_C32(0xdf45144d), SPH_C32(0x361ac33a), SPH_C32(0xea5a8d14), - SPH_C32(0x2a2c18f0) }, - { SPH_C32(0xf2370000), SPH_C32(0xfba20000), SPH_C32(0xc2bd0000), - SPH_C32(0x02e178c0), SPH_C32(0x257072de), SPH_C32(0xc5d07d4f), - SPH_C32(0x0f22cc2b), SPH_C32(0x29959401), SPH_C32(0xac300000), - SPH_C32(0x06c50000), SPH_C32(0x5a300000), SPH_C32(0xc5752a20), - SPH_C32(0x3c4922c4), SPH_C32(0x6c502579), SPH_C32(0x092f75bc), - SPH_C32(0xabd1e1f8) }, - { SPH_C32(0xb6c30000), SPH_C32(0xd5b20000), SPH_C32(0x36620000), - SPH_C32(0x9cbc7ce0), SPH_C32(0x66bf15d7), SPH_C32(0xd62be88b), - SPH_C32(0x1694e6be), SPH_C32(0x315d5140), SPH_C32(0x59db0000), - SPH_C32(0xae6c0000), SPH_C32(0x30f40000), SPH_C32(0x48da2860), - SPH_C32(0xf1ff1e57), SPH_C32(0xbbaff46b), SPH_C32(0x999f2612), - SPH_C32(0x71fa0dc9) }, - { SPH_C32(0x46060000), SPH_C32(0x8c910000), SPH_C32(0x73e00000), - SPH_C32(0x7d317c20), SPH_C32(0x5dd213e6), SPH_C32(0x14c6be12), - SPH_C32(0xdd7418a2), SPH_C32(0x67fae0df), SPH_C32(0x4f360000), - SPH_C32(0xbb040000), SPH_C32(0xdd230000), SPH_C32(0x7a872a40), - SPH_C32(0x12f328de), SPH_C32(0xe1e51228), SPH_C32(0x7aeadeba), - SPH_C32(0xf007f4c1) }, - { SPH_C32(0xe1f40000), SPH_C32(0x1f400000), SPH_C32(0x002c0000), - SPH_C32(0x5c9e7860), SPH_C32(0x30a77ef5), SPH_C32(0x8a881c87), - SPH_C32(0xb7079931), SPH_C32(0x24e430a7), SPH_C32(0xedea0000), - SPH_C32(0xd95f0000), SPH_C32(0x81a90000), SPH_C32(0x370a2c80), - SPH_C32(0x895d7f6f), SPH_C32(0x6ab93736), SPH_C32(0x4bc9f29b), - SPH_C32(0x3f957917) }, - { SPH_C32(0x11310000), SPH_C32(0x46630000), SPH_C32(0x45ae0000), - SPH_C32(0xbd1378a0), SPH_C32(0x0bca78c4), SPH_C32(0x48654a1e), - SPH_C32(0x7ce7672d), SPH_C32(0x72438138), SPH_C32(0xfb070000), - SPH_C32(0xcc370000), SPH_C32(0x6c7e0000), SPH_C32(0x05572ea0), - SPH_C32(0x6a5149e6), SPH_C32(0x30f3d175), SPH_C32(0xa8bc0a33), - SPH_C32(0xbe68801f) }, - { SPH_C32(0x55c50000), SPH_C32(0x68730000), SPH_C32(0xb1710000), - SPH_C32(0x234e7c80), SPH_C32(0x48051fcd), SPH_C32(0x5b9edfda), - SPH_C32(0x65514db8), SPH_C32(0x6a8b4479), SPH_C32(0x0eec0000), - SPH_C32(0x649e0000), SPH_C32(0x06ba0000), SPH_C32(0x88f82ce0), - SPH_C32(0xa7e77575), SPH_C32(0xe70c0067), SPH_C32(0x380c599d), - SPH_C32(0x64436c2e) }, - { SPH_C32(0xa5000000), SPH_C32(0x31500000), SPH_C32(0xf4f30000), - SPH_C32(0xc2c37c40), SPH_C32(0x736819fc), SPH_C32(0x99738943), - SPH_C32(0xaeb1b3a4), SPH_C32(0x3c2cf5e6), SPH_C32(0x18010000), - SPH_C32(0x71f60000), SPH_C32(0xeb6d0000), SPH_C32(0xbaa52ec0), - SPH_C32(0x44eb43fc), SPH_C32(0xbd46e624), SPH_C32(0xdb79a135), - SPH_C32(0xe5be9526) }, - { SPH_C32(0xbadd0000), SPH_C32(0x13ad0000), SPH_C32(0xb7e70000), - SPH_C32(0xf7282800), SPH_C32(0xdf45144d), SPH_C32(0x361ac33a), - SPH_C32(0xea5a8d14), SPH_C32(0x2a2c18f0), SPH_C32(0xb82f0000), - SPH_C32(0xb12c0000), SPH_C32(0x30d80000), SPH_C32(0x14445000), - SPH_C32(0xc15860a2), SPH_C32(0x3127e8ec), SPH_C32(0x2e98bf23), - SPH_C32(0x551e3d6e) }, - { SPH_C32(0x4a180000), SPH_C32(0x4a8e0000), SPH_C32(0xf2650000), - SPH_C32(0x16a528c0), SPH_C32(0xe428127c), SPH_C32(0xf4f795a3), - SPH_C32(0x21ba7308), SPH_C32(0x7c8ba96f), SPH_C32(0xaec20000), - SPH_C32(0xa4440000), SPH_C32(0xdd0f0000), SPH_C32(0x26195220), - SPH_C32(0x2254562b), SPH_C32(0x6b6d0eaf), SPH_C32(0xcded478b), - SPH_C32(0xd4e3c466) }, - { SPH_C32(0x0eec0000), SPH_C32(0x649e0000), SPH_C32(0x06ba0000), - SPH_C32(0x88f82ce0), SPH_C32(0xa7e77575), SPH_C32(0xe70c0067), - SPH_C32(0x380c599d), SPH_C32(0x64436c2e), SPH_C32(0x5b290000), - SPH_C32(0x0ced0000), SPH_C32(0xb7cb0000), SPH_C32(0xabb65060), - SPH_C32(0xefe26ab8), SPH_C32(0xbc92dfbd), SPH_C32(0x5d5d1425), - SPH_C32(0x0ec82857) }, - { SPH_C32(0xfe290000), SPH_C32(0x3dbd0000), SPH_C32(0x43380000), - SPH_C32(0x69752c20), SPH_C32(0x9c8a7344), SPH_C32(0x25e156fe), - SPH_C32(0xf3eca781), SPH_C32(0x32e4ddb1), SPH_C32(0x4dc40000), - SPH_C32(0x19850000), SPH_C32(0x5a1c0000), SPH_C32(0x99eb5240), - SPH_C32(0x0cee5c31), SPH_C32(0xe6d839fe), SPH_C32(0xbe28ec8d), - SPH_C32(0x8f35d15f) }, - { SPH_C32(0x59db0000), SPH_C32(0xae6c0000), SPH_C32(0x30f40000), - SPH_C32(0x48da2860), SPH_C32(0xf1ff1e57), SPH_C32(0xbbaff46b), - SPH_C32(0x999f2612), SPH_C32(0x71fa0dc9), SPH_C32(0xef180000), - SPH_C32(0x7bde0000), SPH_C32(0x06960000), SPH_C32(0xd4665480), - SPH_C32(0x97400b80), SPH_C32(0x6d841ce0), SPH_C32(0x8f0bc0ac), - SPH_C32(0x40a75c89) }, - { SPH_C32(0xa91e0000), SPH_C32(0xf74f0000), SPH_C32(0x75760000), - SPH_C32(0xa95728a0), SPH_C32(0xca921866), SPH_C32(0x7942a2f2), - SPH_C32(0x527fd80e), SPH_C32(0x275dbc56), SPH_C32(0xf9f50000), - SPH_C32(0x6eb60000), SPH_C32(0xeb410000), SPH_C32(0xe63b56a0), - SPH_C32(0x744c3d09), SPH_C32(0x37cefaa3), SPH_C32(0x6c7e3804), - SPH_C32(0xc15aa581) }, - { SPH_C32(0xedea0000), SPH_C32(0xd95f0000), SPH_C32(0x81a90000), - SPH_C32(0x370a2c80), SPH_C32(0x895d7f6f), SPH_C32(0x6ab93736), - SPH_C32(0x4bc9f29b), SPH_C32(0x3f957917), SPH_C32(0x0c1e0000), - SPH_C32(0xc61f0000), SPH_C32(0x81850000), SPH_C32(0x6b9454e0), - SPH_C32(0xb9fa019a), SPH_C32(0xe0312bb1), SPH_C32(0xfcce6baa), - SPH_C32(0x1b7149b0) }, - { SPH_C32(0x1d2f0000), SPH_C32(0x807c0000), SPH_C32(0xc42b0000), - SPH_C32(0xd6872c40), SPH_C32(0xb230795e), SPH_C32(0xa85461af), - SPH_C32(0x80290c87), SPH_C32(0x6932c888), SPH_C32(0x1af30000), - SPH_C32(0xd3770000), SPH_C32(0x6c520000), SPH_C32(0x59c956c0), - SPH_C32(0x5af63713), SPH_C32(0xba7bcdf2), SPH_C32(0x1fbb9302), - SPH_C32(0x9a8cb0b8) }, - { SPH_C32(0xb82f0000), SPH_C32(0xb12c0000), SPH_C32(0x30d80000), - SPH_C32(0x14445000), SPH_C32(0xc15860a2), SPH_C32(0x3127e8ec), - SPH_C32(0x2e98bf23), SPH_C32(0x551e3d6e), SPH_C32(0x02f20000), - SPH_C32(0xa2810000), SPH_C32(0x873f0000), SPH_C32(0xe36c7800), - SPH_C32(0x1e1d74ef), SPH_C32(0x073d2bd6), SPH_C32(0xc4c23237), - SPH_C32(0x7f32259e) }, - { SPH_C32(0x48ea0000), SPH_C32(0xe80f0000), SPH_C32(0x755a0000), - SPH_C32(0xf5c950c0), SPH_C32(0xfa356693), SPH_C32(0xf3cabe75), - SPH_C32(0xe578413f), SPH_C32(0x03b98cf1), SPH_C32(0x141f0000), - SPH_C32(0xb7e90000), SPH_C32(0x6ae80000), SPH_C32(0xd1317a20), - SPH_C32(0xfd114266), SPH_C32(0x5d77cd95), SPH_C32(0x27b7ca9f), - SPH_C32(0xfecfdc96) }, - { SPH_C32(0x0c1e0000), SPH_C32(0xc61f0000), SPH_C32(0x81850000), - SPH_C32(0x6b9454e0), SPH_C32(0xb9fa019a), SPH_C32(0xe0312bb1), - SPH_C32(0xfcce6baa), SPH_C32(0x1b7149b0), SPH_C32(0xe1f40000), - SPH_C32(0x1f400000), SPH_C32(0x002c0000), SPH_C32(0x5c9e7860), - SPH_C32(0x30a77ef5), SPH_C32(0x8a881c87), SPH_C32(0xb7079931), - SPH_C32(0x24e430a7) }, - { SPH_C32(0xfcdb0000), SPH_C32(0x9f3c0000), SPH_C32(0xc4070000), - SPH_C32(0x8a195420), SPH_C32(0x829707ab), SPH_C32(0x22dc7d28), - SPH_C32(0x372e95b6), SPH_C32(0x4dd6f82f), SPH_C32(0xf7190000), - SPH_C32(0x0a280000), SPH_C32(0xedfb0000), SPH_C32(0x6ec37a40), - SPH_C32(0xd3ab487c), SPH_C32(0xd0c2fac4), SPH_C32(0x54726199), - SPH_C32(0xa519c9af) }, - { SPH_C32(0x5b290000), SPH_C32(0x0ced0000), SPH_C32(0xb7cb0000), - SPH_C32(0xabb65060), SPH_C32(0xefe26ab8), SPH_C32(0xbc92dfbd), - SPH_C32(0x5d5d1425), SPH_C32(0x0ec82857), SPH_C32(0x55c50000), - SPH_C32(0x68730000), SPH_C32(0xb1710000), SPH_C32(0x234e7c80), - SPH_C32(0x48051fcd), SPH_C32(0x5b9edfda), SPH_C32(0x65514db8), - SPH_C32(0x6a8b4479) }, - { SPH_C32(0xabec0000), SPH_C32(0x55ce0000), SPH_C32(0xf2490000), - SPH_C32(0x4a3b50a0), SPH_C32(0xd48f6c89), SPH_C32(0x7e7f8924), - SPH_C32(0x96bdea39), SPH_C32(0x586f99c8), SPH_C32(0x43280000), - SPH_C32(0x7d1b0000), SPH_C32(0x5ca60000), SPH_C32(0x11137ea0), - SPH_C32(0xab092944), SPH_C32(0x01d43999), SPH_C32(0x8624b510), - SPH_C32(0xeb76bd71) }, - { SPH_C32(0xef180000), SPH_C32(0x7bde0000), SPH_C32(0x06960000), - SPH_C32(0xd4665480), SPH_C32(0x97400b80), SPH_C32(0x6d841ce0), - SPH_C32(0x8f0bc0ac), SPH_C32(0x40a75c89), SPH_C32(0xb6c30000), - SPH_C32(0xd5b20000), SPH_C32(0x36620000), SPH_C32(0x9cbc7ce0), - SPH_C32(0x66bf15d7), SPH_C32(0xd62be88b), SPH_C32(0x1694e6be), - SPH_C32(0x315d5140) }, - { SPH_C32(0x1fdd0000), SPH_C32(0x22fd0000), SPH_C32(0x43140000), - SPH_C32(0x35eb5440), SPH_C32(0xac2d0db1), SPH_C32(0xaf694a79), - SPH_C32(0x44eb3eb0), SPH_C32(0x1600ed16), SPH_C32(0xa02e0000), - SPH_C32(0xc0da0000), SPH_C32(0xdbb50000), SPH_C32(0xaee17ec0), - SPH_C32(0x85b3235e), SPH_C32(0x8c610ec8), SPH_C32(0xf5e11e16), - SPH_C32(0xb0a0a848) } -}; - -static const sph_u32 T512_55[32][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x5fa80000), SPH_C32(0x56030000), SPH_C32(0x43ae0000), - SPH_C32(0x64f30013), SPH_C32(0x257e86bf), SPH_C32(0x1311944e), - SPH_C32(0x541e95bf), SPH_C32(0x8ea4db69), SPH_C32(0x00440000), - SPH_C32(0x7f480000), SPH_C32(0xda7c0000), SPH_C32(0x2a230001), - SPH_C32(0x3badc9cc), SPH_C32(0xa9b69c87), SPH_C32(0x030a9e60), - SPH_C32(0xbe0a679e) }, - { SPH_C32(0x00440000), SPH_C32(0x7f480000), SPH_C32(0xda7c0000), - SPH_C32(0x2a230001), SPH_C32(0x3badc9cc), SPH_C32(0xa9b69c87), - SPH_C32(0x030a9e60), SPH_C32(0xbe0a679e), SPH_C32(0x5fec0000), - SPH_C32(0x294b0000), SPH_C32(0x99d20000), SPH_C32(0x4ed00012), - SPH_C32(0x1ed34f73), SPH_C32(0xbaa708c9), SPH_C32(0x57140bdf), - SPH_C32(0x30aebcf7) }, - { SPH_C32(0x5fec0000), SPH_C32(0x294b0000), SPH_C32(0x99d20000), - SPH_C32(0x4ed00012), SPH_C32(0x1ed34f73), SPH_C32(0xbaa708c9), - SPH_C32(0x57140bdf), SPH_C32(0x30aebcf7), SPH_C32(0x5fa80000), - SPH_C32(0x56030000), SPH_C32(0x43ae0000), SPH_C32(0x64f30013), - SPH_C32(0x257e86bf), SPH_C32(0x1311944e), SPH_C32(0x541e95bf), - SPH_C32(0x8ea4db69) }, - { SPH_C32(0xee930000), SPH_C32(0xd6070000), SPH_C32(0x92c10000), - SPH_C32(0x2b9801e0), SPH_C32(0x9451287c), SPH_C32(0x3b6cfb57), - SPH_C32(0x45312374), SPH_C32(0x201f6a64), SPH_C32(0x7b280000), - SPH_C32(0x57420000), SPH_C32(0xa9e50000), SPH_C32(0x634300a0), - SPH_C32(0x9edb442f), SPH_C32(0x6d9995bb), SPH_C32(0x27f83b03), - SPH_C32(0xc7ff60f0) }, - { SPH_C32(0xb13b0000), SPH_C32(0x80040000), SPH_C32(0xd16f0000), - SPH_C32(0x4f6b01f3), SPH_C32(0xb12faec3), SPH_C32(0x287d6f19), - SPH_C32(0x112fb6cb), SPH_C32(0xaebbb10d), SPH_C32(0x7b6c0000), - SPH_C32(0x280a0000), SPH_C32(0x73990000), SPH_C32(0x496000a1), - SPH_C32(0xa5768de3), SPH_C32(0xc42f093c), SPH_C32(0x24f2a563), - SPH_C32(0x79f5076e) }, - { SPH_C32(0xeed70000), SPH_C32(0xa94f0000), SPH_C32(0x48bd0000), - SPH_C32(0x01bb01e1), SPH_C32(0xaffce1b0), SPH_C32(0x92da67d0), - SPH_C32(0x463bbd14), SPH_C32(0x9e150dfa), SPH_C32(0x24c40000), - SPH_C32(0x7e090000), SPH_C32(0x30370000), SPH_C32(0x2d9300b2), - SPH_C32(0x80080b5c), SPH_C32(0xd73e9d72), SPH_C32(0x70ec30dc), - SPH_C32(0xf751dc07) }, - { SPH_C32(0xb17f0000), SPH_C32(0xff4c0000), SPH_C32(0x0b130000), - SPH_C32(0x654801f2), SPH_C32(0x8a82670f), SPH_C32(0x81cbf39e), - SPH_C32(0x122528ab), SPH_C32(0x10b1d693), SPH_C32(0x24800000), - SPH_C32(0x01410000), SPH_C32(0xea4b0000), SPH_C32(0x07b000b3), - SPH_C32(0xbba5c290), SPH_C32(0x7e8801f5), SPH_C32(0x73e6aebc), - SPH_C32(0x495bbb99) }, - { SPH_C32(0x7b280000), SPH_C32(0x57420000), SPH_C32(0xa9e50000), - SPH_C32(0x634300a0), SPH_C32(0x9edb442f), SPH_C32(0x6d9995bb), - SPH_C32(0x27f83b03), SPH_C32(0xc7ff60f0), SPH_C32(0x95bb0000), - SPH_C32(0x81450000), SPH_C32(0x3b240000), SPH_C32(0x48db0140), - SPH_C32(0x0a8a6c53), SPH_C32(0x56f56eec), SPH_C32(0x62c91877), - SPH_C32(0xe7e00a94) }, - { SPH_C32(0x24800000), SPH_C32(0x01410000), SPH_C32(0xea4b0000), - SPH_C32(0x07b000b3), SPH_C32(0xbba5c290), SPH_C32(0x7e8801f5), - SPH_C32(0x73e6aebc), SPH_C32(0x495bbb99), SPH_C32(0x95ff0000), - SPH_C32(0xfe0d0000), SPH_C32(0xe1580000), SPH_C32(0x62f80141), - SPH_C32(0x3127a59f), SPH_C32(0xff43f26b), SPH_C32(0x61c38617), - SPH_C32(0x59ea6d0a) }, - { SPH_C32(0x7b6c0000), SPH_C32(0x280a0000), SPH_C32(0x73990000), - SPH_C32(0x496000a1), SPH_C32(0xa5768de3), SPH_C32(0xc42f093c), - SPH_C32(0x24f2a563), SPH_C32(0x79f5076e), SPH_C32(0xca570000), - SPH_C32(0xa80e0000), SPH_C32(0xa2f60000), SPH_C32(0x060b0152), - SPH_C32(0x14592320), SPH_C32(0xec526625), SPH_C32(0x35dd13a8), - SPH_C32(0xd74eb663) }, - { SPH_C32(0x24c40000), SPH_C32(0x7e090000), SPH_C32(0x30370000), - SPH_C32(0x2d9300b2), SPH_C32(0x80080b5c), SPH_C32(0xd73e9d72), - SPH_C32(0x70ec30dc), SPH_C32(0xf751dc07), SPH_C32(0xca130000), - SPH_C32(0xd7460000), SPH_C32(0x788a0000), SPH_C32(0x2c280153), - SPH_C32(0x2ff4eaec), SPH_C32(0x45e4faa2), SPH_C32(0x36d78dc8), - SPH_C32(0x6944d1fd) }, - { SPH_C32(0x95bb0000), SPH_C32(0x81450000), SPH_C32(0x3b240000), - SPH_C32(0x48db0140), SPH_C32(0x0a8a6c53), SPH_C32(0x56f56eec), - SPH_C32(0x62c91877), SPH_C32(0xe7e00a94), SPH_C32(0xee930000), - SPH_C32(0xd6070000), SPH_C32(0x92c10000), SPH_C32(0x2b9801e0), - SPH_C32(0x9451287c), SPH_C32(0x3b6cfb57), SPH_C32(0x45312374), - SPH_C32(0x201f6a64) }, - { SPH_C32(0xca130000), SPH_C32(0xd7460000), SPH_C32(0x788a0000), - SPH_C32(0x2c280153), SPH_C32(0x2ff4eaec), SPH_C32(0x45e4faa2), - SPH_C32(0x36d78dc8), SPH_C32(0x6944d1fd), SPH_C32(0xeed70000), - SPH_C32(0xa94f0000), SPH_C32(0x48bd0000), SPH_C32(0x01bb01e1), - SPH_C32(0xaffce1b0), SPH_C32(0x92da67d0), SPH_C32(0x463bbd14), - SPH_C32(0x9e150dfa) }, - { SPH_C32(0x95ff0000), SPH_C32(0xfe0d0000), SPH_C32(0xe1580000), - SPH_C32(0x62f80141), SPH_C32(0x3127a59f), SPH_C32(0xff43f26b), - SPH_C32(0x61c38617), SPH_C32(0x59ea6d0a), SPH_C32(0xb17f0000), - SPH_C32(0xff4c0000), SPH_C32(0x0b130000), SPH_C32(0x654801f2), - SPH_C32(0x8a82670f), SPH_C32(0x81cbf39e), SPH_C32(0x122528ab), - SPH_C32(0x10b1d693) }, - { SPH_C32(0xca570000), SPH_C32(0xa80e0000), SPH_C32(0xa2f60000), - SPH_C32(0x060b0152), SPH_C32(0x14592320), SPH_C32(0xec526625), - SPH_C32(0x35dd13a8), SPH_C32(0xd74eb663), SPH_C32(0xb13b0000), - SPH_C32(0x80040000), SPH_C32(0xd16f0000), SPH_C32(0x4f6b01f3), - SPH_C32(0xb12faec3), SPH_C32(0x287d6f19), SPH_C32(0x112fb6cb), - SPH_C32(0xaebbb10d) }, - { SPH_C32(0xe6280000), SPH_C32(0x4c4b0000), SPH_C32(0xa8550000), - SPH_C32(0xd3d002e0), SPH_C32(0xd86130b8), SPH_C32(0x98a7b0da), - SPH_C32(0x289506b4), SPH_C32(0xd75a4897), SPH_C32(0xf0c50000), - SPH_C32(0x59230000), SPH_C32(0x45820000), SPH_C32(0xe18d00c0), - SPH_C32(0x3b6d0631), SPH_C32(0xc2ed5699), SPH_C32(0xcbe0fe1c), - SPH_C32(0x56a7b19f) }, - { SPH_C32(0xb9800000), SPH_C32(0x1a480000), SPH_C32(0xebfb0000), - SPH_C32(0xb72302f3), SPH_C32(0xfd1fb607), SPH_C32(0x8bb62494), - SPH_C32(0x7c8b930b), SPH_C32(0x59fe93fe), SPH_C32(0xf0810000), - SPH_C32(0x266b0000), SPH_C32(0x9ffe0000), SPH_C32(0xcbae00c1), - SPH_C32(0x00c0cffd), SPH_C32(0x6b5bca1e), SPH_C32(0xc8ea607c), - SPH_C32(0xe8add601) }, - { SPH_C32(0xe66c0000), SPH_C32(0x33030000), SPH_C32(0x72290000), - SPH_C32(0xf9f302e1), SPH_C32(0xe3ccf974), SPH_C32(0x31112c5d), - SPH_C32(0x2b9f98d4), SPH_C32(0x69502f09), SPH_C32(0xaf290000), - SPH_C32(0x70680000), SPH_C32(0xdc500000), SPH_C32(0xaf5d00d2), - SPH_C32(0x25be4942), SPH_C32(0x784a5e50), SPH_C32(0x9cf4f5c3), - SPH_C32(0x66090d68) }, - { SPH_C32(0xb9c40000), SPH_C32(0x65000000), SPH_C32(0x31870000), - SPH_C32(0x9d0002f2), SPH_C32(0xc6b27fcb), SPH_C32(0x2200b813), - SPH_C32(0x7f810d6b), SPH_C32(0xe7f4f460), SPH_C32(0xaf6d0000), - SPH_C32(0x0f200000), SPH_C32(0x062c0000), SPH_C32(0x857e00d3), - SPH_C32(0x1e13808e), SPH_C32(0xd1fcc2d7), SPH_C32(0x9ffe6ba3), - SPH_C32(0xd8036af6) }, - { SPH_C32(0x08bb0000), SPH_C32(0x9a4c0000), SPH_C32(0x3a940000), - SPH_C32(0xf8480300), SPH_C32(0x4c3018c4), SPH_C32(0xa3cb4b8d), - SPH_C32(0x6da425c0), SPH_C32(0xf74522f3), SPH_C32(0x8bed0000), - SPH_C32(0x0e610000), SPH_C32(0xec670000), SPH_C32(0x82ce0060), - SPH_C32(0xa5b6421e), SPH_C32(0xaf74c322), SPH_C32(0xec18c51f), - SPH_C32(0x9158d16f) }, - { SPH_C32(0x57130000), SPH_C32(0xcc4f0000), SPH_C32(0x793a0000), - SPH_C32(0x9cbb0313), SPH_C32(0x694e9e7b), SPH_C32(0xb0dadfc3), - SPH_C32(0x39bab07f), SPH_C32(0x79e1f99a), SPH_C32(0x8ba90000), - SPH_C32(0x71290000), SPH_C32(0x361b0000), SPH_C32(0xa8ed0061), - SPH_C32(0x9e1b8bd2), SPH_C32(0x06c25fa5), SPH_C32(0xef125b7f), - SPH_C32(0x2f52b6f1) }, - { SPH_C32(0x08ff0000), SPH_C32(0xe5040000), SPH_C32(0xe0e80000), - SPH_C32(0xd26b0301), SPH_C32(0x779dd108), SPH_C32(0x0a7dd70a), - SPH_C32(0x6eaebba0), SPH_C32(0x494f456d), SPH_C32(0xd4010000), - SPH_C32(0x272a0000), SPH_C32(0x75b50000), SPH_C32(0xcc1e0072), - SPH_C32(0xbb650d6d), SPH_C32(0x15d3cbeb), SPH_C32(0xbb0ccec0), - SPH_C32(0xa1f66d98) }, - { SPH_C32(0x57570000), SPH_C32(0xb3070000), SPH_C32(0xa3460000), - SPH_C32(0xb6980312), SPH_C32(0x52e357b7), SPH_C32(0x196c4344), - SPH_C32(0x3ab02e1f), SPH_C32(0xc7eb9e04), SPH_C32(0xd4450000), - SPH_C32(0x58620000), SPH_C32(0xafc90000), SPH_C32(0xe63d0073), - SPH_C32(0x80c8c4a1), SPH_C32(0xbc65576c), SPH_C32(0xb80650a0), - SPH_C32(0x1ffc0a06) }, - { SPH_C32(0x9d000000), SPH_C32(0x1b090000), SPH_C32(0x01b00000), - SPH_C32(0xb0930240), SPH_C32(0x46ba7497), SPH_C32(0xf53e2561), - SPH_C32(0x0f6d3db7), SPH_C32(0x10a52867), SPH_C32(0x657e0000), - SPH_C32(0xd8660000), SPH_C32(0x7ea60000), SPH_C32(0xa9560180), - SPH_C32(0x31e76a62), SPH_C32(0x94183875), SPH_C32(0xa929e66b), - SPH_C32(0xb147bb0b) }, - { SPH_C32(0xc2a80000), SPH_C32(0x4d0a0000), SPH_C32(0x421e0000), - SPH_C32(0xd4600253), SPH_C32(0x63c4f228), SPH_C32(0xe62fb12f), - SPH_C32(0x5b73a808), SPH_C32(0x9e01f30e), SPH_C32(0x653a0000), - SPH_C32(0xa72e0000), SPH_C32(0xa4da0000), SPH_C32(0x83750181), - SPH_C32(0x0a4aa3ae), SPH_C32(0x3daea4f2), SPH_C32(0xaa23780b), - SPH_C32(0x0f4ddc95) }, - { SPH_C32(0x9d440000), SPH_C32(0x64410000), SPH_C32(0xdbcc0000), - SPH_C32(0x9ab00241), SPH_C32(0x7d17bd5b), SPH_C32(0x5c88b9e6), - SPH_C32(0x0c67a3d7), SPH_C32(0xaeaf4ff9), SPH_C32(0x3a920000), - SPH_C32(0xf12d0000), SPH_C32(0xe7740000), SPH_C32(0xe7860192), - SPH_C32(0x2f342511), SPH_C32(0x2ebf30bc), SPH_C32(0xfe3dedb4), - SPH_C32(0x81e907fc) }, - { SPH_C32(0xc2ec0000), SPH_C32(0x32420000), SPH_C32(0x98620000), - SPH_C32(0xfe430252), SPH_C32(0x58693be4), SPH_C32(0x4f992da8), - SPH_C32(0x58793668), SPH_C32(0x200b9490), SPH_C32(0x3ad60000), - SPH_C32(0x8e650000), SPH_C32(0x3d080000), SPH_C32(0xcda50193), - SPH_C32(0x1499ecdd), SPH_C32(0x8709ac3b), SPH_C32(0xfd3773d4), - SPH_C32(0x3fe36062) }, - { SPH_C32(0x73930000), SPH_C32(0xcd0e0000), SPH_C32(0x93710000), - SPH_C32(0x9b0b03a0), SPH_C32(0xd2eb5ceb), SPH_C32(0xce52de36), - SPH_C32(0x4a5c1ec3), SPH_C32(0x30ba4203), SPH_C32(0x1e560000), - SPH_C32(0x8f240000), SPH_C32(0xd7430000), SPH_C32(0xca150120), - SPH_C32(0xaf3c2e4d), SPH_C32(0xf981adce), SPH_C32(0x8ed1dd68), - SPH_C32(0x76b8dbfb) }, - { SPH_C32(0x2c3b0000), SPH_C32(0x9b0d0000), SPH_C32(0xd0df0000), - SPH_C32(0xfff803b3), SPH_C32(0xf795da54), SPH_C32(0xdd434a78), - SPH_C32(0x1e428b7c), SPH_C32(0xbe1e996a), SPH_C32(0x1e120000), - SPH_C32(0xf06c0000), SPH_C32(0x0d3f0000), SPH_C32(0xe0360121), - SPH_C32(0x9491e781), SPH_C32(0x50373149), SPH_C32(0x8ddb4308), - SPH_C32(0xc8b2bc65) }, - { SPH_C32(0x73d70000), SPH_C32(0xb2460000), SPH_C32(0x490d0000), - SPH_C32(0xb12803a1), SPH_C32(0xe9469527), SPH_C32(0x67e442b1), - SPH_C32(0x495680a3), SPH_C32(0x8eb0259d), SPH_C32(0x41ba0000), - SPH_C32(0xa66f0000), SPH_C32(0x4e910000), SPH_C32(0x84c50132), - SPH_C32(0xb1ef613e), SPH_C32(0x4326a507), SPH_C32(0xd9c5d6b7), - SPH_C32(0x4616670c) }, - { SPH_C32(0x2c7f0000), SPH_C32(0xe4450000), SPH_C32(0x0aa30000), - SPH_C32(0xd5db03b2), SPH_C32(0xcc381398), SPH_C32(0x74f5d6ff), - SPH_C32(0x1d48151c), SPH_C32(0x0014fef4), SPH_C32(0x41fe0000), - SPH_C32(0xd9270000), SPH_C32(0x94ed0000), SPH_C32(0xaee60133), - SPH_C32(0x8a42a8f2), SPH_C32(0xea903980), SPH_C32(0xdacf48d7), - SPH_C32(0xf81c0092) } -}; - -static const sph_u32 T512_60[16][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x033d0000), SPH_C32(0x08b30000), SPH_C32(0xf33a0000), - SPH_C32(0x3ac20007), SPH_C32(0x51298a50), SPH_C32(0x6b6e661f), - SPH_C32(0x0ea5cfe3), SPH_C32(0xe6da7ffe), SPH_C32(0xa8da0000), - SPH_C32(0x96be0000), SPH_C32(0x5c1d0000), SPH_C32(0x07da0002), - SPH_C32(0x7d669583), SPH_C32(0x1f98708a), SPH_C32(0xbb668808), - SPH_C32(0xda878000) }, - { SPH_C32(0xa8da0000), SPH_C32(0x96be0000), SPH_C32(0x5c1d0000), - SPH_C32(0x07da0002), SPH_C32(0x7d669583), SPH_C32(0x1f98708a), - SPH_C32(0xbb668808), SPH_C32(0xda878000), SPH_C32(0xabe70000), - SPH_C32(0x9e0d0000), SPH_C32(0xaf270000), SPH_C32(0x3d180005), - SPH_C32(0x2c4f1fd3), SPH_C32(0x74f61695), SPH_C32(0xb5c347eb), - SPH_C32(0x3c5dfffe) }, - { SPH_C32(0xabe70000), SPH_C32(0x9e0d0000), SPH_C32(0xaf270000), - SPH_C32(0x3d180005), SPH_C32(0x2c4f1fd3), SPH_C32(0x74f61695), - SPH_C32(0xb5c347eb), SPH_C32(0x3c5dfffe), SPH_C32(0x033d0000), - SPH_C32(0x08b30000), SPH_C32(0xf33a0000), SPH_C32(0x3ac20007), - SPH_C32(0x51298a50), SPH_C32(0x6b6e661f), SPH_C32(0x0ea5cfe3), - SPH_C32(0xe6da7ffe) }, - { SPH_C32(0x01930000), SPH_C32(0xe7820000), SPH_C32(0xedfb0000), - SPH_C32(0xcf0c000b), SPH_C32(0x8dd08d58), SPH_C32(0xbca3b42e), - SPH_C32(0x063661e1), SPH_C32(0x536f9e7b), SPH_C32(0x92280000), - SPH_C32(0xdc850000), SPH_C32(0x57fa0000), SPH_C32(0x56dc0003), - SPH_C32(0xbae92316), SPH_C32(0x5aefa30c), SPH_C32(0x90cef752), - SPH_C32(0x7b1675d7) }, - { SPH_C32(0x02ae0000), SPH_C32(0xef310000), SPH_C32(0x1ec10000), - SPH_C32(0xf5ce000c), SPH_C32(0xdcf90708), SPH_C32(0xd7cdd231), - SPH_C32(0x0893ae02), SPH_C32(0xb5b5e185), SPH_C32(0x3af20000), - SPH_C32(0x4a3b0000), SPH_C32(0x0be70000), SPH_C32(0x51060001), - SPH_C32(0xc78fb695), SPH_C32(0x4577d386), SPH_C32(0x2ba87f5a), - SPH_C32(0xa191f5d7) }, - { SPH_C32(0xa9490000), SPH_C32(0x713c0000), SPH_C32(0xb1e60000), - SPH_C32(0xc8d60009), SPH_C32(0xf0b618db), SPH_C32(0xa33bc4a4), - SPH_C32(0xbd50e9e9), SPH_C32(0x89e81e7b), SPH_C32(0x39cf0000), - SPH_C32(0x42880000), SPH_C32(0xf8dd0000), SPH_C32(0x6bc40006), - SPH_C32(0x96a63cc5), SPH_C32(0x2e19b599), SPH_C32(0x250db0b9), - SPH_C32(0x474b8a29) }, - { SPH_C32(0xaa740000), SPH_C32(0x798f0000), SPH_C32(0x42dc0000), - SPH_C32(0xf214000e), SPH_C32(0xa19f928b), SPH_C32(0xc855a2bb), - SPH_C32(0xb3f5260a), SPH_C32(0x6f326185), SPH_C32(0x91150000), - SPH_C32(0xd4360000), SPH_C32(0xa4c00000), SPH_C32(0x6c1e0004), - SPH_C32(0xebc0a946), SPH_C32(0x3181c513), SPH_C32(0x9e6b38b1), - SPH_C32(0x9dcc0a29) }, - { SPH_C32(0x92280000), SPH_C32(0xdc850000), SPH_C32(0x57fa0000), - SPH_C32(0x56dc0003), SPH_C32(0xbae92316), SPH_C32(0x5aefa30c), - SPH_C32(0x90cef752), SPH_C32(0x7b1675d7), SPH_C32(0x93bb0000), - SPH_C32(0x3b070000), SPH_C32(0xba010000), SPH_C32(0x99d00008), - SPH_C32(0x3739ae4e), SPH_C32(0xe64c1722), SPH_C32(0x96f896b3), - SPH_C32(0x2879ebac) }, - { SPH_C32(0x91150000), SPH_C32(0xd4360000), SPH_C32(0xa4c00000), - SPH_C32(0x6c1e0004), SPH_C32(0xebc0a946), SPH_C32(0x3181c513), - SPH_C32(0x9e6b38b1), SPH_C32(0x9dcc0a29), SPH_C32(0x3b610000), - SPH_C32(0xadb90000), SPH_C32(0xe61c0000), SPH_C32(0x9e0a000a), - SPH_C32(0x4a5f3bcd), SPH_C32(0xf9d467a8), SPH_C32(0x2d9e1ebb), - SPH_C32(0xf2fe6bac) }, - { SPH_C32(0x3af20000), SPH_C32(0x4a3b0000), SPH_C32(0x0be70000), - SPH_C32(0x51060001), SPH_C32(0xc78fb695), SPH_C32(0x4577d386), - SPH_C32(0x2ba87f5a), SPH_C32(0xa191f5d7), SPH_C32(0x385c0000), - SPH_C32(0xa50a0000), SPH_C32(0x15260000), SPH_C32(0xa4c8000d), - SPH_C32(0x1b76b19d), SPH_C32(0x92ba01b7), SPH_C32(0x233bd158), - SPH_C32(0x14241452) }, - { SPH_C32(0x39cf0000), SPH_C32(0x42880000), SPH_C32(0xf8dd0000), - SPH_C32(0x6bc40006), SPH_C32(0x96a63cc5), SPH_C32(0x2e19b599), - SPH_C32(0x250db0b9), SPH_C32(0x474b8a29), SPH_C32(0x90860000), - SPH_C32(0x33b40000), SPH_C32(0x493b0000), SPH_C32(0xa312000f), - SPH_C32(0x6610241e), SPH_C32(0x8d22713d), SPH_C32(0x985d5950), - SPH_C32(0xcea39452) }, - { SPH_C32(0x93bb0000), SPH_C32(0x3b070000), SPH_C32(0xba010000), - SPH_C32(0x99d00008), SPH_C32(0x3739ae4e), SPH_C32(0xe64c1722), - SPH_C32(0x96f896b3), SPH_C32(0x2879ebac), SPH_C32(0x01930000), - SPH_C32(0xe7820000), SPH_C32(0xedfb0000), SPH_C32(0xcf0c000b), - SPH_C32(0x8dd08d58), SPH_C32(0xbca3b42e), SPH_C32(0x063661e1), - SPH_C32(0x536f9e7b) }, - { SPH_C32(0x90860000), SPH_C32(0x33b40000), SPH_C32(0x493b0000), - SPH_C32(0xa312000f), SPH_C32(0x6610241e), SPH_C32(0x8d22713d), - SPH_C32(0x985d5950), SPH_C32(0xcea39452), SPH_C32(0xa9490000), - SPH_C32(0x713c0000), SPH_C32(0xb1e60000), SPH_C32(0xc8d60009), - SPH_C32(0xf0b618db), SPH_C32(0xa33bc4a4), SPH_C32(0xbd50e9e9), - SPH_C32(0x89e81e7b) }, - { SPH_C32(0x3b610000), SPH_C32(0xadb90000), SPH_C32(0xe61c0000), - SPH_C32(0x9e0a000a), SPH_C32(0x4a5f3bcd), SPH_C32(0xf9d467a8), - SPH_C32(0x2d9e1ebb), SPH_C32(0xf2fe6bac), SPH_C32(0xaa740000), - SPH_C32(0x798f0000), SPH_C32(0x42dc0000), SPH_C32(0xf214000e), - SPH_C32(0xa19f928b), SPH_C32(0xc855a2bb), SPH_C32(0xb3f5260a), - SPH_C32(0x6f326185) }, - { SPH_C32(0x385c0000), SPH_C32(0xa50a0000), SPH_C32(0x15260000), - SPH_C32(0xa4c8000d), SPH_C32(0x1b76b19d), SPH_C32(0x92ba01b7), - SPH_C32(0x233bd158), SPH_C32(0x14241452), SPH_C32(0x02ae0000), - SPH_C32(0xef310000), SPH_C32(0x1ec10000), SPH_C32(0xf5ce000c), - SPH_C32(0xdcf90708), SPH_C32(0xd7cdd231), SPH_C32(0x0893ae02), - SPH_C32(0xb5b5e185) } -}; - -#define INPUT_BIG do { \ - unsigned acc = buf[0]; \ - const sph_u32 *rp; \ - rp = &T512_0[acc >> 3][0]; \ - m0 = rp[0]; \ - m1 = rp[1]; \ - m2 = rp[2]; \ - m3 = rp[3]; \ - m4 = rp[4]; \ - m5 = rp[5]; \ - m6 = rp[6]; \ - m7 = rp[7]; \ - m8 = rp[8]; \ - m9 = rp[9]; \ - mA = rp[10]; \ - mB = rp[11]; \ - mC = rp[12]; \ - mD = rp[13]; \ - mE = rp[14]; \ - mF = rp[15]; \ - acc = (acc << 8) | buf[1]; \ - rp = &T512_5[(acc >> 6) & 0x1f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_10[(acc >> 1) & 0x1f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = (acc << 8) | buf[2]; \ - rp = &T512_15[(acc >> 4) & 0x1f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = (acc << 8) | buf[3]; \ - rp = &T512_20[(acc >> 7) & 0x1f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_25[(acc >> 2) & 0x1f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = (acc << 8) | buf[4]; \ - rp = &T512_30[(acc >> 5) & 0x1f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_35[acc & 0x1f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[5]; \ - rp = &T512_40[acc >> 3][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = (acc << 8) | buf[6]; \ - rp = &T512_45[(acc >> 6) & 0x1f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_50[(acc >> 1) & 0x1f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = (acc << 8) | buf[7]; \ - rp = &T512_55[(acc >> 4) & 0x1f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_60[acc & 0x0f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - } while (0) - -#endif - -#if SPH_HAMSI_EXPAND_BIG == 6 - -static const sph_u32 T512_0[64][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x145a3c00), SPH_C32(0xb9e90000), SPH_C32(0x61270000), - SPH_C32(0xf1610000), SPH_C32(0xce613d6c), SPH_C32(0xb0493d78), - SPH_C32(0x47a96720), SPH_C32(0xe18e24c5), SPH_C32(0x23671400), - SPH_C32(0xc8b90000), SPH_C32(0xf4c70000), SPH_C32(0xfb750000), - SPH_C32(0x73cd2465), SPH_C32(0xf8a6a549), SPH_C32(0x02c40a3f), - SPH_C32(0xdc24e61f) }, - { SPH_C32(0x23671400), SPH_C32(0xc8b90000), SPH_C32(0xf4c70000), - SPH_C32(0xfb750000), SPH_C32(0x73cd2465), SPH_C32(0xf8a6a549), - SPH_C32(0x02c40a3f), SPH_C32(0xdc24e61f), SPH_C32(0x373d2800), - SPH_C32(0x71500000), SPH_C32(0x95e00000), SPH_C32(0x0a140000), - SPH_C32(0xbdac1909), SPH_C32(0x48ef9831), SPH_C32(0x456d6d1f), - SPH_C32(0x3daac2da) }, - { SPH_C32(0x373d2800), SPH_C32(0x71500000), SPH_C32(0x95e00000), - SPH_C32(0x0a140000), SPH_C32(0xbdac1909), SPH_C32(0x48ef9831), - SPH_C32(0x456d6d1f), SPH_C32(0x3daac2da), SPH_C32(0x145a3c00), - SPH_C32(0xb9e90000), SPH_C32(0x61270000), SPH_C32(0xf1610000), - SPH_C32(0xce613d6c), SPH_C32(0xb0493d78), SPH_C32(0x47a96720), - SPH_C32(0xe18e24c5) }, - { SPH_C32(0x54285c00), SPH_C32(0xeaed0000), SPH_C32(0xc5d60000), - SPH_C32(0xa1c50000), SPH_C32(0xb3a26770), SPH_C32(0x94a5c4e1), - SPH_C32(0x6bb0419d), SPH_C32(0x551b3782), SPH_C32(0x9cbb1800), - SPH_C32(0xb0d30000), SPH_C32(0x92510000), SPH_C32(0xed930000), - SPH_C32(0x593a4345), SPH_C32(0xe114d5f4), SPH_C32(0x430633da), - SPH_C32(0x78cace29) }, - { SPH_C32(0x40726000), SPH_C32(0x53040000), SPH_C32(0xa4f10000), - SPH_C32(0x50a40000), SPH_C32(0x7dc35a1c), SPH_C32(0x24ecf999), - SPH_C32(0x2c1926bd), SPH_C32(0xb4951347), SPH_C32(0xbfdc0c00), - SPH_C32(0x786a0000), SPH_C32(0x66960000), SPH_C32(0x16e60000), - SPH_C32(0x2af76720), SPH_C32(0x19b270bd), SPH_C32(0x41c239e5), - SPH_C32(0xa4ee2836) }, - { SPH_C32(0x774f4800), SPH_C32(0x22540000), SPH_C32(0x31110000), - SPH_C32(0x5ab00000), SPH_C32(0xc06f4315), SPH_C32(0x6c0361a8), - SPH_C32(0x69744ba2), SPH_C32(0x893fd19d), SPH_C32(0xab863000), - SPH_C32(0xc1830000), SPH_C32(0x07b10000), SPH_C32(0xe7870000), - SPH_C32(0xe4965a4c), SPH_C32(0xa9fb4dc5), SPH_C32(0x066b5ec5), - SPH_C32(0x45600cf3) }, - { SPH_C32(0x63157400), SPH_C32(0x9bbd0000), SPH_C32(0x50360000), - SPH_C32(0xabd10000), SPH_C32(0x0e0e7e79), SPH_C32(0xdc4a5cd0), - SPH_C32(0x2edd2c82), SPH_C32(0x68b1f558), SPH_C32(0x88e12400), - SPH_C32(0x093a0000), SPH_C32(0xf3760000), SPH_C32(0x1cf20000), - SPH_C32(0x975b7e29), SPH_C32(0x515de88c), SPH_C32(0x04af54fa), - SPH_C32(0x9944eaec) }, - { SPH_C32(0x9cbb1800), SPH_C32(0xb0d30000), SPH_C32(0x92510000), - SPH_C32(0xed930000), SPH_C32(0x593a4345), SPH_C32(0xe114d5f4), - SPH_C32(0x430633da), SPH_C32(0x78cace29), SPH_C32(0xc8934400), - SPH_C32(0x5a3e0000), SPH_C32(0x57870000), SPH_C32(0x4c560000), - SPH_C32(0xea982435), SPH_C32(0x75b11115), SPH_C32(0x28b67247), - SPH_C32(0x2dd1f9ab) }, - { SPH_C32(0x88e12400), SPH_C32(0x093a0000), SPH_C32(0xf3760000), - SPH_C32(0x1cf20000), SPH_C32(0x975b7e29), SPH_C32(0x515de88c), - SPH_C32(0x04af54fa), SPH_C32(0x9944eaec), SPH_C32(0xebf45000), - SPH_C32(0x92870000), SPH_C32(0xa3400000), SPH_C32(0xb7230000), - SPH_C32(0x99550050), SPH_C32(0x8d17b45c), SPH_C32(0x2a727878), - SPH_C32(0xf1f51fb4) }, - { SPH_C32(0xbfdc0c00), SPH_C32(0x786a0000), SPH_C32(0x66960000), - SPH_C32(0x16e60000), SPH_C32(0x2af76720), SPH_C32(0x19b270bd), - SPH_C32(0x41c239e5), SPH_C32(0xa4ee2836), SPH_C32(0xffae6c00), - SPH_C32(0x2b6e0000), SPH_C32(0xc2670000), SPH_C32(0x46420000), - SPH_C32(0x57343d3c), SPH_C32(0x3d5e8924), SPH_C32(0x6ddb1f58), - SPH_C32(0x107b3b71) }, - { SPH_C32(0xab863000), SPH_C32(0xc1830000), SPH_C32(0x07b10000), - SPH_C32(0xe7870000), SPH_C32(0xe4965a4c), SPH_C32(0xa9fb4dc5), - SPH_C32(0x066b5ec5), SPH_C32(0x45600cf3), SPH_C32(0xdcc97800), - SPH_C32(0xe3d70000), SPH_C32(0x36a00000), SPH_C32(0xbd370000), - SPH_C32(0x24f91959), SPH_C32(0xc5f82c6d), SPH_C32(0x6f1f1567), - SPH_C32(0xcc5fdd6e) }, - { SPH_C32(0xc8934400), SPH_C32(0x5a3e0000), SPH_C32(0x57870000), - SPH_C32(0x4c560000), SPH_C32(0xea982435), SPH_C32(0x75b11115), - SPH_C32(0x28b67247), SPH_C32(0x2dd1f9ab), SPH_C32(0x54285c00), - SPH_C32(0xeaed0000), SPH_C32(0xc5d60000), SPH_C32(0xa1c50000), - SPH_C32(0xb3a26770), SPH_C32(0x94a5c4e1), SPH_C32(0x6bb0419d), - SPH_C32(0x551b3782) }, - { SPH_C32(0xdcc97800), SPH_C32(0xe3d70000), SPH_C32(0x36a00000), - SPH_C32(0xbd370000), SPH_C32(0x24f91959), SPH_C32(0xc5f82c6d), - SPH_C32(0x6f1f1567), SPH_C32(0xcc5fdd6e), SPH_C32(0x774f4800), - SPH_C32(0x22540000), SPH_C32(0x31110000), SPH_C32(0x5ab00000), - SPH_C32(0xc06f4315), SPH_C32(0x6c0361a8), SPH_C32(0x69744ba2), - SPH_C32(0x893fd19d) }, - { SPH_C32(0xebf45000), SPH_C32(0x92870000), SPH_C32(0xa3400000), - SPH_C32(0xb7230000), SPH_C32(0x99550050), SPH_C32(0x8d17b45c), - SPH_C32(0x2a727878), SPH_C32(0xf1f51fb4), SPH_C32(0x63157400), - SPH_C32(0x9bbd0000), SPH_C32(0x50360000), SPH_C32(0xabd10000), - SPH_C32(0x0e0e7e79), SPH_C32(0xdc4a5cd0), SPH_C32(0x2edd2c82), - SPH_C32(0x68b1f558) }, - { SPH_C32(0xffae6c00), SPH_C32(0x2b6e0000), SPH_C32(0xc2670000), - SPH_C32(0x46420000), SPH_C32(0x57343d3c), SPH_C32(0x3d5e8924), - SPH_C32(0x6ddb1f58), SPH_C32(0x107b3b71), SPH_C32(0x40726000), - SPH_C32(0x53040000), SPH_C32(0xa4f10000), SPH_C32(0x50a40000), - SPH_C32(0x7dc35a1c), SPH_C32(0x24ecf999), SPH_C32(0x2c1926bd), - SPH_C32(0xb4951347) }, - { SPH_C32(0x29449c00), SPH_C32(0x64e70000), SPH_C32(0xf24b0000), - SPH_C32(0xc2f30000), SPH_C32(0x0ede4e8f), SPH_C32(0x56c23745), - SPH_C32(0xf3e04259), SPH_C32(0x8d0d9ec4), SPH_C32(0x466d0c00), - SPH_C32(0x08620000), SPH_C32(0xdd5d0000), SPH_C32(0xbadd0000), - SPH_C32(0x6a927942), SPH_C32(0x441f2b93), SPH_C32(0x218ace6f), - SPH_C32(0xbf2c0be2) }, - { SPH_C32(0x3d1ea000), SPH_C32(0xdd0e0000), SPH_C32(0x936c0000), - SPH_C32(0x33920000), SPH_C32(0xc0bf73e3), SPH_C32(0xe68b0a3d), - SPH_C32(0xb4492579), SPH_C32(0x6c83ba01), SPH_C32(0x650a1800), - SPH_C32(0xc0db0000), SPH_C32(0x299a0000), SPH_C32(0x41a80000), - SPH_C32(0x195f5d27), SPH_C32(0xbcb98eda), SPH_C32(0x234ec450), - SPH_C32(0x6308edfd) }, - { SPH_C32(0x0a238800), SPH_C32(0xac5e0000), SPH_C32(0x068c0000), - SPH_C32(0x39860000), SPH_C32(0x7d136aea), SPH_C32(0xae64920c), - SPH_C32(0xf1244866), SPH_C32(0x512978db), SPH_C32(0x71502400), - SPH_C32(0x79320000), SPH_C32(0x48bd0000), SPH_C32(0xb0c90000), - SPH_C32(0xd73e604b), SPH_C32(0x0cf0b3a2), SPH_C32(0x64e7a370), - SPH_C32(0x8286c938) }, - { SPH_C32(0x1e79b400), SPH_C32(0x15b70000), SPH_C32(0x67ab0000), - SPH_C32(0xc8e70000), SPH_C32(0xb3725786), SPH_C32(0x1e2daf74), - SPH_C32(0xb68d2f46), SPH_C32(0xb0a75c1e), SPH_C32(0x52373000), - SPH_C32(0xb18b0000), SPH_C32(0xbc7a0000), SPH_C32(0x4bbc0000), - SPH_C32(0xa4f3442e), SPH_C32(0xf45616eb), SPH_C32(0x6623a94f), - SPH_C32(0x5ea22f27) }, - { SPH_C32(0x7d6cc000), SPH_C32(0x8e0a0000), SPH_C32(0x379d0000), - SPH_C32(0x63360000), SPH_C32(0xbd7c29ff), SPH_C32(0xc267f3a4), - SPH_C32(0x985003c4), SPH_C32(0xd816a946), SPH_C32(0xdad61400), - SPH_C32(0xb8b10000), SPH_C32(0x4f0c0000), SPH_C32(0x574e0000), - SPH_C32(0x33a83a07), SPH_C32(0xa50bfe67), SPH_C32(0x628cfdb5), - SPH_C32(0xc7e6c5cb) }, - { SPH_C32(0x6936fc00), SPH_C32(0x37e30000), SPH_C32(0x56ba0000), - SPH_C32(0x92570000), SPH_C32(0x731d1493), SPH_C32(0x722ecedc), - SPH_C32(0xdff964e4), SPH_C32(0x39988d83), SPH_C32(0xf9b10000), - SPH_C32(0x70080000), SPH_C32(0xbbcb0000), SPH_C32(0xac3b0000), - SPH_C32(0x40651e62), SPH_C32(0x5dad5b2e), SPH_C32(0x6048f78a), - SPH_C32(0x1bc223d4) }, - { SPH_C32(0x5e0bd400), SPH_C32(0x46b30000), SPH_C32(0xc35a0000), - SPH_C32(0x98430000), SPH_C32(0xceb10d9a), SPH_C32(0x3ac156ed), - SPH_C32(0x9a9409fb), SPH_C32(0x04324f59), SPH_C32(0xedeb3c00), - SPH_C32(0xc9e10000), SPH_C32(0xdaec0000), SPH_C32(0x5d5a0000), - SPH_C32(0x8e04230e), SPH_C32(0xede46656), SPH_C32(0x27e190aa), - SPH_C32(0xfa4c0711) }, - { SPH_C32(0x4a51e800), SPH_C32(0xff5a0000), SPH_C32(0xa27d0000), - SPH_C32(0x69220000), SPH_C32(0x00d030f6), SPH_C32(0x8a886b95), - SPH_C32(0xdd3d6edb), SPH_C32(0xe5bc6b9c), SPH_C32(0xce8c2800), - SPH_C32(0x01580000), SPH_C32(0x2e2b0000), SPH_C32(0xa62f0000), - SPH_C32(0xfdc9076b), SPH_C32(0x1542c31f), SPH_C32(0x25259a95), - SPH_C32(0x2668e10e) }, - { SPH_C32(0xb5ff8400), SPH_C32(0xd4340000), SPH_C32(0x601a0000), - SPH_C32(0x2f600000), SPH_C32(0x57e40dca), SPH_C32(0xb7d6e2b1), - SPH_C32(0xb0e67183), SPH_C32(0xf5c750ed), SPH_C32(0x8efe4800), - SPH_C32(0x525c0000), SPH_C32(0x8ada0000), SPH_C32(0xf68b0000), - SPH_C32(0x800a5d77), SPH_C32(0x31ae3a86), SPH_C32(0x093cbc28), - SPH_C32(0x92fdf249) }, - { SPH_C32(0xa1a5b800), SPH_C32(0x6ddd0000), SPH_C32(0x013d0000), - SPH_C32(0xde010000), SPH_C32(0x998530a6), SPH_C32(0x079fdfc9), - SPH_C32(0xf74f16a3), SPH_C32(0x14497428), SPH_C32(0xad995c00), - SPH_C32(0x9ae50000), SPH_C32(0x7e1d0000), SPH_C32(0x0dfe0000), - SPH_C32(0xf3c77912), SPH_C32(0xc9089fcf), SPH_C32(0x0bf8b617), - SPH_C32(0x4ed91456) }, - { SPH_C32(0x96989000), SPH_C32(0x1c8d0000), SPH_C32(0x94dd0000), - SPH_C32(0xd4150000), SPH_C32(0x242929af), SPH_C32(0x4f7047f8), - SPH_C32(0xb2227bbc), SPH_C32(0x29e3b6f2), SPH_C32(0xb9c36000), - SPH_C32(0x230c0000), SPH_C32(0x1f3a0000), SPH_C32(0xfc9f0000), - SPH_C32(0x3da6447e), SPH_C32(0x7941a2b7), SPH_C32(0x4c51d137), - SPH_C32(0xaf573093) }, - { SPH_C32(0x82c2ac00), SPH_C32(0xa5640000), SPH_C32(0xf5fa0000), - SPH_C32(0x25740000), SPH_C32(0xea4814c3), SPH_C32(0xff397a80), - SPH_C32(0xf58b1c9c), SPH_C32(0xc86d9237), SPH_C32(0x9aa47400), - SPH_C32(0xebb50000), SPH_C32(0xebfd0000), SPH_C32(0x07ea0000), - SPH_C32(0x4e6b601b), SPH_C32(0x81e707fe), SPH_C32(0x4e95db08), - SPH_C32(0x7373d68c) }, - { SPH_C32(0xe1d7d800), SPH_C32(0x3ed90000), SPH_C32(0xa5cc0000), - SPH_C32(0x8ea50000), SPH_C32(0xe4466aba), SPH_C32(0x23732650), - SPH_C32(0xdb56301e), SPH_C32(0xa0dc676f), SPH_C32(0x12455000), - SPH_C32(0xe28f0000), SPH_C32(0x188b0000), SPH_C32(0x1b180000), - SPH_C32(0xd9301e32), SPH_C32(0xd0baef72), SPH_C32(0x4a3a8ff2), - SPH_C32(0xea373c60) }, - { SPH_C32(0xf58de400), SPH_C32(0x87300000), SPH_C32(0xc4eb0000), - SPH_C32(0x7fc40000), SPH_C32(0x2a2757d6), SPH_C32(0x933a1b28), - SPH_C32(0x9cff573e), SPH_C32(0x415243aa), SPH_C32(0x31224400), - SPH_C32(0x2a360000), SPH_C32(0xec4c0000), SPH_C32(0xe06d0000), - SPH_C32(0xaafd3a57), SPH_C32(0x281c4a3b), SPH_C32(0x48fe85cd), - SPH_C32(0x3613da7f) }, - { SPH_C32(0xc2b0cc00), SPH_C32(0xf6600000), SPH_C32(0x510b0000), - SPH_C32(0x75d00000), SPH_C32(0x978b4edf), SPH_C32(0xdbd58319), - SPH_C32(0xd9923a21), SPH_C32(0x7cf88170), SPH_C32(0x25787800), - SPH_C32(0x93df0000), SPH_C32(0x8d6b0000), SPH_C32(0x110c0000), - SPH_C32(0x649c073b), SPH_C32(0x98557743), SPH_C32(0x0f57e2ed), - SPH_C32(0xd79dfeba) }, - { SPH_C32(0xd6eaf000), SPH_C32(0x4f890000), SPH_C32(0x302c0000), - SPH_C32(0x84b10000), SPH_C32(0x59ea73b3), SPH_C32(0x6b9cbe61), - SPH_C32(0x9e3b5d01), SPH_C32(0x9d76a5b5), SPH_C32(0x061f6c00), - SPH_C32(0x5b660000), SPH_C32(0x79ac0000), SPH_C32(0xea790000), - SPH_C32(0x1751235e), SPH_C32(0x60f3d20a), SPH_C32(0x0d93e8d2), - SPH_C32(0x0bb918a5) }, - { SPH_C32(0x466d0c00), SPH_C32(0x08620000), SPH_C32(0xdd5d0000), - SPH_C32(0xbadd0000), SPH_C32(0x6a927942), SPH_C32(0x441f2b93), - SPH_C32(0x218ace6f), SPH_C32(0xbf2c0be2), SPH_C32(0x6f299000), - SPH_C32(0x6c850000), SPH_C32(0x2f160000), SPH_C32(0x782e0000), - SPH_C32(0x644c37cd), SPH_C32(0x12dd1cd6), SPH_C32(0xd26a8c36), - SPH_C32(0x32219526) }, - { SPH_C32(0x52373000), SPH_C32(0xb18b0000), SPH_C32(0xbc7a0000), - SPH_C32(0x4bbc0000), SPH_C32(0xa4f3442e), SPH_C32(0xf45616eb), - SPH_C32(0x6623a94f), SPH_C32(0x5ea22f27), SPH_C32(0x4c4e8400), - SPH_C32(0xa43c0000), SPH_C32(0xdbd10000), SPH_C32(0x835b0000), - SPH_C32(0x178113a8), SPH_C32(0xea7bb99f), SPH_C32(0xd0ae8609), - SPH_C32(0xee057339) }, - { SPH_C32(0x650a1800), SPH_C32(0xc0db0000), SPH_C32(0x299a0000), - SPH_C32(0x41a80000), SPH_C32(0x195f5d27), SPH_C32(0xbcb98eda), - SPH_C32(0x234ec450), SPH_C32(0x6308edfd), SPH_C32(0x5814b800), - SPH_C32(0x1dd50000), SPH_C32(0xbaf60000), SPH_C32(0x723a0000), - SPH_C32(0xd9e02ec4), SPH_C32(0x5a3284e7), SPH_C32(0x9707e129), - SPH_C32(0x0f8b57fc) }, - { SPH_C32(0x71502400), SPH_C32(0x79320000), SPH_C32(0x48bd0000), - SPH_C32(0xb0c90000), SPH_C32(0xd73e604b), SPH_C32(0x0cf0b3a2), - SPH_C32(0x64e7a370), SPH_C32(0x8286c938), SPH_C32(0x7b73ac00), - SPH_C32(0xd56c0000), SPH_C32(0x4e310000), SPH_C32(0x894f0000), - SPH_C32(0xaa2d0aa1), SPH_C32(0xa29421ae), SPH_C32(0x95c3eb16), - SPH_C32(0xd3afb1e3) }, - { SPH_C32(0x12455000), SPH_C32(0xe28f0000), SPH_C32(0x188b0000), - SPH_C32(0x1b180000), SPH_C32(0xd9301e32), SPH_C32(0xd0baef72), - SPH_C32(0x4a3a8ff2), SPH_C32(0xea373c60), SPH_C32(0xf3928800), - SPH_C32(0xdc560000), SPH_C32(0xbd470000), SPH_C32(0x95bd0000), - SPH_C32(0x3d767488), SPH_C32(0xf3c9c922), SPH_C32(0x916cbfec), - SPH_C32(0x4aeb5b0f) }, - { SPH_C32(0x061f6c00), SPH_C32(0x5b660000), SPH_C32(0x79ac0000), - SPH_C32(0xea790000), SPH_C32(0x1751235e), SPH_C32(0x60f3d20a), - SPH_C32(0x0d93e8d2), SPH_C32(0x0bb918a5), SPH_C32(0xd0f59c00), - SPH_C32(0x14ef0000), SPH_C32(0x49800000), SPH_C32(0x6ec80000), - SPH_C32(0x4ebb50ed), SPH_C32(0x0b6f6c6b), SPH_C32(0x93a8b5d3), - SPH_C32(0x96cfbd10) }, - { SPH_C32(0x31224400), SPH_C32(0x2a360000), SPH_C32(0xec4c0000), - SPH_C32(0xe06d0000), SPH_C32(0xaafd3a57), SPH_C32(0x281c4a3b), - SPH_C32(0x48fe85cd), SPH_C32(0x3613da7f), SPH_C32(0xc4afa000), - SPH_C32(0xad060000), SPH_C32(0x28a70000), SPH_C32(0x9fa90000), - SPH_C32(0x80da6d81), SPH_C32(0xbb265113), SPH_C32(0xd401d2f3), - SPH_C32(0x774199d5) }, - { SPH_C32(0x25787800), SPH_C32(0x93df0000), SPH_C32(0x8d6b0000), - SPH_C32(0x110c0000), SPH_C32(0x649c073b), SPH_C32(0x98557743), - SPH_C32(0x0f57e2ed), SPH_C32(0xd79dfeba), SPH_C32(0xe7c8b400), - SPH_C32(0x65bf0000), SPH_C32(0xdc600000), SPH_C32(0x64dc0000), - SPH_C32(0xf31749e4), SPH_C32(0x4380f45a), SPH_C32(0xd6c5d8cc), - SPH_C32(0xab657fca) }, - { SPH_C32(0xdad61400), SPH_C32(0xb8b10000), SPH_C32(0x4f0c0000), - SPH_C32(0x574e0000), SPH_C32(0x33a83a07), SPH_C32(0xa50bfe67), - SPH_C32(0x628cfdb5), SPH_C32(0xc7e6c5cb), SPH_C32(0xa7bad400), - SPH_C32(0x36bb0000), SPH_C32(0x78910000), SPH_C32(0x34780000), - SPH_C32(0x8ed413f8), SPH_C32(0x676c0dc3), SPH_C32(0xfadcfe71), - SPH_C32(0x1ff06c8d) }, - { SPH_C32(0xce8c2800), SPH_C32(0x01580000), SPH_C32(0x2e2b0000), - SPH_C32(0xa62f0000), SPH_C32(0xfdc9076b), SPH_C32(0x1542c31f), - SPH_C32(0x25259a95), SPH_C32(0x2668e10e), SPH_C32(0x84ddc000), - SPH_C32(0xfe020000), SPH_C32(0x8c560000), SPH_C32(0xcf0d0000), - SPH_C32(0xfd19379d), SPH_C32(0x9fcaa88a), SPH_C32(0xf818f44e), - SPH_C32(0xc3d48a92) }, - { SPH_C32(0xf9b10000), SPH_C32(0x70080000), SPH_C32(0xbbcb0000), - SPH_C32(0xac3b0000), SPH_C32(0x40651e62), SPH_C32(0x5dad5b2e), - SPH_C32(0x6048f78a), SPH_C32(0x1bc223d4), SPH_C32(0x9087fc00), - SPH_C32(0x47eb0000), SPH_C32(0xed710000), SPH_C32(0x3e6c0000), - SPH_C32(0x33780af1), SPH_C32(0x2f8395f2), SPH_C32(0xbfb1936e), - SPH_C32(0x225aae57) }, - { SPH_C32(0xedeb3c00), SPH_C32(0xc9e10000), SPH_C32(0xdaec0000), - SPH_C32(0x5d5a0000), SPH_C32(0x8e04230e), SPH_C32(0xede46656), - SPH_C32(0x27e190aa), SPH_C32(0xfa4c0711), SPH_C32(0xb3e0e800), - SPH_C32(0x8f520000), SPH_C32(0x19b60000), SPH_C32(0xc5190000), - SPH_C32(0x40b52e94), SPH_C32(0xd72530bb), SPH_C32(0xbd759951), - SPH_C32(0xfe7e4848) }, - { SPH_C32(0x8efe4800), SPH_C32(0x525c0000), SPH_C32(0x8ada0000), - SPH_C32(0xf68b0000), SPH_C32(0x800a5d77), SPH_C32(0x31ae3a86), - SPH_C32(0x093cbc28), SPH_C32(0x92fdf249), SPH_C32(0x3b01cc00), - SPH_C32(0x86680000), SPH_C32(0xeac00000), SPH_C32(0xd9eb0000), - SPH_C32(0xd7ee50bd), SPH_C32(0x8678d837), SPH_C32(0xb9dacdab), - SPH_C32(0x673aa2a4) }, - { SPH_C32(0x9aa47400), SPH_C32(0xebb50000), SPH_C32(0xebfd0000), - SPH_C32(0x07ea0000), SPH_C32(0x4e6b601b), SPH_C32(0x81e707fe), - SPH_C32(0x4e95db08), SPH_C32(0x7373d68c), SPH_C32(0x1866d800), - SPH_C32(0x4ed10000), SPH_C32(0x1e070000), SPH_C32(0x229e0000), - SPH_C32(0xa42374d8), SPH_C32(0x7ede7d7e), SPH_C32(0xbb1ec794), - SPH_C32(0xbb1e44bb) }, - { SPH_C32(0xad995c00), SPH_C32(0x9ae50000), SPH_C32(0x7e1d0000), - SPH_C32(0x0dfe0000), SPH_C32(0xf3c77912), SPH_C32(0xc9089fcf), - SPH_C32(0x0bf8b617), SPH_C32(0x4ed91456), SPH_C32(0x0c3ce400), - SPH_C32(0xf7380000), SPH_C32(0x7f200000), SPH_C32(0xd3ff0000), - SPH_C32(0x6a4249b4), SPH_C32(0xce974006), SPH_C32(0xfcb7a0b4), - SPH_C32(0x5a90607e) }, - { SPH_C32(0xb9c36000), SPH_C32(0x230c0000), SPH_C32(0x1f3a0000), - SPH_C32(0xfc9f0000), SPH_C32(0x3da6447e), SPH_C32(0x7941a2b7), - SPH_C32(0x4c51d137), SPH_C32(0xaf573093), SPH_C32(0x2f5bf000), - SPH_C32(0x3f810000), SPH_C32(0x8be70000), SPH_C32(0x288a0000), - SPH_C32(0x198f6dd1), SPH_C32(0x3631e54f), SPH_C32(0xfe73aa8b), - SPH_C32(0x86b48661) }, - { SPH_C32(0x6f299000), SPH_C32(0x6c850000), SPH_C32(0x2f160000), - SPH_C32(0x782e0000), SPH_C32(0x644c37cd), SPH_C32(0x12dd1cd6), - SPH_C32(0xd26a8c36), SPH_C32(0x32219526), SPH_C32(0x29449c00), - SPH_C32(0x64e70000), SPH_C32(0xf24b0000), SPH_C32(0xc2f30000), - SPH_C32(0x0ede4e8f), SPH_C32(0x56c23745), SPH_C32(0xf3e04259), - SPH_C32(0x8d0d9ec4) }, - { SPH_C32(0x7b73ac00), SPH_C32(0xd56c0000), SPH_C32(0x4e310000), - SPH_C32(0x894f0000), SPH_C32(0xaa2d0aa1), SPH_C32(0xa29421ae), - SPH_C32(0x95c3eb16), SPH_C32(0xd3afb1e3), SPH_C32(0x0a238800), - SPH_C32(0xac5e0000), SPH_C32(0x068c0000), SPH_C32(0x39860000), - SPH_C32(0x7d136aea), SPH_C32(0xae64920c), SPH_C32(0xf1244866), - SPH_C32(0x512978db) }, - { SPH_C32(0x4c4e8400), SPH_C32(0xa43c0000), SPH_C32(0xdbd10000), - SPH_C32(0x835b0000), SPH_C32(0x178113a8), SPH_C32(0xea7bb99f), - SPH_C32(0xd0ae8609), SPH_C32(0xee057339), SPH_C32(0x1e79b400), - SPH_C32(0x15b70000), SPH_C32(0x67ab0000), SPH_C32(0xc8e70000), - SPH_C32(0xb3725786), SPH_C32(0x1e2daf74), SPH_C32(0xb68d2f46), - SPH_C32(0xb0a75c1e) }, - { SPH_C32(0x5814b800), SPH_C32(0x1dd50000), SPH_C32(0xbaf60000), - SPH_C32(0x723a0000), SPH_C32(0xd9e02ec4), SPH_C32(0x5a3284e7), - SPH_C32(0x9707e129), SPH_C32(0x0f8b57fc), SPH_C32(0x3d1ea000), - SPH_C32(0xdd0e0000), SPH_C32(0x936c0000), SPH_C32(0x33920000), - SPH_C32(0xc0bf73e3), SPH_C32(0xe68b0a3d), SPH_C32(0xb4492579), - SPH_C32(0x6c83ba01) }, - { SPH_C32(0x3b01cc00), SPH_C32(0x86680000), SPH_C32(0xeac00000), - SPH_C32(0xd9eb0000), SPH_C32(0xd7ee50bd), SPH_C32(0x8678d837), - SPH_C32(0xb9dacdab), SPH_C32(0x673aa2a4), SPH_C32(0xb5ff8400), - SPH_C32(0xd4340000), SPH_C32(0x601a0000), SPH_C32(0x2f600000), - SPH_C32(0x57e40dca), SPH_C32(0xb7d6e2b1), SPH_C32(0xb0e67183), - SPH_C32(0xf5c750ed) }, - { SPH_C32(0x2f5bf000), SPH_C32(0x3f810000), SPH_C32(0x8be70000), - SPH_C32(0x288a0000), SPH_C32(0x198f6dd1), SPH_C32(0x3631e54f), - SPH_C32(0xfe73aa8b), SPH_C32(0x86b48661), SPH_C32(0x96989000), - SPH_C32(0x1c8d0000), SPH_C32(0x94dd0000), SPH_C32(0xd4150000), - SPH_C32(0x242929af), SPH_C32(0x4f7047f8), SPH_C32(0xb2227bbc), - SPH_C32(0x29e3b6f2) }, - { SPH_C32(0x1866d800), SPH_C32(0x4ed10000), SPH_C32(0x1e070000), - SPH_C32(0x229e0000), SPH_C32(0xa42374d8), SPH_C32(0x7ede7d7e), - SPH_C32(0xbb1ec794), SPH_C32(0xbb1e44bb), SPH_C32(0x82c2ac00), - SPH_C32(0xa5640000), SPH_C32(0xf5fa0000), SPH_C32(0x25740000), - SPH_C32(0xea4814c3), SPH_C32(0xff397a80), SPH_C32(0xf58b1c9c), - SPH_C32(0xc86d9237) }, - { SPH_C32(0x0c3ce400), SPH_C32(0xf7380000), SPH_C32(0x7f200000), - SPH_C32(0xd3ff0000), SPH_C32(0x6a4249b4), SPH_C32(0xce974006), - SPH_C32(0xfcb7a0b4), SPH_C32(0x5a90607e), SPH_C32(0xa1a5b800), - SPH_C32(0x6ddd0000), SPH_C32(0x013d0000), SPH_C32(0xde010000), - SPH_C32(0x998530a6), SPH_C32(0x079fdfc9), SPH_C32(0xf74f16a3), - SPH_C32(0x14497428) }, - { SPH_C32(0xf3928800), SPH_C32(0xdc560000), SPH_C32(0xbd470000), - SPH_C32(0x95bd0000), SPH_C32(0x3d767488), SPH_C32(0xf3c9c922), - SPH_C32(0x916cbfec), SPH_C32(0x4aeb5b0f), SPH_C32(0xe1d7d800), - SPH_C32(0x3ed90000), SPH_C32(0xa5cc0000), SPH_C32(0x8ea50000), - SPH_C32(0xe4466aba), SPH_C32(0x23732650), SPH_C32(0xdb56301e), - SPH_C32(0xa0dc676f) }, - { SPH_C32(0xe7c8b400), SPH_C32(0x65bf0000), SPH_C32(0xdc600000), - SPH_C32(0x64dc0000), SPH_C32(0xf31749e4), SPH_C32(0x4380f45a), - SPH_C32(0xd6c5d8cc), SPH_C32(0xab657fca), SPH_C32(0xc2b0cc00), - SPH_C32(0xf6600000), SPH_C32(0x510b0000), SPH_C32(0x75d00000), - SPH_C32(0x978b4edf), SPH_C32(0xdbd58319), SPH_C32(0xd9923a21), - SPH_C32(0x7cf88170) }, - { SPH_C32(0xd0f59c00), SPH_C32(0x14ef0000), SPH_C32(0x49800000), - SPH_C32(0x6ec80000), SPH_C32(0x4ebb50ed), SPH_C32(0x0b6f6c6b), - SPH_C32(0x93a8b5d3), SPH_C32(0x96cfbd10), SPH_C32(0xd6eaf000), - SPH_C32(0x4f890000), SPH_C32(0x302c0000), SPH_C32(0x84b10000), - SPH_C32(0x59ea73b3), SPH_C32(0x6b9cbe61), SPH_C32(0x9e3b5d01), - SPH_C32(0x9d76a5b5) }, - { SPH_C32(0xc4afa000), SPH_C32(0xad060000), SPH_C32(0x28a70000), - SPH_C32(0x9fa90000), SPH_C32(0x80da6d81), SPH_C32(0xbb265113), - SPH_C32(0xd401d2f3), SPH_C32(0x774199d5), SPH_C32(0xf58de400), - SPH_C32(0x87300000), SPH_C32(0xc4eb0000), SPH_C32(0x7fc40000), - SPH_C32(0x2a2757d6), SPH_C32(0x933a1b28), SPH_C32(0x9cff573e), - SPH_C32(0x415243aa) }, - { SPH_C32(0xa7bad400), SPH_C32(0x36bb0000), SPH_C32(0x78910000), - SPH_C32(0x34780000), SPH_C32(0x8ed413f8), SPH_C32(0x676c0dc3), - SPH_C32(0xfadcfe71), SPH_C32(0x1ff06c8d), SPH_C32(0x7d6cc000), - SPH_C32(0x8e0a0000), SPH_C32(0x379d0000), SPH_C32(0x63360000), - SPH_C32(0xbd7c29ff), SPH_C32(0xc267f3a4), SPH_C32(0x985003c4), - SPH_C32(0xd816a946) }, - { SPH_C32(0xb3e0e800), SPH_C32(0x8f520000), SPH_C32(0x19b60000), - SPH_C32(0xc5190000), SPH_C32(0x40b52e94), SPH_C32(0xd72530bb), - SPH_C32(0xbd759951), SPH_C32(0xfe7e4848), SPH_C32(0x5e0bd400), - SPH_C32(0x46b30000), SPH_C32(0xc35a0000), SPH_C32(0x98430000), - SPH_C32(0xceb10d9a), SPH_C32(0x3ac156ed), SPH_C32(0x9a9409fb), - SPH_C32(0x04324f59) }, - { SPH_C32(0x84ddc000), SPH_C32(0xfe020000), SPH_C32(0x8c560000), - SPH_C32(0xcf0d0000), SPH_C32(0xfd19379d), SPH_C32(0x9fcaa88a), - SPH_C32(0xf818f44e), SPH_C32(0xc3d48a92), SPH_C32(0x4a51e800), - SPH_C32(0xff5a0000), SPH_C32(0xa27d0000), SPH_C32(0x69220000), - SPH_C32(0x00d030f6), SPH_C32(0x8a886b95), SPH_C32(0xdd3d6edb), - SPH_C32(0xe5bc6b9c) }, - { SPH_C32(0x9087fc00), SPH_C32(0x47eb0000), SPH_C32(0xed710000), - SPH_C32(0x3e6c0000), SPH_C32(0x33780af1), SPH_C32(0x2f8395f2), - SPH_C32(0xbfb1936e), SPH_C32(0x225aae57), SPH_C32(0x6936fc00), - SPH_C32(0x37e30000), SPH_C32(0x56ba0000), SPH_C32(0x92570000), - SPH_C32(0x731d1493), SPH_C32(0x722ecedc), SPH_C32(0xdff964e4), - SPH_C32(0x39988d83) } -}; - -static const sph_u32 T512_6[64][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x774400f0), SPH_C32(0xf15a0000), SPH_C32(0xf5b20000), - SPH_C32(0x34140000), SPH_C32(0x89377e8c), SPH_C32(0x5a8bec25), - SPH_C32(0x0bc3cd1e), SPH_C32(0xcf3775cb), SPH_C32(0xf46c0050), - SPH_C32(0x96180000), SPH_C32(0x14a50000), SPH_C32(0x031f0000), - SPH_C32(0x42947eb8), SPH_C32(0x66bf7e19), SPH_C32(0x9ca470d2), - SPH_C32(0x8a341574) }, - { SPH_C32(0xf46c0050), SPH_C32(0x96180000), SPH_C32(0x14a50000), - SPH_C32(0x031f0000), SPH_C32(0x42947eb8), SPH_C32(0x66bf7e19), - SPH_C32(0x9ca470d2), SPH_C32(0x8a341574), SPH_C32(0x832800a0), - SPH_C32(0x67420000), SPH_C32(0xe1170000), SPH_C32(0x370b0000), - SPH_C32(0xcba30034), SPH_C32(0x3c34923c), SPH_C32(0x9767bdcc), - SPH_C32(0x450360bf) }, - { SPH_C32(0x832800a0), SPH_C32(0x67420000), SPH_C32(0xe1170000), - SPH_C32(0x370b0000), SPH_C32(0xcba30034), SPH_C32(0x3c34923c), - SPH_C32(0x9767bdcc), SPH_C32(0x450360bf), SPH_C32(0x774400f0), - SPH_C32(0xf15a0000), SPH_C32(0xf5b20000), SPH_C32(0x34140000), - SPH_C32(0x89377e8c), SPH_C32(0x5a8bec25), SPH_C32(0x0bc3cd1e), - SPH_C32(0xcf3775cb) }, - { SPH_C32(0xe8870170), SPH_C32(0x9d720000), SPH_C32(0x12db0000), - SPH_C32(0xd4220000), SPH_C32(0xf2886b27), SPH_C32(0xa921e543), - SPH_C32(0x4ef8b518), SPH_C32(0x618813b1), SPH_C32(0xb4370060), - SPH_C32(0x0c4c0000), SPH_C32(0x56c20000), SPH_C32(0x5cae0000), - SPH_C32(0x94541f3f), SPH_C32(0x3b3ef825), SPH_C32(0x1b365f3d), - SPH_C32(0xf3d45758) }, - { SPH_C32(0x9fc30180), SPH_C32(0x6c280000), SPH_C32(0xe7690000), - SPH_C32(0xe0360000), SPH_C32(0x7bbf15ab), SPH_C32(0xf3aa0966), - SPH_C32(0x453b7806), SPH_C32(0xaebf667a), SPH_C32(0x405b0030), - SPH_C32(0x9a540000), SPH_C32(0x42670000), SPH_C32(0x5fb10000), - SPH_C32(0xd6c06187), SPH_C32(0x5d81863c), SPH_C32(0x87922fef), - SPH_C32(0x79e0422c) }, - { SPH_C32(0x1ceb0120), SPH_C32(0x0b6a0000), SPH_C32(0x067e0000), - SPH_C32(0xd73d0000), SPH_C32(0xb01c159f), SPH_C32(0xcf9e9b5a), - SPH_C32(0xd25cc5ca), SPH_C32(0xebbc06c5), SPH_C32(0x371f00c0), - SPH_C32(0x6b0e0000), SPH_C32(0xb7d50000), SPH_C32(0x6ba50000), - SPH_C32(0x5ff71f0b), SPH_C32(0x070a6a19), SPH_C32(0x8c51e2f1), - SPH_C32(0xb6d737e7) }, - { SPH_C32(0x6baf01d0), SPH_C32(0xfa300000), SPH_C32(0xf3cc0000), - SPH_C32(0xe3290000), SPH_C32(0x392b6b13), SPH_C32(0x9515777f), - SPH_C32(0xd99f08d4), SPH_C32(0x248b730e), SPH_C32(0xc3730090), - SPH_C32(0xfd160000), SPH_C32(0xa3700000), SPH_C32(0x68ba0000), - SPH_C32(0x1d6361b3), SPH_C32(0x61b51400), SPH_C32(0x10f59223), - SPH_C32(0x3ce32293) }, - { SPH_C32(0xb4370060), SPH_C32(0x0c4c0000), SPH_C32(0x56c20000), - SPH_C32(0x5cae0000), SPH_C32(0x94541f3f), SPH_C32(0x3b3ef825), - SPH_C32(0x1b365f3d), SPH_C32(0xf3d45758), SPH_C32(0x5cb00110), - SPH_C32(0x913e0000), SPH_C32(0x44190000), SPH_C32(0x888c0000), - SPH_C32(0x66dc7418), SPH_C32(0x921f1d66), SPH_C32(0x55ceea25), - SPH_C32(0x925c44e9) }, - { SPH_C32(0xc3730090), SPH_C32(0xfd160000), SPH_C32(0xa3700000), - SPH_C32(0x68ba0000), SPH_C32(0x1d6361b3), SPH_C32(0x61b51400), - SPH_C32(0x10f59223), SPH_C32(0x3ce32293), SPH_C32(0xa8dc0140), - SPH_C32(0x07260000), SPH_C32(0x50bc0000), SPH_C32(0x8b930000), - SPH_C32(0x24480aa0), SPH_C32(0xf4a0637f), SPH_C32(0xc96a9af7), - SPH_C32(0x1868519d) }, - { SPH_C32(0x405b0030), SPH_C32(0x9a540000), SPH_C32(0x42670000), - SPH_C32(0x5fb10000), SPH_C32(0xd6c06187), SPH_C32(0x5d81863c), - SPH_C32(0x87922fef), SPH_C32(0x79e0422c), SPH_C32(0xdf9801b0), - SPH_C32(0xf67c0000), SPH_C32(0xa50e0000), SPH_C32(0xbf870000), - SPH_C32(0xad7f742c), SPH_C32(0xae2b8f5a), SPH_C32(0xc2a957e9), - SPH_C32(0xd75f2456) }, - { SPH_C32(0x371f00c0), SPH_C32(0x6b0e0000), SPH_C32(0xb7d50000), - SPH_C32(0x6ba50000), SPH_C32(0x5ff71f0b), SPH_C32(0x070a6a19), - SPH_C32(0x8c51e2f1), SPH_C32(0xb6d737e7), SPH_C32(0x2bf401e0), - SPH_C32(0x60640000), SPH_C32(0xb1ab0000), SPH_C32(0xbc980000), - SPH_C32(0xefeb0a94), SPH_C32(0xc894f143), SPH_C32(0x5e0d273b), - SPH_C32(0x5d6b3122) }, - { SPH_C32(0x5cb00110), SPH_C32(0x913e0000), SPH_C32(0x44190000), - SPH_C32(0x888c0000), SPH_C32(0x66dc7418), SPH_C32(0x921f1d66), - SPH_C32(0x55ceea25), SPH_C32(0x925c44e9), SPH_C32(0xe8870170), - SPH_C32(0x9d720000), SPH_C32(0x12db0000), SPH_C32(0xd4220000), - SPH_C32(0xf2886b27), SPH_C32(0xa921e543), SPH_C32(0x4ef8b518), - SPH_C32(0x618813b1) }, - { SPH_C32(0x2bf401e0), SPH_C32(0x60640000), SPH_C32(0xb1ab0000), - SPH_C32(0xbc980000), SPH_C32(0xefeb0a94), SPH_C32(0xc894f143), - SPH_C32(0x5e0d273b), SPH_C32(0x5d6b3122), SPH_C32(0x1ceb0120), - SPH_C32(0x0b6a0000), SPH_C32(0x067e0000), SPH_C32(0xd73d0000), - SPH_C32(0xb01c159f), SPH_C32(0xcf9e9b5a), SPH_C32(0xd25cc5ca), - SPH_C32(0xebbc06c5) }, - { SPH_C32(0xa8dc0140), SPH_C32(0x07260000), SPH_C32(0x50bc0000), - SPH_C32(0x8b930000), SPH_C32(0x24480aa0), SPH_C32(0xf4a0637f), - SPH_C32(0xc96a9af7), SPH_C32(0x1868519d), SPH_C32(0x6baf01d0), - SPH_C32(0xfa300000), SPH_C32(0xf3cc0000), SPH_C32(0xe3290000), - SPH_C32(0x392b6b13), SPH_C32(0x9515777f), SPH_C32(0xd99f08d4), - SPH_C32(0x248b730e) }, - { SPH_C32(0xdf9801b0), SPH_C32(0xf67c0000), SPH_C32(0xa50e0000), - SPH_C32(0xbf870000), SPH_C32(0xad7f742c), SPH_C32(0xae2b8f5a), - SPH_C32(0xc2a957e9), SPH_C32(0xd75f2456), SPH_C32(0x9fc30180), - SPH_C32(0x6c280000), SPH_C32(0xe7690000), SPH_C32(0xe0360000), - SPH_C32(0x7bbf15ab), SPH_C32(0xf3aa0966), SPH_C32(0x453b7806), - SPH_C32(0xaebf667a) }, - { SPH_C32(0xef0b0270), SPH_C32(0x3afd0000), SPH_C32(0x5dae0000), - SPH_C32(0x69490000), SPH_C32(0x9b0f3c06), SPH_C32(0x4405b5f9), - SPH_C32(0x66140a51), SPH_C32(0x924f5d0a), SPH_C32(0xc96b0030), - SPH_C32(0xe7250000), SPH_C32(0x2f840000), SPH_C32(0x264f0000), - SPH_C32(0x08695bf9), SPH_C32(0x6dfcf137), SPH_C32(0x509f6984), - SPH_C32(0x9e69af68) }, - { SPH_C32(0x984f0280), SPH_C32(0xcba70000), SPH_C32(0xa81c0000), - SPH_C32(0x5d5d0000), SPH_C32(0x1238428a), SPH_C32(0x1e8e59dc), - SPH_C32(0x6dd7c74f), SPH_C32(0x5d7828c1), SPH_C32(0x3d070060), - SPH_C32(0x713d0000), SPH_C32(0x3b210000), SPH_C32(0x25500000), - SPH_C32(0x4afd2541), SPH_C32(0x0b438f2e), SPH_C32(0xcc3b1956), - SPH_C32(0x145dba1c) }, - { SPH_C32(0x1b670220), SPH_C32(0xace50000), SPH_C32(0x490b0000), - SPH_C32(0x6a560000), SPH_C32(0xd99b42be), SPH_C32(0x22bacbe0), - SPH_C32(0xfab07a83), SPH_C32(0x187b487e), SPH_C32(0x4a430090), - SPH_C32(0x80670000), SPH_C32(0xce930000), SPH_C32(0x11440000), - SPH_C32(0xc3ca5bcd), SPH_C32(0x51c8630b), SPH_C32(0xc7f8d448), - SPH_C32(0xdb6acfd7) }, - { SPH_C32(0x6c2302d0), SPH_C32(0x5dbf0000), SPH_C32(0xbcb90000), - SPH_C32(0x5e420000), SPH_C32(0x50ac3c32), SPH_C32(0x783127c5), - SPH_C32(0xf173b79d), SPH_C32(0xd74c3db5), SPH_C32(0xbe2f00c0), - SPH_C32(0x167f0000), SPH_C32(0xda360000), SPH_C32(0x125b0000), - SPH_C32(0x815e2575), SPH_C32(0x37771d12), SPH_C32(0x5b5ca49a), - SPH_C32(0x515edaa3) }, - { SPH_C32(0x078c0300), SPH_C32(0xa78f0000), SPH_C32(0x4f750000), - SPH_C32(0xbd6b0000), SPH_C32(0x69875721), SPH_C32(0xed2450ba), - SPH_C32(0x28ecbf49), SPH_C32(0xf3c74ebb), SPH_C32(0x7d5c0050), - SPH_C32(0xeb690000), SPH_C32(0x79460000), SPH_C32(0x7ae10000), - SPH_C32(0x9c3d44c6), SPH_C32(0x56c20912), SPH_C32(0x4ba936b9), - SPH_C32(0x6dbdf830) }, - { SPH_C32(0x70c803f0), SPH_C32(0x56d50000), SPH_C32(0xbac70000), - SPH_C32(0x897f0000), SPH_C32(0xe0b029ad), SPH_C32(0xb7afbc9f), - SPH_C32(0x232f7257), SPH_C32(0x3cf03b70), SPH_C32(0x89300000), - SPH_C32(0x7d710000), SPH_C32(0x6de30000), SPH_C32(0x79fe0000), - SPH_C32(0xdea93a7e), SPH_C32(0x307d770b), SPH_C32(0xd70d466b), - SPH_C32(0xe789ed44) }, - { SPH_C32(0xf3e00350), SPH_C32(0x31970000), SPH_C32(0x5bd00000), - SPH_C32(0xbe740000), SPH_C32(0x2b132999), SPH_C32(0x8b9b2ea3), - SPH_C32(0xb448cf9b), SPH_C32(0x79f35bcf), SPH_C32(0xfe7400f0), - SPH_C32(0x8c2b0000), SPH_C32(0x98510000), SPH_C32(0x4dea0000), - SPH_C32(0x579e44f2), SPH_C32(0x6af69b2e), SPH_C32(0xdcce8b75), - SPH_C32(0x28be988f) }, - { SPH_C32(0x84a403a0), SPH_C32(0xc0cd0000), SPH_C32(0xae620000), - SPH_C32(0x8a600000), SPH_C32(0xa2245715), SPH_C32(0xd110c286), - SPH_C32(0xbf8b0285), SPH_C32(0xb6c42e04), SPH_C32(0x0a1800a0), - SPH_C32(0x1a330000), SPH_C32(0x8cf40000), SPH_C32(0x4ef50000), - SPH_C32(0x150a3a4a), SPH_C32(0x0c49e537), SPH_C32(0x406afba7), - SPH_C32(0xa28a8dfb) }, - { SPH_C32(0x5b3c0210), SPH_C32(0x36b10000), SPH_C32(0x0b6c0000), - SPH_C32(0x35e70000), SPH_C32(0x0f5b2339), SPH_C32(0x7f3b4ddc), - SPH_C32(0x7d22556c), SPH_C32(0x619b0a52), SPH_C32(0x95db0120), - SPH_C32(0x761b0000), SPH_C32(0x6b9d0000), SPH_C32(0xaec30000), - SPH_C32(0x6eb52fe1), SPH_C32(0xffe3ec51), SPH_C32(0x055183a1), - SPH_C32(0x0c35eb81) }, - { SPH_C32(0x2c7802e0), SPH_C32(0xc7eb0000), SPH_C32(0xfede0000), - SPH_C32(0x01f30000), SPH_C32(0x866c5db5), SPH_C32(0x25b0a1f9), - SPH_C32(0x76e19872), SPH_C32(0xaeac7f99), SPH_C32(0x61b70170), - SPH_C32(0xe0030000), SPH_C32(0x7f380000), SPH_C32(0xaddc0000), - SPH_C32(0x2c215159), SPH_C32(0x995c9248), SPH_C32(0x99f5f373), - SPH_C32(0x8601fef5) }, - { SPH_C32(0xaf500240), SPH_C32(0xa0a90000), SPH_C32(0x1fc90000), - SPH_C32(0x36f80000), SPH_C32(0x4dcf5d81), SPH_C32(0x198433c5), - SPH_C32(0xe18625be), SPH_C32(0xebaf1f26), SPH_C32(0x16f30180), - SPH_C32(0x11590000), SPH_C32(0x8a8a0000), SPH_C32(0x99c80000), - SPH_C32(0xa5162fd5), SPH_C32(0xc3d77e6d), SPH_C32(0x92363e6d), - SPH_C32(0x49368b3e) }, - { SPH_C32(0xd81402b0), SPH_C32(0x51f30000), SPH_C32(0xea7b0000), - SPH_C32(0x02ec0000), SPH_C32(0xc4f8230d), SPH_C32(0x430fdfe0), - SPH_C32(0xea45e8a0), SPH_C32(0x24986aed), SPH_C32(0xe29f01d0), - SPH_C32(0x87410000), SPH_C32(0x9e2f0000), SPH_C32(0x9ad70000), - SPH_C32(0xe782516d), SPH_C32(0xa5680074), SPH_C32(0x0e924ebf), - SPH_C32(0xc3029e4a) }, - { SPH_C32(0xb3bb0360), SPH_C32(0xabc30000), SPH_C32(0x19b70000), - SPH_C32(0xe1c50000), SPH_C32(0xfdd3481e), SPH_C32(0xd61aa89f), - SPH_C32(0x33dae074), SPH_C32(0x001319e3), SPH_C32(0x21ec0140), - SPH_C32(0x7a570000), SPH_C32(0x3d5f0000), SPH_C32(0xf26d0000), - SPH_C32(0xfae130de), SPH_C32(0xc4dd1474), SPH_C32(0x1e67dc9c), - SPH_C32(0xffe1bcd9) }, - { SPH_C32(0xc4ff0390), SPH_C32(0x5a990000), SPH_C32(0xec050000), - SPH_C32(0xd5d10000), SPH_C32(0x74e43692), SPH_C32(0x8c9144ba), - SPH_C32(0x38192d6a), SPH_C32(0xcf246c28), SPH_C32(0xd5800110), - SPH_C32(0xec4f0000), SPH_C32(0x29fa0000), SPH_C32(0xf1720000), - SPH_C32(0xb8754e66), SPH_C32(0xa2626a6d), SPH_C32(0x82c3ac4e), - SPH_C32(0x75d5a9ad) }, - { SPH_C32(0x47d70330), SPH_C32(0x3ddb0000), SPH_C32(0x0d120000), - SPH_C32(0xe2da0000), SPH_C32(0xbf4736a6), SPH_C32(0xb0a5d686), - SPH_C32(0xaf7e90a6), SPH_C32(0x8a270c97), SPH_C32(0xa2c401e0), - SPH_C32(0x1d150000), SPH_C32(0xdc480000), SPH_C32(0xc5660000), - SPH_C32(0x314230ea), SPH_C32(0xf8e98648), SPH_C32(0x89006150), - SPH_C32(0xbae2dc66) }, - { SPH_C32(0x309303c0), SPH_C32(0xcc810000), SPH_C32(0xf8a00000), - SPH_C32(0xd6ce0000), SPH_C32(0x3670482a), SPH_C32(0xea2e3aa3), - SPH_C32(0xa4bd5db8), SPH_C32(0x4510795c), SPH_C32(0x56a801b0), - SPH_C32(0x8b0d0000), SPH_C32(0xc8ed0000), SPH_C32(0xc6790000), - SPH_C32(0x73d64e52), SPH_C32(0x9e56f851), SPH_C32(0x15a41182), - SPH_C32(0x30d6c912) }, - { SPH_C32(0xc96b0030), SPH_C32(0xe7250000), SPH_C32(0x2f840000), - SPH_C32(0x264f0000), SPH_C32(0x08695bf9), SPH_C32(0x6dfcf137), - SPH_C32(0x509f6984), SPH_C32(0x9e69af68), SPH_C32(0x26600240), - SPH_C32(0xddd80000), SPH_C32(0x722a0000), SPH_C32(0x4f060000), - SPH_C32(0x936667ff), SPH_C32(0x29f944ce), SPH_C32(0x368b63d5), - SPH_C32(0x0c26f262) }, - { SPH_C32(0xbe2f00c0), SPH_C32(0x167f0000), SPH_C32(0xda360000), - SPH_C32(0x125b0000), SPH_C32(0x815e2575), SPH_C32(0x37771d12), - SPH_C32(0x5b5ca49a), SPH_C32(0x515edaa3), SPH_C32(0xd20c0210), - SPH_C32(0x4bc00000), SPH_C32(0x668f0000), SPH_C32(0x4c190000), - SPH_C32(0xd1f21947), SPH_C32(0x4f463ad7), SPH_C32(0xaa2f1307), - SPH_C32(0x8612e716) }, - { SPH_C32(0x3d070060), SPH_C32(0x713d0000), SPH_C32(0x3b210000), - SPH_C32(0x25500000), SPH_C32(0x4afd2541), SPH_C32(0x0b438f2e), - SPH_C32(0xcc3b1956), SPH_C32(0x145dba1c), SPH_C32(0xa54802e0), - SPH_C32(0xba9a0000), SPH_C32(0x933d0000), SPH_C32(0x780d0000), - SPH_C32(0x58c567cb), SPH_C32(0x15cdd6f2), SPH_C32(0xa1ecde19), - SPH_C32(0x492592dd) }, - { SPH_C32(0x4a430090), SPH_C32(0x80670000), SPH_C32(0xce930000), - SPH_C32(0x11440000), SPH_C32(0xc3ca5bcd), SPH_C32(0x51c8630b), - SPH_C32(0xc7f8d448), SPH_C32(0xdb6acfd7), SPH_C32(0x512402b0), - SPH_C32(0x2c820000), SPH_C32(0x87980000), SPH_C32(0x7b120000), - SPH_C32(0x1a511973), SPH_C32(0x7372a8eb), SPH_C32(0x3d48aecb), - SPH_C32(0xc31187a9) }, - { SPH_C32(0x21ec0140), SPH_C32(0x7a570000), SPH_C32(0x3d5f0000), - SPH_C32(0xf26d0000), SPH_C32(0xfae130de), SPH_C32(0xc4dd1474), - SPH_C32(0x1e67dc9c), SPH_C32(0xffe1bcd9), SPH_C32(0x92570220), - SPH_C32(0xd1940000), SPH_C32(0x24e80000), SPH_C32(0x13a80000), - SPH_C32(0x073278c0), SPH_C32(0x12c7bceb), SPH_C32(0x2dbd3ce8), - SPH_C32(0xfff2a53a) }, - { SPH_C32(0x56a801b0), SPH_C32(0x8b0d0000), SPH_C32(0xc8ed0000), - SPH_C32(0xc6790000), SPH_C32(0x73d64e52), SPH_C32(0x9e56f851), - SPH_C32(0x15a41182), SPH_C32(0x30d6c912), SPH_C32(0x663b0270), - SPH_C32(0x478c0000), SPH_C32(0x304d0000), SPH_C32(0x10b70000), - SPH_C32(0x45a60678), SPH_C32(0x7478c2f2), SPH_C32(0xb1194c3a), - SPH_C32(0x75c6b04e) }, - { SPH_C32(0xd5800110), SPH_C32(0xec4f0000), SPH_C32(0x29fa0000), - SPH_C32(0xf1720000), SPH_C32(0xb8754e66), SPH_C32(0xa2626a6d), - SPH_C32(0x82c3ac4e), SPH_C32(0x75d5a9ad), SPH_C32(0x117f0280), - SPH_C32(0xb6d60000), SPH_C32(0xc5ff0000), SPH_C32(0x24a30000), - SPH_C32(0xcc9178f4), SPH_C32(0x2ef32ed7), SPH_C32(0xbada8124), - SPH_C32(0xbaf1c585) }, - { SPH_C32(0xa2c401e0), SPH_C32(0x1d150000), SPH_C32(0xdc480000), - SPH_C32(0xc5660000), SPH_C32(0x314230ea), SPH_C32(0xf8e98648), - SPH_C32(0x89006150), SPH_C32(0xbae2dc66), SPH_C32(0xe51302d0), - SPH_C32(0x20ce0000), SPH_C32(0xd15a0000), SPH_C32(0x27bc0000), - SPH_C32(0x8e05064c), SPH_C32(0x484c50ce), SPH_C32(0x267ef1f6), - SPH_C32(0x30c5d0f1) }, - { SPH_C32(0x7d5c0050), SPH_C32(0xeb690000), SPH_C32(0x79460000), - SPH_C32(0x7ae10000), SPH_C32(0x9c3d44c6), SPH_C32(0x56c20912), - SPH_C32(0x4ba936b9), SPH_C32(0x6dbdf830), SPH_C32(0x7ad00350), - SPH_C32(0x4ce60000), SPH_C32(0x36330000), SPH_C32(0xc78a0000), - SPH_C32(0xf5ba13e7), SPH_C32(0xbbe659a8), SPH_C32(0x634589f0), - SPH_C32(0x9e7ab68b) }, - { SPH_C32(0x0a1800a0), SPH_C32(0x1a330000), SPH_C32(0x8cf40000), - SPH_C32(0x4ef50000), SPH_C32(0x150a3a4a), SPH_C32(0x0c49e537), - SPH_C32(0x406afba7), SPH_C32(0xa28a8dfb), SPH_C32(0x8ebc0300), - SPH_C32(0xdafe0000), SPH_C32(0x22960000), SPH_C32(0xc4950000), - SPH_C32(0xb72e6d5f), SPH_C32(0xdd5927b1), SPH_C32(0xffe1f922), - SPH_C32(0x144ea3ff) }, - { SPH_C32(0x89300000), SPH_C32(0x7d710000), SPH_C32(0x6de30000), - SPH_C32(0x79fe0000), SPH_C32(0xdea93a7e), SPH_C32(0x307d770b), - SPH_C32(0xd70d466b), SPH_C32(0xe789ed44), SPH_C32(0xf9f803f0), - SPH_C32(0x2ba40000), SPH_C32(0xd7240000), SPH_C32(0xf0810000), - SPH_C32(0x3e1913d3), SPH_C32(0x87d2cb94), SPH_C32(0xf422343c), - SPH_C32(0xdb79d634) }, - { SPH_C32(0xfe7400f0), SPH_C32(0x8c2b0000), SPH_C32(0x98510000), - SPH_C32(0x4dea0000), SPH_C32(0x579e44f2), SPH_C32(0x6af69b2e), - SPH_C32(0xdcce8b75), SPH_C32(0x28be988f), SPH_C32(0x0d9403a0), - SPH_C32(0xbdbc0000), SPH_C32(0xc3810000), SPH_C32(0xf39e0000), - SPH_C32(0x7c8d6d6b), SPH_C32(0xe16db58d), SPH_C32(0x688644ee), - SPH_C32(0x514dc340) }, - { SPH_C32(0x95db0120), SPH_C32(0x761b0000), SPH_C32(0x6b9d0000), - SPH_C32(0xaec30000), SPH_C32(0x6eb52fe1), SPH_C32(0xffe3ec51), - SPH_C32(0x055183a1), SPH_C32(0x0c35eb81), SPH_C32(0xcee70330), - SPH_C32(0x40aa0000), SPH_C32(0x60f10000), SPH_C32(0x9b240000), - SPH_C32(0x61ee0cd8), SPH_C32(0x80d8a18d), SPH_C32(0x7873d6cd), - SPH_C32(0x6daee1d3) }, - { SPH_C32(0xe29f01d0), SPH_C32(0x87410000), SPH_C32(0x9e2f0000), - SPH_C32(0x9ad70000), SPH_C32(0xe782516d), SPH_C32(0xa5680074), - SPH_C32(0x0e924ebf), SPH_C32(0xc3029e4a), SPH_C32(0x3a8b0360), - SPH_C32(0xd6b20000), SPH_C32(0x74540000), SPH_C32(0x983b0000), - SPH_C32(0x237a7260), SPH_C32(0xe667df94), SPH_C32(0xe4d7a61f), - SPH_C32(0xe79af4a7) }, - { SPH_C32(0x61b70170), SPH_C32(0xe0030000), SPH_C32(0x7f380000), - SPH_C32(0xaddc0000), SPH_C32(0x2c215159), SPH_C32(0x995c9248), - SPH_C32(0x99f5f373), SPH_C32(0x8601fef5), SPH_C32(0x4dcf0390), - SPH_C32(0x27e80000), SPH_C32(0x81e60000), SPH_C32(0xac2f0000), - SPH_C32(0xaa4d0cec), SPH_C32(0xbcec33b1), SPH_C32(0xef146b01), - SPH_C32(0x28ad816c) }, - { SPH_C32(0x16f30180), SPH_C32(0x11590000), SPH_C32(0x8a8a0000), - SPH_C32(0x99c80000), SPH_C32(0xa5162fd5), SPH_C32(0xc3d77e6d), - SPH_C32(0x92363e6d), SPH_C32(0x49368b3e), SPH_C32(0xb9a303c0), - SPH_C32(0xb1f00000), SPH_C32(0x95430000), SPH_C32(0xaf300000), - SPH_C32(0xe8d97254), SPH_C32(0xda534da8), SPH_C32(0x73b01bd3), - SPH_C32(0xa2999418) }, - { SPH_C32(0x26600240), SPH_C32(0xddd80000), SPH_C32(0x722a0000), - SPH_C32(0x4f060000), SPH_C32(0x936667ff), SPH_C32(0x29f944ce), - SPH_C32(0x368b63d5), SPH_C32(0x0c26f262), SPH_C32(0xef0b0270), - SPH_C32(0x3afd0000), SPH_C32(0x5dae0000), SPH_C32(0x69490000), - SPH_C32(0x9b0f3c06), SPH_C32(0x4405b5f9), SPH_C32(0x66140a51), - SPH_C32(0x924f5d0a) }, - { SPH_C32(0x512402b0), SPH_C32(0x2c820000), SPH_C32(0x87980000), - SPH_C32(0x7b120000), SPH_C32(0x1a511973), SPH_C32(0x7372a8eb), - SPH_C32(0x3d48aecb), SPH_C32(0xc31187a9), SPH_C32(0x1b670220), - SPH_C32(0xace50000), SPH_C32(0x490b0000), SPH_C32(0x6a560000), - SPH_C32(0xd99b42be), SPH_C32(0x22bacbe0), SPH_C32(0xfab07a83), - SPH_C32(0x187b487e) }, - { SPH_C32(0xd20c0210), SPH_C32(0x4bc00000), SPH_C32(0x668f0000), - SPH_C32(0x4c190000), SPH_C32(0xd1f21947), SPH_C32(0x4f463ad7), - SPH_C32(0xaa2f1307), SPH_C32(0x8612e716), SPH_C32(0x6c2302d0), - SPH_C32(0x5dbf0000), SPH_C32(0xbcb90000), SPH_C32(0x5e420000), - SPH_C32(0x50ac3c32), SPH_C32(0x783127c5), SPH_C32(0xf173b79d), - SPH_C32(0xd74c3db5) }, - { SPH_C32(0xa54802e0), SPH_C32(0xba9a0000), SPH_C32(0x933d0000), - SPH_C32(0x780d0000), SPH_C32(0x58c567cb), SPH_C32(0x15cdd6f2), - SPH_C32(0xa1ecde19), SPH_C32(0x492592dd), SPH_C32(0x984f0280), - SPH_C32(0xcba70000), SPH_C32(0xa81c0000), SPH_C32(0x5d5d0000), - SPH_C32(0x1238428a), SPH_C32(0x1e8e59dc), SPH_C32(0x6dd7c74f), - SPH_C32(0x5d7828c1) }, - { SPH_C32(0xcee70330), SPH_C32(0x40aa0000), SPH_C32(0x60f10000), - SPH_C32(0x9b240000), SPH_C32(0x61ee0cd8), SPH_C32(0x80d8a18d), - SPH_C32(0x7873d6cd), SPH_C32(0x6daee1d3), SPH_C32(0x5b3c0210), - SPH_C32(0x36b10000), SPH_C32(0x0b6c0000), SPH_C32(0x35e70000), - SPH_C32(0x0f5b2339), SPH_C32(0x7f3b4ddc), SPH_C32(0x7d22556c), - SPH_C32(0x619b0a52) }, - { SPH_C32(0xb9a303c0), SPH_C32(0xb1f00000), SPH_C32(0x95430000), - SPH_C32(0xaf300000), SPH_C32(0xe8d97254), SPH_C32(0xda534da8), - SPH_C32(0x73b01bd3), SPH_C32(0xa2999418), SPH_C32(0xaf500240), - SPH_C32(0xa0a90000), SPH_C32(0x1fc90000), SPH_C32(0x36f80000), - SPH_C32(0x4dcf5d81), SPH_C32(0x198433c5), SPH_C32(0xe18625be), - SPH_C32(0xebaf1f26) }, - { SPH_C32(0x3a8b0360), SPH_C32(0xd6b20000), SPH_C32(0x74540000), - SPH_C32(0x983b0000), SPH_C32(0x237a7260), SPH_C32(0xe667df94), - SPH_C32(0xe4d7a61f), SPH_C32(0xe79af4a7), SPH_C32(0xd81402b0), - SPH_C32(0x51f30000), SPH_C32(0xea7b0000), SPH_C32(0x02ec0000), - SPH_C32(0xc4f8230d), SPH_C32(0x430fdfe0), SPH_C32(0xea45e8a0), - SPH_C32(0x24986aed) }, - { SPH_C32(0x4dcf0390), SPH_C32(0x27e80000), SPH_C32(0x81e60000), - SPH_C32(0xac2f0000), SPH_C32(0xaa4d0cec), SPH_C32(0xbcec33b1), - SPH_C32(0xef146b01), SPH_C32(0x28ad816c), SPH_C32(0x2c7802e0), - SPH_C32(0xc7eb0000), SPH_C32(0xfede0000), SPH_C32(0x01f30000), - SPH_C32(0x866c5db5), SPH_C32(0x25b0a1f9), SPH_C32(0x76e19872), - SPH_C32(0xaeac7f99) }, - { SPH_C32(0x92570220), SPH_C32(0xd1940000), SPH_C32(0x24e80000), - SPH_C32(0x13a80000), SPH_C32(0x073278c0), SPH_C32(0x12c7bceb), - SPH_C32(0x2dbd3ce8), SPH_C32(0xfff2a53a), SPH_C32(0xb3bb0360), - SPH_C32(0xabc30000), SPH_C32(0x19b70000), SPH_C32(0xe1c50000), - SPH_C32(0xfdd3481e), SPH_C32(0xd61aa89f), SPH_C32(0x33dae074), - SPH_C32(0x001319e3) }, - { SPH_C32(0xe51302d0), SPH_C32(0x20ce0000), SPH_C32(0xd15a0000), - SPH_C32(0x27bc0000), SPH_C32(0x8e05064c), SPH_C32(0x484c50ce), - SPH_C32(0x267ef1f6), SPH_C32(0x30c5d0f1), SPH_C32(0x47d70330), - SPH_C32(0x3ddb0000), SPH_C32(0x0d120000), SPH_C32(0xe2da0000), - SPH_C32(0xbf4736a6), SPH_C32(0xb0a5d686), SPH_C32(0xaf7e90a6), - SPH_C32(0x8a270c97) }, - { SPH_C32(0x663b0270), SPH_C32(0x478c0000), SPH_C32(0x304d0000), - SPH_C32(0x10b70000), SPH_C32(0x45a60678), SPH_C32(0x7478c2f2), - SPH_C32(0xb1194c3a), SPH_C32(0x75c6b04e), SPH_C32(0x309303c0), - SPH_C32(0xcc810000), SPH_C32(0xf8a00000), SPH_C32(0xd6ce0000), - SPH_C32(0x3670482a), SPH_C32(0xea2e3aa3), SPH_C32(0xa4bd5db8), - SPH_C32(0x4510795c) }, - { SPH_C32(0x117f0280), SPH_C32(0xb6d60000), SPH_C32(0xc5ff0000), - SPH_C32(0x24a30000), SPH_C32(0xcc9178f4), SPH_C32(0x2ef32ed7), - SPH_C32(0xbada8124), SPH_C32(0xbaf1c585), SPH_C32(0xc4ff0390), - SPH_C32(0x5a990000), SPH_C32(0xec050000), SPH_C32(0xd5d10000), - SPH_C32(0x74e43692), SPH_C32(0x8c9144ba), SPH_C32(0x38192d6a), - SPH_C32(0xcf246c28) }, - { SPH_C32(0x7ad00350), SPH_C32(0x4ce60000), SPH_C32(0x36330000), - SPH_C32(0xc78a0000), SPH_C32(0xf5ba13e7), SPH_C32(0xbbe659a8), - SPH_C32(0x634589f0), SPH_C32(0x9e7ab68b), SPH_C32(0x078c0300), - SPH_C32(0xa78f0000), SPH_C32(0x4f750000), SPH_C32(0xbd6b0000), - SPH_C32(0x69875721), SPH_C32(0xed2450ba), SPH_C32(0x28ecbf49), - SPH_C32(0xf3c74ebb) }, - { SPH_C32(0x0d9403a0), SPH_C32(0xbdbc0000), SPH_C32(0xc3810000), - SPH_C32(0xf39e0000), SPH_C32(0x7c8d6d6b), SPH_C32(0xe16db58d), - SPH_C32(0x688644ee), SPH_C32(0x514dc340), SPH_C32(0xf3e00350), - SPH_C32(0x31970000), SPH_C32(0x5bd00000), SPH_C32(0xbe740000), - SPH_C32(0x2b132999), SPH_C32(0x8b9b2ea3), SPH_C32(0xb448cf9b), - SPH_C32(0x79f35bcf) }, - { SPH_C32(0x8ebc0300), SPH_C32(0xdafe0000), SPH_C32(0x22960000), - SPH_C32(0xc4950000), SPH_C32(0xb72e6d5f), SPH_C32(0xdd5927b1), - SPH_C32(0xffe1f922), SPH_C32(0x144ea3ff), SPH_C32(0x84a403a0), - SPH_C32(0xc0cd0000), SPH_C32(0xae620000), SPH_C32(0x8a600000), - SPH_C32(0xa2245715), SPH_C32(0xd110c286), SPH_C32(0xbf8b0285), - SPH_C32(0xb6c42e04) }, - { SPH_C32(0xf9f803f0), SPH_C32(0x2ba40000), SPH_C32(0xd7240000), - SPH_C32(0xf0810000), SPH_C32(0x3e1913d3), SPH_C32(0x87d2cb94), - SPH_C32(0xf422343c), SPH_C32(0xdb79d634), SPH_C32(0x70c803f0), - SPH_C32(0x56d50000), SPH_C32(0xbac70000), SPH_C32(0x897f0000), - SPH_C32(0xe0b029ad), SPH_C32(0xb7afbc9f), SPH_C32(0x232f7257), - SPH_C32(0x3cf03b70) } -}; - -static const sph_u32 T512_12[64][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x75c90003), SPH_C32(0x0e10c000), SPH_C32(0xd1200000), - SPH_C32(0xbaea0000), SPH_C32(0x8bc42f3e), SPH_C32(0x8758b757), - SPH_C32(0xbb28761d), SPH_C32(0x00b72e2b), SPH_C32(0xeecf0001), - SPH_C32(0x6f564000), SPH_C32(0xf33e0000), SPH_C32(0xa79e0000), - SPH_C32(0xbdb57219), SPH_C32(0xb711ebc5), SPH_C32(0x4a3b40ba), - SPH_C32(0xfeabf254) }, - { SPH_C32(0xeecf0001), SPH_C32(0x6f564000), SPH_C32(0xf33e0000), - SPH_C32(0xa79e0000), SPH_C32(0xbdb57219), SPH_C32(0xb711ebc5), - SPH_C32(0x4a3b40ba), SPH_C32(0xfeabf254), SPH_C32(0x9b060002), - SPH_C32(0x61468000), SPH_C32(0x221e0000), SPH_C32(0x1d740000), - SPH_C32(0x36715d27), SPH_C32(0x30495c92), SPH_C32(0xf11336a7), - SPH_C32(0xfe1cdc7f) }, - { SPH_C32(0x9b060002), SPH_C32(0x61468000), SPH_C32(0x221e0000), - SPH_C32(0x1d740000), SPH_C32(0x36715d27), SPH_C32(0x30495c92), - SPH_C32(0xf11336a7), SPH_C32(0xfe1cdc7f), SPH_C32(0x75c90003), - SPH_C32(0x0e10c000), SPH_C32(0xd1200000), SPH_C32(0xbaea0000), - SPH_C32(0x8bc42f3e), SPH_C32(0x8758b757), SPH_C32(0xbb28761d), - SPH_C32(0x00b72e2b) }, - { SPH_C32(0xf6800005), SPH_C32(0x3443c000), SPH_C32(0x24070000), - SPH_C32(0x8f3d0000), SPH_C32(0x21373bfb), SPH_C32(0x0ab8d5ae), - SPH_C32(0xcdc58b19), SPH_C32(0xd795ba31), SPH_C32(0xa67f0001), - SPH_C32(0x71378000), SPH_C32(0x19fc0000), SPH_C32(0x96db0000), - SPH_C32(0x3a8b6dfd), SPH_C32(0xebcaaef3), SPH_C32(0x2c6d478f), - SPH_C32(0xac8e6c88) }, - { SPH_C32(0x83490006), SPH_C32(0x3a530000), SPH_C32(0xf5270000), - SPH_C32(0x35d70000), SPH_C32(0xaaf314c5), SPH_C32(0x8de062f9), - SPH_C32(0x76edfd04), SPH_C32(0xd722941a), SPH_C32(0x48b00000), - SPH_C32(0x1e61c000), SPH_C32(0xeac20000), SPH_C32(0x31450000), - SPH_C32(0x873e1fe4), SPH_C32(0x5cdb4536), SPH_C32(0x66560735), - SPH_C32(0x52259edc) }, - { SPH_C32(0x184f0004), SPH_C32(0x5b158000), SPH_C32(0xd7390000), - SPH_C32(0x28a30000), SPH_C32(0x9c8249e2), SPH_C32(0xbda93e6b), - SPH_C32(0x87fecba3), SPH_C32(0x293e4865), SPH_C32(0x3d790003), - SPH_C32(0x10710000), SPH_C32(0x3be20000), SPH_C32(0x8baf0000), - SPH_C32(0x0cfa30da), SPH_C32(0xdb83f261), SPH_C32(0xdd7e7128), - SPH_C32(0x5292b0f7) }, - { SPH_C32(0x6d860007), SPH_C32(0x55054000), SPH_C32(0x06190000), - SPH_C32(0x92490000), SPH_C32(0x174666dc), SPH_C32(0x3af1893c), - SPH_C32(0x3cd6bdbe), SPH_C32(0x2989664e), SPH_C32(0xd3b60002), - SPH_C32(0x7f274000), SPH_C32(0xc8dc0000), SPH_C32(0x2c310000), - SPH_C32(0xb14f42c3), SPH_C32(0x6c9219a4), SPH_C32(0x97453192), - SPH_C32(0xac3942a3) }, - { SPH_C32(0xa67f0001), SPH_C32(0x71378000), SPH_C32(0x19fc0000), - SPH_C32(0x96db0000), SPH_C32(0x3a8b6dfd), SPH_C32(0xebcaaef3), - SPH_C32(0x2c6d478f), SPH_C32(0xac8e6c88), SPH_C32(0x50ff0004), - SPH_C32(0x45744000), SPH_C32(0x3dfb0000), SPH_C32(0x19e60000), - SPH_C32(0x1bbc5606), SPH_C32(0xe1727b5d), SPH_C32(0xe1a8cc96), - SPH_C32(0x7b1bd6b9) }, - { SPH_C32(0xd3b60002), SPH_C32(0x7f274000), SPH_C32(0xc8dc0000), - SPH_C32(0x2c310000), SPH_C32(0xb14f42c3), SPH_C32(0x6c9219a4), - SPH_C32(0x97453192), SPH_C32(0xac3942a3), SPH_C32(0xbe300005), - SPH_C32(0x2a220000), SPH_C32(0xcec50000), SPH_C32(0xbe780000), - SPH_C32(0xa609241f), SPH_C32(0x56639098), SPH_C32(0xab938c2c), - SPH_C32(0x85b024ed) }, - { SPH_C32(0x48b00000), SPH_C32(0x1e61c000), SPH_C32(0xeac20000), - SPH_C32(0x31450000), SPH_C32(0x873e1fe4), SPH_C32(0x5cdb4536), - SPH_C32(0x66560735), SPH_C32(0x52259edc), SPH_C32(0xcbf90006), - SPH_C32(0x2432c000), SPH_C32(0x1fe50000), SPH_C32(0x04920000), - SPH_C32(0x2dcd0b21), SPH_C32(0xd13b27cf), SPH_C32(0x10bbfa31), - SPH_C32(0x85070ac6) }, - { SPH_C32(0x3d790003), SPH_C32(0x10710000), SPH_C32(0x3be20000), - SPH_C32(0x8baf0000), SPH_C32(0x0cfa30da), SPH_C32(0xdb83f261), - SPH_C32(0xdd7e7128), SPH_C32(0x5292b0f7), SPH_C32(0x25360007), - SPH_C32(0x4b648000), SPH_C32(0xecdb0000), SPH_C32(0xa30c0000), - SPH_C32(0x90787938), SPH_C32(0x662acc0a), SPH_C32(0x5a80ba8b), - SPH_C32(0x7bacf892) }, - { SPH_C32(0x50ff0004), SPH_C32(0x45744000), SPH_C32(0x3dfb0000), - SPH_C32(0x19e60000), SPH_C32(0x1bbc5606), SPH_C32(0xe1727b5d), - SPH_C32(0xe1a8cc96), SPH_C32(0x7b1bd6b9), SPH_C32(0xf6800005), - SPH_C32(0x3443c000), SPH_C32(0x24070000), SPH_C32(0x8f3d0000), - SPH_C32(0x21373bfb), SPH_C32(0x0ab8d5ae), SPH_C32(0xcdc58b19), - SPH_C32(0xd795ba31) }, - { SPH_C32(0x25360007), SPH_C32(0x4b648000), SPH_C32(0xecdb0000), - SPH_C32(0xa30c0000), SPH_C32(0x90787938), SPH_C32(0x662acc0a), - SPH_C32(0x5a80ba8b), SPH_C32(0x7bacf892), SPH_C32(0x184f0004), - SPH_C32(0x5b158000), SPH_C32(0xd7390000), SPH_C32(0x28a30000), - SPH_C32(0x9c8249e2), SPH_C32(0xbda93e6b), SPH_C32(0x87fecba3), - SPH_C32(0x293e4865) }, - { SPH_C32(0xbe300005), SPH_C32(0x2a220000), SPH_C32(0xcec50000), - SPH_C32(0xbe780000), SPH_C32(0xa609241f), SPH_C32(0x56639098), - SPH_C32(0xab938c2c), SPH_C32(0x85b024ed), SPH_C32(0x6d860007), - SPH_C32(0x55054000), SPH_C32(0x06190000), SPH_C32(0x92490000), - SPH_C32(0x174666dc), SPH_C32(0x3af1893c), SPH_C32(0x3cd6bdbe), - SPH_C32(0x2989664e) }, - { SPH_C32(0xcbf90006), SPH_C32(0x2432c000), SPH_C32(0x1fe50000), - SPH_C32(0x04920000), SPH_C32(0x2dcd0b21), SPH_C32(0xd13b27cf), - SPH_C32(0x10bbfa31), SPH_C32(0x85070ac6), SPH_C32(0x83490006), - SPH_C32(0x3a530000), SPH_C32(0xf5270000), SPH_C32(0x35d70000), - SPH_C32(0xaaf314c5), SPH_C32(0x8de062f9), SPH_C32(0x76edfd04), - SPH_C32(0xd722941a) }, - { SPH_C32(0xf7750009), SPH_C32(0xcf3cc000), SPH_C32(0xc3d60000), - SPH_C32(0x04920000), SPH_C32(0x029519a9), SPH_C32(0xf8e836ba), - SPH_C32(0x7a87f14e), SPH_C32(0x9e16981a), SPH_C32(0xd46a0000), - SPH_C32(0x8dc8c000), SPH_C32(0xa5af0000), SPH_C32(0x4a290000), - SPH_C32(0xfc4e427a), SPH_C32(0xc9b4866c), SPH_C32(0x98369604), - SPH_C32(0xf746c320) }, - { SPH_C32(0x82bc000a), SPH_C32(0xc12c0000), SPH_C32(0x12f60000), - SPH_C32(0xbe780000), SPH_C32(0x89513697), SPH_C32(0x7fb081ed), - SPH_C32(0xc1af8753), SPH_C32(0x9ea1b631), SPH_C32(0x3aa50001), - SPH_C32(0xe29e8000), SPH_C32(0x56910000), SPH_C32(0xedb70000), - SPH_C32(0x41fb3063), SPH_C32(0x7ea56da9), SPH_C32(0xd20dd6be), - SPH_C32(0x09ed3174) }, - { SPH_C32(0x19ba0008), SPH_C32(0xa06a8000), SPH_C32(0x30e80000), - SPH_C32(0xa30c0000), SPH_C32(0xbf206bb0), SPH_C32(0x4ff9dd7f), - SPH_C32(0x30bcb1f4), SPH_C32(0x60bd6a4e), SPH_C32(0x4f6c0002), - SPH_C32(0xec8e4000), SPH_C32(0x87b10000), SPH_C32(0x575d0000), - SPH_C32(0xca3f1f5d), SPH_C32(0xf9fddafe), SPH_C32(0x6925a0a3), - SPH_C32(0x095a1f5f) }, - { SPH_C32(0x6c73000b), SPH_C32(0xae7a4000), SPH_C32(0xe1c80000), - SPH_C32(0x19e60000), SPH_C32(0x34e4448e), SPH_C32(0xc8a16a28), - SPH_C32(0x8b94c7e9), SPH_C32(0x600a4465), SPH_C32(0xa1a30003), - SPH_C32(0x83d80000), SPH_C32(0x748f0000), SPH_C32(0xf0c30000), - SPH_C32(0x778a6d44), SPH_C32(0x4eec313b), SPH_C32(0x231ee019), - SPH_C32(0xf7f1ed0b) }, - { SPH_C32(0x01f5000c), SPH_C32(0xfb7f0000), SPH_C32(0xe7d10000), - SPH_C32(0x8baf0000), SPH_C32(0x23a22252), SPH_C32(0xf250e314), - SPH_C32(0xb7427a57), SPH_C32(0x4983222b), SPH_C32(0x72150001), - SPH_C32(0xfcff4000), SPH_C32(0xbc530000), SPH_C32(0xdcf20000), - SPH_C32(0xc6c52f87), SPH_C32(0x227e289f), SPH_C32(0xb45bd18b), - SPH_C32(0x5bc8afa8) }, - { SPH_C32(0x743c000f), SPH_C32(0xf56fc000), SPH_C32(0x36f10000), - SPH_C32(0x31450000), SPH_C32(0xa8660d6c), SPH_C32(0x75085443), - SPH_C32(0x0c6a0c4a), SPH_C32(0x49340c00), SPH_C32(0x9cda0000), - SPH_C32(0x93a90000), SPH_C32(0x4f6d0000), SPH_C32(0x7b6c0000), - SPH_C32(0x7b705d9e), SPH_C32(0x956fc35a), SPH_C32(0xfe609131), - SPH_C32(0xa5635dfc) }, - { SPH_C32(0xef3a000d), SPH_C32(0x94294000), SPH_C32(0x14ef0000), - SPH_C32(0x2c310000), SPH_C32(0x9e17504b), SPH_C32(0x454108d1), - SPH_C32(0xfd793aed), SPH_C32(0xb728d07f), SPH_C32(0xe9130003), - SPH_C32(0x9db9c000), SPH_C32(0x9e4d0000), SPH_C32(0xc1860000), - SPH_C32(0xf0b472a0), SPH_C32(0x1237740d), SPH_C32(0x4548e72c), - SPH_C32(0xa5d473d7) }, - { SPH_C32(0x9af3000e), SPH_C32(0x9a398000), SPH_C32(0xc5cf0000), - SPH_C32(0x96db0000), SPH_C32(0x15d37f75), SPH_C32(0xc219bf86), - SPH_C32(0x46514cf0), SPH_C32(0xb79ffe54), SPH_C32(0x07dc0002), - SPH_C32(0xf2ef8000), SPH_C32(0x6d730000), SPH_C32(0x66180000), - SPH_C32(0x4d0100b9), SPH_C32(0xa5269fc8), SPH_C32(0x0f73a796), - SPH_C32(0x5b7f8183) }, - { SPH_C32(0x510a0008), SPH_C32(0xbe0b4000), SPH_C32(0xda2a0000), - SPH_C32(0x92490000), SPH_C32(0x381e7454), SPH_C32(0x13229849), - SPH_C32(0x56eab6c1), SPH_C32(0x3298f492), SPH_C32(0x84950004), - SPH_C32(0xc8bc8000), SPH_C32(0x98540000), SPH_C32(0x53cf0000), - SPH_C32(0xe7f2147c), SPH_C32(0x28c6fd31), SPH_C32(0x799e5a92), - SPH_C32(0x8c5d1599) }, - { SPH_C32(0x24c3000b), SPH_C32(0xb01b8000), SPH_C32(0x0b0a0000), - SPH_C32(0x28a30000), SPH_C32(0xb3da5b6a), SPH_C32(0x947a2f1e), - SPH_C32(0xedc2c0dc), SPH_C32(0x322fdab9), SPH_C32(0x6a5a0005), - SPH_C32(0xa7eac000), SPH_C32(0x6b6a0000), SPH_C32(0xf4510000), - SPH_C32(0x5a476665), SPH_C32(0x9fd716f4), SPH_C32(0x33a51a28), - SPH_C32(0x72f6e7cd) }, - { SPH_C32(0xbfc50009), SPH_C32(0xd15d0000), SPH_C32(0x29140000), - SPH_C32(0x35d70000), SPH_C32(0x85ab064d), SPH_C32(0xa433738c), - SPH_C32(0x1cd1f67b), SPH_C32(0xcc3306c6), SPH_C32(0x1f930006), - SPH_C32(0xa9fa0000), SPH_C32(0xba4a0000), SPH_C32(0x4ebb0000), - SPH_C32(0xd183495b), SPH_C32(0x188fa1a3), SPH_C32(0x888d6c35), - SPH_C32(0x7241c9e6) }, - { SPH_C32(0xca0c000a), SPH_C32(0xdf4dc000), SPH_C32(0xf8340000), - SPH_C32(0x8f3d0000), SPH_C32(0x0e6f2973), SPH_C32(0x236bc4db), - SPH_C32(0xa7f98066), SPH_C32(0xcc8428ed), SPH_C32(0xf15c0007), - SPH_C32(0xc6ac4000), SPH_C32(0x49740000), SPH_C32(0xe9250000), - SPH_C32(0x6c363b42), SPH_C32(0xaf9e4a66), SPH_C32(0xc2b62c8f), - SPH_C32(0x8cea3bb2) }, - { SPH_C32(0xa78a000d), SPH_C32(0x8a488000), SPH_C32(0xfe2d0000), - SPH_C32(0x1d740000), SPH_C32(0x19294faf), SPH_C32(0x199a4de7), - SPH_C32(0x9b2f3dd8), SPH_C32(0xe50d4ea3), SPH_C32(0x22ea0005), - SPH_C32(0xb98b0000), SPH_C32(0x81a80000), SPH_C32(0xc5140000), - SPH_C32(0xdd797981), SPH_C32(0xc30c53c2), SPH_C32(0x55f31d1d), - SPH_C32(0x20d37911) }, - { SPH_C32(0xd243000e), SPH_C32(0x84584000), SPH_C32(0x2f0d0000), - SPH_C32(0xa79e0000), SPH_C32(0x92ed6091), SPH_C32(0x9ec2fab0), - SPH_C32(0x20074bc5), SPH_C32(0xe5ba6088), SPH_C32(0xcc250004), - SPH_C32(0xd6dd4000), SPH_C32(0x72960000), SPH_C32(0x628a0000), - SPH_C32(0x60cc0b98), SPH_C32(0x741db807), SPH_C32(0x1fc85da7), - SPH_C32(0xde788b45) }, - { SPH_C32(0x4945000c), SPH_C32(0xe51ec000), SPH_C32(0x0d130000), - SPH_C32(0xbaea0000), SPH_C32(0xa49c3db6), SPH_C32(0xae8ba622), - SPH_C32(0xd1147d62), SPH_C32(0x1ba6bcf7), SPH_C32(0xb9ec0007), - SPH_C32(0xd8cd8000), SPH_C32(0xa3b60000), SPH_C32(0xd8600000), - SPH_C32(0xeb0824a6), SPH_C32(0xf3450f50), SPH_C32(0xa4e02bba), - SPH_C32(0xdecfa56e) }, - { SPH_C32(0x3c8c000f), SPH_C32(0xeb0e0000), SPH_C32(0xdc330000), - SPH_C32(0x00000000), SPH_C32(0x2f581288), SPH_C32(0x29d31175), - SPH_C32(0x6a3c0b7f), SPH_C32(0x1b1192dc), SPH_C32(0x57230006), - SPH_C32(0xb79bc000), SPH_C32(0x50880000), SPH_C32(0x7ffe0000), - SPH_C32(0x56bd56bf), SPH_C32(0x4454e495), SPH_C32(0xeedb6b00), - SPH_C32(0x2064573a) }, - { SPH_C32(0xd46a0000), SPH_C32(0x8dc8c000), SPH_C32(0xa5af0000), - SPH_C32(0x4a290000), SPH_C32(0xfc4e427a), SPH_C32(0xc9b4866c), - SPH_C32(0x98369604), SPH_C32(0xf746c320), SPH_C32(0x231f0009), - SPH_C32(0x42f40000), SPH_C32(0x66790000), SPH_C32(0x4ebb0000), - SPH_C32(0xfedb5bd3), SPH_C32(0x315cb0d6), SPH_C32(0xe2b1674a), - SPH_C32(0x69505b3a) }, - { SPH_C32(0xa1a30003), SPH_C32(0x83d80000), SPH_C32(0x748f0000), - SPH_C32(0xf0c30000), SPH_C32(0x778a6d44), SPH_C32(0x4eec313b), - SPH_C32(0x231ee019), SPH_C32(0xf7f1ed0b), SPH_C32(0xcdd00008), - SPH_C32(0x2da24000), SPH_C32(0x95470000), SPH_C32(0xe9250000), - SPH_C32(0x436e29ca), SPH_C32(0x864d5b13), SPH_C32(0xa88a27f0), - SPH_C32(0x97fba96e) }, - { SPH_C32(0x3aa50001), SPH_C32(0xe29e8000), SPH_C32(0x56910000), - SPH_C32(0xedb70000), SPH_C32(0x41fb3063), SPH_C32(0x7ea56da9), - SPH_C32(0xd20dd6be), SPH_C32(0x09ed3174), SPH_C32(0xb819000b), - SPH_C32(0x23b28000), SPH_C32(0x44670000), SPH_C32(0x53cf0000), - SPH_C32(0xc8aa06f4), SPH_C32(0x0115ec44), SPH_C32(0x13a251ed), - SPH_C32(0x974c8745) }, - { SPH_C32(0x4f6c0002), SPH_C32(0xec8e4000), SPH_C32(0x87b10000), - SPH_C32(0x575d0000), SPH_C32(0xca3f1f5d), SPH_C32(0xf9fddafe), - SPH_C32(0x6925a0a3), SPH_C32(0x095a1f5f), SPH_C32(0x56d6000a), - SPH_C32(0x4ce4c000), SPH_C32(0xb7590000), SPH_C32(0xf4510000), - SPH_C32(0x751f74ed), SPH_C32(0xb6040781), SPH_C32(0x59991157), - SPH_C32(0x69e77511) }, - { SPH_C32(0x22ea0005), SPH_C32(0xb98b0000), SPH_C32(0x81a80000), - SPH_C32(0xc5140000), SPH_C32(0xdd797981), SPH_C32(0xc30c53c2), - SPH_C32(0x55f31d1d), SPH_C32(0x20d37911), SPH_C32(0x85600008), - SPH_C32(0x33c38000), SPH_C32(0x7f850000), SPH_C32(0xd8600000), - SPH_C32(0xc450362e), SPH_C32(0xda961e25), SPH_C32(0xcedc20c5), - SPH_C32(0xc5de37b2) }, - { SPH_C32(0x57230006), SPH_C32(0xb79bc000), SPH_C32(0x50880000), - SPH_C32(0x7ffe0000), SPH_C32(0x56bd56bf), SPH_C32(0x4454e495), - SPH_C32(0xeedb6b00), SPH_C32(0x2064573a), SPH_C32(0x6baf0009), - SPH_C32(0x5c95c000), SPH_C32(0x8cbb0000), SPH_C32(0x7ffe0000), - SPH_C32(0x79e54437), SPH_C32(0x6d87f5e0), SPH_C32(0x84e7607f), - SPH_C32(0x3b75c5e6) }, - { SPH_C32(0xcc250004), SPH_C32(0xd6dd4000), SPH_C32(0x72960000), - SPH_C32(0x628a0000), SPH_C32(0x60cc0b98), SPH_C32(0x741db807), - SPH_C32(0x1fc85da7), SPH_C32(0xde788b45), SPH_C32(0x1e66000a), - SPH_C32(0x52850000), SPH_C32(0x5d9b0000), SPH_C32(0xc5140000), - SPH_C32(0xf2216b09), SPH_C32(0xeadf42b7), SPH_C32(0x3fcf1662), - SPH_C32(0x3bc2ebcd) }, - { SPH_C32(0xb9ec0007), SPH_C32(0xd8cd8000), SPH_C32(0xa3b60000), - SPH_C32(0xd8600000), SPH_C32(0xeb0824a6), SPH_C32(0xf3450f50), - SPH_C32(0xa4e02bba), SPH_C32(0xdecfa56e), SPH_C32(0xf0a9000b), - SPH_C32(0x3dd34000), SPH_C32(0xaea50000), SPH_C32(0x628a0000), - SPH_C32(0x4f941910), SPH_C32(0x5dcea972), SPH_C32(0x75f456d8), - SPH_C32(0xc5691999) }, - { SPH_C32(0x72150001), SPH_C32(0xfcff4000), SPH_C32(0xbc530000), - SPH_C32(0xdcf20000), SPH_C32(0xc6c52f87), SPH_C32(0x227e289f), - SPH_C32(0xb45bd18b), SPH_C32(0x5bc8afa8), SPH_C32(0x73e0000d), - SPH_C32(0x07804000), SPH_C32(0x5b820000), SPH_C32(0x575d0000), - SPH_C32(0xe5670dd5), SPH_C32(0xd02ecb8b), SPH_C32(0x0319abdc), - SPH_C32(0x124b8d83) }, - { SPH_C32(0x07dc0002), SPH_C32(0xf2ef8000), SPH_C32(0x6d730000), - SPH_C32(0x66180000), SPH_C32(0x4d0100b9), SPH_C32(0xa5269fc8), - SPH_C32(0x0f73a796), SPH_C32(0x5b7f8183), SPH_C32(0x9d2f000c), - SPH_C32(0x68d60000), SPH_C32(0xa8bc0000), SPH_C32(0xf0c30000), - SPH_C32(0x58d27fcc), SPH_C32(0x673f204e), SPH_C32(0x4922eb66), - SPH_C32(0xece07fd7) }, - { SPH_C32(0x9cda0000), SPH_C32(0x93a90000), SPH_C32(0x4f6d0000), - SPH_C32(0x7b6c0000), SPH_C32(0x7b705d9e), SPH_C32(0x956fc35a), - SPH_C32(0xfe609131), SPH_C32(0xa5635dfc), SPH_C32(0xe8e6000f), - SPH_C32(0x66c6c000), SPH_C32(0x799c0000), SPH_C32(0x4a290000), - SPH_C32(0xd31650f2), SPH_C32(0xe0679719), SPH_C32(0xf20a9d7b), - SPH_C32(0xec5751fc) }, - { SPH_C32(0xe9130003), SPH_C32(0x9db9c000), SPH_C32(0x9e4d0000), - SPH_C32(0xc1860000), SPH_C32(0xf0b472a0), SPH_C32(0x1237740d), - SPH_C32(0x4548e72c), SPH_C32(0xa5d473d7), SPH_C32(0x0629000e), - SPH_C32(0x09908000), SPH_C32(0x8aa20000), SPH_C32(0xedb70000), - SPH_C32(0x6ea322eb), SPH_C32(0x57767cdc), SPH_C32(0xb831ddc1), - SPH_C32(0x12fca3a8) }, - { SPH_C32(0x84950004), SPH_C32(0xc8bc8000), SPH_C32(0x98540000), - SPH_C32(0x53cf0000), SPH_C32(0xe7f2147c), SPH_C32(0x28c6fd31), - SPH_C32(0x799e5a92), SPH_C32(0x8c5d1599), SPH_C32(0xd59f000c), - SPH_C32(0x76b7c000), SPH_C32(0x427e0000), SPH_C32(0xc1860000), - SPH_C32(0xdfec6028), SPH_C32(0x3be46578), SPH_C32(0x2f74ec53), - SPH_C32(0xbec5e10b) }, - { SPH_C32(0xf15c0007), SPH_C32(0xc6ac4000), SPH_C32(0x49740000), - SPH_C32(0xe9250000), SPH_C32(0x6c363b42), SPH_C32(0xaf9e4a66), - SPH_C32(0xc2b62c8f), SPH_C32(0x8cea3bb2), SPH_C32(0x3b50000d), - SPH_C32(0x19e18000), SPH_C32(0xb1400000), SPH_C32(0x66180000), - SPH_C32(0x62591231), SPH_C32(0x8cf58ebd), SPH_C32(0x654face9), - SPH_C32(0x406e135f) }, - { SPH_C32(0x6a5a0005), SPH_C32(0xa7eac000), SPH_C32(0x6b6a0000), - SPH_C32(0xf4510000), SPH_C32(0x5a476665), SPH_C32(0x9fd716f4), - SPH_C32(0x33a51a28), SPH_C32(0x72f6e7cd), SPH_C32(0x4e99000e), - SPH_C32(0x17f14000), SPH_C32(0x60600000), SPH_C32(0xdcf20000), - SPH_C32(0xe99d3d0f), SPH_C32(0x0bad39ea), SPH_C32(0xde67daf4), - SPH_C32(0x40d93d74) }, - { SPH_C32(0x1f930006), SPH_C32(0xa9fa0000), SPH_C32(0xba4a0000), - SPH_C32(0x4ebb0000), SPH_C32(0xd183495b), SPH_C32(0x188fa1a3), - SPH_C32(0x888d6c35), SPH_C32(0x7241c9e6), SPH_C32(0xa056000f), - SPH_C32(0x78a70000), SPH_C32(0x935e0000), SPH_C32(0x7b6c0000), - SPH_C32(0x54284f16), SPH_C32(0xbcbcd22f), SPH_C32(0x945c9a4e), - SPH_C32(0xbe72cf20) }, - { SPH_C32(0x231f0009), SPH_C32(0x42f40000), SPH_C32(0x66790000), - SPH_C32(0x4ebb0000), SPH_C32(0xfedb5bd3), SPH_C32(0x315cb0d6), - SPH_C32(0xe2b1674a), SPH_C32(0x69505b3a), SPH_C32(0xf7750009), - SPH_C32(0xcf3cc000), SPH_C32(0xc3d60000), SPH_C32(0x04920000), - SPH_C32(0x029519a9), SPH_C32(0xf8e836ba), SPH_C32(0x7a87f14e), - SPH_C32(0x9e16981a) }, - { SPH_C32(0x56d6000a), SPH_C32(0x4ce4c000), SPH_C32(0xb7590000), - SPH_C32(0xf4510000), SPH_C32(0x751f74ed), SPH_C32(0xb6040781), - SPH_C32(0x59991157), SPH_C32(0x69e77511), SPH_C32(0x19ba0008), - SPH_C32(0xa06a8000), SPH_C32(0x30e80000), SPH_C32(0xa30c0000), - SPH_C32(0xbf206bb0), SPH_C32(0x4ff9dd7f), SPH_C32(0x30bcb1f4), - SPH_C32(0x60bd6a4e) }, - { SPH_C32(0xcdd00008), SPH_C32(0x2da24000), SPH_C32(0x95470000), - SPH_C32(0xe9250000), SPH_C32(0x436e29ca), SPH_C32(0x864d5b13), - SPH_C32(0xa88a27f0), SPH_C32(0x97fba96e), SPH_C32(0x6c73000b), - SPH_C32(0xae7a4000), SPH_C32(0xe1c80000), SPH_C32(0x19e60000), - SPH_C32(0x34e4448e), SPH_C32(0xc8a16a28), SPH_C32(0x8b94c7e9), - SPH_C32(0x600a4465) }, - { SPH_C32(0xb819000b), SPH_C32(0x23b28000), SPH_C32(0x44670000), - SPH_C32(0x53cf0000), SPH_C32(0xc8aa06f4), SPH_C32(0x0115ec44), - SPH_C32(0x13a251ed), SPH_C32(0x974c8745), SPH_C32(0x82bc000a), - SPH_C32(0xc12c0000), SPH_C32(0x12f60000), SPH_C32(0xbe780000), - SPH_C32(0x89513697), SPH_C32(0x7fb081ed), SPH_C32(0xc1af8753), - SPH_C32(0x9ea1b631) }, - { SPH_C32(0xd59f000c), SPH_C32(0x76b7c000), SPH_C32(0x427e0000), - SPH_C32(0xc1860000), SPH_C32(0xdfec6028), SPH_C32(0x3be46578), - SPH_C32(0x2f74ec53), SPH_C32(0xbec5e10b), SPH_C32(0x510a0008), - SPH_C32(0xbe0b4000), SPH_C32(0xda2a0000), SPH_C32(0x92490000), - SPH_C32(0x381e7454), SPH_C32(0x13229849), SPH_C32(0x56eab6c1), - SPH_C32(0x3298f492) }, - { SPH_C32(0xa056000f), SPH_C32(0x78a70000), SPH_C32(0x935e0000), - SPH_C32(0x7b6c0000), SPH_C32(0x54284f16), SPH_C32(0xbcbcd22f), - SPH_C32(0x945c9a4e), SPH_C32(0xbe72cf20), SPH_C32(0xbfc50009), - SPH_C32(0xd15d0000), SPH_C32(0x29140000), SPH_C32(0x35d70000), - SPH_C32(0x85ab064d), SPH_C32(0xa433738c), SPH_C32(0x1cd1f67b), - SPH_C32(0xcc3306c6) }, - { SPH_C32(0x3b50000d), SPH_C32(0x19e18000), SPH_C32(0xb1400000), - SPH_C32(0x66180000), SPH_C32(0x62591231), SPH_C32(0x8cf58ebd), - SPH_C32(0x654face9), SPH_C32(0x406e135f), SPH_C32(0xca0c000a), - SPH_C32(0xdf4dc000), SPH_C32(0xf8340000), SPH_C32(0x8f3d0000), - SPH_C32(0x0e6f2973), SPH_C32(0x236bc4db), SPH_C32(0xa7f98066), - SPH_C32(0xcc8428ed) }, - { SPH_C32(0x4e99000e), SPH_C32(0x17f14000), SPH_C32(0x60600000), - SPH_C32(0xdcf20000), SPH_C32(0xe99d3d0f), SPH_C32(0x0bad39ea), - SPH_C32(0xde67daf4), SPH_C32(0x40d93d74), SPH_C32(0x24c3000b), - SPH_C32(0xb01b8000), SPH_C32(0x0b0a0000), SPH_C32(0x28a30000), - SPH_C32(0xb3da5b6a), SPH_C32(0x947a2f1e), SPH_C32(0xedc2c0dc), - SPH_C32(0x322fdab9) }, - { SPH_C32(0x85600008), SPH_C32(0x33c38000), SPH_C32(0x7f850000), - SPH_C32(0xd8600000), SPH_C32(0xc450362e), SPH_C32(0xda961e25), - SPH_C32(0xcedc20c5), SPH_C32(0xc5de37b2), SPH_C32(0xa78a000d), - SPH_C32(0x8a488000), SPH_C32(0xfe2d0000), SPH_C32(0x1d740000), - SPH_C32(0x19294faf), SPH_C32(0x199a4de7), SPH_C32(0x9b2f3dd8), - SPH_C32(0xe50d4ea3) }, - { SPH_C32(0xf0a9000b), SPH_C32(0x3dd34000), SPH_C32(0xaea50000), - SPH_C32(0x628a0000), SPH_C32(0x4f941910), SPH_C32(0x5dcea972), - SPH_C32(0x75f456d8), SPH_C32(0xc5691999), SPH_C32(0x4945000c), - SPH_C32(0xe51ec000), SPH_C32(0x0d130000), SPH_C32(0xbaea0000), - SPH_C32(0xa49c3db6), SPH_C32(0xae8ba622), SPH_C32(0xd1147d62), - SPH_C32(0x1ba6bcf7) }, - { SPH_C32(0x6baf0009), SPH_C32(0x5c95c000), SPH_C32(0x8cbb0000), - SPH_C32(0x7ffe0000), SPH_C32(0x79e54437), SPH_C32(0x6d87f5e0), - SPH_C32(0x84e7607f), SPH_C32(0x3b75c5e6), SPH_C32(0x3c8c000f), - SPH_C32(0xeb0e0000), SPH_C32(0xdc330000), SPH_C32(0x00000000), - SPH_C32(0x2f581288), SPH_C32(0x29d31175), SPH_C32(0x6a3c0b7f), - SPH_C32(0x1b1192dc) }, - { SPH_C32(0x1e66000a), SPH_C32(0x52850000), SPH_C32(0x5d9b0000), - SPH_C32(0xc5140000), SPH_C32(0xf2216b09), SPH_C32(0xeadf42b7), - SPH_C32(0x3fcf1662), SPH_C32(0x3bc2ebcd), SPH_C32(0xd243000e), - SPH_C32(0x84584000), SPH_C32(0x2f0d0000), SPH_C32(0xa79e0000), - SPH_C32(0x92ed6091), SPH_C32(0x9ec2fab0), SPH_C32(0x20074bc5), - SPH_C32(0xe5ba6088) }, - { SPH_C32(0x73e0000d), SPH_C32(0x07804000), SPH_C32(0x5b820000), - SPH_C32(0x575d0000), SPH_C32(0xe5670dd5), SPH_C32(0xd02ecb8b), - SPH_C32(0x0319abdc), SPH_C32(0x124b8d83), SPH_C32(0x01f5000c), - SPH_C32(0xfb7f0000), SPH_C32(0xe7d10000), SPH_C32(0x8baf0000), - SPH_C32(0x23a22252), SPH_C32(0xf250e314), SPH_C32(0xb7427a57), - SPH_C32(0x4983222b) }, - { SPH_C32(0x0629000e), SPH_C32(0x09908000), SPH_C32(0x8aa20000), - SPH_C32(0xedb70000), SPH_C32(0x6ea322eb), SPH_C32(0x57767cdc), - SPH_C32(0xb831ddc1), SPH_C32(0x12fca3a8), SPH_C32(0xef3a000d), - SPH_C32(0x94294000), SPH_C32(0x14ef0000), SPH_C32(0x2c310000), - SPH_C32(0x9e17504b), SPH_C32(0x454108d1), SPH_C32(0xfd793aed), - SPH_C32(0xb728d07f) }, - { SPH_C32(0x9d2f000c), SPH_C32(0x68d60000), SPH_C32(0xa8bc0000), - SPH_C32(0xf0c30000), SPH_C32(0x58d27fcc), SPH_C32(0x673f204e), - SPH_C32(0x4922eb66), SPH_C32(0xece07fd7), SPH_C32(0x9af3000e), - SPH_C32(0x9a398000), SPH_C32(0xc5cf0000), SPH_C32(0x96db0000), - SPH_C32(0x15d37f75), SPH_C32(0xc219bf86), SPH_C32(0x46514cf0), - SPH_C32(0xb79ffe54) }, - { SPH_C32(0xe8e6000f), SPH_C32(0x66c6c000), SPH_C32(0x799c0000), - SPH_C32(0x4a290000), SPH_C32(0xd31650f2), SPH_C32(0xe0679719), - SPH_C32(0xf20a9d7b), SPH_C32(0xec5751fc), SPH_C32(0x743c000f), - SPH_C32(0xf56fc000), SPH_C32(0x36f10000), SPH_C32(0x31450000), - SPH_C32(0xa8660d6c), SPH_C32(0x75085443), SPH_C32(0x0c6a0c4a), - SPH_C32(0x49340c00) } -}; - -static const sph_u32 T512_18[64][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x0c720000), SPH_C32(0x49e50f00), SPH_C32(0x42790000), - SPH_C32(0x5cea0000), SPH_C32(0x33aa301a), SPH_C32(0x15822514), - SPH_C32(0x95a34b7b), SPH_C32(0xb44b0090), SPH_C32(0xfe220000), - SPH_C32(0xa7580500), SPH_C32(0x25d10000), SPH_C32(0xf7600000), - SPH_C32(0x893178da), SPH_C32(0x1fd4f860), SPH_C32(0x4ed0a315), - SPH_C32(0xa123ff9f) }, - { SPH_C32(0xfe220000), SPH_C32(0xa7580500), SPH_C32(0x25d10000), - SPH_C32(0xf7600000), SPH_C32(0x893178da), SPH_C32(0x1fd4f860), - SPH_C32(0x4ed0a315), SPH_C32(0xa123ff9f), SPH_C32(0xf2500000), - SPH_C32(0xeebd0a00), SPH_C32(0x67a80000), SPH_C32(0xab8a0000), - SPH_C32(0xba9b48c0), SPH_C32(0x0a56dd74), SPH_C32(0xdb73e86e), - SPH_C32(0x1568ff0f) }, - { SPH_C32(0xf2500000), SPH_C32(0xeebd0a00), SPH_C32(0x67a80000), - SPH_C32(0xab8a0000), SPH_C32(0xba9b48c0), SPH_C32(0x0a56dd74), - SPH_C32(0xdb73e86e), SPH_C32(0x1568ff0f), SPH_C32(0x0c720000), - SPH_C32(0x49e50f00), SPH_C32(0x42790000), SPH_C32(0x5cea0000), - SPH_C32(0x33aa301a), SPH_C32(0x15822514), SPH_C32(0x95a34b7b), - SPH_C32(0xb44b0090) }, - { SPH_C32(0x45180000), SPH_C32(0xa5b51700), SPH_C32(0xf96a0000), - SPH_C32(0x3b480000), SPH_C32(0x1ecc142c), SPH_C32(0x231395d6), - SPH_C32(0x16bca6b0), SPH_C32(0xdf33f4df), SPH_C32(0xb83d0000), - SPH_C32(0x16710600), SPH_C32(0x379a0000), SPH_C32(0xf5b10000), - SPH_C32(0x228161ac), SPH_C32(0xae48f145), SPH_C32(0x66241616), - SPH_C32(0xc5c1eb3e) }, - { SPH_C32(0x496a0000), SPH_C32(0xec501800), SPH_C32(0xbb130000), - SPH_C32(0x67a20000), SPH_C32(0x2d662436), SPH_C32(0x3691b0c2), - SPH_C32(0x831fedcb), SPH_C32(0x6b78f44f), SPH_C32(0x461f0000), - SPH_C32(0xb1290300), SPH_C32(0x124b0000), SPH_C32(0x02d10000), - SPH_C32(0xabb01976), SPH_C32(0xb19c0925), SPH_C32(0x28f4b503), - SPH_C32(0x64e214a1) }, - { SPH_C32(0xbb3a0000), SPH_C32(0x02ed1200), SPH_C32(0xdcbb0000), - SPH_C32(0xcc280000), SPH_C32(0x97fd6cf6), SPH_C32(0x3cc76db6), - SPH_C32(0x586c05a5), SPH_C32(0x7e100b40), SPH_C32(0x4a6d0000), - SPH_C32(0xf8cc0c00), SPH_C32(0x50320000), SPH_C32(0x5e3b0000), - SPH_C32(0x981a296c), SPH_C32(0xa41e2c31), SPH_C32(0xbd57fe78), - SPH_C32(0xd0a91431) }, - { SPH_C32(0xb7480000), SPH_C32(0x4b081d00), SPH_C32(0x9ec20000), - SPH_C32(0x90c20000), SPH_C32(0xa4575cec), SPH_C32(0x294548a2), - SPH_C32(0xcdcf4ede), SPH_C32(0xca5b0bd0), SPH_C32(0xb44f0000), - SPH_C32(0x5f940900), SPH_C32(0x75e30000), SPH_C32(0xa95b0000), - SPH_C32(0x112b51b6), SPH_C32(0xbbcad451), SPH_C32(0xf3875d6d), - SPH_C32(0x718aebae) }, - { SPH_C32(0xb83d0000), SPH_C32(0x16710600), SPH_C32(0x379a0000), - SPH_C32(0xf5b10000), SPH_C32(0x228161ac), SPH_C32(0xae48f145), - SPH_C32(0x66241616), SPH_C32(0xc5c1eb3e), SPH_C32(0xfd250000), - SPH_C32(0xb3c41100), SPH_C32(0xcef00000), SPH_C32(0xcef90000), - SPH_C32(0x3c4d7580), SPH_C32(0x8d5b6493), SPH_C32(0x7098b0a6), - SPH_C32(0x1af21fe1) }, - { SPH_C32(0xb44f0000), SPH_C32(0x5f940900), SPH_C32(0x75e30000), - SPH_C32(0xa95b0000), SPH_C32(0x112b51b6), SPH_C32(0xbbcad451), - SPH_C32(0xf3875d6d), SPH_C32(0x718aebae), SPH_C32(0x03070000), - SPH_C32(0x149c1400), SPH_C32(0xeb210000), SPH_C32(0x39990000), - SPH_C32(0xb57c0d5a), SPH_C32(0x928f9cf3), SPH_C32(0x3e4813b3), - SPH_C32(0xbbd1e07e) }, - { SPH_C32(0x461f0000), SPH_C32(0xb1290300), SPH_C32(0x124b0000), - SPH_C32(0x02d10000), SPH_C32(0xabb01976), SPH_C32(0xb19c0925), - SPH_C32(0x28f4b503), SPH_C32(0x64e214a1), SPH_C32(0x0f750000), - SPH_C32(0x5d791b00), SPH_C32(0xa9580000), SPH_C32(0x65730000), - SPH_C32(0x86d63d40), SPH_C32(0x870db9e7), SPH_C32(0xabeb58c8), - SPH_C32(0x0f9ae0ee) }, - { SPH_C32(0x4a6d0000), SPH_C32(0xf8cc0c00), SPH_C32(0x50320000), - SPH_C32(0x5e3b0000), SPH_C32(0x981a296c), SPH_C32(0xa41e2c31), - SPH_C32(0xbd57fe78), SPH_C32(0xd0a91431), SPH_C32(0xf1570000), - SPH_C32(0xfa211e00), SPH_C32(0x8c890000), SPH_C32(0x92130000), - SPH_C32(0x0fe7459a), SPH_C32(0x98d94187), SPH_C32(0xe53bfbdd), - SPH_C32(0xaeb91f71) }, - { SPH_C32(0xfd250000), SPH_C32(0xb3c41100), SPH_C32(0xcef00000), - SPH_C32(0xcef90000), SPH_C32(0x3c4d7580), SPH_C32(0x8d5b6493), - SPH_C32(0x7098b0a6), SPH_C32(0x1af21fe1), SPH_C32(0x45180000), - SPH_C32(0xa5b51700), SPH_C32(0xf96a0000), SPH_C32(0x3b480000), - SPH_C32(0x1ecc142c), SPH_C32(0x231395d6), SPH_C32(0x16bca6b0), - SPH_C32(0xdf33f4df) }, - { SPH_C32(0xf1570000), SPH_C32(0xfa211e00), SPH_C32(0x8c890000), - SPH_C32(0x92130000), SPH_C32(0x0fe7459a), SPH_C32(0x98d94187), - SPH_C32(0xe53bfbdd), SPH_C32(0xaeb91f71), SPH_C32(0xbb3a0000), - SPH_C32(0x02ed1200), SPH_C32(0xdcbb0000), SPH_C32(0xcc280000), - SPH_C32(0x97fd6cf6), SPH_C32(0x3cc76db6), SPH_C32(0x586c05a5), - SPH_C32(0x7e100b40) }, - { SPH_C32(0x03070000), SPH_C32(0x149c1400), SPH_C32(0xeb210000), - SPH_C32(0x39990000), SPH_C32(0xb57c0d5a), SPH_C32(0x928f9cf3), - SPH_C32(0x3e4813b3), SPH_C32(0xbbd1e07e), SPH_C32(0xb7480000), - SPH_C32(0x4b081d00), SPH_C32(0x9ec20000), SPH_C32(0x90c20000), - SPH_C32(0xa4575cec), SPH_C32(0x294548a2), SPH_C32(0xcdcf4ede), - SPH_C32(0xca5b0bd0) }, - { SPH_C32(0x0f750000), SPH_C32(0x5d791b00), SPH_C32(0xa9580000), - SPH_C32(0x65730000), SPH_C32(0x86d63d40), SPH_C32(0x870db9e7), - SPH_C32(0xabeb58c8), SPH_C32(0x0f9ae0ee), SPH_C32(0x496a0000), - SPH_C32(0xec501800), SPH_C32(0xbb130000), SPH_C32(0x67a20000), - SPH_C32(0x2d662436), SPH_C32(0x3691b0c2), SPH_C32(0x831fedcb), - SPH_C32(0x6b78f44f) }, - { SPH_C32(0x75a40000), SPH_C32(0xc28b2700), SPH_C32(0x94a40000), - SPH_C32(0x90f50000), SPH_C32(0xfb7857e0), SPH_C32(0x49ce0bae), - SPH_C32(0x1767c483), SPH_C32(0xaedf667e), SPH_C32(0xd1660000), - SPH_C32(0x1bbc0300), SPH_C32(0x9eec0000), SPH_C32(0xf6940000), - SPH_C32(0x03024527), SPH_C32(0xcf70fcf2), SPH_C32(0xb4431b17), - SPH_C32(0x857f3c2b) }, - { SPH_C32(0x79d60000), SPH_C32(0x8b6e2800), SPH_C32(0xd6dd0000), - SPH_C32(0xcc1f0000), SPH_C32(0xc8d267fa), SPH_C32(0x5c4c2eba), - SPH_C32(0x82c48ff8), SPH_C32(0x1a9466ee), SPH_C32(0x2f440000), - SPH_C32(0xbce40600), SPH_C32(0xbb3d0000), SPH_C32(0x01f40000), - SPH_C32(0x8a333dfd), SPH_C32(0xd0a40492), SPH_C32(0xfa93b802), - SPH_C32(0x245cc3b4) }, - { SPH_C32(0x8b860000), SPH_C32(0x65d32200), SPH_C32(0xb1750000), - SPH_C32(0x67950000), SPH_C32(0x72492f3a), SPH_C32(0x561af3ce), - SPH_C32(0x59b76796), SPH_C32(0x0ffc99e1), SPH_C32(0x23360000), - SPH_C32(0xf5010900), SPH_C32(0xf9440000), SPH_C32(0x5d1e0000), - SPH_C32(0xb9990de7), SPH_C32(0xc5262186), SPH_C32(0x6f30f379), - SPH_C32(0x9017c324) }, - { SPH_C32(0x87f40000), SPH_C32(0x2c362d00), SPH_C32(0xf30c0000), - SPH_C32(0x3b7f0000), SPH_C32(0x41e31f20), SPH_C32(0x4398d6da), - SPH_C32(0xcc142ced), SPH_C32(0xbbb79971), SPH_C32(0xdd140000), - SPH_C32(0x52590c00), SPH_C32(0xdc950000), SPH_C32(0xaa7e0000), - SPH_C32(0x30a8753d), SPH_C32(0xdaf2d9e6), SPH_C32(0x21e0506c), - SPH_C32(0x31343cbb) }, - { SPH_C32(0x30bc0000), SPH_C32(0x673e3000), SPH_C32(0x6dce0000), - SPH_C32(0xabbd0000), SPH_C32(0xe5b443cc), SPH_C32(0x6add9e78), - SPH_C32(0x01db6233), SPH_C32(0x71ec92a1), SPH_C32(0x695b0000), - SPH_C32(0x0dcd0500), SPH_C32(0xa9760000), SPH_C32(0x03250000), - SPH_C32(0x2183248b), SPH_C32(0x61380db7), SPH_C32(0xd2670d01), - SPH_C32(0x40bed715) }, - { SPH_C32(0x3cce0000), SPH_C32(0x2edb3f00), SPH_C32(0x2fb70000), - SPH_C32(0xf7570000), SPH_C32(0xd61e73d6), SPH_C32(0x7f5fbb6c), - SPH_C32(0x94782948), SPH_C32(0xc5a79231), SPH_C32(0x97790000), - SPH_C32(0xaa950000), SPH_C32(0x8ca70000), SPH_C32(0xf4450000), - SPH_C32(0xa8b25c51), SPH_C32(0x7eecf5d7), SPH_C32(0x9cb7ae14), - SPH_C32(0xe19d288a) }, - { SPH_C32(0xce9e0000), SPH_C32(0xc0663500), SPH_C32(0x481f0000), - SPH_C32(0x5cdd0000), SPH_C32(0x6c853b16), SPH_C32(0x75096618), - SPH_C32(0x4f0bc126), SPH_C32(0xd0cf6d3e), SPH_C32(0x9b0b0000), - SPH_C32(0xe3700f00), SPH_C32(0xcede0000), SPH_C32(0xa8af0000), - SPH_C32(0x9b186c4b), SPH_C32(0x6b6ed0c3), SPH_C32(0x0914e56f), - SPH_C32(0x55d6281a) }, - { SPH_C32(0xc2ec0000), SPH_C32(0x89833a00), SPH_C32(0x0a660000), - SPH_C32(0x00370000), SPH_C32(0x5f2f0b0c), SPH_C32(0x608b430c), - SPH_C32(0xdaa88a5d), SPH_C32(0x64846dae), SPH_C32(0x65290000), - SPH_C32(0x44280a00), SPH_C32(0xeb0f0000), SPH_C32(0x5fcf0000), - SPH_C32(0x12291491), SPH_C32(0x74ba28a3), SPH_C32(0x47c4467a), - SPH_C32(0xf4f5d785) }, - { SPH_C32(0xcd990000), SPH_C32(0xd4fa2100), SPH_C32(0xa33e0000), - SPH_C32(0x65440000), SPH_C32(0xd9f9364c), SPH_C32(0xe786faeb), - SPH_C32(0x7143d295), SPH_C32(0x6b1e8d40), SPH_C32(0x2c430000), - SPH_C32(0xa8781200), SPH_C32(0x501c0000), SPH_C32(0x386d0000), - SPH_C32(0x3f4f30a7), SPH_C32(0x422b9861), SPH_C32(0xc4dbabb1), - SPH_C32(0x9f8d23ca) }, - { SPH_C32(0xc1eb0000), SPH_C32(0x9d1f2e00), SPH_C32(0xe1470000), - SPH_C32(0x39ae0000), SPH_C32(0xea530656), SPH_C32(0xf204dfff), - SPH_C32(0xe4e099ee), SPH_C32(0xdf558dd0), SPH_C32(0xd2610000), - SPH_C32(0x0f201700), SPH_C32(0x75cd0000), SPH_C32(0xcf0d0000), - SPH_C32(0xb67e487d), SPH_C32(0x5dff6001), SPH_C32(0x8a0b08a4), - SPH_C32(0x3eaedc55) }, - { SPH_C32(0x33bb0000), SPH_C32(0x73a22400), SPH_C32(0x86ef0000), - SPH_C32(0x92240000), SPH_C32(0x50c84e96), SPH_C32(0xf852028b), - SPH_C32(0x3f937180), SPH_C32(0xca3d72df), SPH_C32(0xde130000), - SPH_C32(0x46c51800), SPH_C32(0x37b40000), SPH_C32(0x93e70000), - SPH_C32(0x85d47867), SPH_C32(0x487d4515), SPH_C32(0x1fa843df), - SPH_C32(0x8ae5dcc5) }, - { SPH_C32(0x3fc90000), SPH_C32(0x3a472b00), SPH_C32(0xc4960000), - SPH_C32(0xcece0000), SPH_C32(0x63627e8c), SPH_C32(0xedd0279f), - SPH_C32(0xaa303afb), SPH_C32(0x7e76724f), SPH_C32(0x20310000), - SPH_C32(0xe19d1d00), SPH_C32(0x12650000), SPH_C32(0x64870000), - SPH_C32(0x0ce500bd), SPH_C32(0x57a9bd75), SPH_C32(0x5178e0ca), - SPH_C32(0x2bc6235a) }, - { SPH_C32(0x88810000), SPH_C32(0x714f3600), SPH_C32(0x5a540000), - SPH_C32(0x5e0c0000), SPH_C32(0xc7352260), SPH_C32(0xc4956f3d), - SPH_C32(0x67ff7425), SPH_C32(0xb42d799f), SPH_C32(0x947e0000), - SPH_C32(0xbe091400), SPH_C32(0x67860000), SPH_C32(0xcddc0000), - SPH_C32(0x1dce510b), SPH_C32(0xec636924), SPH_C32(0xa2ffbda7), - SPH_C32(0x5a4cc8f4) }, - { SPH_C32(0x84f30000), SPH_C32(0x38aa3900), SPH_C32(0x182d0000), - SPH_C32(0x02e60000), SPH_C32(0xf49f127a), SPH_C32(0xd1174a29), - SPH_C32(0xf25c3f5e), SPH_C32(0x0066790f), SPH_C32(0x6a5c0000), - SPH_C32(0x19511100), SPH_C32(0x42570000), SPH_C32(0x3abc0000), - SPH_C32(0x94ff29d1), SPH_C32(0xf3b79144), SPH_C32(0xec2f1eb2), - SPH_C32(0xfb6f376b) }, - { SPH_C32(0x76a30000), SPH_C32(0xd6173300), SPH_C32(0x7f850000), - SPH_C32(0xa96c0000), SPH_C32(0x4e045aba), SPH_C32(0xdb41975d), - SPH_C32(0x292fd730), SPH_C32(0x150e8600), SPH_C32(0x662e0000), - SPH_C32(0x50b41e00), SPH_C32(0x002e0000), SPH_C32(0x66560000), - SPH_C32(0xa75519cb), SPH_C32(0xe635b450), SPH_C32(0x798c55c9), - SPH_C32(0x4f2437fb) }, - { SPH_C32(0x7ad10000), SPH_C32(0x9ff23c00), SPH_C32(0x3dfc0000), - SPH_C32(0xf5860000), SPH_C32(0x7dae6aa0), SPH_C32(0xcec3b249), - SPH_C32(0xbc8c9c4b), SPH_C32(0xa1458690), SPH_C32(0x980c0000), - SPH_C32(0xf7ec1b00), SPH_C32(0x25ff0000), SPH_C32(0x91360000), - SPH_C32(0x2e646111), SPH_C32(0xf9e14c30), SPH_C32(0x375cf6dc), - SPH_C32(0xee07c864) }, - { SPH_C32(0xd1660000), SPH_C32(0x1bbc0300), SPH_C32(0x9eec0000), - SPH_C32(0xf6940000), SPH_C32(0x03024527), SPH_C32(0xcf70fcf2), - SPH_C32(0xb4431b17), SPH_C32(0x857f3c2b), SPH_C32(0xa4c20000), - SPH_C32(0xd9372400), SPH_C32(0x0a480000), SPH_C32(0x66610000), - SPH_C32(0xf87a12c7), SPH_C32(0x86bef75c), SPH_C32(0xa324df94), - SPH_C32(0x2ba05a55) }, - { SPH_C32(0xdd140000), SPH_C32(0x52590c00), SPH_C32(0xdc950000), - SPH_C32(0xaa7e0000), SPH_C32(0x30a8753d), SPH_C32(0xdaf2d9e6), - SPH_C32(0x21e0506c), SPH_C32(0x31343cbb), SPH_C32(0x5ae00000), - SPH_C32(0x7e6f2100), SPH_C32(0x2f990000), SPH_C32(0x91010000), - SPH_C32(0x714b6a1d), SPH_C32(0x996a0f3c), SPH_C32(0xedf47c81), - SPH_C32(0x8a83a5ca) }, - { SPH_C32(0x2f440000), SPH_C32(0xbce40600), SPH_C32(0xbb3d0000), - SPH_C32(0x01f40000), SPH_C32(0x8a333dfd), SPH_C32(0xd0a40492), - SPH_C32(0xfa93b802), SPH_C32(0x245cc3b4), SPH_C32(0x56920000), - SPH_C32(0x378a2e00), SPH_C32(0x6de00000), SPH_C32(0xcdeb0000), - SPH_C32(0x42e15a07), SPH_C32(0x8ce82a28), SPH_C32(0x785737fa), - SPH_C32(0x3ec8a55a) }, - { SPH_C32(0x23360000), SPH_C32(0xf5010900), SPH_C32(0xf9440000), - SPH_C32(0x5d1e0000), SPH_C32(0xb9990de7), SPH_C32(0xc5262186), - SPH_C32(0x6f30f379), SPH_C32(0x9017c324), SPH_C32(0xa8b00000), - SPH_C32(0x90d22b00), SPH_C32(0x48310000), SPH_C32(0x3a8b0000), - SPH_C32(0xcbd022dd), SPH_C32(0x933cd248), SPH_C32(0x368794ef), - SPH_C32(0x9feb5ac5) }, - { SPH_C32(0x947e0000), SPH_C32(0xbe091400), SPH_C32(0x67860000), - SPH_C32(0xcddc0000), SPH_C32(0x1dce510b), SPH_C32(0xec636924), - SPH_C32(0xa2ffbda7), SPH_C32(0x5a4cc8f4), SPH_C32(0x1cff0000), - SPH_C32(0xcf462200), SPH_C32(0x3dd20000), SPH_C32(0x93d00000), - SPH_C32(0xdafb736b), SPH_C32(0x28f60619), SPH_C32(0xc500c982), - SPH_C32(0xee61b16b) }, - { SPH_C32(0x980c0000), SPH_C32(0xf7ec1b00), SPH_C32(0x25ff0000), - SPH_C32(0x91360000), SPH_C32(0x2e646111), SPH_C32(0xf9e14c30), - SPH_C32(0x375cf6dc), SPH_C32(0xee07c864), SPH_C32(0xe2dd0000), - SPH_C32(0x681e2700), SPH_C32(0x18030000), SPH_C32(0x64b00000), - SPH_C32(0x53ca0bb1), SPH_C32(0x3722fe79), SPH_C32(0x8bd06a97), - SPH_C32(0x4f424ef4) }, - { SPH_C32(0x6a5c0000), SPH_C32(0x19511100), SPH_C32(0x42570000), - SPH_C32(0x3abc0000), SPH_C32(0x94ff29d1), SPH_C32(0xf3b79144), - SPH_C32(0xec2f1eb2), SPH_C32(0xfb6f376b), SPH_C32(0xeeaf0000), - SPH_C32(0x21fb2800), SPH_C32(0x5a7a0000), SPH_C32(0x385a0000), - SPH_C32(0x60603bab), SPH_C32(0x22a0db6d), SPH_C32(0x1e7321ec), - SPH_C32(0xfb094e64) }, - { SPH_C32(0x662e0000), SPH_C32(0x50b41e00), SPH_C32(0x002e0000), - SPH_C32(0x66560000), SPH_C32(0xa75519cb), SPH_C32(0xe635b450), - SPH_C32(0x798c55c9), SPH_C32(0x4f2437fb), SPH_C32(0x108d0000), - SPH_C32(0x86a32d00), SPH_C32(0x7fab0000), SPH_C32(0xcf3a0000), - SPH_C32(0xe9514371), SPH_C32(0x3d74230d), SPH_C32(0x50a382f9), - SPH_C32(0x5a2ab1fb) }, - { SPH_C32(0x695b0000), SPH_C32(0x0dcd0500), SPH_C32(0xa9760000), - SPH_C32(0x03250000), SPH_C32(0x2183248b), SPH_C32(0x61380db7), - SPH_C32(0xd2670d01), SPH_C32(0x40bed715), SPH_C32(0x59e70000), - SPH_C32(0x6af33500), SPH_C32(0xc4b80000), SPH_C32(0xa8980000), - SPH_C32(0xc4376747), SPH_C32(0x0be593cf), SPH_C32(0xd3bc6f32), - SPH_C32(0x315245b4) }, - { SPH_C32(0x65290000), SPH_C32(0x44280a00), SPH_C32(0xeb0f0000), - SPH_C32(0x5fcf0000), SPH_C32(0x12291491), SPH_C32(0x74ba28a3), - SPH_C32(0x47c4467a), SPH_C32(0xf4f5d785), SPH_C32(0xa7c50000), - SPH_C32(0xcdab3000), SPH_C32(0xe1690000), SPH_C32(0x5ff80000), - SPH_C32(0x4d061f9d), SPH_C32(0x14316baf), SPH_C32(0x9d6ccc27), - SPH_C32(0x9071ba2b) }, - { SPH_C32(0x97790000), SPH_C32(0xaa950000), SPH_C32(0x8ca70000), - SPH_C32(0xf4450000), SPH_C32(0xa8b25c51), SPH_C32(0x7eecf5d7), - SPH_C32(0x9cb7ae14), SPH_C32(0xe19d288a), SPH_C32(0xabb70000), - SPH_C32(0x844e3f00), SPH_C32(0xa3100000), SPH_C32(0x03120000), - SPH_C32(0x7eac2f87), SPH_C32(0x01b34ebb), SPH_C32(0x08cf875c), - SPH_C32(0x243ababb) }, - { SPH_C32(0x9b0b0000), SPH_C32(0xe3700f00), SPH_C32(0xcede0000), - SPH_C32(0xa8af0000), SPH_C32(0x9b186c4b), SPH_C32(0x6b6ed0c3), - SPH_C32(0x0914e56f), SPH_C32(0x55d6281a), SPH_C32(0x55950000), - SPH_C32(0x23163a00), SPH_C32(0x86c10000), SPH_C32(0xf4720000), - SPH_C32(0xf79d575d), SPH_C32(0x1e67b6db), SPH_C32(0x461f2449), - SPH_C32(0x85194524) }, - { SPH_C32(0x2c430000), SPH_C32(0xa8781200), SPH_C32(0x501c0000), - SPH_C32(0x386d0000), SPH_C32(0x3f4f30a7), SPH_C32(0x422b9861), - SPH_C32(0xc4dbabb1), SPH_C32(0x9f8d23ca), SPH_C32(0xe1da0000), - SPH_C32(0x7c823300), SPH_C32(0xf3220000), SPH_C32(0x5d290000), - SPH_C32(0xe6b606eb), SPH_C32(0xa5ad628a), SPH_C32(0xb5987924), - SPH_C32(0xf493ae8a) }, - { SPH_C32(0x20310000), SPH_C32(0xe19d1d00), SPH_C32(0x12650000), - SPH_C32(0x64870000), SPH_C32(0x0ce500bd), SPH_C32(0x57a9bd75), - SPH_C32(0x5178e0ca), SPH_C32(0x2bc6235a), SPH_C32(0x1ff80000), - SPH_C32(0xdbda3600), SPH_C32(0xd6f30000), SPH_C32(0xaa490000), - SPH_C32(0x6f877e31), SPH_C32(0xba799aea), SPH_C32(0xfb48da31), - SPH_C32(0x55b05115) }, - { SPH_C32(0xd2610000), SPH_C32(0x0f201700), SPH_C32(0x75cd0000), - SPH_C32(0xcf0d0000), SPH_C32(0xb67e487d), SPH_C32(0x5dff6001), - SPH_C32(0x8a0b08a4), SPH_C32(0x3eaedc55), SPH_C32(0x138a0000), - SPH_C32(0x923f3900), SPH_C32(0x948a0000), SPH_C32(0xf6a30000), - SPH_C32(0x5c2d4e2b), SPH_C32(0xaffbbffe), SPH_C32(0x6eeb914a), - SPH_C32(0xe1fb5185) }, - { SPH_C32(0xde130000), SPH_C32(0x46c51800), SPH_C32(0x37b40000), - SPH_C32(0x93e70000), SPH_C32(0x85d47867), SPH_C32(0x487d4515), - SPH_C32(0x1fa843df), SPH_C32(0x8ae5dcc5), SPH_C32(0xeda80000), - SPH_C32(0x35673c00), SPH_C32(0xb15b0000), SPH_C32(0x01c30000), - SPH_C32(0xd51c36f1), SPH_C32(0xb02f479e), SPH_C32(0x203b325f), - SPH_C32(0x40d8ae1a) }, - { SPH_C32(0xa4c20000), SPH_C32(0xd9372400), SPH_C32(0x0a480000), - SPH_C32(0x66610000), SPH_C32(0xf87a12c7), SPH_C32(0x86bef75c), - SPH_C32(0xa324df94), SPH_C32(0x2ba05a55), SPH_C32(0x75a40000), - SPH_C32(0xc28b2700), SPH_C32(0x94a40000), SPH_C32(0x90f50000), - SPH_C32(0xfb7857e0), SPH_C32(0x49ce0bae), SPH_C32(0x1767c483), - SPH_C32(0xaedf667e) }, - { SPH_C32(0xa8b00000), SPH_C32(0x90d22b00), SPH_C32(0x48310000), - SPH_C32(0x3a8b0000), SPH_C32(0xcbd022dd), SPH_C32(0x933cd248), - SPH_C32(0x368794ef), SPH_C32(0x9feb5ac5), SPH_C32(0x8b860000), - SPH_C32(0x65d32200), SPH_C32(0xb1750000), SPH_C32(0x67950000), - SPH_C32(0x72492f3a), SPH_C32(0x561af3ce), SPH_C32(0x59b76796), - SPH_C32(0x0ffc99e1) }, - { SPH_C32(0x5ae00000), SPH_C32(0x7e6f2100), SPH_C32(0x2f990000), - SPH_C32(0x91010000), SPH_C32(0x714b6a1d), SPH_C32(0x996a0f3c), - SPH_C32(0xedf47c81), SPH_C32(0x8a83a5ca), SPH_C32(0x87f40000), - SPH_C32(0x2c362d00), SPH_C32(0xf30c0000), SPH_C32(0x3b7f0000), - SPH_C32(0x41e31f20), SPH_C32(0x4398d6da), SPH_C32(0xcc142ced), - SPH_C32(0xbbb79971) }, - { SPH_C32(0x56920000), SPH_C32(0x378a2e00), SPH_C32(0x6de00000), - SPH_C32(0xcdeb0000), SPH_C32(0x42e15a07), SPH_C32(0x8ce82a28), - SPH_C32(0x785737fa), SPH_C32(0x3ec8a55a), SPH_C32(0x79d60000), - SPH_C32(0x8b6e2800), SPH_C32(0xd6dd0000), SPH_C32(0xcc1f0000), - SPH_C32(0xc8d267fa), SPH_C32(0x5c4c2eba), SPH_C32(0x82c48ff8), - SPH_C32(0x1a9466ee) }, - { SPH_C32(0xe1da0000), SPH_C32(0x7c823300), SPH_C32(0xf3220000), - SPH_C32(0x5d290000), SPH_C32(0xe6b606eb), SPH_C32(0xa5ad628a), - SPH_C32(0xb5987924), SPH_C32(0xf493ae8a), SPH_C32(0xcd990000), - SPH_C32(0xd4fa2100), SPH_C32(0xa33e0000), SPH_C32(0x65440000), - SPH_C32(0xd9f9364c), SPH_C32(0xe786faeb), SPH_C32(0x7143d295), - SPH_C32(0x6b1e8d40) }, - { SPH_C32(0xeda80000), SPH_C32(0x35673c00), SPH_C32(0xb15b0000), - SPH_C32(0x01c30000), SPH_C32(0xd51c36f1), SPH_C32(0xb02f479e), - SPH_C32(0x203b325f), SPH_C32(0x40d8ae1a), SPH_C32(0x33bb0000), - SPH_C32(0x73a22400), SPH_C32(0x86ef0000), SPH_C32(0x92240000), - SPH_C32(0x50c84e96), SPH_C32(0xf852028b), SPH_C32(0x3f937180), - SPH_C32(0xca3d72df) }, - { SPH_C32(0x1ff80000), SPH_C32(0xdbda3600), SPH_C32(0xd6f30000), - SPH_C32(0xaa490000), SPH_C32(0x6f877e31), SPH_C32(0xba799aea), - SPH_C32(0xfb48da31), SPH_C32(0x55b05115), SPH_C32(0x3fc90000), - SPH_C32(0x3a472b00), SPH_C32(0xc4960000), SPH_C32(0xcece0000), - SPH_C32(0x63627e8c), SPH_C32(0xedd0279f), SPH_C32(0xaa303afb), - SPH_C32(0x7e76724f) }, - { SPH_C32(0x138a0000), SPH_C32(0x923f3900), SPH_C32(0x948a0000), - SPH_C32(0xf6a30000), SPH_C32(0x5c2d4e2b), SPH_C32(0xaffbbffe), - SPH_C32(0x6eeb914a), SPH_C32(0xe1fb5185), SPH_C32(0xc1eb0000), - SPH_C32(0x9d1f2e00), SPH_C32(0xe1470000), SPH_C32(0x39ae0000), - SPH_C32(0xea530656), SPH_C32(0xf204dfff), SPH_C32(0xe4e099ee), - SPH_C32(0xdf558dd0) }, - { SPH_C32(0x1cff0000), SPH_C32(0xcf462200), SPH_C32(0x3dd20000), - SPH_C32(0x93d00000), SPH_C32(0xdafb736b), SPH_C32(0x28f60619), - SPH_C32(0xc500c982), SPH_C32(0xee61b16b), SPH_C32(0x88810000), - SPH_C32(0x714f3600), SPH_C32(0x5a540000), SPH_C32(0x5e0c0000), - SPH_C32(0xc7352260), SPH_C32(0xc4956f3d), SPH_C32(0x67ff7425), - SPH_C32(0xb42d799f) }, - { SPH_C32(0x108d0000), SPH_C32(0x86a32d00), SPH_C32(0x7fab0000), - SPH_C32(0xcf3a0000), SPH_C32(0xe9514371), SPH_C32(0x3d74230d), - SPH_C32(0x50a382f9), SPH_C32(0x5a2ab1fb), SPH_C32(0x76a30000), - SPH_C32(0xd6173300), SPH_C32(0x7f850000), SPH_C32(0xa96c0000), - SPH_C32(0x4e045aba), SPH_C32(0xdb41975d), SPH_C32(0x292fd730), - SPH_C32(0x150e8600) }, - { SPH_C32(0xe2dd0000), SPH_C32(0x681e2700), SPH_C32(0x18030000), - SPH_C32(0x64b00000), SPH_C32(0x53ca0bb1), SPH_C32(0x3722fe79), - SPH_C32(0x8bd06a97), SPH_C32(0x4f424ef4), SPH_C32(0x7ad10000), - SPH_C32(0x9ff23c00), SPH_C32(0x3dfc0000), SPH_C32(0xf5860000), - SPH_C32(0x7dae6aa0), SPH_C32(0xcec3b249), SPH_C32(0xbc8c9c4b), - SPH_C32(0xa1458690) }, - { SPH_C32(0xeeaf0000), SPH_C32(0x21fb2800), SPH_C32(0x5a7a0000), - SPH_C32(0x385a0000), SPH_C32(0x60603bab), SPH_C32(0x22a0db6d), - SPH_C32(0x1e7321ec), SPH_C32(0xfb094e64), SPH_C32(0x84f30000), - SPH_C32(0x38aa3900), SPH_C32(0x182d0000), SPH_C32(0x02e60000), - SPH_C32(0xf49f127a), SPH_C32(0xd1174a29), SPH_C32(0xf25c3f5e), - SPH_C32(0x0066790f) }, - { SPH_C32(0x59e70000), SPH_C32(0x6af33500), SPH_C32(0xc4b80000), - SPH_C32(0xa8980000), SPH_C32(0xc4376747), SPH_C32(0x0be593cf), - SPH_C32(0xd3bc6f32), SPH_C32(0x315245b4), SPH_C32(0x30bc0000), - SPH_C32(0x673e3000), SPH_C32(0x6dce0000), SPH_C32(0xabbd0000), - SPH_C32(0xe5b443cc), SPH_C32(0x6add9e78), SPH_C32(0x01db6233), - SPH_C32(0x71ec92a1) }, - { SPH_C32(0x55950000), SPH_C32(0x23163a00), SPH_C32(0x86c10000), - SPH_C32(0xf4720000), SPH_C32(0xf79d575d), SPH_C32(0x1e67b6db), - SPH_C32(0x461f2449), SPH_C32(0x85194524), SPH_C32(0xce9e0000), - SPH_C32(0xc0663500), SPH_C32(0x481f0000), SPH_C32(0x5cdd0000), - SPH_C32(0x6c853b16), SPH_C32(0x75096618), SPH_C32(0x4f0bc126), - SPH_C32(0xd0cf6d3e) }, - { SPH_C32(0xa7c50000), SPH_C32(0xcdab3000), SPH_C32(0xe1690000), - SPH_C32(0x5ff80000), SPH_C32(0x4d061f9d), SPH_C32(0x14316baf), - SPH_C32(0x9d6ccc27), SPH_C32(0x9071ba2b), SPH_C32(0xc2ec0000), - SPH_C32(0x89833a00), SPH_C32(0x0a660000), SPH_C32(0x00370000), - SPH_C32(0x5f2f0b0c), SPH_C32(0x608b430c), SPH_C32(0xdaa88a5d), - SPH_C32(0x64846dae) }, - { SPH_C32(0xabb70000), SPH_C32(0x844e3f00), SPH_C32(0xa3100000), - SPH_C32(0x03120000), SPH_C32(0x7eac2f87), SPH_C32(0x01b34ebb), - SPH_C32(0x08cf875c), SPH_C32(0x243ababb), SPH_C32(0x3cce0000), - SPH_C32(0x2edb3f00), SPH_C32(0x2fb70000), SPH_C32(0xf7570000), - SPH_C32(0xd61e73d6), SPH_C32(0x7f5fbb6c), SPH_C32(0x94782948), - SPH_C32(0xc5a79231) } -}; - -static const sph_u32 T512_24[64][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x14190000), SPH_C32(0x23ca003c), SPH_C32(0x50df0000), - SPH_C32(0x44b60000), SPH_C32(0x1b6c67b0), SPH_C32(0x3cf3ac75), - SPH_C32(0x61e610b0), SPH_C32(0xdbcadb80), SPH_C32(0xe3430000), - SPH_C32(0x3a4e0014), SPH_C32(0xf2c60000), SPH_C32(0xaa4e0000), - SPH_C32(0xdb1e42a6), SPH_C32(0x256bbe15), SPH_C32(0x123db156), - SPH_C32(0x3a4e99d7) }, - { SPH_C32(0xe3430000), SPH_C32(0x3a4e0014), SPH_C32(0xf2c60000), - SPH_C32(0xaa4e0000), SPH_C32(0xdb1e42a6), SPH_C32(0x256bbe15), - SPH_C32(0x123db156), SPH_C32(0x3a4e99d7), SPH_C32(0xf75a0000), - SPH_C32(0x19840028), SPH_C32(0xa2190000), SPH_C32(0xeef80000), - SPH_C32(0xc0722516), SPH_C32(0x19981260), SPH_C32(0x73dba1e6), - SPH_C32(0xe1844257) }, - { SPH_C32(0xf75a0000), SPH_C32(0x19840028), SPH_C32(0xa2190000), - SPH_C32(0xeef80000), SPH_C32(0xc0722516), SPH_C32(0x19981260), - SPH_C32(0x73dba1e6), SPH_C32(0xe1844257), SPH_C32(0x14190000), - SPH_C32(0x23ca003c), SPH_C32(0x50df0000), SPH_C32(0x44b60000), - SPH_C32(0x1b6c67b0), SPH_C32(0x3cf3ac75), SPH_C32(0x61e610b0), - SPH_C32(0xdbcadb80) }, - { SPH_C32(0x54500000), SPH_C32(0x0671005c), SPH_C32(0x25ae0000), - SPH_C32(0x6a1e0000), SPH_C32(0x2ea54edf), SPH_C32(0x664e8512), - SPH_C32(0xbfba18c3), SPH_C32(0x7e715d17), SPH_C32(0xbc8d0000), - SPH_C32(0xfc3b0018), SPH_C32(0x19830000), SPH_C32(0xd10b0000), - SPH_C32(0xae1878c4), SPH_C32(0x42a69856), SPH_C32(0x0012da37), - SPH_C32(0x2c3b504e) }, - { SPH_C32(0x40490000), SPH_C32(0x25bb0060), SPH_C32(0x75710000), - SPH_C32(0x2ea80000), SPH_C32(0x35c9296f), SPH_C32(0x5abd2967), - SPH_C32(0xde5c0873), SPH_C32(0xa5bb8697), SPH_C32(0x5fce0000), - SPH_C32(0xc675000c), SPH_C32(0xeb450000), SPH_C32(0x7b450000), - SPH_C32(0x75063a62), SPH_C32(0x67cd2643), SPH_C32(0x122f6b61), - SPH_C32(0x1675c999) }, - { SPH_C32(0xb7130000), SPH_C32(0x3c3f0048), SPH_C32(0xd7680000), - SPH_C32(0xc0500000), SPH_C32(0xf5bb0c79), SPH_C32(0x43253b07), - SPH_C32(0xad87a995), SPH_C32(0x443fc4c0), SPH_C32(0x4bd70000), - SPH_C32(0xe5bf0030), SPH_C32(0xbb9a0000), SPH_C32(0x3ff30000), - SPH_C32(0x6e6a5dd2), SPH_C32(0x5b3e8a36), SPH_C32(0x73c97bd1), - SPH_C32(0xcdbf1219) }, - { SPH_C32(0xa30a0000), SPH_C32(0x1ff50074), SPH_C32(0x87b70000), - SPH_C32(0x84e60000), SPH_C32(0xeed76bc9), SPH_C32(0x7fd69772), - SPH_C32(0xcc61b925), SPH_C32(0x9ff51f40), SPH_C32(0xa8940000), - SPH_C32(0xdff10024), SPH_C32(0x495c0000), SPH_C32(0x95bd0000), - SPH_C32(0xb5741f74), SPH_C32(0x7e553423), SPH_C32(0x61f4ca87), - SPH_C32(0xf7f18bce) }, - { SPH_C32(0xbc8d0000), SPH_C32(0xfc3b0018), SPH_C32(0x19830000), - SPH_C32(0xd10b0000), SPH_C32(0xae1878c4), SPH_C32(0x42a69856), - SPH_C32(0x0012da37), SPH_C32(0x2c3b504e), SPH_C32(0xe8dd0000), - SPH_C32(0xfa4a0044), SPH_C32(0x3c2d0000), SPH_C32(0xbb150000), - SPH_C32(0x80bd361b), SPH_C32(0x24e81d44), SPH_C32(0xbfa8c2f4), - SPH_C32(0x524a0d59) }, - { SPH_C32(0xa8940000), SPH_C32(0xdff10024), SPH_C32(0x495c0000), - SPH_C32(0x95bd0000), SPH_C32(0xb5741f74), SPH_C32(0x7e553423), - SPH_C32(0x61f4ca87), SPH_C32(0xf7f18bce), SPH_C32(0x0b9e0000), - SPH_C32(0xc0040050), SPH_C32(0xceeb0000), SPH_C32(0x115b0000), - SPH_C32(0x5ba374bd), SPH_C32(0x0183a351), SPH_C32(0xad9573a2), - SPH_C32(0x6804948e) }, - { SPH_C32(0x5fce0000), SPH_C32(0xc675000c), SPH_C32(0xeb450000), - SPH_C32(0x7b450000), SPH_C32(0x75063a62), SPH_C32(0x67cd2643), - SPH_C32(0x122f6b61), SPH_C32(0x1675c999), SPH_C32(0x1f870000), - SPH_C32(0xe3ce006c), SPH_C32(0x9e340000), SPH_C32(0x55ed0000), - SPH_C32(0x40cf130d), SPH_C32(0x3d700f24), SPH_C32(0xcc736312), - SPH_C32(0xb3ce4f0e) }, - { SPH_C32(0x4bd70000), SPH_C32(0xe5bf0030), SPH_C32(0xbb9a0000), - SPH_C32(0x3ff30000), SPH_C32(0x6e6a5dd2), SPH_C32(0x5b3e8a36), - SPH_C32(0x73c97bd1), SPH_C32(0xcdbf1219), SPH_C32(0xfcc40000), - SPH_C32(0xd9800078), SPH_C32(0x6cf20000), SPH_C32(0xffa30000), - SPH_C32(0x9bd151ab), SPH_C32(0x181bb131), SPH_C32(0xde4ed244), - SPH_C32(0x8980d6d9) }, - { SPH_C32(0xe8dd0000), SPH_C32(0xfa4a0044), SPH_C32(0x3c2d0000), - SPH_C32(0xbb150000), SPH_C32(0x80bd361b), SPH_C32(0x24e81d44), - SPH_C32(0xbfa8c2f4), SPH_C32(0x524a0d59), SPH_C32(0x54500000), - SPH_C32(0x0671005c), SPH_C32(0x25ae0000), SPH_C32(0x6a1e0000), - SPH_C32(0x2ea54edf), SPH_C32(0x664e8512), SPH_C32(0xbfba18c3), - SPH_C32(0x7e715d17) }, - { SPH_C32(0xfcc40000), SPH_C32(0xd9800078), SPH_C32(0x6cf20000), - SPH_C32(0xffa30000), SPH_C32(0x9bd151ab), SPH_C32(0x181bb131), - SPH_C32(0xde4ed244), SPH_C32(0x8980d6d9), SPH_C32(0xb7130000), - SPH_C32(0x3c3f0048), SPH_C32(0xd7680000), SPH_C32(0xc0500000), - SPH_C32(0xf5bb0c79), SPH_C32(0x43253b07), SPH_C32(0xad87a995), - SPH_C32(0x443fc4c0) }, - { SPH_C32(0x0b9e0000), SPH_C32(0xc0040050), SPH_C32(0xceeb0000), - SPH_C32(0x115b0000), SPH_C32(0x5ba374bd), SPH_C32(0x0183a351), - SPH_C32(0xad9573a2), SPH_C32(0x6804948e), SPH_C32(0xa30a0000), - SPH_C32(0x1ff50074), SPH_C32(0x87b70000), SPH_C32(0x84e60000), - SPH_C32(0xeed76bc9), SPH_C32(0x7fd69772), SPH_C32(0xcc61b925), - SPH_C32(0x9ff51f40) }, - { SPH_C32(0x1f870000), SPH_C32(0xe3ce006c), SPH_C32(0x9e340000), - SPH_C32(0x55ed0000), SPH_C32(0x40cf130d), SPH_C32(0x3d700f24), - SPH_C32(0xcc736312), SPH_C32(0xb3ce4f0e), SPH_C32(0x40490000), - SPH_C32(0x25bb0060), SPH_C32(0x75710000), SPH_C32(0x2ea80000), - SPH_C32(0x35c9296f), SPH_C32(0x5abd2967), SPH_C32(0xde5c0873), - SPH_C32(0xa5bb8697) }, - { SPH_C32(0x69510000), SPH_C32(0xd4e1009c), SPH_C32(0xc3230000), - SPH_C32(0xac2f0000), SPH_C32(0xe4950bae), SPH_C32(0xcea415dc), - SPH_C32(0x87ec287c), SPH_C32(0xbce1a3ce), SPH_C32(0xc6730000), - SPH_C32(0xaf8d000c), SPH_C32(0xa4c10000), SPH_C32(0x218d0000), - SPH_C32(0x23111587), SPH_C32(0x7913512f), SPH_C32(0x1d28ac88), - SPH_C32(0x378dd173) }, - { SPH_C32(0x7d480000), SPH_C32(0xf72b00a0), SPH_C32(0x93fc0000), - SPH_C32(0xe8990000), SPH_C32(0xfff96c1e), SPH_C32(0xf257b9a9), - SPH_C32(0xe60a38cc), SPH_C32(0x672b784e), SPH_C32(0x25300000), - SPH_C32(0x95c30018), SPH_C32(0x56070000), SPH_C32(0x8bc30000), - SPH_C32(0xf80f5721), SPH_C32(0x5c78ef3a), SPH_C32(0x0f151dde), - SPH_C32(0x0dc348a4) }, - { SPH_C32(0x8a120000), SPH_C32(0xeeaf0088), SPH_C32(0x31e50000), - SPH_C32(0x06610000), SPH_C32(0x3f8b4908), SPH_C32(0xebcfabc9), - SPH_C32(0x95d1992a), SPH_C32(0x86af3a19), SPH_C32(0x31290000), - SPH_C32(0xb6090024), SPH_C32(0x06d80000), SPH_C32(0xcf750000), - SPH_C32(0xe3633091), SPH_C32(0x608b434f), SPH_C32(0x6ef30d6e), - SPH_C32(0xd6099324) }, - { SPH_C32(0x9e0b0000), SPH_C32(0xcd6500b4), SPH_C32(0x613a0000), - SPH_C32(0x42d70000), SPH_C32(0x24e72eb8), SPH_C32(0xd73c07bc), - SPH_C32(0xf437899a), SPH_C32(0x5d65e199), SPH_C32(0xd26a0000), - SPH_C32(0x8c470030), SPH_C32(0xf41e0000), SPH_C32(0x653b0000), - SPH_C32(0x387d7237), SPH_C32(0x45e0fd5a), SPH_C32(0x7ccebc38), - SPH_C32(0xec470af3) }, - { SPH_C32(0x3d010000), SPH_C32(0xd29000c0), SPH_C32(0xe68d0000), - SPH_C32(0xc6310000), SPH_C32(0xca304571), SPH_C32(0xa8ea90ce), - SPH_C32(0x385630bf), SPH_C32(0xc290fed9), SPH_C32(0x7afe0000), - SPH_C32(0x53b60014), SPH_C32(0xbd420000), SPH_C32(0xf0860000), - SPH_C32(0x8d096d43), SPH_C32(0x3bb5c979), SPH_C32(0x1d3a76bf), - SPH_C32(0x1bb6813d) }, - { SPH_C32(0x29180000), SPH_C32(0xf15a00fc), SPH_C32(0xb6520000), - SPH_C32(0x82870000), SPH_C32(0xd15c22c1), SPH_C32(0x94193cbb), - SPH_C32(0x59b0200f), SPH_C32(0x195a2559), SPH_C32(0x99bd0000), - SPH_C32(0x69f80000), SPH_C32(0x4f840000), SPH_C32(0x5ac80000), - SPH_C32(0x56172fe5), SPH_C32(0x1ede776c), SPH_C32(0x0f07c7e9), - SPH_C32(0x21f818ea) }, - { SPH_C32(0xde420000), SPH_C32(0xe8de00d4), SPH_C32(0x144b0000), - SPH_C32(0x6c7f0000), SPH_C32(0x112e07d7), SPH_C32(0x8d812edb), - SPH_C32(0x2a6b81e9), SPH_C32(0xf8de670e), SPH_C32(0x8da40000), - SPH_C32(0x4a32003c), SPH_C32(0x1f5b0000), SPH_C32(0x1e7e0000), - SPH_C32(0x4d7b4855), SPH_C32(0x222ddb19), SPH_C32(0x6ee1d759), - SPH_C32(0xfa32c36a) }, - { SPH_C32(0xca5b0000), SPH_C32(0xcb1400e8), SPH_C32(0x44940000), - SPH_C32(0x28c90000), SPH_C32(0x0a426067), SPH_C32(0xb17282ae), - SPH_C32(0x4b8d9159), SPH_C32(0x2314bc8e), SPH_C32(0x6ee70000), - SPH_C32(0x707c0028), SPH_C32(0xed9d0000), SPH_C32(0xb4300000), - SPH_C32(0x96650af3), SPH_C32(0x0746650c), SPH_C32(0x7cdc660f), - SPH_C32(0xc07c5abd) }, - { SPH_C32(0xd5dc0000), SPH_C32(0x28da0084), SPH_C32(0xdaa00000), - SPH_C32(0x7d240000), SPH_C32(0x4a8d736a), SPH_C32(0x8c028d8a), - SPH_C32(0x87fef24b), SPH_C32(0x90daf380), SPH_C32(0x2eae0000), - SPH_C32(0x55c70048), SPH_C32(0x98ec0000), SPH_C32(0x9a980000), - SPH_C32(0xa3ac239c), SPH_C32(0x5dfb4c6b), SPH_C32(0xa2806e7c), - SPH_C32(0x65c7dc2a) }, - { SPH_C32(0xc1c50000), SPH_C32(0x0b1000b8), SPH_C32(0x8a7f0000), - SPH_C32(0x39920000), SPH_C32(0x51e114da), SPH_C32(0xb0f121ff), - SPH_C32(0xe618e2fb), SPH_C32(0x4b102800), SPH_C32(0xcded0000), - SPH_C32(0x6f89005c), SPH_C32(0x6a2a0000), SPH_C32(0x30d60000), - SPH_C32(0x78b2613a), SPH_C32(0x7890f27e), SPH_C32(0xb0bddf2a), - SPH_C32(0x5f8945fd) }, - { SPH_C32(0x369f0000), SPH_C32(0x12940090), SPH_C32(0x28660000), - SPH_C32(0xd76a0000), SPH_C32(0x919331cc), SPH_C32(0xa969339f), - SPH_C32(0x95c3431d), SPH_C32(0xaa946a57), SPH_C32(0xd9f40000), - SPH_C32(0x4c430060), SPH_C32(0x3af50000), SPH_C32(0x74600000), - SPH_C32(0x63de068a), SPH_C32(0x44635e0b), SPH_C32(0xd15bcf9a), - SPH_C32(0x84439e7d) }, - { SPH_C32(0x22860000), SPH_C32(0x315e00ac), SPH_C32(0x78b90000), - SPH_C32(0x93dc0000), SPH_C32(0x8aff567c), SPH_C32(0x959a9fea), - SPH_C32(0xf42553ad), SPH_C32(0x715eb1d7), SPH_C32(0x3ab70000), - SPH_C32(0x760d0074), SPH_C32(0xc8330000), SPH_C32(0xde2e0000), - SPH_C32(0xb8c0442c), SPH_C32(0x6108e01e), SPH_C32(0xc3667ecc), - SPH_C32(0xbe0d07aa) }, - { SPH_C32(0x818c0000), SPH_C32(0x2eab00d8), SPH_C32(0xff0e0000), - SPH_C32(0x173a0000), SPH_C32(0x64283db5), SPH_C32(0xea4c0898), - SPH_C32(0x3844ea88), SPH_C32(0xeeabae97), SPH_C32(0x92230000), - SPH_C32(0xa9fc0050), SPH_C32(0x816f0000), SPH_C32(0x4b930000), - SPH_C32(0x0db45b58), SPH_C32(0x1f5dd43d), SPH_C32(0xa292b44b), - SPH_C32(0x49fc8c64) }, - { SPH_C32(0x95950000), SPH_C32(0x0d6100e4), SPH_C32(0xafd10000), - SPH_C32(0x538c0000), SPH_C32(0x7f445a05), SPH_C32(0xd6bfa4ed), - SPH_C32(0x59a2fa38), SPH_C32(0x35617517), SPH_C32(0x71600000), - SPH_C32(0x93b20044), SPH_C32(0x73a90000), SPH_C32(0xe1dd0000), - SPH_C32(0xd6aa19fe), SPH_C32(0x3a366a28), SPH_C32(0xb0af051d), - SPH_C32(0x73b215b3) }, - { SPH_C32(0x62cf0000), SPH_C32(0x14e500cc), SPH_C32(0x0dc80000), - SPH_C32(0xbd740000), SPH_C32(0xbf367f13), SPH_C32(0xcf27b68d), - SPH_C32(0x2a795bde), SPH_C32(0xd4e53740), SPH_C32(0x65790000), - SPH_C32(0xb0780078), SPH_C32(0x23760000), SPH_C32(0xa56b0000), - SPH_C32(0xcdc67e4e), SPH_C32(0x06c5c65d), SPH_C32(0xd14915ad), - SPH_C32(0xa878ce33) }, - { SPH_C32(0x76d60000), SPH_C32(0x372f00f0), SPH_C32(0x5d170000), - SPH_C32(0xf9c20000), SPH_C32(0xa45a18a3), SPH_C32(0xf3d41af8), - SPH_C32(0x4b9f4b6e), SPH_C32(0x0f2fecc0), SPH_C32(0x863a0000), - SPH_C32(0x8a36006c), SPH_C32(0xd1b00000), SPH_C32(0x0f250000), - SPH_C32(0x16d83ce8), SPH_C32(0x23ae7848), SPH_C32(0xc374a4fb), - SPH_C32(0x923657e4) }, - { SPH_C32(0xc6730000), SPH_C32(0xaf8d000c), SPH_C32(0xa4c10000), - SPH_C32(0x218d0000), SPH_C32(0x23111587), SPH_C32(0x7913512f), - SPH_C32(0x1d28ac88), SPH_C32(0x378dd173), SPH_C32(0xaf220000), - SPH_C32(0x7b6c0090), SPH_C32(0x67e20000), SPH_C32(0x8da20000), - SPH_C32(0xc7841e29), SPH_C32(0xb7b744f3), SPH_C32(0x9ac484f4), - SPH_C32(0x8b6c72bd) }, - { SPH_C32(0xd26a0000), SPH_C32(0x8c470030), SPH_C32(0xf41e0000), - SPH_C32(0x653b0000), SPH_C32(0x387d7237), SPH_C32(0x45e0fd5a), - SPH_C32(0x7ccebc38), SPH_C32(0xec470af3), SPH_C32(0x4c610000), - SPH_C32(0x41220084), SPH_C32(0x95240000), SPH_C32(0x27ec0000), - SPH_C32(0x1c9a5c8f), SPH_C32(0x92dcfae6), SPH_C32(0x88f935a2), - SPH_C32(0xb122eb6a) }, - { SPH_C32(0x25300000), SPH_C32(0x95c30018), SPH_C32(0x56070000), - SPH_C32(0x8bc30000), SPH_C32(0xf80f5721), SPH_C32(0x5c78ef3a), - SPH_C32(0x0f151dde), SPH_C32(0x0dc348a4), SPH_C32(0x58780000), - SPH_C32(0x62e800b8), SPH_C32(0xc5fb0000), SPH_C32(0x635a0000), - SPH_C32(0x07f63b3f), SPH_C32(0xae2f5693), SPH_C32(0xe91f2512), - SPH_C32(0x6ae830ea) }, - { SPH_C32(0x31290000), SPH_C32(0xb6090024), SPH_C32(0x06d80000), - SPH_C32(0xcf750000), SPH_C32(0xe3633091), SPH_C32(0x608b434f), - SPH_C32(0x6ef30d6e), SPH_C32(0xd6099324), SPH_C32(0xbb3b0000), - SPH_C32(0x58a600ac), SPH_C32(0x373d0000), SPH_C32(0xc9140000), - SPH_C32(0xdce87999), SPH_C32(0x8b44e886), SPH_C32(0xfb229444), - SPH_C32(0x50a6a93d) }, - { SPH_C32(0x92230000), SPH_C32(0xa9fc0050), SPH_C32(0x816f0000), - SPH_C32(0x4b930000), SPH_C32(0x0db45b58), SPH_C32(0x1f5dd43d), - SPH_C32(0xa292b44b), SPH_C32(0x49fc8c64), SPH_C32(0x13af0000), - SPH_C32(0x87570088), SPH_C32(0x7e610000), SPH_C32(0x5ca90000), - SPH_C32(0x699c66ed), SPH_C32(0xf511dca5), SPH_C32(0x9ad65ec3), - SPH_C32(0xa75722f3) }, - { SPH_C32(0x863a0000), SPH_C32(0x8a36006c), SPH_C32(0xd1b00000), - SPH_C32(0x0f250000), SPH_C32(0x16d83ce8), SPH_C32(0x23ae7848), - SPH_C32(0xc374a4fb), SPH_C32(0x923657e4), SPH_C32(0xf0ec0000), - SPH_C32(0xbd19009c), SPH_C32(0x8ca70000), SPH_C32(0xf6e70000), - SPH_C32(0xb282244b), SPH_C32(0xd07a62b0), SPH_C32(0x88ebef95), - SPH_C32(0x9d19bb24) }, - { SPH_C32(0x71600000), SPH_C32(0x93b20044), SPH_C32(0x73a90000), - SPH_C32(0xe1dd0000), SPH_C32(0xd6aa19fe), SPH_C32(0x3a366a28), - SPH_C32(0xb0af051d), SPH_C32(0x73b215b3), SPH_C32(0xe4f50000), - SPH_C32(0x9ed300a0), SPH_C32(0xdc780000), SPH_C32(0xb2510000), - SPH_C32(0xa9ee43fb), SPH_C32(0xec89cec5), SPH_C32(0xe90dff25), - SPH_C32(0x46d360a4) }, - { SPH_C32(0x65790000), SPH_C32(0xb0780078), SPH_C32(0x23760000), - SPH_C32(0xa56b0000), SPH_C32(0xcdc67e4e), SPH_C32(0x06c5c65d), - SPH_C32(0xd14915ad), SPH_C32(0xa878ce33), SPH_C32(0x07b60000), - SPH_C32(0xa49d00b4), SPH_C32(0x2ebe0000), SPH_C32(0x181f0000), - SPH_C32(0x72f0015d), SPH_C32(0xc9e270d0), SPH_C32(0xfb304e73), - SPH_C32(0x7c9df973) }, - { SPH_C32(0x7afe0000), SPH_C32(0x53b60014), SPH_C32(0xbd420000), - SPH_C32(0xf0860000), SPH_C32(0x8d096d43), SPH_C32(0x3bb5c979), - SPH_C32(0x1d3a76bf), SPH_C32(0x1bb6813d), SPH_C32(0x47ff0000), - SPH_C32(0x812600d4), SPH_C32(0x5bcf0000), SPH_C32(0x36b70000), - SPH_C32(0x47392832), SPH_C32(0x935f59b7), SPH_C32(0x256c4600), - SPH_C32(0xd9267fe4) }, - { SPH_C32(0x6ee70000), SPH_C32(0x707c0028), SPH_C32(0xed9d0000), - SPH_C32(0xb4300000), SPH_C32(0x96650af3), SPH_C32(0x0746650c), - SPH_C32(0x7cdc660f), SPH_C32(0xc07c5abd), SPH_C32(0xa4bc0000), - SPH_C32(0xbb6800c0), SPH_C32(0xa9090000), SPH_C32(0x9cf90000), - SPH_C32(0x9c276a94), SPH_C32(0xb634e7a2), SPH_C32(0x3751f756), - SPH_C32(0xe368e633) }, - { SPH_C32(0x99bd0000), SPH_C32(0x69f80000), SPH_C32(0x4f840000), - SPH_C32(0x5ac80000), SPH_C32(0x56172fe5), SPH_C32(0x1ede776c), - SPH_C32(0x0f07c7e9), SPH_C32(0x21f818ea), SPH_C32(0xb0a50000), - SPH_C32(0x98a200fc), SPH_C32(0xf9d60000), SPH_C32(0xd84f0000), - SPH_C32(0x874b0d24), SPH_C32(0x8ac74bd7), SPH_C32(0x56b7e7e6), - SPH_C32(0x38a23db3) }, - { SPH_C32(0x8da40000), SPH_C32(0x4a32003c), SPH_C32(0x1f5b0000), - SPH_C32(0x1e7e0000), SPH_C32(0x4d7b4855), SPH_C32(0x222ddb19), - SPH_C32(0x6ee1d759), SPH_C32(0xfa32c36a), SPH_C32(0x53e60000), - SPH_C32(0xa2ec00e8), SPH_C32(0x0b100000), SPH_C32(0x72010000), - SPH_C32(0x5c554f82), SPH_C32(0xafacf5c2), SPH_C32(0x448a56b0), - SPH_C32(0x02eca464) }, - { SPH_C32(0x2eae0000), SPH_C32(0x55c70048), SPH_C32(0x98ec0000), - SPH_C32(0x9a980000), SPH_C32(0xa3ac239c), SPH_C32(0x5dfb4c6b), - SPH_C32(0xa2806e7c), SPH_C32(0x65c7dc2a), SPH_C32(0xfb720000), - SPH_C32(0x7d1d00cc), SPH_C32(0x424c0000), SPH_C32(0xe7bc0000), - SPH_C32(0xe92150f6), SPH_C32(0xd1f9c1e1), SPH_C32(0x257e9c37), - SPH_C32(0xf51d2faa) }, - { SPH_C32(0x3ab70000), SPH_C32(0x760d0074), SPH_C32(0xc8330000), - SPH_C32(0xde2e0000), SPH_C32(0xb8c0442c), SPH_C32(0x6108e01e), - SPH_C32(0xc3667ecc), SPH_C32(0xbe0d07aa), SPH_C32(0x18310000), - SPH_C32(0x475300d8), SPH_C32(0xb08a0000), SPH_C32(0x4df20000), - SPH_C32(0x323f1250), SPH_C32(0xf4927ff4), SPH_C32(0x37432d61), - SPH_C32(0xcf53b67d) }, - { SPH_C32(0xcded0000), SPH_C32(0x6f89005c), SPH_C32(0x6a2a0000), - SPH_C32(0x30d60000), SPH_C32(0x78b2613a), SPH_C32(0x7890f27e), - SPH_C32(0xb0bddf2a), SPH_C32(0x5f8945fd), SPH_C32(0x0c280000), - SPH_C32(0x649900e4), SPH_C32(0xe0550000), SPH_C32(0x09440000), - SPH_C32(0x295375e0), SPH_C32(0xc861d381), SPH_C32(0x56a53dd1), - SPH_C32(0x14996dfd) }, - { SPH_C32(0xd9f40000), SPH_C32(0x4c430060), SPH_C32(0x3af50000), - SPH_C32(0x74600000), SPH_C32(0x63de068a), SPH_C32(0x44635e0b), - SPH_C32(0xd15bcf9a), SPH_C32(0x84439e7d), SPH_C32(0xef6b0000), - SPH_C32(0x5ed700f0), SPH_C32(0x12930000), SPH_C32(0xa30a0000), - SPH_C32(0xf24d3746), SPH_C32(0xed0a6d94), SPH_C32(0x44988c87), - SPH_C32(0x2ed7f42a) }, - { SPH_C32(0xaf220000), SPH_C32(0x7b6c0090), SPH_C32(0x67e20000), - SPH_C32(0x8da20000), SPH_C32(0xc7841e29), SPH_C32(0xb7b744f3), - SPH_C32(0x9ac484f4), SPH_C32(0x8b6c72bd), SPH_C32(0x69510000), - SPH_C32(0xd4e1009c), SPH_C32(0xc3230000), SPH_C32(0xac2f0000), - SPH_C32(0xe4950bae), SPH_C32(0xcea415dc), SPH_C32(0x87ec287c), - SPH_C32(0xbce1a3ce) }, - { SPH_C32(0xbb3b0000), SPH_C32(0x58a600ac), SPH_C32(0x373d0000), - SPH_C32(0xc9140000), SPH_C32(0xdce87999), SPH_C32(0x8b44e886), - SPH_C32(0xfb229444), SPH_C32(0x50a6a93d), SPH_C32(0x8a120000), - SPH_C32(0xeeaf0088), SPH_C32(0x31e50000), SPH_C32(0x06610000), - SPH_C32(0x3f8b4908), SPH_C32(0xebcfabc9), SPH_C32(0x95d1992a), - SPH_C32(0x86af3a19) }, - { SPH_C32(0x4c610000), SPH_C32(0x41220084), SPH_C32(0x95240000), - SPH_C32(0x27ec0000), SPH_C32(0x1c9a5c8f), SPH_C32(0x92dcfae6), - SPH_C32(0x88f935a2), SPH_C32(0xb122eb6a), SPH_C32(0x9e0b0000), - SPH_C32(0xcd6500b4), SPH_C32(0x613a0000), SPH_C32(0x42d70000), - SPH_C32(0x24e72eb8), SPH_C32(0xd73c07bc), SPH_C32(0xf437899a), - SPH_C32(0x5d65e199) }, - { SPH_C32(0x58780000), SPH_C32(0x62e800b8), SPH_C32(0xc5fb0000), - SPH_C32(0x635a0000), SPH_C32(0x07f63b3f), SPH_C32(0xae2f5693), - SPH_C32(0xe91f2512), SPH_C32(0x6ae830ea), SPH_C32(0x7d480000), - SPH_C32(0xf72b00a0), SPH_C32(0x93fc0000), SPH_C32(0xe8990000), - SPH_C32(0xfff96c1e), SPH_C32(0xf257b9a9), SPH_C32(0xe60a38cc), - SPH_C32(0x672b784e) }, - { SPH_C32(0xfb720000), SPH_C32(0x7d1d00cc), SPH_C32(0x424c0000), - SPH_C32(0xe7bc0000), SPH_C32(0xe92150f6), SPH_C32(0xd1f9c1e1), - SPH_C32(0x257e9c37), SPH_C32(0xf51d2faa), SPH_C32(0xd5dc0000), - SPH_C32(0x28da0084), SPH_C32(0xdaa00000), SPH_C32(0x7d240000), - SPH_C32(0x4a8d736a), SPH_C32(0x8c028d8a), SPH_C32(0x87fef24b), - SPH_C32(0x90daf380) }, - { SPH_C32(0xef6b0000), SPH_C32(0x5ed700f0), SPH_C32(0x12930000), - SPH_C32(0xa30a0000), SPH_C32(0xf24d3746), SPH_C32(0xed0a6d94), - SPH_C32(0x44988c87), SPH_C32(0x2ed7f42a), SPH_C32(0x369f0000), - SPH_C32(0x12940090), SPH_C32(0x28660000), SPH_C32(0xd76a0000), - SPH_C32(0x919331cc), SPH_C32(0xa969339f), SPH_C32(0x95c3431d), - SPH_C32(0xaa946a57) }, - { SPH_C32(0x18310000), SPH_C32(0x475300d8), SPH_C32(0xb08a0000), - SPH_C32(0x4df20000), SPH_C32(0x323f1250), SPH_C32(0xf4927ff4), - SPH_C32(0x37432d61), SPH_C32(0xcf53b67d), SPH_C32(0x22860000), - SPH_C32(0x315e00ac), SPH_C32(0x78b90000), SPH_C32(0x93dc0000), - SPH_C32(0x8aff567c), SPH_C32(0x959a9fea), SPH_C32(0xf42553ad), - SPH_C32(0x715eb1d7) }, - { SPH_C32(0x0c280000), SPH_C32(0x649900e4), SPH_C32(0xe0550000), - SPH_C32(0x09440000), SPH_C32(0x295375e0), SPH_C32(0xc861d381), - SPH_C32(0x56a53dd1), SPH_C32(0x14996dfd), SPH_C32(0xc1c50000), - SPH_C32(0x0b1000b8), SPH_C32(0x8a7f0000), SPH_C32(0x39920000), - SPH_C32(0x51e114da), SPH_C32(0xb0f121ff), SPH_C32(0xe618e2fb), - SPH_C32(0x4b102800) }, - { SPH_C32(0x13af0000), SPH_C32(0x87570088), SPH_C32(0x7e610000), - SPH_C32(0x5ca90000), SPH_C32(0x699c66ed), SPH_C32(0xf511dca5), - SPH_C32(0x9ad65ec3), SPH_C32(0xa75722f3), SPH_C32(0x818c0000), - SPH_C32(0x2eab00d8), SPH_C32(0xff0e0000), SPH_C32(0x173a0000), - SPH_C32(0x64283db5), SPH_C32(0xea4c0898), SPH_C32(0x3844ea88), - SPH_C32(0xeeabae97) }, - { SPH_C32(0x07b60000), SPH_C32(0xa49d00b4), SPH_C32(0x2ebe0000), - SPH_C32(0x181f0000), SPH_C32(0x72f0015d), SPH_C32(0xc9e270d0), - SPH_C32(0xfb304e73), SPH_C32(0x7c9df973), SPH_C32(0x62cf0000), - SPH_C32(0x14e500cc), SPH_C32(0x0dc80000), SPH_C32(0xbd740000), - SPH_C32(0xbf367f13), SPH_C32(0xcf27b68d), SPH_C32(0x2a795bde), - SPH_C32(0xd4e53740) }, - { SPH_C32(0xf0ec0000), SPH_C32(0xbd19009c), SPH_C32(0x8ca70000), - SPH_C32(0xf6e70000), SPH_C32(0xb282244b), SPH_C32(0xd07a62b0), - SPH_C32(0x88ebef95), SPH_C32(0x9d19bb24), SPH_C32(0x76d60000), - SPH_C32(0x372f00f0), SPH_C32(0x5d170000), SPH_C32(0xf9c20000), - SPH_C32(0xa45a18a3), SPH_C32(0xf3d41af8), SPH_C32(0x4b9f4b6e), - SPH_C32(0x0f2fecc0) }, - { SPH_C32(0xe4f50000), SPH_C32(0x9ed300a0), SPH_C32(0xdc780000), - SPH_C32(0xb2510000), SPH_C32(0xa9ee43fb), SPH_C32(0xec89cec5), - SPH_C32(0xe90dff25), SPH_C32(0x46d360a4), SPH_C32(0x95950000), - SPH_C32(0x0d6100e4), SPH_C32(0xafd10000), SPH_C32(0x538c0000), - SPH_C32(0x7f445a05), SPH_C32(0xd6bfa4ed), SPH_C32(0x59a2fa38), - SPH_C32(0x35617517) }, - { SPH_C32(0x47ff0000), SPH_C32(0x812600d4), SPH_C32(0x5bcf0000), - SPH_C32(0x36b70000), SPH_C32(0x47392832), SPH_C32(0x935f59b7), - SPH_C32(0x256c4600), SPH_C32(0xd9267fe4), SPH_C32(0x3d010000), - SPH_C32(0xd29000c0), SPH_C32(0xe68d0000), SPH_C32(0xc6310000), - SPH_C32(0xca304571), SPH_C32(0xa8ea90ce), SPH_C32(0x385630bf), - SPH_C32(0xc290fed9) }, - { SPH_C32(0x53e60000), SPH_C32(0xa2ec00e8), SPH_C32(0x0b100000), - SPH_C32(0x72010000), SPH_C32(0x5c554f82), SPH_C32(0xafacf5c2), - SPH_C32(0x448a56b0), SPH_C32(0x02eca464), SPH_C32(0xde420000), - SPH_C32(0xe8de00d4), SPH_C32(0x144b0000), SPH_C32(0x6c7f0000), - SPH_C32(0x112e07d7), SPH_C32(0x8d812edb), SPH_C32(0x2a6b81e9), - SPH_C32(0xf8de670e) }, - { SPH_C32(0xa4bc0000), SPH_C32(0xbb6800c0), SPH_C32(0xa9090000), - SPH_C32(0x9cf90000), SPH_C32(0x9c276a94), SPH_C32(0xb634e7a2), - SPH_C32(0x3751f756), SPH_C32(0xe368e633), SPH_C32(0xca5b0000), - SPH_C32(0xcb1400e8), SPH_C32(0x44940000), SPH_C32(0x28c90000), - SPH_C32(0x0a426067), SPH_C32(0xb17282ae), SPH_C32(0x4b8d9159), - SPH_C32(0x2314bc8e) }, - { SPH_C32(0xb0a50000), SPH_C32(0x98a200fc), SPH_C32(0xf9d60000), - SPH_C32(0xd84f0000), SPH_C32(0x874b0d24), SPH_C32(0x8ac74bd7), - SPH_C32(0x56b7e7e6), SPH_C32(0x38a23db3), SPH_C32(0x29180000), - SPH_C32(0xf15a00fc), SPH_C32(0xb6520000), SPH_C32(0x82870000), - SPH_C32(0xd15c22c1), SPH_C32(0x94193cbb), SPH_C32(0x59b0200f), - SPH_C32(0x195a2559) } -}; - -static const sph_u32 T512_30[64][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xac480000), SPH_C32(0x1ba60000), SPH_C32(0x45fb1380), - SPH_C32(0x03430000), SPH_C32(0x5a85316a), SPH_C32(0x1fb250b6), - SPH_C32(0xfe72c7fe), SPH_C32(0x91e478f6), SPH_C32(0x1e4e0000), - SPH_C32(0xdecf0000), SPH_C32(0x6df80180), SPH_C32(0x77240000), - SPH_C32(0xec47079e), SPH_C32(0xf4a0694e), SPH_C32(0xcda31812), - SPH_C32(0x98aa496e) }, - { SPH_C32(0x1e4e0000), SPH_C32(0xdecf0000), SPH_C32(0x6df80180), - SPH_C32(0x77240000), SPH_C32(0xec47079e), SPH_C32(0xf4a0694e), - SPH_C32(0xcda31812), SPH_C32(0x98aa496e), SPH_C32(0xb2060000), - SPH_C32(0xc5690000), SPH_C32(0x28031200), SPH_C32(0x74670000), - SPH_C32(0xb6c236f4), SPH_C32(0xeb1239f8), SPH_C32(0x33d1dfec), - SPH_C32(0x094e3198) }, - { SPH_C32(0xb2060000), SPH_C32(0xc5690000), SPH_C32(0x28031200), - SPH_C32(0x74670000), SPH_C32(0xb6c236f4), SPH_C32(0xeb1239f8), - SPH_C32(0x33d1dfec), SPH_C32(0x094e3198), SPH_C32(0xac480000), - SPH_C32(0x1ba60000), SPH_C32(0x45fb1380), SPH_C32(0x03430000), - SPH_C32(0x5a85316a), SPH_C32(0x1fb250b6), SPH_C32(0xfe72c7fe), - SPH_C32(0x91e478f6) }, - { SPH_C32(0xaec30000), SPH_C32(0x9c4f0001), SPH_C32(0x79d1e000), - SPH_C32(0x2c150000), SPH_C32(0x45cc75b3), SPH_C32(0x6650b736), - SPH_C32(0xab92f78f), SPH_C32(0xa312567b), SPH_C32(0xdb250000), - SPH_C32(0x09290000), SPH_C32(0x49aac000), SPH_C32(0x81e10000), - SPH_C32(0xcafe6b59), SPH_C32(0x42793431), SPH_C32(0x43566b76), - SPH_C32(0xe86cba2e) }, - { SPH_C32(0x028b0000), SPH_C32(0x87e90001), SPH_C32(0x3c2af380), - SPH_C32(0x2f560000), SPH_C32(0x1f4944d9), SPH_C32(0x79e2e780), - SPH_C32(0x55e03071), SPH_C32(0x32f62e8d), SPH_C32(0xc56b0000), - SPH_C32(0xd7e60000), SPH_C32(0x2452c180), SPH_C32(0xf6c50000), - SPH_C32(0x26b96cc7), SPH_C32(0xb6d95d7f), SPH_C32(0x8ef57364), - SPH_C32(0x70c6f340) }, - { SPH_C32(0xb08d0000), SPH_C32(0x42800001), SPH_C32(0x1429e180), - SPH_C32(0x5b310000), SPH_C32(0xa98b722d), SPH_C32(0x92f0de78), - SPH_C32(0x6631ef9d), SPH_C32(0x3bb81f15), SPH_C32(0x69230000), - SPH_C32(0xcc400000), SPH_C32(0x61a9d200), SPH_C32(0xf5860000), - SPH_C32(0x7c3c5dad), SPH_C32(0xa96b0dc9), SPH_C32(0x7087b49a), - SPH_C32(0xe1228bb6) }, - { SPH_C32(0x1cc50000), SPH_C32(0x59260001), SPH_C32(0x51d2f200), - SPH_C32(0x58720000), SPH_C32(0xf30e4347), SPH_C32(0x8d428ece), - SPH_C32(0x98432863), SPH_C32(0xaa5c67e3), SPH_C32(0x776d0000), - SPH_C32(0x128f0000), SPH_C32(0x0c51d380), SPH_C32(0x82a20000), - SPH_C32(0x907b5a33), SPH_C32(0x5dcb6487), SPH_C32(0xbd24ac88), - SPH_C32(0x7988c2d8) }, - { SPH_C32(0xdb250000), SPH_C32(0x09290000), SPH_C32(0x49aac000), - SPH_C32(0x81e10000), SPH_C32(0xcafe6b59), SPH_C32(0x42793431), - SPH_C32(0x43566b76), SPH_C32(0xe86cba2e), SPH_C32(0x75e60000), - SPH_C32(0x95660001), SPH_C32(0x307b2000), SPH_C32(0xadf40000), - SPH_C32(0x8f321eea), SPH_C32(0x24298307), SPH_C32(0xe8c49cf9), - SPH_C32(0x4b7eec55) }, - { SPH_C32(0x776d0000), SPH_C32(0x128f0000), SPH_C32(0x0c51d380), - SPH_C32(0x82a20000), SPH_C32(0x907b5a33), SPH_C32(0x5dcb6487), - SPH_C32(0xbd24ac88), SPH_C32(0x7988c2d8), SPH_C32(0x6ba80000), - SPH_C32(0x4ba90001), SPH_C32(0x5d832180), SPH_C32(0xdad00000), - SPH_C32(0x63751974), SPH_C32(0xd089ea49), SPH_C32(0x256784eb), - SPH_C32(0xd3d4a53b) }, - { SPH_C32(0xc56b0000), SPH_C32(0xd7e60000), SPH_C32(0x2452c180), - SPH_C32(0xf6c50000), SPH_C32(0x26b96cc7), SPH_C32(0xb6d95d7f), - SPH_C32(0x8ef57364), SPH_C32(0x70c6f340), SPH_C32(0xc7e00000), - SPH_C32(0x500f0001), SPH_C32(0x18783200), SPH_C32(0xd9930000), - SPH_C32(0x39f0281e), SPH_C32(0xcf3bbaff), SPH_C32(0xdb154315), - SPH_C32(0x4230ddcd) }, - { SPH_C32(0x69230000), SPH_C32(0xcc400000), SPH_C32(0x61a9d200), - SPH_C32(0xf5860000), SPH_C32(0x7c3c5dad), SPH_C32(0xa96b0dc9), - SPH_C32(0x7087b49a), SPH_C32(0xe1228bb6), SPH_C32(0xd9ae0000), - SPH_C32(0x8ec00001), SPH_C32(0x75803380), SPH_C32(0xaeb70000), - SPH_C32(0xd5b72f80), SPH_C32(0x3b9bd3b1), SPH_C32(0x16b65b07), - SPH_C32(0xda9a94a3) }, - { SPH_C32(0x75e60000), SPH_C32(0x95660001), SPH_C32(0x307b2000), - SPH_C32(0xadf40000), SPH_C32(0x8f321eea), SPH_C32(0x24298307), - SPH_C32(0xe8c49cf9), SPH_C32(0x4b7eec55), SPH_C32(0xaec30000), - SPH_C32(0x9c4f0001), SPH_C32(0x79d1e000), SPH_C32(0x2c150000), - SPH_C32(0x45cc75b3), SPH_C32(0x6650b736), SPH_C32(0xab92f78f), - SPH_C32(0xa312567b) }, - { SPH_C32(0xd9ae0000), SPH_C32(0x8ec00001), SPH_C32(0x75803380), - SPH_C32(0xaeb70000), SPH_C32(0xd5b72f80), SPH_C32(0x3b9bd3b1), - SPH_C32(0x16b65b07), SPH_C32(0xda9a94a3), SPH_C32(0xb08d0000), - SPH_C32(0x42800001), SPH_C32(0x1429e180), SPH_C32(0x5b310000), - SPH_C32(0xa98b722d), SPH_C32(0x92f0de78), SPH_C32(0x6631ef9d), - SPH_C32(0x3bb81f15) }, - { SPH_C32(0x6ba80000), SPH_C32(0x4ba90001), SPH_C32(0x5d832180), - SPH_C32(0xdad00000), SPH_C32(0x63751974), SPH_C32(0xd089ea49), - SPH_C32(0x256784eb), SPH_C32(0xd3d4a53b), SPH_C32(0x1cc50000), - SPH_C32(0x59260001), SPH_C32(0x51d2f200), SPH_C32(0x58720000), - SPH_C32(0xf30e4347), SPH_C32(0x8d428ece), SPH_C32(0x98432863), - SPH_C32(0xaa5c67e3) }, - { SPH_C32(0xc7e00000), SPH_C32(0x500f0001), SPH_C32(0x18783200), - SPH_C32(0xd9930000), SPH_C32(0x39f0281e), SPH_C32(0xcf3bbaff), - SPH_C32(0xdb154315), SPH_C32(0x4230ddcd), SPH_C32(0x028b0000), - SPH_C32(0x87e90001), SPH_C32(0x3c2af380), SPH_C32(0x2f560000), - SPH_C32(0x1f4944d9), SPH_C32(0x79e2e780), SPH_C32(0x55e03071), - SPH_C32(0x32f62e8d) }, - { SPH_C32(0x86790000), SPH_C32(0x3f390002), SPH_C32(0xe19ae000), - SPH_C32(0x98560000), SPH_C32(0x9565670e), SPH_C32(0x4e88c8ea), - SPH_C32(0xd3dd4944), SPH_C32(0x161ddab9), SPH_C32(0x30b70000), - SPH_C32(0xe5d00000), SPH_C32(0xf4f46000), SPH_C32(0x42c40000), - SPH_C32(0x63b83d6a), SPH_C32(0x78ba9460), SPH_C32(0x21afa1ea), - SPH_C32(0xb0a51834) }, - { SPH_C32(0x2a310000), SPH_C32(0x249f0002), SPH_C32(0xa461f380), - SPH_C32(0x9b150000), SPH_C32(0xcfe05664), SPH_C32(0x513a985c), - SPH_C32(0x2daf8eba), SPH_C32(0x87f9a24f), SPH_C32(0x2ef90000), - SPH_C32(0x3b1f0000), SPH_C32(0x990c6180), SPH_C32(0x35e00000), - SPH_C32(0x8fff3af4), SPH_C32(0x8c1afd2e), SPH_C32(0xec0cb9f8), - SPH_C32(0x280f515a) }, - { SPH_C32(0x98370000), SPH_C32(0xe1f60002), SPH_C32(0x8c62e180), - SPH_C32(0xef720000), SPH_C32(0x79226090), SPH_C32(0xba28a1a4), - SPH_C32(0x1e7e5156), SPH_C32(0x8eb793d7), SPH_C32(0x82b10000), - SPH_C32(0x20b90000), SPH_C32(0xdcf77200), SPH_C32(0x36a30000), - SPH_C32(0xd57a0b9e), SPH_C32(0x93a8ad98), SPH_C32(0x127e7e06), - SPH_C32(0xb9eb29ac) }, - { SPH_C32(0x347f0000), SPH_C32(0xfa500002), SPH_C32(0xc999f200), - SPH_C32(0xec310000), SPH_C32(0x23a751fa), SPH_C32(0xa59af112), - SPH_C32(0xe00c96a8), SPH_C32(0x1f53eb21), SPH_C32(0x9cff0000), - SPH_C32(0xfe760000), SPH_C32(0xb10f7380), SPH_C32(0x41870000), - SPH_C32(0x393d0c00), SPH_C32(0x6708c4d6), SPH_C32(0xdfdd6614), - SPH_C32(0x214160c2) }, - { SPH_C32(0x28ba0000), SPH_C32(0xa3760003), SPH_C32(0x984b0000), - SPH_C32(0xb4430000), SPH_C32(0xd0a912bd), SPH_C32(0x28d87fdc), - SPH_C32(0x784fbecb), SPH_C32(0xb50f8cc2), SPH_C32(0xeb920000), - SPH_C32(0xecf90000), SPH_C32(0xbd5ea000), SPH_C32(0xc3250000), - SPH_C32(0xa9465633), SPH_C32(0x3ac3a051), SPH_C32(0x62f9ca9c), - SPH_C32(0x58c9a21a) }, - { SPH_C32(0x84f20000), SPH_C32(0xb8d00003), SPH_C32(0xddb01380), - SPH_C32(0xb7000000), SPH_C32(0x8a2c23d7), SPH_C32(0x376a2f6a), - SPH_C32(0x863d7935), SPH_C32(0x24ebf434), SPH_C32(0xf5dc0000), - SPH_C32(0x32360000), SPH_C32(0xd0a6a180), SPH_C32(0xb4010000), - SPH_C32(0x450151ad), SPH_C32(0xce63c91f), SPH_C32(0xaf5ad28e), - SPH_C32(0xc063eb74) }, - { SPH_C32(0x36f40000), SPH_C32(0x7db90003), SPH_C32(0xf5b30180), - SPH_C32(0xc3670000), SPH_C32(0x3cee1523), SPH_C32(0xdc781692), - SPH_C32(0xb5eca6d9), SPH_C32(0x2da5c5ac), SPH_C32(0x59940000), - SPH_C32(0x29900000), SPH_C32(0x955db200), SPH_C32(0xb7420000), - SPH_C32(0x1f8460c7), SPH_C32(0xd1d199a9), SPH_C32(0x51281570), - SPH_C32(0x51879382) }, - { SPH_C32(0x9abc0000), SPH_C32(0x661f0003), SPH_C32(0xb0481200), - SPH_C32(0xc0240000), SPH_C32(0x666b2449), SPH_C32(0xc3ca4624), - SPH_C32(0x4b9e6127), SPH_C32(0xbc41bd5a), SPH_C32(0x47da0000), - SPH_C32(0xf75f0000), SPH_C32(0xf8a5b380), SPH_C32(0xc0660000), - SPH_C32(0xf3c36759), SPH_C32(0x2571f0e7), SPH_C32(0x9c8b0d62), - SPH_C32(0xc92ddaec) }, - { SPH_C32(0x5d5c0000), SPH_C32(0x36100002), SPH_C32(0xa8302000), - SPH_C32(0x19b70000), SPH_C32(0x5f9b0c57), SPH_C32(0x0cf1fcdb), - SPH_C32(0x908b2232), SPH_C32(0xfe716097), SPH_C32(0x45510000), - SPH_C32(0x70b60001), SPH_C32(0xc48f4000), SPH_C32(0xef300000), - SPH_C32(0xec8a2380), SPH_C32(0x5c931767), SPH_C32(0xc96b3d13), - SPH_C32(0xfbdbf461) }, - { SPH_C32(0xf1140000), SPH_C32(0x2db60002), SPH_C32(0xedcb3380), - SPH_C32(0x1af40000), SPH_C32(0x051e3d3d), SPH_C32(0x1343ac6d), - SPH_C32(0x6ef9e5cc), SPH_C32(0x6f951861), SPH_C32(0x5b1f0000), - SPH_C32(0xae790001), SPH_C32(0xa9774180), SPH_C32(0x98140000), - SPH_C32(0x00cd241e), SPH_C32(0xa8337e29), SPH_C32(0x04c82501), - SPH_C32(0x6371bd0f) }, - { SPH_C32(0x43120000), SPH_C32(0xe8df0002), SPH_C32(0xc5c82180), - SPH_C32(0x6e930000), SPH_C32(0xb3dc0bc9), SPH_C32(0xf8519595), - SPH_C32(0x5d283a20), SPH_C32(0x66db29f9), SPH_C32(0xf7570000), - SPH_C32(0xb5df0001), SPH_C32(0xec8c5200), SPH_C32(0x9b570000), - SPH_C32(0x5a481574), SPH_C32(0xb7812e9f), SPH_C32(0xfabae2ff), - SPH_C32(0xf295c5f9) }, - { SPH_C32(0xef5a0000), SPH_C32(0xf3790002), SPH_C32(0x80333200), - SPH_C32(0x6dd00000), SPH_C32(0xe9593aa3), SPH_C32(0xe7e3c523), - SPH_C32(0xa35afdde), SPH_C32(0xf73f510f), SPH_C32(0xe9190000), - SPH_C32(0x6b100001), SPH_C32(0x81745380), SPH_C32(0xec730000), - SPH_C32(0xb60f12ea), SPH_C32(0x432147d1), SPH_C32(0x3719faed), - SPH_C32(0x6a3f8c97) }, - { SPH_C32(0xf39f0000), SPH_C32(0xaa5f0003), SPH_C32(0xd1e1c000), - SPH_C32(0x35a20000), SPH_C32(0x1a5779e4), SPH_C32(0x6aa14bed), - SPH_C32(0x3b19d5bd), SPH_C32(0x5d6336ec), SPH_C32(0x9e740000), - SPH_C32(0x799f0001), SPH_C32(0x8d258000), SPH_C32(0x6ed10000), - SPH_C32(0x267448d9), SPH_C32(0x1eea2356), SPH_C32(0x8a3d5665), - SPH_C32(0x13b74e4f) }, - { SPH_C32(0x5fd70000), SPH_C32(0xb1f90003), SPH_C32(0x941ad380), - SPH_C32(0x36e10000), SPH_C32(0x40d2488e), SPH_C32(0x75131b5b), - SPH_C32(0xc56b1243), SPH_C32(0xcc874e1a), SPH_C32(0x803a0000), - SPH_C32(0xa7500001), SPH_C32(0xe0dd8180), SPH_C32(0x19f50000), - SPH_C32(0xca334f47), SPH_C32(0xea4a4a18), SPH_C32(0x479e4e77), - SPH_C32(0x8b1d0721) }, - { SPH_C32(0xedd10000), SPH_C32(0x74900003), SPH_C32(0xbc19c180), - SPH_C32(0x42860000), SPH_C32(0xf6107e7a), SPH_C32(0x9e0122a3), - SPH_C32(0xf6bacdaf), SPH_C32(0xc5c97f82), SPH_C32(0x2c720000), - SPH_C32(0xbcf60001), SPH_C32(0xa5269200), SPH_C32(0x1ab60000), - SPH_C32(0x90b67e2d), SPH_C32(0xf5f81aae), SPH_C32(0xb9ec8989), - SPH_C32(0x1af97fd7) }, - { SPH_C32(0x41990000), SPH_C32(0x6f360003), SPH_C32(0xf9e2d200), - SPH_C32(0x41c50000), SPH_C32(0xac954f10), SPH_C32(0x81b37215), - SPH_C32(0x08c80a51), SPH_C32(0x542d0774), SPH_C32(0x323c0000), - SPH_C32(0x62390001), SPH_C32(0xc8de9380), SPH_C32(0x6d920000), - SPH_C32(0x7cf179b3), SPH_C32(0x015873e0), SPH_C32(0x744f919b), - SPH_C32(0x825336b9) }, - { SPH_C32(0x30b70000), SPH_C32(0xe5d00000), SPH_C32(0xf4f46000), - SPH_C32(0x42c40000), SPH_C32(0x63b83d6a), SPH_C32(0x78ba9460), - SPH_C32(0x21afa1ea), SPH_C32(0xb0a51834), SPH_C32(0xb6ce0000), - SPH_C32(0xdae90002), SPH_C32(0x156e8000), SPH_C32(0xda920000), - SPH_C32(0xf6dd5a64), SPH_C32(0x36325c8a), SPH_C32(0xf272e8ae), - SPH_C32(0xa6b8c28d) }, - { SPH_C32(0x9cff0000), SPH_C32(0xfe760000), SPH_C32(0xb10f7380), - SPH_C32(0x41870000), SPH_C32(0x393d0c00), SPH_C32(0x6708c4d6), - SPH_C32(0xdfdd6614), SPH_C32(0x214160c2), SPH_C32(0xa8800000), - SPH_C32(0x04260002), SPH_C32(0x78968180), SPH_C32(0xadb60000), - SPH_C32(0x1a9a5dfa), SPH_C32(0xc29235c4), SPH_C32(0x3fd1f0bc), - SPH_C32(0x3e128be3) }, - { SPH_C32(0x2ef90000), SPH_C32(0x3b1f0000), SPH_C32(0x990c6180), - SPH_C32(0x35e00000), SPH_C32(0x8fff3af4), SPH_C32(0x8c1afd2e), - SPH_C32(0xec0cb9f8), SPH_C32(0x280f515a), SPH_C32(0x04c80000), - SPH_C32(0x1f800002), SPH_C32(0x3d6d9200), SPH_C32(0xaef50000), - SPH_C32(0x401f6c90), SPH_C32(0xdd206572), SPH_C32(0xc1a33742), - SPH_C32(0xaff6f315) }, - { SPH_C32(0x82b10000), SPH_C32(0x20b90000), SPH_C32(0xdcf77200), - SPH_C32(0x36a30000), SPH_C32(0xd57a0b9e), SPH_C32(0x93a8ad98), - SPH_C32(0x127e7e06), SPH_C32(0xb9eb29ac), SPH_C32(0x1a860000), - SPH_C32(0xc14f0002), SPH_C32(0x50959380), SPH_C32(0xd9d10000), - SPH_C32(0xac586b0e), SPH_C32(0x29800c3c), SPH_C32(0x0c002f50), - SPH_C32(0x375cba7b) }, - { SPH_C32(0x9e740000), SPH_C32(0x799f0001), SPH_C32(0x8d258000), - SPH_C32(0x6ed10000), SPH_C32(0x267448d9), SPH_C32(0x1eea2356), - SPH_C32(0x8a3d5665), SPH_C32(0x13b74e4f), SPH_C32(0x6deb0000), - SPH_C32(0xd3c00002), SPH_C32(0x5cc44000), SPH_C32(0x5b730000), - SPH_C32(0x3c23313d), SPH_C32(0x744b68bb), SPH_C32(0xb12483d8), - SPH_C32(0x4ed478a3) }, - { SPH_C32(0x323c0000), SPH_C32(0x62390001), SPH_C32(0xc8de9380), - SPH_C32(0x6d920000), SPH_C32(0x7cf179b3), SPH_C32(0x015873e0), - SPH_C32(0x744f919b), SPH_C32(0x825336b9), SPH_C32(0x73a50000), - SPH_C32(0x0d0f0002), SPH_C32(0x313c4180), SPH_C32(0x2c570000), - SPH_C32(0xd06436a3), SPH_C32(0x80eb01f5), SPH_C32(0x7c879bca), - SPH_C32(0xd67e31cd) }, - { SPH_C32(0x803a0000), SPH_C32(0xa7500001), SPH_C32(0xe0dd8180), - SPH_C32(0x19f50000), SPH_C32(0xca334f47), SPH_C32(0xea4a4a18), - SPH_C32(0x479e4e77), SPH_C32(0x8b1d0721), SPH_C32(0xdfed0000), - SPH_C32(0x16a90002), SPH_C32(0x74c75200), SPH_C32(0x2f140000), - SPH_C32(0x8ae107c9), SPH_C32(0x9f595143), SPH_C32(0x82f55c34), - SPH_C32(0x479a493b) }, - { SPH_C32(0x2c720000), SPH_C32(0xbcf60001), SPH_C32(0xa5269200), - SPH_C32(0x1ab60000), SPH_C32(0x90b67e2d), SPH_C32(0xf5f81aae), - SPH_C32(0xb9ec8989), SPH_C32(0x1af97fd7), SPH_C32(0xc1a30000), - SPH_C32(0xc8660002), SPH_C32(0x193f5380), SPH_C32(0x58300000), - SPH_C32(0x66a60057), SPH_C32(0x6bf9380d), SPH_C32(0x4f564426), - SPH_C32(0xdf300055) }, - { SPH_C32(0xeb920000), SPH_C32(0xecf90000), SPH_C32(0xbd5ea000), - SPH_C32(0xc3250000), SPH_C32(0xa9465633), SPH_C32(0x3ac3a051), - SPH_C32(0x62f9ca9c), SPH_C32(0x58c9a21a), SPH_C32(0xc3280000), - SPH_C32(0x4f8f0003), SPH_C32(0x2515a000), SPH_C32(0x77660000), - SPH_C32(0x79ef448e), SPH_C32(0x121bdf8d), SPH_C32(0x1ab67457), - SPH_C32(0xedc62ed8) }, - { SPH_C32(0x47da0000), SPH_C32(0xf75f0000), SPH_C32(0xf8a5b380), - SPH_C32(0xc0660000), SPH_C32(0xf3c36759), SPH_C32(0x2571f0e7), - SPH_C32(0x9c8b0d62), SPH_C32(0xc92ddaec), SPH_C32(0xdd660000), - SPH_C32(0x91400003), SPH_C32(0x48eda180), SPH_C32(0x00420000), - SPH_C32(0x95a84310), SPH_C32(0xe6bbb6c3), SPH_C32(0xd7156c45), - SPH_C32(0x756c67b6) }, - { SPH_C32(0xf5dc0000), SPH_C32(0x32360000), SPH_C32(0xd0a6a180), - SPH_C32(0xb4010000), SPH_C32(0x450151ad), SPH_C32(0xce63c91f), - SPH_C32(0xaf5ad28e), SPH_C32(0xc063eb74), SPH_C32(0x712e0000), - SPH_C32(0x8ae60003), SPH_C32(0x0d16b200), SPH_C32(0x03010000), - SPH_C32(0xcf2d727a), SPH_C32(0xf909e675), SPH_C32(0x2967abbb), - SPH_C32(0xe4881f40) }, - { SPH_C32(0x59940000), SPH_C32(0x29900000), SPH_C32(0x955db200), - SPH_C32(0xb7420000), SPH_C32(0x1f8460c7), SPH_C32(0xd1d199a9), - SPH_C32(0x51281570), SPH_C32(0x51879382), SPH_C32(0x6f600000), - SPH_C32(0x54290003), SPH_C32(0x60eeb380), SPH_C32(0x74250000), - SPH_C32(0x236a75e4), SPH_C32(0x0da98f3b), SPH_C32(0xe4c4b3a9), - SPH_C32(0x7c22562e) }, - { SPH_C32(0x45510000), SPH_C32(0x70b60001), SPH_C32(0xc48f4000), - SPH_C32(0xef300000), SPH_C32(0xec8a2380), SPH_C32(0x5c931767), - SPH_C32(0xc96b3d13), SPH_C32(0xfbdbf461), SPH_C32(0x180d0000), - SPH_C32(0x46a60003), SPH_C32(0x6cbf6000), SPH_C32(0xf6870000), - SPH_C32(0xb3112fd7), SPH_C32(0x5062ebbc), SPH_C32(0x59e01f21), - SPH_C32(0x05aa94f6) }, - { SPH_C32(0xe9190000), SPH_C32(0x6b100001), SPH_C32(0x81745380), - SPH_C32(0xec730000), SPH_C32(0xb60f12ea), SPH_C32(0x432147d1), - SPH_C32(0x3719faed), SPH_C32(0x6a3f8c97), SPH_C32(0x06430000), - SPH_C32(0x98690003), SPH_C32(0x01476180), SPH_C32(0x81a30000), - SPH_C32(0x5f562849), SPH_C32(0xa4c282f2), SPH_C32(0x94430733), - SPH_C32(0x9d00dd98) }, - { SPH_C32(0x5b1f0000), SPH_C32(0xae790001), SPH_C32(0xa9774180), - SPH_C32(0x98140000), SPH_C32(0x00cd241e), SPH_C32(0xa8337e29), - SPH_C32(0x04c82501), SPH_C32(0x6371bd0f), SPH_C32(0xaa0b0000), - SPH_C32(0x83cf0003), SPH_C32(0x44bc7200), SPH_C32(0x82e00000), - SPH_C32(0x05d31923), SPH_C32(0xbb70d244), SPH_C32(0x6a31c0cd), - SPH_C32(0x0ce4a56e) }, - { SPH_C32(0xf7570000), SPH_C32(0xb5df0001), SPH_C32(0xec8c5200), - SPH_C32(0x9b570000), SPH_C32(0x5a481574), SPH_C32(0xb7812e9f), - SPH_C32(0xfabae2ff), SPH_C32(0xf295c5f9), SPH_C32(0xb4450000), - SPH_C32(0x5d000003), SPH_C32(0x29447380), SPH_C32(0xf5c40000), - SPH_C32(0xe9941ebd), SPH_C32(0x4fd0bb0a), SPH_C32(0xa792d8df), - SPH_C32(0x944eec00) }, - { SPH_C32(0xb6ce0000), SPH_C32(0xdae90002), SPH_C32(0x156e8000), - SPH_C32(0xda920000), SPH_C32(0xf6dd5a64), SPH_C32(0x36325c8a), - SPH_C32(0xf272e8ae), SPH_C32(0xa6b8c28d), SPH_C32(0x86790000), - SPH_C32(0x3f390002), SPH_C32(0xe19ae000), SPH_C32(0x98560000), - SPH_C32(0x9565670e), SPH_C32(0x4e88c8ea), SPH_C32(0xd3dd4944), - SPH_C32(0x161ddab9) }, - { SPH_C32(0x1a860000), SPH_C32(0xc14f0002), SPH_C32(0x50959380), - SPH_C32(0xd9d10000), SPH_C32(0xac586b0e), SPH_C32(0x29800c3c), - SPH_C32(0x0c002f50), SPH_C32(0x375cba7b), SPH_C32(0x98370000), - SPH_C32(0xe1f60002), SPH_C32(0x8c62e180), SPH_C32(0xef720000), - SPH_C32(0x79226090), SPH_C32(0xba28a1a4), SPH_C32(0x1e7e5156), - SPH_C32(0x8eb793d7) }, - { SPH_C32(0xa8800000), SPH_C32(0x04260002), SPH_C32(0x78968180), - SPH_C32(0xadb60000), SPH_C32(0x1a9a5dfa), SPH_C32(0xc29235c4), - SPH_C32(0x3fd1f0bc), SPH_C32(0x3e128be3), SPH_C32(0x347f0000), - SPH_C32(0xfa500002), SPH_C32(0xc999f200), SPH_C32(0xec310000), - SPH_C32(0x23a751fa), SPH_C32(0xa59af112), SPH_C32(0xe00c96a8), - SPH_C32(0x1f53eb21) }, - { SPH_C32(0x04c80000), SPH_C32(0x1f800002), SPH_C32(0x3d6d9200), - SPH_C32(0xaef50000), SPH_C32(0x401f6c90), SPH_C32(0xdd206572), - SPH_C32(0xc1a33742), SPH_C32(0xaff6f315), SPH_C32(0x2a310000), - SPH_C32(0x249f0002), SPH_C32(0xa461f380), SPH_C32(0x9b150000), - SPH_C32(0xcfe05664), SPH_C32(0x513a985c), SPH_C32(0x2daf8eba), - SPH_C32(0x87f9a24f) }, - { SPH_C32(0x180d0000), SPH_C32(0x46a60003), SPH_C32(0x6cbf6000), - SPH_C32(0xf6870000), SPH_C32(0xb3112fd7), SPH_C32(0x5062ebbc), - SPH_C32(0x59e01f21), SPH_C32(0x05aa94f6), SPH_C32(0x5d5c0000), - SPH_C32(0x36100002), SPH_C32(0xa8302000), SPH_C32(0x19b70000), - SPH_C32(0x5f9b0c57), SPH_C32(0x0cf1fcdb), SPH_C32(0x908b2232), - SPH_C32(0xfe716097) }, - { SPH_C32(0xb4450000), SPH_C32(0x5d000003), SPH_C32(0x29447380), - SPH_C32(0xf5c40000), SPH_C32(0xe9941ebd), SPH_C32(0x4fd0bb0a), - SPH_C32(0xa792d8df), SPH_C32(0x944eec00), SPH_C32(0x43120000), - SPH_C32(0xe8df0002), SPH_C32(0xc5c82180), SPH_C32(0x6e930000), - SPH_C32(0xb3dc0bc9), SPH_C32(0xf8519595), SPH_C32(0x5d283a20), - SPH_C32(0x66db29f9) }, - { SPH_C32(0x06430000), SPH_C32(0x98690003), SPH_C32(0x01476180), - SPH_C32(0x81a30000), SPH_C32(0x5f562849), SPH_C32(0xa4c282f2), - SPH_C32(0x94430733), SPH_C32(0x9d00dd98), SPH_C32(0xef5a0000), - SPH_C32(0xf3790002), SPH_C32(0x80333200), SPH_C32(0x6dd00000), - SPH_C32(0xe9593aa3), SPH_C32(0xe7e3c523), SPH_C32(0xa35afdde), - SPH_C32(0xf73f510f) }, - { SPH_C32(0xaa0b0000), SPH_C32(0x83cf0003), SPH_C32(0x44bc7200), - SPH_C32(0x82e00000), SPH_C32(0x05d31923), SPH_C32(0xbb70d244), - SPH_C32(0x6a31c0cd), SPH_C32(0x0ce4a56e), SPH_C32(0xf1140000), - SPH_C32(0x2db60002), SPH_C32(0xedcb3380), SPH_C32(0x1af40000), - SPH_C32(0x051e3d3d), SPH_C32(0x1343ac6d), SPH_C32(0x6ef9e5cc), - SPH_C32(0x6f951861) }, - { SPH_C32(0x6deb0000), SPH_C32(0xd3c00002), SPH_C32(0x5cc44000), - SPH_C32(0x5b730000), SPH_C32(0x3c23313d), SPH_C32(0x744b68bb), - SPH_C32(0xb12483d8), SPH_C32(0x4ed478a3), SPH_C32(0xf39f0000), - SPH_C32(0xaa5f0003), SPH_C32(0xd1e1c000), SPH_C32(0x35a20000), - SPH_C32(0x1a5779e4), SPH_C32(0x6aa14bed), SPH_C32(0x3b19d5bd), - SPH_C32(0x5d6336ec) }, - { SPH_C32(0xc1a30000), SPH_C32(0xc8660002), SPH_C32(0x193f5380), - SPH_C32(0x58300000), SPH_C32(0x66a60057), SPH_C32(0x6bf9380d), - SPH_C32(0x4f564426), SPH_C32(0xdf300055), SPH_C32(0xedd10000), - SPH_C32(0x74900003), SPH_C32(0xbc19c180), SPH_C32(0x42860000), - SPH_C32(0xf6107e7a), SPH_C32(0x9e0122a3), SPH_C32(0xf6bacdaf), - SPH_C32(0xc5c97f82) }, - { SPH_C32(0x73a50000), SPH_C32(0x0d0f0002), SPH_C32(0x313c4180), - SPH_C32(0x2c570000), SPH_C32(0xd06436a3), SPH_C32(0x80eb01f5), - SPH_C32(0x7c879bca), SPH_C32(0xd67e31cd), SPH_C32(0x41990000), - SPH_C32(0x6f360003), SPH_C32(0xf9e2d200), SPH_C32(0x41c50000), - SPH_C32(0xac954f10), SPH_C32(0x81b37215), SPH_C32(0x08c80a51), - SPH_C32(0x542d0774) }, - { SPH_C32(0xdfed0000), SPH_C32(0x16a90002), SPH_C32(0x74c75200), - SPH_C32(0x2f140000), SPH_C32(0x8ae107c9), SPH_C32(0x9f595143), - SPH_C32(0x82f55c34), SPH_C32(0x479a493b), SPH_C32(0x5fd70000), - SPH_C32(0xb1f90003), SPH_C32(0x941ad380), SPH_C32(0x36e10000), - SPH_C32(0x40d2488e), SPH_C32(0x75131b5b), SPH_C32(0xc56b1243), - SPH_C32(0xcc874e1a) }, - { SPH_C32(0xc3280000), SPH_C32(0x4f8f0003), SPH_C32(0x2515a000), - SPH_C32(0x77660000), SPH_C32(0x79ef448e), SPH_C32(0x121bdf8d), - SPH_C32(0x1ab67457), SPH_C32(0xedc62ed8), SPH_C32(0x28ba0000), - SPH_C32(0xa3760003), SPH_C32(0x984b0000), SPH_C32(0xb4430000), - SPH_C32(0xd0a912bd), SPH_C32(0x28d87fdc), SPH_C32(0x784fbecb), - SPH_C32(0xb50f8cc2) }, - { SPH_C32(0x6f600000), SPH_C32(0x54290003), SPH_C32(0x60eeb380), - SPH_C32(0x74250000), SPH_C32(0x236a75e4), SPH_C32(0x0da98f3b), - SPH_C32(0xe4c4b3a9), SPH_C32(0x7c22562e), SPH_C32(0x36f40000), - SPH_C32(0x7db90003), SPH_C32(0xf5b30180), SPH_C32(0xc3670000), - SPH_C32(0x3cee1523), SPH_C32(0xdc781692), SPH_C32(0xb5eca6d9), - SPH_C32(0x2da5c5ac) }, - { SPH_C32(0xdd660000), SPH_C32(0x91400003), SPH_C32(0x48eda180), - SPH_C32(0x00420000), SPH_C32(0x95a84310), SPH_C32(0xe6bbb6c3), - SPH_C32(0xd7156c45), SPH_C32(0x756c67b6), SPH_C32(0x9abc0000), - SPH_C32(0x661f0003), SPH_C32(0xb0481200), SPH_C32(0xc0240000), - SPH_C32(0x666b2449), SPH_C32(0xc3ca4624), SPH_C32(0x4b9e6127), - SPH_C32(0xbc41bd5a) }, - { SPH_C32(0x712e0000), SPH_C32(0x8ae60003), SPH_C32(0x0d16b200), - SPH_C32(0x03010000), SPH_C32(0xcf2d727a), SPH_C32(0xf909e675), - SPH_C32(0x2967abbb), SPH_C32(0xe4881f40), SPH_C32(0x84f20000), - SPH_C32(0xb8d00003), SPH_C32(0xddb01380), SPH_C32(0xb7000000), - SPH_C32(0x8a2c23d7), SPH_C32(0x376a2f6a), SPH_C32(0x863d7935), - SPH_C32(0x24ebf434) } -}; - -static const sph_u32 T512_36[64][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x52500000), SPH_C32(0x29540000), SPH_C32(0x6a61004e), - SPH_C32(0xf0ff0000), SPH_C32(0x9a317eec), SPH_C32(0x452341ce), - SPH_C32(0xcf568fe5), SPH_C32(0x5303130f), SPH_C32(0x538d0000), - SPH_C32(0xa9fc0000), SPH_C32(0x9ef70006), SPH_C32(0x56ff0000), - SPH_C32(0x0ae4004e), SPH_C32(0x92c5cdf9), SPH_C32(0xa9444018), - SPH_C32(0x7f975691) }, - { SPH_C32(0x538d0000), SPH_C32(0xa9fc0000), SPH_C32(0x9ef70006), - SPH_C32(0x56ff0000), SPH_C32(0x0ae4004e), SPH_C32(0x92c5cdf9), - SPH_C32(0xa9444018), SPH_C32(0x7f975691), SPH_C32(0x01dd0000), - SPH_C32(0x80a80000), SPH_C32(0xf4960048), SPH_C32(0xa6000000), - SPH_C32(0x90d57ea2), SPH_C32(0xd7e68c37), SPH_C32(0x6612cffd), - SPH_C32(0x2c94459e) }, - { SPH_C32(0x01dd0000), SPH_C32(0x80a80000), SPH_C32(0xf4960048), - SPH_C32(0xa6000000), SPH_C32(0x90d57ea2), SPH_C32(0xd7e68c37), - SPH_C32(0x6612cffd), SPH_C32(0x2c94459e), SPH_C32(0x52500000), - SPH_C32(0x29540000), SPH_C32(0x6a61004e), SPH_C32(0xf0ff0000), - SPH_C32(0x9a317eec), SPH_C32(0x452341ce), SPH_C32(0xcf568fe5), - SPH_C32(0x5303130f) }, - { SPH_C32(0xcc140000), SPH_C32(0xa5630000), SPH_C32(0x5ab90780), - SPH_C32(0x3b500000), SPH_C32(0x4bd013ff), SPH_C32(0x879b3418), - SPH_C32(0x694348c1), SPH_C32(0xca5a87fe), SPH_C32(0x819e0000), - SPH_C32(0xec570000), SPH_C32(0x66320280), SPH_C32(0x95f30000), - SPH_C32(0x5da92802), SPH_C32(0x48f43cbc), SPH_C32(0xe65aa22d), - SPH_C32(0x8e67b7fa) }, - { SPH_C32(0x9e440000), SPH_C32(0x8c370000), SPH_C32(0x30d807ce), - SPH_C32(0xcbaf0000), SPH_C32(0xd1e16d13), SPH_C32(0xc2b875d6), - SPH_C32(0xa615c724), SPH_C32(0x995994f1), SPH_C32(0xd2130000), - SPH_C32(0x45ab0000), SPH_C32(0xf8c50286), SPH_C32(0xc30c0000), - SPH_C32(0x574d284c), SPH_C32(0xda31f145), SPH_C32(0x4f1ee235), - SPH_C32(0xf1f0e16b) }, - { SPH_C32(0x9f990000), SPH_C32(0x0c9f0000), SPH_C32(0xc44e0786), - SPH_C32(0x6daf0000), SPH_C32(0x413413b1), SPH_C32(0x155ef9e1), - SPH_C32(0xc00708d9), SPH_C32(0xb5cdd16f), SPH_C32(0x80430000), - SPH_C32(0x6cff0000), SPH_C32(0x92a402c8), SPH_C32(0x33f30000), - SPH_C32(0xcd7c56a0), SPH_C32(0x9f12b08b), SPH_C32(0x80486dd0), - SPH_C32(0xa2f3f264) }, - { SPH_C32(0xcdc90000), SPH_C32(0x25cb0000), SPH_C32(0xae2f07c8), - SPH_C32(0x9d500000), SPH_C32(0xdb056d5d), SPH_C32(0x507db82f), - SPH_C32(0x0f51873c), SPH_C32(0xe6cec260), SPH_C32(0xd3ce0000), - SPH_C32(0xc5030000), SPH_C32(0x0c5302ce), SPH_C32(0x650c0000), - SPH_C32(0xc79856ee), SPH_C32(0x0dd77d72), SPH_C32(0x290c2dc8), - SPH_C32(0xdd64a4f5) }, - { SPH_C32(0x819e0000), SPH_C32(0xec570000), SPH_C32(0x66320280), - SPH_C32(0x95f30000), SPH_C32(0x5da92802), SPH_C32(0x48f43cbc), - SPH_C32(0xe65aa22d), SPH_C32(0x8e67b7fa), SPH_C32(0x4d8a0000), - SPH_C32(0x49340000), SPH_C32(0x3c8b0500), SPH_C32(0xaea30000), - SPH_C32(0x16793bfd), SPH_C32(0xcf6f08a4), SPH_C32(0x8f19eaec), - SPH_C32(0x443d3004) }, - { SPH_C32(0xd3ce0000), SPH_C32(0xc5030000), SPH_C32(0x0c5302ce), - SPH_C32(0x650c0000), SPH_C32(0xc79856ee), SPH_C32(0x0dd77d72), - SPH_C32(0x290c2dc8), SPH_C32(0xdd64a4f5), SPH_C32(0x1e070000), - SPH_C32(0xe0c80000), SPH_C32(0xa27c0506), SPH_C32(0xf85c0000), - SPH_C32(0x1c9d3bb3), SPH_C32(0x5daac55d), SPH_C32(0x265daaf4), - SPH_C32(0x3baa6695) }, - { SPH_C32(0xd2130000), SPH_C32(0x45ab0000), SPH_C32(0xf8c50286), - SPH_C32(0xc30c0000), SPH_C32(0x574d284c), SPH_C32(0xda31f145), - SPH_C32(0x4f1ee235), SPH_C32(0xf1f0e16b), SPH_C32(0x4c570000), - SPH_C32(0xc99c0000), SPH_C32(0xc81d0548), SPH_C32(0x08a30000), - SPH_C32(0x86ac455f), SPH_C32(0x18898493), SPH_C32(0xe90b2511), - SPH_C32(0x68a9759a) }, - { SPH_C32(0x80430000), SPH_C32(0x6cff0000), SPH_C32(0x92a402c8), - SPH_C32(0x33f30000), SPH_C32(0xcd7c56a0), SPH_C32(0x9f12b08b), - SPH_C32(0x80486dd0), SPH_C32(0xa2f3f264), SPH_C32(0x1fda0000), - SPH_C32(0x60600000), SPH_C32(0x56ea054e), SPH_C32(0x5e5c0000), - SPH_C32(0x8c484511), SPH_C32(0x8a4c496a), SPH_C32(0x404f6509), - SPH_C32(0x173e230b) }, - { SPH_C32(0x4d8a0000), SPH_C32(0x49340000), SPH_C32(0x3c8b0500), - SPH_C32(0xaea30000), SPH_C32(0x16793bfd), SPH_C32(0xcf6f08a4), - SPH_C32(0x8f19eaec), SPH_C32(0x443d3004), SPH_C32(0xcc140000), - SPH_C32(0xa5630000), SPH_C32(0x5ab90780), SPH_C32(0x3b500000), - SPH_C32(0x4bd013ff), SPH_C32(0x879b3418), SPH_C32(0x694348c1), - SPH_C32(0xca5a87fe) }, - { SPH_C32(0x1fda0000), SPH_C32(0x60600000), SPH_C32(0x56ea054e), - SPH_C32(0x5e5c0000), SPH_C32(0x8c484511), SPH_C32(0x8a4c496a), - SPH_C32(0x404f6509), SPH_C32(0x173e230b), SPH_C32(0x9f990000), - SPH_C32(0x0c9f0000), SPH_C32(0xc44e0786), SPH_C32(0x6daf0000), - SPH_C32(0x413413b1), SPH_C32(0x155ef9e1), SPH_C32(0xc00708d9), - SPH_C32(0xb5cdd16f) }, - { SPH_C32(0x1e070000), SPH_C32(0xe0c80000), SPH_C32(0xa27c0506), - SPH_C32(0xf85c0000), SPH_C32(0x1c9d3bb3), SPH_C32(0x5daac55d), - SPH_C32(0x265daaf4), SPH_C32(0x3baa6695), SPH_C32(0xcdc90000), - SPH_C32(0x25cb0000), SPH_C32(0xae2f07c8), SPH_C32(0x9d500000), - SPH_C32(0xdb056d5d), SPH_C32(0x507db82f), SPH_C32(0x0f51873c), - SPH_C32(0xe6cec260) }, - { SPH_C32(0x4c570000), SPH_C32(0xc99c0000), SPH_C32(0xc81d0548), - SPH_C32(0x08a30000), SPH_C32(0x86ac455f), SPH_C32(0x18898493), - SPH_C32(0xe90b2511), SPH_C32(0x68a9759a), SPH_C32(0x9e440000), - SPH_C32(0x8c370000), SPH_C32(0x30d807ce), SPH_C32(0xcbaf0000), - SPH_C32(0xd1e16d13), SPH_C32(0xc2b875d6), SPH_C32(0xa615c724), - SPH_C32(0x995994f1) }, - { SPH_C32(0x78230000), SPH_C32(0x12fc0000), SPH_C32(0xa93a0b80), - SPH_C32(0x90a50000), SPH_C32(0x713e2879), SPH_C32(0x7ee98924), - SPH_C32(0xf08ca062), SPH_C32(0x636f8bab), SPH_C32(0x02af0000), - SPH_C32(0xb7280000), SPH_C32(0xba1c0300), SPH_C32(0x56980000), - SPH_C32(0xba8d45d3), SPH_C32(0x8048c667), SPH_C32(0xa95c149a), - SPH_C32(0xf4f6ea7b) }, - { SPH_C32(0x2a730000), SPH_C32(0x3ba80000), SPH_C32(0xc35b0bce), - SPH_C32(0x605a0000), SPH_C32(0xeb0f5695), SPH_C32(0x3bcac8ea), - SPH_C32(0x3fda2f87), SPH_C32(0x306c98a4), SPH_C32(0x51220000), - SPH_C32(0x1ed40000), SPH_C32(0x24eb0306), SPH_C32(0x00670000), - SPH_C32(0xb069459d), SPH_C32(0x128d0b9e), SPH_C32(0x00185482), - SPH_C32(0x8b61bcea) }, - { SPH_C32(0x2bae0000), SPH_C32(0xbb000000), SPH_C32(0x37cd0b86), - SPH_C32(0xc65a0000), SPH_C32(0x7bda2837), SPH_C32(0xec2c44dd), - SPH_C32(0x59c8e07a), SPH_C32(0x1cf8dd3a), SPH_C32(0x03720000), - SPH_C32(0x37800000), SPH_C32(0x4e8a0348), SPH_C32(0xf0980000), - SPH_C32(0x2a583b71), SPH_C32(0x57ae4a50), SPH_C32(0xcf4edb67), - SPH_C32(0xd862afe5) }, - { SPH_C32(0x79fe0000), SPH_C32(0x92540000), SPH_C32(0x5dac0bc8), - SPH_C32(0x36a50000), SPH_C32(0xe1eb56db), SPH_C32(0xa90f0513), - SPH_C32(0x969e6f9f), SPH_C32(0x4ffbce35), SPH_C32(0x50ff0000), - SPH_C32(0x9e7c0000), SPH_C32(0xd07d034e), SPH_C32(0xa6670000), - SPH_C32(0x20bc3b3f), SPH_C32(0xc56b87a9), SPH_C32(0x660a9b7f), - SPH_C32(0xa7f5f974) }, - { SPH_C32(0xb4370000), SPH_C32(0xb79f0000), SPH_C32(0xf3830c00), - SPH_C32(0xabf50000), SPH_C32(0x3aee3b86), SPH_C32(0xf972bd3c), - SPH_C32(0x99cfe8a3), SPH_C32(0xa9350c55), SPH_C32(0x83310000), - SPH_C32(0x5b7f0000), SPH_C32(0xdc2e0180), SPH_C32(0xc36b0000), - SPH_C32(0xe7246dd1), SPH_C32(0xc8bcfadb), SPH_C32(0x4f06b6b7), - SPH_C32(0x7a915d81) }, - { SPH_C32(0xe6670000), SPH_C32(0x9ecb0000), SPH_C32(0x99e20c4e), - SPH_C32(0x5b0a0000), SPH_C32(0xa0df456a), SPH_C32(0xbc51fcf2), - SPH_C32(0x56996746), SPH_C32(0xfa361f5a), SPH_C32(0xd0bc0000), - SPH_C32(0xf2830000), SPH_C32(0x42d90186), SPH_C32(0x95940000), - SPH_C32(0xedc06d9f), SPH_C32(0x5a793722), SPH_C32(0xe642f6af), - SPH_C32(0x05060b10) }, - { SPH_C32(0xe7ba0000), SPH_C32(0x1e630000), SPH_C32(0x6d740c06), - SPH_C32(0xfd0a0000), SPH_C32(0x300a3bc8), SPH_C32(0x6bb770c5), - SPH_C32(0x308ba8bb), SPH_C32(0xd6a25ac4), SPH_C32(0x82ec0000), - SPH_C32(0xdbd70000), SPH_C32(0x28b801c8), SPH_C32(0x656b0000), - SPH_C32(0x77f11373), SPH_C32(0x1f5a76ec), SPH_C32(0x2914794a), - SPH_C32(0x5605181f) }, - { SPH_C32(0xb5ea0000), SPH_C32(0x37370000), SPH_C32(0x07150c48), - SPH_C32(0x0df50000), SPH_C32(0xaa3b4524), SPH_C32(0x2e94310b), - SPH_C32(0xffdd275e), SPH_C32(0x85a149cb), SPH_C32(0xd1610000), - SPH_C32(0x722b0000), SPH_C32(0xb64f01ce), SPH_C32(0x33940000), - SPH_C32(0x7d15133d), SPH_C32(0x8d9fbb15), SPH_C32(0x80503952), - SPH_C32(0x29924e8e) }, - { SPH_C32(0xf9bd0000), SPH_C32(0xfeab0000), SPH_C32(0xcf080900), - SPH_C32(0x05560000), SPH_C32(0x2c97007b), SPH_C32(0x361db598), - SPH_C32(0x16d6024f), SPH_C32(0xed083c51), SPH_C32(0x4f250000), - SPH_C32(0xfe1c0000), SPH_C32(0x86970600), SPH_C32(0xf83b0000), - SPH_C32(0xacf47e2e), SPH_C32(0x4f27cec3), SPH_C32(0x2645fe76), - SPH_C32(0xb0cbda7f) }, - { SPH_C32(0xabed0000), SPH_C32(0xd7ff0000), SPH_C32(0xa569094e), - SPH_C32(0xf5a90000), SPH_C32(0xb6a67e97), SPH_C32(0x733ef456), - SPH_C32(0xd9808daa), SPH_C32(0xbe0b2f5e), SPH_C32(0x1ca80000), - SPH_C32(0x57e00000), SPH_C32(0x18600606), SPH_C32(0xaec40000), - SPH_C32(0xa6107e60), SPH_C32(0xdde2033a), SPH_C32(0x8f01be6e), - SPH_C32(0xcf5c8cee) }, - { SPH_C32(0xaa300000), SPH_C32(0x57570000), SPH_C32(0x51ff0906), - SPH_C32(0x53a90000), SPH_C32(0x26730035), SPH_C32(0xa4d87861), - SPH_C32(0xbf924257), SPH_C32(0x929f6ac0), SPH_C32(0x4ef80000), - SPH_C32(0x7eb40000), SPH_C32(0x72010648), SPH_C32(0x5e3b0000), - SPH_C32(0x3c21008c), SPH_C32(0x98c142f4), SPH_C32(0x4057318b), - SPH_C32(0x9c5f9fe1) }, - { SPH_C32(0xf8600000), SPH_C32(0x7e030000), SPH_C32(0x3b9e0948), - SPH_C32(0xa3560000), SPH_C32(0xbc427ed9), SPH_C32(0xe1fb39af), - SPH_C32(0x70c4cdb2), SPH_C32(0xc19c79cf), SPH_C32(0x1d750000), - SPH_C32(0xd7480000), SPH_C32(0xecf6064e), SPH_C32(0x08c40000), - SPH_C32(0x36c500c2), SPH_C32(0x0a048f0d), SPH_C32(0xe9137193), - SPH_C32(0xe3c8c970) }, - { SPH_C32(0x35a90000), SPH_C32(0x5bc80000), SPH_C32(0x95b10e80), - SPH_C32(0x3e060000), SPH_C32(0x67471384), SPH_C32(0xb1868180), - SPH_C32(0x7f954a8e), SPH_C32(0x2752bbaf), SPH_C32(0xcebb0000), - SPH_C32(0x124b0000), SPH_C32(0xe0a50480), SPH_C32(0x6dc80000), - SPH_C32(0xf15d562c), SPH_C32(0x07d3f27f), SPH_C32(0xc01f5c5b), - SPH_C32(0x3eac6d85) }, - { SPH_C32(0x67f90000), SPH_C32(0x729c0000), SPH_C32(0xffd00ece), - SPH_C32(0xcef90000), SPH_C32(0xfd766d68), SPH_C32(0xf4a5c04e), - SPH_C32(0xb0c3c56b), SPH_C32(0x7451a8a0), SPH_C32(0x9d360000), - SPH_C32(0xbbb70000), SPH_C32(0x7e520486), SPH_C32(0x3b370000), - SPH_C32(0xfbb95662), SPH_C32(0x95163f86), SPH_C32(0x695b1c43), - SPH_C32(0x413b3b14) }, - { SPH_C32(0x66240000), SPH_C32(0xf2340000), SPH_C32(0x0b460e86), - SPH_C32(0x68f90000), SPH_C32(0x6da313ca), SPH_C32(0x23434c79), - SPH_C32(0xd6d10a96), SPH_C32(0x58c5ed3e), SPH_C32(0xcf660000), - SPH_C32(0x92e30000), SPH_C32(0x143304c8), SPH_C32(0xcbc80000), - SPH_C32(0x6188288e), SPH_C32(0xd0357e48), SPH_C32(0xa60d93a6), - SPH_C32(0x1238281b) }, - { SPH_C32(0x34740000), SPH_C32(0xdb600000), SPH_C32(0x61270ec8), - SPH_C32(0x98060000), SPH_C32(0xf7926d26), SPH_C32(0x66600db7), - SPH_C32(0x19878573), SPH_C32(0x0bc6fe31), SPH_C32(0x9ceb0000), - SPH_C32(0x3b1f0000), SPH_C32(0x8ac404ce), SPH_C32(0x9d370000), - SPH_C32(0x6b6c28c0), SPH_C32(0x42f0b3b1), SPH_C32(0x0f49d3be), - SPH_C32(0x6daf7e8a) }, - { SPH_C32(0x02af0000), SPH_C32(0xb7280000), SPH_C32(0xba1c0300), - SPH_C32(0x56980000), SPH_C32(0xba8d45d3), SPH_C32(0x8048c667), - SPH_C32(0xa95c149a), SPH_C32(0xf4f6ea7b), SPH_C32(0x7a8c0000), - SPH_C32(0xa5d40000), SPH_C32(0x13260880), SPH_C32(0xc63d0000), - SPH_C32(0xcbb36daa), SPH_C32(0xfea14f43), SPH_C32(0x59d0b4f8), - SPH_C32(0x979961d0) }, - { SPH_C32(0x50ff0000), SPH_C32(0x9e7c0000), SPH_C32(0xd07d034e), - SPH_C32(0xa6670000), SPH_C32(0x20bc3b3f), SPH_C32(0xc56b87a9), - SPH_C32(0x660a9b7f), SPH_C32(0xa7f5f974), SPH_C32(0x29010000), - SPH_C32(0x0c280000), SPH_C32(0x8dd10886), SPH_C32(0x90c20000), - SPH_C32(0xc1576de4), SPH_C32(0x6c6482ba), SPH_C32(0xf094f4e0), - SPH_C32(0xe80e3741) }, - { SPH_C32(0x51220000), SPH_C32(0x1ed40000), SPH_C32(0x24eb0306), - SPH_C32(0x00670000), SPH_C32(0xb069459d), SPH_C32(0x128d0b9e), - SPH_C32(0x00185482), SPH_C32(0x8b61bcea), SPH_C32(0x7b510000), - SPH_C32(0x257c0000), SPH_C32(0xe7b008c8), SPH_C32(0x603d0000), - SPH_C32(0x5b661308), SPH_C32(0x2947c374), SPH_C32(0x3fc27b05), - SPH_C32(0xbb0d244e) }, - { SPH_C32(0x03720000), SPH_C32(0x37800000), SPH_C32(0x4e8a0348), - SPH_C32(0xf0980000), SPH_C32(0x2a583b71), SPH_C32(0x57ae4a50), - SPH_C32(0xcf4edb67), SPH_C32(0xd862afe5), SPH_C32(0x28dc0000), - SPH_C32(0x8c800000), SPH_C32(0x794708ce), SPH_C32(0x36c20000), - SPH_C32(0x51821346), SPH_C32(0xbb820e8d), SPH_C32(0x96863b1d), - SPH_C32(0xc49a72df) }, - { SPH_C32(0xcebb0000), SPH_C32(0x124b0000), SPH_C32(0xe0a50480), - SPH_C32(0x6dc80000), SPH_C32(0xf15d562c), SPH_C32(0x07d3f27f), - SPH_C32(0xc01f5c5b), SPH_C32(0x3eac6d85), SPH_C32(0xfb120000), - SPH_C32(0x49830000), SPH_C32(0x75140a00), SPH_C32(0x53ce0000), - SPH_C32(0x961a45a8), SPH_C32(0xb65573ff), SPH_C32(0xbf8a16d5), - SPH_C32(0x19fed62a) }, - { SPH_C32(0x9ceb0000), SPH_C32(0x3b1f0000), SPH_C32(0x8ac404ce), - SPH_C32(0x9d370000), SPH_C32(0x6b6c28c0), SPH_C32(0x42f0b3b1), - SPH_C32(0x0f49d3be), SPH_C32(0x6daf7e8a), SPH_C32(0xa89f0000), - SPH_C32(0xe07f0000), SPH_C32(0xebe30a06), SPH_C32(0x05310000), - SPH_C32(0x9cfe45e6), SPH_C32(0x2490be06), SPH_C32(0x16ce56cd), - SPH_C32(0x666980bb) }, - { SPH_C32(0x9d360000), SPH_C32(0xbbb70000), SPH_C32(0x7e520486), - SPH_C32(0x3b370000), SPH_C32(0xfbb95662), SPH_C32(0x95163f86), - SPH_C32(0x695b1c43), SPH_C32(0x413b3b14), SPH_C32(0xfacf0000), - SPH_C32(0xc92b0000), SPH_C32(0x81820a48), SPH_C32(0xf5ce0000), - SPH_C32(0x06cf3b0a), SPH_C32(0x61b3ffc8), SPH_C32(0xd998d928), - SPH_C32(0x356a93b4) }, - { SPH_C32(0xcf660000), SPH_C32(0x92e30000), SPH_C32(0x143304c8), - SPH_C32(0xcbc80000), SPH_C32(0x6188288e), SPH_C32(0xd0357e48), - SPH_C32(0xa60d93a6), SPH_C32(0x1238281b), SPH_C32(0xa9420000), - SPH_C32(0x60d70000), SPH_C32(0x1f750a4e), SPH_C32(0xa3310000), - SPH_C32(0x0c2b3b44), SPH_C32(0xf3763231), SPH_C32(0x70dc9930), - SPH_C32(0x4afdc525) }, - { SPH_C32(0x83310000), SPH_C32(0x5b7f0000), SPH_C32(0xdc2e0180), - SPH_C32(0xc36b0000), SPH_C32(0xe7246dd1), SPH_C32(0xc8bcfadb), - SPH_C32(0x4f06b6b7), SPH_C32(0x7a915d81), SPH_C32(0x37060000), - SPH_C32(0xece00000), SPH_C32(0x2fad0d80), SPH_C32(0x689e0000), - SPH_C32(0xddca5657), SPH_C32(0x31ce47e7), SPH_C32(0xd6c95e14), - SPH_C32(0xd3a451d4) }, - { SPH_C32(0xd1610000), SPH_C32(0x722b0000), SPH_C32(0xb64f01ce), - SPH_C32(0x33940000), SPH_C32(0x7d15133d), SPH_C32(0x8d9fbb15), - SPH_C32(0x80503952), SPH_C32(0x29924e8e), SPH_C32(0x648b0000), - SPH_C32(0x451c0000), SPH_C32(0xb15a0d86), SPH_C32(0x3e610000), - SPH_C32(0xd72e5619), SPH_C32(0xa30b8a1e), SPH_C32(0x7f8d1e0c), - SPH_C32(0xac330745) }, - { SPH_C32(0xd0bc0000), SPH_C32(0xf2830000), SPH_C32(0x42d90186), - SPH_C32(0x95940000), SPH_C32(0xedc06d9f), SPH_C32(0x5a793722), - SPH_C32(0xe642f6af), SPH_C32(0x05060b10), SPH_C32(0x36db0000), - SPH_C32(0x6c480000), SPH_C32(0xdb3b0dc8), SPH_C32(0xce9e0000), - SPH_C32(0x4d1f28f5), SPH_C32(0xe628cbd0), SPH_C32(0xb0db91e9), - SPH_C32(0xff30144a) }, - { SPH_C32(0x82ec0000), SPH_C32(0xdbd70000), SPH_C32(0x28b801c8), - SPH_C32(0x656b0000), SPH_C32(0x77f11373), SPH_C32(0x1f5a76ec), - SPH_C32(0x2914794a), SPH_C32(0x5605181f), SPH_C32(0x65560000), - SPH_C32(0xc5b40000), SPH_C32(0x45cc0dce), SPH_C32(0x98610000), - SPH_C32(0x47fb28bb), SPH_C32(0x74ed0629), SPH_C32(0x199fd1f1), - SPH_C32(0x80a742db) }, - { SPH_C32(0x4f250000), SPH_C32(0xfe1c0000), SPH_C32(0x86970600), - SPH_C32(0xf83b0000), SPH_C32(0xacf47e2e), SPH_C32(0x4f27cec3), - SPH_C32(0x2645fe76), SPH_C32(0xb0cbda7f), SPH_C32(0xb6980000), - SPH_C32(0x00b70000), SPH_C32(0x499f0f00), SPH_C32(0xfd6d0000), - SPH_C32(0x80637e55), SPH_C32(0x793a7b5b), SPH_C32(0x3093fc39), - SPH_C32(0x5dc3e62e) }, - { SPH_C32(0x1d750000), SPH_C32(0xd7480000), SPH_C32(0xecf6064e), - SPH_C32(0x08c40000), SPH_C32(0x36c500c2), SPH_C32(0x0a048f0d), - SPH_C32(0xe9137193), SPH_C32(0xe3c8c970), SPH_C32(0xe5150000), - SPH_C32(0xa94b0000), SPH_C32(0xd7680f06), SPH_C32(0xab920000), - SPH_C32(0x8a877e1b), SPH_C32(0xebffb6a2), SPH_C32(0x99d7bc21), - SPH_C32(0x2254b0bf) }, - { SPH_C32(0x1ca80000), SPH_C32(0x57e00000), SPH_C32(0x18600606), - SPH_C32(0xaec40000), SPH_C32(0xa6107e60), SPH_C32(0xdde2033a), - SPH_C32(0x8f01be6e), SPH_C32(0xcf5c8cee), SPH_C32(0xb7450000), - SPH_C32(0x801f0000), SPH_C32(0xbd090f48), SPH_C32(0x5b6d0000), - SPH_C32(0x10b600f7), SPH_C32(0xaedcf76c), SPH_C32(0x568133c4), - SPH_C32(0x7157a3b0) }, - { SPH_C32(0x4ef80000), SPH_C32(0x7eb40000), SPH_C32(0x72010648), - SPH_C32(0x5e3b0000), SPH_C32(0x3c21008c), SPH_C32(0x98c142f4), - SPH_C32(0x4057318b), SPH_C32(0x9c5f9fe1), SPH_C32(0xe4c80000), - SPH_C32(0x29e30000), SPH_C32(0x23fe0f4e), SPH_C32(0x0d920000), - SPH_C32(0x1a5200b9), SPH_C32(0x3c193a95), SPH_C32(0xffc573dc), - SPH_C32(0x0ec0f521) }, - { SPH_C32(0x7a8c0000), SPH_C32(0xa5d40000), SPH_C32(0x13260880), - SPH_C32(0xc63d0000), SPH_C32(0xcbb36daa), SPH_C32(0xfea14f43), - SPH_C32(0x59d0b4f8), SPH_C32(0x979961d0), SPH_C32(0x78230000), - SPH_C32(0x12fc0000), SPH_C32(0xa93a0b80), SPH_C32(0x90a50000), - SPH_C32(0x713e2879), SPH_C32(0x7ee98924), SPH_C32(0xf08ca062), - SPH_C32(0x636f8bab) }, - { SPH_C32(0x28dc0000), SPH_C32(0x8c800000), SPH_C32(0x794708ce), - SPH_C32(0x36c20000), SPH_C32(0x51821346), SPH_C32(0xbb820e8d), - SPH_C32(0x96863b1d), SPH_C32(0xc49a72df), SPH_C32(0x2bae0000), - SPH_C32(0xbb000000), SPH_C32(0x37cd0b86), SPH_C32(0xc65a0000), - SPH_C32(0x7bda2837), SPH_C32(0xec2c44dd), SPH_C32(0x59c8e07a), - SPH_C32(0x1cf8dd3a) }, - { SPH_C32(0x29010000), SPH_C32(0x0c280000), SPH_C32(0x8dd10886), - SPH_C32(0x90c20000), SPH_C32(0xc1576de4), SPH_C32(0x6c6482ba), - SPH_C32(0xf094f4e0), SPH_C32(0xe80e3741), SPH_C32(0x79fe0000), - SPH_C32(0x92540000), SPH_C32(0x5dac0bc8), SPH_C32(0x36a50000), - SPH_C32(0xe1eb56db), SPH_C32(0xa90f0513), SPH_C32(0x969e6f9f), - SPH_C32(0x4ffbce35) }, - { SPH_C32(0x7b510000), SPH_C32(0x257c0000), SPH_C32(0xe7b008c8), - SPH_C32(0x603d0000), SPH_C32(0x5b661308), SPH_C32(0x2947c374), - SPH_C32(0x3fc27b05), SPH_C32(0xbb0d244e), SPH_C32(0x2a730000), - SPH_C32(0x3ba80000), SPH_C32(0xc35b0bce), SPH_C32(0x605a0000), - SPH_C32(0xeb0f5695), SPH_C32(0x3bcac8ea), SPH_C32(0x3fda2f87), - SPH_C32(0x306c98a4) }, - { SPH_C32(0xb6980000), SPH_C32(0x00b70000), SPH_C32(0x499f0f00), - SPH_C32(0xfd6d0000), SPH_C32(0x80637e55), SPH_C32(0x793a7b5b), - SPH_C32(0x3093fc39), SPH_C32(0x5dc3e62e), SPH_C32(0xf9bd0000), - SPH_C32(0xfeab0000), SPH_C32(0xcf080900), SPH_C32(0x05560000), - SPH_C32(0x2c97007b), SPH_C32(0x361db598), SPH_C32(0x16d6024f), - SPH_C32(0xed083c51) }, - { SPH_C32(0xe4c80000), SPH_C32(0x29e30000), SPH_C32(0x23fe0f4e), - SPH_C32(0x0d920000), SPH_C32(0x1a5200b9), SPH_C32(0x3c193a95), - SPH_C32(0xffc573dc), SPH_C32(0x0ec0f521), SPH_C32(0xaa300000), - SPH_C32(0x57570000), SPH_C32(0x51ff0906), SPH_C32(0x53a90000), - SPH_C32(0x26730035), SPH_C32(0xa4d87861), SPH_C32(0xbf924257), - SPH_C32(0x929f6ac0) }, - { SPH_C32(0xe5150000), SPH_C32(0xa94b0000), SPH_C32(0xd7680f06), - SPH_C32(0xab920000), SPH_C32(0x8a877e1b), SPH_C32(0xebffb6a2), - SPH_C32(0x99d7bc21), SPH_C32(0x2254b0bf), SPH_C32(0xf8600000), - SPH_C32(0x7e030000), SPH_C32(0x3b9e0948), SPH_C32(0xa3560000), - SPH_C32(0xbc427ed9), SPH_C32(0xe1fb39af), SPH_C32(0x70c4cdb2), - SPH_C32(0xc19c79cf) }, - { SPH_C32(0xb7450000), SPH_C32(0x801f0000), SPH_C32(0xbd090f48), - SPH_C32(0x5b6d0000), SPH_C32(0x10b600f7), SPH_C32(0xaedcf76c), - SPH_C32(0x568133c4), SPH_C32(0x7157a3b0), SPH_C32(0xabed0000), - SPH_C32(0xd7ff0000), SPH_C32(0xa569094e), SPH_C32(0xf5a90000), - SPH_C32(0xb6a67e97), SPH_C32(0x733ef456), SPH_C32(0xd9808daa), - SPH_C32(0xbe0b2f5e) }, - { SPH_C32(0xfb120000), SPH_C32(0x49830000), SPH_C32(0x75140a00), - SPH_C32(0x53ce0000), SPH_C32(0x961a45a8), SPH_C32(0xb65573ff), - SPH_C32(0xbf8a16d5), SPH_C32(0x19fed62a), SPH_C32(0x35a90000), - SPH_C32(0x5bc80000), SPH_C32(0x95b10e80), SPH_C32(0x3e060000), - SPH_C32(0x67471384), SPH_C32(0xb1868180), SPH_C32(0x7f954a8e), - SPH_C32(0x2752bbaf) }, - { SPH_C32(0xa9420000), SPH_C32(0x60d70000), SPH_C32(0x1f750a4e), - SPH_C32(0xa3310000), SPH_C32(0x0c2b3b44), SPH_C32(0xf3763231), - SPH_C32(0x70dc9930), SPH_C32(0x4afdc525), SPH_C32(0x66240000), - SPH_C32(0xf2340000), SPH_C32(0x0b460e86), SPH_C32(0x68f90000), - SPH_C32(0x6da313ca), SPH_C32(0x23434c79), SPH_C32(0xd6d10a96), - SPH_C32(0x58c5ed3e) }, - { SPH_C32(0xa89f0000), SPH_C32(0xe07f0000), SPH_C32(0xebe30a06), - SPH_C32(0x05310000), SPH_C32(0x9cfe45e6), SPH_C32(0x2490be06), - SPH_C32(0x16ce56cd), SPH_C32(0x666980bb), SPH_C32(0x34740000), - SPH_C32(0xdb600000), SPH_C32(0x61270ec8), SPH_C32(0x98060000), - SPH_C32(0xf7926d26), SPH_C32(0x66600db7), SPH_C32(0x19878573), - SPH_C32(0x0bc6fe31) }, - { SPH_C32(0xfacf0000), SPH_C32(0xc92b0000), SPH_C32(0x81820a48), - SPH_C32(0xf5ce0000), SPH_C32(0x06cf3b0a), SPH_C32(0x61b3ffc8), - SPH_C32(0xd998d928), SPH_C32(0x356a93b4), SPH_C32(0x67f90000), - SPH_C32(0x729c0000), SPH_C32(0xffd00ece), SPH_C32(0xcef90000), - SPH_C32(0xfd766d68), SPH_C32(0xf4a5c04e), SPH_C32(0xb0c3c56b), - SPH_C32(0x7451a8a0) }, - { SPH_C32(0x37060000), SPH_C32(0xece00000), SPH_C32(0x2fad0d80), - SPH_C32(0x689e0000), SPH_C32(0xddca5657), SPH_C32(0x31ce47e7), - SPH_C32(0xd6c95e14), SPH_C32(0xd3a451d4), SPH_C32(0xb4370000), - SPH_C32(0xb79f0000), SPH_C32(0xf3830c00), SPH_C32(0xabf50000), - SPH_C32(0x3aee3b86), SPH_C32(0xf972bd3c), SPH_C32(0x99cfe8a3), - SPH_C32(0xa9350c55) }, - { SPH_C32(0x65560000), SPH_C32(0xc5b40000), SPH_C32(0x45cc0dce), - SPH_C32(0x98610000), SPH_C32(0x47fb28bb), SPH_C32(0x74ed0629), - SPH_C32(0x199fd1f1), SPH_C32(0x80a742db), SPH_C32(0xe7ba0000), - SPH_C32(0x1e630000), SPH_C32(0x6d740c06), SPH_C32(0xfd0a0000), - SPH_C32(0x300a3bc8), SPH_C32(0x6bb770c5), SPH_C32(0x308ba8bb), - SPH_C32(0xd6a25ac4) }, - { SPH_C32(0x648b0000), SPH_C32(0x451c0000), SPH_C32(0xb15a0d86), - SPH_C32(0x3e610000), SPH_C32(0xd72e5619), SPH_C32(0xa30b8a1e), - SPH_C32(0x7f8d1e0c), SPH_C32(0xac330745), SPH_C32(0xb5ea0000), - SPH_C32(0x37370000), SPH_C32(0x07150c48), SPH_C32(0x0df50000), - SPH_C32(0xaa3b4524), SPH_C32(0x2e94310b), SPH_C32(0xffdd275e), - SPH_C32(0x85a149cb) }, - { SPH_C32(0x36db0000), SPH_C32(0x6c480000), SPH_C32(0xdb3b0dc8), - SPH_C32(0xce9e0000), SPH_C32(0x4d1f28f5), SPH_C32(0xe628cbd0), - SPH_C32(0xb0db91e9), SPH_C32(0xff30144a), SPH_C32(0xe6670000), - SPH_C32(0x9ecb0000), SPH_C32(0x99e20c4e), SPH_C32(0x5b0a0000), - SPH_C32(0xa0df456a), SPH_C32(0xbc51fcf2), SPH_C32(0x56996746), - SPH_C32(0xfa361f5a) } -}; - -static const sph_u32 T512_42[64][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x58430000), SPH_C32(0x807e0000), SPH_C32(0x78330001), - SPH_C32(0xc66b3800), SPH_C32(0xe7375cdc), SPH_C32(0x79ad3fdd), - SPH_C32(0xac73fe6f), SPH_C32(0x3a4479b1), SPH_C32(0x1d5a0000), - SPH_C32(0x2b720000), SPH_C32(0x488d0000), SPH_C32(0xaf611800), - SPH_C32(0x25cb2ec5), SPH_C32(0xc879bfd0), SPH_C32(0x81a20429), - SPH_C32(0x1e7536a6) }, - { SPH_C32(0x1d5a0000), SPH_C32(0x2b720000), SPH_C32(0x488d0000), - SPH_C32(0xaf611800), SPH_C32(0x25cb2ec5), SPH_C32(0xc879bfd0), - SPH_C32(0x81a20429), SPH_C32(0x1e7536a6), SPH_C32(0x45190000), - SPH_C32(0xab0c0000), SPH_C32(0x30be0001), SPH_C32(0x690a2000), - SPH_C32(0xc2fc7219), SPH_C32(0xb1d4800d), SPH_C32(0x2dd1fa46), - SPH_C32(0x24314f17) }, - { SPH_C32(0x45190000), SPH_C32(0xab0c0000), SPH_C32(0x30be0001), - SPH_C32(0x690a2000), SPH_C32(0xc2fc7219), SPH_C32(0xb1d4800d), - SPH_C32(0x2dd1fa46), SPH_C32(0x24314f17), SPH_C32(0x58430000), - SPH_C32(0x807e0000), SPH_C32(0x78330001), SPH_C32(0xc66b3800), - SPH_C32(0xe7375cdc), SPH_C32(0x79ad3fdd), SPH_C32(0xac73fe6f), - SPH_C32(0x3a4479b1) }, - { SPH_C32(0xa53b0000), SPH_C32(0x14260000), SPH_C32(0x4e30001e), - SPH_C32(0x7cae0000), SPH_C32(0x8f9e0dd5), SPH_C32(0x78dfaa3d), - SPH_C32(0xf73168d8), SPH_C32(0x0b1b4946), SPH_C32(0x07ed0000), - SPH_C32(0xb2500000), SPH_C32(0x8774000a), SPH_C32(0x970d0000), - SPH_C32(0x437223ae), SPH_C32(0x48c76ea4), SPH_C32(0xf4786222), - SPH_C32(0x9075b1ce) }, - { SPH_C32(0xfd780000), SPH_C32(0x94580000), SPH_C32(0x3603001f), - SPH_C32(0xbac53800), SPH_C32(0x68a95109), SPH_C32(0x017295e0), - SPH_C32(0x5b4296b7), SPH_C32(0x315f30f7), SPH_C32(0x1ab70000), - SPH_C32(0x99220000), SPH_C32(0xcff9000a), SPH_C32(0x386c1800), - SPH_C32(0x66b90d6b), SPH_C32(0x80bed174), SPH_C32(0x75da660b), - SPH_C32(0x8e008768) }, - { SPH_C32(0xb8610000), SPH_C32(0x3f540000), SPH_C32(0x06bd001e), - SPH_C32(0xd3cf1800), SPH_C32(0xaa552310), SPH_C32(0xb0a615ed), - SPH_C32(0x76936cf1), SPH_C32(0x156e7fe0), SPH_C32(0x42f40000), - SPH_C32(0x195c0000), SPH_C32(0xb7ca000b), SPH_C32(0xfe072000), - SPH_C32(0x818e51b7), SPH_C32(0xf913eea9), SPH_C32(0xd9a99864), - SPH_C32(0xb444fed9) }, - { SPH_C32(0xe0220000), SPH_C32(0xbf2a0000), SPH_C32(0x7e8e001f), - SPH_C32(0x15a42000), SPH_C32(0x4d627fcc), SPH_C32(0xc90b2a30), - SPH_C32(0xdae0929e), SPH_C32(0x2f2a0651), SPH_C32(0x5fae0000), - SPH_C32(0x322e0000), SPH_C32(0xff47000b), SPH_C32(0x51663800), - SPH_C32(0xa4457f72), SPH_C32(0x316a5179), SPH_C32(0x580b9c4d), - SPH_C32(0xaa31c87f) }, - { SPH_C32(0x07ed0000), SPH_C32(0xb2500000), SPH_C32(0x8774000a), - SPH_C32(0x970d0000), SPH_C32(0x437223ae), SPH_C32(0x48c76ea4), - SPH_C32(0xf4786222), SPH_C32(0x9075b1ce), SPH_C32(0xa2d60000), - SPH_C32(0xa6760000), SPH_C32(0xc9440014), SPH_C32(0xeba30000), - SPH_C32(0xccec2e7b), SPH_C32(0x3018c499), SPH_C32(0x03490afa), - SPH_C32(0x9b6ef888) }, - { SPH_C32(0x5fae0000), SPH_C32(0x322e0000), SPH_C32(0xff47000b), - SPH_C32(0x51663800), SPH_C32(0xa4457f72), SPH_C32(0x316a5179), - SPH_C32(0x580b9c4d), SPH_C32(0xaa31c87f), SPH_C32(0xbf8c0000), - SPH_C32(0x8d040000), SPH_C32(0x81c90014), SPH_C32(0x44c21800), - SPH_C32(0xe92700be), SPH_C32(0xf8617b49), SPH_C32(0x82eb0ed3), - SPH_C32(0x851bce2e) }, - { SPH_C32(0x1ab70000), SPH_C32(0x99220000), SPH_C32(0xcff9000a), - SPH_C32(0x386c1800), SPH_C32(0x66b90d6b), SPH_C32(0x80bed174), - SPH_C32(0x75da660b), SPH_C32(0x8e008768), SPH_C32(0xe7cf0000), - SPH_C32(0x0d7a0000), SPH_C32(0xf9fa0015), SPH_C32(0x82a92000), - SPH_C32(0x0e105c62), SPH_C32(0x81cc4494), SPH_C32(0x2e98f0bc), - SPH_C32(0xbf5fb79f) }, - { SPH_C32(0x42f40000), SPH_C32(0x195c0000), SPH_C32(0xb7ca000b), - SPH_C32(0xfe072000), SPH_C32(0x818e51b7), SPH_C32(0xf913eea9), - SPH_C32(0xd9a99864), SPH_C32(0xb444fed9), SPH_C32(0xfa950000), - SPH_C32(0x26080000), SPH_C32(0xb1770015), SPH_C32(0x2dc83800), - SPH_C32(0x2bdb72a7), SPH_C32(0x49b5fb44), SPH_C32(0xaf3af495), - SPH_C32(0xa12a8139) }, - { SPH_C32(0xa2d60000), SPH_C32(0xa6760000), SPH_C32(0xc9440014), - SPH_C32(0xeba30000), SPH_C32(0xccec2e7b), SPH_C32(0x3018c499), - SPH_C32(0x03490afa), SPH_C32(0x9b6ef888), SPH_C32(0xa53b0000), - SPH_C32(0x14260000), SPH_C32(0x4e30001e), SPH_C32(0x7cae0000), - SPH_C32(0x8f9e0dd5), SPH_C32(0x78dfaa3d), SPH_C32(0xf73168d8), - SPH_C32(0x0b1b4946) }, - { SPH_C32(0xfa950000), SPH_C32(0x26080000), SPH_C32(0xb1770015), - SPH_C32(0x2dc83800), SPH_C32(0x2bdb72a7), SPH_C32(0x49b5fb44), - SPH_C32(0xaf3af495), SPH_C32(0xa12a8139), SPH_C32(0xb8610000), - SPH_C32(0x3f540000), SPH_C32(0x06bd001e), SPH_C32(0xd3cf1800), - SPH_C32(0xaa552310), SPH_C32(0xb0a615ed), SPH_C32(0x76936cf1), - SPH_C32(0x156e7fe0) }, - { SPH_C32(0xbf8c0000), SPH_C32(0x8d040000), SPH_C32(0x81c90014), - SPH_C32(0x44c21800), SPH_C32(0xe92700be), SPH_C32(0xf8617b49), - SPH_C32(0x82eb0ed3), SPH_C32(0x851bce2e), SPH_C32(0xe0220000), - SPH_C32(0xbf2a0000), SPH_C32(0x7e8e001f), SPH_C32(0x15a42000), - SPH_C32(0x4d627fcc), SPH_C32(0xc90b2a30), SPH_C32(0xdae0929e), - SPH_C32(0x2f2a0651) }, - { SPH_C32(0xe7cf0000), SPH_C32(0x0d7a0000), SPH_C32(0xf9fa0015), - SPH_C32(0x82a92000), SPH_C32(0x0e105c62), SPH_C32(0x81cc4494), - SPH_C32(0x2e98f0bc), SPH_C32(0xbf5fb79f), SPH_C32(0xfd780000), - SPH_C32(0x94580000), SPH_C32(0x3603001f), SPH_C32(0xbac53800), - SPH_C32(0x68a95109), SPH_C32(0x017295e0), SPH_C32(0x5b4296b7), - SPH_C32(0x315f30f7) }, - { SPH_C32(0x88980000), SPH_C32(0x1f940000), SPH_C32(0x7fcf002e), - SPH_C32(0xfb4e0000), SPH_C32(0xf158079a), SPH_C32(0x61ae9167), - SPH_C32(0xa895706c), SPH_C32(0xe6107494), SPH_C32(0x0bc20000), - SPH_C32(0xdb630000), SPH_C32(0x7e88000c), SPH_C32(0x15860000), - SPH_C32(0x91fd48f3), SPH_C32(0x7581bb43), SPH_C32(0xf460449e), - SPH_C32(0xd8b61463) }, - { SPH_C32(0xd0db0000), SPH_C32(0x9fea0000), SPH_C32(0x07fc002f), - SPH_C32(0x3d253800), SPH_C32(0x166f5b46), SPH_C32(0x1803aeba), - SPH_C32(0x04e68e03), SPH_C32(0xdc540d25), SPH_C32(0x16980000), - SPH_C32(0xf0110000), SPH_C32(0x3605000c), SPH_C32(0xbae71800), - SPH_C32(0xb4366636), SPH_C32(0xbdf80493), SPH_C32(0x75c240b7), - SPH_C32(0xc6c322c5) }, - { SPH_C32(0x95c20000), SPH_C32(0x34e60000), SPH_C32(0x3742002e), - SPH_C32(0x542f1800), SPH_C32(0xd493295f), SPH_C32(0xa9d72eb7), - SPH_C32(0x29377445), SPH_C32(0xf8654232), SPH_C32(0x4edb0000), - SPH_C32(0x706f0000), SPH_C32(0x4e36000d), SPH_C32(0x7c8c2000), - SPH_C32(0x53013aea), SPH_C32(0xc4553b4e), SPH_C32(0xd9b1bed8), - SPH_C32(0xfc875b74) }, - { SPH_C32(0xcd810000), SPH_C32(0xb4980000), SPH_C32(0x4f71002f), - SPH_C32(0x92442000), SPH_C32(0x33a47583), SPH_C32(0xd07a116a), - SPH_C32(0x85448a2a), SPH_C32(0xc2213b83), SPH_C32(0x53810000), - SPH_C32(0x5b1d0000), SPH_C32(0x06bb000d), SPH_C32(0xd3ed3800), - SPH_C32(0x76ca142f), SPH_C32(0x0c2c849e), SPH_C32(0x5813baf1), - SPH_C32(0xe2f26dd2) }, - { SPH_C32(0x2da30000), SPH_C32(0x0bb20000), SPH_C32(0x31ff0030), - SPH_C32(0x87e00000), SPH_C32(0x7ec60a4f), SPH_C32(0x19713b5a), - SPH_C32(0x5fa418b4), SPH_C32(0xed0b3dd2), SPH_C32(0x0c2f0000), - SPH_C32(0x69330000), SPH_C32(0xf9fc0006), SPH_C32(0x828b0000), - SPH_C32(0xd28f6b5d), SPH_C32(0x3d46d5e7), SPH_C32(0x001826bc), - SPH_C32(0x48c3a5ad) }, - { SPH_C32(0x75e00000), SPH_C32(0x8bcc0000), SPH_C32(0x49cc0031), - SPH_C32(0x418b3800), SPH_C32(0x99f15693), SPH_C32(0x60dc0487), - SPH_C32(0xf3d7e6db), SPH_C32(0xd74f4463), SPH_C32(0x11750000), - SPH_C32(0x42410000), SPH_C32(0xb1710006), SPH_C32(0x2dea1800), - SPH_C32(0xf7444598), SPH_C32(0xf53f6a37), SPH_C32(0x81ba2295), - SPH_C32(0x56b6930b) }, - { SPH_C32(0x30f90000), SPH_C32(0x20c00000), SPH_C32(0x79720030), - SPH_C32(0x28811800), SPH_C32(0x5b0d248a), SPH_C32(0xd108848a), - SPH_C32(0xde061c9d), SPH_C32(0xf37e0b74), SPH_C32(0x49360000), - SPH_C32(0xc23f0000), SPH_C32(0xc9420007), SPH_C32(0xeb812000), - SPH_C32(0x10731944), SPH_C32(0x8c9255ea), SPH_C32(0x2dc9dcfa), - SPH_C32(0x6cf2eaba) }, - { SPH_C32(0x68ba0000), SPH_C32(0xa0be0000), SPH_C32(0x01410031), - SPH_C32(0xeeea2000), SPH_C32(0xbc3a7856), SPH_C32(0xa8a5bb57), - SPH_C32(0x7275e2f2), SPH_C32(0xc93a72c5), SPH_C32(0x546c0000), - SPH_C32(0xe94d0000), SPH_C32(0x81cf0007), SPH_C32(0x44e03800), - SPH_C32(0x35b83781), SPH_C32(0x44ebea3a), SPH_C32(0xac6bd8d3), - SPH_C32(0x7287dc1c) }, - { SPH_C32(0x8f750000), SPH_C32(0xadc40000), SPH_C32(0xf8bb0024), - SPH_C32(0x6c430000), SPH_C32(0xb22a2434), SPH_C32(0x2969ffc3), - SPH_C32(0x5ced124e), SPH_C32(0x7665c55a), SPH_C32(0xa9140000), - SPH_C32(0x7d150000), SPH_C32(0xb7cc0018), SPH_C32(0xfe250000), - SPH_C32(0x5d116688), SPH_C32(0x45997fda), SPH_C32(0xf7294e64), - SPH_C32(0x43d8eceb) }, - { SPH_C32(0xd7360000), SPH_C32(0x2dba0000), SPH_C32(0x80880025), - SPH_C32(0xaa283800), SPH_C32(0x551d78e8), SPH_C32(0x50c4c01e), - SPH_C32(0xf09eec21), SPH_C32(0x4c21bceb), SPH_C32(0xb44e0000), - SPH_C32(0x56670000), SPH_C32(0xff410018), SPH_C32(0x51441800), - SPH_C32(0x78da484d), SPH_C32(0x8de0c00a), SPH_C32(0x768b4a4d), - SPH_C32(0x5dadda4d) }, - { SPH_C32(0x922f0000), SPH_C32(0x86b60000), SPH_C32(0xb0360024), - SPH_C32(0xc3221800), SPH_C32(0x97e10af1), SPH_C32(0xe1104013), - SPH_C32(0xdd4f1667), SPH_C32(0x6810f3fc), SPH_C32(0xec0d0000), - SPH_C32(0xd6190000), SPH_C32(0x87720019), SPH_C32(0x972f2000), - SPH_C32(0x9fed1491), SPH_C32(0xf44dffd7), SPH_C32(0xdaf8b422), - SPH_C32(0x67e9a3fc) }, - { SPH_C32(0xca6c0000), SPH_C32(0x06c80000), SPH_C32(0xc8050025), - SPH_C32(0x05492000), SPH_C32(0x70d6562d), SPH_C32(0x98bd7fce), - SPH_C32(0x713ce808), SPH_C32(0x52548a4d), SPH_C32(0xf1570000), - SPH_C32(0xfd6b0000), SPH_C32(0xcfff0019), SPH_C32(0x384e3800), - SPH_C32(0xba263a54), SPH_C32(0x3c344007), SPH_C32(0x5b5ab00b), - SPH_C32(0x799c955a) }, - { SPH_C32(0x2a4e0000), SPH_C32(0xb9e20000), SPH_C32(0xb68b003a), - SPH_C32(0x10ed0000), SPH_C32(0x3db429e1), SPH_C32(0x51b655fe), - SPH_C32(0xabdc7a96), SPH_C32(0x7d7e8c1c), SPH_C32(0xaef90000), - SPH_C32(0xcf450000), SPH_C32(0x30b80012), SPH_C32(0x69280000), - SPH_C32(0x1e634526), SPH_C32(0x0d5e117e), SPH_C32(0x03512c46), - SPH_C32(0xd3ad5d25) }, - { SPH_C32(0x720d0000), SPH_C32(0x399c0000), SPH_C32(0xceb8003b), - SPH_C32(0xd6863800), SPH_C32(0xda83753d), SPH_C32(0x281b6a23), - SPH_C32(0x07af84f9), SPH_C32(0x473af5ad), SPH_C32(0xb3a30000), - SPH_C32(0xe4370000), SPH_C32(0x78350012), SPH_C32(0xc6491800), - SPH_C32(0x3ba86be3), SPH_C32(0xc527aeae), SPH_C32(0x82f3286f), - SPH_C32(0xcdd86b83) }, - { SPH_C32(0x37140000), SPH_C32(0x92900000), SPH_C32(0xfe06003a), - SPH_C32(0xbf8c1800), SPH_C32(0x187f0724), SPH_C32(0x99cfea2e), - SPH_C32(0x2a7e7ebf), SPH_C32(0x630bbaba), SPH_C32(0xebe00000), - SPH_C32(0x64490000), SPH_C32(0x00060013), SPH_C32(0x00222000), - SPH_C32(0xdc9f373f), SPH_C32(0xbc8a9173), SPH_C32(0x2e80d600), - SPH_C32(0xf79c1232) }, - { SPH_C32(0x6f570000), SPH_C32(0x12ee0000), SPH_C32(0x8635003b), - SPH_C32(0x79e72000), SPH_C32(0xff485bf8), SPH_C32(0xe062d5f3), - SPH_C32(0x860d80d0), SPH_C32(0x594fc30b), SPH_C32(0xf6ba0000), - SPH_C32(0x4f3b0000), SPH_C32(0x488b0013), SPH_C32(0xaf433800), - SPH_C32(0xf95419fa), SPH_C32(0x74f32ea3), SPH_C32(0xaf22d229), - SPH_C32(0xe9e92494) }, - { SPH_C32(0x0bc20000), SPH_C32(0xdb630000), SPH_C32(0x7e88000c), - SPH_C32(0x15860000), SPH_C32(0x91fd48f3), SPH_C32(0x7581bb43), - SPH_C32(0xf460449e), SPH_C32(0xd8b61463), SPH_C32(0x835a0000), - SPH_C32(0xc4f70000), SPH_C32(0x01470022), SPH_C32(0xeec80000), - SPH_C32(0x60a54f69), SPH_C32(0x142f2a24), SPH_C32(0x5cf534f2), - SPH_C32(0x3ea660f7) }, - { SPH_C32(0x53810000), SPH_C32(0x5b1d0000), SPH_C32(0x06bb000d), - SPH_C32(0xd3ed3800), SPH_C32(0x76ca142f), SPH_C32(0x0c2c849e), - SPH_C32(0x5813baf1), SPH_C32(0xe2f26dd2), SPH_C32(0x9e000000), - SPH_C32(0xef850000), SPH_C32(0x49ca0022), SPH_C32(0x41a91800), - SPH_C32(0x456e61ac), SPH_C32(0xdc5695f4), SPH_C32(0xdd5730db), - SPH_C32(0x20d35651) }, - { SPH_C32(0x16980000), SPH_C32(0xf0110000), SPH_C32(0x3605000c), - SPH_C32(0xbae71800), SPH_C32(0xb4366636), SPH_C32(0xbdf80493), - SPH_C32(0x75c240b7), SPH_C32(0xc6c322c5), SPH_C32(0xc6430000), - SPH_C32(0x6ffb0000), SPH_C32(0x31f90023), SPH_C32(0x87c22000), - SPH_C32(0xa2593d70), SPH_C32(0xa5fbaa29), SPH_C32(0x7124ceb4), - SPH_C32(0x1a972fe0) }, - { SPH_C32(0x4edb0000), SPH_C32(0x706f0000), SPH_C32(0x4e36000d), - SPH_C32(0x7c8c2000), SPH_C32(0x53013aea), SPH_C32(0xc4553b4e), - SPH_C32(0xd9b1bed8), SPH_C32(0xfc875b74), SPH_C32(0xdb190000), - SPH_C32(0x44890000), SPH_C32(0x79740023), SPH_C32(0x28a33800), - SPH_C32(0x879213b5), SPH_C32(0x6d8215f9), SPH_C32(0xf086ca9d), - SPH_C32(0x04e21946) }, - { SPH_C32(0xaef90000), SPH_C32(0xcf450000), SPH_C32(0x30b80012), - SPH_C32(0x69280000), SPH_C32(0x1e634526), SPH_C32(0x0d5e117e), - SPH_C32(0x03512c46), SPH_C32(0xd3ad5d25), SPH_C32(0x84b70000), - SPH_C32(0x76a70000), SPH_C32(0x86330028), SPH_C32(0x79c50000), - SPH_C32(0x23d76cc7), SPH_C32(0x5ce84480), SPH_C32(0xa88d56d0), - SPH_C32(0xaed3d139) }, - { SPH_C32(0xf6ba0000), SPH_C32(0x4f3b0000), SPH_C32(0x488b0013), - SPH_C32(0xaf433800), SPH_C32(0xf95419fa), SPH_C32(0x74f32ea3), - SPH_C32(0xaf22d229), SPH_C32(0xe9e92494), SPH_C32(0x99ed0000), - SPH_C32(0x5dd50000), SPH_C32(0xcebe0028), SPH_C32(0xd6a41800), - SPH_C32(0x061c4202), SPH_C32(0x9491fb50), SPH_C32(0x292f52f9), - SPH_C32(0xb0a6e79f) }, - { SPH_C32(0xb3a30000), SPH_C32(0xe4370000), SPH_C32(0x78350012), - SPH_C32(0xc6491800), SPH_C32(0x3ba86be3), SPH_C32(0xc527aeae), - SPH_C32(0x82f3286f), SPH_C32(0xcdd86b83), SPH_C32(0xc1ae0000), - SPH_C32(0xddab0000), SPH_C32(0xb68d0029), SPH_C32(0x10cf2000), - SPH_C32(0xe12b1ede), SPH_C32(0xed3cc48d), SPH_C32(0x855cac96), - SPH_C32(0x8ae29e2e) }, - { SPH_C32(0xebe00000), SPH_C32(0x64490000), SPH_C32(0x00060013), - SPH_C32(0x00222000), SPH_C32(0xdc9f373f), SPH_C32(0xbc8a9173), - SPH_C32(0x2e80d600), SPH_C32(0xf79c1232), SPH_C32(0xdcf40000), - SPH_C32(0xf6d90000), SPH_C32(0xfe000029), SPH_C32(0xbfae3800), - SPH_C32(0xc4e0301b), SPH_C32(0x25457b5d), SPH_C32(0x04fea8bf), - SPH_C32(0x9497a888) }, - { SPH_C32(0x0c2f0000), SPH_C32(0x69330000), SPH_C32(0xf9fc0006), - SPH_C32(0x828b0000), SPH_C32(0xd28f6b5d), SPH_C32(0x3d46d5e7), - SPH_C32(0x001826bc), SPH_C32(0x48c3a5ad), SPH_C32(0x218c0000), - SPH_C32(0x62810000), SPH_C32(0xc8030036), SPH_C32(0x056b0000), - SPH_C32(0xac496112), SPH_C32(0x2437eebd), SPH_C32(0x5fbc3e08), - SPH_C32(0xa5c8987f) }, - { SPH_C32(0x546c0000), SPH_C32(0xe94d0000), SPH_C32(0x81cf0007), - SPH_C32(0x44e03800), SPH_C32(0x35b83781), SPH_C32(0x44ebea3a), - SPH_C32(0xac6bd8d3), SPH_C32(0x7287dc1c), SPH_C32(0x3cd60000), - SPH_C32(0x49f30000), SPH_C32(0x808e0036), SPH_C32(0xaa0a1800), - SPH_C32(0x89824fd7), SPH_C32(0xec4e516d), SPH_C32(0xde1e3a21), - SPH_C32(0xbbbdaed9) }, - { SPH_C32(0x11750000), SPH_C32(0x42410000), SPH_C32(0xb1710006), - SPH_C32(0x2dea1800), SPH_C32(0xf7444598), SPH_C32(0xf53f6a37), - SPH_C32(0x81ba2295), SPH_C32(0x56b6930b), SPH_C32(0x64950000), - SPH_C32(0xc98d0000), SPH_C32(0xf8bd0037), SPH_C32(0x6c612000), - SPH_C32(0x6eb5130b), SPH_C32(0x95e36eb0), SPH_C32(0x726dc44e), - SPH_C32(0x81f9d768) }, - { SPH_C32(0x49360000), SPH_C32(0xc23f0000), SPH_C32(0xc9420007), - SPH_C32(0xeb812000), SPH_C32(0x10731944), SPH_C32(0x8c9255ea), - SPH_C32(0x2dc9dcfa), SPH_C32(0x6cf2eaba), SPH_C32(0x79cf0000), - SPH_C32(0xe2ff0000), SPH_C32(0xb0300037), SPH_C32(0xc3003800), - SPH_C32(0x4b7e3dce), SPH_C32(0x5d9ad160), SPH_C32(0xf3cfc067), - SPH_C32(0x9f8ce1ce) }, - { SPH_C32(0xa9140000), SPH_C32(0x7d150000), SPH_C32(0xb7cc0018), - SPH_C32(0xfe250000), SPH_C32(0x5d116688), SPH_C32(0x45997fda), - SPH_C32(0xf7294e64), SPH_C32(0x43d8eceb), SPH_C32(0x26610000), - SPH_C32(0xd0d10000), SPH_C32(0x4f77003c), SPH_C32(0x92660000), - SPH_C32(0xef3b42bc), SPH_C32(0x6cf08019), SPH_C32(0xabc45c2a), - SPH_C32(0x35bd29b1) }, - { SPH_C32(0xf1570000), SPH_C32(0xfd6b0000), SPH_C32(0xcfff0019), - SPH_C32(0x384e3800), SPH_C32(0xba263a54), SPH_C32(0x3c344007), - SPH_C32(0x5b5ab00b), SPH_C32(0x799c955a), SPH_C32(0x3b3b0000), - SPH_C32(0xfba30000), SPH_C32(0x07fa003c), SPH_C32(0x3d071800), - SPH_C32(0xcaf06c79), SPH_C32(0xa4893fc9), SPH_C32(0x2a665803), - SPH_C32(0x2bc81f17) }, - { SPH_C32(0xb44e0000), SPH_C32(0x56670000), SPH_C32(0xff410018), - SPH_C32(0x51441800), SPH_C32(0x78da484d), SPH_C32(0x8de0c00a), - SPH_C32(0x768b4a4d), SPH_C32(0x5dadda4d), SPH_C32(0x63780000), - SPH_C32(0x7bdd0000), SPH_C32(0x7fc9003d), SPH_C32(0xfb6c2000), - SPH_C32(0x2dc730a5), SPH_C32(0xdd240014), SPH_C32(0x8615a66c), - SPH_C32(0x118c66a6) }, - { SPH_C32(0xec0d0000), SPH_C32(0xd6190000), SPH_C32(0x87720019), - SPH_C32(0x972f2000), SPH_C32(0x9fed1491), SPH_C32(0xf44dffd7), - SPH_C32(0xdaf8b422), SPH_C32(0x67e9a3fc), SPH_C32(0x7e220000), - SPH_C32(0x50af0000), SPH_C32(0x3744003d), SPH_C32(0x540d3800), - SPH_C32(0x080c1e60), SPH_C32(0x155dbfc4), SPH_C32(0x07b7a245), - SPH_C32(0x0ff95000) }, - { SPH_C32(0x835a0000), SPH_C32(0xc4f70000), SPH_C32(0x01470022), - SPH_C32(0xeec80000), SPH_C32(0x60a54f69), SPH_C32(0x142f2a24), - SPH_C32(0x5cf534f2), SPH_C32(0x3ea660f7), SPH_C32(0x88980000), - SPH_C32(0x1f940000), SPH_C32(0x7fcf002e), SPH_C32(0xfb4e0000), - SPH_C32(0xf158079a), SPH_C32(0x61ae9167), SPH_C32(0xa895706c), - SPH_C32(0xe6107494) }, - { SPH_C32(0xdb190000), SPH_C32(0x44890000), SPH_C32(0x79740023), - SPH_C32(0x28a33800), SPH_C32(0x879213b5), SPH_C32(0x6d8215f9), - SPH_C32(0xf086ca9d), SPH_C32(0x04e21946), SPH_C32(0x95c20000), - SPH_C32(0x34e60000), SPH_C32(0x3742002e), SPH_C32(0x542f1800), - SPH_C32(0xd493295f), SPH_C32(0xa9d72eb7), SPH_C32(0x29377445), - SPH_C32(0xf8654232) }, - { SPH_C32(0x9e000000), SPH_C32(0xef850000), SPH_C32(0x49ca0022), - SPH_C32(0x41a91800), SPH_C32(0x456e61ac), SPH_C32(0xdc5695f4), - SPH_C32(0xdd5730db), SPH_C32(0x20d35651), SPH_C32(0xcd810000), - SPH_C32(0xb4980000), SPH_C32(0x4f71002f), SPH_C32(0x92442000), - SPH_C32(0x33a47583), SPH_C32(0xd07a116a), SPH_C32(0x85448a2a), - SPH_C32(0xc2213b83) }, - { SPH_C32(0xc6430000), SPH_C32(0x6ffb0000), SPH_C32(0x31f90023), - SPH_C32(0x87c22000), SPH_C32(0xa2593d70), SPH_C32(0xa5fbaa29), - SPH_C32(0x7124ceb4), SPH_C32(0x1a972fe0), SPH_C32(0xd0db0000), - SPH_C32(0x9fea0000), SPH_C32(0x07fc002f), SPH_C32(0x3d253800), - SPH_C32(0x166f5b46), SPH_C32(0x1803aeba), SPH_C32(0x04e68e03), - SPH_C32(0xdc540d25) }, - { SPH_C32(0x26610000), SPH_C32(0xd0d10000), SPH_C32(0x4f77003c), - SPH_C32(0x92660000), SPH_C32(0xef3b42bc), SPH_C32(0x6cf08019), - SPH_C32(0xabc45c2a), SPH_C32(0x35bd29b1), SPH_C32(0x8f750000), - SPH_C32(0xadc40000), SPH_C32(0xf8bb0024), SPH_C32(0x6c430000), - SPH_C32(0xb22a2434), SPH_C32(0x2969ffc3), SPH_C32(0x5ced124e), - SPH_C32(0x7665c55a) }, - { SPH_C32(0x7e220000), SPH_C32(0x50af0000), SPH_C32(0x3744003d), - SPH_C32(0x540d3800), SPH_C32(0x080c1e60), SPH_C32(0x155dbfc4), - SPH_C32(0x07b7a245), SPH_C32(0x0ff95000), SPH_C32(0x922f0000), - SPH_C32(0x86b60000), SPH_C32(0xb0360024), SPH_C32(0xc3221800), - SPH_C32(0x97e10af1), SPH_C32(0xe1104013), SPH_C32(0xdd4f1667), - SPH_C32(0x6810f3fc) }, - { SPH_C32(0x3b3b0000), SPH_C32(0xfba30000), SPH_C32(0x07fa003c), - SPH_C32(0x3d071800), SPH_C32(0xcaf06c79), SPH_C32(0xa4893fc9), - SPH_C32(0x2a665803), SPH_C32(0x2bc81f17), SPH_C32(0xca6c0000), - SPH_C32(0x06c80000), SPH_C32(0xc8050025), SPH_C32(0x05492000), - SPH_C32(0x70d6562d), SPH_C32(0x98bd7fce), SPH_C32(0x713ce808), - SPH_C32(0x52548a4d) }, - { SPH_C32(0x63780000), SPH_C32(0x7bdd0000), SPH_C32(0x7fc9003d), - SPH_C32(0xfb6c2000), SPH_C32(0x2dc730a5), SPH_C32(0xdd240014), - SPH_C32(0x8615a66c), SPH_C32(0x118c66a6), SPH_C32(0xd7360000), - SPH_C32(0x2dba0000), SPH_C32(0x80880025), SPH_C32(0xaa283800), - SPH_C32(0x551d78e8), SPH_C32(0x50c4c01e), SPH_C32(0xf09eec21), - SPH_C32(0x4c21bceb) }, - { SPH_C32(0x84b70000), SPH_C32(0x76a70000), SPH_C32(0x86330028), - SPH_C32(0x79c50000), SPH_C32(0x23d76cc7), SPH_C32(0x5ce84480), - SPH_C32(0xa88d56d0), SPH_C32(0xaed3d139), SPH_C32(0x2a4e0000), - SPH_C32(0xb9e20000), SPH_C32(0xb68b003a), SPH_C32(0x10ed0000), - SPH_C32(0x3db429e1), SPH_C32(0x51b655fe), SPH_C32(0xabdc7a96), - SPH_C32(0x7d7e8c1c) }, - { SPH_C32(0xdcf40000), SPH_C32(0xf6d90000), SPH_C32(0xfe000029), - SPH_C32(0xbfae3800), SPH_C32(0xc4e0301b), SPH_C32(0x25457b5d), - SPH_C32(0x04fea8bf), SPH_C32(0x9497a888), SPH_C32(0x37140000), - SPH_C32(0x92900000), SPH_C32(0xfe06003a), SPH_C32(0xbf8c1800), - SPH_C32(0x187f0724), SPH_C32(0x99cfea2e), SPH_C32(0x2a7e7ebf), - SPH_C32(0x630bbaba) }, - { SPH_C32(0x99ed0000), SPH_C32(0x5dd50000), SPH_C32(0xcebe0028), - SPH_C32(0xd6a41800), SPH_C32(0x061c4202), SPH_C32(0x9491fb50), - SPH_C32(0x292f52f9), SPH_C32(0xb0a6e79f), SPH_C32(0x6f570000), - SPH_C32(0x12ee0000), SPH_C32(0x8635003b), SPH_C32(0x79e72000), - SPH_C32(0xff485bf8), SPH_C32(0xe062d5f3), SPH_C32(0x860d80d0), - SPH_C32(0x594fc30b) }, - { SPH_C32(0xc1ae0000), SPH_C32(0xddab0000), SPH_C32(0xb68d0029), - SPH_C32(0x10cf2000), SPH_C32(0xe12b1ede), SPH_C32(0xed3cc48d), - SPH_C32(0x855cac96), SPH_C32(0x8ae29e2e), SPH_C32(0x720d0000), - SPH_C32(0x399c0000), SPH_C32(0xceb8003b), SPH_C32(0xd6863800), - SPH_C32(0xda83753d), SPH_C32(0x281b6a23), SPH_C32(0x07af84f9), - SPH_C32(0x473af5ad) }, - { SPH_C32(0x218c0000), SPH_C32(0x62810000), SPH_C32(0xc8030036), - SPH_C32(0x056b0000), SPH_C32(0xac496112), SPH_C32(0x2437eebd), - SPH_C32(0x5fbc3e08), SPH_C32(0xa5c8987f), SPH_C32(0x2da30000), - SPH_C32(0x0bb20000), SPH_C32(0x31ff0030), SPH_C32(0x87e00000), - SPH_C32(0x7ec60a4f), SPH_C32(0x19713b5a), SPH_C32(0x5fa418b4), - SPH_C32(0xed0b3dd2) }, - { SPH_C32(0x79cf0000), SPH_C32(0xe2ff0000), SPH_C32(0xb0300037), - SPH_C32(0xc3003800), SPH_C32(0x4b7e3dce), SPH_C32(0x5d9ad160), - SPH_C32(0xf3cfc067), SPH_C32(0x9f8ce1ce), SPH_C32(0x30f90000), - SPH_C32(0x20c00000), SPH_C32(0x79720030), SPH_C32(0x28811800), - SPH_C32(0x5b0d248a), SPH_C32(0xd108848a), SPH_C32(0xde061c9d), - SPH_C32(0xf37e0b74) }, - { SPH_C32(0x3cd60000), SPH_C32(0x49f30000), SPH_C32(0x808e0036), - SPH_C32(0xaa0a1800), SPH_C32(0x89824fd7), SPH_C32(0xec4e516d), - SPH_C32(0xde1e3a21), SPH_C32(0xbbbdaed9), SPH_C32(0x68ba0000), - SPH_C32(0xa0be0000), SPH_C32(0x01410031), SPH_C32(0xeeea2000), - SPH_C32(0xbc3a7856), SPH_C32(0xa8a5bb57), SPH_C32(0x7275e2f2), - SPH_C32(0xc93a72c5) }, - { SPH_C32(0x64950000), SPH_C32(0xc98d0000), SPH_C32(0xf8bd0037), - SPH_C32(0x6c612000), SPH_C32(0x6eb5130b), SPH_C32(0x95e36eb0), - SPH_C32(0x726dc44e), SPH_C32(0x81f9d768), SPH_C32(0x75e00000), - SPH_C32(0x8bcc0000), SPH_C32(0x49cc0031), SPH_C32(0x418b3800), - SPH_C32(0x99f15693), SPH_C32(0x60dc0487), SPH_C32(0xf3d7e6db), - SPH_C32(0xd74f4463) } -}; - -static const sph_u32 T512_48[64][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xb4310000), SPH_C32(0x77330000), SPH_C32(0xb15d0000), - SPH_C32(0x7fd004e0), SPH_C32(0x78a26138), SPH_C32(0xd116c35d), - SPH_C32(0xd256d489), SPH_C32(0x4e6f74de), SPH_C32(0xe3060000), - SPH_C32(0xbdc10000), SPH_C32(0x87130000), SPH_C32(0xbff20060), - SPH_C32(0x2eba0a1a), SPH_C32(0x8db53751), SPH_C32(0x73c5ab06), - SPH_C32(0x5bd61539) }, - { SPH_C32(0xe3060000), SPH_C32(0xbdc10000), SPH_C32(0x87130000), - SPH_C32(0xbff20060), SPH_C32(0x2eba0a1a), SPH_C32(0x8db53751), - SPH_C32(0x73c5ab06), SPH_C32(0x5bd61539), SPH_C32(0x57370000), - SPH_C32(0xcaf20000), SPH_C32(0x364e0000), SPH_C32(0xc0220480), - SPH_C32(0x56186b22), SPH_C32(0x5ca3f40c), SPH_C32(0xa1937f8f), - SPH_C32(0x15b961e7) }, - { SPH_C32(0x57370000), SPH_C32(0xcaf20000), SPH_C32(0x364e0000), - SPH_C32(0xc0220480), SPH_C32(0x56186b22), SPH_C32(0x5ca3f40c), - SPH_C32(0xa1937f8f), SPH_C32(0x15b961e7), SPH_C32(0xb4310000), - SPH_C32(0x77330000), SPH_C32(0xb15d0000), SPH_C32(0x7fd004e0), - SPH_C32(0x78a26138), SPH_C32(0xd116c35d), SPH_C32(0xd256d489), - SPH_C32(0x4e6f74de) }, - { SPH_C32(0x02f20000), SPH_C32(0xa2810000), SPH_C32(0x873f0000), - SPH_C32(0xe36c7800), SPH_C32(0x1e1d74ef), SPH_C32(0x073d2bd6), - SPH_C32(0xc4c23237), SPH_C32(0x7f32259e), SPH_C32(0xbadd0000), - SPH_C32(0x13ad0000), SPH_C32(0xb7e70000), SPH_C32(0xf7282800), - SPH_C32(0xdf45144d), SPH_C32(0x361ac33a), SPH_C32(0xea5a8d14), - SPH_C32(0x2a2c18f0) }, - { SPH_C32(0xb6c30000), SPH_C32(0xd5b20000), SPH_C32(0x36620000), - SPH_C32(0x9cbc7ce0), SPH_C32(0x66bf15d7), SPH_C32(0xd62be88b), - SPH_C32(0x1694e6be), SPH_C32(0x315d5140), SPH_C32(0x59db0000), - SPH_C32(0xae6c0000), SPH_C32(0x30f40000), SPH_C32(0x48da2860), - SPH_C32(0xf1ff1e57), SPH_C32(0xbbaff46b), SPH_C32(0x999f2612), - SPH_C32(0x71fa0dc9) }, - { SPH_C32(0xe1f40000), SPH_C32(0x1f400000), SPH_C32(0x002c0000), - SPH_C32(0x5c9e7860), SPH_C32(0x30a77ef5), SPH_C32(0x8a881c87), - SPH_C32(0xb7079931), SPH_C32(0x24e430a7), SPH_C32(0xedea0000), - SPH_C32(0xd95f0000), SPH_C32(0x81a90000), SPH_C32(0x370a2c80), - SPH_C32(0x895d7f6f), SPH_C32(0x6ab93736), SPH_C32(0x4bc9f29b), - SPH_C32(0x3f957917) }, - { SPH_C32(0x55c50000), SPH_C32(0x68730000), SPH_C32(0xb1710000), - SPH_C32(0x234e7c80), SPH_C32(0x48051fcd), SPH_C32(0x5b9edfda), - SPH_C32(0x65514db8), SPH_C32(0x6a8b4479), SPH_C32(0x0eec0000), - SPH_C32(0x649e0000), SPH_C32(0x06ba0000), SPH_C32(0x88f82ce0), - SPH_C32(0xa7e77575), SPH_C32(0xe70c0067), SPH_C32(0x380c599d), - SPH_C32(0x64436c2e) }, - { SPH_C32(0xbadd0000), SPH_C32(0x13ad0000), SPH_C32(0xb7e70000), - SPH_C32(0xf7282800), SPH_C32(0xdf45144d), SPH_C32(0x361ac33a), - SPH_C32(0xea5a8d14), SPH_C32(0x2a2c18f0), SPH_C32(0xb82f0000), - SPH_C32(0xb12c0000), SPH_C32(0x30d80000), SPH_C32(0x14445000), - SPH_C32(0xc15860a2), SPH_C32(0x3127e8ec), SPH_C32(0x2e98bf23), - SPH_C32(0x551e3d6e) }, - { SPH_C32(0x0eec0000), SPH_C32(0x649e0000), SPH_C32(0x06ba0000), - SPH_C32(0x88f82ce0), SPH_C32(0xa7e77575), SPH_C32(0xe70c0067), - SPH_C32(0x380c599d), SPH_C32(0x64436c2e), SPH_C32(0x5b290000), - SPH_C32(0x0ced0000), SPH_C32(0xb7cb0000), SPH_C32(0xabb65060), - SPH_C32(0xefe26ab8), SPH_C32(0xbc92dfbd), SPH_C32(0x5d5d1425), - SPH_C32(0x0ec82857) }, - { SPH_C32(0x59db0000), SPH_C32(0xae6c0000), SPH_C32(0x30f40000), - SPH_C32(0x48da2860), SPH_C32(0xf1ff1e57), SPH_C32(0xbbaff46b), - SPH_C32(0x999f2612), SPH_C32(0x71fa0dc9), SPH_C32(0xef180000), - SPH_C32(0x7bde0000), SPH_C32(0x06960000), SPH_C32(0xd4665480), - SPH_C32(0x97400b80), SPH_C32(0x6d841ce0), SPH_C32(0x8f0bc0ac), - SPH_C32(0x40a75c89) }, - { SPH_C32(0xedea0000), SPH_C32(0xd95f0000), SPH_C32(0x81a90000), - SPH_C32(0x370a2c80), SPH_C32(0x895d7f6f), SPH_C32(0x6ab93736), - SPH_C32(0x4bc9f29b), SPH_C32(0x3f957917), SPH_C32(0x0c1e0000), - SPH_C32(0xc61f0000), SPH_C32(0x81850000), SPH_C32(0x6b9454e0), - SPH_C32(0xb9fa019a), SPH_C32(0xe0312bb1), SPH_C32(0xfcce6baa), - SPH_C32(0x1b7149b0) }, - { SPH_C32(0xb82f0000), SPH_C32(0xb12c0000), SPH_C32(0x30d80000), - SPH_C32(0x14445000), SPH_C32(0xc15860a2), SPH_C32(0x3127e8ec), - SPH_C32(0x2e98bf23), SPH_C32(0x551e3d6e), SPH_C32(0x02f20000), - SPH_C32(0xa2810000), SPH_C32(0x873f0000), SPH_C32(0xe36c7800), - SPH_C32(0x1e1d74ef), SPH_C32(0x073d2bd6), SPH_C32(0xc4c23237), - SPH_C32(0x7f32259e) }, - { SPH_C32(0x0c1e0000), SPH_C32(0xc61f0000), SPH_C32(0x81850000), - SPH_C32(0x6b9454e0), SPH_C32(0xb9fa019a), SPH_C32(0xe0312bb1), - SPH_C32(0xfcce6baa), SPH_C32(0x1b7149b0), SPH_C32(0xe1f40000), - SPH_C32(0x1f400000), SPH_C32(0x002c0000), SPH_C32(0x5c9e7860), - SPH_C32(0x30a77ef5), SPH_C32(0x8a881c87), SPH_C32(0xb7079931), - SPH_C32(0x24e430a7) }, - { SPH_C32(0x5b290000), SPH_C32(0x0ced0000), SPH_C32(0xb7cb0000), - SPH_C32(0xabb65060), SPH_C32(0xefe26ab8), SPH_C32(0xbc92dfbd), - SPH_C32(0x5d5d1425), SPH_C32(0x0ec82857), SPH_C32(0x55c50000), - SPH_C32(0x68730000), SPH_C32(0xb1710000), SPH_C32(0x234e7c80), - SPH_C32(0x48051fcd), SPH_C32(0x5b9edfda), SPH_C32(0x65514db8), - SPH_C32(0x6a8b4479) }, - { SPH_C32(0xef180000), SPH_C32(0x7bde0000), SPH_C32(0x06960000), - SPH_C32(0xd4665480), SPH_C32(0x97400b80), SPH_C32(0x6d841ce0), - SPH_C32(0x8f0bc0ac), SPH_C32(0x40a75c89), SPH_C32(0xb6c30000), - SPH_C32(0xd5b20000), SPH_C32(0x36620000), SPH_C32(0x9cbc7ce0), - SPH_C32(0x66bf15d7), SPH_C32(0xd62be88b), SPH_C32(0x1694e6be), - SPH_C32(0x315d5140) }, - { SPH_C32(0x1e6c0000), SPH_C32(0xc4420000), SPH_C32(0x8a2e0000), - SPH_C32(0xbcb6b800), SPH_C32(0x2c4413b6), SPH_C32(0x8bfdd3da), - SPH_C32(0x6a0c1bc8), SPH_C32(0xb99dc2eb), SPH_C32(0x92560000), - SPH_C32(0x1eda0000), SPH_C32(0xea510000), SPH_C32(0xe8b13000), - SPH_C32(0xa93556a5), SPH_C32(0xebfb6199), SPH_C32(0xb15c2254), - SPH_C32(0x33c5244f) }, - { SPH_C32(0xaa5d0000), SPH_C32(0xb3710000), SPH_C32(0x3b730000), - SPH_C32(0xc366bce0), SPH_C32(0x54e6728e), SPH_C32(0x5aeb1087), - SPH_C32(0xb85acf41), SPH_C32(0xf7f2b635), SPH_C32(0x71500000), - SPH_C32(0xa31b0000), SPH_C32(0x6d420000), SPH_C32(0x57433060), - SPH_C32(0x878f5cbf), SPH_C32(0x664e56c8), SPH_C32(0xc2998952), - SPH_C32(0x68133176) }, - { SPH_C32(0xfd6a0000), SPH_C32(0x79830000), SPH_C32(0x0d3d0000), - SPH_C32(0x0344b860), SPH_C32(0x02fe19ac), SPH_C32(0x0648e48b), - SPH_C32(0x19c9b0ce), SPH_C32(0xe24bd7d2), SPH_C32(0xc5610000), - SPH_C32(0xd4280000), SPH_C32(0xdc1f0000), SPH_C32(0x28933480), - SPH_C32(0xff2d3d87), SPH_C32(0xb7589595), SPH_C32(0x10cf5ddb), - SPH_C32(0x267c45a8) }, - { SPH_C32(0x495b0000), SPH_C32(0x0eb00000), SPH_C32(0xbc600000), - SPH_C32(0x7c94bc80), SPH_C32(0x7a5c7894), SPH_C32(0xd75e27d6), - SPH_C32(0xcb9f6447), SPH_C32(0xac24a30c), SPH_C32(0x26670000), - SPH_C32(0x69e90000), SPH_C32(0x5b0c0000), SPH_C32(0x976134e0), - SPH_C32(0xd197379d), SPH_C32(0x3aeda2c4), SPH_C32(0x630af6dd), - SPH_C32(0x7daa5091) }, - { SPH_C32(0x1c9e0000), SPH_C32(0x66c30000), SPH_C32(0x0d110000), - SPH_C32(0x5fdac000), SPH_C32(0x32596759), SPH_C32(0x8cc0f80c), - SPH_C32(0xaece29ff), SPH_C32(0xc6afe775), SPH_C32(0x288b0000), - SPH_C32(0x0d770000), SPH_C32(0x5db60000), SPH_C32(0x1f991800), - SPH_C32(0x767042e8), SPH_C32(0xdde1a2a3), SPH_C32(0x5b06af40), - SPH_C32(0x19e93cbf) }, - { SPH_C32(0xa8af0000), SPH_C32(0x11f00000), SPH_C32(0xbc4c0000), - SPH_C32(0x200ac4e0), SPH_C32(0x4afb0661), SPH_C32(0x5dd63b51), - SPH_C32(0x7c98fd76), SPH_C32(0x88c093ab), SPH_C32(0xcb8d0000), - SPH_C32(0xb0b60000), SPH_C32(0xdaa50000), SPH_C32(0xa06b1860), - SPH_C32(0x58ca48f2), SPH_C32(0x505495f2), SPH_C32(0x28c30446), - SPH_C32(0x423f2986) }, - { SPH_C32(0xff980000), SPH_C32(0xdb020000), SPH_C32(0x8a020000), - SPH_C32(0xe028c060), SPH_C32(0x1ce36d43), SPH_C32(0x0175cf5d), - SPH_C32(0xdd0b82f9), SPH_C32(0x9d79f24c), SPH_C32(0x7fbc0000), - SPH_C32(0xc7850000), SPH_C32(0x6bf80000), SPH_C32(0xdfbb1c80), - SPH_C32(0x206829ca), SPH_C32(0x814256af), SPH_C32(0xfa95d0cf), - SPH_C32(0x0c505d58) }, - { SPH_C32(0x4ba90000), SPH_C32(0xac310000), SPH_C32(0x3b5f0000), - SPH_C32(0x9ff8c480), SPH_C32(0x64410c7b), SPH_C32(0xd0630c00), - SPH_C32(0x0f5d5670), SPH_C32(0xd3168692), SPH_C32(0x9cba0000), - SPH_C32(0x7a440000), SPH_C32(0xeceb0000), SPH_C32(0x60491ce0), - SPH_C32(0x0ed223d0), SPH_C32(0x0cf761fe), SPH_C32(0x89507bc9), - SPH_C32(0x57864861) }, - { SPH_C32(0xa4b10000), SPH_C32(0xd7ef0000), SPH_C32(0x3dc90000), - SPH_C32(0x4b9e9000), SPH_C32(0xf30107fb), SPH_C32(0xbde710e0), - SPH_C32(0x805696dc), SPH_C32(0x93b1da1b), SPH_C32(0x2a790000), - SPH_C32(0xaff60000), SPH_C32(0xda890000), SPH_C32(0xfcf56000), - SPH_C32(0x686d3607), SPH_C32(0xdadc8975), SPH_C32(0x9fc49d77), - SPH_C32(0x66db1921) }, - { SPH_C32(0x10800000), SPH_C32(0xa0dc0000), SPH_C32(0x8c940000), - SPH_C32(0x344e94e0), SPH_C32(0x8ba366c3), SPH_C32(0x6cf1d3bd), - SPH_C32(0x52004255), SPH_C32(0xdddeaec5), SPH_C32(0xc97f0000), - SPH_C32(0x12370000), SPH_C32(0x5d9a0000), SPH_C32(0x43076060), - SPH_C32(0x46d73c1d), SPH_C32(0x5769be24), SPH_C32(0xec013671), - SPH_C32(0x3d0d0c18) }, - { SPH_C32(0x47b70000), SPH_C32(0x6a2e0000), SPH_C32(0xbada0000), - SPH_C32(0xf46c9060), SPH_C32(0xddbb0de1), SPH_C32(0x305227b1), - SPH_C32(0xf3933dda), SPH_C32(0xc867cf22), SPH_C32(0x7d4e0000), - SPH_C32(0x65040000), SPH_C32(0xecc70000), SPH_C32(0x3cd76480), - SPH_C32(0x3e755d25), SPH_C32(0x867f7d79), SPH_C32(0x3e57e2f8), - SPH_C32(0x736278c6) }, - { SPH_C32(0xf3860000), SPH_C32(0x1d1d0000), SPH_C32(0x0b870000), - SPH_C32(0x8bbc9480), SPH_C32(0xa5196cd9), SPH_C32(0xe144e4ec), - SPH_C32(0x21c5e953), SPH_C32(0x8608bbfc), SPH_C32(0x9e480000), - SPH_C32(0xd8c50000), SPH_C32(0x6bd40000), SPH_C32(0x832564e0), - SPH_C32(0x10cf573f), SPH_C32(0x0bca4a28), SPH_C32(0x4d9249fe), - SPH_C32(0x28b46dff) }, - { SPH_C32(0xa6430000), SPH_C32(0x756e0000), SPH_C32(0xbaf60000), - SPH_C32(0xa8f2e800), SPH_C32(0xed1c7314), SPH_C32(0xbada3b36), - SPH_C32(0x4494a4eb), SPH_C32(0xec83ff85), SPH_C32(0x90a40000), - SPH_C32(0xbc5b0000), SPH_C32(0x6d6e0000), SPH_C32(0x0bdd4800), - SPH_C32(0xb728224a), SPH_C32(0xecc64a4f), SPH_C32(0x759e1063), - SPH_C32(0x4cf701d1) }, - { SPH_C32(0x12720000), SPH_C32(0x025d0000), SPH_C32(0x0bab0000), - SPH_C32(0xd722ece0), SPH_C32(0x95be122c), SPH_C32(0x6bccf86b), - SPH_C32(0x96c27062), SPH_C32(0xa2ec8b5b), SPH_C32(0x73a20000), - SPH_C32(0x019a0000), SPH_C32(0xea7d0000), SPH_C32(0xb42f4860), - SPH_C32(0x99922850), SPH_C32(0x61737d1e), SPH_C32(0x065bbb65), - SPH_C32(0x172114e8) }, - { SPH_C32(0x45450000), SPH_C32(0xc8af0000), SPH_C32(0x3de50000), - SPH_C32(0x1700e860), SPH_C32(0xc3a6790e), SPH_C32(0x376f0c67), - SPH_C32(0x37510fed), SPH_C32(0xb755eabc), SPH_C32(0xc7930000), - SPH_C32(0x76a90000), SPH_C32(0x5b200000), SPH_C32(0xcbff4c80), - SPH_C32(0xe1304968), SPH_C32(0xb065be43), SPH_C32(0xd40d6fec), - SPH_C32(0x594e6036) }, - { SPH_C32(0xf1740000), SPH_C32(0xbf9c0000), SPH_C32(0x8cb80000), - SPH_C32(0x68d0ec80), SPH_C32(0xbb041836), SPH_C32(0xe679cf3a), - SPH_C32(0xe507db64), SPH_C32(0xf93a9e62), SPH_C32(0x24950000), - SPH_C32(0xcb680000), SPH_C32(0xdc330000), SPH_C32(0x740d4ce0), - SPH_C32(0xcf8a4372), SPH_C32(0x3dd08912), SPH_C32(0xa7c8c4ea), - SPH_C32(0x0298750f) }, - { SPH_C32(0x92560000), SPH_C32(0x1eda0000), SPH_C32(0xea510000), - SPH_C32(0xe8b13000), SPH_C32(0xa93556a5), SPH_C32(0xebfb6199), - SPH_C32(0xb15c2254), SPH_C32(0x33c5244f), SPH_C32(0x8c3a0000), - SPH_C32(0xda980000), SPH_C32(0x607f0000), SPH_C32(0x54078800), - SPH_C32(0x85714513), SPH_C32(0x6006b243), SPH_C32(0xdb50399c), - SPH_C32(0x8a58e6a4) }, - { SPH_C32(0x26670000), SPH_C32(0x69e90000), SPH_C32(0x5b0c0000), - SPH_C32(0x976134e0), SPH_C32(0xd197379d), SPH_C32(0x3aeda2c4), - SPH_C32(0x630af6dd), SPH_C32(0x7daa5091), SPH_C32(0x6f3c0000), - SPH_C32(0x67590000), SPH_C32(0xe76c0000), SPH_C32(0xebf58860), - SPH_C32(0xabcb4f09), SPH_C32(0xedb38512), SPH_C32(0xa895929a), - SPH_C32(0xd18ef39d) }, - { SPH_C32(0x71500000), SPH_C32(0xa31b0000), SPH_C32(0x6d420000), - SPH_C32(0x57433060), SPH_C32(0x878f5cbf), SPH_C32(0x664e56c8), - SPH_C32(0xc2998952), SPH_C32(0x68133176), SPH_C32(0xdb0d0000), - SPH_C32(0x106a0000), SPH_C32(0x56310000), SPH_C32(0x94258c80), - SPH_C32(0xd3692e31), SPH_C32(0x3ca5464f), SPH_C32(0x7ac34613), - SPH_C32(0x9fe18743) }, - { SPH_C32(0xc5610000), SPH_C32(0xd4280000), SPH_C32(0xdc1f0000), - SPH_C32(0x28933480), SPH_C32(0xff2d3d87), SPH_C32(0xb7589595), - SPH_C32(0x10cf5ddb), SPH_C32(0x267c45a8), SPH_C32(0x380b0000), - SPH_C32(0xadab0000), SPH_C32(0xd1220000), SPH_C32(0x2bd78ce0), - SPH_C32(0xfdd3242b), SPH_C32(0xb110711e), SPH_C32(0x0906ed15), - SPH_C32(0xc437927a) }, - { SPH_C32(0x90a40000), SPH_C32(0xbc5b0000), SPH_C32(0x6d6e0000), - SPH_C32(0x0bdd4800), SPH_C32(0xb728224a), SPH_C32(0xecc64a4f), - SPH_C32(0x759e1063), SPH_C32(0x4cf701d1), SPH_C32(0x36e70000), - SPH_C32(0xc9350000), SPH_C32(0xd7980000), SPH_C32(0xa32fa000), - SPH_C32(0x5a34515e), SPH_C32(0x561c7179), SPH_C32(0x310ab488), - SPH_C32(0xa074fe54) }, - { SPH_C32(0x24950000), SPH_C32(0xcb680000), SPH_C32(0xdc330000), - SPH_C32(0x740d4ce0), SPH_C32(0xcf8a4372), SPH_C32(0x3dd08912), - SPH_C32(0xa7c8c4ea), SPH_C32(0x0298750f), SPH_C32(0xd5e10000), - SPH_C32(0x74f40000), SPH_C32(0x508b0000), SPH_C32(0x1cdda060), - SPH_C32(0x748e5b44), SPH_C32(0xdba94628), SPH_C32(0x42cf1f8e), - SPH_C32(0xfba2eb6d) }, - { SPH_C32(0x73a20000), SPH_C32(0x019a0000), SPH_C32(0xea7d0000), - SPH_C32(0xb42f4860), SPH_C32(0x99922850), SPH_C32(0x61737d1e), - SPH_C32(0x065bbb65), SPH_C32(0x172114e8), SPH_C32(0x61d00000), - SPH_C32(0x03c70000), SPH_C32(0xe1d60000), SPH_C32(0x630da480), - SPH_C32(0x0c2c3a7c), SPH_C32(0x0abf8575), SPH_C32(0x9099cb07), - SPH_C32(0xb5cd9fb3) }, - { SPH_C32(0xc7930000), SPH_C32(0x76a90000), SPH_C32(0x5b200000), - SPH_C32(0xcbff4c80), SPH_C32(0xe1304968), SPH_C32(0xb065be43), - SPH_C32(0xd40d6fec), SPH_C32(0x594e6036), SPH_C32(0x82d60000), - SPH_C32(0xbe060000), SPH_C32(0x66c50000), SPH_C32(0xdcffa4e0), - SPH_C32(0x22963066), SPH_C32(0x870ab224), SPH_C32(0xe35c6001), - SPH_C32(0xee1b8a8a) }, - { SPH_C32(0x288b0000), SPH_C32(0x0d770000), SPH_C32(0x5db60000), - SPH_C32(0x1f991800), SPH_C32(0x767042e8), SPH_C32(0xdde1a2a3), - SPH_C32(0x5b06af40), SPH_C32(0x19e93cbf), SPH_C32(0x34150000), - SPH_C32(0x6bb40000), SPH_C32(0x50a70000), SPH_C32(0x4043d800), - SPH_C32(0x442925b1), SPH_C32(0x51215aaf), SPH_C32(0xf5c886bf), - SPH_C32(0xdf46dbca) }, - { SPH_C32(0x9cba0000), SPH_C32(0x7a440000), SPH_C32(0xeceb0000), - SPH_C32(0x60491ce0), SPH_C32(0x0ed223d0), SPH_C32(0x0cf761fe), - SPH_C32(0x89507bc9), SPH_C32(0x57864861), SPH_C32(0xd7130000), - SPH_C32(0xd6750000), SPH_C32(0xd7b40000), SPH_C32(0xffb1d860), - SPH_C32(0x6a932fab), SPH_C32(0xdc946dfe), SPH_C32(0x860d2db9), - SPH_C32(0x8490cef3) }, - { SPH_C32(0xcb8d0000), SPH_C32(0xb0b60000), SPH_C32(0xdaa50000), - SPH_C32(0xa06b1860), SPH_C32(0x58ca48f2), SPH_C32(0x505495f2), - SPH_C32(0x28c30446), SPH_C32(0x423f2986), SPH_C32(0x63220000), - SPH_C32(0xa1460000), SPH_C32(0x66e90000), SPH_C32(0x8061dc80), - SPH_C32(0x12314e93), SPH_C32(0x0d82aea3), SPH_C32(0x545bf930), - SPH_C32(0xcaffba2d) }, - { SPH_C32(0x7fbc0000), SPH_C32(0xc7850000), SPH_C32(0x6bf80000), - SPH_C32(0xdfbb1c80), SPH_C32(0x206829ca), SPH_C32(0x814256af), - SPH_C32(0xfa95d0cf), SPH_C32(0x0c505d58), SPH_C32(0x80240000), - SPH_C32(0x1c870000), SPH_C32(0xe1fa0000), SPH_C32(0x3f93dce0), - SPH_C32(0x3c8b4489), SPH_C32(0x803799f2), SPH_C32(0x279e5236), - SPH_C32(0x9129af14) }, - { SPH_C32(0x2a790000), SPH_C32(0xaff60000), SPH_C32(0xda890000), - SPH_C32(0xfcf56000), SPH_C32(0x686d3607), SPH_C32(0xdadc8975), - SPH_C32(0x9fc49d77), SPH_C32(0x66db1921), SPH_C32(0x8ec80000), - SPH_C32(0x78190000), SPH_C32(0xe7400000), SPH_C32(0xb76bf000), - SPH_C32(0x9b6c31fc), SPH_C32(0x673b9995), SPH_C32(0x1f920bab), - SPH_C32(0xf56ac33a) }, - { SPH_C32(0x9e480000), SPH_C32(0xd8c50000), SPH_C32(0x6bd40000), - SPH_C32(0x832564e0), SPH_C32(0x10cf573f), SPH_C32(0x0bca4a28), - SPH_C32(0x4d9249fe), SPH_C32(0x28b46dff), SPH_C32(0x6dce0000), - SPH_C32(0xc5d80000), SPH_C32(0x60530000), SPH_C32(0x0899f060), - SPH_C32(0xb5d63be6), SPH_C32(0xea8eaec4), SPH_C32(0x6c57a0ad), - SPH_C32(0xaebcd603) }, - { SPH_C32(0xc97f0000), SPH_C32(0x12370000), SPH_C32(0x5d9a0000), - SPH_C32(0x43076060), SPH_C32(0x46d73c1d), SPH_C32(0x5769be24), - SPH_C32(0xec013671), SPH_C32(0x3d0d0c18), SPH_C32(0xd9ff0000), - SPH_C32(0xb2eb0000), SPH_C32(0xd10e0000), SPH_C32(0x7749f480), - SPH_C32(0xcd745ade), SPH_C32(0x3b986d99), SPH_C32(0xbe017424), - SPH_C32(0xe0d3a2dd) }, - { SPH_C32(0x7d4e0000), SPH_C32(0x65040000), SPH_C32(0xecc70000), - SPH_C32(0x3cd76480), SPH_C32(0x3e755d25), SPH_C32(0x867f7d79), - SPH_C32(0x3e57e2f8), SPH_C32(0x736278c6), SPH_C32(0x3af90000), - SPH_C32(0x0f2a0000), SPH_C32(0x561d0000), SPH_C32(0xc8bbf4e0), - SPH_C32(0xe3ce50c4), SPH_C32(0xb62d5ac8), SPH_C32(0xcdc4df22), - SPH_C32(0xbb05b7e4) }, - { SPH_C32(0x8c3a0000), SPH_C32(0xda980000), SPH_C32(0x607f0000), - SPH_C32(0x54078800), SPH_C32(0x85714513), SPH_C32(0x6006b243), - SPH_C32(0xdb50399c), SPH_C32(0x8a58e6a4), SPH_C32(0x1e6c0000), - SPH_C32(0xc4420000), SPH_C32(0x8a2e0000), SPH_C32(0xbcb6b800), - SPH_C32(0x2c4413b6), SPH_C32(0x8bfdd3da), SPH_C32(0x6a0c1bc8), - SPH_C32(0xb99dc2eb) }, - { SPH_C32(0x380b0000), SPH_C32(0xadab0000), SPH_C32(0xd1220000), - SPH_C32(0x2bd78ce0), SPH_C32(0xfdd3242b), SPH_C32(0xb110711e), - SPH_C32(0x0906ed15), SPH_C32(0xc437927a), SPH_C32(0xfd6a0000), - SPH_C32(0x79830000), SPH_C32(0x0d3d0000), SPH_C32(0x0344b860), - SPH_C32(0x02fe19ac), SPH_C32(0x0648e48b), SPH_C32(0x19c9b0ce), - SPH_C32(0xe24bd7d2) }, - { SPH_C32(0x6f3c0000), SPH_C32(0x67590000), SPH_C32(0xe76c0000), - SPH_C32(0xebf58860), SPH_C32(0xabcb4f09), SPH_C32(0xedb38512), - SPH_C32(0xa895929a), SPH_C32(0xd18ef39d), SPH_C32(0x495b0000), - SPH_C32(0x0eb00000), SPH_C32(0xbc600000), SPH_C32(0x7c94bc80), - SPH_C32(0x7a5c7894), SPH_C32(0xd75e27d6), SPH_C32(0xcb9f6447), - SPH_C32(0xac24a30c) }, - { SPH_C32(0xdb0d0000), SPH_C32(0x106a0000), SPH_C32(0x56310000), - SPH_C32(0x94258c80), SPH_C32(0xd3692e31), SPH_C32(0x3ca5464f), - SPH_C32(0x7ac34613), SPH_C32(0x9fe18743), SPH_C32(0xaa5d0000), - SPH_C32(0xb3710000), SPH_C32(0x3b730000), SPH_C32(0xc366bce0), - SPH_C32(0x54e6728e), SPH_C32(0x5aeb1087), SPH_C32(0xb85acf41), - SPH_C32(0xf7f2b635) }, - { SPH_C32(0x8ec80000), SPH_C32(0x78190000), SPH_C32(0xe7400000), - SPH_C32(0xb76bf000), SPH_C32(0x9b6c31fc), SPH_C32(0x673b9995), - SPH_C32(0x1f920bab), SPH_C32(0xf56ac33a), SPH_C32(0xa4b10000), - SPH_C32(0xd7ef0000), SPH_C32(0x3dc90000), SPH_C32(0x4b9e9000), - SPH_C32(0xf30107fb), SPH_C32(0xbde710e0), SPH_C32(0x805696dc), - SPH_C32(0x93b1da1b) }, - { SPH_C32(0x3af90000), SPH_C32(0x0f2a0000), SPH_C32(0x561d0000), - SPH_C32(0xc8bbf4e0), SPH_C32(0xe3ce50c4), SPH_C32(0xb62d5ac8), - SPH_C32(0xcdc4df22), SPH_C32(0xbb05b7e4), SPH_C32(0x47b70000), - SPH_C32(0x6a2e0000), SPH_C32(0xbada0000), SPH_C32(0xf46c9060), - SPH_C32(0xddbb0de1), SPH_C32(0x305227b1), SPH_C32(0xf3933dda), - SPH_C32(0xc867cf22) }, - { SPH_C32(0x6dce0000), SPH_C32(0xc5d80000), SPH_C32(0x60530000), - SPH_C32(0x0899f060), SPH_C32(0xb5d63be6), SPH_C32(0xea8eaec4), - SPH_C32(0x6c57a0ad), SPH_C32(0xaebcd603), SPH_C32(0xf3860000), - SPH_C32(0x1d1d0000), SPH_C32(0x0b870000), SPH_C32(0x8bbc9480), - SPH_C32(0xa5196cd9), SPH_C32(0xe144e4ec), SPH_C32(0x21c5e953), - SPH_C32(0x8608bbfc) }, - { SPH_C32(0xd9ff0000), SPH_C32(0xb2eb0000), SPH_C32(0xd10e0000), - SPH_C32(0x7749f480), SPH_C32(0xcd745ade), SPH_C32(0x3b986d99), - SPH_C32(0xbe017424), SPH_C32(0xe0d3a2dd), SPH_C32(0x10800000), - SPH_C32(0xa0dc0000), SPH_C32(0x8c940000), SPH_C32(0x344e94e0), - SPH_C32(0x8ba366c3), SPH_C32(0x6cf1d3bd), SPH_C32(0x52004255), - SPH_C32(0xdddeaec5) }, - { SPH_C32(0x36e70000), SPH_C32(0xc9350000), SPH_C32(0xd7980000), - SPH_C32(0xa32fa000), SPH_C32(0x5a34515e), SPH_C32(0x561c7179), - SPH_C32(0x310ab488), SPH_C32(0xa074fe54), SPH_C32(0xa6430000), - SPH_C32(0x756e0000), SPH_C32(0xbaf60000), SPH_C32(0xa8f2e800), - SPH_C32(0xed1c7314), SPH_C32(0xbada3b36), SPH_C32(0x4494a4eb), - SPH_C32(0xec83ff85) }, - { SPH_C32(0x82d60000), SPH_C32(0xbe060000), SPH_C32(0x66c50000), - SPH_C32(0xdcffa4e0), SPH_C32(0x22963066), SPH_C32(0x870ab224), - SPH_C32(0xe35c6001), SPH_C32(0xee1b8a8a), SPH_C32(0x45450000), - SPH_C32(0xc8af0000), SPH_C32(0x3de50000), SPH_C32(0x1700e860), - SPH_C32(0xc3a6790e), SPH_C32(0x376f0c67), SPH_C32(0x37510fed), - SPH_C32(0xb755eabc) }, - { SPH_C32(0xd5e10000), SPH_C32(0x74f40000), SPH_C32(0x508b0000), - SPH_C32(0x1cdda060), SPH_C32(0x748e5b44), SPH_C32(0xdba94628), - SPH_C32(0x42cf1f8e), SPH_C32(0xfba2eb6d), SPH_C32(0xf1740000), - SPH_C32(0xbf9c0000), SPH_C32(0x8cb80000), SPH_C32(0x68d0ec80), - SPH_C32(0xbb041836), SPH_C32(0xe679cf3a), SPH_C32(0xe507db64), - SPH_C32(0xf93a9e62) }, - { SPH_C32(0x61d00000), SPH_C32(0x03c70000), SPH_C32(0xe1d60000), - SPH_C32(0x630da480), SPH_C32(0x0c2c3a7c), SPH_C32(0x0abf8575), - SPH_C32(0x9099cb07), SPH_C32(0xb5cd9fb3), SPH_C32(0x12720000), - SPH_C32(0x025d0000), SPH_C32(0x0bab0000), SPH_C32(0xd722ece0), - SPH_C32(0x95be122c), SPH_C32(0x6bccf86b), SPH_C32(0x96c27062), - SPH_C32(0xa2ec8b5b) }, - { SPH_C32(0x34150000), SPH_C32(0x6bb40000), SPH_C32(0x50a70000), - SPH_C32(0x4043d800), SPH_C32(0x442925b1), SPH_C32(0x51215aaf), - SPH_C32(0xf5c886bf), SPH_C32(0xdf46dbca), SPH_C32(0x1c9e0000), - SPH_C32(0x66c30000), SPH_C32(0x0d110000), SPH_C32(0x5fdac000), - SPH_C32(0x32596759), SPH_C32(0x8cc0f80c), SPH_C32(0xaece29ff), - SPH_C32(0xc6afe775) }, - { SPH_C32(0x80240000), SPH_C32(0x1c870000), SPH_C32(0xe1fa0000), - SPH_C32(0x3f93dce0), SPH_C32(0x3c8b4489), SPH_C32(0x803799f2), - SPH_C32(0x279e5236), SPH_C32(0x9129af14), SPH_C32(0xff980000), - SPH_C32(0xdb020000), SPH_C32(0x8a020000), SPH_C32(0xe028c060), - SPH_C32(0x1ce36d43), SPH_C32(0x0175cf5d), SPH_C32(0xdd0b82f9), - SPH_C32(0x9d79f24c) }, - { SPH_C32(0xd7130000), SPH_C32(0xd6750000), SPH_C32(0xd7b40000), - SPH_C32(0xffb1d860), SPH_C32(0x6a932fab), SPH_C32(0xdc946dfe), - SPH_C32(0x860d2db9), SPH_C32(0x8490cef3), SPH_C32(0x4ba90000), - SPH_C32(0xac310000), SPH_C32(0x3b5f0000), SPH_C32(0x9ff8c480), - SPH_C32(0x64410c7b), SPH_C32(0xd0630c00), SPH_C32(0x0f5d5670), - SPH_C32(0xd3168692) }, - { SPH_C32(0x63220000), SPH_C32(0xa1460000), SPH_C32(0x66e90000), - SPH_C32(0x8061dc80), SPH_C32(0x12314e93), SPH_C32(0x0d82aea3), - SPH_C32(0x545bf930), SPH_C32(0xcaffba2d), SPH_C32(0xa8af0000), - SPH_C32(0x11f00000), SPH_C32(0xbc4c0000), SPH_C32(0x200ac4e0), - SPH_C32(0x4afb0661), SPH_C32(0x5dd63b51), SPH_C32(0x7c98fd76), - SPH_C32(0x88c093ab) } -}; - -static const sph_u32 T512_54[64][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x5fa80000), SPH_C32(0x56030000), SPH_C32(0x43ae0000), - SPH_C32(0x64f30013), SPH_C32(0x257e86bf), SPH_C32(0x1311944e), - SPH_C32(0x541e95bf), SPH_C32(0x8ea4db69), SPH_C32(0x00440000), - SPH_C32(0x7f480000), SPH_C32(0xda7c0000), SPH_C32(0x2a230001), - SPH_C32(0x3badc9cc), SPH_C32(0xa9b69c87), SPH_C32(0x030a9e60), - SPH_C32(0xbe0a679e) }, - { SPH_C32(0x00440000), SPH_C32(0x7f480000), SPH_C32(0xda7c0000), - SPH_C32(0x2a230001), SPH_C32(0x3badc9cc), SPH_C32(0xa9b69c87), - SPH_C32(0x030a9e60), SPH_C32(0xbe0a679e), SPH_C32(0x5fec0000), - SPH_C32(0x294b0000), SPH_C32(0x99d20000), SPH_C32(0x4ed00012), - SPH_C32(0x1ed34f73), SPH_C32(0xbaa708c9), SPH_C32(0x57140bdf), - SPH_C32(0x30aebcf7) }, - { SPH_C32(0x5fec0000), SPH_C32(0x294b0000), SPH_C32(0x99d20000), - SPH_C32(0x4ed00012), SPH_C32(0x1ed34f73), SPH_C32(0xbaa708c9), - SPH_C32(0x57140bdf), SPH_C32(0x30aebcf7), SPH_C32(0x5fa80000), - SPH_C32(0x56030000), SPH_C32(0x43ae0000), SPH_C32(0x64f30013), - SPH_C32(0x257e86bf), SPH_C32(0x1311944e), SPH_C32(0x541e95bf), - SPH_C32(0x8ea4db69) }, - { SPH_C32(0xee930000), SPH_C32(0xd6070000), SPH_C32(0x92c10000), - SPH_C32(0x2b9801e0), SPH_C32(0x9451287c), SPH_C32(0x3b6cfb57), - SPH_C32(0x45312374), SPH_C32(0x201f6a64), SPH_C32(0x7b280000), - SPH_C32(0x57420000), SPH_C32(0xa9e50000), SPH_C32(0x634300a0), - SPH_C32(0x9edb442f), SPH_C32(0x6d9995bb), SPH_C32(0x27f83b03), - SPH_C32(0xc7ff60f0) }, - { SPH_C32(0xb13b0000), SPH_C32(0x80040000), SPH_C32(0xd16f0000), - SPH_C32(0x4f6b01f3), SPH_C32(0xb12faec3), SPH_C32(0x287d6f19), - SPH_C32(0x112fb6cb), SPH_C32(0xaebbb10d), SPH_C32(0x7b6c0000), - SPH_C32(0x280a0000), SPH_C32(0x73990000), SPH_C32(0x496000a1), - SPH_C32(0xa5768de3), SPH_C32(0xc42f093c), SPH_C32(0x24f2a563), - SPH_C32(0x79f5076e) }, - { SPH_C32(0xeed70000), SPH_C32(0xa94f0000), SPH_C32(0x48bd0000), - SPH_C32(0x01bb01e1), SPH_C32(0xaffce1b0), SPH_C32(0x92da67d0), - SPH_C32(0x463bbd14), SPH_C32(0x9e150dfa), SPH_C32(0x24c40000), - SPH_C32(0x7e090000), SPH_C32(0x30370000), SPH_C32(0x2d9300b2), - SPH_C32(0x80080b5c), SPH_C32(0xd73e9d72), SPH_C32(0x70ec30dc), - SPH_C32(0xf751dc07) }, - { SPH_C32(0xb17f0000), SPH_C32(0xff4c0000), SPH_C32(0x0b130000), - SPH_C32(0x654801f2), SPH_C32(0x8a82670f), SPH_C32(0x81cbf39e), - SPH_C32(0x122528ab), SPH_C32(0x10b1d693), SPH_C32(0x24800000), - SPH_C32(0x01410000), SPH_C32(0xea4b0000), SPH_C32(0x07b000b3), - SPH_C32(0xbba5c290), SPH_C32(0x7e8801f5), SPH_C32(0x73e6aebc), - SPH_C32(0x495bbb99) }, - { SPH_C32(0x7b280000), SPH_C32(0x57420000), SPH_C32(0xa9e50000), - SPH_C32(0x634300a0), SPH_C32(0x9edb442f), SPH_C32(0x6d9995bb), - SPH_C32(0x27f83b03), SPH_C32(0xc7ff60f0), SPH_C32(0x95bb0000), - SPH_C32(0x81450000), SPH_C32(0x3b240000), SPH_C32(0x48db0140), - SPH_C32(0x0a8a6c53), SPH_C32(0x56f56eec), SPH_C32(0x62c91877), - SPH_C32(0xe7e00a94) }, - { SPH_C32(0x24800000), SPH_C32(0x01410000), SPH_C32(0xea4b0000), - SPH_C32(0x07b000b3), SPH_C32(0xbba5c290), SPH_C32(0x7e8801f5), - SPH_C32(0x73e6aebc), SPH_C32(0x495bbb99), SPH_C32(0x95ff0000), - SPH_C32(0xfe0d0000), SPH_C32(0xe1580000), SPH_C32(0x62f80141), - SPH_C32(0x3127a59f), SPH_C32(0xff43f26b), SPH_C32(0x61c38617), - SPH_C32(0x59ea6d0a) }, - { SPH_C32(0x7b6c0000), SPH_C32(0x280a0000), SPH_C32(0x73990000), - SPH_C32(0x496000a1), SPH_C32(0xa5768de3), SPH_C32(0xc42f093c), - SPH_C32(0x24f2a563), SPH_C32(0x79f5076e), SPH_C32(0xca570000), - SPH_C32(0xa80e0000), SPH_C32(0xa2f60000), SPH_C32(0x060b0152), - SPH_C32(0x14592320), SPH_C32(0xec526625), SPH_C32(0x35dd13a8), - SPH_C32(0xd74eb663) }, - { SPH_C32(0x24c40000), SPH_C32(0x7e090000), SPH_C32(0x30370000), - SPH_C32(0x2d9300b2), SPH_C32(0x80080b5c), SPH_C32(0xd73e9d72), - SPH_C32(0x70ec30dc), SPH_C32(0xf751dc07), SPH_C32(0xca130000), - SPH_C32(0xd7460000), SPH_C32(0x788a0000), SPH_C32(0x2c280153), - SPH_C32(0x2ff4eaec), SPH_C32(0x45e4faa2), SPH_C32(0x36d78dc8), - SPH_C32(0x6944d1fd) }, - { SPH_C32(0x95bb0000), SPH_C32(0x81450000), SPH_C32(0x3b240000), - SPH_C32(0x48db0140), SPH_C32(0x0a8a6c53), SPH_C32(0x56f56eec), - SPH_C32(0x62c91877), SPH_C32(0xe7e00a94), SPH_C32(0xee930000), - SPH_C32(0xd6070000), SPH_C32(0x92c10000), SPH_C32(0x2b9801e0), - SPH_C32(0x9451287c), SPH_C32(0x3b6cfb57), SPH_C32(0x45312374), - SPH_C32(0x201f6a64) }, - { SPH_C32(0xca130000), SPH_C32(0xd7460000), SPH_C32(0x788a0000), - SPH_C32(0x2c280153), SPH_C32(0x2ff4eaec), SPH_C32(0x45e4faa2), - SPH_C32(0x36d78dc8), SPH_C32(0x6944d1fd), SPH_C32(0xeed70000), - SPH_C32(0xa94f0000), SPH_C32(0x48bd0000), SPH_C32(0x01bb01e1), - SPH_C32(0xaffce1b0), SPH_C32(0x92da67d0), SPH_C32(0x463bbd14), - SPH_C32(0x9e150dfa) }, - { SPH_C32(0x95ff0000), SPH_C32(0xfe0d0000), SPH_C32(0xe1580000), - SPH_C32(0x62f80141), SPH_C32(0x3127a59f), SPH_C32(0xff43f26b), - SPH_C32(0x61c38617), SPH_C32(0x59ea6d0a), SPH_C32(0xb17f0000), - SPH_C32(0xff4c0000), SPH_C32(0x0b130000), SPH_C32(0x654801f2), - SPH_C32(0x8a82670f), SPH_C32(0x81cbf39e), SPH_C32(0x122528ab), - SPH_C32(0x10b1d693) }, - { SPH_C32(0xca570000), SPH_C32(0xa80e0000), SPH_C32(0xa2f60000), - SPH_C32(0x060b0152), SPH_C32(0x14592320), SPH_C32(0xec526625), - SPH_C32(0x35dd13a8), SPH_C32(0xd74eb663), SPH_C32(0xb13b0000), - SPH_C32(0x80040000), SPH_C32(0xd16f0000), SPH_C32(0x4f6b01f3), - SPH_C32(0xb12faec3), SPH_C32(0x287d6f19), SPH_C32(0x112fb6cb), - SPH_C32(0xaebbb10d) }, - { SPH_C32(0xe6280000), SPH_C32(0x4c4b0000), SPH_C32(0xa8550000), - SPH_C32(0xd3d002e0), SPH_C32(0xd86130b8), SPH_C32(0x98a7b0da), - SPH_C32(0x289506b4), SPH_C32(0xd75a4897), SPH_C32(0xf0c50000), - SPH_C32(0x59230000), SPH_C32(0x45820000), SPH_C32(0xe18d00c0), - SPH_C32(0x3b6d0631), SPH_C32(0xc2ed5699), SPH_C32(0xcbe0fe1c), - SPH_C32(0x56a7b19f) }, - { SPH_C32(0xb9800000), SPH_C32(0x1a480000), SPH_C32(0xebfb0000), - SPH_C32(0xb72302f3), SPH_C32(0xfd1fb607), SPH_C32(0x8bb62494), - SPH_C32(0x7c8b930b), SPH_C32(0x59fe93fe), SPH_C32(0xf0810000), - SPH_C32(0x266b0000), SPH_C32(0x9ffe0000), SPH_C32(0xcbae00c1), - SPH_C32(0x00c0cffd), SPH_C32(0x6b5bca1e), SPH_C32(0xc8ea607c), - SPH_C32(0xe8add601) }, - { SPH_C32(0xe66c0000), SPH_C32(0x33030000), SPH_C32(0x72290000), - SPH_C32(0xf9f302e1), SPH_C32(0xe3ccf974), SPH_C32(0x31112c5d), - SPH_C32(0x2b9f98d4), SPH_C32(0x69502f09), SPH_C32(0xaf290000), - SPH_C32(0x70680000), SPH_C32(0xdc500000), SPH_C32(0xaf5d00d2), - SPH_C32(0x25be4942), SPH_C32(0x784a5e50), SPH_C32(0x9cf4f5c3), - SPH_C32(0x66090d68) }, - { SPH_C32(0xb9c40000), SPH_C32(0x65000000), SPH_C32(0x31870000), - SPH_C32(0x9d0002f2), SPH_C32(0xc6b27fcb), SPH_C32(0x2200b813), - SPH_C32(0x7f810d6b), SPH_C32(0xe7f4f460), SPH_C32(0xaf6d0000), - SPH_C32(0x0f200000), SPH_C32(0x062c0000), SPH_C32(0x857e00d3), - SPH_C32(0x1e13808e), SPH_C32(0xd1fcc2d7), SPH_C32(0x9ffe6ba3), - SPH_C32(0xd8036af6) }, - { SPH_C32(0x08bb0000), SPH_C32(0x9a4c0000), SPH_C32(0x3a940000), - SPH_C32(0xf8480300), SPH_C32(0x4c3018c4), SPH_C32(0xa3cb4b8d), - SPH_C32(0x6da425c0), SPH_C32(0xf74522f3), SPH_C32(0x8bed0000), - SPH_C32(0x0e610000), SPH_C32(0xec670000), SPH_C32(0x82ce0060), - SPH_C32(0xa5b6421e), SPH_C32(0xaf74c322), SPH_C32(0xec18c51f), - SPH_C32(0x9158d16f) }, - { SPH_C32(0x57130000), SPH_C32(0xcc4f0000), SPH_C32(0x793a0000), - SPH_C32(0x9cbb0313), SPH_C32(0x694e9e7b), SPH_C32(0xb0dadfc3), - SPH_C32(0x39bab07f), SPH_C32(0x79e1f99a), SPH_C32(0x8ba90000), - SPH_C32(0x71290000), SPH_C32(0x361b0000), SPH_C32(0xa8ed0061), - SPH_C32(0x9e1b8bd2), SPH_C32(0x06c25fa5), SPH_C32(0xef125b7f), - SPH_C32(0x2f52b6f1) }, - { SPH_C32(0x08ff0000), SPH_C32(0xe5040000), SPH_C32(0xe0e80000), - SPH_C32(0xd26b0301), SPH_C32(0x779dd108), SPH_C32(0x0a7dd70a), - SPH_C32(0x6eaebba0), SPH_C32(0x494f456d), SPH_C32(0xd4010000), - SPH_C32(0x272a0000), SPH_C32(0x75b50000), SPH_C32(0xcc1e0072), - SPH_C32(0xbb650d6d), SPH_C32(0x15d3cbeb), SPH_C32(0xbb0ccec0), - SPH_C32(0xa1f66d98) }, - { SPH_C32(0x57570000), SPH_C32(0xb3070000), SPH_C32(0xa3460000), - SPH_C32(0xb6980312), SPH_C32(0x52e357b7), SPH_C32(0x196c4344), - SPH_C32(0x3ab02e1f), SPH_C32(0xc7eb9e04), SPH_C32(0xd4450000), - SPH_C32(0x58620000), SPH_C32(0xafc90000), SPH_C32(0xe63d0073), - SPH_C32(0x80c8c4a1), SPH_C32(0xbc65576c), SPH_C32(0xb80650a0), - SPH_C32(0x1ffc0a06) }, - { SPH_C32(0x9d000000), SPH_C32(0x1b090000), SPH_C32(0x01b00000), - SPH_C32(0xb0930240), SPH_C32(0x46ba7497), SPH_C32(0xf53e2561), - SPH_C32(0x0f6d3db7), SPH_C32(0x10a52867), SPH_C32(0x657e0000), - SPH_C32(0xd8660000), SPH_C32(0x7ea60000), SPH_C32(0xa9560180), - SPH_C32(0x31e76a62), SPH_C32(0x94183875), SPH_C32(0xa929e66b), - SPH_C32(0xb147bb0b) }, - { SPH_C32(0xc2a80000), SPH_C32(0x4d0a0000), SPH_C32(0x421e0000), - SPH_C32(0xd4600253), SPH_C32(0x63c4f228), SPH_C32(0xe62fb12f), - SPH_C32(0x5b73a808), SPH_C32(0x9e01f30e), SPH_C32(0x653a0000), - SPH_C32(0xa72e0000), SPH_C32(0xa4da0000), SPH_C32(0x83750181), - SPH_C32(0x0a4aa3ae), SPH_C32(0x3daea4f2), SPH_C32(0xaa23780b), - SPH_C32(0x0f4ddc95) }, - { SPH_C32(0x9d440000), SPH_C32(0x64410000), SPH_C32(0xdbcc0000), - SPH_C32(0x9ab00241), SPH_C32(0x7d17bd5b), SPH_C32(0x5c88b9e6), - SPH_C32(0x0c67a3d7), SPH_C32(0xaeaf4ff9), SPH_C32(0x3a920000), - SPH_C32(0xf12d0000), SPH_C32(0xe7740000), SPH_C32(0xe7860192), - SPH_C32(0x2f342511), SPH_C32(0x2ebf30bc), SPH_C32(0xfe3dedb4), - SPH_C32(0x81e907fc) }, - { SPH_C32(0xc2ec0000), SPH_C32(0x32420000), SPH_C32(0x98620000), - SPH_C32(0xfe430252), SPH_C32(0x58693be4), SPH_C32(0x4f992da8), - SPH_C32(0x58793668), SPH_C32(0x200b9490), SPH_C32(0x3ad60000), - SPH_C32(0x8e650000), SPH_C32(0x3d080000), SPH_C32(0xcda50193), - SPH_C32(0x1499ecdd), SPH_C32(0x8709ac3b), SPH_C32(0xfd3773d4), - SPH_C32(0x3fe36062) }, - { SPH_C32(0x73930000), SPH_C32(0xcd0e0000), SPH_C32(0x93710000), - SPH_C32(0x9b0b03a0), SPH_C32(0xd2eb5ceb), SPH_C32(0xce52de36), - SPH_C32(0x4a5c1ec3), SPH_C32(0x30ba4203), SPH_C32(0x1e560000), - SPH_C32(0x8f240000), SPH_C32(0xd7430000), SPH_C32(0xca150120), - SPH_C32(0xaf3c2e4d), SPH_C32(0xf981adce), SPH_C32(0x8ed1dd68), - SPH_C32(0x76b8dbfb) }, - { SPH_C32(0x2c3b0000), SPH_C32(0x9b0d0000), SPH_C32(0xd0df0000), - SPH_C32(0xfff803b3), SPH_C32(0xf795da54), SPH_C32(0xdd434a78), - SPH_C32(0x1e428b7c), SPH_C32(0xbe1e996a), SPH_C32(0x1e120000), - SPH_C32(0xf06c0000), SPH_C32(0x0d3f0000), SPH_C32(0xe0360121), - SPH_C32(0x9491e781), SPH_C32(0x50373149), SPH_C32(0x8ddb4308), - SPH_C32(0xc8b2bc65) }, - { SPH_C32(0x73d70000), SPH_C32(0xb2460000), SPH_C32(0x490d0000), - SPH_C32(0xb12803a1), SPH_C32(0xe9469527), SPH_C32(0x67e442b1), - SPH_C32(0x495680a3), SPH_C32(0x8eb0259d), SPH_C32(0x41ba0000), - SPH_C32(0xa66f0000), SPH_C32(0x4e910000), SPH_C32(0x84c50132), - SPH_C32(0xb1ef613e), SPH_C32(0x4326a507), SPH_C32(0xd9c5d6b7), - SPH_C32(0x4616670c) }, - { SPH_C32(0x2c7f0000), SPH_C32(0xe4450000), SPH_C32(0x0aa30000), - SPH_C32(0xd5db03b2), SPH_C32(0xcc381398), SPH_C32(0x74f5d6ff), - SPH_C32(0x1d48151c), SPH_C32(0x0014fef4), SPH_C32(0x41fe0000), - SPH_C32(0xd9270000), SPH_C32(0x94ed0000), SPH_C32(0xaee60133), - SPH_C32(0x8a42a8f2), SPH_C32(0xea903980), SPH_C32(0xdacf48d7), - SPH_C32(0xf81c0092) }, - { SPH_C32(0xf0c50000), SPH_C32(0x59230000), SPH_C32(0x45820000), - SPH_C32(0xe18d00c0), SPH_C32(0x3b6d0631), SPH_C32(0xc2ed5699), - SPH_C32(0xcbe0fe1c), SPH_C32(0x56a7b19f), SPH_C32(0x16ed0000), - SPH_C32(0x15680000), SPH_C32(0xedd70000), SPH_C32(0x325d0220), - SPH_C32(0xe30c3689), SPH_C32(0x5a4ae643), SPH_C32(0xe375f8a8), - SPH_C32(0x81fdf908) }, - { SPH_C32(0xaf6d0000), SPH_C32(0x0f200000), SPH_C32(0x062c0000), - SPH_C32(0x857e00d3), SPH_C32(0x1e13808e), SPH_C32(0xd1fcc2d7), - SPH_C32(0x9ffe6ba3), SPH_C32(0xd8036af6), SPH_C32(0x16a90000), - SPH_C32(0x6a200000), SPH_C32(0x37ab0000), SPH_C32(0x187e0221), - SPH_C32(0xd8a1ff45), SPH_C32(0xf3fc7ac4), SPH_C32(0xe07f66c8), - SPH_C32(0x3ff79e96) }, - { SPH_C32(0xf0810000), SPH_C32(0x266b0000), SPH_C32(0x9ffe0000), - SPH_C32(0xcbae00c1), SPH_C32(0x00c0cffd), SPH_C32(0x6b5bca1e), - SPH_C32(0xc8ea607c), SPH_C32(0xe8add601), SPH_C32(0x49010000), - SPH_C32(0x3c230000), SPH_C32(0x74050000), SPH_C32(0x7c8d0232), - SPH_C32(0xfddf79fa), SPH_C32(0xe0edee8a), SPH_C32(0xb461f377), - SPH_C32(0xb15345ff) }, - { SPH_C32(0xaf290000), SPH_C32(0x70680000), SPH_C32(0xdc500000), - SPH_C32(0xaf5d00d2), SPH_C32(0x25be4942), SPH_C32(0x784a5e50), - SPH_C32(0x9cf4f5c3), SPH_C32(0x66090d68), SPH_C32(0x49450000), - SPH_C32(0x436b0000), SPH_C32(0xae790000), SPH_C32(0x56ae0233), - SPH_C32(0xc672b036), SPH_C32(0x495b720d), SPH_C32(0xb76b6d17), - SPH_C32(0x0f592261) }, - { SPH_C32(0x1e560000), SPH_C32(0x8f240000), SPH_C32(0xd7430000), - SPH_C32(0xca150120), SPH_C32(0xaf3c2e4d), SPH_C32(0xf981adce), - SPH_C32(0x8ed1dd68), SPH_C32(0x76b8dbfb), SPH_C32(0x6dc50000), - SPH_C32(0x422a0000), SPH_C32(0x44320000), SPH_C32(0x511e0280), - SPH_C32(0x7dd772a6), SPH_C32(0x37d373f8), SPH_C32(0xc48dc3ab), - SPH_C32(0x460299f8) }, - { SPH_C32(0x41fe0000), SPH_C32(0xd9270000), SPH_C32(0x94ed0000), - SPH_C32(0xaee60133), SPH_C32(0x8a42a8f2), SPH_C32(0xea903980), - SPH_C32(0xdacf48d7), SPH_C32(0xf81c0092), SPH_C32(0x6d810000), - SPH_C32(0x3d620000), SPH_C32(0x9e4e0000), SPH_C32(0x7b3d0281), - SPH_C32(0x467abb6a), SPH_C32(0x9e65ef7f), SPH_C32(0xc7875dcb), - SPH_C32(0xf808fe66) }, - { SPH_C32(0x1e120000), SPH_C32(0xf06c0000), SPH_C32(0x0d3f0000), - SPH_C32(0xe0360121), SPH_C32(0x9491e781), SPH_C32(0x50373149), - SPH_C32(0x8ddb4308), SPH_C32(0xc8b2bc65), SPH_C32(0x32290000), - SPH_C32(0x6b610000), SPH_C32(0xdde00000), SPH_C32(0x1fce0292), - SPH_C32(0x63043dd5), SPH_C32(0x8d747b31), SPH_C32(0x9399c874), - SPH_C32(0x76ac250f) }, - { SPH_C32(0x41ba0000), SPH_C32(0xa66f0000), SPH_C32(0x4e910000), - SPH_C32(0x84c50132), SPH_C32(0xb1ef613e), SPH_C32(0x4326a507), - SPH_C32(0xd9c5d6b7), SPH_C32(0x4616670c), SPH_C32(0x326d0000), - SPH_C32(0x14290000), SPH_C32(0x079c0000), SPH_C32(0x35ed0293), - SPH_C32(0x58a9f419), SPH_C32(0x24c2e7b6), SPH_C32(0x90935614), - SPH_C32(0xc8a64291) }, - { SPH_C32(0x8bed0000), SPH_C32(0x0e610000), SPH_C32(0xec670000), - SPH_C32(0x82ce0060), SPH_C32(0xa5b6421e), SPH_C32(0xaf74c322), - SPH_C32(0xec18c51f), SPH_C32(0x9158d16f), SPH_C32(0x83560000), - SPH_C32(0x942d0000), SPH_C32(0xd6f30000), SPH_C32(0x7a860360), - SPH_C32(0xe9865ada), SPH_C32(0x0cbf88af), SPH_C32(0x81bce0df), - SPH_C32(0x661df39c) }, - { SPH_C32(0xd4450000), SPH_C32(0x58620000), SPH_C32(0xafc90000), - SPH_C32(0xe63d0073), SPH_C32(0x80c8c4a1), SPH_C32(0xbc65576c), - SPH_C32(0xb80650a0), SPH_C32(0x1ffc0a06), SPH_C32(0x83120000), - SPH_C32(0xeb650000), SPH_C32(0x0c8f0000), SPH_C32(0x50a50361), - SPH_C32(0xd22b9316), SPH_C32(0xa5091428), SPH_C32(0x82b67ebf), - SPH_C32(0xd8179402) }, - { SPH_C32(0x8ba90000), SPH_C32(0x71290000), SPH_C32(0x361b0000), - SPH_C32(0xa8ed0061), SPH_C32(0x9e1b8bd2), SPH_C32(0x06c25fa5), - SPH_C32(0xef125b7f), SPH_C32(0x2f52b6f1), SPH_C32(0xdcba0000), - SPH_C32(0xbd660000), SPH_C32(0x4f210000), SPH_C32(0x34560372), - SPH_C32(0xf75515a9), SPH_C32(0xb6188066), SPH_C32(0xd6a8eb00), - SPH_C32(0x56b34f6b) }, - { SPH_C32(0xd4010000), SPH_C32(0x272a0000), SPH_C32(0x75b50000), - SPH_C32(0xcc1e0072), SPH_C32(0xbb650d6d), SPH_C32(0x15d3cbeb), - SPH_C32(0xbb0ccec0), SPH_C32(0xa1f66d98), SPH_C32(0xdcfe0000), - SPH_C32(0xc22e0000), SPH_C32(0x955d0000), SPH_C32(0x1e750373), - SPH_C32(0xccf8dc65), SPH_C32(0x1fae1ce1), SPH_C32(0xd5a27560), - SPH_C32(0xe8b928f5) }, - { SPH_C32(0x657e0000), SPH_C32(0xd8660000), SPH_C32(0x7ea60000), - SPH_C32(0xa9560180), SPH_C32(0x31e76a62), SPH_C32(0x94183875), - SPH_C32(0xa929e66b), SPH_C32(0xb147bb0b), SPH_C32(0xf87e0000), - SPH_C32(0xc36f0000), SPH_C32(0x7f160000), SPH_C32(0x19c503c0), - SPH_C32(0x775d1ef5), SPH_C32(0x61261d14), SPH_C32(0xa644dbdc), - SPH_C32(0xa1e2936c) }, - { SPH_C32(0x3ad60000), SPH_C32(0x8e650000), SPH_C32(0x3d080000), - SPH_C32(0xcda50193), SPH_C32(0x1499ecdd), SPH_C32(0x8709ac3b), - SPH_C32(0xfd3773d4), SPH_C32(0x3fe36062), SPH_C32(0xf83a0000), - SPH_C32(0xbc270000), SPH_C32(0xa56a0000), SPH_C32(0x33e603c1), - SPH_C32(0x4cf0d739), SPH_C32(0xc8908193), SPH_C32(0xa54e45bc), - SPH_C32(0x1fe8f4f2) }, - { SPH_C32(0x653a0000), SPH_C32(0xa72e0000), SPH_C32(0xa4da0000), - SPH_C32(0x83750181), SPH_C32(0x0a4aa3ae), SPH_C32(0x3daea4f2), - SPH_C32(0xaa23780b), SPH_C32(0x0f4ddc95), SPH_C32(0xa7920000), - SPH_C32(0xea240000), SPH_C32(0xe6c40000), SPH_C32(0x571503d2), - SPH_C32(0x698e5186), SPH_C32(0xdb8115dd), SPH_C32(0xf150d003), - SPH_C32(0x914c2f9b) }, - { SPH_C32(0x3a920000), SPH_C32(0xf12d0000), SPH_C32(0xe7740000), - SPH_C32(0xe7860192), SPH_C32(0x2f342511), SPH_C32(0x2ebf30bc), - SPH_C32(0xfe3dedb4), SPH_C32(0x81e907fc), SPH_C32(0xa7d60000), - SPH_C32(0x956c0000), SPH_C32(0x3cb80000), SPH_C32(0x7d3603d3), - SPH_C32(0x5223984a), SPH_C32(0x7237895a), SPH_C32(0xf25a4e63), - SPH_C32(0x2f464805) }, - { SPH_C32(0x16ed0000), SPH_C32(0x15680000), SPH_C32(0xedd70000), - SPH_C32(0x325d0220), SPH_C32(0xe30c3689), SPH_C32(0x5a4ae643), - SPH_C32(0xe375f8a8), SPH_C32(0x81fdf908), SPH_C32(0xe6280000), - SPH_C32(0x4c4b0000), SPH_C32(0xa8550000), SPH_C32(0xd3d002e0), - SPH_C32(0xd86130b8), SPH_C32(0x98a7b0da), SPH_C32(0x289506b4), - SPH_C32(0xd75a4897) }, - { SPH_C32(0x49450000), SPH_C32(0x436b0000), SPH_C32(0xae790000), - SPH_C32(0x56ae0233), SPH_C32(0xc672b036), SPH_C32(0x495b720d), - SPH_C32(0xb76b6d17), SPH_C32(0x0f592261), SPH_C32(0xe66c0000), - SPH_C32(0x33030000), SPH_C32(0x72290000), SPH_C32(0xf9f302e1), - SPH_C32(0xe3ccf974), SPH_C32(0x31112c5d), SPH_C32(0x2b9f98d4), - SPH_C32(0x69502f09) }, - { SPH_C32(0x16a90000), SPH_C32(0x6a200000), SPH_C32(0x37ab0000), - SPH_C32(0x187e0221), SPH_C32(0xd8a1ff45), SPH_C32(0xf3fc7ac4), - SPH_C32(0xe07f66c8), SPH_C32(0x3ff79e96), SPH_C32(0xb9c40000), - SPH_C32(0x65000000), SPH_C32(0x31870000), SPH_C32(0x9d0002f2), - SPH_C32(0xc6b27fcb), SPH_C32(0x2200b813), SPH_C32(0x7f810d6b), - SPH_C32(0xe7f4f460) }, - { SPH_C32(0x49010000), SPH_C32(0x3c230000), SPH_C32(0x74050000), - SPH_C32(0x7c8d0232), SPH_C32(0xfddf79fa), SPH_C32(0xe0edee8a), - SPH_C32(0xb461f377), SPH_C32(0xb15345ff), SPH_C32(0xb9800000), - SPH_C32(0x1a480000), SPH_C32(0xebfb0000), SPH_C32(0xb72302f3), - SPH_C32(0xfd1fb607), SPH_C32(0x8bb62494), SPH_C32(0x7c8b930b), - SPH_C32(0x59fe93fe) }, - { SPH_C32(0xf87e0000), SPH_C32(0xc36f0000), SPH_C32(0x7f160000), - SPH_C32(0x19c503c0), SPH_C32(0x775d1ef5), SPH_C32(0x61261d14), - SPH_C32(0xa644dbdc), SPH_C32(0xa1e2936c), SPH_C32(0x9d000000), - SPH_C32(0x1b090000), SPH_C32(0x01b00000), SPH_C32(0xb0930240), - SPH_C32(0x46ba7497), SPH_C32(0xf53e2561), SPH_C32(0x0f6d3db7), - SPH_C32(0x10a52867) }, - { SPH_C32(0xa7d60000), SPH_C32(0x956c0000), SPH_C32(0x3cb80000), - SPH_C32(0x7d3603d3), SPH_C32(0x5223984a), SPH_C32(0x7237895a), - SPH_C32(0xf25a4e63), SPH_C32(0x2f464805), SPH_C32(0x9d440000), - SPH_C32(0x64410000), SPH_C32(0xdbcc0000), SPH_C32(0x9ab00241), - SPH_C32(0x7d17bd5b), SPH_C32(0x5c88b9e6), SPH_C32(0x0c67a3d7), - SPH_C32(0xaeaf4ff9) }, - { SPH_C32(0xf83a0000), SPH_C32(0xbc270000), SPH_C32(0xa56a0000), - SPH_C32(0x33e603c1), SPH_C32(0x4cf0d739), SPH_C32(0xc8908193), - SPH_C32(0xa54e45bc), SPH_C32(0x1fe8f4f2), SPH_C32(0xc2ec0000), - SPH_C32(0x32420000), SPH_C32(0x98620000), SPH_C32(0xfe430252), - SPH_C32(0x58693be4), SPH_C32(0x4f992da8), SPH_C32(0x58793668), - SPH_C32(0x200b9490) }, - { SPH_C32(0xa7920000), SPH_C32(0xea240000), SPH_C32(0xe6c40000), - SPH_C32(0x571503d2), SPH_C32(0x698e5186), SPH_C32(0xdb8115dd), - SPH_C32(0xf150d003), SPH_C32(0x914c2f9b), SPH_C32(0xc2a80000), - SPH_C32(0x4d0a0000), SPH_C32(0x421e0000), SPH_C32(0xd4600253), - SPH_C32(0x63c4f228), SPH_C32(0xe62fb12f), SPH_C32(0x5b73a808), - SPH_C32(0x9e01f30e) }, - { SPH_C32(0x6dc50000), SPH_C32(0x422a0000), SPH_C32(0x44320000), - SPH_C32(0x511e0280), SPH_C32(0x7dd772a6), SPH_C32(0x37d373f8), - SPH_C32(0xc48dc3ab), SPH_C32(0x460299f8), SPH_C32(0x73930000), - SPH_C32(0xcd0e0000), SPH_C32(0x93710000), SPH_C32(0x9b0b03a0), - SPH_C32(0xd2eb5ceb), SPH_C32(0xce52de36), SPH_C32(0x4a5c1ec3), - SPH_C32(0x30ba4203) }, - { SPH_C32(0x326d0000), SPH_C32(0x14290000), SPH_C32(0x079c0000), - SPH_C32(0x35ed0293), SPH_C32(0x58a9f419), SPH_C32(0x24c2e7b6), - SPH_C32(0x90935614), SPH_C32(0xc8a64291), SPH_C32(0x73d70000), - SPH_C32(0xb2460000), SPH_C32(0x490d0000), SPH_C32(0xb12803a1), - SPH_C32(0xe9469527), SPH_C32(0x67e442b1), SPH_C32(0x495680a3), - SPH_C32(0x8eb0259d) }, - { SPH_C32(0x6d810000), SPH_C32(0x3d620000), SPH_C32(0x9e4e0000), - SPH_C32(0x7b3d0281), SPH_C32(0x467abb6a), SPH_C32(0x9e65ef7f), - SPH_C32(0xc7875dcb), SPH_C32(0xf808fe66), SPH_C32(0x2c7f0000), - SPH_C32(0xe4450000), SPH_C32(0x0aa30000), SPH_C32(0xd5db03b2), - SPH_C32(0xcc381398), SPH_C32(0x74f5d6ff), SPH_C32(0x1d48151c), - SPH_C32(0x0014fef4) }, - { SPH_C32(0x32290000), SPH_C32(0x6b610000), SPH_C32(0xdde00000), - SPH_C32(0x1fce0292), SPH_C32(0x63043dd5), SPH_C32(0x8d747b31), - SPH_C32(0x9399c874), SPH_C32(0x76ac250f), SPH_C32(0x2c3b0000), - SPH_C32(0x9b0d0000), SPH_C32(0xd0df0000), SPH_C32(0xfff803b3), - SPH_C32(0xf795da54), SPH_C32(0xdd434a78), SPH_C32(0x1e428b7c), - SPH_C32(0xbe1e996a) }, - { SPH_C32(0x83560000), SPH_C32(0x942d0000), SPH_C32(0xd6f30000), - SPH_C32(0x7a860360), SPH_C32(0xe9865ada), SPH_C32(0x0cbf88af), - SPH_C32(0x81bce0df), SPH_C32(0x661df39c), SPH_C32(0x08bb0000), - SPH_C32(0x9a4c0000), SPH_C32(0x3a940000), SPH_C32(0xf8480300), - SPH_C32(0x4c3018c4), SPH_C32(0xa3cb4b8d), SPH_C32(0x6da425c0), - SPH_C32(0xf74522f3) }, - { SPH_C32(0xdcfe0000), SPH_C32(0xc22e0000), SPH_C32(0x955d0000), - SPH_C32(0x1e750373), SPH_C32(0xccf8dc65), SPH_C32(0x1fae1ce1), - SPH_C32(0xd5a27560), SPH_C32(0xe8b928f5), SPH_C32(0x08ff0000), - SPH_C32(0xe5040000), SPH_C32(0xe0e80000), SPH_C32(0xd26b0301), - SPH_C32(0x779dd108), SPH_C32(0x0a7dd70a), SPH_C32(0x6eaebba0), - SPH_C32(0x494f456d) }, - { SPH_C32(0x83120000), SPH_C32(0xeb650000), SPH_C32(0x0c8f0000), - SPH_C32(0x50a50361), SPH_C32(0xd22b9316), SPH_C32(0xa5091428), - SPH_C32(0x82b67ebf), SPH_C32(0xd8179402), SPH_C32(0x57570000), - SPH_C32(0xb3070000), SPH_C32(0xa3460000), SPH_C32(0xb6980312), - SPH_C32(0x52e357b7), SPH_C32(0x196c4344), SPH_C32(0x3ab02e1f), - SPH_C32(0xc7eb9e04) }, - { SPH_C32(0xdcba0000), SPH_C32(0xbd660000), SPH_C32(0x4f210000), - SPH_C32(0x34560372), SPH_C32(0xf75515a9), SPH_C32(0xb6188066), - SPH_C32(0xd6a8eb00), SPH_C32(0x56b34f6b), SPH_C32(0x57130000), - SPH_C32(0xcc4f0000), SPH_C32(0x793a0000), SPH_C32(0x9cbb0313), - SPH_C32(0x694e9e7b), SPH_C32(0xb0dadfc3), SPH_C32(0x39bab07f), - SPH_C32(0x79e1f99a) } -}; - -static const sph_u32 T512_60[16][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x033d0000), SPH_C32(0x08b30000), SPH_C32(0xf33a0000), - SPH_C32(0x3ac20007), SPH_C32(0x51298a50), SPH_C32(0x6b6e661f), - SPH_C32(0x0ea5cfe3), SPH_C32(0xe6da7ffe), SPH_C32(0xa8da0000), - SPH_C32(0x96be0000), SPH_C32(0x5c1d0000), SPH_C32(0x07da0002), - SPH_C32(0x7d669583), SPH_C32(0x1f98708a), SPH_C32(0xbb668808), - SPH_C32(0xda878000) }, - { SPH_C32(0xa8da0000), SPH_C32(0x96be0000), SPH_C32(0x5c1d0000), - SPH_C32(0x07da0002), SPH_C32(0x7d669583), SPH_C32(0x1f98708a), - SPH_C32(0xbb668808), SPH_C32(0xda878000), SPH_C32(0xabe70000), - SPH_C32(0x9e0d0000), SPH_C32(0xaf270000), SPH_C32(0x3d180005), - SPH_C32(0x2c4f1fd3), SPH_C32(0x74f61695), SPH_C32(0xb5c347eb), - SPH_C32(0x3c5dfffe) }, - { SPH_C32(0xabe70000), SPH_C32(0x9e0d0000), SPH_C32(0xaf270000), - SPH_C32(0x3d180005), SPH_C32(0x2c4f1fd3), SPH_C32(0x74f61695), - SPH_C32(0xb5c347eb), SPH_C32(0x3c5dfffe), SPH_C32(0x033d0000), - SPH_C32(0x08b30000), SPH_C32(0xf33a0000), SPH_C32(0x3ac20007), - SPH_C32(0x51298a50), SPH_C32(0x6b6e661f), SPH_C32(0x0ea5cfe3), - SPH_C32(0xe6da7ffe) }, - { SPH_C32(0x01930000), SPH_C32(0xe7820000), SPH_C32(0xedfb0000), - SPH_C32(0xcf0c000b), SPH_C32(0x8dd08d58), SPH_C32(0xbca3b42e), - SPH_C32(0x063661e1), SPH_C32(0x536f9e7b), SPH_C32(0x92280000), - SPH_C32(0xdc850000), SPH_C32(0x57fa0000), SPH_C32(0x56dc0003), - SPH_C32(0xbae92316), SPH_C32(0x5aefa30c), SPH_C32(0x90cef752), - SPH_C32(0x7b1675d7) }, - { SPH_C32(0x02ae0000), SPH_C32(0xef310000), SPH_C32(0x1ec10000), - SPH_C32(0xf5ce000c), SPH_C32(0xdcf90708), SPH_C32(0xd7cdd231), - SPH_C32(0x0893ae02), SPH_C32(0xb5b5e185), SPH_C32(0x3af20000), - SPH_C32(0x4a3b0000), SPH_C32(0x0be70000), SPH_C32(0x51060001), - SPH_C32(0xc78fb695), SPH_C32(0x4577d386), SPH_C32(0x2ba87f5a), - SPH_C32(0xa191f5d7) }, - { SPH_C32(0xa9490000), SPH_C32(0x713c0000), SPH_C32(0xb1e60000), - SPH_C32(0xc8d60009), SPH_C32(0xf0b618db), SPH_C32(0xa33bc4a4), - SPH_C32(0xbd50e9e9), SPH_C32(0x89e81e7b), SPH_C32(0x39cf0000), - SPH_C32(0x42880000), SPH_C32(0xf8dd0000), SPH_C32(0x6bc40006), - SPH_C32(0x96a63cc5), SPH_C32(0x2e19b599), SPH_C32(0x250db0b9), - SPH_C32(0x474b8a29) }, - { SPH_C32(0xaa740000), SPH_C32(0x798f0000), SPH_C32(0x42dc0000), - SPH_C32(0xf214000e), SPH_C32(0xa19f928b), SPH_C32(0xc855a2bb), - SPH_C32(0xb3f5260a), SPH_C32(0x6f326185), SPH_C32(0x91150000), - SPH_C32(0xd4360000), SPH_C32(0xa4c00000), SPH_C32(0x6c1e0004), - SPH_C32(0xebc0a946), SPH_C32(0x3181c513), SPH_C32(0x9e6b38b1), - SPH_C32(0x9dcc0a29) }, - { SPH_C32(0x92280000), SPH_C32(0xdc850000), SPH_C32(0x57fa0000), - SPH_C32(0x56dc0003), SPH_C32(0xbae92316), SPH_C32(0x5aefa30c), - SPH_C32(0x90cef752), SPH_C32(0x7b1675d7), SPH_C32(0x93bb0000), - SPH_C32(0x3b070000), SPH_C32(0xba010000), SPH_C32(0x99d00008), - SPH_C32(0x3739ae4e), SPH_C32(0xe64c1722), SPH_C32(0x96f896b3), - SPH_C32(0x2879ebac) }, - { SPH_C32(0x91150000), SPH_C32(0xd4360000), SPH_C32(0xa4c00000), - SPH_C32(0x6c1e0004), SPH_C32(0xebc0a946), SPH_C32(0x3181c513), - SPH_C32(0x9e6b38b1), SPH_C32(0x9dcc0a29), SPH_C32(0x3b610000), - SPH_C32(0xadb90000), SPH_C32(0xe61c0000), SPH_C32(0x9e0a000a), - SPH_C32(0x4a5f3bcd), SPH_C32(0xf9d467a8), SPH_C32(0x2d9e1ebb), - SPH_C32(0xf2fe6bac) }, - { SPH_C32(0x3af20000), SPH_C32(0x4a3b0000), SPH_C32(0x0be70000), - SPH_C32(0x51060001), SPH_C32(0xc78fb695), SPH_C32(0x4577d386), - SPH_C32(0x2ba87f5a), SPH_C32(0xa191f5d7), SPH_C32(0x385c0000), - SPH_C32(0xa50a0000), SPH_C32(0x15260000), SPH_C32(0xa4c8000d), - SPH_C32(0x1b76b19d), SPH_C32(0x92ba01b7), SPH_C32(0x233bd158), - SPH_C32(0x14241452) }, - { SPH_C32(0x39cf0000), SPH_C32(0x42880000), SPH_C32(0xf8dd0000), - SPH_C32(0x6bc40006), SPH_C32(0x96a63cc5), SPH_C32(0x2e19b599), - SPH_C32(0x250db0b9), SPH_C32(0x474b8a29), SPH_C32(0x90860000), - SPH_C32(0x33b40000), SPH_C32(0x493b0000), SPH_C32(0xa312000f), - SPH_C32(0x6610241e), SPH_C32(0x8d22713d), SPH_C32(0x985d5950), - SPH_C32(0xcea39452) }, - { SPH_C32(0x93bb0000), SPH_C32(0x3b070000), SPH_C32(0xba010000), - SPH_C32(0x99d00008), SPH_C32(0x3739ae4e), SPH_C32(0xe64c1722), - SPH_C32(0x96f896b3), SPH_C32(0x2879ebac), SPH_C32(0x01930000), - SPH_C32(0xe7820000), SPH_C32(0xedfb0000), SPH_C32(0xcf0c000b), - SPH_C32(0x8dd08d58), SPH_C32(0xbca3b42e), SPH_C32(0x063661e1), - SPH_C32(0x536f9e7b) }, - { SPH_C32(0x90860000), SPH_C32(0x33b40000), SPH_C32(0x493b0000), - SPH_C32(0xa312000f), SPH_C32(0x6610241e), SPH_C32(0x8d22713d), - SPH_C32(0x985d5950), SPH_C32(0xcea39452), SPH_C32(0xa9490000), - SPH_C32(0x713c0000), SPH_C32(0xb1e60000), SPH_C32(0xc8d60009), - SPH_C32(0xf0b618db), SPH_C32(0xa33bc4a4), SPH_C32(0xbd50e9e9), - SPH_C32(0x89e81e7b) }, - { SPH_C32(0x3b610000), SPH_C32(0xadb90000), SPH_C32(0xe61c0000), - SPH_C32(0x9e0a000a), SPH_C32(0x4a5f3bcd), SPH_C32(0xf9d467a8), - SPH_C32(0x2d9e1ebb), SPH_C32(0xf2fe6bac), SPH_C32(0xaa740000), - SPH_C32(0x798f0000), SPH_C32(0x42dc0000), SPH_C32(0xf214000e), - SPH_C32(0xa19f928b), SPH_C32(0xc855a2bb), SPH_C32(0xb3f5260a), - SPH_C32(0x6f326185) }, - { SPH_C32(0x385c0000), SPH_C32(0xa50a0000), SPH_C32(0x15260000), - SPH_C32(0xa4c8000d), SPH_C32(0x1b76b19d), SPH_C32(0x92ba01b7), - SPH_C32(0x233bd158), SPH_C32(0x14241452), SPH_C32(0x02ae0000), - SPH_C32(0xef310000), SPH_C32(0x1ec10000), SPH_C32(0xf5ce000c), - SPH_C32(0xdcf90708), SPH_C32(0xd7cdd231), SPH_C32(0x0893ae02), - SPH_C32(0xb5b5e185) } -}; - -#define INPUT_BIG do { \ - unsigned acc = buf[0]; \ - const sph_u32 *rp; \ - rp = &T512_0[acc >> 2][0]; \ - m0 = rp[0]; \ - m1 = rp[1]; \ - m2 = rp[2]; \ - m3 = rp[3]; \ - m4 = rp[4]; \ - m5 = rp[5]; \ - m6 = rp[6]; \ - m7 = rp[7]; \ - m8 = rp[8]; \ - m9 = rp[9]; \ - mA = rp[10]; \ - mB = rp[11]; \ - mC = rp[12]; \ - mD = rp[13]; \ - mE = rp[14]; \ - mF = rp[15]; \ - acc = (acc << 8) | buf[1]; \ - rp = &T512_6[(acc >> 4) & 0x3f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = (acc << 8) | buf[2]; \ - rp = &T512_12[(acc >> 6) & 0x3f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_18[acc & 0x3f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[3]; \ - rp = &T512_24[acc >> 2][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = (acc << 8) | buf[4]; \ - rp = &T512_30[(acc >> 4) & 0x3f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = (acc << 8) | buf[5]; \ - rp = &T512_36[(acc >> 6) & 0x3f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_42[acc & 0x3f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[6]; \ - rp = &T512_48[acc >> 2][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = (acc << 8) | buf[7]; \ - rp = &T512_54[(acc >> 4) & 0x3f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_60[acc & 0x0f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - } while (0) - -#endif - -#if SPH_HAMSI_EXPAND_BIG == 7 - -static const sph_u32 T512_0[128][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xc96b0030), SPH_C32(0xe7250000), SPH_C32(0x2f840000), - SPH_C32(0x264f0000), SPH_C32(0x08695bf9), SPH_C32(0x6dfcf137), - SPH_C32(0x509f6984), SPH_C32(0x9e69af68), SPH_C32(0x26600240), - SPH_C32(0xddd80000), SPH_C32(0x722a0000), SPH_C32(0x4f060000), - SPH_C32(0x936667ff), SPH_C32(0x29f944ce), SPH_C32(0x368b63d5), - SPH_C32(0x0c26f262) }, - { SPH_C32(0x145a3c00), SPH_C32(0xb9e90000), SPH_C32(0x61270000), - SPH_C32(0xf1610000), SPH_C32(0xce613d6c), SPH_C32(0xb0493d78), - SPH_C32(0x47a96720), SPH_C32(0xe18e24c5), SPH_C32(0x23671400), - SPH_C32(0xc8b90000), SPH_C32(0xf4c70000), SPH_C32(0xfb750000), - SPH_C32(0x73cd2465), SPH_C32(0xf8a6a549), SPH_C32(0x02c40a3f), - SPH_C32(0xdc24e61f) }, - { SPH_C32(0xdd313c30), SPH_C32(0x5ecc0000), SPH_C32(0x4ea30000), - SPH_C32(0xd72e0000), SPH_C32(0xc6086695), SPH_C32(0xddb5cc4f), - SPH_C32(0x17360ea4), SPH_C32(0x7fe78bad), SPH_C32(0x05071640), - SPH_C32(0x15610000), SPH_C32(0x86ed0000), SPH_C32(0xb4730000), - SPH_C32(0xe0ab439a), SPH_C32(0xd15fe187), SPH_C32(0x344f69ea), - SPH_C32(0xd002147d) }, - { SPH_C32(0x23671400), SPH_C32(0xc8b90000), SPH_C32(0xf4c70000), - SPH_C32(0xfb750000), SPH_C32(0x73cd2465), SPH_C32(0xf8a6a549), - SPH_C32(0x02c40a3f), SPH_C32(0xdc24e61f), SPH_C32(0x373d2800), - SPH_C32(0x71500000), SPH_C32(0x95e00000), SPH_C32(0x0a140000), - SPH_C32(0xbdac1909), SPH_C32(0x48ef9831), SPH_C32(0x456d6d1f), - SPH_C32(0x3daac2da) }, - { SPH_C32(0xea0c1430), SPH_C32(0x2f9c0000), SPH_C32(0xdb430000), - SPH_C32(0xdd3a0000), SPH_C32(0x7ba47f9c), SPH_C32(0x955a547e), - SPH_C32(0x525b63bb), SPH_C32(0x424d4977), SPH_C32(0x115d2a40), - SPH_C32(0xac880000), SPH_C32(0xe7ca0000), SPH_C32(0x45120000), - SPH_C32(0x2eca7ef6), SPH_C32(0x6116dcff), SPH_C32(0x73e60eca), - SPH_C32(0x318c30b8) }, - { SPH_C32(0x373d2800), SPH_C32(0x71500000), SPH_C32(0x95e00000), - SPH_C32(0x0a140000), SPH_C32(0xbdac1909), SPH_C32(0x48ef9831), - SPH_C32(0x456d6d1f), SPH_C32(0x3daac2da), SPH_C32(0x145a3c00), - SPH_C32(0xb9e90000), SPH_C32(0x61270000), SPH_C32(0xf1610000), - SPH_C32(0xce613d6c), SPH_C32(0xb0493d78), SPH_C32(0x47a96720), - SPH_C32(0xe18e24c5) }, - { SPH_C32(0xfe562830), SPH_C32(0x96750000), SPH_C32(0xba640000), - SPH_C32(0x2c5b0000), SPH_C32(0xb5c542f0), SPH_C32(0x25136906), - SPH_C32(0x15f2049b), SPH_C32(0xa3c36db2), SPH_C32(0x323a3e40), - SPH_C32(0x64310000), SPH_C32(0x130d0000), SPH_C32(0xbe670000), - SPH_C32(0x5d075a93), SPH_C32(0x99b079b6), SPH_C32(0x712204f5), - SPH_C32(0xeda8d6a7) }, - { SPH_C32(0x54285c00), SPH_C32(0xeaed0000), SPH_C32(0xc5d60000), - SPH_C32(0xa1c50000), SPH_C32(0xb3a26770), SPH_C32(0x94a5c4e1), - SPH_C32(0x6bb0419d), SPH_C32(0x551b3782), SPH_C32(0x9cbb1800), - SPH_C32(0xb0d30000), SPH_C32(0x92510000), SPH_C32(0xed930000), - SPH_C32(0x593a4345), SPH_C32(0xe114d5f4), SPH_C32(0x430633da), - SPH_C32(0x78cace29) }, - { SPH_C32(0x9d435c30), SPH_C32(0x0dc80000), SPH_C32(0xea520000), - SPH_C32(0x878a0000), SPH_C32(0xbbcb3c89), SPH_C32(0xf95935d6), - SPH_C32(0x3b2f2819), SPH_C32(0xcb7298ea), SPH_C32(0xbadb1a40), - SPH_C32(0x6d0b0000), SPH_C32(0xe07b0000), SPH_C32(0xa2950000), - SPH_C32(0xca5c24ba), SPH_C32(0xc8ed913a), SPH_C32(0x758d500f), - SPH_C32(0x74ec3c4b) }, - { SPH_C32(0x40726000), SPH_C32(0x53040000), SPH_C32(0xa4f10000), - SPH_C32(0x50a40000), SPH_C32(0x7dc35a1c), SPH_C32(0x24ecf999), - SPH_C32(0x2c1926bd), SPH_C32(0xb4951347), SPH_C32(0xbfdc0c00), - SPH_C32(0x786a0000), SPH_C32(0x66960000), SPH_C32(0x16e60000), - SPH_C32(0x2af76720), SPH_C32(0x19b270bd), SPH_C32(0x41c239e5), - SPH_C32(0xa4ee2836) }, - { SPH_C32(0x89196030), SPH_C32(0xb4210000), SPH_C32(0x8b750000), - SPH_C32(0x76eb0000), SPH_C32(0x75aa01e5), SPH_C32(0x491008ae), - SPH_C32(0x7c864f39), SPH_C32(0x2afcbc2f), SPH_C32(0x99bc0e40), - SPH_C32(0xa5b20000), SPH_C32(0x14bc0000), SPH_C32(0x59e00000), - SPH_C32(0xb99100df), SPH_C32(0x304b3473), SPH_C32(0x77495a30), - SPH_C32(0xa8c8da54) }, - { SPH_C32(0x774f4800), SPH_C32(0x22540000), SPH_C32(0x31110000), - SPH_C32(0x5ab00000), SPH_C32(0xc06f4315), SPH_C32(0x6c0361a8), - SPH_C32(0x69744ba2), SPH_C32(0x893fd19d), SPH_C32(0xab863000), - SPH_C32(0xc1830000), SPH_C32(0x07b10000), SPH_C32(0xe7870000), - SPH_C32(0xe4965a4c), SPH_C32(0xa9fb4dc5), SPH_C32(0x066b5ec5), - SPH_C32(0x45600cf3) }, - { SPH_C32(0xbe244830), SPH_C32(0xc5710000), SPH_C32(0x1e950000), - SPH_C32(0x7cff0000), SPH_C32(0xc80618ec), SPH_C32(0x01ff909f), - SPH_C32(0x39eb2226), SPH_C32(0x17567ef5), SPH_C32(0x8de63240), - SPH_C32(0x1c5b0000), SPH_C32(0x759b0000), SPH_C32(0xa8810000), - SPH_C32(0x77f03db3), SPH_C32(0x8002090b), SPH_C32(0x30e03d10), - SPH_C32(0x4946fe91) }, - { SPH_C32(0x63157400), SPH_C32(0x9bbd0000), SPH_C32(0x50360000), - SPH_C32(0xabd10000), SPH_C32(0x0e0e7e79), SPH_C32(0xdc4a5cd0), - SPH_C32(0x2edd2c82), SPH_C32(0x68b1f558), SPH_C32(0x88e12400), - SPH_C32(0x093a0000), SPH_C32(0xf3760000), SPH_C32(0x1cf20000), - SPH_C32(0x975b7e29), SPH_C32(0x515de88c), SPH_C32(0x04af54fa), - SPH_C32(0x9944eaec) }, - { SPH_C32(0xaa7e7430), SPH_C32(0x7c980000), SPH_C32(0x7fb20000), - SPH_C32(0x8d9e0000), SPH_C32(0x06672580), SPH_C32(0xb1b6ade7), - SPH_C32(0x7e424506), SPH_C32(0xf6d85a30), SPH_C32(0xae812640), - SPH_C32(0xd4e20000), SPH_C32(0x815c0000), SPH_C32(0x53f40000), - SPH_C32(0x043d19d6), SPH_C32(0x78a4ac42), SPH_C32(0x3224372f), - SPH_C32(0x9562188e) }, - { SPH_C32(0x9cbb1800), SPH_C32(0xb0d30000), SPH_C32(0x92510000), - SPH_C32(0xed930000), SPH_C32(0x593a4345), SPH_C32(0xe114d5f4), - SPH_C32(0x430633da), SPH_C32(0x78cace29), SPH_C32(0xc8934400), - SPH_C32(0x5a3e0000), SPH_C32(0x57870000), SPH_C32(0x4c560000), - SPH_C32(0xea982435), SPH_C32(0x75b11115), SPH_C32(0x28b67247), - SPH_C32(0x2dd1f9ab) }, - { SPH_C32(0x55d01830), SPH_C32(0x57f60000), SPH_C32(0xbdd50000), - SPH_C32(0xcbdc0000), SPH_C32(0x515318bc), SPH_C32(0x8ce824c3), - SPH_C32(0x13995a5e), SPH_C32(0xe6a36141), SPH_C32(0xeef34640), - SPH_C32(0x87e60000), SPH_C32(0x25ad0000), SPH_C32(0x03500000), - SPH_C32(0x79fe43ca), SPH_C32(0x5c4855db), SPH_C32(0x1e3d1192), - SPH_C32(0x21f70bc9) }, - { SPH_C32(0x88e12400), SPH_C32(0x093a0000), SPH_C32(0xf3760000), - SPH_C32(0x1cf20000), SPH_C32(0x975b7e29), SPH_C32(0x515de88c), - SPH_C32(0x04af54fa), SPH_C32(0x9944eaec), SPH_C32(0xebf45000), - SPH_C32(0x92870000), SPH_C32(0xa3400000), SPH_C32(0xb7230000), - SPH_C32(0x99550050), SPH_C32(0x8d17b45c), SPH_C32(0x2a727878), - SPH_C32(0xf1f51fb4) }, - { SPH_C32(0x418a2430), SPH_C32(0xee1f0000), SPH_C32(0xdcf20000), - SPH_C32(0x3abd0000), SPH_C32(0x9f3225d0), SPH_C32(0x3ca119bb), - SPH_C32(0x54303d7e), SPH_C32(0x072d4584), SPH_C32(0xcd945240), - SPH_C32(0x4f5f0000), SPH_C32(0xd16a0000), SPH_C32(0xf8250000), - SPH_C32(0x0a3367af), SPH_C32(0xa4eef092), SPH_C32(0x1cf91bad), - SPH_C32(0xfdd3edd6) }, - { SPH_C32(0xbfdc0c00), SPH_C32(0x786a0000), SPH_C32(0x66960000), - SPH_C32(0x16e60000), SPH_C32(0x2af76720), SPH_C32(0x19b270bd), - SPH_C32(0x41c239e5), SPH_C32(0xa4ee2836), SPH_C32(0xffae6c00), - SPH_C32(0x2b6e0000), SPH_C32(0xc2670000), SPH_C32(0x46420000), - SPH_C32(0x57343d3c), SPH_C32(0x3d5e8924), SPH_C32(0x6ddb1f58), - SPH_C32(0x107b3b71) }, - { SPH_C32(0x76b70c30), SPH_C32(0x9f4f0000), SPH_C32(0x49120000), - SPH_C32(0x30a90000), SPH_C32(0x229e3cd9), SPH_C32(0x744e818a), - SPH_C32(0x115d5061), SPH_C32(0x3a87875e), SPH_C32(0xd9ce6e40), - SPH_C32(0xf6b60000), SPH_C32(0xb04d0000), SPH_C32(0x09440000), - SPH_C32(0xc4525ac3), SPH_C32(0x14a7cdea), SPH_C32(0x5b507c8d), - SPH_C32(0x1c5dc913) }, - { SPH_C32(0xab863000), SPH_C32(0xc1830000), SPH_C32(0x07b10000), - SPH_C32(0xe7870000), SPH_C32(0xe4965a4c), SPH_C32(0xa9fb4dc5), - SPH_C32(0x066b5ec5), SPH_C32(0x45600cf3), SPH_C32(0xdcc97800), - SPH_C32(0xe3d70000), SPH_C32(0x36a00000), SPH_C32(0xbd370000), - SPH_C32(0x24f91959), SPH_C32(0xc5f82c6d), SPH_C32(0x6f1f1567), - SPH_C32(0xcc5fdd6e) }, - { SPH_C32(0x62ed3030), SPH_C32(0x26a60000), SPH_C32(0x28350000), - SPH_C32(0xc1c80000), SPH_C32(0xecff01b5), SPH_C32(0xc407bcf2), - SPH_C32(0x56f43741), SPH_C32(0xdb09a39b), SPH_C32(0xfaa97a40), - SPH_C32(0x3e0f0000), SPH_C32(0x448a0000), SPH_C32(0xf2310000), - SPH_C32(0xb79f7ea6), SPH_C32(0xec0168a3), SPH_C32(0x599476b2), - SPH_C32(0xc0792f0c) }, - { SPH_C32(0xc8934400), SPH_C32(0x5a3e0000), SPH_C32(0x57870000), - SPH_C32(0x4c560000), SPH_C32(0xea982435), SPH_C32(0x75b11115), - SPH_C32(0x28b67247), SPH_C32(0x2dd1f9ab), SPH_C32(0x54285c00), - SPH_C32(0xeaed0000), SPH_C32(0xc5d60000), SPH_C32(0xa1c50000), - SPH_C32(0xb3a26770), SPH_C32(0x94a5c4e1), SPH_C32(0x6bb0419d), - SPH_C32(0x551b3782) }, - { SPH_C32(0x01f84430), SPH_C32(0xbd1b0000), SPH_C32(0x78030000), - SPH_C32(0x6a190000), SPH_C32(0xe2f17fcc), SPH_C32(0x184de022), - SPH_C32(0x78291bc3), SPH_C32(0xb3b856c3), SPH_C32(0x72485e40), - SPH_C32(0x37350000), SPH_C32(0xb7fc0000), SPH_C32(0xeec30000), - SPH_C32(0x20c4008f), SPH_C32(0xbd5c802f), SPH_C32(0x5d3b2248), - SPH_C32(0x593dc5e0) }, - { SPH_C32(0xdcc97800), SPH_C32(0xe3d70000), SPH_C32(0x36a00000), - SPH_C32(0xbd370000), SPH_C32(0x24f91959), SPH_C32(0xc5f82c6d), - SPH_C32(0x6f1f1567), SPH_C32(0xcc5fdd6e), SPH_C32(0x774f4800), - SPH_C32(0x22540000), SPH_C32(0x31110000), SPH_C32(0x5ab00000), - SPH_C32(0xc06f4315), SPH_C32(0x6c0361a8), SPH_C32(0x69744ba2), - SPH_C32(0x893fd19d) }, - { SPH_C32(0x15a27830), SPH_C32(0x04f20000), SPH_C32(0x19240000), - SPH_C32(0x9b780000), SPH_C32(0x2c9042a0), SPH_C32(0xa804dd5a), - SPH_C32(0x3f807ce3), SPH_C32(0x52367206), SPH_C32(0x512f4a40), - SPH_C32(0xff8c0000), SPH_C32(0x433b0000), SPH_C32(0x15b60000), - SPH_C32(0x530924ea), SPH_C32(0x45fa2566), SPH_C32(0x5fff2877), - SPH_C32(0x851923ff) }, - { SPH_C32(0xebf45000), SPH_C32(0x92870000), SPH_C32(0xa3400000), - SPH_C32(0xb7230000), SPH_C32(0x99550050), SPH_C32(0x8d17b45c), - SPH_C32(0x2a727878), SPH_C32(0xf1f51fb4), SPH_C32(0x63157400), - SPH_C32(0x9bbd0000), SPH_C32(0x50360000), SPH_C32(0xabd10000), - SPH_C32(0x0e0e7e79), SPH_C32(0xdc4a5cd0), SPH_C32(0x2edd2c82), - SPH_C32(0x68b1f558) }, - { SPH_C32(0x229f5030), SPH_C32(0x75a20000), SPH_C32(0x8cc40000), - SPH_C32(0x916c0000), SPH_C32(0x913c5ba9), SPH_C32(0xe0eb456b), - SPH_C32(0x7aed11fc), SPH_C32(0x6f9cb0dc), SPH_C32(0x45757640), - SPH_C32(0x46650000), SPH_C32(0x221c0000), SPH_C32(0xe4d70000), - SPH_C32(0x9d681986), SPH_C32(0xf5b3181e), SPH_C32(0x18564f57), - SPH_C32(0x6497073a) }, - { SPH_C32(0xffae6c00), SPH_C32(0x2b6e0000), SPH_C32(0xc2670000), - SPH_C32(0x46420000), SPH_C32(0x57343d3c), SPH_C32(0x3d5e8924), - SPH_C32(0x6ddb1f58), SPH_C32(0x107b3b71), SPH_C32(0x40726000), - SPH_C32(0x53040000), SPH_C32(0xa4f10000), SPH_C32(0x50a40000), - SPH_C32(0x7dc35a1c), SPH_C32(0x24ecf999), SPH_C32(0x2c1926bd), - SPH_C32(0xb4951347) }, - { SPH_C32(0x36c56c30), SPH_C32(0xcc4b0000), SPH_C32(0xede30000), - SPH_C32(0x600d0000), SPH_C32(0x5f5d66c5), SPH_C32(0x50a27813), - SPH_C32(0x3d4476dc), SPH_C32(0x8e129419), SPH_C32(0x66126240), - SPH_C32(0x8edc0000), SPH_C32(0xd6db0000), SPH_C32(0x1fa20000), - SPH_C32(0xeea53de3), SPH_C32(0x0d15bd57), SPH_C32(0x1a924568), - SPH_C32(0xb8b3e125) }, - { SPH_C32(0x29449c00), SPH_C32(0x64e70000), SPH_C32(0xf24b0000), - SPH_C32(0xc2f30000), SPH_C32(0x0ede4e8f), SPH_C32(0x56c23745), - SPH_C32(0xf3e04259), SPH_C32(0x8d0d9ec4), SPH_C32(0x466d0c00), - SPH_C32(0x08620000), SPH_C32(0xdd5d0000), SPH_C32(0xbadd0000), - SPH_C32(0x6a927942), SPH_C32(0x441f2b93), SPH_C32(0x218ace6f), - SPH_C32(0xbf2c0be2) }, - { SPH_C32(0xe02f9c30), SPH_C32(0x83c20000), SPH_C32(0xddcf0000), - SPH_C32(0xe4bc0000), SPH_C32(0x06b71576), SPH_C32(0x3b3ec672), - SPH_C32(0xa37f2bdd), SPH_C32(0x136431ac), SPH_C32(0x600d0e40), - SPH_C32(0xd5ba0000), SPH_C32(0xaf770000), SPH_C32(0xf5db0000), - SPH_C32(0xf9f41ebd), SPH_C32(0x6de66f5d), SPH_C32(0x1701adba), - SPH_C32(0xb30af980) }, - { SPH_C32(0x3d1ea000), SPH_C32(0xdd0e0000), SPH_C32(0x936c0000), - SPH_C32(0x33920000), SPH_C32(0xc0bf73e3), SPH_C32(0xe68b0a3d), - SPH_C32(0xb4492579), SPH_C32(0x6c83ba01), SPH_C32(0x650a1800), - SPH_C32(0xc0db0000), SPH_C32(0x299a0000), SPH_C32(0x41a80000), - SPH_C32(0x195f5d27), SPH_C32(0xbcb98eda), SPH_C32(0x234ec450), - SPH_C32(0x6308edfd) }, - { SPH_C32(0xf475a030), SPH_C32(0x3a2b0000), SPH_C32(0xbce80000), - SPH_C32(0x15dd0000), SPH_C32(0xc8d6281a), SPH_C32(0x8b77fb0a), - SPH_C32(0xe4d64cfd), SPH_C32(0xf2ea1569), SPH_C32(0x436a1a40), - SPH_C32(0x1d030000), SPH_C32(0x5bb00000), SPH_C32(0x0eae0000), - SPH_C32(0x8a393ad8), SPH_C32(0x9540ca14), SPH_C32(0x15c5a785), - SPH_C32(0x6f2e1f9f) }, - { SPH_C32(0x0a238800), SPH_C32(0xac5e0000), SPH_C32(0x068c0000), - SPH_C32(0x39860000), SPH_C32(0x7d136aea), SPH_C32(0xae64920c), - SPH_C32(0xf1244866), SPH_C32(0x512978db), SPH_C32(0x71502400), - SPH_C32(0x79320000), SPH_C32(0x48bd0000), SPH_C32(0xb0c90000), - SPH_C32(0xd73e604b), SPH_C32(0x0cf0b3a2), SPH_C32(0x64e7a370), - SPH_C32(0x8286c938) }, - { SPH_C32(0xc3488830), SPH_C32(0x4b7b0000), SPH_C32(0x29080000), - SPH_C32(0x1fc90000), SPH_C32(0x757a3113), SPH_C32(0xc398633b), - SPH_C32(0xa1bb21e2), SPH_C32(0xcf40d7b3), SPH_C32(0x57302640), - SPH_C32(0xa4ea0000), SPH_C32(0x3a970000), SPH_C32(0xffcf0000), - SPH_C32(0x445807b4), SPH_C32(0x2509f76c), SPH_C32(0x526cc0a5), - SPH_C32(0x8ea03b5a) }, - { SPH_C32(0x1e79b400), SPH_C32(0x15b70000), SPH_C32(0x67ab0000), - SPH_C32(0xc8e70000), SPH_C32(0xb3725786), SPH_C32(0x1e2daf74), - SPH_C32(0xb68d2f46), SPH_C32(0xb0a75c1e), SPH_C32(0x52373000), - SPH_C32(0xb18b0000), SPH_C32(0xbc7a0000), SPH_C32(0x4bbc0000), - SPH_C32(0xa4f3442e), SPH_C32(0xf45616eb), SPH_C32(0x6623a94f), - SPH_C32(0x5ea22f27) }, - { SPH_C32(0xd712b430), SPH_C32(0xf2920000), SPH_C32(0x482f0000), - SPH_C32(0xeea80000), SPH_C32(0xbb1b0c7f), SPH_C32(0x73d15e43), - SPH_C32(0xe61246c2), SPH_C32(0x2ecef376), SPH_C32(0x74573240), - SPH_C32(0x6c530000), SPH_C32(0xce500000), SPH_C32(0x04ba0000), - SPH_C32(0x379523d1), SPH_C32(0xddaf5225), SPH_C32(0x50a8ca9a), - SPH_C32(0x5284dd45) }, - { SPH_C32(0x7d6cc000), SPH_C32(0x8e0a0000), SPH_C32(0x379d0000), - SPH_C32(0x63360000), SPH_C32(0xbd7c29ff), SPH_C32(0xc267f3a4), - SPH_C32(0x985003c4), SPH_C32(0xd816a946), SPH_C32(0xdad61400), - SPH_C32(0xb8b10000), SPH_C32(0x4f0c0000), SPH_C32(0x574e0000), - SPH_C32(0x33a83a07), SPH_C32(0xa50bfe67), SPH_C32(0x628cfdb5), - SPH_C32(0xc7e6c5cb) }, - { SPH_C32(0xb407c030), SPH_C32(0x692f0000), SPH_C32(0x18190000), - SPH_C32(0x45790000), SPH_C32(0xb5157206), SPH_C32(0xaf9b0293), - SPH_C32(0xc8cf6a40), SPH_C32(0x467f062e), SPH_C32(0xfcb61640), - SPH_C32(0x65690000), SPH_C32(0x3d260000), SPH_C32(0x18480000), - SPH_C32(0xa0ce5df8), SPH_C32(0x8cf2baa9), SPH_C32(0x54079e60), - SPH_C32(0xcbc037a9) }, - { SPH_C32(0x6936fc00), SPH_C32(0x37e30000), SPH_C32(0x56ba0000), - SPH_C32(0x92570000), SPH_C32(0x731d1493), SPH_C32(0x722ecedc), - SPH_C32(0xdff964e4), SPH_C32(0x39988d83), SPH_C32(0xf9b10000), - SPH_C32(0x70080000), SPH_C32(0xbbcb0000), SPH_C32(0xac3b0000), - SPH_C32(0x40651e62), SPH_C32(0x5dad5b2e), SPH_C32(0x6048f78a), - SPH_C32(0x1bc223d4) }, - { SPH_C32(0xa05dfc30), SPH_C32(0xd0c60000), SPH_C32(0x793e0000), - SPH_C32(0xb4180000), SPH_C32(0x7b744f6a), SPH_C32(0x1fd23feb), - SPH_C32(0x8f660d60), SPH_C32(0xa7f122eb), SPH_C32(0xdfd10240), - SPH_C32(0xadd00000), SPH_C32(0xc9e10000), SPH_C32(0xe33d0000), - SPH_C32(0xd303799d), SPH_C32(0x74541fe0), SPH_C32(0x56c3945f), - SPH_C32(0x17e4d1b6) }, - { SPH_C32(0x5e0bd400), SPH_C32(0x46b30000), SPH_C32(0xc35a0000), - SPH_C32(0x98430000), SPH_C32(0xceb10d9a), SPH_C32(0x3ac156ed), - SPH_C32(0x9a9409fb), SPH_C32(0x04324f59), SPH_C32(0xedeb3c00), - SPH_C32(0xc9e10000), SPH_C32(0xdaec0000), SPH_C32(0x5d5a0000), - SPH_C32(0x8e04230e), SPH_C32(0xede46656), SPH_C32(0x27e190aa), - SPH_C32(0xfa4c0711) }, - { SPH_C32(0x9760d430), SPH_C32(0xa1960000), SPH_C32(0xecde0000), - SPH_C32(0xbe0c0000), SPH_C32(0xc6d85663), SPH_C32(0x573da7da), - SPH_C32(0xca0b607f), SPH_C32(0x9a5be031), SPH_C32(0xcb8b3e40), - SPH_C32(0x14390000), SPH_C32(0xa8c60000), SPH_C32(0x125c0000), - SPH_C32(0x1d6244f1), SPH_C32(0xc41d2298), SPH_C32(0x116af37f), - SPH_C32(0xf66af573) }, - { SPH_C32(0x4a51e800), SPH_C32(0xff5a0000), SPH_C32(0xa27d0000), - SPH_C32(0x69220000), SPH_C32(0x00d030f6), SPH_C32(0x8a886b95), - SPH_C32(0xdd3d6edb), SPH_C32(0xe5bc6b9c), SPH_C32(0xce8c2800), - SPH_C32(0x01580000), SPH_C32(0x2e2b0000), SPH_C32(0xa62f0000), - SPH_C32(0xfdc9076b), SPH_C32(0x1542c31f), SPH_C32(0x25259a95), - SPH_C32(0x2668e10e) }, - { SPH_C32(0x833ae830), SPH_C32(0x187f0000), SPH_C32(0x8df90000), - SPH_C32(0x4f6d0000), SPH_C32(0x08b96b0f), SPH_C32(0xe7749aa2), - SPH_C32(0x8da2075f), SPH_C32(0x7bd5c4f4), SPH_C32(0xe8ec2a40), - SPH_C32(0xdc800000), SPH_C32(0x5c010000), SPH_C32(0xe9290000), - SPH_C32(0x6eaf6094), SPH_C32(0x3cbb87d1), SPH_C32(0x13aef940), - SPH_C32(0x2a4e136c) }, - { SPH_C32(0xb5ff8400), SPH_C32(0xd4340000), SPH_C32(0x601a0000), - SPH_C32(0x2f600000), SPH_C32(0x57e40dca), SPH_C32(0xb7d6e2b1), - SPH_C32(0xb0e67183), SPH_C32(0xf5c750ed), SPH_C32(0x8efe4800), - SPH_C32(0x525c0000), SPH_C32(0x8ada0000), SPH_C32(0xf68b0000), - SPH_C32(0x800a5d77), SPH_C32(0x31ae3a86), SPH_C32(0x093cbc28), - SPH_C32(0x92fdf249) }, - { SPH_C32(0x7c948430), SPH_C32(0x33110000), SPH_C32(0x4f9e0000), - SPH_C32(0x092f0000), SPH_C32(0x5f8d5633), SPH_C32(0xda2a1386), - SPH_C32(0xe0791807), SPH_C32(0x6baeff85), SPH_C32(0xa89e4a40), - SPH_C32(0x8f840000), SPH_C32(0xf8f00000), SPH_C32(0xb98d0000), - SPH_C32(0x136c3a88), SPH_C32(0x18577e48), SPH_C32(0x3fb7dffd), - SPH_C32(0x9edb002b) }, - { SPH_C32(0xa1a5b800), SPH_C32(0x6ddd0000), SPH_C32(0x013d0000), - SPH_C32(0xde010000), SPH_C32(0x998530a6), SPH_C32(0x079fdfc9), - SPH_C32(0xf74f16a3), SPH_C32(0x14497428), SPH_C32(0xad995c00), - SPH_C32(0x9ae50000), SPH_C32(0x7e1d0000), SPH_C32(0x0dfe0000), - SPH_C32(0xf3c77912), SPH_C32(0xc9089fcf), SPH_C32(0x0bf8b617), - SPH_C32(0x4ed91456) }, - { SPH_C32(0x68ceb830), SPH_C32(0x8af80000), SPH_C32(0x2eb90000), - SPH_C32(0xf84e0000), SPH_C32(0x91ec6b5f), SPH_C32(0x6a632efe), - SPH_C32(0xa7d07f27), SPH_C32(0x8a20db40), SPH_C32(0x8bf95e40), - SPH_C32(0x473d0000), SPH_C32(0x0c370000), SPH_C32(0x42f80000), - SPH_C32(0x60a11eed), SPH_C32(0xe0f1db01), SPH_C32(0x3d73d5c2), - SPH_C32(0x42ffe634) }, - { SPH_C32(0x96989000), SPH_C32(0x1c8d0000), SPH_C32(0x94dd0000), - SPH_C32(0xd4150000), SPH_C32(0x242929af), SPH_C32(0x4f7047f8), - SPH_C32(0xb2227bbc), SPH_C32(0x29e3b6f2), SPH_C32(0xb9c36000), - SPH_C32(0x230c0000), SPH_C32(0x1f3a0000), SPH_C32(0xfc9f0000), - SPH_C32(0x3da6447e), SPH_C32(0x7941a2b7), SPH_C32(0x4c51d137), - SPH_C32(0xaf573093) }, - { SPH_C32(0x5ff39030), SPH_C32(0xfba80000), SPH_C32(0xbb590000), - SPH_C32(0xf25a0000), SPH_C32(0x2c407256), SPH_C32(0x228cb6cf), - SPH_C32(0xe2bd1238), SPH_C32(0xb78a199a), SPH_C32(0x9fa36240), - SPH_C32(0xfed40000), SPH_C32(0x6d100000), SPH_C32(0xb3990000), - SPH_C32(0xaec02381), SPH_C32(0x50b8e679), SPH_C32(0x7adab2e2), - SPH_C32(0xa371c2f1) }, - { SPH_C32(0x82c2ac00), SPH_C32(0xa5640000), SPH_C32(0xf5fa0000), - SPH_C32(0x25740000), SPH_C32(0xea4814c3), SPH_C32(0xff397a80), - SPH_C32(0xf58b1c9c), SPH_C32(0xc86d9237), SPH_C32(0x9aa47400), - SPH_C32(0xebb50000), SPH_C32(0xebfd0000), SPH_C32(0x07ea0000), - SPH_C32(0x4e6b601b), SPH_C32(0x81e707fe), SPH_C32(0x4e95db08), - SPH_C32(0x7373d68c) }, - { SPH_C32(0x4ba9ac30), SPH_C32(0x42410000), SPH_C32(0xda7e0000), - SPH_C32(0x033b0000), SPH_C32(0xe2214f3a), SPH_C32(0x92c58bb7), - SPH_C32(0xa5147518), SPH_C32(0x56043d5f), SPH_C32(0xbcc47640), - SPH_C32(0x366d0000), SPH_C32(0x99d70000), SPH_C32(0x48ec0000), - SPH_C32(0xdd0d07e4), SPH_C32(0xa81e4330), SPH_C32(0x781eb8dd), - SPH_C32(0x7f5524ee) }, - { SPH_C32(0xe1d7d800), SPH_C32(0x3ed90000), SPH_C32(0xa5cc0000), - SPH_C32(0x8ea50000), SPH_C32(0xe4466aba), SPH_C32(0x23732650), - SPH_C32(0xdb56301e), SPH_C32(0xa0dc676f), SPH_C32(0x12455000), - SPH_C32(0xe28f0000), SPH_C32(0x188b0000), SPH_C32(0x1b180000), - SPH_C32(0xd9301e32), SPH_C32(0xd0baef72), SPH_C32(0x4a3a8ff2), - SPH_C32(0xea373c60) }, - { SPH_C32(0x28bcd830), SPH_C32(0xd9fc0000), SPH_C32(0x8a480000), - SPH_C32(0xa8ea0000), SPH_C32(0xec2f3143), SPH_C32(0x4e8fd767), - SPH_C32(0x8bc9599a), SPH_C32(0x3eb5c807), SPH_C32(0x34255240), - SPH_C32(0x3f570000), SPH_C32(0x6aa10000), SPH_C32(0x541e0000), - SPH_C32(0x4a5679cd), SPH_C32(0xf943abbc), SPH_C32(0x7cb1ec27), - SPH_C32(0xe611ce02) }, - { SPH_C32(0xf58de400), SPH_C32(0x87300000), SPH_C32(0xc4eb0000), - SPH_C32(0x7fc40000), SPH_C32(0x2a2757d6), SPH_C32(0x933a1b28), - SPH_C32(0x9cff573e), SPH_C32(0x415243aa), SPH_C32(0x31224400), - SPH_C32(0x2a360000), SPH_C32(0xec4c0000), SPH_C32(0xe06d0000), - SPH_C32(0xaafd3a57), SPH_C32(0x281c4a3b), SPH_C32(0x48fe85cd), - SPH_C32(0x3613da7f) }, - { SPH_C32(0x3ce6e430), SPH_C32(0x60150000), SPH_C32(0xeb6f0000), - SPH_C32(0x598b0000), SPH_C32(0x224e0c2f), SPH_C32(0xfec6ea1f), - SPH_C32(0xcc603eba), SPH_C32(0xdf3becc2), SPH_C32(0x17424640), - SPH_C32(0xf7ee0000), SPH_C32(0x9e660000), SPH_C32(0xaf6b0000), - SPH_C32(0x399b5da8), SPH_C32(0x01e50ef5), SPH_C32(0x7e75e618), - SPH_C32(0x3a35281d) }, - { SPH_C32(0xc2b0cc00), SPH_C32(0xf6600000), SPH_C32(0x510b0000), - SPH_C32(0x75d00000), SPH_C32(0x978b4edf), SPH_C32(0xdbd58319), - SPH_C32(0xd9923a21), SPH_C32(0x7cf88170), SPH_C32(0x25787800), - SPH_C32(0x93df0000), SPH_C32(0x8d6b0000), SPH_C32(0x110c0000), - SPH_C32(0x649c073b), SPH_C32(0x98557743), SPH_C32(0x0f57e2ed), - SPH_C32(0xd79dfeba) }, - { SPH_C32(0x0bdbcc30), SPH_C32(0x11450000), SPH_C32(0x7e8f0000), - SPH_C32(0x539f0000), SPH_C32(0x9fe21526), SPH_C32(0xb629722e), - SPH_C32(0x890d53a5), SPH_C32(0xe2912e18), SPH_C32(0x03187a40), - SPH_C32(0x4e070000), SPH_C32(0xff410000), SPH_C32(0x5e0a0000), - SPH_C32(0xf7fa60c4), SPH_C32(0xb1ac338d), SPH_C32(0x39dc8138), - SPH_C32(0xdbbb0cd8) }, - { SPH_C32(0xd6eaf000), SPH_C32(0x4f890000), SPH_C32(0x302c0000), - SPH_C32(0x84b10000), SPH_C32(0x59ea73b3), SPH_C32(0x6b9cbe61), - SPH_C32(0x9e3b5d01), SPH_C32(0x9d76a5b5), SPH_C32(0x061f6c00), - SPH_C32(0x5b660000), SPH_C32(0x79ac0000), SPH_C32(0xea790000), - SPH_C32(0x1751235e), SPH_C32(0x60f3d20a), SPH_C32(0x0d93e8d2), - SPH_C32(0x0bb918a5) }, - { SPH_C32(0x1f81f030), SPH_C32(0xa8ac0000), SPH_C32(0x1fa80000), - SPH_C32(0xa2fe0000), SPH_C32(0x5183284a), SPH_C32(0x06604f56), - SPH_C32(0xcea43485), SPH_C32(0x031f0add), SPH_C32(0x207f6e40), - SPH_C32(0x86be0000), SPH_C32(0x0b860000), SPH_C32(0xa57f0000), - SPH_C32(0x843744a1), SPH_C32(0x490a96c4), SPH_C32(0x3b188b07), - SPH_C32(0x079feac7) }, - { SPH_C32(0x466d0c00), SPH_C32(0x08620000), SPH_C32(0xdd5d0000), - SPH_C32(0xbadd0000), SPH_C32(0x6a927942), SPH_C32(0x441f2b93), - SPH_C32(0x218ace6f), SPH_C32(0xbf2c0be2), SPH_C32(0x6f299000), - SPH_C32(0x6c850000), SPH_C32(0x2f160000), SPH_C32(0x782e0000), - SPH_C32(0x644c37cd), SPH_C32(0x12dd1cd6), SPH_C32(0xd26a8c36), - SPH_C32(0x32219526) }, - { SPH_C32(0x8f060c30), SPH_C32(0xef470000), SPH_C32(0xf2d90000), - SPH_C32(0x9c920000), SPH_C32(0x62fb22bb), SPH_C32(0x29e3daa4), - SPH_C32(0x7115a7eb), SPH_C32(0x2145a48a), SPH_C32(0x49499240), - SPH_C32(0xb15d0000), SPH_C32(0x5d3c0000), SPH_C32(0x37280000), - SPH_C32(0xf72a5032), SPH_C32(0x3b245818), SPH_C32(0xe4e1efe3), - SPH_C32(0x3e076744) }, - { SPH_C32(0x52373000), SPH_C32(0xb18b0000), SPH_C32(0xbc7a0000), - SPH_C32(0x4bbc0000), SPH_C32(0xa4f3442e), SPH_C32(0xf45616eb), - SPH_C32(0x6623a94f), SPH_C32(0x5ea22f27), SPH_C32(0x4c4e8400), - SPH_C32(0xa43c0000), SPH_C32(0xdbd10000), SPH_C32(0x835b0000), - SPH_C32(0x178113a8), SPH_C32(0xea7bb99f), SPH_C32(0xd0ae8609), - SPH_C32(0xee057339) }, - { SPH_C32(0x9b5c3030), SPH_C32(0x56ae0000), SPH_C32(0x93fe0000), - SPH_C32(0x6df30000), SPH_C32(0xac9a1fd7), SPH_C32(0x99aae7dc), - SPH_C32(0x36bcc0cb), SPH_C32(0xc0cb804f), SPH_C32(0x6a2e8640), - SPH_C32(0x79e40000), SPH_C32(0xa9fb0000), SPH_C32(0xcc5d0000), - SPH_C32(0x84e77457), SPH_C32(0xc382fd51), SPH_C32(0xe625e5dc), - SPH_C32(0xe223815b) }, - { SPH_C32(0x650a1800), SPH_C32(0xc0db0000), SPH_C32(0x299a0000), - SPH_C32(0x41a80000), SPH_C32(0x195f5d27), SPH_C32(0xbcb98eda), - SPH_C32(0x234ec450), SPH_C32(0x6308edfd), SPH_C32(0x5814b800), - SPH_C32(0x1dd50000), SPH_C32(0xbaf60000), SPH_C32(0x723a0000), - SPH_C32(0xd9e02ec4), SPH_C32(0x5a3284e7), SPH_C32(0x9707e129), - SPH_C32(0x0f8b57fc) }, - { SPH_C32(0xac611830), SPH_C32(0x27fe0000), SPH_C32(0x061e0000), - SPH_C32(0x67e70000), SPH_C32(0x113606de), SPH_C32(0xd1457fed), - SPH_C32(0x73d1add4), SPH_C32(0xfd614295), SPH_C32(0x7e74ba40), - SPH_C32(0xc00d0000), SPH_C32(0xc8dc0000), SPH_C32(0x3d3c0000), - SPH_C32(0x4a86493b), SPH_C32(0x73cbc029), SPH_C32(0xa18c82fc), - SPH_C32(0x03ada59e) }, - { SPH_C32(0x71502400), SPH_C32(0x79320000), SPH_C32(0x48bd0000), - SPH_C32(0xb0c90000), SPH_C32(0xd73e604b), SPH_C32(0x0cf0b3a2), - SPH_C32(0x64e7a370), SPH_C32(0x8286c938), SPH_C32(0x7b73ac00), - SPH_C32(0xd56c0000), SPH_C32(0x4e310000), SPH_C32(0x894f0000), - SPH_C32(0xaa2d0aa1), SPH_C32(0xa29421ae), SPH_C32(0x95c3eb16), - SPH_C32(0xd3afb1e3) }, - { SPH_C32(0xb83b2430), SPH_C32(0x9e170000), SPH_C32(0x67390000), - SPH_C32(0x96860000), SPH_C32(0xdf573bb2), SPH_C32(0x610c4295), - SPH_C32(0x3478caf4), SPH_C32(0x1cef6650), SPH_C32(0x5d13ae40), - SPH_C32(0x08b40000), SPH_C32(0x3c1b0000), SPH_C32(0xc6490000), - SPH_C32(0x394b6d5e), SPH_C32(0x8b6d6560), SPH_C32(0xa34888c3), - SPH_C32(0xdf894381) }, - { SPH_C32(0x12455000), SPH_C32(0xe28f0000), SPH_C32(0x188b0000), - SPH_C32(0x1b180000), SPH_C32(0xd9301e32), SPH_C32(0xd0baef72), - SPH_C32(0x4a3a8ff2), SPH_C32(0xea373c60), SPH_C32(0xf3928800), - SPH_C32(0xdc560000), SPH_C32(0xbd470000), SPH_C32(0x95bd0000), - SPH_C32(0x3d767488), SPH_C32(0xf3c9c922), SPH_C32(0x916cbfec), - SPH_C32(0x4aeb5b0f) }, - { SPH_C32(0xdb2e5030), SPH_C32(0x05aa0000), SPH_C32(0x370f0000), - SPH_C32(0x3d570000), SPH_C32(0xd15945cb), SPH_C32(0xbd461e45), - SPH_C32(0x1aa5e676), SPH_C32(0x745e9308), SPH_C32(0xd5f28a40), - SPH_C32(0x018e0000), SPH_C32(0xcf6d0000), SPH_C32(0xdabb0000), - SPH_C32(0xae101377), SPH_C32(0xda308dec), SPH_C32(0xa7e7dc39), - SPH_C32(0x46cda96d) }, - { SPH_C32(0x061f6c00), SPH_C32(0x5b660000), SPH_C32(0x79ac0000), - SPH_C32(0xea790000), SPH_C32(0x1751235e), SPH_C32(0x60f3d20a), - SPH_C32(0x0d93e8d2), SPH_C32(0x0bb918a5), SPH_C32(0xd0f59c00), - SPH_C32(0x14ef0000), SPH_C32(0x49800000), SPH_C32(0x6ec80000), - SPH_C32(0x4ebb50ed), SPH_C32(0x0b6f6c6b), SPH_C32(0x93a8b5d3), - SPH_C32(0x96cfbd10) }, - { SPH_C32(0xcf746c30), SPH_C32(0xbc430000), SPH_C32(0x56280000), - SPH_C32(0xcc360000), SPH_C32(0x1f3878a7), SPH_C32(0x0d0f233d), - SPH_C32(0x5d0c8156), SPH_C32(0x95d0b7cd), SPH_C32(0xf6959e40), - SPH_C32(0xc9370000), SPH_C32(0x3baa0000), SPH_C32(0x21ce0000), - SPH_C32(0xdddd3712), SPH_C32(0x229628a5), SPH_C32(0xa523d606), - SPH_C32(0x9ae94f72) }, - { SPH_C32(0x31224400), SPH_C32(0x2a360000), SPH_C32(0xec4c0000), - SPH_C32(0xe06d0000), SPH_C32(0xaafd3a57), SPH_C32(0x281c4a3b), - SPH_C32(0x48fe85cd), SPH_C32(0x3613da7f), SPH_C32(0xc4afa000), - SPH_C32(0xad060000), SPH_C32(0x28a70000), SPH_C32(0x9fa90000), - SPH_C32(0x80da6d81), SPH_C32(0xbb265113), SPH_C32(0xd401d2f3), - SPH_C32(0x774199d5) }, - { SPH_C32(0xf8494430), SPH_C32(0xcd130000), SPH_C32(0xc3c80000), - SPH_C32(0xc6220000), SPH_C32(0xa29461ae), SPH_C32(0x45e0bb0c), - SPH_C32(0x1861ec49), SPH_C32(0xa87a7517), SPH_C32(0xe2cfa240), - SPH_C32(0x70de0000), SPH_C32(0x5a8d0000), SPH_C32(0xd0af0000), - SPH_C32(0x13bc0a7e), SPH_C32(0x92df15dd), SPH_C32(0xe28ab126), - SPH_C32(0x7b676bb7) }, - { SPH_C32(0x25787800), SPH_C32(0x93df0000), SPH_C32(0x8d6b0000), - SPH_C32(0x110c0000), SPH_C32(0x649c073b), SPH_C32(0x98557743), - SPH_C32(0x0f57e2ed), SPH_C32(0xd79dfeba), SPH_C32(0xe7c8b400), - SPH_C32(0x65bf0000), SPH_C32(0xdc600000), SPH_C32(0x64dc0000), - SPH_C32(0xf31749e4), SPH_C32(0x4380f45a), SPH_C32(0xd6c5d8cc), - SPH_C32(0xab657fca) }, - { SPH_C32(0xec137830), SPH_C32(0x74fa0000), SPH_C32(0xa2ef0000), - SPH_C32(0x37430000), SPH_C32(0x6cf55cc2), SPH_C32(0xf5a98674), - SPH_C32(0x5fc88b69), SPH_C32(0x49f451d2), SPH_C32(0xc1a8b640), - SPH_C32(0xb8670000), SPH_C32(0xae4a0000), SPH_C32(0x2bda0000), - SPH_C32(0x60712e1b), SPH_C32(0x6a79b094), SPH_C32(0xe04ebb19), - SPH_C32(0xa7438da8) }, - { SPH_C32(0xdad61400), SPH_C32(0xb8b10000), SPH_C32(0x4f0c0000), - SPH_C32(0x574e0000), SPH_C32(0x33a83a07), SPH_C32(0xa50bfe67), - SPH_C32(0x628cfdb5), SPH_C32(0xc7e6c5cb), SPH_C32(0xa7bad400), - SPH_C32(0x36bb0000), SPH_C32(0x78910000), SPH_C32(0x34780000), - SPH_C32(0x8ed413f8), SPH_C32(0x676c0dc3), SPH_C32(0xfadcfe71), - SPH_C32(0x1ff06c8d) }, - { SPH_C32(0x13bd1430), SPH_C32(0x5f940000), SPH_C32(0x60880000), - SPH_C32(0x71010000), SPH_C32(0x3bc161fe), SPH_C32(0xc8f70f50), - SPH_C32(0x32139431), SPH_C32(0x598f6aa3), SPH_C32(0x81dad640), - SPH_C32(0xeb630000), SPH_C32(0x0abb0000), SPH_C32(0x7b7e0000), - SPH_C32(0x1db27407), SPH_C32(0x4e95490d), SPH_C32(0xcc579da4), - SPH_C32(0x13d69eef) }, - { SPH_C32(0xce8c2800), SPH_C32(0x01580000), SPH_C32(0x2e2b0000), - SPH_C32(0xa62f0000), SPH_C32(0xfdc9076b), SPH_C32(0x1542c31f), - SPH_C32(0x25259a95), SPH_C32(0x2668e10e), SPH_C32(0x84ddc000), - SPH_C32(0xfe020000), SPH_C32(0x8c560000), SPH_C32(0xcf0d0000), - SPH_C32(0xfd19379d), SPH_C32(0x9fcaa88a), SPH_C32(0xf818f44e), - SPH_C32(0xc3d48a92) }, - { SPH_C32(0x07e72830), SPH_C32(0xe67d0000), SPH_C32(0x01af0000), - SPH_C32(0x80600000), SPH_C32(0xf5a05c92), SPH_C32(0x78be3228), - SPH_C32(0x75baf311), SPH_C32(0xb8014e66), SPH_C32(0xa2bdc240), - SPH_C32(0x23da0000), SPH_C32(0xfe7c0000), SPH_C32(0x800b0000), - SPH_C32(0x6e7f5062), SPH_C32(0xb633ec44), SPH_C32(0xce93979b), - SPH_C32(0xcff278f0) }, - { SPH_C32(0xf9b10000), SPH_C32(0x70080000), SPH_C32(0xbbcb0000), - SPH_C32(0xac3b0000), SPH_C32(0x40651e62), SPH_C32(0x5dad5b2e), - SPH_C32(0x6048f78a), SPH_C32(0x1bc223d4), SPH_C32(0x9087fc00), - SPH_C32(0x47eb0000), SPH_C32(0xed710000), SPH_C32(0x3e6c0000), - SPH_C32(0x33780af1), SPH_C32(0x2f8395f2), SPH_C32(0xbfb1936e), - SPH_C32(0x225aae57) }, - { SPH_C32(0x30da0030), SPH_C32(0x972d0000), SPH_C32(0x944f0000), - SPH_C32(0x8a740000), SPH_C32(0x480c459b), SPH_C32(0x3051aa19), - SPH_C32(0x30d79e0e), SPH_C32(0x85ab8cbc), SPH_C32(0xb6e7fe40), - SPH_C32(0x9a330000), SPH_C32(0x9f5b0000), SPH_C32(0x716a0000), - SPH_C32(0xa01e6d0e), SPH_C32(0x067ad13c), SPH_C32(0x893af0bb), - SPH_C32(0x2e7c5c35) }, - { SPH_C32(0xedeb3c00), SPH_C32(0xc9e10000), SPH_C32(0xdaec0000), - SPH_C32(0x5d5a0000), SPH_C32(0x8e04230e), SPH_C32(0xede46656), - SPH_C32(0x27e190aa), SPH_C32(0xfa4c0711), SPH_C32(0xb3e0e800), - SPH_C32(0x8f520000), SPH_C32(0x19b60000), SPH_C32(0xc5190000), - SPH_C32(0x40b52e94), SPH_C32(0xd72530bb), SPH_C32(0xbd759951), - SPH_C32(0xfe7e4848) }, - { SPH_C32(0x24803c30), SPH_C32(0x2ec40000), SPH_C32(0xf5680000), - SPH_C32(0x7b150000), SPH_C32(0x866d78f7), SPH_C32(0x80189761), - SPH_C32(0x777ef92e), SPH_C32(0x6425a879), SPH_C32(0x9580ea40), - SPH_C32(0x528a0000), SPH_C32(0x6b9c0000), SPH_C32(0x8a1f0000), - SPH_C32(0xd3d3496b), SPH_C32(0xfedc7475), SPH_C32(0x8bfefa84), - SPH_C32(0xf258ba2a) }, - { SPH_C32(0x8efe4800), SPH_C32(0x525c0000), SPH_C32(0x8ada0000), - SPH_C32(0xf68b0000), SPH_C32(0x800a5d77), SPH_C32(0x31ae3a86), - SPH_C32(0x093cbc28), SPH_C32(0x92fdf249), SPH_C32(0x3b01cc00), - SPH_C32(0x86680000), SPH_C32(0xeac00000), SPH_C32(0xd9eb0000), - SPH_C32(0xd7ee50bd), SPH_C32(0x8678d837), SPH_C32(0xb9dacdab), - SPH_C32(0x673aa2a4) }, - { SPH_C32(0x47954830), SPH_C32(0xb5790000), SPH_C32(0xa55e0000), - SPH_C32(0xd0c40000), SPH_C32(0x8863068e), SPH_C32(0x5c52cbb1), - SPH_C32(0x59a3d5ac), SPH_C32(0x0c945d21), SPH_C32(0x1d61ce40), - SPH_C32(0x5bb00000), SPH_C32(0x98ea0000), SPH_C32(0x96ed0000), - SPH_C32(0x44883742), SPH_C32(0xaf819cf9), SPH_C32(0x8f51ae7e), - SPH_C32(0x6b1c50c6) }, - { SPH_C32(0x9aa47400), SPH_C32(0xebb50000), SPH_C32(0xebfd0000), - SPH_C32(0x07ea0000), SPH_C32(0x4e6b601b), SPH_C32(0x81e707fe), - SPH_C32(0x4e95db08), SPH_C32(0x7373d68c), SPH_C32(0x1866d800), - SPH_C32(0x4ed10000), SPH_C32(0x1e070000), SPH_C32(0x229e0000), - SPH_C32(0xa42374d8), SPH_C32(0x7ede7d7e), SPH_C32(0xbb1ec794), - SPH_C32(0xbb1e44bb) }, - { SPH_C32(0x53cf7430), SPH_C32(0x0c900000), SPH_C32(0xc4790000), - SPH_C32(0x21a50000), SPH_C32(0x46023be2), SPH_C32(0xec1bf6c9), - SPH_C32(0x1e0ab28c), SPH_C32(0xed1a79e4), SPH_C32(0x3e06da40), - SPH_C32(0x93090000), SPH_C32(0x6c2d0000), SPH_C32(0x6d980000), - SPH_C32(0x37451327), SPH_C32(0x572739b0), SPH_C32(0x8d95a441), - SPH_C32(0xb738b6d9) }, - { SPH_C32(0xad995c00), SPH_C32(0x9ae50000), SPH_C32(0x7e1d0000), - SPH_C32(0x0dfe0000), SPH_C32(0xf3c77912), SPH_C32(0xc9089fcf), - SPH_C32(0x0bf8b617), SPH_C32(0x4ed91456), SPH_C32(0x0c3ce400), - SPH_C32(0xf7380000), SPH_C32(0x7f200000), SPH_C32(0xd3ff0000), - SPH_C32(0x6a4249b4), SPH_C32(0xce974006), SPH_C32(0xfcb7a0b4), - SPH_C32(0x5a90607e) }, - { SPH_C32(0x64f25c30), SPH_C32(0x7dc00000), SPH_C32(0x51990000), - SPH_C32(0x2bb10000), SPH_C32(0xfbae22eb), SPH_C32(0xa4f46ef8), - SPH_C32(0x5b67df93), SPH_C32(0xd0b0bb3e), SPH_C32(0x2a5ce640), - SPH_C32(0x2ae00000), SPH_C32(0x0d0a0000), SPH_C32(0x9cf90000), - SPH_C32(0xf9242e4b), SPH_C32(0xe76e04c8), SPH_C32(0xca3cc361), - SPH_C32(0x56b6921c) }, - { SPH_C32(0xb9c36000), SPH_C32(0x230c0000), SPH_C32(0x1f3a0000), - SPH_C32(0xfc9f0000), SPH_C32(0x3da6447e), SPH_C32(0x7941a2b7), - SPH_C32(0x4c51d137), SPH_C32(0xaf573093), SPH_C32(0x2f5bf000), - SPH_C32(0x3f810000), SPH_C32(0x8be70000), SPH_C32(0x288a0000), - SPH_C32(0x198f6dd1), SPH_C32(0x3631e54f), SPH_C32(0xfe73aa8b), - SPH_C32(0x86b48661) }, - { SPH_C32(0x70a86030), SPH_C32(0xc4290000), SPH_C32(0x30be0000), - SPH_C32(0xdad00000), SPH_C32(0x35cf1f87), SPH_C32(0x14bd5380), - SPH_C32(0x1cceb8b3), SPH_C32(0x313e9ffb), SPH_C32(0x093bf240), - SPH_C32(0xe2590000), SPH_C32(0xf9cd0000), SPH_C32(0x678c0000), - SPH_C32(0x8ae90a2e), SPH_C32(0x1fc8a181), SPH_C32(0xc8f8c95e), - SPH_C32(0x8a927403) }, - { SPH_C32(0x6f299000), SPH_C32(0x6c850000), SPH_C32(0x2f160000), - SPH_C32(0x782e0000), SPH_C32(0x644c37cd), SPH_C32(0x12dd1cd6), - SPH_C32(0xd26a8c36), SPH_C32(0x32219526), SPH_C32(0x29449c00), - SPH_C32(0x64e70000), SPH_C32(0xf24b0000), SPH_C32(0xc2f30000), - SPH_C32(0x0ede4e8f), SPH_C32(0x56c23745), SPH_C32(0xf3e04259), - SPH_C32(0x8d0d9ec4) }, - { SPH_C32(0xa6429030), SPH_C32(0x8ba00000), SPH_C32(0x00920000), - SPH_C32(0x5e610000), SPH_C32(0x6c256c34), SPH_C32(0x7f21ede1), - SPH_C32(0x82f5e5b2), SPH_C32(0xac483a4e), SPH_C32(0x0f249e40), - SPH_C32(0xb93f0000), SPH_C32(0x80610000), SPH_C32(0x8df50000), - SPH_C32(0x9db82970), SPH_C32(0x7f3b738b), SPH_C32(0xc56b218c), - SPH_C32(0x812b6ca6) }, - { SPH_C32(0x7b73ac00), SPH_C32(0xd56c0000), SPH_C32(0x4e310000), - SPH_C32(0x894f0000), SPH_C32(0xaa2d0aa1), SPH_C32(0xa29421ae), - SPH_C32(0x95c3eb16), SPH_C32(0xd3afb1e3), SPH_C32(0x0a238800), - SPH_C32(0xac5e0000), SPH_C32(0x068c0000), SPH_C32(0x39860000), - SPH_C32(0x7d136aea), SPH_C32(0xae64920c), SPH_C32(0xf1244866), - SPH_C32(0x512978db) }, - { SPH_C32(0xb218ac30), SPH_C32(0x32490000), SPH_C32(0x61b50000), - SPH_C32(0xaf000000), SPH_C32(0xa2445158), SPH_C32(0xcf68d099), - SPH_C32(0xc55c8292), SPH_C32(0x4dc61e8b), SPH_C32(0x2c438a40), - SPH_C32(0x71860000), SPH_C32(0x74a60000), SPH_C32(0x76800000), - SPH_C32(0xee750d15), SPH_C32(0x879dd6c2), SPH_C32(0xc7af2bb3), - SPH_C32(0x5d0f8ab9) }, - { SPH_C32(0x4c4e8400), SPH_C32(0xa43c0000), SPH_C32(0xdbd10000), - SPH_C32(0x835b0000), SPH_C32(0x178113a8), SPH_C32(0xea7bb99f), - SPH_C32(0xd0ae8609), SPH_C32(0xee057339), SPH_C32(0x1e79b400), - SPH_C32(0x15b70000), SPH_C32(0x67ab0000), SPH_C32(0xc8e70000), - SPH_C32(0xb3725786), SPH_C32(0x1e2daf74), SPH_C32(0xb68d2f46), - SPH_C32(0xb0a75c1e) }, - { SPH_C32(0x85258430), SPH_C32(0x43190000), SPH_C32(0xf4550000), - SPH_C32(0xa5140000), SPH_C32(0x1fe84851), SPH_C32(0x878748a8), - SPH_C32(0x8031ef8d), SPH_C32(0x706cdc51), SPH_C32(0x3819b640), - SPH_C32(0xc86f0000), SPH_C32(0x15810000), SPH_C32(0x87e10000), - SPH_C32(0x20143079), SPH_C32(0x37d4ebba), SPH_C32(0x80064c93), - SPH_C32(0xbc81ae7c) }, - { SPH_C32(0x5814b800), SPH_C32(0x1dd50000), SPH_C32(0xbaf60000), - SPH_C32(0x723a0000), SPH_C32(0xd9e02ec4), SPH_C32(0x5a3284e7), - SPH_C32(0x9707e129), SPH_C32(0x0f8b57fc), SPH_C32(0x3d1ea000), - SPH_C32(0xdd0e0000), SPH_C32(0x936c0000), SPH_C32(0x33920000), - SPH_C32(0xc0bf73e3), SPH_C32(0xe68b0a3d), SPH_C32(0xb4492579), - SPH_C32(0x6c83ba01) }, - { SPH_C32(0x917fb830), SPH_C32(0xfaf00000), SPH_C32(0x95720000), - SPH_C32(0x54750000), SPH_C32(0xd189753d), SPH_C32(0x37ce75d0), - SPH_C32(0xc79888ad), SPH_C32(0x91e2f894), SPH_C32(0x1b7ea240), - SPH_C32(0x00d60000), SPH_C32(0xe1460000), SPH_C32(0x7c940000), - SPH_C32(0x53d9141c), SPH_C32(0xcf724ef3), SPH_C32(0x82c246ac), - SPH_C32(0x60a54863) }, - { SPH_C32(0x3b01cc00), SPH_C32(0x86680000), SPH_C32(0xeac00000), - SPH_C32(0xd9eb0000), SPH_C32(0xd7ee50bd), SPH_C32(0x8678d837), - SPH_C32(0xb9dacdab), SPH_C32(0x673aa2a4), SPH_C32(0xb5ff8400), - SPH_C32(0xd4340000), SPH_C32(0x601a0000), SPH_C32(0x2f600000), - SPH_C32(0x57e40dca), SPH_C32(0xb7d6e2b1), SPH_C32(0xb0e67183), - SPH_C32(0xf5c750ed) }, - { SPH_C32(0xf26acc30), SPH_C32(0x614d0000), SPH_C32(0xc5440000), - SPH_C32(0xffa40000), SPH_C32(0xdf870b44), SPH_C32(0xeb842900), - SPH_C32(0xe945a42f), SPH_C32(0xf9530dcc), SPH_C32(0x939f8640), - SPH_C32(0x09ec0000), SPH_C32(0x12300000), SPH_C32(0x60660000), - SPH_C32(0xc4826a35), SPH_C32(0x9e2fa67f), SPH_C32(0x866d1256), - SPH_C32(0xf9e1a28f) }, - { SPH_C32(0x2f5bf000), SPH_C32(0x3f810000), SPH_C32(0x8be70000), - SPH_C32(0x288a0000), SPH_C32(0x198f6dd1), SPH_C32(0x3631e54f), - SPH_C32(0xfe73aa8b), SPH_C32(0x86b48661), SPH_C32(0x96989000), - SPH_C32(0x1c8d0000), SPH_C32(0x94dd0000), SPH_C32(0xd4150000), - SPH_C32(0x242929af), SPH_C32(0x4f7047f8), SPH_C32(0xb2227bbc), - SPH_C32(0x29e3b6f2) }, - { SPH_C32(0xe630f030), SPH_C32(0xd8a40000), SPH_C32(0xa4630000), - SPH_C32(0x0ec50000), SPH_C32(0x11e63628), SPH_C32(0x5bcd1478), - SPH_C32(0xaeecc30f), SPH_C32(0x18dd2909), SPH_C32(0xb0f89240), - SPH_C32(0xc1550000), SPH_C32(0xe6f70000), SPH_C32(0x9b130000), - SPH_C32(0xb74f4e50), SPH_C32(0x66890336), SPH_C32(0x84a91869), - SPH_C32(0x25c54490) }, - { SPH_C32(0x1866d800), SPH_C32(0x4ed10000), SPH_C32(0x1e070000), - SPH_C32(0x229e0000), SPH_C32(0xa42374d8), SPH_C32(0x7ede7d7e), - SPH_C32(0xbb1ec794), SPH_C32(0xbb1e44bb), SPH_C32(0x82c2ac00), - SPH_C32(0xa5640000), SPH_C32(0xf5fa0000), SPH_C32(0x25740000), - SPH_C32(0xea4814c3), SPH_C32(0xff397a80), SPH_C32(0xf58b1c9c), - SPH_C32(0xc86d9237) }, - { SPH_C32(0xd10dd830), SPH_C32(0xa9f40000), SPH_C32(0x31830000), - SPH_C32(0x04d10000), SPH_C32(0xac4a2f21), SPH_C32(0x13228c49), - SPH_C32(0xeb81ae10), SPH_C32(0x2577ebd3), SPH_C32(0xa4a2ae40), - SPH_C32(0x78bc0000), SPH_C32(0x87d00000), SPH_C32(0x6a720000), - SPH_C32(0x792e733c), SPH_C32(0xd6c03e4e), SPH_C32(0xc3007f49), - SPH_C32(0xc44b6055) }, - { SPH_C32(0x0c3ce400), SPH_C32(0xf7380000), SPH_C32(0x7f200000), - SPH_C32(0xd3ff0000), SPH_C32(0x6a4249b4), SPH_C32(0xce974006), - SPH_C32(0xfcb7a0b4), SPH_C32(0x5a90607e), SPH_C32(0xa1a5b800), - SPH_C32(0x6ddd0000), SPH_C32(0x013d0000), SPH_C32(0xde010000), - SPH_C32(0x998530a6), SPH_C32(0x079fdfc9), SPH_C32(0xf74f16a3), - SPH_C32(0x14497428) }, - { SPH_C32(0xc557e430), SPH_C32(0x101d0000), SPH_C32(0x50a40000), - SPH_C32(0xf5b00000), SPH_C32(0x622b124d), SPH_C32(0xa36bb131), - SPH_C32(0xac28c930), SPH_C32(0xc4f9cf16), SPH_C32(0x87c5ba40), - SPH_C32(0xb0050000), SPH_C32(0x73170000), SPH_C32(0x91070000), - SPH_C32(0x0ae35759), SPH_C32(0x2e669b07), SPH_C32(0xc1c47576), - SPH_C32(0x186f864a) }, - { SPH_C32(0xf3928800), SPH_C32(0xdc560000), SPH_C32(0xbd470000), - SPH_C32(0x95bd0000), SPH_C32(0x3d767488), SPH_C32(0xf3c9c922), - SPH_C32(0x916cbfec), SPH_C32(0x4aeb5b0f), SPH_C32(0xe1d7d800), - SPH_C32(0x3ed90000), SPH_C32(0xa5cc0000), SPH_C32(0x8ea50000), - SPH_C32(0xe4466aba), SPH_C32(0x23732650), SPH_C32(0xdb56301e), - SPH_C32(0xa0dc676f) }, - { SPH_C32(0x3af98830), SPH_C32(0x3b730000), SPH_C32(0x92c30000), - SPH_C32(0xb3f20000), SPH_C32(0x351f2f71), SPH_C32(0x9e353815), - SPH_C32(0xc1f3d668), SPH_C32(0xd482f467), SPH_C32(0xc7b7da40), - SPH_C32(0xe3010000), SPH_C32(0xd7e60000), SPH_C32(0xc1a30000), - SPH_C32(0x77200d45), SPH_C32(0x0a8a629e), SPH_C32(0xeddd53cb), - SPH_C32(0xacfa950d) }, - { SPH_C32(0xe7c8b400), SPH_C32(0x65bf0000), SPH_C32(0xdc600000), - SPH_C32(0x64dc0000), SPH_C32(0xf31749e4), SPH_C32(0x4380f45a), - SPH_C32(0xd6c5d8cc), SPH_C32(0xab657fca), SPH_C32(0xc2b0cc00), - SPH_C32(0xf6600000), SPH_C32(0x510b0000), SPH_C32(0x75d00000), - SPH_C32(0x978b4edf), SPH_C32(0xdbd58319), SPH_C32(0xd9923a21), - SPH_C32(0x7cf88170) }, - { SPH_C32(0x2ea3b430), SPH_C32(0x829a0000), SPH_C32(0xf3e40000), - SPH_C32(0x42930000), SPH_C32(0xfb7e121d), SPH_C32(0x2e7c056d), - SPH_C32(0x865ab148), SPH_C32(0x350cd0a2), SPH_C32(0xe4d0ce40), - SPH_C32(0x2bb80000), SPH_C32(0x23210000), SPH_C32(0x3ad60000), - SPH_C32(0x04ed2920), SPH_C32(0xf22cc7d7), SPH_C32(0xef1959f4), - SPH_C32(0x70de7312) }, - { SPH_C32(0xd0f59c00), SPH_C32(0x14ef0000), SPH_C32(0x49800000), - SPH_C32(0x6ec80000), SPH_C32(0x4ebb50ed), SPH_C32(0x0b6f6c6b), - SPH_C32(0x93a8b5d3), SPH_C32(0x96cfbd10), SPH_C32(0xd6eaf000), - SPH_C32(0x4f890000), SPH_C32(0x302c0000), SPH_C32(0x84b10000), - SPH_C32(0x59ea73b3), SPH_C32(0x6b9cbe61), SPH_C32(0x9e3b5d01), - SPH_C32(0x9d76a5b5) }, - { SPH_C32(0x199e9c30), SPH_C32(0xf3ca0000), SPH_C32(0x66040000), - SPH_C32(0x48870000), SPH_C32(0x46d20b14), SPH_C32(0x66939d5c), - SPH_C32(0xc337dc57), SPH_C32(0x08a61278), SPH_C32(0xf08af240), - SPH_C32(0x92510000), SPH_C32(0x42060000), SPH_C32(0xcbb70000), - SPH_C32(0xca8c144c), SPH_C32(0x4265faaf), SPH_C32(0xa8b03ed4), - SPH_C32(0x915057d7) }, - { SPH_C32(0xc4afa000), SPH_C32(0xad060000), SPH_C32(0x28a70000), - SPH_C32(0x9fa90000), SPH_C32(0x80da6d81), SPH_C32(0xbb265113), - SPH_C32(0xd401d2f3), SPH_C32(0x774199d5), SPH_C32(0xf58de400), - SPH_C32(0x87300000), SPH_C32(0xc4eb0000), SPH_C32(0x7fc40000), - SPH_C32(0x2a2757d6), SPH_C32(0x933a1b28), SPH_C32(0x9cff573e), - SPH_C32(0x415243aa) }, - { SPH_C32(0x0dc4a030), SPH_C32(0x4a230000), SPH_C32(0x07230000), - SPH_C32(0xb9e60000), SPH_C32(0x88b33678), SPH_C32(0xd6daa024), - SPH_C32(0x849ebb77), SPH_C32(0xe92836bd), SPH_C32(0xd3ede640), - SPH_C32(0x5ae80000), SPH_C32(0xb6c10000), SPH_C32(0x30c20000), - SPH_C32(0xb9413029), SPH_C32(0xbac35fe6), SPH_C32(0xaa7434eb), - SPH_C32(0x4d74b1c8) }, - { SPH_C32(0xa7bad400), SPH_C32(0x36bb0000), SPH_C32(0x78910000), - SPH_C32(0x34780000), SPH_C32(0x8ed413f8), SPH_C32(0x676c0dc3), - SPH_C32(0xfadcfe71), SPH_C32(0x1ff06c8d), SPH_C32(0x7d6cc000), - SPH_C32(0x8e0a0000), SPH_C32(0x379d0000), SPH_C32(0x63360000), - SPH_C32(0xbd7c29ff), SPH_C32(0xc267f3a4), SPH_C32(0x985003c4), - SPH_C32(0xd816a946) }, - { SPH_C32(0x6ed1d430), SPH_C32(0xd19e0000), SPH_C32(0x57150000), - SPH_C32(0x12370000), SPH_C32(0x86bd4801), SPH_C32(0x0a90fcf4), - SPH_C32(0xaa4397f5), SPH_C32(0x8199c3e5), SPH_C32(0x5b0cc240), - SPH_C32(0x53d20000), SPH_C32(0x45b70000), SPH_C32(0x2c300000), - SPH_C32(0x2e1a4e00), SPH_C32(0xeb9eb76a), SPH_C32(0xaedb6011), - SPH_C32(0xd4305b24) }, - { SPH_C32(0xb3e0e800), SPH_C32(0x8f520000), SPH_C32(0x19b60000), - SPH_C32(0xc5190000), SPH_C32(0x40b52e94), SPH_C32(0xd72530bb), - SPH_C32(0xbd759951), SPH_C32(0xfe7e4848), SPH_C32(0x5e0bd400), - SPH_C32(0x46b30000), SPH_C32(0xc35a0000), SPH_C32(0x98430000), - SPH_C32(0xceb10d9a), SPH_C32(0x3ac156ed), SPH_C32(0x9a9409fb), - SPH_C32(0x04324f59) }, - { SPH_C32(0x7a8be830), SPH_C32(0x68770000), SPH_C32(0x36320000), - SPH_C32(0xe3560000), SPH_C32(0x48dc756d), SPH_C32(0xbad9c18c), - SPH_C32(0xedeaf0d5), SPH_C32(0x6017e720), SPH_C32(0x786bd640), - SPH_C32(0x9b6b0000), SPH_C32(0xb1700000), SPH_C32(0xd7450000), - SPH_C32(0x5dd76a65), SPH_C32(0x13381223), SPH_C32(0xac1f6a2e), - SPH_C32(0x0814bd3b) }, - { SPH_C32(0x84ddc000), SPH_C32(0xfe020000), SPH_C32(0x8c560000), - SPH_C32(0xcf0d0000), SPH_C32(0xfd19379d), SPH_C32(0x9fcaa88a), - SPH_C32(0xf818f44e), SPH_C32(0xc3d48a92), SPH_C32(0x4a51e800), - SPH_C32(0xff5a0000), SPH_C32(0xa27d0000), SPH_C32(0x69220000), - SPH_C32(0x00d030f6), SPH_C32(0x8a886b95), SPH_C32(0xdd3d6edb), - SPH_C32(0xe5bc6b9c) }, - { SPH_C32(0x4db6c030), SPH_C32(0x19270000), SPH_C32(0xa3d20000), - SPH_C32(0xe9420000), SPH_C32(0xf5706c64), SPH_C32(0xf23659bd), - SPH_C32(0xa8879dca), SPH_C32(0x5dbd25fa), SPH_C32(0x6c31ea40), - SPH_C32(0x22820000), SPH_C32(0xd0570000), SPH_C32(0x26240000), - SPH_C32(0x93b65709), SPH_C32(0xa3712f5b), SPH_C32(0xebb60d0e), - SPH_C32(0xe99a99fe) }, - { SPH_C32(0x9087fc00), SPH_C32(0x47eb0000), SPH_C32(0xed710000), - SPH_C32(0x3e6c0000), SPH_C32(0x33780af1), SPH_C32(0x2f8395f2), - SPH_C32(0xbfb1936e), SPH_C32(0x225aae57), SPH_C32(0x6936fc00), - SPH_C32(0x37e30000), SPH_C32(0x56ba0000), SPH_C32(0x92570000), - SPH_C32(0x731d1493), SPH_C32(0x722ecedc), SPH_C32(0xdff964e4), - SPH_C32(0x39988d83) }, - { SPH_C32(0x59ecfc30), SPH_C32(0xa0ce0000), SPH_C32(0xc2f50000), - SPH_C32(0x18230000), SPH_C32(0x3b115108), SPH_C32(0x427f64c5), - SPH_C32(0xef2efaea), SPH_C32(0xbc33013f), SPH_C32(0x4f56fe40), - SPH_C32(0xea3b0000), SPH_C32(0x24900000), SPH_C32(0xdd510000), - SPH_C32(0xe07b736c), SPH_C32(0x5bd78a12), SPH_C32(0xe9720731), - SPH_C32(0x35be7fe1) } -}; - -static const sph_u32 T512_7[128][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xf7750009), SPH_C32(0xcf3cc000), SPH_C32(0xc3d60000), - SPH_C32(0x04920000), SPH_C32(0x029519a9), SPH_C32(0xf8e836ba), - SPH_C32(0x7a87f14e), SPH_C32(0x9e16981a), SPH_C32(0xd46a0000), - SPH_C32(0x8dc8c000), SPH_C32(0xa5af0000), SPH_C32(0x4a290000), - SPH_C32(0xfc4e427a), SPH_C32(0xc9b4866c), SPH_C32(0x98369604), - SPH_C32(0xf746c320) }, - { SPH_C32(0xd46a0000), SPH_C32(0x8dc8c000), SPH_C32(0xa5af0000), - SPH_C32(0x4a290000), SPH_C32(0xfc4e427a), SPH_C32(0xc9b4866c), - SPH_C32(0x98369604), SPH_C32(0xf746c320), SPH_C32(0x231f0009), - SPH_C32(0x42f40000), SPH_C32(0x66790000), SPH_C32(0x4ebb0000), - SPH_C32(0xfedb5bd3), SPH_C32(0x315cb0d6), SPH_C32(0xe2b1674a), - SPH_C32(0x69505b3a) }, - { SPH_C32(0x231f0009), SPH_C32(0x42f40000), SPH_C32(0x66790000), - SPH_C32(0x4ebb0000), SPH_C32(0xfedb5bd3), SPH_C32(0x315cb0d6), - SPH_C32(0xe2b1674a), SPH_C32(0x69505b3a), SPH_C32(0xf7750009), - SPH_C32(0xcf3cc000), SPH_C32(0xc3d60000), SPH_C32(0x04920000), - SPH_C32(0x029519a9), SPH_C32(0xf8e836ba), SPH_C32(0x7a87f14e), - SPH_C32(0x9e16981a) }, - { SPH_C32(0x774400f0), SPH_C32(0xf15a0000), SPH_C32(0xf5b20000), - SPH_C32(0x34140000), SPH_C32(0x89377e8c), SPH_C32(0x5a8bec25), - SPH_C32(0x0bc3cd1e), SPH_C32(0xcf3775cb), SPH_C32(0xf46c0050), - SPH_C32(0x96180000), SPH_C32(0x14a50000), SPH_C32(0x031f0000), - SPH_C32(0x42947eb8), SPH_C32(0x66bf7e19), SPH_C32(0x9ca470d2), - SPH_C32(0x8a341574) }, - { SPH_C32(0x803100f9), SPH_C32(0x3e66c000), SPH_C32(0x36640000), - SPH_C32(0x30860000), SPH_C32(0x8ba26725), SPH_C32(0xa263da9f), - SPH_C32(0x71443c50), SPH_C32(0x5121edd1), SPH_C32(0x20060050), - SPH_C32(0x1bd0c000), SPH_C32(0xb10a0000), SPH_C32(0x49360000), - SPH_C32(0xbeda3cc2), SPH_C32(0xaf0bf875), SPH_C32(0x0492e6d6), - SPH_C32(0x7d72d654) }, - { SPH_C32(0xa32e00f0), SPH_C32(0x7c92c000), SPH_C32(0x501d0000), - SPH_C32(0x7e3d0000), SPH_C32(0x75793cf6), SPH_C32(0x933f6a49), - SPH_C32(0x93f55b1a), SPH_C32(0x3871b6eb), SPH_C32(0xd7730059), - SPH_C32(0xd4ec0000), SPH_C32(0x72dc0000), SPH_C32(0x4da40000), - SPH_C32(0xbc4f256b), SPH_C32(0x57e3cecf), SPH_C32(0x7e151798), - SPH_C32(0xe3644e4e) }, - { SPH_C32(0x545b00f9), SPH_C32(0xb3ae0000), SPH_C32(0x93cb0000), - SPH_C32(0x7aaf0000), SPH_C32(0x77ec255f), SPH_C32(0x6bd75cf3), - SPH_C32(0xe972aa54), SPH_C32(0xa6672ef1), SPH_C32(0x03190059), - SPH_C32(0x5924c000), SPH_C32(0xd7730000), SPH_C32(0x078d0000), - SPH_C32(0x40016711), SPH_C32(0x9e5748a3), SPH_C32(0xe623819c), - SPH_C32(0x14228d6e) }, - { SPH_C32(0xf46c0050), SPH_C32(0x96180000), SPH_C32(0x14a50000), - SPH_C32(0x031f0000), SPH_C32(0x42947eb8), SPH_C32(0x66bf7e19), - SPH_C32(0x9ca470d2), SPH_C32(0x8a341574), SPH_C32(0x832800a0), - SPH_C32(0x67420000), SPH_C32(0xe1170000), SPH_C32(0x370b0000), - SPH_C32(0xcba30034), SPH_C32(0x3c34923c), SPH_C32(0x9767bdcc), - SPH_C32(0x450360bf) }, - { SPH_C32(0x03190059), SPH_C32(0x5924c000), SPH_C32(0xd7730000), - SPH_C32(0x078d0000), SPH_C32(0x40016711), SPH_C32(0x9e5748a3), - SPH_C32(0xe623819c), SPH_C32(0x14228d6e), SPH_C32(0x574200a0), - SPH_C32(0xea8ac000), SPH_C32(0x44b80000), SPH_C32(0x7d220000), - SPH_C32(0x37ed424e), SPH_C32(0xf5801450), SPH_C32(0x0f512bc8), - SPH_C32(0xb245a39f) }, - { SPH_C32(0x20060050), SPH_C32(0x1bd0c000), SPH_C32(0xb10a0000), - SPH_C32(0x49360000), SPH_C32(0xbeda3cc2), SPH_C32(0xaf0bf875), - SPH_C32(0x0492e6d6), SPH_C32(0x7d72d654), SPH_C32(0xa03700a9), - SPH_C32(0x25b60000), SPH_C32(0x876e0000), SPH_C32(0x79b00000), - SPH_C32(0x35785be7), SPH_C32(0x0d6822ea), SPH_C32(0x75d6da86), - SPH_C32(0x2c533b85) }, - { SPH_C32(0xd7730059), SPH_C32(0xd4ec0000), SPH_C32(0x72dc0000), - SPH_C32(0x4da40000), SPH_C32(0xbc4f256b), SPH_C32(0x57e3cecf), - SPH_C32(0x7e151798), SPH_C32(0xe3644e4e), SPH_C32(0x745d00a9), - SPH_C32(0xa87ec000), SPH_C32(0x22c10000), SPH_C32(0x33990000), - SPH_C32(0xc936199d), SPH_C32(0xc4dca486), SPH_C32(0xede04c82), - SPH_C32(0xdb15f8a5) }, - { SPH_C32(0x832800a0), SPH_C32(0x67420000), SPH_C32(0xe1170000), - SPH_C32(0x370b0000), SPH_C32(0xcba30034), SPH_C32(0x3c34923c), - SPH_C32(0x9767bdcc), SPH_C32(0x450360bf), SPH_C32(0x774400f0), - SPH_C32(0xf15a0000), SPH_C32(0xf5b20000), SPH_C32(0x34140000), - SPH_C32(0x89377e8c), SPH_C32(0x5a8bec25), SPH_C32(0x0bc3cd1e), - SPH_C32(0xcf3775cb) }, - { SPH_C32(0x745d00a9), SPH_C32(0xa87ec000), SPH_C32(0x22c10000), - SPH_C32(0x33990000), SPH_C32(0xc936199d), SPH_C32(0xc4dca486), - SPH_C32(0xede04c82), SPH_C32(0xdb15f8a5), SPH_C32(0xa32e00f0), - SPH_C32(0x7c92c000), SPH_C32(0x501d0000), SPH_C32(0x7e3d0000), - SPH_C32(0x75793cf6), SPH_C32(0x933f6a49), SPH_C32(0x93f55b1a), - SPH_C32(0x3871b6eb) }, - { SPH_C32(0x574200a0), SPH_C32(0xea8ac000), SPH_C32(0x44b80000), - SPH_C32(0x7d220000), SPH_C32(0x37ed424e), SPH_C32(0xf5801450), - SPH_C32(0x0f512bc8), SPH_C32(0xb245a39f), SPH_C32(0x545b00f9), - SPH_C32(0xb3ae0000), SPH_C32(0x93cb0000), SPH_C32(0x7aaf0000), - SPH_C32(0x77ec255f), SPH_C32(0x6bd75cf3), SPH_C32(0xe972aa54), - SPH_C32(0xa6672ef1) }, - { SPH_C32(0xa03700a9), SPH_C32(0x25b60000), SPH_C32(0x876e0000), - SPH_C32(0x79b00000), SPH_C32(0x35785be7), SPH_C32(0x0d6822ea), - SPH_C32(0x75d6da86), SPH_C32(0x2c533b85), SPH_C32(0x803100f9), - SPH_C32(0x3e66c000), SPH_C32(0x36640000), SPH_C32(0x30860000), - SPH_C32(0x8ba26725), SPH_C32(0xa263da9f), SPH_C32(0x71443c50), - SPH_C32(0x5121edd1) }, - { SPH_C32(0xe8870170), SPH_C32(0x9d720000), SPH_C32(0x12db0000), - SPH_C32(0xd4220000), SPH_C32(0xf2886b27), SPH_C32(0xa921e543), - SPH_C32(0x4ef8b518), SPH_C32(0x618813b1), SPH_C32(0xb4370060), - SPH_C32(0x0c4c0000), SPH_C32(0x56c20000), SPH_C32(0x5cae0000), - SPH_C32(0x94541f3f), SPH_C32(0x3b3ef825), SPH_C32(0x1b365f3d), - SPH_C32(0xf3d45758) }, - { SPH_C32(0x1ff20179), SPH_C32(0x524ec000), SPH_C32(0xd10d0000), - SPH_C32(0xd0b00000), SPH_C32(0xf01d728e), SPH_C32(0x51c9d3f9), - SPH_C32(0x347f4456), SPH_C32(0xff9e8bab), SPH_C32(0x605d0060), - SPH_C32(0x8184c000), SPH_C32(0xf36d0000), SPH_C32(0x16870000), - SPH_C32(0x681a5d45), SPH_C32(0xf28a7e49), SPH_C32(0x8300c939), - SPH_C32(0x04929478) }, - { SPH_C32(0x3ced0170), SPH_C32(0x10bac000), SPH_C32(0xb7740000), - SPH_C32(0x9e0b0000), SPH_C32(0x0ec6295d), SPH_C32(0x6095632f), - SPH_C32(0xd6ce231c), SPH_C32(0x96ced091), SPH_C32(0x97280069), - SPH_C32(0x4eb80000), SPH_C32(0x30bb0000), SPH_C32(0x12150000), - SPH_C32(0x6a8f44ec), SPH_C32(0x0a6248f3), SPH_C32(0xf9873877), - SPH_C32(0x9a840c62) }, - { SPH_C32(0xcb980179), SPH_C32(0xdf860000), SPH_C32(0x74a20000), - SPH_C32(0x9a990000), SPH_C32(0x0c5330f4), SPH_C32(0x987d5595), - SPH_C32(0xac49d252), SPH_C32(0x08d8488b), SPH_C32(0x43420069), - SPH_C32(0xc370c000), SPH_C32(0x95140000), SPH_C32(0x583c0000), - SPH_C32(0x96c10696), SPH_C32(0xc3d6ce9f), SPH_C32(0x61b1ae73), - SPH_C32(0x6dc2cf42) }, - { SPH_C32(0x9fc30180), SPH_C32(0x6c280000), SPH_C32(0xe7690000), - SPH_C32(0xe0360000), SPH_C32(0x7bbf15ab), SPH_C32(0xf3aa0966), - SPH_C32(0x453b7806), SPH_C32(0xaebf667a), SPH_C32(0x405b0030), - SPH_C32(0x9a540000), SPH_C32(0x42670000), SPH_C32(0x5fb10000), - SPH_C32(0xd6c06187), SPH_C32(0x5d81863c), SPH_C32(0x87922fef), - SPH_C32(0x79e0422c) }, - { SPH_C32(0x68b60189), SPH_C32(0xa314c000), SPH_C32(0x24bf0000), - SPH_C32(0xe4a40000), SPH_C32(0x792a0c02), SPH_C32(0x0b423fdc), - SPH_C32(0x3fbc8948), SPH_C32(0x30a9fe60), SPH_C32(0x94310030), - SPH_C32(0x179cc000), SPH_C32(0xe7c80000), SPH_C32(0x15980000), - SPH_C32(0x2a8e23fd), SPH_C32(0x94350050), SPH_C32(0x1fa4b9eb), - SPH_C32(0x8ea6810c) }, - { SPH_C32(0x4ba90180), SPH_C32(0xe1e0c000), SPH_C32(0x42c60000), - SPH_C32(0xaa1f0000), SPH_C32(0x87f157d1), SPH_C32(0x3a1e8f0a), - SPH_C32(0xdd0dee02), SPH_C32(0x59f9a55a), SPH_C32(0x63440039), - SPH_C32(0xd8a00000), SPH_C32(0x241e0000), SPH_C32(0x110a0000), - SPH_C32(0x281b3a54), SPH_C32(0x6cdd36ea), SPH_C32(0x652348a5), - SPH_C32(0x10b01916) }, - { SPH_C32(0xbcdc0189), SPH_C32(0x2edc0000), SPH_C32(0x81100000), - SPH_C32(0xae8d0000), SPH_C32(0x85644e78), SPH_C32(0xc2f6b9b0), - SPH_C32(0xa78a1f4c), SPH_C32(0xc7ef3d40), SPH_C32(0xb72e0039), - SPH_C32(0x5568c000), SPH_C32(0x81b10000), SPH_C32(0x5b230000), - SPH_C32(0xd455782e), SPH_C32(0xa569b086), SPH_C32(0xfd15dea1), - SPH_C32(0xe7f6da36) }, - { SPH_C32(0x1ceb0120), SPH_C32(0x0b6a0000), SPH_C32(0x067e0000), - SPH_C32(0xd73d0000), SPH_C32(0xb01c159f), SPH_C32(0xcf9e9b5a), - SPH_C32(0xd25cc5ca), SPH_C32(0xebbc06c5), SPH_C32(0x371f00c0), - SPH_C32(0x6b0e0000), SPH_C32(0xb7d50000), SPH_C32(0x6ba50000), - SPH_C32(0x5ff71f0b), SPH_C32(0x070a6a19), SPH_C32(0x8c51e2f1), - SPH_C32(0xb6d737e7) }, - { SPH_C32(0xeb9e0129), SPH_C32(0xc456c000), SPH_C32(0xc5a80000), - SPH_C32(0xd3af0000), SPH_C32(0xb2890c36), SPH_C32(0x3776ade0), - SPH_C32(0xa8db3484), SPH_C32(0x75aa9edf), SPH_C32(0xe37500c0), - SPH_C32(0xe6c6c000), SPH_C32(0x127a0000), SPH_C32(0x218c0000), - SPH_C32(0xa3b95d71), SPH_C32(0xcebeec75), SPH_C32(0x146774f5), - SPH_C32(0x4191f4c7) }, - { SPH_C32(0xc8810120), SPH_C32(0x86a2c000), SPH_C32(0xa3d10000), - SPH_C32(0x9d140000), SPH_C32(0x4c5257e5), SPH_C32(0x062a1d36), - SPH_C32(0x4a6a53ce), SPH_C32(0x1cfac5e5), SPH_C32(0x140000c9), - SPH_C32(0x29fa0000), SPH_C32(0xd1ac0000), SPH_C32(0x251e0000), - SPH_C32(0xa12c44d8), SPH_C32(0x3656dacf), SPH_C32(0x6ee085bb), - SPH_C32(0xdf876cdd) }, - { SPH_C32(0x3ff40129), SPH_C32(0x499e0000), SPH_C32(0x60070000), - SPH_C32(0x99860000), SPH_C32(0x4ec74e4c), SPH_C32(0xfec22b8c), - SPH_C32(0x30eda280), SPH_C32(0x82ec5dff), SPH_C32(0xc06a00c9), - SPH_C32(0xa432c000), SPH_C32(0x74030000), SPH_C32(0x6f370000), - SPH_C32(0x5d6206a2), SPH_C32(0xffe25ca3), SPH_C32(0xf6d613bf), - SPH_C32(0x28c1affd) }, - { SPH_C32(0x6baf01d0), SPH_C32(0xfa300000), SPH_C32(0xf3cc0000), - SPH_C32(0xe3290000), SPH_C32(0x392b6b13), SPH_C32(0x9515777f), - SPH_C32(0xd99f08d4), SPH_C32(0x248b730e), SPH_C32(0xc3730090), - SPH_C32(0xfd160000), SPH_C32(0xa3700000), SPH_C32(0x68ba0000), - SPH_C32(0x1d6361b3), SPH_C32(0x61b51400), SPH_C32(0x10f59223), - SPH_C32(0x3ce32293) }, - { SPH_C32(0x9cda01d9), SPH_C32(0x350cc000), SPH_C32(0x301a0000), - SPH_C32(0xe7bb0000), SPH_C32(0x3bbe72ba), SPH_C32(0x6dfd41c5), - SPH_C32(0xa318f99a), SPH_C32(0xba9deb14), SPH_C32(0x17190090), - SPH_C32(0x70dec000), SPH_C32(0x06df0000), SPH_C32(0x22930000), - SPH_C32(0xe12d23c9), SPH_C32(0xa801926c), SPH_C32(0x88c30427), - SPH_C32(0xcba5e1b3) }, - { SPH_C32(0xbfc501d0), SPH_C32(0x77f8c000), SPH_C32(0x56630000), - SPH_C32(0xa9000000), SPH_C32(0xc5652969), SPH_C32(0x5ca1f113), - SPH_C32(0x41a99ed0), SPH_C32(0xd3cdb02e), SPH_C32(0xe06c0099), - SPH_C32(0xbfe20000), SPH_C32(0xc5090000), SPH_C32(0x26010000), - SPH_C32(0xe3b83a60), SPH_C32(0x50e9a4d6), SPH_C32(0xf244f569), - SPH_C32(0x55b379a9) }, - { SPH_C32(0x48b001d9), SPH_C32(0xb8c40000), SPH_C32(0x95b50000), - SPH_C32(0xad920000), SPH_C32(0xc7f030c0), SPH_C32(0xa449c7a9), - SPH_C32(0x3b2e6f9e), SPH_C32(0x4ddb2834), SPH_C32(0x34060099), - SPH_C32(0x322ac000), SPH_C32(0x60a60000), SPH_C32(0x6c280000), - SPH_C32(0x1ff6781a), SPH_C32(0x995d22ba), SPH_C32(0x6a72636d), - SPH_C32(0xa2f5ba89) }, - { SPH_C32(0xb4370060), SPH_C32(0x0c4c0000), SPH_C32(0x56c20000), - SPH_C32(0x5cae0000), SPH_C32(0x94541f3f), SPH_C32(0x3b3ef825), - SPH_C32(0x1b365f3d), SPH_C32(0xf3d45758), SPH_C32(0x5cb00110), - SPH_C32(0x913e0000), SPH_C32(0x44190000), SPH_C32(0x888c0000), - SPH_C32(0x66dc7418), SPH_C32(0x921f1d66), SPH_C32(0x55ceea25), - SPH_C32(0x925c44e9) }, - { SPH_C32(0x43420069), SPH_C32(0xc370c000), SPH_C32(0x95140000), - SPH_C32(0x583c0000), SPH_C32(0x96c10696), SPH_C32(0xc3d6ce9f), - SPH_C32(0x61b1ae73), SPH_C32(0x6dc2cf42), SPH_C32(0x88da0110), - SPH_C32(0x1cf6c000), SPH_C32(0xe1b60000), SPH_C32(0xc2a50000), - SPH_C32(0x9a923662), SPH_C32(0x5bab9b0a), SPH_C32(0xcdf87c21), - SPH_C32(0x651a87c9) }, - { SPH_C32(0x605d0060), SPH_C32(0x8184c000), SPH_C32(0xf36d0000), - SPH_C32(0x16870000), SPH_C32(0x681a5d45), SPH_C32(0xf28a7e49), - SPH_C32(0x8300c939), SPH_C32(0x04929478), SPH_C32(0x7faf0119), - SPH_C32(0xd3ca0000), SPH_C32(0x22600000), SPH_C32(0xc6370000), - SPH_C32(0x98072fcb), SPH_C32(0xa343adb0), SPH_C32(0xb77f8d6f), - SPH_C32(0xfb0c1fd3) }, - { SPH_C32(0x97280069), SPH_C32(0x4eb80000), SPH_C32(0x30bb0000), - SPH_C32(0x12150000), SPH_C32(0x6a8f44ec), SPH_C32(0x0a6248f3), - SPH_C32(0xf9873877), SPH_C32(0x9a840c62), SPH_C32(0xabc50119), - SPH_C32(0x5e02c000), SPH_C32(0x87cf0000), SPH_C32(0x8c1e0000), - SPH_C32(0x64496db1), SPH_C32(0x6af72bdc), SPH_C32(0x2f491b6b), - SPH_C32(0x0c4adcf3) }, - { SPH_C32(0xc3730090), SPH_C32(0xfd160000), SPH_C32(0xa3700000), - SPH_C32(0x68ba0000), SPH_C32(0x1d6361b3), SPH_C32(0x61b51400), - SPH_C32(0x10f59223), SPH_C32(0x3ce32293), SPH_C32(0xa8dc0140), - SPH_C32(0x07260000), SPH_C32(0x50bc0000), SPH_C32(0x8b930000), - SPH_C32(0x24480aa0), SPH_C32(0xf4a0637f), SPH_C32(0xc96a9af7), - SPH_C32(0x1868519d) }, - { SPH_C32(0x34060099), SPH_C32(0x322ac000), SPH_C32(0x60a60000), - SPH_C32(0x6c280000), SPH_C32(0x1ff6781a), SPH_C32(0x995d22ba), - SPH_C32(0x6a72636d), SPH_C32(0xa2f5ba89), SPH_C32(0x7cb60140), - SPH_C32(0x8aeec000), SPH_C32(0xf5130000), SPH_C32(0xc1ba0000), - SPH_C32(0xd80648da), SPH_C32(0x3d14e513), SPH_C32(0x515c0cf3), - SPH_C32(0xef2e92bd) }, - { SPH_C32(0x17190090), SPH_C32(0x70dec000), SPH_C32(0x06df0000), - SPH_C32(0x22930000), SPH_C32(0xe12d23c9), SPH_C32(0xa801926c), - SPH_C32(0x88c30427), SPH_C32(0xcba5e1b3), SPH_C32(0x8bc30149), - SPH_C32(0x45d20000), SPH_C32(0x36c50000), SPH_C32(0xc5280000), - SPH_C32(0xda935173), SPH_C32(0xc5fcd3a9), SPH_C32(0x2bdbfdbd), - SPH_C32(0x71380aa7) }, - { SPH_C32(0xe06c0099), SPH_C32(0xbfe20000), SPH_C32(0xc5090000), - SPH_C32(0x26010000), SPH_C32(0xe3b83a60), SPH_C32(0x50e9a4d6), - SPH_C32(0xf244f569), SPH_C32(0x55b379a9), SPH_C32(0x5fa90149), - SPH_C32(0xc81ac000), SPH_C32(0x936a0000), SPH_C32(0x8f010000), - SPH_C32(0x26dd1309), SPH_C32(0x0c4855c5), SPH_C32(0xb3ed6bb9), - SPH_C32(0x867ec987) }, - { SPH_C32(0x405b0030), SPH_C32(0x9a540000), SPH_C32(0x42670000), - SPH_C32(0x5fb10000), SPH_C32(0xd6c06187), SPH_C32(0x5d81863c), - SPH_C32(0x87922fef), SPH_C32(0x79e0422c), SPH_C32(0xdf9801b0), - SPH_C32(0xf67c0000), SPH_C32(0xa50e0000), SPH_C32(0xbf870000), - SPH_C32(0xad7f742c), SPH_C32(0xae2b8f5a), SPH_C32(0xc2a957e9), - SPH_C32(0xd75f2456) }, - { SPH_C32(0xb72e0039), SPH_C32(0x5568c000), SPH_C32(0x81b10000), - SPH_C32(0x5b230000), SPH_C32(0xd455782e), SPH_C32(0xa569b086), - SPH_C32(0xfd15dea1), SPH_C32(0xe7f6da36), SPH_C32(0x0bf201b0), - SPH_C32(0x7bb4c000), SPH_C32(0x00a10000), SPH_C32(0xf5ae0000), - SPH_C32(0x51313656), SPH_C32(0x679f0936), SPH_C32(0x5a9fc1ed), - SPH_C32(0x2019e776) }, - { SPH_C32(0x94310030), SPH_C32(0x179cc000), SPH_C32(0xe7c80000), - SPH_C32(0x15980000), SPH_C32(0x2a8e23fd), SPH_C32(0x94350050), - SPH_C32(0x1fa4b9eb), SPH_C32(0x8ea6810c), SPH_C32(0xfc8701b9), - SPH_C32(0xb4880000), SPH_C32(0xc3770000), SPH_C32(0xf13c0000), - SPH_C32(0x53a42fff), SPH_C32(0x9f773f8c), SPH_C32(0x201830a3), - SPH_C32(0xbe0f7f6c) }, - { SPH_C32(0x63440039), SPH_C32(0xd8a00000), SPH_C32(0x241e0000), - SPH_C32(0x110a0000), SPH_C32(0x281b3a54), SPH_C32(0x6cdd36ea), - SPH_C32(0x652348a5), SPH_C32(0x10b01916), SPH_C32(0x28ed01b9), - SPH_C32(0x3940c000), SPH_C32(0x66d80000), SPH_C32(0xbb150000), - SPH_C32(0xafea6d85), SPH_C32(0x56c3b9e0), SPH_C32(0xb82ea6a7), - SPH_C32(0x4949bc4c) }, - { SPH_C32(0x371f00c0), SPH_C32(0x6b0e0000), SPH_C32(0xb7d50000), - SPH_C32(0x6ba50000), SPH_C32(0x5ff71f0b), SPH_C32(0x070a6a19), - SPH_C32(0x8c51e2f1), SPH_C32(0xb6d737e7), SPH_C32(0x2bf401e0), - SPH_C32(0x60640000), SPH_C32(0xb1ab0000), SPH_C32(0xbc980000), - SPH_C32(0xefeb0a94), SPH_C32(0xc894f143), SPH_C32(0x5e0d273b), - SPH_C32(0x5d6b3122) }, - { SPH_C32(0xc06a00c9), SPH_C32(0xa432c000), SPH_C32(0x74030000), - SPH_C32(0x6f370000), SPH_C32(0x5d6206a2), SPH_C32(0xffe25ca3), - SPH_C32(0xf6d613bf), SPH_C32(0x28c1affd), SPH_C32(0xff9e01e0), - SPH_C32(0xedacc000), SPH_C32(0x14040000), SPH_C32(0xf6b10000), - SPH_C32(0x13a548ee), SPH_C32(0x0120772f), SPH_C32(0xc63bb13f), - SPH_C32(0xaa2df202) }, - { SPH_C32(0xe37500c0), SPH_C32(0xe6c6c000), SPH_C32(0x127a0000), - SPH_C32(0x218c0000), SPH_C32(0xa3b95d71), SPH_C32(0xcebeec75), - SPH_C32(0x146774f5), SPH_C32(0x4191f4c7), SPH_C32(0x08eb01e9), - SPH_C32(0x22900000), SPH_C32(0xd7d20000), SPH_C32(0xf2230000), - SPH_C32(0x11305147), SPH_C32(0xf9c84195), SPH_C32(0xbcbc4071), - SPH_C32(0x343b6a18) }, - { SPH_C32(0x140000c9), SPH_C32(0x29fa0000), SPH_C32(0xd1ac0000), - SPH_C32(0x251e0000), SPH_C32(0xa12c44d8), SPH_C32(0x3656dacf), - SPH_C32(0x6ee085bb), SPH_C32(0xdf876cdd), SPH_C32(0xdc8101e9), - SPH_C32(0xaf58c000), SPH_C32(0x727d0000), SPH_C32(0xb80a0000), - SPH_C32(0xed7e133d), SPH_C32(0x307cc7f9), SPH_C32(0x248ad675), - SPH_C32(0xc37da938) }, - { SPH_C32(0x5cb00110), SPH_C32(0x913e0000), SPH_C32(0x44190000), - SPH_C32(0x888c0000), SPH_C32(0x66dc7418), SPH_C32(0x921f1d66), - SPH_C32(0x55ceea25), SPH_C32(0x925c44e9), SPH_C32(0xe8870170), - SPH_C32(0x9d720000), SPH_C32(0x12db0000), SPH_C32(0xd4220000), - SPH_C32(0xf2886b27), SPH_C32(0xa921e543), SPH_C32(0x4ef8b518), - SPH_C32(0x618813b1) }, - { SPH_C32(0xabc50119), SPH_C32(0x5e02c000), SPH_C32(0x87cf0000), - SPH_C32(0x8c1e0000), SPH_C32(0x64496db1), SPH_C32(0x6af72bdc), - SPH_C32(0x2f491b6b), SPH_C32(0x0c4adcf3), SPH_C32(0x3ced0170), - SPH_C32(0x10bac000), SPH_C32(0xb7740000), SPH_C32(0x9e0b0000), - SPH_C32(0x0ec6295d), SPH_C32(0x6095632f), SPH_C32(0xd6ce231c), - SPH_C32(0x96ced091) }, - { SPH_C32(0x88da0110), SPH_C32(0x1cf6c000), SPH_C32(0xe1b60000), - SPH_C32(0xc2a50000), SPH_C32(0x9a923662), SPH_C32(0x5bab9b0a), - SPH_C32(0xcdf87c21), SPH_C32(0x651a87c9), SPH_C32(0xcb980179), - SPH_C32(0xdf860000), SPH_C32(0x74a20000), SPH_C32(0x9a990000), - SPH_C32(0x0c5330f4), SPH_C32(0x987d5595), SPH_C32(0xac49d252), - SPH_C32(0x08d8488b) }, - { SPH_C32(0x7faf0119), SPH_C32(0xd3ca0000), SPH_C32(0x22600000), - SPH_C32(0xc6370000), SPH_C32(0x98072fcb), SPH_C32(0xa343adb0), - SPH_C32(0xb77f8d6f), SPH_C32(0xfb0c1fd3), SPH_C32(0x1ff20179), - SPH_C32(0x524ec000), SPH_C32(0xd10d0000), SPH_C32(0xd0b00000), - SPH_C32(0xf01d728e), SPH_C32(0x51c9d3f9), SPH_C32(0x347f4456), - SPH_C32(0xff9e8bab) }, - { SPH_C32(0x2bf401e0), SPH_C32(0x60640000), SPH_C32(0xb1ab0000), - SPH_C32(0xbc980000), SPH_C32(0xefeb0a94), SPH_C32(0xc894f143), - SPH_C32(0x5e0d273b), SPH_C32(0x5d6b3122), SPH_C32(0x1ceb0120), - SPH_C32(0x0b6a0000), SPH_C32(0x067e0000), SPH_C32(0xd73d0000), - SPH_C32(0xb01c159f), SPH_C32(0xcf9e9b5a), SPH_C32(0xd25cc5ca), - SPH_C32(0xebbc06c5) }, - { SPH_C32(0xdc8101e9), SPH_C32(0xaf58c000), SPH_C32(0x727d0000), - SPH_C32(0xb80a0000), SPH_C32(0xed7e133d), SPH_C32(0x307cc7f9), - SPH_C32(0x248ad675), SPH_C32(0xc37da938), SPH_C32(0xc8810120), - SPH_C32(0x86a2c000), SPH_C32(0xa3d10000), SPH_C32(0x9d140000), - SPH_C32(0x4c5257e5), SPH_C32(0x062a1d36), SPH_C32(0x4a6a53ce), - SPH_C32(0x1cfac5e5) }, - { SPH_C32(0xff9e01e0), SPH_C32(0xedacc000), SPH_C32(0x14040000), - SPH_C32(0xf6b10000), SPH_C32(0x13a548ee), SPH_C32(0x0120772f), - SPH_C32(0xc63bb13f), SPH_C32(0xaa2df202), SPH_C32(0x3ff40129), - SPH_C32(0x499e0000), SPH_C32(0x60070000), SPH_C32(0x99860000), - SPH_C32(0x4ec74e4c), SPH_C32(0xfec22b8c), SPH_C32(0x30eda280), - SPH_C32(0x82ec5dff) }, - { SPH_C32(0x08eb01e9), SPH_C32(0x22900000), SPH_C32(0xd7d20000), - SPH_C32(0xf2230000), SPH_C32(0x11305147), SPH_C32(0xf9c84195), - SPH_C32(0xbcbc4071), SPH_C32(0x343b6a18), SPH_C32(0xeb9e0129), - SPH_C32(0xc456c000), SPH_C32(0xc5a80000), SPH_C32(0xd3af0000), - SPH_C32(0xb2890c36), SPH_C32(0x3776ade0), SPH_C32(0xa8db3484), - SPH_C32(0x75aa9edf) }, - { SPH_C32(0xa8dc0140), SPH_C32(0x07260000), SPH_C32(0x50bc0000), - SPH_C32(0x8b930000), SPH_C32(0x24480aa0), SPH_C32(0xf4a0637f), - SPH_C32(0xc96a9af7), SPH_C32(0x1868519d), SPH_C32(0x6baf01d0), - SPH_C32(0xfa300000), SPH_C32(0xf3cc0000), SPH_C32(0xe3290000), - SPH_C32(0x392b6b13), SPH_C32(0x9515777f), SPH_C32(0xd99f08d4), - SPH_C32(0x248b730e) }, - { SPH_C32(0x5fa90149), SPH_C32(0xc81ac000), SPH_C32(0x936a0000), - SPH_C32(0x8f010000), SPH_C32(0x26dd1309), SPH_C32(0x0c4855c5), - SPH_C32(0xb3ed6bb9), SPH_C32(0x867ec987), SPH_C32(0xbfc501d0), - SPH_C32(0x77f8c000), SPH_C32(0x56630000), SPH_C32(0xa9000000), - SPH_C32(0xc5652969), SPH_C32(0x5ca1f113), SPH_C32(0x41a99ed0), - SPH_C32(0xd3cdb02e) }, - { SPH_C32(0x7cb60140), SPH_C32(0x8aeec000), SPH_C32(0xf5130000), - SPH_C32(0xc1ba0000), SPH_C32(0xd80648da), SPH_C32(0x3d14e513), - SPH_C32(0x515c0cf3), SPH_C32(0xef2e92bd), SPH_C32(0x48b001d9), - SPH_C32(0xb8c40000), SPH_C32(0x95b50000), SPH_C32(0xad920000), - SPH_C32(0xc7f030c0), SPH_C32(0xa449c7a9), SPH_C32(0x3b2e6f9e), - SPH_C32(0x4ddb2834) }, - { SPH_C32(0x8bc30149), SPH_C32(0x45d20000), SPH_C32(0x36c50000), - SPH_C32(0xc5280000), SPH_C32(0xda935173), SPH_C32(0xc5fcd3a9), - SPH_C32(0x2bdbfdbd), SPH_C32(0x71380aa7), SPH_C32(0x9cda01d9), - SPH_C32(0x350cc000), SPH_C32(0x301a0000), SPH_C32(0xe7bb0000), - SPH_C32(0x3bbe72ba), SPH_C32(0x6dfd41c5), SPH_C32(0xa318f99a), - SPH_C32(0xba9deb14) }, - { SPH_C32(0xdf9801b0), SPH_C32(0xf67c0000), SPH_C32(0xa50e0000), - SPH_C32(0xbf870000), SPH_C32(0xad7f742c), SPH_C32(0xae2b8f5a), - SPH_C32(0xc2a957e9), SPH_C32(0xd75f2456), SPH_C32(0x9fc30180), - SPH_C32(0x6c280000), SPH_C32(0xe7690000), SPH_C32(0xe0360000), - SPH_C32(0x7bbf15ab), SPH_C32(0xf3aa0966), SPH_C32(0x453b7806), - SPH_C32(0xaebf667a) }, - { SPH_C32(0x28ed01b9), SPH_C32(0x3940c000), SPH_C32(0x66d80000), - SPH_C32(0xbb150000), SPH_C32(0xafea6d85), SPH_C32(0x56c3b9e0), - SPH_C32(0xb82ea6a7), SPH_C32(0x4949bc4c), SPH_C32(0x4ba90180), - SPH_C32(0xe1e0c000), SPH_C32(0x42c60000), SPH_C32(0xaa1f0000), - SPH_C32(0x87f157d1), SPH_C32(0x3a1e8f0a), SPH_C32(0xdd0dee02), - SPH_C32(0x59f9a55a) }, - { SPH_C32(0x0bf201b0), SPH_C32(0x7bb4c000), SPH_C32(0x00a10000), - SPH_C32(0xf5ae0000), SPH_C32(0x51313656), SPH_C32(0x679f0936), - SPH_C32(0x5a9fc1ed), SPH_C32(0x2019e776), SPH_C32(0xbcdc0189), - SPH_C32(0x2edc0000), SPH_C32(0x81100000), SPH_C32(0xae8d0000), - SPH_C32(0x85644e78), SPH_C32(0xc2f6b9b0), SPH_C32(0xa78a1f4c), - SPH_C32(0xc7ef3d40) }, - { SPH_C32(0xfc8701b9), SPH_C32(0xb4880000), SPH_C32(0xc3770000), - SPH_C32(0xf13c0000), SPH_C32(0x53a42fff), SPH_C32(0x9f773f8c), - SPH_C32(0x201830a3), SPH_C32(0xbe0f7f6c), SPH_C32(0x68b60189), - SPH_C32(0xa314c000), SPH_C32(0x24bf0000), SPH_C32(0xe4a40000), - SPH_C32(0x792a0c02), SPH_C32(0x0b423fdc), SPH_C32(0x3fbc8948), - SPH_C32(0x30a9fe60) }, - { SPH_C32(0xef0b0270), SPH_C32(0x3afd0000), SPH_C32(0x5dae0000), - SPH_C32(0x69490000), SPH_C32(0x9b0f3c06), SPH_C32(0x4405b5f9), - SPH_C32(0x66140a51), SPH_C32(0x924f5d0a), SPH_C32(0xc96b0030), - SPH_C32(0xe7250000), SPH_C32(0x2f840000), SPH_C32(0x264f0000), - SPH_C32(0x08695bf9), SPH_C32(0x6dfcf137), SPH_C32(0x509f6984), - SPH_C32(0x9e69af68) }, - { SPH_C32(0x187e0279), SPH_C32(0xf5c1c000), SPH_C32(0x9e780000), - SPH_C32(0x6ddb0000), SPH_C32(0x999a25af), SPH_C32(0xbced8343), - SPH_C32(0x1c93fb1f), SPH_C32(0x0c59c510), SPH_C32(0x1d010030), - SPH_C32(0x6aedc000), SPH_C32(0x8a2b0000), SPH_C32(0x6c660000), - SPH_C32(0xf4271983), SPH_C32(0xa448775b), SPH_C32(0xc8a9ff80), - SPH_C32(0x692f6c48) }, - { SPH_C32(0x3b610270), SPH_C32(0xb735c000), SPH_C32(0xf8010000), - SPH_C32(0x23600000), SPH_C32(0x67417e7c), SPH_C32(0x8db13395), - SPH_C32(0xfe229c55), SPH_C32(0x65099e2a), SPH_C32(0xea740039), - SPH_C32(0xa5d10000), SPH_C32(0x49fd0000), SPH_C32(0x68f40000), - SPH_C32(0xf6b2002a), SPH_C32(0x5ca041e1), SPH_C32(0xb22e0ece), - SPH_C32(0xf739f452) }, - { SPH_C32(0xcc140279), SPH_C32(0x78090000), SPH_C32(0x3bd70000), - SPH_C32(0x27f20000), SPH_C32(0x65d467d5), SPH_C32(0x7559052f), - SPH_C32(0x84a56d1b), SPH_C32(0xfb1f0630), SPH_C32(0x3e1e0039), - SPH_C32(0x2819c000), SPH_C32(0xec520000), SPH_C32(0x22dd0000), - SPH_C32(0x0afc4250), SPH_C32(0x9514c78d), SPH_C32(0x2a1898ca), - SPH_C32(0x007f3772) }, - { SPH_C32(0x984f0280), SPH_C32(0xcba70000), SPH_C32(0xa81c0000), - SPH_C32(0x5d5d0000), SPH_C32(0x1238428a), SPH_C32(0x1e8e59dc), - SPH_C32(0x6dd7c74f), SPH_C32(0x5d7828c1), SPH_C32(0x3d070060), - SPH_C32(0x713d0000), SPH_C32(0x3b210000), SPH_C32(0x25500000), - SPH_C32(0x4afd2541), SPH_C32(0x0b438f2e), SPH_C32(0xcc3b1956), - SPH_C32(0x145dba1c) }, - { SPH_C32(0x6f3a0289), SPH_C32(0x049bc000), SPH_C32(0x6bca0000), - SPH_C32(0x59cf0000), SPH_C32(0x10ad5b23), SPH_C32(0xe6666f66), - SPH_C32(0x17503601), SPH_C32(0xc36eb0db), SPH_C32(0xe96d0060), - SPH_C32(0xfcf5c000), SPH_C32(0x9e8e0000), SPH_C32(0x6f790000), - SPH_C32(0xb6b3673b), SPH_C32(0xc2f70942), SPH_C32(0x540d8f52), - SPH_C32(0xe31b793c) }, - { SPH_C32(0x4c250280), SPH_C32(0x466fc000), SPH_C32(0x0db30000), - SPH_C32(0x17740000), SPH_C32(0xee7600f0), SPH_C32(0xd73adfb0), - SPH_C32(0xf5e1514b), SPH_C32(0xaa3eebe1), SPH_C32(0x1e180069), - SPH_C32(0x33c90000), SPH_C32(0x5d580000), SPH_C32(0x6beb0000), - SPH_C32(0xb4267e92), SPH_C32(0x3a1f3ff8), SPH_C32(0x2e8a7e1c), - SPH_C32(0x7d0de126) }, - { SPH_C32(0xbb500289), SPH_C32(0x89530000), SPH_C32(0xce650000), - SPH_C32(0x13e60000), SPH_C32(0xece31959), SPH_C32(0x2fd2e90a), - SPH_C32(0x8f66a005), SPH_C32(0x342873fb), SPH_C32(0xca720069), - SPH_C32(0xbe01c000), SPH_C32(0xf8f70000), SPH_C32(0x21c20000), - SPH_C32(0x48683ce8), SPH_C32(0xf3abb994), SPH_C32(0xb6bce818), - SPH_C32(0x8a4b2206) }, - { SPH_C32(0x1b670220), SPH_C32(0xace50000), SPH_C32(0x490b0000), - SPH_C32(0x6a560000), SPH_C32(0xd99b42be), SPH_C32(0x22bacbe0), - SPH_C32(0xfab07a83), SPH_C32(0x187b487e), SPH_C32(0x4a430090), - SPH_C32(0x80670000), SPH_C32(0xce930000), SPH_C32(0x11440000), - SPH_C32(0xc3ca5bcd), SPH_C32(0x51c8630b), SPH_C32(0xc7f8d448), - SPH_C32(0xdb6acfd7) }, - { SPH_C32(0xec120229), SPH_C32(0x63d9c000), SPH_C32(0x8add0000), - SPH_C32(0x6ec40000), SPH_C32(0xdb0e5b17), SPH_C32(0xda52fd5a), - SPH_C32(0x80378bcd), SPH_C32(0x866dd064), SPH_C32(0x9e290090), - SPH_C32(0x0dafc000), SPH_C32(0x6b3c0000), SPH_C32(0x5b6d0000), - SPH_C32(0x3f8419b7), SPH_C32(0x987ce567), SPH_C32(0x5fce424c), - SPH_C32(0x2c2c0cf7) }, - { SPH_C32(0xcf0d0220), SPH_C32(0x212dc000), SPH_C32(0xeca40000), - SPH_C32(0x207f0000), SPH_C32(0x25d500c4), SPH_C32(0xeb0e4d8c), - SPH_C32(0x6286ec87), SPH_C32(0xef3d8b5e), SPH_C32(0x695c0099), - SPH_C32(0xc2930000), SPH_C32(0xa8ea0000), SPH_C32(0x5fff0000), - SPH_C32(0x3d11001e), SPH_C32(0x6094d3dd), SPH_C32(0x2549b302), - SPH_C32(0xb23a94ed) }, - { SPH_C32(0x38780229), SPH_C32(0xee110000), SPH_C32(0x2f720000), - SPH_C32(0x24ed0000), SPH_C32(0x2740196d), SPH_C32(0x13e67b36), - SPH_C32(0x18011dc9), SPH_C32(0x712b1344), SPH_C32(0xbd360099), - SPH_C32(0x4f5bc000), SPH_C32(0x0d450000), SPH_C32(0x15d60000), - SPH_C32(0xc15f4264), SPH_C32(0xa92055b1), SPH_C32(0xbd7f2506), - SPH_C32(0x457c57cd) }, - { SPH_C32(0x6c2302d0), SPH_C32(0x5dbf0000), SPH_C32(0xbcb90000), - SPH_C32(0x5e420000), SPH_C32(0x50ac3c32), SPH_C32(0x783127c5), - SPH_C32(0xf173b79d), SPH_C32(0xd74c3db5), SPH_C32(0xbe2f00c0), - SPH_C32(0x167f0000), SPH_C32(0xda360000), SPH_C32(0x125b0000), - SPH_C32(0x815e2575), SPH_C32(0x37771d12), SPH_C32(0x5b5ca49a), - SPH_C32(0x515edaa3) }, - { SPH_C32(0x9b5602d9), SPH_C32(0x9283c000), SPH_C32(0x7f6f0000), - SPH_C32(0x5ad00000), SPH_C32(0x5239259b), SPH_C32(0x80d9117f), - SPH_C32(0x8bf446d3), SPH_C32(0x495aa5af), SPH_C32(0x6a4500c0), - SPH_C32(0x9bb7c000), SPH_C32(0x7f990000), SPH_C32(0x58720000), - SPH_C32(0x7d10670f), SPH_C32(0xfec39b7e), SPH_C32(0xc36a329e), - SPH_C32(0xa6181983) }, - { SPH_C32(0xb84902d0), SPH_C32(0xd077c000), SPH_C32(0x19160000), - SPH_C32(0x146b0000), SPH_C32(0xace27e48), SPH_C32(0xb185a1a9), - SPH_C32(0x69452199), SPH_C32(0x200afe95), SPH_C32(0x9d3000c9), - SPH_C32(0x548b0000), SPH_C32(0xbc4f0000), SPH_C32(0x5ce00000), - SPH_C32(0x7f857ea6), SPH_C32(0x062badc4), SPH_C32(0xb9edc3d0), - SPH_C32(0x380e8199) }, - { SPH_C32(0x4f3c02d9), SPH_C32(0x1f4b0000), SPH_C32(0xdac00000), - SPH_C32(0x10f90000), SPH_C32(0xae7767e1), SPH_C32(0x496d9713), - SPH_C32(0x13c2d0d7), SPH_C32(0xbe1c668f), SPH_C32(0x495a00c9), - SPH_C32(0xd943c000), SPH_C32(0x19e00000), SPH_C32(0x16c90000), - SPH_C32(0x83cb3cdc), SPH_C32(0xcf9f2ba8), SPH_C32(0x21db55d4), - SPH_C32(0xcf4842b9) }, - { SPH_C32(0x078c0300), SPH_C32(0xa78f0000), SPH_C32(0x4f750000), - SPH_C32(0xbd6b0000), SPH_C32(0x69875721), SPH_C32(0xed2450ba), - SPH_C32(0x28ecbf49), SPH_C32(0xf3c74ebb), SPH_C32(0x7d5c0050), - SPH_C32(0xeb690000), SPH_C32(0x79460000), SPH_C32(0x7ae10000), - SPH_C32(0x9c3d44c6), SPH_C32(0x56c20912), SPH_C32(0x4ba936b9), - SPH_C32(0x6dbdf830) }, - { SPH_C32(0xf0f90309), SPH_C32(0x68b3c000), SPH_C32(0x8ca30000), - SPH_C32(0xb9f90000), SPH_C32(0x6b124e88), SPH_C32(0x15cc6600), - SPH_C32(0x526b4e07), SPH_C32(0x6dd1d6a1), SPH_C32(0xa9360050), - SPH_C32(0x66a1c000), SPH_C32(0xdce90000), SPH_C32(0x30c80000), - SPH_C32(0x607306bc), SPH_C32(0x9f768f7e), SPH_C32(0xd39fa0bd), - SPH_C32(0x9afb3b10) }, - { SPH_C32(0xd3e60300), SPH_C32(0x2a47c000), SPH_C32(0xeada0000), - SPH_C32(0xf7420000), SPH_C32(0x95c9155b), SPH_C32(0x2490d6d6), - SPH_C32(0xb0da294d), SPH_C32(0x04818d9b), SPH_C32(0x5e430059), - SPH_C32(0xa99d0000), SPH_C32(0x1f3f0000), SPH_C32(0x345a0000), - SPH_C32(0x62e61f15), SPH_C32(0x679eb9c4), SPH_C32(0xa91851f3), - SPH_C32(0x04eda30a) }, - { SPH_C32(0x24930309), SPH_C32(0xe57b0000), SPH_C32(0x290c0000), - SPH_C32(0xf3d00000), SPH_C32(0x975c0cf2), SPH_C32(0xdc78e06c), - SPH_C32(0xca5dd803), SPH_C32(0x9a971581), SPH_C32(0x8a290059), - SPH_C32(0x2455c000), SPH_C32(0xba900000), SPH_C32(0x7e730000), - SPH_C32(0x9ea85d6f), SPH_C32(0xae2a3fa8), SPH_C32(0x312ec7f7), - SPH_C32(0xf3ab602a) }, - { SPH_C32(0x70c803f0), SPH_C32(0x56d50000), SPH_C32(0xbac70000), - SPH_C32(0x897f0000), SPH_C32(0xe0b029ad), SPH_C32(0xb7afbc9f), - SPH_C32(0x232f7257), SPH_C32(0x3cf03b70), SPH_C32(0x89300000), - SPH_C32(0x7d710000), SPH_C32(0x6de30000), SPH_C32(0x79fe0000), - SPH_C32(0xdea93a7e), SPH_C32(0x307d770b), SPH_C32(0xd70d466b), - SPH_C32(0xe789ed44) }, - { SPH_C32(0x87bd03f9), SPH_C32(0x99e9c000), SPH_C32(0x79110000), - SPH_C32(0x8ded0000), SPH_C32(0xe2253004), SPH_C32(0x4f478a25), - SPH_C32(0x59a88319), SPH_C32(0xa2e6a36a), SPH_C32(0x5d5a0000), - SPH_C32(0xf0b9c000), SPH_C32(0xc84c0000), SPH_C32(0x33d70000), - SPH_C32(0x22e77804), SPH_C32(0xf9c9f167), SPH_C32(0x4f3bd06f), - SPH_C32(0x10cf2e64) }, - { SPH_C32(0xa4a203f0), SPH_C32(0xdb1dc000), SPH_C32(0x1f680000), - SPH_C32(0xc3560000), SPH_C32(0x1cfe6bd7), SPH_C32(0x7e1b3af3), - SPH_C32(0xbb19e453), SPH_C32(0xcbb6f850), SPH_C32(0xaa2f0009), - SPH_C32(0x3f850000), SPH_C32(0x0b9a0000), SPH_C32(0x37450000), - SPH_C32(0x207261ad), SPH_C32(0x0121c7dd), SPH_C32(0x35bc2121), - SPH_C32(0x8ed9b67e) }, - { SPH_C32(0x53d703f9), SPH_C32(0x14210000), SPH_C32(0xdcbe0000), - SPH_C32(0xc7c40000), SPH_C32(0x1e6b727e), SPH_C32(0x86f30c49), - SPH_C32(0xc19e151d), SPH_C32(0x55a0604a), SPH_C32(0x7e450009), - SPH_C32(0xb24dc000), SPH_C32(0xae350000), SPH_C32(0x7d6c0000), - SPH_C32(0xdc3c23d7), SPH_C32(0xc89541b1), SPH_C32(0xad8ab725), - SPH_C32(0x799f755e) }, - { SPH_C32(0xf3e00350), SPH_C32(0x31970000), SPH_C32(0x5bd00000), - SPH_C32(0xbe740000), SPH_C32(0x2b132999), SPH_C32(0x8b9b2ea3), - SPH_C32(0xb448cf9b), SPH_C32(0x79f35bcf), SPH_C32(0xfe7400f0), - SPH_C32(0x8c2b0000), SPH_C32(0x98510000), SPH_C32(0x4dea0000), - SPH_C32(0x579e44f2), SPH_C32(0x6af69b2e), SPH_C32(0xdcce8b75), - SPH_C32(0x28be988f) }, - { SPH_C32(0x04950359), SPH_C32(0xfeabc000), SPH_C32(0x98060000), - SPH_C32(0xbae60000), SPH_C32(0x29863030), SPH_C32(0x73731819), - SPH_C32(0xcecf3ed5), SPH_C32(0xe7e5c3d5), SPH_C32(0x2a1e00f0), - SPH_C32(0x01e3c000), SPH_C32(0x3dfe0000), SPH_C32(0x07c30000), - SPH_C32(0xabd00688), SPH_C32(0xa3421d42), SPH_C32(0x44f81d71), - SPH_C32(0xdff85baf) }, - { SPH_C32(0x278a0350), SPH_C32(0xbc5fc000), SPH_C32(0xfe7f0000), - SPH_C32(0xf45d0000), SPH_C32(0xd75d6be3), SPH_C32(0x422fa8cf), - SPH_C32(0x2c7e599f), SPH_C32(0x8eb598ef), SPH_C32(0xdd6b00f9), - SPH_C32(0xcedf0000), SPH_C32(0xfe280000), SPH_C32(0x03510000), - SPH_C32(0xa9451f21), SPH_C32(0x5baa2bf8), SPH_C32(0x3e7fec3f), - SPH_C32(0x41eec3b5) }, - { SPH_C32(0xd0ff0359), SPH_C32(0x73630000), SPH_C32(0x3da90000), - SPH_C32(0xf0cf0000), SPH_C32(0xd5c8724a), SPH_C32(0xbac79e75), - SPH_C32(0x56f9a8d1), SPH_C32(0x10a300f5), SPH_C32(0x090100f9), - SPH_C32(0x4317c000), SPH_C32(0x5b870000), SPH_C32(0x49780000), - SPH_C32(0x550b5d5b), SPH_C32(0x921ead94), SPH_C32(0xa6497a3b), - SPH_C32(0xb6a80095) }, - { SPH_C32(0x84a403a0), SPH_C32(0xc0cd0000), SPH_C32(0xae620000), - SPH_C32(0x8a600000), SPH_C32(0xa2245715), SPH_C32(0xd110c286), - SPH_C32(0xbf8b0285), SPH_C32(0xb6c42e04), SPH_C32(0x0a1800a0), - SPH_C32(0x1a330000), SPH_C32(0x8cf40000), SPH_C32(0x4ef50000), - SPH_C32(0x150a3a4a), SPH_C32(0x0c49e537), SPH_C32(0x406afba7), - SPH_C32(0xa28a8dfb) }, - { SPH_C32(0x73d103a9), SPH_C32(0x0ff1c000), SPH_C32(0x6db40000), - SPH_C32(0x8ef20000), SPH_C32(0xa0b14ebc), SPH_C32(0x29f8f43c), - SPH_C32(0xc50cf3cb), SPH_C32(0x28d2b61e), SPH_C32(0xde7200a0), - SPH_C32(0x97fbc000), SPH_C32(0x295b0000), SPH_C32(0x04dc0000), - SPH_C32(0xe9447830), SPH_C32(0xc5fd635b), SPH_C32(0xd85c6da3), - SPH_C32(0x55cc4edb) }, - { SPH_C32(0x50ce03a0), SPH_C32(0x4d05c000), SPH_C32(0x0bcd0000), - SPH_C32(0xc0490000), SPH_C32(0x5e6a156f), SPH_C32(0x18a444ea), - SPH_C32(0x27bd9481), SPH_C32(0x4182ed24), SPH_C32(0x290700a9), - SPH_C32(0x58c70000), SPH_C32(0xea8d0000), SPH_C32(0x004e0000), - SPH_C32(0xebd16199), SPH_C32(0x3d1555e1), SPH_C32(0xa2db9ced), - SPH_C32(0xcbdad6c1) }, - { SPH_C32(0xa7bb03a9), SPH_C32(0x82390000), SPH_C32(0xc81b0000), - SPH_C32(0xc4db0000), SPH_C32(0x5cff0cc6), SPH_C32(0xe04c7250), - SPH_C32(0x5d3a65cf), SPH_C32(0xdf94753e), SPH_C32(0xfd6d00a9), - SPH_C32(0xd50fc000), SPH_C32(0x4f220000), SPH_C32(0x4a670000), - SPH_C32(0x179f23e3), SPH_C32(0xf4a1d38d), SPH_C32(0x3aed0ae9), - SPH_C32(0x3c9c15e1) }, - { SPH_C32(0x5b3c0210), SPH_C32(0x36b10000), SPH_C32(0x0b6c0000), - SPH_C32(0x35e70000), SPH_C32(0x0f5b2339), SPH_C32(0x7f3b4ddc), - SPH_C32(0x7d22556c), SPH_C32(0x619b0a52), SPH_C32(0x95db0120), - SPH_C32(0x761b0000), SPH_C32(0x6b9d0000), SPH_C32(0xaec30000), - SPH_C32(0x6eb52fe1), SPH_C32(0xffe3ec51), SPH_C32(0x055183a1), - SPH_C32(0x0c35eb81) }, - { SPH_C32(0xac490219), SPH_C32(0xf98dc000), SPH_C32(0xc8ba0000), - SPH_C32(0x31750000), SPH_C32(0x0dce3a90), SPH_C32(0x87d37b66), - SPH_C32(0x07a5a422), SPH_C32(0xff8d9248), SPH_C32(0x41b10120), - SPH_C32(0xfbd3c000), SPH_C32(0xce320000), SPH_C32(0xe4ea0000), - SPH_C32(0x92fb6d9b), SPH_C32(0x36576a3d), SPH_C32(0x9d6715a5), - SPH_C32(0xfb7328a1) }, - { SPH_C32(0x8f560210), SPH_C32(0xbb79c000), SPH_C32(0xaec30000), - SPH_C32(0x7fce0000), SPH_C32(0xf3156143), SPH_C32(0xb68fcbb0), - SPH_C32(0xe514c368), SPH_C32(0x96ddc972), SPH_C32(0xb6c40129), - SPH_C32(0x34ef0000), SPH_C32(0x0de40000), SPH_C32(0xe0780000), - SPH_C32(0x906e7432), SPH_C32(0xcebf5c87), SPH_C32(0xe7e0e4eb), - SPH_C32(0x6565b0bb) }, - { SPH_C32(0x78230219), SPH_C32(0x74450000), SPH_C32(0x6d150000), - SPH_C32(0x7b5c0000), SPH_C32(0xf18078ea), SPH_C32(0x4e67fd0a), - SPH_C32(0x9f933226), SPH_C32(0x08cb5168), SPH_C32(0x62ae0129), - SPH_C32(0xb927c000), SPH_C32(0xa84b0000), SPH_C32(0xaa510000), - SPH_C32(0x6c203648), SPH_C32(0x070bdaeb), SPH_C32(0x7fd672ef), - SPH_C32(0x9223739b) }, - { SPH_C32(0x2c7802e0), SPH_C32(0xc7eb0000), SPH_C32(0xfede0000), - SPH_C32(0x01f30000), SPH_C32(0x866c5db5), SPH_C32(0x25b0a1f9), - SPH_C32(0x76e19872), SPH_C32(0xaeac7f99), SPH_C32(0x61b70170), - SPH_C32(0xe0030000), SPH_C32(0x7f380000), SPH_C32(0xaddc0000), - SPH_C32(0x2c215159), SPH_C32(0x995c9248), SPH_C32(0x99f5f373), - SPH_C32(0x8601fef5) }, - { SPH_C32(0xdb0d02e9), SPH_C32(0x08d7c000), SPH_C32(0x3d080000), - SPH_C32(0x05610000), SPH_C32(0x84f9441c), SPH_C32(0xdd589743), - SPH_C32(0x0c66693c), SPH_C32(0x30bae783), SPH_C32(0xb5dd0170), - SPH_C32(0x6dcbc000), SPH_C32(0xda970000), SPH_C32(0xe7f50000), - SPH_C32(0xd06f1323), SPH_C32(0x50e81424), SPH_C32(0x01c36577), - SPH_C32(0x71473dd5) }, - { SPH_C32(0xf81202e0), SPH_C32(0x4a23c000), SPH_C32(0x5b710000), - SPH_C32(0x4bda0000), SPH_C32(0x7a221fcf), SPH_C32(0xec042795), - SPH_C32(0xeed70e76), SPH_C32(0x59eabcb9), SPH_C32(0x42a80179), - SPH_C32(0xa2f70000), SPH_C32(0x19410000), SPH_C32(0xe3670000), - SPH_C32(0xd2fa0a8a), SPH_C32(0xa800229e), SPH_C32(0x7b449439), - SPH_C32(0xef51a5cf) }, - { SPH_C32(0x0f6702e9), SPH_C32(0x851f0000), SPH_C32(0x98a70000), - SPH_C32(0x4f480000), SPH_C32(0x78b70666), SPH_C32(0x14ec112f), - SPH_C32(0x9450ff38), SPH_C32(0xc7fc24a3), SPH_C32(0x96c20179), - SPH_C32(0x2f3fc000), SPH_C32(0xbcee0000), SPH_C32(0xa94e0000), - SPH_C32(0x2eb448f0), SPH_C32(0x61b4a4f2), SPH_C32(0xe372023d), - SPH_C32(0x181766ef) }, - { SPH_C32(0xaf500240), SPH_C32(0xa0a90000), SPH_C32(0x1fc90000), - SPH_C32(0x36f80000), SPH_C32(0x4dcf5d81), SPH_C32(0x198433c5), - SPH_C32(0xe18625be), SPH_C32(0xebaf1f26), SPH_C32(0x16f30180), - SPH_C32(0x11590000), SPH_C32(0x8a8a0000), SPH_C32(0x99c80000), - SPH_C32(0xa5162fd5), SPH_C32(0xc3d77e6d), SPH_C32(0x92363e6d), - SPH_C32(0x49368b3e) }, - { SPH_C32(0x58250249), SPH_C32(0x6f95c000), SPH_C32(0xdc1f0000), - SPH_C32(0x326a0000), SPH_C32(0x4f5a4428), SPH_C32(0xe16c057f), - SPH_C32(0x9b01d4f0), SPH_C32(0x75b9873c), SPH_C32(0xc2990180), - SPH_C32(0x9c91c000), SPH_C32(0x2f250000), SPH_C32(0xd3e10000), - SPH_C32(0x59586daf), SPH_C32(0x0a63f801), SPH_C32(0x0a00a869), - SPH_C32(0xbe70481e) }, - { SPH_C32(0x7b3a0240), SPH_C32(0x2d61c000), SPH_C32(0xba660000), - SPH_C32(0x7cd10000), SPH_C32(0xb1811ffb), SPH_C32(0xd030b5a9), - SPH_C32(0x79b0b3ba), SPH_C32(0x1ce9dc06), SPH_C32(0x35ec0189), - SPH_C32(0x53ad0000), SPH_C32(0xecf30000), SPH_C32(0xd7730000), - SPH_C32(0x5bcd7406), SPH_C32(0xf28bcebb), SPH_C32(0x70875927), - SPH_C32(0x2066d004) }, - { SPH_C32(0x8c4f0249), SPH_C32(0xe25d0000), SPH_C32(0x79b00000), - SPH_C32(0x78430000), SPH_C32(0xb3140652), SPH_C32(0x28d88313), - SPH_C32(0x033742f4), SPH_C32(0x82ff441c), SPH_C32(0xe1860189), - SPH_C32(0xde65c000), SPH_C32(0x495c0000), SPH_C32(0x9d5a0000), - SPH_C32(0xa783367c), SPH_C32(0x3b3f48d7), SPH_C32(0xe8b1cf23), - SPH_C32(0xd7201324) }, - { SPH_C32(0xd81402b0), SPH_C32(0x51f30000), SPH_C32(0xea7b0000), - SPH_C32(0x02ec0000), SPH_C32(0xc4f8230d), SPH_C32(0x430fdfe0), - SPH_C32(0xea45e8a0), SPH_C32(0x24986aed), SPH_C32(0xe29f01d0), - SPH_C32(0x87410000), SPH_C32(0x9e2f0000), SPH_C32(0x9ad70000), - SPH_C32(0xe782516d), SPH_C32(0xa5680074), SPH_C32(0x0e924ebf), - SPH_C32(0xc3029e4a) }, - { SPH_C32(0x2f6102b9), SPH_C32(0x9ecfc000), SPH_C32(0x29ad0000), - SPH_C32(0x067e0000), SPH_C32(0xc66d3aa4), SPH_C32(0xbbe7e95a), - SPH_C32(0x90c219ee), SPH_C32(0xba8ef2f7), SPH_C32(0x36f501d0), - SPH_C32(0x0a89c000), SPH_C32(0x3b800000), SPH_C32(0xd0fe0000), - SPH_C32(0x1bcc1317), SPH_C32(0x6cdc8618), SPH_C32(0x96a4d8bb), - SPH_C32(0x34445d6a) }, - { SPH_C32(0x0c7e02b0), SPH_C32(0xdc3bc000), SPH_C32(0x4fd40000), - SPH_C32(0x48c50000), SPH_C32(0x38b66177), SPH_C32(0x8abb598c), - SPH_C32(0x72737ea4), SPH_C32(0xd3dea9cd), SPH_C32(0xc18001d9), - SPH_C32(0xc5b50000), SPH_C32(0xf8560000), SPH_C32(0xd46c0000), - SPH_C32(0x19590abe), SPH_C32(0x9434b0a2), SPH_C32(0xec2329f5), - SPH_C32(0xaa52c570) }, - { SPH_C32(0xfb0b02b9), SPH_C32(0x13070000), SPH_C32(0x8c020000), - SPH_C32(0x4c570000), SPH_C32(0x3a2378de), SPH_C32(0x72536f36), - SPH_C32(0x08f48fea), SPH_C32(0x4dc831d7), SPH_C32(0x15ea01d9), - SPH_C32(0x487dc000), SPH_C32(0x5df90000), SPH_C32(0x9e450000), - SPH_C32(0xe51748c4), SPH_C32(0x5d8036ce), SPH_C32(0x7415bff1), - SPH_C32(0x5d140650) }, - { SPH_C32(0xb3bb0360), SPH_C32(0xabc30000), SPH_C32(0x19b70000), - SPH_C32(0xe1c50000), SPH_C32(0xfdd3481e), SPH_C32(0xd61aa89f), - SPH_C32(0x33dae074), SPH_C32(0x001319e3), SPH_C32(0x21ec0140), - SPH_C32(0x7a570000), SPH_C32(0x3d5f0000), SPH_C32(0xf26d0000), - SPH_C32(0xfae130de), SPH_C32(0xc4dd1474), SPH_C32(0x1e67dc9c), - SPH_C32(0xffe1bcd9) }, - { SPH_C32(0x44ce0369), SPH_C32(0x64ffc000), SPH_C32(0xda610000), - SPH_C32(0xe5570000), SPH_C32(0xff4651b7), SPH_C32(0x2ef29e25), - SPH_C32(0x495d113a), SPH_C32(0x9e0581f9), SPH_C32(0xf5860140), - SPH_C32(0xf79fc000), SPH_C32(0x98f00000), SPH_C32(0xb8440000), - SPH_C32(0x06af72a4), SPH_C32(0x0d699218), SPH_C32(0x86514a98), - SPH_C32(0x08a77ff9) }, - { SPH_C32(0x67d10360), SPH_C32(0x260bc000), SPH_C32(0xbc180000), - SPH_C32(0xabec0000), SPH_C32(0x019d0a64), SPH_C32(0x1fae2ef3), - SPH_C32(0xabec7670), SPH_C32(0xf755dac3), SPH_C32(0x02f30149), - SPH_C32(0x38a30000), SPH_C32(0x5b260000), SPH_C32(0xbcd60000), - SPH_C32(0x043a6b0d), SPH_C32(0xf581a4a2), SPH_C32(0xfcd6bbd6), - SPH_C32(0x96b1e7e3) }, - { SPH_C32(0x90a40369), SPH_C32(0xe9370000), SPH_C32(0x7fce0000), - SPH_C32(0xaf7e0000), SPH_C32(0x030813cd), SPH_C32(0xe7461849), - SPH_C32(0xd16b873e), SPH_C32(0x694342d9), SPH_C32(0xd6990149), - SPH_C32(0xb56bc000), SPH_C32(0xfe890000), SPH_C32(0xf6ff0000), - SPH_C32(0xf8742977), SPH_C32(0x3c3522ce), SPH_C32(0x64e02dd2), - SPH_C32(0x61f724c3) }, - { SPH_C32(0xc4ff0390), SPH_C32(0x5a990000), SPH_C32(0xec050000), - SPH_C32(0xd5d10000), SPH_C32(0x74e43692), SPH_C32(0x8c9144ba), - SPH_C32(0x38192d6a), SPH_C32(0xcf246c28), SPH_C32(0xd5800110), - SPH_C32(0xec4f0000), SPH_C32(0x29fa0000), SPH_C32(0xf1720000), - SPH_C32(0xb8754e66), SPH_C32(0xa2626a6d), SPH_C32(0x82c3ac4e), - SPH_C32(0x75d5a9ad) }, - { SPH_C32(0x338a0399), SPH_C32(0x95a5c000), SPH_C32(0x2fd30000), - SPH_C32(0xd1430000), SPH_C32(0x76712f3b), SPH_C32(0x74797200), - SPH_C32(0x429edc24), SPH_C32(0x5132f432), SPH_C32(0x01ea0110), - SPH_C32(0x6187c000), SPH_C32(0x8c550000), SPH_C32(0xbb5b0000), - SPH_C32(0x443b0c1c), SPH_C32(0x6bd6ec01), SPH_C32(0x1af53a4a), - SPH_C32(0x82936a8d) }, - { SPH_C32(0x10950390), SPH_C32(0xd751c000), SPH_C32(0x49aa0000), - SPH_C32(0x9ff80000), SPH_C32(0x88aa74e8), SPH_C32(0x4525c2d6), - SPH_C32(0xa02fbb6e), SPH_C32(0x3862af08), SPH_C32(0xf69f0119), - SPH_C32(0xaebb0000), SPH_C32(0x4f830000), SPH_C32(0xbfc90000), - SPH_C32(0x46ae15b5), SPH_C32(0x933edabb), SPH_C32(0x6072cb04), - SPH_C32(0x1c85f297) }, - { SPH_C32(0xe7e00399), SPH_C32(0x186d0000), SPH_C32(0x8a7c0000), - SPH_C32(0x9b6a0000), SPH_C32(0x8a3f6d41), SPH_C32(0xbdcdf46c), - SPH_C32(0xdaa84a20), SPH_C32(0xa6743712), SPH_C32(0x22f50119), - SPH_C32(0x2373c000), SPH_C32(0xea2c0000), SPH_C32(0xf5e00000), - SPH_C32(0xbae057cf), SPH_C32(0x5a8a5cd7), SPH_C32(0xf8445d00), - SPH_C32(0xebc331b7) }, - { SPH_C32(0x47d70330), SPH_C32(0x3ddb0000), SPH_C32(0x0d120000), - SPH_C32(0xe2da0000), SPH_C32(0xbf4736a6), SPH_C32(0xb0a5d686), - SPH_C32(0xaf7e90a6), SPH_C32(0x8a270c97), SPH_C32(0xa2c401e0), - SPH_C32(0x1d150000), SPH_C32(0xdc480000), SPH_C32(0xc5660000), - SPH_C32(0x314230ea), SPH_C32(0xf8e98648), SPH_C32(0x89006150), - SPH_C32(0xbae2dc66) }, - { SPH_C32(0xb0a20339), SPH_C32(0xf2e7c000), SPH_C32(0xcec40000), - SPH_C32(0xe6480000), SPH_C32(0xbdd22f0f), SPH_C32(0x484de03c), - SPH_C32(0xd5f961e8), SPH_C32(0x1431948d), SPH_C32(0x76ae01e0), - SPH_C32(0x90ddc000), SPH_C32(0x79e70000), SPH_C32(0x8f4f0000), - SPH_C32(0xcd0c7290), SPH_C32(0x315d0024), SPH_C32(0x1136f754), - SPH_C32(0x4da41f46) }, - { SPH_C32(0x93bd0330), SPH_C32(0xb013c000), SPH_C32(0xa8bd0000), - SPH_C32(0xa8f30000), SPH_C32(0x430974dc), SPH_C32(0x791150ea), - SPH_C32(0x374806a2), SPH_C32(0x7d61cfb7), SPH_C32(0x81db01e9), - SPH_C32(0x5fe10000), SPH_C32(0xba310000), SPH_C32(0x8bdd0000), - SPH_C32(0xcf996b39), SPH_C32(0xc9b5369e), SPH_C32(0x6bb1061a), - SPH_C32(0xd3b2875c) }, - { SPH_C32(0x64c80339), SPH_C32(0x7f2f0000), SPH_C32(0x6b6b0000), - SPH_C32(0xac610000), SPH_C32(0x419c6d75), SPH_C32(0x81f96650), - SPH_C32(0x4dcff7ec), SPH_C32(0xe37757ad), SPH_C32(0x55b101e9), - SPH_C32(0xd229c000), SPH_C32(0x1f9e0000), SPH_C32(0xc1f40000), - SPH_C32(0x33d72943), SPH_C32(0x0001b0f2), SPH_C32(0xf387901e), - SPH_C32(0x24f4447c) }, - { SPH_C32(0x309303c0), SPH_C32(0xcc810000), SPH_C32(0xf8a00000), - SPH_C32(0xd6ce0000), SPH_C32(0x3670482a), SPH_C32(0xea2e3aa3), - SPH_C32(0xa4bd5db8), SPH_C32(0x4510795c), SPH_C32(0x56a801b0), - SPH_C32(0x8b0d0000), SPH_C32(0xc8ed0000), SPH_C32(0xc6790000), - SPH_C32(0x73d64e52), SPH_C32(0x9e56f851), SPH_C32(0x15a41182), - SPH_C32(0x30d6c912) }, - { SPH_C32(0xc7e603c9), SPH_C32(0x03bdc000), SPH_C32(0x3b760000), - SPH_C32(0xd25c0000), SPH_C32(0x34e55183), SPH_C32(0x12c60c19), - SPH_C32(0xde3aacf6), SPH_C32(0xdb06e146), SPH_C32(0x82c201b0), - SPH_C32(0x06c5c000), SPH_C32(0x6d420000), SPH_C32(0x8c500000), - SPH_C32(0x8f980c28), SPH_C32(0x57e27e3d), SPH_C32(0x8d928786), - SPH_C32(0xc7900a32) }, - { SPH_C32(0xe4f903c0), SPH_C32(0x4149c000), SPH_C32(0x5d0f0000), - SPH_C32(0x9ce70000), SPH_C32(0xca3e0a50), SPH_C32(0x239abccf), - SPH_C32(0x3c8bcbbc), SPH_C32(0xb256ba7c), SPH_C32(0x75b701b9), - SPH_C32(0xc9f90000), SPH_C32(0xae940000), SPH_C32(0x88c20000), - SPH_C32(0x8d0d1581), SPH_C32(0xaf0a4887), SPH_C32(0xf71576c8), - SPH_C32(0x59869228) }, - { SPH_C32(0x138c03c9), SPH_C32(0x8e750000), SPH_C32(0x9ed90000), - SPH_C32(0x98750000), SPH_C32(0xc8ab13f9), SPH_C32(0xdb728a75), - SPH_C32(0x460c3af2), SPH_C32(0x2c402266), SPH_C32(0xa1dd01b9), - SPH_C32(0x4431c000), SPH_C32(0x0b3b0000), SPH_C32(0xc2eb0000), - SPH_C32(0x714357fb), SPH_C32(0x66beceeb), SPH_C32(0x6f23e0cc), - SPH_C32(0xaec05108) } -}; - -static const sph_u32 T512_14[128][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xb83d0000), SPH_C32(0x16710600), SPH_C32(0x379a0000), - SPH_C32(0xf5b10000), SPH_C32(0x228161ac), SPH_C32(0xae48f145), - SPH_C32(0x66241616), SPH_C32(0xc5c1eb3e), SPH_C32(0xfd250000), - SPH_C32(0xb3c41100), SPH_C32(0xcef00000), SPH_C32(0xcef90000), - SPH_C32(0x3c4d7580), SPH_C32(0x8d5b6493), SPH_C32(0x7098b0a6), - SPH_C32(0x1af21fe1) }, - { SPH_C32(0x75a40000), SPH_C32(0xc28b2700), SPH_C32(0x94a40000), - SPH_C32(0x90f50000), SPH_C32(0xfb7857e0), SPH_C32(0x49ce0bae), - SPH_C32(0x1767c483), SPH_C32(0xaedf667e), SPH_C32(0xd1660000), - SPH_C32(0x1bbc0300), SPH_C32(0x9eec0000), SPH_C32(0xf6940000), - SPH_C32(0x03024527), SPH_C32(0xcf70fcf2), SPH_C32(0xb4431b17), - SPH_C32(0x857f3c2b) }, - { SPH_C32(0xcd990000), SPH_C32(0xd4fa2100), SPH_C32(0xa33e0000), - SPH_C32(0x65440000), SPH_C32(0xd9f9364c), SPH_C32(0xe786faeb), - SPH_C32(0x7143d295), SPH_C32(0x6b1e8d40), SPH_C32(0x2c430000), - SPH_C32(0xa8781200), SPH_C32(0x501c0000), SPH_C32(0x386d0000), - SPH_C32(0x3f4f30a7), SPH_C32(0x422b9861), SPH_C32(0xc4dbabb1), - SPH_C32(0x9f8d23ca) }, - { SPH_C32(0xd1660000), SPH_C32(0x1bbc0300), SPH_C32(0x9eec0000), - SPH_C32(0xf6940000), SPH_C32(0x03024527), SPH_C32(0xcf70fcf2), - SPH_C32(0xb4431b17), SPH_C32(0x857f3c2b), SPH_C32(0xa4c20000), - SPH_C32(0xd9372400), SPH_C32(0x0a480000), SPH_C32(0x66610000), - SPH_C32(0xf87a12c7), SPH_C32(0x86bef75c), SPH_C32(0xa324df94), - SPH_C32(0x2ba05a55) }, - { SPH_C32(0x695b0000), SPH_C32(0x0dcd0500), SPH_C32(0xa9760000), - SPH_C32(0x03250000), SPH_C32(0x2183248b), SPH_C32(0x61380db7), - SPH_C32(0xd2670d01), SPH_C32(0x40bed715), SPH_C32(0x59e70000), - SPH_C32(0x6af33500), SPH_C32(0xc4b80000), SPH_C32(0xa8980000), - SPH_C32(0xc4376747), SPH_C32(0x0be593cf), SPH_C32(0xd3bc6f32), - SPH_C32(0x315245b4) }, - { SPH_C32(0xa4c20000), SPH_C32(0xd9372400), SPH_C32(0x0a480000), - SPH_C32(0x66610000), SPH_C32(0xf87a12c7), SPH_C32(0x86bef75c), - SPH_C32(0xa324df94), SPH_C32(0x2ba05a55), SPH_C32(0x75a40000), - SPH_C32(0xc28b2700), SPH_C32(0x94a40000), SPH_C32(0x90f50000), - SPH_C32(0xfb7857e0), SPH_C32(0x49ce0bae), SPH_C32(0x1767c483), - SPH_C32(0xaedf667e) }, - { SPH_C32(0x1cff0000), SPH_C32(0xcf462200), SPH_C32(0x3dd20000), - SPH_C32(0x93d00000), SPH_C32(0xdafb736b), SPH_C32(0x28f60619), - SPH_C32(0xc500c982), SPH_C32(0xee61b16b), SPH_C32(0x88810000), - SPH_C32(0x714f3600), SPH_C32(0x5a540000), SPH_C32(0x5e0c0000), - SPH_C32(0xc7352260), SPH_C32(0xc4956f3d), SPH_C32(0x67ff7425), - SPH_C32(0xb42d799f) }, - { SPH_C32(0x75c90003), SPH_C32(0x0e10c000), SPH_C32(0xd1200000), - SPH_C32(0xbaea0000), SPH_C32(0x8bc42f3e), SPH_C32(0x8758b757), - SPH_C32(0xbb28761d), SPH_C32(0x00b72e2b), SPH_C32(0xeecf0001), - SPH_C32(0x6f564000), SPH_C32(0xf33e0000), SPH_C32(0xa79e0000), - SPH_C32(0xbdb57219), SPH_C32(0xb711ebc5), SPH_C32(0x4a3b40ba), - SPH_C32(0xfeabf254) }, - { SPH_C32(0xcdf40003), SPH_C32(0x1861c600), SPH_C32(0xe6ba0000), - SPH_C32(0x4f5b0000), SPH_C32(0xa9454e92), SPH_C32(0x29104612), - SPH_C32(0xdd0c600b), SPH_C32(0xc576c515), SPH_C32(0x13ea0001), - SPH_C32(0xdc925100), SPH_C32(0x3dce0000), SPH_C32(0x69670000), - SPH_C32(0x81f80799), SPH_C32(0x3a4a8f56), SPH_C32(0x3aa3f01c), - SPH_C32(0xe459edb5) }, - { SPH_C32(0x006d0003), SPH_C32(0xcc9be700), SPH_C32(0x45840000), - SPH_C32(0x2a1f0000), SPH_C32(0x70bc78de), SPH_C32(0xce96bcf9), - SPH_C32(0xac4fb29e), SPH_C32(0xae684855), SPH_C32(0x3fa90001), - SPH_C32(0x74ea4300), SPH_C32(0x6dd20000), SPH_C32(0x510a0000), - SPH_C32(0xbeb7373e), SPH_C32(0x78611737), SPH_C32(0xfe785bad), - SPH_C32(0x7bd4ce7f) }, - { SPH_C32(0xb8500003), SPH_C32(0xdaeae100), SPH_C32(0x721e0000), - SPH_C32(0xdfae0000), SPH_C32(0x523d1972), SPH_C32(0x60de4dbc), - SPH_C32(0xca6ba488), SPH_C32(0x6ba9a36b), SPH_C32(0xc28c0001), - SPH_C32(0xc72e5200), SPH_C32(0xa3220000), SPH_C32(0x9ff30000), - SPH_C32(0x82fa42be), SPH_C32(0xf53a73a4), SPH_C32(0x8ee0eb0b), - SPH_C32(0x6126d19e) }, - { SPH_C32(0xa4af0003), SPH_C32(0x15acc300), SPH_C32(0x4fcc0000), - SPH_C32(0x4c7e0000), SPH_C32(0x88c66a19), SPH_C32(0x48284ba5), - SPH_C32(0x0f6b6d0a), SPH_C32(0x85c81200), SPH_C32(0x4a0d0001), - SPH_C32(0xb6616400), SPH_C32(0xf9760000), SPH_C32(0xc1ff0000), - SPH_C32(0x45cf60de), SPH_C32(0x31af1c99), SPH_C32(0xe91f9f2e), - SPH_C32(0xd50ba801) }, - { SPH_C32(0x1c920003), SPH_C32(0x03ddc500), SPH_C32(0x78560000), - SPH_C32(0xb9cf0000), SPH_C32(0xaa470bb5), SPH_C32(0xe660bae0), - SPH_C32(0x694f7b1c), SPH_C32(0x4009f93e), SPH_C32(0xb7280001), - SPH_C32(0x05a57500), SPH_C32(0x37860000), SPH_C32(0x0f060000), - SPH_C32(0x7982155e), SPH_C32(0xbcf4780a), SPH_C32(0x99872f88), - SPH_C32(0xcff9b7e0) }, - { SPH_C32(0xd10b0003), SPH_C32(0xd727e400), SPH_C32(0xdb680000), - SPH_C32(0xdc8b0000), SPH_C32(0x73be3df9), SPH_C32(0x01e6400b), - SPH_C32(0x180ca989), SPH_C32(0x2b17747e), SPH_C32(0x9b6b0001), - SPH_C32(0xaddd6700), SPH_C32(0x679a0000), SPH_C32(0x376b0000), - SPH_C32(0x46cd25f9), SPH_C32(0xfedfe06b), SPH_C32(0x5d5c8439), - SPH_C32(0x5074942a) }, - { SPH_C32(0x69360003), SPH_C32(0xc156e200), SPH_C32(0xecf20000), - SPH_C32(0x293a0000), SPH_C32(0x513f5c55), SPH_C32(0xafaeb14e), - SPH_C32(0x7e28bf9f), SPH_C32(0xeed69f40), SPH_C32(0x664e0001), - SPH_C32(0x1e197600), SPH_C32(0xa96a0000), SPH_C32(0xf9920000), - SPH_C32(0x7a805079), SPH_C32(0x738484f8), SPH_C32(0x2dc4349f), - SPH_C32(0x4a868bcb) }, - { SPH_C32(0xeecf0001), SPH_C32(0x6f564000), SPH_C32(0xf33e0000), - SPH_C32(0xa79e0000), SPH_C32(0xbdb57219), SPH_C32(0xb711ebc5), - SPH_C32(0x4a3b40ba), SPH_C32(0xfeabf254), SPH_C32(0x9b060002), - SPH_C32(0x61468000), SPH_C32(0x221e0000), SPH_C32(0x1d740000), - SPH_C32(0x36715d27), SPH_C32(0x30495c92), SPH_C32(0xf11336a7), - SPH_C32(0xfe1cdc7f) }, - { SPH_C32(0x56f20001), SPH_C32(0x79274600), SPH_C32(0xc4a40000), - SPH_C32(0x522f0000), SPH_C32(0x9f3413b5), SPH_C32(0x19591a80), - SPH_C32(0x2c1f56ac), SPH_C32(0x3b6a196a), SPH_C32(0x66230002), - SPH_C32(0xd2829100), SPH_C32(0xecee0000), SPH_C32(0xd38d0000), - SPH_C32(0x0a3c28a7), SPH_C32(0xbd123801), SPH_C32(0x818b8601), - SPH_C32(0xe4eec39e) }, - { SPH_C32(0x9b6b0001), SPH_C32(0xaddd6700), SPH_C32(0x679a0000), - SPH_C32(0x376b0000), SPH_C32(0x46cd25f9), SPH_C32(0xfedfe06b), - SPH_C32(0x5d5c8439), SPH_C32(0x5074942a), SPH_C32(0x4a600002), - SPH_C32(0x7afa8300), SPH_C32(0xbcf20000), SPH_C32(0xebe00000), - SPH_C32(0x35731800), SPH_C32(0xff39a060), SPH_C32(0x45502db0), - SPH_C32(0x7b63e054) }, - { SPH_C32(0x23560001), SPH_C32(0xbbac6100), SPH_C32(0x50000000), - SPH_C32(0xc2da0000), SPH_C32(0x644c4455), SPH_C32(0x5097112e), - SPH_C32(0x3b78922f), SPH_C32(0x95b57f14), SPH_C32(0xb7450002), - SPH_C32(0xc93e9200), SPH_C32(0x72020000), SPH_C32(0x25190000), - SPH_C32(0x093e6d80), SPH_C32(0x7262c4f3), SPH_C32(0x35c89d16), - SPH_C32(0x6191ffb5) }, - { SPH_C32(0x3fa90001), SPH_C32(0x74ea4300), SPH_C32(0x6dd20000), - SPH_C32(0x510a0000), SPH_C32(0xbeb7373e), SPH_C32(0x78611737), - SPH_C32(0xfe785bad), SPH_C32(0x7bd4ce7f), SPH_C32(0x3fc40002), - SPH_C32(0xb871a400), SPH_C32(0x28560000), SPH_C32(0x7b150000), - SPH_C32(0xce0b4fe0), SPH_C32(0xb6f7abce), SPH_C32(0x5237e933), - SPH_C32(0xd5bc862a) }, - { SPH_C32(0x87940001), SPH_C32(0x629b4500), SPH_C32(0x5a480000), - SPH_C32(0xa4bb0000), SPH_C32(0x9c365692), SPH_C32(0xd629e672), - SPH_C32(0x985c4dbb), SPH_C32(0xbe152541), SPH_C32(0xc2e10002), - SPH_C32(0x0bb5b500), SPH_C32(0xe6a60000), SPH_C32(0xb5ec0000), - SPH_C32(0xf2463a60), SPH_C32(0x3baccf5d), SPH_C32(0x22af5995), - SPH_C32(0xcf4e99cb) }, - { SPH_C32(0x4a0d0001), SPH_C32(0xb6616400), SPH_C32(0xf9760000), - SPH_C32(0xc1ff0000), SPH_C32(0x45cf60de), SPH_C32(0x31af1c99), - SPH_C32(0xe91f9f2e), SPH_C32(0xd50ba801), SPH_C32(0xeea20002), - SPH_C32(0xa3cda700), SPH_C32(0xb6ba0000), SPH_C32(0x8d810000), - SPH_C32(0xcd090ac7), SPH_C32(0x7987573c), SPH_C32(0xe674f224), - SPH_C32(0x50c3ba01) }, - { SPH_C32(0xf2300001), SPH_C32(0xa0106200), SPH_C32(0xceec0000), - SPH_C32(0x344e0000), SPH_C32(0x674e0172), SPH_C32(0x9fe7eddc), - SPH_C32(0x8f3b8938), SPH_C32(0x10ca433f), SPH_C32(0x13870002), - SPH_C32(0x1009b600), SPH_C32(0x784a0000), SPH_C32(0x43780000), - SPH_C32(0xf1447f47), SPH_C32(0xf4dc33af), SPH_C32(0x96ec4282), - SPH_C32(0x4a31a5e0) }, - { SPH_C32(0x9b060002), SPH_C32(0x61468000), SPH_C32(0x221e0000), - SPH_C32(0x1d740000), SPH_C32(0x36715d27), SPH_C32(0x30495c92), - SPH_C32(0xf11336a7), SPH_C32(0xfe1cdc7f), SPH_C32(0x75c90003), - SPH_C32(0x0e10c000), SPH_C32(0xd1200000), SPH_C32(0xbaea0000), - SPH_C32(0x8bc42f3e), SPH_C32(0x8758b757), SPH_C32(0xbb28761d), - SPH_C32(0x00b72e2b) }, - { SPH_C32(0x233b0002), SPH_C32(0x77378600), SPH_C32(0x15840000), - SPH_C32(0xe8c50000), SPH_C32(0x14f03c8b), SPH_C32(0x9e01add7), - SPH_C32(0x973720b1), SPH_C32(0x3bdd3741), SPH_C32(0x88ec0003), - SPH_C32(0xbdd4d100), SPH_C32(0x1fd00000), SPH_C32(0x74130000), - SPH_C32(0xb7895abe), SPH_C32(0x0a03d3c4), SPH_C32(0xcbb0c6bb), - SPH_C32(0x1a4531ca) }, - { SPH_C32(0xeea20002), SPH_C32(0xa3cda700), SPH_C32(0xb6ba0000), - SPH_C32(0x8d810000), SPH_C32(0xcd090ac7), SPH_C32(0x7987573c), - SPH_C32(0xe674f224), SPH_C32(0x50c3ba01), SPH_C32(0xa4af0003), - SPH_C32(0x15acc300), SPH_C32(0x4fcc0000), SPH_C32(0x4c7e0000), - SPH_C32(0x88c66a19), SPH_C32(0x48284ba5), SPH_C32(0x0f6b6d0a), - SPH_C32(0x85c81200) }, - { SPH_C32(0x569f0002), SPH_C32(0xb5bca100), SPH_C32(0x81200000), - SPH_C32(0x78300000), SPH_C32(0xef886b6b), SPH_C32(0xd7cfa679), - SPH_C32(0x8050e432), SPH_C32(0x9502513f), SPH_C32(0x598a0003), - SPH_C32(0xa668d200), SPH_C32(0x813c0000), SPH_C32(0x82870000), - SPH_C32(0xb48b1f99), SPH_C32(0xc5732f36), SPH_C32(0x7ff3ddac), - SPH_C32(0x9f3a0de1) }, - { SPH_C32(0x4a600002), SPH_C32(0x7afa8300), SPH_C32(0xbcf20000), - SPH_C32(0xebe00000), SPH_C32(0x35731800), SPH_C32(0xff39a060), - SPH_C32(0x45502db0), SPH_C32(0x7b63e054), SPH_C32(0xd10b0003), - SPH_C32(0xd727e400), SPH_C32(0xdb680000), SPH_C32(0xdc8b0000), - SPH_C32(0x73be3df9), SPH_C32(0x01e6400b), SPH_C32(0x180ca989), - SPH_C32(0x2b17747e) }, - { SPH_C32(0xf25d0002), SPH_C32(0x6c8b8500), SPH_C32(0x8b680000), - SPH_C32(0x1e510000), SPH_C32(0x17f279ac), SPH_C32(0x51715125), - SPH_C32(0x23743ba6), SPH_C32(0xbea20b6a), SPH_C32(0x2c2e0003), - SPH_C32(0x64e3f500), SPH_C32(0x15980000), SPH_C32(0x12720000), - SPH_C32(0x4ff34879), SPH_C32(0x8cbd2498), SPH_C32(0x6894192f), - SPH_C32(0x31e56b9f) }, - { SPH_C32(0x3fc40002), SPH_C32(0xb871a400), SPH_C32(0x28560000), - SPH_C32(0x7b150000), SPH_C32(0xce0b4fe0), SPH_C32(0xb6f7abce), - SPH_C32(0x5237e933), SPH_C32(0xd5bc862a), SPH_C32(0x006d0003), - SPH_C32(0xcc9be700), SPH_C32(0x45840000), SPH_C32(0x2a1f0000), - SPH_C32(0x70bc78de), SPH_C32(0xce96bcf9), SPH_C32(0xac4fb29e), - SPH_C32(0xae684855) }, - { SPH_C32(0x87f90002), SPH_C32(0xae00a200), SPH_C32(0x1fcc0000), - SPH_C32(0x8ea40000), SPH_C32(0xec8a2e4c), SPH_C32(0x18bf5a8b), - SPH_C32(0x3413ff25), SPH_C32(0x107d6d14), SPH_C32(0xfd480003), - SPH_C32(0x7f5ff600), SPH_C32(0x8b740000), SPH_C32(0xe4e60000), - SPH_C32(0x4cf10d5e), SPH_C32(0x43cdd86a), SPH_C32(0xdcd70238), - SPH_C32(0xb49a57b4) }, - { SPH_C32(0xf6800005), SPH_C32(0x3443c000), SPH_C32(0x24070000), - SPH_C32(0x8f3d0000), SPH_C32(0x21373bfb), SPH_C32(0x0ab8d5ae), - SPH_C32(0xcdc58b19), SPH_C32(0xd795ba31), SPH_C32(0xa67f0001), - SPH_C32(0x71378000), SPH_C32(0x19fc0000), SPH_C32(0x96db0000), - SPH_C32(0x3a8b6dfd), SPH_C32(0xebcaaef3), SPH_C32(0x2c6d478f), - SPH_C32(0xac8e6c88) }, - { SPH_C32(0x4ebd0005), SPH_C32(0x2232c600), SPH_C32(0x139d0000), - SPH_C32(0x7a8c0000), SPH_C32(0x03b65a57), SPH_C32(0xa4f024eb), - SPH_C32(0xabe19d0f), SPH_C32(0x1254510f), SPH_C32(0x5b5a0001), - SPH_C32(0xc2f39100), SPH_C32(0xd70c0000), SPH_C32(0x58220000), - SPH_C32(0x06c6187d), SPH_C32(0x6691ca60), SPH_C32(0x5cf5f729), - SPH_C32(0xb67c7369) }, - { SPH_C32(0x83240005), SPH_C32(0xf6c8e700), SPH_C32(0xb0a30000), - SPH_C32(0x1fc80000), SPH_C32(0xda4f6c1b), SPH_C32(0x4376de00), - SPH_C32(0xdaa24f9a), SPH_C32(0x794adc4f), SPH_C32(0x77190001), - SPH_C32(0x6a8b8300), SPH_C32(0x87100000), SPH_C32(0x604f0000), - SPH_C32(0x398928da), SPH_C32(0x24ba5201), SPH_C32(0x982e5c98), - SPH_C32(0x29f150a3) }, - { SPH_C32(0x3b190005), SPH_C32(0xe0b9e100), SPH_C32(0x87390000), - SPH_C32(0xea790000), SPH_C32(0xf8ce0db7), SPH_C32(0xed3e2f45), - SPH_C32(0xbc86598c), SPH_C32(0xbc8b3771), SPH_C32(0x8a3c0001), - SPH_C32(0xd94f9200), SPH_C32(0x49e00000), SPH_C32(0xaeb60000), - SPH_C32(0x05c45d5a), SPH_C32(0xa9e13692), SPH_C32(0xe8b6ec3e), - SPH_C32(0x33034f42) }, - { SPH_C32(0x27e60005), SPH_C32(0x2fffc300), SPH_C32(0xbaeb0000), - SPH_C32(0x79a90000), SPH_C32(0x22357edc), SPH_C32(0xc5c8295c), - SPH_C32(0x7986900e), SPH_C32(0x52ea861a), SPH_C32(0x02bd0001), - SPH_C32(0xa800a400), SPH_C32(0x13b40000), SPH_C32(0xf0ba0000), - SPH_C32(0xc2f17f3a), SPH_C32(0x6d7459af), SPH_C32(0x8f49981b), - SPH_C32(0x872e36dd) }, - { SPH_C32(0x9fdb0005), SPH_C32(0x398ec500), SPH_C32(0x8d710000), - SPH_C32(0x8c180000), SPH_C32(0x00b41f70), SPH_C32(0x6b80d819), - SPH_C32(0x1fa28618), SPH_C32(0x972b6d24), SPH_C32(0xff980001), - SPH_C32(0x1bc4b500), SPH_C32(0xdd440000), SPH_C32(0x3e430000), - SPH_C32(0xfebc0aba), SPH_C32(0xe02f3d3c), SPH_C32(0xffd128bd), - SPH_C32(0x9ddc293c) }, - { SPH_C32(0x52420005), SPH_C32(0xed74e400), SPH_C32(0x2e4f0000), - SPH_C32(0xe95c0000), SPH_C32(0xd94d293c), SPH_C32(0x8c0622f2), - SPH_C32(0x6ee1548d), SPH_C32(0xfc35e064), SPH_C32(0xd3db0001), - SPH_C32(0xb3bca700), SPH_C32(0x8d580000), SPH_C32(0x062e0000), - SPH_C32(0xc1f33a1d), SPH_C32(0xa204a55d), SPH_C32(0x3b0a830c), - SPH_C32(0x02510af6) }, - { SPH_C32(0xea7f0005), SPH_C32(0xfb05e200), SPH_C32(0x19d50000), - SPH_C32(0x1ced0000), SPH_C32(0xfbcc4890), SPH_C32(0x224ed3b7), - SPH_C32(0x08c5429b), SPH_C32(0x39f40b5a), SPH_C32(0x2efe0001), - SPH_C32(0x0078b600), SPH_C32(0x43a80000), SPH_C32(0xc8d70000), - SPH_C32(0xfdbe4f9d), SPH_C32(0x2f5fc1ce), SPH_C32(0x4b9233aa), - SPH_C32(0x18a31517) }, - { SPH_C32(0x83490006), SPH_C32(0x3a530000), SPH_C32(0xf5270000), - SPH_C32(0x35d70000), SPH_C32(0xaaf314c5), SPH_C32(0x8de062f9), - SPH_C32(0x76edfd04), SPH_C32(0xd722941a), SPH_C32(0x48b00000), - SPH_C32(0x1e61c000), SPH_C32(0xeac20000), SPH_C32(0x31450000), - SPH_C32(0x873e1fe4), SPH_C32(0x5cdb4536), SPH_C32(0x66560735), - SPH_C32(0x52259edc) }, - { SPH_C32(0x3b740006), SPH_C32(0x2c220600), SPH_C32(0xc2bd0000), - SPH_C32(0xc0660000), SPH_C32(0x88727569), SPH_C32(0x23a893bc), - SPH_C32(0x10c9eb12), SPH_C32(0x12e37f24), SPH_C32(0xb5950000), - SPH_C32(0xada5d100), SPH_C32(0x24320000), SPH_C32(0xffbc0000), - SPH_C32(0xbb736a64), SPH_C32(0xd18021a5), SPH_C32(0x16ceb793), - SPH_C32(0x48d7813d) }, - { SPH_C32(0xf6ed0006), SPH_C32(0xf8d82700), SPH_C32(0x61830000), - SPH_C32(0xa5220000), SPH_C32(0x518b4325), SPH_C32(0xc42e6957), - SPH_C32(0x618a3987), SPH_C32(0x79fdf264), SPH_C32(0x99d60000), - SPH_C32(0x05ddc300), SPH_C32(0x742e0000), SPH_C32(0xc7d10000), - SPH_C32(0x843c5ac3), SPH_C32(0x93abb9c4), SPH_C32(0xd2151c22), - SPH_C32(0xd75aa2f7) }, - { SPH_C32(0x4ed00006), SPH_C32(0xeea92100), SPH_C32(0x56190000), - SPH_C32(0x50930000), SPH_C32(0x730a2289), SPH_C32(0x6a669812), - SPH_C32(0x07ae2f91), SPH_C32(0xbc3c195a), SPH_C32(0x64f30000), - SPH_C32(0xb619d200), SPH_C32(0xbade0000), SPH_C32(0x09280000), - SPH_C32(0xb8712f43), SPH_C32(0x1ef0dd57), SPH_C32(0xa28dac84), - SPH_C32(0xcda8bd16) }, - { SPH_C32(0x522f0006), SPH_C32(0x21ef0300), SPH_C32(0x6bcb0000), - SPH_C32(0xc3430000), SPH_C32(0xa9f151e2), SPH_C32(0x42909e0b), - SPH_C32(0xc2aee613), SPH_C32(0x525da831), SPH_C32(0xec720000), - SPH_C32(0xc756e400), SPH_C32(0xe08a0000), SPH_C32(0x57240000), - SPH_C32(0x7f440d23), SPH_C32(0xda65b26a), SPH_C32(0xc572d8a1), - SPH_C32(0x7985c489) }, - { SPH_C32(0xea120006), SPH_C32(0x379e0500), SPH_C32(0x5c510000), - SPH_C32(0x36f20000), SPH_C32(0x8b70304e), SPH_C32(0xecd86f4e), - SPH_C32(0xa48af005), SPH_C32(0x979c430f), SPH_C32(0x11570000), - SPH_C32(0x7492f500), SPH_C32(0x2e7a0000), SPH_C32(0x99dd0000), - SPH_C32(0x430978a3), SPH_C32(0x573ed6f9), SPH_C32(0xb5ea6807), - SPH_C32(0x6377db68) }, - { SPH_C32(0x278b0006), SPH_C32(0xe3642400), SPH_C32(0xff6f0000), - SPH_C32(0x53b60000), SPH_C32(0x52890602), SPH_C32(0x0b5e95a5), - SPH_C32(0xd5c92290), SPH_C32(0xfc82ce4f), SPH_C32(0x3d140000), - SPH_C32(0xdceae700), SPH_C32(0x7e660000), SPH_C32(0xa1b00000), - SPH_C32(0x7c464804), SPH_C32(0x15154e98), SPH_C32(0x7131c3b6), - SPH_C32(0xfcfaf8a2) }, - { SPH_C32(0x9fb60006), SPH_C32(0xf5152200), SPH_C32(0xc8f50000), - SPH_C32(0xa6070000), SPH_C32(0x700867ae), SPH_C32(0xa51664e0), - SPH_C32(0xb3ed3486), SPH_C32(0x39432571), SPH_C32(0xc0310000), - SPH_C32(0x6f2ef600), SPH_C32(0xb0960000), SPH_C32(0x6f490000), - SPH_C32(0x400b3d84), SPH_C32(0x984e2a0b), SPH_C32(0x01a97310), - SPH_C32(0xe608e743) }, - { SPH_C32(0x184f0004), SPH_C32(0x5b158000), SPH_C32(0xd7390000), - SPH_C32(0x28a30000), SPH_C32(0x9c8249e2), SPH_C32(0xbda93e6b), - SPH_C32(0x87fecba3), SPH_C32(0x293e4865), SPH_C32(0x3d790003), - SPH_C32(0x10710000), SPH_C32(0x3be20000), SPH_C32(0x8baf0000), - SPH_C32(0x0cfa30da), SPH_C32(0xdb83f261), SPH_C32(0xdd7e7128), - SPH_C32(0x5292b0f7) }, - { SPH_C32(0xa0720004), SPH_C32(0x4d648600), SPH_C32(0xe0a30000), - SPH_C32(0xdd120000), SPH_C32(0xbe03284e), SPH_C32(0x13e1cf2e), - SPH_C32(0xe1daddb5), SPH_C32(0xecffa35b), SPH_C32(0xc05c0003), - SPH_C32(0xa3b51100), SPH_C32(0xf5120000), SPH_C32(0x45560000), - SPH_C32(0x30b7455a), SPH_C32(0x56d896f2), SPH_C32(0xade6c18e), - SPH_C32(0x4860af16) }, - { SPH_C32(0x6deb0004), SPH_C32(0x999ea700), SPH_C32(0x439d0000), - SPH_C32(0xb8560000), SPH_C32(0x67fa1e02), SPH_C32(0xf46735c5), - SPH_C32(0x90990f20), SPH_C32(0x87e12e1b), SPH_C32(0xec1f0003), - SPH_C32(0x0bcd0300), SPH_C32(0xa50e0000), SPH_C32(0x7d3b0000), - SPH_C32(0x0ff875fd), SPH_C32(0x14f30e93), SPH_C32(0x693d6a3f), - SPH_C32(0xd7ed8cdc) }, - { SPH_C32(0xd5d60004), SPH_C32(0x8fefa100), SPH_C32(0x74070000), - SPH_C32(0x4de70000), SPH_C32(0x457b7fae), SPH_C32(0x5a2fc480), - SPH_C32(0xf6bd1936), SPH_C32(0x4220c525), SPH_C32(0x113a0003), - SPH_C32(0xb8091200), SPH_C32(0x6bfe0000), SPH_C32(0xb3c20000), - SPH_C32(0x33b5007d), SPH_C32(0x99a86a00), SPH_C32(0x19a5da99), - SPH_C32(0xcd1f933d) }, - { SPH_C32(0xc9290004), SPH_C32(0x40a98300), SPH_C32(0x49d50000), - SPH_C32(0xde370000), SPH_C32(0x9f800cc5), SPH_C32(0x72d9c299), - SPH_C32(0x33bdd0b4), SPH_C32(0xac41744e), SPH_C32(0x99bb0003), - SPH_C32(0xc9462400), SPH_C32(0x31aa0000), SPH_C32(0xedce0000), - SPH_C32(0xf480221d), SPH_C32(0x5d3d053d), SPH_C32(0x7e5aaebc), - SPH_C32(0x7932eaa2) }, - { SPH_C32(0x71140004), SPH_C32(0x56d88500), SPH_C32(0x7e4f0000), - SPH_C32(0x2b860000), SPH_C32(0xbd016d69), SPH_C32(0xdc9133dc), - SPH_C32(0x5599c6a2), SPH_C32(0x69809f70), SPH_C32(0x649e0003), - SPH_C32(0x7a823500), SPH_C32(0xff5a0000), SPH_C32(0x23370000), - SPH_C32(0xc8cd579d), SPH_C32(0xd06661ae), SPH_C32(0x0ec21e1a), - SPH_C32(0x63c0f543) }, - { SPH_C32(0xbc8d0004), SPH_C32(0x8222a400), SPH_C32(0xdd710000), - SPH_C32(0x4ec20000), SPH_C32(0x64f85b25), SPH_C32(0x3b17c937), - SPH_C32(0x24da1437), SPH_C32(0x029e1230), SPH_C32(0x48dd0003), - SPH_C32(0xd2fa2700), SPH_C32(0xaf460000), SPH_C32(0x1b5a0000), - SPH_C32(0xf782673a), SPH_C32(0x924df9cf), SPH_C32(0xca19b5ab), - SPH_C32(0xfc4dd689) }, - { SPH_C32(0x04b00004), SPH_C32(0x9453a200), SPH_C32(0xeaeb0000), - SPH_C32(0xbb730000), SPH_C32(0x46793a89), SPH_C32(0x955f3872), - SPH_C32(0x42fe0221), SPH_C32(0xc75ff90e), SPH_C32(0xb5f80003), - SPH_C32(0x613e3600), SPH_C32(0x61b60000), SPH_C32(0xd5a30000), - SPH_C32(0xcbcf12ba), SPH_C32(0x1f169d5c), SPH_C32(0xba81050d), - SPH_C32(0xe6bfc968) }, - { SPH_C32(0x6d860007), SPH_C32(0x55054000), SPH_C32(0x06190000), - SPH_C32(0x92490000), SPH_C32(0x174666dc), SPH_C32(0x3af1893c), - SPH_C32(0x3cd6bdbe), SPH_C32(0x2989664e), SPH_C32(0xd3b60002), - SPH_C32(0x7f274000), SPH_C32(0xc8dc0000), SPH_C32(0x2c310000), - SPH_C32(0xb14f42c3), SPH_C32(0x6c9219a4), SPH_C32(0x97453192), - SPH_C32(0xac3942a3) }, - { SPH_C32(0xd5bb0007), SPH_C32(0x43744600), SPH_C32(0x31830000), - SPH_C32(0x67f80000), SPH_C32(0x35c70770), SPH_C32(0x94b97879), - SPH_C32(0x5af2aba8), SPH_C32(0xec488d70), SPH_C32(0x2e930002), - SPH_C32(0xcce35100), SPH_C32(0x062c0000), SPH_C32(0xe2c80000), - SPH_C32(0x8d023743), SPH_C32(0xe1c97d37), SPH_C32(0xe7dd8134), - SPH_C32(0xb6cb5d42) }, - { SPH_C32(0x18220007), SPH_C32(0x978e6700), SPH_C32(0x92bd0000), - SPH_C32(0x02bc0000), SPH_C32(0xec3e313c), SPH_C32(0x733f8292), - SPH_C32(0x2bb1793d), SPH_C32(0x87560030), SPH_C32(0x02d00002), - SPH_C32(0x649b4300), SPH_C32(0x56300000), SPH_C32(0xdaa50000), - SPH_C32(0xb24d07e4), SPH_C32(0xa3e2e556), SPH_C32(0x23062a85), - SPH_C32(0x29467e88) }, - { SPH_C32(0xa01f0007), SPH_C32(0x81ff6100), SPH_C32(0xa5270000), - SPH_C32(0xf70d0000), SPH_C32(0xcebf5090), SPH_C32(0xdd7773d7), - SPH_C32(0x4d956f2b), SPH_C32(0x4297eb0e), SPH_C32(0xfff50002), - SPH_C32(0xd75f5200), SPH_C32(0x98c00000), SPH_C32(0x145c0000), - SPH_C32(0x8e007264), SPH_C32(0x2eb981c5), SPH_C32(0x539e9a23), - SPH_C32(0x33b46169) }, - { SPH_C32(0xbce00007), SPH_C32(0x4eb94300), SPH_C32(0x98f50000), - SPH_C32(0x64dd0000), SPH_C32(0x144423fb), SPH_C32(0xf58175ce), - SPH_C32(0x8895a6a9), SPH_C32(0xacf65a65), SPH_C32(0x77740002), - SPH_C32(0xa6106400), SPH_C32(0xc2940000), SPH_C32(0x4a500000), - SPH_C32(0x49355004), SPH_C32(0xea2ceef8), SPH_C32(0x3461ee06), - SPH_C32(0x879918f6) }, - { SPH_C32(0x04dd0007), SPH_C32(0x58c84500), SPH_C32(0xaf6f0000), - SPH_C32(0x916c0000), SPH_C32(0x36c54257), SPH_C32(0x5bc9848b), - SPH_C32(0xeeb1b0bf), SPH_C32(0x6937b15b), SPH_C32(0x8a510002), - SPH_C32(0x15d47500), SPH_C32(0x0c640000), SPH_C32(0x84a90000), - SPH_C32(0x75782584), SPH_C32(0x67778a6b), SPH_C32(0x44f95ea0), - SPH_C32(0x9d6b0717) }, - { SPH_C32(0xc9440007), SPH_C32(0x8c326400), SPH_C32(0x0c510000), - SPH_C32(0xf4280000), SPH_C32(0xef3c741b), SPH_C32(0xbc4f7e60), - SPH_C32(0x9ff2622a), SPH_C32(0x02293c1b), SPH_C32(0xa6120002), - SPH_C32(0xbdac6700), SPH_C32(0x5c780000), SPH_C32(0xbcc40000), - SPH_C32(0x4a371523), SPH_C32(0x255c120a), SPH_C32(0x8022f511), - SPH_C32(0x02e624dd) }, - { SPH_C32(0x71790007), SPH_C32(0x9a436200), SPH_C32(0x3bcb0000), - SPH_C32(0x01990000), SPH_C32(0xcdbd15b7), SPH_C32(0x12078f25), - SPH_C32(0xf9d6743c), SPH_C32(0xc7e8d725), SPH_C32(0x5b370002), - SPH_C32(0x0e687600), SPH_C32(0x92880000), SPH_C32(0x723d0000), - SPH_C32(0x767a60a3), SPH_C32(0xa8077699), SPH_C32(0xf0ba45b7), - SPH_C32(0x18143b3c) }, - { SPH_C32(0xa67f0001), SPH_C32(0x71378000), SPH_C32(0x19fc0000), - SPH_C32(0x96db0000), SPH_C32(0x3a8b6dfd), SPH_C32(0xebcaaef3), - SPH_C32(0x2c6d478f), SPH_C32(0xac8e6c88), SPH_C32(0x50ff0004), - SPH_C32(0x45744000), SPH_C32(0x3dfb0000), SPH_C32(0x19e60000), - SPH_C32(0x1bbc5606), SPH_C32(0xe1727b5d), SPH_C32(0xe1a8cc96), - SPH_C32(0x7b1bd6b9) }, - { SPH_C32(0x1e420001), SPH_C32(0x67468600), SPH_C32(0x2e660000), - SPH_C32(0x636a0000), SPH_C32(0x180a0c51), SPH_C32(0x45825fb6), - SPH_C32(0x4a495199), SPH_C32(0x694f87b6), SPH_C32(0xadda0004), - SPH_C32(0xf6b05100), SPH_C32(0xf30b0000), SPH_C32(0xd71f0000), - SPH_C32(0x27f12386), SPH_C32(0x6c291fce), SPH_C32(0x91307c30), - SPH_C32(0x61e9c958) }, - { SPH_C32(0xd3db0001), SPH_C32(0xb3bca700), SPH_C32(0x8d580000), - SPH_C32(0x062e0000), SPH_C32(0xc1f33a1d), SPH_C32(0xa204a55d), - SPH_C32(0x3b0a830c), SPH_C32(0x02510af6), SPH_C32(0x81990004), - SPH_C32(0x5ec84300), SPH_C32(0xa3170000), SPH_C32(0xef720000), - SPH_C32(0x18be1321), SPH_C32(0x2e0287af), SPH_C32(0x55ebd781), - SPH_C32(0xfe64ea92) }, - { SPH_C32(0x6be60001), SPH_C32(0xa5cda100), SPH_C32(0xbac20000), - SPH_C32(0xf39f0000), SPH_C32(0xe3725bb1), SPH_C32(0x0c4c5418), - SPH_C32(0x5d2e951a), SPH_C32(0xc790e1c8), SPH_C32(0x7cbc0004), - SPH_C32(0xed0c5200), SPH_C32(0x6de70000), SPH_C32(0x218b0000), - SPH_C32(0x24f366a1), SPH_C32(0xa359e33c), SPH_C32(0x25736727), - SPH_C32(0xe496f573) }, - { SPH_C32(0x77190001), SPH_C32(0x6a8b8300), SPH_C32(0x87100000), - SPH_C32(0x604f0000), SPH_C32(0x398928da), SPH_C32(0x24ba5201), - SPH_C32(0x982e5c98), SPH_C32(0x29f150a3), SPH_C32(0xf43d0004), - SPH_C32(0x9c436400), SPH_C32(0x37b30000), SPH_C32(0x7f870000), - SPH_C32(0xe3c644c1), SPH_C32(0x67cc8c01), SPH_C32(0x428c1302), - SPH_C32(0x50bb8cec) }, - { SPH_C32(0xcf240001), SPH_C32(0x7cfa8500), SPH_C32(0xb08a0000), - SPH_C32(0x95fe0000), SPH_C32(0x1b084976), SPH_C32(0x8af2a344), - SPH_C32(0xfe0a4a8e), SPH_C32(0xec30bb9d), SPH_C32(0x09180004), - SPH_C32(0x2f877500), SPH_C32(0xf9430000), SPH_C32(0xb17e0000), - SPH_C32(0xdf8b3141), SPH_C32(0xea97e892), SPH_C32(0x3214a3a4), - SPH_C32(0x4a49930d) }, - { SPH_C32(0x02bd0001), SPH_C32(0xa800a400), SPH_C32(0x13b40000), - SPH_C32(0xf0ba0000), SPH_C32(0xc2f17f3a), SPH_C32(0x6d7459af), - SPH_C32(0x8f49981b), SPH_C32(0x872e36dd), SPH_C32(0x255b0004), - SPH_C32(0x87ff6700), SPH_C32(0xa95f0000), SPH_C32(0x89130000), - SPH_C32(0xe0c401e6), SPH_C32(0xa8bc70f3), SPH_C32(0xf6cf0815), - SPH_C32(0xd5c4b0c7) }, - { SPH_C32(0xba800001), SPH_C32(0xbe71a200), SPH_C32(0x242e0000), - SPH_C32(0x050b0000), SPH_C32(0xe0701e96), SPH_C32(0xc33ca8ea), - SPH_C32(0xe96d8e0d), SPH_C32(0x42efdde3), SPH_C32(0xd87e0004), - SPH_C32(0x343b7600), SPH_C32(0x67af0000), SPH_C32(0x47ea0000), - SPH_C32(0xdc897466), SPH_C32(0x25e71460), SPH_C32(0x8657b8b3), - SPH_C32(0xcf36af26) }, - { SPH_C32(0xd3b60002), SPH_C32(0x7f274000), SPH_C32(0xc8dc0000), - SPH_C32(0x2c310000), SPH_C32(0xb14f42c3), SPH_C32(0x6c9219a4), - SPH_C32(0x97453192), SPH_C32(0xac3942a3), SPH_C32(0xbe300005), - SPH_C32(0x2a220000), SPH_C32(0xcec50000), SPH_C32(0xbe780000), - SPH_C32(0xa609241f), SPH_C32(0x56639098), SPH_C32(0xab938c2c), - SPH_C32(0x85b024ed) }, - { SPH_C32(0x6b8b0002), SPH_C32(0x69564600), SPH_C32(0xff460000), - SPH_C32(0xd9800000), SPH_C32(0x93ce236f), SPH_C32(0xc2dae8e1), - SPH_C32(0xf1612784), SPH_C32(0x69f8a99d), SPH_C32(0x43150005), - SPH_C32(0x99e61100), SPH_C32(0x00350000), SPH_C32(0x70810000), - SPH_C32(0x9a44519f), SPH_C32(0xdb38f40b), SPH_C32(0xdb0b3c8a), - SPH_C32(0x9f423b0c) }, - { SPH_C32(0xa6120002), SPH_C32(0xbdac6700), SPH_C32(0x5c780000), - SPH_C32(0xbcc40000), SPH_C32(0x4a371523), SPH_C32(0x255c120a), - SPH_C32(0x8022f511), SPH_C32(0x02e624dd), SPH_C32(0x6f560005), - SPH_C32(0x319e0300), SPH_C32(0x50290000), SPH_C32(0x48ec0000), - SPH_C32(0xa50b6138), SPH_C32(0x99136c6a), SPH_C32(0x1fd0973b), - SPH_C32(0x00cf18c6) }, - { SPH_C32(0x1e2f0002), SPH_C32(0xabdd6100), SPH_C32(0x6be20000), - SPH_C32(0x49750000), SPH_C32(0x68b6748f), SPH_C32(0x8b14e34f), - SPH_C32(0xe606e307), SPH_C32(0xc727cfe3), SPH_C32(0x92730005), - SPH_C32(0x825a1200), SPH_C32(0x9ed90000), SPH_C32(0x86150000), - SPH_C32(0x994614b8), SPH_C32(0x144808f9), SPH_C32(0x6f48279d), - SPH_C32(0x1a3d0727) }, - { SPH_C32(0x02d00002), SPH_C32(0x649b4300), SPH_C32(0x56300000), - SPH_C32(0xdaa50000), SPH_C32(0xb24d07e4), SPH_C32(0xa3e2e556), - SPH_C32(0x23062a85), SPH_C32(0x29467e88), SPH_C32(0x1af20005), - SPH_C32(0xf3152400), SPH_C32(0xc48d0000), SPH_C32(0xd8190000), - SPH_C32(0x5e7336d8), SPH_C32(0xd0dd67c4), SPH_C32(0x08b753b8), - SPH_C32(0xae107eb8) }, - { SPH_C32(0xbaed0002), SPH_C32(0x72ea4500), SPH_C32(0x61aa0000), - SPH_C32(0x2f140000), SPH_C32(0x90cc6648), SPH_C32(0x0daa1413), - SPH_C32(0x45223c93), SPH_C32(0xec8795b6), SPH_C32(0xe7d70005), - SPH_C32(0x40d13500), SPH_C32(0x0a7d0000), SPH_C32(0x16e00000), - SPH_C32(0x623e4358), SPH_C32(0x5d860357), SPH_C32(0x782fe31e), - SPH_C32(0xb4e26159) }, - { SPH_C32(0x77740002), SPH_C32(0xa6106400), SPH_C32(0xc2940000), - SPH_C32(0x4a500000), SPH_C32(0x49355004), SPH_C32(0xea2ceef8), - SPH_C32(0x3461ee06), SPH_C32(0x879918f6), SPH_C32(0xcb940005), - SPH_C32(0xe8a92700), SPH_C32(0x5a610000), SPH_C32(0x2e8d0000), - SPH_C32(0x5d7173ff), SPH_C32(0x1fad9b36), SPH_C32(0xbcf448af), - SPH_C32(0x2b6f4293) }, - { SPH_C32(0xcf490002), SPH_C32(0xb0616200), SPH_C32(0xf50e0000), - SPH_C32(0xbfe10000), SPH_C32(0x6bb431a8), SPH_C32(0x44641fbd), - SPH_C32(0x5245f810), SPH_C32(0x4258f3c8), SPH_C32(0x36b10005), - SPH_C32(0x5b6d3600), SPH_C32(0x94910000), SPH_C32(0xe0740000), - SPH_C32(0x613c067f), SPH_C32(0x92f6ffa5), SPH_C32(0xcc6cf809), - SPH_C32(0x319d5d72) }, - { SPH_C32(0x48b00000), SPH_C32(0x1e61c000), SPH_C32(0xeac20000), - SPH_C32(0x31450000), SPH_C32(0x873e1fe4), SPH_C32(0x5cdb4536), - SPH_C32(0x66560735), SPH_C32(0x52259edc), SPH_C32(0xcbf90006), - SPH_C32(0x2432c000), SPH_C32(0x1fe50000), SPH_C32(0x04920000), - SPH_C32(0x2dcd0b21), SPH_C32(0xd13b27cf), SPH_C32(0x10bbfa31), - SPH_C32(0x85070ac6) }, - { SPH_C32(0xf08d0000), SPH_C32(0x0810c600), SPH_C32(0xdd580000), - SPH_C32(0xc4f40000), SPH_C32(0xa5bf7e48), SPH_C32(0xf293b473), - SPH_C32(0x00721123), SPH_C32(0x97e475e2), SPH_C32(0x36dc0006), - SPH_C32(0x97f6d100), SPH_C32(0xd1150000), SPH_C32(0xca6b0000), - SPH_C32(0x11807ea1), SPH_C32(0x5c60435c), SPH_C32(0x60234a97), - SPH_C32(0x9ff51527) }, - { SPH_C32(0x3d140000), SPH_C32(0xdceae700), SPH_C32(0x7e660000), - SPH_C32(0xa1b00000), SPH_C32(0x7c464804), SPH_C32(0x15154e98), - SPH_C32(0x7131c3b6), SPH_C32(0xfcfaf8a2), SPH_C32(0x1a9f0006), - SPH_C32(0x3f8ec300), SPH_C32(0x81090000), SPH_C32(0xf2060000), - SPH_C32(0x2ecf4e06), SPH_C32(0x1e4bdb3d), SPH_C32(0xa4f8e126), - SPH_C32(0x007836ed) }, - { SPH_C32(0x85290000), SPH_C32(0xca9be100), SPH_C32(0x49fc0000), - SPH_C32(0x54010000), SPH_C32(0x5ec729a8), SPH_C32(0xbb5dbfdd), - SPH_C32(0x1715d5a0), SPH_C32(0x393b139c), SPH_C32(0xe7ba0006), - SPH_C32(0x8c4ad200), SPH_C32(0x4ff90000), SPH_C32(0x3cff0000), - SPH_C32(0x12823b86), SPH_C32(0x9310bfae), SPH_C32(0xd4605180), - SPH_C32(0x1a8a290c) }, - { SPH_C32(0x99d60000), SPH_C32(0x05ddc300), SPH_C32(0x742e0000), - SPH_C32(0xc7d10000), SPH_C32(0x843c5ac3), SPH_C32(0x93abb9c4), - SPH_C32(0xd2151c22), SPH_C32(0xd75aa2f7), SPH_C32(0x6f3b0006), - SPH_C32(0xfd05e400), SPH_C32(0x15ad0000), SPH_C32(0x62f30000), - SPH_C32(0xd5b719e6), SPH_C32(0x5785d093), SPH_C32(0xb39f25a5), - SPH_C32(0xaea75093) }, - { SPH_C32(0x21eb0000), SPH_C32(0x13acc500), SPH_C32(0x43b40000), - SPH_C32(0x32600000), SPH_C32(0xa6bd3b6f), SPH_C32(0x3de34881), - SPH_C32(0xb4310a34), SPH_C32(0x129b49c9), SPH_C32(0x921e0006), - SPH_C32(0x4ec1f500), SPH_C32(0xdb5d0000), SPH_C32(0xac0a0000), - SPH_C32(0xe9fa6c66), SPH_C32(0xdadeb400), SPH_C32(0xc3079503), - SPH_C32(0xb4554f72) }, - { SPH_C32(0xec720000), SPH_C32(0xc756e400), SPH_C32(0xe08a0000), - SPH_C32(0x57240000), SPH_C32(0x7f440d23), SPH_C32(0xda65b26a), - SPH_C32(0xc572d8a1), SPH_C32(0x7985c489), SPH_C32(0xbe5d0006), - SPH_C32(0xe6b9e700), SPH_C32(0x8b410000), SPH_C32(0x94670000), - SPH_C32(0xd6b55cc1), SPH_C32(0x98f52c61), SPH_C32(0x07dc3eb2), - SPH_C32(0x2bd86cb8) }, - { SPH_C32(0x544f0000), SPH_C32(0xd127e200), SPH_C32(0xd7100000), - SPH_C32(0xa2950000), SPH_C32(0x5dc56c8f), SPH_C32(0x742d432f), - SPH_C32(0xa356ceb7), SPH_C32(0xbc442fb7), SPH_C32(0x43780006), - SPH_C32(0x557df600), SPH_C32(0x45b10000), SPH_C32(0x5a9e0000), - SPH_C32(0xeaf82941), SPH_C32(0x15ae48f2), SPH_C32(0x77448e14), - SPH_C32(0x312a7359) }, - { SPH_C32(0x3d790003), SPH_C32(0x10710000), SPH_C32(0x3be20000), - SPH_C32(0x8baf0000), SPH_C32(0x0cfa30da), SPH_C32(0xdb83f261), - SPH_C32(0xdd7e7128), SPH_C32(0x5292b0f7), SPH_C32(0x25360007), - SPH_C32(0x4b648000), SPH_C32(0xecdb0000), SPH_C32(0xa30c0000), - SPH_C32(0x90787938), SPH_C32(0x662acc0a), SPH_C32(0x5a80ba8b), - SPH_C32(0x7bacf892) }, - { SPH_C32(0x85440003), SPH_C32(0x06000600), SPH_C32(0x0c780000), - SPH_C32(0x7e1e0000), SPH_C32(0x2e7b5176), SPH_C32(0x75cb0324), - SPH_C32(0xbb5a673e), SPH_C32(0x97535bc9), SPH_C32(0xd8130007), - SPH_C32(0xf8a09100), SPH_C32(0x222b0000), SPH_C32(0x6df50000), - SPH_C32(0xac350cb8), SPH_C32(0xeb71a899), SPH_C32(0x2a180a2d), - SPH_C32(0x615ee773) }, - { SPH_C32(0x48dd0003), SPH_C32(0xd2fa2700), SPH_C32(0xaf460000), - SPH_C32(0x1b5a0000), SPH_C32(0xf782673a), SPH_C32(0x924df9cf), - SPH_C32(0xca19b5ab), SPH_C32(0xfc4dd689), SPH_C32(0xf4500007), - SPH_C32(0x50d88300), SPH_C32(0x72370000), SPH_C32(0x55980000), - SPH_C32(0x937a3c1f), SPH_C32(0xa95a30f8), SPH_C32(0xeec3a19c), - SPH_C32(0xfed3c4b9) }, - { SPH_C32(0xf0e00003), SPH_C32(0xc48b2100), SPH_C32(0x98dc0000), - SPH_C32(0xeeeb0000), SPH_C32(0xd5030696), SPH_C32(0x3c05088a), - SPH_C32(0xac3da3bd), SPH_C32(0x398c3db7), SPH_C32(0x09750007), - SPH_C32(0xe31c9200), SPH_C32(0xbcc70000), SPH_C32(0x9b610000), - SPH_C32(0xaf37499f), SPH_C32(0x2401546b), SPH_C32(0x9e5b113a), - SPH_C32(0xe421db58) }, - { SPH_C32(0xec1f0003), SPH_C32(0x0bcd0300), SPH_C32(0xa50e0000), - SPH_C32(0x7d3b0000), SPH_C32(0x0ff875fd), SPH_C32(0x14f30e93), - SPH_C32(0x693d6a3f), SPH_C32(0xd7ed8cdc), SPH_C32(0x81f40007), - SPH_C32(0x9253a400), SPH_C32(0xe6930000), SPH_C32(0xc56d0000), - SPH_C32(0x68026bff), SPH_C32(0xe0943b56), SPH_C32(0xf9a4651f), - SPH_C32(0x500ca2c7) }, - { SPH_C32(0x54220003), SPH_C32(0x1dbc0500), SPH_C32(0x92940000), - SPH_C32(0x888a0000), SPH_C32(0x2d791451), SPH_C32(0xbabbffd6), - SPH_C32(0x0f197c29), SPH_C32(0x122c67e2), SPH_C32(0x7cd10007), - SPH_C32(0x2197b500), SPH_C32(0x28630000), SPH_C32(0x0b940000), - SPH_C32(0x544f1e7f), SPH_C32(0x6dcf5fc5), SPH_C32(0x893cd5b9), - SPH_C32(0x4afebd26) }, - { SPH_C32(0x99bb0003), SPH_C32(0xc9462400), SPH_C32(0x31aa0000), - SPH_C32(0xedce0000), SPH_C32(0xf480221d), SPH_C32(0x5d3d053d), - SPH_C32(0x7e5aaebc), SPH_C32(0x7932eaa2), SPH_C32(0x50920007), - SPH_C32(0x89efa700), SPH_C32(0x787f0000), SPH_C32(0x33f90000), - SPH_C32(0x6b002ed8), SPH_C32(0x2fe4c7a4), SPH_C32(0x4de77e08), - SPH_C32(0xd5739eec) }, - { SPH_C32(0x21860003), SPH_C32(0xdf372200), SPH_C32(0x06300000), - SPH_C32(0x187f0000), SPH_C32(0xd60143b1), SPH_C32(0xf375f478), - SPH_C32(0x187eb8aa), SPH_C32(0xbcf3019c), SPH_C32(0xadb70007), - SPH_C32(0x3a2bb600), SPH_C32(0xb68f0000), SPH_C32(0xfd000000), - SPH_C32(0x574d5b58), SPH_C32(0xa2bfa337), SPH_C32(0x3d7fceae), - SPH_C32(0xcf81810d) }, - { SPH_C32(0x50ff0004), SPH_C32(0x45744000), SPH_C32(0x3dfb0000), - SPH_C32(0x19e60000), SPH_C32(0x1bbc5606), SPH_C32(0xe1727b5d), - SPH_C32(0xe1a8cc96), SPH_C32(0x7b1bd6b9), SPH_C32(0xf6800005), - SPH_C32(0x3443c000), SPH_C32(0x24070000), SPH_C32(0x8f3d0000), - SPH_C32(0x21373bfb), SPH_C32(0x0ab8d5ae), SPH_C32(0xcdc58b19), - SPH_C32(0xd795ba31) }, - { SPH_C32(0xe8c20004), SPH_C32(0x53054600), SPH_C32(0x0a610000), - SPH_C32(0xec570000), SPH_C32(0x393d37aa), SPH_C32(0x4f3a8a18), - SPH_C32(0x878cda80), SPH_C32(0xbeda3d87), SPH_C32(0x0ba50005), - SPH_C32(0x8787d100), SPH_C32(0xeaf70000), SPH_C32(0x41c40000), - SPH_C32(0x1d7a4e7b), SPH_C32(0x87e3b13d), SPH_C32(0xbd5d3bbf), - SPH_C32(0xcd67a5d0) }, - { SPH_C32(0x255b0004), SPH_C32(0x87ff6700), SPH_C32(0xa95f0000), - SPH_C32(0x89130000), SPH_C32(0xe0c401e6), SPH_C32(0xa8bc70f3), - SPH_C32(0xf6cf0815), SPH_C32(0xd5c4b0c7), SPH_C32(0x27e60005), - SPH_C32(0x2fffc300), SPH_C32(0xbaeb0000), SPH_C32(0x79a90000), - SPH_C32(0x22357edc), SPH_C32(0xc5c8295c), SPH_C32(0x7986900e), - SPH_C32(0x52ea861a) }, - { SPH_C32(0x9d660004), SPH_C32(0x918e6100), SPH_C32(0x9ec50000), - SPH_C32(0x7ca20000), SPH_C32(0xc245604a), SPH_C32(0x06f481b6), - SPH_C32(0x90eb1e03), SPH_C32(0x10055bf9), SPH_C32(0xdac30005), - SPH_C32(0x9c3bd200), SPH_C32(0x741b0000), SPH_C32(0xb7500000), - SPH_C32(0x1e780b5c), SPH_C32(0x48934dcf), SPH_C32(0x091e20a8), - SPH_C32(0x481899fb) }, - { SPH_C32(0x81990004), SPH_C32(0x5ec84300), SPH_C32(0xa3170000), - SPH_C32(0xef720000), SPH_C32(0x18be1321), SPH_C32(0x2e0287af), - SPH_C32(0x55ebd781), SPH_C32(0xfe64ea92), SPH_C32(0x52420005), - SPH_C32(0xed74e400), SPH_C32(0x2e4f0000), SPH_C32(0xe95c0000), - SPH_C32(0xd94d293c), SPH_C32(0x8c0622f2), SPH_C32(0x6ee1548d), - SPH_C32(0xfc35e064) }, - { SPH_C32(0x39a40004), SPH_C32(0x48b94500), SPH_C32(0x948d0000), - SPH_C32(0x1ac30000), SPH_C32(0x3a3f728d), SPH_C32(0x804a76ea), - SPH_C32(0x33cfc197), SPH_C32(0x3ba501ac), SPH_C32(0xaf670005), - SPH_C32(0x5eb0f500), SPH_C32(0xe0bf0000), SPH_C32(0x27a50000), - SPH_C32(0xe5005cbc), SPH_C32(0x015d4661), SPH_C32(0x1e79e42b), - SPH_C32(0xe6c7ff85) }, - { SPH_C32(0xf43d0004), SPH_C32(0x9c436400), SPH_C32(0x37b30000), - SPH_C32(0x7f870000), SPH_C32(0xe3c644c1), SPH_C32(0x67cc8c01), - SPH_C32(0x428c1302), SPH_C32(0x50bb8cec), SPH_C32(0x83240005), - SPH_C32(0xf6c8e700), SPH_C32(0xb0a30000), SPH_C32(0x1fc80000), - SPH_C32(0xda4f6c1b), SPH_C32(0x4376de00), SPH_C32(0xdaa24f9a), - SPH_C32(0x794adc4f) }, - { SPH_C32(0x4c000004), SPH_C32(0x8a326200), SPH_C32(0x00290000), - SPH_C32(0x8a360000), SPH_C32(0xc147256d), SPH_C32(0xc9847d44), - SPH_C32(0x24a80514), SPH_C32(0x957a67d2), SPH_C32(0x7e010005), - SPH_C32(0x450cf600), SPH_C32(0x7e530000), SPH_C32(0xd1310000), - SPH_C32(0xe602199b), SPH_C32(0xce2dba93), SPH_C32(0xaa3aff3c), - SPH_C32(0x63b8c3ae) }, - { SPH_C32(0x25360007), SPH_C32(0x4b648000), SPH_C32(0xecdb0000), - SPH_C32(0xa30c0000), SPH_C32(0x90787938), SPH_C32(0x662acc0a), - SPH_C32(0x5a80ba8b), SPH_C32(0x7bacf892), SPH_C32(0x184f0004), - SPH_C32(0x5b158000), SPH_C32(0xd7390000), SPH_C32(0x28a30000), - SPH_C32(0x9c8249e2), SPH_C32(0xbda93e6b), SPH_C32(0x87fecba3), - SPH_C32(0x293e4865) }, - { SPH_C32(0x9d0b0007), SPH_C32(0x5d158600), SPH_C32(0xdb410000), - SPH_C32(0x56bd0000), SPH_C32(0xb2f91894), SPH_C32(0xc8623d4f), - SPH_C32(0x3ca4ac9d), SPH_C32(0xbe6d13ac), SPH_C32(0xe56a0004), - SPH_C32(0xe8d19100), SPH_C32(0x19c90000), SPH_C32(0xe65a0000), - SPH_C32(0xa0cf3c62), SPH_C32(0x30f25af8), SPH_C32(0xf7667b05), - SPH_C32(0x33cc5784) }, - { SPH_C32(0x50920007), SPH_C32(0x89efa700), SPH_C32(0x787f0000), - SPH_C32(0x33f90000), SPH_C32(0x6b002ed8), SPH_C32(0x2fe4c7a4), - SPH_C32(0x4de77e08), SPH_C32(0xd5739eec), SPH_C32(0xc9290004), - SPH_C32(0x40a98300), SPH_C32(0x49d50000), SPH_C32(0xde370000), - SPH_C32(0x9f800cc5), SPH_C32(0x72d9c299), SPH_C32(0x33bdd0b4), - SPH_C32(0xac41744e) }, - { SPH_C32(0xe8af0007), SPH_C32(0x9f9ea100), SPH_C32(0x4fe50000), - SPH_C32(0xc6480000), SPH_C32(0x49814f74), SPH_C32(0x81ac36e1), - SPH_C32(0x2bc3681e), SPH_C32(0x10b275d2), SPH_C32(0x340c0004), - SPH_C32(0xf36d9200), SPH_C32(0x87250000), SPH_C32(0x10ce0000), - SPH_C32(0xa3cd7945), SPH_C32(0xff82a60a), SPH_C32(0x43256012), - SPH_C32(0xb6b36baf) }, - { SPH_C32(0xf4500007), SPH_C32(0x50d88300), SPH_C32(0x72370000), - SPH_C32(0x55980000), SPH_C32(0x937a3c1f), SPH_C32(0xa95a30f8), - SPH_C32(0xeec3a19c), SPH_C32(0xfed3c4b9), SPH_C32(0xbc8d0004), - SPH_C32(0x8222a400), SPH_C32(0xdd710000), SPH_C32(0x4ec20000), - SPH_C32(0x64f85b25), SPH_C32(0x3b17c937), SPH_C32(0x24da1437), - SPH_C32(0x029e1230) }, - { SPH_C32(0x4c6d0007), SPH_C32(0x46a98500), SPH_C32(0x45ad0000), - SPH_C32(0xa0290000), SPH_C32(0xb1fb5db3), SPH_C32(0x0712c1bd), - SPH_C32(0x88e7b78a), SPH_C32(0x3b122f87), SPH_C32(0x41a80004), - SPH_C32(0x31e6b500), SPH_C32(0x13810000), SPH_C32(0x803b0000), - SPH_C32(0x58b52ea5), SPH_C32(0xb64cada4), SPH_C32(0x5442a491), - SPH_C32(0x186c0dd1) }, - { SPH_C32(0x81f40007), SPH_C32(0x9253a400), SPH_C32(0xe6930000), - SPH_C32(0xc56d0000), SPH_C32(0x68026bff), SPH_C32(0xe0943b56), - SPH_C32(0xf9a4651f), SPH_C32(0x500ca2c7), SPH_C32(0x6deb0004), - SPH_C32(0x999ea700), SPH_C32(0x439d0000), SPH_C32(0xb8560000), - SPH_C32(0x67fa1e02), SPH_C32(0xf46735c5), SPH_C32(0x90990f20), - SPH_C32(0x87e12e1b) }, - { SPH_C32(0x39c90007), SPH_C32(0x8422a200), SPH_C32(0xd1090000), - SPH_C32(0x30dc0000), SPH_C32(0x4a830a53), SPH_C32(0x4edcca13), - SPH_C32(0x9f807309), SPH_C32(0x95cd49f9), SPH_C32(0x90ce0004), - SPH_C32(0x2a5ab600), SPH_C32(0x8d6d0000), SPH_C32(0x76af0000), - SPH_C32(0x5bb76b82), SPH_C32(0x793c5156), SPH_C32(0xe001bf86), - SPH_C32(0x9d1331fa) }, - { SPH_C32(0xbe300005), SPH_C32(0x2a220000), SPH_C32(0xcec50000), - SPH_C32(0xbe780000), SPH_C32(0xa609241f), SPH_C32(0x56639098), - SPH_C32(0xab938c2c), SPH_C32(0x85b024ed), SPH_C32(0x6d860007), - SPH_C32(0x55054000), SPH_C32(0x06190000), SPH_C32(0x92490000), - SPH_C32(0x174666dc), SPH_C32(0x3af1893c), SPH_C32(0x3cd6bdbe), - SPH_C32(0x2989664e) }, - { SPH_C32(0x060d0005), SPH_C32(0x3c530600), SPH_C32(0xf95f0000), - SPH_C32(0x4bc90000), SPH_C32(0x848845b3), SPH_C32(0xf82b61dd), - SPH_C32(0xcdb79a3a), SPH_C32(0x4071cfd3), SPH_C32(0x90a30007), - SPH_C32(0xe6c15100), SPH_C32(0xc8e90000), SPH_C32(0x5cb00000), - SPH_C32(0x2b0b135c), SPH_C32(0xb7aaedaf), SPH_C32(0x4c4e0d18), - SPH_C32(0x337b79af) }, - { SPH_C32(0xcb940005), SPH_C32(0xe8a92700), SPH_C32(0x5a610000), - SPH_C32(0x2e8d0000), SPH_C32(0x5d7173ff), SPH_C32(0x1fad9b36), - SPH_C32(0xbcf448af), SPH_C32(0x2b6f4293), SPH_C32(0xbce00007), - SPH_C32(0x4eb94300), SPH_C32(0x98f50000), SPH_C32(0x64dd0000), - SPH_C32(0x144423fb), SPH_C32(0xf58175ce), SPH_C32(0x8895a6a9), - SPH_C32(0xacf65a65) }, - { SPH_C32(0x73a90005), SPH_C32(0xfed82100), SPH_C32(0x6dfb0000), - SPH_C32(0xdb3c0000), SPH_C32(0x7ff01253), SPH_C32(0xb1e56a73), - SPH_C32(0xdad05eb9), SPH_C32(0xeeaea9ad), SPH_C32(0x41c50007), - SPH_C32(0xfd7d5200), SPH_C32(0x56050000), SPH_C32(0xaa240000), - SPH_C32(0x2809567b), SPH_C32(0x78da115d), SPH_C32(0xf80d160f), - SPH_C32(0xb6044584) }, - { SPH_C32(0x6f560005), SPH_C32(0x319e0300), SPH_C32(0x50290000), - SPH_C32(0x48ec0000), SPH_C32(0xa50b6138), SPH_C32(0x99136c6a), - SPH_C32(0x1fd0973b), SPH_C32(0x00cf18c6), SPH_C32(0xc9440007), - SPH_C32(0x8c326400), SPH_C32(0x0c510000), SPH_C32(0xf4280000), - SPH_C32(0xef3c741b), SPH_C32(0xbc4f7e60), SPH_C32(0x9ff2622a), - SPH_C32(0x02293c1b) }, - { SPH_C32(0xd76b0005), SPH_C32(0x27ef0500), SPH_C32(0x67b30000), - SPH_C32(0xbd5d0000), SPH_C32(0x878a0094), SPH_C32(0x375b9d2f), - SPH_C32(0x79f4812d), SPH_C32(0xc50ef3f8), SPH_C32(0x34610007), - SPH_C32(0x3ff67500), SPH_C32(0xc2a10000), SPH_C32(0x3ad10000), - SPH_C32(0xd371019b), SPH_C32(0x31141af3), SPH_C32(0xef6ad28c), - SPH_C32(0x18db23fa) }, - { SPH_C32(0x1af20005), SPH_C32(0xf3152400), SPH_C32(0xc48d0000), - SPH_C32(0xd8190000), SPH_C32(0x5e7336d8), SPH_C32(0xd0dd67c4), - SPH_C32(0x08b753b8), SPH_C32(0xae107eb8), SPH_C32(0x18220007), - SPH_C32(0x978e6700), SPH_C32(0x92bd0000), SPH_C32(0x02bc0000), - SPH_C32(0xec3e313c), SPH_C32(0x733f8292), SPH_C32(0x2bb1793d), - SPH_C32(0x87560030) }, - { SPH_C32(0xa2cf0005), SPH_C32(0xe5642200), SPH_C32(0xf3170000), - SPH_C32(0x2da80000), SPH_C32(0x7cf25774), SPH_C32(0x7e959681), - SPH_C32(0x6e9345ae), SPH_C32(0x6bd19586), SPH_C32(0xe5070007), - SPH_C32(0x244a7600), SPH_C32(0x5c4d0000), SPH_C32(0xcc450000), - SPH_C32(0xd07344bc), SPH_C32(0xfe64e601), SPH_C32(0x5b29c99b), - SPH_C32(0x9da41fd1) }, - { SPH_C32(0xcbf90006), SPH_C32(0x2432c000), SPH_C32(0x1fe50000), - SPH_C32(0x04920000), SPH_C32(0x2dcd0b21), SPH_C32(0xd13b27cf), - SPH_C32(0x10bbfa31), SPH_C32(0x85070ac6), SPH_C32(0x83490006), - SPH_C32(0x3a530000), SPH_C32(0xf5270000), SPH_C32(0x35d70000), - SPH_C32(0xaaf314c5), SPH_C32(0x8de062f9), SPH_C32(0x76edfd04), - SPH_C32(0xd722941a) }, - { SPH_C32(0x73c40006), SPH_C32(0x3243c600), SPH_C32(0x287f0000), - SPH_C32(0xf1230000), SPH_C32(0x0f4c6a8d), SPH_C32(0x7f73d68a), - SPH_C32(0x769fec27), SPH_C32(0x40c6e1f8), SPH_C32(0x7e6c0006), - SPH_C32(0x89971100), SPH_C32(0x3bd70000), SPH_C32(0xfb2e0000), - SPH_C32(0x96be6145), SPH_C32(0x00bb066a), SPH_C32(0x06754da2), - SPH_C32(0xcdd08bfb) }, - { SPH_C32(0xbe5d0006), SPH_C32(0xe6b9e700), SPH_C32(0x8b410000), - SPH_C32(0x94670000), SPH_C32(0xd6b55cc1), SPH_C32(0x98f52c61), - SPH_C32(0x07dc3eb2), SPH_C32(0x2bd86cb8), SPH_C32(0x522f0006), - SPH_C32(0x21ef0300), SPH_C32(0x6bcb0000), SPH_C32(0xc3430000), - SPH_C32(0xa9f151e2), SPH_C32(0x42909e0b), SPH_C32(0xc2aee613), - SPH_C32(0x525da831) }, - { SPH_C32(0x06600006), SPH_C32(0xf0c8e100), SPH_C32(0xbcdb0000), - SPH_C32(0x61d60000), SPH_C32(0xf4343d6d), SPH_C32(0x36bddd24), - SPH_C32(0x61f828a4), SPH_C32(0xee198786), SPH_C32(0xaf0a0006), - SPH_C32(0x922b1200), SPH_C32(0xa53b0000), SPH_C32(0x0dba0000), - SPH_C32(0x95bc2462), SPH_C32(0xcfcbfa98), SPH_C32(0xb23656b5), - SPH_C32(0x48afb7d0) }, - { SPH_C32(0x1a9f0006), SPH_C32(0x3f8ec300), SPH_C32(0x81090000), - SPH_C32(0xf2060000), SPH_C32(0x2ecf4e06), SPH_C32(0x1e4bdb3d), - SPH_C32(0xa4f8e126), SPH_C32(0x007836ed), SPH_C32(0x278b0006), - SPH_C32(0xe3642400), SPH_C32(0xff6f0000), SPH_C32(0x53b60000), - SPH_C32(0x52890602), SPH_C32(0x0b5e95a5), SPH_C32(0xd5c92290), - SPH_C32(0xfc82ce4f) }, - { SPH_C32(0xa2a20006), SPH_C32(0x29ffc500), SPH_C32(0xb6930000), - SPH_C32(0x07b70000), SPH_C32(0x0c4e2faa), SPH_C32(0xb0032a78), - SPH_C32(0xc2dcf730), SPH_C32(0xc5b9ddd3), SPH_C32(0xdaae0006), - SPH_C32(0x50a03500), SPH_C32(0x319f0000), SPH_C32(0x9d4f0000), - SPH_C32(0x6ec47382), SPH_C32(0x8605f136), SPH_C32(0xa5519236), - SPH_C32(0xe670d1ae) }, - { SPH_C32(0x6f3b0006), SPH_C32(0xfd05e400), SPH_C32(0x15ad0000), - SPH_C32(0x62f30000), SPH_C32(0xd5b719e6), SPH_C32(0x5785d093), - SPH_C32(0xb39f25a5), SPH_C32(0xaea75093), SPH_C32(0xf6ed0006), - SPH_C32(0xf8d82700), SPH_C32(0x61830000), SPH_C32(0xa5220000), - SPH_C32(0x518b4325), SPH_C32(0xc42e6957), SPH_C32(0x618a3987), - SPH_C32(0x79fdf264) }, - { SPH_C32(0xd7060006), SPH_C32(0xeb74e200), SPH_C32(0x22370000), - SPH_C32(0x97420000), SPH_C32(0xf736784a), SPH_C32(0xf9cd21d6), - SPH_C32(0xd5bb33b3), SPH_C32(0x6b66bbad), SPH_C32(0x0bc80006), - SPH_C32(0x4b1c3600), SPH_C32(0xaf730000), SPH_C32(0x6bdb0000), - SPH_C32(0x6dc636a5), SPH_C32(0x49750dc4), SPH_C32(0x11128921), - SPH_C32(0x630fed85) } -}; - -static const sph_u32 T512_21[128][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x54500000), SPH_C32(0x0671005c), SPH_C32(0x25ae0000), - SPH_C32(0x6a1e0000), SPH_C32(0x2ea54edf), SPH_C32(0x664e8512), - SPH_C32(0xbfba18c3), SPH_C32(0x7e715d17), SPH_C32(0xbc8d0000), - SPH_C32(0xfc3b0018), SPH_C32(0x19830000), SPH_C32(0xd10b0000), - SPH_C32(0xae1878c4), SPH_C32(0x42a69856), SPH_C32(0x0012da37), - SPH_C32(0x2c3b504e) }, - { SPH_C32(0xbc8d0000), SPH_C32(0xfc3b0018), SPH_C32(0x19830000), - SPH_C32(0xd10b0000), SPH_C32(0xae1878c4), SPH_C32(0x42a69856), - SPH_C32(0x0012da37), SPH_C32(0x2c3b504e), SPH_C32(0xe8dd0000), - SPH_C32(0xfa4a0044), SPH_C32(0x3c2d0000), SPH_C32(0xbb150000), - SPH_C32(0x80bd361b), SPH_C32(0x24e81d44), SPH_C32(0xbfa8c2f4), - SPH_C32(0x524a0d59) }, - { SPH_C32(0xe8dd0000), SPH_C32(0xfa4a0044), SPH_C32(0x3c2d0000), - SPH_C32(0xbb150000), SPH_C32(0x80bd361b), SPH_C32(0x24e81d44), - SPH_C32(0xbfa8c2f4), SPH_C32(0x524a0d59), SPH_C32(0x54500000), - SPH_C32(0x0671005c), SPH_C32(0x25ae0000), SPH_C32(0x6a1e0000), - SPH_C32(0x2ea54edf), SPH_C32(0x664e8512), SPH_C32(0xbfba18c3), - SPH_C32(0x7e715d17) }, - { SPH_C32(0x69510000), SPH_C32(0xd4e1009c), SPH_C32(0xc3230000), - SPH_C32(0xac2f0000), SPH_C32(0xe4950bae), SPH_C32(0xcea415dc), - SPH_C32(0x87ec287c), SPH_C32(0xbce1a3ce), SPH_C32(0xc6730000), - SPH_C32(0xaf8d000c), SPH_C32(0xa4c10000), SPH_C32(0x218d0000), - SPH_C32(0x23111587), SPH_C32(0x7913512f), SPH_C32(0x1d28ac88), - SPH_C32(0x378dd173) }, - { SPH_C32(0x3d010000), SPH_C32(0xd29000c0), SPH_C32(0xe68d0000), - SPH_C32(0xc6310000), SPH_C32(0xca304571), SPH_C32(0xa8ea90ce), - SPH_C32(0x385630bf), SPH_C32(0xc290fed9), SPH_C32(0x7afe0000), - SPH_C32(0x53b60014), SPH_C32(0xbd420000), SPH_C32(0xf0860000), - SPH_C32(0x8d096d43), SPH_C32(0x3bb5c979), SPH_C32(0x1d3a76bf), - SPH_C32(0x1bb6813d) }, - { SPH_C32(0xd5dc0000), SPH_C32(0x28da0084), SPH_C32(0xdaa00000), - SPH_C32(0x7d240000), SPH_C32(0x4a8d736a), SPH_C32(0x8c028d8a), - SPH_C32(0x87fef24b), SPH_C32(0x90daf380), SPH_C32(0x2eae0000), - SPH_C32(0x55c70048), SPH_C32(0x98ec0000), SPH_C32(0x9a980000), - SPH_C32(0xa3ac239c), SPH_C32(0x5dfb4c6b), SPH_C32(0xa2806e7c), - SPH_C32(0x65c7dc2a) }, - { SPH_C32(0x818c0000), SPH_C32(0x2eab00d8), SPH_C32(0xff0e0000), - SPH_C32(0x173a0000), SPH_C32(0x64283db5), SPH_C32(0xea4c0898), - SPH_C32(0x3844ea88), SPH_C32(0xeeabae97), SPH_C32(0x92230000), - SPH_C32(0xa9fc0050), SPH_C32(0x816f0000), SPH_C32(0x4b930000), - SPH_C32(0x0db45b58), SPH_C32(0x1f5dd43d), SPH_C32(0xa292b44b), - SPH_C32(0x49fc8c64) }, - { SPH_C32(0xc6730000), SPH_C32(0xaf8d000c), SPH_C32(0xa4c10000), - SPH_C32(0x218d0000), SPH_C32(0x23111587), SPH_C32(0x7913512f), - SPH_C32(0x1d28ac88), SPH_C32(0x378dd173), SPH_C32(0xaf220000), - SPH_C32(0x7b6c0090), SPH_C32(0x67e20000), SPH_C32(0x8da20000), - SPH_C32(0xc7841e29), SPH_C32(0xb7b744f3), SPH_C32(0x9ac484f4), - SPH_C32(0x8b6c72bd) }, - { SPH_C32(0x92230000), SPH_C32(0xa9fc0050), SPH_C32(0x816f0000), - SPH_C32(0x4b930000), SPH_C32(0x0db45b58), SPH_C32(0x1f5dd43d), - SPH_C32(0xa292b44b), SPH_C32(0x49fc8c64), SPH_C32(0x13af0000), - SPH_C32(0x87570088), SPH_C32(0x7e610000), SPH_C32(0x5ca90000), - SPH_C32(0x699c66ed), SPH_C32(0xf511dca5), SPH_C32(0x9ad65ec3), - SPH_C32(0xa75722f3) }, - { SPH_C32(0x7afe0000), SPH_C32(0x53b60014), SPH_C32(0xbd420000), - SPH_C32(0xf0860000), SPH_C32(0x8d096d43), SPH_C32(0x3bb5c979), - SPH_C32(0x1d3a76bf), SPH_C32(0x1bb6813d), SPH_C32(0x47ff0000), - SPH_C32(0x812600d4), SPH_C32(0x5bcf0000), SPH_C32(0x36b70000), - SPH_C32(0x47392832), SPH_C32(0x935f59b7), SPH_C32(0x256c4600), - SPH_C32(0xd9267fe4) }, - { SPH_C32(0x2eae0000), SPH_C32(0x55c70048), SPH_C32(0x98ec0000), - SPH_C32(0x9a980000), SPH_C32(0xa3ac239c), SPH_C32(0x5dfb4c6b), - SPH_C32(0xa2806e7c), SPH_C32(0x65c7dc2a), SPH_C32(0xfb720000), - SPH_C32(0x7d1d00cc), SPH_C32(0x424c0000), SPH_C32(0xe7bc0000), - SPH_C32(0xe92150f6), SPH_C32(0xd1f9c1e1), SPH_C32(0x257e9c37), - SPH_C32(0xf51d2faa) }, - { SPH_C32(0xaf220000), SPH_C32(0x7b6c0090), SPH_C32(0x67e20000), - SPH_C32(0x8da20000), SPH_C32(0xc7841e29), SPH_C32(0xb7b744f3), - SPH_C32(0x9ac484f4), SPH_C32(0x8b6c72bd), SPH_C32(0x69510000), - SPH_C32(0xd4e1009c), SPH_C32(0xc3230000), SPH_C32(0xac2f0000), - SPH_C32(0xe4950bae), SPH_C32(0xcea415dc), SPH_C32(0x87ec287c), - SPH_C32(0xbce1a3ce) }, - { SPH_C32(0xfb720000), SPH_C32(0x7d1d00cc), SPH_C32(0x424c0000), - SPH_C32(0xe7bc0000), SPH_C32(0xe92150f6), SPH_C32(0xd1f9c1e1), - SPH_C32(0x257e9c37), SPH_C32(0xf51d2faa), SPH_C32(0xd5dc0000), - SPH_C32(0x28da0084), SPH_C32(0xdaa00000), SPH_C32(0x7d240000), - SPH_C32(0x4a8d736a), SPH_C32(0x8c028d8a), SPH_C32(0x87fef24b), - SPH_C32(0x90daf380) }, - { SPH_C32(0x13af0000), SPH_C32(0x87570088), SPH_C32(0x7e610000), - SPH_C32(0x5ca90000), SPH_C32(0x699c66ed), SPH_C32(0xf511dca5), - SPH_C32(0x9ad65ec3), SPH_C32(0xa75722f3), SPH_C32(0x818c0000), - SPH_C32(0x2eab00d8), SPH_C32(0xff0e0000), SPH_C32(0x173a0000), - SPH_C32(0x64283db5), SPH_C32(0xea4c0898), SPH_C32(0x3844ea88), - SPH_C32(0xeeabae97) }, - { SPH_C32(0x47ff0000), SPH_C32(0x812600d4), SPH_C32(0x5bcf0000), - SPH_C32(0x36b70000), SPH_C32(0x47392832), SPH_C32(0x935f59b7), - SPH_C32(0x256c4600), SPH_C32(0xd9267fe4), SPH_C32(0x3d010000), - SPH_C32(0xd29000c0), SPH_C32(0xe68d0000), SPH_C32(0xc6310000), - SPH_C32(0xca304571), SPH_C32(0xa8ea90ce), SPH_C32(0x385630bf), - SPH_C32(0xc290fed9) }, - { SPH_C32(0x0c720000), SPH_C32(0x49e50f00), SPH_C32(0x42790000), - SPH_C32(0x5cea0000), SPH_C32(0x33aa301a), SPH_C32(0x15822514), - SPH_C32(0x95a34b7b), SPH_C32(0xb44b0090), SPH_C32(0xfe220000), - SPH_C32(0xa7580500), SPH_C32(0x25d10000), SPH_C32(0xf7600000), - SPH_C32(0x893178da), SPH_C32(0x1fd4f860), SPH_C32(0x4ed0a315), - SPH_C32(0xa123ff9f) }, - { SPH_C32(0x58220000), SPH_C32(0x4f940f5c), SPH_C32(0x67d70000), - SPH_C32(0x36f40000), SPH_C32(0x1d0f7ec5), SPH_C32(0x73cca006), - SPH_C32(0x2a1953b8), SPH_C32(0xca3a5d87), SPH_C32(0x42af0000), - SPH_C32(0x5b630518), SPH_C32(0x3c520000), SPH_C32(0x266b0000), - SPH_C32(0x2729001e), SPH_C32(0x5d726036), SPH_C32(0x4ec27922), - SPH_C32(0x8d18afd1) }, - { SPH_C32(0xb0ff0000), SPH_C32(0xb5de0f18), SPH_C32(0x5bfa0000), - SPH_C32(0x8de10000), SPH_C32(0x9db248de), SPH_C32(0x5724bd42), - SPH_C32(0x95b1914c), SPH_C32(0x987050de), SPH_C32(0x16ff0000), - SPH_C32(0x5d120544), SPH_C32(0x19fc0000), SPH_C32(0x4c750000), - SPH_C32(0x098c4ec1), SPH_C32(0x3b3ce524), SPH_C32(0xf17861e1), - SPH_C32(0xf369f2c6) }, - { SPH_C32(0xe4af0000), SPH_C32(0xb3af0f44), SPH_C32(0x7e540000), - SPH_C32(0xe7ff0000), SPH_C32(0xb3170601), SPH_C32(0x316a3850), - SPH_C32(0x2a0b898f), SPH_C32(0xe6010dc9), SPH_C32(0xaa720000), - SPH_C32(0xa129055c), SPH_C32(0x007f0000), SPH_C32(0x9d7e0000), - SPH_C32(0xa7943605), SPH_C32(0x799a7d72), SPH_C32(0xf16abbd6), - SPH_C32(0xdf52a288) }, - { SPH_C32(0x65230000), SPH_C32(0x9d040f9c), SPH_C32(0x815a0000), - SPH_C32(0xf0c50000), SPH_C32(0xd73f3bb4), SPH_C32(0xdb2630c8), - SPH_C32(0x124f6307), SPH_C32(0x08aaa35e), SPH_C32(0x38510000), - SPH_C32(0x08d5050c), SPH_C32(0x81100000), SPH_C32(0xd6ed0000), - SPH_C32(0xaa206d5d), SPH_C32(0x66c7a94f), SPH_C32(0x53f80f9d), - SPH_C32(0x96ae2eec) }, - { SPH_C32(0x31730000), SPH_C32(0x9b750fc0), SPH_C32(0xa4f40000), - SPH_C32(0x9adb0000), SPH_C32(0xf99a756b), SPH_C32(0xbd68b5da), - SPH_C32(0xadf57bc4), SPH_C32(0x76dbfe49), SPH_C32(0x84dc0000), - SPH_C32(0xf4ee0514), SPH_C32(0x98930000), SPH_C32(0x07e60000), - SPH_C32(0x04381599), SPH_C32(0x24613119), SPH_C32(0x53ead5aa), - SPH_C32(0xba957ea2) }, - { SPH_C32(0xd9ae0000), SPH_C32(0x613f0f84), SPH_C32(0x98d90000), - SPH_C32(0x21ce0000), SPH_C32(0x79274370), SPH_C32(0x9980a89e), - SPH_C32(0x125db930), SPH_C32(0x2491f310), SPH_C32(0xd08c0000), - SPH_C32(0xf29f0548), SPH_C32(0xbd3d0000), SPH_C32(0x6df80000), - SPH_C32(0x2a9d5b46), SPH_C32(0x422fb40b), SPH_C32(0xec50cd69), - SPH_C32(0xc4e423b5) }, - { SPH_C32(0x8dfe0000), SPH_C32(0x674e0fd8), SPH_C32(0xbd770000), - SPH_C32(0x4bd00000), SPH_C32(0x57820daf), SPH_C32(0xffce2d8c), - SPH_C32(0xade7a1f3), SPH_C32(0x5ae0ae07), SPH_C32(0x6c010000), - SPH_C32(0x0ea40550), SPH_C32(0xa4be0000), SPH_C32(0xbcf30000), - SPH_C32(0x84852382), SPH_C32(0x00892c5d), SPH_C32(0xec42175e), - SPH_C32(0xe8df73fb) }, - { SPH_C32(0xca010000), SPH_C32(0xe6680f0c), SPH_C32(0xe6b80000), - SPH_C32(0x7d670000), SPH_C32(0x10bb259d), SPH_C32(0x6c91743b), - SPH_C32(0x888be7f3), SPH_C32(0x83c6d1e3), SPH_C32(0x51000000), - SPH_C32(0xdc340590), SPH_C32(0x42330000), SPH_C32(0x7ac20000), - SPH_C32(0x4eb566f3), SPH_C32(0xa863bc93), SPH_C32(0xd41427e1), - SPH_C32(0x2a4f8d22) }, - { SPH_C32(0x9e510000), SPH_C32(0xe0190f50), SPH_C32(0xc3160000), - SPH_C32(0x17790000), SPH_C32(0x3e1e6b42), SPH_C32(0x0adff129), - SPH_C32(0x3731ff30), SPH_C32(0xfdb78cf4), SPH_C32(0xed8d0000), - SPH_C32(0x200f0588), SPH_C32(0x5bb00000), SPH_C32(0xabc90000), - SPH_C32(0xe0ad1e37), SPH_C32(0xeac524c5), SPH_C32(0xd406fdd6), - SPH_C32(0x0674dd6c) }, - { SPH_C32(0x768c0000), SPH_C32(0x1a530f14), SPH_C32(0xff3b0000), - SPH_C32(0xac6c0000), SPH_C32(0xbea35d59), SPH_C32(0x2e37ec6d), - SPH_C32(0x88993dc4), SPH_C32(0xaffd81ad), SPH_C32(0xb9dd0000), - SPH_C32(0x267e05d4), SPH_C32(0x7e1e0000), SPH_C32(0xc1d70000), - SPH_C32(0xce0850e8), SPH_C32(0x8c8ba1d7), SPH_C32(0x6bbce515), - SPH_C32(0x7805807b) }, - { SPH_C32(0x22dc0000), SPH_C32(0x1c220f48), SPH_C32(0xda950000), - SPH_C32(0xc6720000), SPH_C32(0x90061386), SPH_C32(0x4879697f), - SPH_C32(0x37232507), SPH_C32(0xd18cdcba), SPH_C32(0x05500000), - SPH_C32(0xda4505cc), SPH_C32(0x679d0000), SPH_C32(0x10dc0000), - SPH_C32(0x6010282c), SPH_C32(0xce2d3981), SPH_C32(0x6bae3f22), - SPH_C32(0x543ed035) }, - { SPH_C32(0xa3500000), SPH_C32(0x32890f90), SPH_C32(0x259b0000), - SPH_C32(0xd1480000), SPH_C32(0xf42e2e33), SPH_C32(0xa23561e7), - SPH_C32(0x0f67cf8f), SPH_C32(0x3f27722d), SPH_C32(0x97730000), - SPH_C32(0x73b9059c), SPH_C32(0xe6f20000), SPH_C32(0x5b4f0000), - SPH_C32(0x6da47374), SPH_C32(0xd170edbc), SPH_C32(0xc93c8b69), - SPH_C32(0x1dc25c51) }, - { SPH_C32(0xf7000000), SPH_C32(0x34f80fcc), SPH_C32(0x00350000), - SPH_C32(0xbb560000), SPH_C32(0xda8b60ec), SPH_C32(0xc47be4f5), - SPH_C32(0xb0ddd74c), SPH_C32(0x41562f3a), SPH_C32(0x2bfe0000), - SPH_C32(0x8f820584), SPH_C32(0xff710000), SPH_C32(0x8a440000), - SPH_C32(0xc3bc0bb0), SPH_C32(0x93d675ea), SPH_C32(0xc92e515e), - SPH_C32(0x31f90c1f) }, - { SPH_C32(0x1fdd0000), SPH_C32(0xceb20f88), SPH_C32(0x3c180000), - SPH_C32(0x00430000), SPH_C32(0x5a3656f7), SPH_C32(0xe093f9b1), - SPH_C32(0x0f7515b8), SPH_C32(0x131c2263), SPH_C32(0x7fae0000), - SPH_C32(0x89f305d8), SPH_C32(0xdadf0000), SPH_C32(0xe05a0000), - SPH_C32(0xed19456f), SPH_C32(0xf598f0f8), SPH_C32(0x7694499d), - SPH_C32(0x4f885108) }, - { SPH_C32(0x4b8d0000), SPH_C32(0xc8c30fd4), SPH_C32(0x19b60000), - SPH_C32(0x6a5d0000), SPH_C32(0x74931828), SPH_C32(0x86dd7ca3), - SPH_C32(0xb0cf0d7b), SPH_C32(0x6d6d7f74), SPH_C32(0xc3230000), - SPH_C32(0x75c805c0), SPH_C32(0xc35c0000), SPH_C32(0x31510000), - SPH_C32(0x43013dab), SPH_C32(0xb73e68ae), SPH_C32(0x768693aa), - SPH_C32(0x63b30146) }, - { SPH_C32(0xfe220000), SPH_C32(0xa7580500), SPH_C32(0x25d10000), - SPH_C32(0xf7600000), SPH_C32(0x893178da), SPH_C32(0x1fd4f860), - SPH_C32(0x4ed0a315), SPH_C32(0xa123ff9f), SPH_C32(0xf2500000), - SPH_C32(0xeebd0a00), SPH_C32(0x67a80000), SPH_C32(0xab8a0000), - SPH_C32(0xba9b48c0), SPH_C32(0x0a56dd74), SPH_C32(0xdb73e86e), - SPH_C32(0x1568ff0f) }, - { SPH_C32(0xaa720000), SPH_C32(0xa129055c), SPH_C32(0x007f0000), - SPH_C32(0x9d7e0000), SPH_C32(0xa7943605), SPH_C32(0x799a7d72), - SPH_C32(0xf16abbd6), SPH_C32(0xdf52a288), SPH_C32(0x4edd0000), - SPH_C32(0x12860a18), SPH_C32(0x7e2b0000), SPH_C32(0x7a810000), - SPH_C32(0x14833004), SPH_C32(0x48f04522), SPH_C32(0xdb613259), - SPH_C32(0x3953af41) }, - { SPH_C32(0x42af0000), SPH_C32(0x5b630518), SPH_C32(0x3c520000), - SPH_C32(0x266b0000), SPH_C32(0x2729001e), SPH_C32(0x5d726036), - SPH_C32(0x4ec27922), SPH_C32(0x8d18afd1), SPH_C32(0x1a8d0000), - SPH_C32(0x14f70a44), SPH_C32(0x5b850000), SPH_C32(0x109f0000), - SPH_C32(0x3a267edb), SPH_C32(0x2ebec030), SPH_C32(0x64db2a9a), - SPH_C32(0x4722f256) }, - { SPH_C32(0x16ff0000), SPH_C32(0x5d120544), SPH_C32(0x19fc0000), - SPH_C32(0x4c750000), SPH_C32(0x098c4ec1), SPH_C32(0x3b3ce524), - SPH_C32(0xf17861e1), SPH_C32(0xf369f2c6), SPH_C32(0xa6000000), - SPH_C32(0xe8cc0a5c), SPH_C32(0x42060000), SPH_C32(0xc1940000), - SPH_C32(0x943e061f), SPH_C32(0x6c185866), SPH_C32(0x64c9f0ad), - SPH_C32(0x6b19a218) }, - { SPH_C32(0x97730000), SPH_C32(0x73b9059c), SPH_C32(0xe6f20000), - SPH_C32(0x5b4f0000), SPH_C32(0x6da47374), SPH_C32(0xd170edbc), - SPH_C32(0xc93c8b69), SPH_C32(0x1dc25c51), SPH_C32(0x34230000), - SPH_C32(0x41300a0c), SPH_C32(0xc3690000), SPH_C32(0x8a070000), - SPH_C32(0x998a5d47), SPH_C32(0x73458c5b), SPH_C32(0xc65b44e6), - SPH_C32(0x22e52e7c) }, - { SPH_C32(0xc3230000), SPH_C32(0x75c805c0), SPH_C32(0xc35c0000), - SPH_C32(0x31510000), SPH_C32(0x43013dab), SPH_C32(0xb73e68ae), - SPH_C32(0x768693aa), SPH_C32(0x63b30146), SPH_C32(0x88ae0000), - SPH_C32(0xbd0b0a14), SPH_C32(0xdaea0000), SPH_C32(0x5b0c0000), - SPH_C32(0x37922583), SPH_C32(0x31e3140d), SPH_C32(0xc6499ed1), - SPH_C32(0x0ede7e32) }, - { SPH_C32(0x2bfe0000), SPH_C32(0x8f820584), SPH_C32(0xff710000), - SPH_C32(0x8a440000), SPH_C32(0xc3bc0bb0), SPH_C32(0x93d675ea), - SPH_C32(0xc92e515e), SPH_C32(0x31f90c1f), SPH_C32(0xdcfe0000), - SPH_C32(0xbb7a0a48), SPH_C32(0xff440000), SPH_C32(0x31120000), - SPH_C32(0x19376b5c), SPH_C32(0x57ad911f), SPH_C32(0x79f38612), - SPH_C32(0x70af2325) }, - { SPH_C32(0x7fae0000), SPH_C32(0x89f305d8), SPH_C32(0xdadf0000), - SPH_C32(0xe05a0000), SPH_C32(0xed19456f), SPH_C32(0xf598f0f8), - SPH_C32(0x7694499d), SPH_C32(0x4f885108), SPH_C32(0x60730000), - SPH_C32(0x47410a50), SPH_C32(0xe6c70000), SPH_C32(0xe0190000), - SPH_C32(0xb72f1398), SPH_C32(0x150b0949), SPH_C32(0x79e15c25), - SPH_C32(0x5c94736b) }, - { SPH_C32(0x38510000), SPH_C32(0x08d5050c), SPH_C32(0x81100000), - SPH_C32(0xd6ed0000), SPH_C32(0xaa206d5d), SPH_C32(0x66c7a94f), - SPH_C32(0x53f80f9d), SPH_C32(0x96ae2eec), SPH_C32(0x5d720000), - SPH_C32(0x95d10a90), SPH_C32(0x004a0000), SPH_C32(0x26280000), - SPH_C32(0x7d1f56e9), SPH_C32(0xbde19987), SPH_C32(0x41b76c9a), - SPH_C32(0x9e048db2) }, - { SPH_C32(0x6c010000), SPH_C32(0x0ea40550), SPH_C32(0xa4be0000), - SPH_C32(0xbcf30000), SPH_C32(0x84852382), SPH_C32(0x00892c5d), - SPH_C32(0xec42175e), SPH_C32(0xe8df73fb), SPH_C32(0xe1ff0000), - SPH_C32(0x69ea0a88), SPH_C32(0x19c90000), SPH_C32(0xf7230000), - SPH_C32(0xd3072e2d), SPH_C32(0xff4701d1), SPH_C32(0x41a5b6ad), - SPH_C32(0xb23fddfc) }, - { SPH_C32(0x84dc0000), SPH_C32(0xf4ee0514), SPH_C32(0x98930000), - SPH_C32(0x07e60000), SPH_C32(0x04381599), SPH_C32(0x24613119), - SPH_C32(0x53ead5aa), SPH_C32(0xba957ea2), SPH_C32(0xb5af0000), - SPH_C32(0x6f9b0ad4), SPH_C32(0x3c670000), SPH_C32(0x9d3d0000), - SPH_C32(0xfda260f2), SPH_C32(0x990984c3), SPH_C32(0xfe1fae6e), - SPH_C32(0xcc4e80eb) }, - { SPH_C32(0xd08c0000), SPH_C32(0xf29f0548), SPH_C32(0xbd3d0000), - SPH_C32(0x6df80000), SPH_C32(0x2a9d5b46), SPH_C32(0x422fb40b), - SPH_C32(0xec50cd69), SPH_C32(0xc4e423b5), SPH_C32(0x09220000), - SPH_C32(0x93a00acc), SPH_C32(0x25e40000), SPH_C32(0x4c360000), - SPH_C32(0x53ba1836), SPH_C32(0xdbaf1c95), SPH_C32(0xfe0d7459), - SPH_C32(0xe075d0a5) }, - { SPH_C32(0x51000000), SPH_C32(0xdc340590), SPH_C32(0x42330000), - SPH_C32(0x7ac20000), SPH_C32(0x4eb566f3), SPH_C32(0xa863bc93), - SPH_C32(0xd41427e1), SPH_C32(0x2a4f8d22), SPH_C32(0x9b010000), - SPH_C32(0x3a5c0a9c), SPH_C32(0xa48b0000), SPH_C32(0x07a50000), - SPH_C32(0x5e0e436e), SPH_C32(0xc4f2c8a8), SPH_C32(0x5c9fc012), - SPH_C32(0xa9895cc1) }, - { SPH_C32(0x05500000), SPH_C32(0xda4505cc), SPH_C32(0x679d0000), - SPH_C32(0x10dc0000), SPH_C32(0x6010282c), SPH_C32(0xce2d3981), - SPH_C32(0x6bae3f22), SPH_C32(0x543ed035), SPH_C32(0x278c0000), - SPH_C32(0xc6670a84), SPH_C32(0xbd080000), SPH_C32(0xd6ae0000), - SPH_C32(0xf0163baa), SPH_C32(0x865450fe), SPH_C32(0x5c8d1a25), - SPH_C32(0x85b20c8f) }, - { SPH_C32(0xed8d0000), SPH_C32(0x200f0588), SPH_C32(0x5bb00000), - SPH_C32(0xabc90000), SPH_C32(0xe0ad1e37), SPH_C32(0xeac524c5), - SPH_C32(0xd406fdd6), SPH_C32(0x0674dd6c), SPH_C32(0x73dc0000), - SPH_C32(0xc0160ad8), SPH_C32(0x98a60000), SPH_C32(0xbcb00000), - SPH_C32(0xdeb37575), SPH_C32(0xe01ad5ec), SPH_C32(0xe33702e6), - SPH_C32(0xfbc35198) }, - { SPH_C32(0xb9dd0000), SPH_C32(0x267e05d4), SPH_C32(0x7e1e0000), - SPH_C32(0xc1d70000), SPH_C32(0xce0850e8), SPH_C32(0x8c8ba1d7), - SPH_C32(0x6bbce515), SPH_C32(0x7805807b), SPH_C32(0xcf510000), - SPH_C32(0x3c2d0ac0), SPH_C32(0x81250000), SPH_C32(0x6dbb0000), - SPH_C32(0x70ab0db1), SPH_C32(0xa2bc4dba), SPH_C32(0xe325d8d1), - SPH_C32(0xd7f801d6) }, - { SPH_C32(0xf2500000), SPH_C32(0xeebd0a00), SPH_C32(0x67a80000), - SPH_C32(0xab8a0000), SPH_C32(0xba9b48c0), SPH_C32(0x0a56dd74), - SPH_C32(0xdb73e86e), SPH_C32(0x1568ff0f), SPH_C32(0x0c720000), - SPH_C32(0x49e50f00), SPH_C32(0x42790000), SPH_C32(0x5cea0000), - SPH_C32(0x33aa301a), SPH_C32(0x15822514), SPH_C32(0x95a34b7b), - SPH_C32(0xb44b0090) }, - { SPH_C32(0xa6000000), SPH_C32(0xe8cc0a5c), SPH_C32(0x42060000), - SPH_C32(0xc1940000), SPH_C32(0x943e061f), SPH_C32(0x6c185866), - SPH_C32(0x64c9f0ad), SPH_C32(0x6b19a218), SPH_C32(0xb0ff0000), - SPH_C32(0xb5de0f18), SPH_C32(0x5bfa0000), SPH_C32(0x8de10000), - SPH_C32(0x9db248de), SPH_C32(0x5724bd42), SPH_C32(0x95b1914c), - SPH_C32(0x987050de) }, - { SPH_C32(0x4edd0000), SPH_C32(0x12860a18), SPH_C32(0x7e2b0000), - SPH_C32(0x7a810000), SPH_C32(0x14833004), SPH_C32(0x48f04522), - SPH_C32(0xdb613259), SPH_C32(0x3953af41), SPH_C32(0xe4af0000), - SPH_C32(0xb3af0f44), SPH_C32(0x7e540000), SPH_C32(0xe7ff0000), - SPH_C32(0xb3170601), SPH_C32(0x316a3850), SPH_C32(0x2a0b898f), - SPH_C32(0xe6010dc9) }, - { SPH_C32(0x1a8d0000), SPH_C32(0x14f70a44), SPH_C32(0x5b850000), - SPH_C32(0x109f0000), SPH_C32(0x3a267edb), SPH_C32(0x2ebec030), - SPH_C32(0x64db2a9a), SPH_C32(0x4722f256), SPH_C32(0x58220000), - SPH_C32(0x4f940f5c), SPH_C32(0x67d70000), SPH_C32(0x36f40000), - SPH_C32(0x1d0f7ec5), SPH_C32(0x73cca006), SPH_C32(0x2a1953b8), - SPH_C32(0xca3a5d87) }, - { SPH_C32(0x9b010000), SPH_C32(0x3a5c0a9c), SPH_C32(0xa48b0000), - SPH_C32(0x07a50000), SPH_C32(0x5e0e436e), SPH_C32(0xc4f2c8a8), - SPH_C32(0x5c9fc012), SPH_C32(0xa9895cc1), SPH_C32(0xca010000), - SPH_C32(0xe6680f0c), SPH_C32(0xe6b80000), SPH_C32(0x7d670000), - SPH_C32(0x10bb259d), SPH_C32(0x6c91743b), SPH_C32(0x888be7f3), - SPH_C32(0x83c6d1e3) }, - { SPH_C32(0xcf510000), SPH_C32(0x3c2d0ac0), SPH_C32(0x81250000), - SPH_C32(0x6dbb0000), SPH_C32(0x70ab0db1), SPH_C32(0xa2bc4dba), - SPH_C32(0xe325d8d1), SPH_C32(0xd7f801d6), SPH_C32(0x768c0000), - SPH_C32(0x1a530f14), SPH_C32(0xff3b0000), SPH_C32(0xac6c0000), - SPH_C32(0xbea35d59), SPH_C32(0x2e37ec6d), SPH_C32(0x88993dc4), - SPH_C32(0xaffd81ad) }, - { SPH_C32(0x278c0000), SPH_C32(0xc6670a84), SPH_C32(0xbd080000), - SPH_C32(0xd6ae0000), SPH_C32(0xf0163baa), SPH_C32(0x865450fe), - SPH_C32(0x5c8d1a25), SPH_C32(0x85b20c8f), SPH_C32(0x22dc0000), - SPH_C32(0x1c220f48), SPH_C32(0xda950000), SPH_C32(0xc6720000), - SPH_C32(0x90061386), SPH_C32(0x4879697f), SPH_C32(0x37232507), - SPH_C32(0xd18cdcba) }, - { SPH_C32(0x73dc0000), SPH_C32(0xc0160ad8), SPH_C32(0x98a60000), - SPH_C32(0xbcb00000), SPH_C32(0xdeb37575), SPH_C32(0xe01ad5ec), - SPH_C32(0xe33702e6), SPH_C32(0xfbc35198), SPH_C32(0x9e510000), - SPH_C32(0xe0190f50), SPH_C32(0xc3160000), SPH_C32(0x17790000), - SPH_C32(0x3e1e6b42), SPH_C32(0x0adff129), SPH_C32(0x3731ff30), - SPH_C32(0xfdb78cf4) }, - { SPH_C32(0x34230000), SPH_C32(0x41300a0c), SPH_C32(0xc3690000), - SPH_C32(0x8a070000), SPH_C32(0x998a5d47), SPH_C32(0x73458c5b), - SPH_C32(0xc65b44e6), SPH_C32(0x22e52e7c), SPH_C32(0xa3500000), - SPH_C32(0x32890f90), SPH_C32(0x259b0000), SPH_C32(0xd1480000), - SPH_C32(0xf42e2e33), SPH_C32(0xa23561e7), SPH_C32(0x0f67cf8f), - SPH_C32(0x3f27722d) }, - { SPH_C32(0x60730000), SPH_C32(0x47410a50), SPH_C32(0xe6c70000), - SPH_C32(0xe0190000), SPH_C32(0xb72f1398), SPH_C32(0x150b0949), - SPH_C32(0x79e15c25), SPH_C32(0x5c94736b), SPH_C32(0x1fdd0000), - SPH_C32(0xceb20f88), SPH_C32(0x3c180000), SPH_C32(0x00430000), - SPH_C32(0x5a3656f7), SPH_C32(0xe093f9b1), SPH_C32(0x0f7515b8), - SPH_C32(0x131c2263) }, - { SPH_C32(0x88ae0000), SPH_C32(0xbd0b0a14), SPH_C32(0xdaea0000), - SPH_C32(0x5b0c0000), SPH_C32(0x37922583), SPH_C32(0x31e3140d), - SPH_C32(0xc6499ed1), SPH_C32(0x0ede7e32), SPH_C32(0x4b8d0000), - SPH_C32(0xc8c30fd4), SPH_C32(0x19b60000), SPH_C32(0x6a5d0000), - SPH_C32(0x74931828), SPH_C32(0x86dd7ca3), SPH_C32(0xb0cf0d7b), - SPH_C32(0x6d6d7f74) }, - { SPH_C32(0xdcfe0000), SPH_C32(0xbb7a0a48), SPH_C32(0xff440000), - SPH_C32(0x31120000), SPH_C32(0x19376b5c), SPH_C32(0x57ad911f), - SPH_C32(0x79f38612), SPH_C32(0x70af2325), SPH_C32(0xf7000000), - SPH_C32(0x34f80fcc), SPH_C32(0x00350000), SPH_C32(0xbb560000), - SPH_C32(0xda8b60ec), SPH_C32(0xc47be4f5), SPH_C32(0xb0ddd74c), - SPH_C32(0x41562f3a) }, - { SPH_C32(0x5d720000), SPH_C32(0x95d10a90), SPH_C32(0x004a0000), - SPH_C32(0x26280000), SPH_C32(0x7d1f56e9), SPH_C32(0xbde19987), - SPH_C32(0x41b76c9a), SPH_C32(0x9e048db2), SPH_C32(0x65230000), - SPH_C32(0x9d040f9c), SPH_C32(0x815a0000), SPH_C32(0xf0c50000), - SPH_C32(0xd73f3bb4), SPH_C32(0xdb2630c8), SPH_C32(0x124f6307), - SPH_C32(0x08aaa35e) }, - { SPH_C32(0x09220000), SPH_C32(0x93a00acc), SPH_C32(0x25e40000), - SPH_C32(0x4c360000), SPH_C32(0x53ba1836), SPH_C32(0xdbaf1c95), - SPH_C32(0xfe0d7459), SPH_C32(0xe075d0a5), SPH_C32(0xd9ae0000), - SPH_C32(0x613f0f84), SPH_C32(0x98d90000), SPH_C32(0x21ce0000), - SPH_C32(0x79274370), SPH_C32(0x9980a89e), SPH_C32(0x125db930), - SPH_C32(0x2491f310) }, - { SPH_C32(0xe1ff0000), SPH_C32(0x69ea0a88), SPH_C32(0x19c90000), - SPH_C32(0xf7230000), SPH_C32(0xd3072e2d), SPH_C32(0xff4701d1), - SPH_C32(0x41a5b6ad), SPH_C32(0xb23fddfc), SPH_C32(0x8dfe0000), - SPH_C32(0x674e0fd8), SPH_C32(0xbd770000), SPH_C32(0x4bd00000), - SPH_C32(0x57820daf), SPH_C32(0xffce2d8c), SPH_C32(0xade7a1f3), - SPH_C32(0x5ae0ae07) }, - { SPH_C32(0xb5af0000), SPH_C32(0x6f9b0ad4), SPH_C32(0x3c670000), - SPH_C32(0x9d3d0000), SPH_C32(0xfda260f2), SPH_C32(0x990984c3), - SPH_C32(0xfe1fae6e), SPH_C32(0xcc4e80eb), SPH_C32(0x31730000), - SPH_C32(0x9b750fc0), SPH_C32(0xa4f40000), SPH_C32(0x9adb0000), - SPH_C32(0xf99a756b), SPH_C32(0xbd68b5da), SPH_C32(0xadf57bc4), - SPH_C32(0x76dbfe49) }, - { SPH_C32(0x45180000), SPH_C32(0xa5b51700), SPH_C32(0xf96a0000), - SPH_C32(0x3b480000), SPH_C32(0x1ecc142c), SPH_C32(0x231395d6), - SPH_C32(0x16bca6b0), SPH_C32(0xdf33f4df), SPH_C32(0xb83d0000), - SPH_C32(0x16710600), SPH_C32(0x379a0000), SPH_C32(0xf5b10000), - SPH_C32(0x228161ac), SPH_C32(0xae48f145), SPH_C32(0x66241616), - SPH_C32(0xc5c1eb3e) }, - { SPH_C32(0x11480000), SPH_C32(0xa3c4175c), SPH_C32(0xdcc40000), - SPH_C32(0x51560000), SPH_C32(0x30695af3), SPH_C32(0x455d10c4), - SPH_C32(0xa906be73), SPH_C32(0xa142a9c8), SPH_C32(0x04b00000), - SPH_C32(0xea4a0618), SPH_C32(0x2e190000), SPH_C32(0x24ba0000), - SPH_C32(0x8c991968), SPH_C32(0xecee6913), SPH_C32(0x6636cc21), - SPH_C32(0xe9fabb70) }, - { SPH_C32(0xf9950000), SPH_C32(0x598e1718), SPH_C32(0xe0e90000), - SPH_C32(0xea430000), SPH_C32(0xb0d46ce8), SPH_C32(0x61b50d80), - SPH_C32(0x16ae7c87), SPH_C32(0xf308a491), SPH_C32(0x50e00000), - SPH_C32(0xec3b0644), SPH_C32(0x0bb70000), SPH_C32(0x4ea40000), - SPH_C32(0xa23c57b7), SPH_C32(0x8aa0ec01), SPH_C32(0xd98cd4e2), - SPH_C32(0x978be667) }, - { SPH_C32(0xadc50000), SPH_C32(0x5fff1744), SPH_C32(0xc5470000), - SPH_C32(0x805d0000), SPH_C32(0x9e712237), SPH_C32(0x07fb8892), - SPH_C32(0xa9146444), SPH_C32(0x8d79f986), SPH_C32(0xec6d0000), - SPH_C32(0x1000065c), SPH_C32(0x12340000), SPH_C32(0x9faf0000), - SPH_C32(0x0c242f73), SPH_C32(0xc8067457), SPH_C32(0xd99e0ed5), - SPH_C32(0xbbb0b629) }, - { SPH_C32(0x2c490000), SPH_C32(0x7154179c), SPH_C32(0x3a490000), - SPH_C32(0x97670000), SPH_C32(0xfa591f82), SPH_C32(0xedb7800a), - SPH_C32(0x91508ecc), SPH_C32(0x63d25711), SPH_C32(0x7e4e0000), - SPH_C32(0xb9fc060c), SPH_C32(0x935b0000), SPH_C32(0xd43c0000), - SPH_C32(0x0190742b), SPH_C32(0xd75ba06a), SPH_C32(0x7b0cba9e), - SPH_C32(0xf24c3a4d) }, - { SPH_C32(0x78190000), SPH_C32(0x772517c0), SPH_C32(0x1fe70000), - SPH_C32(0xfd790000), SPH_C32(0xd4fc515d), SPH_C32(0x8bf90518), - SPH_C32(0x2eea960f), SPH_C32(0x1da30a06), SPH_C32(0xc2c30000), - SPH_C32(0x45c70614), SPH_C32(0x8ad80000), SPH_C32(0x05370000), - SPH_C32(0xaf880cef), SPH_C32(0x95fd383c), SPH_C32(0x7b1e60a9), - SPH_C32(0xde776a03) }, - { SPH_C32(0x90c40000), SPH_C32(0x8d6f1784), SPH_C32(0x23ca0000), - SPH_C32(0x466c0000), SPH_C32(0x54416746), SPH_C32(0xaf11185c), - SPH_C32(0x914254fb), SPH_C32(0x4fe9075f), SPH_C32(0x96930000), - SPH_C32(0x43b60648), SPH_C32(0xaf760000), SPH_C32(0x6f290000), - SPH_C32(0x812d4230), SPH_C32(0xf3b3bd2e), SPH_C32(0xc4a4786a), - SPH_C32(0xa0063714) }, - { SPH_C32(0xc4940000), SPH_C32(0x8b1e17d8), SPH_C32(0x06640000), - SPH_C32(0x2c720000), SPH_C32(0x7ae42999), SPH_C32(0xc95f9d4e), - SPH_C32(0x2ef84c38), SPH_C32(0x31985a48), SPH_C32(0x2a1e0000), - SPH_C32(0xbf8d0650), SPH_C32(0xb6f50000), SPH_C32(0xbe220000), - SPH_C32(0x2f353af4), SPH_C32(0xb1152578), SPH_C32(0xc4b6a25d), - SPH_C32(0x8c3d675a) }, - { SPH_C32(0x836b0000), SPH_C32(0x0a38170c), SPH_C32(0x5dab0000), - SPH_C32(0x1ac50000), SPH_C32(0x3ddd01ab), SPH_C32(0x5a00c4f9), - SPH_C32(0x0b940a38), SPH_C32(0xe8be25ac), SPH_C32(0x171f0000), - SPH_C32(0x6d1d0690), SPH_C32(0x50780000), SPH_C32(0x78130000), - SPH_C32(0xe5057f85), SPH_C32(0x19ffb5b6), SPH_C32(0xfce092e2), - SPH_C32(0x4ead9983) }, - { SPH_C32(0xd73b0000), SPH_C32(0x0c491750), SPH_C32(0x78050000), - SPH_C32(0x70db0000), SPH_C32(0x13784f74), SPH_C32(0x3c4e41eb), - SPH_C32(0xb42e12fb), SPH_C32(0x96cf78bb), SPH_C32(0xab920000), - SPH_C32(0x91260688), SPH_C32(0x49fb0000), SPH_C32(0xa9180000), - SPH_C32(0x4b1d0741), SPH_C32(0x5b592de0), SPH_C32(0xfcf248d5), - SPH_C32(0x6296c9cd) }, - { SPH_C32(0x3fe60000), SPH_C32(0xf6031714), SPH_C32(0x44280000), - SPH_C32(0xcbce0000), SPH_C32(0x93c5796f), SPH_C32(0x18a65caf), - SPH_C32(0x0b86d00f), SPH_C32(0xc48575e2), SPH_C32(0xffc20000), - SPH_C32(0x975706d4), SPH_C32(0x6c550000), SPH_C32(0xc3060000), - SPH_C32(0x65b8499e), SPH_C32(0x3d17a8f2), SPH_C32(0x43485016), - SPH_C32(0x1ce794da) }, - { SPH_C32(0x6bb60000), SPH_C32(0xf0721748), SPH_C32(0x61860000), - SPH_C32(0xa1d00000), SPH_C32(0xbd6037b0), SPH_C32(0x7ee8d9bd), - SPH_C32(0xb43cc8cc), SPH_C32(0xbaf428f5), SPH_C32(0x434f0000), - SPH_C32(0x6b6c06cc), SPH_C32(0x75d60000), SPH_C32(0x120d0000), - SPH_C32(0xcba0315a), SPH_C32(0x7fb130a4), SPH_C32(0x435a8a21), - SPH_C32(0x30dcc494) }, - { SPH_C32(0xea3a0000), SPH_C32(0xded91790), SPH_C32(0x9e880000), - SPH_C32(0xb6ea0000), SPH_C32(0xd9480a05), SPH_C32(0x94a4d125), - SPH_C32(0x8c782244), SPH_C32(0x545f8662), SPH_C32(0xd16c0000), - SPH_C32(0xc290069c), SPH_C32(0xf4b90000), SPH_C32(0x599e0000), - SPH_C32(0xc6146a02), SPH_C32(0x60ece499), SPH_C32(0xe1c83e6a), - SPH_C32(0x792048f0) }, - { SPH_C32(0xbe6a0000), SPH_C32(0xd8a817cc), SPH_C32(0xbb260000), - SPH_C32(0xdcf40000), SPH_C32(0xf7ed44da), SPH_C32(0xf2ea5437), - SPH_C32(0x33c23a87), SPH_C32(0x2a2edb75), SPH_C32(0x6de10000), - SPH_C32(0x3eab0684), SPH_C32(0xed3a0000), SPH_C32(0x88950000), - SPH_C32(0x680c12c6), SPH_C32(0x224a7ccf), SPH_C32(0xe1dae45d), - SPH_C32(0x551b18be) }, - { SPH_C32(0x56b70000), SPH_C32(0x22e21788), SPH_C32(0x870b0000), - SPH_C32(0x67e10000), SPH_C32(0x775072c1), SPH_C32(0xd6024973), - SPH_C32(0x8c6af873), SPH_C32(0x7864d62c), SPH_C32(0x39b10000), - SPH_C32(0x38da06d8), SPH_C32(0xc8940000), SPH_C32(0xe28b0000), - SPH_C32(0x46a95c19), SPH_C32(0x4404f9dd), SPH_C32(0x5e60fc9e), - SPH_C32(0x2b6a45a9) }, - { SPH_C32(0x02e70000), SPH_C32(0x249317d4), SPH_C32(0xa2a50000), - SPH_C32(0x0dff0000), SPH_C32(0x59f53c1e), SPH_C32(0xb04ccc61), - SPH_C32(0x33d0e0b0), SPH_C32(0x06158b3b), SPH_C32(0x853c0000), - SPH_C32(0xc4e106c0), SPH_C32(0xd1170000), SPH_C32(0x33800000), - SPH_C32(0xe8b124dd), SPH_C32(0x06a2618b), SPH_C32(0x5e7226a9), - SPH_C32(0x075115e7) }, - { SPH_C32(0x496a0000), SPH_C32(0xec501800), SPH_C32(0xbb130000), - SPH_C32(0x67a20000), SPH_C32(0x2d662436), SPH_C32(0x3691b0c2), - SPH_C32(0x831fedcb), SPH_C32(0x6b78f44f), SPH_C32(0x461f0000), - SPH_C32(0xb1290300), SPH_C32(0x124b0000), SPH_C32(0x02d10000), - SPH_C32(0xabb01976), SPH_C32(0xb19c0925), SPH_C32(0x28f4b503), - SPH_C32(0x64e214a1) }, - { SPH_C32(0x1d3a0000), SPH_C32(0xea21185c), SPH_C32(0x9ebd0000), - SPH_C32(0x0dbc0000), SPH_C32(0x03c36ae9), SPH_C32(0x50df35d0), - SPH_C32(0x3ca5f508), SPH_C32(0x1509a958), SPH_C32(0xfa920000), - SPH_C32(0x4d120318), SPH_C32(0x0bc80000), SPH_C32(0xd3da0000), - SPH_C32(0x05a861b2), SPH_C32(0xf33a9173), SPH_C32(0x28e66f34), - SPH_C32(0x48d944ef) }, - { SPH_C32(0xf5e70000), SPH_C32(0x106b1818), SPH_C32(0xa2900000), - SPH_C32(0xb6a90000), SPH_C32(0x837e5cf2), SPH_C32(0x74372894), - SPH_C32(0x830d37fc), SPH_C32(0x4743a401), SPH_C32(0xaec20000), - SPH_C32(0x4b630344), SPH_C32(0x2e660000), SPH_C32(0xb9c40000), - SPH_C32(0x2b0d2f6d), SPH_C32(0x95741461), SPH_C32(0x975c77f7), - SPH_C32(0x36a819f8) }, - { SPH_C32(0xa1b70000), SPH_C32(0x161a1844), SPH_C32(0x873e0000), - SPH_C32(0xdcb70000), SPH_C32(0xaddb122d), SPH_C32(0x1279ad86), - SPH_C32(0x3cb72f3f), SPH_C32(0x3932f916), SPH_C32(0x124f0000), - SPH_C32(0xb758035c), SPH_C32(0x37e50000), SPH_C32(0x68cf0000), - SPH_C32(0x851557a9), SPH_C32(0xd7d28c37), SPH_C32(0x974eadc0), - SPH_C32(0x1a9349b6) }, - { SPH_C32(0x203b0000), SPH_C32(0x38b1189c), SPH_C32(0x78300000), - SPH_C32(0xcb8d0000), SPH_C32(0xc9f32f98), SPH_C32(0xf835a51e), - SPH_C32(0x04f3c5b7), SPH_C32(0xd7995781), SPH_C32(0x806c0000), - SPH_C32(0x1ea4030c), SPH_C32(0xb68a0000), SPH_C32(0x235c0000), - SPH_C32(0x88a10cf1), SPH_C32(0xc88f580a), SPH_C32(0x35dc198b), - SPH_C32(0x536fc5d2) }, - { SPH_C32(0x746b0000), SPH_C32(0x3ec018c0), SPH_C32(0x5d9e0000), - SPH_C32(0xa1930000), SPH_C32(0xe7566147), SPH_C32(0x9e7b200c), - SPH_C32(0xbb49dd74), SPH_C32(0xa9e80a96), SPH_C32(0x3ce10000), - SPH_C32(0xe29f0314), SPH_C32(0xaf090000), SPH_C32(0xf2570000), - SPH_C32(0x26b97435), SPH_C32(0x8a29c05c), SPH_C32(0x35cec3bc), - SPH_C32(0x7f54959c) }, - { SPH_C32(0x9cb60000), SPH_C32(0xc48a1884), SPH_C32(0x61b30000), - SPH_C32(0x1a860000), SPH_C32(0x67eb575c), SPH_C32(0xba933d48), - SPH_C32(0x04e11f80), SPH_C32(0xfba207cf), SPH_C32(0x68b10000), - SPH_C32(0xe4ee0348), SPH_C32(0x8aa70000), SPH_C32(0x98490000), - SPH_C32(0x081c3aea), SPH_C32(0xec67454e), SPH_C32(0x8a74db7f), - SPH_C32(0x0125c88b) }, - { SPH_C32(0xc8e60000), SPH_C32(0xc2fb18d8), SPH_C32(0x441d0000), - SPH_C32(0x70980000), SPH_C32(0x494e1983), SPH_C32(0xdcddb85a), - SPH_C32(0xbb5b0743), SPH_C32(0x85d35ad8), SPH_C32(0xd43c0000), - SPH_C32(0x18d50350), SPH_C32(0x93240000), SPH_C32(0x49420000), - SPH_C32(0xa604422e), SPH_C32(0xaec1dd18), SPH_C32(0x8a660148), - SPH_C32(0x2d1e98c5) }, - { SPH_C32(0x8f190000), SPH_C32(0x43dd180c), SPH_C32(0x1fd20000), - SPH_C32(0x462f0000), SPH_C32(0x0e7731b1), SPH_C32(0x4f82e1ed), - SPH_C32(0x9e374143), SPH_C32(0x5cf5253c), SPH_C32(0xe93d0000), - SPH_C32(0xca450390), SPH_C32(0x75a90000), SPH_C32(0x8f730000), - SPH_C32(0x6c34075f), SPH_C32(0x062b4dd6), SPH_C32(0xb23031f7), - SPH_C32(0xef8e661c) }, - { SPH_C32(0xdb490000), SPH_C32(0x45ac1850), SPH_C32(0x3a7c0000), - SPH_C32(0x2c310000), SPH_C32(0x20d27f6e), SPH_C32(0x29cc64ff), - SPH_C32(0x218d5980), SPH_C32(0x2284782b), SPH_C32(0x55b00000), - SPH_C32(0x367e0388), SPH_C32(0x6c2a0000), SPH_C32(0x5e780000), - SPH_C32(0xc22c7f9b), SPH_C32(0x448dd580), SPH_C32(0xb222ebc0), - SPH_C32(0xc3b53652) }, - { SPH_C32(0x33940000), SPH_C32(0xbfe61814), SPH_C32(0x06510000), - SPH_C32(0x97240000), SPH_C32(0xa06f4975), SPH_C32(0x0d2479bb), - SPH_C32(0x9e259b74), SPH_C32(0x70ce7572), SPH_C32(0x01e00000), - SPH_C32(0x300f03d4), SPH_C32(0x49840000), SPH_C32(0x34660000), - SPH_C32(0xec893144), SPH_C32(0x22c35092), SPH_C32(0x0d98f303), - SPH_C32(0xbdc46b45) }, - { SPH_C32(0x67c40000), SPH_C32(0xb9971848), SPH_C32(0x23ff0000), - SPH_C32(0xfd3a0000), SPH_C32(0x8eca07aa), SPH_C32(0x6b6afca9), - SPH_C32(0x219f83b7), SPH_C32(0x0ebf2865), SPH_C32(0xbd6d0000), - SPH_C32(0xcc3403cc), SPH_C32(0x50070000), SPH_C32(0xe56d0000), - SPH_C32(0x42914980), SPH_C32(0x6065c8c4), SPH_C32(0x0d8a2934), - SPH_C32(0x91ff3b0b) }, - { SPH_C32(0xe6480000), SPH_C32(0x973c1890), SPH_C32(0xdcf10000), - SPH_C32(0xea000000), SPH_C32(0xeae23a1f), SPH_C32(0x8126f431), - SPH_C32(0x19db693f), SPH_C32(0xe01486f2), SPH_C32(0x2f4e0000), - SPH_C32(0x65c8039c), SPH_C32(0xd1680000), SPH_C32(0xaefe0000), - SPH_C32(0x4f2512d8), SPH_C32(0x7f381cf9), SPH_C32(0xaf189d7f), - SPH_C32(0xd803b76f) }, - { SPH_C32(0xb2180000), SPH_C32(0x914d18cc), SPH_C32(0xf95f0000), - SPH_C32(0x801e0000), SPH_C32(0xc44774c0), SPH_C32(0xe7687123), - SPH_C32(0xa66171fc), SPH_C32(0x9e65dbe5), SPH_C32(0x93c30000), - SPH_C32(0x99f30384), SPH_C32(0xc8eb0000), SPH_C32(0x7ff50000), - SPH_C32(0xe13d6a1c), SPH_C32(0x3d9e84af), SPH_C32(0xaf0a4748), - SPH_C32(0xf438e721) }, - { SPH_C32(0x5ac50000), SPH_C32(0x6b071888), SPH_C32(0xc5720000), - SPH_C32(0x3b0b0000), SPH_C32(0x44fa42db), SPH_C32(0xc3806c67), - SPH_C32(0x19c9b308), SPH_C32(0xcc2fd6bc), SPH_C32(0xc7930000), - SPH_C32(0x9f8203d8), SPH_C32(0xed450000), SPH_C32(0x15eb0000), - SPH_C32(0xcf9824c3), SPH_C32(0x5bd001bd), SPH_C32(0x10b05f8b), - SPH_C32(0x8a49ba36) }, - { SPH_C32(0x0e950000), SPH_C32(0x6d7618d4), SPH_C32(0xe0dc0000), - SPH_C32(0x51150000), SPH_C32(0x6a5f0c04), SPH_C32(0xa5cee975), - SPH_C32(0xa673abcb), SPH_C32(0xb25e8bab), SPH_C32(0x7b1e0000), - SPH_C32(0x63b903c0), SPH_C32(0xf4c60000), SPH_C32(0xc4e00000), - SPH_C32(0x61805c07), SPH_C32(0x197699eb), SPH_C32(0x10a285bc), - SPH_C32(0xa672ea78) }, - { SPH_C32(0xbb3a0000), SPH_C32(0x02ed1200), SPH_C32(0xdcbb0000), - SPH_C32(0xcc280000), SPH_C32(0x97fd6cf6), SPH_C32(0x3cc76db6), - SPH_C32(0x586c05a5), SPH_C32(0x7e100b40), SPH_C32(0x4a6d0000), - SPH_C32(0xf8cc0c00), SPH_C32(0x50320000), SPH_C32(0x5e3b0000), - SPH_C32(0x981a296c), SPH_C32(0xa41e2c31), SPH_C32(0xbd57fe78), - SPH_C32(0xd0a91431) }, - { SPH_C32(0xef6a0000), SPH_C32(0x049c125c), SPH_C32(0xf9150000), - SPH_C32(0xa6360000), SPH_C32(0xb9582229), SPH_C32(0x5a89e8a4), - SPH_C32(0xe7d61d66), SPH_C32(0x00615657), SPH_C32(0xf6e00000), - SPH_C32(0x04f70c18), SPH_C32(0x49b10000), SPH_C32(0x8f300000), - SPH_C32(0x360251a8), SPH_C32(0xe6b8b467), SPH_C32(0xbd45244f), - SPH_C32(0xfc92447f) }, - { SPH_C32(0x07b70000), SPH_C32(0xfed61218), SPH_C32(0xc5380000), - SPH_C32(0x1d230000), SPH_C32(0x39e51432), SPH_C32(0x7e61f5e0), - SPH_C32(0x587edf92), SPH_C32(0x522b5b0e), SPH_C32(0xa2b00000), - SPH_C32(0x02860c44), SPH_C32(0x6c1f0000), SPH_C32(0xe52e0000), - SPH_C32(0x18a71f77), SPH_C32(0x80f63175), SPH_C32(0x02ff3c8c), - SPH_C32(0x82e31968) }, - { SPH_C32(0x53e70000), SPH_C32(0xf8a71244), SPH_C32(0xe0960000), - SPH_C32(0x773d0000), SPH_C32(0x17405aed), SPH_C32(0x182f70f2), - SPH_C32(0xe7c4c751), SPH_C32(0x2c5a0619), SPH_C32(0x1e3d0000), - SPH_C32(0xfebd0c5c), SPH_C32(0x759c0000), SPH_C32(0x34250000), - SPH_C32(0xb6bf67b3), SPH_C32(0xc250a923), SPH_C32(0x02ede6bb), - SPH_C32(0xaed84926) }, - { SPH_C32(0xd26b0000), SPH_C32(0xd60c129c), SPH_C32(0x1f980000), - SPH_C32(0x60070000), SPH_C32(0x73686758), SPH_C32(0xf263786a), - SPH_C32(0xdf802dd9), SPH_C32(0xc2f1a88e), SPH_C32(0x8c1e0000), - SPH_C32(0x57410c0c), SPH_C32(0xf4f30000), SPH_C32(0x7fb60000), - SPH_C32(0xbb0b3ceb), SPH_C32(0xdd0d7d1e), SPH_C32(0xa07f52f0), - SPH_C32(0xe724c542) }, - { SPH_C32(0x863b0000), SPH_C32(0xd07d12c0), SPH_C32(0x3a360000), - SPH_C32(0x0a190000), SPH_C32(0x5dcd2987), SPH_C32(0x942dfd78), - SPH_C32(0x603a351a), SPH_C32(0xbc80f599), SPH_C32(0x30930000), - SPH_C32(0xab7a0c14), SPH_C32(0xed700000), SPH_C32(0xaebd0000), - SPH_C32(0x1513442f), SPH_C32(0x9fabe548), SPH_C32(0xa06d88c7), - SPH_C32(0xcb1f950c) }, - { SPH_C32(0x6ee60000), SPH_C32(0x2a371284), SPH_C32(0x061b0000), - SPH_C32(0xb10c0000), SPH_C32(0xdd701f9c), SPH_C32(0xb0c5e03c), - SPH_C32(0xdf92f7ee), SPH_C32(0xeecaf8c0), SPH_C32(0x64c30000), - SPH_C32(0xad0b0c48), SPH_C32(0xc8de0000), SPH_C32(0xc4a30000), - SPH_C32(0x3bb60af0), SPH_C32(0xf9e5605a), SPH_C32(0x1fd79004), - SPH_C32(0xb56ec81b) }, - { SPH_C32(0x3ab60000), SPH_C32(0x2c4612d8), SPH_C32(0x23b50000), - SPH_C32(0xdb120000), SPH_C32(0xf3d55143), SPH_C32(0xd68b652e), - SPH_C32(0x6028ef2d), SPH_C32(0x90bba5d7), SPH_C32(0xd84e0000), - SPH_C32(0x51300c50), SPH_C32(0xd15d0000), SPH_C32(0x15a80000), - SPH_C32(0x95ae7234), SPH_C32(0xbb43f80c), SPH_C32(0x1fc54a33), - SPH_C32(0x99559855) }, - { SPH_C32(0x7d490000), SPH_C32(0xad60120c), SPH_C32(0x787a0000), - SPH_C32(0xeda50000), SPH_C32(0xb4ec7971), SPH_C32(0x45d43c99), - SPH_C32(0x4544a92d), SPH_C32(0x499dda33), SPH_C32(0xe54f0000), - SPH_C32(0x83a00c90), SPH_C32(0x37d00000), SPH_C32(0xd3990000), - SPH_C32(0x5f9e3745), SPH_C32(0x13a968c2), SPH_C32(0x27937a8c), - SPH_C32(0x5bc5668c) }, - { SPH_C32(0x29190000), SPH_C32(0xab111250), SPH_C32(0x5dd40000), - SPH_C32(0x87bb0000), SPH_C32(0x9a4937ae), SPH_C32(0x239ab98b), - SPH_C32(0xfafeb1ee), SPH_C32(0x37ec8724), SPH_C32(0x59c20000), - SPH_C32(0x7f9b0c88), SPH_C32(0x2e530000), SPH_C32(0x02920000), - SPH_C32(0xf1864f81), SPH_C32(0x510ff094), SPH_C32(0x2781a0bb), - SPH_C32(0x77fe36c2) }, - { SPH_C32(0xc1c40000), SPH_C32(0x515b1214), SPH_C32(0x61f90000), - SPH_C32(0x3cae0000), SPH_C32(0x1af401b5), SPH_C32(0x0772a4cf), - SPH_C32(0x4556731a), SPH_C32(0x65a68a7d), SPH_C32(0x0d920000), - SPH_C32(0x79ea0cd4), SPH_C32(0x0bfd0000), SPH_C32(0x688c0000), - SPH_C32(0xdf23015e), SPH_C32(0x37417586), SPH_C32(0x983bb878), - SPH_C32(0x098f6bd5) }, - { SPH_C32(0x95940000), SPH_C32(0x572a1248), SPH_C32(0x44570000), - SPH_C32(0x56b00000), SPH_C32(0x34514f6a), SPH_C32(0x613c21dd), - SPH_C32(0xfaec6bd9), SPH_C32(0x1bd7d76a), SPH_C32(0xb11f0000), - SPH_C32(0x85d10ccc), SPH_C32(0x127e0000), SPH_C32(0xb9870000), - SPH_C32(0x713b799a), SPH_C32(0x75e7edd0), SPH_C32(0x9829624f), - SPH_C32(0x25b43b9b) }, - { SPH_C32(0x14180000), SPH_C32(0x79811290), SPH_C32(0xbb590000), - SPH_C32(0x418a0000), SPH_C32(0x507972df), SPH_C32(0x8b702945), - SPH_C32(0xc2a88151), SPH_C32(0xf57c79fd), SPH_C32(0x233c0000), - SPH_C32(0x2c2d0c9c), SPH_C32(0x93110000), SPH_C32(0xf2140000), - SPH_C32(0x7c8f22c2), SPH_C32(0x6aba39ed), SPH_C32(0x3abbd604), - SPH_C32(0x6c48b7ff) }, - { SPH_C32(0x40480000), SPH_C32(0x7ff012cc), SPH_C32(0x9ef70000), - SPH_C32(0x2b940000), SPH_C32(0x7edc3c00), SPH_C32(0xed3eac57), - SPH_C32(0x7d129992), SPH_C32(0x8b0d24ea), SPH_C32(0x9fb10000), - SPH_C32(0xd0160c84), SPH_C32(0x8a920000), SPH_C32(0x231f0000), - SPH_C32(0xd2975a06), SPH_C32(0x281ca1bb), SPH_C32(0x3aa90c33), - SPH_C32(0x4073e7b1) }, - { SPH_C32(0xa8950000), SPH_C32(0x85ba1288), SPH_C32(0xa2da0000), - SPH_C32(0x90810000), SPH_C32(0xfe610a1b), SPH_C32(0xc9d6b113), - SPH_C32(0xc2ba5b66), SPH_C32(0xd94729b3), SPH_C32(0xcbe10000), - SPH_C32(0xd6670cd8), SPH_C32(0xaf3c0000), SPH_C32(0x49010000), - SPH_C32(0xfc3214d9), SPH_C32(0x4e5224a9), SPH_C32(0x851314f0), - SPH_C32(0x3e02baa6) }, - { SPH_C32(0xfcc50000), SPH_C32(0x83cb12d4), SPH_C32(0x87740000), - SPH_C32(0xfa9f0000), SPH_C32(0xd0c444c4), SPH_C32(0xaf983401), - SPH_C32(0x7d0043a5), SPH_C32(0xa73674a4), SPH_C32(0x776c0000), - SPH_C32(0x2a5c0cc0), SPH_C32(0xb6bf0000), SPH_C32(0x980a0000), - SPH_C32(0x522a6c1d), SPH_C32(0x0cf4bcff), SPH_C32(0x8501cec7), - SPH_C32(0x1239eae8) }, - { SPH_C32(0xb7480000), SPH_C32(0x4b081d00), SPH_C32(0x9ec20000), - SPH_C32(0x90c20000), SPH_C32(0xa4575cec), SPH_C32(0x294548a2), - SPH_C32(0xcdcf4ede), SPH_C32(0xca5b0bd0), SPH_C32(0xb44f0000), - SPH_C32(0x5f940900), SPH_C32(0x75e30000), SPH_C32(0xa95b0000), - SPH_C32(0x112b51b6), SPH_C32(0xbbcad451), SPH_C32(0xf3875d6d), - SPH_C32(0x718aebae) }, - { SPH_C32(0xe3180000), SPH_C32(0x4d791d5c), SPH_C32(0xbb6c0000), - SPH_C32(0xfadc0000), SPH_C32(0x8af21233), SPH_C32(0x4f0bcdb0), - SPH_C32(0x7275561d), SPH_C32(0xb42a56c7), SPH_C32(0x08c20000), - SPH_C32(0xa3af0918), SPH_C32(0x6c600000), SPH_C32(0x78500000), - SPH_C32(0xbf332972), SPH_C32(0xf96c4c07), SPH_C32(0xf395875a), - SPH_C32(0x5db1bbe0) }, - { SPH_C32(0x0bc50000), SPH_C32(0xb7331d18), SPH_C32(0x87410000), - SPH_C32(0x41c90000), SPH_C32(0x0a4f2428), SPH_C32(0x6be3d0f4), - SPH_C32(0xcddd94e9), SPH_C32(0xe6605b9e), SPH_C32(0x5c920000), - SPH_C32(0xa5de0944), SPH_C32(0x49ce0000), SPH_C32(0x124e0000), - SPH_C32(0x919667ad), SPH_C32(0x9f22c915), SPH_C32(0x4c2f9f99), - SPH_C32(0x23c0e6f7) }, - { SPH_C32(0x5f950000), SPH_C32(0xb1421d44), SPH_C32(0xa2ef0000), - SPH_C32(0x2bd70000), SPH_C32(0x24ea6af7), SPH_C32(0x0dad55e6), - SPH_C32(0x72678c2a), SPH_C32(0x98110689), SPH_C32(0xe01f0000), - SPH_C32(0x59e5095c), SPH_C32(0x504d0000), SPH_C32(0xc3450000), - SPH_C32(0x3f8e1f69), SPH_C32(0xdd845143), SPH_C32(0x4c3d45ae), - SPH_C32(0x0ffbb6b9) }, - { SPH_C32(0xde190000), SPH_C32(0x9fe91d9c), SPH_C32(0x5de10000), - SPH_C32(0x3ced0000), SPH_C32(0x40c25742), SPH_C32(0xe7e15d7e), - SPH_C32(0x4a2366a2), SPH_C32(0x76baa81e), SPH_C32(0x723c0000), - SPH_C32(0xf019090c), SPH_C32(0xd1220000), SPH_C32(0x88d60000), - SPH_C32(0x323a4431), SPH_C32(0xc2d9857e), SPH_C32(0xeeaff1e5), - SPH_C32(0x46073add) }, - { SPH_C32(0x8a490000), SPH_C32(0x99981dc0), SPH_C32(0x784f0000), - SPH_C32(0x56f30000), SPH_C32(0x6e67199d), SPH_C32(0x81afd86c), - SPH_C32(0xf5997e61), SPH_C32(0x08cbf509), SPH_C32(0xceb10000), - SPH_C32(0x0c220914), SPH_C32(0xc8a10000), SPH_C32(0x59dd0000), - SPH_C32(0x9c223cf5), SPH_C32(0x807f1d28), SPH_C32(0xeebd2bd2), - SPH_C32(0x6a3c6a93) }, - { SPH_C32(0x62940000), SPH_C32(0x63d21d84), SPH_C32(0x44620000), - SPH_C32(0xede60000), SPH_C32(0xeeda2f86), SPH_C32(0xa547c528), - SPH_C32(0x4a31bc95), SPH_C32(0x5a81f850), SPH_C32(0x9ae10000), - SPH_C32(0x0a530948), SPH_C32(0xed0f0000), SPH_C32(0x33c30000), - SPH_C32(0xb287722a), SPH_C32(0xe631983a), SPH_C32(0x51073311), - SPH_C32(0x144d3784) }, - { SPH_C32(0x36c40000), SPH_C32(0x65a31dd8), SPH_C32(0x61cc0000), - SPH_C32(0x87f80000), SPH_C32(0xc07f6159), SPH_C32(0xc309403a), - SPH_C32(0xf58ba456), SPH_C32(0x24f0a547), SPH_C32(0x266c0000), - SPH_C32(0xf6680950), SPH_C32(0xf48c0000), SPH_C32(0xe2c80000), - SPH_C32(0x1c9f0aee), SPH_C32(0xa497006c), SPH_C32(0x5115e926), - SPH_C32(0x387667ca) }, - { SPH_C32(0x713b0000), SPH_C32(0xe4851d0c), SPH_C32(0x3a030000), - SPH_C32(0xb14f0000), SPH_C32(0x8746496b), SPH_C32(0x5056198d), - SPH_C32(0xd0e7e256), SPH_C32(0xfdd6daa3), SPH_C32(0x1b6d0000), - SPH_C32(0x24f80990), SPH_C32(0x12010000), SPH_C32(0x24f90000), - SPH_C32(0xd6af4f9f), SPH_C32(0x0c7d90a2), SPH_C32(0x6943d999), - SPH_C32(0xfae69913) }, - { SPH_C32(0x256b0000), SPH_C32(0xe2f41d50), SPH_C32(0x1fad0000), - SPH_C32(0xdb510000), SPH_C32(0xa9e307b4), SPH_C32(0x36189c9f), - SPH_C32(0x6f5dfa95), SPH_C32(0x83a787b4), SPH_C32(0xa7e00000), - SPH_C32(0xd8c30988), SPH_C32(0x0b820000), SPH_C32(0xf5f20000), - SPH_C32(0x78b7375b), SPH_C32(0x4edb08f4), SPH_C32(0x695103ae), - SPH_C32(0xd6ddc95d) }, - { SPH_C32(0xcdb60000), SPH_C32(0x18be1d14), SPH_C32(0x23800000), - SPH_C32(0x60440000), SPH_C32(0x295e31af), SPH_C32(0x12f081db), - SPH_C32(0xd0f53861), SPH_C32(0xd1ed8aed), SPH_C32(0xf3b00000), - SPH_C32(0xdeb209d4), SPH_C32(0x2e2c0000), SPH_C32(0x9fec0000), - SPH_C32(0x56127984), SPH_C32(0x28958de6), SPH_C32(0xd6eb1b6d), - SPH_C32(0xa8ac944a) }, - { SPH_C32(0x99e60000), SPH_C32(0x1ecf1d48), SPH_C32(0x062e0000), - SPH_C32(0x0a5a0000), SPH_C32(0x07fb7f70), SPH_C32(0x74be04c9), - SPH_C32(0x6f4f20a2), SPH_C32(0xaf9cd7fa), SPH_C32(0x4f3d0000), - SPH_C32(0x228909cc), SPH_C32(0x37af0000), SPH_C32(0x4ee70000), - SPH_C32(0xf80a0140), SPH_C32(0x6a3315b0), SPH_C32(0xd6f9c15a), - SPH_C32(0x8497c404) }, - { SPH_C32(0x186a0000), SPH_C32(0x30641d90), SPH_C32(0xf9200000), - SPH_C32(0x1d600000), SPH_C32(0x63d342c5), SPH_C32(0x9ef20c51), - SPH_C32(0x570bca2a), SPH_C32(0x4137796d), SPH_C32(0xdd1e0000), - SPH_C32(0x8b75099c), SPH_C32(0xb6c00000), SPH_C32(0x05740000), - SPH_C32(0xf5be5a18), SPH_C32(0x756ec18d), SPH_C32(0x746b7511), - SPH_C32(0xcd6b4860) }, - { SPH_C32(0x4c3a0000), SPH_C32(0x36151dcc), SPH_C32(0xdc8e0000), - SPH_C32(0x777e0000), SPH_C32(0x4d760c1a), SPH_C32(0xf8bc8943), - SPH_C32(0xe8b1d2e9), SPH_C32(0x3f46247a), SPH_C32(0x61930000), - SPH_C32(0x774e0984), SPH_C32(0xaf430000), SPH_C32(0xd47f0000), - SPH_C32(0x5ba622dc), SPH_C32(0x37c859db), SPH_C32(0x7479af26), - SPH_C32(0xe150182e) }, - { SPH_C32(0xa4e70000), SPH_C32(0xcc5f1d88), SPH_C32(0xe0a30000), - SPH_C32(0xcc6b0000), SPH_C32(0xcdcb3a01), SPH_C32(0xdc549407), - SPH_C32(0x5719101d), SPH_C32(0x6d0c2923), SPH_C32(0x35c30000), - SPH_C32(0x713f09d8), SPH_C32(0x8aed0000), SPH_C32(0xbe610000), - SPH_C32(0x75036c03), SPH_C32(0x5186dcc9), SPH_C32(0xcbc3b7e5), - SPH_C32(0x9f214539) }, - { SPH_C32(0xf0b70000), SPH_C32(0xca2e1dd4), SPH_C32(0xc50d0000), - SPH_C32(0xa6750000), SPH_C32(0xe36e74de), SPH_C32(0xba1a1115), - SPH_C32(0xe8a308de), SPH_C32(0x137d7434), SPH_C32(0x894e0000), - SPH_C32(0x8d0409c0), SPH_C32(0x936e0000), SPH_C32(0x6f6a0000), - SPH_C32(0xdb1b14c7), SPH_C32(0x1320449f), SPH_C32(0xcbd16dd2), - SPH_C32(0xb31a1577) } -}; - -static const sph_u32 T512_28[128][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x1e4e0000), SPH_C32(0xdecf0000), SPH_C32(0x6df80180), - SPH_C32(0x77240000), SPH_C32(0xec47079e), SPH_C32(0xf4a0694e), - SPH_C32(0xcda31812), SPH_C32(0x98aa496e), SPH_C32(0xb2060000), - SPH_C32(0xc5690000), SPH_C32(0x28031200), SPH_C32(0x74670000), - SPH_C32(0xb6c236f4), SPH_C32(0xeb1239f8), SPH_C32(0x33d1dfec), - SPH_C32(0x094e3198) }, - { SPH_C32(0xaec30000), SPH_C32(0x9c4f0001), SPH_C32(0x79d1e000), - SPH_C32(0x2c150000), SPH_C32(0x45cc75b3), SPH_C32(0x6650b736), - SPH_C32(0xab92f78f), SPH_C32(0xa312567b), SPH_C32(0xdb250000), - SPH_C32(0x09290000), SPH_C32(0x49aac000), SPH_C32(0x81e10000), - SPH_C32(0xcafe6b59), SPH_C32(0x42793431), SPH_C32(0x43566b76), - SPH_C32(0xe86cba2e) }, - { SPH_C32(0xb08d0000), SPH_C32(0x42800001), SPH_C32(0x1429e180), - SPH_C32(0x5b310000), SPH_C32(0xa98b722d), SPH_C32(0x92f0de78), - SPH_C32(0x6631ef9d), SPH_C32(0x3bb81f15), SPH_C32(0x69230000), - SPH_C32(0xcc400000), SPH_C32(0x61a9d200), SPH_C32(0xf5860000), - SPH_C32(0x7c3c5dad), SPH_C32(0xa96b0dc9), SPH_C32(0x7087b49a), - SPH_C32(0xe1228bb6) }, - { SPH_C32(0xdb250000), SPH_C32(0x09290000), SPH_C32(0x49aac000), - SPH_C32(0x81e10000), SPH_C32(0xcafe6b59), SPH_C32(0x42793431), - SPH_C32(0x43566b76), SPH_C32(0xe86cba2e), SPH_C32(0x75e60000), - SPH_C32(0x95660001), SPH_C32(0x307b2000), SPH_C32(0xadf40000), - SPH_C32(0x8f321eea), SPH_C32(0x24298307), SPH_C32(0xe8c49cf9), - SPH_C32(0x4b7eec55) }, - { SPH_C32(0xc56b0000), SPH_C32(0xd7e60000), SPH_C32(0x2452c180), - SPH_C32(0xf6c50000), SPH_C32(0x26b96cc7), SPH_C32(0xb6d95d7f), - SPH_C32(0x8ef57364), SPH_C32(0x70c6f340), SPH_C32(0xc7e00000), - SPH_C32(0x500f0001), SPH_C32(0x18783200), SPH_C32(0xd9930000), - SPH_C32(0x39f0281e), SPH_C32(0xcf3bbaff), SPH_C32(0xdb154315), - SPH_C32(0x4230ddcd) }, - { SPH_C32(0x75e60000), SPH_C32(0x95660001), SPH_C32(0x307b2000), - SPH_C32(0xadf40000), SPH_C32(0x8f321eea), SPH_C32(0x24298307), - SPH_C32(0xe8c49cf9), SPH_C32(0x4b7eec55), SPH_C32(0xaec30000), - SPH_C32(0x9c4f0001), SPH_C32(0x79d1e000), SPH_C32(0x2c150000), - SPH_C32(0x45cc75b3), SPH_C32(0x6650b736), SPH_C32(0xab92f78f), - SPH_C32(0xa312567b) }, - { SPH_C32(0x6ba80000), SPH_C32(0x4ba90001), SPH_C32(0x5d832180), - SPH_C32(0xdad00000), SPH_C32(0x63751974), SPH_C32(0xd089ea49), - SPH_C32(0x256784eb), SPH_C32(0xd3d4a53b), SPH_C32(0x1cc50000), - SPH_C32(0x59260001), SPH_C32(0x51d2f200), SPH_C32(0x58720000), - SPH_C32(0xf30e4347), SPH_C32(0x8d428ece), SPH_C32(0x98432863), - SPH_C32(0xaa5c67e3) }, - { SPH_C32(0x86790000), SPH_C32(0x3f390002), SPH_C32(0xe19ae000), - SPH_C32(0x98560000), SPH_C32(0x9565670e), SPH_C32(0x4e88c8ea), - SPH_C32(0xd3dd4944), SPH_C32(0x161ddab9), SPH_C32(0x30b70000), - SPH_C32(0xe5d00000), SPH_C32(0xf4f46000), SPH_C32(0x42c40000), - SPH_C32(0x63b83d6a), SPH_C32(0x78ba9460), SPH_C32(0x21afa1ea), - SPH_C32(0xb0a51834) }, - { SPH_C32(0x98370000), SPH_C32(0xe1f60002), SPH_C32(0x8c62e180), - SPH_C32(0xef720000), SPH_C32(0x79226090), SPH_C32(0xba28a1a4), - SPH_C32(0x1e7e5156), SPH_C32(0x8eb793d7), SPH_C32(0x82b10000), - SPH_C32(0x20b90000), SPH_C32(0xdcf77200), SPH_C32(0x36a30000), - SPH_C32(0xd57a0b9e), SPH_C32(0x93a8ad98), SPH_C32(0x127e7e06), - SPH_C32(0xb9eb29ac) }, - { SPH_C32(0x28ba0000), SPH_C32(0xa3760003), SPH_C32(0x984b0000), - SPH_C32(0xb4430000), SPH_C32(0xd0a912bd), SPH_C32(0x28d87fdc), - SPH_C32(0x784fbecb), SPH_C32(0xb50f8cc2), SPH_C32(0xeb920000), - SPH_C32(0xecf90000), SPH_C32(0xbd5ea000), SPH_C32(0xc3250000), - SPH_C32(0xa9465633), SPH_C32(0x3ac3a051), SPH_C32(0x62f9ca9c), - SPH_C32(0x58c9a21a) }, - { SPH_C32(0x36f40000), SPH_C32(0x7db90003), SPH_C32(0xf5b30180), - SPH_C32(0xc3670000), SPH_C32(0x3cee1523), SPH_C32(0xdc781692), - SPH_C32(0xb5eca6d9), SPH_C32(0x2da5c5ac), SPH_C32(0x59940000), - SPH_C32(0x29900000), SPH_C32(0x955db200), SPH_C32(0xb7420000), - SPH_C32(0x1f8460c7), SPH_C32(0xd1d199a9), SPH_C32(0x51281570), - SPH_C32(0x51879382) }, - { SPH_C32(0x5d5c0000), SPH_C32(0x36100002), SPH_C32(0xa8302000), - SPH_C32(0x19b70000), SPH_C32(0x5f9b0c57), SPH_C32(0x0cf1fcdb), - SPH_C32(0x908b2232), SPH_C32(0xfe716097), SPH_C32(0x45510000), - SPH_C32(0x70b60001), SPH_C32(0xc48f4000), SPH_C32(0xef300000), - SPH_C32(0xec8a2380), SPH_C32(0x5c931767), SPH_C32(0xc96b3d13), - SPH_C32(0xfbdbf461) }, - { SPH_C32(0x43120000), SPH_C32(0xe8df0002), SPH_C32(0xc5c82180), - SPH_C32(0x6e930000), SPH_C32(0xb3dc0bc9), SPH_C32(0xf8519595), - SPH_C32(0x5d283a20), SPH_C32(0x66db29f9), SPH_C32(0xf7570000), - SPH_C32(0xb5df0001), SPH_C32(0xec8c5200), SPH_C32(0x9b570000), - SPH_C32(0x5a481574), SPH_C32(0xb7812e9f), SPH_C32(0xfabae2ff), - SPH_C32(0xf295c5f9) }, - { SPH_C32(0xf39f0000), SPH_C32(0xaa5f0003), SPH_C32(0xd1e1c000), - SPH_C32(0x35a20000), SPH_C32(0x1a5779e4), SPH_C32(0x6aa14bed), - SPH_C32(0x3b19d5bd), SPH_C32(0x5d6336ec), SPH_C32(0x9e740000), - SPH_C32(0x799f0001), SPH_C32(0x8d258000), SPH_C32(0x6ed10000), - SPH_C32(0x267448d9), SPH_C32(0x1eea2356), SPH_C32(0x8a3d5665), - SPH_C32(0x13b74e4f) }, - { SPH_C32(0xedd10000), SPH_C32(0x74900003), SPH_C32(0xbc19c180), - SPH_C32(0x42860000), SPH_C32(0xf6107e7a), SPH_C32(0x9e0122a3), - SPH_C32(0xf6bacdaf), SPH_C32(0xc5c97f82), SPH_C32(0x2c720000), - SPH_C32(0xbcf60001), SPH_C32(0xa5269200), SPH_C32(0x1ab60000), - SPH_C32(0x90b67e2d), SPH_C32(0xf5f81aae), SPH_C32(0xb9ec8989), - SPH_C32(0x1af97fd7) }, - { SPH_C32(0x30b70000), SPH_C32(0xe5d00000), SPH_C32(0xf4f46000), - SPH_C32(0x42c40000), SPH_C32(0x63b83d6a), SPH_C32(0x78ba9460), - SPH_C32(0x21afa1ea), SPH_C32(0xb0a51834), SPH_C32(0xb6ce0000), - SPH_C32(0xdae90002), SPH_C32(0x156e8000), SPH_C32(0xda920000), - SPH_C32(0xf6dd5a64), SPH_C32(0x36325c8a), SPH_C32(0xf272e8ae), - SPH_C32(0xa6b8c28d) }, - { SPH_C32(0x2ef90000), SPH_C32(0x3b1f0000), SPH_C32(0x990c6180), - SPH_C32(0x35e00000), SPH_C32(0x8fff3af4), SPH_C32(0x8c1afd2e), - SPH_C32(0xec0cb9f8), SPH_C32(0x280f515a), SPH_C32(0x04c80000), - SPH_C32(0x1f800002), SPH_C32(0x3d6d9200), SPH_C32(0xaef50000), - SPH_C32(0x401f6c90), SPH_C32(0xdd206572), SPH_C32(0xc1a33742), - SPH_C32(0xaff6f315) }, - { SPH_C32(0x9e740000), SPH_C32(0x799f0001), SPH_C32(0x8d258000), - SPH_C32(0x6ed10000), SPH_C32(0x267448d9), SPH_C32(0x1eea2356), - SPH_C32(0x8a3d5665), SPH_C32(0x13b74e4f), SPH_C32(0x6deb0000), - SPH_C32(0xd3c00002), SPH_C32(0x5cc44000), SPH_C32(0x5b730000), - SPH_C32(0x3c23313d), SPH_C32(0x744b68bb), SPH_C32(0xb12483d8), - SPH_C32(0x4ed478a3) }, - { SPH_C32(0x803a0000), SPH_C32(0xa7500001), SPH_C32(0xe0dd8180), - SPH_C32(0x19f50000), SPH_C32(0xca334f47), SPH_C32(0xea4a4a18), - SPH_C32(0x479e4e77), SPH_C32(0x8b1d0721), SPH_C32(0xdfed0000), - SPH_C32(0x16a90002), SPH_C32(0x74c75200), SPH_C32(0x2f140000), - SPH_C32(0x8ae107c9), SPH_C32(0x9f595143), SPH_C32(0x82f55c34), - SPH_C32(0x479a493b) }, - { SPH_C32(0xeb920000), SPH_C32(0xecf90000), SPH_C32(0xbd5ea000), - SPH_C32(0xc3250000), SPH_C32(0xa9465633), SPH_C32(0x3ac3a051), - SPH_C32(0x62f9ca9c), SPH_C32(0x58c9a21a), SPH_C32(0xc3280000), - SPH_C32(0x4f8f0003), SPH_C32(0x2515a000), SPH_C32(0x77660000), - SPH_C32(0x79ef448e), SPH_C32(0x121bdf8d), SPH_C32(0x1ab67457), - SPH_C32(0xedc62ed8) }, - { SPH_C32(0xf5dc0000), SPH_C32(0x32360000), SPH_C32(0xd0a6a180), - SPH_C32(0xb4010000), SPH_C32(0x450151ad), SPH_C32(0xce63c91f), - SPH_C32(0xaf5ad28e), SPH_C32(0xc063eb74), SPH_C32(0x712e0000), - SPH_C32(0x8ae60003), SPH_C32(0x0d16b200), SPH_C32(0x03010000), - SPH_C32(0xcf2d727a), SPH_C32(0xf909e675), SPH_C32(0x2967abbb), - SPH_C32(0xe4881f40) }, - { SPH_C32(0x45510000), SPH_C32(0x70b60001), SPH_C32(0xc48f4000), - SPH_C32(0xef300000), SPH_C32(0xec8a2380), SPH_C32(0x5c931767), - SPH_C32(0xc96b3d13), SPH_C32(0xfbdbf461), SPH_C32(0x180d0000), - SPH_C32(0x46a60003), SPH_C32(0x6cbf6000), SPH_C32(0xf6870000), - SPH_C32(0xb3112fd7), SPH_C32(0x5062ebbc), SPH_C32(0x59e01f21), - SPH_C32(0x05aa94f6) }, - { SPH_C32(0x5b1f0000), SPH_C32(0xae790001), SPH_C32(0xa9774180), - SPH_C32(0x98140000), SPH_C32(0x00cd241e), SPH_C32(0xa8337e29), - SPH_C32(0x04c82501), SPH_C32(0x6371bd0f), SPH_C32(0xaa0b0000), - SPH_C32(0x83cf0003), SPH_C32(0x44bc7200), SPH_C32(0x82e00000), - SPH_C32(0x05d31923), SPH_C32(0xbb70d244), SPH_C32(0x6a31c0cd), - SPH_C32(0x0ce4a56e) }, - { SPH_C32(0xb6ce0000), SPH_C32(0xdae90002), SPH_C32(0x156e8000), - SPH_C32(0xda920000), SPH_C32(0xf6dd5a64), SPH_C32(0x36325c8a), - SPH_C32(0xf272e8ae), SPH_C32(0xa6b8c28d), SPH_C32(0x86790000), - SPH_C32(0x3f390002), SPH_C32(0xe19ae000), SPH_C32(0x98560000), - SPH_C32(0x9565670e), SPH_C32(0x4e88c8ea), SPH_C32(0xd3dd4944), - SPH_C32(0x161ddab9) }, - { SPH_C32(0xa8800000), SPH_C32(0x04260002), SPH_C32(0x78968180), - SPH_C32(0xadb60000), SPH_C32(0x1a9a5dfa), SPH_C32(0xc29235c4), - SPH_C32(0x3fd1f0bc), SPH_C32(0x3e128be3), SPH_C32(0x347f0000), - SPH_C32(0xfa500002), SPH_C32(0xc999f200), SPH_C32(0xec310000), - SPH_C32(0x23a751fa), SPH_C32(0xa59af112), SPH_C32(0xe00c96a8), - SPH_C32(0x1f53eb21) }, - { SPH_C32(0x180d0000), SPH_C32(0x46a60003), SPH_C32(0x6cbf6000), - SPH_C32(0xf6870000), SPH_C32(0xb3112fd7), SPH_C32(0x5062ebbc), - SPH_C32(0x59e01f21), SPH_C32(0x05aa94f6), SPH_C32(0x5d5c0000), - SPH_C32(0x36100002), SPH_C32(0xa8302000), SPH_C32(0x19b70000), - SPH_C32(0x5f9b0c57), SPH_C32(0x0cf1fcdb), SPH_C32(0x908b2232), - SPH_C32(0xfe716097) }, - { SPH_C32(0x06430000), SPH_C32(0x98690003), SPH_C32(0x01476180), - SPH_C32(0x81a30000), SPH_C32(0x5f562849), SPH_C32(0xa4c282f2), - SPH_C32(0x94430733), SPH_C32(0x9d00dd98), SPH_C32(0xef5a0000), - SPH_C32(0xf3790002), SPH_C32(0x80333200), SPH_C32(0x6dd00000), - SPH_C32(0xe9593aa3), SPH_C32(0xe7e3c523), SPH_C32(0xa35afdde), - SPH_C32(0xf73f510f) }, - { SPH_C32(0x6deb0000), SPH_C32(0xd3c00002), SPH_C32(0x5cc44000), - SPH_C32(0x5b730000), SPH_C32(0x3c23313d), SPH_C32(0x744b68bb), - SPH_C32(0xb12483d8), SPH_C32(0x4ed478a3), SPH_C32(0xf39f0000), - SPH_C32(0xaa5f0003), SPH_C32(0xd1e1c000), SPH_C32(0x35a20000), - SPH_C32(0x1a5779e4), SPH_C32(0x6aa14bed), SPH_C32(0x3b19d5bd), - SPH_C32(0x5d6336ec) }, - { SPH_C32(0x73a50000), SPH_C32(0x0d0f0002), SPH_C32(0x313c4180), - SPH_C32(0x2c570000), SPH_C32(0xd06436a3), SPH_C32(0x80eb01f5), - SPH_C32(0x7c879bca), SPH_C32(0xd67e31cd), SPH_C32(0x41990000), - SPH_C32(0x6f360003), SPH_C32(0xf9e2d200), SPH_C32(0x41c50000), - SPH_C32(0xac954f10), SPH_C32(0x81b37215), SPH_C32(0x08c80a51), - SPH_C32(0x542d0774) }, - { SPH_C32(0xc3280000), SPH_C32(0x4f8f0003), SPH_C32(0x2515a000), - SPH_C32(0x77660000), SPH_C32(0x79ef448e), SPH_C32(0x121bdf8d), - SPH_C32(0x1ab67457), SPH_C32(0xedc62ed8), SPH_C32(0x28ba0000), - SPH_C32(0xa3760003), SPH_C32(0x984b0000), SPH_C32(0xb4430000), - SPH_C32(0xd0a912bd), SPH_C32(0x28d87fdc), SPH_C32(0x784fbecb), - SPH_C32(0xb50f8cc2) }, - { SPH_C32(0xdd660000), SPH_C32(0x91400003), SPH_C32(0x48eda180), - SPH_C32(0x00420000), SPH_C32(0x95a84310), SPH_C32(0xe6bbb6c3), - SPH_C32(0xd7156c45), SPH_C32(0x756c67b6), SPH_C32(0x9abc0000), - SPH_C32(0x661f0003), SPH_C32(0xb0481200), SPH_C32(0xc0240000), - SPH_C32(0x666b2449), SPH_C32(0xc3ca4624), SPH_C32(0x4b9e6127), - SPH_C32(0xbc41bd5a) }, - { SPH_C32(0x14190000), SPH_C32(0x23ca003c), SPH_C32(0x50df0000), - SPH_C32(0x44b60000), SPH_C32(0x1b6c67b0), SPH_C32(0x3cf3ac75), - SPH_C32(0x61e610b0), SPH_C32(0xdbcadb80), SPH_C32(0xe3430000), - SPH_C32(0x3a4e0014), SPH_C32(0xf2c60000), SPH_C32(0xaa4e0000), - SPH_C32(0xdb1e42a6), SPH_C32(0x256bbe15), SPH_C32(0x123db156), - SPH_C32(0x3a4e99d7) }, - { SPH_C32(0x0a570000), SPH_C32(0xfd05003c), SPH_C32(0x3d270180), - SPH_C32(0x33920000), SPH_C32(0xf72b602e), SPH_C32(0xc853c53b), - SPH_C32(0xac4508a2), SPH_C32(0x436092ee), SPH_C32(0x51450000), - SPH_C32(0xff270014), SPH_C32(0xdac51200), SPH_C32(0xde290000), - SPH_C32(0x6ddc7452), SPH_C32(0xce7987ed), SPH_C32(0x21ec6eba), - SPH_C32(0x3300a84f) }, - { SPH_C32(0xbada0000), SPH_C32(0xbf85003d), SPH_C32(0x290ee000), - SPH_C32(0x68a30000), SPH_C32(0x5ea01203), SPH_C32(0x5aa31b43), - SPH_C32(0xca74e73f), SPH_C32(0x78d88dfb), SPH_C32(0x38660000), - SPH_C32(0x33670014), SPH_C32(0xbb6cc000), SPH_C32(0x2baf0000), - SPH_C32(0x11e029ff), SPH_C32(0x67128a24), SPH_C32(0x516bda20), - SPH_C32(0xd22223f9) }, - { SPH_C32(0xa4940000), SPH_C32(0x614a003d), SPH_C32(0x44f6e180), - SPH_C32(0x1f870000), SPH_C32(0xb2e7159d), SPH_C32(0xae03720d), - SPH_C32(0x07d7ff2d), SPH_C32(0xe072c495), SPH_C32(0x8a600000), - SPH_C32(0xf60e0014), SPH_C32(0x936fd200), SPH_C32(0x5fc80000), - SPH_C32(0xa7221f0b), SPH_C32(0x8c00b3dc), SPH_C32(0x62ba05cc), - SPH_C32(0xdb6c1261) }, - { SPH_C32(0xcf3c0000), SPH_C32(0x2ae3003c), SPH_C32(0x1975c000), - SPH_C32(0xc5570000), SPH_C32(0xd1920ce9), SPH_C32(0x7e8a9844), - SPH_C32(0x22b07bc6), SPH_C32(0x33a661ae), SPH_C32(0x96a50000), - SPH_C32(0xaf280015), SPH_C32(0xc2bd2000), SPH_C32(0x07ba0000), - SPH_C32(0x542c5c4c), SPH_C32(0x01423d12), SPH_C32(0xfaf92daf), - SPH_C32(0x71307582) }, - { SPH_C32(0xd1720000), SPH_C32(0xf42c003c), SPH_C32(0x748dc180), - SPH_C32(0xb2730000), SPH_C32(0x3dd50b77), SPH_C32(0x8a2af10a), - SPH_C32(0xef1363d4), SPH_C32(0xab0c28c0), SPH_C32(0x24a30000), - SPH_C32(0x6a410015), SPH_C32(0xeabe3200), SPH_C32(0x73dd0000), - SPH_C32(0xe2ee6ab8), SPH_C32(0xea5004ea), SPH_C32(0xc928f243), - SPH_C32(0x787e441a) }, - { SPH_C32(0x61ff0000), SPH_C32(0xb6ac003d), SPH_C32(0x60a42000), - SPH_C32(0xe9420000), SPH_C32(0x945e795a), SPH_C32(0x18da2f72), - SPH_C32(0x89228c49), SPH_C32(0x90b437d5), SPH_C32(0x4d800000), - SPH_C32(0xa6010015), SPH_C32(0x8b17e000), SPH_C32(0x865b0000), - SPH_C32(0x9ed23715), SPH_C32(0x433b0923), SPH_C32(0xb9af46d9), - SPH_C32(0x995ccfac) }, - { SPH_C32(0x7fb10000), SPH_C32(0x6863003d), SPH_C32(0x0d5c2180), - SPH_C32(0x9e660000), SPH_C32(0x78197ec4), SPH_C32(0xec7a463c), - SPH_C32(0x4481945b), SPH_C32(0x081e7ebb), SPH_C32(0xff860000), - SPH_C32(0x63680015), SPH_C32(0xa314f200), SPH_C32(0xf23c0000), - SPH_C32(0x281001e1), SPH_C32(0xa82930db), SPH_C32(0x8a7e9935), - SPH_C32(0x9012fe34) }, - { SPH_C32(0x92600000), SPH_C32(0x1cf3003e), SPH_C32(0xb145e000), - SPH_C32(0xdce00000), SPH_C32(0x8e0900be), SPH_C32(0x727b649f), - SPH_C32(0xb23b59f4), SPH_C32(0xcdd70139), SPH_C32(0xd3f40000), - SPH_C32(0xdf9e0014), SPH_C32(0x06326000), SPH_C32(0xe88a0000), - SPH_C32(0xb8a67fcc), SPH_C32(0x5dd12a75), SPH_C32(0x339210bc), - SPH_C32(0x8aeb81e3) }, - { SPH_C32(0x8c2e0000), SPH_C32(0xc23c003e), SPH_C32(0xdcbde180), - SPH_C32(0xabc40000), SPH_C32(0x624e0720), SPH_C32(0x86db0dd1), - SPH_C32(0x7f9841e6), SPH_C32(0x557d4857), SPH_C32(0x61f20000), - SPH_C32(0x1af70014), SPH_C32(0x2e317200), SPH_C32(0x9ced0000), - SPH_C32(0x0e644938), SPH_C32(0xb6c3138d), SPH_C32(0x0043cf50), - SPH_C32(0x83a5b07b) }, - { SPH_C32(0x3ca30000), SPH_C32(0x80bc003f), SPH_C32(0xc8940000), - SPH_C32(0xf0f50000), SPH_C32(0xcbc5750d), SPH_C32(0x142bd3a9), - SPH_C32(0x19a9ae7b), SPH_C32(0x6ec55742), SPH_C32(0x08d10000), - SPH_C32(0xd6b70014), SPH_C32(0x4f98a000), SPH_C32(0x696b0000), - SPH_C32(0x72581495), SPH_C32(0x1fa81e44), SPH_C32(0x70c47bca), - SPH_C32(0x62873bcd) }, - { SPH_C32(0x22ed0000), SPH_C32(0x5e73003f), SPH_C32(0xa56c0180), - SPH_C32(0x87d10000), SPH_C32(0x27827293), SPH_C32(0xe08bbae7), - SPH_C32(0xd40ab669), SPH_C32(0xf66f1e2c), SPH_C32(0xbad70000), - SPH_C32(0x13de0014), SPH_C32(0x679bb200), SPH_C32(0x1d0c0000), - SPH_C32(0xc49a2261), SPH_C32(0xf4ba27bc), SPH_C32(0x4315a426), - SPH_C32(0x6bc90a55) }, - { SPH_C32(0x49450000), SPH_C32(0x15da003e), SPH_C32(0xf8ef2000), - SPH_C32(0x5d010000), SPH_C32(0x44f76be7), SPH_C32(0x300250ae), - SPH_C32(0xf16d3282), SPH_C32(0x25bbbb17), SPH_C32(0xa6120000), - SPH_C32(0x4af80015), SPH_C32(0x36494000), SPH_C32(0x457e0000), - SPH_C32(0x37946126), SPH_C32(0x79f8a972), SPH_C32(0xdb568c45), - SPH_C32(0xc1956db6) }, - { SPH_C32(0x570b0000), SPH_C32(0xcb15003e), SPH_C32(0x95172180), - SPH_C32(0x2a250000), SPH_C32(0xa8b06c79), SPH_C32(0xc4a239e0), - SPH_C32(0x3cce2a90), SPH_C32(0xbd11f279), SPH_C32(0x14140000), - SPH_C32(0x8f910015), SPH_C32(0x1e4a5200), SPH_C32(0x31190000), - SPH_C32(0x815657d2), SPH_C32(0x92ea908a), SPH_C32(0xe88753a9), - SPH_C32(0xc8db5c2e) }, - { SPH_C32(0xe7860000), SPH_C32(0x8995003f), SPH_C32(0x813ec000), - SPH_C32(0x71140000), SPH_C32(0x013b1e54), SPH_C32(0x5652e798), - SPH_C32(0x5affc50d), SPH_C32(0x86a9ed6c), SPH_C32(0x7d370000), - SPH_C32(0x43d10015), SPH_C32(0x7fe38000), SPH_C32(0xc49f0000), - SPH_C32(0xfd6a0a7f), SPH_C32(0x3b819d43), SPH_C32(0x9800e733), - SPH_C32(0x29f9d798) }, - { SPH_C32(0xf9c80000), SPH_C32(0x575a003f), SPH_C32(0xecc6c180), - SPH_C32(0x06300000), SPH_C32(0xed7c19ca), SPH_C32(0xa2f28ed6), - SPH_C32(0x975cdd1f), SPH_C32(0x1e03a402), SPH_C32(0xcf310000), - SPH_C32(0x86b80015), SPH_C32(0x57e09200), SPH_C32(0xb0f80000), - SPH_C32(0x4ba83c8b), SPH_C32(0xd093a4bb), SPH_C32(0xabd138df), - SPH_C32(0x20b7e600) }, - { SPH_C32(0x24ae0000), SPH_C32(0xc61a003c), SPH_C32(0xa42b6000), - SPH_C32(0x06720000), SPH_C32(0x78d45ada), SPH_C32(0x44493815), - SPH_C32(0x4049b15a), SPH_C32(0x6b6fc3b4), SPH_C32(0x558d0000), - SPH_C32(0xe0a70016), SPH_C32(0xe7a88000), SPH_C32(0x70dc0000), - SPH_C32(0x2dc318c2), SPH_C32(0x1359e29f), SPH_C32(0xe04f59f8), - SPH_C32(0x9cf65b5a) }, - { SPH_C32(0x3ae00000), SPH_C32(0x18d5003c), SPH_C32(0xc9d36180), - SPH_C32(0x71560000), SPH_C32(0x94935d44), SPH_C32(0xb0e9515b), - SPH_C32(0x8deaa948), SPH_C32(0xf3c58ada), SPH_C32(0xe78b0000), - SPH_C32(0x25ce0016), SPH_C32(0xcfab9200), SPH_C32(0x04bb0000), - SPH_C32(0x9b012e36), SPH_C32(0xf84bdb67), SPH_C32(0xd39e8614), - SPH_C32(0x95b86ac2) }, - { SPH_C32(0x8a6d0000), SPH_C32(0x5a55003d), SPH_C32(0xddfa8000), - SPH_C32(0x2a670000), SPH_C32(0x3d182f69), SPH_C32(0x22198f23), - SPH_C32(0xebdb46d5), SPH_C32(0xc87d95cf), SPH_C32(0x8ea80000), - SPH_C32(0xe98e0016), SPH_C32(0xae024000), SPH_C32(0xf13d0000), - SPH_C32(0xe73d739b), SPH_C32(0x5120d6ae), SPH_C32(0xa319328e), - SPH_C32(0x749ae174) }, - { SPH_C32(0x94230000), SPH_C32(0x849a003d), SPH_C32(0xb0028180), - SPH_C32(0x5d430000), SPH_C32(0xd15f28f7), SPH_C32(0xd6b9e66d), - SPH_C32(0x26785ec7), SPH_C32(0x50d7dca1), SPH_C32(0x3cae0000), - SPH_C32(0x2ce70016), SPH_C32(0x86015200), SPH_C32(0x855a0000), - SPH_C32(0x51ff456f), SPH_C32(0xba32ef56), SPH_C32(0x90c8ed62), - SPH_C32(0x7dd4d0ec) }, - { SPH_C32(0xff8b0000), SPH_C32(0xcf33003c), SPH_C32(0xed81a000), - SPH_C32(0x87930000), SPH_C32(0xb22a3183), SPH_C32(0x06300c24), - SPH_C32(0x031fda2c), SPH_C32(0x8303799a), SPH_C32(0x206b0000), - SPH_C32(0x75c10017), SPH_C32(0xd7d3a000), SPH_C32(0xdd280000), - SPH_C32(0xa2f10628), SPH_C32(0x37706198), SPH_C32(0x088bc501), - SPH_C32(0xd788b70f) }, - { SPH_C32(0xe1c50000), SPH_C32(0x11fc003c), SPH_C32(0x8079a180), - SPH_C32(0xf0b70000), SPH_C32(0x5e6d361d), SPH_C32(0xf290656a), - SPH_C32(0xcebcc23e), SPH_C32(0x1ba930f4), SPH_C32(0x926d0000), - SPH_C32(0xb0a80017), SPH_C32(0xffd0b200), SPH_C32(0xa94f0000), - SPH_C32(0x143330dc), SPH_C32(0xdc625860), SPH_C32(0x3b5a1aed), - SPH_C32(0xdec68697) }, - { SPH_C32(0x51480000), SPH_C32(0x537c003d), SPH_C32(0x94504000), - SPH_C32(0xab860000), SPH_C32(0xf7e64430), SPH_C32(0x6060bb12), - SPH_C32(0xa88d2da3), SPH_C32(0x20112fe1), SPH_C32(0xfb4e0000), - SPH_C32(0x7ce80017), SPH_C32(0x9e796000), SPH_C32(0x5cc90000), - SPH_C32(0x680f6d71), SPH_C32(0x750955a9), SPH_C32(0x4bddae77), - SPH_C32(0x3fe40d21) }, - { SPH_C32(0x4f060000), SPH_C32(0x8db3003d), SPH_C32(0xf9a84180), - SPH_C32(0xdca20000), SPH_C32(0x1ba143ae), SPH_C32(0x94c0d25c), - SPH_C32(0x652e35b1), SPH_C32(0xb8bb668f), SPH_C32(0x49480000), - SPH_C32(0xb9810017), SPH_C32(0xb67a7200), SPH_C32(0x28ae0000), - SPH_C32(0xdecd5b85), SPH_C32(0x9e1b6c51), SPH_C32(0x780c719b), - SPH_C32(0x36aa3cb9) }, - { SPH_C32(0xa2d70000), SPH_C32(0xf923003e), SPH_C32(0x45b18000), - SPH_C32(0x9e240000), SPH_C32(0xedb13dd4), SPH_C32(0x0ac1f0ff), - SPH_C32(0x9394f81e), SPH_C32(0x7d72190d), SPH_C32(0x653a0000), - SPH_C32(0x05770016), SPH_C32(0x135ce000), SPH_C32(0x32180000), - SPH_C32(0x4e7b25a8), SPH_C32(0x6be376ff), SPH_C32(0xc1e0f812), - SPH_C32(0x2c53436e) }, - { SPH_C32(0xbc990000), SPH_C32(0x27ec003e), SPH_C32(0x28498180), - SPH_C32(0xe9000000), SPH_C32(0x01f63a4a), SPH_C32(0xfe6199b1), - SPH_C32(0x5e37e00c), SPH_C32(0xe5d85063), SPH_C32(0xd73c0000), - SPH_C32(0xc01e0016), SPH_C32(0x3b5ff200), SPH_C32(0x467f0000), - SPH_C32(0xf8b9135c), SPH_C32(0x80f14f07), SPH_C32(0xf23127fe), - SPH_C32(0x251d72f6) }, - { SPH_C32(0x0c140000), SPH_C32(0x656c003f), SPH_C32(0x3c606000), - SPH_C32(0xb2310000), SPH_C32(0xa87d4867), SPH_C32(0x6c9147c9), - SPH_C32(0x38060f91), SPH_C32(0xde604f76), SPH_C32(0xbe1f0000), - SPH_C32(0x0c5e0016), SPH_C32(0x5af62000), SPH_C32(0xb3f90000), - SPH_C32(0x84854ef1), SPH_C32(0x299a42ce), SPH_C32(0x82b69364), - SPH_C32(0xc43ff940) }, - { SPH_C32(0x125a0000), SPH_C32(0xbba3003f), SPH_C32(0x51986180), - SPH_C32(0xc5150000), SPH_C32(0x443a4ff9), SPH_C32(0x98312e87), - SPH_C32(0xf5a51783), SPH_C32(0x46ca0618), SPH_C32(0x0c190000), - SPH_C32(0xc9370016), SPH_C32(0x72f53200), SPH_C32(0xc79e0000), - SPH_C32(0x32477805), SPH_C32(0xc2887b36), SPH_C32(0xb1674c88), - SPH_C32(0xcd71c8d8) }, - { SPH_C32(0x79f20000), SPH_C32(0xf00a003e), SPH_C32(0x0c1b4000), - SPH_C32(0x1fc50000), SPH_C32(0x274f568d), SPH_C32(0x48b8c4ce), - SPH_C32(0xd0c29368), SPH_C32(0x951ea323), SPH_C32(0x10dc0000), - SPH_C32(0x90110017), SPH_C32(0x2327c000), SPH_C32(0x9fec0000), - SPH_C32(0xc1493b42), SPH_C32(0x4fcaf5f8), SPH_C32(0x292464eb), - SPH_C32(0x672daf3b) }, - { SPH_C32(0x67bc0000), SPH_C32(0x2ec5003e), SPH_C32(0x61e34180), - SPH_C32(0x68e10000), SPH_C32(0xcb085113), SPH_C32(0xbc18ad80), - SPH_C32(0x1d618b7a), SPH_C32(0x0db4ea4d), SPH_C32(0xa2da0000), - SPH_C32(0x55780017), SPH_C32(0x0b24d200), SPH_C32(0xeb8b0000), - SPH_C32(0x778b0db6), SPH_C32(0xa4d8cc00), SPH_C32(0x1af5bb07), - SPH_C32(0x6e639ea3) }, - { SPH_C32(0xd7310000), SPH_C32(0x6c45003f), SPH_C32(0x75caa000), - SPH_C32(0x33d00000), SPH_C32(0x6283233e), SPH_C32(0x2ee873f8), - SPH_C32(0x7b5064e7), SPH_C32(0x360cf558), SPH_C32(0xcbf90000), - SPH_C32(0x99380017), SPH_C32(0x6a8d0000), SPH_C32(0x1e0d0000), - SPH_C32(0x0bb7501b), SPH_C32(0x0db3c1c9), SPH_C32(0x6a720f9d), - SPH_C32(0x8f411515) }, - { SPH_C32(0xc97f0000), SPH_C32(0xb28a003f), SPH_C32(0x1832a180), - SPH_C32(0x44f40000), SPH_C32(0x8ec424a0), SPH_C32(0xda481ab6), - SPH_C32(0xb6f37cf5), SPH_C32(0xaea6bc36), SPH_C32(0x79ff0000), - SPH_C32(0x5c510017), SPH_C32(0x428e1200), SPH_C32(0x6a6a0000), - SPH_C32(0xbd7566ef), SPH_C32(0xe6a1f831), SPH_C32(0x59a3d071), - SPH_C32(0x860f248d) }, - { SPH_C32(0xe3430000), SPH_C32(0x3a4e0014), SPH_C32(0xf2c60000), - SPH_C32(0xaa4e0000), SPH_C32(0xdb1e42a6), SPH_C32(0x256bbe15), - SPH_C32(0x123db156), SPH_C32(0x3a4e99d7), SPH_C32(0xf75a0000), - SPH_C32(0x19840028), SPH_C32(0xa2190000), SPH_C32(0xeef80000), - SPH_C32(0xc0722516), SPH_C32(0x19981260), SPH_C32(0x73dba1e6), - SPH_C32(0xe1844257) }, - { SPH_C32(0xfd0d0000), SPH_C32(0xe4810014), SPH_C32(0x9f3e0180), - SPH_C32(0xdd6a0000), SPH_C32(0x37594538), SPH_C32(0xd1cbd75b), - SPH_C32(0xdf9ea944), SPH_C32(0xa2e4d0b9), SPH_C32(0x455c0000), - SPH_C32(0xdced0028), SPH_C32(0x8a1a1200), SPH_C32(0x9a9f0000), - SPH_C32(0x76b013e2), SPH_C32(0xf28a2b98), SPH_C32(0x400a7e0a), - SPH_C32(0xe8ca73cf) }, - { SPH_C32(0x4d800000), SPH_C32(0xa6010015), SPH_C32(0x8b17e000), - SPH_C32(0x865b0000), SPH_C32(0x9ed23715), SPH_C32(0x433b0923), - SPH_C32(0xb9af46d9), SPH_C32(0x995ccfac), SPH_C32(0x2c7f0000), - SPH_C32(0x10ad0028), SPH_C32(0xebb3c000), SPH_C32(0x6f190000), - SPH_C32(0x0a8c4e4f), SPH_C32(0x5be12651), SPH_C32(0x308dca90), - SPH_C32(0x09e8f879) }, - { SPH_C32(0x53ce0000), SPH_C32(0x78ce0015), SPH_C32(0xe6efe180), - SPH_C32(0xf17f0000), SPH_C32(0x7295308b), SPH_C32(0xb79b606d), - SPH_C32(0x740c5ecb), SPH_C32(0x01f686c2), SPH_C32(0x9e790000), - SPH_C32(0xd5c40028), SPH_C32(0xc3b0d200), SPH_C32(0x1b7e0000), - SPH_C32(0xbc4e78bb), SPH_C32(0xb0f31fa9), SPH_C32(0x035c157c), - SPH_C32(0x00a6c9e1) }, - { SPH_C32(0x38660000), SPH_C32(0x33670014), SPH_C32(0xbb6cc000), - SPH_C32(0x2baf0000), SPH_C32(0x11e029ff), SPH_C32(0x67128a24), - SPH_C32(0x516bda20), SPH_C32(0xd22223f9), SPH_C32(0x82bc0000), - SPH_C32(0x8ce20029), SPH_C32(0x92622000), SPH_C32(0x430c0000), - SPH_C32(0x4f403bfc), SPH_C32(0x3db19167), SPH_C32(0x9b1f3d1f), - SPH_C32(0xaafaae02) }, - { SPH_C32(0x26280000), SPH_C32(0xeda80014), SPH_C32(0xd694c180), - SPH_C32(0x5c8b0000), SPH_C32(0xfda72e61), SPH_C32(0x93b2e36a), - SPH_C32(0x9cc8c232), SPH_C32(0x4a886a97), SPH_C32(0x30ba0000), - SPH_C32(0x498b0029), SPH_C32(0xba613200), SPH_C32(0x376b0000), - SPH_C32(0xf9820d08), SPH_C32(0xd6a3a89f), SPH_C32(0xa8cee2f3), - SPH_C32(0xa3b49f9a) }, - { SPH_C32(0x96a50000), SPH_C32(0xaf280015), SPH_C32(0xc2bd2000), - SPH_C32(0x07ba0000), SPH_C32(0x542c5c4c), SPH_C32(0x01423d12), - SPH_C32(0xfaf92daf), SPH_C32(0x71307582), SPH_C32(0x59990000), - SPH_C32(0x85cb0029), SPH_C32(0xdbc8e000), SPH_C32(0xc2ed0000), - SPH_C32(0x85be50a5), SPH_C32(0x7fc8a556), SPH_C32(0xd8495669), - SPH_C32(0x4296142c) }, - { SPH_C32(0x88eb0000), SPH_C32(0x71e70015), SPH_C32(0xaf452180), - SPH_C32(0x709e0000), SPH_C32(0xb86b5bd2), SPH_C32(0xf5e2545c), - SPH_C32(0x375a35bd), SPH_C32(0xe99a3cec), SPH_C32(0xeb9f0000), - SPH_C32(0x40a20029), SPH_C32(0xf3cbf200), SPH_C32(0xb68a0000), - SPH_C32(0x337c6651), SPH_C32(0x94da9cae), SPH_C32(0xeb988985), - SPH_C32(0x4bd825b4) }, - { SPH_C32(0x653a0000), SPH_C32(0x05770016), SPH_C32(0x135ce000), - SPH_C32(0x32180000), SPH_C32(0x4e7b25a8), SPH_C32(0x6be376ff), - SPH_C32(0xc1e0f812), SPH_C32(0x2c53436e), SPH_C32(0xc7ed0000), - SPH_C32(0xfc540028), SPH_C32(0x56ed6000), SPH_C32(0xac3c0000), - SPH_C32(0xa3ca187c), SPH_C32(0x61228600), SPH_C32(0x5274000c), - SPH_C32(0x51215a63) }, - { SPH_C32(0x7b740000), SPH_C32(0xdbb80016), SPH_C32(0x7ea4e180), - SPH_C32(0x453c0000), SPH_C32(0xa23c2236), SPH_C32(0x9f431fb1), - SPH_C32(0x0c43e000), SPH_C32(0xb4f90a00), SPH_C32(0x75eb0000), - SPH_C32(0x393d0028), SPH_C32(0x7eee7200), SPH_C32(0xd85b0000), - SPH_C32(0x15082e88), SPH_C32(0x8a30bff8), SPH_C32(0x61a5dfe0), - SPH_C32(0x586f6bfb) }, - { SPH_C32(0xcbf90000), SPH_C32(0x99380017), SPH_C32(0x6a8d0000), - SPH_C32(0x1e0d0000), SPH_C32(0x0bb7501b), SPH_C32(0x0db3c1c9), - SPH_C32(0x6a720f9d), SPH_C32(0x8f411515), SPH_C32(0x1cc80000), - SPH_C32(0xf57d0028), SPH_C32(0x1f47a000), SPH_C32(0x2ddd0000), - SPH_C32(0x69347325), SPH_C32(0x235bb231), SPH_C32(0x11226b7a), - SPH_C32(0xb94de04d) }, - { SPH_C32(0xd5b70000), SPH_C32(0x47f70017), SPH_C32(0x07750180), - SPH_C32(0x69290000), SPH_C32(0xe7f05785), SPH_C32(0xf913a887), - SPH_C32(0xa7d1178f), SPH_C32(0x17eb5c7b), SPH_C32(0xaece0000), - SPH_C32(0x30140028), SPH_C32(0x3744b200), SPH_C32(0x59ba0000), - SPH_C32(0xdff645d1), SPH_C32(0xc8498bc9), SPH_C32(0x22f3b496), - SPH_C32(0xb003d1d5) }, - { SPH_C32(0xbe1f0000), SPH_C32(0x0c5e0016), SPH_C32(0x5af62000), - SPH_C32(0xb3f90000), SPH_C32(0x84854ef1), SPH_C32(0x299a42ce), - SPH_C32(0x82b69364), SPH_C32(0xc43ff940), SPH_C32(0xb20b0000), - SPH_C32(0x69320029), SPH_C32(0x66964000), SPH_C32(0x01c80000), - SPH_C32(0x2cf80696), SPH_C32(0x450b0507), SPH_C32(0xbab09cf5), - SPH_C32(0x1a5fb636) }, - { SPH_C32(0xa0510000), SPH_C32(0xd2910016), SPH_C32(0x370e2180), - SPH_C32(0xc4dd0000), SPH_C32(0x68c2496f), SPH_C32(0xdd3a2b80), - SPH_C32(0x4f158b76), SPH_C32(0x5c95b02e), SPH_C32(0x000d0000), - SPH_C32(0xac5b0029), SPH_C32(0x4e955200), SPH_C32(0x75af0000), - SPH_C32(0x9a3a3062), SPH_C32(0xae193cff), SPH_C32(0x89614319), - SPH_C32(0x131187ae) }, - { SPH_C32(0x10dc0000), SPH_C32(0x90110017), SPH_C32(0x2327c000), - SPH_C32(0x9fec0000), SPH_C32(0xc1493b42), SPH_C32(0x4fcaf5f8), - SPH_C32(0x292464eb), SPH_C32(0x672daf3b), SPH_C32(0x692e0000), - SPH_C32(0x601b0029), SPH_C32(0x2f3c8000), SPH_C32(0x80290000), - SPH_C32(0xe6066dcf), SPH_C32(0x07723136), SPH_C32(0xf9e6f783), - SPH_C32(0xf2330c18) }, - { SPH_C32(0x0e920000), SPH_C32(0x4ede0017), SPH_C32(0x4edfc180), - SPH_C32(0xe8c80000), SPH_C32(0x2d0e3cdc), SPH_C32(0xbb6a9cb6), - SPH_C32(0xe4877cf9), SPH_C32(0xff87e655), SPH_C32(0xdb280000), - SPH_C32(0xa5720029), SPH_C32(0x073f9200), SPH_C32(0xf44e0000), - SPH_C32(0x50c45b3b), SPH_C32(0xec6008ce), SPH_C32(0xca37286f), - SPH_C32(0xfb7d3d80) }, - { SPH_C32(0xd3f40000), SPH_C32(0xdf9e0014), SPH_C32(0x06326000), - SPH_C32(0xe88a0000), SPH_C32(0xb8a67fcc), SPH_C32(0x5dd12a75), - SPH_C32(0x339210bc), SPH_C32(0x8aeb81e3), SPH_C32(0x41940000), - SPH_C32(0xc36d002a), SPH_C32(0xb7778000), SPH_C32(0x346a0000), - SPH_C32(0x36af7f72), SPH_C32(0x2faa4eea), SPH_C32(0x81a94948), - SPH_C32(0x473c80da) }, - { SPH_C32(0xcdba0000), SPH_C32(0x01510014), SPH_C32(0x6bca6180), - SPH_C32(0x9fae0000), SPH_C32(0x54e17852), SPH_C32(0xa971433b), - SPH_C32(0xfe3108ae), SPH_C32(0x1241c88d), SPH_C32(0xf3920000), - SPH_C32(0x0604002a), SPH_C32(0x9f749200), SPH_C32(0x400d0000), - SPH_C32(0x806d4986), SPH_C32(0xc4b87712), SPH_C32(0xb27896a4), - SPH_C32(0x4e72b142) }, - { SPH_C32(0x7d370000), SPH_C32(0x43d10015), SPH_C32(0x7fe38000), - SPH_C32(0xc49f0000), SPH_C32(0xfd6a0a7f), SPH_C32(0x3b819d43), - SPH_C32(0x9800e733), SPH_C32(0x29f9d798), SPH_C32(0x9ab10000), - SPH_C32(0xca44002a), SPH_C32(0xfedd4000), SPH_C32(0xb58b0000), - SPH_C32(0xfc51142b), SPH_C32(0x6dd37adb), SPH_C32(0xc2ff223e), - SPH_C32(0xaf503af4) }, - { SPH_C32(0x63790000), SPH_C32(0x9d1e0015), SPH_C32(0x121b8180), - SPH_C32(0xb3bb0000), SPH_C32(0x112d0de1), SPH_C32(0xcf21f40d), - SPH_C32(0x55a3ff21), SPH_C32(0xb1539ef6), SPH_C32(0x28b70000), - SPH_C32(0x0f2d002a), SPH_C32(0xd6de5200), SPH_C32(0xc1ec0000), - SPH_C32(0x4a9322df), SPH_C32(0x86c14323), SPH_C32(0xf12efdd2), - SPH_C32(0xa61e0b6c) }, - { SPH_C32(0x08d10000), SPH_C32(0xd6b70014), SPH_C32(0x4f98a000), - SPH_C32(0x696b0000), SPH_C32(0x72581495), SPH_C32(0x1fa81e44), - SPH_C32(0x70c47bca), SPH_C32(0x62873bcd), SPH_C32(0x34720000), - SPH_C32(0x560b002b), SPH_C32(0x870ca000), SPH_C32(0x999e0000), - SPH_C32(0xb99d6198), SPH_C32(0x0b83cded), SPH_C32(0x696dd5b1), - SPH_C32(0x0c426c8f) }, - { SPH_C32(0x169f0000), SPH_C32(0x08780014), SPH_C32(0x2260a180), - SPH_C32(0x1e4f0000), SPH_C32(0x9e1f130b), SPH_C32(0xeb08770a), - SPH_C32(0xbd6763d8), SPH_C32(0xfa2d72a3), SPH_C32(0x86740000), - SPH_C32(0x9362002b), SPH_C32(0xaf0fb200), SPH_C32(0xedf90000), - SPH_C32(0x0f5f576c), SPH_C32(0xe091f415), SPH_C32(0x5abc0a5d), - SPH_C32(0x050c5d17) }, - { SPH_C32(0xa6120000), SPH_C32(0x4af80015), SPH_C32(0x36494000), - SPH_C32(0x457e0000), SPH_C32(0x37946126), SPH_C32(0x79f8a972), - SPH_C32(0xdb568c45), SPH_C32(0xc1956db6), SPH_C32(0xef570000), - SPH_C32(0x5f22002b), SPH_C32(0xcea66000), SPH_C32(0x187f0000), - SPH_C32(0x73630ac1), SPH_C32(0x49faf9dc), SPH_C32(0x2a3bbec7), - SPH_C32(0xe42ed6a1) }, - { SPH_C32(0xb85c0000), SPH_C32(0x94370015), SPH_C32(0x5bb14180), - SPH_C32(0x325a0000), SPH_C32(0xdbd366b8), SPH_C32(0x8d58c03c), - SPH_C32(0x16f59457), SPH_C32(0x593f24d8), SPH_C32(0x5d510000), - SPH_C32(0x9a4b002b), SPH_C32(0xe6a57200), SPH_C32(0x6c180000), - SPH_C32(0xc5a13c35), SPH_C32(0xa2e8c024), SPH_C32(0x19ea612b), - SPH_C32(0xed60e739) }, - { SPH_C32(0x558d0000), SPH_C32(0xe0a70016), SPH_C32(0xe7a88000), - SPH_C32(0x70dc0000), SPH_C32(0x2dc318c2), SPH_C32(0x1359e29f), - SPH_C32(0xe04f59f8), SPH_C32(0x9cf65b5a), SPH_C32(0x71230000), - SPH_C32(0x26bd002a), SPH_C32(0x4383e000), SPH_C32(0x76ae0000), - SPH_C32(0x55174218), SPH_C32(0x5710da8a), SPH_C32(0xa006e8a2), - SPH_C32(0xf79998ee) }, - { SPH_C32(0x4bc30000), SPH_C32(0x3e680016), SPH_C32(0x8a508180), - SPH_C32(0x07f80000), SPH_C32(0xc1841f5c), SPH_C32(0xe7f98bd1), - SPH_C32(0x2dec41ea), SPH_C32(0x045c1234), SPH_C32(0xc3250000), - SPH_C32(0xe3d4002a), SPH_C32(0x6b80f200), SPH_C32(0x02c90000), - SPH_C32(0xe3d574ec), SPH_C32(0xbc02e372), SPH_C32(0x93d7374e), - SPH_C32(0xfed7a976) }, - { SPH_C32(0xfb4e0000), SPH_C32(0x7ce80017), SPH_C32(0x9e796000), - SPH_C32(0x5cc90000), SPH_C32(0x680f6d71), SPH_C32(0x750955a9), - SPH_C32(0x4bddae77), SPH_C32(0x3fe40d21), SPH_C32(0xaa060000), - SPH_C32(0x2f94002a), SPH_C32(0x0a292000), SPH_C32(0xf74f0000), - SPH_C32(0x9fe92941), SPH_C32(0x1569eebb), SPH_C32(0xe35083d4), - SPH_C32(0x1ff522c0) }, - { SPH_C32(0xe5000000), SPH_C32(0xa2270017), SPH_C32(0xf3816180), - SPH_C32(0x2bed0000), SPH_C32(0x84486aef), SPH_C32(0x81a93ce7), - SPH_C32(0x867eb665), SPH_C32(0xa74e444f), SPH_C32(0x18000000), - SPH_C32(0xeafd002a), SPH_C32(0x222a3200), SPH_C32(0x83280000), - SPH_C32(0x292b1fb5), SPH_C32(0xfe7bd743), SPH_C32(0xd0815c38), - SPH_C32(0x16bb1358) }, - { SPH_C32(0x8ea80000), SPH_C32(0xe98e0016), SPH_C32(0xae024000), - SPH_C32(0xf13d0000), SPH_C32(0xe73d739b), SPH_C32(0x5120d6ae), - SPH_C32(0xa319328e), SPH_C32(0x749ae174), SPH_C32(0x04c50000), - SPH_C32(0xb3db002b), SPH_C32(0x73f8c000), SPH_C32(0xdb5a0000), - SPH_C32(0xda255cf2), SPH_C32(0x7339598d), SPH_C32(0x48c2745b), - SPH_C32(0xbce774bb) }, - { SPH_C32(0x90e60000), SPH_C32(0x37410016), SPH_C32(0xc3fa4180), - SPH_C32(0x86190000), SPH_C32(0x0b7a7405), SPH_C32(0xa580bfe0), - SPH_C32(0x6eba2a9c), SPH_C32(0xec30a81a), SPH_C32(0xb6c30000), - SPH_C32(0x76b2002b), SPH_C32(0x5bfbd200), SPH_C32(0xaf3d0000), - SPH_C32(0x6ce76a06), SPH_C32(0x982b6075), SPH_C32(0x7b13abb7), - SPH_C32(0xb5a94523) }, - { SPH_C32(0x206b0000), SPH_C32(0x75c10017), SPH_C32(0xd7d3a000), - SPH_C32(0xdd280000), SPH_C32(0xa2f10628), SPH_C32(0x37706198), - SPH_C32(0x088bc501), SPH_C32(0xd788b70f), SPH_C32(0xdfe00000), - SPH_C32(0xbaf2002b), SPH_C32(0x3a520000), SPH_C32(0x5abb0000), - SPH_C32(0x10db37ab), SPH_C32(0x31406dbc), SPH_C32(0x0b941f2d), - SPH_C32(0x548bce95) }, - { SPH_C32(0x3e250000), SPH_C32(0xab0e0017), SPH_C32(0xba2ba180), - SPH_C32(0xaa0c0000), SPH_C32(0x4eb601b6), SPH_C32(0xc3d008d6), - SPH_C32(0xc528dd13), SPH_C32(0x4f22fe61), SPH_C32(0x6de60000), - SPH_C32(0x7f9b002b), SPH_C32(0x12511200), SPH_C32(0x2edc0000), - SPH_C32(0xa619015f), SPH_C32(0xda525444), SPH_C32(0x3845c0c1), - SPH_C32(0x5dc5ff0d) }, - { SPH_C32(0xf75a0000), SPH_C32(0x19840028), SPH_C32(0xa2190000), - SPH_C32(0xeef80000), SPH_C32(0xc0722516), SPH_C32(0x19981260), - SPH_C32(0x73dba1e6), SPH_C32(0xe1844257), SPH_C32(0x14190000), - SPH_C32(0x23ca003c), SPH_C32(0x50df0000), SPH_C32(0x44b60000), - SPH_C32(0x1b6c67b0), SPH_C32(0x3cf3ac75), SPH_C32(0x61e610b0), - SPH_C32(0xdbcadb80) }, - { SPH_C32(0xe9140000), SPH_C32(0xc74b0028), SPH_C32(0xcfe10180), - SPH_C32(0x99dc0000), SPH_C32(0x2c352288), SPH_C32(0xed387b2e), - SPH_C32(0xbe78b9f4), SPH_C32(0x792e0b39), SPH_C32(0xa61f0000), - SPH_C32(0xe6a3003c), SPH_C32(0x78dc1200), SPH_C32(0x30d10000), - SPH_C32(0xadae5144), SPH_C32(0xd7e1958d), SPH_C32(0x5237cf5c), - SPH_C32(0xd284ea18) }, - { SPH_C32(0x59990000), SPH_C32(0x85cb0029), SPH_C32(0xdbc8e000), - SPH_C32(0xc2ed0000), SPH_C32(0x85be50a5), SPH_C32(0x7fc8a556), - SPH_C32(0xd8495669), SPH_C32(0x4296142c), SPH_C32(0xcf3c0000), - SPH_C32(0x2ae3003c), SPH_C32(0x1975c000), SPH_C32(0xc5570000), - SPH_C32(0xd1920ce9), SPH_C32(0x7e8a9844), SPH_C32(0x22b07bc6), - SPH_C32(0x33a661ae) }, - { SPH_C32(0x47d70000), SPH_C32(0x5b040029), SPH_C32(0xb630e180), - SPH_C32(0xb5c90000), SPH_C32(0x69f9573b), SPH_C32(0x8b68cc18), - SPH_C32(0x15ea4e7b), SPH_C32(0xda3c5d42), SPH_C32(0x7d3a0000), - SPH_C32(0xef8a003c), SPH_C32(0x3176d200), SPH_C32(0xb1300000), - SPH_C32(0x67503a1d), SPH_C32(0x9598a1bc), SPH_C32(0x1161a42a), - SPH_C32(0x3ae85036) }, - { SPH_C32(0x2c7f0000), SPH_C32(0x10ad0028), SPH_C32(0xebb3c000), - SPH_C32(0x6f190000), SPH_C32(0x0a8c4e4f), SPH_C32(0x5be12651), - SPH_C32(0x308dca90), SPH_C32(0x09e8f879), SPH_C32(0x61ff0000), - SPH_C32(0xb6ac003d), SPH_C32(0x60a42000), SPH_C32(0xe9420000), - SPH_C32(0x945e795a), SPH_C32(0x18da2f72), SPH_C32(0x89228c49), - SPH_C32(0x90b437d5) }, - { SPH_C32(0x32310000), SPH_C32(0xce620028), SPH_C32(0x864bc180), - SPH_C32(0x183d0000), SPH_C32(0xe6cb49d1), SPH_C32(0xaf414f1f), - SPH_C32(0xfd2ed282), SPH_C32(0x9142b117), SPH_C32(0xd3f90000), - SPH_C32(0x73c5003d), SPH_C32(0x48a73200), SPH_C32(0x9d250000), - SPH_C32(0x229c4fae), SPH_C32(0xf3c8168a), SPH_C32(0xbaf353a5), - SPH_C32(0x99fa064d) }, - { SPH_C32(0x82bc0000), SPH_C32(0x8ce20029), SPH_C32(0x92622000), - SPH_C32(0x430c0000), SPH_C32(0x4f403bfc), SPH_C32(0x3db19167), - SPH_C32(0x9b1f3d1f), SPH_C32(0xaafaae02), SPH_C32(0xbada0000), - SPH_C32(0xbf85003d), SPH_C32(0x290ee000), SPH_C32(0x68a30000), - SPH_C32(0x5ea01203), SPH_C32(0x5aa31b43), SPH_C32(0xca74e73f), - SPH_C32(0x78d88dfb) }, - { SPH_C32(0x9cf20000), SPH_C32(0x522d0029), SPH_C32(0xff9a2180), - SPH_C32(0x34280000), SPH_C32(0xa3073c62), SPH_C32(0xc911f829), - SPH_C32(0x56bc250d), SPH_C32(0x3250e76c), SPH_C32(0x08dc0000), - SPH_C32(0x7aec003d), SPH_C32(0x010df200), SPH_C32(0x1cc40000), - SPH_C32(0xe86224f7), SPH_C32(0xb1b122bb), SPH_C32(0xf9a538d3), - SPH_C32(0x7196bc63) }, - { SPH_C32(0x71230000), SPH_C32(0x26bd002a), SPH_C32(0x4383e000), - SPH_C32(0x76ae0000), SPH_C32(0x55174218), SPH_C32(0x5710da8a), - SPH_C32(0xa006e8a2), SPH_C32(0xf79998ee), SPH_C32(0x24ae0000), - SPH_C32(0xc61a003c), SPH_C32(0xa42b6000), SPH_C32(0x06720000), - SPH_C32(0x78d45ada), SPH_C32(0x44493815), SPH_C32(0x4049b15a), - SPH_C32(0x6b6fc3b4) }, - { SPH_C32(0x6f6d0000), SPH_C32(0xf872002a), SPH_C32(0x2e7be180), - SPH_C32(0x018a0000), SPH_C32(0xb9504586), SPH_C32(0xa3b0b3c4), - SPH_C32(0x6da5f0b0), SPH_C32(0x6f33d180), SPH_C32(0x96a80000), - SPH_C32(0x0373003c), SPH_C32(0x8c287200), SPH_C32(0x72150000), - SPH_C32(0xce166c2e), SPH_C32(0xaf5b01ed), SPH_C32(0x73986eb6), - SPH_C32(0x6221f22c) }, - { SPH_C32(0xdfe00000), SPH_C32(0xbaf2002b), SPH_C32(0x3a520000), - SPH_C32(0x5abb0000), SPH_C32(0x10db37ab), SPH_C32(0x31406dbc), - SPH_C32(0x0b941f2d), SPH_C32(0x548bce95), SPH_C32(0xff8b0000), - SPH_C32(0xcf33003c), SPH_C32(0xed81a000), SPH_C32(0x87930000), - SPH_C32(0xb22a3183), SPH_C32(0x06300c24), SPH_C32(0x031fda2c), - SPH_C32(0x8303799a) }, - { SPH_C32(0xc1ae0000), SPH_C32(0x643d002b), SPH_C32(0x57aa0180), - SPH_C32(0x2d9f0000), SPH_C32(0xfc9c3035), SPH_C32(0xc5e004f2), - SPH_C32(0xc637073f), SPH_C32(0xcc2187fb), SPH_C32(0x4d8d0000), - SPH_C32(0x0a5a003c), SPH_C32(0xc582b200), SPH_C32(0xf3f40000), - SPH_C32(0x04e80777), SPH_C32(0xed2235dc), SPH_C32(0x30ce05c0), - SPH_C32(0x8a4d4802) }, - { SPH_C32(0xaa060000), SPH_C32(0x2f94002a), SPH_C32(0x0a292000), - SPH_C32(0xf74f0000), SPH_C32(0x9fe92941), SPH_C32(0x1569eebb), - SPH_C32(0xe35083d4), SPH_C32(0x1ff522c0), SPH_C32(0x51480000), - SPH_C32(0x537c003d), SPH_C32(0x94504000), SPH_C32(0xab860000), - SPH_C32(0xf7e64430), SPH_C32(0x6060bb12), SPH_C32(0xa88d2da3), - SPH_C32(0x20112fe1) }, - { SPH_C32(0xb4480000), SPH_C32(0xf15b002a), SPH_C32(0x67d12180), - SPH_C32(0x806b0000), SPH_C32(0x73ae2edf), SPH_C32(0xe1c987f5), - SPH_C32(0x2ef39bc6), SPH_C32(0x875f6bae), SPH_C32(0xe34e0000), - SPH_C32(0x9615003d), SPH_C32(0xbc535200), SPH_C32(0xdfe10000), - SPH_C32(0x412472c4), SPH_C32(0x8b7282ea), SPH_C32(0x9b5cf24f), - SPH_C32(0x295f1e79) }, - { SPH_C32(0x04c50000), SPH_C32(0xb3db002b), SPH_C32(0x73f8c000), - SPH_C32(0xdb5a0000), SPH_C32(0xda255cf2), SPH_C32(0x7339598d), - SPH_C32(0x48c2745b), SPH_C32(0xbce774bb), SPH_C32(0x8a6d0000), - SPH_C32(0x5a55003d), SPH_C32(0xddfa8000), SPH_C32(0x2a670000), - SPH_C32(0x3d182f69), SPH_C32(0x22198f23), SPH_C32(0xebdb46d5), - SPH_C32(0xc87d95cf) }, - { SPH_C32(0x1a8b0000), SPH_C32(0x6d14002b), SPH_C32(0x1e00c180), - SPH_C32(0xac7e0000), SPH_C32(0x36625b6c), SPH_C32(0x879930c3), - SPH_C32(0x85616c49), SPH_C32(0x244d3dd5), SPH_C32(0x386b0000), - SPH_C32(0x9f3c003d), SPH_C32(0xf5f99200), SPH_C32(0x5e000000), - SPH_C32(0x8bda199d), SPH_C32(0xc90bb6db), SPH_C32(0xd80a9939), - SPH_C32(0xc133a457) }, - { SPH_C32(0xc7ed0000), SPH_C32(0xfc540028), SPH_C32(0x56ed6000), - SPH_C32(0xac3c0000), SPH_C32(0xa3ca187c), SPH_C32(0x61228600), - SPH_C32(0x5274000c), SPH_C32(0x51215a63), SPH_C32(0xa2d70000), - SPH_C32(0xf923003e), SPH_C32(0x45b18000), SPH_C32(0x9e240000), - SPH_C32(0xedb13dd4), SPH_C32(0x0ac1f0ff), SPH_C32(0x9394f81e), - SPH_C32(0x7d72190d) }, - { SPH_C32(0xd9a30000), SPH_C32(0x229b0028), SPH_C32(0x3b156180), - SPH_C32(0xdb180000), SPH_C32(0x4f8d1fe2), SPH_C32(0x9582ef4e), - SPH_C32(0x9fd7181e), SPH_C32(0xc98b130d), SPH_C32(0x10d10000), - SPH_C32(0x3c4a003e), SPH_C32(0x6db29200), SPH_C32(0xea430000), - SPH_C32(0x5b730b20), SPH_C32(0xe1d3c907), SPH_C32(0xa04527f2), - SPH_C32(0x743c2895) }, - { SPH_C32(0x692e0000), SPH_C32(0x601b0029), SPH_C32(0x2f3c8000), - SPH_C32(0x80290000), SPH_C32(0xe6066dcf), SPH_C32(0x07723136), - SPH_C32(0xf9e6f783), SPH_C32(0xf2330c18), SPH_C32(0x79f20000), - SPH_C32(0xf00a003e), SPH_C32(0x0c1b4000), SPH_C32(0x1fc50000), - SPH_C32(0x274f568d), SPH_C32(0x48b8c4ce), SPH_C32(0xd0c29368), - SPH_C32(0x951ea323) }, - { SPH_C32(0x77600000), SPH_C32(0xbed40029), SPH_C32(0x42c48180), - SPH_C32(0xf70d0000), SPH_C32(0x0a416a51), SPH_C32(0xf3d25878), - SPH_C32(0x3445ef91), SPH_C32(0x6a994576), SPH_C32(0xcbf40000), - SPH_C32(0x3563003e), SPH_C32(0x24185200), SPH_C32(0x6ba20000), - SPH_C32(0x918d6079), SPH_C32(0xa3aafd36), SPH_C32(0xe3134c84), - SPH_C32(0x9c5092bb) }, - { SPH_C32(0x1cc80000), SPH_C32(0xf57d0028), SPH_C32(0x1f47a000), - SPH_C32(0x2ddd0000), SPH_C32(0x69347325), SPH_C32(0x235bb231), - SPH_C32(0x11226b7a), SPH_C32(0xb94de04d), SPH_C32(0xd7310000), - SPH_C32(0x6c45003f), SPH_C32(0x75caa000), SPH_C32(0x33d00000), - SPH_C32(0x6283233e), SPH_C32(0x2ee873f8), SPH_C32(0x7b5064e7), - SPH_C32(0x360cf558) }, - { SPH_C32(0x02860000), SPH_C32(0x2bb20028), SPH_C32(0x72bfa180), - SPH_C32(0x5af90000), SPH_C32(0x857374bb), SPH_C32(0xd7fbdb7f), - SPH_C32(0xdc817368), SPH_C32(0x21e7a923), SPH_C32(0x65370000), - SPH_C32(0xa92c003f), SPH_C32(0x5dc9b200), SPH_C32(0x47b70000), - SPH_C32(0xd44115ca), SPH_C32(0xc5fa4a00), SPH_C32(0x4881bb0b), - SPH_C32(0x3f42c4c0) }, - { SPH_C32(0xb20b0000), SPH_C32(0x69320029), SPH_C32(0x66964000), - SPH_C32(0x01c80000), SPH_C32(0x2cf80696), SPH_C32(0x450b0507), - SPH_C32(0xbab09cf5), SPH_C32(0x1a5fb636), SPH_C32(0x0c140000), - SPH_C32(0x656c003f), SPH_C32(0x3c606000), SPH_C32(0xb2310000), - SPH_C32(0xa87d4867), SPH_C32(0x6c9147c9), SPH_C32(0x38060f91), - SPH_C32(0xde604f76) }, - { SPH_C32(0xac450000), SPH_C32(0xb7fd0029), SPH_C32(0x0b6e4180), - SPH_C32(0x76ec0000), SPH_C32(0xc0bf0108), SPH_C32(0xb1ab6c49), - SPH_C32(0x771384e7), SPH_C32(0x82f5ff58), SPH_C32(0xbe120000), - SPH_C32(0xa005003f), SPH_C32(0x14637200), SPH_C32(0xc6560000), - SPH_C32(0x1ebf7e93), SPH_C32(0x87837e31), SPH_C32(0x0bd7d07d), - SPH_C32(0xd72e7eee) }, - { SPH_C32(0x41940000), SPH_C32(0xc36d002a), SPH_C32(0xb7778000), - SPH_C32(0x346a0000), SPH_C32(0x36af7f72), SPH_C32(0x2faa4eea), - SPH_C32(0x81a94948), SPH_C32(0x473c80da), SPH_C32(0x92600000), - SPH_C32(0x1cf3003e), SPH_C32(0xb145e000), SPH_C32(0xdce00000), - SPH_C32(0x8e0900be), SPH_C32(0x727b649f), SPH_C32(0xb23b59f4), - SPH_C32(0xcdd70139) }, - { SPH_C32(0x5fda0000), SPH_C32(0x1da2002a), SPH_C32(0xda8f8180), - SPH_C32(0x434e0000), SPH_C32(0xdae878ec), SPH_C32(0xdb0a27a4), - SPH_C32(0x4c0a515a), SPH_C32(0xdf96c9b4), SPH_C32(0x20660000), - SPH_C32(0xd99a003e), SPH_C32(0x9946f200), SPH_C32(0xa8870000), - SPH_C32(0x38cb364a), SPH_C32(0x99695d67), SPH_C32(0x81ea8618), - SPH_C32(0xc49930a1) }, - { SPH_C32(0xef570000), SPH_C32(0x5f22002b), SPH_C32(0xcea66000), - SPH_C32(0x187f0000), SPH_C32(0x73630ac1), SPH_C32(0x49faf9dc), - SPH_C32(0x2a3bbec7), SPH_C32(0xe42ed6a1), SPH_C32(0x49450000), - SPH_C32(0x15da003e), SPH_C32(0xf8ef2000), SPH_C32(0x5d010000), - SPH_C32(0x44f76be7), SPH_C32(0x300250ae), SPH_C32(0xf16d3282), - SPH_C32(0x25bbbb17) }, - { SPH_C32(0xf1190000), SPH_C32(0x81ed002b), SPH_C32(0xa35e6180), - SPH_C32(0x6f5b0000), SPH_C32(0x9f240d5f), SPH_C32(0xbd5a9092), - SPH_C32(0xe798a6d5), SPH_C32(0x7c849fcf), SPH_C32(0xfb430000), - SPH_C32(0xd0b3003e), SPH_C32(0xd0ec3200), SPH_C32(0x29660000), - SPH_C32(0xf2355d13), SPH_C32(0xdb106956), SPH_C32(0xc2bced6e), - SPH_C32(0x2cf58a8f) }, - { SPH_C32(0x9ab10000), SPH_C32(0xca44002a), SPH_C32(0xfedd4000), - SPH_C32(0xb58b0000), SPH_C32(0xfc51142b), SPH_C32(0x6dd37adb), - SPH_C32(0xc2ff223e), SPH_C32(0xaf503af4), SPH_C32(0xe7860000), - SPH_C32(0x8995003f), SPH_C32(0x813ec000), SPH_C32(0x71140000), - SPH_C32(0x013b1e54), SPH_C32(0x5652e798), SPH_C32(0x5affc50d), - SPH_C32(0x86a9ed6c) }, - { SPH_C32(0x84ff0000), SPH_C32(0x148b002a), SPH_C32(0x93254180), - SPH_C32(0xc2af0000), SPH_C32(0x101613b5), SPH_C32(0x99731395), - SPH_C32(0x0f5c3a2c), SPH_C32(0x37fa739a), SPH_C32(0x55800000), - SPH_C32(0x4cfc003f), SPH_C32(0xa93dd200), SPH_C32(0x05730000), - SPH_C32(0xb7f928a0), SPH_C32(0xbd40de60), SPH_C32(0x692e1ae1), - SPH_C32(0x8fe7dcf4) }, - { SPH_C32(0x34720000), SPH_C32(0x560b002b), SPH_C32(0x870ca000), - SPH_C32(0x999e0000), SPH_C32(0xb99d6198), SPH_C32(0x0b83cded), - SPH_C32(0x696dd5b1), SPH_C32(0x0c426c8f), SPH_C32(0x3ca30000), - SPH_C32(0x80bc003f), SPH_C32(0xc8940000), SPH_C32(0xf0f50000), - SPH_C32(0xcbc5750d), SPH_C32(0x142bd3a9), SPH_C32(0x19a9ae7b), - SPH_C32(0x6ec55742) }, - { SPH_C32(0x2a3c0000), SPH_C32(0x88c4002b), SPH_C32(0xeaf4a180), - SPH_C32(0xeeba0000), SPH_C32(0x55da6606), SPH_C32(0xff23a4a3), - SPH_C32(0xa4cecda3), SPH_C32(0x94e825e1), SPH_C32(0x8ea50000), - SPH_C32(0x45d5003f), SPH_C32(0xe0971200), SPH_C32(0x84920000), - SPH_C32(0x7d0743f9), SPH_C32(0xff39ea51), SPH_C32(0x2a787197), - SPH_C32(0x678b66da) } -}; - -static const sph_u32 T512_35[128][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x52500000), SPH_C32(0x29540000), SPH_C32(0x6a61004e), - SPH_C32(0xf0ff0000), SPH_C32(0x9a317eec), SPH_C32(0x452341ce), - SPH_C32(0xcf568fe5), SPH_C32(0x5303130f), SPH_C32(0x538d0000), - SPH_C32(0xa9fc0000), SPH_C32(0x9ef70006), SPH_C32(0x56ff0000), - SPH_C32(0x0ae4004e), SPH_C32(0x92c5cdf9), SPH_C32(0xa9444018), - SPH_C32(0x7f975691) }, - { SPH_C32(0x538d0000), SPH_C32(0xa9fc0000), SPH_C32(0x9ef70006), - SPH_C32(0x56ff0000), SPH_C32(0x0ae4004e), SPH_C32(0x92c5cdf9), - SPH_C32(0xa9444018), SPH_C32(0x7f975691), SPH_C32(0x01dd0000), - SPH_C32(0x80a80000), SPH_C32(0xf4960048), SPH_C32(0xa6000000), - SPH_C32(0x90d57ea2), SPH_C32(0xd7e68c37), SPH_C32(0x6612cffd), - SPH_C32(0x2c94459e) }, - { SPH_C32(0x01dd0000), SPH_C32(0x80a80000), SPH_C32(0xf4960048), - SPH_C32(0xa6000000), SPH_C32(0x90d57ea2), SPH_C32(0xd7e68c37), - SPH_C32(0x6612cffd), SPH_C32(0x2c94459e), SPH_C32(0x52500000), - SPH_C32(0x29540000), SPH_C32(0x6a61004e), SPH_C32(0xf0ff0000), - SPH_C32(0x9a317eec), SPH_C32(0x452341ce), SPH_C32(0xcf568fe5), - SPH_C32(0x5303130f) }, - { SPH_C32(0xcc140000), SPH_C32(0xa5630000), SPH_C32(0x5ab90780), - SPH_C32(0x3b500000), SPH_C32(0x4bd013ff), SPH_C32(0x879b3418), - SPH_C32(0x694348c1), SPH_C32(0xca5a87fe), SPH_C32(0x819e0000), - SPH_C32(0xec570000), SPH_C32(0x66320280), SPH_C32(0x95f30000), - SPH_C32(0x5da92802), SPH_C32(0x48f43cbc), SPH_C32(0xe65aa22d), - SPH_C32(0x8e67b7fa) }, - { SPH_C32(0x9e440000), SPH_C32(0x8c370000), SPH_C32(0x30d807ce), - SPH_C32(0xcbaf0000), SPH_C32(0xd1e16d13), SPH_C32(0xc2b875d6), - SPH_C32(0xa615c724), SPH_C32(0x995994f1), SPH_C32(0xd2130000), - SPH_C32(0x45ab0000), SPH_C32(0xf8c50286), SPH_C32(0xc30c0000), - SPH_C32(0x574d284c), SPH_C32(0xda31f145), SPH_C32(0x4f1ee235), - SPH_C32(0xf1f0e16b) }, - { SPH_C32(0x9f990000), SPH_C32(0x0c9f0000), SPH_C32(0xc44e0786), - SPH_C32(0x6daf0000), SPH_C32(0x413413b1), SPH_C32(0x155ef9e1), - SPH_C32(0xc00708d9), SPH_C32(0xb5cdd16f), SPH_C32(0x80430000), - SPH_C32(0x6cff0000), SPH_C32(0x92a402c8), SPH_C32(0x33f30000), - SPH_C32(0xcd7c56a0), SPH_C32(0x9f12b08b), SPH_C32(0x80486dd0), - SPH_C32(0xa2f3f264) }, - { SPH_C32(0xcdc90000), SPH_C32(0x25cb0000), SPH_C32(0xae2f07c8), - SPH_C32(0x9d500000), SPH_C32(0xdb056d5d), SPH_C32(0x507db82f), - SPH_C32(0x0f51873c), SPH_C32(0xe6cec260), SPH_C32(0xd3ce0000), - SPH_C32(0xc5030000), SPH_C32(0x0c5302ce), SPH_C32(0x650c0000), - SPH_C32(0xc79856ee), SPH_C32(0x0dd77d72), SPH_C32(0x290c2dc8), - SPH_C32(0xdd64a4f5) }, - { SPH_C32(0x819e0000), SPH_C32(0xec570000), SPH_C32(0x66320280), - SPH_C32(0x95f30000), SPH_C32(0x5da92802), SPH_C32(0x48f43cbc), - SPH_C32(0xe65aa22d), SPH_C32(0x8e67b7fa), SPH_C32(0x4d8a0000), - SPH_C32(0x49340000), SPH_C32(0x3c8b0500), SPH_C32(0xaea30000), - SPH_C32(0x16793bfd), SPH_C32(0xcf6f08a4), SPH_C32(0x8f19eaec), - SPH_C32(0x443d3004) }, - { SPH_C32(0xd3ce0000), SPH_C32(0xc5030000), SPH_C32(0x0c5302ce), - SPH_C32(0x650c0000), SPH_C32(0xc79856ee), SPH_C32(0x0dd77d72), - SPH_C32(0x290c2dc8), SPH_C32(0xdd64a4f5), SPH_C32(0x1e070000), - SPH_C32(0xe0c80000), SPH_C32(0xa27c0506), SPH_C32(0xf85c0000), - SPH_C32(0x1c9d3bb3), SPH_C32(0x5daac55d), SPH_C32(0x265daaf4), - SPH_C32(0x3baa6695) }, - { SPH_C32(0xd2130000), SPH_C32(0x45ab0000), SPH_C32(0xf8c50286), - SPH_C32(0xc30c0000), SPH_C32(0x574d284c), SPH_C32(0xda31f145), - SPH_C32(0x4f1ee235), SPH_C32(0xf1f0e16b), SPH_C32(0x4c570000), - SPH_C32(0xc99c0000), SPH_C32(0xc81d0548), SPH_C32(0x08a30000), - SPH_C32(0x86ac455f), SPH_C32(0x18898493), SPH_C32(0xe90b2511), - SPH_C32(0x68a9759a) }, - { SPH_C32(0x80430000), SPH_C32(0x6cff0000), SPH_C32(0x92a402c8), - SPH_C32(0x33f30000), SPH_C32(0xcd7c56a0), SPH_C32(0x9f12b08b), - SPH_C32(0x80486dd0), SPH_C32(0xa2f3f264), SPH_C32(0x1fda0000), - SPH_C32(0x60600000), SPH_C32(0x56ea054e), SPH_C32(0x5e5c0000), - SPH_C32(0x8c484511), SPH_C32(0x8a4c496a), SPH_C32(0x404f6509), - SPH_C32(0x173e230b) }, - { SPH_C32(0x4d8a0000), SPH_C32(0x49340000), SPH_C32(0x3c8b0500), - SPH_C32(0xaea30000), SPH_C32(0x16793bfd), SPH_C32(0xcf6f08a4), - SPH_C32(0x8f19eaec), SPH_C32(0x443d3004), SPH_C32(0xcc140000), - SPH_C32(0xa5630000), SPH_C32(0x5ab90780), SPH_C32(0x3b500000), - SPH_C32(0x4bd013ff), SPH_C32(0x879b3418), SPH_C32(0x694348c1), - SPH_C32(0xca5a87fe) }, - { SPH_C32(0x1fda0000), SPH_C32(0x60600000), SPH_C32(0x56ea054e), - SPH_C32(0x5e5c0000), SPH_C32(0x8c484511), SPH_C32(0x8a4c496a), - SPH_C32(0x404f6509), SPH_C32(0x173e230b), SPH_C32(0x9f990000), - SPH_C32(0x0c9f0000), SPH_C32(0xc44e0786), SPH_C32(0x6daf0000), - SPH_C32(0x413413b1), SPH_C32(0x155ef9e1), SPH_C32(0xc00708d9), - SPH_C32(0xb5cdd16f) }, - { SPH_C32(0x1e070000), SPH_C32(0xe0c80000), SPH_C32(0xa27c0506), - SPH_C32(0xf85c0000), SPH_C32(0x1c9d3bb3), SPH_C32(0x5daac55d), - SPH_C32(0x265daaf4), SPH_C32(0x3baa6695), SPH_C32(0xcdc90000), - SPH_C32(0x25cb0000), SPH_C32(0xae2f07c8), SPH_C32(0x9d500000), - SPH_C32(0xdb056d5d), SPH_C32(0x507db82f), SPH_C32(0x0f51873c), - SPH_C32(0xe6cec260) }, - { SPH_C32(0x4c570000), SPH_C32(0xc99c0000), SPH_C32(0xc81d0548), - SPH_C32(0x08a30000), SPH_C32(0x86ac455f), SPH_C32(0x18898493), - SPH_C32(0xe90b2511), SPH_C32(0x68a9759a), SPH_C32(0x9e440000), - SPH_C32(0x8c370000), SPH_C32(0x30d807ce), SPH_C32(0xcbaf0000), - SPH_C32(0xd1e16d13), SPH_C32(0xc2b875d6), SPH_C32(0xa615c724), - SPH_C32(0x995994f1) }, - { SPH_C32(0x78230000), SPH_C32(0x12fc0000), SPH_C32(0xa93a0b80), - SPH_C32(0x90a50000), SPH_C32(0x713e2879), SPH_C32(0x7ee98924), - SPH_C32(0xf08ca062), SPH_C32(0x636f8bab), SPH_C32(0x02af0000), - SPH_C32(0xb7280000), SPH_C32(0xba1c0300), SPH_C32(0x56980000), - SPH_C32(0xba8d45d3), SPH_C32(0x8048c667), SPH_C32(0xa95c149a), - SPH_C32(0xf4f6ea7b) }, - { SPH_C32(0x2a730000), SPH_C32(0x3ba80000), SPH_C32(0xc35b0bce), - SPH_C32(0x605a0000), SPH_C32(0xeb0f5695), SPH_C32(0x3bcac8ea), - SPH_C32(0x3fda2f87), SPH_C32(0x306c98a4), SPH_C32(0x51220000), - SPH_C32(0x1ed40000), SPH_C32(0x24eb0306), SPH_C32(0x00670000), - SPH_C32(0xb069459d), SPH_C32(0x128d0b9e), SPH_C32(0x00185482), - SPH_C32(0x8b61bcea) }, - { SPH_C32(0x2bae0000), SPH_C32(0xbb000000), SPH_C32(0x37cd0b86), - SPH_C32(0xc65a0000), SPH_C32(0x7bda2837), SPH_C32(0xec2c44dd), - SPH_C32(0x59c8e07a), SPH_C32(0x1cf8dd3a), SPH_C32(0x03720000), - SPH_C32(0x37800000), SPH_C32(0x4e8a0348), SPH_C32(0xf0980000), - SPH_C32(0x2a583b71), SPH_C32(0x57ae4a50), SPH_C32(0xcf4edb67), - SPH_C32(0xd862afe5) }, - { SPH_C32(0x79fe0000), SPH_C32(0x92540000), SPH_C32(0x5dac0bc8), - SPH_C32(0x36a50000), SPH_C32(0xe1eb56db), SPH_C32(0xa90f0513), - SPH_C32(0x969e6f9f), SPH_C32(0x4ffbce35), SPH_C32(0x50ff0000), - SPH_C32(0x9e7c0000), SPH_C32(0xd07d034e), SPH_C32(0xa6670000), - SPH_C32(0x20bc3b3f), SPH_C32(0xc56b87a9), SPH_C32(0x660a9b7f), - SPH_C32(0xa7f5f974) }, - { SPH_C32(0xb4370000), SPH_C32(0xb79f0000), SPH_C32(0xf3830c00), - SPH_C32(0xabf50000), SPH_C32(0x3aee3b86), SPH_C32(0xf972bd3c), - SPH_C32(0x99cfe8a3), SPH_C32(0xa9350c55), SPH_C32(0x83310000), - SPH_C32(0x5b7f0000), SPH_C32(0xdc2e0180), SPH_C32(0xc36b0000), - SPH_C32(0xe7246dd1), SPH_C32(0xc8bcfadb), SPH_C32(0x4f06b6b7), - SPH_C32(0x7a915d81) }, - { SPH_C32(0xe6670000), SPH_C32(0x9ecb0000), SPH_C32(0x99e20c4e), - SPH_C32(0x5b0a0000), SPH_C32(0xa0df456a), SPH_C32(0xbc51fcf2), - SPH_C32(0x56996746), SPH_C32(0xfa361f5a), SPH_C32(0xd0bc0000), - SPH_C32(0xf2830000), SPH_C32(0x42d90186), SPH_C32(0x95940000), - SPH_C32(0xedc06d9f), SPH_C32(0x5a793722), SPH_C32(0xe642f6af), - SPH_C32(0x05060b10) }, - { SPH_C32(0xe7ba0000), SPH_C32(0x1e630000), SPH_C32(0x6d740c06), - SPH_C32(0xfd0a0000), SPH_C32(0x300a3bc8), SPH_C32(0x6bb770c5), - SPH_C32(0x308ba8bb), SPH_C32(0xd6a25ac4), SPH_C32(0x82ec0000), - SPH_C32(0xdbd70000), SPH_C32(0x28b801c8), SPH_C32(0x656b0000), - SPH_C32(0x77f11373), SPH_C32(0x1f5a76ec), SPH_C32(0x2914794a), - SPH_C32(0x5605181f) }, - { SPH_C32(0xb5ea0000), SPH_C32(0x37370000), SPH_C32(0x07150c48), - SPH_C32(0x0df50000), SPH_C32(0xaa3b4524), SPH_C32(0x2e94310b), - SPH_C32(0xffdd275e), SPH_C32(0x85a149cb), SPH_C32(0xd1610000), - SPH_C32(0x722b0000), SPH_C32(0xb64f01ce), SPH_C32(0x33940000), - SPH_C32(0x7d15133d), SPH_C32(0x8d9fbb15), SPH_C32(0x80503952), - SPH_C32(0x29924e8e) }, - { SPH_C32(0xf9bd0000), SPH_C32(0xfeab0000), SPH_C32(0xcf080900), - SPH_C32(0x05560000), SPH_C32(0x2c97007b), SPH_C32(0x361db598), - SPH_C32(0x16d6024f), SPH_C32(0xed083c51), SPH_C32(0x4f250000), - SPH_C32(0xfe1c0000), SPH_C32(0x86970600), SPH_C32(0xf83b0000), - SPH_C32(0xacf47e2e), SPH_C32(0x4f27cec3), SPH_C32(0x2645fe76), - SPH_C32(0xb0cbda7f) }, - { SPH_C32(0xabed0000), SPH_C32(0xd7ff0000), SPH_C32(0xa569094e), - SPH_C32(0xf5a90000), SPH_C32(0xb6a67e97), SPH_C32(0x733ef456), - SPH_C32(0xd9808daa), SPH_C32(0xbe0b2f5e), SPH_C32(0x1ca80000), - SPH_C32(0x57e00000), SPH_C32(0x18600606), SPH_C32(0xaec40000), - SPH_C32(0xa6107e60), SPH_C32(0xdde2033a), SPH_C32(0x8f01be6e), - SPH_C32(0xcf5c8cee) }, - { SPH_C32(0xaa300000), SPH_C32(0x57570000), SPH_C32(0x51ff0906), - SPH_C32(0x53a90000), SPH_C32(0x26730035), SPH_C32(0xa4d87861), - SPH_C32(0xbf924257), SPH_C32(0x929f6ac0), SPH_C32(0x4ef80000), - SPH_C32(0x7eb40000), SPH_C32(0x72010648), SPH_C32(0x5e3b0000), - SPH_C32(0x3c21008c), SPH_C32(0x98c142f4), SPH_C32(0x4057318b), - SPH_C32(0x9c5f9fe1) }, - { SPH_C32(0xf8600000), SPH_C32(0x7e030000), SPH_C32(0x3b9e0948), - SPH_C32(0xa3560000), SPH_C32(0xbc427ed9), SPH_C32(0xe1fb39af), - SPH_C32(0x70c4cdb2), SPH_C32(0xc19c79cf), SPH_C32(0x1d750000), - SPH_C32(0xd7480000), SPH_C32(0xecf6064e), SPH_C32(0x08c40000), - SPH_C32(0x36c500c2), SPH_C32(0x0a048f0d), SPH_C32(0xe9137193), - SPH_C32(0xe3c8c970) }, - { SPH_C32(0x35a90000), SPH_C32(0x5bc80000), SPH_C32(0x95b10e80), - SPH_C32(0x3e060000), SPH_C32(0x67471384), SPH_C32(0xb1868180), - SPH_C32(0x7f954a8e), SPH_C32(0x2752bbaf), SPH_C32(0xcebb0000), - SPH_C32(0x124b0000), SPH_C32(0xe0a50480), SPH_C32(0x6dc80000), - SPH_C32(0xf15d562c), SPH_C32(0x07d3f27f), SPH_C32(0xc01f5c5b), - SPH_C32(0x3eac6d85) }, - { SPH_C32(0x67f90000), SPH_C32(0x729c0000), SPH_C32(0xffd00ece), - SPH_C32(0xcef90000), SPH_C32(0xfd766d68), SPH_C32(0xf4a5c04e), - SPH_C32(0xb0c3c56b), SPH_C32(0x7451a8a0), SPH_C32(0x9d360000), - SPH_C32(0xbbb70000), SPH_C32(0x7e520486), SPH_C32(0x3b370000), - SPH_C32(0xfbb95662), SPH_C32(0x95163f86), SPH_C32(0x695b1c43), - SPH_C32(0x413b3b14) }, - { SPH_C32(0x66240000), SPH_C32(0xf2340000), SPH_C32(0x0b460e86), - SPH_C32(0x68f90000), SPH_C32(0x6da313ca), SPH_C32(0x23434c79), - SPH_C32(0xd6d10a96), SPH_C32(0x58c5ed3e), SPH_C32(0xcf660000), - SPH_C32(0x92e30000), SPH_C32(0x143304c8), SPH_C32(0xcbc80000), - SPH_C32(0x6188288e), SPH_C32(0xd0357e48), SPH_C32(0xa60d93a6), - SPH_C32(0x1238281b) }, - { SPH_C32(0x34740000), SPH_C32(0xdb600000), SPH_C32(0x61270ec8), - SPH_C32(0x98060000), SPH_C32(0xf7926d26), SPH_C32(0x66600db7), - SPH_C32(0x19878573), SPH_C32(0x0bc6fe31), SPH_C32(0x9ceb0000), - SPH_C32(0x3b1f0000), SPH_C32(0x8ac404ce), SPH_C32(0x9d370000), - SPH_C32(0x6b6c28c0), SPH_C32(0x42f0b3b1), SPH_C32(0x0f49d3be), - SPH_C32(0x6daf7e8a) }, - { SPH_C32(0x02af0000), SPH_C32(0xb7280000), SPH_C32(0xba1c0300), - SPH_C32(0x56980000), SPH_C32(0xba8d45d3), SPH_C32(0x8048c667), - SPH_C32(0xa95c149a), SPH_C32(0xf4f6ea7b), SPH_C32(0x7a8c0000), - SPH_C32(0xa5d40000), SPH_C32(0x13260880), SPH_C32(0xc63d0000), - SPH_C32(0xcbb36daa), SPH_C32(0xfea14f43), SPH_C32(0x59d0b4f8), - SPH_C32(0x979961d0) }, - { SPH_C32(0x50ff0000), SPH_C32(0x9e7c0000), SPH_C32(0xd07d034e), - SPH_C32(0xa6670000), SPH_C32(0x20bc3b3f), SPH_C32(0xc56b87a9), - SPH_C32(0x660a9b7f), SPH_C32(0xa7f5f974), SPH_C32(0x29010000), - SPH_C32(0x0c280000), SPH_C32(0x8dd10886), SPH_C32(0x90c20000), - SPH_C32(0xc1576de4), SPH_C32(0x6c6482ba), SPH_C32(0xf094f4e0), - SPH_C32(0xe80e3741) }, - { SPH_C32(0x51220000), SPH_C32(0x1ed40000), SPH_C32(0x24eb0306), - SPH_C32(0x00670000), SPH_C32(0xb069459d), SPH_C32(0x128d0b9e), - SPH_C32(0x00185482), SPH_C32(0x8b61bcea), SPH_C32(0x7b510000), - SPH_C32(0x257c0000), SPH_C32(0xe7b008c8), SPH_C32(0x603d0000), - SPH_C32(0x5b661308), SPH_C32(0x2947c374), SPH_C32(0x3fc27b05), - SPH_C32(0xbb0d244e) }, - { SPH_C32(0x03720000), SPH_C32(0x37800000), SPH_C32(0x4e8a0348), - SPH_C32(0xf0980000), SPH_C32(0x2a583b71), SPH_C32(0x57ae4a50), - SPH_C32(0xcf4edb67), SPH_C32(0xd862afe5), SPH_C32(0x28dc0000), - SPH_C32(0x8c800000), SPH_C32(0x794708ce), SPH_C32(0x36c20000), - SPH_C32(0x51821346), SPH_C32(0xbb820e8d), SPH_C32(0x96863b1d), - SPH_C32(0xc49a72df) }, - { SPH_C32(0xcebb0000), SPH_C32(0x124b0000), SPH_C32(0xe0a50480), - SPH_C32(0x6dc80000), SPH_C32(0xf15d562c), SPH_C32(0x07d3f27f), - SPH_C32(0xc01f5c5b), SPH_C32(0x3eac6d85), SPH_C32(0xfb120000), - SPH_C32(0x49830000), SPH_C32(0x75140a00), SPH_C32(0x53ce0000), - SPH_C32(0x961a45a8), SPH_C32(0xb65573ff), SPH_C32(0xbf8a16d5), - SPH_C32(0x19fed62a) }, - { SPH_C32(0x9ceb0000), SPH_C32(0x3b1f0000), SPH_C32(0x8ac404ce), - SPH_C32(0x9d370000), SPH_C32(0x6b6c28c0), SPH_C32(0x42f0b3b1), - SPH_C32(0x0f49d3be), SPH_C32(0x6daf7e8a), SPH_C32(0xa89f0000), - SPH_C32(0xe07f0000), SPH_C32(0xebe30a06), SPH_C32(0x05310000), - SPH_C32(0x9cfe45e6), SPH_C32(0x2490be06), SPH_C32(0x16ce56cd), - SPH_C32(0x666980bb) }, - { SPH_C32(0x9d360000), SPH_C32(0xbbb70000), SPH_C32(0x7e520486), - SPH_C32(0x3b370000), SPH_C32(0xfbb95662), SPH_C32(0x95163f86), - SPH_C32(0x695b1c43), SPH_C32(0x413b3b14), SPH_C32(0xfacf0000), - SPH_C32(0xc92b0000), SPH_C32(0x81820a48), SPH_C32(0xf5ce0000), - SPH_C32(0x06cf3b0a), SPH_C32(0x61b3ffc8), SPH_C32(0xd998d928), - SPH_C32(0x356a93b4) }, - { SPH_C32(0xcf660000), SPH_C32(0x92e30000), SPH_C32(0x143304c8), - SPH_C32(0xcbc80000), SPH_C32(0x6188288e), SPH_C32(0xd0357e48), - SPH_C32(0xa60d93a6), SPH_C32(0x1238281b), SPH_C32(0xa9420000), - SPH_C32(0x60d70000), SPH_C32(0x1f750a4e), SPH_C32(0xa3310000), - SPH_C32(0x0c2b3b44), SPH_C32(0xf3763231), SPH_C32(0x70dc9930), - SPH_C32(0x4afdc525) }, - { SPH_C32(0x83310000), SPH_C32(0x5b7f0000), SPH_C32(0xdc2e0180), - SPH_C32(0xc36b0000), SPH_C32(0xe7246dd1), SPH_C32(0xc8bcfadb), - SPH_C32(0x4f06b6b7), SPH_C32(0x7a915d81), SPH_C32(0x37060000), - SPH_C32(0xece00000), SPH_C32(0x2fad0d80), SPH_C32(0x689e0000), - SPH_C32(0xddca5657), SPH_C32(0x31ce47e7), SPH_C32(0xd6c95e14), - SPH_C32(0xd3a451d4) }, - { SPH_C32(0xd1610000), SPH_C32(0x722b0000), SPH_C32(0xb64f01ce), - SPH_C32(0x33940000), SPH_C32(0x7d15133d), SPH_C32(0x8d9fbb15), - SPH_C32(0x80503952), SPH_C32(0x29924e8e), SPH_C32(0x648b0000), - SPH_C32(0x451c0000), SPH_C32(0xb15a0d86), SPH_C32(0x3e610000), - SPH_C32(0xd72e5619), SPH_C32(0xa30b8a1e), SPH_C32(0x7f8d1e0c), - SPH_C32(0xac330745) }, - { SPH_C32(0xd0bc0000), SPH_C32(0xf2830000), SPH_C32(0x42d90186), - SPH_C32(0x95940000), SPH_C32(0xedc06d9f), SPH_C32(0x5a793722), - SPH_C32(0xe642f6af), SPH_C32(0x05060b10), SPH_C32(0x36db0000), - SPH_C32(0x6c480000), SPH_C32(0xdb3b0dc8), SPH_C32(0xce9e0000), - SPH_C32(0x4d1f28f5), SPH_C32(0xe628cbd0), SPH_C32(0xb0db91e9), - SPH_C32(0xff30144a) }, - { SPH_C32(0x82ec0000), SPH_C32(0xdbd70000), SPH_C32(0x28b801c8), - SPH_C32(0x656b0000), SPH_C32(0x77f11373), SPH_C32(0x1f5a76ec), - SPH_C32(0x2914794a), SPH_C32(0x5605181f), SPH_C32(0x65560000), - SPH_C32(0xc5b40000), SPH_C32(0x45cc0dce), SPH_C32(0x98610000), - SPH_C32(0x47fb28bb), SPH_C32(0x74ed0629), SPH_C32(0x199fd1f1), - SPH_C32(0x80a742db) }, - { SPH_C32(0x4f250000), SPH_C32(0xfe1c0000), SPH_C32(0x86970600), - SPH_C32(0xf83b0000), SPH_C32(0xacf47e2e), SPH_C32(0x4f27cec3), - SPH_C32(0x2645fe76), SPH_C32(0xb0cbda7f), SPH_C32(0xb6980000), - SPH_C32(0x00b70000), SPH_C32(0x499f0f00), SPH_C32(0xfd6d0000), - SPH_C32(0x80637e55), SPH_C32(0x793a7b5b), SPH_C32(0x3093fc39), - SPH_C32(0x5dc3e62e) }, - { SPH_C32(0x1d750000), SPH_C32(0xd7480000), SPH_C32(0xecf6064e), - SPH_C32(0x08c40000), SPH_C32(0x36c500c2), SPH_C32(0x0a048f0d), - SPH_C32(0xe9137193), SPH_C32(0xe3c8c970), SPH_C32(0xe5150000), - SPH_C32(0xa94b0000), SPH_C32(0xd7680f06), SPH_C32(0xab920000), - SPH_C32(0x8a877e1b), SPH_C32(0xebffb6a2), SPH_C32(0x99d7bc21), - SPH_C32(0x2254b0bf) }, - { SPH_C32(0x1ca80000), SPH_C32(0x57e00000), SPH_C32(0x18600606), - SPH_C32(0xaec40000), SPH_C32(0xa6107e60), SPH_C32(0xdde2033a), - SPH_C32(0x8f01be6e), SPH_C32(0xcf5c8cee), SPH_C32(0xb7450000), - SPH_C32(0x801f0000), SPH_C32(0xbd090f48), SPH_C32(0x5b6d0000), - SPH_C32(0x10b600f7), SPH_C32(0xaedcf76c), SPH_C32(0x568133c4), - SPH_C32(0x7157a3b0) }, - { SPH_C32(0x4ef80000), SPH_C32(0x7eb40000), SPH_C32(0x72010648), - SPH_C32(0x5e3b0000), SPH_C32(0x3c21008c), SPH_C32(0x98c142f4), - SPH_C32(0x4057318b), SPH_C32(0x9c5f9fe1), SPH_C32(0xe4c80000), - SPH_C32(0x29e30000), SPH_C32(0x23fe0f4e), SPH_C32(0x0d920000), - SPH_C32(0x1a5200b9), SPH_C32(0x3c193a95), SPH_C32(0xffc573dc), - SPH_C32(0x0ec0f521) }, - { SPH_C32(0x7a8c0000), SPH_C32(0xa5d40000), SPH_C32(0x13260880), - SPH_C32(0xc63d0000), SPH_C32(0xcbb36daa), SPH_C32(0xfea14f43), - SPH_C32(0x59d0b4f8), SPH_C32(0x979961d0), SPH_C32(0x78230000), - SPH_C32(0x12fc0000), SPH_C32(0xa93a0b80), SPH_C32(0x90a50000), - SPH_C32(0x713e2879), SPH_C32(0x7ee98924), SPH_C32(0xf08ca062), - SPH_C32(0x636f8bab) }, - { SPH_C32(0x28dc0000), SPH_C32(0x8c800000), SPH_C32(0x794708ce), - SPH_C32(0x36c20000), SPH_C32(0x51821346), SPH_C32(0xbb820e8d), - SPH_C32(0x96863b1d), SPH_C32(0xc49a72df), SPH_C32(0x2bae0000), - SPH_C32(0xbb000000), SPH_C32(0x37cd0b86), SPH_C32(0xc65a0000), - SPH_C32(0x7bda2837), SPH_C32(0xec2c44dd), SPH_C32(0x59c8e07a), - SPH_C32(0x1cf8dd3a) }, - { SPH_C32(0x29010000), SPH_C32(0x0c280000), SPH_C32(0x8dd10886), - SPH_C32(0x90c20000), SPH_C32(0xc1576de4), SPH_C32(0x6c6482ba), - SPH_C32(0xf094f4e0), SPH_C32(0xe80e3741), SPH_C32(0x79fe0000), - SPH_C32(0x92540000), SPH_C32(0x5dac0bc8), SPH_C32(0x36a50000), - SPH_C32(0xe1eb56db), SPH_C32(0xa90f0513), SPH_C32(0x969e6f9f), - SPH_C32(0x4ffbce35) }, - { SPH_C32(0x7b510000), SPH_C32(0x257c0000), SPH_C32(0xe7b008c8), - SPH_C32(0x603d0000), SPH_C32(0x5b661308), SPH_C32(0x2947c374), - SPH_C32(0x3fc27b05), SPH_C32(0xbb0d244e), SPH_C32(0x2a730000), - SPH_C32(0x3ba80000), SPH_C32(0xc35b0bce), SPH_C32(0x605a0000), - SPH_C32(0xeb0f5695), SPH_C32(0x3bcac8ea), SPH_C32(0x3fda2f87), - SPH_C32(0x306c98a4) }, - { SPH_C32(0xb6980000), SPH_C32(0x00b70000), SPH_C32(0x499f0f00), - SPH_C32(0xfd6d0000), SPH_C32(0x80637e55), SPH_C32(0x793a7b5b), - SPH_C32(0x3093fc39), SPH_C32(0x5dc3e62e), SPH_C32(0xf9bd0000), - SPH_C32(0xfeab0000), SPH_C32(0xcf080900), SPH_C32(0x05560000), - SPH_C32(0x2c97007b), SPH_C32(0x361db598), SPH_C32(0x16d6024f), - SPH_C32(0xed083c51) }, - { SPH_C32(0xe4c80000), SPH_C32(0x29e30000), SPH_C32(0x23fe0f4e), - SPH_C32(0x0d920000), SPH_C32(0x1a5200b9), SPH_C32(0x3c193a95), - SPH_C32(0xffc573dc), SPH_C32(0x0ec0f521), SPH_C32(0xaa300000), - SPH_C32(0x57570000), SPH_C32(0x51ff0906), SPH_C32(0x53a90000), - SPH_C32(0x26730035), SPH_C32(0xa4d87861), SPH_C32(0xbf924257), - SPH_C32(0x929f6ac0) }, - { SPH_C32(0xe5150000), SPH_C32(0xa94b0000), SPH_C32(0xd7680f06), - SPH_C32(0xab920000), SPH_C32(0x8a877e1b), SPH_C32(0xebffb6a2), - SPH_C32(0x99d7bc21), SPH_C32(0x2254b0bf), SPH_C32(0xf8600000), - SPH_C32(0x7e030000), SPH_C32(0x3b9e0948), SPH_C32(0xa3560000), - SPH_C32(0xbc427ed9), SPH_C32(0xe1fb39af), SPH_C32(0x70c4cdb2), - SPH_C32(0xc19c79cf) }, - { SPH_C32(0xb7450000), SPH_C32(0x801f0000), SPH_C32(0xbd090f48), - SPH_C32(0x5b6d0000), SPH_C32(0x10b600f7), SPH_C32(0xaedcf76c), - SPH_C32(0x568133c4), SPH_C32(0x7157a3b0), SPH_C32(0xabed0000), - SPH_C32(0xd7ff0000), SPH_C32(0xa569094e), SPH_C32(0xf5a90000), - SPH_C32(0xb6a67e97), SPH_C32(0x733ef456), SPH_C32(0xd9808daa), - SPH_C32(0xbe0b2f5e) }, - { SPH_C32(0xfb120000), SPH_C32(0x49830000), SPH_C32(0x75140a00), - SPH_C32(0x53ce0000), SPH_C32(0x961a45a8), SPH_C32(0xb65573ff), - SPH_C32(0xbf8a16d5), SPH_C32(0x19fed62a), SPH_C32(0x35a90000), - SPH_C32(0x5bc80000), SPH_C32(0x95b10e80), SPH_C32(0x3e060000), - SPH_C32(0x67471384), SPH_C32(0xb1868180), SPH_C32(0x7f954a8e), - SPH_C32(0x2752bbaf) }, - { SPH_C32(0xa9420000), SPH_C32(0x60d70000), SPH_C32(0x1f750a4e), - SPH_C32(0xa3310000), SPH_C32(0x0c2b3b44), SPH_C32(0xf3763231), - SPH_C32(0x70dc9930), SPH_C32(0x4afdc525), SPH_C32(0x66240000), - SPH_C32(0xf2340000), SPH_C32(0x0b460e86), SPH_C32(0x68f90000), - SPH_C32(0x6da313ca), SPH_C32(0x23434c79), SPH_C32(0xd6d10a96), - SPH_C32(0x58c5ed3e) }, - { SPH_C32(0xa89f0000), SPH_C32(0xe07f0000), SPH_C32(0xebe30a06), - SPH_C32(0x05310000), SPH_C32(0x9cfe45e6), SPH_C32(0x2490be06), - SPH_C32(0x16ce56cd), SPH_C32(0x666980bb), SPH_C32(0x34740000), - SPH_C32(0xdb600000), SPH_C32(0x61270ec8), SPH_C32(0x98060000), - SPH_C32(0xf7926d26), SPH_C32(0x66600db7), SPH_C32(0x19878573), - SPH_C32(0x0bc6fe31) }, - { SPH_C32(0xfacf0000), SPH_C32(0xc92b0000), SPH_C32(0x81820a48), - SPH_C32(0xf5ce0000), SPH_C32(0x06cf3b0a), SPH_C32(0x61b3ffc8), - SPH_C32(0xd998d928), SPH_C32(0x356a93b4), SPH_C32(0x67f90000), - SPH_C32(0x729c0000), SPH_C32(0xffd00ece), SPH_C32(0xcef90000), - SPH_C32(0xfd766d68), SPH_C32(0xf4a5c04e), SPH_C32(0xb0c3c56b), - SPH_C32(0x7451a8a0) }, - { SPH_C32(0x37060000), SPH_C32(0xece00000), SPH_C32(0x2fad0d80), - SPH_C32(0x689e0000), SPH_C32(0xddca5657), SPH_C32(0x31ce47e7), - SPH_C32(0xd6c95e14), SPH_C32(0xd3a451d4), SPH_C32(0xb4370000), - SPH_C32(0xb79f0000), SPH_C32(0xf3830c00), SPH_C32(0xabf50000), - SPH_C32(0x3aee3b86), SPH_C32(0xf972bd3c), SPH_C32(0x99cfe8a3), - SPH_C32(0xa9350c55) }, - { SPH_C32(0x65560000), SPH_C32(0xc5b40000), SPH_C32(0x45cc0dce), - SPH_C32(0x98610000), SPH_C32(0x47fb28bb), SPH_C32(0x74ed0629), - SPH_C32(0x199fd1f1), SPH_C32(0x80a742db), SPH_C32(0xe7ba0000), - SPH_C32(0x1e630000), SPH_C32(0x6d740c06), SPH_C32(0xfd0a0000), - SPH_C32(0x300a3bc8), SPH_C32(0x6bb770c5), SPH_C32(0x308ba8bb), - SPH_C32(0xd6a25ac4) }, - { SPH_C32(0x648b0000), SPH_C32(0x451c0000), SPH_C32(0xb15a0d86), - SPH_C32(0x3e610000), SPH_C32(0xd72e5619), SPH_C32(0xa30b8a1e), - SPH_C32(0x7f8d1e0c), SPH_C32(0xac330745), SPH_C32(0xb5ea0000), - SPH_C32(0x37370000), SPH_C32(0x07150c48), SPH_C32(0x0df50000), - SPH_C32(0xaa3b4524), SPH_C32(0x2e94310b), SPH_C32(0xffdd275e), - SPH_C32(0x85a149cb) }, - { SPH_C32(0x36db0000), SPH_C32(0x6c480000), SPH_C32(0xdb3b0dc8), - SPH_C32(0xce9e0000), SPH_C32(0x4d1f28f5), SPH_C32(0xe628cbd0), - SPH_C32(0xb0db91e9), SPH_C32(0xff30144a), SPH_C32(0xe6670000), - SPH_C32(0x9ecb0000), SPH_C32(0x99e20c4e), SPH_C32(0x5b0a0000), - SPH_C32(0xa0df456a), SPH_C32(0xbc51fcf2), SPH_C32(0x56996746), - SPH_C32(0xfa361f5a) }, - { SPH_C32(0xac480000), SPH_C32(0x1ba60000), SPH_C32(0x45fb1380), - SPH_C32(0x03430000), SPH_C32(0x5a85316a), SPH_C32(0x1fb250b6), - SPH_C32(0xfe72c7fe), SPH_C32(0x91e478f6), SPH_C32(0x1e4e0000), - SPH_C32(0xdecf0000), SPH_C32(0x6df80180), SPH_C32(0x77240000), - SPH_C32(0xec47079e), SPH_C32(0xf4a0694e), SPH_C32(0xcda31812), - SPH_C32(0x98aa496e) }, - { SPH_C32(0xfe180000), SPH_C32(0x32f20000), SPH_C32(0x2f9a13ce), - SPH_C32(0xf3bc0000), SPH_C32(0xc0b44f86), SPH_C32(0x5a911178), - SPH_C32(0x3124481b), SPH_C32(0xc2e76bf9), SPH_C32(0x4dc30000), - SPH_C32(0x77330000), SPH_C32(0xf30f0186), SPH_C32(0x21db0000), - SPH_C32(0xe6a307d0), SPH_C32(0x6665a4b7), SPH_C32(0x64e7580a), - SPH_C32(0xe73d1fff) }, - { SPH_C32(0xffc50000), SPH_C32(0xb25a0000), SPH_C32(0xdb0c1386), - SPH_C32(0x55bc0000), SPH_C32(0x50613124), SPH_C32(0x8d779d4f), - SPH_C32(0x573687e6), SPH_C32(0xee732e67), SPH_C32(0x1f930000), - SPH_C32(0x5e670000), SPH_C32(0x996e01c8), SPH_C32(0xd1240000), - SPH_C32(0x7c92793c), SPH_C32(0x2346e579), SPH_C32(0xabb1d7ef), - SPH_C32(0xb43e0cf0) }, - { SPH_C32(0xad950000), SPH_C32(0x9b0e0000), SPH_C32(0xb16d13c8), - SPH_C32(0xa5430000), SPH_C32(0xca504fc8), SPH_C32(0xc854dc81), - SPH_C32(0x98600803), SPH_C32(0xbd703d68), SPH_C32(0x4c1e0000), - SPH_C32(0xf79b0000), SPH_C32(0x079901ce), SPH_C32(0x87db0000), - SPH_C32(0x76767972), SPH_C32(0xb1832880), SPH_C32(0x02f597f7), - SPH_C32(0xcba95a61) }, - { SPH_C32(0x605c0000), SPH_C32(0xbec50000), SPH_C32(0x1f421400), - SPH_C32(0x38130000), SPH_C32(0x11552295), SPH_C32(0x982964ae), - SPH_C32(0x97318f3f), SPH_C32(0x5bbeff08), SPH_C32(0x9fd00000), - SPH_C32(0x32980000), SPH_C32(0x0bca0300), SPH_C32(0xe2d70000), - SPH_C32(0xb1ee2f9c), SPH_C32(0xbc5455f2), SPH_C32(0x2bf9ba3f), - SPH_C32(0x16cdfe94) }, - { SPH_C32(0x320c0000), SPH_C32(0x97910000), SPH_C32(0x7523144e), - SPH_C32(0xc8ec0000), SPH_C32(0x8b645c79), SPH_C32(0xdd0a2560), - SPH_C32(0x586700da), SPH_C32(0x08bdec07), SPH_C32(0xcc5d0000), - SPH_C32(0x9b640000), SPH_C32(0x953d0306), SPH_C32(0xb4280000), - SPH_C32(0xbb0a2fd2), SPH_C32(0x2e91980b), SPH_C32(0x82bdfa27), - SPH_C32(0x695aa805) }, - { SPH_C32(0x33d10000), SPH_C32(0x17390000), SPH_C32(0x81b51406), - SPH_C32(0x6eec0000), SPH_C32(0x1bb122db), SPH_C32(0x0aeca957), - SPH_C32(0x3e75cf27), SPH_C32(0x2429a999), SPH_C32(0x9e0d0000), - SPH_C32(0xb2300000), SPH_C32(0xff5c0348), SPH_C32(0x44d70000), - SPH_C32(0x213b513e), SPH_C32(0x6bb2d9c5), SPH_C32(0x4deb75c2), - SPH_C32(0x3a59bb0a) }, - { SPH_C32(0x61810000), SPH_C32(0x3e6d0000), SPH_C32(0xebd41448), - SPH_C32(0x9e130000), SPH_C32(0x81805c37), SPH_C32(0x4fcfe899), - SPH_C32(0xf12340c2), SPH_C32(0x772aba96), SPH_C32(0xcd800000), - SPH_C32(0x1bcc0000), SPH_C32(0x61ab034e), SPH_C32(0x12280000), - SPH_C32(0x2bdf5170), SPH_C32(0xf977143c), SPH_C32(0xe4af35da), - SPH_C32(0x45ceed9b) }, - { SPH_C32(0x2dd60000), SPH_C32(0xf7f10000), SPH_C32(0x23c91100), - SPH_C32(0x96b00000), SPH_C32(0x072c1968), SPH_C32(0x57466c0a), - SPH_C32(0x182865d3), SPH_C32(0x1f83cf0c), SPH_C32(0x53c40000), - SPH_C32(0x97fb0000), SPH_C32(0x51730480), SPH_C32(0xd9870000), - SPH_C32(0xfa3e3c63), SPH_C32(0x3bcf61ea), SPH_C32(0x42baf2fe), - SPH_C32(0xdc97796a) }, - { SPH_C32(0x7f860000), SPH_C32(0xdea50000), SPH_C32(0x49a8114e), - SPH_C32(0x664f0000), SPH_C32(0x9d1d6784), SPH_C32(0x12652dc4), - SPH_C32(0xd77eea36), SPH_C32(0x4c80dc03), SPH_C32(0x00490000), - SPH_C32(0x3e070000), SPH_C32(0xcf840486), SPH_C32(0x8f780000), - SPH_C32(0xf0da3c2d), SPH_C32(0xa90aac13), SPH_C32(0xebfeb2e6), - SPH_C32(0xa3002ffb) }, - { SPH_C32(0x7e5b0000), SPH_C32(0x5e0d0000), SPH_C32(0xbd3e1106), - SPH_C32(0xc04f0000), SPH_C32(0x0dc81926), SPH_C32(0xc583a1f3), - SPH_C32(0xb16c25cb), SPH_C32(0x6014999d), SPH_C32(0x52190000), - SPH_C32(0x17530000), SPH_C32(0xa5e504c8), SPH_C32(0x7f870000), - SPH_C32(0x6aeb42c1), SPH_C32(0xec29eddd), SPH_C32(0x24a83d03), - SPH_C32(0xf0033cf4) }, - { SPH_C32(0x2c0b0000), SPH_C32(0x77590000), SPH_C32(0xd75f1148), - SPH_C32(0x30b00000), SPH_C32(0x97f967ca), SPH_C32(0x80a0e03d), - SPH_C32(0x7e3aaa2e), SPH_C32(0x33178a92), SPH_C32(0x01940000), - SPH_C32(0xbeaf0000), SPH_C32(0x3b1204ce), SPH_C32(0x29780000), - SPH_C32(0x600f428f), SPH_C32(0x7eec2024), SPH_C32(0x8dec7d1b), - SPH_C32(0x8f946a65) }, - { SPH_C32(0xe1c20000), SPH_C32(0x52920000), SPH_C32(0x79701680), - SPH_C32(0xade00000), SPH_C32(0x4cfc0a97), SPH_C32(0xd0dd5812), - SPH_C32(0x716b2d12), SPH_C32(0xd5d948f2), SPH_C32(0xd25a0000), - SPH_C32(0x7bac0000), SPH_C32(0x37410600), SPH_C32(0x4c740000), - SPH_C32(0xa7971461), SPH_C32(0x733b5d56), SPH_C32(0xa4e050d3), - SPH_C32(0x52f0ce90) }, - { SPH_C32(0xb3920000), SPH_C32(0x7bc60000), SPH_C32(0x131116ce), - SPH_C32(0x5d1f0000), SPH_C32(0xd6cd747b), SPH_C32(0x95fe19dc), - SPH_C32(0xbe3da2f7), SPH_C32(0x86da5bfd), SPH_C32(0x81d70000), - SPH_C32(0xd2500000), SPH_C32(0xa9b60606), SPH_C32(0x1a8b0000), - SPH_C32(0xad73142f), SPH_C32(0xe1fe90af), SPH_C32(0x0da410cb), - SPH_C32(0x2d679801) }, - { SPH_C32(0xb24f0000), SPH_C32(0xfb6e0000), SPH_C32(0xe7871686), - SPH_C32(0xfb1f0000), SPH_C32(0x46180ad9), SPH_C32(0x421895eb), - SPH_C32(0xd82f6d0a), SPH_C32(0xaa4e1e63), SPH_C32(0xd3870000), - SPH_C32(0xfb040000), SPH_C32(0xc3d70648), SPH_C32(0xea740000), - SPH_C32(0x37426ac3), SPH_C32(0xa4ddd161), SPH_C32(0xc2f29f2e), - SPH_C32(0x7e648b0e) }, - { SPH_C32(0xe01f0000), SPH_C32(0xd23a0000), SPH_C32(0x8de616c8), - SPH_C32(0x0be00000), SPH_C32(0xdc297435), SPH_C32(0x073bd425), - SPH_C32(0x1779e2ef), SPH_C32(0xf94d0d6c), SPH_C32(0x800a0000), - SPH_C32(0x52f80000), SPH_C32(0x5d20064e), SPH_C32(0xbc8b0000), - SPH_C32(0x3da66a8d), SPH_C32(0x36181c98), SPH_C32(0x6bb6df36), - SPH_C32(0x01f3dd9f) }, - { SPH_C32(0xd46b0000), SPH_C32(0x095a0000), SPH_C32(0xecc11800), - SPH_C32(0x93e60000), SPH_C32(0x2bbb1913), SPH_C32(0x615bd992), - SPH_C32(0x0efe679c), SPH_C32(0xf28bf35d), SPH_C32(0x1ce10000), - SPH_C32(0x69e70000), SPH_C32(0xd7e40280), SPH_C32(0x21bc0000), - SPH_C32(0x56ca424d), SPH_C32(0x74e8af29), SPH_C32(0x64ff0c88), - SPH_C32(0x6c5ca315) }, - { SPH_C32(0x863b0000), SPH_C32(0x200e0000), SPH_C32(0x86a0184e), - SPH_C32(0x63190000), SPH_C32(0xb18a67ff), SPH_C32(0x2478985c), - SPH_C32(0xc1a8e879), SPH_C32(0xa188e052), SPH_C32(0x4f6c0000), - SPH_C32(0xc01b0000), SPH_C32(0x49130286), SPH_C32(0x77430000), - SPH_C32(0x5c2e4203), SPH_C32(0xe62d62d0), SPH_C32(0xcdbb4c90), - SPH_C32(0x13cbf584) }, - { SPH_C32(0x87e60000), SPH_C32(0xa0a60000), SPH_C32(0x72361806), - SPH_C32(0xc5190000), SPH_C32(0x215f195d), SPH_C32(0xf39e146b), - SPH_C32(0xa7ba2784), SPH_C32(0x8d1ca5cc), SPH_C32(0x1d3c0000), - SPH_C32(0xe94f0000), SPH_C32(0x237202c8), SPH_C32(0x87bc0000), - SPH_C32(0xc61f3cef), SPH_C32(0xa30e231e), SPH_C32(0x02edc375), - SPH_C32(0x40c8e68b) }, - { SPH_C32(0xd5b60000), SPH_C32(0x89f20000), SPH_C32(0x18571848), - SPH_C32(0x35e60000), SPH_C32(0xbb6e67b1), SPH_C32(0xb6bd55a5), - SPH_C32(0x68eca861), SPH_C32(0xde1fb6c3), SPH_C32(0x4eb10000), - SPH_C32(0x40b30000), SPH_C32(0xbd8502ce), SPH_C32(0xd1430000), - SPH_C32(0xccfb3ca1), SPH_C32(0x31cbeee7), SPH_C32(0xaba9836d), - SPH_C32(0x3f5fb01a) }, - { SPH_C32(0x187f0000), SPH_C32(0xac390000), SPH_C32(0xb6781f80), - SPH_C32(0xa8b60000), SPH_C32(0x606b0aec), SPH_C32(0xe6c0ed8a), - SPH_C32(0x67bd2f5d), SPH_C32(0x38d174a3), SPH_C32(0x9d7f0000), - SPH_C32(0x85b00000), SPH_C32(0xb1d60000), SPH_C32(0xb44f0000), - SPH_C32(0x0b636a4f), SPH_C32(0x3c1c9395), SPH_C32(0x82a5aea5), - SPH_C32(0xe23b14ef) }, - { SPH_C32(0x4a2f0000), SPH_C32(0x856d0000), SPH_C32(0xdc191fce), - SPH_C32(0x58490000), SPH_C32(0xfa5a7400), SPH_C32(0xa3e3ac44), - SPH_C32(0xa8eba0b8), SPH_C32(0x6bd267ac), SPH_C32(0xcef20000), - SPH_C32(0x2c4c0000), SPH_C32(0x2f210006), SPH_C32(0xe2b00000), - SPH_C32(0x01876a01), SPH_C32(0xaed95e6c), SPH_C32(0x2be1eebd), - SPH_C32(0x9dac427e) }, - { SPH_C32(0x4bf20000), SPH_C32(0x05c50000), SPH_C32(0x288f1f86), - SPH_C32(0xfe490000), SPH_C32(0x6a8f0aa2), SPH_C32(0x74052073), - SPH_C32(0xcef96f45), SPH_C32(0x47462232), SPH_C32(0x9ca20000), - SPH_C32(0x05180000), SPH_C32(0x45400048), SPH_C32(0x124f0000), - SPH_C32(0x9bb614ed), SPH_C32(0xebfa1fa2), SPH_C32(0xe4b76158), - SPH_C32(0xceaf5171) }, - { SPH_C32(0x19a20000), SPH_C32(0x2c910000), SPH_C32(0x42ee1fc8), - SPH_C32(0x0eb60000), SPH_C32(0xf0be744e), SPH_C32(0x312661bd), - SPH_C32(0x01afe0a0), SPH_C32(0x1445313d), SPH_C32(0xcf2f0000), - SPH_C32(0xace40000), SPH_C32(0xdbb7004e), SPH_C32(0x44b00000), - SPH_C32(0x915214a3), SPH_C32(0x793fd25b), SPH_C32(0x4df32140), - SPH_C32(0xb13807e0) }, - { SPH_C32(0x55f50000), SPH_C32(0xe50d0000), SPH_C32(0x8af31a80), - SPH_C32(0x06150000), SPH_C32(0x76123111), SPH_C32(0x29afe52e), - SPH_C32(0xe8a4c5b1), SPH_C32(0x7cec44a7), SPH_C32(0x516b0000), - SPH_C32(0x20d30000), SPH_C32(0xeb6f0780), SPH_C32(0x8f1f0000), - SPH_C32(0x40b379b0), SPH_C32(0xbb87a78d), SPH_C32(0xebe6e664), - SPH_C32(0x28619311) }, - { SPH_C32(0x07a50000), SPH_C32(0xcc590000), SPH_C32(0xe0921ace), - SPH_C32(0xf6ea0000), SPH_C32(0xec234ffd), SPH_C32(0x6c8ca4e0), - SPH_C32(0x27f24a54), SPH_C32(0x2fef57a8), SPH_C32(0x02e60000), - SPH_C32(0x892f0000), SPH_C32(0x75980786), SPH_C32(0xd9e00000), - SPH_C32(0x4a5779fe), SPH_C32(0x29426a74), SPH_C32(0x42a2a67c), - SPH_C32(0x57f6c580) }, - { SPH_C32(0x06780000), SPH_C32(0x4cf10000), SPH_C32(0x14041a86), - SPH_C32(0x50ea0000), SPH_C32(0x7cf6315f), SPH_C32(0xbb6a28d7), - SPH_C32(0x41e085a9), SPH_C32(0x037b1236), SPH_C32(0x50b60000), - SPH_C32(0xa07b0000), SPH_C32(0x1ff907c8), SPH_C32(0x291f0000), - SPH_C32(0xd0660712), SPH_C32(0x6c612bba), SPH_C32(0x8df42999), - SPH_C32(0x04f5d68f) }, - { SPH_C32(0x54280000), SPH_C32(0x65a50000), SPH_C32(0x7e651ac8), - SPH_C32(0xa0150000), SPH_C32(0xe6c74fb3), SPH_C32(0xfe496919), - SPH_C32(0x8eb60a4c), SPH_C32(0x50780139), SPH_C32(0x033b0000), - SPH_C32(0x09870000), SPH_C32(0x810e07ce), SPH_C32(0x7fe00000), - SPH_C32(0xda82075c), SPH_C32(0xfea4e643), SPH_C32(0x24b06981), - SPH_C32(0x7b62801e) }, - { SPH_C32(0x99e10000), SPH_C32(0x406e0000), SPH_C32(0xd04a1d00), - SPH_C32(0x3d450000), SPH_C32(0x3dc222ee), SPH_C32(0xae34d136), - SPH_C32(0x81e78d70), SPH_C32(0xb6b6c359), SPH_C32(0xd0f50000), - SPH_C32(0xcc840000), SPH_C32(0x8d5d0500), SPH_C32(0x1aec0000), - SPH_C32(0x1d1a51b2), SPH_C32(0xf3739b31), SPH_C32(0x0dbc4449), - SPH_C32(0xa60624eb) }, - { SPH_C32(0xcbb10000), SPH_C32(0x693a0000), SPH_C32(0xba2b1d4e), - SPH_C32(0xcdba0000), SPH_C32(0xa7f35c02), SPH_C32(0xeb1790f8), - SPH_C32(0x4eb10295), SPH_C32(0xe5b5d056), SPH_C32(0x83780000), - SPH_C32(0x65780000), SPH_C32(0x13aa0506), SPH_C32(0x4c130000), - SPH_C32(0x17fe51fc), SPH_C32(0x61b656c8), SPH_C32(0xa4f80451), - SPH_C32(0xd991727a) }, - { SPH_C32(0xca6c0000), SPH_C32(0xe9920000), SPH_C32(0x4ebd1d06), - SPH_C32(0x6bba0000), SPH_C32(0x372622a0), SPH_C32(0x3cf11ccf), - SPH_C32(0x28a3cd68), SPH_C32(0xc92195c8), SPH_C32(0xd1280000), - SPH_C32(0x4c2c0000), SPH_C32(0x79cb0548), SPH_C32(0xbcec0000), - SPH_C32(0x8dcf2f10), SPH_C32(0x24951706), SPH_C32(0x6bae8bb4), - SPH_C32(0x8a926175) }, - { SPH_C32(0x983c0000), SPH_C32(0xc0c60000), SPH_C32(0x24dc1d48), - SPH_C32(0x9b450000), SPH_C32(0xad175c4c), SPH_C32(0x79d25d01), - SPH_C32(0xe7f5428d), SPH_C32(0x9a2286c7), SPH_C32(0x82a50000), - SPH_C32(0xe5d00000), SPH_C32(0xe73c054e), SPH_C32(0xea130000), - SPH_C32(0x872b2f5e), SPH_C32(0xb650daff), SPH_C32(0xc2eacbac), - SPH_C32(0xf50537e4) }, - { SPH_C32(0xaee70000), SPH_C32(0xac8e0000), SPH_C32(0xffe71080), - SPH_C32(0x55db0000), SPH_C32(0xe00874b9), SPH_C32(0x9ffa96d1), - SPH_C32(0x572ed364), SPH_C32(0x6512928d), SPH_C32(0x64c20000), - SPH_C32(0x7b1b0000), SPH_C32(0x7ede0900), SPH_C32(0xb1190000), - SPH_C32(0x27f46a34), SPH_C32(0x0a01260d), SPH_C32(0x9473acea), - SPH_C32(0x0f3328be) }, - { SPH_C32(0xfcb70000), SPH_C32(0x85da0000), SPH_C32(0x958610ce), - SPH_C32(0xa5240000), SPH_C32(0x7a390a55), SPH_C32(0xdad9d71f), - SPH_C32(0x98785c81), SPH_C32(0x36118182), SPH_C32(0x374f0000), - SPH_C32(0xd2e70000), SPH_C32(0xe0290906), SPH_C32(0xe7e60000), - SPH_C32(0x2d106a7a), SPH_C32(0x98c4ebf4), SPH_C32(0x3d37ecf2), - SPH_C32(0x70a47e2f) }, - { SPH_C32(0xfd6a0000), SPH_C32(0x05720000), SPH_C32(0x61101086), - SPH_C32(0x03240000), SPH_C32(0xeaec74f7), SPH_C32(0x0d3f5b28), - SPH_C32(0xfe6a937c), SPH_C32(0x1a85c41c), SPH_C32(0x651f0000), - SPH_C32(0xfbb30000), SPH_C32(0x8a480948), SPH_C32(0x17190000), - SPH_C32(0xb7211496), SPH_C32(0xdde7aa3a), SPH_C32(0xf2616317), - SPH_C32(0x23a76d20) }, - { SPH_C32(0xaf3a0000), SPH_C32(0x2c260000), SPH_C32(0x0b7110c8), - SPH_C32(0xf3db0000), SPH_C32(0x70dd0a1b), SPH_C32(0x481c1ae6), - SPH_C32(0x313c1c99), SPH_C32(0x4986d713), SPH_C32(0x36920000), - SPH_C32(0x524f0000), SPH_C32(0x14bf094e), SPH_C32(0x41e60000), - SPH_C32(0xbdc514d8), SPH_C32(0x4f2267c3), SPH_C32(0x5b25230f), - SPH_C32(0x5c303bb1) }, - { SPH_C32(0x62f30000), SPH_C32(0x09ed0000), SPH_C32(0xa55e1700), - SPH_C32(0x6e8b0000), SPH_C32(0xabd86746), SPH_C32(0x1861a2c9), - SPH_C32(0x3e6d9ba5), SPH_C32(0xaf481573), SPH_C32(0xe55c0000), - SPH_C32(0x974c0000), SPH_C32(0x18ec0b80), SPH_C32(0x24ea0000), - SPH_C32(0x7a5d4236), SPH_C32(0x42f51ab1), SPH_C32(0x72290ec7), - SPH_C32(0x81549f44) }, - { SPH_C32(0x30a30000), SPH_C32(0x20b90000), SPH_C32(0xcf3f174e), - SPH_C32(0x9e740000), SPH_C32(0x31e919aa), SPH_C32(0x5d42e307), - SPH_C32(0xf13b1440), SPH_C32(0xfc4b067c), SPH_C32(0xb6d10000), - SPH_C32(0x3eb00000), SPH_C32(0x861b0b86), SPH_C32(0x72150000), - SPH_C32(0x70b94278), SPH_C32(0xd030d748), SPH_C32(0xdb6d4edf), - SPH_C32(0xfec3c9d5) }, - { SPH_C32(0x317e0000), SPH_C32(0xa0110000), SPH_C32(0x3ba91706), - SPH_C32(0x38740000), SPH_C32(0xa13c6708), SPH_C32(0x8aa46f30), - SPH_C32(0x9729dbbd), SPH_C32(0xd0df43e2), SPH_C32(0xe4810000), - SPH_C32(0x17e40000), SPH_C32(0xec7a0bc8), SPH_C32(0x82ea0000), - SPH_C32(0xea883c94), SPH_C32(0x95139686), SPH_C32(0x143bc13a), - SPH_C32(0xadc0dada) }, - { SPH_C32(0x632e0000), SPH_C32(0x89450000), SPH_C32(0x51c81748), - SPH_C32(0xc88b0000), SPH_C32(0x3b0d19e4), SPH_C32(0xcf872efe), - SPH_C32(0x587f5458), SPH_C32(0x83dc50ed), SPH_C32(0xb70c0000), - SPH_C32(0xbe180000), SPH_C32(0x728d0bce), SPH_C32(0xd4150000), - SPH_C32(0xe06c3cda), SPH_C32(0x07d65b7f), SPH_C32(0xbd7f8122), - SPH_C32(0xd2578c4b) }, - { SPH_C32(0x2f790000), SPH_C32(0x40d90000), SPH_C32(0x99d51200), - SPH_C32(0xc0280000), SPH_C32(0xbda15cbb), SPH_C32(0xd70eaa6d), - SPH_C32(0xb1747149), SPH_C32(0xeb752577), SPH_C32(0x29480000), - SPH_C32(0x322f0000), SPH_C32(0x42550c00), SPH_C32(0x1fba0000), - SPH_C32(0x318d51c9), SPH_C32(0xc56e2ea9), SPH_C32(0x1b6a4606), - SPH_C32(0x4b0e18ba) }, - { SPH_C32(0x7d290000), SPH_C32(0x698d0000), SPH_C32(0xf3b4124e), - SPH_C32(0x30d70000), SPH_C32(0x27902257), SPH_C32(0x922deba3), - SPH_C32(0x7e22feac), SPH_C32(0xb8763678), SPH_C32(0x7ac50000), - SPH_C32(0x9bd30000), SPH_C32(0xdca20c06), SPH_C32(0x49450000), - SPH_C32(0x3b695187), SPH_C32(0x57abe350), SPH_C32(0xb22e061e), - SPH_C32(0x34994e2b) }, - { SPH_C32(0x7cf40000), SPH_C32(0xe9250000), SPH_C32(0x07221206), - SPH_C32(0x96d70000), SPH_C32(0xb7455cf5), SPH_C32(0x45cb6794), - SPH_C32(0x18303151), SPH_C32(0x94e273e6), SPH_C32(0x28950000), - SPH_C32(0xb2870000), SPH_C32(0xb6c30c48), SPH_C32(0xb9ba0000), - SPH_C32(0xa1582f6b), SPH_C32(0x1288a29e), SPH_C32(0x7d7889fb), - SPH_C32(0x679a5d24) }, - { SPH_C32(0x2ea40000), SPH_C32(0xc0710000), SPH_C32(0x6d431248), - SPH_C32(0x66280000), SPH_C32(0x2d742219), SPH_C32(0x00e8265a), - SPH_C32(0xd766beb4), SPH_C32(0xc7e160e9), SPH_C32(0x7b180000), - SPH_C32(0x1b7b0000), SPH_C32(0x28340c4e), SPH_C32(0xef450000), - SPH_C32(0xabbc2f25), SPH_C32(0x804d6f67), SPH_C32(0xd43cc9e3), - SPH_C32(0x180d0bb5) }, - { SPH_C32(0xe36d0000), SPH_C32(0xe5ba0000), SPH_C32(0xc36c1580), - SPH_C32(0xfb780000), SPH_C32(0xf6714f44), SPH_C32(0x50959e75), - SPH_C32(0xd8373988), SPH_C32(0x212fa289), SPH_C32(0xa8d60000), - SPH_C32(0xde780000), SPH_C32(0x24670e80), SPH_C32(0x8a490000), - SPH_C32(0x6c2479cb), SPH_C32(0x8d9a1215), SPH_C32(0xfd30e42b), - SPH_C32(0xc569af40) }, - { SPH_C32(0xb13d0000), SPH_C32(0xccee0000), SPH_C32(0xa90d15ce), - SPH_C32(0x0b870000), SPH_C32(0x6c4031a8), SPH_C32(0x15b6dfbb), - SPH_C32(0x1761b66d), SPH_C32(0x722cb186), SPH_C32(0xfb5b0000), - SPH_C32(0x77840000), SPH_C32(0xba900e86), SPH_C32(0xdcb60000), - SPH_C32(0x66c07985), SPH_C32(0x1f5fdfec), SPH_C32(0x5474a433), - SPH_C32(0xbafef9d1) }, - { SPH_C32(0xb0e00000), SPH_C32(0x4c460000), SPH_C32(0x5d9b1586), - SPH_C32(0xad870000), SPH_C32(0xfc954f0a), SPH_C32(0xc250538c), - SPH_C32(0x71737990), SPH_C32(0x5eb8f418), SPH_C32(0xa90b0000), - SPH_C32(0x5ed00000), SPH_C32(0xd0f10ec8), SPH_C32(0x2c490000), - SPH_C32(0xfcf10769), SPH_C32(0x5a7c9e22), SPH_C32(0x9b222bd6), - SPH_C32(0xe9fdeade) }, - { SPH_C32(0xe2b00000), SPH_C32(0x65120000), SPH_C32(0x37fa15c8), - SPH_C32(0x5d780000), SPH_C32(0x66a431e6), SPH_C32(0x87731242), - SPH_C32(0xbe25f675), SPH_C32(0x0dbbe717), SPH_C32(0xfa860000), - SPH_C32(0xf72c0000), SPH_C32(0x4e060ece), SPH_C32(0x7ab60000), - SPH_C32(0xf6150727), SPH_C32(0xc8b953db), SPH_C32(0x32666bce), - SPH_C32(0x966abc4f) }, - { SPH_C32(0xd6c40000), SPH_C32(0xbe720000), SPH_C32(0x56dd1b00), - SPH_C32(0xc57e0000), SPH_C32(0x91365cc0), SPH_C32(0xe1131ff5), - SPH_C32(0xa7a27306), SPH_C32(0x067d1926), SPH_C32(0x666d0000), - SPH_C32(0xcc330000), SPH_C32(0xc4c20a00), SPH_C32(0xe7810000), - SPH_C32(0x9d792fe7), SPH_C32(0x8a49e06a), SPH_C32(0x3d2fb870), - SPH_C32(0xfbc5c2c5) }, - { SPH_C32(0x84940000), SPH_C32(0x97260000), SPH_C32(0x3cbc1b4e), - SPH_C32(0x35810000), SPH_C32(0x0b07222c), SPH_C32(0xa4305e3b), - SPH_C32(0x68f4fce3), SPH_C32(0x557e0a29), SPH_C32(0x35e00000), - SPH_C32(0x65cf0000), SPH_C32(0x5a350a06), SPH_C32(0xb17e0000), - SPH_C32(0x979d2fa9), SPH_C32(0x188c2d93), SPH_C32(0x946bf868), - SPH_C32(0x84529454) }, - { SPH_C32(0x85490000), SPH_C32(0x178e0000), SPH_C32(0xc82a1b06), - SPH_C32(0x93810000), SPH_C32(0x9bd25c8e), SPH_C32(0x73d6d20c), - SPH_C32(0x0ee6331e), SPH_C32(0x79ea4fb7), SPH_C32(0x67b00000), - SPH_C32(0x4c9b0000), SPH_C32(0x30540a48), SPH_C32(0x41810000), - SPH_C32(0x0dac5145), SPH_C32(0x5daf6c5d), SPH_C32(0x5b3d778d), - SPH_C32(0xd751875b) }, - { SPH_C32(0xd7190000), SPH_C32(0x3eda0000), SPH_C32(0xa24b1b48), - SPH_C32(0x637e0000), SPH_C32(0x01e32262), SPH_C32(0x36f593c2), - SPH_C32(0xc1b0bcfb), SPH_C32(0x2ae95cb8), SPH_C32(0x343d0000), - SPH_C32(0xe5670000), SPH_C32(0xaea30a4e), SPH_C32(0x177e0000), - SPH_C32(0x0748510b), SPH_C32(0xcf6aa1a4), SPH_C32(0xf2793795), - SPH_C32(0xa8c6d1ca) }, - { SPH_C32(0x1ad00000), SPH_C32(0x1b110000), SPH_C32(0x0c641c80), - SPH_C32(0xfe2e0000), SPH_C32(0xdae64f3f), SPH_C32(0x66882bed), - SPH_C32(0xcee13bc7), SPH_C32(0xcc279ed8), SPH_C32(0xe7f30000), - SPH_C32(0x20640000), SPH_C32(0xa2f00880), SPH_C32(0x72720000), - SPH_C32(0xc0d007e5), SPH_C32(0xc2bddcd6), SPH_C32(0xdb751a5d), - SPH_C32(0x75a2753f) }, - { SPH_C32(0x48800000), SPH_C32(0x32450000), SPH_C32(0x66051cce), - SPH_C32(0x0ed10000), SPH_C32(0x40d731d3), SPH_C32(0x23ab6a23), - SPH_C32(0x01b7b422), SPH_C32(0x9f248dd7), SPH_C32(0xb47e0000), - SPH_C32(0x89980000), SPH_C32(0x3c070886), SPH_C32(0x248d0000), - SPH_C32(0xca3407ab), SPH_C32(0x5078112f), SPH_C32(0x72315a45), - SPH_C32(0x0a3523ae) }, - { SPH_C32(0x495d0000), SPH_C32(0xb2ed0000), SPH_C32(0x92931c86), - SPH_C32(0xa8d10000), SPH_C32(0xd0024f71), SPH_C32(0xf44de614), - SPH_C32(0x67a57bdf), SPH_C32(0xb3b0c849), SPH_C32(0xe62e0000), - SPH_C32(0xa0cc0000), SPH_C32(0x566608c8), SPH_C32(0xd4720000), - SPH_C32(0x50057947), SPH_C32(0x155b50e1), SPH_C32(0xbd67d5a0), - SPH_C32(0x593630a1) }, - { SPH_C32(0x1b0d0000), SPH_C32(0x9bb90000), SPH_C32(0xf8f21cc8), - SPH_C32(0x582e0000), SPH_C32(0x4a33319d), SPH_C32(0xb16ea7da), - SPH_C32(0xa8f3f43a), SPH_C32(0xe0b3db46), SPH_C32(0xb5a30000), - SPH_C32(0x09300000), SPH_C32(0xc89108ce), SPH_C32(0x828d0000), - SPH_C32(0x5ae17909), SPH_C32(0x879e9d18), SPH_C32(0x142395b8), - SPH_C32(0x26a16630) }, - { SPH_C32(0x575a0000), SPH_C32(0x52250000), SPH_C32(0x30ef1980), - SPH_C32(0x508d0000), SPH_C32(0xcc9f74c2), SPH_C32(0xa9e72349), - SPH_C32(0x41f8d12b), SPH_C32(0x881aaedc), SPH_C32(0x2be70000), - SPH_C32(0x85070000), SPH_C32(0xf8490f00), SPH_C32(0x49220000), - SPH_C32(0x8b00141a), SPH_C32(0x4526e8ce), SPH_C32(0xb236529c), - SPH_C32(0xbff8f2c1) }, - { SPH_C32(0x050a0000), SPH_C32(0x7b710000), SPH_C32(0x5a8e19ce), - SPH_C32(0xa0720000), SPH_C32(0x56ae0a2e), SPH_C32(0xecc46287), - SPH_C32(0x8eae5ece), SPH_C32(0xdb19bdd3), SPH_C32(0x786a0000), - SPH_C32(0x2cfb0000), SPH_C32(0x66be0f06), SPH_C32(0x1fdd0000), - SPH_C32(0x81e41454), SPH_C32(0xd7e32537), SPH_C32(0x1b721284), - SPH_C32(0xc06fa450) }, - { SPH_C32(0x04d70000), SPH_C32(0xfbd90000), SPH_C32(0xae181986), - SPH_C32(0x06720000), SPH_C32(0xc67b748c), SPH_C32(0x3b22eeb0), - SPH_C32(0xe8bc9133), SPH_C32(0xf78df84d), SPH_C32(0x2a3a0000), - SPH_C32(0x05af0000), SPH_C32(0x0cdf0f48), SPH_C32(0xef220000), - SPH_C32(0x1bd56ab8), SPH_C32(0x92c064f9), SPH_C32(0xd4249d61), - SPH_C32(0x936cb75f) }, - { SPH_C32(0x56870000), SPH_C32(0xd28d0000), SPH_C32(0xc47919c8), - SPH_C32(0xf68d0000), SPH_C32(0x5c4a0a60), SPH_C32(0x7e01af7e), - SPH_C32(0x27ea1ed6), SPH_C32(0xa48eeb42), SPH_C32(0x79b70000), - SPH_C32(0xac530000), SPH_C32(0x92280f4e), SPH_C32(0xb9dd0000), - SPH_C32(0x11316af6), SPH_C32(0x0005a900), SPH_C32(0x7d60dd79), - SPH_C32(0xecfbe1ce) }, - { SPH_C32(0x9b4e0000), SPH_C32(0xf7460000), SPH_C32(0x6a561e00), - SPH_C32(0x6bdd0000), SPH_C32(0x874f673d), SPH_C32(0x2e7c1751), - SPH_C32(0x28bb99ea), SPH_C32(0x42402922), SPH_C32(0xaa790000), - SPH_C32(0x69500000), SPH_C32(0x9e7b0d80), SPH_C32(0xdcd10000), - SPH_C32(0xd6a93c18), SPH_C32(0x0dd2d472), SPH_C32(0x546cf0b1), - SPH_C32(0x319f453b) }, - { SPH_C32(0xc91e0000), SPH_C32(0xde120000), SPH_C32(0x00371e4e), - SPH_C32(0x9b220000), SPH_C32(0x1d7e19d1), SPH_C32(0x6b5f569f), - SPH_C32(0xe7ed160f), SPH_C32(0x11433a2d), SPH_C32(0xf9f40000), - SPH_C32(0xc0ac0000), SPH_C32(0x008c0d86), SPH_C32(0x8a2e0000), - SPH_C32(0xdc4d3c56), SPH_C32(0x9f17198b), SPH_C32(0xfd28b0a9), - SPH_C32(0x4e0813aa) }, - { SPH_C32(0xc8c30000), SPH_C32(0x5eba0000), SPH_C32(0xf4a11e06), - SPH_C32(0x3d220000), SPH_C32(0x8dab6773), SPH_C32(0xbcb9daa8), - SPH_C32(0x81ffd9f2), SPH_C32(0x3dd77fb3), SPH_C32(0xaba40000), - SPH_C32(0xe9f80000), SPH_C32(0x6aed0dc8), SPH_C32(0x7ad10000), - SPH_C32(0x467c42ba), SPH_C32(0xda345845), SPH_C32(0x327e3f4c), - SPH_C32(0x1d0b00a5) }, - { SPH_C32(0x9a930000), SPH_C32(0x77ee0000), SPH_C32(0x9ec01e48), - SPH_C32(0xcddd0000), SPH_C32(0x179a199f), SPH_C32(0xf99a9b66), - SPH_C32(0x4ea95617), SPH_C32(0x6ed46cbc), SPH_C32(0xf8290000), - SPH_C32(0x40040000), SPH_C32(0xf41a0dce), SPH_C32(0x2c2e0000), - SPH_C32(0x4c9842f4), SPH_C32(0x48f195bc), SPH_C32(0x9b3a7f54), - SPH_C32(0x629c5634) } -}; - -static const sph_u32 T512_42[128][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x92560000), SPH_C32(0x1eda0000), SPH_C32(0xea510000), - SPH_C32(0xe8b13000), SPH_C32(0xa93556a5), SPH_C32(0xebfb6199), - SPH_C32(0xb15c2254), SPH_C32(0x33c5244f), SPH_C32(0x8c3a0000), - SPH_C32(0xda980000), SPH_C32(0x607f0000), SPH_C32(0x54078800), - SPH_C32(0x85714513), SPH_C32(0x6006b243), SPH_C32(0xdb50399c), - SPH_C32(0x8a58e6a4) }, - { SPH_C32(0x58430000), SPH_C32(0x807e0000), SPH_C32(0x78330001), - SPH_C32(0xc66b3800), SPH_C32(0xe7375cdc), SPH_C32(0x79ad3fdd), - SPH_C32(0xac73fe6f), SPH_C32(0x3a4479b1), SPH_C32(0x1d5a0000), - SPH_C32(0x2b720000), SPH_C32(0x488d0000), SPH_C32(0xaf611800), - SPH_C32(0x25cb2ec5), SPH_C32(0xc879bfd0), SPH_C32(0x81a20429), - SPH_C32(0x1e7536a6) }, - { SPH_C32(0xca150000), SPH_C32(0x9ea40000), SPH_C32(0x92620001), - SPH_C32(0x2eda0800), SPH_C32(0x4e020a79), SPH_C32(0x92565e44), - SPH_C32(0x1d2fdc3b), SPH_C32(0x09815dfe), SPH_C32(0x91600000), - SPH_C32(0xf1ea0000), SPH_C32(0x28f20000), SPH_C32(0xfb669000), - SPH_C32(0xa0ba6bd6), SPH_C32(0xa87f0d93), SPH_C32(0x5af23db5), - SPH_C32(0x942dd002) }, - { SPH_C32(0x1d5a0000), SPH_C32(0x2b720000), SPH_C32(0x488d0000), - SPH_C32(0xaf611800), SPH_C32(0x25cb2ec5), SPH_C32(0xc879bfd0), - SPH_C32(0x81a20429), SPH_C32(0x1e7536a6), SPH_C32(0x45190000), - SPH_C32(0xab0c0000), SPH_C32(0x30be0001), SPH_C32(0x690a2000), - SPH_C32(0xc2fc7219), SPH_C32(0xb1d4800d), SPH_C32(0x2dd1fa46), - SPH_C32(0x24314f17) }, - { SPH_C32(0x8f0c0000), SPH_C32(0x35a80000), SPH_C32(0xa2dc0000), - SPH_C32(0x47d02800), SPH_C32(0x8cfe7860), SPH_C32(0x2382de49), - SPH_C32(0x30fe267d), SPH_C32(0x2db012e9), SPH_C32(0xc9230000), - SPH_C32(0x71940000), SPH_C32(0x50c10001), SPH_C32(0x3d0da800), - SPH_C32(0x478d370a), SPH_C32(0xd1d2324e), SPH_C32(0xf681c3da), - SPH_C32(0xae69a9b3) }, - { SPH_C32(0x45190000), SPH_C32(0xab0c0000), SPH_C32(0x30be0001), - SPH_C32(0x690a2000), SPH_C32(0xc2fc7219), SPH_C32(0xb1d4800d), - SPH_C32(0x2dd1fa46), SPH_C32(0x24314f17), SPH_C32(0x58430000), - SPH_C32(0x807e0000), SPH_C32(0x78330001), SPH_C32(0xc66b3800), - SPH_C32(0xe7375cdc), SPH_C32(0x79ad3fdd), SPH_C32(0xac73fe6f), - SPH_C32(0x3a4479b1) }, - { SPH_C32(0xd74f0000), SPH_C32(0xb5d60000), SPH_C32(0xdaef0001), - SPH_C32(0x81bb1000), SPH_C32(0x6bc924bc), SPH_C32(0x5a2fe194), - SPH_C32(0x9c8dd812), SPH_C32(0x17f46b58), SPH_C32(0xd4790000), - SPH_C32(0x5ae60000), SPH_C32(0x184c0001), SPH_C32(0x926cb000), - SPH_C32(0x624619cf), SPH_C32(0x19ab8d9e), SPH_C32(0x7723c7f3), - SPH_C32(0xb01c9f15) }, - { SPH_C32(0xa53b0000), SPH_C32(0x14260000), SPH_C32(0x4e30001e), - SPH_C32(0x7cae0000), SPH_C32(0x8f9e0dd5), SPH_C32(0x78dfaa3d), - SPH_C32(0xf73168d8), SPH_C32(0x0b1b4946), SPH_C32(0x07ed0000), - SPH_C32(0xb2500000), SPH_C32(0x8774000a), SPH_C32(0x970d0000), - SPH_C32(0x437223ae), SPH_C32(0x48c76ea4), SPH_C32(0xf4786222), - SPH_C32(0x9075b1ce) }, - { SPH_C32(0x376d0000), SPH_C32(0x0afc0000), SPH_C32(0xa461001e), - SPH_C32(0x941f3000), SPH_C32(0x26ab5b70), SPH_C32(0x9324cba4), - SPH_C32(0x466d4a8c), SPH_C32(0x38de6d09), SPH_C32(0x8bd70000), - SPH_C32(0x68c80000), SPH_C32(0xe70b000a), SPH_C32(0xc30a8800), - SPH_C32(0xc60366bd), SPH_C32(0x28c1dce7), SPH_C32(0x2f285bbe), - SPH_C32(0x1a2d576a) }, - { SPH_C32(0xfd780000), SPH_C32(0x94580000), SPH_C32(0x3603001f), - SPH_C32(0xbac53800), SPH_C32(0x68a95109), SPH_C32(0x017295e0), - SPH_C32(0x5b4296b7), SPH_C32(0x315f30f7), SPH_C32(0x1ab70000), - SPH_C32(0x99220000), SPH_C32(0xcff9000a), SPH_C32(0x386c1800), - SPH_C32(0x66b90d6b), SPH_C32(0x80bed174), SPH_C32(0x75da660b), - SPH_C32(0x8e008768) }, - { SPH_C32(0x6f2e0000), SPH_C32(0x8a820000), SPH_C32(0xdc52001f), - SPH_C32(0x52740800), SPH_C32(0xc19c07ac), SPH_C32(0xea89f479), - SPH_C32(0xea1eb4e3), SPH_C32(0x029a14b8), SPH_C32(0x968d0000), - SPH_C32(0x43ba0000), SPH_C32(0xaf86000a), SPH_C32(0x6c6b9000), - SPH_C32(0xe3c84878), SPH_C32(0xe0b86337), SPH_C32(0xae8a5f97), - SPH_C32(0x045861cc) }, - { SPH_C32(0xb8610000), SPH_C32(0x3f540000), SPH_C32(0x06bd001e), - SPH_C32(0xd3cf1800), SPH_C32(0xaa552310), SPH_C32(0xb0a615ed), - SPH_C32(0x76936cf1), SPH_C32(0x156e7fe0), SPH_C32(0x42f40000), - SPH_C32(0x195c0000), SPH_C32(0xb7ca000b), SPH_C32(0xfe072000), - SPH_C32(0x818e51b7), SPH_C32(0xf913eea9), SPH_C32(0xd9a99864), - SPH_C32(0xb444fed9) }, - { SPH_C32(0x2a370000), SPH_C32(0x218e0000), SPH_C32(0xecec001e), - SPH_C32(0x3b7e2800), SPH_C32(0x036075b5), SPH_C32(0x5b5d7474), - SPH_C32(0xc7cf4ea5), SPH_C32(0x26ab5baf), SPH_C32(0xcece0000), - SPH_C32(0xc3c40000), SPH_C32(0xd7b5000b), SPH_C32(0xaa00a800), - SPH_C32(0x04ff14a4), SPH_C32(0x99155cea), SPH_C32(0x02f9a1f8), - SPH_C32(0x3e1c187d) }, - { SPH_C32(0xe0220000), SPH_C32(0xbf2a0000), SPH_C32(0x7e8e001f), - SPH_C32(0x15a42000), SPH_C32(0x4d627fcc), SPH_C32(0xc90b2a30), - SPH_C32(0xdae0929e), SPH_C32(0x2f2a0651), SPH_C32(0x5fae0000), - SPH_C32(0x322e0000), SPH_C32(0xff47000b), SPH_C32(0x51663800), - SPH_C32(0xa4457f72), SPH_C32(0x316a5179), SPH_C32(0x580b9c4d), - SPH_C32(0xaa31c87f) }, - { SPH_C32(0x72740000), SPH_C32(0xa1f00000), SPH_C32(0x94df001f), - SPH_C32(0xfd151000), SPH_C32(0xe4572969), SPH_C32(0x22f04ba9), - SPH_C32(0x6bbcb0ca), SPH_C32(0x1cef221e), SPH_C32(0xd3940000), - SPH_C32(0xe8b60000), SPH_C32(0x9f38000b), SPH_C32(0x0561b000), - SPH_C32(0x21343a61), SPH_C32(0x516ce33a), SPH_C32(0x835ba5d1), - SPH_C32(0x20692edb) }, - { SPH_C32(0x07ed0000), SPH_C32(0xb2500000), SPH_C32(0x8774000a), - SPH_C32(0x970d0000), SPH_C32(0x437223ae), SPH_C32(0x48c76ea4), - SPH_C32(0xf4786222), SPH_C32(0x9075b1ce), SPH_C32(0xa2d60000), - SPH_C32(0xa6760000), SPH_C32(0xc9440014), SPH_C32(0xeba30000), - SPH_C32(0xccec2e7b), SPH_C32(0x3018c499), SPH_C32(0x03490afa), - SPH_C32(0x9b6ef888) }, - { SPH_C32(0x95bb0000), SPH_C32(0xac8a0000), SPH_C32(0x6d25000a), - SPH_C32(0x7fbc3000), SPH_C32(0xea47750b), SPH_C32(0xa33c0f3d), - SPH_C32(0x45244076), SPH_C32(0xa3b09581), SPH_C32(0x2eec0000), - SPH_C32(0x7cee0000), SPH_C32(0xa93b0014), SPH_C32(0xbfa48800), - SPH_C32(0x499d6b68), SPH_C32(0x501e76da), SPH_C32(0xd8193366), - SPH_C32(0x11361e2c) }, - { SPH_C32(0x5fae0000), SPH_C32(0x322e0000), SPH_C32(0xff47000b), - SPH_C32(0x51663800), SPH_C32(0xa4457f72), SPH_C32(0x316a5179), - SPH_C32(0x580b9c4d), SPH_C32(0xaa31c87f), SPH_C32(0xbf8c0000), - SPH_C32(0x8d040000), SPH_C32(0x81c90014), SPH_C32(0x44c21800), - SPH_C32(0xe92700be), SPH_C32(0xf8617b49), SPH_C32(0x82eb0ed3), - SPH_C32(0x851bce2e) }, - { SPH_C32(0xcdf80000), SPH_C32(0x2cf40000), SPH_C32(0x1516000b), - SPH_C32(0xb9d70800), SPH_C32(0x0d7029d7), SPH_C32(0xda9130e0), - SPH_C32(0xe957be19), SPH_C32(0x99f4ec30), SPH_C32(0x33b60000), - SPH_C32(0x579c0000), SPH_C32(0xe1b60014), SPH_C32(0x10c59000), - SPH_C32(0x6c5645ad), SPH_C32(0x9867c90a), SPH_C32(0x59bb374f), - SPH_C32(0x0f43288a) }, - { SPH_C32(0x1ab70000), SPH_C32(0x99220000), SPH_C32(0xcff9000a), - SPH_C32(0x386c1800), SPH_C32(0x66b90d6b), SPH_C32(0x80bed174), - SPH_C32(0x75da660b), SPH_C32(0x8e008768), SPH_C32(0xe7cf0000), - SPH_C32(0x0d7a0000), SPH_C32(0xf9fa0015), SPH_C32(0x82a92000), - SPH_C32(0x0e105c62), SPH_C32(0x81cc4494), SPH_C32(0x2e98f0bc), - SPH_C32(0xbf5fb79f) }, - { SPH_C32(0x88e10000), SPH_C32(0x87f80000), SPH_C32(0x25a8000a), - SPH_C32(0xd0dd2800), SPH_C32(0xcf8c5bce), SPH_C32(0x6b45b0ed), - SPH_C32(0xc486445f), SPH_C32(0xbdc5a327), SPH_C32(0x6bf50000), - SPH_C32(0xd7e20000), SPH_C32(0x99850015), SPH_C32(0xd6aea800), - SPH_C32(0x8b611971), SPH_C32(0xe1caf6d7), SPH_C32(0xf5c8c920), - SPH_C32(0x3507513b) }, - { SPH_C32(0x42f40000), SPH_C32(0x195c0000), SPH_C32(0xb7ca000b), - SPH_C32(0xfe072000), SPH_C32(0x818e51b7), SPH_C32(0xf913eea9), - SPH_C32(0xd9a99864), SPH_C32(0xb444fed9), SPH_C32(0xfa950000), - SPH_C32(0x26080000), SPH_C32(0xb1770015), SPH_C32(0x2dc83800), - SPH_C32(0x2bdb72a7), SPH_C32(0x49b5fb44), SPH_C32(0xaf3af495), - SPH_C32(0xa12a8139) }, - { SPH_C32(0xd0a20000), SPH_C32(0x07860000), SPH_C32(0x5d9b000b), - SPH_C32(0x16b61000), SPH_C32(0x28bb0712), SPH_C32(0x12e88f30), - SPH_C32(0x68f5ba30), SPH_C32(0x8781da96), SPH_C32(0x76af0000), - SPH_C32(0xfc900000), SPH_C32(0xd1080015), SPH_C32(0x79cfb000), - SPH_C32(0xaeaa37b4), SPH_C32(0x29b34907), SPH_C32(0x746acd09), - SPH_C32(0x2b72679d) }, - { SPH_C32(0xa2d60000), SPH_C32(0xa6760000), SPH_C32(0xc9440014), - SPH_C32(0xeba30000), SPH_C32(0xccec2e7b), SPH_C32(0x3018c499), - SPH_C32(0x03490afa), SPH_C32(0x9b6ef888), SPH_C32(0xa53b0000), - SPH_C32(0x14260000), SPH_C32(0x4e30001e), SPH_C32(0x7cae0000), - SPH_C32(0x8f9e0dd5), SPH_C32(0x78dfaa3d), SPH_C32(0xf73168d8), - SPH_C32(0x0b1b4946) }, - { SPH_C32(0x30800000), SPH_C32(0xb8ac0000), SPH_C32(0x23150014), - SPH_C32(0x03123000), SPH_C32(0x65d978de), SPH_C32(0xdbe3a500), - SPH_C32(0xb21528ae), SPH_C32(0xa8abdcc7), SPH_C32(0x29010000), - SPH_C32(0xcebe0000), SPH_C32(0x2e4f001e), SPH_C32(0x28a98800), - SPH_C32(0x0aef48c6), SPH_C32(0x18d9187e), SPH_C32(0x2c615144), - SPH_C32(0x8143afe2) }, - { SPH_C32(0xfa950000), SPH_C32(0x26080000), SPH_C32(0xb1770015), - SPH_C32(0x2dc83800), SPH_C32(0x2bdb72a7), SPH_C32(0x49b5fb44), - SPH_C32(0xaf3af495), SPH_C32(0xa12a8139), SPH_C32(0xb8610000), - SPH_C32(0x3f540000), SPH_C32(0x06bd001e), SPH_C32(0xd3cf1800), - SPH_C32(0xaa552310), SPH_C32(0xb0a615ed), SPH_C32(0x76936cf1), - SPH_C32(0x156e7fe0) }, - { SPH_C32(0x68c30000), SPH_C32(0x38d20000), SPH_C32(0x5b260015), - SPH_C32(0xc5790800), SPH_C32(0x82ee2402), SPH_C32(0xa24e9add), - SPH_C32(0x1e66d6c1), SPH_C32(0x92efa576), SPH_C32(0x345b0000), - SPH_C32(0xe5cc0000), SPH_C32(0x66c2001e), SPH_C32(0x87c89000), - SPH_C32(0x2f246603), SPH_C32(0xd0a0a7ae), SPH_C32(0xadc3556d), - SPH_C32(0x9f369944) }, - { SPH_C32(0xbf8c0000), SPH_C32(0x8d040000), SPH_C32(0x81c90014), - SPH_C32(0x44c21800), SPH_C32(0xe92700be), SPH_C32(0xf8617b49), - SPH_C32(0x82eb0ed3), SPH_C32(0x851bce2e), SPH_C32(0xe0220000), - SPH_C32(0xbf2a0000), SPH_C32(0x7e8e001f), SPH_C32(0x15a42000), - SPH_C32(0x4d627fcc), SPH_C32(0xc90b2a30), SPH_C32(0xdae0929e), - SPH_C32(0x2f2a0651) }, - { SPH_C32(0x2dda0000), SPH_C32(0x93de0000), SPH_C32(0x6b980014), - SPH_C32(0xac732800), SPH_C32(0x4012561b), SPH_C32(0x139a1ad0), - SPH_C32(0x33b72c87), SPH_C32(0xb6deea61), SPH_C32(0x6c180000), - SPH_C32(0x65b20000), SPH_C32(0x1ef1001f), SPH_C32(0x41a3a800), - SPH_C32(0xc8133adf), SPH_C32(0xa90d9873), SPH_C32(0x01b0ab02), - SPH_C32(0xa572e0f5) }, - { SPH_C32(0xe7cf0000), SPH_C32(0x0d7a0000), SPH_C32(0xf9fa0015), - SPH_C32(0x82a92000), SPH_C32(0x0e105c62), SPH_C32(0x81cc4494), - SPH_C32(0x2e98f0bc), SPH_C32(0xbf5fb79f), SPH_C32(0xfd780000), - SPH_C32(0x94580000), SPH_C32(0x3603001f), SPH_C32(0xbac53800), - SPH_C32(0x68a95109), SPH_C32(0x017295e0), SPH_C32(0x5b4296b7), - SPH_C32(0x315f30f7) }, - { SPH_C32(0x75990000), SPH_C32(0x13a00000), SPH_C32(0x13ab0015), - SPH_C32(0x6a181000), SPH_C32(0xa7250ac7), SPH_C32(0x6a37250d), - SPH_C32(0x9fc4d2e8), SPH_C32(0x8c9a93d0), SPH_C32(0x71420000), - SPH_C32(0x4ec00000), SPH_C32(0x567c001f), SPH_C32(0xeec2b000), - SPH_C32(0xedd8141a), SPH_C32(0x617427a3), SPH_C32(0x8012af2b), - SPH_C32(0xbb07d653) }, - { SPH_C32(0x88980000), SPH_C32(0x1f940000), SPH_C32(0x7fcf002e), - SPH_C32(0xfb4e0000), SPH_C32(0xf158079a), SPH_C32(0x61ae9167), - SPH_C32(0xa895706c), SPH_C32(0xe6107494), SPH_C32(0x0bc20000), - SPH_C32(0xdb630000), SPH_C32(0x7e88000c), SPH_C32(0x15860000), - SPH_C32(0x91fd48f3), SPH_C32(0x7581bb43), SPH_C32(0xf460449e), - SPH_C32(0xd8b61463) }, - { SPH_C32(0x1ace0000), SPH_C32(0x014e0000), SPH_C32(0x959e002e), - SPH_C32(0x13ff3000), SPH_C32(0x586d513f), SPH_C32(0x8a55f0fe), - SPH_C32(0x19c95238), SPH_C32(0xd5d550db), SPH_C32(0x87f80000), - SPH_C32(0x01fb0000), SPH_C32(0x1ef7000c), SPH_C32(0x41818800), - SPH_C32(0x148c0de0), SPH_C32(0x15870900), SPH_C32(0x2f307d02), - SPH_C32(0x52eef2c7) }, - { SPH_C32(0xd0db0000), SPH_C32(0x9fea0000), SPH_C32(0x07fc002f), - SPH_C32(0x3d253800), SPH_C32(0x166f5b46), SPH_C32(0x1803aeba), - SPH_C32(0x04e68e03), SPH_C32(0xdc540d25), SPH_C32(0x16980000), - SPH_C32(0xf0110000), SPH_C32(0x3605000c), SPH_C32(0xbae71800), - SPH_C32(0xb4366636), SPH_C32(0xbdf80493), SPH_C32(0x75c240b7), - SPH_C32(0xc6c322c5) }, - { SPH_C32(0x428d0000), SPH_C32(0x81300000), SPH_C32(0xedad002f), - SPH_C32(0xd5940800), SPH_C32(0xbf5a0de3), SPH_C32(0xf3f8cf23), - SPH_C32(0xb5baac57), SPH_C32(0xef91296a), SPH_C32(0x9aa20000), - SPH_C32(0x2a890000), SPH_C32(0x567a000c), SPH_C32(0xeee09000), - SPH_C32(0x31472325), SPH_C32(0xddfeb6d0), SPH_C32(0xae92792b), - SPH_C32(0x4c9bc461) }, - { SPH_C32(0x95c20000), SPH_C32(0x34e60000), SPH_C32(0x3742002e), - SPH_C32(0x542f1800), SPH_C32(0xd493295f), SPH_C32(0xa9d72eb7), - SPH_C32(0x29377445), SPH_C32(0xf8654232), SPH_C32(0x4edb0000), - SPH_C32(0x706f0000), SPH_C32(0x4e36000d), SPH_C32(0x7c8c2000), - SPH_C32(0x53013aea), SPH_C32(0xc4553b4e), SPH_C32(0xd9b1bed8), - SPH_C32(0xfc875b74) }, - { SPH_C32(0x07940000), SPH_C32(0x2a3c0000), SPH_C32(0xdd13002e), - SPH_C32(0xbc9e2800), SPH_C32(0x7da67ffa), SPH_C32(0x422c4f2e), - SPH_C32(0x986b5611), SPH_C32(0xcba0667d), SPH_C32(0xc2e10000), - SPH_C32(0xaaf70000), SPH_C32(0x2e49000d), SPH_C32(0x288ba800), - SPH_C32(0xd6707ff9), SPH_C32(0xa453890d), SPH_C32(0x02e18744), - SPH_C32(0x76dfbdd0) }, - { SPH_C32(0xcd810000), SPH_C32(0xb4980000), SPH_C32(0x4f71002f), - SPH_C32(0x92442000), SPH_C32(0x33a47583), SPH_C32(0xd07a116a), - SPH_C32(0x85448a2a), SPH_C32(0xc2213b83), SPH_C32(0x53810000), - SPH_C32(0x5b1d0000), SPH_C32(0x06bb000d), SPH_C32(0xd3ed3800), - SPH_C32(0x76ca142f), SPH_C32(0x0c2c849e), SPH_C32(0x5813baf1), - SPH_C32(0xe2f26dd2) }, - { SPH_C32(0x5fd70000), SPH_C32(0xaa420000), SPH_C32(0xa520002f), - SPH_C32(0x7af51000), SPH_C32(0x9a912326), SPH_C32(0x3b8170f3), - SPH_C32(0x3418a87e), SPH_C32(0xf1e41fcc), SPH_C32(0xdfbb0000), - SPH_C32(0x81850000), SPH_C32(0x66c4000d), SPH_C32(0x87eab000), - SPH_C32(0xf3bb513c), SPH_C32(0x6c2a36dd), SPH_C32(0x8343836d), - SPH_C32(0x68aa8b76) }, - { SPH_C32(0x2da30000), SPH_C32(0x0bb20000), SPH_C32(0x31ff0030), - SPH_C32(0x87e00000), SPH_C32(0x7ec60a4f), SPH_C32(0x19713b5a), - SPH_C32(0x5fa418b4), SPH_C32(0xed0b3dd2), SPH_C32(0x0c2f0000), - SPH_C32(0x69330000), SPH_C32(0xf9fc0006), SPH_C32(0x828b0000), - SPH_C32(0xd28f6b5d), SPH_C32(0x3d46d5e7), SPH_C32(0x001826bc), - SPH_C32(0x48c3a5ad) }, - { SPH_C32(0xbff50000), SPH_C32(0x15680000), SPH_C32(0xdbae0030), - SPH_C32(0x6f513000), SPH_C32(0xd7f35cea), SPH_C32(0xf28a5ac3), - SPH_C32(0xeef83ae0), SPH_C32(0xdece199d), SPH_C32(0x80150000), - SPH_C32(0xb3ab0000), SPH_C32(0x99830006), SPH_C32(0xd68c8800), - SPH_C32(0x57fe2e4e), SPH_C32(0x5d4067a4), SPH_C32(0xdb481f20), - SPH_C32(0xc29b4309) }, - { SPH_C32(0x75e00000), SPH_C32(0x8bcc0000), SPH_C32(0x49cc0031), - SPH_C32(0x418b3800), SPH_C32(0x99f15693), SPH_C32(0x60dc0487), - SPH_C32(0xf3d7e6db), SPH_C32(0xd74f4463), SPH_C32(0x11750000), - SPH_C32(0x42410000), SPH_C32(0xb1710006), SPH_C32(0x2dea1800), - SPH_C32(0xf7444598), SPH_C32(0xf53f6a37), SPH_C32(0x81ba2295), - SPH_C32(0x56b6930b) }, - { SPH_C32(0xe7b60000), SPH_C32(0x95160000), SPH_C32(0xa39d0031), - SPH_C32(0xa93a0800), SPH_C32(0x30c40036), SPH_C32(0x8b27651e), - SPH_C32(0x428bc48f), SPH_C32(0xe48a602c), SPH_C32(0x9d4f0000), - SPH_C32(0x98d90000), SPH_C32(0xd10e0006), SPH_C32(0x79ed9000), - SPH_C32(0x7235008b), SPH_C32(0x9539d874), SPH_C32(0x5aea1b09), - SPH_C32(0xdcee75af) }, - { SPH_C32(0x30f90000), SPH_C32(0x20c00000), SPH_C32(0x79720030), - SPH_C32(0x28811800), SPH_C32(0x5b0d248a), SPH_C32(0xd108848a), - SPH_C32(0xde061c9d), SPH_C32(0xf37e0b74), SPH_C32(0x49360000), - SPH_C32(0xc23f0000), SPH_C32(0xc9420007), SPH_C32(0xeb812000), - SPH_C32(0x10731944), SPH_C32(0x8c9255ea), SPH_C32(0x2dc9dcfa), - SPH_C32(0x6cf2eaba) }, - { SPH_C32(0xa2af0000), SPH_C32(0x3e1a0000), SPH_C32(0x93230030), - SPH_C32(0xc0302800), SPH_C32(0xf238722f), SPH_C32(0x3af3e513), - SPH_C32(0x6f5a3ec9), SPH_C32(0xc0bb2f3b), SPH_C32(0xc50c0000), - SPH_C32(0x18a70000), SPH_C32(0xa93d0007), SPH_C32(0xbf86a800), - SPH_C32(0x95025c57), SPH_C32(0xec94e7a9), SPH_C32(0xf699e566), - SPH_C32(0xe6aa0c1e) }, - { SPH_C32(0x68ba0000), SPH_C32(0xa0be0000), SPH_C32(0x01410031), - SPH_C32(0xeeea2000), SPH_C32(0xbc3a7856), SPH_C32(0xa8a5bb57), - SPH_C32(0x7275e2f2), SPH_C32(0xc93a72c5), SPH_C32(0x546c0000), - SPH_C32(0xe94d0000), SPH_C32(0x81cf0007), SPH_C32(0x44e03800), - SPH_C32(0x35b83781), SPH_C32(0x44ebea3a), SPH_C32(0xac6bd8d3), - SPH_C32(0x7287dc1c) }, - { SPH_C32(0xfaec0000), SPH_C32(0xbe640000), SPH_C32(0xeb100031), - SPH_C32(0x065b1000), SPH_C32(0x150f2ef3), SPH_C32(0x435edace), - SPH_C32(0xc329c0a6), SPH_C32(0xfaff568a), SPH_C32(0xd8560000), - SPH_C32(0x33d50000), SPH_C32(0xe1b00007), SPH_C32(0x10e7b000), - SPH_C32(0xb0c97292), SPH_C32(0x24ed5879), SPH_C32(0x773be14f), - SPH_C32(0xf8df3ab8) }, - { SPH_C32(0x8f750000), SPH_C32(0xadc40000), SPH_C32(0xf8bb0024), - SPH_C32(0x6c430000), SPH_C32(0xb22a2434), SPH_C32(0x2969ffc3), - SPH_C32(0x5ced124e), SPH_C32(0x7665c55a), SPH_C32(0xa9140000), - SPH_C32(0x7d150000), SPH_C32(0xb7cc0018), SPH_C32(0xfe250000), - SPH_C32(0x5d116688), SPH_C32(0x45997fda), SPH_C32(0xf7294e64), - SPH_C32(0x43d8eceb) }, - { SPH_C32(0x1d230000), SPH_C32(0xb31e0000), SPH_C32(0x12ea0024), - SPH_C32(0x84f23000), SPH_C32(0x1b1f7291), SPH_C32(0xc2929e5a), - SPH_C32(0xedb1301a), SPH_C32(0x45a0e115), SPH_C32(0x252e0000), - SPH_C32(0xa78d0000), SPH_C32(0xd7b30018), SPH_C32(0xaa228800), - SPH_C32(0xd860239b), SPH_C32(0x259fcd99), SPH_C32(0x2c7977f8), - SPH_C32(0xc9800a4f) }, - { SPH_C32(0xd7360000), SPH_C32(0x2dba0000), SPH_C32(0x80880025), - SPH_C32(0xaa283800), SPH_C32(0x551d78e8), SPH_C32(0x50c4c01e), - SPH_C32(0xf09eec21), SPH_C32(0x4c21bceb), SPH_C32(0xb44e0000), - SPH_C32(0x56670000), SPH_C32(0xff410018), SPH_C32(0x51441800), - SPH_C32(0x78da484d), SPH_C32(0x8de0c00a), SPH_C32(0x768b4a4d), - SPH_C32(0x5dadda4d) }, - { SPH_C32(0x45600000), SPH_C32(0x33600000), SPH_C32(0x6ad90025), - SPH_C32(0x42990800), SPH_C32(0xfc282e4d), SPH_C32(0xbb3fa187), - SPH_C32(0x41c2ce75), SPH_C32(0x7fe498a4), SPH_C32(0x38740000), - SPH_C32(0x8cff0000), SPH_C32(0x9f3e0018), SPH_C32(0x05439000), - SPH_C32(0xfdab0d5e), SPH_C32(0xede67249), SPH_C32(0xaddb73d1), - SPH_C32(0xd7f53ce9) }, - { SPH_C32(0x922f0000), SPH_C32(0x86b60000), SPH_C32(0xb0360024), - SPH_C32(0xc3221800), SPH_C32(0x97e10af1), SPH_C32(0xe1104013), - SPH_C32(0xdd4f1667), SPH_C32(0x6810f3fc), SPH_C32(0xec0d0000), - SPH_C32(0xd6190000), SPH_C32(0x87720019), SPH_C32(0x972f2000), - SPH_C32(0x9fed1491), SPH_C32(0xf44dffd7), SPH_C32(0xdaf8b422), - SPH_C32(0x67e9a3fc) }, - { SPH_C32(0x00790000), SPH_C32(0x986c0000), SPH_C32(0x5a670024), - SPH_C32(0x2b932800), SPH_C32(0x3ed45c54), SPH_C32(0x0aeb218a), - SPH_C32(0x6c133433), SPH_C32(0x5bd5d7b3), SPH_C32(0x60370000), - SPH_C32(0x0c810000), SPH_C32(0xe70d0019), SPH_C32(0xc328a800), - SPH_C32(0x1a9c5182), SPH_C32(0x944b4d94), SPH_C32(0x01a88dbe), - SPH_C32(0xedb14558) }, - { SPH_C32(0xca6c0000), SPH_C32(0x06c80000), SPH_C32(0xc8050025), - SPH_C32(0x05492000), SPH_C32(0x70d6562d), SPH_C32(0x98bd7fce), - SPH_C32(0x713ce808), SPH_C32(0x52548a4d), SPH_C32(0xf1570000), - SPH_C32(0xfd6b0000), SPH_C32(0xcfff0019), SPH_C32(0x384e3800), - SPH_C32(0xba263a54), SPH_C32(0x3c344007), SPH_C32(0x5b5ab00b), - SPH_C32(0x799c955a) }, - { SPH_C32(0x583a0000), SPH_C32(0x18120000), SPH_C32(0x22540025), - SPH_C32(0xedf81000), SPH_C32(0xd9e30088), SPH_C32(0x73461e57), - SPH_C32(0xc060ca5c), SPH_C32(0x6191ae02), SPH_C32(0x7d6d0000), - SPH_C32(0x27f30000), SPH_C32(0xaf800019), SPH_C32(0x6c49b000), - SPH_C32(0x3f577f47), SPH_C32(0x5c32f244), SPH_C32(0x800a8997), - SPH_C32(0xf3c473fe) }, - { SPH_C32(0x2a4e0000), SPH_C32(0xb9e20000), SPH_C32(0xb68b003a), - SPH_C32(0x10ed0000), SPH_C32(0x3db429e1), SPH_C32(0x51b655fe), - SPH_C32(0xabdc7a96), SPH_C32(0x7d7e8c1c), SPH_C32(0xaef90000), - SPH_C32(0xcf450000), SPH_C32(0x30b80012), SPH_C32(0x69280000), - SPH_C32(0x1e634526), SPH_C32(0x0d5e117e), SPH_C32(0x03512c46), - SPH_C32(0xd3ad5d25) }, - { SPH_C32(0xb8180000), SPH_C32(0xa7380000), SPH_C32(0x5cda003a), - SPH_C32(0xf85c3000), SPH_C32(0x94817f44), SPH_C32(0xba4d3467), - SPH_C32(0x1a8058c2), SPH_C32(0x4ebba853), SPH_C32(0x22c30000), - SPH_C32(0x15dd0000), SPH_C32(0x50c70012), SPH_C32(0x3d2f8800), - SPH_C32(0x9b120035), SPH_C32(0x6d58a33d), SPH_C32(0xd80115da), - SPH_C32(0x59f5bb81) }, - { SPH_C32(0x720d0000), SPH_C32(0x399c0000), SPH_C32(0xceb8003b), - SPH_C32(0xd6863800), SPH_C32(0xda83753d), SPH_C32(0x281b6a23), - SPH_C32(0x07af84f9), SPH_C32(0x473af5ad), SPH_C32(0xb3a30000), - SPH_C32(0xe4370000), SPH_C32(0x78350012), SPH_C32(0xc6491800), - SPH_C32(0x3ba86be3), SPH_C32(0xc527aeae), SPH_C32(0x82f3286f), - SPH_C32(0xcdd86b83) }, - { SPH_C32(0xe05b0000), SPH_C32(0x27460000), SPH_C32(0x24e9003b), - SPH_C32(0x3e370800), SPH_C32(0x73b62398), SPH_C32(0xc3e00bba), - SPH_C32(0xb6f3a6ad), SPH_C32(0x74ffd1e2), SPH_C32(0x3f990000), - SPH_C32(0x3eaf0000), SPH_C32(0x184a0012), SPH_C32(0x924e9000), - SPH_C32(0xbed92ef0), SPH_C32(0xa5211ced), SPH_C32(0x59a311f3), - SPH_C32(0x47808d27) }, - { SPH_C32(0x37140000), SPH_C32(0x92900000), SPH_C32(0xfe06003a), - SPH_C32(0xbf8c1800), SPH_C32(0x187f0724), SPH_C32(0x99cfea2e), - SPH_C32(0x2a7e7ebf), SPH_C32(0x630bbaba), SPH_C32(0xebe00000), - SPH_C32(0x64490000), SPH_C32(0x00060013), SPH_C32(0x00222000), - SPH_C32(0xdc9f373f), SPH_C32(0xbc8a9173), SPH_C32(0x2e80d600), - SPH_C32(0xf79c1232) }, - { SPH_C32(0xa5420000), SPH_C32(0x8c4a0000), SPH_C32(0x1457003a), - SPH_C32(0x573d2800), SPH_C32(0xb14a5181), SPH_C32(0x72348bb7), - SPH_C32(0x9b225ceb), SPH_C32(0x50ce9ef5), SPH_C32(0x67da0000), - SPH_C32(0xbed10000), SPH_C32(0x60790013), SPH_C32(0x5425a800), - SPH_C32(0x59ee722c), SPH_C32(0xdc8c2330), SPH_C32(0xf5d0ef9c), - SPH_C32(0x7dc4f496) }, - { SPH_C32(0x6f570000), SPH_C32(0x12ee0000), SPH_C32(0x8635003b), - SPH_C32(0x79e72000), SPH_C32(0xff485bf8), SPH_C32(0xe062d5f3), - SPH_C32(0x860d80d0), SPH_C32(0x594fc30b), SPH_C32(0xf6ba0000), - SPH_C32(0x4f3b0000), SPH_C32(0x488b0013), SPH_C32(0xaf433800), - SPH_C32(0xf95419fa), SPH_C32(0x74f32ea3), SPH_C32(0xaf22d229), - SPH_C32(0xe9e92494) }, - { SPH_C32(0xfd010000), SPH_C32(0x0c340000), SPH_C32(0x6c64003b), - SPH_C32(0x91561000), SPH_C32(0x567d0d5d), SPH_C32(0x0b99b46a), - SPH_C32(0x3751a284), SPH_C32(0x6a8ae744), SPH_C32(0x7a800000), - SPH_C32(0x95a30000), SPH_C32(0x28f40013), SPH_C32(0xfb44b000), - SPH_C32(0x7c255ce9), SPH_C32(0x14f59ce0), SPH_C32(0x7472ebb5), - SPH_C32(0x63b1c230) }, - { SPH_C32(0x0bc20000), SPH_C32(0xdb630000), SPH_C32(0x7e88000c), - SPH_C32(0x15860000), SPH_C32(0x91fd48f3), SPH_C32(0x7581bb43), - SPH_C32(0xf460449e), SPH_C32(0xd8b61463), SPH_C32(0x835a0000), - SPH_C32(0xc4f70000), SPH_C32(0x01470022), SPH_C32(0xeec80000), - SPH_C32(0x60a54f69), SPH_C32(0x142f2a24), SPH_C32(0x5cf534f2), - SPH_C32(0x3ea660f7) }, - { SPH_C32(0x99940000), SPH_C32(0xc5b90000), SPH_C32(0x94d9000c), - SPH_C32(0xfd373000), SPH_C32(0x38c81e56), SPH_C32(0x9e7adada), - SPH_C32(0x453c66ca), SPH_C32(0xeb73302c), SPH_C32(0x0f600000), - SPH_C32(0x1e6f0000), SPH_C32(0x61380022), SPH_C32(0xbacf8800), - SPH_C32(0xe5d40a7a), SPH_C32(0x74299867), SPH_C32(0x87a50d6e), - SPH_C32(0xb4fe8653) }, - { SPH_C32(0x53810000), SPH_C32(0x5b1d0000), SPH_C32(0x06bb000d), - SPH_C32(0xd3ed3800), SPH_C32(0x76ca142f), SPH_C32(0x0c2c849e), - SPH_C32(0x5813baf1), SPH_C32(0xe2f26dd2), SPH_C32(0x9e000000), - SPH_C32(0xef850000), SPH_C32(0x49ca0022), SPH_C32(0x41a91800), - SPH_C32(0x456e61ac), SPH_C32(0xdc5695f4), SPH_C32(0xdd5730db), - SPH_C32(0x20d35651) }, - { SPH_C32(0xc1d70000), SPH_C32(0x45c70000), SPH_C32(0xecea000d), - SPH_C32(0x3b5c0800), SPH_C32(0xdfff428a), SPH_C32(0xe7d7e507), - SPH_C32(0xe94f98a5), SPH_C32(0xd137499d), SPH_C32(0x123a0000), - SPH_C32(0x351d0000), SPH_C32(0x29b50022), SPH_C32(0x15ae9000), - SPH_C32(0xc01f24bf), SPH_C32(0xbc5027b7), SPH_C32(0x06070947), - SPH_C32(0xaa8bb0f5) }, - { SPH_C32(0x16980000), SPH_C32(0xf0110000), SPH_C32(0x3605000c), - SPH_C32(0xbae71800), SPH_C32(0xb4366636), SPH_C32(0xbdf80493), - SPH_C32(0x75c240b7), SPH_C32(0xc6c322c5), SPH_C32(0xc6430000), - SPH_C32(0x6ffb0000), SPH_C32(0x31f90023), SPH_C32(0x87c22000), - SPH_C32(0xa2593d70), SPH_C32(0xa5fbaa29), SPH_C32(0x7124ceb4), - SPH_C32(0x1a972fe0) }, - { SPH_C32(0x84ce0000), SPH_C32(0xeecb0000), SPH_C32(0xdc54000c), - SPH_C32(0x52562800), SPH_C32(0x1d033093), SPH_C32(0x5603650a), - SPH_C32(0xc49e62e3), SPH_C32(0xf506068a), SPH_C32(0x4a790000), - SPH_C32(0xb5630000), SPH_C32(0x51860023), SPH_C32(0xd3c5a800), - SPH_C32(0x27287863), SPH_C32(0xc5fd186a), SPH_C32(0xaa74f728), - SPH_C32(0x90cfc944) }, - { SPH_C32(0x4edb0000), SPH_C32(0x706f0000), SPH_C32(0x4e36000d), - SPH_C32(0x7c8c2000), SPH_C32(0x53013aea), SPH_C32(0xc4553b4e), - SPH_C32(0xd9b1bed8), SPH_C32(0xfc875b74), SPH_C32(0xdb190000), - SPH_C32(0x44890000), SPH_C32(0x79740023), SPH_C32(0x28a33800), - SPH_C32(0x879213b5), SPH_C32(0x6d8215f9), SPH_C32(0xf086ca9d), - SPH_C32(0x04e21946) }, - { SPH_C32(0xdc8d0000), SPH_C32(0x6eb50000), SPH_C32(0xa467000d), - SPH_C32(0x943d1000), SPH_C32(0xfa346c4f), SPH_C32(0x2fae5ad7), - SPH_C32(0x68ed9c8c), SPH_C32(0xcf427f3b), SPH_C32(0x57230000), - SPH_C32(0x9e110000), SPH_C32(0x190b0023), SPH_C32(0x7ca4b000), - SPH_C32(0x02e356a6), SPH_C32(0x0d84a7ba), SPH_C32(0x2bd6f301), - SPH_C32(0x8ebaffe2) }, - { SPH_C32(0xaef90000), SPH_C32(0xcf450000), SPH_C32(0x30b80012), - SPH_C32(0x69280000), SPH_C32(0x1e634526), SPH_C32(0x0d5e117e), - SPH_C32(0x03512c46), SPH_C32(0xd3ad5d25), SPH_C32(0x84b70000), - SPH_C32(0x76a70000), SPH_C32(0x86330028), SPH_C32(0x79c50000), - SPH_C32(0x23d76cc7), SPH_C32(0x5ce84480), SPH_C32(0xa88d56d0), - SPH_C32(0xaed3d139) }, - { SPH_C32(0x3caf0000), SPH_C32(0xd19f0000), SPH_C32(0xdae90012), - SPH_C32(0x81993000), SPH_C32(0xb7561383), SPH_C32(0xe6a570e7), - SPH_C32(0xb20d0e12), SPH_C32(0xe068796a), SPH_C32(0x088d0000), - SPH_C32(0xac3f0000), SPH_C32(0xe64c0028), SPH_C32(0x2dc28800), - SPH_C32(0xa6a629d4), SPH_C32(0x3ceef6c3), SPH_C32(0x73dd6f4c), - SPH_C32(0x248b379d) }, - { SPH_C32(0xf6ba0000), SPH_C32(0x4f3b0000), SPH_C32(0x488b0013), - SPH_C32(0xaf433800), SPH_C32(0xf95419fa), SPH_C32(0x74f32ea3), - SPH_C32(0xaf22d229), SPH_C32(0xe9e92494), SPH_C32(0x99ed0000), - SPH_C32(0x5dd50000), SPH_C32(0xcebe0028), SPH_C32(0xd6a41800), - SPH_C32(0x061c4202), SPH_C32(0x9491fb50), SPH_C32(0x292f52f9), - SPH_C32(0xb0a6e79f) }, - { SPH_C32(0x64ec0000), SPH_C32(0x51e10000), SPH_C32(0xa2da0013), - SPH_C32(0x47f20800), SPH_C32(0x50614f5f), SPH_C32(0x9f084f3a), - SPH_C32(0x1e7ef07d), SPH_C32(0xda2c00db), SPH_C32(0x15d70000), - SPH_C32(0x874d0000), SPH_C32(0xaec10028), SPH_C32(0x82a39000), - SPH_C32(0x836d0711), SPH_C32(0xf4974913), SPH_C32(0xf27f6b65), - SPH_C32(0x3afe013b) }, - { SPH_C32(0xb3a30000), SPH_C32(0xe4370000), SPH_C32(0x78350012), - SPH_C32(0xc6491800), SPH_C32(0x3ba86be3), SPH_C32(0xc527aeae), - SPH_C32(0x82f3286f), SPH_C32(0xcdd86b83), SPH_C32(0xc1ae0000), - SPH_C32(0xddab0000), SPH_C32(0xb68d0029), SPH_C32(0x10cf2000), - SPH_C32(0xe12b1ede), SPH_C32(0xed3cc48d), SPH_C32(0x855cac96), - SPH_C32(0x8ae29e2e) }, - { SPH_C32(0x21f50000), SPH_C32(0xfaed0000), SPH_C32(0x92640012), - SPH_C32(0x2ef82800), SPH_C32(0x929d3d46), SPH_C32(0x2edccf37), - SPH_C32(0x33af0a3b), SPH_C32(0xfe1d4fcc), SPH_C32(0x4d940000), - SPH_C32(0x07330000), SPH_C32(0xd6f20029), SPH_C32(0x44c8a800), - SPH_C32(0x645a5bcd), SPH_C32(0x8d3a76ce), SPH_C32(0x5e0c950a), - SPH_C32(0x00ba788a) }, - { SPH_C32(0xebe00000), SPH_C32(0x64490000), SPH_C32(0x00060013), - SPH_C32(0x00222000), SPH_C32(0xdc9f373f), SPH_C32(0xbc8a9173), - SPH_C32(0x2e80d600), SPH_C32(0xf79c1232), SPH_C32(0xdcf40000), - SPH_C32(0xf6d90000), SPH_C32(0xfe000029), SPH_C32(0xbfae3800), - SPH_C32(0xc4e0301b), SPH_C32(0x25457b5d), SPH_C32(0x04fea8bf), - SPH_C32(0x9497a888) }, - { SPH_C32(0x79b60000), SPH_C32(0x7a930000), SPH_C32(0xea570013), - SPH_C32(0xe8931000), SPH_C32(0x75aa619a), SPH_C32(0x5771f0ea), - SPH_C32(0x9fdcf454), SPH_C32(0xc459367d), SPH_C32(0x50ce0000), - SPH_C32(0x2c410000), SPH_C32(0x9e7f0029), SPH_C32(0xeba9b000), - SPH_C32(0x41917508), SPH_C32(0x4543c91e), SPH_C32(0xdfae9123), - SPH_C32(0x1ecf4e2c) }, - { SPH_C32(0x0c2f0000), SPH_C32(0x69330000), SPH_C32(0xf9fc0006), - SPH_C32(0x828b0000), SPH_C32(0xd28f6b5d), SPH_C32(0x3d46d5e7), - SPH_C32(0x001826bc), SPH_C32(0x48c3a5ad), SPH_C32(0x218c0000), - SPH_C32(0x62810000), SPH_C32(0xc8030036), SPH_C32(0x056b0000), - SPH_C32(0xac496112), SPH_C32(0x2437eebd), SPH_C32(0x5fbc3e08), - SPH_C32(0xa5c8987f) }, - { SPH_C32(0x9e790000), SPH_C32(0x77e90000), SPH_C32(0x13ad0006), - SPH_C32(0x6a3a3000), SPH_C32(0x7bba3df8), SPH_C32(0xd6bdb47e), - SPH_C32(0xb14404e8), SPH_C32(0x7b0681e2), SPH_C32(0xadb60000), - SPH_C32(0xb8190000), SPH_C32(0xa87c0036), SPH_C32(0x516c8800), - SPH_C32(0x29382401), SPH_C32(0x44315cfe), SPH_C32(0x84ec0794), - SPH_C32(0x2f907edb) }, - { SPH_C32(0x546c0000), SPH_C32(0xe94d0000), SPH_C32(0x81cf0007), - SPH_C32(0x44e03800), SPH_C32(0x35b83781), SPH_C32(0x44ebea3a), - SPH_C32(0xac6bd8d3), SPH_C32(0x7287dc1c), SPH_C32(0x3cd60000), - SPH_C32(0x49f30000), SPH_C32(0x808e0036), SPH_C32(0xaa0a1800), - SPH_C32(0x89824fd7), SPH_C32(0xec4e516d), SPH_C32(0xde1e3a21), - SPH_C32(0xbbbdaed9) }, - { SPH_C32(0xc63a0000), SPH_C32(0xf7970000), SPH_C32(0x6b9e0007), - SPH_C32(0xac510800), SPH_C32(0x9c8d6124), SPH_C32(0xaf108ba3), - SPH_C32(0x1d37fa87), SPH_C32(0x4142f853), SPH_C32(0xb0ec0000), - SPH_C32(0x936b0000), SPH_C32(0xe0f10036), SPH_C32(0xfe0d9000), - SPH_C32(0x0cf30ac4), SPH_C32(0x8c48e32e), SPH_C32(0x054e03bd), - SPH_C32(0x31e5487d) }, - { SPH_C32(0x11750000), SPH_C32(0x42410000), SPH_C32(0xb1710006), - SPH_C32(0x2dea1800), SPH_C32(0xf7444598), SPH_C32(0xf53f6a37), - SPH_C32(0x81ba2295), SPH_C32(0x56b6930b), SPH_C32(0x64950000), - SPH_C32(0xc98d0000), SPH_C32(0xf8bd0037), SPH_C32(0x6c612000), - SPH_C32(0x6eb5130b), SPH_C32(0x95e36eb0), SPH_C32(0x726dc44e), - SPH_C32(0x81f9d768) }, - { SPH_C32(0x83230000), SPH_C32(0x5c9b0000), SPH_C32(0x5b200006), - SPH_C32(0xc55b2800), SPH_C32(0x5e71133d), SPH_C32(0x1ec40bae), - SPH_C32(0x30e600c1), SPH_C32(0x6573b744), SPH_C32(0xe8af0000), - SPH_C32(0x13150000), SPH_C32(0x98c20037), SPH_C32(0x3866a800), - SPH_C32(0xebc45618), SPH_C32(0xf5e5dcf3), SPH_C32(0xa93dfdd2), - SPH_C32(0x0ba131cc) }, - { SPH_C32(0x49360000), SPH_C32(0xc23f0000), SPH_C32(0xc9420007), - SPH_C32(0xeb812000), SPH_C32(0x10731944), SPH_C32(0x8c9255ea), - SPH_C32(0x2dc9dcfa), SPH_C32(0x6cf2eaba), SPH_C32(0x79cf0000), - SPH_C32(0xe2ff0000), SPH_C32(0xb0300037), SPH_C32(0xc3003800), - SPH_C32(0x4b7e3dce), SPH_C32(0x5d9ad160), SPH_C32(0xf3cfc067), - SPH_C32(0x9f8ce1ce) }, - { SPH_C32(0xdb600000), SPH_C32(0xdce50000), SPH_C32(0x23130007), - SPH_C32(0x03301000), SPH_C32(0xb9464fe1), SPH_C32(0x67693473), - SPH_C32(0x9c95feae), SPH_C32(0x5f37cef5), SPH_C32(0xf5f50000), - SPH_C32(0x38670000), SPH_C32(0xd04f0037), SPH_C32(0x9707b000), - SPH_C32(0xce0f78dd), SPH_C32(0x3d9c6323), SPH_C32(0x289ff9fb), - SPH_C32(0x15d4076a) }, - { SPH_C32(0xa9140000), SPH_C32(0x7d150000), SPH_C32(0xb7cc0018), - SPH_C32(0xfe250000), SPH_C32(0x5d116688), SPH_C32(0x45997fda), - SPH_C32(0xf7294e64), SPH_C32(0x43d8eceb), SPH_C32(0x26610000), - SPH_C32(0xd0d10000), SPH_C32(0x4f77003c), SPH_C32(0x92660000), - SPH_C32(0xef3b42bc), SPH_C32(0x6cf08019), SPH_C32(0xabc45c2a), - SPH_C32(0x35bd29b1) }, - { SPH_C32(0x3b420000), SPH_C32(0x63cf0000), SPH_C32(0x5d9d0018), - SPH_C32(0x16943000), SPH_C32(0xf424302d), SPH_C32(0xae621e43), - SPH_C32(0x46756c30), SPH_C32(0x701dc8a4), SPH_C32(0xaa5b0000), - SPH_C32(0x0a490000), SPH_C32(0x2f08003c), SPH_C32(0xc6618800), - SPH_C32(0x6a4a07af), SPH_C32(0x0cf6325a), SPH_C32(0x709465b6), - SPH_C32(0xbfe5cf15) }, - { SPH_C32(0xf1570000), SPH_C32(0xfd6b0000), SPH_C32(0xcfff0019), - SPH_C32(0x384e3800), SPH_C32(0xba263a54), SPH_C32(0x3c344007), - SPH_C32(0x5b5ab00b), SPH_C32(0x799c955a), SPH_C32(0x3b3b0000), - SPH_C32(0xfba30000), SPH_C32(0x07fa003c), SPH_C32(0x3d071800), - SPH_C32(0xcaf06c79), SPH_C32(0xa4893fc9), SPH_C32(0x2a665803), - SPH_C32(0x2bc81f17) }, - { SPH_C32(0x63010000), SPH_C32(0xe3b10000), SPH_C32(0x25ae0019), - SPH_C32(0xd0ff0800), SPH_C32(0x13136cf1), SPH_C32(0xd7cf219e), - SPH_C32(0xea06925f), SPH_C32(0x4a59b115), SPH_C32(0xb7010000), - SPH_C32(0x213b0000), SPH_C32(0x6785003c), SPH_C32(0x69009000), - SPH_C32(0x4f81296a), SPH_C32(0xc48f8d8a), SPH_C32(0xf136619f), - SPH_C32(0xa190f9b3) }, - { SPH_C32(0xb44e0000), SPH_C32(0x56670000), SPH_C32(0xff410018), - SPH_C32(0x51441800), SPH_C32(0x78da484d), SPH_C32(0x8de0c00a), - SPH_C32(0x768b4a4d), SPH_C32(0x5dadda4d), SPH_C32(0x63780000), - SPH_C32(0x7bdd0000), SPH_C32(0x7fc9003d), SPH_C32(0xfb6c2000), - SPH_C32(0x2dc730a5), SPH_C32(0xdd240014), SPH_C32(0x8615a66c), - SPH_C32(0x118c66a6) }, - { SPH_C32(0x26180000), SPH_C32(0x48bd0000), SPH_C32(0x15100018), - SPH_C32(0xb9f52800), SPH_C32(0xd1ef1ee8), SPH_C32(0x661ba193), - SPH_C32(0xc7d76819), SPH_C32(0x6e68fe02), SPH_C32(0xef420000), - SPH_C32(0xa1450000), SPH_C32(0x1fb6003d), SPH_C32(0xaf6ba800), - SPH_C32(0xa8b675b6), SPH_C32(0xbd22b257), SPH_C32(0x5d459ff0), - SPH_C32(0x9bd48002) }, - { SPH_C32(0xec0d0000), SPH_C32(0xd6190000), SPH_C32(0x87720019), - SPH_C32(0x972f2000), SPH_C32(0x9fed1491), SPH_C32(0xf44dffd7), - SPH_C32(0xdaf8b422), SPH_C32(0x67e9a3fc), SPH_C32(0x7e220000), - SPH_C32(0x50af0000), SPH_C32(0x3744003d), SPH_C32(0x540d3800), - SPH_C32(0x080c1e60), SPH_C32(0x155dbfc4), SPH_C32(0x07b7a245), - SPH_C32(0x0ff95000) }, - { SPH_C32(0x7e5b0000), SPH_C32(0xc8c30000), SPH_C32(0x6d230019), - SPH_C32(0x7f9e1000), SPH_C32(0x36d84234), SPH_C32(0x1fb69e4e), - SPH_C32(0x6ba49676), SPH_C32(0x542c87b3), SPH_C32(0xf2180000), - SPH_C32(0x8a370000), SPH_C32(0x573b003d), SPH_C32(0x000ab000), - SPH_C32(0x8d7d5b73), SPH_C32(0x755b0d87), SPH_C32(0xdce79bd9), - SPH_C32(0x85a1b6a4) }, - { SPH_C32(0x835a0000), SPH_C32(0xc4f70000), SPH_C32(0x01470022), - SPH_C32(0xeec80000), SPH_C32(0x60a54f69), SPH_C32(0x142f2a24), - SPH_C32(0x5cf534f2), SPH_C32(0x3ea660f7), SPH_C32(0x88980000), - SPH_C32(0x1f940000), SPH_C32(0x7fcf002e), SPH_C32(0xfb4e0000), - SPH_C32(0xf158079a), SPH_C32(0x61ae9167), SPH_C32(0xa895706c), - SPH_C32(0xe6107494) }, - { SPH_C32(0x110c0000), SPH_C32(0xda2d0000), SPH_C32(0xeb160022), - SPH_C32(0x06793000), SPH_C32(0xc99019cc), SPH_C32(0xffd44bbd), - SPH_C32(0xeda916a6), SPH_C32(0x0d6344b8), SPH_C32(0x04a20000), - SPH_C32(0xc50c0000), SPH_C32(0x1fb0002e), SPH_C32(0xaf498800), - SPH_C32(0x74294289), SPH_C32(0x01a82324), SPH_C32(0x73c549f0), - SPH_C32(0x6c489230) }, - { SPH_C32(0xdb190000), SPH_C32(0x44890000), SPH_C32(0x79740023), - SPH_C32(0x28a33800), SPH_C32(0x879213b5), SPH_C32(0x6d8215f9), - SPH_C32(0xf086ca9d), SPH_C32(0x04e21946), SPH_C32(0x95c20000), - SPH_C32(0x34e60000), SPH_C32(0x3742002e), SPH_C32(0x542f1800), - SPH_C32(0xd493295f), SPH_C32(0xa9d72eb7), SPH_C32(0x29377445), - SPH_C32(0xf8654232) }, - { SPH_C32(0x494f0000), SPH_C32(0x5a530000), SPH_C32(0x93250023), - SPH_C32(0xc0120800), SPH_C32(0x2ea74510), SPH_C32(0x86797460), - SPH_C32(0x41dae8c9), SPH_C32(0x37273d09), SPH_C32(0x19f80000), - SPH_C32(0xee7e0000), SPH_C32(0x573d002e), SPH_C32(0x00289000), - SPH_C32(0x51e26c4c), SPH_C32(0xc9d19cf4), SPH_C32(0xf2674dd9), - SPH_C32(0x723da496) }, - { SPH_C32(0x9e000000), SPH_C32(0xef850000), SPH_C32(0x49ca0022), - SPH_C32(0x41a91800), SPH_C32(0x456e61ac), SPH_C32(0xdc5695f4), - SPH_C32(0xdd5730db), SPH_C32(0x20d35651), SPH_C32(0xcd810000), - SPH_C32(0xb4980000), SPH_C32(0x4f71002f), SPH_C32(0x92442000), - SPH_C32(0x33a47583), SPH_C32(0xd07a116a), SPH_C32(0x85448a2a), - SPH_C32(0xc2213b83) }, - { SPH_C32(0x0c560000), SPH_C32(0xf15f0000), SPH_C32(0xa39b0022), - SPH_C32(0xa9182800), SPH_C32(0xec5b3709), SPH_C32(0x37adf46d), - SPH_C32(0x6c0b128f), SPH_C32(0x1316721e), SPH_C32(0x41bb0000), - SPH_C32(0x6e000000), SPH_C32(0x2f0e002f), SPH_C32(0xc643a800), - SPH_C32(0xb6d53090), SPH_C32(0xb07ca329), SPH_C32(0x5e14b3b6), - SPH_C32(0x4879dd27) }, - { SPH_C32(0xc6430000), SPH_C32(0x6ffb0000), SPH_C32(0x31f90023), - SPH_C32(0x87c22000), SPH_C32(0xa2593d70), SPH_C32(0xa5fbaa29), - SPH_C32(0x7124ceb4), SPH_C32(0x1a972fe0), SPH_C32(0xd0db0000), - SPH_C32(0x9fea0000), SPH_C32(0x07fc002f), SPH_C32(0x3d253800), - SPH_C32(0x166f5b46), SPH_C32(0x1803aeba), SPH_C32(0x04e68e03), - SPH_C32(0xdc540d25) }, - { SPH_C32(0x54150000), SPH_C32(0x71210000), SPH_C32(0xdba80023), - SPH_C32(0x6f731000), SPH_C32(0x0b6c6bd5), SPH_C32(0x4e00cbb0), - SPH_C32(0xc078ece0), SPH_C32(0x29520baf), SPH_C32(0x5ce10000), - SPH_C32(0x45720000), SPH_C32(0x6783002f), SPH_C32(0x6922b000), - SPH_C32(0x931e1e55), SPH_C32(0x78051cf9), SPH_C32(0xdfb6b79f), - SPH_C32(0x560ceb81) }, - { SPH_C32(0x26610000), SPH_C32(0xd0d10000), SPH_C32(0x4f77003c), - SPH_C32(0x92660000), SPH_C32(0xef3b42bc), SPH_C32(0x6cf08019), - SPH_C32(0xabc45c2a), SPH_C32(0x35bd29b1), SPH_C32(0x8f750000), - SPH_C32(0xadc40000), SPH_C32(0xf8bb0024), SPH_C32(0x6c430000), - SPH_C32(0xb22a2434), SPH_C32(0x2969ffc3), SPH_C32(0x5ced124e), - SPH_C32(0x7665c55a) }, - { SPH_C32(0xb4370000), SPH_C32(0xce0b0000), SPH_C32(0xa526003c), - SPH_C32(0x7ad73000), SPH_C32(0x460e1419), SPH_C32(0x870be180), - SPH_C32(0x1a987e7e), SPH_C32(0x06780dfe), SPH_C32(0x034f0000), - SPH_C32(0x775c0000), SPH_C32(0x98c40024), SPH_C32(0x38448800), - SPH_C32(0x375b6127), SPH_C32(0x496f4d80), SPH_C32(0x87bd2bd2), - SPH_C32(0xfc3d23fe) }, - { SPH_C32(0x7e220000), SPH_C32(0x50af0000), SPH_C32(0x3744003d), - SPH_C32(0x540d3800), SPH_C32(0x080c1e60), SPH_C32(0x155dbfc4), - SPH_C32(0x07b7a245), SPH_C32(0x0ff95000), SPH_C32(0x922f0000), - SPH_C32(0x86b60000), SPH_C32(0xb0360024), SPH_C32(0xc3221800), - SPH_C32(0x97e10af1), SPH_C32(0xe1104013), SPH_C32(0xdd4f1667), - SPH_C32(0x6810f3fc) }, - { SPH_C32(0xec740000), SPH_C32(0x4e750000), SPH_C32(0xdd15003d), - SPH_C32(0xbcbc0800), SPH_C32(0xa13948c5), SPH_C32(0xfea6de5d), - SPH_C32(0xb6eb8011), SPH_C32(0x3c3c744f), SPH_C32(0x1e150000), - SPH_C32(0x5c2e0000), SPH_C32(0xd0490024), SPH_C32(0x97259000), - SPH_C32(0x12904fe2), SPH_C32(0x8116f250), SPH_C32(0x061f2ffb), - SPH_C32(0xe2481558) }, - { SPH_C32(0x3b3b0000), SPH_C32(0xfba30000), SPH_C32(0x07fa003c), - SPH_C32(0x3d071800), SPH_C32(0xcaf06c79), SPH_C32(0xa4893fc9), - SPH_C32(0x2a665803), SPH_C32(0x2bc81f17), SPH_C32(0xca6c0000), - SPH_C32(0x06c80000), SPH_C32(0xc8050025), SPH_C32(0x05492000), - SPH_C32(0x70d6562d), SPH_C32(0x98bd7fce), SPH_C32(0x713ce808), - SPH_C32(0x52548a4d) }, - { SPH_C32(0xa96d0000), SPH_C32(0xe5790000), SPH_C32(0xedab003c), - SPH_C32(0xd5b62800), SPH_C32(0x63c53adc), SPH_C32(0x4f725e50), - SPH_C32(0x9b3a7a57), SPH_C32(0x180d3b58), SPH_C32(0x46560000), - SPH_C32(0xdc500000), SPH_C32(0xa87a0025), SPH_C32(0x514ea800), - SPH_C32(0xf5a7133e), SPH_C32(0xf8bbcd8d), SPH_C32(0xaa6cd194), - SPH_C32(0xd80c6ce9) }, - { SPH_C32(0x63780000), SPH_C32(0x7bdd0000), SPH_C32(0x7fc9003d), - SPH_C32(0xfb6c2000), SPH_C32(0x2dc730a5), SPH_C32(0xdd240014), - SPH_C32(0x8615a66c), SPH_C32(0x118c66a6), SPH_C32(0xd7360000), - SPH_C32(0x2dba0000), SPH_C32(0x80880025), SPH_C32(0xaa283800), - SPH_C32(0x551d78e8), SPH_C32(0x50c4c01e), SPH_C32(0xf09eec21), - SPH_C32(0x4c21bceb) }, - { SPH_C32(0xf12e0000), SPH_C32(0x65070000), SPH_C32(0x9598003d), - SPH_C32(0x13dd1000), SPH_C32(0x84f26600), SPH_C32(0x36df618d), - SPH_C32(0x37498438), SPH_C32(0x224942e9), SPH_C32(0x5b0c0000), - SPH_C32(0xf7220000), SPH_C32(0xe0f70025), SPH_C32(0xfe2fb000), - SPH_C32(0xd06c3dfb), SPH_C32(0x30c2725d), SPH_C32(0x2bced5bd), - SPH_C32(0xc6795a4f) }, - { SPH_C32(0x84b70000), SPH_C32(0x76a70000), SPH_C32(0x86330028), - SPH_C32(0x79c50000), SPH_C32(0x23d76cc7), SPH_C32(0x5ce84480), - SPH_C32(0xa88d56d0), SPH_C32(0xaed3d139), SPH_C32(0x2a4e0000), - SPH_C32(0xb9e20000), SPH_C32(0xb68b003a), SPH_C32(0x10ed0000), - SPH_C32(0x3db429e1), SPH_C32(0x51b655fe), SPH_C32(0xabdc7a96), - SPH_C32(0x7d7e8c1c) }, - { SPH_C32(0x16e10000), SPH_C32(0x687d0000), SPH_C32(0x6c620028), - SPH_C32(0x91743000), SPH_C32(0x8ae23a62), SPH_C32(0xb7132519), - SPH_C32(0x19d17484), SPH_C32(0x9d16f576), SPH_C32(0xa6740000), - SPH_C32(0x637a0000), SPH_C32(0xd6f4003a), SPH_C32(0x44ea8800), - SPH_C32(0xb8c56cf2), SPH_C32(0x31b0e7bd), SPH_C32(0x708c430a), - SPH_C32(0xf7266ab8) }, - { SPH_C32(0xdcf40000), SPH_C32(0xf6d90000), SPH_C32(0xfe000029), - SPH_C32(0xbfae3800), SPH_C32(0xc4e0301b), SPH_C32(0x25457b5d), - SPH_C32(0x04fea8bf), SPH_C32(0x9497a888), SPH_C32(0x37140000), - SPH_C32(0x92900000), SPH_C32(0xfe06003a), SPH_C32(0xbf8c1800), - SPH_C32(0x187f0724), SPH_C32(0x99cfea2e), SPH_C32(0x2a7e7ebf), - SPH_C32(0x630bbaba) }, - { SPH_C32(0x4ea20000), SPH_C32(0xe8030000), SPH_C32(0x14510029), - SPH_C32(0x571f0800), SPH_C32(0x6dd566be), SPH_C32(0xcebe1ac4), - SPH_C32(0xb5a28aeb), SPH_C32(0xa7528cc7), SPH_C32(0xbb2e0000), - SPH_C32(0x48080000), SPH_C32(0x9e79003a), SPH_C32(0xeb8b9000), - SPH_C32(0x9d0e4237), SPH_C32(0xf9c9586d), SPH_C32(0xf12e4723), - SPH_C32(0xe9535c1e) }, - { SPH_C32(0x99ed0000), SPH_C32(0x5dd50000), SPH_C32(0xcebe0028), - SPH_C32(0xd6a41800), SPH_C32(0x061c4202), SPH_C32(0x9491fb50), - SPH_C32(0x292f52f9), SPH_C32(0xb0a6e79f), SPH_C32(0x6f570000), - SPH_C32(0x12ee0000), SPH_C32(0x8635003b), SPH_C32(0x79e72000), - SPH_C32(0xff485bf8), SPH_C32(0xe062d5f3), SPH_C32(0x860d80d0), - SPH_C32(0x594fc30b) }, - { SPH_C32(0x0bbb0000), SPH_C32(0x430f0000), SPH_C32(0x24ef0028), - SPH_C32(0x3e152800), SPH_C32(0xaf2914a7), SPH_C32(0x7f6a9ac9), - SPH_C32(0x987370ad), SPH_C32(0x8363c3d0), SPH_C32(0xe36d0000), - SPH_C32(0xc8760000), SPH_C32(0xe64a003b), SPH_C32(0x2de0a800), - SPH_C32(0x7a391eeb), SPH_C32(0x806467b0), SPH_C32(0x5d5db94c), - SPH_C32(0xd31725af) }, - { SPH_C32(0xc1ae0000), SPH_C32(0xddab0000), SPH_C32(0xb68d0029), - SPH_C32(0x10cf2000), SPH_C32(0xe12b1ede), SPH_C32(0xed3cc48d), - SPH_C32(0x855cac96), SPH_C32(0x8ae29e2e), SPH_C32(0x720d0000), - SPH_C32(0x399c0000), SPH_C32(0xceb8003b), SPH_C32(0xd6863800), - SPH_C32(0xda83753d), SPH_C32(0x281b6a23), SPH_C32(0x07af84f9), - SPH_C32(0x473af5ad) }, - { SPH_C32(0x53f80000), SPH_C32(0xc3710000), SPH_C32(0x5cdc0029), - SPH_C32(0xf87e1000), SPH_C32(0x481e487b), SPH_C32(0x06c7a514), - SPH_C32(0x34008ec2), SPH_C32(0xb927ba61), SPH_C32(0xfe370000), - SPH_C32(0xe3040000), SPH_C32(0xaec7003b), SPH_C32(0x8281b000), - SPH_C32(0x5ff2302e), SPH_C32(0x481dd860), SPH_C32(0xdcffbd65), - SPH_C32(0xcd621309) }, - { SPH_C32(0x218c0000), SPH_C32(0x62810000), SPH_C32(0xc8030036), - SPH_C32(0x056b0000), SPH_C32(0xac496112), SPH_C32(0x2437eebd), - SPH_C32(0x5fbc3e08), SPH_C32(0xa5c8987f), SPH_C32(0x2da30000), - SPH_C32(0x0bb20000), SPH_C32(0x31ff0030), SPH_C32(0x87e00000), - SPH_C32(0x7ec60a4f), SPH_C32(0x19713b5a), SPH_C32(0x5fa418b4), - SPH_C32(0xed0b3dd2) }, - { SPH_C32(0xb3da0000), SPH_C32(0x7c5b0000), SPH_C32(0x22520036), - SPH_C32(0xedda3000), SPH_C32(0x057c37b7), SPH_C32(0xcfcc8f24), - SPH_C32(0xeee01c5c), SPH_C32(0x960dbc30), SPH_C32(0xa1990000), - SPH_C32(0xd12a0000), SPH_C32(0x51800030), SPH_C32(0xd3e78800), - SPH_C32(0xfbb74f5c), SPH_C32(0x79778919), SPH_C32(0x84f42128), - SPH_C32(0x6753db76) }, - { SPH_C32(0x79cf0000), SPH_C32(0xe2ff0000), SPH_C32(0xb0300037), - SPH_C32(0xc3003800), SPH_C32(0x4b7e3dce), SPH_C32(0x5d9ad160), - SPH_C32(0xf3cfc067), SPH_C32(0x9f8ce1ce), SPH_C32(0x30f90000), - SPH_C32(0x20c00000), SPH_C32(0x79720030), SPH_C32(0x28811800), - SPH_C32(0x5b0d248a), SPH_C32(0xd108848a), SPH_C32(0xde061c9d), - SPH_C32(0xf37e0b74) }, - { SPH_C32(0xeb990000), SPH_C32(0xfc250000), SPH_C32(0x5a610037), - SPH_C32(0x2bb10800), SPH_C32(0xe24b6b6b), SPH_C32(0xb661b0f9), - SPH_C32(0x4293e233), SPH_C32(0xac49c581), SPH_C32(0xbcc30000), - SPH_C32(0xfa580000), SPH_C32(0x190d0030), SPH_C32(0x7c869000), - SPH_C32(0xde7c6199), SPH_C32(0xb10e36c9), SPH_C32(0x05562501), - SPH_C32(0x7926edd0) }, - { SPH_C32(0x3cd60000), SPH_C32(0x49f30000), SPH_C32(0x808e0036), - SPH_C32(0xaa0a1800), SPH_C32(0x89824fd7), SPH_C32(0xec4e516d), - SPH_C32(0xde1e3a21), SPH_C32(0xbbbdaed9), SPH_C32(0x68ba0000), - SPH_C32(0xa0be0000), SPH_C32(0x01410031), SPH_C32(0xeeea2000), - SPH_C32(0xbc3a7856), SPH_C32(0xa8a5bb57), SPH_C32(0x7275e2f2), - SPH_C32(0xc93a72c5) }, - { SPH_C32(0xae800000), SPH_C32(0x57290000), SPH_C32(0x6adf0036), - SPH_C32(0x42bb2800), SPH_C32(0x20b71972), SPH_C32(0x07b530f4), - SPH_C32(0x6f421875), SPH_C32(0x88788a96), SPH_C32(0xe4800000), - SPH_C32(0x7a260000), SPH_C32(0x613e0031), SPH_C32(0xbaeda800), - SPH_C32(0x394b3d45), SPH_C32(0xc8a30914), SPH_C32(0xa925db6e), - SPH_C32(0x43629461) }, - { SPH_C32(0x64950000), SPH_C32(0xc98d0000), SPH_C32(0xf8bd0037), - SPH_C32(0x6c612000), SPH_C32(0x6eb5130b), SPH_C32(0x95e36eb0), - SPH_C32(0x726dc44e), SPH_C32(0x81f9d768), SPH_C32(0x75e00000), - SPH_C32(0x8bcc0000), SPH_C32(0x49cc0031), SPH_C32(0x418b3800), - SPH_C32(0x99f15693), SPH_C32(0x60dc0487), SPH_C32(0xf3d7e6db), - SPH_C32(0xd74f4463) }, - { SPH_C32(0xf6c30000), SPH_C32(0xd7570000), SPH_C32(0x12ec0037), - SPH_C32(0x84d01000), SPH_C32(0xc78045ae), SPH_C32(0x7e180f29), - SPH_C32(0xc331e61a), SPH_C32(0xb23cf327), SPH_C32(0xf9da0000), - SPH_C32(0x51540000), SPH_C32(0x29b30031), SPH_C32(0x158cb000), - SPH_C32(0x1c801380), SPH_C32(0x00dab6c4), SPH_C32(0x2887df47), - SPH_C32(0x5d17a2c7) } -}; - -static const sph_u32 T512_49[128][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xe6280000), SPH_C32(0x4c4b0000), SPH_C32(0xa8550000), - SPH_C32(0xd3d002e0), SPH_C32(0xd86130b8), SPH_C32(0x98a7b0da), - SPH_C32(0x289506b4), SPH_C32(0xd75a4897), SPH_C32(0xf0c50000), - SPH_C32(0x59230000), SPH_C32(0x45820000), SPH_C32(0xe18d00c0), - SPH_C32(0x3b6d0631), SPH_C32(0xc2ed5699), SPH_C32(0xcbe0fe1c), - SPH_C32(0x56a7b19f) }, - { SPH_C32(0xf0c50000), SPH_C32(0x59230000), SPH_C32(0x45820000), - SPH_C32(0xe18d00c0), SPH_C32(0x3b6d0631), SPH_C32(0xc2ed5699), - SPH_C32(0xcbe0fe1c), SPH_C32(0x56a7b19f), SPH_C32(0x16ed0000), - SPH_C32(0x15680000), SPH_C32(0xedd70000), SPH_C32(0x325d0220), - SPH_C32(0xe30c3689), SPH_C32(0x5a4ae643), SPH_C32(0xe375f8a8), - SPH_C32(0x81fdf908) }, - { SPH_C32(0x16ed0000), SPH_C32(0x15680000), SPH_C32(0xedd70000), - SPH_C32(0x325d0220), SPH_C32(0xe30c3689), SPH_C32(0x5a4ae643), - SPH_C32(0xe375f8a8), SPH_C32(0x81fdf908), SPH_C32(0xe6280000), - SPH_C32(0x4c4b0000), SPH_C32(0xa8550000), SPH_C32(0xd3d002e0), - SPH_C32(0xd86130b8), SPH_C32(0x98a7b0da), SPH_C32(0x289506b4), - SPH_C32(0xd75a4897) }, - { SPH_C32(0xb4310000), SPH_C32(0x77330000), SPH_C32(0xb15d0000), - SPH_C32(0x7fd004e0), SPH_C32(0x78a26138), SPH_C32(0xd116c35d), - SPH_C32(0xd256d489), SPH_C32(0x4e6f74de), SPH_C32(0xe3060000), - SPH_C32(0xbdc10000), SPH_C32(0x87130000), SPH_C32(0xbff20060), - SPH_C32(0x2eba0a1a), SPH_C32(0x8db53751), SPH_C32(0x73c5ab06), - SPH_C32(0x5bd61539) }, - { SPH_C32(0x52190000), SPH_C32(0x3b780000), SPH_C32(0x19080000), - SPH_C32(0xac000600), SPH_C32(0xa0c35180), SPH_C32(0x49b17387), - SPH_C32(0xfac3d23d), SPH_C32(0x99353c49), SPH_C32(0x13c30000), - SPH_C32(0xe4e20000), SPH_C32(0xc2910000), SPH_C32(0x5e7f00a0), - SPH_C32(0x15d70c2b), SPH_C32(0x4f5861c8), SPH_C32(0xb825551a), - SPH_C32(0x0d71a4a6) }, - { SPH_C32(0x44f40000), SPH_C32(0x2e100000), SPH_C32(0xf4df0000), - SPH_C32(0x9e5d0420), SPH_C32(0x43cf6709), SPH_C32(0x13fb95c4), - SPH_C32(0x19b62a95), SPH_C32(0x18c8c541), SPH_C32(0xf5eb0000), - SPH_C32(0xa8a90000), SPH_C32(0x6ac40000), SPH_C32(0x8daf0240), - SPH_C32(0xcdb63c93), SPH_C32(0xd7ffd112), SPH_C32(0x90b053ae), - SPH_C32(0xda2bec31) }, - { SPH_C32(0xa2dc0000), SPH_C32(0x625b0000), SPH_C32(0x5c8a0000), - SPH_C32(0x4d8d06c0), SPH_C32(0x9bae57b1), SPH_C32(0x8b5c251e), - SPH_C32(0x31232c21), SPH_C32(0xcf928dd6), SPH_C32(0x052e0000), - SPH_C32(0xf18a0000), SPH_C32(0x2f460000), SPH_C32(0x6c220280), - SPH_C32(0xf6db3aa2), SPH_C32(0x1512878b), SPH_C32(0x5b50adb2), - SPH_C32(0x8c8c5dae) }, - { SPH_C32(0xe3060000), SPH_C32(0xbdc10000), SPH_C32(0x87130000), - SPH_C32(0xbff20060), SPH_C32(0x2eba0a1a), SPH_C32(0x8db53751), - SPH_C32(0x73c5ab06), SPH_C32(0x5bd61539), SPH_C32(0x57370000), - SPH_C32(0xcaf20000), SPH_C32(0x364e0000), SPH_C32(0xc0220480), - SPH_C32(0x56186b22), SPH_C32(0x5ca3f40c), SPH_C32(0xa1937f8f), - SPH_C32(0x15b961e7) }, - { SPH_C32(0x052e0000), SPH_C32(0xf18a0000), SPH_C32(0x2f460000), - SPH_C32(0x6c220280), SPH_C32(0xf6db3aa2), SPH_C32(0x1512878b), - SPH_C32(0x5b50adb2), SPH_C32(0x8c8c5dae), SPH_C32(0xa7f20000), - SPH_C32(0x93d10000), SPH_C32(0x73cc0000), SPH_C32(0x21af0440), - SPH_C32(0x6d756d13), SPH_C32(0x9e4ea295), SPH_C32(0x6a738193), - SPH_C32(0x431ed078) }, - { SPH_C32(0x13c30000), SPH_C32(0xe4e20000), SPH_C32(0xc2910000), - SPH_C32(0x5e7f00a0), SPH_C32(0x15d70c2b), SPH_C32(0x4f5861c8), - SPH_C32(0xb825551a), SPH_C32(0x0d71a4a6), SPH_C32(0x41da0000), - SPH_C32(0xdf9a0000), SPH_C32(0xdb990000), SPH_C32(0xf27f06a0), - SPH_C32(0xb5145dab), SPH_C32(0x06e9124f), SPH_C32(0x42e68727), - SPH_C32(0x944498ef) }, - { SPH_C32(0xf5eb0000), SPH_C32(0xa8a90000), SPH_C32(0x6ac40000), - SPH_C32(0x8daf0240), SPH_C32(0xcdb63c93), SPH_C32(0xd7ffd112), - SPH_C32(0x90b053ae), SPH_C32(0xda2bec31), SPH_C32(0xb11f0000), - SPH_C32(0x86b90000), SPH_C32(0x9e1b0000), SPH_C32(0x13f20660), - SPH_C32(0x8e795b9a), SPH_C32(0xc40444d6), SPH_C32(0x8906793b), - SPH_C32(0xc2e32970) }, - { SPH_C32(0x57370000), SPH_C32(0xcaf20000), SPH_C32(0x364e0000), - SPH_C32(0xc0220480), SPH_C32(0x56186b22), SPH_C32(0x5ca3f40c), - SPH_C32(0xa1937f8f), SPH_C32(0x15b961e7), SPH_C32(0xb4310000), - SPH_C32(0x77330000), SPH_C32(0xb15d0000), SPH_C32(0x7fd004e0), - SPH_C32(0x78a26138), SPH_C32(0xd116c35d), SPH_C32(0xd256d489), - SPH_C32(0x4e6f74de) }, - { SPH_C32(0xb11f0000), SPH_C32(0x86b90000), SPH_C32(0x9e1b0000), - SPH_C32(0x13f20660), SPH_C32(0x8e795b9a), SPH_C32(0xc40444d6), - SPH_C32(0x8906793b), SPH_C32(0xc2e32970), SPH_C32(0x44f40000), - SPH_C32(0x2e100000), SPH_C32(0xf4df0000), SPH_C32(0x9e5d0420), - SPH_C32(0x43cf6709), SPH_C32(0x13fb95c4), SPH_C32(0x19b62a95), - SPH_C32(0x18c8c541) }, - { SPH_C32(0xa7f20000), SPH_C32(0x93d10000), SPH_C32(0x73cc0000), - SPH_C32(0x21af0440), SPH_C32(0x6d756d13), SPH_C32(0x9e4ea295), - SPH_C32(0x6a738193), SPH_C32(0x431ed078), SPH_C32(0xa2dc0000), - SPH_C32(0x625b0000), SPH_C32(0x5c8a0000), SPH_C32(0x4d8d06c0), - SPH_C32(0x9bae57b1), SPH_C32(0x8b5c251e), SPH_C32(0x31232c21), - SPH_C32(0xcf928dd6) }, - { SPH_C32(0x41da0000), SPH_C32(0xdf9a0000), SPH_C32(0xdb990000), - SPH_C32(0xf27f06a0), SPH_C32(0xb5145dab), SPH_C32(0x06e9124f), - SPH_C32(0x42e68727), SPH_C32(0x944498ef), SPH_C32(0x52190000), - SPH_C32(0x3b780000), SPH_C32(0x19080000), SPH_C32(0xac000600), - SPH_C32(0xa0c35180), SPH_C32(0x49b17387), SPH_C32(0xfac3d23d), - SPH_C32(0x99353c49) }, - { SPH_C32(0x02f20000), SPH_C32(0xa2810000), SPH_C32(0x873f0000), - SPH_C32(0xe36c7800), SPH_C32(0x1e1d74ef), SPH_C32(0x073d2bd6), - SPH_C32(0xc4c23237), SPH_C32(0x7f32259e), SPH_C32(0xbadd0000), - SPH_C32(0x13ad0000), SPH_C32(0xb7e70000), SPH_C32(0xf7282800), - SPH_C32(0xdf45144d), SPH_C32(0x361ac33a), SPH_C32(0xea5a8d14), - SPH_C32(0x2a2c18f0) }, - { SPH_C32(0xe4da0000), SPH_C32(0xeeca0000), SPH_C32(0x2f6a0000), - SPH_C32(0x30bc7ae0), SPH_C32(0xc67c4457), SPH_C32(0x9f9a9b0c), - SPH_C32(0xec573483), SPH_C32(0xa8686d09), SPH_C32(0x4a180000), - SPH_C32(0x4a8e0000), SPH_C32(0xf2650000), SPH_C32(0x16a528c0), - SPH_C32(0xe428127c), SPH_C32(0xf4f795a3), SPH_C32(0x21ba7308), - SPH_C32(0x7c8ba96f) }, - { SPH_C32(0xf2370000), SPH_C32(0xfba20000), SPH_C32(0xc2bd0000), - SPH_C32(0x02e178c0), SPH_C32(0x257072de), SPH_C32(0xc5d07d4f), - SPH_C32(0x0f22cc2b), SPH_C32(0x29959401), SPH_C32(0xac300000), - SPH_C32(0x06c50000), SPH_C32(0x5a300000), SPH_C32(0xc5752a20), - SPH_C32(0x3c4922c4), SPH_C32(0x6c502579), SPH_C32(0x092f75bc), - SPH_C32(0xabd1e1f8) }, - { SPH_C32(0x141f0000), SPH_C32(0xb7e90000), SPH_C32(0x6ae80000), - SPH_C32(0xd1317a20), SPH_C32(0xfd114266), SPH_C32(0x5d77cd95), - SPH_C32(0x27b7ca9f), SPH_C32(0xfecfdc96), SPH_C32(0x5cf50000), - SPH_C32(0x5fe60000), SPH_C32(0x1fb20000), SPH_C32(0x24f82ae0), - SPH_C32(0x072424f5), SPH_C32(0xaebd73e0), SPH_C32(0xc2cf8ba0), - SPH_C32(0xfd765067) }, - { SPH_C32(0xb6c30000), SPH_C32(0xd5b20000), SPH_C32(0x36620000), - SPH_C32(0x9cbc7ce0), SPH_C32(0x66bf15d7), SPH_C32(0xd62be88b), - SPH_C32(0x1694e6be), SPH_C32(0x315d5140), SPH_C32(0x59db0000), - SPH_C32(0xae6c0000), SPH_C32(0x30f40000), SPH_C32(0x48da2860), - SPH_C32(0xf1ff1e57), SPH_C32(0xbbaff46b), SPH_C32(0x999f2612), - SPH_C32(0x71fa0dc9) }, - { SPH_C32(0x50eb0000), SPH_C32(0x99f90000), SPH_C32(0x9e370000), - SPH_C32(0x4f6c7e00), SPH_C32(0xbede256f), SPH_C32(0x4e8c5851), - SPH_C32(0x3e01e00a), SPH_C32(0xe60719d7), SPH_C32(0xa91e0000), - SPH_C32(0xf74f0000), SPH_C32(0x75760000), SPH_C32(0xa95728a0), - SPH_C32(0xca921866), SPH_C32(0x7942a2f2), SPH_C32(0x527fd80e), - SPH_C32(0x275dbc56) }, - { SPH_C32(0x46060000), SPH_C32(0x8c910000), SPH_C32(0x73e00000), - SPH_C32(0x7d317c20), SPH_C32(0x5dd213e6), SPH_C32(0x14c6be12), - SPH_C32(0xdd7418a2), SPH_C32(0x67fae0df), SPH_C32(0x4f360000), - SPH_C32(0xbb040000), SPH_C32(0xdd230000), SPH_C32(0x7a872a40), - SPH_C32(0x12f328de), SPH_C32(0xe1e51228), SPH_C32(0x7aeadeba), - SPH_C32(0xf007f4c1) }, - { SPH_C32(0xa02e0000), SPH_C32(0xc0da0000), SPH_C32(0xdbb50000), - SPH_C32(0xaee17ec0), SPH_C32(0x85b3235e), SPH_C32(0x8c610ec8), - SPH_C32(0xf5e11e16), SPH_C32(0xb0a0a848), SPH_C32(0xbff30000), - SPH_C32(0xe2270000), SPH_C32(0x98a10000), SPH_C32(0x9b0a2a80), - SPH_C32(0x299e2eef), SPH_C32(0x230844b1), SPH_C32(0xb10a20a6), - SPH_C32(0xa6a0455e) }, - { SPH_C32(0xe1f40000), SPH_C32(0x1f400000), SPH_C32(0x002c0000), - SPH_C32(0x5c9e7860), SPH_C32(0x30a77ef5), SPH_C32(0x8a881c87), - SPH_C32(0xb7079931), SPH_C32(0x24e430a7), SPH_C32(0xedea0000), - SPH_C32(0xd95f0000), SPH_C32(0x81a90000), SPH_C32(0x370a2c80), - SPH_C32(0x895d7f6f), SPH_C32(0x6ab93736), SPH_C32(0x4bc9f29b), - SPH_C32(0x3f957917) }, - { SPH_C32(0x07dc0000), SPH_C32(0x530b0000), SPH_C32(0xa8790000), - SPH_C32(0x8f4e7a80), SPH_C32(0xe8c64e4d), SPH_C32(0x122fac5d), - SPH_C32(0x9f929f85), SPH_C32(0xf3be7830), SPH_C32(0x1d2f0000), - SPH_C32(0x807c0000), SPH_C32(0xc42b0000), SPH_C32(0xd6872c40), - SPH_C32(0xb230795e), SPH_C32(0xa85461af), SPH_C32(0x80290c87), - SPH_C32(0x6932c888) }, - { SPH_C32(0x11310000), SPH_C32(0x46630000), SPH_C32(0x45ae0000), - SPH_C32(0xbd1378a0), SPH_C32(0x0bca78c4), SPH_C32(0x48654a1e), - SPH_C32(0x7ce7672d), SPH_C32(0x72438138), SPH_C32(0xfb070000), - SPH_C32(0xcc370000), SPH_C32(0x6c7e0000), SPH_C32(0x05572ea0), - SPH_C32(0x6a5149e6), SPH_C32(0x30f3d175), SPH_C32(0xa8bc0a33), - SPH_C32(0xbe68801f) }, - { SPH_C32(0xf7190000), SPH_C32(0x0a280000), SPH_C32(0xedfb0000), - SPH_C32(0x6ec37a40), SPH_C32(0xd3ab487c), SPH_C32(0xd0c2fac4), - SPH_C32(0x54726199), SPH_C32(0xa519c9af), SPH_C32(0x0bc20000), - SPH_C32(0x95140000), SPH_C32(0x29fc0000), SPH_C32(0xe4da2e60), - SPH_C32(0x513c4fd7), SPH_C32(0xf21e87ec), SPH_C32(0x635cf42f), - SPH_C32(0xe8cf3180) }, - { SPH_C32(0x55c50000), SPH_C32(0x68730000), SPH_C32(0xb1710000), - SPH_C32(0x234e7c80), SPH_C32(0x48051fcd), SPH_C32(0x5b9edfda), - SPH_C32(0x65514db8), SPH_C32(0x6a8b4479), SPH_C32(0x0eec0000), - SPH_C32(0x649e0000), SPH_C32(0x06ba0000), SPH_C32(0x88f82ce0), - SPH_C32(0xa7e77575), SPH_C32(0xe70c0067), SPH_C32(0x380c599d), - SPH_C32(0x64436c2e) }, - { SPH_C32(0xb3ed0000), SPH_C32(0x24380000), SPH_C32(0x19240000), - SPH_C32(0xf09e7e60), SPH_C32(0x90642f75), SPH_C32(0xc3396f00), - SPH_C32(0x4dc44b0c), SPH_C32(0xbdd10cee), SPH_C32(0xfe290000), - SPH_C32(0x3dbd0000), SPH_C32(0x43380000), SPH_C32(0x69752c20), - SPH_C32(0x9c8a7344), SPH_C32(0x25e156fe), SPH_C32(0xf3eca781), - SPH_C32(0x32e4ddb1) }, - { SPH_C32(0xa5000000), SPH_C32(0x31500000), SPH_C32(0xf4f30000), - SPH_C32(0xc2c37c40), SPH_C32(0x736819fc), SPH_C32(0x99738943), - SPH_C32(0xaeb1b3a4), SPH_C32(0x3c2cf5e6), SPH_C32(0x18010000), - SPH_C32(0x71f60000), SPH_C32(0xeb6d0000), SPH_C32(0xbaa52ec0), - SPH_C32(0x44eb43fc), SPH_C32(0xbd46e624), SPH_C32(0xdb79a135), - SPH_C32(0xe5be9526) }, - { SPH_C32(0x43280000), SPH_C32(0x7d1b0000), SPH_C32(0x5ca60000), - SPH_C32(0x11137ea0), SPH_C32(0xab092944), SPH_C32(0x01d43999), - SPH_C32(0x8624b510), SPH_C32(0xeb76bd71), SPH_C32(0xe8c40000), - SPH_C32(0x28d50000), SPH_C32(0xaeef0000), SPH_C32(0x5b282e00), - SPH_C32(0x7f8645cd), SPH_C32(0x7fabb0bd), SPH_C32(0x10995f29), - SPH_C32(0xb31924b9) }, - { SPH_C32(0xbadd0000), SPH_C32(0x13ad0000), SPH_C32(0xb7e70000), - SPH_C32(0xf7282800), SPH_C32(0xdf45144d), SPH_C32(0x361ac33a), - SPH_C32(0xea5a8d14), SPH_C32(0x2a2c18f0), SPH_C32(0xb82f0000), - SPH_C32(0xb12c0000), SPH_C32(0x30d80000), SPH_C32(0x14445000), - SPH_C32(0xc15860a2), SPH_C32(0x3127e8ec), SPH_C32(0x2e98bf23), - SPH_C32(0x551e3d6e) }, - { SPH_C32(0x5cf50000), SPH_C32(0x5fe60000), SPH_C32(0x1fb20000), - SPH_C32(0x24f82ae0), SPH_C32(0x072424f5), SPH_C32(0xaebd73e0), - SPH_C32(0xc2cf8ba0), SPH_C32(0xfd765067), SPH_C32(0x48ea0000), - SPH_C32(0xe80f0000), SPH_C32(0x755a0000), SPH_C32(0xf5c950c0), - SPH_C32(0xfa356693), SPH_C32(0xf3cabe75), SPH_C32(0xe578413f), - SPH_C32(0x03b98cf1) }, - { SPH_C32(0x4a180000), SPH_C32(0x4a8e0000), SPH_C32(0xf2650000), - SPH_C32(0x16a528c0), SPH_C32(0xe428127c), SPH_C32(0xf4f795a3), - SPH_C32(0x21ba7308), SPH_C32(0x7c8ba96f), SPH_C32(0xaec20000), - SPH_C32(0xa4440000), SPH_C32(0xdd0f0000), SPH_C32(0x26195220), - SPH_C32(0x2254562b), SPH_C32(0x6b6d0eaf), SPH_C32(0xcded478b), - SPH_C32(0xd4e3c466) }, - { SPH_C32(0xac300000), SPH_C32(0x06c50000), SPH_C32(0x5a300000), - SPH_C32(0xc5752a20), SPH_C32(0x3c4922c4), SPH_C32(0x6c502579), - SPH_C32(0x092f75bc), SPH_C32(0xabd1e1f8), SPH_C32(0x5e070000), - SPH_C32(0xfd670000), SPH_C32(0x988d0000), SPH_C32(0xc79452e0), - SPH_C32(0x1939501a), SPH_C32(0xa9805836), SPH_C32(0x060db997), - SPH_C32(0x824475f9) }, - { SPH_C32(0x0eec0000), SPH_C32(0x649e0000), SPH_C32(0x06ba0000), - SPH_C32(0x88f82ce0), SPH_C32(0xa7e77575), SPH_C32(0xe70c0067), - SPH_C32(0x380c599d), SPH_C32(0x64436c2e), SPH_C32(0x5b290000), - SPH_C32(0x0ced0000), SPH_C32(0xb7cb0000), SPH_C32(0xabb65060), - SPH_C32(0xefe26ab8), SPH_C32(0xbc92dfbd), SPH_C32(0x5d5d1425), - SPH_C32(0x0ec82857) }, - { SPH_C32(0xe8c40000), SPH_C32(0x28d50000), SPH_C32(0xaeef0000), - SPH_C32(0x5b282e00), SPH_C32(0x7f8645cd), SPH_C32(0x7fabb0bd), - SPH_C32(0x10995f29), SPH_C32(0xb31924b9), SPH_C32(0xabec0000), - SPH_C32(0x55ce0000), SPH_C32(0xf2490000), SPH_C32(0x4a3b50a0), - SPH_C32(0xd48f6c89), SPH_C32(0x7e7f8924), SPH_C32(0x96bdea39), - SPH_C32(0x586f99c8) }, - { SPH_C32(0xfe290000), SPH_C32(0x3dbd0000), SPH_C32(0x43380000), - SPH_C32(0x69752c20), SPH_C32(0x9c8a7344), SPH_C32(0x25e156fe), - SPH_C32(0xf3eca781), SPH_C32(0x32e4ddb1), SPH_C32(0x4dc40000), - SPH_C32(0x19850000), SPH_C32(0x5a1c0000), SPH_C32(0x99eb5240), - SPH_C32(0x0cee5c31), SPH_C32(0xe6d839fe), SPH_C32(0xbe28ec8d), - SPH_C32(0x8f35d15f) }, - { SPH_C32(0x18010000), SPH_C32(0x71f60000), SPH_C32(0xeb6d0000), - SPH_C32(0xbaa52ec0), SPH_C32(0x44eb43fc), SPH_C32(0xbd46e624), - SPH_C32(0xdb79a135), SPH_C32(0xe5be9526), SPH_C32(0xbd010000), - SPH_C32(0x40a60000), SPH_C32(0x1f9e0000), SPH_C32(0x78665280), - SPH_C32(0x37835a00), SPH_C32(0x24356f67), SPH_C32(0x75c81291), - SPH_C32(0xd99260c0) }, - { SPH_C32(0x59db0000), SPH_C32(0xae6c0000), SPH_C32(0x30f40000), - SPH_C32(0x48da2860), SPH_C32(0xf1ff1e57), SPH_C32(0xbbaff46b), - SPH_C32(0x999f2612), SPH_C32(0x71fa0dc9), SPH_C32(0xef180000), - SPH_C32(0x7bde0000), SPH_C32(0x06960000), SPH_C32(0xd4665480), - SPH_C32(0x97400b80), SPH_C32(0x6d841ce0), SPH_C32(0x8f0bc0ac), - SPH_C32(0x40a75c89) }, - { SPH_C32(0xbff30000), SPH_C32(0xe2270000), SPH_C32(0x98a10000), - SPH_C32(0x9b0a2a80), SPH_C32(0x299e2eef), SPH_C32(0x230844b1), - SPH_C32(0xb10a20a6), SPH_C32(0xa6a0455e), SPH_C32(0x1fdd0000), - SPH_C32(0x22fd0000), SPH_C32(0x43140000), SPH_C32(0x35eb5440), - SPH_C32(0xac2d0db1), SPH_C32(0xaf694a79), SPH_C32(0x44eb3eb0), - SPH_C32(0x1600ed16) }, - { SPH_C32(0xa91e0000), SPH_C32(0xf74f0000), SPH_C32(0x75760000), - SPH_C32(0xa95728a0), SPH_C32(0xca921866), SPH_C32(0x7942a2f2), - SPH_C32(0x527fd80e), SPH_C32(0x275dbc56), SPH_C32(0xf9f50000), - SPH_C32(0x6eb60000), SPH_C32(0xeb410000), SPH_C32(0xe63b56a0), - SPH_C32(0x744c3d09), SPH_C32(0x37cefaa3), SPH_C32(0x6c7e3804), - SPH_C32(0xc15aa581) }, - { SPH_C32(0x4f360000), SPH_C32(0xbb040000), SPH_C32(0xdd230000), - SPH_C32(0x7a872a40), SPH_C32(0x12f328de), SPH_C32(0xe1e51228), - SPH_C32(0x7aeadeba), SPH_C32(0xf007f4c1), SPH_C32(0x09300000), - SPH_C32(0x37950000), SPH_C32(0xaec30000), SPH_C32(0x07b65660), - SPH_C32(0x4f213b38), SPH_C32(0xf523ac3a), SPH_C32(0xa79ec618), - SPH_C32(0x97fd141e) }, - { SPH_C32(0xedea0000), SPH_C32(0xd95f0000), SPH_C32(0x81a90000), - SPH_C32(0x370a2c80), SPH_C32(0x895d7f6f), SPH_C32(0x6ab93736), - SPH_C32(0x4bc9f29b), SPH_C32(0x3f957917), SPH_C32(0x0c1e0000), - SPH_C32(0xc61f0000), SPH_C32(0x81850000), SPH_C32(0x6b9454e0), - SPH_C32(0xb9fa019a), SPH_C32(0xe0312bb1), SPH_C32(0xfcce6baa), - SPH_C32(0x1b7149b0) }, - { SPH_C32(0x0bc20000), SPH_C32(0x95140000), SPH_C32(0x29fc0000), - SPH_C32(0xe4da2e60), SPH_C32(0x513c4fd7), SPH_C32(0xf21e87ec), - SPH_C32(0x635cf42f), SPH_C32(0xe8cf3180), SPH_C32(0xfcdb0000), - SPH_C32(0x9f3c0000), SPH_C32(0xc4070000), SPH_C32(0x8a195420), - SPH_C32(0x829707ab), SPH_C32(0x22dc7d28), SPH_C32(0x372e95b6), - SPH_C32(0x4dd6f82f) }, - { SPH_C32(0x1d2f0000), SPH_C32(0x807c0000), SPH_C32(0xc42b0000), - SPH_C32(0xd6872c40), SPH_C32(0xb230795e), SPH_C32(0xa85461af), - SPH_C32(0x80290c87), SPH_C32(0x6932c888), SPH_C32(0x1af30000), - SPH_C32(0xd3770000), SPH_C32(0x6c520000), SPH_C32(0x59c956c0), - SPH_C32(0x5af63713), SPH_C32(0xba7bcdf2), SPH_C32(0x1fbb9302), - SPH_C32(0x9a8cb0b8) }, - { SPH_C32(0xfb070000), SPH_C32(0xcc370000), SPH_C32(0x6c7e0000), - SPH_C32(0x05572ea0), SPH_C32(0x6a5149e6), SPH_C32(0x30f3d175), - SPH_C32(0xa8bc0a33), SPH_C32(0xbe68801f), SPH_C32(0xea360000), - SPH_C32(0x8a540000), SPH_C32(0x29d00000), SPH_C32(0xb8445600), - SPH_C32(0x619b3122), SPH_C32(0x78969b6b), SPH_C32(0xd45b6d1e), - SPH_C32(0xcc2b0127) }, - { SPH_C32(0xb82f0000), SPH_C32(0xb12c0000), SPH_C32(0x30d80000), - SPH_C32(0x14445000), SPH_C32(0xc15860a2), SPH_C32(0x3127e8ec), - SPH_C32(0x2e98bf23), SPH_C32(0x551e3d6e), SPH_C32(0x02f20000), - SPH_C32(0xa2810000), SPH_C32(0x873f0000), SPH_C32(0xe36c7800), - SPH_C32(0x1e1d74ef), SPH_C32(0x073d2bd6), SPH_C32(0xc4c23237), - SPH_C32(0x7f32259e) }, - { SPH_C32(0x5e070000), SPH_C32(0xfd670000), SPH_C32(0x988d0000), - SPH_C32(0xc79452e0), SPH_C32(0x1939501a), SPH_C32(0xa9805836), - SPH_C32(0x060db997), SPH_C32(0x824475f9), SPH_C32(0xf2370000), - SPH_C32(0xfba20000), SPH_C32(0xc2bd0000), SPH_C32(0x02e178c0), - SPH_C32(0x257072de), SPH_C32(0xc5d07d4f), SPH_C32(0x0f22cc2b), - SPH_C32(0x29959401) }, - { SPH_C32(0x48ea0000), SPH_C32(0xe80f0000), SPH_C32(0x755a0000), - SPH_C32(0xf5c950c0), SPH_C32(0xfa356693), SPH_C32(0xf3cabe75), - SPH_C32(0xe578413f), SPH_C32(0x03b98cf1), SPH_C32(0x141f0000), - SPH_C32(0xb7e90000), SPH_C32(0x6ae80000), SPH_C32(0xd1317a20), - SPH_C32(0xfd114266), SPH_C32(0x5d77cd95), SPH_C32(0x27b7ca9f), - SPH_C32(0xfecfdc96) }, - { SPH_C32(0xaec20000), SPH_C32(0xa4440000), SPH_C32(0xdd0f0000), - SPH_C32(0x26195220), SPH_C32(0x2254562b), SPH_C32(0x6b6d0eaf), - SPH_C32(0xcded478b), SPH_C32(0xd4e3c466), SPH_C32(0xe4da0000), - SPH_C32(0xeeca0000), SPH_C32(0x2f6a0000), SPH_C32(0x30bc7ae0), - SPH_C32(0xc67c4457), SPH_C32(0x9f9a9b0c), SPH_C32(0xec573483), - SPH_C32(0xa8686d09) }, - { SPH_C32(0x0c1e0000), SPH_C32(0xc61f0000), SPH_C32(0x81850000), - SPH_C32(0x6b9454e0), SPH_C32(0xb9fa019a), SPH_C32(0xe0312bb1), - SPH_C32(0xfcce6baa), SPH_C32(0x1b7149b0), SPH_C32(0xe1f40000), - SPH_C32(0x1f400000), SPH_C32(0x002c0000), SPH_C32(0x5c9e7860), - SPH_C32(0x30a77ef5), SPH_C32(0x8a881c87), SPH_C32(0xb7079931), - SPH_C32(0x24e430a7) }, - { SPH_C32(0xea360000), SPH_C32(0x8a540000), SPH_C32(0x29d00000), - SPH_C32(0xb8445600), SPH_C32(0x619b3122), SPH_C32(0x78969b6b), - SPH_C32(0xd45b6d1e), SPH_C32(0xcc2b0127), SPH_C32(0x11310000), - SPH_C32(0x46630000), SPH_C32(0x45ae0000), SPH_C32(0xbd1378a0), - SPH_C32(0x0bca78c4), SPH_C32(0x48654a1e), SPH_C32(0x7ce7672d), - SPH_C32(0x72438138) }, - { SPH_C32(0xfcdb0000), SPH_C32(0x9f3c0000), SPH_C32(0xc4070000), - SPH_C32(0x8a195420), SPH_C32(0x829707ab), SPH_C32(0x22dc7d28), - SPH_C32(0x372e95b6), SPH_C32(0x4dd6f82f), SPH_C32(0xf7190000), - SPH_C32(0x0a280000), SPH_C32(0xedfb0000), SPH_C32(0x6ec37a40), - SPH_C32(0xd3ab487c), SPH_C32(0xd0c2fac4), SPH_C32(0x54726199), - SPH_C32(0xa519c9af) }, - { SPH_C32(0x1af30000), SPH_C32(0xd3770000), SPH_C32(0x6c520000), - SPH_C32(0x59c956c0), SPH_C32(0x5af63713), SPH_C32(0xba7bcdf2), - SPH_C32(0x1fbb9302), SPH_C32(0x9a8cb0b8), SPH_C32(0x07dc0000), - SPH_C32(0x530b0000), SPH_C32(0xa8790000), SPH_C32(0x8f4e7a80), - SPH_C32(0xe8c64e4d), SPH_C32(0x122fac5d), SPH_C32(0x9f929f85), - SPH_C32(0xf3be7830) }, - { SPH_C32(0x5b290000), SPH_C32(0x0ced0000), SPH_C32(0xb7cb0000), - SPH_C32(0xabb65060), SPH_C32(0xefe26ab8), SPH_C32(0xbc92dfbd), - SPH_C32(0x5d5d1425), SPH_C32(0x0ec82857), SPH_C32(0x55c50000), - SPH_C32(0x68730000), SPH_C32(0xb1710000), SPH_C32(0x234e7c80), - SPH_C32(0x48051fcd), SPH_C32(0x5b9edfda), SPH_C32(0x65514db8), - SPH_C32(0x6a8b4479) }, - { SPH_C32(0xbd010000), SPH_C32(0x40a60000), SPH_C32(0x1f9e0000), - SPH_C32(0x78665280), SPH_C32(0x37835a00), SPH_C32(0x24356f67), - SPH_C32(0x75c81291), SPH_C32(0xd99260c0), SPH_C32(0xa5000000), - SPH_C32(0x31500000), SPH_C32(0xf4f30000), SPH_C32(0xc2c37c40), - SPH_C32(0x736819fc), SPH_C32(0x99738943), SPH_C32(0xaeb1b3a4), - SPH_C32(0x3c2cf5e6) }, - { SPH_C32(0xabec0000), SPH_C32(0x55ce0000), SPH_C32(0xf2490000), - SPH_C32(0x4a3b50a0), SPH_C32(0xd48f6c89), SPH_C32(0x7e7f8924), - SPH_C32(0x96bdea39), SPH_C32(0x586f99c8), SPH_C32(0x43280000), - SPH_C32(0x7d1b0000), SPH_C32(0x5ca60000), SPH_C32(0x11137ea0), - SPH_C32(0xab092944), SPH_C32(0x01d43999), SPH_C32(0x8624b510), - SPH_C32(0xeb76bd71) }, - { SPH_C32(0x4dc40000), SPH_C32(0x19850000), SPH_C32(0x5a1c0000), - SPH_C32(0x99eb5240), SPH_C32(0x0cee5c31), SPH_C32(0xe6d839fe), - SPH_C32(0xbe28ec8d), SPH_C32(0x8f35d15f), SPH_C32(0xb3ed0000), - SPH_C32(0x24380000), SPH_C32(0x19240000), SPH_C32(0xf09e7e60), - SPH_C32(0x90642f75), SPH_C32(0xc3396f00), SPH_C32(0x4dc44b0c), - SPH_C32(0xbdd10cee) }, - { SPH_C32(0xef180000), SPH_C32(0x7bde0000), SPH_C32(0x06960000), - SPH_C32(0xd4665480), SPH_C32(0x97400b80), SPH_C32(0x6d841ce0), - SPH_C32(0x8f0bc0ac), SPH_C32(0x40a75c89), SPH_C32(0xb6c30000), - SPH_C32(0xd5b20000), SPH_C32(0x36620000), SPH_C32(0x9cbc7ce0), - SPH_C32(0x66bf15d7), SPH_C32(0xd62be88b), SPH_C32(0x1694e6be), - SPH_C32(0x315d5140) }, - { SPH_C32(0x09300000), SPH_C32(0x37950000), SPH_C32(0xaec30000), - SPH_C32(0x07b65660), SPH_C32(0x4f213b38), SPH_C32(0xf523ac3a), - SPH_C32(0xa79ec618), SPH_C32(0x97fd141e), SPH_C32(0x46060000), - SPH_C32(0x8c910000), SPH_C32(0x73e00000), SPH_C32(0x7d317c20), - SPH_C32(0x5dd213e6), SPH_C32(0x14c6be12), SPH_C32(0xdd7418a2), - SPH_C32(0x67fae0df) }, - { SPH_C32(0x1fdd0000), SPH_C32(0x22fd0000), SPH_C32(0x43140000), - SPH_C32(0x35eb5440), SPH_C32(0xac2d0db1), SPH_C32(0xaf694a79), - SPH_C32(0x44eb3eb0), SPH_C32(0x1600ed16), SPH_C32(0xa02e0000), - SPH_C32(0xc0da0000), SPH_C32(0xdbb50000), SPH_C32(0xaee17ec0), - SPH_C32(0x85b3235e), SPH_C32(0x8c610ec8), SPH_C32(0xf5e11e16), - SPH_C32(0xb0a0a848) }, - { SPH_C32(0xf9f50000), SPH_C32(0x6eb60000), SPH_C32(0xeb410000), - SPH_C32(0xe63b56a0), SPH_C32(0x744c3d09), SPH_C32(0x37cefaa3), - SPH_C32(0x6c7e3804), SPH_C32(0xc15aa581), SPH_C32(0x50eb0000), - SPH_C32(0x99f90000), SPH_C32(0x9e370000), SPH_C32(0x4f6c7e00), - SPH_C32(0xbede256f), SPH_C32(0x4e8c5851), SPH_C32(0x3e01e00a), - SPH_C32(0xe60719d7) }, - { SPH_C32(0x1e6c0000), SPH_C32(0xc4420000), SPH_C32(0x8a2e0000), - SPH_C32(0xbcb6b800), SPH_C32(0x2c4413b6), SPH_C32(0x8bfdd3da), - SPH_C32(0x6a0c1bc8), SPH_C32(0xb99dc2eb), SPH_C32(0x92560000), - SPH_C32(0x1eda0000), SPH_C32(0xea510000), SPH_C32(0xe8b13000), - SPH_C32(0xa93556a5), SPH_C32(0xebfb6199), SPH_C32(0xb15c2254), - SPH_C32(0x33c5244f) }, - { SPH_C32(0xf8440000), SPH_C32(0x88090000), SPH_C32(0x227b0000), - SPH_C32(0x6f66bae0), SPH_C32(0xf425230e), SPH_C32(0x135a6300), - SPH_C32(0x42991d7c), SPH_C32(0x6ec78a7c), SPH_C32(0x62930000), - SPH_C32(0x47f90000), SPH_C32(0xafd30000), SPH_C32(0x093c30c0), - SPH_C32(0x92585094), SPH_C32(0x29163700), SPH_C32(0x7abcdc48), - SPH_C32(0x656295d0) }, - { SPH_C32(0xeea90000), SPH_C32(0x9d610000), SPH_C32(0xcfac0000), - SPH_C32(0x5d3bb8c0), SPH_C32(0x17291587), SPH_C32(0x49108543), - SPH_C32(0xa1ece5d4), SPH_C32(0xef3a7374), SPH_C32(0x84bb0000), - SPH_C32(0x0bb20000), SPH_C32(0x07860000), SPH_C32(0xdaec3220), - SPH_C32(0x4a39602c), SPH_C32(0xb1b187da), SPH_C32(0x5229dafc), - SPH_C32(0xb238dd47) }, - { SPH_C32(0x08810000), SPH_C32(0xd12a0000), SPH_C32(0x67f90000), - SPH_C32(0x8eebba20), SPH_C32(0xcf48253f), SPH_C32(0xd1b73599), - SPH_C32(0x8979e360), SPH_C32(0x38603be3), SPH_C32(0x747e0000), - SPH_C32(0x52910000), SPH_C32(0x42040000), SPH_C32(0x3b6132e0), - SPH_C32(0x7154661d), SPH_C32(0x735cd143), SPH_C32(0x99c924e0), - SPH_C32(0xe49f6cd8) }, - { SPH_C32(0xaa5d0000), SPH_C32(0xb3710000), SPH_C32(0x3b730000), - SPH_C32(0xc366bce0), SPH_C32(0x54e6728e), SPH_C32(0x5aeb1087), - SPH_C32(0xb85acf41), SPH_C32(0xf7f2b635), SPH_C32(0x71500000), - SPH_C32(0xa31b0000), SPH_C32(0x6d420000), SPH_C32(0x57433060), - SPH_C32(0x878f5cbf), SPH_C32(0x664e56c8), SPH_C32(0xc2998952), - SPH_C32(0x68133176) }, - { SPH_C32(0x4c750000), SPH_C32(0xff3a0000), SPH_C32(0x93260000), - SPH_C32(0x10b6be00), SPH_C32(0x8c874236), SPH_C32(0xc24ca05d), - SPH_C32(0x90cfc9f5), SPH_C32(0x20a8fea2), SPH_C32(0x81950000), - SPH_C32(0xfa380000), SPH_C32(0x28c00000), SPH_C32(0xb6ce30a0), - SPH_C32(0xbce25a8e), SPH_C32(0xa4a30051), SPH_C32(0x0979774e), - SPH_C32(0x3eb480e9) }, - { SPH_C32(0x5a980000), SPH_C32(0xea520000), SPH_C32(0x7ef10000), - SPH_C32(0x22ebbc20), SPH_C32(0x6f8b74bf), SPH_C32(0x9806461e), - SPH_C32(0x73ba315d), SPH_C32(0xa15507aa), SPH_C32(0x67bd0000), - SPH_C32(0xb6730000), SPH_C32(0x80950000), SPH_C32(0x651e3240), - SPH_C32(0x64836a36), SPH_C32(0x3c04b08b), SPH_C32(0x21ec71fa), - SPH_C32(0xe9eec87e) }, - { SPH_C32(0xbcb00000), SPH_C32(0xa6190000), SPH_C32(0xd6a40000), - SPH_C32(0xf13bbec0), SPH_C32(0xb7ea4407), SPH_C32(0x00a1f6c4), - SPH_C32(0x5b2f37e9), SPH_C32(0x760f4f3d), SPH_C32(0x97780000), - SPH_C32(0xef500000), SPH_C32(0xc5170000), SPH_C32(0x84933280), - SPH_C32(0x5fee6c07), SPH_C32(0xfee9e612), SPH_C32(0xea0c8fe6), - SPH_C32(0xbf4979e1) }, - { SPH_C32(0xfd6a0000), SPH_C32(0x79830000), SPH_C32(0x0d3d0000), - SPH_C32(0x0344b860), SPH_C32(0x02fe19ac), SPH_C32(0x0648e48b), - SPH_C32(0x19c9b0ce), SPH_C32(0xe24bd7d2), SPH_C32(0xc5610000), - SPH_C32(0xd4280000), SPH_C32(0xdc1f0000), SPH_C32(0x28933480), - SPH_C32(0xff2d3d87), SPH_C32(0xb7589595), SPH_C32(0x10cf5ddb), - SPH_C32(0x267c45a8) }, - { SPH_C32(0x1b420000), SPH_C32(0x35c80000), SPH_C32(0xa5680000), - SPH_C32(0xd094ba80), SPH_C32(0xda9f2914), SPH_C32(0x9eef5451), - SPH_C32(0x315cb67a), SPH_C32(0x35119f45), SPH_C32(0x35a40000), - SPH_C32(0x8d0b0000), SPH_C32(0x999d0000), SPH_C32(0xc91e3440), - SPH_C32(0xc4403bb6), SPH_C32(0x75b5c30c), SPH_C32(0xdb2fa3c7), - SPH_C32(0x70dbf437) }, - { SPH_C32(0x0daf0000), SPH_C32(0x20a00000), SPH_C32(0x48bf0000), - SPH_C32(0xe2c9b8a0), SPH_C32(0x39931f9d), SPH_C32(0xc4a5b212), - SPH_C32(0xd2294ed2), SPH_C32(0xb4ec664d), SPH_C32(0xd38c0000), - SPH_C32(0xc1400000), SPH_C32(0x31c80000), SPH_C32(0x1ace36a0), - SPH_C32(0x1c210b0e), SPH_C32(0xed1273d6), SPH_C32(0xf3baa573), - SPH_C32(0xa781bca0) }, - { SPH_C32(0xeb870000), SPH_C32(0x6ceb0000), SPH_C32(0xe0ea0000), - SPH_C32(0x3119ba40), SPH_C32(0xe1f22f25), SPH_C32(0x5c0202c8), - SPH_C32(0xfabc4866), SPH_C32(0x63b62eda), SPH_C32(0x23490000), - SPH_C32(0x98630000), SPH_C32(0x744a0000), SPH_C32(0xfb433660), - SPH_C32(0x274c0d3f), SPH_C32(0x2fff254f), SPH_C32(0x385a5b6f), - SPH_C32(0xf1260d3f) }, - { SPH_C32(0x495b0000), SPH_C32(0x0eb00000), SPH_C32(0xbc600000), - SPH_C32(0x7c94bc80), SPH_C32(0x7a5c7894), SPH_C32(0xd75e27d6), - SPH_C32(0xcb9f6447), SPH_C32(0xac24a30c), SPH_C32(0x26670000), - SPH_C32(0x69e90000), SPH_C32(0x5b0c0000), SPH_C32(0x976134e0), - SPH_C32(0xd197379d), SPH_C32(0x3aeda2c4), SPH_C32(0x630af6dd), - SPH_C32(0x7daa5091) }, - { SPH_C32(0xaf730000), SPH_C32(0x42fb0000), SPH_C32(0x14350000), - SPH_C32(0xaf44be60), SPH_C32(0xa23d482c), SPH_C32(0x4ff9970c), - SPH_C32(0xe30a62f3), SPH_C32(0x7b7eeb9b), SPH_C32(0xd6a20000), - SPH_C32(0x30ca0000), SPH_C32(0x1e8e0000), SPH_C32(0x76ec3420), - SPH_C32(0xeafa31ac), SPH_C32(0xf800f45d), SPH_C32(0xa8ea08c1), - SPH_C32(0x2b0de10e) }, - { SPH_C32(0xb99e0000), SPH_C32(0x57930000), SPH_C32(0xf9e20000), - SPH_C32(0x9d19bc40), SPH_C32(0x41317ea5), SPH_C32(0x15b3714f), - SPH_C32(0x007f9a5b), SPH_C32(0xfa831293), SPH_C32(0x308a0000), - SPH_C32(0x7c810000), SPH_C32(0xb6db0000), SPH_C32(0xa53c36c0), - SPH_C32(0x329b0114), SPH_C32(0x60a74487), SPH_C32(0x807f0e75), - SPH_C32(0xfc57a999) }, - { SPH_C32(0x5fb60000), SPH_C32(0x1bd80000), SPH_C32(0x51b70000), - SPH_C32(0x4ec9bea0), SPH_C32(0x99504e1d), SPH_C32(0x8d14c195), - SPH_C32(0x28ea9cef), SPH_C32(0x2dd95a04), SPH_C32(0xc04f0000), - SPH_C32(0x25a20000), SPH_C32(0xf3590000), SPH_C32(0x44b13600), - SPH_C32(0x09f60725), SPH_C32(0xa24a121e), SPH_C32(0x4b9ff069), - SPH_C32(0xaaf01806) }, - { SPH_C32(0x1c9e0000), SPH_C32(0x66c30000), SPH_C32(0x0d110000), - SPH_C32(0x5fdac000), SPH_C32(0x32596759), SPH_C32(0x8cc0f80c), - SPH_C32(0xaece29ff), SPH_C32(0xc6afe775), SPH_C32(0x288b0000), - SPH_C32(0x0d770000), SPH_C32(0x5db60000), SPH_C32(0x1f991800), - SPH_C32(0x767042e8), SPH_C32(0xdde1a2a3), SPH_C32(0x5b06af40), - SPH_C32(0x19e93cbf) }, - { SPH_C32(0xfab60000), SPH_C32(0x2a880000), SPH_C32(0xa5440000), - SPH_C32(0x8c0ac2e0), SPH_C32(0xea3857e1), SPH_C32(0x146748d6), - SPH_C32(0x865b2f4b), SPH_C32(0x11f5afe2), SPH_C32(0xd84e0000), - SPH_C32(0x54540000), SPH_C32(0x18340000), SPH_C32(0xfe1418c0), - SPH_C32(0x4d1d44d9), SPH_C32(0x1f0cf43a), SPH_C32(0x90e6515c), - SPH_C32(0x4f4e8d20) }, - { SPH_C32(0xec5b0000), SPH_C32(0x3fe00000), SPH_C32(0x48930000), - SPH_C32(0xbe57c0c0), SPH_C32(0x09346168), SPH_C32(0x4e2dae95), - SPH_C32(0x652ed7e3), SPH_C32(0x900856ea), SPH_C32(0x3e660000), - SPH_C32(0x181f0000), SPH_C32(0xb0610000), SPH_C32(0x2dc41a20), - SPH_C32(0x957c7461), SPH_C32(0x87ab44e0), SPH_C32(0xb87357e8), - SPH_C32(0x9814c5b7) }, - { SPH_C32(0x0a730000), SPH_C32(0x73ab0000), SPH_C32(0xe0c60000), - SPH_C32(0x6d87c220), SPH_C32(0xd15551d0), SPH_C32(0xd68a1e4f), - SPH_C32(0x4dbbd157), SPH_C32(0x47521e7d), SPH_C32(0xcea30000), - SPH_C32(0x413c0000), SPH_C32(0xf5e30000), SPH_C32(0xcc491ae0), - SPH_C32(0xae117250), SPH_C32(0x45461279), SPH_C32(0x7393a9f4), - SPH_C32(0xceb37428) }, - { SPH_C32(0xa8af0000), SPH_C32(0x11f00000), SPH_C32(0xbc4c0000), - SPH_C32(0x200ac4e0), SPH_C32(0x4afb0661), SPH_C32(0x5dd63b51), - SPH_C32(0x7c98fd76), SPH_C32(0x88c093ab), SPH_C32(0xcb8d0000), - SPH_C32(0xb0b60000), SPH_C32(0xdaa50000), SPH_C32(0xa06b1860), - SPH_C32(0x58ca48f2), SPH_C32(0x505495f2), SPH_C32(0x28c30446), - SPH_C32(0x423f2986) }, - { SPH_C32(0x4e870000), SPH_C32(0x5dbb0000), SPH_C32(0x14190000), - SPH_C32(0xf3dac600), SPH_C32(0x929a36d9), SPH_C32(0xc5718b8b), - SPH_C32(0x540dfbc2), SPH_C32(0x5f9adb3c), SPH_C32(0x3b480000), - SPH_C32(0xe9950000), SPH_C32(0x9f270000), SPH_C32(0x41e618a0), - SPH_C32(0x63a74ec3), SPH_C32(0x92b9c36b), SPH_C32(0xe323fa5a), - SPH_C32(0x14989819) }, - { SPH_C32(0x586a0000), SPH_C32(0x48d30000), SPH_C32(0xf9ce0000), - SPH_C32(0xc187c420), SPH_C32(0x71960050), SPH_C32(0x9f3b6dc8), - SPH_C32(0xb778036a), SPH_C32(0xde672234), SPH_C32(0xdd600000), - SPH_C32(0xa5de0000), SPH_C32(0x37720000), SPH_C32(0x92361a40), - SPH_C32(0xbbc67e7b), SPH_C32(0x0a1e73b1), SPH_C32(0xcbb6fcee), - SPH_C32(0xc3c2d08e) }, - { SPH_C32(0xbe420000), SPH_C32(0x04980000), SPH_C32(0x519b0000), - SPH_C32(0x1257c6c0), SPH_C32(0xa9f730e8), SPH_C32(0x079cdd12), - SPH_C32(0x9fed05de), SPH_C32(0x093d6aa3), SPH_C32(0x2da50000), - SPH_C32(0xfcfd0000), SPH_C32(0x72f00000), SPH_C32(0x73bb1a80), - SPH_C32(0x80ab784a), SPH_C32(0xc8f32528), SPH_C32(0x005602f2), - SPH_C32(0x95656111) }, - { SPH_C32(0xff980000), SPH_C32(0xdb020000), SPH_C32(0x8a020000), - SPH_C32(0xe028c060), SPH_C32(0x1ce36d43), SPH_C32(0x0175cf5d), - SPH_C32(0xdd0b82f9), SPH_C32(0x9d79f24c), SPH_C32(0x7fbc0000), - SPH_C32(0xc7850000), SPH_C32(0x6bf80000), SPH_C32(0xdfbb1c80), - SPH_C32(0x206829ca), SPH_C32(0x814256af), SPH_C32(0xfa95d0cf), - SPH_C32(0x0c505d58) }, - { SPH_C32(0x19b00000), SPH_C32(0x97490000), SPH_C32(0x22570000), - SPH_C32(0x33f8c280), SPH_C32(0xc4825dfb), SPH_C32(0x99d27f87), - SPH_C32(0xf59e844d), SPH_C32(0x4a23badb), SPH_C32(0x8f790000), - SPH_C32(0x9ea60000), SPH_C32(0x2e7a0000), SPH_C32(0x3e361c40), - SPH_C32(0x1b052ffb), SPH_C32(0x43af0036), SPH_C32(0x31752ed3), - SPH_C32(0x5af7ecc7) }, - { SPH_C32(0x0f5d0000), SPH_C32(0x82210000), SPH_C32(0xcf800000), - SPH_C32(0x01a5c0a0), SPH_C32(0x278e6b72), SPH_C32(0xc39899c4), - SPH_C32(0x16eb7ce5), SPH_C32(0xcbde43d3), SPH_C32(0x69510000), - SPH_C32(0xd2ed0000), SPH_C32(0x862f0000), SPH_C32(0xede61ea0), - SPH_C32(0xc3641f43), SPH_C32(0xdb08b0ec), SPH_C32(0x19e02867), - SPH_C32(0x8dada450) }, - { SPH_C32(0xe9750000), SPH_C32(0xce6a0000), SPH_C32(0x67d50000), - SPH_C32(0xd275c240), SPH_C32(0xffef5bca), SPH_C32(0x5b3f291e), - SPH_C32(0x3e7e7a51), SPH_C32(0x1c840b44), SPH_C32(0x99940000), - SPH_C32(0x8bce0000), SPH_C32(0xc3ad0000), SPH_C32(0x0c6b1e60), - SPH_C32(0xf8091972), SPH_C32(0x19e5e675), SPH_C32(0xd200d67b), - SPH_C32(0xdb0a15cf) }, - { SPH_C32(0x4ba90000), SPH_C32(0xac310000), SPH_C32(0x3b5f0000), - SPH_C32(0x9ff8c480), SPH_C32(0x64410c7b), SPH_C32(0xd0630c00), - SPH_C32(0x0f5d5670), SPH_C32(0xd3168692), SPH_C32(0x9cba0000), - SPH_C32(0x7a440000), SPH_C32(0xeceb0000), SPH_C32(0x60491ce0), - SPH_C32(0x0ed223d0), SPH_C32(0x0cf761fe), SPH_C32(0x89507bc9), - SPH_C32(0x57864861) }, - { SPH_C32(0xad810000), SPH_C32(0xe07a0000), SPH_C32(0x930a0000), - SPH_C32(0x4c28c660), SPH_C32(0xbc203cc3), SPH_C32(0x48c4bcda), - SPH_C32(0x27c850c4), SPH_C32(0x044cce05), SPH_C32(0x6c7f0000), - SPH_C32(0x23670000), SPH_C32(0xa9690000), SPH_C32(0x81c41c20), - SPH_C32(0x35bf25e1), SPH_C32(0xce1a3767), SPH_C32(0x42b085d5), - SPH_C32(0x0121f9fe) }, - { SPH_C32(0xbb6c0000), SPH_C32(0xf5120000), SPH_C32(0x7edd0000), - SPH_C32(0x7e75c440), SPH_C32(0x5f2c0a4a), SPH_C32(0x128e5a99), - SPH_C32(0xc4bda86c), SPH_C32(0x85b1370d), SPH_C32(0x8a570000), - SPH_C32(0x6f2c0000), SPH_C32(0x013c0000), SPH_C32(0x52141ec0), - SPH_C32(0xedde1559), SPH_C32(0x56bd87bd), SPH_C32(0x6a258361), - SPH_C32(0xd67bb169) }, - { SPH_C32(0x5d440000), SPH_C32(0xb9590000), SPH_C32(0xd6880000), - SPH_C32(0xada5c6a0), SPH_C32(0x874d3af2), SPH_C32(0x8a29ea43), - SPH_C32(0xec28aed8), SPH_C32(0x52eb7f9a), SPH_C32(0x7a920000), - SPH_C32(0x360f0000), SPH_C32(0x44be0000), SPH_C32(0xb3991e00), - SPH_C32(0xd6b31368), SPH_C32(0x9450d124), SPH_C32(0xa1c57d7d), - SPH_C32(0x80dc00f6) }, - { SPH_C32(0xa4b10000), SPH_C32(0xd7ef0000), SPH_C32(0x3dc90000), - SPH_C32(0x4b9e9000), SPH_C32(0xf30107fb), SPH_C32(0xbde710e0), - SPH_C32(0x805696dc), SPH_C32(0x93b1da1b), SPH_C32(0x2a790000), - SPH_C32(0xaff60000), SPH_C32(0xda890000), SPH_C32(0xfcf56000), - SPH_C32(0x686d3607), SPH_C32(0xdadc8975), SPH_C32(0x9fc49d77), - SPH_C32(0x66db1921) }, - { SPH_C32(0x42990000), SPH_C32(0x9ba40000), SPH_C32(0x959c0000), - SPH_C32(0x984e92e0), SPH_C32(0x2b603743), SPH_C32(0x2540a03a), - SPH_C32(0xa8c39068), SPH_C32(0x44eb928c), SPH_C32(0xdabc0000), - SPH_C32(0xf6d50000), SPH_C32(0x9f0b0000), SPH_C32(0x1d7860c0), - SPH_C32(0x53003036), SPH_C32(0x1831dfec), SPH_C32(0x5424636b), - SPH_C32(0x307ca8be) }, - { SPH_C32(0x54740000), SPH_C32(0x8ecc0000), SPH_C32(0x784b0000), - SPH_C32(0xaa1390c0), SPH_C32(0xc86c01ca), SPH_C32(0x7f0a4679), - SPH_C32(0x4bb668c0), SPH_C32(0xc5166b84), SPH_C32(0x3c940000), - SPH_C32(0xba9e0000), SPH_C32(0x375e0000), SPH_C32(0xcea86220), - SPH_C32(0x8b61008e), SPH_C32(0x80966f36), SPH_C32(0x7cb165df), - SPH_C32(0xe726e029) }, - { SPH_C32(0xb25c0000), SPH_C32(0xc2870000), SPH_C32(0xd01e0000), - SPH_C32(0x79c39220), SPH_C32(0x100d3172), SPH_C32(0xe7adf6a3), - SPH_C32(0x63236e74), SPH_C32(0x124c2313), SPH_C32(0xcc510000), - SPH_C32(0xe3bd0000), SPH_C32(0x72dc0000), SPH_C32(0x2f2562e0), - SPH_C32(0xb00c06bf), SPH_C32(0x427b39af), SPH_C32(0xb7519bc3), - SPH_C32(0xb18151b6) }, - { SPH_C32(0x10800000), SPH_C32(0xa0dc0000), SPH_C32(0x8c940000), - SPH_C32(0x344e94e0), SPH_C32(0x8ba366c3), SPH_C32(0x6cf1d3bd), - SPH_C32(0x52004255), SPH_C32(0xdddeaec5), SPH_C32(0xc97f0000), - SPH_C32(0x12370000), SPH_C32(0x5d9a0000), SPH_C32(0x43076060), - SPH_C32(0x46d73c1d), SPH_C32(0x5769be24), SPH_C32(0xec013671), - SPH_C32(0x3d0d0c18) }, - { SPH_C32(0xf6a80000), SPH_C32(0xec970000), SPH_C32(0x24c10000), - SPH_C32(0xe79e9600), SPH_C32(0x53c2567b), SPH_C32(0xf4566367), - SPH_C32(0x7a9544e1), SPH_C32(0x0a84e652), SPH_C32(0x39ba0000), - SPH_C32(0x4b140000), SPH_C32(0x18180000), SPH_C32(0xa28a60a0), - SPH_C32(0x7dba3a2c), SPH_C32(0x9584e8bd), SPH_C32(0x27e1c86d), - SPH_C32(0x6baabd87) }, - { SPH_C32(0xe0450000), SPH_C32(0xf9ff0000), SPH_C32(0xc9160000), - SPH_C32(0xd5c39420), SPH_C32(0xb0ce60f2), SPH_C32(0xae1c8524), - SPH_C32(0x99e0bc49), SPH_C32(0x8b791f5a), SPH_C32(0xdf920000), - SPH_C32(0x075f0000), SPH_C32(0xb04d0000), SPH_C32(0x715a6240), - SPH_C32(0xa5db0a94), SPH_C32(0x0d235867), SPH_C32(0x0f74ced9), - SPH_C32(0xbcf0f510) }, - { SPH_C32(0x066d0000), SPH_C32(0xb5b40000), SPH_C32(0x61430000), - SPH_C32(0x061396c0), SPH_C32(0x68af504a), SPH_C32(0x36bb35fe), - SPH_C32(0xb175bafd), SPH_C32(0x5c2357cd), SPH_C32(0x2f570000), - SPH_C32(0x5e7c0000), SPH_C32(0xf5cf0000), SPH_C32(0x90d76280), - SPH_C32(0x9eb60ca5), SPH_C32(0xcfce0efe), SPH_C32(0xc49430c5), - SPH_C32(0xea57448f) }, - { SPH_C32(0x47b70000), SPH_C32(0x6a2e0000), SPH_C32(0xbada0000), - SPH_C32(0xf46c9060), SPH_C32(0xddbb0de1), SPH_C32(0x305227b1), - SPH_C32(0xf3933dda), SPH_C32(0xc867cf22), SPH_C32(0x7d4e0000), - SPH_C32(0x65040000), SPH_C32(0xecc70000), SPH_C32(0x3cd76480), - SPH_C32(0x3e755d25), SPH_C32(0x867f7d79), SPH_C32(0x3e57e2f8), - SPH_C32(0x736278c6) }, - { SPH_C32(0xa19f0000), SPH_C32(0x26650000), SPH_C32(0x128f0000), - SPH_C32(0x27bc9280), SPH_C32(0x05da3d59), SPH_C32(0xa8f5976b), - SPH_C32(0xdb063b6e), SPH_C32(0x1f3d87b5), SPH_C32(0x8d8b0000), - SPH_C32(0x3c270000), SPH_C32(0xa9450000), SPH_C32(0xdd5a6440), - SPH_C32(0x05185b14), SPH_C32(0x44922be0), SPH_C32(0xf5b71ce4), - SPH_C32(0x25c5c959) }, - { SPH_C32(0xb7720000), SPH_C32(0x330d0000), SPH_C32(0xff580000), - SPH_C32(0x15e190a0), SPH_C32(0xe6d60bd0), SPH_C32(0xf2bf7128), - SPH_C32(0x3873c3c6), SPH_C32(0x9ec07ebd), SPH_C32(0x6ba30000), - SPH_C32(0x706c0000), SPH_C32(0x01100000), SPH_C32(0x0e8a66a0), - SPH_C32(0xdd796bac), SPH_C32(0xdc359b3a), SPH_C32(0xdd221a50), - SPH_C32(0xf29f81ce) }, - { SPH_C32(0x515a0000), SPH_C32(0x7f460000), SPH_C32(0x570d0000), - SPH_C32(0xc6319240), SPH_C32(0x3eb73b68), SPH_C32(0x6a18c1f2), - SPH_C32(0x10e6c572), SPH_C32(0x499a362a), SPH_C32(0x9b660000), - SPH_C32(0x294f0000), SPH_C32(0x44920000), SPH_C32(0xef076660), - SPH_C32(0xe6146d9d), SPH_C32(0x1ed8cda3), SPH_C32(0x16c2e44c), - SPH_C32(0xa4383051) }, - { SPH_C32(0xf3860000), SPH_C32(0x1d1d0000), SPH_C32(0x0b870000), - SPH_C32(0x8bbc9480), SPH_C32(0xa5196cd9), SPH_C32(0xe144e4ec), - SPH_C32(0x21c5e953), SPH_C32(0x8608bbfc), SPH_C32(0x9e480000), - SPH_C32(0xd8c50000), SPH_C32(0x6bd40000), SPH_C32(0x832564e0), - SPH_C32(0x10cf573f), SPH_C32(0x0bca4a28), SPH_C32(0x4d9249fe), - SPH_C32(0x28b46dff) }, - { SPH_C32(0x15ae0000), SPH_C32(0x51560000), SPH_C32(0xa3d20000), - SPH_C32(0x586c9660), SPH_C32(0x7d785c61), SPH_C32(0x79e35436), - SPH_C32(0x0950efe7), SPH_C32(0x5152f36b), SPH_C32(0x6e8d0000), - SPH_C32(0x81e60000), SPH_C32(0x2e560000), SPH_C32(0x62a86420), - SPH_C32(0x2ba2510e), SPH_C32(0xc9271cb1), SPH_C32(0x8672b7e2), - SPH_C32(0x7e13dc60) }, - { SPH_C32(0x03430000), SPH_C32(0x443e0000), SPH_C32(0x4e050000), - SPH_C32(0x6a319440), SPH_C32(0x9e746ae8), SPH_C32(0x23a9b275), - SPH_C32(0xea25174f), SPH_C32(0xd0af0a63), SPH_C32(0x88a50000), - SPH_C32(0xcdad0000), SPH_C32(0x86030000), SPH_C32(0xb17866c0), - SPH_C32(0xf3c361b6), SPH_C32(0x5180ac6b), SPH_C32(0xaee7b156), - SPH_C32(0xa94994f7) }, - { SPH_C32(0xe56b0000), SPH_C32(0x08750000), SPH_C32(0xe6500000), - SPH_C32(0xb9e196a0), SPH_C32(0x46155a50), SPH_C32(0xbb0e02af), - SPH_C32(0xc2b011fb), SPH_C32(0x07f542f4), SPH_C32(0x78600000), - SPH_C32(0x948e0000), SPH_C32(0xc3810000), SPH_C32(0x50f56600), - SPH_C32(0xc8ae6787), SPH_C32(0x936dfaf2), SPH_C32(0x65074f4a), - SPH_C32(0xffee2568) }, - { SPH_C32(0xa6430000), SPH_C32(0x756e0000), SPH_C32(0xbaf60000), - SPH_C32(0xa8f2e800), SPH_C32(0xed1c7314), SPH_C32(0xbada3b36), - SPH_C32(0x4494a4eb), SPH_C32(0xec83ff85), SPH_C32(0x90a40000), - SPH_C32(0xbc5b0000), SPH_C32(0x6d6e0000), SPH_C32(0x0bdd4800), - SPH_C32(0xb728224a), SPH_C32(0xecc64a4f), SPH_C32(0x759e1063), - SPH_C32(0x4cf701d1) }, - { SPH_C32(0x406b0000), SPH_C32(0x39250000), SPH_C32(0x12a30000), - SPH_C32(0x7b22eae0), SPH_C32(0x357d43ac), SPH_C32(0x227d8bec), - SPH_C32(0x6c01a25f), SPH_C32(0x3bd9b712), SPH_C32(0x60610000), - SPH_C32(0xe5780000), SPH_C32(0x28ec0000), SPH_C32(0xea5048c0), - SPH_C32(0x8c45247b), SPH_C32(0x2e2b1cd6), SPH_C32(0xbe7eee7f), - SPH_C32(0x1a50b04e) }, - { SPH_C32(0x56860000), SPH_C32(0x2c4d0000), SPH_C32(0xff740000), - SPH_C32(0x497fe8c0), SPH_C32(0xd6717525), SPH_C32(0x78376daf), - SPH_C32(0x8f745af7), SPH_C32(0xba244e1a), SPH_C32(0x86490000), - SPH_C32(0xa9330000), SPH_C32(0x80b90000), SPH_C32(0x39804a20), - SPH_C32(0x542414c3), SPH_C32(0xb68cac0c), SPH_C32(0x96ebe8cb), - SPH_C32(0xcd0af8d9) }, - { SPH_C32(0xb0ae0000), SPH_C32(0x60060000), SPH_C32(0x57210000), - SPH_C32(0x9aafea20), SPH_C32(0x0e10459d), SPH_C32(0xe090dd75), - SPH_C32(0xa7e15c43), SPH_C32(0x6d7e068d), SPH_C32(0x768c0000), - SPH_C32(0xf0100000), SPH_C32(0xc53b0000), SPH_C32(0xd80d4ae0), - SPH_C32(0x6f4912f2), SPH_C32(0x7461fa95), SPH_C32(0x5d0b16d7), - SPH_C32(0x9bad4946) }, - { SPH_C32(0x12720000), SPH_C32(0x025d0000), SPH_C32(0x0bab0000), - SPH_C32(0xd722ece0), SPH_C32(0x95be122c), SPH_C32(0x6bccf86b), - SPH_C32(0x96c27062), SPH_C32(0xa2ec8b5b), SPH_C32(0x73a20000), - SPH_C32(0x019a0000), SPH_C32(0xea7d0000), SPH_C32(0xb42f4860), - SPH_C32(0x99922850), SPH_C32(0x61737d1e), SPH_C32(0x065bbb65), - SPH_C32(0x172114e8) }, - { SPH_C32(0xf45a0000), SPH_C32(0x4e160000), SPH_C32(0xa3fe0000), - SPH_C32(0x04f2ee00), SPH_C32(0x4ddf2294), SPH_C32(0xf36b48b1), - SPH_C32(0xbe5776d6), SPH_C32(0x75b6c3cc), SPH_C32(0x83670000), - SPH_C32(0x58b90000), SPH_C32(0xafff0000), SPH_C32(0x55a248a0), - SPH_C32(0xa2ff2e61), SPH_C32(0xa39e2b87), SPH_C32(0xcdbb4579), - SPH_C32(0x4186a577) }, - { SPH_C32(0xe2b70000), SPH_C32(0x5b7e0000), SPH_C32(0x4e290000), - SPH_C32(0x36afec20), SPH_C32(0xaed3141d), SPH_C32(0xa921aef2), - SPH_C32(0x5d228e7e), SPH_C32(0xf44b3ac4), SPH_C32(0x654f0000), - SPH_C32(0x14f20000), SPH_C32(0x07aa0000), SPH_C32(0x86724a40), - SPH_C32(0x7a9e1ed9), SPH_C32(0x3b399b5d), SPH_C32(0xe52e43cd), - SPH_C32(0x96dcede0) }, - { SPH_C32(0x049f0000), SPH_C32(0x17350000), SPH_C32(0xe67c0000), - SPH_C32(0xe57feec0), SPH_C32(0x76b224a5), SPH_C32(0x31861e28), - SPH_C32(0x75b788ca), SPH_C32(0x23117253), SPH_C32(0x958a0000), - SPH_C32(0x4dd10000), SPH_C32(0x42280000), SPH_C32(0x67ff4a80), - SPH_C32(0x41f318e8), SPH_C32(0xf9d4cdc4), SPH_C32(0x2ecebdd1), - SPH_C32(0xc07b5c7f) }, - { SPH_C32(0x45450000), SPH_C32(0xc8af0000), SPH_C32(0x3de50000), - SPH_C32(0x1700e860), SPH_C32(0xc3a6790e), SPH_C32(0x376f0c67), - SPH_C32(0x37510fed), SPH_C32(0xb755eabc), SPH_C32(0xc7930000), - SPH_C32(0x76a90000), SPH_C32(0x5b200000), SPH_C32(0xcbff4c80), - SPH_C32(0xe1304968), SPH_C32(0xb065be43), SPH_C32(0xd40d6fec), - SPH_C32(0x594e6036) }, - { SPH_C32(0xa36d0000), SPH_C32(0x84e40000), SPH_C32(0x95b00000), - SPH_C32(0xc4d0ea80), SPH_C32(0x1bc749b6), SPH_C32(0xafc8bcbd), - SPH_C32(0x1fc40959), SPH_C32(0x600fa22b), SPH_C32(0x37560000), - SPH_C32(0x2f8a0000), SPH_C32(0x1ea20000), SPH_C32(0x2a724c40), - SPH_C32(0xda5d4f59), SPH_C32(0x7288e8da), SPH_C32(0x1fed91f0), - SPH_C32(0x0fe9d1a9) }, - { SPH_C32(0xb5800000), SPH_C32(0x918c0000), SPH_C32(0x78670000), - SPH_C32(0xf68de8a0), SPH_C32(0xf8cb7f3f), SPH_C32(0xf5825afe), - SPH_C32(0xfcb1f1f1), SPH_C32(0xe1f25b23), SPH_C32(0xd17e0000), - SPH_C32(0x63c10000), SPH_C32(0xb6f70000), SPH_C32(0xf9a24ea0), - SPH_C32(0x023c7fe1), SPH_C32(0xea2f5800), SPH_C32(0x37789744), - SPH_C32(0xd8b3993e) }, - { SPH_C32(0x53a80000), SPH_C32(0xddc70000), SPH_C32(0xd0320000), - SPH_C32(0x255dea40), SPH_C32(0x20aa4f87), SPH_C32(0x6d25ea24), - SPH_C32(0xd424f745), SPH_C32(0x36a813b4), SPH_C32(0x21bb0000), - SPH_C32(0x3ae20000), SPH_C32(0xf3750000), SPH_C32(0x182f4e60), - SPH_C32(0x395179d0), SPH_C32(0x28c20e99), SPH_C32(0xfc986958), - SPH_C32(0x8e1428a1) }, - { SPH_C32(0xf1740000), SPH_C32(0xbf9c0000), SPH_C32(0x8cb80000), - SPH_C32(0x68d0ec80), SPH_C32(0xbb041836), SPH_C32(0xe679cf3a), - SPH_C32(0xe507db64), SPH_C32(0xf93a9e62), SPH_C32(0x24950000), - SPH_C32(0xcb680000), SPH_C32(0xdc330000), SPH_C32(0x740d4ce0), - SPH_C32(0xcf8a4372), SPH_C32(0x3dd08912), SPH_C32(0xa7c8c4ea), - SPH_C32(0x0298750f) }, - { SPH_C32(0x175c0000), SPH_C32(0xf3d70000), SPH_C32(0x24ed0000), - SPH_C32(0xbb00ee60), SPH_C32(0x6365288e), SPH_C32(0x7ede7fe0), - SPH_C32(0xcd92ddd0), SPH_C32(0x2e60d6f5), SPH_C32(0xd4500000), - SPH_C32(0x924b0000), SPH_C32(0x99b10000), SPH_C32(0x95804c20), - SPH_C32(0xf4e74543), SPH_C32(0xff3ddf8b), SPH_C32(0x6c283af6), - SPH_C32(0x543fc490) }, - { SPH_C32(0x01b10000), SPH_C32(0xe6bf0000), SPH_C32(0xc93a0000), - SPH_C32(0x895dec40), SPH_C32(0x80691e07), SPH_C32(0x249499a3), - SPH_C32(0x2ee72578), SPH_C32(0xaf9d2ffd), SPH_C32(0x32780000), - SPH_C32(0xde000000), SPH_C32(0x31e40000), SPH_C32(0x46504ec0), - SPH_C32(0x2c8675fb), SPH_C32(0x679a6f51), SPH_C32(0x44bd3c42), - SPH_C32(0x83658c07) }, - { SPH_C32(0xe7990000), SPH_C32(0xaaf40000), SPH_C32(0x616f0000), - SPH_C32(0x5a8deea0), SPH_C32(0x58082ebf), SPH_C32(0xbc332979), - SPH_C32(0x067223cc), SPH_C32(0x78c7676a), SPH_C32(0xc2bd0000), - SPH_C32(0x87230000), SPH_C32(0x74660000), SPH_C32(0xa7dd4e00), - SPH_C32(0x17eb73ca), SPH_C32(0xa57739c8), SPH_C32(0x8f5dc25e), - SPH_C32(0xd5c23d98) } -}; - -static const sph_u32 T512_56[128][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xa8da0000), SPH_C32(0x96be0000), SPH_C32(0x5c1d0000), - SPH_C32(0x07da0002), SPH_C32(0x7d669583), SPH_C32(0x1f98708a), - SPH_C32(0xbb668808), SPH_C32(0xda878000), SPH_C32(0xabe70000), - SPH_C32(0x9e0d0000), SPH_C32(0xaf270000), SPH_C32(0x3d180005), - SPH_C32(0x2c4f1fd3), SPH_C32(0x74f61695), SPH_C32(0xb5c347eb), - SPH_C32(0x3c5dfffe) }, - { SPH_C32(0x01930000), SPH_C32(0xe7820000), SPH_C32(0xedfb0000), - SPH_C32(0xcf0c000b), SPH_C32(0x8dd08d58), SPH_C32(0xbca3b42e), - SPH_C32(0x063661e1), SPH_C32(0x536f9e7b), SPH_C32(0x92280000), - SPH_C32(0xdc850000), SPH_C32(0x57fa0000), SPH_C32(0x56dc0003), - SPH_C32(0xbae92316), SPH_C32(0x5aefa30c), SPH_C32(0x90cef752), - SPH_C32(0x7b1675d7) }, - { SPH_C32(0xa9490000), SPH_C32(0x713c0000), SPH_C32(0xb1e60000), - SPH_C32(0xc8d60009), SPH_C32(0xf0b618db), SPH_C32(0xa33bc4a4), - SPH_C32(0xbd50e9e9), SPH_C32(0x89e81e7b), SPH_C32(0x39cf0000), - SPH_C32(0x42880000), SPH_C32(0xf8dd0000), SPH_C32(0x6bc40006), - SPH_C32(0x96a63cc5), SPH_C32(0x2e19b599), SPH_C32(0x250db0b9), - SPH_C32(0x474b8a29) }, - { SPH_C32(0x92280000), SPH_C32(0xdc850000), SPH_C32(0x57fa0000), - SPH_C32(0x56dc0003), SPH_C32(0xbae92316), SPH_C32(0x5aefa30c), - SPH_C32(0x90cef752), SPH_C32(0x7b1675d7), SPH_C32(0x93bb0000), - SPH_C32(0x3b070000), SPH_C32(0xba010000), SPH_C32(0x99d00008), - SPH_C32(0x3739ae4e), SPH_C32(0xe64c1722), SPH_C32(0x96f896b3), - SPH_C32(0x2879ebac) }, - { SPH_C32(0x3af20000), SPH_C32(0x4a3b0000), SPH_C32(0x0be70000), - SPH_C32(0x51060001), SPH_C32(0xc78fb695), SPH_C32(0x4577d386), - SPH_C32(0x2ba87f5a), SPH_C32(0xa191f5d7), SPH_C32(0x385c0000), - SPH_C32(0xa50a0000), SPH_C32(0x15260000), SPH_C32(0xa4c8000d), - SPH_C32(0x1b76b19d), SPH_C32(0x92ba01b7), SPH_C32(0x233bd158), - SPH_C32(0x14241452) }, - { SPH_C32(0x93bb0000), SPH_C32(0x3b070000), SPH_C32(0xba010000), - SPH_C32(0x99d00008), SPH_C32(0x3739ae4e), SPH_C32(0xe64c1722), - SPH_C32(0x96f896b3), SPH_C32(0x2879ebac), SPH_C32(0x01930000), - SPH_C32(0xe7820000), SPH_C32(0xedfb0000), SPH_C32(0xcf0c000b), - SPH_C32(0x8dd08d58), SPH_C32(0xbca3b42e), SPH_C32(0x063661e1), - SPH_C32(0x536f9e7b) }, - { SPH_C32(0x3b610000), SPH_C32(0xadb90000), SPH_C32(0xe61c0000), - SPH_C32(0x9e0a000a), SPH_C32(0x4a5f3bcd), SPH_C32(0xf9d467a8), - SPH_C32(0x2d9e1ebb), SPH_C32(0xf2fe6bac), SPH_C32(0xaa740000), - SPH_C32(0x798f0000), SPH_C32(0x42dc0000), SPH_C32(0xf214000e), - SPH_C32(0xa19f928b), SPH_C32(0xc855a2bb), SPH_C32(0xb3f5260a), - SPH_C32(0x6f326185) }, - { SPH_C32(0x5fa80000), SPH_C32(0x56030000), SPH_C32(0x43ae0000), - SPH_C32(0x64f30013), SPH_C32(0x257e86bf), SPH_C32(0x1311944e), - SPH_C32(0x541e95bf), SPH_C32(0x8ea4db69), SPH_C32(0x00440000), - SPH_C32(0x7f480000), SPH_C32(0xda7c0000), SPH_C32(0x2a230001), - SPH_C32(0x3badc9cc), SPH_C32(0xa9b69c87), SPH_C32(0x030a9e60), - SPH_C32(0xbe0a679e) }, - { SPH_C32(0xf7720000), SPH_C32(0xc0bd0000), SPH_C32(0x1fb30000), - SPH_C32(0x63290011), SPH_C32(0x5818133c), SPH_C32(0x0c89e4c4), - SPH_C32(0xef781db7), SPH_C32(0x54235b69), SPH_C32(0xaba30000), - SPH_C32(0xe1450000), SPH_C32(0x755b0000), SPH_C32(0x173b0004), - SPH_C32(0x17e2d61f), SPH_C32(0xdd408a12), SPH_C32(0xb6c9d98b), - SPH_C32(0x82579860) }, - { SPH_C32(0x5e3b0000), SPH_C32(0xb1810000), SPH_C32(0xae550000), - SPH_C32(0xabff0018), SPH_C32(0xa8ae0be7), SPH_C32(0xafb22060), - SPH_C32(0x5228f45e), SPH_C32(0xddcb4512), SPH_C32(0x926c0000), - SPH_C32(0xa3cd0000), SPH_C32(0x8d860000), SPH_C32(0x7cff0002), - SPH_C32(0x8144eada), SPH_C32(0xf3593f8b), SPH_C32(0x93c46932), - SPH_C32(0xc51c1249) }, - { SPH_C32(0xf6e10000), SPH_C32(0x273f0000), SPH_C32(0xf2480000), - SPH_C32(0xac25001a), SPH_C32(0xd5c89e64), SPH_C32(0xb02a50ea), - SPH_C32(0xe94e7c56), SPH_C32(0x074cc512), SPH_C32(0x398b0000), - SPH_C32(0x3dc00000), SPH_C32(0x22a10000), SPH_C32(0x41e70007), - SPH_C32(0xad0bf509), SPH_C32(0x87af291e), SPH_C32(0x26072ed9), - SPH_C32(0xf941edb7) }, - { SPH_C32(0xcd800000), SPH_C32(0x8a860000), SPH_C32(0x14540000), - SPH_C32(0x322f0010), SPH_C32(0x9f97a5a9), SPH_C32(0x49fe3742), - SPH_C32(0xc4d062ed), SPH_C32(0xf5b2aebe), SPH_C32(0x93ff0000), - SPH_C32(0x444f0000), SPH_C32(0x607d0000), SPH_C32(0xb3f30009), - SPH_C32(0x0c946782), SPH_C32(0x4ffa8ba5), SPH_C32(0x95f208d3), - SPH_C32(0x96738c32) }, - { SPH_C32(0x655a0000), SPH_C32(0x1c380000), SPH_C32(0x48490000), - SPH_C32(0x35f50012), SPH_C32(0xe2f1302a), SPH_C32(0x566647c8), - SPH_C32(0x7fb6eae5), SPH_C32(0x2f352ebe), SPH_C32(0x38180000), - SPH_C32(0xda420000), SPH_C32(0xcf5a0000), SPH_C32(0x8eeb000c), - SPH_C32(0x20db7851), SPH_C32(0x3b0c9d30), SPH_C32(0x20314f38), - SPH_C32(0xaa2e73cc) }, - { SPH_C32(0xcc130000), SPH_C32(0x6d040000), SPH_C32(0xf9af0000), - SPH_C32(0xfd23001b), SPH_C32(0x124728f1), SPH_C32(0xf55d836c), - SPH_C32(0xc2e6030c), SPH_C32(0xa6dd30c5), SPH_C32(0x01d70000), - SPH_C32(0x98ca0000), SPH_C32(0x37870000), SPH_C32(0xe52f000a), - SPH_C32(0xb67d4494), SPH_C32(0x151528a9), SPH_C32(0x053cff81), - SPH_C32(0xed65f9e5) }, - { SPH_C32(0x64c90000), SPH_C32(0xfbba0000), SPH_C32(0xa5b20000), - SPH_C32(0xfaf90019), SPH_C32(0x6f21bd72), SPH_C32(0xeac5f3e6), - SPH_C32(0x79808b04), SPH_C32(0x7c5ab0c5), SPH_C32(0xaa300000), - SPH_C32(0x06c70000), SPH_C32(0x98a00000), SPH_C32(0xd837000f), - SPH_C32(0x9a325b47), SPH_C32(0x61e33e3c), SPH_C32(0xb0ffb86a), - SPH_C32(0xd138061b) }, - { SPH_C32(0x00440000), SPH_C32(0x7f480000), SPH_C32(0xda7c0000), - SPH_C32(0x2a230001), SPH_C32(0x3badc9cc), SPH_C32(0xa9b69c87), - SPH_C32(0x030a9e60), SPH_C32(0xbe0a679e), SPH_C32(0x5fec0000), - SPH_C32(0x294b0000), SPH_C32(0x99d20000), SPH_C32(0x4ed00012), - SPH_C32(0x1ed34f73), SPH_C32(0xbaa708c9), SPH_C32(0x57140bdf), - SPH_C32(0x30aebcf7) }, - { SPH_C32(0xa89e0000), SPH_C32(0xe9f60000), SPH_C32(0x86610000), - SPH_C32(0x2df90003), SPH_C32(0x46cb5c4f), SPH_C32(0xb62eec0d), - SPH_C32(0xb86c1668), SPH_C32(0x648de79e), SPH_C32(0xf40b0000), - SPH_C32(0xb7460000), SPH_C32(0x36f50000), SPH_C32(0x73c80017), - SPH_C32(0x329c50a0), SPH_C32(0xce511e5c), SPH_C32(0xe2d74c34), - SPH_C32(0x0cf34309) }, - { SPH_C32(0x01d70000), SPH_C32(0x98ca0000), SPH_C32(0x37870000), - SPH_C32(0xe52f000a), SPH_C32(0xb67d4494), SPH_C32(0x151528a9), - SPH_C32(0x053cff81), SPH_C32(0xed65f9e5), SPH_C32(0xcdc40000), - SPH_C32(0xf5ce0000), SPH_C32(0xce280000), SPH_C32(0x180c0011), - SPH_C32(0xa43a6c65), SPH_C32(0xe048abc5), SPH_C32(0xc7dafc8d), - SPH_C32(0x4bb8c920) }, - { SPH_C32(0xa90d0000), SPH_C32(0x0e740000), SPH_C32(0x6b9a0000), - SPH_C32(0xe2f50008), SPH_C32(0xcb1bd117), SPH_C32(0x0a8d5823), - SPH_C32(0xbe5a7789), SPH_C32(0x37e279e5), SPH_C32(0x66230000), - SPH_C32(0x6bc30000), SPH_C32(0x610f0000), SPH_C32(0x25140014), - SPH_C32(0x887573b6), SPH_C32(0x94bebd50), SPH_C32(0x7219bb66), - SPH_C32(0x77e536de) }, - { SPH_C32(0x926c0000), SPH_C32(0xa3cd0000), SPH_C32(0x8d860000), - SPH_C32(0x7cff0002), SPH_C32(0x8144eada), SPH_C32(0xf3593f8b), - SPH_C32(0x93c46932), SPH_C32(0xc51c1249), SPH_C32(0xcc570000), - SPH_C32(0x124c0000), SPH_C32(0x23d30000), SPH_C32(0xd700001a), - SPH_C32(0x29eae13d), SPH_C32(0x5ceb1feb), SPH_C32(0xc1ec9d6c), - SPH_C32(0x18d7575b) }, - { SPH_C32(0x3ab60000), SPH_C32(0x35730000), SPH_C32(0xd19b0000), - SPH_C32(0x7b250000), SPH_C32(0xfc227f59), SPH_C32(0xecc14f01), - SPH_C32(0x28a2e13a), SPH_C32(0x1f9b9249), SPH_C32(0x67b00000), - SPH_C32(0x8c410000), SPH_C32(0x8cf40000), SPH_C32(0xea18001f), - SPH_C32(0x05a5feee), SPH_C32(0x281d097e), SPH_C32(0x742fda87), - SPH_C32(0x248aa8a5) }, - { SPH_C32(0x93ff0000), SPH_C32(0x444f0000), SPH_C32(0x607d0000), - SPH_C32(0xb3f30009), SPH_C32(0x0c946782), SPH_C32(0x4ffa8ba5), - SPH_C32(0x95f208d3), SPH_C32(0x96738c32), SPH_C32(0x5e7f0000), - SPH_C32(0xcec90000), SPH_C32(0x74290000), SPH_C32(0x81dc0019), - SPH_C32(0x9303c22b), SPH_C32(0x0604bce7), SPH_C32(0x51226a3e), - SPH_C32(0x63c1228c) }, - { SPH_C32(0x3b250000), SPH_C32(0xd2f10000), SPH_C32(0x3c600000), - SPH_C32(0xb429000b), SPH_C32(0x71f2f201), SPH_C32(0x5062fb2f), - SPH_C32(0x2e9480db), SPH_C32(0x4cf40c32), SPH_C32(0xf5980000), - SPH_C32(0x50c40000), SPH_C32(0xdb0e0000), SPH_C32(0xbcc4001c), - SPH_C32(0xbf4cddf8), SPH_C32(0x72f2aa72), SPH_C32(0xe4e12dd5), - SPH_C32(0x5f9cdd72) }, - { SPH_C32(0x5fec0000), SPH_C32(0x294b0000), SPH_C32(0x99d20000), - SPH_C32(0x4ed00012), SPH_C32(0x1ed34f73), SPH_C32(0xbaa708c9), - SPH_C32(0x57140bdf), SPH_C32(0x30aebcf7), SPH_C32(0x5fa80000), - SPH_C32(0x56030000), SPH_C32(0x43ae0000), SPH_C32(0x64f30013), - SPH_C32(0x257e86bf), SPH_C32(0x1311944e), SPH_C32(0x541e95bf), - SPH_C32(0x8ea4db69) }, - { SPH_C32(0xf7360000), SPH_C32(0xbff50000), SPH_C32(0xc5cf0000), - SPH_C32(0x490a0010), SPH_C32(0x63b5daf0), SPH_C32(0xa53f7843), - SPH_C32(0xec7283d7), SPH_C32(0xea293cf7), SPH_C32(0xf44f0000), - SPH_C32(0xc80e0000), SPH_C32(0xec890000), SPH_C32(0x59eb0016), - SPH_C32(0x0931996c), SPH_C32(0x67e782db), SPH_C32(0xe1ddd254), - SPH_C32(0xb2f92497) }, - { SPH_C32(0x5e7f0000), SPH_C32(0xcec90000), SPH_C32(0x74290000), - SPH_C32(0x81dc0019), SPH_C32(0x9303c22b), SPH_C32(0x0604bce7), - SPH_C32(0x51226a3e), SPH_C32(0x63c1228c), SPH_C32(0xcd800000), - SPH_C32(0x8a860000), SPH_C32(0x14540000), SPH_C32(0x322f0010), - SPH_C32(0x9f97a5a9), SPH_C32(0x49fe3742), SPH_C32(0xc4d062ed), - SPH_C32(0xf5b2aebe) }, - { SPH_C32(0xf6a50000), SPH_C32(0x58770000), SPH_C32(0x28340000), - SPH_C32(0x8606001b), SPH_C32(0xee6557a8), SPH_C32(0x199ccc6d), - SPH_C32(0xea44e236), SPH_C32(0xb946a28c), SPH_C32(0x66670000), - SPH_C32(0x148b0000), SPH_C32(0xbb730000), SPH_C32(0x0f370015), - SPH_C32(0xb3d8ba7a), SPH_C32(0x3d0821d7), SPH_C32(0x71132506), - SPH_C32(0xc9ef5140) }, - { SPH_C32(0xcdc40000), SPH_C32(0xf5ce0000), SPH_C32(0xce280000), - SPH_C32(0x180c0011), SPH_C32(0xa43a6c65), SPH_C32(0xe048abc5), - SPH_C32(0xc7dafc8d), SPH_C32(0x4bb8c920), SPH_C32(0xcc130000), - SPH_C32(0x6d040000), SPH_C32(0xf9af0000), SPH_C32(0xfd23001b), - SPH_C32(0x124728f1), SPH_C32(0xf55d836c), SPH_C32(0xc2e6030c), - SPH_C32(0xa6dd30c5) }, - { SPH_C32(0x651e0000), SPH_C32(0x63700000), SPH_C32(0x92350000), - SPH_C32(0x1fd60013), SPH_C32(0xd95cf9e6), SPH_C32(0xffd0db4f), - SPH_C32(0x7cbc7485), SPH_C32(0x913f4920), SPH_C32(0x67f40000), - SPH_C32(0xf3090000), SPH_C32(0x56880000), SPH_C32(0xc03b001e), - SPH_C32(0x3e083722), SPH_C32(0x81ab95f9), SPH_C32(0x772544e7), - SPH_C32(0x9a80cf3b) }, - { SPH_C32(0xcc570000), SPH_C32(0x124c0000), SPH_C32(0x23d30000), - SPH_C32(0xd700001a), SPH_C32(0x29eae13d), SPH_C32(0x5ceb1feb), - SPH_C32(0xc1ec9d6c), SPH_C32(0x18d7575b), SPH_C32(0x5e3b0000), - SPH_C32(0xb1810000), SPH_C32(0xae550000), SPH_C32(0xabff0018), - SPH_C32(0xa8ae0be7), SPH_C32(0xafb22060), SPH_C32(0x5228f45e), - SPH_C32(0xddcb4512) }, - { SPH_C32(0x648d0000), SPH_C32(0x84f20000), SPH_C32(0x7fce0000), - SPH_C32(0xd0da0018), SPH_C32(0x548c74be), SPH_C32(0x43736f61), - SPH_C32(0x7a8a1564), SPH_C32(0xc250d75b), SPH_C32(0xf5dc0000), - SPH_C32(0x2f8c0000), SPH_C32(0x01720000), SPH_C32(0x96e7001d), - SPH_C32(0x84e11434), SPH_C32(0xdb4436f5), SPH_C32(0xe7ebb3b5), - SPH_C32(0xe196baec) }, - { SPH_C32(0xee930000), SPH_C32(0xd6070000), SPH_C32(0x92c10000), - SPH_C32(0x2b9801e0), SPH_C32(0x9451287c), SPH_C32(0x3b6cfb57), - SPH_C32(0x45312374), SPH_C32(0x201f6a64), SPH_C32(0x7b280000), - SPH_C32(0x57420000), SPH_C32(0xa9e50000), SPH_C32(0x634300a0), - SPH_C32(0x9edb442f), SPH_C32(0x6d9995bb), SPH_C32(0x27f83b03), - SPH_C32(0xc7ff60f0) }, - { SPH_C32(0x46490000), SPH_C32(0x40b90000), SPH_C32(0xcedc0000), - SPH_C32(0x2c4201e2), SPH_C32(0xe937bdff), SPH_C32(0x24f48bdd), - SPH_C32(0xfe57ab7c), SPH_C32(0xfa98ea64), SPH_C32(0xd0cf0000), - SPH_C32(0xc94f0000), SPH_C32(0x06c20000), SPH_C32(0x5e5b00a5), - SPH_C32(0xb2945bfc), SPH_C32(0x196f832e), SPH_C32(0x923b7ce8), - SPH_C32(0xfba29f0e) }, - { SPH_C32(0xef000000), SPH_C32(0x31850000), SPH_C32(0x7f3a0000), - SPH_C32(0xe49401eb), SPH_C32(0x1981a524), SPH_C32(0x87cf4f79), - SPH_C32(0x43074295), SPH_C32(0x7370f41f), SPH_C32(0xe9000000), - SPH_C32(0x8bc70000), SPH_C32(0xfe1f0000), SPH_C32(0x359f00a3), - SPH_C32(0x24326739), SPH_C32(0x377636b7), SPH_C32(0xb736cc51), - SPH_C32(0xbce91527) }, - { SPH_C32(0x47da0000), SPH_C32(0xa73b0000), SPH_C32(0x23270000), - SPH_C32(0xe34e01e9), SPH_C32(0x64e730a7), SPH_C32(0x98573ff3), - SPH_C32(0xf861ca9d), SPH_C32(0xa9f7741f), SPH_C32(0x42e70000), - SPH_C32(0x15ca0000), SPH_C32(0x51380000), SPH_C32(0x088700a6), - SPH_C32(0x087d78ea), SPH_C32(0x43802022), SPH_C32(0x02f58bba), - SPH_C32(0x80b4ead9) }, - { SPH_C32(0x7cbb0000), SPH_C32(0x0a820000), SPH_C32(0xc53b0000), - SPH_C32(0x7d4401e3), SPH_C32(0x2eb80b6a), SPH_C32(0x6183585b), - SPH_C32(0xd5ffd426), SPH_C32(0x5b091fb3), SPH_C32(0xe8930000), - SPH_C32(0x6c450000), SPH_C32(0x13e40000), SPH_C32(0xfa9300a8), - SPH_C32(0xa9e2ea61), SPH_C32(0x8bd58299), SPH_C32(0xb100adb0), - SPH_C32(0xef868b5c) }, - { SPH_C32(0xd4610000), SPH_C32(0x9c3c0000), SPH_C32(0x99260000), - SPH_C32(0x7a9e01e1), SPH_C32(0x53de9ee9), SPH_C32(0x7e1b28d1), - SPH_C32(0x6e995c2e), SPH_C32(0x818e9fb3), SPH_C32(0x43740000), - SPH_C32(0xf2480000), SPH_C32(0xbcc30000), SPH_C32(0xc78b00ad), - SPH_C32(0x85adf5b2), SPH_C32(0xff23940c), SPH_C32(0x04c3ea5b), - SPH_C32(0xd3db74a2) }, - { SPH_C32(0x7d280000), SPH_C32(0xed000000), SPH_C32(0x28c00000), - SPH_C32(0xb24801e8), SPH_C32(0xa3688632), SPH_C32(0xdd20ec75), - SPH_C32(0xd3c9b5c7), SPH_C32(0x086681c8), SPH_C32(0x7abb0000), - SPH_C32(0xb0c00000), SPH_C32(0x441e0000), SPH_C32(0xac4f00ab), - SPH_C32(0x130bc977), SPH_C32(0xd13a2195), SPH_C32(0x21ce5ae2), - SPH_C32(0x9490fe8b) }, - { SPH_C32(0xd5f20000), SPH_C32(0x7bbe0000), SPH_C32(0x74dd0000), - SPH_C32(0xb59201ea), SPH_C32(0xde0e13b1), SPH_C32(0xc2b89cff), - SPH_C32(0x68af3dcf), SPH_C32(0xd2e101c8), SPH_C32(0xd15c0000), - SPH_C32(0x2ecd0000), SPH_C32(0xeb390000), SPH_C32(0x915700ae), - SPH_C32(0x3f44d6a4), SPH_C32(0xa5cc3700), SPH_C32(0x940d1d09), - SPH_C32(0xa8cd0175) }, - { SPH_C32(0xb13b0000), SPH_C32(0x80040000), SPH_C32(0xd16f0000), - SPH_C32(0x4f6b01f3), SPH_C32(0xb12faec3), SPH_C32(0x287d6f19), - SPH_C32(0x112fb6cb), SPH_C32(0xaebbb10d), SPH_C32(0x7b6c0000), - SPH_C32(0x280a0000), SPH_C32(0x73990000), SPH_C32(0x496000a1), - SPH_C32(0xa5768de3), SPH_C32(0xc42f093c), SPH_C32(0x24f2a563), - SPH_C32(0x79f5076e) }, - { SPH_C32(0x19e10000), SPH_C32(0x16ba0000), SPH_C32(0x8d720000), - SPH_C32(0x48b101f1), SPH_C32(0xcc493b40), SPH_C32(0x37e51f93), - SPH_C32(0xaa493ec3), SPH_C32(0x743c310d), SPH_C32(0xd08b0000), - SPH_C32(0xb6070000), SPH_C32(0xdcbe0000), SPH_C32(0x747800a4), - SPH_C32(0x89399230), SPH_C32(0xb0d91fa9), SPH_C32(0x9131e288), - SPH_C32(0x45a8f890) }, - { SPH_C32(0xb0a80000), SPH_C32(0x67860000), SPH_C32(0x3c940000), - SPH_C32(0x806701f8), SPH_C32(0x3cff239b), SPH_C32(0x94dedb37), - SPH_C32(0x1719d72a), SPH_C32(0xfdd42f76), SPH_C32(0xe9440000), - SPH_C32(0xf48f0000), SPH_C32(0x24630000), SPH_C32(0x1fbc00a2), - SPH_C32(0x1f9faef5), SPH_C32(0x9ec0aa30), SPH_C32(0xb43c5231), - SPH_C32(0x02e372b9) }, - { SPH_C32(0x18720000), SPH_C32(0xf1380000), SPH_C32(0x60890000), - SPH_C32(0x87bd01fa), SPH_C32(0x4199b618), SPH_C32(0x8b46abbd), - SPH_C32(0xac7f5f22), SPH_C32(0x2753af76), SPH_C32(0x42a30000), - SPH_C32(0x6a820000), SPH_C32(0x8b440000), SPH_C32(0x22a400a7), - SPH_C32(0x33d0b126), SPH_C32(0xea36bca5), SPH_C32(0x01ff15da), - SPH_C32(0x3ebe8d47) }, - { SPH_C32(0x23130000), SPH_C32(0x5c810000), SPH_C32(0x86950000), - SPH_C32(0x19b701f0), SPH_C32(0x0bc68dd5), SPH_C32(0x7292cc15), - SPH_C32(0x81e14199), SPH_C32(0xd5adc4da), SPH_C32(0xe8d70000), - SPH_C32(0x130d0000), SPH_C32(0xc9980000), SPH_C32(0xd0b000a9), - SPH_C32(0x924f23ad), SPH_C32(0x22631e1e), SPH_C32(0xb20a33d0), - SPH_C32(0x518cecc2) }, - { SPH_C32(0x8bc90000), SPH_C32(0xca3f0000), SPH_C32(0xda880000), - SPH_C32(0x1e6d01f2), SPH_C32(0x76a01856), SPH_C32(0x6d0abc9f), - SPH_C32(0x3a87c991), SPH_C32(0x0f2a44da), SPH_C32(0x43300000), - SPH_C32(0x8d000000), SPH_C32(0x66bf0000), SPH_C32(0xeda800ac), - SPH_C32(0xbe003c7e), SPH_C32(0x5695088b), SPH_C32(0x07c9743b), - SPH_C32(0x6dd1133c) }, - { SPH_C32(0x22800000), SPH_C32(0xbb030000), SPH_C32(0x6b6e0000), - SPH_C32(0xd6bb01fb), SPH_C32(0x8616008d), SPH_C32(0xce31783b), - SPH_C32(0x87d72078), SPH_C32(0x86c25aa1), SPH_C32(0x7aff0000), - SPH_C32(0xcf880000), SPH_C32(0x9e620000), SPH_C32(0x866c00aa), - SPH_C32(0x28a600bb), SPH_C32(0x788cbd12), SPH_C32(0x22c4c482), - SPH_C32(0x2a9a9915) }, - { SPH_C32(0x8a5a0000), SPH_C32(0x2dbd0000), SPH_C32(0x37730000), - SPH_C32(0xd16101f9), SPH_C32(0xfb70950e), SPH_C32(0xd1a908b1), - SPH_C32(0x3cb1a870), SPH_C32(0x5c45daa1), SPH_C32(0xd1180000), - SPH_C32(0x51850000), SPH_C32(0x31450000), SPH_C32(0xbb7400af), - SPH_C32(0x04e91f68), SPH_C32(0x0c7aab87), SPH_C32(0x97078369), - SPH_C32(0x16c766eb) }, - { SPH_C32(0xeed70000), SPH_C32(0xa94f0000), SPH_C32(0x48bd0000), - SPH_C32(0x01bb01e1), SPH_C32(0xaffce1b0), SPH_C32(0x92da67d0), - SPH_C32(0x463bbd14), SPH_C32(0x9e150dfa), SPH_C32(0x24c40000), - SPH_C32(0x7e090000), SPH_C32(0x30370000), SPH_C32(0x2d9300b2), - SPH_C32(0x80080b5c), SPH_C32(0xd73e9d72), SPH_C32(0x70ec30dc), - SPH_C32(0xf751dc07) }, - { SPH_C32(0x460d0000), SPH_C32(0x3ff10000), SPH_C32(0x14a00000), - SPH_C32(0x066101e3), SPH_C32(0xd29a7433), SPH_C32(0x8d42175a), - SPH_C32(0xfd5d351c), SPH_C32(0x44928dfa), SPH_C32(0x8f230000), - SPH_C32(0xe0040000), SPH_C32(0x9f100000), SPH_C32(0x108b00b7), - SPH_C32(0xac47148f), SPH_C32(0xa3c88be7), SPH_C32(0xc52f7737), - SPH_C32(0xcb0c23f9) }, - { SPH_C32(0xef440000), SPH_C32(0x4ecd0000), SPH_C32(0xa5460000), - SPH_C32(0xceb701ea), SPH_C32(0x222c6ce8), SPH_C32(0x2e79d3fe), - SPH_C32(0x400ddcf5), SPH_C32(0xcd7a9381), SPH_C32(0xb6ec0000), - SPH_C32(0xa28c0000), SPH_C32(0x67cd0000), SPH_C32(0x7b4f00b1), - SPH_C32(0x3ae1284a), SPH_C32(0x8dd13e7e), SPH_C32(0xe022c78e), - SPH_C32(0x8c47a9d0) }, - { SPH_C32(0x479e0000), SPH_C32(0xd8730000), SPH_C32(0xf95b0000), - SPH_C32(0xc96d01e8), SPH_C32(0x5f4af96b), SPH_C32(0x31e1a374), - SPH_C32(0xfb6b54fd), SPH_C32(0x17fd1381), SPH_C32(0x1d0b0000), - SPH_C32(0x3c810000), SPH_C32(0xc8ea0000), SPH_C32(0x465700b4), - SPH_C32(0x16ae3799), SPH_C32(0xf92728eb), SPH_C32(0x55e18065), - SPH_C32(0xb01a562e) }, - { SPH_C32(0x7cff0000), SPH_C32(0x75ca0000), SPH_C32(0x1f470000), - SPH_C32(0x576701e2), SPH_C32(0x1515c2a6), SPH_C32(0xc835c4dc), - SPH_C32(0xd6f54a46), SPH_C32(0xe503782d), SPH_C32(0xb77f0000), - SPH_C32(0x450e0000), SPH_C32(0x8a360000), SPH_C32(0xb44300ba), - SPH_C32(0xb731a512), SPH_C32(0x31728a50), SPH_C32(0xe614a66f), - SPH_C32(0xdf2837ab) }, - { SPH_C32(0xd4250000), SPH_C32(0xe3740000), SPH_C32(0x435a0000), - SPH_C32(0x50bd01e0), SPH_C32(0x68735725), SPH_C32(0xd7adb456), - SPH_C32(0x6d93c24e), SPH_C32(0x3f84f82d), SPH_C32(0x1c980000), - SPH_C32(0xdb030000), SPH_C32(0x25110000), SPH_C32(0x895b00bf), - SPH_C32(0x9b7ebac1), SPH_C32(0x45849cc5), SPH_C32(0x53d7e184), - SPH_C32(0xe375c855) }, - { SPH_C32(0x7d6c0000), SPH_C32(0x92480000), SPH_C32(0xf2bc0000), - SPH_C32(0x986b01e9), SPH_C32(0x98c54ffe), SPH_C32(0x749670f2), - SPH_C32(0xd0c32ba7), SPH_C32(0xb66ce656), SPH_C32(0x25570000), - SPH_C32(0x998b0000), SPH_C32(0xddcc0000), SPH_C32(0xe29f00b9), - SPH_C32(0x0dd88604), SPH_C32(0x6b9d295c), SPH_C32(0x76da513d), - SPH_C32(0xa43e427c) }, - { SPH_C32(0xd5b60000), SPH_C32(0x04f60000), SPH_C32(0xaea10000), - SPH_C32(0x9fb101eb), SPH_C32(0xe5a3da7d), SPH_C32(0x6b0e0078), - SPH_C32(0x6ba5a3af), SPH_C32(0x6ceb6656), SPH_C32(0x8eb00000), - SPH_C32(0x07860000), SPH_C32(0x72eb0000), SPH_C32(0xdf8700bc), - SPH_C32(0x219799d7), SPH_C32(0x1f6b3fc9), SPH_C32(0xc31916d6), - SPH_C32(0x9863bd82) }, - { SPH_C32(0xb17f0000), SPH_C32(0xff4c0000), SPH_C32(0x0b130000), - SPH_C32(0x654801f2), SPH_C32(0x8a82670f), SPH_C32(0x81cbf39e), - SPH_C32(0x122528ab), SPH_C32(0x10b1d693), SPH_C32(0x24800000), - SPH_C32(0x01410000), SPH_C32(0xea4b0000), SPH_C32(0x07b000b3), - SPH_C32(0xbba5c290), SPH_C32(0x7e8801f5), SPH_C32(0x73e6aebc), - SPH_C32(0x495bbb99) }, - { SPH_C32(0x19a50000), SPH_C32(0x69f20000), SPH_C32(0x570e0000), - SPH_C32(0x629201f0), SPH_C32(0xf7e4f28c), SPH_C32(0x9e538314), - SPH_C32(0xa943a0a3), SPH_C32(0xca365693), SPH_C32(0x8f670000), - SPH_C32(0x9f4c0000), SPH_C32(0x456c0000), SPH_C32(0x3aa800b6), - SPH_C32(0x97eadd43), SPH_C32(0x0a7e1760), SPH_C32(0xc625e957), - SPH_C32(0x75064467) }, - { SPH_C32(0xb0ec0000), SPH_C32(0x18ce0000), SPH_C32(0xe6e80000), - SPH_C32(0xaa4401f9), SPH_C32(0x0752ea57), SPH_C32(0x3d6847b0), - SPH_C32(0x1413494a), SPH_C32(0x43de48e8), SPH_C32(0xb6a80000), - SPH_C32(0xddc40000), SPH_C32(0xbdb10000), SPH_C32(0x516c00b0), - SPH_C32(0x014ce186), SPH_C32(0x2467a2f9), SPH_C32(0xe32859ee), - SPH_C32(0x324dce4e) }, - { SPH_C32(0x18360000), SPH_C32(0x8e700000), SPH_C32(0xbaf50000), - SPH_C32(0xad9e01fb), SPH_C32(0x7a347fd4), SPH_C32(0x22f0373a), - SPH_C32(0xaf75c142), SPH_C32(0x9959c8e8), SPH_C32(0x1d4f0000), - SPH_C32(0x43c90000), SPH_C32(0x12960000), SPH_C32(0x6c7400b5), - SPH_C32(0x2d03fe55), SPH_C32(0x5091b46c), SPH_C32(0x56eb1e05), - SPH_C32(0x0e1031b0) }, - { SPH_C32(0x23570000), SPH_C32(0x23c90000), SPH_C32(0x5ce90000), - SPH_C32(0x339401f1), SPH_C32(0x306b4419), SPH_C32(0xdb245092), - SPH_C32(0x82ebdff9), SPH_C32(0x6ba7a344), SPH_C32(0xb73b0000), - SPH_C32(0x3a460000), SPH_C32(0x504a0000), SPH_C32(0x9e6000bb), - SPH_C32(0x8c9c6cde), SPH_C32(0x98c416d7), SPH_C32(0xe51e380f), - SPH_C32(0x61225035) }, - { SPH_C32(0x8b8d0000), SPH_C32(0xb5770000), SPH_C32(0x00f40000), - SPH_C32(0x344e01f3), SPH_C32(0x4d0dd19a), SPH_C32(0xc4bc2018), - SPH_C32(0x398d57f1), SPH_C32(0xb1202344), SPH_C32(0x1cdc0000), - SPH_C32(0xa44b0000), SPH_C32(0xff6d0000), SPH_C32(0xa37800be), - SPH_C32(0xa0d3730d), SPH_C32(0xec320042), SPH_C32(0x50dd7fe4), - SPH_C32(0x5d7fafcb) }, - { SPH_C32(0x22c40000), SPH_C32(0xc44b0000), SPH_C32(0xb1120000), - SPH_C32(0xfc9801fa), SPH_C32(0xbdbbc941), SPH_C32(0x6787e4bc), - SPH_C32(0x84ddbe18), SPH_C32(0x38c83d3f), SPH_C32(0x25130000), - SPH_C32(0xe6c30000), SPH_C32(0x07b00000), SPH_C32(0xc8bc00b8), - SPH_C32(0x36754fc8), SPH_C32(0xc22bb5db), SPH_C32(0x75d0cf5d), - SPH_C32(0x1a3425e2) }, - { SPH_C32(0x8a1e0000), SPH_C32(0x52f50000), SPH_C32(0xed0f0000), - SPH_C32(0xfb4201f8), SPH_C32(0xc0dd5cc2), SPH_C32(0x781f9436), - SPH_C32(0x3fbb3610), SPH_C32(0xe24fbd3f), SPH_C32(0x8ef40000), - SPH_C32(0x78ce0000), SPH_C32(0xa8970000), SPH_C32(0xf5a400bd), - SPH_C32(0x1a3a501b), SPH_C32(0xb6dda34e), SPH_C32(0xc01388b6), - SPH_C32(0x2669da1c) }, - { SPH_C32(0x7b280000), SPH_C32(0x57420000), SPH_C32(0xa9e50000), - SPH_C32(0x634300a0), SPH_C32(0x9edb442f), SPH_C32(0x6d9995bb), - SPH_C32(0x27f83b03), SPH_C32(0xc7ff60f0), SPH_C32(0x95bb0000), - SPH_C32(0x81450000), SPH_C32(0x3b240000), SPH_C32(0x48db0140), - SPH_C32(0x0a8a6c53), SPH_C32(0x56f56eec), SPH_C32(0x62c91877), - SPH_C32(0xe7e00a94) }, - { SPH_C32(0xd3f20000), SPH_C32(0xc1fc0000), SPH_C32(0xf5f80000), - SPH_C32(0x649900a2), SPH_C32(0xe3bdd1ac), SPH_C32(0x7201e531), - SPH_C32(0x9c9eb30b), SPH_C32(0x1d78e0f0), SPH_C32(0x3e5c0000), - SPH_C32(0x1f480000), SPH_C32(0x94030000), SPH_C32(0x75c30145), - SPH_C32(0x26c57380), SPH_C32(0x22037879), SPH_C32(0xd70a5f9c), - SPH_C32(0xdbbdf56a) }, - { SPH_C32(0x7abb0000), SPH_C32(0xb0c00000), SPH_C32(0x441e0000), - SPH_C32(0xac4f00ab), SPH_C32(0x130bc977), SPH_C32(0xd13a2195), - SPH_C32(0x21ce5ae2), SPH_C32(0x9490fe8b), SPH_C32(0x07930000), - SPH_C32(0x5dc00000), SPH_C32(0x6cde0000), SPH_C32(0x1e070143), - SPH_C32(0xb0634f45), SPH_C32(0x0c1acde0), SPH_C32(0xf207ef25), - SPH_C32(0x9cf67f43) }, - { SPH_C32(0xd2610000), SPH_C32(0x267e0000), SPH_C32(0x18030000), - SPH_C32(0xab9500a9), SPH_C32(0x6e6d5cf4), SPH_C32(0xcea2511f), - SPH_C32(0x9aa8d2ea), SPH_C32(0x4e177e8b), SPH_C32(0xac740000), - SPH_C32(0xc3cd0000), SPH_C32(0xc3f90000), SPH_C32(0x231f0146), - SPH_C32(0x9c2c5096), SPH_C32(0x78ecdb75), SPH_C32(0x47c4a8ce), - SPH_C32(0xa0ab80bd) }, - { SPH_C32(0xe9000000), SPH_C32(0x8bc70000), SPH_C32(0xfe1f0000), - SPH_C32(0x359f00a3), SPH_C32(0x24326739), SPH_C32(0x377636b7), - SPH_C32(0xb736cc51), SPH_C32(0xbce91527), SPH_C32(0x06000000), - SPH_C32(0xba420000), SPH_C32(0x81250000), SPH_C32(0xd10b0148), - SPH_C32(0x3db3c21d), SPH_C32(0xb0b979ce), SPH_C32(0xf4318ec4), - SPH_C32(0xcf99e138) }, - { SPH_C32(0x41da0000), SPH_C32(0x1d790000), SPH_C32(0xa2020000), - SPH_C32(0x324500a1), SPH_C32(0x5954f2ba), SPH_C32(0x28ee463d), - SPH_C32(0x0c504459), SPH_C32(0x666e9527), SPH_C32(0xade70000), - SPH_C32(0x244f0000), SPH_C32(0x2e020000), SPH_C32(0xec13014d), - SPH_C32(0x11fcddce), SPH_C32(0xc44f6f5b), SPH_C32(0x41f2c92f), - SPH_C32(0xf3c41ec6) }, - { SPH_C32(0xe8930000), SPH_C32(0x6c450000), SPH_C32(0x13e40000), - SPH_C32(0xfa9300a8), SPH_C32(0xa9e2ea61), SPH_C32(0x8bd58299), - SPH_C32(0xb100adb0), SPH_C32(0xef868b5c), SPH_C32(0x94280000), - SPH_C32(0x66c70000), SPH_C32(0xd6df0000), SPH_C32(0x87d7014b), - SPH_C32(0x875ae10b), SPH_C32(0xea56dac2), SPH_C32(0x64ff7996), - SPH_C32(0xb48f94ef) }, - { SPH_C32(0x40490000), SPH_C32(0xfafb0000), SPH_C32(0x4ff90000), - SPH_C32(0xfd4900aa), SPH_C32(0xd4847fe2), SPH_C32(0x944df213), - SPH_C32(0x0a6625b8), SPH_C32(0x35010b5c), SPH_C32(0x3fcf0000), - SPH_C32(0xf8ca0000), SPH_C32(0x79f80000), SPH_C32(0xbacf014e), - SPH_C32(0xab15fed8), SPH_C32(0x9ea0cc57), SPH_C32(0xd13c3e7d), - SPH_C32(0x88d26b11) }, - { SPH_C32(0x24800000), SPH_C32(0x01410000), SPH_C32(0xea4b0000), - SPH_C32(0x07b000b3), SPH_C32(0xbba5c290), SPH_C32(0x7e8801f5), - SPH_C32(0x73e6aebc), SPH_C32(0x495bbb99), SPH_C32(0x95ff0000), - SPH_C32(0xfe0d0000), SPH_C32(0xe1580000), SPH_C32(0x62f80141), - SPH_C32(0x3127a59f), SPH_C32(0xff43f26b), SPH_C32(0x61c38617), - SPH_C32(0x59ea6d0a) }, - { SPH_C32(0x8c5a0000), SPH_C32(0x97ff0000), SPH_C32(0xb6560000), - SPH_C32(0x006a00b1), SPH_C32(0xc6c35713), SPH_C32(0x6110717f), - SPH_C32(0xc88026b4), SPH_C32(0x93dc3b99), SPH_C32(0x3e180000), - SPH_C32(0x60000000), SPH_C32(0x4e7f0000), SPH_C32(0x5fe00144), - SPH_C32(0x1d68ba4c), SPH_C32(0x8bb5e4fe), SPH_C32(0xd400c1fc), - SPH_C32(0x65b792f4) }, - { SPH_C32(0x25130000), SPH_C32(0xe6c30000), SPH_C32(0x07b00000), - SPH_C32(0xc8bc00b8), SPH_C32(0x36754fc8), SPH_C32(0xc22bb5db), - SPH_C32(0x75d0cf5d), SPH_C32(0x1a3425e2), SPH_C32(0x07d70000), - SPH_C32(0x22880000), SPH_C32(0xb6a20000), SPH_C32(0x34240142), - SPH_C32(0x8bce8689), SPH_C32(0xa5ac5167), SPH_C32(0xf10d7145), - SPH_C32(0x22fc18dd) }, - { SPH_C32(0x8dc90000), SPH_C32(0x707d0000), SPH_C32(0x5bad0000), - SPH_C32(0xcf6600ba), SPH_C32(0x4b13da4b), SPH_C32(0xddb3c551), - SPH_C32(0xceb64755), SPH_C32(0xc0b3a5e2), SPH_C32(0xac300000), - SPH_C32(0xbc850000), SPH_C32(0x19850000), SPH_C32(0x093c0147), - SPH_C32(0xa781995a), SPH_C32(0xd15a47f2), SPH_C32(0x44ce36ae), - SPH_C32(0x1ea1e723) }, - { SPH_C32(0xb6a80000), SPH_C32(0xddc40000), SPH_C32(0xbdb10000), - SPH_C32(0x516c00b0), SPH_C32(0x014ce186), SPH_C32(0x2467a2f9), - SPH_C32(0xe32859ee), SPH_C32(0x324dce4e), SPH_C32(0x06440000), - SPH_C32(0xc50a0000), SPH_C32(0x5b590000), SPH_C32(0xfb280149), - SPH_C32(0x061e0bd1), SPH_C32(0x190fe549), SPH_C32(0xf73b10a4), - SPH_C32(0x719386a6) }, - { SPH_C32(0x1e720000), SPH_C32(0x4b7a0000), SPH_C32(0xe1ac0000), - SPH_C32(0x56b600b2), SPH_C32(0x7c2a7405), SPH_C32(0x3bffd273), - SPH_C32(0x584ed1e6), SPH_C32(0xe8ca4e4e), SPH_C32(0xada30000), - SPH_C32(0x5b070000), SPH_C32(0xf47e0000), SPH_C32(0xc630014c), - SPH_C32(0x2a511402), SPH_C32(0x6df9f3dc), SPH_C32(0x42f8574f), - SPH_C32(0x4dce7958) }, - { SPH_C32(0xb73b0000), SPH_C32(0x3a460000), SPH_C32(0x504a0000), - SPH_C32(0x9e6000bb), SPH_C32(0x8c9c6cde), SPH_C32(0x98c416d7), - SPH_C32(0xe51e380f), SPH_C32(0x61225035), SPH_C32(0x946c0000), - SPH_C32(0x198f0000), SPH_C32(0x0ca30000), SPH_C32(0xadf4014a), - SPH_C32(0xbcf728c7), SPH_C32(0x43e04645), SPH_C32(0x67f5e7f6), - SPH_C32(0x0a85f371) }, - { SPH_C32(0x1fe10000), SPH_C32(0xacf80000), SPH_C32(0x0c570000), - SPH_C32(0x99ba00b9), SPH_C32(0xf1faf95d), SPH_C32(0x875c665d), - SPH_C32(0x5e78b007), SPH_C32(0xbba5d035), SPH_C32(0x3f8b0000), - SPH_C32(0x87820000), SPH_C32(0xa3840000), SPH_C32(0x90ec014f), - SPH_C32(0x90b83714), SPH_C32(0x371650d0), SPH_C32(0xd236a01d), - SPH_C32(0x36d80c8f) }, - { SPH_C32(0x7b6c0000), SPH_C32(0x280a0000), SPH_C32(0x73990000), - SPH_C32(0x496000a1), SPH_C32(0xa5768de3), SPH_C32(0xc42f093c), - SPH_C32(0x24f2a563), SPH_C32(0x79f5076e), SPH_C32(0xca570000), - SPH_C32(0xa80e0000), SPH_C32(0xa2f60000), SPH_C32(0x060b0152), - SPH_C32(0x14592320), SPH_C32(0xec526625), SPH_C32(0x35dd13a8), - SPH_C32(0xd74eb663) }, - { SPH_C32(0xd3b60000), SPH_C32(0xbeb40000), SPH_C32(0x2f840000), - SPH_C32(0x4eba00a3), SPH_C32(0xd8101860), SPH_C32(0xdbb779b6), - SPH_C32(0x9f942d6b), SPH_C32(0xa372876e), SPH_C32(0x61b00000), - SPH_C32(0x36030000), SPH_C32(0x0dd10000), SPH_C32(0x3b130157), - SPH_C32(0x38163cf3), SPH_C32(0x98a470b0), SPH_C32(0x801e5443), - SPH_C32(0xeb13499d) }, - { SPH_C32(0x7aff0000), SPH_C32(0xcf880000), SPH_C32(0x9e620000), - SPH_C32(0x866c00aa), SPH_C32(0x28a600bb), SPH_C32(0x788cbd12), - SPH_C32(0x22c4c482), SPH_C32(0x2a9a9915), SPH_C32(0x587f0000), - SPH_C32(0x748b0000), SPH_C32(0xf50c0000), SPH_C32(0x50d70151), - SPH_C32(0xaeb00036), SPH_C32(0xb6bdc529), SPH_C32(0xa513e4fa), - SPH_C32(0xac58c3b4) }, - { SPH_C32(0xd2250000), SPH_C32(0x59360000), SPH_C32(0xc27f0000), - SPH_C32(0x81b600a8), SPH_C32(0x55c09538), SPH_C32(0x6714cd98), - SPH_C32(0x99a24c8a), SPH_C32(0xf01d1915), SPH_C32(0xf3980000), - SPH_C32(0xea860000), SPH_C32(0x5a2b0000), SPH_C32(0x6dcf0154), - SPH_C32(0x82ff1fe5), SPH_C32(0xc24bd3bc), SPH_C32(0x10d0a311), - SPH_C32(0x90053c4a) }, - { SPH_C32(0xe9440000), SPH_C32(0xf48f0000), SPH_C32(0x24630000), - SPH_C32(0x1fbc00a2), SPH_C32(0x1f9faef5), SPH_C32(0x9ec0aa30), - SPH_C32(0xb43c5231), SPH_C32(0x02e372b9), SPH_C32(0x59ec0000), - SPH_C32(0x93090000), SPH_C32(0x18f70000), SPH_C32(0x9fdb015a), - SPH_C32(0x23608d6e), SPH_C32(0x0a1e7107), SPH_C32(0xa325851b), - SPH_C32(0xff375dcf) }, - { SPH_C32(0x419e0000), SPH_C32(0x62310000), SPH_C32(0x787e0000), - SPH_C32(0x186600a0), SPH_C32(0x62f93b76), SPH_C32(0x8158daba), - SPH_C32(0x0f5ada39), SPH_C32(0xd864f2b9), SPH_C32(0xf20b0000), - SPH_C32(0x0d040000), SPH_C32(0xb7d00000), SPH_C32(0xa2c3015f), - SPH_C32(0x0f2f92bd), SPH_C32(0x7ee86792), SPH_C32(0x16e6c2f0), - SPH_C32(0xc36aa231) }, - { SPH_C32(0xe8d70000), SPH_C32(0x130d0000), SPH_C32(0xc9980000), - SPH_C32(0xd0b000a9), SPH_C32(0x924f23ad), SPH_C32(0x22631e1e), - SPH_C32(0xb20a33d0), SPH_C32(0x518cecc2), SPH_C32(0xcbc40000), - SPH_C32(0x4f8c0000), SPH_C32(0x4f0d0000), SPH_C32(0xc9070159), - SPH_C32(0x9989ae78), SPH_C32(0x50f1d20b), SPH_C32(0x33eb7249), - SPH_C32(0x84212818) }, - { SPH_C32(0x400d0000), SPH_C32(0x85b30000), SPH_C32(0x95850000), - SPH_C32(0xd76a00ab), SPH_C32(0xef29b62e), SPH_C32(0x3dfb6e94), - SPH_C32(0x096cbbd8), SPH_C32(0x8b0b6cc2), SPH_C32(0x60230000), - SPH_C32(0xd1810000), SPH_C32(0xe02a0000), SPH_C32(0xf41f015c), - SPH_C32(0xb5c6b1ab), SPH_C32(0x2407c49e), SPH_C32(0x862835a2), - SPH_C32(0xb87cd7e6) }, - { SPH_C32(0x24c40000), SPH_C32(0x7e090000), SPH_C32(0x30370000), - SPH_C32(0x2d9300b2), SPH_C32(0x80080b5c), SPH_C32(0xd73e9d72), - SPH_C32(0x70ec30dc), SPH_C32(0xf751dc07), SPH_C32(0xca130000), - SPH_C32(0xd7460000), SPH_C32(0x788a0000), SPH_C32(0x2c280153), - SPH_C32(0x2ff4eaec), SPH_C32(0x45e4faa2), SPH_C32(0x36d78dc8), - SPH_C32(0x6944d1fd) }, - { SPH_C32(0x8c1e0000), SPH_C32(0xe8b70000), SPH_C32(0x6c2a0000), - SPH_C32(0x2a4900b0), SPH_C32(0xfd6e9edf), SPH_C32(0xc8a6edf8), - SPH_C32(0xcb8ab8d4), SPH_C32(0x2dd65c07), SPH_C32(0x61f40000), - SPH_C32(0x494b0000), SPH_C32(0xd7ad0000), SPH_C32(0x11300156), - SPH_C32(0x03bbf53f), SPH_C32(0x3112ec37), SPH_C32(0x8314ca23), - SPH_C32(0x55192e03) }, - { SPH_C32(0x25570000), SPH_C32(0x998b0000), SPH_C32(0xddcc0000), - SPH_C32(0xe29f00b9), SPH_C32(0x0dd88604), SPH_C32(0x6b9d295c), - SPH_C32(0x76da513d), SPH_C32(0xa43e427c), SPH_C32(0x583b0000), - SPH_C32(0x0bc30000), SPH_C32(0x2f700000), SPH_C32(0x7af40150), - SPH_C32(0x951dc9fa), SPH_C32(0x1f0b59ae), SPH_C32(0xa6197a9a), - SPH_C32(0x1252a42a) }, - { SPH_C32(0x8d8d0000), SPH_C32(0x0f350000), SPH_C32(0x81d10000), - SPH_C32(0xe54500bb), SPH_C32(0x70be1387), SPH_C32(0x740559d6), - SPH_C32(0xcdbcd935), SPH_C32(0x7eb9c27c), SPH_C32(0xf3dc0000), - SPH_C32(0x95ce0000), SPH_C32(0x80570000), SPH_C32(0x47ec0155), - SPH_C32(0xb952d629), SPH_C32(0x6bfd4f3b), SPH_C32(0x13da3d71), - SPH_C32(0x2e0f5bd4) }, - { SPH_C32(0xb6ec0000), SPH_C32(0xa28c0000), SPH_C32(0x67cd0000), - SPH_C32(0x7b4f00b1), SPH_C32(0x3ae1284a), SPH_C32(0x8dd13e7e), - SPH_C32(0xe022c78e), SPH_C32(0x8c47a9d0), SPH_C32(0x59a80000), - SPH_C32(0xec410000), SPH_C32(0xc28b0000), SPH_C32(0xb5f8015b), - SPH_C32(0x18cd44a2), SPH_C32(0xa3a8ed80), SPH_C32(0xa02f1b7b), - SPH_C32(0x413d3a51) }, - { SPH_C32(0x1e360000), SPH_C32(0x34320000), SPH_C32(0x3bd00000), - SPH_C32(0x7c9500b3), SPH_C32(0x4787bdc9), SPH_C32(0x92494ef4), - SPH_C32(0x5b444f86), SPH_C32(0x56c029d0), SPH_C32(0xf24f0000), - SPH_C32(0x724c0000), SPH_C32(0x6dac0000), SPH_C32(0x88e0015e), - SPH_C32(0x34825b71), SPH_C32(0xd75efb15), SPH_C32(0x15ec5c90), - SPH_C32(0x7d60c5af) }, - { SPH_C32(0xb77f0000), SPH_C32(0x450e0000), SPH_C32(0x8a360000), - SPH_C32(0xb44300ba), SPH_C32(0xb731a512), SPH_C32(0x31728a50), - SPH_C32(0xe614a66f), SPH_C32(0xdf2837ab), SPH_C32(0xcb800000), - SPH_C32(0x30c40000), SPH_C32(0x95710000), SPH_C32(0xe3240158), - SPH_C32(0xa22467b4), SPH_C32(0xf9474e8c), SPH_C32(0x30e1ec29), - SPH_C32(0x3a2b4f86) }, - { SPH_C32(0x1fa50000), SPH_C32(0xd3b00000), SPH_C32(0xd62b0000), - SPH_C32(0xb39900b8), SPH_C32(0xca573091), SPH_C32(0x2eeafada), - SPH_C32(0x5d722e67), SPH_C32(0x05afb7ab), SPH_C32(0x60670000), - SPH_C32(0xaec90000), SPH_C32(0x3a560000), SPH_C32(0xde3c015d), - SPH_C32(0x8e6b7867), SPH_C32(0x8db15819), SPH_C32(0x8522abc2), - SPH_C32(0x0676b078) }, - { SPH_C32(0x95bb0000), SPH_C32(0x81450000), SPH_C32(0x3b240000), - SPH_C32(0x48db0140), SPH_C32(0x0a8a6c53), SPH_C32(0x56f56eec), - SPH_C32(0x62c91877), SPH_C32(0xe7e00a94), SPH_C32(0xee930000), - SPH_C32(0xd6070000), SPH_C32(0x92c10000), SPH_C32(0x2b9801e0), - SPH_C32(0x9451287c), SPH_C32(0x3b6cfb57), SPH_C32(0x45312374), - SPH_C32(0x201f6a64) }, - { SPH_C32(0x3d610000), SPH_C32(0x17fb0000), SPH_C32(0x67390000), - SPH_C32(0x4f010142), SPH_C32(0x77ecf9d0), SPH_C32(0x496d1e66), - SPH_C32(0xd9af907f), SPH_C32(0x3d678a94), SPH_C32(0x45740000), - SPH_C32(0x480a0000), SPH_C32(0x3de60000), SPH_C32(0x168001e5), - SPH_C32(0xb81e37af), SPH_C32(0x4f9aedc2), SPH_C32(0xf0f2649f), - SPH_C32(0x1c42959a) }, - { SPH_C32(0x94280000), SPH_C32(0x66c70000), SPH_C32(0xd6df0000), - SPH_C32(0x87d7014b), SPH_C32(0x875ae10b), SPH_C32(0xea56dac2), - SPH_C32(0x64ff7996), SPH_C32(0xb48f94ef), SPH_C32(0x7cbb0000), - SPH_C32(0x0a820000), SPH_C32(0xc53b0000), SPH_C32(0x7d4401e3), - SPH_C32(0x2eb80b6a), SPH_C32(0x6183585b), SPH_C32(0xd5ffd426), - SPH_C32(0x5b091fb3) }, - { SPH_C32(0x3cf20000), SPH_C32(0xf0790000), SPH_C32(0x8ac20000), - SPH_C32(0x800d0149), SPH_C32(0xfa3c7488), SPH_C32(0xf5ceaa48), - SPH_C32(0xdf99f19e), SPH_C32(0x6e0814ef), SPH_C32(0xd75c0000), - SPH_C32(0x948f0000), SPH_C32(0x6a1c0000), SPH_C32(0x405c01e6), - SPH_C32(0x02f714b9), SPH_C32(0x15754ece), SPH_C32(0x603c93cd), - SPH_C32(0x6754e04d) }, - { SPH_C32(0x07930000), SPH_C32(0x5dc00000), SPH_C32(0x6cde0000), - SPH_C32(0x1e070143), SPH_C32(0xb0634f45), SPH_C32(0x0c1acde0), - SPH_C32(0xf207ef25), SPH_C32(0x9cf67f43), SPH_C32(0x7d280000), - SPH_C32(0xed000000), SPH_C32(0x28c00000), SPH_C32(0xb24801e8), - SPH_C32(0xa3688632), SPH_C32(0xdd20ec75), SPH_C32(0xd3c9b5c7), - SPH_C32(0x086681c8) }, - { SPH_C32(0xaf490000), SPH_C32(0xcb7e0000), SPH_C32(0x30c30000), - SPH_C32(0x19dd0141), SPH_C32(0xcd05dac6), SPH_C32(0x1382bd6a), - SPH_C32(0x4961672d), SPH_C32(0x4671ff43), SPH_C32(0xd6cf0000), - SPH_C32(0x730d0000), SPH_C32(0x87e70000), SPH_C32(0x8f5001ed), - SPH_C32(0x8f2799e1), SPH_C32(0xa9d6fae0), SPH_C32(0x660af22c), - SPH_C32(0x343b7e36) }, - { SPH_C32(0x06000000), SPH_C32(0xba420000), SPH_C32(0x81250000), - SPH_C32(0xd10b0148), SPH_C32(0x3db3c21d), SPH_C32(0xb0b979ce), - SPH_C32(0xf4318ec4), SPH_C32(0xcf99e138), SPH_C32(0xef000000), - SPH_C32(0x31850000), SPH_C32(0x7f3a0000), SPH_C32(0xe49401eb), - SPH_C32(0x1981a524), SPH_C32(0x87cf4f79), SPH_C32(0x43074295), - SPH_C32(0x7370f41f) }, - { SPH_C32(0xaeda0000), SPH_C32(0x2cfc0000), SPH_C32(0xdd380000), - SPH_C32(0xd6d1014a), SPH_C32(0x40d5579e), SPH_C32(0xaf210944), - SPH_C32(0x4f5706cc), SPH_C32(0x151e6138), SPH_C32(0x44e70000), - SPH_C32(0xaf880000), SPH_C32(0xd01d0000), SPH_C32(0xd98c01ee), - SPH_C32(0x35cebaf7), SPH_C32(0xf33959ec), SPH_C32(0xf6c4057e), - SPH_C32(0x4f2d0be1) }, - { SPH_C32(0xca130000), SPH_C32(0xd7460000), SPH_C32(0x788a0000), - SPH_C32(0x2c280153), SPH_C32(0x2ff4eaec), SPH_C32(0x45e4faa2), - SPH_C32(0x36d78dc8), SPH_C32(0x6944d1fd), SPH_C32(0xeed70000), - SPH_C32(0xa94f0000), SPH_C32(0x48bd0000), SPH_C32(0x01bb01e1), - SPH_C32(0xaffce1b0), SPH_C32(0x92da67d0), SPH_C32(0x463bbd14), - SPH_C32(0x9e150dfa) }, - { SPH_C32(0x62c90000), SPH_C32(0x41f80000), SPH_C32(0x24970000), - SPH_C32(0x2bf20151), SPH_C32(0x52927f6f), SPH_C32(0x5a7c8a28), - SPH_C32(0x8db105c0), SPH_C32(0xb3c351fd), SPH_C32(0x45300000), - SPH_C32(0x37420000), SPH_C32(0xe79a0000), SPH_C32(0x3ca301e4), - SPH_C32(0x83b3fe63), SPH_C32(0xe62c7145), SPH_C32(0xf3f8faff), - SPH_C32(0xa248f204) }, - { SPH_C32(0xcb800000), SPH_C32(0x30c40000), SPH_C32(0x95710000), - SPH_C32(0xe3240158), SPH_C32(0xa22467b4), SPH_C32(0xf9474e8c), - SPH_C32(0x30e1ec29), SPH_C32(0x3a2b4f86), SPH_C32(0x7cff0000), - SPH_C32(0x75ca0000), SPH_C32(0x1f470000), SPH_C32(0x576701e2), - SPH_C32(0x1515c2a6), SPH_C32(0xc835c4dc), SPH_C32(0xd6f54a46), - SPH_C32(0xe503782d) }, - { SPH_C32(0x635a0000), SPH_C32(0xa67a0000), SPH_C32(0xc96c0000), - SPH_C32(0xe4fe015a), SPH_C32(0xdf42f237), SPH_C32(0xe6df3e06), - SPH_C32(0x8b876421), SPH_C32(0xe0accf86), SPH_C32(0xd7180000), - SPH_C32(0xebc70000), SPH_C32(0xb0600000), SPH_C32(0x6a7f01e7), - SPH_C32(0x395add75), SPH_C32(0xbcc3d249), SPH_C32(0x63360dad), - SPH_C32(0xd95e87d3) }, - { SPH_C32(0x583b0000), SPH_C32(0x0bc30000), SPH_C32(0x2f700000), - SPH_C32(0x7af40150), SPH_C32(0x951dc9fa), SPH_C32(0x1f0b59ae), - SPH_C32(0xa6197a9a), SPH_C32(0x1252a42a), SPH_C32(0x7d6c0000), - SPH_C32(0x92480000), SPH_C32(0xf2bc0000), SPH_C32(0x986b01e9), - SPH_C32(0x98c54ffe), SPH_C32(0x749670f2), SPH_C32(0xd0c32ba7), - SPH_C32(0xb66ce656) }, - { SPH_C32(0xf0e10000), SPH_C32(0x9d7d0000), SPH_C32(0x736d0000), - SPH_C32(0x7d2e0152), SPH_C32(0xe87b5c79), SPH_C32(0x00932924), - SPH_C32(0x1d7ff292), SPH_C32(0xc8d5242a), SPH_C32(0xd68b0000), - SPH_C32(0x0c450000), SPH_C32(0x5d9b0000), SPH_C32(0xa57301ec), - SPH_C32(0xb48a502d), SPH_C32(0x00606667), SPH_C32(0x65006c4c), - SPH_C32(0x8a3119a8) }, - { SPH_C32(0x59a80000), SPH_C32(0xec410000), SPH_C32(0xc28b0000), - SPH_C32(0xb5f8015b), SPH_C32(0x18cd44a2), SPH_C32(0xa3a8ed80), - SPH_C32(0xa02f1b7b), SPH_C32(0x413d3a51), SPH_C32(0xef440000), - SPH_C32(0x4ecd0000), SPH_C32(0xa5460000), SPH_C32(0xceb701ea), - SPH_C32(0x222c6ce8), SPH_C32(0x2e79d3fe), SPH_C32(0x400ddcf5), - SPH_C32(0xcd7a9381) }, - { SPH_C32(0xf1720000), SPH_C32(0x7aff0000), SPH_C32(0x9e960000), - SPH_C32(0xb2220159), SPH_C32(0x65abd121), SPH_C32(0xbc309d0a), - SPH_C32(0x1b499373), SPH_C32(0x9bbaba51), SPH_C32(0x44a30000), - SPH_C32(0xd0c00000), SPH_C32(0x0a610000), SPH_C32(0xf3af01ef), - SPH_C32(0x0e63733b), SPH_C32(0x5a8fc56b), SPH_C32(0xf5ce9b1e), - SPH_C32(0xf1276c7f) }, - { SPH_C32(0x95ff0000), SPH_C32(0xfe0d0000), SPH_C32(0xe1580000), - SPH_C32(0x62f80141), SPH_C32(0x3127a59f), SPH_C32(0xff43f26b), - SPH_C32(0x61c38617), SPH_C32(0x59ea6d0a), SPH_C32(0xb17f0000), - SPH_C32(0xff4c0000), SPH_C32(0x0b130000), SPH_C32(0x654801f2), - SPH_C32(0x8a82670f), SPH_C32(0x81cbf39e), SPH_C32(0x122528ab), - SPH_C32(0x10b1d693) }, - { SPH_C32(0x3d250000), SPH_C32(0x68b30000), SPH_C32(0xbd450000), - SPH_C32(0x65220143), SPH_C32(0x4c41301c), SPH_C32(0xe0db82e1), - SPH_C32(0xdaa50e1f), SPH_C32(0x836ded0a), SPH_C32(0x1a980000), - SPH_C32(0x61410000), SPH_C32(0xa4340000), SPH_C32(0x585001f7), - SPH_C32(0xa6cd78dc), SPH_C32(0xf53de50b), SPH_C32(0xa7e66f40), - SPH_C32(0x2cec296d) }, - { SPH_C32(0x946c0000), SPH_C32(0x198f0000), SPH_C32(0x0ca30000), - SPH_C32(0xadf4014a), SPH_C32(0xbcf728c7), SPH_C32(0x43e04645), - SPH_C32(0x67f5e7f6), SPH_C32(0x0a85f371), SPH_C32(0x23570000), - SPH_C32(0x23c90000), SPH_C32(0x5ce90000), SPH_C32(0x339401f1), - SPH_C32(0x306b4419), SPH_C32(0xdb245092), SPH_C32(0x82ebdff9), - SPH_C32(0x6ba7a344) }, - { SPH_C32(0x3cb60000), SPH_C32(0x8f310000), SPH_C32(0x50be0000), - SPH_C32(0xaa2e0148), SPH_C32(0xc191bd44), SPH_C32(0x5c7836cf), - SPH_C32(0xdc936ffe), SPH_C32(0xd0027371), SPH_C32(0x88b00000), - SPH_C32(0xbdc40000), SPH_C32(0xf3ce0000), SPH_C32(0x0e8c01f4), - SPH_C32(0x1c245bca), SPH_C32(0xafd24607), SPH_C32(0x37289812), - SPH_C32(0x57fa5cba) }, - { SPH_C32(0x07d70000), SPH_C32(0x22880000), SPH_C32(0xb6a20000), - SPH_C32(0x34240142), SPH_C32(0x8bce8689), SPH_C32(0xa5ac5167), - SPH_C32(0xf10d7145), SPH_C32(0x22fc18dd), SPH_C32(0x22c40000), - SPH_C32(0xc44b0000), SPH_C32(0xb1120000), SPH_C32(0xfc9801fa), - SPH_C32(0xbdbbc941), SPH_C32(0x6787e4bc), SPH_C32(0x84ddbe18), - SPH_C32(0x38c83d3f) }, - { SPH_C32(0xaf0d0000), SPH_C32(0xb4360000), SPH_C32(0xeabf0000), - SPH_C32(0x33fe0140), SPH_C32(0xf6a8130a), SPH_C32(0xba3421ed), - SPH_C32(0x4a6bf94d), SPH_C32(0xf87b98dd), SPH_C32(0x89230000), - SPH_C32(0x5a460000), SPH_C32(0x1e350000), SPH_C32(0xc18001ff), - SPH_C32(0x91f4d692), SPH_C32(0x1371f229), SPH_C32(0x311ef9f3), - SPH_C32(0x0495c2c1) }, - { SPH_C32(0x06440000), SPH_C32(0xc50a0000), SPH_C32(0x5b590000), - SPH_C32(0xfb280149), SPH_C32(0x061e0bd1), SPH_C32(0x190fe549), - SPH_C32(0xf73b10a4), SPH_C32(0x719386a6), SPH_C32(0xb0ec0000), - SPH_C32(0x18ce0000), SPH_C32(0xe6e80000), SPH_C32(0xaa4401f9), - SPH_C32(0x0752ea57), SPH_C32(0x3d6847b0), SPH_C32(0x1413494a), - SPH_C32(0x43de48e8) }, - { SPH_C32(0xae9e0000), SPH_C32(0x53b40000), SPH_C32(0x07440000), - SPH_C32(0xfcf2014b), SPH_C32(0x7b789e52), SPH_C32(0x069795c3), - SPH_C32(0x4c5d98ac), SPH_C32(0xab1406a6), SPH_C32(0x1b0b0000), - SPH_C32(0x86c30000), SPH_C32(0x49cf0000), SPH_C32(0x975c01fc), - SPH_C32(0x2b1df584), SPH_C32(0x499e5125), SPH_C32(0xa1d00ea1), - SPH_C32(0x7f83b716) }, - { SPH_C32(0xca570000), SPH_C32(0xa80e0000), SPH_C32(0xa2f60000), - SPH_C32(0x060b0152), SPH_C32(0x14592320), SPH_C32(0xec526625), - SPH_C32(0x35dd13a8), SPH_C32(0xd74eb663), SPH_C32(0xb13b0000), - SPH_C32(0x80040000), SPH_C32(0xd16f0000), SPH_C32(0x4f6b01f3), - SPH_C32(0xb12faec3), SPH_C32(0x287d6f19), SPH_C32(0x112fb6cb), - SPH_C32(0xaebbb10d) }, - { SPH_C32(0x628d0000), SPH_C32(0x3eb00000), SPH_C32(0xfeeb0000), - SPH_C32(0x01d10150), SPH_C32(0x693fb6a3), SPH_C32(0xf3ca16af), - SPH_C32(0x8ebb9ba0), SPH_C32(0x0dc93663), SPH_C32(0x1adc0000), - SPH_C32(0x1e090000), SPH_C32(0x7e480000), SPH_C32(0x727301f6), - SPH_C32(0x9d60b110), SPH_C32(0x5c8b798c), SPH_C32(0xa4ecf120), - SPH_C32(0x92e64ef3) }, - { SPH_C32(0xcbc40000), SPH_C32(0x4f8c0000), SPH_C32(0x4f0d0000), - SPH_C32(0xc9070159), SPH_C32(0x9989ae78), SPH_C32(0x50f1d20b), - SPH_C32(0x33eb7249), SPH_C32(0x84212818), SPH_C32(0x23130000), - SPH_C32(0x5c810000), SPH_C32(0x86950000), SPH_C32(0x19b701f0), - SPH_C32(0x0bc68dd5), SPH_C32(0x7292cc15), SPH_C32(0x81e14199), - SPH_C32(0xd5adc4da) }, - { SPH_C32(0x631e0000), SPH_C32(0xd9320000), SPH_C32(0x13100000), - SPH_C32(0xcedd015b), SPH_C32(0xe4ef3bfb), SPH_C32(0x4f69a281), - SPH_C32(0x888dfa41), SPH_C32(0x5ea6a818), SPH_C32(0x88f40000), - SPH_C32(0xc28c0000), SPH_C32(0x29b20000), SPH_C32(0x24af01f5), - SPH_C32(0x27899206), SPH_C32(0x0664da80), SPH_C32(0x34220672), - SPH_C32(0xe9f03b24) }, - { SPH_C32(0x587f0000), SPH_C32(0x748b0000), SPH_C32(0xf50c0000), - SPH_C32(0x50d70151), SPH_C32(0xaeb00036), SPH_C32(0xb6bdc529), - SPH_C32(0xa513e4fa), SPH_C32(0xac58c3b4), SPH_C32(0x22800000), - SPH_C32(0xbb030000), SPH_C32(0x6b6e0000), SPH_C32(0xd6bb01fb), - SPH_C32(0x8616008d), SPH_C32(0xce31783b), SPH_C32(0x87d72078), - SPH_C32(0x86c25aa1) }, - { SPH_C32(0xf0a50000), SPH_C32(0xe2350000), SPH_C32(0xa9110000), - SPH_C32(0x570d0153), SPH_C32(0xd3d695b5), SPH_C32(0xa925b5a3), - SPH_C32(0x1e756cf2), SPH_C32(0x76df43b4), SPH_C32(0x89670000), - SPH_C32(0x250e0000), SPH_C32(0xc4490000), SPH_C32(0xeba301fe), - SPH_C32(0xaa591f5e), SPH_C32(0xbac76eae), SPH_C32(0x32146793), - SPH_C32(0xba9fa55f) }, - { SPH_C32(0x59ec0000), SPH_C32(0x93090000), SPH_C32(0x18f70000), - SPH_C32(0x9fdb015a), SPH_C32(0x23608d6e), SPH_C32(0x0a1e7107), - SPH_C32(0xa325851b), SPH_C32(0xff375dcf), SPH_C32(0xb0a80000), - SPH_C32(0x67860000), SPH_C32(0x3c940000), SPH_C32(0x806701f8), - SPH_C32(0x3cff239b), SPH_C32(0x94dedb37), SPH_C32(0x1719d72a), - SPH_C32(0xfdd42f76) }, - { SPH_C32(0xf1360000), SPH_C32(0x05b70000), SPH_C32(0x44ea0000), - SPH_C32(0x98010158), SPH_C32(0x5e0618ed), SPH_C32(0x1586018d), - SPH_C32(0x18430d13), SPH_C32(0x25b0ddcf), SPH_C32(0x1b4f0000), - SPH_C32(0xf98b0000), SPH_C32(0x93b30000), SPH_C32(0xbd7f01fd), - SPH_C32(0x10b03c48), SPH_C32(0xe028cda2), SPH_C32(0xa2da90c1), - SPH_C32(0xc189d088) } -}; - -static const sph_u32 T512_63[2][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x033d0000), SPH_C32(0x08b30000), SPH_C32(0xf33a0000), - SPH_C32(0x3ac20007), SPH_C32(0x51298a50), SPH_C32(0x6b6e661f), - SPH_C32(0x0ea5cfe3), SPH_C32(0xe6da7ffe), SPH_C32(0xa8da0000), - SPH_C32(0x96be0000), SPH_C32(0x5c1d0000), SPH_C32(0x07da0002), - SPH_C32(0x7d669583), SPH_C32(0x1f98708a), SPH_C32(0xbb668808), - SPH_C32(0xda878000) } -}; - -#define INPUT_BIG do { \ - unsigned acc = buf[0]; \ - const sph_u32 *rp; \ - rp = &T512_0[acc >> 1][0]; \ - m0 = rp[0]; \ - m1 = rp[1]; \ - m2 = rp[2]; \ - m3 = rp[3]; \ - m4 = rp[4]; \ - m5 = rp[5]; \ - m6 = rp[6]; \ - m7 = rp[7]; \ - m8 = rp[8]; \ - m9 = rp[9]; \ - mA = rp[10]; \ - mB = rp[11]; \ - mC = rp[12]; \ - mD = rp[13]; \ - mE = rp[14]; \ - mF = rp[15]; \ - acc = (acc << 8) | buf[1]; \ - rp = &T512_7[(acc >> 2) & 0x7f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = (acc << 8) | buf[2]; \ - rp = &T512_14[(acc >> 3) & 0x7f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = (acc << 8) | buf[3]; \ - rp = &T512_21[(acc >> 4) & 0x7f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = (acc << 8) | buf[4]; \ - rp = &T512_28[(acc >> 5) & 0x7f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = (acc << 8) | buf[5]; \ - rp = &T512_35[(acc >> 6) & 0x7f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = (acc << 8) | buf[6]; \ - rp = &T512_42[(acc >> 7) & 0x7f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_49[acc & 0x7f][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[7]; \ - rp = &T512_56[acc >> 1][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - rp = &T512_63[acc & 0x01][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - } while (0) - -#endif - -#if SPH_HAMSI_EXPAND_BIG == 8 - -static const sph_u32 T512_0[256][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xef0b0270), SPH_C32(0x3afd0000), SPH_C32(0x5dae0000), - SPH_C32(0x69490000), SPH_C32(0x9b0f3c06), SPH_C32(0x4405b5f9), - SPH_C32(0x66140a51), SPH_C32(0x924f5d0a), SPH_C32(0xc96b0030), - SPH_C32(0xe7250000), SPH_C32(0x2f840000), SPH_C32(0x264f0000), - SPH_C32(0x08695bf9), SPH_C32(0x6dfcf137), SPH_C32(0x509f6984), - SPH_C32(0x9e69af68) }, - { SPH_C32(0xc96b0030), SPH_C32(0xe7250000), SPH_C32(0x2f840000), - SPH_C32(0x264f0000), SPH_C32(0x08695bf9), SPH_C32(0x6dfcf137), - SPH_C32(0x509f6984), SPH_C32(0x9e69af68), SPH_C32(0x26600240), - SPH_C32(0xddd80000), SPH_C32(0x722a0000), SPH_C32(0x4f060000), - SPH_C32(0x936667ff), SPH_C32(0x29f944ce), SPH_C32(0x368b63d5), - SPH_C32(0x0c26f262) }, - { SPH_C32(0x26600240), SPH_C32(0xddd80000), SPH_C32(0x722a0000), - SPH_C32(0x4f060000), SPH_C32(0x936667ff), SPH_C32(0x29f944ce), - SPH_C32(0x368b63d5), SPH_C32(0x0c26f262), SPH_C32(0xef0b0270), - SPH_C32(0x3afd0000), SPH_C32(0x5dae0000), SPH_C32(0x69490000), - SPH_C32(0x9b0f3c06), SPH_C32(0x4405b5f9), SPH_C32(0x66140a51), - SPH_C32(0x924f5d0a) }, - { SPH_C32(0x145a3c00), SPH_C32(0xb9e90000), SPH_C32(0x61270000), - SPH_C32(0xf1610000), SPH_C32(0xce613d6c), SPH_C32(0xb0493d78), - SPH_C32(0x47a96720), SPH_C32(0xe18e24c5), SPH_C32(0x23671400), - SPH_C32(0xc8b90000), SPH_C32(0xf4c70000), SPH_C32(0xfb750000), - SPH_C32(0x73cd2465), SPH_C32(0xf8a6a549), SPH_C32(0x02c40a3f), - SPH_C32(0xdc24e61f) }, - { SPH_C32(0xfb513e70), SPH_C32(0x83140000), SPH_C32(0x3c890000), - SPH_C32(0x98280000), SPH_C32(0x556e016a), SPH_C32(0xf44c8881), - SPH_C32(0x21bd6d71), SPH_C32(0x73c179cf), SPH_C32(0xea0c1430), - SPH_C32(0x2f9c0000), SPH_C32(0xdb430000), SPH_C32(0xdd3a0000), - SPH_C32(0x7ba47f9c), SPH_C32(0x955a547e), SPH_C32(0x525b63bb), - SPH_C32(0x424d4977) }, - { SPH_C32(0xdd313c30), SPH_C32(0x5ecc0000), SPH_C32(0x4ea30000), - SPH_C32(0xd72e0000), SPH_C32(0xc6086695), SPH_C32(0xddb5cc4f), - SPH_C32(0x17360ea4), SPH_C32(0x7fe78bad), SPH_C32(0x05071640), - SPH_C32(0x15610000), SPH_C32(0x86ed0000), SPH_C32(0xb4730000), - SPH_C32(0xe0ab439a), SPH_C32(0xd15fe187), SPH_C32(0x344f69ea), - SPH_C32(0xd002147d) }, - { SPH_C32(0x323a3e40), SPH_C32(0x64310000), SPH_C32(0x130d0000), - SPH_C32(0xbe670000), SPH_C32(0x5d075a93), SPH_C32(0x99b079b6), - SPH_C32(0x712204f5), SPH_C32(0xeda8d6a7), SPH_C32(0xcc6c1670), - SPH_C32(0xf2440000), SPH_C32(0xa9690000), SPH_C32(0x923c0000), - SPH_C32(0xe8c21863), SPH_C32(0xbca310b0), SPH_C32(0x64d0006e), - SPH_C32(0x4e6bbb15) }, - { SPH_C32(0x23671400), SPH_C32(0xc8b90000), SPH_C32(0xf4c70000), - SPH_C32(0xfb750000), SPH_C32(0x73cd2465), SPH_C32(0xf8a6a549), - SPH_C32(0x02c40a3f), SPH_C32(0xdc24e61f), SPH_C32(0x373d2800), - SPH_C32(0x71500000), SPH_C32(0x95e00000), SPH_C32(0x0a140000), - SPH_C32(0xbdac1909), SPH_C32(0x48ef9831), SPH_C32(0x456d6d1f), - SPH_C32(0x3daac2da) }, - { SPH_C32(0xcc6c1670), SPH_C32(0xf2440000), SPH_C32(0xa9690000), - SPH_C32(0x923c0000), SPH_C32(0xe8c21863), SPH_C32(0xbca310b0), - SPH_C32(0x64d0006e), SPH_C32(0x4e6bbb15), SPH_C32(0xfe562830), - SPH_C32(0x96750000), SPH_C32(0xba640000), SPH_C32(0x2c5b0000), - SPH_C32(0xb5c542f0), SPH_C32(0x25136906), SPH_C32(0x15f2049b), - SPH_C32(0xa3c36db2) }, - { SPH_C32(0xea0c1430), SPH_C32(0x2f9c0000), SPH_C32(0xdb430000), - SPH_C32(0xdd3a0000), SPH_C32(0x7ba47f9c), SPH_C32(0x955a547e), - SPH_C32(0x525b63bb), SPH_C32(0x424d4977), SPH_C32(0x115d2a40), - SPH_C32(0xac880000), SPH_C32(0xe7ca0000), SPH_C32(0x45120000), - SPH_C32(0x2eca7ef6), SPH_C32(0x6116dcff), SPH_C32(0x73e60eca), - SPH_C32(0x318c30b8) }, - { SPH_C32(0x05071640), SPH_C32(0x15610000), SPH_C32(0x86ed0000), - SPH_C32(0xb4730000), SPH_C32(0xe0ab439a), SPH_C32(0xd15fe187), - SPH_C32(0x344f69ea), SPH_C32(0xd002147d), SPH_C32(0xd8362a70), - SPH_C32(0x4bad0000), SPH_C32(0xc84e0000), SPH_C32(0x635d0000), - SPH_C32(0x26a3250f), SPH_C32(0x0cea2dc8), SPH_C32(0x2379674e), - SPH_C32(0xafe59fd0) }, - { SPH_C32(0x373d2800), SPH_C32(0x71500000), SPH_C32(0x95e00000), - SPH_C32(0x0a140000), SPH_C32(0xbdac1909), SPH_C32(0x48ef9831), - SPH_C32(0x456d6d1f), SPH_C32(0x3daac2da), SPH_C32(0x145a3c00), - SPH_C32(0xb9e90000), SPH_C32(0x61270000), SPH_C32(0xf1610000), - SPH_C32(0xce613d6c), SPH_C32(0xb0493d78), SPH_C32(0x47a96720), - SPH_C32(0xe18e24c5) }, - { SPH_C32(0xd8362a70), SPH_C32(0x4bad0000), SPH_C32(0xc84e0000), - SPH_C32(0x635d0000), SPH_C32(0x26a3250f), SPH_C32(0x0cea2dc8), - SPH_C32(0x2379674e), SPH_C32(0xafe59fd0), SPH_C32(0xdd313c30), - SPH_C32(0x5ecc0000), SPH_C32(0x4ea30000), SPH_C32(0xd72e0000), - SPH_C32(0xc6086695), SPH_C32(0xddb5cc4f), SPH_C32(0x17360ea4), - SPH_C32(0x7fe78bad) }, - { SPH_C32(0xfe562830), SPH_C32(0x96750000), SPH_C32(0xba640000), - SPH_C32(0x2c5b0000), SPH_C32(0xb5c542f0), SPH_C32(0x25136906), - SPH_C32(0x15f2049b), SPH_C32(0xa3c36db2), SPH_C32(0x323a3e40), - SPH_C32(0x64310000), SPH_C32(0x130d0000), SPH_C32(0xbe670000), - SPH_C32(0x5d075a93), SPH_C32(0x99b079b6), SPH_C32(0x712204f5), - SPH_C32(0xeda8d6a7) }, - { SPH_C32(0x115d2a40), SPH_C32(0xac880000), SPH_C32(0xe7ca0000), - SPH_C32(0x45120000), SPH_C32(0x2eca7ef6), SPH_C32(0x6116dcff), - SPH_C32(0x73e60eca), SPH_C32(0x318c30b8), SPH_C32(0xfb513e70), - SPH_C32(0x83140000), SPH_C32(0x3c890000), SPH_C32(0x98280000), - SPH_C32(0x556e016a), SPH_C32(0xf44c8881), SPH_C32(0x21bd6d71), - SPH_C32(0x73c179cf) }, - { SPH_C32(0x54285c00), SPH_C32(0xeaed0000), SPH_C32(0xc5d60000), - SPH_C32(0xa1c50000), SPH_C32(0xb3a26770), SPH_C32(0x94a5c4e1), - SPH_C32(0x6bb0419d), SPH_C32(0x551b3782), SPH_C32(0x9cbb1800), - SPH_C32(0xb0d30000), SPH_C32(0x92510000), SPH_C32(0xed930000), - SPH_C32(0x593a4345), SPH_C32(0xe114d5f4), SPH_C32(0x430633da), - SPH_C32(0x78cace29) }, - { SPH_C32(0xbb235e70), SPH_C32(0xd0100000), SPH_C32(0x98780000), - SPH_C32(0xc88c0000), SPH_C32(0x28ad5b76), SPH_C32(0xd0a07118), - SPH_C32(0x0da44bcc), SPH_C32(0xc7546a88), SPH_C32(0x55d01830), - SPH_C32(0x57f60000), SPH_C32(0xbdd50000), SPH_C32(0xcbdc0000), - SPH_C32(0x515318bc), SPH_C32(0x8ce824c3), SPH_C32(0x13995a5e), - SPH_C32(0xe6a36141) }, - { SPH_C32(0x9d435c30), SPH_C32(0x0dc80000), SPH_C32(0xea520000), - SPH_C32(0x878a0000), SPH_C32(0xbbcb3c89), SPH_C32(0xf95935d6), - SPH_C32(0x3b2f2819), SPH_C32(0xcb7298ea), SPH_C32(0xbadb1a40), - SPH_C32(0x6d0b0000), SPH_C32(0xe07b0000), SPH_C32(0xa2950000), - SPH_C32(0xca5c24ba), SPH_C32(0xc8ed913a), SPH_C32(0x758d500f), - SPH_C32(0x74ec3c4b) }, - { SPH_C32(0x72485e40), SPH_C32(0x37350000), SPH_C32(0xb7fc0000), - SPH_C32(0xeec30000), SPH_C32(0x20c4008f), SPH_C32(0xbd5c802f), - SPH_C32(0x5d3b2248), SPH_C32(0x593dc5e0), SPH_C32(0x73b01a70), - SPH_C32(0x8a2e0000), SPH_C32(0xcfff0000), SPH_C32(0x84da0000), - SPH_C32(0xc2357f43), SPH_C32(0xa511600d), SPH_C32(0x2512398b), - SPH_C32(0xea859323) }, - { SPH_C32(0x40726000), SPH_C32(0x53040000), SPH_C32(0xa4f10000), - SPH_C32(0x50a40000), SPH_C32(0x7dc35a1c), SPH_C32(0x24ecf999), - SPH_C32(0x2c1926bd), SPH_C32(0xb4951347), SPH_C32(0xbfdc0c00), - SPH_C32(0x786a0000), SPH_C32(0x66960000), SPH_C32(0x16e60000), - SPH_C32(0x2af76720), SPH_C32(0x19b270bd), SPH_C32(0x41c239e5), - SPH_C32(0xa4ee2836) }, - { SPH_C32(0xaf796270), SPH_C32(0x69f90000), SPH_C32(0xf95f0000), - SPH_C32(0x39ed0000), SPH_C32(0xe6cc661a), SPH_C32(0x60e94c60), - SPH_C32(0x4a0d2cec), SPH_C32(0x26da4e4d), SPH_C32(0x76b70c30), - SPH_C32(0x9f4f0000), SPH_C32(0x49120000), SPH_C32(0x30a90000), - SPH_C32(0x229e3cd9), SPH_C32(0x744e818a), SPH_C32(0x115d5061), - SPH_C32(0x3a87875e) }, - { SPH_C32(0x89196030), SPH_C32(0xb4210000), SPH_C32(0x8b750000), - SPH_C32(0x76eb0000), SPH_C32(0x75aa01e5), SPH_C32(0x491008ae), - SPH_C32(0x7c864f39), SPH_C32(0x2afcbc2f), SPH_C32(0x99bc0e40), - SPH_C32(0xa5b20000), SPH_C32(0x14bc0000), SPH_C32(0x59e00000), - SPH_C32(0xb99100df), SPH_C32(0x304b3473), SPH_C32(0x77495a30), - SPH_C32(0xa8c8da54) }, - { SPH_C32(0x66126240), SPH_C32(0x8edc0000), SPH_C32(0xd6db0000), - SPH_C32(0x1fa20000), SPH_C32(0xeea53de3), SPH_C32(0x0d15bd57), - SPH_C32(0x1a924568), SPH_C32(0xb8b3e125), SPH_C32(0x50d70e70), - SPH_C32(0x42970000), SPH_C32(0x3b380000), SPH_C32(0x7faf0000), - SPH_C32(0xb1f85b26), SPH_C32(0x5db7c544), SPH_C32(0x27d633b4), - SPH_C32(0x36a1753c) }, - { SPH_C32(0x774f4800), SPH_C32(0x22540000), SPH_C32(0x31110000), - SPH_C32(0x5ab00000), SPH_C32(0xc06f4315), SPH_C32(0x6c0361a8), - SPH_C32(0x69744ba2), SPH_C32(0x893fd19d), SPH_C32(0xab863000), - SPH_C32(0xc1830000), SPH_C32(0x07b10000), SPH_C32(0xe7870000), - SPH_C32(0xe4965a4c), SPH_C32(0xa9fb4dc5), SPH_C32(0x066b5ec5), - SPH_C32(0x45600cf3) }, - { SPH_C32(0x98444a70), SPH_C32(0x18a90000), SPH_C32(0x6cbf0000), - SPH_C32(0x33f90000), SPH_C32(0x5b607f13), SPH_C32(0x2806d451), - SPH_C32(0x0f6041f3), SPH_C32(0x1b708c97), SPH_C32(0x62ed3030), - SPH_C32(0x26a60000), SPH_C32(0x28350000), SPH_C32(0xc1c80000), - SPH_C32(0xecff01b5), SPH_C32(0xc407bcf2), SPH_C32(0x56f43741), - SPH_C32(0xdb09a39b) }, - { SPH_C32(0xbe244830), SPH_C32(0xc5710000), SPH_C32(0x1e950000), - SPH_C32(0x7cff0000), SPH_C32(0xc80618ec), SPH_C32(0x01ff909f), - SPH_C32(0x39eb2226), SPH_C32(0x17567ef5), SPH_C32(0x8de63240), - SPH_C32(0x1c5b0000), SPH_C32(0x759b0000), SPH_C32(0xa8810000), - SPH_C32(0x77f03db3), SPH_C32(0x8002090b), SPH_C32(0x30e03d10), - SPH_C32(0x4946fe91) }, - { SPH_C32(0x512f4a40), SPH_C32(0xff8c0000), SPH_C32(0x433b0000), - SPH_C32(0x15b60000), SPH_C32(0x530924ea), SPH_C32(0x45fa2566), - SPH_C32(0x5fff2877), SPH_C32(0x851923ff), SPH_C32(0x448d3270), - SPH_C32(0xfb7e0000), SPH_C32(0x5a1f0000), SPH_C32(0x8ece0000), - SPH_C32(0x7f99664a), SPH_C32(0xedfef83c), SPH_C32(0x607f5494), - SPH_C32(0xd72f51f9) }, - { SPH_C32(0x63157400), SPH_C32(0x9bbd0000), SPH_C32(0x50360000), - SPH_C32(0xabd10000), SPH_C32(0x0e0e7e79), SPH_C32(0xdc4a5cd0), - SPH_C32(0x2edd2c82), SPH_C32(0x68b1f558), SPH_C32(0x88e12400), - SPH_C32(0x093a0000), SPH_C32(0xf3760000), SPH_C32(0x1cf20000), - SPH_C32(0x975b7e29), SPH_C32(0x515de88c), SPH_C32(0x04af54fa), - SPH_C32(0x9944eaec) }, - { SPH_C32(0x8c1e7670), SPH_C32(0xa1400000), SPH_C32(0x0d980000), - SPH_C32(0xc2980000), SPH_C32(0x9501427f), SPH_C32(0x984fe929), - SPH_C32(0x48c926d3), SPH_C32(0xfafea852), SPH_C32(0x418a2430), - SPH_C32(0xee1f0000), SPH_C32(0xdcf20000), SPH_C32(0x3abd0000), - SPH_C32(0x9f3225d0), SPH_C32(0x3ca119bb), SPH_C32(0x54303d7e), - SPH_C32(0x072d4584) }, - { SPH_C32(0xaa7e7430), SPH_C32(0x7c980000), SPH_C32(0x7fb20000), - SPH_C32(0x8d9e0000), SPH_C32(0x06672580), SPH_C32(0xb1b6ade7), - SPH_C32(0x7e424506), SPH_C32(0xf6d85a30), SPH_C32(0xae812640), - SPH_C32(0xd4e20000), SPH_C32(0x815c0000), SPH_C32(0x53f40000), - SPH_C32(0x043d19d6), SPH_C32(0x78a4ac42), SPH_C32(0x3224372f), - SPH_C32(0x9562188e) }, - { SPH_C32(0x45757640), SPH_C32(0x46650000), SPH_C32(0x221c0000), - SPH_C32(0xe4d70000), SPH_C32(0x9d681986), SPH_C32(0xf5b3181e), - SPH_C32(0x18564f57), SPH_C32(0x6497073a), SPH_C32(0x67ea2670), - SPH_C32(0x33c70000), SPH_C32(0xaed80000), SPH_C32(0x75bb0000), - SPH_C32(0x0c54422f), SPH_C32(0x15585d75), SPH_C32(0x62bb5eab), - SPH_C32(0x0b0bb7e6) }, - { SPH_C32(0x9cbb1800), SPH_C32(0xb0d30000), SPH_C32(0x92510000), - SPH_C32(0xed930000), SPH_C32(0x593a4345), SPH_C32(0xe114d5f4), - SPH_C32(0x430633da), SPH_C32(0x78cace29), SPH_C32(0xc8934400), - SPH_C32(0x5a3e0000), SPH_C32(0x57870000), SPH_C32(0x4c560000), - SPH_C32(0xea982435), SPH_C32(0x75b11115), SPH_C32(0x28b67247), - SPH_C32(0x2dd1f9ab) }, - { SPH_C32(0x73b01a70), SPH_C32(0x8a2e0000), SPH_C32(0xcfff0000), - SPH_C32(0x84da0000), SPH_C32(0xc2357f43), SPH_C32(0xa511600d), - SPH_C32(0x2512398b), SPH_C32(0xea859323), SPH_C32(0x01f84430), - SPH_C32(0xbd1b0000), SPH_C32(0x78030000), SPH_C32(0x6a190000), - SPH_C32(0xe2f17fcc), SPH_C32(0x184de022), SPH_C32(0x78291bc3), - SPH_C32(0xb3b856c3) }, - { SPH_C32(0x55d01830), SPH_C32(0x57f60000), SPH_C32(0xbdd50000), - SPH_C32(0xcbdc0000), SPH_C32(0x515318bc), SPH_C32(0x8ce824c3), - SPH_C32(0x13995a5e), SPH_C32(0xe6a36141), SPH_C32(0xeef34640), - SPH_C32(0x87e60000), SPH_C32(0x25ad0000), SPH_C32(0x03500000), - SPH_C32(0x79fe43ca), SPH_C32(0x5c4855db), SPH_C32(0x1e3d1192), - SPH_C32(0x21f70bc9) }, - { SPH_C32(0xbadb1a40), SPH_C32(0x6d0b0000), SPH_C32(0xe07b0000), - SPH_C32(0xa2950000), SPH_C32(0xca5c24ba), SPH_C32(0xc8ed913a), - SPH_C32(0x758d500f), SPH_C32(0x74ec3c4b), SPH_C32(0x27984670), - SPH_C32(0x60c30000), SPH_C32(0x0a290000), SPH_C32(0x251f0000), - SPH_C32(0x71971833), SPH_C32(0x31b4a4ec), SPH_C32(0x4ea27816), - SPH_C32(0xbf9ea4a1) }, - { SPH_C32(0x88e12400), SPH_C32(0x093a0000), SPH_C32(0xf3760000), - SPH_C32(0x1cf20000), SPH_C32(0x975b7e29), SPH_C32(0x515de88c), - SPH_C32(0x04af54fa), SPH_C32(0x9944eaec), SPH_C32(0xebf45000), - SPH_C32(0x92870000), SPH_C32(0xa3400000), SPH_C32(0xb7230000), - SPH_C32(0x99550050), SPH_C32(0x8d17b45c), SPH_C32(0x2a727878), - SPH_C32(0xf1f51fb4) }, - { SPH_C32(0x67ea2670), SPH_C32(0x33c70000), SPH_C32(0xaed80000), - SPH_C32(0x75bb0000), SPH_C32(0x0c54422f), SPH_C32(0x15585d75), - SPH_C32(0x62bb5eab), SPH_C32(0x0b0bb7e6), SPH_C32(0x229f5030), - SPH_C32(0x75a20000), SPH_C32(0x8cc40000), SPH_C32(0x916c0000), - SPH_C32(0x913c5ba9), SPH_C32(0xe0eb456b), SPH_C32(0x7aed11fc), - SPH_C32(0x6f9cb0dc) }, - { SPH_C32(0x418a2430), SPH_C32(0xee1f0000), SPH_C32(0xdcf20000), - SPH_C32(0x3abd0000), SPH_C32(0x9f3225d0), SPH_C32(0x3ca119bb), - SPH_C32(0x54303d7e), SPH_C32(0x072d4584), SPH_C32(0xcd945240), - SPH_C32(0x4f5f0000), SPH_C32(0xd16a0000), SPH_C32(0xf8250000), - SPH_C32(0x0a3367af), SPH_C32(0xa4eef092), SPH_C32(0x1cf91bad), - SPH_C32(0xfdd3edd6) }, - { SPH_C32(0xae812640), SPH_C32(0xd4e20000), SPH_C32(0x815c0000), - SPH_C32(0x53f40000), SPH_C32(0x043d19d6), SPH_C32(0x78a4ac42), - SPH_C32(0x3224372f), SPH_C32(0x9562188e), SPH_C32(0x04ff5270), - SPH_C32(0xa87a0000), SPH_C32(0xfeee0000), SPH_C32(0xde6a0000), - SPH_C32(0x025a3c56), SPH_C32(0xc91201a5), SPH_C32(0x4c667229), - SPH_C32(0x63ba42be) }, - { SPH_C32(0xbfdc0c00), SPH_C32(0x786a0000), SPH_C32(0x66960000), - SPH_C32(0x16e60000), SPH_C32(0x2af76720), SPH_C32(0x19b270bd), - SPH_C32(0x41c239e5), SPH_C32(0xa4ee2836), SPH_C32(0xffae6c00), - SPH_C32(0x2b6e0000), SPH_C32(0xc2670000), SPH_C32(0x46420000), - SPH_C32(0x57343d3c), SPH_C32(0x3d5e8924), SPH_C32(0x6ddb1f58), - SPH_C32(0x107b3b71) }, - { SPH_C32(0x50d70e70), SPH_C32(0x42970000), SPH_C32(0x3b380000), - SPH_C32(0x7faf0000), SPH_C32(0xb1f85b26), SPH_C32(0x5db7c544), - SPH_C32(0x27d633b4), SPH_C32(0x36a1753c), SPH_C32(0x36c56c30), - SPH_C32(0xcc4b0000), SPH_C32(0xede30000), SPH_C32(0x600d0000), - SPH_C32(0x5f5d66c5), SPH_C32(0x50a27813), SPH_C32(0x3d4476dc), - SPH_C32(0x8e129419) }, - { SPH_C32(0x76b70c30), SPH_C32(0x9f4f0000), SPH_C32(0x49120000), - SPH_C32(0x30a90000), SPH_C32(0x229e3cd9), SPH_C32(0x744e818a), - SPH_C32(0x115d5061), SPH_C32(0x3a87875e), SPH_C32(0xd9ce6e40), - SPH_C32(0xf6b60000), SPH_C32(0xb04d0000), SPH_C32(0x09440000), - SPH_C32(0xc4525ac3), SPH_C32(0x14a7cdea), SPH_C32(0x5b507c8d), - SPH_C32(0x1c5dc913) }, - { SPH_C32(0x99bc0e40), SPH_C32(0xa5b20000), SPH_C32(0x14bc0000), - SPH_C32(0x59e00000), SPH_C32(0xb99100df), SPH_C32(0x304b3473), - SPH_C32(0x77495a30), SPH_C32(0xa8c8da54), SPH_C32(0x10a56e70), - SPH_C32(0x11930000), SPH_C32(0x9fc90000), SPH_C32(0x2f0b0000), - SPH_C32(0xcc3b013a), SPH_C32(0x795b3cdd), SPH_C32(0x0bcf1509), - SPH_C32(0x8234667b) }, - { SPH_C32(0xab863000), SPH_C32(0xc1830000), SPH_C32(0x07b10000), - SPH_C32(0xe7870000), SPH_C32(0xe4965a4c), SPH_C32(0xa9fb4dc5), - SPH_C32(0x066b5ec5), SPH_C32(0x45600cf3), SPH_C32(0xdcc97800), - SPH_C32(0xe3d70000), SPH_C32(0x36a00000), SPH_C32(0xbd370000), - SPH_C32(0x24f91959), SPH_C32(0xc5f82c6d), SPH_C32(0x6f1f1567), - SPH_C32(0xcc5fdd6e) }, - { SPH_C32(0x448d3270), SPH_C32(0xfb7e0000), SPH_C32(0x5a1f0000), - SPH_C32(0x8ece0000), SPH_C32(0x7f99664a), SPH_C32(0xedfef83c), - SPH_C32(0x607f5494), SPH_C32(0xd72f51f9), SPH_C32(0x15a27830), - SPH_C32(0x04f20000), SPH_C32(0x19240000), SPH_C32(0x9b780000), - SPH_C32(0x2c9042a0), SPH_C32(0xa804dd5a), SPH_C32(0x3f807ce3), - SPH_C32(0x52367206) }, - { SPH_C32(0x62ed3030), SPH_C32(0x26a60000), SPH_C32(0x28350000), - SPH_C32(0xc1c80000), SPH_C32(0xecff01b5), SPH_C32(0xc407bcf2), - SPH_C32(0x56f43741), SPH_C32(0xdb09a39b), SPH_C32(0xfaa97a40), - SPH_C32(0x3e0f0000), SPH_C32(0x448a0000), SPH_C32(0xf2310000), - SPH_C32(0xb79f7ea6), SPH_C32(0xec0168a3), SPH_C32(0x599476b2), - SPH_C32(0xc0792f0c) }, - { SPH_C32(0x8de63240), SPH_C32(0x1c5b0000), SPH_C32(0x759b0000), - SPH_C32(0xa8810000), SPH_C32(0x77f03db3), SPH_C32(0x8002090b), - SPH_C32(0x30e03d10), SPH_C32(0x4946fe91), SPH_C32(0x33c27a70), - SPH_C32(0xd92a0000), SPH_C32(0x6b0e0000), SPH_C32(0xd47e0000), - SPH_C32(0xbff6255f), SPH_C32(0x81fd9994), SPH_C32(0x090b1f36), - SPH_C32(0x5e108064) }, - { SPH_C32(0xc8934400), SPH_C32(0x5a3e0000), SPH_C32(0x57870000), - SPH_C32(0x4c560000), SPH_C32(0xea982435), SPH_C32(0x75b11115), - SPH_C32(0x28b67247), SPH_C32(0x2dd1f9ab), SPH_C32(0x54285c00), - SPH_C32(0xeaed0000), SPH_C32(0xc5d60000), SPH_C32(0xa1c50000), - SPH_C32(0xb3a26770), SPH_C32(0x94a5c4e1), SPH_C32(0x6bb0419d), - SPH_C32(0x551b3782) }, - { SPH_C32(0x27984670), SPH_C32(0x60c30000), SPH_C32(0x0a290000), - SPH_C32(0x251f0000), SPH_C32(0x71971833), SPH_C32(0x31b4a4ec), - SPH_C32(0x4ea27816), SPH_C32(0xbf9ea4a1), SPH_C32(0x9d435c30), - SPH_C32(0x0dc80000), SPH_C32(0xea520000), SPH_C32(0x878a0000), - SPH_C32(0xbbcb3c89), SPH_C32(0xf95935d6), SPH_C32(0x3b2f2819), - SPH_C32(0xcb7298ea) }, - { SPH_C32(0x01f84430), SPH_C32(0xbd1b0000), SPH_C32(0x78030000), - SPH_C32(0x6a190000), SPH_C32(0xe2f17fcc), SPH_C32(0x184de022), - SPH_C32(0x78291bc3), SPH_C32(0xb3b856c3), SPH_C32(0x72485e40), - SPH_C32(0x37350000), SPH_C32(0xb7fc0000), SPH_C32(0xeec30000), - SPH_C32(0x20c4008f), SPH_C32(0xbd5c802f), SPH_C32(0x5d3b2248), - SPH_C32(0x593dc5e0) }, - { SPH_C32(0xeef34640), SPH_C32(0x87e60000), SPH_C32(0x25ad0000), - SPH_C32(0x03500000), SPH_C32(0x79fe43ca), SPH_C32(0x5c4855db), - SPH_C32(0x1e3d1192), SPH_C32(0x21f70bc9), SPH_C32(0xbb235e70), - SPH_C32(0xd0100000), SPH_C32(0x98780000), SPH_C32(0xc88c0000), - SPH_C32(0x28ad5b76), SPH_C32(0xd0a07118), SPH_C32(0x0da44bcc), - SPH_C32(0xc7546a88) }, - { SPH_C32(0xdcc97800), SPH_C32(0xe3d70000), SPH_C32(0x36a00000), - SPH_C32(0xbd370000), SPH_C32(0x24f91959), SPH_C32(0xc5f82c6d), - SPH_C32(0x6f1f1567), SPH_C32(0xcc5fdd6e), SPH_C32(0x774f4800), - SPH_C32(0x22540000), SPH_C32(0x31110000), SPH_C32(0x5ab00000), - SPH_C32(0xc06f4315), SPH_C32(0x6c0361a8), SPH_C32(0x69744ba2), - SPH_C32(0x893fd19d) }, - { SPH_C32(0x33c27a70), SPH_C32(0xd92a0000), SPH_C32(0x6b0e0000), - SPH_C32(0xd47e0000), SPH_C32(0xbff6255f), SPH_C32(0x81fd9994), - SPH_C32(0x090b1f36), SPH_C32(0x5e108064), SPH_C32(0xbe244830), - SPH_C32(0xc5710000), SPH_C32(0x1e950000), SPH_C32(0x7cff0000), - SPH_C32(0xc80618ec), SPH_C32(0x01ff909f), SPH_C32(0x39eb2226), - SPH_C32(0x17567ef5) }, - { SPH_C32(0x15a27830), SPH_C32(0x04f20000), SPH_C32(0x19240000), - SPH_C32(0x9b780000), SPH_C32(0x2c9042a0), SPH_C32(0xa804dd5a), - SPH_C32(0x3f807ce3), SPH_C32(0x52367206), SPH_C32(0x512f4a40), - SPH_C32(0xff8c0000), SPH_C32(0x433b0000), SPH_C32(0x15b60000), - SPH_C32(0x530924ea), SPH_C32(0x45fa2566), SPH_C32(0x5fff2877), - SPH_C32(0x851923ff) }, - { SPH_C32(0xfaa97a40), SPH_C32(0x3e0f0000), SPH_C32(0x448a0000), - SPH_C32(0xf2310000), SPH_C32(0xb79f7ea6), SPH_C32(0xec0168a3), - SPH_C32(0x599476b2), SPH_C32(0xc0792f0c), SPH_C32(0x98444a70), - SPH_C32(0x18a90000), SPH_C32(0x6cbf0000), SPH_C32(0x33f90000), - SPH_C32(0x5b607f13), SPH_C32(0x2806d451), SPH_C32(0x0f6041f3), - SPH_C32(0x1b708c97) }, - { SPH_C32(0xebf45000), SPH_C32(0x92870000), SPH_C32(0xa3400000), - SPH_C32(0xb7230000), SPH_C32(0x99550050), SPH_C32(0x8d17b45c), - SPH_C32(0x2a727878), SPH_C32(0xf1f51fb4), SPH_C32(0x63157400), - SPH_C32(0x9bbd0000), SPH_C32(0x50360000), SPH_C32(0xabd10000), - SPH_C32(0x0e0e7e79), SPH_C32(0xdc4a5cd0), SPH_C32(0x2edd2c82), - SPH_C32(0x68b1f558) }, - { SPH_C32(0x04ff5270), SPH_C32(0xa87a0000), SPH_C32(0xfeee0000), - SPH_C32(0xde6a0000), SPH_C32(0x025a3c56), SPH_C32(0xc91201a5), - SPH_C32(0x4c667229), SPH_C32(0x63ba42be), SPH_C32(0xaa7e7430), - SPH_C32(0x7c980000), SPH_C32(0x7fb20000), SPH_C32(0x8d9e0000), - SPH_C32(0x06672580), SPH_C32(0xb1b6ade7), SPH_C32(0x7e424506), - SPH_C32(0xf6d85a30) }, - { SPH_C32(0x229f5030), SPH_C32(0x75a20000), SPH_C32(0x8cc40000), - SPH_C32(0x916c0000), SPH_C32(0x913c5ba9), SPH_C32(0xe0eb456b), - SPH_C32(0x7aed11fc), SPH_C32(0x6f9cb0dc), SPH_C32(0x45757640), - SPH_C32(0x46650000), SPH_C32(0x221c0000), SPH_C32(0xe4d70000), - SPH_C32(0x9d681986), SPH_C32(0xf5b3181e), SPH_C32(0x18564f57), - SPH_C32(0x6497073a) }, - { SPH_C32(0xcd945240), SPH_C32(0x4f5f0000), SPH_C32(0xd16a0000), - SPH_C32(0xf8250000), SPH_C32(0x0a3367af), SPH_C32(0xa4eef092), - SPH_C32(0x1cf91bad), SPH_C32(0xfdd3edd6), SPH_C32(0x8c1e7670), - SPH_C32(0xa1400000), SPH_C32(0x0d980000), SPH_C32(0xc2980000), - SPH_C32(0x9501427f), SPH_C32(0x984fe929), SPH_C32(0x48c926d3), - SPH_C32(0xfafea852) }, - { SPH_C32(0xffae6c00), SPH_C32(0x2b6e0000), SPH_C32(0xc2670000), - SPH_C32(0x46420000), SPH_C32(0x57343d3c), SPH_C32(0x3d5e8924), - SPH_C32(0x6ddb1f58), SPH_C32(0x107b3b71), SPH_C32(0x40726000), - SPH_C32(0x53040000), SPH_C32(0xa4f10000), SPH_C32(0x50a40000), - SPH_C32(0x7dc35a1c), SPH_C32(0x24ecf999), SPH_C32(0x2c1926bd), - SPH_C32(0xb4951347) }, - { SPH_C32(0x10a56e70), SPH_C32(0x11930000), SPH_C32(0x9fc90000), - SPH_C32(0x2f0b0000), SPH_C32(0xcc3b013a), SPH_C32(0x795b3cdd), - SPH_C32(0x0bcf1509), SPH_C32(0x8234667b), SPH_C32(0x89196030), - SPH_C32(0xb4210000), SPH_C32(0x8b750000), SPH_C32(0x76eb0000), - SPH_C32(0x75aa01e5), SPH_C32(0x491008ae), SPH_C32(0x7c864f39), - SPH_C32(0x2afcbc2f) }, - { SPH_C32(0x36c56c30), SPH_C32(0xcc4b0000), SPH_C32(0xede30000), - SPH_C32(0x600d0000), SPH_C32(0x5f5d66c5), SPH_C32(0x50a27813), - SPH_C32(0x3d4476dc), SPH_C32(0x8e129419), SPH_C32(0x66126240), - SPH_C32(0x8edc0000), SPH_C32(0xd6db0000), SPH_C32(0x1fa20000), - SPH_C32(0xeea53de3), SPH_C32(0x0d15bd57), SPH_C32(0x1a924568), - SPH_C32(0xb8b3e125) }, - { SPH_C32(0xd9ce6e40), SPH_C32(0xf6b60000), SPH_C32(0xb04d0000), - SPH_C32(0x09440000), SPH_C32(0xc4525ac3), SPH_C32(0x14a7cdea), - SPH_C32(0x5b507c8d), SPH_C32(0x1c5dc913), SPH_C32(0xaf796270), - SPH_C32(0x69f90000), SPH_C32(0xf95f0000), SPH_C32(0x39ed0000), - SPH_C32(0xe6cc661a), SPH_C32(0x60e94c60), SPH_C32(0x4a0d2cec), - SPH_C32(0x26da4e4d) }, - { SPH_C32(0x29449c00), SPH_C32(0x64e70000), SPH_C32(0xf24b0000), - SPH_C32(0xc2f30000), SPH_C32(0x0ede4e8f), SPH_C32(0x56c23745), - SPH_C32(0xf3e04259), SPH_C32(0x8d0d9ec4), SPH_C32(0x466d0c00), - SPH_C32(0x08620000), SPH_C32(0xdd5d0000), SPH_C32(0xbadd0000), - SPH_C32(0x6a927942), SPH_C32(0x441f2b93), SPH_C32(0x218ace6f), - SPH_C32(0xbf2c0be2) }, - { SPH_C32(0xc64f9e70), SPH_C32(0x5e1a0000), SPH_C32(0xafe50000), - SPH_C32(0xabba0000), SPH_C32(0x95d17289), SPH_C32(0x12c782bc), - SPH_C32(0x95f44808), SPH_C32(0x1f42c3ce), SPH_C32(0x8f060c30), - SPH_C32(0xef470000), SPH_C32(0xf2d90000), SPH_C32(0x9c920000), - SPH_C32(0x62fb22bb), SPH_C32(0x29e3daa4), SPH_C32(0x7115a7eb), - SPH_C32(0x2145a48a) }, - { SPH_C32(0xe02f9c30), SPH_C32(0x83c20000), SPH_C32(0xddcf0000), - SPH_C32(0xe4bc0000), SPH_C32(0x06b71576), SPH_C32(0x3b3ec672), - SPH_C32(0xa37f2bdd), SPH_C32(0x136431ac), SPH_C32(0x600d0e40), - SPH_C32(0xd5ba0000), SPH_C32(0xaf770000), SPH_C32(0xf5db0000), - SPH_C32(0xf9f41ebd), SPH_C32(0x6de66f5d), SPH_C32(0x1701adba), - SPH_C32(0xb30af980) }, - { SPH_C32(0x0f249e40), SPH_C32(0xb93f0000), SPH_C32(0x80610000), - SPH_C32(0x8df50000), SPH_C32(0x9db82970), SPH_C32(0x7f3b738b), - SPH_C32(0xc56b218c), SPH_C32(0x812b6ca6), SPH_C32(0xa9660e70), - SPH_C32(0x329f0000), SPH_C32(0x80f30000), SPH_C32(0xd3940000), - SPH_C32(0xf19d4544), SPH_C32(0x001a9e6a), SPH_C32(0x479ec43e), - SPH_C32(0x2d6356e8) }, - { SPH_C32(0x3d1ea000), SPH_C32(0xdd0e0000), SPH_C32(0x936c0000), - SPH_C32(0x33920000), SPH_C32(0xc0bf73e3), SPH_C32(0xe68b0a3d), - SPH_C32(0xb4492579), SPH_C32(0x6c83ba01), SPH_C32(0x650a1800), - SPH_C32(0xc0db0000), SPH_C32(0x299a0000), SPH_C32(0x41a80000), - SPH_C32(0x195f5d27), SPH_C32(0xbcb98eda), SPH_C32(0x234ec450), - SPH_C32(0x6308edfd) }, - { SPH_C32(0xd215a270), SPH_C32(0xe7f30000), SPH_C32(0xcec20000), - SPH_C32(0x5adb0000), SPH_C32(0x5bb04fe5), SPH_C32(0xa28ebfc4), - SPH_C32(0xd25d2f28), SPH_C32(0xfecce70b), SPH_C32(0xac611830), - SPH_C32(0x27fe0000), SPH_C32(0x061e0000), SPH_C32(0x67e70000), - SPH_C32(0x113606de), SPH_C32(0xd1457fed), SPH_C32(0x73d1add4), - SPH_C32(0xfd614295) }, - { SPH_C32(0xf475a030), SPH_C32(0x3a2b0000), SPH_C32(0xbce80000), - SPH_C32(0x15dd0000), SPH_C32(0xc8d6281a), SPH_C32(0x8b77fb0a), - SPH_C32(0xe4d64cfd), SPH_C32(0xf2ea1569), SPH_C32(0x436a1a40), - SPH_C32(0x1d030000), SPH_C32(0x5bb00000), SPH_C32(0x0eae0000), - SPH_C32(0x8a393ad8), SPH_C32(0x9540ca14), SPH_C32(0x15c5a785), - SPH_C32(0x6f2e1f9f) }, - { SPH_C32(0x1b7ea240), SPH_C32(0x00d60000), SPH_C32(0xe1460000), - SPH_C32(0x7c940000), SPH_C32(0x53d9141c), SPH_C32(0xcf724ef3), - SPH_C32(0x82c246ac), SPH_C32(0x60a54863), SPH_C32(0x8a011a70), - SPH_C32(0xfa260000), SPH_C32(0x74340000), SPH_C32(0x28e10000), - SPH_C32(0x82506121), SPH_C32(0xf8bc3b23), SPH_C32(0x455ace01), - SPH_C32(0xf147b0f7) }, - { SPH_C32(0x0a238800), SPH_C32(0xac5e0000), SPH_C32(0x068c0000), - SPH_C32(0x39860000), SPH_C32(0x7d136aea), SPH_C32(0xae64920c), - SPH_C32(0xf1244866), SPH_C32(0x512978db), SPH_C32(0x71502400), - SPH_C32(0x79320000), SPH_C32(0x48bd0000), SPH_C32(0xb0c90000), - SPH_C32(0xd73e604b), SPH_C32(0x0cf0b3a2), SPH_C32(0x64e7a370), - SPH_C32(0x8286c938) }, - { SPH_C32(0xe5288a70), SPH_C32(0x96a30000), SPH_C32(0x5b220000), - SPH_C32(0x50cf0000), SPH_C32(0xe61c56ec), SPH_C32(0xea6127f5), - SPH_C32(0x97304237), SPH_C32(0xc36625d1), SPH_C32(0xb83b2430), - SPH_C32(0x9e170000), SPH_C32(0x67390000), SPH_C32(0x96860000), - SPH_C32(0xdf573bb2), SPH_C32(0x610c4295), SPH_C32(0x3478caf4), - SPH_C32(0x1cef6650) }, - { SPH_C32(0xc3488830), SPH_C32(0x4b7b0000), SPH_C32(0x29080000), - SPH_C32(0x1fc90000), SPH_C32(0x757a3113), SPH_C32(0xc398633b), - SPH_C32(0xa1bb21e2), SPH_C32(0xcf40d7b3), SPH_C32(0x57302640), - SPH_C32(0xa4ea0000), SPH_C32(0x3a970000), SPH_C32(0xffcf0000), - SPH_C32(0x445807b4), SPH_C32(0x2509f76c), SPH_C32(0x526cc0a5), - SPH_C32(0x8ea03b5a) }, - { SPH_C32(0x2c438a40), SPH_C32(0x71860000), SPH_C32(0x74a60000), - SPH_C32(0x76800000), SPH_C32(0xee750d15), SPH_C32(0x879dd6c2), - SPH_C32(0xc7af2bb3), SPH_C32(0x5d0f8ab9), SPH_C32(0x9e5b2670), - SPH_C32(0x43cf0000), SPH_C32(0x15130000), SPH_C32(0xd9800000), - SPH_C32(0x4c315c4d), SPH_C32(0x48f5065b), SPH_C32(0x02f3a921), - SPH_C32(0x10c99432) }, - { SPH_C32(0x1e79b400), SPH_C32(0x15b70000), SPH_C32(0x67ab0000), - SPH_C32(0xc8e70000), SPH_C32(0xb3725786), SPH_C32(0x1e2daf74), - SPH_C32(0xb68d2f46), SPH_C32(0xb0a75c1e), SPH_C32(0x52373000), - SPH_C32(0xb18b0000), SPH_C32(0xbc7a0000), SPH_C32(0x4bbc0000), - SPH_C32(0xa4f3442e), SPH_C32(0xf45616eb), SPH_C32(0x6623a94f), - SPH_C32(0x5ea22f27) }, - { SPH_C32(0xf172b670), SPH_C32(0x2f4a0000), SPH_C32(0x3a050000), - SPH_C32(0xa1ae0000), SPH_C32(0x287d6b80), SPH_C32(0x5a281a8d), - SPH_C32(0xd0992517), SPH_C32(0x22e80114), SPH_C32(0x9b5c3030), - SPH_C32(0x56ae0000), SPH_C32(0x93fe0000), SPH_C32(0x6df30000), - SPH_C32(0xac9a1fd7), SPH_C32(0x99aae7dc), SPH_C32(0x36bcc0cb), - SPH_C32(0xc0cb804f) }, - { SPH_C32(0xd712b430), SPH_C32(0xf2920000), SPH_C32(0x482f0000), - SPH_C32(0xeea80000), SPH_C32(0xbb1b0c7f), SPH_C32(0x73d15e43), - SPH_C32(0xe61246c2), SPH_C32(0x2ecef376), SPH_C32(0x74573240), - SPH_C32(0x6c530000), SPH_C32(0xce500000), SPH_C32(0x04ba0000), - SPH_C32(0x379523d1), SPH_C32(0xddaf5225), SPH_C32(0x50a8ca9a), - SPH_C32(0x5284dd45) }, - { SPH_C32(0x3819b640), SPH_C32(0xc86f0000), SPH_C32(0x15810000), - SPH_C32(0x87e10000), SPH_C32(0x20143079), SPH_C32(0x37d4ebba), - SPH_C32(0x80064c93), SPH_C32(0xbc81ae7c), SPH_C32(0xbd3c3270), - SPH_C32(0x8b760000), SPH_C32(0xe1d40000), SPH_C32(0x22f50000), - SPH_C32(0x3ffc7828), SPH_C32(0xb053a312), SPH_C32(0x0037a31e), - SPH_C32(0xcced722d) }, - { SPH_C32(0x7d6cc000), SPH_C32(0x8e0a0000), SPH_C32(0x379d0000), - SPH_C32(0x63360000), SPH_C32(0xbd7c29ff), SPH_C32(0xc267f3a4), - SPH_C32(0x985003c4), SPH_C32(0xd816a946), SPH_C32(0xdad61400), - SPH_C32(0xb8b10000), SPH_C32(0x4f0c0000), SPH_C32(0x574e0000), - SPH_C32(0x33a83a07), SPH_C32(0xa50bfe67), SPH_C32(0x628cfdb5), - SPH_C32(0xc7e6c5cb) }, - { SPH_C32(0x9267c270), SPH_C32(0xb4f70000), SPH_C32(0x6a330000), - SPH_C32(0x0a7f0000), SPH_C32(0x267315f9), SPH_C32(0x8662465d), - SPH_C32(0xfe440995), SPH_C32(0x4a59f44c), SPH_C32(0x13bd1430), - SPH_C32(0x5f940000), SPH_C32(0x60880000), SPH_C32(0x71010000), - SPH_C32(0x3bc161fe), SPH_C32(0xc8f70f50), SPH_C32(0x32139431), - SPH_C32(0x598f6aa3) }, - { SPH_C32(0xb407c030), SPH_C32(0x692f0000), SPH_C32(0x18190000), - SPH_C32(0x45790000), SPH_C32(0xb5157206), SPH_C32(0xaf9b0293), - SPH_C32(0xc8cf6a40), SPH_C32(0x467f062e), SPH_C32(0xfcb61640), - SPH_C32(0x65690000), SPH_C32(0x3d260000), SPH_C32(0x18480000), - SPH_C32(0xa0ce5df8), SPH_C32(0x8cf2baa9), SPH_C32(0x54079e60), - SPH_C32(0xcbc037a9) }, - { SPH_C32(0x5b0cc240), SPH_C32(0x53d20000), SPH_C32(0x45b70000), - SPH_C32(0x2c300000), SPH_C32(0x2e1a4e00), SPH_C32(0xeb9eb76a), - SPH_C32(0xaedb6011), SPH_C32(0xd4305b24), SPH_C32(0x35dd1670), - SPH_C32(0x824c0000), SPH_C32(0x12a20000), SPH_C32(0x3e070000), - SPH_C32(0xa8a70601), SPH_C32(0xe10e4b9e), SPH_C32(0x0498f7e4), - SPH_C32(0x55a998c1) }, - { SPH_C32(0x6936fc00), SPH_C32(0x37e30000), SPH_C32(0x56ba0000), - SPH_C32(0x92570000), SPH_C32(0x731d1493), SPH_C32(0x722ecedc), - SPH_C32(0xdff964e4), SPH_C32(0x39988d83), SPH_C32(0xf9b10000), - SPH_C32(0x70080000), SPH_C32(0xbbcb0000), SPH_C32(0xac3b0000), - SPH_C32(0x40651e62), SPH_C32(0x5dad5b2e), SPH_C32(0x6048f78a), - SPH_C32(0x1bc223d4) }, - { SPH_C32(0x863dfe70), SPH_C32(0x0d1e0000), SPH_C32(0x0b140000), - SPH_C32(0xfb1e0000), SPH_C32(0xe8122895), SPH_C32(0x362b7b25), - SPH_C32(0xb9ed6eb5), SPH_C32(0xabd7d089), SPH_C32(0x30da0030), - SPH_C32(0x972d0000), SPH_C32(0x944f0000), SPH_C32(0x8a740000), - SPH_C32(0x480c459b), SPH_C32(0x3051aa19), SPH_C32(0x30d79e0e), - SPH_C32(0x85ab8cbc) }, - { SPH_C32(0xa05dfc30), SPH_C32(0xd0c60000), SPH_C32(0x793e0000), - SPH_C32(0xb4180000), SPH_C32(0x7b744f6a), SPH_C32(0x1fd23feb), - SPH_C32(0x8f660d60), SPH_C32(0xa7f122eb), SPH_C32(0xdfd10240), - SPH_C32(0xadd00000), SPH_C32(0xc9e10000), SPH_C32(0xe33d0000), - SPH_C32(0xd303799d), SPH_C32(0x74541fe0), SPH_C32(0x56c3945f), - SPH_C32(0x17e4d1b6) }, - { SPH_C32(0x4f56fe40), SPH_C32(0xea3b0000), SPH_C32(0x24900000), - SPH_C32(0xdd510000), SPH_C32(0xe07b736c), SPH_C32(0x5bd78a12), - SPH_C32(0xe9720731), SPH_C32(0x35be7fe1), SPH_C32(0x16ba0270), - SPH_C32(0x4af50000), SPH_C32(0xe6650000), SPH_C32(0xc5720000), - SPH_C32(0xdb6a2264), SPH_C32(0x19a8eed7), SPH_C32(0x065cfddb), - SPH_C32(0x898d7ede) }, - { SPH_C32(0x5e0bd400), SPH_C32(0x46b30000), SPH_C32(0xc35a0000), - SPH_C32(0x98430000), SPH_C32(0xceb10d9a), SPH_C32(0x3ac156ed), - SPH_C32(0x9a9409fb), SPH_C32(0x04324f59), SPH_C32(0xedeb3c00), - SPH_C32(0xc9e10000), SPH_C32(0xdaec0000), SPH_C32(0x5d5a0000), - SPH_C32(0x8e04230e), SPH_C32(0xede46656), SPH_C32(0x27e190aa), - SPH_C32(0xfa4c0711) }, - { SPH_C32(0xb100d670), SPH_C32(0x7c4e0000), SPH_C32(0x9ef40000), - SPH_C32(0xf10a0000), SPH_C32(0x55be319c), SPH_C32(0x7ec4e314), - SPH_C32(0xfc8003aa), SPH_C32(0x967d1253), SPH_C32(0x24803c30), - SPH_C32(0x2ec40000), SPH_C32(0xf5680000), SPH_C32(0x7b150000), - SPH_C32(0x866d78f7), SPH_C32(0x80189761), SPH_C32(0x777ef92e), - SPH_C32(0x6425a879) }, - { SPH_C32(0x9760d430), SPH_C32(0xa1960000), SPH_C32(0xecde0000), - SPH_C32(0xbe0c0000), SPH_C32(0xc6d85663), SPH_C32(0x573da7da), - SPH_C32(0xca0b607f), SPH_C32(0x9a5be031), SPH_C32(0xcb8b3e40), - SPH_C32(0x14390000), SPH_C32(0xa8c60000), SPH_C32(0x125c0000), - SPH_C32(0x1d6244f1), SPH_C32(0xc41d2298), SPH_C32(0x116af37f), - SPH_C32(0xf66af573) }, - { SPH_C32(0x786bd640), SPH_C32(0x9b6b0000), SPH_C32(0xb1700000), - SPH_C32(0xd7450000), SPH_C32(0x5dd76a65), SPH_C32(0x13381223), - SPH_C32(0xac1f6a2e), SPH_C32(0x0814bd3b), SPH_C32(0x02e03e70), - SPH_C32(0xf31c0000), SPH_C32(0x87420000), SPH_C32(0x34130000), - SPH_C32(0x150b1f08), SPH_C32(0xa9e1d3af), SPH_C32(0x41f59afb), - SPH_C32(0x68035a1b) }, - { SPH_C32(0x4a51e800), SPH_C32(0xff5a0000), SPH_C32(0xa27d0000), - SPH_C32(0x69220000), SPH_C32(0x00d030f6), SPH_C32(0x8a886b95), - SPH_C32(0xdd3d6edb), SPH_C32(0xe5bc6b9c), SPH_C32(0xce8c2800), - SPH_C32(0x01580000), SPH_C32(0x2e2b0000), SPH_C32(0xa62f0000), - SPH_C32(0xfdc9076b), SPH_C32(0x1542c31f), SPH_C32(0x25259a95), - SPH_C32(0x2668e10e) }, - { SPH_C32(0xa55aea70), SPH_C32(0xc5a70000), SPH_C32(0xffd30000), - SPH_C32(0x006b0000), SPH_C32(0x9bdf0cf0), SPH_C32(0xce8dde6c), - SPH_C32(0xbb29648a), SPH_C32(0x77f33696), SPH_C32(0x07e72830), - SPH_C32(0xe67d0000), SPH_C32(0x01af0000), SPH_C32(0x80600000), - SPH_C32(0xf5a05c92), SPH_C32(0x78be3228), SPH_C32(0x75baf311), - SPH_C32(0xb8014e66) }, - { SPH_C32(0x833ae830), SPH_C32(0x187f0000), SPH_C32(0x8df90000), - SPH_C32(0x4f6d0000), SPH_C32(0x08b96b0f), SPH_C32(0xe7749aa2), - SPH_C32(0x8da2075f), SPH_C32(0x7bd5c4f4), SPH_C32(0xe8ec2a40), - SPH_C32(0xdc800000), SPH_C32(0x5c010000), SPH_C32(0xe9290000), - SPH_C32(0x6eaf6094), SPH_C32(0x3cbb87d1), SPH_C32(0x13aef940), - SPH_C32(0x2a4e136c) }, - { SPH_C32(0x6c31ea40), SPH_C32(0x22820000), SPH_C32(0xd0570000), - SPH_C32(0x26240000), SPH_C32(0x93b65709), SPH_C32(0xa3712f5b), - SPH_C32(0xebb60d0e), SPH_C32(0xe99a99fe), SPH_C32(0x21872a70), - SPH_C32(0x3ba50000), SPH_C32(0x73850000), SPH_C32(0xcf660000), - SPH_C32(0x66c63b6d), SPH_C32(0x514776e6), SPH_C32(0x433190c4), - SPH_C32(0xb427bc04) }, - { SPH_C32(0xb5ff8400), SPH_C32(0xd4340000), SPH_C32(0x601a0000), - SPH_C32(0x2f600000), SPH_C32(0x57e40dca), SPH_C32(0xb7d6e2b1), - SPH_C32(0xb0e67183), SPH_C32(0xf5c750ed), SPH_C32(0x8efe4800), - SPH_C32(0x525c0000), SPH_C32(0x8ada0000), SPH_C32(0xf68b0000), - SPH_C32(0x800a5d77), SPH_C32(0x31ae3a86), SPH_C32(0x093cbc28), - SPH_C32(0x92fdf249) }, - { SPH_C32(0x5af48670), SPH_C32(0xeec90000), SPH_C32(0x3db40000), - SPH_C32(0x46290000), SPH_C32(0xcceb31cc), SPH_C32(0xf3d35748), - SPH_C32(0xd6f27bd2), SPH_C32(0x67880de7), SPH_C32(0x47954830), - SPH_C32(0xb5790000), SPH_C32(0xa55e0000), SPH_C32(0xd0c40000), - SPH_C32(0x8863068e), SPH_C32(0x5c52cbb1), SPH_C32(0x59a3d5ac), - SPH_C32(0x0c945d21) }, - { SPH_C32(0x7c948430), SPH_C32(0x33110000), SPH_C32(0x4f9e0000), - SPH_C32(0x092f0000), SPH_C32(0x5f8d5633), SPH_C32(0xda2a1386), - SPH_C32(0xe0791807), SPH_C32(0x6baeff85), SPH_C32(0xa89e4a40), - SPH_C32(0x8f840000), SPH_C32(0xf8f00000), SPH_C32(0xb98d0000), - SPH_C32(0x136c3a88), SPH_C32(0x18577e48), SPH_C32(0x3fb7dffd), - SPH_C32(0x9edb002b) }, - { SPH_C32(0x939f8640), SPH_C32(0x09ec0000), SPH_C32(0x12300000), - SPH_C32(0x60660000), SPH_C32(0xc4826a35), SPH_C32(0x9e2fa67f), - SPH_C32(0x866d1256), SPH_C32(0xf9e1a28f), SPH_C32(0x61f54a70), - SPH_C32(0x68a10000), SPH_C32(0xd7740000), SPH_C32(0x9fc20000), - SPH_C32(0x1b056171), SPH_C32(0x75ab8f7f), SPH_C32(0x6f28b679), - SPH_C32(0x00b2af43) }, - { SPH_C32(0xa1a5b800), SPH_C32(0x6ddd0000), SPH_C32(0x013d0000), - SPH_C32(0xde010000), SPH_C32(0x998530a6), SPH_C32(0x079fdfc9), - SPH_C32(0xf74f16a3), SPH_C32(0x14497428), SPH_C32(0xad995c00), - SPH_C32(0x9ae50000), SPH_C32(0x7e1d0000), SPH_C32(0x0dfe0000), - SPH_C32(0xf3c77912), SPH_C32(0xc9089fcf), SPH_C32(0x0bf8b617), - SPH_C32(0x4ed91456) }, - { SPH_C32(0x4eaeba70), SPH_C32(0x57200000), SPH_C32(0x5c930000), - SPH_C32(0xb7480000), SPH_C32(0x028a0ca0), SPH_C32(0x439a6a30), - SPH_C32(0x915b1cf2), SPH_C32(0x86062922), SPH_C32(0x64f25c30), - SPH_C32(0x7dc00000), SPH_C32(0x51990000), SPH_C32(0x2bb10000), - SPH_C32(0xfbae22eb), SPH_C32(0xa4f46ef8), SPH_C32(0x5b67df93), - SPH_C32(0xd0b0bb3e) }, - { SPH_C32(0x68ceb830), SPH_C32(0x8af80000), SPH_C32(0x2eb90000), - SPH_C32(0xf84e0000), SPH_C32(0x91ec6b5f), SPH_C32(0x6a632efe), - SPH_C32(0xa7d07f27), SPH_C32(0x8a20db40), SPH_C32(0x8bf95e40), - SPH_C32(0x473d0000), SPH_C32(0x0c370000), SPH_C32(0x42f80000), - SPH_C32(0x60a11eed), SPH_C32(0xe0f1db01), SPH_C32(0x3d73d5c2), - SPH_C32(0x42ffe634) }, - { SPH_C32(0x87c5ba40), SPH_C32(0xb0050000), SPH_C32(0x73170000), - SPH_C32(0x91070000), SPH_C32(0x0ae35759), SPH_C32(0x2e669b07), - SPH_C32(0xc1c47576), SPH_C32(0x186f864a), SPH_C32(0x42925e70), - SPH_C32(0xa0180000), SPH_C32(0x23b30000), SPH_C32(0x64b70000), - SPH_C32(0x68c84514), SPH_C32(0x8d0d2a36), SPH_C32(0x6decbc46), - SPH_C32(0xdc96495c) }, - { SPH_C32(0x96989000), SPH_C32(0x1c8d0000), SPH_C32(0x94dd0000), - SPH_C32(0xd4150000), SPH_C32(0x242929af), SPH_C32(0x4f7047f8), - SPH_C32(0xb2227bbc), SPH_C32(0x29e3b6f2), SPH_C32(0xb9c36000), - SPH_C32(0x230c0000), SPH_C32(0x1f3a0000), SPH_C32(0xfc9f0000), - SPH_C32(0x3da6447e), SPH_C32(0x7941a2b7), SPH_C32(0x4c51d137), - SPH_C32(0xaf573093) }, - { SPH_C32(0x79939270), SPH_C32(0x26700000), SPH_C32(0xc9730000), - SPH_C32(0xbd5c0000), SPH_C32(0xbf2615a9), SPH_C32(0x0b75f201), - SPH_C32(0xd43671ed), SPH_C32(0xbbacebf8), SPH_C32(0x70a86030), - SPH_C32(0xc4290000), SPH_C32(0x30be0000), SPH_C32(0xdad00000), - SPH_C32(0x35cf1f87), SPH_C32(0x14bd5380), SPH_C32(0x1cceb8b3), - SPH_C32(0x313e9ffb) }, - { SPH_C32(0x5ff39030), SPH_C32(0xfba80000), SPH_C32(0xbb590000), - SPH_C32(0xf25a0000), SPH_C32(0x2c407256), SPH_C32(0x228cb6cf), - SPH_C32(0xe2bd1238), SPH_C32(0xb78a199a), SPH_C32(0x9fa36240), - SPH_C32(0xfed40000), SPH_C32(0x6d100000), SPH_C32(0xb3990000), - SPH_C32(0xaec02381), SPH_C32(0x50b8e679), SPH_C32(0x7adab2e2), - SPH_C32(0xa371c2f1) }, - { SPH_C32(0xb0f89240), SPH_C32(0xc1550000), SPH_C32(0xe6f70000), - SPH_C32(0x9b130000), SPH_C32(0xb74f4e50), SPH_C32(0x66890336), - SPH_C32(0x84a91869), SPH_C32(0x25c54490), SPH_C32(0x56c86270), - SPH_C32(0x19f10000), SPH_C32(0x42940000), SPH_C32(0x95d60000), - SPH_C32(0xa6a97878), SPH_C32(0x3d44174e), SPH_C32(0x2a45db66), - SPH_C32(0x3d186d99) }, - { SPH_C32(0x82c2ac00), SPH_C32(0xa5640000), SPH_C32(0xf5fa0000), - SPH_C32(0x25740000), SPH_C32(0xea4814c3), SPH_C32(0xff397a80), - SPH_C32(0xf58b1c9c), SPH_C32(0xc86d9237), SPH_C32(0x9aa47400), - SPH_C32(0xebb50000), SPH_C32(0xebfd0000), SPH_C32(0x07ea0000), - SPH_C32(0x4e6b601b), SPH_C32(0x81e707fe), SPH_C32(0x4e95db08), - SPH_C32(0x7373d68c) }, - { SPH_C32(0x6dc9ae70), SPH_C32(0x9f990000), SPH_C32(0xa8540000), - SPH_C32(0x4c3d0000), SPH_C32(0x714728c5), SPH_C32(0xbb3ccf79), - SPH_C32(0x939f16cd), SPH_C32(0x5a22cf3d), SPH_C32(0x53cf7430), - SPH_C32(0x0c900000), SPH_C32(0xc4790000), SPH_C32(0x21a50000), - SPH_C32(0x46023be2), SPH_C32(0xec1bf6c9), SPH_C32(0x1e0ab28c), - SPH_C32(0xed1a79e4) }, - { SPH_C32(0x4ba9ac30), SPH_C32(0x42410000), SPH_C32(0xda7e0000), - SPH_C32(0x033b0000), SPH_C32(0xe2214f3a), SPH_C32(0x92c58bb7), - SPH_C32(0xa5147518), SPH_C32(0x56043d5f), SPH_C32(0xbcc47640), - SPH_C32(0x366d0000), SPH_C32(0x99d70000), SPH_C32(0x48ec0000), - SPH_C32(0xdd0d07e4), SPH_C32(0xa81e4330), SPH_C32(0x781eb8dd), - SPH_C32(0x7f5524ee) }, - { SPH_C32(0xa4a2ae40), SPH_C32(0x78bc0000), SPH_C32(0x87d00000), - SPH_C32(0x6a720000), SPH_C32(0x792e733c), SPH_C32(0xd6c03e4e), - SPH_C32(0xc3007f49), SPH_C32(0xc44b6055), SPH_C32(0x75af7670), - SPH_C32(0xd1480000), SPH_C32(0xb6530000), SPH_C32(0x6ea30000), - SPH_C32(0xd5645c1d), SPH_C32(0xc5e2b207), SPH_C32(0x2881d159), - SPH_C32(0xe13c8b86) }, - { SPH_C32(0xe1d7d800), SPH_C32(0x3ed90000), SPH_C32(0xa5cc0000), - SPH_C32(0x8ea50000), SPH_C32(0xe4466aba), SPH_C32(0x23732650), - SPH_C32(0xdb56301e), SPH_C32(0xa0dc676f), SPH_C32(0x12455000), - SPH_C32(0xe28f0000), SPH_C32(0x188b0000), SPH_C32(0x1b180000), - SPH_C32(0xd9301e32), SPH_C32(0xd0baef72), SPH_C32(0x4a3a8ff2), - SPH_C32(0xea373c60) }, - { SPH_C32(0x0edcda70), SPH_C32(0x04240000), SPH_C32(0xf8620000), - SPH_C32(0xe7ec0000), SPH_C32(0x7f4956bc), SPH_C32(0x677693a9), - SPH_C32(0xbd423a4f), SPH_C32(0x32933a65), SPH_C32(0xdb2e5030), - SPH_C32(0x05aa0000), SPH_C32(0x370f0000), SPH_C32(0x3d570000), - SPH_C32(0xd15945cb), SPH_C32(0xbd461e45), SPH_C32(0x1aa5e676), - SPH_C32(0x745e9308) }, - { SPH_C32(0x28bcd830), SPH_C32(0xd9fc0000), SPH_C32(0x8a480000), - SPH_C32(0xa8ea0000), SPH_C32(0xec2f3143), SPH_C32(0x4e8fd767), - SPH_C32(0x8bc9599a), SPH_C32(0x3eb5c807), SPH_C32(0x34255240), - SPH_C32(0x3f570000), SPH_C32(0x6aa10000), SPH_C32(0x541e0000), - SPH_C32(0x4a5679cd), SPH_C32(0xf943abbc), SPH_C32(0x7cb1ec27), - SPH_C32(0xe611ce02) }, - { SPH_C32(0xc7b7da40), SPH_C32(0xe3010000), SPH_C32(0xd7e60000), - SPH_C32(0xc1a30000), SPH_C32(0x77200d45), SPH_C32(0x0a8a629e), - SPH_C32(0xeddd53cb), SPH_C32(0xacfa950d), SPH_C32(0xfd4e5270), - SPH_C32(0xd8720000), SPH_C32(0x45250000), SPH_C32(0x72510000), - SPH_C32(0x423f2234), SPH_C32(0x94bf5a8b), SPH_C32(0x2c2e85a3), - SPH_C32(0x7878616a) }, - { SPH_C32(0xf58de400), SPH_C32(0x87300000), SPH_C32(0xc4eb0000), - SPH_C32(0x7fc40000), SPH_C32(0x2a2757d6), SPH_C32(0x933a1b28), - SPH_C32(0x9cff573e), SPH_C32(0x415243aa), SPH_C32(0x31224400), - SPH_C32(0x2a360000), SPH_C32(0xec4c0000), SPH_C32(0xe06d0000), - SPH_C32(0xaafd3a57), SPH_C32(0x281c4a3b), SPH_C32(0x48fe85cd), - SPH_C32(0x3613da7f) }, - { SPH_C32(0x1a86e670), SPH_C32(0xbdcd0000), SPH_C32(0x99450000), - SPH_C32(0x168d0000), SPH_C32(0xb1286bd0), SPH_C32(0xd73faed1), - SPH_C32(0xfaeb5d6f), SPH_C32(0xd31d1ea0), SPH_C32(0xf8494430), - SPH_C32(0xcd130000), SPH_C32(0xc3c80000), SPH_C32(0xc6220000), - SPH_C32(0xa29461ae), SPH_C32(0x45e0bb0c), SPH_C32(0x1861ec49), - SPH_C32(0xa87a7517) }, - { SPH_C32(0x3ce6e430), SPH_C32(0x60150000), SPH_C32(0xeb6f0000), - SPH_C32(0x598b0000), SPH_C32(0x224e0c2f), SPH_C32(0xfec6ea1f), - SPH_C32(0xcc603eba), SPH_C32(0xdf3becc2), SPH_C32(0x17424640), - SPH_C32(0xf7ee0000), SPH_C32(0x9e660000), SPH_C32(0xaf6b0000), - SPH_C32(0x399b5da8), SPH_C32(0x01e50ef5), SPH_C32(0x7e75e618), - SPH_C32(0x3a35281d) }, - { SPH_C32(0xd3ede640), SPH_C32(0x5ae80000), SPH_C32(0xb6c10000), - SPH_C32(0x30c20000), SPH_C32(0xb9413029), SPH_C32(0xbac35fe6), - SPH_C32(0xaa7434eb), SPH_C32(0x4d74b1c8), SPH_C32(0xde294670), - SPH_C32(0x10cb0000), SPH_C32(0xb1e20000), SPH_C32(0x89240000), - SPH_C32(0x31f20651), SPH_C32(0x6c19ffc2), SPH_C32(0x2eea8f9c), - SPH_C32(0xa45c8775) }, - { SPH_C32(0xc2b0cc00), SPH_C32(0xf6600000), SPH_C32(0x510b0000), - SPH_C32(0x75d00000), SPH_C32(0x978b4edf), SPH_C32(0xdbd58319), - SPH_C32(0xd9923a21), SPH_C32(0x7cf88170), SPH_C32(0x25787800), - SPH_C32(0x93df0000), SPH_C32(0x8d6b0000), SPH_C32(0x110c0000), - SPH_C32(0x649c073b), SPH_C32(0x98557743), SPH_C32(0x0f57e2ed), - SPH_C32(0xd79dfeba) }, - { SPH_C32(0x2dbbce70), SPH_C32(0xcc9d0000), SPH_C32(0x0ca50000), - SPH_C32(0x1c990000), SPH_C32(0x0c8472d9), SPH_C32(0x9fd036e0), - SPH_C32(0xbf863070), SPH_C32(0xeeb7dc7a), SPH_C32(0xec137830), - SPH_C32(0x74fa0000), SPH_C32(0xa2ef0000), SPH_C32(0x37430000), - SPH_C32(0x6cf55cc2), SPH_C32(0xf5a98674), SPH_C32(0x5fc88b69), - SPH_C32(0x49f451d2) }, - { SPH_C32(0x0bdbcc30), SPH_C32(0x11450000), SPH_C32(0x7e8f0000), - SPH_C32(0x539f0000), SPH_C32(0x9fe21526), SPH_C32(0xb629722e), - SPH_C32(0x890d53a5), SPH_C32(0xe2912e18), SPH_C32(0x03187a40), - SPH_C32(0x4e070000), SPH_C32(0xff410000), SPH_C32(0x5e0a0000), - SPH_C32(0xf7fa60c4), SPH_C32(0xb1ac338d), SPH_C32(0x39dc8138), - SPH_C32(0xdbbb0cd8) }, - { SPH_C32(0xe4d0ce40), SPH_C32(0x2bb80000), SPH_C32(0x23210000), - SPH_C32(0x3ad60000), SPH_C32(0x04ed2920), SPH_C32(0xf22cc7d7), - SPH_C32(0xef1959f4), SPH_C32(0x70de7312), SPH_C32(0xca737a70), - SPH_C32(0xa9220000), SPH_C32(0xd0c50000), SPH_C32(0x78450000), - SPH_C32(0xff933b3d), SPH_C32(0xdc50c2ba), SPH_C32(0x6943e8bc), - SPH_C32(0x45d2a3b0) }, - { SPH_C32(0xd6eaf000), SPH_C32(0x4f890000), SPH_C32(0x302c0000), - SPH_C32(0x84b10000), SPH_C32(0x59ea73b3), SPH_C32(0x6b9cbe61), - SPH_C32(0x9e3b5d01), SPH_C32(0x9d76a5b5), SPH_C32(0x061f6c00), - SPH_C32(0x5b660000), SPH_C32(0x79ac0000), SPH_C32(0xea790000), - SPH_C32(0x1751235e), SPH_C32(0x60f3d20a), SPH_C32(0x0d93e8d2), - SPH_C32(0x0bb918a5) }, - { SPH_C32(0x39e1f270), SPH_C32(0x75740000), SPH_C32(0x6d820000), - SPH_C32(0xedf80000), SPH_C32(0xc2e54fb5), SPH_C32(0x2f990b98), - SPH_C32(0xf82f5750), SPH_C32(0x0f39f8bf), SPH_C32(0xcf746c30), - SPH_C32(0xbc430000), SPH_C32(0x56280000), SPH_C32(0xcc360000), - SPH_C32(0x1f3878a7), SPH_C32(0x0d0f233d), SPH_C32(0x5d0c8156), - SPH_C32(0x95d0b7cd) }, - { SPH_C32(0x1f81f030), SPH_C32(0xa8ac0000), SPH_C32(0x1fa80000), - SPH_C32(0xa2fe0000), SPH_C32(0x5183284a), SPH_C32(0x06604f56), - SPH_C32(0xcea43485), SPH_C32(0x031f0add), SPH_C32(0x207f6e40), - SPH_C32(0x86be0000), SPH_C32(0x0b860000), SPH_C32(0xa57f0000), - SPH_C32(0x843744a1), SPH_C32(0x490a96c4), SPH_C32(0x3b188b07), - SPH_C32(0x079feac7) }, - { SPH_C32(0xf08af240), SPH_C32(0x92510000), SPH_C32(0x42060000), - SPH_C32(0xcbb70000), SPH_C32(0xca8c144c), SPH_C32(0x4265faaf), - SPH_C32(0xa8b03ed4), SPH_C32(0x915057d7), SPH_C32(0xe9146e70), - SPH_C32(0x619b0000), SPH_C32(0x24020000), SPH_C32(0x83300000), - SPH_C32(0x8c5e1f58), SPH_C32(0x24f667f3), SPH_C32(0x6b87e283), - SPH_C32(0x99f645af) }, - { SPH_C32(0x466d0c00), SPH_C32(0x08620000), SPH_C32(0xdd5d0000), - SPH_C32(0xbadd0000), SPH_C32(0x6a927942), SPH_C32(0x441f2b93), - SPH_C32(0x218ace6f), SPH_C32(0xbf2c0be2), SPH_C32(0x6f299000), - SPH_C32(0x6c850000), SPH_C32(0x2f160000), SPH_C32(0x782e0000), - SPH_C32(0x644c37cd), SPH_C32(0x12dd1cd6), SPH_C32(0xd26a8c36), - SPH_C32(0x32219526) }, - { SPH_C32(0xa9660e70), SPH_C32(0x329f0000), SPH_C32(0x80f30000), - SPH_C32(0xd3940000), SPH_C32(0xf19d4544), SPH_C32(0x001a9e6a), - SPH_C32(0x479ec43e), SPH_C32(0x2d6356e8), SPH_C32(0xa6429030), - SPH_C32(0x8ba00000), SPH_C32(0x00920000), SPH_C32(0x5e610000), - SPH_C32(0x6c256c34), SPH_C32(0x7f21ede1), SPH_C32(0x82f5e5b2), - SPH_C32(0xac483a4e) }, - { SPH_C32(0x8f060c30), SPH_C32(0xef470000), SPH_C32(0xf2d90000), - SPH_C32(0x9c920000), SPH_C32(0x62fb22bb), SPH_C32(0x29e3daa4), - SPH_C32(0x7115a7eb), SPH_C32(0x2145a48a), SPH_C32(0x49499240), - SPH_C32(0xb15d0000), SPH_C32(0x5d3c0000), SPH_C32(0x37280000), - SPH_C32(0xf72a5032), SPH_C32(0x3b245818), SPH_C32(0xe4e1efe3), - SPH_C32(0x3e076744) }, - { SPH_C32(0x600d0e40), SPH_C32(0xd5ba0000), SPH_C32(0xaf770000), - SPH_C32(0xf5db0000), SPH_C32(0xf9f41ebd), SPH_C32(0x6de66f5d), - SPH_C32(0x1701adba), SPH_C32(0xb30af980), SPH_C32(0x80229270), - SPH_C32(0x56780000), SPH_C32(0x72b80000), SPH_C32(0x11670000), - SPH_C32(0xff430bcb), SPH_C32(0x56d8a92f), SPH_C32(0xb47e8667), - SPH_C32(0xa06ec82c) }, - { SPH_C32(0x52373000), SPH_C32(0xb18b0000), SPH_C32(0xbc7a0000), - SPH_C32(0x4bbc0000), SPH_C32(0xa4f3442e), SPH_C32(0xf45616eb), - SPH_C32(0x6623a94f), SPH_C32(0x5ea22f27), SPH_C32(0x4c4e8400), - SPH_C32(0xa43c0000), SPH_C32(0xdbd10000), SPH_C32(0x835b0000), - SPH_C32(0x178113a8), SPH_C32(0xea7bb99f), SPH_C32(0xd0ae8609), - SPH_C32(0xee057339) }, - { SPH_C32(0xbd3c3270), SPH_C32(0x8b760000), SPH_C32(0xe1d40000), - SPH_C32(0x22f50000), SPH_C32(0x3ffc7828), SPH_C32(0xb053a312), - SPH_C32(0x0037a31e), SPH_C32(0xcced722d), SPH_C32(0x85258430), - SPH_C32(0x43190000), SPH_C32(0xf4550000), SPH_C32(0xa5140000), - SPH_C32(0x1fe84851), SPH_C32(0x878748a8), SPH_C32(0x8031ef8d), - SPH_C32(0x706cdc51) }, - { SPH_C32(0x9b5c3030), SPH_C32(0x56ae0000), SPH_C32(0x93fe0000), - SPH_C32(0x6df30000), SPH_C32(0xac9a1fd7), SPH_C32(0x99aae7dc), - SPH_C32(0x36bcc0cb), SPH_C32(0xc0cb804f), SPH_C32(0x6a2e8640), - SPH_C32(0x79e40000), SPH_C32(0xa9fb0000), SPH_C32(0xcc5d0000), - SPH_C32(0x84e77457), SPH_C32(0xc382fd51), SPH_C32(0xe625e5dc), - SPH_C32(0xe223815b) }, - { SPH_C32(0x74573240), SPH_C32(0x6c530000), SPH_C32(0xce500000), - SPH_C32(0x04ba0000), SPH_C32(0x379523d1), SPH_C32(0xddaf5225), - SPH_C32(0x50a8ca9a), SPH_C32(0x5284dd45), SPH_C32(0xa3458670), - SPH_C32(0x9ec10000), SPH_C32(0x867f0000), SPH_C32(0xea120000), - SPH_C32(0x8c8e2fae), SPH_C32(0xae7e0c66), SPH_C32(0xb6ba8c58), - SPH_C32(0x7c4a2e33) }, - { SPH_C32(0x650a1800), SPH_C32(0xc0db0000), SPH_C32(0x299a0000), - SPH_C32(0x41a80000), SPH_C32(0x195f5d27), SPH_C32(0xbcb98eda), - SPH_C32(0x234ec450), SPH_C32(0x6308edfd), SPH_C32(0x5814b800), - SPH_C32(0x1dd50000), SPH_C32(0xbaf60000), SPH_C32(0x723a0000), - SPH_C32(0xd9e02ec4), SPH_C32(0x5a3284e7), SPH_C32(0x9707e129), - SPH_C32(0x0f8b57fc) }, - { SPH_C32(0x8a011a70), SPH_C32(0xfa260000), SPH_C32(0x74340000), - SPH_C32(0x28e10000), SPH_C32(0x82506121), SPH_C32(0xf8bc3b23), - SPH_C32(0x455ace01), SPH_C32(0xf147b0f7), SPH_C32(0x917fb830), - SPH_C32(0xfaf00000), SPH_C32(0x95720000), SPH_C32(0x54750000), - SPH_C32(0xd189753d), SPH_C32(0x37ce75d0), SPH_C32(0xc79888ad), - SPH_C32(0x91e2f894) }, - { SPH_C32(0xac611830), SPH_C32(0x27fe0000), SPH_C32(0x061e0000), - SPH_C32(0x67e70000), SPH_C32(0x113606de), SPH_C32(0xd1457fed), - SPH_C32(0x73d1add4), SPH_C32(0xfd614295), SPH_C32(0x7e74ba40), - SPH_C32(0xc00d0000), SPH_C32(0xc8dc0000), SPH_C32(0x3d3c0000), - SPH_C32(0x4a86493b), SPH_C32(0x73cbc029), SPH_C32(0xa18c82fc), - SPH_C32(0x03ada59e) }, - { SPH_C32(0x436a1a40), SPH_C32(0x1d030000), SPH_C32(0x5bb00000), - SPH_C32(0x0eae0000), SPH_C32(0x8a393ad8), SPH_C32(0x9540ca14), - SPH_C32(0x15c5a785), SPH_C32(0x6f2e1f9f), SPH_C32(0xb71fba70), - SPH_C32(0x27280000), SPH_C32(0xe7580000), SPH_C32(0x1b730000), - SPH_C32(0x42ef12c2), SPH_C32(0x1e37311e), SPH_C32(0xf113eb78), - SPH_C32(0x9dc40af6) }, - { SPH_C32(0x71502400), SPH_C32(0x79320000), SPH_C32(0x48bd0000), - SPH_C32(0xb0c90000), SPH_C32(0xd73e604b), SPH_C32(0x0cf0b3a2), - SPH_C32(0x64e7a370), SPH_C32(0x8286c938), SPH_C32(0x7b73ac00), - SPH_C32(0xd56c0000), SPH_C32(0x4e310000), SPH_C32(0x894f0000), - SPH_C32(0xaa2d0aa1), SPH_C32(0xa29421ae), SPH_C32(0x95c3eb16), - SPH_C32(0xd3afb1e3) }, - { SPH_C32(0x9e5b2670), SPH_C32(0x43cf0000), SPH_C32(0x15130000), - SPH_C32(0xd9800000), SPH_C32(0x4c315c4d), SPH_C32(0x48f5065b), - SPH_C32(0x02f3a921), SPH_C32(0x10c99432), SPH_C32(0xb218ac30), - SPH_C32(0x32490000), SPH_C32(0x61b50000), SPH_C32(0xaf000000), - SPH_C32(0xa2445158), SPH_C32(0xcf68d099), SPH_C32(0xc55c8292), - SPH_C32(0x4dc61e8b) }, - { SPH_C32(0xb83b2430), SPH_C32(0x9e170000), SPH_C32(0x67390000), - SPH_C32(0x96860000), SPH_C32(0xdf573bb2), SPH_C32(0x610c4295), - SPH_C32(0x3478caf4), SPH_C32(0x1cef6650), SPH_C32(0x5d13ae40), - SPH_C32(0x08b40000), SPH_C32(0x3c1b0000), SPH_C32(0xc6490000), - SPH_C32(0x394b6d5e), SPH_C32(0x8b6d6560), SPH_C32(0xa34888c3), - SPH_C32(0xdf894381) }, - { SPH_C32(0x57302640), SPH_C32(0xa4ea0000), SPH_C32(0x3a970000), - SPH_C32(0xffcf0000), SPH_C32(0x445807b4), SPH_C32(0x2509f76c), - SPH_C32(0x526cc0a5), SPH_C32(0x8ea03b5a), SPH_C32(0x9478ae70), - SPH_C32(0xef910000), SPH_C32(0x139f0000), SPH_C32(0xe0060000), - SPH_C32(0x312236a7), SPH_C32(0xe6919457), SPH_C32(0xf3d7e147), - SPH_C32(0x41e0ece9) }, - { SPH_C32(0x12455000), SPH_C32(0xe28f0000), SPH_C32(0x188b0000), - SPH_C32(0x1b180000), SPH_C32(0xd9301e32), SPH_C32(0xd0baef72), - SPH_C32(0x4a3a8ff2), SPH_C32(0xea373c60), SPH_C32(0xf3928800), - SPH_C32(0xdc560000), SPH_C32(0xbd470000), SPH_C32(0x95bd0000), - SPH_C32(0x3d767488), SPH_C32(0xf3c9c922), SPH_C32(0x916cbfec), - SPH_C32(0x4aeb5b0f) }, - { SPH_C32(0xfd4e5270), SPH_C32(0xd8720000), SPH_C32(0x45250000), - SPH_C32(0x72510000), SPH_C32(0x423f2234), SPH_C32(0x94bf5a8b), - SPH_C32(0x2c2e85a3), SPH_C32(0x7878616a), SPH_C32(0x3af98830), - SPH_C32(0x3b730000), SPH_C32(0x92c30000), SPH_C32(0xb3f20000), - SPH_C32(0x351f2f71), SPH_C32(0x9e353815), SPH_C32(0xc1f3d668), - SPH_C32(0xd482f467) }, - { SPH_C32(0xdb2e5030), SPH_C32(0x05aa0000), SPH_C32(0x370f0000), - SPH_C32(0x3d570000), SPH_C32(0xd15945cb), SPH_C32(0xbd461e45), - SPH_C32(0x1aa5e676), SPH_C32(0x745e9308), SPH_C32(0xd5f28a40), - SPH_C32(0x018e0000), SPH_C32(0xcf6d0000), SPH_C32(0xdabb0000), - SPH_C32(0xae101377), SPH_C32(0xda308dec), SPH_C32(0xa7e7dc39), - SPH_C32(0x46cda96d) }, - { SPH_C32(0x34255240), SPH_C32(0x3f570000), SPH_C32(0x6aa10000), - SPH_C32(0x541e0000), SPH_C32(0x4a5679cd), SPH_C32(0xf943abbc), - SPH_C32(0x7cb1ec27), SPH_C32(0xe611ce02), SPH_C32(0x1c998a70), - SPH_C32(0xe6ab0000), SPH_C32(0xe0e90000), SPH_C32(0xfcf40000), - SPH_C32(0xa679488e), SPH_C32(0xb7cc7cdb), SPH_C32(0xf778b5bd), - SPH_C32(0xd8a40605) }, - { SPH_C32(0x061f6c00), SPH_C32(0x5b660000), SPH_C32(0x79ac0000), - SPH_C32(0xea790000), SPH_C32(0x1751235e), SPH_C32(0x60f3d20a), - SPH_C32(0x0d93e8d2), SPH_C32(0x0bb918a5), SPH_C32(0xd0f59c00), - SPH_C32(0x14ef0000), SPH_C32(0x49800000), SPH_C32(0x6ec80000), - SPH_C32(0x4ebb50ed), SPH_C32(0x0b6f6c6b), SPH_C32(0x93a8b5d3), - SPH_C32(0x96cfbd10) }, - { SPH_C32(0xe9146e70), SPH_C32(0x619b0000), SPH_C32(0x24020000), - SPH_C32(0x83300000), SPH_C32(0x8c5e1f58), SPH_C32(0x24f667f3), - SPH_C32(0x6b87e283), SPH_C32(0x99f645af), SPH_C32(0x199e9c30), - SPH_C32(0xf3ca0000), SPH_C32(0x66040000), SPH_C32(0x48870000), - SPH_C32(0x46d20b14), SPH_C32(0x66939d5c), SPH_C32(0xc337dc57), - SPH_C32(0x08a61278) }, - { SPH_C32(0xcf746c30), SPH_C32(0xbc430000), SPH_C32(0x56280000), - SPH_C32(0xcc360000), SPH_C32(0x1f3878a7), SPH_C32(0x0d0f233d), - SPH_C32(0x5d0c8156), SPH_C32(0x95d0b7cd), SPH_C32(0xf6959e40), - SPH_C32(0xc9370000), SPH_C32(0x3baa0000), SPH_C32(0x21ce0000), - SPH_C32(0xdddd3712), SPH_C32(0x229628a5), SPH_C32(0xa523d606), - SPH_C32(0x9ae94f72) }, - { SPH_C32(0x207f6e40), SPH_C32(0x86be0000), SPH_C32(0x0b860000), - SPH_C32(0xa57f0000), SPH_C32(0x843744a1), SPH_C32(0x490a96c4), - SPH_C32(0x3b188b07), SPH_C32(0x079feac7), SPH_C32(0x3ffe9e70), - SPH_C32(0x2e120000), SPH_C32(0x142e0000), SPH_C32(0x07810000), - SPH_C32(0xd5b46ceb), SPH_C32(0x4f6ad992), SPH_C32(0xf5bcbf82), - SPH_C32(0x0480e01a) }, - { SPH_C32(0x31224400), SPH_C32(0x2a360000), SPH_C32(0xec4c0000), - SPH_C32(0xe06d0000), SPH_C32(0xaafd3a57), SPH_C32(0x281c4a3b), - SPH_C32(0x48fe85cd), SPH_C32(0x3613da7f), SPH_C32(0xc4afa000), - SPH_C32(0xad060000), SPH_C32(0x28a70000), SPH_C32(0x9fa90000), - SPH_C32(0x80da6d81), SPH_C32(0xbb265113), SPH_C32(0xd401d2f3), - SPH_C32(0x774199d5) }, - { SPH_C32(0xde294670), SPH_C32(0x10cb0000), SPH_C32(0xb1e20000), - SPH_C32(0x89240000), SPH_C32(0x31f20651), SPH_C32(0x6c19ffc2), - SPH_C32(0x2eea8f9c), SPH_C32(0xa45c8775), SPH_C32(0x0dc4a030), - SPH_C32(0x4a230000), SPH_C32(0x07230000), SPH_C32(0xb9e60000), - SPH_C32(0x88b33678), SPH_C32(0xd6daa024), SPH_C32(0x849ebb77), - SPH_C32(0xe92836bd) }, - { SPH_C32(0xf8494430), SPH_C32(0xcd130000), SPH_C32(0xc3c80000), - SPH_C32(0xc6220000), SPH_C32(0xa29461ae), SPH_C32(0x45e0bb0c), - SPH_C32(0x1861ec49), SPH_C32(0xa87a7517), SPH_C32(0xe2cfa240), - SPH_C32(0x70de0000), SPH_C32(0x5a8d0000), SPH_C32(0xd0af0000), - SPH_C32(0x13bc0a7e), SPH_C32(0x92df15dd), SPH_C32(0xe28ab126), - SPH_C32(0x7b676bb7) }, - { SPH_C32(0x17424640), SPH_C32(0xf7ee0000), SPH_C32(0x9e660000), - SPH_C32(0xaf6b0000), SPH_C32(0x399b5da8), SPH_C32(0x01e50ef5), - SPH_C32(0x7e75e618), SPH_C32(0x3a35281d), SPH_C32(0x2ba4a270), - SPH_C32(0x97fb0000), SPH_C32(0x75090000), SPH_C32(0xf6e00000), - SPH_C32(0x1bd55187), SPH_C32(0xff23e4ea), SPH_C32(0xb215d8a2), - SPH_C32(0xe50ec4df) }, - { SPH_C32(0x25787800), SPH_C32(0x93df0000), SPH_C32(0x8d6b0000), - SPH_C32(0x110c0000), SPH_C32(0x649c073b), SPH_C32(0x98557743), - SPH_C32(0x0f57e2ed), SPH_C32(0xd79dfeba), SPH_C32(0xe7c8b400), - SPH_C32(0x65bf0000), SPH_C32(0xdc600000), SPH_C32(0x64dc0000), - SPH_C32(0xf31749e4), SPH_C32(0x4380f45a), SPH_C32(0xd6c5d8cc), - SPH_C32(0xab657fca) }, - { SPH_C32(0xca737a70), SPH_C32(0xa9220000), SPH_C32(0xd0c50000), - SPH_C32(0x78450000), SPH_C32(0xff933b3d), SPH_C32(0xdc50c2ba), - SPH_C32(0x6943e8bc), SPH_C32(0x45d2a3b0), SPH_C32(0x2ea3b430), - SPH_C32(0x829a0000), SPH_C32(0xf3e40000), SPH_C32(0x42930000), - SPH_C32(0xfb7e121d), SPH_C32(0x2e7c056d), SPH_C32(0x865ab148), - SPH_C32(0x350cd0a2) }, - { SPH_C32(0xec137830), SPH_C32(0x74fa0000), SPH_C32(0xa2ef0000), - SPH_C32(0x37430000), SPH_C32(0x6cf55cc2), SPH_C32(0xf5a98674), - SPH_C32(0x5fc88b69), SPH_C32(0x49f451d2), SPH_C32(0xc1a8b640), - SPH_C32(0xb8670000), SPH_C32(0xae4a0000), SPH_C32(0x2bda0000), - SPH_C32(0x60712e1b), SPH_C32(0x6a79b094), SPH_C32(0xe04ebb19), - SPH_C32(0xa7438da8) }, - { SPH_C32(0x03187a40), SPH_C32(0x4e070000), SPH_C32(0xff410000), - SPH_C32(0x5e0a0000), SPH_C32(0xf7fa60c4), SPH_C32(0xb1ac338d), - SPH_C32(0x39dc8138), SPH_C32(0xdbbb0cd8), SPH_C32(0x08c3b670), - SPH_C32(0x5f420000), SPH_C32(0x81ce0000), SPH_C32(0x0d950000), - SPH_C32(0x681875e2), SPH_C32(0x078541a3), SPH_C32(0xb0d1d29d), - SPH_C32(0x392a22c0) }, - { SPH_C32(0xdad61400), SPH_C32(0xb8b10000), SPH_C32(0x4f0c0000), - SPH_C32(0x574e0000), SPH_C32(0x33a83a07), SPH_C32(0xa50bfe67), - SPH_C32(0x628cfdb5), SPH_C32(0xc7e6c5cb), SPH_C32(0xa7bad400), - SPH_C32(0x36bb0000), SPH_C32(0x78910000), SPH_C32(0x34780000), - SPH_C32(0x8ed413f8), SPH_C32(0x676c0dc3), SPH_C32(0xfadcfe71), - SPH_C32(0x1ff06c8d) }, - { SPH_C32(0x35dd1670), SPH_C32(0x824c0000), SPH_C32(0x12a20000), - SPH_C32(0x3e070000), SPH_C32(0xa8a70601), SPH_C32(0xe10e4b9e), - SPH_C32(0x0498f7e4), SPH_C32(0x55a998c1), SPH_C32(0x6ed1d430), - SPH_C32(0xd19e0000), SPH_C32(0x57150000), SPH_C32(0x12370000), - SPH_C32(0x86bd4801), SPH_C32(0x0a90fcf4), SPH_C32(0xaa4397f5), - SPH_C32(0x8199c3e5) }, - { SPH_C32(0x13bd1430), SPH_C32(0x5f940000), SPH_C32(0x60880000), - SPH_C32(0x71010000), SPH_C32(0x3bc161fe), SPH_C32(0xc8f70f50), - SPH_C32(0x32139431), SPH_C32(0x598f6aa3), SPH_C32(0x81dad640), - SPH_C32(0xeb630000), SPH_C32(0x0abb0000), SPH_C32(0x7b7e0000), - SPH_C32(0x1db27407), SPH_C32(0x4e95490d), SPH_C32(0xcc579da4), - SPH_C32(0x13d69eef) }, - { SPH_C32(0xfcb61640), SPH_C32(0x65690000), SPH_C32(0x3d260000), - SPH_C32(0x18480000), SPH_C32(0xa0ce5df8), SPH_C32(0x8cf2baa9), - SPH_C32(0x54079e60), SPH_C32(0xcbc037a9), SPH_C32(0x48b1d670), - SPH_C32(0x0c460000), SPH_C32(0x253f0000), SPH_C32(0x5d310000), - SPH_C32(0x15db2ffe), SPH_C32(0x2369b83a), SPH_C32(0x9cc8f420), - SPH_C32(0x8dbf3187) }, - { SPH_C32(0xce8c2800), SPH_C32(0x01580000), SPH_C32(0x2e2b0000), - SPH_C32(0xa62f0000), SPH_C32(0xfdc9076b), SPH_C32(0x1542c31f), - SPH_C32(0x25259a95), SPH_C32(0x2668e10e), SPH_C32(0x84ddc000), - SPH_C32(0xfe020000), SPH_C32(0x8c560000), SPH_C32(0xcf0d0000), - SPH_C32(0xfd19379d), SPH_C32(0x9fcaa88a), SPH_C32(0xf818f44e), - SPH_C32(0xc3d48a92) }, - { SPH_C32(0x21872a70), SPH_C32(0x3ba50000), SPH_C32(0x73850000), - SPH_C32(0xcf660000), SPH_C32(0x66c63b6d), SPH_C32(0x514776e6), - SPH_C32(0x433190c4), SPH_C32(0xb427bc04), SPH_C32(0x4db6c030), - SPH_C32(0x19270000), SPH_C32(0xa3d20000), SPH_C32(0xe9420000), - SPH_C32(0xf5706c64), SPH_C32(0xf23659bd), SPH_C32(0xa8879dca), - SPH_C32(0x5dbd25fa) }, - { SPH_C32(0x07e72830), SPH_C32(0xe67d0000), SPH_C32(0x01af0000), - SPH_C32(0x80600000), SPH_C32(0xf5a05c92), SPH_C32(0x78be3228), - SPH_C32(0x75baf311), SPH_C32(0xb8014e66), SPH_C32(0xa2bdc240), - SPH_C32(0x23da0000), SPH_C32(0xfe7c0000), SPH_C32(0x800b0000), - SPH_C32(0x6e7f5062), SPH_C32(0xb633ec44), SPH_C32(0xce93979b), - SPH_C32(0xcff278f0) }, - { SPH_C32(0xe8ec2a40), SPH_C32(0xdc800000), SPH_C32(0x5c010000), - SPH_C32(0xe9290000), SPH_C32(0x6eaf6094), SPH_C32(0x3cbb87d1), - SPH_C32(0x13aef940), SPH_C32(0x2a4e136c), SPH_C32(0x6bd6c270), - SPH_C32(0xc4ff0000), SPH_C32(0xd1f80000), SPH_C32(0xa6440000), - SPH_C32(0x66160b9b), SPH_C32(0xdbcf1d73), SPH_C32(0x9e0cfe1f), - SPH_C32(0x519bd798) }, - { SPH_C32(0xf9b10000), SPH_C32(0x70080000), SPH_C32(0xbbcb0000), - SPH_C32(0xac3b0000), SPH_C32(0x40651e62), SPH_C32(0x5dad5b2e), - SPH_C32(0x6048f78a), SPH_C32(0x1bc223d4), SPH_C32(0x9087fc00), - SPH_C32(0x47eb0000), SPH_C32(0xed710000), SPH_C32(0x3e6c0000), - SPH_C32(0x33780af1), SPH_C32(0x2f8395f2), SPH_C32(0xbfb1936e), - SPH_C32(0x225aae57) }, - { SPH_C32(0x16ba0270), SPH_C32(0x4af50000), SPH_C32(0xe6650000), - SPH_C32(0xc5720000), SPH_C32(0xdb6a2264), SPH_C32(0x19a8eed7), - SPH_C32(0x065cfddb), SPH_C32(0x898d7ede), SPH_C32(0x59ecfc30), - SPH_C32(0xa0ce0000), SPH_C32(0xc2f50000), SPH_C32(0x18230000), - SPH_C32(0x3b115108), SPH_C32(0x427f64c5), SPH_C32(0xef2efaea), - SPH_C32(0xbc33013f) }, - { SPH_C32(0x30da0030), SPH_C32(0x972d0000), SPH_C32(0x944f0000), - SPH_C32(0x8a740000), SPH_C32(0x480c459b), SPH_C32(0x3051aa19), - SPH_C32(0x30d79e0e), SPH_C32(0x85ab8cbc), SPH_C32(0xb6e7fe40), - SPH_C32(0x9a330000), SPH_C32(0x9f5b0000), SPH_C32(0x716a0000), - SPH_C32(0xa01e6d0e), SPH_C32(0x067ad13c), SPH_C32(0x893af0bb), - SPH_C32(0x2e7c5c35) }, - { SPH_C32(0xdfd10240), SPH_C32(0xadd00000), SPH_C32(0xc9e10000), - SPH_C32(0xe33d0000), SPH_C32(0xd303799d), SPH_C32(0x74541fe0), - SPH_C32(0x56c3945f), SPH_C32(0x17e4d1b6), SPH_C32(0x7f8cfe70), - SPH_C32(0x7d160000), SPH_C32(0xb0df0000), SPH_C32(0x57250000), - SPH_C32(0xa87736f7), SPH_C32(0x6b86200b), SPH_C32(0xd9a5993f), - SPH_C32(0xb015f35d) }, - { SPH_C32(0xedeb3c00), SPH_C32(0xc9e10000), SPH_C32(0xdaec0000), - SPH_C32(0x5d5a0000), SPH_C32(0x8e04230e), SPH_C32(0xede46656), - SPH_C32(0x27e190aa), SPH_C32(0xfa4c0711), SPH_C32(0xb3e0e800), - SPH_C32(0x8f520000), SPH_C32(0x19b60000), SPH_C32(0xc5190000), - SPH_C32(0x40b52e94), SPH_C32(0xd72530bb), SPH_C32(0xbd759951), - SPH_C32(0xfe7e4848) }, - { SPH_C32(0x02e03e70), SPH_C32(0xf31c0000), SPH_C32(0x87420000), - SPH_C32(0x34130000), SPH_C32(0x150b1f08), SPH_C32(0xa9e1d3af), - SPH_C32(0x41f59afb), SPH_C32(0x68035a1b), SPH_C32(0x7a8be830), - SPH_C32(0x68770000), SPH_C32(0x36320000), SPH_C32(0xe3560000), - SPH_C32(0x48dc756d), SPH_C32(0xbad9c18c), SPH_C32(0xedeaf0d5), - SPH_C32(0x6017e720) }, - { SPH_C32(0x24803c30), SPH_C32(0x2ec40000), SPH_C32(0xf5680000), - SPH_C32(0x7b150000), SPH_C32(0x866d78f7), SPH_C32(0x80189761), - SPH_C32(0x777ef92e), SPH_C32(0x6425a879), SPH_C32(0x9580ea40), - SPH_C32(0x528a0000), SPH_C32(0x6b9c0000), SPH_C32(0x8a1f0000), - SPH_C32(0xd3d3496b), SPH_C32(0xfedc7475), SPH_C32(0x8bfefa84), - SPH_C32(0xf258ba2a) }, - { SPH_C32(0xcb8b3e40), SPH_C32(0x14390000), SPH_C32(0xa8c60000), - SPH_C32(0x125c0000), SPH_C32(0x1d6244f1), SPH_C32(0xc41d2298), - SPH_C32(0x116af37f), SPH_C32(0xf66af573), SPH_C32(0x5cebea70), - SPH_C32(0xb5af0000), SPH_C32(0x44180000), SPH_C32(0xac500000), - SPH_C32(0xdbba1292), SPH_C32(0x93208542), SPH_C32(0xdb619300), - SPH_C32(0x6c311542) }, - { SPH_C32(0x8efe4800), SPH_C32(0x525c0000), SPH_C32(0x8ada0000), - SPH_C32(0xf68b0000), SPH_C32(0x800a5d77), SPH_C32(0x31ae3a86), - SPH_C32(0x093cbc28), SPH_C32(0x92fdf249), SPH_C32(0x3b01cc00), - SPH_C32(0x86680000), SPH_C32(0xeac00000), SPH_C32(0xd9eb0000), - SPH_C32(0xd7ee50bd), SPH_C32(0x8678d837), SPH_C32(0xb9dacdab), - SPH_C32(0x673aa2a4) }, - { SPH_C32(0x61f54a70), SPH_C32(0x68a10000), SPH_C32(0xd7740000), - SPH_C32(0x9fc20000), SPH_C32(0x1b056171), SPH_C32(0x75ab8f7f), - SPH_C32(0x6f28b679), SPH_C32(0x00b2af43), SPH_C32(0xf26acc30), - SPH_C32(0x614d0000), SPH_C32(0xc5440000), SPH_C32(0xffa40000), - SPH_C32(0xdf870b44), SPH_C32(0xeb842900), SPH_C32(0xe945a42f), - SPH_C32(0xf9530dcc) }, - { SPH_C32(0x47954830), SPH_C32(0xb5790000), SPH_C32(0xa55e0000), - SPH_C32(0xd0c40000), SPH_C32(0x8863068e), SPH_C32(0x5c52cbb1), - SPH_C32(0x59a3d5ac), SPH_C32(0x0c945d21), SPH_C32(0x1d61ce40), - SPH_C32(0x5bb00000), SPH_C32(0x98ea0000), SPH_C32(0x96ed0000), - SPH_C32(0x44883742), SPH_C32(0xaf819cf9), SPH_C32(0x8f51ae7e), - SPH_C32(0x6b1c50c6) }, - { SPH_C32(0xa89e4a40), SPH_C32(0x8f840000), SPH_C32(0xf8f00000), - SPH_C32(0xb98d0000), SPH_C32(0x136c3a88), SPH_C32(0x18577e48), - SPH_C32(0x3fb7dffd), SPH_C32(0x9edb002b), SPH_C32(0xd40ace70), - SPH_C32(0xbc950000), SPH_C32(0xb76e0000), SPH_C32(0xb0a20000), - SPH_C32(0x4ce16cbb), SPH_C32(0xc27d6dce), SPH_C32(0xdfcec7fa), - SPH_C32(0xf575ffae) }, - { SPH_C32(0x9aa47400), SPH_C32(0xebb50000), SPH_C32(0xebfd0000), - SPH_C32(0x07ea0000), SPH_C32(0x4e6b601b), SPH_C32(0x81e707fe), - SPH_C32(0x4e95db08), SPH_C32(0x7373d68c), SPH_C32(0x1866d800), - SPH_C32(0x4ed10000), SPH_C32(0x1e070000), SPH_C32(0x229e0000), - SPH_C32(0xa42374d8), SPH_C32(0x7ede7d7e), SPH_C32(0xbb1ec794), - SPH_C32(0xbb1e44bb) }, - { SPH_C32(0x75af7670), SPH_C32(0xd1480000), SPH_C32(0xb6530000), - SPH_C32(0x6ea30000), SPH_C32(0xd5645c1d), SPH_C32(0xc5e2b207), - SPH_C32(0x2881d159), SPH_C32(0xe13c8b86), SPH_C32(0xd10dd830), - SPH_C32(0xa9f40000), SPH_C32(0x31830000), SPH_C32(0x04d10000), - SPH_C32(0xac4a2f21), SPH_C32(0x13228c49), SPH_C32(0xeb81ae10), - SPH_C32(0x2577ebd3) }, - { SPH_C32(0x53cf7430), SPH_C32(0x0c900000), SPH_C32(0xc4790000), - SPH_C32(0x21a50000), SPH_C32(0x46023be2), SPH_C32(0xec1bf6c9), - SPH_C32(0x1e0ab28c), SPH_C32(0xed1a79e4), SPH_C32(0x3e06da40), - SPH_C32(0x93090000), SPH_C32(0x6c2d0000), SPH_C32(0x6d980000), - SPH_C32(0x37451327), SPH_C32(0x572739b0), SPH_C32(0x8d95a441), - SPH_C32(0xb738b6d9) }, - { SPH_C32(0xbcc47640), SPH_C32(0x366d0000), SPH_C32(0x99d70000), - SPH_C32(0x48ec0000), SPH_C32(0xdd0d07e4), SPH_C32(0xa81e4330), - SPH_C32(0x781eb8dd), SPH_C32(0x7f5524ee), SPH_C32(0xf76dda70), - SPH_C32(0x742c0000), SPH_C32(0x43a90000), SPH_C32(0x4bd70000), - SPH_C32(0x3f2c48de), SPH_C32(0x3adbc887), SPH_C32(0xdd0acdc5), - SPH_C32(0x295119b1) }, - { SPH_C32(0xad995c00), SPH_C32(0x9ae50000), SPH_C32(0x7e1d0000), - SPH_C32(0x0dfe0000), SPH_C32(0xf3c77912), SPH_C32(0xc9089fcf), - SPH_C32(0x0bf8b617), SPH_C32(0x4ed91456), SPH_C32(0x0c3ce400), - SPH_C32(0xf7380000), SPH_C32(0x7f200000), SPH_C32(0xd3ff0000), - SPH_C32(0x6a4249b4), SPH_C32(0xce974006), SPH_C32(0xfcb7a0b4), - SPH_C32(0x5a90607e) }, - { SPH_C32(0x42925e70), SPH_C32(0xa0180000), SPH_C32(0x23b30000), - SPH_C32(0x64b70000), SPH_C32(0x68c84514), SPH_C32(0x8d0d2a36), - SPH_C32(0x6decbc46), SPH_C32(0xdc96495c), SPH_C32(0xc557e430), - SPH_C32(0x101d0000), SPH_C32(0x50a40000), SPH_C32(0xf5b00000), - SPH_C32(0x622b124d), SPH_C32(0xa36bb131), SPH_C32(0xac28c930), - SPH_C32(0xc4f9cf16) }, - { SPH_C32(0x64f25c30), SPH_C32(0x7dc00000), SPH_C32(0x51990000), - SPH_C32(0x2bb10000), SPH_C32(0xfbae22eb), SPH_C32(0xa4f46ef8), - SPH_C32(0x5b67df93), SPH_C32(0xd0b0bb3e), SPH_C32(0x2a5ce640), - SPH_C32(0x2ae00000), SPH_C32(0x0d0a0000), SPH_C32(0x9cf90000), - SPH_C32(0xf9242e4b), SPH_C32(0xe76e04c8), SPH_C32(0xca3cc361), - SPH_C32(0x56b6921c) }, - { SPH_C32(0x8bf95e40), SPH_C32(0x473d0000), SPH_C32(0x0c370000), - SPH_C32(0x42f80000), SPH_C32(0x60a11eed), SPH_C32(0xe0f1db01), - SPH_C32(0x3d73d5c2), SPH_C32(0x42ffe634), SPH_C32(0xe337e670), - SPH_C32(0xcdc50000), SPH_C32(0x228e0000), SPH_C32(0xbab60000), - SPH_C32(0xf14d75b2), SPH_C32(0x8a92f5ff), SPH_C32(0x9aa3aae5), - SPH_C32(0xc8df3d74) }, - { SPH_C32(0xb9c36000), SPH_C32(0x230c0000), SPH_C32(0x1f3a0000), - SPH_C32(0xfc9f0000), SPH_C32(0x3da6447e), SPH_C32(0x7941a2b7), - SPH_C32(0x4c51d137), SPH_C32(0xaf573093), SPH_C32(0x2f5bf000), - SPH_C32(0x3f810000), SPH_C32(0x8be70000), SPH_C32(0x288a0000), - SPH_C32(0x198f6dd1), SPH_C32(0x3631e54f), SPH_C32(0xfe73aa8b), - SPH_C32(0x86b48661) }, - { SPH_C32(0x56c86270), SPH_C32(0x19f10000), SPH_C32(0x42940000), - SPH_C32(0x95d60000), SPH_C32(0xa6a97878), SPH_C32(0x3d44174e), - SPH_C32(0x2a45db66), SPH_C32(0x3d186d99), SPH_C32(0xe630f030), - SPH_C32(0xd8a40000), SPH_C32(0xa4630000), SPH_C32(0x0ec50000), - SPH_C32(0x11e63628), SPH_C32(0x5bcd1478), SPH_C32(0xaeecc30f), - SPH_C32(0x18dd2909) }, - { SPH_C32(0x70a86030), SPH_C32(0xc4290000), SPH_C32(0x30be0000), - SPH_C32(0xdad00000), SPH_C32(0x35cf1f87), SPH_C32(0x14bd5380), - SPH_C32(0x1cceb8b3), SPH_C32(0x313e9ffb), SPH_C32(0x093bf240), - SPH_C32(0xe2590000), SPH_C32(0xf9cd0000), SPH_C32(0x678c0000), - SPH_C32(0x8ae90a2e), SPH_C32(0x1fc8a181), SPH_C32(0xc8f8c95e), - SPH_C32(0x8a927403) }, - { SPH_C32(0x9fa36240), SPH_C32(0xfed40000), SPH_C32(0x6d100000), - SPH_C32(0xb3990000), SPH_C32(0xaec02381), SPH_C32(0x50b8e679), - SPH_C32(0x7adab2e2), SPH_C32(0xa371c2f1), SPH_C32(0xc050f270), - SPH_C32(0x057c0000), SPH_C32(0xd6490000), SPH_C32(0x41c30000), - SPH_C32(0x828051d7), SPH_C32(0x723450b6), SPH_C32(0x9867a0da), - SPH_C32(0x14fbdb6b) }, - { SPH_C32(0x6f299000), SPH_C32(0x6c850000), SPH_C32(0x2f160000), - SPH_C32(0x782e0000), SPH_C32(0x644c37cd), SPH_C32(0x12dd1cd6), - SPH_C32(0xd26a8c36), SPH_C32(0x32219526), SPH_C32(0x29449c00), - SPH_C32(0x64e70000), SPH_C32(0xf24b0000), SPH_C32(0xc2f30000), - SPH_C32(0x0ede4e8f), SPH_C32(0x56c23745), SPH_C32(0xf3e04259), - SPH_C32(0x8d0d9ec4) }, - { SPH_C32(0x80229270), SPH_C32(0x56780000), SPH_C32(0x72b80000), - SPH_C32(0x11670000), SPH_C32(0xff430bcb), SPH_C32(0x56d8a92f), - SPH_C32(0xb47e8667), SPH_C32(0xa06ec82c), SPH_C32(0xe02f9c30), - SPH_C32(0x83c20000), SPH_C32(0xddcf0000), SPH_C32(0xe4bc0000), - SPH_C32(0x06b71576), SPH_C32(0x3b3ec672), SPH_C32(0xa37f2bdd), - SPH_C32(0x136431ac) }, - { SPH_C32(0xa6429030), SPH_C32(0x8ba00000), SPH_C32(0x00920000), - SPH_C32(0x5e610000), SPH_C32(0x6c256c34), SPH_C32(0x7f21ede1), - SPH_C32(0x82f5e5b2), SPH_C32(0xac483a4e), SPH_C32(0x0f249e40), - SPH_C32(0xb93f0000), SPH_C32(0x80610000), SPH_C32(0x8df50000), - SPH_C32(0x9db82970), SPH_C32(0x7f3b738b), SPH_C32(0xc56b218c), - SPH_C32(0x812b6ca6) }, - { SPH_C32(0x49499240), SPH_C32(0xb15d0000), SPH_C32(0x5d3c0000), - SPH_C32(0x37280000), SPH_C32(0xf72a5032), SPH_C32(0x3b245818), - SPH_C32(0xe4e1efe3), SPH_C32(0x3e076744), SPH_C32(0xc64f9e70), - SPH_C32(0x5e1a0000), SPH_C32(0xafe50000), SPH_C32(0xabba0000), - SPH_C32(0x95d17289), SPH_C32(0x12c782bc), SPH_C32(0x95f44808), - SPH_C32(0x1f42c3ce) }, - { SPH_C32(0x7b73ac00), SPH_C32(0xd56c0000), SPH_C32(0x4e310000), - SPH_C32(0x894f0000), SPH_C32(0xaa2d0aa1), SPH_C32(0xa29421ae), - SPH_C32(0x95c3eb16), SPH_C32(0xd3afb1e3), SPH_C32(0x0a238800), - SPH_C32(0xac5e0000), SPH_C32(0x068c0000), SPH_C32(0x39860000), - SPH_C32(0x7d136aea), SPH_C32(0xae64920c), SPH_C32(0xf1244866), - SPH_C32(0x512978db) }, - { SPH_C32(0x9478ae70), SPH_C32(0xef910000), SPH_C32(0x139f0000), - SPH_C32(0xe0060000), SPH_C32(0x312236a7), SPH_C32(0xe6919457), - SPH_C32(0xf3d7e147), SPH_C32(0x41e0ece9), SPH_C32(0xc3488830), - SPH_C32(0x4b7b0000), SPH_C32(0x29080000), SPH_C32(0x1fc90000), - SPH_C32(0x757a3113), SPH_C32(0xc398633b), SPH_C32(0xa1bb21e2), - SPH_C32(0xcf40d7b3) }, - { SPH_C32(0xb218ac30), SPH_C32(0x32490000), SPH_C32(0x61b50000), - SPH_C32(0xaf000000), SPH_C32(0xa2445158), SPH_C32(0xcf68d099), - SPH_C32(0xc55c8292), SPH_C32(0x4dc61e8b), SPH_C32(0x2c438a40), - SPH_C32(0x71860000), SPH_C32(0x74a60000), SPH_C32(0x76800000), - SPH_C32(0xee750d15), SPH_C32(0x879dd6c2), SPH_C32(0xc7af2bb3), - SPH_C32(0x5d0f8ab9) }, - { SPH_C32(0x5d13ae40), SPH_C32(0x08b40000), SPH_C32(0x3c1b0000), - SPH_C32(0xc6490000), SPH_C32(0x394b6d5e), SPH_C32(0x8b6d6560), - SPH_C32(0xa34888c3), SPH_C32(0xdf894381), SPH_C32(0xe5288a70), - SPH_C32(0x96a30000), SPH_C32(0x5b220000), SPH_C32(0x50cf0000), - SPH_C32(0xe61c56ec), SPH_C32(0xea6127f5), SPH_C32(0x97304237), - SPH_C32(0xc36625d1) }, - { SPH_C32(0x4c4e8400), SPH_C32(0xa43c0000), SPH_C32(0xdbd10000), - SPH_C32(0x835b0000), SPH_C32(0x178113a8), SPH_C32(0xea7bb99f), - SPH_C32(0xd0ae8609), SPH_C32(0xee057339), SPH_C32(0x1e79b400), - SPH_C32(0x15b70000), SPH_C32(0x67ab0000), SPH_C32(0xc8e70000), - SPH_C32(0xb3725786), SPH_C32(0x1e2daf74), SPH_C32(0xb68d2f46), - SPH_C32(0xb0a75c1e) }, - { SPH_C32(0xa3458670), SPH_C32(0x9ec10000), SPH_C32(0x867f0000), - SPH_C32(0xea120000), SPH_C32(0x8c8e2fae), SPH_C32(0xae7e0c66), - SPH_C32(0xb6ba8c58), SPH_C32(0x7c4a2e33), SPH_C32(0xd712b430), - SPH_C32(0xf2920000), SPH_C32(0x482f0000), SPH_C32(0xeea80000), - SPH_C32(0xbb1b0c7f), SPH_C32(0x73d15e43), SPH_C32(0xe61246c2), - SPH_C32(0x2ecef376) }, - { SPH_C32(0x85258430), SPH_C32(0x43190000), SPH_C32(0xf4550000), - SPH_C32(0xa5140000), SPH_C32(0x1fe84851), SPH_C32(0x878748a8), - SPH_C32(0x8031ef8d), SPH_C32(0x706cdc51), SPH_C32(0x3819b640), - SPH_C32(0xc86f0000), SPH_C32(0x15810000), SPH_C32(0x87e10000), - SPH_C32(0x20143079), SPH_C32(0x37d4ebba), SPH_C32(0x80064c93), - SPH_C32(0xbc81ae7c) }, - { SPH_C32(0x6a2e8640), SPH_C32(0x79e40000), SPH_C32(0xa9fb0000), - SPH_C32(0xcc5d0000), SPH_C32(0x84e77457), SPH_C32(0xc382fd51), - SPH_C32(0xe625e5dc), SPH_C32(0xe223815b), SPH_C32(0xf172b670), - SPH_C32(0x2f4a0000), SPH_C32(0x3a050000), SPH_C32(0xa1ae0000), - SPH_C32(0x287d6b80), SPH_C32(0x5a281a8d), SPH_C32(0xd0992517), - SPH_C32(0x22e80114) }, - { SPH_C32(0x5814b800), SPH_C32(0x1dd50000), SPH_C32(0xbaf60000), - SPH_C32(0x723a0000), SPH_C32(0xd9e02ec4), SPH_C32(0x5a3284e7), - SPH_C32(0x9707e129), SPH_C32(0x0f8b57fc), SPH_C32(0x3d1ea000), - SPH_C32(0xdd0e0000), SPH_C32(0x936c0000), SPH_C32(0x33920000), - SPH_C32(0xc0bf73e3), SPH_C32(0xe68b0a3d), SPH_C32(0xb4492579), - SPH_C32(0x6c83ba01) }, - { SPH_C32(0xb71fba70), SPH_C32(0x27280000), SPH_C32(0xe7580000), - SPH_C32(0x1b730000), SPH_C32(0x42ef12c2), SPH_C32(0x1e37311e), - SPH_C32(0xf113eb78), SPH_C32(0x9dc40af6), SPH_C32(0xf475a030), - SPH_C32(0x3a2b0000), SPH_C32(0xbce80000), SPH_C32(0x15dd0000), - SPH_C32(0xc8d6281a), SPH_C32(0x8b77fb0a), SPH_C32(0xe4d64cfd), - SPH_C32(0xf2ea1569) }, - { SPH_C32(0x917fb830), SPH_C32(0xfaf00000), SPH_C32(0x95720000), - SPH_C32(0x54750000), SPH_C32(0xd189753d), SPH_C32(0x37ce75d0), - SPH_C32(0xc79888ad), SPH_C32(0x91e2f894), SPH_C32(0x1b7ea240), - SPH_C32(0x00d60000), SPH_C32(0xe1460000), SPH_C32(0x7c940000), - SPH_C32(0x53d9141c), SPH_C32(0xcf724ef3), SPH_C32(0x82c246ac), - SPH_C32(0x60a54863) }, - { SPH_C32(0x7e74ba40), SPH_C32(0xc00d0000), SPH_C32(0xc8dc0000), - SPH_C32(0x3d3c0000), SPH_C32(0x4a86493b), SPH_C32(0x73cbc029), - SPH_C32(0xa18c82fc), SPH_C32(0x03ada59e), SPH_C32(0xd215a270), - SPH_C32(0xe7f30000), SPH_C32(0xcec20000), SPH_C32(0x5adb0000), - SPH_C32(0x5bb04fe5), SPH_C32(0xa28ebfc4), SPH_C32(0xd25d2f28), - SPH_C32(0xfecce70b) }, - { SPH_C32(0x3b01cc00), SPH_C32(0x86680000), SPH_C32(0xeac00000), - SPH_C32(0xd9eb0000), SPH_C32(0xd7ee50bd), SPH_C32(0x8678d837), - SPH_C32(0xb9dacdab), SPH_C32(0x673aa2a4), SPH_C32(0xb5ff8400), - SPH_C32(0xd4340000), SPH_C32(0x601a0000), SPH_C32(0x2f600000), - SPH_C32(0x57e40dca), SPH_C32(0xb7d6e2b1), SPH_C32(0xb0e67183), - SPH_C32(0xf5c750ed) }, - { SPH_C32(0xd40ace70), SPH_C32(0xbc950000), SPH_C32(0xb76e0000), - SPH_C32(0xb0a20000), SPH_C32(0x4ce16cbb), SPH_C32(0xc27d6dce), - SPH_C32(0xdfcec7fa), SPH_C32(0xf575ffae), SPH_C32(0x7c948430), - SPH_C32(0x33110000), SPH_C32(0x4f9e0000), SPH_C32(0x092f0000), - SPH_C32(0x5f8d5633), SPH_C32(0xda2a1386), SPH_C32(0xe0791807), - SPH_C32(0x6baeff85) }, - { SPH_C32(0xf26acc30), SPH_C32(0x614d0000), SPH_C32(0xc5440000), - SPH_C32(0xffa40000), SPH_C32(0xdf870b44), SPH_C32(0xeb842900), - SPH_C32(0xe945a42f), SPH_C32(0xf9530dcc), SPH_C32(0x939f8640), - SPH_C32(0x09ec0000), SPH_C32(0x12300000), SPH_C32(0x60660000), - SPH_C32(0xc4826a35), SPH_C32(0x9e2fa67f), SPH_C32(0x866d1256), - SPH_C32(0xf9e1a28f) }, - { SPH_C32(0x1d61ce40), SPH_C32(0x5bb00000), SPH_C32(0x98ea0000), - SPH_C32(0x96ed0000), SPH_C32(0x44883742), SPH_C32(0xaf819cf9), - SPH_C32(0x8f51ae7e), SPH_C32(0x6b1c50c6), SPH_C32(0x5af48670), - SPH_C32(0xeec90000), SPH_C32(0x3db40000), SPH_C32(0x46290000), - SPH_C32(0xcceb31cc), SPH_C32(0xf3d35748), SPH_C32(0xd6f27bd2), - SPH_C32(0x67880de7) }, - { SPH_C32(0x2f5bf000), SPH_C32(0x3f810000), SPH_C32(0x8be70000), - SPH_C32(0x288a0000), SPH_C32(0x198f6dd1), SPH_C32(0x3631e54f), - SPH_C32(0xfe73aa8b), SPH_C32(0x86b48661), SPH_C32(0x96989000), - SPH_C32(0x1c8d0000), SPH_C32(0x94dd0000), SPH_C32(0xd4150000), - SPH_C32(0x242929af), SPH_C32(0x4f7047f8), SPH_C32(0xb2227bbc), - SPH_C32(0x29e3b6f2) }, - { SPH_C32(0xc050f270), SPH_C32(0x057c0000), SPH_C32(0xd6490000), - SPH_C32(0x41c30000), SPH_C32(0x828051d7), SPH_C32(0x723450b6), - SPH_C32(0x9867a0da), SPH_C32(0x14fbdb6b), SPH_C32(0x5ff39030), - SPH_C32(0xfba80000), SPH_C32(0xbb590000), SPH_C32(0xf25a0000), - SPH_C32(0x2c407256), SPH_C32(0x228cb6cf), SPH_C32(0xe2bd1238), - SPH_C32(0xb78a199a) }, - { SPH_C32(0xe630f030), SPH_C32(0xd8a40000), SPH_C32(0xa4630000), - SPH_C32(0x0ec50000), SPH_C32(0x11e63628), SPH_C32(0x5bcd1478), - SPH_C32(0xaeecc30f), SPH_C32(0x18dd2909), SPH_C32(0xb0f89240), - SPH_C32(0xc1550000), SPH_C32(0xe6f70000), SPH_C32(0x9b130000), - SPH_C32(0xb74f4e50), SPH_C32(0x66890336), SPH_C32(0x84a91869), - SPH_C32(0x25c54490) }, - { SPH_C32(0x093bf240), SPH_C32(0xe2590000), SPH_C32(0xf9cd0000), - SPH_C32(0x678c0000), SPH_C32(0x8ae90a2e), SPH_C32(0x1fc8a181), - SPH_C32(0xc8f8c95e), SPH_C32(0x8a927403), SPH_C32(0x79939270), - SPH_C32(0x26700000), SPH_C32(0xc9730000), SPH_C32(0xbd5c0000), - SPH_C32(0xbf2615a9), SPH_C32(0x0b75f201), SPH_C32(0xd43671ed), - SPH_C32(0xbbacebf8) }, - { SPH_C32(0x1866d800), SPH_C32(0x4ed10000), SPH_C32(0x1e070000), - SPH_C32(0x229e0000), SPH_C32(0xa42374d8), SPH_C32(0x7ede7d7e), - SPH_C32(0xbb1ec794), SPH_C32(0xbb1e44bb), SPH_C32(0x82c2ac00), - SPH_C32(0xa5640000), SPH_C32(0xf5fa0000), SPH_C32(0x25740000), - SPH_C32(0xea4814c3), SPH_C32(0xff397a80), SPH_C32(0xf58b1c9c), - SPH_C32(0xc86d9237) }, - { SPH_C32(0xf76dda70), SPH_C32(0x742c0000), SPH_C32(0x43a90000), - SPH_C32(0x4bd70000), SPH_C32(0x3f2c48de), SPH_C32(0x3adbc887), - SPH_C32(0xdd0acdc5), SPH_C32(0x295119b1), SPH_C32(0x4ba9ac30), - SPH_C32(0x42410000), SPH_C32(0xda7e0000), SPH_C32(0x033b0000), - SPH_C32(0xe2214f3a), SPH_C32(0x92c58bb7), SPH_C32(0xa5147518), - SPH_C32(0x56043d5f) }, - { SPH_C32(0xd10dd830), SPH_C32(0xa9f40000), SPH_C32(0x31830000), - SPH_C32(0x04d10000), SPH_C32(0xac4a2f21), SPH_C32(0x13228c49), - SPH_C32(0xeb81ae10), SPH_C32(0x2577ebd3), SPH_C32(0xa4a2ae40), - SPH_C32(0x78bc0000), SPH_C32(0x87d00000), SPH_C32(0x6a720000), - SPH_C32(0x792e733c), SPH_C32(0xd6c03e4e), SPH_C32(0xc3007f49), - SPH_C32(0xc44b6055) }, - { SPH_C32(0x3e06da40), SPH_C32(0x93090000), SPH_C32(0x6c2d0000), - SPH_C32(0x6d980000), SPH_C32(0x37451327), SPH_C32(0x572739b0), - SPH_C32(0x8d95a441), SPH_C32(0xb738b6d9), SPH_C32(0x6dc9ae70), - SPH_C32(0x9f990000), SPH_C32(0xa8540000), SPH_C32(0x4c3d0000), - SPH_C32(0x714728c5), SPH_C32(0xbb3ccf79), SPH_C32(0x939f16cd), - SPH_C32(0x5a22cf3d) }, - { SPH_C32(0x0c3ce400), SPH_C32(0xf7380000), SPH_C32(0x7f200000), - SPH_C32(0xd3ff0000), SPH_C32(0x6a4249b4), SPH_C32(0xce974006), - SPH_C32(0xfcb7a0b4), SPH_C32(0x5a90607e), SPH_C32(0xa1a5b800), - SPH_C32(0x6ddd0000), SPH_C32(0x013d0000), SPH_C32(0xde010000), - SPH_C32(0x998530a6), SPH_C32(0x079fdfc9), SPH_C32(0xf74f16a3), - SPH_C32(0x14497428) }, - { SPH_C32(0xe337e670), SPH_C32(0xcdc50000), SPH_C32(0x228e0000), - SPH_C32(0xbab60000), SPH_C32(0xf14d75b2), SPH_C32(0x8a92f5ff), - SPH_C32(0x9aa3aae5), SPH_C32(0xc8df3d74), SPH_C32(0x68ceb830), - SPH_C32(0x8af80000), SPH_C32(0x2eb90000), SPH_C32(0xf84e0000), - SPH_C32(0x91ec6b5f), SPH_C32(0x6a632efe), SPH_C32(0xa7d07f27), - SPH_C32(0x8a20db40) }, - { SPH_C32(0xc557e430), SPH_C32(0x101d0000), SPH_C32(0x50a40000), - SPH_C32(0xf5b00000), SPH_C32(0x622b124d), SPH_C32(0xa36bb131), - SPH_C32(0xac28c930), SPH_C32(0xc4f9cf16), SPH_C32(0x87c5ba40), - SPH_C32(0xb0050000), SPH_C32(0x73170000), SPH_C32(0x91070000), - SPH_C32(0x0ae35759), SPH_C32(0x2e669b07), SPH_C32(0xc1c47576), - SPH_C32(0x186f864a) }, - { SPH_C32(0x2a5ce640), SPH_C32(0x2ae00000), SPH_C32(0x0d0a0000), - SPH_C32(0x9cf90000), SPH_C32(0xf9242e4b), SPH_C32(0xe76e04c8), - SPH_C32(0xca3cc361), SPH_C32(0x56b6921c), SPH_C32(0x4eaeba70), - SPH_C32(0x57200000), SPH_C32(0x5c930000), SPH_C32(0xb7480000), - SPH_C32(0x028a0ca0), SPH_C32(0x439a6a30), SPH_C32(0x915b1cf2), - SPH_C32(0x86062922) }, - { SPH_C32(0xf3928800), SPH_C32(0xdc560000), SPH_C32(0xbd470000), - SPH_C32(0x95bd0000), SPH_C32(0x3d767488), SPH_C32(0xf3c9c922), - SPH_C32(0x916cbfec), SPH_C32(0x4aeb5b0f), SPH_C32(0xe1d7d800), - SPH_C32(0x3ed90000), SPH_C32(0xa5cc0000), SPH_C32(0x8ea50000), - SPH_C32(0xe4466aba), SPH_C32(0x23732650), SPH_C32(0xdb56301e), - SPH_C32(0xa0dc676f) }, - { SPH_C32(0x1c998a70), SPH_C32(0xe6ab0000), SPH_C32(0xe0e90000), - SPH_C32(0xfcf40000), SPH_C32(0xa679488e), SPH_C32(0xb7cc7cdb), - SPH_C32(0xf778b5bd), SPH_C32(0xd8a40605), SPH_C32(0x28bcd830), - SPH_C32(0xd9fc0000), SPH_C32(0x8a480000), SPH_C32(0xa8ea0000), - SPH_C32(0xec2f3143), SPH_C32(0x4e8fd767), SPH_C32(0x8bc9599a), - SPH_C32(0x3eb5c807) }, - { SPH_C32(0x3af98830), SPH_C32(0x3b730000), SPH_C32(0x92c30000), - SPH_C32(0xb3f20000), SPH_C32(0x351f2f71), SPH_C32(0x9e353815), - SPH_C32(0xc1f3d668), SPH_C32(0xd482f467), SPH_C32(0xc7b7da40), - SPH_C32(0xe3010000), SPH_C32(0xd7e60000), SPH_C32(0xc1a30000), - SPH_C32(0x77200d45), SPH_C32(0x0a8a629e), SPH_C32(0xeddd53cb), - SPH_C32(0xacfa950d) }, - { SPH_C32(0xd5f28a40), SPH_C32(0x018e0000), SPH_C32(0xcf6d0000), - SPH_C32(0xdabb0000), SPH_C32(0xae101377), SPH_C32(0xda308dec), - SPH_C32(0xa7e7dc39), SPH_C32(0x46cda96d), SPH_C32(0x0edcda70), - SPH_C32(0x04240000), SPH_C32(0xf8620000), SPH_C32(0xe7ec0000), - SPH_C32(0x7f4956bc), SPH_C32(0x677693a9), SPH_C32(0xbd423a4f), - SPH_C32(0x32933a65) }, - { SPH_C32(0xe7c8b400), SPH_C32(0x65bf0000), SPH_C32(0xdc600000), - SPH_C32(0x64dc0000), SPH_C32(0xf31749e4), SPH_C32(0x4380f45a), - SPH_C32(0xd6c5d8cc), SPH_C32(0xab657fca), SPH_C32(0xc2b0cc00), - SPH_C32(0xf6600000), SPH_C32(0x510b0000), SPH_C32(0x75d00000), - SPH_C32(0x978b4edf), SPH_C32(0xdbd58319), SPH_C32(0xd9923a21), - SPH_C32(0x7cf88170) }, - { SPH_C32(0x08c3b670), SPH_C32(0x5f420000), SPH_C32(0x81ce0000), - SPH_C32(0x0d950000), SPH_C32(0x681875e2), SPH_C32(0x078541a3), - SPH_C32(0xb0d1d29d), SPH_C32(0x392a22c0), SPH_C32(0x0bdbcc30), - SPH_C32(0x11450000), SPH_C32(0x7e8f0000), SPH_C32(0x539f0000), - SPH_C32(0x9fe21526), SPH_C32(0xb629722e), SPH_C32(0x890d53a5), - SPH_C32(0xe2912e18) }, - { SPH_C32(0x2ea3b430), SPH_C32(0x829a0000), SPH_C32(0xf3e40000), - SPH_C32(0x42930000), SPH_C32(0xfb7e121d), SPH_C32(0x2e7c056d), - SPH_C32(0x865ab148), SPH_C32(0x350cd0a2), SPH_C32(0xe4d0ce40), - SPH_C32(0x2bb80000), SPH_C32(0x23210000), SPH_C32(0x3ad60000), - SPH_C32(0x04ed2920), SPH_C32(0xf22cc7d7), SPH_C32(0xef1959f4), - SPH_C32(0x70de7312) }, - { SPH_C32(0xc1a8b640), SPH_C32(0xb8670000), SPH_C32(0xae4a0000), - SPH_C32(0x2bda0000), SPH_C32(0x60712e1b), SPH_C32(0x6a79b094), - SPH_C32(0xe04ebb19), SPH_C32(0xa7438da8), SPH_C32(0x2dbbce70), - SPH_C32(0xcc9d0000), SPH_C32(0x0ca50000), SPH_C32(0x1c990000), - SPH_C32(0x0c8472d9), SPH_C32(0x9fd036e0), SPH_C32(0xbf863070), - SPH_C32(0xeeb7dc7a) }, - { SPH_C32(0xd0f59c00), SPH_C32(0x14ef0000), SPH_C32(0x49800000), - SPH_C32(0x6ec80000), SPH_C32(0x4ebb50ed), SPH_C32(0x0b6f6c6b), - SPH_C32(0x93a8b5d3), SPH_C32(0x96cfbd10), SPH_C32(0xd6eaf000), - SPH_C32(0x4f890000), SPH_C32(0x302c0000), SPH_C32(0x84b10000), - SPH_C32(0x59ea73b3), SPH_C32(0x6b9cbe61), SPH_C32(0x9e3b5d01), - SPH_C32(0x9d76a5b5) }, - { SPH_C32(0x3ffe9e70), SPH_C32(0x2e120000), SPH_C32(0x142e0000), - SPH_C32(0x07810000), SPH_C32(0xd5b46ceb), SPH_C32(0x4f6ad992), - SPH_C32(0xf5bcbf82), SPH_C32(0x0480e01a), SPH_C32(0x1f81f030), - SPH_C32(0xa8ac0000), SPH_C32(0x1fa80000), SPH_C32(0xa2fe0000), - SPH_C32(0x5183284a), SPH_C32(0x06604f56), SPH_C32(0xcea43485), - SPH_C32(0x031f0add) }, - { SPH_C32(0x199e9c30), SPH_C32(0xf3ca0000), SPH_C32(0x66040000), - SPH_C32(0x48870000), SPH_C32(0x46d20b14), SPH_C32(0x66939d5c), - SPH_C32(0xc337dc57), SPH_C32(0x08a61278), SPH_C32(0xf08af240), - SPH_C32(0x92510000), SPH_C32(0x42060000), SPH_C32(0xcbb70000), - SPH_C32(0xca8c144c), SPH_C32(0x4265faaf), SPH_C32(0xa8b03ed4), - SPH_C32(0x915057d7) }, - { SPH_C32(0xf6959e40), SPH_C32(0xc9370000), SPH_C32(0x3baa0000), - SPH_C32(0x21ce0000), SPH_C32(0xdddd3712), SPH_C32(0x229628a5), - SPH_C32(0xa523d606), SPH_C32(0x9ae94f72), SPH_C32(0x39e1f270), - SPH_C32(0x75740000), SPH_C32(0x6d820000), SPH_C32(0xedf80000), - SPH_C32(0xc2e54fb5), SPH_C32(0x2f990b98), SPH_C32(0xf82f5750), - SPH_C32(0x0f39f8bf) }, - { SPH_C32(0xc4afa000), SPH_C32(0xad060000), SPH_C32(0x28a70000), - SPH_C32(0x9fa90000), SPH_C32(0x80da6d81), SPH_C32(0xbb265113), - SPH_C32(0xd401d2f3), SPH_C32(0x774199d5), SPH_C32(0xf58de400), - SPH_C32(0x87300000), SPH_C32(0xc4eb0000), SPH_C32(0x7fc40000), - SPH_C32(0x2a2757d6), SPH_C32(0x933a1b28), SPH_C32(0x9cff573e), - SPH_C32(0x415243aa) }, - { SPH_C32(0x2ba4a270), SPH_C32(0x97fb0000), SPH_C32(0x75090000), - SPH_C32(0xf6e00000), SPH_C32(0x1bd55187), SPH_C32(0xff23e4ea), - SPH_C32(0xb215d8a2), SPH_C32(0xe50ec4df), SPH_C32(0x3ce6e430), - SPH_C32(0x60150000), SPH_C32(0xeb6f0000), SPH_C32(0x598b0000), - SPH_C32(0x224e0c2f), SPH_C32(0xfec6ea1f), SPH_C32(0xcc603eba), - SPH_C32(0xdf3becc2) }, - { SPH_C32(0x0dc4a030), SPH_C32(0x4a230000), SPH_C32(0x07230000), - SPH_C32(0xb9e60000), SPH_C32(0x88b33678), SPH_C32(0xd6daa024), - SPH_C32(0x849ebb77), SPH_C32(0xe92836bd), SPH_C32(0xd3ede640), - SPH_C32(0x5ae80000), SPH_C32(0xb6c10000), SPH_C32(0x30c20000), - SPH_C32(0xb9413029), SPH_C32(0xbac35fe6), SPH_C32(0xaa7434eb), - SPH_C32(0x4d74b1c8) }, - { SPH_C32(0xe2cfa240), SPH_C32(0x70de0000), SPH_C32(0x5a8d0000), - SPH_C32(0xd0af0000), SPH_C32(0x13bc0a7e), SPH_C32(0x92df15dd), - SPH_C32(0xe28ab126), SPH_C32(0x7b676bb7), SPH_C32(0x1a86e670), - SPH_C32(0xbdcd0000), SPH_C32(0x99450000), SPH_C32(0x168d0000), - SPH_C32(0xb1286bd0), SPH_C32(0xd73faed1), SPH_C32(0xfaeb5d6f), - SPH_C32(0xd31d1ea0) }, - { SPH_C32(0xa7bad400), SPH_C32(0x36bb0000), SPH_C32(0x78910000), - SPH_C32(0x34780000), SPH_C32(0x8ed413f8), SPH_C32(0x676c0dc3), - SPH_C32(0xfadcfe71), SPH_C32(0x1ff06c8d), SPH_C32(0x7d6cc000), - SPH_C32(0x8e0a0000), SPH_C32(0x379d0000), SPH_C32(0x63360000), - SPH_C32(0xbd7c29ff), SPH_C32(0xc267f3a4), SPH_C32(0x985003c4), - SPH_C32(0xd816a946) }, - { SPH_C32(0x48b1d670), SPH_C32(0x0c460000), SPH_C32(0x253f0000), - SPH_C32(0x5d310000), SPH_C32(0x15db2ffe), SPH_C32(0x2369b83a), - SPH_C32(0x9cc8f420), SPH_C32(0x8dbf3187), SPH_C32(0xb407c030), - SPH_C32(0x692f0000), SPH_C32(0x18190000), SPH_C32(0x45790000), - SPH_C32(0xb5157206), SPH_C32(0xaf9b0293), SPH_C32(0xc8cf6a40), - SPH_C32(0x467f062e) }, - { SPH_C32(0x6ed1d430), SPH_C32(0xd19e0000), SPH_C32(0x57150000), - SPH_C32(0x12370000), SPH_C32(0x86bd4801), SPH_C32(0x0a90fcf4), - SPH_C32(0xaa4397f5), SPH_C32(0x8199c3e5), SPH_C32(0x5b0cc240), - SPH_C32(0x53d20000), SPH_C32(0x45b70000), SPH_C32(0x2c300000), - SPH_C32(0x2e1a4e00), SPH_C32(0xeb9eb76a), SPH_C32(0xaedb6011), - SPH_C32(0xd4305b24) }, - { SPH_C32(0x81dad640), SPH_C32(0xeb630000), SPH_C32(0x0abb0000), - SPH_C32(0x7b7e0000), SPH_C32(0x1db27407), SPH_C32(0x4e95490d), - SPH_C32(0xcc579da4), SPH_C32(0x13d69eef), SPH_C32(0x9267c270), - SPH_C32(0xb4f70000), SPH_C32(0x6a330000), SPH_C32(0x0a7f0000), - SPH_C32(0x267315f9), SPH_C32(0x8662465d), SPH_C32(0xfe440995), - SPH_C32(0x4a59f44c) }, - { SPH_C32(0xb3e0e800), SPH_C32(0x8f520000), SPH_C32(0x19b60000), - SPH_C32(0xc5190000), SPH_C32(0x40b52e94), SPH_C32(0xd72530bb), - SPH_C32(0xbd759951), SPH_C32(0xfe7e4848), SPH_C32(0x5e0bd400), - SPH_C32(0x46b30000), SPH_C32(0xc35a0000), SPH_C32(0x98430000), - SPH_C32(0xceb10d9a), SPH_C32(0x3ac156ed), SPH_C32(0x9a9409fb), - SPH_C32(0x04324f59) }, - { SPH_C32(0x5cebea70), SPH_C32(0xb5af0000), SPH_C32(0x44180000), - SPH_C32(0xac500000), SPH_C32(0xdbba1292), SPH_C32(0x93208542), - SPH_C32(0xdb619300), SPH_C32(0x6c311542), SPH_C32(0x9760d430), - SPH_C32(0xa1960000), SPH_C32(0xecde0000), SPH_C32(0xbe0c0000), - SPH_C32(0xc6d85663), SPH_C32(0x573da7da), SPH_C32(0xca0b607f), - SPH_C32(0x9a5be031) }, - { SPH_C32(0x7a8be830), SPH_C32(0x68770000), SPH_C32(0x36320000), - SPH_C32(0xe3560000), SPH_C32(0x48dc756d), SPH_C32(0xbad9c18c), - SPH_C32(0xedeaf0d5), SPH_C32(0x6017e720), SPH_C32(0x786bd640), - SPH_C32(0x9b6b0000), SPH_C32(0xb1700000), SPH_C32(0xd7450000), - SPH_C32(0x5dd76a65), SPH_C32(0x13381223), SPH_C32(0xac1f6a2e), - SPH_C32(0x0814bd3b) }, - { SPH_C32(0x9580ea40), SPH_C32(0x528a0000), SPH_C32(0x6b9c0000), - SPH_C32(0x8a1f0000), SPH_C32(0xd3d3496b), SPH_C32(0xfedc7475), - SPH_C32(0x8bfefa84), SPH_C32(0xf258ba2a), SPH_C32(0xb100d670), - SPH_C32(0x7c4e0000), SPH_C32(0x9ef40000), SPH_C32(0xf10a0000), - SPH_C32(0x55be319c), SPH_C32(0x7ec4e314), SPH_C32(0xfc8003aa), - SPH_C32(0x967d1253) }, - { SPH_C32(0x84ddc000), SPH_C32(0xfe020000), SPH_C32(0x8c560000), - SPH_C32(0xcf0d0000), SPH_C32(0xfd19379d), SPH_C32(0x9fcaa88a), - SPH_C32(0xf818f44e), SPH_C32(0xc3d48a92), SPH_C32(0x4a51e800), - SPH_C32(0xff5a0000), SPH_C32(0xa27d0000), SPH_C32(0x69220000), - SPH_C32(0x00d030f6), SPH_C32(0x8a886b95), SPH_C32(0xdd3d6edb), - SPH_C32(0xe5bc6b9c) }, - { SPH_C32(0x6bd6c270), SPH_C32(0xc4ff0000), SPH_C32(0xd1f80000), - SPH_C32(0xa6440000), SPH_C32(0x66160b9b), SPH_C32(0xdbcf1d73), - SPH_C32(0x9e0cfe1f), SPH_C32(0x519bd798), SPH_C32(0x833ae830), - SPH_C32(0x187f0000), SPH_C32(0x8df90000), SPH_C32(0x4f6d0000), - SPH_C32(0x08b96b0f), SPH_C32(0xe7749aa2), SPH_C32(0x8da2075f), - SPH_C32(0x7bd5c4f4) }, - { SPH_C32(0x4db6c030), SPH_C32(0x19270000), SPH_C32(0xa3d20000), - SPH_C32(0xe9420000), SPH_C32(0xf5706c64), SPH_C32(0xf23659bd), - SPH_C32(0xa8879dca), SPH_C32(0x5dbd25fa), SPH_C32(0x6c31ea40), - SPH_C32(0x22820000), SPH_C32(0xd0570000), SPH_C32(0x26240000), - SPH_C32(0x93b65709), SPH_C32(0xa3712f5b), SPH_C32(0xebb60d0e), - SPH_C32(0xe99a99fe) }, - { SPH_C32(0xa2bdc240), SPH_C32(0x23da0000), SPH_C32(0xfe7c0000), - SPH_C32(0x800b0000), SPH_C32(0x6e7f5062), SPH_C32(0xb633ec44), - SPH_C32(0xce93979b), SPH_C32(0xcff278f0), SPH_C32(0xa55aea70), - SPH_C32(0xc5a70000), SPH_C32(0xffd30000), SPH_C32(0x006b0000), - SPH_C32(0x9bdf0cf0), SPH_C32(0xce8dde6c), SPH_C32(0xbb29648a), - SPH_C32(0x77f33696) }, - { SPH_C32(0x9087fc00), SPH_C32(0x47eb0000), SPH_C32(0xed710000), - SPH_C32(0x3e6c0000), SPH_C32(0x33780af1), SPH_C32(0x2f8395f2), - SPH_C32(0xbfb1936e), SPH_C32(0x225aae57), SPH_C32(0x6936fc00), - SPH_C32(0x37e30000), SPH_C32(0x56ba0000), SPH_C32(0x92570000), - SPH_C32(0x731d1493), SPH_C32(0x722ecedc), SPH_C32(0xdff964e4), - SPH_C32(0x39988d83) }, - { SPH_C32(0x7f8cfe70), SPH_C32(0x7d160000), SPH_C32(0xb0df0000), - SPH_C32(0x57250000), SPH_C32(0xa87736f7), SPH_C32(0x6b86200b), - SPH_C32(0xd9a5993f), SPH_C32(0xb015f35d), SPH_C32(0xa05dfc30), - SPH_C32(0xd0c60000), SPH_C32(0x793e0000), SPH_C32(0xb4180000), - SPH_C32(0x7b744f6a), SPH_C32(0x1fd23feb), SPH_C32(0x8f660d60), - SPH_C32(0xa7f122eb) }, - { SPH_C32(0x59ecfc30), SPH_C32(0xa0ce0000), SPH_C32(0xc2f50000), - SPH_C32(0x18230000), SPH_C32(0x3b115108), SPH_C32(0x427f64c5), - SPH_C32(0xef2efaea), SPH_C32(0xbc33013f), SPH_C32(0x4f56fe40), - SPH_C32(0xea3b0000), SPH_C32(0x24900000), SPH_C32(0xdd510000), - SPH_C32(0xe07b736c), SPH_C32(0x5bd78a12), SPH_C32(0xe9720731), - SPH_C32(0x35be7fe1) }, - { SPH_C32(0xb6e7fe40), SPH_C32(0x9a330000), SPH_C32(0x9f5b0000), - SPH_C32(0x716a0000), SPH_C32(0xa01e6d0e), SPH_C32(0x067ad13c), - SPH_C32(0x893af0bb), SPH_C32(0x2e7c5c35), SPH_C32(0x863dfe70), - SPH_C32(0x0d1e0000), SPH_C32(0x0b140000), SPH_C32(0xfb1e0000), - SPH_C32(0xe8122895), SPH_C32(0x362b7b25), SPH_C32(0xb9ed6eb5), - SPH_C32(0xabd7d089) } -}; - -static const sph_u32 T512_8[256][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xf6800005), SPH_C32(0x3443c000), SPH_C32(0x24070000), - SPH_C32(0x8f3d0000), SPH_C32(0x21373bfb), SPH_C32(0x0ab8d5ae), - SPH_C32(0xcdc58b19), SPH_C32(0xd795ba31), SPH_C32(0xa67f0001), - SPH_C32(0x71378000), SPH_C32(0x19fc0000), SPH_C32(0x96db0000), - SPH_C32(0x3a8b6dfd), SPH_C32(0xebcaaef3), SPH_C32(0x2c6d478f), - SPH_C32(0xac8e6c88) }, - { SPH_C32(0xa67f0001), SPH_C32(0x71378000), SPH_C32(0x19fc0000), - SPH_C32(0x96db0000), SPH_C32(0x3a8b6dfd), SPH_C32(0xebcaaef3), - SPH_C32(0x2c6d478f), SPH_C32(0xac8e6c88), SPH_C32(0x50ff0004), - SPH_C32(0x45744000), SPH_C32(0x3dfb0000), SPH_C32(0x19e60000), - SPH_C32(0x1bbc5606), SPH_C32(0xe1727b5d), SPH_C32(0xe1a8cc96), - SPH_C32(0x7b1bd6b9) }, - { SPH_C32(0x50ff0004), SPH_C32(0x45744000), SPH_C32(0x3dfb0000), - SPH_C32(0x19e60000), SPH_C32(0x1bbc5606), SPH_C32(0xe1727b5d), - SPH_C32(0xe1a8cc96), SPH_C32(0x7b1bd6b9), SPH_C32(0xf6800005), - SPH_C32(0x3443c000), SPH_C32(0x24070000), SPH_C32(0x8f3d0000), - SPH_C32(0x21373bfb), SPH_C32(0x0ab8d5ae), SPH_C32(0xcdc58b19), - SPH_C32(0xd795ba31) }, - { SPH_C32(0xf7750009), SPH_C32(0xcf3cc000), SPH_C32(0xc3d60000), - SPH_C32(0x04920000), SPH_C32(0x029519a9), SPH_C32(0xf8e836ba), - SPH_C32(0x7a87f14e), SPH_C32(0x9e16981a), SPH_C32(0xd46a0000), - SPH_C32(0x8dc8c000), SPH_C32(0xa5af0000), SPH_C32(0x4a290000), - SPH_C32(0xfc4e427a), SPH_C32(0xc9b4866c), SPH_C32(0x98369604), - SPH_C32(0xf746c320) }, - { SPH_C32(0x01f5000c), SPH_C32(0xfb7f0000), SPH_C32(0xe7d10000), - SPH_C32(0x8baf0000), SPH_C32(0x23a22252), SPH_C32(0xf250e314), - SPH_C32(0xb7427a57), SPH_C32(0x4983222b), SPH_C32(0x72150001), - SPH_C32(0xfcff4000), SPH_C32(0xbc530000), SPH_C32(0xdcf20000), - SPH_C32(0xc6c52f87), SPH_C32(0x227e289f), SPH_C32(0xb45bd18b), - SPH_C32(0x5bc8afa8) }, - { SPH_C32(0x510a0008), SPH_C32(0xbe0b4000), SPH_C32(0xda2a0000), - SPH_C32(0x92490000), SPH_C32(0x381e7454), SPH_C32(0x13229849), - SPH_C32(0x56eab6c1), SPH_C32(0x3298f492), SPH_C32(0x84950004), - SPH_C32(0xc8bc8000), SPH_C32(0x98540000), SPH_C32(0x53cf0000), - SPH_C32(0xe7f2147c), SPH_C32(0x28c6fd31), SPH_C32(0x799e5a92), - SPH_C32(0x8c5d1599) }, - { SPH_C32(0xa78a000d), SPH_C32(0x8a488000), SPH_C32(0xfe2d0000), - SPH_C32(0x1d740000), SPH_C32(0x19294faf), SPH_C32(0x199a4de7), - SPH_C32(0x9b2f3dd8), SPH_C32(0xe50d4ea3), SPH_C32(0x22ea0005), - SPH_C32(0xb98b0000), SPH_C32(0x81a80000), SPH_C32(0xc5140000), - SPH_C32(0xdd797981), SPH_C32(0xc30c53c2), SPH_C32(0x55f31d1d), - SPH_C32(0x20d37911) }, - { SPH_C32(0xd46a0000), SPH_C32(0x8dc8c000), SPH_C32(0xa5af0000), - SPH_C32(0x4a290000), SPH_C32(0xfc4e427a), SPH_C32(0xc9b4866c), - SPH_C32(0x98369604), SPH_C32(0xf746c320), SPH_C32(0x231f0009), - SPH_C32(0x42f40000), SPH_C32(0x66790000), SPH_C32(0x4ebb0000), - SPH_C32(0xfedb5bd3), SPH_C32(0x315cb0d6), SPH_C32(0xe2b1674a), - SPH_C32(0x69505b3a) }, - { SPH_C32(0x22ea0005), SPH_C32(0xb98b0000), SPH_C32(0x81a80000), - SPH_C32(0xc5140000), SPH_C32(0xdd797981), SPH_C32(0xc30c53c2), - SPH_C32(0x55f31d1d), SPH_C32(0x20d37911), SPH_C32(0x85600008), - SPH_C32(0x33c38000), SPH_C32(0x7f850000), SPH_C32(0xd8600000), - SPH_C32(0xc450362e), SPH_C32(0xda961e25), SPH_C32(0xcedc20c5), - SPH_C32(0xc5de37b2) }, - { SPH_C32(0x72150001), SPH_C32(0xfcff4000), SPH_C32(0xbc530000), - SPH_C32(0xdcf20000), SPH_C32(0xc6c52f87), SPH_C32(0x227e289f), - SPH_C32(0xb45bd18b), SPH_C32(0x5bc8afa8), SPH_C32(0x73e0000d), - SPH_C32(0x07804000), SPH_C32(0x5b820000), SPH_C32(0x575d0000), - SPH_C32(0xe5670dd5), SPH_C32(0xd02ecb8b), SPH_C32(0x0319abdc), - SPH_C32(0x124b8d83) }, - { SPH_C32(0x84950004), SPH_C32(0xc8bc8000), SPH_C32(0x98540000), - SPH_C32(0x53cf0000), SPH_C32(0xe7f2147c), SPH_C32(0x28c6fd31), - SPH_C32(0x799e5a92), SPH_C32(0x8c5d1599), SPH_C32(0xd59f000c), - SPH_C32(0x76b7c000), SPH_C32(0x427e0000), SPH_C32(0xc1860000), - SPH_C32(0xdfec6028), SPH_C32(0x3be46578), SPH_C32(0x2f74ec53), - SPH_C32(0xbec5e10b) }, - { SPH_C32(0x231f0009), SPH_C32(0x42f40000), SPH_C32(0x66790000), - SPH_C32(0x4ebb0000), SPH_C32(0xfedb5bd3), SPH_C32(0x315cb0d6), - SPH_C32(0xe2b1674a), SPH_C32(0x69505b3a), SPH_C32(0xf7750009), - SPH_C32(0xcf3cc000), SPH_C32(0xc3d60000), SPH_C32(0x04920000), - SPH_C32(0x029519a9), SPH_C32(0xf8e836ba), SPH_C32(0x7a87f14e), - SPH_C32(0x9e16981a) }, - { SPH_C32(0xd59f000c), SPH_C32(0x76b7c000), SPH_C32(0x427e0000), - SPH_C32(0xc1860000), SPH_C32(0xdfec6028), SPH_C32(0x3be46578), - SPH_C32(0x2f74ec53), SPH_C32(0xbec5e10b), SPH_C32(0x510a0008), - SPH_C32(0xbe0b4000), SPH_C32(0xda2a0000), SPH_C32(0x92490000), - SPH_C32(0x381e7454), SPH_C32(0x13229849), SPH_C32(0x56eab6c1), - SPH_C32(0x3298f492) }, - { SPH_C32(0x85600008), SPH_C32(0x33c38000), SPH_C32(0x7f850000), - SPH_C32(0xd8600000), SPH_C32(0xc450362e), SPH_C32(0xda961e25), - SPH_C32(0xcedc20c5), SPH_C32(0xc5de37b2), SPH_C32(0xa78a000d), - SPH_C32(0x8a488000), SPH_C32(0xfe2d0000), SPH_C32(0x1d740000), - SPH_C32(0x19294faf), SPH_C32(0x199a4de7), SPH_C32(0x9b2f3dd8), - SPH_C32(0xe50d4ea3) }, - { SPH_C32(0x73e0000d), SPH_C32(0x07804000), SPH_C32(0x5b820000), - SPH_C32(0x575d0000), SPH_C32(0xe5670dd5), SPH_C32(0xd02ecb8b), - SPH_C32(0x0319abdc), SPH_C32(0x124b8d83), SPH_C32(0x01f5000c), - SPH_C32(0xfb7f0000), SPH_C32(0xe7d10000), SPH_C32(0x8baf0000), - SPH_C32(0x23a22252), SPH_C32(0xf250e314), SPH_C32(0xb7427a57), - SPH_C32(0x4983222b) }, - { SPH_C32(0x774400f0), SPH_C32(0xf15a0000), SPH_C32(0xf5b20000), - SPH_C32(0x34140000), SPH_C32(0x89377e8c), SPH_C32(0x5a8bec25), - SPH_C32(0x0bc3cd1e), SPH_C32(0xcf3775cb), SPH_C32(0xf46c0050), - SPH_C32(0x96180000), SPH_C32(0x14a50000), SPH_C32(0x031f0000), - SPH_C32(0x42947eb8), SPH_C32(0x66bf7e19), SPH_C32(0x9ca470d2), - SPH_C32(0x8a341574) }, - { SPH_C32(0x81c400f5), SPH_C32(0xc519c000), SPH_C32(0xd1b50000), - SPH_C32(0xbb290000), SPH_C32(0xa8004577), SPH_C32(0x5033398b), - SPH_C32(0xc6064607), SPH_C32(0x18a2cffa), SPH_C32(0x52130051), - SPH_C32(0xe72f8000), SPH_C32(0x0d590000), SPH_C32(0x95c40000), - SPH_C32(0x781f1345), SPH_C32(0x8d75d0ea), SPH_C32(0xb0c9375d), - SPH_C32(0x26ba79fc) }, - { SPH_C32(0xd13b00f1), SPH_C32(0x806d8000), SPH_C32(0xec4e0000), - SPH_C32(0xa2cf0000), SPH_C32(0xb3bc1371), SPH_C32(0xb14142d6), - SPH_C32(0x27ae8a91), SPH_C32(0x63b91943), SPH_C32(0xa4930054), - SPH_C32(0xd36c4000), SPH_C32(0x295e0000), SPH_C32(0x1af90000), - SPH_C32(0x592828be), SPH_C32(0x87cd0544), SPH_C32(0x7d0cbc44), - SPH_C32(0xf12fc3cd) }, - { SPH_C32(0x27bb00f4), SPH_C32(0xb42e4000), SPH_C32(0xc8490000), - SPH_C32(0x2df20000), SPH_C32(0x928b288a), SPH_C32(0xbbf99778), - SPH_C32(0xea6b0188), SPH_C32(0xb42ca372), SPH_C32(0x02ec0055), - SPH_C32(0xa25bc000), SPH_C32(0x30a20000), SPH_C32(0x8c220000), - SPH_C32(0x63a34543), SPH_C32(0x6c07abb7), SPH_C32(0x5161fbcb), - SPH_C32(0x5da1af45) }, - { SPH_C32(0x803100f9), SPH_C32(0x3e66c000), SPH_C32(0x36640000), - SPH_C32(0x30860000), SPH_C32(0x8ba26725), SPH_C32(0xa263da9f), - SPH_C32(0x71443c50), SPH_C32(0x5121edd1), SPH_C32(0x20060050), - SPH_C32(0x1bd0c000), SPH_C32(0xb10a0000), SPH_C32(0x49360000), - SPH_C32(0xbeda3cc2), SPH_C32(0xaf0bf875), SPH_C32(0x0492e6d6), - SPH_C32(0x7d72d654) }, - { SPH_C32(0x76b100fc), SPH_C32(0x0a250000), SPH_C32(0x12630000), - SPH_C32(0xbfbb0000), SPH_C32(0xaa955cde), SPH_C32(0xa8db0f31), - SPH_C32(0xbc81b749), SPH_C32(0x86b457e0), SPH_C32(0x86790051), - SPH_C32(0x6ae74000), SPH_C32(0xa8f60000), SPH_C32(0xdfed0000), - SPH_C32(0x8451513f), SPH_C32(0x44c15686), SPH_C32(0x28ffa159), - SPH_C32(0xd1fcbadc) }, - { SPH_C32(0x264e00f8), SPH_C32(0x4f514000), SPH_C32(0x2f980000), - SPH_C32(0xa65d0000), SPH_C32(0xb1290ad8), SPH_C32(0x49a9746c), - SPH_C32(0x5d297bdf), SPH_C32(0xfdaf8159), SPH_C32(0x70f90054), - SPH_C32(0x5ea48000), SPH_C32(0x8cf10000), SPH_C32(0x50d00000), - SPH_C32(0xa5666ac4), SPH_C32(0x4e798328), SPH_C32(0xe53a2a40), - SPH_C32(0x066900ed) }, - { SPH_C32(0xd0ce00fd), SPH_C32(0x7b128000), SPH_C32(0x0b9f0000), - SPH_C32(0x29600000), SPH_C32(0x901e3123), SPH_C32(0x4311a1c2), - SPH_C32(0x90ecf0c6), SPH_C32(0x2a3a3b68), SPH_C32(0xd6860055), - SPH_C32(0x2f930000), SPH_C32(0x950d0000), SPH_C32(0xc60b0000), - SPH_C32(0x9fed0739), SPH_C32(0xa5b32ddb), SPH_C32(0xc9576dcf), - SPH_C32(0xaae76c65) }, - { SPH_C32(0xa32e00f0), SPH_C32(0x7c92c000), SPH_C32(0x501d0000), - SPH_C32(0x7e3d0000), SPH_C32(0x75793cf6), SPH_C32(0x933f6a49), - SPH_C32(0x93f55b1a), SPH_C32(0x3871b6eb), SPH_C32(0xd7730059), - SPH_C32(0xd4ec0000), SPH_C32(0x72dc0000), SPH_C32(0x4da40000), - SPH_C32(0xbc4f256b), SPH_C32(0x57e3cecf), SPH_C32(0x7e151798), - SPH_C32(0xe3644e4e) }, - { SPH_C32(0x55ae00f5), SPH_C32(0x48d10000), SPH_C32(0x741a0000), - SPH_C32(0xf1000000), SPH_C32(0x544e070d), SPH_C32(0x9987bfe7), - SPH_C32(0x5e30d003), SPH_C32(0xefe40cda), SPH_C32(0x710c0058), - SPH_C32(0xa5db8000), SPH_C32(0x6b200000), SPH_C32(0xdb7f0000), - SPH_C32(0x86c44896), SPH_C32(0xbc29603c), SPH_C32(0x52785017), - SPH_C32(0x4fea22c6) }, - { SPH_C32(0x055100f1), SPH_C32(0x0da54000), SPH_C32(0x49e10000), - SPH_C32(0xe8e60000), SPH_C32(0x4ff2510b), SPH_C32(0x78f5c4ba), - SPH_C32(0xbf981c95), SPH_C32(0x94ffda63), SPH_C32(0x878c005d), - SPH_C32(0x91984000), SPH_C32(0x4f270000), SPH_C32(0x54420000), - SPH_C32(0xa7f3736d), SPH_C32(0xb691b592), SPH_C32(0x9fbddb0e), - SPH_C32(0x987f98f7) }, - { SPH_C32(0xf3d100f4), SPH_C32(0x39e68000), SPH_C32(0x6de60000), - SPH_C32(0x67db0000), SPH_C32(0x6ec56af0), SPH_C32(0x724d1114), - SPH_C32(0x725d978c), SPH_C32(0x436a6052), SPH_C32(0x21f3005c), - SPH_C32(0xe0afc000), SPH_C32(0x56db0000), SPH_C32(0xc2990000), - SPH_C32(0x9d781e90), SPH_C32(0x5d5b1b61), SPH_C32(0xb3d09c81), - SPH_C32(0x34f1f47f) }, - { SPH_C32(0x545b00f9), SPH_C32(0xb3ae0000), SPH_C32(0x93cb0000), - SPH_C32(0x7aaf0000), SPH_C32(0x77ec255f), SPH_C32(0x6bd75cf3), - SPH_C32(0xe972aa54), SPH_C32(0xa6672ef1), SPH_C32(0x03190059), - SPH_C32(0x5924c000), SPH_C32(0xd7730000), SPH_C32(0x078d0000), - SPH_C32(0x40016711), SPH_C32(0x9e5748a3), SPH_C32(0xe623819c), - SPH_C32(0x14228d6e) }, - { SPH_C32(0xa2db00fc), SPH_C32(0x87edc000), SPH_C32(0xb7cc0000), - SPH_C32(0xf5920000), SPH_C32(0x56db1ea4), SPH_C32(0x616f895d), - SPH_C32(0x24b7214d), SPH_C32(0x71f294c0), SPH_C32(0xa5660058), - SPH_C32(0x28134000), SPH_C32(0xce8f0000), SPH_C32(0x91560000), - SPH_C32(0x7a8a0aec), SPH_C32(0x759de650), SPH_C32(0xca4ec613), - SPH_C32(0xb8ace1e6) }, - { SPH_C32(0xf22400f8), SPH_C32(0xc2998000), SPH_C32(0x8a370000), - SPH_C32(0xec740000), SPH_C32(0x4d6748a2), SPH_C32(0x801df200), - SPH_C32(0xc51feddb), SPH_C32(0x0ae94279), SPH_C32(0x53e6005d), - SPH_C32(0x1c508000), SPH_C32(0xea880000), SPH_C32(0x1e6b0000), - SPH_C32(0x5bbd3117), SPH_C32(0x7f2533fe), SPH_C32(0x078b4d0a), - SPH_C32(0x6f395bd7) }, - { SPH_C32(0x04a400fd), SPH_C32(0xf6da4000), SPH_C32(0xae300000), - SPH_C32(0x63490000), SPH_C32(0x6c507359), SPH_C32(0x8aa527ae), - SPH_C32(0x08da66c2), SPH_C32(0xdd7cf848), SPH_C32(0xf599005c), - SPH_C32(0x6d670000), SPH_C32(0xf3740000), SPH_C32(0x88b00000), - SPH_C32(0x61365cea), SPH_C32(0x94ef9d0d), SPH_C32(0x2be60a85), - SPH_C32(0xc3b7375f) }, - { SPH_C32(0xf46c0050), SPH_C32(0x96180000), SPH_C32(0x14a50000), - SPH_C32(0x031f0000), SPH_C32(0x42947eb8), SPH_C32(0x66bf7e19), - SPH_C32(0x9ca470d2), SPH_C32(0x8a341574), SPH_C32(0x832800a0), - SPH_C32(0x67420000), SPH_C32(0xe1170000), SPH_C32(0x370b0000), - SPH_C32(0xcba30034), SPH_C32(0x3c34923c), SPH_C32(0x9767bdcc), - SPH_C32(0x450360bf) }, - { SPH_C32(0x02ec0055), SPH_C32(0xa25bc000), SPH_C32(0x30a20000), - SPH_C32(0x8c220000), SPH_C32(0x63a34543), SPH_C32(0x6c07abb7), - SPH_C32(0x5161fbcb), SPH_C32(0x5da1af45), SPH_C32(0x255700a1), - SPH_C32(0x16758000), SPH_C32(0xf8eb0000), SPH_C32(0xa1d00000), - SPH_C32(0xf1286dc9), SPH_C32(0xd7fe3ccf), SPH_C32(0xbb0afa43), - SPH_C32(0xe98d0c37) }, - { SPH_C32(0x52130051), SPH_C32(0xe72f8000), SPH_C32(0x0d590000), - SPH_C32(0x95c40000), SPH_C32(0x781f1345), SPH_C32(0x8d75d0ea), - SPH_C32(0xb0c9375d), SPH_C32(0x26ba79fc), SPH_C32(0xd3d700a4), - SPH_C32(0x22364000), SPH_C32(0xdcec0000), SPH_C32(0x2eed0000), - SPH_C32(0xd01f5632), SPH_C32(0xdd46e961), SPH_C32(0x76cf715a), - SPH_C32(0x3e18b606) }, - { SPH_C32(0xa4930054), SPH_C32(0xd36c4000), SPH_C32(0x295e0000), - SPH_C32(0x1af90000), SPH_C32(0x592828be), SPH_C32(0x87cd0544), - SPH_C32(0x7d0cbc44), SPH_C32(0xf12fc3cd), SPH_C32(0x75a800a5), - SPH_C32(0x5301c000), SPH_C32(0xc5100000), SPH_C32(0xb8360000), - SPH_C32(0xea943bcf), SPH_C32(0x368c4792), SPH_C32(0x5aa236d5), - SPH_C32(0x9296da8e) }, - { SPH_C32(0x03190059), SPH_C32(0x5924c000), SPH_C32(0xd7730000), - SPH_C32(0x078d0000), SPH_C32(0x40016711), SPH_C32(0x9e5748a3), - SPH_C32(0xe623819c), SPH_C32(0x14228d6e), SPH_C32(0x574200a0), - SPH_C32(0xea8ac000), SPH_C32(0x44b80000), SPH_C32(0x7d220000), - SPH_C32(0x37ed424e), SPH_C32(0xf5801450), SPH_C32(0x0f512bc8), - SPH_C32(0xb245a39f) }, - { SPH_C32(0xf599005c), SPH_C32(0x6d670000), SPH_C32(0xf3740000), - SPH_C32(0x88b00000), SPH_C32(0x61365cea), SPH_C32(0x94ef9d0d), - SPH_C32(0x2be60a85), SPH_C32(0xc3b7375f), SPH_C32(0xf13d00a1), - SPH_C32(0x9bbd4000), SPH_C32(0x5d440000), SPH_C32(0xebf90000), - SPH_C32(0x0d662fb3), SPH_C32(0x1e4abaa3), SPH_C32(0x233c6c47), - SPH_C32(0x1ecbcf17) }, - { SPH_C32(0xa5660058), SPH_C32(0x28134000), SPH_C32(0xce8f0000), - SPH_C32(0x91560000), SPH_C32(0x7a8a0aec), SPH_C32(0x759de650), - SPH_C32(0xca4ec613), SPH_C32(0xb8ace1e6), SPH_C32(0x07bd00a4), - SPH_C32(0xaffe8000), SPH_C32(0x79430000), SPH_C32(0x64c40000), - SPH_C32(0x2c511448), SPH_C32(0x14f26f0d), SPH_C32(0xeef9e75e), - SPH_C32(0xc95e7526) }, - { SPH_C32(0x53e6005d), SPH_C32(0x1c508000), SPH_C32(0xea880000), - SPH_C32(0x1e6b0000), SPH_C32(0x5bbd3117), SPH_C32(0x7f2533fe), - SPH_C32(0x078b4d0a), SPH_C32(0x6f395bd7), SPH_C32(0xa1c200a5), - SPH_C32(0xdec90000), SPH_C32(0x60bf0000), SPH_C32(0xf21f0000), - SPH_C32(0x16da79b5), SPH_C32(0xff38c1fe), SPH_C32(0xc294a0d1), - SPH_C32(0x65d019ae) }, - { SPH_C32(0x20060050), SPH_C32(0x1bd0c000), SPH_C32(0xb10a0000), - SPH_C32(0x49360000), SPH_C32(0xbeda3cc2), SPH_C32(0xaf0bf875), - SPH_C32(0x0492e6d6), SPH_C32(0x7d72d654), SPH_C32(0xa03700a9), - SPH_C32(0x25b60000), SPH_C32(0x876e0000), SPH_C32(0x79b00000), - SPH_C32(0x35785be7), SPH_C32(0x0d6822ea), SPH_C32(0x75d6da86), - SPH_C32(0x2c533b85) }, - { SPH_C32(0xd6860055), SPH_C32(0x2f930000), SPH_C32(0x950d0000), - SPH_C32(0xc60b0000), SPH_C32(0x9fed0739), SPH_C32(0xa5b32ddb), - SPH_C32(0xc9576dcf), SPH_C32(0xaae76c65), SPH_C32(0x064800a8), - SPH_C32(0x54818000), SPH_C32(0x9e920000), SPH_C32(0xef6b0000), - SPH_C32(0x0ff3361a), SPH_C32(0xe6a28c19), SPH_C32(0x59bb9d09), - SPH_C32(0x80dd570d) }, - { SPH_C32(0x86790051), SPH_C32(0x6ae74000), SPH_C32(0xa8f60000), - SPH_C32(0xdfed0000), SPH_C32(0x8451513f), SPH_C32(0x44c15686), - SPH_C32(0x28ffa159), SPH_C32(0xd1fcbadc), SPH_C32(0xf0c800ad), - SPH_C32(0x60c24000), SPH_C32(0xba950000), SPH_C32(0x60560000), - SPH_C32(0x2ec40de1), SPH_C32(0xec1a59b7), SPH_C32(0x947e1610), - SPH_C32(0x5748ed3c) }, - { SPH_C32(0x70f90054), SPH_C32(0x5ea48000), SPH_C32(0x8cf10000), - SPH_C32(0x50d00000), SPH_C32(0xa5666ac4), SPH_C32(0x4e798328), - SPH_C32(0xe53a2a40), SPH_C32(0x066900ed), SPH_C32(0x56b700ac), - SPH_C32(0x11f5c000), SPH_C32(0xa3690000), SPH_C32(0xf68d0000), - SPH_C32(0x144f601c), SPH_C32(0x07d0f744), SPH_C32(0xb813519f), - SPH_C32(0xfbc681b4) }, - { SPH_C32(0xd7730059), SPH_C32(0xd4ec0000), SPH_C32(0x72dc0000), - SPH_C32(0x4da40000), SPH_C32(0xbc4f256b), SPH_C32(0x57e3cecf), - SPH_C32(0x7e151798), SPH_C32(0xe3644e4e), SPH_C32(0x745d00a9), - SPH_C32(0xa87ec000), SPH_C32(0x22c10000), SPH_C32(0x33990000), - SPH_C32(0xc936199d), SPH_C32(0xc4dca486), SPH_C32(0xede04c82), - SPH_C32(0xdb15f8a5) }, - { SPH_C32(0x21f3005c), SPH_C32(0xe0afc000), SPH_C32(0x56db0000), - SPH_C32(0xc2990000), SPH_C32(0x9d781e90), SPH_C32(0x5d5b1b61), - SPH_C32(0xb3d09c81), SPH_C32(0x34f1f47f), SPH_C32(0xd22200a8), - SPH_C32(0xd9494000), SPH_C32(0x3b3d0000), SPH_C32(0xa5420000), - SPH_C32(0xf3bd7460), SPH_C32(0x2f160a75), SPH_C32(0xc18d0b0d), - SPH_C32(0x779b942d) }, - { SPH_C32(0x710c0058), SPH_C32(0xa5db8000), SPH_C32(0x6b200000), - SPH_C32(0xdb7f0000), SPH_C32(0x86c44896), SPH_C32(0xbc29603c), - SPH_C32(0x52785017), SPH_C32(0x4fea22c6), SPH_C32(0x24a200ad), - SPH_C32(0xed0a8000), SPH_C32(0x1f3a0000), SPH_C32(0x2a7f0000), - SPH_C32(0xd28a4f9b), SPH_C32(0x25aedfdb), SPH_C32(0x0c488014), - SPH_C32(0xa00e2e1c) }, - { SPH_C32(0x878c005d), SPH_C32(0x91984000), SPH_C32(0x4f270000), - SPH_C32(0x54420000), SPH_C32(0xa7f3736d), SPH_C32(0xb691b592), - SPH_C32(0x9fbddb0e), SPH_C32(0x987f98f7), SPH_C32(0x82dd00ac), - SPH_C32(0x9c3d0000), SPH_C32(0x06c60000), SPH_C32(0xbca40000), - SPH_C32(0xe8012266), SPH_C32(0xce647128), SPH_C32(0x2025c79b), - SPH_C32(0x0c804294) }, - { SPH_C32(0x832800a0), SPH_C32(0x67420000), SPH_C32(0xe1170000), - SPH_C32(0x370b0000), SPH_C32(0xcba30034), SPH_C32(0x3c34923c), - SPH_C32(0x9767bdcc), SPH_C32(0x450360bf), SPH_C32(0x774400f0), - SPH_C32(0xf15a0000), SPH_C32(0xf5b20000), SPH_C32(0x34140000), - SPH_C32(0x89377e8c), SPH_C32(0x5a8bec25), SPH_C32(0x0bc3cd1e), - SPH_C32(0xcf3775cb) }, - { SPH_C32(0x75a800a5), SPH_C32(0x5301c000), SPH_C32(0xc5100000), - SPH_C32(0xb8360000), SPH_C32(0xea943bcf), SPH_C32(0x368c4792), - SPH_C32(0x5aa236d5), SPH_C32(0x9296da8e), SPH_C32(0xd13b00f1), - SPH_C32(0x806d8000), SPH_C32(0xec4e0000), SPH_C32(0xa2cf0000), - SPH_C32(0xb3bc1371), SPH_C32(0xb14142d6), SPH_C32(0x27ae8a91), - SPH_C32(0x63b91943) }, - { SPH_C32(0x255700a1), SPH_C32(0x16758000), SPH_C32(0xf8eb0000), - SPH_C32(0xa1d00000), SPH_C32(0xf1286dc9), SPH_C32(0xd7fe3ccf), - SPH_C32(0xbb0afa43), SPH_C32(0xe98d0c37), SPH_C32(0x27bb00f4), - SPH_C32(0xb42e4000), SPH_C32(0xc8490000), SPH_C32(0x2df20000), - SPH_C32(0x928b288a), SPH_C32(0xbbf99778), SPH_C32(0xea6b0188), - SPH_C32(0xb42ca372) }, - { SPH_C32(0xd3d700a4), SPH_C32(0x22364000), SPH_C32(0xdcec0000), - SPH_C32(0x2eed0000), SPH_C32(0xd01f5632), SPH_C32(0xdd46e961), - SPH_C32(0x76cf715a), SPH_C32(0x3e18b606), SPH_C32(0x81c400f5), - SPH_C32(0xc519c000), SPH_C32(0xd1b50000), SPH_C32(0xbb290000), - SPH_C32(0xa8004577), SPH_C32(0x5033398b), SPH_C32(0xc6064607), - SPH_C32(0x18a2cffa) }, - { SPH_C32(0x745d00a9), SPH_C32(0xa87ec000), SPH_C32(0x22c10000), - SPH_C32(0x33990000), SPH_C32(0xc936199d), SPH_C32(0xc4dca486), - SPH_C32(0xede04c82), SPH_C32(0xdb15f8a5), SPH_C32(0xa32e00f0), - SPH_C32(0x7c92c000), SPH_C32(0x501d0000), SPH_C32(0x7e3d0000), - SPH_C32(0x75793cf6), SPH_C32(0x933f6a49), SPH_C32(0x93f55b1a), - SPH_C32(0x3871b6eb) }, - { SPH_C32(0x82dd00ac), SPH_C32(0x9c3d0000), SPH_C32(0x06c60000), - SPH_C32(0xbca40000), SPH_C32(0xe8012266), SPH_C32(0xce647128), - SPH_C32(0x2025c79b), SPH_C32(0x0c804294), SPH_C32(0x055100f1), - SPH_C32(0x0da54000), SPH_C32(0x49e10000), SPH_C32(0xe8e60000), - SPH_C32(0x4ff2510b), SPH_C32(0x78f5c4ba), SPH_C32(0xbf981c95), - SPH_C32(0x94ffda63) }, - { SPH_C32(0xd22200a8), SPH_C32(0xd9494000), SPH_C32(0x3b3d0000), - SPH_C32(0xa5420000), SPH_C32(0xf3bd7460), SPH_C32(0x2f160a75), - SPH_C32(0xc18d0b0d), SPH_C32(0x779b942d), SPH_C32(0xf3d100f4), - SPH_C32(0x39e68000), SPH_C32(0x6de60000), SPH_C32(0x67db0000), - SPH_C32(0x6ec56af0), SPH_C32(0x724d1114), SPH_C32(0x725d978c), - SPH_C32(0x436a6052) }, - { SPH_C32(0x24a200ad), SPH_C32(0xed0a8000), SPH_C32(0x1f3a0000), - SPH_C32(0x2a7f0000), SPH_C32(0xd28a4f9b), SPH_C32(0x25aedfdb), - SPH_C32(0x0c488014), SPH_C32(0xa00e2e1c), SPH_C32(0x55ae00f5), - SPH_C32(0x48d10000), SPH_C32(0x741a0000), SPH_C32(0xf1000000), - SPH_C32(0x544e070d), SPH_C32(0x9987bfe7), SPH_C32(0x5e30d003), - SPH_C32(0xefe40cda) }, - { SPH_C32(0x574200a0), SPH_C32(0xea8ac000), SPH_C32(0x44b80000), - SPH_C32(0x7d220000), SPH_C32(0x37ed424e), SPH_C32(0xf5801450), - SPH_C32(0x0f512bc8), SPH_C32(0xb245a39f), SPH_C32(0x545b00f9), - SPH_C32(0xb3ae0000), SPH_C32(0x93cb0000), SPH_C32(0x7aaf0000), - SPH_C32(0x77ec255f), SPH_C32(0x6bd75cf3), SPH_C32(0xe972aa54), - SPH_C32(0xa6672ef1) }, - { SPH_C32(0xa1c200a5), SPH_C32(0xdec90000), SPH_C32(0x60bf0000), - SPH_C32(0xf21f0000), SPH_C32(0x16da79b5), SPH_C32(0xff38c1fe), - SPH_C32(0xc294a0d1), SPH_C32(0x65d019ae), SPH_C32(0xf22400f8), - SPH_C32(0xc2998000), SPH_C32(0x8a370000), SPH_C32(0xec740000), - SPH_C32(0x4d6748a2), SPH_C32(0x801df200), SPH_C32(0xc51feddb), - SPH_C32(0x0ae94279) }, - { SPH_C32(0xf13d00a1), SPH_C32(0x9bbd4000), SPH_C32(0x5d440000), - SPH_C32(0xebf90000), SPH_C32(0x0d662fb3), SPH_C32(0x1e4abaa3), - SPH_C32(0x233c6c47), SPH_C32(0x1ecbcf17), SPH_C32(0x04a400fd), - SPH_C32(0xf6da4000), SPH_C32(0xae300000), SPH_C32(0x63490000), - SPH_C32(0x6c507359), SPH_C32(0x8aa527ae), SPH_C32(0x08da66c2), - SPH_C32(0xdd7cf848) }, - { SPH_C32(0x07bd00a4), SPH_C32(0xaffe8000), SPH_C32(0x79430000), - SPH_C32(0x64c40000), SPH_C32(0x2c511448), SPH_C32(0x14f26f0d), - SPH_C32(0xeef9e75e), SPH_C32(0xc95e7526), SPH_C32(0xa2db00fc), - SPH_C32(0x87edc000), SPH_C32(0xb7cc0000), SPH_C32(0xf5920000), - SPH_C32(0x56db1ea4), SPH_C32(0x616f895d), SPH_C32(0x24b7214d), - SPH_C32(0x71f294c0) }, - { SPH_C32(0xa03700a9), SPH_C32(0x25b60000), SPH_C32(0x876e0000), - SPH_C32(0x79b00000), SPH_C32(0x35785be7), SPH_C32(0x0d6822ea), - SPH_C32(0x75d6da86), SPH_C32(0x2c533b85), SPH_C32(0x803100f9), - SPH_C32(0x3e66c000), SPH_C32(0x36640000), SPH_C32(0x30860000), - SPH_C32(0x8ba26725), SPH_C32(0xa263da9f), SPH_C32(0x71443c50), - SPH_C32(0x5121edd1) }, - { SPH_C32(0x56b700ac), SPH_C32(0x11f5c000), SPH_C32(0xa3690000), - SPH_C32(0xf68d0000), SPH_C32(0x144f601c), SPH_C32(0x07d0f744), - SPH_C32(0xb813519f), SPH_C32(0xfbc681b4), SPH_C32(0x264e00f8), - SPH_C32(0x4f514000), SPH_C32(0x2f980000), SPH_C32(0xa65d0000), - SPH_C32(0xb1290ad8), SPH_C32(0x49a9746c), SPH_C32(0x5d297bdf), - SPH_C32(0xfdaf8159) }, - { SPH_C32(0x064800a8), SPH_C32(0x54818000), SPH_C32(0x9e920000), - SPH_C32(0xef6b0000), SPH_C32(0x0ff3361a), SPH_C32(0xe6a28c19), - SPH_C32(0x59bb9d09), SPH_C32(0x80dd570d), SPH_C32(0xd0ce00fd), - SPH_C32(0x7b128000), SPH_C32(0x0b9f0000), SPH_C32(0x29600000), - SPH_C32(0x901e3123), SPH_C32(0x4311a1c2), SPH_C32(0x90ecf0c6), - SPH_C32(0x2a3a3b68) }, - { SPH_C32(0xf0c800ad), SPH_C32(0x60c24000), SPH_C32(0xba950000), - SPH_C32(0x60560000), SPH_C32(0x2ec40de1), SPH_C32(0xec1a59b7), - SPH_C32(0x947e1610), SPH_C32(0x5748ed3c), SPH_C32(0x76b100fc), - SPH_C32(0x0a250000), SPH_C32(0x12630000), SPH_C32(0xbfbb0000), - SPH_C32(0xaa955cde), SPH_C32(0xa8db0f31), SPH_C32(0xbc81b749), - SPH_C32(0x86b457e0) }, - { SPH_C32(0xe8870170), SPH_C32(0x9d720000), SPH_C32(0x12db0000), - SPH_C32(0xd4220000), SPH_C32(0xf2886b27), SPH_C32(0xa921e543), - SPH_C32(0x4ef8b518), SPH_C32(0x618813b1), SPH_C32(0xb4370060), - SPH_C32(0x0c4c0000), SPH_C32(0x56c20000), SPH_C32(0x5cae0000), - SPH_C32(0x94541f3f), SPH_C32(0x3b3ef825), SPH_C32(0x1b365f3d), - SPH_C32(0xf3d45758) }, - { SPH_C32(0x1e070175), SPH_C32(0xa931c000), SPH_C32(0x36dc0000), - SPH_C32(0x5b1f0000), SPH_C32(0xd3bf50dc), SPH_C32(0xa39930ed), - SPH_C32(0x833d3e01), SPH_C32(0xb61da980), SPH_C32(0x12480061), - SPH_C32(0x7d7b8000), SPH_C32(0x4f3e0000), SPH_C32(0xca750000), - SPH_C32(0xaedf72c2), SPH_C32(0xd0f456d6), SPH_C32(0x375b18b2), - SPH_C32(0x5f5a3bd0) }, - { SPH_C32(0x4ef80171), SPH_C32(0xec458000), SPH_C32(0x0b270000), - SPH_C32(0x42f90000), SPH_C32(0xc80306da), SPH_C32(0x42eb4bb0), - SPH_C32(0x6295f297), SPH_C32(0xcd067f39), SPH_C32(0xe4c80064), - SPH_C32(0x49384000), SPH_C32(0x6b390000), SPH_C32(0x45480000), - SPH_C32(0x8fe84939), SPH_C32(0xda4c8378), SPH_C32(0xfa9e93ab), - SPH_C32(0x88cf81e1) }, - { SPH_C32(0xb8780174), SPH_C32(0xd8064000), SPH_C32(0x2f200000), - SPH_C32(0xcdc40000), SPH_C32(0xe9343d21), SPH_C32(0x48539e1e), - SPH_C32(0xaf50798e), SPH_C32(0x1a93c508), SPH_C32(0x42b70065), - SPH_C32(0x380fc000), SPH_C32(0x72c50000), SPH_C32(0xd3930000), - SPH_C32(0xb56324c4), SPH_C32(0x31862d8b), SPH_C32(0xd6f3d424), - SPH_C32(0x2441ed69) }, - { SPH_C32(0x1ff20179), SPH_C32(0x524ec000), SPH_C32(0xd10d0000), - SPH_C32(0xd0b00000), SPH_C32(0xf01d728e), SPH_C32(0x51c9d3f9), - SPH_C32(0x347f4456), SPH_C32(0xff9e8bab), SPH_C32(0x605d0060), - SPH_C32(0x8184c000), SPH_C32(0xf36d0000), SPH_C32(0x16870000), - SPH_C32(0x681a5d45), SPH_C32(0xf28a7e49), SPH_C32(0x8300c939), - SPH_C32(0x04929478) }, - { SPH_C32(0xe972017c), SPH_C32(0x660d0000), SPH_C32(0xf50a0000), - SPH_C32(0x5f8d0000), SPH_C32(0xd12a4975), SPH_C32(0x5b710657), - SPH_C32(0xf9bacf4f), SPH_C32(0x280b319a), SPH_C32(0xc6220061), - SPH_C32(0xf0b34000), SPH_C32(0xea910000), SPH_C32(0x805c0000), - SPH_C32(0x529130b8), SPH_C32(0x1940d0ba), SPH_C32(0xaf6d8eb6), - SPH_C32(0xa81cf8f0) }, - { SPH_C32(0xb98d0178), SPH_C32(0x23794000), SPH_C32(0xc8f10000), - SPH_C32(0x466b0000), SPH_C32(0xca961f73), SPH_C32(0xba037d0a), - SPH_C32(0x181203d9), SPH_C32(0x5310e723), SPH_C32(0x30a20064), - SPH_C32(0xc4f08000), SPH_C32(0xce960000), SPH_C32(0x0f610000), - SPH_C32(0x73a60b43), SPH_C32(0x13f80514), SPH_C32(0x62a805af), - SPH_C32(0x7f8942c1) }, - { SPH_C32(0x4f0d017d), SPH_C32(0x173a8000), SPH_C32(0xecf60000), - SPH_C32(0xc9560000), SPH_C32(0xeba12488), SPH_C32(0xb0bba8a4), - SPH_C32(0xd5d788c0), SPH_C32(0x84855d12), SPH_C32(0x96dd0065), - SPH_C32(0xb5c70000), SPH_C32(0xd76a0000), SPH_C32(0x99ba0000), - SPH_C32(0x492d66be), SPH_C32(0xf832abe7), SPH_C32(0x4ec54220), - SPH_C32(0xd3072e49) }, - { SPH_C32(0x3ced0170), SPH_C32(0x10bac000), SPH_C32(0xb7740000), - SPH_C32(0x9e0b0000), SPH_C32(0x0ec6295d), SPH_C32(0x6095632f), - SPH_C32(0xd6ce231c), SPH_C32(0x96ced091), SPH_C32(0x97280069), - SPH_C32(0x4eb80000), SPH_C32(0x30bb0000), SPH_C32(0x12150000), - SPH_C32(0x6a8f44ec), SPH_C32(0x0a6248f3), SPH_C32(0xf9873877), - SPH_C32(0x9a840c62) }, - { SPH_C32(0xca6d0175), SPH_C32(0x24f90000), SPH_C32(0x93730000), - SPH_C32(0x11360000), SPH_C32(0x2ff112a6), SPH_C32(0x6a2db681), - SPH_C32(0x1b0ba805), SPH_C32(0x415b6aa0), SPH_C32(0x31570068), - SPH_C32(0x3f8f8000), SPH_C32(0x29470000), SPH_C32(0x84ce0000), - SPH_C32(0x50042911), SPH_C32(0xe1a8e600), SPH_C32(0xd5ea7ff8), - SPH_C32(0x360a60ea) }, - { SPH_C32(0x9a920171), SPH_C32(0x618d4000), SPH_C32(0xae880000), - SPH_C32(0x08d00000), SPH_C32(0x344d44a0), SPH_C32(0x8b5fcddc), - SPH_C32(0xfaa36493), SPH_C32(0x3a40bc19), SPH_C32(0xc7d7006d), - SPH_C32(0x0bcc4000), SPH_C32(0x0d400000), SPH_C32(0x0bf30000), - SPH_C32(0x713312ea), SPH_C32(0xeb1033ae), SPH_C32(0x182ff4e1), - SPH_C32(0xe19fdadb) }, - { SPH_C32(0x6c120174), SPH_C32(0x55ce8000), SPH_C32(0x8a8f0000), - SPH_C32(0x87ed0000), SPH_C32(0x157a7f5b), SPH_C32(0x81e71872), - SPH_C32(0x3766ef8a), SPH_C32(0xedd50628), SPH_C32(0x61a8006c), - SPH_C32(0x7afbc000), SPH_C32(0x14bc0000), SPH_C32(0x9d280000), - SPH_C32(0x4bb87f17), SPH_C32(0x00da9d5d), SPH_C32(0x3442b36e), - SPH_C32(0x4d11b653) }, - { SPH_C32(0xcb980179), SPH_C32(0xdf860000), SPH_C32(0x74a20000), - SPH_C32(0x9a990000), SPH_C32(0x0c5330f4), SPH_C32(0x987d5595), - SPH_C32(0xac49d252), SPH_C32(0x08d8488b), SPH_C32(0x43420069), - SPH_C32(0xc370c000), SPH_C32(0x95140000), SPH_C32(0x583c0000), - SPH_C32(0x96c10696), SPH_C32(0xc3d6ce9f), SPH_C32(0x61b1ae73), - SPH_C32(0x6dc2cf42) }, - { SPH_C32(0x3d18017c), SPH_C32(0xebc5c000), SPH_C32(0x50a50000), - SPH_C32(0x15a40000), SPH_C32(0x2d640b0f), SPH_C32(0x92c5803b), - SPH_C32(0x618c594b), SPH_C32(0xdf4df2ba), SPH_C32(0xe53d0068), - SPH_C32(0xb2474000), SPH_C32(0x8ce80000), SPH_C32(0xcee70000), - SPH_C32(0xac4a6b6b), SPH_C32(0x281c606c), SPH_C32(0x4ddce9fc), - SPH_C32(0xc14ca3ca) }, - { SPH_C32(0x6de70178), SPH_C32(0xaeb18000), SPH_C32(0x6d5e0000), - SPH_C32(0x0c420000), SPH_C32(0x36d85d09), SPH_C32(0x73b7fb66), - SPH_C32(0x802495dd), SPH_C32(0xa4562403), SPH_C32(0x13bd006d), - SPH_C32(0x86048000), SPH_C32(0xa8ef0000), SPH_C32(0x41da0000), - SPH_C32(0x8d7d5090), SPH_C32(0x22a4b5c2), SPH_C32(0x801962e5), - SPH_C32(0x16d919fb) }, - { SPH_C32(0x9b67017d), SPH_C32(0x9af24000), SPH_C32(0x49590000), - SPH_C32(0x837f0000), SPH_C32(0x17ef66f2), SPH_C32(0x790f2ec8), - SPH_C32(0x4de11ec4), SPH_C32(0x73c39e32), SPH_C32(0xb5c2006c), - SPH_C32(0xf7330000), SPH_C32(0xb1130000), SPH_C32(0xd7010000), - SPH_C32(0xb7f63d6d), SPH_C32(0xc96e1b31), SPH_C32(0xac74256a), - SPH_C32(0xba577573) }, - { SPH_C32(0x9fc30180), SPH_C32(0x6c280000), SPH_C32(0xe7690000), - SPH_C32(0xe0360000), SPH_C32(0x7bbf15ab), SPH_C32(0xf3aa0966), - SPH_C32(0x453b7806), SPH_C32(0xaebf667a), SPH_C32(0x405b0030), - SPH_C32(0x9a540000), SPH_C32(0x42670000), SPH_C32(0x5fb10000), - SPH_C32(0xd6c06187), SPH_C32(0x5d81863c), SPH_C32(0x87922fef), - SPH_C32(0x79e0422c) }, - { SPH_C32(0x69430185), SPH_C32(0x586bc000), SPH_C32(0xc36e0000), - SPH_C32(0x6f0b0000), SPH_C32(0x5a882e50), SPH_C32(0xf912dcc8), - SPH_C32(0x88fef31f), SPH_C32(0x792adc4b), SPH_C32(0xe6240031), - SPH_C32(0xeb638000), SPH_C32(0x5b9b0000), SPH_C32(0xc96a0000), - SPH_C32(0xec4b0c7a), SPH_C32(0xb64b28cf), SPH_C32(0xabff6860), - SPH_C32(0xd56e2ea4) }, - { SPH_C32(0x39bc0181), SPH_C32(0x1d1f8000), SPH_C32(0xfe950000), - SPH_C32(0x76ed0000), SPH_C32(0x41347856), SPH_C32(0x1860a795), - SPH_C32(0x69563f89), SPH_C32(0x02310af2), SPH_C32(0x10a40034), - SPH_C32(0xdf204000), SPH_C32(0x7f9c0000), SPH_C32(0x46570000), - SPH_C32(0xcd7c3781), SPH_C32(0xbcf3fd61), SPH_C32(0x663ae379), - SPH_C32(0x02fb9495) }, - { SPH_C32(0xcf3c0184), SPH_C32(0x295c4000), SPH_C32(0xda920000), - SPH_C32(0xf9d00000), SPH_C32(0x600343ad), SPH_C32(0x12d8723b), - SPH_C32(0xa493b490), SPH_C32(0xd5a4b0c3), SPH_C32(0xb6db0035), - SPH_C32(0xae17c000), SPH_C32(0x66600000), SPH_C32(0xd08c0000), - SPH_C32(0xf7f75a7c), SPH_C32(0x57395392), SPH_C32(0x4a57a4f6), - SPH_C32(0xae75f81d) }, - { SPH_C32(0x68b60189), SPH_C32(0xa314c000), SPH_C32(0x24bf0000), - SPH_C32(0xe4a40000), SPH_C32(0x792a0c02), SPH_C32(0x0b423fdc), - SPH_C32(0x3fbc8948), SPH_C32(0x30a9fe60), SPH_C32(0x94310030), - SPH_C32(0x179cc000), SPH_C32(0xe7c80000), SPH_C32(0x15980000), - SPH_C32(0x2a8e23fd), SPH_C32(0x94350050), SPH_C32(0x1fa4b9eb), - SPH_C32(0x8ea6810c) }, - { SPH_C32(0x9e36018c), SPH_C32(0x97570000), SPH_C32(0x00b80000), - SPH_C32(0x6b990000), SPH_C32(0x581d37f9), SPH_C32(0x01faea72), - SPH_C32(0xf2790251), SPH_C32(0xe73c4451), SPH_C32(0x324e0031), - SPH_C32(0x66ab4000), SPH_C32(0xfe340000), SPH_C32(0x83430000), - SPH_C32(0x10054e00), SPH_C32(0x7fffaea3), SPH_C32(0x33c9fe64), - SPH_C32(0x2228ed84) }, - { SPH_C32(0xcec90188), SPH_C32(0xd2234000), SPH_C32(0x3d430000), - SPH_C32(0x727f0000), SPH_C32(0x43a161ff), SPH_C32(0xe088912f), - SPH_C32(0x13d1cec7), SPH_C32(0x9c2792e8), SPH_C32(0xc4ce0034), - SPH_C32(0x52e88000), SPH_C32(0xda330000), SPH_C32(0x0c7e0000), - SPH_C32(0x313275fb), SPH_C32(0x75477b0d), SPH_C32(0xfe0c757d), - SPH_C32(0xf5bd57b5) }, - { SPH_C32(0x3849018d), SPH_C32(0xe6608000), SPH_C32(0x19440000), - SPH_C32(0xfd420000), SPH_C32(0x62965a04), SPH_C32(0xea304481), - SPH_C32(0xde1445de), SPH_C32(0x4bb228d9), SPH_C32(0x62b10035), - SPH_C32(0x23df0000), SPH_C32(0xc3cf0000), SPH_C32(0x9aa50000), - SPH_C32(0x0bb91806), SPH_C32(0x9e8dd5fe), SPH_C32(0xd26132f2), - SPH_C32(0x59333b3d) }, - { SPH_C32(0x4ba90180), SPH_C32(0xe1e0c000), SPH_C32(0x42c60000), - SPH_C32(0xaa1f0000), SPH_C32(0x87f157d1), SPH_C32(0x3a1e8f0a), - SPH_C32(0xdd0dee02), SPH_C32(0x59f9a55a), SPH_C32(0x63440039), - SPH_C32(0xd8a00000), SPH_C32(0x241e0000), SPH_C32(0x110a0000), - SPH_C32(0x281b3a54), SPH_C32(0x6cdd36ea), SPH_C32(0x652348a5), - SPH_C32(0x10b01916) }, - { SPH_C32(0xbd290185), SPH_C32(0xd5a30000), SPH_C32(0x66c10000), - SPH_C32(0x25220000), SPH_C32(0xa6c66c2a), SPH_C32(0x30a65aa4), - SPH_C32(0x10c8651b), SPH_C32(0x8e6c1f6b), SPH_C32(0xc53b0038), - SPH_C32(0xa9978000), SPH_C32(0x3de20000), SPH_C32(0x87d10000), - SPH_C32(0x129057a9), SPH_C32(0x87179819), SPH_C32(0x494e0f2a), - SPH_C32(0xbc3e759e) }, - { SPH_C32(0xedd60181), SPH_C32(0x90d74000), SPH_C32(0x5b3a0000), - SPH_C32(0x3cc40000), SPH_C32(0xbd7a3a2c), SPH_C32(0xd1d421f9), - SPH_C32(0xf160a98d), SPH_C32(0xf577c9d2), SPH_C32(0x33bb003d), - SPH_C32(0x9dd44000), SPH_C32(0x19e50000), SPH_C32(0x08ec0000), - SPH_C32(0x33a76c52), SPH_C32(0x8daf4db7), SPH_C32(0x848b8433), - SPH_C32(0x6babcfaf) }, - { SPH_C32(0x1b560184), SPH_C32(0xa4948000), SPH_C32(0x7f3d0000), - SPH_C32(0xb3f90000), SPH_C32(0x9c4d01d7), SPH_C32(0xdb6cf457), - SPH_C32(0x3ca52294), SPH_C32(0x22e273e3), SPH_C32(0x95c4003c), - SPH_C32(0xece3c000), SPH_C32(0x00190000), SPH_C32(0x9e370000), - SPH_C32(0x092c01af), SPH_C32(0x6665e344), SPH_C32(0xa8e6c3bc), - SPH_C32(0xc725a327) }, - { SPH_C32(0xbcdc0189), SPH_C32(0x2edc0000), SPH_C32(0x81100000), - SPH_C32(0xae8d0000), SPH_C32(0x85644e78), SPH_C32(0xc2f6b9b0), - SPH_C32(0xa78a1f4c), SPH_C32(0xc7ef3d40), SPH_C32(0xb72e0039), - SPH_C32(0x5568c000), SPH_C32(0x81b10000), SPH_C32(0x5b230000), - SPH_C32(0xd455782e), SPH_C32(0xa569b086), SPH_C32(0xfd15dea1), - SPH_C32(0xe7f6da36) }, - { SPH_C32(0x4a5c018c), SPH_C32(0x1a9fc000), SPH_C32(0xa5170000), - SPH_C32(0x21b00000), SPH_C32(0xa4537583), SPH_C32(0xc84e6c1e), - SPH_C32(0x6a4f9455), SPH_C32(0x107a8771), SPH_C32(0x11510038), - SPH_C32(0x245f4000), SPH_C32(0x984d0000), SPH_C32(0xcdf80000), - SPH_C32(0xeede15d3), SPH_C32(0x4ea31e75), SPH_C32(0xd178992e), - SPH_C32(0x4b78b6be) }, - { SPH_C32(0x1aa30188), SPH_C32(0x5feb8000), SPH_C32(0x98ec0000), - SPH_C32(0x38560000), SPH_C32(0xbfef2385), SPH_C32(0x293c1743), - SPH_C32(0x8be758c3), SPH_C32(0x6b6151c8), SPH_C32(0xe7d1003d), - SPH_C32(0x101c8000), SPH_C32(0xbc4a0000), SPH_C32(0x42c50000), - SPH_C32(0xcfe92e28), SPH_C32(0x441bcbdb), SPH_C32(0x1cbd1237), - SPH_C32(0x9ced0c8f) }, - { SPH_C32(0xec23018d), SPH_C32(0x6ba84000), SPH_C32(0xbceb0000), - SPH_C32(0xb76b0000), SPH_C32(0x9ed8187e), SPH_C32(0x2384c2ed), - SPH_C32(0x4622d3da), SPH_C32(0xbcf4ebf9), SPH_C32(0x41ae003c), - SPH_C32(0x612b0000), SPH_C32(0xa5b60000), SPH_C32(0xd41e0000), - SPH_C32(0xf56243d5), SPH_C32(0xafd16528), SPH_C32(0x30d055b8), - SPH_C32(0x30636007) }, - { SPH_C32(0x1ceb0120), SPH_C32(0x0b6a0000), SPH_C32(0x067e0000), - SPH_C32(0xd73d0000), SPH_C32(0xb01c159f), SPH_C32(0xcf9e9b5a), - SPH_C32(0xd25cc5ca), SPH_C32(0xebbc06c5), SPH_C32(0x371f00c0), - SPH_C32(0x6b0e0000), SPH_C32(0xb7d50000), SPH_C32(0x6ba50000), - SPH_C32(0x5ff71f0b), SPH_C32(0x070a6a19), SPH_C32(0x8c51e2f1), - SPH_C32(0xb6d737e7) }, - { SPH_C32(0xea6b0125), SPH_C32(0x3f29c000), SPH_C32(0x22790000), - SPH_C32(0x58000000), SPH_C32(0x912b2e64), SPH_C32(0xc5264ef4), - SPH_C32(0x1f994ed3), SPH_C32(0x3c29bcf4), SPH_C32(0x916000c1), - SPH_C32(0x1a398000), SPH_C32(0xae290000), SPH_C32(0xfd7e0000), - SPH_C32(0x657c72f6), SPH_C32(0xecc0c4ea), SPH_C32(0xa03ca57e), - SPH_C32(0x1a595b6f) }, - { SPH_C32(0xba940121), SPH_C32(0x7a5d8000), SPH_C32(0x1f820000), - SPH_C32(0x41e60000), SPH_C32(0x8a977862), SPH_C32(0x245435a9), - SPH_C32(0xfe318245), SPH_C32(0x47326a4d), SPH_C32(0x67e000c4), - SPH_C32(0x2e7a4000), SPH_C32(0x8a2e0000), SPH_C32(0x72430000), - SPH_C32(0x444b490d), SPH_C32(0xe6781144), SPH_C32(0x6df92e67), - SPH_C32(0xcdcce15e) }, - { SPH_C32(0x4c140124), SPH_C32(0x4e1e4000), SPH_C32(0x3b850000), - SPH_C32(0xcedb0000), SPH_C32(0xaba04399), SPH_C32(0x2eece007), - SPH_C32(0x33f4095c), SPH_C32(0x90a7d07c), SPH_C32(0xc19f00c5), - SPH_C32(0x5f4dc000), SPH_C32(0x93d20000), SPH_C32(0xe4980000), - SPH_C32(0x7ec024f0), SPH_C32(0x0db2bfb7), SPH_C32(0x419469e8), - SPH_C32(0x61428dd6) }, - { SPH_C32(0xeb9e0129), SPH_C32(0xc456c000), SPH_C32(0xc5a80000), - SPH_C32(0xd3af0000), SPH_C32(0xb2890c36), SPH_C32(0x3776ade0), - SPH_C32(0xa8db3484), SPH_C32(0x75aa9edf), SPH_C32(0xe37500c0), - SPH_C32(0xe6c6c000), SPH_C32(0x127a0000), SPH_C32(0x218c0000), - SPH_C32(0xa3b95d71), SPH_C32(0xcebeec75), SPH_C32(0x146774f5), - SPH_C32(0x4191f4c7) }, - { SPH_C32(0x1d1e012c), SPH_C32(0xf0150000), SPH_C32(0xe1af0000), - SPH_C32(0x5c920000), SPH_C32(0x93be37cd), SPH_C32(0x3dce784e), - SPH_C32(0x651ebf9d), SPH_C32(0xa23f24ee), SPH_C32(0x450a00c1), - SPH_C32(0x97f14000), SPH_C32(0x0b860000), SPH_C32(0xb7570000), - SPH_C32(0x9932308c), SPH_C32(0x25744286), SPH_C32(0x380a337a), - SPH_C32(0xed1f984f) }, - { SPH_C32(0x4de10128), SPH_C32(0xb5614000), SPH_C32(0xdc540000), - SPH_C32(0x45740000), SPH_C32(0x880261cb), SPH_C32(0xdcbc0313), - SPH_C32(0x84b6730b), SPH_C32(0xd924f257), SPH_C32(0xb38a00c4), - SPH_C32(0xa3b28000), SPH_C32(0x2f810000), SPH_C32(0x386a0000), - SPH_C32(0xb8050b77), SPH_C32(0x2fcc9728), SPH_C32(0xf5cfb863), - SPH_C32(0x3a8a227e) }, - { SPH_C32(0xbb61012d), SPH_C32(0x81228000), SPH_C32(0xf8530000), - SPH_C32(0xca490000), SPH_C32(0xa9355a30), SPH_C32(0xd604d6bd), - SPH_C32(0x4973f812), SPH_C32(0x0eb14866), SPH_C32(0x15f500c5), - SPH_C32(0xd2850000), SPH_C32(0x367d0000), SPH_C32(0xaeb10000), - SPH_C32(0x828e668a), SPH_C32(0xc40639db), SPH_C32(0xd9a2ffec), - SPH_C32(0x96044ef6) }, - { SPH_C32(0xc8810120), SPH_C32(0x86a2c000), SPH_C32(0xa3d10000), - SPH_C32(0x9d140000), SPH_C32(0x4c5257e5), SPH_C32(0x062a1d36), - SPH_C32(0x4a6a53ce), SPH_C32(0x1cfac5e5), SPH_C32(0x140000c9), - SPH_C32(0x29fa0000), SPH_C32(0xd1ac0000), SPH_C32(0x251e0000), - SPH_C32(0xa12c44d8), SPH_C32(0x3656dacf), SPH_C32(0x6ee085bb), - SPH_C32(0xdf876cdd) }, - { SPH_C32(0x3e010125), SPH_C32(0xb2e10000), SPH_C32(0x87d60000), - SPH_C32(0x12290000), SPH_C32(0x6d656c1e), SPH_C32(0x0c92c898), - SPH_C32(0x87afd8d7), SPH_C32(0xcb6f7fd4), SPH_C32(0xb27f00c8), - SPH_C32(0x58cd8000), SPH_C32(0xc8500000), SPH_C32(0xb3c50000), - SPH_C32(0x9ba72925), SPH_C32(0xdd9c743c), SPH_C32(0x428dc234), - SPH_C32(0x73090055) }, - { SPH_C32(0x6efe0121), SPH_C32(0xf7954000), SPH_C32(0xba2d0000), - SPH_C32(0x0bcf0000), SPH_C32(0x76d93a18), SPH_C32(0xede0b3c5), - SPH_C32(0x66071441), SPH_C32(0xb074a96d), SPH_C32(0x44ff00cd), - SPH_C32(0x6c8e4000), SPH_C32(0xec570000), SPH_C32(0x3cf80000), - SPH_C32(0xba9012de), SPH_C32(0xd724a192), SPH_C32(0x8f48492d), - SPH_C32(0xa49cba64) }, - { SPH_C32(0x987e0124), SPH_C32(0xc3d68000), SPH_C32(0x9e2a0000), - SPH_C32(0x84f20000), SPH_C32(0x57ee01e3), SPH_C32(0xe758666b), - SPH_C32(0xabc29f58), SPH_C32(0x67e1135c), SPH_C32(0xe28000cc), - SPH_C32(0x1db9c000), SPH_C32(0xf5ab0000), SPH_C32(0xaa230000), - SPH_C32(0x801b7f23), SPH_C32(0x3cee0f61), SPH_C32(0xa3250ea2), - SPH_C32(0x0812d6ec) }, - { SPH_C32(0x3ff40129), SPH_C32(0x499e0000), SPH_C32(0x60070000), - SPH_C32(0x99860000), SPH_C32(0x4ec74e4c), SPH_C32(0xfec22b8c), - SPH_C32(0x30eda280), SPH_C32(0x82ec5dff), SPH_C32(0xc06a00c9), - SPH_C32(0xa432c000), SPH_C32(0x74030000), SPH_C32(0x6f370000), - SPH_C32(0x5d6206a2), SPH_C32(0xffe25ca3), SPH_C32(0xf6d613bf), - SPH_C32(0x28c1affd) }, - { SPH_C32(0xc974012c), SPH_C32(0x7dddc000), SPH_C32(0x44000000), - SPH_C32(0x16bb0000), SPH_C32(0x6ff075b7), SPH_C32(0xf47afe22), - SPH_C32(0xfd282999), SPH_C32(0x5579e7ce), SPH_C32(0x661500c8), - SPH_C32(0xd5054000), SPH_C32(0x6dff0000), SPH_C32(0xf9ec0000), - SPH_C32(0x67e96b5f), SPH_C32(0x1428f250), SPH_C32(0xdabb5430), - SPH_C32(0x844fc375) }, - { SPH_C32(0x998b0128), SPH_C32(0x38a98000), SPH_C32(0x79fb0000), - SPH_C32(0x0f5d0000), SPH_C32(0x744c23b1), SPH_C32(0x1508857f), - SPH_C32(0x1c80e50f), SPH_C32(0x2e623177), SPH_C32(0x909500cd), - SPH_C32(0xe1468000), SPH_C32(0x49f80000), SPH_C32(0x76d10000), - SPH_C32(0x46de50a4), SPH_C32(0x1e9027fe), SPH_C32(0x177edf29), - SPH_C32(0x53da7944) }, - { SPH_C32(0x6f0b012d), SPH_C32(0x0cea4000), SPH_C32(0x5dfc0000), - SPH_C32(0x80600000), SPH_C32(0x557b184a), SPH_C32(0x1fb050d1), - SPH_C32(0xd1456e16), SPH_C32(0xf9f78b46), SPH_C32(0x36ea00cc), - SPH_C32(0x90710000), SPH_C32(0x50040000), SPH_C32(0xe00a0000), - SPH_C32(0x7c553d59), SPH_C32(0xf55a890d), SPH_C32(0x3b1398a6), - SPH_C32(0xff5415cc) }, - { SPH_C32(0x6baf01d0), SPH_C32(0xfa300000), SPH_C32(0xf3cc0000), - SPH_C32(0xe3290000), SPH_C32(0x392b6b13), SPH_C32(0x9515777f), - SPH_C32(0xd99f08d4), SPH_C32(0x248b730e), SPH_C32(0xc3730090), - SPH_C32(0xfd160000), SPH_C32(0xa3700000), SPH_C32(0x68ba0000), - SPH_C32(0x1d6361b3), SPH_C32(0x61b51400), SPH_C32(0x10f59223), - SPH_C32(0x3ce32293) }, - { SPH_C32(0x9d2f01d5), SPH_C32(0xce73c000), SPH_C32(0xd7cb0000), - SPH_C32(0x6c140000), SPH_C32(0x181c50e8), SPH_C32(0x9fada2d1), - SPH_C32(0x145a83cd), SPH_C32(0xf31ec93f), SPH_C32(0x650c0091), - SPH_C32(0x8c218000), SPH_C32(0xba8c0000), SPH_C32(0xfe610000), - SPH_C32(0x27e80c4e), SPH_C32(0x8a7fbaf3), SPH_C32(0x3c98d5ac), - SPH_C32(0x906d4e1b) }, - { SPH_C32(0xcdd001d1), SPH_C32(0x8b078000), SPH_C32(0xea300000), - SPH_C32(0x75f20000), SPH_C32(0x03a006ee), SPH_C32(0x7edfd98c), - SPH_C32(0xf5f24f5b), SPH_C32(0x88051f86), SPH_C32(0x938c0094), - SPH_C32(0xb8624000), SPH_C32(0x9e8b0000), SPH_C32(0x715c0000), - SPH_C32(0x06df37b5), SPH_C32(0x80c76f5d), SPH_C32(0xf15d5eb5), - SPH_C32(0x47f8f42a) }, - { SPH_C32(0x3b5001d4), SPH_C32(0xbf444000), SPH_C32(0xce370000), - SPH_C32(0xfacf0000), SPH_C32(0x22973d15), SPH_C32(0x74670c22), - SPH_C32(0x3837c442), SPH_C32(0x5f90a5b7), SPH_C32(0x35f30095), - SPH_C32(0xc955c000), SPH_C32(0x87770000), SPH_C32(0xe7870000), - SPH_C32(0x3c545a48), SPH_C32(0x6b0dc1ae), SPH_C32(0xdd30193a), - SPH_C32(0xeb7698a2) }, - { SPH_C32(0x9cda01d9), SPH_C32(0x350cc000), SPH_C32(0x301a0000), - SPH_C32(0xe7bb0000), SPH_C32(0x3bbe72ba), SPH_C32(0x6dfd41c5), - SPH_C32(0xa318f99a), SPH_C32(0xba9deb14), SPH_C32(0x17190090), - SPH_C32(0x70dec000), SPH_C32(0x06df0000), SPH_C32(0x22930000), - SPH_C32(0xe12d23c9), SPH_C32(0xa801926c), SPH_C32(0x88c30427), - SPH_C32(0xcba5e1b3) }, - { SPH_C32(0x6a5a01dc), SPH_C32(0x014f0000), SPH_C32(0x141d0000), - SPH_C32(0x68860000), SPH_C32(0x1a894941), SPH_C32(0x6745946b), - SPH_C32(0x6edd7283), SPH_C32(0x6d085125), SPH_C32(0xb1660091), - SPH_C32(0x01e94000), SPH_C32(0x1f230000), SPH_C32(0xb4480000), - SPH_C32(0xdba64e34), SPH_C32(0x43cb3c9f), SPH_C32(0xa4ae43a8), - SPH_C32(0x672b8d3b) }, - { SPH_C32(0x3aa501d8), SPH_C32(0x443b4000), SPH_C32(0x29e60000), - SPH_C32(0x71600000), SPH_C32(0x01351f47), SPH_C32(0x8637ef36), - SPH_C32(0x8f75be15), SPH_C32(0x1613879c), SPH_C32(0x47e60094), - SPH_C32(0x35aa8000), SPH_C32(0x3b240000), SPH_C32(0x3b750000), - SPH_C32(0xfa9175cf), SPH_C32(0x4973e931), SPH_C32(0x696bc8b1), - SPH_C32(0xb0be370a) }, - { SPH_C32(0xcc2501dd), SPH_C32(0x70788000), SPH_C32(0x0de10000), - SPH_C32(0xfe5d0000), SPH_C32(0x200224bc), SPH_C32(0x8c8f3a98), - SPH_C32(0x42b0350c), SPH_C32(0xc1863dad), SPH_C32(0xe1990095), - SPH_C32(0x449d0000), SPH_C32(0x22d80000), SPH_C32(0xadae0000), - SPH_C32(0xc01a1832), SPH_C32(0xa2b947c2), SPH_C32(0x45068f3e), - SPH_C32(0x1c305b82) }, - { SPH_C32(0xbfc501d0), SPH_C32(0x77f8c000), SPH_C32(0x56630000), - SPH_C32(0xa9000000), SPH_C32(0xc5652969), SPH_C32(0x5ca1f113), - SPH_C32(0x41a99ed0), SPH_C32(0xd3cdb02e), SPH_C32(0xe06c0099), - SPH_C32(0xbfe20000), SPH_C32(0xc5090000), SPH_C32(0x26010000), - SPH_C32(0xe3b83a60), SPH_C32(0x50e9a4d6), SPH_C32(0xf244f569), - SPH_C32(0x55b379a9) }, - { SPH_C32(0x494501d5), SPH_C32(0x43bb0000), SPH_C32(0x72640000), - SPH_C32(0x263d0000), SPH_C32(0xe4521292), SPH_C32(0x561924bd), - SPH_C32(0x8c6c15c9), SPH_C32(0x04580a1f), SPH_C32(0x46130098), - SPH_C32(0xced58000), SPH_C32(0xdcf50000), SPH_C32(0xb0da0000), - SPH_C32(0xd933579d), SPH_C32(0xbb230a25), SPH_C32(0xde29b2e6), - SPH_C32(0xf93d1521) }, - { SPH_C32(0x19ba01d1), SPH_C32(0x06cf4000), SPH_C32(0x4f9f0000), - SPH_C32(0x3fdb0000), SPH_C32(0xffee4494), SPH_C32(0xb76b5fe0), - SPH_C32(0x6dc4d95f), SPH_C32(0x7f43dca6), SPH_C32(0xb093009d), - SPH_C32(0xfa964000), SPH_C32(0xf8f20000), SPH_C32(0x3fe70000), - SPH_C32(0xf8046c66), SPH_C32(0xb19bdf8b), SPH_C32(0x13ec39ff), - SPH_C32(0x2ea8af10) }, - { SPH_C32(0xef3a01d4), SPH_C32(0x328c8000), SPH_C32(0x6b980000), - SPH_C32(0xb0e60000), SPH_C32(0xded97f6f), SPH_C32(0xbdd38a4e), - SPH_C32(0xa0015246), SPH_C32(0xa8d66697), SPH_C32(0x16ec009c), - SPH_C32(0x8ba1c000), SPH_C32(0xe10e0000), SPH_C32(0xa93c0000), - SPH_C32(0xc28f019b), SPH_C32(0x5a517178), SPH_C32(0x3f817e70), - SPH_C32(0x8226c398) }, - { SPH_C32(0x48b001d9), SPH_C32(0xb8c40000), SPH_C32(0x95b50000), - SPH_C32(0xad920000), SPH_C32(0xc7f030c0), SPH_C32(0xa449c7a9), - SPH_C32(0x3b2e6f9e), SPH_C32(0x4ddb2834), SPH_C32(0x34060099), - SPH_C32(0x322ac000), SPH_C32(0x60a60000), SPH_C32(0x6c280000), - SPH_C32(0x1ff6781a), SPH_C32(0x995d22ba), SPH_C32(0x6a72636d), - SPH_C32(0xa2f5ba89) }, - { SPH_C32(0xbe3001dc), SPH_C32(0x8c87c000), SPH_C32(0xb1b20000), - SPH_C32(0x22af0000), SPH_C32(0xe6c70b3b), SPH_C32(0xaef11207), - SPH_C32(0xf6ebe487), SPH_C32(0x9a4e9205), SPH_C32(0x92790098), - SPH_C32(0x431d4000), SPH_C32(0x795a0000), SPH_C32(0xfaf30000), - SPH_C32(0x257d15e7), SPH_C32(0x72978c49), SPH_C32(0x461f24e2), - SPH_C32(0x0e7bd601) }, - { SPH_C32(0xeecf01d8), SPH_C32(0xc9f38000), SPH_C32(0x8c490000), - SPH_C32(0x3b490000), SPH_C32(0xfd7b5d3d), SPH_C32(0x4f83695a), - SPH_C32(0x17432811), SPH_C32(0xe15544bc), SPH_C32(0x64f9009d), - SPH_C32(0x775e8000), SPH_C32(0x5d5d0000), SPH_C32(0x75ce0000), - SPH_C32(0x044a2e1c), SPH_C32(0x782f59e7), SPH_C32(0x8bdaaffb), - SPH_C32(0xd9ee6c30) }, - { SPH_C32(0x184f01dd), SPH_C32(0xfdb04000), SPH_C32(0xa84e0000), - SPH_C32(0xb4740000), SPH_C32(0xdc4c66c6), SPH_C32(0x453bbcf4), - SPH_C32(0xda86a308), SPH_C32(0x36c0fe8d), SPH_C32(0xc286009c), - SPH_C32(0x06690000), SPH_C32(0x44a10000), SPH_C32(0xe3150000), - SPH_C32(0x3ec143e1), SPH_C32(0x93e5f714), SPH_C32(0xa7b7e874), - SPH_C32(0x756000b8) }, - { SPH_C32(0xb4370060), SPH_C32(0x0c4c0000), SPH_C32(0x56c20000), - SPH_C32(0x5cae0000), SPH_C32(0x94541f3f), SPH_C32(0x3b3ef825), - SPH_C32(0x1b365f3d), SPH_C32(0xf3d45758), SPH_C32(0x5cb00110), - SPH_C32(0x913e0000), SPH_C32(0x44190000), SPH_C32(0x888c0000), - SPH_C32(0x66dc7418), SPH_C32(0x921f1d66), SPH_C32(0x55ceea25), - SPH_C32(0x925c44e9) }, - { SPH_C32(0x42b70065), SPH_C32(0x380fc000), SPH_C32(0x72c50000), - SPH_C32(0xd3930000), SPH_C32(0xb56324c4), SPH_C32(0x31862d8b), - SPH_C32(0xd6f3d424), SPH_C32(0x2441ed69), SPH_C32(0xfacf0111), - SPH_C32(0xe0098000), SPH_C32(0x5de50000), SPH_C32(0x1e570000), - SPH_C32(0x5c5719e5), SPH_C32(0x79d5b395), SPH_C32(0x79a3adaa), - SPH_C32(0x3ed22861) }, - { SPH_C32(0x12480061), SPH_C32(0x7d7b8000), SPH_C32(0x4f3e0000), - SPH_C32(0xca750000), SPH_C32(0xaedf72c2), SPH_C32(0xd0f456d6), - SPH_C32(0x375b18b2), SPH_C32(0x5f5a3bd0), SPH_C32(0x0c4f0114), - SPH_C32(0xd44a4000), SPH_C32(0x79e20000), SPH_C32(0x916a0000), - SPH_C32(0x7d60221e), SPH_C32(0x736d663b), SPH_C32(0xb46626b3), - SPH_C32(0xe9479250) }, - { SPH_C32(0xe4c80064), SPH_C32(0x49384000), SPH_C32(0x6b390000), - SPH_C32(0x45480000), SPH_C32(0x8fe84939), SPH_C32(0xda4c8378), - SPH_C32(0xfa9e93ab), SPH_C32(0x88cf81e1), SPH_C32(0xaa300115), - SPH_C32(0xa57dc000), SPH_C32(0x601e0000), SPH_C32(0x07b10000), - SPH_C32(0x47eb4fe3), SPH_C32(0x98a7c8c8), SPH_C32(0x980b613c), - SPH_C32(0x45c9fed8) }, - { SPH_C32(0x43420069), SPH_C32(0xc370c000), SPH_C32(0x95140000), - SPH_C32(0x583c0000), SPH_C32(0x96c10696), SPH_C32(0xc3d6ce9f), - SPH_C32(0x61b1ae73), SPH_C32(0x6dc2cf42), SPH_C32(0x88da0110), - SPH_C32(0x1cf6c000), SPH_C32(0xe1b60000), SPH_C32(0xc2a50000), - SPH_C32(0x9a923662), SPH_C32(0x5bab9b0a), SPH_C32(0xcdf87c21), - SPH_C32(0x651a87c9) }, - { SPH_C32(0xb5c2006c), SPH_C32(0xf7330000), SPH_C32(0xb1130000), - SPH_C32(0xd7010000), SPH_C32(0xb7f63d6d), SPH_C32(0xc96e1b31), - SPH_C32(0xac74256a), SPH_C32(0xba577573), SPH_C32(0x2ea50111), - SPH_C32(0x6dc14000), SPH_C32(0xf84a0000), SPH_C32(0x547e0000), - SPH_C32(0xa0195b9f), SPH_C32(0xb06135f9), SPH_C32(0xe1953bae), - SPH_C32(0xc994eb41) }, - { SPH_C32(0xe53d0068), SPH_C32(0xb2474000), SPH_C32(0x8ce80000), - SPH_C32(0xcee70000), SPH_C32(0xac4a6b6b), SPH_C32(0x281c606c), - SPH_C32(0x4ddce9fc), SPH_C32(0xc14ca3ca), SPH_C32(0xd8250114), - SPH_C32(0x59828000), SPH_C32(0xdc4d0000), SPH_C32(0xdb430000), - SPH_C32(0x812e6064), SPH_C32(0xbad9e057), SPH_C32(0x2c50b0b7), - SPH_C32(0x1e015170) }, - { SPH_C32(0x13bd006d), SPH_C32(0x86048000), SPH_C32(0xa8ef0000), - SPH_C32(0x41da0000), SPH_C32(0x8d7d5090), SPH_C32(0x22a4b5c2), - SPH_C32(0x801962e5), SPH_C32(0x16d919fb), SPH_C32(0x7e5a0115), - SPH_C32(0x28b50000), SPH_C32(0xc5b10000), SPH_C32(0x4d980000), - SPH_C32(0xbba50d99), SPH_C32(0x51134ea4), SPH_C32(0x003df738), - SPH_C32(0xb28f3df8) }, - { SPH_C32(0x605d0060), SPH_C32(0x8184c000), SPH_C32(0xf36d0000), - SPH_C32(0x16870000), SPH_C32(0x681a5d45), SPH_C32(0xf28a7e49), - SPH_C32(0x8300c939), SPH_C32(0x04929478), SPH_C32(0x7faf0119), - SPH_C32(0xd3ca0000), SPH_C32(0x22600000), SPH_C32(0xc6370000), - SPH_C32(0x98072fcb), SPH_C32(0xa343adb0), SPH_C32(0xb77f8d6f), - SPH_C32(0xfb0c1fd3) }, - { SPH_C32(0x96dd0065), SPH_C32(0xb5c70000), SPH_C32(0xd76a0000), - SPH_C32(0x99ba0000), SPH_C32(0x492d66be), SPH_C32(0xf832abe7), - SPH_C32(0x4ec54220), SPH_C32(0xd3072e49), SPH_C32(0xd9d00118), - SPH_C32(0xa2fd8000), SPH_C32(0x3b9c0000), SPH_C32(0x50ec0000), - SPH_C32(0xa28c4236), SPH_C32(0x48890343), SPH_C32(0x9b12cae0), - SPH_C32(0x5782735b) }, - { SPH_C32(0xc6220061), SPH_C32(0xf0b34000), SPH_C32(0xea910000), - SPH_C32(0x805c0000), SPH_C32(0x529130b8), SPH_C32(0x1940d0ba), - SPH_C32(0xaf6d8eb6), SPH_C32(0xa81cf8f0), SPH_C32(0x2f50011d), - SPH_C32(0x96be4000), SPH_C32(0x1f9b0000), SPH_C32(0xdfd10000), - SPH_C32(0x83bb79cd), SPH_C32(0x4231d6ed), SPH_C32(0x56d741f9), - SPH_C32(0x8017c96a) }, - { SPH_C32(0x30a20064), SPH_C32(0xc4f08000), SPH_C32(0xce960000), - SPH_C32(0x0f610000), SPH_C32(0x73a60b43), SPH_C32(0x13f80514), - SPH_C32(0x62a805af), SPH_C32(0x7f8942c1), SPH_C32(0x892f011c), - SPH_C32(0xe789c000), SPH_C32(0x06670000), SPH_C32(0x490a0000), - SPH_C32(0xb9301430), SPH_C32(0xa9fb781e), SPH_C32(0x7aba0676), - SPH_C32(0x2c99a5e2) }, - { SPH_C32(0x97280069), SPH_C32(0x4eb80000), SPH_C32(0x30bb0000), - SPH_C32(0x12150000), SPH_C32(0x6a8f44ec), SPH_C32(0x0a6248f3), - SPH_C32(0xf9873877), SPH_C32(0x9a840c62), SPH_C32(0xabc50119), - SPH_C32(0x5e02c000), SPH_C32(0x87cf0000), SPH_C32(0x8c1e0000), - SPH_C32(0x64496db1), SPH_C32(0x6af72bdc), SPH_C32(0x2f491b6b), - SPH_C32(0x0c4adcf3) }, - { SPH_C32(0x61a8006c), SPH_C32(0x7afbc000), SPH_C32(0x14bc0000), - SPH_C32(0x9d280000), SPH_C32(0x4bb87f17), SPH_C32(0x00da9d5d), - SPH_C32(0x3442b36e), SPH_C32(0x4d11b653), SPH_C32(0x0dba0118), - SPH_C32(0x2f354000), SPH_C32(0x9e330000), SPH_C32(0x1ac50000), - SPH_C32(0x5ec2004c), SPH_C32(0x813d852f), SPH_C32(0x03245ce4), - SPH_C32(0xa0c4b07b) }, - { SPH_C32(0x31570068), SPH_C32(0x3f8f8000), SPH_C32(0x29470000), - SPH_C32(0x84ce0000), SPH_C32(0x50042911), SPH_C32(0xe1a8e600), - SPH_C32(0xd5ea7ff8), SPH_C32(0x360a60ea), SPH_C32(0xfb3a011d), - SPH_C32(0x1b768000), SPH_C32(0xba340000), SPH_C32(0x95f80000), - SPH_C32(0x7ff53bb7), SPH_C32(0x8b855081), SPH_C32(0xcee1d7fd), - SPH_C32(0x77510a4a) }, - { SPH_C32(0xc7d7006d), SPH_C32(0x0bcc4000), SPH_C32(0x0d400000), - SPH_C32(0x0bf30000), SPH_C32(0x713312ea), SPH_C32(0xeb1033ae), - SPH_C32(0x182ff4e1), SPH_C32(0xe19fdadb), SPH_C32(0x5d45011c), - SPH_C32(0x6a410000), SPH_C32(0xa3c80000), SPH_C32(0x03230000), - SPH_C32(0x457e564a), SPH_C32(0x604ffe72), SPH_C32(0xe28c9072), - SPH_C32(0xdbdf66c2) }, - { SPH_C32(0xc3730090), SPH_C32(0xfd160000), SPH_C32(0xa3700000), - SPH_C32(0x68ba0000), SPH_C32(0x1d6361b3), SPH_C32(0x61b51400), - SPH_C32(0x10f59223), SPH_C32(0x3ce32293), SPH_C32(0xa8dc0140), - SPH_C32(0x07260000), SPH_C32(0x50bc0000), SPH_C32(0x8b930000), - SPH_C32(0x24480aa0), SPH_C32(0xf4a0637f), SPH_C32(0xc96a9af7), - SPH_C32(0x1868519d) }, - { SPH_C32(0x35f30095), SPH_C32(0xc955c000), SPH_C32(0x87770000), - SPH_C32(0xe7870000), SPH_C32(0x3c545a48), SPH_C32(0x6b0dc1ae), - SPH_C32(0xdd30193a), SPH_C32(0xeb7698a2), SPH_C32(0x0ea30141), - SPH_C32(0x76118000), SPH_C32(0x49400000), SPH_C32(0x1d480000), - SPH_C32(0x1ec3675d), SPH_C32(0x1f6acd8c), SPH_C32(0xe507dd78), - SPH_C32(0xb4e63d15) }, - { SPH_C32(0x650c0091), SPH_C32(0x8c218000), SPH_C32(0xba8c0000), - SPH_C32(0xfe610000), SPH_C32(0x27e80c4e), SPH_C32(0x8a7fbaf3), - SPH_C32(0x3c98d5ac), SPH_C32(0x906d4e1b), SPH_C32(0xf8230144), - SPH_C32(0x42524000), SPH_C32(0x6d470000), SPH_C32(0x92750000), - SPH_C32(0x3ff45ca6), SPH_C32(0x15d21822), SPH_C32(0x28c25661), - SPH_C32(0x63738724) }, - { SPH_C32(0x938c0094), SPH_C32(0xb8624000), SPH_C32(0x9e8b0000), - SPH_C32(0x715c0000), SPH_C32(0x06df37b5), SPH_C32(0x80c76f5d), - SPH_C32(0xf15d5eb5), SPH_C32(0x47f8f42a), SPH_C32(0x5e5c0145), - SPH_C32(0x3365c000), SPH_C32(0x74bb0000), SPH_C32(0x04ae0000), - SPH_C32(0x057f315b), SPH_C32(0xfe18b6d1), SPH_C32(0x04af11ee), - SPH_C32(0xcffdebac) }, - { SPH_C32(0x34060099), SPH_C32(0x322ac000), SPH_C32(0x60a60000), - SPH_C32(0x6c280000), SPH_C32(0x1ff6781a), SPH_C32(0x995d22ba), - SPH_C32(0x6a72636d), SPH_C32(0xa2f5ba89), SPH_C32(0x7cb60140), - SPH_C32(0x8aeec000), SPH_C32(0xf5130000), SPH_C32(0xc1ba0000), - SPH_C32(0xd80648da), SPH_C32(0x3d14e513), SPH_C32(0x515c0cf3), - SPH_C32(0xef2e92bd) }, - { SPH_C32(0xc286009c), SPH_C32(0x06690000), SPH_C32(0x44a10000), - SPH_C32(0xe3150000), SPH_C32(0x3ec143e1), SPH_C32(0x93e5f714), - SPH_C32(0xa7b7e874), SPH_C32(0x756000b8), SPH_C32(0xdac90141), - SPH_C32(0xfbd94000), SPH_C32(0xecef0000), SPH_C32(0x57610000), - SPH_C32(0xe28d2527), SPH_C32(0xd6de4be0), SPH_C32(0x7d314b7c), - SPH_C32(0x43a0fe35) }, - { SPH_C32(0x92790098), SPH_C32(0x431d4000), SPH_C32(0x795a0000), - SPH_C32(0xfaf30000), SPH_C32(0x257d15e7), SPH_C32(0x72978c49), - SPH_C32(0x461f24e2), SPH_C32(0x0e7bd601), SPH_C32(0x2c490144), - SPH_C32(0xcf9a8000), SPH_C32(0xc8e80000), SPH_C32(0xd85c0000), - SPH_C32(0xc3ba1edc), SPH_C32(0xdc669e4e), SPH_C32(0xb0f4c065), - SPH_C32(0x94354404) }, - { SPH_C32(0x64f9009d), SPH_C32(0x775e8000), SPH_C32(0x5d5d0000), - SPH_C32(0x75ce0000), SPH_C32(0x044a2e1c), SPH_C32(0x782f59e7), - SPH_C32(0x8bdaaffb), SPH_C32(0xd9ee6c30), SPH_C32(0x8a360145), - SPH_C32(0xbead0000), SPH_C32(0xd1140000), SPH_C32(0x4e870000), - SPH_C32(0xf9317321), SPH_C32(0x37ac30bd), SPH_C32(0x9c9987ea), - SPH_C32(0x38bb288c) }, - { SPH_C32(0x17190090), SPH_C32(0x70dec000), SPH_C32(0x06df0000), - SPH_C32(0x22930000), SPH_C32(0xe12d23c9), SPH_C32(0xa801926c), - SPH_C32(0x88c30427), SPH_C32(0xcba5e1b3), SPH_C32(0x8bc30149), - SPH_C32(0x45d20000), SPH_C32(0x36c50000), SPH_C32(0xc5280000), - SPH_C32(0xda935173), SPH_C32(0xc5fcd3a9), SPH_C32(0x2bdbfdbd), - SPH_C32(0x71380aa7) }, - { SPH_C32(0xe1990095), SPH_C32(0x449d0000), SPH_C32(0x22d80000), - SPH_C32(0xadae0000), SPH_C32(0xc01a1832), SPH_C32(0xa2b947c2), - SPH_C32(0x45068f3e), SPH_C32(0x1c305b82), SPH_C32(0x2dbc0148), - SPH_C32(0x34e58000), SPH_C32(0x2f390000), SPH_C32(0x53f30000), - SPH_C32(0xe0183c8e), SPH_C32(0x2e367d5a), SPH_C32(0x07b6ba32), - SPH_C32(0xddb6662f) }, - { SPH_C32(0xb1660091), SPH_C32(0x01e94000), SPH_C32(0x1f230000), - SPH_C32(0xb4480000), SPH_C32(0xdba64e34), SPH_C32(0x43cb3c9f), - SPH_C32(0xa4ae43a8), SPH_C32(0x672b8d3b), SPH_C32(0xdb3c014d), - SPH_C32(0x00a64000), SPH_C32(0x0b3e0000), SPH_C32(0xdcce0000), - SPH_C32(0xc12f0775), SPH_C32(0x248ea8f4), SPH_C32(0xca73312b), - SPH_C32(0x0a23dc1e) }, - { SPH_C32(0x47e60094), SPH_C32(0x35aa8000), SPH_C32(0x3b240000), - SPH_C32(0x3b750000), SPH_C32(0xfa9175cf), SPH_C32(0x4973e931), - SPH_C32(0x696bc8b1), SPH_C32(0xb0be370a), SPH_C32(0x7d43014c), - SPH_C32(0x7191c000), SPH_C32(0x12c20000), SPH_C32(0x4a150000), - SPH_C32(0xfba46a88), SPH_C32(0xcf440607), SPH_C32(0xe61e76a4), - SPH_C32(0xa6adb096) }, - { SPH_C32(0xe06c0099), SPH_C32(0xbfe20000), SPH_C32(0xc5090000), - SPH_C32(0x26010000), SPH_C32(0xe3b83a60), SPH_C32(0x50e9a4d6), - SPH_C32(0xf244f569), SPH_C32(0x55b379a9), SPH_C32(0x5fa90149), - SPH_C32(0xc81ac000), SPH_C32(0x936a0000), SPH_C32(0x8f010000), - SPH_C32(0x26dd1309), SPH_C32(0x0c4855c5), SPH_C32(0xb3ed6bb9), - SPH_C32(0x867ec987) }, - { SPH_C32(0x16ec009c), SPH_C32(0x8ba1c000), SPH_C32(0xe10e0000), - SPH_C32(0xa93c0000), SPH_C32(0xc28f019b), SPH_C32(0x5a517178), - SPH_C32(0x3f817e70), SPH_C32(0x8226c398), SPH_C32(0xf9d60148), - SPH_C32(0xb92d4000), SPH_C32(0x8a960000), SPH_C32(0x19da0000), - SPH_C32(0x1c567ef4), SPH_C32(0xe782fb36), SPH_C32(0x9f802c36), - SPH_C32(0x2af0a50f) }, - { SPH_C32(0x46130098), SPH_C32(0xced58000), SPH_C32(0xdcf50000), - SPH_C32(0xb0da0000), SPH_C32(0xd933579d), SPH_C32(0xbb230a25), - SPH_C32(0xde29b2e6), SPH_C32(0xf93d1521), SPH_C32(0x0f56014d), - SPH_C32(0x8d6e8000), SPH_C32(0xae910000), SPH_C32(0x96e70000), - SPH_C32(0x3d61450f), SPH_C32(0xed3a2e98), SPH_C32(0x5245a72f), - SPH_C32(0xfd651f3e) }, - { SPH_C32(0xb093009d), SPH_C32(0xfa964000), SPH_C32(0xf8f20000), - SPH_C32(0x3fe70000), SPH_C32(0xf8046c66), SPH_C32(0xb19bdf8b), - SPH_C32(0x13ec39ff), SPH_C32(0x2ea8af10), SPH_C32(0xa929014c), - SPH_C32(0xfc590000), SPH_C32(0xb76d0000), SPH_C32(0x003c0000), - SPH_C32(0x07ea28f2), SPH_C32(0x06f0806b), SPH_C32(0x7e28e0a0), - SPH_C32(0x51eb73b6) }, - { SPH_C32(0x405b0030), SPH_C32(0x9a540000), SPH_C32(0x42670000), - SPH_C32(0x5fb10000), SPH_C32(0xd6c06187), SPH_C32(0x5d81863c), - SPH_C32(0x87922fef), SPH_C32(0x79e0422c), SPH_C32(0xdf9801b0), - SPH_C32(0xf67c0000), SPH_C32(0xa50e0000), SPH_C32(0xbf870000), - SPH_C32(0xad7f742c), SPH_C32(0xae2b8f5a), SPH_C32(0xc2a957e9), - SPH_C32(0xd75f2456) }, - { SPH_C32(0xb6db0035), SPH_C32(0xae17c000), SPH_C32(0x66600000), - SPH_C32(0xd08c0000), SPH_C32(0xf7f75a7c), SPH_C32(0x57395392), - SPH_C32(0x4a57a4f6), SPH_C32(0xae75f81d), SPH_C32(0x79e701b1), - SPH_C32(0x874b8000), SPH_C32(0xbcf20000), SPH_C32(0x295c0000), - SPH_C32(0x97f419d1), SPH_C32(0x45e121a9), SPH_C32(0xeec41066), - SPH_C32(0x7bd148de) }, - { SPH_C32(0xe6240031), SPH_C32(0xeb638000), SPH_C32(0x5b9b0000), - SPH_C32(0xc96a0000), SPH_C32(0xec4b0c7a), SPH_C32(0xb64b28cf), - SPH_C32(0xabff6860), SPH_C32(0xd56e2ea4), SPH_C32(0x8f6701b4), - SPH_C32(0xb3084000), SPH_C32(0x98f50000), SPH_C32(0xa6610000), - SPH_C32(0xb6c3222a), SPH_C32(0x4f59f407), SPH_C32(0x23019b7f), - SPH_C32(0xac44f2ef) }, - { SPH_C32(0x10a40034), SPH_C32(0xdf204000), SPH_C32(0x7f9c0000), - SPH_C32(0x46570000), SPH_C32(0xcd7c3781), SPH_C32(0xbcf3fd61), - SPH_C32(0x663ae379), SPH_C32(0x02fb9495), SPH_C32(0x291801b5), - SPH_C32(0xc23fc000), SPH_C32(0x81090000), SPH_C32(0x30ba0000), - SPH_C32(0x8c484fd7), SPH_C32(0xa4935af4), SPH_C32(0x0f6cdcf0), - SPH_C32(0x00ca9e67) }, - { SPH_C32(0xb72e0039), SPH_C32(0x5568c000), SPH_C32(0x81b10000), - SPH_C32(0x5b230000), SPH_C32(0xd455782e), SPH_C32(0xa569b086), - SPH_C32(0xfd15dea1), SPH_C32(0xe7f6da36), SPH_C32(0x0bf201b0), - SPH_C32(0x7bb4c000), SPH_C32(0x00a10000), SPH_C32(0xf5ae0000), - SPH_C32(0x51313656), SPH_C32(0x679f0936), SPH_C32(0x5a9fc1ed), - SPH_C32(0x2019e776) }, - { SPH_C32(0x41ae003c), SPH_C32(0x612b0000), SPH_C32(0xa5b60000), - SPH_C32(0xd41e0000), SPH_C32(0xf56243d5), SPH_C32(0xafd16528), - SPH_C32(0x30d055b8), SPH_C32(0x30636007), SPH_C32(0xad8d01b1), - SPH_C32(0x0a834000), SPH_C32(0x195d0000), SPH_C32(0x63750000), - SPH_C32(0x6bba5bab), SPH_C32(0x8c55a7c5), SPH_C32(0x76f28662), - SPH_C32(0x8c978bfe) }, - { SPH_C32(0x11510038), SPH_C32(0x245f4000), SPH_C32(0x984d0000), - SPH_C32(0xcdf80000), SPH_C32(0xeede15d3), SPH_C32(0x4ea31e75), - SPH_C32(0xd178992e), SPH_C32(0x4b78b6be), SPH_C32(0x5b0d01b4), - SPH_C32(0x3ec08000), SPH_C32(0x3d5a0000), SPH_C32(0xec480000), - SPH_C32(0x4a8d6050), SPH_C32(0x86ed726b), SPH_C32(0xbb370d7b), - SPH_C32(0x5b0231cf) }, - { SPH_C32(0xe7d1003d), SPH_C32(0x101c8000), SPH_C32(0xbc4a0000), - SPH_C32(0x42c50000), SPH_C32(0xcfe92e28), SPH_C32(0x441bcbdb), - SPH_C32(0x1cbd1237), SPH_C32(0x9ced0c8f), SPH_C32(0xfd7201b5), - SPH_C32(0x4ff70000), SPH_C32(0x24a60000), SPH_C32(0x7a930000), - SPH_C32(0x70060dad), SPH_C32(0x6d27dc98), SPH_C32(0x975a4af4), - SPH_C32(0xf78c5d47) }, - { SPH_C32(0x94310030), SPH_C32(0x179cc000), SPH_C32(0xe7c80000), - SPH_C32(0x15980000), SPH_C32(0x2a8e23fd), SPH_C32(0x94350050), - SPH_C32(0x1fa4b9eb), SPH_C32(0x8ea6810c), SPH_C32(0xfc8701b9), - SPH_C32(0xb4880000), SPH_C32(0xc3770000), SPH_C32(0xf13c0000), - SPH_C32(0x53a42fff), SPH_C32(0x9f773f8c), SPH_C32(0x201830a3), - SPH_C32(0xbe0f7f6c) }, - { SPH_C32(0x62b10035), SPH_C32(0x23df0000), SPH_C32(0xc3cf0000), - SPH_C32(0x9aa50000), SPH_C32(0x0bb91806), SPH_C32(0x9e8dd5fe), - SPH_C32(0xd26132f2), SPH_C32(0x59333b3d), SPH_C32(0x5af801b8), - SPH_C32(0xc5bf8000), SPH_C32(0xda8b0000), SPH_C32(0x67e70000), - SPH_C32(0x692f4202), SPH_C32(0x74bd917f), SPH_C32(0x0c75772c), - SPH_C32(0x128113e4) }, - { SPH_C32(0x324e0031), SPH_C32(0x66ab4000), SPH_C32(0xfe340000), - SPH_C32(0x83430000), SPH_C32(0x10054e00), SPH_C32(0x7fffaea3), - SPH_C32(0x33c9fe64), SPH_C32(0x2228ed84), SPH_C32(0xac7801bd), - SPH_C32(0xf1fc4000), SPH_C32(0xfe8c0000), SPH_C32(0xe8da0000), - SPH_C32(0x481879f9), SPH_C32(0x7e0544d1), SPH_C32(0xc1b0fc35), - SPH_C32(0xc514a9d5) }, - { SPH_C32(0xc4ce0034), SPH_C32(0x52e88000), SPH_C32(0xda330000), - SPH_C32(0x0c7e0000), SPH_C32(0x313275fb), SPH_C32(0x75477b0d), - SPH_C32(0xfe0c757d), SPH_C32(0xf5bd57b5), SPH_C32(0x0a0701bc), - SPH_C32(0x80cbc000), SPH_C32(0xe7700000), SPH_C32(0x7e010000), - SPH_C32(0x72931404), SPH_C32(0x95cfea22), SPH_C32(0xedddbbba), - SPH_C32(0x699ac55d) }, - { SPH_C32(0x63440039), SPH_C32(0xd8a00000), SPH_C32(0x241e0000), - SPH_C32(0x110a0000), SPH_C32(0x281b3a54), SPH_C32(0x6cdd36ea), - SPH_C32(0x652348a5), SPH_C32(0x10b01916), SPH_C32(0x28ed01b9), - SPH_C32(0x3940c000), SPH_C32(0x66d80000), SPH_C32(0xbb150000), - SPH_C32(0xafea6d85), SPH_C32(0x56c3b9e0), SPH_C32(0xb82ea6a7), - SPH_C32(0x4949bc4c) }, - { SPH_C32(0x95c4003c), SPH_C32(0xece3c000), SPH_C32(0x00190000), - SPH_C32(0x9e370000), SPH_C32(0x092c01af), SPH_C32(0x6665e344), - SPH_C32(0xa8e6c3bc), SPH_C32(0xc725a327), SPH_C32(0x8e9201b8), - SPH_C32(0x48774000), SPH_C32(0x7f240000), SPH_C32(0x2dce0000), - SPH_C32(0x95610078), SPH_C32(0xbd091713), SPH_C32(0x9443e128), - SPH_C32(0xe5c7d0c4) }, - { SPH_C32(0xc53b0038), SPH_C32(0xa9978000), SPH_C32(0x3de20000), - SPH_C32(0x87d10000), SPH_C32(0x129057a9), SPH_C32(0x87179819), - SPH_C32(0x494e0f2a), SPH_C32(0xbc3e759e), SPH_C32(0x781201bd), - SPH_C32(0x7c348000), SPH_C32(0x5b230000), SPH_C32(0xa2f30000), - SPH_C32(0xb4563b83), SPH_C32(0xb7b1c2bd), SPH_C32(0x59866a31), - SPH_C32(0x32526af5) }, - { SPH_C32(0x33bb003d), SPH_C32(0x9dd44000), SPH_C32(0x19e50000), - SPH_C32(0x08ec0000), SPH_C32(0x33a76c52), SPH_C32(0x8daf4db7), - SPH_C32(0x848b8433), SPH_C32(0x6babcfaf), SPH_C32(0xde6d01bc), - SPH_C32(0x0d030000), SPH_C32(0x42df0000), SPH_C32(0x34280000), - SPH_C32(0x8edd567e), SPH_C32(0x5c7b6c4e), SPH_C32(0x75eb2dbe), - SPH_C32(0x9edc067d) }, - { SPH_C32(0x371f00c0), SPH_C32(0x6b0e0000), SPH_C32(0xb7d50000), - SPH_C32(0x6ba50000), SPH_C32(0x5ff71f0b), SPH_C32(0x070a6a19), - SPH_C32(0x8c51e2f1), SPH_C32(0xb6d737e7), SPH_C32(0x2bf401e0), - SPH_C32(0x60640000), SPH_C32(0xb1ab0000), SPH_C32(0xbc980000), - SPH_C32(0xefeb0a94), SPH_C32(0xc894f143), SPH_C32(0x5e0d273b), - SPH_C32(0x5d6b3122) }, - { SPH_C32(0xc19f00c5), SPH_C32(0x5f4dc000), SPH_C32(0x93d20000), - SPH_C32(0xe4980000), SPH_C32(0x7ec024f0), SPH_C32(0x0db2bfb7), - SPH_C32(0x419469e8), SPH_C32(0x61428dd6), SPH_C32(0x8d8b01e1), - SPH_C32(0x11538000), SPH_C32(0xa8570000), SPH_C32(0x2a430000), - SPH_C32(0xd5606769), SPH_C32(0x235e5fb0), SPH_C32(0x726060b4), - SPH_C32(0xf1e55daa) }, - { SPH_C32(0x916000c1), SPH_C32(0x1a398000), SPH_C32(0xae290000), - SPH_C32(0xfd7e0000), SPH_C32(0x657c72f6), SPH_C32(0xecc0c4ea), - SPH_C32(0xa03ca57e), SPH_C32(0x1a595b6f), SPH_C32(0x7b0b01e4), - SPH_C32(0x25104000), SPH_C32(0x8c500000), SPH_C32(0xa57e0000), - SPH_C32(0xf4575c92), SPH_C32(0x29e68a1e), SPH_C32(0xbfa5ebad), - SPH_C32(0x2670e79b) }, - { SPH_C32(0x67e000c4), SPH_C32(0x2e7a4000), SPH_C32(0x8a2e0000), - SPH_C32(0x72430000), SPH_C32(0x444b490d), SPH_C32(0xe6781144), - SPH_C32(0x6df92e67), SPH_C32(0xcdcce15e), SPH_C32(0xdd7401e5), - SPH_C32(0x5427c000), SPH_C32(0x95ac0000), SPH_C32(0x33a50000), - SPH_C32(0xcedc316f), SPH_C32(0xc22c24ed), SPH_C32(0x93c8ac22), - SPH_C32(0x8afe8b13) }, - { SPH_C32(0xc06a00c9), SPH_C32(0xa432c000), SPH_C32(0x74030000), - SPH_C32(0x6f370000), SPH_C32(0x5d6206a2), SPH_C32(0xffe25ca3), - SPH_C32(0xf6d613bf), SPH_C32(0x28c1affd), SPH_C32(0xff9e01e0), - SPH_C32(0xedacc000), SPH_C32(0x14040000), SPH_C32(0xf6b10000), - SPH_C32(0x13a548ee), SPH_C32(0x0120772f), SPH_C32(0xc63bb13f), - SPH_C32(0xaa2df202) }, - { SPH_C32(0x36ea00cc), SPH_C32(0x90710000), SPH_C32(0x50040000), - SPH_C32(0xe00a0000), SPH_C32(0x7c553d59), SPH_C32(0xf55a890d), - SPH_C32(0x3b1398a6), SPH_C32(0xff5415cc), SPH_C32(0x59e101e1), - SPH_C32(0x9c9b4000), SPH_C32(0x0df80000), SPH_C32(0x606a0000), - SPH_C32(0x292e2513), SPH_C32(0xeaead9dc), SPH_C32(0xea56f6b0), - SPH_C32(0x06a39e8a) }, - { SPH_C32(0x661500c8), SPH_C32(0xd5054000), SPH_C32(0x6dff0000), - SPH_C32(0xf9ec0000), SPH_C32(0x67e96b5f), SPH_C32(0x1428f250), - SPH_C32(0xdabb5430), SPH_C32(0x844fc375), SPH_C32(0xaf6101e4), - SPH_C32(0xa8d88000), SPH_C32(0x29ff0000), SPH_C32(0xef570000), - SPH_C32(0x08191ee8), SPH_C32(0xe0520c72), SPH_C32(0x27937da9), - SPH_C32(0xd13624bb) }, - { SPH_C32(0x909500cd), SPH_C32(0xe1468000), SPH_C32(0x49f80000), - SPH_C32(0x76d10000), SPH_C32(0x46de50a4), SPH_C32(0x1e9027fe), - SPH_C32(0x177edf29), SPH_C32(0x53da7944), SPH_C32(0x091e01e5), - SPH_C32(0xd9ef0000), SPH_C32(0x30030000), SPH_C32(0x798c0000), - SPH_C32(0x32927315), SPH_C32(0x0b98a281), SPH_C32(0x0bfe3a26), - SPH_C32(0x7db84833) }, - { SPH_C32(0xe37500c0), SPH_C32(0xe6c6c000), SPH_C32(0x127a0000), - SPH_C32(0x218c0000), SPH_C32(0xa3b95d71), SPH_C32(0xcebeec75), - SPH_C32(0x146774f5), SPH_C32(0x4191f4c7), SPH_C32(0x08eb01e9), - SPH_C32(0x22900000), SPH_C32(0xd7d20000), SPH_C32(0xf2230000), - SPH_C32(0x11305147), SPH_C32(0xf9c84195), SPH_C32(0xbcbc4071), - SPH_C32(0x343b6a18) }, - { SPH_C32(0x15f500c5), SPH_C32(0xd2850000), SPH_C32(0x367d0000), - SPH_C32(0xaeb10000), SPH_C32(0x828e668a), SPH_C32(0xc40639db), - SPH_C32(0xd9a2ffec), SPH_C32(0x96044ef6), SPH_C32(0xae9401e8), - SPH_C32(0x53a78000), SPH_C32(0xce2e0000), SPH_C32(0x64f80000), - SPH_C32(0x2bbb3cba), SPH_C32(0x1202ef66), SPH_C32(0x90d107fe), - SPH_C32(0x98b50690) }, - { SPH_C32(0x450a00c1), SPH_C32(0x97f14000), SPH_C32(0x0b860000), - SPH_C32(0xb7570000), SPH_C32(0x9932308c), SPH_C32(0x25744286), - SPH_C32(0x380a337a), SPH_C32(0xed1f984f), SPH_C32(0x581401ed), - SPH_C32(0x67e44000), SPH_C32(0xea290000), SPH_C32(0xebc50000), - SPH_C32(0x0a8c0741), SPH_C32(0x18ba3ac8), SPH_C32(0x5d148ce7), - SPH_C32(0x4f20bca1) }, - { SPH_C32(0xb38a00c4), SPH_C32(0xa3b28000), SPH_C32(0x2f810000), - SPH_C32(0x386a0000), SPH_C32(0xb8050b77), SPH_C32(0x2fcc9728), - SPH_C32(0xf5cfb863), SPH_C32(0x3a8a227e), SPH_C32(0xfe6b01ec), - SPH_C32(0x16d3c000), SPH_C32(0xf3d50000), SPH_C32(0x7d1e0000), - SPH_C32(0x30076abc), SPH_C32(0xf370943b), SPH_C32(0x7179cb68), - SPH_C32(0xe3aed029) }, - { SPH_C32(0x140000c9), SPH_C32(0x29fa0000), SPH_C32(0xd1ac0000), - SPH_C32(0x251e0000), SPH_C32(0xa12c44d8), SPH_C32(0x3656dacf), - SPH_C32(0x6ee085bb), SPH_C32(0xdf876cdd), SPH_C32(0xdc8101e9), - SPH_C32(0xaf58c000), SPH_C32(0x727d0000), SPH_C32(0xb80a0000), - SPH_C32(0xed7e133d), SPH_C32(0x307cc7f9), SPH_C32(0x248ad675), - SPH_C32(0xc37da938) }, - { SPH_C32(0xe28000cc), SPH_C32(0x1db9c000), SPH_C32(0xf5ab0000), - SPH_C32(0xaa230000), SPH_C32(0x801b7f23), SPH_C32(0x3cee0f61), - SPH_C32(0xa3250ea2), SPH_C32(0x0812d6ec), SPH_C32(0x7afe01e8), - SPH_C32(0xde6f4000), SPH_C32(0x6b810000), SPH_C32(0x2ed10000), - SPH_C32(0xd7f57ec0), SPH_C32(0xdbb6690a), SPH_C32(0x08e791fa), - SPH_C32(0x6ff3c5b0) }, - { SPH_C32(0xb27f00c8), SPH_C32(0x58cd8000), SPH_C32(0xc8500000), - SPH_C32(0xb3c50000), SPH_C32(0x9ba72925), SPH_C32(0xdd9c743c), - SPH_C32(0x428dc234), SPH_C32(0x73090055), SPH_C32(0x8c7e01ed), - SPH_C32(0xea2c8000), SPH_C32(0x4f860000), SPH_C32(0xa1ec0000), - SPH_C32(0xf6c2453b), SPH_C32(0xd10ebca4), SPH_C32(0xc5221ae3), - SPH_C32(0xb8667f81) }, - { SPH_C32(0x44ff00cd), SPH_C32(0x6c8e4000), SPH_C32(0xec570000), - SPH_C32(0x3cf80000), SPH_C32(0xba9012de), SPH_C32(0xd724a192), - SPH_C32(0x8f48492d), SPH_C32(0xa49cba64), SPH_C32(0x2a0101ec), - SPH_C32(0x9b1b0000), SPH_C32(0x567a0000), SPH_C32(0x37370000), - SPH_C32(0xcc4928c6), SPH_C32(0x3ac41257), SPH_C32(0xe94f5d6c), - SPH_C32(0x14e81309) }, - { SPH_C32(0x5cb00110), SPH_C32(0x913e0000), SPH_C32(0x44190000), - SPH_C32(0x888c0000), SPH_C32(0x66dc7418), SPH_C32(0x921f1d66), - SPH_C32(0x55ceea25), SPH_C32(0x925c44e9), SPH_C32(0xe8870170), - SPH_C32(0x9d720000), SPH_C32(0x12db0000), SPH_C32(0xd4220000), - SPH_C32(0xf2886b27), SPH_C32(0xa921e543), SPH_C32(0x4ef8b518), - SPH_C32(0x618813b1) }, - { SPH_C32(0xaa300115), SPH_C32(0xa57dc000), SPH_C32(0x601e0000), - SPH_C32(0x07b10000), SPH_C32(0x47eb4fe3), SPH_C32(0x98a7c8c8), - SPH_C32(0x980b613c), SPH_C32(0x45c9fed8), SPH_C32(0x4ef80171), - SPH_C32(0xec458000), SPH_C32(0x0b270000), SPH_C32(0x42f90000), - SPH_C32(0xc80306da), SPH_C32(0x42eb4bb0), SPH_C32(0x6295f297), - SPH_C32(0xcd067f39) }, - { SPH_C32(0xfacf0111), SPH_C32(0xe0098000), SPH_C32(0x5de50000), - SPH_C32(0x1e570000), SPH_C32(0x5c5719e5), SPH_C32(0x79d5b395), - SPH_C32(0x79a3adaa), SPH_C32(0x3ed22861), SPH_C32(0xb8780174), - SPH_C32(0xd8064000), SPH_C32(0x2f200000), SPH_C32(0xcdc40000), - SPH_C32(0xe9343d21), SPH_C32(0x48539e1e), SPH_C32(0xaf50798e), - SPH_C32(0x1a93c508) }, - { SPH_C32(0x0c4f0114), SPH_C32(0xd44a4000), SPH_C32(0x79e20000), - SPH_C32(0x916a0000), SPH_C32(0x7d60221e), SPH_C32(0x736d663b), - SPH_C32(0xb46626b3), SPH_C32(0xe9479250), SPH_C32(0x1e070175), - SPH_C32(0xa931c000), SPH_C32(0x36dc0000), SPH_C32(0x5b1f0000), - SPH_C32(0xd3bf50dc), SPH_C32(0xa39930ed), SPH_C32(0x833d3e01), - SPH_C32(0xb61da980) }, - { SPH_C32(0xabc50119), SPH_C32(0x5e02c000), SPH_C32(0x87cf0000), - SPH_C32(0x8c1e0000), SPH_C32(0x64496db1), SPH_C32(0x6af72bdc), - SPH_C32(0x2f491b6b), SPH_C32(0x0c4adcf3), SPH_C32(0x3ced0170), - SPH_C32(0x10bac000), SPH_C32(0xb7740000), SPH_C32(0x9e0b0000), - SPH_C32(0x0ec6295d), SPH_C32(0x6095632f), SPH_C32(0xd6ce231c), - SPH_C32(0x96ced091) }, - { SPH_C32(0x5d45011c), SPH_C32(0x6a410000), SPH_C32(0xa3c80000), - SPH_C32(0x03230000), SPH_C32(0x457e564a), SPH_C32(0x604ffe72), - SPH_C32(0xe28c9072), SPH_C32(0xdbdf66c2), SPH_C32(0x9a920171), - SPH_C32(0x618d4000), SPH_C32(0xae880000), SPH_C32(0x08d00000), - SPH_C32(0x344d44a0), SPH_C32(0x8b5fcddc), SPH_C32(0xfaa36493), - SPH_C32(0x3a40bc19) }, - { SPH_C32(0x0dba0118), SPH_C32(0x2f354000), SPH_C32(0x9e330000), - SPH_C32(0x1ac50000), SPH_C32(0x5ec2004c), SPH_C32(0x813d852f), - SPH_C32(0x03245ce4), SPH_C32(0xa0c4b07b), SPH_C32(0x6c120174), - SPH_C32(0x55ce8000), SPH_C32(0x8a8f0000), SPH_C32(0x87ed0000), - SPH_C32(0x157a7f5b), SPH_C32(0x81e71872), SPH_C32(0x3766ef8a), - SPH_C32(0xedd50628) }, - { SPH_C32(0xfb3a011d), SPH_C32(0x1b768000), SPH_C32(0xba340000), - SPH_C32(0x95f80000), SPH_C32(0x7ff53bb7), SPH_C32(0x8b855081), - SPH_C32(0xcee1d7fd), SPH_C32(0x77510a4a), SPH_C32(0xca6d0175), - SPH_C32(0x24f90000), SPH_C32(0x93730000), SPH_C32(0x11360000), - SPH_C32(0x2ff112a6), SPH_C32(0x6a2db681), SPH_C32(0x1b0ba805), - SPH_C32(0x415b6aa0) }, - { SPH_C32(0x88da0110), SPH_C32(0x1cf6c000), SPH_C32(0xe1b60000), - SPH_C32(0xc2a50000), SPH_C32(0x9a923662), SPH_C32(0x5bab9b0a), - SPH_C32(0xcdf87c21), SPH_C32(0x651a87c9), SPH_C32(0xcb980179), - SPH_C32(0xdf860000), SPH_C32(0x74a20000), SPH_C32(0x9a990000), - SPH_C32(0x0c5330f4), SPH_C32(0x987d5595), SPH_C32(0xac49d252), - SPH_C32(0x08d8488b) }, - { SPH_C32(0x7e5a0115), SPH_C32(0x28b50000), SPH_C32(0xc5b10000), - SPH_C32(0x4d980000), SPH_C32(0xbba50d99), SPH_C32(0x51134ea4), - SPH_C32(0x003df738), SPH_C32(0xb28f3df8), SPH_C32(0x6de70178), - SPH_C32(0xaeb18000), SPH_C32(0x6d5e0000), SPH_C32(0x0c420000), - SPH_C32(0x36d85d09), SPH_C32(0x73b7fb66), SPH_C32(0x802495dd), - SPH_C32(0xa4562403) }, - { SPH_C32(0x2ea50111), SPH_C32(0x6dc14000), SPH_C32(0xf84a0000), - SPH_C32(0x547e0000), SPH_C32(0xa0195b9f), SPH_C32(0xb06135f9), - SPH_C32(0xe1953bae), SPH_C32(0xc994eb41), SPH_C32(0x9b67017d), - SPH_C32(0x9af24000), SPH_C32(0x49590000), SPH_C32(0x837f0000), - SPH_C32(0x17ef66f2), SPH_C32(0x790f2ec8), SPH_C32(0x4de11ec4), - SPH_C32(0x73c39e32) }, - { SPH_C32(0xd8250114), SPH_C32(0x59828000), SPH_C32(0xdc4d0000), - SPH_C32(0xdb430000), SPH_C32(0x812e6064), SPH_C32(0xbad9e057), - SPH_C32(0x2c50b0b7), SPH_C32(0x1e015170), SPH_C32(0x3d18017c), - SPH_C32(0xebc5c000), SPH_C32(0x50a50000), SPH_C32(0x15a40000), - SPH_C32(0x2d640b0f), SPH_C32(0x92c5803b), SPH_C32(0x618c594b), - SPH_C32(0xdf4df2ba) }, - { SPH_C32(0x7faf0119), SPH_C32(0xd3ca0000), SPH_C32(0x22600000), - SPH_C32(0xc6370000), SPH_C32(0x98072fcb), SPH_C32(0xa343adb0), - SPH_C32(0xb77f8d6f), SPH_C32(0xfb0c1fd3), SPH_C32(0x1ff20179), - SPH_C32(0x524ec000), SPH_C32(0xd10d0000), SPH_C32(0xd0b00000), - SPH_C32(0xf01d728e), SPH_C32(0x51c9d3f9), SPH_C32(0x347f4456), - SPH_C32(0xff9e8bab) }, - { SPH_C32(0x892f011c), SPH_C32(0xe789c000), SPH_C32(0x06670000), - SPH_C32(0x490a0000), SPH_C32(0xb9301430), SPH_C32(0xa9fb781e), - SPH_C32(0x7aba0676), SPH_C32(0x2c99a5e2), SPH_C32(0xb98d0178), - SPH_C32(0x23794000), SPH_C32(0xc8f10000), SPH_C32(0x466b0000), - SPH_C32(0xca961f73), SPH_C32(0xba037d0a), SPH_C32(0x181203d9), - SPH_C32(0x5310e723) }, - { SPH_C32(0xd9d00118), SPH_C32(0xa2fd8000), SPH_C32(0x3b9c0000), - SPH_C32(0x50ec0000), SPH_C32(0xa28c4236), SPH_C32(0x48890343), - SPH_C32(0x9b12cae0), SPH_C32(0x5782735b), SPH_C32(0x4f0d017d), - SPH_C32(0x173a8000), SPH_C32(0xecf60000), SPH_C32(0xc9560000), - SPH_C32(0xeba12488), SPH_C32(0xb0bba8a4), SPH_C32(0xd5d788c0), - SPH_C32(0x84855d12) }, - { SPH_C32(0x2f50011d), SPH_C32(0x96be4000), SPH_C32(0x1f9b0000), - SPH_C32(0xdfd10000), SPH_C32(0x83bb79cd), SPH_C32(0x4231d6ed), - SPH_C32(0x56d741f9), SPH_C32(0x8017c96a), SPH_C32(0xe972017c), - SPH_C32(0x660d0000), SPH_C32(0xf50a0000), SPH_C32(0x5f8d0000), - SPH_C32(0xd12a4975), SPH_C32(0x5b710657), SPH_C32(0xf9bacf4f), - SPH_C32(0x280b319a) }, - { SPH_C32(0x2bf401e0), SPH_C32(0x60640000), SPH_C32(0xb1ab0000), - SPH_C32(0xbc980000), SPH_C32(0xefeb0a94), SPH_C32(0xc894f143), - SPH_C32(0x5e0d273b), SPH_C32(0x5d6b3122), SPH_C32(0x1ceb0120), - SPH_C32(0x0b6a0000), SPH_C32(0x067e0000), SPH_C32(0xd73d0000), - SPH_C32(0xb01c159f), SPH_C32(0xcf9e9b5a), SPH_C32(0xd25cc5ca), - SPH_C32(0xebbc06c5) }, - { SPH_C32(0xdd7401e5), SPH_C32(0x5427c000), SPH_C32(0x95ac0000), - SPH_C32(0x33a50000), SPH_C32(0xcedc316f), SPH_C32(0xc22c24ed), - SPH_C32(0x93c8ac22), SPH_C32(0x8afe8b13), SPH_C32(0xba940121), - SPH_C32(0x7a5d8000), SPH_C32(0x1f820000), SPH_C32(0x41e60000), - SPH_C32(0x8a977862), SPH_C32(0x245435a9), SPH_C32(0xfe318245), - SPH_C32(0x47326a4d) }, - { SPH_C32(0x8d8b01e1), SPH_C32(0x11538000), SPH_C32(0xa8570000), - SPH_C32(0x2a430000), SPH_C32(0xd5606769), SPH_C32(0x235e5fb0), - SPH_C32(0x726060b4), SPH_C32(0xf1e55daa), SPH_C32(0x4c140124), - SPH_C32(0x4e1e4000), SPH_C32(0x3b850000), SPH_C32(0xcedb0000), - SPH_C32(0xaba04399), SPH_C32(0x2eece007), SPH_C32(0x33f4095c), - SPH_C32(0x90a7d07c) }, - { SPH_C32(0x7b0b01e4), SPH_C32(0x25104000), SPH_C32(0x8c500000), - SPH_C32(0xa57e0000), SPH_C32(0xf4575c92), SPH_C32(0x29e68a1e), - SPH_C32(0xbfa5ebad), SPH_C32(0x2670e79b), SPH_C32(0xea6b0125), - SPH_C32(0x3f29c000), SPH_C32(0x22790000), SPH_C32(0x58000000), - SPH_C32(0x912b2e64), SPH_C32(0xc5264ef4), SPH_C32(0x1f994ed3), - SPH_C32(0x3c29bcf4) }, - { SPH_C32(0xdc8101e9), SPH_C32(0xaf58c000), SPH_C32(0x727d0000), - SPH_C32(0xb80a0000), SPH_C32(0xed7e133d), SPH_C32(0x307cc7f9), - SPH_C32(0x248ad675), SPH_C32(0xc37da938), SPH_C32(0xc8810120), - SPH_C32(0x86a2c000), SPH_C32(0xa3d10000), SPH_C32(0x9d140000), - SPH_C32(0x4c5257e5), SPH_C32(0x062a1d36), SPH_C32(0x4a6a53ce), - SPH_C32(0x1cfac5e5) }, - { SPH_C32(0x2a0101ec), SPH_C32(0x9b1b0000), SPH_C32(0x567a0000), - SPH_C32(0x37370000), SPH_C32(0xcc4928c6), SPH_C32(0x3ac41257), - SPH_C32(0xe94f5d6c), SPH_C32(0x14e81309), SPH_C32(0x6efe0121), - SPH_C32(0xf7954000), SPH_C32(0xba2d0000), SPH_C32(0x0bcf0000), - SPH_C32(0x76d93a18), SPH_C32(0xede0b3c5), SPH_C32(0x66071441), - SPH_C32(0xb074a96d) }, - { SPH_C32(0x7afe01e8), SPH_C32(0xde6f4000), SPH_C32(0x6b810000), - SPH_C32(0x2ed10000), SPH_C32(0xd7f57ec0), SPH_C32(0xdbb6690a), - SPH_C32(0x08e791fa), SPH_C32(0x6ff3c5b0), SPH_C32(0x987e0124), - SPH_C32(0xc3d68000), SPH_C32(0x9e2a0000), SPH_C32(0x84f20000), - SPH_C32(0x57ee01e3), SPH_C32(0xe758666b), SPH_C32(0xabc29f58), - SPH_C32(0x67e1135c) }, - { SPH_C32(0x8c7e01ed), SPH_C32(0xea2c8000), SPH_C32(0x4f860000), - SPH_C32(0xa1ec0000), SPH_C32(0xf6c2453b), SPH_C32(0xd10ebca4), - SPH_C32(0xc5221ae3), SPH_C32(0xb8667f81), SPH_C32(0x3e010125), - SPH_C32(0xb2e10000), SPH_C32(0x87d60000), SPH_C32(0x12290000), - SPH_C32(0x6d656c1e), SPH_C32(0x0c92c898), SPH_C32(0x87afd8d7), - SPH_C32(0xcb6f7fd4) }, - { SPH_C32(0xff9e01e0), SPH_C32(0xedacc000), SPH_C32(0x14040000), - SPH_C32(0xf6b10000), SPH_C32(0x13a548ee), SPH_C32(0x0120772f), - SPH_C32(0xc63bb13f), SPH_C32(0xaa2df202), SPH_C32(0x3ff40129), - SPH_C32(0x499e0000), SPH_C32(0x60070000), SPH_C32(0x99860000), - SPH_C32(0x4ec74e4c), SPH_C32(0xfec22b8c), SPH_C32(0x30eda280), - SPH_C32(0x82ec5dff) }, - { SPH_C32(0x091e01e5), SPH_C32(0xd9ef0000), SPH_C32(0x30030000), - SPH_C32(0x798c0000), SPH_C32(0x32927315), SPH_C32(0x0b98a281), - SPH_C32(0x0bfe3a26), SPH_C32(0x7db84833), SPH_C32(0x998b0128), - SPH_C32(0x38a98000), SPH_C32(0x79fb0000), SPH_C32(0x0f5d0000), - SPH_C32(0x744c23b1), SPH_C32(0x1508857f), SPH_C32(0x1c80e50f), - SPH_C32(0x2e623177) }, - { SPH_C32(0x59e101e1), SPH_C32(0x9c9b4000), SPH_C32(0x0df80000), - SPH_C32(0x606a0000), SPH_C32(0x292e2513), SPH_C32(0xeaead9dc), - SPH_C32(0xea56f6b0), SPH_C32(0x06a39e8a), SPH_C32(0x6f0b012d), - SPH_C32(0x0cea4000), SPH_C32(0x5dfc0000), SPH_C32(0x80600000), - SPH_C32(0x557b184a), SPH_C32(0x1fb050d1), SPH_C32(0xd1456e16), - SPH_C32(0xf9f78b46) }, - { SPH_C32(0xaf6101e4), SPH_C32(0xa8d88000), SPH_C32(0x29ff0000), - SPH_C32(0xef570000), SPH_C32(0x08191ee8), SPH_C32(0xe0520c72), - SPH_C32(0x27937da9), SPH_C32(0xd13624bb), SPH_C32(0xc974012c), - SPH_C32(0x7dddc000), SPH_C32(0x44000000), SPH_C32(0x16bb0000), - SPH_C32(0x6ff075b7), SPH_C32(0xf47afe22), SPH_C32(0xfd282999), - SPH_C32(0x5579e7ce) }, - { SPH_C32(0x08eb01e9), SPH_C32(0x22900000), SPH_C32(0xd7d20000), - SPH_C32(0xf2230000), SPH_C32(0x11305147), SPH_C32(0xf9c84195), - SPH_C32(0xbcbc4071), SPH_C32(0x343b6a18), SPH_C32(0xeb9e0129), - SPH_C32(0xc456c000), SPH_C32(0xc5a80000), SPH_C32(0xd3af0000), - SPH_C32(0xb2890c36), SPH_C32(0x3776ade0), SPH_C32(0xa8db3484), - SPH_C32(0x75aa9edf) }, - { SPH_C32(0xfe6b01ec), SPH_C32(0x16d3c000), SPH_C32(0xf3d50000), - SPH_C32(0x7d1e0000), SPH_C32(0x30076abc), SPH_C32(0xf370943b), - SPH_C32(0x7179cb68), SPH_C32(0xe3aed029), SPH_C32(0x4de10128), - SPH_C32(0xb5614000), SPH_C32(0xdc540000), SPH_C32(0x45740000), - SPH_C32(0x880261cb), SPH_C32(0xdcbc0313), SPH_C32(0x84b6730b), - SPH_C32(0xd924f257) }, - { SPH_C32(0xae9401e8), SPH_C32(0x53a78000), SPH_C32(0xce2e0000), - SPH_C32(0x64f80000), SPH_C32(0x2bbb3cba), SPH_C32(0x1202ef66), - SPH_C32(0x90d107fe), SPH_C32(0x98b50690), SPH_C32(0xbb61012d), - SPH_C32(0x81228000), SPH_C32(0xf8530000), SPH_C32(0xca490000), - SPH_C32(0xa9355a30), SPH_C32(0xd604d6bd), SPH_C32(0x4973f812), - SPH_C32(0x0eb14866) }, - { SPH_C32(0x581401ed), SPH_C32(0x67e44000), SPH_C32(0xea290000), - SPH_C32(0xebc50000), SPH_C32(0x0a8c0741), SPH_C32(0x18ba3ac8), - SPH_C32(0x5d148ce7), SPH_C32(0x4f20bca1), SPH_C32(0x1d1e012c), - SPH_C32(0xf0150000), SPH_C32(0xe1af0000), SPH_C32(0x5c920000), - SPH_C32(0x93be37cd), SPH_C32(0x3dce784e), SPH_C32(0x651ebf9d), - SPH_C32(0xa23f24ee) }, - { SPH_C32(0xa8dc0140), SPH_C32(0x07260000), SPH_C32(0x50bc0000), - SPH_C32(0x8b930000), SPH_C32(0x24480aa0), SPH_C32(0xf4a0637f), - SPH_C32(0xc96a9af7), SPH_C32(0x1868519d), SPH_C32(0x6baf01d0), - SPH_C32(0xfa300000), SPH_C32(0xf3cc0000), SPH_C32(0xe3290000), - SPH_C32(0x392b6b13), SPH_C32(0x9515777f), SPH_C32(0xd99f08d4), - SPH_C32(0x248b730e) }, - { SPH_C32(0x5e5c0145), SPH_C32(0x3365c000), SPH_C32(0x74bb0000), - SPH_C32(0x04ae0000), SPH_C32(0x057f315b), SPH_C32(0xfe18b6d1), - SPH_C32(0x04af11ee), SPH_C32(0xcffdebac), SPH_C32(0xcdd001d1), - SPH_C32(0x8b078000), SPH_C32(0xea300000), SPH_C32(0x75f20000), - SPH_C32(0x03a006ee), SPH_C32(0x7edfd98c), SPH_C32(0xf5f24f5b), - SPH_C32(0x88051f86) }, - { SPH_C32(0x0ea30141), SPH_C32(0x76118000), SPH_C32(0x49400000), - SPH_C32(0x1d480000), SPH_C32(0x1ec3675d), SPH_C32(0x1f6acd8c), - SPH_C32(0xe507dd78), SPH_C32(0xb4e63d15), SPH_C32(0x3b5001d4), - SPH_C32(0xbf444000), SPH_C32(0xce370000), SPH_C32(0xfacf0000), - SPH_C32(0x22973d15), SPH_C32(0x74670c22), SPH_C32(0x3837c442), - SPH_C32(0x5f90a5b7) }, - { SPH_C32(0xf8230144), SPH_C32(0x42524000), SPH_C32(0x6d470000), - SPH_C32(0x92750000), SPH_C32(0x3ff45ca6), SPH_C32(0x15d21822), - SPH_C32(0x28c25661), SPH_C32(0x63738724), SPH_C32(0x9d2f01d5), - SPH_C32(0xce73c000), SPH_C32(0xd7cb0000), SPH_C32(0x6c140000), - SPH_C32(0x181c50e8), SPH_C32(0x9fada2d1), SPH_C32(0x145a83cd), - SPH_C32(0xf31ec93f) }, - { SPH_C32(0x5fa90149), SPH_C32(0xc81ac000), SPH_C32(0x936a0000), - SPH_C32(0x8f010000), SPH_C32(0x26dd1309), SPH_C32(0x0c4855c5), - SPH_C32(0xb3ed6bb9), SPH_C32(0x867ec987), SPH_C32(0xbfc501d0), - SPH_C32(0x77f8c000), SPH_C32(0x56630000), SPH_C32(0xa9000000), - SPH_C32(0xc5652969), SPH_C32(0x5ca1f113), SPH_C32(0x41a99ed0), - SPH_C32(0xd3cdb02e) }, - { SPH_C32(0xa929014c), SPH_C32(0xfc590000), SPH_C32(0xb76d0000), - SPH_C32(0x003c0000), SPH_C32(0x07ea28f2), SPH_C32(0x06f0806b), - SPH_C32(0x7e28e0a0), SPH_C32(0x51eb73b6), SPH_C32(0x19ba01d1), - SPH_C32(0x06cf4000), SPH_C32(0x4f9f0000), SPH_C32(0x3fdb0000), - SPH_C32(0xffee4494), SPH_C32(0xb76b5fe0), SPH_C32(0x6dc4d95f), - SPH_C32(0x7f43dca6) }, - { SPH_C32(0xf9d60148), SPH_C32(0xb92d4000), SPH_C32(0x8a960000), - SPH_C32(0x19da0000), SPH_C32(0x1c567ef4), SPH_C32(0xe782fb36), - SPH_C32(0x9f802c36), SPH_C32(0x2af0a50f), SPH_C32(0xef3a01d4), - SPH_C32(0x328c8000), SPH_C32(0x6b980000), SPH_C32(0xb0e60000), - SPH_C32(0xded97f6f), SPH_C32(0xbdd38a4e), SPH_C32(0xa0015246), - SPH_C32(0xa8d66697) }, - { SPH_C32(0x0f56014d), SPH_C32(0x8d6e8000), SPH_C32(0xae910000), - SPH_C32(0x96e70000), SPH_C32(0x3d61450f), SPH_C32(0xed3a2e98), - SPH_C32(0x5245a72f), SPH_C32(0xfd651f3e), SPH_C32(0x494501d5), - SPH_C32(0x43bb0000), SPH_C32(0x72640000), SPH_C32(0x263d0000), - SPH_C32(0xe4521292), SPH_C32(0x561924bd), SPH_C32(0x8c6c15c9), - SPH_C32(0x04580a1f) }, - { SPH_C32(0x7cb60140), SPH_C32(0x8aeec000), SPH_C32(0xf5130000), - SPH_C32(0xc1ba0000), SPH_C32(0xd80648da), SPH_C32(0x3d14e513), - SPH_C32(0x515c0cf3), SPH_C32(0xef2e92bd), SPH_C32(0x48b001d9), - SPH_C32(0xb8c40000), SPH_C32(0x95b50000), SPH_C32(0xad920000), - SPH_C32(0xc7f030c0), SPH_C32(0xa449c7a9), SPH_C32(0x3b2e6f9e), - SPH_C32(0x4ddb2834) }, - { SPH_C32(0x8a360145), SPH_C32(0xbead0000), SPH_C32(0xd1140000), - SPH_C32(0x4e870000), SPH_C32(0xf9317321), SPH_C32(0x37ac30bd), - SPH_C32(0x9c9987ea), SPH_C32(0x38bb288c), SPH_C32(0xeecf01d8), - SPH_C32(0xc9f38000), SPH_C32(0x8c490000), SPH_C32(0x3b490000), - SPH_C32(0xfd7b5d3d), SPH_C32(0x4f83695a), SPH_C32(0x17432811), - SPH_C32(0xe15544bc) }, - { SPH_C32(0xdac90141), SPH_C32(0xfbd94000), SPH_C32(0xecef0000), - SPH_C32(0x57610000), SPH_C32(0xe28d2527), SPH_C32(0xd6de4be0), - SPH_C32(0x7d314b7c), SPH_C32(0x43a0fe35), SPH_C32(0x184f01dd), - SPH_C32(0xfdb04000), SPH_C32(0xa84e0000), SPH_C32(0xb4740000), - SPH_C32(0xdc4c66c6), SPH_C32(0x453bbcf4), SPH_C32(0xda86a308), - SPH_C32(0x36c0fe8d) }, - { SPH_C32(0x2c490144), SPH_C32(0xcf9a8000), SPH_C32(0xc8e80000), - SPH_C32(0xd85c0000), SPH_C32(0xc3ba1edc), SPH_C32(0xdc669e4e), - SPH_C32(0xb0f4c065), SPH_C32(0x94354404), SPH_C32(0xbe3001dc), - SPH_C32(0x8c87c000), SPH_C32(0xb1b20000), SPH_C32(0x22af0000), - SPH_C32(0xe6c70b3b), SPH_C32(0xaef11207), SPH_C32(0xf6ebe487), - SPH_C32(0x9a4e9205) }, - { SPH_C32(0x8bc30149), SPH_C32(0x45d20000), SPH_C32(0x36c50000), - SPH_C32(0xc5280000), SPH_C32(0xda935173), SPH_C32(0xc5fcd3a9), - SPH_C32(0x2bdbfdbd), SPH_C32(0x71380aa7), SPH_C32(0x9cda01d9), - SPH_C32(0x350cc000), SPH_C32(0x301a0000), SPH_C32(0xe7bb0000), - SPH_C32(0x3bbe72ba), SPH_C32(0x6dfd41c5), SPH_C32(0xa318f99a), - SPH_C32(0xba9deb14) }, - { SPH_C32(0x7d43014c), SPH_C32(0x7191c000), SPH_C32(0x12c20000), - SPH_C32(0x4a150000), SPH_C32(0xfba46a88), SPH_C32(0xcf440607), - SPH_C32(0xe61e76a4), SPH_C32(0xa6adb096), SPH_C32(0x3aa501d8), - SPH_C32(0x443b4000), SPH_C32(0x29e60000), SPH_C32(0x71600000), - SPH_C32(0x01351f47), SPH_C32(0x8637ef36), SPH_C32(0x8f75be15), - SPH_C32(0x1613879c) }, - { SPH_C32(0x2dbc0148), SPH_C32(0x34e58000), SPH_C32(0x2f390000), - SPH_C32(0x53f30000), SPH_C32(0xe0183c8e), SPH_C32(0x2e367d5a), - SPH_C32(0x07b6ba32), SPH_C32(0xddb6662f), SPH_C32(0xcc2501dd), - SPH_C32(0x70788000), SPH_C32(0x0de10000), SPH_C32(0xfe5d0000), - SPH_C32(0x200224bc), SPH_C32(0x8c8f3a98), SPH_C32(0x42b0350c), - SPH_C32(0xc1863dad) }, - { SPH_C32(0xdb3c014d), SPH_C32(0x00a64000), SPH_C32(0x0b3e0000), - SPH_C32(0xdcce0000), SPH_C32(0xc12f0775), SPH_C32(0x248ea8f4), - SPH_C32(0xca73312b), SPH_C32(0x0a23dc1e), SPH_C32(0x6a5a01dc), - SPH_C32(0x014f0000), SPH_C32(0x141d0000), SPH_C32(0x68860000), - SPH_C32(0x1a894941), SPH_C32(0x6745946b), SPH_C32(0x6edd7283), - SPH_C32(0x6d085125) }, - { SPH_C32(0xdf9801b0), SPH_C32(0xf67c0000), SPH_C32(0xa50e0000), - SPH_C32(0xbf870000), SPH_C32(0xad7f742c), SPH_C32(0xae2b8f5a), - SPH_C32(0xc2a957e9), SPH_C32(0xd75f2456), SPH_C32(0x9fc30180), - SPH_C32(0x6c280000), SPH_C32(0xe7690000), SPH_C32(0xe0360000), - SPH_C32(0x7bbf15ab), SPH_C32(0xf3aa0966), SPH_C32(0x453b7806), - SPH_C32(0xaebf667a) }, - { SPH_C32(0x291801b5), SPH_C32(0xc23fc000), SPH_C32(0x81090000), - SPH_C32(0x30ba0000), SPH_C32(0x8c484fd7), SPH_C32(0xa4935af4), - SPH_C32(0x0f6cdcf0), SPH_C32(0x00ca9e67), SPH_C32(0x39bc0181), - SPH_C32(0x1d1f8000), SPH_C32(0xfe950000), SPH_C32(0x76ed0000), - SPH_C32(0x41347856), SPH_C32(0x1860a795), SPH_C32(0x69563f89), - SPH_C32(0x02310af2) }, - { SPH_C32(0x79e701b1), SPH_C32(0x874b8000), SPH_C32(0xbcf20000), - SPH_C32(0x295c0000), SPH_C32(0x97f419d1), SPH_C32(0x45e121a9), - SPH_C32(0xeec41066), SPH_C32(0x7bd148de), SPH_C32(0xcf3c0184), - SPH_C32(0x295c4000), SPH_C32(0xda920000), SPH_C32(0xf9d00000), - SPH_C32(0x600343ad), SPH_C32(0x12d8723b), SPH_C32(0xa493b490), - SPH_C32(0xd5a4b0c3) }, - { SPH_C32(0x8f6701b4), SPH_C32(0xb3084000), SPH_C32(0x98f50000), - SPH_C32(0xa6610000), SPH_C32(0xb6c3222a), SPH_C32(0x4f59f407), - SPH_C32(0x23019b7f), SPH_C32(0xac44f2ef), SPH_C32(0x69430185), - SPH_C32(0x586bc000), SPH_C32(0xc36e0000), SPH_C32(0x6f0b0000), - SPH_C32(0x5a882e50), SPH_C32(0xf912dcc8), SPH_C32(0x88fef31f), - SPH_C32(0x792adc4b) }, - { SPH_C32(0x28ed01b9), SPH_C32(0x3940c000), SPH_C32(0x66d80000), - SPH_C32(0xbb150000), SPH_C32(0xafea6d85), SPH_C32(0x56c3b9e0), - SPH_C32(0xb82ea6a7), SPH_C32(0x4949bc4c), SPH_C32(0x4ba90180), - SPH_C32(0xe1e0c000), SPH_C32(0x42c60000), SPH_C32(0xaa1f0000), - SPH_C32(0x87f157d1), SPH_C32(0x3a1e8f0a), SPH_C32(0xdd0dee02), - SPH_C32(0x59f9a55a) }, - { SPH_C32(0xde6d01bc), SPH_C32(0x0d030000), SPH_C32(0x42df0000), - SPH_C32(0x34280000), SPH_C32(0x8edd567e), SPH_C32(0x5c7b6c4e), - SPH_C32(0x75eb2dbe), SPH_C32(0x9edc067d), SPH_C32(0xedd60181), - SPH_C32(0x90d74000), SPH_C32(0x5b3a0000), SPH_C32(0x3cc40000), - SPH_C32(0xbd7a3a2c), SPH_C32(0xd1d421f9), SPH_C32(0xf160a98d), - SPH_C32(0xf577c9d2) }, - { SPH_C32(0x8e9201b8), SPH_C32(0x48774000), SPH_C32(0x7f240000), - SPH_C32(0x2dce0000), SPH_C32(0x95610078), SPH_C32(0xbd091713), - SPH_C32(0x9443e128), SPH_C32(0xe5c7d0c4), SPH_C32(0x1b560184), - SPH_C32(0xa4948000), SPH_C32(0x7f3d0000), SPH_C32(0xb3f90000), - SPH_C32(0x9c4d01d7), SPH_C32(0xdb6cf457), SPH_C32(0x3ca52294), - SPH_C32(0x22e273e3) }, - { SPH_C32(0x781201bd), SPH_C32(0x7c348000), SPH_C32(0x5b230000), - SPH_C32(0xa2f30000), SPH_C32(0xb4563b83), SPH_C32(0xb7b1c2bd), - SPH_C32(0x59866a31), SPH_C32(0x32526af5), SPH_C32(0xbd290185), - SPH_C32(0xd5a30000), SPH_C32(0x66c10000), SPH_C32(0x25220000), - SPH_C32(0xa6c66c2a), SPH_C32(0x30a65aa4), SPH_C32(0x10c8651b), - SPH_C32(0x8e6c1f6b) }, - { SPH_C32(0x0bf201b0), SPH_C32(0x7bb4c000), SPH_C32(0x00a10000), - SPH_C32(0xf5ae0000), SPH_C32(0x51313656), SPH_C32(0x679f0936), - SPH_C32(0x5a9fc1ed), SPH_C32(0x2019e776), SPH_C32(0xbcdc0189), - SPH_C32(0x2edc0000), SPH_C32(0x81100000), SPH_C32(0xae8d0000), - SPH_C32(0x85644e78), SPH_C32(0xc2f6b9b0), SPH_C32(0xa78a1f4c), - SPH_C32(0xc7ef3d40) }, - { SPH_C32(0xfd7201b5), SPH_C32(0x4ff70000), SPH_C32(0x24a60000), - SPH_C32(0x7a930000), SPH_C32(0x70060dad), SPH_C32(0x6d27dc98), - SPH_C32(0x975a4af4), SPH_C32(0xf78c5d47), SPH_C32(0x1aa30188), - SPH_C32(0x5feb8000), SPH_C32(0x98ec0000), SPH_C32(0x38560000), - SPH_C32(0xbfef2385), SPH_C32(0x293c1743), SPH_C32(0x8be758c3), - SPH_C32(0x6b6151c8) }, - { SPH_C32(0xad8d01b1), SPH_C32(0x0a834000), SPH_C32(0x195d0000), - SPH_C32(0x63750000), SPH_C32(0x6bba5bab), SPH_C32(0x8c55a7c5), - SPH_C32(0x76f28662), SPH_C32(0x8c978bfe), SPH_C32(0xec23018d), - SPH_C32(0x6ba84000), SPH_C32(0xbceb0000), SPH_C32(0xb76b0000), - SPH_C32(0x9ed8187e), SPH_C32(0x2384c2ed), SPH_C32(0x4622d3da), - SPH_C32(0xbcf4ebf9) }, - { SPH_C32(0x5b0d01b4), SPH_C32(0x3ec08000), SPH_C32(0x3d5a0000), - SPH_C32(0xec480000), SPH_C32(0x4a8d6050), SPH_C32(0x86ed726b), - SPH_C32(0xbb370d7b), SPH_C32(0x5b0231cf), SPH_C32(0x4a5c018c), - SPH_C32(0x1a9fc000), SPH_C32(0xa5170000), SPH_C32(0x21b00000), - SPH_C32(0xa4537583), SPH_C32(0xc84e6c1e), SPH_C32(0x6a4f9455), - SPH_C32(0x107a8771) }, - { SPH_C32(0xfc8701b9), SPH_C32(0xb4880000), SPH_C32(0xc3770000), - SPH_C32(0xf13c0000), SPH_C32(0x53a42fff), SPH_C32(0x9f773f8c), - SPH_C32(0x201830a3), SPH_C32(0xbe0f7f6c), SPH_C32(0x68b60189), - SPH_C32(0xa314c000), SPH_C32(0x24bf0000), SPH_C32(0xe4a40000), - SPH_C32(0x792a0c02), SPH_C32(0x0b423fdc), SPH_C32(0x3fbc8948), - SPH_C32(0x30a9fe60) }, - { SPH_C32(0x0a0701bc), SPH_C32(0x80cbc000), SPH_C32(0xe7700000), - SPH_C32(0x7e010000), SPH_C32(0x72931404), SPH_C32(0x95cfea22), - SPH_C32(0xedddbbba), SPH_C32(0x699ac55d), SPH_C32(0xcec90188), - SPH_C32(0xd2234000), SPH_C32(0x3d430000), SPH_C32(0x727f0000), - SPH_C32(0x43a161ff), SPH_C32(0xe088912f), SPH_C32(0x13d1cec7), - SPH_C32(0x9c2792e8) }, - { SPH_C32(0x5af801b8), SPH_C32(0xc5bf8000), SPH_C32(0xda8b0000), - SPH_C32(0x67e70000), SPH_C32(0x692f4202), SPH_C32(0x74bd917f), - SPH_C32(0x0c75772c), SPH_C32(0x128113e4), SPH_C32(0x3849018d), - SPH_C32(0xe6608000), SPH_C32(0x19440000), SPH_C32(0xfd420000), - SPH_C32(0x62965a04), SPH_C32(0xea304481), SPH_C32(0xde1445de), - SPH_C32(0x4bb228d9) }, - { SPH_C32(0xac7801bd), SPH_C32(0xf1fc4000), SPH_C32(0xfe8c0000), - SPH_C32(0xe8da0000), SPH_C32(0x481879f9), SPH_C32(0x7e0544d1), - SPH_C32(0xc1b0fc35), SPH_C32(0xc514a9d5), SPH_C32(0x9e36018c), - SPH_C32(0x97570000), SPH_C32(0x00b80000), SPH_C32(0x6b990000), - SPH_C32(0x581d37f9), SPH_C32(0x01faea72), SPH_C32(0xf2790251), - SPH_C32(0xe73c4451) } -}; - -static const sph_u32 T512_16[256][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x0c720000), SPH_C32(0x49e50f00), SPH_C32(0x42790000), - SPH_C32(0x5cea0000), SPH_C32(0x33aa301a), SPH_C32(0x15822514), - SPH_C32(0x95a34b7b), SPH_C32(0xb44b0090), SPH_C32(0xfe220000), - SPH_C32(0xa7580500), SPH_C32(0x25d10000), SPH_C32(0xf7600000), - SPH_C32(0x893178da), SPH_C32(0x1fd4f860), SPH_C32(0x4ed0a315), - SPH_C32(0xa123ff9f) }, - { SPH_C32(0xfe220000), SPH_C32(0xa7580500), SPH_C32(0x25d10000), - SPH_C32(0xf7600000), SPH_C32(0x893178da), SPH_C32(0x1fd4f860), - SPH_C32(0x4ed0a315), SPH_C32(0xa123ff9f), SPH_C32(0xf2500000), - SPH_C32(0xeebd0a00), SPH_C32(0x67a80000), SPH_C32(0xab8a0000), - SPH_C32(0xba9b48c0), SPH_C32(0x0a56dd74), SPH_C32(0xdb73e86e), - SPH_C32(0x1568ff0f) }, - { SPH_C32(0xf2500000), SPH_C32(0xeebd0a00), SPH_C32(0x67a80000), - SPH_C32(0xab8a0000), SPH_C32(0xba9b48c0), SPH_C32(0x0a56dd74), - SPH_C32(0xdb73e86e), SPH_C32(0x1568ff0f), SPH_C32(0x0c720000), - SPH_C32(0x49e50f00), SPH_C32(0x42790000), SPH_C32(0x5cea0000), - SPH_C32(0x33aa301a), SPH_C32(0x15822514), SPH_C32(0x95a34b7b), - SPH_C32(0xb44b0090) }, - { SPH_C32(0x45180000), SPH_C32(0xa5b51700), SPH_C32(0xf96a0000), - SPH_C32(0x3b480000), SPH_C32(0x1ecc142c), SPH_C32(0x231395d6), - SPH_C32(0x16bca6b0), SPH_C32(0xdf33f4df), SPH_C32(0xb83d0000), - SPH_C32(0x16710600), SPH_C32(0x379a0000), SPH_C32(0xf5b10000), - SPH_C32(0x228161ac), SPH_C32(0xae48f145), SPH_C32(0x66241616), - SPH_C32(0xc5c1eb3e) }, - { SPH_C32(0x496a0000), SPH_C32(0xec501800), SPH_C32(0xbb130000), - SPH_C32(0x67a20000), SPH_C32(0x2d662436), SPH_C32(0x3691b0c2), - SPH_C32(0x831fedcb), SPH_C32(0x6b78f44f), SPH_C32(0x461f0000), - SPH_C32(0xb1290300), SPH_C32(0x124b0000), SPH_C32(0x02d10000), - SPH_C32(0xabb01976), SPH_C32(0xb19c0925), SPH_C32(0x28f4b503), - SPH_C32(0x64e214a1) }, - { SPH_C32(0xbb3a0000), SPH_C32(0x02ed1200), SPH_C32(0xdcbb0000), - SPH_C32(0xcc280000), SPH_C32(0x97fd6cf6), SPH_C32(0x3cc76db6), - SPH_C32(0x586c05a5), SPH_C32(0x7e100b40), SPH_C32(0x4a6d0000), - SPH_C32(0xf8cc0c00), SPH_C32(0x50320000), SPH_C32(0x5e3b0000), - SPH_C32(0x981a296c), SPH_C32(0xa41e2c31), SPH_C32(0xbd57fe78), - SPH_C32(0xd0a91431) }, - { SPH_C32(0xb7480000), SPH_C32(0x4b081d00), SPH_C32(0x9ec20000), - SPH_C32(0x90c20000), SPH_C32(0xa4575cec), SPH_C32(0x294548a2), - SPH_C32(0xcdcf4ede), SPH_C32(0xca5b0bd0), SPH_C32(0xb44f0000), - SPH_C32(0x5f940900), SPH_C32(0x75e30000), SPH_C32(0xa95b0000), - SPH_C32(0x112b51b6), SPH_C32(0xbbcad451), SPH_C32(0xf3875d6d), - SPH_C32(0x718aebae) }, - { SPH_C32(0xb83d0000), SPH_C32(0x16710600), SPH_C32(0x379a0000), - SPH_C32(0xf5b10000), SPH_C32(0x228161ac), SPH_C32(0xae48f145), - SPH_C32(0x66241616), SPH_C32(0xc5c1eb3e), SPH_C32(0xfd250000), - SPH_C32(0xb3c41100), SPH_C32(0xcef00000), SPH_C32(0xcef90000), - SPH_C32(0x3c4d7580), SPH_C32(0x8d5b6493), SPH_C32(0x7098b0a6), - SPH_C32(0x1af21fe1) }, - { SPH_C32(0xb44f0000), SPH_C32(0x5f940900), SPH_C32(0x75e30000), - SPH_C32(0xa95b0000), SPH_C32(0x112b51b6), SPH_C32(0xbbcad451), - SPH_C32(0xf3875d6d), SPH_C32(0x718aebae), SPH_C32(0x03070000), - SPH_C32(0x149c1400), SPH_C32(0xeb210000), SPH_C32(0x39990000), - SPH_C32(0xb57c0d5a), SPH_C32(0x928f9cf3), SPH_C32(0x3e4813b3), - SPH_C32(0xbbd1e07e) }, - { SPH_C32(0x461f0000), SPH_C32(0xb1290300), SPH_C32(0x124b0000), - SPH_C32(0x02d10000), SPH_C32(0xabb01976), SPH_C32(0xb19c0925), - SPH_C32(0x28f4b503), SPH_C32(0x64e214a1), SPH_C32(0x0f750000), - SPH_C32(0x5d791b00), SPH_C32(0xa9580000), SPH_C32(0x65730000), - SPH_C32(0x86d63d40), SPH_C32(0x870db9e7), SPH_C32(0xabeb58c8), - SPH_C32(0x0f9ae0ee) }, - { SPH_C32(0x4a6d0000), SPH_C32(0xf8cc0c00), SPH_C32(0x50320000), - SPH_C32(0x5e3b0000), SPH_C32(0x981a296c), SPH_C32(0xa41e2c31), - SPH_C32(0xbd57fe78), SPH_C32(0xd0a91431), SPH_C32(0xf1570000), - SPH_C32(0xfa211e00), SPH_C32(0x8c890000), SPH_C32(0x92130000), - SPH_C32(0x0fe7459a), SPH_C32(0x98d94187), SPH_C32(0xe53bfbdd), - SPH_C32(0xaeb91f71) }, - { SPH_C32(0xfd250000), SPH_C32(0xb3c41100), SPH_C32(0xcef00000), - SPH_C32(0xcef90000), SPH_C32(0x3c4d7580), SPH_C32(0x8d5b6493), - SPH_C32(0x7098b0a6), SPH_C32(0x1af21fe1), SPH_C32(0x45180000), - SPH_C32(0xa5b51700), SPH_C32(0xf96a0000), SPH_C32(0x3b480000), - SPH_C32(0x1ecc142c), SPH_C32(0x231395d6), SPH_C32(0x16bca6b0), - SPH_C32(0xdf33f4df) }, - { SPH_C32(0xf1570000), SPH_C32(0xfa211e00), SPH_C32(0x8c890000), - SPH_C32(0x92130000), SPH_C32(0x0fe7459a), SPH_C32(0x98d94187), - SPH_C32(0xe53bfbdd), SPH_C32(0xaeb91f71), SPH_C32(0xbb3a0000), - SPH_C32(0x02ed1200), SPH_C32(0xdcbb0000), SPH_C32(0xcc280000), - SPH_C32(0x97fd6cf6), SPH_C32(0x3cc76db6), SPH_C32(0x586c05a5), - SPH_C32(0x7e100b40) }, - { SPH_C32(0x03070000), SPH_C32(0x149c1400), SPH_C32(0xeb210000), - SPH_C32(0x39990000), SPH_C32(0xb57c0d5a), SPH_C32(0x928f9cf3), - SPH_C32(0x3e4813b3), SPH_C32(0xbbd1e07e), SPH_C32(0xb7480000), - SPH_C32(0x4b081d00), SPH_C32(0x9ec20000), SPH_C32(0x90c20000), - SPH_C32(0xa4575cec), SPH_C32(0x294548a2), SPH_C32(0xcdcf4ede), - SPH_C32(0xca5b0bd0) }, - { SPH_C32(0x0f750000), SPH_C32(0x5d791b00), SPH_C32(0xa9580000), - SPH_C32(0x65730000), SPH_C32(0x86d63d40), SPH_C32(0x870db9e7), - SPH_C32(0xabeb58c8), SPH_C32(0x0f9ae0ee), SPH_C32(0x496a0000), - SPH_C32(0xec501800), SPH_C32(0xbb130000), SPH_C32(0x67a20000), - SPH_C32(0x2d662436), SPH_C32(0x3691b0c2), SPH_C32(0x831fedcb), - SPH_C32(0x6b78f44f) }, - { SPH_C32(0x75a40000), SPH_C32(0xc28b2700), SPH_C32(0x94a40000), - SPH_C32(0x90f50000), SPH_C32(0xfb7857e0), SPH_C32(0x49ce0bae), - SPH_C32(0x1767c483), SPH_C32(0xaedf667e), SPH_C32(0xd1660000), - SPH_C32(0x1bbc0300), SPH_C32(0x9eec0000), SPH_C32(0xf6940000), - SPH_C32(0x03024527), SPH_C32(0xcf70fcf2), SPH_C32(0xb4431b17), - SPH_C32(0x857f3c2b) }, - { SPH_C32(0x79d60000), SPH_C32(0x8b6e2800), SPH_C32(0xd6dd0000), - SPH_C32(0xcc1f0000), SPH_C32(0xc8d267fa), SPH_C32(0x5c4c2eba), - SPH_C32(0x82c48ff8), SPH_C32(0x1a9466ee), SPH_C32(0x2f440000), - SPH_C32(0xbce40600), SPH_C32(0xbb3d0000), SPH_C32(0x01f40000), - SPH_C32(0x8a333dfd), SPH_C32(0xd0a40492), SPH_C32(0xfa93b802), - SPH_C32(0x245cc3b4) }, - { SPH_C32(0x8b860000), SPH_C32(0x65d32200), SPH_C32(0xb1750000), - SPH_C32(0x67950000), SPH_C32(0x72492f3a), SPH_C32(0x561af3ce), - SPH_C32(0x59b76796), SPH_C32(0x0ffc99e1), SPH_C32(0x23360000), - SPH_C32(0xf5010900), SPH_C32(0xf9440000), SPH_C32(0x5d1e0000), - SPH_C32(0xb9990de7), SPH_C32(0xc5262186), SPH_C32(0x6f30f379), - SPH_C32(0x9017c324) }, - { SPH_C32(0x87f40000), SPH_C32(0x2c362d00), SPH_C32(0xf30c0000), - SPH_C32(0x3b7f0000), SPH_C32(0x41e31f20), SPH_C32(0x4398d6da), - SPH_C32(0xcc142ced), SPH_C32(0xbbb79971), SPH_C32(0xdd140000), - SPH_C32(0x52590c00), SPH_C32(0xdc950000), SPH_C32(0xaa7e0000), - SPH_C32(0x30a8753d), SPH_C32(0xdaf2d9e6), SPH_C32(0x21e0506c), - SPH_C32(0x31343cbb) }, - { SPH_C32(0x30bc0000), SPH_C32(0x673e3000), SPH_C32(0x6dce0000), - SPH_C32(0xabbd0000), SPH_C32(0xe5b443cc), SPH_C32(0x6add9e78), - SPH_C32(0x01db6233), SPH_C32(0x71ec92a1), SPH_C32(0x695b0000), - SPH_C32(0x0dcd0500), SPH_C32(0xa9760000), SPH_C32(0x03250000), - SPH_C32(0x2183248b), SPH_C32(0x61380db7), SPH_C32(0xd2670d01), - SPH_C32(0x40bed715) }, - { SPH_C32(0x3cce0000), SPH_C32(0x2edb3f00), SPH_C32(0x2fb70000), - SPH_C32(0xf7570000), SPH_C32(0xd61e73d6), SPH_C32(0x7f5fbb6c), - SPH_C32(0x94782948), SPH_C32(0xc5a79231), SPH_C32(0x97790000), - SPH_C32(0xaa950000), SPH_C32(0x8ca70000), SPH_C32(0xf4450000), - SPH_C32(0xa8b25c51), SPH_C32(0x7eecf5d7), SPH_C32(0x9cb7ae14), - SPH_C32(0xe19d288a) }, - { SPH_C32(0xce9e0000), SPH_C32(0xc0663500), SPH_C32(0x481f0000), - SPH_C32(0x5cdd0000), SPH_C32(0x6c853b16), SPH_C32(0x75096618), - SPH_C32(0x4f0bc126), SPH_C32(0xd0cf6d3e), SPH_C32(0x9b0b0000), - SPH_C32(0xe3700f00), SPH_C32(0xcede0000), SPH_C32(0xa8af0000), - SPH_C32(0x9b186c4b), SPH_C32(0x6b6ed0c3), SPH_C32(0x0914e56f), - SPH_C32(0x55d6281a) }, - { SPH_C32(0xc2ec0000), SPH_C32(0x89833a00), SPH_C32(0x0a660000), - SPH_C32(0x00370000), SPH_C32(0x5f2f0b0c), SPH_C32(0x608b430c), - SPH_C32(0xdaa88a5d), SPH_C32(0x64846dae), SPH_C32(0x65290000), - SPH_C32(0x44280a00), SPH_C32(0xeb0f0000), SPH_C32(0x5fcf0000), - SPH_C32(0x12291491), SPH_C32(0x74ba28a3), SPH_C32(0x47c4467a), - SPH_C32(0xf4f5d785) }, - { SPH_C32(0xcd990000), SPH_C32(0xd4fa2100), SPH_C32(0xa33e0000), - SPH_C32(0x65440000), SPH_C32(0xd9f9364c), SPH_C32(0xe786faeb), - SPH_C32(0x7143d295), SPH_C32(0x6b1e8d40), SPH_C32(0x2c430000), - SPH_C32(0xa8781200), SPH_C32(0x501c0000), SPH_C32(0x386d0000), - SPH_C32(0x3f4f30a7), SPH_C32(0x422b9861), SPH_C32(0xc4dbabb1), - SPH_C32(0x9f8d23ca) }, - { SPH_C32(0xc1eb0000), SPH_C32(0x9d1f2e00), SPH_C32(0xe1470000), - SPH_C32(0x39ae0000), SPH_C32(0xea530656), SPH_C32(0xf204dfff), - SPH_C32(0xe4e099ee), SPH_C32(0xdf558dd0), SPH_C32(0xd2610000), - SPH_C32(0x0f201700), SPH_C32(0x75cd0000), SPH_C32(0xcf0d0000), - SPH_C32(0xb67e487d), SPH_C32(0x5dff6001), SPH_C32(0x8a0b08a4), - SPH_C32(0x3eaedc55) }, - { SPH_C32(0x33bb0000), SPH_C32(0x73a22400), SPH_C32(0x86ef0000), - SPH_C32(0x92240000), SPH_C32(0x50c84e96), SPH_C32(0xf852028b), - SPH_C32(0x3f937180), SPH_C32(0xca3d72df), SPH_C32(0xde130000), - SPH_C32(0x46c51800), SPH_C32(0x37b40000), SPH_C32(0x93e70000), - SPH_C32(0x85d47867), SPH_C32(0x487d4515), SPH_C32(0x1fa843df), - SPH_C32(0x8ae5dcc5) }, - { SPH_C32(0x3fc90000), SPH_C32(0x3a472b00), SPH_C32(0xc4960000), - SPH_C32(0xcece0000), SPH_C32(0x63627e8c), SPH_C32(0xedd0279f), - SPH_C32(0xaa303afb), SPH_C32(0x7e76724f), SPH_C32(0x20310000), - SPH_C32(0xe19d1d00), SPH_C32(0x12650000), SPH_C32(0x64870000), - SPH_C32(0x0ce500bd), SPH_C32(0x57a9bd75), SPH_C32(0x5178e0ca), - SPH_C32(0x2bc6235a) }, - { SPH_C32(0x88810000), SPH_C32(0x714f3600), SPH_C32(0x5a540000), - SPH_C32(0x5e0c0000), SPH_C32(0xc7352260), SPH_C32(0xc4956f3d), - SPH_C32(0x67ff7425), SPH_C32(0xb42d799f), SPH_C32(0x947e0000), - SPH_C32(0xbe091400), SPH_C32(0x67860000), SPH_C32(0xcddc0000), - SPH_C32(0x1dce510b), SPH_C32(0xec636924), SPH_C32(0xa2ffbda7), - SPH_C32(0x5a4cc8f4) }, - { SPH_C32(0x84f30000), SPH_C32(0x38aa3900), SPH_C32(0x182d0000), - SPH_C32(0x02e60000), SPH_C32(0xf49f127a), SPH_C32(0xd1174a29), - SPH_C32(0xf25c3f5e), SPH_C32(0x0066790f), SPH_C32(0x6a5c0000), - SPH_C32(0x19511100), SPH_C32(0x42570000), SPH_C32(0x3abc0000), - SPH_C32(0x94ff29d1), SPH_C32(0xf3b79144), SPH_C32(0xec2f1eb2), - SPH_C32(0xfb6f376b) }, - { SPH_C32(0x76a30000), SPH_C32(0xd6173300), SPH_C32(0x7f850000), - SPH_C32(0xa96c0000), SPH_C32(0x4e045aba), SPH_C32(0xdb41975d), - SPH_C32(0x292fd730), SPH_C32(0x150e8600), SPH_C32(0x662e0000), - SPH_C32(0x50b41e00), SPH_C32(0x002e0000), SPH_C32(0x66560000), - SPH_C32(0xa75519cb), SPH_C32(0xe635b450), SPH_C32(0x798c55c9), - SPH_C32(0x4f2437fb) }, - { SPH_C32(0x7ad10000), SPH_C32(0x9ff23c00), SPH_C32(0x3dfc0000), - SPH_C32(0xf5860000), SPH_C32(0x7dae6aa0), SPH_C32(0xcec3b249), - SPH_C32(0xbc8c9c4b), SPH_C32(0xa1458690), SPH_C32(0x980c0000), - SPH_C32(0xf7ec1b00), SPH_C32(0x25ff0000), SPH_C32(0x91360000), - SPH_C32(0x2e646111), SPH_C32(0xf9e14c30), SPH_C32(0x375cf6dc), - SPH_C32(0xee07c864) }, - { SPH_C32(0xd1660000), SPH_C32(0x1bbc0300), SPH_C32(0x9eec0000), - SPH_C32(0xf6940000), SPH_C32(0x03024527), SPH_C32(0xcf70fcf2), - SPH_C32(0xb4431b17), SPH_C32(0x857f3c2b), SPH_C32(0xa4c20000), - SPH_C32(0xd9372400), SPH_C32(0x0a480000), SPH_C32(0x66610000), - SPH_C32(0xf87a12c7), SPH_C32(0x86bef75c), SPH_C32(0xa324df94), - SPH_C32(0x2ba05a55) }, - { SPH_C32(0xdd140000), SPH_C32(0x52590c00), SPH_C32(0xdc950000), - SPH_C32(0xaa7e0000), SPH_C32(0x30a8753d), SPH_C32(0xdaf2d9e6), - SPH_C32(0x21e0506c), SPH_C32(0x31343cbb), SPH_C32(0x5ae00000), - SPH_C32(0x7e6f2100), SPH_C32(0x2f990000), SPH_C32(0x91010000), - SPH_C32(0x714b6a1d), SPH_C32(0x996a0f3c), SPH_C32(0xedf47c81), - SPH_C32(0x8a83a5ca) }, - { SPH_C32(0x2f440000), SPH_C32(0xbce40600), SPH_C32(0xbb3d0000), - SPH_C32(0x01f40000), SPH_C32(0x8a333dfd), SPH_C32(0xd0a40492), - SPH_C32(0xfa93b802), SPH_C32(0x245cc3b4), SPH_C32(0x56920000), - SPH_C32(0x378a2e00), SPH_C32(0x6de00000), SPH_C32(0xcdeb0000), - SPH_C32(0x42e15a07), SPH_C32(0x8ce82a28), SPH_C32(0x785737fa), - SPH_C32(0x3ec8a55a) }, - { SPH_C32(0x23360000), SPH_C32(0xf5010900), SPH_C32(0xf9440000), - SPH_C32(0x5d1e0000), SPH_C32(0xb9990de7), SPH_C32(0xc5262186), - SPH_C32(0x6f30f379), SPH_C32(0x9017c324), SPH_C32(0xa8b00000), - SPH_C32(0x90d22b00), SPH_C32(0x48310000), SPH_C32(0x3a8b0000), - SPH_C32(0xcbd022dd), SPH_C32(0x933cd248), SPH_C32(0x368794ef), - SPH_C32(0x9feb5ac5) }, - { SPH_C32(0x947e0000), SPH_C32(0xbe091400), SPH_C32(0x67860000), - SPH_C32(0xcddc0000), SPH_C32(0x1dce510b), SPH_C32(0xec636924), - SPH_C32(0xa2ffbda7), SPH_C32(0x5a4cc8f4), SPH_C32(0x1cff0000), - SPH_C32(0xcf462200), SPH_C32(0x3dd20000), SPH_C32(0x93d00000), - SPH_C32(0xdafb736b), SPH_C32(0x28f60619), SPH_C32(0xc500c982), - SPH_C32(0xee61b16b) }, - { SPH_C32(0x980c0000), SPH_C32(0xf7ec1b00), SPH_C32(0x25ff0000), - SPH_C32(0x91360000), SPH_C32(0x2e646111), SPH_C32(0xf9e14c30), - SPH_C32(0x375cf6dc), SPH_C32(0xee07c864), SPH_C32(0xe2dd0000), - SPH_C32(0x681e2700), SPH_C32(0x18030000), SPH_C32(0x64b00000), - SPH_C32(0x53ca0bb1), SPH_C32(0x3722fe79), SPH_C32(0x8bd06a97), - SPH_C32(0x4f424ef4) }, - { SPH_C32(0x6a5c0000), SPH_C32(0x19511100), SPH_C32(0x42570000), - SPH_C32(0x3abc0000), SPH_C32(0x94ff29d1), SPH_C32(0xf3b79144), - SPH_C32(0xec2f1eb2), SPH_C32(0xfb6f376b), SPH_C32(0xeeaf0000), - SPH_C32(0x21fb2800), SPH_C32(0x5a7a0000), SPH_C32(0x385a0000), - SPH_C32(0x60603bab), SPH_C32(0x22a0db6d), SPH_C32(0x1e7321ec), - SPH_C32(0xfb094e64) }, - { SPH_C32(0x662e0000), SPH_C32(0x50b41e00), SPH_C32(0x002e0000), - SPH_C32(0x66560000), SPH_C32(0xa75519cb), SPH_C32(0xe635b450), - SPH_C32(0x798c55c9), SPH_C32(0x4f2437fb), SPH_C32(0x108d0000), - SPH_C32(0x86a32d00), SPH_C32(0x7fab0000), SPH_C32(0xcf3a0000), - SPH_C32(0xe9514371), SPH_C32(0x3d74230d), SPH_C32(0x50a382f9), - SPH_C32(0x5a2ab1fb) }, - { SPH_C32(0x695b0000), SPH_C32(0x0dcd0500), SPH_C32(0xa9760000), - SPH_C32(0x03250000), SPH_C32(0x2183248b), SPH_C32(0x61380db7), - SPH_C32(0xd2670d01), SPH_C32(0x40bed715), SPH_C32(0x59e70000), - SPH_C32(0x6af33500), SPH_C32(0xc4b80000), SPH_C32(0xa8980000), - SPH_C32(0xc4376747), SPH_C32(0x0be593cf), SPH_C32(0xd3bc6f32), - SPH_C32(0x315245b4) }, - { SPH_C32(0x65290000), SPH_C32(0x44280a00), SPH_C32(0xeb0f0000), - SPH_C32(0x5fcf0000), SPH_C32(0x12291491), SPH_C32(0x74ba28a3), - SPH_C32(0x47c4467a), SPH_C32(0xf4f5d785), SPH_C32(0xa7c50000), - SPH_C32(0xcdab3000), SPH_C32(0xe1690000), SPH_C32(0x5ff80000), - SPH_C32(0x4d061f9d), SPH_C32(0x14316baf), SPH_C32(0x9d6ccc27), - SPH_C32(0x9071ba2b) }, - { SPH_C32(0x97790000), SPH_C32(0xaa950000), SPH_C32(0x8ca70000), - SPH_C32(0xf4450000), SPH_C32(0xa8b25c51), SPH_C32(0x7eecf5d7), - SPH_C32(0x9cb7ae14), SPH_C32(0xe19d288a), SPH_C32(0xabb70000), - SPH_C32(0x844e3f00), SPH_C32(0xa3100000), SPH_C32(0x03120000), - SPH_C32(0x7eac2f87), SPH_C32(0x01b34ebb), SPH_C32(0x08cf875c), - SPH_C32(0x243ababb) }, - { SPH_C32(0x9b0b0000), SPH_C32(0xe3700f00), SPH_C32(0xcede0000), - SPH_C32(0xa8af0000), SPH_C32(0x9b186c4b), SPH_C32(0x6b6ed0c3), - SPH_C32(0x0914e56f), SPH_C32(0x55d6281a), SPH_C32(0x55950000), - SPH_C32(0x23163a00), SPH_C32(0x86c10000), SPH_C32(0xf4720000), - SPH_C32(0xf79d575d), SPH_C32(0x1e67b6db), SPH_C32(0x461f2449), - SPH_C32(0x85194524) }, - { SPH_C32(0x2c430000), SPH_C32(0xa8781200), SPH_C32(0x501c0000), - SPH_C32(0x386d0000), SPH_C32(0x3f4f30a7), SPH_C32(0x422b9861), - SPH_C32(0xc4dbabb1), SPH_C32(0x9f8d23ca), SPH_C32(0xe1da0000), - SPH_C32(0x7c823300), SPH_C32(0xf3220000), SPH_C32(0x5d290000), - SPH_C32(0xe6b606eb), SPH_C32(0xa5ad628a), SPH_C32(0xb5987924), - SPH_C32(0xf493ae8a) }, - { SPH_C32(0x20310000), SPH_C32(0xe19d1d00), SPH_C32(0x12650000), - SPH_C32(0x64870000), SPH_C32(0x0ce500bd), SPH_C32(0x57a9bd75), - SPH_C32(0x5178e0ca), SPH_C32(0x2bc6235a), SPH_C32(0x1ff80000), - SPH_C32(0xdbda3600), SPH_C32(0xd6f30000), SPH_C32(0xaa490000), - SPH_C32(0x6f877e31), SPH_C32(0xba799aea), SPH_C32(0xfb48da31), - SPH_C32(0x55b05115) }, - { SPH_C32(0xd2610000), SPH_C32(0x0f201700), SPH_C32(0x75cd0000), - SPH_C32(0xcf0d0000), SPH_C32(0xb67e487d), SPH_C32(0x5dff6001), - SPH_C32(0x8a0b08a4), SPH_C32(0x3eaedc55), SPH_C32(0x138a0000), - SPH_C32(0x923f3900), SPH_C32(0x948a0000), SPH_C32(0xf6a30000), - SPH_C32(0x5c2d4e2b), SPH_C32(0xaffbbffe), SPH_C32(0x6eeb914a), - SPH_C32(0xe1fb5185) }, - { SPH_C32(0xde130000), SPH_C32(0x46c51800), SPH_C32(0x37b40000), - SPH_C32(0x93e70000), SPH_C32(0x85d47867), SPH_C32(0x487d4515), - SPH_C32(0x1fa843df), SPH_C32(0x8ae5dcc5), SPH_C32(0xeda80000), - SPH_C32(0x35673c00), SPH_C32(0xb15b0000), SPH_C32(0x01c30000), - SPH_C32(0xd51c36f1), SPH_C32(0xb02f479e), SPH_C32(0x203b325f), - SPH_C32(0x40d8ae1a) }, - { SPH_C32(0xa4c20000), SPH_C32(0xd9372400), SPH_C32(0x0a480000), - SPH_C32(0x66610000), SPH_C32(0xf87a12c7), SPH_C32(0x86bef75c), - SPH_C32(0xa324df94), SPH_C32(0x2ba05a55), SPH_C32(0x75a40000), - SPH_C32(0xc28b2700), SPH_C32(0x94a40000), SPH_C32(0x90f50000), - SPH_C32(0xfb7857e0), SPH_C32(0x49ce0bae), SPH_C32(0x1767c483), - SPH_C32(0xaedf667e) }, - { SPH_C32(0xa8b00000), SPH_C32(0x90d22b00), SPH_C32(0x48310000), - SPH_C32(0x3a8b0000), SPH_C32(0xcbd022dd), SPH_C32(0x933cd248), - SPH_C32(0x368794ef), SPH_C32(0x9feb5ac5), SPH_C32(0x8b860000), - SPH_C32(0x65d32200), SPH_C32(0xb1750000), SPH_C32(0x67950000), - SPH_C32(0x72492f3a), SPH_C32(0x561af3ce), SPH_C32(0x59b76796), - SPH_C32(0x0ffc99e1) }, - { SPH_C32(0x5ae00000), SPH_C32(0x7e6f2100), SPH_C32(0x2f990000), - SPH_C32(0x91010000), SPH_C32(0x714b6a1d), SPH_C32(0x996a0f3c), - SPH_C32(0xedf47c81), SPH_C32(0x8a83a5ca), SPH_C32(0x87f40000), - SPH_C32(0x2c362d00), SPH_C32(0xf30c0000), SPH_C32(0x3b7f0000), - SPH_C32(0x41e31f20), SPH_C32(0x4398d6da), SPH_C32(0xcc142ced), - SPH_C32(0xbbb79971) }, - { SPH_C32(0x56920000), SPH_C32(0x378a2e00), SPH_C32(0x6de00000), - SPH_C32(0xcdeb0000), SPH_C32(0x42e15a07), SPH_C32(0x8ce82a28), - SPH_C32(0x785737fa), SPH_C32(0x3ec8a55a), SPH_C32(0x79d60000), - SPH_C32(0x8b6e2800), SPH_C32(0xd6dd0000), SPH_C32(0xcc1f0000), - SPH_C32(0xc8d267fa), SPH_C32(0x5c4c2eba), SPH_C32(0x82c48ff8), - SPH_C32(0x1a9466ee) }, - { SPH_C32(0xe1da0000), SPH_C32(0x7c823300), SPH_C32(0xf3220000), - SPH_C32(0x5d290000), SPH_C32(0xe6b606eb), SPH_C32(0xa5ad628a), - SPH_C32(0xb5987924), SPH_C32(0xf493ae8a), SPH_C32(0xcd990000), - SPH_C32(0xd4fa2100), SPH_C32(0xa33e0000), SPH_C32(0x65440000), - SPH_C32(0xd9f9364c), SPH_C32(0xe786faeb), SPH_C32(0x7143d295), - SPH_C32(0x6b1e8d40) }, - { SPH_C32(0xeda80000), SPH_C32(0x35673c00), SPH_C32(0xb15b0000), - SPH_C32(0x01c30000), SPH_C32(0xd51c36f1), SPH_C32(0xb02f479e), - SPH_C32(0x203b325f), SPH_C32(0x40d8ae1a), SPH_C32(0x33bb0000), - SPH_C32(0x73a22400), SPH_C32(0x86ef0000), SPH_C32(0x92240000), - SPH_C32(0x50c84e96), SPH_C32(0xf852028b), SPH_C32(0x3f937180), - SPH_C32(0xca3d72df) }, - { SPH_C32(0x1ff80000), SPH_C32(0xdbda3600), SPH_C32(0xd6f30000), - SPH_C32(0xaa490000), SPH_C32(0x6f877e31), SPH_C32(0xba799aea), - SPH_C32(0xfb48da31), SPH_C32(0x55b05115), SPH_C32(0x3fc90000), - SPH_C32(0x3a472b00), SPH_C32(0xc4960000), SPH_C32(0xcece0000), - SPH_C32(0x63627e8c), SPH_C32(0xedd0279f), SPH_C32(0xaa303afb), - SPH_C32(0x7e76724f) }, - { SPH_C32(0x138a0000), SPH_C32(0x923f3900), SPH_C32(0x948a0000), - SPH_C32(0xf6a30000), SPH_C32(0x5c2d4e2b), SPH_C32(0xaffbbffe), - SPH_C32(0x6eeb914a), SPH_C32(0xe1fb5185), SPH_C32(0xc1eb0000), - SPH_C32(0x9d1f2e00), SPH_C32(0xe1470000), SPH_C32(0x39ae0000), - SPH_C32(0xea530656), SPH_C32(0xf204dfff), SPH_C32(0xe4e099ee), - SPH_C32(0xdf558dd0) }, - { SPH_C32(0x1cff0000), SPH_C32(0xcf462200), SPH_C32(0x3dd20000), - SPH_C32(0x93d00000), SPH_C32(0xdafb736b), SPH_C32(0x28f60619), - SPH_C32(0xc500c982), SPH_C32(0xee61b16b), SPH_C32(0x88810000), - SPH_C32(0x714f3600), SPH_C32(0x5a540000), SPH_C32(0x5e0c0000), - SPH_C32(0xc7352260), SPH_C32(0xc4956f3d), SPH_C32(0x67ff7425), - SPH_C32(0xb42d799f) }, - { SPH_C32(0x108d0000), SPH_C32(0x86a32d00), SPH_C32(0x7fab0000), - SPH_C32(0xcf3a0000), SPH_C32(0xe9514371), SPH_C32(0x3d74230d), - SPH_C32(0x50a382f9), SPH_C32(0x5a2ab1fb), SPH_C32(0x76a30000), - SPH_C32(0xd6173300), SPH_C32(0x7f850000), SPH_C32(0xa96c0000), - SPH_C32(0x4e045aba), SPH_C32(0xdb41975d), SPH_C32(0x292fd730), - SPH_C32(0x150e8600) }, - { SPH_C32(0xe2dd0000), SPH_C32(0x681e2700), SPH_C32(0x18030000), - SPH_C32(0x64b00000), SPH_C32(0x53ca0bb1), SPH_C32(0x3722fe79), - SPH_C32(0x8bd06a97), SPH_C32(0x4f424ef4), SPH_C32(0x7ad10000), - SPH_C32(0x9ff23c00), SPH_C32(0x3dfc0000), SPH_C32(0xf5860000), - SPH_C32(0x7dae6aa0), SPH_C32(0xcec3b249), SPH_C32(0xbc8c9c4b), - SPH_C32(0xa1458690) }, - { SPH_C32(0xeeaf0000), SPH_C32(0x21fb2800), SPH_C32(0x5a7a0000), - SPH_C32(0x385a0000), SPH_C32(0x60603bab), SPH_C32(0x22a0db6d), - SPH_C32(0x1e7321ec), SPH_C32(0xfb094e64), SPH_C32(0x84f30000), - SPH_C32(0x38aa3900), SPH_C32(0x182d0000), SPH_C32(0x02e60000), - SPH_C32(0xf49f127a), SPH_C32(0xd1174a29), SPH_C32(0xf25c3f5e), - SPH_C32(0x0066790f) }, - { SPH_C32(0x59e70000), SPH_C32(0x6af33500), SPH_C32(0xc4b80000), - SPH_C32(0xa8980000), SPH_C32(0xc4376747), SPH_C32(0x0be593cf), - SPH_C32(0xd3bc6f32), SPH_C32(0x315245b4), SPH_C32(0x30bc0000), - SPH_C32(0x673e3000), SPH_C32(0x6dce0000), SPH_C32(0xabbd0000), - SPH_C32(0xe5b443cc), SPH_C32(0x6add9e78), SPH_C32(0x01db6233), - SPH_C32(0x71ec92a1) }, - { SPH_C32(0x55950000), SPH_C32(0x23163a00), SPH_C32(0x86c10000), - SPH_C32(0xf4720000), SPH_C32(0xf79d575d), SPH_C32(0x1e67b6db), - SPH_C32(0x461f2449), SPH_C32(0x85194524), SPH_C32(0xce9e0000), - SPH_C32(0xc0663500), SPH_C32(0x481f0000), SPH_C32(0x5cdd0000), - SPH_C32(0x6c853b16), SPH_C32(0x75096618), SPH_C32(0x4f0bc126), - SPH_C32(0xd0cf6d3e) }, - { SPH_C32(0xa7c50000), SPH_C32(0xcdab3000), SPH_C32(0xe1690000), - SPH_C32(0x5ff80000), SPH_C32(0x4d061f9d), SPH_C32(0x14316baf), - SPH_C32(0x9d6ccc27), SPH_C32(0x9071ba2b), SPH_C32(0xc2ec0000), - SPH_C32(0x89833a00), SPH_C32(0x0a660000), SPH_C32(0x00370000), - SPH_C32(0x5f2f0b0c), SPH_C32(0x608b430c), SPH_C32(0xdaa88a5d), - SPH_C32(0x64846dae) }, - { SPH_C32(0xabb70000), SPH_C32(0x844e3f00), SPH_C32(0xa3100000), - SPH_C32(0x03120000), SPH_C32(0x7eac2f87), SPH_C32(0x01b34ebb), - SPH_C32(0x08cf875c), SPH_C32(0x243ababb), SPH_C32(0x3cce0000), - SPH_C32(0x2edb3f00), SPH_C32(0x2fb70000), SPH_C32(0xf7570000), - SPH_C32(0xd61e73d6), SPH_C32(0x7f5fbb6c), SPH_C32(0x94782948), - SPH_C32(0xc5a79231) }, - { SPH_C32(0x75c90003), SPH_C32(0x0e10c000), SPH_C32(0xd1200000), - SPH_C32(0xbaea0000), SPH_C32(0x8bc42f3e), SPH_C32(0x8758b757), - SPH_C32(0xbb28761d), SPH_C32(0x00b72e2b), SPH_C32(0xeecf0001), - SPH_C32(0x6f564000), SPH_C32(0xf33e0000), SPH_C32(0xa79e0000), - SPH_C32(0xbdb57219), SPH_C32(0xb711ebc5), SPH_C32(0x4a3b40ba), - SPH_C32(0xfeabf254) }, - { SPH_C32(0x79bb0003), SPH_C32(0x47f5cf00), SPH_C32(0x93590000), - SPH_C32(0xe6000000), SPH_C32(0xb86e1f24), SPH_C32(0x92da9243), - SPH_C32(0x2e8b3d66), SPH_C32(0xb4fc2ebb), SPH_C32(0x10ed0001), - SPH_C32(0xc80e4500), SPH_C32(0xd6ef0000), SPH_C32(0x50fe0000), - SPH_C32(0x34840ac3), SPH_C32(0xa8c513a5), SPH_C32(0x04ebe3af), - SPH_C32(0x5f880dcb) }, - { SPH_C32(0x8beb0003), SPH_C32(0xa948c500), SPH_C32(0xf4f10000), - SPH_C32(0x4d8a0000), SPH_C32(0x02f557e4), SPH_C32(0x988c4f37), - SPH_C32(0xf5f8d508), SPH_C32(0xa194d1b4), SPH_C32(0x1c9f0001), - SPH_C32(0x81eb4a00), SPH_C32(0x94960000), SPH_C32(0x0c140000), - SPH_C32(0x072e3ad9), SPH_C32(0xbd4736b1), SPH_C32(0x9148a8d4), - SPH_C32(0xebc30d5b) }, - { SPH_C32(0x87990003), SPH_C32(0xe0adca00), SPH_C32(0xb6880000), - SPH_C32(0x11600000), SPH_C32(0x315f67fe), SPH_C32(0x8d0e6a23), - SPH_C32(0x605b9e73), SPH_C32(0x15dfd124), SPH_C32(0xe2bd0001), - SPH_C32(0x26b34f00), SPH_C32(0xb1470000), SPH_C32(0xfb740000), - SPH_C32(0x8e1f4203), SPH_C32(0xa293ced1), SPH_C32(0xdf980bc1), - SPH_C32(0x4ae0f2c4) }, - { SPH_C32(0x30d10003), SPH_C32(0xaba5d700), SPH_C32(0x284a0000), - SPH_C32(0x81a20000), SPH_C32(0x95083b12), SPH_C32(0xa44b2281), - SPH_C32(0xad94d0ad), SPH_C32(0xdf84daf4), SPH_C32(0x56f20001), - SPH_C32(0x79274600), SPH_C32(0xc4a40000), SPH_C32(0x522f0000), - SPH_C32(0x9f3413b5), SPH_C32(0x19591a80), SPH_C32(0x2c1f56ac), - SPH_C32(0x3b6a196a) }, - { SPH_C32(0x3ca30003), SPH_C32(0xe240d800), SPH_C32(0x6a330000), - SPH_C32(0xdd480000), SPH_C32(0xa6a20b08), SPH_C32(0xb1c90795), - SPH_C32(0x38379bd6), SPH_C32(0x6bcfda64), SPH_C32(0xa8d00001), - SPH_C32(0xde7f4300), SPH_C32(0xe1750000), SPH_C32(0xa54f0000), - SPH_C32(0x16056b6f), SPH_C32(0x068de2e0), SPH_C32(0x62cff5b9), - SPH_C32(0x9a49e6f5) }, - { SPH_C32(0xcef30003), SPH_C32(0x0cfdd200), SPH_C32(0x0d9b0000), - SPH_C32(0x76c20000), SPH_C32(0x1c3943c8), SPH_C32(0xbb9fdae1), - SPH_C32(0xe34473b8), SPH_C32(0x7ea7256b), SPH_C32(0xa4a20001), - SPH_C32(0x979a4c00), SPH_C32(0xa30c0000), SPH_C32(0xf9a50000), - SPH_C32(0x25af5b75), SPH_C32(0x130fc7f4), SPH_C32(0xf76cbec2), - SPH_C32(0x2e02e665) }, - { SPH_C32(0xc2810003), SPH_C32(0x4518dd00), SPH_C32(0x4fe20000), - SPH_C32(0x2a280000), SPH_C32(0x2f9373d2), SPH_C32(0xae1dfff5), - SPH_C32(0x76e738c3), SPH_C32(0xcaec25fb), SPH_C32(0x5a800001), - SPH_C32(0x30c24900), SPH_C32(0x86dd0000), SPH_C32(0x0ec50000), - SPH_C32(0xac9e23af), SPH_C32(0x0cdb3f94), SPH_C32(0xb9bc1dd7), - SPH_C32(0x8f2119fa) }, - { SPH_C32(0xcdf40003), SPH_C32(0x1861c600), SPH_C32(0xe6ba0000), - SPH_C32(0x4f5b0000), SPH_C32(0xa9454e92), SPH_C32(0x29104612), - SPH_C32(0xdd0c600b), SPH_C32(0xc576c515), SPH_C32(0x13ea0001), - SPH_C32(0xdc925100), SPH_C32(0x3dce0000), SPH_C32(0x69670000), - SPH_C32(0x81f80799), SPH_C32(0x3a4a8f56), SPH_C32(0x3aa3f01c), - SPH_C32(0xe459edb5) }, - { SPH_C32(0xc1860003), SPH_C32(0x5184c900), SPH_C32(0xa4c30000), - SPH_C32(0x13b10000), SPH_C32(0x9aef7e88), SPH_C32(0x3c926306), - SPH_C32(0x48af2b70), SPH_C32(0x713dc585), SPH_C32(0xedc80001), - SPH_C32(0x7bca5400), SPH_C32(0x181f0000), SPH_C32(0x9e070000), - SPH_C32(0x08c97f43), SPH_C32(0x259e7736), SPH_C32(0x74735309), - SPH_C32(0x457a122a) }, - { SPH_C32(0x33d60003), SPH_C32(0xbf39c300), SPH_C32(0xc36b0000), - SPH_C32(0xb83b0000), SPH_C32(0x20743648), SPH_C32(0x36c4be72), - SPH_C32(0x93dcc31e), SPH_C32(0x64553a8a), SPH_C32(0xe1ba0001), - SPH_C32(0x322f5b00), SPH_C32(0x5a660000), SPH_C32(0xc2ed0000), - SPH_C32(0x3b634f59), SPH_C32(0x301c5222), SPH_C32(0xe1d01872), - SPH_C32(0xf13112ba) }, - { SPH_C32(0x3fa40003), SPH_C32(0xf6dccc00), SPH_C32(0x81120000), - SPH_C32(0xe4d10000), SPH_C32(0x13de0652), SPH_C32(0x23469b66), - SPH_C32(0x067f8865), SPH_C32(0xd01e3a1a), SPH_C32(0x1f980001), - SPH_C32(0x95775e00), SPH_C32(0x7fb70000), SPH_C32(0x358d0000), - SPH_C32(0xb2523783), SPH_C32(0x2fc8aa42), SPH_C32(0xaf00bb67), - SPH_C32(0x5012ed25) }, - { SPH_C32(0x88ec0003), SPH_C32(0xbdd4d100), SPH_C32(0x1fd00000), - SPH_C32(0x74130000), SPH_C32(0xb7895abe), SPH_C32(0x0a03d3c4), - SPH_C32(0xcbb0c6bb), SPH_C32(0x1a4531ca), SPH_C32(0xabd70001), - SPH_C32(0xcae35700), SPH_C32(0x0a540000), SPH_C32(0x9cd60000), - SPH_C32(0xa3796635), SPH_C32(0x94027e13), SPH_C32(0x5c87e60a), - SPH_C32(0x2198068b) }, - { SPH_C32(0x849e0003), SPH_C32(0xf431de00), SPH_C32(0x5da90000), - SPH_C32(0x28f90000), SPH_C32(0x84236aa4), SPH_C32(0x1f81f6d0), - SPH_C32(0x5e138dc0), SPH_C32(0xae0e315a), SPH_C32(0x55f50001), - SPH_C32(0x6dbb5200), SPH_C32(0x2f850000), SPH_C32(0x6bb60000), - SPH_C32(0x2a481eef), SPH_C32(0x8bd68673), SPH_C32(0x1257451f), - SPH_C32(0x80bbf914) }, - { SPH_C32(0x76ce0003), SPH_C32(0x1a8cd400), SPH_C32(0x3a010000), - SPH_C32(0x83730000), SPH_C32(0x3eb82264), SPH_C32(0x15d72ba4), - SPH_C32(0x856065ae), SPH_C32(0xbb66ce55), SPH_C32(0x59870001), - SPH_C32(0x245e5d00), SPH_C32(0x6dfc0000), SPH_C32(0x375c0000), - SPH_C32(0x19e22ef5), SPH_C32(0x9e54a367), SPH_C32(0x87f40e64), - SPH_C32(0x34f0f984) }, - { SPH_C32(0x7abc0003), SPH_C32(0x5369db00), SPH_C32(0x78780000), - SPH_C32(0xdf990000), SPH_C32(0x0d12127e), SPH_C32(0x00550eb0), - SPH_C32(0x10c32ed5), SPH_C32(0x0f2dcec5), SPH_C32(0xa7a50001), - SPH_C32(0x83065800), SPH_C32(0x482d0000), SPH_C32(0xc03c0000), - SPH_C32(0x90d3562f), SPH_C32(0x81805b07), SPH_C32(0xc924ad71), - SPH_C32(0x95d3061b) }, - { SPH_C32(0x006d0003), SPH_C32(0xcc9be700), SPH_C32(0x45840000), - SPH_C32(0x2a1f0000), SPH_C32(0x70bc78de), SPH_C32(0xce96bcf9), - SPH_C32(0xac4fb29e), SPH_C32(0xae684855), SPH_C32(0x3fa90001), - SPH_C32(0x74ea4300), SPH_C32(0x6dd20000), SPH_C32(0x510a0000), - SPH_C32(0xbeb7373e), SPH_C32(0x78611737), SPH_C32(0xfe785bad), - SPH_C32(0x7bd4ce7f) }, - { SPH_C32(0x0c1f0003), SPH_C32(0x857ee800), SPH_C32(0x07fd0000), - SPH_C32(0x76f50000), SPH_C32(0x431648c4), SPH_C32(0xdb1499ed), - SPH_C32(0x39ecf9e5), SPH_C32(0x1a2348c5), SPH_C32(0xc18b0001), - SPH_C32(0xd3b24600), SPH_C32(0x48030000), SPH_C32(0xa66a0000), - SPH_C32(0x37864fe4), SPH_C32(0x67b5ef57), SPH_C32(0xb0a8f8b8), - SPH_C32(0xdaf731e0) }, - { SPH_C32(0xfe4f0003), SPH_C32(0x6bc3e200), SPH_C32(0x60550000), - SPH_C32(0xdd7f0000), SPH_C32(0xf98d0004), SPH_C32(0xd1424499), - SPH_C32(0xe29f118b), SPH_C32(0x0f4bb7ca), SPH_C32(0xcdf90001), - SPH_C32(0x9a574900), SPH_C32(0x0a7a0000), SPH_C32(0xfa800000), - SPH_C32(0x042c7ffe), SPH_C32(0x7237ca43), SPH_C32(0x250bb3c3), - SPH_C32(0x6ebc3170) }, - { SPH_C32(0xf23d0003), SPH_C32(0x2226ed00), SPH_C32(0x222c0000), - SPH_C32(0x81950000), SPH_C32(0xca27301e), SPH_C32(0xc4c0618d), - SPH_C32(0x773c5af0), SPH_C32(0xbb00b75a), SPH_C32(0x33db0001), - SPH_C32(0x3d0f4c00), SPH_C32(0x2fab0000), SPH_C32(0x0de00000), - SPH_C32(0x8d1d0724), SPH_C32(0x6de33223), SPH_C32(0x6bdb10d6), - SPH_C32(0xcf9fceef) }, - { SPH_C32(0x45750003), SPH_C32(0x692ef000), SPH_C32(0xbcee0000), - SPH_C32(0x11570000), SPH_C32(0x6e706cf2), SPH_C32(0xed85292f), - SPH_C32(0xbaf3142e), SPH_C32(0x715bbc8a), SPH_C32(0x87940001), - SPH_C32(0x629b4500), SPH_C32(0x5a480000), SPH_C32(0xa4bb0000), - SPH_C32(0x9c365692), SPH_C32(0xd629e672), SPH_C32(0x985c4dbb), - SPH_C32(0xbe152541) }, - { SPH_C32(0x49070003), SPH_C32(0x20cbff00), SPH_C32(0xfe970000), - SPH_C32(0x4dbd0000), SPH_C32(0x5dda5ce8), SPH_C32(0xf8070c3b), - SPH_C32(0x2f505f55), SPH_C32(0xc510bc1a), SPH_C32(0x79b60001), - SPH_C32(0xc5c34000), SPH_C32(0x7f990000), SPH_C32(0x53db0000), - SPH_C32(0x15072e48), SPH_C32(0xc9fd1e12), SPH_C32(0xd68ceeae), - SPH_C32(0x1f36dade) }, - { SPH_C32(0xbb570003), SPH_C32(0xce76f500), SPH_C32(0x993f0000), - SPH_C32(0xe6370000), SPH_C32(0xe7411428), SPH_C32(0xf251d14f), - SPH_C32(0xf423b73b), SPH_C32(0xd0784315), SPH_C32(0x75c40001), - SPH_C32(0x8c264f00), SPH_C32(0x3de00000), SPH_C32(0x0f310000), - SPH_C32(0x26ad1e52), SPH_C32(0xdc7f3b06), SPH_C32(0x432fa5d5), - SPH_C32(0xab7dda4e) }, - { SPH_C32(0xb7250003), SPH_C32(0x8793fa00), SPH_C32(0xdb460000), - SPH_C32(0xbadd0000), SPH_C32(0xd4eb2432), SPH_C32(0xe7d3f45b), - SPH_C32(0x6180fc40), SPH_C32(0x64334385), SPH_C32(0x8be60001), - SPH_C32(0x2b7e4a00), SPH_C32(0x18310000), SPH_C32(0xf8510000), - SPH_C32(0xaf9c6688), SPH_C32(0xc3abc366), SPH_C32(0x0dff06c0), - SPH_C32(0x0a5e25d1) }, - { SPH_C32(0xb8500003), SPH_C32(0xdaeae100), SPH_C32(0x721e0000), - SPH_C32(0xdfae0000), SPH_C32(0x523d1972), SPH_C32(0x60de4dbc), - SPH_C32(0xca6ba488), SPH_C32(0x6ba9a36b), SPH_C32(0xc28c0001), - SPH_C32(0xc72e5200), SPH_C32(0xa3220000), SPH_C32(0x9ff30000), - SPH_C32(0x82fa42be), SPH_C32(0xf53a73a4), SPH_C32(0x8ee0eb0b), - SPH_C32(0x6126d19e) }, - { SPH_C32(0xb4220003), SPH_C32(0x930fee00), SPH_C32(0x30670000), - SPH_C32(0x83440000), SPH_C32(0x61972968), SPH_C32(0x755c68a8), - SPH_C32(0x5fc8eff3), SPH_C32(0xdfe2a3fb), SPH_C32(0x3cae0001), - SPH_C32(0x60765700), SPH_C32(0x86f30000), SPH_C32(0x68930000), - SPH_C32(0x0bcb3a64), SPH_C32(0xeaee8bc4), SPH_C32(0xc030481e), - SPH_C32(0xc0052e01) }, - { SPH_C32(0x46720003), SPH_C32(0x7db2e400), SPH_C32(0x57cf0000), - SPH_C32(0x28ce0000), SPH_C32(0xdb0c61a8), SPH_C32(0x7f0ab5dc), - SPH_C32(0x84bb079d), SPH_C32(0xca8a5cf4), SPH_C32(0x30dc0001), - SPH_C32(0x29935800), SPH_C32(0xc48a0000), SPH_C32(0x34790000), - SPH_C32(0x38610a7e), SPH_C32(0xff6caed0), SPH_C32(0x55930365), - SPH_C32(0x744e2e91) }, - { SPH_C32(0x4a000003), SPH_C32(0x3457eb00), SPH_C32(0x15b60000), - SPH_C32(0x74240000), SPH_C32(0xe8a651b2), SPH_C32(0x6a8890c8), - SPH_C32(0x11184ce6), SPH_C32(0x7ec15c64), SPH_C32(0xcefe0001), - SPH_C32(0x8ecb5d00), SPH_C32(0xe15b0000), SPH_C32(0xc3190000), - SPH_C32(0xb15072a4), SPH_C32(0xe0b856b0), SPH_C32(0x1b43a070), - SPH_C32(0xd56dd10e) }, - { SPH_C32(0xfd480003), SPH_C32(0x7f5ff600), SPH_C32(0x8b740000), - SPH_C32(0xe4e60000), SPH_C32(0x4cf10d5e), SPH_C32(0x43cdd86a), - SPH_C32(0xdcd70238), SPH_C32(0xb49a57b4), SPH_C32(0x7ab10001), - SPH_C32(0xd15f5400), SPH_C32(0x94b80000), SPH_C32(0x6a420000), - SPH_C32(0xa07b2312), SPH_C32(0x5b7282e1), SPH_C32(0xe8c4fd1d), - SPH_C32(0xa4e73aa0) }, - { SPH_C32(0xf13a0003), SPH_C32(0x36baf900), SPH_C32(0xc90d0000), - SPH_C32(0xb80c0000), SPH_C32(0x7f5b3d44), SPH_C32(0x564ffd7e), - SPH_C32(0x49744943), SPH_C32(0x00d15724), SPH_C32(0x84930001), - SPH_C32(0x76075100), SPH_C32(0xb1690000), SPH_C32(0x9d220000), - SPH_C32(0x294a5bc8), SPH_C32(0x44a67a81), SPH_C32(0xa6145e08), - SPH_C32(0x05c4c53f) }, - { SPH_C32(0x036a0003), SPH_C32(0xd807f300), SPH_C32(0xaea50000), - SPH_C32(0x13860000), SPH_C32(0xc5c07584), SPH_C32(0x5c19200a), - SPH_C32(0x9207a12d), SPH_C32(0x15b9a82b), SPH_C32(0x88e10001), - SPH_C32(0x3fe25e00), SPH_C32(0xf3100000), SPH_C32(0xc1c80000), - SPH_C32(0x1ae06bd2), SPH_C32(0x51245f95), SPH_C32(0x33b71573), - SPH_C32(0xb18fc5af) }, - { SPH_C32(0x0f180003), SPH_C32(0x91e2fc00), SPH_C32(0xecdc0000), - SPH_C32(0x4f6c0000), SPH_C32(0xf66a459e), SPH_C32(0x499b051e), - SPH_C32(0x07a4ea56), SPH_C32(0xa1f2a8bb), SPH_C32(0x76c30001), - SPH_C32(0x98ba5b00), SPH_C32(0xd6c10000), SPH_C32(0x36a80000), - SPH_C32(0x93d11308), SPH_C32(0x4ef0a7f5), SPH_C32(0x7d67b666), - SPH_C32(0x10ac3a30) }, - { SPH_C32(0xa4af0003), SPH_C32(0x15acc300), SPH_C32(0x4fcc0000), - SPH_C32(0x4c7e0000), SPH_C32(0x88c66a19), SPH_C32(0x48284ba5), - SPH_C32(0x0f6b6d0a), SPH_C32(0x85c81200), SPH_C32(0x4a0d0001), - SPH_C32(0xb6616400), SPH_C32(0xf9760000), SPH_C32(0xc1ff0000), - SPH_C32(0x45cf60de), SPH_C32(0x31af1c99), SPH_C32(0xe91f9f2e), - SPH_C32(0xd50ba801) }, - { SPH_C32(0xa8dd0003), SPH_C32(0x5c49cc00), SPH_C32(0x0db50000), - SPH_C32(0x10940000), SPH_C32(0xbb6c5a03), SPH_C32(0x5daa6eb1), - SPH_C32(0x9ac82671), SPH_C32(0x31831290), SPH_C32(0xb42f0001), - SPH_C32(0x11396100), SPH_C32(0xdca70000), SPH_C32(0x369f0000), - SPH_C32(0xccfe1804), SPH_C32(0x2e7be4f9), SPH_C32(0xa7cf3c3b), - SPH_C32(0x7428579e) }, - { SPH_C32(0x5a8d0003), SPH_C32(0xb2f4c600), SPH_C32(0x6a1d0000), - SPH_C32(0xbb1e0000), SPH_C32(0x01f712c3), SPH_C32(0x57fcb3c5), - SPH_C32(0x41bbce1f), SPH_C32(0x24ebed9f), SPH_C32(0xb85d0001), - SPH_C32(0x58dc6e00), SPH_C32(0x9ede0000), SPH_C32(0x6a750000), - SPH_C32(0xff54281e), SPH_C32(0x3bf9c1ed), SPH_C32(0x326c7740), - SPH_C32(0xc063570e) }, - { SPH_C32(0x56ff0003), SPH_C32(0xfb11c900), SPH_C32(0x28640000), - SPH_C32(0xe7f40000), SPH_C32(0x325d22d9), SPH_C32(0x427e96d1), - SPH_C32(0xd4188564), SPH_C32(0x90a0ed0f), SPH_C32(0x467f0001), - SPH_C32(0xff846b00), SPH_C32(0xbb0f0000), SPH_C32(0x9d150000), - SPH_C32(0x766550c4), SPH_C32(0x242d398d), SPH_C32(0x7cbcd455), - SPH_C32(0x6140a891) }, - { SPH_C32(0xe1b70003), SPH_C32(0xb019d400), SPH_C32(0xb6a60000), - SPH_C32(0x77360000), SPH_C32(0x960a7e35), SPH_C32(0x6b3bde73), - SPH_C32(0x19d7cbba), SPH_C32(0x5afbe6df), SPH_C32(0xf2300001), - SPH_C32(0xa0106200), SPH_C32(0xceec0000), SPH_C32(0x344e0000), - SPH_C32(0x674e0172), SPH_C32(0x9fe7eddc), SPH_C32(0x8f3b8938), - SPH_C32(0x10ca433f) }, - { SPH_C32(0xedc50003), SPH_C32(0xf9fcdb00), SPH_C32(0xf4df0000), - SPH_C32(0x2bdc0000), SPH_C32(0xa5a04e2f), SPH_C32(0x7eb9fb67), - SPH_C32(0x8c7480c1), SPH_C32(0xeeb0e64f), SPH_C32(0x0c120001), - SPH_C32(0x07486700), SPH_C32(0xeb3d0000), SPH_C32(0xc32e0000), - SPH_C32(0xee7f79a8), SPH_C32(0x803315bc), SPH_C32(0xc1eb2a2d), - SPH_C32(0xb1e9bca0) }, - { SPH_C32(0x1f950003), SPH_C32(0x1741d100), SPH_C32(0x93770000), - SPH_C32(0x80560000), SPH_C32(0x1f3b06ef), SPH_C32(0x74ef2613), - SPH_C32(0x570768af), SPH_C32(0xfbd81940), SPH_C32(0x00600001), - SPH_C32(0x4ead6800), SPH_C32(0xa9440000), SPH_C32(0x9fc40000), - SPH_C32(0xddd549b2), SPH_C32(0x95b130a8), SPH_C32(0x54486156), - SPH_C32(0x05a2bc30) }, - { SPH_C32(0x13e70003), SPH_C32(0x5ea4de00), SPH_C32(0xd10e0000), - SPH_C32(0xdcbc0000), SPH_C32(0x2c9136f5), SPH_C32(0x616d0307), - SPH_C32(0xc2a423d4), SPH_C32(0x4f9319d0), SPH_C32(0xfe420001), - SPH_C32(0xe9f56d00), SPH_C32(0x8c950000), SPH_C32(0x68a40000), - SPH_C32(0x54e43168), SPH_C32(0x8a65c8c8), SPH_C32(0x1a98c243), - SPH_C32(0xa48143af) }, - { SPH_C32(0x1c920003), SPH_C32(0x03ddc500), SPH_C32(0x78560000), - SPH_C32(0xb9cf0000), SPH_C32(0xaa470bb5), SPH_C32(0xe660bae0), - SPH_C32(0x694f7b1c), SPH_C32(0x4009f93e), SPH_C32(0xb7280001), - SPH_C32(0x05a57500), SPH_C32(0x37860000), SPH_C32(0x0f060000), - SPH_C32(0x7982155e), SPH_C32(0xbcf4780a), SPH_C32(0x99872f88), - SPH_C32(0xcff9b7e0) }, - { SPH_C32(0x10e00003), SPH_C32(0x4a38ca00), SPH_C32(0x3a2f0000), - SPH_C32(0xe5250000), SPH_C32(0x99ed3baf), SPH_C32(0xf3e29ff4), - SPH_C32(0xfcec3067), SPH_C32(0xf442f9ae), SPH_C32(0x490a0001), - SPH_C32(0xa2fd7000), SPH_C32(0x12570000), SPH_C32(0xf8660000), - SPH_C32(0xf0b36d84), SPH_C32(0xa320806a), SPH_C32(0xd7578c9d), - SPH_C32(0x6eda487f) }, - { SPH_C32(0xe2b00003), SPH_C32(0xa485c000), SPH_C32(0x5d870000), - SPH_C32(0x4eaf0000), SPH_C32(0x2376736f), SPH_C32(0xf9b44280), - SPH_C32(0x279fd809), SPH_C32(0xe12a06a1), SPH_C32(0x45780001), - SPH_C32(0xeb187f00), SPH_C32(0x502e0000), SPH_C32(0xa48c0000), - SPH_C32(0xc3195d9e), SPH_C32(0xb6a2a57e), SPH_C32(0x42f4c7e6), - SPH_C32(0xda9148ef) }, - { SPH_C32(0xeec20003), SPH_C32(0xed60cf00), SPH_C32(0x1ffe0000), - SPH_C32(0x12450000), SPH_C32(0x10dc4375), SPH_C32(0xec366794), - SPH_C32(0xb23c9372), SPH_C32(0x55610631), SPH_C32(0xbb5a0001), - SPH_C32(0x4c407a00), SPH_C32(0x75ff0000), SPH_C32(0x53ec0000), - SPH_C32(0x4a282544), SPH_C32(0xa9765d1e), SPH_C32(0x0c2464f3), - SPH_C32(0x7bb2b770) }, - { SPH_C32(0x598a0003), SPH_C32(0xa668d200), SPH_C32(0x813c0000), - SPH_C32(0x82870000), SPH_C32(0xb48b1f99), SPH_C32(0xc5732f36), - SPH_C32(0x7ff3ddac), SPH_C32(0x9f3a0de1), SPH_C32(0x0f150001), - SPH_C32(0x13d47300), SPH_C32(0x001c0000), SPH_C32(0xfab70000), - SPH_C32(0x5b0374f2), SPH_C32(0x12bc894f), SPH_C32(0xffa3399e), - SPH_C32(0x0a385cde) }, - { SPH_C32(0x55f80003), SPH_C32(0xef8ddd00), SPH_C32(0xc3450000), - SPH_C32(0xde6d0000), SPH_C32(0x87212f83), SPH_C32(0xd0f10a22), - SPH_C32(0xea5096d7), SPH_C32(0x2b710d71), SPH_C32(0xf1370001), - SPH_C32(0xb48c7600), SPH_C32(0x25cd0000), SPH_C32(0x0dd70000), - SPH_C32(0xd2320c28), SPH_C32(0x0d68712f), SPH_C32(0xb1739a8b), - SPH_C32(0xab1ba341) }, - { SPH_C32(0xa7a80003), SPH_C32(0x0130d700), SPH_C32(0xa4ed0000), - SPH_C32(0x75e70000), SPH_C32(0x3dba6743), SPH_C32(0xdaa7d756), - SPH_C32(0x31237eb9), SPH_C32(0x3e19f27e), SPH_C32(0xfd450001), - SPH_C32(0xfd697900), SPH_C32(0x67b40000), SPH_C32(0x513d0000), - SPH_C32(0xe1983c32), SPH_C32(0x18ea543b), SPH_C32(0x24d0d1f0), - SPH_C32(0x1f50a3d1) }, - { SPH_C32(0xabda0003), SPH_C32(0x48d5d800), SPH_C32(0xe6940000), - SPH_C32(0x290d0000), SPH_C32(0x0e105759), SPH_C32(0xcf25f242), - SPH_C32(0xa48035c2), SPH_C32(0x8a52f2ee), SPH_C32(0x03670001), - SPH_C32(0x5a317c00), SPH_C32(0x42650000), SPH_C32(0xa65d0000), - SPH_C32(0x68a944e8), SPH_C32(0x073eac5b), SPH_C32(0x6a0072e5), - SPH_C32(0xbe735c4e) }, - { SPH_C32(0xd10b0003), SPH_C32(0xd727e400), SPH_C32(0xdb680000), - SPH_C32(0xdc8b0000), SPH_C32(0x73be3df9), SPH_C32(0x01e6400b), - SPH_C32(0x180ca989), SPH_C32(0x2b17747e), SPH_C32(0x9b6b0001), - SPH_C32(0xaddd6700), SPH_C32(0x679a0000), SPH_C32(0x376b0000), - SPH_C32(0x46cd25f9), SPH_C32(0xfedfe06b), SPH_C32(0x5d5c8439), - SPH_C32(0x5074942a) }, - { SPH_C32(0xdd790003), SPH_C32(0x9ec2eb00), SPH_C32(0x99110000), - SPH_C32(0x80610000), SPH_C32(0x40140de3), SPH_C32(0x1464651f), - SPH_C32(0x8dafe2f2), SPH_C32(0x9f5c74ee), SPH_C32(0x65490001), - SPH_C32(0x0a856200), SPH_C32(0x424b0000), SPH_C32(0xc00b0000), - SPH_C32(0xcffc5d23), SPH_C32(0xe10b180b), SPH_C32(0x138c272c), - SPH_C32(0xf1576bb5) }, - { SPH_C32(0x2f290003), SPH_C32(0x707fe100), SPH_C32(0xfeb90000), - SPH_C32(0x2beb0000), SPH_C32(0xfa8f4523), SPH_C32(0x1e32b86b), - SPH_C32(0x56dc0a9c), SPH_C32(0x8a348be1), SPH_C32(0x693b0001), - SPH_C32(0x43606d00), SPH_C32(0x00320000), SPH_C32(0x9ce10000), - SPH_C32(0xfc566d39), SPH_C32(0xf4893d1f), SPH_C32(0x862f6c57), - SPH_C32(0x451c6b25) }, - { SPH_C32(0x235b0003), SPH_C32(0x399aee00), SPH_C32(0xbcc00000), - SPH_C32(0x77010000), SPH_C32(0xc9257539), SPH_C32(0x0bb09d7f), - SPH_C32(0xc37f41e7), SPH_C32(0x3e7f8b71), SPH_C32(0x97190001), - SPH_C32(0xe4386800), SPH_C32(0x25e30000), SPH_C32(0x6b810000), - SPH_C32(0x756715e3), SPH_C32(0xeb5dc57f), SPH_C32(0xc8ffcf42), - SPH_C32(0xe43f94ba) }, - { SPH_C32(0x94130003), SPH_C32(0x7292f300), SPH_C32(0x22020000), - SPH_C32(0xe7c30000), SPH_C32(0x6d7229d5), SPH_C32(0x22f5d5dd), - SPH_C32(0x0eb00f39), SPH_C32(0xf42480a1), SPH_C32(0x23560001), - SPH_C32(0xbbac6100), SPH_C32(0x50000000), SPH_C32(0xc2da0000), - SPH_C32(0x644c4455), SPH_C32(0x5097112e), SPH_C32(0x3b78922f), - SPH_C32(0x95b57f14) }, - { SPH_C32(0x98610003), SPH_C32(0x3b77fc00), SPH_C32(0x607b0000), - SPH_C32(0xbb290000), SPH_C32(0x5ed819cf), SPH_C32(0x3777f0c9), - SPH_C32(0x9b134442), SPH_C32(0x406f8031), SPH_C32(0xdd740001), - SPH_C32(0x1cf46400), SPH_C32(0x75d10000), SPH_C32(0x35ba0000), - SPH_C32(0xed7d3c8f), SPH_C32(0x4f43e94e), SPH_C32(0x75a8313a), - SPH_C32(0x3496808b) }, - { SPH_C32(0x6a310003), SPH_C32(0xd5caf600), SPH_C32(0x07d30000), - SPH_C32(0x10a30000), SPH_C32(0xe443510f), SPH_C32(0x3d212dbd), - SPH_C32(0x4060ac2c), SPH_C32(0x55077f3e), SPH_C32(0xd1060001), - SPH_C32(0x55116b00), SPH_C32(0x37a80000), SPH_C32(0x69500000), - SPH_C32(0xded70c95), SPH_C32(0x5ac1cc5a), SPH_C32(0xe00b7a41), - SPH_C32(0x80dd801b) }, - { SPH_C32(0x66430003), SPH_C32(0x9c2ff900), SPH_C32(0x45aa0000), - SPH_C32(0x4c490000), SPH_C32(0xd7e96115), SPH_C32(0x28a308a9), - SPH_C32(0xd5c3e757), SPH_C32(0xe14c7fae), SPH_C32(0x2f240001), - SPH_C32(0xf2496e00), SPH_C32(0x12790000), SPH_C32(0x9e300000), - SPH_C32(0x57e6744f), SPH_C32(0x4515343a), SPH_C32(0xaedbd954), - SPH_C32(0x21fe7f84) }, - { SPH_C32(0x69360003), SPH_C32(0xc156e200), SPH_C32(0xecf20000), - SPH_C32(0x293a0000), SPH_C32(0x513f5c55), SPH_C32(0xafaeb14e), - SPH_C32(0x7e28bf9f), SPH_C32(0xeed69f40), SPH_C32(0x664e0001), - SPH_C32(0x1e197600), SPH_C32(0xa96a0000), SPH_C32(0xf9920000), - SPH_C32(0x7a805079), SPH_C32(0x738484f8), SPH_C32(0x2dc4349f), - SPH_C32(0x4a868bcb) }, - { SPH_C32(0x65440003), SPH_C32(0x88b3ed00), SPH_C32(0xae8b0000), - SPH_C32(0x75d00000), SPH_C32(0x62956c4f), SPH_C32(0xba2c945a), - SPH_C32(0xeb8bf4e4), SPH_C32(0x5a9d9fd0), SPH_C32(0x986c0001), - SPH_C32(0xb9417300), SPH_C32(0x8cbb0000), SPH_C32(0x0ef20000), - SPH_C32(0xf3b128a3), SPH_C32(0x6c507c98), SPH_C32(0x6314978a), - SPH_C32(0xeba57454) }, - { SPH_C32(0x97140003), SPH_C32(0x660ee700), SPH_C32(0xc9230000), - SPH_C32(0xde5a0000), SPH_C32(0xd80e248f), SPH_C32(0xb07a492e), - SPH_C32(0x30f81c8a), SPH_C32(0x4ff560df), SPH_C32(0x941e0001), - SPH_C32(0xf0a47c00), SPH_C32(0xcec20000), SPH_C32(0x52180000), - SPH_C32(0xc01b18b9), SPH_C32(0x79d2598c), SPH_C32(0xf6b7dcf1), - SPH_C32(0x5fee74c4) }, - { SPH_C32(0x9b660003), SPH_C32(0x2febe800), SPH_C32(0x8b5a0000), - SPH_C32(0x82b00000), SPH_C32(0xeba41495), SPH_C32(0xa5f86c3a), - SPH_C32(0xa55b57f1), SPH_C32(0xfbbe604f), SPH_C32(0x6a3c0001), - SPH_C32(0x57fc7900), SPH_C32(0xeb130000), SPH_C32(0xa5780000), - SPH_C32(0x492a6063), SPH_C32(0x6606a1ec), SPH_C32(0xb8677fe4), - SPH_C32(0xfecd8b5b) }, - { SPH_C32(0x2c2e0003), SPH_C32(0x64e3f500), SPH_C32(0x15980000), - SPH_C32(0x12720000), SPH_C32(0x4ff34879), SPH_C32(0x8cbd2498), - SPH_C32(0x6894192f), SPH_C32(0x31e56b9f), SPH_C32(0xde730001), - SPH_C32(0x08687000), SPH_C32(0x9ef00000), SPH_C32(0x0c230000), - SPH_C32(0x580131d5), SPH_C32(0xddcc75bd), SPH_C32(0x4be02289), - SPH_C32(0x8f4760f5) }, - { SPH_C32(0x205c0003), SPH_C32(0x2d06fa00), SPH_C32(0x57e10000), - SPH_C32(0x4e980000), SPH_C32(0x7c597863), SPH_C32(0x993f018c), - SPH_C32(0xfd375254), SPH_C32(0x85ae6b0f), SPH_C32(0x20510001), - SPH_C32(0xaf307500), SPH_C32(0xbb210000), SPH_C32(0xfb430000), - SPH_C32(0xd130490f), SPH_C32(0xc2188ddd), SPH_C32(0x0530819c), - SPH_C32(0x2e649f6a) }, - { SPH_C32(0xd20c0003), SPH_C32(0xc3bbf000), SPH_C32(0x30490000), - SPH_C32(0xe5120000), SPH_C32(0xc6c230a3), SPH_C32(0x9369dcf8), - SPH_C32(0x2644ba3a), SPH_C32(0x90c69400), SPH_C32(0x2c230001), - SPH_C32(0xe6d57a00), SPH_C32(0xf9580000), SPH_C32(0xa7a90000), - SPH_C32(0xe29a7915), SPH_C32(0xd79aa8c9), SPH_C32(0x9093cae7), - SPH_C32(0x9a2f9ffa) }, - { SPH_C32(0xde7e0003), SPH_C32(0x8a5eff00), SPH_C32(0x72300000), - SPH_C32(0xb9f80000), SPH_C32(0xf56800b9), SPH_C32(0x86ebf9ec), - SPH_C32(0xb3e7f141), SPH_C32(0x248d9490), SPH_C32(0xd2010001), - SPH_C32(0x418d7f00), SPH_C32(0xdc890000), SPH_C32(0x50c90000), - SPH_C32(0x6bab01cf), SPH_C32(0xc84e50a9), SPH_C32(0xde4369f2), - SPH_C32(0x3b0c6065) }, - { SPH_C32(0xeecf0001), SPH_C32(0x6f564000), SPH_C32(0xf33e0000), - SPH_C32(0xa79e0000), SPH_C32(0xbdb57219), SPH_C32(0xb711ebc5), - SPH_C32(0x4a3b40ba), SPH_C32(0xfeabf254), SPH_C32(0x9b060002), - SPH_C32(0x61468000), SPH_C32(0x221e0000), SPH_C32(0x1d740000), - SPH_C32(0x36715d27), SPH_C32(0x30495c92), SPH_C32(0xf11336a7), - SPH_C32(0xfe1cdc7f) }, - { SPH_C32(0xe2bd0001), SPH_C32(0x26b34f00), SPH_C32(0xb1470000), - SPH_C32(0xfb740000), SPH_C32(0x8e1f4203), SPH_C32(0xa293ced1), - SPH_C32(0xdf980bc1), SPH_C32(0x4ae0f2c4), SPH_C32(0x65240002), - SPH_C32(0xc61e8500), SPH_C32(0x07cf0000), SPH_C32(0xea140000), - SPH_C32(0xbf4025fd), SPH_C32(0x2f9da4f2), SPH_C32(0xbfc395b2), - SPH_C32(0x5f3f23e0) }, - { SPH_C32(0x10ed0001), SPH_C32(0xc80e4500), SPH_C32(0xd6ef0000), - SPH_C32(0x50fe0000), SPH_C32(0x34840ac3), SPH_C32(0xa8c513a5), - SPH_C32(0x04ebe3af), SPH_C32(0x5f880dcb), SPH_C32(0x69560002), - SPH_C32(0x8ffb8a00), SPH_C32(0x45b60000), SPH_C32(0xb6fe0000), - SPH_C32(0x8cea15e7), SPH_C32(0x3a1f81e6), SPH_C32(0x2a60dec9), - SPH_C32(0xeb742370) }, - { SPH_C32(0x1c9f0001), SPH_C32(0x81eb4a00), SPH_C32(0x94960000), - SPH_C32(0x0c140000), SPH_C32(0x072e3ad9), SPH_C32(0xbd4736b1), - SPH_C32(0x9148a8d4), SPH_C32(0xebc30d5b), SPH_C32(0x97740002), - SPH_C32(0x28a38f00), SPH_C32(0x60670000), SPH_C32(0x419e0000), - SPH_C32(0x05db6d3d), SPH_C32(0x25cb7986), SPH_C32(0x64b07ddc), - SPH_C32(0x4a57dcef) }, - { SPH_C32(0xabd70001), SPH_C32(0xcae35700), SPH_C32(0x0a540000), - SPH_C32(0x9cd60000), SPH_C32(0xa3796635), SPH_C32(0x94027e13), - SPH_C32(0x5c87e60a), SPH_C32(0x2198068b), SPH_C32(0x233b0002), - SPH_C32(0x77378600), SPH_C32(0x15840000), SPH_C32(0xe8c50000), - SPH_C32(0x14f03c8b), SPH_C32(0x9e01add7), SPH_C32(0x973720b1), - SPH_C32(0x3bdd3741) }, - { SPH_C32(0xa7a50001), SPH_C32(0x83065800), SPH_C32(0x482d0000), - SPH_C32(0xc03c0000), SPH_C32(0x90d3562f), SPH_C32(0x81805b07), - SPH_C32(0xc924ad71), SPH_C32(0x95d3061b), SPH_C32(0xdd190002), - SPH_C32(0xd06f8300), SPH_C32(0x30550000), SPH_C32(0x1fa50000), - SPH_C32(0x9dc14451), SPH_C32(0x81d555b7), SPH_C32(0xd9e783a4), - SPH_C32(0x9afec8de) }, - { SPH_C32(0x55f50001), SPH_C32(0x6dbb5200), SPH_C32(0x2f850000), - SPH_C32(0x6bb60000), SPH_C32(0x2a481eef), SPH_C32(0x8bd68673), - SPH_C32(0x1257451f), SPH_C32(0x80bbf914), SPH_C32(0xd16b0002), - SPH_C32(0x998a8c00), SPH_C32(0x722c0000), SPH_C32(0x434f0000), - SPH_C32(0xae6b744b), SPH_C32(0x945770a3), SPH_C32(0x4c44c8df), - SPH_C32(0x2eb5c84e) }, - { SPH_C32(0x59870001), SPH_C32(0x245e5d00), SPH_C32(0x6dfc0000), - SPH_C32(0x375c0000), SPH_C32(0x19e22ef5), SPH_C32(0x9e54a367), - SPH_C32(0x87f40e64), SPH_C32(0x34f0f984), SPH_C32(0x2f490002), - SPH_C32(0x3ed28900), SPH_C32(0x57fd0000), SPH_C32(0xb42f0000), - SPH_C32(0x275a0c91), SPH_C32(0x8b8388c3), SPH_C32(0x02946bca), - SPH_C32(0x8f9637d1) }, - { SPH_C32(0x56f20001), SPH_C32(0x79274600), SPH_C32(0xc4a40000), - SPH_C32(0x522f0000), SPH_C32(0x9f3413b5), SPH_C32(0x19591a80), - SPH_C32(0x2c1f56ac), SPH_C32(0x3b6a196a), SPH_C32(0x66230002), - SPH_C32(0xd2829100), SPH_C32(0xecee0000), SPH_C32(0xd38d0000), - SPH_C32(0x0a3c28a7), SPH_C32(0xbd123801), SPH_C32(0x818b8601), - SPH_C32(0xe4eec39e) }, - { SPH_C32(0x5a800001), SPH_C32(0x30c24900), SPH_C32(0x86dd0000), - SPH_C32(0x0ec50000), SPH_C32(0xac9e23af), SPH_C32(0x0cdb3f94), - SPH_C32(0xb9bc1dd7), SPH_C32(0x8f2119fa), SPH_C32(0x98010002), - SPH_C32(0x75da9400), SPH_C32(0xc93f0000), SPH_C32(0x24ed0000), - SPH_C32(0x830d507d), SPH_C32(0xa2c6c061), SPH_C32(0xcf5b2514), - SPH_C32(0x45cd3c01) }, - { SPH_C32(0xa8d00001), SPH_C32(0xde7f4300), SPH_C32(0xe1750000), - SPH_C32(0xa54f0000), SPH_C32(0x16056b6f), SPH_C32(0x068de2e0), - SPH_C32(0x62cff5b9), SPH_C32(0x9a49e6f5), SPH_C32(0x94730002), - SPH_C32(0x3c3f9b00), SPH_C32(0x8b460000), SPH_C32(0x78070000), - SPH_C32(0xb0a76067), SPH_C32(0xb744e575), SPH_C32(0x5af86e6f), - SPH_C32(0xf1863c91) }, - { SPH_C32(0xa4a20001), SPH_C32(0x979a4c00), SPH_C32(0xa30c0000), - SPH_C32(0xf9a50000), SPH_C32(0x25af5b75), SPH_C32(0x130fc7f4), - SPH_C32(0xf76cbec2), SPH_C32(0x2e02e665), SPH_C32(0x6a510002), - SPH_C32(0x9b679e00), SPH_C32(0xae970000), SPH_C32(0x8f670000), - SPH_C32(0x399618bd), SPH_C32(0xa8901d15), SPH_C32(0x1428cd7a), - SPH_C32(0x50a5c30e) }, - { SPH_C32(0x13ea0001), SPH_C32(0xdc925100), SPH_C32(0x3dce0000), - SPH_C32(0x69670000), SPH_C32(0x81f80799), SPH_C32(0x3a4a8f56), - SPH_C32(0x3aa3f01c), SPH_C32(0xe459edb5), SPH_C32(0xde1e0002), - SPH_C32(0xc4f39700), SPH_C32(0xdb740000), SPH_C32(0x263c0000), - SPH_C32(0x28bd490b), SPH_C32(0x135ac944), SPH_C32(0xe7af9017), - SPH_C32(0x212f28a0) }, - { SPH_C32(0x1f980001), SPH_C32(0x95775e00), SPH_C32(0x7fb70000), - SPH_C32(0x358d0000), SPH_C32(0xb2523783), SPH_C32(0x2fc8aa42), - SPH_C32(0xaf00bb67), SPH_C32(0x5012ed25), SPH_C32(0x203c0002), - SPH_C32(0x63ab9200), SPH_C32(0xfea50000), SPH_C32(0xd15c0000), - SPH_C32(0xa18c31d1), SPH_C32(0x0c8e3124), SPH_C32(0xa97f3302), - SPH_C32(0x800cd73f) }, - { SPH_C32(0xedc80001), SPH_C32(0x7bca5400), SPH_C32(0x181f0000), - SPH_C32(0x9e070000), SPH_C32(0x08c97f43), SPH_C32(0x259e7736), - SPH_C32(0x74735309), SPH_C32(0x457a122a), SPH_C32(0x2c4e0002), - SPH_C32(0x2a4e9d00), SPH_C32(0xbcdc0000), SPH_C32(0x8db60000), - SPH_C32(0x922601cb), SPH_C32(0x190c1430), SPH_C32(0x3cdc7879), - SPH_C32(0x3447d7af) }, - { SPH_C32(0xe1ba0001), SPH_C32(0x322f5b00), SPH_C32(0x5a660000), - SPH_C32(0xc2ed0000), SPH_C32(0x3b634f59), SPH_C32(0x301c5222), - SPH_C32(0xe1d01872), SPH_C32(0xf13112ba), SPH_C32(0xd26c0002), - SPH_C32(0x8d169800), SPH_C32(0x990d0000), SPH_C32(0x7ad60000), - SPH_C32(0x1b177911), SPH_C32(0x06d8ec50), SPH_C32(0x720cdb6c), - SPH_C32(0x95642830) }, - { SPH_C32(0x9b6b0001), SPH_C32(0xaddd6700), SPH_C32(0x679a0000), - SPH_C32(0x376b0000), SPH_C32(0x46cd25f9), SPH_C32(0xfedfe06b), - SPH_C32(0x5d5c8439), SPH_C32(0x5074942a), SPH_C32(0x4a600002), - SPH_C32(0x7afa8300), SPH_C32(0xbcf20000), SPH_C32(0xebe00000), - SPH_C32(0x35731800), SPH_C32(0xff39a060), SPH_C32(0x45502db0), - SPH_C32(0x7b63e054) }, - { SPH_C32(0x97190001), SPH_C32(0xe4386800), SPH_C32(0x25e30000), - SPH_C32(0x6b810000), SPH_C32(0x756715e3), SPH_C32(0xeb5dc57f), - SPH_C32(0xc8ffcf42), SPH_C32(0xe43f94ba), SPH_C32(0xb4420002), - SPH_C32(0xdda28600), SPH_C32(0x99230000), SPH_C32(0x1c800000), - SPH_C32(0xbc4260da), SPH_C32(0xe0ed5800), SPH_C32(0x0b808ea5), - SPH_C32(0xda401fcb) }, - { SPH_C32(0x65490001), SPH_C32(0x0a856200), SPH_C32(0x424b0000), - SPH_C32(0xc00b0000), SPH_C32(0xcffc5d23), SPH_C32(0xe10b180b), - SPH_C32(0x138c272c), SPH_C32(0xf1576bb5), SPH_C32(0xb8300002), - SPH_C32(0x94478900), SPH_C32(0xdb5a0000), SPH_C32(0x406a0000), - SPH_C32(0x8fe850c0), SPH_C32(0xf56f7d14), SPH_C32(0x9e23c5de), - SPH_C32(0x6e0b1f5b) }, - { SPH_C32(0x693b0001), SPH_C32(0x43606d00), SPH_C32(0x00320000), - SPH_C32(0x9ce10000), SPH_C32(0xfc566d39), SPH_C32(0xf4893d1f), - SPH_C32(0x862f6c57), SPH_C32(0x451c6b25), SPH_C32(0x46120002), - SPH_C32(0x331f8c00), SPH_C32(0xfe8b0000), SPH_C32(0xb70a0000), - SPH_C32(0x06d9281a), SPH_C32(0xeabb8574), SPH_C32(0xd0f366cb), - SPH_C32(0xcf28e0c4) }, - { SPH_C32(0xde730001), SPH_C32(0x08687000), SPH_C32(0x9ef00000), - SPH_C32(0x0c230000), SPH_C32(0x580131d5), SPH_C32(0xddcc75bd), - SPH_C32(0x4be02289), SPH_C32(0x8f4760f5), SPH_C32(0xf25d0002), - SPH_C32(0x6c8b8500), SPH_C32(0x8b680000), SPH_C32(0x1e510000), - SPH_C32(0x17f279ac), SPH_C32(0x51715125), SPH_C32(0x23743ba6), - SPH_C32(0xbea20b6a) }, - { SPH_C32(0xd2010001), SPH_C32(0x418d7f00), SPH_C32(0xdc890000), - SPH_C32(0x50c90000), SPH_C32(0x6bab01cf), SPH_C32(0xc84e50a9), - SPH_C32(0xde4369f2), SPH_C32(0x3b0c6065), SPH_C32(0x0c7f0002), - SPH_C32(0xcbd38000), SPH_C32(0xaeb90000), SPH_C32(0xe9310000), - SPH_C32(0x9ec30176), SPH_C32(0x4ea5a945), SPH_C32(0x6da498b3), - SPH_C32(0x1f81f4f5) }, - { SPH_C32(0x20510001), SPH_C32(0xaf307500), SPH_C32(0xbb210000), - SPH_C32(0xfb430000), SPH_C32(0xd130490f), SPH_C32(0xc2188ddd), - SPH_C32(0x0530819c), SPH_C32(0x2e649f6a), SPH_C32(0x000d0002), - SPH_C32(0x82368f00), SPH_C32(0xecc00000), SPH_C32(0xb5db0000), - SPH_C32(0xad69316c), SPH_C32(0x5b278c51), SPH_C32(0xf807d3c8), - SPH_C32(0xabcaf465) }, - { SPH_C32(0x2c230001), SPH_C32(0xe6d57a00), SPH_C32(0xf9580000), - SPH_C32(0xa7a90000), SPH_C32(0xe29a7915), SPH_C32(0xd79aa8c9), - SPH_C32(0x9093cae7), SPH_C32(0x9a2f9ffa), SPH_C32(0xfe2f0002), - SPH_C32(0x256e8a00), SPH_C32(0xc9110000), SPH_C32(0x42bb0000), - SPH_C32(0x245849b6), SPH_C32(0x44f37431), SPH_C32(0xb6d770dd), - SPH_C32(0x0ae90bfa) }, - { SPH_C32(0x23560001), SPH_C32(0xbbac6100), SPH_C32(0x50000000), - SPH_C32(0xc2da0000), SPH_C32(0x644c4455), SPH_C32(0x5097112e), - SPH_C32(0x3b78922f), SPH_C32(0x95b57f14), SPH_C32(0xb7450002), - SPH_C32(0xc93e9200), SPH_C32(0x72020000), SPH_C32(0x25190000), - SPH_C32(0x093e6d80), SPH_C32(0x7262c4f3), SPH_C32(0x35c89d16), - SPH_C32(0x6191ffb5) }, - { SPH_C32(0x2f240001), SPH_C32(0xf2496e00), SPH_C32(0x12790000), - SPH_C32(0x9e300000), SPH_C32(0x57e6744f), SPH_C32(0x4515343a), - SPH_C32(0xaedbd954), SPH_C32(0x21fe7f84), SPH_C32(0x49670002), - SPH_C32(0x6e669700), SPH_C32(0x57d30000), SPH_C32(0xd2790000), - SPH_C32(0x800f155a), SPH_C32(0x6db63c93), SPH_C32(0x7b183e03), - SPH_C32(0xc0b2002a) }, - { SPH_C32(0xdd740001), SPH_C32(0x1cf46400), SPH_C32(0x75d10000), - SPH_C32(0x35ba0000), SPH_C32(0xed7d3c8f), SPH_C32(0x4f43e94e), - SPH_C32(0x75a8313a), SPH_C32(0x3496808b), SPH_C32(0x45150002), - SPH_C32(0x27839800), SPH_C32(0x15aa0000), SPH_C32(0x8e930000), - SPH_C32(0xb3a52540), SPH_C32(0x78341987), SPH_C32(0xeebb7578), - SPH_C32(0x74f900ba) }, - { SPH_C32(0xd1060001), SPH_C32(0x55116b00), SPH_C32(0x37a80000), - SPH_C32(0x69500000), SPH_C32(0xded70c95), SPH_C32(0x5ac1cc5a), - SPH_C32(0xe00b7a41), SPH_C32(0x80dd801b), SPH_C32(0xbb370002), - SPH_C32(0x80db9d00), SPH_C32(0x307b0000), SPH_C32(0x79f30000), - SPH_C32(0x3a945d9a), SPH_C32(0x67e0e1e7), SPH_C32(0xa06bd66d), - SPH_C32(0xd5daff25) }, - { SPH_C32(0x664e0001), SPH_C32(0x1e197600), SPH_C32(0xa96a0000), - SPH_C32(0xf9920000), SPH_C32(0x7a805079), SPH_C32(0x738484f8), - SPH_C32(0x2dc4349f), SPH_C32(0x4a868bcb), SPH_C32(0x0f780002), - SPH_C32(0xdf4f9400), SPH_C32(0x45980000), SPH_C32(0xd0a80000), - SPH_C32(0x2bbf0c2c), SPH_C32(0xdc2a35b6), SPH_C32(0x53ec8b00), - SPH_C32(0xa450148b) }, - { SPH_C32(0x6a3c0001), SPH_C32(0x57fc7900), SPH_C32(0xeb130000), - SPH_C32(0xa5780000), SPH_C32(0x492a6063), SPH_C32(0x6606a1ec), - SPH_C32(0xb8677fe4), SPH_C32(0xfecd8b5b), SPH_C32(0xf15a0002), - SPH_C32(0x78179100), SPH_C32(0x60490000), SPH_C32(0x27c80000), - SPH_C32(0xa28e74f6), SPH_C32(0xc3fecdd6), SPH_C32(0x1d3c2815), - SPH_C32(0x0573eb14) }, - { SPH_C32(0x986c0001), SPH_C32(0xb9417300), SPH_C32(0x8cbb0000), - SPH_C32(0x0ef20000), SPH_C32(0xf3b128a3), SPH_C32(0x6c507c98), - SPH_C32(0x6314978a), SPH_C32(0xeba57454), SPH_C32(0xfd280002), - SPH_C32(0x31f29e00), SPH_C32(0x22300000), SPH_C32(0x7b220000), - SPH_C32(0x912444ec), SPH_C32(0xd67ce8c2), SPH_C32(0x889f636e), - SPH_C32(0xb138eb84) }, - { SPH_C32(0x941e0001), SPH_C32(0xf0a47c00), SPH_C32(0xcec20000), - SPH_C32(0x52180000), SPH_C32(0xc01b18b9), SPH_C32(0x79d2598c), - SPH_C32(0xf6b7dcf1), SPH_C32(0x5fee74c4), SPH_C32(0x030a0002), - SPH_C32(0x96aa9b00), SPH_C32(0x07e10000), SPH_C32(0x8c420000), - SPH_C32(0x18153c36), SPH_C32(0xc9a810a2), SPH_C32(0xc64fc07b), - SPH_C32(0x101b141b) }, - { SPH_C32(0x3fa90001), SPH_C32(0x74ea4300), SPH_C32(0x6dd20000), - SPH_C32(0x510a0000), SPH_C32(0xbeb7373e), SPH_C32(0x78611737), - SPH_C32(0xfe785bad), SPH_C32(0x7bd4ce7f), SPH_C32(0x3fc40002), - SPH_C32(0xb871a400), SPH_C32(0x28560000), SPH_C32(0x7b150000), - SPH_C32(0xce0b4fe0), SPH_C32(0xb6f7abce), SPH_C32(0x5237e933), - SPH_C32(0xd5bc862a) }, - { SPH_C32(0x33db0001), SPH_C32(0x3d0f4c00), SPH_C32(0x2fab0000), - SPH_C32(0x0de00000), SPH_C32(0x8d1d0724), SPH_C32(0x6de33223), - SPH_C32(0x6bdb10d6), SPH_C32(0xcf9fceef), SPH_C32(0xc1e60002), - SPH_C32(0x1f29a100), SPH_C32(0x0d870000), SPH_C32(0x8c750000), - SPH_C32(0x473a373a), SPH_C32(0xa92353ae), SPH_C32(0x1ce74a26), - SPH_C32(0x749f79b5) }, - { SPH_C32(0xc18b0001), SPH_C32(0xd3b24600), SPH_C32(0x48030000), - SPH_C32(0xa66a0000), SPH_C32(0x37864fe4), SPH_C32(0x67b5ef57), - SPH_C32(0xb0a8f8b8), SPH_C32(0xdaf731e0), SPH_C32(0xcd940002), - SPH_C32(0x56ccae00), SPH_C32(0x4ffe0000), SPH_C32(0xd09f0000), - SPH_C32(0x74900720), SPH_C32(0xbca176ba), SPH_C32(0x8944015d), - SPH_C32(0xc0d47925) }, - { SPH_C32(0xcdf90001), SPH_C32(0x9a574900), SPH_C32(0x0a7a0000), - SPH_C32(0xfa800000), SPH_C32(0x042c7ffe), SPH_C32(0x7237ca43), - SPH_C32(0x250bb3c3), SPH_C32(0x6ebc3170), SPH_C32(0x33b60002), - SPH_C32(0xf194ab00), SPH_C32(0x6a2f0000), SPH_C32(0x27ff0000), - SPH_C32(0xfda17ffa), SPH_C32(0xa3758eda), SPH_C32(0xc794a248), - SPH_C32(0x61f786ba) }, - { SPH_C32(0x7ab10001), SPH_C32(0xd15f5400), SPH_C32(0x94b80000), - SPH_C32(0x6a420000), SPH_C32(0xa07b2312), SPH_C32(0x5b7282e1), - SPH_C32(0xe8c4fd1d), SPH_C32(0xa4e73aa0), SPH_C32(0x87f90002), - SPH_C32(0xae00a200), SPH_C32(0x1fcc0000), SPH_C32(0x8ea40000), - SPH_C32(0xec8a2e4c), SPH_C32(0x18bf5a8b), SPH_C32(0x3413ff25), - SPH_C32(0x107d6d14) }, - { SPH_C32(0x76c30001), SPH_C32(0x98ba5b00), SPH_C32(0xd6c10000), - SPH_C32(0x36a80000), SPH_C32(0x93d11308), SPH_C32(0x4ef0a7f5), - SPH_C32(0x7d67b666), SPH_C32(0x10ac3a30), SPH_C32(0x79db0002), - SPH_C32(0x0958a700), SPH_C32(0x3a1d0000), SPH_C32(0x79c40000), - SPH_C32(0x65bb5696), SPH_C32(0x076ba2eb), SPH_C32(0x7ac35c30), - SPH_C32(0xb15e928b) }, - { SPH_C32(0x84930001), SPH_C32(0x76075100), SPH_C32(0xb1690000), - SPH_C32(0x9d220000), SPH_C32(0x294a5bc8), SPH_C32(0x44a67a81), - SPH_C32(0xa6145e08), SPH_C32(0x05c4c53f), SPH_C32(0x75a90002), - SPH_C32(0x40bda800), SPH_C32(0x78640000), SPH_C32(0x252e0000), - SPH_C32(0x5611668c), SPH_C32(0x12e987ff), SPH_C32(0xef60174b), - SPH_C32(0x0515921b) }, - { SPH_C32(0x88e10001), SPH_C32(0x3fe25e00), SPH_C32(0xf3100000), - SPH_C32(0xc1c80000), SPH_C32(0x1ae06bd2), SPH_C32(0x51245f95), - SPH_C32(0x33b71573), SPH_C32(0xb18fc5af), SPH_C32(0x8b8b0002), - SPH_C32(0xe7e5ad00), SPH_C32(0x5db50000), SPH_C32(0xd24e0000), - SPH_C32(0xdf201e56), SPH_C32(0x0d3d7f9f), SPH_C32(0xa1b0b45e), - SPH_C32(0xa4366d84) }, - { SPH_C32(0x87940001), SPH_C32(0x629b4500), SPH_C32(0x5a480000), - SPH_C32(0xa4bb0000), SPH_C32(0x9c365692), SPH_C32(0xd629e672), - SPH_C32(0x985c4dbb), SPH_C32(0xbe152541), SPH_C32(0xc2e10002), - SPH_C32(0x0bb5b500), SPH_C32(0xe6a60000), SPH_C32(0xb5ec0000), - SPH_C32(0xf2463a60), SPH_C32(0x3baccf5d), SPH_C32(0x22af5995), - SPH_C32(0xcf4e99cb) }, - { SPH_C32(0x8be60001), SPH_C32(0x2b7e4a00), SPH_C32(0x18310000), - SPH_C32(0xf8510000), SPH_C32(0xaf9c6688), SPH_C32(0xc3abc366), - SPH_C32(0x0dff06c0), SPH_C32(0x0a5e25d1), SPH_C32(0x3cc30002), - SPH_C32(0xacedb000), SPH_C32(0xc3770000), SPH_C32(0x428c0000), - SPH_C32(0x7b7742ba), SPH_C32(0x2478373d), SPH_C32(0x6c7ffa80), - SPH_C32(0x6e6d6654) }, - { SPH_C32(0x79b60001), SPH_C32(0xc5c34000), SPH_C32(0x7f990000), - SPH_C32(0x53db0000), SPH_C32(0x15072e48), SPH_C32(0xc9fd1e12), - SPH_C32(0xd68ceeae), SPH_C32(0x1f36dade), SPH_C32(0x30b10002), - SPH_C32(0xe508bf00), SPH_C32(0x810e0000), SPH_C32(0x1e660000), - SPH_C32(0x48dd72a0), SPH_C32(0x31fa1229), SPH_C32(0xf9dcb1fb), - SPH_C32(0xda2666c4) }, - { SPH_C32(0x75c40001), SPH_C32(0x8c264f00), SPH_C32(0x3de00000), - SPH_C32(0x0f310000), SPH_C32(0x26ad1e52), SPH_C32(0xdc7f3b06), - SPH_C32(0x432fa5d5), SPH_C32(0xab7dda4e), SPH_C32(0xce930002), - SPH_C32(0x4250ba00), SPH_C32(0xa4df0000), SPH_C32(0xe9060000), - SPH_C32(0xc1ec0a7a), SPH_C32(0x2e2eea49), SPH_C32(0xb70c12ee), - SPH_C32(0x7b05995b) }, - { SPH_C32(0xc28c0001), SPH_C32(0xc72e5200), SPH_C32(0xa3220000), - SPH_C32(0x9ff30000), SPH_C32(0x82fa42be), SPH_C32(0xf53a73a4), - SPH_C32(0x8ee0eb0b), SPH_C32(0x6126d19e), SPH_C32(0x7adc0002), - SPH_C32(0x1dc4b300), SPH_C32(0xd13c0000), SPH_C32(0x405d0000), - SPH_C32(0xd0c75bcc), SPH_C32(0x95e43e18), SPH_C32(0x448b4f83), - SPH_C32(0x0a8f72f5) }, - { SPH_C32(0xcefe0001), SPH_C32(0x8ecb5d00), SPH_C32(0xe15b0000), - SPH_C32(0xc3190000), SPH_C32(0xb15072a4), SPH_C32(0xe0b856b0), - SPH_C32(0x1b43a070), SPH_C32(0xd56dd10e), SPH_C32(0x84fe0002), - SPH_C32(0xba9cb600), SPH_C32(0xf4ed0000), SPH_C32(0xb73d0000), - SPH_C32(0x59f62316), SPH_C32(0x8a30c678), SPH_C32(0x0a5bec96), - SPH_C32(0xabac8d6a) }, - { SPH_C32(0x3cae0001), SPH_C32(0x60765700), SPH_C32(0x86f30000), - SPH_C32(0x68930000), SPH_C32(0x0bcb3a64), SPH_C32(0xeaee8bc4), - SPH_C32(0xc030481e), SPH_C32(0xc0052e01), SPH_C32(0x888c0002), - SPH_C32(0xf379b900), SPH_C32(0xb6940000), SPH_C32(0xebd70000), - SPH_C32(0x6a5c130c), SPH_C32(0x9fb2e36c), SPH_C32(0x9ff8a7ed), - SPH_C32(0x1fe78dfa) }, - { SPH_C32(0x30dc0001), SPH_C32(0x29935800), SPH_C32(0xc48a0000), - SPH_C32(0x34790000), SPH_C32(0x38610a7e), SPH_C32(0xff6caed0), - SPH_C32(0x55930365), SPH_C32(0x744e2e91), SPH_C32(0x76ae0002), - SPH_C32(0x5421bc00), SPH_C32(0x93450000), SPH_C32(0x1cb70000), - SPH_C32(0xe36d6bd6), SPH_C32(0x80661b0c), SPH_C32(0xd12804f8), - SPH_C32(0xbec47265) }, - { SPH_C32(0x4a0d0001), SPH_C32(0xb6616400), SPH_C32(0xf9760000), - SPH_C32(0xc1ff0000), SPH_C32(0x45cf60de), SPH_C32(0x31af1c99), - SPH_C32(0xe91f9f2e), SPH_C32(0xd50ba801), SPH_C32(0xeea20002), - SPH_C32(0xa3cda700), SPH_C32(0xb6ba0000), SPH_C32(0x8d810000), - SPH_C32(0xcd090ac7), SPH_C32(0x7987573c), SPH_C32(0xe674f224), - SPH_C32(0x50c3ba01) }, - { SPH_C32(0x467f0001), SPH_C32(0xff846b00), SPH_C32(0xbb0f0000), - SPH_C32(0x9d150000), SPH_C32(0x766550c4), SPH_C32(0x242d398d), - SPH_C32(0x7cbcd455), SPH_C32(0x6140a891), SPH_C32(0x10800002), - SPH_C32(0x0495a200), SPH_C32(0x936b0000), SPH_C32(0x7ae10000), - SPH_C32(0x4438721d), SPH_C32(0x6653af5c), SPH_C32(0xa8a45131), - SPH_C32(0xf1e0459e) }, - { SPH_C32(0xb42f0001), SPH_C32(0x11396100), SPH_C32(0xdca70000), - SPH_C32(0x369f0000), SPH_C32(0xccfe1804), SPH_C32(0x2e7be4f9), - SPH_C32(0xa7cf3c3b), SPH_C32(0x7428579e), SPH_C32(0x1cf20002), - SPH_C32(0x4d70ad00), SPH_C32(0xd1120000), SPH_C32(0x260b0000), - SPH_C32(0x77924207), SPH_C32(0x73d18a48), SPH_C32(0x3d071a4a), - SPH_C32(0x45ab450e) }, - { SPH_C32(0xb85d0001), SPH_C32(0x58dc6e00), SPH_C32(0x9ede0000), - SPH_C32(0x6a750000), SPH_C32(0xff54281e), SPH_C32(0x3bf9c1ed), - SPH_C32(0x326c7740), SPH_C32(0xc063570e), SPH_C32(0xe2d00002), - SPH_C32(0xea28a800), SPH_C32(0xf4c30000), SPH_C32(0xd16b0000), - SPH_C32(0xfea33add), SPH_C32(0x6c057228), SPH_C32(0x73d7b95f), - SPH_C32(0xe488ba91) }, - { SPH_C32(0x0f150001), SPH_C32(0x13d47300), SPH_C32(0x001c0000), - SPH_C32(0xfab70000), SPH_C32(0x5b0374f2), SPH_C32(0x12bc894f), - SPH_C32(0xffa3399e), SPH_C32(0x0a385cde), SPH_C32(0x569f0002), - SPH_C32(0xb5bca100), SPH_C32(0x81200000), SPH_C32(0x78300000), - SPH_C32(0xef886b6b), SPH_C32(0xd7cfa679), SPH_C32(0x8050e432), - SPH_C32(0x9502513f) }, - { SPH_C32(0x03670001), SPH_C32(0x5a317c00), SPH_C32(0x42650000), - SPH_C32(0xa65d0000), SPH_C32(0x68a944e8), SPH_C32(0x073eac5b), - SPH_C32(0x6a0072e5), SPH_C32(0xbe735c4e), SPH_C32(0xa8bd0002), - SPH_C32(0x12e4a400), SPH_C32(0xa4f10000), SPH_C32(0x8f500000), - SPH_C32(0x66b913b1), SPH_C32(0xc81b5e19), SPH_C32(0xce804727), - SPH_C32(0x3421aea0) }, - { SPH_C32(0xf1370001), SPH_C32(0xb48c7600), SPH_C32(0x25cd0000), - SPH_C32(0x0dd70000), SPH_C32(0xd2320c28), SPH_C32(0x0d68712f), - SPH_C32(0xb1739a8b), SPH_C32(0xab1ba341), SPH_C32(0xa4cf0002), - SPH_C32(0x5b01ab00), SPH_C32(0xe6880000), SPH_C32(0xd3ba0000), - SPH_C32(0x551323ab), SPH_C32(0xdd997b0d), SPH_C32(0x5b230c5c), - SPH_C32(0x806aae30) }, - { SPH_C32(0xfd450001), SPH_C32(0xfd697900), SPH_C32(0x67b40000), - SPH_C32(0x513d0000), SPH_C32(0xe1983c32), SPH_C32(0x18ea543b), - SPH_C32(0x24d0d1f0), SPH_C32(0x1f50a3d1), SPH_C32(0x5aed0002), - SPH_C32(0xfc59ae00), SPH_C32(0xc3590000), SPH_C32(0x24da0000), - SPH_C32(0xdc225b71), SPH_C32(0xc24d836d), SPH_C32(0x15f3af49), - SPH_C32(0x214951af) }, - { SPH_C32(0xf2300001), SPH_C32(0xa0106200), SPH_C32(0xceec0000), - SPH_C32(0x344e0000), SPH_C32(0x674e0172), SPH_C32(0x9fe7eddc), - SPH_C32(0x8f3b8938), SPH_C32(0x10ca433f), SPH_C32(0x13870002), - SPH_C32(0x1009b600), SPH_C32(0x784a0000), SPH_C32(0x43780000), - SPH_C32(0xf1447f47), SPH_C32(0xf4dc33af), SPH_C32(0x96ec4282), - SPH_C32(0x4a31a5e0) }, - { SPH_C32(0xfe420001), SPH_C32(0xe9f56d00), SPH_C32(0x8c950000), - SPH_C32(0x68a40000), SPH_C32(0x54e43168), SPH_C32(0x8a65c8c8), - SPH_C32(0x1a98c243), SPH_C32(0xa48143af), SPH_C32(0xeda50002), - SPH_C32(0xb751b300), SPH_C32(0x5d9b0000), SPH_C32(0xb4180000), - SPH_C32(0x7875079d), SPH_C32(0xeb08cbcf), SPH_C32(0xd83ce197), - SPH_C32(0xeb125a7f) }, - { SPH_C32(0x0c120001), SPH_C32(0x07486700), SPH_C32(0xeb3d0000), - SPH_C32(0xc32e0000), SPH_C32(0xee7f79a8), SPH_C32(0x803315bc), - SPH_C32(0xc1eb2a2d), SPH_C32(0xb1e9bca0), SPH_C32(0xe1d70002), - SPH_C32(0xfeb4bc00), SPH_C32(0x1fe20000), SPH_C32(0xe8f20000), - SPH_C32(0x4bdf3787), SPH_C32(0xfe8aeedb), SPH_C32(0x4d9faaec), - SPH_C32(0x5f595aef) }, - { SPH_C32(0x00600001), SPH_C32(0x4ead6800), SPH_C32(0xa9440000), - SPH_C32(0x9fc40000), SPH_C32(0xddd549b2), SPH_C32(0x95b130a8), - SPH_C32(0x54486156), SPH_C32(0x05a2bc30), SPH_C32(0x1ff50002), - SPH_C32(0x59ecb900), SPH_C32(0x3a330000), SPH_C32(0x1f920000), - SPH_C32(0xc2ee4f5d), SPH_C32(0xe15e16bb), SPH_C32(0x034f09f9), - SPH_C32(0xfe7aa570) }, - { SPH_C32(0xb7280001), SPH_C32(0x05a57500), SPH_C32(0x37860000), - SPH_C32(0x0f060000), SPH_C32(0x7982155e), SPH_C32(0xbcf4780a), - SPH_C32(0x99872f88), SPH_C32(0xcff9b7e0), SPH_C32(0xabba0002), - SPH_C32(0x0678b000), SPH_C32(0x4fd00000), SPH_C32(0xb6c90000), - SPH_C32(0xd3c51eeb), SPH_C32(0x5a94c2ea), SPH_C32(0xf0c85494), - SPH_C32(0x8ff04ede) }, - { SPH_C32(0xbb5a0001), SPH_C32(0x4c407a00), SPH_C32(0x75ff0000), - SPH_C32(0x53ec0000), SPH_C32(0x4a282544), SPH_C32(0xa9765d1e), - SPH_C32(0x0c2464f3), SPH_C32(0x7bb2b770), SPH_C32(0x55980002), - SPH_C32(0xa120b500), SPH_C32(0x6a010000), SPH_C32(0x41a90000), - SPH_C32(0x5af46631), SPH_C32(0x45403a8a), SPH_C32(0xbe18f781), - SPH_C32(0x2ed3b141) }, - { SPH_C32(0x490a0001), SPH_C32(0xa2fd7000), SPH_C32(0x12570000), - SPH_C32(0xf8660000), SPH_C32(0xf0b36d84), SPH_C32(0xa320806a), - SPH_C32(0xd7578c9d), SPH_C32(0x6eda487f), SPH_C32(0x59ea0002), - SPH_C32(0xe8c5ba00), SPH_C32(0x28780000), SPH_C32(0x1d430000), - SPH_C32(0x695e562b), SPH_C32(0x50c21f9e), SPH_C32(0x2bbbbcfa), - SPH_C32(0x9a98b1d1) }, - { SPH_C32(0x45780001), SPH_C32(0xeb187f00), SPH_C32(0x502e0000), - SPH_C32(0xa48c0000), SPH_C32(0xc3195d9e), SPH_C32(0xb6a2a57e), - SPH_C32(0x42f4c7e6), SPH_C32(0xda9148ef), SPH_C32(0xa7c80002), - SPH_C32(0x4f9dbf00), SPH_C32(0x0da90000), SPH_C32(0xea230000), - SPH_C32(0xe06f2ef1), SPH_C32(0x4f16e7fe), SPH_C32(0x656b1fef), - SPH_C32(0x3bbb4e4e) }, - { SPH_C32(0x9b060002), SPH_C32(0x61468000), SPH_C32(0x221e0000), - SPH_C32(0x1d740000), SPH_C32(0x36715d27), SPH_C32(0x30495c92), - SPH_C32(0xf11336a7), SPH_C32(0xfe1cdc7f), SPH_C32(0x75c90003), - SPH_C32(0x0e10c000), SPH_C32(0xd1200000), SPH_C32(0xbaea0000), - SPH_C32(0x8bc42f3e), SPH_C32(0x8758b757), SPH_C32(0xbb28761d), - SPH_C32(0x00b72e2b) }, - { SPH_C32(0x97740002), SPH_C32(0x28a38f00), SPH_C32(0x60670000), - SPH_C32(0x419e0000), SPH_C32(0x05db6d3d), SPH_C32(0x25cb7986), - SPH_C32(0x64b07ddc), SPH_C32(0x4a57dcef), SPH_C32(0x8beb0003), - SPH_C32(0xa948c500), SPH_C32(0xf4f10000), SPH_C32(0x4d8a0000), - SPH_C32(0x02f557e4), SPH_C32(0x988c4f37), SPH_C32(0xf5f8d508), - SPH_C32(0xa194d1b4) }, - { SPH_C32(0x65240002), SPH_C32(0xc61e8500), SPH_C32(0x07cf0000), - SPH_C32(0xea140000), SPH_C32(0xbf4025fd), SPH_C32(0x2f9da4f2), - SPH_C32(0xbfc395b2), SPH_C32(0x5f3f23e0), SPH_C32(0x87990003), - SPH_C32(0xe0adca00), SPH_C32(0xb6880000), SPH_C32(0x11600000), - SPH_C32(0x315f67fe), SPH_C32(0x8d0e6a23), SPH_C32(0x605b9e73), - SPH_C32(0x15dfd124) }, - { SPH_C32(0x69560002), SPH_C32(0x8ffb8a00), SPH_C32(0x45b60000), - SPH_C32(0xb6fe0000), SPH_C32(0x8cea15e7), SPH_C32(0x3a1f81e6), - SPH_C32(0x2a60dec9), SPH_C32(0xeb742370), SPH_C32(0x79bb0003), - SPH_C32(0x47f5cf00), SPH_C32(0x93590000), SPH_C32(0xe6000000), - SPH_C32(0xb86e1f24), SPH_C32(0x92da9243), SPH_C32(0x2e8b3d66), - SPH_C32(0xb4fc2ebb) }, - { SPH_C32(0xde1e0002), SPH_C32(0xc4f39700), SPH_C32(0xdb740000), - SPH_C32(0x263c0000), SPH_C32(0x28bd490b), SPH_C32(0x135ac944), - SPH_C32(0xe7af9017), SPH_C32(0x212f28a0), SPH_C32(0xcdf40003), - SPH_C32(0x1861c600), SPH_C32(0xe6ba0000), SPH_C32(0x4f5b0000), - SPH_C32(0xa9454e92), SPH_C32(0x29104612), SPH_C32(0xdd0c600b), - SPH_C32(0xc576c515) }, - { SPH_C32(0xd26c0002), SPH_C32(0x8d169800), SPH_C32(0x990d0000), - SPH_C32(0x7ad60000), SPH_C32(0x1b177911), SPH_C32(0x06d8ec50), - SPH_C32(0x720cdb6c), SPH_C32(0x95642830), SPH_C32(0x33d60003), - SPH_C32(0xbf39c300), SPH_C32(0xc36b0000), SPH_C32(0xb83b0000), - SPH_C32(0x20743648), SPH_C32(0x36c4be72), SPH_C32(0x93dcc31e), - SPH_C32(0x64553a8a) }, - { SPH_C32(0x203c0002), SPH_C32(0x63ab9200), SPH_C32(0xfea50000), - SPH_C32(0xd15c0000), SPH_C32(0xa18c31d1), SPH_C32(0x0c8e3124), - SPH_C32(0xa97f3302), SPH_C32(0x800cd73f), SPH_C32(0x3fa40003), - SPH_C32(0xf6dccc00), SPH_C32(0x81120000), SPH_C32(0xe4d10000), - SPH_C32(0x13de0652), SPH_C32(0x23469b66), SPH_C32(0x067f8865), - SPH_C32(0xd01e3a1a) }, - { SPH_C32(0x2c4e0002), SPH_C32(0x2a4e9d00), SPH_C32(0xbcdc0000), - SPH_C32(0x8db60000), SPH_C32(0x922601cb), SPH_C32(0x190c1430), - SPH_C32(0x3cdc7879), SPH_C32(0x3447d7af), SPH_C32(0xc1860003), - SPH_C32(0x5184c900), SPH_C32(0xa4c30000), SPH_C32(0x13b10000), - SPH_C32(0x9aef7e88), SPH_C32(0x3c926306), SPH_C32(0x48af2b70), - SPH_C32(0x713dc585) }, - { SPH_C32(0x233b0002), SPH_C32(0x77378600), SPH_C32(0x15840000), - SPH_C32(0xe8c50000), SPH_C32(0x14f03c8b), SPH_C32(0x9e01add7), - SPH_C32(0x973720b1), SPH_C32(0x3bdd3741), SPH_C32(0x88ec0003), - SPH_C32(0xbdd4d100), SPH_C32(0x1fd00000), SPH_C32(0x74130000), - SPH_C32(0xb7895abe), SPH_C32(0x0a03d3c4), SPH_C32(0xcbb0c6bb), - SPH_C32(0x1a4531ca) }, - { SPH_C32(0x2f490002), SPH_C32(0x3ed28900), SPH_C32(0x57fd0000), - SPH_C32(0xb42f0000), SPH_C32(0x275a0c91), SPH_C32(0x8b8388c3), - SPH_C32(0x02946bca), SPH_C32(0x8f9637d1), SPH_C32(0x76ce0003), - SPH_C32(0x1a8cd400), SPH_C32(0x3a010000), SPH_C32(0x83730000), - SPH_C32(0x3eb82264), SPH_C32(0x15d72ba4), SPH_C32(0x856065ae), - SPH_C32(0xbb66ce55) }, - { SPH_C32(0xdd190002), SPH_C32(0xd06f8300), SPH_C32(0x30550000), - SPH_C32(0x1fa50000), SPH_C32(0x9dc14451), SPH_C32(0x81d555b7), - SPH_C32(0xd9e783a4), SPH_C32(0x9afec8de), SPH_C32(0x7abc0003), - SPH_C32(0x5369db00), SPH_C32(0x78780000), SPH_C32(0xdf990000), - SPH_C32(0x0d12127e), SPH_C32(0x00550eb0), SPH_C32(0x10c32ed5), - SPH_C32(0x0f2dcec5) }, - { SPH_C32(0xd16b0002), SPH_C32(0x998a8c00), SPH_C32(0x722c0000), - SPH_C32(0x434f0000), SPH_C32(0xae6b744b), SPH_C32(0x945770a3), - SPH_C32(0x4c44c8df), SPH_C32(0x2eb5c84e), SPH_C32(0x849e0003), - SPH_C32(0xf431de00), SPH_C32(0x5da90000), SPH_C32(0x28f90000), - SPH_C32(0x84236aa4), SPH_C32(0x1f81f6d0), SPH_C32(0x5e138dc0), - SPH_C32(0xae0e315a) }, - { SPH_C32(0x66230002), SPH_C32(0xd2829100), SPH_C32(0xecee0000), - SPH_C32(0xd38d0000), SPH_C32(0x0a3c28a7), SPH_C32(0xbd123801), - SPH_C32(0x818b8601), SPH_C32(0xe4eec39e), SPH_C32(0x30d10003), - SPH_C32(0xaba5d700), SPH_C32(0x284a0000), SPH_C32(0x81a20000), - SPH_C32(0x95083b12), SPH_C32(0xa44b2281), SPH_C32(0xad94d0ad), - SPH_C32(0xdf84daf4) }, - { SPH_C32(0x6a510002), SPH_C32(0x9b679e00), SPH_C32(0xae970000), - SPH_C32(0x8f670000), SPH_C32(0x399618bd), SPH_C32(0xa8901d15), - SPH_C32(0x1428cd7a), SPH_C32(0x50a5c30e), SPH_C32(0xcef30003), - SPH_C32(0x0cfdd200), SPH_C32(0x0d9b0000), SPH_C32(0x76c20000), - SPH_C32(0x1c3943c8), SPH_C32(0xbb9fdae1), SPH_C32(0xe34473b8), - SPH_C32(0x7ea7256b) }, - { SPH_C32(0x98010002), SPH_C32(0x75da9400), SPH_C32(0xc93f0000), - SPH_C32(0x24ed0000), SPH_C32(0x830d507d), SPH_C32(0xa2c6c061), - SPH_C32(0xcf5b2514), SPH_C32(0x45cd3c01), SPH_C32(0xc2810003), - SPH_C32(0x4518dd00), SPH_C32(0x4fe20000), SPH_C32(0x2a280000), - SPH_C32(0x2f9373d2), SPH_C32(0xae1dfff5), SPH_C32(0x76e738c3), - SPH_C32(0xcaec25fb) }, - { SPH_C32(0x94730002), SPH_C32(0x3c3f9b00), SPH_C32(0x8b460000), - SPH_C32(0x78070000), SPH_C32(0xb0a76067), SPH_C32(0xb744e575), - SPH_C32(0x5af86e6f), SPH_C32(0xf1863c91), SPH_C32(0x3ca30003), - SPH_C32(0xe240d800), SPH_C32(0x6a330000), SPH_C32(0xdd480000), - SPH_C32(0xa6a20b08), SPH_C32(0xb1c90795), SPH_C32(0x38379bd6), - SPH_C32(0x6bcfda64) }, - { SPH_C32(0xeea20002), SPH_C32(0xa3cda700), SPH_C32(0xb6ba0000), - SPH_C32(0x8d810000), SPH_C32(0xcd090ac7), SPH_C32(0x7987573c), - SPH_C32(0xe674f224), SPH_C32(0x50c3ba01), SPH_C32(0xa4af0003), - SPH_C32(0x15acc300), SPH_C32(0x4fcc0000), SPH_C32(0x4c7e0000), - SPH_C32(0x88c66a19), SPH_C32(0x48284ba5), SPH_C32(0x0f6b6d0a), - SPH_C32(0x85c81200) }, - { SPH_C32(0xe2d00002), SPH_C32(0xea28a800), SPH_C32(0xf4c30000), - SPH_C32(0xd16b0000), SPH_C32(0xfea33add), SPH_C32(0x6c057228), - SPH_C32(0x73d7b95f), SPH_C32(0xe488ba91), SPH_C32(0x5a8d0003), - SPH_C32(0xb2f4c600), SPH_C32(0x6a1d0000), SPH_C32(0xbb1e0000), - SPH_C32(0x01f712c3), SPH_C32(0x57fcb3c5), SPH_C32(0x41bbce1f), - SPH_C32(0x24ebed9f) }, - { SPH_C32(0x10800002), SPH_C32(0x0495a200), SPH_C32(0x936b0000), - SPH_C32(0x7ae10000), SPH_C32(0x4438721d), SPH_C32(0x6653af5c), - SPH_C32(0xa8a45131), SPH_C32(0xf1e0459e), SPH_C32(0x56ff0003), - SPH_C32(0xfb11c900), SPH_C32(0x28640000), SPH_C32(0xe7f40000), - SPH_C32(0x325d22d9), SPH_C32(0x427e96d1), SPH_C32(0xd4188564), - SPH_C32(0x90a0ed0f) }, - { SPH_C32(0x1cf20002), SPH_C32(0x4d70ad00), SPH_C32(0xd1120000), - SPH_C32(0x260b0000), SPH_C32(0x77924207), SPH_C32(0x73d18a48), - SPH_C32(0x3d071a4a), SPH_C32(0x45ab450e), SPH_C32(0xa8dd0003), - SPH_C32(0x5c49cc00), SPH_C32(0x0db50000), SPH_C32(0x10940000), - SPH_C32(0xbb6c5a03), SPH_C32(0x5daa6eb1), SPH_C32(0x9ac82671), - SPH_C32(0x31831290) }, - { SPH_C32(0xabba0002), SPH_C32(0x0678b000), SPH_C32(0x4fd00000), - SPH_C32(0xb6c90000), SPH_C32(0xd3c51eeb), SPH_C32(0x5a94c2ea), - SPH_C32(0xf0c85494), SPH_C32(0x8ff04ede), SPH_C32(0x1c920003), - SPH_C32(0x03ddc500), SPH_C32(0x78560000), SPH_C32(0xb9cf0000), - SPH_C32(0xaa470bb5), SPH_C32(0xe660bae0), SPH_C32(0x694f7b1c), - SPH_C32(0x4009f93e) }, - { SPH_C32(0xa7c80002), SPH_C32(0x4f9dbf00), SPH_C32(0x0da90000), - SPH_C32(0xea230000), SPH_C32(0xe06f2ef1), SPH_C32(0x4f16e7fe), - SPH_C32(0x656b1fef), SPH_C32(0x3bbb4e4e), SPH_C32(0xe2b00003), - SPH_C32(0xa485c000), SPH_C32(0x5d870000), SPH_C32(0x4eaf0000), - SPH_C32(0x2376736f), SPH_C32(0xf9b44280), SPH_C32(0x279fd809), - SPH_C32(0xe12a06a1) }, - { SPH_C32(0x55980002), SPH_C32(0xa120b500), SPH_C32(0x6a010000), - SPH_C32(0x41a90000), SPH_C32(0x5af46631), SPH_C32(0x45403a8a), - SPH_C32(0xbe18f781), SPH_C32(0x2ed3b141), SPH_C32(0xeec20003), - SPH_C32(0xed60cf00), SPH_C32(0x1ffe0000), SPH_C32(0x12450000), - SPH_C32(0x10dc4375), SPH_C32(0xec366794), SPH_C32(0xb23c9372), - SPH_C32(0x55610631) }, - { SPH_C32(0x59ea0002), SPH_C32(0xe8c5ba00), SPH_C32(0x28780000), - SPH_C32(0x1d430000), SPH_C32(0x695e562b), SPH_C32(0x50c21f9e), - SPH_C32(0x2bbbbcfa), SPH_C32(0x9a98b1d1), SPH_C32(0x10e00003), - SPH_C32(0x4a38ca00), SPH_C32(0x3a2f0000), SPH_C32(0xe5250000), - SPH_C32(0x99ed3baf), SPH_C32(0xf3e29ff4), SPH_C32(0xfcec3067), - SPH_C32(0xf442f9ae) }, - { SPH_C32(0x569f0002), SPH_C32(0xb5bca100), SPH_C32(0x81200000), - SPH_C32(0x78300000), SPH_C32(0xef886b6b), SPH_C32(0xd7cfa679), - SPH_C32(0x8050e432), SPH_C32(0x9502513f), SPH_C32(0x598a0003), - SPH_C32(0xa668d200), SPH_C32(0x813c0000), SPH_C32(0x82870000), - SPH_C32(0xb48b1f99), SPH_C32(0xc5732f36), SPH_C32(0x7ff3ddac), - SPH_C32(0x9f3a0de1) }, - { SPH_C32(0x5aed0002), SPH_C32(0xfc59ae00), SPH_C32(0xc3590000), - SPH_C32(0x24da0000), SPH_C32(0xdc225b71), SPH_C32(0xc24d836d), - SPH_C32(0x15f3af49), SPH_C32(0x214951af), SPH_C32(0xa7a80003), - SPH_C32(0x0130d700), SPH_C32(0xa4ed0000), SPH_C32(0x75e70000), - SPH_C32(0x3dba6743), SPH_C32(0xdaa7d756), SPH_C32(0x31237eb9), - SPH_C32(0x3e19f27e) }, - { SPH_C32(0xa8bd0002), SPH_C32(0x12e4a400), SPH_C32(0xa4f10000), - SPH_C32(0x8f500000), SPH_C32(0x66b913b1), SPH_C32(0xc81b5e19), - SPH_C32(0xce804727), SPH_C32(0x3421aea0), SPH_C32(0xabda0003), - SPH_C32(0x48d5d800), SPH_C32(0xe6940000), SPH_C32(0x290d0000), - SPH_C32(0x0e105759), SPH_C32(0xcf25f242), SPH_C32(0xa48035c2), - SPH_C32(0x8a52f2ee) }, - { SPH_C32(0xa4cf0002), SPH_C32(0x5b01ab00), SPH_C32(0xe6880000), - SPH_C32(0xd3ba0000), SPH_C32(0x551323ab), SPH_C32(0xdd997b0d), - SPH_C32(0x5b230c5c), SPH_C32(0x806aae30), SPH_C32(0x55f80003), - SPH_C32(0xef8ddd00), SPH_C32(0xc3450000), SPH_C32(0xde6d0000), - SPH_C32(0x87212f83), SPH_C32(0xd0f10a22), SPH_C32(0xea5096d7), - SPH_C32(0x2b710d71) }, - { SPH_C32(0x13870002), SPH_C32(0x1009b600), SPH_C32(0x784a0000), - SPH_C32(0x43780000), SPH_C32(0xf1447f47), SPH_C32(0xf4dc33af), - SPH_C32(0x96ec4282), SPH_C32(0x4a31a5e0), SPH_C32(0xe1b70003), - SPH_C32(0xb019d400), SPH_C32(0xb6a60000), SPH_C32(0x77360000), - SPH_C32(0x960a7e35), SPH_C32(0x6b3bde73), SPH_C32(0x19d7cbba), - SPH_C32(0x5afbe6df) }, - { SPH_C32(0x1ff50002), SPH_C32(0x59ecb900), SPH_C32(0x3a330000), - SPH_C32(0x1f920000), SPH_C32(0xc2ee4f5d), SPH_C32(0xe15e16bb), - SPH_C32(0x034f09f9), SPH_C32(0xfe7aa570), SPH_C32(0x1f950003), - SPH_C32(0x1741d100), SPH_C32(0x93770000), SPH_C32(0x80560000), - SPH_C32(0x1f3b06ef), SPH_C32(0x74ef2613), SPH_C32(0x570768af), - SPH_C32(0xfbd81940) }, - { SPH_C32(0xeda50002), SPH_C32(0xb751b300), SPH_C32(0x5d9b0000), - SPH_C32(0xb4180000), SPH_C32(0x7875079d), SPH_C32(0xeb08cbcf), - SPH_C32(0xd83ce197), SPH_C32(0xeb125a7f), SPH_C32(0x13e70003), - SPH_C32(0x5ea4de00), SPH_C32(0xd10e0000), SPH_C32(0xdcbc0000), - SPH_C32(0x2c9136f5), SPH_C32(0x616d0307), SPH_C32(0xc2a423d4), - SPH_C32(0x4f9319d0) }, - { SPH_C32(0xe1d70002), SPH_C32(0xfeb4bc00), SPH_C32(0x1fe20000), - SPH_C32(0xe8f20000), SPH_C32(0x4bdf3787), SPH_C32(0xfe8aeedb), - SPH_C32(0x4d9faaec), SPH_C32(0x5f595aef), SPH_C32(0xedc50003), - SPH_C32(0xf9fcdb00), SPH_C32(0xf4df0000), SPH_C32(0x2bdc0000), - SPH_C32(0xa5a04e2f), SPH_C32(0x7eb9fb67), SPH_C32(0x8c7480c1), - SPH_C32(0xeeb0e64f) }, - { SPH_C32(0x4a600002), SPH_C32(0x7afa8300), SPH_C32(0xbcf20000), - SPH_C32(0xebe00000), SPH_C32(0x35731800), SPH_C32(0xff39a060), - SPH_C32(0x45502db0), SPH_C32(0x7b63e054), SPH_C32(0xd10b0003), - SPH_C32(0xd727e400), SPH_C32(0xdb680000), SPH_C32(0xdc8b0000), - SPH_C32(0x73be3df9), SPH_C32(0x01e6400b), SPH_C32(0x180ca989), - SPH_C32(0x2b17747e) }, - { SPH_C32(0x46120002), SPH_C32(0x331f8c00), SPH_C32(0xfe8b0000), - SPH_C32(0xb70a0000), SPH_C32(0x06d9281a), SPH_C32(0xeabb8574), - SPH_C32(0xd0f366cb), SPH_C32(0xcf28e0c4), SPH_C32(0x2f290003), - SPH_C32(0x707fe100), SPH_C32(0xfeb90000), SPH_C32(0x2beb0000), - SPH_C32(0xfa8f4523), SPH_C32(0x1e32b86b), SPH_C32(0x56dc0a9c), - SPH_C32(0x8a348be1) }, - { SPH_C32(0xb4420002), SPH_C32(0xdda28600), SPH_C32(0x99230000), - SPH_C32(0x1c800000), SPH_C32(0xbc4260da), SPH_C32(0xe0ed5800), - SPH_C32(0x0b808ea5), SPH_C32(0xda401fcb), SPH_C32(0x235b0003), - SPH_C32(0x399aee00), SPH_C32(0xbcc00000), SPH_C32(0x77010000), - SPH_C32(0xc9257539), SPH_C32(0x0bb09d7f), SPH_C32(0xc37f41e7), - SPH_C32(0x3e7f8b71) }, - { SPH_C32(0xb8300002), SPH_C32(0x94478900), SPH_C32(0xdb5a0000), - SPH_C32(0x406a0000), SPH_C32(0x8fe850c0), SPH_C32(0xf56f7d14), - SPH_C32(0x9e23c5de), SPH_C32(0x6e0b1f5b), SPH_C32(0xdd790003), - SPH_C32(0x9ec2eb00), SPH_C32(0x99110000), SPH_C32(0x80610000), - SPH_C32(0x40140de3), SPH_C32(0x1464651f), SPH_C32(0x8dafe2f2), - SPH_C32(0x9f5c74ee) }, - { SPH_C32(0x0f780002), SPH_C32(0xdf4f9400), SPH_C32(0x45980000), - SPH_C32(0xd0a80000), SPH_C32(0x2bbf0c2c), SPH_C32(0xdc2a35b6), - SPH_C32(0x53ec8b00), SPH_C32(0xa450148b), SPH_C32(0x69360003), - SPH_C32(0xc156e200), SPH_C32(0xecf20000), SPH_C32(0x293a0000), - SPH_C32(0x513f5c55), SPH_C32(0xafaeb14e), SPH_C32(0x7e28bf9f), - SPH_C32(0xeed69f40) }, - { SPH_C32(0x030a0002), SPH_C32(0x96aa9b00), SPH_C32(0x07e10000), - SPH_C32(0x8c420000), SPH_C32(0x18153c36), SPH_C32(0xc9a810a2), - SPH_C32(0xc64fc07b), SPH_C32(0x101b141b), SPH_C32(0x97140003), - SPH_C32(0x660ee700), SPH_C32(0xc9230000), SPH_C32(0xde5a0000), - SPH_C32(0xd80e248f), SPH_C32(0xb07a492e), SPH_C32(0x30f81c8a), - SPH_C32(0x4ff560df) }, - { SPH_C32(0xf15a0002), SPH_C32(0x78179100), SPH_C32(0x60490000), - SPH_C32(0x27c80000), SPH_C32(0xa28e74f6), SPH_C32(0xc3fecdd6), - SPH_C32(0x1d3c2815), SPH_C32(0x0573eb14), SPH_C32(0x9b660003), - SPH_C32(0x2febe800), SPH_C32(0x8b5a0000), SPH_C32(0x82b00000), - SPH_C32(0xeba41495), SPH_C32(0xa5f86c3a), SPH_C32(0xa55b57f1), - SPH_C32(0xfbbe604f) }, - { SPH_C32(0xfd280002), SPH_C32(0x31f29e00), SPH_C32(0x22300000), - SPH_C32(0x7b220000), SPH_C32(0x912444ec), SPH_C32(0xd67ce8c2), - SPH_C32(0x889f636e), SPH_C32(0xb138eb84), SPH_C32(0x65440003), - SPH_C32(0x88b3ed00), SPH_C32(0xae8b0000), SPH_C32(0x75d00000), - SPH_C32(0x62956c4f), SPH_C32(0xba2c945a), SPH_C32(0xeb8bf4e4), - SPH_C32(0x5a9d9fd0) }, - { SPH_C32(0xf25d0002), SPH_C32(0x6c8b8500), SPH_C32(0x8b680000), - SPH_C32(0x1e510000), SPH_C32(0x17f279ac), SPH_C32(0x51715125), - SPH_C32(0x23743ba6), SPH_C32(0xbea20b6a), SPH_C32(0x2c2e0003), - SPH_C32(0x64e3f500), SPH_C32(0x15980000), SPH_C32(0x12720000), - SPH_C32(0x4ff34879), SPH_C32(0x8cbd2498), SPH_C32(0x6894192f), - SPH_C32(0x31e56b9f) }, - { SPH_C32(0xfe2f0002), SPH_C32(0x256e8a00), SPH_C32(0xc9110000), - SPH_C32(0x42bb0000), SPH_C32(0x245849b6), SPH_C32(0x44f37431), - SPH_C32(0xb6d770dd), SPH_C32(0x0ae90bfa), SPH_C32(0xd20c0003), - SPH_C32(0xc3bbf000), SPH_C32(0x30490000), SPH_C32(0xe5120000), - SPH_C32(0xc6c230a3), SPH_C32(0x9369dcf8), SPH_C32(0x2644ba3a), - SPH_C32(0x90c69400) }, - { SPH_C32(0x0c7f0002), SPH_C32(0xcbd38000), SPH_C32(0xaeb90000), - SPH_C32(0xe9310000), SPH_C32(0x9ec30176), SPH_C32(0x4ea5a945), - SPH_C32(0x6da498b3), SPH_C32(0x1f81f4f5), SPH_C32(0xde7e0003), - SPH_C32(0x8a5eff00), SPH_C32(0x72300000), SPH_C32(0xb9f80000), - SPH_C32(0xf56800b9), SPH_C32(0x86ebf9ec), SPH_C32(0xb3e7f141), - SPH_C32(0x248d9490) }, - { SPH_C32(0x000d0002), SPH_C32(0x82368f00), SPH_C32(0xecc00000), - SPH_C32(0xb5db0000), SPH_C32(0xad69316c), SPH_C32(0x5b278c51), - SPH_C32(0xf807d3c8), SPH_C32(0xabcaf465), SPH_C32(0x205c0003), - SPH_C32(0x2d06fa00), SPH_C32(0x57e10000), SPH_C32(0x4e980000), - SPH_C32(0x7c597863), SPH_C32(0x993f018c), SPH_C32(0xfd375254), - SPH_C32(0x85ae6b0f) }, - { SPH_C32(0xb7450002), SPH_C32(0xc93e9200), SPH_C32(0x72020000), - SPH_C32(0x25190000), SPH_C32(0x093e6d80), SPH_C32(0x7262c4f3), - SPH_C32(0x35c89d16), SPH_C32(0x6191ffb5), SPH_C32(0x94130003), - SPH_C32(0x7292f300), SPH_C32(0x22020000), SPH_C32(0xe7c30000), - SPH_C32(0x6d7229d5), SPH_C32(0x22f5d5dd), SPH_C32(0x0eb00f39), - SPH_C32(0xf42480a1) }, - { SPH_C32(0xbb370002), SPH_C32(0x80db9d00), SPH_C32(0x307b0000), - SPH_C32(0x79f30000), SPH_C32(0x3a945d9a), SPH_C32(0x67e0e1e7), - SPH_C32(0xa06bd66d), SPH_C32(0xd5daff25), SPH_C32(0x6a310003), - SPH_C32(0xd5caf600), SPH_C32(0x07d30000), SPH_C32(0x10a30000), - SPH_C32(0xe443510f), SPH_C32(0x3d212dbd), SPH_C32(0x4060ac2c), - SPH_C32(0x55077f3e) }, - { SPH_C32(0x49670002), SPH_C32(0x6e669700), SPH_C32(0x57d30000), - SPH_C32(0xd2790000), SPH_C32(0x800f155a), SPH_C32(0x6db63c93), - SPH_C32(0x7b183e03), SPH_C32(0xc0b2002a), SPH_C32(0x66430003), - SPH_C32(0x9c2ff900), SPH_C32(0x45aa0000), SPH_C32(0x4c490000), - SPH_C32(0xd7e96115), SPH_C32(0x28a308a9), SPH_C32(0xd5c3e757), - SPH_C32(0xe14c7fae) }, - { SPH_C32(0x45150002), SPH_C32(0x27839800), SPH_C32(0x15aa0000), - SPH_C32(0x8e930000), SPH_C32(0xb3a52540), SPH_C32(0x78341987), - SPH_C32(0xeebb7578), SPH_C32(0x74f900ba), SPH_C32(0x98610003), - SPH_C32(0x3b77fc00), SPH_C32(0x607b0000), SPH_C32(0xbb290000), - SPH_C32(0x5ed819cf), SPH_C32(0x3777f0c9), SPH_C32(0x9b134442), - SPH_C32(0x406f8031) }, - { SPH_C32(0x3fc40002), SPH_C32(0xb871a400), SPH_C32(0x28560000), - SPH_C32(0x7b150000), SPH_C32(0xce0b4fe0), SPH_C32(0xb6f7abce), - SPH_C32(0x5237e933), SPH_C32(0xd5bc862a), SPH_C32(0x006d0003), - SPH_C32(0xcc9be700), SPH_C32(0x45840000), SPH_C32(0x2a1f0000), - SPH_C32(0x70bc78de), SPH_C32(0xce96bcf9), SPH_C32(0xac4fb29e), - SPH_C32(0xae684855) }, - { SPH_C32(0x33b60002), SPH_C32(0xf194ab00), SPH_C32(0x6a2f0000), - SPH_C32(0x27ff0000), SPH_C32(0xfda17ffa), SPH_C32(0xa3758eda), - SPH_C32(0xc794a248), SPH_C32(0x61f786ba), SPH_C32(0xfe4f0003), - SPH_C32(0x6bc3e200), SPH_C32(0x60550000), SPH_C32(0xdd7f0000), - SPH_C32(0xf98d0004), SPH_C32(0xd1424499), SPH_C32(0xe29f118b), - SPH_C32(0x0f4bb7ca) }, - { SPH_C32(0xc1e60002), SPH_C32(0x1f29a100), SPH_C32(0x0d870000), - SPH_C32(0x8c750000), SPH_C32(0x473a373a), SPH_C32(0xa92353ae), - SPH_C32(0x1ce74a26), SPH_C32(0x749f79b5), SPH_C32(0xf23d0003), - SPH_C32(0x2226ed00), SPH_C32(0x222c0000), SPH_C32(0x81950000), - SPH_C32(0xca27301e), SPH_C32(0xc4c0618d), SPH_C32(0x773c5af0), - SPH_C32(0xbb00b75a) }, - { SPH_C32(0xcd940002), SPH_C32(0x56ccae00), SPH_C32(0x4ffe0000), - SPH_C32(0xd09f0000), SPH_C32(0x74900720), SPH_C32(0xbca176ba), - SPH_C32(0x8944015d), SPH_C32(0xc0d47925), SPH_C32(0x0c1f0003), - SPH_C32(0x857ee800), SPH_C32(0x07fd0000), SPH_C32(0x76f50000), - SPH_C32(0x431648c4), SPH_C32(0xdb1499ed), SPH_C32(0x39ecf9e5), - SPH_C32(0x1a2348c5) }, - { SPH_C32(0x7adc0002), SPH_C32(0x1dc4b300), SPH_C32(0xd13c0000), - SPH_C32(0x405d0000), SPH_C32(0xd0c75bcc), SPH_C32(0x95e43e18), - SPH_C32(0x448b4f83), SPH_C32(0x0a8f72f5), SPH_C32(0xb8500003), - SPH_C32(0xdaeae100), SPH_C32(0x721e0000), SPH_C32(0xdfae0000), - SPH_C32(0x523d1972), SPH_C32(0x60de4dbc), SPH_C32(0xca6ba488), - SPH_C32(0x6ba9a36b) }, - { SPH_C32(0x76ae0002), SPH_C32(0x5421bc00), SPH_C32(0x93450000), - SPH_C32(0x1cb70000), SPH_C32(0xe36d6bd6), SPH_C32(0x80661b0c), - SPH_C32(0xd12804f8), SPH_C32(0xbec47265), SPH_C32(0x46720003), - SPH_C32(0x7db2e400), SPH_C32(0x57cf0000), SPH_C32(0x28ce0000), - SPH_C32(0xdb0c61a8), SPH_C32(0x7f0ab5dc), SPH_C32(0x84bb079d), - SPH_C32(0xca8a5cf4) }, - { SPH_C32(0x84fe0002), SPH_C32(0xba9cb600), SPH_C32(0xf4ed0000), - SPH_C32(0xb73d0000), SPH_C32(0x59f62316), SPH_C32(0x8a30c678), - SPH_C32(0x0a5bec96), SPH_C32(0xabac8d6a), SPH_C32(0x4a000003), - SPH_C32(0x3457eb00), SPH_C32(0x15b60000), SPH_C32(0x74240000), - SPH_C32(0xe8a651b2), SPH_C32(0x6a8890c8), SPH_C32(0x11184ce6), - SPH_C32(0x7ec15c64) }, - { SPH_C32(0x888c0002), SPH_C32(0xf379b900), SPH_C32(0xb6940000), - SPH_C32(0xebd70000), SPH_C32(0x6a5c130c), SPH_C32(0x9fb2e36c), - SPH_C32(0x9ff8a7ed), SPH_C32(0x1fe78dfa), SPH_C32(0xb4220003), - SPH_C32(0x930fee00), SPH_C32(0x30670000), SPH_C32(0x83440000), - SPH_C32(0x61972968), SPH_C32(0x755c68a8), SPH_C32(0x5fc8eff3), - SPH_C32(0xdfe2a3fb) }, - { SPH_C32(0x87f90002), SPH_C32(0xae00a200), SPH_C32(0x1fcc0000), - SPH_C32(0x8ea40000), SPH_C32(0xec8a2e4c), SPH_C32(0x18bf5a8b), - SPH_C32(0x3413ff25), SPH_C32(0x107d6d14), SPH_C32(0xfd480003), - SPH_C32(0x7f5ff600), SPH_C32(0x8b740000), SPH_C32(0xe4e60000), - SPH_C32(0x4cf10d5e), SPH_C32(0x43cdd86a), SPH_C32(0xdcd70238), - SPH_C32(0xb49a57b4) }, - { SPH_C32(0x8b8b0002), SPH_C32(0xe7e5ad00), SPH_C32(0x5db50000), - SPH_C32(0xd24e0000), SPH_C32(0xdf201e56), SPH_C32(0x0d3d7f9f), - SPH_C32(0xa1b0b45e), SPH_C32(0xa4366d84), SPH_C32(0x036a0003), - SPH_C32(0xd807f300), SPH_C32(0xaea50000), SPH_C32(0x13860000), - SPH_C32(0xc5c07584), SPH_C32(0x5c19200a), SPH_C32(0x9207a12d), - SPH_C32(0x15b9a82b) }, - { SPH_C32(0x79db0002), SPH_C32(0x0958a700), SPH_C32(0x3a1d0000), - SPH_C32(0x79c40000), SPH_C32(0x65bb5696), SPH_C32(0x076ba2eb), - SPH_C32(0x7ac35c30), SPH_C32(0xb15e928b), SPH_C32(0x0f180003), - SPH_C32(0x91e2fc00), SPH_C32(0xecdc0000), SPH_C32(0x4f6c0000), - SPH_C32(0xf66a459e), SPH_C32(0x499b051e), SPH_C32(0x07a4ea56), - SPH_C32(0xa1f2a8bb) }, - { SPH_C32(0x75a90002), SPH_C32(0x40bda800), SPH_C32(0x78640000), - SPH_C32(0x252e0000), SPH_C32(0x5611668c), SPH_C32(0x12e987ff), - SPH_C32(0xef60174b), SPH_C32(0x0515921b), SPH_C32(0xf13a0003), - SPH_C32(0x36baf900), SPH_C32(0xc90d0000), SPH_C32(0xb80c0000), - SPH_C32(0x7f5b3d44), SPH_C32(0x564ffd7e), SPH_C32(0x49744943), - SPH_C32(0x00d15724) }, - { SPH_C32(0xc2e10002), SPH_C32(0x0bb5b500), SPH_C32(0xe6a60000), - SPH_C32(0xb5ec0000), SPH_C32(0xf2463a60), SPH_C32(0x3baccf5d), - SPH_C32(0x22af5995), SPH_C32(0xcf4e99cb), SPH_C32(0x45750003), - SPH_C32(0x692ef000), SPH_C32(0xbcee0000), SPH_C32(0x11570000), - SPH_C32(0x6e706cf2), SPH_C32(0xed85292f), SPH_C32(0xbaf3142e), - SPH_C32(0x715bbc8a) }, - { SPH_C32(0xce930002), SPH_C32(0x4250ba00), SPH_C32(0xa4df0000), - SPH_C32(0xe9060000), SPH_C32(0xc1ec0a7a), SPH_C32(0x2e2eea49), - SPH_C32(0xb70c12ee), SPH_C32(0x7b05995b), SPH_C32(0xbb570003), - SPH_C32(0xce76f500), SPH_C32(0x993f0000), SPH_C32(0xe6370000), - SPH_C32(0xe7411428), SPH_C32(0xf251d14f), SPH_C32(0xf423b73b), - SPH_C32(0xd0784315) }, - { SPH_C32(0x3cc30002), SPH_C32(0xacedb000), SPH_C32(0xc3770000), - SPH_C32(0x428c0000), SPH_C32(0x7b7742ba), SPH_C32(0x2478373d), - SPH_C32(0x6c7ffa80), SPH_C32(0x6e6d6654), SPH_C32(0xb7250003), - SPH_C32(0x8793fa00), SPH_C32(0xdb460000), SPH_C32(0xbadd0000), - SPH_C32(0xd4eb2432), SPH_C32(0xe7d3f45b), SPH_C32(0x6180fc40), - SPH_C32(0x64334385) }, - { SPH_C32(0x30b10002), SPH_C32(0xe508bf00), SPH_C32(0x810e0000), - SPH_C32(0x1e660000), SPH_C32(0x48dd72a0), SPH_C32(0x31fa1229), - SPH_C32(0xf9dcb1fb), SPH_C32(0xda2666c4), SPH_C32(0x49070003), - SPH_C32(0x20cbff00), SPH_C32(0xfe970000), SPH_C32(0x4dbd0000), - SPH_C32(0x5dda5ce8), SPH_C32(0xf8070c3b), SPH_C32(0x2f505f55), - SPH_C32(0xc510bc1a) } -}; - -static const sph_u32 T512_24[256][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x86790000), SPH_C32(0x3f390002), SPH_C32(0xe19ae000), - SPH_C32(0x98560000), SPH_C32(0x9565670e), SPH_C32(0x4e88c8ea), - SPH_C32(0xd3dd4944), SPH_C32(0x161ddab9), SPH_C32(0x30b70000), - SPH_C32(0xe5d00000), SPH_C32(0xf4f46000), SPH_C32(0x42c40000), - SPH_C32(0x63b83d6a), SPH_C32(0x78ba9460), SPH_C32(0x21afa1ea), - SPH_C32(0xb0a51834) }, - { SPH_C32(0x30b70000), SPH_C32(0xe5d00000), SPH_C32(0xf4f46000), - SPH_C32(0x42c40000), SPH_C32(0x63b83d6a), SPH_C32(0x78ba9460), - SPH_C32(0x21afa1ea), SPH_C32(0xb0a51834), SPH_C32(0xb6ce0000), - SPH_C32(0xdae90002), SPH_C32(0x156e8000), SPH_C32(0xda920000), - SPH_C32(0xf6dd5a64), SPH_C32(0x36325c8a), SPH_C32(0xf272e8ae), - SPH_C32(0xa6b8c28d) }, - { SPH_C32(0xb6ce0000), SPH_C32(0xdae90002), SPH_C32(0x156e8000), - SPH_C32(0xda920000), SPH_C32(0xf6dd5a64), SPH_C32(0x36325c8a), - SPH_C32(0xf272e8ae), SPH_C32(0xa6b8c28d), SPH_C32(0x86790000), - SPH_C32(0x3f390002), SPH_C32(0xe19ae000), SPH_C32(0x98560000), - SPH_C32(0x9565670e), SPH_C32(0x4e88c8ea), SPH_C32(0xd3dd4944), - SPH_C32(0x161ddab9) }, - { SPH_C32(0x14190000), SPH_C32(0x23ca003c), SPH_C32(0x50df0000), - SPH_C32(0x44b60000), SPH_C32(0x1b6c67b0), SPH_C32(0x3cf3ac75), - SPH_C32(0x61e610b0), SPH_C32(0xdbcadb80), SPH_C32(0xe3430000), - SPH_C32(0x3a4e0014), SPH_C32(0xf2c60000), SPH_C32(0xaa4e0000), - SPH_C32(0xdb1e42a6), SPH_C32(0x256bbe15), SPH_C32(0x123db156), - SPH_C32(0x3a4e99d7) }, - { SPH_C32(0x92600000), SPH_C32(0x1cf3003e), SPH_C32(0xb145e000), - SPH_C32(0xdce00000), SPH_C32(0x8e0900be), SPH_C32(0x727b649f), - SPH_C32(0xb23b59f4), SPH_C32(0xcdd70139), SPH_C32(0xd3f40000), - SPH_C32(0xdf9e0014), SPH_C32(0x06326000), SPH_C32(0xe88a0000), - SPH_C32(0xb8a67fcc), SPH_C32(0x5dd12a75), SPH_C32(0x339210bc), - SPH_C32(0x8aeb81e3) }, - { SPH_C32(0x24ae0000), SPH_C32(0xc61a003c), SPH_C32(0xa42b6000), - SPH_C32(0x06720000), SPH_C32(0x78d45ada), SPH_C32(0x44493815), - SPH_C32(0x4049b15a), SPH_C32(0x6b6fc3b4), SPH_C32(0x558d0000), - SPH_C32(0xe0a70016), SPH_C32(0xe7a88000), SPH_C32(0x70dc0000), - SPH_C32(0x2dc318c2), SPH_C32(0x1359e29f), SPH_C32(0xe04f59f8), - SPH_C32(0x9cf65b5a) }, - { SPH_C32(0xa2d70000), SPH_C32(0xf923003e), SPH_C32(0x45b18000), - SPH_C32(0x9e240000), SPH_C32(0xedb13dd4), SPH_C32(0x0ac1f0ff), - SPH_C32(0x9394f81e), SPH_C32(0x7d72190d), SPH_C32(0x653a0000), - SPH_C32(0x05770016), SPH_C32(0x135ce000), SPH_C32(0x32180000), - SPH_C32(0x4e7b25a8), SPH_C32(0x6be376ff), SPH_C32(0xc1e0f812), - SPH_C32(0x2c53436e) }, - { SPH_C32(0xe3430000), SPH_C32(0x3a4e0014), SPH_C32(0xf2c60000), - SPH_C32(0xaa4e0000), SPH_C32(0xdb1e42a6), SPH_C32(0x256bbe15), - SPH_C32(0x123db156), SPH_C32(0x3a4e99d7), SPH_C32(0xf75a0000), - SPH_C32(0x19840028), SPH_C32(0xa2190000), SPH_C32(0xeef80000), - SPH_C32(0xc0722516), SPH_C32(0x19981260), SPH_C32(0x73dba1e6), - SPH_C32(0xe1844257) }, - { SPH_C32(0x653a0000), SPH_C32(0x05770016), SPH_C32(0x135ce000), - SPH_C32(0x32180000), SPH_C32(0x4e7b25a8), SPH_C32(0x6be376ff), - SPH_C32(0xc1e0f812), SPH_C32(0x2c53436e), SPH_C32(0xc7ed0000), - SPH_C32(0xfc540028), SPH_C32(0x56ed6000), SPH_C32(0xac3c0000), - SPH_C32(0xa3ca187c), SPH_C32(0x61228600), SPH_C32(0x5274000c), - SPH_C32(0x51215a63) }, - { SPH_C32(0xd3f40000), SPH_C32(0xdf9e0014), SPH_C32(0x06326000), - SPH_C32(0xe88a0000), SPH_C32(0xb8a67fcc), SPH_C32(0x5dd12a75), - SPH_C32(0x339210bc), SPH_C32(0x8aeb81e3), SPH_C32(0x41940000), - SPH_C32(0xc36d002a), SPH_C32(0xb7778000), SPH_C32(0x346a0000), - SPH_C32(0x36af7f72), SPH_C32(0x2faa4eea), SPH_C32(0x81a94948), - SPH_C32(0x473c80da) }, - { SPH_C32(0x558d0000), SPH_C32(0xe0a70016), SPH_C32(0xe7a88000), - SPH_C32(0x70dc0000), SPH_C32(0x2dc318c2), SPH_C32(0x1359e29f), - SPH_C32(0xe04f59f8), SPH_C32(0x9cf65b5a), SPH_C32(0x71230000), - SPH_C32(0x26bd002a), SPH_C32(0x4383e000), SPH_C32(0x76ae0000), - SPH_C32(0x55174218), SPH_C32(0x5710da8a), SPH_C32(0xa006e8a2), - SPH_C32(0xf79998ee) }, - { SPH_C32(0xf75a0000), SPH_C32(0x19840028), SPH_C32(0xa2190000), - SPH_C32(0xeef80000), SPH_C32(0xc0722516), SPH_C32(0x19981260), - SPH_C32(0x73dba1e6), SPH_C32(0xe1844257), SPH_C32(0x14190000), - SPH_C32(0x23ca003c), SPH_C32(0x50df0000), SPH_C32(0x44b60000), - SPH_C32(0x1b6c67b0), SPH_C32(0x3cf3ac75), SPH_C32(0x61e610b0), - SPH_C32(0xdbcadb80) }, - { SPH_C32(0x71230000), SPH_C32(0x26bd002a), SPH_C32(0x4383e000), - SPH_C32(0x76ae0000), SPH_C32(0x55174218), SPH_C32(0x5710da8a), - SPH_C32(0xa006e8a2), SPH_C32(0xf79998ee), SPH_C32(0x24ae0000), - SPH_C32(0xc61a003c), SPH_C32(0xa42b6000), SPH_C32(0x06720000), - SPH_C32(0x78d45ada), SPH_C32(0x44493815), SPH_C32(0x4049b15a), - SPH_C32(0x6b6fc3b4) }, - { SPH_C32(0xc7ed0000), SPH_C32(0xfc540028), SPH_C32(0x56ed6000), - SPH_C32(0xac3c0000), SPH_C32(0xa3ca187c), SPH_C32(0x61228600), - SPH_C32(0x5274000c), SPH_C32(0x51215a63), SPH_C32(0xa2d70000), - SPH_C32(0xf923003e), SPH_C32(0x45b18000), SPH_C32(0x9e240000), - SPH_C32(0xedb13dd4), SPH_C32(0x0ac1f0ff), SPH_C32(0x9394f81e), - SPH_C32(0x7d72190d) }, - { SPH_C32(0x41940000), SPH_C32(0xc36d002a), SPH_C32(0xb7778000), - SPH_C32(0x346a0000), SPH_C32(0x36af7f72), SPH_C32(0x2faa4eea), - SPH_C32(0x81a94948), SPH_C32(0x473c80da), SPH_C32(0x92600000), - SPH_C32(0x1cf3003e), SPH_C32(0xb145e000), SPH_C32(0xdce00000), - SPH_C32(0x8e0900be), SPH_C32(0x727b649f), SPH_C32(0xb23b59f4), - SPH_C32(0xcdd70139) }, - { SPH_C32(0x54500000), SPH_C32(0x0671005c), SPH_C32(0x25ae0000), - SPH_C32(0x6a1e0000), SPH_C32(0x2ea54edf), SPH_C32(0x664e8512), - SPH_C32(0xbfba18c3), SPH_C32(0x7e715d17), SPH_C32(0xbc8d0000), - SPH_C32(0xfc3b0018), SPH_C32(0x19830000), SPH_C32(0xd10b0000), - SPH_C32(0xae1878c4), SPH_C32(0x42a69856), SPH_C32(0x0012da37), - SPH_C32(0x2c3b504e) }, - { SPH_C32(0xd2290000), SPH_C32(0x3948005e), SPH_C32(0xc434e000), - SPH_C32(0xf2480000), SPH_C32(0xbbc029d1), SPH_C32(0x28c64df8), - SPH_C32(0x6c675187), SPH_C32(0x686c87ae), SPH_C32(0x8c3a0000), - SPH_C32(0x19eb0018), SPH_C32(0xed776000), SPH_C32(0x93cf0000), - SPH_C32(0xcda045ae), SPH_C32(0x3a1c0c36), SPH_C32(0x21bd7bdd), - SPH_C32(0x9c9e487a) }, - { SPH_C32(0x64e70000), SPH_C32(0xe3a1005c), SPH_C32(0xd15a6000), - SPH_C32(0x28da0000), SPH_C32(0x4d1d73b5), SPH_C32(0x1ef41172), - SPH_C32(0x9e15b929), SPH_C32(0xced44523), SPH_C32(0x0a430000), - SPH_C32(0x26d2001a), SPH_C32(0x0ced8000), SPH_C32(0x0b990000), - SPH_C32(0x58c522a0), SPH_C32(0x7494c4dc), SPH_C32(0xf2603299), - SPH_C32(0x8a8392c3) }, - { SPH_C32(0xe29e0000), SPH_C32(0xdc98005e), SPH_C32(0x30c08000), - SPH_C32(0xb08c0000), SPH_C32(0xd87814bb), SPH_C32(0x507cd998), - SPH_C32(0x4dc8f06d), SPH_C32(0xd8c99f9a), SPH_C32(0x3af40000), - SPH_C32(0xc302001a), SPH_C32(0xf819e000), SPH_C32(0x495d0000), - SPH_C32(0x3b7d1fca), SPH_C32(0x0c2e50bc), SPH_C32(0xd3cf9373), - SPH_C32(0x3a268af7) }, - { SPH_C32(0x40490000), SPH_C32(0x25bb0060), SPH_C32(0x75710000), - SPH_C32(0x2ea80000), SPH_C32(0x35c9296f), SPH_C32(0x5abd2967), - SPH_C32(0xde5c0873), SPH_C32(0xa5bb8697), SPH_C32(0x5fce0000), - SPH_C32(0xc675000c), SPH_C32(0xeb450000), SPH_C32(0x7b450000), - SPH_C32(0x75063a62), SPH_C32(0x67cd2643), SPH_C32(0x122f6b61), - SPH_C32(0x1675c999) }, - { SPH_C32(0xc6300000), SPH_C32(0x1a820062), SPH_C32(0x94ebe000), - SPH_C32(0xb6fe0000), SPH_C32(0xa0ac4e61), SPH_C32(0x1435e18d), - SPH_C32(0x0d814137), SPH_C32(0xb3a65c2e), SPH_C32(0x6f790000), - SPH_C32(0x23a5000c), SPH_C32(0x1fb16000), SPH_C32(0x39810000), - SPH_C32(0x16be0708), SPH_C32(0x1f77b223), SPH_C32(0x3380ca8b), - SPH_C32(0xa6d0d1ad) }, - { SPH_C32(0x70fe0000), SPH_C32(0xc06b0060), SPH_C32(0x81856000), - SPH_C32(0x6c6c0000), SPH_C32(0x56711405), SPH_C32(0x2207bd07), - SPH_C32(0xfff3a999), SPH_C32(0x151e9ea3), SPH_C32(0xe9000000), - SPH_C32(0x1c9c000e), SPH_C32(0xfe2b8000), SPH_C32(0xa1d70000), - SPH_C32(0x83db6006), SPH_C32(0x51ff7ac9), SPH_C32(0xe05d83cf), - SPH_C32(0xb0cd0b14) }, - { SPH_C32(0xf6870000), SPH_C32(0xff520062), SPH_C32(0x601f8000), - SPH_C32(0xf43a0000), SPH_C32(0xc314730b), SPH_C32(0x6c8f75ed), - SPH_C32(0x2c2ee0dd), SPH_C32(0x0303441a), SPH_C32(0xd9b70000), - SPH_C32(0xf94c000e), SPH_C32(0x0adfe000), SPH_C32(0xe3130000), - SPH_C32(0xe0635d6c), SPH_C32(0x2945eea9), SPH_C32(0xc1f22225), - SPH_C32(0x00681320) }, - { SPH_C32(0xb7130000), SPH_C32(0x3c3f0048), SPH_C32(0xd7680000), - SPH_C32(0xc0500000), SPH_C32(0xf5bb0c79), SPH_C32(0x43253b07), - SPH_C32(0xad87a995), SPH_C32(0x443fc4c0), SPH_C32(0x4bd70000), - SPH_C32(0xe5bf0030), SPH_C32(0xbb9a0000), SPH_C32(0x3ff30000), - SPH_C32(0x6e6a5dd2), SPH_C32(0x5b3e8a36), SPH_C32(0x73c97bd1), - SPH_C32(0xcdbf1219) }, - { SPH_C32(0x316a0000), SPH_C32(0x0306004a), SPH_C32(0x36f2e000), - SPH_C32(0x58060000), SPH_C32(0x60de6b77), SPH_C32(0x0dadf3ed), - SPH_C32(0x7e5ae0d1), SPH_C32(0x52221e79), SPH_C32(0x7b600000), - SPH_C32(0x006f0030), SPH_C32(0x4f6e6000), SPH_C32(0x7d370000), - SPH_C32(0x0dd260b8), SPH_C32(0x23841e56), SPH_C32(0x5266da3b), - SPH_C32(0x7d1a0a2d) }, - { SPH_C32(0x87a40000), SPH_C32(0xd9ef0048), SPH_C32(0x239c6000), - SPH_C32(0x82940000), SPH_C32(0x96033113), SPH_C32(0x3b9faf67), - SPH_C32(0x8c28087f), SPH_C32(0xf49adcf4), SPH_C32(0xfd190000), - SPH_C32(0x3f560032), SPH_C32(0xaef48000), SPH_C32(0xe5610000), - SPH_C32(0x98b707b6), SPH_C32(0x6d0cd6bc), SPH_C32(0x81bb937f), - SPH_C32(0x6b07d094) }, - { SPH_C32(0x01dd0000), SPH_C32(0xe6d6004a), SPH_C32(0xc2068000), - SPH_C32(0x1ac20000), SPH_C32(0x0366561d), SPH_C32(0x7517678d), - SPH_C32(0x5ff5413b), SPH_C32(0xe287064d), SPH_C32(0xcdae0000), - SPH_C32(0xda860032), SPH_C32(0x5a00e000), SPH_C32(0xa7a50000), - SPH_C32(0xfb0f3adc), SPH_C32(0x15b642dc), SPH_C32(0xa0143295), - SPH_C32(0xdba2c8a0) }, - { SPH_C32(0xa30a0000), SPH_C32(0x1ff50074), SPH_C32(0x87b70000), - SPH_C32(0x84e60000), SPH_C32(0xeed76bc9), SPH_C32(0x7fd69772), - SPH_C32(0xcc61b925), SPH_C32(0x9ff51f40), SPH_C32(0xa8940000), - SPH_C32(0xdff10024), SPH_C32(0x495c0000), SPH_C32(0x95bd0000), - SPH_C32(0xb5741f74), SPH_C32(0x7e553423), SPH_C32(0x61f4ca87), - SPH_C32(0xf7f18bce) }, - { SPH_C32(0x25730000), SPH_C32(0x20cc0076), SPH_C32(0x662de000), - SPH_C32(0x1cb00000), SPH_C32(0x7bb20cc7), SPH_C32(0x315e5f98), - SPH_C32(0x1fbcf061), SPH_C32(0x89e8c5f9), SPH_C32(0x98230000), - SPH_C32(0x3a210024), SPH_C32(0xbda86000), SPH_C32(0xd7790000), - SPH_C32(0xd6cc221e), SPH_C32(0x06efa043), SPH_C32(0x405b6b6d), - SPH_C32(0x475493fa) }, - { SPH_C32(0x93bd0000), SPH_C32(0xfa250074), SPH_C32(0x73436000), - SPH_C32(0xc6220000), SPH_C32(0x8d6f56a3), SPH_C32(0x076c0312), - SPH_C32(0xedce18cf), SPH_C32(0x2f500774), SPH_C32(0x1e5a0000), - SPH_C32(0x05180026), SPH_C32(0x5c328000), SPH_C32(0x4f2f0000), - SPH_C32(0x43a94510), SPH_C32(0x486768a9), SPH_C32(0x93862229), - SPH_C32(0x51494943) }, - { SPH_C32(0x15c40000), SPH_C32(0xc51c0076), SPH_C32(0x92d98000), - SPH_C32(0x5e740000), SPH_C32(0x180a31ad), SPH_C32(0x49e4cbf8), - SPH_C32(0x3e13518b), SPH_C32(0x394dddcd), SPH_C32(0x2eed0000), - SPH_C32(0xe0c80026), SPH_C32(0xa8c6e000), SPH_C32(0x0deb0000), - SPH_C32(0x2011787a), SPH_C32(0x30ddfcc9), SPH_C32(0xb22983c3), - SPH_C32(0xe1ec5177) }, - { SPH_C32(0xbc8d0000), SPH_C32(0xfc3b0018), SPH_C32(0x19830000), - SPH_C32(0xd10b0000), SPH_C32(0xae1878c4), SPH_C32(0x42a69856), - SPH_C32(0x0012da37), SPH_C32(0x2c3b504e), SPH_C32(0xe8dd0000), - SPH_C32(0xfa4a0044), SPH_C32(0x3c2d0000), SPH_C32(0xbb150000), - SPH_C32(0x80bd361b), SPH_C32(0x24e81d44), SPH_C32(0xbfa8c2f4), - SPH_C32(0x524a0d59) }, - { SPH_C32(0x3af40000), SPH_C32(0xc302001a), SPH_C32(0xf819e000), - SPH_C32(0x495d0000), SPH_C32(0x3b7d1fca), SPH_C32(0x0c2e50bc), - SPH_C32(0xd3cf9373), SPH_C32(0x3a268af7), SPH_C32(0xd86a0000), - SPH_C32(0x1f9a0044), SPH_C32(0xc8d96000), SPH_C32(0xf9d10000), - SPH_C32(0xe3050b71), SPH_C32(0x5c528924), SPH_C32(0x9e07631e), - SPH_C32(0xe2ef156d) }, - { SPH_C32(0x8c3a0000), SPH_C32(0x19eb0018), SPH_C32(0xed776000), - SPH_C32(0x93cf0000), SPH_C32(0xcda045ae), SPH_C32(0x3a1c0c36), - SPH_C32(0x21bd7bdd), SPH_C32(0x9c9e487a), SPH_C32(0x5e130000), - SPH_C32(0x20a30046), SPH_C32(0x29438000), SPH_C32(0x61870000), - SPH_C32(0x76606c7f), SPH_C32(0x12da41ce), SPH_C32(0x4dda2a5a), - SPH_C32(0xf4f2cfd4) }, - { SPH_C32(0x0a430000), SPH_C32(0x26d2001a), SPH_C32(0x0ced8000), - SPH_C32(0x0b990000), SPH_C32(0x58c522a0), SPH_C32(0x7494c4dc), - SPH_C32(0xf2603299), SPH_C32(0x8a8392c3), SPH_C32(0x6ea40000), - SPH_C32(0xc5730046), SPH_C32(0xddb7e000), SPH_C32(0x23430000), - SPH_C32(0x15d85115), SPH_C32(0x6a60d5ae), SPH_C32(0x6c758bb0), - SPH_C32(0x4457d7e0) }, - { SPH_C32(0xa8940000), SPH_C32(0xdff10024), SPH_C32(0x495c0000), - SPH_C32(0x95bd0000), SPH_C32(0xb5741f74), SPH_C32(0x7e553423), - SPH_C32(0x61f4ca87), SPH_C32(0xf7f18bce), SPH_C32(0x0b9e0000), - SPH_C32(0xc0040050), SPH_C32(0xceeb0000), SPH_C32(0x115b0000), - SPH_C32(0x5ba374bd), SPH_C32(0x0183a351), SPH_C32(0xad9573a2), - SPH_C32(0x6804948e) }, - { SPH_C32(0x2eed0000), SPH_C32(0xe0c80026), SPH_C32(0xa8c6e000), - SPH_C32(0x0deb0000), SPH_C32(0x2011787a), SPH_C32(0x30ddfcc9), - SPH_C32(0xb22983c3), SPH_C32(0xe1ec5177), SPH_C32(0x3b290000), - SPH_C32(0x25d40050), SPH_C32(0x3a1f6000), SPH_C32(0x539f0000), - SPH_C32(0x381b49d7), SPH_C32(0x79393731), SPH_C32(0x8c3ad248), - SPH_C32(0xd8a18cba) }, - { SPH_C32(0x98230000), SPH_C32(0x3a210024), SPH_C32(0xbda86000), - SPH_C32(0xd7790000), SPH_C32(0xd6cc221e), SPH_C32(0x06efa043), - SPH_C32(0x405b6b6d), SPH_C32(0x475493fa), SPH_C32(0xbd500000), - SPH_C32(0x1aed0052), SPH_C32(0xdb858000), SPH_C32(0xcbc90000), - SPH_C32(0xad7e2ed9), SPH_C32(0x37b1ffdb), SPH_C32(0x5fe79b0c), - SPH_C32(0xcebc5603) }, - { SPH_C32(0x1e5a0000), SPH_C32(0x05180026), SPH_C32(0x5c328000), - SPH_C32(0x4f2f0000), SPH_C32(0x43a94510), SPH_C32(0x486768a9), - SPH_C32(0x93862229), SPH_C32(0x51494943), SPH_C32(0x8de70000), - SPH_C32(0xff3d0052), SPH_C32(0x2f71e000), SPH_C32(0x890d0000), - SPH_C32(0xcec613b3), SPH_C32(0x4f0b6bbb), SPH_C32(0x7e483ae6), - SPH_C32(0x7e194e37) }, - { SPH_C32(0x5fce0000), SPH_C32(0xc675000c), SPH_C32(0xeb450000), - SPH_C32(0x7b450000), SPH_C32(0x75063a62), SPH_C32(0x67cd2643), - SPH_C32(0x122f6b61), SPH_C32(0x1675c999), SPH_C32(0x1f870000), - SPH_C32(0xe3ce006c), SPH_C32(0x9e340000), SPH_C32(0x55ed0000), - SPH_C32(0x40cf130d), SPH_C32(0x3d700f24), SPH_C32(0xcc736312), - SPH_C32(0xb3ce4f0e) }, - { SPH_C32(0xd9b70000), SPH_C32(0xf94c000e), SPH_C32(0x0adfe000), - SPH_C32(0xe3130000), SPH_C32(0xe0635d6c), SPH_C32(0x2945eea9), - SPH_C32(0xc1f22225), SPH_C32(0x00681320), SPH_C32(0x2f300000), - SPH_C32(0x061e006c), SPH_C32(0x6ac06000), SPH_C32(0x17290000), - SPH_C32(0x23772e67), SPH_C32(0x45ca9b44), SPH_C32(0xeddcc2f8), - SPH_C32(0x036b573a) }, - { SPH_C32(0x6f790000), SPH_C32(0x23a5000c), SPH_C32(0x1fb16000), - SPH_C32(0x39810000), SPH_C32(0x16be0708), SPH_C32(0x1f77b223), - SPH_C32(0x3380ca8b), SPH_C32(0xa6d0d1ad), SPH_C32(0xa9490000), - SPH_C32(0x3927006e), SPH_C32(0x8b5a8000), SPH_C32(0x8f7f0000), - SPH_C32(0xb6124969), SPH_C32(0x0b4253ae), SPH_C32(0x3e018bbc), - SPH_C32(0x15768d83) }, - { SPH_C32(0xe9000000), SPH_C32(0x1c9c000e), SPH_C32(0xfe2b8000), - SPH_C32(0xa1d70000), SPH_C32(0x83db6006), SPH_C32(0x51ff7ac9), - SPH_C32(0xe05d83cf), SPH_C32(0xb0cd0b14), SPH_C32(0x99fe0000), - SPH_C32(0xdcf7006e), SPH_C32(0x7faee000), SPH_C32(0xcdbb0000), - SPH_C32(0xd5aa7403), SPH_C32(0x73f8c7ce), SPH_C32(0x1fae2a56), - SPH_C32(0xa5d395b7) }, - { SPH_C32(0x4bd70000), SPH_C32(0xe5bf0030), SPH_C32(0xbb9a0000), - SPH_C32(0x3ff30000), SPH_C32(0x6e6a5dd2), SPH_C32(0x5b3e8a36), - SPH_C32(0x73c97bd1), SPH_C32(0xcdbf1219), SPH_C32(0xfcc40000), - SPH_C32(0xd9800078), SPH_C32(0x6cf20000), SPH_C32(0xffa30000), - SPH_C32(0x9bd151ab), SPH_C32(0x181bb131), SPH_C32(0xde4ed244), - SPH_C32(0x8980d6d9) }, - { SPH_C32(0xcdae0000), SPH_C32(0xda860032), SPH_C32(0x5a00e000), - SPH_C32(0xa7a50000), SPH_C32(0xfb0f3adc), SPH_C32(0x15b642dc), - SPH_C32(0xa0143295), SPH_C32(0xdba2c8a0), SPH_C32(0xcc730000), - SPH_C32(0x3c500078), SPH_C32(0x98066000), SPH_C32(0xbd670000), - SPH_C32(0xf8696cc1), SPH_C32(0x60a12551), SPH_C32(0xffe173ae), - SPH_C32(0x3925ceed) }, - { SPH_C32(0x7b600000), SPH_C32(0x006f0030), SPH_C32(0x4f6e6000), - SPH_C32(0x7d370000), SPH_C32(0x0dd260b8), SPH_C32(0x23841e56), - SPH_C32(0x5266da3b), SPH_C32(0x7d1a0a2d), SPH_C32(0x4a0a0000), - SPH_C32(0x0369007a), SPH_C32(0x799c8000), SPH_C32(0x25310000), - SPH_C32(0x6d0c0bcf), SPH_C32(0x2e29edbb), SPH_C32(0x2c3c3aea), - SPH_C32(0x2f381454) }, - { SPH_C32(0xfd190000), SPH_C32(0x3f560032), SPH_C32(0xaef48000), - SPH_C32(0xe5610000), SPH_C32(0x98b707b6), SPH_C32(0x6d0cd6bc), - SPH_C32(0x81bb937f), SPH_C32(0x6b07d094), SPH_C32(0x7abd0000), - SPH_C32(0xe6b9007a), SPH_C32(0x8d68e000), SPH_C32(0x67f50000), - SPH_C32(0x0eb436a5), SPH_C32(0x569379db), SPH_C32(0x0d939b00), - SPH_C32(0x9f9d0c60) }, - { SPH_C32(0xe8dd0000), SPH_C32(0xfa4a0044), SPH_C32(0x3c2d0000), - SPH_C32(0xbb150000), SPH_C32(0x80bd361b), SPH_C32(0x24e81d44), - SPH_C32(0xbfa8c2f4), SPH_C32(0x524a0d59), SPH_C32(0x54500000), - SPH_C32(0x0671005c), SPH_C32(0x25ae0000), SPH_C32(0x6a1e0000), - SPH_C32(0x2ea54edf), SPH_C32(0x664e8512), SPH_C32(0xbfba18c3), - SPH_C32(0x7e715d17) }, - { SPH_C32(0x6ea40000), SPH_C32(0xc5730046), SPH_C32(0xddb7e000), - SPH_C32(0x23430000), SPH_C32(0x15d85115), SPH_C32(0x6a60d5ae), - SPH_C32(0x6c758bb0), SPH_C32(0x4457d7e0), SPH_C32(0x64e70000), - SPH_C32(0xe3a1005c), SPH_C32(0xd15a6000), SPH_C32(0x28da0000), - SPH_C32(0x4d1d73b5), SPH_C32(0x1ef41172), SPH_C32(0x9e15b929), - SPH_C32(0xced44523) }, - { SPH_C32(0xd86a0000), SPH_C32(0x1f9a0044), SPH_C32(0xc8d96000), - SPH_C32(0xf9d10000), SPH_C32(0xe3050b71), SPH_C32(0x5c528924), - SPH_C32(0x9e07631e), SPH_C32(0xe2ef156d), SPH_C32(0xe29e0000), - SPH_C32(0xdc98005e), SPH_C32(0x30c08000), SPH_C32(0xb08c0000), - SPH_C32(0xd87814bb), SPH_C32(0x507cd998), SPH_C32(0x4dc8f06d), - SPH_C32(0xd8c99f9a) }, - { SPH_C32(0x5e130000), SPH_C32(0x20a30046), SPH_C32(0x29438000), - SPH_C32(0x61870000), SPH_C32(0x76606c7f), SPH_C32(0x12da41ce), - SPH_C32(0x4dda2a5a), SPH_C32(0xf4f2cfd4), SPH_C32(0xd2290000), - SPH_C32(0x3948005e), SPH_C32(0xc434e000), SPH_C32(0xf2480000), - SPH_C32(0xbbc029d1), SPH_C32(0x28c64df8), SPH_C32(0x6c675187), - SPH_C32(0x686c87ae) }, - { SPH_C32(0xfcc40000), SPH_C32(0xd9800078), SPH_C32(0x6cf20000), - SPH_C32(0xffa30000), SPH_C32(0x9bd151ab), SPH_C32(0x181bb131), - SPH_C32(0xde4ed244), SPH_C32(0x8980d6d9), SPH_C32(0xb7130000), - SPH_C32(0x3c3f0048), SPH_C32(0xd7680000), SPH_C32(0xc0500000), - SPH_C32(0xf5bb0c79), SPH_C32(0x43253b07), SPH_C32(0xad87a995), - SPH_C32(0x443fc4c0) }, - { SPH_C32(0x7abd0000), SPH_C32(0xe6b9007a), SPH_C32(0x8d68e000), - SPH_C32(0x67f50000), SPH_C32(0x0eb436a5), SPH_C32(0x569379db), - SPH_C32(0x0d939b00), SPH_C32(0x9f9d0c60), SPH_C32(0x87a40000), - SPH_C32(0xd9ef0048), SPH_C32(0x239c6000), SPH_C32(0x82940000), - SPH_C32(0x96033113), SPH_C32(0x3b9faf67), SPH_C32(0x8c28087f), - SPH_C32(0xf49adcf4) }, - { SPH_C32(0xcc730000), SPH_C32(0x3c500078), SPH_C32(0x98066000), - SPH_C32(0xbd670000), SPH_C32(0xf8696cc1), SPH_C32(0x60a12551), - SPH_C32(0xffe173ae), SPH_C32(0x3925ceed), SPH_C32(0x01dd0000), - SPH_C32(0xe6d6004a), SPH_C32(0xc2068000), SPH_C32(0x1ac20000), - SPH_C32(0x0366561d), SPH_C32(0x7517678d), SPH_C32(0x5ff5413b), - SPH_C32(0xe287064d) }, - { SPH_C32(0x4a0a0000), SPH_C32(0x0369007a), SPH_C32(0x799c8000), - SPH_C32(0x25310000), SPH_C32(0x6d0c0bcf), SPH_C32(0x2e29edbb), - SPH_C32(0x2c3c3aea), SPH_C32(0x2f381454), SPH_C32(0x316a0000), - SPH_C32(0x0306004a), SPH_C32(0x36f2e000), SPH_C32(0x58060000), - SPH_C32(0x60de6b77), SPH_C32(0x0dadf3ed), SPH_C32(0x7e5ae0d1), - SPH_C32(0x52221e79) }, - { SPH_C32(0x0b9e0000), SPH_C32(0xc0040050), SPH_C32(0xceeb0000), - SPH_C32(0x115b0000), SPH_C32(0x5ba374bd), SPH_C32(0x0183a351), - SPH_C32(0xad9573a2), SPH_C32(0x6804948e), SPH_C32(0xa30a0000), - SPH_C32(0x1ff50074), SPH_C32(0x87b70000), SPH_C32(0x84e60000), - SPH_C32(0xeed76bc9), SPH_C32(0x7fd69772), SPH_C32(0xcc61b925), - SPH_C32(0x9ff51f40) }, - { SPH_C32(0x8de70000), SPH_C32(0xff3d0052), SPH_C32(0x2f71e000), - SPH_C32(0x890d0000), SPH_C32(0xcec613b3), SPH_C32(0x4f0b6bbb), - SPH_C32(0x7e483ae6), SPH_C32(0x7e194e37), SPH_C32(0x93bd0000), - SPH_C32(0xfa250074), SPH_C32(0x73436000), SPH_C32(0xc6220000), - SPH_C32(0x8d6f56a3), SPH_C32(0x076c0312), SPH_C32(0xedce18cf), - SPH_C32(0x2f500774) }, - { SPH_C32(0x3b290000), SPH_C32(0x25d40050), SPH_C32(0x3a1f6000), - SPH_C32(0x539f0000), SPH_C32(0x381b49d7), SPH_C32(0x79393731), - SPH_C32(0x8c3ad248), SPH_C32(0xd8a18cba), SPH_C32(0x15c40000), - SPH_C32(0xc51c0076), SPH_C32(0x92d98000), SPH_C32(0x5e740000), - SPH_C32(0x180a31ad), SPH_C32(0x49e4cbf8), SPH_C32(0x3e13518b), - SPH_C32(0x394dddcd) }, - { SPH_C32(0xbd500000), SPH_C32(0x1aed0052), SPH_C32(0xdb858000), - SPH_C32(0xcbc90000), SPH_C32(0xad7e2ed9), SPH_C32(0x37b1ffdb), - SPH_C32(0x5fe79b0c), SPH_C32(0xcebc5603), SPH_C32(0x25730000), - SPH_C32(0x20cc0076), SPH_C32(0x662de000), SPH_C32(0x1cb00000), - SPH_C32(0x7bb20cc7), SPH_C32(0x315e5f98), SPH_C32(0x1fbcf061), - SPH_C32(0x89e8c5f9) }, - { SPH_C32(0x1f870000), SPH_C32(0xe3ce006c), SPH_C32(0x9e340000), - SPH_C32(0x55ed0000), SPH_C32(0x40cf130d), SPH_C32(0x3d700f24), - SPH_C32(0xcc736312), SPH_C32(0xb3ce4f0e), SPH_C32(0x40490000), - SPH_C32(0x25bb0060), SPH_C32(0x75710000), SPH_C32(0x2ea80000), - SPH_C32(0x35c9296f), SPH_C32(0x5abd2967), SPH_C32(0xde5c0873), - SPH_C32(0xa5bb8697) }, - { SPH_C32(0x99fe0000), SPH_C32(0xdcf7006e), SPH_C32(0x7faee000), - SPH_C32(0xcdbb0000), SPH_C32(0xd5aa7403), SPH_C32(0x73f8c7ce), - SPH_C32(0x1fae2a56), SPH_C32(0xa5d395b7), SPH_C32(0x70fe0000), - SPH_C32(0xc06b0060), SPH_C32(0x81856000), SPH_C32(0x6c6c0000), - SPH_C32(0x56711405), SPH_C32(0x2207bd07), SPH_C32(0xfff3a999), - SPH_C32(0x151e9ea3) }, - { SPH_C32(0x2f300000), SPH_C32(0x061e006c), SPH_C32(0x6ac06000), - SPH_C32(0x17290000), SPH_C32(0x23772e67), SPH_C32(0x45ca9b44), - SPH_C32(0xeddcc2f8), SPH_C32(0x036b573a), SPH_C32(0xf6870000), - SPH_C32(0xff520062), SPH_C32(0x601f8000), SPH_C32(0xf43a0000), - SPH_C32(0xc314730b), SPH_C32(0x6c8f75ed), SPH_C32(0x2c2ee0dd), - SPH_C32(0x0303441a) }, - { SPH_C32(0xa9490000), SPH_C32(0x3927006e), SPH_C32(0x8b5a8000), - SPH_C32(0x8f7f0000), SPH_C32(0xb6124969), SPH_C32(0x0b4253ae), - SPH_C32(0x3e018bbc), SPH_C32(0x15768d83), SPH_C32(0xc6300000), - SPH_C32(0x1a820062), SPH_C32(0x94ebe000), SPH_C32(0xb6fe0000), - SPH_C32(0xa0ac4e61), SPH_C32(0x1435e18d), SPH_C32(0x0d814137), - SPH_C32(0xb3a65c2e) }, - { SPH_C32(0x69510000), SPH_C32(0xd4e1009c), SPH_C32(0xc3230000), - SPH_C32(0xac2f0000), SPH_C32(0xe4950bae), SPH_C32(0xcea415dc), - SPH_C32(0x87ec287c), SPH_C32(0xbce1a3ce), SPH_C32(0xc6730000), - SPH_C32(0xaf8d000c), SPH_C32(0xa4c10000), SPH_C32(0x218d0000), - SPH_C32(0x23111587), SPH_C32(0x7913512f), SPH_C32(0x1d28ac88), - SPH_C32(0x378dd173) }, - { SPH_C32(0xef280000), SPH_C32(0xebd8009e), SPH_C32(0x22b9e000), - SPH_C32(0x34790000), SPH_C32(0x71f06ca0), SPH_C32(0x802cdd36), - SPH_C32(0x54316138), SPH_C32(0xaafc7977), SPH_C32(0xf6c40000), - SPH_C32(0x4a5d000c), SPH_C32(0x50356000), SPH_C32(0x63490000), - SPH_C32(0x40a928ed), SPH_C32(0x01a9c54f), SPH_C32(0x3c870d62), - SPH_C32(0x8728c947) }, - { SPH_C32(0x59e60000), SPH_C32(0x3131009c), SPH_C32(0x37d76000), - SPH_C32(0xeeeb0000), SPH_C32(0x872d36c4), SPH_C32(0xb61e81bc), - SPH_C32(0xa6438996), SPH_C32(0x0c44bbfa), SPH_C32(0x70bd0000), - SPH_C32(0x7564000e), SPH_C32(0xb1af8000), SPH_C32(0xfb1f0000), - SPH_C32(0xd5cc4fe3), SPH_C32(0x4f210da5), SPH_C32(0xef5a4426), - SPH_C32(0x913513fe) }, - { SPH_C32(0xdf9f0000), SPH_C32(0x0e08009e), SPH_C32(0xd64d8000), - SPH_C32(0x76bd0000), SPH_C32(0x124851ca), SPH_C32(0xf8964956), - SPH_C32(0x759ec0d2), SPH_C32(0x1a596143), SPH_C32(0x400a0000), - SPH_C32(0x90b4000e), SPH_C32(0x455be000), SPH_C32(0xb9db0000), - SPH_C32(0xb6747289), SPH_C32(0x379b99c5), SPH_C32(0xcef5e5cc), - SPH_C32(0x21900bca) }, - { SPH_C32(0x7d480000), SPH_C32(0xf72b00a0), SPH_C32(0x93fc0000), - SPH_C32(0xe8990000), SPH_C32(0xfff96c1e), SPH_C32(0xf257b9a9), - SPH_C32(0xe60a38cc), SPH_C32(0x672b784e), SPH_C32(0x25300000), - SPH_C32(0x95c30018), SPH_C32(0x56070000), SPH_C32(0x8bc30000), - SPH_C32(0xf80f5721), SPH_C32(0x5c78ef3a), SPH_C32(0x0f151dde), - SPH_C32(0x0dc348a4) }, - { SPH_C32(0xfb310000), SPH_C32(0xc81200a2), SPH_C32(0x7266e000), - SPH_C32(0x70cf0000), SPH_C32(0x6a9c0b10), SPH_C32(0xbcdf7143), - SPH_C32(0x35d77188), SPH_C32(0x7136a2f7), SPH_C32(0x15870000), - SPH_C32(0x70130018), SPH_C32(0xa2f36000), SPH_C32(0xc9070000), - SPH_C32(0x9bb76a4b), SPH_C32(0x24c27b5a), SPH_C32(0x2ebabc34), - SPH_C32(0xbd665090) }, - { SPH_C32(0x4dff0000), SPH_C32(0x12fb00a0), SPH_C32(0x67086000), - SPH_C32(0xaa5d0000), SPH_C32(0x9c415174), SPH_C32(0x8aed2dc9), - SPH_C32(0xc7a59926), SPH_C32(0xd78e607a), SPH_C32(0x93fe0000), - SPH_C32(0x4f2a001a), SPH_C32(0x43698000), SPH_C32(0x51510000), - SPH_C32(0x0ed20d45), SPH_C32(0x6a4ab3b0), SPH_C32(0xfd67f570), - SPH_C32(0xab7b8a29) }, - { SPH_C32(0xcb860000), SPH_C32(0x2dc200a2), SPH_C32(0x86928000), - SPH_C32(0x320b0000), SPH_C32(0x0924367a), SPH_C32(0xc465e523), - SPH_C32(0x1478d062), SPH_C32(0xc193bac3), SPH_C32(0xa3490000), - SPH_C32(0xaafa001a), SPH_C32(0xb79de000), SPH_C32(0x13950000), - SPH_C32(0x6d6a302f), SPH_C32(0x12f027d0), SPH_C32(0xdcc8549a), - SPH_C32(0x1bde921d) }, - { SPH_C32(0x8a120000), SPH_C32(0xeeaf0088), SPH_C32(0x31e50000), - SPH_C32(0x06610000), SPH_C32(0x3f8b4908), SPH_C32(0xebcfabc9), - SPH_C32(0x95d1992a), SPH_C32(0x86af3a19), SPH_C32(0x31290000), - SPH_C32(0xb6090024), SPH_C32(0x06d80000), SPH_C32(0xcf750000), - SPH_C32(0xe3633091), SPH_C32(0x608b434f), SPH_C32(0x6ef30d6e), - SPH_C32(0xd6099324) }, - { SPH_C32(0x0c6b0000), SPH_C32(0xd196008a), SPH_C32(0xd07fe000), - SPH_C32(0x9e370000), SPH_C32(0xaaee2e06), SPH_C32(0xa5476323), - SPH_C32(0x460cd06e), SPH_C32(0x90b2e0a0), SPH_C32(0x019e0000), - SPH_C32(0x53d90024), SPH_C32(0xf22c6000), SPH_C32(0x8db10000), - SPH_C32(0x80db0dfb), SPH_C32(0x1831d72f), SPH_C32(0x4f5cac84), - SPH_C32(0x66ac8b10) }, - { SPH_C32(0xbaa50000), SPH_C32(0x0b7f0088), SPH_C32(0xc5116000), - SPH_C32(0x44a50000), SPH_C32(0x5c337462), SPH_C32(0x93753fa9), - SPH_C32(0xb47e38c0), SPH_C32(0x360a222d), SPH_C32(0x87e70000), - SPH_C32(0x6ce00026), SPH_C32(0x13b68000), SPH_C32(0x15e70000), - SPH_C32(0x15be6af5), SPH_C32(0x56b91fc5), SPH_C32(0x9c81e5c0), - SPH_C32(0x70b151a9) }, - { SPH_C32(0x3cdc0000), SPH_C32(0x3446008a), SPH_C32(0x248b8000), - SPH_C32(0xdcf30000), SPH_C32(0xc956136c), SPH_C32(0xddfdf743), - SPH_C32(0x67a37184), SPH_C32(0x2017f894), SPH_C32(0xb7500000), - SPH_C32(0x89300026), SPH_C32(0xe742e000), SPH_C32(0x57230000), - SPH_C32(0x7606579f), SPH_C32(0x2e038ba5), SPH_C32(0xbd2e442a), - SPH_C32(0xc014499d) }, - { SPH_C32(0x9e0b0000), SPH_C32(0xcd6500b4), SPH_C32(0x613a0000), - SPH_C32(0x42d70000), SPH_C32(0x24e72eb8), SPH_C32(0xd73c07bc), - SPH_C32(0xf437899a), SPH_C32(0x5d65e199), SPH_C32(0xd26a0000), - SPH_C32(0x8c470030), SPH_C32(0xf41e0000), SPH_C32(0x653b0000), - SPH_C32(0x387d7237), SPH_C32(0x45e0fd5a), SPH_C32(0x7ccebc38), - SPH_C32(0xec470af3) }, - { SPH_C32(0x18720000), SPH_C32(0xf25c00b6), SPH_C32(0x80a0e000), - SPH_C32(0xda810000), SPH_C32(0xb18249b6), SPH_C32(0x99b4cf56), - SPH_C32(0x27eac0de), SPH_C32(0x4b783b20), SPH_C32(0xe2dd0000), - SPH_C32(0x69970030), SPH_C32(0x00ea6000), SPH_C32(0x27ff0000), - SPH_C32(0x5bc54f5d), SPH_C32(0x3d5a693a), SPH_C32(0x5d611dd2), - SPH_C32(0x5ce212c7) }, - { SPH_C32(0xaebc0000), SPH_C32(0x28b500b4), SPH_C32(0x95ce6000), - SPH_C32(0x00130000), SPH_C32(0x475f13d2), SPH_C32(0xaf8693dc), - SPH_C32(0xd5982870), SPH_C32(0xedc0f9ad), SPH_C32(0x64a40000), - SPH_C32(0x56ae0032), SPH_C32(0xe1708000), SPH_C32(0xbfa90000), - SPH_C32(0xcea02853), SPH_C32(0x73d2a1d0), SPH_C32(0x8ebc5496), - SPH_C32(0x4affc87e) }, - { SPH_C32(0x28c50000), SPH_C32(0x178c00b6), SPH_C32(0x74548000), - SPH_C32(0x98450000), SPH_C32(0xd23a74dc), SPH_C32(0xe10e5b36), - SPH_C32(0x06456134), SPH_C32(0xfbdd2314), SPH_C32(0x54130000), - SPH_C32(0xb37e0032), SPH_C32(0x1584e000), SPH_C32(0xfd6d0000), - SPH_C32(0xad181539), SPH_C32(0x0b6835b0), SPH_C32(0xaf13f57c), - SPH_C32(0xfa5ad04a) }, - { SPH_C32(0x3d010000), SPH_C32(0xd29000c0), SPH_C32(0xe68d0000), - SPH_C32(0xc6310000), SPH_C32(0xca304571), SPH_C32(0xa8ea90ce), - SPH_C32(0x385630bf), SPH_C32(0xc290fed9), SPH_C32(0x7afe0000), - SPH_C32(0x53b60014), SPH_C32(0xbd420000), SPH_C32(0xf0860000), - SPH_C32(0x8d096d43), SPH_C32(0x3bb5c979), SPH_C32(0x1d3a76bf), - SPH_C32(0x1bb6813d) }, - { SPH_C32(0xbb780000), SPH_C32(0xeda900c2), SPH_C32(0x0717e000), - SPH_C32(0x5e670000), SPH_C32(0x5f55227f), SPH_C32(0xe6625824), - SPH_C32(0xeb8b79fb), SPH_C32(0xd48d2460), SPH_C32(0x4a490000), - SPH_C32(0xb6660014), SPH_C32(0x49b66000), SPH_C32(0xb2420000), - SPH_C32(0xeeb15029), SPH_C32(0x430f5d19), SPH_C32(0x3c95d755), - SPH_C32(0xab139909) }, - { SPH_C32(0x0db60000), SPH_C32(0x374000c0), SPH_C32(0x12796000), - SPH_C32(0x84f50000), SPH_C32(0xa988781b), SPH_C32(0xd05004ae), - SPH_C32(0x19f99155), SPH_C32(0x7235e6ed), SPH_C32(0xcc300000), - SPH_C32(0x895f0016), SPH_C32(0xa82c8000), SPH_C32(0x2a140000), - SPH_C32(0x7bd43727), SPH_C32(0x0d8795f3), SPH_C32(0xef489e11), - SPH_C32(0xbd0e43b0) }, - { SPH_C32(0x8bcf0000), SPH_C32(0x087900c2), SPH_C32(0xf3e38000), - SPH_C32(0x1ca30000), SPH_C32(0x3ced1f15), SPH_C32(0x9ed8cc44), - SPH_C32(0xca24d811), SPH_C32(0x64283c54), SPH_C32(0xfc870000), - SPH_C32(0x6c8f0016), SPH_C32(0x5cd8e000), SPH_C32(0x68d00000), - SPH_C32(0x186c0a4d), SPH_C32(0x753d0193), SPH_C32(0xcee73ffb), - SPH_C32(0x0dab5b84) }, - { SPH_C32(0x29180000), SPH_C32(0xf15a00fc), SPH_C32(0xb6520000), - SPH_C32(0x82870000), SPH_C32(0xd15c22c1), SPH_C32(0x94193cbb), - SPH_C32(0x59b0200f), SPH_C32(0x195a2559), SPH_C32(0x99bd0000), - SPH_C32(0x69f80000), SPH_C32(0x4f840000), SPH_C32(0x5ac80000), - SPH_C32(0x56172fe5), SPH_C32(0x1ede776c), SPH_C32(0x0f07c7e9), - SPH_C32(0x21f818ea) }, - { SPH_C32(0xaf610000), SPH_C32(0xce6300fe), SPH_C32(0x57c8e000), - SPH_C32(0x1ad10000), SPH_C32(0x443945cf), SPH_C32(0xda91f451), - SPH_C32(0x8a6d694b), SPH_C32(0x0f47ffe0), SPH_C32(0xa90a0000), - SPH_C32(0x8c280000), SPH_C32(0xbb706000), SPH_C32(0x180c0000), - SPH_C32(0x35af128f), SPH_C32(0x6664e30c), SPH_C32(0x2ea86603), - SPH_C32(0x915d00de) }, - { SPH_C32(0x19af0000), SPH_C32(0x148a00fc), SPH_C32(0x42a66000), - SPH_C32(0xc0430000), SPH_C32(0xb2e41fab), SPH_C32(0xeca3a8db), - SPH_C32(0x781f81e5), SPH_C32(0xa9ff3d6d), SPH_C32(0x2f730000), - SPH_C32(0xb3110002), SPH_C32(0x5aea8000), SPH_C32(0x805a0000), - SPH_C32(0xa0ca7581), SPH_C32(0x28ec2be6), SPH_C32(0xfd752f47), - SPH_C32(0x8740da67) }, - { SPH_C32(0x9fd60000), SPH_C32(0x2bb300fe), SPH_C32(0xa33c8000), - SPH_C32(0x58150000), SPH_C32(0x278178a5), SPH_C32(0xa22b6031), - SPH_C32(0xabc2c8a1), SPH_C32(0xbfe2e7d4), SPH_C32(0x1fc40000), - SPH_C32(0x56c10002), SPH_C32(0xae1ee000), SPH_C32(0xc29e0000), - SPH_C32(0xc37248eb), SPH_C32(0x5056bf86), SPH_C32(0xdcda8ead), - SPH_C32(0x37e5c253) }, - { SPH_C32(0xde420000), SPH_C32(0xe8de00d4), SPH_C32(0x144b0000), - SPH_C32(0x6c7f0000), SPH_C32(0x112e07d7), SPH_C32(0x8d812edb), - SPH_C32(0x2a6b81e9), SPH_C32(0xf8de670e), SPH_C32(0x8da40000), - SPH_C32(0x4a32003c), SPH_C32(0x1f5b0000), SPH_C32(0x1e7e0000), - SPH_C32(0x4d7b4855), SPH_C32(0x222ddb19), SPH_C32(0x6ee1d759), - SPH_C32(0xfa32c36a) }, - { SPH_C32(0x583b0000), SPH_C32(0xd7e700d6), SPH_C32(0xf5d1e000), - SPH_C32(0xf4290000), SPH_C32(0x844b60d9), SPH_C32(0xc309e631), - SPH_C32(0xf9b6c8ad), SPH_C32(0xeec3bdb7), SPH_C32(0xbd130000), - SPH_C32(0xafe2003c), SPH_C32(0xebaf6000), SPH_C32(0x5cba0000), - SPH_C32(0x2ec3753f), SPH_C32(0x5a974f79), SPH_C32(0x4f4e76b3), - SPH_C32(0x4a97db5e) }, - { SPH_C32(0xeef50000), SPH_C32(0x0d0e00d4), SPH_C32(0xe0bf6000), - SPH_C32(0x2ebb0000), SPH_C32(0x72963abd), SPH_C32(0xf53bbabb), - SPH_C32(0x0bc42003), SPH_C32(0x487b7f3a), SPH_C32(0x3b6a0000), - SPH_C32(0x90db003e), SPH_C32(0x0a358000), SPH_C32(0xc4ec0000), - SPH_C32(0xbba61231), SPH_C32(0x141f8793), SPH_C32(0x9c933ff7), - SPH_C32(0x5c8a01e7) }, - { SPH_C32(0x688c0000), SPH_C32(0x323700d6), SPH_C32(0x01258000), - SPH_C32(0xb6ed0000), SPH_C32(0xe7f35db3), SPH_C32(0xbbb37251), - SPH_C32(0xd8196947), SPH_C32(0x5e66a583), SPH_C32(0x0bdd0000), - SPH_C32(0x750b003e), SPH_C32(0xfec1e000), SPH_C32(0x86280000), - SPH_C32(0xd81e2f5b), SPH_C32(0x6ca513f3), SPH_C32(0xbd3c9e1d), - SPH_C32(0xec2f19d3) }, - { SPH_C32(0xca5b0000), SPH_C32(0xcb1400e8), SPH_C32(0x44940000), - SPH_C32(0x28c90000), SPH_C32(0x0a426067), SPH_C32(0xb17282ae), - SPH_C32(0x4b8d9159), SPH_C32(0x2314bc8e), SPH_C32(0x6ee70000), - SPH_C32(0x707c0028), SPH_C32(0xed9d0000), SPH_C32(0xb4300000), - SPH_C32(0x96650af3), SPH_C32(0x0746650c), SPH_C32(0x7cdc660f), - SPH_C32(0xc07c5abd) }, - { SPH_C32(0x4c220000), SPH_C32(0xf42d00ea), SPH_C32(0xa50ee000), - SPH_C32(0xb09f0000), SPH_C32(0x9f270769), SPH_C32(0xfffa4a44), - SPH_C32(0x9850d81d), SPH_C32(0x35096637), SPH_C32(0x5e500000), - SPH_C32(0x95ac0028), SPH_C32(0x19696000), SPH_C32(0xf6f40000), - SPH_C32(0xf5dd3799), SPH_C32(0x7ffcf16c), SPH_C32(0x5d73c7e5), - SPH_C32(0x70d94289) }, - { SPH_C32(0xfaec0000), SPH_C32(0x2ec400e8), SPH_C32(0xb0606000), - SPH_C32(0x6a0d0000), SPH_C32(0x69fa5d0d), SPH_C32(0xc9c816ce), - SPH_C32(0x6a2230b3), SPH_C32(0x93b1a4ba), SPH_C32(0xd8290000), - SPH_C32(0xaa95002a), SPH_C32(0xf8f38000), SPH_C32(0x6ea20000), - SPH_C32(0x60b85097), SPH_C32(0x31743986), SPH_C32(0x8eae8ea1), - SPH_C32(0x66c49830) }, - { SPH_C32(0x7c950000), SPH_C32(0x11fd00ea), SPH_C32(0x51fa8000), - SPH_C32(0xf25b0000), SPH_C32(0xfc9f3a03), SPH_C32(0x8740de24), - SPH_C32(0xb9ff79f7), SPH_C32(0x85ac7e03), SPH_C32(0xe89e0000), - SPH_C32(0x4f45002a), SPH_C32(0x0c07e000), SPH_C32(0x2c660000), - SPH_C32(0x03006dfd), SPH_C32(0x49ceade6), SPH_C32(0xaf012f4b), - SPH_C32(0xd6618004) }, - { SPH_C32(0xd5dc0000), SPH_C32(0x28da0084), SPH_C32(0xdaa00000), - SPH_C32(0x7d240000), SPH_C32(0x4a8d736a), SPH_C32(0x8c028d8a), - SPH_C32(0x87fef24b), SPH_C32(0x90daf380), SPH_C32(0x2eae0000), - SPH_C32(0x55c70048), SPH_C32(0x98ec0000), SPH_C32(0x9a980000), - SPH_C32(0xa3ac239c), SPH_C32(0x5dfb4c6b), SPH_C32(0xa2806e7c), - SPH_C32(0x65c7dc2a) }, - { SPH_C32(0x53a50000), SPH_C32(0x17e30086), SPH_C32(0x3b3ae000), - SPH_C32(0xe5720000), SPH_C32(0xdfe81464), SPH_C32(0xc28a4560), - SPH_C32(0x5423bb0f), SPH_C32(0x86c72939), SPH_C32(0x1e190000), - SPH_C32(0xb0170048), SPH_C32(0x6c186000), SPH_C32(0xd85c0000), - SPH_C32(0xc0141ef6), SPH_C32(0x2541d80b), SPH_C32(0x832fcf96), - SPH_C32(0xd562c41e) }, - { SPH_C32(0xe56b0000), SPH_C32(0xcd0a0084), SPH_C32(0x2e546000), - SPH_C32(0x3fe00000), SPH_C32(0x29354e00), SPH_C32(0xf4b819ea), - SPH_C32(0xa65153a1), SPH_C32(0x207febb4), SPH_C32(0x98600000), - SPH_C32(0x8f2e004a), SPH_C32(0x8d828000), SPH_C32(0x400a0000), - SPH_C32(0x557179f8), SPH_C32(0x6bc910e1), SPH_C32(0x50f286d2), - SPH_C32(0xc37f1ea7) }, - { SPH_C32(0x63120000), SPH_C32(0xf2330086), SPH_C32(0xcfce8000), - SPH_C32(0xa7b60000), SPH_C32(0xbc50290e), SPH_C32(0xba30d100), - SPH_C32(0x758c1ae5), SPH_C32(0x3662310d), SPH_C32(0xa8d70000), - SPH_C32(0x6afe004a), SPH_C32(0x7976e000), SPH_C32(0x02ce0000), - SPH_C32(0x36c94492), SPH_C32(0x13738481), SPH_C32(0x715d2738), - SPH_C32(0x73da0693) }, - { SPH_C32(0xc1c50000), SPH_C32(0x0b1000b8), SPH_C32(0x8a7f0000), - SPH_C32(0x39920000), SPH_C32(0x51e114da), SPH_C32(0xb0f121ff), - SPH_C32(0xe618e2fb), SPH_C32(0x4b102800), SPH_C32(0xcded0000), - SPH_C32(0x6f89005c), SPH_C32(0x6a2a0000), SPH_C32(0x30d60000), - SPH_C32(0x78b2613a), SPH_C32(0x7890f27e), SPH_C32(0xb0bddf2a), - SPH_C32(0x5f8945fd) }, - { SPH_C32(0x47bc0000), SPH_C32(0x342900ba), SPH_C32(0x6be5e000), - SPH_C32(0xa1c40000), SPH_C32(0xc48473d4), SPH_C32(0xfe79e915), - SPH_C32(0x35c5abbf), SPH_C32(0x5d0df2b9), SPH_C32(0xfd5a0000), - SPH_C32(0x8a59005c), SPH_C32(0x9ede6000), SPH_C32(0x72120000), - SPH_C32(0x1b0a5c50), SPH_C32(0x002a661e), SPH_C32(0x91127ec0), - SPH_C32(0xef2c5dc9) }, - { SPH_C32(0xf1720000), SPH_C32(0xeec000b8), SPH_C32(0x7e8b6000), - SPH_C32(0x7b560000), SPH_C32(0x325929b0), SPH_C32(0xc84bb59f), - SPH_C32(0xc7b74311), SPH_C32(0xfbb53034), SPH_C32(0x7b230000), - SPH_C32(0xb560005e), SPH_C32(0x7f448000), SPH_C32(0xea440000), - SPH_C32(0x8e6f3b5e), SPH_C32(0x4ea2aef4), SPH_C32(0x42cf3784), - SPH_C32(0xf9318770) }, - { SPH_C32(0x770b0000), SPH_C32(0xd1f900ba), SPH_C32(0x9f118000), - SPH_C32(0xe3000000), SPH_C32(0xa73c4ebe), SPH_C32(0x86c37d75), - SPH_C32(0x146a0a55), SPH_C32(0xeda8ea8d), SPH_C32(0x4b940000), - SPH_C32(0x50b0005e), SPH_C32(0x8bb0e000), SPH_C32(0xa8800000), - SPH_C32(0xedd70634), SPH_C32(0x36183a94), SPH_C32(0x6360966e), - SPH_C32(0x49949f44) }, - { SPH_C32(0x369f0000), SPH_C32(0x12940090), SPH_C32(0x28660000), - SPH_C32(0xd76a0000), SPH_C32(0x919331cc), SPH_C32(0xa969339f), - SPH_C32(0x95c3431d), SPH_C32(0xaa946a57), SPH_C32(0xd9f40000), - SPH_C32(0x4c430060), SPH_C32(0x3af50000), SPH_C32(0x74600000), - SPH_C32(0x63de068a), SPH_C32(0x44635e0b), SPH_C32(0xd15bcf9a), - SPH_C32(0x84439e7d) }, - { SPH_C32(0xb0e60000), SPH_C32(0x2dad0092), SPH_C32(0xc9fce000), - SPH_C32(0x4f3c0000), SPH_C32(0x04f656c2), SPH_C32(0xe7e1fb75), - SPH_C32(0x461e0a59), SPH_C32(0xbc89b0ee), SPH_C32(0xe9430000), - SPH_C32(0xa9930060), SPH_C32(0xce016000), SPH_C32(0x36a40000), - SPH_C32(0x00663be0), SPH_C32(0x3cd9ca6b), SPH_C32(0xf0f46e70), - SPH_C32(0x34e68649) }, - { SPH_C32(0x06280000), SPH_C32(0xf7440090), SPH_C32(0xdc926000), - SPH_C32(0x95ae0000), SPH_C32(0xf22b0ca6), SPH_C32(0xd1d3a7ff), - SPH_C32(0xb46ce2f7), SPH_C32(0x1a317263), SPH_C32(0x6f3a0000), - SPH_C32(0x96aa0062), SPH_C32(0x2f9b8000), SPH_C32(0xaef20000), - SPH_C32(0x95035cee), SPH_C32(0x72510281), SPH_C32(0x23292734), - SPH_C32(0x22fb5cf0) }, - { SPH_C32(0x80510000), SPH_C32(0xc87d0092), SPH_C32(0x3d088000), - SPH_C32(0x0df80000), SPH_C32(0x674e6ba8), SPH_C32(0x9f5b6f15), - SPH_C32(0x67b1abb3), SPH_C32(0x0c2ca8da), SPH_C32(0x5f8d0000), - SPH_C32(0x737a0062), SPH_C32(0xdb6fe000), SPH_C32(0xec360000), - SPH_C32(0xf6bb6184), SPH_C32(0x0aeb96e1), SPH_C32(0x028686de), - SPH_C32(0x925e44c4) }, - { SPH_C32(0x22860000), SPH_C32(0x315e00ac), SPH_C32(0x78b90000), - SPH_C32(0x93dc0000), SPH_C32(0x8aff567c), SPH_C32(0x959a9fea), - SPH_C32(0xf42553ad), SPH_C32(0x715eb1d7), SPH_C32(0x3ab70000), - SPH_C32(0x760d0074), SPH_C32(0xc8330000), SPH_C32(0xde2e0000), - SPH_C32(0xb8c0442c), SPH_C32(0x6108e01e), SPH_C32(0xc3667ecc), - SPH_C32(0xbe0d07aa) }, - { SPH_C32(0xa4ff0000), SPH_C32(0x0e6700ae), SPH_C32(0x9923e000), - SPH_C32(0x0b8a0000), SPH_C32(0x1f9a3172), SPH_C32(0xdb125700), - SPH_C32(0x27f81ae9), SPH_C32(0x67436b6e), SPH_C32(0x0a000000), - SPH_C32(0x93dd0074), SPH_C32(0x3cc76000), SPH_C32(0x9cea0000), - SPH_C32(0xdb787946), SPH_C32(0x19b2747e), SPH_C32(0xe2c9df26), - SPH_C32(0x0ea81f9e) }, - { SPH_C32(0x12310000), SPH_C32(0xd48e00ac), SPH_C32(0x8c4d6000), - SPH_C32(0xd1180000), SPH_C32(0xe9476b16), SPH_C32(0xed200b8a), - SPH_C32(0xd58af247), SPH_C32(0xc1fba9e3), SPH_C32(0x8c790000), - SPH_C32(0xace40076), SPH_C32(0xdd5d8000), SPH_C32(0x04bc0000), - SPH_C32(0x4e1d1e48), SPH_C32(0x573abc94), SPH_C32(0x31149662), - SPH_C32(0x18b5c527) }, - { SPH_C32(0x94480000), SPH_C32(0xebb700ae), SPH_C32(0x6dd78000), - SPH_C32(0x494e0000), SPH_C32(0x7c220c18), SPH_C32(0xa3a8c360), - SPH_C32(0x0657bb03), SPH_C32(0xd7e6735a), SPH_C32(0xbcce0000), - SPH_C32(0x49340076), SPH_C32(0x29a9e000), SPH_C32(0x46780000), - SPH_C32(0x2da52322), SPH_C32(0x2f8028f4), SPH_C32(0x10bb3788), - SPH_C32(0xa810dd13) }, - { SPH_C32(0x818c0000), SPH_C32(0x2eab00d8), SPH_C32(0xff0e0000), - SPH_C32(0x173a0000), SPH_C32(0x64283db5), SPH_C32(0xea4c0898), - SPH_C32(0x3844ea88), SPH_C32(0xeeabae97), SPH_C32(0x92230000), - SPH_C32(0xa9fc0050), SPH_C32(0x816f0000), SPH_C32(0x4b930000), - SPH_C32(0x0db45b58), SPH_C32(0x1f5dd43d), SPH_C32(0xa292b44b), - SPH_C32(0x49fc8c64) }, - { SPH_C32(0x07f50000), SPH_C32(0x119200da), SPH_C32(0x1e94e000), - SPH_C32(0x8f6c0000), SPH_C32(0xf14d5abb), SPH_C32(0xa4c4c072), - SPH_C32(0xeb99a3cc), SPH_C32(0xf8b6742e), SPH_C32(0xa2940000), - SPH_C32(0x4c2c0050), SPH_C32(0x759b6000), SPH_C32(0x09570000), - SPH_C32(0x6e0c6632), SPH_C32(0x67e7405d), SPH_C32(0x833d15a1), - SPH_C32(0xf9599450) }, - { SPH_C32(0xb13b0000), SPH_C32(0xcb7b00d8), SPH_C32(0x0bfa6000), - SPH_C32(0x55fe0000), SPH_C32(0x079000df), SPH_C32(0x92f69cf8), - SPH_C32(0x19eb4b62), SPH_C32(0x5e0eb6a3), SPH_C32(0x24ed0000), - SPH_C32(0x73150052), SPH_C32(0x94018000), SPH_C32(0x91010000), - SPH_C32(0xfb69013c), SPH_C32(0x296f88b7), SPH_C32(0x50e05ce5), - SPH_C32(0xef444ee9) }, - { SPH_C32(0x37420000), SPH_C32(0xf44200da), SPH_C32(0xea608000), - SPH_C32(0xcda80000), SPH_C32(0x92f567d1), SPH_C32(0xdc7e5412), - SPH_C32(0xca360226), SPH_C32(0x48136c1a), SPH_C32(0x145a0000), - SPH_C32(0x96c50052), SPH_C32(0x60f5e000), SPH_C32(0xd3c50000), - SPH_C32(0x98d13c56), SPH_C32(0x51d51cd7), SPH_C32(0x714ffd0f), - SPH_C32(0x5fe156dd) }, - { SPH_C32(0x95950000), SPH_C32(0x0d6100e4), SPH_C32(0xafd10000), - SPH_C32(0x538c0000), SPH_C32(0x7f445a05), SPH_C32(0xd6bfa4ed), - SPH_C32(0x59a2fa38), SPH_C32(0x35617517), SPH_C32(0x71600000), - SPH_C32(0x93b20044), SPH_C32(0x73a90000), SPH_C32(0xe1dd0000), - SPH_C32(0xd6aa19fe), SPH_C32(0x3a366a28), SPH_C32(0xb0af051d), - SPH_C32(0x73b215b3) }, - { SPH_C32(0x13ec0000), SPH_C32(0x325800e6), SPH_C32(0x4e4be000), - SPH_C32(0xcbda0000), SPH_C32(0xea213d0b), SPH_C32(0x98376c07), - SPH_C32(0x8a7fb37c), SPH_C32(0x237cafae), SPH_C32(0x41d70000), - SPH_C32(0x76620044), SPH_C32(0x875d6000), SPH_C32(0xa3190000), - SPH_C32(0xb5122494), SPH_C32(0x428cfe48), SPH_C32(0x9100a4f7), - SPH_C32(0xc3170d87) }, - { SPH_C32(0xa5220000), SPH_C32(0xe8b100e4), SPH_C32(0x5b256000), - SPH_C32(0x11480000), SPH_C32(0x1cfc676f), SPH_C32(0xae05308d), - SPH_C32(0x780d5bd2), SPH_C32(0x85c46d23), SPH_C32(0xc7ae0000), - SPH_C32(0x495b0046), SPH_C32(0x66c78000), SPH_C32(0x3b4f0000), - SPH_C32(0x2077439a), SPH_C32(0x0c0436a2), SPH_C32(0x42ddedb3), - SPH_C32(0xd50ad73e) }, - { SPH_C32(0x235b0000), SPH_C32(0xd78800e6), SPH_C32(0xbabf8000), - SPH_C32(0x891e0000), SPH_C32(0x89990061), SPH_C32(0xe08df867), - SPH_C32(0xabd01296), SPH_C32(0x93d9b79a), SPH_C32(0xf7190000), - SPH_C32(0xac8b0046), SPH_C32(0x9233e000), SPH_C32(0x798b0000), - SPH_C32(0x43cf7ef0), SPH_C32(0x74bea2c2), SPH_C32(0x63724c59), - SPH_C32(0x65afcf0a) }, - { SPH_C32(0x62cf0000), SPH_C32(0x14e500cc), SPH_C32(0x0dc80000), - SPH_C32(0xbd740000), SPH_C32(0xbf367f13), SPH_C32(0xcf27b68d), - SPH_C32(0x2a795bde), SPH_C32(0xd4e53740), SPH_C32(0x65790000), - SPH_C32(0xb0780078), SPH_C32(0x23760000), SPH_C32(0xa56b0000), - SPH_C32(0xcdc67e4e), SPH_C32(0x06c5c65d), SPH_C32(0xd14915ad), - SPH_C32(0xa878ce33) }, - { SPH_C32(0xe4b60000), SPH_C32(0x2bdc00ce), SPH_C32(0xec52e000), - SPH_C32(0x25220000), SPH_C32(0x2a53181d), SPH_C32(0x81af7e67), - SPH_C32(0xf9a4129a), SPH_C32(0xc2f8edf9), SPH_C32(0x55ce0000), - SPH_C32(0x55a80078), SPH_C32(0xd7826000), SPH_C32(0xe7af0000), - SPH_C32(0xae7e4324), SPH_C32(0x7e7f523d), SPH_C32(0xf0e6b447), - SPH_C32(0x18ddd607) }, - { SPH_C32(0x52780000), SPH_C32(0xf13500cc), SPH_C32(0xf93c6000), - SPH_C32(0xffb00000), SPH_C32(0xdc8e4279), SPH_C32(0xb79d22ed), - SPH_C32(0x0bd6fa34), SPH_C32(0x64402f74), SPH_C32(0xd3b70000), - SPH_C32(0x6a91007a), SPH_C32(0x36188000), SPH_C32(0x7ff90000), - SPH_C32(0x3b1b242a), SPH_C32(0x30f79ad7), SPH_C32(0x233bfd03), - SPH_C32(0x0ec00cbe) }, - { SPH_C32(0xd4010000), SPH_C32(0xce0c00ce), SPH_C32(0x18a68000), - SPH_C32(0x67e60000), SPH_C32(0x49eb2577), SPH_C32(0xf915ea07), - SPH_C32(0xd80bb370), SPH_C32(0x725df5cd), SPH_C32(0xe3000000), - SPH_C32(0x8f41007a), SPH_C32(0xc2ece000), SPH_C32(0x3d3d0000), - SPH_C32(0x58a31940), SPH_C32(0x484d0eb7), SPH_C32(0x02945ce9), - SPH_C32(0xbe65148a) }, - { SPH_C32(0x76d60000), SPH_C32(0x372f00f0), SPH_C32(0x5d170000), - SPH_C32(0xf9c20000), SPH_C32(0xa45a18a3), SPH_C32(0xf3d41af8), - SPH_C32(0x4b9f4b6e), SPH_C32(0x0f2fecc0), SPH_C32(0x863a0000), - SPH_C32(0x8a36006c), SPH_C32(0xd1b00000), SPH_C32(0x0f250000), - SPH_C32(0x16d83ce8), SPH_C32(0x23ae7848), SPH_C32(0xc374a4fb), - SPH_C32(0x923657e4) }, - { SPH_C32(0xf0af0000), SPH_C32(0x081600f2), SPH_C32(0xbc8de000), - SPH_C32(0x61940000), SPH_C32(0x313f7fad), SPH_C32(0xbd5cd212), - SPH_C32(0x9842022a), SPH_C32(0x19323679), SPH_C32(0xb68d0000), - SPH_C32(0x6fe6006c), SPH_C32(0x25446000), SPH_C32(0x4de10000), - SPH_C32(0x75600182), SPH_C32(0x5b14ec28), SPH_C32(0xe2db0511), - SPH_C32(0x22934fd0) }, - { SPH_C32(0x46610000), SPH_C32(0xd2ff00f0), SPH_C32(0xa9e36000), - SPH_C32(0xbb060000), SPH_C32(0xc7e225c9), SPH_C32(0x8b6e8e98), - SPH_C32(0x6a30ea84), SPH_C32(0xbf8af4f4), SPH_C32(0x30f40000), - SPH_C32(0x50df006e), SPH_C32(0xc4de8000), SPH_C32(0xd5b70000), - SPH_C32(0xe005668c), SPH_C32(0x159c24c2), SPH_C32(0x31064c55), - SPH_C32(0x348e9569) }, - { SPH_C32(0xc0180000), SPH_C32(0xedc600f2), SPH_C32(0x48798000), - SPH_C32(0x23500000), SPH_C32(0x528742c7), SPH_C32(0xc5e64672), - SPH_C32(0xb9eda3c0), SPH_C32(0xa9972e4d), SPH_C32(0x00430000), - SPH_C32(0xb50f006e), SPH_C32(0x302ae000), SPH_C32(0x97730000), - SPH_C32(0x83bd5be6), SPH_C32(0x6d26b0a2), SPH_C32(0x10a9edbf), - SPH_C32(0x842b8d5d) }, - { SPH_C32(0xc6730000), SPH_C32(0xaf8d000c), SPH_C32(0xa4c10000), - SPH_C32(0x218d0000), SPH_C32(0x23111587), SPH_C32(0x7913512f), - SPH_C32(0x1d28ac88), SPH_C32(0x378dd173), SPH_C32(0xaf220000), - SPH_C32(0x7b6c0090), SPH_C32(0x67e20000), SPH_C32(0x8da20000), - SPH_C32(0xc7841e29), SPH_C32(0xb7b744f3), SPH_C32(0x9ac484f4), - SPH_C32(0x8b6c72bd) }, - { SPH_C32(0x400a0000), SPH_C32(0x90b4000e), SPH_C32(0x455be000), - SPH_C32(0xb9db0000), SPH_C32(0xb6747289), SPH_C32(0x379b99c5), - SPH_C32(0xcef5e5cc), SPH_C32(0x21900bca), SPH_C32(0x9f950000), - SPH_C32(0x9ebc0090), SPH_C32(0x93166000), SPH_C32(0xcf660000), - SPH_C32(0xa43c2343), SPH_C32(0xcf0dd093), SPH_C32(0xbb6b251e), - SPH_C32(0x3bc96a89) }, - { SPH_C32(0xf6c40000), SPH_C32(0x4a5d000c), SPH_C32(0x50356000), - SPH_C32(0x63490000), SPH_C32(0x40a928ed), SPH_C32(0x01a9c54f), - SPH_C32(0x3c870d62), SPH_C32(0x8728c947), SPH_C32(0x19ec0000), - SPH_C32(0xa1850092), SPH_C32(0x728c8000), SPH_C32(0x57300000), - SPH_C32(0x3159444d), SPH_C32(0x81851879), SPH_C32(0x68b66c5a), - SPH_C32(0x2dd4b030) }, - { SPH_C32(0x70bd0000), SPH_C32(0x7564000e), SPH_C32(0xb1af8000), - SPH_C32(0xfb1f0000), SPH_C32(0xd5cc4fe3), SPH_C32(0x4f210da5), - SPH_C32(0xef5a4426), SPH_C32(0x913513fe), SPH_C32(0x295b0000), - SPH_C32(0x44550092), SPH_C32(0x8678e000), SPH_C32(0x15f40000), - SPH_C32(0x52e17927), SPH_C32(0xf93f8c19), SPH_C32(0x4919cdb0), - SPH_C32(0x9d71a804) }, - { SPH_C32(0xd26a0000), SPH_C32(0x8c470030), SPH_C32(0xf41e0000), - SPH_C32(0x653b0000), SPH_C32(0x387d7237), SPH_C32(0x45e0fd5a), - SPH_C32(0x7ccebc38), SPH_C32(0xec470af3), SPH_C32(0x4c610000), - SPH_C32(0x41220084), SPH_C32(0x95240000), SPH_C32(0x27ec0000), - SPH_C32(0x1c9a5c8f), SPH_C32(0x92dcfae6), SPH_C32(0x88f935a2), - SPH_C32(0xb122eb6a) }, - { SPH_C32(0x54130000), SPH_C32(0xb37e0032), SPH_C32(0x1584e000), - SPH_C32(0xfd6d0000), SPH_C32(0xad181539), SPH_C32(0x0b6835b0), - SPH_C32(0xaf13f57c), SPH_C32(0xfa5ad04a), SPH_C32(0x7cd60000), - SPH_C32(0xa4f20084), SPH_C32(0x61d06000), SPH_C32(0x65280000), - SPH_C32(0x7f2261e5), SPH_C32(0xea666e86), SPH_C32(0xa9569448), - SPH_C32(0x0187f35e) }, - { SPH_C32(0xe2dd0000), SPH_C32(0x69970030), SPH_C32(0x00ea6000), - SPH_C32(0x27ff0000), SPH_C32(0x5bc54f5d), SPH_C32(0x3d5a693a), - SPH_C32(0x5d611dd2), SPH_C32(0x5ce212c7), SPH_C32(0xfaaf0000), - SPH_C32(0x9bcb0086), SPH_C32(0x804a8000), SPH_C32(0xfd7e0000), - SPH_C32(0xea4706eb), SPH_C32(0xa4eea66c), SPH_C32(0x7a8bdd0c), - SPH_C32(0x179a29e7) }, - { SPH_C32(0x64a40000), SPH_C32(0x56ae0032), SPH_C32(0xe1708000), - SPH_C32(0xbfa90000), SPH_C32(0xcea02853), SPH_C32(0x73d2a1d0), - SPH_C32(0x8ebc5496), SPH_C32(0x4affc87e), SPH_C32(0xca180000), - SPH_C32(0x7e1b0086), SPH_C32(0x74bee000), SPH_C32(0xbfba0000), - SPH_C32(0x89ff3b81), SPH_C32(0xdc54320c), SPH_C32(0x5b247ce6), - SPH_C32(0xa73f31d3) }, - { SPH_C32(0x25300000), SPH_C32(0x95c30018), SPH_C32(0x56070000), - SPH_C32(0x8bc30000), SPH_C32(0xf80f5721), SPH_C32(0x5c78ef3a), - SPH_C32(0x0f151dde), SPH_C32(0x0dc348a4), SPH_C32(0x58780000), - SPH_C32(0x62e800b8), SPH_C32(0xc5fb0000), SPH_C32(0x635a0000), - SPH_C32(0x07f63b3f), SPH_C32(0xae2f5693), SPH_C32(0xe91f2512), - SPH_C32(0x6ae830ea) }, - { SPH_C32(0xa3490000), SPH_C32(0xaafa001a), SPH_C32(0xb79de000), - SPH_C32(0x13950000), SPH_C32(0x6d6a302f), SPH_C32(0x12f027d0), - SPH_C32(0xdcc8549a), SPH_C32(0x1bde921d), SPH_C32(0x68cf0000), - SPH_C32(0x873800b8), SPH_C32(0x310f6000), SPH_C32(0x219e0000), - SPH_C32(0x644e0655), SPH_C32(0xd695c2f3), SPH_C32(0xc8b084f8), - SPH_C32(0xda4d28de) }, - { SPH_C32(0x15870000), SPH_C32(0x70130018), SPH_C32(0xa2f36000), - SPH_C32(0xc9070000), SPH_C32(0x9bb76a4b), SPH_C32(0x24c27b5a), - SPH_C32(0x2ebabc34), SPH_C32(0xbd665090), SPH_C32(0xeeb60000), - SPH_C32(0xb80100ba), SPH_C32(0xd0958000), SPH_C32(0xb9c80000), - SPH_C32(0xf12b615b), SPH_C32(0x981d0a19), SPH_C32(0x1b6dcdbc), - SPH_C32(0xcc50f267) }, - { SPH_C32(0x93fe0000), SPH_C32(0x4f2a001a), SPH_C32(0x43698000), - SPH_C32(0x51510000), SPH_C32(0x0ed20d45), SPH_C32(0x6a4ab3b0), - SPH_C32(0xfd67f570), SPH_C32(0xab7b8a29), SPH_C32(0xde010000), - SPH_C32(0x5dd100ba), SPH_C32(0x2461e000), SPH_C32(0xfb0c0000), - SPH_C32(0x92935c31), SPH_C32(0xe0a79e79), SPH_C32(0x3ac26c56), - SPH_C32(0x7cf5ea53) }, - { SPH_C32(0x31290000), SPH_C32(0xb6090024), SPH_C32(0x06d80000), - SPH_C32(0xcf750000), SPH_C32(0xe3633091), SPH_C32(0x608b434f), - SPH_C32(0x6ef30d6e), SPH_C32(0xd6099324), SPH_C32(0xbb3b0000), - SPH_C32(0x58a600ac), SPH_C32(0x373d0000), SPH_C32(0xc9140000), - SPH_C32(0xdce87999), SPH_C32(0x8b44e886), SPH_C32(0xfb229444), - SPH_C32(0x50a6a93d) }, - { SPH_C32(0xb7500000), SPH_C32(0x89300026), SPH_C32(0xe742e000), - SPH_C32(0x57230000), SPH_C32(0x7606579f), SPH_C32(0x2e038ba5), - SPH_C32(0xbd2e442a), SPH_C32(0xc014499d), SPH_C32(0x8b8c0000), - SPH_C32(0xbd7600ac), SPH_C32(0xc3c96000), SPH_C32(0x8bd00000), - SPH_C32(0xbf5044f3), SPH_C32(0xf3fe7ce6), SPH_C32(0xda8d35ae), - SPH_C32(0xe003b109) }, - { SPH_C32(0x019e0000), SPH_C32(0x53d90024), SPH_C32(0xf22c6000), - SPH_C32(0x8db10000), SPH_C32(0x80db0dfb), SPH_C32(0x1831d72f), - SPH_C32(0x4f5cac84), SPH_C32(0x66ac8b10), SPH_C32(0x0df50000), - SPH_C32(0x824f00ae), SPH_C32(0x22538000), SPH_C32(0x13860000), - SPH_C32(0x2a3523fd), SPH_C32(0xbd76b40c), SPH_C32(0x09507cea), - SPH_C32(0xf61e6bb0) }, - { SPH_C32(0x87e70000), SPH_C32(0x6ce00026), SPH_C32(0x13b68000), - SPH_C32(0x15e70000), SPH_C32(0x15be6af5), SPH_C32(0x56b91fc5), - SPH_C32(0x9c81e5c0), SPH_C32(0x70b151a9), SPH_C32(0x3d420000), - SPH_C32(0x679f00ae), SPH_C32(0xd6a7e000), SPH_C32(0x51420000), - SPH_C32(0x498d1e97), SPH_C32(0xc5cc206c), SPH_C32(0x28ffdd00), - SPH_C32(0x46bb7384) }, - { SPH_C32(0x92230000), SPH_C32(0xa9fc0050), SPH_C32(0x816f0000), - SPH_C32(0x4b930000), SPH_C32(0x0db45b58), SPH_C32(0x1f5dd43d), - SPH_C32(0xa292b44b), SPH_C32(0x49fc8c64), SPH_C32(0x13af0000), - SPH_C32(0x87570088), SPH_C32(0x7e610000), SPH_C32(0x5ca90000), - SPH_C32(0x699c66ed), SPH_C32(0xf511dca5), SPH_C32(0x9ad65ec3), - SPH_C32(0xa75722f3) }, - { SPH_C32(0x145a0000), SPH_C32(0x96c50052), SPH_C32(0x60f5e000), - SPH_C32(0xd3c50000), SPH_C32(0x98d13c56), SPH_C32(0x51d51cd7), - SPH_C32(0x714ffd0f), SPH_C32(0x5fe156dd), SPH_C32(0x23180000), - SPH_C32(0x62870088), SPH_C32(0x8a956000), SPH_C32(0x1e6d0000), - SPH_C32(0x0a245b87), SPH_C32(0x8dab48c5), SPH_C32(0xbb79ff29), - SPH_C32(0x17f23ac7) }, - { SPH_C32(0xa2940000), SPH_C32(0x4c2c0050), SPH_C32(0x759b6000), - SPH_C32(0x09570000), SPH_C32(0x6e0c6632), SPH_C32(0x67e7405d), - SPH_C32(0x833d15a1), SPH_C32(0xf9599450), SPH_C32(0xa5610000), - SPH_C32(0x5dbe008a), SPH_C32(0x6b0f8000), SPH_C32(0x863b0000), - SPH_C32(0x9f413c89), SPH_C32(0xc323802f), SPH_C32(0x68a4b66d), - SPH_C32(0x01efe07e) }, - { SPH_C32(0x24ed0000), SPH_C32(0x73150052), SPH_C32(0x94018000), - SPH_C32(0x91010000), SPH_C32(0xfb69013c), SPH_C32(0x296f88b7), - SPH_C32(0x50e05ce5), SPH_C32(0xef444ee9), SPH_C32(0x95d60000), - SPH_C32(0xb86e008a), SPH_C32(0x9ffbe000), SPH_C32(0xc4ff0000), - SPH_C32(0xfcf901e3), SPH_C32(0xbb99144f), SPH_C32(0x490b1787), - SPH_C32(0xb14af84a) }, - { SPH_C32(0x863a0000), SPH_C32(0x8a36006c), SPH_C32(0xd1b00000), - SPH_C32(0x0f250000), SPH_C32(0x16d83ce8), SPH_C32(0x23ae7848), - SPH_C32(0xc374a4fb), SPH_C32(0x923657e4), SPH_C32(0xf0ec0000), - SPH_C32(0xbd19009c), SPH_C32(0x8ca70000), SPH_C32(0xf6e70000), - SPH_C32(0xb282244b), SPH_C32(0xd07a62b0), SPH_C32(0x88ebef95), - SPH_C32(0x9d19bb24) }, - { SPH_C32(0x00430000), SPH_C32(0xb50f006e), SPH_C32(0x302ae000), - SPH_C32(0x97730000), SPH_C32(0x83bd5be6), SPH_C32(0x6d26b0a2), - SPH_C32(0x10a9edbf), SPH_C32(0x842b8d5d), SPH_C32(0xc05b0000), - SPH_C32(0x58c9009c), SPH_C32(0x78536000), SPH_C32(0xb4230000), - SPH_C32(0xd13a1921), SPH_C32(0xa8c0f6d0), SPH_C32(0xa9444e7f), - SPH_C32(0x2dbca310) }, - { SPH_C32(0xb68d0000), SPH_C32(0x6fe6006c), SPH_C32(0x25446000), - SPH_C32(0x4de10000), SPH_C32(0x75600182), SPH_C32(0x5b14ec28), - SPH_C32(0xe2db0511), SPH_C32(0x22934fd0), SPH_C32(0x46220000), - SPH_C32(0x67f0009e), SPH_C32(0x99c98000), SPH_C32(0x2c750000), - SPH_C32(0x445f7e2f), SPH_C32(0xe6483e3a), SPH_C32(0x7a99073b), - SPH_C32(0x3ba179a9) }, - { SPH_C32(0x30f40000), SPH_C32(0x50df006e), SPH_C32(0xc4de8000), - SPH_C32(0xd5b70000), SPH_C32(0xe005668c), SPH_C32(0x159c24c2), - SPH_C32(0x31064c55), SPH_C32(0x348e9569), SPH_C32(0x76950000), - SPH_C32(0x8220009e), SPH_C32(0x6d3de000), SPH_C32(0x6eb10000), - SPH_C32(0x27e74345), SPH_C32(0x9ef2aa5a), SPH_C32(0x5b36a6d1), - SPH_C32(0x8b04619d) }, - { SPH_C32(0x71600000), SPH_C32(0x93b20044), SPH_C32(0x73a90000), - SPH_C32(0xe1dd0000), SPH_C32(0xd6aa19fe), SPH_C32(0x3a366a28), - SPH_C32(0xb0af051d), SPH_C32(0x73b215b3), SPH_C32(0xe4f50000), - SPH_C32(0x9ed300a0), SPH_C32(0xdc780000), SPH_C32(0xb2510000), - SPH_C32(0xa9ee43fb), SPH_C32(0xec89cec5), SPH_C32(0xe90dff25), - SPH_C32(0x46d360a4) }, - { SPH_C32(0xf7190000), SPH_C32(0xac8b0046), SPH_C32(0x9233e000), - SPH_C32(0x798b0000), SPH_C32(0x43cf7ef0), SPH_C32(0x74bea2c2), - SPH_C32(0x63724c59), SPH_C32(0x65afcf0a), SPH_C32(0xd4420000), - SPH_C32(0x7b0300a0), SPH_C32(0x288c6000), SPH_C32(0xf0950000), - SPH_C32(0xca567e91), SPH_C32(0x94335aa5), SPH_C32(0xc8a25ecf), - SPH_C32(0xf6767890) }, - { SPH_C32(0x41d70000), SPH_C32(0x76620044), SPH_C32(0x875d6000), - SPH_C32(0xa3190000), SPH_C32(0xb5122494), SPH_C32(0x428cfe48), - SPH_C32(0x9100a4f7), SPH_C32(0xc3170d87), SPH_C32(0x523b0000), - SPH_C32(0x443a00a2), SPH_C32(0xc9168000), SPH_C32(0x68c30000), - SPH_C32(0x5f33199f), SPH_C32(0xdabb924f), SPH_C32(0x1b7f178b), - SPH_C32(0xe06ba229) }, - { SPH_C32(0xc7ae0000), SPH_C32(0x495b0046), SPH_C32(0x66c78000), - SPH_C32(0x3b4f0000), SPH_C32(0x2077439a), SPH_C32(0x0c0436a2), - SPH_C32(0x42ddedb3), SPH_C32(0xd50ad73e), SPH_C32(0x628c0000), - SPH_C32(0xa1ea00a2), SPH_C32(0x3de2e000), SPH_C32(0x2a070000), - SPH_C32(0x3c8b24f5), SPH_C32(0xa201062f), SPH_C32(0x3ad0b661), - SPH_C32(0x50ceba1d) }, - { SPH_C32(0x65790000), SPH_C32(0xb0780078), SPH_C32(0x23760000), - SPH_C32(0xa56b0000), SPH_C32(0xcdc67e4e), SPH_C32(0x06c5c65d), - SPH_C32(0xd14915ad), SPH_C32(0xa878ce33), SPH_C32(0x07b60000), - SPH_C32(0xa49d00b4), SPH_C32(0x2ebe0000), SPH_C32(0x181f0000), - SPH_C32(0x72f0015d), SPH_C32(0xc9e270d0), SPH_C32(0xfb304e73), - SPH_C32(0x7c9df973) }, - { SPH_C32(0xe3000000), SPH_C32(0x8f41007a), SPH_C32(0xc2ece000), - SPH_C32(0x3d3d0000), SPH_C32(0x58a31940), SPH_C32(0x484d0eb7), - SPH_C32(0x02945ce9), SPH_C32(0xbe65148a), SPH_C32(0x37010000), - SPH_C32(0x414d00b4), SPH_C32(0xda4a6000), SPH_C32(0x5adb0000), - SPH_C32(0x11483c37), SPH_C32(0xb158e4b0), SPH_C32(0xda9fef99), - SPH_C32(0xcc38e147) }, - { SPH_C32(0x55ce0000), SPH_C32(0x55a80078), SPH_C32(0xd7826000), - SPH_C32(0xe7af0000), SPH_C32(0xae7e4324), SPH_C32(0x7e7f523d), - SPH_C32(0xf0e6b447), SPH_C32(0x18ddd607), SPH_C32(0xb1780000), - SPH_C32(0x7e7400b6), SPH_C32(0x3bd08000), SPH_C32(0xc28d0000), - SPH_C32(0x842d5b39), SPH_C32(0xffd02c5a), SPH_C32(0x0942a6dd), - SPH_C32(0xda253bfe) }, - { SPH_C32(0xd3b70000), SPH_C32(0x6a91007a), SPH_C32(0x36188000), - SPH_C32(0x7ff90000), SPH_C32(0x3b1b242a), SPH_C32(0x30f79ad7), - SPH_C32(0x233bfd03), SPH_C32(0x0ec00cbe), SPH_C32(0x81cf0000), - SPH_C32(0x9ba400b6), SPH_C32(0xcf24e000), SPH_C32(0x80490000), - SPH_C32(0xe7956653), SPH_C32(0x876ab83a), SPH_C32(0x28ed0737), - SPH_C32(0x6a8023ca) }, - { SPH_C32(0x7afe0000), SPH_C32(0x53b60014), SPH_C32(0xbd420000), - SPH_C32(0xf0860000), SPH_C32(0x8d096d43), SPH_C32(0x3bb5c979), - SPH_C32(0x1d3a76bf), SPH_C32(0x1bb6813d), SPH_C32(0x47ff0000), - SPH_C32(0x812600d4), SPH_C32(0x5bcf0000), SPH_C32(0x36b70000), - SPH_C32(0x47392832), SPH_C32(0x935f59b7), SPH_C32(0x256c4600), - SPH_C32(0xd9267fe4) }, - { SPH_C32(0xfc870000), SPH_C32(0x6c8f0016), SPH_C32(0x5cd8e000), - SPH_C32(0x68d00000), SPH_C32(0x186c0a4d), SPH_C32(0x753d0193), - SPH_C32(0xcee73ffb), SPH_C32(0x0dab5b84), SPH_C32(0x77480000), - SPH_C32(0x64f600d4), SPH_C32(0xaf3b6000), SPH_C32(0x74730000), - SPH_C32(0x24811558), SPH_C32(0xebe5cdd7), SPH_C32(0x04c3e7ea), - SPH_C32(0x698367d0) }, - { SPH_C32(0x4a490000), SPH_C32(0xb6660014), SPH_C32(0x49b66000), - SPH_C32(0xb2420000), SPH_C32(0xeeb15029), SPH_C32(0x430f5d19), - SPH_C32(0x3c95d755), SPH_C32(0xab139909), SPH_C32(0xf1310000), - SPH_C32(0x5bcf00d6), SPH_C32(0x4ea18000), SPH_C32(0xec250000), - SPH_C32(0xb1e47256), SPH_C32(0xa56d053d), SPH_C32(0xd71eaeae), - SPH_C32(0x7f9ebd69) }, - { SPH_C32(0xcc300000), SPH_C32(0x895f0016), SPH_C32(0xa82c8000), - SPH_C32(0x2a140000), SPH_C32(0x7bd43727), SPH_C32(0x0d8795f3), - SPH_C32(0xef489e11), SPH_C32(0xbd0e43b0), SPH_C32(0xc1860000), - SPH_C32(0xbe1f00d6), SPH_C32(0xba55e000), SPH_C32(0xaee10000), - SPH_C32(0xd25c4f3c), SPH_C32(0xddd7915d), SPH_C32(0xf6b10f44), - SPH_C32(0xcf3ba55d) }, - { SPH_C32(0x6ee70000), SPH_C32(0x707c0028), SPH_C32(0xed9d0000), - SPH_C32(0xb4300000), SPH_C32(0x96650af3), SPH_C32(0x0746650c), - SPH_C32(0x7cdc660f), SPH_C32(0xc07c5abd), SPH_C32(0xa4bc0000), - SPH_C32(0xbb6800c0), SPH_C32(0xa9090000), SPH_C32(0x9cf90000), - SPH_C32(0x9c276a94), SPH_C32(0xb634e7a2), SPH_C32(0x3751f756), - SPH_C32(0xe368e633) }, - { SPH_C32(0xe89e0000), SPH_C32(0x4f45002a), SPH_C32(0x0c07e000), - SPH_C32(0x2c660000), SPH_C32(0x03006dfd), SPH_C32(0x49ceade6), - SPH_C32(0xaf012f4b), SPH_C32(0xd6618004), SPH_C32(0x940b0000), - SPH_C32(0x5eb800c0), SPH_C32(0x5dfd6000), SPH_C32(0xde3d0000), - SPH_C32(0xff9f57fe), SPH_C32(0xce8e73c2), SPH_C32(0x16fe56bc), - SPH_C32(0x53cdfe07) }, - { SPH_C32(0x5e500000), SPH_C32(0x95ac0028), SPH_C32(0x19696000), - SPH_C32(0xf6f40000), SPH_C32(0xf5dd3799), SPH_C32(0x7ffcf16c), - SPH_C32(0x5d73c7e5), SPH_C32(0x70d94289), SPH_C32(0x12720000), - SPH_C32(0x618100c2), SPH_C32(0xbc678000), SPH_C32(0x466b0000), - SPH_C32(0x6afa30f0), SPH_C32(0x8006bb28), SPH_C32(0xc5231ff8), - SPH_C32(0x45d024be) }, - { SPH_C32(0xd8290000), SPH_C32(0xaa95002a), SPH_C32(0xf8f38000), - SPH_C32(0x6ea20000), SPH_C32(0x60b85097), SPH_C32(0x31743986), - SPH_C32(0x8eae8ea1), SPH_C32(0x66c49830), SPH_C32(0x22c50000), - SPH_C32(0x845100c2), SPH_C32(0x4893e000), SPH_C32(0x04af0000), - SPH_C32(0x09420d9a), SPH_C32(0xf8bc2f48), SPH_C32(0xe48cbe12), - SPH_C32(0xf5753c8a) }, - { SPH_C32(0x99bd0000), SPH_C32(0x69f80000), SPH_C32(0x4f840000), - SPH_C32(0x5ac80000), SPH_C32(0x56172fe5), SPH_C32(0x1ede776c), - SPH_C32(0x0f07c7e9), SPH_C32(0x21f818ea), SPH_C32(0xb0a50000), - SPH_C32(0x98a200fc), SPH_C32(0xf9d60000), SPH_C32(0xd84f0000), - SPH_C32(0x874b0d24), SPH_C32(0x8ac74bd7), SPH_C32(0x56b7e7e6), - SPH_C32(0x38a23db3) }, - { SPH_C32(0x1fc40000), SPH_C32(0x56c10002), SPH_C32(0xae1ee000), - SPH_C32(0xc29e0000), SPH_C32(0xc37248eb), SPH_C32(0x5056bf86), - SPH_C32(0xdcda8ead), SPH_C32(0x37e5c253), SPH_C32(0x80120000), - SPH_C32(0x7d7200fc), SPH_C32(0x0d226000), SPH_C32(0x9a8b0000), - SPH_C32(0xe4f3304e), SPH_C32(0xf27ddfb7), SPH_C32(0x7718460c), - SPH_C32(0x88072587) }, - { SPH_C32(0xa90a0000), SPH_C32(0x8c280000), SPH_C32(0xbb706000), - SPH_C32(0x180c0000), SPH_C32(0x35af128f), SPH_C32(0x6664e30c), - SPH_C32(0x2ea86603), SPH_C32(0x915d00de), SPH_C32(0x066b0000), - SPH_C32(0x424b00fe), SPH_C32(0xecb88000), SPH_C32(0x02dd0000), - SPH_C32(0x71965740), SPH_C32(0xbcf5175d), SPH_C32(0xa4c50f48), - SPH_C32(0x9e1aff3e) }, - { SPH_C32(0x2f730000), SPH_C32(0xb3110002), SPH_C32(0x5aea8000), - SPH_C32(0x805a0000), SPH_C32(0xa0ca7581), SPH_C32(0x28ec2be6), - SPH_C32(0xfd752f47), SPH_C32(0x8740da67), SPH_C32(0x36dc0000), - SPH_C32(0xa79b00fe), SPH_C32(0x184ce000), SPH_C32(0x40190000), - SPH_C32(0x122e6a2a), SPH_C32(0xc44f833d), SPH_C32(0x856aaea2), - SPH_C32(0x2ebfe70a) }, - { SPH_C32(0x8da40000), SPH_C32(0x4a32003c), SPH_C32(0x1f5b0000), - SPH_C32(0x1e7e0000), SPH_C32(0x4d7b4855), SPH_C32(0x222ddb19), - SPH_C32(0x6ee1d759), SPH_C32(0xfa32c36a), SPH_C32(0x53e60000), - SPH_C32(0xa2ec00e8), SPH_C32(0x0b100000), SPH_C32(0x72010000), - SPH_C32(0x5c554f82), SPH_C32(0xafacf5c2), SPH_C32(0x448a56b0), - SPH_C32(0x02eca464) }, - { SPH_C32(0x0bdd0000), SPH_C32(0x750b003e), SPH_C32(0xfec1e000), - SPH_C32(0x86280000), SPH_C32(0xd81e2f5b), SPH_C32(0x6ca513f3), - SPH_C32(0xbd3c9e1d), SPH_C32(0xec2f19d3), SPH_C32(0x63510000), - SPH_C32(0x473c00e8), SPH_C32(0xffe46000), SPH_C32(0x30c50000), - SPH_C32(0x3fed72e8), SPH_C32(0xd71661a2), SPH_C32(0x6525f75a), - SPH_C32(0xb249bc50) }, - { SPH_C32(0xbd130000), SPH_C32(0xafe2003c), SPH_C32(0xebaf6000), - SPH_C32(0x5cba0000), SPH_C32(0x2ec3753f), SPH_C32(0x5a974f79), - SPH_C32(0x4f4e76b3), SPH_C32(0x4a97db5e), SPH_C32(0xe5280000), - SPH_C32(0x780500ea), SPH_C32(0x1e7e8000), SPH_C32(0xa8930000), - SPH_C32(0xaa8815e6), SPH_C32(0x999ea948), SPH_C32(0xb6f8be1e), - SPH_C32(0xa45466e9) }, - { SPH_C32(0x3b6a0000), SPH_C32(0x90db003e), SPH_C32(0x0a358000), - SPH_C32(0xc4ec0000), SPH_C32(0xbba61231), SPH_C32(0x141f8793), - SPH_C32(0x9c933ff7), SPH_C32(0x5c8a01e7), SPH_C32(0xd59f0000), - SPH_C32(0x9dd500ea), SPH_C32(0xea8ae000), SPH_C32(0xea570000), - SPH_C32(0xc930288c), SPH_C32(0xe1243d28), SPH_C32(0x97571ff4), - SPH_C32(0x14f17edd) }, - { SPH_C32(0x2eae0000), SPH_C32(0x55c70048), SPH_C32(0x98ec0000), - SPH_C32(0x9a980000), SPH_C32(0xa3ac239c), SPH_C32(0x5dfb4c6b), - SPH_C32(0xa2806e7c), SPH_C32(0x65c7dc2a), SPH_C32(0xfb720000), - SPH_C32(0x7d1d00cc), SPH_C32(0x424c0000), SPH_C32(0xe7bc0000), - SPH_C32(0xe92150f6), SPH_C32(0xd1f9c1e1), SPH_C32(0x257e9c37), - SPH_C32(0xf51d2faa) }, - { SPH_C32(0xa8d70000), SPH_C32(0x6afe004a), SPH_C32(0x7976e000), - SPH_C32(0x02ce0000), SPH_C32(0x36c94492), SPH_C32(0x13738481), - SPH_C32(0x715d2738), SPH_C32(0x73da0693), SPH_C32(0xcbc50000), - SPH_C32(0x98cd00cc), SPH_C32(0xb6b86000), SPH_C32(0xa5780000), - SPH_C32(0x8a996d9c), SPH_C32(0xa9435581), SPH_C32(0x04d13ddd), - SPH_C32(0x45b8379e) }, - { SPH_C32(0x1e190000), SPH_C32(0xb0170048), SPH_C32(0x6c186000), - SPH_C32(0xd85c0000), SPH_C32(0xc0141ef6), SPH_C32(0x2541d80b), - SPH_C32(0x832fcf96), SPH_C32(0xd562c41e), SPH_C32(0x4dbc0000), - SPH_C32(0xa7f400ce), SPH_C32(0x57228000), SPH_C32(0x3d2e0000), - SPH_C32(0x1ffc0a92), SPH_C32(0xe7cb9d6b), SPH_C32(0xd70c7499), - SPH_C32(0x53a5ed27) }, - { SPH_C32(0x98600000), SPH_C32(0x8f2e004a), SPH_C32(0x8d828000), - SPH_C32(0x400a0000), SPH_C32(0x557179f8), SPH_C32(0x6bc910e1), - SPH_C32(0x50f286d2), SPH_C32(0xc37f1ea7), SPH_C32(0x7d0b0000), - SPH_C32(0x422400ce), SPH_C32(0xa3d6e000), SPH_C32(0x7fea0000), - SPH_C32(0x7c4437f8), SPH_C32(0x9f71090b), SPH_C32(0xf6a3d573), - SPH_C32(0xe300f513) }, - { SPH_C32(0x3ab70000), SPH_C32(0x760d0074), SPH_C32(0xc8330000), - SPH_C32(0xde2e0000), SPH_C32(0xb8c0442c), SPH_C32(0x6108e01e), - SPH_C32(0xc3667ecc), SPH_C32(0xbe0d07aa), SPH_C32(0x18310000), - SPH_C32(0x475300d8), SPH_C32(0xb08a0000), SPH_C32(0x4df20000), - SPH_C32(0x323f1250), SPH_C32(0xf4927ff4), SPH_C32(0x37432d61), - SPH_C32(0xcf53b67d) }, - { SPH_C32(0xbcce0000), SPH_C32(0x49340076), SPH_C32(0x29a9e000), - SPH_C32(0x46780000), SPH_C32(0x2da52322), SPH_C32(0x2f8028f4), - SPH_C32(0x10bb3788), SPH_C32(0xa810dd13), SPH_C32(0x28860000), - SPH_C32(0xa28300d8), SPH_C32(0x447e6000), SPH_C32(0x0f360000), - SPH_C32(0x51872f3a), SPH_C32(0x8c28eb94), SPH_C32(0x16ec8c8b), - SPH_C32(0x7ff6ae49) }, - { SPH_C32(0x0a000000), SPH_C32(0x93dd0074), SPH_C32(0x3cc76000), - SPH_C32(0x9cea0000), SPH_C32(0xdb787946), SPH_C32(0x19b2747e), - SPH_C32(0xe2c9df26), SPH_C32(0x0ea81f9e), SPH_C32(0xaeff0000), - SPH_C32(0x9dba00da), SPH_C32(0xa5e48000), SPH_C32(0x97600000), - SPH_C32(0xc4e24834), SPH_C32(0xc2a0237e), SPH_C32(0xc531c5cf), - SPH_C32(0x69eb74f0) }, - { SPH_C32(0x8c790000), SPH_C32(0xace40076), SPH_C32(0xdd5d8000), - SPH_C32(0x04bc0000), SPH_C32(0x4e1d1e48), SPH_C32(0x573abc94), - SPH_C32(0x31149662), SPH_C32(0x18b5c527), SPH_C32(0x9e480000), - SPH_C32(0x786a00da), SPH_C32(0x5110e000), SPH_C32(0xd5a40000), - SPH_C32(0xa75a755e), SPH_C32(0xba1ab71e), SPH_C32(0xe49e6425), - SPH_C32(0xd94e6cc4) }, - { SPH_C32(0xcded0000), SPH_C32(0x6f89005c), SPH_C32(0x6a2a0000), - SPH_C32(0x30d60000), SPH_C32(0x78b2613a), SPH_C32(0x7890f27e), - SPH_C32(0xb0bddf2a), SPH_C32(0x5f8945fd), SPH_C32(0x0c280000), - SPH_C32(0x649900e4), SPH_C32(0xe0550000), SPH_C32(0x09440000), - SPH_C32(0x295375e0), SPH_C32(0xc861d381), SPH_C32(0x56a53dd1), - SPH_C32(0x14996dfd) }, - { SPH_C32(0x4b940000), SPH_C32(0x50b0005e), SPH_C32(0x8bb0e000), - SPH_C32(0xa8800000), SPH_C32(0xedd70634), SPH_C32(0x36183a94), - SPH_C32(0x6360966e), SPH_C32(0x49949f44), SPH_C32(0x3c9f0000), - SPH_C32(0x814900e4), SPH_C32(0x14a16000), SPH_C32(0x4b800000), - SPH_C32(0x4aeb488a), SPH_C32(0xb0db47e1), SPH_C32(0x770a9c3b), - SPH_C32(0xa43c75c9) }, - { SPH_C32(0xfd5a0000), SPH_C32(0x8a59005c), SPH_C32(0x9ede6000), - SPH_C32(0x72120000), SPH_C32(0x1b0a5c50), SPH_C32(0x002a661e), - SPH_C32(0x91127ec0), SPH_C32(0xef2c5dc9), SPH_C32(0xbae60000), - SPH_C32(0xbe7000e6), SPH_C32(0xf53b8000), SPH_C32(0xd3d60000), - SPH_C32(0xdf8e2f84), SPH_C32(0xfe538f0b), SPH_C32(0xa4d7d57f), - SPH_C32(0xb221af70) }, - { SPH_C32(0x7b230000), SPH_C32(0xb560005e), SPH_C32(0x7f448000), - SPH_C32(0xea440000), SPH_C32(0x8e6f3b5e), SPH_C32(0x4ea2aef4), - SPH_C32(0x42cf3784), SPH_C32(0xf9318770), SPH_C32(0x8a510000), - SPH_C32(0x5ba000e6), SPH_C32(0x01cfe000), SPH_C32(0x91120000), - SPH_C32(0xbc3612ee), SPH_C32(0x86e91b6b), SPH_C32(0x85787495), - SPH_C32(0x0284b744) }, - { SPH_C32(0xd9f40000), SPH_C32(0x4c430060), SPH_C32(0x3af50000), - SPH_C32(0x74600000), SPH_C32(0x63de068a), SPH_C32(0x44635e0b), - SPH_C32(0xd15bcf9a), SPH_C32(0x84439e7d), SPH_C32(0xef6b0000), - SPH_C32(0x5ed700f0), SPH_C32(0x12930000), SPH_C32(0xa30a0000), - SPH_C32(0xf24d3746), SPH_C32(0xed0a6d94), SPH_C32(0x44988c87), - SPH_C32(0x2ed7f42a) }, - { SPH_C32(0x5f8d0000), SPH_C32(0x737a0062), SPH_C32(0xdb6fe000), - SPH_C32(0xec360000), SPH_C32(0xf6bb6184), SPH_C32(0x0aeb96e1), - SPH_C32(0x028686de), SPH_C32(0x925e44c4), SPH_C32(0xdfdc0000), - SPH_C32(0xbb0700f0), SPH_C32(0xe6676000), SPH_C32(0xe1ce0000), - SPH_C32(0x91f50a2c), SPH_C32(0x95b0f9f4), SPH_C32(0x65372d6d), - SPH_C32(0x9e72ec1e) }, - { SPH_C32(0xe9430000), SPH_C32(0xa9930060), SPH_C32(0xce016000), - SPH_C32(0x36a40000), SPH_C32(0x00663be0), SPH_C32(0x3cd9ca6b), - SPH_C32(0xf0f46e70), SPH_C32(0x34e68649), SPH_C32(0x59a50000), - SPH_C32(0x843e00f2), SPH_C32(0x07fd8000), SPH_C32(0x79980000), - SPH_C32(0x04906d22), SPH_C32(0xdb38311e), SPH_C32(0xb6ea6429), - SPH_C32(0x886f36a7) }, - { SPH_C32(0x6f3a0000), SPH_C32(0x96aa0062), SPH_C32(0x2f9b8000), - SPH_C32(0xaef20000), SPH_C32(0x95035cee), SPH_C32(0x72510281), - SPH_C32(0x23292734), SPH_C32(0x22fb5cf0), SPH_C32(0x69120000), - SPH_C32(0x61ee00f2), SPH_C32(0xf309e000), SPH_C32(0x3b5c0000), - SPH_C32(0x67285048), SPH_C32(0xa382a57e), SPH_C32(0x9745c5c3), - SPH_C32(0x38ca2e93) }, - { SPH_C32(0xaf220000), SPH_C32(0x7b6c0090), SPH_C32(0x67e20000), - SPH_C32(0x8da20000), SPH_C32(0xc7841e29), SPH_C32(0xb7b744f3), - SPH_C32(0x9ac484f4), SPH_C32(0x8b6c72bd), SPH_C32(0x69510000), - SPH_C32(0xd4e1009c), SPH_C32(0xc3230000), SPH_C32(0xac2f0000), - SPH_C32(0xe4950bae), SPH_C32(0xcea415dc), SPH_C32(0x87ec287c), - SPH_C32(0xbce1a3ce) }, - { SPH_C32(0x295b0000), SPH_C32(0x44550092), SPH_C32(0x8678e000), - SPH_C32(0x15f40000), SPH_C32(0x52e17927), SPH_C32(0xf93f8c19), - SPH_C32(0x4919cdb0), SPH_C32(0x9d71a804), SPH_C32(0x59e60000), - SPH_C32(0x3131009c), SPH_C32(0x37d76000), SPH_C32(0xeeeb0000), - SPH_C32(0x872d36c4), SPH_C32(0xb61e81bc), SPH_C32(0xa6438996), - SPH_C32(0x0c44bbfa) }, - { SPH_C32(0x9f950000), SPH_C32(0x9ebc0090), SPH_C32(0x93166000), - SPH_C32(0xcf660000), SPH_C32(0xa43c2343), SPH_C32(0xcf0dd093), - SPH_C32(0xbb6b251e), SPH_C32(0x3bc96a89), SPH_C32(0xdf9f0000), - SPH_C32(0x0e08009e), SPH_C32(0xd64d8000), SPH_C32(0x76bd0000), - SPH_C32(0x124851ca), SPH_C32(0xf8964956), SPH_C32(0x759ec0d2), - SPH_C32(0x1a596143) }, - { SPH_C32(0x19ec0000), SPH_C32(0xa1850092), SPH_C32(0x728c8000), - SPH_C32(0x57300000), SPH_C32(0x3159444d), SPH_C32(0x81851879), - SPH_C32(0x68b66c5a), SPH_C32(0x2dd4b030), SPH_C32(0xef280000), - SPH_C32(0xebd8009e), SPH_C32(0x22b9e000), SPH_C32(0x34790000), - SPH_C32(0x71f06ca0), SPH_C32(0x802cdd36), SPH_C32(0x54316138), - SPH_C32(0xaafc7977) }, - { SPH_C32(0xbb3b0000), SPH_C32(0x58a600ac), SPH_C32(0x373d0000), - SPH_C32(0xc9140000), SPH_C32(0xdce87999), SPH_C32(0x8b44e886), - SPH_C32(0xfb229444), SPH_C32(0x50a6a93d), SPH_C32(0x8a120000), - SPH_C32(0xeeaf0088), SPH_C32(0x31e50000), SPH_C32(0x06610000), - SPH_C32(0x3f8b4908), SPH_C32(0xebcfabc9), SPH_C32(0x95d1992a), - SPH_C32(0x86af3a19) }, - { SPH_C32(0x3d420000), SPH_C32(0x679f00ae), SPH_C32(0xd6a7e000), - SPH_C32(0x51420000), SPH_C32(0x498d1e97), SPH_C32(0xc5cc206c), - SPH_C32(0x28ffdd00), SPH_C32(0x46bb7384), SPH_C32(0xbaa50000), - SPH_C32(0x0b7f0088), SPH_C32(0xc5116000), SPH_C32(0x44a50000), - SPH_C32(0x5c337462), SPH_C32(0x93753fa9), SPH_C32(0xb47e38c0), - SPH_C32(0x360a222d) }, - { SPH_C32(0x8b8c0000), SPH_C32(0xbd7600ac), SPH_C32(0xc3c96000), - SPH_C32(0x8bd00000), SPH_C32(0xbf5044f3), SPH_C32(0xf3fe7ce6), - SPH_C32(0xda8d35ae), SPH_C32(0xe003b109), SPH_C32(0x3cdc0000), - SPH_C32(0x3446008a), SPH_C32(0x248b8000), SPH_C32(0xdcf30000), - SPH_C32(0xc956136c), SPH_C32(0xddfdf743), SPH_C32(0x67a37184), - SPH_C32(0x2017f894) }, - { SPH_C32(0x0df50000), SPH_C32(0x824f00ae), SPH_C32(0x22538000), - SPH_C32(0x13860000), SPH_C32(0x2a3523fd), SPH_C32(0xbd76b40c), - SPH_C32(0x09507cea), SPH_C32(0xf61e6bb0), SPH_C32(0x0c6b0000), - SPH_C32(0xd196008a), SPH_C32(0xd07fe000), SPH_C32(0x9e370000), - SPH_C32(0xaaee2e06), SPH_C32(0xa5476323), SPH_C32(0x460cd06e), - SPH_C32(0x90b2e0a0) }, - { SPH_C32(0x4c610000), SPH_C32(0x41220084), SPH_C32(0x95240000), - SPH_C32(0x27ec0000), SPH_C32(0x1c9a5c8f), SPH_C32(0x92dcfae6), - SPH_C32(0x88f935a2), SPH_C32(0xb122eb6a), SPH_C32(0x9e0b0000), - SPH_C32(0xcd6500b4), SPH_C32(0x613a0000), SPH_C32(0x42d70000), - SPH_C32(0x24e72eb8), SPH_C32(0xd73c07bc), SPH_C32(0xf437899a), - SPH_C32(0x5d65e199) }, - { SPH_C32(0xca180000), SPH_C32(0x7e1b0086), SPH_C32(0x74bee000), - SPH_C32(0xbfba0000), SPH_C32(0x89ff3b81), SPH_C32(0xdc54320c), - SPH_C32(0x5b247ce6), SPH_C32(0xa73f31d3), SPH_C32(0xaebc0000), - SPH_C32(0x28b500b4), SPH_C32(0x95ce6000), SPH_C32(0x00130000), - SPH_C32(0x475f13d2), SPH_C32(0xaf8693dc), SPH_C32(0xd5982870), - SPH_C32(0xedc0f9ad) }, - { SPH_C32(0x7cd60000), SPH_C32(0xa4f20084), SPH_C32(0x61d06000), - SPH_C32(0x65280000), SPH_C32(0x7f2261e5), SPH_C32(0xea666e86), - SPH_C32(0xa9569448), SPH_C32(0x0187f35e), SPH_C32(0x28c50000), - SPH_C32(0x178c00b6), SPH_C32(0x74548000), SPH_C32(0x98450000), - SPH_C32(0xd23a74dc), SPH_C32(0xe10e5b36), SPH_C32(0x06456134), - SPH_C32(0xfbdd2314) }, - { SPH_C32(0xfaaf0000), SPH_C32(0x9bcb0086), SPH_C32(0x804a8000), - SPH_C32(0xfd7e0000), SPH_C32(0xea4706eb), SPH_C32(0xa4eea66c), - SPH_C32(0x7a8bdd0c), SPH_C32(0x179a29e7), SPH_C32(0x18720000), - SPH_C32(0xf25c00b6), SPH_C32(0x80a0e000), SPH_C32(0xda810000), - SPH_C32(0xb18249b6), SPH_C32(0x99b4cf56), SPH_C32(0x27eac0de), - SPH_C32(0x4b783b20) }, - { SPH_C32(0x58780000), SPH_C32(0x62e800b8), SPH_C32(0xc5fb0000), - SPH_C32(0x635a0000), SPH_C32(0x07f63b3f), SPH_C32(0xae2f5693), - SPH_C32(0xe91f2512), SPH_C32(0x6ae830ea), SPH_C32(0x7d480000), - SPH_C32(0xf72b00a0), SPH_C32(0x93fc0000), SPH_C32(0xe8990000), - SPH_C32(0xfff96c1e), SPH_C32(0xf257b9a9), SPH_C32(0xe60a38cc), - SPH_C32(0x672b784e) }, - { SPH_C32(0xde010000), SPH_C32(0x5dd100ba), SPH_C32(0x2461e000), - SPH_C32(0xfb0c0000), SPH_C32(0x92935c31), SPH_C32(0xe0a79e79), - SPH_C32(0x3ac26c56), SPH_C32(0x7cf5ea53), SPH_C32(0x4dff0000), - SPH_C32(0x12fb00a0), SPH_C32(0x67086000), SPH_C32(0xaa5d0000), - SPH_C32(0x9c415174), SPH_C32(0x8aed2dc9), SPH_C32(0xc7a59926), - SPH_C32(0xd78e607a) }, - { SPH_C32(0x68cf0000), SPH_C32(0x873800b8), SPH_C32(0x310f6000), - SPH_C32(0x219e0000), SPH_C32(0x644e0655), SPH_C32(0xd695c2f3), - SPH_C32(0xc8b084f8), SPH_C32(0xda4d28de), SPH_C32(0xcb860000), - SPH_C32(0x2dc200a2), SPH_C32(0x86928000), SPH_C32(0x320b0000), - SPH_C32(0x0924367a), SPH_C32(0xc465e523), SPH_C32(0x1478d062), - SPH_C32(0xc193bac3) }, - { SPH_C32(0xeeb60000), SPH_C32(0xb80100ba), SPH_C32(0xd0958000), - SPH_C32(0xb9c80000), SPH_C32(0xf12b615b), SPH_C32(0x981d0a19), - SPH_C32(0x1b6dcdbc), SPH_C32(0xcc50f267), SPH_C32(0xfb310000), - SPH_C32(0xc81200a2), SPH_C32(0x7266e000), SPH_C32(0x70cf0000), - SPH_C32(0x6a9c0b10), SPH_C32(0xbcdf7143), SPH_C32(0x35d77188), - SPH_C32(0x7136a2f7) }, - { SPH_C32(0xfb720000), SPH_C32(0x7d1d00cc), SPH_C32(0x424c0000), - SPH_C32(0xe7bc0000), SPH_C32(0xe92150f6), SPH_C32(0xd1f9c1e1), - SPH_C32(0x257e9c37), SPH_C32(0xf51d2faa), SPH_C32(0xd5dc0000), - SPH_C32(0x28da0084), SPH_C32(0xdaa00000), SPH_C32(0x7d240000), - SPH_C32(0x4a8d736a), SPH_C32(0x8c028d8a), SPH_C32(0x87fef24b), - SPH_C32(0x90daf380) }, - { SPH_C32(0x7d0b0000), SPH_C32(0x422400ce), SPH_C32(0xa3d6e000), - SPH_C32(0x7fea0000), SPH_C32(0x7c4437f8), SPH_C32(0x9f71090b), - SPH_C32(0xf6a3d573), SPH_C32(0xe300f513), SPH_C32(0xe56b0000), - SPH_C32(0xcd0a0084), SPH_C32(0x2e546000), SPH_C32(0x3fe00000), - SPH_C32(0x29354e00), SPH_C32(0xf4b819ea), SPH_C32(0xa65153a1), - SPH_C32(0x207febb4) }, - { SPH_C32(0xcbc50000), SPH_C32(0x98cd00cc), SPH_C32(0xb6b86000), - SPH_C32(0xa5780000), SPH_C32(0x8a996d9c), SPH_C32(0xa9435581), - SPH_C32(0x04d13ddd), SPH_C32(0x45b8379e), SPH_C32(0x63120000), - SPH_C32(0xf2330086), SPH_C32(0xcfce8000), SPH_C32(0xa7b60000), - SPH_C32(0xbc50290e), SPH_C32(0xba30d100), SPH_C32(0x758c1ae5), - SPH_C32(0x3662310d) }, - { SPH_C32(0x4dbc0000), SPH_C32(0xa7f400ce), SPH_C32(0x57228000), - SPH_C32(0x3d2e0000), SPH_C32(0x1ffc0a92), SPH_C32(0xe7cb9d6b), - SPH_C32(0xd70c7499), SPH_C32(0x53a5ed27), SPH_C32(0x53a50000), - SPH_C32(0x17e30086), SPH_C32(0x3b3ae000), SPH_C32(0xe5720000), - SPH_C32(0xdfe81464), SPH_C32(0xc28a4560), SPH_C32(0x5423bb0f), - SPH_C32(0x86c72939) }, - { SPH_C32(0xef6b0000), SPH_C32(0x5ed700f0), SPH_C32(0x12930000), - SPH_C32(0xa30a0000), SPH_C32(0xf24d3746), SPH_C32(0xed0a6d94), - SPH_C32(0x44988c87), SPH_C32(0x2ed7f42a), SPH_C32(0x369f0000), - SPH_C32(0x12940090), SPH_C32(0x28660000), SPH_C32(0xd76a0000), - SPH_C32(0x919331cc), SPH_C32(0xa969339f), SPH_C32(0x95c3431d), - SPH_C32(0xaa946a57) }, - { SPH_C32(0x69120000), SPH_C32(0x61ee00f2), SPH_C32(0xf309e000), - SPH_C32(0x3b5c0000), SPH_C32(0x67285048), SPH_C32(0xa382a57e), - SPH_C32(0x9745c5c3), SPH_C32(0x38ca2e93), SPH_C32(0x06280000), - SPH_C32(0xf7440090), SPH_C32(0xdc926000), SPH_C32(0x95ae0000), - SPH_C32(0xf22b0ca6), SPH_C32(0xd1d3a7ff), SPH_C32(0xb46ce2f7), - SPH_C32(0x1a317263) }, - { SPH_C32(0xdfdc0000), SPH_C32(0xbb0700f0), SPH_C32(0xe6676000), - SPH_C32(0xe1ce0000), SPH_C32(0x91f50a2c), SPH_C32(0x95b0f9f4), - SPH_C32(0x65372d6d), SPH_C32(0x9e72ec1e), SPH_C32(0x80510000), - SPH_C32(0xc87d0092), SPH_C32(0x3d088000), SPH_C32(0x0df80000), - SPH_C32(0x674e6ba8), SPH_C32(0x9f5b6f15), SPH_C32(0x67b1abb3), - SPH_C32(0x0c2ca8da) }, - { SPH_C32(0x59a50000), SPH_C32(0x843e00f2), SPH_C32(0x07fd8000), - SPH_C32(0x79980000), SPH_C32(0x04906d22), SPH_C32(0xdb38311e), - SPH_C32(0xb6ea6429), SPH_C32(0x886f36a7), SPH_C32(0xb0e60000), - SPH_C32(0x2dad0092), SPH_C32(0xc9fce000), SPH_C32(0x4f3c0000), - SPH_C32(0x04f656c2), SPH_C32(0xe7e1fb75), SPH_C32(0x461e0a59), - SPH_C32(0xbc89b0ee) }, - { SPH_C32(0x18310000), SPH_C32(0x475300d8), SPH_C32(0xb08a0000), - SPH_C32(0x4df20000), SPH_C32(0x323f1250), SPH_C32(0xf4927ff4), - SPH_C32(0x37432d61), SPH_C32(0xcf53b67d), SPH_C32(0x22860000), - SPH_C32(0x315e00ac), SPH_C32(0x78b90000), SPH_C32(0x93dc0000), - SPH_C32(0x8aff567c), SPH_C32(0x959a9fea), SPH_C32(0xf42553ad), - SPH_C32(0x715eb1d7) }, - { SPH_C32(0x9e480000), SPH_C32(0x786a00da), SPH_C32(0x5110e000), - SPH_C32(0xd5a40000), SPH_C32(0xa75a755e), SPH_C32(0xba1ab71e), - SPH_C32(0xe49e6425), SPH_C32(0xd94e6cc4), SPH_C32(0x12310000), - SPH_C32(0xd48e00ac), SPH_C32(0x8c4d6000), SPH_C32(0xd1180000), - SPH_C32(0xe9476b16), SPH_C32(0xed200b8a), SPH_C32(0xd58af247), - SPH_C32(0xc1fba9e3) }, - { SPH_C32(0x28860000), SPH_C32(0xa28300d8), SPH_C32(0x447e6000), - SPH_C32(0x0f360000), SPH_C32(0x51872f3a), SPH_C32(0x8c28eb94), - SPH_C32(0x16ec8c8b), SPH_C32(0x7ff6ae49), SPH_C32(0x94480000), - SPH_C32(0xebb700ae), SPH_C32(0x6dd78000), SPH_C32(0x494e0000), - SPH_C32(0x7c220c18), SPH_C32(0xa3a8c360), SPH_C32(0x0657bb03), - SPH_C32(0xd7e6735a) }, - { SPH_C32(0xaeff0000), SPH_C32(0x9dba00da), SPH_C32(0xa5e48000), - SPH_C32(0x97600000), SPH_C32(0xc4e24834), SPH_C32(0xc2a0237e), - SPH_C32(0xc531c5cf), SPH_C32(0x69eb74f0), SPH_C32(0xa4ff0000), - SPH_C32(0x0e6700ae), SPH_C32(0x9923e000), SPH_C32(0x0b8a0000), - SPH_C32(0x1f9a3172), SPH_C32(0xdb125700), SPH_C32(0x27f81ae9), - SPH_C32(0x67436b6e) }, - { SPH_C32(0x0c280000), SPH_C32(0x649900e4), SPH_C32(0xe0550000), - SPH_C32(0x09440000), SPH_C32(0x295375e0), SPH_C32(0xc861d381), - SPH_C32(0x56a53dd1), SPH_C32(0x14996dfd), SPH_C32(0xc1c50000), - SPH_C32(0x0b1000b8), SPH_C32(0x8a7f0000), SPH_C32(0x39920000), - SPH_C32(0x51e114da), SPH_C32(0xb0f121ff), SPH_C32(0xe618e2fb), - SPH_C32(0x4b102800) }, - { SPH_C32(0x8a510000), SPH_C32(0x5ba000e6), SPH_C32(0x01cfe000), - SPH_C32(0x91120000), SPH_C32(0xbc3612ee), SPH_C32(0x86e91b6b), - SPH_C32(0x85787495), SPH_C32(0x0284b744), SPH_C32(0xf1720000), - SPH_C32(0xeec000b8), SPH_C32(0x7e8b6000), SPH_C32(0x7b560000), - SPH_C32(0x325929b0), SPH_C32(0xc84bb59f), SPH_C32(0xc7b74311), - SPH_C32(0xfbb53034) }, - { SPH_C32(0x3c9f0000), SPH_C32(0x814900e4), SPH_C32(0x14a16000), - SPH_C32(0x4b800000), SPH_C32(0x4aeb488a), SPH_C32(0xb0db47e1), - SPH_C32(0x770a9c3b), SPH_C32(0xa43c75c9), SPH_C32(0x770b0000), - SPH_C32(0xd1f900ba), SPH_C32(0x9f118000), SPH_C32(0xe3000000), - SPH_C32(0xa73c4ebe), SPH_C32(0x86c37d75), SPH_C32(0x146a0a55), - SPH_C32(0xeda8ea8d) }, - { SPH_C32(0xbae60000), SPH_C32(0xbe7000e6), SPH_C32(0xf53b8000), - SPH_C32(0xd3d60000), SPH_C32(0xdf8e2f84), SPH_C32(0xfe538f0b), - SPH_C32(0xa4d7d57f), SPH_C32(0xb221af70), SPH_C32(0x47bc0000), - SPH_C32(0x342900ba), SPH_C32(0x6be5e000), SPH_C32(0xa1c40000), - SPH_C32(0xc48473d4), SPH_C32(0xfe79e915), SPH_C32(0x35c5abbf), - SPH_C32(0x5d0df2b9) }, - { SPH_C32(0x13af0000), SPH_C32(0x87570088), SPH_C32(0x7e610000), - SPH_C32(0x5ca90000), SPH_C32(0x699c66ed), SPH_C32(0xf511dca5), - SPH_C32(0x9ad65ec3), SPH_C32(0xa75722f3), SPH_C32(0x818c0000), - SPH_C32(0x2eab00d8), SPH_C32(0xff0e0000), SPH_C32(0x173a0000), - SPH_C32(0x64283db5), SPH_C32(0xea4c0898), SPH_C32(0x3844ea88), - SPH_C32(0xeeabae97) }, - { SPH_C32(0x95d60000), SPH_C32(0xb86e008a), SPH_C32(0x9ffbe000), - SPH_C32(0xc4ff0000), SPH_C32(0xfcf901e3), SPH_C32(0xbb99144f), - SPH_C32(0x490b1787), SPH_C32(0xb14af84a), SPH_C32(0xb13b0000), - SPH_C32(0xcb7b00d8), SPH_C32(0x0bfa6000), SPH_C32(0x55fe0000), - SPH_C32(0x079000df), SPH_C32(0x92f69cf8), SPH_C32(0x19eb4b62), - SPH_C32(0x5e0eb6a3) }, - { SPH_C32(0x23180000), SPH_C32(0x62870088), SPH_C32(0x8a956000), - SPH_C32(0x1e6d0000), SPH_C32(0x0a245b87), SPH_C32(0x8dab48c5), - SPH_C32(0xbb79ff29), SPH_C32(0x17f23ac7), SPH_C32(0x37420000), - SPH_C32(0xf44200da), SPH_C32(0xea608000), SPH_C32(0xcda80000), - SPH_C32(0x92f567d1), SPH_C32(0xdc7e5412), SPH_C32(0xca360226), - SPH_C32(0x48136c1a) }, - { SPH_C32(0xa5610000), SPH_C32(0x5dbe008a), SPH_C32(0x6b0f8000), - SPH_C32(0x863b0000), SPH_C32(0x9f413c89), SPH_C32(0xc323802f), - SPH_C32(0x68a4b66d), SPH_C32(0x01efe07e), SPH_C32(0x07f50000), - SPH_C32(0x119200da), SPH_C32(0x1e94e000), SPH_C32(0x8f6c0000), - SPH_C32(0xf14d5abb), SPH_C32(0xa4c4c072), SPH_C32(0xeb99a3cc), - SPH_C32(0xf8b6742e) }, - { SPH_C32(0x07b60000), SPH_C32(0xa49d00b4), SPH_C32(0x2ebe0000), - SPH_C32(0x181f0000), SPH_C32(0x72f0015d), SPH_C32(0xc9e270d0), - SPH_C32(0xfb304e73), SPH_C32(0x7c9df973), SPH_C32(0x62cf0000), - SPH_C32(0x14e500cc), SPH_C32(0x0dc80000), SPH_C32(0xbd740000), - SPH_C32(0xbf367f13), SPH_C32(0xcf27b68d), SPH_C32(0x2a795bde), - SPH_C32(0xd4e53740) }, - { SPH_C32(0x81cf0000), SPH_C32(0x9ba400b6), SPH_C32(0xcf24e000), - SPH_C32(0x80490000), SPH_C32(0xe7956653), SPH_C32(0x876ab83a), - SPH_C32(0x28ed0737), SPH_C32(0x6a8023ca), SPH_C32(0x52780000), - SPH_C32(0xf13500cc), SPH_C32(0xf93c6000), SPH_C32(0xffb00000), - SPH_C32(0xdc8e4279), SPH_C32(0xb79d22ed), SPH_C32(0x0bd6fa34), - SPH_C32(0x64402f74) }, - { SPH_C32(0x37010000), SPH_C32(0x414d00b4), SPH_C32(0xda4a6000), - SPH_C32(0x5adb0000), SPH_C32(0x11483c37), SPH_C32(0xb158e4b0), - SPH_C32(0xda9fef99), SPH_C32(0xcc38e147), SPH_C32(0xd4010000), - SPH_C32(0xce0c00ce), SPH_C32(0x18a68000), SPH_C32(0x67e60000), - SPH_C32(0x49eb2577), SPH_C32(0xf915ea07), SPH_C32(0xd80bb370), - SPH_C32(0x725df5cd) }, - { SPH_C32(0xb1780000), SPH_C32(0x7e7400b6), SPH_C32(0x3bd08000), - SPH_C32(0xc28d0000), SPH_C32(0x842d5b39), SPH_C32(0xffd02c5a), - SPH_C32(0x0942a6dd), SPH_C32(0xda253bfe), SPH_C32(0xe4b60000), - SPH_C32(0x2bdc00ce), SPH_C32(0xec52e000), SPH_C32(0x25220000), - SPH_C32(0x2a53181d), SPH_C32(0x81af7e67), SPH_C32(0xf9a4129a), - SPH_C32(0xc2f8edf9) }, - { SPH_C32(0xf0ec0000), SPH_C32(0xbd19009c), SPH_C32(0x8ca70000), - SPH_C32(0xf6e70000), SPH_C32(0xb282244b), SPH_C32(0xd07a62b0), - SPH_C32(0x88ebef95), SPH_C32(0x9d19bb24), SPH_C32(0x76d60000), - SPH_C32(0x372f00f0), SPH_C32(0x5d170000), SPH_C32(0xf9c20000), - SPH_C32(0xa45a18a3), SPH_C32(0xf3d41af8), SPH_C32(0x4b9f4b6e), - SPH_C32(0x0f2fecc0) }, - { SPH_C32(0x76950000), SPH_C32(0x8220009e), SPH_C32(0x6d3de000), - SPH_C32(0x6eb10000), SPH_C32(0x27e74345), SPH_C32(0x9ef2aa5a), - SPH_C32(0x5b36a6d1), SPH_C32(0x8b04619d), SPH_C32(0x46610000), - SPH_C32(0xd2ff00f0), SPH_C32(0xa9e36000), SPH_C32(0xbb060000), - SPH_C32(0xc7e225c9), SPH_C32(0x8b6e8e98), SPH_C32(0x6a30ea84), - SPH_C32(0xbf8af4f4) }, - { SPH_C32(0xc05b0000), SPH_C32(0x58c9009c), SPH_C32(0x78536000), - SPH_C32(0xb4230000), SPH_C32(0xd13a1921), SPH_C32(0xa8c0f6d0), - SPH_C32(0xa9444e7f), SPH_C32(0x2dbca310), SPH_C32(0xc0180000), - SPH_C32(0xedc600f2), SPH_C32(0x48798000), SPH_C32(0x23500000), - SPH_C32(0x528742c7), SPH_C32(0xc5e64672), SPH_C32(0xb9eda3c0), - SPH_C32(0xa9972e4d) }, - { SPH_C32(0x46220000), SPH_C32(0x67f0009e), SPH_C32(0x99c98000), - SPH_C32(0x2c750000), SPH_C32(0x445f7e2f), SPH_C32(0xe6483e3a), - SPH_C32(0x7a99073b), SPH_C32(0x3ba179a9), SPH_C32(0xf0af0000), - SPH_C32(0x081600f2), SPH_C32(0xbc8de000), SPH_C32(0x61940000), - SPH_C32(0x313f7fad), SPH_C32(0xbd5cd212), SPH_C32(0x9842022a), - SPH_C32(0x19323679) }, - { SPH_C32(0xe4f50000), SPH_C32(0x9ed300a0), SPH_C32(0xdc780000), - SPH_C32(0xb2510000), SPH_C32(0xa9ee43fb), SPH_C32(0xec89cec5), - SPH_C32(0xe90dff25), SPH_C32(0x46d360a4), SPH_C32(0x95950000), - SPH_C32(0x0d6100e4), SPH_C32(0xafd10000), SPH_C32(0x538c0000), - SPH_C32(0x7f445a05), SPH_C32(0xd6bfa4ed), SPH_C32(0x59a2fa38), - SPH_C32(0x35617517) }, - { SPH_C32(0x628c0000), SPH_C32(0xa1ea00a2), SPH_C32(0x3de2e000), - SPH_C32(0x2a070000), SPH_C32(0x3c8b24f5), SPH_C32(0xa201062f), - SPH_C32(0x3ad0b661), SPH_C32(0x50ceba1d), SPH_C32(0xa5220000), - SPH_C32(0xe8b100e4), SPH_C32(0x5b256000), SPH_C32(0x11480000), - SPH_C32(0x1cfc676f), SPH_C32(0xae05308d), SPH_C32(0x780d5bd2), - SPH_C32(0x85c46d23) }, - { SPH_C32(0xd4420000), SPH_C32(0x7b0300a0), SPH_C32(0x288c6000), - SPH_C32(0xf0950000), SPH_C32(0xca567e91), SPH_C32(0x94335aa5), - SPH_C32(0xc8a25ecf), SPH_C32(0xf6767890), SPH_C32(0x235b0000), - SPH_C32(0xd78800e6), SPH_C32(0xbabf8000), SPH_C32(0x891e0000), - SPH_C32(0x89990061), SPH_C32(0xe08df867), SPH_C32(0xabd01296), - SPH_C32(0x93d9b79a) }, - { SPH_C32(0x523b0000), SPH_C32(0x443a00a2), SPH_C32(0xc9168000), - SPH_C32(0x68c30000), SPH_C32(0x5f33199f), SPH_C32(0xdabb924f), - SPH_C32(0x1b7f178b), SPH_C32(0xe06ba229), SPH_C32(0x13ec0000), - SPH_C32(0x325800e6), SPH_C32(0x4e4be000), SPH_C32(0xcbda0000), - SPH_C32(0xea213d0b), SPH_C32(0x98376c07), SPH_C32(0x8a7fb37c), - SPH_C32(0x237cafae) }, - { SPH_C32(0x47ff0000), SPH_C32(0x812600d4), SPH_C32(0x5bcf0000), - SPH_C32(0x36b70000), SPH_C32(0x47392832), SPH_C32(0x935f59b7), - SPH_C32(0x256c4600), SPH_C32(0xd9267fe4), SPH_C32(0x3d010000), - SPH_C32(0xd29000c0), SPH_C32(0xe68d0000), SPH_C32(0xc6310000), - SPH_C32(0xca304571), SPH_C32(0xa8ea90ce), SPH_C32(0x385630bf), - SPH_C32(0xc290fed9) }, - { SPH_C32(0xc1860000), SPH_C32(0xbe1f00d6), SPH_C32(0xba55e000), - SPH_C32(0xaee10000), SPH_C32(0xd25c4f3c), SPH_C32(0xddd7915d), - SPH_C32(0xf6b10f44), SPH_C32(0xcf3ba55d), SPH_C32(0x0db60000), - SPH_C32(0x374000c0), SPH_C32(0x12796000), SPH_C32(0x84f50000), - SPH_C32(0xa988781b), SPH_C32(0xd05004ae), SPH_C32(0x19f99155), - SPH_C32(0x7235e6ed) }, - { SPH_C32(0x77480000), SPH_C32(0x64f600d4), SPH_C32(0xaf3b6000), - SPH_C32(0x74730000), SPH_C32(0x24811558), SPH_C32(0xebe5cdd7), - SPH_C32(0x04c3e7ea), SPH_C32(0x698367d0), SPH_C32(0x8bcf0000), - SPH_C32(0x087900c2), SPH_C32(0xf3e38000), SPH_C32(0x1ca30000), - SPH_C32(0x3ced1f15), SPH_C32(0x9ed8cc44), SPH_C32(0xca24d811), - SPH_C32(0x64283c54) }, - { SPH_C32(0xf1310000), SPH_C32(0x5bcf00d6), SPH_C32(0x4ea18000), - SPH_C32(0xec250000), SPH_C32(0xb1e47256), SPH_C32(0xa56d053d), - SPH_C32(0xd71eaeae), SPH_C32(0x7f9ebd69), SPH_C32(0xbb780000), - SPH_C32(0xeda900c2), SPH_C32(0x0717e000), SPH_C32(0x5e670000), - SPH_C32(0x5f55227f), SPH_C32(0xe6625824), SPH_C32(0xeb8b79fb), - SPH_C32(0xd48d2460) }, - { SPH_C32(0x53e60000), SPH_C32(0xa2ec00e8), SPH_C32(0x0b100000), - SPH_C32(0x72010000), SPH_C32(0x5c554f82), SPH_C32(0xafacf5c2), - SPH_C32(0x448a56b0), SPH_C32(0x02eca464), SPH_C32(0xde420000), - SPH_C32(0xe8de00d4), SPH_C32(0x144b0000), SPH_C32(0x6c7f0000), - SPH_C32(0x112e07d7), SPH_C32(0x8d812edb), SPH_C32(0x2a6b81e9), - SPH_C32(0xf8de670e) }, - { SPH_C32(0xd59f0000), SPH_C32(0x9dd500ea), SPH_C32(0xea8ae000), - SPH_C32(0xea570000), SPH_C32(0xc930288c), SPH_C32(0xe1243d28), - SPH_C32(0x97571ff4), SPH_C32(0x14f17edd), SPH_C32(0xeef50000), - SPH_C32(0x0d0e00d4), SPH_C32(0xe0bf6000), SPH_C32(0x2ebb0000), - SPH_C32(0x72963abd), SPH_C32(0xf53bbabb), SPH_C32(0x0bc42003), - SPH_C32(0x487b7f3a) }, - { SPH_C32(0x63510000), SPH_C32(0x473c00e8), SPH_C32(0xffe46000), - SPH_C32(0x30c50000), SPH_C32(0x3fed72e8), SPH_C32(0xd71661a2), - SPH_C32(0x6525f75a), SPH_C32(0xb249bc50), SPH_C32(0x688c0000), - SPH_C32(0x323700d6), SPH_C32(0x01258000), SPH_C32(0xb6ed0000), - SPH_C32(0xe7f35db3), SPH_C32(0xbbb37251), SPH_C32(0xd8196947), - SPH_C32(0x5e66a583) }, - { SPH_C32(0xe5280000), SPH_C32(0x780500ea), SPH_C32(0x1e7e8000), - SPH_C32(0xa8930000), SPH_C32(0xaa8815e6), SPH_C32(0x999ea948), - SPH_C32(0xb6f8be1e), SPH_C32(0xa45466e9), SPH_C32(0x583b0000), - SPH_C32(0xd7e700d6), SPH_C32(0xf5d1e000), SPH_C32(0xf4290000), - SPH_C32(0x844b60d9), SPH_C32(0xc309e631), SPH_C32(0xf9b6c8ad), - SPH_C32(0xeec3bdb7) }, - { SPH_C32(0xa4bc0000), SPH_C32(0xbb6800c0), SPH_C32(0xa9090000), - SPH_C32(0x9cf90000), SPH_C32(0x9c276a94), SPH_C32(0xb634e7a2), - SPH_C32(0x3751f756), SPH_C32(0xe368e633), SPH_C32(0xca5b0000), - SPH_C32(0xcb1400e8), SPH_C32(0x44940000), SPH_C32(0x28c90000), - SPH_C32(0x0a426067), SPH_C32(0xb17282ae), SPH_C32(0x4b8d9159), - SPH_C32(0x2314bc8e) }, - { SPH_C32(0x22c50000), SPH_C32(0x845100c2), SPH_C32(0x4893e000), - SPH_C32(0x04af0000), SPH_C32(0x09420d9a), SPH_C32(0xf8bc2f48), - SPH_C32(0xe48cbe12), SPH_C32(0xf5753c8a), SPH_C32(0xfaec0000), - SPH_C32(0x2ec400e8), SPH_C32(0xb0606000), SPH_C32(0x6a0d0000), - SPH_C32(0x69fa5d0d), SPH_C32(0xc9c816ce), SPH_C32(0x6a2230b3), - SPH_C32(0x93b1a4ba) }, - { SPH_C32(0x940b0000), SPH_C32(0x5eb800c0), SPH_C32(0x5dfd6000), - SPH_C32(0xde3d0000), SPH_C32(0xff9f57fe), SPH_C32(0xce8e73c2), - SPH_C32(0x16fe56bc), SPH_C32(0x53cdfe07), SPH_C32(0x7c950000), - SPH_C32(0x11fd00ea), SPH_C32(0x51fa8000), SPH_C32(0xf25b0000), - SPH_C32(0xfc9f3a03), SPH_C32(0x8740de24), SPH_C32(0xb9ff79f7), - SPH_C32(0x85ac7e03) }, - { SPH_C32(0x12720000), SPH_C32(0x618100c2), SPH_C32(0xbc678000), - SPH_C32(0x466b0000), SPH_C32(0x6afa30f0), SPH_C32(0x8006bb28), - SPH_C32(0xc5231ff8), SPH_C32(0x45d024be), SPH_C32(0x4c220000), - SPH_C32(0xf42d00ea), SPH_C32(0xa50ee000), SPH_C32(0xb09f0000), - SPH_C32(0x9f270769), SPH_C32(0xfffa4a44), SPH_C32(0x9850d81d), - SPH_C32(0x35096637) }, - { SPH_C32(0xb0a50000), SPH_C32(0x98a200fc), SPH_C32(0xf9d60000), - SPH_C32(0xd84f0000), SPH_C32(0x874b0d24), SPH_C32(0x8ac74bd7), - SPH_C32(0x56b7e7e6), SPH_C32(0x38a23db3), SPH_C32(0x29180000), - SPH_C32(0xf15a00fc), SPH_C32(0xb6520000), SPH_C32(0x82870000), - SPH_C32(0xd15c22c1), SPH_C32(0x94193cbb), SPH_C32(0x59b0200f), - SPH_C32(0x195a2559) }, - { SPH_C32(0x36dc0000), SPH_C32(0xa79b00fe), SPH_C32(0x184ce000), - SPH_C32(0x40190000), SPH_C32(0x122e6a2a), SPH_C32(0xc44f833d), - SPH_C32(0x856aaea2), SPH_C32(0x2ebfe70a), SPH_C32(0x19af0000), - SPH_C32(0x148a00fc), SPH_C32(0x42a66000), SPH_C32(0xc0430000), - SPH_C32(0xb2e41fab), SPH_C32(0xeca3a8db), SPH_C32(0x781f81e5), - SPH_C32(0xa9ff3d6d) }, - { SPH_C32(0x80120000), SPH_C32(0x7d7200fc), SPH_C32(0x0d226000), - SPH_C32(0x9a8b0000), SPH_C32(0xe4f3304e), SPH_C32(0xf27ddfb7), - SPH_C32(0x7718460c), SPH_C32(0x88072587), SPH_C32(0x9fd60000), - SPH_C32(0x2bb300fe), SPH_C32(0xa33c8000), SPH_C32(0x58150000), - SPH_C32(0x278178a5), SPH_C32(0xa22b6031), SPH_C32(0xabc2c8a1), - SPH_C32(0xbfe2e7d4) }, - { SPH_C32(0x066b0000), SPH_C32(0x424b00fe), SPH_C32(0xecb88000), - SPH_C32(0x02dd0000), SPH_C32(0x71965740), SPH_C32(0xbcf5175d), - SPH_C32(0xa4c50f48), SPH_C32(0x9e1aff3e), SPH_C32(0xaf610000), - SPH_C32(0xce6300fe), SPH_C32(0x57c8e000), SPH_C32(0x1ad10000), - SPH_C32(0x443945cf), SPH_C32(0xda91f451), SPH_C32(0x8a6d694b), - SPH_C32(0x0f47ffe0) } -}; - -static const sph_u32 T512_32[256][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xcc140000), SPH_C32(0xa5630000), SPH_C32(0x5ab90780), - SPH_C32(0x3b500000), SPH_C32(0x4bd013ff), SPH_C32(0x879b3418), - SPH_C32(0x694348c1), SPH_C32(0xca5a87fe), SPH_C32(0x819e0000), - SPH_C32(0xec570000), SPH_C32(0x66320280), SPH_C32(0x95f30000), - SPH_C32(0x5da92802), SPH_C32(0x48f43cbc), SPH_C32(0xe65aa22d), - SPH_C32(0x8e67b7fa) }, - { SPH_C32(0x819e0000), SPH_C32(0xec570000), SPH_C32(0x66320280), - SPH_C32(0x95f30000), SPH_C32(0x5da92802), SPH_C32(0x48f43cbc), - SPH_C32(0xe65aa22d), SPH_C32(0x8e67b7fa), SPH_C32(0x4d8a0000), - SPH_C32(0x49340000), SPH_C32(0x3c8b0500), SPH_C32(0xaea30000), - SPH_C32(0x16793bfd), SPH_C32(0xcf6f08a4), SPH_C32(0x8f19eaec), - SPH_C32(0x443d3004) }, - { SPH_C32(0x4d8a0000), SPH_C32(0x49340000), SPH_C32(0x3c8b0500), - SPH_C32(0xaea30000), SPH_C32(0x16793bfd), SPH_C32(0xcf6f08a4), - SPH_C32(0x8f19eaec), SPH_C32(0x443d3004), SPH_C32(0xcc140000), - SPH_C32(0xa5630000), SPH_C32(0x5ab90780), SPH_C32(0x3b500000), - SPH_C32(0x4bd013ff), SPH_C32(0x879b3418), SPH_C32(0x694348c1), - SPH_C32(0xca5a87fe) }, - { SPH_C32(0x78230000), SPH_C32(0x12fc0000), SPH_C32(0xa93a0b80), - SPH_C32(0x90a50000), SPH_C32(0x713e2879), SPH_C32(0x7ee98924), - SPH_C32(0xf08ca062), SPH_C32(0x636f8bab), SPH_C32(0x02af0000), - SPH_C32(0xb7280000), SPH_C32(0xba1c0300), SPH_C32(0x56980000), - SPH_C32(0xba8d45d3), SPH_C32(0x8048c667), SPH_C32(0xa95c149a), - SPH_C32(0xf4f6ea7b) }, - { SPH_C32(0xb4370000), SPH_C32(0xb79f0000), SPH_C32(0xf3830c00), - SPH_C32(0xabf50000), SPH_C32(0x3aee3b86), SPH_C32(0xf972bd3c), - SPH_C32(0x99cfe8a3), SPH_C32(0xa9350c55), SPH_C32(0x83310000), - SPH_C32(0x5b7f0000), SPH_C32(0xdc2e0180), SPH_C32(0xc36b0000), - SPH_C32(0xe7246dd1), SPH_C32(0xc8bcfadb), SPH_C32(0x4f06b6b7), - SPH_C32(0x7a915d81) }, - { SPH_C32(0xf9bd0000), SPH_C32(0xfeab0000), SPH_C32(0xcf080900), - SPH_C32(0x05560000), SPH_C32(0x2c97007b), SPH_C32(0x361db598), - SPH_C32(0x16d6024f), SPH_C32(0xed083c51), SPH_C32(0x4f250000), - SPH_C32(0xfe1c0000), SPH_C32(0x86970600), SPH_C32(0xf83b0000), - SPH_C32(0xacf47e2e), SPH_C32(0x4f27cec3), SPH_C32(0x2645fe76), - SPH_C32(0xb0cbda7f) }, - { SPH_C32(0x35a90000), SPH_C32(0x5bc80000), SPH_C32(0x95b10e80), - SPH_C32(0x3e060000), SPH_C32(0x67471384), SPH_C32(0xb1868180), - SPH_C32(0x7f954a8e), SPH_C32(0x2752bbaf), SPH_C32(0xcebb0000), - SPH_C32(0x124b0000), SPH_C32(0xe0a50480), SPH_C32(0x6dc80000), - SPH_C32(0xf15d562c), SPH_C32(0x07d3f27f), SPH_C32(0xc01f5c5b), - SPH_C32(0x3eac6d85) }, - { SPH_C32(0x02af0000), SPH_C32(0xb7280000), SPH_C32(0xba1c0300), - SPH_C32(0x56980000), SPH_C32(0xba8d45d3), SPH_C32(0x8048c667), - SPH_C32(0xa95c149a), SPH_C32(0xf4f6ea7b), SPH_C32(0x7a8c0000), - SPH_C32(0xa5d40000), SPH_C32(0x13260880), SPH_C32(0xc63d0000), - SPH_C32(0xcbb36daa), SPH_C32(0xfea14f43), SPH_C32(0x59d0b4f8), - SPH_C32(0x979961d0) }, - { SPH_C32(0xcebb0000), SPH_C32(0x124b0000), SPH_C32(0xe0a50480), - SPH_C32(0x6dc80000), SPH_C32(0xf15d562c), SPH_C32(0x07d3f27f), - SPH_C32(0xc01f5c5b), SPH_C32(0x3eac6d85), SPH_C32(0xfb120000), - SPH_C32(0x49830000), SPH_C32(0x75140a00), SPH_C32(0x53ce0000), - SPH_C32(0x961a45a8), SPH_C32(0xb65573ff), SPH_C32(0xbf8a16d5), - SPH_C32(0x19fed62a) }, - { SPH_C32(0x83310000), SPH_C32(0x5b7f0000), SPH_C32(0xdc2e0180), - SPH_C32(0xc36b0000), SPH_C32(0xe7246dd1), SPH_C32(0xc8bcfadb), - SPH_C32(0x4f06b6b7), SPH_C32(0x7a915d81), SPH_C32(0x37060000), - SPH_C32(0xece00000), SPH_C32(0x2fad0d80), SPH_C32(0x689e0000), - SPH_C32(0xddca5657), SPH_C32(0x31ce47e7), SPH_C32(0xd6c95e14), - SPH_C32(0xd3a451d4) }, - { SPH_C32(0x4f250000), SPH_C32(0xfe1c0000), SPH_C32(0x86970600), - SPH_C32(0xf83b0000), SPH_C32(0xacf47e2e), SPH_C32(0x4f27cec3), - SPH_C32(0x2645fe76), SPH_C32(0xb0cbda7f), SPH_C32(0xb6980000), - SPH_C32(0x00b70000), SPH_C32(0x499f0f00), SPH_C32(0xfd6d0000), - SPH_C32(0x80637e55), SPH_C32(0x793a7b5b), SPH_C32(0x3093fc39), - SPH_C32(0x5dc3e62e) }, - { SPH_C32(0x7a8c0000), SPH_C32(0xa5d40000), SPH_C32(0x13260880), - SPH_C32(0xc63d0000), SPH_C32(0xcbb36daa), SPH_C32(0xfea14f43), - SPH_C32(0x59d0b4f8), SPH_C32(0x979961d0), SPH_C32(0x78230000), - SPH_C32(0x12fc0000), SPH_C32(0xa93a0b80), SPH_C32(0x90a50000), - SPH_C32(0x713e2879), SPH_C32(0x7ee98924), SPH_C32(0xf08ca062), - SPH_C32(0x636f8bab) }, - { SPH_C32(0xb6980000), SPH_C32(0x00b70000), SPH_C32(0x499f0f00), - SPH_C32(0xfd6d0000), SPH_C32(0x80637e55), SPH_C32(0x793a7b5b), - SPH_C32(0x3093fc39), SPH_C32(0x5dc3e62e), SPH_C32(0xf9bd0000), - SPH_C32(0xfeab0000), SPH_C32(0xcf080900), SPH_C32(0x05560000), - SPH_C32(0x2c97007b), SPH_C32(0x361db598), SPH_C32(0x16d6024f), - SPH_C32(0xed083c51) }, - { SPH_C32(0xfb120000), SPH_C32(0x49830000), SPH_C32(0x75140a00), - SPH_C32(0x53ce0000), SPH_C32(0x961a45a8), SPH_C32(0xb65573ff), - SPH_C32(0xbf8a16d5), SPH_C32(0x19fed62a), SPH_C32(0x35a90000), - SPH_C32(0x5bc80000), SPH_C32(0x95b10e80), SPH_C32(0x3e060000), - SPH_C32(0x67471384), SPH_C32(0xb1868180), SPH_C32(0x7f954a8e), - SPH_C32(0x2752bbaf) }, - { SPH_C32(0x37060000), SPH_C32(0xece00000), SPH_C32(0x2fad0d80), - SPH_C32(0x689e0000), SPH_C32(0xddca5657), SPH_C32(0x31ce47e7), - SPH_C32(0xd6c95e14), SPH_C32(0xd3a451d4), SPH_C32(0xb4370000), - SPH_C32(0xb79f0000), SPH_C32(0xf3830c00), SPH_C32(0xabf50000), - SPH_C32(0x3aee3b86), SPH_C32(0xf972bd3c), SPH_C32(0x99cfe8a3), - SPH_C32(0xa9350c55) }, - { SPH_C32(0xac480000), SPH_C32(0x1ba60000), SPH_C32(0x45fb1380), - SPH_C32(0x03430000), SPH_C32(0x5a85316a), SPH_C32(0x1fb250b6), - SPH_C32(0xfe72c7fe), SPH_C32(0x91e478f6), SPH_C32(0x1e4e0000), - SPH_C32(0xdecf0000), SPH_C32(0x6df80180), SPH_C32(0x77240000), - SPH_C32(0xec47079e), SPH_C32(0xf4a0694e), SPH_C32(0xcda31812), - SPH_C32(0x98aa496e) }, - { SPH_C32(0x605c0000), SPH_C32(0xbec50000), SPH_C32(0x1f421400), - SPH_C32(0x38130000), SPH_C32(0x11552295), SPH_C32(0x982964ae), - SPH_C32(0x97318f3f), SPH_C32(0x5bbeff08), SPH_C32(0x9fd00000), - SPH_C32(0x32980000), SPH_C32(0x0bca0300), SPH_C32(0xe2d70000), - SPH_C32(0xb1ee2f9c), SPH_C32(0xbc5455f2), SPH_C32(0x2bf9ba3f), - SPH_C32(0x16cdfe94) }, - { SPH_C32(0x2dd60000), SPH_C32(0xf7f10000), SPH_C32(0x23c91100), - SPH_C32(0x96b00000), SPH_C32(0x072c1968), SPH_C32(0x57466c0a), - SPH_C32(0x182865d3), SPH_C32(0x1f83cf0c), SPH_C32(0x53c40000), - SPH_C32(0x97fb0000), SPH_C32(0x51730480), SPH_C32(0xd9870000), - SPH_C32(0xfa3e3c63), SPH_C32(0x3bcf61ea), SPH_C32(0x42baf2fe), - SPH_C32(0xdc97796a) }, - { SPH_C32(0xe1c20000), SPH_C32(0x52920000), SPH_C32(0x79701680), - SPH_C32(0xade00000), SPH_C32(0x4cfc0a97), SPH_C32(0xd0dd5812), - SPH_C32(0x716b2d12), SPH_C32(0xd5d948f2), SPH_C32(0xd25a0000), - SPH_C32(0x7bac0000), SPH_C32(0x37410600), SPH_C32(0x4c740000), - SPH_C32(0xa7971461), SPH_C32(0x733b5d56), SPH_C32(0xa4e050d3), - SPH_C32(0x52f0ce90) }, - { SPH_C32(0xd46b0000), SPH_C32(0x095a0000), SPH_C32(0xecc11800), - SPH_C32(0x93e60000), SPH_C32(0x2bbb1913), SPH_C32(0x615bd992), - SPH_C32(0x0efe679c), SPH_C32(0xf28bf35d), SPH_C32(0x1ce10000), - SPH_C32(0x69e70000), SPH_C32(0xd7e40280), SPH_C32(0x21bc0000), - SPH_C32(0x56ca424d), SPH_C32(0x74e8af29), SPH_C32(0x64ff0c88), - SPH_C32(0x6c5ca315) }, - { SPH_C32(0x187f0000), SPH_C32(0xac390000), SPH_C32(0xb6781f80), - SPH_C32(0xa8b60000), SPH_C32(0x606b0aec), SPH_C32(0xe6c0ed8a), - SPH_C32(0x67bd2f5d), SPH_C32(0x38d174a3), SPH_C32(0x9d7f0000), - SPH_C32(0x85b00000), SPH_C32(0xb1d60000), SPH_C32(0xb44f0000), - SPH_C32(0x0b636a4f), SPH_C32(0x3c1c9395), SPH_C32(0x82a5aea5), - SPH_C32(0xe23b14ef) }, - { SPH_C32(0x55f50000), SPH_C32(0xe50d0000), SPH_C32(0x8af31a80), - SPH_C32(0x06150000), SPH_C32(0x76123111), SPH_C32(0x29afe52e), - SPH_C32(0xe8a4c5b1), SPH_C32(0x7cec44a7), SPH_C32(0x516b0000), - SPH_C32(0x20d30000), SPH_C32(0xeb6f0780), SPH_C32(0x8f1f0000), - SPH_C32(0x40b379b0), SPH_C32(0xbb87a78d), SPH_C32(0xebe6e664), - SPH_C32(0x28619311) }, - { SPH_C32(0x99e10000), SPH_C32(0x406e0000), SPH_C32(0xd04a1d00), - SPH_C32(0x3d450000), SPH_C32(0x3dc222ee), SPH_C32(0xae34d136), - SPH_C32(0x81e78d70), SPH_C32(0xb6b6c359), SPH_C32(0xd0f50000), - SPH_C32(0xcc840000), SPH_C32(0x8d5d0500), SPH_C32(0x1aec0000), - SPH_C32(0x1d1a51b2), SPH_C32(0xf3739b31), SPH_C32(0x0dbc4449), - SPH_C32(0xa60624eb) }, - { SPH_C32(0xaee70000), SPH_C32(0xac8e0000), SPH_C32(0xffe71080), - SPH_C32(0x55db0000), SPH_C32(0xe00874b9), SPH_C32(0x9ffa96d1), - SPH_C32(0x572ed364), SPH_C32(0x6512928d), SPH_C32(0x64c20000), - SPH_C32(0x7b1b0000), SPH_C32(0x7ede0900), SPH_C32(0xb1190000), - SPH_C32(0x27f46a34), SPH_C32(0x0a01260d), SPH_C32(0x9473acea), - SPH_C32(0x0f3328be) }, - { SPH_C32(0x62f30000), SPH_C32(0x09ed0000), SPH_C32(0xa55e1700), - SPH_C32(0x6e8b0000), SPH_C32(0xabd86746), SPH_C32(0x1861a2c9), - SPH_C32(0x3e6d9ba5), SPH_C32(0xaf481573), SPH_C32(0xe55c0000), - SPH_C32(0x974c0000), SPH_C32(0x18ec0b80), SPH_C32(0x24ea0000), - SPH_C32(0x7a5d4236), SPH_C32(0x42f51ab1), SPH_C32(0x72290ec7), - SPH_C32(0x81549f44) }, - { SPH_C32(0x2f790000), SPH_C32(0x40d90000), SPH_C32(0x99d51200), - SPH_C32(0xc0280000), SPH_C32(0xbda15cbb), SPH_C32(0xd70eaa6d), - SPH_C32(0xb1747149), SPH_C32(0xeb752577), SPH_C32(0x29480000), - SPH_C32(0x322f0000), SPH_C32(0x42550c00), SPH_C32(0x1fba0000), - SPH_C32(0x318d51c9), SPH_C32(0xc56e2ea9), SPH_C32(0x1b6a4606), - SPH_C32(0x4b0e18ba) }, - { SPH_C32(0xe36d0000), SPH_C32(0xe5ba0000), SPH_C32(0xc36c1580), - SPH_C32(0xfb780000), SPH_C32(0xf6714f44), SPH_C32(0x50959e75), - SPH_C32(0xd8373988), SPH_C32(0x212fa289), SPH_C32(0xa8d60000), - SPH_C32(0xde780000), SPH_C32(0x24670e80), SPH_C32(0x8a490000), - SPH_C32(0x6c2479cb), SPH_C32(0x8d9a1215), SPH_C32(0xfd30e42b), - SPH_C32(0xc569af40) }, - { SPH_C32(0xd6c40000), SPH_C32(0xbe720000), SPH_C32(0x56dd1b00), - SPH_C32(0xc57e0000), SPH_C32(0x91365cc0), SPH_C32(0xe1131ff5), - SPH_C32(0xa7a27306), SPH_C32(0x067d1926), SPH_C32(0x666d0000), - SPH_C32(0xcc330000), SPH_C32(0xc4c20a00), SPH_C32(0xe7810000), - SPH_C32(0x9d792fe7), SPH_C32(0x8a49e06a), SPH_C32(0x3d2fb870), - SPH_C32(0xfbc5c2c5) }, - { SPH_C32(0x1ad00000), SPH_C32(0x1b110000), SPH_C32(0x0c641c80), - SPH_C32(0xfe2e0000), SPH_C32(0xdae64f3f), SPH_C32(0x66882bed), - SPH_C32(0xcee13bc7), SPH_C32(0xcc279ed8), SPH_C32(0xe7f30000), - SPH_C32(0x20640000), SPH_C32(0xa2f00880), SPH_C32(0x72720000), - SPH_C32(0xc0d007e5), SPH_C32(0xc2bddcd6), SPH_C32(0xdb751a5d), - SPH_C32(0x75a2753f) }, - { SPH_C32(0x575a0000), SPH_C32(0x52250000), SPH_C32(0x30ef1980), - SPH_C32(0x508d0000), SPH_C32(0xcc9f74c2), SPH_C32(0xa9e72349), - SPH_C32(0x41f8d12b), SPH_C32(0x881aaedc), SPH_C32(0x2be70000), - SPH_C32(0x85070000), SPH_C32(0xf8490f00), SPH_C32(0x49220000), - SPH_C32(0x8b00141a), SPH_C32(0x4526e8ce), SPH_C32(0xb236529c), - SPH_C32(0xbff8f2c1) }, - { SPH_C32(0x9b4e0000), SPH_C32(0xf7460000), SPH_C32(0x6a561e00), - SPH_C32(0x6bdd0000), SPH_C32(0x874f673d), SPH_C32(0x2e7c1751), - SPH_C32(0x28bb99ea), SPH_C32(0x42402922), SPH_C32(0xaa790000), - SPH_C32(0x69500000), SPH_C32(0x9e7b0d80), SPH_C32(0xdcd10000), - SPH_C32(0xd6a93c18), SPH_C32(0x0dd2d472), SPH_C32(0x546cf0b1), - SPH_C32(0x319f453b) }, - { SPH_C32(0x1e4e0000), SPH_C32(0xdecf0000), SPH_C32(0x6df80180), - SPH_C32(0x77240000), SPH_C32(0xec47079e), SPH_C32(0xf4a0694e), - SPH_C32(0xcda31812), SPH_C32(0x98aa496e), SPH_C32(0xb2060000), - SPH_C32(0xc5690000), SPH_C32(0x28031200), SPH_C32(0x74670000), - SPH_C32(0xb6c236f4), SPH_C32(0xeb1239f8), SPH_C32(0x33d1dfec), - SPH_C32(0x094e3198) }, - { SPH_C32(0xd25a0000), SPH_C32(0x7bac0000), SPH_C32(0x37410600), - SPH_C32(0x4c740000), SPH_C32(0xa7971461), SPH_C32(0x733b5d56), - SPH_C32(0xa4e050d3), SPH_C32(0x52f0ce90), SPH_C32(0x33980000), - SPH_C32(0x293e0000), SPH_C32(0x4e311080), SPH_C32(0xe1940000), - SPH_C32(0xeb6b1ef6), SPH_C32(0xa3e60544), SPH_C32(0xd58b7dc1), - SPH_C32(0x87298662) }, - { SPH_C32(0x9fd00000), SPH_C32(0x32980000), SPH_C32(0x0bca0300), - SPH_C32(0xe2d70000), SPH_C32(0xb1ee2f9c), SPH_C32(0xbc5455f2), - SPH_C32(0x2bf9ba3f), SPH_C32(0x16cdfe94), SPH_C32(0xff8c0000), - SPH_C32(0x8c5d0000), SPH_C32(0x14881700), SPH_C32(0xdac40000), - SPH_C32(0xa0bb0d09), SPH_C32(0x247d315c), SPH_C32(0xbcc83500), - SPH_C32(0x4d73019c) }, - { SPH_C32(0x53c40000), SPH_C32(0x97fb0000), SPH_C32(0x51730480), - SPH_C32(0xd9870000), SPH_C32(0xfa3e3c63), SPH_C32(0x3bcf61ea), - SPH_C32(0x42baf2fe), SPH_C32(0xdc97796a), SPH_C32(0x7e120000), - SPH_C32(0x600a0000), SPH_C32(0x72ba1580), SPH_C32(0x4f370000), - SPH_C32(0xfd12250b), SPH_C32(0x6c890de0), SPH_C32(0x5a92972d), - SPH_C32(0xc314b666) }, - { SPH_C32(0x666d0000), SPH_C32(0xcc330000), SPH_C32(0xc4c20a00), - SPH_C32(0xe7810000), SPH_C32(0x9d792fe7), SPH_C32(0x8a49e06a), - SPH_C32(0x3d2fb870), SPH_C32(0xfbc5c2c5), SPH_C32(0xb0a90000), - SPH_C32(0x72410000), SPH_C32(0x921f1100), SPH_C32(0x22ff0000), - SPH_C32(0x0c4f7327), SPH_C32(0x6b5aff9f), SPH_C32(0x9a8dcb76), - SPH_C32(0xfdb8dbe3) }, - { SPH_C32(0xaa790000), SPH_C32(0x69500000), SPH_C32(0x9e7b0d80), - SPH_C32(0xdcd10000), SPH_C32(0xd6a93c18), SPH_C32(0x0dd2d472), - SPH_C32(0x546cf0b1), SPH_C32(0x319f453b), SPH_C32(0x31370000), - SPH_C32(0x9e160000), SPH_C32(0xf42d1380), SPH_C32(0xb70c0000), - SPH_C32(0x51e65b25), SPH_C32(0x23aec323), SPH_C32(0x7cd7695b), - SPH_C32(0x73df6c19) }, - { SPH_C32(0xe7f30000), SPH_C32(0x20640000), SPH_C32(0xa2f00880), - SPH_C32(0x72720000), SPH_C32(0xc0d007e5), SPH_C32(0xc2bddcd6), - SPH_C32(0xdb751a5d), SPH_C32(0x75a2753f), SPH_C32(0xfd230000), - SPH_C32(0x3b750000), SPH_C32(0xae941400), SPH_C32(0x8c5c0000), - SPH_C32(0x1a3648da), SPH_C32(0xa435f73b), SPH_C32(0x1594219a), - SPH_C32(0xb985ebe7) }, - { SPH_C32(0x2be70000), SPH_C32(0x85070000), SPH_C32(0xf8490f00), - SPH_C32(0x49220000), SPH_C32(0x8b00141a), SPH_C32(0x4526e8ce), - SPH_C32(0xb236529c), SPH_C32(0xbff8f2c1), SPH_C32(0x7cbd0000), - SPH_C32(0xd7220000), SPH_C32(0xc8a61680), SPH_C32(0x19af0000), - SPH_C32(0x479f60d8), SPH_C32(0xecc1cb87), SPH_C32(0xf3ce83b7), - SPH_C32(0x37e25c1d) }, - { SPH_C32(0x1ce10000), SPH_C32(0x69e70000), SPH_C32(0xd7e40280), - SPH_C32(0x21bc0000), SPH_C32(0x56ca424d), SPH_C32(0x74e8af29), - SPH_C32(0x64ff0c88), SPH_C32(0x6c5ca315), SPH_C32(0xc88a0000), - SPH_C32(0x60bd0000), SPH_C32(0x3b251a80), SPH_C32(0xb25a0000), - SPH_C32(0x7d715b5e), SPH_C32(0x15b376bb), SPH_C32(0x6a016b14), - SPH_C32(0x9ed75048) }, - { SPH_C32(0xd0f50000), SPH_C32(0xcc840000), SPH_C32(0x8d5d0500), - SPH_C32(0x1aec0000), SPH_C32(0x1d1a51b2), SPH_C32(0xf3739b31), - SPH_C32(0x0dbc4449), SPH_C32(0xa60624eb), SPH_C32(0x49140000), - SPH_C32(0x8cea0000), SPH_C32(0x5d171800), SPH_C32(0x27a90000), - SPH_C32(0x20d8735c), SPH_C32(0x5d474a07), SPH_C32(0x8c5bc939), - SPH_C32(0x10b0e7b2) }, - { SPH_C32(0x9d7f0000), SPH_C32(0x85b00000), SPH_C32(0xb1d60000), - SPH_C32(0xb44f0000), SPH_C32(0x0b636a4f), SPH_C32(0x3c1c9395), - SPH_C32(0x82a5aea5), SPH_C32(0xe23b14ef), SPH_C32(0x85000000), - SPH_C32(0x29890000), SPH_C32(0x07ae1f80), SPH_C32(0x1cf90000), - SPH_C32(0x6b0860a3), SPH_C32(0xdadc7e1f), SPH_C32(0xe51881f8), - SPH_C32(0xdaea604c) }, - { SPH_C32(0x516b0000), SPH_C32(0x20d30000), SPH_C32(0xeb6f0780), - SPH_C32(0x8f1f0000), SPH_C32(0x40b379b0), SPH_C32(0xbb87a78d), - SPH_C32(0xebe6e664), SPH_C32(0x28619311), SPH_C32(0x049e0000), - SPH_C32(0xc5de0000), SPH_C32(0x619c1d00), SPH_C32(0x890a0000), - SPH_C32(0x36a148a1), SPH_C32(0x922842a3), SPH_C32(0x034223d5), - SPH_C32(0x548dd7b6) }, - { SPH_C32(0x64c20000), SPH_C32(0x7b1b0000), SPH_C32(0x7ede0900), - SPH_C32(0xb1190000), SPH_C32(0x27f46a34), SPH_C32(0x0a01260d), - SPH_C32(0x9473acea), SPH_C32(0x0f3328be), SPH_C32(0xca250000), - SPH_C32(0xd7950000), SPH_C32(0x81391980), SPH_C32(0xe4c20000), - SPH_C32(0xc7fc1e8d), SPH_C32(0x95fbb0dc), SPH_C32(0xc35d7f8e), - SPH_C32(0x6a21ba33) }, - { SPH_C32(0xa8d60000), SPH_C32(0xde780000), SPH_C32(0x24670e80), - SPH_C32(0x8a490000), SPH_C32(0x6c2479cb), SPH_C32(0x8d9a1215), - SPH_C32(0xfd30e42b), SPH_C32(0xc569af40), SPH_C32(0x4bbb0000), - SPH_C32(0x3bc20000), SPH_C32(0xe70b1b00), SPH_C32(0x71310000), - SPH_C32(0x9a55368f), SPH_C32(0xdd0f8c60), SPH_C32(0x2507dda3), - SPH_C32(0xe4460dc9) }, - { SPH_C32(0xe55c0000), SPH_C32(0x974c0000), SPH_C32(0x18ec0b80), - SPH_C32(0x24ea0000), SPH_C32(0x7a5d4236), SPH_C32(0x42f51ab1), - SPH_C32(0x72290ec7), SPH_C32(0x81549f44), SPH_C32(0x87af0000), - SPH_C32(0x9ea10000), SPH_C32(0xbdb21c80), SPH_C32(0x4a610000), - SPH_C32(0xd1852570), SPH_C32(0x5a94b878), SPH_C32(0x4c449562), - SPH_C32(0x2e1c8a37) }, - { SPH_C32(0x29480000), SPH_C32(0x322f0000), SPH_C32(0x42550c00), - SPH_C32(0x1fba0000), SPH_C32(0x318d51c9), SPH_C32(0xc56e2ea9), - SPH_C32(0x1b6a4606), SPH_C32(0x4b0e18ba), SPH_C32(0x06310000), - SPH_C32(0x72f60000), SPH_C32(0xdb801e00), SPH_C32(0xdf920000), - SPH_C32(0x8c2c0d72), SPH_C32(0x126084c4), SPH_C32(0xaa1e374f), - SPH_C32(0xa07b3dcd) }, - { SPH_C32(0xb2060000), SPH_C32(0xc5690000), SPH_C32(0x28031200), - SPH_C32(0x74670000), SPH_C32(0xb6c236f4), SPH_C32(0xeb1239f8), - SPH_C32(0x33d1dfec), SPH_C32(0x094e3198), SPH_C32(0xac480000), - SPH_C32(0x1ba60000), SPH_C32(0x45fb1380), SPH_C32(0x03430000), - SPH_C32(0x5a85316a), SPH_C32(0x1fb250b6), SPH_C32(0xfe72c7fe), - SPH_C32(0x91e478f6) }, - { SPH_C32(0x7e120000), SPH_C32(0x600a0000), SPH_C32(0x72ba1580), - SPH_C32(0x4f370000), SPH_C32(0xfd12250b), SPH_C32(0x6c890de0), - SPH_C32(0x5a92972d), SPH_C32(0xc314b666), SPH_C32(0x2dd60000), - SPH_C32(0xf7f10000), SPH_C32(0x23c91100), SPH_C32(0x96b00000), - SPH_C32(0x072c1968), SPH_C32(0x57466c0a), SPH_C32(0x182865d3), - SPH_C32(0x1f83cf0c) }, - { SPH_C32(0x33980000), SPH_C32(0x293e0000), SPH_C32(0x4e311080), - SPH_C32(0xe1940000), SPH_C32(0xeb6b1ef6), SPH_C32(0xa3e60544), - SPH_C32(0xd58b7dc1), SPH_C32(0x87298662), SPH_C32(0xe1c20000), - SPH_C32(0x52920000), SPH_C32(0x79701680), SPH_C32(0xade00000), - SPH_C32(0x4cfc0a97), SPH_C32(0xd0dd5812), SPH_C32(0x716b2d12), - SPH_C32(0xd5d948f2) }, - { SPH_C32(0xff8c0000), SPH_C32(0x8c5d0000), SPH_C32(0x14881700), - SPH_C32(0xdac40000), SPH_C32(0xa0bb0d09), SPH_C32(0x247d315c), - SPH_C32(0xbcc83500), SPH_C32(0x4d73019c), SPH_C32(0x605c0000), - SPH_C32(0xbec50000), SPH_C32(0x1f421400), SPH_C32(0x38130000), - SPH_C32(0x11552295), SPH_C32(0x982964ae), SPH_C32(0x97318f3f), - SPH_C32(0x5bbeff08) }, - { SPH_C32(0xca250000), SPH_C32(0xd7950000), SPH_C32(0x81391980), - SPH_C32(0xe4c20000), SPH_C32(0xc7fc1e8d), SPH_C32(0x95fbb0dc), - SPH_C32(0xc35d7f8e), SPH_C32(0x6a21ba33), SPH_C32(0xaee70000), - SPH_C32(0xac8e0000), SPH_C32(0xffe71080), SPH_C32(0x55db0000), - SPH_C32(0xe00874b9), SPH_C32(0x9ffa96d1), SPH_C32(0x572ed364), - SPH_C32(0x6512928d) }, - { SPH_C32(0x06310000), SPH_C32(0x72f60000), SPH_C32(0xdb801e00), - SPH_C32(0xdf920000), SPH_C32(0x8c2c0d72), SPH_C32(0x126084c4), - SPH_C32(0xaa1e374f), SPH_C32(0xa07b3dcd), SPH_C32(0x2f790000), - SPH_C32(0x40d90000), SPH_C32(0x99d51200), SPH_C32(0xc0280000), - SPH_C32(0xbda15cbb), SPH_C32(0xd70eaa6d), SPH_C32(0xb1747149), - SPH_C32(0xeb752577) }, - { SPH_C32(0x4bbb0000), SPH_C32(0x3bc20000), SPH_C32(0xe70b1b00), - SPH_C32(0x71310000), SPH_C32(0x9a55368f), SPH_C32(0xdd0f8c60), - SPH_C32(0x2507dda3), SPH_C32(0xe4460dc9), SPH_C32(0xe36d0000), - SPH_C32(0xe5ba0000), SPH_C32(0xc36c1580), SPH_C32(0xfb780000), - SPH_C32(0xf6714f44), SPH_C32(0x50959e75), SPH_C32(0xd8373988), - SPH_C32(0x212fa289) }, - { SPH_C32(0x87af0000), SPH_C32(0x9ea10000), SPH_C32(0xbdb21c80), - SPH_C32(0x4a610000), SPH_C32(0xd1852570), SPH_C32(0x5a94b878), - SPH_C32(0x4c449562), SPH_C32(0x2e1c8a37), SPH_C32(0x62f30000), - SPH_C32(0x09ed0000), SPH_C32(0xa55e1700), SPH_C32(0x6e8b0000), - SPH_C32(0xabd86746), SPH_C32(0x1861a2c9), SPH_C32(0x3e6d9ba5), - SPH_C32(0xaf481573) }, - { SPH_C32(0xb0a90000), SPH_C32(0x72410000), SPH_C32(0x921f1100), - SPH_C32(0x22ff0000), SPH_C32(0x0c4f7327), SPH_C32(0x6b5aff9f), - SPH_C32(0x9a8dcb76), SPH_C32(0xfdb8dbe3), SPH_C32(0xd6c40000), - SPH_C32(0xbe720000), SPH_C32(0x56dd1b00), SPH_C32(0xc57e0000), - SPH_C32(0x91365cc0), SPH_C32(0xe1131ff5), SPH_C32(0xa7a27306), - SPH_C32(0x067d1926) }, - { SPH_C32(0x7cbd0000), SPH_C32(0xd7220000), SPH_C32(0xc8a61680), - SPH_C32(0x19af0000), SPH_C32(0x479f60d8), SPH_C32(0xecc1cb87), - SPH_C32(0xf3ce83b7), SPH_C32(0x37e25c1d), SPH_C32(0x575a0000), - SPH_C32(0x52250000), SPH_C32(0x30ef1980), SPH_C32(0x508d0000), - SPH_C32(0xcc9f74c2), SPH_C32(0xa9e72349), SPH_C32(0x41f8d12b), - SPH_C32(0x881aaedc) }, - { SPH_C32(0x31370000), SPH_C32(0x9e160000), SPH_C32(0xf42d1380), - SPH_C32(0xb70c0000), SPH_C32(0x51e65b25), SPH_C32(0x23aec323), - SPH_C32(0x7cd7695b), SPH_C32(0x73df6c19), SPH_C32(0x9b4e0000), - SPH_C32(0xf7460000), SPH_C32(0x6a561e00), SPH_C32(0x6bdd0000), - SPH_C32(0x874f673d), SPH_C32(0x2e7c1751), SPH_C32(0x28bb99ea), - SPH_C32(0x42402922) }, - { SPH_C32(0xfd230000), SPH_C32(0x3b750000), SPH_C32(0xae941400), - SPH_C32(0x8c5c0000), SPH_C32(0x1a3648da), SPH_C32(0xa435f73b), - SPH_C32(0x1594219a), SPH_C32(0xb985ebe7), SPH_C32(0x1ad00000), - SPH_C32(0x1b110000), SPH_C32(0x0c641c80), SPH_C32(0xfe2e0000), - SPH_C32(0xdae64f3f), SPH_C32(0x66882bed), SPH_C32(0xcee13bc7), - SPH_C32(0xcc279ed8) }, - { SPH_C32(0xc88a0000), SPH_C32(0x60bd0000), SPH_C32(0x3b251a80), - SPH_C32(0xb25a0000), SPH_C32(0x7d715b5e), SPH_C32(0x15b376bb), - SPH_C32(0x6a016b14), SPH_C32(0x9ed75048), SPH_C32(0xd46b0000), - SPH_C32(0x095a0000), SPH_C32(0xecc11800), SPH_C32(0x93e60000), - SPH_C32(0x2bbb1913), SPH_C32(0x615bd992), SPH_C32(0x0efe679c), - SPH_C32(0xf28bf35d) }, - { SPH_C32(0x049e0000), SPH_C32(0xc5de0000), SPH_C32(0x619c1d00), - SPH_C32(0x890a0000), SPH_C32(0x36a148a1), SPH_C32(0x922842a3), - SPH_C32(0x034223d5), SPH_C32(0x548dd7b6), SPH_C32(0x55f50000), - SPH_C32(0xe50d0000), SPH_C32(0x8af31a80), SPH_C32(0x06150000), - SPH_C32(0x76123111), SPH_C32(0x29afe52e), SPH_C32(0xe8a4c5b1), - SPH_C32(0x7cec44a7) }, - { SPH_C32(0x49140000), SPH_C32(0x8cea0000), SPH_C32(0x5d171800), - SPH_C32(0x27a90000), SPH_C32(0x20d8735c), SPH_C32(0x5d474a07), - SPH_C32(0x8c5bc939), SPH_C32(0x10b0e7b2), SPH_C32(0x99e10000), - SPH_C32(0x406e0000), SPH_C32(0xd04a1d00), SPH_C32(0x3d450000), - SPH_C32(0x3dc222ee), SPH_C32(0xae34d136), SPH_C32(0x81e78d70), - SPH_C32(0xb6b6c359) }, - { SPH_C32(0x85000000), SPH_C32(0x29890000), SPH_C32(0x07ae1f80), - SPH_C32(0x1cf90000), SPH_C32(0x6b0860a3), SPH_C32(0xdadc7e1f), - SPH_C32(0xe51881f8), SPH_C32(0xdaea604c), SPH_C32(0x187f0000), - SPH_C32(0xac390000), SPH_C32(0xb6781f80), SPH_C32(0xa8b60000), - SPH_C32(0x606b0aec), SPH_C32(0xe6c0ed8a), SPH_C32(0x67bd2f5d), - SPH_C32(0x38d174a3) }, - { SPH_C32(0xaec30000), SPH_C32(0x9c4f0001), SPH_C32(0x79d1e000), - SPH_C32(0x2c150000), SPH_C32(0x45cc75b3), SPH_C32(0x6650b736), - SPH_C32(0xab92f78f), SPH_C32(0xa312567b), SPH_C32(0xdb250000), - SPH_C32(0x09290000), SPH_C32(0x49aac000), SPH_C32(0x81e10000), - SPH_C32(0xcafe6b59), SPH_C32(0x42793431), SPH_C32(0x43566b76), - SPH_C32(0xe86cba2e) }, - { SPH_C32(0x62d70000), SPH_C32(0x392c0001), SPH_C32(0x2368e780), - SPH_C32(0x17450000), SPH_C32(0x0e1c664c), SPH_C32(0xe1cb832e), - SPH_C32(0xc2d1bf4e), SPH_C32(0x6948d185), SPH_C32(0x5abb0000), - SPH_C32(0xe57e0000), SPH_C32(0x2f98c280), SPH_C32(0x14120000), - SPH_C32(0x9757435b), SPH_C32(0x0a8d088d), SPH_C32(0xa50cc95b), - SPH_C32(0x660b0dd4) }, - { SPH_C32(0x2f5d0000), SPH_C32(0x70180001), SPH_C32(0x1fe3e280), - SPH_C32(0xb9e60000), SPH_C32(0x18655db1), SPH_C32(0x2ea48b8a), - SPH_C32(0x4dc855a2), SPH_C32(0x2d75e181), SPH_C32(0x96af0000), - SPH_C32(0x401d0000), SPH_C32(0x7521c500), SPH_C32(0x2f420000), - SPH_C32(0xdc8750a4), SPH_C32(0x8d163c95), SPH_C32(0xcc4f819a), - SPH_C32(0xac518a2a) }, - { SPH_C32(0xe3490000), SPH_C32(0xd57b0001), SPH_C32(0x455ae500), - SPH_C32(0x82b60000), SPH_C32(0x53b54e4e), SPH_C32(0xa93fbf92), - SPH_C32(0x248b1d63), SPH_C32(0xe72f667f), SPH_C32(0x17310000), - SPH_C32(0xac4a0000), SPH_C32(0x1313c780), SPH_C32(0xbab10000), - SPH_C32(0x812e78a6), SPH_C32(0xc5e20029), SPH_C32(0x2a1523b7), - SPH_C32(0x22363dd0) }, - { SPH_C32(0xd6e00000), SPH_C32(0x8eb30001), SPH_C32(0xd0ebeb80), - SPH_C32(0xbcb00000), SPH_C32(0x34f25dca), SPH_C32(0x18b93e12), - SPH_C32(0x5b1e57ed), SPH_C32(0xc07dddd0), SPH_C32(0xd98a0000), - SPH_C32(0xbe010000), SPH_C32(0xf3b6c300), SPH_C32(0xd7790000), - SPH_C32(0x70732e8a), SPH_C32(0xc231f256), SPH_C32(0xea0a7fec), - SPH_C32(0x1c9a5055) }, - { SPH_C32(0x1af40000), SPH_C32(0x2bd00001), SPH_C32(0x8a52ec00), - SPH_C32(0x87e00000), SPH_C32(0x7f224e35), SPH_C32(0x9f220a0a), - SPH_C32(0x325d1f2c), SPH_C32(0x0a275a2e), SPH_C32(0x58140000), - SPH_C32(0x52560000), SPH_C32(0x9584c180), SPH_C32(0x428a0000), - SPH_C32(0x2dda0688), SPH_C32(0x8ac5ceea), SPH_C32(0x0c50ddc1), - SPH_C32(0x92fde7af) }, - { SPH_C32(0x577e0000), SPH_C32(0x62e40001), SPH_C32(0xb6d9e900), - SPH_C32(0x29430000), SPH_C32(0x695b75c8), SPH_C32(0x504d02ae), - SPH_C32(0xbd44f5c0), SPH_C32(0x4e1a6a2a), SPH_C32(0x94000000), - SPH_C32(0xf7350000), SPH_C32(0xcf3dc600), SPH_C32(0x79da0000), - SPH_C32(0x660a1577), SPH_C32(0x0d5efaf2), SPH_C32(0x65139500), - SPH_C32(0x58a76051) }, - { SPH_C32(0x9b6a0000), SPH_C32(0xc7870001), SPH_C32(0xec60ee80), - SPH_C32(0x12130000), SPH_C32(0x228b6637), SPH_C32(0xd7d636b6), - SPH_C32(0xd407bd01), SPH_C32(0x8440edd4), SPH_C32(0x159e0000), - SPH_C32(0x1b620000), SPH_C32(0xa90fc480), SPH_C32(0xec290000), - SPH_C32(0x3ba33d75), SPH_C32(0x45aac64e), SPH_C32(0x8349372d), - SPH_C32(0xd6c0d7ab) }, - { SPH_C32(0xac6c0000), SPH_C32(0x2b670001), SPH_C32(0xc3cde300), - SPH_C32(0x7a8d0000), SPH_C32(0xff413060), SPH_C32(0xe6187151), - SPH_C32(0x02cee315), SPH_C32(0x57e4bc00), SPH_C32(0xa1a90000), - SPH_C32(0xacfd0000), SPH_C32(0x5a8cc880), SPH_C32(0x47dc0000), - SPH_C32(0x014d06f3), SPH_C32(0xbcd87b72), SPH_C32(0x1a86df8e), - SPH_C32(0x7ff5dbfe) }, - { SPH_C32(0x60780000), SPH_C32(0x8e040001), SPH_C32(0x9974e480), - SPH_C32(0x41dd0000), SPH_C32(0xb491239f), SPH_C32(0x61834549), - SPH_C32(0x6b8dabd4), SPH_C32(0x9dbe3bfe), SPH_C32(0x20370000), - SPH_C32(0x40aa0000), SPH_C32(0x3cbeca00), SPH_C32(0xd22f0000), - SPH_C32(0x5ce42ef1), SPH_C32(0xf42c47ce), SPH_C32(0xfcdc7da3), - SPH_C32(0xf1926c04) }, - { SPH_C32(0x2df20000), SPH_C32(0xc7300001), SPH_C32(0xa5ffe180), - SPH_C32(0xef7e0000), SPH_C32(0xa2e81862), SPH_C32(0xaeec4ded), - SPH_C32(0xe4944138), SPH_C32(0xd9830bfa), SPH_C32(0xec230000), - SPH_C32(0xe5c90000), SPH_C32(0x6607cd80), SPH_C32(0xe97f0000), - SPH_C32(0x17343d0e), SPH_C32(0x73b773d6), SPH_C32(0x959f3562), - SPH_C32(0x3bc8ebfa) }, - { SPH_C32(0xe1e60000), SPH_C32(0x62530001), SPH_C32(0xff46e600), - SPH_C32(0xd42e0000), SPH_C32(0xe9380b9d), SPH_C32(0x297779f5), - SPH_C32(0x8dd709f9), SPH_C32(0x13d98c04), SPH_C32(0x6dbd0000), - SPH_C32(0x099e0000), SPH_C32(0x0035cf00), SPH_C32(0x7c8c0000), - SPH_C32(0x4a9d150c), SPH_C32(0x3b434f6a), SPH_C32(0x73c5974f), - SPH_C32(0xb5af5c00) }, - { SPH_C32(0xd44f0000), SPH_C32(0x399b0001), SPH_C32(0x6af7e880), - SPH_C32(0xea280000), SPH_C32(0x8e7f1819), SPH_C32(0x98f1f875), - SPH_C32(0xf2424377), SPH_C32(0x348b37ab), SPH_C32(0xa3060000), - SPH_C32(0x1bd50000), SPH_C32(0xe090cb80), SPH_C32(0x11440000), - SPH_C32(0xbbc04320), SPH_C32(0x3c90bd15), SPH_C32(0xb3dacb14), - SPH_C32(0x8b033185) }, - { SPH_C32(0x185b0000), SPH_C32(0x9cf80001), SPH_C32(0x304eef00), - SPH_C32(0xd1780000), SPH_C32(0xc5af0be6), SPH_C32(0x1f6acc6d), - SPH_C32(0x9b010bb6), SPH_C32(0xfed1b055), SPH_C32(0x22980000), - SPH_C32(0xf7820000), SPH_C32(0x86a2c900), SPH_C32(0x84b70000), - SPH_C32(0xe6696b22), SPH_C32(0x746481a9), SPH_C32(0x55806939), - SPH_C32(0x0564867f) }, - { SPH_C32(0x55d10000), SPH_C32(0xd5cc0001), SPH_C32(0x0cc5ea00), - SPH_C32(0x7fdb0000), SPH_C32(0xd3d6301b), SPH_C32(0xd005c4c9), - SPH_C32(0x1418e15a), SPH_C32(0xbaec8051), SPH_C32(0xee8c0000), - SPH_C32(0x52e10000), SPH_C32(0xdc1bce80), SPH_C32(0xbfe70000), - SPH_C32(0xadb978dd), SPH_C32(0xf3ffb5b1), SPH_C32(0x3cc321f8), - SPH_C32(0xcf3e0181) }, - { SPH_C32(0x99c50000), SPH_C32(0x70af0001), SPH_C32(0x567ced80), - SPH_C32(0x448b0000), SPH_C32(0x980623e4), SPH_C32(0x579ef0d1), - SPH_C32(0x7d5ba99b), SPH_C32(0x70b607af), SPH_C32(0x6f120000), - SPH_C32(0xbeb60000), SPH_C32(0xba29cc00), SPH_C32(0x2a140000), - SPH_C32(0xf01050df), SPH_C32(0xbb0b890d), SPH_C32(0xda9983d5), - SPH_C32(0x4159b67b) }, - { SPH_C32(0x028b0000), SPH_C32(0x87e90001), SPH_C32(0x3c2af380), - SPH_C32(0x2f560000), SPH_C32(0x1f4944d9), SPH_C32(0x79e2e780), - SPH_C32(0x55e03071), SPH_C32(0x32f62e8d), SPH_C32(0xc56b0000), - SPH_C32(0xd7e60000), SPH_C32(0x2452c180), SPH_C32(0xf6c50000), - SPH_C32(0x26b96cc7), SPH_C32(0xb6d95d7f), SPH_C32(0x8ef57364), - SPH_C32(0x70c6f340) }, - { SPH_C32(0xce9f0000), SPH_C32(0x228a0001), SPH_C32(0x6693f400), - SPH_C32(0x14060000), SPH_C32(0x54995726), SPH_C32(0xfe79d398), - SPH_C32(0x3ca378b0), SPH_C32(0xf8aca973), SPH_C32(0x44f50000), - SPH_C32(0x3bb10000), SPH_C32(0x4260c300), SPH_C32(0x63360000), - SPH_C32(0x7b1044c5), SPH_C32(0xfe2d61c3), SPH_C32(0x68afd149), - SPH_C32(0xfea144ba) }, - { SPH_C32(0x83150000), SPH_C32(0x6bbe0001), SPH_C32(0x5a18f100), - SPH_C32(0xbaa50000), SPH_C32(0x42e06cdb), SPH_C32(0x3116db3c), - SPH_C32(0xb3ba925c), SPH_C32(0xbc919977), SPH_C32(0x88e10000), - SPH_C32(0x9ed20000), SPH_C32(0x18d9c480), SPH_C32(0x58660000), - SPH_C32(0x30c0573a), SPH_C32(0x79b655db), SPH_C32(0x01ec9988), - SPH_C32(0x34fbc344) }, - { SPH_C32(0x4f010000), SPH_C32(0xcedd0001), SPH_C32(0x00a1f680), - SPH_C32(0x81f50000), SPH_C32(0x09307f24), SPH_C32(0xb68def24), - SPH_C32(0xdaf9da9d), SPH_C32(0x76cb1e89), SPH_C32(0x097f0000), - SPH_C32(0x72850000), SPH_C32(0x7eebc600), SPH_C32(0xcd950000), - SPH_C32(0x6d697f38), SPH_C32(0x31426967), SPH_C32(0xe7b63ba5), - SPH_C32(0xba9c74be) }, - { SPH_C32(0x7aa80000), SPH_C32(0x95150001), SPH_C32(0x9510f800), - SPH_C32(0xbff30000), SPH_C32(0x6e776ca0), SPH_C32(0x070b6ea4), - SPH_C32(0xa56c9013), SPH_C32(0x5199a526), SPH_C32(0xc7c40000), - SPH_C32(0x60ce0000), SPH_C32(0x9e4ec280), SPH_C32(0xa05d0000), - SPH_C32(0x9c342914), SPH_C32(0x36919b18), SPH_C32(0x27a967fe), - SPH_C32(0x8430193b) }, - { SPH_C32(0xb6bc0000), SPH_C32(0x30760001), SPH_C32(0xcfa9ff80), - SPH_C32(0x84a30000), SPH_C32(0x25a77f5f), SPH_C32(0x80905abc), - SPH_C32(0xcc2fd8d2), SPH_C32(0x9bc322d8), SPH_C32(0x465a0000), - SPH_C32(0x8c990000), SPH_C32(0xf87cc000), SPH_C32(0x35ae0000), - SPH_C32(0xc19d0116), SPH_C32(0x7e65a7a4), SPH_C32(0xc1f3c5d3), - SPH_C32(0x0a57aec1) }, - { SPH_C32(0xfb360000), SPH_C32(0x79420001), SPH_C32(0xf322fa80), - SPH_C32(0x2a000000), SPH_C32(0x33de44a2), SPH_C32(0x4fff5218), - SPH_C32(0x4336323e), SPH_C32(0xdffe12dc), SPH_C32(0x8a4e0000), - SPH_C32(0x29fa0000), SPH_C32(0xa2c5c780), SPH_C32(0x0efe0000), - SPH_C32(0x8a4d12e9), SPH_C32(0xf9fe93bc), SPH_C32(0xa8b08d12), - SPH_C32(0xc00d293f) }, - { SPH_C32(0x37220000), SPH_C32(0xdc210001), SPH_C32(0xa99bfd00), - SPH_C32(0x11500000), SPH_C32(0x780e575d), SPH_C32(0xc8646600), - SPH_C32(0x2a757aff), SPH_C32(0x15a49522), SPH_C32(0x0bd00000), - SPH_C32(0xc5ad0000), SPH_C32(0xc4f7c500), SPH_C32(0x9b0d0000), - SPH_C32(0xd7e43aeb), SPH_C32(0xb10aaf00), SPH_C32(0x4eea2f3f), - SPH_C32(0x4e6a9ec5) }, - { SPH_C32(0x00240000), SPH_C32(0x30c10001), SPH_C32(0x8636f080), - SPH_C32(0x79ce0000), SPH_C32(0xa5c4010a), SPH_C32(0xf9aa21e7), - SPH_C32(0xfcbc24eb), SPH_C32(0xc600c4f6), SPH_C32(0xbfe70000), - SPH_C32(0x72320000), SPH_C32(0x3774c900), SPH_C32(0x30f80000), - SPH_C32(0xed0a016d), SPH_C32(0x4878123c), SPH_C32(0xd725c79c), - SPH_C32(0xe75f9290) }, - { SPH_C32(0xcc300000), SPH_C32(0x95a20001), SPH_C32(0xdc8ff700), - SPH_C32(0x429e0000), SPH_C32(0xee1412f5), SPH_C32(0x7e3115ff), - SPH_C32(0x95ff6c2a), SPH_C32(0x0c5a4308), SPH_C32(0x3e790000), - SPH_C32(0x9e650000), SPH_C32(0x5146cb80), SPH_C32(0xa50b0000), - SPH_C32(0xb0a3296f), SPH_C32(0x008c2e80), SPH_C32(0x317f65b1), - SPH_C32(0x6938256a) }, - { SPH_C32(0x81ba0000), SPH_C32(0xdc960001), SPH_C32(0xe004f200), - SPH_C32(0xec3d0000), SPH_C32(0xf86d2908), SPH_C32(0xb15e1d5b), - SPH_C32(0x1ae686c6), SPH_C32(0x4867730c), SPH_C32(0xf26d0000), - SPH_C32(0x3b060000), SPH_C32(0x0bffcc00), SPH_C32(0x9e5b0000), - SPH_C32(0xfb733a90), SPH_C32(0x87171a98), SPH_C32(0x583c2d70), - SPH_C32(0xa362a294) }, - { SPH_C32(0x4dae0000), SPH_C32(0x79f50001), SPH_C32(0xbabdf580), - SPH_C32(0xd76d0000), SPH_C32(0xb3bd3af7), SPH_C32(0x36c52943), - SPH_C32(0x73a5ce07), SPH_C32(0x823df4f2), SPH_C32(0x73f30000), - SPH_C32(0xd7510000), SPH_C32(0x6dcdce80), SPH_C32(0x0ba80000), - SPH_C32(0xa6da1292), SPH_C32(0xcfe32624), SPH_C32(0xbe668f5d), - SPH_C32(0x2d05156e) }, - { SPH_C32(0x78070000), SPH_C32(0x223d0001), SPH_C32(0x2f0cfb00), - SPH_C32(0xe96b0000), SPH_C32(0xd4fa2973), SPH_C32(0x8743a8c3), - SPH_C32(0x0c308489), SPH_C32(0xa56f4f5d), SPH_C32(0xbd480000), - SPH_C32(0xc51a0000), SPH_C32(0x8d68ca00), SPH_C32(0x66600000), - SPH_C32(0x578744be), SPH_C32(0xc830d45b), SPH_C32(0x7e79d306), - SPH_C32(0x13a978eb) }, - { SPH_C32(0xb4130000), SPH_C32(0x875e0001), SPH_C32(0x75b5fc80), - SPH_C32(0xd23b0000), SPH_C32(0x9f2a3a8c), SPH_C32(0x00d89cdb), - SPH_C32(0x6573cc48), SPH_C32(0x6f35c8a3), SPH_C32(0x3cd60000), - SPH_C32(0x294d0000), SPH_C32(0xeb5ac880), SPH_C32(0xf3930000), - SPH_C32(0x0a2e6cbc), SPH_C32(0x80c4e8e7), SPH_C32(0x9823712b), - SPH_C32(0x9dcecf11) }, - { SPH_C32(0xf9990000), SPH_C32(0xce6a0001), SPH_C32(0x493ef980), - SPH_C32(0x7c980000), SPH_C32(0x89530171), SPH_C32(0xcfb7947f), - SPH_C32(0xea6a26a4), SPH_C32(0x2b08f8a7), SPH_C32(0xf0c20000), - SPH_C32(0x8c2e0000), SPH_C32(0xb1e3cf00), SPH_C32(0xc8c30000), - SPH_C32(0x41fe7f43), SPH_C32(0x075fdcff), SPH_C32(0xf16039ea), - SPH_C32(0x579448ef) }, - { SPH_C32(0x358d0000), SPH_C32(0x6b090001), SPH_C32(0x1387fe00), - SPH_C32(0x47c80000), SPH_C32(0xc283128e), SPH_C32(0x482ca067), - SPH_C32(0x83296e65), SPH_C32(0xe1527f59), SPH_C32(0x715c0000), - SPH_C32(0x60790000), SPH_C32(0xd7d1cd80), SPH_C32(0x5d300000), - SPH_C32(0x1c575741), SPH_C32(0x4fabe043), SPH_C32(0x173a9bc7), - SPH_C32(0xd9f3ff15) }, - { SPH_C32(0xb08d0000), SPH_C32(0x42800001), SPH_C32(0x1429e180), - SPH_C32(0x5b310000), SPH_C32(0xa98b722d), SPH_C32(0x92f0de78), - SPH_C32(0x6631ef9d), SPH_C32(0x3bb81f15), SPH_C32(0x69230000), - SPH_C32(0xcc400000), SPH_C32(0x61a9d200), SPH_C32(0xf5860000), - SPH_C32(0x7c3c5dad), SPH_C32(0xa96b0dc9), SPH_C32(0x7087b49a), - SPH_C32(0xe1228bb6) }, - { SPH_C32(0x7c990000), SPH_C32(0xe7e30001), SPH_C32(0x4e90e600), - SPH_C32(0x60610000), SPH_C32(0xe25b61d2), SPH_C32(0x156bea60), - SPH_C32(0x0f72a75c), SPH_C32(0xf1e298eb), SPH_C32(0xe8bd0000), - SPH_C32(0x20170000), SPH_C32(0x079bd080), SPH_C32(0x60750000), - SPH_C32(0x219575af), SPH_C32(0xe19f3175), SPH_C32(0x96dd16b7), - SPH_C32(0x6f453c4c) }, - { SPH_C32(0x31130000), SPH_C32(0xaed70001), SPH_C32(0x721be300), - SPH_C32(0xcec20000), SPH_C32(0xf4225a2f), SPH_C32(0xda04e2c4), - SPH_C32(0x806b4db0), SPH_C32(0xb5dfa8ef), SPH_C32(0x24a90000), - SPH_C32(0x85740000), SPH_C32(0x5d22d700), SPH_C32(0x5b250000), - SPH_C32(0x6a456650), SPH_C32(0x6604056d), SPH_C32(0xff9e5e76), - SPH_C32(0xa51fbbb2) }, - { SPH_C32(0xfd070000), SPH_C32(0x0bb40001), SPH_C32(0x28a2e480), - SPH_C32(0xf5920000), SPH_C32(0xbff249d0), SPH_C32(0x5d9fd6dc), - SPH_C32(0xe9280571), SPH_C32(0x7f852f11), SPH_C32(0xa5370000), - SPH_C32(0x69230000), SPH_C32(0x3b10d580), SPH_C32(0xced60000), - SPH_C32(0x37ec4e52), SPH_C32(0x2ef039d1), SPH_C32(0x19c4fc5b), - SPH_C32(0x2b780c48) }, - { SPH_C32(0xc8ae0000), SPH_C32(0x507c0001), SPH_C32(0xbd13ea00), - SPH_C32(0xcb940000), SPH_C32(0xd8b55a54), SPH_C32(0xec19575c), - SPH_C32(0x96bd4fff), SPH_C32(0x58d794be), SPH_C32(0x6b8c0000), - SPH_C32(0x7b680000), SPH_C32(0xdbb5d100), SPH_C32(0xa31e0000), - SPH_C32(0xc6b1187e), SPH_C32(0x2923cbae), SPH_C32(0xd9dba000), - SPH_C32(0x15d461cd) }, - { SPH_C32(0x04ba0000), SPH_C32(0xf51f0001), SPH_C32(0xe7aaed80), - SPH_C32(0xf0c40000), SPH_C32(0x936549ab), SPH_C32(0x6b826344), - SPH_C32(0xfffe073e), SPH_C32(0x928d1340), SPH_C32(0xea120000), - SPH_C32(0x973f0000), SPH_C32(0xbd87d380), SPH_C32(0x36ed0000), - SPH_C32(0x9b18307c), SPH_C32(0x61d7f712), SPH_C32(0x3f81022d), - SPH_C32(0x9bb3d637) }, - { SPH_C32(0x49300000), SPH_C32(0xbc2b0001), SPH_C32(0xdb21e880), - SPH_C32(0x5e670000), SPH_C32(0x851c7256), SPH_C32(0xa4ed6be0), - SPH_C32(0x70e7edd2), SPH_C32(0xd6b02344), SPH_C32(0x26060000), - SPH_C32(0x325c0000), SPH_C32(0xe73ed400), SPH_C32(0x0dbd0000), - SPH_C32(0xd0c82383), SPH_C32(0xe64cc30a), SPH_C32(0x56c24aec), - SPH_C32(0x51e951c9) }, - { SPH_C32(0x85240000), SPH_C32(0x19480001), SPH_C32(0x8198ef00), - SPH_C32(0x65370000), SPH_C32(0xcecc61a9), SPH_C32(0x23765ff8), - SPH_C32(0x19a4a513), SPH_C32(0x1ceaa4ba), SPH_C32(0xa7980000), - SPH_C32(0xde0b0000), SPH_C32(0x810cd680), SPH_C32(0x984e0000), - SPH_C32(0x8d610b81), SPH_C32(0xaeb8ffb6), SPH_C32(0xb098e8c1), - SPH_C32(0xdf8ee633) }, - { SPH_C32(0xb2220000), SPH_C32(0xf5a80001), SPH_C32(0xae35e280), - SPH_C32(0x0da90000), SPH_C32(0x130637fe), SPH_C32(0x12b8181f), - SPH_C32(0xcf6dfb07), SPH_C32(0xcf4ef56e), SPH_C32(0x13af0000), - SPH_C32(0x69940000), SPH_C32(0x728fda80), SPH_C32(0x33bb0000), - SPH_C32(0xb78f3007), SPH_C32(0x57ca428a), SPH_C32(0x29570062), - SPH_C32(0x76bbea66) }, - { SPH_C32(0x7e360000), SPH_C32(0x50cb0001), SPH_C32(0xf48ce500), - SPH_C32(0x36f90000), SPH_C32(0x58d62401), SPH_C32(0x95232c07), - SPH_C32(0xa62eb3c6), SPH_C32(0x05147290), SPH_C32(0x92310000), - SPH_C32(0x85c30000), SPH_C32(0x14bdd800), SPH_C32(0xa6480000), - SPH_C32(0xea261805), SPH_C32(0x1f3e7e36), SPH_C32(0xcf0da24f), - SPH_C32(0xf8dc5d9c) }, - { SPH_C32(0x33bc0000), SPH_C32(0x19ff0001), SPH_C32(0xc807e000), - SPH_C32(0x985a0000), SPH_C32(0x4eaf1ffc), SPH_C32(0x5a4c24a3), - SPH_C32(0x2937592a), SPH_C32(0x41294294), SPH_C32(0x5e250000), - SPH_C32(0x20a00000), SPH_C32(0x4e04df80), SPH_C32(0x9d180000), - SPH_C32(0xa1f60bfa), SPH_C32(0x98a54a2e), SPH_C32(0xa64eea8e), - SPH_C32(0x3286da62) }, - { SPH_C32(0xffa80000), SPH_C32(0xbc9c0001), SPH_C32(0x92bee780), - SPH_C32(0xa30a0000), SPH_C32(0x057f0c03), SPH_C32(0xddd710bb), - SPH_C32(0x407411eb), SPH_C32(0x8b73c56a), SPH_C32(0xdfbb0000), - SPH_C32(0xccf70000), SPH_C32(0x2836dd00), SPH_C32(0x08eb0000), - SPH_C32(0xfc5f23f8), SPH_C32(0xd0517692), SPH_C32(0x401448a3), - SPH_C32(0xbce16d98) }, - { SPH_C32(0xca010000), SPH_C32(0xe7540001), SPH_C32(0x070fe900), - SPH_C32(0x9d0c0000), SPH_C32(0x62381f87), SPH_C32(0x6c51913b), - SPH_C32(0x3fe15b65), SPH_C32(0xac217ec5), SPH_C32(0x11000000), - SPH_C32(0xdebc0000), SPH_C32(0xc893d980), SPH_C32(0x65230000), - SPH_C32(0x0d0275d4), SPH_C32(0xd78284ed), SPH_C32(0x800b14f8), - SPH_C32(0x824d001d) }, - { SPH_C32(0x06150000), SPH_C32(0x42370001), SPH_C32(0x5db6ee80), - SPH_C32(0xa65c0000), SPH_C32(0x29e80c78), SPH_C32(0xebcaa523), - SPH_C32(0x56a213a4), SPH_C32(0x667bf93b), SPH_C32(0x909e0000), - SPH_C32(0x32eb0000), SPH_C32(0xaea1db00), SPH_C32(0xf0d00000), - SPH_C32(0x50ab5dd6), SPH_C32(0x9f76b851), SPH_C32(0x6651b6d5), - SPH_C32(0x0c2ab7e7) }, - { SPH_C32(0x4b9f0000), SPH_C32(0x0b030001), SPH_C32(0x613deb80), - SPH_C32(0x08ff0000), SPH_C32(0x3f913785), SPH_C32(0x24a5ad87), - SPH_C32(0xd9bbf948), SPH_C32(0x2246c93f), SPH_C32(0x5c8a0000), - SPH_C32(0x97880000), SPH_C32(0xf418dc80), SPH_C32(0xcb800000), - SPH_C32(0x1b7b4e29), SPH_C32(0x18ed8c49), SPH_C32(0x0f12fe14), - SPH_C32(0xc6703019) }, - { SPH_C32(0x878b0000), SPH_C32(0xae600001), SPH_C32(0x3b84ec00), - SPH_C32(0x33af0000), SPH_C32(0x7441247a), SPH_C32(0xa33e999f), - SPH_C32(0xb0f8b189), SPH_C32(0xe81c4ec1), SPH_C32(0xdd140000), - SPH_C32(0x7bdf0000), SPH_C32(0x922ade00), SPH_C32(0x5e730000), - SPH_C32(0x46d2662b), SPH_C32(0x5019b0f5), SPH_C32(0xe9485c39), - SPH_C32(0x481787e3) }, - { SPH_C32(0x1cc50000), SPH_C32(0x59260001), SPH_C32(0x51d2f200), - SPH_C32(0x58720000), SPH_C32(0xf30e4347), SPH_C32(0x8d428ece), - SPH_C32(0x98432863), SPH_C32(0xaa5c67e3), SPH_C32(0x776d0000), - SPH_C32(0x128f0000), SPH_C32(0x0c51d380), SPH_C32(0x82a20000), - SPH_C32(0x907b5a33), SPH_C32(0x5dcb6487), SPH_C32(0xbd24ac88), - SPH_C32(0x7988c2d8) }, - { SPH_C32(0xd0d10000), SPH_C32(0xfc450001), SPH_C32(0x0b6bf580), - SPH_C32(0x63220000), SPH_C32(0xb8de50b8), SPH_C32(0x0ad9bad6), - SPH_C32(0xf10060a2), SPH_C32(0x6006e01d), SPH_C32(0xf6f30000), - SPH_C32(0xfed80000), SPH_C32(0x6a63d100), SPH_C32(0x17510000), - SPH_C32(0xcdd27231), SPH_C32(0x153f583b), SPH_C32(0x5b7e0ea5), - SPH_C32(0xf7ef7522) }, - { SPH_C32(0x9d5b0000), SPH_C32(0xb5710001), SPH_C32(0x37e0f080), - SPH_C32(0xcd810000), SPH_C32(0xaea76b45), SPH_C32(0xc5b6b272), - SPH_C32(0x7e198a4e), SPH_C32(0x243bd019), SPH_C32(0x3ae70000), - SPH_C32(0x5bbb0000), SPH_C32(0x30dad680), SPH_C32(0x2c010000), - SPH_C32(0x860261ce), SPH_C32(0x92a46c23), SPH_C32(0x323d4664), - SPH_C32(0x3db5f2dc) }, - { SPH_C32(0x514f0000), SPH_C32(0x10120001), SPH_C32(0x6d59f700), - SPH_C32(0xf6d10000), SPH_C32(0xe57778ba), SPH_C32(0x422d866a), - SPH_C32(0x175ac28f), SPH_C32(0xee6157e7), SPH_C32(0xbb790000), - SPH_C32(0xb7ec0000), SPH_C32(0x56e8d400), SPH_C32(0xb9f20000), - SPH_C32(0xdbab49cc), SPH_C32(0xda50509f), SPH_C32(0xd467e449), - SPH_C32(0xb3d24526) }, - { SPH_C32(0x64e60000), SPH_C32(0x4bda0001), SPH_C32(0xf8e8f980), - SPH_C32(0xc8d70000), SPH_C32(0x82306b3e), SPH_C32(0xf3ab07ea), - SPH_C32(0x68cf8801), SPH_C32(0xc933ec48), SPH_C32(0x75c20000), - SPH_C32(0xa5a70000), SPH_C32(0xb64dd080), SPH_C32(0xd43a0000), - SPH_C32(0x2af61fe0), SPH_C32(0xdd83a2e0), SPH_C32(0x1478b812), - SPH_C32(0x8d7e28a3) }, - { SPH_C32(0xa8f20000), SPH_C32(0xeeb90001), SPH_C32(0xa251fe00), - SPH_C32(0xf3870000), SPH_C32(0xc9e078c1), SPH_C32(0x743033f2), - SPH_C32(0x018cc0c0), SPH_C32(0x03696bb6), SPH_C32(0xf45c0000), - SPH_C32(0x49f00000), SPH_C32(0xd07fd200), SPH_C32(0x41c90000), - SPH_C32(0x775f37e2), SPH_C32(0x95779e5c), SPH_C32(0xf2221a3f), - SPH_C32(0x03199f59) }, - { SPH_C32(0xe5780000), SPH_C32(0xa78d0001), SPH_C32(0x9edafb00), - SPH_C32(0x5d240000), SPH_C32(0xdf99433c), SPH_C32(0xbb5f3b56), - SPH_C32(0x8e952a2c), SPH_C32(0x47545bb2), SPH_C32(0x38480000), - SPH_C32(0xec930000), SPH_C32(0x8ac6d580), SPH_C32(0x7a990000), - SPH_C32(0x3c8f241d), SPH_C32(0x12ecaa44), SPH_C32(0x9b6152fe), - SPH_C32(0xc94318a7) }, - { SPH_C32(0x296c0000), SPH_C32(0x02ee0001), SPH_C32(0xc463fc80), - SPH_C32(0x66740000), SPH_C32(0x944950c3), SPH_C32(0x3cc40f4e), - SPH_C32(0xe7d662ed), SPH_C32(0x8d0edc4c), SPH_C32(0xb9d60000), - SPH_C32(0x00c40000), SPH_C32(0xecf4d700), SPH_C32(0xef6a0000), - SPH_C32(0x61260c1f), SPH_C32(0x5a1896f8), SPH_C32(0x7d3bf0d3), - SPH_C32(0x4724af5d) }, - { SPH_C32(0x1e6a0000), SPH_C32(0xee0e0001), SPH_C32(0xebcef100), - SPH_C32(0x0eea0000), SPH_C32(0x49830694), SPH_C32(0x0d0a48a9), - SPH_C32(0x311f3cf9), SPH_C32(0x5eaa8d98), SPH_C32(0x0de10000), - SPH_C32(0xb75b0000), SPH_C32(0x1f77db00), SPH_C32(0x449f0000), - SPH_C32(0x5bc83799), SPH_C32(0xa36a2bc4), SPH_C32(0xe4f41870), - SPH_C32(0xee11a308) }, - { SPH_C32(0xd27e0000), SPH_C32(0x4b6d0001), SPH_C32(0xb177f680), - SPH_C32(0x35ba0000), SPH_C32(0x0253156b), SPH_C32(0x8a917cb1), - SPH_C32(0x585c7438), SPH_C32(0x94f00a66), SPH_C32(0x8c7f0000), - SPH_C32(0x5b0c0000), SPH_C32(0x7945d980), SPH_C32(0xd16c0000), - SPH_C32(0x06611f9b), SPH_C32(0xeb9e1778), SPH_C32(0x02aeba5d), - SPH_C32(0x607614f2) }, - { SPH_C32(0x9ff40000), SPH_C32(0x02590001), SPH_C32(0x8dfcf380), - SPH_C32(0x9b190000), SPH_C32(0x142a2e96), SPH_C32(0x45fe7415), - SPH_C32(0xd7459ed4), SPH_C32(0xd0cd3a62), SPH_C32(0x406b0000), - SPH_C32(0xfe6f0000), SPH_C32(0x23fcde00), SPH_C32(0xea3c0000), - SPH_C32(0x4db10c64), SPH_C32(0x6c052360), SPH_C32(0x6bedf29c), - SPH_C32(0xaa2c930c) }, - { SPH_C32(0x53e00000), SPH_C32(0xa73a0001), SPH_C32(0xd745f400), - SPH_C32(0xa0490000), SPH_C32(0x5ffa3d69), SPH_C32(0xc265400d), - SPH_C32(0xbe06d615), SPH_C32(0x1a97bd9c), SPH_C32(0xc1f50000), - SPH_C32(0x12380000), SPH_C32(0x45cedc80), SPH_C32(0x7fcf0000), - SPH_C32(0x10182466), SPH_C32(0x24f11fdc), SPH_C32(0x8db750b1), - SPH_C32(0x244b24f6) }, - { SPH_C32(0x66490000), SPH_C32(0xfcf20001), SPH_C32(0x42f4fa80), - SPH_C32(0x9e4f0000), SPH_C32(0x38bd2eed), SPH_C32(0x73e3c18d), - SPH_C32(0xc1939c9b), SPH_C32(0x3dc50633), SPH_C32(0x0f4e0000), - SPH_C32(0x00730000), SPH_C32(0xa56bd800), SPH_C32(0x12070000), - SPH_C32(0xe145724a), SPH_C32(0x2322eda3), SPH_C32(0x4da80cea), - SPH_C32(0x1ae74973) }, - { SPH_C32(0xaa5d0000), SPH_C32(0x59910001), SPH_C32(0x184dfd00), - SPH_C32(0xa51f0000), SPH_C32(0x736d3d12), SPH_C32(0xf478f595), - SPH_C32(0xa8d0d45a), SPH_C32(0xf79f81cd), SPH_C32(0x8ed00000), - SPH_C32(0xec240000), SPH_C32(0xc359da80), SPH_C32(0x87f40000), - SPH_C32(0xbcec5a48), SPH_C32(0x6bd6d11f), SPH_C32(0xabf2aec7), - SPH_C32(0x9480fe89) }, - { SPH_C32(0xe7d70000), SPH_C32(0x10a50001), SPH_C32(0x24c6f800), - SPH_C32(0x0bbc0000), SPH_C32(0x651406ef), SPH_C32(0x3b17fd31), - SPH_C32(0x27c93eb6), SPH_C32(0xb3a2b1c9), SPH_C32(0x42c40000), - SPH_C32(0x49470000), SPH_C32(0x99e0dd00), SPH_C32(0xbca40000), - SPH_C32(0xf73c49b7), SPH_C32(0xec4de507), SPH_C32(0xc2b1e606), - SPH_C32(0x5eda7977) }, - { SPH_C32(0x2bc30000), SPH_C32(0xb5c60001), SPH_C32(0x7e7fff80), - SPH_C32(0x30ec0000), SPH_C32(0x2ec41510), SPH_C32(0xbc8cc929), - SPH_C32(0x4e8a7677), SPH_C32(0x79f83637), SPH_C32(0xc35a0000), - SPH_C32(0xa5100000), SPH_C32(0xffd2df80), SPH_C32(0x29570000), - SPH_C32(0xaa9561b5), SPH_C32(0xa4b9d9bb), SPH_C32(0x24eb442b), - SPH_C32(0xd0bdce8d) }, - { SPH_C32(0xdb250000), SPH_C32(0x09290000), SPH_C32(0x49aac000), - SPH_C32(0x81e10000), SPH_C32(0xcafe6b59), SPH_C32(0x42793431), - SPH_C32(0x43566b76), SPH_C32(0xe86cba2e), SPH_C32(0x75e60000), - SPH_C32(0x95660001), SPH_C32(0x307b2000), SPH_C32(0xadf40000), - SPH_C32(0x8f321eea), SPH_C32(0x24298307), SPH_C32(0xe8c49cf9), - SPH_C32(0x4b7eec55) }, - { SPH_C32(0x17310000), SPH_C32(0xac4a0000), SPH_C32(0x1313c780), - SPH_C32(0xbab10000), SPH_C32(0x812e78a6), SPH_C32(0xc5e20029), - SPH_C32(0x2a1523b7), SPH_C32(0x22363dd0), SPH_C32(0xf4780000), - SPH_C32(0x79310001), SPH_C32(0x56492280), SPH_C32(0x38070000), - SPH_C32(0xd29b36e8), SPH_C32(0x6cddbfbb), SPH_C32(0x0e9e3ed4), - SPH_C32(0xc5195baf) }, - { SPH_C32(0x5abb0000), SPH_C32(0xe57e0000), SPH_C32(0x2f98c280), - SPH_C32(0x14120000), SPH_C32(0x9757435b), SPH_C32(0x0a8d088d), - SPH_C32(0xa50cc95b), SPH_C32(0x660b0dd4), SPH_C32(0x386c0000), - SPH_C32(0xdc520001), SPH_C32(0x0cf02500), SPH_C32(0x03570000), - SPH_C32(0x994b2517), SPH_C32(0xeb468ba3), SPH_C32(0x67dd7615), - SPH_C32(0x0f43dc51) }, - { SPH_C32(0x96af0000), SPH_C32(0x401d0000), SPH_C32(0x7521c500), - SPH_C32(0x2f420000), SPH_C32(0xdc8750a4), SPH_C32(0x8d163c95), - SPH_C32(0xcc4f819a), SPH_C32(0xac518a2a), SPH_C32(0xb9f20000), - SPH_C32(0x30050001), SPH_C32(0x6ac22780), SPH_C32(0x96a40000), - SPH_C32(0xc4e20d15), SPH_C32(0xa3b2b71f), SPH_C32(0x8187d438), - SPH_C32(0x81246bab) }, - { SPH_C32(0xa3060000), SPH_C32(0x1bd50000), SPH_C32(0xe090cb80), - SPH_C32(0x11440000), SPH_C32(0xbbc04320), SPH_C32(0x3c90bd15), - SPH_C32(0xb3dacb14), SPH_C32(0x8b033185), SPH_C32(0x77490000), - SPH_C32(0x224e0001), SPH_C32(0x8a672300), SPH_C32(0xfb6c0000), - SPH_C32(0x35bf5b39), SPH_C32(0xa4614560), SPH_C32(0x41988863), - SPH_C32(0xbf88062e) }, - { SPH_C32(0x6f120000), SPH_C32(0xbeb60000), SPH_C32(0xba29cc00), - SPH_C32(0x2a140000), SPH_C32(0xf01050df), SPH_C32(0xbb0b890d), - SPH_C32(0xda9983d5), SPH_C32(0x4159b67b), SPH_C32(0xf6d70000), - SPH_C32(0xce190001), SPH_C32(0xec552180), SPH_C32(0x6e9f0000), - SPH_C32(0x6816733b), SPH_C32(0xec9579dc), SPH_C32(0xa7c22a4e), - SPH_C32(0x31efb1d4) }, - { SPH_C32(0x22980000), SPH_C32(0xf7820000), SPH_C32(0x86a2c900), - SPH_C32(0x84b70000), SPH_C32(0xe6696b22), SPH_C32(0x746481a9), - SPH_C32(0x55806939), SPH_C32(0x0564867f), SPH_C32(0x3ac30000), - SPH_C32(0x6b7a0001), SPH_C32(0xb6ec2600), SPH_C32(0x55cf0000), - SPH_C32(0x23c660c4), SPH_C32(0x6b0e4dc4), SPH_C32(0xce81628f), - SPH_C32(0xfbb5362a) }, - { SPH_C32(0xee8c0000), SPH_C32(0x52e10000), SPH_C32(0xdc1bce80), - SPH_C32(0xbfe70000), SPH_C32(0xadb978dd), SPH_C32(0xf3ffb5b1), - SPH_C32(0x3cc321f8), SPH_C32(0xcf3e0181), SPH_C32(0xbb5d0000), - SPH_C32(0x872d0001), SPH_C32(0xd0de2480), SPH_C32(0xc03c0000), - SPH_C32(0x7e6f48c6), SPH_C32(0x23fa7178), SPH_C32(0x28dbc0a2), - SPH_C32(0x75d281d0) }, - { SPH_C32(0xd98a0000), SPH_C32(0xbe010000), SPH_C32(0xf3b6c300), - SPH_C32(0xd7790000), SPH_C32(0x70732e8a), SPH_C32(0xc231f256), - SPH_C32(0xea0a7fec), SPH_C32(0x1c9a5055), SPH_C32(0x0f6a0000), - SPH_C32(0x30b20001), SPH_C32(0x235d2880), SPH_C32(0x6bc90000), - SPH_C32(0x44817340), SPH_C32(0xda88cc44), SPH_C32(0xb1142801), - SPH_C32(0xdce78d85) }, - { SPH_C32(0x159e0000), SPH_C32(0x1b620000), SPH_C32(0xa90fc480), - SPH_C32(0xec290000), SPH_C32(0x3ba33d75), SPH_C32(0x45aac64e), - SPH_C32(0x8349372d), SPH_C32(0xd6c0d7ab), SPH_C32(0x8ef40000), - SPH_C32(0xdce50001), SPH_C32(0x456f2a00), SPH_C32(0xfe3a0000), - SPH_C32(0x19285b42), SPH_C32(0x927cf0f8), SPH_C32(0x574e8a2c), - SPH_C32(0x52803a7f) }, - { SPH_C32(0x58140000), SPH_C32(0x52560000), SPH_C32(0x9584c180), - SPH_C32(0x428a0000), SPH_C32(0x2dda0688), SPH_C32(0x8ac5ceea), - SPH_C32(0x0c50ddc1), SPH_C32(0x92fde7af), SPH_C32(0x42e00000), - SPH_C32(0x79860001), SPH_C32(0x1fd62d80), SPH_C32(0xc56a0000), - SPH_C32(0x52f848bd), SPH_C32(0x15e7c4e0), SPH_C32(0x3e0dc2ed), - SPH_C32(0x98dabd81) }, - { SPH_C32(0x94000000), SPH_C32(0xf7350000), SPH_C32(0xcf3dc600), - SPH_C32(0x79da0000), SPH_C32(0x660a1577), SPH_C32(0x0d5efaf2), - SPH_C32(0x65139500), SPH_C32(0x58a76051), SPH_C32(0xc37e0000), - SPH_C32(0x95d10001), SPH_C32(0x79e42f00), SPH_C32(0x50990000), - SPH_C32(0x0f5160bf), SPH_C32(0x5d13f85c), SPH_C32(0xd85760c0), - SPH_C32(0x16bd0a7b) }, - { SPH_C32(0xa1a90000), SPH_C32(0xacfd0000), SPH_C32(0x5a8cc880), - SPH_C32(0x47dc0000), SPH_C32(0x014d06f3), SPH_C32(0xbcd87b72), - SPH_C32(0x1a86df8e), SPH_C32(0x7ff5dbfe), SPH_C32(0x0dc50000), - SPH_C32(0x879a0001), SPH_C32(0x99412b80), SPH_C32(0x3d510000), - SPH_C32(0xfe0c3693), SPH_C32(0x5ac00a23), SPH_C32(0x18483c9b), - SPH_C32(0x281167fe) }, - { SPH_C32(0x6dbd0000), SPH_C32(0x099e0000), SPH_C32(0x0035cf00), - SPH_C32(0x7c8c0000), SPH_C32(0x4a9d150c), SPH_C32(0x3b434f6a), - SPH_C32(0x73c5974f), SPH_C32(0xb5af5c00), SPH_C32(0x8c5b0000), - SPH_C32(0x6bcd0001), SPH_C32(0xff732900), SPH_C32(0xa8a20000), - SPH_C32(0xa3a51e91), SPH_C32(0x1234369f), SPH_C32(0xfe129eb6), - SPH_C32(0xa676d004) }, - { SPH_C32(0x20370000), SPH_C32(0x40aa0000), SPH_C32(0x3cbeca00), - SPH_C32(0xd22f0000), SPH_C32(0x5ce42ef1), SPH_C32(0xf42c47ce), - SPH_C32(0xfcdc7da3), SPH_C32(0xf1926c04), SPH_C32(0x404f0000), - SPH_C32(0xceae0001), SPH_C32(0xa5ca2e80), SPH_C32(0x93f20000), - SPH_C32(0xe8750d6e), SPH_C32(0x95af0287), SPH_C32(0x9751d677), - SPH_C32(0x6c2c57fa) }, - { SPH_C32(0xec230000), SPH_C32(0xe5c90000), SPH_C32(0x6607cd80), - SPH_C32(0xe97f0000), SPH_C32(0x17343d0e), SPH_C32(0x73b773d6), - SPH_C32(0x959f3562), SPH_C32(0x3bc8ebfa), SPH_C32(0xc1d10000), - SPH_C32(0x22f90001), SPH_C32(0xc3f82c00), SPH_C32(0x06010000), - SPH_C32(0xb5dc256c), SPH_C32(0xdd5b3e3b), SPH_C32(0x710b745a), - SPH_C32(0xe24be000) }, - { SPH_C32(0x776d0000), SPH_C32(0x128f0000), SPH_C32(0x0c51d380), - SPH_C32(0x82a20000), SPH_C32(0x907b5a33), SPH_C32(0x5dcb6487), - SPH_C32(0xbd24ac88), SPH_C32(0x7988c2d8), SPH_C32(0x6ba80000), - SPH_C32(0x4ba90001), SPH_C32(0x5d832180), SPH_C32(0xdad00000), - SPH_C32(0x63751974), SPH_C32(0xd089ea49), SPH_C32(0x256784eb), - SPH_C32(0xd3d4a53b) }, - { SPH_C32(0xbb790000), SPH_C32(0xb7ec0000), SPH_C32(0x56e8d400), - SPH_C32(0xb9f20000), SPH_C32(0xdbab49cc), SPH_C32(0xda50509f), - SPH_C32(0xd467e449), SPH_C32(0xb3d24526), SPH_C32(0xea360000), - SPH_C32(0xa7fe0001), SPH_C32(0x3bb12300), SPH_C32(0x4f230000), - SPH_C32(0x3edc3176), SPH_C32(0x987dd6f5), SPH_C32(0xc33d26c6), - SPH_C32(0x5db312c1) }, - { SPH_C32(0xf6f30000), SPH_C32(0xfed80000), SPH_C32(0x6a63d100), - SPH_C32(0x17510000), SPH_C32(0xcdd27231), SPH_C32(0x153f583b), - SPH_C32(0x5b7e0ea5), SPH_C32(0xf7ef7522), SPH_C32(0x26220000), - SPH_C32(0x029d0001), SPH_C32(0x61082480), SPH_C32(0x74730000), - SPH_C32(0x750c2289), SPH_C32(0x1fe6e2ed), SPH_C32(0xaa7e6e07), - SPH_C32(0x97e9953f) }, - { SPH_C32(0x3ae70000), SPH_C32(0x5bbb0000), SPH_C32(0x30dad680), - SPH_C32(0x2c010000), SPH_C32(0x860261ce), SPH_C32(0x92a46c23), - SPH_C32(0x323d4664), SPH_C32(0x3db5f2dc), SPH_C32(0xa7bc0000), - SPH_C32(0xeeca0001), SPH_C32(0x073a2600), SPH_C32(0xe1800000), - SPH_C32(0x28a50a8b), SPH_C32(0x5712de51), SPH_C32(0x4c24cc2a), - SPH_C32(0x198e22c5) }, - { SPH_C32(0x0f4e0000), SPH_C32(0x00730000), SPH_C32(0xa56bd800), - SPH_C32(0x12070000), SPH_C32(0xe145724a), SPH_C32(0x2322eda3), - SPH_C32(0x4da80cea), SPH_C32(0x1ae74973), SPH_C32(0x69070000), - SPH_C32(0xfc810001), SPH_C32(0xe79f2280), SPH_C32(0x8c480000), - SPH_C32(0xd9f85ca7), SPH_C32(0x50c12c2e), SPH_C32(0x8c3b9071), - SPH_C32(0x27224f40) }, - { SPH_C32(0xc35a0000), SPH_C32(0xa5100000), SPH_C32(0xffd2df80), - SPH_C32(0x29570000), SPH_C32(0xaa9561b5), SPH_C32(0xa4b9d9bb), - SPH_C32(0x24eb442b), SPH_C32(0xd0bdce8d), SPH_C32(0xe8990000), - SPH_C32(0x10d60001), SPH_C32(0x81ad2000), SPH_C32(0x19bb0000), - SPH_C32(0x845174a5), SPH_C32(0x18351092), SPH_C32(0x6a61325c), - SPH_C32(0xa945f8ba) }, - { SPH_C32(0x8ed00000), SPH_C32(0xec240000), SPH_C32(0xc359da80), - SPH_C32(0x87f40000), SPH_C32(0xbcec5a48), SPH_C32(0x6bd6d11f), - SPH_C32(0xabf2aec7), SPH_C32(0x9480fe89), SPH_C32(0x248d0000), - SPH_C32(0xb5b50001), SPH_C32(0xdb142780), SPH_C32(0x22eb0000), - SPH_C32(0xcf81675a), SPH_C32(0x9fae248a), SPH_C32(0x03227a9d), - SPH_C32(0x631f7f44) }, - { SPH_C32(0x42c40000), SPH_C32(0x49470000), SPH_C32(0x99e0dd00), - SPH_C32(0xbca40000), SPH_C32(0xf73c49b7), SPH_C32(0xec4de507), - SPH_C32(0xc2b1e606), SPH_C32(0x5eda7977), SPH_C32(0xa5130000), - SPH_C32(0x59e20001), SPH_C32(0xbd262500), SPH_C32(0xb7180000), - SPH_C32(0x92284f58), SPH_C32(0xd75a1836), SPH_C32(0xe578d8b0), - SPH_C32(0xed78c8be) }, - { SPH_C32(0x75c20000), SPH_C32(0xa5a70000), SPH_C32(0xb64dd080), - SPH_C32(0xd43a0000), SPH_C32(0x2af61fe0), SPH_C32(0xdd83a2e0), - SPH_C32(0x1478b812), SPH_C32(0x8d7e28a3), SPH_C32(0x11240000), - SPH_C32(0xee7d0001), SPH_C32(0x4ea52900), SPH_C32(0x1ced0000), - SPH_C32(0xa8c674de), SPH_C32(0x2e28a50a), SPH_C32(0x7cb73013), - SPH_C32(0x444dc4eb) }, - { SPH_C32(0xb9d60000), SPH_C32(0x00c40000), SPH_C32(0xecf4d700), - SPH_C32(0xef6a0000), SPH_C32(0x61260c1f), SPH_C32(0x5a1896f8), - SPH_C32(0x7d3bf0d3), SPH_C32(0x4724af5d), SPH_C32(0x90ba0000), - SPH_C32(0x022a0001), SPH_C32(0x28972b80), SPH_C32(0x891e0000), - SPH_C32(0xf56f5cdc), SPH_C32(0x66dc99b6), SPH_C32(0x9aed923e), - SPH_C32(0xca2a7311) }, - { SPH_C32(0xf45c0000), SPH_C32(0x49f00000), SPH_C32(0xd07fd200), - SPH_C32(0x41c90000), SPH_C32(0x775f37e2), SPH_C32(0x95779e5c), - SPH_C32(0xf2221a3f), SPH_C32(0x03199f59), SPH_C32(0x5cae0000), - SPH_C32(0xa7490001), SPH_C32(0x722e2c00), SPH_C32(0xb24e0000), - SPH_C32(0xbebf4f23), SPH_C32(0xe147adae), SPH_C32(0xf3aedaff), - SPH_C32(0x0070f4ef) }, - { SPH_C32(0x38480000), SPH_C32(0xec930000), SPH_C32(0x8ac6d580), - SPH_C32(0x7a990000), SPH_C32(0x3c8f241d), SPH_C32(0x12ecaa44), - SPH_C32(0x9b6152fe), SPH_C32(0xc94318a7), SPH_C32(0xdd300000), - SPH_C32(0x4b1e0001), SPH_C32(0x141c2e80), SPH_C32(0x27bd0000), - SPH_C32(0xe3166721), SPH_C32(0xa9b39112), SPH_C32(0x15f478d2), - SPH_C32(0x8e174315) }, - { SPH_C32(0x0de10000), SPH_C32(0xb75b0000), SPH_C32(0x1f77db00), - SPH_C32(0x449f0000), SPH_C32(0x5bc83799), SPH_C32(0xa36a2bc4), - SPH_C32(0xe4f41870), SPH_C32(0xee11a308), SPH_C32(0x138b0000), - SPH_C32(0x59550001), SPH_C32(0xf4b92a00), SPH_C32(0x4a750000), - SPH_C32(0x124b310d), SPH_C32(0xae60636d), SPH_C32(0xd5eb2489), - SPH_C32(0xb0bb2e90) }, - { SPH_C32(0xc1f50000), SPH_C32(0x12380000), SPH_C32(0x45cedc80), - SPH_C32(0x7fcf0000), SPH_C32(0x10182466), SPH_C32(0x24f11fdc), - SPH_C32(0x8db750b1), SPH_C32(0x244b24f6), SPH_C32(0x92150000), - SPH_C32(0xb5020001), SPH_C32(0x928b2880), SPH_C32(0xdf860000), - SPH_C32(0x4fe2190f), SPH_C32(0xe6945fd1), SPH_C32(0x33b186a4), - SPH_C32(0x3edc996a) }, - { SPH_C32(0x8c7f0000), SPH_C32(0x5b0c0000), SPH_C32(0x7945d980), - SPH_C32(0xd16c0000), SPH_C32(0x06611f9b), SPH_C32(0xeb9e1778), - SPH_C32(0x02aeba5d), SPH_C32(0x607614f2), SPH_C32(0x5e010000), - SPH_C32(0x10610001), SPH_C32(0xc8322f00), SPH_C32(0xe4d60000), - SPH_C32(0x04320af0), SPH_C32(0x610f6bc9), SPH_C32(0x5af2ce65), - SPH_C32(0xf4861e94) }, - { SPH_C32(0x406b0000), SPH_C32(0xfe6f0000), SPH_C32(0x23fcde00), - SPH_C32(0xea3c0000), SPH_C32(0x4db10c64), SPH_C32(0x6c052360), - SPH_C32(0x6bedf29c), SPH_C32(0xaa2c930c), SPH_C32(0xdf9f0000), - SPH_C32(0xfc360001), SPH_C32(0xae002d80), SPH_C32(0x71250000), - SPH_C32(0x599b22f2), SPH_C32(0x29fb5775), SPH_C32(0xbca86c48), - SPH_C32(0x7ae1a96e) }, - { SPH_C32(0xc56b0000), SPH_C32(0xd7e60000), SPH_C32(0x2452c180), - SPH_C32(0xf6c50000), SPH_C32(0x26b96cc7), SPH_C32(0xb6d95d7f), - SPH_C32(0x8ef57364), SPH_C32(0x70c6f340), SPH_C32(0xc7e00000), - SPH_C32(0x500f0001), SPH_C32(0x18783200), SPH_C32(0xd9930000), - SPH_C32(0x39f0281e), SPH_C32(0xcf3bbaff), SPH_C32(0xdb154315), - SPH_C32(0x4230ddcd) }, - { SPH_C32(0x097f0000), SPH_C32(0x72850000), SPH_C32(0x7eebc600), - SPH_C32(0xcd950000), SPH_C32(0x6d697f38), SPH_C32(0x31426967), - SPH_C32(0xe7b63ba5), SPH_C32(0xba9c74be), SPH_C32(0x467e0000), - SPH_C32(0xbc580001), SPH_C32(0x7e4a3080), SPH_C32(0x4c600000), - SPH_C32(0x6459001c), SPH_C32(0x87cf8643), SPH_C32(0x3d4fe138), - SPH_C32(0xcc576a37) }, - { SPH_C32(0x44f50000), SPH_C32(0x3bb10000), SPH_C32(0x4260c300), - SPH_C32(0x63360000), SPH_C32(0x7b1044c5), SPH_C32(0xfe2d61c3), - SPH_C32(0x68afd149), SPH_C32(0xfea144ba), SPH_C32(0x8a6a0000), - SPH_C32(0x193b0001), SPH_C32(0x24f33700), SPH_C32(0x77300000), - SPH_C32(0x2f8913e3), SPH_C32(0x0054b25b), SPH_C32(0x540ca9f9), - SPH_C32(0x060dedc9) }, - { SPH_C32(0x88e10000), SPH_C32(0x9ed20000), SPH_C32(0x18d9c480), - SPH_C32(0x58660000), SPH_C32(0x30c0573a), SPH_C32(0x79b655db), - SPH_C32(0x01ec9988), SPH_C32(0x34fbc344), SPH_C32(0x0bf40000), - SPH_C32(0xf56c0001), SPH_C32(0x42c13580), SPH_C32(0xe2c30000), - SPH_C32(0x72203be1), SPH_C32(0x48a08ee7), SPH_C32(0xb2560bd4), - SPH_C32(0x886a5a33) }, - { SPH_C32(0xbd480000), SPH_C32(0xc51a0000), SPH_C32(0x8d68ca00), - SPH_C32(0x66600000), SPH_C32(0x578744be), SPH_C32(0xc830d45b), - SPH_C32(0x7e79d306), SPH_C32(0x13a978eb), SPH_C32(0xc54f0000), - SPH_C32(0xe7270001), SPH_C32(0xa2643100), SPH_C32(0x8f0b0000), - SPH_C32(0x837d6dcd), SPH_C32(0x4f737c98), SPH_C32(0x7249578f), - SPH_C32(0xb6c637b6) }, - { SPH_C32(0x715c0000), SPH_C32(0x60790000), SPH_C32(0xd7d1cd80), - SPH_C32(0x5d300000), SPH_C32(0x1c575741), SPH_C32(0x4fabe043), - SPH_C32(0x173a9bc7), SPH_C32(0xd9f3ff15), SPH_C32(0x44d10000), - SPH_C32(0x0b700001), SPH_C32(0xc4563380), SPH_C32(0x1af80000), - SPH_C32(0xded445cf), SPH_C32(0x07874024), SPH_C32(0x9413f5a2), - SPH_C32(0x38a1804c) }, - { SPH_C32(0x3cd60000), SPH_C32(0x294d0000), SPH_C32(0xeb5ac880), - SPH_C32(0xf3930000), SPH_C32(0x0a2e6cbc), SPH_C32(0x80c4e8e7), - SPH_C32(0x9823712b), SPH_C32(0x9dcecf11), SPH_C32(0x88c50000), - SPH_C32(0xae130001), SPH_C32(0x9eef3400), SPH_C32(0x21a80000), - SPH_C32(0x95045630), SPH_C32(0x801c743c), SPH_C32(0xfd50bd63), - SPH_C32(0xf2fb07b2) }, - { SPH_C32(0xf0c20000), SPH_C32(0x8c2e0000), SPH_C32(0xb1e3cf00), - SPH_C32(0xc8c30000), SPH_C32(0x41fe7f43), SPH_C32(0x075fdcff), - SPH_C32(0xf16039ea), SPH_C32(0x579448ef), SPH_C32(0x095b0000), - SPH_C32(0x42440001), SPH_C32(0xf8dd3680), SPH_C32(0xb45b0000), - SPH_C32(0xc8ad7e32), SPH_C32(0xc8e84880), SPH_C32(0x1b0a1f4e), - SPH_C32(0x7c9cb048) }, - { SPH_C32(0xc7c40000), SPH_C32(0x60ce0000), SPH_C32(0x9e4ec280), - SPH_C32(0xa05d0000), SPH_C32(0x9c342914), SPH_C32(0x36919b18), - SPH_C32(0x27a967fe), SPH_C32(0x8430193b), SPH_C32(0xbd6c0000), - SPH_C32(0xf5db0001), SPH_C32(0x0b5e3a80), SPH_C32(0x1fae0000), - SPH_C32(0xf24345b4), SPH_C32(0x319af5bc), SPH_C32(0x82c5f7ed), - SPH_C32(0xd5a9bc1d) }, - { SPH_C32(0x0bd00000), SPH_C32(0xc5ad0000), SPH_C32(0xc4f7c500), - SPH_C32(0x9b0d0000), SPH_C32(0xd7e43aeb), SPH_C32(0xb10aaf00), - SPH_C32(0x4eea2f3f), SPH_C32(0x4e6a9ec5), SPH_C32(0x3cf20000), - SPH_C32(0x198c0001), SPH_C32(0x6d6c3800), SPH_C32(0x8a5d0000), - SPH_C32(0xafea6db6), SPH_C32(0x796ec900), SPH_C32(0x649f55c0), - SPH_C32(0x5bce0be7) }, - { SPH_C32(0x465a0000), SPH_C32(0x8c990000), SPH_C32(0xf87cc000), - SPH_C32(0x35ae0000), SPH_C32(0xc19d0116), SPH_C32(0x7e65a7a4), - SPH_C32(0xc1f3c5d3), SPH_C32(0x0a57aec1), SPH_C32(0xf0e60000), - SPH_C32(0xbcef0001), SPH_C32(0x37d53f80), SPH_C32(0xb10d0000), - SPH_C32(0xe43a7e49), SPH_C32(0xfef5fd18), SPH_C32(0x0ddc1d01), - SPH_C32(0x91948c19) }, - { SPH_C32(0x8a4e0000), SPH_C32(0x29fa0000), SPH_C32(0xa2c5c780), - SPH_C32(0x0efe0000), SPH_C32(0x8a4d12e9), SPH_C32(0xf9fe93bc), - SPH_C32(0xa8b08d12), SPH_C32(0xc00d293f), SPH_C32(0x71780000), - SPH_C32(0x50b80001), SPH_C32(0x51e73d00), SPH_C32(0x24fe0000), - SPH_C32(0xb993564b), SPH_C32(0xb601c1a4), SPH_C32(0xeb86bf2c), - SPH_C32(0x1ff33be3) }, - { SPH_C32(0xbfe70000), SPH_C32(0x72320000), SPH_C32(0x3774c900), - SPH_C32(0x30f80000), SPH_C32(0xed0a016d), SPH_C32(0x4878123c), - SPH_C32(0xd725c79c), SPH_C32(0xe75f9290), SPH_C32(0xbfc30000), - SPH_C32(0x42f30001), SPH_C32(0xb1423980), SPH_C32(0x49360000), - SPH_C32(0x48ce0067), SPH_C32(0xb1d233db), SPH_C32(0x2b99e377), - SPH_C32(0x215f5666) }, - { SPH_C32(0x73f30000), SPH_C32(0xd7510000), SPH_C32(0x6dcdce80), - SPH_C32(0x0ba80000), SPH_C32(0xa6da1292), SPH_C32(0xcfe32624), - SPH_C32(0xbe668f5d), SPH_C32(0x2d05156e), SPH_C32(0x3e5d0000), - SPH_C32(0xaea40001), SPH_C32(0xd7703b00), SPH_C32(0xdcc50000), - SPH_C32(0x15672865), SPH_C32(0xf9260f67), SPH_C32(0xcdc3415a), - SPH_C32(0xaf38e19c) }, - { SPH_C32(0x3e790000), SPH_C32(0x9e650000), SPH_C32(0x5146cb80), - SPH_C32(0xa50b0000), SPH_C32(0xb0a3296f), SPH_C32(0x008c2e80), - SPH_C32(0x317f65b1), SPH_C32(0x6938256a), SPH_C32(0xf2490000), - SPH_C32(0x0bc70001), SPH_C32(0x8dc93c80), SPH_C32(0xe7950000), - SPH_C32(0x5eb73b9a), SPH_C32(0x7ebd3b7f), SPH_C32(0xa480099b), - SPH_C32(0x65626662) }, - { SPH_C32(0xf26d0000), SPH_C32(0x3b060000), SPH_C32(0x0bffcc00), - SPH_C32(0x9e5b0000), SPH_C32(0xfb733a90), SPH_C32(0x87171a98), - SPH_C32(0x583c2d70), SPH_C32(0xa362a294), SPH_C32(0x73d70000), - SPH_C32(0xe7900001), SPH_C32(0xebfb3e00), SPH_C32(0x72660000), - SPH_C32(0x031e1398), SPH_C32(0x364907c3), SPH_C32(0x42daabb6), - SPH_C32(0xeb05d198) }, - { SPH_C32(0x69230000), SPH_C32(0xcc400000), SPH_C32(0x61a9d200), - SPH_C32(0xf5860000), SPH_C32(0x7c3c5dad), SPH_C32(0xa96b0dc9), - SPH_C32(0x7087b49a), SPH_C32(0xe1228bb6), SPH_C32(0xd9ae0000), - SPH_C32(0x8ec00001), SPH_C32(0x75803380), SPH_C32(0xaeb70000), - SPH_C32(0xd5b72f80), SPH_C32(0x3b9bd3b1), SPH_C32(0x16b65b07), - SPH_C32(0xda9a94a3) }, - { SPH_C32(0xa5370000), SPH_C32(0x69230000), SPH_C32(0x3b10d580), - SPH_C32(0xced60000), SPH_C32(0x37ec4e52), SPH_C32(0x2ef039d1), - SPH_C32(0x19c4fc5b), SPH_C32(0x2b780c48), SPH_C32(0x58300000), - SPH_C32(0x62970001), SPH_C32(0x13b23100), SPH_C32(0x3b440000), - SPH_C32(0x881e0782), SPH_C32(0x736fef0d), SPH_C32(0xf0ecf92a), - SPH_C32(0x54fd2359) }, - { SPH_C32(0xe8bd0000), SPH_C32(0x20170000), SPH_C32(0x079bd080), - SPH_C32(0x60750000), SPH_C32(0x219575af), SPH_C32(0xe19f3175), - SPH_C32(0x96dd16b7), SPH_C32(0x6f453c4c), SPH_C32(0x94240000), - SPH_C32(0xc7f40001), SPH_C32(0x490b3680), SPH_C32(0x00140000), - SPH_C32(0xc3ce147d), SPH_C32(0xf4f4db15), SPH_C32(0x99afb1eb), - SPH_C32(0x9ea7a4a7) }, - { SPH_C32(0x24a90000), SPH_C32(0x85740000), SPH_C32(0x5d22d700), - SPH_C32(0x5b250000), SPH_C32(0x6a456650), SPH_C32(0x6604056d), - SPH_C32(0xff9e5e76), SPH_C32(0xa51fbbb2), SPH_C32(0x15ba0000), - SPH_C32(0x2ba30001), SPH_C32(0x2f393400), SPH_C32(0x95e70000), - SPH_C32(0x9e673c7f), SPH_C32(0xbc00e7a9), SPH_C32(0x7ff513c6), - SPH_C32(0x10c0135d) }, - { SPH_C32(0x11000000), SPH_C32(0xdebc0000), SPH_C32(0xc893d980), - SPH_C32(0x65230000), SPH_C32(0x0d0275d4), SPH_C32(0xd78284ed), - SPH_C32(0x800b14f8), SPH_C32(0x824d001d), SPH_C32(0xdb010000), - SPH_C32(0x39e80001), SPH_C32(0xcf9c3080), SPH_C32(0xf82f0000), - SPH_C32(0x6f3a6a53), SPH_C32(0xbbd315d6), SPH_C32(0xbfea4f9d), - SPH_C32(0x2e6c7ed8) }, - { SPH_C32(0xdd140000), SPH_C32(0x7bdf0000), SPH_C32(0x922ade00), - SPH_C32(0x5e730000), SPH_C32(0x46d2662b), SPH_C32(0x5019b0f5), - SPH_C32(0xe9485c39), SPH_C32(0x481787e3), SPH_C32(0x5a9f0000), - SPH_C32(0xd5bf0001), SPH_C32(0xa9ae3200), SPH_C32(0x6ddc0000), - SPH_C32(0x32934251), SPH_C32(0xf327296a), SPH_C32(0x59b0edb0), - SPH_C32(0xa00bc922) }, - { SPH_C32(0x909e0000), SPH_C32(0x32eb0000), SPH_C32(0xaea1db00), - SPH_C32(0xf0d00000), SPH_C32(0x50ab5dd6), SPH_C32(0x9f76b851), - SPH_C32(0x6651b6d5), SPH_C32(0x0c2ab7e7), SPH_C32(0x968b0000), - SPH_C32(0x70dc0001), SPH_C32(0xf3173580), SPH_C32(0x568c0000), - SPH_C32(0x794351ae), SPH_C32(0x74bc1d72), SPH_C32(0x30f3a571), - SPH_C32(0x6a514edc) }, - { SPH_C32(0x5c8a0000), SPH_C32(0x97880000), SPH_C32(0xf418dc80), - SPH_C32(0xcb800000), SPH_C32(0x1b7b4e29), SPH_C32(0x18ed8c49), - SPH_C32(0x0f12fe14), SPH_C32(0xc6703019), SPH_C32(0x17150000), - SPH_C32(0x9c8b0001), SPH_C32(0x95253700), SPH_C32(0xc37f0000), - SPH_C32(0x24ea79ac), SPH_C32(0x3c4821ce), SPH_C32(0xd6a9075c), - SPH_C32(0xe436f926) }, - { SPH_C32(0x6b8c0000), SPH_C32(0x7b680000), SPH_C32(0xdbb5d100), - SPH_C32(0xa31e0000), SPH_C32(0xc6b1187e), SPH_C32(0x2923cbae), - SPH_C32(0xd9dba000), SPH_C32(0x15d461cd), SPH_C32(0xa3220000), - SPH_C32(0x2b140001), SPH_C32(0x66a63b00), SPH_C32(0x688a0000), - SPH_C32(0x1e04422a), SPH_C32(0xc53a9cf2), SPH_C32(0x4f66efff), - SPH_C32(0x4d03f573) }, - { SPH_C32(0xa7980000), SPH_C32(0xde0b0000), SPH_C32(0x810cd680), - SPH_C32(0x984e0000), SPH_C32(0x8d610b81), SPH_C32(0xaeb8ffb6), - SPH_C32(0xb098e8c1), SPH_C32(0xdf8ee633), SPH_C32(0x22bc0000), - SPH_C32(0xc7430001), SPH_C32(0x00943980), SPH_C32(0xfd790000), - SPH_C32(0x43ad6a28), SPH_C32(0x8dcea04e), SPH_C32(0xa93c4dd2), - SPH_C32(0xc3644289) }, - { SPH_C32(0xea120000), SPH_C32(0x973f0000), SPH_C32(0xbd87d380), - SPH_C32(0x36ed0000), SPH_C32(0x9b18307c), SPH_C32(0x61d7f712), - SPH_C32(0x3f81022d), SPH_C32(0x9bb3d637), SPH_C32(0xeea80000), - SPH_C32(0x62200001), SPH_C32(0x5a2d3e00), SPH_C32(0xc6290000), - SPH_C32(0x087d79d7), SPH_C32(0x0a559456), SPH_C32(0xc07f0513), - SPH_C32(0x093ec577) }, - { SPH_C32(0x26060000), SPH_C32(0x325c0000), SPH_C32(0xe73ed400), - SPH_C32(0x0dbd0000), SPH_C32(0xd0c82383), SPH_C32(0xe64cc30a), - SPH_C32(0x56c24aec), SPH_C32(0x51e951c9), SPH_C32(0x6f360000), - SPH_C32(0x8e770001), SPH_C32(0x3c1f3c80), SPH_C32(0x53da0000), - SPH_C32(0x55d451d5), SPH_C32(0x42a1a8ea), SPH_C32(0x2625a73e), - SPH_C32(0x8759728d) }, - { SPH_C32(0x13af0000), SPH_C32(0x69940000), SPH_C32(0x728fda80), - SPH_C32(0x33bb0000), SPH_C32(0xb78f3007), SPH_C32(0x57ca428a), - SPH_C32(0x29570062), SPH_C32(0x76bbea66), SPH_C32(0xa18d0000), - SPH_C32(0x9c3c0001), SPH_C32(0xdcba3800), SPH_C32(0x3e120000), - SPH_C32(0xa48907f9), SPH_C32(0x45725a95), SPH_C32(0xe63afb65), - SPH_C32(0xb9f51f08) }, - { SPH_C32(0xdfbb0000), SPH_C32(0xccf70000), SPH_C32(0x2836dd00), - SPH_C32(0x08eb0000), SPH_C32(0xfc5f23f8), SPH_C32(0xd0517692), - SPH_C32(0x401448a3), SPH_C32(0xbce16d98), SPH_C32(0x20130000), - SPH_C32(0x706b0001), SPH_C32(0xba883a80), SPH_C32(0xabe10000), - SPH_C32(0xf9202ffb), SPH_C32(0x0d866629), SPH_C32(0x00605948), - SPH_C32(0x3792a8f2) }, - { SPH_C32(0x92310000), SPH_C32(0x85c30000), SPH_C32(0x14bdd800), - SPH_C32(0xa6480000), SPH_C32(0xea261805), SPH_C32(0x1f3e7e36), - SPH_C32(0xcf0da24f), SPH_C32(0xf8dc5d9c), SPH_C32(0xec070000), - SPH_C32(0xd5080001), SPH_C32(0xe0313d00), SPH_C32(0x90b10000), - SPH_C32(0xb2f03c04), SPH_C32(0x8a1d5231), SPH_C32(0x69231189), - SPH_C32(0xfdc82f0c) }, - { SPH_C32(0x5e250000), SPH_C32(0x20a00000), SPH_C32(0x4e04df80), - SPH_C32(0x9d180000), SPH_C32(0xa1f60bfa), SPH_C32(0x98a54a2e), - SPH_C32(0xa64eea8e), SPH_C32(0x3286da62), SPH_C32(0x6d990000), - SPH_C32(0x395f0001), SPH_C32(0x86033f80), SPH_C32(0x05420000), - SPH_C32(0xef591406), SPH_C32(0xc2e96e8d), SPH_C32(0x8f79b3a4), - SPH_C32(0x73af98f6) }, - { SPH_C32(0x75e60000), SPH_C32(0x95660001), SPH_C32(0x307b2000), - SPH_C32(0xadf40000), SPH_C32(0x8f321eea), SPH_C32(0x24298307), - SPH_C32(0xe8c49cf9), SPH_C32(0x4b7eec55), SPH_C32(0xaec30000), - SPH_C32(0x9c4f0001), SPH_C32(0x79d1e000), SPH_C32(0x2c150000), - SPH_C32(0x45cc75b3), SPH_C32(0x6650b736), SPH_C32(0xab92f78f), - SPH_C32(0xa312567b) }, - { SPH_C32(0xb9f20000), SPH_C32(0x30050001), SPH_C32(0x6ac22780), - SPH_C32(0x96a40000), SPH_C32(0xc4e20d15), SPH_C32(0xa3b2b71f), - SPH_C32(0x8187d438), SPH_C32(0x81246bab), SPH_C32(0x2f5d0000), - SPH_C32(0x70180001), SPH_C32(0x1fe3e280), SPH_C32(0xb9e60000), - SPH_C32(0x18655db1), SPH_C32(0x2ea48b8a), SPH_C32(0x4dc855a2), - SPH_C32(0x2d75e181) }, - { SPH_C32(0xf4780000), SPH_C32(0x79310001), SPH_C32(0x56492280), - SPH_C32(0x38070000), SPH_C32(0xd29b36e8), SPH_C32(0x6cddbfbb), - SPH_C32(0x0e9e3ed4), SPH_C32(0xc5195baf), SPH_C32(0xe3490000), - SPH_C32(0xd57b0001), SPH_C32(0x455ae500), SPH_C32(0x82b60000), - SPH_C32(0x53b54e4e), SPH_C32(0xa93fbf92), SPH_C32(0x248b1d63), - SPH_C32(0xe72f667f) }, - { SPH_C32(0x386c0000), SPH_C32(0xdc520001), SPH_C32(0x0cf02500), - SPH_C32(0x03570000), SPH_C32(0x994b2517), SPH_C32(0xeb468ba3), - SPH_C32(0x67dd7615), SPH_C32(0x0f43dc51), SPH_C32(0x62d70000), - SPH_C32(0x392c0001), SPH_C32(0x2368e780), SPH_C32(0x17450000), - SPH_C32(0x0e1c664c), SPH_C32(0xe1cb832e), SPH_C32(0xc2d1bf4e), - SPH_C32(0x6948d185) }, - { SPH_C32(0x0dc50000), SPH_C32(0x879a0001), SPH_C32(0x99412b80), - SPH_C32(0x3d510000), SPH_C32(0xfe0c3693), SPH_C32(0x5ac00a23), - SPH_C32(0x18483c9b), SPH_C32(0x281167fe), SPH_C32(0xac6c0000), - SPH_C32(0x2b670001), SPH_C32(0xc3cde300), SPH_C32(0x7a8d0000), - SPH_C32(0xff413060), SPH_C32(0xe6187151), SPH_C32(0x02cee315), - SPH_C32(0x57e4bc00) }, - { SPH_C32(0xc1d10000), SPH_C32(0x22f90001), SPH_C32(0xc3f82c00), - SPH_C32(0x06010000), SPH_C32(0xb5dc256c), SPH_C32(0xdd5b3e3b), - SPH_C32(0x710b745a), SPH_C32(0xe24be000), SPH_C32(0x2df20000), - SPH_C32(0xc7300001), SPH_C32(0xa5ffe180), SPH_C32(0xef7e0000), - SPH_C32(0xa2e81862), SPH_C32(0xaeec4ded), SPH_C32(0xe4944138), - SPH_C32(0xd9830bfa) }, - { SPH_C32(0x8c5b0000), SPH_C32(0x6bcd0001), SPH_C32(0xff732900), - SPH_C32(0xa8a20000), SPH_C32(0xa3a51e91), SPH_C32(0x1234369f), - SPH_C32(0xfe129eb6), SPH_C32(0xa676d004), SPH_C32(0xe1e60000), - SPH_C32(0x62530001), SPH_C32(0xff46e600), SPH_C32(0xd42e0000), - SPH_C32(0xe9380b9d), SPH_C32(0x297779f5), SPH_C32(0x8dd709f9), - SPH_C32(0x13d98c04) }, - { SPH_C32(0x404f0000), SPH_C32(0xceae0001), SPH_C32(0xa5ca2e80), - SPH_C32(0x93f20000), SPH_C32(0xe8750d6e), SPH_C32(0x95af0287), - SPH_C32(0x9751d677), SPH_C32(0x6c2c57fa), SPH_C32(0x60780000), - SPH_C32(0x8e040001), SPH_C32(0x9974e480), SPH_C32(0x41dd0000), - SPH_C32(0xb491239f), SPH_C32(0x61834549), SPH_C32(0x6b8dabd4), - SPH_C32(0x9dbe3bfe) }, - { SPH_C32(0x77490000), SPH_C32(0x224e0001), SPH_C32(0x8a672300), - SPH_C32(0xfb6c0000), SPH_C32(0x35bf5b39), SPH_C32(0xa4614560), - SPH_C32(0x41988863), SPH_C32(0xbf88062e), SPH_C32(0xd44f0000), - SPH_C32(0x399b0001), SPH_C32(0x6af7e880), SPH_C32(0xea280000), - SPH_C32(0x8e7f1819), SPH_C32(0x98f1f875), SPH_C32(0xf2424377), - SPH_C32(0x348b37ab) }, - { SPH_C32(0xbb5d0000), SPH_C32(0x872d0001), SPH_C32(0xd0de2480), - SPH_C32(0xc03c0000), SPH_C32(0x7e6f48c6), SPH_C32(0x23fa7178), - SPH_C32(0x28dbc0a2), SPH_C32(0x75d281d0), SPH_C32(0x55d10000), - SPH_C32(0xd5cc0001), SPH_C32(0x0cc5ea00), SPH_C32(0x7fdb0000), - SPH_C32(0xd3d6301b), SPH_C32(0xd005c4c9), SPH_C32(0x1418e15a), - SPH_C32(0xbaec8051) }, - { SPH_C32(0xf6d70000), SPH_C32(0xce190001), SPH_C32(0xec552180), - SPH_C32(0x6e9f0000), SPH_C32(0x6816733b), SPH_C32(0xec9579dc), - SPH_C32(0xa7c22a4e), SPH_C32(0x31efb1d4), SPH_C32(0x99c50000), - SPH_C32(0x70af0001), SPH_C32(0x567ced80), SPH_C32(0x448b0000), - SPH_C32(0x980623e4), SPH_C32(0x579ef0d1), SPH_C32(0x7d5ba99b), - SPH_C32(0x70b607af) }, - { SPH_C32(0x3ac30000), SPH_C32(0x6b7a0001), SPH_C32(0xb6ec2600), - SPH_C32(0x55cf0000), SPH_C32(0x23c660c4), SPH_C32(0x6b0e4dc4), - SPH_C32(0xce81628f), SPH_C32(0xfbb5362a), SPH_C32(0x185b0000), - SPH_C32(0x9cf80001), SPH_C32(0x304eef00), SPH_C32(0xd1780000), - SPH_C32(0xc5af0be6), SPH_C32(0x1f6acc6d), SPH_C32(0x9b010bb6), - SPH_C32(0xfed1b055) }, - { SPH_C32(0x0f6a0000), SPH_C32(0x30b20001), SPH_C32(0x235d2880), - SPH_C32(0x6bc90000), SPH_C32(0x44817340), SPH_C32(0xda88cc44), - SPH_C32(0xb1142801), SPH_C32(0xdce78d85), SPH_C32(0xd6e00000), - SPH_C32(0x8eb30001), SPH_C32(0xd0ebeb80), SPH_C32(0xbcb00000), - SPH_C32(0x34f25dca), SPH_C32(0x18b93e12), SPH_C32(0x5b1e57ed), - SPH_C32(0xc07dddd0) }, - { SPH_C32(0xc37e0000), SPH_C32(0x95d10001), SPH_C32(0x79e42f00), - SPH_C32(0x50990000), SPH_C32(0x0f5160bf), SPH_C32(0x5d13f85c), - SPH_C32(0xd85760c0), SPH_C32(0x16bd0a7b), SPH_C32(0x577e0000), - SPH_C32(0x62e40001), SPH_C32(0xb6d9e900), SPH_C32(0x29430000), - SPH_C32(0x695b75c8), SPH_C32(0x504d02ae), SPH_C32(0xbd44f5c0), - SPH_C32(0x4e1a6a2a) }, - { SPH_C32(0x8ef40000), SPH_C32(0xdce50001), SPH_C32(0x456f2a00), - SPH_C32(0xfe3a0000), SPH_C32(0x19285b42), SPH_C32(0x927cf0f8), - SPH_C32(0x574e8a2c), SPH_C32(0x52803a7f), SPH_C32(0x9b6a0000), - SPH_C32(0xc7870001), SPH_C32(0xec60ee80), SPH_C32(0x12130000), - SPH_C32(0x228b6637), SPH_C32(0xd7d636b6), SPH_C32(0xd407bd01), - SPH_C32(0x8440edd4) }, - { SPH_C32(0x42e00000), SPH_C32(0x79860001), SPH_C32(0x1fd62d80), - SPH_C32(0xc56a0000), SPH_C32(0x52f848bd), SPH_C32(0x15e7c4e0), - SPH_C32(0x3e0dc2ed), SPH_C32(0x98dabd81), SPH_C32(0x1af40000), - SPH_C32(0x2bd00001), SPH_C32(0x8a52ec00), SPH_C32(0x87e00000), - SPH_C32(0x7f224e35), SPH_C32(0x9f220a0a), SPH_C32(0x325d1f2c), - SPH_C32(0x0a275a2e) }, - { SPH_C32(0xd9ae0000), SPH_C32(0x8ec00001), SPH_C32(0x75803380), - SPH_C32(0xaeb70000), SPH_C32(0xd5b72f80), SPH_C32(0x3b9bd3b1), - SPH_C32(0x16b65b07), SPH_C32(0xda9a94a3), SPH_C32(0xb08d0000), - SPH_C32(0x42800001), SPH_C32(0x1429e180), SPH_C32(0x5b310000), - SPH_C32(0xa98b722d), SPH_C32(0x92f0de78), SPH_C32(0x6631ef9d), - SPH_C32(0x3bb81f15) }, - { SPH_C32(0x15ba0000), SPH_C32(0x2ba30001), SPH_C32(0x2f393400), - SPH_C32(0x95e70000), SPH_C32(0x9e673c7f), SPH_C32(0xbc00e7a9), - SPH_C32(0x7ff513c6), SPH_C32(0x10c0135d), SPH_C32(0x31130000), - SPH_C32(0xaed70001), SPH_C32(0x721be300), SPH_C32(0xcec20000), - SPH_C32(0xf4225a2f), SPH_C32(0xda04e2c4), SPH_C32(0x806b4db0), - SPH_C32(0xb5dfa8ef) }, - { SPH_C32(0x58300000), SPH_C32(0x62970001), SPH_C32(0x13b23100), - SPH_C32(0x3b440000), SPH_C32(0x881e0782), SPH_C32(0x736fef0d), - SPH_C32(0xf0ecf92a), SPH_C32(0x54fd2359), SPH_C32(0xfd070000), - SPH_C32(0x0bb40001), SPH_C32(0x28a2e480), SPH_C32(0xf5920000), - SPH_C32(0xbff249d0), SPH_C32(0x5d9fd6dc), SPH_C32(0xe9280571), - SPH_C32(0x7f852f11) }, - { SPH_C32(0x94240000), SPH_C32(0xc7f40001), SPH_C32(0x490b3680), - SPH_C32(0x00140000), SPH_C32(0xc3ce147d), SPH_C32(0xf4f4db15), - SPH_C32(0x99afb1eb), SPH_C32(0x9ea7a4a7), SPH_C32(0x7c990000), - SPH_C32(0xe7e30001), SPH_C32(0x4e90e600), SPH_C32(0x60610000), - SPH_C32(0xe25b61d2), SPH_C32(0x156bea60), SPH_C32(0x0f72a75c), - SPH_C32(0xf1e298eb) }, - { SPH_C32(0xa18d0000), SPH_C32(0x9c3c0001), SPH_C32(0xdcba3800), - SPH_C32(0x3e120000), SPH_C32(0xa48907f9), SPH_C32(0x45725a95), - SPH_C32(0xe63afb65), SPH_C32(0xb9f51f08), SPH_C32(0xb2220000), - SPH_C32(0xf5a80001), SPH_C32(0xae35e280), SPH_C32(0x0da90000), - SPH_C32(0x130637fe), SPH_C32(0x12b8181f), SPH_C32(0xcf6dfb07), - SPH_C32(0xcf4ef56e) }, - { SPH_C32(0x6d990000), SPH_C32(0x395f0001), SPH_C32(0x86033f80), - SPH_C32(0x05420000), SPH_C32(0xef591406), SPH_C32(0xc2e96e8d), - SPH_C32(0x8f79b3a4), SPH_C32(0x73af98f6), SPH_C32(0x33bc0000), - SPH_C32(0x19ff0001), SPH_C32(0xc807e000), SPH_C32(0x985a0000), - SPH_C32(0x4eaf1ffc), SPH_C32(0x5a4c24a3), SPH_C32(0x2937592a), - SPH_C32(0x41294294) }, - { SPH_C32(0x20130000), SPH_C32(0x706b0001), SPH_C32(0xba883a80), - SPH_C32(0xabe10000), SPH_C32(0xf9202ffb), SPH_C32(0x0d866629), - SPH_C32(0x00605948), SPH_C32(0x3792a8f2), SPH_C32(0xffa80000), - SPH_C32(0xbc9c0001), SPH_C32(0x92bee780), SPH_C32(0xa30a0000), - SPH_C32(0x057f0c03), SPH_C32(0xddd710bb), SPH_C32(0x407411eb), - SPH_C32(0x8b73c56a) }, - { SPH_C32(0xec070000), SPH_C32(0xd5080001), SPH_C32(0xe0313d00), - SPH_C32(0x90b10000), SPH_C32(0xb2f03c04), SPH_C32(0x8a1d5231), - SPH_C32(0x69231189), SPH_C32(0xfdc82f0c), SPH_C32(0x7e360000), - SPH_C32(0x50cb0001), SPH_C32(0xf48ce500), SPH_C32(0x36f90000), - SPH_C32(0x58d62401), SPH_C32(0x95232c07), SPH_C32(0xa62eb3c6), - SPH_C32(0x05147290) }, - { SPH_C32(0xdb010000), SPH_C32(0x39e80001), SPH_C32(0xcf9c3080), - SPH_C32(0xf82f0000), SPH_C32(0x6f3a6a53), SPH_C32(0xbbd315d6), - SPH_C32(0xbfea4f9d), SPH_C32(0x2e6c7ed8), SPH_C32(0xca010000), - SPH_C32(0xe7540001), SPH_C32(0x070fe900), SPH_C32(0x9d0c0000), - SPH_C32(0x62381f87), SPH_C32(0x6c51913b), SPH_C32(0x3fe15b65), - SPH_C32(0xac217ec5) }, - { SPH_C32(0x17150000), SPH_C32(0x9c8b0001), SPH_C32(0x95253700), - SPH_C32(0xc37f0000), SPH_C32(0x24ea79ac), SPH_C32(0x3c4821ce), - SPH_C32(0xd6a9075c), SPH_C32(0xe436f926), SPH_C32(0x4b9f0000), - SPH_C32(0x0b030001), SPH_C32(0x613deb80), SPH_C32(0x08ff0000), - SPH_C32(0x3f913785), SPH_C32(0x24a5ad87), SPH_C32(0xd9bbf948), - SPH_C32(0x2246c93f) }, - { SPH_C32(0x5a9f0000), SPH_C32(0xd5bf0001), SPH_C32(0xa9ae3200), - SPH_C32(0x6ddc0000), SPH_C32(0x32934251), SPH_C32(0xf327296a), - SPH_C32(0x59b0edb0), SPH_C32(0xa00bc922), SPH_C32(0x878b0000), - SPH_C32(0xae600001), SPH_C32(0x3b84ec00), SPH_C32(0x33af0000), - SPH_C32(0x7441247a), SPH_C32(0xa33e999f), SPH_C32(0xb0f8b189), - SPH_C32(0xe81c4ec1) }, - { SPH_C32(0x968b0000), SPH_C32(0x70dc0001), SPH_C32(0xf3173580), - SPH_C32(0x568c0000), SPH_C32(0x794351ae), SPH_C32(0x74bc1d72), - SPH_C32(0x30f3a571), SPH_C32(0x6a514edc), SPH_C32(0x06150000), - SPH_C32(0x42370001), SPH_C32(0x5db6ee80), SPH_C32(0xa65c0000), - SPH_C32(0x29e80c78), SPH_C32(0xebcaa523), SPH_C32(0x56a213a4), - SPH_C32(0x667bf93b) }, - { SPH_C32(0xa3220000), SPH_C32(0x2b140001), SPH_C32(0x66a63b00), - SPH_C32(0x688a0000), SPH_C32(0x1e04422a), SPH_C32(0xc53a9cf2), - SPH_C32(0x4f66efff), SPH_C32(0x4d03f573), SPH_C32(0xc8ae0000), - SPH_C32(0x507c0001), SPH_C32(0xbd13ea00), SPH_C32(0xcb940000), - SPH_C32(0xd8b55a54), SPH_C32(0xec19575c), SPH_C32(0x96bd4fff), - SPH_C32(0x58d794be) }, - { SPH_C32(0x6f360000), SPH_C32(0x8e770001), SPH_C32(0x3c1f3c80), - SPH_C32(0x53da0000), SPH_C32(0x55d451d5), SPH_C32(0x42a1a8ea), - SPH_C32(0x2625a73e), SPH_C32(0x8759728d), SPH_C32(0x49300000), - SPH_C32(0xbc2b0001), SPH_C32(0xdb21e880), SPH_C32(0x5e670000), - SPH_C32(0x851c7256), SPH_C32(0xa4ed6be0), SPH_C32(0x70e7edd2), - SPH_C32(0xd6b02344) }, - { SPH_C32(0x22bc0000), SPH_C32(0xc7430001), SPH_C32(0x00943980), - SPH_C32(0xfd790000), SPH_C32(0x43ad6a28), SPH_C32(0x8dcea04e), - SPH_C32(0xa93c4dd2), SPH_C32(0xc3644289), SPH_C32(0x85240000), - SPH_C32(0x19480001), SPH_C32(0x8198ef00), SPH_C32(0x65370000), - SPH_C32(0xcecc61a9), SPH_C32(0x23765ff8), SPH_C32(0x19a4a513), - SPH_C32(0x1ceaa4ba) }, - { SPH_C32(0xeea80000), SPH_C32(0x62200001), SPH_C32(0x5a2d3e00), - SPH_C32(0xc6290000), SPH_C32(0x087d79d7), SPH_C32(0x0a559456), - SPH_C32(0xc07f0513), SPH_C32(0x093ec577), SPH_C32(0x04ba0000), - SPH_C32(0xf51f0001), SPH_C32(0xe7aaed80), SPH_C32(0xf0c40000), - SPH_C32(0x936549ab), SPH_C32(0x6b826344), SPH_C32(0xfffe073e), - SPH_C32(0x928d1340) }, - { SPH_C32(0x6ba80000), SPH_C32(0x4ba90001), SPH_C32(0x5d832180), - SPH_C32(0xdad00000), SPH_C32(0x63751974), SPH_C32(0xd089ea49), - SPH_C32(0x256784eb), SPH_C32(0xd3d4a53b), SPH_C32(0x1cc50000), - SPH_C32(0x59260001), SPH_C32(0x51d2f200), SPH_C32(0x58720000), - SPH_C32(0xf30e4347), SPH_C32(0x8d428ece), SPH_C32(0x98432863), - SPH_C32(0xaa5c67e3) }, - { SPH_C32(0xa7bc0000), SPH_C32(0xeeca0001), SPH_C32(0x073a2600), - SPH_C32(0xe1800000), SPH_C32(0x28a50a8b), SPH_C32(0x5712de51), - SPH_C32(0x4c24cc2a), SPH_C32(0x198e22c5), SPH_C32(0x9d5b0000), - SPH_C32(0xb5710001), SPH_C32(0x37e0f080), SPH_C32(0xcd810000), - SPH_C32(0xaea76b45), SPH_C32(0xc5b6b272), SPH_C32(0x7e198a4e), - SPH_C32(0x243bd019) }, - { SPH_C32(0xea360000), SPH_C32(0xa7fe0001), SPH_C32(0x3bb12300), - SPH_C32(0x4f230000), SPH_C32(0x3edc3176), SPH_C32(0x987dd6f5), - SPH_C32(0xc33d26c6), SPH_C32(0x5db312c1), SPH_C32(0x514f0000), - SPH_C32(0x10120001), SPH_C32(0x6d59f700), SPH_C32(0xf6d10000), - SPH_C32(0xe57778ba), SPH_C32(0x422d866a), SPH_C32(0x175ac28f), - SPH_C32(0xee6157e7) }, - { SPH_C32(0x26220000), SPH_C32(0x029d0001), SPH_C32(0x61082480), - SPH_C32(0x74730000), SPH_C32(0x750c2289), SPH_C32(0x1fe6e2ed), - SPH_C32(0xaa7e6e07), SPH_C32(0x97e9953f), SPH_C32(0xd0d10000), - SPH_C32(0xfc450001), SPH_C32(0x0b6bf580), SPH_C32(0x63220000), - SPH_C32(0xb8de50b8), SPH_C32(0x0ad9bad6), SPH_C32(0xf10060a2), - SPH_C32(0x6006e01d) }, - { SPH_C32(0x138b0000), SPH_C32(0x59550001), SPH_C32(0xf4b92a00), - SPH_C32(0x4a750000), SPH_C32(0x124b310d), SPH_C32(0xae60636d), - SPH_C32(0xd5eb2489), SPH_C32(0xb0bb2e90), SPH_C32(0x1e6a0000), - SPH_C32(0xee0e0001), SPH_C32(0xebcef100), SPH_C32(0x0eea0000), - SPH_C32(0x49830694), SPH_C32(0x0d0a48a9), SPH_C32(0x311f3cf9), - SPH_C32(0x5eaa8d98) }, - { SPH_C32(0xdf9f0000), SPH_C32(0xfc360001), SPH_C32(0xae002d80), - SPH_C32(0x71250000), SPH_C32(0x599b22f2), SPH_C32(0x29fb5775), - SPH_C32(0xbca86c48), SPH_C32(0x7ae1a96e), SPH_C32(0x9ff40000), - SPH_C32(0x02590001), SPH_C32(0x8dfcf380), SPH_C32(0x9b190000), - SPH_C32(0x142a2e96), SPH_C32(0x45fe7415), SPH_C32(0xd7459ed4), - SPH_C32(0xd0cd3a62) }, - { SPH_C32(0x92150000), SPH_C32(0xb5020001), SPH_C32(0x928b2880), - SPH_C32(0xdf860000), SPH_C32(0x4fe2190f), SPH_C32(0xe6945fd1), - SPH_C32(0x33b186a4), SPH_C32(0x3edc996a), SPH_C32(0x53e00000), - SPH_C32(0xa73a0001), SPH_C32(0xd745f400), SPH_C32(0xa0490000), - SPH_C32(0x5ffa3d69), SPH_C32(0xc265400d), SPH_C32(0xbe06d615), - SPH_C32(0x1a97bd9c) }, - { SPH_C32(0x5e010000), SPH_C32(0x10610001), SPH_C32(0xc8322f00), - SPH_C32(0xe4d60000), SPH_C32(0x04320af0), SPH_C32(0x610f6bc9), - SPH_C32(0x5af2ce65), SPH_C32(0xf4861e94), SPH_C32(0xd27e0000), - SPH_C32(0x4b6d0001), SPH_C32(0xb177f680), SPH_C32(0x35ba0000), - SPH_C32(0x0253156b), SPH_C32(0x8a917cb1), SPH_C32(0x585c7438), - SPH_C32(0x94f00a66) }, - { SPH_C32(0x69070000), SPH_C32(0xfc810001), SPH_C32(0xe79f2280), - SPH_C32(0x8c480000), SPH_C32(0xd9f85ca7), SPH_C32(0x50c12c2e), - SPH_C32(0x8c3b9071), SPH_C32(0x27224f40), SPH_C32(0x66490000), - SPH_C32(0xfcf20001), SPH_C32(0x42f4fa80), SPH_C32(0x9e4f0000), - SPH_C32(0x38bd2eed), SPH_C32(0x73e3c18d), SPH_C32(0xc1939c9b), - SPH_C32(0x3dc50633) }, - { SPH_C32(0xa5130000), SPH_C32(0x59e20001), SPH_C32(0xbd262500), - SPH_C32(0xb7180000), SPH_C32(0x92284f58), SPH_C32(0xd75a1836), - SPH_C32(0xe578d8b0), SPH_C32(0xed78c8be), SPH_C32(0xe7d70000), - SPH_C32(0x10a50001), SPH_C32(0x24c6f800), SPH_C32(0x0bbc0000), - SPH_C32(0x651406ef), SPH_C32(0x3b17fd31), SPH_C32(0x27c93eb6), - SPH_C32(0xb3a2b1c9) }, - { SPH_C32(0xe8990000), SPH_C32(0x10d60001), SPH_C32(0x81ad2000), - SPH_C32(0x19bb0000), SPH_C32(0x845174a5), SPH_C32(0x18351092), - SPH_C32(0x6a61325c), SPH_C32(0xa945f8ba), SPH_C32(0x2bc30000), - SPH_C32(0xb5c60001), SPH_C32(0x7e7fff80), SPH_C32(0x30ec0000), - SPH_C32(0x2ec41510), SPH_C32(0xbc8cc929), SPH_C32(0x4e8a7677), - SPH_C32(0x79f83637) }, - { SPH_C32(0x248d0000), SPH_C32(0xb5b50001), SPH_C32(0xdb142780), - SPH_C32(0x22eb0000), SPH_C32(0xcf81675a), SPH_C32(0x9fae248a), - SPH_C32(0x03227a9d), SPH_C32(0x631f7f44), SPH_C32(0xaa5d0000), - SPH_C32(0x59910001), SPH_C32(0x184dfd00), SPH_C32(0xa51f0000), - SPH_C32(0x736d3d12), SPH_C32(0xf478f595), SPH_C32(0xa8d0d45a), - SPH_C32(0xf79f81cd) }, - { SPH_C32(0x11240000), SPH_C32(0xee7d0001), SPH_C32(0x4ea52900), - SPH_C32(0x1ced0000), SPH_C32(0xa8c674de), SPH_C32(0x2e28a50a), - SPH_C32(0x7cb73013), SPH_C32(0x444dc4eb), SPH_C32(0x64e60000), - SPH_C32(0x4bda0001), SPH_C32(0xf8e8f980), SPH_C32(0xc8d70000), - SPH_C32(0x82306b3e), SPH_C32(0xf3ab07ea), SPH_C32(0x68cf8801), - SPH_C32(0xc933ec48) }, - { SPH_C32(0xdd300000), SPH_C32(0x4b1e0001), SPH_C32(0x141c2e80), - SPH_C32(0x27bd0000), SPH_C32(0xe3166721), SPH_C32(0xa9b39112), - SPH_C32(0x15f478d2), SPH_C32(0x8e174315), SPH_C32(0xe5780000), - SPH_C32(0xa78d0001), SPH_C32(0x9edafb00), SPH_C32(0x5d240000), - SPH_C32(0xdf99433c), SPH_C32(0xbb5f3b56), SPH_C32(0x8e952a2c), - SPH_C32(0x47545bb2) }, - { SPH_C32(0x90ba0000), SPH_C32(0x022a0001), SPH_C32(0x28972b80), - SPH_C32(0x891e0000), SPH_C32(0xf56f5cdc), SPH_C32(0x66dc99b6), - SPH_C32(0x9aed923e), SPH_C32(0xca2a7311), SPH_C32(0x296c0000), - SPH_C32(0x02ee0001), SPH_C32(0xc463fc80), SPH_C32(0x66740000), - SPH_C32(0x944950c3), SPH_C32(0x3cc40f4e), SPH_C32(0xe7d662ed), - SPH_C32(0x8d0edc4c) }, - { SPH_C32(0x5cae0000), SPH_C32(0xa7490001), SPH_C32(0x722e2c00), - SPH_C32(0xb24e0000), SPH_C32(0xbebf4f23), SPH_C32(0xe147adae), - SPH_C32(0xf3aedaff), SPH_C32(0x0070f4ef), SPH_C32(0xa8f20000), - SPH_C32(0xeeb90001), SPH_C32(0xa251fe00), SPH_C32(0xf3870000), - SPH_C32(0xc9e078c1), SPH_C32(0x743033f2), SPH_C32(0x018cc0c0), - SPH_C32(0x03696bb6) }, - { SPH_C32(0xc7e00000), SPH_C32(0x500f0001), SPH_C32(0x18783200), - SPH_C32(0xd9930000), SPH_C32(0x39f0281e), SPH_C32(0xcf3bbaff), - SPH_C32(0xdb154315), SPH_C32(0x4230ddcd), SPH_C32(0x028b0000), - SPH_C32(0x87e90001), SPH_C32(0x3c2af380), SPH_C32(0x2f560000), - SPH_C32(0x1f4944d9), SPH_C32(0x79e2e780), SPH_C32(0x55e03071), - SPH_C32(0x32f62e8d) }, - { SPH_C32(0x0bf40000), SPH_C32(0xf56c0001), SPH_C32(0x42c13580), - SPH_C32(0xe2c30000), SPH_C32(0x72203be1), SPH_C32(0x48a08ee7), - SPH_C32(0xb2560bd4), SPH_C32(0x886a5a33), SPH_C32(0x83150000), - SPH_C32(0x6bbe0001), SPH_C32(0x5a18f100), SPH_C32(0xbaa50000), - SPH_C32(0x42e06cdb), SPH_C32(0x3116db3c), SPH_C32(0xb3ba925c), - SPH_C32(0xbc919977) }, - { SPH_C32(0x467e0000), SPH_C32(0xbc580001), SPH_C32(0x7e4a3080), - SPH_C32(0x4c600000), SPH_C32(0x6459001c), SPH_C32(0x87cf8643), - SPH_C32(0x3d4fe138), SPH_C32(0xcc576a37), SPH_C32(0x4f010000), - SPH_C32(0xcedd0001), SPH_C32(0x00a1f680), SPH_C32(0x81f50000), - SPH_C32(0x09307f24), SPH_C32(0xb68def24), SPH_C32(0xdaf9da9d), - SPH_C32(0x76cb1e89) }, - { SPH_C32(0x8a6a0000), SPH_C32(0x193b0001), SPH_C32(0x24f33700), - SPH_C32(0x77300000), SPH_C32(0x2f8913e3), SPH_C32(0x0054b25b), - SPH_C32(0x540ca9f9), SPH_C32(0x060dedc9), SPH_C32(0xce9f0000), - SPH_C32(0x228a0001), SPH_C32(0x6693f400), SPH_C32(0x14060000), - SPH_C32(0x54995726), SPH_C32(0xfe79d398), SPH_C32(0x3ca378b0), - SPH_C32(0xf8aca973) }, - { SPH_C32(0xbfc30000), SPH_C32(0x42f30001), SPH_C32(0xb1423980), - SPH_C32(0x49360000), SPH_C32(0x48ce0067), SPH_C32(0xb1d233db), - SPH_C32(0x2b99e377), SPH_C32(0x215f5666), SPH_C32(0x00240000), - SPH_C32(0x30c10001), SPH_C32(0x8636f080), SPH_C32(0x79ce0000), - SPH_C32(0xa5c4010a), SPH_C32(0xf9aa21e7), SPH_C32(0xfcbc24eb), - SPH_C32(0xc600c4f6) }, - { SPH_C32(0x73d70000), SPH_C32(0xe7900001), SPH_C32(0xebfb3e00), - SPH_C32(0x72660000), SPH_C32(0x031e1398), SPH_C32(0x364907c3), - SPH_C32(0x42daabb6), SPH_C32(0xeb05d198), SPH_C32(0x81ba0000), - SPH_C32(0xdc960001), SPH_C32(0xe004f200), SPH_C32(0xec3d0000), - SPH_C32(0xf86d2908), SPH_C32(0xb15e1d5b), SPH_C32(0x1ae686c6), - SPH_C32(0x4867730c) }, - { SPH_C32(0x3e5d0000), SPH_C32(0xaea40001), SPH_C32(0xd7703b00), - SPH_C32(0xdcc50000), SPH_C32(0x15672865), SPH_C32(0xf9260f67), - SPH_C32(0xcdc3415a), SPH_C32(0xaf38e19c), SPH_C32(0x4dae0000), - SPH_C32(0x79f50001), SPH_C32(0xbabdf580), SPH_C32(0xd76d0000), - SPH_C32(0xb3bd3af7), SPH_C32(0x36c52943), SPH_C32(0x73a5ce07), - SPH_C32(0x823df4f2) }, - { SPH_C32(0xf2490000), SPH_C32(0x0bc70001), SPH_C32(0x8dc93c80), - SPH_C32(0xe7950000), SPH_C32(0x5eb73b9a), SPH_C32(0x7ebd3b7f), - SPH_C32(0xa480099b), SPH_C32(0x65626662), SPH_C32(0xcc300000), - SPH_C32(0x95a20001), SPH_C32(0xdc8ff700), SPH_C32(0x429e0000), - SPH_C32(0xee1412f5), SPH_C32(0x7e3115ff), SPH_C32(0x95ff6c2a), - SPH_C32(0x0c5a4308) }, - { SPH_C32(0xc54f0000), SPH_C32(0xe7270001), SPH_C32(0xa2643100), - SPH_C32(0x8f0b0000), SPH_C32(0x837d6dcd), SPH_C32(0x4f737c98), - SPH_C32(0x7249578f), SPH_C32(0xb6c637b6), SPH_C32(0x78070000), - SPH_C32(0x223d0001), SPH_C32(0x2f0cfb00), SPH_C32(0xe96b0000), - SPH_C32(0xd4fa2973), SPH_C32(0x8743a8c3), SPH_C32(0x0c308489), - SPH_C32(0xa56f4f5d) }, - { SPH_C32(0x095b0000), SPH_C32(0x42440001), SPH_C32(0xf8dd3680), - SPH_C32(0xb45b0000), SPH_C32(0xc8ad7e32), SPH_C32(0xc8e84880), - SPH_C32(0x1b0a1f4e), SPH_C32(0x7c9cb048), SPH_C32(0xf9990000), - SPH_C32(0xce6a0001), SPH_C32(0x493ef980), SPH_C32(0x7c980000), - SPH_C32(0x89530171), SPH_C32(0xcfb7947f), SPH_C32(0xea6a26a4), - SPH_C32(0x2b08f8a7) }, - { SPH_C32(0x44d10000), SPH_C32(0x0b700001), SPH_C32(0xc4563380), - SPH_C32(0x1af80000), SPH_C32(0xded445cf), SPH_C32(0x07874024), - SPH_C32(0x9413f5a2), SPH_C32(0x38a1804c), SPH_C32(0x358d0000), - SPH_C32(0x6b090001), SPH_C32(0x1387fe00), SPH_C32(0x47c80000), - SPH_C32(0xc283128e), SPH_C32(0x482ca067), SPH_C32(0x83296e65), - SPH_C32(0xe1527f59) }, - { SPH_C32(0x88c50000), SPH_C32(0xae130001), SPH_C32(0x9eef3400), - SPH_C32(0x21a80000), SPH_C32(0x95045630), SPH_C32(0x801c743c), - SPH_C32(0xfd50bd63), SPH_C32(0xf2fb07b2), SPH_C32(0xb4130000), - SPH_C32(0x875e0001), SPH_C32(0x75b5fc80), SPH_C32(0xd23b0000), - SPH_C32(0x9f2a3a8c), SPH_C32(0x00d89cdb), SPH_C32(0x6573cc48), - SPH_C32(0x6f35c8a3) }, - { SPH_C32(0xbd6c0000), SPH_C32(0xf5db0001), SPH_C32(0x0b5e3a80), - SPH_C32(0x1fae0000), SPH_C32(0xf24345b4), SPH_C32(0x319af5bc), - SPH_C32(0x82c5f7ed), SPH_C32(0xd5a9bc1d), SPH_C32(0x7aa80000), - SPH_C32(0x95150001), SPH_C32(0x9510f800), SPH_C32(0xbff30000), - SPH_C32(0x6e776ca0), SPH_C32(0x070b6ea4), SPH_C32(0xa56c9013), - SPH_C32(0x5199a526) }, - { SPH_C32(0x71780000), SPH_C32(0x50b80001), SPH_C32(0x51e73d00), - SPH_C32(0x24fe0000), SPH_C32(0xb993564b), SPH_C32(0xb601c1a4), - SPH_C32(0xeb86bf2c), SPH_C32(0x1ff33be3), SPH_C32(0xfb360000), - SPH_C32(0x79420001), SPH_C32(0xf322fa80), SPH_C32(0x2a000000), - SPH_C32(0x33de44a2), SPH_C32(0x4fff5218), SPH_C32(0x4336323e), - SPH_C32(0xdffe12dc) }, - { SPH_C32(0x3cf20000), SPH_C32(0x198c0001), SPH_C32(0x6d6c3800), - SPH_C32(0x8a5d0000), SPH_C32(0xafea6db6), SPH_C32(0x796ec900), - SPH_C32(0x649f55c0), SPH_C32(0x5bce0be7), SPH_C32(0x37220000), - SPH_C32(0xdc210001), SPH_C32(0xa99bfd00), SPH_C32(0x11500000), - SPH_C32(0x780e575d), SPH_C32(0xc8646600), SPH_C32(0x2a757aff), - SPH_C32(0x15a49522) }, - { SPH_C32(0xf0e60000), SPH_C32(0xbcef0001), SPH_C32(0x37d53f80), - SPH_C32(0xb10d0000), SPH_C32(0xe43a7e49), SPH_C32(0xfef5fd18), - SPH_C32(0x0ddc1d01), SPH_C32(0x91948c19), SPH_C32(0xb6bc0000), - SPH_C32(0x30760001), SPH_C32(0xcfa9ff80), SPH_C32(0x84a30000), - SPH_C32(0x25a77f5f), SPH_C32(0x80905abc), SPH_C32(0xcc2fd8d2), - SPH_C32(0x9bc322d8) } -}; - -static const sph_u32 T512_40[256][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x58430000), SPH_C32(0x807e0000), SPH_C32(0x78330001), - SPH_C32(0xc66b3800), SPH_C32(0xe7375cdc), SPH_C32(0x79ad3fdd), - SPH_C32(0xac73fe6f), SPH_C32(0x3a4479b1), SPH_C32(0x1d5a0000), - SPH_C32(0x2b720000), SPH_C32(0x488d0000), SPH_C32(0xaf611800), - SPH_C32(0x25cb2ec5), SPH_C32(0xc879bfd0), SPH_C32(0x81a20429), - SPH_C32(0x1e7536a6) }, - { SPH_C32(0x1d5a0000), SPH_C32(0x2b720000), SPH_C32(0x488d0000), - SPH_C32(0xaf611800), SPH_C32(0x25cb2ec5), SPH_C32(0xc879bfd0), - SPH_C32(0x81a20429), SPH_C32(0x1e7536a6), SPH_C32(0x45190000), - SPH_C32(0xab0c0000), SPH_C32(0x30be0001), SPH_C32(0x690a2000), - SPH_C32(0xc2fc7219), SPH_C32(0xb1d4800d), SPH_C32(0x2dd1fa46), - SPH_C32(0x24314f17) }, - { SPH_C32(0x45190000), SPH_C32(0xab0c0000), SPH_C32(0x30be0001), - SPH_C32(0x690a2000), SPH_C32(0xc2fc7219), SPH_C32(0xb1d4800d), - SPH_C32(0x2dd1fa46), SPH_C32(0x24314f17), SPH_C32(0x58430000), - SPH_C32(0x807e0000), SPH_C32(0x78330001), SPH_C32(0xc66b3800), - SPH_C32(0xe7375cdc), SPH_C32(0x79ad3fdd), SPH_C32(0xac73fe6f), - SPH_C32(0x3a4479b1) }, - { SPH_C32(0xa53b0000), SPH_C32(0x14260000), SPH_C32(0x4e30001e), - SPH_C32(0x7cae0000), SPH_C32(0x8f9e0dd5), SPH_C32(0x78dfaa3d), - SPH_C32(0xf73168d8), SPH_C32(0x0b1b4946), SPH_C32(0x07ed0000), - SPH_C32(0xb2500000), SPH_C32(0x8774000a), SPH_C32(0x970d0000), - SPH_C32(0x437223ae), SPH_C32(0x48c76ea4), SPH_C32(0xf4786222), - SPH_C32(0x9075b1ce) }, - { SPH_C32(0xfd780000), SPH_C32(0x94580000), SPH_C32(0x3603001f), - SPH_C32(0xbac53800), SPH_C32(0x68a95109), SPH_C32(0x017295e0), - SPH_C32(0x5b4296b7), SPH_C32(0x315f30f7), SPH_C32(0x1ab70000), - SPH_C32(0x99220000), SPH_C32(0xcff9000a), SPH_C32(0x386c1800), - SPH_C32(0x66b90d6b), SPH_C32(0x80bed174), SPH_C32(0x75da660b), - SPH_C32(0x8e008768) }, - { SPH_C32(0xb8610000), SPH_C32(0x3f540000), SPH_C32(0x06bd001e), - SPH_C32(0xd3cf1800), SPH_C32(0xaa552310), SPH_C32(0xb0a615ed), - SPH_C32(0x76936cf1), SPH_C32(0x156e7fe0), SPH_C32(0x42f40000), - SPH_C32(0x195c0000), SPH_C32(0xb7ca000b), SPH_C32(0xfe072000), - SPH_C32(0x818e51b7), SPH_C32(0xf913eea9), SPH_C32(0xd9a99864), - SPH_C32(0xb444fed9) }, - { SPH_C32(0xe0220000), SPH_C32(0xbf2a0000), SPH_C32(0x7e8e001f), - SPH_C32(0x15a42000), SPH_C32(0x4d627fcc), SPH_C32(0xc90b2a30), - SPH_C32(0xdae0929e), SPH_C32(0x2f2a0651), SPH_C32(0x5fae0000), - SPH_C32(0x322e0000), SPH_C32(0xff47000b), SPH_C32(0x51663800), - SPH_C32(0xa4457f72), SPH_C32(0x316a5179), SPH_C32(0x580b9c4d), - SPH_C32(0xaa31c87f) }, - { SPH_C32(0x07ed0000), SPH_C32(0xb2500000), SPH_C32(0x8774000a), - SPH_C32(0x970d0000), SPH_C32(0x437223ae), SPH_C32(0x48c76ea4), - SPH_C32(0xf4786222), SPH_C32(0x9075b1ce), SPH_C32(0xa2d60000), - SPH_C32(0xa6760000), SPH_C32(0xc9440014), SPH_C32(0xeba30000), - SPH_C32(0xccec2e7b), SPH_C32(0x3018c499), SPH_C32(0x03490afa), - SPH_C32(0x9b6ef888) }, - { SPH_C32(0x5fae0000), SPH_C32(0x322e0000), SPH_C32(0xff47000b), - SPH_C32(0x51663800), SPH_C32(0xa4457f72), SPH_C32(0x316a5179), - SPH_C32(0x580b9c4d), SPH_C32(0xaa31c87f), SPH_C32(0xbf8c0000), - SPH_C32(0x8d040000), SPH_C32(0x81c90014), SPH_C32(0x44c21800), - SPH_C32(0xe92700be), SPH_C32(0xf8617b49), SPH_C32(0x82eb0ed3), - SPH_C32(0x851bce2e) }, - { SPH_C32(0x1ab70000), SPH_C32(0x99220000), SPH_C32(0xcff9000a), - SPH_C32(0x386c1800), SPH_C32(0x66b90d6b), SPH_C32(0x80bed174), - SPH_C32(0x75da660b), SPH_C32(0x8e008768), SPH_C32(0xe7cf0000), - SPH_C32(0x0d7a0000), SPH_C32(0xf9fa0015), SPH_C32(0x82a92000), - SPH_C32(0x0e105c62), SPH_C32(0x81cc4494), SPH_C32(0x2e98f0bc), - SPH_C32(0xbf5fb79f) }, - { SPH_C32(0x42f40000), SPH_C32(0x195c0000), SPH_C32(0xb7ca000b), - SPH_C32(0xfe072000), SPH_C32(0x818e51b7), SPH_C32(0xf913eea9), - SPH_C32(0xd9a99864), SPH_C32(0xb444fed9), SPH_C32(0xfa950000), - SPH_C32(0x26080000), SPH_C32(0xb1770015), SPH_C32(0x2dc83800), - SPH_C32(0x2bdb72a7), SPH_C32(0x49b5fb44), SPH_C32(0xaf3af495), - SPH_C32(0xa12a8139) }, - { SPH_C32(0xa2d60000), SPH_C32(0xa6760000), SPH_C32(0xc9440014), - SPH_C32(0xeba30000), SPH_C32(0xccec2e7b), SPH_C32(0x3018c499), - SPH_C32(0x03490afa), SPH_C32(0x9b6ef888), SPH_C32(0xa53b0000), - SPH_C32(0x14260000), SPH_C32(0x4e30001e), SPH_C32(0x7cae0000), - SPH_C32(0x8f9e0dd5), SPH_C32(0x78dfaa3d), SPH_C32(0xf73168d8), - SPH_C32(0x0b1b4946) }, - { SPH_C32(0xfa950000), SPH_C32(0x26080000), SPH_C32(0xb1770015), - SPH_C32(0x2dc83800), SPH_C32(0x2bdb72a7), SPH_C32(0x49b5fb44), - SPH_C32(0xaf3af495), SPH_C32(0xa12a8139), SPH_C32(0xb8610000), - SPH_C32(0x3f540000), SPH_C32(0x06bd001e), SPH_C32(0xd3cf1800), - SPH_C32(0xaa552310), SPH_C32(0xb0a615ed), SPH_C32(0x76936cf1), - SPH_C32(0x156e7fe0) }, - { SPH_C32(0xbf8c0000), SPH_C32(0x8d040000), SPH_C32(0x81c90014), - SPH_C32(0x44c21800), SPH_C32(0xe92700be), SPH_C32(0xf8617b49), - SPH_C32(0x82eb0ed3), SPH_C32(0x851bce2e), SPH_C32(0xe0220000), - SPH_C32(0xbf2a0000), SPH_C32(0x7e8e001f), SPH_C32(0x15a42000), - SPH_C32(0x4d627fcc), SPH_C32(0xc90b2a30), SPH_C32(0xdae0929e), - SPH_C32(0x2f2a0651) }, - { SPH_C32(0xe7cf0000), SPH_C32(0x0d7a0000), SPH_C32(0xf9fa0015), - SPH_C32(0x82a92000), SPH_C32(0x0e105c62), SPH_C32(0x81cc4494), - SPH_C32(0x2e98f0bc), SPH_C32(0xbf5fb79f), SPH_C32(0xfd780000), - SPH_C32(0x94580000), SPH_C32(0x3603001f), SPH_C32(0xbac53800), - SPH_C32(0x68a95109), SPH_C32(0x017295e0), SPH_C32(0x5b4296b7), - SPH_C32(0x315f30f7) }, - { SPH_C32(0x88980000), SPH_C32(0x1f940000), SPH_C32(0x7fcf002e), - SPH_C32(0xfb4e0000), SPH_C32(0xf158079a), SPH_C32(0x61ae9167), - SPH_C32(0xa895706c), SPH_C32(0xe6107494), SPH_C32(0x0bc20000), - SPH_C32(0xdb630000), SPH_C32(0x7e88000c), SPH_C32(0x15860000), - SPH_C32(0x91fd48f3), SPH_C32(0x7581bb43), SPH_C32(0xf460449e), - SPH_C32(0xd8b61463) }, - { SPH_C32(0xd0db0000), SPH_C32(0x9fea0000), SPH_C32(0x07fc002f), - SPH_C32(0x3d253800), SPH_C32(0x166f5b46), SPH_C32(0x1803aeba), - SPH_C32(0x04e68e03), SPH_C32(0xdc540d25), SPH_C32(0x16980000), - SPH_C32(0xf0110000), SPH_C32(0x3605000c), SPH_C32(0xbae71800), - SPH_C32(0xb4366636), SPH_C32(0xbdf80493), SPH_C32(0x75c240b7), - SPH_C32(0xc6c322c5) }, - { SPH_C32(0x95c20000), SPH_C32(0x34e60000), SPH_C32(0x3742002e), - SPH_C32(0x542f1800), SPH_C32(0xd493295f), SPH_C32(0xa9d72eb7), - SPH_C32(0x29377445), SPH_C32(0xf8654232), SPH_C32(0x4edb0000), - SPH_C32(0x706f0000), SPH_C32(0x4e36000d), SPH_C32(0x7c8c2000), - SPH_C32(0x53013aea), SPH_C32(0xc4553b4e), SPH_C32(0xd9b1bed8), - SPH_C32(0xfc875b74) }, - { SPH_C32(0xcd810000), SPH_C32(0xb4980000), SPH_C32(0x4f71002f), - SPH_C32(0x92442000), SPH_C32(0x33a47583), SPH_C32(0xd07a116a), - SPH_C32(0x85448a2a), SPH_C32(0xc2213b83), SPH_C32(0x53810000), - SPH_C32(0x5b1d0000), SPH_C32(0x06bb000d), SPH_C32(0xd3ed3800), - SPH_C32(0x76ca142f), SPH_C32(0x0c2c849e), SPH_C32(0x5813baf1), - SPH_C32(0xe2f26dd2) }, - { SPH_C32(0x2da30000), SPH_C32(0x0bb20000), SPH_C32(0x31ff0030), - SPH_C32(0x87e00000), SPH_C32(0x7ec60a4f), SPH_C32(0x19713b5a), - SPH_C32(0x5fa418b4), SPH_C32(0xed0b3dd2), SPH_C32(0x0c2f0000), - SPH_C32(0x69330000), SPH_C32(0xf9fc0006), SPH_C32(0x828b0000), - SPH_C32(0xd28f6b5d), SPH_C32(0x3d46d5e7), SPH_C32(0x001826bc), - SPH_C32(0x48c3a5ad) }, - { SPH_C32(0x75e00000), SPH_C32(0x8bcc0000), SPH_C32(0x49cc0031), - SPH_C32(0x418b3800), SPH_C32(0x99f15693), SPH_C32(0x60dc0487), - SPH_C32(0xf3d7e6db), SPH_C32(0xd74f4463), SPH_C32(0x11750000), - SPH_C32(0x42410000), SPH_C32(0xb1710006), SPH_C32(0x2dea1800), - SPH_C32(0xf7444598), SPH_C32(0xf53f6a37), SPH_C32(0x81ba2295), - SPH_C32(0x56b6930b) }, - { SPH_C32(0x30f90000), SPH_C32(0x20c00000), SPH_C32(0x79720030), - SPH_C32(0x28811800), SPH_C32(0x5b0d248a), SPH_C32(0xd108848a), - SPH_C32(0xde061c9d), SPH_C32(0xf37e0b74), SPH_C32(0x49360000), - SPH_C32(0xc23f0000), SPH_C32(0xc9420007), SPH_C32(0xeb812000), - SPH_C32(0x10731944), SPH_C32(0x8c9255ea), SPH_C32(0x2dc9dcfa), - SPH_C32(0x6cf2eaba) }, - { SPH_C32(0x68ba0000), SPH_C32(0xa0be0000), SPH_C32(0x01410031), - SPH_C32(0xeeea2000), SPH_C32(0xbc3a7856), SPH_C32(0xa8a5bb57), - SPH_C32(0x7275e2f2), SPH_C32(0xc93a72c5), SPH_C32(0x546c0000), - SPH_C32(0xe94d0000), SPH_C32(0x81cf0007), SPH_C32(0x44e03800), - SPH_C32(0x35b83781), SPH_C32(0x44ebea3a), SPH_C32(0xac6bd8d3), - SPH_C32(0x7287dc1c) }, - { SPH_C32(0x8f750000), SPH_C32(0xadc40000), SPH_C32(0xf8bb0024), - SPH_C32(0x6c430000), SPH_C32(0xb22a2434), SPH_C32(0x2969ffc3), - SPH_C32(0x5ced124e), SPH_C32(0x7665c55a), SPH_C32(0xa9140000), - SPH_C32(0x7d150000), SPH_C32(0xb7cc0018), SPH_C32(0xfe250000), - SPH_C32(0x5d116688), SPH_C32(0x45997fda), SPH_C32(0xf7294e64), - SPH_C32(0x43d8eceb) }, - { SPH_C32(0xd7360000), SPH_C32(0x2dba0000), SPH_C32(0x80880025), - SPH_C32(0xaa283800), SPH_C32(0x551d78e8), SPH_C32(0x50c4c01e), - SPH_C32(0xf09eec21), SPH_C32(0x4c21bceb), SPH_C32(0xb44e0000), - SPH_C32(0x56670000), SPH_C32(0xff410018), SPH_C32(0x51441800), - SPH_C32(0x78da484d), SPH_C32(0x8de0c00a), SPH_C32(0x768b4a4d), - SPH_C32(0x5dadda4d) }, - { SPH_C32(0x922f0000), SPH_C32(0x86b60000), SPH_C32(0xb0360024), - SPH_C32(0xc3221800), SPH_C32(0x97e10af1), SPH_C32(0xe1104013), - SPH_C32(0xdd4f1667), SPH_C32(0x6810f3fc), SPH_C32(0xec0d0000), - SPH_C32(0xd6190000), SPH_C32(0x87720019), SPH_C32(0x972f2000), - SPH_C32(0x9fed1491), SPH_C32(0xf44dffd7), SPH_C32(0xdaf8b422), - SPH_C32(0x67e9a3fc) }, - { SPH_C32(0xca6c0000), SPH_C32(0x06c80000), SPH_C32(0xc8050025), - SPH_C32(0x05492000), SPH_C32(0x70d6562d), SPH_C32(0x98bd7fce), - SPH_C32(0x713ce808), SPH_C32(0x52548a4d), SPH_C32(0xf1570000), - SPH_C32(0xfd6b0000), SPH_C32(0xcfff0019), SPH_C32(0x384e3800), - SPH_C32(0xba263a54), SPH_C32(0x3c344007), SPH_C32(0x5b5ab00b), - SPH_C32(0x799c955a) }, - { SPH_C32(0x2a4e0000), SPH_C32(0xb9e20000), SPH_C32(0xb68b003a), - SPH_C32(0x10ed0000), SPH_C32(0x3db429e1), SPH_C32(0x51b655fe), - SPH_C32(0xabdc7a96), SPH_C32(0x7d7e8c1c), SPH_C32(0xaef90000), - SPH_C32(0xcf450000), SPH_C32(0x30b80012), SPH_C32(0x69280000), - SPH_C32(0x1e634526), SPH_C32(0x0d5e117e), SPH_C32(0x03512c46), - SPH_C32(0xd3ad5d25) }, - { SPH_C32(0x720d0000), SPH_C32(0x399c0000), SPH_C32(0xceb8003b), - SPH_C32(0xd6863800), SPH_C32(0xda83753d), SPH_C32(0x281b6a23), - SPH_C32(0x07af84f9), SPH_C32(0x473af5ad), SPH_C32(0xb3a30000), - SPH_C32(0xe4370000), SPH_C32(0x78350012), SPH_C32(0xc6491800), - SPH_C32(0x3ba86be3), SPH_C32(0xc527aeae), SPH_C32(0x82f3286f), - SPH_C32(0xcdd86b83) }, - { SPH_C32(0x37140000), SPH_C32(0x92900000), SPH_C32(0xfe06003a), - SPH_C32(0xbf8c1800), SPH_C32(0x187f0724), SPH_C32(0x99cfea2e), - SPH_C32(0x2a7e7ebf), SPH_C32(0x630bbaba), SPH_C32(0xebe00000), - SPH_C32(0x64490000), SPH_C32(0x00060013), SPH_C32(0x00222000), - SPH_C32(0xdc9f373f), SPH_C32(0xbc8a9173), SPH_C32(0x2e80d600), - SPH_C32(0xf79c1232) }, - { SPH_C32(0x6f570000), SPH_C32(0x12ee0000), SPH_C32(0x8635003b), - SPH_C32(0x79e72000), SPH_C32(0xff485bf8), SPH_C32(0xe062d5f3), - SPH_C32(0x860d80d0), SPH_C32(0x594fc30b), SPH_C32(0xf6ba0000), - SPH_C32(0x4f3b0000), SPH_C32(0x488b0013), SPH_C32(0xaf433800), - SPH_C32(0xf95419fa), SPH_C32(0x74f32ea3), SPH_C32(0xaf22d229), - SPH_C32(0xe9e92494) }, - { SPH_C32(0x0bc20000), SPH_C32(0xdb630000), SPH_C32(0x7e88000c), - SPH_C32(0x15860000), SPH_C32(0x91fd48f3), SPH_C32(0x7581bb43), - SPH_C32(0xf460449e), SPH_C32(0xd8b61463), SPH_C32(0x835a0000), - SPH_C32(0xc4f70000), SPH_C32(0x01470022), SPH_C32(0xeec80000), - SPH_C32(0x60a54f69), SPH_C32(0x142f2a24), SPH_C32(0x5cf534f2), - SPH_C32(0x3ea660f7) }, - { SPH_C32(0x53810000), SPH_C32(0x5b1d0000), SPH_C32(0x06bb000d), - SPH_C32(0xd3ed3800), SPH_C32(0x76ca142f), SPH_C32(0x0c2c849e), - SPH_C32(0x5813baf1), SPH_C32(0xe2f26dd2), SPH_C32(0x9e000000), - SPH_C32(0xef850000), SPH_C32(0x49ca0022), SPH_C32(0x41a91800), - SPH_C32(0x456e61ac), SPH_C32(0xdc5695f4), SPH_C32(0xdd5730db), - SPH_C32(0x20d35651) }, - { SPH_C32(0x16980000), SPH_C32(0xf0110000), SPH_C32(0x3605000c), - SPH_C32(0xbae71800), SPH_C32(0xb4366636), SPH_C32(0xbdf80493), - SPH_C32(0x75c240b7), SPH_C32(0xc6c322c5), SPH_C32(0xc6430000), - SPH_C32(0x6ffb0000), SPH_C32(0x31f90023), SPH_C32(0x87c22000), - SPH_C32(0xa2593d70), SPH_C32(0xa5fbaa29), SPH_C32(0x7124ceb4), - SPH_C32(0x1a972fe0) }, - { SPH_C32(0x4edb0000), SPH_C32(0x706f0000), SPH_C32(0x4e36000d), - SPH_C32(0x7c8c2000), SPH_C32(0x53013aea), SPH_C32(0xc4553b4e), - SPH_C32(0xd9b1bed8), SPH_C32(0xfc875b74), SPH_C32(0xdb190000), - SPH_C32(0x44890000), SPH_C32(0x79740023), SPH_C32(0x28a33800), - SPH_C32(0x879213b5), SPH_C32(0x6d8215f9), SPH_C32(0xf086ca9d), - SPH_C32(0x04e21946) }, - { SPH_C32(0xaef90000), SPH_C32(0xcf450000), SPH_C32(0x30b80012), - SPH_C32(0x69280000), SPH_C32(0x1e634526), SPH_C32(0x0d5e117e), - SPH_C32(0x03512c46), SPH_C32(0xd3ad5d25), SPH_C32(0x84b70000), - SPH_C32(0x76a70000), SPH_C32(0x86330028), SPH_C32(0x79c50000), - SPH_C32(0x23d76cc7), SPH_C32(0x5ce84480), SPH_C32(0xa88d56d0), - SPH_C32(0xaed3d139) }, - { SPH_C32(0xf6ba0000), SPH_C32(0x4f3b0000), SPH_C32(0x488b0013), - SPH_C32(0xaf433800), SPH_C32(0xf95419fa), SPH_C32(0x74f32ea3), - SPH_C32(0xaf22d229), SPH_C32(0xe9e92494), SPH_C32(0x99ed0000), - SPH_C32(0x5dd50000), SPH_C32(0xcebe0028), SPH_C32(0xd6a41800), - SPH_C32(0x061c4202), SPH_C32(0x9491fb50), SPH_C32(0x292f52f9), - SPH_C32(0xb0a6e79f) }, - { SPH_C32(0xb3a30000), SPH_C32(0xe4370000), SPH_C32(0x78350012), - SPH_C32(0xc6491800), SPH_C32(0x3ba86be3), SPH_C32(0xc527aeae), - SPH_C32(0x82f3286f), SPH_C32(0xcdd86b83), SPH_C32(0xc1ae0000), - SPH_C32(0xddab0000), SPH_C32(0xb68d0029), SPH_C32(0x10cf2000), - SPH_C32(0xe12b1ede), SPH_C32(0xed3cc48d), SPH_C32(0x855cac96), - SPH_C32(0x8ae29e2e) }, - { SPH_C32(0xebe00000), SPH_C32(0x64490000), SPH_C32(0x00060013), - SPH_C32(0x00222000), SPH_C32(0xdc9f373f), SPH_C32(0xbc8a9173), - SPH_C32(0x2e80d600), SPH_C32(0xf79c1232), SPH_C32(0xdcf40000), - SPH_C32(0xf6d90000), SPH_C32(0xfe000029), SPH_C32(0xbfae3800), - SPH_C32(0xc4e0301b), SPH_C32(0x25457b5d), SPH_C32(0x04fea8bf), - SPH_C32(0x9497a888) }, - { SPH_C32(0x0c2f0000), SPH_C32(0x69330000), SPH_C32(0xf9fc0006), - SPH_C32(0x828b0000), SPH_C32(0xd28f6b5d), SPH_C32(0x3d46d5e7), - SPH_C32(0x001826bc), SPH_C32(0x48c3a5ad), SPH_C32(0x218c0000), - SPH_C32(0x62810000), SPH_C32(0xc8030036), SPH_C32(0x056b0000), - SPH_C32(0xac496112), SPH_C32(0x2437eebd), SPH_C32(0x5fbc3e08), - SPH_C32(0xa5c8987f) }, - { SPH_C32(0x546c0000), SPH_C32(0xe94d0000), SPH_C32(0x81cf0007), - SPH_C32(0x44e03800), SPH_C32(0x35b83781), SPH_C32(0x44ebea3a), - SPH_C32(0xac6bd8d3), SPH_C32(0x7287dc1c), SPH_C32(0x3cd60000), - SPH_C32(0x49f30000), SPH_C32(0x808e0036), SPH_C32(0xaa0a1800), - SPH_C32(0x89824fd7), SPH_C32(0xec4e516d), SPH_C32(0xde1e3a21), - SPH_C32(0xbbbdaed9) }, - { SPH_C32(0x11750000), SPH_C32(0x42410000), SPH_C32(0xb1710006), - SPH_C32(0x2dea1800), SPH_C32(0xf7444598), SPH_C32(0xf53f6a37), - SPH_C32(0x81ba2295), SPH_C32(0x56b6930b), SPH_C32(0x64950000), - SPH_C32(0xc98d0000), SPH_C32(0xf8bd0037), SPH_C32(0x6c612000), - SPH_C32(0x6eb5130b), SPH_C32(0x95e36eb0), SPH_C32(0x726dc44e), - SPH_C32(0x81f9d768) }, - { SPH_C32(0x49360000), SPH_C32(0xc23f0000), SPH_C32(0xc9420007), - SPH_C32(0xeb812000), SPH_C32(0x10731944), SPH_C32(0x8c9255ea), - SPH_C32(0x2dc9dcfa), SPH_C32(0x6cf2eaba), SPH_C32(0x79cf0000), - SPH_C32(0xe2ff0000), SPH_C32(0xb0300037), SPH_C32(0xc3003800), - SPH_C32(0x4b7e3dce), SPH_C32(0x5d9ad160), SPH_C32(0xf3cfc067), - SPH_C32(0x9f8ce1ce) }, - { SPH_C32(0xa9140000), SPH_C32(0x7d150000), SPH_C32(0xb7cc0018), - SPH_C32(0xfe250000), SPH_C32(0x5d116688), SPH_C32(0x45997fda), - SPH_C32(0xf7294e64), SPH_C32(0x43d8eceb), SPH_C32(0x26610000), - SPH_C32(0xd0d10000), SPH_C32(0x4f77003c), SPH_C32(0x92660000), - SPH_C32(0xef3b42bc), SPH_C32(0x6cf08019), SPH_C32(0xabc45c2a), - SPH_C32(0x35bd29b1) }, - { SPH_C32(0xf1570000), SPH_C32(0xfd6b0000), SPH_C32(0xcfff0019), - SPH_C32(0x384e3800), SPH_C32(0xba263a54), SPH_C32(0x3c344007), - SPH_C32(0x5b5ab00b), SPH_C32(0x799c955a), SPH_C32(0x3b3b0000), - SPH_C32(0xfba30000), SPH_C32(0x07fa003c), SPH_C32(0x3d071800), - SPH_C32(0xcaf06c79), SPH_C32(0xa4893fc9), SPH_C32(0x2a665803), - SPH_C32(0x2bc81f17) }, - { SPH_C32(0xb44e0000), SPH_C32(0x56670000), SPH_C32(0xff410018), - SPH_C32(0x51441800), SPH_C32(0x78da484d), SPH_C32(0x8de0c00a), - SPH_C32(0x768b4a4d), SPH_C32(0x5dadda4d), SPH_C32(0x63780000), - SPH_C32(0x7bdd0000), SPH_C32(0x7fc9003d), SPH_C32(0xfb6c2000), - SPH_C32(0x2dc730a5), SPH_C32(0xdd240014), SPH_C32(0x8615a66c), - SPH_C32(0x118c66a6) }, - { SPH_C32(0xec0d0000), SPH_C32(0xd6190000), SPH_C32(0x87720019), - SPH_C32(0x972f2000), SPH_C32(0x9fed1491), SPH_C32(0xf44dffd7), - SPH_C32(0xdaf8b422), SPH_C32(0x67e9a3fc), SPH_C32(0x7e220000), - SPH_C32(0x50af0000), SPH_C32(0x3744003d), SPH_C32(0x540d3800), - SPH_C32(0x080c1e60), SPH_C32(0x155dbfc4), SPH_C32(0x07b7a245), - SPH_C32(0x0ff95000) }, - { SPH_C32(0x835a0000), SPH_C32(0xc4f70000), SPH_C32(0x01470022), - SPH_C32(0xeec80000), SPH_C32(0x60a54f69), SPH_C32(0x142f2a24), - SPH_C32(0x5cf534f2), SPH_C32(0x3ea660f7), SPH_C32(0x88980000), - SPH_C32(0x1f940000), SPH_C32(0x7fcf002e), SPH_C32(0xfb4e0000), - SPH_C32(0xf158079a), SPH_C32(0x61ae9167), SPH_C32(0xa895706c), - SPH_C32(0xe6107494) }, - { SPH_C32(0xdb190000), SPH_C32(0x44890000), SPH_C32(0x79740023), - SPH_C32(0x28a33800), SPH_C32(0x879213b5), SPH_C32(0x6d8215f9), - SPH_C32(0xf086ca9d), SPH_C32(0x04e21946), SPH_C32(0x95c20000), - SPH_C32(0x34e60000), SPH_C32(0x3742002e), SPH_C32(0x542f1800), - SPH_C32(0xd493295f), SPH_C32(0xa9d72eb7), SPH_C32(0x29377445), - SPH_C32(0xf8654232) }, - { SPH_C32(0x9e000000), SPH_C32(0xef850000), SPH_C32(0x49ca0022), - SPH_C32(0x41a91800), SPH_C32(0x456e61ac), SPH_C32(0xdc5695f4), - SPH_C32(0xdd5730db), SPH_C32(0x20d35651), SPH_C32(0xcd810000), - SPH_C32(0xb4980000), SPH_C32(0x4f71002f), SPH_C32(0x92442000), - SPH_C32(0x33a47583), SPH_C32(0xd07a116a), SPH_C32(0x85448a2a), - SPH_C32(0xc2213b83) }, - { SPH_C32(0xc6430000), SPH_C32(0x6ffb0000), SPH_C32(0x31f90023), - SPH_C32(0x87c22000), SPH_C32(0xa2593d70), SPH_C32(0xa5fbaa29), - SPH_C32(0x7124ceb4), SPH_C32(0x1a972fe0), SPH_C32(0xd0db0000), - SPH_C32(0x9fea0000), SPH_C32(0x07fc002f), SPH_C32(0x3d253800), - SPH_C32(0x166f5b46), SPH_C32(0x1803aeba), SPH_C32(0x04e68e03), - SPH_C32(0xdc540d25) }, - { SPH_C32(0x26610000), SPH_C32(0xd0d10000), SPH_C32(0x4f77003c), - SPH_C32(0x92660000), SPH_C32(0xef3b42bc), SPH_C32(0x6cf08019), - SPH_C32(0xabc45c2a), SPH_C32(0x35bd29b1), SPH_C32(0x8f750000), - SPH_C32(0xadc40000), SPH_C32(0xf8bb0024), SPH_C32(0x6c430000), - SPH_C32(0xb22a2434), SPH_C32(0x2969ffc3), SPH_C32(0x5ced124e), - SPH_C32(0x7665c55a) }, - { SPH_C32(0x7e220000), SPH_C32(0x50af0000), SPH_C32(0x3744003d), - SPH_C32(0x540d3800), SPH_C32(0x080c1e60), SPH_C32(0x155dbfc4), - SPH_C32(0x07b7a245), SPH_C32(0x0ff95000), SPH_C32(0x922f0000), - SPH_C32(0x86b60000), SPH_C32(0xb0360024), SPH_C32(0xc3221800), - SPH_C32(0x97e10af1), SPH_C32(0xe1104013), SPH_C32(0xdd4f1667), - SPH_C32(0x6810f3fc) }, - { SPH_C32(0x3b3b0000), SPH_C32(0xfba30000), SPH_C32(0x07fa003c), - SPH_C32(0x3d071800), SPH_C32(0xcaf06c79), SPH_C32(0xa4893fc9), - SPH_C32(0x2a665803), SPH_C32(0x2bc81f17), SPH_C32(0xca6c0000), - SPH_C32(0x06c80000), SPH_C32(0xc8050025), SPH_C32(0x05492000), - SPH_C32(0x70d6562d), SPH_C32(0x98bd7fce), SPH_C32(0x713ce808), - SPH_C32(0x52548a4d) }, - { SPH_C32(0x63780000), SPH_C32(0x7bdd0000), SPH_C32(0x7fc9003d), - SPH_C32(0xfb6c2000), SPH_C32(0x2dc730a5), SPH_C32(0xdd240014), - SPH_C32(0x8615a66c), SPH_C32(0x118c66a6), SPH_C32(0xd7360000), - SPH_C32(0x2dba0000), SPH_C32(0x80880025), SPH_C32(0xaa283800), - SPH_C32(0x551d78e8), SPH_C32(0x50c4c01e), SPH_C32(0xf09eec21), - SPH_C32(0x4c21bceb) }, - { SPH_C32(0x84b70000), SPH_C32(0x76a70000), SPH_C32(0x86330028), - SPH_C32(0x79c50000), SPH_C32(0x23d76cc7), SPH_C32(0x5ce84480), - SPH_C32(0xa88d56d0), SPH_C32(0xaed3d139), SPH_C32(0x2a4e0000), - SPH_C32(0xb9e20000), SPH_C32(0xb68b003a), SPH_C32(0x10ed0000), - SPH_C32(0x3db429e1), SPH_C32(0x51b655fe), SPH_C32(0xabdc7a96), - SPH_C32(0x7d7e8c1c) }, - { SPH_C32(0xdcf40000), SPH_C32(0xf6d90000), SPH_C32(0xfe000029), - SPH_C32(0xbfae3800), SPH_C32(0xc4e0301b), SPH_C32(0x25457b5d), - SPH_C32(0x04fea8bf), SPH_C32(0x9497a888), SPH_C32(0x37140000), - SPH_C32(0x92900000), SPH_C32(0xfe06003a), SPH_C32(0xbf8c1800), - SPH_C32(0x187f0724), SPH_C32(0x99cfea2e), SPH_C32(0x2a7e7ebf), - SPH_C32(0x630bbaba) }, - { SPH_C32(0x99ed0000), SPH_C32(0x5dd50000), SPH_C32(0xcebe0028), - SPH_C32(0xd6a41800), SPH_C32(0x061c4202), SPH_C32(0x9491fb50), - SPH_C32(0x292f52f9), SPH_C32(0xb0a6e79f), SPH_C32(0x6f570000), - SPH_C32(0x12ee0000), SPH_C32(0x8635003b), SPH_C32(0x79e72000), - SPH_C32(0xff485bf8), SPH_C32(0xe062d5f3), SPH_C32(0x860d80d0), - SPH_C32(0x594fc30b) }, - { SPH_C32(0xc1ae0000), SPH_C32(0xddab0000), SPH_C32(0xb68d0029), - SPH_C32(0x10cf2000), SPH_C32(0xe12b1ede), SPH_C32(0xed3cc48d), - SPH_C32(0x855cac96), SPH_C32(0x8ae29e2e), SPH_C32(0x720d0000), - SPH_C32(0x399c0000), SPH_C32(0xceb8003b), SPH_C32(0xd6863800), - SPH_C32(0xda83753d), SPH_C32(0x281b6a23), SPH_C32(0x07af84f9), - SPH_C32(0x473af5ad) }, - { SPH_C32(0x218c0000), SPH_C32(0x62810000), SPH_C32(0xc8030036), - SPH_C32(0x056b0000), SPH_C32(0xac496112), SPH_C32(0x2437eebd), - SPH_C32(0x5fbc3e08), SPH_C32(0xa5c8987f), SPH_C32(0x2da30000), - SPH_C32(0x0bb20000), SPH_C32(0x31ff0030), SPH_C32(0x87e00000), - SPH_C32(0x7ec60a4f), SPH_C32(0x19713b5a), SPH_C32(0x5fa418b4), - SPH_C32(0xed0b3dd2) }, - { SPH_C32(0x79cf0000), SPH_C32(0xe2ff0000), SPH_C32(0xb0300037), - SPH_C32(0xc3003800), SPH_C32(0x4b7e3dce), SPH_C32(0x5d9ad160), - SPH_C32(0xf3cfc067), SPH_C32(0x9f8ce1ce), SPH_C32(0x30f90000), - SPH_C32(0x20c00000), SPH_C32(0x79720030), SPH_C32(0x28811800), - SPH_C32(0x5b0d248a), SPH_C32(0xd108848a), SPH_C32(0xde061c9d), - SPH_C32(0xf37e0b74) }, - { SPH_C32(0x3cd60000), SPH_C32(0x49f30000), SPH_C32(0x808e0036), - SPH_C32(0xaa0a1800), SPH_C32(0x89824fd7), SPH_C32(0xec4e516d), - SPH_C32(0xde1e3a21), SPH_C32(0xbbbdaed9), SPH_C32(0x68ba0000), - SPH_C32(0xa0be0000), SPH_C32(0x01410031), SPH_C32(0xeeea2000), - SPH_C32(0xbc3a7856), SPH_C32(0xa8a5bb57), SPH_C32(0x7275e2f2), - SPH_C32(0xc93a72c5) }, - { SPH_C32(0x64950000), SPH_C32(0xc98d0000), SPH_C32(0xf8bd0037), - SPH_C32(0x6c612000), SPH_C32(0x6eb5130b), SPH_C32(0x95e36eb0), - SPH_C32(0x726dc44e), SPH_C32(0x81f9d768), SPH_C32(0x75e00000), - SPH_C32(0x8bcc0000), SPH_C32(0x49cc0031), SPH_C32(0x418b3800), - SPH_C32(0x99f15693), SPH_C32(0x60dc0487), SPH_C32(0xf3d7e6db), - SPH_C32(0xd74f4463) }, - { SPH_C32(0x52500000), SPH_C32(0x29540000), SPH_C32(0x6a61004e), - SPH_C32(0xf0ff0000), SPH_C32(0x9a317eec), SPH_C32(0x452341ce), - SPH_C32(0xcf568fe5), SPH_C32(0x5303130f), SPH_C32(0x538d0000), - SPH_C32(0xa9fc0000), SPH_C32(0x9ef70006), SPH_C32(0x56ff0000), - SPH_C32(0x0ae4004e), SPH_C32(0x92c5cdf9), SPH_C32(0xa9444018), - SPH_C32(0x7f975691) }, - { SPH_C32(0x0a130000), SPH_C32(0xa92a0000), SPH_C32(0x1252004f), - SPH_C32(0x36943800), SPH_C32(0x7d062230), SPH_C32(0x3c8e7e13), - SPH_C32(0x6325718a), SPH_C32(0x69476abe), SPH_C32(0x4ed70000), - SPH_C32(0x828e0000), SPH_C32(0xd67a0006), SPH_C32(0xf99e1800), - SPH_C32(0x2f2f2e8b), SPH_C32(0x5abc7229), SPH_C32(0x28e64431), - SPH_C32(0x61e26037) }, - { SPH_C32(0x4f0a0000), SPH_C32(0x02260000), SPH_C32(0x22ec004e), - SPH_C32(0x5f9e1800), SPH_C32(0xbffa5029), SPH_C32(0x8d5afe1e), - SPH_C32(0x4ef48bcc), SPH_C32(0x4d7625a9), SPH_C32(0x16940000), - SPH_C32(0x02f00000), SPH_C32(0xae490007), SPH_C32(0x3ff52000), - SPH_C32(0xc8187257), SPH_C32(0x23114df4), SPH_C32(0x8495ba5e), - SPH_C32(0x5ba61986) }, - { SPH_C32(0x17490000), SPH_C32(0x82580000), SPH_C32(0x5adf004f), - SPH_C32(0x99f52000), SPH_C32(0x58cd0cf5), SPH_C32(0xf4f7c1c3), - SPH_C32(0xe28775a3), SPH_C32(0x77325c18), SPH_C32(0x0bce0000), - SPH_C32(0x29820000), SPH_C32(0xe6c40007), SPH_C32(0x90943800), - SPH_C32(0xedd35c92), SPH_C32(0xeb68f224), SPH_C32(0x0537be77), - SPH_C32(0x45d32f20) }, - { SPH_C32(0xf76b0000), SPH_C32(0x3d720000), SPH_C32(0x24510050), - SPH_C32(0x8c510000), SPH_C32(0x15af7339), SPH_C32(0x3dfcebf3), - SPH_C32(0x3867e73d), SPH_C32(0x58185a49), SPH_C32(0x54600000), - SPH_C32(0x1bac0000), SPH_C32(0x1983000c), SPH_C32(0xc1f20000), - SPH_C32(0x499623e0), SPH_C32(0xda02a35d), SPH_C32(0x5d3c223a), - SPH_C32(0xefe2e75f) }, - { SPH_C32(0xaf280000), SPH_C32(0xbd0c0000), SPH_C32(0x5c620051), - SPH_C32(0x4a3a3800), SPH_C32(0xf2982fe5), SPH_C32(0x4451d42e), - SPH_C32(0x94141952), SPH_C32(0x625c23f8), SPH_C32(0x493a0000), - SPH_C32(0x30de0000), SPH_C32(0x510e000c), SPH_C32(0x6e931800), - SPH_C32(0x6c5d0d25), SPH_C32(0x127b1c8d), SPH_C32(0xdc9e2613), - SPH_C32(0xf197d1f9) }, - { SPH_C32(0xea310000), SPH_C32(0x16000000), SPH_C32(0x6cdc0050), - SPH_C32(0x23301800), SPH_C32(0x30645dfc), SPH_C32(0xf5855423), - SPH_C32(0xb9c5e314), SPH_C32(0x466d6cef), SPH_C32(0x11790000), - SPH_C32(0xb0a00000), SPH_C32(0x293d000d), SPH_C32(0xa8f82000), - SPH_C32(0x8b6a51f9), SPH_C32(0x6bd62350), SPH_C32(0x70edd87c), - SPH_C32(0xcbd3a848) }, - { SPH_C32(0xb2720000), SPH_C32(0x967e0000), SPH_C32(0x14ef0051), - SPH_C32(0xe55b2000), SPH_C32(0xd7530120), SPH_C32(0x8c286bfe), - SPH_C32(0x15b61d7b), SPH_C32(0x7c29155e), SPH_C32(0x0c230000), - SPH_C32(0x9bd20000), SPH_C32(0x61b0000d), SPH_C32(0x07993800), - SPH_C32(0xaea17f3c), SPH_C32(0xa3af9c80), SPH_C32(0xf14fdc55), - SPH_C32(0xd5a69eee) }, - { SPH_C32(0x55bd0000), SPH_C32(0x9b040000), SPH_C32(0xed150044), - SPH_C32(0x67f20000), SPH_C32(0xd9435d42), SPH_C32(0x0de42f6a), - SPH_C32(0x3b2eedc7), SPH_C32(0xc376a2c1), SPH_C32(0xf15b0000), - SPH_C32(0x0f8a0000), SPH_C32(0x57b30012), SPH_C32(0xbd5c0000), - SPH_C32(0xc6082e35), SPH_C32(0xa2dd0960), SPH_C32(0xaa0d4ae2), - SPH_C32(0xe4f9ae19) }, - { SPH_C32(0x0dfe0000), SPH_C32(0x1b7a0000), SPH_C32(0x95260045), - SPH_C32(0xa1993800), SPH_C32(0x3e74019e), SPH_C32(0x744910b7), - SPH_C32(0x975d13a8), SPH_C32(0xf932db70), SPH_C32(0xec010000), - SPH_C32(0x24f80000), SPH_C32(0x1f3e0012), SPH_C32(0x123d1800), - SPH_C32(0xe3c300f0), SPH_C32(0x6aa4b6b0), SPH_C32(0x2baf4ecb), - SPH_C32(0xfa8c98bf) }, - { SPH_C32(0x48e70000), SPH_C32(0xb0760000), SPH_C32(0xa5980044), - SPH_C32(0xc8931800), SPH_C32(0xfc887387), SPH_C32(0xc59d90ba), - SPH_C32(0xba8ce9ee), SPH_C32(0xdd039467), SPH_C32(0xb4420000), - SPH_C32(0xa4860000), SPH_C32(0x670d0013), SPH_C32(0xd4562000), - SPH_C32(0x04f45c2c), SPH_C32(0x1309896d), SPH_C32(0x87dcb0a4), - SPH_C32(0xc0c8e10e) }, - { SPH_C32(0x10a40000), SPH_C32(0x30080000), SPH_C32(0xddab0045), - SPH_C32(0x0ef82000), SPH_C32(0x1bbf2f5b), SPH_C32(0xbc30af67), - SPH_C32(0x16ff1781), SPH_C32(0xe747edd6), SPH_C32(0xa9180000), - SPH_C32(0x8ff40000), SPH_C32(0x2f800013), SPH_C32(0x7b373800), - SPH_C32(0x213f72e9), SPH_C32(0xdb7036bd), SPH_C32(0x067eb48d), - SPH_C32(0xdebdd7a8) }, - { SPH_C32(0xf0860000), SPH_C32(0x8f220000), SPH_C32(0xa325005a), - SPH_C32(0x1b5c0000), SPH_C32(0x56dd5097), SPH_C32(0x753b8557), - SPH_C32(0xcc1f851f), SPH_C32(0xc86deb87), SPH_C32(0xf6b60000), - SPH_C32(0xbdda0000), SPH_C32(0xd0c70018), SPH_C32(0x2a510000), - SPH_C32(0x857a0d9b), SPH_C32(0xea1a67c4), SPH_C32(0x5e7528c0), - SPH_C32(0x748c1fd7) }, - { SPH_C32(0xa8c50000), SPH_C32(0x0f5c0000), SPH_C32(0xdb16005b), - SPH_C32(0xdd373800), SPH_C32(0xb1ea0c4b), SPH_C32(0x0c96ba8a), - SPH_C32(0x606c7b70), SPH_C32(0xf2299236), SPH_C32(0xebec0000), - SPH_C32(0x96a80000), SPH_C32(0x984a0018), SPH_C32(0x85301800), - SPH_C32(0xa0b1235e), SPH_C32(0x2263d814), SPH_C32(0xdfd72ce9), - SPH_C32(0x6af92971) }, - { SPH_C32(0xeddc0000), SPH_C32(0xa4500000), SPH_C32(0xeba8005a), - SPH_C32(0xb43d1800), SPH_C32(0x73167e52), SPH_C32(0xbd423a87), - SPH_C32(0x4dbd8136), SPH_C32(0xd618dd21), SPH_C32(0xb3af0000), - SPH_C32(0x16d60000), SPH_C32(0xe0790019), SPH_C32(0x435b2000), - SPH_C32(0x47867f82), SPH_C32(0x5bcee7c9), SPH_C32(0x73a4d286), - SPH_C32(0x50bd50c0) }, - { SPH_C32(0xb59f0000), SPH_C32(0x242e0000), SPH_C32(0x939b005b), - SPH_C32(0x72562000), SPH_C32(0x9421228e), SPH_C32(0xc4ef055a), - SPH_C32(0xe1ce7f59), SPH_C32(0xec5ca490), SPH_C32(0xaef50000), - SPH_C32(0x3da40000), SPH_C32(0xa8f40019), SPH_C32(0xec3a3800), - SPH_C32(0x624d5147), SPH_C32(0x93b75819), SPH_C32(0xf206d6af), - SPH_C32(0x4ec86666) }, - { SPH_C32(0xdac80000), SPH_C32(0x36c00000), SPH_C32(0x15ae0060), - SPH_C32(0x0bb10000), SPH_C32(0x6b697976), SPH_C32(0x248dd0a9), - SPH_C32(0x67c3ff89), SPH_C32(0xb513679b), SPH_C32(0x584f0000), - SPH_C32(0x729f0000), SPH_C32(0xe07f000a), SPH_C32(0x43790000), - SPH_C32(0x9b1948bd), SPH_C32(0xe74476ba), SPH_C32(0x5d240486), - SPH_C32(0xa72142f2) }, - { SPH_C32(0x828b0000), SPH_C32(0xb6be0000), SPH_C32(0x6d9d0061), - SPH_C32(0xcdda3800), SPH_C32(0x8c5e25aa), SPH_C32(0x5d20ef74), - SPH_C32(0xcbb001e6), SPH_C32(0x8f571e2a), SPH_C32(0x45150000), - SPH_C32(0x59ed0000), SPH_C32(0xa8f2000a), SPH_C32(0xec181800), - SPH_C32(0xbed26678), SPH_C32(0x2f3dc96a), SPH_C32(0xdc8600af), - SPH_C32(0xb9547454) }, - { SPH_C32(0xc7920000), SPH_C32(0x1db20000), SPH_C32(0x5d230060), - SPH_C32(0xa4d01800), SPH_C32(0x4ea257b3), SPH_C32(0xecf46f79), - SPH_C32(0xe661fba0), SPH_C32(0xab66513d), SPH_C32(0x1d560000), - SPH_C32(0xd9930000), SPH_C32(0xd0c1000b), SPH_C32(0x2a732000), - SPH_C32(0x59e53aa4), SPH_C32(0x5690f6b7), SPH_C32(0x70f5fec0), - SPH_C32(0x83100de5) }, - { SPH_C32(0x9fd10000), SPH_C32(0x9dcc0000), SPH_C32(0x25100061), - SPH_C32(0x62bb2000), SPH_C32(0xa9950b6f), SPH_C32(0x955950a4), - SPH_C32(0x4a1205cf), SPH_C32(0x9122288c), SPH_C32(0x000c0000), - SPH_C32(0xf2e10000), SPH_C32(0x984c000b), SPH_C32(0x85123800), - SPH_C32(0x7c2e1461), SPH_C32(0x9ee94967), SPH_C32(0xf157fae9), - SPH_C32(0x9d653b43) }, - { SPH_C32(0x7ff30000), SPH_C32(0x22e60000), SPH_C32(0x5b9e007e), - SPH_C32(0x771f0000), SPH_C32(0xe4f774a3), SPH_C32(0x5c527a94), - SPH_C32(0x90f29751), SPH_C32(0xbe082edd), SPH_C32(0x5fa20000), - SPH_C32(0xc0cf0000), SPH_C32(0x670b0000), SPH_C32(0xd4740000), - SPH_C32(0xd86b6b13), SPH_C32(0xaf83181e), SPH_C32(0xa95c66a4), - SPH_C32(0x3754f33c) }, - { SPH_C32(0x27b00000), SPH_C32(0xa2980000), SPH_C32(0x23ad007f), - SPH_C32(0xb1743800), SPH_C32(0x03c0287f), SPH_C32(0x25ff4549), - SPH_C32(0x3c81693e), SPH_C32(0x844c576c), SPH_C32(0x42f80000), - SPH_C32(0xebbd0000), SPH_C32(0x2f860000), SPH_C32(0x7b151800), - SPH_C32(0xfda045d6), SPH_C32(0x67faa7ce), SPH_C32(0x28fe628d), - SPH_C32(0x2921c59a) }, - { SPH_C32(0x62a90000), SPH_C32(0x09940000), SPH_C32(0x1313007e), - SPH_C32(0xd87e1800), SPH_C32(0xc13c5a66), SPH_C32(0x942bc544), - SPH_C32(0x11509378), SPH_C32(0xa07d187b), SPH_C32(0x1abb0000), - SPH_C32(0x6bc30000), SPH_C32(0x57b50001), SPH_C32(0xbd7e2000), - SPH_C32(0x1a97190a), SPH_C32(0x1e579813), SPH_C32(0x848d9ce2), - SPH_C32(0x1365bc2b) }, - { SPH_C32(0x3aea0000), SPH_C32(0x89ea0000), SPH_C32(0x6b20007f), - SPH_C32(0x1e152000), SPH_C32(0x260b06ba), SPH_C32(0xed86fa99), - SPH_C32(0xbd236d17), SPH_C32(0x9a3961ca), SPH_C32(0x07e10000), - SPH_C32(0x40b10000), SPH_C32(0x1f380001), SPH_C32(0x121f3800), - SPH_C32(0x3f5c37cf), SPH_C32(0xd62e27c3), SPH_C32(0x052f98cb), - SPH_C32(0x0d108a8d) }, - { SPH_C32(0xdd250000), SPH_C32(0x84900000), SPH_C32(0x92da006a), - SPH_C32(0x9cbc0000), SPH_C32(0x281b5ad8), SPH_C32(0x6c4abe0d), - SPH_C32(0x93bb9dab), SPH_C32(0x2566d655), SPH_C32(0xfa990000), - SPH_C32(0xd4e90000), SPH_C32(0x293b001e), SPH_C32(0xa8da0000), - SPH_C32(0x57f566c6), SPH_C32(0xd75cb223), SPH_C32(0x5e6d0e7c), - SPH_C32(0x3c4fba7a) }, - { SPH_C32(0x85660000), SPH_C32(0x04ee0000), SPH_C32(0xeae9006b), - SPH_C32(0x5ad73800), SPH_C32(0xcf2c0604), SPH_C32(0x15e781d0), - SPH_C32(0x3fc863c4), SPH_C32(0x1f22afe4), SPH_C32(0xe7c30000), - SPH_C32(0xff9b0000), SPH_C32(0x61b6001e), SPH_C32(0x07bb1800), - SPH_C32(0x723e4803), SPH_C32(0x1f250df3), SPH_C32(0xdfcf0a55), - SPH_C32(0x223a8cdc) }, - { SPH_C32(0xc07f0000), SPH_C32(0xafe20000), SPH_C32(0xda57006a), - SPH_C32(0x33dd1800), SPH_C32(0x0dd0741d), SPH_C32(0xa43301dd), - SPH_C32(0x12199982), SPH_C32(0x3b13e0f3), SPH_C32(0xbf800000), - SPH_C32(0x7fe50000), SPH_C32(0x1985001f), SPH_C32(0xc1d02000), - SPH_C32(0x950914df), SPH_C32(0x6688322e), SPH_C32(0x73bcf43a), - SPH_C32(0x187ef56d) }, - { SPH_C32(0x983c0000), SPH_C32(0x2f9c0000), SPH_C32(0xa264006b), - SPH_C32(0xf5b62000), SPH_C32(0xeae728c1), SPH_C32(0xdd9e3e00), - SPH_C32(0xbe6a67ed), SPH_C32(0x01579942), SPH_C32(0xa2da0000), - SPH_C32(0x54970000), SPH_C32(0x5108001f), SPH_C32(0x6eb13800), - SPH_C32(0xb0c23a1a), SPH_C32(0xaef18dfe), SPH_C32(0xf21ef013), - SPH_C32(0x060bc3cb) }, - { SPH_C32(0x781e0000), SPH_C32(0x90b60000), SPH_C32(0xdcea0074), - SPH_C32(0xe0120000), SPH_C32(0xa785570d), SPH_C32(0x14951430), - SPH_C32(0x648af573), SPH_C32(0x2e7d9f13), SPH_C32(0xfd740000), - SPH_C32(0x66b90000), SPH_C32(0xae4f0014), SPH_C32(0x3fd70000), - SPH_C32(0x14874568), SPH_C32(0x9f9bdc87), SPH_C32(0xaa156c5e), - SPH_C32(0xac3a0bb4) }, - { SPH_C32(0x205d0000), SPH_C32(0x10c80000), SPH_C32(0xa4d90075), - SPH_C32(0x26793800), SPH_C32(0x40b20bd1), SPH_C32(0x6d382bed), - SPH_C32(0xc8f90b1c), SPH_C32(0x1439e6a2), SPH_C32(0xe02e0000), - SPH_C32(0x4dcb0000), SPH_C32(0xe6c20014), SPH_C32(0x90b61800), - SPH_C32(0x314c6bad), SPH_C32(0x57e26357), SPH_C32(0x2bb76877), - SPH_C32(0xb24f3d12) }, - { SPH_C32(0x65440000), SPH_C32(0xbbc40000), SPH_C32(0x94670074), - SPH_C32(0x4f731800), SPH_C32(0x824e79c8), SPH_C32(0xdcecabe0), - SPH_C32(0xe528f15a), SPH_C32(0x3008a9b5), SPH_C32(0xb86d0000), - SPH_C32(0xcdb50000), SPH_C32(0x9ef10015), SPH_C32(0x56dd2000), - SPH_C32(0xd67b3771), SPH_C32(0x2e4f5c8a), SPH_C32(0x87c49618), - SPH_C32(0x880b44a3) }, - { SPH_C32(0x3d070000), SPH_C32(0x3bba0000), SPH_C32(0xec540075), - SPH_C32(0x89182000), SPH_C32(0x65792514), SPH_C32(0xa541943d), - SPH_C32(0x495b0f35), SPH_C32(0x0a4cd004), SPH_C32(0xa5370000), - SPH_C32(0xe6c70000), SPH_C32(0xd67c0015), SPH_C32(0xf9bc3800), - SPH_C32(0xf3b019b4), SPH_C32(0xe636e35a), SPH_C32(0x06669231), - SPH_C32(0x967e7205) }, - { SPH_C32(0x59920000), SPH_C32(0xf2370000), SPH_C32(0x14e90042), - SPH_C32(0xe5790000), SPH_C32(0x0bcc361f), SPH_C32(0x30a2fa8d), - SPH_C32(0x3b36cb7b), SPH_C32(0x8bb5076c), SPH_C32(0xd0d70000), - SPH_C32(0x6d0b0000), SPH_C32(0x9fb00024), SPH_C32(0xb8370000), - SPH_C32(0x6a414f27), SPH_C32(0x86eae7dd), SPH_C32(0xf5b174ea), - SPH_C32(0x41313666) }, - { SPH_C32(0x01d10000), SPH_C32(0x72490000), SPH_C32(0x6cda0043), - SPH_C32(0x23123800), SPH_C32(0xecfb6ac3), SPH_C32(0x490fc550), - SPH_C32(0x97453514), SPH_C32(0xb1f17edd), SPH_C32(0xcd8d0000), - SPH_C32(0x46790000), SPH_C32(0xd73d0024), SPH_C32(0x17561800), - SPH_C32(0x4f8a61e2), SPH_C32(0x4e93580d), SPH_C32(0x741370c3), - SPH_C32(0x5f4400c0) }, - { SPH_C32(0x44c80000), SPH_C32(0xd9450000), SPH_C32(0x5c640042), - SPH_C32(0x4a181800), SPH_C32(0x2e0718da), SPH_C32(0xf8db455d), - SPH_C32(0xba94cf52), SPH_C32(0x95c031ca), SPH_C32(0x95ce0000), - SPH_C32(0xc6070000), SPH_C32(0xaf0e0025), SPH_C32(0xd13d2000), - SPH_C32(0xa8bd3d3e), SPH_C32(0x373e67d0), SPH_C32(0xd8608eac), - SPH_C32(0x65007971) }, - { SPH_C32(0x1c8b0000), SPH_C32(0x593b0000), SPH_C32(0x24570043), - SPH_C32(0x8c732000), SPH_C32(0xc9304406), SPH_C32(0x81767a80), - SPH_C32(0x16e7313d), SPH_C32(0xaf84487b), SPH_C32(0x88940000), - SPH_C32(0xed750000), SPH_C32(0xe7830025), SPH_C32(0x7e5c3800), - SPH_C32(0x8d7613fb), SPH_C32(0xff47d800), SPH_C32(0x59c28a85), - SPH_C32(0x7b754fd7) }, - { SPH_C32(0xfca90000), SPH_C32(0xe6110000), SPH_C32(0x5ad9005c), - SPH_C32(0x99d70000), SPH_C32(0x84523bca), SPH_C32(0x487d50b0), - SPH_C32(0xcc07a3a3), SPH_C32(0x80ae4e2a), SPH_C32(0xd73a0000), - SPH_C32(0xdf5b0000), SPH_C32(0x18c4002e), SPH_C32(0x2f3a0000), - SPH_C32(0x29336c89), SPH_C32(0xce2d8979), SPH_C32(0x01c916c8), - SPH_C32(0xd14487a8) }, - { SPH_C32(0xa4ea0000), SPH_C32(0x666f0000), SPH_C32(0x22ea005d), - SPH_C32(0x5fbc3800), SPH_C32(0x63656716), SPH_C32(0x31d06f6d), - SPH_C32(0x60745dcc), SPH_C32(0xbaea379b), SPH_C32(0xca600000), - SPH_C32(0xf4290000), SPH_C32(0x5049002e), SPH_C32(0x805b1800), - SPH_C32(0x0cf8424c), SPH_C32(0x065436a9), SPH_C32(0x806b12e1), - SPH_C32(0xcf31b10e) }, - { SPH_C32(0xe1f30000), SPH_C32(0xcd630000), SPH_C32(0x1254005c), - SPH_C32(0x36b61800), SPH_C32(0xa199150f), SPH_C32(0x8004ef60), - SPH_C32(0x4da5a78a), SPH_C32(0x9edb788c), SPH_C32(0x92230000), - SPH_C32(0x74570000), SPH_C32(0x287a002f), SPH_C32(0x46302000), - SPH_C32(0xebcf1e90), SPH_C32(0x7ff90974), SPH_C32(0x2c18ec8e), - SPH_C32(0xf575c8bf) }, - { SPH_C32(0xb9b00000), SPH_C32(0x4d1d0000), SPH_C32(0x6a67005d), - SPH_C32(0xf0dd2000), SPH_C32(0x46ae49d3), SPH_C32(0xf9a9d0bd), - SPH_C32(0xe1d659e5), SPH_C32(0xa49f013d), SPH_C32(0x8f790000), - SPH_C32(0x5f250000), SPH_C32(0x60f7002f), SPH_C32(0xe9513800), - SPH_C32(0xce043055), SPH_C32(0xb780b6a4), SPH_C32(0xadbae8a7), - SPH_C32(0xeb00fe19) }, - { SPH_C32(0x5e7f0000), SPH_C32(0x40670000), SPH_C32(0x939d0048), - SPH_C32(0x72740000), SPH_C32(0x48be15b1), SPH_C32(0x78659429), - SPH_C32(0xcf4ea959), SPH_C32(0x1bc0b6a2), SPH_C32(0x72010000), - SPH_C32(0xcb7d0000), SPH_C32(0x56f40030), SPH_C32(0x53940000), - SPH_C32(0xa6ad615c), SPH_C32(0xb6f22344), SPH_C32(0xf6f87e10), - SPH_C32(0xda5fceee) }, - { SPH_C32(0x063c0000), SPH_C32(0xc0190000), SPH_C32(0xebae0049), - SPH_C32(0xb41f3800), SPH_C32(0xaf89496d), SPH_C32(0x01c8abf4), - SPH_C32(0x633d5736), SPH_C32(0x2184cf13), SPH_C32(0x6f5b0000), - SPH_C32(0xe00f0000), SPH_C32(0x1e790030), SPH_C32(0xfcf51800), - SPH_C32(0x83664f99), SPH_C32(0x7e8b9c94), SPH_C32(0x775a7a39), - SPH_C32(0xc42af848) }, - { SPH_C32(0x43250000), SPH_C32(0x6b150000), SPH_C32(0xdb100048), - SPH_C32(0xdd151800), SPH_C32(0x6d753b74), SPH_C32(0xb01c2bf9), - SPH_C32(0x4eecad70), SPH_C32(0x05b58004), SPH_C32(0x37180000), - SPH_C32(0x60710000), SPH_C32(0x664a0031), SPH_C32(0x3a9e2000), - SPH_C32(0x64511345), SPH_C32(0x0726a349), SPH_C32(0xdb298456), - SPH_C32(0xfe6e81f9) }, - { SPH_C32(0x1b660000), SPH_C32(0xeb6b0000), SPH_C32(0xa3230049), - SPH_C32(0x1b7e2000), SPH_C32(0x8a4267a8), SPH_C32(0xc9b11424), - SPH_C32(0xe29f531f), SPH_C32(0x3ff1f9b5), SPH_C32(0x2a420000), - SPH_C32(0x4b030000), SPH_C32(0x2ec70031), SPH_C32(0x95ff3800), - SPH_C32(0x419a3d80), SPH_C32(0xcf5f1c99), SPH_C32(0x5a8b807f), - SPH_C32(0xe01bb75f) }, - { SPH_C32(0xfb440000), SPH_C32(0x54410000), SPH_C32(0xddad0056), - SPH_C32(0x0eda0000), SPH_C32(0xc7201864), SPH_C32(0x00ba3e14), - SPH_C32(0x387fc181), SPH_C32(0x10dbffe4), SPH_C32(0x75ec0000), - SPH_C32(0x792d0000), SPH_C32(0xd180003a), SPH_C32(0xc4990000), - SPH_C32(0xe5df42f2), SPH_C32(0xfe354de0), SPH_C32(0x02801c32), - SPH_C32(0x4a2a7f20) }, - { SPH_C32(0xa3070000), SPH_C32(0xd43f0000), SPH_C32(0xa59e0057), - SPH_C32(0xc8b13800), SPH_C32(0x201744b8), SPH_C32(0x791701c9), - SPH_C32(0x940c3fee), SPH_C32(0x2a9f8655), SPH_C32(0x68b60000), - SPH_C32(0x525f0000), SPH_C32(0x990d003a), SPH_C32(0x6bf81800), - SPH_C32(0xc0146c37), SPH_C32(0x364cf230), SPH_C32(0x8322181b), - SPH_C32(0x545f4986) }, - { SPH_C32(0xe61e0000), SPH_C32(0x7f330000), SPH_C32(0x95200056), - SPH_C32(0xa1bb1800), SPH_C32(0xe2eb36a1), SPH_C32(0xc8c381c4), - SPH_C32(0xb9ddc5a8), SPH_C32(0x0eaec942), SPH_C32(0x30f50000), - SPH_C32(0xd2210000), SPH_C32(0xe13e003b), SPH_C32(0xad932000), - SPH_C32(0x272330eb), SPH_C32(0x4fe1cded), SPH_C32(0x2f51e674), - SPH_C32(0x6e1b3037) }, - { SPH_C32(0xbe5d0000), SPH_C32(0xff4d0000), SPH_C32(0xed130057), - SPH_C32(0x67d02000), SPH_C32(0x05dc6a7d), SPH_C32(0xb16ebe19), - SPH_C32(0x15ae3bc7), SPH_C32(0x34eab0f3), SPH_C32(0x2daf0000), - SPH_C32(0xf9530000), SPH_C32(0xa9b3003b), SPH_C32(0x02f23800), - SPH_C32(0x02e81e2e), SPH_C32(0x8798723d), SPH_C32(0xaef3e25d), - SPH_C32(0x706e0691) }, - { SPH_C32(0xd10a0000), SPH_C32(0xeda30000), SPH_C32(0x6b26006c), - SPH_C32(0x1e370000), SPH_C32(0xfa943185), SPH_C32(0x510c6bea), - SPH_C32(0x93a3bb17), SPH_C32(0x6da573f8), SPH_C32(0xdb150000), - SPH_C32(0xb6680000), SPH_C32(0xe1380028), SPH_C32(0xadb10000), - SPH_C32(0xfbbc07d4), SPH_C32(0xf36b5c9e), SPH_C32(0x01d13074), - SPH_C32(0x99872205) }, - { SPH_C32(0x89490000), SPH_C32(0x6ddd0000), SPH_C32(0x1315006d), - SPH_C32(0xd85c3800), SPH_C32(0x1da36d59), SPH_C32(0x28a15437), - SPH_C32(0x3fd04578), SPH_C32(0x57e10a49), SPH_C32(0xc64f0000), - SPH_C32(0x9d1a0000), SPH_C32(0xa9b50028), SPH_C32(0x02d01800), - SPH_C32(0xde772911), SPH_C32(0x3b12e34e), SPH_C32(0x8073345d), - SPH_C32(0x87f214a3) }, - { SPH_C32(0xcc500000), SPH_C32(0xc6d10000), SPH_C32(0x23ab006c), - SPH_C32(0xb1561800), SPH_C32(0xdf5f1f40), SPH_C32(0x9975d43a), - SPH_C32(0x1201bf3e), SPH_C32(0x73d0455e), SPH_C32(0x9e0c0000), - SPH_C32(0x1d640000), SPH_C32(0xd1860029), SPH_C32(0xc4bb2000), - SPH_C32(0x394075cd), SPH_C32(0x42bfdc93), SPH_C32(0x2c00ca32), - SPH_C32(0xbdb66d12) }, - { SPH_C32(0x94130000), SPH_C32(0x46af0000), SPH_C32(0x5b98006d), - SPH_C32(0x773d2000), SPH_C32(0x3868439c), SPH_C32(0xe0d8ebe7), - SPH_C32(0xbe724151), SPH_C32(0x49943cef), SPH_C32(0x83560000), - SPH_C32(0x36160000), SPH_C32(0x990b0029), SPH_C32(0x6bda3800), - SPH_C32(0x1c8b5b08), SPH_C32(0x8ac66343), SPH_C32(0xada2ce1b), - SPH_C32(0xa3c35bb4) }, - { SPH_C32(0x74310000), SPH_C32(0xf9850000), SPH_C32(0x25160072), - SPH_C32(0x62990000), SPH_C32(0x750a3c50), SPH_C32(0x29d3c1d7), - SPH_C32(0x6492d3cf), SPH_C32(0x66be3abe), SPH_C32(0xdcf80000), - SPH_C32(0x04380000), SPH_C32(0x664c0022), SPH_C32(0x3abc0000), - SPH_C32(0xb8ce247a), SPH_C32(0xbbac323a), SPH_C32(0xf5a95256), - SPH_C32(0x09f293cb) }, - { SPH_C32(0x2c720000), SPH_C32(0x79fb0000), SPH_C32(0x5d250073), - SPH_C32(0xa4f23800), SPH_C32(0x923d608c), SPH_C32(0x507efe0a), - SPH_C32(0xc8e12da0), SPH_C32(0x5cfa430f), SPH_C32(0xc1a20000), - SPH_C32(0x2f4a0000), SPH_C32(0x2ec10022), SPH_C32(0x95dd1800), - SPH_C32(0x9d050abf), SPH_C32(0x73d58dea), SPH_C32(0x740b567f), - SPH_C32(0x1787a56d) }, - { SPH_C32(0x696b0000), SPH_C32(0xd2f70000), SPH_C32(0x6d9b0072), - SPH_C32(0xcdf81800), SPH_C32(0x50c11295), SPH_C32(0xe1aa7e07), - SPH_C32(0xe530d7e6), SPH_C32(0x78cb0c18), SPH_C32(0x99e10000), - SPH_C32(0xaf340000), SPH_C32(0x56f20023), SPH_C32(0x53b62000), - SPH_C32(0x7a325663), SPH_C32(0x0a78b237), SPH_C32(0xd878a810), - SPH_C32(0x2dc3dcdc) }, - { SPH_C32(0x31280000), SPH_C32(0x52890000), SPH_C32(0x15a80073), - SPH_C32(0x0b932000), SPH_C32(0xb7f64e49), SPH_C32(0x980741da), - SPH_C32(0x49432989), SPH_C32(0x428f75a9), SPH_C32(0x84bb0000), - SPH_C32(0x84460000), SPH_C32(0x1e7f0023), SPH_C32(0xfcd73800), - SPH_C32(0x5ff978a6), SPH_C32(0xc2010de7), SPH_C32(0x59daac39), - SPH_C32(0x33b6ea7a) }, - { SPH_C32(0xd6e70000), SPH_C32(0x5ff30000), SPH_C32(0xec520066), - SPH_C32(0x893a0000), SPH_C32(0xb9e6122b), SPH_C32(0x19cb054e), - SPH_C32(0x67dbd935), SPH_C32(0xfdd0c236), SPH_C32(0x79c30000), - SPH_C32(0x101e0000), SPH_C32(0x287c003c), SPH_C32(0x46120000), - SPH_C32(0x375029af), SPH_C32(0xc3739807), SPH_C32(0x02983a8e), - SPH_C32(0x02e9da8d) }, - { SPH_C32(0x8ea40000), SPH_C32(0xdf8d0000), SPH_C32(0x94610067), - SPH_C32(0x4f513800), SPH_C32(0x5ed14ef7), SPH_C32(0x60663a93), - SPH_C32(0xcba8275a), SPH_C32(0xc794bb87), SPH_C32(0x64990000), - SPH_C32(0x3b6c0000), SPH_C32(0x60f1003c), SPH_C32(0xe9731800), - SPH_C32(0x129b076a), SPH_C32(0x0b0a27d7), SPH_C32(0x833a3ea7), - SPH_C32(0x1c9cec2b) }, - { SPH_C32(0xcbbd0000), SPH_C32(0x74810000), SPH_C32(0xa4df0066), - SPH_C32(0x265b1800), SPH_C32(0x9c2d3cee), SPH_C32(0xd1b2ba9e), - SPH_C32(0xe679dd1c), SPH_C32(0xe3a5f490), SPH_C32(0x3cda0000), - SPH_C32(0xbb120000), SPH_C32(0x18c2003d), SPH_C32(0x2f182000), - SPH_C32(0xf5ac5bb6), SPH_C32(0x72a7180a), SPH_C32(0x2f49c0c8), - SPH_C32(0x26d8959a) }, - { SPH_C32(0x93fe0000), SPH_C32(0xf4ff0000), SPH_C32(0xdcec0067), - SPH_C32(0xe0302000), SPH_C32(0x7b1a6032), SPH_C32(0xa81f8543), - SPH_C32(0x4a0a2373), SPH_C32(0xd9e18d21), SPH_C32(0x21800000), - SPH_C32(0x90600000), SPH_C32(0x504f003d), SPH_C32(0x80793800), - SPH_C32(0xd0677573), SPH_C32(0xbadea7da), SPH_C32(0xaeebc4e1), - SPH_C32(0x38ada33c) }, - { SPH_C32(0x73dc0000), SPH_C32(0x4bd50000), SPH_C32(0xa2620078), - SPH_C32(0xf5940000), SPH_C32(0x36781ffe), SPH_C32(0x6114af73), - SPH_C32(0x90eab1ed), SPH_C32(0xf6cb8b70), SPH_C32(0x7e2e0000), - SPH_C32(0xa24e0000), SPH_C32(0xaf080036), SPH_C32(0xd11f0000), - SPH_C32(0x74220a01), SPH_C32(0x8bb4f6a3), SPH_C32(0xf6e058ac), - SPH_C32(0x929c6b43) }, - { SPH_C32(0x2b9f0000), SPH_C32(0xcbab0000), SPH_C32(0xda510079), - SPH_C32(0x33ff3800), SPH_C32(0xd14f4322), SPH_C32(0x18b990ae), - SPH_C32(0x3c994f82), SPH_C32(0xcc8ff2c1), SPH_C32(0x63740000), - SPH_C32(0x893c0000), SPH_C32(0xe7850036), SPH_C32(0x7e7e1800), - SPH_C32(0x51e924c4), SPH_C32(0x43cd4973), SPH_C32(0x77425c85), - SPH_C32(0x8ce95de5) }, - { SPH_C32(0x6e860000), SPH_C32(0x60a70000), SPH_C32(0xeaef0078), - SPH_C32(0x5af51800), SPH_C32(0x13b3313b), SPH_C32(0xa96d10a3), - SPH_C32(0x1148b5c4), SPH_C32(0xe8bebdd6), SPH_C32(0x3b370000), - SPH_C32(0x09420000), SPH_C32(0x9fb60037), SPH_C32(0xb8152000), - SPH_C32(0xb6de7818), SPH_C32(0x3a6076ae), SPH_C32(0xdb31a2ea), - SPH_C32(0xb6ad2454) }, - { SPH_C32(0x36c50000), SPH_C32(0xe0d90000), SPH_C32(0x92dc0079), - SPH_C32(0x9c9e2000), SPH_C32(0xf4846de7), SPH_C32(0xd0c02f7e), - SPH_C32(0xbd3b4bab), SPH_C32(0xd2fac467), SPH_C32(0x266d0000), - SPH_C32(0x22300000), SPH_C32(0xd73b0037), SPH_C32(0x17743800), - SPH_C32(0x931556dd), SPH_C32(0xf219c97e), SPH_C32(0x5a93a6c3), - SPH_C32(0xa8d812f2) }, - { SPH_C32(0x538d0000), SPH_C32(0xa9fc0000), SPH_C32(0x9ef70006), - SPH_C32(0x56ff0000), SPH_C32(0x0ae4004e), SPH_C32(0x92c5cdf9), - SPH_C32(0xa9444018), SPH_C32(0x7f975691), SPH_C32(0x01dd0000), - SPH_C32(0x80a80000), SPH_C32(0xf4960048), SPH_C32(0xa6000000), - SPH_C32(0x90d57ea2), SPH_C32(0xd7e68c37), SPH_C32(0x6612cffd), - SPH_C32(0x2c94459e) }, - { SPH_C32(0x0bce0000), SPH_C32(0x29820000), SPH_C32(0xe6c40007), - SPH_C32(0x90943800), SPH_C32(0xedd35c92), SPH_C32(0xeb68f224), - SPH_C32(0x0537be77), SPH_C32(0x45d32f20), SPH_C32(0x1c870000), - SPH_C32(0xabda0000), SPH_C32(0xbc1b0048), SPH_C32(0x09611800), - SPH_C32(0xb51e5067), SPH_C32(0x1f9f33e7), SPH_C32(0xe7b0cbd4), - SPH_C32(0x32e17338) }, - { SPH_C32(0x4ed70000), SPH_C32(0x828e0000), SPH_C32(0xd67a0006), - SPH_C32(0xf99e1800), SPH_C32(0x2f2f2e8b), SPH_C32(0x5abc7229), - SPH_C32(0x28e64431), SPH_C32(0x61e26037), SPH_C32(0x44c40000), - SPH_C32(0x2ba40000), SPH_C32(0xc4280049), SPH_C32(0xcf0a2000), - SPH_C32(0x52290cbb), SPH_C32(0x66320c3a), SPH_C32(0x4bc335bb), - SPH_C32(0x08a50a89) }, - { SPH_C32(0x16940000), SPH_C32(0x02f00000), SPH_C32(0xae490007), - SPH_C32(0x3ff52000), SPH_C32(0xc8187257), SPH_C32(0x23114df4), - SPH_C32(0x8495ba5e), SPH_C32(0x5ba61986), SPH_C32(0x599e0000), - SPH_C32(0x00d60000), SPH_C32(0x8ca50049), SPH_C32(0x606b3800), - SPH_C32(0x77e2227e), SPH_C32(0xae4bb3ea), SPH_C32(0xca613192), - SPH_C32(0x16d03c2f) }, - { SPH_C32(0xf6b60000), SPH_C32(0xbdda0000), SPH_C32(0xd0c70018), - SPH_C32(0x2a510000), SPH_C32(0x857a0d9b), SPH_C32(0xea1a67c4), - SPH_C32(0x5e7528c0), SPH_C32(0x748c1fd7), SPH_C32(0x06300000), - SPH_C32(0x32f80000), SPH_C32(0x73e20042), SPH_C32(0x310d0000), - SPH_C32(0xd3a75d0c), SPH_C32(0x9f21e293), SPH_C32(0x926aaddf), - SPH_C32(0xbce1f450) }, - { SPH_C32(0xaef50000), SPH_C32(0x3da40000), SPH_C32(0xa8f40019), - SPH_C32(0xec3a3800), SPH_C32(0x624d5147), SPH_C32(0x93b75819), - SPH_C32(0xf206d6af), SPH_C32(0x4ec86666), SPH_C32(0x1b6a0000), - SPH_C32(0x198a0000), SPH_C32(0x3b6f0042), SPH_C32(0x9e6c1800), - SPH_C32(0xf66c73c9), SPH_C32(0x57585d43), SPH_C32(0x13c8a9f6), - SPH_C32(0xa294c2f6) }, - { SPH_C32(0xebec0000), SPH_C32(0x96a80000), SPH_C32(0x984a0018), - SPH_C32(0x85301800), SPH_C32(0xa0b1235e), SPH_C32(0x2263d814), - SPH_C32(0xdfd72ce9), SPH_C32(0x6af92971), SPH_C32(0x43290000), - SPH_C32(0x99f40000), SPH_C32(0x435c0043), SPH_C32(0x58072000), - SPH_C32(0x115b2f15), SPH_C32(0x2ef5629e), SPH_C32(0xbfbb5799), - SPH_C32(0x98d0bb47) }, - { SPH_C32(0xb3af0000), SPH_C32(0x16d60000), SPH_C32(0xe0790019), - SPH_C32(0x435b2000), SPH_C32(0x47867f82), SPH_C32(0x5bcee7c9), - SPH_C32(0x73a4d286), SPH_C32(0x50bd50c0), SPH_C32(0x5e730000), - SPH_C32(0xb2860000), SPH_C32(0x0bd10043), SPH_C32(0xf7663800), - SPH_C32(0x349001d0), SPH_C32(0xe68cdd4e), SPH_C32(0x3e1953b0), - SPH_C32(0x86a58de1) }, - { SPH_C32(0x54600000), SPH_C32(0x1bac0000), SPH_C32(0x1983000c), - SPH_C32(0xc1f20000), SPH_C32(0x499623e0), SPH_C32(0xda02a35d), - SPH_C32(0x5d3c223a), SPH_C32(0xefe2e75f), SPH_C32(0xa30b0000), - SPH_C32(0x26de0000), SPH_C32(0x3dd2005c), SPH_C32(0x4da30000), - SPH_C32(0x5c3950d9), SPH_C32(0xe7fe48ae), SPH_C32(0x655bc507), - SPH_C32(0xb7fabd16) }, - { SPH_C32(0x0c230000), SPH_C32(0x9bd20000), SPH_C32(0x61b0000d), - SPH_C32(0x07993800), SPH_C32(0xaea17f3c), SPH_C32(0xa3af9c80), - SPH_C32(0xf14fdc55), SPH_C32(0xd5a69eee), SPH_C32(0xbe510000), - SPH_C32(0x0dac0000), SPH_C32(0x755f005c), SPH_C32(0xe2c21800), - SPH_C32(0x79f27e1c), SPH_C32(0x2f87f77e), SPH_C32(0xe4f9c12e), - SPH_C32(0xa98f8bb0) }, - { SPH_C32(0x493a0000), SPH_C32(0x30de0000), SPH_C32(0x510e000c), - SPH_C32(0x6e931800), SPH_C32(0x6c5d0d25), SPH_C32(0x127b1c8d), - SPH_C32(0xdc9e2613), SPH_C32(0xf197d1f9), SPH_C32(0xe6120000), - SPH_C32(0x8dd20000), SPH_C32(0x0d6c005d), SPH_C32(0x24a92000), - SPH_C32(0x9ec522c0), SPH_C32(0x562ac8a3), SPH_C32(0x488a3f41), - SPH_C32(0x93cbf201) }, - { SPH_C32(0x11790000), SPH_C32(0xb0a00000), SPH_C32(0x293d000d), - SPH_C32(0xa8f82000), SPH_C32(0x8b6a51f9), SPH_C32(0x6bd62350), - SPH_C32(0x70edd87c), SPH_C32(0xcbd3a848), SPH_C32(0xfb480000), - SPH_C32(0xa6a00000), SPH_C32(0x45e1005d), SPH_C32(0x8bc83800), - SPH_C32(0xbb0e0c05), SPH_C32(0x9e537773), SPH_C32(0xc9283b68), - SPH_C32(0x8dbec4a7) }, - { SPH_C32(0xf15b0000), SPH_C32(0x0f8a0000), SPH_C32(0x57b30012), - SPH_C32(0xbd5c0000), SPH_C32(0xc6082e35), SPH_C32(0xa2dd0960), - SPH_C32(0xaa0d4ae2), SPH_C32(0xe4f9ae19), SPH_C32(0xa4e60000), - SPH_C32(0x948e0000), SPH_C32(0xbaa60056), SPH_C32(0xdaae0000), - SPH_C32(0x1f4b7377), SPH_C32(0xaf39260a), SPH_C32(0x9123a725), - SPH_C32(0x278f0cd8) }, - { SPH_C32(0xa9180000), SPH_C32(0x8ff40000), SPH_C32(0x2f800013), - SPH_C32(0x7b373800), SPH_C32(0x213f72e9), SPH_C32(0xdb7036bd), - SPH_C32(0x067eb48d), SPH_C32(0xdebdd7a8), SPH_C32(0xb9bc0000), - SPH_C32(0xbffc0000), SPH_C32(0xf22b0056), SPH_C32(0x75cf1800), - SPH_C32(0x3a805db2), SPH_C32(0x674099da), SPH_C32(0x1081a30c), - SPH_C32(0x39fa3a7e) }, - { SPH_C32(0xec010000), SPH_C32(0x24f80000), SPH_C32(0x1f3e0012), - SPH_C32(0x123d1800), SPH_C32(0xe3c300f0), SPH_C32(0x6aa4b6b0), - SPH_C32(0x2baf4ecb), SPH_C32(0xfa8c98bf), SPH_C32(0xe1ff0000), - SPH_C32(0x3f820000), SPH_C32(0x8a180057), SPH_C32(0xb3a42000), - SPH_C32(0xddb7016e), SPH_C32(0x1eeda607), SPH_C32(0xbcf25d63), - SPH_C32(0x03be43cf) }, - { SPH_C32(0xb4420000), SPH_C32(0xa4860000), SPH_C32(0x670d0013), - SPH_C32(0xd4562000), SPH_C32(0x04f45c2c), SPH_C32(0x1309896d), - SPH_C32(0x87dcb0a4), SPH_C32(0xc0c8e10e), SPH_C32(0xfca50000), - SPH_C32(0x14f00000), SPH_C32(0xc2950057), SPH_C32(0x1cc53800), - SPH_C32(0xf87c2fab), SPH_C32(0xd69419d7), SPH_C32(0x3d50594a), - SPH_C32(0x1dcb7569) }, - { SPH_C32(0xdb150000), SPH_C32(0xb6680000), SPH_C32(0xe1380028), - SPH_C32(0xadb10000), SPH_C32(0xfbbc07d4), SPH_C32(0xf36b5c9e), - SPH_C32(0x01d13074), SPH_C32(0x99872205), SPH_C32(0x0a1f0000), - SPH_C32(0x5bcb0000), SPH_C32(0x8a1e0044), SPH_C32(0xb3860000), - SPH_C32(0x01283651), SPH_C32(0xa2673774), SPH_C32(0x92728b63), - SPH_C32(0xf42251fd) }, - { SPH_C32(0x83560000), SPH_C32(0x36160000), SPH_C32(0x990b0029), - SPH_C32(0x6bda3800), SPH_C32(0x1c8b5b08), SPH_C32(0x8ac66343), - SPH_C32(0xada2ce1b), SPH_C32(0xa3c35bb4), SPH_C32(0x17450000), - SPH_C32(0x70b90000), SPH_C32(0xc2930044), SPH_C32(0x1ce71800), - SPH_C32(0x24e31894), SPH_C32(0x6a1e88a4), SPH_C32(0x13d08f4a), - SPH_C32(0xea57675b) }, - { SPH_C32(0xc64f0000), SPH_C32(0x9d1a0000), SPH_C32(0xa9b50028), - SPH_C32(0x02d01800), SPH_C32(0xde772911), SPH_C32(0x3b12e34e), - SPH_C32(0x8073345d), SPH_C32(0x87f214a3), SPH_C32(0x4f060000), - SPH_C32(0xf0c70000), SPH_C32(0xbaa00045), SPH_C32(0xda8c2000), - SPH_C32(0xc3d44448), SPH_C32(0x13b3b779), SPH_C32(0xbfa37125), - SPH_C32(0xd0131eea) }, - { SPH_C32(0x9e0c0000), SPH_C32(0x1d640000), SPH_C32(0xd1860029), - SPH_C32(0xc4bb2000), SPH_C32(0x394075cd), SPH_C32(0x42bfdc93), - SPH_C32(0x2c00ca32), SPH_C32(0xbdb66d12), SPH_C32(0x525c0000), - SPH_C32(0xdbb50000), SPH_C32(0xf22d0045), SPH_C32(0x75ed3800), - SPH_C32(0xe61f6a8d), SPH_C32(0xdbca08a9), SPH_C32(0x3e01750c), - SPH_C32(0xce66284c) }, - { SPH_C32(0x7e2e0000), SPH_C32(0xa24e0000), SPH_C32(0xaf080036), - SPH_C32(0xd11f0000), SPH_C32(0x74220a01), SPH_C32(0x8bb4f6a3), - SPH_C32(0xf6e058ac), SPH_C32(0x929c6b43), SPH_C32(0x0df20000), - SPH_C32(0xe99b0000), SPH_C32(0x0d6a004e), SPH_C32(0x248b0000), - SPH_C32(0x425a15ff), SPH_C32(0xeaa059d0), SPH_C32(0x660ae941), - SPH_C32(0x6457e033) }, - { SPH_C32(0x266d0000), SPH_C32(0x22300000), SPH_C32(0xd73b0037), - SPH_C32(0x17743800), SPH_C32(0x931556dd), SPH_C32(0xf219c97e), - SPH_C32(0x5a93a6c3), SPH_C32(0xa8d812f2), SPH_C32(0x10a80000), - SPH_C32(0xc2e90000), SPH_C32(0x45e7004e), SPH_C32(0x8bea1800), - SPH_C32(0x67913b3a), SPH_C32(0x22d9e600), SPH_C32(0xe7a8ed68), - SPH_C32(0x7a22d695) }, - { SPH_C32(0x63740000), SPH_C32(0x893c0000), SPH_C32(0xe7850036), - SPH_C32(0x7e7e1800), SPH_C32(0x51e924c4), SPH_C32(0x43cd4973), - SPH_C32(0x77425c85), SPH_C32(0x8ce95de5), SPH_C32(0x48eb0000), - SPH_C32(0x42970000), SPH_C32(0x3dd4004f), SPH_C32(0x4d812000), - SPH_C32(0x80a667e6), SPH_C32(0x5b74d9dd), SPH_C32(0x4bdb1307), - SPH_C32(0x4066af24) }, - { SPH_C32(0x3b370000), SPH_C32(0x09420000), SPH_C32(0x9fb60037), - SPH_C32(0xb8152000), SPH_C32(0xb6de7818), SPH_C32(0x3a6076ae), - SPH_C32(0xdb31a2ea), SPH_C32(0xb6ad2454), SPH_C32(0x55b10000), - SPH_C32(0x69e50000), SPH_C32(0x7559004f), SPH_C32(0xe2e03800), - SPH_C32(0xa56d4923), SPH_C32(0x930d660d), SPH_C32(0xca79172e), - SPH_C32(0x5e139982) }, - { SPH_C32(0xdcf80000), SPH_C32(0x04380000), SPH_C32(0x664c0022), - SPH_C32(0x3abc0000), SPH_C32(0xb8ce247a), SPH_C32(0xbbac323a), - SPH_C32(0xf5a95256), SPH_C32(0x09f293cb), SPH_C32(0xa8c90000), - SPH_C32(0xfdbd0000), SPH_C32(0x435a0050), SPH_C32(0x58250000), - SPH_C32(0xcdc4182a), SPH_C32(0x927ff3ed), SPH_C32(0x913b8199), - SPH_C32(0x6f4ca975) }, - { SPH_C32(0x84bb0000), SPH_C32(0x84460000), SPH_C32(0x1e7f0023), - SPH_C32(0xfcd73800), SPH_C32(0x5ff978a6), SPH_C32(0xc2010de7), - SPH_C32(0x59daac39), SPH_C32(0x33b6ea7a), SPH_C32(0xb5930000), - SPH_C32(0xd6cf0000), SPH_C32(0x0bd70050), SPH_C32(0xf7441800), - SPH_C32(0xe80f36ef), SPH_C32(0x5a064c3d), SPH_C32(0x109985b0), - SPH_C32(0x71399fd3) }, - { SPH_C32(0xc1a20000), SPH_C32(0x2f4a0000), SPH_C32(0x2ec10022), - SPH_C32(0x95dd1800), SPH_C32(0x9d050abf), SPH_C32(0x73d58dea), - SPH_C32(0x740b567f), SPH_C32(0x1787a56d), SPH_C32(0xedd00000), - SPH_C32(0x56b10000), SPH_C32(0x73e40051), SPH_C32(0x312f2000), - SPH_C32(0x0f386a33), SPH_C32(0x23ab73e0), SPH_C32(0xbcea7bdf), - SPH_C32(0x4b7de662) }, - { SPH_C32(0x99e10000), SPH_C32(0xaf340000), SPH_C32(0x56f20023), - SPH_C32(0x53b62000), SPH_C32(0x7a325663), SPH_C32(0x0a78b237), - SPH_C32(0xd878a810), SPH_C32(0x2dc3dcdc), SPH_C32(0xf08a0000), - SPH_C32(0x7dc30000), SPH_C32(0x3b690051), SPH_C32(0x9e4e3800), - SPH_C32(0x2af344f6), SPH_C32(0xebd2cc30), SPH_C32(0x3d487ff6), - SPH_C32(0x5508d0c4) }, - { SPH_C32(0x79c30000), SPH_C32(0x101e0000), SPH_C32(0x287c003c), - SPH_C32(0x46120000), SPH_C32(0x375029af), SPH_C32(0xc3739807), - SPH_C32(0x02983a8e), SPH_C32(0x02e9da8d), SPH_C32(0xaf240000), - SPH_C32(0x4fed0000), SPH_C32(0xc42e005a), SPH_C32(0xcf280000), - SPH_C32(0x8eb63b84), SPH_C32(0xdab89d49), SPH_C32(0x6543e3bb), - SPH_C32(0xff3918bb) }, - { SPH_C32(0x21800000), SPH_C32(0x90600000), SPH_C32(0x504f003d), - SPH_C32(0x80793800), SPH_C32(0xd0677573), SPH_C32(0xbadea7da), - SPH_C32(0xaeebc4e1), SPH_C32(0x38ada33c), SPH_C32(0xb27e0000), - SPH_C32(0x649f0000), SPH_C32(0x8ca3005a), SPH_C32(0x60491800), - SPH_C32(0xab7d1541), SPH_C32(0x12c12299), SPH_C32(0xe4e1e792), - SPH_C32(0xe14c2e1d) }, - { SPH_C32(0x64990000), SPH_C32(0x3b6c0000), SPH_C32(0x60f1003c), - SPH_C32(0xe9731800), SPH_C32(0x129b076a), SPH_C32(0x0b0a27d7), - SPH_C32(0x833a3ea7), SPH_C32(0x1c9cec2b), SPH_C32(0xea3d0000), - SPH_C32(0xe4e10000), SPH_C32(0xf490005b), SPH_C32(0xa6222000), - SPH_C32(0x4c4a499d), SPH_C32(0x6b6c1d44), SPH_C32(0x489219fd), - SPH_C32(0xdb0857ac) }, - { SPH_C32(0x3cda0000), SPH_C32(0xbb120000), SPH_C32(0x18c2003d), - SPH_C32(0x2f182000), SPH_C32(0xf5ac5bb6), SPH_C32(0x72a7180a), - SPH_C32(0x2f49c0c8), SPH_C32(0x26d8959a), SPH_C32(0xf7670000), - SPH_C32(0xcf930000), SPH_C32(0xbc1d005b), SPH_C32(0x09433800), - SPH_C32(0x69816758), SPH_C32(0xa315a294), SPH_C32(0xc9301dd4), - SPH_C32(0xc57d610a) }, - { SPH_C32(0x584f0000), SPH_C32(0x729f0000), SPH_C32(0xe07f000a), - SPH_C32(0x43790000), SPH_C32(0x9b1948bd), SPH_C32(0xe74476ba), - SPH_C32(0x5d240486), SPH_C32(0xa72142f2), SPH_C32(0x82870000), - SPH_C32(0x445f0000), SPH_C32(0xf5d1006a), SPH_C32(0x48c80000), - SPH_C32(0xf07031cb), SPH_C32(0xc3c9a613), SPH_C32(0x3ae7fb0f), - SPH_C32(0x12322569) }, - { SPH_C32(0x000c0000), SPH_C32(0xf2e10000), SPH_C32(0x984c000b), - SPH_C32(0x85123800), SPH_C32(0x7c2e1461), SPH_C32(0x9ee94967), - SPH_C32(0xf157fae9), SPH_C32(0x9d653b43), SPH_C32(0x9fdd0000), - SPH_C32(0x6f2d0000), SPH_C32(0xbd5c006a), SPH_C32(0xe7a91800), - SPH_C32(0xd5bb1f0e), SPH_C32(0x0bb019c3), SPH_C32(0xbb45ff26), - SPH_C32(0x0c4713cf) }, - { SPH_C32(0x45150000), SPH_C32(0x59ed0000), SPH_C32(0xa8f2000a), - SPH_C32(0xec181800), SPH_C32(0xbed26678), SPH_C32(0x2f3dc96a), - SPH_C32(0xdc8600af), SPH_C32(0xb9547454), SPH_C32(0xc79e0000), - SPH_C32(0xef530000), SPH_C32(0xc56f006b), SPH_C32(0x21c22000), - SPH_C32(0x328c43d2), SPH_C32(0x721d261e), SPH_C32(0x17360149), - SPH_C32(0x36036a7e) }, - { SPH_C32(0x1d560000), SPH_C32(0xd9930000), SPH_C32(0xd0c1000b), - SPH_C32(0x2a732000), SPH_C32(0x59e53aa4), SPH_C32(0x5690f6b7), - SPH_C32(0x70f5fec0), SPH_C32(0x83100de5), SPH_C32(0xdac40000), - SPH_C32(0xc4210000), SPH_C32(0x8de2006b), SPH_C32(0x8ea33800), - SPH_C32(0x17476d17), SPH_C32(0xba6499ce), SPH_C32(0x96940560), - SPH_C32(0x28765cd8) }, - { SPH_C32(0xfd740000), SPH_C32(0x66b90000), SPH_C32(0xae4f0014), - SPH_C32(0x3fd70000), SPH_C32(0x14874568), SPH_C32(0x9f9bdc87), - SPH_C32(0xaa156c5e), SPH_C32(0xac3a0bb4), SPH_C32(0x856a0000), - SPH_C32(0xf60f0000), SPH_C32(0x72a50060), SPH_C32(0xdfc50000), - SPH_C32(0xb3021265), SPH_C32(0x8b0ec8b7), SPH_C32(0xce9f992d), - SPH_C32(0x824794a7) }, - { SPH_C32(0xa5370000), SPH_C32(0xe6c70000), SPH_C32(0xd67c0015), - SPH_C32(0xf9bc3800), SPH_C32(0xf3b019b4), SPH_C32(0xe636e35a), - SPH_C32(0x06669231), SPH_C32(0x967e7205), SPH_C32(0x98300000), - SPH_C32(0xdd7d0000), SPH_C32(0x3a280060), SPH_C32(0x70a41800), - SPH_C32(0x96c93ca0), SPH_C32(0x43777767), SPH_C32(0x4f3d9d04), - SPH_C32(0x9c32a201) }, - { SPH_C32(0xe02e0000), SPH_C32(0x4dcb0000), SPH_C32(0xe6c20014), - SPH_C32(0x90b61800), SPH_C32(0x314c6bad), SPH_C32(0x57e26357), - SPH_C32(0x2bb76877), SPH_C32(0xb24f3d12), SPH_C32(0xc0730000), - SPH_C32(0x5d030000), SPH_C32(0x421b0061), SPH_C32(0xb6cf2000), - SPH_C32(0x71fe607c), SPH_C32(0x3ada48ba), SPH_C32(0xe34e636b), - SPH_C32(0xa676dbb0) }, - { SPH_C32(0xb86d0000), SPH_C32(0xcdb50000), SPH_C32(0x9ef10015), - SPH_C32(0x56dd2000), SPH_C32(0xd67b3771), SPH_C32(0x2e4f5c8a), - SPH_C32(0x87c49618), SPH_C32(0x880b44a3), SPH_C32(0xdd290000), - SPH_C32(0x76710000), SPH_C32(0x0a960061), SPH_C32(0x19ae3800), - SPH_C32(0x54354eb9), SPH_C32(0xf2a3f76a), SPH_C32(0x62ec6742), - SPH_C32(0xb803ed16) }, - { SPH_C32(0x5fa20000), SPH_C32(0xc0cf0000), SPH_C32(0x670b0000), - SPH_C32(0xd4740000), SPH_C32(0xd86b6b13), SPH_C32(0xaf83181e), - SPH_C32(0xa95c66a4), SPH_C32(0x3754f33c), SPH_C32(0x20510000), - SPH_C32(0xe2290000), SPH_C32(0x3c95007e), SPH_C32(0xa36b0000), - SPH_C32(0x3c9c1fb0), SPH_C32(0xf3d1628a), SPH_C32(0x39aef1f5), - SPH_C32(0x895cdde1) }, - { SPH_C32(0x07e10000), SPH_C32(0x40b10000), SPH_C32(0x1f380001), - SPH_C32(0x121f3800), SPH_C32(0x3f5c37cf), SPH_C32(0xd62e27c3), - SPH_C32(0x052f98cb), SPH_C32(0x0d108a8d), SPH_C32(0x3d0b0000), - SPH_C32(0xc95b0000), SPH_C32(0x7418007e), SPH_C32(0x0c0a1800), - SPH_C32(0x19573175), SPH_C32(0x3ba8dd5a), SPH_C32(0xb80cf5dc), - SPH_C32(0x9729eb47) }, - { SPH_C32(0x42f80000), SPH_C32(0xebbd0000), SPH_C32(0x2f860000), - SPH_C32(0x7b151800), SPH_C32(0xfda045d6), SPH_C32(0x67faa7ce), - SPH_C32(0x28fe628d), SPH_C32(0x2921c59a), SPH_C32(0x65480000), - SPH_C32(0x49250000), SPH_C32(0x0c2b007f), SPH_C32(0xca612000), - SPH_C32(0xfe606da9), SPH_C32(0x4205e287), SPH_C32(0x147f0bb3), - SPH_C32(0xad6d92f6) }, - { SPH_C32(0x1abb0000), SPH_C32(0x6bc30000), SPH_C32(0x57b50001), - SPH_C32(0xbd7e2000), SPH_C32(0x1a97190a), SPH_C32(0x1e579813), - SPH_C32(0x848d9ce2), SPH_C32(0x1365bc2b), SPH_C32(0x78120000), - SPH_C32(0x62570000), SPH_C32(0x44a6007f), SPH_C32(0x65003800), - SPH_C32(0xdbab436c), SPH_C32(0x8a7c5d57), SPH_C32(0x95dd0f9a), - SPH_C32(0xb318a450) }, - { SPH_C32(0xfa990000), SPH_C32(0xd4e90000), SPH_C32(0x293b001e), - SPH_C32(0xa8da0000), SPH_C32(0x57f566c6), SPH_C32(0xd75cb223), - SPH_C32(0x5e6d0e7c), SPH_C32(0x3c4fba7a), SPH_C32(0x27bc0000), - SPH_C32(0x50790000), SPH_C32(0xbbe10074), SPH_C32(0x34660000), - SPH_C32(0x7fee3c1e), SPH_C32(0xbb160c2e), SPH_C32(0xcdd693d7), - SPH_C32(0x19296c2f) }, - { SPH_C32(0xa2da0000), SPH_C32(0x54970000), SPH_C32(0x5108001f), - SPH_C32(0x6eb13800), SPH_C32(0xb0c23a1a), SPH_C32(0xaef18dfe), - SPH_C32(0xf21ef013), SPH_C32(0x060bc3cb), SPH_C32(0x3ae60000), - SPH_C32(0x7b0b0000), SPH_C32(0xf36c0074), SPH_C32(0x9b071800), - SPH_C32(0x5a2512db), SPH_C32(0x736fb3fe), SPH_C32(0x4c7497fe), - SPH_C32(0x075c5a89) }, - { SPH_C32(0xe7c30000), SPH_C32(0xff9b0000), SPH_C32(0x61b6001e), - SPH_C32(0x07bb1800), SPH_C32(0x723e4803), SPH_C32(0x1f250df3), - SPH_C32(0xdfcf0a55), SPH_C32(0x223a8cdc), SPH_C32(0x62a50000), - SPH_C32(0xfb750000), SPH_C32(0x8b5f0075), SPH_C32(0x5d6c2000), - SPH_C32(0xbd124e07), SPH_C32(0x0ac28c23), SPH_C32(0xe0076991), - SPH_C32(0x3d182338) }, - { SPH_C32(0xbf800000), SPH_C32(0x7fe50000), SPH_C32(0x1985001f), - SPH_C32(0xc1d02000), SPH_C32(0x950914df), SPH_C32(0x6688322e), - SPH_C32(0x73bcf43a), SPH_C32(0x187ef56d), SPH_C32(0x7fff0000), - SPH_C32(0xd0070000), SPH_C32(0xc3d20075), SPH_C32(0xf20d3800), - SPH_C32(0x98d960c2), SPH_C32(0xc2bb33f3), SPH_C32(0x61a56db8), - SPH_C32(0x236d159e) }, - { SPH_C32(0xd0d70000), SPH_C32(0x6d0b0000), SPH_C32(0x9fb00024), - SPH_C32(0xb8370000), SPH_C32(0x6a414f27), SPH_C32(0x86eae7dd), - SPH_C32(0xf5b174ea), SPH_C32(0x41313666), SPH_C32(0x89450000), - SPH_C32(0x9f3c0000), SPH_C32(0x8b590066), SPH_C32(0x5d4e0000), - SPH_C32(0x618d7938), SPH_C32(0xb6481d50), SPH_C32(0xce87bf91), - SPH_C32(0xca84310a) }, - { SPH_C32(0x88940000), SPH_C32(0xed750000), SPH_C32(0xe7830025), - SPH_C32(0x7e5c3800), SPH_C32(0x8d7613fb), SPH_C32(0xff47d800), - SPH_C32(0x59c28a85), SPH_C32(0x7b754fd7), SPH_C32(0x941f0000), - SPH_C32(0xb44e0000), SPH_C32(0xc3d40066), SPH_C32(0xf22f1800), - SPH_C32(0x444657fd), SPH_C32(0x7e31a280), SPH_C32(0x4f25bbb8), - SPH_C32(0xd4f107ac) }, - { SPH_C32(0xcd8d0000), SPH_C32(0x46790000), SPH_C32(0xd73d0024), - SPH_C32(0x17561800), SPH_C32(0x4f8a61e2), SPH_C32(0x4e93580d), - SPH_C32(0x741370c3), SPH_C32(0x5f4400c0), SPH_C32(0xcc5c0000), - SPH_C32(0x34300000), SPH_C32(0xbbe70067), SPH_C32(0x34442000), - SPH_C32(0xa3710b21), SPH_C32(0x079c9d5d), SPH_C32(0xe35645d7), - SPH_C32(0xeeb57e1d) }, - { SPH_C32(0x95ce0000), SPH_C32(0xc6070000), SPH_C32(0xaf0e0025), - SPH_C32(0xd13d2000), SPH_C32(0xa8bd3d3e), SPH_C32(0x373e67d0), - SPH_C32(0xd8608eac), SPH_C32(0x65007971), SPH_C32(0xd1060000), - SPH_C32(0x1f420000), SPH_C32(0xf36a0067), SPH_C32(0x9b253800), - SPH_C32(0x86ba25e4), SPH_C32(0xcfe5228d), SPH_C32(0x62f441fe), - SPH_C32(0xf0c048bb) }, - { SPH_C32(0x75ec0000), SPH_C32(0x792d0000), SPH_C32(0xd180003a), - SPH_C32(0xc4990000), SPH_C32(0xe5df42f2), SPH_C32(0xfe354de0), - SPH_C32(0x02801c32), SPH_C32(0x4a2a7f20), SPH_C32(0x8ea80000), - SPH_C32(0x2d6c0000), SPH_C32(0x0c2d006c), SPH_C32(0xca430000), - SPH_C32(0x22ff5a96), SPH_C32(0xfe8f73f4), SPH_C32(0x3affddb3), - SPH_C32(0x5af180c4) }, - { SPH_C32(0x2daf0000), SPH_C32(0xf9530000), SPH_C32(0xa9b3003b), - SPH_C32(0x02f23800), SPH_C32(0x02e81e2e), SPH_C32(0x8798723d), - SPH_C32(0xaef3e25d), SPH_C32(0x706e0691), SPH_C32(0x93f20000), - SPH_C32(0x061e0000), SPH_C32(0x44a0006c), SPH_C32(0x65221800), - SPH_C32(0x07347453), SPH_C32(0x36f6cc24), SPH_C32(0xbb5dd99a), - SPH_C32(0x4484b662) }, - { SPH_C32(0x68b60000), SPH_C32(0x525f0000), SPH_C32(0x990d003a), - SPH_C32(0x6bf81800), SPH_C32(0xc0146c37), SPH_C32(0x364cf230), - SPH_C32(0x8322181b), SPH_C32(0x545f4986), SPH_C32(0xcbb10000), - SPH_C32(0x86600000), SPH_C32(0x3c93006d), SPH_C32(0xa3492000), - SPH_C32(0xe003288f), SPH_C32(0x4f5bf3f9), SPH_C32(0x172e27f5), - SPH_C32(0x7ec0cfd3) }, - { SPH_C32(0x30f50000), SPH_C32(0xd2210000), SPH_C32(0xe13e003b), - SPH_C32(0xad932000), SPH_C32(0x272330eb), SPH_C32(0x4fe1cded), - SPH_C32(0x2f51e674), SPH_C32(0x6e1b3037), SPH_C32(0xd6eb0000), - SPH_C32(0xad120000), SPH_C32(0x741e006d), SPH_C32(0x0c283800), - SPH_C32(0xc5c8064a), SPH_C32(0x87224c29), SPH_C32(0x968c23dc), - SPH_C32(0x60b5f975) }, - { SPH_C32(0xd73a0000), SPH_C32(0xdf5b0000), SPH_C32(0x18c4002e), - SPH_C32(0x2f3a0000), SPH_C32(0x29336c89), SPH_C32(0xce2d8979), - SPH_C32(0x01c916c8), SPH_C32(0xd14487a8), SPH_C32(0x2b930000), - SPH_C32(0x394a0000), SPH_C32(0x421d0072), SPH_C32(0xb6ed0000), - SPH_C32(0xad615743), SPH_C32(0x8650d9c9), SPH_C32(0xcdceb56b), - SPH_C32(0x51eac982) }, - { SPH_C32(0x8f790000), SPH_C32(0x5f250000), SPH_C32(0x60f7002f), - SPH_C32(0xe9513800), SPH_C32(0xce043055), SPH_C32(0xb780b6a4), - SPH_C32(0xadbae8a7), SPH_C32(0xeb00fe19), SPH_C32(0x36c90000), - SPH_C32(0x12380000), SPH_C32(0x0a900072), SPH_C32(0x198c1800), - SPH_C32(0x88aa7986), SPH_C32(0x4e296619), SPH_C32(0x4c6cb142), - SPH_C32(0x4f9fff24) }, - { SPH_C32(0xca600000), SPH_C32(0xf4290000), SPH_C32(0x5049002e), - SPH_C32(0x805b1800), SPH_C32(0x0cf8424c), SPH_C32(0x065436a9), - SPH_C32(0x806b12e1), SPH_C32(0xcf31b10e), SPH_C32(0x6e8a0000), - SPH_C32(0x92460000), SPH_C32(0x72a30073), SPH_C32(0xdfe72000), - SPH_C32(0x6f9d255a), SPH_C32(0x378459c4), SPH_C32(0xe01f4f2d), - SPH_C32(0x75db8695) }, - { SPH_C32(0x92230000), SPH_C32(0x74570000), SPH_C32(0x287a002f), - SPH_C32(0x46302000), SPH_C32(0xebcf1e90), SPH_C32(0x7ff90974), - SPH_C32(0x2c18ec8e), SPH_C32(0xf575c8bf), SPH_C32(0x73d00000), - SPH_C32(0xb9340000), SPH_C32(0x3a2e0073), SPH_C32(0x70863800), - SPH_C32(0x4a560b9f), SPH_C32(0xfffde614), SPH_C32(0x61bd4b04), - SPH_C32(0x6baeb033) }, - { SPH_C32(0x72010000), SPH_C32(0xcb7d0000), SPH_C32(0x56f40030), - SPH_C32(0x53940000), SPH_C32(0xa6ad615c), SPH_C32(0xb6f22344), - SPH_C32(0xf6f87e10), SPH_C32(0xda5fceee), SPH_C32(0x2c7e0000), - SPH_C32(0x8b1a0000), SPH_C32(0xc5690078), SPH_C32(0x21e00000), - SPH_C32(0xee1374ed), SPH_C32(0xce97b76d), SPH_C32(0x39b6d749), - SPH_C32(0xc19f784c) }, - { SPH_C32(0x2a420000), SPH_C32(0x4b030000), SPH_C32(0x2ec70031), - SPH_C32(0x95ff3800), SPH_C32(0x419a3d80), SPH_C32(0xcf5f1c99), - SPH_C32(0x5a8b807f), SPH_C32(0xe01bb75f), SPH_C32(0x31240000), - SPH_C32(0xa0680000), SPH_C32(0x8de40078), SPH_C32(0x8e811800), - SPH_C32(0xcbd85a28), SPH_C32(0x06ee08bd), SPH_C32(0xb814d360), - SPH_C32(0xdfea4eea) }, - { SPH_C32(0x6f5b0000), SPH_C32(0xe00f0000), SPH_C32(0x1e790030), - SPH_C32(0xfcf51800), SPH_C32(0x83664f99), SPH_C32(0x7e8b9c94), - SPH_C32(0x775a7a39), SPH_C32(0xc42af848), SPH_C32(0x69670000), - SPH_C32(0x20160000), SPH_C32(0xf5d70079), SPH_C32(0x48ea2000), - SPH_C32(0x2cef06f4), SPH_C32(0x7f433760), SPH_C32(0x14672d0f), - SPH_C32(0xe5ae375b) }, - { SPH_C32(0x37180000), SPH_C32(0x60710000), SPH_C32(0x664a0031), - SPH_C32(0x3a9e2000), SPH_C32(0x64511345), SPH_C32(0x0726a349), - SPH_C32(0xdb298456), SPH_C32(0xfe6e81f9), SPH_C32(0x743d0000), - SPH_C32(0x0b640000), SPH_C32(0xbd5a0079), SPH_C32(0xe78b3800), - SPH_C32(0x09242831), SPH_C32(0xb73a88b0), SPH_C32(0x95c52926), - SPH_C32(0xfbdb01fd) }, - { SPH_C32(0x01dd0000), SPH_C32(0x80a80000), SPH_C32(0xf4960048), - SPH_C32(0xa6000000), SPH_C32(0x90d57ea2), SPH_C32(0xd7e68c37), - SPH_C32(0x6612cffd), SPH_C32(0x2c94459e), SPH_C32(0x52500000), - SPH_C32(0x29540000), SPH_C32(0x6a61004e), SPH_C32(0xf0ff0000), - SPH_C32(0x9a317eec), SPH_C32(0x452341ce), SPH_C32(0xcf568fe5), - SPH_C32(0x5303130f) }, - { SPH_C32(0x599e0000), SPH_C32(0x00d60000), SPH_C32(0x8ca50049), - SPH_C32(0x606b3800), SPH_C32(0x77e2227e), SPH_C32(0xae4bb3ea), - SPH_C32(0xca613192), SPH_C32(0x16d03c2f), SPH_C32(0x4f0a0000), - SPH_C32(0x02260000), SPH_C32(0x22ec004e), SPH_C32(0x5f9e1800), - SPH_C32(0xbffa5029), SPH_C32(0x8d5afe1e), SPH_C32(0x4ef48bcc), - SPH_C32(0x4d7625a9) }, - { SPH_C32(0x1c870000), SPH_C32(0xabda0000), SPH_C32(0xbc1b0048), - SPH_C32(0x09611800), SPH_C32(0xb51e5067), SPH_C32(0x1f9f33e7), - SPH_C32(0xe7b0cbd4), SPH_C32(0x32e17338), SPH_C32(0x17490000), - SPH_C32(0x82580000), SPH_C32(0x5adf004f), SPH_C32(0x99f52000), - SPH_C32(0x58cd0cf5), SPH_C32(0xf4f7c1c3), SPH_C32(0xe28775a3), - SPH_C32(0x77325c18) }, - { SPH_C32(0x44c40000), SPH_C32(0x2ba40000), SPH_C32(0xc4280049), - SPH_C32(0xcf0a2000), SPH_C32(0x52290cbb), SPH_C32(0x66320c3a), - SPH_C32(0x4bc335bb), SPH_C32(0x08a50a89), SPH_C32(0x0a130000), - SPH_C32(0xa92a0000), SPH_C32(0x1252004f), SPH_C32(0x36943800), - SPH_C32(0x7d062230), SPH_C32(0x3c8e7e13), SPH_C32(0x6325718a), - SPH_C32(0x69476abe) }, - { SPH_C32(0xa4e60000), SPH_C32(0x948e0000), SPH_C32(0xbaa60056), - SPH_C32(0xdaae0000), SPH_C32(0x1f4b7377), SPH_C32(0xaf39260a), - SPH_C32(0x9123a725), SPH_C32(0x278f0cd8), SPH_C32(0x55bd0000), - SPH_C32(0x9b040000), SPH_C32(0xed150044), SPH_C32(0x67f20000), - SPH_C32(0xd9435d42), SPH_C32(0x0de42f6a), SPH_C32(0x3b2eedc7), - SPH_C32(0xc376a2c1) }, - { SPH_C32(0xfca50000), SPH_C32(0x14f00000), SPH_C32(0xc2950057), - SPH_C32(0x1cc53800), SPH_C32(0xf87c2fab), SPH_C32(0xd69419d7), - SPH_C32(0x3d50594a), SPH_C32(0x1dcb7569), SPH_C32(0x48e70000), - SPH_C32(0xb0760000), SPH_C32(0xa5980044), SPH_C32(0xc8931800), - SPH_C32(0xfc887387), SPH_C32(0xc59d90ba), SPH_C32(0xba8ce9ee), - SPH_C32(0xdd039467) }, - { SPH_C32(0xb9bc0000), SPH_C32(0xbffc0000), SPH_C32(0xf22b0056), - SPH_C32(0x75cf1800), SPH_C32(0x3a805db2), SPH_C32(0x674099da), - SPH_C32(0x1081a30c), SPH_C32(0x39fa3a7e), SPH_C32(0x10a40000), - SPH_C32(0x30080000), SPH_C32(0xddab0045), SPH_C32(0x0ef82000), - SPH_C32(0x1bbf2f5b), SPH_C32(0xbc30af67), SPH_C32(0x16ff1781), - SPH_C32(0xe747edd6) }, - { SPH_C32(0xe1ff0000), SPH_C32(0x3f820000), SPH_C32(0x8a180057), - SPH_C32(0xb3a42000), SPH_C32(0xddb7016e), SPH_C32(0x1eeda607), - SPH_C32(0xbcf25d63), SPH_C32(0x03be43cf), SPH_C32(0x0dfe0000), - SPH_C32(0x1b7a0000), SPH_C32(0x95260045), SPH_C32(0xa1993800), - SPH_C32(0x3e74019e), SPH_C32(0x744910b7), SPH_C32(0x975d13a8), - SPH_C32(0xf932db70) }, - { SPH_C32(0x06300000), SPH_C32(0x32f80000), SPH_C32(0x73e20042), - SPH_C32(0x310d0000), SPH_C32(0xd3a75d0c), SPH_C32(0x9f21e293), - SPH_C32(0x926aaddf), SPH_C32(0xbce1f450), SPH_C32(0xf0860000), - SPH_C32(0x8f220000), SPH_C32(0xa325005a), SPH_C32(0x1b5c0000), - SPH_C32(0x56dd5097), SPH_C32(0x753b8557), SPH_C32(0xcc1f851f), - SPH_C32(0xc86deb87) }, - { SPH_C32(0x5e730000), SPH_C32(0xb2860000), SPH_C32(0x0bd10043), - SPH_C32(0xf7663800), SPH_C32(0x349001d0), SPH_C32(0xe68cdd4e), - SPH_C32(0x3e1953b0), SPH_C32(0x86a58de1), SPH_C32(0xeddc0000), - SPH_C32(0xa4500000), SPH_C32(0xeba8005a), SPH_C32(0xb43d1800), - SPH_C32(0x73167e52), SPH_C32(0xbd423a87), SPH_C32(0x4dbd8136), - SPH_C32(0xd618dd21) }, - { SPH_C32(0x1b6a0000), SPH_C32(0x198a0000), SPH_C32(0x3b6f0042), - SPH_C32(0x9e6c1800), SPH_C32(0xf66c73c9), SPH_C32(0x57585d43), - SPH_C32(0x13c8a9f6), SPH_C32(0xa294c2f6), SPH_C32(0xb59f0000), - SPH_C32(0x242e0000), SPH_C32(0x939b005b), SPH_C32(0x72562000), - SPH_C32(0x9421228e), SPH_C32(0xc4ef055a), SPH_C32(0xe1ce7f59), - SPH_C32(0xec5ca490) }, - { SPH_C32(0x43290000), SPH_C32(0x99f40000), SPH_C32(0x435c0043), - SPH_C32(0x58072000), SPH_C32(0x115b2f15), SPH_C32(0x2ef5629e), - SPH_C32(0xbfbb5799), SPH_C32(0x98d0bb47), SPH_C32(0xa8c50000), - SPH_C32(0x0f5c0000), SPH_C32(0xdb16005b), SPH_C32(0xdd373800), - SPH_C32(0xb1ea0c4b), SPH_C32(0x0c96ba8a), SPH_C32(0x606c7b70), - SPH_C32(0xf2299236) }, - { SPH_C32(0xa30b0000), SPH_C32(0x26de0000), SPH_C32(0x3dd2005c), - SPH_C32(0x4da30000), SPH_C32(0x5c3950d9), SPH_C32(0xe7fe48ae), - SPH_C32(0x655bc507), SPH_C32(0xb7fabd16), SPH_C32(0xf76b0000), - SPH_C32(0x3d720000), SPH_C32(0x24510050), SPH_C32(0x8c510000), - SPH_C32(0x15af7339), SPH_C32(0x3dfcebf3), SPH_C32(0x3867e73d), - SPH_C32(0x58185a49) }, - { SPH_C32(0xfb480000), SPH_C32(0xa6a00000), SPH_C32(0x45e1005d), - SPH_C32(0x8bc83800), SPH_C32(0xbb0e0c05), SPH_C32(0x9e537773), - SPH_C32(0xc9283b68), SPH_C32(0x8dbec4a7), SPH_C32(0xea310000), - SPH_C32(0x16000000), SPH_C32(0x6cdc0050), SPH_C32(0x23301800), - SPH_C32(0x30645dfc), SPH_C32(0xf5855423), SPH_C32(0xb9c5e314), - SPH_C32(0x466d6cef) }, - { SPH_C32(0xbe510000), SPH_C32(0x0dac0000), SPH_C32(0x755f005c), - SPH_C32(0xe2c21800), SPH_C32(0x79f27e1c), SPH_C32(0x2f87f77e), - SPH_C32(0xe4f9c12e), SPH_C32(0xa98f8bb0), SPH_C32(0xb2720000), - SPH_C32(0x967e0000), SPH_C32(0x14ef0051), SPH_C32(0xe55b2000), - SPH_C32(0xd7530120), SPH_C32(0x8c286bfe), SPH_C32(0x15b61d7b), - SPH_C32(0x7c29155e) }, - { SPH_C32(0xe6120000), SPH_C32(0x8dd20000), SPH_C32(0x0d6c005d), - SPH_C32(0x24a92000), SPH_C32(0x9ec522c0), SPH_C32(0x562ac8a3), - SPH_C32(0x488a3f41), SPH_C32(0x93cbf201), SPH_C32(0xaf280000), - SPH_C32(0xbd0c0000), SPH_C32(0x5c620051), SPH_C32(0x4a3a3800), - SPH_C32(0xf2982fe5), SPH_C32(0x4451d42e), SPH_C32(0x94141952), - SPH_C32(0x625c23f8) }, - { SPH_C32(0x89450000), SPH_C32(0x9f3c0000), SPH_C32(0x8b590066), - SPH_C32(0x5d4e0000), SPH_C32(0x618d7938), SPH_C32(0xb6481d50), - SPH_C32(0xce87bf91), SPH_C32(0xca84310a), SPH_C32(0x59920000), - SPH_C32(0xf2370000), SPH_C32(0x14e90042), SPH_C32(0xe5790000), - SPH_C32(0x0bcc361f), SPH_C32(0x30a2fa8d), SPH_C32(0x3b36cb7b), - SPH_C32(0x8bb5076c) }, - { SPH_C32(0xd1060000), SPH_C32(0x1f420000), SPH_C32(0xf36a0067), - SPH_C32(0x9b253800), SPH_C32(0x86ba25e4), SPH_C32(0xcfe5228d), - SPH_C32(0x62f441fe), SPH_C32(0xf0c048bb), SPH_C32(0x44c80000), - SPH_C32(0xd9450000), SPH_C32(0x5c640042), SPH_C32(0x4a181800), - SPH_C32(0x2e0718da), SPH_C32(0xf8db455d), SPH_C32(0xba94cf52), - SPH_C32(0x95c031ca) }, - { SPH_C32(0x941f0000), SPH_C32(0xb44e0000), SPH_C32(0xc3d40066), - SPH_C32(0xf22f1800), SPH_C32(0x444657fd), SPH_C32(0x7e31a280), - SPH_C32(0x4f25bbb8), SPH_C32(0xd4f107ac), SPH_C32(0x1c8b0000), - SPH_C32(0x593b0000), SPH_C32(0x24570043), SPH_C32(0x8c732000), - SPH_C32(0xc9304406), SPH_C32(0x81767a80), SPH_C32(0x16e7313d), - SPH_C32(0xaf84487b) }, - { SPH_C32(0xcc5c0000), SPH_C32(0x34300000), SPH_C32(0xbbe70067), - SPH_C32(0x34442000), SPH_C32(0xa3710b21), SPH_C32(0x079c9d5d), - SPH_C32(0xe35645d7), SPH_C32(0xeeb57e1d), SPH_C32(0x01d10000), - SPH_C32(0x72490000), SPH_C32(0x6cda0043), SPH_C32(0x23123800), - SPH_C32(0xecfb6ac3), SPH_C32(0x490fc550), SPH_C32(0x97453514), - SPH_C32(0xb1f17edd) }, - { SPH_C32(0x2c7e0000), SPH_C32(0x8b1a0000), SPH_C32(0xc5690078), - SPH_C32(0x21e00000), SPH_C32(0xee1374ed), SPH_C32(0xce97b76d), - SPH_C32(0x39b6d749), SPH_C32(0xc19f784c), SPH_C32(0x5e7f0000), - SPH_C32(0x40670000), SPH_C32(0x939d0048), SPH_C32(0x72740000), - SPH_C32(0x48be15b1), SPH_C32(0x78659429), SPH_C32(0xcf4ea959), - SPH_C32(0x1bc0b6a2) }, - { SPH_C32(0x743d0000), SPH_C32(0x0b640000), SPH_C32(0xbd5a0079), - SPH_C32(0xe78b3800), SPH_C32(0x09242831), SPH_C32(0xb73a88b0), - SPH_C32(0x95c52926), SPH_C32(0xfbdb01fd), SPH_C32(0x43250000), - SPH_C32(0x6b150000), SPH_C32(0xdb100048), SPH_C32(0xdd151800), - SPH_C32(0x6d753b74), SPH_C32(0xb01c2bf9), SPH_C32(0x4eecad70), - SPH_C32(0x05b58004) }, - { SPH_C32(0x31240000), SPH_C32(0xa0680000), SPH_C32(0x8de40078), - SPH_C32(0x8e811800), SPH_C32(0xcbd85a28), SPH_C32(0x06ee08bd), - SPH_C32(0xb814d360), SPH_C32(0xdfea4eea), SPH_C32(0x1b660000), - SPH_C32(0xeb6b0000), SPH_C32(0xa3230049), SPH_C32(0x1b7e2000), - SPH_C32(0x8a4267a8), SPH_C32(0xc9b11424), SPH_C32(0xe29f531f), - SPH_C32(0x3ff1f9b5) }, - { SPH_C32(0x69670000), SPH_C32(0x20160000), SPH_C32(0xf5d70079), - SPH_C32(0x48ea2000), SPH_C32(0x2cef06f4), SPH_C32(0x7f433760), - SPH_C32(0x14672d0f), SPH_C32(0xe5ae375b), SPH_C32(0x063c0000), - SPH_C32(0xc0190000), SPH_C32(0xebae0049), SPH_C32(0xb41f3800), - SPH_C32(0xaf89496d), SPH_C32(0x01c8abf4), SPH_C32(0x633d5736), - SPH_C32(0x2184cf13) }, - { SPH_C32(0x8ea80000), SPH_C32(0x2d6c0000), SPH_C32(0x0c2d006c), - SPH_C32(0xca430000), SPH_C32(0x22ff5a96), SPH_C32(0xfe8f73f4), - SPH_C32(0x3affddb3), SPH_C32(0x5af180c4), SPH_C32(0xfb440000), - SPH_C32(0x54410000), SPH_C32(0xddad0056), SPH_C32(0x0eda0000), - SPH_C32(0xc7201864), SPH_C32(0x00ba3e14), SPH_C32(0x387fc181), - SPH_C32(0x10dbffe4) }, - { SPH_C32(0xd6eb0000), SPH_C32(0xad120000), SPH_C32(0x741e006d), - SPH_C32(0x0c283800), SPH_C32(0xc5c8064a), SPH_C32(0x87224c29), - SPH_C32(0x968c23dc), SPH_C32(0x60b5f975), SPH_C32(0xe61e0000), - SPH_C32(0x7f330000), SPH_C32(0x95200056), SPH_C32(0xa1bb1800), - SPH_C32(0xe2eb36a1), SPH_C32(0xc8c381c4), SPH_C32(0xb9ddc5a8), - SPH_C32(0x0eaec942) }, - { SPH_C32(0x93f20000), SPH_C32(0x061e0000), SPH_C32(0x44a0006c), - SPH_C32(0x65221800), SPH_C32(0x07347453), SPH_C32(0x36f6cc24), - SPH_C32(0xbb5dd99a), SPH_C32(0x4484b662), SPH_C32(0xbe5d0000), - SPH_C32(0xff4d0000), SPH_C32(0xed130057), SPH_C32(0x67d02000), - SPH_C32(0x05dc6a7d), SPH_C32(0xb16ebe19), SPH_C32(0x15ae3bc7), - SPH_C32(0x34eab0f3) }, - { SPH_C32(0xcbb10000), SPH_C32(0x86600000), SPH_C32(0x3c93006d), - SPH_C32(0xa3492000), SPH_C32(0xe003288f), SPH_C32(0x4f5bf3f9), - SPH_C32(0x172e27f5), SPH_C32(0x7ec0cfd3), SPH_C32(0xa3070000), - SPH_C32(0xd43f0000), SPH_C32(0xa59e0057), SPH_C32(0xc8b13800), - SPH_C32(0x201744b8), SPH_C32(0x791701c9), SPH_C32(0x940c3fee), - SPH_C32(0x2a9f8655) }, - { SPH_C32(0x2b930000), SPH_C32(0x394a0000), SPH_C32(0x421d0072), - SPH_C32(0xb6ed0000), SPH_C32(0xad615743), SPH_C32(0x8650d9c9), - SPH_C32(0xcdceb56b), SPH_C32(0x51eac982), SPH_C32(0xfca90000), - SPH_C32(0xe6110000), SPH_C32(0x5ad9005c), SPH_C32(0x99d70000), - SPH_C32(0x84523bca), SPH_C32(0x487d50b0), SPH_C32(0xcc07a3a3), - SPH_C32(0x80ae4e2a) }, - { SPH_C32(0x73d00000), SPH_C32(0xb9340000), SPH_C32(0x3a2e0073), - SPH_C32(0x70863800), SPH_C32(0x4a560b9f), SPH_C32(0xfffde614), - SPH_C32(0x61bd4b04), SPH_C32(0x6baeb033), SPH_C32(0xe1f30000), - SPH_C32(0xcd630000), SPH_C32(0x1254005c), SPH_C32(0x36b61800), - SPH_C32(0xa199150f), SPH_C32(0x8004ef60), SPH_C32(0x4da5a78a), - SPH_C32(0x9edb788c) }, - { SPH_C32(0x36c90000), SPH_C32(0x12380000), SPH_C32(0x0a900072), - SPH_C32(0x198c1800), SPH_C32(0x88aa7986), SPH_C32(0x4e296619), - SPH_C32(0x4c6cb142), SPH_C32(0x4f9fff24), SPH_C32(0xb9b00000), - SPH_C32(0x4d1d0000), SPH_C32(0x6a67005d), SPH_C32(0xf0dd2000), - SPH_C32(0x46ae49d3), SPH_C32(0xf9a9d0bd), SPH_C32(0xe1d659e5), - SPH_C32(0xa49f013d) }, - { SPH_C32(0x6e8a0000), SPH_C32(0x92460000), SPH_C32(0x72a30073), - SPH_C32(0xdfe72000), SPH_C32(0x6f9d255a), SPH_C32(0x378459c4), - SPH_C32(0xe01f4f2d), SPH_C32(0x75db8695), SPH_C32(0xa4ea0000), - SPH_C32(0x666f0000), SPH_C32(0x22ea005d), SPH_C32(0x5fbc3800), - SPH_C32(0x63656716), SPH_C32(0x31d06f6d), SPH_C32(0x60745dcc), - SPH_C32(0xbaea379b) }, - { SPH_C32(0x0a1f0000), SPH_C32(0x5bcb0000), SPH_C32(0x8a1e0044), - SPH_C32(0xb3860000), SPH_C32(0x01283651), SPH_C32(0xa2673774), - SPH_C32(0x92728b63), SPH_C32(0xf42251fd), SPH_C32(0xd10a0000), - SPH_C32(0xeda30000), SPH_C32(0x6b26006c), SPH_C32(0x1e370000), - SPH_C32(0xfa943185), SPH_C32(0x510c6bea), SPH_C32(0x93a3bb17), - SPH_C32(0x6da573f8) }, - { SPH_C32(0x525c0000), SPH_C32(0xdbb50000), SPH_C32(0xf22d0045), - SPH_C32(0x75ed3800), SPH_C32(0xe61f6a8d), SPH_C32(0xdbca08a9), - SPH_C32(0x3e01750c), SPH_C32(0xce66284c), SPH_C32(0xcc500000), - SPH_C32(0xc6d10000), SPH_C32(0x23ab006c), SPH_C32(0xb1561800), - SPH_C32(0xdf5f1f40), SPH_C32(0x9975d43a), SPH_C32(0x1201bf3e), - SPH_C32(0x73d0455e) }, - { SPH_C32(0x17450000), SPH_C32(0x70b90000), SPH_C32(0xc2930044), - SPH_C32(0x1ce71800), SPH_C32(0x24e31894), SPH_C32(0x6a1e88a4), - SPH_C32(0x13d08f4a), SPH_C32(0xea57675b), SPH_C32(0x94130000), - SPH_C32(0x46af0000), SPH_C32(0x5b98006d), SPH_C32(0x773d2000), - SPH_C32(0x3868439c), SPH_C32(0xe0d8ebe7), SPH_C32(0xbe724151), - SPH_C32(0x49943cef) }, - { SPH_C32(0x4f060000), SPH_C32(0xf0c70000), SPH_C32(0xbaa00045), - SPH_C32(0xda8c2000), SPH_C32(0xc3d44448), SPH_C32(0x13b3b779), - SPH_C32(0xbfa37125), SPH_C32(0xd0131eea), SPH_C32(0x89490000), - SPH_C32(0x6ddd0000), SPH_C32(0x1315006d), SPH_C32(0xd85c3800), - SPH_C32(0x1da36d59), SPH_C32(0x28a15437), SPH_C32(0x3fd04578), - SPH_C32(0x57e10a49) }, - { SPH_C32(0xaf240000), SPH_C32(0x4fed0000), SPH_C32(0xc42e005a), - SPH_C32(0xcf280000), SPH_C32(0x8eb63b84), SPH_C32(0xdab89d49), - SPH_C32(0x6543e3bb), SPH_C32(0xff3918bb), SPH_C32(0xd6e70000), - SPH_C32(0x5ff30000), SPH_C32(0xec520066), SPH_C32(0x893a0000), - SPH_C32(0xb9e6122b), SPH_C32(0x19cb054e), SPH_C32(0x67dbd935), - SPH_C32(0xfdd0c236) }, - { SPH_C32(0xf7670000), SPH_C32(0xcf930000), SPH_C32(0xbc1d005b), - SPH_C32(0x09433800), SPH_C32(0x69816758), SPH_C32(0xa315a294), - SPH_C32(0xc9301dd4), SPH_C32(0xc57d610a), SPH_C32(0xcbbd0000), - SPH_C32(0x74810000), SPH_C32(0xa4df0066), SPH_C32(0x265b1800), - SPH_C32(0x9c2d3cee), SPH_C32(0xd1b2ba9e), SPH_C32(0xe679dd1c), - SPH_C32(0xe3a5f490) }, - { SPH_C32(0xb27e0000), SPH_C32(0x649f0000), SPH_C32(0x8ca3005a), - SPH_C32(0x60491800), SPH_C32(0xab7d1541), SPH_C32(0x12c12299), - SPH_C32(0xe4e1e792), SPH_C32(0xe14c2e1d), SPH_C32(0x93fe0000), - SPH_C32(0xf4ff0000), SPH_C32(0xdcec0067), SPH_C32(0xe0302000), - SPH_C32(0x7b1a6032), SPH_C32(0xa81f8543), SPH_C32(0x4a0a2373), - SPH_C32(0xd9e18d21) }, - { SPH_C32(0xea3d0000), SPH_C32(0xe4e10000), SPH_C32(0xf490005b), - SPH_C32(0xa6222000), SPH_C32(0x4c4a499d), SPH_C32(0x6b6c1d44), - SPH_C32(0x489219fd), SPH_C32(0xdb0857ac), SPH_C32(0x8ea40000), - SPH_C32(0xdf8d0000), SPH_C32(0x94610067), SPH_C32(0x4f513800), - SPH_C32(0x5ed14ef7), SPH_C32(0x60663a93), SPH_C32(0xcba8275a), - SPH_C32(0xc794bb87) }, - { SPH_C32(0x0df20000), SPH_C32(0xe99b0000), SPH_C32(0x0d6a004e), - SPH_C32(0x248b0000), SPH_C32(0x425a15ff), SPH_C32(0xeaa059d0), - SPH_C32(0x660ae941), SPH_C32(0x6457e033), SPH_C32(0x73dc0000), - SPH_C32(0x4bd50000), SPH_C32(0xa2620078), SPH_C32(0xf5940000), - SPH_C32(0x36781ffe), SPH_C32(0x6114af73), SPH_C32(0x90eab1ed), - SPH_C32(0xf6cb8b70) }, - { SPH_C32(0x55b10000), SPH_C32(0x69e50000), SPH_C32(0x7559004f), - SPH_C32(0xe2e03800), SPH_C32(0xa56d4923), SPH_C32(0x930d660d), - SPH_C32(0xca79172e), SPH_C32(0x5e139982), SPH_C32(0x6e860000), - SPH_C32(0x60a70000), SPH_C32(0xeaef0078), SPH_C32(0x5af51800), - SPH_C32(0x13b3313b), SPH_C32(0xa96d10a3), SPH_C32(0x1148b5c4), - SPH_C32(0xe8bebdd6) }, - { SPH_C32(0x10a80000), SPH_C32(0xc2e90000), SPH_C32(0x45e7004e), - SPH_C32(0x8bea1800), SPH_C32(0x67913b3a), SPH_C32(0x22d9e600), - SPH_C32(0xe7a8ed68), SPH_C32(0x7a22d695), SPH_C32(0x36c50000), - SPH_C32(0xe0d90000), SPH_C32(0x92dc0079), SPH_C32(0x9c9e2000), - SPH_C32(0xf4846de7), SPH_C32(0xd0c02f7e), SPH_C32(0xbd3b4bab), - SPH_C32(0xd2fac467) }, - { SPH_C32(0x48eb0000), SPH_C32(0x42970000), SPH_C32(0x3dd4004f), - SPH_C32(0x4d812000), SPH_C32(0x80a667e6), SPH_C32(0x5b74d9dd), - SPH_C32(0x4bdb1307), SPH_C32(0x4066af24), SPH_C32(0x2b9f0000), - SPH_C32(0xcbab0000), SPH_C32(0xda510079), SPH_C32(0x33ff3800), - SPH_C32(0xd14f4322), SPH_C32(0x18b990ae), SPH_C32(0x3c994f82), - SPH_C32(0xcc8ff2c1) }, - { SPH_C32(0xa8c90000), SPH_C32(0xfdbd0000), SPH_C32(0x435a0050), - SPH_C32(0x58250000), SPH_C32(0xcdc4182a), SPH_C32(0x927ff3ed), - SPH_C32(0x913b8199), SPH_C32(0x6f4ca975), SPH_C32(0x74310000), - SPH_C32(0xf9850000), SPH_C32(0x25160072), SPH_C32(0x62990000), - SPH_C32(0x750a3c50), SPH_C32(0x29d3c1d7), SPH_C32(0x6492d3cf), - SPH_C32(0x66be3abe) }, - { SPH_C32(0xf08a0000), SPH_C32(0x7dc30000), SPH_C32(0x3b690051), - SPH_C32(0x9e4e3800), SPH_C32(0x2af344f6), SPH_C32(0xebd2cc30), - SPH_C32(0x3d487ff6), SPH_C32(0x5508d0c4), SPH_C32(0x696b0000), - SPH_C32(0xd2f70000), SPH_C32(0x6d9b0072), SPH_C32(0xcdf81800), - SPH_C32(0x50c11295), SPH_C32(0xe1aa7e07), SPH_C32(0xe530d7e6), - SPH_C32(0x78cb0c18) }, - { SPH_C32(0xb5930000), SPH_C32(0xd6cf0000), SPH_C32(0x0bd70050), - SPH_C32(0xf7441800), SPH_C32(0xe80f36ef), SPH_C32(0x5a064c3d), - SPH_C32(0x109985b0), SPH_C32(0x71399fd3), SPH_C32(0x31280000), - SPH_C32(0x52890000), SPH_C32(0x15a80073), SPH_C32(0x0b932000), - SPH_C32(0xb7f64e49), SPH_C32(0x980741da), SPH_C32(0x49432989), - SPH_C32(0x428f75a9) }, - { SPH_C32(0xedd00000), SPH_C32(0x56b10000), SPH_C32(0x73e40051), - SPH_C32(0x312f2000), SPH_C32(0x0f386a33), SPH_C32(0x23ab73e0), - SPH_C32(0xbcea7bdf), SPH_C32(0x4b7de662), SPH_C32(0x2c720000), - SPH_C32(0x79fb0000), SPH_C32(0x5d250073), SPH_C32(0xa4f23800), - SPH_C32(0x923d608c), SPH_C32(0x507efe0a), SPH_C32(0xc8e12da0), - SPH_C32(0x5cfa430f) }, - { SPH_C32(0x82870000), SPH_C32(0x445f0000), SPH_C32(0xf5d1006a), - SPH_C32(0x48c80000), SPH_C32(0xf07031cb), SPH_C32(0xc3c9a613), - SPH_C32(0x3ae7fb0f), SPH_C32(0x12322569), SPH_C32(0xdac80000), - SPH_C32(0x36c00000), SPH_C32(0x15ae0060), SPH_C32(0x0bb10000), - SPH_C32(0x6b697976), SPH_C32(0x248dd0a9), SPH_C32(0x67c3ff89), - SPH_C32(0xb513679b) }, - { SPH_C32(0xdac40000), SPH_C32(0xc4210000), SPH_C32(0x8de2006b), - SPH_C32(0x8ea33800), SPH_C32(0x17476d17), SPH_C32(0xba6499ce), - SPH_C32(0x96940560), SPH_C32(0x28765cd8), SPH_C32(0xc7920000), - SPH_C32(0x1db20000), SPH_C32(0x5d230060), SPH_C32(0xa4d01800), - SPH_C32(0x4ea257b3), SPH_C32(0xecf46f79), SPH_C32(0xe661fba0), - SPH_C32(0xab66513d) }, - { SPH_C32(0x9fdd0000), SPH_C32(0x6f2d0000), SPH_C32(0xbd5c006a), - SPH_C32(0xe7a91800), SPH_C32(0xd5bb1f0e), SPH_C32(0x0bb019c3), - SPH_C32(0xbb45ff26), SPH_C32(0x0c4713cf), SPH_C32(0x9fd10000), - SPH_C32(0x9dcc0000), SPH_C32(0x25100061), SPH_C32(0x62bb2000), - SPH_C32(0xa9950b6f), SPH_C32(0x955950a4), SPH_C32(0x4a1205cf), - SPH_C32(0x9122288c) }, - { SPH_C32(0xc79e0000), SPH_C32(0xef530000), SPH_C32(0xc56f006b), - SPH_C32(0x21c22000), SPH_C32(0x328c43d2), SPH_C32(0x721d261e), - SPH_C32(0x17360149), SPH_C32(0x36036a7e), SPH_C32(0x828b0000), - SPH_C32(0xb6be0000), SPH_C32(0x6d9d0061), SPH_C32(0xcdda3800), - SPH_C32(0x8c5e25aa), SPH_C32(0x5d20ef74), SPH_C32(0xcbb001e6), - SPH_C32(0x8f571e2a) }, - { SPH_C32(0x27bc0000), SPH_C32(0x50790000), SPH_C32(0xbbe10074), - SPH_C32(0x34660000), SPH_C32(0x7fee3c1e), SPH_C32(0xbb160c2e), - SPH_C32(0xcdd693d7), SPH_C32(0x19296c2f), SPH_C32(0xdd250000), - SPH_C32(0x84900000), SPH_C32(0x92da006a), SPH_C32(0x9cbc0000), - SPH_C32(0x281b5ad8), SPH_C32(0x6c4abe0d), SPH_C32(0x93bb9dab), - SPH_C32(0x2566d655) }, - { SPH_C32(0x7fff0000), SPH_C32(0xd0070000), SPH_C32(0xc3d20075), - SPH_C32(0xf20d3800), SPH_C32(0x98d960c2), SPH_C32(0xc2bb33f3), - SPH_C32(0x61a56db8), SPH_C32(0x236d159e), SPH_C32(0xc07f0000), - SPH_C32(0xafe20000), SPH_C32(0xda57006a), SPH_C32(0x33dd1800), - SPH_C32(0x0dd0741d), SPH_C32(0xa43301dd), SPH_C32(0x12199982), - SPH_C32(0x3b13e0f3) }, - { SPH_C32(0x3ae60000), SPH_C32(0x7b0b0000), SPH_C32(0xf36c0074), - SPH_C32(0x9b071800), SPH_C32(0x5a2512db), SPH_C32(0x736fb3fe), - SPH_C32(0x4c7497fe), SPH_C32(0x075c5a89), SPH_C32(0x983c0000), - SPH_C32(0x2f9c0000), SPH_C32(0xa264006b), SPH_C32(0xf5b62000), - SPH_C32(0xeae728c1), SPH_C32(0xdd9e3e00), SPH_C32(0xbe6a67ed), - SPH_C32(0x01579942) }, - { SPH_C32(0x62a50000), SPH_C32(0xfb750000), SPH_C32(0x8b5f0075), - SPH_C32(0x5d6c2000), SPH_C32(0xbd124e07), SPH_C32(0x0ac28c23), - SPH_C32(0xe0076991), SPH_C32(0x3d182338), SPH_C32(0x85660000), - SPH_C32(0x04ee0000), SPH_C32(0xeae9006b), SPH_C32(0x5ad73800), - SPH_C32(0xcf2c0604), SPH_C32(0x15e781d0), SPH_C32(0x3fc863c4), - SPH_C32(0x1f22afe4) }, - { SPH_C32(0x856a0000), SPH_C32(0xf60f0000), SPH_C32(0x72a50060), - SPH_C32(0xdfc50000), SPH_C32(0xb3021265), SPH_C32(0x8b0ec8b7), - SPH_C32(0xce9f992d), SPH_C32(0x824794a7), SPH_C32(0x781e0000), - SPH_C32(0x90b60000), SPH_C32(0xdcea0074), SPH_C32(0xe0120000), - SPH_C32(0xa785570d), SPH_C32(0x14951430), SPH_C32(0x648af573), - SPH_C32(0x2e7d9f13) }, - { SPH_C32(0xdd290000), SPH_C32(0x76710000), SPH_C32(0x0a960061), - SPH_C32(0x19ae3800), SPH_C32(0x54354eb9), SPH_C32(0xf2a3f76a), - SPH_C32(0x62ec6742), SPH_C32(0xb803ed16), SPH_C32(0x65440000), - SPH_C32(0xbbc40000), SPH_C32(0x94670074), SPH_C32(0x4f731800), - SPH_C32(0x824e79c8), SPH_C32(0xdcecabe0), SPH_C32(0xe528f15a), - SPH_C32(0x3008a9b5) }, - { SPH_C32(0x98300000), SPH_C32(0xdd7d0000), SPH_C32(0x3a280060), - SPH_C32(0x70a41800), SPH_C32(0x96c93ca0), SPH_C32(0x43777767), - SPH_C32(0x4f3d9d04), SPH_C32(0x9c32a201), SPH_C32(0x3d070000), - SPH_C32(0x3bba0000), SPH_C32(0xec540075), SPH_C32(0x89182000), - SPH_C32(0x65792514), SPH_C32(0xa541943d), SPH_C32(0x495b0f35), - SPH_C32(0x0a4cd004) }, - { SPH_C32(0xc0730000), SPH_C32(0x5d030000), SPH_C32(0x421b0061), - SPH_C32(0xb6cf2000), SPH_C32(0x71fe607c), SPH_C32(0x3ada48ba), - SPH_C32(0xe34e636b), SPH_C32(0xa676dbb0), SPH_C32(0x205d0000), - SPH_C32(0x10c80000), SPH_C32(0xa4d90075), SPH_C32(0x26793800), - SPH_C32(0x40b20bd1), SPH_C32(0x6d382bed), SPH_C32(0xc8f90b1c), - SPH_C32(0x1439e6a2) }, - { SPH_C32(0x20510000), SPH_C32(0xe2290000), SPH_C32(0x3c95007e), - SPH_C32(0xa36b0000), SPH_C32(0x3c9c1fb0), SPH_C32(0xf3d1628a), - SPH_C32(0x39aef1f5), SPH_C32(0x895cdde1), SPH_C32(0x7ff30000), - SPH_C32(0x22e60000), SPH_C32(0x5b9e007e), SPH_C32(0x771f0000), - SPH_C32(0xe4f774a3), SPH_C32(0x5c527a94), SPH_C32(0x90f29751), - SPH_C32(0xbe082edd) }, - { SPH_C32(0x78120000), SPH_C32(0x62570000), SPH_C32(0x44a6007f), - SPH_C32(0x65003800), SPH_C32(0xdbab436c), SPH_C32(0x8a7c5d57), - SPH_C32(0x95dd0f9a), SPH_C32(0xb318a450), SPH_C32(0x62a90000), - SPH_C32(0x09940000), SPH_C32(0x1313007e), SPH_C32(0xd87e1800), - SPH_C32(0xc13c5a66), SPH_C32(0x942bc544), SPH_C32(0x11509378), - SPH_C32(0xa07d187b) }, - { SPH_C32(0x3d0b0000), SPH_C32(0xc95b0000), SPH_C32(0x7418007e), - SPH_C32(0x0c0a1800), SPH_C32(0x19573175), SPH_C32(0x3ba8dd5a), - SPH_C32(0xb80cf5dc), SPH_C32(0x9729eb47), SPH_C32(0x3aea0000), - SPH_C32(0x89ea0000), SPH_C32(0x6b20007f), SPH_C32(0x1e152000), - SPH_C32(0x260b06ba), SPH_C32(0xed86fa99), SPH_C32(0xbd236d17), - SPH_C32(0x9a3961ca) }, - { SPH_C32(0x65480000), SPH_C32(0x49250000), SPH_C32(0x0c2b007f), - SPH_C32(0xca612000), SPH_C32(0xfe606da9), SPH_C32(0x4205e287), - SPH_C32(0x147f0bb3), SPH_C32(0xad6d92f6), SPH_C32(0x27b00000), - SPH_C32(0xa2980000), SPH_C32(0x23ad007f), SPH_C32(0xb1743800), - SPH_C32(0x03c0287f), SPH_C32(0x25ff4549), SPH_C32(0x3c81693e), - SPH_C32(0x844c576c) } -}; - -static const sph_u32 T512_48[256][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0xe6280000), SPH_C32(0x4c4b0000), SPH_C32(0xa8550000), - SPH_C32(0xd3d002e0), SPH_C32(0xd86130b8), SPH_C32(0x98a7b0da), - SPH_C32(0x289506b4), SPH_C32(0xd75a4897), SPH_C32(0xf0c50000), - SPH_C32(0x59230000), SPH_C32(0x45820000), SPH_C32(0xe18d00c0), - SPH_C32(0x3b6d0631), SPH_C32(0xc2ed5699), SPH_C32(0xcbe0fe1c), - SPH_C32(0x56a7b19f) }, - { SPH_C32(0xf0c50000), SPH_C32(0x59230000), SPH_C32(0x45820000), - SPH_C32(0xe18d00c0), SPH_C32(0x3b6d0631), SPH_C32(0xc2ed5699), - SPH_C32(0xcbe0fe1c), SPH_C32(0x56a7b19f), SPH_C32(0x16ed0000), - SPH_C32(0x15680000), SPH_C32(0xedd70000), SPH_C32(0x325d0220), - SPH_C32(0xe30c3689), SPH_C32(0x5a4ae643), SPH_C32(0xe375f8a8), - SPH_C32(0x81fdf908) }, - { SPH_C32(0x16ed0000), SPH_C32(0x15680000), SPH_C32(0xedd70000), - SPH_C32(0x325d0220), SPH_C32(0xe30c3689), SPH_C32(0x5a4ae643), - SPH_C32(0xe375f8a8), SPH_C32(0x81fdf908), SPH_C32(0xe6280000), - SPH_C32(0x4c4b0000), SPH_C32(0xa8550000), SPH_C32(0xd3d002e0), - SPH_C32(0xd86130b8), SPH_C32(0x98a7b0da), SPH_C32(0x289506b4), - SPH_C32(0xd75a4897) }, - { SPH_C32(0xb4310000), SPH_C32(0x77330000), SPH_C32(0xb15d0000), - SPH_C32(0x7fd004e0), SPH_C32(0x78a26138), SPH_C32(0xd116c35d), - SPH_C32(0xd256d489), SPH_C32(0x4e6f74de), SPH_C32(0xe3060000), - SPH_C32(0xbdc10000), SPH_C32(0x87130000), SPH_C32(0xbff20060), - SPH_C32(0x2eba0a1a), SPH_C32(0x8db53751), SPH_C32(0x73c5ab06), - SPH_C32(0x5bd61539) }, - { SPH_C32(0x52190000), SPH_C32(0x3b780000), SPH_C32(0x19080000), - SPH_C32(0xac000600), SPH_C32(0xa0c35180), SPH_C32(0x49b17387), - SPH_C32(0xfac3d23d), SPH_C32(0x99353c49), SPH_C32(0x13c30000), - SPH_C32(0xe4e20000), SPH_C32(0xc2910000), SPH_C32(0x5e7f00a0), - SPH_C32(0x15d70c2b), SPH_C32(0x4f5861c8), SPH_C32(0xb825551a), - SPH_C32(0x0d71a4a6) }, - { SPH_C32(0x44f40000), SPH_C32(0x2e100000), SPH_C32(0xf4df0000), - SPH_C32(0x9e5d0420), SPH_C32(0x43cf6709), SPH_C32(0x13fb95c4), - SPH_C32(0x19b62a95), SPH_C32(0x18c8c541), SPH_C32(0xf5eb0000), - SPH_C32(0xa8a90000), SPH_C32(0x6ac40000), SPH_C32(0x8daf0240), - SPH_C32(0xcdb63c93), SPH_C32(0xd7ffd112), SPH_C32(0x90b053ae), - SPH_C32(0xda2bec31) }, - { SPH_C32(0xa2dc0000), SPH_C32(0x625b0000), SPH_C32(0x5c8a0000), - SPH_C32(0x4d8d06c0), SPH_C32(0x9bae57b1), SPH_C32(0x8b5c251e), - SPH_C32(0x31232c21), SPH_C32(0xcf928dd6), SPH_C32(0x052e0000), - SPH_C32(0xf18a0000), SPH_C32(0x2f460000), SPH_C32(0x6c220280), - SPH_C32(0xf6db3aa2), SPH_C32(0x1512878b), SPH_C32(0x5b50adb2), - SPH_C32(0x8c8c5dae) }, - { SPH_C32(0xe3060000), SPH_C32(0xbdc10000), SPH_C32(0x87130000), - SPH_C32(0xbff20060), SPH_C32(0x2eba0a1a), SPH_C32(0x8db53751), - SPH_C32(0x73c5ab06), SPH_C32(0x5bd61539), SPH_C32(0x57370000), - SPH_C32(0xcaf20000), SPH_C32(0x364e0000), SPH_C32(0xc0220480), - SPH_C32(0x56186b22), SPH_C32(0x5ca3f40c), SPH_C32(0xa1937f8f), - SPH_C32(0x15b961e7) }, - { SPH_C32(0x052e0000), SPH_C32(0xf18a0000), SPH_C32(0x2f460000), - SPH_C32(0x6c220280), SPH_C32(0xf6db3aa2), SPH_C32(0x1512878b), - SPH_C32(0x5b50adb2), SPH_C32(0x8c8c5dae), SPH_C32(0xa7f20000), - SPH_C32(0x93d10000), SPH_C32(0x73cc0000), SPH_C32(0x21af0440), - SPH_C32(0x6d756d13), SPH_C32(0x9e4ea295), SPH_C32(0x6a738193), - SPH_C32(0x431ed078) }, - { SPH_C32(0x13c30000), SPH_C32(0xe4e20000), SPH_C32(0xc2910000), - SPH_C32(0x5e7f00a0), SPH_C32(0x15d70c2b), SPH_C32(0x4f5861c8), - SPH_C32(0xb825551a), SPH_C32(0x0d71a4a6), SPH_C32(0x41da0000), - SPH_C32(0xdf9a0000), SPH_C32(0xdb990000), SPH_C32(0xf27f06a0), - SPH_C32(0xb5145dab), SPH_C32(0x06e9124f), SPH_C32(0x42e68727), - SPH_C32(0x944498ef) }, - { SPH_C32(0xf5eb0000), SPH_C32(0xa8a90000), SPH_C32(0x6ac40000), - SPH_C32(0x8daf0240), SPH_C32(0xcdb63c93), SPH_C32(0xd7ffd112), - SPH_C32(0x90b053ae), SPH_C32(0xda2bec31), SPH_C32(0xb11f0000), - SPH_C32(0x86b90000), SPH_C32(0x9e1b0000), SPH_C32(0x13f20660), - SPH_C32(0x8e795b9a), SPH_C32(0xc40444d6), SPH_C32(0x8906793b), - SPH_C32(0xc2e32970) }, - { SPH_C32(0x57370000), SPH_C32(0xcaf20000), SPH_C32(0x364e0000), - SPH_C32(0xc0220480), SPH_C32(0x56186b22), SPH_C32(0x5ca3f40c), - SPH_C32(0xa1937f8f), SPH_C32(0x15b961e7), SPH_C32(0xb4310000), - SPH_C32(0x77330000), SPH_C32(0xb15d0000), SPH_C32(0x7fd004e0), - SPH_C32(0x78a26138), SPH_C32(0xd116c35d), SPH_C32(0xd256d489), - SPH_C32(0x4e6f74de) }, - { SPH_C32(0xb11f0000), SPH_C32(0x86b90000), SPH_C32(0x9e1b0000), - SPH_C32(0x13f20660), SPH_C32(0x8e795b9a), SPH_C32(0xc40444d6), - SPH_C32(0x8906793b), SPH_C32(0xc2e32970), SPH_C32(0x44f40000), - SPH_C32(0x2e100000), SPH_C32(0xf4df0000), SPH_C32(0x9e5d0420), - SPH_C32(0x43cf6709), SPH_C32(0x13fb95c4), SPH_C32(0x19b62a95), - SPH_C32(0x18c8c541) }, - { SPH_C32(0xa7f20000), SPH_C32(0x93d10000), SPH_C32(0x73cc0000), - SPH_C32(0x21af0440), SPH_C32(0x6d756d13), SPH_C32(0x9e4ea295), - SPH_C32(0x6a738193), SPH_C32(0x431ed078), SPH_C32(0xa2dc0000), - SPH_C32(0x625b0000), SPH_C32(0x5c8a0000), SPH_C32(0x4d8d06c0), - SPH_C32(0x9bae57b1), SPH_C32(0x8b5c251e), SPH_C32(0x31232c21), - SPH_C32(0xcf928dd6) }, - { SPH_C32(0x41da0000), SPH_C32(0xdf9a0000), SPH_C32(0xdb990000), - SPH_C32(0xf27f06a0), SPH_C32(0xb5145dab), SPH_C32(0x06e9124f), - SPH_C32(0x42e68727), SPH_C32(0x944498ef), SPH_C32(0x52190000), - SPH_C32(0x3b780000), SPH_C32(0x19080000), SPH_C32(0xac000600), - SPH_C32(0xa0c35180), SPH_C32(0x49b17387), SPH_C32(0xfac3d23d), - SPH_C32(0x99353c49) }, - { SPH_C32(0x02f20000), SPH_C32(0xa2810000), SPH_C32(0x873f0000), - SPH_C32(0xe36c7800), SPH_C32(0x1e1d74ef), SPH_C32(0x073d2bd6), - SPH_C32(0xc4c23237), SPH_C32(0x7f32259e), SPH_C32(0xbadd0000), - SPH_C32(0x13ad0000), SPH_C32(0xb7e70000), SPH_C32(0xf7282800), - SPH_C32(0xdf45144d), SPH_C32(0x361ac33a), SPH_C32(0xea5a8d14), - SPH_C32(0x2a2c18f0) }, - { SPH_C32(0xe4da0000), SPH_C32(0xeeca0000), SPH_C32(0x2f6a0000), - SPH_C32(0x30bc7ae0), SPH_C32(0xc67c4457), SPH_C32(0x9f9a9b0c), - SPH_C32(0xec573483), SPH_C32(0xa8686d09), SPH_C32(0x4a180000), - SPH_C32(0x4a8e0000), SPH_C32(0xf2650000), SPH_C32(0x16a528c0), - SPH_C32(0xe428127c), SPH_C32(0xf4f795a3), SPH_C32(0x21ba7308), - SPH_C32(0x7c8ba96f) }, - { SPH_C32(0xf2370000), SPH_C32(0xfba20000), SPH_C32(0xc2bd0000), - SPH_C32(0x02e178c0), SPH_C32(0x257072de), SPH_C32(0xc5d07d4f), - SPH_C32(0x0f22cc2b), SPH_C32(0x29959401), SPH_C32(0xac300000), - SPH_C32(0x06c50000), SPH_C32(0x5a300000), SPH_C32(0xc5752a20), - SPH_C32(0x3c4922c4), SPH_C32(0x6c502579), SPH_C32(0x092f75bc), - SPH_C32(0xabd1e1f8) }, - { SPH_C32(0x141f0000), SPH_C32(0xb7e90000), SPH_C32(0x6ae80000), - SPH_C32(0xd1317a20), SPH_C32(0xfd114266), SPH_C32(0x5d77cd95), - SPH_C32(0x27b7ca9f), SPH_C32(0xfecfdc96), SPH_C32(0x5cf50000), - SPH_C32(0x5fe60000), SPH_C32(0x1fb20000), SPH_C32(0x24f82ae0), - SPH_C32(0x072424f5), SPH_C32(0xaebd73e0), SPH_C32(0xc2cf8ba0), - SPH_C32(0xfd765067) }, - { SPH_C32(0xb6c30000), SPH_C32(0xd5b20000), SPH_C32(0x36620000), - SPH_C32(0x9cbc7ce0), SPH_C32(0x66bf15d7), SPH_C32(0xd62be88b), - SPH_C32(0x1694e6be), SPH_C32(0x315d5140), SPH_C32(0x59db0000), - SPH_C32(0xae6c0000), SPH_C32(0x30f40000), SPH_C32(0x48da2860), - SPH_C32(0xf1ff1e57), SPH_C32(0xbbaff46b), SPH_C32(0x999f2612), - SPH_C32(0x71fa0dc9) }, - { SPH_C32(0x50eb0000), SPH_C32(0x99f90000), SPH_C32(0x9e370000), - SPH_C32(0x4f6c7e00), SPH_C32(0xbede256f), SPH_C32(0x4e8c5851), - SPH_C32(0x3e01e00a), SPH_C32(0xe60719d7), SPH_C32(0xa91e0000), - SPH_C32(0xf74f0000), SPH_C32(0x75760000), SPH_C32(0xa95728a0), - SPH_C32(0xca921866), SPH_C32(0x7942a2f2), SPH_C32(0x527fd80e), - SPH_C32(0x275dbc56) }, - { SPH_C32(0x46060000), SPH_C32(0x8c910000), SPH_C32(0x73e00000), - SPH_C32(0x7d317c20), SPH_C32(0x5dd213e6), SPH_C32(0x14c6be12), - SPH_C32(0xdd7418a2), SPH_C32(0x67fae0df), SPH_C32(0x4f360000), - SPH_C32(0xbb040000), SPH_C32(0xdd230000), SPH_C32(0x7a872a40), - SPH_C32(0x12f328de), SPH_C32(0xe1e51228), SPH_C32(0x7aeadeba), - SPH_C32(0xf007f4c1) }, - { SPH_C32(0xa02e0000), SPH_C32(0xc0da0000), SPH_C32(0xdbb50000), - SPH_C32(0xaee17ec0), SPH_C32(0x85b3235e), SPH_C32(0x8c610ec8), - SPH_C32(0xf5e11e16), SPH_C32(0xb0a0a848), SPH_C32(0xbff30000), - SPH_C32(0xe2270000), SPH_C32(0x98a10000), SPH_C32(0x9b0a2a80), - SPH_C32(0x299e2eef), SPH_C32(0x230844b1), SPH_C32(0xb10a20a6), - SPH_C32(0xa6a0455e) }, - { SPH_C32(0xe1f40000), SPH_C32(0x1f400000), SPH_C32(0x002c0000), - SPH_C32(0x5c9e7860), SPH_C32(0x30a77ef5), SPH_C32(0x8a881c87), - SPH_C32(0xb7079931), SPH_C32(0x24e430a7), SPH_C32(0xedea0000), - SPH_C32(0xd95f0000), SPH_C32(0x81a90000), SPH_C32(0x370a2c80), - SPH_C32(0x895d7f6f), SPH_C32(0x6ab93736), SPH_C32(0x4bc9f29b), - SPH_C32(0x3f957917) }, - { SPH_C32(0x07dc0000), SPH_C32(0x530b0000), SPH_C32(0xa8790000), - SPH_C32(0x8f4e7a80), SPH_C32(0xe8c64e4d), SPH_C32(0x122fac5d), - SPH_C32(0x9f929f85), SPH_C32(0xf3be7830), SPH_C32(0x1d2f0000), - SPH_C32(0x807c0000), SPH_C32(0xc42b0000), SPH_C32(0xd6872c40), - SPH_C32(0xb230795e), SPH_C32(0xa85461af), SPH_C32(0x80290c87), - SPH_C32(0x6932c888) }, - { SPH_C32(0x11310000), SPH_C32(0x46630000), SPH_C32(0x45ae0000), - SPH_C32(0xbd1378a0), SPH_C32(0x0bca78c4), SPH_C32(0x48654a1e), - SPH_C32(0x7ce7672d), SPH_C32(0x72438138), SPH_C32(0xfb070000), - SPH_C32(0xcc370000), SPH_C32(0x6c7e0000), SPH_C32(0x05572ea0), - SPH_C32(0x6a5149e6), SPH_C32(0x30f3d175), SPH_C32(0xa8bc0a33), - SPH_C32(0xbe68801f) }, - { SPH_C32(0xf7190000), SPH_C32(0x0a280000), SPH_C32(0xedfb0000), - SPH_C32(0x6ec37a40), SPH_C32(0xd3ab487c), SPH_C32(0xd0c2fac4), - SPH_C32(0x54726199), SPH_C32(0xa519c9af), SPH_C32(0x0bc20000), - SPH_C32(0x95140000), SPH_C32(0x29fc0000), SPH_C32(0xe4da2e60), - SPH_C32(0x513c4fd7), SPH_C32(0xf21e87ec), SPH_C32(0x635cf42f), - SPH_C32(0xe8cf3180) }, - { SPH_C32(0x55c50000), SPH_C32(0x68730000), SPH_C32(0xb1710000), - SPH_C32(0x234e7c80), SPH_C32(0x48051fcd), SPH_C32(0x5b9edfda), - SPH_C32(0x65514db8), SPH_C32(0x6a8b4479), SPH_C32(0x0eec0000), - SPH_C32(0x649e0000), SPH_C32(0x06ba0000), SPH_C32(0x88f82ce0), - SPH_C32(0xa7e77575), SPH_C32(0xe70c0067), SPH_C32(0x380c599d), - SPH_C32(0x64436c2e) }, - { SPH_C32(0xb3ed0000), SPH_C32(0x24380000), SPH_C32(0x19240000), - SPH_C32(0xf09e7e60), SPH_C32(0x90642f75), SPH_C32(0xc3396f00), - SPH_C32(0x4dc44b0c), SPH_C32(0xbdd10cee), SPH_C32(0xfe290000), - SPH_C32(0x3dbd0000), SPH_C32(0x43380000), SPH_C32(0x69752c20), - SPH_C32(0x9c8a7344), SPH_C32(0x25e156fe), SPH_C32(0xf3eca781), - SPH_C32(0x32e4ddb1) }, - { SPH_C32(0xa5000000), SPH_C32(0x31500000), SPH_C32(0xf4f30000), - SPH_C32(0xc2c37c40), SPH_C32(0x736819fc), SPH_C32(0x99738943), - SPH_C32(0xaeb1b3a4), SPH_C32(0x3c2cf5e6), SPH_C32(0x18010000), - SPH_C32(0x71f60000), SPH_C32(0xeb6d0000), SPH_C32(0xbaa52ec0), - SPH_C32(0x44eb43fc), SPH_C32(0xbd46e624), SPH_C32(0xdb79a135), - SPH_C32(0xe5be9526) }, - { SPH_C32(0x43280000), SPH_C32(0x7d1b0000), SPH_C32(0x5ca60000), - SPH_C32(0x11137ea0), SPH_C32(0xab092944), SPH_C32(0x01d43999), - SPH_C32(0x8624b510), SPH_C32(0xeb76bd71), SPH_C32(0xe8c40000), - SPH_C32(0x28d50000), SPH_C32(0xaeef0000), SPH_C32(0x5b282e00), - SPH_C32(0x7f8645cd), SPH_C32(0x7fabb0bd), SPH_C32(0x10995f29), - SPH_C32(0xb31924b9) }, - { SPH_C32(0xbadd0000), SPH_C32(0x13ad0000), SPH_C32(0xb7e70000), - SPH_C32(0xf7282800), SPH_C32(0xdf45144d), SPH_C32(0x361ac33a), - SPH_C32(0xea5a8d14), SPH_C32(0x2a2c18f0), SPH_C32(0xb82f0000), - SPH_C32(0xb12c0000), SPH_C32(0x30d80000), SPH_C32(0x14445000), - SPH_C32(0xc15860a2), SPH_C32(0x3127e8ec), SPH_C32(0x2e98bf23), - SPH_C32(0x551e3d6e) }, - { SPH_C32(0x5cf50000), SPH_C32(0x5fe60000), SPH_C32(0x1fb20000), - SPH_C32(0x24f82ae0), SPH_C32(0x072424f5), SPH_C32(0xaebd73e0), - SPH_C32(0xc2cf8ba0), SPH_C32(0xfd765067), SPH_C32(0x48ea0000), - SPH_C32(0xe80f0000), SPH_C32(0x755a0000), SPH_C32(0xf5c950c0), - SPH_C32(0xfa356693), SPH_C32(0xf3cabe75), SPH_C32(0xe578413f), - SPH_C32(0x03b98cf1) }, - { SPH_C32(0x4a180000), SPH_C32(0x4a8e0000), SPH_C32(0xf2650000), - SPH_C32(0x16a528c0), SPH_C32(0xe428127c), SPH_C32(0xf4f795a3), - SPH_C32(0x21ba7308), SPH_C32(0x7c8ba96f), SPH_C32(0xaec20000), - SPH_C32(0xa4440000), SPH_C32(0xdd0f0000), SPH_C32(0x26195220), - SPH_C32(0x2254562b), SPH_C32(0x6b6d0eaf), SPH_C32(0xcded478b), - SPH_C32(0xd4e3c466) }, - { SPH_C32(0xac300000), SPH_C32(0x06c50000), SPH_C32(0x5a300000), - SPH_C32(0xc5752a20), SPH_C32(0x3c4922c4), SPH_C32(0x6c502579), - SPH_C32(0x092f75bc), SPH_C32(0xabd1e1f8), SPH_C32(0x5e070000), - SPH_C32(0xfd670000), SPH_C32(0x988d0000), SPH_C32(0xc79452e0), - SPH_C32(0x1939501a), SPH_C32(0xa9805836), SPH_C32(0x060db997), - SPH_C32(0x824475f9) }, - { SPH_C32(0x0eec0000), SPH_C32(0x649e0000), SPH_C32(0x06ba0000), - SPH_C32(0x88f82ce0), SPH_C32(0xa7e77575), SPH_C32(0xe70c0067), - SPH_C32(0x380c599d), SPH_C32(0x64436c2e), SPH_C32(0x5b290000), - SPH_C32(0x0ced0000), SPH_C32(0xb7cb0000), SPH_C32(0xabb65060), - SPH_C32(0xefe26ab8), SPH_C32(0xbc92dfbd), SPH_C32(0x5d5d1425), - SPH_C32(0x0ec82857) }, - { SPH_C32(0xe8c40000), SPH_C32(0x28d50000), SPH_C32(0xaeef0000), - SPH_C32(0x5b282e00), SPH_C32(0x7f8645cd), SPH_C32(0x7fabb0bd), - SPH_C32(0x10995f29), SPH_C32(0xb31924b9), SPH_C32(0xabec0000), - SPH_C32(0x55ce0000), SPH_C32(0xf2490000), SPH_C32(0x4a3b50a0), - SPH_C32(0xd48f6c89), SPH_C32(0x7e7f8924), SPH_C32(0x96bdea39), - SPH_C32(0x586f99c8) }, - { SPH_C32(0xfe290000), SPH_C32(0x3dbd0000), SPH_C32(0x43380000), - SPH_C32(0x69752c20), SPH_C32(0x9c8a7344), SPH_C32(0x25e156fe), - SPH_C32(0xf3eca781), SPH_C32(0x32e4ddb1), SPH_C32(0x4dc40000), - SPH_C32(0x19850000), SPH_C32(0x5a1c0000), SPH_C32(0x99eb5240), - SPH_C32(0x0cee5c31), SPH_C32(0xe6d839fe), SPH_C32(0xbe28ec8d), - SPH_C32(0x8f35d15f) }, - { SPH_C32(0x18010000), SPH_C32(0x71f60000), SPH_C32(0xeb6d0000), - SPH_C32(0xbaa52ec0), SPH_C32(0x44eb43fc), SPH_C32(0xbd46e624), - SPH_C32(0xdb79a135), SPH_C32(0xe5be9526), SPH_C32(0xbd010000), - SPH_C32(0x40a60000), SPH_C32(0x1f9e0000), SPH_C32(0x78665280), - SPH_C32(0x37835a00), SPH_C32(0x24356f67), SPH_C32(0x75c81291), - SPH_C32(0xd99260c0) }, - { SPH_C32(0x59db0000), SPH_C32(0xae6c0000), SPH_C32(0x30f40000), - SPH_C32(0x48da2860), SPH_C32(0xf1ff1e57), SPH_C32(0xbbaff46b), - SPH_C32(0x999f2612), SPH_C32(0x71fa0dc9), SPH_C32(0xef180000), - SPH_C32(0x7bde0000), SPH_C32(0x06960000), SPH_C32(0xd4665480), - SPH_C32(0x97400b80), SPH_C32(0x6d841ce0), SPH_C32(0x8f0bc0ac), - SPH_C32(0x40a75c89) }, - { SPH_C32(0xbff30000), SPH_C32(0xe2270000), SPH_C32(0x98a10000), - SPH_C32(0x9b0a2a80), SPH_C32(0x299e2eef), SPH_C32(0x230844b1), - SPH_C32(0xb10a20a6), SPH_C32(0xa6a0455e), SPH_C32(0x1fdd0000), - SPH_C32(0x22fd0000), SPH_C32(0x43140000), SPH_C32(0x35eb5440), - SPH_C32(0xac2d0db1), SPH_C32(0xaf694a79), SPH_C32(0x44eb3eb0), - SPH_C32(0x1600ed16) }, - { SPH_C32(0xa91e0000), SPH_C32(0xf74f0000), SPH_C32(0x75760000), - SPH_C32(0xa95728a0), SPH_C32(0xca921866), SPH_C32(0x7942a2f2), - SPH_C32(0x527fd80e), SPH_C32(0x275dbc56), SPH_C32(0xf9f50000), - SPH_C32(0x6eb60000), SPH_C32(0xeb410000), SPH_C32(0xe63b56a0), - SPH_C32(0x744c3d09), SPH_C32(0x37cefaa3), SPH_C32(0x6c7e3804), - SPH_C32(0xc15aa581) }, - { SPH_C32(0x4f360000), SPH_C32(0xbb040000), SPH_C32(0xdd230000), - SPH_C32(0x7a872a40), SPH_C32(0x12f328de), SPH_C32(0xe1e51228), - SPH_C32(0x7aeadeba), SPH_C32(0xf007f4c1), SPH_C32(0x09300000), - SPH_C32(0x37950000), SPH_C32(0xaec30000), SPH_C32(0x07b65660), - SPH_C32(0x4f213b38), SPH_C32(0xf523ac3a), SPH_C32(0xa79ec618), - SPH_C32(0x97fd141e) }, - { SPH_C32(0xedea0000), SPH_C32(0xd95f0000), SPH_C32(0x81a90000), - SPH_C32(0x370a2c80), SPH_C32(0x895d7f6f), SPH_C32(0x6ab93736), - SPH_C32(0x4bc9f29b), SPH_C32(0x3f957917), SPH_C32(0x0c1e0000), - SPH_C32(0xc61f0000), SPH_C32(0x81850000), SPH_C32(0x6b9454e0), - SPH_C32(0xb9fa019a), SPH_C32(0xe0312bb1), SPH_C32(0xfcce6baa), - SPH_C32(0x1b7149b0) }, - { SPH_C32(0x0bc20000), SPH_C32(0x95140000), SPH_C32(0x29fc0000), - SPH_C32(0xe4da2e60), SPH_C32(0x513c4fd7), SPH_C32(0xf21e87ec), - SPH_C32(0x635cf42f), SPH_C32(0xe8cf3180), SPH_C32(0xfcdb0000), - SPH_C32(0x9f3c0000), SPH_C32(0xc4070000), SPH_C32(0x8a195420), - SPH_C32(0x829707ab), SPH_C32(0x22dc7d28), SPH_C32(0x372e95b6), - SPH_C32(0x4dd6f82f) }, - { SPH_C32(0x1d2f0000), SPH_C32(0x807c0000), SPH_C32(0xc42b0000), - SPH_C32(0xd6872c40), SPH_C32(0xb230795e), SPH_C32(0xa85461af), - SPH_C32(0x80290c87), SPH_C32(0x6932c888), SPH_C32(0x1af30000), - SPH_C32(0xd3770000), SPH_C32(0x6c520000), SPH_C32(0x59c956c0), - SPH_C32(0x5af63713), SPH_C32(0xba7bcdf2), SPH_C32(0x1fbb9302), - SPH_C32(0x9a8cb0b8) }, - { SPH_C32(0xfb070000), SPH_C32(0xcc370000), SPH_C32(0x6c7e0000), - SPH_C32(0x05572ea0), SPH_C32(0x6a5149e6), SPH_C32(0x30f3d175), - SPH_C32(0xa8bc0a33), SPH_C32(0xbe68801f), SPH_C32(0xea360000), - SPH_C32(0x8a540000), SPH_C32(0x29d00000), SPH_C32(0xb8445600), - SPH_C32(0x619b3122), SPH_C32(0x78969b6b), SPH_C32(0xd45b6d1e), - SPH_C32(0xcc2b0127) }, - { SPH_C32(0xb82f0000), SPH_C32(0xb12c0000), SPH_C32(0x30d80000), - SPH_C32(0x14445000), SPH_C32(0xc15860a2), SPH_C32(0x3127e8ec), - SPH_C32(0x2e98bf23), SPH_C32(0x551e3d6e), SPH_C32(0x02f20000), - SPH_C32(0xa2810000), SPH_C32(0x873f0000), SPH_C32(0xe36c7800), - SPH_C32(0x1e1d74ef), SPH_C32(0x073d2bd6), SPH_C32(0xc4c23237), - SPH_C32(0x7f32259e) }, - { SPH_C32(0x5e070000), SPH_C32(0xfd670000), SPH_C32(0x988d0000), - SPH_C32(0xc79452e0), SPH_C32(0x1939501a), SPH_C32(0xa9805836), - SPH_C32(0x060db997), SPH_C32(0x824475f9), SPH_C32(0xf2370000), - SPH_C32(0xfba20000), SPH_C32(0xc2bd0000), SPH_C32(0x02e178c0), - SPH_C32(0x257072de), SPH_C32(0xc5d07d4f), SPH_C32(0x0f22cc2b), - SPH_C32(0x29959401) }, - { SPH_C32(0x48ea0000), SPH_C32(0xe80f0000), SPH_C32(0x755a0000), - SPH_C32(0xf5c950c0), SPH_C32(0xfa356693), SPH_C32(0xf3cabe75), - SPH_C32(0xe578413f), SPH_C32(0x03b98cf1), SPH_C32(0x141f0000), - SPH_C32(0xb7e90000), SPH_C32(0x6ae80000), SPH_C32(0xd1317a20), - SPH_C32(0xfd114266), SPH_C32(0x5d77cd95), SPH_C32(0x27b7ca9f), - SPH_C32(0xfecfdc96) }, - { SPH_C32(0xaec20000), SPH_C32(0xa4440000), SPH_C32(0xdd0f0000), - SPH_C32(0x26195220), SPH_C32(0x2254562b), SPH_C32(0x6b6d0eaf), - SPH_C32(0xcded478b), SPH_C32(0xd4e3c466), SPH_C32(0xe4da0000), - SPH_C32(0xeeca0000), SPH_C32(0x2f6a0000), SPH_C32(0x30bc7ae0), - SPH_C32(0xc67c4457), SPH_C32(0x9f9a9b0c), SPH_C32(0xec573483), - SPH_C32(0xa8686d09) }, - { SPH_C32(0x0c1e0000), SPH_C32(0xc61f0000), SPH_C32(0x81850000), - SPH_C32(0x6b9454e0), SPH_C32(0xb9fa019a), SPH_C32(0xe0312bb1), - SPH_C32(0xfcce6baa), SPH_C32(0x1b7149b0), SPH_C32(0xe1f40000), - SPH_C32(0x1f400000), SPH_C32(0x002c0000), SPH_C32(0x5c9e7860), - SPH_C32(0x30a77ef5), SPH_C32(0x8a881c87), SPH_C32(0xb7079931), - SPH_C32(0x24e430a7) }, - { SPH_C32(0xea360000), SPH_C32(0x8a540000), SPH_C32(0x29d00000), - SPH_C32(0xb8445600), SPH_C32(0x619b3122), SPH_C32(0x78969b6b), - SPH_C32(0xd45b6d1e), SPH_C32(0xcc2b0127), SPH_C32(0x11310000), - SPH_C32(0x46630000), SPH_C32(0x45ae0000), SPH_C32(0xbd1378a0), - SPH_C32(0x0bca78c4), SPH_C32(0x48654a1e), SPH_C32(0x7ce7672d), - SPH_C32(0x72438138) }, - { SPH_C32(0xfcdb0000), SPH_C32(0x9f3c0000), SPH_C32(0xc4070000), - SPH_C32(0x8a195420), SPH_C32(0x829707ab), SPH_C32(0x22dc7d28), - SPH_C32(0x372e95b6), SPH_C32(0x4dd6f82f), SPH_C32(0xf7190000), - SPH_C32(0x0a280000), SPH_C32(0xedfb0000), SPH_C32(0x6ec37a40), - SPH_C32(0xd3ab487c), SPH_C32(0xd0c2fac4), SPH_C32(0x54726199), - SPH_C32(0xa519c9af) }, - { SPH_C32(0x1af30000), SPH_C32(0xd3770000), SPH_C32(0x6c520000), - SPH_C32(0x59c956c0), SPH_C32(0x5af63713), SPH_C32(0xba7bcdf2), - SPH_C32(0x1fbb9302), SPH_C32(0x9a8cb0b8), SPH_C32(0x07dc0000), - SPH_C32(0x530b0000), SPH_C32(0xa8790000), SPH_C32(0x8f4e7a80), - SPH_C32(0xe8c64e4d), SPH_C32(0x122fac5d), SPH_C32(0x9f929f85), - SPH_C32(0xf3be7830) }, - { SPH_C32(0x5b290000), SPH_C32(0x0ced0000), SPH_C32(0xb7cb0000), - SPH_C32(0xabb65060), SPH_C32(0xefe26ab8), SPH_C32(0xbc92dfbd), - SPH_C32(0x5d5d1425), SPH_C32(0x0ec82857), SPH_C32(0x55c50000), - SPH_C32(0x68730000), SPH_C32(0xb1710000), SPH_C32(0x234e7c80), - SPH_C32(0x48051fcd), SPH_C32(0x5b9edfda), SPH_C32(0x65514db8), - SPH_C32(0x6a8b4479) }, - { SPH_C32(0xbd010000), SPH_C32(0x40a60000), SPH_C32(0x1f9e0000), - SPH_C32(0x78665280), SPH_C32(0x37835a00), SPH_C32(0x24356f67), - SPH_C32(0x75c81291), SPH_C32(0xd99260c0), SPH_C32(0xa5000000), - SPH_C32(0x31500000), SPH_C32(0xf4f30000), SPH_C32(0xc2c37c40), - SPH_C32(0x736819fc), SPH_C32(0x99738943), SPH_C32(0xaeb1b3a4), - SPH_C32(0x3c2cf5e6) }, - { SPH_C32(0xabec0000), SPH_C32(0x55ce0000), SPH_C32(0xf2490000), - SPH_C32(0x4a3b50a0), SPH_C32(0xd48f6c89), SPH_C32(0x7e7f8924), - SPH_C32(0x96bdea39), SPH_C32(0x586f99c8), SPH_C32(0x43280000), - SPH_C32(0x7d1b0000), SPH_C32(0x5ca60000), SPH_C32(0x11137ea0), - SPH_C32(0xab092944), SPH_C32(0x01d43999), SPH_C32(0x8624b510), - SPH_C32(0xeb76bd71) }, - { SPH_C32(0x4dc40000), SPH_C32(0x19850000), SPH_C32(0x5a1c0000), - SPH_C32(0x99eb5240), SPH_C32(0x0cee5c31), SPH_C32(0xe6d839fe), - SPH_C32(0xbe28ec8d), SPH_C32(0x8f35d15f), SPH_C32(0xb3ed0000), - SPH_C32(0x24380000), SPH_C32(0x19240000), SPH_C32(0xf09e7e60), - SPH_C32(0x90642f75), SPH_C32(0xc3396f00), SPH_C32(0x4dc44b0c), - SPH_C32(0xbdd10cee) }, - { SPH_C32(0xef180000), SPH_C32(0x7bde0000), SPH_C32(0x06960000), - SPH_C32(0xd4665480), SPH_C32(0x97400b80), SPH_C32(0x6d841ce0), - SPH_C32(0x8f0bc0ac), SPH_C32(0x40a75c89), SPH_C32(0xb6c30000), - SPH_C32(0xd5b20000), SPH_C32(0x36620000), SPH_C32(0x9cbc7ce0), - SPH_C32(0x66bf15d7), SPH_C32(0xd62be88b), SPH_C32(0x1694e6be), - SPH_C32(0x315d5140) }, - { SPH_C32(0x09300000), SPH_C32(0x37950000), SPH_C32(0xaec30000), - SPH_C32(0x07b65660), SPH_C32(0x4f213b38), SPH_C32(0xf523ac3a), - SPH_C32(0xa79ec618), SPH_C32(0x97fd141e), SPH_C32(0x46060000), - SPH_C32(0x8c910000), SPH_C32(0x73e00000), SPH_C32(0x7d317c20), - SPH_C32(0x5dd213e6), SPH_C32(0x14c6be12), SPH_C32(0xdd7418a2), - SPH_C32(0x67fae0df) }, - { SPH_C32(0x1fdd0000), SPH_C32(0x22fd0000), SPH_C32(0x43140000), - SPH_C32(0x35eb5440), SPH_C32(0xac2d0db1), SPH_C32(0xaf694a79), - SPH_C32(0x44eb3eb0), SPH_C32(0x1600ed16), SPH_C32(0xa02e0000), - SPH_C32(0xc0da0000), SPH_C32(0xdbb50000), SPH_C32(0xaee17ec0), - SPH_C32(0x85b3235e), SPH_C32(0x8c610ec8), SPH_C32(0xf5e11e16), - SPH_C32(0xb0a0a848) }, - { SPH_C32(0xf9f50000), SPH_C32(0x6eb60000), SPH_C32(0xeb410000), - SPH_C32(0xe63b56a0), SPH_C32(0x744c3d09), SPH_C32(0x37cefaa3), - SPH_C32(0x6c7e3804), SPH_C32(0xc15aa581), SPH_C32(0x50eb0000), - SPH_C32(0x99f90000), SPH_C32(0x9e370000), SPH_C32(0x4f6c7e00), - SPH_C32(0xbede256f), SPH_C32(0x4e8c5851), SPH_C32(0x3e01e00a), - SPH_C32(0xe60719d7) }, - { SPH_C32(0x1e6c0000), SPH_C32(0xc4420000), SPH_C32(0x8a2e0000), - SPH_C32(0xbcb6b800), SPH_C32(0x2c4413b6), SPH_C32(0x8bfdd3da), - SPH_C32(0x6a0c1bc8), SPH_C32(0xb99dc2eb), SPH_C32(0x92560000), - SPH_C32(0x1eda0000), SPH_C32(0xea510000), SPH_C32(0xe8b13000), - SPH_C32(0xa93556a5), SPH_C32(0xebfb6199), SPH_C32(0xb15c2254), - SPH_C32(0x33c5244f) }, - { SPH_C32(0xf8440000), SPH_C32(0x88090000), SPH_C32(0x227b0000), - SPH_C32(0x6f66bae0), SPH_C32(0xf425230e), SPH_C32(0x135a6300), - SPH_C32(0x42991d7c), SPH_C32(0x6ec78a7c), SPH_C32(0x62930000), - SPH_C32(0x47f90000), SPH_C32(0xafd30000), SPH_C32(0x093c30c0), - SPH_C32(0x92585094), SPH_C32(0x29163700), SPH_C32(0x7abcdc48), - SPH_C32(0x656295d0) }, - { SPH_C32(0xeea90000), SPH_C32(0x9d610000), SPH_C32(0xcfac0000), - SPH_C32(0x5d3bb8c0), SPH_C32(0x17291587), SPH_C32(0x49108543), - SPH_C32(0xa1ece5d4), SPH_C32(0xef3a7374), SPH_C32(0x84bb0000), - SPH_C32(0x0bb20000), SPH_C32(0x07860000), SPH_C32(0xdaec3220), - SPH_C32(0x4a39602c), SPH_C32(0xb1b187da), SPH_C32(0x5229dafc), - SPH_C32(0xb238dd47) }, - { SPH_C32(0x08810000), SPH_C32(0xd12a0000), SPH_C32(0x67f90000), - SPH_C32(0x8eebba20), SPH_C32(0xcf48253f), SPH_C32(0xd1b73599), - SPH_C32(0x8979e360), SPH_C32(0x38603be3), SPH_C32(0x747e0000), - SPH_C32(0x52910000), SPH_C32(0x42040000), SPH_C32(0x3b6132e0), - SPH_C32(0x7154661d), SPH_C32(0x735cd143), SPH_C32(0x99c924e0), - SPH_C32(0xe49f6cd8) }, - { SPH_C32(0xaa5d0000), SPH_C32(0xb3710000), SPH_C32(0x3b730000), - SPH_C32(0xc366bce0), SPH_C32(0x54e6728e), SPH_C32(0x5aeb1087), - SPH_C32(0xb85acf41), SPH_C32(0xf7f2b635), SPH_C32(0x71500000), - SPH_C32(0xa31b0000), SPH_C32(0x6d420000), SPH_C32(0x57433060), - SPH_C32(0x878f5cbf), SPH_C32(0x664e56c8), SPH_C32(0xc2998952), - SPH_C32(0x68133176) }, - { SPH_C32(0x4c750000), SPH_C32(0xff3a0000), SPH_C32(0x93260000), - SPH_C32(0x10b6be00), SPH_C32(0x8c874236), SPH_C32(0xc24ca05d), - SPH_C32(0x90cfc9f5), SPH_C32(0x20a8fea2), SPH_C32(0x81950000), - SPH_C32(0xfa380000), SPH_C32(0x28c00000), SPH_C32(0xb6ce30a0), - SPH_C32(0xbce25a8e), SPH_C32(0xa4a30051), SPH_C32(0x0979774e), - SPH_C32(0x3eb480e9) }, - { SPH_C32(0x5a980000), SPH_C32(0xea520000), SPH_C32(0x7ef10000), - SPH_C32(0x22ebbc20), SPH_C32(0x6f8b74bf), SPH_C32(0x9806461e), - SPH_C32(0x73ba315d), SPH_C32(0xa15507aa), SPH_C32(0x67bd0000), - SPH_C32(0xb6730000), SPH_C32(0x80950000), SPH_C32(0x651e3240), - SPH_C32(0x64836a36), SPH_C32(0x3c04b08b), SPH_C32(0x21ec71fa), - SPH_C32(0xe9eec87e) }, - { SPH_C32(0xbcb00000), SPH_C32(0xa6190000), SPH_C32(0xd6a40000), - SPH_C32(0xf13bbec0), SPH_C32(0xb7ea4407), SPH_C32(0x00a1f6c4), - SPH_C32(0x5b2f37e9), SPH_C32(0x760f4f3d), SPH_C32(0x97780000), - SPH_C32(0xef500000), SPH_C32(0xc5170000), SPH_C32(0x84933280), - SPH_C32(0x5fee6c07), SPH_C32(0xfee9e612), SPH_C32(0xea0c8fe6), - SPH_C32(0xbf4979e1) }, - { SPH_C32(0xfd6a0000), SPH_C32(0x79830000), SPH_C32(0x0d3d0000), - SPH_C32(0x0344b860), SPH_C32(0x02fe19ac), SPH_C32(0x0648e48b), - SPH_C32(0x19c9b0ce), SPH_C32(0xe24bd7d2), SPH_C32(0xc5610000), - SPH_C32(0xd4280000), SPH_C32(0xdc1f0000), SPH_C32(0x28933480), - SPH_C32(0xff2d3d87), SPH_C32(0xb7589595), SPH_C32(0x10cf5ddb), - SPH_C32(0x267c45a8) }, - { SPH_C32(0x1b420000), SPH_C32(0x35c80000), SPH_C32(0xa5680000), - SPH_C32(0xd094ba80), SPH_C32(0xda9f2914), SPH_C32(0x9eef5451), - SPH_C32(0x315cb67a), SPH_C32(0x35119f45), SPH_C32(0x35a40000), - SPH_C32(0x8d0b0000), SPH_C32(0x999d0000), SPH_C32(0xc91e3440), - SPH_C32(0xc4403bb6), SPH_C32(0x75b5c30c), SPH_C32(0xdb2fa3c7), - SPH_C32(0x70dbf437) }, - { SPH_C32(0x0daf0000), SPH_C32(0x20a00000), SPH_C32(0x48bf0000), - SPH_C32(0xe2c9b8a0), SPH_C32(0x39931f9d), SPH_C32(0xc4a5b212), - SPH_C32(0xd2294ed2), SPH_C32(0xb4ec664d), SPH_C32(0xd38c0000), - SPH_C32(0xc1400000), SPH_C32(0x31c80000), SPH_C32(0x1ace36a0), - SPH_C32(0x1c210b0e), SPH_C32(0xed1273d6), SPH_C32(0xf3baa573), - SPH_C32(0xa781bca0) }, - { SPH_C32(0xeb870000), SPH_C32(0x6ceb0000), SPH_C32(0xe0ea0000), - SPH_C32(0x3119ba40), SPH_C32(0xe1f22f25), SPH_C32(0x5c0202c8), - SPH_C32(0xfabc4866), SPH_C32(0x63b62eda), SPH_C32(0x23490000), - SPH_C32(0x98630000), SPH_C32(0x744a0000), SPH_C32(0xfb433660), - SPH_C32(0x274c0d3f), SPH_C32(0x2fff254f), SPH_C32(0x385a5b6f), - SPH_C32(0xf1260d3f) }, - { SPH_C32(0x495b0000), SPH_C32(0x0eb00000), SPH_C32(0xbc600000), - SPH_C32(0x7c94bc80), SPH_C32(0x7a5c7894), SPH_C32(0xd75e27d6), - SPH_C32(0xcb9f6447), SPH_C32(0xac24a30c), SPH_C32(0x26670000), - SPH_C32(0x69e90000), SPH_C32(0x5b0c0000), SPH_C32(0x976134e0), - SPH_C32(0xd197379d), SPH_C32(0x3aeda2c4), SPH_C32(0x630af6dd), - SPH_C32(0x7daa5091) }, - { SPH_C32(0xaf730000), SPH_C32(0x42fb0000), SPH_C32(0x14350000), - SPH_C32(0xaf44be60), SPH_C32(0xa23d482c), SPH_C32(0x4ff9970c), - SPH_C32(0xe30a62f3), SPH_C32(0x7b7eeb9b), SPH_C32(0xd6a20000), - SPH_C32(0x30ca0000), SPH_C32(0x1e8e0000), SPH_C32(0x76ec3420), - SPH_C32(0xeafa31ac), SPH_C32(0xf800f45d), SPH_C32(0xa8ea08c1), - SPH_C32(0x2b0de10e) }, - { SPH_C32(0xb99e0000), SPH_C32(0x57930000), SPH_C32(0xf9e20000), - SPH_C32(0x9d19bc40), SPH_C32(0x41317ea5), SPH_C32(0x15b3714f), - SPH_C32(0x007f9a5b), SPH_C32(0xfa831293), SPH_C32(0x308a0000), - SPH_C32(0x7c810000), SPH_C32(0xb6db0000), SPH_C32(0xa53c36c0), - SPH_C32(0x329b0114), SPH_C32(0x60a74487), SPH_C32(0x807f0e75), - SPH_C32(0xfc57a999) }, - { SPH_C32(0x5fb60000), SPH_C32(0x1bd80000), SPH_C32(0x51b70000), - SPH_C32(0x4ec9bea0), SPH_C32(0x99504e1d), SPH_C32(0x8d14c195), - SPH_C32(0x28ea9cef), SPH_C32(0x2dd95a04), SPH_C32(0xc04f0000), - SPH_C32(0x25a20000), SPH_C32(0xf3590000), SPH_C32(0x44b13600), - SPH_C32(0x09f60725), SPH_C32(0xa24a121e), SPH_C32(0x4b9ff069), - SPH_C32(0xaaf01806) }, - { SPH_C32(0x1c9e0000), SPH_C32(0x66c30000), SPH_C32(0x0d110000), - SPH_C32(0x5fdac000), SPH_C32(0x32596759), SPH_C32(0x8cc0f80c), - SPH_C32(0xaece29ff), SPH_C32(0xc6afe775), SPH_C32(0x288b0000), - SPH_C32(0x0d770000), SPH_C32(0x5db60000), SPH_C32(0x1f991800), - SPH_C32(0x767042e8), SPH_C32(0xdde1a2a3), SPH_C32(0x5b06af40), - SPH_C32(0x19e93cbf) }, - { SPH_C32(0xfab60000), SPH_C32(0x2a880000), SPH_C32(0xa5440000), - SPH_C32(0x8c0ac2e0), SPH_C32(0xea3857e1), SPH_C32(0x146748d6), - SPH_C32(0x865b2f4b), SPH_C32(0x11f5afe2), SPH_C32(0xd84e0000), - SPH_C32(0x54540000), SPH_C32(0x18340000), SPH_C32(0xfe1418c0), - SPH_C32(0x4d1d44d9), SPH_C32(0x1f0cf43a), SPH_C32(0x90e6515c), - SPH_C32(0x4f4e8d20) }, - { SPH_C32(0xec5b0000), SPH_C32(0x3fe00000), SPH_C32(0x48930000), - SPH_C32(0xbe57c0c0), SPH_C32(0x09346168), SPH_C32(0x4e2dae95), - SPH_C32(0x652ed7e3), SPH_C32(0x900856ea), SPH_C32(0x3e660000), - SPH_C32(0x181f0000), SPH_C32(0xb0610000), SPH_C32(0x2dc41a20), - SPH_C32(0x957c7461), SPH_C32(0x87ab44e0), SPH_C32(0xb87357e8), - SPH_C32(0x9814c5b7) }, - { SPH_C32(0x0a730000), SPH_C32(0x73ab0000), SPH_C32(0xe0c60000), - SPH_C32(0x6d87c220), SPH_C32(0xd15551d0), SPH_C32(0xd68a1e4f), - SPH_C32(0x4dbbd157), SPH_C32(0x47521e7d), SPH_C32(0xcea30000), - SPH_C32(0x413c0000), SPH_C32(0xf5e30000), SPH_C32(0xcc491ae0), - SPH_C32(0xae117250), SPH_C32(0x45461279), SPH_C32(0x7393a9f4), - SPH_C32(0xceb37428) }, - { SPH_C32(0xa8af0000), SPH_C32(0x11f00000), SPH_C32(0xbc4c0000), - SPH_C32(0x200ac4e0), SPH_C32(0x4afb0661), SPH_C32(0x5dd63b51), - SPH_C32(0x7c98fd76), SPH_C32(0x88c093ab), SPH_C32(0xcb8d0000), - SPH_C32(0xb0b60000), SPH_C32(0xdaa50000), SPH_C32(0xa06b1860), - SPH_C32(0x58ca48f2), SPH_C32(0x505495f2), SPH_C32(0x28c30446), - SPH_C32(0x423f2986) }, - { SPH_C32(0x4e870000), SPH_C32(0x5dbb0000), SPH_C32(0x14190000), - SPH_C32(0xf3dac600), SPH_C32(0x929a36d9), SPH_C32(0xc5718b8b), - SPH_C32(0x540dfbc2), SPH_C32(0x5f9adb3c), SPH_C32(0x3b480000), - SPH_C32(0xe9950000), SPH_C32(0x9f270000), SPH_C32(0x41e618a0), - SPH_C32(0x63a74ec3), SPH_C32(0x92b9c36b), SPH_C32(0xe323fa5a), - SPH_C32(0x14989819) }, - { SPH_C32(0x586a0000), SPH_C32(0x48d30000), SPH_C32(0xf9ce0000), - SPH_C32(0xc187c420), SPH_C32(0x71960050), SPH_C32(0x9f3b6dc8), - SPH_C32(0xb778036a), SPH_C32(0xde672234), SPH_C32(0xdd600000), - SPH_C32(0xa5de0000), SPH_C32(0x37720000), SPH_C32(0x92361a40), - SPH_C32(0xbbc67e7b), SPH_C32(0x0a1e73b1), SPH_C32(0xcbb6fcee), - SPH_C32(0xc3c2d08e) }, - { SPH_C32(0xbe420000), SPH_C32(0x04980000), SPH_C32(0x519b0000), - SPH_C32(0x1257c6c0), SPH_C32(0xa9f730e8), SPH_C32(0x079cdd12), - SPH_C32(0x9fed05de), SPH_C32(0x093d6aa3), SPH_C32(0x2da50000), - SPH_C32(0xfcfd0000), SPH_C32(0x72f00000), SPH_C32(0x73bb1a80), - SPH_C32(0x80ab784a), SPH_C32(0xc8f32528), SPH_C32(0x005602f2), - SPH_C32(0x95656111) }, - { SPH_C32(0xff980000), SPH_C32(0xdb020000), SPH_C32(0x8a020000), - SPH_C32(0xe028c060), SPH_C32(0x1ce36d43), SPH_C32(0x0175cf5d), - SPH_C32(0xdd0b82f9), SPH_C32(0x9d79f24c), SPH_C32(0x7fbc0000), - SPH_C32(0xc7850000), SPH_C32(0x6bf80000), SPH_C32(0xdfbb1c80), - SPH_C32(0x206829ca), SPH_C32(0x814256af), SPH_C32(0xfa95d0cf), - SPH_C32(0x0c505d58) }, - { SPH_C32(0x19b00000), SPH_C32(0x97490000), SPH_C32(0x22570000), - SPH_C32(0x33f8c280), SPH_C32(0xc4825dfb), SPH_C32(0x99d27f87), - SPH_C32(0xf59e844d), SPH_C32(0x4a23badb), SPH_C32(0x8f790000), - SPH_C32(0x9ea60000), SPH_C32(0x2e7a0000), SPH_C32(0x3e361c40), - SPH_C32(0x1b052ffb), SPH_C32(0x43af0036), SPH_C32(0x31752ed3), - SPH_C32(0x5af7ecc7) }, - { SPH_C32(0x0f5d0000), SPH_C32(0x82210000), SPH_C32(0xcf800000), - SPH_C32(0x01a5c0a0), SPH_C32(0x278e6b72), SPH_C32(0xc39899c4), - SPH_C32(0x16eb7ce5), SPH_C32(0xcbde43d3), SPH_C32(0x69510000), - SPH_C32(0xd2ed0000), SPH_C32(0x862f0000), SPH_C32(0xede61ea0), - SPH_C32(0xc3641f43), SPH_C32(0xdb08b0ec), SPH_C32(0x19e02867), - SPH_C32(0x8dada450) }, - { SPH_C32(0xe9750000), SPH_C32(0xce6a0000), SPH_C32(0x67d50000), - SPH_C32(0xd275c240), SPH_C32(0xffef5bca), SPH_C32(0x5b3f291e), - SPH_C32(0x3e7e7a51), SPH_C32(0x1c840b44), SPH_C32(0x99940000), - SPH_C32(0x8bce0000), SPH_C32(0xc3ad0000), SPH_C32(0x0c6b1e60), - SPH_C32(0xf8091972), SPH_C32(0x19e5e675), SPH_C32(0xd200d67b), - SPH_C32(0xdb0a15cf) }, - { SPH_C32(0x4ba90000), SPH_C32(0xac310000), SPH_C32(0x3b5f0000), - SPH_C32(0x9ff8c480), SPH_C32(0x64410c7b), SPH_C32(0xd0630c00), - SPH_C32(0x0f5d5670), SPH_C32(0xd3168692), SPH_C32(0x9cba0000), - SPH_C32(0x7a440000), SPH_C32(0xeceb0000), SPH_C32(0x60491ce0), - SPH_C32(0x0ed223d0), SPH_C32(0x0cf761fe), SPH_C32(0x89507bc9), - SPH_C32(0x57864861) }, - { SPH_C32(0xad810000), SPH_C32(0xe07a0000), SPH_C32(0x930a0000), - SPH_C32(0x4c28c660), SPH_C32(0xbc203cc3), SPH_C32(0x48c4bcda), - SPH_C32(0x27c850c4), SPH_C32(0x044cce05), SPH_C32(0x6c7f0000), - SPH_C32(0x23670000), SPH_C32(0xa9690000), SPH_C32(0x81c41c20), - SPH_C32(0x35bf25e1), SPH_C32(0xce1a3767), SPH_C32(0x42b085d5), - SPH_C32(0x0121f9fe) }, - { SPH_C32(0xbb6c0000), SPH_C32(0xf5120000), SPH_C32(0x7edd0000), - SPH_C32(0x7e75c440), SPH_C32(0x5f2c0a4a), SPH_C32(0x128e5a99), - SPH_C32(0xc4bda86c), SPH_C32(0x85b1370d), SPH_C32(0x8a570000), - SPH_C32(0x6f2c0000), SPH_C32(0x013c0000), SPH_C32(0x52141ec0), - SPH_C32(0xedde1559), SPH_C32(0x56bd87bd), SPH_C32(0x6a258361), - SPH_C32(0xd67bb169) }, - { SPH_C32(0x5d440000), SPH_C32(0xb9590000), SPH_C32(0xd6880000), - SPH_C32(0xada5c6a0), SPH_C32(0x874d3af2), SPH_C32(0x8a29ea43), - SPH_C32(0xec28aed8), SPH_C32(0x52eb7f9a), SPH_C32(0x7a920000), - SPH_C32(0x360f0000), SPH_C32(0x44be0000), SPH_C32(0xb3991e00), - SPH_C32(0xd6b31368), SPH_C32(0x9450d124), SPH_C32(0xa1c57d7d), - SPH_C32(0x80dc00f6) }, - { SPH_C32(0xa4b10000), SPH_C32(0xd7ef0000), SPH_C32(0x3dc90000), - SPH_C32(0x4b9e9000), SPH_C32(0xf30107fb), SPH_C32(0xbde710e0), - SPH_C32(0x805696dc), SPH_C32(0x93b1da1b), SPH_C32(0x2a790000), - SPH_C32(0xaff60000), SPH_C32(0xda890000), SPH_C32(0xfcf56000), - SPH_C32(0x686d3607), SPH_C32(0xdadc8975), SPH_C32(0x9fc49d77), - SPH_C32(0x66db1921) }, - { SPH_C32(0x42990000), SPH_C32(0x9ba40000), SPH_C32(0x959c0000), - SPH_C32(0x984e92e0), SPH_C32(0x2b603743), SPH_C32(0x2540a03a), - SPH_C32(0xa8c39068), SPH_C32(0x44eb928c), SPH_C32(0xdabc0000), - SPH_C32(0xf6d50000), SPH_C32(0x9f0b0000), SPH_C32(0x1d7860c0), - SPH_C32(0x53003036), SPH_C32(0x1831dfec), SPH_C32(0x5424636b), - SPH_C32(0x307ca8be) }, - { SPH_C32(0x54740000), SPH_C32(0x8ecc0000), SPH_C32(0x784b0000), - SPH_C32(0xaa1390c0), SPH_C32(0xc86c01ca), SPH_C32(0x7f0a4679), - SPH_C32(0x4bb668c0), SPH_C32(0xc5166b84), SPH_C32(0x3c940000), - SPH_C32(0xba9e0000), SPH_C32(0x375e0000), SPH_C32(0xcea86220), - SPH_C32(0x8b61008e), SPH_C32(0x80966f36), SPH_C32(0x7cb165df), - SPH_C32(0xe726e029) }, - { SPH_C32(0xb25c0000), SPH_C32(0xc2870000), SPH_C32(0xd01e0000), - SPH_C32(0x79c39220), SPH_C32(0x100d3172), SPH_C32(0xe7adf6a3), - SPH_C32(0x63236e74), SPH_C32(0x124c2313), SPH_C32(0xcc510000), - SPH_C32(0xe3bd0000), SPH_C32(0x72dc0000), SPH_C32(0x2f2562e0), - SPH_C32(0xb00c06bf), SPH_C32(0x427b39af), SPH_C32(0xb7519bc3), - SPH_C32(0xb18151b6) }, - { SPH_C32(0x10800000), SPH_C32(0xa0dc0000), SPH_C32(0x8c940000), - SPH_C32(0x344e94e0), SPH_C32(0x8ba366c3), SPH_C32(0x6cf1d3bd), - SPH_C32(0x52004255), SPH_C32(0xdddeaec5), SPH_C32(0xc97f0000), - SPH_C32(0x12370000), SPH_C32(0x5d9a0000), SPH_C32(0x43076060), - SPH_C32(0x46d73c1d), SPH_C32(0x5769be24), SPH_C32(0xec013671), - SPH_C32(0x3d0d0c18) }, - { SPH_C32(0xf6a80000), SPH_C32(0xec970000), SPH_C32(0x24c10000), - SPH_C32(0xe79e9600), SPH_C32(0x53c2567b), SPH_C32(0xf4566367), - SPH_C32(0x7a9544e1), SPH_C32(0x0a84e652), SPH_C32(0x39ba0000), - SPH_C32(0x4b140000), SPH_C32(0x18180000), SPH_C32(0xa28a60a0), - SPH_C32(0x7dba3a2c), SPH_C32(0x9584e8bd), SPH_C32(0x27e1c86d), - SPH_C32(0x6baabd87) }, - { SPH_C32(0xe0450000), SPH_C32(0xf9ff0000), SPH_C32(0xc9160000), - SPH_C32(0xd5c39420), SPH_C32(0xb0ce60f2), SPH_C32(0xae1c8524), - SPH_C32(0x99e0bc49), SPH_C32(0x8b791f5a), SPH_C32(0xdf920000), - SPH_C32(0x075f0000), SPH_C32(0xb04d0000), SPH_C32(0x715a6240), - SPH_C32(0xa5db0a94), SPH_C32(0x0d235867), SPH_C32(0x0f74ced9), - SPH_C32(0xbcf0f510) }, - { SPH_C32(0x066d0000), SPH_C32(0xb5b40000), SPH_C32(0x61430000), - SPH_C32(0x061396c0), SPH_C32(0x68af504a), SPH_C32(0x36bb35fe), - SPH_C32(0xb175bafd), SPH_C32(0x5c2357cd), SPH_C32(0x2f570000), - SPH_C32(0x5e7c0000), SPH_C32(0xf5cf0000), SPH_C32(0x90d76280), - SPH_C32(0x9eb60ca5), SPH_C32(0xcfce0efe), SPH_C32(0xc49430c5), - SPH_C32(0xea57448f) }, - { SPH_C32(0x47b70000), SPH_C32(0x6a2e0000), SPH_C32(0xbada0000), - SPH_C32(0xf46c9060), SPH_C32(0xddbb0de1), SPH_C32(0x305227b1), - SPH_C32(0xf3933dda), SPH_C32(0xc867cf22), SPH_C32(0x7d4e0000), - SPH_C32(0x65040000), SPH_C32(0xecc70000), SPH_C32(0x3cd76480), - SPH_C32(0x3e755d25), SPH_C32(0x867f7d79), SPH_C32(0x3e57e2f8), - SPH_C32(0x736278c6) }, - { SPH_C32(0xa19f0000), SPH_C32(0x26650000), SPH_C32(0x128f0000), - SPH_C32(0x27bc9280), SPH_C32(0x05da3d59), SPH_C32(0xa8f5976b), - SPH_C32(0xdb063b6e), SPH_C32(0x1f3d87b5), SPH_C32(0x8d8b0000), - SPH_C32(0x3c270000), SPH_C32(0xa9450000), SPH_C32(0xdd5a6440), - SPH_C32(0x05185b14), SPH_C32(0x44922be0), SPH_C32(0xf5b71ce4), - SPH_C32(0x25c5c959) }, - { SPH_C32(0xb7720000), SPH_C32(0x330d0000), SPH_C32(0xff580000), - SPH_C32(0x15e190a0), SPH_C32(0xe6d60bd0), SPH_C32(0xf2bf7128), - SPH_C32(0x3873c3c6), SPH_C32(0x9ec07ebd), SPH_C32(0x6ba30000), - SPH_C32(0x706c0000), SPH_C32(0x01100000), SPH_C32(0x0e8a66a0), - SPH_C32(0xdd796bac), SPH_C32(0xdc359b3a), SPH_C32(0xdd221a50), - SPH_C32(0xf29f81ce) }, - { SPH_C32(0x515a0000), SPH_C32(0x7f460000), SPH_C32(0x570d0000), - SPH_C32(0xc6319240), SPH_C32(0x3eb73b68), SPH_C32(0x6a18c1f2), - SPH_C32(0x10e6c572), SPH_C32(0x499a362a), SPH_C32(0x9b660000), - SPH_C32(0x294f0000), SPH_C32(0x44920000), SPH_C32(0xef076660), - SPH_C32(0xe6146d9d), SPH_C32(0x1ed8cda3), SPH_C32(0x16c2e44c), - SPH_C32(0xa4383051) }, - { SPH_C32(0xf3860000), SPH_C32(0x1d1d0000), SPH_C32(0x0b870000), - SPH_C32(0x8bbc9480), SPH_C32(0xa5196cd9), SPH_C32(0xe144e4ec), - SPH_C32(0x21c5e953), SPH_C32(0x8608bbfc), SPH_C32(0x9e480000), - SPH_C32(0xd8c50000), SPH_C32(0x6bd40000), SPH_C32(0x832564e0), - SPH_C32(0x10cf573f), SPH_C32(0x0bca4a28), SPH_C32(0x4d9249fe), - SPH_C32(0x28b46dff) }, - { SPH_C32(0x15ae0000), SPH_C32(0x51560000), SPH_C32(0xa3d20000), - SPH_C32(0x586c9660), SPH_C32(0x7d785c61), SPH_C32(0x79e35436), - SPH_C32(0x0950efe7), SPH_C32(0x5152f36b), SPH_C32(0x6e8d0000), - SPH_C32(0x81e60000), SPH_C32(0x2e560000), SPH_C32(0x62a86420), - SPH_C32(0x2ba2510e), SPH_C32(0xc9271cb1), SPH_C32(0x8672b7e2), - SPH_C32(0x7e13dc60) }, - { SPH_C32(0x03430000), SPH_C32(0x443e0000), SPH_C32(0x4e050000), - SPH_C32(0x6a319440), SPH_C32(0x9e746ae8), SPH_C32(0x23a9b275), - SPH_C32(0xea25174f), SPH_C32(0xd0af0a63), SPH_C32(0x88a50000), - SPH_C32(0xcdad0000), SPH_C32(0x86030000), SPH_C32(0xb17866c0), - SPH_C32(0xf3c361b6), SPH_C32(0x5180ac6b), SPH_C32(0xaee7b156), - SPH_C32(0xa94994f7) }, - { SPH_C32(0xe56b0000), SPH_C32(0x08750000), SPH_C32(0xe6500000), - SPH_C32(0xb9e196a0), SPH_C32(0x46155a50), SPH_C32(0xbb0e02af), - SPH_C32(0xc2b011fb), SPH_C32(0x07f542f4), SPH_C32(0x78600000), - SPH_C32(0x948e0000), SPH_C32(0xc3810000), SPH_C32(0x50f56600), - SPH_C32(0xc8ae6787), SPH_C32(0x936dfaf2), SPH_C32(0x65074f4a), - SPH_C32(0xffee2568) }, - { SPH_C32(0xa6430000), SPH_C32(0x756e0000), SPH_C32(0xbaf60000), - SPH_C32(0xa8f2e800), SPH_C32(0xed1c7314), SPH_C32(0xbada3b36), - SPH_C32(0x4494a4eb), SPH_C32(0xec83ff85), SPH_C32(0x90a40000), - SPH_C32(0xbc5b0000), SPH_C32(0x6d6e0000), SPH_C32(0x0bdd4800), - SPH_C32(0xb728224a), SPH_C32(0xecc64a4f), SPH_C32(0x759e1063), - SPH_C32(0x4cf701d1) }, - { SPH_C32(0x406b0000), SPH_C32(0x39250000), SPH_C32(0x12a30000), - SPH_C32(0x7b22eae0), SPH_C32(0x357d43ac), SPH_C32(0x227d8bec), - SPH_C32(0x6c01a25f), SPH_C32(0x3bd9b712), SPH_C32(0x60610000), - SPH_C32(0xe5780000), SPH_C32(0x28ec0000), SPH_C32(0xea5048c0), - SPH_C32(0x8c45247b), SPH_C32(0x2e2b1cd6), SPH_C32(0xbe7eee7f), - SPH_C32(0x1a50b04e) }, - { SPH_C32(0x56860000), SPH_C32(0x2c4d0000), SPH_C32(0xff740000), - SPH_C32(0x497fe8c0), SPH_C32(0xd6717525), SPH_C32(0x78376daf), - SPH_C32(0x8f745af7), SPH_C32(0xba244e1a), SPH_C32(0x86490000), - SPH_C32(0xa9330000), SPH_C32(0x80b90000), SPH_C32(0x39804a20), - SPH_C32(0x542414c3), SPH_C32(0xb68cac0c), SPH_C32(0x96ebe8cb), - SPH_C32(0xcd0af8d9) }, - { SPH_C32(0xb0ae0000), SPH_C32(0x60060000), SPH_C32(0x57210000), - SPH_C32(0x9aafea20), SPH_C32(0x0e10459d), SPH_C32(0xe090dd75), - SPH_C32(0xa7e15c43), SPH_C32(0x6d7e068d), SPH_C32(0x768c0000), - SPH_C32(0xf0100000), SPH_C32(0xc53b0000), SPH_C32(0xd80d4ae0), - SPH_C32(0x6f4912f2), SPH_C32(0x7461fa95), SPH_C32(0x5d0b16d7), - SPH_C32(0x9bad4946) }, - { SPH_C32(0x12720000), SPH_C32(0x025d0000), SPH_C32(0x0bab0000), - SPH_C32(0xd722ece0), SPH_C32(0x95be122c), SPH_C32(0x6bccf86b), - SPH_C32(0x96c27062), SPH_C32(0xa2ec8b5b), SPH_C32(0x73a20000), - SPH_C32(0x019a0000), SPH_C32(0xea7d0000), SPH_C32(0xb42f4860), - SPH_C32(0x99922850), SPH_C32(0x61737d1e), SPH_C32(0x065bbb65), - SPH_C32(0x172114e8) }, - { SPH_C32(0xf45a0000), SPH_C32(0x4e160000), SPH_C32(0xa3fe0000), - SPH_C32(0x04f2ee00), SPH_C32(0x4ddf2294), SPH_C32(0xf36b48b1), - SPH_C32(0xbe5776d6), SPH_C32(0x75b6c3cc), SPH_C32(0x83670000), - SPH_C32(0x58b90000), SPH_C32(0xafff0000), SPH_C32(0x55a248a0), - SPH_C32(0xa2ff2e61), SPH_C32(0xa39e2b87), SPH_C32(0xcdbb4579), - SPH_C32(0x4186a577) }, - { SPH_C32(0xe2b70000), SPH_C32(0x5b7e0000), SPH_C32(0x4e290000), - SPH_C32(0x36afec20), SPH_C32(0xaed3141d), SPH_C32(0xa921aef2), - SPH_C32(0x5d228e7e), SPH_C32(0xf44b3ac4), SPH_C32(0x654f0000), - SPH_C32(0x14f20000), SPH_C32(0x07aa0000), SPH_C32(0x86724a40), - SPH_C32(0x7a9e1ed9), SPH_C32(0x3b399b5d), SPH_C32(0xe52e43cd), - SPH_C32(0x96dcede0) }, - { SPH_C32(0x049f0000), SPH_C32(0x17350000), SPH_C32(0xe67c0000), - SPH_C32(0xe57feec0), SPH_C32(0x76b224a5), SPH_C32(0x31861e28), - SPH_C32(0x75b788ca), SPH_C32(0x23117253), SPH_C32(0x958a0000), - SPH_C32(0x4dd10000), SPH_C32(0x42280000), SPH_C32(0x67ff4a80), - SPH_C32(0x41f318e8), SPH_C32(0xf9d4cdc4), SPH_C32(0x2ecebdd1), - SPH_C32(0xc07b5c7f) }, - { SPH_C32(0x45450000), SPH_C32(0xc8af0000), SPH_C32(0x3de50000), - SPH_C32(0x1700e860), SPH_C32(0xc3a6790e), SPH_C32(0x376f0c67), - SPH_C32(0x37510fed), SPH_C32(0xb755eabc), SPH_C32(0xc7930000), - SPH_C32(0x76a90000), SPH_C32(0x5b200000), SPH_C32(0xcbff4c80), - SPH_C32(0xe1304968), SPH_C32(0xb065be43), SPH_C32(0xd40d6fec), - SPH_C32(0x594e6036) }, - { SPH_C32(0xa36d0000), SPH_C32(0x84e40000), SPH_C32(0x95b00000), - SPH_C32(0xc4d0ea80), SPH_C32(0x1bc749b6), SPH_C32(0xafc8bcbd), - SPH_C32(0x1fc40959), SPH_C32(0x600fa22b), SPH_C32(0x37560000), - SPH_C32(0x2f8a0000), SPH_C32(0x1ea20000), SPH_C32(0x2a724c40), - SPH_C32(0xda5d4f59), SPH_C32(0x7288e8da), SPH_C32(0x1fed91f0), - SPH_C32(0x0fe9d1a9) }, - { SPH_C32(0xb5800000), SPH_C32(0x918c0000), SPH_C32(0x78670000), - SPH_C32(0xf68de8a0), SPH_C32(0xf8cb7f3f), SPH_C32(0xf5825afe), - SPH_C32(0xfcb1f1f1), SPH_C32(0xe1f25b23), SPH_C32(0xd17e0000), - SPH_C32(0x63c10000), SPH_C32(0xb6f70000), SPH_C32(0xf9a24ea0), - SPH_C32(0x023c7fe1), SPH_C32(0xea2f5800), SPH_C32(0x37789744), - SPH_C32(0xd8b3993e) }, - { SPH_C32(0x53a80000), SPH_C32(0xddc70000), SPH_C32(0xd0320000), - SPH_C32(0x255dea40), SPH_C32(0x20aa4f87), SPH_C32(0x6d25ea24), - SPH_C32(0xd424f745), SPH_C32(0x36a813b4), SPH_C32(0x21bb0000), - SPH_C32(0x3ae20000), SPH_C32(0xf3750000), SPH_C32(0x182f4e60), - SPH_C32(0x395179d0), SPH_C32(0x28c20e99), SPH_C32(0xfc986958), - SPH_C32(0x8e1428a1) }, - { SPH_C32(0xf1740000), SPH_C32(0xbf9c0000), SPH_C32(0x8cb80000), - SPH_C32(0x68d0ec80), SPH_C32(0xbb041836), SPH_C32(0xe679cf3a), - SPH_C32(0xe507db64), SPH_C32(0xf93a9e62), SPH_C32(0x24950000), - SPH_C32(0xcb680000), SPH_C32(0xdc330000), SPH_C32(0x740d4ce0), - SPH_C32(0xcf8a4372), SPH_C32(0x3dd08912), SPH_C32(0xa7c8c4ea), - SPH_C32(0x0298750f) }, - { SPH_C32(0x175c0000), SPH_C32(0xf3d70000), SPH_C32(0x24ed0000), - SPH_C32(0xbb00ee60), SPH_C32(0x6365288e), SPH_C32(0x7ede7fe0), - SPH_C32(0xcd92ddd0), SPH_C32(0x2e60d6f5), SPH_C32(0xd4500000), - SPH_C32(0x924b0000), SPH_C32(0x99b10000), SPH_C32(0x95804c20), - SPH_C32(0xf4e74543), SPH_C32(0xff3ddf8b), SPH_C32(0x6c283af6), - SPH_C32(0x543fc490) }, - { SPH_C32(0x01b10000), SPH_C32(0xe6bf0000), SPH_C32(0xc93a0000), - SPH_C32(0x895dec40), SPH_C32(0x80691e07), SPH_C32(0x249499a3), - SPH_C32(0x2ee72578), SPH_C32(0xaf9d2ffd), SPH_C32(0x32780000), - SPH_C32(0xde000000), SPH_C32(0x31e40000), SPH_C32(0x46504ec0), - SPH_C32(0x2c8675fb), SPH_C32(0x679a6f51), SPH_C32(0x44bd3c42), - SPH_C32(0x83658c07) }, - { SPH_C32(0xe7990000), SPH_C32(0xaaf40000), SPH_C32(0x616f0000), - SPH_C32(0x5a8deea0), SPH_C32(0x58082ebf), SPH_C32(0xbc332979), - SPH_C32(0x067223cc), SPH_C32(0x78c7676a), SPH_C32(0xc2bd0000), - SPH_C32(0x87230000), SPH_C32(0x74660000), SPH_C32(0xa7dd4e00), - SPH_C32(0x17eb73ca), SPH_C32(0xa57739c8), SPH_C32(0x8f5dc25e), - SPH_C32(0xd5c23d98) }, - { SPH_C32(0x92560000), SPH_C32(0x1eda0000), SPH_C32(0xea510000), - SPH_C32(0xe8b13000), SPH_C32(0xa93556a5), SPH_C32(0xebfb6199), - SPH_C32(0xb15c2254), SPH_C32(0x33c5244f), SPH_C32(0x8c3a0000), - SPH_C32(0xda980000), SPH_C32(0x607f0000), SPH_C32(0x54078800), - SPH_C32(0x85714513), SPH_C32(0x6006b243), SPH_C32(0xdb50399c), - SPH_C32(0x8a58e6a4) }, - { SPH_C32(0x747e0000), SPH_C32(0x52910000), SPH_C32(0x42040000), - SPH_C32(0x3b6132e0), SPH_C32(0x7154661d), SPH_C32(0x735cd143), - SPH_C32(0x99c924e0), SPH_C32(0xe49f6cd8), SPH_C32(0x7cff0000), - SPH_C32(0x83bb0000), SPH_C32(0x25fd0000), SPH_C32(0xb58a88c0), - SPH_C32(0xbe1c4322), SPH_C32(0xa2ebe4da), SPH_C32(0x10b0c780), - SPH_C32(0xdcff573b) }, - { SPH_C32(0x62930000), SPH_C32(0x47f90000), SPH_C32(0xafd30000), - SPH_C32(0x093c30c0), SPH_C32(0x92585094), SPH_C32(0x29163700), - SPH_C32(0x7abcdc48), SPH_C32(0x656295d0), SPH_C32(0x9ad70000), - SPH_C32(0xcff00000), SPH_C32(0x8da80000), SPH_C32(0x665a8a20), - SPH_C32(0x667d739a), SPH_C32(0x3a4c5400), SPH_C32(0x3825c134), - SPH_C32(0x0ba51fac) }, - { SPH_C32(0x84bb0000), SPH_C32(0x0bb20000), SPH_C32(0x07860000), - SPH_C32(0xdaec3220), SPH_C32(0x4a39602c), SPH_C32(0xb1b187da), - SPH_C32(0x5229dafc), SPH_C32(0xb238dd47), SPH_C32(0x6a120000), - SPH_C32(0x96d30000), SPH_C32(0xc82a0000), SPH_C32(0x87d78ae0), - SPH_C32(0x5d1075ab), SPH_C32(0xf8a10299), SPH_C32(0xf3c53f28), - SPH_C32(0x5d02ae33) }, - { SPH_C32(0x26670000), SPH_C32(0x69e90000), SPH_C32(0x5b0c0000), - SPH_C32(0x976134e0), SPH_C32(0xd197379d), SPH_C32(0x3aeda2c4), - SPH_C32(0x630af6dd), SPH_C32(0x7daa5091), SPH_C32(0x6f3c0000), - SPH_C32(0x67590000), SPH_C32(0xe76c0000), SPH_C32(0xebf58860), - SPH_C32(0xabcb4f09), SPH_C32(0xedb38512), SPH_C32(0xa895929a), - SPH_C32(0xd18ef39d) }, - { SPH_C32(0xc04f0000), SPH_C32(0x25a20000), SPH_C32(0xf3590000), - SPH_C32(0x44b13600), SPH_C32(0x09f60725), SPH_C32(0xa24a121e), - SPH_C32(0x4b9ff069), SPH_C32(0xaaf01806), SPH_C32(0x9ff90000), - SPH_C32(0x3e7a0000), SPH_C32(0xa2ee0000), SPH_C32(0x0a7888a0), - SPH_C32(0x90a64938), SPH_C32(0x2f5ed38b), SPH_C32(0x63756c86), - SPH_C32(0x87294202) }, - { SPH_C32(0xd6a20000), SPH_C32(0x30ca0000), SPH_C32(0x1e8e0000), - SPH_C32(0x76ec3420), SPH_C32(0xeafa31ac), SPH_C32(0xf800f45d), - SPH_C32(0xa8ea08c1), SPH_C32(0x2b0de10e), SPH_C32(0x79d10000), - SPH_C32(0x72310000), SPH_C32(0x0abb0000), SPH_C32(0xd9a88a40), - SPH_C32(0x48c77980), SPH_C32(0xb7f96351), SPH_C32(0x4be06a32), - SPH_C32(0x50730a95) }, - { SPH_C32(0x308a0000), SPH_C32(0x7c810000), SPH_C32(0xb6db0000), - SPH_C32(0xa53c36c0), SPH_C32(0x329b0114), SPH_C32(0x60a74487), - SPH_C32(0x807f0e75), SPH_C32(0xfc57a999), SPH_C32(0x89140000), - SPH_C32(0x2b120000), SPH_C32(0x4f390000), SPH_C32(0x38258a80), - SPH_C32(0x73aa7fb1), SPH_C32(0x751435c8), SPH_C32(0x8000942e), - SPH_C32(0x06d4bb0a) }, - { SPH_C32(0x71500000), SPH_C32(0xa31b0000), SPH_C32(0x6d420000), - SPH_C32(0x57433060), SPH_C32(0x878f5cbf), SPH_C32(0x664e56c8), - SPH_C32(0xc2998952), SPH_C32(0x68133176), SPH_C32(0xdb0d0000), - SPH_C32(0x106a0000), SPH_C32(0x56310000), SPH_C32(0x94258c80), - SPH_C32(0xd3692e31), SPH_C32(0x3ca5464f), SPH_C32(0x7ac34613), - SPH_C32(0x9fe18743) }, - { SPH_C32(0x97780000), SPH_C32(0xef500000), SPH_C32(0xc5170000), - SPH_C32(0x84933280), SPH_C32(0x5fee6c07), SPH_C32(0xfee9e612), - SPH_C32(0xea0c8fe6), SPH_C32(0xbf4979e1), SPH_C32(0x2bc80000), - SPH_C32(0x49490000), SPH_C32(0x13b30000), SPH_C32(0x75a88c40), - SPH_C32(0xe8042800), SPH_C32(0xfe4810d6), SPH_C32(0xb123b80f), - SPH_C32(0xc94636dc) }, - { SPH_C32(0x81950000), SPH_C32(0xfa380000), SPH_C32(0x28c00000), - SPH_C32(0xb6ce30a0), SPH_C32(0xbce25a8e), SPH_C32(0xa4a30051), - SPH_C32(0x0979774e), SPH_C32(0x3eb480e9), SPH_C32(0xcde00000), - SPH_C32(0x05020000), SPH_C32(0xbbe60000), SPH_C32(0xa6788ea0), - SPH_C32(0x306518b8), SPH_C32(0x66efa00c), SPH_C32(0x99b6bebb), - SPH_C32(0x1e1c7e4b) }, - { SPH_C32(0x67bd0000), SPH_C32(0xb6730000), SPH_C32(0x80950000), - SPH_C32(0x651e3240), SPH_C32(0x64836a36), SPH_C32(0x3c04b08b), - SPH_C32(0x21ec71fa), SPH_C32(0xe9eec87e), SPH_C32(0x3d250000), - SPH_C32(0x5c210000), SPH_C32(0xfe640000), SPH_C32(0x47f58e60), - SPH_C32(0x0b081e89), SPH_C32(0xa402f695), SPH_C32(0x525640a7), - SPH_C32(0x48bbcfd4) }, - { SPH_C32(0xc5610000), SPH_C32(0xd4280000), SPH_C32(0xdc1f0000), - SPH_C32(0x28933480), SPH_C32(0xff2d3d87), SPH_C32(0xb7589595), - SPH_C32(0x10cf5ddb), SPH_C32(0x267c45a8), SPH_C32(0x380b0000), - SPH_C32(0xadab0000), SPH_C32(0xd1220000), SPH_C32(0x2bd78ce0), - SPH_C32(0xfdd3242b), SPH_C32(0xb110711e), SPH_C32(0x0906ed15), - SPH_C32(0xc437927a) }, - { SPH_C32(0x23490000), SPH_C32(0x98630000), SPH_C32(0x744a0000), - SPH_C32(0xfb433660), SPH_C32(0x274c0d3f), SPH_C32(0x2fff254f), - SPH_C32(0x385a5b6f), SPH_C32(0xf1260d3f), SPH_C32(0xc8ce0000), - SPH_C32(0xf4880000), SPH_C32(0x94a00000), SPH_C32(0xca5a8c20), - SPH_C32(0xc6be221a), SPH_C32(0x73fd2787), SPH_C32(0xc2e61309), - SPH_C32(0x929023e5) }, - { SPH_C32(0x35a40000), SPH_C32(0x8d0b0000), SPH_C32(0x999d0000), - SPH_C32(0xc91e3440), SPH_C32(0xc4403bb6), SPH_C32(0x75b5c30c), - SPH_C32(0xdb2fa3c7), SPH_C32(0x70dbf437), SPH_C32(0x2ee60000), - SPH_C32(0xb8c30000), SPH_C32(0x3cf50000), SPH_C32(0x198a8ec0), - SPH_C32(0x1edf12a2), SPH_C32(0xeb5a975d), SPH_C32(0xea7315bd), - SPH_C32(0x45ca6b72) }, - { SPH_C32(0xd38c0000), SPH_C32(0xc1400000), SPH_C32(0x31c80000), - SPH_C32(0x1ace36a0), SPH_C32(0x1c210b0e), SPH_C32(0xed1273d6), - SPH_C32(0xf3baa573), SPH_C32(0xa781bca0), SPH_C32(0xde230000), - SPH_C32(0xe1e00000), SPH_C32(0x79770000), SPH_C32(0xf8078e00), - SPH_C32(0x25b21493), SPH_C32(0x29b7c1c4), SPH_C32(0x2193eba1), - SPH_C32(0x136ddaed) }, - { SPH_C32(0x90a40000), SPH_C32(0xbc5b0000), SPH_C32(0x6d6e0000), - SPH_C32(0x0bdd4800), SPH_C32(0xb728224a), SPH_C32(0xecc64a4f), - SPH_C32(0x759e1063), SPH_C32(0x4cf701d1), SPH_C32(0x36e70000), - SPH_C32(0xc9350000), SPH_C32(0xd7980000), SPH_C32(0xa32fa000), - SPH_C32(0x5a34515e), SPH_C32(0x561c7179), SPH_C32(0x310ab488), - SPH_C32(0xa074fe54) }, - { SPH_C32(0x768c0000), SPH_C32(0xf0100000), SPH_C32(0xc53b0000), - SPH_C32(0xd80d4ae0), SPH_C32(0x6f4912f2), SPH_C32(0x7461fa95), - SPH_C32(0x5d0b16d7), SPH_C32(0x9bad4946), SPH_C32(0xc6220000), - SPH_C32(0x90160000), SPH_C32(0x921a0000), SPH_C32(0x42a2a0c0), - SPH_C32(0x6159576f), SPH_C32(0x94f127e0), SPH_C32(0xfaea4a94), - SPH_C32(0xf6d34fcb) }, - { SPH_C32(0x60610000), SPH_C32(0xe5780000), SPH_C32(0x28ec0000), - SPH_C32(0xea5048c0), SPH_C32(0x8c45247b), SPH_C32(0x2e2b1cd6), - SPH_C32(0xbe7eee7f), SPH_C32(0x1a50b04e), SPH_C32(0x200a0000), - SPH_C32(0xdc5d0000), SPH_C32(0x3a4f0000), SPH_C32(0x9172a220), - SPH_C32(0xb93867d7), SPH_C32(0x0c56973a), SPH_C32(0xd27f4c20), - SPH_C32(0x2189075c) }, - { SPH_C32(0x86490000), SPH_C32(0xa9330000), SPH_C32(0x80b90000), - SPH_C32(0x39804a20), SPH_C32(0x542414c3), SPH_C32(0xb68cac0c), - SPH_C32(0x96ebe8cb), SPH_C32(0xcd0af8d9), SPH_C32(0xd0cf0000), - SPH_C32(0x857e0000), SPH_C32(0x7fcd0000), SPH_C32(0x70ffa2e0), - SPH_C32(0x825561e6), SPH_C32(0xcebbc1a3), SPH_C32(0x199fb23c), - SPH_C32(0x772eb6c3) }, - { SPH_C32(0x24950000), SPH_C32(0xcb680000), SPH_C32(0xdc330000), - SPH_C32(0x740d4ce0), SPH_C32(0xcf8a4372), SPH_C32(0x3dd08912), - SPH_C32(0xa7c8c4ea), SPH_C32(0x0298750f), SPH_C32(0xd5e10000), - SPH_C32(0x74f40000), SPH_C32(0x508b0000), SPH_C32(0x1cdda060), - SPH_C32(0x748e5b44), SPH_C32(0xdba94628), SPH_C32(0x42cf1f8e), - SPH_C32(0xfba2eb6d) }, - { SPH_C32(0xc2bd0000), SPH_C32(0x87230000), SPH_C32(0x74660000), - SPH_C32(0xa7dd4e00), SPH_C32(0x17eb73ca), SPH_C32(0xa57739c8), - SPH_C32(0x8f5dc25e), SPH_C32(0xd5c23d98), SPH_C32(0x25240000), - SPH_C32(0x2dd70000), SPH_C32(0x15090000), SPH_C32(0xfd50a0a0), - SPH_C32(0x4fe35d75), SPH_C32(0x194410b1), SPH_C32(0x892fe192), - SPH_C32(0xad055af2) }, - { SPH_C32(0xd4500000), SPH_C32(0x924b0000), SPH_C32(0x99b10000), - SPH_C32(0x95804c20), SPH_C32(0xf4e74543), SPH_C32(0xff3ddf8b), - SPH_C32(0x6c283af6), SPH_C32(0x543fc490), SPH_C32(0xc30c0000), - SPH_C32(0x619c0000), SPH_C32(0xbd5c0000), SPH_C32(0x2e80a240), - SPH_C32(0x97826dcd), SPH_C32(0x81e3a06b), SPH_C32(0xa1bae726), - SPH_C32(0x7a5f1265) }, - { SPH_C32(0x32780000), SPH_C32(0xde000000), SPH_C32(0x31e40000), - SPH_C32(0x46504ec0), SPH_C32(0x2c8675fb), SPH_C32(0x679a6f51), - SPH_C32(0x44bd3c42), SPH_C32(0x83658c07), SPH_C32(0x33c90000), - SPH_C32(0x38bf0000), SPH_C32(0xf8de0000), SPH_C32(0xcf0da280), - SPH_C32(0xacef6bfc), SPH_C32(0x430ef6f2), SPH_C32(0x6a5a193a), - SPH_C32(0x2cf8a3fa) }, - { SPH_C32(0x73a20000), SPH_C32(0x019a0000), SPH_C32(0xea7d0000), - SPH_C32(0xb42f4860), SPH_C32(0x99922850), SPH_C32(0x61737d1e), - SPH_C32(0x065bbb65), SPH_C32(0x172114e8), SPH_C32(0x61d00000), - SPH_C32(0x03c70000), SPH_C32(0xe1d60000), SPH_C32(0x630da480), - SPH_C32(0x0c2c3a7c), SPH_C32(0x0abf8575), SPH_C32(0x9099cb07), - SPH_C32(0xb5cd9fb3) }, - { SPH_C32(0x958a0000), SPH_C32(0x4dd10000), SPH_C32(0x42280000), - SPH_C32(0x67ff4a80), SPH_C32(0x41f318e8), SPH_C32(0xf9d4cdc4), - SPH_C32(0x2ecebdd1), SPH_C32(0xc07b5c7f), SPH_C32(0x91150000), - SPH_C32(0x5ae40000), SPH_C32(0xa4540000), SPH_C32(0x8280a440), - SPH_C32(0x37413c4d), SPH_C32(0xc852d3ec), SPH_C32(0x5b79351b), - SPH_C32(0xe36a2e2c) }, - { SPH_C32(0x83670000), SPH_C32(0x58b90000), SPH_C32(0xafff0000), - SPH_C32(0x55a248a0), SPH_C32(0xa2ff2e61), SPH_C32(0xa39e2b87), - SPH_C32(0xcdbb4579), SPH_C32(0x4186a577), SPH_C32(0x773d0000), - SPH_C32(0x16af0000), SPH_C32(0x0c010000), SPH_C32(0x5150a6a0), - SPH_C32(0xef200cf5), SPH_C32(0x50f56336), SPH_C32(0x73ec33af), - SPH_C32(0x343066bb) }, - { SPH_C32(0x654f0000), SPH_C32(0x14f20000), SPH_C32(0x07aa0000), - SPH_C32(0x86724a40), SPH_C32(0x7a9e1ed9), SPH_C32(0x3b399b5d), - SPH_C32(0xe52e43cd), SPH_C32(0x96dcede0), SPH_C32(0x87f80000), - SPH_C32(0x4f8c0000), SPH_C32(0x49830000), SPH_C32(0xb0dda660), - SPH_C32(0xd44d0ac4), SPH_C32(0x921835af), SPH_C32(0xb80ccdb3), - SPH_C32(0x6297d724) }, - { SPH_C32(0xc7930000), SPH_C32(0x76a90000), SPH_C32(0x5b200000), - SPH_C32(0xcbff4c80), SPH_C32(0xe1304968), SPH_C32(0xb065be43), - SPH_C32(0xd40d6fec), SPH_C32(0x594e6036), SPH_C32(0x82d60000), - SPH_C32(0xbe060000), SPH_C32(0x66c50000), SPH_C32(0xdcffa4e0), - SPH_C32(0x22963066), SPH_C32(0x870ab224), SPH_C32(0xe35c6001), - SPH_C32(0xee1b8a8a) }, - { SPH_C32(0x21bb0000), SPH_C32(0x3ae20000), SPH_C32(0xf3750000), - SPH_C32(0x182f4e60), SPH_C32(0x395179d0), SPH_C32(0x28c20e99), - SPH_C32(0xfc986958), SPH_C32(0x8e1428a1), SPH_C32(0x72130000), - SPH_C32(0xe7250000), SPH_C32(0x23470000), SPH_C32(0x3d72a420), - SPH_C32(0x19fb3657), SPH_C32(0x45e7e4bd), SPH_C32(0x28bc9e1d), - SPH_C32(0xb8bc3b15) }, - { SPH_C32(0x37560000), SPH_C32(0x2f8a0000), SPH_C32(0x1ea20000), - SPH_C32(0x2a724c40), SPH_C32(0xda5d4f59), SPH_C32(0x7288e8da), - SPH_C32(0x1fed91f0), SPH_C32(0x0fe9d1a9), SPH_C32(0x943b0000), - SPH_C32(0xab6e0000), SPH_C32(0x8b120000), SPH_C32(0xeea2a6c0), - SPH_C32(0xc19a06ef), SPH_C32(0xdd405467), SPH_C32(0x002998a9), - SPH_C32(0x6fe67382) }, - { SPH_C32(0xd17e0000), SPH_C32(0x63c10000), SPH_C32(0xb6f70000), - SPH_C32(0xf9a24ea0), SPH_C32(0x023c7fe1), SPH_C32(0xea2f5800), - SPH_C32(0x37789744), SPH_C32(0xd8b3993e), SPH_C32(0x64fe0000), - SPH_C32(0xf24d0000), SPH_C32(0xce900000), SPH_C32(0x0f2fa600), - SPH_C32(0xfaf700de), SPH_C32(0x1fad02fe), SPH_C32(0xcbc966b5), - SPH_C32(0x3941c21d) }, - { SPH_C32(0x288b0000), SPH_C32(0x0d770000), SPH_C32(0x5db60000), - SPH_C32(0x1f991800), SPH_C32(0x767042e8), SPH_C32(0xdde1a2a3), - SPH_C32(0x5b06af40), SPH_C32(0x19e93cbf), SPH_C32(0x34150000), - SPH_C32(0x6bb40000), SPH_C32(0x50a70000), SPH_C32(0x4043d800), - SPH_C32(0x442925b1), SPH_C32(0x51215aaf), SPH_C32(0xf5c886bf), - SPH_C32(0xdf46dbca) }, - { SPH_C32(0xcea30000), SPH_C32(0x413c0000), SPH_C32(0xf5e30000), - SPH_C32(0xcc491ae0), SPH_C32(0xae117250), SPH_C32(0x45461279), - SPH_C32(0x7393a9f4), SPH_C32(0xceb37428), SPH_C32(0xc4d00000), - SPH_C32(0x32970000), SPH_C32(0x15250000), SPH_C32(0xa1ced8c0), - SPH_C32(0x7f442380), SPH_C32(0x93cc0c36), SPH_C32(0x3e2878a3), - SPH_C32(0x89e16a55) }, - { SPH_C32(0xd84e0000), SPH_C32(0x54540000), SPH_C32(0x18340000), - SPH_C32(0xfe1418c0), SPH_C32(0x4d1d44d9), SPH_C32(0x1f0cf43a), - SPH_C32(0x90e6515c), SPH_C32(0x4f4e8d20), SPH_C32(0x22f80000), - SPH_C32(0x7edc0000), SPH_C32(0xbd700000), SPH_C32(0x721eda20), - SPH_C32(0xa7251338), SPH_C32(0x0b6bbcec), SPH_C32(0x16bd7e17), - SPH_C32(0x5ebb22c2) }, - { SPH_C32(0x3e660000), SPH_C32(0x181f0000), SPH_C32(0xb0610000), - SPH_C32(0x2dc41a20), SPH_C32(0x957c7461), SPH_C32(0x87ab44e0), - SPH_C32(0xb87357e8), SPH_C32(0x9814c5b7), SPH_C32(0xd23d0000), - SPH_C32(0x27ff0000), SPH_C32(0xf8f20000), SPH_C32(0x9393dae0), - SPH_C32(0x9c481509), SPH_C32(0xc986ea75), SPH_C32(0xdd5d800b), - SPH_C32(0x081c935d) }, - { SPH_C32(0x9cba0000), SPH_C32(0x7a440000), SPH_C32(0xeceb0000), - SPH_C32(0x60491ce0), SPH_C32(0x0ed223d0), SPH_C32(0x0cf761fe), - SPH_C32(0x89507bc9), SPH_C32(0x57864861), SPH_C32(0xd7130000), - SPH_C32(0xd6750000), SPH_C32(0xd7b40000), SPH_C32(0xffb1d860), - SPH_C32(0x6a932fab), SPH_C32(0xdc946dfe), SPH_C32(0x860d2db9), - SPH_C32(0x8490cef3) }, - { SPH_C32(0x7a920000), SPH_C32(0x360f0000), SPH_C32(0x44be0000), - SPH_C32(0xb3991e00), SPH_C32(0xd6b31368), SPH_C32(0x9450d124), - SPH_C32(0xa1c57d7d), SPH_C32(0x80dc00f6), SPH_C32(0x27d60000), - SPH_C32(0x8f560000), SPH_C32(0x92360000), SPH_C32(0x1e3cd8a0), - SPH_C32(0x51fe299a), SPH_C32(0x1e793b67), SPH_C32(0x4dedd3a5), - SPH_C32(0xd2377f6c) }, - { SPH_C32(0x6c7f0000), SPH_C32(0x23670000), SPH_C32(0xa9690000), - SPH_C32(0x81c41c20), SPH_C32(0x35bf25e1), SPH_C32(0xce1a3767), - SPH_C32(0x42b085d5), SPH_C32(0x0121f9fe), SPH_C32(0xc1fe0000), - SPH_C32(0xc31d0000), SPH_C32(0x3a630000), SPH_C32(0xcdecda40), - SPH_C32(0x899f1922), SPH_C32(0x86de8bbd), SPH_C32(0x6578d511), - SPH_C32(0x056d37fb) }, - { SPH_C32(0x8a570000), SPH_C32(0x6f2c0000), SPH_C32(0x013c0000), - SPH_C32(0x52141ec0), SPH_C32(0xedde1559), SPH_C32(0x56bd87bd), - SPH_C32(0x6a258361), SPH_C32(0xd67bb169), SPH_C32(0x313b0000), - SPH_C32(0x9a3e0000), SPH_C32(0x7fe10000), SPH_C32(0x2c61da80), - SPH_C32(0xb2f21f13), SPH_C32(0x4433dd24), SPH_C32(0xae982b0d), - SPH_C32(0x53ca8664) }, - { SPH_C32(0xcb8d0000), SPH_C32(0xb0b60000), SPH_C32(0xdaa50000), - SPH_C32(0xa06b1860), SPH_C32(0x58ca48f2), SPH_C32(0x505495f2), - SPH_C32(0x28c30446), SPH_C32(0x423f2986), SPH_C32(0x63220000), - SPH_C32(0xa1460000), SPH_C32(0x66e90000), SPH_C32(0x8061dc80), - SPH_C32(0x12314e93), SPH_C32(0x0d82aea3), SPH_C32(0x545bf930), - SPH_C32(0xcaffba2d) }, - { SPH_C32(0x2da50000), SPH_C32(0xfcfd0000), SPH_C32(0x72f00000), - SPH_C32(0x73bb1a80), SPH_C32(0x80ab784a), SPH_C32(0xc8f32528), - SPH_C32(0x005602f2), SPH_C32(0x95656111), SPH_C32(0x93e70000), - SPH_C32(0xf8650000), SPH_C32(0x236b0000), SPH_C32(0x61ecdc40), - SPH_C32(0x295c48a2), SPH_C32(0xcf6ff83a), SPH_C32(0x9fbb072c), - SPH_C32(0x9c580bb2) }, - { SPH_C32(0x3b480000), SPH_C32(0xe9950000), SPH_C32(0x9f270000), - SPH_C32(0x41e618a0), SPH_C32(0x63a74ec3), SPH_C32(0x92b9c36b), - SPH_C32(0xe323fa5a), SPH_C32(0x14989819), SPH_C32(0x75cf0000), - SPH_C32(0xb42e0000), SPH_C32(0x8b3e0000), SPH_C32(0xb23cdea0), - SPH_C32(0xf13d781a), SPH_C32(0x57c848e0), SPH_C32(0xb72e0198), - SPH_C32(0x4b024325) }, - { SPH_C32(0xdd600000), SPH_C32(0xa5de0000), SPH_C32(0x37720000), - SPH_C32(0x92361a40), SPH_C32(0xbbc67e7b), SPH_C32(0x0a1e73b1), - SPH_C32(0xcbb6fcee), SPH_C32(0xc3c2d08e), SPH_C32(0x850a0000), - SPH_C32(0xed0d0000), SPH_C32(0xcebc0000), SPH_C32(0x53b1de60), - SPH_C32(0xca507e2b), SPH_C32(0x95251e79), SPH_C32(0x7cceff84), - SPH_C32(0x1da5f2ba) }, - { SPH_C32(0x7fbc0000), SPH_C32(0xc7850000), SPH_C32(0x6bf80000), - SPH_C32(0xdfbb1c80), SPH_C32(0x206829ca), SPH_C32(0x814256af), - SPH_C32(0xfa95d0cf), SPH_C32(0x0c505d58), SPH_C32(0x80240000), - SPH_C32(0x1c870000), SPH_C32(0xe1fa0000), SPH_C32(0x3f93dce0), - SPH_C32(0x3c8b4489), SPH_C32(0x803799f2), SPH_C32(0x279e5236), - SPH_C32(0x9129af14) }, - { SPH_C32(0x99940000), SPH_C32(0x8bce0000), SPH_C32(0xc3ad0000), - SPH_C32(0x0c6b1e60), SPH_C32(0xf8091972), SPH_C32(0x19e5e675), - SPH_C32(0xd200d67b), SPH_C32(0xdb0a15cf), SPH_C32(0x70e10000), - SPH_C32(0x45a40000), SPH_C32(0xa4780000), SPH_C32(0xde1edc20), - SPH_C32(0x07e642b8), SPH_C32(0x42dacf6b), SPH_C32(0xec7eac2a), - SPH_C32(0xc78e1e8b) }, - { SPH_C32(0x8f790000), SPH_C32(0x9ea60000), SPH_C32(0x2e7a0000), - SPH_C32(0x3e361c40), SPH_C32(0x1b052ffb), SPH_C32(0x43af0036), - SPH_C32(0x31752ed3), SPH_C32(0x5af7ecc7), SPH_C32(0x96c90000), - SPH_C32(0x09ef0000), SPH_C32(0x0c2d0000), SPH_C32(0x0dcedec0), - SPH_C32(0xdf877200), SPH_C32(0xda7d7fb1), SPH_C32(0xc4ebaa9e), - SPH_C32(0x10d4561c) }, - { SPH_C32(0x69510000), SPH_C32(0xd2ed0000), SPH_C32(0x862f0000), - SPH_C32(0xede61ea0), SPH_C32(0xc3641f43), SPH_C32(0xdb08b0ec), - SPH_C32(0x19e02867), SPH_C32(0x8dada450), SPH_C32(0x660c0000), - SPH_C32(0x50cc0000), SPH_C32(0x49af0000), SPH_C32(0xec43de00), - SPH_C32(0xe4ea7431), SPH_C32(0x18902928), SPH_C32(0x0f0b5482), - SPH_C32(0x4673e783) }, - { SPH_C32(0x2a790000), SPH_C32(0xaff60000), SPH_C32(0xda890000), - SPH_C32(0xfcf56000), SPH_C32(0x686d3607), SPH_C32(0xdadc8975), - SPH_C32(0x9fc49d77), SPH_C32(0x66db1921), SPH_C32(0x8ec80000), - SPH_C32(0x78190000), SPH_C32(0xe7400000), SPH_C32(0xb76bf000), - SPH_C32(0x9b6c31fc), SPH_C32(0x673b9995), SPH_C32(0x1f920bab), - SPH_C32(0xf56ac33a) }, - { SPH_C32(0xcc510000), SPH_C32(0xe3bd0000), SPH_C32(0x72dc0000), - SPH_C32(0x2f2562e0), SPH_C32(0xb00c06bf), SPH_C32(0x427b39af), - SPH_C32(0xb7519bc3), SPH_C32(0xb18151b6), SPH_C32(0x7e0d0000), - SPH_C32(0x213a0000), SPH_C32(0xa2c20000), SPH_C32(0x56e6f0c0), - SPH_C32(0xa00137cd), SPH_C32(0xa5d6cf0c), SPH_C32(0xd472f5b7), - SPH_C32(0xa3cd72a5) }, - { SPH_C32(0xdabc0000), SPH_C32(0xf6d50000), SPH_C32(0x9f0b0000), - SPH_C32(0x1d7860c0), SPH_C32(0x53003036), SPH_C32(0x1831dfec), - SPH_C32(0x5424636b), SPH_C32(0x307ca8be), SPH_C32(0x98250000), - SPH_C32(0x6d710000), SPH_C32(0x0a970000), SPH_C32(0x8536f220), - SPH_C32(0x78600775), SPH_C32(0x3d717fd6), SPH_C32(0xfce7f303), - SPH_C32(0x74973a32) }, - { SPH_C32(0x3c940000), SPH_C32(0xba9e0000), SPH_C32(0x375e0000), - SPH_C32(0xcea86220), SPH_C32(0x8b61008e), SPH_C32(0x80966f36), - SPH_C32(0x7cb165df), SPH_C32(0xe726e029), SPH_C32(0x68e00000), - SPH_C32(0x34520000), SPH_C32(0x4f150000), SPH_C32(0x64bbf2e0), - SPH_C32(0x430d0144), SPH_C32(0xff9c294f), SPH_C32(0x37070d1f), - SPH_C32(0x22308bad) }, - { SPH_C32(0x9e480000), SPH_C32(0xd8c50000), SPH_C32(0x6bd40000), - SPH_C32(0x832564e0), SPH_C32(0x10cf573f), SPH_C32(0x0bca4a28), - SPH_C32(0x4d9249fe), SPH_C32(0x28b46dff), SPH_C32(0x6dce0000), - SPH_C32(0xc5d80000), SPH_C32(0x60530000), SPH_C32(0x0899f060), - SPH_C32(0xb5d63be6), SPH_C32(0xea8eaec4), SPH_C32(0x6c57a0ad), - SPH_C32(0xaebcd603) }, - { SPH_C32(0x78600000), SPH_C32(0x948e0000), SPH_C32(0xc3810000), - SPH_C32(0x50f56600), SPH_C32(0xc8ae6787), SPH_C32(0x936dfaf2), - SPH_C32(0x65074f4a), SPH_C32(0xffee2568), SPH_C32(0x9d0b0000), - SPH_C32(0x9cfb0000), SPH_C32(0x25d10000), SPH_C32(0xe914f0a0), - SPH_C32(0x8ebb3dd7), SPH_C32(0x2863f85d), SPH_C32(0xa7b75eb1), - SPH_C32(0xf81b679c) }, - { SPH_C32(0x6e8d0000), SPH_C32(0x81e60000), SPH_C32(0x2e560000), - SPH_C32(0x62a86420), SPH_C32(0x2ba2510e), SPH_C32(0xc9271cb1), - SPH_C32(0x8672b7e2), SPH_C32(0x7e13dc60), SPH_C32(0x7b230000), - SPH_C32(0xd0b00000), SPH_C32(0x8d840000), SPH_C32(0x3ac4f240), - SPH_C32(0x56da0d6f), SPH_C32(0xb0c44887), SPH_C32(0x8f225805), - SPH_C32(0x2f412f0b) }, - { SPH_C32(0x88a50000), SPH_C32(0xcdad0000), SPH_C32(0x86030000), - SPH_C32(0xb17866c0), SPH_C32(0xf3c361b6), SPH_C32(0x5180ac6b), - SPH_C32(0xaee7b156), SPH_C32(0xa94994f7), SPH_C32(0x8be60000), - SPH_C32(0x89930000), SPH_C32(0xc8060000), SPH_C32(0xdb49f280), - SPH_C32(0x6db70b5e), SPH_C32(0x72291e1e), SPH_C32(0x44c2a619), - SPH_C32(0x79e69e94) }, - { SPH_C32(0xc97f0000), SPH_C32(0x12370000), SPH_C32(0x5d9a0000), - SPH_C32(0x43076060), SPH_C32(0x46d73c1d), SPH_C32(0x5769be24), - SPH_C32(0xec013671), SPH_C32(0x3d0d0c18), SPH_C32(0xd9ff0000), - SPH_C32(0xb2eb0000), SPH_C32(0xd10e0000), SPH_C32(0x7749f480), - SPH_C32(0xcd745ade), SPH_C32(0x3b986d99), SPH_C32(0xbe017424), - SPH_C32(0xe0d3a2dd) }, - { SPH_C32(0x2f570000), SPH_C32(0x5e7c0000), SPH_C32(0xf5cf0000), - SPH_C32(0x90d76280), SPH_C32(0x9eb60ca5), SPH_C32(0xcfce0efe), - SPH_C32(0xc49430c5), SPH_C32(0xea57448f), SPH_C32(0x293a0000), - SPH_C32(0xebc80000), SPH_C32(0x948c0000), SPH_C32(0x96c4f440), - SPH_C32(0xf6195cef), SPH_C32(0xf9753b00), SPH_C32(0x75e18a38), - SPH_C32(0xb6741342) }, - { SPH_C32(0x39ba0000), SPH_C32(0x4b140000), SPH_C32(0x18180000), - SPH_C32(0xa28a60a0), SPH_C32(0x7dba3a2c), SPH_C32(0x9584e8bd), - SPH_C32(0x27e1c86d), SPH_C32(0x6baabd87), SPH_C32(0xcf120000), - SPH_C32(0xa7830000), SPH_C32(0x3cd90000), SPH_C32(0x4514f6a0), - SPH_C32(0x2e786c57), SPH_C32(0x61d28bda), SPH_C32(0x5d748c8c), - SPH_C32(0x612e5bd5) }, - { SPH_C32(0xdf920000), SPH_C32(0x075f0000), SPH_C32(0xb04d0000), - SPH_C32(0x715a6240), SPH_C32(0xa5db0a94), SPH_C32(0x0d235867), - SPH_C32(0x0f74ced9), SPH_C32(0xbcf0f510), SPH_C32(0x3fd70000), - SPH_C32(0xfea00000), SPH_C32(0x795b0000), SPH_C32(0xa499f660), - SPH_C32(0x15156a66), SPH_C32(0xa33fdd43), SPH_C32(0x96947290), - SPH_C32(0x3789ea4a) }, - { SPH_C32(0x7d4e0000), SPH_C32(0x65040000), SPH_C32(0xecc70000), - SPH_C32(0x3cd76480), SPH_C32(0x3e755d25), SPH_C32(0x867f7d79), - SPH_C32(0x3e57e2f8), SPH_C32(0x736278c6), SPH_C32(0x3af90000), - SPH_C32(0x0f2a0000), SPH_C32(0x561d0000), SPH_C32(0xc8bbf4e0), - SPH_C32(0xe3ce50c4), SPH_C32(0xb62d5ac8), SPH_C32(0xcdc4df22), - SPH_C32(0xbb05b7e4) }, - { SPH_C32(0x9b660000), SPH_C32(0x294f0000), SPH_C32(0x44920000), - SPH_C32(0xef076660), SPH_C32(0xe6146d9d), SPH_C32(0x1ed8cda3), - SPH_C32(0x16c2e44c), SPH_C32(0xa4383051), SPH_C32(0xca3c0000), - SPH_C32(0x56090000), SPH_C32(0x139f0000), SPH_C32(0x2936f420), - SPH_C32(0xd8a356f5), SPH_C32(0x74c00c51), SPH_C32(0x0624213e), - SPH_C32(0xeda2067b) }, - { SPH_C32(0x8d8b0000), SPH_C32(0x3c270000), SPH_C32(0xa9450000), - SPH_C32(0xdd5a6440), SPH_C32(0x05185b14), SPH_C32(0x44922be0), - SPH_C32(0xf5b71ce4), SPH_C32(0x25c5c959), SPH_C32(0x2c140000), - SPH_C32(0x1a420000), SPH_C32(0xbbca0000), SPH_C32(0xfae6f6c0), - SPH_C32(0x00c2664d), SPH_C32(0xec67bc8b), SPH_C32(0x2eb1278a), - SPH_C32(0x3af84eec) }, - { SPH_C32(0x6ba30000), SPH_C32(0x706c0000), SPH_C32(0x01100000), - SPH_C32(0x0e8a66a0), SPH_C32(0xdd796bac), SPH_C32(0xdc359b3a), - SPH_C32(0xdd221a50), SPH_C32(0xf29f81ce), SPH_C32(0xdcd10000), - SPH_C32(0x43610000), SPH_C32(0xfe480000), SPH_C32(0x1b6bf600), - SPH_C32(0x3baf607c), SPH_C32(0x2e8aea12), SPH_C32(0xe551d996), - SPH_C32(0x6c5fff73) }, - { SPH_C32(0x8c3a0000), SPH_C32(0xda980000), SPH_C32(0x607f0000), - SPH_C32(0x54078800), SPH_C32(0x85714513), SPH_C32(0x6006b243), - SPH_C32(0xdb50399c), SPH_C32(0x8a58e6a4), SPH_C32(0x1e6c0000), - SPH_C32(0xc4420000), SPH_C32(0x8a2e0000), SPH_C32(0xbcb6b800), - SPH_C32(0x2c4413b6), SPH_C32(0x8bfdd3da), SPH_C32(0x6a0c1bc8), - SPH_C32(0xb99dc2eb) }, - { SPH_C32(0x6a120000), SPH_C32(0x96d30000), SPH_C32(0xc82a0000), - SPH_C32(0x87d78ae0), SPH_C32(0x5d1075ab), SPH_C32(0xf8a10299), - SPH_C32(0xf3c53f28), SPH_C32(0x5d02ae33), SPH_C32(0xeea90000), - SPH_C32(0x9d610000), SPH_C32(0xcfac0000), SPH_C32(0x5d3bb8c0), - SPH_C32(0x17291587), SPH_C32(0x49108543), SPH_C32(0xa1ece5d4), - SPH_C32(0xef3a7374) }, - { SPH_C32(0x7cff0000), SPH_C32(0x83bb0000), SPH_C32(0x25fd0000), - SPH_C32(0xb58a88c0), SPH_C32(0xbe1c4322), SPH_C32(0xa2ebe4da), - SPH_C32(0x10b0c780), SPH_C32(0xdcff573b), SPH_C32(0x08810000), - SPH_C32(0xd12a0000), SPH_C32(0x67f90000), SPH_C32(0x8eebba20), - SPH_C32(0xcf48253f), SPH_C32(0xd1b73599), SPH_C32(0x8979e360), - SPH_C32(0x38603be3) }, - { SPH_C32(0x9ad70000), SPH_C32(0xcff00000), SPH_C32(0x8da80000), - SPH_C32(0x665a8a20), SPH_C32(0x667d739a), SPH_C32(0x3a4c5400), - SPH_C32(0x3825c134), SPH_C32(0x0ba51fac), SPH_C32(0xf8440000), - SPH_C32(0x88090000), SPH_C32(0x227b0000), SPH_C32(0x6f66bae0), - SPH_C32(0xf425230e), SPH_C32(0x135a6300), SPH_C32(0x42991d7c), - SPH_C32(0x6ec78a7c) }, - { SPH_C32(0x380b0000), SPH_C32(0xadab0000), SPH_C32(0xd1220000), - SPH_C32(0x2bd78ce0), SPH_C32(0xfdd3242b), SPH_C32(0xb110711e), - SPH_C32(0x0906ed15), SPH_C32(0xc437927a), SPH_C32(0xfd6a0000), - SPH_C32(0x79830000), SPH_C32(0x0d3d0000), SPH_C32(0x0344b860), - SPH_C32(0x02fe19ac), SPH_C32(0x0648e48b), SPH_C32(0x19c9b0ce), - SPH_C32(0xe24bd7d2) }, - { SPH_C32(0xde230000), SPH_C32(0xe1e00000), SPH_C32(0x79770000), - SPH_C32(0xf8078e00), SPH_C32(0x25b21493), SPH_C32(0x29b7c1c4), - SPH_C32(0x2193eba1), SPH_C32(0x136ddaed), SPH_C32(0x0daf0000), - SPH_C32(0x20a00000), SPH_C32(0x48bf0000), SPH_C32(0xe2c9b8a0), - SPH_C32(0x39931f9d), SPH_C32(0xc4a5b212), SPH_C32(0xd2294ed2), - SPH_C32(0xb4ec664d) }, - { SPH_C32(0xc8ce0000), SPH_C32(0xf4880000), SPH_C32(0x94a00000), - SPH_C32(0xca5a8c20), SPH_C32(0xc6be221a), SPH_C32(0x73fd2787), - SPH_C32(0xc2e61309), SPH_C32(0x929023e5), SPH_C32(0xeb870000), - SPH_C32(0x6ceb0000), SPH_C32(0xe0ea0000), SPH_C32(0x3119ba40), - SPH_C32(0xe1f22f25), SPH_C32(0x5c0202c8), SPH_C32(0xfabc4866), - SPH_C32(0x63b62eda) }, - { SPH_C32(0x2ee60000), SPH_C32(0xb8c30000), SPH_C32(0x3cf50000), - SPH_C32(0x198a8ec0), SPH_C32(0x1edf12a2), SPH_C32(0xeb5a975d), - SPH_C32(0xea7315bd), SPH_C32(0x45ca6b72), SPH_C32(0x1b420000), - SPH_C32(0x35c80000), SPH_C32(0xa5680000), SPH_C32(0xd094ba80), - SPH_C32(0xda9f2914), SPH_C32(0x9eef5451), SPH_C32(0x315cb67a), - SPH_C32(0x35119f45) }, - { SPH_C32(0x6f3c0000), SPH_C32(0x67590000), SPH_C32(0xe76c0000), - SPH_C32(0xebf58860), SPH_C32(0xabcb4f09), SPH_C32(0xedb38512), - SPH_C32(0xa895929a), SPH_C32(0xd18ef39d), SPH_C32(0x495b0000), - SPH_C32(0x0eb00000), SPH_C32(0xbc600000), SPH_C32(0x7c94bc80), - SPH_C32(0x7a5c7894), SPH_C32(0xd75e27d6), SPH_C32(0xcb9f6447), - SPH_C32(0xac24a30c) }, - { SPH_C32(0x89140000), SPH_C32(0x2b120000), SPH_C32(0x4f390000), - SPH_C32(0x38258a80), SPH_C32(0x73aa7fb1), SPH_C32(0x751435c8), - SPH_C32(0x8000942e), SPH_C32(0x06d4bb0a), SPH_C32(0xb99e0000), - SPH_C32(0x57930000), SPH_C32(0xf9e20000), SPH_C32(0x9d19bc40), - SPH_C32(0x41317ea5), SPH_C32(0x15b3714f), SPH_C32(0x007f9a5b), - SPH_C32(0xfa831293) }, - { SPH_C32(0x9ff90000), SPH_C32(0x3e7a0000), SPH_C32(0xa2ee0000), - SPH_C32(0x0a7888a0), SPH_C32(0x90a64938), SPH_C32(0x2f5ed38b), - SPH_C32(0x63756c86), SPH_C32(0x87294202), SPH_C32(0x5fb60000), - SPH_C32(0x1bd80000), SPH_C32(0x51b70000), SPH_C32(0x4ec9bea0), - SPH_C32(0x99504e1d), SPH_C32(0x8d14c195), SPH_C32(0x28ea9cef), - SPH_C32(0x2dd95a04) }, - { SPH_C32(0x79d10000), SPH_C32(0x72310000), SPH_C32(0x0abb0000), - SPH_C32(0xd9a88a40), SPH_C32(0x48c77980), SPH_C32(0xb7f96351), - SPH_C32(0x4be06a32), SPH_C32(0x50730a95), SPH_C32(0xaf730000), - SPH_C32(0x42fb0000), SPH_C32(0x14350000), SPH_C32(0xaf44be60), - SPH_C32(0xa23d482c), SPH_C32(0x4ff9970c), SPH_C32(0xe30a62f3), - SPH_C32(0x7b7eeb9b) }, - { SPH_C32(0xdb0d0000), SPH_C32(0x106a0000), SPH_C32(0x56310000), - SPH_C32(0x94258c80), SPH_C32(0xd3692e31), SPH_C32(0x3ca5464f), - SPH_C32(0x7ac34613), SPH_C32(0x9fe18743), SPH_C32(0xaa5d0000), - SPH_C32(0xb3710000), SPH_C32(0x3b730000), SPH_C32(0xc366bce0), - SPH_C32(0x54e6728e), SPH_C32(0x5aeb1087), SPH_C32(0xb85acf41), - SPH_C32(0xf7f2b635) }, - { SPH_C32(0x3d250000), SPH_C32(0x5c210000), SPH_C32(0xfe640000), - SPH_C32(0x47f58e60), SPH_C32(0x0b081e89), SPH_C32(0xa402f695), - SPH_C32(0x525640a7), SPH_C32(0x48bbcfd4), SPH_C32(0x5a980000), - SPH_C32(0xea520000), SPH_C32(0x7ef10000), SPH_C32(0x22ebbc20), - SPH_C32(0x6f8b74bf), SPH_C32(0x9806461e), SPH_C32(0x73ba315d), - SPH_C32(0xa15507aa) }, - { SPH_C32(0x2bc80000), SPH_C32(0x49490000), SPH_C32(0x13b30000), - SPH_C32(0x75a88c40), SPH_C32(0xe8042800), SPH_C32(0xfe4810d6), - SPH_C32(0xb123b80f), SPH_C32(0xc94636dc), SPH_C32(0xbcb00000), - SPH_C32(0xa6190000), SPH_C32(0xd6a40000), SPH_C32(0xf13bbec0), - SPH_C32(0xb7ea4407), SPH_C32(0x00a1f6c4), SPH_C32(0x5b2f37e9), - SPH_C32(0x760f4f3d) }, - { SPH_C32(0xcde00000), SPH_C32(0x05020000), SPH_C32(0xbbe60000), - SPH_C32(0xa6788ea0), SPH_C32(0x306518b8), SPH_C32(0x66efa00c), - SPH_C32(0x99b6bebb), SPH_C32(0x1e1c7e4b), SPH_C32(0x4c750000), - SPH_C32(0xff3a0000), SPH_C32(0x93260000), SPH_C32(0x10b6be00), - SPH_C32(0x8c874236), SPH_C32(0xc24ca05d), SPH_C32(0x90cfc9f5), - SPH_C32(0x20a8fea2) }, - { SPH_C32(0x8ec80000), SPH_C32(0x78190000), SPH_C32(0xe7400000), - SPH_C32(0xb76bf000), SPH_C32(0x9b6c31fc), SPH_C32(0x673b9995), - SPH_C32(0x1f920bab), SPH_C32(0xf56ac33a), SPH_C32(0xa4b10000), - SPH_C32(0xd7ef0000), SPH_C32(0x3dc90000), SPH_C32(0x4b9e9000), - SPH_C32(0xf30107fb), SPH_C32(0xbde710e0), SPH_C32(0x805696dc), - SPH_C32(0x93b1da1b) }, - { SPH_C32(0x68e00000), SPH_C32(0x34520000), SPH_C32(0x4f150000), - SPH_C32(0x64bbf2e0), SPH_C32(0x430d0144), SPH_C32(0xff9c294f), - SPH_C32(0x37070d1f), SPH_C32(0x22308bad), SPH_C32(0x54740000), - SPH_C32(0x8ecc0000), SPH_C32(0x784b0000), SPH_C32(0xaa1390c0), - SPH_C32(0xc86c01ca), SPH_C32(0x7f0a4679), SPH_C32(0x4bb668c0), - SPH_C32(0xc5166b84) }, - { SPH_C32(0x7e0d0000), SPH_C32(0x213a0000), SPH_C32(0xa2c20000), - SPH_C32(0x56e6f0c0), SPH_C32(0xa00137cd), SPH_C32(0xa5d6cf0c), - SPH_C32(0xd472f5b7), SPH_C32(0xa3cd72a5), SPH_C32(0xb25c0000), - SPH_C32(0xc2870000), SPH_C32(0xd01e0000), SPH_C32(0x79c39220), - SPH_C32(0x100d3172), SPH_C32(0xe7adf6a3), SPH_C32(0x63236e74), - SPH_C32(0x124c2313) }, - { SPH_C32(0x98250000), SPH_C32(0x6d710000), SPH_C32(0x0a970000), - SPH_C32(0x8536f220), SPH_C32(0x78600775), SPH_C32(0x3d717fd6), - SPH_C32(0xfce7f303), SPH_C32(0x74973a32), SPH_C32(0x42990000), - SPH_C32(0x9ba40000), SPH_C32(0x959c0000), SPH_C32(0x984e92e0), - SPH_C32(0x2b603743), SPH_C32(0x2540a03a), SPH_C32(0xa8c39068), - SPH_C32(0x44eb928c) }, - { SPH_C32(0x3af90000), SPH_C32(0x0f2a0000), SPH_C32(0x561d0000), - SPH_C32(0xc8bbf4e0), SPH_C32(0xe3ce50c4), SPH_C32(0xb62d5ac8), - SPH_C32(0xcdc4df22), SPH_C32(0xbb05b7e4), SPH_C32(0x47b70000), - SPH_C32(0x6a2e0000), SPH_C32(0xbada0000), SPH_C32(0xf46c9060), - SPH_C32(0xddbb0de1), SPH_C32(0x305227b1), SPH_C32(0xf3933dda), - SPH_C32(0xc867cf22) }, - { SPH_C32(0xdcd10000), SPH_C32(0x43610000), SPH_C32(0xfe480000), - SPH_C32(0x1b6bf600), SPH_C32(0x3baf607c), SPH_C32(0x2e8aea12), - SPH_C32(0xe551d996), SPH_C32(0x6c5fff73), SPH_C32(0xb7720000), - SPH_C32(0x330d0000), SPH_C32(0xff580000), SPH_C32(0x15e190a0), - SPH_C32(0xe6d60bd0), SPH_C32(0xf2bf7128), SPH_C32(0x3873c3c6), - SPH_C32(0x9ec07ebd) }, - { SPH_C32(0xca3c0000), SPH_C32(0x56090000), SPH_C32(0x139f0000), - SPH_C32(0x2936f420), SPH_C32(0xd8a356f5), SPH_C32(0x74c00c51), - SPH_C32(0x0624213e), SPH_C32(0xeda2067b), SPH_C32(0x515a0000), - SPH_C32(0x7f460000), SPH_C32(0x570d0000), SPH_C32(0xc6319240), - SPH_C32(0x3eb73b68), SPH_C32(0x6a18c1f2), SPH_C32(0x10e6c572), - SPH_C32(0x499a362a) }, - { SPH_C32(0x2c140000), SPH_C32(0x1a420000), SPH_C32(0xbbca0000), - SPH_C32(0xfae6f6c0), SPH_C32(0x00c2664d), SPH_C32(0xec67bc8b), - SPH_C32(0x2eb1278a), SPH_C32(0x3af84eec), SPH_C32(0xa19f0000), - SPH_C32(0x26650000), SPH_C32(0x128f0000), SPH_C32(0x27bc9280), - SPH_C32(0x05da3d59), SPH_C32(0xa8f5976b), SPH_C32(0xdb063b6e), - SPH_C32(0x1f3d87b5) }, - { SPH_C32(0x6dce0000), SPH_C32(0xc5d80000), SPH_C32(0x60530000), - SPH_C32(0x0899f060), SPH_C32(0xb5d63be6), SPH_C32(0xea8eaec4), - SPH_C32(0x6c57a0ad), SPH_C32(0xaebcd603), SPH_C32(0xf3860000), - SPH_C32(0x1d1d0000), SPH_C32(0x0b870000), SPH_C32(0x8bbc9480), - SPH_C32(0xa5196cd9), SPH_C32(0xe144e4ec), SPH_C32(0x21c5e953), - SPH_C32(0x8608bbfc) }, - { SPH_C32(0x8be60000), SPH_C32(0x89930000), SPH_C32(0xc8060000), - SPH_C32(0xdb49f280), SPH_C32(0x6db70b5e), SPH_C32(0x72291e1e), - SPH_C32(0x44c2a619), SPH_C32(0x79e69e94), SPH_C32(0x03430000), - SPH_C32(0x443e0000), SPH_C32(0x4e050000), SPH_C32(0x6a319440), - SPH_C32(0x9e746ae8), SPH_C32(0x23a9b275), SPH_C32(0xea25174f), - SPH_C32(0xd0af0a63) }, - { SPH_C32(0x9d0b0000), SPH_C32(0x9cfb0000), SPH_C32(0x25d10000), - SPH_C32(0xe914f0a0), SPH_C32(0x8ebb3dd7), SPH_C32(0x2863f85d), - SPH_C32(0xa7b75eb1), SPH_C32(0xf81b679c), SPH_C32(0xe56b0000), - SPH_C32(0x08750000), SPH_C32(0xe6500000), SPH_C32(0xb9e196a0), - SPH_C32(0x46155a50), SPH_C32(0xbb0e02af), SPH_C32(0xc2b011fb), - SPH_C32(0x07f542f4) }, - { SPH_C32(0x7b230000), SPH_C32(0xd0b00000), SPH_C32(0x8d840000), - SPH_C32(0x3ac4f240), SPH_C32(0x56da0d6f), SPH_C32(0xb0c44887), - SPH_C32(0x8f225805), SPH_C32(0x2f412f0b), SPH_C32(0x15ae0000), - SPH_C32(0x51560000), SPH_C32(0xa3d20000), SPH_C32(0x586c9660), - SPH_C32(0x7d785c61), SPH_C32(0x79e35436), SPH_C32(0x0950efe7), - SPH_C32(0x5152f36b) }, - { SPH_C32(0xd9ff0000), SPH_C32(0xb2eb0000), SPH_C32(0xd10e0000), - SPH_C32(0x7749f480), SPH_C32(0xcd745ade), SPH_C32(0x3b986d99), - SPH_C32(0xbe017424), SPH_C32(0xe0d3a2dd), SPH_C32(0x10800000), - SPH_C32(0xa0dc0000), SPH_C32(0x8c940000), SPH_C32(0x344e94e0), - SPH_C32(0x8ba366c3), SPH_C32(0x6cf1d3bd), SPH_C32(0x52004255), - SPH_C32(0xdddeaec5) }, - { SPH_C32(0x3fd70000), SPH_C32(0xfea00000), SPH_C32(0x795b0000), - SPH_C32(0xa499f660), SPH_C32(0x15156a66), SPH_C32(0xa33fdd43), - SPH_C32(0x96947290), SPH_C32(0x3789ea4a), SPH_C32(0xe0450000), - SPH_C32(0xf9ff0000), SPH_C32(0xc9160000), SPH_C32(0xd5c39420), - SPH_C32(0xb0ce60f2), SPH_C32(0xae1c8524), SPH_C32(0x99e0bc49), - SPH_C32(0x8b791f5a) }, - { SPH_C32(0x293a0000), SPH_C32(0xebc80000), SPH_C32(0x948c0000), - SPH_C32(0x96c4f440), SPH_C32(0xf6195cef), SPH_C32(0xf9753b00), - SPH_C32(0x75e18a38), SPH_C32(0xb6741342), SPH_C32(0x066d0000), - SPH_C32(0xb5b40000), SPH_C32(0x61430000), SPH_C32(0x061396c0), - SPH_C32(0x68af504a), SPH_C32(0x36bb35fe), SPH_C32(0xb175bafd), - SPH_C32(0x5c2357cd) }, - { SPH_C32(0xcf120000), SPH_C32(0xa7830000), SPH_C32(0x3cd90000), - SPH_C32(0x4514f6a0), SPH_C32(0x2e786c57), SPH_C32(0x61d28bda), - SPH_C32(0x5d748c8c), SPH_C32(0x612e5bd5), SPH_C32(0xf6a80000), - SPH_C32(0xec970000), SPH_C32(0x24c10000), SPH_C32(0xe79e9600), - SPH_C32(0x53c2567b), SPH_C32(0xf4566367), SPH_C32(0x7a9544e1), - SPH_C32(0x0a84e652) }, - { SPH_C32(0x36e70000), SPH_C32(0xc9350000), SPH_C32(0xd7980000), - SPH_C32(0xa32fa000), SPH_C32(0x5a34515e), SPH_C32(0x561c7179), - SPH_C32(0x310ab488), SPH_C32(0xa074fe54), SPH_C32(0xa6430000), - SPH_C32(0x756e0000), SPH_C32(0xbaf60000), SPH_C32(0xa8f2e800), - SPH_C32(0xed1c7314), SPH_C32(0xbada3b36), SPH_C32(0x4494a4eb), - SPH_C32(0xec83ff85) }, - { SPH_C32(0xd0cf0000), SPH_C32(0x857e0000), SPH_C32(0x7fcd0000), - SPH_C32(0x70ffa2e0), SPH_C32(0x825561e6), SPH_C32(0xcebbc1a3), - SPH_C32(0x199fb23c), SPH_C32(0x772eb6c3), SPH_C32(0x56860000), - SPH_C32(0x2c4d0000), SPH_C32(0xff740000), SPH_C32(0x497fe8c0), - SPH_C32(0xd6717525), SPH_C32(0x78376daf), SPH_C32(0x8f745af7), - SPH_C32(0xba244e1a) }, - { SPH_C32(0xc6220000), SPH_C32(0x90160000), SPH_C32(0x921a0000), - SPH_C32(0x42a2a0c0), SPH_C32(0x6159576f), SPH_C32(0x94f127e0), - SPH_C32(0xfaea4a94), SPH_C32(0xf6d34fcb), SPH_C32(0xb0ae0000), - SPH_C32(0x60060000), SPH_C32(0x57210000), SPH_C32(0x9aafea20), - SPH_C32(0x0e10459d), SPH_C32(0xe090dd75), SPH_C32(0xa7e15c43), - SPH_C32(0x6d7e068d) }, - { SPH_C32(0x200a0000), SPH_C32(0xdc5d0000), SPH_C32(0x3a4f0000), - SPH_C32(0x9172a220), SPH_C32(0xb93867d7), SPH_C32(0x0c56973a), - SPH_C32(0xd27f4c20), SPH_C32(0x2189075c), SPH_C32(0x406b0000), - SPH_C32(0x39250000), SPH_C32(0x12a30000), SPH_C32(0x7b22eae0), - SPH_C32(0x357d43ac), SPH_C32(0x227d8bec), SPH_C32(0x6c01a25f), - SPH_C32(0x3bd9b712) }, - { SPH_C32(0x82d60000), SPH_C32(0xbe060000), SPH_C32(0x66c50000), - SPH_C32(0xdcffa4e0), SPH_C32(0x22963066), SPH_C32(0x870ab224), - SPH_C32(0xe35c6001), SPH_C32(0xee1b8a8a), SPH_C32(0x45450000), - SPH_C32(0xc8af0000), SPH_C32(0x3de50000), SPH_C32(0x1700e860), - SPH_C32(0xc3a6790e), SPH_C32(0x376f0c67), SPH_C32(0x37510fed), - SPH_C32(0xb755eabc) }, - { SPH_C32(0x64fe0000), SPH_C32(0xf24d0000), SPH_C32(0xce900000), - SPH_C32(0x0f2fa600), SPH_C32(0xfaf700de), SPH_C32(0x1fad02fe), - SPH_C32(0xcbc966b5), SPH_C32(0x3941c21d), SPH_C32(0xb5800000), - SPH_C32(0x918c0000), SPH_C32(0x78670000), SPH_C32(0xf68de8a0), - SPH_C32(0xf8cb7f3f), SPH_C32(0xf5825afe), SPH_C32(0xfcb1f1f1), - SPH_C32(0xe1f25b23) }, - { SPH_C32(0x72130000), SPH_C32(0xe7250000), SPH_C32(0x23470000), - SPH_C32(0x3d72a420), SPH_C32(0x19fb3657), SPH_C32(0x45e7e4bd), - SPH_C32(0x28bc9e1d), SPH_C32(0xb8bc3b15), SPH_C32(0x53a80000), - SPH_C32(0xddc70000), SPH_C32(0xd0320000), SPH_C32(0x255dea40), - SPH_C32(0x20aa4f87), SPH_C32(0x6d25ea24), SPH_C32(0xd424f745), - SPH_C32(0x36a813b4) }, - { SPH_C32(0x943b0000), SPH_C32(0xab6e0000), SPH_C32(0x8b120000), - SPH_C32(0xeea2a6c0), SPH_C32(0xc19a06ef), SPH_C32(0xdd405467), - SPH_C32(0x002998a9), SPH_C32(0x6fe67382), SPH_C32(0xa36d0000), - SPH_C32(0x84e40000), SPH_C32(0x95b00000), SPH_C32(0xc4d0ea80), - SPH_C32(0x1bc749b6), SPH_C32(0xafc8bcbd), SPH_C32(0x1fc40959), - SPH_C32(0x600fa22b) }, - { SPH_C32(0xd5e10000), SPH_C32(0x74f40000), SPH_C32(0x508b0000), - SPH_C32(0x1cdda060), SPH_C32(0x748e5b44), SPH_C32(0xdba94628), - SPH_C32(0x42cf1f8e), SPH_C32(0xfba2eb6d), SPH_C32(0xf1740000), - SPH_C32(0xbf9c0000), SPH_C32(0x8cb80000), SPH_C32(0x68d0ec80), - SPH_C32(0xbb041836), SPH_C32(0xe679cf3a), SPH_C32(0xe507db64), - SPH_C32(0xf93a9e62) }, - { SPH_C32(0x33c90000), SPH_C32(0x38bf0000), SPH_C32(0xf8de0000), - SPH_C32(0xcf0da280), SPH_C32(0xacef6bfc), SPH_C32(0x430ef6f2), - SPH_C32(0x6a5a193a), SPH_C32(0x2cf8a3fa), SPH_C32(0x01b10000), - SPH_C32(0xe6bf0000), SPH_C32(0xc93a0000), SPH_C32(0x895dec40), - SPH_C32(0x80691e07), SPH_C32(0x249499a3), SPH_C32(0x2ee72578), - SPH_C32(0xaf9d2ffd) }, - { SPH_C32(0x25240000), SPH_C32(0x2dd70000), SPH_C32(0x15090000), - SPH_C32(0xfd50a0a0), SPH_C32(0x4fe35d75), SPH_C32(0x194410b1), - SPH_C32(0x892fe192), SPH_C32(0xad055af2), SPH_C32(0xe7990000), - SPH_C32(0xaaf40000), SPH_C32(0x616f0000), SPH_C32(0x5a8deea0), - SPH_C32(0x58082ebf), SPH_C32(0xbc332979), SPH_C32(0x067223cc), - SPH_C32(0x78c7676a) }, - { SPH_C32(0xc30c0000), SPH_C32(0x619c0000), SPH_C32(0xbd5c0000), - SPH_C32(0x2e80a240), SPH_C32(0x97826dcd), SPH_C32(0x81e3a06b), - SPH_C32(0xa1bae726), SPH_C32(0x7a5f1265), SPH_C32(0x175c0000), - SPH_C32(0xf3d70000), SPH_C32(0x24ed0000), SPH_C32(0xbb00ee60), - SPH_C32(0x6365288e), SPH_C32(0x7ede7fe0), SPH_C32(0xcd92ddd0), - SPH_C32(0x2e60d6f5) }, - { SPH_C32(0x61d00000), SPH_C32(0x03c70000), SPH_C32(0xe1d60000), - SPH_C32(0x630da480), SPH_C32(0x0c2c3a7c), SPH_C32(0x0abf8575), - SPH_C32(0x9099cb07), SPH_C32(0xb5cd9fb3), SPH_C32(0x12720000), - SPH_C32(0x025d0000), SPH_C32(0x0bab0000), SPH_C32(0xd722ece0), - SPH_C32(0x95be122c), SPH_C32(0x6bccf86b), SPH_C32(0x96c27062), - SPH_C32(0xa2ec8b5b) }, - { SPH_C32(0x87f80000), SPH_C32(0x4f8c0000), SPH_C32(0x49830000), - SPH_C32(0xb0dda660), SPH_C32(0xd44d0ac4), SPH_C32(0x921835af), - SPH_C32(0xb80ccdb3), SPH_C32(0x6297d724), SPH_C32(0xe2b70000), - SPH_C32(0x5b7e0000), SPH_C32(0x4e290000), SPH_C32(0x36afec20), - SPH_C32(0xaed3141d), SPH_C32(0xa921aef2), SPH_C32(0x5d228e7e), - SPH_C32(0xf44b3ac4) }, - { SPH_C32(0x91150000), SPH_C32(0x5ae40000), SPH_C32(0xa4540000), - SPH_C32(0x8280a440), SPH_C32(0x37413c4d), SPH_C32(0xc852d3ec), - SPH_C32(0x5b79351b), SPH_C32(0xe36a2e2c), SPH_C32(0x049f0000), - SPH_C32(0x17350000), SPH_C32(0xe67c0000), SPH_C32(0xe57feec0), - SPH_C32(0x76b224a5), SPH_C32(0x31861e28), SPH_C32(0x75b788ca), - SPH_C32(0x23117253) }, - { SPH_C32(0x773d0000), SPH_C32(0x16af0000), SPH_C32(0x0c010000), - SPH_C32(0x5150a6a0), SPH_C32(0xef200cf5), SPH_C32(0x50f56336), - SPH_C32(0x73ec33af), SPH_C32(0x343066bb), SPH_C32(0xf45a0000), - SPH_C32(0x4e160000), SPH_C32(0xa3fe0000), SPH_C32(0x04f2ee00), - SPH_C32(0x4ddf2294), SPH_C32(0xf36b48b1), SPH_C32(0xbe5776d6), - SPH_C32(0x75b6c3cc) }, - { SPH_C32(0x34150000), SPH_C32(0x6bb40000), SPH_C32(0x50a70000), - SPH_C32(0x4043d800), SPH_C32(0x442925b1), SPH_C32(0x51215aaf), - SPH_C32(0xf5c886bf), SPH_C32(0xdf46dbca), SPH_C32(0x1c9e0000), - SPH_C32(0x66c30000), SPH_C32(0x0d110000), SPH_C32(0x5fdac000), - SPH_C32(0x32596759), SPH_C32(0x8cc0f80c), SPH_C32(0xaece29ff), - SPH_C32(0xc6afe775) }, - { SPH_C32(0xd23d0000), SPH_C32(0x27ff0000), SPH_C32(0xf8f20000), - SPH_C32(0x9393dae0), SPH_C32(0x9c481509), SPH_C32(0xc986ea75), - SPH_C32(0xdd5d800b), SPH_C32(0x081c935d), SPH_C32(0xec5b0000), - SPH_C32(0x3fe00000), SPH_C32(0x48930000), SPH_C32(0xbe57c0c0), - SPH_C32(0x09346168), SPH_C32(0x4e2dae95), SPH_C32(0x652ed7e3), - SPH_C32(0x900856ea) }, - { SPH_C32(0xc4d00000), SPH_C32(0x32970000), SPH_C32(0x15250000), - SPH_C32(0xa1ced8c0), SPH_C32(0x7f442380), SPH_C32(0x93cc0c36), - SPH_C32(0x3e2878a3), SPH_C32(0x89e16a55), SPH_C32(0x0a730000), - SPH_C32(0x73ab0000), SPH_C32(0xe0c60000), SPH_C32(0x6d87c220), - SPH_C32(0xd15551d0), SPH_C32(0xd68a1e4f), SPH_C32(0x4dbbd157), - SPH_C32(0x47521e7d) }, - { SPH_C32(0x22f80000), SPH_C32(0x7edc0000), SPH_C32(0xbd700000), - SPH_C32(0x721eda20), SPH_C32(0xa7251338), SPH_C32(0x0b6bbcec), - SPH_C32(0x16bd7e17), SPH_C32(0x5ebb22c2), SPH_C32(0xfab60000), - SPH_C32(0x2a880000), SPH_C32(0xa5440000), SPH_C32(0x8c0ac2e0), - SPH_C32(0xea3857e1), SPH_C32(0x146748d6), SPH_C32(0x865b2f4b), - SPH_C32(0x11f5afe2) }, - { SPH_C32(0x80240000), SPH_C32(0x1c870000), SPH_C32(0xe1fa0000), - SPH_C32(0x3f93dce0), SPH_C32(0x3c8b4489), SPH_C32(0x803799f2), - SPH_C32(0x279e5236), SPH_C32(0x9129af14), SPH_C32(0xff980000), - SPH_C32(0xdb020000), SPH_C32(0x8a020000), SPH_C32(0xe028c060), - SPH_C32(0x1ce36d43), SPH_C32(0x0175cf5d), SPH_C32(0xdd0b82f9), - SPH_C32(0x9d79f24c) }, - { SPH_C32(0x660c0000), SPH_C32(0x50cc0000), SPH_C32(0x49af0000), - SPH_C32(0xec43de00), SPH_C32(0xe4ea7431), SPH_C32(0x18902928), - SPH_C32(0x0f0b5482), SPH_C32(0x4673e783), SPH_C32(0x0f5d0000), - SPH_C32(0x82210000), SPH_C32(0xcf800000), SPH_C32(0x01a5c0a0), - SPH_C32(0x278e6b72), SPH_C32(0xc39899c4), SPH_C32(0x16eb7ce5), - SPH_C32(0xcbde43d3) }, - { SPH_C32(0x70e10000), SPH_C32(0x45a40000), SPH_C32(0xa4780000), - SPH_C32(0xde1edc20), SPH_C32(0x07e642b8), SPH_C32(0x42dacf6b), - SPH_C32(0xec7eac2a), SPH_C32(0xc78e1e8b), SPH_C32(0xe9750000), - SPH_C32(0xce6a0000), SPH_C32(0x67d50000), SPH_C32(0xd275c240), - SPH_C32(0xffef5bca), SPH_C32(0x5b3f291e), SPH_C32(0x3e7e7a51), - SPH_C32(0x1c840b44) }, - { SPH_C32(0x96c90000), SPH_C32(0x09ef0000), SPH_C32(0x0c2d0000), - SPH_C32(0x0dcedec0), SPH_C32(0xdf877200), SPH_C32(0xda7d7fb1), - SPH_C32(0xc4ebaa9e), SPH_C32(0x10d4561c), SPH_C32(0x19b00000), - SPH_C32(0x97490000), SPH_C32(0x22570000), SPH_C32(0x33f8c280), - SPH_C32(0xc4825dfb), SPH_C32(0x99d27f87), SPH_C32(0xf59e844d), - SPH_C32(0x4a23badb) }, - { SPH_C32(0xd7130000), SPH_C32(0xd6750000), SPH_C32(0xd7b40000), - SPH_C32(0xffb1d860), SPH_C32(0x6a932fab), SPH_C32(0xdc946dfe), - SPH_C32(0x860d2db9), SPH_C32(0x8490cef3), SPH_C32(0x4ba90000), - SPH_C32(0xac310000), SPH_C32(0x3b5f0000), SPH_C32(0x9ff8c480), - SPH_C32(0x64410c7b), SPH_C32(0xd0630c00), SPH_C32(0x0f5d5670), - SPH_C32(0xd3168692) }, - { SPH_C32(0x313b0000), SPH_C32(0x9a3e0000), SPH_C32(0x7fe10000), - SPH_C32(0x2c61da80), SPH_C32(0xb2f21f13), SPH_C32(0x4433dd24), - SPH_C32(0xae982b0d), SPH_C32(0x53ca8664), SPH_C32(0xbb6c0000), - SPH_C32(0xf5120000), SPH_C32(0x7edd0000), SPH_C32(0x7e75c440), - SPH_C32(0x5f2c0a4a), SPH_C32(0x128e5a99), SPH_C32(0xc4bda86c), - SPH_C32(0x85b1370d) }, - { SPH_C32(0x27d60000), SPH_C32(0x8f560000), SPH_C32(0x92360000), - SPH_C32(0x1e3cd8a0), SPH_C32(0x51fe299a), SPH_C32(0x1e793b67), - SPH_C32(0x4dedd3a5), SPH_C32(0xd2377f6c), SPH_C32(0x5d440000), - SPH_C32(0xb9590000), SPH_C32(0xd6880000), SPH_C32(0xada5c6a0), - SPH_C32(0x874d3af2), SPH_C32(0x8a29ea43), SPH_C32(0xec28aed8), - SPH_C32(0x52eb7f9a) }, - { SPH_C32(0xc1fe0000), SPH_C32(0xc31d0000), SPH_C32(0x3a630000), - SPH_C32(0xcdecda40), SPH_C32(0x899f1922), SPH_C32(0x86de8bbd), - SPH_C32(0x6578d511), SPH_C32(0x056d37fb), SPH_C32(0xad810000), - SPH_C32(0xe07a0000), SPH_C32(0x930a0000), SPH_C32(0x4c28c660), - SPH_C32(0xbc203cc3), SPH_C32(0x48c4bcda), SPH_C32(0x27c850c4), - SPH_C32(0x044cce05) }, - { SPH_C32(0x63220000), SPH_C32(0xa1460000), SPH_C32(0x66e90000), - SPH_C32(0x8061dc80), SPH_C32(0x12314e93), SPH_C32(0x0d82aea3), - SPH_C32(0x545bf930), SPH_C32(0xcaffba2d), SPH_C32(0xa8af0000), - SPH_C32(0x11f00000), SPH_C32(0xbc4c0000), SPH_C32(0x200ac4e0), - SPH_C32(0x4afb0661), SPH_C32(0x5dd63b51), SPH_C32(0x7c98fd76), - SPH_C32(0x88c093ab) }, - { SPH_C32(0x850a0000), SPH_C32(0xed0d0000), SPH_C32(0xcebc0000), - SPH_C32(0x53b1de60), SPH_C32(0xca507e2b), SPH_C32(0x95251e79), - SPH_C32(0x7cceff84), SPH_C32(0x1da5f2ba), SPH_C32(0x586a0000), - SPH_C32(0x48d30000), SPH_C32(0xf9ce0000), SPH_C32(0xc187c420), - SPH_C32(0x71960050), SPH_C32(0x9f3b6dc8), SPH_C32(0xb778036a), - SPH_C32(0xde672234) }, - { SPH_C32(0x93e70000), SPH_C32(0xf8650000), SPH_C32(0x236b0000), - SPH_C32(0x61ecdc40), SPH_C32(0x295c48a2), SPH_C32(0xcf6ff83a), - SPH_C32(0x9fbb072c), SPH_C32(0x9c580bb2), SPH_C32(0xbe420000), - SPH_C32(0x04980000), SPH_C32(0x519b0000), SPH_C32(0x1257c6c0), - SPH_C32(0xa9f730e8), SPH_C32(0x079cdd12), SPH_C32(0x9fed05de), - SPH_C32(0x093d6aa3) }, - { SPH_C32(0x75cf0000), SPH_C32(0xb42e0000), SPH_C32(0x8b3e0000), - SPH_C32(0xb23cdea0), SPH_C32(0xf13d781a), SPH_C32(0x57c848e0), - SPH_C32(0xb72e0198), SPH_C32(0x4b024325), SPH_C32(0x4e870000), - SPH_C32(0x5dbb0000), SPH_C32(0x14190000), SPH_C32(0xf3dac600), - SPH_C32(0x929a36d9), SPH_C32(0xc5718b8b), SPH_C32(0x540dfbc2), - SPH_C32(0x5f9adb3c) } -}; - -static const sph_u32 T512_56[256][16] = { - { SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000), SPH_C32(0x00000000), SPH_C32(0x00000000), - SPH_C32(0x00000000) }, - { SPH_C32(0x033d0000), SPH_C32(0x08b30000), SPH_C32(0xf33a0000), - SPH_C32(0x3ac20007), SPH_C32(0x51298a50), SPH_C32(0x6b6e661f), - SPH_C32(0x0ea5cfe3), SPH_C32(0xe6da7ffe), SPH_C32(0xa8da0000), - SPH_C32(0x96be0000), SPH_C32(0x5c1d0000), SPH_C32(0x07da0002), - SPH_C32(0x7d669583), SPH_C32(0x1f98708a), SPH_C32(0xbb668808), - SPH_C32(0xda878000) }, - { SPH_C32(0xa8da0000), SPH_C32(0x96be0000), SPH_C32(0x5c1d0000), - SPH_C32(0x07da0002), SPH_C32(0x7d669583), SPH_C32(0x1f98708a), - SPH_C32(0xbb668808), SPH_C32(0xda878000), SPH_C32(0xabe70000), - SPH_C32(0x9e0d0000), SPH_C32(0xaf270000), SPH_C32(0x3d180005), - SPH_C32(0x2c4f1fd3), SPH_C32(0x74f61695), SPH_C32(0xb5c347eb), - SPH_C32(0x3c5dfffe) }, - { SPH_C32(0xabe70000), SPH_C32(0x9e0d0000), SPH_C32(0xaf270000), - SPH_C32(0x3d180005), SPH_C32(0x2c4f1fd3), SPH_C32(0x74f61695), - SPH_C32(0xb5c347eb), SPH_C32(0x3c5dfffe), SPH_C32(0x033d0000), - SPH_C32(0x08b30000), SPH_C32(0xf33a0000), SPH_C32(0x3ac20007), - SPH_C32(0x51298a50), SPH_C32(0x6b6e661f), SPH_C32(0x0ea5cfe3), - SPH_C32(0xe6da7ffe) }, - { SPH_C32(0x01930000), SPH_C32(0xe7820000), SPH_C32(0xedfb0000), - SPH_C32(0xcf0c000b), SPH_C32(0x8dd08d58), SPH_C32(0xbca3b42e), - SPH_C32(0x063661e1), SPH_C32(0x536f9e7b), SPH_C32(0x92280000), - SPH_C32(0xdc850000), SPH_C32(0x57fa0000), SPH_C32(0x56dc0003), - SPH_C32(0xbae92316), SPH_C32(0x5aefa30c), SPH_C32(0x90cef752), - SPH_C32(0x7b1675d7) }, - { SPH_C32(0x02ae0000), SPH_C32(0xef310000), SPH_C32(0x1ec10000), - SPH_C32(0xf5ce000c), SPH_C32(0xdcf90708), SPH_C32(0xd7cdd231), - SPH_C32(0x0893ae02), SPH_C32(0xb5b5e185), SPH_C32(0x3af20000), - SPH_C32(0x4a3b0000), SPH_C32(0x0be70000), SPH_C32(0x51060001), - SPH_C32(0xc78fb695), SPH_C32(0x4577d386), SPH_C32(0x2ba87f5a), - SPH_C32(0xa191f5d7) }, - { SPH_C32(0xa9490000), SPH_C32(0x713c0000), SPH_C32(0xb1e60000), - SPH_C32(0xc8d60009), SPH_C32(0xf0b618db), SPH_C32(0xa33bc4a4), - SPH_C32(0xbd50e9e9), SPH_C32(0x89e81e7b), SPH_C32(0x39cf0000), - SPH_C32(0x42880000), SPH_C32(0xf8dd0000), SPH_C32(0x6bc40006), - SPH_C32(0x96a63cc5), SPH_C32(0x2e19b599), SPH_C32(0x250db0b9), - SPH_C32(0x474b8a29) }, - { SPH_C32(0xaa740000), SPH_C32(0x798f0000), SPH_C32(0x42dc0000), - SPH_C32(0xf214000e), SPH_C32(0xa19f928b), SPH_C32(0xc855a2bb), - SPH_C32(0xb3f5260a), SPH_C32(0x6f326185), SPH_C32(0x91150000), - SPH_C32(0xd4360000), SPH_C32(0xa4c00000), SPH_C32(0x6c1e0004), - SPH_C32(0xebc0a946), SPH_C32(0x3181c513), SPH_C32(0x9e6b38b1), - SPH_C32(0x9dcc0a29) }, - { SPH_C32(0x92280000), SPH_C32(0xdc850000), SPH_C32(0x57fa0000), - SPH_C32(0x56dc0003), SPH_C32(0xbae92316), SPH_C32(0x5aefa30c), - SPH_C32(0x90cef752), SPH_C32(0x7b1675d7), SPH_C32(0x93bb0000), - SPH_C32(0x3b070000), SPH_C32(0xba010000), SPH_C32(0x99d00008), - SPH_C32(0x3739ae4e), SPH_C32(0xe64c1722), SPH_C32(0x96f896b3), - SPH_C32(0x2879ebac) }, - { SPH_C32(0x91150000), SPH_C32(0xd4360000), SPH_C32(0xa4c00000), - SPH_C32(0x6c1e0004), SPH_C32(0xebc0a946), SPH_C32(0x3181c513), - SPH_C32(0x9e6b38b1), SPH_C32(0x9dcc0a29), SPH_C32(0x3b610000), - SPH_C32(0xadb90000), SPH_C32(0xe61c0000), SPH_C32(0x9e0a000a), - SPH_C32(0x4a5f3bcd), SPH_C32(0xf9d467a8), SPH_C32(0x2d9e1ebb), - SPH_C32(0xf2fe6bac) }, - { SPH_C32(0x3af20000), SPH_C32(0x4a3b0000), SPH_C32(0x0be70000), - SPH_C32(0x51060001), SPH_C32(0xc78fb695), SPH_C32(0x4577d386), - SPH_C32(0x2ba87f5a), SPH_C32(0xa191f5d7), SPH_C32(0x385c0000), - SPH_C32(0xa50a0000), SPH_C32(0x15260000), SPH_C32(0xa4c8000d), - SPH_C32(0x1b76b19d), SPH_C32(0x92ba01b7), SPH_C32(0x233bd158), - SPH_C32(0x14241452) }, - { SPH_C32(0x39cf0000), SPH_C32(0x42880000), SPH_C32(0xf8dd0000), - SPH_C32(0x6bc40006), SPH_C32(0x96a63cc5), SPH_C32(0x2e19b599), - SPH_C32(0x250db0b9), SPH_C32(0x474b8a29), SPH_C32(0x90860000), - SPH_C32(0x33b40000), SPH_C32(0x493b0000), SPH_C32(0xa312000f), - SPH_C32(0x6610241e), SPH_C32(0x8d22713d), SPH_C32(0x985d5950), - SPH_C32(0xcea39452) }, - { SPH_C32(0x93bb0000), SPH_C32(0x3b070000), SPH_C32(0xba010000), - SPH_C32(0x99d00008), SPH_C32(0x3739ae4e), SPH_C32(0xe64c1722), - SPH_C32(0x96f896b3), SPH_C32(0x2879ebac), SPH_C32(0x01930000), - SPH_C32(0xe7820000), SPH_C32(0xedfb0000), SPH_C32(0xcf0c000b), - SPH_C32(0x8dd08d58), SPH_C32(0xbca3b42e), SPH_C32(0x063661e1), - SPH_C32(0x536f9e7b) }, - { SPH_C32(0x90860000), SPH_C32(0x33b40000), SPH_C32(0x493b0000), - SPH_C32(0xa312000f), SPH_C32(0x6610241e), SPH_C32(0x8d22713d), - SPH_C32(0x985d5950), SPH_C32(0xcea39452), SPH_C32(0xa9490000), - SPH_C32(0x713c0000), SPH_C32(0xb1e60000), SPH_C32(0xc8d60009), - SPH_C32(0xf0b618db), SPH_C32(0xa33bc4a4), SPH_C32(0xbd50e9e9), - SPH_C32(0x89e81e7b) }, - { SPH_C32(0x3b610000), SPH_C32(0xadb90000), SPH_C32(0xe61c0000), - SPH_C32(0x9e0a000a), SPH_C32(0x4a5f3bcd), SPH_C32(0xf9d467a8), - SPH_C32(0x2d9e1ebb), SPH_C32(0xf2fe6bac), SPH_C32(0xaa740000), - SPH_C32(0x798f0000), SPH_C32(0x42dc0000), SPH_C32(0xf214000e), - SPH_C32(0xa19f928b), SPH_C32(0xc855a2bb), SPH_C32(0xb3f5260a), - SPH_C32(0x6f326185) }, - { SPH_C32(0x385c0000), SPH_C32(0xa50a0000), SPH_C32(0x15260000), - SPH_C32(0xa4c8000d), SPH_C32(0x1b76b19d), SPH_C32(0x92ba01b7), - SPH_C32(0x233bd158), SPH_C32(0x14241452), SPH_C32(0x02ae0000), - SPH_C32(0xef310000), SPH_C32(0x1ec10000), SPH_C32(0xf5ce000c), - SPH_C32(0xdcf90708), SPH_C32(0xd7cdd231), SPH_C32(0x0893ae02), - SPH_C32(0xb5b5e185) }, - { SPH_C32(0x5fa80000), SPH_C32(0x56030000), SPH_C32(0x43ae0000), - SPH_C32(0x64f30013), SPH_C32(0x257e86bf), SPH_C32(0x1311944e), - SPH_C32(0x541e95bf), SPH_C32(0x8ea4db69), SPH_C32(0x00440000), - SPH_C32(0x7f480000), SPH_C32(0xda7c0000), SPH_C32(0x2a230001), - SPH_C32(0x3badc9cc), SPH_C32(0xa9b69c87), SPH_C32(0x030a9e60), - SPH_C32(0xbe0a679e) }, - { SPH_C32(0x5c950000), SPH_C32(0x5eb00000), SPH_C32(0xb0940000), - SPH_C32(0x5e310014), SPH_C32(0x74570cef), SPH_C32(0x787ff251), - SPH_C32(0x5abb5a5c), SPH_C32(0x687ea497), SPH_C32(0xa89e0000), - SPH_C32(0xe9f60000), SPH_C32(0x86610000), SPH_C32(0x2df90003), - SPH_C32(0x46cb5c4f), SPH_C32(0xb62eec0d), SPH_C32(0xb86c1668), - SPH_C32(0x648de79e) }, - { SPH_C32(0xf7720000), SPH_C32(0xc0bd0000), SPH_C32(0x1fb30000), - SPH_C32(0x63290011), SPH_C32(0x5818133c), SPH_C32(0x0c89e4c4), - SPH_C32(0xef781db7), SPH_C32(0x54235b69), SPH_C32(0xaba30000), - SPH_C32(0xe1450000), SPH_C32(0x755b0000), SPH_C32(0x173b0004), - SPH_C32(0x17e2d61f), SPH_C32(0xdd408a12), SPH_C32(0xb6c9d98b), - SPH_C32(0x82579860) }, - { SPH_C32(0xf44f0000), SPH_C32(0xc80e0000), SPH_C32(0xec890000), - SPH_C32(0x59eb0016), SPH_C32(0x0931996c), SPH_C32(0x67e782db), - SPH_C32(0xe1ddd254), SPH_C32(0xb2f92497), SPH_C32(0x03790000), - SPH_C32(0x77fb0000), SPH_C32(0x29460000), SPH_C32(0x10e10006), - SPH_C32(0x6a84439c), SPH_C32(0xc2d8fa98), SPH_C32(0x0daf5183), - SPH_C32(0x58d01860) }, - { SPH_C32(0x5e3b0000), SPH_C32(0xb1810000), SPH_C32(0xae550000), - SPH_C32(0xabff0018), SPH_C32(0xa8ae0be7), SPH_C32(0xafb22060), - SPH_C32(0x5228f45e), SPH_C32(0xddcb4512), SPH_C32(0x926c0000), - SPH_C32(0xa3cd0000), SPH_C32(0x8d860000), SPH_C32(0x7cff0002), - SPH_C32(0x8144eada), SPH_C32(0xf3593f8b), SPH_C32(0x93c46932), - SPH_C32(0xc51c1249) }, - { SPH_C32(0x5d060000), SPH_C32(0xb9320000), SPH_C32(0x5d6f0000), - SPH_C32(0x913d001f), SPH_C32(0xf98781b7), SPH_C32(0xc4dc467f), - SPH_C32(0x5c8d3bbd), SPH_C32(0x3b113aec), SPH_C32(0x3ab60000), - SPH_C32(0x35730000), SPH_C32(0xd19b0000), SPH_C32(0x7b250000), - SPH_C32(0xfc227f59), SPH_C32(0xecc14f01), SPH_C32(0x28a2e13a), - SPH_C32(0x1f9b9249) }, - { SPH_C32(0xf6e10000), SPH_C32(0x273f0000), SPH_C32(0xf2480000), - SPH_C32(0xac25001a), SPH_C32(0xd5c89e64), SPH_C32(0xb02a50ea), - SPH_C32(0xe94e7c56), SPH_C32(0x074cc512), SPH_C32(0x398b0000), - SPH_C32(0x3dc00000), SPH_C32(0x22a10000), SPH_C32(0x41e70007), - SPH_C32(0xad0bf509), SPH_C32(0x87af291e), SPH_C32(0x26072ed9), - SPH_C32(0xf941edb7) }, - { SPH_C32(0xf5dc0000), SPH_C32(0x2f8c0000), SPH_C32(0x01720000), - SPH_C32(0x96e7001d), SPH_C32(0x84e11434), SPH_C32(0xdb4436f5), - SPH_C32(0xe7ebb3b5), SPH_C32(0xe196baec), SPH_C32(0x91510000), - SPH_C32(0xab7e0000), SPH_C32(0x7ebc0000), SPH_C32(0x463d0005), - SPH_C32(0xd06d608a), SPH_C32(0x98375994), SPH_C32(0x9d61a6d1), - SPH_C32(0x23c66db7) }, - { SPH_C32(0xcd800000), SPH_C32(0x8a860000), SPH_C32(0x14540000), - SPH_C32(0x322f0010), SPH_C32(0x9f97a5a9), SPH_C32(0x49fe3742), - SPH_C32(0xc4d062ed), SPH_C32(0xf5b2aebe), SPH_C32(0x93ff0000), - SPH_C32(0x444f0000), SPH_C32(0x607d0000), SPH_C32(0xb3f30009), - SPH_C32(0x0c946782), SPH_C32(0x4ffa8ba5), SPH_C32(0x95f208d3), - SPH_C32(0x96738c32) }, - { SPH_C32(0xcebd0000), SPH_C32(0x82350000), SPH_C32(0xe76e0000), - SPH_C32(0x08ed0017), SPH_C32(0xcebe2ff9), SPH_C32(0x2290515d), - SPH_C32(0xca75ad0e), SPH_C32(0x1368d140), SPH_C32(0x3b250000), - SPH_C32(0xd2f10000), SPH_C32(0x3c600000), SPH_C32(0xb429000b), - SPH_C32(0x71f2f201), SPH_C32(0x5062fb2f), SPH_C32(0x2e9480db), - SPH_C32(0x4cf40c32) }, - { SPH_C32(0x655a0000), SPH_C32(0x1c380000), SPH_C32(0x48490000), - SPH_C32(0x35f50012), SPH_C32(0xe2f1302a), SPH_C32(0x566647c8), - SPH_C32(0x7fb6eae5), SPH_C32(0x2f352ebe), SPH_C32(0x38180000), - SPH_C32(0xda420000), SPH_C32(0xcf5a0000), SPH_C32(0x8eeb000c), - SPH_C32(0x20db7851), SPH_C32(0x3b0c9d30), SPH_C32(0x20314f38), - SPH_C32(0xaa2e73cc) }, - { SPH_C32(0x66670000), SPH_C32(0x148b0000), SPH_C32(0xbb730000), - SPH_C32(0x0f370015), SPH_C32(0xb3d8ba7a), SPH_C32(0x3d0821d7), - SPH_C32(0x71132506), SPH_C32(0xc9ef5140), SPH_C32(0x90c20000), - SPH_C32(0x4cfc0000), SPH_C32(0x93470000), SPH_C32(0x8931000e), - SPH_C32(0x5dbdedd2), SPH_C32(0x2494edba), SPH_C32(0x9b57c730), - SPH_C32(0x70a9f3cc) }, - { SPH_C32(0xcc130000), SPH_C32(0x6d040000), SPH_C32(0xf9af0000), - SPH_C32(0xfd23001b), SPH_C32(0x124728f1), SPH_C32(0xf55d836c), - SPH_C32(0xc2e6030c), SPH_C32(0xa6dd30c5), SPH_C32(0x01d70000), - SPH_C32(0x98ca0000), SPH_C32(0x37870000), SPH_C32(0xe52f000a), - SPH_C32(0xb67d4494), SPH_C32(0x151528a9), SPH_C32(0x053cff81), - SPH_C32(0xed65f9e5) }, - { SPH_C32(0xcf2e0000), SPH_C32(0x65b70000), SPH_C32(0x0a950000), - SPH_C32(0xc7e1001c), SPH_C32(0x436ea2a1), SPH_C32(0x9e33e573), - SPH_C32(0xcc43ccef), SPH_C32(0x40074f3b), SPH_C32(0xa90d0000), - SPH_C32(0x0e740000), SPH_C32(0x6b9a0000), SPH_C32(0xe2f50008), - SPH_C32(0xcb1bd117), SPH_C32(0x0a8d5823), SPH_C32(0xbe5a7789), - SPH_C32(0x37e279e5) }, - { SPH_C32(0x64c90000), SPH_C32(0xfbba0000), SPH_C32(0xa5b20000), - SPH_C32(0xfaf90019), SPH_C32(0x6f21bd72), SPH_C32(0xeac5f3e6), - SPH_C32(0x79808b04), SPH_C32(0x7c5ab0c5), SPH_C32(0xaa300000), - SPH_C32(0x06c70000), SPH_C32(0x98a00000), SPH_C32(0xd837000f), - SPH_C32(0x9a325b47), SPH_C32(0x61e33e3c), SPH_C32(0xb0ffb86a), - SPH_C32(0xd138061b) }, - { SPH_C32(0x67f40000), SPH_C32(0xf3090000), SPH_C32(0x56880000), - SPH_C32(0xc03b001e), SPH_C32(0x3e083722), SPH_C32(0x81ab95f9), - SPH_C32(0x772544e7), SPH_C32(0x9a80cf3b), SPH_C32(0x02ea0000), - SPH_C32(0x90790000), SPH_C32(0xc4bd0000), SPH_C32(0xdfed000d), - SPH_C32(0xe754cec4), SPH_C32(0x7e7b4eb6), SPH_C32(0x0b993062), - SPH_C32(0x0bbf861b) }, - { SPH_C32(0x00440000), SPH_C32(0x7f480000), SPH_C32(0xda7c0000), - SPH_C32(0x2a230001), SPH_C32(0x3badc9cc), SPH_C32(0xa9b69c87), - SPH_C32(0x030a9e60), SPH_C32(0xbe0a679e), SPH_C32(0x5fec0000), - SPH_C32(0x294b0000), SPH_C32(0x99d20000), SPH_C32(0x4ed00012), - SPH_C32(0x1ed34f73), SPH_C32(0xbaa708c9), SPH_C32(0x57140bdf), - SPH_C32(0x30aebcf7) }, - { SPH_C32(0x03790000), SPH_C32(0x77fb0000), SPH_C32(0x29460000), - SPH_C32(0x10e10006), SPH_C32(0x6a84439c), SPH_C32(0xc2d8fa98), - SPH_C32(0x0daf5183), SPH_C32(0x58d01860), SPH_C32(0xf7360000), - SPH_C32(0xbff50000), SPH_C32(0xc5cf0000), SPH_C32(0x490a0010), - SPH_C32(0x63b5daf0), SPH_C32(0xa53f7843), SPH_C32(0xec7283d7), - SPH_C32(0xea293cf7) }, - { SPH_C32(0xa89e0000), SPH_C32(0xe9f60000), SPH_C32(0x86610000), - SPH_C32(0x2df90003), SPH_C32(0x46cb5c4f), SPH_C32(0xb62eec0d), - SPH_C32(0xb86c1668), SPH_C32(0x648de79e), SPH_C32(0xf40b0000), - SPH_C32(0xb7460000), SPH_C32(0x36f50000), SPH_C32(0x73c80017), - SPH_C32(0x329c50a0), SPH_C32(0xce511e5c), SPH_C32(0xe2d74c34), - SPH_C32(0x0cf34309) }, - { SPH_C32(0xaba30000), SPH_C32(0xe1450000), SPH_C32(0x755b0000), - SPH_C32(0x173b0004), SPH_C32(0x17e2d61f), SPH_C32(0xdd408a12), - SPH_C32(0xb6c9d98b), SPH_C32(0x82579860), SPH_C32(0x5cd10000), - SPH_C32(0x21f80000), SPH_C32(0x6ae80000), SPH_C32(0x74120015), - SPH_C32(0x4ffac523), SPH_C32(0xd1c96ed6), SPH_C32(0x59b1c43c), - SPH_C32(0xd674c309) }, - { SPH_C32(0x01d70000), SPH_C32(0x98ca0000), SPH_C32(0x37870000), - SPH_C32(0xe52f000a), SPH_C32(0xb67d4494), SPH_C32(0x151528a9), - SPH_C32(0x053cff81), SPH_C32(0xed65f9e5), SPH_C32(0xcdc40000), - SPH_C32(0xf5ce0000), SPH_C32(0xce280000), SPH_C32(0x180c0011), - SPH_C32(0xa43a6c65), SPH_C32(0xe048abc5), SPH_C32(0xc7dafc8d), - SPH_C32(0x4bb8c920) }, - { SPH_C32(0x02ea0000), SPH_C32(0x90790000), SPH_C32(0xc4bd0000), - SPH_C32(0xdfed000d), SPH_C32(0xe754cec4), SPH_C32(0x7e7b4eb6), - SPH_C32(0x0b993062), SPH_C32(0x0bbf861b), SPH_C32(0x651e0000), - SPH_C32(0x63700000), SPH_C32(0x92350000), SPH_C32(0x1fd60013), - SPH_C32(0xd95cf9e6), SPH_C32(0xffd0db4f), SPH_C32(0x7cbc7485), - SPH_C32(0x913f4920) }, - { SPH_C32(0xa90d0000), SPH_C32(0x0e740000), SPH_C32(0x6b9a0000), - SPH_C32(0xe2f50008), SPH_C32(0xcb1bd117), SPH_C32(0x0a8d5823), - SPH_C32(0xbe5a7789), SPH_C32(0x37e279e5), SPH_C32(0x66230000), - SPH_C32(0x6bc30000), SPH_C32(0x610f0000), SPH_C32(0x25140014), - SPH_C32(0x887573b6), SPH_C32(0x94bebd50), SPH_C32(0x7219bb66), - SPH_C32(0x77e536de) }, - { SPH_C32(0xaa300000), SPH_C32(0x06c70000), SPH_C32(0x98a00000), - SPH_C32(0xd837000f), SPH_C32(0x9a325b47), SPH_C32(0x61e33e3c), - SPH_C32(0xb0ffb86a), SPH_C32(0xd138061b), SPH_C32(0xcef90000), - SPH_C32(0xfd7d0000), SPH_C32(0x3d120000), SPH_C32(0x22ce0016), - SPH_C32(0xf513e635), SPH_C32(0x8b26cdda), SPH_C32(0xc97f336e), - SPH_C32(0xad62b6de) }, - { SPH_C32(0x926c0000), SPH_C32(0xa3cd0000), SPH_C32(0x8d860000), - SPH_C32(0x7cff0002), SPH_C32(0x8144eada), SPH_C32(0xf3593f8b), - SPH_C32(0x93c46932), SPH_C32(0xc51c1249), SPH_C32(0xcc570000), - SPH_C32(0x124c0000), SPH_C32(0x23d30000), SPH_C32(0xd700001a), - SPH_C32(0x29eae13d), SPH_C32(0x5ceb1feb), SPH_C32(0xc1ec9d6c), - SPH_C32(0x18d7575b) }, - { SPH_C32(0x91510000), SPH_C32(0xab7e0000), SPH_C32(0x7ebc0000), - SPH_C32(0x463d0005), SPH_C32(0xd06d608a), SPH_C32(0x98375994), - SPH_C32(0x9d61a6d1), SPH_C32(0x23c66db7), SPH_C32(0x648d0000), - SPH_C32(0x84f20000), SPH_C32(0x7fce0000), SPH_C32(0xd0da0018), - SPH_C32(0x548c74be), SPH_C32(0x43736f61), SPH_C32(0x7a8a1564), - SPH_C32(0xc250d75b) }, - { SPH_C32(0x3ab60000), SPH_C32(0x35730000), SPH_C32(0xd19b0000), - SPH_C32(0x7b250000), SPH_C32(0xfc227f59), SPH_C32(0xecc14f01), - SPH_C32(0x28a2e13a), SPH_C32(0x1f9b9249), SPH_C32(0x67b00000), - SPH_C32(0x8c410000), SPH_C32(0x8cf40000), SPH_C32(0xea18001f), - SPH_C32(0x05a5feee), SPH_C32(0x281d097e), SPH_C32(0x742fda87), - SPH_C32(0x248aa8a5) }, - { SPH_C32(0x398b0000), SPH_C32(0x3dc00000), SPH_C32(0x22a10000), - SPH_C32(0x41e70007), SPH_C32(0xad0bf509), SPH_C32(0x87af291e), - SPH_C32(0x26072ed9), SPH_C32(0xf941edb7), SPH_C32(0xcf6a0000), - SPH_C32(0x1aff0000), SPH_C32(0xd0e90000), SPH_C32(0xedc2001d), - SPH_C32(0x78c36b6d), SPH_C32(0x378579f4), SPH_C32(0xcf49528f), - SPH_C32(0xfe0d28a5) }, - { SPH_C32(0x93ff0000), SPH_C32(0x444f0000), SPH_C32(0x607d0000), - SPH_C32(0xb3f30009), SPH_C32(0x0c946782), SPH_C32(0x4ffa8ba5), - SPH_C32(0x95f208d3), SPH_C32(0x96738c32), SPH_C32(0x5e7f0000), - SPH_C32(0xcec90000), SPH_C32(0x74290000), SPH_C32(0x81dc0019), - SPH_C32(0x9303c22b), SPH_C32(0x0604bce7), SPH_C32(0x51226a3e), - SPH_C32(0x63c1228c) }, - { SPH_C32(0x90c20000), SPH_C32(0x4cfc0000), SPH_C32(0x93470000), - SPH_C32(0x8931000e), SPH_C32(0x5dbdedd2), SPH_C32(0x2494edba), - SPH_C32(0x9b57c730), SPH_C32(0x70a9f3cc), SPH_C32(0xf6a50000), - SPH_C32(0x58770000), SPH_C32(0x28340000), SPH_C32(0x8606001b), - SPH_C32(0xee6557a8), SPH_C32(0x199ccc6d), SPH_C32(0xea44e236), - SPH_C32(0xb946a28c) }, - { SPH_C32(0x3b250000), SPH_C32(0xd2f10000), SPH_C32(0x3c600000), - SPH_C32(0xb429000b), SPH_C32(0x71f2f201), SPH_C32(0x5062fb2f), - SPH_C32(0x2e9480db), SPH_C32(0x4cf40c32), SPH_C32(0xf5980000), - SPH_C32(0x50c40000), SPH_C32(0xdb0e0000), SPH_C32(0xbcc4001c), - SPH_C32(0xbf4cddf8), SPH_C32(0x72f2aa72), SPH_C32(0xe4e12dd5), - SPH_C32(0x5f9cdd72) }, - { SPH_C32(0x38180000), SPH_C32(0xda420000), SPH_C32(0xcf5a0000), - SPH_C32(0x8eeb000c), SPH_C32(0x20db7851), SPH_C32(0x3b0c9d30), - SPH_C32(0x20314f38), SPH_C32(0xaa2e73cc), SPH_C32(0x5d420000), - SPH_C32(0xc67a0000), SPH_C32(0x87130000), SPH_C32(0xbb1e001e), - SPH_C32(0xc22a487b), SPH_C32(0x6d6adaf8), SPH_C32(0x5f87a5dd), - SPH_C32(0x851b5d72) }, - { SPH_C32(0x5fec0000), SPH_C32(0x294b0000), SPH_C32(0x99d20000), - SPH_C32(0x4ed00012), SPH_C32(0x1ed34f73), SPH_C32(0xbaa708c9), - SPH_C32(0x57140bdf), SPH_C32(0x30aebcf7), SPH_C32(0x5fa80000), - SPH_C32(0x56030000), SPH_C32(0x43ae0000), SPH_C32(0x64f30013), - SPH_C32(0x257e86bf), SPH_C32(0x1311944e), SPH_C32(0x541e95bf), - SPH_C32(0x8ea4db69) }, - { SPH_C32(0x5cd10000), SPH_C32(0x21f80000), SPH_C32(0x6ae80000), - SPH_C32(0x74120015), SPH_C32(0x4ffac523), SPH_C32(0xd1c96ed6), - SPH_C32(0x59b1c43c), SPH_C32(0xd674c309), SPH_C32(0xf7720000), - SPH_C32(0xc0bd0000), SPH_C32(0x1fb30000), SPH_C32(0x63290011), - SPH_C32(0x5818133c), SPH_C32(0x0c89e4c4), SPH_C32(0xef781db7), - SPH_C32(0x54235b69) }, - { SPH_C32(0xf7360000), SPH_C32(0xbff50000), SPH_C32(0xc5cf0000), - SPH_C32(0x490a0010), SPH_C32(0x63b5daf0), SPH_C32(0xa53f7843), - SPH_C32(0xec7283d7), SPH_C32(0xea293cf7), SPH_C32(0xf44f0000), - SPH_C32(0xc80e0000), SPH_C32(0xec890000), SPH_C32(0x59eb0016), - SPH_C32(0x0931996c), SPH_C32(0x67e782db), SPH_C32(0xe1ddd254), - SPH_C32(0xb2f92497) }, - { SPH_C32(0xf40b0000), SPH_C32(0xb7460000), SPH_C32(0x36f50000), - SPH_C32(0x73c80017), SPH_C32(0x329c50a0), SPH_C32(0xce511e5c), - SPH_C32(0xe2d74c34), SPH_C32(0x0cf34309), SPH_C32(0x5c950000), - SPH_C32(0x5eb00000), SPH_C32(0xb0940000), SPH_C32(0x5e310014), - SPH_C32(0x74570cef), SPH_C32(0x787ff251), SPH_C32(0x5abb5a5c), - SPH_C32(0x687ea497) }, - { SPH_C32(0x5e7f0000), SPH_C32(0xcec90000), SPH_C32(0x74290000), - SPH_C32(0x81dc0019), SPH_C32(0x9303c22b), SPH_C32(0x0604bce7), - SPH_C32(0x51226a3e), SPH_C32(0x63c1228c), SPH_C32(0xcd800000), - SPH_C32(0x8a860000), SPH_C32(0x14540000), SPH_C32(0x322f0010), - SPH_C32(0x9f97a5a9), SPH_C32(0x49fe3742), SPH_C32(0xc4d062ed), - SPH_C32(0xf5b2aebe) }, - { SPH_C32(0x5d420000), SPH_C32(0xc67a0000), SPH_C32(0x87130000), - SPH_C32(0xbb1e001e), SPH_C32(0xc22a487b), SPH_C32(0x6d6adaf8), - SPH_C32(0x5f87a5dd), SPH_C32(0x851b5d72), SPH_C32(0x655a0000), - SPH_C32(0x1c380000), SPH_C32(0x48490000), SPH_C32(0x35f50012), - SPH_C32(0xe2f1302a), SPH_C32(0x566647c8), SPH_C32(0x7fb6eae5), - SPH_C32(0x2f352ebe) }, - { SPH_C32(0xf6a50000), SPH_C32(0x58770000), SPH_C32(0x28340000), - SPH_C32(0x8606001b), SPH_C32(0xee6557a8), SPH_C32(0x199ccc6d), - SPH_C32(0xea44e236), SPH_C32(0xb946a28c), SPH_C32(0x66670000), - SPH_C32(0x148b0000), SPH_C32(0xbb730000), SPH_C32(0x0f370015), - SPH_C32(0xb3d8ba7a), SPH_C32(0x3d0821d7), SPH_C32(0x71132506), - SPH_C32(0xc9ef5140) }, - { SPH_C32(0xf5980000), SPH_C32(0x50c40000), SPH_C32(0xdb0e0000), - SPH_C32(0xbcc4001c), SPH_C32(0xbf4cddf8), SPH_C32(0x72f2aa72), - SPH_C32(0xe4e12dd5), SPH_C32(0x5f9cdd72), SPH_C32(0xcebd0000), - SPH_C32(0x82350000), SPH_C32(0xe76e0000), SPH_C32(0x08ed0017), - SPH_C32(0xcebe2ff9), SPH_C32(0x2290515d), SPH_C32(0xca75ad0e), - SPH_C32(0x1368d140) }, - { SPH_C32(0xcdc40000), SPH_C32(0xf5ce0000), SPH_C32(0xce280000), - SPH_C32(0x180c0011), SPH_C32(0xa43a6c65), SPH_C32(0xe048abc5), - SPH_C32(0xc7dafc8d), SPH_C32(0x4bb8c920), SPH_C32(0xcc130000), - SPH_C32(0x6d040000), SPH_C32(0xf9af0000), SPH_C32(0xfd23001b), - SPH_C32(0x124728f1), SPH_C32(0xf55d836c), SPH_C32(0xc2e6030c), - SPH_C32(0xa6dd30c5) }, - { SPH_C32(0xcef90000), SPH_C32(0xfd7d0000), SPH_C32(0x3d120000), - SPH_C32(0x22ce0016), SPH_C32(0xf513e635), SPH_C32(0x8b26cdda), - SPH_C32(0xc97f336e), SPH_C32(0xad62b6de), SPH_C32(0x64c90000), - SPH_C32(0xfbba0000), SPH_C32(0xa5b20000), SPH_C32(0xfaf90019), - SPH_C32(0x6f21bd72), SPH_C32(0xeac5f3e6), SPH_C32(0x79808b04), - SPH_C32(0x7c5ab0c5) }, - { SPH_C32(0x651e0000), SPH_C32(0x63700000), SPH_C32(0x92350000), - SPH_C32(0x1fd60013), SPH_C32(0xd95cf9e6), SPH_C32(0xffd0db4f), - SPH_C32(0x7cbc7485), SPH_C32(0x913f4920), SPH_C32(0x67f40000), - SPH_C32(0xf3090000), SPH_C32(0x56880000), SPH_C32(0xc03b001e), - SPH_C32(0x3e083722), SPH_C32(0x81ab95f9), SPH_C32(0x772544e7), - SPH_C32(0x9a80cf3b) }, - { SPH_C32(0x66230000), SPH_C32(0x6bc30000), SPH_C32(0x610f0000), - SPH_C32(0x25140014), SPH_C32(0x887573b6), SPH_C32(0x94bebd50), - SPH_C32(0x7219bb66), SPH_C32(0x77e536de), SPH_C32(0xcf2e0000), - SPH_C32(0x65b70000), SPH_C32(0x0a950000), SPH_C32(0xc7e1001c), - SPH_C32(0x436ea2a1), SPH_C32(0x9e33e573), SPH_C32(0xcc43ccef), - SPH_C32(0x40074f3b) }, - { SPH_C32(0xcc570000), SPH_C32(0x124c0000), SPH_C32(0x23d30000), - SPH_C32(0xd700001a), SPH_C32(0x29eae13d), SPH_C32(0x5ceb1feb), - SPH_C32(0xc1ec9d6c), SPH_C32(0x18d7575b), SPH_C32(0x5e3b0000), - SPH_C32(0xb1810000), SPH_C32(0xae550000), SPH_C32(0xabff0018), - SPH_C32(0xa8ae0be7), SPH_C32(0xafb22060), SPH_C32(0x5228f45e), - SPH_C32(0xddcb4512) }, - { SPH_C32(0xcf6a0000), SPH_C32(0x1aff0000), SPH_C32(0xd0e90000), - SPH_C32(0xedc2001d), SPH_C32(0x78c36b6d), SPH_C32(0x378579f4), - SPH_C32(0xcf49528f), SPH_C32(0xfe0d28a5), SPH_C32(0xf6e10000), - SPH_C32(0x273f0000), SPH_C32(0xf2480000), SPH_C32(0xac25001a), - SPH_C32(0xd5c89e64), SPH_C32(0xb02a50ea), SPH_C32(0xe94e7c56), - SPH_C32(0x074cc512) }, - { SPH_C32(0x648d0000), SPH_C32(0x84f20000), SPH_C32(0x7fce0000), - SPH_C32(0xd0da0018), SPH_C32(0x548c74be), SPH_C32(0x43736f61), - SPH_C32(0x7a8a1564), SPH_C32(0xc250d75b), SPH_C32(0xf5dc0000), - SPH_C32(0x2f8c0000), SPH_C32(0x01720000), SPH_C32(0x96e7001d), - SPH_C32(0x84e11434), SPH_C32(0xdb4436f5), SPH_C32(0xe7ebb3b5), - SPH_C32(0xe196baec) }, - { SPH_C32(0x67b00000), SPH_C32(0x8c410000), SPH_C32(0x8cf40000), - SPH_C32(0xea18001f), SPH_C32(0x05a5feee), SPH_C32(0x281d097e), - SPH_C32(0x742fda87), SPH_C32(0x248aa8a5), SPH_C32(0x5d060000), - SPH_C32(0xb9320000), SPH_C32(0x5d6f0000), SPH_C32(0x913d001f), - SPH_C32(0xf98781b7), SPH_C32(0xc4dc467f), SPH_C32(0x5c8d3bbd), - SPH_C32(0x3b113aec) }, - { SPH_C32(0xee930000), SPH_C32(0xd6070000), SPH_C32(0x92c10000), - SPH_C32(0x2b9801e0), SPH_C32(0x9451287c), SPH_C32(0x3b6cfb57), - SPH_C32(0x45312374), SPH_C32(0x201f6a64), SPH_C32(0x7b280000), - SPH_C32(0x57420000), SPH_C32(0xa9e50000), SPH_C32(0x634300a0), - SPH_C32(0x9edb442f), SPH_C32(0x6d9995bb), SPH_C32(0x27f83b03), - SPH_C32(0xc7ff60f0) }, - { SPH_C32(0xedae0000), SPH_C32(0xdeb40000), SPH_C32(0x61fb0000), - SPH_C32(0x115a01e7), SPH_C32(0xc578a22c), SPH_C32(0x50029d48), - SPH_C32(0x4b94ec97), SPH_C32(0xc6c5159a), SPH_C32(0xd3f20000), - SPH_C32(0xc1fc0000), SPH_C32(0xf5f80000), SPH_C32(0x649900a2), - SPH_C32(0xe3bdd1ac), SPH_C32(0x7201e531), SPH_C32(0x9c9eb30b), - SPH_C32(0x1d78e0f0) }, - { SPH_C32(0x46490000), SPH_C32(0x40b90000), SPH_C32(0xcedc0000), - SPH_C32(0x2c4201e2), SPH_C32(0xe937bdff), SPH_C32(0x24f48bdd), - SPH_C32(0xfe57ab7c), SPH_C32(0xfa98ea64), SPH_C32(0xd0cf0000), - SPH_C32(0xc94f0000), SPH_C32(0x06c20000), SPH_C32(0x5e5b00a5), - SPH_C32(0xb2945bfc), SPH_C32(0x196f832e), SPH_C32(0x923b7ce8), - SPH_C32(0xfba29f0e) }, - { SPH_C32(0x45740000), SPH_C32(0x480a0000), SPH_C32(0x3de60000), - SPH_C32(0x168001e5), SPH_C32(0xb81e37af), SPH_C32(0x4f9aedc2), - SPH_C32(0xf0f2649f), SPH_C32(0x1c42959a), SPH_C32(0x78150000), - SPH_C32(0x5ff10000), SPH_C32(0x5adf0000), SPH_C32(0x598100a7), - SPH_C32(0xcff2ce7f), SPH_C32(0x06f7f3a4), SPH_C32(0x295df4e0), - SPH_C32(0x21251f0e) }, - { SPH_C32(0xef000000), SPH_C32(0x31850000), SPH_C32(0x7f3a0000), - SPH_C32(0xe49401eb), SPH_C32(0x1981a524), SPH_C32(0x87cf4f79), - SPH_C32(0x43074295), SPH_C32(0x7370f41f), SPH_C32(0xe9000000), - SPH_C32(0x8bc70000), SPH_C32(0xfe1f0000), SPH_C32(0x359f00a3), - SPH_C32(0x24326739), SPH_C32(0x377636b7), SPH_C32(0xb736cc51), - SPH_C32(0xbce91527) }, - { SPH_C32(0xec3d0000), SPH_C32(0x39360000), SPH_C32(0x8c000000), - SPH_C32(0xde5601ec), SPH_C32(0x48a82f74), SPH_C32(0xeca12966), - SPH_C32(0x4da28d76), SPH_C32(0x95aa8be1), SPH_C32(0x41da0000), - SPH_C32(0x1d790000), SPH_C32(0xa2020000), SPH_C32(0x324500a1), - SPH_C32(0x5954f2ba), SPH_C32(0x28ee463d), SPH_C32(0x0c504459), - SPH_C32(0x666e9527) }, - { SPH_C32(0x47da0000), SPH_C32(0xa73b0000), SPH_C32(0x23270000), - SPH_C32(0xe34e01e9), SPH_C32(0x64e730a7), SPH_C32(0x98573ff3), - SPH_C32(0xf861ca9d), SPH_C32(0xa9f7741f), SPH_C32(0x42e70000), - SPH_C32(0x15ca0000), SPH_C32(0x51380000), SPH_C32(0x088700a6), - SPH_C32(0x087d78ea), SPH_C32(0x43802022), SPH_C32(0x02f58bba), - SPH_C32(0x80b4ead9) }, - { SPH_C32(0x44e70000), SPH_C32(0xaf880000), SPH_C32(0xd01d0000), - SPH_C32(0xd98c01ee), SPH_C32(0x35cebaf7), SPH_C32(0xf33959ec), - SPH_C32(0xf6c4057e), SPH_C32(0x4f2d0be1), SPH_C32(0xea3d0000), - SPH_C32(0x83740000), SPH_C32(0x0d250000), SPH_C32(0x0f5d00a4), - SPH_C32(0x751bed69), SPH_C32(0x5c1850a8), SPH_C32(0xb99303b2), - SPH_C32(0x5a336ad9) }, - { SPH_C32(0x7cbb0000), SPH_C32(0x0a820000), SPH_C32(0xc53b0000), - SPH_C32(0x7d4401e3), SPH_C32(0x2eb80b6a), SPH_C32(0x6183585b), - SPH_C32(0xd5ffd426), SPH_C32(0x5b091fb3), SPH_C32(0xe8930000), - SPH_C32(0x6c450000), SPH_C32(0x13e40000), SPH_C32(0xfa9300a8), - SPH_C32(0xa9e2ea61), SPH_C32(0x8bd58299), SPH_C32(0xb100adb0), - SPH_C32(0xef868b5c) }, - { SPH_C32(0x7f860000), SPH_C32(0x02310000), SPH_C32(0x36010000), - SPH_C32(0x478601e4), SPH_C32(0x7f91813a), SPH_C32(0x0aed3e44), - SPH_C32(0xdb5a1bc5), SPH_C32(0xbdd3604d), SPH_C32(0x40490000), - SPH_C32(0xfafb0000), SPH_C32(0x4ff90000), SPH_C32(0xfd4900aa), - SPH_C32(0xd4847fe2), SPH_C32(0x944df213), SPH_C32(0x0a6625b8), - SPH_C32(0x35010b5c) }, - { SPH_C32(0xd4610000), SPH_C32(0x9c3c0000), SPH_C32(0x99260000), - SPH_C32(0x7a9e01e1), SPH_C32(0x53de9ee9), SPH_C32(0x7e1b28d1), - SPH_C32(0x6e995c2e), SPH_C32(0x818e9fb3), SPH_C32(0x43740000), - SPH_C32(0xf2480000), SPH_C32(0xbcc30000), SPH_C32(0xc78b00ad), - SPH_C32(0x85adf5b2), SPH_C32(0xff23940c), SPH_C32(0x04c3ea5b), - SPH_C32(0xd3db74a2) }, - { SPH_C32(0xd75c0000), SPH_C32(0x948f0000), SPH_C32(0x6a1c0000), - SPH_C32(0x405c01e6), SPH_C32(0x02f714b9), SPH_C32(0x15754ece), - SPH_C32(0x603c93cd), SPH_C32(0x6754e04d), SPH_C32(0xebae0000), - SPH_C32(0x64f60000), SPH_C32(0xe0de0000), SPH_C32(0xc05100af), - SPH_C32(0xf8cb6031), SPH_C32(0xe0bbe486), SPH_C32(0xbfa56253), - SPH_C32(0x095cf4a2) }, - { SPH_C32(0x7d280000), SPH_C32(0xed000000), SPH_C32(0x28c00000), - SPH_C32(0xb24801e8), SPH_C32(0xa3688632), SPH_C32(0xdd20ec75), - SPH_C32(0xd3c9b5c7), SPH_C32(0x086681c8), SPH_C32(0x7abb0000), - SPH_C32(0xb0c00000), SPH_C32(0x441e0000), SPH_C32(0xac4f00ab), - SPH_C32(0x130bc977), SPH_C32(0xd13a2195), SPH_C32(0x21ce5ae2), - SPH_C32(0x9490fe8b) }, - { SPH_C32(0x7e150000), SPH_C32(0xe5b30000), SPH_C32(0xdbfa0000), - SPH_C32(0x888a01ef), SPH_C32(0xf2410c62), SPH_C32(0xb64e8a6a), - SPH_C32(0xdd6c7a24), SPH_C32(0xeebcfe36), SPH_C32(0xd2610000), - SPH_C32(0x267e0000), SPH_C32(0x18030000), SPH_C32(0xab9500a9), - SPH_C32(0x6e6d5cf4), SPH_C32(0xcea2511f), SPH_C32(0x9aa8d2ea), - SPH_C32(0x4e177e8b) }, - { SPH_C32(0xd5f20000), SPH_C32(0x7bbe0000), SPH_C32(0x74dd0000), - SPH_C32(0xb59201ea), SPH_C32(0xde0e13b1), SPH_C32(0xc2b89cff), - SPH_C32(0x68af3dcf), SPH_C32(0xd2e101c8), SPH_C32(0xd15c0000), - SPH_C32(0x2ecd0000), SPH_C32(0xeb390000), SPH_C32(0x915700ae), - SPH_C32(0x3f44d6a4), SPH_C32(0xa5cc3700), SPH_C32(0x940d1d09), - SPH_C32(0xa8cd0175) }, - { SPH_C32(0xd6cf0000), SPH_C32(0x730d0000), SPH_C32(0x87e70000), - SPH_C32(0x8f5001ed), SPH_C32(0x8f2799e1), SPH_C32(0xa9d6fae0), - SPH_C32(0x660af22c), SPH_C32(0x343b7e36), SPH_C32(0x79860000), - SPH_C32(0xb8730000), SPH_C32(0xb7240000), SPH_C32(0x968d00ac), - SPH_C32(0x42224327), SPH_C32(0xba54478a), SPH_C32(0x2f6b9501), - SPH_C32(0x724a8175) }, - { SPH_C32(0xb13b0000), SPH_C32(0x80040000), SPH_C32(0xd16f0000), - SPH_C32(0x4f6b01f3), SPH_C32(0xb12faec3), SPH_C32(0x287d6f19), - SPH_C32(0x112fb6cb), SPH_C32(0xaebbb10d), SPH_C32(0x7b6c0000), - SPH_C32(0x280a0000), SPH_C32(0x73990000), SPH_C32(0x496000a1), - SPH_C32(0xa5768de3), SPH_C32(0xc42f093c), SPH_C32(0x24f2a563), - SPH_C32(0x79f5076e) }, - { SPH_C32(0xb2060000), SPH_C32(0x88b70000), SPH_C32(0x22550000), - SPH_C32(0x75a901f4), SPH_C32(0xe0062493), SPH_C32(0x43130906), - SPH_C32(0x1f8a7928), SPH_C32(0x4861cef3), SPH_C32(0xd3b60000), - SPH_C32(0xbeb40000), SPH_C32(0x2f840000), SPH_C32(0x4eba00a3), - SPH_C32(0xd8101860), SPH_C32(0xdbb779b6), SPH_C32(0x9f942d6b), - SPH_C32(0xa372876e) }, - { SPH_C32(0x19e10000), SPH_C32(0x16ba0000), SPH_C32(0x8d720000), - SPH_C32(0x48b101f1), SPH_C32(0xcc493b40), SPH_C32(0x37e51f93), - SPH_C32(0xaa493ec3), SPH_C32(0x743c310d), SPH_C32(0xd08b0000), - SPH_C32(0xb6070000), SPH_C32(0xdcbe0000), SPH_C32(0x747800a4), - SPH_C32(0x89399230), SPH_C32(0xb0d91fa9), SPH_C32(0x9131e288), - SPH_C32(0x45a8f890) }, - { SPH_C32(0x1adc0000), SPH_C32(0x1e090000), SPH_C32(0x7e480000), - SPH_C32(0x727301f6), SPH_C32(0x9d60b110), SPH_C32(0x5c8b798c), - SPH_C32(0xa4ecf120), SPH_C32(0x92e64ef3), SPH_C32(0x78510000), - SPH_C32(0x20b90000), SPH_C32(0x80a30000), SPH_C32(0x73a200a6), - SPH_C32(0xf45f07b3), SPH_C32(0xaf416f23), SPH_C32(0x2a576a80), - SPH_C32(0x9f2f7890) }, - { SPH_C32(0xb0a80000), SPH_C32(0x67860000), SPH_C32(0x3c940000), - SPH_C32(0x806701f8), SPH_C32(0x3cff239b), SPH_C32(0x94dedb37), - SPH_C32(0x1719d72a), SPH_C32(0xfdd42f76), SPH_C32(0xe9440000), - SPH_C32(0xf48f0000), SPH_C32(0x24630000), SPH_C32(0x1fbc00a2), - SPH_C32(0x1f9faef5), SPH_C32(0x9ec0aa30), SPH_C32(0xb43c5231), - SPH_C32(0x02e372b9) }, - { SPH_C32(0xb3950000), SPH_C32(0x6f350000), SPH_C32(0xcfae0000), - SPH_C32(0xbaa501ff), SPH_C32(0x6dd6a9cb), SPH_C32(0xffb0bd28), - SPH_C32(0x19bc18c9), SPH_C32(0x1b0e5088), SPH_C32(0x419e0000), - SPH_C32(0x62310000), SPH_C32(0x787e0000), SPH_C32(0x186600a0), - SPH_C32(0x62f93b76), SPH_C32(0x8158daba), SPH_C32(0x0f5ada39), - SPH_C32(0xd864f2b9) }, - { SPH_C32(0x18720000), SPH_C32(0xf1380000), SPH_C32(0x60890000), - SPH_C32(0x87bd01fa), SPH_C32(0x4199b618), SPH_C32(0x8b46abbd), - SPH_C32(0xac7f5f22), SPH_C32(0x2753af76), SPH_C32(0x42a30000), - SPH_C32(0x6a820000), SPH_C32(0x8b440000), SPH_C32(0x22a400a7), - SPH_C32(0x33d0b126), SPH_C32(0xea36bca5), SPH_C32(0x01ff15da), - SPH_C32(0x3ebe8d47) }, - { SPH_C32(0x1b4f0000), SPH_C32(0xf98b0000), SPH_C32(0x93b30000), - SPH_C32(0xbd7f01fd), SPH_C32(0x10b03c48), SPH_C32(0xe028cda2), - SPH_C32(0xa2da90c1), SPH_C32(0xc189d088), SPH_C32(0xea790000), - SPH_C32(0xfc3c0000), SPH_C32(0xd7590000), SPH_C32(0x257e00a5), - SPH_C32(0x4eb624a5), SPH_C32(0xf5aecc2f), SPH_C32(0xba999dd2), - SPH_C32(0xe4390d47) }, - { SPH_C32(0x23130000), SPH_C32(0x5c810000), SPH_C32(0x86950000), - SPH_C32(0x19b701f0), SPH_C32(0x0bc68dd5), SPH_C32(0x7292cc15), - SPH_C32(0x81e14199), SPH_C32(0xd5adc4da), SPH_C32(0xe8d70000), - SPH_C32(0x130d0000), SPH_C32(0xc9980000), SPH_C32(0xd0b000a9), - SPH_C32(0x924f23ad), SPH_C32(0x22631e1e), SPH_C32(0xb20a33d0), - SPH_C32(0x518cecc2) }, - { SPH_C32(0x202e0000), SPH_C32(0x54320000), SPH_C32(0x75af0000), - SPH_C32(0x237501f7), SPH_C32(0x5aef0785), SPH_C32(0x19fcaa0a), - SPH_C32(0x8f448e7a), SPH_C32(0x3377bb24), SPH_C32(0x400d0000), - SPH_C32(0x85b30000), SPH_C32(0x95850000), SPH_C32(0xd76a00ab), - SPH_C32(0xef29b62e), SPH_C32(0x3dfb6e94), SPH_C32(0x096cbbd8), - SPH_C32(0x8b0b6cc2) }, - { SPH_C32(0x8bc90000), SPH_C32(0xca3f0000), SPH_C32(0xda880000), - SPH_C32(0x1e6d01f2), SPH_C32(0x76a01856), SPH_C32(0x6d0abc9f), - SPH_C32(0x3a87c991), SPH_C32(0x0f2a44da), SPH_C32(0x43300000), - SPH_C32(0x8d000000), SPH_C32(0x66bf0000), SPH_C32(0xeda800ac), - SPH_C32(0xbe003c7e), SPH_C32(0x5695088b), SPH_C32(0x07c9743b), - SPH_C32(0x6dd1133c) }, - { SPH_C32(0x88f40000), SPH_C32(0xc28c0000), SPH_C32(0x29b20000), - SPH_C32(0x24af01f5), SPH_C32(0x27899206), SPH_C32(0x0664da80), - SPH_C32(0x34220672), SPH_C32(0xe9f03b24), SPH_C32(0xebea0000), - SPH_C32(0x1bbe0000), SPH_C32(0x3aa20000), SPH_C32(0xea7200ae), - SPH_C32(0xc366a9fd), SPH_C32(0x490d7801), SPH_C32(0xbcaffc33), - SPH_C32(0xb756933c) }, - { SPH_C32(0x22800000), SPH_C32(0xbb030000), SPH_C32(0x6b6e0000), - SPH_C32(0xd6bb01fb), SPH_C32(0x8616008d), SPH_C32(0xce31783b), - SPH_C32(0x87d72078), SPH_C32(0x86c25aa1), SPH_C32(0x7aff0000), - SPH_C32(0xcf880000), SPH_C32(0x9e620000), SPH_C32(0x866c00aa), - SPH_C32(0x28a600bb), SPH_C32(0x788cbd12), SPH_C32(0x22c4c482), - SPH_C32(0x2a9a9915) }, - { SPH_C32(0x21bd0000), SPH_C32(0xb3b00000), SPH_C32(0x98540000), - SPH_C32(0xec7901fc), SPH_C32(0xd73f8add), SPH_C32(0xa55f1e24), - SPH_C32(0x8972ef9b), SPH_C32(0x6018255f), SPH_C32(0xd2250000), - SPH_C32(0x59360000), SPH_C32(0xc27f0000), SPH_C32(0x81b600a8), - SPH_C32(0x55c09538), SPH_C32(0x6714cd98), SPH_C32(0x99a24c8a), - SPH_C32(0xf01d1915) }, - { SPH_C32(0x8a5a0000), SPH_C32(0x2dbd0000), SPH_C32(0x37730000), - SPH_C32(0xd16101f9), SPH_C32(0xfb70950e), SPH_C32(0xd1a908b1), - SPH_C32(0x3cb1a870), SPH_C32(0x5c45daa1), SPH_C32(0xd1180000), - SPH_C32(0x51850000), SPH_C32(0x31450000), SPH_C32(0xbb7400af), - SPH_C32(0x04e91f68), SPH_C32(0x0c7aab87), SPH_C32(0x97078369), - SPH_C32(0x16c766eb) }, - { SPH_C32(0x89670000), SPH_C32(0x250e0000), SPH_C32(0xc4490000), - SPH_C32(0xeba301fe), SPH_C32(0xaa591f5e), SPH_C32(0xbac76eae), - SPH_C32(0x32146793), SPH_C32(0xba9fa55f), SPH_C32(0x79c20000), - SPH_C32(0xc73b0000), SPH_C32(0x6d580000), SPH_C32(0xbcae00ad), - SPH_C32(0x798f8aeb), SPH_C32(0x13e2db0d), SPH_C32(0x2c610b61), - SPH_C32(0xcc40e6eb) }, - { SPH_C32(0xeed70000), SPH_C32(0xa94f0000), SPH_C32(0x48bd0000), - SPH_C32(0x01bb01e1), SPH_C32(0xaffce1b0), SPH_C32(0x92da67d0), - SPH_C32(0x463bbd14), SPH_C32(0x9e150dfa), SPH_C32(0x24c40000), - SPH_C32(0x7e090000), SPH_C32(0x30370000), SPH_C32(0x2d9300b2), - SPH_C32(0x80080b5c), SPH_C32(0xd73e9d72), SPH_C32(0x70ec30dc), - SPH_C32(0xf751dc07) }, - { SPH_C32(0xedea0000), SPH_C32(0xa1fc0000), SPH_C32(0xbb870000), - SPH_C32(0x3b7901e6), SPH_C32(0xfed56be0), SPH_C32(0xf9b401cf), - SPH_C32(0x489e72f7), SPH_C32(0x78cf7204), SPH_C32(0x8c1e0000), - SPH_C32(0xe8b70000), SPH_C32(0x6c2a0000), SPH_C32(0x2a4900b0), - SPH_C32(0xfd6e9edf), SPH_C32(0xc8a6edf8), SPH_C32(0xcb8ab8d4), - SPH_C32(0x2dd65c07) }, - { SPH_C32(0x460d0000), SPH_C32(0x3ff10000), SPH_C32(0x14a00000), - SPH_C32(0x066101e3), SPH_C32(0xd29a7433), SPH_C32(0x8d42175a), - SPH_C32(0xfd5d351c), SPH_C32(0x44928dfa), SPH_C32(0x8f230000), - SPH_C32(0xe0040000), SPH_C32(0x9f100000), SPH_C32(0x108b00b7), - SPH_C32(0xac47148f), SPH_C32(0xa3c88be7), SPH_C32(0xc52f7737), - SPH_C32(0xcb0c23f9) }, - { SPH_C32(0x45300000), SPH_C32(0x37420000), SPH_C32(0xe79a0000), - SPH_C32(0x3ca301e4), SPH_C32(0x83b3fe63), SPH_C32(0xe62c7145), - SPH_C32(0xf3f8faff), SPH_C32(0xa248f204), SPH_C32(0x27f90000), - SPH_C32(0x76ba0000), SPH_C32(0xc30d0000), SPH_C32(0x175100b5), - SPH_C32(0xd121810c), SPH_C32(0xbc50fb6d), SPH_C32(0x7e49ff3f), - SPH_C32(0x118ba3f9) }, - { SPH_C32(0xef440000), SPH_C32(0x4ecd0000), SPH_C32(0xa5460000), - SPH_C32(0xceb701ea), SPH_C32(0x222c6ce8), SPH_C32(0x2e79d3fe), - SPH_C32(0x400ddcf5), SPH_C32(0xcd7a9381), SPH_C32(0xb6ec0000), - SPH_C32(0xa28c0000), SPH_C32(0x67cd0000), SPH_C32(0x7b4f00b1), - SPH_C32(0x3ae1284a), SPH_C32(0x8dd13e7e), SPH_C32(0xe022c78e), - SPH_C32(0x8c47a9d0) }, - { SPH_C32(0xec790000), SPH_C32(0x467e0000), SPH_C32(0x567c0000), - SPH_C32(0xf47501ed), SPH_C32(0x7305e6b8), SPH_C32(0x4517b5e1), - SPH_C32(0x4ea81316), SPH_C32(0x2ba0ec7f), SPH_C32(0x1e360000), - SPH_C32(0x34320000), SPH_C32(0x3bd00000), SPH_C32(0x7c9500b3), - SPH_C32(0x4787bdc9), SPH_C32(0x92494ef4), SPH_C32(0x5b444f86), - SPH_C32(0x56c029d0) }, - { SPH_C32(0x479e0000), SPH_C32(0xd8730000), SPH_C32(0xf95b0000), - SPH_C32(0xc96d01e8), SPH_C32(0x5f4af96b), SPH_C32(0x31e1a374), - SPH_C32(0xfb6b54fd), SPH_C32(0x17fd1381), SPH_C32(0x1d0b0000), - SPH_C32(0x3c810000), SPH_C32(0xc8ea0000), SPH_C32(0x465700b4), - SPH_C32(0x16ae3799), SPH_C32(0xf92728eb), SPH_C32(0x55e18065), - SPH_C32(0xb01a562e) }, - { SPH_C32(0x44a30000), SPH_C32(0xd0c00000), SPH_C32(0x0a610000), - SPH_C32(0xf3af01ef), SPH_C32(0x0e63733b), SPH_C32(0x5a8fc56b), - SPH_C32(0xf5ce9b1e), SPH_C32(0xf1276c7f), SPH_C32(0xb5d10000), - SPH_C32(0xaa3f0000), SPH_C32(0x94f70000), SPH_C32(0x418d00b6), - SPH_C32(0x6bc8a21a), SPH_C32(0xe6bf5861), SPH_C32(0xee87086d), - SPH_C32(0x6a9dd62e) }, - { SPH_C32(0x7cff0000), SPH_C32(0x75ca0000), SPH_C32(0x1f470000), - SPH_C32(0x576701e2), SPH_C32(0x1515c2a6), SPH_C32(0xc835c4dc), - SPH_C32(0xd6f54a46), SPH_C32(0xe503782d), SPH_C32(0xb77f0000), - SPH_C32(0x450e0000), SPH_C32(0x8a360000), SPH_C32(0xb44300ba), - SPH_C32(0xb731a512), SPH_C32(0x31728a50), SPH_C32(0xe614a66f), - SPH_C32(0xdf2837ab) }, - { SPH_C32(0x7fc20000), SPH_C32(0x7d790000), SPH_C32(0xec7d0000), - SPH_C32(0x6da501e5), SPH_C32(0x443c48f6), SPH_C32(0xa35ba2c3), - SPH_C32(0xd85085a5), SPH_C32(0x03d907d3), SPH_C32(0x1fa50000), - SPH_C32(0xd3b00000), SPH_C32(0xd62b0000), SPH_C32(0xb39900b8), - SPH_C32(0xca573091), SPH_C32(0x2eeafada), SPH_C32(0x5d722e67), - SPH_C32(0x05afb7ab) }, - { SPH_C32(0xd4250000), SPH_C32(0xe3740000), SPH_C32(0x435a0000), - SPH_C32(0x50bd01e0), SPH_C32(0x68735725), SPH_C32(0xd7adb456), - SPH_C32(0x6d93c24e), SPH_C32(0x3f84f82d), SPH_C32(0x1c980000), - SPH_C32(0xdb030000), SPH_C32(0x25110000), SPH_C32(0x895b00bf), - SPH_C32(0x9b7ebac1), SPH_C32(0x45849cc5), SPH_C32(0x53d7e184), - SPH_C32(0xe375c855) }, - { SPH_C32(0xd7180000), SPH_C32(0xebc70000), SPH_C32(0xb0600000), - SPH_C32(0x6a7f01e7), SPH_C32(0x395add75), SPH_C32(0xbcc3d249), - SPH_C32(0x63360dad), SPH_C32(0xd95e87d3), SPH_C32(0xb4420000), - SPH_C32(0x4dbd0000), SPH_C32(0x790c0000), SPH_C32(0x8e8100bd), - SPH_C32(0xe6182f42), SPH_C32(0x5a1cec4f), SPH_C32(0xe8b1698c), - SPH_C32(0x39f24855) }, - { SPH_C32(0x7d6c0000), SPH_C32(0x92480000), SPH_C32(0xf2bc0000), - SPH_C32(0x986b01e9), SPH_C32(0x98c54ffe), SPH_C32(0x749670f2), - SPH_C32(0xd0c32ba7), SPH_C32(0xb66ce656), SPH_C32(0x25570000), - SPH_C32(0x998b0000), SPH_C32(0xddcc0000), SPH_C32(0xe29f00b9), - SPH_C32(0x0dd88604), SPH_C32(0x6b9d295c), SPH_C32(0x76da513d), - SPH_C32(0xa43e427c) }, - { SPH_C32(0x7e510000), SPH_C32(0x9afb0000), SPH_C32(0x01860000), - SPH_C32(0xa2a901ee), SPH_C32(0xc9ecc5ae), SPH_C32(0x1ff816ed), - SPH_C32(0xde66e444), SPH_C32(0x50b699a8), SPH_C32(0x8d8d0000), - SPH_C32(0x0f350000), SPH_C32(0x81d10000), SPH_C32(0xe54500bb), - SPH_C32(0x70be1387), SPH_C32(0x740559d6), SPH_C32(0xcdbcd935), - SPH_C32(0x7eb9c27c) }, - { SPH_C32(0xd5b60000), SPH_C32(0x04f60000), SPH_C32(0xaea10000), - SPH_C32(0x9fb101eb), SPH_C32(0xe5a3da7d), SPH_C32(0x6b0e0078), - SPH_C32(0x6ba5a3af), SPH_C32(0x6ceb6656), SPH_C32(0x8eb00000), - SPH_C32(0x07860000), SPH_C32(0x72eb0000), SPH_C32(0xdf8700bc), - SPH_C32(0x219799d7), SPH_C32(0x1f6b3fc9), SPH_C32(0xc31916d6), - SPH_C32(0x9863bd82) }, - { SPH_C32(0xd68b0000), SPH_C32(0x0c450000), SPH_C32(0x5d9b0000), - SPH_C32(0xa57301ec), SPH_C32(0xb48a502d), SPH_C32(0x00606667), - SPH_C32(0x65006c4c), SPH_C32(0x8a3119a8), SPH_C32(0x266a0000), - SPH_C32(0x91380000), SPH_C32(0x2ef60000), SPH_C32(0xd85d00be), - SPH_C32(0x5cf10c54), SPH_C32(0x00f34f43), SPH_C32(0x787f9ede), - SPH_C32(0x42e43d82) }, - { SPH_C32(0xb17f0000), SPH_C32(0xff4c0000), SPH_C32(0x0b130000), - SPH_C32(0x654801f2), SPH_C32(0x8a82670f), SPH_C32(0x81cbf39e), - SPH_C32(0x122528ab), SPH_C32(0x10b1d693), SPH_C32(0x24800000), - SPH_C32(0x01410000), SPH_C32(0xea4b0000), SPH_C32(0x07b000b3), - SPH_C32(0xbba5c290), SPH_C32(0x7e8801f5), SPH_C32(0x73e6aebc), - SPH_C32(0x495bbb99) }, - { SPH_C32(0xb2420000), SPH_C32(0xf7ff0000), SPH_C32(0xf8290000), - SPH_C32(0x5f8a01f5), SPH_C32(0xdbabed5f), SPH_C32(0xeaa59581), - SPH_C32(0x1c80e748), SPH_C32(0xf66ba96d), SPH_C32(0x8c5a0000), - SPH_C32(0x97ff0000), SPH_C32(0xb6560000), SPH_C32(0x006a00b1), - SPH_C32(0xc6c35713), SPH_C32(0x6110717f), SPH_C32(0xc88026b4), - SPH_C32(0x93dc3b99) }, - { SPH_C32(0x19a50000), SPH_C32(0x69f20000), SPH_C32(0x570e0000), - SPH_C32(0x629201f0), SPH_C32(0xf7e4f28c), SPH_C32(0x9e538314), - SPH_C32(0xa943a0a3), SPH_C32(0xca365693), SPH_C32(0x8f670000), - SPH_C32(0x9f4c0000), SPH_C32(0x456c0000), SPH_C32(0x3aa800b6), - SPH_C32(0x97eadd43), SPH_C32(0x0a7e1760), SPH_C32(0xc625e957), - SPH_C32(0x75064467) }, - { SPH_C32(0x1a980000), SPH_C32(0x61410000), SPH_C32(0xa4340000), - SPH_C32(0x585001f7), SPH_C32(0xa6cd78dc), SPH_C32(0xf53de50b), - SPH_C32(0xa7e66f40), SPH_C32(0x2cec296d), SPH_C32(0x27bd0000), - SPH_C32(0x09f20000), SPH_C32(0x19710000), SPH_C32(0x3d7200b4), - SPH_C32(0xea8c48c0), SPH_C32(0x15e667ea), SPH_C32(0x7d43615f), - SPH_C32(0xaf81c467) }, - { SPH_C32(0xb0ec0000), SPH_C32(0x18ce0000), SPH_C32(0xe6e80000), - SPH_C32(0xaa4401f9), SPH_C32(0x0752ea57), SPH_C32(0x3d6847b0), - SPH_C32(0x1413494a), SPH_C32(0x43de48e8), SPH_C32(0xb6a80000), - SPH_C32(0xddc40000), SPH_C32(0xbdb10000), SPH_C32(0x516c00b0), - SPH_C32(0x014ce186), SPH_C32(0x2467a2f9), SPH_C32(0xe32859ee), - SPH_C32(0x324dce4e) }, - { SPH_C32(0xb3d10000), SPH_C32(0x107d0000), SPH_C32(0x15d20000), - SPH_C32(0x908601fe), SPH_C32(0x567b6007), SPH_C32(0x560621af), - SPH_C32(0x1ab686a9), SPH_C32(0xa5043716), SPH_C32(0x1e720000), - SPH_C32(0x4b7a0000), SPH_C32(0xe1ac0000), SPH_C32(0x56b600b2), - SPH_C32(0x7c2a7405), SPH_C32(0x3bffd273), SPH_C32(0x584ed1e6), - SPH_C32(0xe8ca4e4e) }, - { SPH_C32(0x18360000), SPH_C32(0x8e700000), SPH_C32(0xbaf50000), - SPH_C32(0xad9e01fb), SPH_C32(0x7a347fd4), SPH_C32(0x22f0373a), - SPH_C32(0xaf75c142), SPH_C32(0x9959c8e8), SPH_C32(0x1d4f0000), - SPH_C32(0x43c90000), SPH_C32(0x12960000), SPH_C32(0x6c7400b5), - SPH_C32(0x2d03fe55), SPH_C32(0x5091b46c), SPH_C32(0x56eb1e05), - SPH_C32(0x0e1031b0) }, - { SPH_C32(0x1b0b0000), SPH_C32(0x86c30000), SPH_C32(0x49cf0000), - SPH_C32(0x975c01fc), SPH_C32(0x2b1df584), SPH_C32(0x499e5125), - SPH_C32(0xa1d00ea1), SPH_C32(0x7f83b716), SPH_C32(0xb5950000), - SPH_C32(0xd5770000), SPH_C32(0x4e8b0000), SPH_C32(0x6bae00b7), - SPH_C32(0x50656bd6), SPH_C32(0x4f09c4e6), SPH_C32(0xed8d960d), - SPH_C32(0xd497b1b0) }, - { SPH_C32(0x23570000), SPH_C32(0x23c90000), SPH_C32(0x5ce90000), - SPH_C32(0x339401f1), SPH_C32(0x306b4419), SPH_C32(0xdb245092), - SPH_C32(0x82ebdff9), SPH_C32(0x6ba7a344), SPH_C32(0xb73b0000), - SPH_C32(0x3a460000), SPH_C32(0x504a0000), SPH_C32(0x9e6000bb), - SPH_C32(0x8c9c6cde), SPH_C32(0x98c416d7), SPH_C32(0xe51e380f), - SPH_C32(0x61225035) }, - { SPH_C32(0x206a0000), SPH_C32(0x2b7a0000), SPH_C32(0xafd30000), - SPH_C32(0x095601f6), SPH_C32(0x6142ce49), SPH_C32(0xb04a368d), - SPH_C32(0x8c4e101a), SPH_C32(0x8d7ddcba), SPH_C32(0x1fe10000), - SPH_C32(0xacf80000), SPH_C32(0x0c570000), SPH_C32(0x99ba00b9), - SPH_C32(0xf1faf95d), SPH_C32(0x875c665d), SPH_C32(0x5e78b007), - SPH_C32(0xbba5d035) }, - { SPH_C32(0x8b8d0000), SPH_C32(0xb5770000), SPH_C32(0x00f40000), - SPH_C32(0x344e01f3), SPH_C32(0x4d0dd19a), SPH_C32(0xc4bc2018), - SPH_C32(0x398d57f1), SPH_C32(0xb1202344), SPH_C32(0x1cdc0000), - SPH_C32(0xa44b0000), SPH_C32(0xff6d0000), SPH_C32(0xa37800be), - SPH_C32(0xa0d3730d), SPH_C32(0xec320042), SPH_C32(0x50dd7fe4), - SPH_C32(0x5d7fafcb) }, - { SPH_C32(0x88b00000), SPH_C32(0xbdc40000), SPH_C32(0xf3ce0000), - SPH_C32(0x0e8c01f4), SPH_C32(0x1c245bca), SPH_C32(0xafd24607), - SPH_C32(0x37289812), SPH_C32(0x57fa5cba), SPH_C32(0xb4060000), - SPH_C32(0x32f50000), SPH_C32(0xa3700000), SPH_C32(0xa4a200bc), - SPH_C32(0xddb5e68e), SPH_C32(0xf3aa70c8), SPH_C32(0xebbbf7ec), - SPH_C32(0x87f82fcb) }, - { SPH_C32(0x22c40000), SPH_C32(0xc44b0000), SPH_C32(0xb1120000), - SPH_C32(0xfc9801fa), SPH_C32(0xbdbbc941), SPH_C32(0x6787e4bc), - SPH_C32(0x84ddbe18), SPH_C32(0x38c83d3f), SPH_C32(0x25130000), - SPH_C32(0xe6c30000), SPH_C32(0x07b00000), SPH_C32(0xc8bc00b8), - SPH_C32(0x36754fc8), SPH_C32(0xc22bb5db), SPH_C32(0x75d0cf5d), - SPH_C32(0x1a3425e2) }, - { SPH_C32(0x21f90000), SPH_C32(0xccf80000), SPH_C32(0x42280000), - SPH_C32(0xc65a01fd), SPH_C32(0xec924311), SPH_C32(0x0ce982a3), - SPH_C32(0x8a7871fb), SPH_C32(0xde1242c1), SPH_C32(0x8dc90000), - SPH_C32(0x707d0000), SPH_C32(0x5bad0000), SPH_C32(0xcf6600ba), - SPH_C32(0x4b13da4b), SPH_C32(0xddb3c551), SPH_C32(0xceb64755), - SPH_C32(0xc0b3a5e2) }, - { SPH_C32(0x8a1e0000), SPH_C32(0x52f50000), SPH_C32(0xed0f0000), - SPH_C32(0xfb4201f8), SPH_C32(0xc0dd5cc2), SPH_C32(0x781f9436), - SPH_C32(0x3fbb3610), SPH_C32(0xe24fbd3f), SPH_C32(0x8ef40000), - SPH_C32(0x78ce0000), SPH_C32(0xa8970000), SPH_C32(0xf5a400bd), - SPH_C32(0x1a3a501b), SPH_C32(0xb6dda34e), SPH_C32(0xc01388b6), - SPH_C32(0x2669da1c) }, - { SPH_C32(0x89230000), SPH_C32(0x5a460000), SPH_C32(0x1e350000), - SPH_C32(0xc18001ff), SPH_C32(0x91f4d692), SPH_C32(0x1371f229), - SPH_C32(0x311ef9f3), SPH_C32(0x0495c2c1), SPH_C32(0x262e0000), - SPH_C32(0xee700000), SPH_C32(0xf48a0000), SPH_C32(0xf27e00bf), - SPH_C32(0x675cc598), SPH_C32(0xa945d3c4), SPH_C32(0x7b7500be), - SPH_C32(0xfcee5a1c) }, - { SPH_C32(0x7b280000), SPH_C32(0x57420000), SPH_C32(0xa9e50000), - SPH_C32(0x634300a0), SPH_C32(0x9edb442f), SPH_C32(0x6d9995bb), - SPH_C32(0x27f83b03), SPH_C32(0xc7ff60f0), SPH_C32(0x95bb0000), - SPH_C32(0x81450000), SPH_C32(0x3b240000), SPH_C32(0x48db0140), - SPH_C32(0x0a8a6c53), SPH_C32(0x56f56eec), SPH_C32(0x62c91877), - SPH_C32(0xe7e00a94) }, - { SPH_C32(0x78150000), SPH_C32(0x5ff10000), SPH_C32(0x5adf0000), - SPH_C32(0x598100a7), SPH_C32(0xcff2ce7f), SPH_C32(0x06f7f3a4), - SPH_C32(0x295df4e0), SPH_C32(0x21251f0e), SPH_C32(0x3d610000), - SPH_C32(0x17fb0000), SPH_C32(0x67390000), SPH_C32(0x4f010142), - SPH_C32(0x77ecf9d0), SPH_C32(0x496d1e66), SPH_C32(0xd9af907f), - SPH_C32(0x3d678a94) }, - { SPH_C32(0xd3f20000), SPH_C32(0xc1fc0000), SPH_C32(0xf5f80000), - SPH_C32(0x649900a2), SPH_C32(0xe3bdd1ac), SPH_C32(0x7201e531), - SPH_C32(0x9c9eb30b), SPH_C32(0x1d78e0f0), SPH_C32(0x3e5c0000), - SPH_C32(0x1f480000), SPH_C32(0x94030000), SPH_C32(0x75c30145), - SPH_C32(0x26c57380), SPH_C32(0x22037879), SPH_C32(0xd70a5f9c), - SPH_C32(0xdbbdf56a) }, - { SPH_C32(0xd0cf0000), SPH_C32(0xc94f0000), SPH_C32(0x06c20000), - SPH_C32(0x5e5b00a5), SPH_C32(0xb2945bfc), SPH_C32(0x196f832e), - SPH_C32(0x923b7ce8), SPH_C32(0xfba29f0e), SPH_C32(0x96860000), - SPH_C32(0x89f60000), SPH_C32(0xc81e0000), SPH_C32(0x72190147), - SPH_C32(0x5ba3e603), SPH_C32(0x3d9b08f3), SPH_C32(0x6c6cd794), - SPH_C32(0x013a756a) }, - { SPH_C32(0x7abb0000), SPH_C32(0xb0c00000), SPH_C32(0x441e0000), - SPH_C32(0xac4f00ab), SPH_C32(0x130bc977), SPH_C32(0xd13a2195), - SPH_C32(0x21ce5ae2), SPH_C32(0x9490fe8b), SPH_C32(0x07930000), - SPH_C32(0x5dc00000), SPH_C32(0x6cde0000), SPH_C32(0x1e070143), - SPH_C32(0xb0634f45), SPH_C32(0x0c1acde0), SPH_C32(0xf207ef25), - SPH_C32(0x9cf67f43) }, - { SPH_C32(0x79860000), SPH_C32(0xb8730000), SPH_C32(0xb7240000), - SPH_C32(0x968d00ac), SPH_C32(0x42224327), SPH_C32(0xba54478a), - SPH_C32(0x2f6b9501), SPH_C32(0x724a8175), SPH_C32(0xaf490000), - SPH_C32(0xcb7e0000), SPH_C32(0x30c30000), SPH_C32(0x19dd0141), - SPH_C32(0xcd05dac6), SPH_C32(0x1382bd6a), SPH_C32(0x4961672d), - SPH_C32(0x4671ff43) }, - { SPH_C32(0xd2610000), SPH_C32(0x267e0000), SPH_C32(0x18030000), - SPH_C32(0xab9500a9), SPH_C32(0x6e6d5cf4), SPH_C32(0xcea2511f), - SPH_C32(0x9aa8d2ea), SPH_C32(0x4e177e8b), SPH_C32(0xac740000), - SPH_C32(0xc3cd0000), SPH_C32(0xc3f90000), SPH_C32(0x231f0146), - SPH_C32(0x9c2c5096), SPH_C32(0x78ecdb75), SPH_C32(0x47c4a8ce), - SPH_C32(0xa0ab80bd) }, - { SPH_C32(0xd15c0000), SPH_C32(0x2ecd0000), SPH_C32(0xeb390000), - SPH_C32(0x915700ae), SPH_C32(0x3f44d6a4), SPH_C32(0xa5cc3700), - SPH_C32(0x940d1d09), SPH_C32(0xa8cd0175), SPH_C32(0x04ae0000), - SPH_C32(0x55730000), SPH_C32(0x9fe40000), SPH_C32(0x24c50144), - SPH_C32(0xe14ac515), SPH_C32(0x6774abff), SPH_C32(0xfca220c6), - SPH_C32(0x7a2c00bd) }, - { SPH_C32(0xe9000000), SPH_C32(0x8bc70000), SPH_C32(0xfe1f0000), - SPH_C32(0x359f00a3), SPH_C32(0x24326739), SPH_C32(0x377636b7), - SPH_C32(0xb736cc51), SPH_C32(0xbce91527), SPH_C32(0x06000000), - SPH_C32(0xba420000), SPH_C32(0x81250000), SPH_C32(0xd10b0148), - SPH_C32(0x3db3c21d), SPH_C32(0xb0b979ce), SPH_C32(0xf4318ec4), - SPH_C32(0xcf99e138) }, - { SPH_C32(0xea3d0000), SPH_C32(0x83740000), SPH_C32(0x0d250000), - SPH_C32(0x0f5d00a4), SPH_C32(0x751bed69), SPH_C32(0x5c1850a8), - SPH_C32(0xb99303b2), SPH_C32(0x5a336ad9), SPH_C32(0xaeda0000), - SPH_C32(0x2cfc0000), SPH_C32(0xdd380000), SPH_C32(0xd6d1014a), - SPH_C32(0x40d5579e), SPH_C32(0xaf210944), SPH_C32(0x4f5706cc), - SPH_C32(0x151e6138) }, - { SPH_C32(0x41da0000), SPH_C32(0x1d790000), SPH_C32(0xa2020000), - SPH_C32(0x324500a1), SPH_C32(0x5954f2ba), SPH_C32(0x28ee463d), - SPH_C32(0x0c504459), SPH_C32(0x666e9527), SPH_C32(0xade70000), - SPH_C32(0x244f0000), SPH_C32(0x2e020000), SPH_C32(0xec13014d), - SPH_C32(0x11fcddce), SPH_C32(0xc44f6f5b), SPH_C32(0x41f2c92f), - SPH_C32(0xf3c41ec6) }, - { SPH_C32(0x42e70000), SPH_C32(0x15ca0000), SPH_C32(0x51380000), - SPH_C32(0x088700a6), SPH_C32(0x087d78ea), SPH_C32(0x43802022), - SPH_C32(0x02f58bba), SPH_C32(0x80b4ead9), SPH_C32(0x053d0000), - SPH_C32(0xb2f10000), SPH_C32(0x721f0000), SPH_C32(0xebc9014f), - SPH_C32(0x6c9a484d), SPH_C32(0xdbd71fd1), SPH_C32(0xfa944127), - SPH_C32(0x29439ec6) }, - { SPH_C32(0xe8930000), SPH_C32(0x6c450000), SPH_C32(0x13e40000), - SPH_C32(0xfa9300a8), SPH_C32(0xa9e2ea61), SPH_C32(0x8bd58299), - SPH_C32(0xb100adb0), SPH_C32(0xef868b5c), SPH_C32(0x94280000), - SPH_C32(0x66c70000), SPH_C32(0xd6df0000), SPH_C32(0x87d7014b), - SPH_C32(0x875ae10b), SPH_C32(0xea56dac2), SPH_C32(0x64ff7996), - SPH_C32(0xb48f94ef) }, - { SPH_C32(0xebae0000), SPH_C32(0x64f60000), SPH_C32(0xe0de0000), - SPH_C32(0xc05100af), SPH_C32(0xf8cb6031), SPH_C32(0xe0bbe486), - SPH_C32(0xbfa56253), SPH_C32(0x095cf4a2), SPH_C32(0x3cf20000), - SPH_C32(0xf0790000), SPH_C32(0x8ac20000), SPH_C32(0x800d0149), - SPH_C32(0xfa3c7488), SPH_C32(0xf5ceaa48), SPH_C32(0xdf99f19e), - SPH_C32(0x6e0814ef) }, - { SPH_C32(0x40490000), SPH_C32(0xfafb0000), SPH_C32(0x4ff90000), - SPH_C32(0xfd4900aa), SPH_C32(0xd4847fe2), SPH_C32(0x944df213), - SPH_C32(0x0a6625b8), SPH_C32(0x35010b5c), SPH_C32(0x3fcf0000), - SPH_C32(0xf8ca0000), SPH_C32(0x79f80000), SPH_C32(0xbacf014e), - SPH_C32(0xab15fed8), SPH_C32(0x9ea0cc57), SPH_C32(0xd13c3e7d), - SPH_C32(0x88d26b11) }, - { SPH_C32(0x43740000), SPH_C32(0xf2480000), SPH_C32(0xbcc30000), - SPH_C32(0xc78b00ad), SPH_C32(0x85adf5b2), SPH_C32(0xff23940c), - SPH_C32(0x04c3ea5b), SPH_C32(0xd3db74a2), SPH_C32(0x97150000), - SPH_C32(0x6e740000), SPH_C32(0x25e50000), SPH_C32(0xbd15014c), - SPH_C32(0xd6736b5b), SPH_C32(0x8138bcdd), SPH_C32(0x6a5ab675), - SPH_C32(0x5255eb11) }, - { SPH_C32(0x24800000), SPH_C32(0x01410000), SPH_C32(0xea4b0000), - SPH_C32(0x07b000b3), SPH_C32(0xbba5c290), SPH_C32(0x7e8801f5), - SPH_C32(0x73e6aebc), SPH_C32(0x495bbb99), SPH_C32(0x95ff0000), - SPH_C32(0xfe0d0000), SPH_C32(0xe1580000), SPH_C32(0x62f80141), - SPH_C32(0x3127a59f), SPH_C32(0xff43f26b), SPH_C32(0x61c38617), - SPH_C32(0x59ea6d0a) }, - { SPH_C32(0x27bd0000), SPH_C32(0x09f20000), SPH_C32(0x19710000), - SPH_C32(0x3d7200b4), SPH_C32(0xea8c48c0), SPH_C32(0x15e667ea), - SPH_C32(0x7d43615f), SPH_C32(0xaf81c467), SPH_C32(0x3d250000), - SPH_C32(0x68b30000), SPH_C32(0xbd450000), SPH_C32(0x65220143), - SPH_C32(0x4c41301c), SPH_C32(0xe0db82e1), SPH_C32(0xdaa50e1f), - SPH_C32(0x836ded0a) }, - { SPH_C32(0x8c5a0000), SPH_C32(0x97ff0000), SPH_C32(0xb6560000), - SPH_C32(0x006a00b1), SPH_C32(0xc6c35713), SPH_C32(0x6110717f), - SPH_C32(0xc88026b4), SPH_C32(0x93dc3b99), SPH_C32(0x3e180000), - SPH_C32(0x60000000), SPH_C32(0x4e7f0000), SPH_C32(0x5fe00144), - SPH_C32(0x1d68ba4c), SPH_C32(0x8bb5e4fe), SPH_C32(0xd400c1fc), - SPH_C32(0x65b792f4) }, - { SPH_C32(0x8f670000), SPH_C32(0x9f4c0000), SPH_C32(0x456c0000), - SPH_C32(0x3aa800b6), SPH_C32(0x97eadd43), SPH_C32(0x0a7e1760), - SPH_C32(0xc625e957), SPH_C32(0x75064467), SPH_C32(0x96c20000), - SPH_C32(0xf6be0000), SPH_C32(0x12620000), SPH_C32(0x583a0146), - SPH_C32(0x600e2fcf), SPH_C32(0x942d9474), SPH_C32(0x6f6649f4), - SPH_C32(0xbf3012f4) }, - { SPH_C32(0x25130000), SPH_C32(0xe6c30000), SPH_C32(0x07b00000), - SPH_C32(0xc8bc00b8), SPH_C32(0x36754fc8), SPH_C32(0xc22bb5db), - SPH_C32(0x75d0cf5d), SPH_C32(0x1a3425e2), SPH_C32(0x07d70000), - SPH_C32(0x22880000), SPH_C32(0xb6a20000), SPH_C32(0x34240142), - SPH_C32(0x8bce8689), SPH_C32(0xa5ac5167), SPH_C32(0xf10d7145), - SPH_C32(0x22fc18dd) }, - { SPH_C32(0x262e0000), SPH_C32(0xee700000), SPH_C32(0xf48a0000), - SPH_C32(0xf27e00bf), SPH_C32(0x675cc598), SPH_C32(0xa945d3c4), - SPH_C32(0x7b7500be), SPH_C32(0xfcee5a1c), SPH_C32(0xaf0d0000), - SPH_C32(0xb4360000), SPH_C32(0xeabf0000), SPH_C32(0x33fe0140), - SPH_C32(0xf6a8130a), SPH_C32(0xba3421ed), SPH_C32(0x4a6bf94d), - SPH_C32(0xf87b98dd) }, - { SPH_C32(0x8dc90000), SPH_C32(0x707d0000), SPH_C32(0x5bad0000), - SPH_C32(0xcf6600ba), SPH_C32(0x4b13da4b), SPH_C32(0xddb3c551), - SPH_C32(0xceb64755), SPH_C32(0xc0b3a5e2), SPH_C32(0xac300000), - SPH_C32(0xbc850000), SPH_C32(0x19850000), SPH_C32(0x093c0147), - SPH_C32(0xa781995a), SPH_C32(0xd15a47f2), SPH_C32(0x44ce36ae), - SPH_C32(0x1ea1e723) }, - { SPH_C32(0x8ef40000), SPH_C32(0x78ce0000), SPH_C32(0xa8970000), - SPH_C32(0xf5a400bd), SPH_C32(0x1a3a501b), SPH_C32(0xb6dda34e), - SPH_C32(0xc01388b6), SPH_C32(0x2669da1c), SPH_C32(0x04ea0000), - SPH_C32(0x2a3b0000), SPH_C32(0x45980000), SPH_C32(0x0ee60145), - SPH_C32(0xdae70cd9), SPH_C32(0xcec23778), SPH_C32(0xffa8bea6), - SPH_C32(0xc4266723) }, - { SPH_C32(0xb6a80000), SPH_C32(0xddc40000), SPH_C32(0xbdb10000), - SPH_C32(0x516c00b0), SPH_C32(0x014ce186), SPH_C32(0x2467a2f9), - SPH_C32(0xe32859ee), SPH_C32(0x324dce4e), SPH_C32(0x06440000), - SPH_C32(0xc50a0000), SPH_C32(0x5b590000), SPH_C32(0xfb280149), - SPH_C32(0x061e0bd1), SPH_C32(0x190fe549), SPH_C32(0xf73b10a4), - SPH_C32(0x719386a6) }, - { SPH_C32(0xb5950000), SPH_C32(0xd5770000), SPH_C32(0x4e8b0000), - SPH_C32(0x6bae00b7), SPH_C32(0x50656bd6), SPH_C32(0x4f09c4e6), - SPH_C32(0xed8d960d), SPH_C32(0xd497b1b0), SPH_C32(0xae9e0000), - SPH_C32(0x53b40000), SPH_C32(0x07440000), SPH_C32(0xfcf2014b), - SPH_C32(0x7b789e52), SPH_C32(0x069795c3), SPH_C32(0x4c5d98ac), - SPH_C32(0xab1406a6) }, - { SPH_C32(0x1e720000), SPH_C32(0x4b7a0000), SPH_C32(0xe1ac0000), - SPH_C32(0x56b600b2), SPH_C32(0x7c2a7405), SPH_C32(0x3bffd273), - SPH_C32(0x584ed1e6), SPH_C32(0xe8ca4e4e), SPH_C32(0xada30000), - SPH_C32(0x5b070000), SPH_C32(0xf47e0000), SPH_C32(0xc630014c), - SPH_C32(0x2a511402), SPH_C32(0x6df9f3dc), SPH_C32(0x42f8574f), - SPH_C32(0x4dce7958) }, - { SPH_C32(0x1d4f0000), SPH_C32(0x43c90000), SPH_C32(0x12960000), - SPH_C32(0x6c7400b5), SPH_C32(0x2d03fe55), SPH_C32(0x5091b46c), - SPH_C32(0x56eb1e05), SPH_C32(0x0e1031b0), SPH_C32(0x05790000), - SPH_C32(0xcdb90000), SPH_C32(0xa8630000), SPH_C32(0xc1ea014e), - SPH_C32(0x57378181), SPH_C32(0x72618356), SPH_C32(0xf99edf47), - SPH_C32(0x9749f958) }, - { SPH_C32(0xb73b0000), SPH_C32(0x3a460000), SPH_C32(0x504a0000), - SPH_C32(0x9e6000bb), SPH_C32(0x8c9c6cde), SPH_C32(0x98c416d7), - SPH_C32(0xe51e380f), SPH_C32(0x61225035), SPH_C32(0x946c0000), - SPH_C32(0x198f0000), SPH_C32(0x0ca30000), SPH_C32(0xadf4014a), - SPH_C32(0xbcf728c7), SPH_C32(0x43e04645), SPH_C32(0x67f5e7f6), - SPH_C32(0x0a85f371) }, - { SPH_C32(0xb4060000), SPH_C32(0x32f50000), SPH_C32(0xa3700000), - SPH_C32(0xa4a200bc), SPH_C32(0xddb5e68e), SPH_C32(0xf3aa70c8), - SPH_C32(0xebbbf7ec), SPH_C32(0x87f82fcb), SPH_C32(0x3cb60000), - SPH_C32(0x8f310000), SPH_C32(0x50be0000), SPH_C32(0xaa2e0148), - SPH_C32(0xc191bd44), SPH_C32(0x5c7836cf), SPH_C32(0xdc936ffe), - SPH_C32(0xd0027371) }, - { SPH_C32(0x1fe10000), SPH_C32(0xacf80000), SPH_C32(0x0c570000), - SPH_C32(0x99ba00b9), SPH_C32(0xf1faf95d), SPH_C32(0x875c665d), - SPH_C32(0x5e78b007), SPH_C32(0xbba5d035), SPH_C32(0x3f8b0000), - SPH_C32(0x87820000), SPH_C32(0xa3840000), SPH_C32(0x90ec014f), - SPH_C32(0x90b83714), SPH_C32(0x371650d0), SPH_C32(0xd236a01d), - SPH_C32(0x36d80c8f) }, - { SPH_C32(0x1cdc0000), SPH_C32(0xa44b0000), SPH_C32(0xff6d0000), - SPH_C32(0xa37800be), SPH_C32(0xa0d3730d), SPH_C32(0xec320042), - SPH_C32(0x50dd7fe4), SPH_C32(0x5d7fafcb), SPH_C32(0x97510000), - SPH_C32(0x113c0000), SPH_C32(0xff990000), SPH_C32(0x9736014d), - SPH_C32(0xeddea297), SPH_C32(0x288e205a), SPH_C32(0x69502815), - SPH_C32(0xec5f8c8f) }, - { SPH_C32(0x7b6c0000), SPH_C32(0x280a0000), SPH_C32(0x73990000), - SPH_C32(0x496000a1), SPH_C32(0xa5768de3), SPH_C32(0xc42f093c), - SPH_C32(0x24f2a563), SPH_C32(0x79f5076e), SPH_C32(0xca570000), - SPH_C32(0xa80e0000), SPH_C32(0xa2f60000), SPH_C32(0x060b0152), - SPH_C32(0x14592320), SPH_C32(0xec526625), SPH_C32(0x35dd13a8), - SPH_C32(0xd74eb663) }, - { SPH_C32(0x78510000), SPH_C32(0x20b90000), SPH_C32(0x80a30000), - SPH_C32(0x73a200a6), SPH_C32(0xf45f07b3), SPH_C32(0xaf416f23), - SPH_C32(0x2a576a80), SPH_C32(0x9f2f7890), SPH_C32(0x628d0000), - SPH_C32(0x3eb00000), SPH_C32(0xfeeb0000), SPH_C32(0x01d10150), - SPH_C32(0x693fb6a3), SPH_C32(0xf3ca16af), SPH_C32(0x8ebb9ba0), - SPH_C32(0x0dc93663) }, - { SPH_C32(0xd3b60000), SPH_C32(0xbeb40000), SPH_C32(0x2f840000), - SPH_C32(0x4eba00a3), SPH_C32(0xd8101860), SPH_C32(0xdbb779b6), - SPH_C32(0x9f942d6b), SPH_C32(0xa372876e), SPH_C32(0x61b00000), - SPH_C32(0x36030000), SPH_C32(0x0dd10000), SPH_C32(0x3b130157), - SPH_C32(0x38163cf3), SPH_C32(0x98a470b0), SPH_C32(0x801e5443), - SPH_C32(0xeb13499d) }, - { SPH_C32(0xd08b0000), SPH_C32(0xb6070000), SPH_C32(0xdcbe0000), - SPH_C32(0x747800a4), SPH_C32(0x89399230), SPH_C32(0xb0d91fa9), - SPH_C32(0x9131e288), SPH_C32(0x45a8f890), SPH_C32(0xc96a0000), - SPH_C32(0xa0bd0000), SPH_C32(0x51cc0000), SPH_C32(0x3cc90155), - SPH_C32(0x4570a970), SPH_C32(0x873c003a), SPH_C32(0x3b78dc4b), - SPH_C32(0x3194c99d) }, - { SPH_C32(0x7aff0000), SPH_C32(0xcf880000), SPH_C32(0x9e620000), - SPH_C32(0x866c00aa), SPH_C32(0x28a600bb), SPH_C32(0x788cbd12), - SPH_C32(0x22c4c482), SPH_C32(0x2a9a9915), SPH_C32(0x587f0000), - SPH_C32(0x748b0000), SPH_C32(0xf50c0000), SPH_C32(0x50d70151), - SPH_C32(0xaeb00036), SPH_C32(0xb6bdc529), SPH_C32(0xa513e4fa), - SPH_C32(0xac58c3b4) }, - { SPH_C32(0x79c20000), SPH_C32(0xc73b0000), SPH_C32(0x6d580000), - SPH_C32(0xbcae00ad), SPH_C32(0x798f8aeb), SPH_C32(0x13e2db0d), - SPH_C32(0x2c610b61), SPH_C32(0xcc40e6eb), SPH_C32(0xf0a50000), - SPH_C32(0xe2350000), SPH_C32(0xa9110000), SPH_C32(0x570d0153), - SPH_C32(0xd3d695b5), SPH_C32(0xa925b5a3), SPH_C32(0x1e756cf2), - SPH_C32(0x76df43b4) }, - { SPH_C32(0xd2250000), SPH_C32(0x59360000), SPH_C32(0xc27f0000), - SPH_C32(0x81b600a8), SPH_C32(0x55c09538), SPH_C32(0x6714cd98), - SPH_C32(0x99a24c8a), SPH_C32(0xf01d1915), SPH_C32(0xf3980000), - SPH_C32(0xea860000), SPH_C32(0x5a2b0000), SPH_C32(0x6dcf0154), - SPH_C32(0x82ff1fe5), SPH_C32(0xc24bd3bc), SPH_C32(0x10d0a311), - SPH_C32(0x90053c4a) }, - { SPH_C32(0xd1180000), SPH_C32(0x51850000), SPH_C32(0x31450000), - SPH_C32(0xbb7400af), SPH_C32(0x04e91f68), SPH_C32(0x0c7aab87), - SPH_C32(0x97078369), SPH_C32(0x16c766eb), SPH_C32(0x5b420000), - SPH_C32(0x7c380000), SPH_C32(0x06360000), SPH_C32(0x6a150156), - SPH_C32(0xff998a66), SPH_C32(0xddd3a336), SPH_C32(0xabb62b19), - SPH_C32(0x4a82bc4a) }, - { SPH_C32(0xe9440000), SPH_C32(0xf48f0000), SPH_C32(0x24630000), - SPH_C32(0x1fbc00a2), SPH_C32(0x1f9faef5), SPH_C32(0x9ec0aa30), - SPH_C32(0xb43c5231), SPH_C32(0x02e372b9), SPH_C32(0x59ec0000), - SPH_C32(0x93090000), SPH_C32(0x18f70000), SPH_C32(0x9fdb015a), - SPH_C32(0x23608d6e), SPH_C32(0x0a1e7107), SPH_C32(0xa325851b), - SPH_C32(0xff375dcf) }, - { SPH_C32(0xea790000), SPH_C32(0xfc3c0000), SPH_C32(0xd7590000), - SPH_C32(0x257e00a5), SPH_C32(0x4eb624a5), SPH_C32(0xf5aecc2f), - SPH_C32(0xba999dd2), SPH_C32(0xe4390d47), SPH_C32(0xf1360000), - SPH_C32(0x05b70000), SPH_C32(0x44ea0000), SPH_C32(0x98010158), - SPH_C32(0x5e0618ed), SPH_C32(0x1586018d), SPH_C32(0x18430d13), - SPH_C32(0x25b0ddcf) }, - { SPH_C32(0x419e0000), SPH_C32(0x62310000), SPH_C32(0x787e0000), - SPH_C32(0x186600a0), SPH_C32(0x62f93b76), SPH_C32(0x8158daba), - SPH_C32(0x0f5ada39), SPH_C32(0xd864f2b9), SPH_C32(0xf20b0000), - SPH_C32(0x0d040000), SPH_C32(0xb7d00000), SPH_C32(0xa2c3015f), - SPH_C32(0x0f2f92bd), SPH_C32(0x7ee86792), SPH_C32(0x16e6c2f0), - SPH_C32(0xc36aa231) }, - { SPH_C32(0x42a30000), SPH_C32(0x6a820000), SPH_C32(0x8b440000), - SPH_C32(0x22a400a7), SPH_C32(0x33d0b126), SPH_C32(0xea36bca5), - SPH_C32(0x01ff15da), SPH_C32(0x3ebe8d47), SPH_C32(0x5ad10000), - SPH_C32(0x9bba0000), SPH_C32(0xebcd0000), SPH_C32(0xa519015d), - SPH_C32(0x7249073e), SPH_C32(0x61701718), SPH_C32(0xad804af8), - SPH_C32(0x19ed2231) }, - { SPH_C32(0xe8d70000), SPH_C32(0x130d0000), SPH_C32(0xc9980000), - SPH_C32(0xd0b000a9), SPH_C32(0x924f23ad), SPH_C32(0x22631e1e), - SPH_C32(0xb20a33d0), SPH_C32(0x518cecc2), SPH_C32(0xcbc40000), - SPH_C32(0x4f8c0000), SPH_C32(0x4f0d0000), SPH_C32(0xc9070159), - SPH_C32(0x9989ae78), SPH_C32(0x50f1d20b), SPH_C32(0x33eb7249), - SPH_C32(0x84212818) }, - { SPH_C32(0xebea0000), SPH_C32(0x1bbe0000), SPH_C32(0x3aa20000), - SPH_C32(0xea7200ae), SPH_C32(0xc366a9fd), SPH_C32(0x490d7801), - SPH_C32(0xbcaffc33), SPH_C32(0xb756933c), SPH_C32(0x631e0000), - SPH_C32(0xd9320000), SPH_C32(0x13100000), SPH_C32(0xcedd015b), - SPH_C32(0xe4ef3bfb), SPH_C32(0x4f69a281), SPH_C32(0x888dfa41), - SPH_C32(0x5ea6a818) }, - { SPH_C32(0x400d0000), SPH_C32(0x85b30000), SPH_C32(0x95850000), - SPH_C32(0xd76a00ab), SPH_C32(0xef29b62e), SPH_C32(0x3dfb6e94), - SPH_C32(0x096cbbd8), SPH_C32(0x8b0b6cc2), SPH_C32(0x60230000), - SPH_C32(0xd1810000), SPH_C32(0xe02a0000), SPH_C32(0xf41f015c), - SPH_C32(0xb5c6b1ab), SPH_C32(0x2407c49e), SPH_C32(0x862835a2), - SPH_C32(0xb87cd7e6) }, - { SPH_C32(0x43300000), SPH_C32(0x8d000000), SPH_C32(0x66bf0000), - SPH_C32(0xeda800ac), SPH_C32(0xbe003c7e), SPH_C32(0x5695088b), - SPH_C32(0x07c9743b), SPH_C32(0x6dd1133c), SPH_C32(0xc8f90000), - SPH_C32(0x473f0000), SPH_C32(0xbc370000), SPH_C32(0xf3c5015e), - SPH_C32(0xc8a02428), SPH_C32(0x3b9fb414), SPH_C32(0x3d4ebdaa), - SPH_C32(0x62fb57e6) }, - { SPH_C32(0x24c40000), SPH_C32(0x7e090000), SPH_C32(0x30370000), - SPH_C32(0x2d9300b2), SPH_C32(0x80080b5c), SPH_C32(0xd73e9d72), - SPH_C32(0x70ec30dc), SPH_C32(0xf751dc07), SPH_C32(0xca130000), - SPH_C32(0xd7460000), SPH_C32(0x788a0000), SPH_C32(0x2c280153), - SPH_C32(0x2ff4eaec), SPH_C32(0x45e4faa2), SPH_C32(0x36d78dc8), - SPH_C32(0x6944d1fd) }, - { SPH_C32(0x27f90000), SPH_C32(0x76ba0000), SPH_C32(0xc30d0000), - SPH_C32(0x175100b5), SPH_C32(0xd121810c), SPH_C32(0xbc50fb6d), - SPH_C32(0x7e49ff3f), SPH_C32(0x118ba3f9), SPH_C32(0x62c90000), - SPH_C32(0x41f80000), SPH_C32(0x24970000), SPH_C32(0x2bf20151), - SPH_C32(0x52927f6f), SPH_C32(0x5a7c8a28), SPH_C32(0x8db105c0), - SPH_C32(0xb3c351fd) }, - { SPH_C32(0x8c1e0000), SPH_C32(0xe8b70000), SPH_C32(0x6c2a0000), - SPH_C32(0x2a4900b0), SPH_C32(0xfd6e9edf), SPH_C32(0xc8a6edf8), - SPH_C32(0xcb8ab8d4), SPH_C32(0x2dd65c07), SPH_C32(0x61f40000), - SPH_C32(0x494b0000), SPH_C32(0xd7ad0000), SPH_C32(0x11300156), - SPH_C32(0x03bbf53f), SPH_C32(0x3112ec37), SPH_C32(0x8314ca23), - SPH_C32(0x55192e03) }, - { SPH_C32(0x8f230000), SPH_C32(0xe0040000), SPH_C32(0x9f100000), - SPH_C32(0x108b00b7), SPH_C32(0xac47148f), SPH_C32(0xa3c88be7), - SPH_C32(0xc52f7737), SPH_C32(0xcb0c23f9), SPH_C32(0xc92e0000), - SPH_C32(0xdff50000), SPH_C32(0x8bb00000), SPH_C32(0x16ea0154), - SPH_C32(0x7edd60bc), SPH_C32(0x2e8a9cbd), SPH_C32(0x3872422b), - SPH_C32(0x8f9eae03) }, - { SPH_C32(0x25570000), SPH_C32(0x998b0000), SPH_C32(0xddcc0000), - SPH_C32(0xe29f00b9), SPH_C32(0x0dd88604), SPH_C32(0x6b9d295c), - SPH_C32(0x76da513d), SPH_C32(0xa43e427c), SPH_C32(0x583b0000), - SPH_C32(0x0bc30000), SPH_C32(0x2f700000), SPH_C32(0x7af40150), - SPH_C32(0x951dc9fa), SPH_C32(0x1f0b59ae), SPH_C32(0xa6197a9a), - SPH_C32(0x1252a42a) }, - { SPH_C32(0x266a0000), SPH_C32(0x91380000), SPH_C32(0x2ef60000), - SPH_C32(0xd85d00be), SPH_C32(0x5cf10c54), SPH_C32(0x00f34f43), - SPH_C32(0x787f9ede), SPH_C32(0x42e43d82), SPH_C32(0xf0e10000), - SPH_C32(0x9d7d0000), SPH_C32(0x736d0000), SPH_C32(0x7d2e0152), - SPH_C32(0xe87b5c79), SPH_C32(0x00932924), SPH_C32(0x1d7ff292), - SPH_C32(0xc8d5242a) }, - { SPH_C32(0x8d8d0000), SPH_C32(0x0f350000), SPH_C32(0x81d10000), - SPH_C32(0xe54500bb), SPH_C32(0x70be1387), SPH_C32(0x740559d6), - SPH_C32(0xcdbcd935), SPH_C32(0x7eb9c27c), SPH_C32(0xf3dc0000), - SPH_C32(0x95ce0000), SPH_C32(0x80570000), SPH_C32(0x47ec0155), - SPH_C32(0xb952d629), SPH_C32(0x6bfd4f3b), SPH_C32(0x13da3d71), - SPH_C32(0x2e0f5bd4) }, - { SPH_C32(0x8eb00000), SPH_C32(0x07860000), SPH_C32(0x72eb0000), - SPH_C32(0xdf8700bc), SPH_C32(0x219799d7), SPH_C32(0x1f6b3fc9), - SPH_C32(0xc31916d6), SPH_C32(0x9863bd82), SPH_C32(0x5b060000), - SPH_C32(0x03700000), SPH_C32(0xdc4a0000), SPH_C32(0x40360157), - SPH_C32(0xc43443aa), SPH_C32(0x74653fb1), SPH_C32(0xa8bcb579), - SPH_C32(0xf488dbd4) }, - { SPH_C32(0xb6ec0000), SPH_C32(0xa28c0000), SPH_C32(0x67cd0000), - SPH_C32(0x7b4f00b1), SPH_C32(0x3ae1284a), SPH_C32(0x8dd13e7e), - SPH_C32(0xe022c78e), SPH_C32(0x8c47a9d0), SPH_C32(0x59a80000), - SPH_C32(0xec410000), SPH_C32(0xc28b0000), SPH_C32(0xb5f8015b), - SPH_C32(0x18cd44a2), SPH_C32(0xa3a8ed80), SPH_C32(0xa02f1b7b), - SPH_C32(0x413d3a51) }, - { SPH_C32(0xb5d10000), SPH_C32(0xaa3f0000), SPH_C32(0x94f70000), - SPH_C32(0x418d00b6), SPH_C32(0x6bc8a21a), SPH_C32(0xe6bf5861), - SPH_C32(0xee87086d), SPH_C32(0x6a9dd62e), SPH_C32(0xf1720000), - SPH_C32(0x7aff0000), SPH_C32(0x9e960000), SPH_C32(0xb2220159), - SPH_C32(0x65abd121), SPH_C32(0xbc309d0a), SPH_C32(0x1b499373), - SPH_C32(0x9bbaba51) }, - { SPH_C32(0x1e360000), SPH_C32(0x34320000), SPH_C32(0x3bd00000), - SPH_C32(0x7c9500b3), SPH_C32(0x4787bdc9), SPH_C32(0x92494ef4), - SPH_C32(0x5b444f86), SPH_C32(0x56c029d0), SPH_C32(0xf24f0000), - SPH_C32(0x724c0000), SPH_C32(0x6dac0000), SPH_C32(0x88e0015e), - SPH_C32(0x34825b71), SPH_C32(0xd75efb15), SPH_C32(0x15ec5c90), - SPH_C32(0x7d60c5af) }, - { SPH_C32(0x1d0b0000), SPH_C32(0x3c810000), SPH_C32(0xc8ea0000), - SPH_C32(0x465700b4), SPH_C32(0x16ae3799), SPH_C32(0xf92728eb), - SPH_C32(0x55e18065), SPH_C32(0xb01a562e), SPH_C32(0x5a950000), - SPH_C32(0xe4f20000), SPH_C32(0x31b10000), SPH_C32(0x8f3a015c), - SPH_C32(0x49e4cef2), SPH_C32(0xc8c68b9f), SPH_C32(0xae8ad498), - SPH_C32(0xa7e745af) }, - { SPH_C32(0xb77f0000), SPH_C32(0x450e0000), SPH_C32(0x8a360000), - SPH_C32(0xb44300ba), SPH_C32(0xb731a512), SPH_C32(0x31728a50), - SPH_C32(0xe614a66f), SPH_C32(0xdf2837ab), SPH_C32(0xcb800000), - SPH_C32(0x30c40000), SPH_C32(0x95710000), SPH_C32(0xe3240158), - SPH_C32(0xa22467b4), SPH_C32(0xf9474e8c), SPH_C32(0x30e1ec29), - SPH_C32(0x3a2b4f86) }, - { SPH_C32(0xb4420000), SPH_C32(0x4dbd0000), SPH_C32(0x790c0000), - SPH_C32(0x8e8100bd), SPH_C32(0xe6182f42), SPH_C32(0x5a1cec4f), - SPH_C32(0xe8b1698c), SPH_C32(0x39f24855), SPH_C32(0x635a0000), - SPH_C32(0xa67a0000), SPH_C32(0xc96c0000), SPH_C32(0xe4fe015a), - SPH_C32(0xdf42f237), SPH_C32(0xe6df3e06), SPH_C32(0x8b876421), - SPH_C32(0xe0accf86) }, - { SPH_C32(0x1fa50000), SPH_C32(0xd3b00000), SPH_C32(0xd62b0000), - SPH_C32(0xb39900b8), SPH_C32(0xca573091), SPH_C32(0x2eeafada), - SPH_C32(0x5d722e67), SPH_C32(0x05afb7ab), SPH_C32(0x60670000), - SPH_C32(0xaec90000), SPH_C32(0x3a560000), SPH_C32(0xde3c015d), - SPH_C32(0x8e6b7867), SPH_C32(0x8db15819), SPH_C32(0x8522abc2), - SPH_C32(0x0676b078) }, - { SPH_C32(0x1c980000), SPH_C32(0xdb030000), SPH_C32(0x25110000), - SPH_C32(0x895b00bf), SPH_C32(0x9b7ebac1), SPH_C32(0x45849cc5), - SPH_C32(0x53d7e184), SPH_C32(0xe375c855), SPH_C32(0xc8bd0000), - SPH_C32(0x38770000), SPH_C32(0x664b0000), SPH_C32(0xd9e6015f), - SPH_C32(0xf30dede4), SPH_C32(0x92292893), SPH_C32(0x3e4423ca), - SPH_C32(0xdcf13078) }, - { SPH_C32(0x95bb0000), SPH_C32(0x81450000), SPH_C32(0x3b240000), - SPH_C32(0x48db0140), SPH_C32(0x0a8a6c53), SPH_C32(0x56f56eec), - SPH_C32(0x62c91877), SPH_C32(0xe7e00a94), SPH_C32(0xee930000), - SPH_C32(0xd6070000), SPH_C32(0x92c10000), SPH_C32(0x2b9801e0), - SPH_C32(0x9451287c), SPH_C32(0x3b6cfb57), SPH_C32(0x45312374), - SPH_C32(0x201f6a64) }, - { SPH_C32(0x96860000), SPH_C32(0x89f60000), SPH_C32(0xc81e0000), - SPH_C32(0x72190147), SPH_C32(0x5ba3e603), SPH_C32(0x3d9b08f3), - SPH_C32(0x6c6cd794), SPH_C32(0x013a756a), SPH_C32(0x46490000), - SPH_C32(0x40b90000), SPH_C32(0xcedc0000), SPH_C32(0x2c4201e2), - SPH_C32(0xe937bdff), SPH_C32(0x24f48bdd), SPH_C32(0xfe57ab7c), - SPH_C32(0xfa98ea64) }, - { SPH_C32(0x3d610000), SPH_C32(0x17fb0000), SPH_C32(0x67390000), - SPH_C32(0x4f010142), SPH_C32(0x77ecf9d0), SPH_C32(0x496d1e66), - SPH_C32(0xd9af907f), SPH_C32(0x3d678a94), SPH_C32(0x45740000), - SPH_C32(0x480a0000), SPH_C32(0x3de60000), SPH_C32(0x168001e5), - SPH_C32(0xb81e37af), SPH_C32(0x4f9aedc2), SPH_C32(0xf0f2649f), - SPH_C32(0x1c42959a) }, - { SPH_C32(0x3e5c0000), SPH_C32(0x1f480000), SPH_C32(0x94030000), - SPH_C32(0x75c30145), SPH_C32(0x26c57380), SPH_C32(0x22037879), - SPH_C32(0xd70a5f9c), SPH_C32(0xdbbdf56a), SPH_C32(0xedae0000), - SPH_C32(0xdeb40000), SPH_C32(0x61fb0000), SPH_C32(0x115a01e7), - SPH_C32(0xc578a22c), SPH_C32(0x50029d48), SPH_C32(0x4b94ec97), - SPH_C32(0xc6c5159a) }, - { SPH_C32(0x94280000), SPH_C32(0x66c70000), SPH_C32(0xd6df0000), - SPH_C32(0x87d7014b), SPH_C32(0x875ae10b), SPH_C32(0xea56dac2), - SPH_C32(0x64ff7996), SPH_C32(0xb48f94ef), SPH_C32(0x7cbb0000), - SPH_C32(0x0a820000), SPH_C32(0xc53b0000), SPH_C32(0x7d4401e3), - SPH_C32(0x2eb80b6a), SPH_C32(0x6183585b), SPH_C32(0xd5ffd426), - SPH_C32(0x5b091fb3) }, - { SPH_C32(0x97150000), SPH_C32(0x6e740000), SPH_C32(0x25e50000), - SPH_C32(0xbd15014c), SPH_C32(0xd6736b5b), SPH_C32(0x8138bcdd), - SPH_C32(0x6a5ab675), SPH_C32(0x5255eb11), SPH_C32(0xd4610000), - SPH_C32(0x9c3c0000), SPH_C32(0x99260000), SPH_C32(0x7a9e01e1), - SPH_C32(0x53de9ee9), SPH_C32(0x7e1b28d1), SPH_C32(0x6e995c2e), - SPH_C32(0x818e9fb3) }, - { SPH_C32(0x3cf20000), SPH_C32(0xf0790000), SPH_C32(0x8ac20000), - SPH_C32(0x800d0149), SPH_C32(0xfa3c7488), SPH_C32(0xf5ceaa48), - SPH_C32(0xdf99f19e), SPH_C32(0x6e0814ef), SPH_C32(0xd75c0000), - SPH_C32(0x948f0000), SPH_C32(0x6a1c0000), SPH_C32(0x405c01e6), - SPH_C32(0x02f714b9), SPH_C32(0x15754ece), SPH_C32(0x603c93cd), - SPH_C32(0x6754e04d) }, - { SPH_C32(0x3fcf0000), SPH_C32(0xf8ca0000), SPH_C32(0x79f80000), - SPH_C32(0xbacf014e), SPH_C32(0xab15fed8), SPH_C32(0x9ea0cc57), - SPH_C32(0xd13c3e7d), SPH_C32(0x88d26b11), SPH_C32(0x7f860000), - SPH_C32(0x02310000), SPH_C32(0x36010000), SPH_C32(0x478601e4), - SPH_C32(0x7f91813a), SPH_C32(0x0aed3e44), SPH_C32(0xdb5a1bc5), - SPH_C32(0xbdd3604d) }, - { SPH_C32(0x07930000), SPH_C32(0x5dc00000), SPH_C32(0x6cde0000), - SPH_C32(0x1e070143), SPH_C32(0xb0634f45), SPH_C32(0x0c1acde0), - SPH_C32(0xf207ef25), SPH_C32(0x9cf67f43), SPH_C32(0x7d280000), - SPH_C32(0xed000000), SPH_C32(0x28c00000), SPH_C32(0xb24801e8), - SPH_C32(0xa3688632), SPH_C32(0xdd20ec75), SPH_C32(0xd3c9b5c7), - SPH_C32(0x086681c8) }, - { SPH_C32(0x04ae0000), SPH_C32(0x55730000), SPH_C32(0x9fe40000), - SPH_C32(0x24c50144), SPH_C32(0xe14ac515), SPH_C32(0x6774abff), - SPH_C32(0xfca220c6), SPH_C32(0x7a2c00bd), SPH_C32(0xd5f20000), - SPH_C32(0x7bbe0000), SPH_C32(0x74dd0000), SPH_C32(0xb59201ea), - SPH_C32(0xde0e13b1), SPH_C32(0xc2b89cff), SPH_C32(0x68af3dcf), - SPH_C32(0xd2e101c8) }, - { SPH_C32(0xaf490000), SPH_C32(0xcb7e0000), SPH_C32(0x30c30000), - SPH_C32(0x19dd0141), SPH_C32(0xcd05dac6), SPH_C32(0x1382bd6a), - SPH_C32(0x4961672d), SPH_C32(0x4671ff43), SPH_C32(0xd6cf0000), - SPH_C32(0x730d0000), SPH_C32(0x87e70000), SPH_C32(0x8f5001ed), - SPH_C32(0x8f2799e1), SPH_C32(0xa9d6fae0), SPH_C32(0x660af22c), - SPH_C32(0x343b7e36) }, - { SPH_C32(0xac740000), SPH_C32(0xc3cd0000), SPH_C32(0xc3f90000), - SPH_C32(0x231f0146), SPH_C32(0x9c2c5096), SPH_C32(0x78ecdb75), - SPH_C32(0x47c4a8ce), SPH_C32(0xa0ab80bd), SPH_C32(0x7e150000), - SPH_C32(0xe5b30000), SPH_C32(0xdbfa0000), SPH_C32(0x888a01ef), - SPH_C32(0xf2410c62), SPH_C32(0xb64e8a6a), SPH_C32(0xdd6c7a24), - SPH_C32(0xeebcfe36) }, - { SPH_C32(0x06000000), SPH_C32(0xba420000), SPH_C32(0x81250000), - SPH_C32(0xd10b0148), SPH_C32(0x3db3c21d), SPH_C32(0xb0b979ce), - SPH_C32(0xf4318ec4), SPH_C32(0xcf99e138), SPH_C32(0xef000000), - SPH_C32(0x31850000), SPH_C32(0x7f3a0000), SPH_C32(0xe49401eb), - SPH_C32(0x1981a524), SPH_C32(0x87cf4f79), SPH_C32(0x43074295), - SPH_C32(0x7370f41f) }, - { SPH_C32(0x053d0000), SPH_C32(0xb2f10000), SPH_C32(0x721f0000), - SPH_C32(0xebc9014f), SPH_C32(0x6c9a484d), SPH_C32(0xdbd71fd1), - SPH_C32(0xfa944127), SPH_C32(0x29439ec6), SPH_C32(0x47da0000), - SPH_C32(0xa73b0000), SPH_C32(0x23270000), SPH_C32(0xe34e01e9), - SPH_C32(0x64e730a7), SPH_C32(0x98573ff3), SPH_C32(0xf861ca9d), - SPH_C32(0xa9f7741f) }, - { SPH_C32(0xaeda0000), SPH_C32(0x2cfc0000), SPH_C32(0xdd380000), - SPH_C32(0xd6d1014a), SPH_C32(0x40d5579e), SPH_C32(0xaf210944), - SPH_C32(0x4f5706cc), SPH_C32(0x151e6138), SPH_C32(0x44e70000), - SPH_C32(0xaf880000), SPH_C32(0xd01d0000), SPH_C32(0xd98c01ee), - SPH_C32(0x35cebaf7), SPH_C32(0xf33959ec), SPH_C32(0xf6c4057e), - SPH_C32(0x4f2d0be1) }, - { SPH_C32(0xade70000), SPH_C32(0x244f0000), SPH_C32(0x2e020000), - SPH_C32(0xec13014d), SPH_C32(0x11fcddce), SPH_C32(0xc44f6f5b), - SPH_C32(0x41f2c92f), SPH_C32(0xf3c41ec6), SPH_C32(0xec3d0000), - SPH_C32(0x39360000), SPH_C32(0x8c000000), SPH_C32(0xde5601ec), - SPH_C32(0x48a82f74), SPH_C32(0xeca12966), SPH_C32(0x4da28d76), - SPH_C32(0x95aa8be1) }, - { SPH_C32(0xca130000), SPH_C32(0xd7460000), SPH_C32(0x788a0000), - SPH_C32(0x2c280153), SPH_C32(0x2ff4eaec), SPH_C32(0x45e4faa2), - SPH_C32(0x36d78dc8), SPH_C32(0x6944d1fd), SPH_C32(0xeed70000), - SPH_C32(0xa94f0000), SPH_C32(0x48bd0000), SPH_C32(0x01bb01e1), - SPH_C32(0xaffce1b0), SPH_C32(0x92da67d0), SPH_C32(0x463bbd14), - SPH_C32(0x9e150dfa) }, - { SPH_C32(0xc92e0000), SPH_C32(0xdff50000), SPH_C32(0x8bb00000), - SPH_C32(0x16ea0154), SPH_C32(0x7edd60bc), SPH_C32(0x2e8a9cbd), - SPH_C32(0x3872422b), SPH_C32(0x8f9eae03), SPH_C32(0x460d0000), - SPH_C32(0x3ff10000), SPH_C32(0x14a00000), SPH_C32(0x066101e3), - SPH_C32(0xd29a7433), SPH_C32(0x8d42175a), SPH_C32(0xfd5d351c), - SPH_C32(0x44928dfa) }, - { SPH_C32(0x62c90000), SPH_C32(0x41f80000), SPH_C32(0x24970000), - SPH_C32(0x2bf20151), SPH_C32(0x52927f6f), SPH_C32(0x5a7c8a28), - SPH_C32(0x8db105c0), SPH_C32(0xb3c351fd), SPH_C32(0x45300000), - SPH_C32(0x37420000), SPH_C32(0xe79a0000), SPH_C32(0x3ca301e4), - SPH_C32(0x83b3fe63), SPH_C32(0xe62c7145), SPH_C32(0xf3f8faff), - SPH_C32(0xa248f204) }, - { SPH_C32(0x61f40000), SPH_C32(0x494b0000), SPH_C32(0xd7ad0000), - SPH_C32(0x11300156), SPH_C32(0x03bbf53f), SPH_C32(0x3112ec37), - SPH_C32(0x8314ca23), SPH_C32(0x55192e03), SPH_C32(0xedea0000), - SPH_C32(0xa1fc0000), SPH_C32(0xbb870000), SPH_C32(0x3b7901e6), - SPH_C32(0xfed56be0), SPH_C32(0xf9b401cf), SPH_C32(0x489e72f7), - SPH_C32(0x78cf7204) }, - { SPH_C32(0xcb800000), SPH_C32(0x30c40000), SPH_C32(0x95710000), - SPH_C32(0xe3240158), SPH_C32(0xa22467b4), SPH_C32(0xf9474e8c), - SPH_C32(0x30e1ec29), SPH_C32(0x3a2b4f86), SPH_C32(0x7cff0000), - SPH_C32(0x75ca0000), SPH_C32(0x1f470000), SPH_C32(0x576701e2), - SPH_C32(0x1515c2a6), SPH_C32(0xc835c4dc), SPH_C32(0xd6f54a46), - SPH_C32(0xe503782d) }, - { SPH_C32(0xc8bd0000), SPH_C32(0x38770000), SPH_C32(0x664b0000), - SPH_C32(0xd9e6015f), SPH_C32(0xf30dede4), SPH_C32(0x92292893), - SPH_C32(0x3e4423ca), SPH_C32(0xdcf13078), SPH_C32(0xd4250000), - SPH_C32(0xe3740000), SPH_C32(0x435a0000), SPH_C32(0x50bd01e0), - SPH_C32(0x68735725), SPH_C32(0xd7adb456), SPH_C32(0x6d93c24e), - SPH_C32(0x3f84f82d) }, - { SPH_C32(0x635a0000), SPH_C32(0xa67a0000), SPH_C32(0xc96c0000), - SPH_C32(0xe4fe015a), SPH_C32(0xdf42f237), SPH_C32(0xe6df3e06), - SPH_C32(0x8b876421), SPH_C32(0xe0accf86), SPH_C32(0xd7180000), - SPH_C32(0xebc70000), SPH_C32(0xb0600000), SPH_C32(0x6a7f01e7), - SPH_C32(0x395add75), SPH_C32(0xbcc3d249), SPH_C32(0x63360dad), - SPH_C32(0xd95e87d3) }, - { SPH_C32(0x60670000), SPH_C32(0xaec90000), SPH_C32(0x3a560000), - SPH_C32(0xde3c015d), SPH_C32(0x8e6b7867), SPH_C32(0x8db15819), - SPH_C32(0x8522abc2), SPH_C32(0x0676b078), SPH_C32(0x7fc20000), - SPH_C32(0x7d790000), SPH_C32(0xec7d0000), SPH_C32(0x6da501e5), - SPH_C32(0x443c48f6), SPH_C32(0xa35ba2c3), SPH_C32(0xd85085a5), - SPH_C32(0x03d907d3) }, - { SPH_C32(0x583b0000), SPH_C32(0x0bc30000), SPH_C32(0x2f700000), - SPH_C32(0x7af40150), SPH_C32(0x951dc9fa), SPH_C32(0x1f0b59ae), - SPH_C32(0xa6197a9a), SPH_C32(0x1252a42a), SPH_C32(0x7d6c0000), - SPH_C32(0x92480000), SPH_C32(0xf2bc0000), SPH_C32(0x986b01e9), - SPH_C32(0x98c54ffe), SPH_C32(0x749670f2), SPH_C32(0xd0c32ba7), - SPH_C32(0xb66ce656) }, - { SPH_C32(0x5b060000), SPH_C32(0x03700000), SPH_C32(0xdc4a0000), - SPH_C32(0x40360157), SPH_C32(0xc43443aa), SPH_C32(0x74653fb1), - SPH_C32(0xa8bcb579), SPH_C32(0xf488dbd4), SPH_C32(0xd5b60000), - SPH_C32(0x04f60000), SPH_C32(0xaea10000), SPH_C32(0x9fb101eb), - SPH_C32(0xe5a3da7d), SPH_C32(0x6b0e0078), SPH_C32(0x6ba5a3af), - SPH_C32(0x6ceb6656) }, - { SPH_C32(0xf0e10000), SPH_C32(0x9d7d0000), SPH_C32(0x736d0000), - SPH_C32(0x7d2e0152), SPH_C32(0xe87b5c79), SPH_C32(0x00932924), - SPH_C32(0x1d7ff292), SPH_C32(0xc8d5242a), SPH_C32(0xd68b0000), - SPH_C32(0x0c450000), SPH_C32(0x5d9b0000), SPH_C32(0xa57301ec), - SPH_C32(0xb48a502d), SPH_C32(0x00606667), SPH_C32(0x65006c4c), - SPH_C32(0x8a3119a8) }, - { SPH_C32(0xf3dc0000), SPH_C32(0x95ce0000), SPH_C32(0x80570000), - SPH_C32(0x47ec0155), SPH_C32(0xb952d629), SPH_C32(0x6bfd4f3b), - SPH_C32(0x13da3d71), SPH_C32(0x2e0f5bd4), SPH_C32(0x7e510000), - SPH_C32(0x9afb0000), SPH_C32(0x01860000), SPH_C32(0xa2a901ee), - SPH_C32(0xc9ecc5ae), SPH_C32(0x1ff816ed), SPH_C32(0xde66e444), - SPH_C32(0x50b699a8) }, - { SPH_C32(0x59a80000), SPH_C32(0xec410000), SPH_C32(0xc28b0000), - SPH_C32(0xb5f8015b), SPH_C32(0x18cd44a2), SPH_C32(0xa3a8ed80), - SPH_C32(0xa02f1b7b), SPH_C32(0x413d3a51), SPH_C32(0xef440000), - SPH_C32(0x4ecd0000), SPH_C32(0xa5460000), SPH_C32(0xceb701ea), - SPH_C32(0x222c6ce8), SPH_C32(0x2e79d3fe), SPH_C32(0x400ddcf5), - SPH_C32(0xcd7a9381) }, - { SPH_C32(0x5a950000), SPH_C32(0xe4f20000), SPH_C32(0x31b10000), - SPH_C32(0x8f3a015c), SPH_C32(0x49e4cef2), SPH_C32(0xc8c68b9f), - SPH_C32(0xae8ad498), SPH_C32(0xa7e745af), SPH_C32(0x479e0000), - SPH_C32(0xd8730000), SPH_C32(0xf95b0000), SPH_C32(0xc96d01e8), - SPH_C32(0x5f4af96b), SPH_C32(0x31e1a374), SPH_C32(0xfb6b54fd), - SPH_C32(0x17fd1381) }, - { SPH_C32(0xf1720000), SPH_C32(0x7aff0000), SPH_C32(0x9e960000), - SPH_C32(0xb2220159), SPH_C32(0x65abd121), SPH_C32(0xbc309d0a), - SPH_C32(0x1b499373), SPH_C32(0x9bbaba51), SPH_C32(0x44a30000), - SPH_C32(0xd0c00000), SPH_C32(0x0a610000), SPH_C32(0xf3af01ef), - SPH_C32(0x0e63733b), SPH_C32(0x5a8fc56b), SPH_C32(0xf5ce9b1e), - SPH_C32(0xf1276c7f) }, - { SPH_C32(0xf24f0000), SPH_C32(0x724c0000), SPH_C32(0x6dac0000), - SPH_C32(0x88e0015e), SPH_C32(0x34825b71), SPH_C32(0xd75efb15), - SPH_C32(0x15ec5c90), SPH_C32(0x7d60c5af), SPH_C32(0xec790000), - SPH_C32(0x467e0000), SPH_C32(0x567c0000), SPH_C32(0xf47501ed), - SPH_C32(0x7305e6b8), SPH_C32(0x4517b5e1), SPH_C32(0x4ea81316), - SPH_C32(0x2ba0ec7f) }, - { SPH_C32(0x95ff0000), SPH_C32(0xfe0d0000), SPH_C32(0xe1580000), - SPH_C32(0x62f80141), SPH_C32(0x3127a59f), SPH_C32(0xff43f26b), - SPH_C32(0x61c38617), SPH_C32(0x59ea6d0a), SPH_C32(0xb17f0000), - SPH_C32(0xff4c0000), SPH_C32(0x0b130000), SPH_C32(0x654801f2), - SPH_C32(0x8a82670f), SPH_C32(0x81cbf39e), SPH_C32(0x122528ab), - SPH_C32(0x10b1d693) }, - { SPH_C32(0x96c20000), SPH_C32(0xf6be0000), SPH_C32(0x12620000), - SPH_C32(0x583a0146), SPH_C32(0x600e2fcf), SPH_C32(0x942d9474), - SPH_C32(0x6f6649f4), SPH_C32(0xbf3012f4), SPH_C32(0x19a50000), - SPH_C32(0x69f20000), SPH_C32(0x570e0000), SPH_C32(0x629201f0), - SPH_C32(0xf7e4f28c), SPH_C32(0x9e538314), SPH_C32(0xa943a0a3), - SPH_C32(0xca365693) }, - { SPH_C32(0x3d250000), SPH_C32(0x68b30000), SPH_C32(0xbd450000), - SPH_C32(0x65220143), SPH_C32(0x4c41301c), SPH_C32(0xe0db82e1), - SPH_C32(0xdaa50e1f), SPH_C32(0x836ded0a), SPH_C32(0x1a980000), - SPH_C32(0x61410000), SPH_C32(0xa4340000), SPH_C32(0x585001f7), - SPH_C32(0xa6cd78dc), SPH_C32(0xf53de50b), SPH_C32(0xa7e66f40), - SPH_C32(0x2cec296d) }, - { SPH_C32(0x3e180000), SPH_C32(0x60000000), SPH_C32(0x4e7f0000), - SPH_C32(0x5fe00144), SPH_C32(0x1d68ba4c), SPH_C32(0x8bb5e4fe), - SPH_C32(0xd400c1fc), SPH_C32(0x65b792f4), SPH_C32(0xb2420000), - SPH_C32(0xf7ff0000), SPH_C32(0xf8290000), SPH_C32(0x5f8a01f5), - SPH_C32(0xdbabed5f), SPH_C32(0xeaa59581), SPH_C32(0x1c80e748), - SPH_C32(0xf66ba96d) }, - { SPH_C32(0x946c0000), SPH_C32(0x198f0000), SPH_C32(0x0ca30000), - SPH_C32(0xadf4014a), SPH_C32(0xbcf728c7), SPH_C32(0x43e04645), - SPH_C32(0x67f5e7f6), SPH_C32(0x0a85f371), SPH_C32(0x23570000), - SPH_C32(0x23c90000), SPH_C32(0x5ce90000), SPH_C32(0x339401f1), - SPH_C32(0x306b4419), SPH_C32(0xdb245092), SPH_C32(0x82ebdff9), - SPH_C32(0x6ba7a344) }, - { SPH_C32(0x97510000), SPH_C32(0x113c0000), SPH_C32(0xff990000), - SPH_C32(0x9736014d), SPH_C32(0xeddea297), SPH_C32(0x288e205a), - SPH_C32(0x69502815), SPH_C32(0xec5f8c8f), SPH_C32(0x8b8d0000), - SPH_C32(0xb5770000), SPH_C32(0x00f40000), SPH_C32(0x344e01f3), - SPH_C32(0x4d0dd19a), SPH_C32(0xc4bc2018), SPH_C32(0x398d57f1), - SPH_C32(0xb1202344) }, - { SPH_C32(0x3cb60000), SPH_C32(0x8f310000), SPH_C32(0x50be0000), - SPH_C32(0xaa2e0148), SPH_C32(0xc191bd44), SPH_C32(0x5c7836cf), - SPH_C32(0xdc936ffe), SPH_C32(0xd0027371), SPH_C32(0x88b00000), - SPH_C32(0xbdc40000), SPH_C32(0xf3ce0000), SPH_C32(0x0e8c01f4), - SPH_C32(0x1c245bca), SPH_C32(0xafd24607), SPH_C32(0x37289812), - SPH_C32(0x57fa5cba) }, - { SPH_C32(0x3f8b0000), SPH_C32(0x87820000), SPH_C32(0xa3840000), - SPH_C32(0x90ec014f), SPH_C32(0x90b83714), SPH_C32(0x371650d0), - SPH_C32(0xd236a01d), SPH_C32(0x36d80c8f), SPH_C32(0x206a0000), - SPH_C32(0x2b7a0000), SPH_C32(0xafd30000), SPH_C32(0x095601f6), - SPH_C32(0x6142ce49), SPH_C32(0xb04a368d), SPH_C32(0x8c4e101a), - SPH_C32(0x8d7ddcba) }, - { SPH_C32(0x07d70000), SPH_C32(0x22880000), SPH_C32(0xb6a20000), - SPH_C32(0x34240142), SPH_C32(0x8bce8689), SPH_C32(0xa5ac5167), - SPH_C32(0xf10d7145), SPH_C32(0x22fc18dd), SPH_C32(0x22c40000), - SPH_C32(0xc44b0000), SPH_C32(0xb1120000), SPH_C32(0xfc9801fa), - SPH_C32(0xbdbbc941), SPH_C32(0x6787e4bc), SPH_C32(0x84ddbe18), - SPH_C32(0x38c83d3f) }, - { SPH_C32(0x04ea0000), SPH_C32(0x2a3b0000), SPH_C32(0x45980000), - SPH_C32(0x0ee60145), SPH_C32(0xdae70cd9), SPH_C32(0xcec23778), - SPH_C32(0xffa8bea6), SPH_C32(0xc4266723), SPH_C32(0x8a1e0000), - SPH_C32(0x52f50000), SPH_C32(0xed0f0000), SPH_C32(0xfb4201f8), - SPH_C32(0xc0dd5cc2), SPH_C32(0x781f9436), SPH_C32(0x3fbb3610), - SPH_C32(0xe24fbd3f) }, - { SPH_C32(0xaf0d0000), SPH_C32(0xb4360000), SPH_C32(0xeabf0000), - SPH_C32(0x33fe0140), SPH_C32(0xf6a8130a), SPH_C32(0xba3421ed), - SPH_C32(0x4a6bf94d), SPH_C32(0xf87b98dd), SPH_C32(0x89230000), - SPH_C32(0x5a460000), SPH_C32(0x1e350000), SPH_C32(0xc18001ff), - SPH_C32(0x91f4d692), SPH_C32(0x1371f229), SPH_C32(0x311ef9f3), - SPH_C32(0x0495c2c1) }, - { SPH_C32(0xac300000), SPH_C32(0xbc850000), SPH_C32(0x19850000), - SPH_C32(0x093c0147), SPH_C32(0xa781995a), SPH_C32(0xd15a47f2), - SPH_C32(0x44ce36ae), SPH_C32(0x1ea1e723), SPH_C32(0x21f90000), - SPH_C32(0xccf80000), SPH_C32(0x42280000), SPH_C32(0xc65a01fd), - SPH_C32(0xec924311), SPH_C32(0x0ce982a3), SPH_C32(0x8a7871fb), - SPH_C32(0xde1242c1) }, - { SPH_C32(0x06440000), SPH_C32(0xc50a0000), SPH_C32(0x5b590000), - SPH_C32(0xfb280149), SPH_C32(0x061e0bd1), SPH_C32(0x190fe549), - SPH_C32(0xf73b10a4), SPH_C32(0x719386a6), SPH_C32(0xb0ec0000), - SPH_C32(0x18ce0000), SPH_C32(0xe6e80000), SPH_C32(0xaa4401f9), - SPH_C32(0x0752ea57), SPH_C32(0x3d6847b0), SPH_C32(0x1413494a), - SPH_C32(0x43de48e8) }, - { SPH_C32(0x05790000), SPH_C32(0xcdb90000), SPH_C32(0xa8630000), - SPH_C32(0xc1ea014e), SPH_C32(0x57378181), SPH_C32(0x72618356), - SPH_C32(0xf99edf47), SPH_C32(0x9749f958), SPH_C32(0x18360000), - SPH_C32(0x8e700000), SPH_C32(0xbaf50000), SPH_C32(0xad9e01fb), - SPH_C32(0x7a347fd4), SPH_C32(0x22f0373a), SPH_C32(0xaf75c142), - SPH_C32(0x9959c8e8) }, - { SPH_C32(0xae9e0000), SPH_C32(0x53b40000), SPH_C32(0x07440000), - SPH_C32(0xfcf2014b), SPH_C32(0x7b789e52), SPH_C32(0x069795c3), - SPH_C32(0x4c5d98ac), SPH_C32(0xab1406a6), SPH_C32(0x1b0b0000), - SPH_C32(0x86c30000), SPH_C32(0x49cf0000), SPH_C32(0x975c01fc), - SPH_C32(0x2b1df584), SPH_C32(0x499e5125), SPH_C32(0xa1d00ea1), - SPH_C32(0x7f83b716) }, - { SPH_C32(0xada30000), SPH_C32(0x5b070000), SPH_C32(0xf47e0000), - SPH_C32(0xc630014c), SPH_C32(0x2a511402), SPH_C32(0x6df9f3dc), - SPH_C32(0x42f8574f), SPH_C32(0x4dce7958), SPH_C32(0xb3d10000), - SPH_C32(0x107d0000), SPH_C32(0x15d20000), SPH_C32(0x908601fe), - SPH_C32(0x567b6007), SPH_C32(0x560621af), SPH_C32(0x1ab686a9), - SPH_C32(0xa5043716) }, - { SPH_C32(0xca570000), SPH_C32(0xa80e0000), SPH_C32(0xa2f60000), - SPH_C32(0x060b0152), SPH_C32(0x14592320), SPH_C32(0xec526625), - SPH_C32(0x35dd13a8), SPH_C32(0xd74eb663), SPH_C32(0xb13b0000), - SPH_C32(0x80040000), SPH_C32(0xd16f0000), SPH_C32(0x4f6b01f3), - SPH_C32(0xb12faec3), SPH_C32(0x287d6f19), SPH_C32(0x112fb6cb), - SPH_C32(0xaebbb10d) }, - { SPH_C32(0xc96a0000), SPH_C32(0xa0bd0000), SPH_C32(0x51cc0000), - SPH_C32(0x3cc90155), SPH_C32(0x4570a970), SPH_C32(0x873c003a), - SPH_C32(0x3b78dc4b), SPH_C32(0x3194c99d), SPH_C32(0x19e10000), - SPH_C32(0x16ba0000), SPH_C32(0x8d720000), SPH_C32(0x48b101f1), - SPH_C32(0xcc493b40), SPH_C32(0x37e51f93), SPH_C32(0xaa493ec3), - SPH_C32(0x743c310d) }, - { SPH_C32(0x628d0000), SPH_C32(0x3eb00000), SPH_C32(0xfeeb0000), - SPH_C32(0x01d10150), SPH_C32(0x693fb6a3), SPH_C32(0xf3ca16af), - SPH_C32(0x8ebb9ba0), SPH_C32(0x0dc93663), SPH_C32(0x1adc0000), - SPH_C32(0x1e090000), SPH_C32(0x7e480000), SPH_C32(0x727301f6), - SPH_C32(0x9d60b110), SPH_C32(0x5c8b798c), SPH_C32(0xa4ecf120), - SPH_C32(0x92e64ef3) }, - { SPH_C32(0x61b00000), SPH_C32(0x36030000), SPH_C32(0x0dd10000), - SPH_C32(0x3b130157), SPH_C32(0x38163cf3), SPH_C32(0x98a470b0), - SPH_C32(0x801e5443), SPH_C32(0xeb13499d), SPH_C32(0xb2060000), - SPH_C32(0x88b70000), SPH_C32(0x22550000), SPH_C32(0x75a901f4), - SPH_C32(0xe0062493), SPH_C32(0x43130906), SPH_C32(0x1f8a7928), - SPH_C32(0x4861cef3) }, - { SPH_C32(0xcbc40000), SPH_C32(0x4f8c0000), SPH_C32(0x4f0d0000), - SPH_C32(0xc9070159), SPH_C32(0x9989ae78), SPH_C32(0x50f1d20b), - SPH_C32(0x33eb7249), SPH_C32(0x84212818), SPH_C32(0x23130000), - SPH_C32(0x5c810000), SPH_C32(0x86950000), SPH_C32(0x19b701f0), - SPH_C32(0x0bc68dd5), SPH_C32(0x7292cc15), SPH_C32(0x81e14199), - SPH_C32(0xd5adc4da) }, - { SPH_C32(0xc8f90000), SPH_C32(0x473f0000), SPH_C32(0xbc370000), - SPH_C32(0xf3c5015e), SPH_C32(0xc8a02428), SPH_C32(0x3b9fb414), - SPH_C32(0x3d4ebdaa), SPH_C32(0x62fb57e6), SPH_C32(0x8bc90000), - SPH_C32(0xca3f0000), SPH_C32(0xda880000), SPH_C32(0x1e6d01f2), - SPH_C32(0x76a01856), SPH_C32(0x6d0abc9f), SPH_C32(0x3a87c991), - SPH_C32(0x0f2a44da) }, - { SPH_C32(0x631e0000), SPH_C32(0xd9320000), SPH_C32(0x13100000), - SPH_C32(0xcedd015b), SPH_C32(0xe4ef3bfb), SPH_C32(0x4f69a281), - SPH_C32(0x888dfa41), SPH_C32(0x5ea6a818), SPH_C32(0x88f40000), - SPH_C32(0xc28c0000), SPH_C32(0x29b20000), SPH_C32(0x24af01f5), - SPH_C32(0x27899206), SPH_C32(0x0664da80), SPH_C32(0x34220672), - SPH_C32(0xe9f03b24) }, - { SPH_C32(0x60230000), SPH_C32(0xd1810000), SPH_C32(0xe02a0000), - SPH_C32(0xf41f015c), SPH_C32(0xb5c6b1ab), SPH_C32(0x2407c49e), - SPH_C32(0x862835a2), SPH_C32(0xb87cd7e6), SPH_C32(0x202e0000), - SPH_C32(0x54320000), SPH_C32(0x75af0000), SPH_C32(0x237501f7), - SPH_C32(0x5aef0785), SPH_C32(0x19fcaa0a), SPH_C32(0x8f448e7a), - SPH_C32(0x3377bb24) }, - { SPH_C32(0x587f0000), SPH_C32(0x748b0000), SPH_C32(0xf50c0000), - SPH_C32(0x50d70151), SPH_C32(0xaeb00036), SPH_C32(0xb6bdc529), - SPH_C32(0xa513e4fa), SPH_C32(0xac58c3b4), SPH_C32(0x22800000), - SPH_C32(0xbb030000), SPH_C32(0x6b6e0000), SPH_C32(0xd6bb01fb), - SPH_C32(0x8616008d), SPH_C32(0xce31783b), SPH_C32(0x87d72078), - SPH_C32(0x86c25aa1) }, - { SPH_C32(0x5b420000), SPH_C32(0x7c380000), SPH_C32(0x06360000), - SPH_C32(0x6a150156), SPH_C32(0xff998a66), SPH_C32(0xddd3a336), - SPH_C32(0xabb62b19), SPH_C32(0x4a82bc4a), SPH_C32(0x8a5a0000), - SPH_C32(0x2dbd0000), SPH_C32(0x37730000), SPH_C32(0xd16101f9), - SPH_C32(0xfb70950e), SPH_C32(0xd1a908b1), SPH_C32(0x3cb1a870), - SPH_C32(0x5c45daa1) }, - { SPH_C32(0xf0a50000), SPH_C32(0xe2350000), SPH_C32(0xa9110000), - SPH_C32(0x570d0153), SPH_C32(0xd3d695b5), SPH_C32(0xa925b5a3), - SPH_C32(0x1e756cf2), SPH_C32(0x76df43b4), SPH_C32(0x89670000), - SPH_C32(0x250e0000), SPH_C32(0xc4490000), SPH_C32(0xeba301fe), - SPH_C32(0xaa591f5e), SPH_C32(0xbac76eae), SPH_C32(0x32146793), - SPH_C32(0xba9fa55f) }, - { SPH_C32(0xf3980000), SPH_C32(0xea860000), SPH_C32(0x5a2b0000), - SPH_C32(0x6dcf0154), SPH_C32(0x82ff1fe5), SPH_C32(0xc24bd3bc), - SPH_C32(0x10d0a311), SPH_C32(0x90053c4a), SPH_C32(0x21bd0000), - SPH_C32(0xb3b00000), SPH_C32(0x98540000), SPH_C32(0xec7901fc), - SPH_C32(0xd73f8add), SPH_C32(0xa55f1e24), SPH_C32(0x8972ef9b), - SPH_C32(0x6018255f) }, - { SPH_C32(0x59ec0000), SPH_C32(0x93090000), SPH_C32(0x18f70000), - SPH_C32(0x9fdb015a), SPH_C32(0x23608d6e), SPH_C32(0x0a1e7107), - SPH_C32(0xa325851b), SPH_C32(0xff375dcf), SPH_C32(0xb0a80000), - SPH_C32(0x67860000), SPH_C32(0x3c940000), SPH_C32(0x806701f8), - SPH_C32(0x3cff239b), SPH_C32(0x94dedb37), SPH_C32(0x1719d72a), - SPH_C32(0xfdd42f76) }, - { SPH_C32(0x5ad10000), SPH_C32(0x9bba0000), SPH_C32(0xebcd0000), - SPH_C32(0xa519015d), SPH_C32(0x7249073e), SPH_C32(0x61701718), - SPH_C32(0xad804af8), SPH_C32(0x19ed2231), SPH_C32(0x18720000), - SPH_C32(0xf1380000), SPH_C32(0x60890000), SPH_C32(0x87bd01fa), - SPH_C32(0x4199b618), SPH_C32(0x8b46abbd), SPH_C32(0xac7f5f22), - SPH_C32(0x2753af76) }, - { SPH_C32(0xf1360000), SPH_C32(0x05b70000), SPH_C32(0x44ea0000), - SPH_C32(0x98010158), SPH_C32(0x5e0618ed), SPH_C32(0x1586018d), - SPH_C32(0x18430d13), SPH_C32(0x25b0ddcf), SPH_C32(0x1b4f0000), - SPH_C32(0xf98b0000), SPH_C32(0x93b30000), SPH_C32(0xbd7f01fd), - SPH_C32(0x10b03c48), SPH_C32(0xe028cda2), SPH_C32(0xa2da90c1), - SPH_C32(0xc189d088) }, - { SPH_C32(0xf20b0000), SPH_C32(0x0d040000), SPH_C32(0xb7d00000), - SPH_C32(0xa2c3015f), SPH_C32(0x0f2f92bd), SPH_C32(0x7ee86792), - SPH_C32(0x16e6c2f0), SPH_C32(0xc36aa231), SPH_C32(0xb3950000), - SPH_C32(0x6f350000), SPH_C32(0xcfae0000), SPH_C32(0xbaa501ff), - SPH_C32(0x6dd6a9cb), SPH_C32(0xffb0bd28), SPH_C32(0x19bc18c9), - SPH_C32(0x1b0e5088) } -}; - -#define INPUT_BIG do { \ - unsigned acc = buf[0]; \ - const sph_u32 *rp; \ - rp = &T512_0[acc][0]; \ - m0 = rp[0]; \ - m1 = rp[1]; \ - m2 = rp[2]; \ - m3 = rp[3]; \ - m4 = rp[4]; \ - m5 = rp[5]; \ - m6 = rp[6]; \ - m7 = rp[7]; \ - m8 = rp[8]; \ - m9 = rp[9]; \ - mA = rp[10]; \ - mB = rp[11]; \ - mC = rp[12]; \ - mD = rp[13]; \ - mE = rp[14]; \ - mF = rp[15]; \ - acc = buf[1]; \ - rp = &T512_8[acc][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[2]; \ - rp = &T512_16[acc][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[3]; \ - rp = &T512_24[acc][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[4]; \ - rp = &T512_32[acc][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[5]; \ - rp = &T512_40[acc][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[6]; \ - rp = &T512_48[acc][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - acc = buf[7]; \ - rp = &T512_56[acc][0]; \ - m0 ^= rp[0]; \ - m1 ^= rp[1]; \ - m2 ^= rp[2]; \ - m3 ^= rp[3]; \ - m4 ^= rp[4]; \ - m5 ^= rp[5]; \ - m6 ^= rp[6]; \ - m7 ^= rp[7]; \ - m8 ^= rp[8]; \ - m9 ^= rp[9]; \ - mA ^= rp[10]; \ - mB ^= rp[11]; \ - mC ^= rp[12]; \ - mD ^= rp[13]; \ - mE ^= rp[14]; \ - mF ^= rp[15]; \ - } while (0) - -#endif - -#ifdef __cplusplus -} -#endif \ No newline at end of file diff --git a/sph/haval.c b/sph/haval.c deleted file mode 100644 index f9a89187..00000000 --- a/sph/haval.c +++ /dev/null @@ -1,983 +0,0 @@ -/* $Id: haval.c 227 2010-06-16 17:28:38Z tp $ */ -/* - * HAVAL implementation. - * - * The HAVAL reference paper is of questionable clarity with regards to - * some details such as endianness of bits within a byte, bytes within - * a 32-bit word, or the actual ordering of words within a stream of - * words. This implementation has been made compatible with the reference - * implementation available on: http://labs.calyptix.com/haval.php - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include - -#include "sph_haval.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -#if SPH_SMALL_FOOTPRINT && !defined SPH_SMALL_FOOTPRINT_HAVAL -#define SPH_SMALL_FOOTPRINT_HAVAL 1 -#endif - -/* - * Basic definition from the reference paper. - * -#define F1(x6, x5, x4, x3, x2, x1, x0) \ - (((x1) & (x4)) ^ ((x2) & (x5)) ^ ((x3) & (x6)) ^ ((x0) & (x1)) ^ (x0)) - * - */ - -#define F1(x6, x5, x4, x3, x2, x1, x0) \ - (((x1) & ((x0) ^ (x4))) ^ ((x2) & (x5)) ^ ((x3) & (x6)) ^ (x0)) - -/* - * Basic definition from the reference paper. - * -#define F2(x6, x5, x4, x3, x2, x1, x0) \ - (((x1) & (x2) & (x3)) ^ ((x2) & (x4) & (x5)) ^ ((x1) & (x2)) \ - ^ ((x1) & (x4)) ^ ((x2) & (x6)) ^ ((x3) & (x5)) \ - ^ ((x4) & (x5)) ^ ((x0) & (x2)) ^ (x0)) - * - */ - -#define F2(x6, x5, x4, x3, x2, x1, x0) \ - (((x2) & (((x1) & ~(x3)) ^ ((x4) & (x5)) ^ (x6) ^ (x0))) \ - ^ ((x4) & ((x1) ^ (x5))) ^ ((x3 & (x5)) ^ (x0))) - -/* - * Basic definition from the reference paper. - * -#define F3(x6, x5, x4, x3, x2, x1, x0) \ - (((x1) & (x2) & (x3)) ^ ((x1) & (x4)) ^ ((x2) & (x5)) \ - ^ ((x3) & (x6)) ^ ((x0) & (x3)) ^ (x0)) - * - */ - -#define F3(x6, x5, x4, x3, x2, x1, x0) \ - (((x3) & (((x1) & (x2)) ^ (x6) ^ (x0))) \ - ^ ((x1) & (x4)) ^ ((x2) & (x5)) ^ (x0)) - -/* - * Basic definition from the reference paper. - * -#define F4(x6, x5, x4, x3, x2, x1, x0) \ - (((x1) & (x2) & (x3)) ^ ((x2) & (x4) & (x5)) ^ ((x3) & (x4) & (x6)) \ - ^ ((x1) & (x4)) ^ ((x2) & (x6)) ^ ((x3) & (x4)) ^ ((x3) & (x5)) \ - ^ ((x3) & (x6)) ^ ((x4) & (x5)) ^ ((x4) & (x6)) ^ ((x0) & (x4)) ^ (x0)) - * - */ - -#define F4(x6, x5, x4, x3, x2, x1, x0) \ - (((x3) & (((x1) & (x2)) ^ ((x4) | (x6)) ^ (x5))) \ - ^ ((x4) & ((~(x2) & (x5)) ^ (x1) ^ (x6) ^ (x0))) \ - ^ ((x2) & (x6)) ^ (x0)) - -/* - * Basic definition from the reference paper. - * -#define F5(x6, x5, x4, x3, x2, x1, x0) \ - (((x1) & (x4)) ^ ((x2) & (x5)) ^ ((x3) & (x6)) \ - ^ ((x0) & (x1) & (x2) & (x3)) ^ ((x0) & (x5)) ^ (x0)) - * - */ - -#define F5(x6, x5, x4, x3, x2, x1, x0) \ - (((x0) & ~(((x1) & (x2) & (x3)) ^ (x5))) \ - ^ ((x1) & (x4)) ^ ((x2) & (x5)) ^ ((x3) & (x6))) - -/* - * The macros below integrate the phi() permutations, depending on the - * pass and the total number of passes. - */ - -#define FP3_1(x6, x5, x4, x3, x2, x1, x0) \ - F1(x1, x0, x3, x5, x6, x2, x4) -#define FP3_2(x6, x5, x4, x3, x2, x1, x0) \ - F2(x4, x2, x1, x0, x5, x3, x6) -#define FP3_3(x6, x5, x4, x3, x2, x1, x0) \ - F3(x6, x1, x2, x3, x4, x5, x0) - -#define FP4_1(x6, x5, x4, x3, x2, x1, x0) \ - F1(x2, x6, x1, x4, x5, x3, x0) -#define FP4_2(x6, x5, x4, x3, x2, x1, x0) \ - F2(x3, x5, x2, x0, x1, x6, x4) -#define FP4_3(x6, x5, x4, x3, x2, x1, x0) \ - F3(x1, x4, x3, x6, x0, x2, x5) -#define FP4_4(x6, x5, x4, x3, x2, x1, x0) \ - F4(x6, x4, x0, x5, x2, x1, x3) - -#define FP5_1(x6, x5, x4, x3, x2, x1, x0) \ - F1(x3, x4, x1, x0, x5, x2, x6) -#define FP5_2(x6, x5, x4, x3, x2, x1, x0) \ - F2(x6, x2, x1, x0, x3, x4, x5) -#define FP5_3(x6, x5, x4, x3, x2, x1, x0) \ - F3(x2, x6, x0, x4, x3, x1, x5) -#define FP5_4(x6, x5, x4, x3, x2, x1, x0) \ - F4(x1, x5, x3, x2, x0, x4, x6) -#define FP5_5(x6, x5, x4, x3, x2, x1, x0) \ - F5(x2, x5, x0, x6, x4, x3, x1) - -/* - * One step, for "n" passes, pass number "p" (1 <= p <= n), using - * input word number "w" and step constant "c". - */ -#define STEP(n, p, x7, x6, x5, x4, x3, x2, x1, x0, w, c) do { \ - sph_u32 t = FP ## n ## _ ## p(x6, x5, x4, x3, x2, x1, x0); \ - (x7) = SPH_T32(SPH_ROTR32(t, 7) + SPH_ROTR32((x7), 11) \ - + (w) + (c)); \ - } while (0) - -/* - * PASSy(n, in) computes pass number "y", for a total of "n", using the - * one-argument macro "in" to access input words. Current state is assumed - * to be held in variables "s0" to "s7". - */ - -#if SPH_SMALL_FOOTPRINT_HAVAL - -#define PASS1(n, in) do { \ - unsigned pass_count; \ - for (pass_count = 0; pass_count < 32; pass_count += 8) { \ - STEP(n, 1, s7, s6, s5, s4, s3, s2, s1, s0, \ - in(pass_count + 0), SPH_C32(0x00000000)); \ - STEP(n, 1, s6, s5, s4, s3, s2, s1, s0, s7, \ - in(pass_count + 1), SPH_C32(0x00000000)); \ - STEP(n, 1, s5, s4, s3, s2, s1, s0, s7, s6, \ - in(pass_count + 2), SPH_C32(0x00000000)); \ - STEP(n, 1, s4, s3, s2, s1, s0, s7, s6, s5, \ - in(pass_count + 3), SPH_C32(0x00000000)); \ - STEP(n, 1, s3, s2, s1, s0, s7, s6, s5, s4, \ - in(pass_count + 4), SPH_C32(0x00000000)); \ - STEP(n, 1, s2, s1, s0, s7, s6, s5, s4, s3, \ - in(pass_count + 5), SPH_C32(0x00000000)); \ - STEP(n, 1, s1, s0, s7, s6, s5, s4, s3, s2, \ - in(pass_count + 6), SPH_C32(0x00000000)); \ - STEP(n, 1, s0, s7, s6, s5, s4, s3, s2, s1, \ - in(pass_count + 7), SPH_C32(0x00000000)); \ - } \ - } while (0) - -#define PASSG(p, n, in) do { \ - unsigned pass_count; \ - for (pass_count = 0; pass_count < 32; pass_count += 8) { \ - STEP(n, p, s7, s6, s5, s4, s3, s2, s1, s0, \ - in(MP ## p[pass_count + 0]), \ - RK ## p[pass_count + 0]); \ - STEP(n, p, s6, s5, s4, s3, s2, s1, s0, s7, \ - in(MP ## p[pass_count + 1]), \ - RK ## p[pass_count + 1]); \ - STEP(n, p, s5, s4, s3, s2, s1, s0, s7, s6, \ - in(MP ## p[pass_count + 2]), \ - RK ## p[pass_count + 2]); \ - STEP(n, p, s4, s3, s2, s1, s0, s7, s6, s5, \ - in(MP ## p[pass_count + 3]), \ - RK ## p[pass_count + 3]); \ - STEP(n, p, s3, s2, s1, s0, s7, s6, s5, s4, \ - in(MP ## p[pass_count + 4]), \ - RK ## p[pass_count + 4]); \ - STEP(n, p, s2, s1, s0, s7, s6, s5, s4, s3, \ - in(MP ## p[pass_count + 5]), \ - RK ## p[pass_count + 5]); \ - STEP(n, p, s1, s0, s7, s6, s5, s4, s3, s2, \ - in(MP ## p[pass_count + 6]), \ - RK ## p[pass_count + 6]); \ - STEP(n, p, s0, s7, s6, s5, s4, s3, s2, s1, \ - in(MP ## p[pass_count + 7]), \ - RK ## p[pass_count + 7]); \ - } \ - } while (0) - -#define PASS2(n, in) PASSG(2, n, in) -#define PASS3(n, in) PASSG(3, n, in) -#define PASS4(n, in) PASSG(4, n, in) -#define PASS5(n, in) PASSG(5, n, in) - -static const unsigned MP2[32] = { - 5, 14, 26, 18, 11, 28, 7, 16, - 0, 23, 20, 22, 1, 10, 4, 8, - 30, 3, 21, 9, 17, 24, 29, 6, - 19, 12, 15, 13, 2, 25, 31, 27 -}; - -static const unsigned MP3[32] = { - 19, 9, 4, 20, 28, 17, 8, 22, - 29, 14, 25, 12, 24, 30, 16, 26, - 31, 15, 7, 3, 1, 0, 18, 27, - 13, 6, 21, 10, 23, 11, 5, 2 -}; - -static const unsigned MP4[32] = { - 24, 4, 0, 14, 2, 7, 28, 23, - 26, 6, 30, 20, 18, 25, 19, 3, - 22, 11, 31, 21, 8, 27, 12, 9, - 1, 29, 5, 15, 17, 10, 16, 13 -}; - -static const unsigned MP5[32] = { - 27, 3, 21, 26, 17, 11, 20, 29, - 19, 0, 12, 7, 13, 8, 31, 10, - 5, 9, 14, 30, 18, 6, 28, 24, - 2, 23, 16, 22, 4, 1, 25, 15 -}; - -static const sph_u32 RK2[32] = { - SPH_C32(0x452821E6), SPH_C32(0x38D01377), - SPH_C32(0xBE5466CF), SPH_C32(0x34E90C6C), - SPH_C32(0xC0AC29B7), SPH_C32(0xC97C50DD), - SPH_C32(0x3F84D5B5), SPH_C32(0xB5470917), - SPH_C32(0x9216D5D9), SPH_C32(0x8979FB1B), - SPH_C32(0xD1310BA6), SPH_C32(0x98DFB5AC), - SPH_C32(0x2FFD72DB), SPH_C32(0xD01ADFB7), - SPH_C32(0xB8E1AFED), SPH_C32(0x6A267E96), - SPH_C32(0xBA7C9045), SPH_C32(0xF12C7F99), - SPH_C32(0x24A19947), SPH_C32(0xB3916CF7), - SPH_C32(0x0801F2E2), SPH_C32(0x858EFC16), - SPH_C32(0x636920D8), SPH_C32(0x71574E69), - SPH_C32(0xA458FEA3), SPH_C32(0xF4933D7E), - SPH_C32(0x0D95748F), SPH_C32(0x728EB658), - SPH_C32(0x718BCD58), SPH_C32(0x82154AEE), - SPH_C32(0x7B54A41D), SPH_C32(0xC25A59B5) -}; - -static const sph_u32 RK3[32] = { - SPH_C32(0x9C30D539), SPH_C32(0x2AF26013), - SPH_C32(0xC5D1B023), SPH_C32(0x286085F0), - SPH_C32(0xCA417918), SPH_C32(0xB8DB38EF), - SPH_C32(0x8E79DCB0), SPH_C32(0x603A180E), - SPH_C32(0x6C9E0E8B), SPH_C32(0xB01E8A3E), - SPH_C32(0xD71577C1), SPH_C32(0xBD314B27), - SPH_C32(0x78AF2FDA), SPH_C32(0x55605C60), - SPH_C32(0xE65525F3), SPH_C32(0xAA55AB94), - SPH_C32(0x57489862), SPH_C32(0x63E81440), - SPH_C32(0x55CA396A), SPH_C32(0x2AAB10B6), - SPH_C32(0xB4CC5C34), SPH_C32(0x1141E8CE), - SPH_C32(0xA15486AF), SPH_C32(0x7C72E993), - SPH_C32(0xB3EE1411), SPH_C32(0x636FBC2A), - SPH_C32(0x2BA9C55D), SPH_C32(0x741831F6), - SPH_C32(0xCE5C3E16), SPH_C32(0x9B87931E), - SPH_C32(0xAFD6BA33), SPH_C32(0x6C24CF5C) -}; - -static const sph_u32 RK4[32] = { - SPH_C32(0x7A325381), SPH_C32(0x28958677), - SPH_C32(0x3B8F4898), SPH_C32(0x6B4BB9AF), - SPH_C32(0xC4BFE81B), SPH_C32(0x66282193), - SPH_C32(0x61D809CC), SPH_C32(0xFB21A991), - SPH_C32(0x487CAC60), SPH_C32(0x5DEC8032), - SPH_C32(0xEF845D5D), SPH_C32(0xE98575B1), - SPH_C32(0xDC262302), SPH_C32(0xEB651B88), - SPH_C32(0x23893E81), SPH_C32(0xD396ACC5), - SPH_C32(0x0F6D6FF3), SPH_C32(0x83F44239), - SPH_C32(0x2E0B4482), SPH_C32(0xA4842004), - SPH_C32(0x69C8F04A), SPH_C32(0x9E1F9B5E), - SPH_C32(0x21C66842), SPH_C32(0xF6E96C9A), - SPH_C32(0x670C9C61), SPH_C32(0xABD388F0), - SPH_C32(0x6A51A0D2), SPH_C32(0xD8542F68), - SPH_C32(0x960FA728), SPH_C32(0xAB5133A3), - SPH_C32(0x6EEF0B6C), SPH_C32(0x137A3BE4) -}; - -static const sph_u32 RK5[32] = { - SPH_C32(0xBA3BF050), SPH_C32(0x7EFB2A98), - SPH_C32(0xA1F1651D), SPH_C32(0x39AF0176), - SPH_C32(0x66CA593E), SPH_C32(0x82430E88), - SPH_C32(0x8CEE8619), SPH_C32(0x456F9FB4), - SPH_C32(0x7D84A5C3), SPH_C32(0x3B8B5EBE), - SPH_C32(0xE06F75D8), SPH_C32(0x85C12073), - SPH_C32(0x401A449F), SPH_C32(0x56C16AA6), - SPH_C32(0x4ED3AA62), SPH_C32(0x363F7706), - SPH_C32(0x1BFEDF72), SPH_C32(0x429B023D), - SPH_C32(0x37D0D724), SPH_C32(0xD00A1248), - SPH_C32(0xDB0FEAD3), SPH_C32(0x49F1C09B), - SPH_C32(0x075372C9), SPH_C32(0x80991B7B), - SPH_C32(0x25D479D8), SPH_C32(0xF6E8DEF7), - SPH_C32(0xE3FE501A), SPH_C32(0xB6794C3B), - SPH_C32(0x976CE0BD), SPH_C32(0x04C006BA), - SPH_C32(0xC1A94FB6), SPH_C32(0x409F60C4) -}; - -#else - -#define PASS1(n, in) do { \ - STEP(n, 1, s7, s6, s5, s4, s3, s2, s1, s0, in( 0), SPH_C32(0x00000000)); \ - STEP(n, 1, s6, s5, s4, s3, s2, s1, s0, s7, in( 1), SPH_C32(0x00000000)); \ - STEP(n, 1, s5, s4, s3, s2, s1, s0, s7, s6, in( 2), SPH_C32(0x00000000)); \ - STEP(n, 1, s4, s3, s2, s1, s0, s7, s6, s5, in( 3), SPH_C32(0x00000000)); \ - STEP(n, 1, s3, s2, s1, s0, s7, s6, s5, s4, in( 4), SPH_C32(0x00000000)); \ - STEP(n, 1, s2, s1, s0, s7, s6, s5, s4, s3, in( 5), SPH_C32(0x00000000)); \ - STEP(n, 1, s1, s0, s7, s6, s5, s4, s3, s2, in( 6), SPH_C32(0x00000000)); \ - STEP(n, 1, s0, s7, s6, s5, s4, s3, s2, s1, in( 7), SPH_C32(0x00000000)); \ - \ - STEP(n, 1, s7, s6, s5, s4, s3, s2, s1, s0, in( 8), SPH_C32(0x00000000)); \ - STEP(n, 1, s6, s5, s4, s3, s2, s1, s0, s7, in( 9), SPH_C32(0x00000000)); \ - STEP(n, 1, s5, s4, s3, s2, s1, s0, s7, s6, in(10), SPH_C32(0x00000000)); \ - STEP(n, 1, s4, s3, s2, s1, s0, s7, s6, s5, in(11), SPH_C32(0x00000000)); \ - STEP(n, 1, s3, s2, s1, s0, s7, s6, s5, s4, in(12), SPH_C32(0x00000000)); \ - STEP(n, 1, s2, s1, s0, s7, s6, s5, s4, s3, in(13), SPH_C32(0x00000000)); \ - STEP(n, 1, s1, s0, s7, s6, s5, s4, s3, s2, in(14), SPH_C32(0x00000000)); \ - STEP(n, 1, s0, s7, s6, s5, s4, s3, s2, s1, in(15), SPH_C32(0x00000000)); \ - \ - STEP(n, 1, s7, s6, s5, s4, s3, s2, s1, s0, in(16), SPH_C32(0x00000000)); \ - STEP(n, 1, s6, s5, s4, s3, s2, s1, s0, s7, in(17), SPH_C32(0x00000000)); \ - STEP(n, 1, s5, s4, s3, s2, s1, s0, s7, s6, in(18), SPH_C32(0x00000000)); \ - STEP(n, 1, s4, s3, s2, s1, s0, s7, s6, s5, in(19), SPH_C32(0x00000000)); \ - STEP(n, 1, s3, s2, s1, s0, s7, s6, s5, s4, in(20), SPH_C32(0x00000000)); \ - STEP(n, 1, s2, s1, s0, s7, s6, s5, s4, s3, in(21), SPH_C32(0x00000000)); \ - STEP(n, 1, s1, s0, s7, s6, s5, s4, s3, s2, in(22), SPH_C32(0x00000000)); \ - STEP(n, 1, s0, s7, s6, s5, s4, s3, s2, s1, in(23), SPH_C32(0x00000000)); \ - \ - STEP(n, 1, s7, s6, s5, s4, s3, s2, s1, s0, in(24), SPH_C32(0x00000000)); \ - STEP(n, 1, s6, s5, s4, s3, s2, s1, s0, s7, in(25), SPH_C32(0x00000000)); \ - STEP(n, 1, s5, s4, s3, s2, s1, s0, s7, s6, in(26), SPH_C32(0x00000000)); \ - STEP(n, 1, s4, s3, s2, s1, s0, s7, s6, s5, in(27), SPH_C32(0x00000000)); \ - STEP(n, 1, s3, s2, s1, s0, s7, s6, s5, s4, in(28), SPH_C32(0x00000000)); \ - STEP(n, 1, s2, s1, s0, s7, s6, s5, s4, s3, in(29), SPH_C32(0x00000000)); \ - STEP(n, 1, s1, s0, s7, s6, s5, s4, s3, s2, in(30), SPH_C32(0x00000000)); \ - STEP(n, 1, s0, s7, s6, s5, s4, s3, s2, s1, in(31), SPH_C32(0x00000000)); \ - } while (0) - -#define PASS2(n, in) do { \ - STEP(n, 2, s7, s6, s5, s4, s3, s2, s1, s0, in( 5), SPH_C32(0x452821E6)); \ - STEP(n, 2, s6, s5, s4, s3, s2, s1, s0, s7, in(14), SPH_C32(0x38D01377)); \ - STEP(n, 2, s5, s4, s3, s2, s1, s0, s7, s6, in(26), SPH_C32(0xBE5466CF)); \ - STEP(n, 2, s4, s3, s2, s1, s0, s7, s6, s5, in(18), SPH_C32(0x34E90C6C)); \ - STEP(n, 2, s3, s2, s1, s0, s7, s6, s5, s4, in(11), SPH_C32(0xC0AC29B7)); \ - STEP(n, 2, s2, s1, s0, s7, s6, s5, s4, s3, in(28), SPH_C32(0xC97C50DD)); \ - STEP(n, 2, s1, s0, s7, s6, s5, s4, s3, s2, in( 7), SPH_C32(0x3F84D5B5)); \ - STEP(n, 2, s0, s7, s6, s5, s4, s3, s2, s1, in(16), SPH_C32(0xB5470917)); \ - \ - STEP(n, 2, s7, s6, s5, s4, s3, s2, s1, s0, in( 0), SPH_C32(0x9216D5D9)); \ - STEP(n, 2, s6, s5, s4, s3, s2, s1, s0, s7, in(23), SPH_C32(0x8979FB1B)); \ - STEP(n, 2, s5, s4, s3, s2, s1, s0, s7, s6, in(20), SPH_C32(0xD1310BA6)); \ - STEP(n, 2, s4, s3, s2, s1, s0, s7, s6, s5, in(22), SPH_C32(0x98DFB5AC)); \ - STEP(n, 2, s3, s2, s1, s0, s7, s6, s5, s4, in( 1), SPH_C32(0x2FFD72DB)); \ - STEP(n, 2, s2, s1, s0, s7, s6, s5, s4, s3, in(10), SPH_C32(0xD01ADFB7)); \ - STEP(n, 2, s1, s0, s7, s6, s5, s4, s3, s2, in( 4), SPH_C32(0xB8E1AFED)); \ - STEP(n, 2, s0, s7, s6, s5, s4, s3, s2, s1, in( 8), SPH_C32(0x6A267E96)); \ - \ - STEP(n, 2, s7, s6, s5, s4, s3, s2, s1, s0, in(30), SPH_C32(0xBA7C9045)); \ - STEP(n, 2, s6, s5, s4, s3, s2, s1, s0, s7, in( 3), SPH_C32(0xF12C7F99)); \ - STEP(n, 2, s5, s4, s3, s2, s1, s0, s7, s6, in(21), SPH_C32(0x24A19947)); \ - STEP(n, 2, s4, s3, s2, s1, s0, s7, s6, s5, in( 9), SPH_C32(0xB3916CF7)); \ - STEP(n, 2, s3, s2, s1, s0, s7, s6, s5, s4, in(17), SPH_C32(0x0801F2E2)); \ - STEP(n, 2, s2, s1, s0, s7, s6, s5, s4, s3, in(24), SPH_C32(0x858EFC16)); \ - STEP(n, 2, s1, s0, s7, s6, s5, s4, s3, s2, in(29), SPH_C32(0x636920D8)); \ - STEP(n, 2, s0, s7, s6, s5, s4, s3, s2, s1, in( 6), SPH_C32(0x71574E69)); \ - \ - STEP(n, 2, s7, s6, s5, s4, s3, s2, s1, s0, in(19), SPH_C32(0xA458FEA3)); \ - STEP(n, 2, s6, s5, s4, s3, s2, s1, s0, s7, in(12), SPH_C32(0xF4933D7E)); \ - STEP(n, 2, s5, s4, s3, s2, s1, s0, s7, s6, in(15), SPH_C32(0x0D95748F)); \ - STEP(n, 2, s4, s3, s2, s1, s0, s7, s6, s5, in(13), SPH_C32(0x728EB658)); \ - STEP(n, 2, s3, s2, s1, s0, s7, s6, s5, s4, in( 2), SPH_C32(0x718BCD58)); \ - STEP(n, 2, s2, s1, s0, s7, s6, s5, s4, s3, in(25), SPH_C32(0x82154AEE)); \ - STEP(n, 2, s1, s0, s7, s6, s5, s4, s3, s2, in(31), SPH_C32(0x7B54A41D)); \ - STEP(n, 2, s0, s7, s6, s5, s4, s3, s2, s1, in(27), SPH_C32(0xC25A59B5)); \ - } while (0) - -#define PASS3(n, in) do { \ - STEP(n, 3, s7, s6, s5, s4, s3, s2, s1, s0, in(19), SPH_C32(0x9C30D539)); \ - STEP(n, 3, s6, s5, s4, s3, s2, s1, s0, s7, in( 9), SPH_C32(0x2AF26013)); \ - STEP(n, 3, s5, s4, s3, s2, s1, s0, s7, s6, in( 4), SPH_C32(0xC5D1B023)); \ - STEP(n, 3, s4, s3, s2, s1, s0, s7, s6, s5, in(20), SPH_C32(0x286085F0)); \ - STEP(n, 3, s3, s2, s1, s0, s7, s6, s5, s4, in(28), SPH_C32(0xCA417918)); \ - STEP(n, 3, s2, s1, s0, s7, s6, s5, s4, s3, in(17), SPH_C32(0xB8DB38EF)); \ - STEP(n, 3, s1, s0, s7, s6, s5, s4, s3, s2, in( 8), SPH_C32(0x8E79DCB0)); \ - STEP(n, 3, s0, s7, s6, s5, s4, s3, s2, s1, in(22), SPH_C32(0x603A180E)); \ - \ - STEP(n, 3, s7, s6, s5, s4, s3, s2, s1, s0, in(29), SPH_C32(0x6C9E0E8B)); \ - STEP(n, 3, s6, s5, s4, s3, s2, s1, s0, s7, in(14), SPH_C32(0xB01E8A3E)); \ - STEP(n, 3, s5, s4, s3, s2, s1, s0, s7, s6, in(25), SPH_C32(0xD71577C1)); \ - STEP(n, 3, s4, s3, s2, s1, s0, s7, s6, s5, in(12), SPH_C32(0xBD314B27)); \ - STEP(n, 3, s3, s2, s1, s0, s7, s6, s5, s4, in(24), SPH_C32(0x78AF2FDA)); \ - STEP(n, 3, s2, s1, s0, s7, s6, s5, s4, s3, in(30), SPH_C32(0x55605C60)); \ - STEP(n, 3, s1, s0, s7, s6, s5, s4, s3, s2, in(16), SPH_C32(0xE65525F3)); \ - STEP(n, 3, s0, s7, s6, s5, s4, s3, s2, s1, in(26), SPH_C32(0xAA55AB94)); \ - \ - STEP(n, 3, s7, s6, s5, s4, s3, s2, s1, s0, in(31), SPH_C32(0x57489862)); \ - STEP(n, 3, s6, s5, s4, s3, s2, s1, s0, s7, in(15), SPH_C32(0x63E81440)); \ - STEP(n, 3, s5, s4, s3, s2, s1, s0, s7, s6, in( 7), SPH_C32(0x55CA396A)); \ - STEP(n, 3, s4, s3, s2, s1, s0, s7, s6, s5, in( 3), SPH_C32(0x2AAB10B6)); \ - STEP(n, 3, s3, s2, s1, s0, s7, s6, s5, s4, in( 1), SPH_C32(0xB4CC5C34)); \ - STEP(n, 3, s2, s1, s0, s7, s6, s5, s4, s3, in( 0), SPH_C32(0x1141E8CE)); \ - STEP(n, 3, s1, s0, s7, s6, s5, s4, s3, s2, in(18), SPH_C32(0xA15486AF)); \ - STEP(n, 3, s0, s7, s6, s5, s4, s3, s2, s1, in(27), SPH_C32(0x7C72E993)); \ - \ - STEP(n, 3, s7, s6, s5, s4, s3, s2, s1, s0, in(13), SPH_C32(0xB3EE1411)); \ - STEP(n, 3, s6, s5, s4, s3, s2, s1, s0, s7, in( 6), SPH_C32(0x636FBC2A)); \ - STEP(n, 3, s5, s4, s3, s2, s1, s0, s7, s6, in(21), SPH_C32(0x2BA9C55D)); \ - STEP(n, 3, s4, s3, s2, s1, s0, s7, s6, s5, in(10), SPH_C32(0x741831F6)); \ - STEP(n, 3, s3, s2, s1, s0, s7, s6, s5, s4, in(23), SPH_C32(0xCE5C3E16)); \ - STEP(n, 3, s2, s1, s0, s7, s6, s5, s4, s3, in(11), SPH_C32(0x9B87931E)); \ - STEP(n, 3, s1, s0, s7, s6, s5, s4, s3, s2, in( 5), SPH_C32(0xAFD6BA33)); \ - STEP(n, 3, s0, s7, s6, s5, s4, s3, s2, s1, in( 2), SPH_C32(0x6C24CF5C)); \ - } while (0) - -#define PASS4(n, in) do { \ - STEP(n, 4, s7, s6, s5, s4, s3, s2, s1, s0, in(24), SPH_C32(0x7A325381)); \ - STEP(n, 4, s6, s5, s4, s3, s2, s1, s0, s7, in( 4), SPH_C32(0x28958677)); \ - STEP(n, 4, s5, s4, s3, s2, s1, s0, s7, s6, in( 0), SPH_C32(0x3B8F4898)); \ - STEP(n, 4, s4, s3, s2, s1, s0, s7, s6, s5, in(14), SPH_C32(0x6B4BB9AF)); \ - STEP(n, 4, s3, s2, s1, s0, s7, s6, s5, s4, in( 2), SPH_C32(0xC4BFE81B)); \ - STEP(n, 4, s2, s1, s0, s7, s6, s5, s4, s3, in( 7), SPH_C32(0x66282193)); \ - STEP(n, 4, s1, s0, s7, s6, s5, s4, s3, s2, in(28), SPH_C32(0x61D809CC)); \ - STEP(n, 4, s0, s7, s6, s5, s4, s3, s2, s1, in(23), SPH_C32(0xFB21A991)); \ - \ - STEP(n, 4, s7, s6, s5, s4, s3, s2, s1, s0, in(26), SPH_C32(0x487CAC60)); \ - STEP(n, 4, s6, s5, s4, s3, s2, s1, s0, s7, in( 6), SPH_C32(0x5DEC8032)); \ - STEP(n, 4, s5, s4, s3, s2, s1, s0, s7, s6, in(30), SPH_C32(0xEF845D5D)); \ - STEP(n, 4, s4, s3, s2, s1, s0, s7, s6, s5, in(20), SPH_C32(0xE98575B1)); \ - STEP(n, 4, s3, s2, s1, s0, s7, s6, s5, s4, in(18), SPH_C32(0xDC262302)); \ - STEP(n, 4, s2, s1, s0, s7, s6, s5, s4, s3, in(25), SPH_C32(0xEB651B88)); \ - STEP(n, 4, s1, s0, s7, s6, s5, s4, s3, s2, in(19), SPH_C32(0x23893E81)); \ - STEP(n, 4, s0, s7, s6, s5, s4, s3, s2, s1, in( 3), SPH_C32(0xD396ACC5)); \ - \ - STEP(n, 4, s7, s6, s5, s4, s3, s2, s1, s0, in(22), SPH_C32(0x0F6D6FF3)); \ - STEP(n, 4, s6, s5, s4, s3, s2, s1, s0, s7, in(11), SPH_C32(0x83F44239)); \ - STEP(n, 4, s5, s4, s3, s2, s1, s0, s7, s6, in(31), SPH_C32(0x2E0B4482)); \ - STEP(n, 4, s4, s3, s2, s1, s0, s7, s6, s5, in(21), SPH_C32(0xA4842004)); \ - STEP(n, 4, s3, s2, s1, s0, s7, s6, s5, s4, in( 8), SPH_C32(0x69C8F04A)); \ - STEP(n, 4, s2, s1, s0, s7, s6, s5, s4, s3, in(27), SPH_C32(0x9E1F9B5E)); \ - STEP(n, 4, s1, s0, s7, s6, s5, s4, s3, s2, in(12), SPH_C32(0x21C66842)); \ - STEP(n, 4, s0, s7, s6, s5, s4, s3, s2, s1, in( 9), SPH_C32(0xF6E96C9A)); \ - \ - STEP(n, 4, s7, s6, s5, s4, s3, s2, s1, s0, in( 1), SPH_C32(0x670C9C61)); \ - STEP(n, 4, s6, s5, s4, s3, s2, s1, s0, s7, in(29), SPH_C32(0xABD388F0)); \ - STEP(n, 4, s5, s4, s3, s2, s1, s0, s7, s6, in( 5), SPH_C32(0x6A51A0D2)); \ - STEP(n, 4, s4, s3, s2, s1, s0, s7, s6, s5, in(15), SPH_C32(0xD8542F68)); \ - STEP(n, 4, s3, s2, s1, s0, s7, s6, s5, s4, in(17), SPH_C32(0x960FA728)); \ - STEP(n, 4, s2, s1, s0, s7, s6, s5, s4, s3, in(10), SPH_C32(0xAB5133A3)); \ - STEP(n, 4, s1, s0, s7, s6, s5, s4, s3, s2, in(16), SPH_C32(0x6EEF0B6C)); \ - STEP(n, 4, s0, s7, s6, s5, s4, s3, s2, s1, in(13), SPH_C32(0x137A3BE4)); \ - } while (0) - -#define PASS5(n, in) do { \ - STEP(n, 5, s7, s6, s5, s4, s3, s2, s1, s0, in(27), SPH_C32(0xBA3BF050)); \ - STEP(n, 5, s6, s5, s4, s3, s2, s1, s0, s7, in( 3), SPH_C32(0x7EFB2A98)); \ - STEP(n, 5, s5, s4, s3, s2, s1, s0, s7, s6, in(21), SPH_C32(0xA1F1651D)); \ - STEP(n, 5, s4, s3, s2, s1, s0, s7, s6, s5, in(26), SPH_C32(0x39AF0176)); \ - STEP(n, 5, s3, s2, s1, s0, s7, s6, s5, s4, in(17), SPH_C32(0x66CA593E)); \ - STEP(n, 5, s2, s1, s0, s7, s6, s5, s4, s3, in(11), SPH_C32(0x82430E88)); \ - STEP(n, 5, s1, s0, s7, s6, s5, s4, s3, s2, in(20), SPH_C32(0x8CEE8619)); \ - STEP(n, 5, s0, s7, s6, s5, s4, s3, s2, s1, in(29), SPH_C32(0x456F9FB4)); \ - \ - STEP(n, 5, s7, s6, s5, s4, s3, s2, s1, s0, in(19), SPH_C32(0x7D84A5C3)); \ - STEP(n, 5, s6, s5, s4, s3, s2, s1, s0, s7, in( 0), SPH_C32(0x3B8B5EBE)); \ - STEP(n, 5, s5, s4, s3, s2, s1, s0, s7, s6, in(12), SPH_C32(0xE06F75D8)); \ - STEP(n, 5, s4, s3, s2, s1, s0, s7, s6, s5, in( 7), SPH_C32(0x85C12073)); \ - STEP(n, 5, s3, s2, s1, s0, s7, s6, s5, s4, in(13), SPH_C32(0x401A449F)); \ - STEP(n, 5, s2, s1, s0, s7, s6, s5, s4, s3, in( 8), SPH_C32(0x56C16AA6)); \ - STEP(n, 5, s1, s0, s7, s6, s5, s4, s3, s2, in(31), SPH_C32(0x4ED3AA62)); \ - STEP(n, 5, s0, s7, s6, s5, s4, s3, s2, s1, in(10), SPH_C32(0x363F7706)); \ - \ - STEP(n, 5, s7, s6, s5, s4, s3, s2, s1, s0, in( 5), SPH_C32(0x1BFEDF72)); \ - STEP(n, 5, s6, s5, s4, s3, s2, s1, s0, s7, in( 9), SPH_C32(0x429B023D)); \ - STEP(n, 5, s5, s4, s3, s2, s1, s0, s7, s6, in(14), SPH_C32(0x37D0D724)); \ - STEP(n, 5, s4, s3, s2, s1, s0, s7, s6, s5, in(30), SPH_C32(0xD00A1248)); \ - STEP(n, 5, s3, s2, s1, s0, s7, s6, s5, s4, in(18), SPH_C32(0xDB0FEAD3)); \ - STEP(n, 5, s2, s1, s0, s7, s6, s5, s4, s3, in( 6), SPH_C32(0x49F1C09B)); \ - STEP(n, 5, s1, s0, s7, s6, s5, s4, s3, s2, in(28), SPH_C32(0x075372C9)); \ - STEP(n, 5, s0, s7, s6, s5, s4, s3, s2, s1, in(24), SPH_C32(0x80991B7B)); \ - \ - STEP(n, 5, s7, s6, s5, s4, s3, s2, s1, s0, in( 2), SPH_C32(0x25D479D8)); \ - STEP(n, 5, s6, s5, s4, s3, s2, s1, s0, s7, in(23), SPH_C32(0xF6E8DEF7)); \ - STEP(n, 5, s5, s4, s3, s2, s1, s0, s7, s6, in(16), SPH_C32(0xE3FE501A)); \ - STEP(n, 5, s4, s3, s2, s1, s0, s7, s6, s5, in(22), SPH_C32(0xB6794C3B)); \ - STEP(n, 5, s3, s2, s1, s0, s7, s6, s5, s4, in( 4), SPH_C32(0x976CE0BD)); \ - STEP(n, 5, s2, s1, s0, s7, s6, s5, s4, s3, in( 1), SPH_C32(0x04C006BA)); \ - STEP(n, 5, s1, s0, s7, s6, s5, s4, s3, s2, in(25), SPH_C32(0xC1A94FB6)); \ - STEP(n, 5, s0, s7, s6, s5, s4, s3, s2, s1, in(15), SPH_C32(0x409F60C4)); \ - } while (0) - -#endif - -#define SAVE_STATE \ - sph_u32 u0, u1, u2, u3, u4, u5, u6, u7; \ - do { \ - u0 = s0; \ - u1 = s1; \ - u2 = s2; \ - u3 = s3; \ - u4 = s4; \ - u5 = s5; \ - u6 = s6; \ - u7 = s7; \ - } while (0) - -#define UPDATE_STATE do { \ - s0 = SPH_T32(s0 + u0); \ - s1 = SPH_T32(s1 + u1); \ - s2 = SPH_T32(s2 + u2); \ - s3 = SPH_T32(s3 + u3); \ - s4 = SPH_T32(s4 + u4); \ - s5 = SPH_T32(s5 + u5); \ - s6 = SPH_T32(s6 + u6); \ - s7 = SPH_T32(s7 + u7); \ - } while (0) - -/* - * COREn(in) performs the core HAVAL computation for "n" passes, using - * the one-argument macro "in" to access the input words. Running state - * is held in variable "s0" to "s7". - */ - -#define CORE3(in) do { \ - SAVE_STATE; \ - PASS1(3, in); \ - PASS2(3, in); \ - PASS3(3, in); \ - UPDATE_STATE; \ - } while (0) - -#define CORE4(in) do { \ - SAVE_STATE; \ - PASS1(4, in); \ - PASS2(4, in); \ - PASS3(4, in); \ - PASS4(4, in); \ - UPDATE_STATE; \ - } while (0) - -#define CORE5(in) do { \ - SAVE_STATE; \ - PASS1(5, in); \ - PASS2(5, in); \ - PASS3(5, in); \ - PASS4(5, in); \ - PASS5(5, in); \ - UPDATE_STATE; \ - } while (0) - -/* - * DSTATE declares the state variables "s0" to "s7". - */ -#define DSTATE sph_u32 s0, s1, s2, s3, s4, s5, s6, s7 - -/* - * RSTATE fills the state variables from the context "sc". - */ -#define RSTATE do { \ - s0 = sc->s0; \ - s1 = sc->s1; \ - s2 = sc->s2; \ - s3 = sc->s3; \ - s4 = sc->s4; \ - s5 = sc->s5; \ - s6 = sc->s6; \ - s7 = sc->s7; \ - } while (0) - -/* - * WSTATE updates the context "sc" from the state variables. - */ -#define WSTATE do { \ - sc->s0 = s0; \ - sc->s1 = s1; \ - sc->s2 = s2; \ - sc->s3 = s3; \ - sc->s4 = s4; \ - sc->s5 = s5; \ - sc->s6 = s6; \ - sc->s7 = s7; \ - } while (0) - -/* - * Initialize a context. "olen" is the output length, in 32-bit words - * (between 4 and 8, inclusive). "passes" is the number of passes - * (3, 4 or 5). - */ -static void -haval_init(sph_haval_context *sc, unsigned olen, unsigned passes) -{ - sc->s0 = SPH_C32(0x243F6A88); - sc->s1 = SPH_C32(0x85A308D3); - sc->s2 = SPH_C32(0x13198A2E); - sc->s3 = SPH_C32(0x03707344); - sc->s4 = SPH_C32(0xA4093822); - sc->s5 = SPH_C32(0x299F31D0); - sc->s6 = SPH_C32(0x082EFA98); - sc->s7 = SPH_C32(0xEC4E6C89); - sc->olen = olen; - sc->passes = passes; -#if SPH_64 - sc->count = 0; -#else - sc->count_high = 0; - sc->count_low = 0; -#endif - -} - -/* - * IN_PREPARE(data) contains declarations and code to prepare for - * reading input words pointed to by "data". - * INW(i) reads the word number "i" (from 0 to 31). - */ -#if SPH_LITTLE_FAST -#define IN_PREPARE(indata) const unsigned char *const load_ptr = \ - (const unsigned char *)(indata) -#define INW(i) sph_dec32le_aligned(load_ptr + 4 * (i)) -#else -#define IN_PREPARE(indata) \ - sph_u32 X_var[32]; \ - int load_index; \ - \ - for (load_index = 0; load_index < 32; load_index ++) \ - X_var[load_index] = sph_dec32le_aligned( \ - (const unsigned char *)(indata) + 4 * load_index) -#define INW(i) X_var[i] -#endif - -/* - * Mixing operation used for 128-bit output tailoring. This function - * takes the byte 0 from a0, byte 1 from a1, byte 2 from a2 and byte 3 - * from a3, and combines them into a 32-bit word, which is then rotated - * to the left by n bits. - */ -static SPH_INLINE sph_u32 -mix128(sph_u32 a0, sph_u32 a1, sph_u32 a2, sph_u32 a3, int n) -{ - sph_u32 tmp; - - tmp = (a0 & SPH_C32(0x000000FF)) - | (a1 & SPH_C32(0x0000FF00)) - | (a2 & SPH_C32(0x00FF0000)) - | (a3 & SPH_C32(0xFF000000)); - if (n > 0) - tmp = SPH_ROTL32(tmp, n); - return tmp; -} - -/* - * Mixing operation used to compute output word 0 for 160-bit output. - */ -static SPH_INLINE sph_u32 -mix160_0(sph_u32 x5, sph_u32 x6, sph_u32 x7) -{ - sph_u32 tmp; - - tmp = (x5 & SPH_C32(0x01F80000)) - | (x6 & SPH_C32(0xFE000000)) - | (x7 & SPH_C32(0x0000003F)); - return SPH_ROTL32(tmp, 13); -} - -/* - * Mixing operation used to compute output word 1 for 160-bit output. - */ -static SPH_INLINE sph_u32 -mix160_1(sph_u32 x5, sph_u32 x6, sph_u32 x7) -{ - sph_u32 tmp; - - tmp = (x5 & SPH_C32(0xFE000000)) - | (x6 & SPH_C32(0x0000003F)) - | (x7 & SPH_C32(0x00000FC0)); - return SPH_ROTL32(tmp, 7); -} - -/* - * Mixing operation used to compute output word 2 for 160-bit output. - */ -static SPH_INLINE sph_u32 -mix160_2(sph_u32 x5, sph_u32 x6, sph_u32 x7) -{ - sph_u32 tmp; - - tmp = (x5 & SPH_C32(0x0000003F)) - | (x6 & SPH_C32(0x00000FC0)) - | (x7 & SPH_C32(0x0007F000)); - return tmp; -} - -/* - * Mixing operation used to compute output word 3 for 160-bit output. - */ -static SPH_INLINE sph_u32 -mix160_3(sph_u32 x5, sph_u32 x6, sph_u32 x7) -{ - sph_u32 tmp; - - tmp = (x5 & SPH_C32(0x00000FC0)) - | (x6 & SPH_C32(0x0007F000)) - | (x7 & SPH_C32(0x01F80000)); - return tmp >> 6; -} - -/* - * Mixing operation used to compute output word 4 for 160-bit output. - */ -static SPH_INLINE sph_u32 -mix160_4(sph_u32 x5, sph_u32 x6, sph_u32 x7) -{ - sph_u32 tmp; - - tmp = (x5 & SPH_C32(0x0007F000)) - | (x6 & SPH_C32(0x01F80000)) - | (x7 & SPH_C32(0xFE000000)); - return tmp >> 12; -} - -/* - * Mixing operation used to compute output word 0 for 192-bit output. - */ -static SPH_INLINE sph_u32 -mix192_0(sph_u32 x6, sph_u32 x7) -{ - sph_u32 tmp; - - tmp = (x6 & SPH_C32(0xFC000000)) | (x7 & SPH_C32(0x0000001F)); - return SPH_ROTL32(tmp, 6); -} - -/* - * Mixing operation used to compute output word 1 for 192-bit output. - */ -static SPH_INLINE sph_u32 -mix192_1(sph_u32 x6, sph_u32 x7) -{ - return (x6 & SPH_C32(0x0000001F)) | (x7 & SPH_C32(0x000003E0)); -} - -/* - * Mixing operation used to compute output word 2 for 192-bit output. - */ -static SPH_INLINE sph_u32 -mix192_2(sph_u32 x6, sph_u32 x7) -{ - return ((x6 & SPH_C32(0x000003E0)) | (x7 & SPH_C32(0x0000FC00))) >> 5; -} - -/* - * Mixing operation used to compute output word 3 for 192-bit output. - */ -static SPH_INLINE sph_u32 -mix192_3(sph_u32 x6, sph_u32 x7) -{ - return ((x6 & SPH_C32(0x0000FC00)) | (x7 & SPH_C32(0x001F0000))) >> 10; -} - -/* - * Mixing operation used to compute output word 4 for 192-bit output. - */ -static SPH_INLINE sph_u32 -mix192_4(sph_u32 x6, sph_u32 x7) -{ - return ((x6 & SPH_C32(0x001F0000)) | (x7 & SPH_C32(0x03E00000))) >> 16; -} - -/* - * Mixing operation used to compute output word 5 for 192-bit output. - */ -static SPH_INLINE sph_u32 -mix192_5(sph_u32 x6, sph_u32 x7) -{ - return ((x6 & SPH_C32(0x03E00000)) | (x7 & SPH_C32(0xFC000000))) >> 21; -} - -/* - * Write out HAVAL output. The output length is tailored to the requested - * length. - */ -static void -haval_out(sph_haval_context *sc, void *dst) -{ - DSTATE; - unsigned char *buf; - - buf = dst; - RSTATE; - switch (sc->olen) { - case 4: - sph_enc32le(buf, SPH_T32(s0 + mix128(s7, s4, s5, s6, 24))); - sph_enc32le(buf + 4, SPH_T32(s1 + mix128(s6, s7, s4, s5, 16))); - sph_enc32le(buf + 8, SPH_T32(s2 + mix128(s5, s6, s7, s4, 8))); - sph_enc32le(buf + 12, SPH_T32(s3 + mix128(s4, s5, s6, s7, 0))); - break; - case 5: - sph_enc32le(buf, SPH_T32(s0 + mix160_0(s5, s6, s7))); - sph_enc32le(buf + 4, SPH_T32(s1 + mix160_1(s5, s6, s7))); - sph_enc32le(buf + 8, SPH_T32(s2 + mix160_2(s5, s6, s7))); - sph_enc32le(buf + 12, SPH_T32(s3 + mix160_3(s5, s6, s7))); - sph_enc32le(buf + 16, SPH_T32(s4 + mix160_4(s5, s6, s7))); - break; - case 6: - sph_enc32le(buf, SPH_T32(s0 + mix192_0(s6, s7))); - sph_enc32le(buf + 4, SPH_T32(s1 + mix192_1(s6, s7))); - sph_enc32le(buf + 8, SPH_T32(s2 + mix192_2(s6, s7))); - sph_enc32le(buf + 12, SPH_T32(s3 + mix192_3(s6, s7))); - sph_enc32le(buf + 16, SPH_T32(s4 + mix192_4(s6, s7))); - sph_enc32le(buf + 20, SPH_T32(s5 + mix192_5(s6, s7))); - break; - case 7: - sph_enc32le(buf, SPH_T32(s0 + ((s7 >> 27) & 0x1F))); - sph_enc32le(buf + 4, SPH_T32(s1 + ((s7 >> 22) & 0x1F))); - sph_enc32le(buf + 8, SPH_T32(s2 + ((s7 >> 18) & 0x0F))); - sph_enc32le(buf + 12, SPH_T32(s3 + ((s7 >> 13) & 0x1F))); - sph_enc32le(buf + 16, SPH_T32(s4 + ((s7 >> 9) & 0x0F))); - sph_enc32le(buf + 20, SPH_T32(s5 + ((s7 >> 4) & 0x1F))); - sph_enc32le(buf + 24, SPH_T32(s6 + ((s7 ) & 0x0F))); - break; - case 8: - sph_enc32le(buf, s0); - sph_enc32le(buf + 4, s1); - sph_enc32le(buf + 8, s2); - sph_enc32le(buf + 12, s3); - sph_enc32le(buf + 16, s4); - sph_enc32le(buf + 20, s5); - sph_enc32le(buf + 24, s6); - sph_enc32le(buf + 28, s7); - break; - } -} - -/* - * The main core functions inline the code with the COREx() macros. We - * use a helper file, included three times, which avoids code copying. - */ - -#undef PASSES -#define PASSES 3 -#include "haval_helper.c" - -#undef PASSES -#define PASSES 4 -#include "haval_helper.c" - -#undef PASSES -#define PASSES 5 -#include "haval_helper.c" - -/* ====================================================================== */ - -#define API(xxx, y) \ -void \ -sph_haval ## xxx ## _ ## y ## _init(void *cc) \ -{ \ - haval_init(cc, xxx >> 5, y); \ -} \ - \ -void \ -sph_haval ## xxx ## _ ## y (void *cc, const void *data, size_t len) \ -{ \ - haval ## y(cc, data, len); \ -} \ - \ -void \ -sph_haval ## xxx ## _ ## y ## _close(void *cc, void *dst) \ -{ \ - haval ## y ## _close(cc, 0, 0, dst); \ -} \ - \ -void \ -sph_haval ## xxx ## _ ## y ## addbits_and_close( \ - void *cc, unsigned ub, unsigned n, void *dst) \ -{ \ - haval ## y ## _close(cc, ub, n, dst); \ -} - -API(128, 3) -API(128, 4) -API(128, 5) -API(160, 3) -API(160, 4) -API(160, 5) -API(192, 3) -API(192, 4) -API(192, 5) -API(224, 3) -API(224, 4) -API(224, 5) -API(256, 3) -API(256, 4) -API(256, 5) - -#define RVAL do { \ - s0 = val[0]; \ - s1 = val[1]; \ - s2 = val[2]; \ - s3 = val[3]; \ - s4 = val[4]; \ - s5 = val[5]; \ - s6 = val[6]; \ - s7 = val[7]; \ - } while (0) - -#define WVAL do { \ - val[0] = s0; \ - val[1] = s1; \ - val[2] = s2; \ - val[3] = s3; \ - val[4] = s4; \ - val[5] = s5; \ - val[6] = s6; \ - val[7] = s7; \ - } while (0) - -#define INMSG(i) msg[i] - -/* see sph_haval.h */ -void -sph_haval_3_comp(const sph_u32 msg[32], sph_u32 val[8]) -{ - DSTATE; - - RVAL; - CORE3(INMSG); - WVAL; -} - -/* see sph_haval.h */ -void -sph_haval_4_comp(const sph_u32 msg[32], sph_u32 val[8]) -{ - DSTATE; - - RVAL; - CORE4(INMSG); - WVAL; -} - -/* see sph_haval.h */ -void -sph_haval_5_comp(const sph_u32 msg[32], sph_u32 val[8]) -{ - DSTATE; - - RVAL; - CORE5(INMSG); - WVAL; -} - -#ifdef __cplusplus -} -#endif diff --git a/sph/haval_helper.c b/sph/haval_helper.c deleted file mode 100644 index ce0a9fd6..00000000 --- a/sph/haval_helper.c +++ /dev/null @@ -1,190 +0,0 @@ -/* $Id: haval_helper.c 218 2010-06-08 17:06:34Z tp $ */ -/* - * Helper code, included (three times !) by HAVAL implementation. - * - * TODO: try to merge this with md_helper.c. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#undef SPH_XCAT -#define SPH_XCAT(a, b) SPH_XCAT_(a, b) -#undef SPH_XCAT_ -#define SPH_XCAT_(a, b) a ## b - -static void -#ifdef SPH_UPTR -SPH_XCAT(SPH_XCAT(haval, PASSES), _short) -#else -SPH_XCAT(haval, PASSES) -#endif -(sph_haval_context *sc, const void *data, size_t len) -{ - unsigned current; - -#if SPH_64 - current = (unsigned)sc->count & 127U; -#else - current = (unsigned)sc->count_low & 127U; -#endif - while (len > 0) { - unsigned clen; -#if !SPH_64 - sph_u32 clow, clow2; -#endif - - clen = 128U - current; - if (clen > len) - clen = len; - memcpy(sc->buf + current, data, clen); - data = (const unsigned char *)data + clen; - current += clen; - len -= clen; - if (current == 128U) { - DSTATE; - IN_PREPARE(sc->buf); - RSTATE; - SPH_XCAT(CORE, PASSES)(INW); - WSTATE; - current = 0; - } -#if SPH_64 - sc->count += clen; -#else - clow = sc->count_low; - clow2 = SPH_T32(clow + clen); - sc->count_low = clow2; - if (clow2 < clow) - sc->count_high ++; -#endif - } -} - -#ifdef SPH_UPTR -static void -SPH_XCAT(haval, PASSES)(sph_haval_context *sc, const void *data, size_t len) -{ - unsigned current; - size_t orig_len; -#if !SPH_64 - sph_u32 clow, clow2; -#endif - DSTATE; - - if (len < 256U) { - SPH_XCAT(SPH_XCAT(haval, PASSES), _short)(sc, data, len); - return; - } -#if SPH_64 - current = (unsigned)sc->count & 127U; -#else - current = (unsigned)sc->count_low & 127U; -#endif - if (current > 0) { - unsigned clen; - clen = 128U - current; - SPH_XCAT(SPH_XCAT(haval, PASSES), _short)(sc, data, clen); - data = (const unsigned char *)data + clen; - len -= clen; - } -#if !SPH_UNALIGNED - if (((SPH_UPTR)data & 3U) != 0) { - SPH_XCAT(SPH_XCAT(haval, PASSES), _short)(sc, data, len); - return; - } -#endif - orig_len = len; - RSTATE; - while (len >= 128U) { - IN_PREPARE(data); - SPH_XCAT(CORE, PASSES)(INW); - data = (const unsigned char *)data + 128U; - len -= 128U; - } - WSTATE; - if (len > 0) - memcpy(sc->buf, data, len); -#if SPH_64 - sc->count += (sph_u64)orig_len; -#else - clow = sc->count_low; - clow2 = SPH_T32(clow + orig_len); - sc->count_low = clow2; - if (clow2 < clow) - sc->count_high ++; - orig_len >>= 12; - orig_len >>= 10; - orig_len >>= 10; - sc->count_high += orig_len; -#endif -} -#endif - -static void -SPH_XCAT(SPH_XCAT(haval, PASSES), _close)(sph_haval_context *sc, - unsigned ub, unsigned n, void *dst) -{ - unsigned current; - DSTATE; - -#if SPH_64 - current = (unsigned)sc->count & 127U; -#else - current = (unsigned)sc->count_low & 127U; -#endif - sc->buf[current ++] = (0x01 << n) | ((ub & 0xFF) >> (8 - n)); - RSTATE; - if (current > 118U) { - memset(sc->buf + current, 0, 128U - current); - - do { - IN_PREPARE(sc->buf); - SPH_XCAT(CORE, PASSES)(INW); - } while (0); - current = 0; - } - memset(sc->buf + current, 0, 118U - current); - sc->buf[118] = 0x01 | (PASSES << 3); - sc->buf[119] = sc->olen << 3; -#if SPH_64 - sph_enc64le_aligned(sc->buf + 120, SPH_T64(sc->count << 3)); -#else - sph_enc32le_aligned(sc->buf + 120, SPH_T32(sc->count_low << 3)); - sph_enc32le_aligned(sc->buf + 124, - SPH_T32((sc->count_high << 3) | (sc->count_low >> 29))); -#endif - - do { - IN_PREPARE(sc->buf); - SPH_XCAT(CORE, PASSES)(INW); - } while (0); - WSTATE; - - haval_out(sc, dst); - haval_init(sc, sc->olen, sc->passes); -} diff --git a/sph/jh.c b/sph/jh.c deleted file mode 100644 index 4e266172..00000000 --- a/sph/jh.c +++ /dev/null @@ -1,1107 +0,0 @@ -/* $Id: jh.c 255 2011-06-07 19:50:20Z tp $ */ -/* - * JH implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include - -#include "sph_jh.h" - -#if SPH_SMALL_FOOTPRINT && !defined SPH_SMALL_FOOTPRINT_JH -#define SPH_SMALL_FOOTPRINT_JH 1 -#endif - -#if !defined SPH_JH_64 && SPH_64_TRUE -#define SPH_JH_64 1 -#endif - -#if !SPH_64 -#undef SPH_JH_64 -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -/* - * The internal bitslice representation may use either big-endian or - * little-endian (true bitslice operations do not care about the bit - * ordering, and the bit-swapping linear operations in JH happen to - * be invariant through endianness-swapping). The constants must be - * defined according to the chosen endianness; we use some - * byte-swapping macros for that. - */ - -#if SPH_LITTLE_ENDIAN - -#define C32e(x) ((SPH_C32(x) >> 24) \ - | ((SPH_C32(x) >> 8) & SPH_C32(0x0000FF00)) \ - | ((SPH_C32(x) << 8) & SPH_C32(0x00FF0000)) \ - | ((SPH_C32(x) << 24) & SPH_C32(0xFF000000))) -#define dec32e_aligned sph_dec32le_aligned -#define enc32e sph_enc32le - -#if SPH_64 -#define C64e(x) ((SPH_C64(x) >> 56) \ - | ((SPH_C64(x) >> 40) & SPH_C64(0x000000000000FF00)) \ - | ((SPH_C64(x) >> 24) & SPH_C64(0x0000000000FF0000)) \ - | ((SPH_C64(x) >> 8) & SPH_C64(0x00000000FF000000)) \ - | ((SPH_C64(x) << 8) & SPH_C64(0x000000FF00000000)) \ - | ((SPH_C64(x) << 24) & SPH_C64(0x0000FF0000000000)) \ - | ((SPH_C64(x) << 40) & SPH_C64(0x00FF000000000000)) \ - | ((SPH_C64(x) << 56) & SPH_C64(0xFF00000000000000))) -#define dec64e_aligned sph_dec64le_aligned -#define enc64e sph_enc64le -#endif - -#else - -#define C32e(x) SPH_C32(x) -#define dec32e_aligned sph_dec32be_aligned -#define enc32e sph_enc32be -#if SPH_64 -#define C64e(x) SPH_C64(x) -#define dec64e_aligned sph_dec64be_aligned -#define enc64e sph_enc64be -#endif - -#endif - -#define Sb(x0, x1, x2, x3, c) do { \ - x3 = ~x3; \ - x0 ^= (c) & ~x2; \ - tmp = (c) ^ (x0 & x1); \ - x0 ^= x2 & x3; \ - x3 ^= ~x1 & x2; \ - x1 ^= x0 & x2; \ - x2 ^= x0 & ~x3; \ - x0 ^= x1 | x3; \ - x3 ^= x1 & x2; \ - x1 ^= tmp & x0; \ - x2 ^= tmp; \ - } while (0) - -#define Lb(x0, x1, x2, x3, x4, x5, x6, x7) do { \ - x4 ^= x1; \ - x5 ^= x2; \ - x6 ^= x3 ^ x0; \ - x7 ^= x0; \ - x0 ^= x5; \ - x1 ^= x6; \ - x2 ^= x7 ^ x4; \ - x3 ^= x4; \ - } while (0) - -#if SPH_JH_64 - -static const sph_u64 C[] = { - C64e(0x72d5dea2df15f867), C64e(0x7b84150ab7231557), - C64e(0x81abd6904d5a87f6), C64e(0x4e9f4fc5c3d12b40), - C64e(0xea983ae05c45fa9c), C64e(0x03c5d29966b2999a), - C64e(0x660296b4f2bb538a), C64e(0xb556141a88dba231), - C64e(0x03a35a5c9a190edb), C64e(0x403fb20a87c14410), - C64e(0x1c051980849e951d), C64e(0x6f33ebad5ee7cddc), - C64e(0x10ba139202bf6b41), C64e(0xdc786515f7bb27d0), - C64e(0x0a2c813937aa7850), C64e(0x3f1abfd2410091d3), - C64e(0x422d5a0df6cc7e90), C64e(0xdd629f9c92c097ce), - C64e(0x185ca70bc72b44ac), C64e(0xd1df65d663c6fc23), - C64e(0x976e6c039ee0b81a), C64e(0x2105457e446ceca8), - C64e(0xeef103bb5d8e61fa), C64e(0xfd9697b294838197), - C64e(0x4a8e8537db03302f), C64e(0x2a678d2dfb9f6a95), - C64e(0x8afe7381f8b8696c), C64e(0x8ac77246c07f4214), - C64e(0xc5f4158fbdc75ec4), C64e(0x75446fa78f11bb80), - C64e(0x52de75b7aee488bc), C64e(0x82b8001e98a6a3f4), - C64e(0x8ef48f33a9a36315), C64e(0xaa5f5624d5b7f989), - C64e(0xb6f1ed207c5ae0fd), C64e(0x36cae95a06422c36), - C64e(0xce2935434efe983d), C64e(0x533af974739a4ba7), - C64e(0xd0f51f596f4e8186), C64e(0x0e9dad81afd85a9f), - C64e(0xa7050667ee34626a), C64e(0x8b0b28be6eb91727), - C64e(0x47740726c680103f), C64e(0xe0a07e6fc67e487b), - C64e(0x0d550aa54af8a4c0), C64e(0x91e3e79f978ef19e), - C64e(0x8676728150608dd4), C64e(0x7e9e5a41f3e5b062), - C64e(0xfc9f1fec4054207a), C64e(0xe3e41a00cef4c984), - C64e(0x4fd794f59dfa95d8), C64e(0x552e7e1124c354a5), - C64e(0x5bdf7228bdfe6e28), C64e(0x78f57fe20fa5c4b2), - C64e(0x05897cefee49d32e), C64e(0x447e9385eb28597f), - C64e(0x705f6937b324314a), C64e(0x5e8628f11dd6e465), - C64e(0xc71b770451b920e7), C64e(0x74fe43e823d4878a), - C64e(0x7d29e8a3927694f2), C64e(0xddcb7a099b30d9c1), - C64e(0x1d1b30fb5bdc1be0), C64e(0xda24494ff29c82bf), - C64e(0xa4e7ba31b470bfff), C64e(0x0d324405def8bc48), - C64e(0x3baefc3253bbd339), C64e(0x459fc3c1e0298ba0), - C64e(0xe5c905fdf7ae090f), C64e(0x947034124290f134), - C64e(0xa271b701e344ed95), C64e(0xe93b8e364f2f984a), - C64e(0x88401d63a06cf615), C64e(0x47c1444b8752afff), - C64e(0x7ebb4af1e20ac630), C64e(0x4670b6c5cc6e8ce6), - C64e(0xa4d5a456bd4fca00), C64e(0xda9d844bc83e18ae), - C64e(0x7357ce453064d1ad), C64e(0xe8a6ce68145c2567), - C64e(0xa3da8cf2cb0ee116), C64e(0x33e906589a94999a), - C64e(0x1f60b220c26f847b), C64e(0xd1ceac7fa0d18518), - C64e(0x32595ba18ddd19d3), C64e(0x509a1cc0aaa5b446), - C64e(0x9f3d6367e4046bba), C64e(0xf6ca19ab0b56ee7e), - C64e(0x1fb179eaa9282174), C64e(0xe9bdf7353b3651ee), - C64e(0x1d57ac5a7550d376), C64e(0x3a46c2fea37d7001), - C64e(0xf735c1af98a4d842), C64e(0x78edec209e6b6779), - C64e(0x41836315ea3adba8), C64e(0xfac33b4d32832c83), - C64e(0xa7403b1f1c2747f3), C64e(0x5940f034b72d769a), - C64e(0xe73e4e6cd2214ffd), C64e(0xb8fd8d39dc5759ef), - C64e(0x8d9b0c492b49ebda), C64e(0x5ba2d74968f3700d), - C64e(0x7d3baed07a8d5584), C64e(0xf5a5e9f0e4f88e65), - C64e(0xa0b8a2f436103b53), C64e(0x0ca8079e753eec5a), - C64e(0x9168949256e8884f), C64e(0x5bb05c55f8babc4c), - C64e(0xe3bb3b99f387947b), C64e(0x75daf4d6726b1c5d), - C64e(0x64aeac28dc34b36d), C64e(0x6c34a550b828db71), - C64e(0xf861e2f2108d512a), C64e(0xe3db643359dd75fc), - C64e(0x1cacbcf143ce3fa2), C64e(0x67bbd13c02e843b0), - C64e(0x330a5bca8829a175), C64e(0x7f34194db416535c), - C64e(0x923b94c30e794d1e), C64e(0x797475d7b6eeaf3f), - C64e(0xeaa8d4f7be1a3921), C64e(0x5cf47e094c232751), - C64e(0x26a32453ba323cd2), C64e(0x44a3174a6da6d5ad), - C64e(0xb51d3ea6aff2c908), C64e(0x83593d98916b3c56), - C64e(0x4cf87ca17286604d), C64e(0x46e23ecc086ec7f6), - C64e(0x2f9833b3b1bc765e), C64e(0x2bd666a5efc4e62a), - C64e(0x06f4b6e8bec1d436), C64e(0x74ee8215bcef2163), - C64e(0xfdc14e0df453c969), C64e(0xa77d5ac406585826), - C64e(0x7ec1141606e0fa16), C64e(0x7e90af3d28639d3f), - C64e(0xd2c9f2e3009bd20c), C64e(0x5faace30b7d40c30), - C64e(0x742a5116f2e03298), C64e(0x0deb30d8e3cef89a), - C64e(0x4bc59e7bb5f17992), C64e(0xff51e66e048668d3), - C64e(0x9b234d57e6966731), C64e(0xcce6a6f3170a7505), - C64e(0xb17681d913326cce), C64e(0x3c175284f805a262), - C64e(0xf42bcbb378471547), C64e(0xff46548223936a48), - C64e(0x38df58074e5e6565), C64e(0xf2fc7c89fc86508e), - C64e(0x31702e44d00bca86), C64e(0xf04009a23078474e), - C64e(0x65a0ee39d1f73883), C64e(0xf75ee937e42c3abd), - C64e(0x2197b2260113f86f), C64e(0xa344edd1ef9fdee7), - C64e(0x8ba0df15762592d9), C64e(0x3c85f7f612dc42be), - C64e(0xd8a7ec7cab27b07e), C64e(0x538d7ddaaa3ea8de), - C64e(0xaa25ce93bd0269d8), C64e(0x5af643fd1a7308f9), - C64e(0xc05fefda174a19a5), C64e(0x974d66334cfd216a), - C64e(0x35b49831db411570), C64e(0xea1e0fbbedcd549b), - C64e(0x9ad063a151974072), C64e(0xf6759dbf91476fe2) -}; - -#define Ceven_hi(r) (C[((r) << 2) + 0]) -#define Ceven_lo(r) (C[((r) << 2) + 1]) -#define Codd_hi(r) (C[((r) << 2) + 2]) -#define Codd_lo(r) (C[((r) << 2) + 3]) - -#define S(x0, x1, x2, x3, cb, r) do { \ - Sb(x0 ## h, x1 ## h, x2 ## h, x3 ## h, cb ## hi(r)); \ - Sb(x0 ## l, x1 ## l, x2 ## l, x3 ## l, cb ## lo(r)); \ - } while (0) - -#define L(x0, x1, x2, x3, x4, x5, x6, x7) do { \ - Lb(x0 ## h, x1 ## h, x2 ## h, x3 ## h, \ - x4 ## h, x5 ## h, x6 ## h, x7 ## h); \ - Lb(x0 ## l, x1 ## l, x2 ## l, x3 ## l, \ - x4 ## l, x5 ## l, x6 ## l, x7 ## l); \ - } while (0) - -#define Wz(x, c, n) do { \ - sph_u64 t = (x ## h & (c)) << (n); \ - x ## h = ((x ## h >> (n)) & (c)) | t; \ - t = (x ## l & (c)) << (n); \ - x ## l = ((x ## l >> (n)) & (c)) | t; \ - } while (0) - -#define W0(x) Wz(x, SPH_C64(0x5555555555555555), 1) -#define W1(x) Wz(x, SPH_C64(0x3333333333333333), 2) -#define W2(x) Wz(x, SPH_C64(0x0F0F0F0F0F0F0F0F), 4) -#define W3(x) Wz(x, SPH_C64(0x00FF00FF00FF00FF), 8) -#define W4(x) Wz(x, SPH_C64(0x0000FFFF0000FFFF), 16) -#define W5(x) Wz(x, SPH_C64(0x00000000FFFFFFFF), 32) -#define W6(x) do { \ - sph_u64 t = x ## h; \ - x ## h = x ## l; \ - x ## l = t; \ - } while (0) - -#define DECL_STATE \ - sph_u64 h0h, h1h, h2h, h3h, h4h, h5h, h6h, h7h; \ - sph_u64 h0l, h1l, h2l, h3l, h4l, h5l, h6l, h7l; \ - sph_u64 tmp; - -#define READ_STATE(state) do { \ - h0h = (state)->H.wide[ 0]; \ - h0l = (state)->H.wide[ 1]; \ - h1h = (state)->H.wide[ 2]; \ - h1l = (state)->H.wide[ 3]; \ - h2h = (state)->H.wide[ 4]; \ - h2l = (state)->H.wide[ 5]; \ - h3h = (state)->H.wide[ 6]; \ - h3l = (state)->H.wide[ 7]; \ - h4h = (state)->H.wide[ 8]; \ - h4l = (state)->H.wide[ 9]; \ - h5h = (state)->H.wide[10]; \ - h5l = (state)->H.wide[11]; \ - h6h = (state)->H.wide[12]; \ - h6l = (state)->H.wide[13]; \ - h7h = (state)->H.wide[14]; \ - h7l = (state)->H.wide[15]; \ - } while (0) - -#define WRITE_STATE(state) do { \ - (state)->H.wide[ 0] = h0h; \ - (state)->H.wide[ 1] = h0l; \ - (state)->H.wide[ 2] = h1h; \ - (state)->H.wide[ 3] = h1l; \ - (state)->H.wide[ 4] = h2h; \ - (state)->H.wide[ 5] = h2l; \ - (state)->H.wide[ 6] = h3h; \ - (state)->H.wide[ 7] = h3l; \ - (state)->H.wide[ 8] = h4h; \ - (state)->H.wide[ 9] = h4l; \ - (state)->H.wide[10] = h5h; \ - (state)->H.wide[11] = h5l; \ - (state)->H.wide[12] = h6h; \ - (state)->H.wide[13] = h6l; \ - (state)->H.wide[14] = h7h; \ - (state)->H.wide[15] = h7l; \ - } while (0) - -#define INPUT_BUF1 \ - sph_u64 m0h = dec64e_aligned(buf + 0); \ - sph_u64 m0l = dec64e_aligned(buf + 8); \ - sph_u64 m1h = dec64e_aligned(buf + 16); \ - sph_u64 m1l = dec64e_aligned(buf + 24); \ - sph_u64 m2h = dec64e_aligned(buf + 32); \ - sph_u64 m2l = dec64e_aligned(buf + 40); \ - sph_u64 m3h = dec64e_aligned(buf + 48); \ - sph_u64 m3l = dec64e_aligned(buf + 56); \ - h0h ^= m0h; \ - h0l ^= m0l; \ - h1h ^= m1h; \ - h1l ^= m1l; \ - h2h ^= m2h; \ - h2l ^= m2l; \ - h3h ^= m3h; \ - h3l ^= m3l; - -#define INPUT_BUF2 \ - h4h ^= m0h; \ - h4l ^= m0l; \ - h5h ^= m1h; \ - h5l ^= m1l; \ - h6h ^= m2h; \ - h6l ^= m2l; \ - h7h ^= m3h; \ - h7l ^= m3l; - -static const sph_u64 IV224[] = { - C64e(0x2dfedd62f99a98ac), C64e(0xae7cacd619d634e7), - C64e(0xa4831005bc301216), C64e(0xb86038c6c9661494), - C64e(0x66d9899f2580706f), C64e(0xce9ea31b1d9b1adc), - C64e(0x11e8325f7b366e10), C64e(0xf994857f02fa06c1), - C64e(0x1b4f1b5cd8c840b3), C64e(0x97f6a17f6e738099), - C64e(0xdcdf93a5adeaa3d3), C64e(0xa431e8dec9539a68), - C64e(0x22b4a98aec86a1e4), C64e(0xd574ac959ce56cf0), - C64e(0x15960deab5ab2bbf), C64e(0x9611dcf0dd64ea6e) -}; - -static const sph_u64 IV256[] = { - C64e(0xeb98a3412c20d3eb), C64e(0x92cdbe7b9cb245c1), - C64e(0x1c93519160d4c7fa), C64e(0x260082d67e508a03), - C64e(0xa4239e267726b945), C64e(0xe0fb1a48d41a9477), - C64e(0xcdb5ab26026b177a), C64e(0x56f024420fff2fa8), - C64e(0x71a396897f2e4d75), C64e(0x1d144908f77de262), - C64e(0x277695f776248f94), C64e(0x87d5b6574780296c), - C64e(0x5c5e272dac8e0d6c), C64e(0x518450c657057a0f), - C64e(0x7be4d367702412ea), C64e(0x89e3ab13d31cd769) -}; - -static const sph_u64 IV384[] = { - C64e(0x481e3bc6d813398a), C64e(0x6d3b5e894ade879b), - C64e(0x63faea68d480ad2e), C64e(0x332ccb21480f8267), - C64e(0x98aec84d9082b928), C64e(0xd455ea3041114249), - C64e(0x36f555b2924847ec), C64e(0xc7250a93baf43ce1), - C64e(0x569b7f8a27db454c), C64e(0x9efcbd496397af0e), - C64e(0x589fc27d26aa80cd), C64e(0x80c08b8c9deb2eda), - C64e(0x8a7981e8f8d5373a), C64e(0xf43967adddd17a71), - C64e(0xa9b4d3bda475d394), C64e(0x976c3fba9842737f) -}; - -static const sph_u64 IV512[] = { - C64e(0x6fd14b963e00aa17), C64e(0x636a2e057a15d543), - C64e(0x8a225e8d0c97ef0b), C64e(0xe9341259f2b3c361), - C64e(0x891da0c1536f801e), C64e(0x2aa9056bea2b6d80), - C64e(0x588eccdb2075baa6), C64e(0xa90f3a76baf83bf7), - C64e(0x0169e60541e34a69), C64e(0x46b58a8e2e6fe65a), - C64e(0x1047a7d0c1843c24), C64e(0x3b6e71b12d5ac199), - C64e(0xcf57f6ec9db1f856), C64e(0xa706887c5716b156), - C64e(0xe3c2fcdfe68517fb), C64e(0x545a4678cc8cdd4b) -}; - -#else - -static const sph_u32 C[] = { - C32e(0x72d5dea2), C32e(0xdf15f867), C32e(0x7b84150a), - C32e(0xb7231557), C32e(0x81abd690), C32e(0x4d5a87f6), - C32e(0x4e9f4fc5), C32e(0xc3d12b40), C32e(0xea983ae0), - C32e(0x5c45fa9c), C32e(0x03c5d299), C32e(0x66b2999a), - C32e(0x660296b4), C32e(0xf2bb538a), C32e(0xb556141a), - C32e(0x88dba231), C32e(0x03a35a5c), C32e(0x9a190edb), - C32e(0x403fb20a), C32e(0x87c14410), C32e(0x1c051980), - C32e(0x849e951d), C32e(0x6f33ebad), C32e(0x5ee7cddc), - C32e(0x10ba1392), C32e(0x02bf6b41), C32e(0xdc786515), - C32e(0xf7bb27d0), C32e(0x0a2c8139), C32e(0x37aa7850), - C32e(0x3f1abfd2), C32e(0x410091d3), C32e(0x422d5a0d), - C32e(0xf6cc7e90), C32e(0xdd629f9c), C32e(0x92c097ce), - C32e(0x185ca70b), C32e(0xc72b44ac), C32e(0xd1df65d6), - C32e(0x63c6fc23), C32e(0x976e6c03), C32e(0x9ee0b81a), - C32e(0x2105457e), C32e(0x446ceca8), C32e(0xeef103bb), - C32e(0x5d8e61fa), C32e(0xfd9697b2), C32e(0x94838197), - C32e(0x4a8e8537), C32e(0xdb03302f), C32e(0x2a678d2d), - C32e(0xfb9f6a95), C32e(0x8afe7381), C32e(0xf8b8696c), - C32e(0x8ac77246), C32e(0xc07f4214), C32e(0xc5f4158f), - C32e(0xbdc75ec4), C32e(0x75446fa7), C32e(0x8f11bb80), - C32e(0x52de75b7), C32e(0xaee488bc), C32e(0x82b8001e), - C32e(0x98a6a3f4), C32e(0x8ef48f33), C32e(0xa9a36315), - C32e(0xaa5f5624), C32e(0xd5b7f989), C32e(0xb6f1ed20), - C32e(0x7c5ae0fd), C32e(0x36cae95a), C32e(0x06422c36), - C32e(0xce293543), C32e(0x4efe983d), C32e(0x533af974), - C32e(0x739a4ba7), C32e(0xd0f51f59), C32e(0x6f4e8186), - C32e(0x0e9dad81), C32e(0xafd85a9f), C32e(0xa7050667), - C32e(0xee34626a), C32e(0x8b0b28be), C32e(0x6eb91727), - C32e(0x47740726), C32e(0xc680103f), C32e(0xe0a07e6f), - C32e(0xc67e487b), C32e(0x0d550aa5), C32e(0x4af8a4c0), - C32e(0x91e3e79f), C32e(0x978ef19e), C32e(0x86767281), - C32e(0x50608dd4), C32e(0x7e9e5a41), C32e(0xf3e5b062), - C32e(0xfc9f1fec), C32e(0x4054207a), C32e(0xe3e41a00), - C32e(0xcef4c984), C32e(0x4fd794f5), C32e(0x9dfa95d8), - C32e(0x552e7e11), C32e(0x24c354a5), C32e(0x5bdf7228), - C32e(0xbdfe6e28), C32e(0x78f57fe2), C32e(0x0fa5c4b2), - C32e(0x05897cef), C32e(0xee49d32e), C32e(0x447e9385), - C32e(0xeb28597f), C32e(0x705f6937), C32e(0xb324314a), - C32e(0x5e8628f1), C32e(0x1dd6e465), C32e(0xc71b7704), - C32e(0x51b920e7), C32e(0x74fe43e8), C32e(0x23d4878a), - C32e(0x7d29e8a3), C32e(0x927694f2), C32e(0xddcb7a09), - C32e(0x9b30d9c1), C32e(0x1d1b30fb), C32e(0x5bdc1be0), - C32e(0xda24494f), C32e(0xf29c82bf), C32e(0xa4e7ba31), - C32e(0xb470bfff), C32e(0x0d324405), C32e(0xdef8bc48), - C32e(0x3baefc32), C32e(0x53bbd339), C32e(0x459fc3c1), - C32e(0xe0298ba0), C32e(0xe5c905fd), C32e(0xf7ae090f), - C32e(0x94703412), C32e(0x4290f134), C32e(0xa271b701), - C32e(0xe344ed95), C32e(0xe93b8e36), C32e(0x4f2f984a), - C32e(0x88401d63), C32e(0xa06cf615), C32e(0x47c1444b), - C32e(0x8752afff), C32e(0x7ebb4af1), C32e(0xe20ac630), - C32e(0x4670b6c5), C32e(0xcc6e8ce6), C32e(0xa4d5a456), - C32e(0xbd4fca00), C32e(0xda9d844b), C32e(0xc83e18ae), - C32e(0x7357ce45), C32e(0x3064d1ad), C32e(0xe8a6ce68), - C32e(0x145c2567), C32e(0xa3da8cf2), C32e(0xcb0ee116), - C32e(0x33e90658), C32e(0x9a94999a), C32e(0x1f60b220), - C32e(0xc26f847b), C32e(0xd1ceac7f), C32e(0xa0d18518), - C32e(0x32595ba1), C32e(0x8ddd19d3), C32e(0x509a1cc0), - C32e(0xaaa5b446), C32e(0x9f3d6367), C32e(0xe4046bba), - C32e(0xf6ca19ab), C32e(0x0b56ee7e), C32e(0x1fb179ea), - C32e(0xa9282174), C32e(0xe9bdf735), C32e(0x3b3651ee), - C32e(0x1d57ac5a), C32e(0x7550d376), C32e(0x3a46c2fe), - C32e(0xa37d7001), C32e(0xf735c1af), C32e(0x98a4d842), - C32e(0x78edec20), C32e(0x9e6b6779), C32e(0x41836315), - C32e(0xea3adba8), C32e(0xfac33b4d), C32e(0x32832c83), - C32e(0xa7403b1f), C32e(0x1c2747f3), C32e(0x5940f034), - C32e(0xb72d769a), C32e(0xe73e4e6c), C32e(0xd2214ffd), - C32e(0xb8fd8d39), C32e(0xdc5759ef), C32e(0x8d9b0c49), - C32e(0x2b49ebda), C32e(0x5ba2d749), C32e(0x68f3700d), - C32e(0x7d3baed0), C32e(0x7a8d5584), C32e(0xf5a5e9f0), - C32e(0xe4f88e65), C32e(0xa0b8a2f4), C32e(0x36103b53), - C32e(0x0ca8079e), C32e(0x753eec5a), C32e(0x91689492), - C32e(0x56e8884f), C32e(0x5bb05c55), C32e(0xf8babc4c), - C32e(0xe3bb3b99), C32e(0xf387947b), C32e(0x75daf4d6), - C32e(0x726b1c5d), C32e(0x64aeac28), C32e(0xdc34b36d), - C32e(0x6c34a550), C32e(0xb828db71), C32e(0xf861e2f2), - C32e(0x108d512a), C32e(0xe3db6433), C32e(0x59dd75fc), - C32e(0x1cacbcf1), C32e(0x43ce3fa2), C32e(0x67bbd13c), - C32e(0x02e843b0), C32e(0x330a5bca), C32e(0x8829a175), - C32e(0x7f34194d), C32e(0xb416535c), C32e(0x923b94c3), - C32e(0x0e794d1e), C32e(0x797475d7), C32e(0xb6eeaf3f), - C32e(0xeaa8d4f7), C32e(0xbe1a3921), C32e(0x5cf47e09), - C32e(0x4c232751), C32e(0x26a32453), C32e(0xba323cd2), - C32e(0x44a3174a), C32e(0x6da6d5ad), C32e(0xb51d3ea6), - C32e(0xaff2c908), C32e(0x83593d98), C32e(0x916b3c56), - C32e(0x4cf87ca1), C32e(0x7286604d), C32e(0x46e23ecc), - C32e(0x086ec7f6), C32e(0x2f9833b3), C32e(0xb1bc765e), - C32e(0x2bd666a5), C32e(0xefc4e62a), C32e(0x06f4b6e8), - C32e(0xbec1d436), C32e(0x74ee8215), C32e(0xbcef2163), - C32e(0xfdc14e0d), C32e(0xf453c969), C32e(0xa77d5ac4), - C32e(0x06585826), C32e(0x7ec11416), C32e(0x06e0fa16), - C32e(0x7e90af3d), C32e(0x28639d3f), C32e(0xd2c9f2e3), - C32e(0x009bd20c), C32e(0x5faace30), C32e(0xb7d40c30), - C32e(0x742a5116), C32e(0xf2e03298), C32e(0x0deb30d8), - C32e(0xe3cef89a), C32e(0x4bc59e7b), C32e(0xb5f17992), - C32e(0xff51e66e), C32e(0x048668d3), C32e(0x9b234d57), - C32e(0xe6966731), C32e(0xcce6a6f3), C32e(0x170a7505), - C32e(0xb17681d9), C32e(0x13326cce), C32e(0x3c175284), - C32e(0xf805a262), C32e(0xf42bcbb3), C32e(0x78471547), - C32e(0xff465482), C32e(0x23936a48), C32e(0x38df5807), - C32e(0x4e5e6565), C32e(0xf2fc7c89), C32e(0xfc86508e), - C32e(0x31702e44), C32e(0xd00bca86), C32e(0xf04009a2), - C32e(0x3078474e), C32e(0x65a0ee39), C32e(0xd1f73883), - C32e(0xf75ee937), C32e(0xe42c3abd), C32e(0x2197b226), - C32e(0x0113f86f), C32e(0xa344edd1), C32e(0xef9fdee7), - C32e(0x8ba0df15), C32e(0x762592d9), C32e(0x3c85f7f6), - C32e(0x12dc42be), C32e(0xd8a7ec7c), C32e(0xab27b07e), - C32e(0x538d7dda), C32e(0xaa3ea8de), C32e(0xaa25ce93), - C32e(0xbd0269d8), C32e(0x5af643fd), C32e(0x1a7308f9), - C32e(0xc05fefda), C32e(0x174a19a5), C32e(0x974d6633), - C32e(0x4cfd216a), C32e(0x35b49831), C32e(0xdb411570), - C32e(0xea1e0fbb), C32e(0xedcd549b), C32e(0x9ad063a1), - C32e(0x51974072), C32e(0xf6759dbf), C32e(0x91476fe2) -}; - -#define Ceven_w3(r) (C[((r) << 3) + 0]) -#define Ceven_w2(r) (C[((r) << 3) + 1]) -#define Ceven_w1(r) (C[((r) << 3) + 2]) -#define Ceven_w0(r) (C[((r) << 3) + 3]) -#define Codd_w3(r) (C[((r) << 3) + 4]) -#define Codd_w2(r) (C[((r) << 3) + 5]) -#define Codd_w1(r) (C[((r) << 3) + 6]) -#define Codd_w0(r) (C[((r) << 3) + 7]) - -#define S(x0, x1, x2, x3, cb, r) do { \ - Sb(x0 ## 3, x1 ## 3, x2 ## 3, x3 ## 3, cb ## w3(r)); \ - Sb(x0 ## 2, x1 ## 2, x2 ## 2, x3 ## 2, cb ## w2(r)); \ - Sb(x0 ## 1, x1 ## 1, x2 ## 1, x3 ## 1, cb ## w1(r)); \ - Sb(x0 ## 0, x1 ## 0, x2 ## 0, x3 ## 0, cb ## w0(r)); \ - } while (0) - -#define L(x0, x1, x2, x3, x4, x5, x6, x7) do { \ - Lb(x0 ## 3, x1 ## 3, x2 ## 3, x3 ## 3, \ - x4 ## 3, x5 ## 3, x6 ## 3, x7 ## 3); \ - Lb(x0 ## 2, x1 ## 2, x2 ## 2, x3 ## 2, \ - x4 ## 2, x5 ## 2, x6 ## 2, x7 ## 2); \ - Lb(x0 ## 1, x1 ## 1, x2 ## 1, x3 ## 1, \ - x4 ## 1, x5 ## 1, x6 ## 1, x7 ## 1); \ - Lb(x0 ## 0, x1 ## 0, x2 ## 0, x3 ## 0, \ - x4 ## 0, x5 ## 0, x6 ## 0, x7 ## 0); \ - } while (0) - -#define Wz(x, c, n) do { \ - sph_u32 t = (x ## 3 & (c)) << (n); \ - x ## 3 = ((x ## 3 >> (n)) & (c)) | t; \ - t = (x ## 2 & (c)) << (n); \ - x ## 2 = ((x ## 2 >> (n)) & (c)) | t; \ - t = (x ## 1 & (c)) << (n); \ - x ## 1 = ((x ## 1 >> (n)) & (c)) | t; \ - t = (x ## 0 & (c)) << (n); \ - x ## 0 = ((x ## 0 >> (n)) & (c)) | t; \ - } while (0) - -#define W0(x) Wz(x, SPH_C32(0x55555555), 1) -#define W1(x) Wz(x, SPH_C32(0x33333333), 2) -#define W2(x) Wz(x, SPH_C32(0x0F0F0F0F), 4) -#define W3(x) Wz(x, SPH_C32(0x00FF00FF), 8) -#define W4(x) Wz(x, SPH_C32(0x0000FFFF), 16) -#define W5(x) do { \ - sph_u32 t = x ## 3; \ - x ## 3 = x ## 2; \ - x ## 2 = t; \ - t = x ## 1; \ - x ## 1 = x ## 0; \ - x ## 0 = t; \ - } while (0) -#define W6(x) do { \ - sph_u32 t = x ## 3; \ - x ## 3 = x ## 1; \ - x ## 1 = t; \ - t = x ## 2; \ - x ## 2 = x ## 0; \ - x ## 0 = t; \ - } while (0) - -#define DECL_STATE \ - sph_u32 h03, h02, h01, h00, h13, h12, h11, h10; \ - sph_u32 h23, h22, h21, h20, h33, h32, h31, h30; \ - sph_u32 h43, h42, h41, h40, h53, h52, h51, h50; \ - sph_u32 h63, h62, h61, h60, h73, h72, h71, h70; \ - sph_u32 tmp; - -#define READ_STATE(state) do { \ - h03 = (state)->H.narrow[ 0]; \ - h02 = (state)->H.narrow[ 1]; \ - h01 = (state)->H.narrow[ 2]; \ - h00 = (state)->H.narrow[ 3]; \ - h13 = (state)->H.narrow[ 4]; \ - h12 = (state)->H.narrow[ 5]; \ - h11 = (state)->H.narrow[ 6]; \ - h10 = (state)->H.narrow[ 7]; \ - h23 = (state)->H.narrow[ 8]; \ - h22 = (state)->H.narrow[ 9]; \ - h21 = (state)->H.narrow[10]; \ - h20 = (state)->H.narrow[11]; \ - h33 = (state)->H.narrow[12]; \ - h32 = (state)->H.narrow[13]; \ - h31 = (state)->H.narrow[14]; \ - h30 = (state)->H.narrow[15]; \ - h43 = (state)->H.narrow[16]; \ - h42 = (state)->H.narrow[17]; \ - h41 = (state)->H.narrow[18]; \ - h40 = (state)->H.narrow[19]; \ - h53 = (state)->H.narrow[20]; \ - h52 = (state)->H.narrow[21]; \ - h51 = (state)->H.narrow[22]; \ - h50 = (state)->H.narrow[23]; \ - h63 = (state)->H.narrow[24]; \ - h62 = (state)->H.narrow[25]; \ - h61 = (state)->H.narrow[26]; \ - h60 = (state)->H.narrow[27]; \ - h73 = (state)->H.narrow[28]; \ - h72 = (state)->H.narrow[29]; \ - h71 = (state)->H.narrow[30]; \ - h70 = (state)->H.narrow[31]; \ - } while (0) - -#define WRITE_STATE(state) do { \ - (state)->H.narrow[ 0] = h03; \ - (state)->H.narrow[ 1] = h02; \ - (state)->H.narrow[ 2] = h01; \ - (state)->H.narrow[ 3] = h00; \ - (state)->H.narrow[ 4] = h13; \ - (state)->H.narrow[ 5] = h12; \ - (state)->H.narrow[ 6] = h11; \ - (state)->H.narrow[ 7] = h10; \ - (state)->H.narrow[ 8] = h23; \ - (state)->H.narrow[ 9] = h22; \ - (state)->H.narrow[10] = h21; \ - (state)->H.narrow[11] = h20; \ - (state)->H.narrow[12] = h33; \ - (state)->H.narrow[13] = h32; \ - (state)->H.narrow[14] = h31; \ - (state)->H.narrow[15] = h30; \ - (state)->H.narrow[16] = h43; \ - (state)->H.narrow[17] = h42; \ - (state)->H.narrow[18] = h41; \ - (state)->H.narrow[19] = h40; \ - (state)->H.narrow[20] = h53; \ - (state)->H.narrow[21] = h52; \ - (state)->H.narrow[22] = h51; \ - (state)->H.narrow[23] = h50; \ - (state)->H.narrow[24] = h63; \ - (state)->H.narrow[25] = h62; \ - (state)->H.narrow[26] = h61; \ - (state)->H.narrow[27] = h60; \ - (state)->H.narrow[28] = h73; \ - (state)->H.narrow[29] = h72; \ - (state)->H.narrow[30] = h71; \ - (state)->H.narrow[31] = h70; \ - } while (0) - -#define INPUT_BUF1 \ - sph_u32 m03 = dec32e_aligned(buf + 0); \ - sph_u32 m02 = dec32e_aligned(buf + 4); \ - sph_u32 m01 = dec32e_aligned(buf + 8); \ - sph_u32 m00 = dec32e_aligned(buf + 12); \ - sph_u32 m13 = dec32e_aligned(buf + 16); \ - sph_u32 m12 = dec32e_aligned(buf + 20); \ - sph_u32 m11 = dec32e_aligned(buf + 24); \ - sph_u32 m10 = dec32e_aligned(buf + 28); \ - sph_u32 m23 = dec32e_aligned(buf + 32); \ - sph_u32 m22 = dec32e_aligned(buf + 36); \ - sph_u32 m21 = dec32e_aligned(buf + 40); \ - sph_u32 m20 = dec32e_aligned(buf + 44); \ - sph_u32 m33 = dec32e_aligned(buf + 48); \ - sph_u32 m32 = dec32e_aligned(buf + 52); \ - sph_u32 m31 = dec32e_aligned(buf + 56); \ - sph_u32 m30 = dec32e_aligned(buf + 60); \ - h03 ^= m03; \ - h02 ^= m02; \ - h01 ^= m01; \ - h00 ^= m00; \ - h13 ^= m13; \ - h12 ^= m12; \ - h11 ^= m11; \ - h10 ^= m10; \ - h23 ^= m23; \ - h22 ^= m22; \ - h21 ^= m21; \ - h20 ^= m20; \ - h33 ^= m33; \ - h32 ^= m32; \ - h31 ^= m31; \ - h30 ^= m30; - -#define INPUT_BUF2 \ - h43 ^= m03; \ - h42 ^= m02; \ - h41 ^= m01; \ - h40 ^= m00; \ - h53 ^= m13; \ - h52 ^= m12; \ - h51 ^= m11; \ - h50 ^= m10; \ - h63 ^= m23; \ - h62 ^= m22; \ - h61 ^= m21; \ - h60 ^= m20; \ - h73 ^= m33; \ - h72 ^= m32; \ - h71 ^= m31; \ - h70 ^= m30; - -static const sph_u32 IV224[] = { - C32e(0x2dfedd62), C32e(0xf99a98ac), C32e(0xae7cacd6), C32e(0x19d634e7), - C32e(0xa4831005), C32e(0xbc301216), C32e(0xb86038c6), C32e(0xc9661494), - C32e(0x66d9899f), C32e(0x2580706f), C32e(0xce9ea31b), C32e(0x1d9b1adc), - C32e(0x11e8325f), C32e(0x7b366e10), C32e(0xf994857f), C32e(0x02fa06c1), - C32e(0x1b4f1b5c), C32e(0xd8c840b3), C32e(0x97f6a17f), C32e(0x6e738099), - C32e(0xdcdf93a5), C32e(0xadeaa3d3), C32e(0xa431e8de), C32e(0xc9539a68), - C32e(0x22b4a98a), C32e(0xec86a1e4), C32e(0xd574ac95), C32e(0x9ce56cf0), - C32e(0x15960dea), C32e(0xb5ab2bbf), C32e(0x9611dcf0), C32e(0xdd64ea6e) -}; - -static const sph_u32 IV256[] = { - C32e(0xeb98a341), C32e(0x2c20d3eb), C32e(0x92cdbe7b), C32e(0x9cb245c1), - C32e(0x1c935191), C32e(0x60d4c7fa), C32e(0x260082d6), C32e(0x7e508a03), - C32e(0xa4239e26), C32e(0x7726b945), C32e(0xe0fb1a48), C32e(0xd41a9477), - C32e(0xcdb5ab26), C32e(0x026b177a), C32e(0x56f02442), C32e(0x0fff2fa8), - C32e(0x71a39689), C32e(0x7f2e4d75), C32e(0x1d144908), C32e(0xf77de262), - C32e(0x277695f7), C32e(0x76248f94), C32e(0x87d5b657), C32e(0x4780296c), - C32e(0x5c5e272d), C32e(0xac8e0d6c), C32e(0x518450c6), C32e(0x57057a0f), - C32e(0x7be4d367), C32e(0x702412ea), C32e(0x89e3ab13), C32e(0xd31cd769) -}; - -static const sph_u32 IV384[] = { - C32e(0x481e3bc6), C32e(0xd813398a), C32e(0x6d3b5e89), C32e(0x4ade879b), - C32e(0x63faea68), C32e(0xd480ad2e), C32e(0x332ccb21), C32e(0x480f8267), - C32e(0x98aec84d), C32e(0x9082b928), C32e(0xd455ea30), C32e(0x41114249), - C32e(0x36f555b2), C32e(0x924847ec), C32e(0xc7250a93), C32e(0xbaf43ce1), - C32e(0x569b7f8a), C32e(0x27db454c), C32e(0x9efcbd49), C32e(0x6397af0e), - C32e(0x589fc27d), C32e(0x26aa80cd), C32e(0x80c08b8c), C32e(0x9deb2eda), - C32e(0x8a7981e8), C32e(0xf8d5373a), C32e(0xf43967ad), C32e(0xddd17a71), - C32e(0xa9b4d3bd), C32e(0xa475d394), C32e(0x976c3fba), C32e(0x9842737f) -}; - -static const sph_u32 IV512[] = { - C32e(0x6fd14b96), C32e(0x3e00aa17), C32e(0x636a2e05), C32e(0x7a15d543), - C32e(0x8a225e8d), C32e(0x0c97ef0b), C32e(0xe9341259), C32e(0xf2b3c361), - C32e(0x891da0c1), C32e(0x536f801e), C32e(0x2aa9056b), C32e(0xea2b6d80), - C32e(0x588eccdb), C32e(0x2075baa6), C32e(0xa90f3a76), C32e(0xbaf83bf7), - C32e(0x0169e605), C32e(0x41e34a69), C32e(0x46b58a8e), C32e(0x2e6fe65a), - C32e(0x1047a7d0), C32e(0xc1843c24), C32e(0x3b6e71b1), C32e(0x2d5ac199), - C32e(0xcf57f6ec), C32e(0x9db1f856), C32e(0xa706887c), C32e(0x5716b156), - C32e(0xe3c2fcdf), C32e(0xe68517fb), C32e(0x545a4678), C32e(0xcc8cdd4b) -}; - -#endif - -#define SL(ro) SLu(r + ro, ro) - -#define SLu(r, ro) do { \ - S(h0, h2, h4, h6, Ceven_, r); \ - S(h1, h3, h5, h7, Codd_, r); \ - L(h0, h2, h4, h6, h1, h3, h5, h7); \ - W ## ro(h1); \ - W ## ro(h3); \ - W ## ro(h5); \ - W ## ro(h7); \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_JH - -#if SPH_JH_64 - -/* - * The "small footprint" 64-bit version just uses a partially unrolled - * loop. - */ - -#define E8 do { \ - unsigned r; \ - for (r = 0; r < 42; r += 7) { \ - SL(0); \ - SL(1); \ - SL(2); \ - SL(3); \ - SL(4); \ - SL(5); \ - SL(6); \ - } \ - } while (0) - -#else - -#define E8 do { \ - unsigned r, g; \ - for (r = g = 0; r < 42; r ++) { \ - S(h0, h2, h4, h6, Ceven_, r); \ - S(h1, h3, h5, h7, Codd_, r); \ - L(h0, h2, h4, h6, h1, h3, h5, h7); \ - switch (g) { \ - case 0: \ - W0(h1); \ - W0(h3); \ - W0(h5); \ - W0(h7); \ - break; \ - case 1: \ - W1(h1); \ - W1(h3); \ - W1(h5); \ - W1(h7); \ - break; \ - case 2: \ - W2(h1); \ - W2(h3); \ - W2(h5); \ - W2(h7); \ - break; \ - case 3: \ - W3(h1); \ - W3(h3); \ - W3(h5); \ - W3(h7); \ - break; \ - case 4: \ - W4(h1); \ - W4(h3); \ - W4(h5); \ - W4(h7); \ - break; \ - case 5: \ - W5(h1); \ - W5(h3); \ - W5(h5); \ - W5(h7); \ - break; \ - case 6: \ - W6(h1); \ - W6(h3); \ - W6(h5); \ - W6(h7); \ - break; \ - } \ - if (++ g == 7) \ - g = 0; \ - } \ - } while (0) - -#endif - -#else - -#if SPH_JH_64 - -/* - * On a "true 64-bit" architecture, we can unroll at will. - */ - -#define E8 do { \ - SLu( 0, 0); \ - SLu( 1, 1); \ - SLu( 2, 2); \ - SLu( 3, 3); \ - SLu( 4, 4); \ - SLu( 5, 5); \ - SLu( 6, 6); \ - SLu( 7, 0); \ - SLu( 8, 1); \ - SLu( 9, 2); \ - SLu(10, 3); \ - SLu(11, 4); \ - SLu(12, 5); \ - SLu(13, 6); \ - SLu(14, 0); \ - SLu(15, 1); \ - SLu(16, 2); \ - SLu(17, 3); \ - SLu(18, 4); \ - SLu(19, 5); \ - SLu(20, 6); \ - SLu(21, 0); \ - SLu(22, 1); \ - SLu(23, 2); \ - SLu(24, 3); \ - SLu(25, 4); \ - SLu(26, 5); \ - SLu(27, 6); \ - SLu(28, 0); \ - SLu(29, 1); \ - SLu(30, 2); \ - SLu(31, 3); \ - SLu(32, 4); \ - SLu(33, 5); \ - SLu(34, 6); \ - SLu(35, 0); \ - SLu(36, 1); \ - SLu(37, 2); \ - SLu(38, 3); \ - SLu(39, 4); \ - SLu(40, 5); \ - SLu(41, 6); \ - } while (0) - -#else - -/* - * We are not aiming at a small footprint, but we are still using a - * 32-bit implementation. Full loop unrolling would smash the L1 - * cache on some "big" architectures (32 kB L1 cache). - */ - -#define E8 do { \ - unsigned r; \ - for (r = 0; r < 42; r += 7) { \ - SL(0); \ - SL(1); \ - SL(2); \ - SL(3); \ - SL(4); \ - SL(5); \ - SL(6); \ - } \ - } while (0) - -#endif - -#endif - -static void -jh_init(sph_jh_context *sc, const void *iv) -{ - sc->ptr = 0; -#if SPH_JH_64 - memcpy(sc->H.wide, iv, sizeof sc->H.wide); -#else - memcpy(sc->H.narrow, iv, sizeof sc->H.narrow); -#endif -#if SPH_64 - sc->block_count = 0; -#else - sc->block_count_high = 0; - sc->block_count_low = 0; -#endif -} - -static void -jh_core(sph_jh_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - DECL_STATE - - buf = sc->buf; - ptr = sc->ptr; - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - READ_STATE(sc); - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data = (const unsigned char *)data + clen; - len -= clen; - if (ptr == sizeof sc->buf) { - INPUT_BUF1; - E8; - INPUT_BUF2; -#if SPH_64 - sc->block_count ++; -#else - if ((sc->block_count_low = SPH_T32( - sc->block_count_low + 1)) == 0) - sc->block_count_high ++; -#endif - ptr = 0; - } - } - WRITE_STATE(sc); - sc->ptr = ptr; -} - -static void -jh_close(sph_jh_context *sc, unsigned ub, unsigned n, - void *dst, size_t out_size_w32, const void *iv) -{ - unsigned z; - unsigned char buf[128]; - size_t numz, u; -#if SPH_64 - sph_u64 l0, l1; -#else - sph_u32 l0, l1, l2, l3; -#endif - - z = 0x80 >> n; - buf[0] = ((ub & -z) | z) & 0xFF; - if (sc->ptr == 0 && n == 0) { - numz = 47; - } else { - numz = 111 - sc->ptr; - } - memset(buf + 1, 0, numz); -#if SPH_64 - l0 = SPH_T64(sc->block_count << 9) + (sc->ptr << 3) + n; - l1 = SPH_T64(sc->block_count >> 55); - sph_enc64be(buf + numz + 1, l1); - sph_enc64be(buf + numz + 9, l0); -#else - l0 = SPH_T32(sc->block_count_low << 9) + (sc->ptr << 3) + n; - l1 = SPH_T32(sc->block_count_low >> 23) - + SPH_T32(sc->block_count_high << 9); - l2 = SPH_T32(sc->block_count_high >> 23); - l3 = 0; - sph_enc32be(buf + numz + 1, l3); - sph_enc32be(buf + numz + 5, l2); - sph_enc32be(buf + numz + 9, l1); - sph_enc32be(buf + numz + 13, l0); -#endif - jh_core(sc, buf, numz + 17); -#if SPH_JH_64 - for (u = 0; u < 8; u ++) - enc64e(buf + (u << 3), sc->H.wide[u + 8]); -#else - for (u = 0; u < 16; u ++) - enc32e(buf + (u << 2), sc->H.narrow[u + 16]); -#endif - memcpy(dst, buf + ((16 - out_size_w32) << 2), out_size_w32 << 2); - jh_init(sc, iv); -} - -/* see sph_jh.h */ -void -sph_jh224_init(void *cc) -{ - jh_init(cc, IV224); -} - -/* see sph_jh.h */ -void -sph_jh224(void *cc, const void *data, size_t len) -{ - jh_core(cc, data, len); -} - -/* see sph_jh.h */ -void -sph_jh224_close(void *cc, void *dst) -{ - jh_close(cc, 0, 0, dst, 7, IV224); -} - -/* see sph_jh.h */ -void -sph_jh224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - jh_close(cc, ub, n, dst, 7, IV224); -} - -/* see sph_jh.h */ -void -sph_jh256_init(void *cc) -{ - jh_init(cc, IV256); -} - -/* see sph_jh.h */ -void -sph_jh256(void *cc, const void *data, size_t len) -{ - jh_core(cc, data, len); -} - -/* see sph_jh.h */ -void -sph_jh256_close(void *cc, void *dst) -{ - jh_close(cc, 0, 0, dst, 8, IV256); -} - -/* see sph_jh.h */ -void -sph_jh256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - jh_close(cc, ub, n, dst, 8, IV256); -} - -/* see sph_jh.h */ -void -sph_jh384_init(void *cc) -{ - jh_init(cc, IV384); -} - -/* see sph_jh.h */ -void -sph_jh384(void *cc, const void *data, size_t len) -{ - jh_core(cc, data, len); -} - -/* see sph_jh.h */ -void -sph_jh384_close(void *cc, void *dst) -{ - jh_close(cc, 0, 0, dst, 12, IV384); -} - -/* see sph_jh.h */ -void -sph_jh384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - jh_close(cc, ub, n, dst, 12, IV384); -} - -/* see sph_jh.h */ -void -sph_jh512_init(void *cc) -{ - jh_init(cc, IV512); -} - -/* see sph_jh.h */ -void -sph_jh512(void *cc, const void *data, size_t len) -{ - jh_core(cc, data, len); -} - -/* see sph_jh.h */ -void -sph_jh512_close(void *cc, void *dst) -{ - jh_close(cc, 0, 0, dst, 16, IV512); -} - -/* see sph_jh.h */ -void -sph_jh512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - jh_close(cc, ub, n, dst, 16, IV512); -} diff --git a/sph/luffa.c b/sph/luffa.c deleted file mode 100644 index a761bea0..00000000 --- a/sph/luffa.c +++ /dev/null @@ -1,1426 +0,0 @@ -/* $Id: luffa.c 219 2010-06-08 17:24:41Z tp $ */ -/* - * Luffa implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include -#include - -#include "sph_luffa.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -#if SPH_64_TRUE && !defined SPH_LUFFA_PARALLEL -#define SPH_LUFFA_PARALLEL 1 -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -static const sph_u32 V_INIT[5][8] = { - { - SPH_C32(0x6d251e69), SPH_C32(0x44b051e0), - SPH_C32(0x4eaa6fb4), SPH_C32(0xdbf78465), - SPH_C32(0x6e292011), SPH_C32(0x90152df4), - SPH_C32(0xee058139), SPH_C32(0xdef610bb) - }, { - SPH_C32(0xc3b44b95), SPH_C32(0xd9d2f256), - SPH_C32(0x70eee9a0), SPH_C32(0xde099fa3), - SPH_C32(0x5d9b0557), SPH_C32(0x8fc944b3), - SPH_C32(0xcf1ccf0e), SPH_C32(0x746cd581) - }, { - SPH_C32(0xf7efc89d), SPH_C32(0x5dba5781), - SPH_C32(0x04016ce5), SPH_C32(0xad659c05), - SPH_C32(0x0306194f), SPH_C32(0x666d1836), - SPH_C32(0x24aa230a), SPH_C32(0x8b264ae7) - }, { - SPH_C32(0x858075d5), SPH_C32(0x36d79cce), - SPH_C32(0xe571f7d7), SPH_C32(0x204b1f67), - SPH_C32(0x35870c6a), SPH_C32(0x57e9e923), - SPH_C32(0x14bcb808), SPH_C32(0x7cde72ce) - }, { - SPH_C32(0x6c68e9be), SPH_C32(0x5ec41e22), - SPH_C32(0xc825b7c7), SPH_C32(0xaffb4363), - SPH_C32(0xf5df3999), SPH_C32(0x0fc688f1), - SPH_C32(0xb07224cc), SPH_C32(0x03e86cea) - } -}; - -static const sph_u32 RC00[8] = { - SPH_C32(0x303994a6), SPH_C32(0xc0e65299), - SPH_C32(0x6cc33a12), SPH_C32(0xdc56983e), - SPH_C32(0x1e00108f), SPH_C32(0x7800423d), - SPH_C32(0x8f5b7882), SPH_C32(0x96e1db12) -}; - -static const sph_u32 RC04[8] = { - SPH_C32(0xe0337818), SPH_C32(0x441ba90d), - SPH_C32(0x7f34d442), SPH_C32(0x9389217f), - SPH_C32(0xe5a8bce6), SPH_C32(0x5274baf4), - SPH_C32(0x26889ba7), SPH_C32(0x9a226e9d) -}; - -static const sph_u32 RC10[8] = { - SPH_C32(0xb6de10ed), SPH_C32(0x70f47aae), - SPH_C32(0x0707a3d4), SPH_C32(0x1c1e8f51), - SPH_C32(0x707a3d45), SPH_C32(0xaeb28562), - SPH_C32(0xbaca1589), SPH_C32(0x40a46f3e) -}; - -static const sph_u32 RC14[8] = { - SPH_C32(0x01685f3d), SPH_C32(0x05a17cf4), - SPH_C32(0xbd09caca), SPH_C32(0xf4272b28), - SPH_C32(0x144ae5cc), SPH_C32(0xfaa7ae2b), - SPH_C32(0x2e48f1c1), SPH_C32(0xb923c704) -}; - -#if SPH_LUFFA_PARALLEL - -static const sph_u64 RCW010[8] = { - SPH_C64(0xb6de10ed303994a6), SPH_C64(0x70f47aaec0e65299), - SPH_C64(0x0707a3d46cc33a12), SPH_C64(0x1c1e8f51dc56983e), - SPH_C64(0x707a3d451e00108f), SPH_C64(0xaeb285627800423d), - SPH_C64(0xbaca15898f5b7882), SPH_C64(0x40a46f3e96e1db12) -}; - -static const sph_u64 RCW014[8] = { - SPH_C64(0x01685f3de0337818), SPH_C64(0x05a17cf4441ba90d), - SPH_C64(0xbd09caca7f34d442), SPH_C64(0xf4272b289389217f), - SPH_C64(0x144ae5cce5a8bce6), SPH_C64(0xfaa7ae2b5274baf4), - SPH_C64(0x2e48f1c126889ba7), SPH_C64(0xb923c7049a226e9d) -}; - -#endif - -static const sph_u32 RC20[8] = { - SPH_C32(0xfc20d9d2), SPH_C32(0x34552e25), - SPH_C32(0x7ad8818f), SPH_C32(0x8438764a), - SPH_C32(0xbb6de032), SPH_C32(0xedb780c8), - SPH_C32(0xd9847356), SPH_C32(0xa2c78434) -}; - -static const sph_u32 RC24[8] = { - SPH_C32(0xe25e72c1), SPH_C32(0xe623bb72), - SPH_C32(0x5c58a4a4), SPH_C32(0x1e38e2e7), - SPH_C32(0x78e38b9d), SPH_C32(0x27586719), - SPH_C32(0x36eda57f), SPH_C32(0x703aace7) -}; - -static const sph_u32 RC30[8] = { - SPH_C32(0xb213afa5), SPH_C32(0xc84ebe95), - SPH_C32(0x4e608a22), SPH_C32(0x56d858fe), - SPH_C32(0x343b138f), SPH_C32(0xd0ec4e3d), - SPH_C32(0x2ceb4882), SPH_C32(0xb3ad2208) -}; - -static const sph_u32 RC34[8] = { - SPH_C32(0xe028c9bf), SPH_C32(0x44756f91), - SPH_C32(0x7e8fce32), SPH_C32(0x956548be), - SPH_C32(0xfe191be2), SPH_C32(0x3cb226e5), - SPH_C32(0x5944a28e), SPH_C32(0xa1c4c355) -}; - -#if SPH_LUFFA_PARALLEL - -static const sph_u64 RCW230[8] = { - SPH_C64(0xb213afa5fc20d9d2), SPH_C64(0xc84ebe9534552e25), - SPH_C64(0x4e608a227ad8818f), SPH_C64(0x56d858fe8438764a), - SPH_C64(0x343b138fbb6de032), SPH_C64(0xd0ec4e3dedb780c8), - SPH_C64(0x2ceb4882d9847356), SPH_C64(0xb3ad2208a2c78434) -}; - - -static const sph_u64 RCW234[8] = { - SPH_C64(0xe028c9bfe25e72c1), SPH_C64(0x44756f91e623bb72), - SPH_C64(0x7e8fce325c58a4a4), SPH_C64(0x956548be1e38e2e7), - SPH_C64(0xfe191be278e38b9d), SPH_C64(0x3cb226e527586719), - SPH_C64(0x5944a28e36eda57f), SPH_C64(0xa1c4c355703aace7) -}; - -#endif - -static const sph_u32 RC40[8] = { - SPH_C32(0xf0d2e9e3), SPH_C32(0xac11d7fa), - SPH_C32(0x1bcb66f2), SPH_C32(0x6f2d9bc9), - SPH_C32(0x78602649), SPH_C32(0x8edae952), - SPH_C32(0x3b6ba548), SPH_C32(0xedae9520) -}; - -static const sph_u32 RC44[8] = { - SPH_C32(0x5090d577), SPH_C32(0x2d1925ab), - SPH_C32(0xb46496ac), SPH_C32(0xd1925ab0), - SPH_C32(0x29131ab6), SPH_C32(0x0fc053c3), - SPH_C32(0x3f014f0c), SPH_C32(0xfc053c31) -}; - -#define DECL_TMP8(w) \ - sph_u32 w ## 0, w ## 1, w ## 2, w ## 3, w ## 4, w ## 5, w ## 6, w ## 7; - -#define M2(d, s) do { \ - sph_u32 tmp = s ## 7; \ - d ## 7 = s ## 6; \ - d ## 6 = s ## 5; \ - d ## 5 = s ## 4; \ - d ## 4 = s ## 3 ^ tmp; \ - d ## 3 = s ## 2 ^ tmp; \ - d ## 2 = s ## 1; \ - d ## 1 = s ## 0 ^ tmp; \ - d ## 0 = tmp; \ - } while (0) - -#define XOR(d, s1, s2) do { \ - d ## 0 = s1 ## 0 ^ s2 ## 0; \ - d ## 1 = s1 ## 1 ^ s2 ## 1; \ - d ## 2 = s1 ## 2 ^ s2 ## 2; \ - d ## 3 = s1 ## 3 ^ s2 ## 3; \ - d ## 4 = s1 ## 4 ^ s2 ## 4; \ - d ## 5 = s1 ## 5 ^ s2 ## 5; \ - d ## 6 = s1 ## 6 ^ s2 ## 6; \ - d ## 7 = s1 ## 7 ^ s2 ## 7; \ - } while (0) - -#if SPH_LUFFA_PARALLEL - -#define SUB_CRUMB_GEN(a0, a1, a2, a3, width) do { \ - sph_u ## width tmp; \ - tmp = (a0); \ - (a0) |= (a1); \ - (a2) ^= (a3); \ - (a1) = SPH_T ## width(~(a1)); \ - (a0) ^= (a3); \ - (a3) &= tmp; \ - (a1) ^= (a3); \ - (a3) ^= (a2); \ - (a2) &= (a0); \ - (a0) = SPH_T ## width(~(a0)); \ - (a2) ^= (a1); \ - (a1) |= (a3); \ - tmp ^= (a1); \ - (a3) ^= (a2); \ - (a2) &= (a1); \ - (a1) ^= (a0); \ - (a0) = tmp; \ - } while (0) - -#define SUB_CRUMB(a0, a1, a2, a3) SUB_CRUMB_GEN(a0, a1, a2, a3, 32) -#define SUB_CRUMBW(a0, a1, a2, a3) SUB_CRUMB_GEN(a0, a1, a2, a3, 64) - - -#if 0 - -#define ROL32W(x, n) SPH_T64( \ - (((x) << (n)) \ - & ~((SPH_C64(0xFFFFFFFF) >> (32 - (n))) << 32)) \ - | (((x) >> (32 - (n))) \ - & ~((SPH_C64(0xFFFFFFFF) >> (n)) << (n)))) - -#define MIX_WORDW(u, v) do { \ - (v) ^= (u); \ - (u) = ROL32W((u), 2) ^ (v); \ - (v) = ROL32W((v), 14) ^ (u); \ - (u) = ROL32W((u), 10) ^ (v); \ - (v) = ROL32W((v), 1); \ - } while (0) - -#endif - -#define MIX_WORDW(u, v) do { \ - sph_u32 ul, uh, vl, vh; \ - (v) ^= (u); \ - ul = SPH_T32((sph_u32)(u)); \ - uh = SPH_T32((sph_u32)((u) >> 32)); \ - vl = SPH_T32((sph_u32)(v)); \ - vh = SPH_T32((sph_u32)((v) >> 32)); \ - ul = SPH_ROTL32(ul, 2) ^ vl; \ - vl = SPH_ROTL32(vl, 14) ^ ul; \ - ul = SPH_ROTL32(ul, 10) ^ vl; \ - vl = SPH_ROTL32(vl, 1); \ - uh = SPH_ROTL32(uh, 2) ^ vh; \ - vh = SPH_ROTL32(vh, 14) ^ uh; \ - uh = SPH_ROTL32(uh, 10) ^ vh; \ - vh = SPH_ROTL32(vh, 1); \ - (u) = (sph_u64)ul | ((sph_u64)uh << 32); \ - (v) = (sph_u64)vl | ((sph_u64)vh << 32); \ - } while (0) - -#else - -#define SUB_CRUMB(a0, a1, a2, a3) do { \ - sph_u32 tmp; \ - tmp = (a0); \ - (a0) |= (a1); \ - (a2) ^= (a3); \ - (a1) = SPH_T32(~(a1)); \ - (a0) ^= (a3); \ - (a3) &= tmp; \ - (a1) ^= (a3); \ - (a3) ^= (a2); \ - (a2) &= (a0); \ - (a0) = SPH_T32(~(a0)); \ - (a2) ^= (a1); \ - (a1) |= (a3); \ - tmp ^= (a1); \ - (a3) ^= (a2); \ - (a2) &= (a1); \ - (a1) ^= (a0); \ - (a0) = tmp; \ - } while (0) - -#endif - -#define MIX_WORD(u, v) do { \ - (v) ^= (u); \ - (u) = SPH_ROTL32((u), 2) ^ (v); \ - (v) = SPH_ROTL32((v), 14) ^ (u); \ - (u) = SPH_ROTL32((u), 10) ^ (v); \ - (v) = SPH_ROTL32((v), 1); \ - } while (0) - -#define DECL_STATE3 \ - sph_u32 V00, V01, V02, V03, V04, V05, V06, V07; \ - sph_u32 V10, V11, V12, V13, V14, V15, V16, V17; \ - sph_u32 V20, V21, V22, V23, V24, V25, V26, V27; - -#define READ_STATE3(state) do { \ - V00 = (state)->V[0][0]; \ - V01 = (state)->V[0][1]; \ - V02 = (state)->V[0][2]; \ - V03 = (state)->V[0][3]; \ - V04 = (state)->V[0][4]; \ - V05 = (state)->V[0][5]; \ - V06 = (state)->V[0][6]; \ - V07 = (state)->V[0][7]; \ - V10 = (state)->V[1][0]; \ - V11 = (state)->V[1][1]; \ - V12 = (state)->V[1][2]; \ - V13 = (state)->V[1][3]; \ - V14 = (state)->V[1][4]; \ - V15 = (state)->V[1][5]; \ - V16 = (state)->V[1][6]; \ - V17 = (state)->V[1][7]; \ - V20 = (state)->V[2][0]; \ - V21 = (state)->V[2][1]; \ - V22 = (state)->V[2][2]; \ - V23 = (state)->V[2][3]; \ - V24 = (state)->V[2][4]; \ - V25 = (state)->V[2][5]; \ - V26 = (state)->V[2][6]; \ - V27 = (state)->V[2][7]; \ - } while (0) - -#define WRITE_STATE3(state) do { \ - (state)->V[0][0] = V00; \ - (state)->V[0][1] = V01; \ - (state)->V[0][2] = V02; \ - (state)->V[0][3] = V03; \ - (state)->V[0][4] = V04; \ - (state)->V[0][5] = V05; \ - (state)->V[0][6] = V06; \ - (state)->V[0][7] = V07; \ - (state)->V[1][0] = V10; \ - (state)->V[1][1] = V11; \ - (state)->V[1][2] = V12; \ - (state)->V[1][3] = V13; \ - (state)->V[1][4] = V14; \ - (state)->V[1][5] = V15; \ - (state)->V[1][6] = V16; \ - (state)->V[1][7] = V17; \ - (state)->V[2][0] = V20; \ - (state)->V[2][1] = V21; \ - (state)->V[2][2] = V22; \ - (state)->V[2][3] = V23; \ - (state)->V[2][4] = V24; \ - (state)->V[2][5] = V25; \ - (state)->V[2][6] = V26; \ - (state)->V[2][7] = V27; \ - } while (0) - -#define MI3 do { \ - DECL_TMP8(M) \ - DECL_TMP8(a) \ - M0 = sph_dec32be_aligned(buf + 0); \ - M1 = sph_dec32be_aligned(buf + 4); \ - M2 = sph_dec32be_aligned(buf + 8); \ - M3 = sph_dec32be_aligned(buf + 12); \ - M4 = sph_dec32be_aligned(buf + 16); \ - M5 = sph_dec32be_aligned(buf + 20); \ - M6 = sph_dec32be_aligned(buf + 24); \ - M7 = sph_dec32be_aligned(buf + 28); \ - XOR(a, V0, V1); \ - XOR(a, a, V2); \ - M2(a, a); \ - XOR(V0, a, V0); \ - XOR(V0, M, V0); \ - M2(M, M); \ - XOR(V1, a, V1); \ - XOR(V1, M, V1); \ - M2(M, M); \ - XOR(V2, a, V2); \ - XOR(V2, M, V2); \ - } while (0) - -#define TWEAK3 do { \ - V14 = SPH_ROTL32(V14, 1); \ - V15 = SPH_ROTL32(V15, 1); \ - V16 = SPH_ROTL32(V16, 1); \ - V17 = SPH_ROTL32(V17, 1); \ - V24 = SPH_ROTL32(V24, 2); \ - V25 = SPH_ROTL32(V25, 2); \ - V26 = SPH_ROTL32(V26, 2); \ - V27 = SPH_ROTL32(V27, 2); \ - } while (0) - -#if SPH_LUFFA_PARALLEL - -#define P3 do { \ - int r; \ - sph_u64 W0, W1, W2, W3, W4, W5, W6, W7; \ - TWEAK3; \ - W0 = (sph_u64)V00 | ((sph_u64)V10 << 32); \ - W1 = (sph_u64)V01 | ((sph_u64)V11 << 32); \ - W2 = (sph_u64)V02 | ((sph_u64)V12 << 32); \ - W3 = (sph_u64)V03 | ((sph_u64)V13 << 32); \ - W4 = (sph_u64)V04 | ((sph_u64)V14 << 32); \ - W5 = (sph_u64)V05 | ((sph_u64)V15 << 32); \ - W6 = (sph_u64)V06 | ((sph_u64)V16 << 32); \ - W7 = (sph_u64)V07 | ((sph_u64)V17 << 32); \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMBW(W0, W1, W2, W3); \ - SUB_CRUMBW(W5, W6, W7, W4); \ - MIX_WORDW(W0, W4); \ - MIX_WORDW(W1, W5); \ - MIX_WORDW(W2, W6); \ - MIX_WORDW(W3, W7); \ - W0 ^= RCW010[r]; \ - W4 ^= RCW014[r]; \ - } \ - V00 = SPH_T32((sph_u32)W0); \ - V10 = SPH_T32((sph_u32)(W0 >> 32)); \ - V01 = SPH_T32((sph_u32)W1); \ - V11 = SPH_T32((sph_u32)(W1 >> 32)); \ - V02 = SPH_T32((sph_u32)W2); \ - V12 = SPH_T32((sph_u32)(W2 >> 32)); \ - V03 = SPH_T32((sph_u32)W3); \ - V13 = SPH_T32((sph_u32)(W3 >> 32)); \ - V04 = SPH_T32((sph_u32)W4); \ - V14 = SPH_T32((sph_u32)(W4 >> 32)); \ - V05 = SPH_T32((sph_u32)W5); \ - V15 = SPH_T32((sph_u32)(W5 >> 32)); \ - V06 = SPH_T32((sph_u32)W6); \ - V16 = SPH_T32((sph_u32)(W6 >> 32)); \ - V07 = SPH_T32((sph_u32)W7); \ - V17 = SPH_T32((sph_u32)(W7 >> 32)); \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V20, V21, V22, V23); \ - SUB_CRUMB(V25, V26, V27, V24); \ - MIX_WORD(V20, V24); \ - MIX_WORD(V21, V25); \ - MIX_WORD(V22, V26); \ - MIX_WORD(V23, V27); \ - V20 ^= RC20[r]; \ - V24 ^= RC24[r]; \ - } \ - } while (0) - -#else - -#define P3 do { \ - int r; \ - TWEAK3; \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V00, V01, V02, V03); \ - SUB_CRUMB(V05, V06, V07, V04); \ - MIX_WORD(V00, V04); \ - MIX_WORD(V01, V05); \ - MIX_WORD(V02, V06); \ - MIX_WORD(V03, V07); \ - V00 ^= RC00[r]; \ - V04 ^= RC04[r]; \ - } \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V10, V11, V12, V13); \ - SUB_CRUMB(V15, V16, V17, V14); \ - MIX_WORD(V10, V14); \ - MIX_WORD(V11, V15); \ - MIX_WORD(V12, V16); \ - MIX_WORD(V13, V17); \ - V10 ^= RC10[r]; \ - V14 ^= RC14[r]; \ - } \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V20, V21, V22, V23); \ - SUB_CRUMB(V25, V26, V27, V24); \ - MIX_WORD(V20, V24); \ - MIX_WORD(V21, V25); \ - MIX_WORD(V22, V26); \ - MIX_WORD(V23, V27); \ - V20 ^= RC20[r]; \ - V24 ^= RC24[r]; \ - } \ - } while (0) - -#endif - -#define DECL_STATE4 \ - sph_u32 V00, V01, V02, V03, V04, V05, V06, V07; \ - sph_u32 V10, V11, V12, V13, V14, V15, V16, V17; \ - sph_u32 V20, V21, V22, V23, V24, V25, V26, V27; \ - sph_u32 V30, V31, V32, V33, V34, V35, V36, V37; - -#define READ_STATE4(state) do { \ - V00 = (state)->V[0][0]; \ - V01 = (state)->V[0][1]; \ - V02 = (state)->V[0][2]; \ - V03 = (state)->V[0][3]; \ - V04 = (state)->V[0][4]; \ - V05 = (state)->V[0][5]; \ - V06 = (state)->V[0][6]; \ - V07 = (state)->V[0][7]; \ - V10 = (state)->V[1][0]; \ - V11 = (state)->V[1][1]; \ - V12 = (state)->V[1][2]; \ - V13 = (state)->V[1][3]; \ - V14 = (state)->V[1][4]; \ - V15 = (state)->V[1][5]; \ - V16 = (state)->V[1][6]; \ - V17 = (state)->V[1][7]; \ - V20 = (state)->V[2][0]; \ - V21 = (state)->V[2][1]; \ - V22 = (state)->V[2][2]; \ - V23 = (state)->V[2][3]; \ - V24 = (state)->V[2][4]; \ - V25 = (state)->V[2][5]; \ - V26 = (state)->V[2][6]; \ - V27 = (state)->V[2][7]; \ - V30 = (state)->V[3][0]; \ - V31 = (state)->V[3][1]; \ - V32 = (state)->V[3][2]; \ - V33 = (state)->V[3][3]; \ - V34 = (state)->V[3][4]; \ - V35 = (state)->V[3][5]; \ - V36 = (state)->V[3][6]; \ - V37 = (state)->V[3][7]; \ - } while (0) - -#define WRITE_STATE4(state) do { \ - (state)->V[0][0] = V00; \ - (state)->V[0][1] = V01; \ - (state)->V[0][2] = V02; \ - (state)->V[0][3] = V03; \ - (state)->V[0][4] = V04; \ - (state)->V[0][5] = V05; \ - (state)->V[0][6] = V06; \ - (state)->V[0][7] = V07; \ - (state)->V[1][0] = V10; \ - (state)->V[1][1] = V11; \ - (state)->V[1][2] = V12; \ - (state)->V[1][3] = V13; \ - (state)->V[1][4] = V14; \ - (state)->V[1][5] = V15; \ - (state)->V[1][6] = V16; \ - (state)->V[1][7] = V17; \ - (state)->V[2][0] = V20; \ - (state)->V[2][1] = V21; \ - (state)->V[2][2] = V22; \ - (state)->V[2][3] = V23; \ - (state)->V[2][4] = V24; \ - (state)->V[2][5] = V25; \ - (state)->V[2][6] = V26; \ - (state)->V[2][7] = V27; \ - (state)->V[3][0] = V30; \ - (state)->V[3][1] = V31; \ - (state)->V[3][2] = V32; \ - (state)->V[3][3] = V33; \ - (state)->V[3][4] = V34; \ - (state)->V[3][5] = V35; \ - (state)->V[3][6] = V36; \ - (state)->V[3][7] = V37; \ - } while (0) - -#define MI4 do { \ - DECL_TMP8(M) \ - DECL_TMP8(a) \ - DECL_TMP8(b) \ - M0 = sph_dec32be_aligned(buf + 0); \ - M1 = sph_dec32be_aligned(buf + 4); \ - M2 = sph_dec32be_aligned(buf + 8); \ - M3 = sph_dec32be_aligned(buf + 12); \ - M4 = sph_dec32be_aligned(buf + 16); \ - M5 = sph_dec32be_aligned(buf + 20); \ - M6 = sph_dec32be_aligned(buf + 24); \ - M7 = sph_dec32be_aligned(buf + 28); \ - XOR(a, V0, V1); \ - XOR(b, V2, V3); \ - XOR(a, a, b); \ - M2(a, a); \ - XOR(V0, a, V0); \ - XOR(V1, a, V1); \ - XOR(V2, a, V2); \ - XOR(V3, a, V3); \ - M2(b, V0); \ - XOR(b, b, V3); \ - M2(V3, V3); \ - XOR(V3, V3, V2); \ - M2(V2, V2); \ - XOR(V2, V2, V1); \ - M2(V1, V1); \ - XOR(V1, V1, V0); \ - XOR(V0, b, M); \ - M2(M, M); \ - XOR(V1, V1, M); \ - M2(M, M); \ - XOR(V2, V2, M); \ - M2(M, M); \ - XOR(V3, V3, M); \ - } while (0) - -#define TWEAK4 do { \ - V14 = SPH_ROTL32(V14, 1); \ - V15 = SPH_ROTL32(V15, 1); \ - V16 = SPH_ROTL32(V16, 1); \ - V17 = SPH_ROTL32(V17, 1); \ - V24 = SPH_ROTL32(V24, 2); \ - V25 = SPH_ROTL32(V25, 2); \ - V26 = SPH_ROTL32(V26, 2); \ - V27 = SPH_ROTL32(V27, 2); \ - V34 = SPH_ROTL32(V34, 3); \ - V35 = SPH_ROTL32(V35, 3); \ - V36 = SPH_ROTL32(V36, 3); \ - V37 = SPH_ROTL32(V37, 3); \ - } while (0) - -#if SPH_LUFFA_PARALLEL - -#define P4 do { \ - int r; \ - sph_u64 W0, W1, W2, W3, W4, W5, W6, W7; \ - TWEAK4; \ - W0 = (sph_u64)V00 | ((sph_u64)V10 << 32); \ - W1 = (sph_u64)V01 | ((sph_u64)V11 << 32); \ - W2 = (sph_u64)V02 | ((sph_u64)V12 << 32); \ - W3 = (sph_u64)V03 | ((sph_u64)V13 << 32); \ - W4 = (sph_u64)V04 | ((sph_u64)V14 << 32); \ - W5 = (sph_u64)V05 | ((sph_u64)V15 << 32); \ - W6 = (sph_u64)V06 | ((sph_u64)V16 << 32); \ - W7 = (sph_u64)V07 | ((sph_u64)V17 << 32); \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMBW(W0, W1, W2, W3); \ - SUB_CRUMBW(W5, W6, W7, W4); \ - MIX_WORDW(W0, W4); \ - MIX_WORDW(W1, W5); \ - MIX_WORDW(W2, W6); \ - MIX_WORDW(W3, W7); \ - W0 ^= RCW010[r]; \ - W4 ^= RCW014[r]; \ - } \ - V00 = SPH_T32((sph_u32)W0); \ - V10 = SPH_T32((sph_u32)(W0 >> 32)); \ - V01 = SPH_T32((sph_u32)W1); \ - V11 = SPH_T32((sph_u32)(W1 >> 32)); \ - V02 = SPH_T32((sph_u32)W2); \ - V12 = SPH_T32((sph_u32)(W2 >> 32)); \ - V03 = SPH_T32((sph_u32)W3); \ - V13 = SPH_T32((sph_u32)(W3 >> 32)); \ - V04 = SPH_T32((sph_u32)W4); \ - V14 = SPH_T32((sph_u32)(W4 >> 32)); \ - V05 = SPH_T32((sph_u32)W5); \ - V15 = SPH_T32((sph_u32)(W5 >> 32)); \ - V06 = SPH_T32((sph_u32)W6); \ - V16 = SPH_T32((sph_u32)(W6 >> 32)); \ - V07 = SPH_T32((sph_u32)W7); \ - V17 = SPH_T32((sph_u32)(W7 >> 32)); \ - W0 = (sph_u64)V20 | ((sph_u64)V30 << 32); \ - W1 = (sph_u64)V21 | ((sph_u64)V31 << 32); \ - W2 = (sph_u64)V22 | ((sph_u64)V32 << 32); \ - W3 = (sph_u64)V23 | ((sph_u64)V33 << 32); \ - W4 = (sph_u64)V24 | ((sph_u64)V34 << 32); \ - W5 = (sph_u64)V25 | ((sph_u64)V35 << 32); \ - W6 = (sph_u64)V26 | ((sph_u64)V36 << 32); \ - W7 = (sph_u64)V27 | ((sph_u64)V37 << 32); \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMBW(W0, W1, W2, W3); \ - SUB_CRUMBW(W5, W6, W7, W4); \ - MIX_WORDW(W0, W4); \ - MIX_WORDW(W1, W5); \ - MIX_WORDW(W2, W6); \ - MIX_WORDW(W3, W7); \ - W0 ^= RCW230[r]; \ - W4 ^= RCW234[r]; \ - } \ - V20 = SPH_T32((sph_u32)W0); \ - V30 = SPH_T32((sph_u32)(W0 >> 32)); \ - V21 = SPH_T32((sph_u32)W1); \ - V31 = SPH_T32((sph_u32)(W1 >> 32)); \ - V22 = SPH_T32((sph_u32)W2); \ - V32 = SPH_T32((sph_u32)(W2 >> 32)); \ - V23 = SPH_T32((sph_u32)W3); \ - V33 = SPH_T32((sph_u32)(W3 >> 32)); \ - V24 = SPH_T32((sph_u32)W4); \ - V34 = SPH_T32((sph_u32)(W4 >> 32)); \ - V25 = SPH_T32((sph_u32)W5); \ - V35 = SPH_T32((sph_u32)(W5 >> 32)); \ - V26 = SPH_T32((sph_u32)W6); \ - V36 = SPH_T32((sph_u32)(W6 >> 32)); \ - V27 = SPH_T32((sph_u32)W7); \ - V37 = SPH_T32((sph_u32)(W7 >> 32)); \ - } while (0) - -#else - -#define P4 do { \ - int r; \ - TWEAK4; \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V00, V01, V02, V03); \ - SUB_CRUMB(V05, V06, V07, V04); \ - MIX_WORD(V00, V04); \ - MIX_WORD(V01, V05); \ - MIX_WORD(V02, V06); \ - MIX_WORD(V03, V07); \ - V00 ^= RC00[r]; \ - V04 ^= RC04[r]; \ - } \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V10, V11, V12, V13); \ - SUB_CRUMB(V15, V16, V17, V14); \ - MIX_WORD(V10, V14); \ - MIX_WORD(V11, V15); \ - MIX_WORD(V12, V16); \ - MIX_WORD(V13, V17); \ - V10 ^= RC10[r]; \ - V14 ^= RC14[r]; \ - } \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V20, V21, V22, V23); \ - SUB_CRUMB(V25, V26, V27, V24); \ - MIX_WORD(V20, V24); \ - MIX_WORD(V21, V25); \ - MIX_WORD(V22, V26); \ - MIX_WORD(V23, V27); \ - V20 ^= RC20[r]; \ - V24 ^= RC24[r]; \ - } \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V30, V31, V32, V33); \ - SUB_CRUMB(V35, V36, V37, V34); \ - MIX_WORD(V30, V34); \ - MIX_WORD(V31, V35); \ - MIX_WORD(V32, V36); \ - MIX_WORD(V33, V37); \ - V30 ^= RC30[r]; \ - V34 ^= RC34[r]; \ - } \ - } while (0) - -#endif - -#define DECL_STATE5 \ - sph_u32 V00, V01, V02, V03, V04, V05, V06, V07; \ - sph_u32 V10, V11, V12, V13, V14, V15, V16, V17; \ - sph_u32 V20, V21, V22, V23, V24, V25, V26, V27; \ - sph_u32 V30, V31, V32, V33, V34, V35, V36, V37; \ - sph_u32 V40, V41, V42, V43, V44, V45, V46, V47; - -#define READ_STATE5(state) do { \ - V00 = (state)->V[0][0]; \ - V01 = (state)->V[0][1]; \ - V02 = (state)->V[0][2]; \ - V03 = (state)->V[0][3]; \ - V04 = (state)->V[0][4]; \ - V05 = (state)->V[0][5]; \ - V06 = (state)->V[0][6]; \ - V07 = (state)->V[0][7]; \ - V10 = (state)->V[1][0]; \ - V11 = (state)->V[1][1]; \ - V12 = (state)->V[1][2]; \ - V13 = (state)->V[1][3]; \ - V14 = (state)->V[1][4]; \ - V15 = (state)->V[1][5]; \ - V16 = (state)->V[1][6]; \ - V17 = (state)->V[1][7]; \ - V20 = (state)->V[2][0]; \ - V21 = (state)->V[2][1]; \ - V22 = (state)->V[2][2]; \ - V23 = (state)->V[2][3]; \ - V24 = (state)->V[2][4]; \ - V25 = (state)->V[2][5]; \ - V26 = (state)->V[2][6]; \ - V27 = (state)->V[2][7]; \ - V30 = (state)->V[3][0]; \ - V31 = (state)->V[3][1]; \ - V32 = (state)->V[3][2]; \ - V33 = (state)->V[3][3]; \ - V34 = (state)->V[3][4]; \ - V35 = (state)->V[3][5]; \ - V36 = (state)->V[3][6]; \ - V37 = (state)->V[3][7]; \ - V40 = (state)->V[4][0]; \ - V41 = (state)->V[4][1]; \ - V42 = (state)->V[4][2]; \ - V43 = (state)->V[4][3]; \ - V44 = (state)->V[4][4]; \ - V45 = (state)->V[4][5]; \ - V46 = (state)->V[4][6]; \ - V47 = (state)->V[4][7]; \ - } while (0) - -#define WRITE_STATE5(state) do { \ - (state)->V[0][0] = V00; \ - (state)->V[0][1] = V01; \ - (state)->V[0][2] = V02; \ - (state)->V[0][3] = V03; \ - (state)->V[0][4] = V04; \ - (state)->V[0][5] = V05; \ - (state)->V[0][6] = V06; \ - (state)->V[0][7] = V07; \ - (state)->V[1][0] = V10; \ - (state)->V[1][1] = V11; \ - (state)->V[1][2] = V12; \ - (state)->V[1][3] = V13; \ - (state)->V[1][4] = V14; \ - (state)->V[1][5] = V15; \ - (state)->V[1][6] = V16; \ - (state)->V[1][7] = V17; \ - (state)->V[2][0] = V20; \ - (state)->V[2][1] = V21; \ - (state)->V[2][2] = V22; \ - (state)->V[2][3] = V23; \ - (state)->V[2][4] = V24; \ - (state)->V[2][5] = V25; \ - (state)->V[2][6] = V26; \ - (state)->V[2][7] = V27; \ - (state)->V[3][0] = V30; \ - (state)->V[3][1] = V31; \ - (state)->V[3][2] = V32; \ - (state)->V[3][3] = V33; \ - (state)->V[3][4] = V34; \ - (state)->V[3][5] = V35; \ - (state)->V[3][6] = V36; \ - (state)->V[3][7] = V37; \ - (state)->V[4][0] = V40; \ - (state)->V[4][1] = V41; \ - (state)->V[4][2] = V42; \ - (state)->V[4][3] = V43; \ - (state)->V[4][4] = V44; \ - (state)->V[4][5] = V45; \ - (state)->V[4][6] = V46; \ - (state)->V[4][7] = V47; \ - } while (0) - -#define MI5 do { \ - DECL_TMP8(M) \ - DECL_TMP8(a) \ - DECL_TMP8(b) \ - M0 = sph_dec32be_aligned(buf + 0); \ - M1 = sph_dec32be_aligned(buf + 4); \ - M2 = sph_dec32be_aligned(buf + 8); \ - M3 = sph_dec32be_aligned(buf + 12); \ - M4 = sph_dec32be_aligned(buf + 16); \ - M5 = sph_dec32be_aligned(buf + 20); \ - M6 = sph_dec32be_aligned(buf + 24); \ - M7 = sph_dec32be_aligned(buf + 28); \ - XOR(a, V0, V1); \ - XOR(b, V2, V3); \ - XOR(a, a, b); \ - XOR(a, a, V4); \ - M2(a, a); \ - XOR(V0, a, V0); \ - XOR(V1, a, V1); \ - XOR(V2, a, V2); \ - XOR(V3, a, V3); \ - XOR(V4, a, V4); \ - M2(b, V0); \ - XOR(b, b, V1); \ - M2(V1, V1); \ - XOR(V1, V1, V2); \ - M2(V2, V2); \ - XOR(V2, V2, V3); \ - M2(V3, V3); \ - XOR(V3, V3, V4); \ - M2(V4, V4); \ - XOR(V4, V4, V0); \ - M2(V0, b); \ - XOR(V0, V0, V4); \ - M2(V4, V4); \ - XOR(V4, V4, V3); \ - M2(V3, V3); \ - XOR(V3, V3, V2); \ - M2(V2, V2); \ - XOR(V2, V2, V1); \ - M2(V1, V1); \ - XOR(V1, V1, b); \ - XOR(V0, V0, M); \ - M2(M, M); \ - XOR(V1, V1, M); \ - M2(M, M); \ - XOR(V2, V2, M); \ - M2(M, M); \ - XOR(V3, V3, M); \ - M2(M, M); \ - XOR(V4, V4, M); \ - } while (0) - -#define TWEAK5 do { \ - V14 = SPH_ROTL32(V14, 1); \ - V15 = SPH_ROTL32(V15, 1); \ - V16 = SPH_ROTL32(V16, 1); \ - V17 = SPH_ROTL32(V17, 1); \ - V24 = SPH_ROTL32(V24, 2); \ - V25 = SPH_ROTL32(V25, 2); \ - V26 = SPH_ROTL32(V26, 2); \ - V27 = SPH_ROTL32(V27, 2); \ - V34 = SPH_ROTL32(V34, 3); \ - V35 = SPH_ROTL32(V35, 3); \ - V36 = SPH_ROTL32(V36, 3); \ - V37 = SPH_ROTL32(V37, 3); \ - V44 = SPH_ROTL32(V44, 4); \ - V45 = SPH_ROTL32(V45, 4); \ - V46 = SPH_ROTL32(V46, 4); \ - V47 = SPH_ROTL32(V47, 4); \ - } while (0) - -#if SPH_LUFFA_PARALLEL - -#define P5 do { \ - int r; \ - sph_u64 W0, W1, W2, W3, W4, W5, W6, W7; \ - TWEAK5; \ - W0 = (sph_u64)V00 | ((sph_u64)V10 << 32); \ - W1 = (sph_u64)V01 | ((sph_u64)V11 << 32); \ - W2 = (sph_u64)V02 | ((sph_u64)V12 << 32); \ - W3 = (sph_u64)V03 | ((sph_u64)V13 << 32); \ - W4 = (sph_u64)V04 | ((sph_u64)V14 << 32); \ - W5 = (sph_u64)V05 | ((sph_u64)V15 << 32); \ - W6 = (sph_u64)V06 | ((sph_u64)V16 << 32); \ - W7 = (sph_u64)V07 | ((sph_u64)V17 << 32); \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMBW(W0, W1, W2, W3); \ - SUB_CRUMBW(W5, W6, W7, W4); \ - MIX_WORDW(W0, W4); \ - MIX_WORDW(W1, W5); \ - MIX_WORDW(W2, W6); \ - MIX_WORDW(W3, W7); \ - W0 ^= RCW010[r]; \ - W4 ^= RCW014[r]; \ - } \ - V00 = SPH_T32((sph_u32)W0); \ - V10 = SPH_T32((sph_u32)(W0 >> 32)); \ - V01 = SPH_T32((sph_u32)W1); \ - V11 = SPH_T32((sph_u32)(W1 >> 32)); \ - V02 = SPH_T32((sph_u32)W2); \ - V12 = SPH_T32((sph_u32)(W2 >> 32)); \ - V03 = SPH_T32((sph_u32)W3); \ - V13 = SPH_T32((sph_u32)(W3 >> 32)); \ - V04 = SPH_T32((sph_u32)W4); \ - V14 = SPH_T32((sph_u32)(W4 >> 32)); \ - V05 = SPH_T32((sph_u32)W5); \ - V15 = SPH_T32((sph_u32)(W5 >> 32)); \ - V06 = SPH_T32((sph_u32)W6); \ - V16 = SPH_T32((sph_u32)(W6 >> 32)); \ - V07 = SPH_T32((sph_u32)W7); \ - V17 = SPH_T32((sph_u32)(W7 >> 32)); \ - W0 = (sph_u64)V20 | ((sph_u64)V30 << 32); \ - W1 = (sph_u64)V21 | ((sph_u64)V31 << 32); \ - W2 = (sph_u64)V22 | ((sph_u64)V32 << 32); \ - W3 = (sph_u64)V23 | ((sph_u64)V33 << 32); \ - W4 = (sph_u64)V24 | ((sph_u64)V34 << 32); \ - W5 = (sph_u64)V25 | ((sph_u64)V35 << 32); \ - W6 = (sph_u64)V26 | ((sph_u64)V36 << 32); \ - W7 = (sph_u64)V27 | ((sph_u64)V37 << 32); \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMBW(W0, W1, W2, W3); \ - SUB_CRUMBW(W5, W6, W7, W4); \ - MIX_WORDW(W0, W4); \ - MIX_WORDW(W1, W5); \ - MIX_WORDW(W2, W6); \ - MIX_WORDW(W3, W7); \ - W0 ^= RCW230[r]; \ - W4 ^= RCW234[r]; \ - } \ - V20 = SPH_T32((sph_u32)W0); \ - V30 = SPH_T32((sph_u32)(W0 >> 32)); \ - V21 = SPH_T32((sph_u32)W1); \ - V31 = SPH_T32((sph_u32)(W1 >> 32)); \ - V22 = SPH_T32((sph_u32)W2); \ - V32 = SPH_T32((sph_u32)(W2 >> 32)); \ - V23 = SPH_T32((sph_u32)W3); \ - V33 = SPH_T32((sph_u32)(W3 >> 32)); \ - V24 = SPH_T32((sph_u32)W4); \ - V34 = SPH_T32((sph_u32)(W4 >> 32)); \ - V25 = SPH_T32((sph_u32)W5); \ - V35 = SPH_T32((sph_u32)(W5 >> 32)); \ - V26 = SPH_T32((sph_u32)W6); \ - V36 = SPH_T32((sph_u32)(W6 >> 32)); \ - V27 = SPH_T32((sph_u32)W7); \ - V37 = SPH_T32((sph_u32)(W7 >> 32)); \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V40, V41, V42, V43); \ - SUB_CRUMB(V45, V46, V47, V44); \ - MIX_WORD(V40, V44); \ - MIX_WORD(V41, V45); \ - MIX_WORD(V42, V46); \ - MIX_WORD(V43, V47); \ - V40 ^= RC40[r]; \ - V44 ^= RC44[r]; \ - } \ - } while (0) - -#else - -#define P5 do { \ - int r; \ - TWEAK5; \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V00, V01, V02, V03); \ - SUB_CRUMB(V05, V06, V07, V04); \ - MIX_WORD(V00, V04); \ - MIX_WORD(V01, V05); \ - MIX_WORD(V02, V06); \ - MIX_WORD(V03, V07); \ - V00 ^= RC00[r]; \ - V04 ^= RC04[r]; \ - } \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V10, V11, V12, V13); \ - SUB_CRUMB(V15, V16, V17, V14); \ - MIX_WORD(V10, V14); \ - MIX_WORD(V11, V15); \ - MIX_WORD(V12, V16); \ - MIX_WORD(V13, V17); \ - V10 ^= RC10[r]; \ - V14 ^= RC14[r]; \ - } \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V20, V21, V22, V23); \ - SUB_CRUMB(V25, V26, V27, V24); \ - MIX_WORD(V20, V24); \ - MIX_WORD(V21, V25); \ - MIX_WORD(V22, V26); \ - MIX_WORD(V23, V27); \ - V20 ^= RC20[r]; \ - V24 ^= RC24[r]; \ - } \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V30, V31, V32, V33); \ - SUB_CRUMB(V35, V36, V37, V34); \ - MIX_WORD(V30, V34); \ - MIX_WORD(V31, V35); \ - MIX_WORD(V32, V36); \ - MIX_WORD(V33, V37); \ - V30 ^= RC30[r]; \ - V34 ^= RC34[r]; \ - } \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V40, V41, V42, V43); \ - SUB_CRUMB(V45, V46, V47, V44); \ - MIX_WORD(V40, V44); \ - MIX_WORD(V41, V45); \ - MIX_WORD(V42, V46); \ - MIX_WORD(V43, V47); \ - V40 ^= RC40[r]; \ - V44 ^= RC44[r]; \ - } \ - } while (0) - -#endif - -static void -luffa3(sph_luffa224_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - DECL_STATE3 - - buf = sc->buf; - ptr = sc->ptr; - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - READ_STATE3(sc); - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data = (const unsigned char *)data + clen; - len -= clen; - if (ptr == sizeof sc->buf) { - MI3; - P3; - ptr = 0; - } - } - WRITE_STATE3(sc); - sc->ptr = ptr; -} - -static void -luffa3_close(sph_luffa224_context *sc, unsigned ub, unsigned n, - void *dst, unsigned out_size_w32) -{ - unsigned char *buf, *out; - size_t ptr; - unsigned z; - int i; - DECL_STATE3 - - buf = sc->buf; - ptr = sc->ptr; - z = 0x80 >> n; - buf[ptr ++] = ((ub & -z) | z) & 0xFF; - memset(buf + ptr, 0, (sizeof sc->buf) - ptr); - READ_STATE3(sc); - for (i = 0; i < 2; i ++) { - MI3; - P3; - memset(buf, 0, sizeof sc->buf); - } - out = dst; - sph_enc32be(out + 0, V00 ^ V10 ^ V20); - sph_enc32be(out + 4, V01 ^ V11 ^ V21); - sph_enc32be(out + 8, V02 ^ V12 ^ V22); - sph_enc32be(out + 12, V03 ^ V13 ^ V23); - sph_enc32be(out + 16, V04 ^ V14 ^ V24); - sph_enc32be(out + 20, V05 ^ V15 ^ V25); - sph_enc32be(out + 24, V06 ^ V16 ^ V26); - if (out_size_w32 > 7) - sph_enc32be(out + 28, V07 ^ V17 ^ V27); -} - -static void -luffa4(sph_luffa384_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - DECL_STATE4 - - buf = sc->buf; - ptr = sc->ptr; - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - READ_STATE4(sc); - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data = (const unsigned char *)data + clen; - len -= clen; - if (ptr == sizeof sc->buf) { - MI4; - P4; - ptr = 0; - } - } - WRITE_STATE4(sc); - sc->ptr = ptr; -} - -static void -luffa4_close(sph_luffa384_context *sc, unsigned ub, unsigned n, void *dst) -{ - unsigned char *buf, *out; - size_t ptr; - unsigned z; - int i; - DECL_STATE4 - - buf = sc->buf; - ptr = sc->ptr; - out = dst; - z = 0x80 >> n; - buf[ptr ++] = ((ub & -z) | z) & 0xFF; - memset(buf + ptr, 0, (sizeof sc->buf) - ptr); - READ_STATE4(sc); - for (i = 0; i < 3; i ++) { - MI4; - P4; - switch (i) { - case 0: - memset(buf, 0, sizeof sc->buf); - break; - case 1: - sph_enc32be(out + 0, V00 ^ V10 ^ V20 ^ V30); - sph_enc32be(out + 4, V01 ^ V11 ^ V21 ^ V31); - sph_enc32be(out + 8, V02 ^ V12 ^ V22 ^ V32); - sph_enc32be(out + 12, V03 ^ V13 ^ V23 ^ V33); - sph_enc32be(out + 16, V04 ^ V14 ^ V24 ^ V34); - sph_enc32be(out + 20, V05 ^ V15 ^ V25 ^ V35); - sph_enc32be(out + 24, V06 ^ V16 ^ V26 ^ V36); - sph_enc32be(out + 28, V07 ^ V17 ^ V27 ^ V37); - break; - case 2: - sph_enc32be(out + 32, V00 ^ V10 ^ V20 ^ V30); - sph_enc32be(out + 36, V01 ^ V11 ^ V21 ^ V31); - sph_enc32be(out + 40, V02 ^ V12 ^ V22 ^ V32); - sph_enc32be(out + 44, V03 ^ V13 ^ V23 ^ V33); - break; - } - } -} - -static void -luffa5(sph_luffa512_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - DECL_STATE5 - - buf = sc->buf; - ptr = sc->ptr; - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - READ_STATE5(sc); - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data = (const unsigned char *)data + clen; - len -= clen; - if (ptr == sizeof sc->buf) { - MI5; - P5; - ptr = 0; - } - } - WRITE_STATE5(sc); - sc->ptr = ptr; -} - -static void -luffa5_close(sph_luffa512_context *sc, unsigned ub, unsigned n, void *dst) -{ - unsigned char *buf, *out; - size_t ptr; - unsigned z; - int i; - DECL_STATE5 - - buf = sc->buf; - ptr = sc->ptr; - out = dst; - z = 0x80 >> n; - buf[ptr ++] = ((ub & -z) | z) & 0xFF; - memset(buf + ptr, 0, (sizeof sc->buf) - ptr); - READ_STATE5(sc); - for (i = 0; i < 3; i ++) { - MI5; - P5; - switch (i) { - case 0: - memset(buf, 0, sizeof sc->buf); - break; - case 1: - sph_enc32be(out + 0, V00 ^ V10 ^ V20 ^ V30 ^ V40); - sph_enc32be(out + 4, V01 ^ V11 ^ V21 ^ V31 ^ V41); - sph_enc32be(out + 8, V02 ^ V12 ^ V22 ^ V32 ^ V42); - sph_enc32be(out + 12, V03 ^ V13 ^ V23 ^ V33 ^ V43); - sph_enc32be(out + 16, V04 ^ V14 ^ V24 ^ V34 ^ V44); - sph_enc32be(out + 20, V05 ^ V15 ^ V25 ^ V35 ^ V45); - sph_enc32be(out + 24, V06 ^ V16 ^ V26 ^ V36 ^ V46); - sph_enc32be(out + 28, V07 ^ V17 ^ V27 ^ V37 ^ V47); - break; - case 2: - sph_enc32be(out + 32, V00 ^ V10 ^ V20 ^ V30 ^ V40); - sph_enc32be(out + 36, V01 ^ V11 ^ V21 ^ V31 ^ V41); - sph_enc32be(out + 40, V02 ^ V12 ^ V22 ^ V32 ^ V42); - sph_enc32be(out + 44, V03 ^ V13 ^ V23 ^ V33 ^ V43); - sph_enc32be(out + 48, V04 ^ V14 ^ V24 ^ V34 ^ V44); - sph_enc32be(out + 52, V05 ^ V15 ^ V25 ^ V35 ^ V45); - sph_enc32be(out + 56, V06 ^ V16 ^ V26 ^ V36 ^ V46); - sph_enc32be(out + 60, V07 ^ V17 ^ V27 ^ V37 ^ V47); - break; - } - } -} - -/* see sph_luffa.h */ -void -sph_luffa224_init(void *cc) -{ - sph_luffa224_context *sc; - - sc = cc; - memcpy(sc->V, V_INIT, sizeof(sc->V)); - sc->ptr = 0; -} - -/* see sph_luffa.h */ -void -sph_luffa224(void *cc, const void *data, size_t len) -{ - luffa3(cc, data, len); -} - -/* see sph_luffa.h */ -void -sph_luffa224_close(void *cc, void *dst) -{ - sph_luffa224_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_luffa.h */ -void -sph_luffa224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - luffa3_close(cc, ub, n, dst, 7); - sph_luffa224_init(cc); -} - -/* see sph_luffa.h */ -void -sph_luffa256_init(void *cc) -{ - sph_luffa256_context *sc; - - sc = cc; - memcpy(sc->V, V_INIT, sizeof(sc->V)); - sc->ptr = 0; -} - -/* see sph_luffa.h */ -void -sph_luffa256(void *cc, const void *data, size_t len) -{ - luffa3(cc, data, len); -} - -/* see sph_luffa.h */ -void -sph_luffa256_close(void *cc, void *dst) -{ - sph_luffa256_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_luffa.h */ -void -sph_luffa256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - luffa3_close(cc, ub, n, dst, 8); - sph_luffa256_init(cc); -} - -/* see sph_luffa.h */ -void -sph_luffa384_init(void *cc) -{ - sph_luffa384_context *sc; - - sc = cc; - memcpy(sc->V, V_INIT, sizeof(sc->V)); - sc->ptr = 0; -} - -/* see sph_luffa.h */ -void -sph_luffa384(void *cc, const void *data, size_t len) -{ - luffa4(cc, data, len); -} - -/* see sph_luffa.h */ -void -sph_luffa384_close(void *cc, void *dst) -{ - sph_luffa384_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_luffa.h */ -void -sph_luffa384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - luffa4_close(cc, ub, n, dst); - sph_luffa384_init(cc); -} - -/* see sph_luffa.h */ -void -sph_luffa512_init(void *cc) -{ - sph_luffa512_context *sc; - - sc = cc; - memcpy(sc->V, V_INIT, sizeof(sc->V)); - sc->ptr = 0; -} - -/* see sph_luffa.h */ -void -sph_luffa512(void *cc, const void *data, size_t len) -{ - luffa5(cc, data, len); -} - -/* see sph_luffa.h */ -void -sph_luffa512_close(void *cc, void *dst) -{ - sph_luffa512_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_luffa.h */ -void -sph_luffa512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - luffa5_close(cc, ub, n, dst); - sph_luffa512_init(cc); -} - -#ifdef __cplusplus -} -#endif \ No newline at end of file diff --git a/sph/ripemd.c b/sph/ripemd.c deleted file mode 100644 index dd12b1fa..00000000 --- a/sph/ripemd.c +++ /dev/null @@ -1,833 +0,0 @@ -/* $Id: ripemd.c 216 2010-06-08 09:46:57Z tp $ */ -/* - * RIPEMD-160 implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include - -#include "sph_ripemd.h" - -/* - * Round functions for RIPEMD (original). - */ -#define F(x, y, z) ((((y) ^ (z)) & (x)) ^ (z)) -#define G(x, y, z) (((x) & (y)) | (((x) | (y)) & (z))) -#define H(x, y, z) ((x) ^ (y) ^ (z)) - -static const sph_u32 oIV[5] = { - SPH_C32(0x67452301), SPH_C32(0xEFCDAB89), - SPH_C32(0x98BADCFE), SPH_C32(0x10325476) -}; - -/* - * Round functions for RIPEMD-128 and RIPEMD-160. - */ -#define F1(x, y, z) ((x) ^ (y) ^ (z)) -#define F2(x, y, z) ((((y) ^ (z)) & (x)) ^ (z)) -#define F3(x, y, z) (((x) | ~(y)) ^ (z)) -#define F4(x, y, z) ((((x) ^ (y)) & (z)) ^ (y)) -#define F5(x, y, z) ((x) ^ ((y) | ~(z))) - -static const sph_u32 IV[5] = { - SPH_C32(0x67452301), SPH_C32(0xEFCDAB89), SPH_C32(0x98BADCFE), - SPH_C32(0x10325476), SPH_C32(0xC3D2E1F0) -}; - -#define ROTL SPH_ROTL32 - -/* ===================================================================== */ -/* - * RIPEMD (original hash, deprecated). - */ - -#define FF1(A, B, C, D, X, s) do { \ - sph_u32 tmp = SPH_T32((A) + F(B, C, D) + (X)); \ - (A) = ROTL(tmp, (s)); \ - } while (0) - -#define GG1(A, B, C, D, X, s) do { \ - sph_u32 tmp = SPH_T32((A) + G(B, C, D) \ - + (X) + SPH_C32(0x5A827999)); \ - (A) = ROTL(tmp, (s)); \ - } while (0) - -#define HH1(A, B, C, D, X, s) do { \ - sph_u32 tmp = SPH_T32((A) + H(B, C, D) \ - + (X) + SPH_C32(0x6ED9EBA1)); \ - (A) = ROTL(tmp, (s)); \ - } while (0) - -#define FF2(A, B, C, D, X, s) do { \ - sph_u32 tmp = SPH_T32((A) + F(B, C, D) \ - + (X) + SPH_C32(0x50A28BE6)); \ - (A) = ROTL(tmp, (s)); \ - } while (0) - -#define GG2(A, B, C, D, X, s) do { \ - sph_u32 tmp = SPH_T32((A) + G(B, C, D) + (X)); \ - (A) = ROTL(tmp, (s)); \ - } while (0) - -#define HH2(A, B, C, D, X, s) do { \ - sph_u32 tmp = SPH_T32((A) + H(B, C, D) \ - + (X) + SPH_C32(0x5C4DD124)); \ - (A) = ROTL(tmp, (s)); \ - } while (0) - -#define RIPEMD_ROUND_BODY(in, h) do { \ - sph_u32 A1, B1, C1, D1; \ - sph_u32 A2, B2, C2, D2; \ - sph_u32 tmp; \ - \ - A1 = A2 = (h)[0]; \ - B1 = B2 = (h)[1]; \ - C1 = C2 = (h)[2]; \ - D1 = D2 = (h)[3]; \ - \ - FF1(A1, B1, C1, D1, in( 0), 11); \ - FF1(D1, A1, B1, C1, in( 1), 14); \ - FF1(C1, D1, A1, B1, in( 2), 15); \ - FF1(B1, C1, D1, A1, in( 3), 12); \ - FF1(A1, B1, C1, D1, in( 4), 5); \ - FF1(D1, A1, B1, C1, in( 5), 8); \ - FF1(C1, D1, A1, B1, in( 6), 7); \ - FF1(B1, C1, D1, A1, in( 7), 9); \ - FF1(A1, B1, C1, D1, in( 8), 11); \ - FF1(D1, A1, B1, C1, in( 9), 13); \ - FF1(C1, D1, A1, B1, in(10), 14); \ - FF1(B1, C1, D1, A1, in(11), 15); \ - FF1(A1, B1, C1, D1, in(12), 6); \ - FF1(D1, A1, B1, C1, in(13), 7); \ - FF1(C1, D1, A1, B1, in(14), 9); \ - FF1(B1, C1, D1, A1, in(15), 8); \ - \ - GG1(A1, B1, C1, D1, in( 7), 7); \ - GG1(D1, A1, B1, C1, in( 4), 6); \ - GG1(C1, D1, A1, B1, in(13), 8); \ - GG1(B1, C1, D1, A1, in( 1), 13); \ - GG1(A1, B1, C1, D1, in(10), 11); \ - GG1(D1, A1, B1, C1, in( 6), 9); \ - GG1(C1, D1, A1, B1, in(15), 7); \ - GG1(B1, C1, D1, A1, in( 3), 15); \ - GG1(A1, B1, C1, D1, in(12), 7); \ - GG1(D1, A1, B1, C1, in( 0), 12); \ - GG1(C1, D1, A1, B1, in( 9), 15); \ - GG1(B1, C1, D1, A1, in( 5), 9); \ - GG1(A1, B1, C1, D1, in(14), 7); \ - GG1(D1, A1, B1, C1, in( 2), 11); \ - GG1(C1, D1, A1, B1, in(11), 13); \ - GG1(B1, C1, D1, A1, in( 8), 12); \ - \ - HH1(A1, B1, C1, D1, in( 3), 11); \ - HH1(D1, A1, B1, C1, in(10), 13); \ - HH1(C1, D1, A1, B1, in( 2), 14); \ - HH1(B1, C1, D1, A1, in( 4), 7); \ - HH1(A1, B1, C1, D1, in( 9), 14); \ - HH1(D1, A1, B1, C1, in(15), 9); \ - HH1(C1, D1, A1, B1, in( 8), 13); \ - HH1(B1, C1, D1, A1, in( 1), 15); \ - HH1(A1, B1, C1, D1, in(14), 6); \ - HH1(D1, A1, B1, C1, in( 7), 8); \ - HH1(C1, D1, A1, B1, in( 0), 13); \ - HH1(B1, C1, D1, A1, in( 6), 6); \ - HH1(A1, B1, C1, D1, in(11), 12); \ - HH1(D1, A1, B1, C1, in(13), 5); \ - HH1(C1, D1, A1, B1, in( 5), 7); \ - HH1(B1, C1, D1, A1, in(12), 5); \ - \ - FF2(A2, B2, C2, D2, in( 0), 11); \ - FF2(D2, A2, B2, C2, in( 1), 14); \ - FF2(C2, D2, A2, B2, in( 2), 15); \ - FF2(B2, C2, D2, A2, in( 3), 12); \ - FF2(A2, B2, C2, D2, in( 4), 5); \ - FF2(D2, A2, B2, C2, in( 5), 8); \ - FF2(C2, D2, A2, B2, in( 6), 7); \ - FF2(B2, C2, D2, A2, in( 7), 9); \ - FF2(A2, B2, C2, D2, in( 8), 11); \ - FF2(D2, A2, B2, C2, in( 9), 13); \ - FF2(C2, D2, A2, B2, in(10), 14); \ - FF2(B2, C2, D2, A2, in(11), 15); \ - FF2(A2, B2, C2, D2, in(12), 6); \ - FF2(D2, A2, B2, C2, in(13), 7); \ - FF2(C2, D2, A2, B2, in(14), 9); \ - FF2(B2, C2, D2, A2, in(15), 8); \ - \ - GG2(A2, B2, C2, D2, in( 7), 7); \ - GG2(D2, A2, B2, C2, in( 4), 6); \ - GG2(C2, D2, A2, B2, in(13), 8); \ - GG2(B2, C2, D2, A2, in( 1), 13); \ - GG2(A2, B2, C2, D2, in(10), 11); \ - GG2(D2, A2, B2, C2, in( 6), 9); \ - GG2(C2, D2, A2, B2, in(15), 7); \ - GG2(B2, C2, D2, A2, in( 3), 15); \ - GG2(A2, B2, C2, D2, in(12), 7); \ - GG2(D2, A2, B2, C2, in( 0), 12); \ - GG2(C2, D2, A2, B2, in( 9), 15); \ - GG2(B2, C2, D2, A2, in( 5), 9); \ - GG2(A2, B2, C2, D2, in(14), 7); \ - GG2(D2, A2, B2, C2, in( 2), 11); \ - GG2(C2, D2, A2, B2, in(11), 13); \ - GG2(B2, C2, D2, A2, in( 8), 12); \ - \ - HH2(A2, B2, C2, D2, in( 3), 11); \ - HH2(D2, A2, B2, C2, in(10), 13); \ - HH2(C2, D2, A2, B2, in( 2), 14); \ - HH2(B2, C2, D2, A2, in( 4), 7); \ - HH2(A2, B2, C2, D2, in( 9), 14); \ - HH2(D2, A2, B2, C2, in(15), 9); \ - HH2(C2, D2, A2, B2, in( 8), 13); \ - HH2(B2, C2, D2, A2, in( 1), 15); \ - HH2(A2, B2, C2, D2, in(14), 6); \ - HH2(D2, A2, B2, C2, in( 7), 8); \ - HH2(C2, D2, A2, B2, in( 0), 13); \ - HH2(B2, C2, D2, A2, in( 6), 6); \ - HH2(A2, B2, C2, D2, in(11), 12); \ - HH2(D2, A2, B2, C2, in(13), 5); \ - HH2(C2, D2, A2, B2, in( 5), 7); \ - HH2(B2, C2, D2, A2, in(12), 5); \ - \ - tmp = SPH_T32((h)[1] + C1 + D2); \ - (h)[1] = SPH_T32((h)[2] + D1 + A2); \ - (h)[2] = SPH_T32((h)[3] + A1 + B2); \ - (h)[3] = SPH_T32((h)[0] + B1 + C2); \ - (h)[0] = tmp; \ - } while (0) - -/* - * One round of RIPEMD. The data must be aligned for 32-bit access. - */ -static void -ripemd_round(const unsigned char *data, sph_u32 r[5]) -{ -#if SPH_LITTLE_FAST - -#define RIPEMD_IN(x) sph_dec32le_aligned(data + (4 * (x))) - -#else - - sph_u32 X_var[16]; - int i; - - for (i = 0; i < 16; i ++) - X_var[i] = sph_dec32le_aligned(data + 4 * i); -#define RIPEMD_IN(x) X_var[x] - -#endif - RIPEMD_ROUND_BODY(RIPEMD_IN, r); -#undef RIPEMD_IN -} - -/* see sph_ripemd.h */ -void -sph_ripemd_init(void *cc) -{ - sph_ripemd_context *sc; - - sc = cc; - memcpy(sc->val, oIV, sizeof sc->val); -#if SPH_64 - sc->count = 0; -#else - sc->count_high = sc->count_low = 0; -#endif -} - -#define RFUN ripemd_round -#define HASH ripemd -#define LE32 1 -#include "md_helper.c" -#undef RFUN -#undef HASH -#undef LE32 - -/* see sph_ripemd.h */ -void -sph_ripemd_close(void *cc, void *dst) -{ - ripemd_close(cc, dst, 4); - sph_ripemd_init(cc); -} - -/* see sph_ripemd.h */ -void -sph_ripemd_comp(const sph_u32 msg[16], sph_u32 val[4]) -{ -#define RIPEMD_IN(x) msg[x] - RIPEMD_ROUND_BODY(RIPEMD_IN, val); -#undef RIPEMD_IN -} - -/* ===================================================================== */ -/* - * RIPEMD-128. - */ - -/* - * Round constants for RIPEMD-128. - */ -#define sK11 SPH_C32(0x00000000) -#define sK12 SPH_C32(0x5A827999) -#define sK13 SPH_C32(0x6ED9EBA1) -#define sK14 SPH_C32(0x8F1BBCDC) - -#define sK21 SPH_C32(0x50A28BE6) -#define sK22 SPH_C32(0x5C4DD124) -#define sK23 SPH_C32(0x6D703EF3) -#define sK24 SPH_C32(0x00000000) - -#define sRR(a, b, c, d, f, s, r, k) do { \ - a = ROTL(SPH_T32(a + f(b, c, d) + r + k), s); \ - } while (0) - -#define sROUND1(a, b, c, d, f, s, r, k) \ - sRR(a ## 1, b ## 1, c ## 1, d ## 1, f, s, r, sK1 ## k) - -#define sROUND2(a, b, c, d, f, s, r, k) \ - sRR(a ## 2, b ## 2, c ## 2, d ## 2, f, s, r, sK2 ## k) - -/* - * This macro defines the body for a RIPEMD-128 compression function - * implementation. The "in" parameter should evaluate, when applied to a - * numerical input parameter from 0 to 15, to an expression which yields - * the corresponding input block. The "h" parameter should evaluate to - * an array or pointer expression designating the array of 4 words which - * contains the input and output of the compression function. - */ - -#define RIPEMD128_ROUND_BODY(in, h) do { \ - sph_u32 A1, B1, C1, D1; \ - sph_u32 A2, B2, C2, D2; \ - sph_u32 tmp; \ - \ - A1 = A2 = (h)[0]; \ - B1 = B2 = (h)[1]; \ - C1 = C2 = (h)[2]; \ - D1 = D2 = (h)[3]; \ - \ - sROUND1(A, B, C, D, F1, 11, in( 0), 1); \ - sROUND1(D, A, B, C, F1, 14, in( 1), 1); \ - sROUND1(C, D, A, B, F1, 15, in( 2), 1); \ - sROUND1(B, C, D, A, F1, 12, in( 3), 1); \ - sROUND1(A, B, C, D, F1, 5, in( 4), 1); \ - sROUND1(D, A, B, C, F1, 8, in( 5), 1); \ - sROUND1(C, D, A, B, F1, 7, in( 6), 1); \ - sROUND1(B, C, D, A, F1, 9, in( 7), 1); \ - sROUND1(A, B, C, D, F1, 11, in( 8), 1); \ - sROUND1(D, A, B, C, F1, 13, in( 9), 1); \ - sROUND1(C, D, A, B, F1, 14, in(10), 1); \ - sROUND1(B, C, D, A, F1, 15, in(11), 1); \ - sROUND1(A, B, C, D, F1, 6, in(12), 1); \ - sROUND1(D, A, B, C, F1, 7, in(13), 1); \ - sROUND1(C, D, A, B, F1, 9, in(14), 1); \ - sROUND1(B, C, D, A, F1, 8, in(15), 1); \ - \ - sROUND1(A, B, C, D, F2, 7, in( 7), 2); \ - sROUND1(D, A, B, C, F2, 6, in( 4), 2); \ - sROUND1(C, D, A, B, F2, 8, in(13), 2); \ - sROUND1(B, C, D, A, F2, 13, in( 1), 2); \ - sROUND1(A, B, C, D, F2, 11, in(10), 2); \ - sROUND1(D, A, B, C, F2, 9, in( 6), 2); \ - sROUND1(C, D, A, B, F2, 7, in(15), 2); \ - sROUND1(B, C, D, A, F2, 15, in( 3), 2); \ - sROUND1(A, B, C, D, F2, 7, in(12), 2); \ - sROUND1(D, A, B, C, F2, 12, in( 0), 2); \ - sROUND1(C, D, A, B, F2, 15, in( 9), 2); \ - sROUND1(B, C, D, A, F2, 9, in( 5), 2); \ - sROUND1(A, B, C, D, F2, 11, in( 2), 2); \ - sROUND1(D, A, B, C, F2, 7, in(14), 2); \ - sROUND1(C, D, A, B, F2, 13, in(11), 2); \ - sROUND1(B, C, D, A, F2, 12, in( 8), 2); \ - \ - sROUND1(A, B, C, D, F3, 11, in( 3), 3); \ - sROUND1(D, A, B, C, F3, 13, in(10), 3); \ - sROUND1(C, D, A, B, F3, 6, in(14), 3); \ - sROUND1(B, C, D, A, F3, 7, in( 4), 3); \ - sROUND1(A, B, C, D, F3, 14, in( 9), 3); \ - sROUND1(D, A, B, C, F3, 9, in(15), 3); \ - sROUND1(C, D, A, B, F3, 13, in( 8), 3); \ - sROUND1(B, C, D, A, F3, 15, in( 1), 3); \ - sROUND1(A, B, C, D, F3, 14, in( 2), 3); \ - sROUND1(D, A, B, C, F3, 8, in( 7), 3); \ - sROUND1(C, D, A, B, F3, 13, in( 0), 3); \ - sROUND1(B, C, D, A, F3, 6, in( 6), 3); \ - sROUND1(A, B, C, D, F3, 5, in(13), 3); \ - sROUND1(D, A, B, C, F3, 12, in(11), 3); \ - sROUND1(C, D, A, B, F3, 7, in( 5), 3); \ - sROUND1(B, C, D, A, F3, 5, in(12), 3); \ - \ - sROUND1(A, B, C, D, F4, 11, in( 1), 4); \ - sROUND1(D, A, B, C, F4, 12, in( 9), 4); \ - sROUND1(C, D, A, B, F4, 14, in(11), 4); \ - sROUND1(B, C, D, A, F4, 15, in(10), 4); \ - sROUND1(A, B, C, D, F4, 14, in( 0), 4); \ - sROUND1(D, A, B, C, F4, 15, in( 8), 4); \ - sROUND1(C, D, A, B, F4, 9, in(12), 4); \ - sROUND1(B, C, D, A, F4, 8, in( 4), 4); \ - sROUND1(A, B, C, D, F4, 9, in(13), 4); \ - sROUND1(D, A, B, C, F4, 14, in( 3), 4); \ - sROUND1(C, D, A, B, F4, 5, in( 7), 4); \ - sROUND1(B, C, D, A, F4, 6, in(15), 4); \ - sROUND1(A, B, C, D, F4, 8, in(14), 4); \ - sROUND1(D, A, B, C, F4, 6, in( 5), 4); \ - sROUND1(C, D, A, B, F4, 5, in( 6), 4); \ - sROUND1(B, C, D, A, F4, 12, in( 2), 4); \ - \ - sROUND2(A, B, C, D, F4, 8, in( 5), 1); \ - sROUND2(D, A, B, C, F4, 9, in(14), 1); \ - sROUND2(C, D, A, B, F4, 9, in( 7), 1); \ - sROUND2(B, C, D, A, F4, 11, in( 0), 1); \ - sROUND2(A, B, C, D, F4, 13, in( 9), 1); \ - sROUND2(D, A, B, C, F4, 15, in( 2), 1); \ - sROUND2(C, D, A, B, F4, 15, in(11), 1); \ - sROUND2(B, C, D, A, F4, 5, in( 4), 1); \ - sROUND2(A, B, C, D, F4, 7, in(13), 1); \ - sROUND2(D, A, B, C, F4, 7, in( 6), 1); \ - sROUND2(C, D, A, B, F4, 8, in(15), 1); \ - sROUND2(B, C, D, A, F4, 11, in( 8), 1); \ - sROUND2(A, B, C, D, F4, 14, in( 1), 1); \ - sROUND2(D, A, B, C, F4, 14, in(10), 1); \ - sROUND2(C, D, A, B, F4, 12, in( 3), 1); \ - sROUND2(B, C, D, A, F4, 6, in(12), 1); \ - \ - sROUND2(A, B, C, D, F3, 9, in( 6), 2); \ - sROUND2(D, A, B, C, F3, 13, in(11), 2); \ - sROUND2(C, D, A, B, F3, 15, in( 3), 2); \ - sROUND2(B, C, D, A, F3, 7, in( 7), 2); \ - sROUND2(A, B, C, D, F3, 12, in( 0), 2); \ - sROUND2(D, A, B, C, F3, 8, in(13), 2); \ - sROUND2(C, D, A, B, F3, 9, in( 5), 2); \ - sROUND2(B, C, D, A, F3, 11, in(10), 2); \ - sROUND2(A, B, C, D, F3, 7, in(14), 2); \ - sROUND2(D, A, B, C, F3, 7, in(15), 2); \ - sROUND2(C, D, A, B, F3, 12, in( 8), 2); \ - sROUND2(B, C, D, A, F3, 7, in(12), 2); \ - sROUND2(A, B, C, D, F3, 6, in( 4), 2); \ - sROUND2(D, A, B, C, F3, 15, in( 9), 2); \ - sROUND2(C, D, A, B, F3, 13, in( 1), 2); \ - sROUND2(B, C, D, A, F3, 11, in( 2), 2); \ - \ - sROUND2(A, B, C, D, F2, 9, in(15), 3); \ - sROUND2(D, A, B, C, F2, 7, in( 5), 3); \ - sROUND2(C, D, A, B, F2, 15, in( 1), 3); \ - sROUND2(B, C, D, A, F2, 11, in( 3), 3); \ - sROUND2(A, B, C, D, F2, 8, in( 7), 3); \ - sROUND2(D, A, B, C, F2, 6, in(14), 3); \ - sROUND2(C, D, A, B, F2, 6, in( 6), 3); \ - sROUND2(B, C, D, A, F2, 14, in( 9), 3); \ - sROUND2(A, B, C, D, F2, 12, in(11), 3); \ - sROUND2(D, A, B, C, F2, 13, in( 8), 3); \ - sROUND2(C, D, A, B, F2, 5, in(12), 3); \ - sROUND2(B, C, D, A, F2, 14, in( 2), 3); \ - sROUND2(A, B, C, D, F2, 13, in(10), 3); \ - sROUND2(D, A, B, C, F2, 13, in( 0), 3); \ - sROUND2(C, D, A, B, F2, 7, in( 4), 3); \ - sROUND2(B, C, D, A, F2, 5, in(13), 3); \ - \ - sROUND2(A, B, C, D, F1, 15, in( 8), 4); \ - sROUND2(D, A, B, C, F1, 5, in( 6), 4); \ - sROUND2(C, D, A, B, F1, 8, in( 4), 4); \ - sROUND2(B, C, D, A, F1, 11, in( 1), 4); \ - sROUND2(A, B, C, D, F1, 14, in( 3), 4); \ - sROUND2(D, A, B, C, F1, 14, in(11), 4); \ - sROUND2(C, D, A, B, F1, 6, in(15), 4); \ - sROUND2(B, C, D, A, F1, 14, in( 0), 4); \ - sROUND2(A, B, C, D, F1, 6, in( 5), 4); \ - sROUND2(D, A, B, C, F1, 9, in(12), 4); \ - sROUND2(C, D, A, B, F1, 12, in( 2), 4); \ - sROUND2(B, C, D, A, F1, 9, in(13), 4); \ - sROUND2(A, B, C, D, F1, 12, in( 9), 4); \ - sROUND2(D, A, B, C, F1, 5, in( 7), 4); \ - sROUND2(C, D, A, B, F1, 15, in(10), 4); \ - sROUND2(B, C, D, A, F1, 8, in(14), 4); \ - \ - tmp = SPH_T32((h)[1] + C1 + D2); \ - (h)[1] = SPH_T32((h)[2] + D1 + A2); \ - (h)[2] = SPH_T32((h)[3] + A1 + B2); \ - (h)[3] = SPH_T32((h)[0] + B1 + C2); \ - (h)[0] = tmp; \ - } while (0) - -/* - * One round of RIPEMD-128. The data must be aligned for 32-bit access. - */ -static void -ripemd128_round(const unsigned char *data, sph_u32 r[5]) -{ -#if SPH_LITTLE_FAST - -#define RIPEMD128_IN(x) sph_dec32le_aligned(data + (4 * (x))) - -#else - - sph_u32 X_var[16]; - int i; - - for (i = 0; i < 16; i ++) - X_var[i] = sph_dec32le_aligned(data + 4 * i); -#define RIPEMD128_IN(x) X_var[x] - -#endif - RIPEMD128_ROUND_BODY(RIPEMD128_IN, r); -#undef RIPEMD128_IN -} - -/* see sph_ripemd.h */ -void -sph_ripemd128_init(void *cc) -{ - sph_ripemd128_context *sc; - - sc = cc; - memcpy(sc->val, IV, sizeof sc->val); -#if SPH_64 - sc->count = 0; -#else - sc->count_high = sc->count_low = 0; -#endif -} - -#define RFUN ripemd128_round -#define HASH ripemd128 -#define LE32 1 -#include "md_helper.c" -#undef RFUN -#undef HASH -#undef LE32 - -/* see sph_ripemd.h */ -void -sph_ripemd128_close(void *cc, void *dst) -{ - ripemd128_close(cc, dst, 4); - sph_ripemd128_init(cc); -} - -/* see sph_ripemd.h */ -void -sph_ripemd128_comp(const sph_u32 msg[16], sph_u32 val[4]) -{ -#define RIPEMD128_IN(x) msg[x] - RIPEMD128_ROUND_BODY(RIPEMD128_IN, val); -#undef RIPEMD128_IN -} - -/* ===================================================================== */ -/* - * RIPEMD-160. - */ - -/* - * Round constants for RIPEMD-160. - */ -#define K11 SPH_C32(0x00000000) -#define K12 SPH_C32(0x5A827999) -#define K13 SPH_C32(0x6ED9EBA1) -#define K14 SPH_C32(0x8F1BBCDC) -#define K15 SPH_C32(0xA953FD4E) - -#define K21 SPH_C32(0x50A28BE6) -#define K22 SPH_C32(0x5C4DD124) -#define K23 SPH_C32(0x6D703EF3) -#define K24 SPH_C32(0x7A6D76E9) -#define K25 SPH_C32(0x00000000) - -#define RR(a, b, c, d, e, f, s, r, k) do { \ - a = SPH_T32(ROTL(SPH_T32(a + f(b, c, d) + r + k), s) + e); \ - c = ROTL(c, 10); \ - } while (0) - -#define ROUND1(a, b, c, d, e, f, s, r, k) \ - RR(a ## 1, b ## 1, c ## 1, d ## 1, e ## 1, f, s, r, K1 ## k) - -#define ROUND2(a, b, c, d, e, f, s, r, k) \ - RR(a ## 2, b ## 2, c ## 2, d ## 2, e ## 2, f, s, r, K2 ## k) - -/* - * This macro defines the body for a RIPEMD-160 compression function - * implementation. The "in" parameter should evaluate, when applied to a - * numerical input parameter from 0 to 15, to an expression which yields - * the corresponding input block. The "h" parameter should evaluate to - * an array or pointer expression designating the array of 5 words which - * contains the input and output of the compression function. - */ - -#define RIPEMD160_ROUND_BODY(in, h) do { \ - sph_u32 A1, B1, C1, D1, E1; \ - sph_u32 A2, B2, C2, D2, E2; \ - sph_u32 tmp; \ - \ - A1 = A2 = (h)[0]; \ - B1 = B2 = (h)[1]; \ - C1 = C2 = (h)[2]; \ - D1 = D2 = (h)[3]; \ - E1 = E2 = (h)[4]; \ - \ - ROUND1(A, B, C, D, E, F1, 11, in( 0), 1); \ - ROUND1(E, A, B, C, D, F1, 14, in( 1), 1); \ - ROUND1(D, E, A, B, C, F1, 15, in( 2), 1); \ - ROUND1(C, D, E, A, B, F1, 12, in( 3), 1); \ - ROUND1(B, C, D, E, A, F1, 5, in( 4), 1); \ - ROUND1(A, B, C, D, E, F1, 8, in( 5), 1); \ - ROUND1(E, A, B, C, D, F1, 7, in( 6), 1); \ - ROUND1(D, E, A, B, C, F1, 9, in( 7), 1); \ - ROUND1(C, D, E, A, B, F1, 11, in( 8), 1); \ - ROUND1(B, C, D, E, A, F1, 13, in( 9), 1); \ - ROUND1(A, B, C, D, E, F1, 14, in(10), 1); \ - ROUND1(E, A, B, C, D, F1, 15, in(11), 1); \ - ROUND1(D, E, A, B, C, F1, 6, in(12), 1); \ - ROUND1(C, D, E, A, B, F1, 7, in(13), 1); \ - ROUND1(B, C, D, E, A, F1, 9, in(14), 1); \ - ROUND1(A, B, C, D, E, F1, 8, in(15), 1); \ - \ - ROUND1(E, A, B, C, D, F2, 7, in( 7), 2); \ - ROUND1(D, E, A, B, C, F2, 6, in( 4), 2); \ - ROUND1(C, D, E, A, B, F2, 8, in(13), 2); \ - ROUND1(B, C, D, E, A, F2, 13, in( 1), 2); \ - ROUND1(A, B, C, D, E, F2, 11, in(10), 2); \ - ROUND1(E, A, B, C, D, F2, 9, in( 6), 2); \ - ROUND1(D, E, A, B, C, F2, 7, in(15), 2); \ - ROUND1(C, D, E, A, B, F2, 15, in( 3), 2); \ - ROUND1(B, C, D, E, A, F2, 7, in(12), 2); \ - ROUND1(A, B, C, D, E, F2, 12, in( 0), 2); \ - ROUND1(E, A, B, C, D, F2, 15, in( 9), 2); \ - ROUND1(D, E, A, B, C, F2, 9, in( 5), 2); \ - ROUND1(C, D, E, A, B, F2, 11, in( 2), 2); \ - ROUND1(B, C, D, E, A, F2, 7, in(14), 2); \ - ROUND1(A, B, C, D, E, F2, 13, in(11), 2); \ - ROUND1(E, A, B, C, D, F2, 12, in( 8), 2); \ - \ - ROUND1(D, E, A, B, C, F3, 11, in( 3), 3); \ - ROUND1(C, D, E, A, B, F3, 13, in(10), 3); \ - ROUND1(B, C, D, E, A, F3, 6, in(14), 3); \ - ROUND1(A, B, C, D, E, F3, 7, in( 4), 3); \ - ROUND1(E, A, B, C, D, F3, 14, in( 9), 3); \ - ROUND1(D, E, A, B, C, F3, 9, in(15), 3); \ - ROUND1(C, D, E, A, B, F3, 13, in( 8), 3); \ - ROUND1(B, C, D, E, A, F3, 15, in( 1), 3); \ - ROUND1(A, B, C, D, E, F3, 14, in( 2), 3); \ - ROUND1(E, A, B, C, D, F3, 8, in( 7), 3); \ - ROUND1(D, E, A, B, C, F3, 13, in( 0), 3); \ - ROUND1(C, D, E, A, B, F3, 6, in( 6), 3); \ - ROUND1(B, C, D, E, A, F3, 5, in(13), 3); \ - ROUND1(A, B, C, D, E, F3, 12, in(11), 3); \ - ROUND1(E, A, B, C, D, F3, 7, in( 5), 3); \ - ROUND1(D, E, A, B, C, F3, 5, in(12), 3); \ - \ - ROUND1(C, D, E, A, B, F4, 11, in( 1), 4); \ - ROUND1(B, C, D, E, A, F4, 12, in( 9), 4); \ - ROUND1(A, B, C, D, E, F4, 14, in(11), 4); \ - ROUND1(E, A, B, C, D, F4, 15, in(10), 4); \ - ROUND1(D, E, A, B, C, F4, 14, in( 0), 4); \ - ROUND1(C, D, E, A, B, F4, 15, in( 8), 4); \ - ROUND1(B, C, D, E, A, F4, 9, in(12), 4); \ - ROUND1(A, B, C, D, E, F4, 8, in( 4), 4); \ - ROUND1(E, A, B, C, D, F4, 9, in(13), 4); \ - ROUND1(D, E, A, B, C, F4, 14, in( 3), 4); \ - ROUND1(C, D, E, A, B, F4, 5, in( 7), 4); \ - ROUND1(B, C, D, E, A, F4, 6, in(15), 4); \ - ROUND1(A, B, C, D, E, F4, 8, in(14), 4); \ - ROUND1(E, A, B, C, D, F4, 6, in( 5), 4); \ - ROUND1(D, E, A, B, C, F4, 5, in( 6), 4); \ - ROUND1(C, D, E, A, B, F4, 12, in( 2), 4); \ - \ - ROUND1(B, C, D, E, A, F5, 9, in( 4), 5); \ - ROUND1(A, B, C, D, E, F5, 15, in( 0), 5); \ - ROUND1(E, A, B, C, D, F5, 5, in( 5), 5); \ - ROUND1(D, E, A, B, C, F5, 11, in( 9), 5); \ - ROUND1(C, D, E, A, B, F5, 6, in( 7), 5); \ - ROUND1(B, C, D, E, A, F5, 8, in(12), 5); \ - ROUND1(A, B, C, D, E, F5, 13, in( 2), 5); \ - ROUND1(E, A, B, C, D, F5, 12, in(10), 5); \ - ROUND1(D, E, A, B, C, F5, 5, in(14), 5); \ - ROUND1(C, D, E, A, B, F5, 12, in( 1), 5); \ - ROUND1(B, C, D, E, A, F5, 13, in( 3), 5); \ - ROUND1(A, B, C, D, E, F5, 14, in( 8), 5); \ - ROUND1(E, A, B, C, D, F5, 11, in(11), 5); \ - ROUND1(D, E, A, B, C, F5, 8, in( 6), 5); \ - ROUND1(C, D, E, A, B, F5, 5, in(15), 5); \ - ROUND1(B, C, D, E, A, F5, 6, in(13), 5); \ - \ - ROUND2(A, B, C, D, E, F5, 8, in( 5), 1); \ - ROUND2(E, A, B, C, D, F5, 9, in(14), 1); \ - ROUND2(D, E, A, B, C, F5, 9, in( 7), 1); \ - ROUND2(C, D, E, A, B, F5, 11, in( 0), 1); \ - ROUND2(B, C, D, E, A, F5, 13, in( 9), 1); \ - ROUND2(A, B, C, D, E, F5, 15, in( 2), 1); \ - ROUND2(E, A, B, C, D, F5, 15, in(11), 1); \ - ROUND2(D, E, A, B, C, F5, 5, in( 4), 1); \ - ROUND2(C, D, E, A, B, F5, 7, in(13), 1); \ - ROUND2(B, C, D, E, A, F5, 7, in( 6), 1); \ - ROUND2(A, B, C, D, E, F5, 8, in(15), 1); \ - ROUND2(E, A, B, C, D, F5, 11, in( 8), 1); \ - ROUND2(D, E, A, B, C, F5, 14, in( 1), 1); \ - ROUND2(C, D, E, A, B, F5, 14, in(10), 1); \ - ROUND2(B, C, D, E, A, F5, 12, in( 3), 1); \ - ROUND2(A, B, C, D, E, F5, 6, in(12), 1); \ - \ - ROUND2(E, A, B, C, D, F4, 9, in( 6), 2); \ - ROUND2(D, E, A, B, C, F4, 13, in(11), 2); \ - ROUND2(C, D, E, A, B, F4, 15, in( 3), 2); \ - ROUND2(B, C, D, E, A, F4, 7, in( 7), 2); \ - ROUND2(A, B, C, D, E, F4, 12, in( 0), 2); \ - ROUND2(E, A, B, C, D, F4, 8, in(13), 2); \ - ROUND2(D, E, A, B, C, F4, 9, in( 5), 2); \ - ROUND2(C, D, E, A, B, F4, 11, in(10), 2); \ - ROUND2(B, C, D, E, A, F4, 7, in(14), 2); \ - ROUND2(A, B, C, D, E, F4, 7, in(15), 2); \ - ROUND2(E, A, B, C, D, F4, 12, in( 8), 2); \ - ROUND2(D, E, A, B, C, F4, 7, in(12), 2); \ - ROUND2(C, D, E, A, B, F4, 6, in( 4), 2); \ - ROUND2(B, C, D, E, A, F4, 15, in( 9), 2); \ - ROUND2(A, B, C, D, E, F4, 13, in( 1), 2); \ - ROUND2(E, A, B, C, D, F4, 11, in( 2), 2); \ - \ - ROUND2(D, E, A, B, C, F3, 9, in(15), 3); \ - ROUND2(C, D, E, A, B, F3, 7, in( 5), 3); \ - ROUND2(B, C, D, E, A, F3, 15, in( 1), 3); \ - ROUND2(A, B, C, D, E, F3, 11, in( 3), 3); \ - ROUND2(E, A, B, C, D, F3, 8, in( 7), 3); \ - ROUND2(D, E, A, B, C, F3, 6, in(14), 3); \ - ROUND2(C, D, E, A, B, F3, 6, in( 6), 3); \ - ROUND2(B, C, D, E, A, F3, 14, in( 9), 3); \ - ROUND2(A, B, C, D, E, F3, 12, in(11), 3); \ - ROUND2(E, A, B, C, D, F3, 13, in( 8), 3); \ - ROUND2(D, E, A, B, C, F3, 5, in(12), 3); \ - ROUND2(C, D, E, A, B, F3, 14, in( 2), 3); \ - ROUND2(B, C, D, E, A, F3, 13, in(10), 3); \ - ROUND2(A, B, C, D, E, F3, 13, in( 0), 3); \ - ROUND2(E, A, B, C, D, F3, 7, in( 4), 3); \ - ROUND2(D, E, A, B, C, F3, 5, in(13), 3); \ - \ - ROUND2(C, D, E, A, B, F2, 15, in( 8), 4); \ - ROUND2(B, C, D, E, A, F2, 5, in( 6), 4); \ - ROUND2(A, B, C, D, E, F2, 8, in( 4), 4); \ - ROUND2(E, A, B, C, D, F2, 11, in( 1), 4); \ - ROUND2(D, E, A, B, C, F2, 14, in( 3), 4); \ - ROUND2(C, D, E, A, B, F2, 14, in(11), 4); \ - ROUND2(B, C, D, E, A, F2, 6, in(15), 4); \ - ROUND2(A, B, C, D, E, F2, 14, in( 0), 4); \ - ROUND2(E, A, B, C, D, F2, 6, in( 5), 4); \ - ROUND2(D, E, A, B, C, F2, 9, in(12), 4); \ - ROUND2(C, D, E, A, B, F2, 12, in( 2), 4); \ - ROUND2(B, C, D, E, A, F2, 9, in(13), 4); \ - ROUND2(A, B, C, D, E, F2, 12, in( 9), 4); \ - ROUND2(E, A, B, C, D, F2, 5, in( 7), 4); \ - ROUND2(D, E, A, B, C, F2, 15, in(10), 4); \ - ROUND2(C, D, E, A, B, F2, 8, in(14), 4); \ - \ - ROUND2(B, C, D, E, A, F1, 8, in(12), 5); \ - ROUND2(A, B, C, D, E, F1, 5, in(15), 5); \ - ROUND2(E, A, B, C, D, F1, 12, in(10), 5); \ - ROUND2(D, E, A, B, C, F1, 9, in( 4), 5); \ - ROUND2(C, D, E, A, B, F1, 12, in( 1), 5); \ - ROUND2(B, C, D, E, A, F1, 5, in( 5), 5); \ - ROUND2(A, B, C, D, E, F1, 14, in( 8), 5); \ - ROUND2(E, A, B, C, D, F1, 6, in( 7), 5); \ - ROUND2(D, E, A, B, C, F1, 8, in( 6), 5); \ - ROUND2(C, D, E, A, B, F1, 13, in( 2), 5); \ - ROUND2(B, C, D, E, A, F1, 6, in(13), 5); \ - ROUND2(A, B, C, D, E, F1, 5, in(14), 5); \ - ROUND2(E, A, B, C, D, F1, 15, in( 0), 5); \ - ROUND2(D, E, A, B, C, F1, 13, in( 3), 5); \ - ROUND2(C, D, E, A, B, F1, 11, in( 9), 5); \ - ROUND2(B, C, D, E, A, F1, 11, in(11), 5); \ - \ - tmp = SPH_T32((h)[1] + C1 + D2); \ - (h)[1] = SPH_T32((h)[2] + D1 + E2); \ - (h)[2] = SPH_T32((h)[3] + E1 + A2); \ - (h)[3] = SPH_T32((h)[4] + A1 + B2); \ - (h)[4] = SPH_T32((h)[0] + B1 + C2); \ - (h)[0] = tmp; \ - } while (0) - -/* - * One round of RIPEMD-160. The data must be aligned for 32-bit access. - */ -static void -ripemd160_round(const unsigned char *data, sph_u32 r[5]) -{ -#if SPH_LITTLE_FAST - -#define RIPEMD160_IN(x) sph_dec32le_aligned(data + (4 * (x))) - -#else - - sph_u32 X_var[16]; - int i; - - for (i = 0; i < 16; i ++) - X_var[i] = sph_dec32le_aligned(data + 4 * i); -#define RIPEMD160_IN(x) X_var[x] - -#endif - RIPEMD160_ROUND_BODY(RIPEMD160_IN, r); -#undef RIPEMD160_IN -} - -/* see sph_ripemd.h */ -void -sph_ripemd160_init(void *cc) -{ - sph_ripemd160_context *sc; - - sc = cc; - memcpy(sc->val, IV, sizeof sc->val); -#if SPH_64 - sc->count = 0; -#else - sc->count_high = sc->count_low = 0; -#endif -} - -#define RFUN ripemd160_round -#define HASH ripemd160 -#define LE32 1 -#include "md_helper.c" -#undef RFUN -#undef HASH -#undef LE32 - -/* see sph_ripemd.h */ -void -sph_ripemd160_close(void *cc, void *dst) -{ - ripemd160_close(cc, dst, 5); - sph_ripemd160_init(cc); -} - -/* see sph_ripemd.h */ -void -sph_ripemd160_comp(const sph_u32 msg[16], sph_u32 val[5]) -{ -#define RIPEMD160_IN(x) msg[x] - RIPEMD160_ROUND_BODY(RIPEMD160_IN, val); -#undef RIPEMD160_IN -} diff --git a/sph/shabal.c b/sph/shabal.c deleted file mode 100644 index 06d368ce..00000000 --- a/sph/shabal.c +++ /dev/null @@ -1,810 +0,0 @@ -/* $Id: shabal.c 175 2010-05-07 16:03:20Z tp $ */ -/* - * Shabal implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include - -#include "sph_shabal.h" -#ifdef __cplusplus -extern "C"{ -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -/* - * Part of this code was automatically generated (the part between - * the "BEGIN" and "END" markers). - */ - -#define sM 16 - -#define C32 SPH_C32 -#define T32 SPH_T32 - -#define O1 13 -#define O2 9 -#define O3 6 - -/* - * We copy the state into local variables, so that the compiler knows - * that it can optimize them at will. - */ - -/* BEGIN -- automatically generated code. */ - -#define DECL_STATE \ - sph_u32 A00, A01, A02, A03, A04, A05, A06, A07, \ - A08, A09, A0A, A0B; \ - sph_u32 B0, B1, B2, B3, B4, B5, B6, B7, \ - B8, B9, BA, BB, BC, BD, BE, BF; \ - sph_u32 C0, C1, C2, C3, C4, C5, C6, C7, \ - C8, C9, CA, CB, CC, CD, CE, CF; \ - sph_u32 M0, M1, M2, M3, M4, M5, M6, M7, \ - M8, M9, MA, MB, MC, MD, ME, MF; \ - sph_u32 Wlow, Whigh; - -#define READ_STATE(state) do { \ - A00 = (state)->A[0]; \ - A01 = (state)->A[1]; \ - A02 = (state)->A[2]; \ - A03 = (state)->A[3]; \ - A04 = (state)->A[4]; \ - A05 = (state)->A[5]; \ - A06 = (state)->A[6]; \ - A07 = (state)->A[7]; \ - A08 = (state)->A[8]; \ - A09 = (state)->A[9]; \ - A0A = (state)->A[10]; \ - A0B = (state)->A[11]; \ - B0 = (state)->B[0]; \ - B1 = (state)->B[1]; \ - B2 = (state)->B[2]; \ - B3 = (state)->B[3]; \ - B4 = (state)->B[4]; \ - B5 = (state)->B[5]; \ - B6 = (state)->B[6]; \ - B7 = (state)->B[7]; \ - B8 = (state)->B[8]; \ - B9 = (state)->B[9]; \ - BA = (state)->B[10]; \ - BB = (state)->B[11]; \ - BC = (state)->B[12]; \ - BD = (state)->B[13]; \ - BE = (state)->B[14]; \ - BF = (state)->B[15]; \ - C0 = (state)->C[0]; \ - C1 = (state)->C[1]; \ - C2 = (state)->C[2]; \ - C3 = (state)->C[3]; \ - C4 = (state)->C[4]; \ - C5 = (state)->C[5]; \ - C6 = (state)->C[6]; \ - C7 = (state)->C[7]; \ - C8 = (state)->C[8]; \ - C9 = (state)->C[9]; \ - CA = (state)->C[10]; \ - CB = (state)->C[11]; \ - CC = (state)->C[12]; \ - CD = (state)->C[13]; \ - CE = (state)->C[14]; \ - CF = (state)->C[15]; \ - Wlow = (state)->Wlow; \ - Whigh = (state)->Whigh; \ - } while (0) - -#define WRITE_STATE(state) do { \ - (state)->A[0] = A00; \ - (state)->A[1] = A01; \ - (state)->A[2] = A02; \ - (state)->A[3] = A03; \ - (state)->A[4] = A04; \ - (state)->A[5] = A05; \ - (state)->A[6] = A06; \ - (state)->A[7] = A07; \ - (state)->A[8] = A08; \ - (state)->A[9] = A09; \ - (state)->A[10] = A0A; \ - (state)->A[11] = A0B; \ - (state)->B[0] = B0; \ - (state)->B[1] = B1; \ - (state)->B[2] = B2; \ - (state)->B[3] = B3; \ - (state)->B[4] = B4; \ - (state)->B[5] = B5; \ - (state)->B[6] = B6; \ - (state)->B[7] = B7; \ - (state)->B[8] = B8; \ - (state)->B[9] = B9; \ - (state)->B[10] = BA; \ - (state)->B[11] = BB; \ - (state)->B[12] = BC; \ - (state)->B[13] = BD; \ - (state)->B[14] = BE; \ - (state)->B[15] = BF; \ - (state)->C[0] = C0; \ - (state)->C[1] = C1; \ - (state)->C[2] = C2; \ - (state)->C[3] = C3; \ - (state)->C[4] = C4; \ - (state)->C[5] = C5; \ - (state)->C[6] = C6; \ - (state)->C[7] = C7; \ - (state)->C[8] = C8; \ - (state)->C[9] = C9; \ - (state)->C[10] = CA; \ - (state)->C[11] = CB; \ - (state)->C[12] = CC; \ - (state)->C[13] = CD; \ - (state)->C[14] = CE; \ - (state)->C[15] = CF; \ - (state)->Wlow = Wlow; \ - (state)->Whigh = Whigh; \ - } while (0) - -#define DECODE_BLOCK do { \ - M0 = sph_dec32le_aligned(buf + 0); \ - M1 = sph_dec32le_aligned(buf + 4); \ - M2 = sph_dec32le_aligned(buf + 8); \ - M3 = sph_dec32le_aligned(buf + 12); \ - M4 = sph_dec32le_aligned(buf + 16); \ - M5 = sph_dec32le_aligned(buf + 20); \ - M6 = sph_dec32le_aligned(buf + 24); \ - M7 = sph_dec32le_aligned(buf + 28); \ - M8 = sph_dec32le_aligned(buf + 32); \ - M9 = sph_dec32le_aligned(buf + 36); \ - MA = sph_dec32le_aligned(buf + 40); \ - MB = sph_dec32le_aligned(buf + 44); \ - MC = sph_dec32le_aligned(buf + 48); \ - MD = sph_dec32le_aligned(buf + 52); \ - ME = sph_dec32le_aligned(buf + 56); \ - MF = sph_dec32le_aligned(buf + 60); \ - } while (0) - -#define INPUT_BLOCK_ADD do { \ - B0 = T32(B0 + M0); \ - B1 = T32(B1 + M1); \ - B2 = T32(B2 + M2); \ - B3 = T32(B3 + M3); \ - B4 = T32(B4 + M4); \ - B5 = T32(B5 + M5); \ - B6 = T32(B6 + M6); \ - B7 = T32(B7 + M7); \ - B8 = T32(B8 + M8); \ - B9 = T32(B9 + M9); \ - BA = T32(BA + MA); \ - BB = T32(BB + MB); \ - BC = T32(BC + MC); \ - BD = T32(BD + MD); \ - BE = T32(BE + ME); \ - BF = T32(BF + MF); \ - } while (0) - -#define INPUT_BLOCK_SUB do { \ - C0 = T32(C0 - M0); \ - C1 = T32(C1 - M1); \ - C2 = T32(C2 - M2); \ - C3 = T32(C3 - M3); \ - C4 = T32(C4 - M4); \ - C5 = T32(C5 - M5); \ - C6 = T32(C6 - M6); \ - C7 = T32(C7 - M7); \ - C8 = T32(C8 - M8); \ - C9 = T32(C9 - M9); \ - CA = T32(CA - MA); \ - CB = T32(CB - MB); \ - CC = T32(CC - MC); \ - CD = T32(CD - MD); \ - CE = T32(CE - ME); \ - CF = T32(CF - MF); \ - } while (0) - -#define XOR_W do { \ - A00 ^= Wlow; \ - A01 ^= Whigh; \ - } while (0) - -#define SWAP(v1, v2) do { \ - sph_u32 tmp = (v1); \ - (v1) = (v2); \ - (v2) = tmp; \ - } while (0) - -#define SWAP_BC do { \ - SWAP(B0, C0); \ - SWAP(B1, C1); \ - SWAP(B2, C2); \ - SWAP(B3, C3); \ - SWAP(B4, C4); \ - SWAP(B5, C5); \ - SWAP(B6, C6); \ - SWAP(B7, C7); \ - SWAP(B8, C8); \ - SWAP(B9, C9); \ - SWAP(BA, CA); \ - SWAP(BB, CB); \ - SWAP(BC, CC); \ - SWAP(BD, CD); \ - SWAP(BE, CE); \ - SWAP(BF, CF); \ - } while (0) - -#define PERM_ELT(xa0, xa1, xb0, xb1, xb2, xb3, xc, xm) do { \ - xa0 = T32((xa0 \ - ^ (((xa1 << 15) | (xa1 >> 17)) * 5U) \ - ^ xc) * 3U) \ - ^ xb1 ^ (xb2 & ~xb3) ^ xm; \ - xb0 = T32(~(((xb0 << 1) | (xb0 >> 31)) ^ xa0)); \ - } while (0) - -#define PERM_STEP_0 do { \ - PERM_ELT(A00, A0B, B0, BD, B9, B6, C8, M0); \ - PERM_ELT(A01, A00, B1, BE, BA, B7, C7, M1); \ - PERM_ELT(A02, A01, B2, BF, BB, B8, C6, M2); \ - PERM_ELT(A03, A02, B3, B0, BC, B9, C5, M3); \ - PERM_ELT(A04, A03, B4, B1, BD, BA, C4, M4); \ - PERM_ELT(A05, A04, B5, B2, BE, BB, C3, M5); \ - PERM_ELT(A06, A05, B6, B3, BF, BC, C2, M6); \ - PERM_ELT(A07, A06, B7, B4, B0, BD, C1, M7); \ - PERM_ELT(A08, A07, B8, B5, B1, BE, C0, M8); \ - PERM_ELT(A09, A08, B9, B6, B2, BF, CF, M9); \ - PERM_ELT(A0A, A09, BA, B7, B3, B0, CE, MA); \ - PERM_ELT(A0B, A0A, BB, B8, B4, B1, CD, MB); \ - PERM_ELT(A00, A0B, BC, B9, B5, B2, CC, MC); \ - PERM_ELT(A01, A00, BD, BA, B6, B3, CB, MD); \ - PERM_ELT(A02, A01, BE, BB, B7, B4, CA, ME); \ - PERM_ELT(A03, A02, BF, BC, B8, B5, C9, MF); \ - } while (0) - -#define PERM_STEP_1 do { \ - PERM_ELT(A04, A03, B0, BD, B9, B6, C8, M0); \ - PERM_ELT(A05, A04, B1, BE, BA, B7, C7, M1); \ - PERM_ELT(A06, A05, B2, BF, BB, B8, C6, M2); \ - PERM_ELT(A07, A06, B3, B0, BC, B9, C5, M3); \ - PERM_ELT(A08, A07, B4, B1, BD, BA, C4, M4); \ - PERM_ELT(A09, A08, B5, B2, BE, BB, C3, M5); \ - PERM_ELT(A0A, A09, B6, B3, BF, BC, C2, M6); \ - PERM_ELT(A0B, A0A, B7, B4, B0, BD, C1, M7); \ - PERM_ELT(A00, A0B, B8, B5, B1, BE, C0, M8); \ - PERM_ELT(A01, A00, B9, B6, B2, BF, CF, M9); \ - PERM_ELT(A02, A01, BA, B7, B3, B0, CE, MA); \ - PERM_ELT(A03, A02, BB, B8, B4, B1, CD, MB); \ - PERM_ELT(A04, A03, BC, B9, B5, B2, CC, MC); \ - PERM_ELT(A05, A04, BD, BA, B6, B3, CB, MD); \ - PERM_ELT(A06, A05, BE, BB, B7, B4, CA, ME); \ - PERM_ELT(A07, A06, BF, BC, B8, B5, C9, MF); \ - } while (0) - -#define PERM_STEP_2 do { \ - PERM_ELT(A08, A07, B0, BD, B9, B6, C8, M0); \ - PERM_ELT(A09, A08, B1, BE, BA, B7, C7, M1); \ - PERM_ELT(A0A, A09, B2, BF, BB, B8, C6, M2); \ - PERM_ELT(A0B, A0A, B3, B0, BC, B9, C5, M3); \ - PERM_ELT(A00, A0B, B4, B1, BD, BA, C4, M4); \ - PERM_ELT(A01, A00, B5, B2, BE, BB, C3, M5); \ - PERM_ELT(A02, A01, B6, B3, BF, BC, C2, M6); \ - PERM_ELT(A03, A02, B7, B4, B0, BD, C1, M7); \ - PERM_ELT(A04, A03, B8, B5, B1, BE, C0, M8); \ - PERM_ELT(A05, A04, B9, B6, B2, BF, CF, M9); \ - PERM_ELT(A06, A05, BA, B7, B3, B0, CE, MA); \ - PERM_ELT(A07, A06, BB, B8, B4, B1, CD, MB); \ - PERM_ELT(A08, A07, BC, B9, B5, B2, CC, MC); \ - PERM_ELT(A09, A08, BD, BA, B6, B3, CB, MD); \ - PERM_ELT(A0A, A09, BE, BB, B7, B4, CA, ME); \ - PERM_ELT(A0B, A0A, BF, BC, B8, B5, C9, MF); \ - } while (0) - -#define APPLY_P do { \ - B0 = T32(B0 << 17) | (B0 >> 15); \ - B1 = T32(B1 << 17) | (B1 >> 15); \ - B2 = T32(B2 << 17) | (B2 >> 15); \ - B3 = T32(B3 << 17) | (B3 >> 15); \ - B4 = T32(B4 << 17) | (B4 >> 15); \ - B5 = T32(B5 << 17) | (B5 >> 15); \ - B6 = T32(B6 << 17) | (B6 >> 15); \ - B7 = T32(B7 << 17) | (B7 >> 15); \ - B8 = T32(B8 << 17) | (B8 >> 15); \ - B9 = T32(B9 << 17) | (B9 >> 15); \ - BA = T32(BA << 17) | (BA >> 15); \ - BB = T32(BB << 17) | (BB >> 15); \ - BC = T32(BC << 17) | (BC >> 15); \ - BD = T32(BD << 17) | (BD >> 15); \ - BE = T32(BE << 17) | (BE >> 15); \ - BF = T32(BF << 17) | (BF >> 15); \ - PERM_STEP_0; \ - PERM_STEP_1; \ - PERM_STEP_2; \ - A0B = T32(A0B + C6); \ - A0A = T32(A0A + C5); \ - A09 = T32(A09 + C4); \ - A08 = T32(A08 + C3); \ - A07 = T32(A07 + C2); \ - A06 = T32(A06 + C1); \ - A05 = T32(A05 + C0); \ - A04 = T32(A04 + CF); \ - A03 = T32(A03 + CE); \ - A02 = T32(A02 + CD); \ - A01 = T32(A01 + CC); \ - A00 = T32(A00 + CB); \ - A0B = T32(A0B + CA); \ - A0A = T32(A0A + C9); \ - A09 = T32(A09 + C8); \ - A08 = T32(A08 + C7); \ - A07 = T32(A07 + C6); \ - A06 = T32(A06 + C5); \ - A05 = T32(A05 + C4); \ - A04 = T32(A04 + C3); \ - A03 = T32(A03 + C2); \ - A02 = T32(A02 + C1); \ - A01 = T32(A01 + C0); \ - A00 = T32(A00 + CF); \ - A0B = T32(A0B + CE); \ - A0A = T32(A0A + CD); \ - A09 = T32(A09 + CC); \ - A08 = T32(A08 + CB); \ - A07 = T32(A07 + CA); \ - A06 = T32(A06 + C9); \ - A05 = T32(A05 + C8); \ - A04 = T32(A04 + C7); \ - A03 = T32(A03 + C6); \ - A02 = T32(A02 + C5); \ - A01 = T32(A01 + C4); \ - A00 = T32(A00 + C3); \ - } while (0) - -#define INCR_W do { \ - if ((Wlow = T32(Wlow + 1)) == 0) \ - Whigh = T32(Whigh + 1); \ - } while (0) -#if 0 -static const sph_u32 A_init_192[] = { - C32(0xFD749ED4), C32(0xB798E530), C32(0x33904B6F), C32(0x46BDA85E), - C32(0x076934B4), C32(0x454B4058), C32(0x77F74527), C32(0xFB4CF465), - C32(0x62931DA9), C32(0xE778C8DB), C32(0x22B3998E), C32(0xAC15CFB9) -}; - -static const sph_u32 B_init_192[] = { - C32(0x58BCBAC4), C32(0xEC47A08E), C32(0xAEE933B2), C32(0xDFCBC824), - C32(0xA7944804), C32(0xBF65BDB0), C32(0x5A9D4502), C32(0x59979AF7), - C32(0xC5CEA54E), C32(0x4B6B8150), C32(0x16E71909), C32(0x7D632319), - C32(0x930573A0), C32(0xF34C63D1), C32(0xCAF914B4), C32(0xFDD6612C) -}; - -static const sph_u32 C_init_192[] = { - C32(0x61550878), C32(0x89EF2B75), C32(0xA1660C46), C32(0x7EF3855B), - C32(0x7297B58C), C32(0x1BC67793), C32(0x7FB1C723), C32(0xB66FC640), - C32(0x1A48B71C), C32(0xF0976D17), C32(0x088CE80A), C32(0xA454EDF3), - C32(0x1C096BF4), C32(0xAC76224B), C32(0x5215781C), C32(0xCD5D2669) -}; - -static const sph_u32 A_init_224[] = { - C32(0xA5201467), C32(0xA9B8D94A), C32(0xD4CED997), C32(0x68379D7B), - C32(0xA7FC73BA), C32(0xF1A2546B), C32(0x606782BF), C32(0xE0BCFD0F), - C32(0x2F25374E), C32(0x069A149F), C32(0x5E2DFF25), C32(0xFAECF061) -}; - -static const sph_u32 B_init_224[] = { - C32(0xEC9905D8), C32(0xF21850CF), C32(0xC0A746C8), C32(0x21DAD498), - C32(0x35156EEB), C32(0x088C97F2), C32(0x26303E40), C32(0x8A2D4FB5), - C32(0xFEEE44B6), C32(0x8A1E9573), C32(0x7B81111A), C32(0xCBC139F0), - C32(0xA3513861), C32(0x1D2C362E), C32(0x918C580E), C32(0xB58E1B9C) -}; - -static const sph_u32 C_init_224[] = { - C32(0xE4B573A1), C32(0x4C1A0880), C32(0x1E907C51), C32(0x04807EFD), - C32(0x3AD8CDE5), C32(0x16B21302), C32(0x02512C53), C32(0x2204CB18), - C32(0x99405F2D), C32(0xE5B648A1), C32(0x70AB1D43), C32(0xA10C25C2), - C32(0x16F1AC05), C32(0x38BBEB56), C32(0x9B01DC60), C32(0xB1096D83) -}; - -static const sph_u32 A_init_256[] = { - C32(0x52F84552), C32(0xE54B7999), C32(0x2D8EE3EC), C32(0xB9645191), - C32(0xE0078B86), C32(0xBB7C44C9), C32(0xD2B5C1CA), C32(0xB0D2EB8C), - C32(0x14CE5A45), C32(0x22AF50DC), C32(0xEFFDBC6B), C32(0xEB21B74A) -}; - -static const sph_u32 B_init_256[] = { - C32(0xB555C6EE), C32(0x3E710596), C32(0xA72A652F), C32(0x9301515F), - C32(0xDA28C1FA), C32(0x696FD868), C32(0x9CB6BF72), C32(0x0AFE4002), - C32(0xA6E03615), C32(0x5138C1D4), C32(0xBE216306), C32(0xB38B8890), - C32(0x3EA8B96B), C32(0x3299ACE4), C32(0x30924DD4), C32(0x55CB34A5) -}; - -static const sph_u32 C_init_256[] = { - C32(0xB405F031), C32(0xC4233EBA), C32(0xB3733979), C32(0xC0DD9D55), - C32(0xC51C28AE), C32(0xA327B8E1), C32(0x56C56167), C32(0xED614433), - C32(0x88B59D60), C32(0x60E2CEBA), C32(0x758B4B8B), C32(0x83E82A7F), - C32(0xBC968828), C32(0xE6E00BF7), C32(0xBA839E55), C32(0x9B491C60) -}; - -static const sph_u32 A_init_384[] = { - C32(0xC8FCA331), C32(0xE55C504E), C32(0x003EBF26), C32(0xBB6B8D83), - C32(0x7B0448C1), C32(0x41B82789), C32(0x0A7C9601), C32(0x8D659CFF), - C32(0xB6E2673E), C32(0xCA54C77B), C32(0x1460FD7E), C32(0x3FCB8F2D) -}; - -static const sph_u32 B_init_384[] = { - C32(0x527291FC), C32(0x2A16455F), C32(0x78E627E5), C32(0x944F169F), - C32(0x1CA6F016), C32(0xA854EA25), C32(0x8DB98ABE), C32(0xF2C62641), - C32(0x30117DCB), C32(0xCF5C4309), C32(0x93711A25), C32(0xF9F671B8), - C32(0xB01D2116), C32(0x333F4B89), C32(0xB285D165), C32(0x86829B36) -}; - -static const sph_u32 C_init_384[] = { - C32(0xF764B11A), C32(0x76172146), C32(0xCEF6934D), C32(0xC6D28399), - C32(0xFE095F61), C32(0x5E6018B4), C32(0x5048ECF5), C32(0x51353261), - C32(0x6E6E36DC), C32(0x63130DAD), C32(0xA9C69BD6), C32(0x1E90EA0C), - C32(0x7C35073B), C32(0x28D95E6D), C32(0xAA340E0D), C32(0xCB3DEE70) -}; -#endif -static const sph_u32 A_init_512[] = { - C32(0x20728DFD), C32(0x46C0BD53), C32(0xE782B699), C32(0x55304632), - C32(0x71B4EF90), C32(0x0EA9E82C), C32(0xDBB930F1), C32(0xFAD06B8B), - C32(0xBE0CAE40), C32(0x8BD14410), C32(0x76D2ADAC), C32(0x28ACAB7F) -}; - -static const sph_u32 B_init_512[] = { - C32(0xC1099CB7), C32(0x07B385F3), C32(0xE7442C26), C32(0xCC8AD640), - C32(0xEB6F56C7), C32(0x1EA81AA9), C32(0x73B9D314), C32(0x1DE85D08), - C32(0x48910A5A), C32(0x893B22DB), C32(0xC5A0DF44), C32(0xBBC4324E), - C32(0x72D2F240), C32(0x75941D99), C32(0x6D8BDE82), C32(0xA1A7502B) -}; - -static const sph_u32 C_init_512[] = { - C32(0xD9BF68D1), C32(0x58BAD750), C32(0x56028CB2), C32(0x8134F359), - C32(0xB5D469D8), C32(0x941A8CC2), C32(0x418B2A6E), C32(0x04052780), - C32(0x7F07D787), C32(0x5194358F), C32(0x3C60D665), C32(0xBE97D79A), - C32(0x950C3434), C32(0xAED9A06D), C32(0x2537DC8D), C32(0x7CDB5969) -}; - -/* END -- automatically generated code. */ - -static void -shabal_init(void *cc, unsigned size) -{ - /* - * We have precomputed initial states for all the supported - * output bit lengths. - */ - const sph_u32 *A_init, *B_init, *C_init; - sph_shabal_context *sc; - - switch (size) { -#if 0 - case 192: - A_init = A_init_192; - B_init = B_init_192; - C_init = C_init_192; - break; - case 224: - A_init = A_init_224; - B_init = B_init_224; - C_init = C_init_224; - break; - case 256: - A_init = A_init_256; - B_init = B_init_256; - C_init = C_init_256; - break; - case 384: - A_init = A_init_384; - B_init = B_init_384; - C_init = C_init_384; - break; -#endif - case 512: - A_init = A_init_512; - B_init = B_init_512; - C_init = C_init_512; - break; - default: - return; - } - sc = cc; - memcpy(sc->A, A_init, sizeof sc->A); - memcpy(sc->B, B_init, sizeof sc->B); - memcpy(sc->C, C_init, sizeof sc->C); - sc->Wlow = 1; - sc->Whigh = 0; - sc->ptr = 0; -} - -static void -shabal_core(void *cc, const unsigned char *data, size_t len) -{ - sph_shabal_context *sc; - unsigned char *buf; - size_t ptr; - DECL_STATE - - sc = cc; - buf = sc->buf; - ptr = sc->ptr; - - /* - * We do not want to copy the state to local variables if the - * amount of data is less than what is needed to complete the - * current block. Note that it is anyway suboptimal to call - * this method many times for small chunks of data. - */ - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - READ_STATE(sc); - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data += clen; - len -= clen; - if (ptr == sizeof sc->buf) { - DECODE_BLOCK; - INPUT_BLOCK_ADD; - XOR_W; - APPLY_P; - INPUT_BLOCK_SUB; - SWAP_BC; - INCR_W; - ptr = 0; - } - } - WRITE_STATE(sc); - sc->ptr = ptr; -} - -static void -shabal_close(void *cc, unsigned ub, unsigned n, void *dst, unsigned size_words) -{ - sph_shabal_context *sc; - unsigned char *buf; - size_t ptr; - int i; - unsigned z; - union { - unsigned char tmp_out[64]; - sph_u32 dummy; - } u; - size_t out_len; - DECL_STATE - - sc = cc; - buf = sc->buf; - ptr = sc->ptr; - z = 0x80 >> n; - buf[ptr] = ((ub & -z) | z) & 0xFF; - memset(buf + ptr + 1, 0, (sizeof sc->buf) - (ptr + 1)); - READ_STATE(sc); - DECODE_BLOCK; - INPUT_BLOCK_ADD; - XOR_W; - APPLY_P; - for (i = 0; i < 3; i ++) { - SWAP_BC; - XOR_W; - APPLY_P; - } - - /* - * We just use our local variables; no need to go through - * the state structure. In order to share some code, we - * emit the relevant words into a temporary buffer, which - * we finally copy into the destination array. - */ - switch (size_words) { - case 16: - sph_enc32le_aligned(u.tmp_out + 0, B0); - sph_enc32le_aligned(u.tmp_out + 4, B1); - sph_enc32le_aligned(u.tmp_out + 8, B2); - sph_enc32le_aligned(u.tmp_out + 12, B3); - /* fall through */ - case 12: - sph_enc32le_aligned(u.tmp_out + 16, B4); - sph_enc32le_aligned(u.tmp_out + 20, B5); - sph_enc32le_aligned(u.tmp_out + 24, B6); - sph_enc32le_aligned(u.tmp_out + 28, B7); - /* fall through */ - case 8: - sph_enc32le_aligned(u.tmp_out + 32, B8); - /* fall through */ - case 7: - sph_enc32le_aligned(u.tmp_out + 36, B9); - /* fall through */ - case 6: - sph_enc32le_aligned(u.tmp_out + 40, BA); - sph_enc32le_aligned(u.tmp_out + 44, BB); - sph_enc32le_aligned(u.tmp_out + 48, BC); - sph_enc32le_aligned(u.tmp_out + 52, BD); - sph_enc32le_aligned(u.tmp_out + 56, BE); - sph_enc32le_aligned(u.tmp_out + 60, BF); - break; - default: - return; - } - out_len = size_words << 2; - memcpy(dst, u.tmp_out + (sizeof u.tmp_out) - out_len, out_len); - shabal_init(sc, size_words << 5); -} - -#if 0 -/* see sph_shabal.h */ -void -sph_shabal192_init(void *cc) -{ - shabal_init(cc, 192); -} - -/* see sph_shabal.h */ -void -sph_shabal192(void *cc, const void *data, size_t len) -{ - shabal_core(cc, data, len); -} - -/* see sph_shabal.h */ -void -sph_shabal192_close(void *cc, void *dst) -{ - shabal_close(cc, 0, 0, dst, 6); -} - -/* see sph_shabal.h */ -void -sph_shabal192_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - shabal_close(cc, ub, n, dst, 6); -} - -/* see sph_shabal.h */ -void -sph_shabal224_init(void *cc) -{ - shabal_init(cc, 224); -} - -/* see sph_shabal.h */ -void -sph_shabal224(void *cc, const void *data, size_t len) -{ - shabal_core(cc, data, len); -} - -/* see sph_shabal.h */ -void -sph_shabal224_close(void *cc, void *dst) -{ - shabal_close(cc, 0, 0, dst, 7); -} - -/* see sph_shabal.h */ -void -sph_shabal224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - shabal_close(cc, ub, n, dst, 7); -} - -/* see sph_shabal.h */ -void -sph_shabal256_init(void *cc) -{ - shabal_init(cc, 256); -} - -/* see sph_shabal.h */ -void -sph_shabal256(void *cc, const void *data, size_t len) -{ - shabal_core(cc, data, len); -} - -/* see sph_shabal.h */ -void -sph_shabal256_close(void *cc, void *dst) -{ - shabal_close(cc, 0, 0, dst, 8); -} - -/* see sph_shabal.h */ -void -sph_shabal256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - shabal_close(cc, ub, n, dst, 8); -} - -/* see sph_shabal.h */ -void -sph_shabal384_init(void *cc) -{ - shabal_init(cc, 384); -} - -/* see sph_shabal.h */ -void -sph_shabal384(void *cc, const void *data, size_t len) -{ - shabal_core(cc, data, len); -} - -/* see sph_shabal.h */ -void -sph_shabal384_close(void *cc, void *dst) -{ - shabal_close(cc, 0, 0, dst, 12); -} - -/* see sph_shabal.h */ -void -sph_shabal384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - shabal_close(cc, ub, n, dst, 12); -} - -#endif - -/* see sph_shabal.h */ -void -sph_shabal512_init(void *cc) -{ - shabal_init(cc, 512); -} - -/* see sph_shabal.h */ -void -sph_shabal512(void *cc, const void *data, size_t len) -{ - shabal_core(cc, data, len); -} - -/* see sph_shabal.h */ -void -sph_shabal512_close(void *cc, void *dst) -{ - shabal_close(cc, 0, 0, dst, 16); -} - -/* see sph_shabal.h */ -void -sph_shabal512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - shabal_close(cc, ub, n, dst, 16); -} -#ifdef __cplusplus -} -#endif diff --git a/sph/shavite.c b/sph/shavite.c deleted file mode 100644 index 85074f33..00000000 --- a/sph/shavite.c +++ /dev/null @@ -1,1764 +0,0 @@ -/* $Id: shavite.c 227 2010-06-16 17:28:38Z tp $ */ -/* - * SHAvite-3 implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include - -#include "sph_shavite.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -#if SPH_SMALL_FOOTPRINT && !defined SPH_SMALL_FOOTPRINT_SHAVITE -#define SPH_SMALL_FOOTPRINT_SHAVITE 1 -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -#define C32 SPH_C32 - -/* - * As of round 2 of the SHA-3 competition, the published reference - * implementation and test vectors are wrong, because they use - * big-endian AES tables while the internal decoding uses little-endian. - * The code below follows the specification. To turn it into a code - * which follows the reference implementation (the one called "BugFix" - * on the SHAvite-3 web site, published on Nov 23rd, 2009), comment out - * the code below (from the '#define AES_BIG_ENDIAN...' to the definition - * of the AES_ROUND_NOKEY macro) and replace it with the version which - * is commented out afterwards. - */ - -#define AES_BIG_ENDIAN 0 -#include "aes_helper.c" - -static const sph_u32 IV224[] = { - C32(0x6774F31C), C32(0x990AE210), C32(0xC87D4274), C32(0xC9546371), - C32(0x62B2AEA8), C32(0x4B5801D8), C32(0x1B702860), C32(0x842F3017) -}; - -static const sph_u32 IV256[] = { - C32(0x49BB3E47), C32(0x2674860D), C32(0xA8B392AC), C32(0x021AC4E6), - C32(0x409283CF), C32(0x620E5D86), C32(0x6D929DCB), C32(0x96CC2A8B) -}; - -static const sph_u32 IV384[] = { - C32(0x83DF1545), C32(0xF9AAEC13), C32(0xF4803CB0), C32(0x11FE1F47), - C32(0xDA6CD269), C32(0x4F53FCD7), C32(0x950529A2), C32(0x97908147), - C32(0xB0A4D7AF), C32(0x2B9132BF), C32(0x226E607D), C32(0x3C0F8D7C), - C32(0x487B3F0F), C32(0x04363E22), C32(0x0155C99C), C32(0xEC2E20D3) -}; - -static const sph_u32 IV512[] = { - C32(0x72FCCDD8), C32(0x79CA4727), C32(0x128A077B), C32(0x40D55AEC), - C32(0xD1901A06), C32(0x430AE307), C32(0xB29F5CD1), C32(0xDF07FBFC), - C32(0x8E45D73D), C32(0x681AB538), C32(0xBDE86578), C32(0xDD577E47), - C32(0xE275EADE), C32(0x502D9FCD), C32(0xB9357178), C32(0x022A4B9A) -}; - -#define AES_ROUND_NOKEY(x0, x1, x2, x3) do { \ - sph_u32 t0 = (x0); \ - sph_u32 t1 = (x1); \ - sph_u32 t2 = (x2); \ - sph_u32 t3 = (x3); \ - AES_ROUND_NOKEY_LE(t0, t1, t2, t3, x0, x1, x2, x3); \ - } while (0) - -/* - * This is the code needed to match the "reference implementation" as - * published on Nov 23rd, 2009, instead of the published specification. - * - -#define AES_BIG_ENDIAN 1 -#include "aes_helper.c" - -static const sph_u32 IV224[] = { - C32(0xC4C67795), C32(0xC0B1817F), C32(0xEAD88924), C32(0x1ABB1BB0), - C32(0xE0C29152), C32(0xBDE046BA), C32(0xAEEECF99), C32(0x58D509D8) -}; - -static const sph_u32 IV256[] = { - C32(0x3EECF551), C32(0xBF10819B), C32(0xE6DC8559), C32(0xF3E23FD5), - C32(0x431AEC73), C32(0x79E3F731), C32(0x98325F05), C32(0xA92A31F1) -}; - -static const sph_u32 IV384[] = { - C32(0x71F48510), C32(0xA903A8AC), C32(0xFE3216DD), C32(0x0B2D2AD4), - C32(0x6672900A), C32(0x41032819), C32(0x15A7D780), C32(0xB3CAB8D9), - C32(0x34EF4711), C32(0xDE019FE8), C32(0x4D674DC4), C32(0xE056D96B), - C32(0xA35C016B), C32(0xDD903BA7), C32(0x8C1B09B4), C32(0x2C3E9F25) -}; - -static const sph_u32 IV512[] = { - C32(0xD5652B63), C32(0x25F1E6EA), C32(0xB18F48FA), C32(0xA1EE3A47), - C32(0xC8B67B07), C32(0xBDCE48D3), C32(0xE3937B78), C32(0x05DB5186), - C32(0x613BE326), C32(0xA11FA303), C32(0x90C833D4), C32(0x79CEE316), - C32(0x1E1AF00F), C32(0x2829B165), C32(0x23B25F80), C32(0x21E11499) -}; - -#define AES_ROUND_NOKEY(x0, x1, x2, x3) do { \ - sph_u32 t0 = (x0); \ - sph_u32 t1 = (x1); \ - sph_u32 t2 = (x2); \ - sph_u32 t3 = (x3); \ - AES_ROUND_NOKEY_BE(t0, t1, t2, t3, x0, x1, x2, x3); \ - } while (0) - - */ - -#define KEY_EXPAND_ELT(k0, k1, k2, k3) do { \ - sph_u32 kt; \ - AES_ROUND_NOKEY(k1, k2, k3, k0); \ - kt = (k0); \ - (k0) = (k1); \ - (k1) = (k2); \ - (k2) = (k3); \ - (k3) = kt; \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_SHAVITE - -/* - * This function assumes that "msg" is aligned for 32-bit access. - */ -static void -c256(sph_shavite_small_context *sc, const void *msg) -{ - sph_u32 p0, p1, p2, p3, p4, p5, p6, p7; - sph_u32 rk[144]; - size_t u; - int r, s; - -#if SPH_LITTLE_ENDIAN - memcpy(rk, msg, 64); -#else - for (u = 0; u < 16; u += 4) { - rk[u + 0] = sph_dec32le_aligned( - (const unsigned char *)msg + (u << 2) + 0); - rk[u + 1] = sph_dec32le_aligned( - (const unsigned char *)msg + (u << 2) + 4); - rk[u + 2] = sph_dec32le_aligned( - (const unsigned char *)msg + (u << 2) + 8); - rk[u + 3] = sph_dec32le_aligned( - (const unsigned char *)msg + (u << 2) + 12); - } -#endif - u = 16; - for (r = 0; r < 4; r ++) { - for (s = 0; s < 2; s ++) { - sph_u32 x0, x1, x2, x3; - - x0 = rk[u - 15]; - x1 = rk[u - 14]; - x2 = rk[u - 13]; - x3 = rk[u - 16]; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk[u + 0] = x0 ^ rk[u - 4]; - rk[u + 1] = x1 ^ rk[u - 3]; - rk[u + 2] = x2 ^ rk[u - 2]; - rk[u + 3] = x3 ^ rk[u - 1]; - if (u == 16) { - rk[ 16] ^= sc->count0; - rk[ 17] ^= SPH_T32(~sc->count1); - } else if (u == 56) { - rk[ 57] ^= sc->count1; - rk[ 58] ^= SPH_T32(~sc->count0); - } - u += 4; - - x0 = rk[u - 15]; - x1 = rk[u - 14]; - x2 = rk[u - 13]; - x3 = rk[u - 16]; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk[u + 0] = x0 ^ rk[u - 4]; - rk[u + 1] = x1 ^ rk[u - 3]; - rk[u + 2] = x2 ^ rk[u - 2]; - rk[u + 3] = x3 ^ rk[u - 1]; - if (u == 84) { - rk[ 86] ^= sc->count1; - rk[ 87] ^= SPH_T32(~sc->count0); - } else if (u == 124) { - rk[124] ^= sc->count0; - rk[127] ^= SPH_T32(~sc->count1); - } - u += 4; - } - for (s = 0; s < 4; s ++) { - rk[u + 0] = rk[u - 16] ^ rk[u - 3]; - rk[u + 1] = rk[u - 15] ^ rk[u - 2]; - rk[u + 2] = rk[u - 14] ^ rk[u - 1]; - rk[u + 3] = rk[u - 13] ^ rk[u - 0]; - u += 4; - } - } - - p0 = sc->h[0x0]; - p1 = sc->h[0x1]; - p2 = sc->h[0x2]; - p3 = sc->h[0x3]; - p4 = sc->h[0x4]; - p5 = sc->h[0x5]; - p6 = sc->h[0x6]; - p7 = sc->h[0x7]; - u = 0; - for (r = 0; r < 6; r ++) { - sph_u32 x0, x1, x2, x3; - - x0 = p4 ^ rk[u ++]; - x1 = p5 ^ rk[u ++]; - x2 = p6 ^ rk[u ++]; - x3 = p7 ^ rk[u ++]; - AES_ROUND_NOKEY(x0, x1, x2, x3); - x0 ^= rk[u ++]; - x1 ^= rk[u ++]; - x2 ^= rk[u ++]; - x3 ^= rk[u ++]; - AES_ROUND_NOKEY(x0, x1, x2, x3); - x0 ^= rk[u ++]; - x1 ^= rk[u ++]; - x2 ^= rk[u ++]; - x3 ^= rk[u ++]; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - - x0 = p0 ^ rk[u ++]; - x1 = p1 ^ rk[u ++]; - x2 = p2 ^ rk[u ++]; - x3 = p3 ^ rk[u ++]; - AES_ROUND_NOKEY(x0, x1, x2, x3); - x0 ^= rk[u ++]; - x1 ^= rk[u ++]; - x2 ^= rk[u ++]; - x3 ^= rk[u ++]; - AES_ROUND_NOKEY(x0, x1, x2, x3); - x0 ^= rk[u ++]; - x1 ^= rk[u ++]; - x2 ^= rk[u ++]; - x3 ^= rk[u ++]; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - } - sc->h[0x0] ^= p0; - sc->h[0x1] ^= p1; - sc->h[0x2] ^= p2; - sc->h[0x3] ^= p3; - sc->h[0x4] ^= p4; - sc->h[0x5] ^= p5; - sc->h[0x6] ^= p6; - sc->h[0x7] ^= p7; -} - -#else - -/* - * This function assumes that "msg" is aligned for 32-bit access. - */ -static void -c256(sph_shavite_small_context *sc, const void *msg) -{ - sph_u32 p0, p1, p2, p3, p4, p5, p6, p7; - sph_u32 x0, x1, x2, x3; - sph_u32 rk0, rk1, rk2, rk3, rk4, rk5, rk6, rk7; - sph_u32 rk8, rk9, rkA, rkB, rkC, rkD, rkE, rkF; - - p0 = sc->h[0x0]; - p1 = sc->h[0x1]; - p2 = sc->h[0x2]; - p3 = sc->h[0x3]; - p4 = sc->h[0x4]; - p5 = sc->h[0x5]; - p6 = sc->h[0x6]; - p7 = sc->h[0x7]; - /* round 0 */ - rk0 = sph_dec32le_aligned((const unsigned char *)msg + 0); - x0 = p4 ^ rk0; - rk1 = sph_dec32le_aligned((const unsigned char *)msg + 4); - x1 = p5 ^ rk1; - rk2 = sph_dec32le_aligned((const unsigned char *)msg + 8); - x2 = p6 ^ rk2; - rk3 = sph_dec32le_aligned((const unsigned char *)msg + 12); - x3 = p7 ^ rk3; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk4 = sph_dec32le_aligned((const unsigned char *)msg + 16); - x0 ^= rk4; - rk5 = sph_dec32le_aligned((const unsigned char *)msg + 20); - x1 ^= rk5; - rk6 = sph_dec32le_aligned((const unsigned char *)msg + 24); - x2 ^= rk6; - rk7 = sph_dec32le_aligned((const unsigned char *)msg + 28); - x3 ^= rk7; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk8 = sph_dec32le_aligned((const unsigned char *)msg + 32); - x0 ^= rk8; - rk9 = sph_dec32le_aligned((const unsigned char *)msg + 36); - x1 ^= rk9; - rkA = sph_dec32le_aligned((const unsigned char *)msg + 40); - x2 ^= rkA; - rkB = sph_dec32le_aligned((const unsigned char *)msg + 44); - x3 ^= rkB; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - /* round 1 */ - rkC = sph_dec32le_aligned((const unsigned char *)msg + 48); - x0 = p0 ^ rkC; - rkD = sph_dec32le_aligned((const unsigned char *)msg + 52); - x1 = p1 ^ rkD; - rkE = sph_dec32le_aligned((const unsigned char *)msg + 56); - x2 = p2 ^ rkE; - rkF = sph_dec32le_aligned((const unsigned char *)msg + 60); - x3 = p3 ^ rkF; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk0, rk1, rk2, rk3); - rk0 ^= rkC ^ sc->count0; - rk1 ^= rkD ^ SPH_T32(~sc->count1); - rk2 ^= rkE; - rk3 ^= rkF; - x0 ^= rk0; - x1 ^= rk1; - x2 ^= rk2; - x3 ^= rk3; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk4, rk5, rk6, rk7); - rk4 ^= rk0; - rk5 ^= rk1; - rk6 ^= rk2; - rk7 ^= rk3; - x0 ^= rk4; - x1 ^= rk5; - x2 ^= rk6; - x3 ^= rk7; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - /* round 2 */ - KEY_EXPAND_ELT(rk8, rk9, rkA, rkB); - rk8 ^= rk4; - rk9 ^= rk5; - rkA ^= rk6; - rkB ^= rk7; - x0 = p4 ^ rk8; - x1 = p5 ^ rk9; - x2 = p6 ^ rkA; - x3 = p7 ^ rkB; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rkC, rkD, rkE, rkF); - rkC ^= rk8; - rkD ^= rk9; - rkE ^= rkA; - rkF ^= rkB; - x0 ^= rkC; - x1 ^= rkD; - x2 ^= rkE; - x3 ^= rkF; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk0 ^= rkD; - x0 ^= rk0; - rk1 ^= rkE; - x1 ^= rk1; - rk2 ^= rkF; - x2 ^= rk2; - rk3 ^= rk0; - x3 ^= rk3; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - /* round 3 */ - rk4 ^= rk1; - x0 = p0 ^ rk4; - rk5 ^= rk2; - x1 = p1 ^ rk5; - rk6 ^= rk3; - x2 = p2 ^ rk6; - rk7 ^= rk4; - x3 = p3 ^ rk7; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk8 ^= rk5; - x0 ^= rk8; - rk9 ^= rk6; - x1 ^= rk9; - rkA ^= rk7; - x2 ^= rkA; - rkB ^= rk8; - x3 ^= rkB; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rkC ^= rk9; - x0 ^= rkC; - rkD ^= rkA; - x1 ^= rkD; - rkE ^= rkB; - x2 ^= rkE; - rkF ^= rkC; - x3 ^= rkF; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - /* round 4 */ - KEY_EXPAND_ELT(rk0, rk1, rk2, rk3); - rk0 ^= rkC; - rk1 ^= rkD; - rk2 ^= rkE; - rk3 ^= rkF; - x0 = p4 ^ rk0; - x1 = p5 ^ rk1; - x2 = p6 ^ rk2; - x3 = p7 ^ rk3; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk4, rk5, rk6, rk7); - rk4 ^= rk0; - rk5 ^= rk1; - rk6 ^= rk2; - rk7 ^= rk3; - x0 ^= rk4; - x1 ^= rk5; - x2 ^= rk6; - x3 ^= rk7; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk8, rk9, rkA, rkB); - rk8 ^= rk4; - rk9 ^= rk5 ^ sc->count1; - rkA ^= rk6 ^ SPH_T32(~sc->count0); - rkB ^= rk7; - x0 ^= rk8; - x1 ^= rk9; - x2 ^= rkA; - x3 ^= rkB; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - /* round 5 */ - KEY_EXPAND_ELT(rkC, rkD, rkE, rkF); - rkC ^= rk8; - rkD ^= rk9; - rkE ^= rkA; - rkF ^= rkB; - x0 = p0 ^ rkC; - x1 = p1 ^ rkD; - x2 = p2 ^ rkE; - x3 = p3 ^ rkF; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk0 ^= rkD; - x0 ^= rk0; - rk1 ^= rkE; - x1 ^= rk1; - rk2 ^= rkF; - x2 ^= rk2; - rk3 ^= rk0; - x3 ^= rk3; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk4 ^= rk1; - x0 ^= rk4; - rk5 ^= rk2; - x1 ^= rk5; - rk6 ^= rk3; - x2 ^= rk6; - rk7 ^= rk4; - x3 ^= rk7; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - /* round 6 */ - rk8 ^= rk5; - x0 = p4 ^ rk8; - rk9 ^= rk6; - x1 = p5 ^ rk9; - rkA ^= rk7; - x2 = p6 ^ rkA; - rkB ^= rk8; - x3 = p7 ^ rkB; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rkC ^= rk9; - x0 ^= rkC; - rkD ^= rkA; - x1 ^= rkD; - rkE ^= rkB; - x2 ^= rkE; - rkF ^= rkC; - x3 ^= rkF; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk0, rk1, rk2, rk3); - rk0 ^= rkC; - rk1 ^= rkD; - rk2 ^= rkE; - rk3 ^= rkF; - x0 ^= rk0; - x1 ^= rk1; - x2 ^= rk2; - x3 ^= rk3; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - /* round 7 */ - KEY_EXPAND_ELT(rk4, rk5, rk6, rk7); - rk4 ^= rk0; - rk5 ^= rk1; - rk6 ^= rk2 ^ sc->count1; - rk7 ^= rk3 ^ SPH_T32(~sc->count0); - x0 = p0 ^ rk4; - x1 = p1 ^ rk5; - x2 = p2 ^ rk6; - x3 = p3 ^ rk7; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk8, rk9, rkA, rkB); - rk8 ^= rk4; - rk9 ^= rk5; - rkA ^= rk6; - rkB ^= rk7; - x0 ^= rk8; - x1 ^= rk9; - x2 ^= rkA; - x3 ^= rkB; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rkC, rkD, rkE, rkF); - rkC ^= rk8; - rkD ^= rk9; - rkE ^= rkA; - rkF ^= rkB; - x0 ^= rkC; - x1 ^= rkD; - x2 ^= rkE; - x3 ^= rkF; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - /* round 8 */ - rk0 ^= rkD; - x0 = p4 ^ rk0; - rk1 ^= rkE; - x1 = p5 ^ rk1; - rk2 ^= rkF; - x2 = p6 ^ rk2; - rk3 ^= rk0; - x3 = p7 ^ rk3; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk4 ^= rk1; - x0 ^= rk4; - rk5 ^= rk2; - x1 ^= rk5; - rk6 ^= rk3; - x2 ^= rk6; - rk7 ^= rk4; - x3 ^= rk7; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk8 ^= rk5; - x0 ^= rk8; - rk9 ^= rk6; - x1 ^= rk9; - rkA ^= rk7; - x2 ^= rkA; - rkB ^= rk8; - x3 ^= rkB; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - /* round 9 */ - rkC ^= rk9; - x0 = p0 ^ rkC; - rkD ^= rkA; - x1 = p1 ^ rkD; - rkE ^= rkB; - x2 = p2 ^ rkE; - rkF ^= rkC; - x3 = p3 ^ rkF; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk0, rk1, rk2, rk3); - rk0 ^= rkC; - rk1 ^= rkD; - rk2 ^= rkE; - rk3 ^= rkF; - x0 ^= rk0; - x1 ^= rk1; - x2 ^= rk2; - x3 ^= rk3; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk4, rk5, rk6, rk7); - rk4 ^= rk0; - rk5 ^= rk1; - rk6 ^= rk2; - rk7 ^= rk3; - x0 ^= rk4; - x1 ^= rk5; - x2 ^= rk6; - x3 ^= rk7; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - /* round 10 */ - KEY_EXPAND_ELT(rk8, rk9, rkA, rkB); - rk8 ^= rk4; - rk9 ^= rk5; - rkA ^= rk6; - rkB ^= rk7; - x0 = p4 ^ rk8; - x1 = p5 ^ rk9; - x2 = p6 ^ rkA; - x3 = p7 ^ rkB; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rkC, rkD, rkE, rkF); - rkC ^= rk8 ^ sc->count0; - rkD ^= rk9; - rkE ^= rkA; - rkF ^= rkB ^ SPH_T32(~sc->count1); - x0 ^= rkC; - x1 ^= rkD; - x2 ^= rkE; - x3 ^= rkF; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk0 ^= rkD; - x0 ^= rk0; - rk1 ^= rkE; - x1 ^= rk1; - rk2 ^= rkF; - x2 ^= rk2; - rk3 ^= rk0; - x3 ^= rk3; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - /* round 11 */ - rk4 ^= rk1; - x0 = p0 ^ rk4; - rk5 ^= rk2; - x1 = p1 ^ rk5; - rk6 ^= rk3; - x2 = p2 ^ rk6; - rk7 ^= rk4; - x3 = p3 ^ rk7; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk8 ^= rk5; - x0 ^= rk8; - rk9 ^= rk6; - x1 ^= rk9; - rkA ^= rk7; - x2 ^= rkA; - rkB ^= rk8; - x3 ^= rkB; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rkC ^= rk9; - x0 ^= rkC; - rkD ^= rkA; - x1 ^= rkD; - rkE ^= rkB; - x2 ^= rkE; - rkF ^= rkC; - x3 ^= rkF; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - sc->h[0x0] ^= p0; - sc->h[0x1] ^= p1; - sc->h[0x2] ^= p2; - sc->h[0x3] ^= p3; - sc->h[0x4] ^= p4; - sc->h[0x5] ^= p5; - sc->h[0x6] ^= p6; - sc->h[0x7] ^= p7; -} - -#endif - -#if SPH_SMALL_FOOTPRINT_SHAVITE - -/* - * This function assumes that "msg" is aligned for 32-bit access. - */ -static void -c512(sph_shavite_big_context *sc, const void *msg) -{ - sph_u32 p0, p1, p2, p3, p4, p5, p6, p7; - sph_u32 p8, p9, pA, pB, pC, pD, pE, pF; - sph_u32 rk[448]; - size_t u; - int r, s; - -#if SPH_LITTLE_ENDIAN - memcpy(rk, msg, 128); -#else - for (u = 0; u < 32; u += 4) { - rk[u + 0] = sph_dec32le_aligned( - (const unsigned char *)msg + (u << 2) + 0); - rk[u + 1] = sph_dec32le_aligned( - (const unsigned char *)msg + (u << 2) + 4); - rk[u + 2] = sph_dec32le_aligned( - (const unsigned char *)msg + (u << 2) + 8); - rk[u + 3] = sph_dec32le_aligned( - (const unsigned char *)msg + (u << 2) + 12); - } -#endif - u = 32; - for (;;) { - for (s = 0; s < 4; s ++) { - sph_u32 x0, x1, x2, x3; - - x0 = rk[u - 31]; - x1 = rk[u - 30]; - x2 = rk[u - 29]; - x3 = rk[u - 32]; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk[u + 0] = x0 ^ rk[u - 4]; - rk[u + 1] = x1 ^ rk[u - 3]; - rk[u + 2] = x2 ^ rk[u - 2]; - rk[u + 3] = x3 ^ rk[u - 1]; - if (u == 32) { - rk[ 32] ^= sc->count0; - rk[ 33] ^= sc->count1; - rk[ 34] ^= sc->count2; - rk[ 35] ^= SPH_T32(~sc->count3); - } else if (u == 440) { - rk[440] ^= sc->count1; - rk[441] ^= sc->count0; - rk[442] ^= sc->count3; - rk[443] ^= SPH_T32(~sc->count2); - } - u += 4; - - x0 = rk[u - 31]; - x1 = rk[u - 30]; - x2 = rk[u - 29]; - x3 = rk[u - 32]; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk[u + 0] = x0 ^ rk[u - 4]; - rk[u + 1] = x1 ^ rk[u - 3]; - rk[u + 2] = x2 ^ rk[u - 2]; - rk[u + 3] = x3 ^ rk[u - 1]; - if (u == 164) { - rk[164] ^= sc->count3; - rk[165] ^= sc->count2; - rk[166] ^= sc->count1; - rk[167] ^= SPH_T32(~sc->count0); - } else if (u == 316) { - rk[316] ^= sc->count2; - rk[317] ^= sc->count3; - rk[318] ^= sc->count0; - rk[319] ^= SPH_T32(~sc->count1); - } - u += 4; - } - if (u == 448) - break; - for (s = 0; s < 8; s ++) { - rk[u + 0] = rk[u - 32] ^ rk[u - 7]; - rk[u + 1] = rk[u - 31] ^ rk[u - 6]; - rk[u + 2] = rk[u - 30] ^ rk[u - 5]; - rk[u + 3] = rk[u - 29] ^ rk[u - 4]; - u += 4; - } - } - - p0 = sc->h[0x0]; - p1 = sc->h[0x1]; - p2 = sc->h[0x2]; - p3 = sc->h[0x3]; - p4 = sc->h[0x4]; - p5 = sc->h[0x5]; - p6 = sc->h[0x6]; - p7 = sc->h[0x7]; - p8 = sc->h[0x8]; - p9 = sc->h[0x9]; - pA = sc->h[0xA]; - pB = sc->h[0xB]; - pC = sc->h[0xC]; - pD = sc->h[0xD]; - pE = sc->h[0xE]; - pF = sc->h[0xF]; - u = 0; - for (r = 0; r < 14; r ++) { -#define C512_ELT(l0, l1, l2, l3, r0, r1, r2, r3) do { \ - sph_u32 x0, x1, x2, x3; \ - x0 = r0 ^ rk[u ++]; \ - x1 = r1 ^ rk[u ++]; \ - x2 = r2 ^ rk[u ++]; \ - x3 = r3 ^ rk[u ++]; \ - AES_ROUND_NOKEY(x0, x1, x2, x3); \ - x0 ^= rk[u ++]; \ - x1 ^= rk[u ++]; \ - x2 ^= rk[u ++]; \ - x3 ^= rk[u ++]; \ - AES_ROUND_NOKEY(x0, x1, x2, x3); \ - x0 ^= rk[u ++]; \ - x1 ^= rk[u ++]; \ - x2 ^= rk[u ++]; \ - x3 ^= rk[u ++]; \ - AES_ROUND_NOKEY(x0, x1, x2, x3); \ - x0 ^= rk[u ++]; \ - x1 ^= rk[u ++]; \ - x2 ^= rk[u ++]; \ - x3 ^= rk[u ++]; \ - AES_ROUND_NOKEY(x0, x1, x2, x3); \ - l0 ^= x0; \ - l1 ^= x1; \ - l2 ^= x2; \ - l3 ^= x3; \ - } while (0) - -#define WROT(a, b, c, d) do { \ - sph_u32 t = d; \ - d = c; \ - c = b; \ - b = a; \ - a = t; \ - } while (0) - - C512_ELT(p0, p1, p2, p3, p4, p5, p6, p7); - C512_ELT(p8, p9, pA, pB, pC, pD, pE, pF); - - WROT(p0, p4, p8, pC); - WROT(p1, p5, p9, pD); - WROT(p2, p6, pA, pE); - WROT(p3, p7, pB, pF); - -#undef C512_ELT -#undef WROT - } - sc->h[0x0] ^= p0; - sc->h[0x1] ^= p1; - sc->h[0x2] ^= p2; - sc->h[0x3] ^= p3; - sc->h[0x4] ^= p4; - sc->h[0x5] ^= p5; - sc->h[0x6] ^= p6; - sc->h[0x7] ^= p7; - sc->h[0x8] ^= p8; - sc->h[0x9] ^= p9; - sc->h[0xA] ^= pA; - sc->h[0xB] ^= pB; - sc->h[0xC] ^= pC; - sc->h[0xD] ^= pD; - sc->h[0xE] ^= pE; - sc->h[0xF] ^= pF; -} - -#else - -/* - * This function assumes that "msg" is aligned for 32-bit access. - */ -static void -c512(sph_shavite_big_context *sc, const void *msg) -{ - sph_u32 p0, p1, p2, p3, p4, p5, p6, p7; - sph_u32 p8, p9, pA, pB, pC, pD, pE, pF; - sph_u32 x0, x1, x2, x3; - sph_u32 rk00, rk01, rk02, rk03, rk04, rk05, rk06, rk07; - sph_u32 rk08, rk09, rk0A, rk0B, rk0C, rk0D, rk0E, rk0F; - sph_u32 rk10, rk11, rk12, rk13, rk14, rk15, rk16, rk17; - sph_u32 rk18, rk19, rk1A, rk1B, rk1C, rk1D, rk1E, rk1F; - int r; - - p0 = sc->h[0x0]; - p1 = sc->h[0x1]; - p2 = sc->h[0x2]; - p3 = sc->h[0x3]; - p4 = sc->h[0x4]; - p5 = sc->h[0x5]; - p6 = sc->h[0x6]; - p7 = sc->h[0x7]; - p8 = sc->h[0x8]; - p9 = sc->h[0x9]; - pA = sc->h[0xA]; - pB = sc->h[0xB]; - pC = sc->h[0xC]; - pD = sc->h[0xD]; - pE = sc->h[0xE]; - pF = sc->h[0xF]; - /* round 0 */ - rk00 = sph_dec32le_aligned((const unsigned char *)msg + 0); - x0 = p4 ^ rk00; - rk01 = sph_dec32le_aligned((const unsigned char *)msg + 4); - x1 = p5 ^ rk01; - rk02 = sph_dec32le_aligned((const unsigned char *)msg + 8); - x2 = p6 ^ rk02; - rk03 = sph_dec32le_aligned((const unsigned char *)msg + 12); - x3 = p7 ^ rk03; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk04 = sph_dec32le_aligned((const unsigned char *)msg + 16); - x0 ^= rk04; - rk05 = sph_dec32le_aligned((const unsigned char *)msg + 20); - x1 ^= rk05; - rk06 = sph_dec32le_aligned((const unsigned char *)msg + 24); - x2 ^= rk06; - rk07 = sph_dec32le_aligned((const unsigned char *)msg + 28); - x3 ^= rk07; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk08 = sph_dec32le_aligned((const unsigned char *)msg + 32); - x0 ^= rk08; - rk09 = sph_dec32le_aligned((const unsigned char *)msg + 36); - x1 ^= rk09; - rk0A = sph_dec32le_aligned((const unsigned char *)msg + 40); - x2 ^= rk0A; - rk0B = sph_dec32le_aligned((const unsigned char *)msg + 44); - x3 ^= rk0B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk0C = sph_dec32le_aligned((const unsigned char *)msg + 48); - x0 ^= rk0C; - rk0D = sph_dec32le_aligned((const unsigned char *)msg + 52); - x1 ^= rk0D; - rk0E = sph_dec32le_aligned((const unsigned char *)msg + 56); - x2 ^= rk0E; - rk0F = sph_dec32le_aligned((const unsigned char *)msg + 60); - x3 ^= rk0F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - rk10 = sph_dec32le_aligned((const unsigned char *)msg + 64); - x0 = pC ^ rk10; - rk11 = sph_dec32le_aligned((const unsigned char *)msg + 68); - x1 = pD ^ rk11; - rk12 = sph_dec32le_aligned((const unsigned char *)msg + 72); - x2 = pE ^ rk12; - rk13 = sph_dec32le_aligned((const unsigned char *)msg + 76); - x3 = pF ^ rk13; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk14 = sph_dec32le_aligned((const unsigned char *)msg + 80); - x0 ^= rk14; - rk15 = sph_dec32le_aligned((const unsigned char *)msg + 84); - x1 ^= rk15; - rk16 = sph_dec32le_aligned((const unsigned char *)msg + 88); - x2 ^= rk16; - rk17 = sph_dec32le_aligned((const unsigned char *)msg + 92); - x3 ^= rk17; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk18 = sph_dec32le_aligned((const unsigned char *)msg + 96); - x0 ^= rk18; - rk19 = sph_dec32le_aligned((const unsigned char *)msg + 100); - x1 ^= rk19; - rk1A = sph_dec32le_aligned((const unsigned char *)msg + 104); - x2 ^= rk1A; - rk1B = sph_dec32le_aligned((const unsigned char *)msg + 108); - x3 ^= rk1B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk1C = sph_dec32le_aligned((const unsigned char *)msg + 112); - x0 ^= rk1C; - rk1D = sph_dec32le_aligned((const unsigned char *)msg + 116); - x1 ^= rk1D; - rk1E = sph_dec32le_aligned((const unsigned char *)msg + 120); - x2 ^= rk1E; - rk1F = sph_dec32le_aligned((const unsigned char *)msg + 124); - x3 ^= rk1F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p8 ^= x0; - p9 ^= x1; - pA ^= x2; - pB ^= x3; - - for (r = 0; r < 3; r ++) { - /* round 1, 5, 9 */ - KEY_EXPAND_ELT(rk00, rk01, rk02, rk03); - rk00 ^= rk1C; - rk01 ^= rk1D; - rk02 ^= rk1E; - rk03 ^= rk1F; - if (r == 0) { - rk00 ^= sc->count0; - rk01 ^= sc->count1; - rk02 ^= sc->count2; - rk03 ^= SPH_T32(~sc->count3); - } - x0 = p0 ^ rk00; - x1 = p1 ^ rk01; - x2 = p2 ^ rk02; - x3 = p3 ^ rk03; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk04, rk05, rk06, rk07); - rk04 ^= rk00; - rk05 ^= rk01; - rk06 ^= rk02; - rk07 ^= rk03; - if (r == 1) { - rk04 ^= sc->count3; - rk05 ^= sc->count2; - rk06 ^= sc->count1; - rk07 ^= SPH_T32(~sc->count0); - } - x0 ^= rk04; - x1 ^= rk05; - x2 ^= rk06; - x3 ^= rk07; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk08, rk09, rk0A, rk0B); - rk08 ^= rk04; - rk09 ^= rk05; - rk0A ^= rk06; - rk0B ^= rk07; - x0 ^= rk08; - x1 ^= rk09; - x2 ^= rk0A; - x3 ^= rk0B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk0C, rk0D, rk0E, rk0F); - rk0C ^= rk08; - rk0D ^= rk09; - rk0E ^= rk0A; - rk0F ^= rk0B; - x0 ^= rk0C; - x1 ^= rk0D; - x2 ^= rk0E; - x3 ^= rk0F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - pC ^= x0; - pD ^= x1; - pE ^= x2; - pF ^= x3; - KEY_EXPAND_ELT(rk10, rk11, rk12, rk13); - rk10 ^= rk0C; - rk11 ^= rk0D; - rk12 ^= rk0E; - rk13 ^= rk0F; - x0 = p8 ^ rk10; - x1 = p9 ^ rk11; - x2 = pA ^ rk12; - x3 = pB ^ rk13; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk14, rk15, rk16, rk17); - rk14 ^= rk10; - rk15 ^= rk11; - rk16 ^= rk12; - rk17 ^= rk13; - x0 ^= rk14; - x1 ^= rk15; - x2 ^= rk16; - x3 ^= rk17; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk18, rk19, rk1A, rk1B); - rk18 ^= rk14; - rk19 ^= rk15; - rk1A ^= rk16; - rk1B ^= rk17; - x0 ^= rk18; - x1 ^= rk19; - x2 ^= rk1A; - x3 ^= rk1B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk1C, rk1D, rk1E, rk1F); - rk1C ^= rk18; - rk1D ^= rk19; - rk1E ^= rk1A; - rk1F ^= rk1B; - if (r == 2) { - rk1C ^= sc->count2; - rk1D ^= sc->count3; - rk1E ^= sc->count0; - rk1F ^= SPH_T32(~sc->count1); - } - x0 ^= rk1C; - x1 ^= rk1D; - x2 ^= rk1E; - x3 ^= rk1F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - /* round 2, 6, 10 */ - rk00 ^= rk19; - x0 = pC ^ rk00; - rk01 ^= rk1A; - x1 = pD ^ rk01; - rk02 ^= rk1B; - x2 = pE ^ rk02; - rk03 ^= rk1C; - x3 = pF ^ rk03; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk04 ^= rk1D; - x0 ^= rk04; - rk05 ^= rk1E; - x1 ^= rk05; - rk06 ^= rk1F; - x2 ^= rk06; - rk07 ^= rk00; - x3 ^= rk07; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk08 ^= rk01; - x0 ^= rk08; - rk09 ^= rk02; - x1 ^= rk09; - rk0A ^= rk03; - x2 ^= rk0A; - rk0B ^= rk04; - x3 ^= rk0B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk0C ^= rk05; - x0 ^= rk0C; - rk0D ^= rk06; - x1 ^= rk0D; - rk0E ^= rk07; - x2 ^= rk0E; - rk0F ^= rk08; - x3 ^= rk0F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p8 ^= x0; - p9 ^= x1; - pA ^= x2; - pB ^= x3; - rk10 ^= rk09; - x0 = p4 ^ rk10; - rk11 ^= rk0A; - x1 = p5 ^ rk11; - rk12 ^= rk0B; - x2 = p6 ^ rk12; - rk13 ^= rk0C; - x3 = p7 ^ rk13; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk14 ^= rk0D; - x0 ^= rk14; - rk15 ^= rk0E; - x1 ^= rk15; - rk16 ^= rk0F; - x2 ^= rk16; - rk17 ^= rk10; - x3 ^= rk17; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk18 ^= rk11; - x0 ^= rk18; - rk19 ^= rk12; - x1 ^= rk19; - rk1A ^= rk13; - x2 ^= rk1A; - rk1B ^= rk14; - x3 ^= rk1B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk1C ^= rk15; - x0 ^= rk1C; - rk1D ^= rk16; - x1 ^= rk1D; - rk1E ^= rk17; - x2 ^= rk1E; - rk1F ^= rk18; - x3 ^= rk1F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - /* round 3, 7, 11 */ - KEY_EXPAND_ELT(rk00, rk01, rk02, rk03); - rk00 ^= rk1C; - rk01 ^= rk1D; - rk02 ^= rk1E; - rk03 ^= rk1F; - x0 = p8 ^ rk00; - x1 = p9 ^ rk01; - x2 = pA ^ rk02; - x3 = pB ^ rk03; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk04, rk05, rk06, rk07); - rk04 ^= rk00; - rk05 ^= rk01; - rk06 ^= rk02; - rk07 ^= rk03; - x0 ^= rk04; - x1 ^= rk05; - x2 ^= rk06; - x3 ^= rk07; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk08, rk09, rk0A, rk0B); - rk08 ^= rk04; - rk09 ^= rk05; - rk0A ^= rk06; - rk0B ^= rk07; - x0 ^= rk08; - x1 ^= rk09; - x2 ^= rk0A; - x3 ^= rk0B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk0C, rk0D, rk0E, rk0F); - rk0C ^= rk08; - rk0D ^= rk09; - rk0E ^= rk0A; - rk0F ^= rk0B; - x0 ^= rk0C; - x1 ^= rk0D; - x2 ^= rk0E; - x3 ^= rk0F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - KEY_EXPAND_ELT(rk10, rk11, rk12, rk13); - rk10 ^= rk0C; - rk11 ^= rk0D; - rk12 ^= rk0E; - rk13 ^= rk0F; - x0 = p0 ^ rk10; - x1 = p1 ^ rk11; - x2 = p2 ^ rk12; - x3 = p3 ^ rk13; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk14, rk15, rk16, rk17); - rk14 ^= rk10; - rk15 ^= rk11; - rk16 ^= rk12; - rk17 ^= rk13; - x0 ^= rk14; - x1 ^= rk15; - x2 ^= rk16; - x3 ^= rk17; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk18, rk19, rk1A, rk1B); - rk18 ^= rk14; - rk19 ^= rk15; - rk1A ^= rk16; - rk1B ^= rk17; - x0 ^= rk18; - x1 ^= rk19; - x2 ^= rk1A; - x3 ^= rk1B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk1C, rk1D, rk1E, rk1F); - rk1C ^= rk18; - rk1D ^= rk19; - rk1E ^= rk1A; - rk1F ^= rk1B; - x0 ^= rk1C; - x1 ^= rk1D; - x2 ^= rk1E; - x3 ^= rk1F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - pC ^= x0; - pD ^= x1; - pE ^= x2; - pF ^= x3; - /* round 4, 8, 12 */ - rk00 ^= rk19; - x0 = p4 ^ rk00; - rk01 ^= rk1A; - x1 = p5 ^ rk01; - rk02 ^= rk1B; - x2 = p6 ^ rk02; - rk03 ^= rk1C; - x3 = p7 ^ rk03; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk04 ^= rk1D; - x0 ^= rk04; - rk05 ^= rk1E; - x1 ^= rk05; - rk06 ^= rk1F; - x2 ^= rk06; - rk07 ^= rk00; - x3 ^= rk07; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk08 ^= rk01; - x0 ^= rk08; - rk09 ^= rk02; - x1 ^= rk09; - rk0A ^= rk03; - x2 ^= rk0A; - rk0B ^= rk04; - x3 ^= rk0B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk0C ^= rk05; - x0 ^= rk0C; - rk0D ^= rk06; - x1 ^= rk0D; - rk0E ^= rk07; - x2 ^= rk0E; - rk0F ^= rk08; - x3 ^= rk0F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - rk10 ^= rk09; - x0 = pC ^ rk10; - rk11 ^= rk0A; - x1 = pD ^ rk11; - rk12 ^= rk0B; - x2 = pE ^ rk12; - rk13 ^= rk0C; - x3 = pF ^ rk13; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk14 ^= rk0D; - x0 ^= rk14; - rk15 ^= rk0E; - x1 ^= rk15; - rk16 ^= rk0F; - x2 ^= rk16; - rk17 ^= rk10; - x3 ^= rk17; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk18 ^= rk11; - x0 ^= rk18; - rk19 ^= rk12; - x1 ^= rk19; - rk1A ^= rk13; - x2 ^= rk1A; - rk1B ^= rk14; - x3 ^= rk1B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk1C ^= rk15; - x0 ^= rk1C; - rk1D ^= rk16; - x1 ^= rk1D; - rk1E ^= rk17; - x2 ^= rk1E; - rk1F ^= rk18; - x3 ^= rk1F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p8 ^= x0; - p9 ^= x1; - pA ^= x2; - pB ^= x3; - } - /* round 13 */ - KEY_EXPAND_ELT(rk00, rk01, rk02, rk03); - rk00 ^= rk1C; - rk01 ^= rk1D; - rk02 ^= rk1E; - rk03 ^= rk1F; - x0 = p0 ^ rk00; - x1 = p1 ^ rk01; - x2 = p2 ^ rk02; - x3 = p3 ^ rk03; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk04, rk05, rk06, rk07); - rk04 ^= rk00; - rk05 ^= rk01; - rk06 ^= rk02; - rk07 ^= rk03; - x0 ^= rk04; - x1 ^= rk05; - x2 ^= rk06; - x3 ^= rk07; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk08, rk09, rk0A, rk0B); - rk08 ^= rk04; - rk09 ^= rk05; - rk0A ^= rk06; - rk0B ^= rk07; - x0 ^= rk08; - x1 ^= rk09; - x2 ^= rk0A; - x3 ^= rk0B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk0C, rk0D, rk0E, rk0F); - rk0C ^= rk08; - rk0D ^= rk09; - rk0E ^= rk0A; - rk0F ^= rk0B; - x0 ^= rk0C; - x1 ^= rk0D; - x2 ^= rk0E; - x3 ^= rk0F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - pC ^= x0; - pD ^= x1; - pE ^= x2; - pF ^= x3; - KEY_EXPAND_ELT(rk10, rk11, rk12, rk13); - rk10 ^= rk0C; - rk11 ^= rk0D; - rk12 ^= rk0E; - rk13 ^= rk0F; - x0 = p8 ^ rk10; - x1 = p9 ^ rk11; - x2 = pA ^ rk12; - x3 = pB ^ rk13; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk14, rk15, rk16, rk17); - rk14 ^= rk10; - rk15 ^= rk11; - rk16 ^= rk12; - rk17 ^= rk13; - x0 ^= rk14; - x1 ^= rk15; - x2 ^= rk16; - x3 ^= rk17; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk18, rk19, rk1A, rk1B); - rk18 ^= rk14 ^ sc->count1; - rk19 ^= rk15 ^ sc->count0; - rk1A ^= rk16 ^ sc->count3; - rk1B ^= rk17 ^ SPH_T32(~sc->count2); - x0 ^= rk18; - x1 ^= rk19; - x2 ^= rk1A; - x3 ^= rk1B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk1C, rk1D, rk1E, rk1F); - rk1C ^= rk18; - rk1D ^= rk19; - rk1E ^= rk1A; - rk1F ^= rk1B; - x0 ^= rk1C; - x1 ^= rk1D; - x2 ^= rk1E; - x3 ^= rk1F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - sc->h[0x0] ^= p8; - sc->h[0x1] ^= p9; - sc->h[0x2] ^= pA; - sc->h[0x3] ^= pB; - sc->h[0x4] ^= pC; - sc->h[0x5] ^= pD; - sc->h[0x6] ^= pE; - sc->h[0x7] ^= pF; - sc->h[0x8] ^= p0; - sc->h[0x9] ^= p1; - sc->h[0xA] ^= p2; - sc->h[0xB] ^= p3; - sc->h[0xC] ^= p4; - sc->h[0xD] ^= p5; - sc->h[0xE] ^= p6; - sc->h[0xF] ^= p7; -} - -#endif - -static void -shavite_small_init(sph_shavite_small_context *sc, const sph_u32 *iv) -{ - memcpy(sc->h, iv, sizeof sc->h); - sc->ptr = 0; - sc->count0 = 0; - sc->count1 = 0; -} - -static void -shavite_small_core(sph_shavite_small_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - - buf = sc->buf; - ptr = sc->ptr; - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - data = (const unsigned char *)data + clen; - ptr += clen; - len -= clen; - if (ptr == sizeof sc->buf) { - if ((sc->count0 = SPH_T32(sc->count0 + 512)) == 0) - sc->count1 = SPH_T32(sc->count1 + 1); - c256(sc, buf); - ptr = 0; - } - } - sc->ptr = ptr; -} - -static void -shavite_small_close(sph_shavite_small_context *sc, - unsigned ub, unsigned n, void *dst, size_t out_size_w32) -{ - unsigned char *buf; - size_t ptr, u; - unsigned z; - sph_u32 count0, count1; - - buf = sc->buf; - ptr = sc->ptr; - count0 = (sc->count0 += (ptr << 3) + n); - count1 = sc->count1; - z = 0x80 >> n; - z = ((ub & -z) | z) & 0xFF; - if (ptr == 0 && n == 0) { - buf[0] = 0x80; - memset(buf + 1, 0, 53); - sc->count0 = sc->count1 = 0; - } else if (ptr < 54) { - buf[ptr ++] = z; - memset(buf + ptr, 0, 54 - ptr); - } else { - buf[ptr ++] = z; - memset(buf + ptr, 0, 64 - ptr); - c256(sc, buf); - memset(buf, 0, 54); - sc->count0 = sc->count1 = 0; - } - sph_enc32le(buf + 54, count0); - sph_enc32le(buf + 58, count1); - buf[62] = out_size_w32 << 5; - buf[63] = out_size_w32 >> 3; - c256(sc, buf); - for (u = 0; u < out_size_w32; u ++) - sph_enc32le((unsigned char *)dst + (u << 2), sc->h[u]); -} - -static void -shavite_big_init(sph_shavite_big_context *sc, const sph_u32 *iv) -{ - memcpy(sc->h, iv, sizeof sc->h); - sc->ptr = 0; - sc->count0 = 0; - sc->count1 = 0; - sc->count2 = 0; - sc->count3 = 0; -} - -static void -shavite_big_core(sph_shavite_big_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - - buf = sc->buf; - ptr = sc->ptr; - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - data = (const unsigned char *)data + clen; - ptr += clen; - len -= clen; - if (ptr == sizeof sc->buf) { - if ((sc->count0 = SPH_T32(sc->count0 + 1024)) == 0) { - sc->count1 = SPH_T32(sc->count1 + 1); - if (sc->count1 == 0) { - sc->count2 = SPH_T32(sc->count2 + 1); - if (sc->count2 == 0) { - sc->count3 = SPH_T32( - sc->count3 + 1); - } - } - } - c512(sc, buf); - ptr = 0; - } - } - sc->ptr = ptr; -} - -static void -shavite_big_close(sph_shavite_big_context *sc, - unsigned ub, unsigned n, void *dst, size_t out_size_w32) -{ - unsigned char *buf; - size_t ptr, u; - unsigned z; - sph_u32 count0, count1, count2, count3; - - buf = sc->buf; - ptr = sc->ptr; - count0 = (sc->count0 += (ptr << 3) + n); - count1 = sc->count1; - count2 = sc->count2; - count3 = sc->count3; - z = 0x80 >> n; - z = ((ub & -z) | z) & 0xFF; - if (ptr == 0 && n == 0) { - buf[0] = 0x80; - memset(buf + 1, 0, 109); - sc->count0 = sc->count1 = sc->count2 = sc->count3 = 0; - } else if (ptr < 110) { - buf[ptr ++] = z; - memset(buf + ptr, 0, 110 - ptr); - } else { - buf[ptr ++] = z; - memset(buf + ptr, 0, 128 - ptr); - c512(sc, buf); - memset(buf, 0, 110); - sc->count0 = sc->count1 = sc->count2 = sc->count3 = 0; - } - sph_enc32le(buf + 110, count0); - sph_enc32le(buf + 114, count1); - sph_enc32le(buf + 118, count2); - sph_enc32le(buf + 122, count3); - buf[126] = out_size_w32 << 5; - buf[127] = out_size_w32 >> 3; - c512(sc, buf); - for (u = 0; u < out_size_w32; u ++) - sph_enc32le((unsigned char *)dst + (u << 2), sc->h[u]); -} - -/* see sph_shavite.h */ -void -sph_shavite224_init(void *cc) -{ - shavite_small_init(cc, IV224); -} - -/* see sph_shavite.h */ -void -sph_shavite224(void *cc, const void *data, size_t len) -{ - shavite_small_core(cc, data, len); -} - -/* see sph_shavite.h */ -void -sph_shavite224_close(void *cc, void *dst) -{ - shavite_small_close(cc, 0, 0, dst, 7); - shavite_small_init(cc, IV224); -} - -/* see sph_shavite.h */ -void -sph_shavite224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - shavite_small_close(cc, ub, n, dst, 7); - shavite_small_init(cc, IV224); -} - -/* see sph_shavite.h */ -void -sph_shavite256_init(void *cc) -{ - shavite_small_init(cc, IV256); -} - -/* see sph_shavite.h */ -void -sph_shavite256(void *cc, const void *data, size_t len) -{ - shavite_small_core(cc, data, len); -} - -/* see sph_shavite.h */ -void -sph_shavite256_close(void *cc, void *dst) -{ - shavite_small_close(cc, 0, 0, dst, 8); - shavite_small_init(cc, IV256); -} - -/* see sph_shavite.h */ -void -sph_shavite256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - shavite_small_close(cc, ub, n, dst, 8); - shavite_small_init(cc, IV256); -} - -/* see sph_shavite.h */ -void -sph_shavite384_init(void *cc) -{ - shavite_big_init(cc, IV384); -} - -/* see sph_shavite.h */ -void -sph_shavite384(void *cc, const void *data, size_t len) -{ - shavite_big_core(cc, data, len); -} - -/* see sph_shavite.h */ -void -sph_shavite384_close(void *cc, void *dst) -{ - shavite_big_close(cc, 0, 0, dst, 12); - shavite_big_init(cc, IV384); -} - -/* see sph_shavite.h */ -void -sph_shavite384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - shavite_big_close(cc, ub, n, dst, 12); - shavite_big_init(cc, IV384); -} - -/* see sph_shavite.h */ -void -sph_shavite512_init(void *cc) -{ - shavite_big_init(cc, IV512); -} - -/* see sph_shavite.h */ -void -sph_shavite512(void *cc, const void *data, size_t len) -{ - shavite_big_core(cc, data, len); -} - -/* see sph_shavite.h */ -void -sph_shavite512_close(void *cc, void *dst) -{ - shavite_big_close(cc, 0, 0, dst, 16); - shavite_big_init(cc, IV512); -} - -/* see sph_shavite.h */ -void -sph_shavite512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - shavite_big_close(cc, ub, n, dst, 16); - shavite_big_init(cc, IV512); -} - -#ifdef __cplusplus -} -#endif \ No newline at end of file diff --git a/sph/simd.c b/sph/simd.c deleted file mode 100644 index 2c806261..00000000 --- a/sph/simd.c +++ /dev/null @@ -1,1799 +0,0 @@ -/* $Id: simd.c 227 2010-06-16 17:28:38Z tp $ */ -/* - * SIMD implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include -#include - -#include "sph_simd.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -#if SPH_SMALL_FOOTPRINT && !defined SPH_SMALL_FOOTPRINT_SIMD -#define SPH_SMALL_FOOTPRINT_SIMD 1 -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -typedef sph_u32 u32; -typedef sph_s32 s32; -#define C32 SPH_C32 -#define T32 SPH_T32 -#define ROL32 SPH_ROTL32 - -#define XCAT(x, y) XCAT_(x, y) -#define XCAT_(x, y) x ## y - -/* - * The powers of 41 modulo 257. We use exponents from 0 to 255, inclusive. - */ -static const s32 alpha_tab[] = { - 1, 41, 139, 45, 46, 87, 226, 14, 60, 147, 116, 130, - 190, 80, 196, 69, 2, 82, 21, 90, 92, 174, 195, 28, - 120, 37, 232, 3, 123, 160, 135, 138, 4, 164, 42, 180, - 184, 91, 133, 56, 240, 74, 207, 6, 246, 63, 13, 19, - 8, 71, 84, 103, 111, 182, 9, 112, 223, 148, 157, 12, - 235, 126, 26, 38, 16, 142, 168, 206, 222, 107, 18, 224, - 189, 39, 57, 24, 213, 252, 52, 76, 32, 27, 79, 155, - 187, 214, 36, 191, 121, 78, 114, 48, 169, 247, 104, 152, - 64, 54, 158, 53, 117, 171, 72, 125, 242, 156, 228, 96, - 81, 237, 208, 47, 128, 108, 59, 106, 234, 85, 144, 250, - 227, 55, 199, 192, 162, 217, 159, 94, 256, 216, 118, 212, - 211, 170, 31, 243, 197, 110, 141, 127, 67, 177, 61, 188, - 255, 175, 236, 167, 165, 83, 62, 229, 137, 220, 25, 254, - 134, 97, 122, 119, 253, 93, 215, 77, 73, 166, 124, 201, - 17, 183, 50, 251, 11, 194, 244, 238, 249, 186, 173, 154, - 146, 75, 248, 145, 34, 109, 100, 245, 22, 131, 231, 219, - 241, 115, 89, 51, 35, 150, 239, 33, 68, 218, 200, 233, - 44, 5, 205, 181, 225, 230, 178, 102, 70, 43, 221, 66, - 136, 179, 143, 209, 88, 10, 153, 105, 193, 203, 99, 204, - 140, 86, 185, 132, 15, 101, 29, 161, 176, 20, 49, 210, - 129, 149, 198, 151, 23, 172, 113, 7, 30, 202, 58, 65, - 95, 40, 98, 163 -}; - -/* - * Ranges: - * REDS1: from -32768..98302 to -383..383 - * REDS2: from -2^31..2^31-1 to -32768..98302 - */ -#define REDS1(x) (((x) & 0xFF) - ((x) >> 8)) -#define REDS2(x) (((x) & 0xFFFF) + ((x) >> 16)) - -/* - * If, upon entry, the values of q[] are all in the -N..N range (where - * N >= 98302) then the new values of q[] are in the -2N..2N range. - * - * Since alpha_tab[v] <= 256, maximum allowed range is for N = 8388608. - */ -#define FFT_LOOP(rb, hk, as, id) do { \ - size_t u, v; \ - s32 m = q[(rb)]; \ - s32 n = q[(rb) + (hk)]; \ - q[(rb)] = m + n; \ - q[(rb) + (hk)] = m - n; \ - u = v = 0; \ - goto id; \ - for (; u < (hk); u += 4, v += 4 * (as)) { \ - s32 t; \ - m = q[(rb) + u + 0]; \ - n = q[(rb) + u + 0 + (hk)]; \ - t = REDS2(n * alpha_tab[v + 0 * (as)]); \ - q[(rb) + u + 0] = m + t; \ - q[(rb) + u + 0 + (hk)] = m - t; \ - id: \ - m = q[(rb) + u + 1]; \ - n = q[(rb) + u + 1 + (hk)]; \ - t = REDS2(n * alpha_tab[v + 1 * (as)]); \ - q[(rb) + u + 1] = m + t; \ - q[(rb) + u + 1 + (hk)] = m - t; \ - m = q[(rb) + u + 2]; \ - n = q[(rb) + u + 2 + (hk)]; \ - t = REDS2(n * alpha_tab[v + 2 * (as)]); \ - q[(rb) + u + 2] = m + t; \ - q[(rb) + u + 2 + (hk)] = m - t; \ - m = q[(rb) + u + 3]; \ - n = q[(rb) + u + 3 + (hk)]; \ - t = REDS2(n * alpha_tab[v + 3 * (as)]); \ - q[(rb) + u + 3] = m + t; \ - q[(rb) + u + 3 + (hk)] = m - t; \ - } \ - } while (0) - -/* - * Output ranges: - * d0: min= 0 max= 1020 - * d1: min= -67 max= 4587 - * d2: min=-4335 max= 4335 - * d3: min=-4147 max= 507 - * d4: min= -510 max= 510 - * d5: min= -252 max= 4402 - * d6: min=-4335 max= 4335 - * d7: min=-4332 max= 322 - */ -#define FFT8(xb, xs, d) do { \ - s32 x0 = x[(xb)]; \ - s32 x1 = x[(xb) + (xs)]; \ - s32 x2 = x[(xb) + 2 * (xs)]; \ - s32 x3 = x[(xb) + 3 * (xs)]; \ - s32 a0 = x0 + x2; \ - s32 a1 = x0 + (x2 << 4); \ - s32 a2 = x0 - x2; \ - s32 a3 = x0 - (x2 << 4); \ - s32 b0 = x1 + x3; \ - s32 b1 = REDS1((x1 << 2) + (x3 << 6)); \ - s32 b2 = (x1 << 4) - (x3 << 4); \ - s32 b3 = REDS1((x1 << 6) + (x3 << 2)); \ - d ## 0 = a0 + b0; \ - d ## 1 = a1 + b1; \ - d ## 2 = a2 + b2; \ - d ## 3 = a3 + b3; \ - d ## 4 = a0 - b0; \ - d ## 5 = a1 - b1; \ - d ## 6 = a2 - b2; \ - d ## 7 = a3 - b3; \ - } while (0) - -/* - * When k=16, we have alpha=2. Multiplication by alpha^i is then reduced - * to some shifting. - * - * Output: within -591471..591723 - */ -#define FFT16(xb, xs, rb) do { \ - s32 d1_0, d1_1, d1_2, d1_3, d1_4, d1_5, d1_6, d1_7; \ - s32 d2_0, d2_1, d2_2, d2_3, d2_4, d2_5, d2_6, d2_7; \ - FFT8(xb, (xs) << 1, d1_); \ - FFT8((xb) + (xs), (xs) << 1, d2_); \ - q[(rb) + 0] = d1_0 + d2_0; \ - q[(rb) + 1] = d1_1 + (d2_1 << 1); \ - q[(rb) + 2] = d1_2 + (d2_2 << 2); \ - q[(rb) + 3] = d1_3 + (d2_3 << 3); \ - q[(rb) + 4] = d1_4 + (d2_4 << 4); \ - q[(rb) + 5] = d1_5 + (d2_5 << 5); \ - q[(rb) + 6] = d1_6 + (d2_6 << 6); \ - q[(rb) + 7] = d1_7 + (d2_7 << 7); \ - q[(rb) + 8] = d1_0 - d2_0; \ - q[(rb) + 9] = d1_1 - (d2_1 << 1); \ - q[(rb) + 10] = d1_2 - (d2_2 << 2); \ - q[(rb) + 11] = d1_3 - (d2_3 << 3); \ - q[(rb) + 12] = d1_4 - (d2_4 << 4); \ - q[(rb) + 13] = d1_5 - (d2_5 << 5); \ - q[(rb) + 14] = d1_6 - (d2_6 << 6); \ - q[(rb) + 15] = d1_7 - (d2_7 << 7); \ - } while (0) - -/* - * Output range: |q| <= 1183446 - */ -#define FFT32(xb, xs, rb, id) do { \ - FFT16(xb, (xs) << 1, rb); \ - FFT16((xb) + (xs), (xs) << 1, (rb) + 16); \ - FFT_LOOP(rb, 16, 8, id); \ - } while (0) - -/* - * Output range: |q| <= 2366892 - */ -#define FFT64(xb, xs, rb, id) do { \ - FFT32(xb, (xs) << 1, rb, XCAT(id, a)); \ - FFT32((xb) + (xs), (xs) << 1, (rb) + 32, XCAT(id, b)); \ - FFT_LOOP(rb, 32, 4, id); \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_SIMD - -static void -fft32(unsigned char *x, size_t xs, s32 *q) -{ - size_t xd; - - xd = xs << 1; - FFT16(0, xd, 0); - FFT16(xs, xd, 16); - FFT_LOOP(0, 16, 8, label_); -} - -#define FFT128(xb, xs, rb, id) do { \ - fft32(x + (xb) + ((xs) * 0), (xs) << 2, &q[(rb) + 0]); \ - fft32(x + (xb) + ((xs) * 2), (xs) << 2, &q[(rb) + 32]); \ - FFT_LOOP(rb, 32, 4, XCAT(id, aa)); \ - fft32(x + (xb) + ((xs) * 1), (xs) << 2, &q[(rb) + 64]); \ - fft32(x + (xb) + ((xs) * 3), (xs) << 2, &q[(rb) + 96]); \ - FFT_LOOP((rb) + 64, 32, 4, XCAT(id, ab)); \ - FFT_LOOP(rb, 64, 2, XCAT(id, a)); \ - } while (0) - -#else - -/* - * Output range: |q| <= 4733784 - */ -#define FFT128(xb, xs, rb, id) do { \ - FFT64(xb, (xs) << 1, rb, XCAT(id, a)); \ - FFT64((xb) + (xs), (xs) << 1, (rb) + 64, XCAT(id, b)); \ - FFT_LOOP(rb, 64, 2, id); \ - } while (0) - -#endif - -/* - * For SIMD-384 / SIMD-512, the fully unrolled FFT yields a compression - * function which does not fit in the 32 kB L1 cache of a typical x86 - * Intel. We therefore add a function call layer at the FFT64 level. - */ - -static void -fft64(unsigned char *x, size_t xs, s32 *q) -{ - size_t xd; - - xd = xs << 1; - FFT32(0, xd, 0, label_a); - FFT32(xs, xd, 32, label_b); - FFT_LOOP(0, 32, 4, label_); -} - -/* - * Output range: |q| <= 9467568 - */ -#define FFT256(xb, xs, rb, id) do { \ - fft64(x + (xb) + ((xs) * 0), (xs) << 2, &q[(rb) + 0]); \ - fft64(x + (xb) + ((xs) * 2), (xs) << 2, &q[(rb) + 64]); \ - FFT_LOOP(rb, 64, 2, XCAT(id, aa)); \ - fft64(x + (xb) + ((xs) * 1), (xs) << 2, &q[(rb) + 128]); \ - fft64(x + (xb) + ((xs) * 3), (xs) << 2, &q[(rb) + 192]); \ - FFT_LOOP((rb) + 128, 64, 2, XCAT(id, ab)); \ - FFT_LOOP(rb, 128, 1, XCAT(id, a)); \ - } while (0) - -/* - * alpha^(127*i) mod 257 - */ -static const unsigned short yoff_s_n[] = { - 1, 98, 95, 58, 30, 113, 23, 198, 129, 49, 176, 29, - 15, 185, 140, 99, 193, 153, 88, 143, 136, 221, 70, 178, - 225, 205, 44, 200, 68, 239, 35, 89, 241, 231, 22, 100, - 34, 248, 146, 173, 249, 244, 11, 50, 17, 124, 73, 215, - 253, 122, 134, 25, 137, 62, 165, 236, 255, 61, 67, 141, - 197, 31, 211, 118, 256, 159, 162, 199, 227, 144, 234, 59, - 128, 208, 81, 228, 242, 72, 117, 158, 64, 104, 169, 114, - 121, 36, 187, 79, 32, 52, 213, 57, 189, 18, 222, 168, - 16, 26, 235, 157, 223, 9, 111, 84, 8, 13, 246, 207, - 240, 133, 184, 42, 4, 135, 123, 232, 120, 195, 92, 21, - 2, 196, 190, 116, 60, 226, 46, 139 -}; - -/* - * alpha^(127*i) + alpha^(125*i) mod 257 - */ -static const unsigned short yoff_s_f[] = { - 2, 156, 118, 107, 45, 212, 111, 162, 97, 249, 211, 3, - 49, 101, 151, 223, 189, 178, 253, 204, 76, 82, 232, 65, - 96, 176, 161, 47, 189, 61, 248, 107, 0, 131, 133, 113, - 17, 33, 12, 111, 251, 103, 57, 148, 47, 65, 249, 143, - 189, 8, 204, 230, 205, 151, 187, 227, 247, 111, 140, 6, - 77, 10, 21, 149, 255, 101, 139, 150, 212, 45, 146, 95, - 160, 8, 46, 254, 208, 156, 106, 34, 68, 79, 4, 53, - 181, 175, 25, 192, 161, 81, 96, 210, 68, 196, 9, 150, - 0, 126, 124, 144, 240, 224, 245, 146, 6, 154, 200, 109, - 210, 192, 8, 114, 68, 249, 53, 27, 52, 106, 70, 30, - 10, 146, 117, 251, 180, 247, 236, 108 -}; - -/* - * beta^(255*i) mod 257 - */ -static const unsigned short yoff_b_n[] = { - 1, 163, 98, 40, 95, 65, 58, 202, 30, 7, 113, 172, - 23, 151, 198, 149, 129, 210, 49, 20, 176, 161, 29, 101, - 15, 132, 185, 86, 140, 204, 99, 203, 193, 105, 153, 10, - 88, 209, 143, 179, 136, 66, 221, 43, 70, 102, 178, 230, - 225, 181, 205, 5, 44, 233, 200, 218, 68, 33, 239, 150, - 35, 51, 89, 115, 241, 219, 231, 131, 22, 245, 100, 109, - 34, 145, 248, 75, 146, 154, 173, 186, 249, 238, 244, 194, - 11, 251, 50, 183, 17, 201, 124, 166, 73, 77, 215, 93, - 253, 119, 122, 97, 134, 254, 25, 220, 137, 229, 62, 83, - 165, 167, 236, 175, 255, 188, 61, 177, 67, 127, 141, 110, - 197, 243, 31, 170, 211, 212, 118, 216, 256, 94, 159, 217, - 162, 192, 199, 55, 227, 250, 144, 85, 234, 106, 59, 108, - 128, 47, 208, 237, 81, 96, 228, 156, 242, 125, 72, 171, - 117, 53, 158, 54, 64, 152, 104, 247, 169, 48, 114, 78, - 121, 191, 36, 214, 187, 155, 79, 27, 32, 76, 52, 252, - 213, 24, 57, 39, 189, 224, 18, 107, 222, 206, 168, 142, - 16, 38, 26, 126, 235, 12, 157, 148, 223, 112, 9, 182, - 111, 103, 84, 71, 8, 19, 13, 63, 246, 6, 207, 74, - 240, 56, 133, 91, 184, 180, 42, 164, 4, 138, 135, 160, - 123, 3, 232, 37, 120, 28, 195, 174, 92, 90, 21, 82, - 2, 69, 196, 80, 190, 130, 116, 147, 60, 14, 226, 87, - 46, 45, 139, 41 -}; - -/* - * beta^(255*i) + beta^(253*i) mod 257 - */ -static const unsigned short yoff_b_f[] = { - 2, 203, 156, 47, 118, 214, 107, 106, 45, 93, 212, 20, - 111, 73, 162, 251, 97, 215, 249, 53, 211, 19, 3, 89, - 49, 207, 101, 67, 151, 130, 223, 23, 189, 202, 178, 239, - 253, 127, 204, 49, 76, 236, 82, 137, 232, 157, 65, 79, - 96, 161, 176, 130, 161, 30, 47, 9, 189, 247, 61, 226, - 248, 90, 107, 64, 0, 88, 131, 243, 133, 59, 113, 115, - 17, 236, 33, 213, 12, 191, 111, 19, 251, 61, 103, 208, - 57, 35, 148, 248, 47, 116, 65, 119, 249, 178, 143, 40, - 189, 129, 8, 163, 204, 227, 230, 196, 205, 122, 151, 45, - 187, 19, 227, 72, 247, 125, 111, 121, 140, 220, 6, 107, - 77, 69, 10, 101, 21, 65, 149, 171, 255, 54, 101, 210, - 139, 43, 150, 151, 212, 164, 45, 237, 146, 184, 95, 6, - 160, 42, 8, 204, 46, 238, 254, 168, 208, 50, 156, 190, - 106, 127, 34, 234, 68, 55, 79, 18, 4, 130, 53, 208, - 181, 21, 175, 120, 25, 100, 192, 178, 161, 96, 81, 127, - 96, 227, 210, 248, 68, 10, 196, 31, 9, 167, 150, 193, - 0, 169, 126, 14, 124, 198, 144, 142, 240, 21, 224, 44, - 245, 66, 146, 238, 6, 196, 154, 49, 200, 222, 109, 9, - 210, 141, 192, 138, 8, 79, 114, 217, 68, 128, 249, 94, - 53, 30, 27, 61, 52, 135, 106, 212, 70, 238, 30, 185, - 10, 132, 146, 136, 117, 37, 251, 150, 180, 188, 247, 156, - 236, 192, 108, 86 -}; - -#define INNER(l, h, mm) (((u32)((l) * (mm)) & 0xFFFFU) \ - + ((u32)((h) * (mm)) << 16)) - -#define W_SMALL(sb, o1, o2, mm) \ - (INNER(q[8 * (sb) + 2 * 0 + o1], q[8 * (sb) + 2 * 0 + o2], mm), \ - INNER(q[8 * (sb) + 2 * 1 + o1], q[8 * (sb) + 2 * 1 + o2], mm), \ - INNER(q[8 * (sb) + 2 * 2 + o1], q[8 * (sb) + 2 * 2 + o2], mm), \ - INNER(q[8 * (sb) + 2 * 3 + o1], q[8 * (sb) + 2 * 3 + o2], mm) - -#define WS_0_0 W_SMALL( 4, 0, 1, 185) -#define WS_0_1 W_SMALL( 6, 0, 1, 185) -#define WS_0_2 W_SMALL( 0, 0, 1, 185) -#define WS_0_3 W_SMALL( 2, 0, 1, 185) -#define WS_0_4 W_SMALL( 7, 0, 1, 185) -#define WS_0_5 W_SMALL( 5, 0, 1, 185) -#define WS_0_6 W_SMALL( 3, 0, 1, 185) -#define WS_0_7 W_SMALL( 1, 0, 1, 185) -#define WS_1_0 W_SMALL(15, 0, 1, 185) -#define WS_1_1 W_SMALL(11, 0, 1, 185) -#define WS_1_2 W_SMALL(12, 0, 1, 185) -#define WS_1_3 W_SMALL( 8, 0, 1, 185) -#define WS_1_4 W_SMALL( 9, 0, 1, 185) -#define WS_1_5 W_SMALL(13, 0, 1, 185) -#define WS_1_6 W_SMALL(10, 0, 1, 185) -#define WS_1_7 W_SMALL(14, 0, 1, 185) -#define WS_2_0 W_SMALL(17, -128, -64, 233) -#define WS_2_1 W_SMALL(18, -128, -64, 233) -#define WS_2_2 W_SMALL(23, -128, -64, 233) -#define WS_2_3 W_SMALL(20, -128, -64, 233) -#define WS_2_4 W_SMALL(22, -128, -64, 233) -#define WS_2_5 W_SMALL(21, -128, -64, 233) -#define WS_2_6 W_SMALL(16, -128, -64, 233) -#define WS_2_7 W_SMALL(19, -128, -64, 233) -#define WS_3_0 W_SMALL(30, -191, -127, 233) -#define WS_3_1 W_SMALL(24, -191, -127, 233) -#define WS_3_2 W_SMALL(25, -191, -127, 233) -#define WS_3_3 W_SMALL(31, -191, -127, 233) -#define WS_3_4 W_SMALL(27, -191, -127, 233) -#define WS_3_5 W_SMALL(29, -191, -127, 233) -#define WS_3_6 W_SMALL(28, -191, -127, 233) -#define WS_3_7 W_SMALL(26, -191, -127, 233) - -#define W_BIG(sb, o1, o2, mm) \ - (INNER(q[16 * (sb) + 2 * 0 + o1], q[16 * (sb) + 2 * 0 + o2], mm), \ - INNER(q[16 * (sb) + 2 * 1 + o1], q[16 * (sb) + 2 * 1 + o2], mm), \ - INNER(q[16 * (sb) + 2 * 2 + o1], q[16 * (sb) + 2 * 2 + o2], mm), \ - INNER(q[16 * (sb) + 2 * 3 + o1], q[16 * (sb) + 2 * 3 + o2], mm), \ - INNER(q[16 * (sb) + 2 * 4 + o1], q[16 * (sb) + 2 * 4 + o2], mm), \ - INNER(q[16 * (sb) + 2 * 5 + o1], q[16 * (sb) + 2 * 5 + o2], mm), \ - INNER(q[16 * (sb) + 2 * 6 + o1], q[16 * (sb) + 2 * 6 + o2], mm), \ - INNER(q[16 * (sb) + 2 * 7 + o1], q[16 * (sb) + 2 * 7 + o2], mm) - -#define WB_0_0 W_BIG( 4, 0, 1, 185) -#define WB_0_1 W_BIG( 6, 0, 1, 185) -#define WB_0_2 W_BIG( 0, 0, 1, 185) -#define WB_0_3 W_BIG( 2, 0, 1, 185) -#define WB_0_4 W_BIG( 7, 0, 1, 185) -#define WB_0_5 W_BIG( 5, 0, 1, 185) -#define WB_0_6 W_BIG( 3, 0, 1, 185) -#define WB_0_7 W_BIG( 1, 0, 1, 185) -#define WB_1_0 W_BIG(15, 0, 1, 185) -#define WB_1_1 W_BIG(11, 0, 1, 185) -#define WB_1_2 W_BIG(12, 0, 1, 185) -#define WB_1_3 W_BIG( 8, 0, 1, 185) -#define WB_1_4 W_BIG( 9, 0, 1, 185) -#define WB_1_5 W_BIG(13, 0, 1, 185) -#define WB_1_6 W_BIG(10, 0, 1, 185) -#define WB_1_7 W_BIG(14, 0, 1, 185) -#define WB_2_0 W_BIG(17, -256, -128, 233) -#define WB_2_1 W_BIG(18, -256, -128, 233) -#define WB_2_2 W_BIG(23, -256, -128, 233) -#define WB_2_3 W_BIG(20, -256, -128, 233) -#define WB_2_4 W_BIG(22, -256, -128, 233) -#define WB_2_5 W_BIG(21, -256, -128, 233) -#define WB_2_6 W_BIG(16, -256, -128, 233) -#define WB_2_7 W_BIG(19, -256, -128, 233) -#define WB_3_0 W_BIG(30, -383, -255, 233) -#define WB_3_1 W_BIG(24, -383, -255, 233) -#define WB_3_2 W_BIG(25, -383, -255, 233) -#define WB_3_3 W_BIG(31, -383, -255, 233) -#define WB_3_4 W_BIG(27, -383, -255, 233) -#define WB_3_5 W_BIG(29, -383, -255, 233) -#define WB_3_6 W_BIG(28, -383, -255, 233) -#define WB_3_7 W_BIG(26, -383, -255, 233) - -#define IF(x, y, z) ((((y) ^ (z)) & (x)) ^ (z)) -#define MAJ(x, y, z) (((x) & (y)) | (((x) | (y)) & (z))) - -#define PP4_0_0 1 -#define PP4_0_1 0 -#define PP4_0_2 3 -#define PP4_0_3 2 -#define PP4_1_0 2 -#define PP4_1_1 3 -#define PP4_1_2 0 -#define PP4_1_3 1 -#define PP4_2_0 3 -#define PP4_2_1 2 -#define PP4_2_2 1 -#define PP4_2_3 0 - -#define PP8_0_0 1 -#define PP8_0_1 0 -#define PP8_0_2 3 -#define PP8_0_3 2 -#define PP8_0_4 5 -#define PP8_0_5 4 -#define PP8_0_6 7 -#define PP8_0_7 6 - -#define PP8_1_0 6 -#define PP8_1_1 7 -#define PP8_1_2 4 -#define PP8_1_3 5 -#define PP8_1_4 2 -#define PP8_1_5 3 -#define PP8_1_6 0 -#define PP8_1_7 1 - -#define PP8_2_0 2 -#define PP8_2_1 3 -#define PP8_2_2 0 -#define PP8_2_3 1 -#define PP8_2_4 6 -#define PP8_2_5 7 -#define PP8_2_6 4 -#define PP8_2_7 5 - -#define PP8_3_0 3 -#define PP8_3_1 2 -#define PP8_3_2 1 -#define PP8_3_3 0 -#define PP8_3_4 7 -#define PP8_3_5 6 -#define PP8_3_6 5 -#define PP8_3_7 4 - -#define PP8_4_0 5 -#define PP8_4_1 4 -#define PP8_4_2 7 -#define PP8_4_3 6 -#define PP8_4_4 1 -#define PP8_4_5 0 -#define PP8_4_6 3 -#define PP8_4_7 2 - -#define PP8_5_0 7 -#define PP8_5_1 6 -#define PP8_5_2 5 -#define PP8_5_3 4 -#define PP8_5_4 3 -#define PP8_5_5 2 -#define PP8_5_6 1 -#define PP8_5_7 0 - -#define PP8_6_0 4 -#define PP8_6_1 5 -#define PP8_6_2 6 -#define PP8_6_3 7 -#define PP8_6_4 0 -#define PP8_6_5 1 -#define PP8_6_6 2 -#define PP8_6_7 3 - -#if SPH_SIMD_NOCOPY - -#define DECL_STATE_SMALL -#define READ_STATE_SMALL(sc) -#define WRITE_STATE_SMALL(sc) -#define DECL_STATE_BIG -#define READ_STATE_BIG(sc) -#define WRITE_STATE_BIG(sc) - -#else - -#define DECL_STATE_SMALL \ - u32 A0, A1, A2, A3, B0, B1, B2, B3, C0, C1, C2, C3, D0, D1, D2, D3; - -#define READ_STATE_SMALL(sc) do { \ - A0 = (sc)->state[ 0]; \ - A1 = (sc)->state[ 1]; \ - A2 = (sc)->state[ 2]; \ - A3 = (sc)->state[ 3]; \ - B0 = (sc)->state[ 4]; \ - B1 = (sc)->state[ 5]; \ - B2 = (sc)->state[ 6]; \ - B3 = (sc)->state[ 7]; \ - C0 = (sc)->state[ 8]; \ - C1 = (sc)->state[ 9]; \ - C2 = (sc)->state[10]; \ - C3 = (sc)->state[11]; \ - D0 = (sc)->state[12]; \ - D1 = (sc)->state[13]; \ - D2 = (sc)->state[14]; \ - D3 = (sc)->state[15]; \ - } while (0) - -#define WRITE_STATE_SMALL(sc) do { \ - (sc)->state[ 0] = A0; \ - (sc)->state[ 1] = A1; \ - (sc)->state[ 2] = A2; \ - (sc)->state[ 3] = A3; \ - (sc)->state[ 4] = B0; \ - (sc)->state[ 5] = B1; \ - (sc)->state[ 6] = B2; \ - (sc)->state[ 7] = B3; \ - (sc)->state[ 8] = C0; \ - (sc)->state[ 9] = C1; \ - (sc)->state[10] = C2; \ - (sc)->state[11] = C3; \ - (sc)->state[12] = D0; \ - (sc)->state[13] = D1; \ - (sc)->state[14] = D2; \ - (sc)->state[15] = D3; \ - } while (0) - -#define DECL_STATE_BIG \ - u32 A0, A1, A2, A3, A4, A5, A6, A7; \ - u32 B0, B1, B2, B3, B4, B5, B6, B7; \ - u32 C0, C1, C2, C3, C4, C5, C6, C7; \ - u32 D0, D1, D2, D3, D4, D5, D6, D7; - -#define READ_STATE_BIG(sc) do { \ - A0 = (sc)->state[ 0]; \ - A1 = (sc)->state[ 1]; \ - A2 = (sc)->state[ 2]; \ - A3 = (sc)->state[ 3]; \ - A4 = (sc)->state[ 4]; \ - A5 = (sc)->state[ 5]; \ - A6 = (sc)->state[ 6]; \ - A7 = (sc)->state[ 7]; \ - B0 = (sc)->state[ 8]; \ - B1 = (sc)->state[ 9]; \ - B2 = (sc)->state[10]; \ - B3 = (sc)->state[11]; \ - B4 = (sc)->state[12]; \ - B5 = (sc)->state[13]; \ - B6 = (sc)->state[14]; \ - B7 = (sc)->state[15]; \ - C0 = (sc)->state[16]; \ - C1 = (sc)->state[17]; \ - C2 = (sc)->state[18]; \ - C3 = (sc)->state[19]; \ - C4 = (sc)->state[20]; \ - C5 = (sc)->state[21]; \ - C6 = (sc)->state[22]; \ - C7 = (sc)->state[23]; \ - D0 = (sc)->state[24]; \ - D1 = (sc)->state[25]; \ - D2 = (sc)->state[26]; \ - D3 = (sc)->state[27]; \ - D4 = (sc)->state[28]; \ - D5 = (sc)->state[29]; \ - D6 = (sc)->state[30]; \ - D7 = (sc)->state[31]; \ - } while (0) - -#define WRITE_STATE_BIG(sc) do { \ - (sc)->state[ 0] = A0; \ - (sc)->state[ 1] = A1; \ - (sc)->state[ 2] = A2; \ - (sc)->state[ 3] = A3; \ - (sc)->state[ 4] = A4; \ - (sc)->state[ 5] = A5; \ - (sc)->state[ 6] = A6; \ - (sc)->state[ 7] = A7; \ - (sc)->state[ 8] = B0; \ - (sc)->state[ 9] = B1; \ - (sc)->state[10] = B2; \ - (sc)->state[11] = B3; \ - (sc)->state[12] = B4; \ - (sc)->state[13] = B5; \ - (sc)->state[14] = B6; \ - (sc)->state[15] = B7; \ - (sc)->state[16] = C0; \ - (sc)->state[17] = C1; \ - (sc)->state[18] = C2; \ - (sc)->state[19] = C3; \ - (sc)->state[20] = C4; \ - (sc)->state[21] = C5; \ - (sc)->state[22] = C6; \ - (sc)->state[23] = C7; \ - (sc)->state[24] = D0; \ - (sc)->state[25] = D1; \ - (sc)->state[26] = D2; \ - (sc)->state[27] = D3; \ - (sc)->state[28] = D4; \ - (sc)->state[29] = D5; \ - (sc)->state[30] = D6; \ - (sc)->state[31] = D7; \ - } while (0) - -#endif - -#define STEP_ELT(n, w, fun, s, ppb) do { \ - u32 tt = T32(D ## n + (w) + fun(A ## n, B ## n, C ## n)); \ - A ## n = T32(ROL32(tt, s) + XCAT(tA, XCAT(ppb, n))); \ - D ## n = C ## n; \ - C ## n = B ## n; \ - B ## n = tA ## n; \ - } while (0) - -#define STEP_SMALL(w0, w1, w2, w3, fun, r, s, pp4b) do { \ - u32 tA0 = ROL32(A0, r); \ - u32 tA1 = ROL32(A1, r); \ - u32 tA2 = ROL32(A2, r); \ - u32 tA3 = ROL32(A3, r); \ - STEP_ELT(0, w0, fun, s, pp4b); \ - STEP_ELT(1, w1, fun, s, pp4b); \ - STEP_ELT(2, w2, fun, s, pp4b); \ - STEP_ELT(3, w3, fun, s, pp4b); \ - } while (0) - -#define STEP_BIG(w0, w1, w2, w3, w4, w5, w6, w7, fun, r, s, pp8b) do { \ - u32 tA0 = ROL32(A0, r); \ - u32 tA1 = ROL32(A1, r); \ - u32 tA2 = ROL32(A2, r); \ - u32 tA3 = ROL32(A3, r); \ - u32 tA4 = ROL32(A4, r); \ - u32 tA5 = ROL32(A5, r); \ - u32 tA6 = ROL32(A6, r); \ - u32 tA7 = ROL32(A7, r); \ - STEP_ELT(0, w0, fun, s, pp8b); \ - STEP_ELT(1, w1, fun, s, pp8b); \ - STEP_ELT(2, w2, fun, s, pp8b); \ - STEP_ELT(3, w3, fun, s, pp8b); \ - STEP_ELT(4, w4, fun, s, pp8b); \ - STEP_ELT(5, w5, fun, s, pp8b); \ - STEP_ELT(6, w6, fun, s, pp8b); \ - STEP_ELT(7, w7, fun, s, pp8b); \ - } while (0) - -#define M3_0_0 0_ -#define M3_1_0 1_ -#define M3_2_0 2_ -#define M3_3_0 0_ -#define M3_4_0 1_ -#define M3_5_0 2_ -#define M3_6_0 0_ -#define M3_7_0 1_ - -#define M3_0_1 1_ -#define M3_1_1 2_ -#define M3_2_1 0_ -#define M3_3_1 1_ -#define M3_4_1 2_ -#define M3_5_1 0_ -#define M3_6_1 1_ -#define M3_7_1 2_ - -#define M3_0_2 2_ -#define M3_1_2 0_ -#define M3_2_2 1_ -#define M3_3_2 2_ -#define M3_4_2 0_ -#define M3_5_2 1_ -#define M3_6_2 2_ -#define M3_7_2 0_ - -#define STEP_SMALL_(w, fun, r, s, pp4b) STEP_SMALL w, fun, r, s, pp4b) - -#define ONE_ROUND_SMALL(ri, isp, p0, p1, p2, p3) do { \ - STEP_SMALL_(WS_ ## ri ## 0, \ - IF, p0, p1, XCAT(PP4_, M3_0_ ## isp)); \ - STEP_SMALL_(WS_ ## ri ## 1, \ - IF, p1, p2, XCAT(PP4_, M3_1_ ## isp)); \ - STEP_SMALL_(WS_ ## ri ## 2, \ - IF, p2, p3, XCAT(PP4_, M3_2_ ## isp)); \ - STEP_SMALL_(WS_ ## ri ## 3, \ - IF, p3, p0, XCAT(PP4_, M3_3_ ## isp)); \ - STEP_SMALL_(WS_ ## ri ## 4, \ - MAJ, p0, p1, XCAT(PP4_, M3_4_ ## isp)); \ - STEP_SMALL_(WS_ ## ri ## 5, \ - MAJ, p1, p2, XCAT(PP4_, M3_5_ ## isp)); \ - STEP_SMALL_(WS_ ## ri ## 6, \ - MAJ, p2, p3, XCAT(PP4_, M3_6_ ## isp)); \ - STEP_SMALL_(WS_ ## ri ## 7, \ - MAJ, p3, p0, XCAT(PP4_, M3_7_ ## isp)); \ - } while (0) - -#define M7_0_0 0_ -#define M7_1_0 1_ -#define M7_2_0 2_ -#define M7_3_0 3_ -#define M7_4_0 4_ -#define M7_5_0 5_ -#define M7_6_0 6_ -#define M7_7_0 0_ - -#define M7_0_1 1_ -#define M7_1_1 2_ -#define M7_2_1 3_ -#define M7_3_1 4_ -#define M7_4_1 5_ -#define M7_5_1 6_ -#define M7_6_1 0_ -#define M7_7_1 1_ - -#define M7_0_2 2_ -#define M7_1_2 3_ -#define M7_2_2 4_ -#define M7_3_2 5_ -#define M7_4_2 6_ -#define M7_5_2 0_ -#define M7_6_2 1_ -#define M7_7_2 2_ - -#define M7_0_3 3_ -#define M7_1_3 4_ -#define M7_2_3 5_ -#define M7_3_3 6_ -#define M7_4_3 0_ -#define M7_5_3 1_ -#define M7_6_3 2_ -#define M7_7_3 3_ - -#define STEP_BIG_(w, fun, r, s, pp8b) STEP_BIG w, fun, r, s, pp8b) - -#define ONE_ROUND_BIG(ri, isp, p0, p1, p2, p3) do { \ - STEP_BIG_(WB_ ## ri ## 0, \ - IF, p0, p1, XCAT(PP8_, M7_0_ ## isp)); \ - STEP_BIG_(WB_ ## ri ## 1, \ - IF, p1, p2, XCAT(PP8_, M7_1_ ## isp)); \ - STEP_BIG_(WB_ ## ri ## 2, \ - IF, p2, p3, XCAT(PP8_, M7_2_ ## isp)); \ - STEP_BIG_(WB_ ## ri ## 3, \ - IF, p3, p0, XCAT(PP8_, M7_3_ ## isp)); \ - STEP_BIG_(WB_ ## ri ## 4, \ - MAJ, p0, p1, XCAT(PP8_, M7_4_ ## isp)); \ - STEP_BIG_(WB_ ## ri ## 5, \ - MAJ, p1, p2, XCAT(PP8_, M7_5_ ## isp)); \ - STEP_BIG_(WB_ ## ri ## 6, \ - MAJ, p2, p3, XCAT(PP8_, M7_6_ ## isp)); \ - STEP_BIG_(WB_ ## ri ## 7, \ - MAJ, p3, p0, XCAT(PP8_, M7_7_ ## isp)); \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_SIMD - -#define A0 state[ 0] -#define A1 state[ 1] -#define A2 state[ 2] -#define A3 state[ 3] -#define B0 state[ 4] -#define B1 state[ 5] -#define B2 state[ 6] -#define B3 state[ 7] -#define C0 state[ 8] -#define C1 state[ 9] -#define C2 state[10] -#define C3 state[11] -#define D0 state[12] -#define D1 state[13] -#define D2 state[14] -#define D3 state[15] - -#define STEP2_ELT(n, w, fun, s, ppb) do { \ - u32 tt = T32(D ## n + (w) + fun(A ## n, B ## n, C ## n)); \ - A ## n = T32(ROL32(tt, s) + tA[(ppb) ^ n]); \ - D ## n = C ## n; \ - C ## n = B ## n; \ - B ## n = tA[n]; \ - } while (0) - -#define STEP2_SMALL(w0, w1, w2, w3, fun, r, s, pp4b) do { \ - u32 tA[4]; \ - tA[0] = ROL32(A0, r); \ - tA[1] = ROL32(A1, r); \ - tA[2] = ROL32(A2, r); \ - tA[3] = ROL32(A3, r); \ - STEP2_ELT(0, w0, fun, s, pp4b); \ - STEP2_ELT(1, w1, fun, s, pp4b); \ - STEP2_ELT(2, w2, fun, s, pp4b); \ - STEP2_ELT(3, w3, fun, s, pp4b); \ - } while (0) - -static void -one_round_small(u32 *state, u32 *w, int isp, int p0, int p1, int p2, int p3) -{ - static const int pp4k[] = { 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2 }; - - STEP2_SMALL(w[ 0], w[ 1], w[ 2], w[ 3], IF, p0, p1, pp4k[isp + 0]); - STEP2_SMALL(w[ 4], w[ 5], w[ 6], w[ 7], IF, p1, p2, pp4k[isp + 1]); - STEP2_SMALL(w[ 8], w[ 9], w[10], w[11], IF, p2, p3, pp4k[isp + 2]); - STEP2_SMALL(w[12], w[13], w[14], w[15], IF, p3, p0, pp4k[isp + 3]); - STEP2_SMALL(w[16], w[17], w[18], w[19], MAJ, p0, p1, pp4k[isp + 4]); - STEP2_SMALL(w[20], w[21], w[22], w[23], MAJ, p1, p2, pp4k[isp + 5]); - STEP2_SMALL(w[24], w[25], w[26], w[27], MAJ, p2, p3, pp4k[isp + 6]); - STEP2_SMALL(w[28], w[29], w[30], w[31], MAJ, p3, p0, pp4k[isp + 7]); -} - -static void -compress_small(sph_simd_small_context *sc, int last) -{ - unsigned char *x; - s32 q[128]; - int i; - u32 w[32]; - u32 state[16]; - size_t u; - - static const size_t wsp[32] = { - 4 << 3, 6 << 3, 0 << 3, 2 << 3, - 7 << 3, 5 << 3, 3 << 3, 1 << 3, - 15 << 3, 11 << 3, 12 << 3, 8 << 3, - 9 << 3, 13 << 3, 10 << 3, 14 << 3, - 17 << 3, 18 << 3, 23 << 3, 20 << 3, - 22 << 3, 21 << 3, 16 << 3, 19 << 3, - 30 << 3, 24 << 3, 25 << 3, 31 << 3, - 27 << 3, 29 << 3, 28 << 3, 26 << 3 - }; - - x = sc->buf; - FFT128(0, 1, 0, ll); - if (last) { - for (i = 0; i < 128; i ++) { - s32 tq; - - tq = q[i] + yoff_s_f[i]; - tq = REDS2(tq); - tq = REDS1(tq); - tq = REDS1(tq); - q[i] = (tq <= 128 ? tq : tq - 257); - } - } else { - for (i = 0; i < 128; i ++) { - s32 tq; - - tq = q[i] + yoff_s_n[i]; - tq = REDS2(tq); - tq = REDS1(tq); - tq = REDS1(tq); - q[i] = (tq <= 128 ? tq : tq - 257); - } - } - - for (i = 0; i < 16; i += 4) { - state[i + 0] = sc->state[i + 0] - ^ sph_dec32le_aligned(x + 4 * (i + 0)); - state[i + 1] = sc->state[i + 1] - ^ sph_dec32le_aligned(x + 4 * (i + 1)); - state[i + 2] = sc->state[i + 2] - ^ sph_dec32le_aligned(x + 4 * (i + 2)); - state[i + 3] = sc->state[i + 3] - ^ sph_dec32le_aligned(x + 4 * (i + 3)); - } - -#define WSREAD(sb, o1, o2, mm) do { \ - for (u = 0; u < 32; u += 4) { \ - size_t v = wsp[(u >> 2) + (sb)]; \ - w[u + 0] = INNER(q[v + 2 * 0 + (o1)], \ - q[v + 2 * 0 + (o2)], mm); \ - w[u + 1] = INNER(q[v + 2 * 1 + (o1)], \ - q[v + 2 * 1 + (o2)], mm); \ - w[u + 2] = INNER(q[v + 2 * 2 + (o1)], \ - q[v + 2 * 2 + (o2)], mm); \ - w[u + 3] = INNER(q[v + 2 * 3 + (o1)], \ - q[v + 2 * 3 + (o2)], mm); \ - } \ - } while (0) - - WSREAD( 0, 0, 1, 185); - one_round_small(state, w, 0, 3, 23, 17, 27); - WSREAD( 8, 0, 1, 185); - one_round_small(state, w, 2, 28, 19, 22, 7); - WSREAD(16, -128, -64, 233); - one_round_small(state, w, 1, 29, 9, 15, 5); - WSREAD(24, -191, -127, 233); - one_round_small(state, w, 0, 4, 13, 10, 25); - -#undef WSREAD - - STEP_SMALL(sc->state[ 0], sc->state[ 1], sc->state[ 2], sc->state[ 3], - IF, 4, 13, PP4_2_); - STEP_SMALL(sc->state[ 4], sc->state[ 5], sc->state[ 6], sc->state[ 7], - IF, 13, 10, PP4_0_); - STEP_SMALL(sc->state[ 8], sc->state[ 9], sc->state[10], sc->state[11], - IF, 10, 25, PP4_1_); - STEP_SMALL(sc->state[12], sc->state[13], sc->state[14], sc->state[15], - IF, 25, 4, PP4_2_); - - memcpy(sc->state, state, sizeof state); -} - -#undef A0 -#undef A1 -#undef A2 -#undef A3 -#undef B0 -#undef B1 -#undef B2 -#undef B3 -#undef C0 -#undef C1 -#undef C2 -#undef C3 -#undef D0 -#undef D1 -#undef D2 -#undef D3 - -#else - -#if SPH_SIMD_NOCOPY -#define A0 (sc->state[ 0]) -#define A1 (sc->state[ 1]) -#define A2 (sc->state[ 2]) -#define A3 (sc->state[ 3]) -#define B0 (sc->state[ 4]) -#define B1 (sc->state[ 5]) -#define B2 (sc->state[ 6]) -#define B3 (sc->state[ 7]) -#define C0 (sc->state[ 8]) -#define C1 (sc->state[ 9]) -#define C2 (sc->state[10]) -#define C3 (sc->state[11]) -#define D0 (sc->state[12]) -#define D1 (sc->state[13]) -#define D2 (sc->state[14]) -#define D3 (sc->state[15]) -#endif - -static void -compress_small(sph_simd_small_context *sc, int last) -{ - unsigned char *x; - s32 q[128]; - int i; - DECL_STATE_SMALL -#if SPH_SIMD_NOCOPY - sph_u32 saved[16]; -#endif - -#if SPH_SIMD_NOCOPY - memcpy(saved, sc->state, sizeof saved); -#endif - x = sc->buf; - FFT128(0, 1, 0, ll); - if (last) { - for (i = 0; i < 128; i ++) { - s32 tq; - - tq = q[i] + yoff_s_f[i]; - tq = REDS2(tq); - tq = REDS1(tq); - tq = REDS1(tq); - q[i] = (tq <= 128 ? tq : tq - 257); - } - } else { - for (i = 0; i < 128; i ++) { - s32 tq; - - tq = q[i] + yoff_s_n[i]; - tq = REDS2(tq); - tq = REDS1(tq); - tq = REDS1(tq); - q[i] = (tq <= 128 ? tq : tq - 257); - } - } - READ_STATE_SMALL(sc); - A0 ^= sph_dec32le_aligned(x + 0); - A1 ^= sph_dec32le_aligned(x + 4); - A2 ^= sph_dec32le_aligned(x + 8); - A3 ^= sph_dec32le_aligned(x + 12); - B0 ^= sph_dec32le_aligned(x + 16); - B1 ^= sph_dec32le_aligned(x + 20); - B2 ^= sph_dec32le_aligned(x + 24); - B3 ^= sph_dec32le_aligned(x + 28); - C0 ^= sph_dec32le_aligned(x + 32); - C1 ^= sph_dec32le_aligned(x + 36); - C2 ^= sph_dec32le_aligned(x + 40); - C3 ^= sph_dec32le_aligned(x + 44); - D0 ^= sph_dec32le_aligned(x + 48); - D1 ^= sph_dec32le_aligned(x + 52); - D2 ^= sph_dec32le_aligned(x + 56); - D3 ^= sph_dec32le_aligned(x + 60); - ONE_ROUND_SMALL(0_, 0, 3, 23, 17, 27); - ONE_ROUND_SMALL(1_, 2, 28, 19, 22, 7); - ONE_ROUND_SMALL(2_, 1, 29, 9, 15, 5); - ONE_ROUND_SMALL(3_, 0, 4, 13, 10, 25); -#if SPH_SIMD_NOCOPY - STEP_SMALL(saved[ 0], saved[ 1], saved[ 2], saved[ 3], - IF, 4, 13, PP4_2_); - STEP_SMALL(saved[ 4], saved[ 5], saved[ 6], saved[ 7], - IF, 13, 10, PP4_0_); - STEP_SMALL(saved[ 8], saved[ 9], saved[10], saved[11], - IF, 10, 25, PP4_1_); - STEP_SMALL(saved[12], saved[13], saved[14], saved[15], - IF, 25, 4, PP4_2_); -#else - STEP_SMALL(sc->state[ 0], sc->state[ 1], sc->state[ 2], sc->state[ 3], - IF, 4, 13, PP4_2_); - STEP_SMALL(sc->state[ 4], sc->state[ 5], sc->state[ 6], sc->state[ 7], - IF, 13, 10, PP4_0_); - STEP_SMALL(sc->state[ 8], sc->state[ 9], sc->state[10], sc->state[11], - IF, 10, 25, PP4_1_); - STEP_SMALL(sc->state[12], sc->state[13], sc->state[14], sc->state[15], - IF, 25, 4, PP4_2_); - WRITE_STATE_SMALL(sc); -#endif -} - -#if SPH_SIMD_NOCOPY -#undef A0 -#undef A1 -#undef A2 -#undef A3 -#undef B0 -#undef B1 -#undef B2 -#undef B3 -#undef C0 -#undef C1 -#undef C2 -#undef C3 -#undef D0 -#undef D1 -#undef D2 -#undef D3 -#endif - -#endif - -#if SPH_SMALL_FOOTPRINT_SIMD - -#define A0 state[ 0] -#define A1 state[ 1] -#define A2 state[ 2] -#define A3 state[ 3] -#define A4 state[ 4] -#define A5 state[ 5] -#define A6 state[ 6] -#define A7 state[ 7] -#define B0 state[ 8] -#define B1 state[ 9] -#define B2 state[10] -#define B3 state[11] -#define B4 state[12] -#define B5 state[13] -#define B6 state[14] -#define B7 state[15] -#define C0 state[16] -#define C1 state[17] -#define C2 state[18] -#define C3 state[19] -#define C4 state[20] -#define C5 state[21] -#define C6 state[22] -#define C7 state[23] -#define D0 state[24] -#define D1 state[25] -#define D2 state[26] -#define D3 state[27] -#define D4 state[28] -#define D5 state[29] -#define D6 state[30] -#define D7 state[31] - -/* - * Not needed -- already defined for SIMD-224 / SIMD-256 - * -#define STEP2_ELT(n, w, fun, s, ppb) do { \ - u32 tt = T32(D ## n + (w) + fun(A ## n, B ## n, C ## n)); \ - A ## n = T32(ROL32(tt, s) + tA[(ppb) ^ n]); \ - D ## n = C ## n; \ - C ## n = B ## n; \ - B ## n = tA[n]; \ - } while (0) - */ - -#define STEP2_BIG(w0, w1, w2, w3, w4, w5, w6, w7, fun, r, s, pp8b) do { \ - u32 tA[8]; \ - tA[0] = ROL32(A0, r); \ - tA[1] = ROL32(A1, r); \ - tA[2] = ROL32(A2, r); \ - tA[3] = ROL32(A3, r); \ - tA[4] = ROL32(A4, r); \ - tA[5] = ROL32(A5, r); \ - tA[6] = ROL32(A6, r); \ - tA[7] = ROL32(A7, r); \ - STEP2_ELT(0, w0, fun, s, pp8b); \ - STEP2_ELT(1, w1, fun, s, pp8b); \ - STEP2_ELT(2, w2, fun, s, pp8b); \ - STEP2_ELT(3, w3, fun, s, pp8b); \ - STEP2_ELT(4, w4, fun, s, pp8b); \ - STEP2_ELT(5, w5, fun, s, pp8b); \ - STEP2_ELT(6, w6, fun, s, pp8b); \ - STEP2_ELT(7, w7, fun, s, pp8b); \ - } while (0) - -static void -one_round_big(u32 *state, u32 *w, int isp, int p0, int p1, int p2, int p3) -{ - static const int pp8k[] = { 1, 6, 2, 3, 5, 7, 4, 1, 6, 2, 3 }; - - STEP2_BIG(w[ 0], w[ 1], w[ 2], w[ 3], w[ 4], w[ 5], w[ 6], w[ 7], - IF, p0, p1, pp8k[isp + 0]); - STEP2_BIG(w[ 8], w[ 9], w[10], w[11], w[12], w[13], w[14], w[15], - IF, p1, p2, pp8k[isp + 1]); - STEP2_BIG(w[16], w[17], w[18], w[19], w[20], w[21], w[22], w[23], - IF, p2, p3, pp8k[isp + 2]); - STEP2_BIG(w[24], w[25], w[26], w[27], w[28], w[29], w[30], w[31], - IF, p3, p0, pp8k[isp + 3]); - STEP2_BIG(w[32], w[33], w[34], w[35], w[36], w[37], w[38], w[39], - MAJ, p0, p1, pp8k[isp + 4]); - STEP2_BIG(w[40], w[41], w[42], w[43], w[44], w[45], w[46], w[47], - MAJ, p1, p2, pp8k[isp + 5]); - STEP2_BIG(w[48], w[49], w[50], w[51], w[52], w[53], w[54], w[55], - MAJ, p2, p3, pp8k[isp + 6]); - STEP2_BIG(w[56], w[57], w[58], w[59], w[60], w[61], w[62], w[63], - MAJ, p3, p0, pp8k[isp + 7]); -} - -static void -compress_big(sph_simd_big_context *sc, int last) -{ - unsigned char *x; - s32 q[256]; - int i; - u32 w[64]; - u32 state[32]; - size_t u; - - static const size_t wbp[32] = { - 4 << 4, 6 << 4, 0 << 4, 2 << 4, - 7 << 4, 5 << 4, 3 << 4, 1 << 4, - 15 << 4, 11 << 4, 12 << 4, 8 << 4, - 9 << 4, 13 << 4, 10 << 4, 14 << 4, - 17 << 4, 18 << 4, 23 << 4, 20 << 4, - 22 << 4, 21 << 4, 16 << 4, 19 << 4, - 30 << 4, 24 << 4, 25 << 4, 31 << 4, - 27 << 4, 29 << 4, 28 << 4, 26 << 4 - }; - - x = sc->buf; - FFT256(0, 1, 0, ll); - if (last) { - for (i = 0; i < 256; i ++) { - s32 tq; - - tq = q[i] + yoff_b_f[i]; - tq = REDS2(tq); - tq = REDS1(tq); - tq = REDS1(tq); - q[i] = (tq <= 128 ? tq : tq - 257); - } - } else { - for (i = 0; i < 256; i ++) { - s32 tq; - - tq = q[i] + yoff_b_n[i]; - tq = REDS2(tq); - tq = REDS1(tq); - tq = REDS1(tq); - q[i] = (tq <= 128 ? tq : tq - 257); - } - } - - for (i = 0; i < 32; i += 8) { - state[i + 0] = sc->state[i + 0] - ^ sph_dec32le_aligned(x + 4 * (i + 0)); - state[i + 1] = sc->state[i + 1] - ^ sph_dec32le_aligned(x + 4 * (i + 1)); - state[i + 2] = sc->state[i + 2] - ^ sph_dec32le_aligned(x + 4 * (i + 2)); - state[i + 3] = sc->state[i + 3] - ^ sph_dec32le_aligned(x + 4 * (i + 3)); - state[i + 4] = sc->state[i + 4] - ^ sph_dec32le_aligned(x + 4 * (i + 4)); - state[i + 5] = sc->state[i + 5] - ^ sph_dec32le_aligned(x + 4 * (i + 5)); - state[i + 6] = sc->state[i + 6] - ^ sph_dec32le_aligned(x + 4 * (i + 6)); - state[i + 7] = sc->state[i + 7] - ^ sph_dec32le_aligned(x + 4 * (i + 7)); - } - -#define WBREAD(sb, o1, o2, mm) do { \ - for (u = 0; u < 64; u += 8) { \ - size_t v = wbp[(u >> 3) + (sb)]; \ - w[u + 0] = INNER(q[v + 2 * 0 + (o1)], \ - q[v + 2 * 0 + (o2)], mm); \ - w[u + 1] = INNER(q[v + 2 * 1 + (o1)], \ - q[v + 2 * 1 + (o2)], mm); \ - w[u + 2] = INNER(q[v + 2 * 2 + (o1)], \ - q[v + 2 * 2 + (o2)], mm); \ - w[u + 3] = INNER(q[v + 2 * 3 + (o1)], \ - q[v + 2 * 3 + (o2)], mm); \ - w[u + 4] = INNER(q[v + 2 * 4 + (o1)], \ - q[v + 2 * 4 + (o2)], mm); \ - w[u + 5] = INNER(q[v + 2 * 5 + (o1)], \ - q[v + 2 * 5 + (o2)], mm); \ - w[u + 6] = INNER(q[v + 2 * 6 + (o1)], \ - q[v + 2 * 6 + (o2)], mm); \ - w[u + 7] = INNER(q[v + 2 * 7 + (o1)], \ - q[v + 2 * 7 + (o2)], mm); \ - } \ - } while (0) - - WBREAD( 0, 0, 1, 185); - one_round_big(state, w, 0, 3, 23, 17, 27); - WBREAD( 8, 0, 1, 185); - one_round_big(state, w, 1, 28, 19, 22, 7); - WBREAD(16, -256, -128, 233); - one_round_big(state, w, 2, 29, 9, 15, 5); - WBREAD(24, -383, -255, 233); - one_round_big(state, w, 3, 4, 13, 10, 25); - -#undef WBREAD - - STEP_BIG( - sc->state[ 0], sc->state[ 1], sc->state[ 2], sc->state[ 3], - sc->state[ 4], sc->state[ 5], sc->state[ 6], sc->state[ 7], - IF, 4, 13, PP8_4_); - STEP_BIG( - sc->state[ 8], sc->state[ 9], sc->state[10], sc->state[11], - sc->state[12], sc->state[13], sc->state[14], sc->state[15], - IF, 13, 10, PP8_5_); - STEP_BIG( - sc->state[16], sc->state[17], sc->state[18], sc->state[19], - sc->state[20], sc->state[21], sc->state[22], sc->state[23], - IF, 10, 25, PP8_6_); - STEP_BIG( - sc->state[24], sc->state[25], sc->state[26], sc->state[27], - sc->state[28], sc->state[29], sc->state[30], sc->state[31], - IF, 25, 4, PP8_0_); - - memcpy(sc->state, state, sizeof state); -} - -#undef A0 -#undef A1 -#undef A2 -#undef A3 -#undef A4 -#undef A5 -#undef A6 -#undef A7 -#undef B0 -#undef B1 -#undef B2 -#undef B3 -#undef B4 -#undef B5 -#undef B6 -#undef B7 -#undef C0 -#undef C1 -#undef C2 -#undef C3 -#undef C4 -#undef C5 -#undef C6 -#undef C7 -#undef D0 -#undef D1 -#undef D2 -#undef D3 -#undef D4 -#undef D5 -#undef D6 -#undef D7 - -#else - -#if SPH_SIMD_NOCOPY -#define A0 (sc->state[ 0]) -#define A1 (sc->state[ 1]) -#define A2 (sc->state[ 2]) -#define A3 (sc->state[ 3]) -#define A4 (sc->state[ 4]) -#define A5 (sc->state[ 5]) -#define A6 (sc->state[ 6]) -#define A7 (sc->state[ 7]) -#define B0 (sc->state[ 8]) -#define B1 (sc->state[ 9]) -#define B2 (sc->state[10]) -#define B3 (sc->state[11]) -#define B4 (sc->state[12]) -#define B5 (sc->state[13]) -#define B6 (sc->state[14]) -#define B7 (sc->state[15]) -#define C0 (sc->state[16]) -#define C1 (sc->state[17]) -#define C2 (sc->state[18]) -#define C3 (sc->state[19]) -#define C4 (sc->state[20]) -#define C5 (sc->state[21]) -#define C6 (sc->state[22]) -#define C7 (sc->state[23]) -#define D0 (sc->state[24]) -#define D1 (sc->state[25]) -#define D2 (sc->state[26]) -#define D3 (sc->state[27]) -#define D4 (sc->state[28]) -#define D5 (sc->state[29]) -#define D6 (sc->state[30]) -#define D7 (sc->state[31]) -#endif - -static void -compress_big(sph_simd_big_context *sc, int last) -{ - unsigned char *x; - s32 q[256]; - int i; - DECL_STATE_BIG -#if SPH_SIMD_NOCOPY - sph_u32 saved[32]; -#endif - -#if SPH_SIMD_NOCOPY - memcpy(saved, sc->state, sizeof saved); -#endif - - x = sc->buf; - FFT256(0, 1, 0, ll); - if (last) { - for (i = 0; i < 256; i ++) { - s32 tq; - - tq = q[i] + yoff_b_f[i]; - tq = REDS2(tq); - tq = REDS1(tq); - tq = REDS1(tq); - q[i] = (tq <= 128 ? tq : tq - 257); - } - } else { - for (i = 0; i < 256; i ++) { - s32 tq; - - tq = q[i] + yoff_b_n[i]; - tq = REDS2(tq); - tq = REDS1(tq); - tq = REDS1(tq); - q[i] = (tq <= 128 ? tq : tq - 257); - } - } - READ_STATE_BIG(sc); - A0 ^= sph_dec32le_aligned(x + 0); - A1 ^= sph_dec32le_aligned(x + 4); - A2 ^= sph_dec32le_aligned(x + 8); - A3 ^= sph_dec32le_aligned(x + 12); - A4 ^= sph_dec32le_aligned(x + 16); - A5 ^= sph_dec32le_aligned(x + 20); - A6 ^= sph_dec32le_aligned(x + 24); - A7 ^= sph_dec32le_aligned(x + 28); - B0 ^= sph_dec32le_aligned(x + 32); - B1 ^= sph_dec32le_aligned(x + 36); - B2 ^= sph_dec32le_aligned(x + 40); - B3 ^= sph_dec32le_aligned(x + 44); - B4 ^= sph_dec32le_aligned(x + 48); - B5 ^= sph_dec32le_aligned(x + 52); - B6 ^= sph_dec32le_aligned(x + 56); - B7 ^= sph_dec32le_aligned(x + 60); - C0 ^= sph_dec32le_aligned(x + 64); - C1 ^= sph_dec32le_aligned(x + 68); - C2 ^= sph_dec32le_aligned(x + 72); - C3 ^= sph_dec32le_aligned(x + 76); - C4 ^= sph_dec32le_aligned(x + 80); - C5 ^= sph_dec32le_aligned(x + 84); - C6 ^= sph_dec32le_aligned(x + 88); - C7 ^= sph_dec32le_aligned(x + 92); - D0 ^= sph_dec32le_aligned(x + 96); - D1 ^= sph_dec32le_aligned(x + 100); - D2 ^= sph_dec32le_aligned(x + 104); - D3 ^= sph_dec32le_aligned(x + 108); - D4 ^= sph_dec32le_aligned(x + 112); - D5 ^= sph_dec32le_aligned(x + 116); - D6 ^= sph_dec32le_aligned(x + 120); - D7 ^= sph_dec32le_aligned(x + 124); - - ONE_ROUND_BIG(0_, 0, 3, 23, 17, 27); - ONE_ROUND_BIG(1_, 1, 28, 19, 22, 7); - ONE_ROUND_BIG(2_, 2, 29, 9, 15, 5); - ONE_ROUND_BIG(3_, 3, 4, 13, 10, 25); -#if SPH_SIMD_NOCOPY - STEP_BIG( - saved[ 0], saved[ 1], saved[ 2], saved[ 3], - saved[ 4], saved[ 5], saved[ 6], saved[ 7], - IF, 4, 13, PP8_4_); - STEP_BIG( - saved[ 8], saved[ 9], saved[10], saved[11], - saved[12], saved[13], saved[14], saved[15], - IF, 13, 10, PP8_5_); - STEP_BIG( - saved[16], saved[17], saved[18], saved[19], - saved[20], saved[21], saved[22], saved[23], - IF, 10, 25, PP8_6_); - STEP_BIG( - saved[24], saved[25], saved[26], saved[27], - saved[28], saved[29], saved[30], saved[31], - IF, 25, 4, PP8_0_); -#else - STEP_BIG( - sc->state[ 0], sc->state[ 1], sc->state[ 2], sc->state[ 3], - sc->state[ 4], sc->state[ 5], sc->state[ 6], sc->state[ 7], - IF, 4, 13, PP8_4_); - STEP_BIG( - sc->state[ 8], sc->state[ 9], sc->state[10], sc->state[11], - sc->state[12], sc->state[13], sc->state[14], sc->state[15], - IF, 13, 10, PP8_5_); - STEP_BIG( - sc->state[16], sc->state[17], sc->state[18], sc->state[19], - sc->state[20], sc->state[21], sc->state[22], sc->state[23], - IF, 10, 25, PP8_6_); - STEP_BIG( - sc->state[24], sc->state[25], sc->state[26], sc->state[27], - sc->state[28], sc->state[29], sc->state[30], sc->state[31], - IF, 25, 4, PP8_0_); - WRITE_STATE_BIG(sc); -#endif -} - -#if SPH_SIMD_NOCOPY -#undef A0 -#undef A1 -#undef A2 -#undef A3 -#undef A4 -#undef A5 -#undef A6 -#undef A7 -#undef B0 -#undef B1 -#undef B2 -#undef B3 -#undef B4 -#undef B5 -#undef B6 -#undef B7 -#undef C0 -#undef C1 -#undef C2 -#undef C3 -#undef C4 -#undef C5 -#undef C6 -#undef C7 -#undef D0 -#undef D1 -#undef D2 -#undef D3 -#undef D4 -#undef D5 -#undef D6 -#undef D7 -#endif - -#endif - -static const u32 IV224[] = { - C32(0x33586E9F), C32(0x12FFF033), C32(0xB2D9F64D), C32(0x6F8FEA53), - C32(0xDE943106), C32(0x2742E439), C32(0x4FBAB5AC), C32(0x62B9FF96), - C32(0x22E7B0AF), C32(0xC862B3A8), C32(0x33E00CDC), C32(0x236B86A6), - C32(0xF64AE77C), C32(0xFA373B76), C32(0x7DC1EE5B), C32(0x7FB29CE8) -}; - -static const u32 IV256[] = { - C32(0x4D567983), C32(0x07190BA9), C32(0x8474577B), C32(0x39D726E9), - C32(0xAAF3D925), C32(0x3EE20B03), C32(0xAFD5E751), C32(0xC96006D3), - C32(0xC2C2BA14), C32(0x49B3BCB4), C32(0xF67CAF46), C32(0x668626C9), - C32(0xE2EAA8D2), C32(0x1FF47833), C32(0xD0C661A5), C32(0x55693DE1) -}; - -static const u32 IV384[] = { - C32(0x8A36EEBC), C32(0x94A3BD90), C32(0xD1537B83), C32(0xB25B070B), - C32(0xF463F1B5), C32(0xB6F81E20), C32(0x0055C339), C32(0xB4D144D1), - C32(0x7360CA61), C32(0x18361A03), C32(0x17DCB4B9), C32(0x3414C45A), - C32(0xA699A9D2), C32(0xE39E9664), C32(0x468BFE77), C32(0x51D062F8), - C32(0xB9E3BFE8), C32(0x63BECE2A), C32(0x8FE506B9), C32(0xF8CC4AC2), - C32(0x7AE11542), C32(0xB1AADDA1), C32(0x64B06794), C32(0x28D2F462), - C32(0xE64071EC), C32(0x1DEB91A8), C32(0x8AC8DB23), C32(0x3F782AB5), - C32(0x039B5CB8), C32(0x71DDD962), C32(0xFADE2CEA), C32(0x1416DF71) -}; - -static const u32 IV512[] = { - C32(0x0BA16B95), C32(0x72F999AD), C32(0x9FECC2AE), C32(0xBA3264FC), - C32(0x5E894929), C32(0x8E9F30E5), C32(0x2F1DAA37), C32(0xF0F2C558), - C32(0xAC506643), C32(0xA90635A5), C32(0xE25B878B), C32(0xAAB7878F), - C32(0x88817F7A), C32(0x0A02892B), C32(0x559A7550), C32(0x598F657E), - C32(0x7EEF60A1), C32(0x6B70E3E8), C32(0x9C1714D1), C32(0xB958E2A8), - C32(0xAB02675E), C32(0xED1C014F), C32(0xCD8D65BB), C32(0xFDB7A257), - C32(0x09254899), C32(0xD699C7BC), C32(0x9019B6DC), C32(0x2B9022E4), - C32(0x8FA14956), C32(0x21BF9BD3), C32(0xB94D0943), C32(0x6FFDDC22) -}; - -static void -init_small(void *cc, const u32 *iv) -{ - sph_simd_small_context *sc; - - sc = cc; - memcpy(sc->state, iv, sizeof sc->state); - sc->count_low = sc->count_high = 0; - sc->ptr = 0; -} - -static void -init_big(void *cc, const u32 *iv) -{ - sph_simd_big_context *sc; - - sc = cc; - memcpy(sc->state, iv, sizeof sc->state); - sc->count_low = sc->count_high = 0; - sc->ptr = 0; -} - -static void -update_small(void *cc, const void *data, size_t len) -{ - sph_simd_small_context *sc; - - sc = cc; - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - sc->ptr; - if (clen > len) - clen = len; - memcpy(sc->buf + sc->ptr, data, clen); - data = (const unsigned char *)data + clen; - len -= clen; - if ((sc->ptr += clen) == sizeof sc->buf) { - compress_small(sc, 0); - sc->ptr = 0; - sc->count_low = T32(sc->count_low + 1); - if (sc->count_low == 0) - sc->count_high ++; - } - } -} - -static void -update_big(void *cc, const void *data, size_t len) -{ - sph_simd_big_context *sc; - - sc = cc; - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - sc->ptr; - if (clen > len) - clen = len; - memcpy(sc->buf + sc->ptr, data, clen); - data = (const unsigned char *)data + clen; - len -= clen; - if ((sc->ptr += clen) == sizeof sc->buf) { - compress_big(sc, 0); - sc->ptr = 0; - sc->count_low = T32(sc->count_low + 1); - if (sc->count_low == 0) - sc->count_high ++; - } - } -} - -static void -encode_count_small(unsigned char *dst, - u32 low, u32 high, size_t ptr, unsigned n) -{ - low = T32(low << 9); - high = T32(high << 9) + (low >> 23); - low += (ptr << 3) + n; - sph_enc32le(dst, low); - sph_enc32le(dst + 4, high); -} - -static void -encode_count_big(unsigned char *dst, - u32 low, u32 high, size_t ptr, unsigned n) -{ - low = T32(low << 10); - high = T32(high << 10) + (low >> 22); - low += (ptr << 3) + n; - sph_enc32le(dst, low); - sph_enc32le(dst + 4, high); -} - -static void -finalize_small(void *cc, unsigned ub, unsigned n, void *dst, size_t dst_len) -{ - sph_simd_small_context *sc; - unsigned char *d; - size_t u; - - sc = cc; - if (sc->ptr > 0 || n > 0) { - memset(sc->buf + sc->ptr, 0, - (sizeof sc->buf) - sc->ptr); - sc->buf[sc->ptr] = ub & (0xFF << (8 - n)); - compress_small(sc, 0); - } - memset(sc->buf, 0, sizeof sc->buf); - encode_count_small(sc->buf, sc->count_low, sc->count_high, sc->ptr, n); - compress_small(sc, 1); - d = dst; - for (d = dst, u = 0; u < dst_len; u ++) - sph_enc32le(d + (u << 2), sc->state[u]); -} - -static void -finalize_big(void *cc, unsigned ub, unsigned n, void *dst, size_t dst_len) -{ - sph_simd_big_context *sc; - unsigned char *d; - size_t u; - - sc = cc; - if (sc->ptr > 0 || n > 0) { - memset(sc->buf + sc->ptr, 0, - (sizeof sc->buf) - sc->ptr); - sc->buf[sc->ptr] = ub & (0xFF << (8 - n)); - compress_big(sc, 0); - } - memset(sc->buf, 0, sizeof sc->buf); - encode_count_big(sc->buf, sc->count_low, sc->count_high, sc->ptr, n); - compress_big(sc, 1); - d = dst; - for (d = dst, u = 0; u < dst_len; u ++) - sph_enc32le(d + (u << 2), sc->state[u]); -} - -void -sph_simd224_init(void *cc) -{ - init_small(cc, IV224); -} - -void -sph_simd224(void *cc, const void *data, size_t len) -{ - update_small(cc, data, len); -} - -void -sph_simd224_close(void *cc, void *dst) -{ - sph_simd224_addbits_and_close(cc, 0, 0, dst); -} - -void -sph_simd224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - finalize_small(cc, ub, n, dst, 7); - sph_simd224_init(cc); -} - -void -sph_simd256_init(void *cc) -{ - init_small(cc, IV256); -} - -void -sph_simd256(void *cc, const void *data, size_t len) -{ - update_small(cc, data, len); -} - -void -sph_simd256_close(void *cc, void *dst) -{ - sph_simd256_addbits_and_close(cc, 0, 0, dst); -} - -void -sph_simd256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - finalize_small(cc, ub, n, dst, 8); - sph_simd256_init(cc); -} - -void -sph_simd384_init(void *cc) -{ - init_big(cc, IV384); -} - -void -sph_simd384(void *cc, const void *data, size_t len) -{ - update_big(cc, data, len); -} - -void -sph_simd384_close(void *cc, void *dst) -{ - sph_simd384_addbits_and_close(cc, 0, 0, dst); -} - -void -sph_simd384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - finalize_big(cc, ub, n, dst, 12); - sph_simd384_init(cc); -} - -void -sph_simd512_init(void *cc) -{ - init_big(cc, IV512); -} - -void -sph_simd512(void *cc, const void *data, size_t len) -{ - update_big(cc, data, len); -} - -void -sph_simd512_close(void *cc, void *dst) -{ - sph_simd512_addbits_and_close(cc, 0, 0, dst); -} - -void -sph_simd512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - finalize_big(cc, ub, n, dst, 16); - sph_simd512_init(cc); -} -#ifdef __cplusplus -} -#endif \ No newline at end of file diff --git a/sph/skein.c b/sph/skein.c deleted file mode 100644 index 7e47e352..00000000 --- a/sph/skein.c +++ /dev/null @@ -1,1254 +0,0 @@ -/* $Id: skein.c 254 2011-06-07 19:38:58Z tp $ */ -/* - * Skein implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include - -#include "sph_skein.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -#if SPH_SMALL_FOOTPRINT && !defined SPH_SMALL_FOOTPRINT_SKEIN -#define SPH_SMALL_FOOTPRINT_SKEIN 1 -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -#if SPH_64 - -#if 0 -/* obsolete */ -/* - * M5_ ## s ## _ ## i evaluates to s+i mod 5 (0 <= s <= 18, 0 <= i <= 3). - */ - -#define M5_0_0 0 -#define M5_0_1 1 -#define M5_0_2 2 -#define M5_0_3 3 - -#define M5_1_0 1 -#define M5_1_1 2 -#define M5_1_2 3 -#define M5_1_3 4 - -#define M5_2_0 2 -#define M5_2_1 3 -#define M5_2_2 4 -#define M5_2_3 0 - -#define M5_3_0 3 -#define M5_3_1 4 -#define M5_3_2 0 -#define M5_3_3 1 - -#define M5_4_0 4 -#define M5_4_1 0 -#define M5_4_2 1 -#define M5_4_3 2 - -#define M5_5_0 0 -#define M5_5_1 1 -#define M5_5_2 2 -#define M5_5_3 3 - -#define M5_6_0 1 -#define M5_6_1 2 -#define M5_6_2 3 -#define M5_6_3 4 - -#define M5_7_0 2 -#define M5_7_1 3 -#define M5_7_2 4 -#define M5_7_3 0 - -#define M5_8_0 3 -#define M5_8_1 4 -#define M5_8_2 0 -#define M5_8_3 1 - -#define M5_9_0 4 -#define M5_9_1 0 -#define M5_9_2 1 -#define M5_9_3 2 - -#define M5_10_0 0 -#define M5_10_1 1 -#define M5_10_2 2 -#define M5_10_3 3 - -#define M5_11_0 1 -#define M5_11_1 2 -#define M5_11_2 3 -#define M5_11_3 4 - -#define M5_12_0 2 -#define M5_12_1 3 -#define M5_12_2 4 -#define M5_12_3 0 - -#define M5_13_0 3 -#define M5_13_1 4 -#define M5_13_2 0 -#define M5_13_3 1 - -#define M5_14_0 4 -#define M5_14_1 0 -#define M5_14_2 1 -#define M5_14_3 2 - -#define M5_15_0 0 -#define M5_15_1 1 -#define M5_15_2 2 -#define M5_15_3 3 - -#define M5_16_0 1 -#define M5_16_1 2 -#define M5_16_2 3 -#define M5_16_3 4 - -#define M5_17_0 2 -#define M5_17_1 3 -#define M5_17_2 4 -#define M5_17_3 0 - -#define M5_18_0 3 -#define M5_18_1 4 -#define M5_18_2 0 -#define M5_18_3 1 -#endif - -/* - * M9_ ## s ## _ ## i evaluates to s+i mod 9 (0 <= s <= 18, 0 <= i <= 7). - */ - -#define M9_0_0 0 -#define M9_0_1 1 -#define M9_0_2 2 -#define M9_0_3 3 -#define M9_0_4 4 -#define M9_0_5 5 -#define M9_0_6 6 -#define M9_0_7 7 - -#define M9_1_0 1 -#define M9_1_1 2 -#define M9_1_2 3 -#define M9_1_3 4 -#define M9_1_4 5 -#define M9_1_5 6 -#define M9_1_6 7 -#define M9_1_7 8 - -#define M9_2_0 2 -#define M9_2_1 3 -#define M9_2_2 4 -#define M9_2_3 5 -#define M9_2_4 6 -#define M9_2_5 7 -#define M9_2_6 8 -#define M9_2_7 0 - -#define M9_3_0 3 -#define M9_3_1 4 -#define M9_3_2 5 -#define M9_3_3 6 -#define M9_3_4 7 -#define M9_3_5 8 -#define M9_3_6 0 -#define M9_3_7 1 - -#define M9_4_0 4 -#define M9_4_1 5 -#define M9_4_2 6 -#define M9_4_3 7 -#define M9_4_4 8 -#define M9_4_5 0 -#define M9_4_6 1 -#define M9_4_7 2 - -#define M9_5_0 5 -#define M9_5_1 6 -#define M9_5_2 7 -#define M9_5_3 8 -#define M9_5_4 0 -#define M9_5_5 1 -#define M9_5_6 2 -#define M9_5_7 3 - -#define M9_6_0 6 -#define M9_6_1 7 -#define M9_6_2 8 -#define M9_6_3 0 -#define M9_6_4 1 -#define M9_6_5 2 -#define M9_6_6 3 -#define M9_6_7 4 - -#define M9_7_0 7 -#define M9_7_1 8 -#define M9_7_2 0 -#define M9_7_3 1 -#define M9_7_4 2 -#define M9_7_5 3 -#define M9_7_6 4 -#define M9_7_7 5 - -#define M9_8_0 8 -#define M9_8_1 0 -#define M9_8_2 1 -#define M9_8_3 2 -#define M9_8_4 3 -#define M9_8_5 4 -#define M9_8_6 5 -#define M9_8_7 6 - -#define M9_9_0 0 -#define M9_9_1 1 -#define M9_9_2 2 -#define M9_9_3 3 -#define M9_9_4 4 -#define M9_9_5 5 -#define M9_9_6 6 -#define M9_9_7 7 - -#define M9_10_0 1 -#define M9_10_1 2 -#define M9_10_2 3 -#define M9_10_3 4 -#define M9_10_4 5 -#define M9_10_5 6 -#define M9_10_6 7 -#define M9_10_7 8 - -#define M9_11_0 2 -#define M9_11_1 3 -#define M9_11_2 4 -#define M9_11_3 5 -#define M9_11_4 6 -#define M9_11_5 7 -#define M9_11_6 8 -#define M9_11_7 0 - -#define M9_12_0 3 -#define M9_12_1 4 -#define M9_12_2 5 -#define M9_12_3 6 -#define M9_12_4 7 -#define M9_12_5 8 -#define M9_12_6 0 -#define M9_12_7 1 - -#define M9_13_0 4 -#define M9_13_1 5 -#define M9_13_2 6 -#define M9_13_3 7 -#define M9_13_4 8 -#define M9_13_5 0 -#define M9_13_6 1 -#define M9_13_7 2 - -#define M9_14_0 5 -#define M9_14_1 6 -#define M9_14_2 7 -#define M9_14_3 8 -#define M9_14_4 0 -#define M9_14_5 1 -#define M9_14_6 2 -#define M9_14_7 3 - -#define M9_15_0 6 -#define M9_15_1 7 -#define M9_15_2 8 -#define M9_15_3 0 -#define M9_15_4 1 -#define M9_15_5 2 -#define M9_15_6 3 -#define M9_15_7 4 - -#define M9_16_0 7 -#define M9_16_1 8 -#define M9_16_2 0 -#define M9_16_3 1 -#define M9_16_4 2 -#define M9_16_5 3 -#define M9_16_6 4 -#define M9_16_7 5 - -#define M9_17_0 8 -#define M9_17_1 0 -#define M9_17_2 1 -#define M9_17_3 2 -#define M9_17_4 3 -#define M9_17_5 4 -#define M9_17_6 5 -#define M9_17_7 6 - -#define M9_18_0 0 -#define M9_18_1 1 -#define M9_18_2 2 -#define M9_18_3 3 -#define M9_18_4 4 -#define M9_18_5 5 -#define M9_18_6 6 -#define M9_18_7 7 - -/* - * M3_ ## s ## _ ## i evaluates to s+i mod 3 (0 <= s <= 18, 0 <= i <= 1). - */ - -#define M3_0_0 0 -#define M3_0_1 1 -#define M3_1_0 1 -#define M3_1_1 2 -#define M3_2_0 2 -#define M3_2_1 0 -#define M3_3_0 0 -#define M3_3_1 1 -#define M3_4_0 1 -#define M3_4_1 2 -#define M3_5_0 2 -#define M3_5_1 0 -#define M3_6_0 0 -#define M3_6_1 1 -#define M3_7_0 1 -#define M3_7_1 2 -#define M3_8_0 2 -#define M3_8_1 0 -#define M3_9_0 0 -#define M3_9_1 1 -#define M3_10_0 1 -#define M3_10_1 2 -#define M3_11_0 2 -#define M3_11_1 0 -#define M3_12_0 0 -#define M3_12_1 1 -#define M3_13_0 1 -#define M3_13_1 2 -#define M3_14_0 2 -#define M3_14_1 0 -#define M3_15_0 0 -#define M3_15_1 1 -#define M3_16_0 1 -#define M3_16_1 2 -#define M3_17_0 2 -#define M3_17_1 0 -#define M3_18_0 0 -#define M3_18_1 1 - -#define XCAT(x, y) XCAT_(x, y) -#define XCAT_(x, y) x ## y - -#if 0 -/* obsolete */ -#define SKSI(k, s, i) XCAT(k, XCAT(XCAT(XCAT(M5_, s), _), i)) -#define SKST(t, s, v) XCAT(t, XCAT(XCAT(XCAT(M3_, s), _), v)) -#endif - -#define SKBI(k, s, i) XCAT(k, XCAT(XCAT(XCAT(M9_, s), _), i)) -#define SKBT(t, s, v) XCAT(t, XCAT(XCAT(XCAT(M3_, s), _), v)) - -#if 0 -/* obsolete */ -#define TFSMALL_KINIT(k0, k1, k2, k3, k4, t0, t1, t2) do { \ - k4 = (k0 ^ k1) ^ (k2 ^ k3) ^ SPH_C64(0x1BD11BDAA9FC1A22); \ - t2 = t0 ^ t1; \ - } while (0) -#endif - -#define TFBIG_KINIT(k0, k1, k2, k3, k4, k5, k6, k7, k8, t0, t1, t2) do { \ - k8 = ((k0 ^ k1) ^ (k2 ^ k3)) ^ ((k4 ^ k5) ^ (k6 ^ k7)) \ - ^ SPH_C64(0x1BD11BDAA9FC1A22); \ - t2 = t0 ^ t1; \ - } while (0) - -#if 0 -/* obsolete */ -#define TFSMALL_ADDKEY(w0, w1, w2, w3, k, t, s) do { \ - w0 = SPH_T64(w0 + SKSI(k, s, 0)); \ - w1 = SPH_T64(w1 + SKSI(k, s, 1) + SKST(t, s, 0)); \ - w2 = SPH_T64(w2 + SKSI(k, s, 2) + SKST(t, s, 1)); \ - w3 = SPH_T64(w3 + SKSI(k, s, 3) + (sph_u64)s); \ - } while (0) -#endif - -#if SPH_SMALL_FOOTPRINT_SKEIN - -#define TFBIG_ADDKEY(s, tt0, tt1) do { \ - p0 = SPH_T64(p0 + h[s + 0]); \ - p1 = SPH_T64(p1 + h[s + 1]); \ - p2 = SPH_T64(p2 + h[s + 2]); \ - p3 = SPH_T64(p3 + h[s + 3]); \ - p4 = SPH_T64(p4 + h[s + 4]); \ - p5 = SPH_T64(p5 + h[s + 5] + tt0); \ - p6 = SPH_T64(p6 + h[s + 6] + tt1); \ - p7 = SPH_T64(p7 + h[s + 7] + (sph_u64)s); \ - } while (0) - -#else - -#define TFBIG_ADDKEY(w0, w1, w2, w3, w4, w5, w6, w7, k, t, s) do { \ - w0 = SPH_T64(w0 + SKBI(k, s, 0)); \ - w1 = SPH_T64(w1 + SKBI(k, s, 1)); \ - w2 = SPH_T64(w2 + SKBI(k, s, 2)); \ - w3 = SPH_T64(w3 + SKBI(k, s, 3)); \ - w4 = SPH_T64(w4 + SKBI(k, s, 4)); \ - w5 = SPH_T64(w5 + SKBI(k, s, 5) + SKBT(t, s, 0)); \ - w6 = SPH_T64(w6 + SKBI(k, s, 6) + SKBT(t, s, 1)); \ - w7 = SPH_T64(w7 + SKBI(k, s, 7) + (sph_u64)s); \ - } while (0) - -#endif - -#if 0 -/* obsolete */ -#define TFSMALL_MIX(x0, x1, rc) do { \ - x0 = SPH_T64(x0 + x1); \ - x1 = SPH_ROTL64(x1, rc) ^ x0; \ - } while (0) -#endif - -#define TFBIG_MIX(x0, x1, rc) do { \ - x0 = SPH_T64(x0 + x1); \ - x1 = SPH_ROTL64(x1, rc) ^ x0; \ - } while (0) - -#if 0 -/* obsolete */ -#define TFSMALL_MIX4(w0, w1, w2, w3, rc0, rc1) do { \ - TFSMALL_MIX(w0, w1, rc0); \ - TFSMALL_MIX(w2, w3, rc1); \ - } while (0) -#endif - -#define TFBIG_MIX8(w0, w1, w2, w3, w4, w5, w6, w7, rc0, rc1, rc2, rc3) do { \ - TFBIG_MIX(w0, w1, rc0); \ - TFBIG_MIX(w2, w3, rc1); \ - TFBIG_MIX(w4, w5, rc2); \ - TFBIG_MIX(w6, w7, rc3); \ - } while (0) - -#if 0 -/* obsolete */ -#define TFSMALL_4e(s) do { \ - TFSMALL_ADDKEY(p0, p1, p2, p3, h, t, s); \ - TFSMALL_MIX4(p0, p1, p2, p3, 14, 16); \ - TFSMALL_MIX4(p0, p3, p2, p1, 52, 57); \ - TFSMALL_MIX4(p0, p1, p2, p3, 23, 40); \ - TFSMALL_MIX4(p0, p3, p2, p1, 5, 37); \ - } while (0) - -#define TFSMALL_4o(s) do { \ - TFSMALL_ADDKEY(p0, p1, p2, p3, h, t, s); \ - TFSMALL_MIX4(p0, p1, p2, p3, 25, 33); \ - TFSMALL_MIX4(p0, p3, p2, p1, 46, 12); \ - TFSMALL_MIX4(p0, p1, p2, p3, 58, 22); \ - TFSMALL_MIX4(p0, p3, p2, p1, 32, 32); \ - } while (0) -#endif - -#if SPH_SMALL_FOOTPRINT_SKEIN - -#define TFBIG_4e(s) do { \ - TFBIG_ADDKEY(s, t0, t1); \ - TFBIG_MIX8(p0, p1, p2, p3, p4, p5, p6, p7, 46, 36, 19, 37); \ - TFBIG_MIX8(p2, p1, p4, p7, p6, p5, p0, p3, 33, 27, 14, 42); \ - TFBIG_MIX8(p4, p1, p6, p3, p0, p5, p2, p7, 17, 49, 36, 39); \ - TFBIG_MIX8(p6, p1, p0, p7, p2, p5, p4, p3, 44, 9, 54, 56); \ - } while (0) - -#define TFBIG_4o(s) do { \ - TFBIG_ADDKEY(s, t1, t2); \ - TFBIG_MIX8(p0, p1, p2, p3, p4, p5, p6, p7, 39, 30, 34, 24); \ - TFBIG_MIX8(p2, p1, p4, p7, p6, p5, p0, p3, 13, 50, 10, 17); \ - TFBIG_MIX8(p4, p1, p6, p3, p0, p5, p2, p7, 25, 29, 39, 43); \ - TFBIG_MIX8(p6, p1, p0, p7, p2, p5, p4, p3, 8, 35, 56, 22); \ - } while (0) - -#else - -#define TFBIG_4e(s) do { \ - TFBIG_ADDKEY(p0, p1, p2, p3, p4, p5, p6, p7, h, t, s); \ - TFBIG_MIX8(p0, p1, p2, p3, p4, p5, p6, p7, 46, 36, 19, 37); \ - TFBIG_MIX8(p2, p1, p4, p7, p6, p5, p0, p3, 33, 27, 14, 42); \ - TFBIG_MIX8(p4, p1, p6, p3, p0, p5, p2, p7, 17, 49, 36, 39); \ - TFBIG_MIX8(p6, p1, p0, p7, p2, p5, p4, p3, 44, 9, 54, 56); \ - } while (0) - -#define TFBIG_4o(s) do { \ - TFBIG_ADDKEY(p0, p1, p2, p3, p4, p5, p6, p7, h, t, s); \ - TFBIG_MIX8(p0, p1, p2, p3, p4, p5, p6, p7, 39, 30, 34, 24); \ - TFBIG_MIX8(p2, p1, p4, p7, p6, p5, p0, p3, 13, 50, 10, 17); \ - TFBIG_MIX8(p4, p1, p6, p3, p0, p5, p2, p7, 25, 29, 39, 43); \ - TFBIG_MIX8(p6, p1, p0, p7, p2, p5, p4, p3, 8, 35, 56, 22); \ - } while (0) - -#endif - -#if 0 -/* obsolete */ -#define UBI_SMALL(etype, extra) do { \ - sph_u64 h4, t0, t1, t2; \ - sph_u64 m0 = sph_dec64le(buf + 0); \ - sph_u64 m1 = sph_dec64le(buf + 8); \ - sph_u64 m2 = sph_dec64le(buf + 16); \ - sph_u64 m3 = sph_dec64le(buf + 24); \ - sph_u64 p0 = m0; \ - sph_u64 p1 = m1; \ - sph_u64 p2 = m2; \ - sph_u64 p3 = m3; \ - t0 = SPH_T64(bcount << 5) + (sph_u64)(extra); \ - t1 = (bcount >> 59) + ((sph_u64)(etype) << 55); \ - TFSMALL_KINIT(h0, h1, h2, h3, h4, t0, t1, t2); \ - TFSMALL_4e(0); \ - TFSMALL_4o(1); \ - TFSMALL_4e(2); \ - TFSMALL_4o(3); \ - TFSMALL_4e(4); \ - TFSMALL_4o(5); \ - TFSMALL_4e(6); \ - TFSMALL_4o(7); \ - TFSMALL_4e(8); \ - TFSMALL_4o(9); \ - TFSMALL_4e(10); \ - TFSMALL_4o(11); \ - TFSMALL_4e(12); \ - TFSMALL_4o(13); \ - TFSMALL_4e(14); \ - TFSMALL_4o(15); \ - TFSMALL_4e(16); \ - TFSMALL_4o(17); \ - TFSMALL_ADDKEY(p0, p1, p2, p3, h, t, 18); \ - h0 = m0 ^ p0; \ - h1 = m1 ^ p1; \ - h2 = m2 ^ p2; \ - h3 = m3 ^ p3; \ - } while (0) -#endif - -#if SPH_SMALL_FOOTPRINT_SKEIN - -#define UBI_BIG(etype, extra) do { \ - sph_u64 t0, t1, t2; \ - unsigned u; \ - sph_u64 m0 = sph_dec64le_aligned(buf + 0); \ - sph_u64 m1 = sph_dec64le_aligned(buf + 8); \ - sph_u64 m2 = sph_dec64le_aligned(buf + 16); \ - sph_u64 m3 = sph_dec64le_aligned(buf + 24); \ - sph_u64 m4 = sph_dec64le_aligned(buf + 32); \ - sph_u64 m5 = sph_dec64le_aligned(buf + 40); \ - sph_u64 m6 = sph_dec64le_aligned(buf + 48); \ - sph_u64 m7 = sph_dec64le_aligned(buf + 56); \ - sph_u64 p0 = m0; \ - sph_u64 p1 = m1; \ - sph_u64 p2 = m2; \ - sph_u64 p3 = m3; \ - sph_u64 p4 = m4; \ - sph_u64 p5 = m5; \ - sph_u64 p6 = m6; \ - sph_u64 p7 = m7; \ - t0 = SPH_T64(bcount << 6) + (sph_u64)(extra); \ - t1 = (bcount >> 58) + ((sph_u64)(etype) << 55); \ - TFBIG_KINIT(h[0], h[1], h[2], h[3], h[4], h[5], \ - h[6], h[7], h[8], t0, t1, t2); \ - for (u = 0; u <= 15; u += 3) { \ - h[u + 9] = h[u + 0]; \ - h[u + 10] = h[u + 1]; \ - h[u + 11] = h[u + 2]; \ - } \ - for (u = 0; u < 9; u ++) { \ - sph_u64 s = u << 1; \ - sph_u64 tmp; \ - TFBIG_4e(s); \ - TFBIG_4o(s + 1); \ - tmp = t2; \ - t2 = t1; \ - t1 = t0; \ - t0 = tmp; \ - } \ - TFBIG_ADDKEY(18, t0, t1); \ - h[0] = m0 ^ p0; \ - h[1] = m1 ^ p1; \ - h[2] = m2 ^ p2; \ - h[3] = m3 ^ p3; \ - h[4] = m4 ^ p4; \ - h[5] = m5 ^ p5; \ - h[6] = m6 ^ p6; \ - h[7] = m7 ^ p7; \ - } while (0) - -#else - -#define UBI_BIG(etype, extra) do { \ - sph_u64 h8, t0, t1, t2; \ - sph_u64 m0 = sph_dec64le_aligned(buf + 0); \ - sph_u64 m1 = sph_dec64le_aligned(buf + 8); \ - sph_u64 m2 = sph_dec64le_aligned(buf + 16); \ - sph_u64 m3 = sph_dec64le_aligned(buf + 24); \ - sph_u64 m4 = sph_dec64le_aligned(buf + 32); \ - sph_u64 m5 = sph_dec64le_aligned(buf + 40); \ - sph_u64 m6 = sph_dec64le_aligned(buf + 48); \ - sph_u64 m7 = sph_dec64le_aligned(buf + 56); \ - sph_u64 p0 = m0; \ - sph_u64 p1 = m1; \ - sph_u64 p2 = m2; \ - sph_u64 p3 = m3; \ - sph_u64 p4 = m4; \ - sph_u64 p5 = m5; \ - sph_u64 p6 = m6; \ - sph_u64 p7 = m7; \ - t0 = SPH_T64(bcount << 6) + (sph_u64)(extra); \ - t1 = (bcount >> 58) + ((sph_u64)(etype) << 55); \ - TFBIG_KINIT(h0, h1, h2, h3, h4, h5, h6, h7, h8, t0, t1, t2); \ - TFBIG_4e(0); \ - TFBIG_4o(1); \ - TFBIG_4e(2); \ - TFBIG_4o(3); \ - TFBIG_4e(4); \ - TFBIG_4o(5); \ - TFBIG_4e(6); \ - TFBIG_4o(7); \ - TFBIG_4e(8); \ - TFBIG_4o(9); \ - TFBIG_4e(10); \ - TFBIG_4o(11); \ - TFBIG_4e(12); \ - TFBIG_4o(13); \ - TFBIG_4e(14); \ - TFBIG_4o(15); \ - TFBIG_4e(16); \ - TFBIG_4o(17); \ - TFBIG_ADDKEY(p0, p1, p2, p3, p4, p5, p6, p7, h, t, 18); \ - h0 = m0 ^ p0; \ - h1 = m1 ^ p1; \ - h2 = m2 ^ p2; \ - h3 = m3 ^ p3; \ - h4 = m4 ^ p4; \ - h5 = m5 ^ p5; \ - h6 = m6 ^ p6; \ - h7 = m7 ^ p7; \ - } while (0) - -#endif - -#if 0 -/* obsolete */ -#define DECL_STATE_SMALL \ - sph_u64 h0, h1, h2, h3; \ - sph_u64 bcount; - -#define READ_STATE_SMALL(sc) do { \ - h0 = (sc)->h0; \ - h1 = (sc)->h1; \ - h2 = (sc)->h2; \ - h3 = (sc)->h3; \ - bcount = sc->bcount; \ - } while (0) - -#define WRITE_STATE_SMALL(sc) do { \ - (sc)->h0 = h0; \ - (sc)->h1 = h1; \ - (sc)->h2 = h2; \ - (sc)->h3 = h3; \ - sc->bcount = bcount; \ - } while (0) -#endif - -#if SPH_SMALL_FOOTPRINT_SKEIN - -#define DECL_STATE_BIG \ - sph_u64 h[27]; \ - sph_u64 bcount; - -#define READ_STATE_BIG(sc) do { \ - h[0] = (sc)->h0; \ - h[1] = (sc)->h1; \ - h[2] = (sc)->h2; \ - h[3] = (sc)->h3; \ - h[4] = (sc)->h4; \ - h[5] = (sc)->h5; \ - h[6] = (sc)->h6; \ - h[7] = (sc)->h7; \ - bcount = sc->bcount; \ - } while (0) - -#define WRITE_STATE_BIG(sc) do { \ - (sc)->h0 = h[0]; \ - (sc)->h1 = h[1]; \ - (sc)->h2 = h[2]; \ - (sc)->h3 = h[3]; \ - (sc)->h4 = h[4]; \ - (sc)->h5 = h[5]; \ - (sc)->h6 = h[6]; \ - (sc)->h7 = h[7]; \ - sc->bcount = bcount; \ - } while (0) - -#else - -#define DECL_STATE_BIG \ - sph_u64 h0, h1, h2, h3, h4, h5, h6, h7; \ - sph_u64 bcount; - -#define READ_STATE_BIG(sc) do { \ - h0 = (sc)->h0; \ - h1 = (sc)->h1; \ - h2 = (sc)->h2; \ - h3 = (sc)->h3; \ - h4 = (sc)->h4; \ - h5 = (sc)->h5; \ - h6 = (sc)->h6; \ - h7 = (sc)->h7; \ - bcount = sc->bcount; \ - } while (0) - -#define WRITE_STATE_BIG(sc) do { \ - (sc)->h0 = h0; \ - (sc)->h1 = h1; \ - (sc)->h2 = h2; \ - (sc)->h3 = h3; \ - (sc)->h4 = h4; \ - (sc)->h5 = h5; \ - (sc)->h6 = h6; \ - (sc)->h7 = h7; \ - sc->bcount = bcount; \ - } while (0) - -#endif - -#if 0 -/* obsolete */ -static void -skein_small_init(sph_skein_small_context *sc, const sph_u64 *iv) -{ - sc->h0 = iv[0]; - sc->h1 = iv[1]; - sc->h2 = iv[2]; - sc->h3 = iv[3]; - sc->bcount = 0; - sc->ptr = 0; -} -#endif - -static void -skein_big_init(sph_skein_big_context *sc, const sph_u64 *iv) -{ - sc->h0 = iv[0]; - sc->h1 = iv[1]; - sc->h2 = iv[2]; - sc->h3 = iv[3]; - sc->h4 = iv[4]; - sc->h5 = iv[5]; - sc->h6 = iv[6]; - sc->h7 = iv[7]; - sc->bcount = 0; - sc->ptr = 0; -} - -#if 0 -/* obsolete */ -static void -skein_small_core(sph_skein_small_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr, clen; - unsigned first; - DECL_STATE_SMALL - - buf = sc->buf; - ptr = sc->ptr; - clen = (sizeof sc->buf) - ptr; - if (len <= clen) { - memcpy(buf + ptr, data, len); - sc->ptr = ptr + len; - return; - } - if (clen != 0) { - memcpy(buf + ptr, data, clen); - data = (const unsigned char *)data + clen; - len -= clen; - } - -#if SPH_SMALL_FOOTPRINT_SKEIN - - READ_STATE_SMALL(sc); - first = (bcount == 0) << 7; - for (;;) { - bcount ++; - UBI_SMALL(96 + first, 0); - if (len <= sizeof sc->buf) - break; - first = 0; - memcpy(buf, data, sizeof sc->buf); - data = (const unsigned char *)data + sizeof sc->buf; - len -= sizeof sc->buf; - } - WRITE_STATE_SMALL(sc); - sc->ptr = len; - memcpy(buf, data, len); - -#else - - /* - * Unrolling the loop yields a slight performance boost, while - * keeping the code size aorund 24 kB on 32-bit x86. - */ - READ_STATE_SMALL(sc); - first = (bcount == 0) << 7; - for (;;) { - bcount ++; - UBI_SMALL(96 + first, 0); - if (len <= sizeof sc->buf) - break; - buf = (unsigned char *)data; - bcount ++; - UBI_SMALL(96, 0); - if (len <= 2 * sizeof sc->buf) { - data = buf + sizeof sc->buf; - len -= sizeof sc->buf; - break; - } - buf += sizeof sc->buf; - data = buf + sizeof sc->buf; - first = 0; - len -= 2 * sizeof sc->buf; - } - WRITE_STATE_SMALL(sc); - sc->ptr = len; - memcpy(sc->buf, data, len); - -#endif -} -#endif - -static void -skein_big_core(sph_skein_big_context *sc, const void *data, size_t len) -{ - /* - * The Skein "final bit" in the tweak is troublesome here, - * because if the input has a length which is a multiple of the - * block size (512 bits) then that bit must be set for the - * final block, which is full of message bits (padding in - * Skein can be reduced to no extra bit at all). However, this - * function cannot know whether it processes the last chunks of - * the message or not. Hence we may keep a full block of buffered - * data (64 bytes). - */ - unsigned char *buf; - size_t ptr; - unsigned first; - DECL_STATE_BIG - - buf = sc->buf; - ptr = sc->ptr; - if (len <= (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - READ_STATE_BIG(sc); - first = (bcount == 0) << 7; - do { - size_t clen; - - if (ptr == sizeof sc->buf) { - bcount ++; - UBI_BIG(96 + first, 0); - first = 0; - ptr = 0; - } - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data = (const unsigned char *)data + clen; - len -= clen; - } while (len > 0); - WRITE_STATE_BIG(sc); - sc->ptr = ptr; -} - -#if 0 -/* obsolete */ -static void -skein_small_close(sph_skein_small_context *sc, unsigned ub, unsigned n, - void *dst, size_t out_len) -{ - unsigned char *buf; - size_t ptr; - unsigned et; - int i; - DECL_STATE_SMALL - - if (n != 0) { - unsigned z; - unsigned char x; - - z = 0x80 >> n; - x = ((ub & -z) | z) & 0xFF; - skein_small_core(sc, &x, 1); - } - - buf = sc->buf; - ptr = sc->ptr; - READ_STATE_SMALL(sc); - memset(buf + ptr, 0, (sizeof sc->buf) - ptr); - et = 352 + ((bcount == 0) << 7) + (n != 0); - for (i = 0; i < 2; i ++) { - UBI_SMALL(et, ptr); - if (i == 0) { - memset(buf, 0, sizeof sc->buf); - bcount = 0; - et = 510; - ptr = 8; - } - } - - sph_enc64le_aligned(buf + 0, h0); - sph_enc64le_aligned(buf + 8, h1); - sph_enc64le_aligned(buf + 16, h2); - sph_enc64le_aligned(buf + 24, h3); - memcpy(dst, buf, out_len); -} -#endif - -static void -skein_big_close(sph_skein_big_context *sc, unsigned ub, unsigned n, - void *dst, size_t out_len) -{ - unsigned char *buf; - size_t ptr; - unsigned et; - int i; -#if SPH_SMALL_FOOTPRINT_SKEIN - size_t u; -#endif - DECL_STATE_BIG - - /* - * Add bit padding if necessary. - */ - if (n != 0) { - unsigned z; - unsigned char x; - - z = 0x80 >> n; - x = ((ub & -z) | z) & 0xFF; - skein_big_core(sc, &x, 1); - } - - buf = sc->buf; - ptr = sc->ptr; - - /* - * At that point, if ptr == 0, then the message was empty; - * otherwise, there is between 1 and 64 bytes (inclusive) which - * are yet to be processed. Either way, we complete the buffer - * to a full block with zeros (the Skein specification mandates - * that an empty message is padded so that there is at least - * one block to process). - * - * Once this block has been processed, we do it again, with - * a block full of zeros, for the output (that block contains - * the encoding of "0", over 8 bytes, then padded with zeros). - */ - READ_STATE_BIG(sc); - memset(buf + ptr, 0, (sizeof sc->buf) - ptr); - et = 352 + ((bcount == 0) << 7) + (n != 0); - for (i = 0; i < 2; i ++) { - UBI_BIG(et, ptr); - if (i == 0) { - memset(buf, 0, sizeof sc->buf); - bcount = 0; - et = 510; - ptr = 8; - } - } - -#if SPH_SMALL_FOOTPRINT_SKEIN - - /* - * We use a temporary buffer because we must support the case - * where output size is not a multiple of 64 (namely, a 224-bit - * output). - */ - for (u = 0; u < out_len; u += 8) - sph_enc64le_aligned(buf + u, h[u >> 3]); - memcpy(dst, buf, out_len); - -#else - - sph_enc64le_aligned(buf + 0, h0); - sph_enc64le_aligned(buf + 8, h1); - sph_enc64le_aligned(buf + 16, h2); - sph_enc64le_aligned(buf + 24, h3); - sph_enc64le_aligned(buf + 32, h4); - sph_enc64le_aligned(buf + 40, h5); - sph_enc64le_aligned(buf + 48, h6); - sph_enc64le_aligned(buf + 56, h7); - memcpy(dst, buf, out_len); - -#endif -} - -#if 0 -/* obsolete */ -static const sph_u64 IV224[] = { - SPH_C64(0xC6098A8C9AE5EA0B), SPH_C64(0x876D568608C5191C), - SPH_C64(0x99CB88D7D7F53884), SPH_C64(0x384BDDB1AEDDB5DE) -}; - -static const sph_u64 IV256[] = { - SPH_C64(0xFC9DA860D048B449), SPH_C64(0x2FCA66479FA7D833), - SPH_C64(0xB33BC3896656840F), SPH_C64(0x6A54E920FDE8DA69) -}; -#endif - -static const sph_u64 IV224[] = { - SPH_C64(0xCCD0616248677224), SPH_C64(0xCBA65CF3A92339EF), - SPH_C64(0x8CCD69D652FF4B64), SPH_C64(0x398AED7B3AB890B4), - SPH_C64(0x0F59D1B1457D2BD0), SPH_C64(0x6776FE6575D4EB3D), - SPH_C64(0x99FBC70E997413E9), SPH_C64(0x9E2CFCCFE1C41EF7) -}; - -static const sph_u64 IV256[] = { - SPH_C64(0xCCD044A12FDB3E13), SPH_C64(0xE83590301A79A9EB), - SPH_C64(0x55AEA0614F816E6F), SPH_C64(0x2A2767A4AE9B94DB), - SPH_C64(0xEC06025E74DD7683), SPH_C64(0xE7A436CDC4746251), - SPH_C64(0xC36FBAF9393AD185), SPH_C64(0x3EEDBA1833EDFC13) -}; - -static const sph_u64 IV384[] = { - SPH_C64(0xA3F6C6BF3A75EF5F), SPH_C64(0xB0FEF9CCFD84FAA4), - SPH_C64(0x9D77DD663D770CFE), SPH_C64(0xD798CBF3B468FDDA), - SPH_C64(0x1BC4A6668A0E4465), SPH_C64(0x7ED7D434E5807407), - SPH_C64(0x548FC1ACD4EC44D6), SPH_C64(0x266E17546AA18FF8) -}; - -static const sph_u64 IV512[] = { - SPH_C64(0x4903ADFF749C51CE), SPH_C64(0x0D95DE399746DF03), - SPH_C64(0x8FD1934127C79BCE), SPH_C64(0x9A255629FF352CB1), - SPH_C64(0x5DB62599DF6CA7B0), SPH_C64(0xEABE394CA9D5C3F4), - SPH_C64(0x991112C71A75B523), SPH_C64(0xAE18A40B660FCC33) -}; - -#if 0 -/* obsolete */ -/* see sph_skein.h */ -void -sph_skein224_init(void *cc) -{ - skein_small_init(cc, IV224); -} - -/* see sph_skein.h */ -void -sph_skein224(void *cc, const void *data, size_t len) -{ - skein_small_core(cc, data, len); -} - -/* see sph_skein.h */ -void -sph_skein224_close(void *cc, void *dst) -{ - sph_skein224_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_skein.h */ -void -sph_skein224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - skein_small_close(cc, ub, n, dst, 28); - sph_skein224_init(cc); -} - -/* see sph_skein.h */ -void -sph_skein256_init(void *cc) -{ - skein_small_init(cc, IV256); -} - -/* see sph_skein.h */ -void -sph_skein256(void *cc, const void *data, size_t len) -{ - skein_small_core(cc, data, len); -} - -/* see sph_skein.h */ -void -sph_skein256_close(void *cc, void *dst) -{ - sph_skein256_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_skein.h */ -void -sph_skein256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - skein_small_close(cc, ub, n, dst, 32); - sph_skein256_init(cc); -} -#endif - -/* see sph_skein.h */ -void -sph_skein224_init(void *cc) -{ - skein_big_init(cc, IV224); -} - -/* see sph_skein.h */ -void -sph_skein224(void *cc, const void *data, size_t len) -{ - skein_big_core(cc, data, len); -} - -/* see sph_skein.h */ -void -sph_skein224_close(void *cc, void *dst) -{ - sph_skein224_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_skein.h */ -void -sph_skein224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - skein_big_close(cc, ub, n, dst, 28); - sph_skein224_init(cc); -} - -/* see sph_skein.h */ -void -sph_skein256_init(void *cc) -{ - skein_big_init(cc, IV256); -} - -/* see sph_skein.h */ -void -sph_skein256(void *cc, const void *data, size_t len) -{ - skein_big_core(cc, data, len); -} - -/* see sph_skein.h */ -void -sph_skein256_close(void *cc, void *dst) -{ - sph_skein256_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_skein.h */ -void -sph_skein256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - skein_big_close(cc, ub, n, dst, 32); - sph_skein256_init(cc); -} - -/* see sph_skein.h */ -void -sph_skein384_init(void *cc) -{ - skein_big_init(cc, IV384); -} - -/* see sph_skein.h */ -void -sph_skein384(void *cc, const void *data, size_t len) -{ - skein_big_core(cc, data, len); -} - -/* see sph_skein.h */ -void -sph_skein384_close(void *cc, void *dst) -{ - sph_skein384_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_skein.h */ -void -sph_skein384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - skein_big_close(cc, ub, n, dst, 48); - sph_skein384_init(cc); -} - -/* see sph_skein.h */ -void -sph_skein512_init(void *cc) -{ - skein_big_init(cc, IV512); -} - -/* see sph_skein.h */ -void -sph_skein512(void *cc, const void *data, size_t len) -{ - skein_big_core(cc, data, len); -} - -/* see sph_skein.h */ -void -sph_skein512_close(void *cc, void *dst) -{ - sph_skein512_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_skein.h */ -void -sph_skein512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - skein_big_close(cc, ub, n, dst, 64); - sph_skein512_init(cc); -} - -#endif - - -#ifdef __cplusplus -} -#endif diff --git a/sph/sph_blake.h b/sph/sph_blake.h deleted file mode 100644 index 2c2b3da2..00000000 --- a/sph/sph_blake.h +++ /dev/null @@ -1,337 +0,0 @@ -/* $Id: sph_blake.h 252 2011-06-07 17:55:14Z tp $ */ -/** - * BLAKE interface. BLAKE is a family of functions which differ by their - * output size; this implementation defines BLAKE for output sizes 224, - * 256, 384 and 512 bits. This implementation conforms to the "third - * round" specification. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_blake.h - * @author Thomas Pornin - */ - -#ifndef SPH_BLAKE_H__ -#define SPH_BLAKE_H__ - -#ifdef __cplusplus -extern "C"{ -#endif - -#include -#include "sph_types.h" - -/** - * Output size (in bits) for BLAKE-224. - */ -#define SPH_SIZE_blake224 224 - -/** - * Output size (in bits) for BLAKE-256. - */ -#define SPH_SIZE_blake256 256 - -#if SPH_64 - -/** - * Output size (in bits) for BLAKE-384. - */ -#define SPH_SIZE_blake384 384 - -/** - * Output size (in bits) for BLAKE-512. - */ -#define SPH_SIZE_blake512 512 - -#endif - -/** - * This structure is a context for BLAKE-224 and BLAKE-256 computations: - * it contains the intermediate values and some data from the last - * entered block. Once a BLAKE computation has been performed, the - * context can be reused for another computation. - * - * The contents of this structure are private. A running BLAKE - * computation can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[64]; /* first field, for alignment */ - size_t ptr; - sph_u32 H[8]; - sph_u32 S[4]; - sph_u32 T0, T1; -#endif -} sph_blake_small_context; - -/** - * This structure is a context for BLAKE-224 computations. It is - * identical to the common sph_blake_small_context. - */ -typedef sph_blake_small_context sph_blake224_context; - -/** - * This structure is a context for BLAKE-256 computations. It is - * identical to the common sph_blake_small_context. - */ -typedef sph_blake_small_context sph_blake256_context; - -#if SPH_64 - -/** - * This structure is a context for BLAKE-384 and BLAKE-512 computations: - * it contains the intermediate values and some data from the last - * entered block. Once a BLAKE computation has been performed, the - * context can be reused for another computation. - * - * The contents of this structure are private. A running BLAKE - * computation can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[128]; /* first field, for alignment */ - size_t ptr; - sph_u64 H[8]; - sph_u64 S[4]; - sph_u64 T0, T1; -#endif -} sph_blake_big_context; - -/** - * This structure is a context for BLAKE-384 computations. It is - * identical to the common sph_blake_small_context. - */ -typedef sph_blake_big_context sph_blake384_context; - -/** - * This structure is a context for BLAKE-512 computations. It is - * identical to the common sph_blake_small_context. - */ -typedef sph_blake_big_context sph_blake512_context; - -#endif - -/** - * Initialize a BLAKE-224 context. This process performs no memory allocation. - * - * @param cc the BLAKE-224 context (pointer to a - * sph_blake224_context) - */ -void sph_blake224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the BLAKE-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_blake224(void *cc, const void *data, size_t len); - -/** - * Terminate the current BLAKE-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the BLAKE-224 context - * @param dst the destination buffer - */ -void sph_blake224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the BLAKE-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_blake224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Switch for the number of rounds (old blake was 8) - */ -extern int blake256_rounds; - -/** - * Initialize a BLAKE-256 context. This process performs no memory allocation. - * - * @param cc the BLAKE-256 context (pointer to a - * sph_blake256_context) - */ -void sph_blake256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the BLAKE-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_blake256(void *cc, const void *data, size_t len); - -/** - * Terminate the current BLAKE-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the BLAKE-256 context - * @param dst the destination buffer - */ -void sph_blake256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the BLAKE-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_blake256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Allow blakecoin and blake variants - */ -void sph_blake256_set_rounds(int rounds); - -#if SPH_64 - -/** - * Initialize a BLAKE-384 context. This process performs no memory allocation. - * - * @param cc the BLAKE-384 context (pointer to a - * sph_blake384_context) - */ -void sph_blake384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the BLAKE-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_blake384(void *cc, const void *data, size_t len); - -/** - * Terminate the current BLAKE-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the BLAKE-384 context - * @param dst the destination buffer - */ -void sph_blake384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the BLAKE-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_blake384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a BLAKE-512 context. This process performs no memory allocation. - * - * @param cc the BLAKE-512 context (pointer to a - * sph_blake512_context) - */ -void sph_blake512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the BLAKE-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_blake512(void *cc, const void *data, size_t len); - -/** - * Terminate the current BLAKE-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the BLAKE-512 context - * @param dst the destination buffer - */ -void sph_blake512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the BLAKE-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_blake512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/sph/sph_bmw.h b/sph/sph_bmw.h deleted file mode 100644 index 484a2a74..00000000 --- a/sph/sph_bmw.h +++ /dev/null @@ -1,320 +0,0 @@ -/* $Id: sph_bmw.h 216 2010-06-08 09:46:57Z tp $ */ -/** - * BMW interface. BMW (aka "Blue Midnight Wish") is a family of - * functions which differ by their output size; this implementation - * defines BMW for output sizes 224, 256, 384 and 512 bits. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_bmw.h - * @author Thomas Pornin - */ - -#ifndef SPH_BMW_H__ -#define SPH_BMW_H__ - -#include -#include "sph_types.h" - -/** - * Output size (in bits) for BMW-224. - */ -#define SPH_SIZE_bmw224 224 - -/** - * Output size (in bits) for BMW-256. - */ -#define SPH_SIZE_bmw256 256 - -#if SPH_64 - -/** - * Output size (in bits) for BMW-384. - */ -#define SPH_SIZE_bmw384 384 - -/** - * Output size (in bits) for BMW-512. - */ -#define SPH_SIZE_bmw512 512 - -#endif - -/** - * This structure is a context for BMW-224 and BMW-256 computations: - * it contains the intermediate values and some data from the last - * entered block. Once a BMW computation has been performed, the - * context can be reused for another computation. - * - * The contents of this structure are private. A running BMW - * computation can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[64]; /* first field, for alignment */ - size_t ptr; - sph_u32 H[16]; -#if SPH_64 - sph_u64 bit_count; -#else - sph_u32 bit_count_high, bit_count_low; -#endif -#endif -} sph_bmw_small_context; - -/** - * This structure is a context for BMW-224 computations. It is - * identical to the common sph_bmw_small_context. - */ -typedef sph_bmw_small_context sph_bmw224_context; - -/** - * This structure is a context for BMW-256 computations. It is - * identical to the common sph_bmw_small_context. - */ -typedef sph_bmw_small_context sph_bmw256_context; - -#if SPH_64 - -/** - * This structure is a context for BMW-384 and BMW-512 computations: - * it contains the intermediate values and some data from the last - * entered block. Once a BMW computation has been performed, the - * context can be reused for another computation. - * - * The contents of this structure are private. A running BMW - * computation can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[128]; /* first field, for alignment */ - size_t ptr; - sph_u64 H[16]; - sph_u64 bit_count; -#endif -} sph_bmw_big_context; - -/** - * This structure is a context for BMW-384 computations. It is - * identical to the common sph_bmw_small_context. - */ -typedef sph_bmw_big_context sph_bmw384_context; - -/** - * This structure is a context for BMW-512 computations. It is - * identical to the common sph_bmw_small_context. - */ -typedef sph_bmw_big_context sph_bmw512_context; - -#endif - -/** - * Initialize a BMW-224 context. This process performs no memory allocation. - * - * @param cc the BMW-224 context (pointer to a - * sph_bmw224_context) - */ -void sph_bmw224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the BMW-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_bmw224(void *cc, const void *data, size_t len); - -/** - * Terminate the current BMW-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the BMW-224 context - * @param dst the destination buffer - */ -void sph_bmw224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the BMW-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_bmw224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a BMW-256 context. This process performs no memory allocation. - * - * @param cc the BMW-256 context (pointer to a - * sph_bmw256_context) - */ -void sph_bmw256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the BMW-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_bmw256(void *cc, const void *data, size_t len); - -/** - * Terminate the current BMW-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the BMW-256 context - * @param dst the destination buffer - */ -void sph_bmw256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the BMW-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_bmw256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#if SPH_64 - -/** - * Initialize a BMW-384 context. This process performs no memory allocation. - * - * @param cc the BMW-384 context (pointer to a - * sph_bmw384_context) - */ -void sph_bmw384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the BMW-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_bmw384(void *cc, const void *data, size_t len); - -/** - * Terminate the current BMW-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the BMW-384 context - * @param dst the destination buffer - */ -void sph_bmw384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the BMW-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_bmw384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a BMW-512 context. This process performs no memory allocation. - * - * @param cc the BMW-512 context (pointer to a - * sph_bmw512_context) - */ -void sph_bmw512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the BMW-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_bmw512(void *cc, const void *data, size_t len); - -/** - * Terminate the current BMW-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the BMW-512 context - * @param dst the destination buffer - */ -void sph_bmw512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the BMW-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_bmw512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#endif - -#endif diff --git a/sph/sph_cubehash.h b/sph/sph_cubehash.h deleted file mode 100644 index 487a1946..00000000 --- a/sph/sph_cubehash.h +++ /dev/null @@ -1,292 +0,0 @@ -/* $Id: sph_cubehash.h 180 2010-05-08 02:29:25Z tp $ */ -/** - * CubeHash interface. CubeHash is a family of functions which differ by - * their output size; this implementation defines CubeHash for output - * sizes 224, 256, 384 and 512 bits, with the "standard parameters" - * (CubeHash16/32 with the CubeHash specification notations). - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_cubehash.h - * @author Thomas Pornin - */ - -#ifndef SPH_CUBEHASH_H__ -#define SPH_CUBEHASH_H__ - -#ifdef __cplusplus -extern "C"{ -#endif - -#include -#include "sph_types.h" - -/** - * Output size (in bits) for CubeHash-224. - */ -#define SPH_SIZE_cubehash224 224 - -/** - * Output size (in bits) for CubeHash-256. - */ -#define SPH_SIZE_cubehash256 256 - -/** - * Output size (in bits) for CubeHash-384. - */ -#define SPH_SIZE_cubehash384 384 - -/** - * Output size (in bits) for CubeHash-512. - */ -#define SPH_SIZE_cubehash512 512 - -/** - * This structure is a context for CubeHash computations: it contains the - * intermediate values and some data from the last entered block. Once - * a CubeHash computation has been performed, the context can be reused for - * another computation. - * - * The contents of this structure are private. A running CubeHash computation - * can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[32]; /* first field, for alignment */ - size_t ptr; - sph_u32 state[32]; -#endif -} sph_cubehash_context; - -/** - * Type for a CubeHash-224 context (identical to the common context). - */ -typedef sph_cubehash_context sph_cubehash224_context; - -/** - * Type for a CubeHash-256 context (identical to the common context). - */ -typedef sph_cubehash_context sph_cubehash256_context; - -/** - * Type for a CubeHash-384 context (identical to the common context). - */ -typedef sph_cubehash_context sph_cubehash384_context; - -/** - * Type for a CubeHash-512 context (identical to the common context). - */ -typedef sph_cubehash_context sph_cubehash512_context; - -/** - * Initialize a CubeHash-224 context. This process performs no memory - * allocation. - * - * @param cc the CubeHash-224 context (pointer to a - * sph_cubehash224_context) - */ -void sph_cubehash224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the CubeHash-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_cubehash224(void *cc, const void *data, size_t len); - -/** - * Terminate the current CubeHash-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the CubeHash-224 context - * @param dst the destination buffer - */ -void sph_cubehash224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the CubeHash-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_cubehash224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a CubeHash-256 context. This process performs no memory - * allocation. - * - * @param cc the CubeHash-256 context (pointer to a - * sph_cubehash256_context) - */ -void sph_cubehash256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the CubeHash-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_cubehash256(void *cc, const void *data, size_t len); - -/** - * Terminate the current CubeHash-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the CubeHash-256 context - * @param dst the destination buffer - */ -void sph_cubehash256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the CubeHash-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_cubehash256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a CubeHash-384 context. This process performs no memory - * allocation. - * - * @param cc the CubeHash-384 context (pointer to a - * sph_cubehash384_context) - */ -void sph_cubehash384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the CubeHash-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_cubehash384(void *cc, const void *data, size_t len); - -/** - * Terminate the current CubeHash-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the CubeHash-384 context - * @param dst the destination buffer - */ -void sph_cubehash384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the CubeHash-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_cubehash384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a CubeHash-512 context. This process performs no memory - * allocation. - * - * @param cc the CubeHash-512 context (pointer to a - * sph_cubehash512_context) - */ -void sph_cubehash512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the CubeHash-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_cubehash512(void *cc, const void *data, size_t len); - -/** - * Terminate the current CubeHash-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the CubeHash-512 context - * @param dst the destination buffer - */ -void sph_cubehash512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the CubeHash-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_cubehash512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/sph/sph_echo.h b/sph/sph_echo.h deleted file mode 100644 index 1ae1e3dd..00000000 --- a/sph/sph_echo.h +++ /dev/null @@ -1,320 +0,0 @@ -/* $Id: sph_echo.h 216 2010-06-08 09:46:57Z tp $ */ -/** - * ECHO interface. ECHO is a family of functions which differ by - * their output size; this implementation defines ECHO for output - * sizes 224, 256, 384 and 512 bits. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_echo.h - * @author Thomas Pornin - */ - -#ifndef SPH_ECHO_H__ -#define SPH_ECHO_H__ - -#ifdef __cplusplus -extern "C"{ -#endif - -#include -#include "sph_types.h" - -/** - * Output size (in bits) for ECHO-224. - */ -#define SPH_SIZE_echo224 224 - -/** - * Output size (in bits) for ECHO-256. - */ -#define SPH_SIZE_echo256 256 - -/** - * Output size (in bits) for ECHO-384. - */ -#define SPH_SIZE_echo384 384 - -/** - * Output size (in bits) for ECHO-512. - */ -#define SPH_SIZE_echo512 512 - -/** - * This structure is a context for ECHO computations: it contains the - * intermediate values and some data from the last entered block. Once - * an ECHO computation has been performed, the context can be reused for - * another computation. This specific structure is used for ECHO-224 - * and ECHO-256. - * - * The contents of this structure are private. A running ECHO computation - * can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[192]; /* first field, for alignment */ - size_t ptr; - union { - sph_u32 Vs[4][4]; -#if SPH_64 - sph_u64 Vb[4][2]; -#endif - } u; - sph_u32 C0, C1, C2, C3; -#endif -} sph_echo_small_context; - -/** - * This structure is a context for ECHO computations: it contains the - * intermediate values and some data from the last entered block. Once - * an ECHO computation has been performed, the context can be reused for - * another computation. This specific structure is used for ECHO-384 - * and ECHO-512. - * - * The contents of this structure are private. A running ECHO computation - * can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[128]; /* first field, for alignment */ - size_t ptr; - union { - sph_u32 Vs[8][4]; -#if SPH_64 - sph_u64 Vb[8][2]; -#endif - } u; - sph_u32 C0, C1, C2, C3; -#endif -} sph_echo_big_context; - -/** - * Type for a ECHO-224 context (identical to the common "small" context). - */ -typedef sph_echo_small_context sph_echo224_context; - -/** - * Type for a ECHO-256 context (identical to the common "small" context). - */ -typedef sph_echo_small_context sph_echo256_context; - -/** - * Type for a ECHO-384 context (identical to the common "big" context). - */ -typedef sph_echo_big_context sph_echo384_context; - -/** - * Type for a ECHO-512 context (identical to the common "big" context). - */ -typedef sph_echo_big_context sph_echo512_context; - -/** - * Initialize an ECHO-224 context. This process performs no memory allocation. - * - * @param cc the ECHO-224 context (pointer to a - * sph_echo224_context) - */ -void sph_echo224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the ECHO-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_echo224(void *cc, const void *data, size_t len); - -/** - * Terminate the current ECHO-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the ECHO-224 context - * @param dst the destination buffer - */ -void sph_echo224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the ECHO-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_echo224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize an ECHO-256 context. This process performs no memory allocation. - * - * @param cc the ECHO-256 context (pointer to a - * sph_echo256_context) - */ -void sph_echo256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the ECHO-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_echo256(void *cc, const void *data, size_t len); - -/** - * Terminate the current ECHO-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the ECHO-256 context - * @param dst the destination buffer - */ -void sph_echo256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the ECHO-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_echo256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize an ECHO-384 context. This process performs no memory allocation. - * - * @param cc the ECHO-384 context (pointer to a - * sph_echo384_context) - */ -void sph_echo384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the ECHO-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_echo384(void *cc, const void *data, size_t len); - -/** - * Terminate the current ECHO-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the ECHO-384 context - * @param dst the destination buffer - */ -void sph_echo384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the ECHO-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_echo384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize an ECHO-512 context. This process performs no memory allocation. - * - * @param cc the ECHO-512 context (pointer to a - * sph_echo512_context) - */ -void sph_echo512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the ECHO-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_echo512(void *cc, const void *data, size_t len); - -/** - * Terminate the current ECHO-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the ECHO-512 context - * @param dst the destination buffer - */ -void sph_echo512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the ECHO-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_echo512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/sph/sph_fugue.h b/sph/sph_fugue.h deleted file mode 100644 index c8ff395e..00000000 --- a/sph/sph_fugue.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef SPH_FUGUE_H__ -#define SPH_FUGUE_H__ - -#include -#include "sph_types.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -#define SPH_SIZE_fugue224 224 - -#define SPH_SIZE_fugue256 256 - -#define SPH_SIZE_fugue384 384 - -#define SPH_SIZE_fugue512 512 - -typedef struct { -#ifndef DOXYGEN_IGNORE - sph_u32 partial; - unsigned partial_len; - unsigned round_shift; - sph_u32 S[36]; -#if SPH_64 - sph_u64 bit_count; -#else - sph_u32 bit_count_high, bit_count_low; -#endif -#endif -} sph_fugue_context; - -typedef sph_fugue_context sph_fugue224_context; - -typedef sph_fugue_context sph_fugue256_context; - -typedef sph_fugue_context sph_fugue384_context; - -typedef sph_fugue_context sph_fugue512_context; - -void sph_fugue224_init(void *cc); - -void sph_fugue224(void *cc, const void *data, size_t len); - -void sph_fugue224_close(void *cc, void *dst); - -void sph_fugue224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -void sph_fugue256_init(void *cc); - -void sph_fugue256(void *cc, const void *data, size_t len); - -void sph_fugue256_close(void *cc, void *dst); - -void sph_fugue256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -void sph_fugue384_init(void *cc); - -void sph_fugue384(void *cc, const void *data, size_t len); - -void sph_fugue384_close(void *cc, void *dst); - -void sph_fugue384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -void sph_fugue512_init(void *cc); - -void sph_fugue512(void *cc, const void *data, size_t len); - -void sph_fugue512_close(void *cc, void *dst); - -void sph_fugue512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/sph/sph_groestl.h b/sph/sph_groestl.h deleted file mode 100644 index 495f05e2..00000000 --- a/sph/sph_groestl.h +++ /dev/null @@ -1,329 +0,0 @@ -/* $Id: sph_groestl.h 216 2010-06-08 09:46:57Z tp $ */ -/** - * Groestl interface. This code implements Groestl with the recommended - * parameters for SHA-3, with outputs of 224, 256, 384 and 512 bits. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_groestl.h - * @author Thomas Pornin - */ - -#ifndef SPH_GROESTL_H__ -#define SPH_GROESTL_H__ - -#ifdef __cplusplus -extern "C"{ -#endif - -#include -#include "sph_types.h" - -/** - * Output size (in bits) for Groestl-224. - */ -#define SPH_SIZE_groestl224 224 - -/** - * Output size (in bits) for Groestl-256. - */ -#define SPH_SIZE_groestl256 256 - -/** - * Output size (in bits) for Groestl-384. - */ -#define SPH_SIZE_groestl384 384 - -/** - * Output size (in bits) for Groestl-512. - */ -#define SPH_SIZE_groestl512 512 - -/** - * This structure is a context for Groestl-224 and Groestl-256 computations: - * it contains the intermediate values and some data from the last - * entered block. Once a Groestl computation has been performed, the - * context can be reused for another computation. - * - * The contents of this structure are private. A running Groestl - * computation can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[64]; /* first field, for alignment */ - size_t ptr; - union { -#if SPH_64 - sph_u64 wide[8]; -#endif - sph_u32 narrow[16]; - } state; -#if SPH_64 - sph_u64 count; -#else - sph_u32 count_high, count_low; -#endif -#endif -} sph_groestl_small_context; - -/** - * This structure is a context for Groestl-224 computations. It is - * identical to the common sph_groestl_small_context. - */ -typedef sph_groestl_small_context sph_groestl224_context; - -/** - * This structure is a context for Groestl-256 computations. It is - * identical to the common sph_groestl_small_context. - */ -typedef sph_groestl_small_context sph_groestl256_context; - -/** - * This structure is a context for Groestl-384 and Groestl-512 computations: - * it contains the intermediate values and some data from the last - * entered block. Once a Groestl computation has been performed, the - * context can be reused for another computation. - * - * The contents of this structure are private. A running Groestl - * computation can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[128]; /* first field, for alignment */ - size_t ptr; - union { -#if SPH_64 - sph_u64 wide[16]; -#endif - sph_u32 narrow[32]; - } state; -#if SPH_64 - sph_u64 count; -#else - sph_u32 count_high, count_low; -#endif -#endif -} sph_groestl_big_context; - -/** - * This structure is a context for Groestl-384 computations. It is - * identical to the common sph_groestl_small_context. - */ -typedef sph_groestl_big_context sph_groestl384_context; - -/** - * This structure is a context for Groestl-512 computations. It is - * identical to the common sph_groestl_small_context. - */ -typedef sph_groestl_big_context sph_groestl512_context; - -/** - * Initialize a Groestl-224 context. This process performs no memory allocation. - * - * @param cc the Groestl-224 context (pointer to a - * sph_groestl224_context) - */ -void sph_groestl224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Groestl-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_groestl224(void *cc, const void *data, size_t len); - -/** - * Terminate the current Groestl-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the Groestl-224 context - * @param dst the destination buffer - */ -void sph_groestl224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Groestl-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_groestl224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Groestl-256 context. This process performs no memory allocation. - * - * @param cc the Groestl-256 context (pointer to a - * sph_groestl256_context) - */ -void sph_groestl256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Groestl-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_groestl256(void *cc, const void *data, size_t len); - -/** - * Terminate the current Groestl-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the Groestl-256 context - * @param dst the destination buffer - */ -void sph_groestl256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Groestl-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_groestl256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Groestl-384 context. This process performs no memory allocation. - * - * @param cc the Groestl-384 context (pointer to a - * sph_groestl384_context) - */ -void sph_groestl384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Groestl-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_groestl384(void *cc, const void *data, size_t len); - -/** - * Terminate the current Groestl-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the Groestl-384 context - * @param dst the destination buffer - */ -void sph_groestl384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Groestl-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_groestl384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Groestl-512 context. This process performs no memory allocation. - * - * @param cc the Groestl-512 context (pointer to a - * sph_groestl512_context) - */ -void sph_groestl512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Groestl-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_groestl512(void *cc, const void *data, size_t len); - -/** - * Terminate the current Groestl-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the Groestl-512 context - * @param dst the destination buffer - */ -void sph_groestl512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Groestl-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_groestl512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/sph/sph_hamsi.h b/sph/sph_hamsi.h deleted file mode 100644 index b2cba309..00000000 --- a/sph/sph_hamsi.h +++ /dev/null @@ -1,321 +0,0 @@ -/* $Id: sph_hamsi.h 216 2010-06-08 09:46:57Z tp $ */ -/** - * Hamsi interface. This code implements Hamsi with the recommended - * parameters for SHA-3, with outputs of 224, 256, 384 and 512 bits. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_hamsi.h - * @author Thomas Pornin - */ - -#ifndef SPH_HAMSI_H__ -#define SPH_HAMSI_H__ - -#include -#include "sph_types.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -/** - * Output size (in bits) for Hamsi-224. - */ -#define SPH_SIZE_hamsi224 224 - -/** - * Output size (in bits) for Hamsi-256. - */ -#define SPH_SIZE_hamsi256 256 - -/** - * Output size (in bits) for Hamsi-384. - */ -#define SPH_SIZE_hamsi384 384 - -/** - * Output size (in bits) for Hamsi-512. - */ -#define SPH_SIZE_hamsi512 512 - -/** - * This structure is a context for Hamsi-224 and Hamsi-256 computations: - * it contains the intermediate values and some data from the last - * entered block. Once a Hamsi computation has been performed, the - * context can be reused for another computation. - * - * The contents of this structure are private. A running Hamsi - * computation can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char partial[4]; - size_t partial_len; - sph_u32 h[8]; -#if SPH_64 - sph_u64 count; -#else - sph_u32 count_high, count_low; -#endif -#endif -} sph_hamsi_small_context; - -/** - * This structure is a context for Hamsi-224 computations. It is - * identical to the common sph_hamsi_small_context. - */ -typedef sph_hamsi_small_context sph_hamsi224_context; - -/** - * This structure is a context for Hamsi-256 computations. It is - * identical to the common sph_hamsi_small_context. - */ -typedef sph_hamsi_small_context sph_hamsi256_context; - -/** - * This structure is a context for Hamsi-384 and Hamsi-512 computations: - * it contains the intermediate values and some data from the last - * entered block. Once a Hamsi computation has been performed, the - * context can be reused for another computation. - * - * The contents of this structure are private. A running Hamsi - * computation can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char partial[8]; - size_t partial_len; - sph_u32 h[16]; -#if SPH_64 - sph_u64 count; -#else - sph_u32 count_high, count_low; -#endif -#endif -} sph_hamsi_big_context; - -/** - * This structure is a context for Hamsi-384 computations. It is - * identical to the common sph_hamsi_small_context. - */ -typedef sph_hamsi_big_context sph_hamsi384_context; - -/** - * This structure is a context for Hamsi-512 computations. It is - * identical to the common sph_hamsi_small_context. - */ -typedef sph_hamsi_big_context sph_hamsi512_context; - -/** - * Initialize a Hamsi-224 context. This process performs no memory allocation. - * - * @param cc the Hamsi-224 context (pointer to a - * sph_hamsi224_context) - */ -void sph_hamsi224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Hamsi-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_hamsi224(void *cc, const void *data, size_t len); - -/** - * Terminate the current Hamsi-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the Hamsi-224 context - * @param dst the destination buffer - */ -void sph_hamsi224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Hamsi-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_hamsi224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Hamsi-256 context. This process performs no memory allocation. - * - * @param cc the Hamsi-256 context (pointer to a - * sph_hamsi256_context) - */ -void sph_hamsi256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Hamsi-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_hamsi256(void *cc, const void *data, size_t len); - -/** - * Terminate the current Hamsi-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the Hamsi-256 context - * @param dst the destination buffer - */ -void sph_hamsi256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Hamsi-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_hamsi256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Hamsi-384 context. This process performs no memory allocation. - * - * @param cc the Hamsi-384 context (pointer to a - * sph_hamsi384_context) - */ -void sph_hamsi384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Hamsi-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_hamsi384(void *cc, const void *data, size_t len); - -/** - * Terminate the current Hamsi-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the Hamsi-384 context - * @param dst the destination buffer - */ -void sph_hamsi384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Hamsi-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_hamsi384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Hamsi-512 context. This process performs no memory allocation. - * - * @param cc the Hamsi-512 context (pointer to a - * sph_hamsi512_context) - */ -void sph_hamsi512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Hamsi-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_hamsi512(void *cc, const void *data, size_t len); - -/** - * Terminate the current Hamsi-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the Hamsi-512 context - * @param dst the destination buffer - */ -void sph_hamsi512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Hamsi-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_hamsi512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/sph/sph_haval.h b/sph/sph_haval.h deleted file mode 100644 index 409daaf4..00000000 --- a/sph/sph_haval.h +++ /dev/null @@ -1,976 +0,0 @@ -/* $Id: sph_haval.h 218 2010-06-08 17:06:34Z tp $ */ -/** - * HAVAL interface. - * - * HAVAL is actually a family of 15 hash functions, depending on whether - * the internal computation uses 3, 4 or 5 passes, and on the output - * length, which is 128, 160, 192, 224 or 256 bits. This implementation - * provides interface functions for all 15, which internally map to - * three cores (depending on the number of passes). Note that output - * lengths other than 256 bits are not obtained by a simple truncation - * of a longer result; the requested length is encoded within the - * padding data. - * - * HAVAL was published in: Yuliang Zheng, Josef Pieprzyk and Jennifer - * Seberry: "HAVAL -- a one-way hashing algorithm with variable length - * of output", Advances in Cryptology -- AUSCRYPT'92, Lecture Notes in - * Computer Science, Vol.718, pp.83-104, Springer-Verlag, 1993. - * - * This paper, and a reference implementation, are available on the - * Calyptix web site: http://labs.calyptix.com/haval.php - * - * The HAVAL reference paper is quite unclear on the data encoding - * details, i.e. endianness (both byte order within a 32-bit word, and - * word order within a message block). This implementation has been - * made compatible with the reference implementation referenced above. - * - * @warning A collision for HAVAL-128/3 (HAVAL with three passes and - * 128-bit output) has been published; this function is thus considered - * as cryptographically broken. The status for other variants is unclear; - * use only with care. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_haval.h - * @author Thomas Pornin - */ - -#ifndef SPH_HAVAL_H__ -#define SPH_HAVAL_H__ - -#ifdef __cplusplus -extern "C"{ -#endif - -#include -#include "sph_types.h" - -/** - * Output size (in bits) for HAVAL-128/3. - */ -#define SPH_SIZE_haval128_3 128 - -/** - * Output size (in bits) for HAVAL-128/4. - */ -#define SPH_SIZE_haval128_4 128 - -/** - * Output size (in bits) for HAVAL-128/5. - */ -#define SPH_SIZE_haval128_5 128 - -/** - * Output size (in bits) for HAVAL-160/3. - */ -#define SPH_SIZE_haval160_3 160 - -/** - * Output size (in bits) for HAVAL-160/4. - */ -#define SPH_SIZE_haval160_4 160 - -/** - * Output size (in bits) for HAVAL-160/5. - */ -#define SPH_SIZE_haval160_5 160 - -/** - * Output size (in bits) for HAVAL-192/3. - */ -#define SPH_SIZE_haval192_3 192 - -/** - * Output size (in bits) for HAVAL-192/4. - */ -#define SPH_SIZE_haval192_4 192 - -/** - * Output size (in bits) for HAVAL-192/5. - */ -#define SPH_SIZE_haval192_5 192 - -/** - * Output size (in bits) for HAVAL-224/3. - */ -#define SPH_SIZE_haval224_3 224 - -/** - * Output size (in bits) for HAVAL-224/4. - */ -#define SPH_SIZE_haval224_4 224 - -/** - * Output size (in bits) for HAVAL-224/5. - */ -#define SPH_SIZE_haval224_5 224 - -/** - * Output size (in bits) for HAVAL-256/3. - */ -#define SPH_SIZE_haval256_3 256 - -/** - * Output size (in bits) for HAVAL-256/4. - */ -#define SPH_SIZE_haval256_4 256 - -/** - * Output size (in bits) for HAVAL-256/5. - */ -#define SPH_SIZE_haval256_5 256 - -/** - * This structure is a context for HAVAL computations: it contains the - * intermediate values and some data from the last entered block. Once - * a HAVAL computation has been performed, the context can be reused for - * another computation. - * - * The contents of this structure are private. A running HAVAL computation - * can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[128]; /* first field, for alignment */ - sph_u32 s0, s1, s2, s3, s4, s5, s6, s7; - unsigned olen, passes; -#if SPH_64 - sph_u64 count; -#else - sph_u32 count_high, count_low; -#endif -#endif -} sph_haval_context; - -/** - * Type for a HAVAL-128/3 context (identical to the common context). - */ -typedef sph_haval_context sph_haval128_3_context; - -/** - * Type for a HAVAL-128/4 context (identical to the common context). - */ -typedef sph_haval_context sph_haval128_4_context; - -/** - * Type for a HAVAL-128/5 context (identical to the common context). - */ -typedef sph_haval_context sph_haval128_5_context; - -/** - * Type for a HAVAL-160/3 context (identical to the common context). - */ -typedef sph_haval_context sph_haval160_3_context; - -/** - * Type for a HAVAL-160/4 context (identical to the common context). - */ -typedef sph_haval_context sph_haval160_4_context; - -/** - * Type for a HAVAL-160/5 context (identical to the common context). - */ -typedef sph_haval_context sph_haval160_5_context; - -/** - * Type for a HAVAL-192/3 context (identical to the common context). - */ -typedef sph_haval_context sph_haval192_3_context; - -/** - * Type for a HAVAL-192/4 context (identical to the common context). - */ -typedef sph_haval_context sph_haval192_4_context; - -/** - * Type for a HAVAL-192/5 context (identical to the common context). - */ -typedef sph_haval_context sph_haval192_5_context; - -/** - * Type for a HAVAL-224/3 context (identical to the common context). - */ -typedef sph_haval_context sph_haval224_3_context; - -/** - * Type for a HAVAL-224/4 context (identical to the common context). - */ -typedef sph_haval_context sph_haval224_4_context; - -/** - * Type for a HAVAL-224/5 context (identical to the common context). - */ -typedef sph_haval_context sph_haval224_5_context; - -/** - * Type for a HAVAL-256/3 context (identical to the common context). - */ -typedef sph_haval_context sph_haval256_3_context; - -/** - * Type for a HAVAL-256/4 context (identical to the common context). - */ -typedef sph_haval_context sph_haval256_4_context; - -/** - * Type for a HAVAL-256/5 context (identical to the common context). - */ -typedef sph_haval_context sph_haval256_5_context; - -/** - * Initialize the context for HAVAL-128/3. - * - * @param cc context to initialize (pointer to a - * sph_haval128_3_context structure) - */ -void sph_haval128_3_init(void *cc); - -/** - * Process some data bytes for HAVAL-128/3. If len is 0, - * then this function does nothing. - * - * @param cc the HAVAL-128/3 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_haval128_3(void *cc, const void *data, size_t len); - -/** - * Close a HAVAL-128/3 computation. The output buffer must be wide - * enough to accomodate the result (16 bytes). The context is automatically - * reinitialized. - * - * @param cc the HAVAL-128/3 context - * @param dst the output buffer - */ -void sph_haval128_3_close(void *cc, void *dst); - -/** - * Close a HAVAL-128/3 computation. Up to 7 extra input bits may be added - * to the input message; these are the n upper bits of - * the ub byte (i.e. the first extra bit has value 128 in - * ub, the second extra bit has value 64, and so on). Other - * bits in ub are ignored. - * - * The output buffer must be wide enough to accomodate the result (16 - * bytes). The context is automatically reinitialized. - * - * @param cc the HAVAL-128/3 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the output buffer - */ -void sph_haval128_3_addbits_and_close(void *cc, - unsigned ub, unsigned n, void *dst); - -/** - * Initialize the context for HAVAL-128/4. - * - * @param cc context to initialize (pointer to a - * sph_haval128_4_context structure) - */ -void sph_haval128_4_init(void *cc); - -/** - * Process some data bytes for HAVAL-128/4. If len is 0, - * then this function does nothing. - * - * @param cc the HAVAL-128/4 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_haval128_4(void *cc, const void *data, size_t len); - -/** - * Close a HAVAL-128/4 computation. The output buffer must be wide - * enough to accomodate the result (16 bytes). The context is automatically - * reinitialized. - * - * @param cc the HAVAL-128/4 context - * @param dst the output buffer - */ -void sph_haval128_4_close(void *cc, void *dst); - -/** - * Close a HAVAL-128/4 computation. Up to 7 extra input bits may be added - * to the input message; these are the n upper bits of - * the ub byte (i.e. the first extra bit has value 128 in - * ub, the second extra bit has value 64, and so on). Other - * bits in ub are ignored. - * - * The output buffer must be wide enough to accomodate the result (16 - * bytes). The context is automatically reinitialized. - * - * @param cc the HAVAL-128/4 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the output buffer - */ -void sph_haval128_4_addbits_and_close(void *cc, - unsigned ub, unsigned n, void *dst); - -/** - * Initialize the context for HAVAL-128/5. - * - * @param cc context to initialize (pointer to a - * sph_haval128_5_context structure) - */ -void sph_haval128_5_init(void *cc); - -/** - * Process some data bytes for HAVAL-128/5. If len is 0, - * then this function does nothing. - * - * @param cc the HAVAL-128/5 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_haval128_5(void *cc, const void *data, size_t len); - -/** - * Close a HAVAL-128/5 computation. The output buffer must be wide - * enough to accomodate the result (16 bytes). The context is automatically - * reinitialized. - * - * @param cc the HAVAL-128/5 context - * @param dst the output buffer - */ -void sph_haval128_5_close(void *cc, void *dst); - -/** - * Close a HAVAL-128/5 computation. Up to 7 extra input bits may be added - * to the input message; these are the n upper bits of - * the ub byte (i.e. the first extra bit has value 128 in - * ub, the second extra bit has value 64, and so on). Other - * bits in ub are ignored. - * - * The output buffer must be wide enough to accomodate the result (16 - * bytes). The context is automatically reinitialized. - * - * @param cc the HAVAL-128/5 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the output buffer - */ -void sph_haval128_5_addbits_and_close(void *cc, - unsigned ub, unsigned n, void *dst); - -/** - * Initialize the context for HAVAL-160/3. - * - * @param cc context to initialize (pointer to a - * sph_haval160_3_context structure) - */ -void sph_haval160_3_init(void *cc); - -/** - * Process some data bytes for HAVAL-160/3. If len is 0, - * then this function does nothing. - * - * @param cc the HAVAL-160/3 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_haval160_3(void *cc, const void *data, size_t len); - -/** - * Close a HAVAL-160/3 computation. The output buffer must be wide - * enough to accomodate the result (20 bytes). The context is automatically - * reinitialized. - * - * @param cc the HAVAL-160/3 context - * @param dst the output buffer - */ -void sph_haval160_3_close(void *cc, void *dst); - -/** - * Close a HAVAL-160/3 computation. Up to 7 extra input bits may be added - * to the input message; these are the n upper bits of - * the ub byte (i.e. the first extra bit has value 128 in - * ub, the second extra bit has value 64, and so on). Other - * bits in ub are ignored. - * - * The output buffer must be wide enough to accomodate the result (20 - * bytes). The context is automatically reinitialized. - * - * @param cc the HAVAL-160/3 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the output buffer - */ -void sph_haval160_3_addbits_and_close(void *cc, - unsigned ub, unsigned n, void *dst); - -/** - * Initialize the context for HAVAL-160/4. - * - * @param cc context to initialize (pointer to a - * sph_haval160_4_context structure) - */ -void sph_haval160_4_init(void *cc); - -/** - * Process some data bytes for HAVAL-160/4. If len is 0, - * then this function does nothing. - * - * @param cc the HAVAL-160/4 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_haval160_4(void *cc, const void *data, size_t len); - -/** - * Close a HAVAL-160/4 computation. The output buffer must be wide - * enough to accomodate the result (20 bytes). The context is automatically - * reinitialized. - * - * @param cc the HAVAL-160/4 context - * @param dst the output buffer - */ -void sph_haval160_4_close(void *cc, void *dst); - -/** - * Close a HAVAL-160/4 computation. Up to 7 extra input bits may be added - * to the input message; these are the n upper bits of - * the ub byte (i.e. the first extra bit has value 128 in - * ub, the second extra bit has value 64, and so on). Other - * bits in ub are ignored. - * - * The output buffer must be wide enough to accomodate the result (20 - * bytes). The context is automatically reinitialized. - * - * @param cc the HAVAL-160/4 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the output buffer - */ -void sph_haval160_3_addbits_and_close(void *cc, - unsigned ub, unsigned n, void *dst); - -/** - * Initialize the context for HAVAL-160/5. - * - * @param cc context to initialize (pointer to a - * sph_haval160_5_context structure) - */ -void sph_haval160_5_init(void *cc); - -/** - * Process some data bytes for HAVAL-160/5. If len is 0, - * then this function does nothing. - * - * @param cc the HAVAL-160/5 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_haval160_5(void *cc, const void *data, size_t len); - -/** - * Close a HAVAL-160/5 computation. The output buffer must be wide - * enough to accomodate the result (20 bytes). The context is automatically - * reinitialized. - * - * @param cc the HAVAL-160/5 context - * @param dst the output buffer - */ -void sph_haval160_5_close(void *cc, void *dst); - -/** - * Close a HAVAL-160/5 computation. Up to 7 extra input bits may be added - * to the input message; these are the n upper bits of - * the ub byte (i.e. the first extra bit has value 128 in - * ub, the second extra bit has value 64, and so on). Other - * bits in ub are ignored. - * - * The output buffer must be wide enough to accomodate the result (20 - * bytes). The context is automatically reinitialized. - * - * @param cc the HAVAL-160/5 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the output buffer - */ -void sph_haval160_5_addbits_and_close(void *cc, - unsigned ub, unsigned n, void *dst); - -/** - * Initialize the context for HAVAL-192/3. - * - * @param cc context to initialize (pointer to a - * sph_haval192_3_context structure) - */ -void sph_haval192_3_init(void *cc); - -/** - * Process some data bytes for HAVAL-192/3. If len is 0, - * then this function does nothing. - * - * @param cc the HAVAL-192/3 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_haval192_3(void *cc, const void *data, size_t len); - -/** - * Close a HAVAL-192/3 computation. The output buffer must be wide - * enough to accomodate the result (24 bytes). The context is automatically - * reinitialized. - * - * @param cc the HAVAL-192/3 context - * @param dst the output buffer - */ -void sph_haval192_3_close(void *cc, void *dst); - -/** - * Close a HAVAL-192/3 computation. Up to 7 extra input bits may be added - * to the input message; these are the n upper bits of - * the ub byte (i.e. the first extra bit has value 128 in - * ub, the second extra bit has value 64, and so on). Other - * bits in ub are ignored. - * - * The output buffer must be wide enough to accomodate the result (24 - * bytes). The context is automatically reinitialized. - * - * @param cc the HAVAL-192/3 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the output buffer - */ -void sph_haval192_3_addbits_and_close(void *cc, - unsigned ub, unsigned n, void *dst); - -/** - * Initialize the context for HAVAL-192/4. - * - * @param cc context to initialize (pointer to a - * sph_haval192_4_context structure) - */ -void sph_haval192_4_init(void *cc); - -/** - * Process some data bytes for HAVAL-192/4. If len is 0, - * then this function does nothing. - * - * @param cc the HAVAL-192/4 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_haval192_4(void *cc, const void *data, size_t len); - -/** - * Close a HAVAL-192/4 computation. The output buffer must be wide - * enough to accomodate the result (24 bytes). The context is automatically - * reinitialized. - * - * @param cc the HAVAL-192/4 context - * @param dst the output buffer - */ -void sph_haval192_4_close(void *cc, void *dst); - -/** - * Close a HAVAL-192/4 computation. Up to 7 extra input bits may be added - * to the input message; these are the n upper bits of - * the ub byte (i.e. the first extra bit has value 128 in - * ub, the second extra bit has value 64, and so on). Other - * bits in ub are ignored. - * - * The output buffer must be wide enough to accomodate the result (24 - * bytes). The context is automatically reinitialized. - * - * @param cc the HAVAL-192/4 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the output buffer - */ -void sph_haval192_4_addbits_and_close(void *cc, - unsigned ub, unsigned n, void *dst); - -/** - * Initialize the context for HAVAL-192/5. - * - * @param cc context to initialize (pointer to a - * sph_haval192_5_context structure) - */ -void sph_haval192_5_init(void *cc); - -/** - * Process some data bytes for HAVAL-192/5. If len is 0, - * then this function does nothing. - * - * @param cc the HAVAL-192/5 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_haval192_5(void *cc, const void *data, size_t len); - -/** - * Close a HAVAL-192/5 computation. The output buffer must be wide - * enough to accomodate the result (24 bytes). The context is automatically - * reinitialized. - * - * @param cc the HAVAL-192/5 context - * @param dst the output buffer - */ -void sph_haval192_5_close(void *cc, void *dst); - -/** - * Close a HAVAL-192/5 computation. Up to 7 extra input bits may be added - * to the input message; these are the n upper bits of - * the ub byte (i.e. the first extra bit has value 128 in - * ub, the second extra bit has value 64, and so on). Other - * bits in ub are ignored. - * - * The output buffer must be wide enough to accomodate the result (24 - * bytes). The context is automatically reinitialized. - * - * @param cc the HAVAL-192/5 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the output buffer - */ -void sph_haval192_5_addbits_and_close(void *cc, - unsigned ub, unsigned n, void *dst); - -/** - * Initialize the context for HAVAL-224/3. - * - * @param cc context to initialize (pointer to a - * sph_haval224_3_context structure) - */ -void sph_haval224_3_init(void *cc); - -/** - * Process some data bytes for HAVAL-224/3. If len is 0, - * then this function does nothing. - * - * @param cc the HAVAL-224/3 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_haval224_3(void *cc, const void *data, size_t len); - -/** - * Close a HAVAL-224/3 computation. The output buffer must be wide - * enough to accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the HAVAL-224/3 context - * @param dst the output buffer - */ -void sph_haval224_3_close(void *cc, void *dst); - -/** - * Close a HAVAL-224/3 computation. Up to 7 extra input bits may be added - * to the input message; these are the n upper bits of - * the ub byte (i.e. the first extra bit has value 128 in - * ub, the second extra bit has value 64, and so on). Other - * bits in ub are ignored. - * - * The output buffer must be wide enough to accomodate the result (28 - * bytes). The context is automatically reinitialized. - * - * @param cc the HAVAL-224/3 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the output buffer - */ -void sph_haval224_3_addbits_and_close(void *cc, - unsigned ub, unsigned n, void *dst); - -/** - * Initialize the context for HAVAL-224/4. - * - * @param cc context to initialize (pointer to a - * sph_haval224_4_context structure) - */ -void sph_haval224_4_init(void *cc); - -/** - * Process some data bytes for HAVAL-224/4. If len is 0, - * then this function does nothing. - * - * @param cc the HAVAL-224/4 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_haval224_4(void *cc, const void *data, size_t len); - -/** - * Close a HAVAL-224/4 computation. The output buffer must be wide - * enough to accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the HAVAL-224/4 context - * @param dst the output buffer - */ -void sph_haval224_4_close(void *cc, void *dst); - -/** - * Close a HAVAL-224/4 computation. Up to 7 extra input bits may be added - * to the input message; these are the n upper bits of - * the ub byte (i.e. the first extra bit has value 128 in - * ub, the second extra bit has value 64, and so on). Other - * bits in ub are ignored. - * - * The output buffer must be wide enough to accomodate the result (28 - * bytes). The context is automatically reinitialized. - * - * @param cc the HAVAL-224/4 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the output buffer - */ -void sph_haval224_4_addbits_and_close(void *cc, - unsigned ub, unsigned n, void *dst); - -/** - * Initialize the context for HAVAL-224/5. - * - * @param cc context to initialize (pointer to a - * sph_haval224_5_context structure) - */ -void sph_haval224_5_init(void *cc); - -/** - * Process some data bytes for HAVAL-224/5. If len is 0, - * then this function does nothing. - * - * @param cc the HAVAL-224/5 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_haval224_5(void *cc, const void *data, size_t len); - -/** - * Close a HAVAL-224/5 computation. The output buffer must be wide - * enough to accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the HAVAL-224/5 context - * @param dst the output buffer - */ -void sph_haval224_5_close(void *cc, void *dst); - -/** - * Close a HAVAL-224/5 computation. Up to 7 extra input bits may be added - * to the input message; these are the n upper bits of - * the ub byte (i.e. the first extra bit has value 128 in - * ub, the second extra bit has value 64, and so on). Other - * bits in ub are ignored. - * - * The output buffer must be wide enough to accomodate the result (28 - * bytes). The context is automatically reinitialized. - * - * @param cc the HAVAL-224/5 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the output buffer - */ -void sph_haval224_5_addbits_and_close(void *cc, - unsigned ub, unsigned n, void *dst); - -/** - * Initialize the context for HAVAL-256/3. - * - * @param cc context to initialize (pointer to a - * sph_haval256_3_context structure) - */ -void sph_haval256_3_init(void *cc); - -/** - * Process some data bytes for HAVAL-256/3. If len is 0, - * then this function does nothing. - * - * @param cc the HAVAL-256/3 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_haval256_3(void *cc, const void *data, size_t len); - -/** - * Close a HAVAL-256/3 computation. The output buffer must be wide - * enough to accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the HAVAL-256/3 context - * @param dst the output buffer - */ -void sph_haval256_3_close(void *cc, void *dst); - -/** - * Close a HAVAL-256/3 computation. Up to 7 extra input bits may be added - * to the input message; these are the n upper bits of - * the ub byte (i.e. the first extra bit has value 128 in - * ub, the second extra bit has value 64, and so on). Other - * bits in ub are ignored. - * - * The output buffer must be wide enough to accomodate the result (32 - * bytes). The context is automatically reinitialized. - * - * @param cc the HAVAL-256/3 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the output buffer - */ -void sph_haval256_3_addbits_and_close(void *cc, - unsigned ub, unsigned n, void *dst); - -/** - * Initialize the context for HAVAL-256/4. - * - * @param cc context to initialize (pointer to a - * sph_haval256_4_context structure) - */ -void sph_haval256_4_init(void *cc); - -/** - * Process some data bytes for HAVAL-256/4. If len is 0, - * then this function does nothing. - * - * @param cc the HAVAL-256/4 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_haval256_4(void *cc, const void *data, size_t len); - -/** - * Close a HAVAL-256/4 computation. The output buffer must be wide - * enough to accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the HAVAL-256/4 context - * @param dst the output buffer - */ -void sph_haval256_4_close(void *cc, void *dst); - -/** - * Close a HAVAL-256/4 computation. Up to 7 extra input bits may be added - * to the input message; these are the n upper bits of - * the ub byte (i.e. the first extra bit has value 128 in - * ub, the second extra bit has value 64, and so on). Other - * bits in ub are ignored. - * - * The output buffer must be wide enough to accomodate the result (32 - * bytes). The context is automatically reinitialized. - * - * @param cc the HAVAL-256/4 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the output buffer - */ -void sph_haval256_4_addbits_and_close(void *cc, - unsigned ub, unsigned n, void *dst); - -/** - * Initialize the context for HAVAL-256/5. - * - * @param cc context to initialize (pointer to a - * sph_haval256_5_context structure) - */ -void sph_haval256_5_init(void *cc); - -/** - * Process some data bytes for HAVAL-256/5. If len is 0, - * then this function does nothing. - * - * @param cc the HAVAL-256/5 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_haval256_5(void *cc, const void *data, size_t len); - -/** - * Close a HAVAL-256/5 computation. The output buffer must be wide - * enough to accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the HAVAL-256/5 context - * @param dst the output buffer - */ -void sph_haval256_5_close(void *cc, void *dst); - -/** - * Close a HAVAL-256/5 computation. Up to 7 extra input bits may be added - * to the input message; these are the n upper bits of - * the ub byte (i.e. the first extra bit has value 128 in - * ub, the second extra bit has value 64, and so on). Other - * bits in ub are ignored. - * - * The output buffer must be wide enough to accomodate the result (32 - * bytes). The context is automatically reinitialized. - * - * @param cc the HAVAL-256/5 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the output buffer - */ -void sph_haval256_5_addbits_and_close(void *cc, - unsigned ub, unsigned n, void *dst); - -/** - * Apply the HAVAL compression function on the provided data. The - * msg parameter contains the 32 32-bit input blocks, - * as numerical values (hence after the little-endian decoding). The - * val parameter contains the 8 32-bit input blocks for - * the compression function; the output is written in place in this - * array. This function uses three internal passes. - * - * @param msg the message block (32 values) - * @param val the function 256-bit input and output - */ -void sph_haval_3_comp(const sph_u32 msg[32], sph_u32 val[8]); - -/** - * Apply the HAVAL compression function on the provided data. The - * msg parameter contains the 32 32-bit input blocks, - * as numerical values (hence after the little-endian decoding). The - * val parameter contains the 8 32-bit input blocks for - * the compression function; the output is written in place in this - * array. This function uses four internal passes. - * - * @param msg the message block (32 values) - * @param val the function 256-bit input and output - */ -void sph_haval_4_comp(const sph_u32 msg[32], sph_u32 val[8]); - -/** - * Apply the HAVAL compression function on the provided data. The - * msg parameter contains the 32 32-bit input blocks, - * as numerical values (hence after the little-endian decoding). The - * val parameter contains the 8 32-bit input blocks for - * the compression function; the output is written in place in this - * array. This function uses five internal passes. - * - * @param msg the message block (32 values) - * @param val the function 256-bit input and output - */ -void sph_haval_5_comp(const sph_u32 msg[32], sph_u32 val[8]); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/sph/sph_jh.h b/sph/sph_jh.h deleted file mode 100644 index 02684061..00000000 --- a/sph/sph_jh.h +++ /dev/null @@ -1,290 +0,0 @@ -/* $Id: sph_jh.h 216 2010-06-08 09:46:57Z tp $ */ -/** - * JH interface. JH is a family of functions which differ by - * their output size; this implementation defines JH for output - * sizes 224, 256, 384 and 512 bits. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_jh.h - * @author Thomas Pornin - */ - -#ifndef SPH_JH_H__ -#define SPH_JH_H__ - -#include -#include "sph_types.h" - -/** - * Output size (in bits) for JH-224. - */ -#define SPH_SIZE_jh224 224 - -/** - * Output size (in bits) for JH-256. - */ -#define SPH_SIZE_jh256 256 - -/** - * Output size (in bits) for JH-384. - */ -#define SPH_SIZE_jh384 384 - -/** - * Output size (in bits) for JH-512. - */ -#define SPH_SIZE_jh512 512 - -/** - * This structure is a context for JH computations: it contains the - * intermediate values and some data from the last entered block. Once - * a JH computation has been performed, the context can be reused for - * another computation. - * - * The contents of this structure are private. A running JH computation - * can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[64]; /* first field, for alignment */ - size_t ptr; - union { -#if SPH_64 - sph_u64 wide[16]; -#endif - sph_u32 narrow[32]; - } H; -#if SPH_64 - sph_u64 block_count; -#else - sph_u32 block_count_high, block_count_low; -#endif -#endif -} sph_jh_context; - -/** - * Type for a JH-224 context (identical to the common context). - */ -typedef sph_jh_context sph_jh224_context; - -/** - * Type for a JH-256 context (identical to the common context). - */ -typedef sph_jh_context sph_jh256_context; - -/** - * Type for a JH-384 context (identical to the common context). - */ -typedef sph_jh_context sph_jh384_context; - -/** - * Type for a JH-512 context (identical to the common context). - */ -typedef sph_jh_context sph_jh512_context; - -/** - * Initialize a JH-224 context. This process performs no memory allocation. - * - * @param cc the JH-224 context (pointer to a - * sph_jh224_context) - */ -void sph_jh224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the JH-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_jh224(void *cc, const void *data, size_t len); - -/** - * Terminate the current JH-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the JH-224 context - * @param dst the destination buffer - */ -void sph_jh224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the JH-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_jh224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a JH-256 context. This process performs no memory allocation. - * - * @param cc the JH-256 context (pointer to a - * sph_jh256_context) - */ -void sph_jh256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the JH-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_jh256(void *cc, const void *data, size_t len); - -/** - * Terminate the current JH-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the JH-256 context - * @param dst the destination buffer - */ -void sph_jh256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the JH-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_jh256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a JH-384 context. This process performs no memory allocation. - * - * @param cc the JH-384 context (pointer to a - * sph_jh384_context) - */ -void sph_jh384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the JH-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_jh384(void *cc, const void *data, size_t len); - -/** - * Terminate the current JH-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the JH-384 context - * @param dst the destination buffer - */ -void sph_jh384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the JH-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_jh384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a JH-512 context. This process performs no memory allocation. - * - * @param cc the JH-512 context (pointer to a - * sph_jh512_context) - */ -void sph_jh512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the JH-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_jh512(void *cc, const void *data, size_t len); - -/** - * Terminate the current JH-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the JH-512 context - * @param dst the destination buffer - */ -void sph_jh512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the JH-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_jh512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#endif diff --git a/sph/sph_luffa.h b/sph/sph_luffa.h deleted file mode 100644 index a32fd7b1..00000000 --- a/sph/sph_luffa.h +++ /dev/null @@ -1,296 +0,0 @@ -/* $Id: sph_luffa.h 154 2010-04-26 17:00:24Z tp $ */ -/** - * Luffa interface. Luffa is a family of functions which differ by - * their output size; this implementation defines Luffa for output - * sizes 224, 256, 384 and 512 bits. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_luffa.h - * @author Thomas Pornin - */ - -#ifndef SPH_LUFFA_H__ -#define SPH_LUFFA_H__ - -#ifdef __cplusplus -extern "C"{ -#endif - -#include -#include "sph_types.h" - -/** - * Output size (in bits) for Luffa-224. - */ -#define SPH_SIZE_luffa224 224 - -/** - * Output size (in bits) for Luffa-256. - */ -#define SPH_SIZE_luffa256 256 - -/** - * Output size (in bits) for Luffa-384. - */ -#define SPH_SIZE_luffa384 384 - -/** - * Output size (in bits) for Luffa-512. - */ -#define SPH_SIZE_luffa512 512 - -/** - * This structure is a context for Luffa-224 computations: it contains - * the intermediate values and some data from the last entered block. - * Once a Luffa computation has been performed, the context can be - * reused for another computation. - * - * The contents of this structure are private. A running Luffa - * computation can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[32]; /* first field, for alignment */ - size_t ptr; - sph_u32 V[3][8]; -#endif -} sph_luffa224_context; - -/** - * This structure is a context for Luffa-256 computations. It is - * identical to sph_luffa224_context. - */ -typedef sph_luffa224_context sph_luffa256_context; - -/** - * This structure is a context for Luffa-384 computations. - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[32]; /* first field, for alignment */ - size_t ptr; - sph_u32 V[4][8]; -#endif -} sph_luffa384_context; - -/** - * This structure is a context for Luffa-512 computations. - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[32]; /* first field, for alignment */ - size_t ptr; - sph_u32 V[5][8]; -#endif -} sph_luffa512_context; - -/** - * Initialize a Luffa-224 context. This process performs no memory allocation. - * - * @param cc the Luffa-224 context (pointer to a - * sph_luffa224_context) - */ -void sph_luffa224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Luffa-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_luffa224(void *cc, const void *data, size_t len); - -/** - * Terminate the current Luffa-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the Luffa-224 context - * @param dst the destination buffer - */ -void sph_luffa224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Luffa-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_luffa224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Luffa-256 context. This process performs no memory allocation. - * - * @param cc the Luffa-256 context (pointer to a - * sph_luffa256_context) - */ -void sph_luffa256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Luffa-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_luffa256(void *cc, const void *data, size_t len); - -/** - * Terminate the current Luffa-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the Luffa-256 context - * @param dst the destination buffer - */ -void sph_luffa256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Luffa-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_luffa256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Luffa-384 context. This process performs no memory allocation. - * - * @param cc the Luffa-384 context (pointer to a - * sph_luffa384_context) - */ -void sph_luffa384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Luffa-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_luffa384(void *cc, const void *data, size_t len); - -/** - * Terminate the current Luffa-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the Luffa-384 context - * @param dst the destination buffer - */ -void sph_luffa384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Luffa-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_luffa384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Luffa-512 context. This process performs no memory allocation. - * - * @param cc the Luffa-512 context (pointer to a - * sph_luffa512_context) - */ -void sph_luffa512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Luffa-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_luffa512(void *cc, const void *data, size_t len); - -/** - * Terminate the current Luffa-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the Luffa-512 context - * @param dst the destination buffer - */ -void sph_luffa512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Luffa-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_luffa512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/sph/sph_ripemd.h b/sph/sph_ripemd.h deleted file mode 100644 index f1f0982f..00000000 --- a/sph/sph_ripemd.h +++ /dev/null @@ -1,273 +0,0 @@ -/* $Id: sph_ripemd.h 216 2010-06-08 09:46:57Z tp $ */ -/** - * RIPEMD, RIPEMD-128 and RIPEMD-160 interface. - * - * RIPEMD was first described in: Research and Development in Advanced - * Communication Technologies in Europe, "RIPE Integrity Primitives: - * Final Report of RACE Integrity Primitives Evaluation (R1040)", RACE, - * June 1992. - * - * A new, strengthened version, dubbed RIPEMD-160, was published in: H. - * Dobbertin, A. Bosselaers, and B. Preneel, "RIPEMD-160, a strengthened - * version of RIPEMD", Fast Software Encryption - FSE'96, LNCS 1039, - * Springer (1996), pp. 71--82. - * - * This article describes both RIPEMD-160, with a 160-bit output, and a - * reduced version called RIPEMD-128, which has a 128-bit output. RIPEMD-128 - * was meant as a "drop-in" replacement for any hash function with 128-bit - * output, especially the original RIPEMD. - * - * @warning Collisions, and an efficient method to build other collisions, - * have been published for the original RIPEMD, which is thus considered as - * cryptographically broken. It is also very rarely encountered, and there - * seems to exist no free description or implementation of RIPEMD (except - * the sphlib code, of course). As of january 2007, RIPEMD-128 and RIPEMD-160 - * seem as secure as their output length allows. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_ripemd.h - * @author Thomas Pornin - */ - -#ifndef SPH_RIPEMD_H__ -#define SPH_RIPEMD_H__ - -#include -#include "sph_types.h" - -/** - * Output size (in bits) for RIPEMD. - */ -#define SPH_SIZE_ripemd 128 - -/** - * Output size (in bits) for RIPEMD-128. - */ -#define SPH_SIZE_ripemd128 128 - -/** - * Output size (in bits) for RIPEMD-160. - */ -#define SPH_SIZE_ripemd160 160 - -/** - * This structure is a context for RIPEMD computations: it contains the - * intermediate values and some data from the last entered block. Once - * a RIPEMD computation has been performed, the context can be reused for - * another computation. - * - * The contents of this structure are private. A running RIPEMD computation - * can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[64]; /* first field, for alignment */ - sph_u32 val[4]; -#if SPH_64 - sph_u64 count; -#else - sph_u32 count_high, count_low; -#endif -#endif -} sph_ripemd_context; - -/** - * Initialize a RIPEMD context. This process performs no memory allocation. - * - * @param cc the RIPEMD context (pointer to - * a sph_ripemd_context) - */ -void sph_ripemd_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the RIPEMD context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_ripemd(void *cc, const void *data, size_t len); - -/** - * Terminate the current RIPEMD computation and output the result into the - * provided buffer. The destination buffer must be wide enough to - * accomodate the result (16 bytes). The context is automatically - * reinitialized. - * - * @param cc the RIPEMD context - * @param dst the destination buffer - */ -void sph_ripemd_close(void *cc, void *dst); - -/** - * Apply the RIPEMD compression function on the provided data. The - * msg parameter contains the 16 32-bit input blocks, - * as numerical values (hence after the little-endian decoding). The - * val parameter contains the 5 32-bit input blocks for - * the compression function; the output is written in place in this - * array. - * - * @param msg the message block (16 values) - * @param val the function 128-bit input and output - */ -void sph_ripemd_comp(const sph_u32 msg[16], sph_u32 val[4]); - -/* ===================================================================== */ - -/** - * This structure is a context for RIPEMD-128 computations: it contains the - * intermediate values and some data from the last entered block. Once - * a RIPEMD-128 computation has been performed, the context can be reused for - * another computation. - * - * The contents of this structure are private. A running RIPEMD-128 computation - * can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[64]; /* first field, for alignment */ - sph_u32 val[4]; -#if SPH_64 - sph_u64 count; -#else - sph_u32 count_high, count_low; -#endif -#endif -} sph_ripemd128_context; - -/** - * Initialize a RIPEMD-128 context. This process performs no memory allocation. - * - * @param cc the RIPEMD-128 context (pointer to - * a sph_ripemd128_context) - */ -void sph_ripemd128_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the RIPEMD-128 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_ripemd128(void *cc, const void *data, size_t len); - -/** - * Terminate the current RIPEMD-128 computation and output the result into the - * provided buffer. The destination buffer must be wide enough to - * accomodate the result (16 bytes). The context is automatically - * reinitialized. - * - * @param cc the RIPEMD-128 context - * @param dst the destination buffer - */ -void sph_ripemd128_close(void *cc, void *dst); - -/** - * Apply the RIPEMD-128 compression function on the provided data. The - * msg parameter contains the 16 32-bit input blocks, - * as numerical values (hence after the little-endian decoding). The - * val parameter contains the 5 32-bit input blocks for - * the compression function; the output is written in place in this - * array. - * - * @param msg the message block (16 values) - * @param val the function 128-bit input and output - */ -void sph_ripemd128_comp(const sph_u32 msg[16], sph_u32 val[4]); - -/* ===================================================================== */ - -/** - * This structure is a context for RIPEMD-160 computations: it contains the - * intermediate values and some data from the last entered block. Once - * a RIPEMD-160 computation has been performed, the context can be reused for - * another computation. - * - * The contents of this structure are private. A running RIPEMD-160 computation - * can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[64]; /* first field, for alignment */ - sph_u32 val[5]; -#if SPH_64 - sph_u64 count; -#else - sph_u32 count_high, count_low; -#endif -#endif -} sph_ripemd160_context; - -/** - * Initialize a RIPEMD-160 context. This process performs no memory allocation. - * - * @param cc the RIPEMD-160 context (pointer to - * a sph_ripemd160_context) - */ -void sph_ripemd160_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the RIPEMD-160 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_ripemd160(void *cc, const void *data, size_t len); - -/** - * Terminate the current RIPEMD-160 computation and output the result into the - * provided buffer. The destination buffer must be wide enough to - * accomodate the result (20 bytes). The context is automatically - * reinitialized. - * - * @param cc the RIPEMD-160 context - * @param dst the destination buffer - */ -void sph_ripemd160_close(void *cc, void *dst); - -/** - * Apply the RIPEMD-160 compression function on the provided data. The - * msg parameter contains the 16 32-bit input blocks, - * as numerical values (hence after the little-endian decoding). The - * val parameter contains the 5 32-bit input blocks for - * the compression function; the output is written in place in this - * array. - * - * @param msg the message block (16 values) - * @param val the function 160-bit input and output - */ -void sph_ripemd160_comp(const sph_u32 msg[16], sph_u32 val[5]); - -#endif diff --git a/sph/sph_shabal.h b/sph/sph_shabal.h deleted file mode 100644 index 08aa5f73..00000000 --- a/sph/sph_shabal.h +++ /dev/null @@ -1,344 +0,0 @@ -/* $Id: sph_shabal.h 175 2010-05-07 16:03:20Z tp $ */ -/** - * Shabal interface. Shabal is a family of functions which differ by - * their output size; this implementation defines Shabal for output - * sizes 192, 224, 256, 384 and 512 bits. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_shabal.h - * @author Thomas Pornin - */ - -#ifndef SPH_SHABAL_H__ -#define SPH_SHABAL_H__ - -#ifdef __cplusplus -extern "C"{ -#endif - -#include -#include "sph_types.h" - -/** - * Output size (in bits) for Shabal-192. - */ -#define SPH_SIZE_shabal192 192 - -/** - * Output size (in bits) for Shabal-224. - */ -#define SPH_SIZE_shabal224 224 - -/** - * Output size (in bits) for Shabal-256. - */ -#define SPH_SIZE_shabal256 256 - -/** - * Output size (in bits) for Shabal-384. - */ -#define SPH_SIZE_shabal384 384 - -/** - * Output size (in bits) for Shabal-512. - */ -#define SPH_SIZE_shabal512 512 - -/** - * This structure is a context for Shabal computations: it contains the - * intermediate values and some data from the last entered block. Once - * a Shabal computation has been performed, the context can be reused for - * another computation. - * - * The contents of this structure are private. A running Shabal computation - * can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[64]; /* first field, for alignment */ - size_t ptr; - sph_u32 A[12], B[16], C[16]; - sph_u32 Whigh, Wlow; -#endif -} sph_shabal_context; - -/** - * Type for a Shabal-192 context (identical to the common context). - */ -typedef sph_shabal_context sph_shabal192_context; - -/** - * Type for a Shabal-224 context (identical to the common context). - */ -typedef sph_shabal_context sph_shabal224_context; - -/** - * Type for a Shabal-256 context (identical to the common context). - */ -typedef sph_shabal_context sph_shabal256_context; - -/** - * Type for a Shabal-384 context (identical to the common context). - */ -typedef sph_shabal_context sph_shabal384_context; - -/** - * Type for a Shabal-512 context (identical to the common context). - */ -typedef sph_shabal_context sph_shabal512_context; - -/** - * Initialize a Shabal-192 context. This process performs no memory allocation. - * - * @param cc the Shabal-192 context (pointer to a - * sph_shabal192_context) - */ -void sph_shabal192_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Shabal-192 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_shabal192(void *cc, const void *data, size_t len); - -/** - * Terminate the current Shabal-192 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (24 bytes). The context is automatically - * reinitialized. - * - * @param cc the Shabal-192 context - * @param dst the destination buffer - */ -void sph_shabal192_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (24 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Shabal-192 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_shabal192_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Shabal-224 context. This process performs no memory allocation. - * - * @param cc the Shabal-224 context (pointer to a - * sph_shabal224_context) - */ -void sph_shabal224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Shabal-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_shabal224(void *cc, const void *data, size_t len); - -/** - * Terminate the current Shabal-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the Shabal-224 context - * @param dst the destination buffer - */ -void sph_shabal224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Shabal-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_shabal224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Shabal-256 context. This process performs no memory allocation. - * - * @param cc the Shabal-256 context (pointer to a - * sph_shabal256_context) - */ -void sph_shabal256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Shabal-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_shabal256(void *cc, const void *data, size_t len); - -/** - * Terminate the current Shabal-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the Shabal-256 context - * @param dst the destination buffer - */ -void sph_shabal256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Shabal-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_shabal256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Shabal-384 context. This process performs no memory allocation. - * - * @param cc the Shabal-384 context (pointer to a - * sph_shabal384_context) - */ -void sph_shabal384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Shabal-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_shabal384(void *cc, const void *data, size_t len); - -/** - * Terminate the current Shabal-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the Shabal-384 context - * @param dst the destination buffer - */ -void sph_shabal384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Shabal-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_shabal384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Shabal-512 context. This process performs no memory allocation. - * - * @param cc the Shabal-512 context (pointer to a - * sph_shabal512_context) - */ -void sph_shabal512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Shabal-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_shabal512(void *cc, const void *data, size_t len); - -/** - * Terminate the current Shabal-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the Shabal-512 context - * @param dst the destination buffer - */ -void sph_shabal512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Shabal-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_shabal512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/sph/sph_shavite.h b/sph/sph_shavite.h deleted file mode 100644 index 0957e42a..00000000 --- a/sph/sph_shavite.h +++ /dev/null @@ -1,314 +0,0 @@ -/* $Id: sph_shavite.h 208 2010-06-02 20:33:00Z tp $ */ -/** - * SHAvite-3 interface. This code implements SHAvite-3 with the - * recommended parameters for SHA-3, with outputs of 224, 256, 384 and - * 512 bits. In the following, we call the function "SHAvite" (without - * the "-3" suffix), thus "SHAvite-224" is "SHAvite-3 with a 224-bit - * output". - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_shavite.h - * @author Thomas Pornin - */ - -#ifndef SPH_SHAVITE_H__ -#define SPH_SHAVITE_H__ - -#include -#include "sph_types.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -/** - * Output size (in bits) for SHAvite-224. - */ -#define SPH_SIZE_shavite224 224 - -/** - * Output size (in bits) for SHAvite-256. - */ -#define SPH_SIZE_shavite256 256 - -/** - * Output size (in bits) for SHAvite-384. - */ -#define SPH_SIZE_shavite384 384 - -/** - * Output size (in bits) for SHAvite-512. - */ -#define SPH_SIZE_shavite512 512 - -/** - * This structure is a context for SHAvite-224 and SHAvite-256 computations: - * it contains the intermediate values and some data from the last - * entered block. Once a SHAvite computation has been performed, the - * context can be reused for another computation. - * - * The contents of this structure are private. A running SHAvite - * computation can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[64]; /* first field, for alignment */ - size_t ptr; - sph_u32 h[8]; - sph_u32 count0, count1; -#endif -} sph_shavite_small_context; - -/** - * This structure is a context for SHAvite-224 computations. It is - * identical to the common sph_shavite_small_context. - */ -typedef sph_shavite_small_context sph_shavite224_context; - -/** - * This structure is a context for SHAvite-256 computations. It is - * identical to the common sph_shavite_small_context. - */ -typedef sph_shavite_small_context sph_shavite256_context; - -/** - * This structure is a context for SHAvite-384 and SHAvite-512 computations: - * it contains the intermediate values and some data from the last - * entered block. Once a SHAvite computation has been performed, the - * context can be reused for another computation. - * - * The contents of this structure are private. A running SHAvite - * computation can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[128]; /* first field, for alignment */ - size_t ptr; - sph_u32 h[16]; - sph_u32 count0, count1, count2, count3; -#endif -} sph_shavite_big_context; - -/** - * This structure is a context for SHAvite-384 computations. It is - * identical to the common sph_shavite_small_context. - */ -typedef sph_shavite_big_context sph_shavite384_context; - -/** - * This structure is a context for SHAvite-512 computations. It is - * identical to the common sph_shavite_small_context. - */ -typedef sph_shavite_big_context sph_shavite512_context; - -/** - * Initialize a SHAvite-224 context. This process performs no memory allocation. - * - * @param cc the SHAvite-224 context (pointer to a - * sph_shavite224_context) - */ -void sph_shavite224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the SHAvite-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_shavite224(void *cc, const void *data, size_t len); - -/** - * Terminate the current SHAvite-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the SHAvite-224 context - * @param dst the destination buffer - */ -void sph_shavite224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the SHAvite-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_shavite224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a SHAvite-256 context. This process performs no memory allocation. - * - * @param cc the SHAvite-256 context (pointer to a - * sph_shavite256_context) - */ -void sph_shavite256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the SHAvite-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_shavite256(void *cc, const void *data, size_t len); - -/** - * Terminate the current SHAvite-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the SHAvite-256 context - * @param dst the destination buffer - */ -void sph_shavite256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the SHAvite-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_shavite256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a SHAvite-384 context. This process performs no memory allocation. - * - * @param cc the SHAvite-384 context (pointer to a - * sph_shavite384_context) - */ -void sph_shavite384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the SHAvite-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_shavite384(void *cc, const void *data, size_t len); - -/** - * Terminate the current SHAvite-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the SHAvite-384 context - * @param dst the destination buffer - */ -void sph_shavite384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the SHAvite-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_shavite384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a SHAvite-512 context. This process performs no memory allocation. - * - * @param cc the SHAvite-512 context (pointer to a - * sph_shavite512_context) - */ -void sph_shavite512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the SHAvite-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_shavite512(void *cc, const void *data, size_t len); - -/** - * Terminate the current SHAvite-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the SHAvite-512 context - * @param dst the destination buffer - */ -void sph_shavite512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the SHAvite-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_shavite512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/sph/sph_simd.h b/sph/sph_simd.h deleted file mode 100644 index 92ee1e72..00000000 --- a/sph/sph_simd.h +++ /dev/null @@ -1,309 +0,0 @@ -/* $Id: sph_simd.h 154 2010-04-26 17:00:24Z tp $ */ -/** - * SIMD interface. SIMD is a family of functions which differ by - * their output size; this implementation defines SIMD for output - * sizes 224, 256, 384 and 512 bits. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_simd.h - * @author Thomas Pornin - */ - -#ifndef SPH_SIMD_H__ -#define SPH_SIMD_H__ - -#ifdef __cplusplus -extern "C"{ -#endif - -#include -#include "sph_types.h" - -/** - * Output size (in bits) for SIMD-224. - */ -#define SPH_SIZE_simd224 224 - -/** - * Output size (in bits) for SIMD-256. - */ -#define SPH_SIZE_simd256 256 - -/** - * Output size (in bits) for SIMD-384. - */ -#define SPH_SIZE_simd384 384 - -/** - * Output size (in bits) for SIMD-512. - */ -#define SPH_SIZE_simd512 512 - -/** - * This structure is a context for SIMD computations: it contains the - * intermediate values and some data from the last entered block. Once - * an SIMD computation has been performed, the context can be reused for - * another computation. This specific structure is used for SIMD-224 - * and SIMD-256. - * - * The contents of this structure are private. A running SIMD computation - * can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[64]; /* first field, for alignment */ - size_t ptr; - sph_u32 state[16]; - sph_u32 count_low, count_high; -#endif -} sph_simd_small_context; - -/** - * This structure is a context for SIMD computations: it contains the - * intermediate values and some data from the last entered block. Once - * an SIMD computation has been performed, the context can be reused for - * another computation. This specific structure is used for SIMD-384 - * and SIMD-512. - * - * The contents of this structure are private. A running SIMD computation - * can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[128]; /* first field, for alignment */ - size_t ptr; - sph_u32 state[32]; - sph_u32 count_low, count_high; -#endif -} sph_simd_big_context; - -/** - * Type for a SIMD-224 context (identical to the common "small" context). - */ -typedef sph_simd_small_context sph_simd224_context; - -/** - * Type for a SIMD-256 context (identical to the common "small" context). - */ -typedef sph_simd_small_context sph_simd256_context; - -/** - * Type for a SIMD-384 context (identical to the common "big" context). - */ -typedef sph_simd_big_context sph_simd384_context; - -/** - * Type for a SIMD-512 context (identical to the common "big" context). - */ -typedef sph_simd_big_context sph_simd512_context; - -/** - * Initialize an SIMD-224 context. This process performs no memory allocation. - * - * @param cc the SIMD-224 context (pointer to a - * sph_simd224_context) - */ -void sph_simd224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the SIMD-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_simd224(void *cc, const void *data, size_t len); - -/** - * Terminate the current SIMD-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the SIMD-224 context - * @param dst the destination buffer - */ -void sph_simd224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the SIMD-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_simd224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize an SIMD-256 context. This process performs no memory allocation. - * - * @param cc the SIMD-256 context (pointer to a - * sph_simd256_context) - */ -void sph_simd256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the SIMD-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_simd256(void *cc, const void *data, size_t len); - -/** - * Terminate the current SIMD-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the SIMD-256 context - * @param dst the destination buffer - */ -void sph_simd256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the SIMD-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_simd256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize an SIMD-384 context. This process performs no memory allocation. - * - * @param cc the SIMD-384 context (pointer to a - * sph_simd384_context) - */ -void sph_simd384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the SIMD-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_simd384(void *cc, const void *data, size_t len); - -/** - * Terminate the current SIMD-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the SIMD-384 context - * @param dst the destination buffer - */ -void sph_simd384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the SIMD-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_simd384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize an SIMD-512 context. This process performs no memory allocation. - * - * @param cc the SIMD-512 context (pointer to a - * sph_simd512_context) - */ -void sph_simd512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the SIMD-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_simd512(void *cc, const void *data, size_t len); - -/** - * Terminate the current SIMD-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the SIMD-512 context - * @param dst the destination buffer - */ -void sph_simd512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the SIMD-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_simd512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/sph/sph_skein.h b/sph/sph_skein.h deleted file mode 100644 index bddbc86f..00000000 --- a/sph/sph_skein.h +++ /dev/null @@ -1,298 +0,0 @@ -/* $Id: sph_skein.h 253 2011-06-07 18:33:10Z tp $ */ -/** - * Skein interface. The Skein specification defines three main - * functions, called Skein-256, Skein-512 and Skein-1024, which can be - * further parameterized with an output length. For the SHA-3 - * competition, Skein-512 is used for output sizes of 224, 256, 384 and - * 512 bits; this is what this code implements. Thus, we hereafter call - * Skein-224, Skein-256, Skein-384 and Skein-512 what the Skein - * specification defines as Skein-512-224, Skein-512-256, Skein-512-384 - * and Skein-512-512, respectively. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_skein.h - * @author Thomas Pornin - */ - -#ifndef SPH_SKEIN_H__ -#define SPH_SKEIN_H__ - -#ifdef __cplusplus -extern "C"{ -#endif - -#include -#include "sph_types.h" - -#if SPH_64 - -/** - * Output size (in bits) for Skein-224. - */ -#define SPH_SIZE_skein224 224 - -/** - * Output size (in bits) for Skein-256. - */ -#define SPH_SIZE_skein256 256 - -/** - * Output size (in bits) for Skein-384. - */ -#define SPH_SIZE_skein384 384 - -/** - * Output size (in bits) for Skein-512. - */ -#define SPH_SIZE_skein512 512 - -/** - * This structure is a context for Skein computations (with a 384- or - * 512-bit output): it contains the intermediate values and some data - * from the last entered block. Once a Skein computation has been - * performed, the context can be reused for another computation. - * - * The contents of this structure are private. A running Skein computation - * can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[64]; /* first field, for alignment */ - size_t ptr; - sph_u64 h0, h1, h2, h3, h4, h5, h6, h7; - sph_u64 bcount; -#endif -} sph_skein_big_context; - -/** - * Type for a Skein-224 context (identical to the common "big" context). - */ -typedef sph_skein_big_context sph_skein224_context; - -/** - * Type for a Skein-256 context (identical to the common "big" context). - */ -typedef sph_skein_big_context sph_skein256_context; - -/** - * Type for a Skein-384 context (identical to the common "big" context). - */ -typedef sph_skein_big_context sph_skein384_context; - -/** - * Type for a Skein-512 context (identical to the common "big" context). - */ -typedef sph_skein_big_context sph_skein512_context; - -/** - * Initialize a Skein-224 context. This process performs no memory allocation. - * - * @param cc the Skein-224 context (pointer to a - * sph_skein224_context) - */ -void sph_skein224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Skein-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_skein224(void *cc, const void *data, size_t len); - -/** - * Terminate the current Skein-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the Skein-224 context - * @param dst the destination buffer - */ -void sph_skein224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Skein-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_skein224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Skein-256 context. This process performs no memory allocation. - * - * @param cc the Skein-256 context (pointer to a - * sph_skein256_context) - */ -void sph_skein256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Skein-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_skein256(void *cc, const void *data, size_t len); - -/** - * Terminate the current Skein-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the Skein-256 context - * @param dst the destination buffer - */ -void sph_skein256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Skein-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_skein256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Skein-384 context. This process performs no memory allocation. - * - * @param cc the Skein-384 context (pointer to a - * sph_skein384_context) - */ -void sph_skein384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Skein-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_skein384(void *cc, const void *data, size_t len); - -/** - * Terminate the current Skein-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the Skein-384 context - * @param dst the destination buffer - */ -void sph_skein384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Skein-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_skein384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Skein-512 context. This process performs no memory allocation. - * - * @param cc the Skein-512 context (pointer to a - * sph_skein512_context) - */ -void sph_skein512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Skein-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_skein512(void *cc, const void *data, size_t len); - -/** - * Terminate the current Skein-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the Skein-512 context - * @param dst the destination buffer - */ -void sph_skein512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Skein-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_skein512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/sph/sph_streebog.h b/sph/sph_streebog.h deleted file mode 100644 index aa8f69d0..00000000 --- a/sph/sph_streebog.h +++ /dev/null @@ -1,185 +0,0 @@ -/* $Id: sph_gost.h 216 2010-06-08 09:46:57Z tp $ */ -/** - * GOST interface. This is the interface for GOST R 12 with the - * recommended parameters for SHA-3, with output lengths 256 - * and 512 bits. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_gost.h - * @author Mish - */ - -#ifndef SPH_GOST_H__ -#define SPH_GOST_H__ - -#ifdef __cplusplus -extern "C"{ -#endif - -#include -#include "sph_types.h" - -/** - * Output size (in bits) for GOST-256. - */ -#define SPH_SIZE_gost256 256 - -/** - * Output size (in bits) for GOST-512. - */ -#define SPH_SIZE_gost512 512 - -/** - * This structure is a context for Keccak computations: it contains the - * intermediate values and some data from the last entered block. Once a - * GOST computation has been performed, the context can be reused for - * another computation. - * - * The contents of this structure are private. A running GOST computation - * can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ - -/** - * This structure is a context for Gost-256 computations. - */ - -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[32]; /* first field, for alignment */ - size_t ptr; - sph_u32 V[3][8]; -#endif -} sph_gost256_context; - -/** - * This structure is a context for Gost-512 computations. - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[64]; /* first field, for alignment */ - size_t ptr; - sph_u32 V[5][8]; -#endif -} sph_gost512_context; - - -/** - * Initialize a GOST-256 context. This process performs no memory allocation. - * - * @param cc the GOST-256 context (pointer to a - * sph_gost256_context) - */ -void sph_gost256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Gost-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_gost256(void *cc, const void *data, size_t len); - -/** - * Terminate the current GOST-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the GOST-256 context - * @param dst the destination buffer - */ -void sph_gost256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the GOST-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_gost256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Gost-512 context. This process performs no memory allocation. - * - * @param cc the GOST-512 context (pointer to a - * sph_gost512_context) - */ -void sph_gost512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the GOST-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_gost512(void *cc, const void *data, size_t len); - -/** - * Terminate the current GOST-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the GOST-512 context - * @param dst the destination buffer - */ -void sph_gost512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the GOST-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_gost512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/sph/sph_whirlpool.h b/sph/sph_whirlpool.h deleted file mode 100644 index 493b7d79..00000000 --- a/sph/sph_whirlpool.h +++ /dev/null @@ -1,216 +0,0 @@ -/* $Id: sph_whirlpool.h 216 2010-06-08 09:46:57Z tp $ */ -/** - * WHIRLPOOL interface. - * - * WHIRLPOOL knows three variants, dubbed "WHIRLPOOL-0" (original - * version, published in 2000, studied by NESSIE), "WHIRLPOOL-1" - * (first revision, 2001, with a new S-box) and "WHIRLPOOL" (current - * version, 2003, with a new diffusion matrix, also described as "plain - * WHIRLPOOL"). All three variants are implemented here. - * - * The original WHIRLPOOL (i.e. WHIRLPOOL-0) was published in: P. S. L. - * M. Barreto, V. Rijmen, "The Whirlpool Hashing Function", First open - * NESSIE Workshop, Leuven, Belgium, November 13--14, 2000. - * - * The current WHIRLPOOL specification and a reference implementation - * can be found on the WHIRLPOOL web page: - * http://paginas.terra.com.br/informatica/paulobarreto/WhirlpoolPage.html - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_whirlpool.h - * @author Thomas Pornin - */ - -#ifndef SPH_WHIRLPOOL_H__ -#define SPH_WHIRLPOOL_H__ - -#include -#include "sph_types.h" -#ifdef __cplusplus -extern "C"{ -#endif - -#if SPH_64 - -/** - * Output size (in bits) for WHIRLPOOL. - */ -#define SPH_SIZE_whirlpool 512 - -/** - * Output size (in bits) for WHIRLPOOL-0. - */ -#define SPH_SIZE_whirlpool0 512 - -/** - * Output size (in bits) for WHIRLPOOL-1. - */ -#define SPH_SIZE_whirlpool1 512 - -/** - * This structure is a context for WHIRLPOOL computations: it contains the - * intermediate values and some data from the last entered block. Once - * a WHIRLPOOL computation has been performed, the context can be reused for - * another computation. - * - * The contents of this structure are private. A running WHIRLPOOL computation - * can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[64]; /* first field, for alignment */ - sph_u64 state[8]; -#if SPH_64 - sph_u64 count; -#else - sph_u32 count_high, count_low; -#endif -#endif -} sph_whirlpool_context; - -/** - * Initialize a WHIRLPOOL context. This process performs no memory allocation. - * - * @param cc the WHIRLPOOL context (pointer to a - * sph_whirlpool_context) - */ -void sph_whirlpool_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). This function applies the - * plain WHIRLPOOL algorithm. - * - * @param cc the WHIRLPOOL context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_whirlpool(void *cc, const void *data, size_t len); - -/** - * Terminate the current WHIRLPOOL computation and output the result into the - * provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the WHIRLPOOL context - * @param dst the destination buffer - */ -void sph_whirlpool_close(void *cc, void *dst); - -/** - * WHIRLPOOL-0 uses the same structure than plain WHIRLPOOL. - */ -typedef sph_whirlpool_context sph_whirlpool0_context; - -#ifdef DOXYGEN_IGNORE -/** - * Initialize a WHIRLPOOL-0 context. This function is identical to - * sph_whirlpool_init(). - * - * @param cc the WHIRLPOOL context (pointer to a - * sph_whirlpool0_context) - */ -void sph_whirlpool0_init(void *cc); -#endif - -#ifndef DOXYGEN_IGNORE -#define sph_whirlpool0_init sph_whirlpool_init -#endif - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). This function applies the - * WHIRLPOOL-0 algorithm. - * - * @param cc the WHIRLPOOL context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_whirlpool0(void *cc, const void *data, size_t len); - -/** - * Terminate the current WHIRLPOOL-0 computation and output the result into the - * provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the WHIRLPOOL-0 context - * @param dst the destination buffer - */ -void sph_whirlpool0_close(void *cc, void *dst); - -/** - * WHIRLPOOL-1 uses the same structure than plain WHIRLPOOL. - */ -typedef sph_whirlpool_context sph_whirlpool1_context; - -#ifdef DOXYGEN_IGNORE -/** - * Initialize a WHIRLPOOL-1 context. This function is identical to - * sph_whirlpool_init(). - * - * @param cc the WHIRLPOOL context (pointer to a - * sph_whirlpool1_context) - */ -void sph_whirlpool1_init(void *cc); -#endif - -#ifndef DOXYGEN_IGNORE -#define sph_whirlpool1_init sph_whirlpool_init -#endif - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). This function applies the - * WHIRLPOOL-1 algorithm. - * - * @param cc the WHIRLPOOL context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_whirlpool1(void *cc, const void *data, size_t len); - -/** - * Terminate the current WHIRLPOOL-1 computation and output the result into the - * provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the WHIRLPOOL-1 context - * @param dst the destination buffer - */ -void sph_whirlpool1_close(void *cc, void *dst); - -#endif - -#ifdef __cplusplus -} -#endif - -#endif \ No newline at end of file diff --git a/sph/streebog.c b/sph/streebog.c deleted file mode 100644 index dbae4e54..00000000 --- a/sph/streebog.c +++ /dev/null @@ -1,1045 +0,0 @@ -/* Streebog GOST hash function for sib algo SibCoin */ - -#include -#include -#include -#include - -#include "sph_streebog.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -//-------------------------------------------------------------------------------------------- -// -// Streebog 512 implementation -// -//-------------------------------------------------------------------------------------------- - - -// Tables for function F -static const sph_u64 TG[8][256] = {{ - 0xE6F87E5C5B711FD0,0x258377800924FA16,0xC849E07E852EA4A8,0x5B4686A18F06C16A, - 0x0B32E9A2D77B416E,0xABDA37A467815C66,0xF61796A81A686676,0xF5DC0B706391954B, - 0x4862F38DB7E64BF1,0xFF5C629A68BD85C5,0xCB827DA6FCD75795,0x66D36DAF69B9F089, - 0x356C9F74483D83B0,0x7CBCECB1238C99A1,0x36A702AC31C4708D,0x9EB6A8D02FBCDFD6, - 0x8B19FA51E5B3AE37,0x9CCFB5408A127D0B,0xBC0C78B508208F5A,0xE533E3842288ECED, - 0xCEC2C7D377C15FD2,0xEC7817B6505D0F5E,0xB94CC2C08336871D,0x8C205DB4CB0B04AD, - 0x763C855B28A0892F,0x588D1B79F6FF3257,0x3FECF69E4311933E,0x0FC0D39F803A18C9, - 0xEE010A26F5F3AD83,0x10EFE8F4411979A6,0x5DCDA10C7DE93A10,0x4A1BEE1D1248E92C, - 0x53BFF2DB21847339,0xB4F50CCFA6A23D09,0x5FB4BC9CD84798CD,0xE88A2D8B071C56F9, - 0x7F7771695A756A9C,0xC5F02E71A0BA1EBC,0xA663F9AB4215E672,0x2EB19E22DE5FBB78, - 0x0DB9CE0F2594BA14,0x82520E6397664D84,0x2F031E6A0208EA98,0x5C7F2144A1BE6BF0, - 0x7A37CB1CD16362DB,0x83E08E2B4B311C64,0xCF70479BAB960E32,0x856BA986B9DEE71E, - 0xB5478C877AF56CE9,0xB8FE42885F61D6FD,0x1BDD0156966238C8,0x622157923EF8A92E, - 0xFC97FF42114476F8,0x9D7D350856452CEB,0x4C90C9B0E0A71256,0x2308502DFBCB016C, - 0x2D7A03FAA7A64845,0xF46E8B38BFC6C4AB,0xBDBEF8FDD477DEBA,0x3AAC4CEBC8079B79, - 0xF09CB105E8879D0C,0x27FA6A10AC8A58CB,0x8960E7C1401D0CEA,0x1A6F811E4A356928, - 0x90C4FB0773D196FF,0x43501A2F609D0A9F,0xF7A516E0C63F3796,0x1CE4A6B3B8DA9252, - 0x1324752C38E08A9B,0xA5A864733BEC154F,0x2BF124575549B33F,0xD766DB15440DC5C7, - 0xA7D179E39E42B792,0xDADF151A61997FD3,0x86A0345EC0271423,0x38D5517B6DA939A4, - 0x6518F077104003B4,0x02791D90A5AEA2DD,0x88D267899C4A5D0A,0x930F66DF0A2865C2, - 0x4EE9D4204509B08B,0x325538916685292A,0x412907BFC533A842,0xB27E2B62544DC673, - 0x6C5304456295E007,0x5AF406E95351908A,0x1F2F3B6BC123616F,0xC37B09DC5255E5C6, - 0x3967D133B1FE6844,0x298839C7F0E711E2,0x409B87F71964F9A2,0xE938ADC3DB4B0719, - 0x0C0B4E47F9C3EBF4,0x5534D576D36B8843,0x4610A05AEB8B02D8,0x20C3CDF58232F251, - 0x6DE1840DBEC2B1E7,0xA0E8DE06B0FA1D08,0x7B854B540D34333B,0x42E29A67BCCA5B7F, - 0xD8A6088AC437DD0E,0xC63BB3A9D943ED81,0x21714DBD5E65A3B1,0x6761EDE7B5EEA169, - 0x2431F7C8D573ABF6,0xD51FC685E1A3671A,0x5E063CD40410C92D,0x283AB98F2CB04002, - 0x8FEBC06CB2F2F790,0x17D64F116FA1D33C,0xE07359F1A99EE4AA,0x784ED68C74CDC006, - 0x6E2A19D5C73B42DA,0x8712B4161C7045C3,0x371582E4ED93216D,0xACE390414939F6FC, - 0x7EC5F12186223B7C,0xC0B094042BAC16FB,0xF9D745379A527EBF,0x737C3F2EA3B68168, - 0x33E7B8D9BAD278CA,0xA9A32A34C22FFEBB,0xE48163CCFEDFBD0D,0x8E5940246EA5A670, - 0x51C6EF4B842AD1E4,0x22BAD065279C508C,0xD91488C218608CEE,0x319EA5491F7CDA17, - 0xD394E128134C9C60,0x094BF43272D5E3B3,0x9BF612A5A4AAD791,0xCCBBDA43D26FFD0F, - 0x34DE1F3C946AD250,0x4F5B5468995EE16B,0xDF9FAF6FEA8F7794,0x2648EA5870DD092B, - 0xBFC7E56D71D97C67,0xDDE6B2FF4F21D549,0x3C276B463AE86003,0x91767B4FAF86C71F, - 0x68A13E7835D4B9A0,0xB68C115F030C9FD4,0x141DD2C916582001,0x983D8F7DDD5324AC, - 0x64AA703FCC175254,0xC2C989948E02B426,0x3E5E76D69F46C2DE,0x50746F03587D8004, - 0x45DB3D829272F1E5,0x60584A029B560BF3,0xFBAE58A73FFCDC62,0xA15A5E4E6CAD4CE8, - 0x4BA96E55CE1FB8CC,0x08F9747AAE82B253,0xC102144CF7FB471B,0x9F042898F3EB8E36, - 0x068B27ADF2EFFB7A,0xEDCA97FE8C0A5EBE,0x778E0513F4F7D8CF,0x302C2501C32B8BF7, - 0x8D92DDFC175C554D,0xF865C57F46052F5F,0xEAF3301BA2B2F424,0xAA68B7ECBBD60D86, - 0x998F0F350104754C,0x0000000000000000,0xF12E314D34D0CCEC,0x710522BE061823B5, - 0xAF280D9930C005C1,0x97FD5CE25D693C65,0x19A41CC633CC9A15,0x95844172F8C79EB8, - 0xDC5432B7937684A9,0x9436C13A2490CF58,0x802B13F332C8EF59,0xC442AE397CED4F5C, - 0xFA1CD8EFE3AB8D82,0xF2E5AC954D293FD1,0x6AD823E8907A1B7D,0x4D2249F83CF043B6, - 0x03CB9DD879F9F33D,0xDE2D2F2736D82674,0x2A43A41F891EE2DF,0x6F98999D1B6C133A, - 0xD4AD46CD3DF436FA,0xBB35DF50269825C0,0x964FDCAA813E6D85,0xEB41B0537EE5A5C4, - 0x0540BA758B160847,0xA41AE43BE7BB44AF,0xE3B8C429D0671797,0x819993BBEE9FBEB9, - 0xAE9A8DD1EC975421,0xF3572CDD917E6E31,0x6393D7DAE2AFF8CE,0x47A2201237DC5338, - 0xA32343DEC903EE35,0x79FC56C4A89A91E6,0x01B28048DC5751E0,0x1296F564E4B7DB7B, - 0x75F7188351597A12,0xDB6D9552BDCE2E33,0x1E9DBB231D74308F,0x520D7293FDD322D9, - 0xE20A44610C304677,0xFEEEE2D2B4EAD425,0xCA30FDEE20800675,0x61EACA4A47015A13, - 0xE74AFE1487264E30,0x2CC883B27BF119A5,0x1664CF59B3F682DC,0xA811AA7C1E78AF5B, - 0x1D5626FB648DC3B2,0xB73E9117DF5BCE34,0xD05F7CF06AB56F5D,0xFD257F0ACD132718, - 0x574DC8E676C52A9E,0x0739A7E52EB8AA9A,0x5486553E0F3CD9A3,0x56FF48AEAA927B7E, - 0xBE756525AD8E2D87,0x7D0E6CF9FFDBC841,0x3B1ECCA31450CA99,0x6913BE30E983E840, - 0xAD511009956EA71C,0xB1B5B6BA2DB4354E,0x4469BDCA4E25A005,0x15AF5281CA0F71E1, - 0x744598CB8D0E2BF2,0x593F9B312AA863B7,0xEFB38A6E29A4FC63,0x6B6AA3A04C2D4A9D, - 0x3D95EB0EE6BF31E3,0xA291C3961554BFD5,0x18169C8EEF9BCBF5,0x115D68BC9D4E2846, - 0xBA875F18FACF7420,0xD1EDFCB8B6E23EBD,0xB00736F2F1E364AE,0x84D929CE6589B6FE, - 0x70B7A2F6DA4F7255,0x0E7253D75C6D4929,0x04F23A3D574159A7,0x0A8069EA0B2C108E, - 0x49D073C56BB11A11,0x8AAB7A1939E4FFD7,0xCD095A0B0E38ACEF,0xC9FB60365979F548, - 0x92BDE697D67F3422,0xC78933E10514BC61,0xE1C1D9B975C9B54A,0xD2266160CF1BCD80, - 0x9A4492ED78FD8671,0xB3CCAB2A881A9793,0x72CEBF667FE1D088,0xD6D45B5D985A9427 -},{ - 0xC811A8058C3F55DE,0x65F5B43196B50619,0xF74F96B1D6706E43,0x859D1E8BCB43D336, - 0x5AAB8A85CCFA3D84,0xF9C7BF99C295FCFD,0xA21FD5A1DE4B630F,0xCDB3EF763B8B456D, - 0x803F59F87CF7C385,0xB27C73BE5F31913C,0x98E3AC6633B04821,0xBF61674C26B8F818, - 0x0FFBC995C4C130C8,0xAAA0862010761A98,0x6057F342210116AA,0xF63C760C0654CC35, - 0x2DDB45CC667D9042,0xBCF45A964BD40382,0x68E8A0C3EF3C6F3D,0xA7BD92D269FF73BC, - 0x290AE20201ED2287,0xB7DE34CDE885818F,0xD901EEA7DD61059B,0xD6FA273219A03553, - 0xD56F1AE874CCCEC9,0xEA31245C2E83F554,0x7034555DA07BE499,0xCE26D2AC56E7BEF7, - 0xFD161857A5054E38,0x6A0E7DA4527436D1,0x5BD86A381CDE9FF2,0xCAF7756231770C32, - 0xB09AAED9E279C8D0,0x5DEF1091C60674DB,0x111046A2515E5045,0x23536CE4729802FC, - 0xC50CBCF7F5B63CFA,0x73A16887CD171F03,0x7D2941AFD9F28DBD,0x3F5E3EB45A4F3B9D, - 0x84EEFE361B677140,0x3DB8E3D3E7076271,0x1A3A28F9F20FD248,0x7EBC7C75B49E7627, - 0x74E5F293C7EB565C,0x18DCF59E4F478BA4,0x0C6EF44FA9ADCB52,0xC699812D98DAC760, - 0x788B06DC6E469D0E,0xFC65F8EA7521EC4E,0x30A5F7219E8E0B55,0x2BEC3F65BCA57B6B, - 0xDDD04969BAF1B75E,0x99904CDBE394EA57,0x14B201D1E6EA40F6,0xBBB0C08241284ADD, - 0x50F20463BF8F1DFF,0xE8D7F93B93CBACB8,0x4D8CB68E477C86E8,0xC1DD1B3992268E3F, - 0x7C5AA11209D62FCB,0x2F3D98ABDB35C9AE,0x671369562BFD5FF5,0x15C1E16C36CEE280, - 0x1D7EB2EDF8F39B17,0xDA94D37DB00DFE01,0x877BC3EC760B8ADA,0xCB8495DFE153AE44, - 0x05A24773B7B410B3,0x12857B783C32ABDF,0x8EB770D06812513B,0x536739B9D2E3E665, - 0x584D57E271B26468,0xD789C78FC9849725,0xA935BBFA7D1AE102,0x8B1537A3DFA64188, - 0xD0CD5D9BC378DE7A,0x4AC82C9A4D80CFB7,0x42777F1B83BDB620,0x72D2883A1D33BD75, - 0x5E7A2D4BAB6A8F41,0xF4DAAB6BBB1C95D9,0x905CFFE7FD8D31B6,0x83AA6422119B381F, - 0xC0AEFB8442022C49,0xA0F908C663033AE3,0xA428AF0804938826,0xADE41C341A8A53C7, - 0xAE7121EE77E6A85D,0xC47F5C4A25929E8C,0xB538E9AA55CDD863,0x06377AA9DAD8EB29, - 0xA18AE87BB3279895,0x6EDFDA6A35E48414,0x6B7D9D19825094A7,0xD41CFA55A4E86CBF, - 0xE5CAEDC9EA42C59C,0xA36C351C0E6FC179,0x5181E4DE6FABBF89,0xFFF0C530184D17D4, - 0x9D41EB1584045892,0x1C0D525028D73961,0xF178EC180CA8856A,0x9A0571018EF811CD, - 0x4091A27C3EF5EFCC,0x19AF15239F6329D2,0x347450EFF91EB990,0xE11B4A078DD27759, - 0xB9561DE5FC601331,0x912F1F5A2DA993C0,0x1654DCB65BA2191A,0x3E2DDE098A6B99EB, - 0x8A66D71E0F82E3FE,0x8C51ADB7D55A08D7,0x4533E50F8941FF7F,0x02E6DD67BD4859EC, - 0xE068AABA5DF6D52F,0xC24826E3FF4A75A5,0x6C39070D88ACDDF8,0x6486548C4691A46F, - 0xD1BEBD26135C7C0C,0xB30F93038F15334A,0x82D9849FC1BF9A69,0x9C320BA85420FAE4, - 0xFA528243AFF90767,0x9ED4D6CFE968A308,0xB825FD582C44B147,0x9B7691BC5EDCB3BB, - 0xC7EA619048FE6516,0x1063A61F817AF233,0x47D538683409A693,0x63C2CE984C6DED30, - 0x2A9FDFD86C81D91D,0x7B1E3B06032A6694,0x666089EBFBD9FD83,0x0A598EE67375207B, - 0x07449A140AFC495F,0x2CA8A571B6593234,0x1F986F8A45BBC2FB,0x381AA4A050B372C2, - 0x5423A3ADD81FAF3A,0x17273C0B8B86BB6C,0xFE83258DC869B5A2,0x287902BFD1C980F1, - 0xF5A94BD66B3837AF,0x88800A79B2CABA12,0x55504310083B0D4C,0xDF36940E07B9EEB2, - 0x04D1A7CE6790B2C5,0x612413FFF125B4DC,0x26F12B97C52C124F,0x86082351A62F28AC, - 0xEF93632F9937E5E7,0x3507B052293A1BE6,0xE72C30AE570A9C70,0xD3586041AE1425E0, - 0xDE4574B3D79D4CC4,0x92BA228040C5685A,0xF00B0CA5DC8C271C,0xBE1287F1F69C5A6E, - 0xF39E317FB1E0DC86,0x495D114020EC342D,0x699B407E3F18CD4B,0xDCA3A9D46AD51528, - 0x0D1D14F279896924,0x0000000000000000,0x593EB75FA196C61E,0x2E4E78160B116BD8, - 0x6D4AE7B058887F8E,0xE65FD013872E3E06,0x7A6DDBBBD30EC4E2,0xAC97FC89CAAEF1B1, - 0x09CCB33C1E19DBE1,0x89F3EAC462EE1864,0x7770CF49AA87ADC6,0x56C57ECA6557F6D6, - 0x03953DDA6D6CFB9A,0x36928D884456E07C,0x1EEB8F37959F608D,0x31D6179C4EAAA923, - 0x6FAC3AD7E5C02662,0x43049FA653991456,0xABD3669DC052B8EE,0xAF02C153A7C20A2B, - 0x3CCB036E3723C007,0x93C9C23D90E1CA2C,0xC33BC65E2F6ED7D3,0x4CFF56339758249E, - 0xB1E94E64325D6AA6,0x37E16D359472420A,0x79F8E661BE623F78,0x5214D90402C74413, - 0x482EF1FDF0C8965B,0x13F69BC5EC1609A9,0x0E88292814E592BE,0x4E198B542A107D72, - 0xCCC00FCBEBAFE71B,0x1B49C844222B703E,0x2564164DA840E9D5,0x20C6513E1FF4F966, - 0xBAC3203F910CE8AB,0xF2EDD1C261C47EF0,0x814CB945ACD361F3,0x95FEB8944A392105, - 0x5C9CF02C1622D6AD,0x971865F3F77178E9,0xBD87BA2B9BF0A1F4,0x444005B259655D09, - 0xED75BE48247FBC0B,0x7596122E17CFF42A,0xB44B091785E97A15,0x966B854E2755DA9F, - 0xEEE0839249134791,0x32432A4623C652B9,0xA8465B47AD3E4374,0xF8B45F2412B15E8B, - 0x2417F6F078644BA3,0xFB2162FE7FDDA511,0x4BBBCC279DA46DC1,0x0173E0BDD024A276, - 0x22208C59A2BCA08A,0x8FC4906DB836F34D,0xE4B90D743A6667EA,0x7147B5E0705F46EF, - 0x2782CB2A1508B039,0xEC065EF5F45B1E7D,0x21B5B183CFD05B10,0xDBE733C060295C77, - 0x9FA73672394C017E,0xCF55321186C31C81,0xD8720E1A0D45A7ED,0x3B8F997A3DDF8958, - 0x3AFC79C7EDFB2B2E,0xE9A4198643EF0ECE,0x5F09CDF67B4E2D37,0x4F6A6BE9FA34DF04, - 0xB6ADD47038A123F9,0x8D224D0A057EAAA1,0xC96248B85C1BF7A8,0xE3FD9760309A2EB5, - 0x0B2A6E5BA351820D,0xEB42C4E1FEA75722,0x948D58299A1D8373,0x7FCF9CC864BAD451, - 0xA55B4FB5D4B72A50,0x08BF5381CE3D7997,0x46A6D8D5E42D04E5,0xD22B80FC7E308796, - 0x57B69E77B57354A0,0x3969441D8097D0B4,0x3330CAFBF3E2F0CF,0xE28E77DDE0BE8CC3, - 0x62B12E259C494F46,0xA6CE726FB9DBD1CA,0x41E242C1EED14DBA,0x76032FF47AA30FB0 -},{ - 0x45B268A93ACDE4CC,0xAF7F0BE884549D08,0x048354B3C1468263,0x925435C2C80EFED2, - 0xEE4E37F27FDFFBA7,0x167A33920C60F14D,0xFB123B52EA03E584,0x4A0CAB53FDBB9007, - 0x9DEAF6380F788A19,0xCB48EC558F0CB32A,0xB59DC4B2D6FEF7E0,0xDCDBCA22F4F3ECB6, - 0x11DF5813549A9C40,0xE33FDEDF568ACED3,0xA0C1C8124322E9C3,0x07A56B8158FA6D0D, - 0x77279579B1E1F3DD,0xD9B18B74422AC004,0xB8EC2D9FFFABC294,0xF4ACF8A82D75914F, - 0x7BBF69B1EF2B6878,0xC4F62FAF487AC7E1,0x76CE809CC67E5D0C,0x6711D88F92E4C14C, - 0x627B99D9243DEDFE,0x234AA5C3DFB68B51,0x909B1F15262DBF6D,0x4F66EA054B62BCB5, - 0x1AE2CF5A52AA6AE8,0xBEA053FBD0CE0148,0xED6808C0E66314C9,0x43FE16CD15A82710, - 0xCD049231A06970F6,0xE7BC8A6C97CC4CB0,0x337CE835FCB3B9C0,0x65DEF2587CC780F3, - 0x52214EDE4132BB50,0x95F15E4390F493DF,0x870839625DD2E0F1,0x41313C1AFB8B66AF, - 0x91720AF051B211BC,0x477D427ED4EEA573,0x2E3B4CEEF6E3BE25,0x82627834EB0BCC43, - 0x9C03E3DD78E724C8,0x2877328AD9867DF9,0x14B51945E243B0F2,0x574B0F88F7EB97E2, - 0x88B6FA989AA4943A,0x19C4F068CB168586,0x50EE6409AF11FAEF,0x7DF317D5C04EABA4, - 0x7A567C5498B4C6A9,0xB6BBFB804F42188E,0x3CC22BCF3BC5CD0B,0xD04336EAAA397713, - 0xF02FAC1BEC33132C,0x2506DBA7F0D3488D,0xD7E65D6BF2C31A1E,0x5EB9B2161FF820F5, - 0x842E0650C46E0F9F,0x716BEB1D9E843001,0xA933758CAB315ED4,0x3FE414FDA2792265, - 0x27C9F1701EF00932,0x73A4C1CA70A771BE,0x94184BA6E76B3D0E,0x40D829FF8C14C87E, - 0x0FBEC3FAC77674CB,0x3616A9634A6A9572,0x8F139119C25EF937,0xF545ED4D5AEA3F9E, - 0xE802499650BA387B,0x6437E7BD0B582E22,0xE6559F89E053E261,0x80AD52E305288DFC, - 0x6DC55A23E34B9935,0xDE14E0F51AD0AD09,0xC6390578A659865E,0x96D7617109487CB1, - 0xE2D6CB3A21156002,0x01E915E5779FAED1,0xADB0213F6A77DCB7,0x9880B76EB9A1A6AB, - 0x5D9F8D248644CF9B,0xFD5E4536C5662658,0xF1C6B9FE9BACBDFD,0xEACD6341BE9979C4, - 0xEFA7221708405576,0x510771ECD88E543E,0xC2BA51CB671F043D,0x0AD482AC71AF5879, - 0xFE787A045CDAC936,0xB238AF338E049AED,0xBD866CC94972EE26,0x615DA6EBBD810290, - 0x3295FDD08B2C1711,0xF834046073BF0AEA,0xF3099329758FFC42,0x1CAEB13E7DCFA934, - 0xBA2307481188832B,0x24EFCE42874CE65C,0x0E57D61FB0E9DA1A,0xB3D1BAD6F99B343C, - 0xC0757B1C893C4582,0x2B510DB8403A9297,0x5C7698C1F1DB614A,0x3E0D0118D5E68CB4, - 0xD60F488E855CB4CF,0xAE961E0DF3CB33D9,0x3A8E55AB14A00ED7,0x42170328623789C1, - 0x838B6DD19C946292,0x895FEF7DED3B3AEB,0xCFCBB8E64E4A3149,0x064C7E642F65C3DC, - 0x3D2B3E2A4C5A63DA,0x5BD3F340A9210C47,0xB474D157A1615931,0xAC5934DA1DE87266, - 0x6EE365117AF7765B,0xC86ED36716B05C44,0x9BA6885C201D49C5,0xB905387A88346C45, - 0x131072C4BAB9DDFF,0xBF49461EA751AF99,0xD52977BC1CE05BA1,0xB0F785E46027DB52, - 0x546D30BA6E57788C,0x305AD707650F56AE,0xC987C682612FF295,0xA5AB8944F5FBC571, - 0x7ED528E759F244CA,0x8DDCBBCE2C7DB888,0xAA154ABE328DB1BA,0x1E619BE993ECE88B, - 0x09F2BD9EE813B717,0x7401AA4B285D1CB3,0x21858F143195CAEE,0x48C381841398D1B8, - 0xFCB750D3B2F98889,0x39A86A998D1CE1B9,0x1F888E0CE473465A,0x7899568376978716, - 0x02CF2AD7EE2341BF,0x85C713B5B3F1A14E,0xFF916FE12B4567E7,0x7C1A0230B7D10575, - 0x0C98FCC85ECA9BA5,0xA3E7F720DA9E06AD,0x6A6031A2BBB1F438,0x973E74947ED7D260, - 0x2CF4663918C0FF9A,0x5F50A7F368678E24,0x34D983B4A449D4CD,0x68AF1B755592B587, - 0x7F3C3D022E6DEA1B,0xABFC5F5B45121F6B,0x0D71E92D29553574,0xDFFDF5106D4F03D8, - 0x081BA87B9F8C19C6,0xDB7EA1A3AC0981BB,0xBBCA12AD66172DFA,0x79704366010829C7, - 0x179326777BFF5F9C,0x0000000000000000,0xEB2476A4C906D715,0x724DD42F0738DF6F, - 0xB752EE6538DDB65F,0x37FFBC863DF53BA3,0x8EFA84FCB5C157E6,0xE9EB5C73272596AA, - 0x1B0BDABF2535C439,0x86E12C872A4D4E20,0x9969A28BCE3E087A,0xFAFB2EB79D9C4B55, - 0x056A4156B6D92CB2,0x5A3AE6A5DEBEA296,0x22A3B026A8292580,0x53C85B3B36AD1581, - 0xB11E900117B87583,0xC51F3A4A3FE56930,0xE019E1EDCF3621BD,0xEC811D2591FCBA18, - 0x445B7D4C4D524A1D,0xA8DA6069DCAEF005,0x58F5CC72309DE329,0xD4C062596B7FF570, - 0xCE22AD0339D59F98,0x591CD99747024DF8,0x8B90C5AA03187B54,0xF663D27FC356D0F0, - 0xD8589E9135B56ED5,0x35309651D3D67A1C,0x12F96721CD26732E,0xD28C1C3D441A36AC, - 0x492A946164077F69,0x2D1D73DC6F5F514B,0x6F0A70F40D68D88A,0x60B4B30ECA1EAC41, - 0xD36509D83385987D,0x0B3D97490630F6A8,0x9ECCC90A96C46577,0xA20EE2C5AD01A87C, - 0xE49AB55E0E70A3DE,0xA4429CA182646BA0,0xDA97B446DB962F6A,0xCCED87D4D7F6DE27, - 0x2AB8185D37A53C46,0x9F25DCEFE15BCBA6,0xC19C6EF9FEA3EB53,0xA764A3931BD884CE, - 0x2FD2590B817C10F4,0x56A21A6D80743933,0xE573A0BB79EF0D0F,0x155C0CA095DC1E23, - 0x6C2C4FC694D437E4,0x10364DF623053291,0xDD32DFC7836C4267,0x03263F3299BCEF6E, - 0x66F8CD6AE57B6F9D,0x8C35AE2B5BE21659,0x31B3C2E21290F87F,0x93BD2027BF915003, - 0x69460E90220D1B56,0x299E276FAE19D328,0x63928C3C53A2432F,0x7082FEF8E91B9ED0, - 0xBC6F792C3EED40F7,0x4C40D537D2DE53DB,0x75E8BFAE5FC2B262,0x4DA9C0D2A541FD0A, - 0x4E8FFFE03CFD1264,0x2620E495696FA7E3,0xE1F0F408B8A98F6C,0xD1AA230FDDA6D9C2, - 0xC7D0109DD1C6288F,0x8A79D04F7487D585,0x4694579BA3710BA2,0x38417F7CFA834F68, - 0x1D47A4DB0A5007E5,0x206C9AF1460A643F,0xA128DDF734BD4712,0x8144470672B7232D, - 0xF2E086CC02105293,0x182DE58DBC892B57,0xCAA1F9B0F8931DFB,0x6B892447CC2E5AE9, - 0xF9DD11850420A43B,0x4BE5BEB68A243ED6,0x5584255F19C8D65D,0x3B67404E633FA006, - 0xA68DB6766C472A1F,0xF78AC79AB4C97E21,0xC353442E1080AAEC,0x9A4F9DB95782E714 -},{ - 0x05BA7BC82C9B3220,0x31A54665F8B65E4F,0xB1B651F77547F4D4,0x8BFA0D857BA46682, - 0x85A96C5AA16A98BB,0x990FAEF908EB79C9,0xA15E37A247F4A62D,0x76857DCD5D27741E, - 0xF8C50B800A1820BC,0xBE65DCB201F7A2B4,0x666D1B986F9426E7,0x4CC921BF53C4E648, - 0x95410A0F93D9CA42,0x20CDCCAA647BA4EF,0x429A4060890A1871,0x0C4EA4F69B32B38B, - 0xCCDA362DDE354CD3,0x96DC23BC7C5B2FA9,0xC309BB68AA851AB3,0xD26131A73648E013, - 0x021DC52941FC4DB2,0xCD5ADAB7704BE48A,0xA77965D984ED71E6,0x32386FD61734BBA4, - 0xE82D6DD538AB7245,0x5C2147EA6177B4B1,0x5DA1AB70CF091CE8,0xAC907FCE72B8BDFF, - 0x57C85DFD972278A8,0xA4E44C6A6B6F940D,0x3851995B4F1FDFE4,0x62578CCAED71BC9E, - 0xD9882BB0C01D2C0A,0x917B9D5D113C503B,0xA2C31E11A87643C6,0xE463C923A399C1CE, - 0xF71686C57EA876DC,0x87B4A973E096D509,0xAF0D567D9D3A5814,0xB40C2A3F59DCC6F4, - 0x3602F88495D121DD,0xD3E1DD3D9836484A,0xF945E71AA46688E5,0x7518547EB2A591F5, - 0x9366587450C01D89,0x9EA81018658C065B,0x4F54080CBC4603A3,0x2D0384C65137BF3D, - 0xDC325078EC861E2A,0xEA30A8FC79573FF7,0x214D2030CA050CB6,0x65F0322B8016C30C, - 0x69BE96DD1B247087,0xDB95EE9981E161B8,0xD1FC1814D9CA05F8,0x820ED2BBCC0DE729, - 0x63D76050430F14C7,0x3BCCB0E8A09D3A0F,0x8E40764D573F54A2,0x39D175C1E16177BD, - 0x12F5A37C734F1F4B,0xAB37C12F1FDFC26D,0x5648B167395CD0F1,0x6C04ED1537BF42A7, - 0xED97161D14304065,0x7D6C67DAAB72B807,0xEC17FA87BA4EE83C,0xDFAF79CB0304FBC1, - 0x733F060571BC463E,0x78D61C1287E98A27,0xD07CF48E77B4ADA1,0xB9C262536C90DD26, - 0xE2449B5860801605,0x8FC09AD7F941FCFB,0xFAD8CEA94BE46D0E,0xA343F28B0608EB9F, - 0x9B126BD04917347B,0x9A92874AE7699C22,0x1B017C42C4E69EE0,0x3A4C5C720EE39256, - 0x4B6E9F5E3EA399DA,0x6BA353F45AD83D35,0xE7FEE0904C1B2425,0x22D009832587E95D, - 0x842980C00F1430E2,0xC6B3C0A0861E2893,0x087433A419D729F2,0x341F3DADD42D6C6F, - 0xEE0A3FAEFBB2A58E,0x4AEE73C490DD3183,0xAAB72DB5B1A16A34,0xA92A04065E238FDF, - 0x7B4B35A1686B6FCC,0x6A23BF6EF4A6956C,0x191CB96B851AD352,0x55D598D4D6DE351A, - 0xC9604DE5F2AE7EF3,0x1CA6C2A3A981E172,0xDE2F9551AD7A5398,0x3025AAFF56C8F616, - 0x15521D9D1E2860D9,0x506FE31CFA45073A,0x189C55F12B647B0B,0x0180EC9AAE7EA859, - 0x7CEC8B40050C105E,0x2350E5198BF94104,0xEF8AD33455CC0DD7,0x07A7BEE16D677F92, - 0xE5E325B90DE76997,0x5A061591A26E637A,0xB611EF1618208B46,0x09F4DF3EB7A981AB, - 0x1EBB078AE87DACC0,0xB791038CB65E231F,0x0FD38D4574B05660,0x67EDF702C1EA8EBE, - 0xBA5F4BE0831238CD,0xE3C477C2CEFEBE5C,0x0DCE486C354C1BD2,0x8C5DB36416C31910, - 0x26EA9ED1A7627324,0x039D29B3EF82E5EB,0x9F28FC82CBF2AE02,0xA8AAE89CF05D2786, - 0x431AACFA2774B028,0xCF471F9E31B7A938,0x581BD0B8E3922EC8,0xBC78199B400BEF06, - 0x90FB71C7BF42F862,0x1F3BEB1046030499,0x683E7A47B55AD8DE,0x988F4263A695D190, - 0xD808C72A6E638453,0x0627527BC319D7CB,0xEBB04466D72997AE,0xE67E0C0AE2658C7C, - 0x14D2F107B056C880,0x7122C32C30400B8C,0x8A7AE11FD5DACEDB,0xA0DEDB38E98A0E74, - 0xAD109354DCC615A6,0x0BE91A17F655CC19,0x8DDD5FFEB8BDB149,0xBFE53028AF890AED, - 0xD65BA6F5B4AD7A6A,0x7956F0882997227E,0x10E8665532B352F9,0x0E5361DFDACEFE39, - 0xCEC7F3049FC90161,0xFF62B561677F5F2E,0x975CCF26D22587F0,0x51EF0F86543BAF63, - 0x2F1E41EF10CBF28F,0x52722635BBB94A88,0xAE8DBAE73344F04D,0x410769D36688FD9A, - 0xB3AB94DE34BBB966,0x801317928DF1AA9B,0xA564A0F0C5113C54,0xF131D4BEBDB1A117, - 0x7F71A2F3EA8EF5B5,0x40878549C8F655C3,0x7EF14E6944F05DEC,0xD44663DCF55137D8, - 0xF2ACFD0D523344FC,0x0000000000000000,0x5FBC6E598EF5515A,0x16CF342EF1AA8532, - 0xB036BD6DDB395C8D,0x13754FE6DD31B712,0xBBDFA77A2D6C9094,0x89E7C8AC3A582B30, - 0x3C6B0E09CDFA459D,0xC4AE0589C7E26521,0x49735A777F5FD468,0xCAFD64561D2C9B18, - 0xDA1502032F9FC9E1,0x8867243694268369,0x3782141E3BAF8984,0x9CB5D53124704BE9, - 0xD7DB4A6F1AD3D233,0xA6F989432A93D9BF,0x9D3539AB8A0EE3B0,0x53F2CAAF15C7E2D1, - 0x6E19283C76430F15,0x3DEBE2936384EDC4,0x5E3C82C3208BF903,0x33B8834CB94A13FD, - 0x6470DEB12E686B55,0x359FD1377A53C436,0x61CAA57902F35975,0x043A975282E59A79, - 0xFD7F70482683129C,0xC52EE913699CCD78,0x28B9FF0E7DAC8D1D,0x5455744E78A09D43, - 0xCB7D88CCB3523341,0x44BD121B4A13CFBA,0x4D49CD25FDBA4E11,0x3E76CB208C06082F, - 0x3FF627BA2278A076,0xC28957F204FBB2EA,0x453DFE81E46D67E3,0x94C1E6953DA7621B, - 0x2C83685CFF491764,0xF32C1197FC4DECA5,0x2B24D6BD922E68F6,0xB22B78449AC5113F, - 0x48F3B6EDD1217C31,0x2E9EAD75BEB55AD6,0x174FD8B45FD42D6B,0x4ED4E4961238ABFA, - 0x92E6B4EEFEBEB5D0,0x46A0D7320BEF8208,0x47203BA8A5912A51,0x24F75BF8E69E3E96, - 0xF0B1382413CF094E,0xFEE259FBC901F777,0x276A724B091CDB7D,0xBDF8F501EE75475F, - 0x599B3C224DEC8691,0x6D84018F99C1EAFE,0x7498B8E41CDB39AC,0xE0595E71217C5BB7, - 0x2AA43A273C50C0AF,0xF50B43EC3F543B6E,0x838E3E2162734F70,0xC09492DB4507FF58, - 0x72BFEA9FDFC2EE67,0x11688ACF9CCDFAA0,0x1A8190D86A9836B9,0x7ACBD93BC615C795, - 0xC7332C3A286080CA,0x863445E94EE87D50,0xF6966A5FD0D6DE85,0xE9AD814F96D5DA1C, - 0x70A22FB69E3EA3D5,0x0A69F68D582B6440,0xB8428EC9C2EE757F,0x604A49E3AC8DF12C, - 0x5B86F90B0C10CB23,0xE1D9B2EB8F02F3EE,0x29391394D3D22544,0xC8E0A17F5CD0D6AA, - 0xB58CC6A5F7A26EAD,0x8193FB08238F02C2,0xD5C68F465B2F9F81,0xFCFF9CD288FDBAC5, - 0x77059157F359DC47,0x1D262E3907FF492B,0xFB582233E59AC557,0xDDB2BCE242F8B673, - 0x2577B76248E096CF,0x6F99C4A6D83DA74C,0xC1147E41EB795701,0xF48BAF76912A9337 -},{ - 0x3EF29D249B2C0A19,0xE9E16322B6F8622F,0x5536994047757F7A,0x9F4D56D5A47B0B33, - 0x822567466AA1174C,0xB8F5057DEB082FB2,0xCC48C10BF4475F53,0x373088D4275DEC3A, - 0x968F4325180AED10,0x173D232CF7016151,0xAE4ED09F946FCC13,0xFD4B4741C4539873, - 0x1B5B3F0DD9933765,0x2FFCB0967B644052,0xE02376D20A89840C,0xA3AE3A70329B18D7, - 0x419CBD2335DE8526,0xFAFEBF115B7C3199,0x0397074F85AA9B0D,0xC58AD4FB4836B970, - 0xBEC60BE3FC4104A8,0x1EFF36DC4B708772,0x131FDC33ED8453B6,0x0844E33E341764D3, - 0x0FF11B6EAB38CD39,0x64351F0A7761B85A,0x3B5694F509CFBA0E,0x30857084B87245D0, - 0x47AFB3BD2297AE3C,0xF2BA5C2F6F6B554A,0x74BDC4761F4F70E1,0xCFDFC64471EDC45E, - 0xE610784C1DC0AF16,0x7ACA29D63C113F28,0x2DED411776A859AF,0xAC5F211E99A3D5EE, - 0xD484F949A87EF33B,0x3CE36CA596E013E4,0xD120F0983A9D432C,0x6BC40464DC597563, - 0x69D5F5E5D1956C9E,0x9AE95F043698BB24,0xC9ECC8DA66A4EF44,0xD69508C8A5B2EAC6, - 0xC40C2235C0503B80,0x38C193BA8C652103,0x1CEEC75D46BC9E8F,0xD331011937515AD1, - 0xD8E2E56886ECA50F,0xB137108D5779C991,0x709F3B6905CA4206,0x4FEB50831680CAEF, - 0xEC456AF3241BD238,0x58D673AFE181ABBE,0x242F54E7CAD9BF8C,0x0211F1810DCC19FD, - 0x90BC4DBB0F43C60A,0x9518446A9DA0761D,0xA1BFCBF13F57012A,0x2BDE4F8961E172B5, - 0x27B853A84F732481,0xB0B1E643DF1F4B61,0x18CC38425C39AC68,0xD2B7F7D7BF37D821, - 0x3103864A3014C720,0x14AA246372ABFA5C,0x6E600DB54EBAC574,0x394765740403A3F3, - 0x09C215F0BC71E623,0x2A58B947E987F045,0x7B4CDF18B477BDD8,0x9709B5EB906C6FE0, - 0x73083C268060D90B,0xFEDC400E41F9037E,0x284948C6E44BE9B8,0x728ECAE808065BFB, - 0x06330E9E17492B1A,0x5950856169E7294E,0xBAE4F4FCE6C4364F,0xCA7BCF95E30E7449, - 0x7D7FD186A33E96C2,0x52836110D85AD690,0x4DFAA1021B4CD312,0x913ABB75872544FA, - 0xDD46ECB9140F1518,0x3D659A6B1E869114,0xC23F2CABD719109A,0xD713FE062DD46836, - 0xD0A60656B2FBC1DC,0x221C5A79DD909496,0xEFD26DBCA1B14935,0x0E77EDA0235E4FC9, - 0xCBFD395B6B68F6B9,0x0DE0EAEFA6F4D4C4,0x0422FF1F1A8532E7,0xF969B85EDED6AA94, - 0x7F6E2007AEF28F3F,0x3AD0623B81A938FE,0x6624EE8B7AADA1A7,0xB682E8DDC856607B, - 0xA78CC56F281E2A30,0xC79B257A45FAA08D,0x5B4174E0642B30B3,0x5F638BFF7EAE0254, - 0x4BC9AF9C0C05F808,0xCE59308AF98B46AE,0x8FC58DA9CC55C388,0x803496C7676D0EB1, - 0xF33CAAE1E70DD7BA,0xBB6202326EA2B4BF,0xD5020F87201871CB,0x9D5CA754A9B712CE, - 0x841669D87DE83C56,0x8A6184785EB6739F,0x420BBA6CB0741E2B,0xF12D5B60EAC1CE47, - 0x76AC35F71283691C,0x2C6BB7D9FECEDB5F,0xFCCDB18F4C351A83,0x1F79C012C3160582, - 0xF0ABADAE62A74CB7,0xE1A5801C82EF06FC,0x67A21845F2CB2357,0x5114665F5DF04D9D, - 0xBF40FD2D74278658,0xA0393D3FB73183DA,0x05A409D192E3B017,0xA9FB28CF0B4065F9, - 0x25A9A22942BF3D7C,0xDB75E22703463E02,0xB326E10C5AB5D06C,0xE7968E8295A62DE6, - 0xB973F3B3636EAD42,0xDF571D3819C30CE5,0xEE549B7229D7CBC5,0x12992AFD65E2D146, - 0xF8EF4E9056B02864,0xB7041E134030E28B,0xC02EDD2ADAD50967,0x932B4AF48AE95D07, - 0x6FE6FB7BC6DC4784,0x239AACB755F61666,0x401A4BEDBDB807D6,0x485EA8D389AF6305, - 0xA41BC220ADB4B13D,0x753B32B89729F211,0x997E584BB3322029,0x1D683193CEDA1C7F, - 0xFF5AB6C0C99F818E,0x16BBD5E27F67E3A1,0xA59D34EE25D233CD,0x98F8AE853B54A2D9, - 0x6DF70AFACB105E79,0x795D2E99B9BBA425,0x8E437B6744334178,0x0186F6CE886682F0, - 0xEBF092A3BB347BD2,0xBCD7FA62F18D1D55,0xADD9D7D011C5571E,0x0BD3E471B1BDFFDE, - 0xAA6C2F808EEAFEF4,0x5EE57D31F6C880A4,0xF50FA47FF044FCA0,0x1ADDC9C351F5B595, - 0xEA76646D3352F922,0x0000000000000000,0x85909F16F58EBEA6,0x46294573AAF12CCC, - 0x0A5512BF39DB7D2E,0x78DBD85731DD26D5,0x29CFBE086C2D6B48,0x218B5D36583A0F9B, - 0x152CD2ADFACD78AC,0x83A39188E2C795BC,0xC3B9DA655F7F926A,0x9ECBA01B2C1D89C3, - 0x07B5F8509F2FA9EA,0x7EE8D6C926940DCF,0x36B67E1AAF3B6ECA,0x86079859702425AB, - 0xFB7849DFD31AB369,0x4C7C57CC932A51E2,0xD96413A60E8A27FF,0x263EA566C715A671, - 0x6C71FC344376DC89,0x4A4F595284637AF8,0xDAF314E98B20BCF2,0x572768C14AB96687, - 0x1088DB7C682EC8BB,0x887075F9537A6A62,0x2E7A4658F302C2A2,0x619116DBE582084D, - 0xA87DDE018326E709,0xDCC01A779C6997E8,0xEDC39C3DAC7D50C8,0xA60A33A1A078A8C0, - 0xC1A82BE452B38B97,0x3F746BEA134A88E9,0xA228CCBEBAFD9A27,0xABEAD94E068C7C04, - 0xF48952B178227E50,0x5CF48CB0FB049959,0x6017E0156DE48ABD,0x4438B4F2A73D3531, - 0x8C528AE649FF5885,0xB515EF924DFCFB76,0x0C661C212E925634,0xB493195CC59A7986, - 0x9CDA519A21D1903E,0x32948105B5BE5C2D,0x194ACE8CD45F2E98,0x438D4CA238129CDB, - 0x9B6FA9CABEFE39D4,0x81B26009EF0B8C41,0xDED1EBF691A58E15,0x4E6DA64D9EE6481F, - 0x54B06F8ECF13FD8A,0x49D85E1D01C9E1F5,0xAFC826511C094EE3,0xF698A33075EE67AD, - 0x5AC7822EEC4DB243,0x8DD47C28C199DA75,0x89F68337DB1CE892,0xCDCE37C57C21DDA3, - 0x530597DE503C5460,0x6A42F2AA543FF793,0x5D727A7E73621BA9,0xE232875307459DF1, - 0x56A19E0FC2DFE477,0xC61DD3B4CD9C227D,0xE5877F03986A341B,0x949EB2A415C6F4ED, - 0x6206119460289340,0x6380E75AE84E11B0,0x8BE772B6D6D0F16F,0x50929091D596CF6D, - 0xE86795EC3E9EE0DF,0x7CF927482B581432,0xC86A3E14EEC26DB4,0x7119CDA78DACC0F6, - 0xE40189CD100CB6EB,0x92ADBC3A028FDFF7,0xB2A017C2D2D3529C,0x200DABF8D05C8D6B, - 0x34A78F9BA2F77737,0xE3B4719D8F231F01,0x45BE423C2F5BB7C1,0xF71E55FEFD88E55D, - 0x6853032B59F3EE6E,0x65B3E9C4FF073AAA,0x772AC3399AE5EBEC,0x87816E97F842A75B, - 0x110E2DB2E0484A4B,0x331277CB3DD8DEDD,0xBD510CAC79EB9FA5,0x352179552A91F5C7 -},{ - 0x8AB0A96846E06A6D,0x43C7E80B4BF0B33A,0x08C9B3546B161EE5,0x39F1C235EBA990BE, - 0xC1BEF2376606C7B2,0x2C209233614569AA,0xEB01523B6FC3289A,0x946953AB935ACEDD, - 0x272838F63E13340E,0x8B0455ECA12BA052,0x77A1B2C4978FF8A2,0xA55122CA13E54086, - 0x2276135862D3F1CD,0xDB8DDFDE08B76CFE,0x5D1E12C89E4A178A,0x0E56816B03969867, - 0xEE5F79953303ED59,0xAFED748BAB78D71D,0x6D929F2DF93E53EE,0xF5D8A8F8BA798C2A, - 0xF619B1698E39CF6B,0x95DDAF2F749104E2,0xEC2A9C80E0886427,0xCE5C8FD8825B95EA, - 0xC4E0D9993AC60271,0x4699C3A5173076F9,0x3D1B151F50A29F42,0x9ED505EA2BC75946, - 0x34665ACFDC7F4B98,0x61B1FB53292342F7,0xC721C0080E864130,0x8693CD1696FD7B74, - 0x872731927136B14B,0xD3446C8A63A1721B,0x669A35E8A6680E4A,0xCAB658F239509A16, - 0xA4E5DE4EF42E8AB9,0x37A7435EE83F08D9,0x134E6239E26C7F96,0x82791A3C2DF67488, - 0x3F6EF00A8329163C,0x8E5A7E42FDEB6591,0x5CAAEE4C7981DDB5,0x19F234785AF1E80D, - 0x255DDDE3ED98BD70,0x50898A32A99CCCAC,0x28CA4519DA4E6656,0xAE59880F4CB31D22, - 0x0D9798FA37D6DB26,0x32F968F0B4FFCD1A,0xA00F09644F258545,0xFA3AD5175E24DE72, - 0xF46C547C5DB24615,0x713E80FBFF0F7E20,0x7843CF2B73D2AAFA,0xBD17EA36AEDF62B4, - 0xFD111BACD16F92CF,0x4ABAA7DBC72D67E0,0xB3416B5DAD49FAD3,0xBCA316B24914A88B, - 0x15D150068AECF914,0xE27C1DEBE31EFC40,0x4FE48C759BEDA223,0x7EDCFD141B522C78, - 0x4E5070F17C26681C,0xE696CAC15815F3BC,0x35D2A64B3BB481A7,0x800CFF29FE7DFDF6, - 0x1ED9FAC3D5BAA4B0,0x6C2663A91EF599D1,0x03C1199134404341,0xF7AD4DED69F20554, - 0xCD9D9649B61BD6AB,0xC8C3BDE7EADB1368,0xD131899FB02AFB65,0x1D18E352E1FAE7F1, - 0xDA39235AEF7CA6C1,0xA1BBF5E0A8EE4F7A,0x91377805CF9A0B1E,0x3138716180BF8E5B, - 0xD9F83ACBDB3CE580,0x0275E515D38B897E,0x472D3F21F0FBBCC6,0x2D946EB7868EA395, - 0xBA3C248D21942E09,0xE7223645BFDE3983,0xFF64FEB902E41BB1,0xC97741630D10D957, - 0xC3CB1722B58D4ECC,0xA27AEC719CAE0C3B,0x99FECB51A48C15FB,0x1465AC826D27332B, - 0xE1BD047AD75EBF01,0x79F733AF941960C5,0x672EC96C41A3C475,0xC27FEBA6524684F3, - 0x64EFD0FD75E38734,0xED9E60040743AE18,0xFB8E2993B9EF144D,0x38453EB10C625A81, - 0x6978480742355C12,0x48CF42CE14A6EE9E,0x1CAC1FD606312DCE,0x7B82D6BA4792E9BB, - 0x9D141C7B1F871A07,0x5616B80DC11C4A2E,0xB849C198F21FA777,0x7CA91801C8D9A506, - 0xB1348E487EC273AD,0x41B20D1E987B3A44,0x7460AB55A3CFBBE3,0x84E628034576F20A, - 0x1B87D16D897A6173,0x0FE27DEFE45D5258,0x83CDE6B8CA3DBEB7,0x0C23647ED01D1119, - 0x7A362A3EA0592384,0xB61F40F3F1893F10,0x75D457D1440471DC,0x4558DA34237035B8, - 0xDCA6116587FC2043,0x8D9B67D3C9AB26D0,0x2B0B5C88EE0E2517,0x6FE77A382AB5DA90, - 0x269CC472D9D8FE31,0x63C41E46FAA8CB89,0xB7ABBC771642F52F,0x7D1DE4852F126F39, - 0xA8C6BA3024339BA0,0x600507D7CEE888C8,0x8FEE82C61A20AFAE,0x57A2448926D78011, - 0xFCA5E72836A458F0,0x072BCEBB8F4B4CBD,0x497BBE4AF36D24A1,0x3CAFE99BB769557D, - 0x12FA9EBD05A7B5A9,0xE8C04BAA5B836BDB,0x4273148FAC3B7905,0x908384812851C121, - 0xE557D3506C55B0FD,0x72FF996ACB4F3D61,0x3EDA0C8E64E2DC03,0xF0868356E6B949E9, - 0x04EAD72ABB0B0FFC,0x17A4B5135967706A,0xE3C8E16F04D5367F,0xF84F30028DAF570C, - 0x1846C8FCBD3A2232,0x5B8120F7F6CA9108,0xD46FA231ECEA3EA6,0x334D947453340725, - 0x58403966C28AD249,0xBED6F3A79A9F21F5,0x68CCB483A5FE962D,0xD085751B57E1315A, - 0xFED0023DE52FD18E,0x4B0E5B5F20E6ADDF,0x1A332DE96EB1AB4C,0xA3CE10F57B65C604, - 0x108F7BA8D62C3CD7,0xAB07A3A11073D8E1,0x6B0DAD1291BED56C,0xF2F366433532C097, - 0x2E557726B2CEE0D4,0x0000000000000000,0xCB02A476DE9B5029,0xE4E32FD48B9E7AC2, - 0x734B65EE2C84F75E,0x6E5386BCCD7E10AF,0x01B4FC84E7CBCA3F,0xCFE8735C65905FD5, - 0x3613BFDA0FF4C2E6,0x113B872C31E7F6E8,0x2FE18BA255052AEB,0xE974B72EBC48A1E4, - 0x0ABC5641B89D979B,0xB46AA5E62202B66E,0x44EC26B0C4BBFF87,0xA6903B5B27A503C7, - 0x7F680190FC99E647,0x97A84A3AA71A8D9C,0xDD12EDE16037EA7C,0xC554251DDD0DC84E, - 0x88C54C7D956BE313,0x4D91696048662B5D,0xB08072CC9909B992,0xB5DE5962C5C97C51, - 0x81B803AD19B637C9,0xB2F597D94A8230EC,0x0B08AAC55F565DA4,0xF1327FD2017283D6, - 0xAD98919E78F35E63,0x6AB9519676751F53,0x24E921670A53774F,0xB9FD3D1C15D46D48, - 0x92F66194FBDA485F,0x5A35DC7311015B37,0xDED3F4705477A93D,0xC00A0EB381CD0D8D, - 0xBB88D809C65FE436,0x16104997BEACBA55,0x21B70AC95693B28C,0x59F4C5E225411876, - 0xD5DB5EB50B21F499,0x55D7A19CF55C096F,0xA97246B4C3F8519F,0x8552D487A2BD3835, - 0x54635D181297C350,0x23C2EFDC85183BF2,0x9F61F96ECC0C9379,0x534893A39DDC8FED, - 0x5EDF0B59AA0A54CB,0xAC2C6D1A9F38945C,0xD7AEBBA0D8AA7DE7,0x2ABFA00C09C5EF28, - 0xD84CC64F3CF72FBF,0x2003F64DB15878B3,0xA724C7DFC06EC9F8,0x069F323F68808682, - 0xCC296ACD51D01C94,0x055E2BAE5CC0C5C3,0x6270E2C21D6301B6,0x3B842720382219C0, - 0xD2F0900E846AB824,0x52FC6F277A1745D2,0xC6953C8CE94D8B0F,0xE009F8FE3095753E, - 0x655B2C7992284D0B,0x984A37D54347DFC4,0xEAB5AEBF8808E2A5,0x9A3FD2C090CC56BA, - 0x9CA0E0FFF84CD038,0x4C2595E4AFADE162,0xDF6708F4B3BC6302,0xBF620F237D54EBCA, - 0x93429D101C118260,0x097D4FD08CDDD4DA,0x8C2F9B572E60ECEF,0x708A7C7F18C4B41F, - 0x3A30DBA4DFE9D3FF,0x4006F19A7FB0F07B,0x5F6BF7DD4DC19EF4,0x1F6D064732716E8F, - 0xF9FBCC866A649D33,0x308C8DE567744464,0x8971B0F972A0292C,0xD61A47243F61B7D8, - 0xEFEB8511D4C82766,0x961CB6BE40D147A3,0xAAB35F25F7B812DE,0x76154E407044329D, - 0x513D76B64E570693,0xF3479AC7D2F90AA8,0x9B8B2E4477079C85,0x297EB99D3D85AC69 -},{ - 0x7E37E62DFC7D40C3,0x776F25A4EE939E5B,0xE045C850DD8FB5AD,0x86ED5BA711FF1952, - 0xE91D0BD9CF616B35,0x37E0AB256E408FFB,0x9607F6C031025A7A,0x0B02F5E116D23C9D, - 0xF3D8486BFB50650C,0x621CFF27C40875F5,0x7D40CB71FA5FD34A,0x6DAA6616DAA29062, - 0x9F5F354923EC84E2,0xEC847C3DC507C3B3,0x025A3668043CE205,0xA8BF9E6C4DAC0B19, - 0xFA808BE2E9BEBB94,0xB5B99C5277C74FA3,0x78D9BC95F0397BCC,0xE332E50CDBAD2624, - 0xC74FCE129332797E,0x1729ECEB2EA709AB,0xC2D6B9F69954D1F8,0x5D898CBFBAB8551A, - 0x859A76FB17DD8ADB,0x1BE85886362F7FB5,0xF6413F8FF136CD8A,0xD3110FA5BBB7E35C, - 0x0A2FEED514CC4D11,0xE83010EDCD7F1AB9,0xA1E75DE55F42D581,0xEEDE4A55C13B21B6, - 0xF2F5535FF94E1480,0x0CC1B46D1888761E,0xBCE15FDB6529913B,0x2D25E8975A7181C2, - 0x71817F1CE2D7A554,0x2E52C5CB5C53124B,0xF9F7A6BEEF9C281D,0x9E722E7D21F2F56E, - 0xCE170D9B81DCA7E6,0x0E9B82051CB4941B,0x1E712F623C49D733,0x21E45CFA42F9F7DC, - 0xCB8E7A7F8BBA0F60,0x8E98831A010FB646,0x474CCF0D8E895B23,0xA99285584FB27A95, - 0x8CC2B57205335443,0x42D5B8E984EFF3A5,0x012D1B34021E718C,0x57A6626AAE74180B, - 0xFF19FC06E3D81312,0x35BA9D4D6A7C6DFE,0xC9D44C178F86ED65,0x506523E6A02E5288, - 0x03772D5C06229389,0x8B01F4FE0B691EC0,0xF8DABD8AED825991,0x4C4E3AEC985B67BE, - 0xB10DF0827FBF96A9,0x6A69279AD4F8DAE1,0xE78689DCD3D5FF2E,0x812E1A2B1FA553D1, - 0xFBAD90D6EBA0CA18,0x1AC543B234310E39,0x1604F7DF2CB97827,0xA6241C6951189F02, - 0x753513CCEAAF7C5E,0x64F2A59FC84C4EFA,0x247D2B1E489F5F5A,0xDB64D718AB474C48, - 0x79F4A7A1F2270A40,0x1573DA832A9BEBAE,0x3497867968621C72,0x514838D2A2302304, - 0xF0AF6537FD72F685,0x1D06023E3A6B44BA,0x678588C3CE6EDD73,0x66A893F7CC70ACFF, - 0xD4D24E29B5EDA9DF,0x3856321470EA6A6C,0x07C3418C0E5A4A83,0x2BCBB22F5635BACD, - 0x04B46CD00878D90A,0x06EE5AB80C443B0F,0x3B211F4876C8F9E5,0x0958C38912EEDE98, - 0xD14B39CDBF8B0159,0x397B292072F41BE0,0x87C0409313E168DE,0xAD26E98847CAA39F, - 0x4E140C849C6785BB,0xD5FF551DB7F3D853,0xA0CA46D15D5CA40D,0xCD6020C787FE346F, - 0x84B76DCF15C3FB57,0xDEFDA0FCA121E4CE,0x4B8D7B6096012D3D,0x9AC642AD298A2C64, - 0x0875D8BD10F0AF14,0xB357C6EA7B8374AC,0x4D6321D89A451632,0xEDA96709C719B23F, - 0xF76C24BBF328BC06,0xC662D526912C08F2,0x3CE25EC47892B366,0xB978283F6F4F39BD, - 0xC08C8F9E9D6833FD,0x4F3917B09E79F437,0x593DE06FB2C08C10,0xD6887841B1D14BDA, - 0x19B26EEE32139DB0,0xB494876675D93E2F,0x825937771987C058,0x90E9AC783D466175, - 0xF1827E03FF6C8709,0x945DC0A8353EB87F,0x4516F9658AB5B926,0x3F9573987EB020EF, - 0xB855330B6D514831,0x2AE6A91B542BCB41,0x6331E413C6160479,0x408F8E8180D311A0, - 0xEFF35161C325503A,0xD06622F9BD9570D5,0x8876D9A20D4B8D49,0xA5533135573A0C8B, - 0xE168D364DF91C421,0xF41B09E7F50A2F8F,0x12B09B0F24C1A12D,0xDA49CC2CA9593DC4, - 0x1F5C34563E57A6BF,0x54D14F36A8568B82,0xAF7CDFE043F6419A,0xEA6A2685C943F8BC, - 0xE5DCBFB4D7E91D2B,0xB27ADDDE799D0520,0x6B443CAED6E6AB6D,0x7BAE91C9F61BE845, - 0x3EB868AC7CAE5163,0x11C7B65322E332A4,0xD23C1491B9A992D0,0x8FB5982E0311C7CA, - 0x70AC6428E0C9D4D8,0x895BC2960F55FCC5,0x76423E90EC8DEFD7,0x6FF0507EDE9E7267, - 0x3DCF45F07A8CC2EA,0x4AA06054941F5CB1,0x5810FB5BB0DEFD9C,0x5EFEA1E3BC9AC693, - 0x6EDD4B4ADC8003EB,0x741808F8E8B10DD2,0x145EC1B728859A22,0x28BC9F7350172944, - 0x270A06424EBDCCD3,0x972AEDF4331C2BF6,0x059977E40A66A886,0x2550302A4A812ED6, - 0xDD8A8DA0A7037747,0xC515F87A970E9B7B,0x3023EAA9601AC578,0xB7E3AA3A73FBADA6, - 0x0FB699311EAAE597,0x0000000000000000,0x310EF19D6204B4F4,0x229371A644DB6455, - 0x0DECAF591A960792,0x5CA4978BB8A62496,0x1C2B190A38753536,0x41A295B582CD602C, - 0x3279DCC16426277D,0xC1A194AA9F764271,0x139D803B26DFD0A1,0xAE51C4D441E83016, - 0xD813FA44AD65DFC1,0xAC0BF2BC45D4D213,0x23BE6A9246C515D9,0x49D74D08923DCF38, - 0x9D05032127D066E7,0x2F7FDEFF5E4D63C7,0xA47E2A0155247D07,0x99B16FF12FA8BFED, - 0x4661D4398C972AAF,0xDFD0BBC8A33F9542,0xDCA79694A51D06CB,0xB020EBB67DA1E725, - 0xBA0F0563696DAA34,0xE4F1A480D5F76CA7,0xC438E34E9510EAF7,0x939E81243B64F2FC, - 0x8DEFAE46072D25CF,0x2C08F3A3586FF04E,0xD7A56375B3CF3A56,0x20C947CE40E78650, - 0x43F8A3DD86F18229,0x568B795EAC6A6987,0x8003011F1DBB225D,0xF53612D3F7145E03, - 0x189F75DA300DEC3C,0x9570DB9C3720C9F3,0xBB221E576B73DBB8,0x72F65240E4F536DD, - 0x443BE25188ABC8AA,0xE21FFE38D9B357A8,0xFD43CA6EE7E4F117,0xCAA3614B89A47EEC, - 0xFE34E732E1C6629E,0x83742C431B99B1D4,0xCF3A16AF83C2D66A,0xAAE5A8044990E91C, - 0x26271D764CA3BD5F,0x91C4B74C3F5810F9,0x7C6DD045F841A2C6,0x7F1AFD19FE63314F, - 0xC8F957238D989CE9,0xA709075D5306EE8E,0x55FC5402AA48FA0E,0x48FA563C9023BEB4, - 0x65DFBEABCA523F76,0x6C877D22D8BCE1EE,0xCC4D3BF385E045E3,0xBEBB69B36115733E, - 0x10EAAD6720FD4328,0xB6CEB10E71E5DC2A,0xBDCC44EF6737E0B7,0x523F158EA412B08D, - 0x989C74C52DB6CE61,0x9BEB59992B945DE8,0x8A2CEFCA09776F4C,0xA3BD6B8D5B7E3784, - 0xEB473DB1CB5D8930,0xC3FBA2C29B4AA074,0x9C28181525CE176B,0x683311F2D0C438E4, - 0x5FD3BAD7BE84B71F,0xFC6ED15AE5FA809B,0x36CDB0116C5EFE77,0x29918447520958C8, - 0xA29070B959604608,0x53120EBAA60CC101,0x3A0C047C74D68869,0x691E0AC6D2DA4968, - 0x73DB4974E6EB4751,0x7A838AFDF40599C9,0x5A4ACD33B4E21F99,0x6046C94FC03497F0, - 0xE6AB92E8D1CB8EA2,0x3354C7F5663856F1,0xD93EE170AF7BAE4D,0x616BD27BC22AE67C, - 0x92B39A10397A8370,0xABC8B3304B8E9890,0xBF967287630B02B2,0x5B67D607B6FC6E15 -},{ - 0xD031C397CE553FE6,0x16BA5B01B006B525,0xA89BADE6296E70C8,0x6A1F525D77D3435B, - 0x6E103570573DFA0B,0x660EFB2A17FC95AB,0x76327A9E97634BF6,0x4BAD9D6462458BF5, - 0xF1830CAEDBC3F748,0xC5C8F542669131FF,0x95044A1CDC48B0CB,0x892962DF3CF8B866, - 0xB0B9E208E930C135,0xA14FB3F0611A767C,0x8D2605F21C160136,0xD6B71922FECC549E, - 0x37089438A5907D8B,0x0B5DA38E5803D49C,0x5A5BCC9CEA6F3CBC,0xEDAE246D3B73FFE5, - 0xD2B87E0FDE22EDCE,0x5E54ABB1CA8185EC,0x1DE7F88FE80561B9,0xAD5E1A870135A08C, - 0x2F2ADBD665CECC76,0x5780B5A782F58358,0x3EDC8A2EEDE47B3F,0xC9D95C3506BEE70F, - 0x83BE111D6C4E05EE,0xA603B90959367410,0x103C81B4809FDE5D,0x2C69B6027D0C774A, - 0x399080D7D5C87953,0x09D41E16487406B4,0xCDD63B1826505E5F,0xF99DC2F49B0298E8, - 0x9CD0540A943CB67F,0xBCA84B7F891F17C5,0x723D1DB3B78DF2A6,0x78AA6E71E73B4F2E, - 0x1433E699A071670D,0x84F21BE454620782,0x98DF3327B4D20F2F,0xF049DCE2D3769E5C, - 0xDB6C60199656EB7A,0x648746B2078B4783,0x32CD23598DCBADCF,0x1EA4955BF0C7DA85, - 0xE9A143401B9D46B5,0xFD92A5D9BBEC21B8,0xC8138C790E0B8E1B,0x2EE00B9A6D7BA562, - 0xF85712B893B7F1FC,0xEB28FED80BEA949D,0x564A65EB8A40EA4C,0x6C9988E8474A2823, - 0x4535898B121D8F2D,0xABD8C03231ACCBF4,0xBA2E91CAB9867CBD,0x7960BE3DEF8E263A, - 0x0C11A977602FD6F0,0xCB50E1AD16C93527,0xEAE22E94035FFD89,0x2866D12F5DE2CE1A, - 0xFF1B1841AB9BF390,0x9F9339DE8CFE0D43,0x964727C8C48A0BF7,0x524502C6AAAE531C, - 0x9B9C5EF3AC10B413,0x4FA2FA4942AB32A5,0x3F165A62E551122B,0xC74148DA76E6E3D7, - 0x924840E5E464B2A7,0xD372AE43D69784DA,0x233B72A105E11A86,0xA48A04914941A638, - 0xB4B68525C9DE7865,0xDDEABAACA6CF8002,0x0A9773C250B6BD88,0xC284FFBB5EBD3393, - 0x8BA0DF472C8F6A4E,0x2AEF6CB74D951C32,0x427983722A318D41,0x73F7CDFFBF389BB2, - 0x074C0AF9382C026C,0x8A6A0F0B243A035A,0x6FDAE53C5F88931F,0xC68B98967E538AC3, - 0x44FF59C71AA8E639,0xE2FCE0CE439E9229,0xA20CDE2479D8CD40,0x19E89FA2C8EBD8E9, - 0xF446BBCFF398270C,0x43B3533E2284E455,0xD82F0DCD8E945046,0x51066F12B26CE820, - 0xE73957AF6BC5426D,0x081ECE5A40C16FA0,0x3B193D4FC5BFAB7B,0x7FE66488DF174D42, - 0x0E9814EF705804D8,0x8137AC857C39D7C6,0xB1733244E185A821,0x695C3F896F11F867, - 0xF6CF0657E3EFF524,0x1AABF276D02963D5,0x2DA3664E75B91E5E,0x0289BD981077D228, - 0x90C1FD7DF413608F,0x3C5537B6FD93A917,0xAA12107E3919A2E0,0x0686DAB530996B78, - 0xDAA6B0559EE3826E,0xC34E2FF756085A87,0x6D5358A44FFF4137,0xFC587595B35948AC, - 0x7CA5095CC7D5F67E,0xFB147F6C8B754AC0,0xBFEB26AB91DDACF9,0x6896EFC567A49173, - 0xCA9A31E11E7C5C33,0xBBE44186B13315A9,0x0DDB793B689ABFE4,0x70B4A02BA7FA208E, - 0xE47A3A7B7307F951,0x8CECD5BE14A36822,0xEEED49B923B144D9,0x17708B4DB8B3DC31, - 0x6088219F2765FED3,0xB3FA8FDCF1F27A09,0x910B2D31FCA6099B,0x0F52C4A378ED6DCC, - 0x50CCBF5EBAD98134,0x6BD582117F662A4F,0x94CE9A50D4FDD9DF,0x2B25BCFB45207526, - 0x67C42B661F49FCBF,0x492420FC723259DD,0x03436DD418C2BB3C,0x1F6E4517F872B391, - 0xA08563BC69AF1F68,0xD43EA4BAEEBB86B6,0x01CAD04C08B56914,0xAC94CACB0980C998, - 0x54C3D8739A373864,0x26FEC5C02DBACAC2,0xDEA9D778BE0D3B3E,0x040F672D20EEB950, - 0xE5B0EA377BB29045,0xF30AB136CBB42560,0x62019C0737122CFB,0xE86B930C13282FA1, - 0xCC1CEB542EE5374B,0x538FD28AA21B3A08,0x1B61223AD89C0AC1,0x36C24474AD25149F, - 0x7A23D3E9F74C9D06,0xBE21F6E79968C5ED,0xCF5F868036278C77,0xF705D61BEB5A9C30, - 0x4D2B47D152DCE08D,0x5F9E7BFDC234ECF8,0x247778583DCD18EA,0x867BA67C4415D5AA, - 0x4CE1979D5A698999,0x0000000000000000,0xEC64F42133C696F1,0xB57C5569C16B1171, - 0xC1C7926F467F88AF,0x654D96FE0F3E2E97,0x15F936D5A8C40E19,0xB8A72C52A9F1AE95, - 0xA9517DAA21DB19DC,0x58D27104FA18EE94,0x5918A148F2AD8780,0x5CDD1629DAF657C4, - 0x8274C15164FB6CFA,0xD1FB13DBC6E056F2,0x7D6FD910CF609F6A,0xB63F38BDD9A9AA4D, - 0x3D9FE7FAF526C003,0x74BBC706871499DE,0xDF630734B6B8522A,0x3AD3ED03CD0AC26F, - 0xFADEAF2083C023D4,0xC00D42234ECAE1BB,0x8538CBA85CD76E96,0xC402250E6E2458EB, - 0x47BC3413026A5D05,0xAFD7A71F114272A4,0x978DF784CC3F62E3,0xB96DFC1EA144C781, - 0x21B2CF391596C8AE,0x318E4E8D950916F3,0xCE9556CC3E92E563,0x385A509BDD7D1047, - 0x358129A0B5E7AFA3,0xE6F387E363702B79,0xE0755D5653E94001,0x7BE903A5FFF9F412, - 0x12B53C2C90E80C75,0x3307F315857EC4DB,0x8FAFB86A0C61D31E,0xD9E5DD8186213952, - 0x77F8AAD29FD622E2,0x25BDA814357871FE,0x7571174A8FA1F0CA,0x137FEC60985D6561, - 0x30449EC19DBC7FE7,0xA540D4DD41F4CF2C,0xDC206AE0AE7AE916,0x5B911CD0E2DA55A8, - 0xB2305F90F947131D,0x344BF9ECBD52C6B7,0x5D17C665D2433ED0,0x18224FEEC05EB1FD, - 0x9E59E992844B6457,0x9A568EBFA4A5DD07,0xA3C60E68716DA454,0x7E2CB4C4D7A22456, - 0x87B176304CA0BCBE,0x413AEEA632F3367D,0x9915E36BBC67663B,0x40F03EEA3A465F69, - 0x1C2D28C3E0B008AD,0x4E682A054A1E5BB1,0x05C5B761285BD044,0xE1BF8D1A5B5C2915, - 0xF2C0617AC3014C74,0xB7F5E8F1D11CC359,0x63CB4C4B3FA745EF,0x9D1A84469C89DF6B, - 0xE33630824B2BFB3D,0xD5F474F6E60EEFA2,0xF58C6B83FB2D4E18,0x4676E45F0ADF3411, - 0x20781F751D23A1BA,0xBD629B3381AA7ED1,0xAE1D775319F71BB0,0xFED1C80DA32E9A84, - 0x5509083F92825170,0x29AC01635557A70E,0xA7C9694551831D04,0x8E65682604D4BA0A, - 0x11F651F8882AB749,0xD77DC96EF6793D8A,0xEF2799F52B042DCD,0x48EEF0B07A8730C9, - 0x22F1A2ED0D547392,0x6142F1D32FD097C7,0x4A674D286AF0E2E1,0x80FD7CC9748CBED2, - 0x717E7067AF4F499A,0x938290A9ECD1DBB3,0x88E3B293344DD172,0x2734158C250FA3D6 -}}; - -// Constant values for KeySchedule function -const unsigned char C[12][64] = {{ - 0xB1,0x08,0x5B,0xDA,0x1E,0xCA,0xDA,0xE9,0xEB,0xCB,0x2F,0x81,0xC0,0x65,0x7C,0x1F, - 0x2F,0x6A,0x76,0x43,0x2E,0x45,0xD0,0x16,0x71,0x4E,0xB8,0x8D,0x75,0x85,0xC4,0xFC, - 0x4B,0x7C,0xE0,0x91,0x92,0x67,0x69,0x01,0xA2,0x42,0x2A,0x08,0xA4,0x60,0xD3,0x15, - 0x05,0x76,0x74,0x36,0xCC,0x74,0x4D,0x23,0xDD,0x80,0x65,0x59,0xF2,0xA6,0x45,0x07 -},{ - 0x6F,0xA3,0xB5,0x8A,0xA9,0x9D,0x2F,0x1A,0x4F,0xE3,0x9D,0x46,0x0F,0x70,0xB5,0xD7, - 0xF3,0xFE,0xEA,0x72,0x0A,0x23,0x2B,0x98,0x61,0xD5,0x5E,0x0F,0x16,0xB5,0x01,0x31, - 0x9A,0xB5,0x17,0x6B,0x12,0xD6,0x99,0x58,0x5C,0xB5,0x61,0xC2,0xDB,0x0A,0xA7,0xCA, - 0x55,0xDD,0xA2,0x1B,0xD7,0xCB,0xCD,0x56,0xE6,0x79,0x04,0x70,0x21,0xB1,0x9B,0xB7 -},{ - 0xF5,0x74,0xDC,0xAC,0x2B,0xCE,0x2F,0xC7,0x0A,0x39,0xFC,0x28,0x6A,0x3D,0x84,0x35, - 0x06,0xF1,0x5E,0x5F,0x52,0x9C,0x1F,0x8B,0xF2,0xEA,0x75,0x14,0xB1,0x29,0x7B,0x7B, - 0xD3,0xE2,0x0F,0xE4,0x90,0x35,0x9E,0xB1,0xC1,0xC9,0x3A,0x37,0x60,0x62,0xDB,0x09, - 0xC2,0xB6,0xF4,0x43,0x86,0x7A,0xDB,0x31,0x99,0x1E,0x96,0xF5,0x0A,0xBA,0x0A,0xB2 -},{ - 0xEF,0x1F,0xDF,0xB3,0xE8,0x15,0x66,0xD2,0xF9,0x48,0xE1,0xA0,0x5D,0x71,0xE4,0xDD, - 0x48,0x8E,0x85,0x7E,0x33,0x5C,0x3C,0x7D,0x9D,0x72,0x1C,0xAD,0x68,0x5E,0x35,0x3F, - 0xA9,0xD7,0x2C,0x82,0xED,0x03,0xD6,0x75,0xD8,0xB7,0x13,0x33,0x93,0x52,0x03,0xBE, - 0x34,0x53,0xEA,0xA1,0x93,0xE8,0x37,0xF1,0x22,0x0C,0xBE,0xBC,0x84,0xE3,0xD1,0x2E -},{ - 0x4B,0xEA,0x6B,0xAC,0xAD,0x47,0x47,0x99,0x9A,0x3F,0x41,0x0C,0x6C,0xA9,0x23,0x63, - 0x7F,0x15,0x1C,0x1F,0x16,0x86,0x10,0x4A,0x35,0x9E,0x35,0xD7,0x80,0x0F,0xFF,0xBD, - 0xBF,0xCD,0x17,0x47,0x25,0x3A,0xF5,0xA3,0xDF,0xFF,0x00,0xB7,0x23,0x27,0x1A,0x16, - 0x7A,0x56,0xA2,0x7E,0xA9,0xEA,0x63,0xF5,0x60,0x17,0x58,0xFD,0x7C,0x6C,0xFE,0x57 -},{ - 0xAE,0x4F,0xAE,0xAE,0x1D,0x3A,0xD3,0xD9,0x6F,0xA4,0xC3,0x3B,0x7A,0x30,0x39,0xC0, - 0x2D,0x66,0xC4,0xF9,0x51,0x42,0xA4,0x6C,0x18,0x7F,0x9A,0xB4,0x9A,0xF0,0x8E,0xC6, - 0xCF,0xFA,0xA6,0xB7,0x1C,0x9A,0xB7,0xB4,0x0A,0xF2,0x1F,0x66,0xC2,0xBE,0xC6,0xB6, - 0xBF,0x71,0xC5,0x72,0x36,0x90,0x4F,0x35,0xFA,0x68,0x40,0x7A,0x46,0x64,0x7D,0x6E -},{ - 0xF4,0xC7,0x0E,0x16,0xEE,0xAA,0xC5,0xEC,0x51,0xAC,0x86,0xFE,0xBF,0x24,0x09,0x54, - 0x39,0x9E,0xC6,0xC7,0xE6,0xBF,0x87,0xC9,0xD3,0x47,0x3E,0x33,0x19,0x7A,0x93,0xC9, - 0x09,0x92,0xAB,0xC5,0x2D,0x82,0x2C,0x37,0x06,0x47,0x69,0x83,0x28,0x4A,0x05,0x04, - 0x35,0x17,0x45,0x4C,0xA2,0x3C,0x4A,0xF3,0x88,0x86,0x56,0x4D,0x3A,0x14,0xD4,0x93 -},{ - 0x9B,0x1F,0x5B,0x42,0x4D,0x93,0xC9,0xA7,0x03,0xE7,0xAA,0x02,0x0C,0x6E,0x41,0x41, - 0x4E,0xB7,0xF8,0x71,0x9C,0x36,0xDE,0x1E,0x89,0xB4,0x44,0x3B,0x4D,0xDB,0xC4,0x9A, - 0xF4,0x89,0x2B,0xCB,0x92,0x9B,0x06,0x90,0x69,0xD1,0x8D,0x2B,0xD1,0xA5,0xC4,0x2F, - 0x36,0xAC,0xC2,0x35,0x59,0x51,0xA8,0xD9,0xA4,0x7F,0x0D,0xD4,0xBF,0x02,0xE7,0x1E -},{ - 0x37,0x8F,0x5A,0x54,0x16,0x31,0x22,0x9B,0x94,0x4C,0x9A,0xD8,0xEC,0x16,0x5F,0xDE, - 0x3A,0x7D,0x3A,0x1B,0x25,0x89,0x42,0x24,0x3C,0xD9,0x55,0xB7,0xE0,0x0D,0x09,0x84, - 0x80,0x0A,0x44,0x0B,0xDB,0xB2,0xCE,0xB1,0x7B,0x2B,0x8A,0x9A,0xA6,0x07,0x9C,0x54, - 0x0E,0x38,0xDC,0x92,0xCB,0x1F,0x2A,0x60,0x72,0x61,0x44,0x51,0x83,0x23,0x5A,0xDB -},{ - 0xAB,0xBE,0xDE,0xA6,0x80,0x05,0x6F,0x52,0x38,0x2A,0xE5,0x48,0xB2,0xE4,0xF3,0xF3, - 0x89,0x41,0xE7,0x1C,0xFF,0x8A,0x78,0xDB,0x1F,0xFF,0xE1,0x8A,0x1B,0x33,0x61,0x03, - 0x9F,0xE7,0x67,0x02,0xAF,0x69,0x33,0x4B,0x7A,0x1E,0x6C,0x30,0x3B,0x76,0x52,0xF4, - 0x36,0x98,0xFA,0xD1,0x15,0x3B,0xB6,0xC3,0x74,0xB4,0xC7,0xFB,0x98,0x45,0x9C,0xED -},{ - 0x7B,0xCD,0x9E,0xD0,0xEF,0xC8,0x89,0xFB,0x30,0x02,0xC6,0xCD,0x63,0x5A,0xFE,0x94, - 0xD8,0xFA,0x6B,0xBB,0xEB,0xAB,0x07,0x61,0x20,0x01,0x80,0x21,0x14,0x84,0x66,0x79, - 0x8A,0x1D,0x71,0xEF,0xEA,0x48,0xB9,0xCA,0xEF,0xBA,0xCD,0x1D,0x7D,0x47,0x6E,0x98, - 0xDE,0xA2,0x59,0x4A,0xC0,0x6F,0xD8,0x5D,0x6B,0xCA,0xA4,0xCD,0x81,0xF3,0x2D,0x1B -},{ - 0x37,0x8E,0xE7,0x67,0xF1,0x16,0x31,0xBA,0xD2,0x13,0x80,0xB0,0x04,0x49,0xB1,0x7A, - 0xCD,0xA4,0x3C,0x32,0xBC,0xDF,0x1D,0x77,0xF8,0x20,0x12,0xD4,0x30,0x21,0x9F,0x9B, - 0x5D,0x80,0xEF,0x9D,0x18,0x91,0xCC,0x86,0xE7,0x1D,0xA4,0xAA,0x88,0xE1,0x28,0x52, - 0xFA,0xF4,0x17,0xD5,0xD9,0xB2,0x1B,0x99,0x48,0xBC,0x92,0x4A,0xF1,0x1B,0xD7,0x20 -}}; - - -static void AddModulo512(const void *a,const void *b,void *c) -{ - const unsigned char *A=a, *B=b; - unsigned char *C=c; - int t = 0; -#ifdef FULL_UNROLL -#define ADDBYTE_8(i) t = A[i] + B[i] + (t >> 8); C[i] = t & 0xFF; - - ADDBYTE_8(63) - ADDBYTE_8(62) - ADDBYTE_8(61) - ADDBYTE_8(60) - ADDBYTE_8(59) - ADDBYTE_8(58) - ADDBYTE_8(57) - ADDBYTE_8(56) - ADDBYTE_8(55) - ADDBYTE_8(54) - ADDBYTE_8(53) - ADDBYTE_8(52) - ADDBYTE_8(51) - ADDBYTE_8(50) - ADDBYTE_8(49) - ADDBYTE_8(48) - ADDBYTE_8(47) - ADDBYTE_8(46) - ADDBYTE_8(45) - ADDBYTE_8(44) - ADDBYTE_8(43) - ADDBYTE_8(42) - ADDBYTE_8(41) - ADDBYTE_8(40) - ADDBYTE_8(39) - ADDBYTE_8(38) - ADDBYTE_8(37) - ADDBYTE_8(36) - ADDBYTE_8(35) - ADDBYTE_8(34) - ADDBYTE_8(33) - ADDBYTE_8(32) - ADDBYTE_8(31) - ADDBYTE_8(30) - ADDBYTE_8(29) - ADDBYTE_8(28) - ADDBYTE_8(27) - ADDBYTE_8(26) - ADDBYTE_8(25) - ADDBYTE_8(24) - ADDBYTE_8(23) - ADDBYTE_8(22) - ADDBYTE_8(21) - ADDBYTE_8(20) - ADDBYTE_8(19) - ADDBYTE_8(18) - ADDBYTE_8(17) - ADDBYTE_8(16) - ADDBYTE_8(15) - ADDBYTE_8(14) - ADDBYTE_8(13) - ADDBYTE_8(12) - ADDBYTE_8(11) - ADDBYTE_8(10) - ADDBYTE_8(9) - ADDBYTE_8(8) - ADDBYTE_8(7) - ADDBYTE_8(6) - ADDBYTE_8(5) - ADDBYTE_8(4) - ADDBYTE_8(3) - ADDBYTE_8(2) - ADDBYTE_8(1) - ADDBYTE_8(0) - -#else - int i = 0; - - for(i=63;i>=0;i--) - { - t = A[i] + B[i] + (t >> 8); - C[i] = t & 0xFF; - } -#endif -} - -static void AddXor512(const void *a,const void *b,void *c) -{ - const unsigned long long *A=a, *B=b; - unsigned long long *C=c; -#ifdef FULL_UNROLL - C[0] = A[0] ^ B[0]; - C[1] = A[1] ^ B[1]; - C[2] = A[2] ^ B[2]; - C[3] = A[3] ^ B[3]; - C[4] = A[4] ^ B[4]; - C[5] = A[5] ^ B[5]; - C[6] = A[6] ^ B[6]; - C[7] = A[7] ^ B[7]; -#else - int i = 0; - - for(i=0; i<8; i++) { - C[i] = A[i] ^ B[i]; - } -#endif -} - -static void F(unsigned char *state) -{ - unsigned long long return_state[8]; - register unsigned long long r = 0; - r ^= TG[0][state[56]]; - r ^= TG[1][state[48]]; - r ^= TG[2][state[40]]; - r ^= TG[3][state[32]]; - r ^= TG[4][state[24]]; - r ^= TG[5][state[16]]; - r ^= TG[6][state[8]]; - r ^= TG[7][state[0]]; - return_state[0] = r; - r = 0; - - r ^= TG[0][state[57]]; - r ^= TG[1][state[49]]; - r ^= TG[2][state[41]]; - r ^= TG[3][state[33]]; - r ^= TG[4][state[25]]; - r ^= TG[5][state[17]]; - r ^= TG[6][state[9]]; - r ^= TG[7][state[1]]; - return_state[1] = r; - r = 0; - - r ^= TG[0][state[58]]; - r ^= TG[1][state[50]]; - r ^= TG[2][state[42]]; - r ^= TG[3][state[34]]; - r ^= TG[4][state[26]]; - r ^= TG[5][state[18]]; - r ^= TG[6][state[10]]; - r ^= TG[7][state[2]]; - return_state[2] = r; - r = 0; - - r ^= TG[0][state[59]]; - r ^= TG[1][state[51]]; - r ^= TG[2][state[43]]; - r ^= TG[3][state[35]]; - r ^= TG[4][state[27]]; - r ^= TG[5][state[19]]; - r ^= TG[6][state[11]]; - r ^= TG[7][state[3]]; - return_state[3] = r; - r = 0; - - r ^= TG[0][state[60]]; - r ^= TG[1][state[52]]; - r ^= TG[2][state[44]]; - r ^= TG[3][state[36]]; - r ^= TG[4][state[28]]; - r ^= TG[5][state[20]]; - r ^= TG[6][state[12]]; - r ^= TG[7][state[4]]; - return_state[4] = r; - r = 0; - - r ^= TG[0][state[61]]; - r ^= TG[1][state[53]]; - r ^= TG[2][state[45]]; - r ^= TG[3][state[37]]; - r ^= TG[4][state[29]]; - r ^= TG[5][state[21]]; - r ^= TG[6][state[13]]; - r ^= TG[7][state[5]]; - return_state[5] = r; - r = 0; - - r ^= TG[0][state[62]]; - r ^= TG[1][state[54]]; - r ^= TG[2][state[46]]; - r ^= TG[3][state[38]]; - r ^= TG[4][state[30]]; - r ^= TG[5][state[22]]; - r ^= TG[6][state[14]]; - r ^= TG[7][state[6]]; - return_state[6] = r; - r = 0; - - r ^= TG[0][state[63]]; - r ^= TG[1][state[55]]; - r ^= TG[2][state[47]]; - r ^= TG[3][state[39]]; - r ^= TG[4][state[31]]; - r ^= TG[5][state[23]]; - r ^= TG[6][state[15]]; - r ^= TG[7][state[7]]; - return_state[7] = r; - - memcpy(state,(unsigned char*)return_state,64); -} - -#define KeySchedule(K,i) AddXor512(K,C[i],K); F(K); - -static void E(unsigned char *K,const unsigned char *m, unsigned char *state) -{ -#ifdef FULL_UNROLL - AddXor512(m,K,state); - - F(state); - KeySchedule(K,0); - AddXor512(state,K,state); - - F(state); - KeySchedule(K,1); - AddXor512(state,K,state); - - F(state); - KeySchedule(K,2); - AddXor512(state,K,state); - - F(state); - KeySchedule(K,3); - AddXor512(state,K,state); - - F(state); - KeySchedule(K,4); - AddXor512(state,K,state); - - F(state); - KeySchedule(K,5); - AddXor512(state,K,state); - - F(state); - KeySchedule(K,6); - AddXor512(state,K,state); - - F(state); - KeySchedule(K,7); - AddXor512(state,K,state); - - F(state); - KeySchedule(K,8); - AddXor512(state,K,state); - - F(state); - KeySchedule(K,9); - AddXor512(state,K,state); - - F(state); - KeySchedule(K,10); - AddXor512(state,K,state); - - F(state); - KeySchedule(K,11); - AddXor512(state,K,state); -#else - int i = 0; - - AddXor512(m,K,state); - - for(i=0;i<12;i++) { - F(state); - KeySchedule(K,i); - AddXor512(state,K,state); - } -#endif -} - -static void g_N(const unsigned char *N,unsigned char *h,const unsigned char *m) -{ - unsigned char t[64], K[64]; - - AddXor512(N,h,K); - - F(K); - - E(K,m,t); - - AddXor512(t,h,t); - AddXor512(t,m,h); -} - -static void hash_X(unsigned char *IV,const unsigned char *message,unsigned long long length,unsigned char *out) -{ - unsigned char v512[64] = { - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00 - }; - unsigned char v0[64] = { - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - }; - unsigned char Sigma[64] = { - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - }; - unsigned char N[64] = { - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - }; - unsigned char m[64], *hash = IV; - unsigned long long len = length; - - // Stage 2 - while (len >= 512) - { - memcpy(m, message + len/8 - 63 - ( (len & 0x7) == 0 ), 64); - - g_N(N,hash,m); - AddModulo512(N,v512,N); - AddModulo512(Sigma,m,Sigma); - len -= 512; - } - - memset(m,0,64); - memcpy(m + 63 - len/8 + ( (len & 0x7) == 0 ), message, len/8 + 1 - ( (len & 0x7) == 0 )); - - // Stage 3 - m[ 63 - len/8 ] |= (1 << (len & 0x7)); - - g_N(N,hash,m); - v512[63] = len & 0xFF; - v512[62] = (unsigned char) (len >> 8); - AddModulo512(N,v512,N); - - AddModulo512(Sigma,m,Sigma); - - g_N(v0,hash,N); - g_N(v0,hash,Sigma); - - memcpy(out, hash, 64); -} - -static void hash_512(const unsigned char *message, unsigned long long length, unsigned char *out) -{ - unsigned char IV[64] = { - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - }; - - hash_X(IV,message,length,out); -} - -static void hash_256(const unsigned char *message, unsigned long long length, unsigned char *out) -{ - unsigned char IV[64] = { - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01 - }; - unsigned char hash[64]; - - hash_X(IV,message,length,hash); - - memcpy(out,hash,32); -} - - - - - -/* see sph_gost.h */ -void -sph_gost256_init(void *cc) -{ - //gost_init(cc, 256); -} - -/* see sph_gost.h */ -void -sph_gost256(void *cc, const void *data, size_t len) -{ - hash_256(data, 8*len, cc); -} - -/* see sph_gost.h */ -void -sph_gost256_close(void *cc, void *dst) -{ - //sph_gost256_addbits_and_close(cc, 0, 0, dst); - memcpy(dst, cc, 32); -} - -/* see sph_gost.h */ -void -sph_gost256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - //gost_close32(cc, ub, n, dst); -} - -/* see sph_gost.h */ -void -sph_gost512_init(void *cc) -{ - //gost_init(cc, 512); -} - -/* see sph_gost.h */ -void -sph_gost512(void *cc, const void *data, size_t len) -{ - hash_512(data, 8*len, cc); -} - -/* see sph_gost.h */ -void -sph_gost512_close(void *cc, void *dst) -{ - //sph_gost512_addbits_and_close(cc, 0, 0, dst); - memcpy(dst, cc, 64); -} - -/* see sph_gost.h */ -void -sph_gost512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - //gost_close64(cc, ub, n, dst); -} - - -#ifdef __cplusplus -} -#endif diff --git a/sph/whirlpool.c b/sph/whirlpool.c deleted file mode 100644 index 07ff50cb..00000000 --- a/sph/whirlpool.c +++ /dev/null @@ -1,3480 +0,0 @@ -/* $Id: whirlpool.c 227 2010-06-16 17:28:38Z tp $ */ -/* - * WHIRLPOOL implementation. - * - * Internally, we use little-endian convention, on the assumption that - * architectures which favour big-endian encoding are: - * 1. rarer - * 2. in decreasing numbers - * 3. able to decode little-endian data efficiently anyway - * - * The most common big-endian architecture is Sparc, and Ultrasparc CPU - * include special opcodes to perform little-endian accesses, which we use - * (see sph_types.h). Most modern CPU designs can work with both endianness - * and architecture designer now favour little-endian (basically, x86 has - * won the endianness war). - * - * TODO: implement a 32-bit version. Not only such a version would be handy - * for non-64-bit-able architectures, but it may also use smaller tables, - * at the expense of more lookups and XORs. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include - -#include "sph_whirlpool.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -#if SPH_SMALL_FOOTPRINT && !defined SPH_SMALL_FOOTPRINT_WHIRLPOOL -#define SPH_SMALL_FOOTPRINT_WHIRLPOOL 1 -#endif - -/* ====================================================================== */ -/* - * Constants for plain WHIRLPOOL (current version). - */ - -static const sph_u64 plain_T0[256] = { - SPH_C64(0xD83078C018601818), SPH_C64(0x2646AF05238C2323), - SPH_C64(0xB891F97EC63FC6C6), SPH_C64(0xFBCD6F13E887E8E8), - SPH_C64(0xCB13A14C87268787), SPH_C64(0x116D62A9B8DAB8B8), - SPH_C64(0x0902050801040101), SPH_C64(0x0D9E6E424F214F4F), - SPH_C64(0x9B6CEEAD36D83636), SPH_C64(0xFF510459A6A2A6A6), - SPH_C64(0x0CB9BDDED26FD2D2), SPH_C64(0x0EF706FBF5F3F5F5), - SPH_C64(0x96F280EF79F97979), SPH_C64(0x30DECE5F6FA16F6F), - SPH_C64(0x6D3FEFFC917E9191), SPH_C64(0xF8A407AA52555252), - SPH_C64(0x47C0FD27609D6060), SPH_C64(0x35657689BCCABCBC), - SPH_C64(0x372BCDAC9B569B9B), SPH_C64(0x8A018C048E028E8E), - SPH_C64(0xD25B1571A3B6A3A3), SPH_C64(0x6C183C600C300C0C), - SPH_C64(0x84F68AFF7BF17B7B), SPH_C64(0x806AE1B535D43535), - SPH_C64(0xF53A69E81D741D1D), SPH_C64(0xB3DD4753E0A7E0E0), - SPH_C64(0x21B3ACF6D77BD7D7), SPH_C64(0x9C99ED5EC22FC2C2), - SPH_C64(0x435C966D2EB82E2E), SPH_C64(0x29967A624B314B4B), - SPH_C64(0x5DE121A3FEDFFEFE), SPH_C64(0xD5AE168257415757), - SPH_C64(0xBD2A41A815541515), SPH_C64(0xE8EEB69F77C17777), - SPH_C64(0x926EEBA537DC3737), SPH_C64(0x9ED7567BE5B3E5E5), - SPH_C64(0x1323D98C9F469F9F), SPH_C64(0x23FD17D3F0E7F0F0), - SPH_C64(0x20947F6A4A354A4A), SPH_C64(0x44A9959EDA4FDADA), - SPH_C64(0xA2B025FA587D5858), SPH_C64(0xCF8FCA06C903C9C9), - SPH_C64(0x7C528D5529A42929), SPH_C64(0x5A1422500A280A0A), - SPH_C64(0x507F4FE1B1FEB1B1), SPH_C64(0xC95D1A69A0BAA0A0), - SPH_C64(0x14D6DA7F6BB16B6B), SPH_C64(0xD917AB5C852E8585), - SPH_C64(0x3C677381BDCEBDBD), SPH_C64(0x8FBA34D25D695D5D), - SPH_C64(0x9020508010401010), SPH_C64(0x07F503F3F4F7F4F4), - SPH_C64(0xDD8BC016CB0BCBCB), SPH_C64(0xD37CC6ED3EF83E3E), - SPH_C64(0x2D0A112805140505), SPH_C64(0x78CEE61F67816767), - SPH_C64(0x97D55373E4B7E4E4), SPH_C64(0x024EBB25279C2727), - SPH_C64(0x7382583241194141), SPH_C64(0xA70B9D2C8B168B8B), - SPH_C64(0xF6530151A7A6A7A7), SPH_C64(0xB2FA94CF7DE97D7D), - SPH_C64(0x4937FBDC956E9595), SPH_C64(0x56AD9F8ED847D8D8), - SPH_C64(0x70EB308BFBCBFBFB), SPH_C64(0xCDC17123EE9FEEEE), - SPH_C64(0xBBF891C77CED7C7C), SPH_C64(0x71CCE31766856666), - SPH_C64(0x7BA78EA6DD53DDDD), SPH_C64(0xAF2E4BB8175C1717), - SPH_C64(0x458E460247014747), SPH_C64(0x1A21DC849E429E9E), - SPH_C64(0xD489C51ECA0FCACA), SPH_C64(0x585A99752DB42D2D), - SPH_C64(0x2E637991BFC6BFBF), SPH_C64(0x3F0E1B38071C0707), - SPH_C64(0xAC472301AD8EADAD), SPH_C64(0xB0B42FEA5A755A5A), - SPH_C64(0xEF1BB56C83368383), SPH_C64(0xB666FF8533CC3333), - SPH_C64(0x5CC6F23F63916363), SPH_C64(0x12040A1002080202), - SPH_C64(0x93493839AA92AAAA), SPH_C64(0xDEE2A8AF71D97171), - SPH_C64(0xC68DCF0EC807C8C8), SPH_C64(0xD1327DC819641919), - SPH_C64(0x3B92707249394949), SPH_C64(0x5FAF9A86D943D9D9), - SPH_C64(0x31F91DC3F2EFF2F2), SPH_C64(0xA8DB484BE3ABE3E3), - SPH_C64(0xB9B62AE25B715B5B), SPH_C64(0xBC0D9234881A8888), - SPH_C64(0x3E29C8A49A529A9A), SPH_C64(0x0B4CBE2D26982626), - SPH_C64(0xBF64FA8D32C83232), SPH_C64(0x597D4AE9B0FAB0B0), - SPH_C64(0xF2CF6A1BE983E9E9), SPH_C64(0x771E33780F3C0F0F), - SPH_C64(0x33B7A6E6D573D5D5), SPH_C64(0xF41DBA74803A8080), - SPH_C64(0x27617C99BEC2BEBE), SPH_C64(0xEB87DE26CD13CDCD), - SPH_C64(0x8968E4BD34D03434), SPH_C64(0x3290757A483D4848), - SPH_C64(0x54E324ABFFDBFFFF), SPH_C64(0x8DF48FF77AF57A7A), - SPH_C64(0x643DEAF4907A9090), SPH_C64(0x9DBE3EC25F615F5F), - SPH_C64(0x3D40A01D20802020), SPH_C64(0x0FD0D56768BD6868), - SPH_C64(0xCA3472D01A681A1A), SPH_C64(0xB7412C19AE82AEAE), - SPH_C64(0x7D755EC9B4EAB4B4), SPH_C64(0xCEA8199A544D5454), - SPH_C64(0x7F3BE5EC93769393), SPH_C64(0x2F44AA0D22882222), - SPH_C64(0x63C8E907648D6464), SPH_C64(0x2AFF12DBF1E3F1F1), - SPH_C64(0xCCE6A2BF73D17373), SPH_C64(0x82245A9012481212), - SPH_C64(0x7A805D3A401D4040), SPH_C64(0x4810284008200808), - SPH_C64(0x959BE856C32BC3C3), SPH_C64(0xDFC57B33EC97ECEC), - SPH_C64(0x4DAB9096DB4BDBDB), SPH_C64(0xC05F1F61A1BEA1A1), - SPH_C64(0x9107831C8D0E8D8D), SPH_C64(0xC87AC9F53DF43D3D), - SPH_C64(0x5B33F1CC97669797), SPH_C64(0x0000000000000000), - SPH_C64(0xF983D436CF1BCFCF), SPH_C64(0x6E5687452BAC2B2B), - SPH_C64(0xE1ECB39776C57676), SPH_C64(0xE619B06482328282), - SPH_C64(0x28B1A9FED67FD6D6), SPH_C64(0xC33677D81B6C1B1B), - SPH_C64(0x74775BC1B5EEB5B5), SPH_C64(0xBE432911AF86AFAF), - SPH_C64(0x1DD4DF776AB56A6A), SPH_C64(0xEAA00DBA505D5050), - SPH_C64(0x578A4C1245094545), SPH_C64(0x38FB18CBF3EBF3F3), - SPH_C64(0xAD60F09D30C03030), SPH_C64(0xC4C3742BEF9BEFEF), - SPH_C64(0xDA7EC3E53FFC3F3F), SPH_C64(0xC7AA1C9255495555), - SPH_C64(0xDB591079A2B2A2A2), SPH_C64(0xE9C96503EA8FEAEA), - SPH_C64(0x6ACAEC0F65896565), SPH_C64(0x036968B9BAD2BABA), - SPH_C64(0x4A5E93652FBC2F2F), SPH_C64(0x8E9DE74EC027C0C0), - SPH_C64(0x60A181BEDE5FDEDE), SPH_C64(0xFC386CE01C701C1C), - SPH_C64(0x46E72EBBFDD3FDFD), SPH_C64(0x1F9A64524D294D4D), - SPH_C64(0x7639E0E492729292), SPH_C64(0xFAEABC8F75C97575), - SPH_C64(0x360C1E3006180606), SPH_C64(0xAE0998248A128A8A), - SPH_C64(0x4B7940F9B2F2B2B2), SPH_C64(0x85D15963E6BFE6E6), - SPH_C64(0x7E1C36700E380E0E), SPH_C64(0xE73E63F81F7C1F1F), - SPH_C64(0x55C4F73762956262), SPH_C64(0x3AB5A3EED477D4D4), - SPH_C64(0x814D3229A89AA8A8), SPH_C64(0x5231F4C496629696), - SPH_C64(0x62EF3A9BF9C3F9F9), SPH_C64(0xA397F666C533C5C5), - SPH_C64(0x104AB13525942525), SPH_C64(0xABB220F259795959), - SPH_C64(0xD015AE54842A8484), SPH_C64(0xC5E4A7B772D57272), - SPH_C64(0xEC72DDD539E43939), SPH_C64(0x1698615A4C2D4C4C), - SPH_C64(0x94BC3BCA5E655E5E), SPH_C64(0x9FF085E778FD7878), - SPH_C64(0xE570D8DD38E03838), SPH_C64(0x980586148C0A8C8C), - SPH_C64(0x17BFB2C6D163D1D1), SPH_C64(0xE4570B41A5AEA5A5), - SPH_C64(0xA1D94D43E2AFE2E2), SPH_C64(0x4EC2F82F61996161), - SPH_C64(0x427B45F1B3F6B3B3), SPH_C64(0x3442A51521842121), - SPH_C64(0x0825D6949C4A9C9C), SPH_C64(0xEE3C66F01E781E1E), - SPH_C64(0x6186522243114343), SPH_C64(0xB193FC76C73BC7C7), - SPH_C64(0x4FE52BB3FCD7FCFC), SPH_C64(0x2408142004100404), - SPH_C64(0xE3A208B251595151), SPH_C64(0x252FC7BC995E9999), - SPH_C64(0x22DAC44F6DA96D6D), SPH_C64(0x651A39680D340D0D), - SPH_C64(0x79E93583FACFFAFA), SPH_C64(0x69A384B6DF5BDFDF), - SPH_C64(0xA9FC9BD77EE57E7E), SPH_C64(0x1948B43D24902424), - SPH_C64(0xFE76D7C53BEC3B3B), SPH_C64(0x9A4B3D31AB96ABAB), - SPH_C64(0xF081D13ECE1FCECE), SPH_C64(0x9922558811441111), - SPH_C64(0x8303890C8F068F8F), SPH_C64(0x049C6B4A4E254E4E), - SPH_C64(0x667351D1B7E6B7B7), SPH_C64(0xE0CB600BEB8BEBEB), - SPH_C64(0xC178CCFD3CF03C3C), SPH_C64(0xFD1FBF7C813E8181), - SPH_C64(0x4035FED4946A9494), SPH_C64(0x1CF30CEBF7FBF7F7), - SPH_C64(0x186F67A1B9DEB9B9), SPH_C64(0x8B265F98134C1313), - SPH_C64(0x51589C7D2CB02C2C), SPH_C64(0x05BBB8D6D36BD3D3), - SPH_C64(0x8CD35C6BE7BBE7E7), SPH_C64(0x39DCCB576EA56E6E), - SPH_C64(0xAA95F36EC437C4C4), SPH_C64(0x1B060F18030C0303), - SPH_C64(0xDCAC138A56455656), SPH_C64(0x5E88491A440D4444), - SPH_C64(0xA0FE9EDF7FE17F7F), SPH_C64(0x884F3721A99EA9A9), - SPH_C64(0x6754824D2AA82A2A), SPH_C64(0x0A6B6DB1BBD6BBBB), - SPH_C64(0x879FE246C123C1C1), SPH_C64(0xF1A602A253515353), - SPH_C64(0x72A58BAEDC57DCDC), SPH_C64(0x531627580B2C0B0B), - SPH_C64(0x0127D39C9D4E9D9D), SPH_C64(0x2BD8C1476CAD6C6C), - SPH_C64(0xA462F59531C43131), SPH_C64(0xF3E8B98774CD7474), - SPH_C64(0x15F109E3F6FFF6F6), SPH_C64(0x4C8C430A46054646), - SPH_C64(0xA5452609AC8AACAC), SPH_C64(0xB50F973C891E8989), - SPH_C64(0xB42844A014501414), SPH_C64(0xBADF425BE1A3E1E1), - SPH_C64(0xA62C4EB016581616), SPH_C64(0xF774D2CD3AE83A3A), - SPH_C64(0x06D2D06F69B96969), SPH_C64(0x41122D4809240909), - SPH_C64(0xD7E0ADA770DD7070), SPH_C64(0x6F7154D9B6E2B6B6), - SPH_C64(0x1EBDB7CED067D0D0), SPH_C64(0xD6C77E3BED93EDED), - SPH_C64(0xE285DB2ECC17CCCC), SPH_C64(0x6884572A42154242), - SPH_C64(0x2C2DC2B4985A9898), SPH_C64(0xED550E49A4AAA4A4), - SPH_C64(0x7550885D28A02828), SPH_C64(0x86B831DA5C6D5C5C), - SPH_C64(0x6BED3F93F8C7F8F8), SPH_C64(0xC211A44486228686) -}; - -#if !SPH_SMALL_FOOTPRINT_WHIRLPOOL - -static const sph_u64 plain_T1[256] = { - SPH_C64(0x3078C018601818D8), SPH_C64(0x46AF05238C232326), - SPH_C64(0x91F97EC63FC6C6B8), SPH_C64(0xCD6F13E887E8E8FB), - SPH_C64(0x13A14C87268787CB), SPH_C64(0x6D62A9B8DAB8B811), - SPH_C64(0x0205080104010109), SPH_C64(0x9E6E424F214F4F0D), - SPH_C64(0x6CEEAD36D836369B), SPH_C64(0x510459A6A2A6A6FF), - SPH_C64(0xB9BDDED26FD2D20C), SPH_C64(0xF706FBF5F3F5F50E), - SPH_C64(0xF280EF79F9797996), SPH_C64(0xDECE5F6FA16F6F30), - SPH_C64(0x3FEFFC917E91916D), SPH_C64(0xA407AA52555252F8), - SPH_C64(0xC0FD27609D606047), SPH_C64(0x657689BCCABCBC35), - SPH_C64(0x2BCDAC9B569B9B37), SPH_C64(0x018C048E028E8E8A), - SPH_C64(0x5B1571A3B6A3A3D2), SPH_C64(0x183C600C300C0C6C), - SPH_C64(0xF68AFF7BF17B7B84), SPH_C64(0x6AE1B535D4353580), - SPH_C64(0x3A69E81D741D1DF5), SPH_C64(0xDD4753E0A7E0E0B3), - SPH_C64(0xB3ACF6D77BD7D721), SPH_C64(0x99ED5EC22FC2C29C), - SPH_C64(0x5C966D2EB82E2E43), SPH_C64(0x967A624B314B4B29), - SPH_C64(0xE121A3FEDFFEFE5D), SPH_C64(0xAE168257415757D5), - SPH_C64(0x2A41A815541515BD), SPH_C64(0xEEB69F77C17777E8), - SPH_C64(0x6EEBA537DC373792), SPH_C64(0xD7567BE5B3E5E59E), - SPH_C64(0x23D98C9F469F9F13), SPH_C64(0xFD17D3F0E7F0F023), - SPH_C64(0x947F6A4A354A4A20), SPH_C64(0xA9959EDA4FDADA44), - SPH_C64(0xB025FA587D5858A2), SPH_C64(0x8FCA06C903C9C9CF), - SPH_C64(0x528D5529A429297C), SPH_C64(0x1422500A280A0A5A), - SPH_C64(0x7F4FE1B1FEB1B150), SPH_C64(0x5D1A69A0BAA0A0C9), - SPH_C64(0xD6DA7F6BB16B6B14), SPH_C64(0x17AB5C852E8585D9), - SPH_C64(0x677381BDCEBDBD3C), SPH_C64(0xBA34D25D695D5D8F), - SPH_C64(0x2050801040101090), SPH_C64(0xF503F3F4F7F4F407), - SPH_C64(0x8BC016CB0BCBCBDD), SPH_C64(0x7CC6ED3EF83E3ED3), - SPH_C64(0x0A1128051405052D), SPH_C64(0xCEE61F6781676778), - SPH_C64(0xD55373E4B7E4E497), SPH_C64(0x4EBB25279C272702), - SPH_C64(0x8258324119414173), SPH_C64(0x0B9D2C8B168B8BA7), - SPH_C64(0x530151A7A6A7A7F6), SPH_C64(0xFA94CF7DE97D7DB2), - SPH_C64(0x37FBDC956E959549), SPH_C64(0xAD9F8ED847D8D856), - SPH_C64(0xEB308BFBCBFBFB70), SPH_C64(0xC17123EE9FEEEECD), - SPH_C64(0xF891C77CED7C7CBB), SPH_C64(0xCCE3176685666671), - SPH_C64(0xA78EA6DD53DDDD7B), SPH_C64(0x2E4BB8175C1717AF), - SPH_C64(0x8E46024701474745), SPH_C64(0x21DC849E429E9E1A), - SPH_C64(0x89C51ECA0FCACAD4), SPH_C64(0x5A99752DB42D2D58), - SPH_C64(0x637991BFC6BFBF2E), SPH_C64(0x0E1B38071C07073F), - SPH_C64(0x472301AD8EADADAC), SPH_C64(0xB42FEA5A755A5AB0), - SPH_C64(0x1BB56C83368383EF), SPH_C64(0x66FF8533CC3333B6), - SPH_C64(0xC6F23F639163635C), SPH_C64(0x040A100208020212), - SPH_C64(0x493839AA92AAAA93), SPH_C64(0xE2A8AF71D97171DE), - SPH_C64(0x8DCF0EC807C8C8C6), SPH_C64(0x327DC819641919D1), - SPH_C64(0x927072493949493B), SPH_C64(0xAF9A86D943D9D95F), - SPH_C64(0xF91DC3F2EFF2F231), SPH_C64(0xDB484BE3ABE3E3A8), - SPH_C64(0xB62AE25B715B5BB9), SPH_C64(0x0D9234881A8888BC), - SPH_C64(0x29C8A49A529A9A3E), SPH_C64(0x4CBE2D269826260B), - SPH_C64(0x64FA8D32C83232BF), SPH_C64(0x7D4AE9B0FAB0B059), - SPH_C64(0xCF6A1BE983E9E9F2), SPH_C64(0x1E33780F3C0F0F77), - SPH_C64(0xB7A6E6D573D5D533), SPH_C64(0x1DBA74803A8080F4), - SPH_C64(0x617C99BEC2BEBE27), SPH_C64(0x87DE26CD13CDCDEB), - SPH_C64(0x68E4BD34D0343489), SPH_C64(0x90757A483D484832), - SPH_C64(0xE324ABFFDBFFFF54), SPH_C64(0xF48FF77AF57A7A8D), - SPH_C64(0x3DEAF4907A909064), SPH_C64(0xBE3EC25F615F5F9D), - SPH_C64(0x40A01D208020203D), SPH_C64(0xD0D56768BD68680F), - SPH_C64(0x3472D01A681A1ACA), SPH_C64(0x412C19AE82AEAEB7), - SPH_C64(0x755EC9B4EAB4B47D), SPH_C64(0xA8199A544D5454CE), - SPH_C64(0x3BE5EC937693937F), SPH_C64(0x44AA0D228822222F), - SPH_C64(0xC8E907648D646463), SPH_C64(0xFF12DBF1E3F1F12A), - SPH_C64(0xE6A2BF73D17373CC), SPH_C64(0x245A901248121282), - SPH_C64(0x805D3A401D40407A), SPH_C64(0x1028400820080848), - SPH_C64(0x9BE856C32BC3C395), SPH_C64(0xC57B33EC97ECECDF), - SPH_C64(0xAB9096DB4BDBDB4D), SPH_C64(0x5F1F61A1BEA1A1C0), - SPH_C64(0x07831C8D0E8D8D91), SPH_C64(0x7AC9F53DF43D3DC8), - SPH_C64(0x33F1CC976697975B), SPH_C64(0x0000000000000000), - SPH_C64(0x83D436CF1BCFCFF9), SPH_C64(0x5687452BAC2B2B6E), - SPH_C64(0xECB39776C57676E1), SPH_C64(0x19B06482328282E6), - SPH_C64(0xB1A9FED67FD6D628), SPH_C64(0x3677D81B6C1B1BC3), - SPH_C64(0x775BC1B5EEB5B574), SPH_C64(0x432911AF86AFAFBE), - SPH_C64(0xD4DF776AB56A6A1D), SPH_C64(0xA00DBA505D5050EA), - SPH_C64(0x8A4C124509454557), SPH_C64(0xFB18CBF3EBF3F338), - SPH_C64(0x60F09D30C03030AD), SPH_C64(0xC3742BEF9BEFEFC4), - SPH_C64(0x7EC3E53FFC3F3FDA), SPH_C64(0xAA1C9255495555C7), - SPH_C64(0x591079A2B2A2A2DB), SPH_C64(0xC96503EA8FEAEAE9), - SPH_C64(0xCAEC0F658965656A), SPH_C64(0x6968B9BAD2BABA03), - SPH_C64(0x5E93652FBC2F2F4A), SPH_C64(0x9DE74EC027C0C08E), - SPH_C64(0xA181BEDE5FDEDE60), SPH_C64(0x386CE01C701C1CFC), - SPH_C64(0xE72EBBFDD3FDFD46), SPH_C64(0x9A64524D294D4D1F), - SPH_C64(0x39E0E49272929276), SPH_C64(0xEABC8F75C97575FA), - SPH_C64(0x0C1E300618060636), SPH_C64(0x0998248A128A8AAE), - SPH_C64(0x7940F9B2F2B2B24B), SPH_C64(0xD15963E6BFE6E685), - SPH_C64(0x1C36700E380E0E7E), SPH_C64(0x3E63F81F7C1F1FE7), - SPH_C64(0xC4F7376295626255), SPH_C64(0xB5A3EED477D4D43A), - SPH_C64(0x4D3229A89AA8A881), SPH_C64(0x31F4C49662969652), - SPH_C64(0xEF3A9BF9C3F9F962), SPH_C64(0x97F666C533C5C5A3), - SPH_C64(0x4AB1352594252510), SPH_C64(0xB220F259795959AB), - SPH_C64(0x15AE54842A8484D0), SPH_C64(0xE4A7B772D57272C5), - SPH_C64(0x72DDD539E43939EC), SPH_C64(0x98615A4C2D4C4C16), - SPH_C64(0xBC3BCA5E655E5E94), SPH_C64(0xF085E778FD78789F), - SPH_C64(0x70D8DD38E03838E5), SPH_C64(0x0586148C0A8C8C98), - SPH_C64(0xBFB2C6D163D1D117), SPH_C64(0x570B41A5AEA5A5E4), - SPH_C64(0xD94D43E2AFE2E2A1), SPH_C64(0xC2F82F619961614E), - SPH_C64(0x7B45F1B3F6B3B342), SPH_C64(0x42A5152184212134), - SPH_C64(0x25D6949C4A9C9C08), SPH_C64(0x3C66F01E781E1EEE), - SPH_C64(0x8652224311434361), SPH_C64(0x93FC76C73BC7C7B1), - SPH_C64(0xE52BB3FCD7FCFC4F), SPH_C64(0x0814200410040424), - SPH_C64(0xA208B251595151E3), SPH_C64(0x2FC7BC995E999925), - SPH_C64(0xDAC44F6DA96D6D22), SPH_C64(0x1A39680D340D0D65), - SPH_C64(0xE93583FACFFAFA79), SPH_C64(0xA384B6DF5BDFDF69), - SPH_C64(0xFC9BD77EE57E7EA9), SPH_C64(0x48B43D2490242419), - SPH_C64(0x76D7C53BEC3B3BFE), SPH_C64(0x4B3D31AB96ABAB9A), - SPH_C64(0x81D13ECE1FCECEF0), SPH_C64(0x2255881144111199), - SPH_C64(0x03890C8F068F8F83), SPH_C64(0x9C6B4A4E254E4E04), - SPH_C64(0x7351D1B7E6B7B766), SPH_C64(0xCB600BEB8BEBEBE0), - SPH_C64(0x78CCFD3CF03C3CC1), SPH_C64(0x1FBF7C813E8181FD), - SPH_C64(0x35FED4946A949440), SPH_C64(0xF30CEBF7FBF7F71C), - SPH_C64(0x6F67A1B9DEB9B918), SPH_C64(0x265F98134C13138B), - SPH_C64(0x589C7D2CB02C2C51), SPH_C64(0xBBB8D6D36BD3D305), - SPH_C64(0xD35C6BE7BBE7E78C), SPH_C64(0xDCCB576EA56E6E39), - SPH_C64(0x95F36EC437C4C4AA), SPH_C64(0x060F18030C03031B), - SPH_C64(0xAC138A56455656DC), SPH_C64(0x88491A440D44445E), - SPH_C64(0xFE9EDF7FE17F7FA0), SPH_C64(0x4F3721A99EA9A988), - SPH_C64(0x54824D2AA82A2A67), SPH_C64(0x6B6DB1BBD6BBBB0A), - SPH_C64(0x9FE246C123C1C187), SPH_C64(0xA602A253515353F1), - SPH_C64(0xA58BAEDC57DCDC72), SPH_C64(0x1627580B2C0B0B53), - SPH_C64(0x27D39C9D4E9D9D01), SPH_C64(0xD8C1476CAD6C6C2B), - SPH_C64(0x62F59531C43131A4), SPH_C64(0xE8B98774CD7474F3), - SPH_C64(0xF109E3F6FFF6F615), SPH_C64(0x8C430A460546464C), - SPH_C64(0x452609AC8AACACA5), SPH_C64(0x0F973C891E8989B5), - SPH_C64(0x2844A014501414B4), SPH_C64(0xDF425BE1A3E1E1BA), - SPH_C64(0x2C4EB016581616A6), SPH_C64(0x74D2CD3AE83A3AF7), - SPH_C64(0xD2D06F69B9696906), SPH_C64(0x122D480924090941), - SPH_C64(0xE0ADA770DD7070D7), SPH_C64(0x7154D9B6E2B6B66F), - SPH_C64(0xBDB7CED067D0D01E), SPH_C64(0xC77E3BED93EDEDD6), - SPH_C64(0x85DB2ECC17CCCCE2), SPH_C64(0x84572A4215424268), - SPH_C64(0x2DC2B4985A98982C), SPH_C64(0x550E49A4AAA4A4ED), - SPH_C64(0x50885D28A0282875), SPH_C64(0xB831DA5C6D5C5C86), - SPH_C64(0xED3F93F8C7F8F86B), SPH_C64(0x11A44486228686C2) -}; - -static const sph_u64 plain_T2[256] = { - SPH_C64(0x78C018601818D830), SPH_C64(0xAF05238C23232646), - SPH_C64(0xF97EC63FC6C6B891), SPH_C64(0x6F13E887E8E8FBCD), - SPH_C64(0xA14C87268787CB13), SPH_C64(0x62A9B8DAB8B8116D), - SPH_C64(0x0508010401010902), SPH_C64(0x6E424F214F4F0D9E), - SPH_C64(0xEEAD36D836369B6C), SPH_C64(0x0459A6A2A6A6FF51), - SPH_C64(0xBDDED26FD2D20CB9), SPH_C64(0x06FBF5F3F5F50EF7), - SPH_C64(0x80EF79F9797996F2), SPH_C64(0xCE5F6FA16F6F30DE), - SPH_C64(0xEFFC917E91916D3F), SPH_C64(0x07AA52555252F8A4), - SPH_C64(0xFD27609D606047C0), SPH_C64(0x7689BCCABCBC3565), - SPH_C64(0xCDAC9B569B9B372B), SPH_C64(0x8C048E028E8E8A01), - SPH_C64(0x1571A3B6A3A3D25B), SPH_C64(0x3C600C300C0C6C18), - SPH_C64(0x8AFF7BF17B7B84F6), SPH_C64(0xE1B535D43535806A), - SPH_C64(0x69E81D741D1DF53A), SPH_C64(0x4753E0A7E0E0B3DD), - SPH_C64(0xACF6D77BD7D721B3), SPH_C64(0xED5EC22FC2C29C99), - SPH_C64(0x966D2EB82E2E435C), SPH_C64(0x7A624B314B4B2996), - SPH_C64(0x21A3FEDFFEFE5DE1), SPH_C64(0x168257415757D5AE), - SPH_C64(0x41A815541515BD2A), SPH_C64(0xB69F77C17777E8EE), - SPH_C64(0xEBA537DC3737926E), SPH_C64(0x567BE5B3E5E59ED7), - SPH_C64(0xD98C9F469F9F1323), SPH_C64(0x17D3F0E7F0F023FD), - SPH_C64(0x7F6A4A354A4A2094), SPH_C64(0x959EDA4FDADA44A9), - SPH_C64(0x25FA587D5858A2B0), SPH_C64(0xCA06C903C9C9CF8F), - SPH_C64(0x8D5529A429297C52), SPH_C64(0x22500A280A0A5A14), - SPH_C64(0x4FE1B1FEB1B1507F), SPH_C64(0x1A69A0BAA0A0C95D), - SPH_C64(0xDA7F6BB16B6B14D6), SPH_C64(0xAB5C852E8585D917), - SPH_C64(0x7381BDCEBDBD3C67), SPH_C64(0x34D25D695D5D8FBA), - SPH_C64(0x5080104010109020), SPH_C64(0x03F3F4F7F4F407F5), - SPH_C64(0xC016CB0BCBCBDD8B), SPH_C64(0xC6ED3EF83E3ED37C), - SPH_C64(0x1128051405052D0A), SPH_C64(0xE61F6781676778CE), - SPH_C64(0x5373E4B7E4E497D5), SPH_C64(0xBB25279C2727024E), - SPH_C64(0x5832411941417382), SPH_C64(0x9D2C8B168B8BA70B), - SPH_C64(0x0151A7A6A7A7F653), SPH_C64(0x94CF7DE97D7DB2FA), - SPH_C64(0xFBDC956E95954937), SPH_C64(0x9F8ED847D8D856AD), - SPH_C64(0x308BFBCBFBFB70EB), SPH_C64(0x7123EE9FEEEECDC1), - SPH_C64(0x91C77CED7C7CBBF8), SPH_C64(0xE3176685666671CC), - SPH_C64(0x8EA6DD53DDDD7BA7), SPH_C64(0x4BB8175C1717AF2E), - SPH_C64(0x460247014747458E), SPH_C64(0xDC849E429E9E1A21), - SPH_C64(0xC51ECA0FCACAD489), SPH_C64(0x99752DB42D2D585A), - SPH_C64(0x7991BFC6BFBF2E63), SPH_C64(0x1B38071C07073F0E), - SPH_C64(0x2301AD8EADADAC47), SPH_C64(0x2FEA5A755A5AB0B4), - SPH_C64(0xB56C83368383EF1B), SPH_C64(0xFF8533CC3333B666), - SPH_C64(0xF23F639163635CC6), SPH_C64(0x0A10020802021204), - SPH_C64(0x3839AA92AAAA9349), SPH_C64(0xA8AF71D97171DEE2), - SPH_C64(0xCF0EC807C8C8C68D), SPH_C64(0x7DC819641919D132), - SPH_C64(0x7072493949493B92), SPH_C64(0x9A86D943D9D95FAF), - SPH_C64(0x1DC3F2EFF2F231F9), SPH_C64(0x484BE3ABE3E3A8DB), - SPH_C64(0x2AE25B715B5BB9B6), SPH_C64(0x9234881A8888BC0D), - SPH_C64(0xC8A49A529A9A3E29), SPH_C64(0xBE2D269826260B4C), - SPH_C64(0xFA8D32C83232BF64), SPH_C64(0x4AE9B0FAB0B0597D), - SPH_C64(0x6A1BE983E9E9F2CF), SPH_C64(0x33780F3C0F0F771E), - SPH_C64(0xA6E6D573D5D533B7), SPH_C64(0xBA74803A8080F41D), - SPH_C64(0x7C99BEC2BEBE2761), SPH_C64(0xDE26CD13CDCDEB87), - SPH_C64(0xE4BD34D034348968), SPH_C64(0x757A483D48483290), - SPH_C64(0x24ABFFDBFFFF54E3), SPH_C64(0x8FF77AF57A7A8DF4), - SPH_C64(0xEAF4907A9090643D), SPH_C64(0x3EC25F615F5F9DBE), - SPH_C64(0xA01D208020203D40), SPH_C64(0xD56768BD68680FD0), - SPH_C64(0x72D01A681A1ACA34), SPH_C64(0x2C19AE82AEAEB741), - SPH_C64(0x5EC9B4EAB4B47D75), SPH_C64(0x199A544D5454CEA8), - SPH_C64(0xE5EC937693937F3B), SPH_C64(0xAA0D228822222F44), - SPH_C64(0xE907648D646463C8), SPH_C64(0x12DBF1E3F1F12AFF), - SPH_C64(0xA2BF73D17373CCE6), SPH_C64(0x5A90124812128224), - SPH_C64(0x5D3A401D40407A80), SPH_C64(0x2840082008084810), - SPH_C64(0xE856C32BC3C3959B), SPH_C64(0x7B33EC97ECECDFC5), - SPH_C64(0x9096DB4BDBDB4DAB), SPH_C64(0x1F61A1BEA1A1C05F), - SPH_C64(0x831C8D0E8D8D9107), SPH_C64(0xC9F53DF43D3DC87A), - SPH_C64(0xF1CC976697975B33), SPH_C64(0x0000000000000000), - SPH_C64(0xD436CF1BCFCFF983), SPH_C64(0x87452BAC2B2B6E56), - SPH_C64(0xB39776C57676E1EC), SPH_C64(0xB06482328282E619), - SPH_C64(0xA9FED67FD6D628B1), SPH_C64(0x77D81B6C1B1BC336), - SPH_C64(0x5BC1B5EEB5B57477), SPH_C64(0x2911AF86AFAFBE43), - SPH_C64(0xDF776AB56A6A1DD4), SPH_C64(0x0DBA505D5050EAA0), - SPH_C64(0x4C1245094545578A), SPH_C64(0x18CBF3EBF3F338FB), - SPH_C64(0xF09D30C03030AD60), SPH_C64(0x742BEF9BEFEFC4C3), - SPH_C64(0xC3E53FFC3F3FDA7E), SPH_C64(0x1C9255495555C7AA), - SPH_C64(0x1079A2B2A2A2DB59), SPH_C64(0x6503EA8FEAEAE9C9), - SPH_C64(0xEC0F658965656ACA), SPH_C64(0x68B9BAD2BABA0369), - SPH_C64(0x93652FBC2F2F4A5E), SPH_C64(0xE74EC027C0C08E9D), - SPH_C64(0x81BEDE5FDEDE60A1), SPH_C64(0x6CE01C701C1CFC38), - SPH_C64(0x2EBBFDD3FDFD46E7), SPH_C64(0x64524D294D4D1F9A), - SPH_C64(0xE0E4927292927639), SPH_C64(0xBC8F75C97575FAEA), - SPH_C64(0x1E3006180606360C), SPH_C64(0x98248A128A8AAE09), - SPH_C64(0x40F9B2F2B2B24B79), SPH_C64(0x5963E6BFE6E685D1), - SPH_C64(0x36700E380E0E7E1C), SPH_C64(0x63F81F7C1F1FE73E), - SPH_C64(0xF7376295626255C4), SPH_C64(0xA3EED477D4D43AB5), - SPH_C64(0x3229A89AA8A8814D), SPH_C64(0xF4C4966296965231), - SPH_C64(0x3A9BF9C3F9F962EF), SPH_C64(0xF666C533C5C5A397), - SPH_C64(0xB13525942525104A), SPH_C64(0x20F259795959ABB2), - SPH_C64(0xAE54842A8484D015), SPH_C64(0xA7B772D57272C5E4), - SPH_C64(0xDDD539E43939EC72), SPH_C64(0x615A4C2D4C4C1698), - SPH_C64(0x3BCA5E655E5E94BC), SPH_C64(0x85E778FD78789FF0), - SPH_C64(0xD8DD38E03838E570), SPH_C64(0x86148C0A8C8C9805), - SPH_C64(0xB2C6D163D1D117BF), SPH_C64(0x0B41A5AEA5A5E457), - SPH_C64(0x4D43E2AFE2E2A1D9), SPH_C64(0xF82F619961614EC2), - SPH_C64(0x45F1B3F6B3B3427B), SPH_C64(0xA515218421213442), - SPH_C64(0xD6949C4A9C9C0825), SPH_C64(0x66F01E781E1EEE3C), - SPH_C64(0x5222431143436186), SPH_C64(0xFC76C73BC7C7B193), - SPH_C64(0x2BB3FCD7FCFC4FE5), SPH_C64(0x1420041004042408), - SPH_C64(0x08B251595151E3A2), SPH_C64(0xC7BC995E9999252F), - SPH_C64(0xC44F6DA96D6D22DA), SPH_C64(0x39680D340D0D651A), - SPH_C64(0x3583FACFFAFA79E9), SPH_C64(0x84B6DF5BDFDF69A3), - SPH_C64(0x9BD77EE57E7EA9FC), SPH_C64(0xB43D249024241948), - SPH_C64(0xD7C53BEC3B3BFE76), SPH_C64(0x3D31AB96ABAB9A4B), - SPH_C64(0xD13ECE1FCECEF081), SPH_C64(0x5588114411119922), - SPH_C64(0x890C8F068F8F8303), SPH_C64(0x6B4A4E254E4E049C), - SPH_C64(0x51D1B7E6B7B76673), SPH_C64(0x600BEB8BEBEBE0CB), - SPH_C64(0xCCFD3CF03C3CC178), SPH_C64(0xBF7C813E8181FD1F), - SPH_C64(0xFED4946A94944035), SPH_C64(0x0CEBF7FBF7F71CF3), - SPH_C64(0x67A1B9DEB9B9186F), SPH_C64(0x5F98134C13138B26), - SPH_C64(0x9C7D2CB02C2C5158), SPH_C64(0xB8D6D36BD3D305BB), - SPH_C64(0x5C6BE7BBE7E78CD3), SPH_C64(0xCB576EA56E6E39DC), - SPH_C64(0xF36EC437C4C4AA95), SPH_C64(0x0F18030C03031B06), - SPH_C64(0x138A56455656DCAC), SPH_C64(0x491A440D44445E88), - SPH_C64(0x9EDF7FE17F7FA0FE), SPH_C64(0x3721A99EA9A9884F), - SPH_C64(0x824D2AA82A2A6754), SPH_C64(0x6DB1BBD6BBBB0A6B), - SPH_C64(0xE246C123C1C1879F), SPH_C64(0x02A253515353F1A6), - SPH_C64(0x8BAEDC57DCDC72A5), SPH_C64(0x27580B2C0B0B5316), - SPH_C64(0xD39C9D4E9D9D0127), SPH_C64(0xC1476CAD6C6C2BD8), - SPH_C64(0xF59531C43131A462), SPH_C64(0xB98774CD7474F3E8), - SPH_C64(0x09E3F6FFF6F615F1), SPH_C64(0x430A460546464C8C), - SPH_C64(0x2609AC8AACACA545), SPH_C64(0x973C891E8989B50F), - SPH_C64(0x44A014501414B428), SPH_C64(0x425BE1A3E1E1BADF), - SPH_C64(0x4EB016581616A62C), SPH_C64(0xD2CD3AE83A3AF774), - SPH_C64(0xD06F69B9696906D2), SPH_C64(0x2D48092409094112), - SPH_C64(0xADA770DD7070D7E0), SPH_C64(0x54D9B6E2B6B66F71), - SPH_C64(0xB7CED067D0D01EBD), SPH_C64(0x7E3BED93EDEDD6C7), - SPH_C64(0xDB2ECC17CCCCE285), SPH_C64(0x572A421542426884), - SPH_C64(0xC2B4985A98982C2D), SPH_C64(0x0E49A4AAA4A4ED55), - SPH_C64(0x885D28A028287550), SPH_C64(0x31DA5C6D5C5C86B8), - SPH_C64(0x3F93F8C7F8F86BED), SPH_C64(0xA44486228686C211) -}; - -static const sph_u64 plain_T3[256] = { - SPH_C64(0xC018601818D83078), SPH_C64(0x05238C23232646AF), - SPH_C64(0x7EC63FC6C6B891F9), SPH_C64(0x13E887E8E8FBCD6F), - SPH_C64(0x4C87268787CB13A1), SPH_C64(0xA9B8DAB8B8116D62), - SPH_C64(0x0801040101090205), SPH_C64(0x424F214F4F0D9E6E), - SPH_C64(0xAD36D836369B6CEE), SPH_C64(0x59A6A2A6A6FF5104), - SPH_C64(0xDED26FD2D20CB9BD), SPH_C64(0xFBF5F3F5F50EF706), - SPH_C64(0xEF79F9797996F280), SPH_C64(0x5F6FA16F6F30DECE), - SPH_C64(0xFC917E91916D3FEF), SPH_C64(0xAA52555252F8A407), - SPH_C64(0x27609D606047C0FD), SPH_C64(0x89BCCABCBC356576), - SPH_C64(0xAC9B569B9B372BCD), SPH_C64(0x048E028E8E8A018C), - SPH_C64(0x71A3B6A3A3D25B15), SPH_C64(0x600C300C0C6C183C), - SPH_C64(0xFF7BF17B7B84F68A), SPH_C64(0xB535D43535806AE1), - SPH_C64(0xE81D741D1DF53A69), SPH_C64(0x53E0A7E0E0B3DD47), - SPH_C64(0xF6D77BD7D721B3AC), SPH_C64(0x5EC22FC2C29C99ED), - SPH_C64(0x6D2EB82E2E435C96), SPH_C64(0x624B314B4B29967A), - SPH_C64(0xA3FEDFFEFE5DE121), SPH_C64(0x8257415757D5AE16), - SPH_C64(0xA815541515BD2A41), SPH_C64(0x9F77C17777E8EEB6), - SPH_C64(0xA537DC3737926EEB), SPH_C64(0x7BE5B3E5E59ED756), - SPH_C64(0x8C9F469F9F1323D9), SPH_C64(0xD3F0E7F0F023FD17), - SPH_C64(0x6A4A354A4A20947F), SPH_C64(0x9EDA4FDADA44A995), - SPH_C64(0xFA587D5858A2B025), SPH_C64(0x06C903C9C9CF8FCA), - SPH_C64(0x5529A429297C528D), SPH_C64(0x500A280A0A5A1422), - SPH_C64(0xE1B1FEB1B1507F4F), SPH_C64(0x69A0BAA0A0C95D1A), - SPH_C64(0x7F6BB16B6B14D6DA), SPH_C64(0x5C852E8585D917AB), - SPH_C64(0x81BDCEBDBD3C6773), SPH_C64(0xD25D695D5D8FBA34), - SPH_C64(0x8010401010902050), SPH_C64(0xF3F4F7F4F407F503), - SPH_C64(0x16CB0BCBCBDD8BC0), SPH_C64(0xED3EF83E3ED37CC6), - SPH_C64(0x28051405052D0A11), SPH_C64(0x1F6781676778CEE6), - SPH_C64(0x73E4B7E4E497D553), SPH_C64(0x25279C2727024EBB), - SPH_C64(0x3241194141738258), SPH_C64(0x2C8B168B8BA70B9D), - SPH_C64(0x51A7A6A7A7F65301), SPH_C64(0xCF7DE97D7DB2FA94), - SPH_C64(0xDC956E95954937FB), SPH_C64(0x8ED847D8D856AD9F), - SPH_C64(0x8BFBCBFBFB70EB30), SPH_C64(0x23EE9FEEEECDC171), - SPH_C64(0xC77CED7C7CBBF891), SPH_C64(0x176685666671CCE3), - SPH_C64(0xA6DD53DDDD7BA78E), SPH_C64(0xB8175C1717AF2E4B), - SPH_C64(0x0247014747458E46), SPH_C64(0x849E429E9E1A21DC), - SPH_C64(0x1ECA0FCACAD489C5), SPH_C64(0x752DB42D2D585A99), - SPH_C64(0x91BFC6BFBF2E6379), SPH_C64(0x38071C07073F0E1B), - SPH_C64(0x01AD8EADADAC4723), SPH_C64(0xEA5A755A5AB0B42F), - SPH_C64(0x6C83368383EF1BB5), SPH_C64(0x8533CC3333B666FF), - SPH_C64(0x3F639163635CC6F2), SPH_C64(0x100208020212040A), - SPH_C64(0x39AA92AAAA934938), SPH_C64(0xAF71D97171DEE2A8), - SPH_C64(0x0EC807C8C8C68DCF), SPH_C64(0xC819641919D1327D), - SPH_C64(0x72493949493B9270), SPH_C64(0x86D943D9D95FAF9A), - SPH_C64(0xC3F2EFF2F231F91D), SPH_C64(0x4BE3ABE3E3A8DB48), - SPH_C64(0xE25B715B5BB9B62A), SPH_C64(0x34881A8888BC0D92), - SPH_C64(0xA49A529A9A3E29C8), SPH_C64(0x2D269826260B4CBE), - SPH_C64(0x8D32C83232BF64FA), SPH_C64(0xE9B0FAB0B0597D4A), - SPH_C64(0x1BE983E9E9F2CF6A), SPH_C64(0x780F3C0F0F771E33), - SPH_C64(0xE6D573D5D533B7A6), SPH_C64(0x74803A8080F41DBA), - SPH_C64(0x99BEC2BEBE27617C), SPH_C64(0x26CD13CDCDEB87DE), - SPH_C64(0xBD34D034348968E4), SPH_C64(0x7A483D4848329075), - SPH_C64(0xABFFDBFFFF54E324), SPH_C64(0xF77AF57A7A8DF48F), - SPH_C64(0xF4907A9090643DEA), SPH_C64(0xC25F615F5F9DBE3E), - SPH_C64(0x1D208020203D40A0), SPH_C64(0x6768BD68680FD0D5), - SPH_C64(0xD01A681A1ACA3472), SPH_C64(0x19AE82AEAEB7412C), - SPH_C64(0xC9B4EAB4B47D755E), SPH_C64(0x9A544D5454CEA819), - SPH_C64(0xEC937693937F3BE5), SPH_C64(0x0D228822222F44AA), - SPH_C64(0x07648D646463C8E9), SPH_C64(0xDBF1E3F1F12AFF12), - SPH_C64(0xBF73D17373CCE6A2), SPH_C64(0x901248121282245A), - SPH_C64(0x3A401D40407A805D), SPH_C64(0x4008200808481028), - SPH_C64(0x56C32BC3C3959BE8), SPH_C64(0x33EC97ECECDFC57B), - SPH_C64(0x96DB4BDBDB4DAB90), SPH_C64(0x61A1BEA1A1C05F1F), - SPH_C64(0x1C8D0E8D8D910783), SPH_C64(0xF53DF43D3DC87AC9), - SPH_C64(0xCC976697975B33F1), SPH_C64(0x0000000000000000), - SPH_C64(0x36CF1BCFCFF983D4), SPH_C64(0x452BAC2B2B6E5687), - SPH_C64(0x9776C57676E1ECB3), SPH_C64(0x6482328282E619B0), - SPH_C64(0xFED67FD6D628B1A9), SPH_C64(0xD81B6C1B1BC33677), - SPH_C64(0xC1B5EEB5B574775B), SPH_C64(0x11AF86AFAFBE4329), - SPH_C64(0x776AB56A6A1DD4DF), SPH_C64(0xBA505D5050EAA00D), - SPH_C64(0x1245094545578A4C), SPH_C64(0xCBF3EBF3F338FB18), - SPH_C64(0x9D30C03030AD60F0), SPH_C64(0x2BEF9BEFEFC4C374), - SPH_C64(0xE53FFC3F3FDA7EC3), SPH_C64(0x9255495555C7AA1C), - SPH_C64(0x79A2B2A2A2DB5910), SPH_C64(0x03EA8FEAEAE9C965), - SPH_C64(0x0F658965656ACAEC), SPH_C64(0xB9BAD2BABA036968), - SPH_C64(0x652FBC2F2F4A5E93), SPH_C64(0x4EC027C0C08E9DE7), - SPH_C64(0xBEDE5FDEDE60A181), SPH_C64(0xE01C701C1CFC386C), - SPH_C64(0xBBFDD3FDFD46E72E), SPH_C64(0x524D294D4D1F9A64), - SPH_C64(0xE4927292927639E0), SPH_C64(0x8F75C97575FAEABC), - SPH_C64(0x3006180606360C1E), SPH_C64(0x248A128A8AAE0998), - SPH_C64(0xF9B2F2B2B24B7940), SPH_C64(0x63E6BFE6E685D159), - SPH_C64(0x700E380E0E7E1C36), SPH_C64(0xF81F7C1F1FE73E63), - SPH_C64(0x376295626255C4F7), SPH_C64(0xEED477D4D43AB5A3), - SPH_C64(0x29A89AA8A8814D32), SPH_C64(0xC4966296965231F4), - SPH_C64(0x9BF9C3F9F962EF3A), SPH_C64(0x66C533C5C5A397F6), - SPH_C64(0x3525942525104AB1), SPH_C64(0xF259795959ABB220), - SPH_C64(0x54842A8484D015AE), SPH_C64(0xB772D57272C5E4A7), - SPH_C64(0xD539E43939EC72DD), SPH_C64(0x5A4C2D4C4C169861), - SPH_C64(0xCA5E655E5E94BC3B), SPH_C64(0xE778FD78789FF085), - SPH_C64(0xDD38E03838E570D8), SPH_C64(0x148C0A8C8C980586), - SPH_C64(0xC6D163D1D117BFB2), SPH_C64(0x41A5AEA5A5E4570B), - SPH_C64(0x43E2AFE2E2A1D94D), SPH_C64(0x2F619961614EC2F8), - SPH_C64(0xF1B3F6B3B3427B45), SPH_C64(0x15218421213442A5), - SPH_C64(0x949C4A9C9C0825D6), SPH_C64(0xF01E781E1EEE3C66), - SPH_C64(0x2243114343618652), SPH_C64(0x76C73BC7C7B193FC), - SPH_C64(0xB3FCD7FCFC4FE52B), SPH_C64(0x2004100404240814), - SPH_C64(0xB251595151E3A208), SPH_C64(0xBC995E9999252FC7), - SPH_C64(0x4F6DA96D6D22DAC4), SPH_C64(0x680D340D0D651A39), - SPH_C64(0x83FACFFAFA79E935), SPH_C64(0xB6DF5BDFDF69A384), - SPH_C64(0xD77EE57E7EA9FC9B), SPH_C64(0x3D249024241948B4), - SPH_C64(0xC53BEC3B3BFE76D7), SPH_C64(0x31AB96ABAB9A4B3D), - SPH_C64(0x3ECE1FCECEF081D1), SPH_C64(0x8811441111992255), - SPH_C64(0x0C8F068F8F830389), SPH_C64(0x4A4E254E4E049C6B), - SPH_C64(0xD1B7E6B7B7667351), SPH_C64(0x0BEB8BEBEBE0CB60), - SPH_C64(0xFD3CF03C3CC178CC), SPH_C64(0x7C813E8181FD1FBF), - SPH_C64(0xD4946A94944035FE), SPH_C64(0xEBF7FBF7F71CF30C), - SPH_C64(0xA1B9DEB9B9186F67), SPH_C64(0x98134C13138B265F), - SPH_C64(0x7D2CB02C2C51589C), SPH_C64(0xD6D36BD3D305BBB8), - SPH_C64(0x6BE7BBE7E78CD35C), SPH_C64(0x576EA56E6E39DCCB), - SPH_C64(0x6EC437C4C4AA95F3), SPH_C64(0x18030C03031B060F), - SPH_C64(0x8A56455656DCAC13), SPH_C64(0x1A440D44445E8849), - SPH_C64(0xDF7FE17F7FA0FE9E), SPH_C64(0x21A99EA9A9884F37), - SPH_C64(0x4D2AA82A2A675482), SPH_C64(0xB1BBD6BBBB0A6B6D), - SPH_C64(0x46C123C1C1879FE2), SPH_C64(0xA253515353F1A602), - SPH_C64(0xAEDC57DCDC72A58B), SPH_C64(0x580B2C0B0B531627), - SPH_C64(0x9C9D4E9D9D0127D3), SPH_C64(0x476CAD6C6C2BD8C1), - SPH_C64(0x9531C43131A462F5), SPH_C64(0x8774CD7474F3E8B9), - SPH_C64(0xE3F6FFF6F615F109), SPH_C64(0x0A460546464C8C43), - SPH_C64(0x09AC8AACACA54526), SPH_C64(0x3C891E8989B50F97), - SPH_C64(0xA014501414B42844), SPH_C64(0x5BE1A3E1E1BADF42), - SPH_C64(0xB016581616A62C4E), SPH_C64(0xCD3AE83A3AF774D2), - SPH_C64(0x6F69B9696906D2D0), SPH_C64(0x480924090941122D), - SPH_C64(0xA770DD7070D7E0AD), SPH_C64(0xD9B6E2B6B66F7154), - SPH_C64(0xCED067D0D01EBDB7), SPH_C64(0x3BED93EDEDD6C77E), - SPH_C64(0x2ECC17CCCCE285DB), SPH_C64(0x2A42154242688457), - SPH_C64(0xB4985A98982C2DC2), SPH_C64(0x49A4AAA4A4ED550E), - SPH_C64(0x5D28A02828755088), SPH_C64(0xDA5C6D5C5C86B831), - SPH_C64(0x93F8C7F8F86BED3F), SPH_C64(0x4486228686C211A4) -}; - -static const sph_u64 plain_T4[256] = { - SPH_C64(0x18601818D83078C0), SPH_C64(0x238C23232646AF05), - SPH_C64(0xC63FC6C6B891F97E), SPH_C64(0xE887E8E8FBCD6F13), - SPH_C64(0x87268787CB13A14C), SPH_C64(0xB8DAB8B8116D62A9), - SPH_C64(0x0104010109020508), SPH_C64(0x4F214F4F0D9E6E42), - SPH_C64(0x36D836369B6CEEAD), SPH_C64(0xA6A2A6A6FF510459), - SPH_C64(0xD26FD2D20CB9BDDE), SPH_C64(0xF5F3F5F50EF706FB), - SPH_C64(0x79F9797996F280EF), SPH_C64(0x6FA16F6F30DECE5F), - SPH_C64(0x917E91916D3FEFFC), SPH_C64(0x52555252F8A407AA), - SPH_C64(0x609D606047C0FD27), SPH_C64(0xBCCABCBC35657689), - SPH_C64(0x9B569B9B372BCDAC), SPH_C64(0x8E028E8E8A018C04), - SPH_C64(0xA3B6A3A3D25B1571), SPH_C64(0x0C300C0C6C183C60), - SPH_C64(0x7BF17B7B84F68AFF), SPH_C64(0x35D43535806AE1B5), - SPH_C64(0x1D741D1DF53A69E8), SPH_C64(0xE0A7E0E0B3DD4753), - SPH_C64(0xD77BD7D721B3ACF6), SPH_C64(0xC22FC2C29C99ED5E), - SPH_C64(0x2EB82E2E435C966D), SPH_C64(0x4B314B4B29967A62), - SPH_C64(0xFEDFFEFE5DE121A3), SPH_C64(0x57415757D5AE1682), - SPH_C64(0x15541515BD2A41A8), SPH_C64(0x77C17777E8EEB69F), - SPH_C64(0x37DC3737926EEBA5), SPH_C64(0xE5B3E5E59ED7567B), - SPH_C64(0x9F469F9F1323D98C), SPH_C64(0xF0E7F0F023FD17D3), - SPH_C64(0x4A354A4A20947F6A), SPH_C64(0xDA4FDADA44A9959E), - SPH_C64(0x587D5858A2B025FA), SPH_C64(0xC903C9C9CF8FCA06), - SPH_C64(0x29A429297C528D55), SPH_C64(0x0A280A0A5A142250), - SPH_C64(0xB1FEB1B1507F4FE1), SPH_C64(0xA0BAA0A0C95D1A69), - SPH_C64(0x6BB16B6B14D6DA7F), SPH_C64(0x852E8585D917AB5C), - SPH_C64(0xBDCEBDBD3C677381), SPH_C64(0x5D695D5D8FBA34D2), - SPH_C64(0x1040101090205080), SPH_C64(0xF4F7F4F407F503F3), - SPH_C64(0xCB0BCBCBDD8BC016), SPH_C64(0x3EF83E3ED37CC6ED), - SPH_C64(0x051405052D0A1128), SPH_C64(0x6781676778CEE61F), - SPH_C64(0xE4B7E4E497D55373), SPH_C64(0x279C2727024EBB25), - SPH_C64(0x4119414173825832), SPH_C64(0x8B168B8BA70B9D2C), - SPH_C64(0xA7A6A7A7F6530151), SPH_C64(0x7DE97D7DB2FA94CF), - SPH_C64(0x956E95954937FBDC), SPH_C64(0xD847D8D856AD9F8E), - SPH_C64(0xFBCBFBFB70EB308B), SPH_C64(0xEE9FEEEECDC17123), - SPH_C64(0x7CED7C7CBBF891C7), SPH_C64(0x6685666671CCE317), - SPH_C64(0xDD53DDDD7BA78EA6), SPH_C64(0x175C1717AF2E4BB8), - SPH_C64(0x47014747458E4602), SPH_C64(0x9E429E9E1A21DC84), - SPH_C64(0xCA0FCACAD489C51E), SPH_C64(0x2DB42D2D585A9975), - SPH_C64(0xBFC6BFBF2E637991), SPH_C64(0x071C07073F0E1B38), - SPH_C64(0xAD8EADADAC472301), SPH_C64(0x5A755A5AB0B42FEA), - SPH_C64(0x83368383EF1BB56C), SPH_C64(0x33CC3333B666FF85), - SPH_C64(0x639163635CC6F23F), SPH_C64(0x0208020212040A10), - SPH_C64(0xAA92AAAA93493839), SPH_C64(0x71D97171DEE2A8AF), - SPH_C64(0xC807C8C8C68DCF0E), SPH_C64(0x19641919D1327DC8), - SPH_C64(0x493949493B927072), SPH_C64(0xD943D9D95FAF9A86), - SPH_C64(0xF2EFF2F231F91DC3), SPH_C64(0xE3ABE3E3A8DB484B), - SPH_C64(0x5B715B5BB9B62AE2), SPH_C64(0x881A8888BC0D9234), - SPH_C64(0x9A529A9A3E29C8A4), SPH_C64(0x269826260B4CBE2D), - SPH_C64(0x32C83232BF64FA8D), SPH_C64(0xB0FAB0B0597D4AE9), - SPH_C64(0xE983E9E9F2CF6A1B), SPH_C64(0x0F3C0F0F771E3378), - SPH_C64(0xD573D5D533B7A6E6), SPH_C64(0x803A8080F41DBA74), - SPH_C64(0xBEC2BEBE27617C99), SPH_C64(0xCD13CDCDEB87DE26), - SPH_C64(0x34D034348968E4BD), SPH_C64(0x483D48483290757A), - SPH_C64(0xFFDBFFFF54E324AB), SPH_C64(0x7AF57A7A8DF48FF7), - SPH_C64(0x907A9090643DEAF4), SPH_C64(0x5F615F5F9DBE3EC2), - SPH_C64(0x208020203D40A01D), SPH_C64(0x68BD68680FD0D567), - SPH_C64(0x1A681A1ACA3472D0), SPH_C64(0xAE82AEAEB7412C19), - SPH_C64(0xB4EAB4B47D755EC9), SPH_C64(0x544D5454CEA8199A), - SPH_C64(0x937693937F3BE5EC), SPH_C64(0x228822222F44AA0D), - SPH_C64(0x648D646463C8E907), SPH_C64(0xF1E3F1F12AFF12DB), - SPH_C64(0x73D17373CCE6A2BF), SPH_C64(0x1248121282245A90), - SPH_C64(0x401D40407A805D3A), SPH_C64(0x0820080848102840), - SPH_C64(0xC32BC3C3959BE856), SPH_C64(0xEC97ECECDFC57B33), - SPH_C64(0xDB4BDBDB4DAB9096), SPH_C64(0xA1BEA1A1C05F1F61), - SPH_C64(0x8D0E8D8D9107831C), SPH_C64(0x3DF43D3DC87AC9F5), - SPH_C64(0x976697975B33F1CC), SPH_C64(0x0000000000000000), - SPH_C64(0xCF1BCFCFF983D436), SPH_C64(0x2BAC2B2B6E568745), - SPH_C64(0x76C57676E1ECB397), SPH_C64(0x82328282E619B064), - SPH_C64(0xD67FD6D628B1A9FE), SPH_C64(0x1B6C1B1BC33677D8), - SPH_C64(0xB5EEB5B574775BC1), SPH_C64(0xAF86AFAFBE432911), - SPH_C64(0x6AB56A6A1DD4DF77), SPH_C64(0x505D5050EAA00DBA), - SPH_C64(0x45094545578A4C12), SPH_C64(0xF3EBF3F338FB18CB), - SPH_C64(0x30C03030AD60F09D), SPH_C64(0xEF9BEFEFC4C3742B), - SPH_C64(0x3FFC3F3FDA7EC3E5), SPH_C64(0x55495555C7AA1C92), - SPH_C64(0xA2B2A2A2DB591079), SPH_C64(0xEA8FEAEAE9C96503), - SPH_C64(0x658965656ACAEC0F), SPH_C64(0xBAD2BABA036968B9), - SPH_C64(0x2FBC2F2F4A5E9365), SPH_C64(0xC027C0C08E9DE74E), - SPH_C64(0xDE5FDEDE60A181BE), SPH_C64(0x1C701C1CFC386CE0), - SPH_C64(0xFDD3FDFD46E72EBB), SPH_C64(0x4D294D4D1F9A6452), - SPH_C64(0x927292927639E0E4), SPH_C64(0x75C97575FAEABC8F), - SPH_C64(0x06180606360C1E30), SPH_C64(0x8A128A8AAE099824), - SPH_C64(0xB2F2B2B24B7940F9), SPH_C64(0xE6BFE6E685D15963), - SPH_C64(0x0E380E0E7E1C3670), SPH_C64(0x1F7C1F1FE73E63F8), - SPH_C64(0x6295626255C4F737), SPH_C64(0xD477D4D43AB5A3EE), - SPH_C64(0xA89AA8A8814D3229), SPH_C64(0x966296965231F4C4), - SPH_C64(0xF9C3F9F962EF3A9B), SPH_C64(0xC533C5C5A397F666), - SPH_C64(0x25942525104AB135), SPH_C64(0x59795959ABB220F2), - SPH_C64(0x842A8484D015AE54), SPH_C64(0x72D57272C5E4A7B7), - SPH_C64(0x39E43939EC72DDD5), SPH_C64(0x4C2D4C4C1698615A), - SPH_C64(0x5E655E5E94BC3BCA), SPH_C64(0x78FD78789FF085E7), - SPH_C64(0x38E03838E570D8DD), SPH_C64(0x8C0A8C8C98058614), - SPH_C64(0xD163D1D117BFB2C6), SPH_C64(0xA5AEA5A5E4570B41), - SPH_C64(0xE2AFE2E2A1D94D43), SPH_C64(0x619961614EC2F82F), - SPH_C64(0xB3F6B3B3427B45F1), SPH_C64(0x218421213442A515), - SPH_C64(0x9C4A9C9C0825D694), SPH_C64(0x1E781E1EEE3C66F0), - SPH_C64(0x4311434361865222), SPH_C64(0xC73BC7C7B193FC76), - SPH_C64(0xFCD7FCFC4FE52BB3), SPH_C64(0x0410040424081420), - SPH_C64(0x51595151E3A208B2), SPH_C64(0x995E9999252FC7BC), - SPH_C64(0x6DA96D6D22DAC44F), SPH_C64(0x0D340D0D651A3968), - SPH_C64(0xFACFFAFA79E93583), SPH_C64(0xDF5BDFDF69A384B6), - SPH_C64(0x7EE57E7EA9FC9BD7), SPH_C64(0x249024241948B43D), - SPH_C64(0x3BEC3B3BFE76D7C5), SPH_C64(0xAB96ABAB9A4B3D31), - SPH_C64(0xCE1FCECEF081D13E), SPH_C64(0x1144111199225588), - SPH_C64(0x8F068F8F8303890C), SPH_C64(0x4E254E4E049C6B4A), - SPH_C64(0xB7E6B7B7667351D1), SPH_C64(0xEB8BEBEBE0CB600B), - SPH_C64(0x3CF03C3CC178CCFD), SPH_C64(0x813E8181FD1FBF7C), - SPH_C64(0x946A94944035FED4), SPH_C64(0xF7FBF7F71CF30CEB), - SPH_C64(0xB9DEB9B9186F67A1), SPH_C64(0x134C13138B265F98), - SPH_C64(0x2CB02C2C51589C7D), SPH_C64(0xD36BD3D305BBB8D6), - SPH_C64(0xE7BBE7E78CD35C6B), SPH_C64(0x6EA56E6E39DCCB57), - SPH_C64(0xC437C4C4AA95F36E), SPH_C64(0x030C03031B060F18), - SPH_C64(0x56455656DCAC138A), SPH_C64(0x440D44445E88491A), - SPH_C64(0x7FE17F7FA0FE9EDF), SPH_C64(0xA99EA9A9884F3721), - SPH_C64(0x2AA82A2A6754824D), SPH_C64(0xBBD6BBBB0A6B6DB1), - SPH_C64(0xC123C1C1879FE246), SPH_C64(0x53515353F1A602A2), - SPH_C64(0xDC57DCDC72A58BAE), SPH_C64(0x0B2C0B0B53162758), - SPH_C64(0x9D4E9D9D0127D39C), SPH_C64(0x6CAD6C6C2BD8C147), - SPH_C64(0x31C43131A462F595), SPH_C64(0x74CD7474F3E8B987), - SPH_C64(0xF6FFF6F615F109E3), SPH_C64(0x460546464C8C430A), - SPH_C64(0xAC8AACACA5452609), SPH_C64(0x891E8989B50F973C), - SPH_C64(0x14501414B42844A0), SPH_C64(0xE1A3E1E1BADF425B), - SPH_C64(0x16581616A62C4EB0), SPH_C64(0x3AE83A3AF774D2CD), - SPH_C64(0x69B9696906D2D06F), SPH_C64(0x0924090941122D48), - SPH_C64(0x70DD7070D7E0ADA7), SPH_C64(0xB6E2B6B66F7154D9), - SPH_C64(0xD067D0D01EBDB7CE), SPH_C64(0xED93EDEDD6C77E3B), - SPH_C64(0xCC17CCCCE285DB2E), SPH_C64(0x421542426884572A), - SPH_C64(0x985A98982C2DC2B4), SPH_C64(0xA4AAA4A4ED550E49), - SPH_C64(0x28A028287550885D), SPH_C64(0x5C6D5C5C86B831DA), - SPH_C64(0xF8C7F8F86BED3F93), SPH_C64(0x86228686C211A444) -}; - -static const sph_u64 plain_T5[256] = { - SPH_C64(0x601818D83078C018), SPH_C64(0x8C23232646AF0523), - SPH_C64(0x3FC6C6B891F97EC6), SPH_C64(0x87E8E8FBCD6F13E8), - SPH_C64(0x268787CB13A14C87), SPH_C64(0xDAB8B8116D62A9B8), - SPH_C64(0x0401010902050801), SPH_C64(0x214F4F0D9E6E424F), - SPH_C64(0xD836369B6CEEAD36), SPH_C64(0xA2A6A6FF510459A6), - SPH_C64(0x6FD2D20CB9BDDED2), SPH_C64(0xF3F5F50EF706FBF5), - SPH_C64(0xF9797996F280EF79), SPH_C64(0xA16F6F30DECE5F6F), - SPH_C64(0x7E91916D3FEFFC91), SPH_C64(0x555252F8A407AA52), - SPH_C64(0x9D606047C0FD2760), SPH_C64(0xCABCBC35657689BC), - SPH_C64(0x569B9B372BCDAC9B), SPH_C64(0x028E8E8A018C048E), - SPH_C64(0xB6A3A3D25B1571A3), SPH_C64(0x300C0C6C183C600C), - SPH_C64(0xF17B7B84F68AFF7B), SPH_C64(0xD43535806AE1B535), - SPH_C64(0x741D1DF53A69E81D), SPH_C64(0xA7E0E0B3DD4753E0), - SPH_C64(0x7BD7D721B3ACF6D7), SPH_C64(0x2FC2C29C99ED5EC2), - SPH_C64(0xB82E2E435C966D2E), SPH_C64(0x314B4B29967A624B), - SPH_C64(0xDFFEFE5DE121A3FE), SPH_C64(0x415757D5AE168257), - SPH_C64(0x541515BD2A41A815), SPH_C64(0xC17777E8EEB69F77), - SPH_C64(0xDC3737926EEBA537), SPH_C64(0xB3E5E59ED7567BE5), - SPH_C64(0x469F9F1323D98C9F), SPH_C64(0xE7F0F023FD17D3F0), - SPH_C64(0x354A4A20947F6A4A), SPH_C64(0x4FDADA44A9959EDA), - SPH_C64(0x7D5858A2B025FA58), SPH_C64(0x03C9C9CF8FCA06C9), - SPH_C64(0xA429297C528D5529), SPH_C64(0x280A0A5A1422500A), - SPH_C64(0xFEB1B1507F4FE1B1), SPH_C64(0xBAA0A0C95D1A69A0), - SPH_C64(0xB16B6B14D6DA7F6B), SPH_C64(0x2E8585D917AB5C85), - SPH_C64(0xCEBDBD3C677381BD), SPH_C64(0x695D5D8FBA34D25D), - SPH_C64(0x4010109020508010), SPH_C64(0xF7F4F407F503F3F4), - SPH_C64(0x0BCBCBDD8BC016CB), SPH_C64(0xF83E3ED37CC6ED3E), - SPH_C64(0x1405052D0A112805), SPH_C64(0x81676778CEE61F67), - SPH_C64(0xB7E4E497D55373E4), SPH_C64(0x9C2727024EBB2527), - SPH_C64(0x1941417382583241), SPH_C64(0x168B8BA70B9D2C8B), - SPH_C64(0xA6A7A7F6530151A7), SPH_C64(0xE97D7DB2FA94CF7D), - SPH_C64(0x6E95954937FBDC95), SPH_C64(0x47D8D856AD9F8ED8), - SPH_C64(0xCBFBFB70EB308BFB), SPH_C64(0x9FEEEECDC17123EE), - SPH_C64(0xED7C7CBBF891C77C), SPH_C64(0x85666671CCE31766), - SPH_C64(0x53DDDD7BA78EA6DD), SPH_C64(0x5C1717AF2E4BB817), - SPH_C64(0x014747458E460247), SPH_C64(0x429E9E1A21DC849E), - SPH_C64(0x0FCACAD489C51ECA), SPH_C64(0xB42D2D585A99752D), - SPH_C64(0xC6BFBF2E637991BF), SPH_C64(0x1C07073F0E1B3807), - SPH_C64(0x8EADADAC472301AD), SPH_C64(0x755A5AB0B42FEA5A), - SPH_C64(0x368383EF1BB56C83), SPH_C64(0xCC3333B666FF8533), - SPH_C64(0x9163635CC6F23F63), SPH_C64(0x08020212040A1002), - SPH_C64(0x92AAAA93493839AA), SPH_C64(0xD97171DEE2A8AF71), - SPH_C64(0x07C8C8C68DCF0EC8), SPH_C64(0x641919D1327DC819), - SPH_C64(0x3949493B92707249), SPH_C64(0x43D9D95FAF9A86D9), - SPH_C64(0xEFF2F231F91DC3F2), SPH_C64(0xABE3E3A8DB484BE3), - SPH_C64(0x715B5BB9B62AE25B), SPH_C64(0x1A8888BC0D923488), - SPH_C64(0x529A9A3E29C8A49A), SPH_C64(0x9826260B4CBE2D26), - SPH_C64(0xC83232BF64FA8D32), SPH_C64(0xFAB0B0597D4AE9B0), - SPH_C64(0x83E9E9F2CF6A1BE9), SPH_C64(0x3C0F0F771E33780F), - SPH_C64(0x73D5D533B7A6E6D5), SPH_C64(0x3A8080F41DBA7480), - SPH_C64(0xC2BEBE27617C99BE), SPH_C64(0x13CDCDEB87DE26CD), - SPH_C64(0xD034348968E4BD34), SPH_C64(0x3D48483290757A48), - SPH_C64(0xDBFFFF54E324ABFF), SPH_C64(0xF57A7A8DF48FF77A), - SPH_C64(0x7A9090643DEAF490), SPH_C64(0x615F5F9DBE3EC25F), - SPH_C64(0x8020203D40A01D20), SPH_C64(0xBD68680FD0D56768), - SPH_C64(0x681A1ACA3472D01A), SPH_C64(0x82AEAEB7412C19AE), - SPH_C64(0xEAB4B47D755EC9B4), SPH_C64(0x4D5454CEA8199A54), - SPH_C64(0x7693937F3BE5EC93), SPH_C64(0x8822222F44AA0D22), - SPH_C64(0x8D646463C8E90764), SPH_C64(0xE3F1F12AFF12DBF1), - SPH_C64(0xD17373CCE6A2BF73), SPH_C64(0x48121282245A9012), - SPH_C64(0x1D40407A805D3A40), SPH_C64(0x2008084810284008), - SPH_C64(0x2BC3C3959BE856C3), SPH_C64(0x97ECECDFC57B33EC), - SPH_C64(0x4BDBDB4DAB9096DB), SPH_C64(0xBEA1A1C05F1F61A1), - SPH_C64(0x0E8D8D9107831C8D), SPH_C64(0xF43D3DC87AC9F53D), - SPH_C64(0x6697975B33F1CC97), SPH_C64(0x0000000000000000), - SPH_C64(0x1BCFCFF983D436CF), SPH_C64(0xAC2B2B6E5687452B), - SPH_C64(0xC57676E1ECB39776), SPH_C64(0x328282E619B06482), - SPH_C64(0x7FD6D628B1A9FED6), SPH_C64(0x6C1B1BC33677D81B), - SPH_C64(0xEEB5B574775BC1B5), SPH_C64(0x86AFAFBE432911AF), - SPH_C64(0xB56A6A1DD4DF776A), SPH_C64(0x5D5050EAA00DBA50), - SPH_C64(0x094545578A4C1245), SPH_C64(0xEBF3F338FB18CBF3), - SPH_C64(0xC03030AD60F09D30), SPH_C64(0x9BEFEFC4C3742BEF), - SPH_C64(0xFC3F3FDA7EC3E53F), SPH_C64(0x495555C7AA1C9255), - SPH_C64(0xB2A2A2DB591079A2), SPH_C64(0x8FEAEAE9C96503EA), - SPH_C64(0x8965656ACAEC0F65), SPH_C64(0xD2BABA036968B9BA), - SPH_C64(0xBC2F2F4A5E93652F), SPH_C64(0x27C0C08E9DE74EC0), - SPH_C64(0x5FDEDE60A181BEDE), SPH_C64(0x701C1CFC386CE01C), - SPH_C64(0xD3FDFD46E72EBBFD), SPH_C64(0x294D4D1F9A64524D), - SPH_C64(0x7292927639E0E492), SPH_C64(0xC97575FAEABC8F75), - SPH_C64(0x180606360C1E3006), SPH_C64(0x128A8AAE0998248A), - SPH_C64(0xF2B2B24B7940F9B2), SPH_C64(0xBFE6E685D15963E6), - SPH_C64(0x380E0E7E1C36700E), SPH_C64(0x7C1F1FE73E63F81F), - SPH_C64(0x95626255C4F73762), SPH_C64(0x77D4D43AB5A3EED4), - SPH_C64(0x9AA8A8814D3229A8), SPH_C64(0x6296965231F4C496), - SPH_C64(0xC3F9F962EF3A9BF9), SPH_C64(0x33C5C5A397F666C5), - SPH_C64(0x942525104AB13525), SPH_C64(0x795959ABB220F259), - SPH_C64(0x2A8484D015AE5484), SPH_C64(0xD57272C5E4A7B772), - SPH_C64(0xE43939EC72DDD539), SPH_C64(0x2D4C4C1698615A4C), - SPH_C64(0x655E5E94BC3BCA5E), SPH_C64(0xFD78789FF085E778), - SPH_C64(0xE03838E570D8DD38), SPH_C64(0x0A8C8C980586148C), - SPH_C64(0x63D1D117BFB2C6D1), SPH_C64(0xAEA5A5E4570B41A5), - SPH_C64(0xAFE2E2A1D94D43E2), SPH_C64(0x9961614EC2F82F61), - SPH_C64(0xF6B3B3427B45F1B3), SPH_C64(0x8421213442A51521), - SPH_C64(0x4A9C9C0825D6949C), SPH_C64(0x781E1EEE3C66F01E), - SPH_C64(0x1143436186522243), SPH_C64(0x3BC7C7B193FC76C7), - SPH_C64(0xD7FCFC4FE52BB3FC), SPH_C64(0x1004042408142004), - SPH_C64(0x595151E3A208B251), SPH_C64(0x5E9999252FC7BC99), - SPH_C64(0xA96D6D22DAC44F6D), SPH_C64(0x340D0D651A39680D), - SPH_C64(0xCFFAFA79E93583FA), SPH_C64(0x5BDFDF69A384B6DF), - SPH_C64(0xE57E7EA9FC9BD77E), SPH_C64(0x9024241948B43D24), - SPH_C64(0xEC3B3BFE76D7C53B), SPH_C64(0x96ABAB9A4B3D31AB), - SPH_C64(0x1FCECEF081D13ECE), SPH_C64(0x4411119922558811), - SPH_C64(0x068F8F8303890C8F), SPH_C64(0x254E4E049C6B4A4E), - SPH_C64(0xE6B7B7667351D1B7), SPH_C64(0x8BEBEBE0CB600BEB), - SPH_C64(0xF03C3CC178CCFD3C), SPH_C64(0x3E8181FD1FBF7C81), - SPH_C64(0x6A94944035FED494), SPH_C64(0xFBF7F71CF30CEBF7), - SPH_C64(0xDEB9B9186F67A1B9), SPH_C64(0x4C13138B265F9813), - SPH_C64(0xB02C2C51589C7D2C), SPH_C64(0x6BD3D305BBB8D6D3), - SPH_C64(0xBBE7E78CD35C6BE7), SPH_C64(0xA56E6E39DCCB576E), - SPH_C64(0x37C4C4AA95F36EC4), SPH_C64(0x0C03031B060F1803), - SPH_C64(0x455656DCAC138A56), SPH_C64(0x0D44445E88491A44), - SPH_C64(0xE17F7FA0FE9EDF7F), SPH_C64(0x9EA9A9884F3721A9), - SPH_C64(0xA82A2A6754824D2A), SPH_C64(0xD6BBBB0A6B6DB1BB), - SPH_C64(0x23C1C1879FE246C1), SPH_C64(0x515353F1A602A253), - SPH_C64(0x57DCDC72A58BAEDC), SPH_C64(0x2C0B0B531627580B), - SPH_C64(0x4E9D9D0127D39C9D), SPH_C64(0xAD6C6C2BD8C1476C), - SPH_C64(0xC43131A462F59531), SPH_C64(0xCD7474F3E8B98774), - SPH_C64(0xFFF6F615F109E3F6), SPH_C64(0x0546464C8C430A46), - SPH_C64(0x8AACACA5452609AC), SPH_C64(0x1E8989B50F973C89), - SPH_C64(0x501414B42844A014), SPH_C64(0xA3E1E1BADF425BE1), - SPH_C64(0x581616A62C4EB016), SPH_C64(0xE83A3AF774D2CD3A), - SPH_C64(0xB9696906D2D06F69), SPH_C64(0x24090941122D4809), - SPH_C64(0xDD7070D7E0ADA770), SPH_C64(0xE2B6B66F7154D9B6), - SPH_C64(0x67D0D01EBDB7CED0), SPH_C64(0x93EDEDD6C77E3BED), - SPH_C64(0x17CCCCE285DB2ECC), SPH_C64(0x1542426884572A42), - SPH_C64(0x5A98982C2DC2B498), SPH_C64(0xAAA4A4ED550E49A4), - SPH_C64(0xA028287550885D28), SPH_C64(0x6D5C5C86B831DA5C), - SPH_C64(0xC7F8F86BED3F93F8), SPH_C64(0x228686C211A44486) -}; - -static const sph_u64 plain_T6[256] = { - SPH_C64(0x1818D83078C01860), SPH_C64(0x23232646AF05238C), - SPH_C64(0xC6C6B891F97EC63F), SPH_C64(0xE8E8FBCD6F13E887), - SPH_C64(0x8787CB13A14C8726), SPH_C64(0xB8B8116D62A9B8DA), - SPH_C64(0x0101090205080104), SPH_C64(0x4F4F0D9E6E424F21), - SPH_C64(0x36369B6CEEAD36D8), SPH_C64(0xA6A6FF510459A6A2), - SPH_C64(0xD2D20CB9BDDED26F), SPH_C64(0xF5F50EF706FBF5F3), - SPH_C64(0x797996F280EF79F9), SPH_C64(0x6F6F30DECE5F6FA1), - SPH_C64(0x91916D3FEFFC917E), SPH_C64(0x5252F8A407AA5255), - SPH_C64(0x606047C0FD27609D), SPH_C64(0xBCBC35657689BCCA), - SPH_C64(0x9B9B372BCDAC9B56), SPH_C64(0x8E8E8A018C048E02), - SPH_C64(0xA3A3D25B1571A3B6), SPH_C64(0x0C0C6C183C600C30), - SPH_C64(0x7B7B84F68AFF7BF1), SPH_C64(0x3535806AE1B535D4), - SPH_C64(0x1D1DF53A69E81D74), SPH_C64(0xE0E0B3DD4753E0A7), - SPH_C64(0xD7D721B3ACF6D77B), SPH_C64(0xC2C29C99ED5EC22F), - SPH_C64(0x2E2E435C966D2EB8), SPH_C64(0x4B4B29967A624B31), - SPH_C64(0xFEFE5DE121A3FEDF), SPH_C64(0x5757D5AE16825741), - SPH_C64(0x1515BD2A41A81554), SPH_C64(0x7777E8EEB69F77C1), - SPH_C64(0x3737926EEBA537DC), SPH_C64(0xE5E59ED7567BE5B3), - SPH_C64(0x9F9F1323D98C9F46), SPH_C64(0xF0F023FD17D3F0E7), - SPH_C64(0x4A4A20947F6A4A35), SPH_C64(0xDADA44A9959EDA4F), - SPH_C64(0x5858A2B025FA587D), SPH_C64(0xC9C9CF8FCA06C903), - SPH_C64(0x29297C528D5529A4), SPH_C64(0x0A0A5A1422500A28), - SPH_C64(0xB1B1507F4FE1B1FE), SPH_C64(0xA0A0C95D1A69A0BA), - SPH_C64(0x6B6B14D6DA7F6BB1), SPH_C64(0x8585D917AB5C852E), - SPH_C64(0xBDBD3C677381BDCE), SPH_C64(0x5D5D8FBA34D25D69), - SPH_C64(0x1010902050801040), SPH_C64(0xF4F407F503F3F4F7), - SPH_C64(0xCBCBDD8BC016CB0B), SPH_C64(0x3E3ED37CC6ED3EF8), - SPH_C64(0x05052D0A11280514), SPH_C64(0x676778CEE61F6781), - SPH_C64(0xE4E497D55373E4B7), SPH_C64(0x2727024EBB25279C), - SPH_C64(0x4141738258324119), SPH_C64(0x8B8BA70B9D2C8B16), - SPH_C64(0xA7A7F6530151A7A6), SPH_C64(0x7D7DB2FA94CF7DE9), - SPH_C64(0x95954937FBDC956E), SPH_C64(0xD8D856AD9F8ED847), - SPH_C64(0xFBFB70EB308BFBCB), SPH_C64(0xEEEECDC17123EE9F), - SPH_C64(0x7C7CBBF891C77CED), SPH_C64(0x666671CCE3176685), - SPH_C64(0xDDDD7BA78EA6DD53), SPH_C64(0x1717AF2E4BB8175C), - SPH_C64(0x4747458E46024701), SPH_C64(0x9E9E1A21DC849E42), - SPH_C64(0xCACAD489C51ECA0F), SPH_C64(0x2D2D585A99752DB4), - SPH_C64(0xBFBF2E637991BFC6), SPH_C64(0x07073F0E1B38071C), - SPH_C64(0xADADAC472301AD8E), SPH_C64(0x5A5AB0B42FEA5A75), - SPH_C64(0x8383EF1BB56C8336), SPH_C64(0x3333B666FF8533CC), - SPH_C64(0x63635CC6F23F6391), SPH_C64(0x020212040A100208), - SPH_C64(0xAAAA93493839AA92), SPH_C64(0x7171DEE2A8AF71D9), - SPH_C64(0xC8C8C68DCF0EC807), SPH_C64(0x1919D1327DC81964), - SPH_C64(0x49493B9270724939), SPH_C64(0xD9D95FAF9A86D943), - SPH_C64(0xF2F231F91DC3F2EF), SPH_C64(0xE3E3A8DB484BE3AB), - SPH_C64(0x5B5BB9B62AE25B71), SPH_C64(0x8888BC0D9234881A), - SPH_C64(0x9A9A3E29C8A49A52), SPH_C64(0x26260B4CBE2D2698), - SPH_C64(0x3232BF64FA8D32C8), SPH_C64(0xB0B0597D4AE9B0FA), - SPH_C64(0xE9E9F2CF6A1BE983), SPH_C64(0x0F0F771E33780F3C), - SPH_C64(0xD5D533B7A6E6D573), SPH_C64(0x8080F41DBA74803A), - SPH_C64(0xBEBE27617C99BEC2), SPH_C64(0xCDCDEB87DE26CD13), - SPH_C64(0x34348968E4BD34D0), SPH_C64(0x48483290757A483D), - SPH_C64(0xFFFF54E324ABFFDB), SPH_C64(0x7A7A8DF48FF77AF5), - SPH_C64(0x9090643DEAF4907A), SPH_C64(0x5F5F9DBE3EC25F61), - SPH_C64(0x20203D40A01D2080), SPH_C64(0x68680FD0D56768BD), - SPH_C64(0x1A1ACA3472D01A68), SPH_C64(0xAEAEB7412C19AE82), - SPH_C64(0xB4B47D755EC9B4EA), SPH_C64(0x5454CEA8199A544D), - SPH_C64(0x93937F3BE5EC9376), SPH_C64(0x22222F44AA0D2288), - SPH_C64(0x646463C8E907648D), SPH_C64(0xF1F12AFF12DBF1E3), - SPH_C64(0x7373CCE6A2BF73D1), SPH_C64(0x121282245A901248), - SPH_C64(0x40407A805D3A401D), SPH_C64(0x0808481028400820), - SPH_C64(0xC3C3959BE856C32B), SPH_C64(0xECECDFC57B33EC97), - SPH_C64(0xDBDB4DAB9096DB4B), SPH_C64(0xA1A1C05F1F61A1BE), - SPH_C64(0x8D8D9107831C8D0E), SPH_C64(0x3D3DC87AC9F53DF4), - SPH_C64(0x97975B33F1CC9766), SPH_C64(0x0000000000000000), - SPH_C64(0xCFCFF983D436CF1B), SPH_C64(0x2B2B6E5687452BAC), - SPH_C64(0x7676E1ECB39776C5), SPH_C64(0x8282E619B0648232), - SPH_C64(0xD6D628B1A9FED67F), SPH_C64(0x1B1BC33677D81B6C), - SPH_C64(0xB5B574775BC1B5EE), SPH_C64(0xAFAFBE432911AF86), - SPH_C64(0x6A6A1DD4DF776AB5), SPH_C64(0x5050EAA00DBA505D), - SPH_C64(0x4545578A4C124509), SPH_C64(0xF3F338FB18CBF3EB), - SPH_C64(0x3030AD60F09D30C0), SPH_C64(0xEFEFC4C3742BEF9B), - SPH_C64(0x3F3FDA7EC3E53FFC), SPH_C64(0x5555C7AA1C925549), - SPH_C64(0xA2A2DB591079A2B2), SPH_C64(0xEAEAE9C96503EA8F), - SPH_C64(0x65656ACAEC0F6589), SPH_C64(0xBABA036968B9BAD2), - SPH_C64(0x2F2F4A5E93652FBC), SPH_C64(0xC0C08E9DE74EC027), - SPH_C64(0xDEDE60A181BEDE5F), SPH_C64(0x1C1CFC386CE01C70), - SPH_C64(0xFDFD46E72EBBFDD3), SPH_C64(0x4D4D1F9A64524D29), - SPH_C64(0x92927639E0E49272), SPH_C64(0x7575FAEABC8F75C9), - SPH_C64(0x0606360C1E300618), SPH_C64(0x8A8AAE0998248A12), - SPH_C64(0xB2B24B7940F9B2F2), SPH_C64(0xE6E685D15963E6BF), - SPH_C64(0x0E0E7E1C36700E38), SPH_C64(0x1F1FE73E63F81F7C), - SPH_C64(0x626255C4F7376295), SPH_C64(0xD4D43AB5A3EED477), - SPH_C64(0xA8A8814D3229A89A), SPH_C64(0x96965231F4C49662), - SPH_C64(0xF9F962EF3A9BF9C3), SPH_C64(0xC5C5A397F666C533), - SPH_C64(0x2525104AB1352594), SPH_C64(0x5959ABB220F25979), - SPH_C64(0x8484D015AE54842A), SPH_C64(0x7272C5E4A7B772D5), - SPH_C64(0x3939EC72DDD539E4), SPH_C64(0x4C4C1698615A4C2D), - SPH_C64(0x5E5E94BC3BCA5E65), SPH_C64(0x78789FF085E778FD), - SPH_C64(0x3838E570D8DD38E0), SPH_C64(0x8C8C980586148C0A), - SPH_C64(0xD1D117BFB2C6D163), SPH_C64(0xA5A5E4570B41A5AE), - SPH_C64(0xE2E2A1D94D43E2AF), SPH_C64(0x61614EC2F82F6199), - SPH_C64(0xB3B3427B45F1B3F6), SPH_C64(0x21213442A5152184), - SPH_C64(0x9C9C0825D6949C4A), SPH_C64(0x1E1EEE3C66F01E78), - SPH_C64(0x4343618652224311), SPH_C64(0xC7C7B193FC76C73B), - SPH_C64(0xFCFC4FE52BB3FCD7), SPH_C64(0x0404240814200410), - SPH_C64(0x5151E3A208B25159), SPH_C64(0x9999252FC7BC995E), - SPH_C64(0x6D6D22DAC44F6DA9), SPH_C64(0x0D0D651A39680D34), - SPH_C64(0xFAFA79E93583FACF), SPH_C64(0xDFDF69A384B6DF5B), - SPH_C64(0x7E7EA9FC9BD77EE5), SPH_C64(0x24241948B43D2490), - SPH_C64(0x3B3BFE76D7C53BEC), SPH_C64(0xABAB9A4B3D31AB96), - SPH_C64(0xCECEF081D13ECE1F), SPH_C64(0x1111992255881144), - SPH_C64(0x8F8F8303890C8F06), SPH_C64(0x4E4E049C6B4A4E25), - SPH_C64(0xB7B7667351D1B7E6), SPH_C64(0xEBEBE0CB600BEB8B), - SPH_C64(0x3C3CC178CCFD3CF0), SPH_C64(0x8181FD1FBF7C813E), - SPH_C64(0x94944035FED4946A), SPH_C64(0xF7F71CF30CEBF7FB), - SPH_C64(0xB9B9186F67A1B9DE), SPH_C64(0x13138B265F98134C), - SPH_C64(0x2C2C51589C7D2CB0), SPH_C64(0xD3D305BBB8D6D36B), - SPH_C64(0xE7E78CD35C6BE7BB), SPH_C64(0x6E6E39DCCB576EA5), - SPH_C64(0xC4C4AA95F36EC437), SPH_C64(0x03031B060F18030C), - SPH_C64(0x5656DCAC138A5645), SPH_C64(0x44445E88491A440D), - SPH_C64(0x7F7FA0FE9EDF7FE1), SPH_C64(0xA9A9884F3721A99E), - SPH_C64(0x2A2A6754824D2AA8), SPH_C64(0xBBBB0A6B6DB1BBD6), - SPH_C64(0xC1C1879FE246C123), SPH_C64(0x5353F1A602A25351), - SPH_C64(0xDCDC72A58BAEDC57), SPH_C64(0x0B0B531627580B2C), - SPH_C64(0x9D9D0127D39C9D4E), SPH_C64(0x6C6C2BD8C1476CAD), - SPH_C64(0x3131A462F59531C4), SPH_C64(0x7474F3E8B98774CD), - SPH_C64(0xF6F615F109E3F6FF), SPH_C64(0x46464C8C430A4605), - SPH_C64(0xACACA5452609AC8A), SPH_C64(0x8989B50F973C891E), - SPH_C64(0x1414B42844A01450), SPH_C64(0xE1E1BADF425BE1A3), - SPH_C64(0x1616A62C4EB01658), SPH_C64(0x3A3AF774D2CD3AE8), - SPH_C64(0x696906D2D06F69B9), SPH_C64(0x090941122D480924), - SPH_C64(0x7070D7E0ADA770DD), SPH_C64(0xB6B66F7154D9B6E2), - SPH_C64(0xD0D01EBDB7CED067), SPH_C64(0xEDEDD6C77E3BED93), - SPH_C64(0xCCCCE285DB2ECC17), SPH_C64(0x42426884572A4215), - SPH_C64(0x98982C2DC2B4985A), SPH_C64(0xA4A4ED550E49A4AA), - SPH_C64(0x28287550885D28A0), SPH_C64(0x5C5C86B831DA5C6D), - SPH_C64(0xF8F86BED3F93F8C7), SPH_C64(0x8686C211A4448622) -}; - -static const sph_u64 plain_T7[256] = { - SPH_C64(0x18D83078C0186018), SPH_C64(0x232646AF05238C23), - SPH_C64(0xC6B891F97EC63FC6), SPH_C64(0xE8FBCD6F13E887E8), - SPH_C64(0x87CB13A14C872687), SPH_C64(0xB8116D62A9B8DAB8), - SPH_C64(0x0109020508010401), SPH_C64(0x4F0D9E6E424F214F), - SPH_C64(0x369B6CEEAD36D836), SPH_C64(0xA6FF510459A6A2A6), - SPH_C64(0xD20CB9BDDED26FD2), SPH_C64(0xF50EF706FBF5F3F5), - SPH_C64(0x7996F280EF79F979), SPH_C64(0x6F30DECE5F6FA16F), - SPH_C64(0x916D3FEFFC917E91), SPH_C64(0x52F8A407AA525552), - SPH_C64(0x6047C0FD27609D60), SPH_C64(0xBC35657689BCCABC), - SPH_C64(0x9B372BCDAC9B569B), SPH_C64(0x8E8A018C048E028E), - SPH_C64(0xA3D25B1571A3B6A3), SPH_C64(0x0C6C183C600C300C), - SPH_C64(0x7B84F68AFF7BF17B), SPH_C64(0x35806AE1B535D435), - SPH_C64(0x1DF53A69E81D741D), SPH_C64(0xE0B3DD4753E0A7E0), - SPH_C64(0xD721B3ACF6D77BD7), SPH_C64(0xC29C99ED5EC22FC2), - SPH_C64(0x2E435C966D2EB82E), SPH_C64(0x4B29967A624B314B), - SPH_C64(0xFE5DE121A3FEDFFE), SPH_C64(0x57D5AE1682574157), - SPH_C64(0x15BD2A41A8155415), SPH_C64(0x77E8EEB69F77C177), - SPH_C64(0x37926EEBA537DC37), SPH_C64(0xE59ED7567BE5B3E5), - SPH_C64(0x9F1323D98C9F469F), SPH_C64(0xF023FD17D3F0E7F0), - SPH_C64(0x4A20947F6A4A354A), SPH_C64(0xDA44A9959EDA4FDA), - SPH_C64(0x58A2B025FA587D58), SPH_C64(0xC9CF8FCA06C903C9), - SPH_C64(0x297C528D5529A429), SPH_C64(0x0A5A1422500A280A), - SPH_C64(0xB1507F4FE1B1FEB1), SPH_C64(0xA0C95D1A69A0BAA0), - SPH_C64(0x6B14D6DA7F6BB16B), SPH_C64(0x85D917AB5C852E85), - SPH_C64(0xBD3C677381BDCEBD), SPH_C64(0x5D8FBA34D25D695D), - SPH_C64(0x1090205080104010), SPH_C64(0xF407F503F3F4F7F4), - SPH_C64(0xCBDD8BC016CB0BCB), SPH_C64(0x3ED37CC6ED3EF83E), - SPH_C64(0x052D0A1128051405), SPH_C64(0x6778CEE61F678167), - SPH_C64(0xE497D55373E4B7E4), SPH_C64(0x27024EBB25279C27), - SPH_C64(0x4173825832411941), SPH_C64(0x8BA70B9D2C8B168B), - SPH_C64(0xA7F6530151A7A6A7), SPH_C64(0x7DB2FA94CF7DE97D), - SPH_C64(0x954937FBDC956E95), SPH_C64(0xD856AD9F8ED847D8), - SPH_C64(0xFB70EB308BFBCBFB), SPH_C64(0xEECDC17123EE9FEE), - SPH_C64(0x7CBBF891C77CED7C), SPH_C64(0x6671CCE317668566), - SPH_C64(0xDD7BA78EA6DD53DD), SPH_C64(0x17AF2E4BB8175C17), - SPH_C64(0x47458E4602470147), SPH_C64(0x9E1A21DC849E429E), - SPH_C64(0xCAD489C51ECA0FCA), SPH_C64(0x2D585A99752DB42D), - SPH_C64(0xBF2E637991BFC6BF), SPH_C64(0x073F0E1B38071C07), - SPH_C64(0xADAC472301AD8EAD), SPH_C64(0x5AB0B42FEA5A755A), - SPH_C64(0x83EF1BB56C833683), SPH_C64(0x33B666FF8533CC33), - SPH_C64(0x635CC6F23F639163), SPH_C64(0x0212040A10020802), - SPH_C64(0xAA93493839AA92AA), SPH_C64(0x71DEE2A8AF71D971), - SPH_C64(0xC8C68DCF0EC807C8), SPH_C64(0x19D1327DC8196419), - SPH_C64(0x493B927072493949), SPH_C64(0xD95FAF9A86D943D9), - SPH_C64(0xF231F91DC3F2EFF2), SPH_C64(0xE3A8DB484BE3ABE3), - SPH_C64(0x5BB9B62AE25B715B), SPH_C64(0x88BC0D9234881A88), - SPH_C64(0x9A3E29C8A49A529A), SPH_C64(0x260B4CBE2D269826), - SPH_C64(0x32BF64FA8D32C832), SPH_C64(0xB0597D4AE9B0FAB0), - SPH_C64(0xE9F2CF6A1BE983E9), SPH_C64(0x0F771E33780F3C0F), - SPH_C64(0xD533B7A6E6D573D5), SPH_C64(0x80F41DBA74803A80), - SPH_C64(0xBE27617C99BEC2BE), SPH_C64(0xCDEB87DE26CD13CD), - SPH_C64(0x348968E4BD34D034), SPH_C64(0x483290757A483D48), - SPH_C64(0xFF54E324ABFFDBFF), SPH_C64(0x7A8DF48FF77AF57A), - SPH_C64(0x90643DEAF4907A90), SPH_C64(0x5F9DBE3EC25F615F), - SPH_C64(0x203D40A01D208020), SPH_C64(0x680FD0D56768BD68), - SPH_C64(0x1ACA3472D01A681A), SPH_C64(0xAEB7412C19AE82AE), - SPH_C64(0xB47D755EC9B4EAB4), SPH_C64(0x54CEA8199A544D54), - SPH_C64(0x937F3BE5EC937693), SPH_C64(0x222F44AA0D228822), - SPH_C64(0x6463C8E907648D64), SPH_C64(0xF12AFF12DBF1E3F1), - SPH_C64(0x73CCE6A2BF73D173), SPH_C64(0x1282245A90124812), - SPH_C64(0x407A805D3A401D40), SPH_C64(0x0848102840082008), - SPH_C64(0xC3959BE856C32BC3), SPH_C64(0xECDFC57B33EC97EC), - SPH_C64(0xDB4DAB9096DB4BDB), SPH_C64(0xA1C05F1F61A1BEA1), - SPH_C64(0x8D9107831C8D0E8D), SPH_C64(0x3DC87AC9F53DF43D), - SPH_C64(0x975B33F1CC976697), SPH_C64(0x0000000000000000), - SPH_C64(0xCFF983D436CF1BCF), SPH_C64(0x2B6E5687452BAC2B), - SPH_C64(0x76E1ECB39776C576), SPH_C64(0x82E619B064823282), - SPH_C64(0xD628B1A9FED67FD6), SPH_C64(0x1BC33677D81B6C1B), - SPH_C64(0xB574775BC1B5EEB5), SPH_C64(0xAFBE432911AF86AF), - SPH_C64(0x6A1DD4DF776AB56A), SPH_C64(0x50EAA00DBA505D50), - SPH_C64(0x45578A4C12450945), SPH_C64(0xF338FB18CBF3EBF3), - SPH_C64(0x30AD60F09D30C030), SPH_C64(0xEFC4C3742BEF9BEF), - SPH_C64(0x3FDA7EC3E53FFC3F), SPH_C64(0x55C7AA1C92554955), - SPH_C64(0xA2DB591079A2B2A2), SPH_C64(0xEAE9C96503EA8FEA), - SPH_C64(0x656ACAEC0F658965), SPH_C64(0xBA036968B9BAD2BA), - SPH_C64(0x2F4A5E93652FBC2F), SPH_C64(0xC08E9DE74EC027C0), - SPH_C64(0xDE60A181BEDE5FDE), SPH_C64(0x1CFC386CE01C701C), - SPH_C64(0xFD46E72EBBFDD3FD), SPH_C64(0x4D1F9A64524D294D), - SPH_C64(0x927639E0E4927292), SPH_C64(0x75FAEABC8F75C975), - SPH_C64(0x06360C1E30061806), SPH_C64(0x8AAE0998248A128A), - SPH_C64(0xB24B7940F9B2F2B2), SPH_C64(0xE685D15963E6BFE6), - SPH_C64(0x0E7E1C36700E380E), SPH_C64(0x1FE73E63F81F7C1F), - SPH_C64(0x6255C4F737629562), SPH_C64(0xD43AB5A3EED477D4), - SPH_C64(0xA8814D3229A89AA8), SPH_C64(0x965231F4C4966296), - SPH_C64(0xF962EF3A9BF9C3F9), SPH_C64(0xC5A397F666C533C5), - SPH_C64(0x25104AB135259425), SPH_C64(0x59ABB220F2597959), - SPH_C64(0x84D015AE54842A84), SPH_C64(0x72C5E4A7B772D572), - SPH_C64(0x39EC72DDD539E439), SPH_C64(0x4C1698615A4C2D4C), - SPH_C64(0x5E94BC3BCA5E655E), SPH_C64(0x789FF085E778FD78), - SPH_C64(0x38E570D8DD38E038), SPH_C64(0x8C980586148C0A8C), - SPH_C64(0xD117BFB2C6D163D1), SPH_C64(0xA5E4570B41A5AEA5), - SPH_C64(0xE2A1D94D43E2AFE2), SPH_C64(0x614EC2F82F619961), - SPH_C64(0xB3427B45F1B3F6B3), SPH_C64(0x213442A515218421), - SPH_C64(0x9C0825D6949C4A9C), SPH_C64(0x1EEE3C66F01E781E), - SPH_C64(0x4361865222431143), SPH_C64(0xC7B193FC76C73BC7), - SPH_C64(0xFC4FE52BB3FCD7FC), SPH_C64(0x0424081420041004), - SPH_C64(0x51E3A208B2515951), SPH_C64(0x99252FC7BC995E99), - SPH_C64(0x6D22DAC44F6DA96D), SPH_C64(0x0D651A39680D340D), - SPH_C64(0xFA79E93583FACFFA), SPH_C64(0xDF69A384B6DF5BDF), - SPH_C64(0x7EA9FC9BD77EE57E), SPH_C64(0x241948B43D249024), - SPH_C64(0x3BFE76D7C53BEC3B), SPH_C64(0xAB9A4B3D31AB96AB), - SPH_C64(0xCEF081D13ECE1FCE), SPH_C64(0x1199225588114411), - SPH_C64(0x8F8303890C8F068F), SPH_C64(0x4E049C6B4A4E254E), - SPH_C64(0xB7667351D1B7E6B7), SPH_C64(0xEBE0CB600BEB8BEB), - SPH_C64(0x3CC178CCFD3CF03C), SPH_C64(0x81FD1FBF7C813E81), - SPH_C64(0x944035FED4946A94), SPH_C64(0xF71CF30CEBF7FBF7), - SPH_C64(0xB9186F67A1B9DEB9), SPH_C64(0x138B265F98134C13), - SPH_C64(0x2C51589C7D2CB02C), SPH_C64(0xD305BBB8D6D36BD3), - SPH_C64(0xE78CD35C6BE7BBE7), SPH_C64(0x6E39DCCB576EA56E), - SPH_C64(0xC4AA95F36EC437C4), SPH_C64(0x031B060F18030C03), - SPH_C64(0x56DCAC138A564556), SPH_C64(0x445E88491A440D44), - SPH_C64(0x7FA0FE9EDF7FE17F), SPH_C64(0xA9884F3721A99EA9), - SPH_C64(0x2A6754824D2AA82A), SPH_C64(0xBB0A6B6DB1BBD6BB), - SPH_C64(0xC1879FE246C123C1), SPH_C64(0x53F1A602A2535153), - SPH_C64(0xDC72A58BAEDC57DC), SPH_C64(0x0B531627580B2C0B), - SPH_C64(0x9D0127D39C9D4E9D), SPH_C64(0x6C2BD8C1476CAD6C), - SPH_C64(0x31A462F59531C431), SPH_C64(0x74F3E8B98774CD74), - SPH_C64(0xF615F109E3F6FFF6), SPH_C64(0x464C8C430A460546), - SPH_C64(0xACA5452609AC8AAC), SPH_C64(0x89B50F973C891E89), - SPH_C64(0x14B42844A0145014), SPH_C64(0xE1BADF425BE1A3E1), - SPH_C64(0x16A62C4EB0165816), SPH_C64(0x3AF774D2CD3AE83A), - SPH_C64(0x6906D2D06F69B969), SPH_C64(0x0941122D48092409), - SPH_C64(0x70D7E0ADA770DD70), SPH_C64(0xB66F7154D9B6E2B6), - SPH_C64(0xD01EBDB7CED067D0), SPH_C64(0xEDD6C77E3BED93ED), - SPH_C64(0xCCE285DB2ECC17CC), SPH_C64(0x426884572A421542), - SPH_C64(0x982C2DC2B4985A98), SPH_C64(0xA4ED550E49A4AAA4), - SPH_C64(0x287550885D28A028), SPH_C64(0x5C86B831DA5C6D5C), - SPH_C64(0xF86BED3F93F8C7F8), SPH_C64(0x86C211A444862286) -}; - -#endif - -/* - * Round constants. - */ -static const sph_u64 plain_RC[10] = { - SPH_C64(0x4F01B887E8C62318), - SPH_C64(0x52916F79F5D2A636), - SPH_C64(0x357B0CA38E9BBC60), - SPH_C64(0x57FE4B2EC2D7E01D), - SPH_C64(0xDA4AF09FE5377715), - SPH_C64(0x856BA0B10A29C958), - SPH_C64(0x67053ECBF4105DBD), - SPH_C64(0xD8957DA78B4127E4), - SPH_C64(0x9E4717DD667CEEFB), - SPH_C64(0x33835AAD07BF2DCA) -}; - -/* ====================================================================== */ -/* - * Constants for plain WHIRLPOOL-0 (first version). - */ - -static const sph_u64 old0_T0[256] = { - SPH_C64(0xD50F67D568B86868), SPH_C64(0xB71ECEB7D06DD0D0), - SPH_C64(0x60E00B60EB20EBEB), SPH_C64(0x876E45872B7D2B2B), - SPH_C64(0x75327A7548D84848), SPH_C64(0xD3019CD39DBA9D9D), - SPH_C64(0xDF1D77DF6ABE6A6A), SPH_C64(0x53977353E431E4E4), - SPH_C64(0x48A84B48E338E3E3), SPH_C64(0x15D27115A3F8A3A3), - SPH_C64(0x13DC8A1356FA5656), SPH_C64(0xBFFD7CBF819E8181), - SPH_C64(0x94B2CF947D877D7D), SPH_C64(0x122ADB12F10EF1F1), - SPH_C64(0xABD95CAB85928585), SPH_C64(0xDC1A84DC9EBF9E9E), - SPH_C64(0x9C517D9C2C742C2C), SPH_C64(0x8C8A048C8E8F8E8E), - SPH_C64(0x859FE78578887878), SPH_C64(0xC5D41EC5CA43CACA), - SPH_C64(0x4BAFB84B17391717), SPH_C64(0x37882137A9E6A9A9), - SPH_C64(0xF84E2FF861A36161), SPH_C64(0xA633E6A6D562D5D5), - SPH_C64(0x348FD2345DE75D5D), SPH_C64(0x275358270B1D0B0B), - SPH_C64(0x869814868C898C8C), SPH_C64(0xCCC1FDCC3C443C3C), - SPH_C64(0xB6E89FB677997777), SPH_C64(0x08E3B20851F35151), - SPH_C64(0xAA2F0DAA22662222), SPH_C64(0x57682A5742C64242), - SPH_C64(0xC3DAE5C33F413F3F), SPH_C64(0x19CE9A1954FC5454), - SPH_C64(0x5873325841C34141), SPH_C64(0xBAF474BA809D8080), - SPH_C64(0xDBE22EDBCC49CCCC), SPH_C64(0xA4C244A486978686), - SPH_C64(0x4542F145B3C8B3B3), SPH_C64(0x78D8C07818281818), - SPH_C64(0x96436D962E722E2E), SPH_C64(0x16D5821657F95757), - SPH_C64(0x1E36301E060A0606), SPH_C64(0xF75537F762A66262), - SPH_C64(0x0307F303F401F4F4), SPH_C64(0xEE9BADEE365A3636), - SPH_C64(0xB217C6B2D16ED1D1), SPH_C64(0xDA147FDA6BBD6B6B), - SPH_C64(0x77C3D8771B2D1B1B), SPH_C64(0xEC6A0FEC65AF6565), - SPH_C64(0xBCFA8FBC759F7575), SPH_C64(0x5090805010301010), - SPH_C64(0x95449E95DA73DADA), SPH_C64(0x703B727049DB4949), - SPH_C64(0xBE0B2DBE266A2626), SPH_C64(0x3A629B3AF916F9F9), - SPH_C64(0xC0DD16C0CB40CBCB), SPH_C64(0xE37117E366AA6666), - SPH_C64(0x5C8C6B5CE734E7E7), SPH_C64(0x6803B968BAD3BABA), - SPH_C64(0x2CB7192CAEEFAEAE), SPH_C64(0x0DEABA0D50F05050), - SPH_C64(0x07F8AA0752F65252), SPH_C64(0x3D9A313DABE0ABAB), - SPH_C64(0x112D2811050F0505), SPH_C64(0x1723D317F00DF0F0), - SPH_C64(0x396568390D170D0D), SPH_C64(0xA2CCBFA273957373), - SPH_C64(0xD7FEC5D73B4D3B3B), SPH_C64(0x14242014040C0404), - SPH_C64(0xA03D1DA020602020), SPH_C64(0x215DA321FE1FFEFE), - SPH_C64(0x8E7BA68EDD7ADDDD), SPH_C64(0x060EFB06F502F5F5), - SPH_C64(0x5E7DC95EB4C1B4B4), SPH_C64(0x3E9DC23E5FE15F5F), - SPH_C64(0x225A50220A1E0A0A), SPH_C64(0x5B74C15BB5C2B5B5), - SPH_C64(0xE78E4EE7C05DC0C0), SPH_C64(0x1AC9691AA0FDA0A0), - SPH_C64(0xA8DEAFA871937171), SPH_C64(0x0BE4410BA5F2A5A5), - SPH_C64(0x995875992D772D2D), SPH_C64(0xFD4727FD60A06060), - SPH_C64(0xA7C5B7A772967272), SPH_C64(0xE57FECE593A89393), - SPH_C64(0xDDECD5DD394B3939), SPH_C64(0x2848402808180808), - SPH_C64(0xB5EF6CB583988383), SPH_C64(0xA53415A521632121), - SPH_C64(0x3186DA315CE45C5C), SPH_C64(0xA1CB4CA187948787), - SPH_C64(0x4F50E14FB1CEB1B1), SPH_C64(0x47B35347E03DE0E0), - SPH_C64(0x0000000000000000), SPH_C64(0xE89556E8C358C3C3), - SPH_C64(0x5A82905A12361212), SPH_C64(0xEF6DFCEF91AE9191), - SPH_C64(0x98AE24988A838A8A), SPH_C64(0x0A12100A02060202), - SPH_C64(0x6CFCE06C1C241C1C), SPH_C64(0x59856359E637E6E6), - SPH_C64(0x4C57124C45CF4545), SPH_C64(0xED9C5EEDC25BC2C2), - SPH_C64(0xF3AA6EF3C451C4C4), SPH_C64(0x2E46BB2EFD1AFDFD), - SPH_C64(0x792E9179BFDCBFBF), SPH_C64(0x495E1A4944CC4444), - SPH_C64(0x1FC0611FA1FEA1A1), SPH_C64(0x61165A614CD44C4C), - SPH_C64(0xFFB685FF33553333), SPH_C64(0xF6A366F6C552C5C5), - SPH_C64(0xAED054AE84918484), SPH_C64(0xAF2605AF23652323), - SPH_C64(0x91BBC7917C847C7C), SPH_C64(0x4A59E94AB0CDB0B0), - SPH_C64(0xB11035B1256F2525), SPH_C64(0x41BDA841153F1515), - SPH_C64(0xE180B5E1355F3535), SPH_C64(0xD0066FD069BB6969), - SPH_C64(0x2454AB24FF1CFFFF), SPH_C64(0xFE40D4FE94A19494), - SPH_C64(0x641F52644DD74D4D), SPH_C64(0xADD7A7AD70907070), - SPH_C64(0x10DB7910A2FBA2A2), SPH_C64(0x29BE1129AFECAFAF), - SPH_C64(0xDEEB26DECD4ACDCD), SPH_C64(0xA928FEA9D667D6D6), - SPH_C64(0xC12B47C16CB46C6C), SPH_C64(0x5166D151B7C4B7B7), - SPH_C64(0x3F6B933FF815F8F8), SPH_C64(0x2D41482D091B0909), - SPH_C64(0x1838CB18F308F3F3), SPH_C64(0xE6781FE667A96767), - SPH_C64(0x0EED490EA4F1A4A4), SPH_C64(0x65E90365EA23EAEA), - SPH_C64(0x7BDF337BEC29ECEC), SPH_C64(0x546FD954B6C7B6B6), - SPH_C64(0xA33AEEA3D461D4D4), SPH_C64(0xBD0CDEBDD26BD2D2), - SPH_C64(0x44B4A044143C1414), SPH_C64(0x66EEF0661E221E1E), - SPH_C64(0x42BA5B42E13EE1E1), SPH_C64(0xB4193DB4246C2424), - SPH_C64(0xD8E5DDD838483838), SPH_C64(0xF9B87EF9C657C6C6), - SPH_C64(0x904D9690DB70DBDB), SPH_C64(0x7A29627A4BDD4B4B), - SPH_C64(0x8F8DF78F7A8E7A7A), SPH_C64(0xD2F7CDD23A4E3A3A), - SPH_C64(0x8160BE81DE7FDEDE), SPH_C64(0x3B94CA3B5EE25E5E), - SPH_C64(0x8469B684DF7CDFDF), SPH_C64(0xFB49DCFB95A29595), - SPH_C64(0x2B4FB32BFC19FCFC), SPH_C64(0x38933938AAE3AAAA), - SPH_C64(0xAC21F6ACD764D7D7), SPH_C64(0xD1F03ED1CE4FCECE), - SPH_C64(0x1B3F381B07090707), SPH_C64(0x337778330F110F0F), - SPH_C64(0xC9C8F5C93D473D3D), SPH_C64(0x25A2FA2558E85858), - SPH_C64(0xC83EA4C89AB39A9A), SPH_C64(0xC22CB4C298B59898), - SPH_C64(0xD60894D69CB99C9C), SPH_C64(0x1D31C31DF20BF2F2), - SPH_C64(0x01F65101A7F4A7A7), SPH_C64(0x5599885511331111), - SPH_C64(0x9BA9D79B7E827E7E), SPH_C64(0x9DA72C9D8B808B8B), - SPH_C64(0x5261225243C54343), SPH_C64(0x0F1B180F03050303), - SPH_C64(0x4DA1434DE23BE2E2), SPH_C64(0x8B72AE8BDC79DCDC), - SPH_C64(0x569E7B56E532E5E5), SPH_C64(0x404BF940B2CBB2B2), - SPH_C64(0x6B044A6B4ED24E4E), SPH_C64(0xFCB176FCC754C7C7), - SPH_C64(0xC4224FC46DB76D6D), SPH_C64(0x6AF21B6AE926E9E9), - SPH_C64(0xBB0225BB27692727), SPH_C64(0x5D7A3A5D40C04040), - SPH_C64(0x9F568E9FD875D8D8), SPH_C64(0xEB92A5EB37593737), - SPH_C64(0xE076E4E092AB9292), SPH_C64(0x89830C898F8C8F8F), - SPH_C64(0x0509080501030101), SPH_C64(0x69F5E8691D271D1D), - SPH_C64(0x02F1A20253F55353), SPH_C64(0xC6D3EDC63E423E3E), - SPH_C64(0x20ABF22059EB5959), SPH_C64(0xE28746E2C15EC1C1), - SPH_C64(0x6E0D426E4FD14F4F), SPH_C64(0xFABF8DFA32563232), - SPH_C64(0x4EA6B04E163A1616), SPH_C64(0x35798335FA13FAFA), - SPH_C64(0xB9F387B9749C7474), SPH_C64(0x30708B30FB10FBFB), - SPH_C64(0xF25C3FF263A56363), SPH_C64(0xD9138CD99FBC9F9F), - SPH_C64(0xE489BDE4345C3434), SPH_C64(0x72CAD0721A2E1A1A), - SPH_C64(0x82674D822A7E2A2A), SPH_C64(0x2FB0EA2F5AEE5A5A), - SPH_C64(0x83911C838D8A8D8D), SPH_C64(0xCACF06CAC946C9C9), - SPH_C64(0xD4F936D4CF4CCFCF), SPH_C64(0x0915E309F607F6F6), - SPH_C64(0xEA64F4EA90AD9090), SPH_C64(0x88755D8828782828), - SPH_C64(0x92BC349288858888), SPH_C64(0xCD37ACCD9BB09B9B), - SPH_C64(0xF5A495F531533131), SPH_C64(0x367E70360E120E0E), - SPH_C64(0x733C8173BDDABDBD), SPH_C64(0x7F206A7F4ADE4A4A), - SPH_C64(0x6FFB136FE825E8E8), SPH_C64(0xF452C4F496A79696), - SPH_C64(0x04FF5904A6F7A6A6), SPH_C64(0x3C6C603C0C140C0C), - SPH_C64(0xCFC60ECFC845C8C8), SPH_C64(0x8096EF80798B7979), - SPH_C64(0x76358976BCD9BCBC), SPH_C64(0x7C27997CBEDFBEBE), - SPH_C64(0x74C42B74EF2CEFEF), SPH_C64(0xCB3957CB6EB26E6E), - SPH_C64(0x434C0A4346CA4646), SPH_C64(0xF15BCCF197A49797), - SPH_C64(0x2AB9E22A5BED5B5B), SPH_C64(0x7ED63B7EED2AEDED), - SPH_C64(0x7DD1C87D192B1919), SPH_C64(0x9A5F869AD976D9D9), - SPH_C64(0x26A50926ACE9ACAC), SPH_C64(0xC725BCC799B69999), - SPH_C64(0x32812932A8E5A8A8), SPH_C64(0x8D7C558D297B2929), - SPH_C64(0xE96307E964AC6464), SPH_C64(0x63E7F8631F211F1F), - SPH_C64(0x23AC0123ADEAADAD), SPH_C64(0x1CC7921C55FF5555), - SPH_C64(0x5F8B985F13351313), SPH_C64(0x6D0AB16DBBD0BBBB), - SPH_C64(0x0C1CEB0CF704F7F7), SPH_C64(0xCE305FCE6FB16F6F), - SPH_C64(0x6718A167B9D6B9B9), SPH_C64(0x4645024647C94747), - SPH_C64(0x934A65932F712F2F), SPH_C64(0x71CD2371EE2FEEEE), - SPH_C64(0x6211A962B8D5B8B8), SPH_C64(0x8A84FF8A7B8D7B7B), - SPH_C64(0x97B53C9789868989), SPH_C64(0xF0AD9DF030503030), - SPH_C64(0xB805D6B8D368D3D3), SPH_C64(0x9EA0DF9E7F817F7F), - SPH_C64(0xB3E197B3769A7676), SPH_C64(0xB0E664B0829B8282) -}; - -#if !SPH_SMALL_FOOTPRINT_WHIRLPOOL - -static const sph_u64 old0_T1[256] = { - SPH_C64(0x0F67D568B86868D5), SPH_C64(0x1ECEB7D06DD0D0B7), - SPH_C64(0xE00B60EB20EBEB60), SPH_C64(0x6E45872B7D2B2B87), - SPH_C64(0x327A7548D8484875), SPH_C64(0x019CD39DBA9D9DD3), - SPH_C64(0x1D77DF6ABE6A6ADF), SPH_C64(0x977353E431E4E453), - SPH_C64(0xA84B48E338E3E348), SPH_C64(0xD27115A3F8A3A315), - SPH_C64(0xDC8A1356FA565613), SPH_C64(0xFD7CBF819E8181BF), - SPH_C64(0xB2CF947D877D7D94), SPH_C64(0x2ADB12F10EF1F112), - SPH_C64(0xD95CAB85928585AB), SPH_C64(0x1A84DC9EBF9E9EDC), - SPH_C64(0x517D9C2C742C2C9C), SPH_C64(0x8A048C8E8F8E8E8C), - SPH_C64(0x9FE7857888787885), SPH_C64(0xD41EC5CA43CACAC5), - SPH_C64(0xAFB84B173917174B), SPH_C64(0x882137A9E6A9A937), - SPH_C64(0x4E2FF861A36161F8), SPH_C64(0x33E6A6D562D5D5A6), - SPH_C64(0x8FD2345DE75D5D34), SPH_C64(0x5358270B1D0B0B27), - SPH_C64(0x9814868C898C8C86), SPH_C64(0xC1FDCC3C443C3CCC), - SPH_C64(0xE89FB677997777B6), SPH_C64(0xE3B20851F3515108), - SPH_C64(0x2F0DAA22662222AA), SPH_C64(0x682A5742C6424257), - SPH_C64(0xDAE5C33F413F3FC3), SPH_C64(0xCE9A1954FC545419), - SPH_C64(0x73325841C3414158), SPH_C64(0xF474BA809D8080BA), - SPH_C64(0xE22EDBCC49CCCCDB), SPH_C64(0xC244A486978686A4), - SPH_C64(0x42F145B3C8B3B345), SPH_C64(0xD8C0781828181878), - SPH_C64(0x436D962E722E2E96), SPH_C64(0xD5821657F9575716), - SPH_C64(0x36301E060A06061E), SPH_C64(0x5537F762A66262F7), - SPH_C64(0x07F303F401F4F403), SPH_C64(0x9BADEE365A3636EE), - SPH_C64(0x17C6B2D16ED1D1B2), SPH_C64(0x147FDA6BBD6B6BDA), - SPH_C64(0xC3D8771B2D1B1B77), SPH_C64(0x6A0FEC65AF6565EC), - SPH_C64(0xFA8FBC759F7575BC), SPH_C64(0x9080501030101050), - SPH_C64(0x449E95DA73DADA95), SPH_C64(0x3B727049DB494970), - SPH_C64(0x0B2DBE266A2626BE), SPH_C64(0x629B3AF916F9F93A), - SPH_C64(0xDD16C0CB40CBCBC0), SPH_C64(0x7117E366AA6666E3), - SPH_C64(0x8C6B5CE734E7E75C), SPH_C64(0x03B968BAD3BABA68), - SPH_C64(0xB7192CAEEFAEAE2C), SPH_C64(0xEABA0D50F050500D), - SPH_C64(0xF8AA0752F6525207), SPH_C64(0x9A313DABE0ABAB3D), - SPH_C64(0x2D2811050F050511), SPH_C64(0x23D317F00DF0F017), - SPH_C64(0x6568390D170D0D39), SPH_C64(0xCCBFA273957373A2), - SPH_C64(0xFEC5D73B4D3B3BD7), SPH_C64(0x242014040C040414), - SPH_C64(0x3D1DA020602020A0), SPH_C64(0x5DA321FE1FFEFE21), - SPH_C64(0x7BA68EDD7ADDDD8E), SPH_C64(0x0EFB06F502F5F506), - SPH_C64(0x7DC95EB4C1B4B45E), SPH_C64(0x9DC23E5FE15F5F3E), - SPH_C64(0x5A50220A1E0A0A22), SPH_C64(0x74C15BB5C2B5B55B), - SPH_C64(0x8E4EE7C05DC0C0E7), SPH_C64(0xC9691AA0FDA0A01A), - SPH_C64(0xDEAFA871937171A8), SPH_C64(0xE4410BA5F2A5A50B), - SPH_C64(0x5875992D772D2D99), SPH_C64(0x4727FD60A06060FD), - SPH_C64(0xC5B7A772967272A7), SPH_C64(0x7FECE593A89393E5), - SPH_C64(0xECD5DD394B3939DD), SPH_C64(0x4840280818080828), - SPH_C64(0xEF6CB583988383B5), SPH_C64(0x3415A521632121A5), - SPH_C64(0x86DA315CE45C5C31), SPH_C64(0xCB4CA187948787A1), - SPH_C64(0x50E14FB1CEB1B14F), SPH_C64(0xB35347E03DE0E047), - SPH_C64(0x0000000000000000), SPH_C64(0x9556E8C358C3C3E8), - SPH_C64(0x82905A123612125A), SPH_C64(0x6DFCEF91AE9191EF), - SPH_C64(0xAE24988A838A8A98), SPH_C64(0x12100A020602020A), - SPH_C64(0xFCE06C1C241C1C6C), SPH_C64(0x856359E637E6E659), - SPH_C64(0x57124C45CF45454C), SPH_C64(0x9C5EEDC25BC2C2ED), - SPH_C64(0xAA6EF3C451C4C4F3), SPH_C64(0x46BB2EFD1AFDFD2E), - SPH_C64(0x2E9179BFDCBFBF79), SPH_C64(0x5E1A4944CC444449), - SPH_C64(0xC0611FA1FEA1A11F), SPH_C64(0x165A614CD44C4C61), - SPH_C64(0xB685FF33553333FF), SPH_C64(0xA366F6C552C5C5F6), - SPH_C64(0xD054AE84918484AE), SPH_C64(0x2605AF23652323AF), - SPH_C64(0xBBC7917C847C7C91), SPH_C64(0x59E94AB0CDB0B04A), - SPH_C64(0x1035B1256F2525B1), SPH_C64(0xBDA841153F151541), - SPH_C64(0x80B5E1355F3535E1), SPH_C64(0x066FD069BB6969D0), - SPH_C64(0x54AB24FF1CFFFF24), SPH_C64(0x40D4FE94A19494FE), - SPH_C64(0x1F52644DD74D4D64), SPH_C64(0xD7A7AD70907070AD), - SPH_C64(0xDB7910A2FBA2A210), SPH_C64(0xBE1129AFECAFAF29), - SPH_C64(0xEB26DECD4ACDCDDE), SPH_C64(0x28FEA9D667D6D6A9), - SPH_C64(0x2B47C16CB46C6CC1), SPH_C64(0x66D151B7C4B7B751), - SPH_C64(0x6B933FF815F8F83F), SPH_C64(0x41482D091B09092D), - SPH_C64(0x38CB18F308F3F318), SPH_C64(0x781FE667A96767E6), - SPH_C64(0xED490EA4F1A4A40E), SPH_C64(0xE90365EA23EAEA65), - SPH_C64(0xDF337BEC29ECEC7B), SPH_C64(0x6FD954B6C7B6B654), - SPH_C64(0x3AEEA3D461D4D4A3), SPH_C64(0x0CDEBDD26BD2D2BD), - SPH_C64(0xB4A044143C141444), SPH_C64(0xEEF0661E221E1E66), - SPH_C64(0xBA5B42E13EE1E142), SPH_C64(0x193DB4246C2424B4), - SPH_C64(0xE5DDD838483838D8), SPH_C64(0xB87EF9C657C6C6F9), - SPH_C64(0x4D9690DB70DBDB90), SPH_C64(0x29627A4BDD4B4B7A), - SPH_C64(0x8DF78F7A8E7A7A8F), SPH_C64(0xF7CDD23A4E3A3AD2), - SPH_C64(0x60BE81DE7FDEDE81), SPH_C64(0x94CA3B5EE25E5E3B), - SPH_C64(0x69B684DF7CDFDF84), SPH_C64(0x49DCFB95A29595FB), - SPH_C64(0x4FB32BFC19FCFC2B), SPH_C64(0x933938AAE3AAAA38), - SPH_C64(0x21F6ACD764D7D7AC), SPH_C64(0xF03ED1CE4FCECED1), - SPH_C64(0x3F381B070907071B), SPH_C64(0x7778330F110F0F33), - SPH_C64(0xC8F5C93D473D3DC9), SPH_C64(0xA2FA2558E8585825), - SPH_C64(0x3EA4C89AB39A9AC8), SPH_C64(0x2CB4C298B59898C2), - SPH_C64(0x0894D69CB99C9CD6), SPH_C64(0x31C31DF20BF2F21D), - SPH_C64(0xF65101A7F4A7A701), SPH_C64(0x9988551133111155), - SPH_C64(0xA9D79B7E827E7E9B), SPH_C64(0xA72C9D8B808B8B9D), - SPH_C64(0x61225243C5434352), SPH_C64(0x1B180F030503030F), - SPH_C64(0xA1434DE23BE2E24D), SPH_C64(0x72AE8BDC79DCDC8B), - SPH_C64(0x9E7B56E532E5E556), SPH_C64(0x4BF940B2CBB2B240), - SPH_C64(0x044A6B4ED24E4E6B), SPH_C64(0xB176FCC754C7C7FC), - SPH_C64(0x224FC46DB76D6DC4), SPH_C64(0xF21B6AE926E9E96A), - SPH_C64(0x0225BB27692727BB), SPH_C64(0x7A3A5D40C040405D), - SPH_C64(0x568E9FD875D8D89F), SPH_C64(0x92A5EB37593737EB), - SPH_C64(0x76E4E092AB9292E0), SPH_C64(0x830C898F8C8F8F89), - SPH_C64(0x0908050103010105), SPH_C64(0xF5E8691D271D1D69), - SPH_C64(0xF1A20253F5535302), SPH_C64(0xD3EDC63E423E3EC6), - SPH_C64(0xABF22059EB595920), SPH_C64(0x8746E2C15EC1C1E2), - SPH_C64(0x0D426E4FD14F4F6E), SPH_C64(0xBF8DFA32563232FA), - SPH_C64(0xA6B04E163A16164E), SPH_C64(0x798335FA13FAFA35), - SPH_C64(0xF387B9749C7474B9), SPH_C64(0x708B30FB10FBFB30), - SPH_C64(0x5C3FF263A56363F2), SPH_C64(0x138CD99FBC9F9FD9), - SPH_C64(0x89BDE4345C3434E4), SPH_C64(0xCAD0721A2E1A1A72), - SPH_C64(0x674D822A7E2A2A82), SPH_C64(0xB0EA2F5AEE5A5A2F), - SPH_C64(0x911C838D8A8D8D83), SPH_C64(0xCF06CAC946C9C9CA), - SPH_C64(0xF936D4CF4CCFCFD4), SPH_C64(0x15E309F607F6F609), - SPH_C64(0x64F4EA90AD9090EA), SPH_C64(0x755D882878282888), - SPH_C64(0xBC34928885888892), SPH_C64(0x37ACCD9BB09B9BCD), - SPH_C64(0xA495F531533131F5), SPH_C64(0x7E70360E120E0E36), - SPH_C64(0x3C8173BDDABDBD73), SPH_C64(0x206A7F4ADE4A4A7F), - SPH_C64(0xFB136FE825E8E86F), SPH_C64(0x52C4F496A79696F4), - SPH_C64(0xFF5904A6F7A6A604), SPH_C64(0x6C603C0C140C0C3C), - SPH_C64(0xC60ECFC845C8C8CF), SPH_C64(0x96EF80798B797980), - SPH_C64(0x358976BCD9BCBC76), SPH_C64(0x27997CBEDFBEBE7C), - SPH_C64(0xC42B74EF2CEFEF74), SPH_C64(0x3957CB6EB26E6ECB), - SPH_C64(0x4C0A4346CA464643), SPH_C64(0x5BCCF197A49797F1), - SPH_C64(0xB9E22A5BED5B5B2A), SPH_C64(0xD63B7EED2AEDED7E), - SPH_C64(0xD1C87D192B19197D), SPH_C64(0x5F869AD976D9D99A), - SPH_C64(0xA50926ACE9ACAC26), SPH_C64(0x25BCC799B69999C7), - SPH_C64(0x812932A8E5A8A832), SPH_C64(0x7C558D297B29298D), - SPH_C64(0x6307E964AC6464E9), SPH_C64(0xE7F8631F211F1F63), - SPH_C64(0xAC0123ADEAADAD23), SPH_C64(0xC7921C55FF55551C), - SPH_C64(0x8B985F133513135F), SPH_C64(0x0AB16DBBD0BBBB6D), - SPH_C64(0x1CEB0CF704F7F70C), SPH_C64(0x305FCE6FB16F6FCE), - SPH_C64(0x18A167B9D6B9B967), SPH_C64(0x45024647C9474746), - SPH_C64(0x4A65932F712F2F93), SPH_C64(0xCD2371EE2FEEEE71), - SPH_C64(0x11A962B8D5B8B862), SPH_C64(0x84FF8A7B8D7B7B8A), - SPH_C64(0xB53C978986898997), SPH_C64(0xAD9DF030503030F0), - SPH_C64(0x05D6B8D368D3D3B8), SPH_C64(0xA0DF9E7F817F7F9E), - SPH_C64(0xE197B3769A7676B3), SPH_C64(0xE664B0829B8282B0) -}; - -static const sph_u64 old0_T2[256] = { - SPH_C64(0x67D568B86868D50F), SPH_C64(0xCEB7D06DD0D0B71E), - SPH_C64(0x0B60EB20EBEB60E0), SPH_C64(0x45872B7D2B2B876E), - SPH_C64(0x7A7548D848487532), SPH_C64(0x9CD39DBA9D9DD301), - SPH_C64(0x77DF6ABE6A6ADF1D), SPH_C64(0x7353E431E4E45397), - SPH_C64(0x4B48E338E3E348A8), SPH_C64(0x7115A3F8A3A315D2), - SPH_C64(0x8A1356FA565613DC), SPH_C64(0x7CBF819E8181BFFD), - SPH_C64(0xCF947D877D7D94B2), SPH_C64(0xDB12F10EF1F1122A), - SPH_C64(0x5CAB85928585ABD9), SPH_C64(0x84DC9EBF9E9EDC1A), - SPH_C64(0x7D9C2C742C2C9C51), SPH_C64(0x048C8E8F8E8E8C8A), - SPH_C64(0xE78578887878859F), SPH_C64(0x1EC5CA43CACAC5D4), - SPH_C64(0xB84B173917174BAF), SPH_C64(0x2137A9E6A9A93788), - SPH_C64(0x2FF861A36161F84E), SPH_C64(0xE6A6D562D5D5A633), - SPH_C64(0xD2345DE75D5D348F), SPH_C64(0x58270B1D0B0B2753), - SPH_C64(0x14868C898C8C8698), SPH_C64(0xFDCC3C443C3CCCC1), - SPH_C64(0x9FB677997777B6E8), SPH_C64(0xB20851F3515108E3), - SPH_C64(0x0DAA22662222AA2F), SPH_C64(0x2A5742C642425768), - SPH_C64(0xE5C33F413F3FC3DA), SPH_C64(0x9A1954FC545419CE), - SPH_C64(0x325841C341415873), SPH_C64(0x74BA809D8080BAF4), - SPH_C64(0x2EDBCC49CCCCDBE2), SPH_C64(0x44A486978686A4C2), - SPH_C64(0xF145B3C8B3B34542), SPH_C64(0xC0781828181878D8), - SPH_C64(0x6D962E722E2E9643), SPH_C64(0x821657F9575716D5), - SPH_C64(0x301E060A06061E36), SPH_C64(0x37F762A66262F755), - SPH_C64(0xF303F401F4F40307), SPH_C64(0xADEE365A3636EE9B), - SPH_C64(0xC6B2D16ED1D1B217), SPH_C64(0x7FDA6BBD6B6BDA14), - SPH_C64(0xD8771B2D1B1B77C3), SPH_C64(0x0FEC65AF6565EC6A), - SPH_C64(0x8FBC759F7575BCFA), SPH_C64(0x8050103010105090), - SPH_C64(0x9E95DA73DADA9544), SPH_C64(0x727049DB4949703B), - SPH_C64(0x2DBE266A2626BE0B), SPH_C64(0x9B3AF916F9F93A62), - SPH_C64(0x16C0CB40CBCBC0DD), SPH_C64(0x17E366AA6666E371), - SPH_C64(0x6B5CE734E7E75C8C), SPH_C64(0xB968BAD3BABA6803), - SPH_C64(0x192CAEEFAEAE2CB7), SPH_C64(0xBA0D50F050500DEA), - SPH_C64(0xAA0752F6525207F8), SPH_C64(0x313DABE0ABAB3D9A), - SPH_C64(0x2811050F0505112D), SPH_C64(0xD317F00DF0F01723), - SPH_C64(0x68390D170D0D3965), SPH_C64(0xBFA273957373A2CC), - SPH_C64(0xC5D73B4D3B3BD7FE), SPH_C64(0x2014040C04041424), - SPH_C64(0x1DA020602020A03D), SPH_C64(0xA321FE1FFEFE215D), - SPH_C64(0xA68EDD7ADDDD8E7B), SPH_C64(0xFB06F502F5F5060E), - SPH_C64(0xC95EB4C1B4B45E7D), SPH_C64(0xC23E5FE15F5F3E9D), - SPH_C64(0x50220A1E0A0A225A), SPH_C64(0xC15BB5C2B5B55B74), - SPH_C64(0x4EE7C05DC0C0E78E), SPH_C64(0x691AA0FDA0A01AC9), - SPH_C64(0xAFA871937171A8DE), SPH_C64(0x410BA5F2A5A50BE4), - SPH_C64(0x75992D772D2D9958), SPH_C64(0x27FD60A06060FD47), - SPH_C64(0xB7A772967272A7C5), SPH_C64(0xECE593A89393E57F), - SPH_C64(0xD5DD394B3939DDEC), SPH_C64(0x4028081808082848), - SPH_C64(0x6CB583988383B5EF), SPH_C64(0x15A521632121A534), - SPH_C64(0xDA315CE45C5C3186), SPH_C64(0x4CA187948787A1CB), - SPH_C64(0xE14FB1CEB1B14F50), SPH_C64(0x5347E03DE0E047B3), - SPH_C64(0x0000000000000000), SPH_C64(0x56E8C358C3C3E895), - SPH_C64(0x905A123612125A82), SPH_C64(0xFCEF91AE9191EF6D), - SPH_C64(0x24988A838A8A98AE), SPH_C64(0x100A020602020A12), - SPH_C64(0xE06C1C241C1C6CFC), SPH_C64(0x6359E637E6E65985), - SPH_C64(0x124C45CF45454C57), SPH_C64(0x5EEDC25BC2C2ED9C), - SPH_C64(0x6EF3C451C4C4F3AA), SPH_C64(0xBB2EFD1AFDFD2E46), - SPH_C64(0x9179BFDCBFBF792E), SPH_C64(0x1A4944CC4444495E), - SPH_C64(0x611FA1FEA1A11FC0), SPH_C64(0x5A614CD44C4C6116), - SPH_C64(0x85FF33553333FFB6), SPH_C64(0x66F6C552C5C5F6A3), - SPH_C64(0x54AE84918484AED0), SPH_C64(0x05AF23652323AF26), - SPH_C64(0xC7917C847C7C91BB), SPH_C64(0xE94AB0CDB0B04A59), - SPH_C64(0x35B1256F2525B110), SPH_C64(0xA841153F151541BD), - SPH_C64(0xB5E1355F3535E180), SPH_C64(0x6FD069BB6969D006), - SPH_C64(0xAB24FF1CFFFF2454), SPH_C64(0xD4FE94A19494FE40), - SPH_C64(0x52644DD74D4D641F), SPH_C64(0xA7AD70907070ADD7), - SPH_C64(0x7910A2FBA2A210DB), SPH_C64(0x1129AFECAFAF29BE), - SPH_C64(0x26DECD4ACDCDDEEB), SPH_C64(0xFEA9D667D6D6A928), - SPH_C64(0x47C16CB46C6CC12B), SPH_C64(0xD151B7C4B7B75166), - SPH_C64(0x933FF815F8F83F6B), SPH_C64(0x482D091B09092D41), - SPH_C64(0xCB18F308F3F31838), SPH_C64(0x1FE667A96767E678), - SPH_C64(0x490EA4F1A4A40EED), SPH_C64(0x0365EA23EAEA65E9), - SPH_C64(0x337BEC29ECEC7BDF), SPH_C64(0xD954B6C7B6B6546F), - SPH_C64(0xEEA3D461D4D4A33A), SPH_C64(0xDEBDD26BD2D2BD0C), - SPH_C64(0xA044143C141444B4), SPH_C64(0xF0661E221E1E66EE), - SPH_C64(0x5B42E13EE1E142BA), SPH_C64(0x3DB4246C2424B419), - SPH_C64(0xDDD838483838D8E5), SPH_C64(0x7EF9C657C6C6F9B8), - SPH_C64(0x9690DB70DBDB904D), SPH_C64(0x627A4BDD4B4B7A29), - SPH_C64(0xF78F7A8E7A7A8F8D), SPH_C64(0xCDD23A4E3A3AD2F7), - SPH_C64(0xBE81DE7FDEDE8160), SPH_C64(0xCA3B5EE25E5E3B94), - SPH_C64(0xB684DF7CDFDF8469), SPH_C64(0xDCFB95A29595FB49), - SPH_C64(0xB32BFC19FCFC2B4F), SPH_C64(0x3938AAE3AAAA3893), - SPH_C64(0xF6ACD764D7D7AC21), SPH_C64(0x3ED1CE4FCECED1F0), - SPH_C64(0x381B070907071B3F), SPH_C64(0x78330F110F0F3377), - SPH_C64(0xF5C93D473D3DC9C8), SPH_C64(0xFA2558E8585825A2), - SPH_C64(0xA4C89AB39A9AC83E), SPH_C64(0xB4C298B59898C22C), - SPH_C64(0x94D69CB99C9CD608), SPH_C64(0xC31DF20BF2F21D31), - SPH_C64(0x5101A7F4A7A701F6), SPH_C64(0x8855113311115599), - SPH_C64(0xD79B7E827E7E9BA9), SPH_C64(0x2C9D8B808B8B9DA7), - SPH_C64(0x225243C543435261), SPH_C64(0x180F030503030F1B), - SPH_C64(0x434DE23BE2E24DA1), SPH_C64(0xAE8BDC79DCDC8B72), - SPH_C64(0x7B56E532E5E5569E), SPH_C64(0xF940B2CBB2B2404B), - SPH_C64(0x4A6B4ED24E4E6B04), SPH_C64(0x76FCC754C7C7FCB1), - SPH_C64(0x4FC46DB76D6DC422), SPH_C64(0x1B6AE926E9E96AF2), - SPH_C64(0x25BB27692727BB02), SPH_C64(0x3A5D40C040405D7A), - SPH_C64(0x8E9FD875D8D89F56), SPH_C64(0xA5EB37593737EB92), - SPH_C64(0xE4E092AB9292E076), SPH_C64(0x0C898F8C8F8F8983), - SPH_C64(0x0805010301010509), SPH_C64(0xE8691D271D1D69F5), - SPH_C64(0xA20253F5535302F1), SPH_C64(0xEDC63E423E3EC6D3), - SPH_C64(0xF22059EB595920AB), SPH_C64(0x46E2C15EC1C1E287), - SPH_C64(0x426E4FD14F4F6E0D), SPH_C64(0x8DFA32563232FABF), - SPH_C64(0xB04E163A16164EA6), SPH_C64(0x8335FA13FAFA3579), - SPH_C64(0x87B9749C7474B9F3), SPH_C64(0x8B30FB10FBFB3070), - SPH_C64(0x3FF263A56363F25C), SPH_C64(0x8CD99FBC9F9FD913), - SPH_C64(0xBDE4345C3434E489), SPH_C64(0xD0721A2E1A1A72CA), - SPH_C64(0x4D822A7E2A2A8267), SPH_C64(0xEA2F5AEE5A5A2FB0), - SPH_C64(0x1C838D8A8D8D8391), SPH_C64(0x06CAC946C9C9CACF), - SPH_C64(0x36D4CF4CCFCFD4F9), SPH_C64(0xE309F607F6F60915), - SPH_C64(0xF4EA90AD9090EA64), SPH_C64(0x5D88287828288875), - SPH_C64(0x34928885888892BC), SPH_C64(0xACCD9BB09B9BCD37), - SPH_C64(0x95F531533131F5A4), SPH_C64(0x70360E120E0E367E), - SPH_C64(0x8173BDDABDBD733C), SPH_C64(0x6A7F4ADE4A4A7F20), - SPH_C64(0x136FE825E8E86FFB), SPH_C64(0xC4F496A79696F452), - SPH_C64(0x5904A6F7A6A604FF), SPH_C64(0x603C0C140C0C3C6C), - SPH_C64(0x0ECFC845C8C8CFC6), SPH_C64(0xEF80798B79798096), - SPH_C64(0x8976BCD9BCBC7635), SPH_C64(0x997CBEDFBEBE7C27), - SPH_C64(0x2B74EF2CEFEF74C4), SPH_C64(0x57CB6EB26E6ECB39), - SPH_C64(0x0A4346CA4646434C), SPH_C64(0xCCF197A49797F15B), - SPH_C64(0xE22A5BED5B5B2AB9), SPH_C64(0x3B7EED2AEDED7ED6), - SPH_C64(0xC87D192B19197DD1), SPH_C64(0x869AD976D9D99A5F), - SPH_C64(0x0926ACE9ACAC26A5), SPH_C64(0xBCC799B69999C725), - SPH_C64(0x2932A8E5A8A83281), SPH_C64(0x558D297B29298D7C), - SPH_C64(0x07E964AC6464E963), SPH_C64(0xF8631F211F1F63E7), - SPH_C64(0x0123ADEAADAD23AC), SPH_C64(0x921C55FF55551CC7), - SPH_C64(0x985F133513135F8B), SPH_C64(0xB16DBBD0BBBB6D0A), - SPH_C64(0xEB0CF704F7F70C1C), SPH_C64(0x5FCE6FB16F6FCE30), - SPH_C64(0xA167B9D6B9B96718), SPH_C64(0x024647C947474645), - SPH_C64(0x65932F712F2F934A), SPH_C64(0x2371EE2FEEEE71CD), - SPH_C64(0xA962B8D5B8B86211), SPH_C64(0xFF8A7B8D7B7B8A84), - SPH_C64(0x3C978986898997B5), SPH_C64(0x9DF030503030F0AD), - SPH_C64(0xD6B8D368D3D3B805), SPH_C64(0xDF9E7F817F7F9EA0), - SPH_C64(0x97B3769A7676B3E1), SPH_C64(0x64B0829B8282B0E6) -}; - -static const sph_u64 old0_T3[256] = { - SPH_C64(0xD568B86868D50F67), SPH_C64(0xB7D06DD0D0B71ECE), - SPH_C64(0x60EB20EBEB60E00B), SPH_C64(0x872B7D2B2B876E45), - SPH_C64(0x7548D8484875327A), SPH_C64(0xD39DBA9D9DD3019C), - SPH_C64(0xDF6ABE6A6ADF1D77), SPH_C64(0x53E431E4E4539773), - SPH_C64(0x48E338E3E348A84B), SPH_C64(0x15A3F8A3A315D271), - SPH_C64(0x1356FA565613DC8A), SPH_C64(0xBF819E8181BFFD7C), - SPH_C64(0x947D877D7D94B2CF), SPH_C64(0x12F10EF1F1122ADB), - SPH_C64(0xAB85928585ABD95C), SPH_C64(0xDC9EBF9E9EDC1A84), - SPH_C64(0x9C2C742C2C9C517D), SPH_C64(0x8C8E8F8E8E8C8A04), - SPH_C64(0x8578887878859FE7), SPH_C64(0xC5CA43CACAC5D41E), - SPH_C64(0x4B173917174BAFB8), SPH_C64(0x37A9E6A9A9378821), - SPH_C64(0xF861A36161F84E2F), SPH_C64(0xA6D562D5D5A633E6), - SPH_C64(0x345DE75D5D348FD2), SPH_C64(0x270B1D0B0B275358), - SPH_C64(0x868C898C8C869814), SPH_C64(0xCC3C443C3CCCC1FD), - SPH_C64(0xB677997777B6E89F), SPH_C64(0x0851F3515108E3B2), - SPH_C64(0xAA22662222AA2F0D), SPH_C64(0x5742C6424257682A), - SPH_C64(0xC33F413F3FC3DAE5), SPH_C64(0x1954FC545419CE9A), - SPH_C64(0x5841C34141587332), SPH_C64(0xBA809D8080BAF474), - SPH_C64(0xDBCC49CCCCDBE22E), SPH_C64(0xA486978686A4C244), - SPH_C64(0x45B3C8B3B34542F1), SPH_C64(0x781828181878D8C0), - SPH_C64(0x962E722E2E96436D), SPH_C64(0x1657F9575716D582), - SPH_C64(0x1E060A06061E3630), SPH_C64(0xF762A66262F75537), - SPH_C64(0x03F401F4F40307F3), SPH_C64(0xEE365A3636EE9BAD), - SPH_C64(0xB2D16ED1D1B217C6), SPH_C64(0xDA6BBD6B6BDA147F), - SPH_C64(0x771B2D1B1B77C3D8), SPH_C64(0xEC65AF6565EC6A0F), - SPH_C64(0xBC759F7575BCFA8F), SPH_C64(0x5010301010509080), - SPH_C64(0x95DA73DADA95449E), SPH_C64(0x7049DB4949703B72), - SPH_C64(0xBE266A2626BE0B2D), SPH_C64(0x3AF916F9F93A629B), - SPH_C64(0xC0CB40CBCBC0DD16), SPH_C64(0xE366AA6666E37117), - SPH_C64(0x5CE734E7E75C8C6B), SPH_C64(0x68BAD3BABA6803B9), - SPH_C64(0x2CAEEFAEAE2CB719), SPH_C64(0x0D50F050500DEABA), - SPH_C64(0x0752F6525207F8AA), SPH_C64(0x3DABE0ABAB3D9A31), - SPH_C64(0x11050F0505112D28), SPH_C64(0x17F00DF0F01723D3), - SPH_C64(0x390D170D0D396568), SPH_C64(0xA273957373A2CCBF), - SPH_C64(0xD73B4D3B3BD7FEC5), SPH_C64(0x14040C0404142420), - SPH_C64(0xA020602020A03D1D), SPH_C64(0x21FE1FFEFE215DA3), - SPH_C64(0x8EDD7ADDDD8E7BA6), SPH_C64(0x06F502F5F5060EFB), - SPH_C64(0x5EB4C1B4B45E7DC9), SPH_C64(0x3E5FE15F5F3E9DC2), - SPH_C64(0x220A1E0A0A225A50), SPH_C64(0x5BB5C2B5B55B74C1), - SPH_C64(0xE7C05DC0C0E78E4E), SPH_C64(0x1AA0FDA0A01AC969), - SPH_C64(0xA871937171A8DEAF), SPH_C64(0x0BA5F2A5A50BE441), - SPH_C64(0x992D772D2D995875), SPH_C64(0xFD60A06060FD4727), - SPH_C64(0xA772967272A7C5B7), SPH_C64(0xE593A89393E57FEC), - SPH_C64(0xDD394B3939DDECD5), SPH_C64(0x2808180808284840), - SPH_C64(0xB583988383B5EF6C), SPH_C64(0xA521632121A53415), - SPH_C64(0x315CE45C5C3186DA), SPH_C64(0xA187948787A1CB4C), - SPH_C64(0x4FB1CEB1B14F50E1), SPH_C64(0x47E03DE0E047B353), - SPH_C64(0x0000000000000000), SPH_C64(0xE8C358C3C3E89556), - SPH_C64(0x5A123612125A8290), SPH_C64(0xEF91AE9191EF6DFC), - SPH_C64(0x988A838A8A98AE24), SPH_C64(0x0A020602020A1210), - SPH_C64(0x6C1C241C1C6CFCE0), SPH_C64(0x59E637E6E6598563), - SPH_C64(0x4C45CF45454C5712), SPH_C64(0xEDC25BC2C2ED9C5E), - SPH_C64(0xF3C451C4C4F3AA6E), SPH_C64(0x2EFD1AFDFD2E46BB), - SPH_C64(0x79BFDCBFBF792E91), SPH_C64(0x4944CC4444495E1A), - SPH_C64(0x1FA1FEA1A11FC061), SPH_C64(0x614CD44C4C61165A), - SPH_C64(0xFF33553333FFB685), SPH_C64(0xF6C552C5C5F6A366), - SPH_C64(0xAE84918484AED054), SPH_C64(0xAF23652323AF2605), - SPH_C64(0x917C847C7C91BBC7), SPH_C64(0x4AB0CDB0B04A59E9), - SPH_C64(0xB1256F2525B11035), SPH_C64(0x41153F151541BDA8), - SPH_C64(0xE1355F3535E180B5), SPH_C64(0xD069BB6969D0066F), - SPH_C64(0x24FF1CFFFF2454AB), SPH_C64(0xFE94A19494FE40D4), - SPH_C64(0x644DD74D4D641F52), SPH_C64(0xAD70907070ADD7A7), - SPH_C64(0x10A2FBA2A210DB79), SPH_C64(0x29AFECAFAF29BE11), - SPH_C64(0xDECD4ACDCDDEEB26), SPH_C64(0xA9D667D6D6A928FE), - SPH_C64(0xC16CB46C6CC12B47), SPH_C64(0x51B7C4B7B75166D1), - SPH_C64(0x3FF815F8F83F6B93), SPH_C64(0x2D091B09092D4148), - SPH_C64(0x18F308F3F31838CB), SPH_C64(0xE667A96767E6781F), - SPH_C64(0x0EA4F1A4A40EED49), SPH_C64(0x65EA23EAEA65E903), - SPH_C64(0x7BEC29ECEC7BDF33), SPH_C64(0x54B6C7B6B6546FD9), - SPH_C64(0xA3D461D4D4A33AEE), SPH_C64(0xBDD26BD2D2BD0CDE), - SPH_C64(0x44143C141444B4A0), SPH_C64(0x661E221E1E66EEF0), - SPH_C64(0x42E13EE1E142BA5B), SPH_C64(0xB4246C2424B4193D), - SPH_C64(0xD838483838D8E5DD), SPH_C64(0xF9C657C6C6F9B87E), - SPH_C64(0x90DB70DBDB904D96), SPH_C64(0x7A4BDD4B4B7A2962), - SPH_C64(0x8F7A8E7A7A8F8DF7), SPH_C64(0xD23A4E3A3AD2F7CD), - SPH_C64(0x81DE7FDEDE8160BE), SPH_C64(0x3B5EE25E5E3B94CA), - SPH_C64(0x84DF7CDFDF8469B6), SPH_C64(0xFB95A29595FB49DC), - SPH_C64(0x2BFC19FCFC2B4FB3), SPH_C64(0x38AAE3AAAA389339), - SPH_C64(0xACD764D7D7AC21F6), SPH_C64(0xD1CE4FCECED1F03E), - SPH_C64(0x1B070907071B3F38), SPH_C64(0x330F110F0F337778), - SPH_C64(0xC93D473D3DC9C8F5), SPH_C64(0x2558E8585825A2FA), - SPH_C64(0xC89AB39A9AC83EA4), SPH_C64(0xC298B59898C22CB4), - SPH_C64(0xD69CB99C9CD60894), SPH_C64(0x1DF20BF2F21D31C3), - SPH_C64(0x01A7F4A7A701F651), SPH_C64(0x5511331111559988), - SPH_C64(0x9B7E827E7E9BA9D7), SPH_C64(0x9D8B808B8B9DA72C), - SPH_C64(0x5243C54343526122), SPH_C64(0x0F030503030F1B18), - SPH_C64(0x4DE23BE2E24DA143), SPH_C64(0x8BDC79DCDC8B72AE), - SPH_C64(0x56E532E5E5569E7B), SPH_C64(0x40B2CBB2B2404BF9), - SPH_C64(0x6B4ED24E4E6B044A), SPH_C64(0xFCC754C7C7FCB176), - SPH_C64(0xC46DB76D6DC4224F), SPH_C64(0x6AE926E9E96AF21B), - SPH_C64(0xBB27692727BB0225), SPH_C64(0x5D40C040405D7A3A), - SPH_C64(0x9FD875D8D89F568E), SPH_C64(0xEB37593737EB92A5), - SPH_C64(0xE092AB9292E076E4), SPH_C64(0x898F8C8F8F89830C), - SPH_C64(0x0501030101050908), SPH_C64(0x691D271D1D69F5E8), - SPH_C64(0x0253F5535302F1A2), SPH_C64(0xC63E423E3EC6D3ED), - SPH_C64(0x2059EB595920ABF2), SPH_C64(0xE2C15EC1C1E28746), - SPH_C64(0x6E4FD14F4F6E0D42), SPH_C64(0xFA32563232FABF8D), - SPH_C64(0x4E163A16164EA6B0), SPH_C64(0x35FA13FAFA357983), - SPH_C64(0xB9749C7474B9F387), SPH_C64(0x30FB10FBFB30708B), - SPH_C64(0xF263A56363F25C3F), SPH_C64(0xD99FBC9F9FD9138C), - SPH_C64(0xE4345C3434E489BD), SPH_C64(0x721A2E1A1A72CAD0), - SPH_C64(0x822A7E2A2A82674D), SPH_C64(0x2F5AEE5A5A2FB0EA), - SPH_C64(0x838D8A8D8D83911C), SPH_C64(0xCAC946C9C9CACF06), - SPH_C64(0xD4CF4CCFCFD4F936), SPH_C64(0x09F607F6F60915E3), - SPH_C64(0xEA90AD9090EA64F4), SPH_C64(0x882878282888755D), - SPH_C64(0x928885888892BC34), SPH_C64(0xCD9BB09B9BCD37AC), - SPH_C64(0xF531533131F5A495), SPH_C64(0x360E120E0E367E70), - SPH_C64(0x73BDDABDBD733C81), SPH_C64(0x7F4ADE4A4A7F206A), - SPH_C64(0x6FE825E8E86FFB13), SPH_C64(0xF496A79696F452C4), - SPH_C64(0x04A6F7A6A604FF59), SPH_C64(0x3C0C140C0C3C6C60), - SPH_C64(0xCFC845C8C8CFC60E), SPH_C64(0x80798B79798096EF), - SPH_C64(0x76BCD9BCBC763589), SPH_C64(0x7CBEDFBEBE7C2799), - SPH_C64(0x74EF2CEFEF74C42B), SPH_C64(0xCB6EB26E6ECB3957), - SPH_C64(0x4346CA4646434C0A), SPH_C64(0xF197A49797F15BCC), - SPH_C64(0x2A5BED5B5B2AB9E2), SPH_C64(0x7EED2AEDED7ED63B), - SPH_C64(0x7D192B19197DD1C8), SPH_C64(0x9AD976D9D99A5F86), - SPH_C64(0x26ACE9ACAC26A509), SPH_C64(0xC799B69999C725BC), - SPH_C64(0x32A8E5A8A8328129), SPH_C64(0x8D297B29298D7C55), - SPH_C64(0xE964AC6464E96307), SPH_C64(0x631F211F1F63E7F8), - SPH_C64(0x23ADEAADAD23AC01), SPH_C64(0x1C55FF55551CC792), - SPH_C64(0x5F133513135F8B98), SPH_C64(0x6DBBD0BBBB6D0AB1), - SPH_C64(0x0CF704F7F70C1CEB), SPH_C64(0xCE6FB16F6FCE305F), - SPH_C64(0x67B9D6B9B96718A1), SPH_C64(0x4647C94747464502), - SPH_C64(0x932F712F2F934A65), SPH_C64(0x71EE2FEEEE71CD23), - SPH_C64(0x62B8D5B8B86211A9), SPH_C64(0x8A7B8D7B7B8A84FF), - SPH_C64(0x978986898997B53C), SPH_C64(0xF030503030F0AD9D), - SPH_C64(0xB8D368D3D3B805D6), SPH_C64(0x9E7F817F7F9EA0DF), - SPH_C64(0xB3769A7676B3E197), SPH_C64(0xB0829B8282B0E664) -}; - -static const sph_u64 old0_T4[256] = { - SPH_C64(0x68B86868D50F67D5), SPH_C64(0xD06DD0D0B71ECEB7), - SPH_C64(0xEB20EBEB60E00B60), SPH_C64(0x2B7D2B2B876E4587), - SPH_C64(0x48D8484875327A75), SPH_C64(0x9DBA9D9DD3019CD3), - SPH_C64(0x6ABE6A6ADF1D77DF), SPH_C64(0xE431E4E453977353), - SPH_C64(0xE338E3E348A84B48), SPH_C64(0xA3F8A3A315D27115), - SPH_C64(0x56FA565613DC8A13), SPH_C64(0x819E8181BFFD7CBF), - SPH_C64(0x7D877D7D94B2CF94), SPH_C64(0xF10EF1F1122ADB12), - SPH_C64(0x85928585ABD95CAB), SPH_C64(0x9EBF9E9EDC1A84DC), - SPH_C64(0x2C742C2C9C517D9C), SPH_C64(0x8E8F8E8E8C8A048C), - SPH_C64(0x78887878859FE785), SPH_C64(0xCA43CACAC5D41EC5), - SPH_C64(0x173917174BAFB84B), SPH_C64(0xA9E6A9A937882137), - SPH_C64(0x61A36161F84E2FF8), SPH_C64(0xD562D5D5A633E6A6), - SPH_C64(0x5DE75D5D348FD234), SPH_C64(0x0B1D0B0B27535827), - SPH_C64(0x8C898C8C86981486), SPH_C64(0x3C443C3CCCC1FDCC), - SPH_C64(0x77997777B6E89FB6), SPH_C64(0x51F3515108E3B208), - SPH_C64(0x22662222AA2F0DAA), SPH_C64(0x42C6424257682A57), - SPH_C64(0x3F413F3FC3DAE5C3), SPH_C64(0x54FC545419CE9A19), - SPH_C64(0x41C3414158733258), SPH_C64(0x809D8080BAF474BA), - SPH_C64(0xCC49CCCCDBE22EDB), SPH_C64(0x86978686A4C244A4), - SPH_C64(0xB3C8B3B34542F145), SPH_C64(0x1828181878D8C078), - SPH_C64(0x2E722E2E96436D96), SPH_C64(0x57F9575716D58216), - SPH_C64(0x060A06061E36301E), SPH_C64(0x62A66262F75537F7), - SPH_C64(0xF401F4F40307F303), SPH_C64(0x365A3636EE9BADEE), - SPH_C64(0xD16ED1D1B217C6B2), SPH_C64(0x6BBD6B6BDA147FDA), - SPH_C64(0x1B2D1B1B77C3D877), SPH_C64(0x65AF6565EC6A0FEC), - SPH_C64(0x759F7575BCFA8FBC), SPH_C64(0x1030101050908050), - SPH_C64(0xDA73DADA95449E95), SPH_C64(0x49DB4949703B7270), - SPH_C64(0x266A2626BE0B2DBE), SPH_C64(0xF916F9F93A629B3A), - SPH_C64(0xCB40CBCBC0DD16C0), SPH_C64(0x66AA6666E37117E3), - SPH_C64(0xE734E7E75C8C6B5C), SPH_C64(0xBAD3BABA6803B968), - SPH_C64(0xAEEFAEAE2CB7192C), SPH_C64(0x50F050500DEABA0D), - SPH_C64(0x52F6525207F8AA07), SPH_C64(0xABE0ABAB3D9A313D), - SPH_C64(0x050F0505112D2811), SPH_C64(0xF00DF0F01723D317), - SPH_C64(0x0D170D0D39656839), SPH_C64(0x73957373A2CCBFA2), - SPH_C64(0x3B4D3B3BD7FEC5D7), SPH_C64(0x040C040414242014), - SPH_C64(0x20602020A03D1DA0), SPH_C64(0xFE1FFEFE215DA321), - SPH_C64(0xDD7ADDDD8E7BA68E), SPH_C64(0xF502F5F5060EFB06), - SPH_C64(0xB4C1B4B45E7DC95E), SPH_C64(0x5FE15F5F3E9DC23E), - SPH_C64(0x0A1E0A0A225A5022), SPH_C64(0xB5C2B5B55B74C15B), - SPH_C64(0xC05DC0C0E78E4EE7), SPH_C64(0xA0FDA0A01AC9691A), - SPH_C64(0x71937171A8DEAFA8), SPH_C64(0xA5F2A5A50BE4410B), - SPH_C64(0x2D772D2D99587599), SPH_C64(0x60A06060FD4727FD), - SPH_C64(0x72967272A7C5B7A7), SPH_C64(0x93A89393E57FECE5), - SPH_C64(0x394B3939DDECD5DD), SPH_C64(0x0818080828484028), - SPH_C64(0x83988383B5EF6CB5), SPH_C64(0x21632121A53415A5), - SPH_C64(0x5CE45C5C3186DA31), SPH_C64(0x87948787A1CB4CA1), - SPH_C64(0xB1CEB1B14F50E14F), SPH_C64(0xE03DE0E047B35347), - SPH_C64(0x0000000000000000), SPH_C64(0xC358C3C3E89556E8), - SPH_C64(0x123612125A82905A), SPH_C64(0x91AE9191EF6DFCEF), - SPH_C64(0x8A838A8A98AE2498), SPH_C64(0x020602020A12100A), - SPH_C64(0x1C241C1C6CFCE06C), SPH_C64(0xE637E6E659856359), - SPH_C64(0x45CF45454C57124C), SPH_C64(0xC25BC2C2ED9C5EED), - SPH_C64(0xC451C4C4F3AA6EF3), SPH_C64(0xFD1AFDFD2E46BB2E), - SPH_C64(0xBFDCBFBF792E9179), SPH_C64(0x44CC4444495E1A49), - SPH_C64(0xA1FEA1A11FC0611F), SPH_C64(0x4CD44C4C61165A61), - SPH_C64(0x33553333FFB685FF), SPH_C64(0xC552C5C5F6A366F6), - SPH_C64(0x84918484AED054AE), SPH_C64(0x23652323AF2605AF), - SPH_C64(0x7C847C7C91BBC791), SPH_C64(0xB0CDB0B04A59E94A), - SPH_C64(0x256F2525B11035B1), SPH_C64(0x153F151541BDA841), - SPH_C64(0x355F3535E180B5E1), SPH_C64(0x69BB6969D0066FD0), - SPH_C64(0xFF1CFFFF2454AB24), SPH_C64(0x94A19494FE40D4FE), - SPH_C64(0x4DD74D4D641F5264), SPH_C64(0x70907070ADD7A7AD), - SPH_C64(0xA2FBA2A210DB7910), SPH_C64(0xAFECAFAF29BE1129), - SPH_C64(0xCD4ACDCDDEEB26DE), SPH_C64(0xD667D6D6A928FEA9), - SPH_C64(0x6CB46C6CC12B47C1), SPH_C64(0xB7C4B7B75166D151), - SPH_C64(0xF815F8F83F6B933F), SPH_C64(0x091B09092D41482D), - SPH_C64(0xF308F3F31838CB18), SPH_C64(0x67A96767E6781FE6), - SPH_C64(0xA4F1A4A40EED490E), SPH_C64(0xEA23EAEA65E90365), - SPH_C64(0xEC29ECEC7BDF337B), SPH_C64(0xB6C7B6B6546FD954), - SPH_C64(0xD461D4D4A33AEEA3), SPH_C64(0xD26BD2D2BD0CDEBD), - SPH_C64(0x143C141444B4A044), SPH_C64(0x1E221E1E66EEF066), - SPH_C64(0xE13EE1E142BA5B42), SPH_C64(0x246C2424B4193DB4), - SPH_C64(0x38483838D8E5DDD8), SPH_C64(0xC657C6C6F9B87EF9), - SPH_C64(0xDB70DBDB904D9690), SPH_C64(0x4BDD4B4B7A29627A), - SPH_C64(0x7A8E7A7A8F8DF78F), SPH_C64(0x3A4E3A3AD2F7CDD2), - SPH_C64(0xDE7FDEDE8160BE81), SPH_C64(0x5EE25E5E3B94CA3B), - SPH_C64(0xDF7CDFDF8469B684), SPH_C64(0x95A29595FB49DCFB), - SPH_C64(0xFC19FCFC2B4FB32B), SPH_C64(0xAAE3AAAA38933938), - SPH_C64(0xD764D7D7AC21F6AC), SPH_C64(0xCE4FCECED1F03ED1), - SPH_C64(0x070907071B3F381B), SPH_C64(0x0F110F0F33777833), - SPH_C64(0x3D473D3DC9C8F5C9), SPH_C64(0x58E8585825A2FA25), - SPH_C64(0x9AB39A9AC83EA4C8), SPH_C64(0x98B59898C22CB4C2), - SPH_C64(0x9CB99C9CD60894D6), SPH_C64(0xF20BF2F21D31C31D), - SPH_C64(0xA7F4A7A701F65101), SPH_C64(0x1133111155998855), - SPH_C64(0x7E827E7E9BA9D79B), SPH_C64(0x8B808B8B9DA72C9D), - SPH_C64(0x43C5434352612252), SPH_C64(0x030503030F1B180F), - SPH_C64(0xE23BE2E24DA1434D), SPH_C64(0xDC79DCDC8B72AE8B), - SPH_C64(0xE532E5E5569E7B56), SPH_C64(0xB2CBB2B2404BF940), - SPH_C64(0x4ED24E4E6B044A6B), SPH_C64(0xC754C7C7FCB176FC), - SPH_C64(0x6DB76D6DC4224FC4), SPH_C64(0xE926E9E96AF21B6A), - SPH_C64(0x27692727BB0225BB), SPH_C64(0x40C040405D7A3A5D), - SPH_C64(0xD875D8D89F568E9F), SPH_C64(0x37593737EB92A5EB), - SPH_C64(0x92AB9292E076E4E0), SPH_C64(0x8F8C8F8F89830C89), - SPH_C64(0x0103010105090805), SPH_C64(0x1D271D1D69F5E869), - SPH_C64(0x53F5535302F1A202), SPH_C64(0x3E423E3EC6D3EDC6), - SPH_C64(0x59EB595920ABF220), SPH_C64(0xC15EC1C1E28746E2), - SPH_C64(0x4FD14F4F6E0D426E), SPH_C64(0x32563232FABF8DFA), - SPH_C64(0x163A16164EA6B04E), SPH_C64(0xFA13FAFA35798335), - SPH_C64(0x749C7474B9F387B9), SPH_C64(0xFB10FBFB30708B30), - SPH_C64(0x63A56363F25C3FF2), SPH_C64(0x9FBC9F9FD9138CD9), - SPH_C64(0x345C3434E489BDE4), SPH_C64(0x1A2E1A1A72CAD072), - SPH_C64(0x2A7E2A2A82674D82), SPH_C64(0x5AEE5A5A2FB0EA2F), - SPH_C64(0x8D8A8D8D83911C83), SPH_C64(0xC946C9C9CACF06CA), - SPH_C64(0xCF4CCFCFD4F936D4), SPH_C64(0xF607F6F60915E309), - SPH_C64(0x90AD9090EA64F4EA), SPH_C64(0x2878282888755D88), - SPH_C64(0x8885888892BC3492), SPH_C64(0x9BB09B9BCD37ACCD), - SPH_C64(0x31533131F5A495F5), SPH_C64(0x0E120E0E367E7036), - SPH_C64(0xBDDABDBD733C8173), SPH_C64(0x4ADE4A4A7F206A7F), - SPH_C64(0xE825E8E86FFB136F), SPH_C64(0x96A79696F452C4F4), - SPH_C64(0xA6F7A6A604FF5904), SPH_C64(0x0C140C0C3C6C603C), - SPH_C64(0xC845C8C8CFC60ECF), SPH_C64(0x798B79798096EF80), - SPH_C64(0xBCD9BCBC76358976), SPH_C64(0xBEDFBEBE7C27997C), - SPH_C64(0xEF2CEFEF74C42B74), SPH_C64(0x6EB26E6ECB3957CB), - SPH_C64(0x46CA4646434C0A43), SPH_C64(0x97A49797F15BCCF1), - SPH_C64(0x5BED5B5B2AB9E22A), SPH_C64(0xED2AEDED7ED63B7E), - SPH_C64(0x192B19197DD1C87D), SPH_C64(0xD976D9D99A5F869A), - SPH_C64(0xACE9ACAC26A50926), SPH_C64(0x99B69999C725BCC7), - SPH_C64(0xA8E5A8A832812932), SPH_C64(0x297B29298D7C558D), - SPH_C64(0x64AC6464E96307E9), SPH_C64(0x1F211F1F63E7F863), - SPH_C64(0xADEAADAD23AC0123), SPH_C64(0x55FF55551CC7921C), - SPH_C64(0x133513135F8B985F), SPH_C64(0xBBD0BBBB6D0AB16D), - SPH_C64(0xF704F7F70C1CEB0C), SPH_C64(0x6FB16F6FCE305FCE), - SPH_C64(0xB9D6B9B96718A167), SPH_C64(0x47C9474746450246), - SPH_C64(0x2F712F2F934A6593), SPH_C64(0xEE2FEEEE71CD2371), - SPH_C64(0xB8D5B8B86211A962), SPH_C64(0x7B8D7B7B8A84FF8A), - SPH_C64(0x8986898997B53C97), SPH_C64(0x30503030F0AD9DF0), - SPH_C64(0xD368D3D3B805D6B8), SPH_C64(0x7F817F7F9EA0DF9E), - SPH_C64(0x769A7676B3E197B3), SPH_C64(0x829B8282B0E664B0) -}; - -static const sph_u64 old0_T5[256] = { - SPH_C64(0xB86868D50F67D568), SPH_C64(0x6DD0D0B71ECEB7D0), - SPH_C64(0x20EBEB60E00B60EB), SPH_C64(0x7D2B2B876E45872B), - SPH_C64(0xD8484875327A7548), SPH_C64(0xBA9D9DD3019CD39D), - SPH_C64(0xBE6A6ADF1D77DF6A), SPH_C64(0x31E4E453977353E4), - SPH_C64(0x38E3E348A84B48E3), SPH_C64(0xF8A3A315D27115A3), - SPH_C64(0xFA565613DC8A1356), SPH_C64(0x9E8181BFFD7CBF81), - SPH_C64(0x877D7D94B2CF947D), SPH_C64(0x0EF1F1122ADB12F1), - SPH_C64(0x928585ABD95CAB85), SPH_C64(0xBF9E9EDC1A84DC9E), - SPH_C64(0x742C2C9C517D9C2C), SPH_C64(0x8F8E8E8C8A048C8E), - SPH_C64(0x887878859FE78578), SPH_C64(0x43CACAC5D41EC5CA), - SPH_C64(0x3917174BAFB84B17), SPH_C64(0xE6A9A937882137A9), - SPH_C64(0xA36161F84E2FF861), SPH_C64(0x62D5D5A633E6A6D5), - SPH_C64(0xE75D5D348FD2345D), SPH_C64(0x1D0B0B275358270B), - SPH_C64(0x898C8C869814868C), SPH_C64(0x443C3CCCC1FDCC3C), - SPH_C64(0x997777B6E89FB677), SPH_C64(0xF3515108E3B20851), - SPH_C64(0x662222AA2F0DAA22), SPH_C64(0xC6424257682A5742), - SPH_C64(0x413F3FC3DAE5C33F), SPH_C64(0xFC545419CE9A1954), - SPH_C64(0xC341415873325841), SPH_C64(0x9D8080BAF474BA80), - SPH_C64(0x49CCCCDBE22EDBCC), SPH_C64(0x978686A4C244A486), - SPH_C64(0xC8B3B34542F145B3), SPH_C64(0x28181878D8C07818), - SPH_C64(0x722E2E96436D962E), SPH_C64(0xF9575716D5821657), - SPH_C64(0x0A06061E36301E06), SPH_C64(0xA66262F75537F762), - SPH_C64(0x01F4F40307F303F4), SPH_C64(0x5A3636EE9BADEE36), - SPH_C64(0x6ED1D1B217C6B2D1), SPH_C64(0xBD6B6BDA147FDA6B), - SPH_C64(0x2D1B1B77C3D8771B), SPH_C64(0xAF6565EC6A0FEC65), - SPH_C64(0x9F7575BCFA8FBC75), SPH_C64(0x3010105090805010), - SPH_C64(0x73DADA95449E95DA), SPH_C64(0xDB4949703B727049), - SPH_C64(0x6A2626BE0B2DBE26), SPH_C64(0x16F9F93A629B3AF9), - SPH_C64(0x40CBCBC0DD16C0CB), SPH_C64(0xAA6666E37117E366), - SPH_C64(0x34E7E75C8C6B5CE7), SPH_C64(0xD3BABA6803B968BA), - SPH_C64(0xEFAEAE2CB7192CAE), SPH_C64(0xF050500DEABA0D50), - SPH_C64(0xF6525207F8AA0752), SPH_C64(0xE0ABAB3D9A313DAB), - SPH_C64(0x0F0505112D281105), SPH_C64(0x0DF0F01723D317F0), - SPH_C64(0x170D0D396568390D), SPH_C64(0x957373A2CCBFA273), - SPH_C64(0x4D3B3BD7FEC5D73B), SPH_C64(0x0C04041424201404), - SPH_C64(0x602020A03D1DA020), SPH_C64(0x1FFEFE215DA321FE), - SPH_C64(0x7ADDDD8E7BA68EDD), SPH_C64(0x02F5F5060EFB06F5), - SPH_C64(0xC1B4B45E7DC95EB4), SPH_C64(0xE15F5F3E9DC23E5F), - SPH_C64(0x1E0A0A225A50220A), SPH_C64(0xC2B5B55B74C15BB5), - SPH_C64(0x5DC0C0E78E4EE7C0), SPH_C64(0xFDA0A01AC9691AA0), - SPH_C64(0x937171A8DEAFA871), SPH_C64(0xF2A5A50BE4410BA5), - SPH_C64(0x772D2D995875992D), SPH_C64(0xA06060FD4727FD60), - SPH_C64(0x967272A7C5B7A772), SPH_C64(0xA89393E57FECE593), - SPH_C64(0x4B3939DDECD5DD39), SPH_C64(0x1808082848402808), - SPH_C64(0x988383B5EF6CB583), SPH_C64(0x632121A53415A521), - SPH_C64(0xE45C5C3186DA315C), SPH_C64(0x948787A1CB4CA187), - SPH_C64(0xCEB1B14F50E14FB1), SPH_C64(0x3DE0E047B35347E0), - SPH_C64(0x0000000000000000), SPH_C64(0x58C3C3E89556E8C3), - SPH_C64(0x3612125A82905A12), SPH_C64(0xAE9191EF6DFCEF91), - SPH_C64(0x838A8A98AE24988A), SPH_C64(0x0602020A12100A02), - SPH_C64(0x241C1C6CFCE06C1C), SPH_C64(0x37E6E659856359E6), - SPH_C64(0xCF45454C57124C45), SPH_C64(0x5BC2C2ED9C5EEDC2), - SPH_C64(0x51C4C4F3AA6EF3C4), SPH_C64(0x1AFDFD2E46BB2EFD), - SPH_C64(0xDCBFBF792E9179BF), SPH_C64(0xCC4444495E1A4944), - SPH_C64(0xFEA1A11FC0611FA1), SPH_C64(0xD44C4C61165A614C), - SPH_C64(0x553333FFB685FF33), SPH_C64(0x52C5C5F6A366F6C5), - SPH_C64(0x918484AED054AE84), SPH_C64(0x652323AF2605AF23), - SPH_C64(0x847C7C91BBC7917C), SPH_C64(0xCDB0B04A59E94AB0), - SPH_C64(0x6F2525B11035B125), SPH_C64(0x3F151541BDA84115), - SPH_C64(0x5F3535E180B5E135), SPH_C64(0xBB6969D0066FD069), - SPH_C64(0x1CFFFF2454AB24FF), SPH_C64(0xA19494FE40D4FE94), - SPH_C64(0xD74D4D641F52644D), SPH_C64(0x907070ADD7A7AD70), - SPH_C64(0xFBA2A210DB7910A2), SPH_C64(0xECAFAF29BE1129AF), - SPH_C64(0x4ACDCDDEEB26DECD), SPH_C64(0x67D6D6A928FEA9D6), - SPH_C64(0xB46C6CC12B47C16C), SPH_C64(0xC4B7B75166D151B7), - SPH_C64(0x15F8F83F6B933FF8), SPH_C64(0x1B09092D41482D09), - SPH_C64(0x08F3F31838CB18F3), SPH_C64(0xA96767E6781FE667), - SPH_C64(0xF1A4A40EED490EA4), SPH_C64(0x23EAEA65E90365EA), - SPH_C64(0x29ECEC7BDF337BEC), SPH_C64(0xC7B6B6546FD954B6), - SPH_C64(0x61D4D4A33AEEA3D4), SPH_C64(0x6BD2D2BD0CDEBDD2), - SPH_C64(0x3C141444B4A04414), SPH_C64(0x221E1E66EEF0661E), - SPH_C64(0x3EE1E142BA5B42E1), SPH_C64(0x6C2424B4193DB424), - SPH_C64(0x483838D8E5DDD838), SPH_C64(0x57C6C6F9B87EF9C6), - SPH_C64(0x70DBDB904D9690DB), SPH_C64(0xDD4B4B7A29627A4B), - SPH_C64(0x8E7A7A8F8DF78F7A), SPH_C64(0x4E3A3AD2F7CDD23A), - SPH_C64(0x7FDEDE8160BE81DE), SPH_C64(0xE25E5E3B94CA3B5E), - SPH_C64(0x7CDFDF8469B684DF), SPH_C64(0xA29595FB49DCFB95), - SPH_C64(0x19FCFC2B4FB32BFC), SPH_C64(0xE3AAAA38933938AA), - SPH_C64(0x64D7D7AC21F6ACD7), SPH_C64(0x4FCECED1F03ED1CE), - SPH_C64(0x0907071B3F381B07), SPH_C64(0x110F0F337778330F), - SPH_C64(0x473D3DC9C8F5C93D), SPH_C64(0xE8585825A2FA2558), - SPH_C64(0xB39A9AC83EA4C89A), SPH_C64(0xB59898C22CB4C298), - SPH_C64(0xB99C9CD60894D69C), SPH_C64(0x0BF2F21D31C31DF2), - SPH_C64(0xF4A7A701F65101A7), SPH_C64(0x3311115599885511), - SPH_C64(0x827E7E9BA9D79B7E), SPH_C64(0x808B8B9DA72C9D8B), - SPH_C64(0xC543435261225243), SPH_C64(0x0503030F1B180F03), - SPH_C64(0x3BE2E24DA1434DE2), SPH_C64(0x79DCDC8B72AE8BDC), - SPH_C64(0x32E5E5569E7B56E5), SPH_C64(0xCBB2B2404BF940B2), - SPH_C64(0xD24E4E6B044A6B4E), SPH_C64(0x54C7C7FCB176FCC7), - SPH_C64(0xB76D6DC4224FC46D), SPH_C64(0x26E9E96AF21B6AE9), - SPH_C64(0x692727BB0225BB27), SPH_C64(0xC040405D7A3A5D40), - SPH_C64(0x75D8D89F568E9FD8), SPH_C64(0x593737EB92A5EB37), - SPH_C64(0xAB9292E076E4E092), SPH_C64(0x8C8F8F89830C898F), - SPH_C64(0x0301010509080501), SPH_C64(0x271D1D69F5E8691D), - SPH_C64(0xF5535302F1A20253), SPH_C64(0x423E3EC6D3EDC63E), - SPH_C64(0xEB595920ABF22059), SPH_C64(0x5EC1C1E28746E2C1), - SPH_C64(0xD14F4F6E0D426E4F), SPH_C64(0x563232FABF8DFA32), - SPH_C64(0x3A16164EA6B04E16), SPH_C64(0x13FAFA35798335FA), - SPH_C64(0x9C7474B9F387B974), SPH_C64(0x10FBFB30708B30FB), - SPH_C64(0xA56363F25C3FF263), SPH_C64(0xBC9F9FD9138CD99F), - SPH_C64(0x5C3434E489BDE434), SPH_C64(0x2E1A1A72CAD0721A), - SPH_C64(0x7E2A2A82674D822A), SPH_C64(0xEE5A5A2FB0EA2F5A), - SPH_C64(0x8A8D8D83911C838D), SPH_C64(0x46C9C9CACF06CAC9), - SPH_C64(0x4CCFCFD4F936D4CF), SPH_C64(0x07F6F60915E309F6), - SPH_C64(0xAD9090EA64F4EA90), SPH_C64(0x78282888755D8828), - SPH_C64(0x85888892BC349288), SPH_C64(0xB09B9BCD37ACCD9B), - SPH_C64(0x533131F5A495F531), SPH_C64(0x120E0E367E70360E), - SPH_C64(0xDABDBD733C8173BD), SPH_C64(0xDE4A4A7F206A7F4A), - SPH_C64(0x25E8E86FFB136FE8), SPH_C64(0xA79696F452C4F496), - SPH_C64(0xF7A6A604FF5904A6), SPH_C64(0x140C0C3C6C603C0C), - SPH_C64(0x45C8C8CFC60ECFC8), SPH_C64(0x8B79798096EF8079), - SPH_C64(0xD9BCBC76358976BC), SPH_C64(0xDFBEBE7C27997CBE), - SPH_C64(0x2CEFEF74C42B74EF), SPH_C64(0xB26E6ECB3957CB6E), - SPH_C64(0xCA4646434C0A4346), SPH_C64(0xA49797F15BCCF197), - SPH_C64(0xED5B5B2AB9E22A5B), SPH_C64(0x2AEDED7ED63B7EED), - SPH_C64(0x2B19197DD1C87D19), SPH_C64(0x76D9D99A5F869AD9), - SPH_C64(0xE9ACAC26A50926AC), SPH_C64(0xB69999C725BCC799), - SPH_C64(0xE5A8A832812932A8), SPH_C64(0x7B29298D7C558D29), - SPH_C64(0xAC6464E96307E964), SPH_C64(0x211F1F63E7F8631F), - SPH_C64(0xEAADAD23AC0123AD), SPH_C64(0xFF55551CC7921C55), - SPH_C64(0x3513135F8B985F13), SPH_C64(0xD0BBBB6D0AB16DBB), - SPH_C64(0x04F7F70C1CEB0CF7), SPH_C64(0xB16F6FCE305FCE6F), - SPH_C64(0xD6B9B96718A167B9), SPH_C64(0xC947474645024647), - SPH_C64(0x712F2F934A65932F), SPH_C64(0x2FEEEE71CD2371EE), - SPH_C64(0xD5B8B86211A962B8), SPH_C64(0x8D7B7B8A84FF8A7B), - SPH_C64(0x86898997B53C9789), SPH_C64(0x503030F0AD9DF030), - SPH_C64(0x68D3D3B805D6B8D3), SPH_C64(0x817F7F9EA0DF9E7F), - SPH_C64(0x9A7676B3E197B376), SPH_C64(0x9B8282B0E664B082) -}; - -static const sph_u64 old0_T6[256] = { - SPH_C64(0x6868D50F67D568B8), SPH_C64(0xD0D0B71ECEB7D06D), - SPH_C64(0xEBEB60E00B60EB20), SPH_C64(0x2B2B876E45872B7D), - SPH_C64(0x484875327A7548D8), SPH_C64(0x9D9DD3019CD39DBA), - SPH_C64(0x6A6ADF1D77DF6ABE), SPH_C64(0xE4E453977353E431), - SPH_C64(0xE3E348A84B48E338), SPH_C64(0xA3A315D27115A3F8), - SPH_C64(0x565613DC8A1356FA), SPH_C64(0x8181BFFD7CBF819E), - SPH_C64(0x7D7D94B2CF947D87), SPH_C64(0xF1F1122ADB12F10E), - SPH_C64(0x8585ABD95CAB8592), SPH_C64(0x9E9EDC1A84DC9EBF), - SPH_C64(0x2C2C9C517D9C2C74), SPH_C64(0x8E8E8C8A048C8E8F), - SPH_C64(0x7878859FE7857888), SPH_C64(0xCACAC5D41EC5CA43), - SPH_C64(0x17174BAFB84B1739), SPH_C64(0xA9A937882137A9E6), - SPH_C64(0x6161F84E2FF861A3), SPH_C64(0xD5D5A633E6A6D562), - SPH_C64(0x5D5D348FD2345DE7), SPH_C64(0x0B0B275358270B1D), - SPH_C64(0x8C8C869814868C89), SPH_C64(0x3C3CCCC1FDCC3C44), - SPH_C64(0x7777B6E89FB67799), SPH_C64(0x515108E3B20851F3), - SPH_C64(0x2222AA2F0DAA2266), SPH_C64(0x424257682A5742C6), - SPH_C64(0x3F3FC3DAE5C33F41), SPH_C64(0x545419CE9A1954FC), - SPH_C64(0x41415873325841C3), SPH_C64(0x8080BAF474BA809D), - SPH_C64(0xCCCCDBE22EDBCC49), SPH_C64(0x8686A4C244A48697), - SPH_C64(0xB3B34542F145B3C8), SPH_C64(0x181878D8C0781828), - SPH_C64(0x2E2E96436D962E72), SPH_C64(0x575716D5821657F9), - SPH_C64(0x06061E36301E060A), SPH_C64(0x6262F75537F762A6), - SPH_C64(0xF4F40307F303F401), SPH_C64(0x3636EE9BADEE365A), - SPH_C64(0xD1D1B217C6B2D16E), SPH_C64(0x6B6BDA147FDA6BBD), - SPH_C64(0x1B1B77C3D8771B2D), SPH_C64(0x6565EC6A0FEC65AF), - SPH_C64(0x7575BCFA8FBC759F), SPH_C64(0x1010509080501030), - SPH_C64(0xDADA95449E95DA73), SPH_C64(0x4949703B727049DB), - SPH_C64(0x2626BE0B2DBE266A), SPH_C64(0xF9F93A629B3AF916), - SPH_C64(0xCBCBC0DD16C0CB40), SPH_C64(0x6666E37117E366AA), - SPH_C64(0xE7E75C8C6B5CE734), SPH_C64(0xBABA6803B968BAD3), - SPH_C64(0xAEAE2CB7192CAEEF), SPH_C64(0x50500DEABA0D50F0), - SPH_C64(0x525207F8AA0752F6), SPH_C64(0xABAB3D9A313DABE0), - SPH_C64(0x0505112D2811050F), SPH_C64(0xF0F01723D317F00D), - SPH_C64(0x0D0D396568390D17), SPH_C64(0x7373A2CCBFA27395), - SPH_C64(0x3B3BD7FEC5D73B4D), SPH_C64(0x040414242014040C), - SPH_C64(0x2020A03D1DA02060), SPH_C64(0xFEFE215DA321FE1F), - SPH_C64(0xDDDD8E7BA68EDD7A), SPH_C64(0xF5F5060EFB06F502), - SPH_C64(0xB4B45E7DC95EB4C1), SPH_C64(0x5F5F3E9DC23E5FE1), - SPH_C64(0x0A0A225A50220A1E), SPH_C64(0xB5B55B74C15BB5C2), - SPH_C64(0xC0C0E78E4EE7C05D), SPH_C64(0xA0A01AC9691AA0FD), - SPH_C64(0x7171A8DEAFA87193), SPH_C64(0xA5A50BE4410BA5F2), - SPH_C64(0x2D2D995875992D77), SPH_C64(0x6060FD4727FD60A0), - SPH_C64(0x7272A7C5B7A77296), SPH_C64(0x9393E57FECE593A8), - SPH_C64(0x3939DDECD5DD394B), SPH_C64(0x0808284840280818), - SPH_C64(0x8383B5EF6CB58398), SPH_C64(0x2121A53415A52163), - SPH_C64(0x5C5C3186DA315CE4), SPH_C64(0x8787A1CB4CA18794), - SPH_C64(0xB1B14F50E14FB1CE), SPH_C64(0xE0E047B35347E03D), - SPH_C64(0x0000000000000000), SPH_C64(0xC3C3E89556E8C358), - SPH_C64(0x12125A82905A1236), SPH_C64(0x9191EF6DFCEF91AE), - SPH_C64(0x8A8A98AE24988A83), SPH_C64(0x02020A12100A0206), - SPH_C64(0x1C1C6CFCE06C1C24), SPH_C64(0xE6E659856359E637), - SPH_C64(0x45454C57124C45CF), SPH_C64(0xC2C2ED9C5EEDC25B), - SPH_C64(0xC4C4F3AA6EF3C451), SPH_C64(0xFDFD2E46BB2EFD1A), - SPH_C64(0xBFBF792E9179BFDC), SPH_C64(0x4444495E1A4944CC), - SPH_C64(0xA1A11FC0611FA1FE), SPH_C64(0x4C4C61165A614CD4), - SPH_C64(0x3333FFB685FF3355), SPH_C64(0xC5C5F6A366F6C552), - SPH_C64(0x8484AED054AE8491), SPH_C64(0x2323AF2605AF2365), - SPH_C64(0x7C7C91BBC7917C84), SPH_C64(0xB0B04A59E94AB0CD), - SPH_C64(0x2525B11035B1256F), SPH_C64(0x151541BDA841153F), - SPH_C64(0x3535E180B5E1355F), SPH_C64(0x6969D0066FD069BB), - SPH_C64(0xFFFF2454AB24FF1C), SPH_C64(0x9494FE40D4FE94A1), - SPH_C64(0x4D4D641F52644DD7), SPH_C64(0x7070ADD7A7AD7090), - SPH_C64(0xA2A210DB7910A2FB), SPH_C64(0xAFAF29BE1129AFEC), - SPH_C64(0xCDCDDEEB26DECD4A), SPH_C64(0xD6D6A928FEA9D667), - SPH_C64(0x6C6CC12B47C16CB4), SPH_C64(0xB7B75166D151B7C4), - SPH_C64(0xF8F83F6B933FF815), SPH_C64(0x09092D41482D091B), - SPH_C64(0xF3F31838CB18F308), SPH_C64(0x6767E6781FE667A9), - SPH_C64(0xA4A40EED490EA4F1), SPH_C64(0xEAEA65E90365EA23), - SPH_C64(0xECEC7BDF337BEC29), SPH_C64(0xB6B6546FD954B6C7), - SPH_C64(0xD4D4A33AEEA3D461), SPH_C64(0xD2D2BD0CDEBDD26B), - SPH_C64(0x141444B4A044143C), SPH_C64(0x1E1E66EEF0661E22), - SPH_C64(0xE1E142BA5B42E13E), SPH_C64(0x2424B4193DB4246C), - SPH_C64(0x3838D8E5DDD83848), SPH_C64(0xC6C6F9B87EF9C657), - SPH_C64(0xDBDB904D9690DB70), SPH_C64(0x4B4B7A29627A4BDD), - SPH_C64(0x7A7A8F8DF78F7A8E), SPH_C64(0x3A3AD2F7CDD23A4E), - SPH_C64(0xDEDE8160BE81DE7F), SPH_C64(0x5E5E3B94CA3B5EE2), - SPH_C64(0xDFDF8469B684DF7C), SPH_C64(0x9595FB49DCFB95A2), - SPH_C64(0xFCFC2B4FB32BFC19), SPH_C64(0xAAAA38933938AAE3), - SPH_C64(0xD7D7AC21F6ACD764), SPH_C64(0xCECED1F03ED1CE4F), - SPH_C64(0x07071B3F381B0709), SPH_C64(0x0F0F337778330F11), - SPH_C64(0x3D3DC9C8F5C93D47), SPH_C64(0x585825A2FA2558E8), - SPH_C64(0x9A9AC83EA4C89AB3), SPH_C64(0x9898C22CB4C298B5), - SPH_C64(0x9C9CD60894D69CB9), SPH_C64(0xF2F21D31C31DF20B), - SPH_C64(0xA7A701F65101A7F4), SPH_C64(0x1111559988551133), - SPH_C64(0x7E7E9BA9D79B7E82), SPH_C64(0x8B8B9DA72C9D8B80), - SPH_C64(0x43435261225243C5), SPH_C64(0x03030F1B180F0305), - SPH_C64(0xE2E24DA1434DE23B), SPH_C64(0xDCDC8B72AE8BDC79), - SPH_C64(0xE5E5569E7B56E532), SPH_C64(0xB2B2404BF940B2CB), - SPH_C64(0x4E4E6B044A6B4ED2), SPH_C64(0xC7C7FCB176FCC754), - SPH_C64(0x6D6DC4224FC46DB7), SPH_C64(0xE9E96AF21B6AE926), - SPH_C64(0x2727BB0225BB2769), SPH_C64(0x40405D7A3A5D40C0), - SPH_C64(0xD8D89F568E9FD875), SPH_C64(0x3737EB92A5EB3759), - SPH_C64(0x9292E076E4E092AB), SPH_C64(0x8F8F89830C898F8C), - SPH_C64(0x0101050908050103), SPH_C64(0x1D1D69F5E8691D27), - SPH_C64(0x535302F1A20253F5), SPH_C64(0x3E3EC6D3EDC63E42), - SPH_C64(0x595920ABF22059EB), SPH_C64(0xC1C1E28746E2C15E), - SPH_C64(0x4F4F6E0D426E4FD1), SPH_C64(0x3232FABF8DFA3256), - SPH_C64(0x16164EA6B04E163A), SPH_C64(0xFAFA35798335FA13), - SPH_C64(0x7474B9F387B9749C), SPH_C64(0xFBFB30708B30FB10), - SPH_C64(0x6363F25C3FF263A5), SPH_C64(0x9F9FD9138CD99FBC), - SPH_C64(0x3434E489BDE4345C), SPH_C64(0x1A1A72CAD0721A2E), - SPH_C64(0x2A2A82674D822A7E), SPH_C64(0x5A5A2FB0EA2F5AEE), - SPH_C64(0x8D8D83911C838D8A), SPH_C64(0xC9C9CACF06CAC946), - SPH_C64(0xCFCFD4F936D4CF4C), SPH_C64(0xF6F60915E309F607), - SPH_C64(0x9090EA64F4EA90AD), SPH_C64(0x282888755D882878), - SPH_C64(0x888892BC34928885), SPH_C64(0x9B9BCD37ACCD9BB0), - SPH_C64(0x3131F5A495F53153), SPH_C64(0x0E0E367E70360E12), - SPH_C64(0xBDBD733C8173BDDA), SPH_C64(0x4A4A7F206A7F4ADE), - SPH_C64(0xE8E86FFB136FE825), SPH_C64(0x9696F452C4F496A7), - SPH_C64(0xA6A604FF5904A6F7), SPH_C64(0x0C0C3C6C603C0C14), - SPH_C64(0xC8C8CFC60ECFC845), SPH_C64(0x79798096EF80798B), - SPH_C64(0xBCBC76358976BCD9), SPH_C64(0xBEBE7C27997CBEDF), - SPH_C64(0xEFEF74C42B74EF2C), SPH_C64(0x6E6ECB3957CB6EB2), - SPH_C64(0x4646434C0A4346CA), SPH_C64(0x9797F15BCCF197A4), - SPH_C64(0x5B5B2AB9E22A5BED), SPH_C64(0xEDED7ED63B7EED2A), - SPH_C64(0x19197DD1C87D192B), SPH_C64(0xD9D99A5F869AD976), - SPH_C64(0xACAC26A50926ACE9), SPH_C64(0x9999C725BCC799B6), - SPH_C64(0xA8A832812932A8E5), SPH_C64(0x29298D7C558D297B), - SPH_C64(0x6464E96307E964AC), SPH_C64(0x1F1F63E7F8631F21), - SPH_C64(0xADAD23AC0123ADEA), SPH_C64(0x55551CC7921C55FF), - SPH_C64(0x13135F8B985F1335), SPH_C64(0xBBBB6D0AB16DBBD0), - SPH_C64(0xF7F70C1CEB0CF704), SPH_C64(0x6F6FCE305FCE6FB1), - SPH_C64(0xB9B96718A167B9D6), SPH_C64(0x47474645024647C9), - SPH_C64(0x2F2F934A65932F71), SPH_C64(0xEEEE71CD2371EE2F), - SPH_C64(0xB8B86211A962B8D5), SPH_C64(0x7B7B8A84FF8A7B8D), - SPH_C64(0x898997B53C978986), SPH_C64(0x3030F0AD9DF03050), - SPH_C64(0xD3D3B805D6B8D368), SPH_C64(0x7F7F9EA0DF9E7F81), - SPH_C64(0x7676B3E197B3769A), SPH_C64(0x8282B0E664B0829B) -}; - -static const sph_u64 old0_T7[256] = { - SPH_C64(0x68D50F67D568B868), SPH_C64(0xD0B71ECEB7D06DD0), - SPH_C64(0xEB60E00B60EB20EB), SPH_C64(0x2B876E45872B7D2B), - SPH_C64(0x4875327A7548D848), SPH_C64(0x9DD3019CD39DBA9D), - SPH_C64(0x6ADF1D77DF6ABE6A), SPH_C64(0xE453977353E431E4), - SPH_C64(0xE348A84B48E338E3), SPH_C64(0xA315D27115A3F8A3), - SPH_C64(0x5613DC8A1356FA56), SPH_C64(0x81BFFD7CBF819E81), - SPH_C64(0x7D94B2CF947D877D), SPH_C64(0xF1122ADB12F10EF1), - SPH_C64(0x85ABD95CAB859285), SPH_C64(0x9EDC1A84DC9EBF9E), - SPH_C64(0x2C9C517D9C2C742C), SPH_C64(0x8E8C8A048C8E8F8E), - SPH_C64(0x78859FE785788878), SPH_C64(0xCAC5D41EC5CA43CA), - SPH_C64(0x174BAFB84B173917), SPH_C64(0xA937882137A9E6A9), - SPH_C64(0x61F84E2FF861A361), SPH_C64(0xD5A633E6A6D562D5), - SPH_C64(0x5D348FD2345DE75D), SPH_C64(0x0B275358270B1D0B), - SPH_C64(0x8C869814868C898C), SPH_C64(0x3CCCC1FDCC3C443C), - SPH_C64(0x77B6E89FB6779977), SPH_C64(0x5108E3B20851F351), - SPH_C64(0x22AA2F0DAA226622), SPH_C64(0x4257682A5742C642), - SPH_C64(0x3FC3DAE5C33F413F), SPH_C64(0x5419CE9A1954FC54), - SPH_C64(0x415873325841C341), SPH_C64(0x80BAF474BA809D80), - SPH_C64(0xCCDBE22EDBCC49CC), SPH_C64(0x86A4C244A4869786), - SPH_C64(0xB34542F145B3C8B3), SPH_C64(0x1878D8C078182818), - SPH_C64(0x2E96436D962E722E), SPH_C64(0x5716D5821657F957), - SPH_C64(0x061E36301E060A06), SPH_C64(0x62F75537F762A662), - SPH_C64(0xF40307F303F401F4), SPH_C64(0x36EE9BADEE365A36), - SPH_C64(0xD1B217C6B2D16ED1), SPH_C64(0x6BDA147FDA6BBD6B), - SPH_C64(0x1B77C3D8771B2D1B), SPH_C64(0x65EC6A0FEC65AF65), - SPH_C64(0x75BCFA8FBC759F75), SPH_C64(0x1050908050103010), - SPH_C64(0xDA95449E95DA73DA), SPH_C64(0x49703B727049DB49), - SPH_C64(0x26BE0B2DBE266A26), SPH_C64(0xF93A629B3AF916F9), - SPH_C64(0xCBC0DD16C0CB40CB), SPH_C64(0x66E37117E366AA66), - SPH_C64(0xE75C8C6B5CE734E7), SPH_C64(0xBA6803B968BAD3BA), - SPH_C64(0xAE2CB7192CAEEFAE), SPH_C64(0x500DEABA0D50F050), - SPH_C64(0x5207F8AA0752F652), SPH_C64(0xAB3D9A313DABE0AB), - SPH_C64(0x05112D2811050F05), SPH_C64(0xF01723D317F00DF0), - SPH_C64(0x0D396568390D170D), SPH_C64(0x73A2CCBFA2739573), - SPH_C64(0x3BD7FEC5D73B4D3B), SPH_C64(0x0414242014040C04), - SPH_C64(0x20A03D1DA0206020), SPH_C64(0xFE215DA321FE1FFE), - SPH_C64(0xDD8E7BA68EDD7ADD), SPH_C64(0xF5060EFB06F502F5), - SPH_C64(0xB45E7DC95EB4C1B4), SPH_C64(0x5F3E9DC23E5FE15F), - SPH_C64(0x0A225A50220A1E0A), SPH_C64(0xB55B74C15BB5C2B5), - SPH_C64(0xC0E78E4EE7C05DC0), SPH_C64(0xA01AC9691AA0FDA0), - SPH_C64(0x71A8DEAFA8719371), SPH_C64(0xA50BE4410BA5F2A5), - SPH_C64(0x2D995875992D772D), SPH_C64(0x60FD4727FD60A060), - SPH_C64(0x72A7C5B7A7729672), SPH_C64(0x93E57FECE593A893), - SPH_C64(0x39DDECD5DD394B39), SPH_C64(0x0828484028081808), - SPH_C64(0x83B5EF6CB5839883), SPH_C64(0x21A53415A5216321), - SPH_C64(0x5C3186DA315CE45C), SPH_C64(0x87A1CB4CA1879487), - SPH_C64(0xB14F50E14FB1CEB1), SPH_C64(0xE047B35347E03DE0), - SPH_C64(0x0000000000000000), SPH_C64(0xC3E89556E8C358C3), - SPH_C64(0x125A82905A123612), SPH_C64(0x91EF6DFCEF91AE91), - SPH_C64(0x8A98AE24988A838A), SPH_C64(0x020A12100A020602), - SPH_C64(0x1C6CFCE06C1C241C), SPH_C64(0xE659856359E637E6), - SPH_C64(0x454C57124C45CF45), SPH_C64(0xC2ED9C5EEDC25BC2), - SPH_C64(0xC4F3AA6EF3C451C4), SPH_C64(0xFD2E46BB2EFD1AFD), - SPH_C64(0xBF792E9179BFDCBF), SPH_C64(0x44495E1A4944CC44), - SPH_C64(0xA11FC0611FA1FEA1), SPH_C64(0x4C61165A614CD44C), - SPH_C64(0x33FFB685FF335533), SPH_C64(0xC5F6A366F6C552C5), - SPH_C64(0x84AED054AE849184), SPH_C64(0x23AF2605AF236523), - SPH_C64(0x7C91BBC7917C847C), SPH_C64(0xB04A59E94AB0CDB0), - SPH_C64(0x25B11035B1256F25), SPH_C64(0x1541BDA841153F15), - SPH_C64(0x35E180B5E1355F35), SPH_C64(0x69D0066FD069BB69), - SPH_C64(0xFF2454AB24FF1CFF), SPH_C64(0x94FE40D4FE94A194), - SPH_C64(0x4D641F52644DD74D), SPH_C64(0x70ADD7A7AD709070), - SPH_C64(0xA210DB7910A2FBA2), SPH_C64(0xAF29BE1129AFECAF), - SPH_C64(0xCDDEEB26DECD4ACD), SPH_C64(0xD6A928FEA9D667D6), - SPH_C64(0x6CC12B47C16CB46C), SPH_C64(0xB75166D151B7C4B7), - SPH_C64(0xF83F6B933FF815F8), SPH_C64(0x092D41482D091B09), - SPH_C64(0xF31838CB18F308F3), SPH_C64(0x67E6781FE667A967), - SPH_C64(0xA40EED490EA4F1A4), SPH_C64(0xEA65E90365EA23EA), - SPH_C64(0xEC7BDF337BEC29EC), SPH_C64(0xB6546FD954B6C7B6), - SPH_C64(0xD4A33AEEA3D461D4), SPH_C64(0xD2BD0CDEBDD26BD2), - SPH_C64(0x1444B4A044143C14), SPH_C64(0x1E66EEF0661E221E), - SPH_C64(0xE142BA5B42E13EE1), SPH_C64(0x24B4193DB4246C24), - SPH_C64(0x38D8E5DDD8384838), SPH_C64(0xC6F9B87EF9C657C6), - SPH_C64(0xDB904D9690DB70DB), SPH_C64(0x4B7A29627A4BDD4B), - SPH_C64(0x7A8F8DF78F7A8E7A), SPH_C64(0x3AD2F7CDD23A4E3A), - SPH_C64(0xDE8160BE81DE7FDE), SPH_C64(0x5E3B94CA3B5EE25E), - SPH_C64(0xDF8469B684DF7CDF), SPH_C64(0x95FB49DCFB95A295), - SPH_C64(0xFC2B4FB32BFC19FC), SPH_C64(0xAA38933938AAE3AA), - SPH_C64(0xD7AC21F6ACD764D7), SPH_C64(0xCED1F03ED1CE4FCE), - SPH_C64(0x071B3F381B070907), SPH_C64(0x0F337778330F110F), - SPH_C64(0x3DC9C8F5C93D473D), SPH_C64(0x5825A2FA2558E858), - SPH_C64(0x9AC83EA4C89AB39A), SPH_C64(0x98C22CB4C298B598), - SPH_C64(0x9CD60894D69CB99C), SPH_C64(0xF21D31C31DF20BF2), - SPH_C64(0xA701F65101A7F4A7), SPH_C64(0x1155998855113311), - SPH_C64(0x7E9BA9D79B7E827E), SPH_C64(0x8B9DA72C9D8B808B), - SPH_C64(0x435261225243C543), SPH_C64(0x030F1B180F030503), - SPH_C64(0xE24DA1434DE23BE2), SPH_C64(0xDC8B72AE8BDC79DC), - SPH_C64(0xE5569E7B56E532E5), SPH_C64(0xB2404BF940B2CBB2), - SPH_C64(0x4E6B044A6B4ED24E), SPH_C64(0xC7FCB176FCC754C7), - SPH_C64(0x6DC4224FC46DB76D), SPH_C64(0xE96AF21B6AE926E9), - SPH_C64(0x27BB0225BB276927), SPH_C64(0x405D7A3A5D40C040), - SPH_C64(0xD89F568E9FD875D8), SPH_C64(0x37EB92A5EB375937), - SPH_C64(0x92E076E4E092AB92), SPH_C64(0x8F89830C898F8C8F), - SPH_C64(0x0105090805010301), SPH_C64(0x1D69F5E8691D271D), - SPH_C64(0x5302F1A20253F553), SPH_C64(0x3EC6D3EDC63E423E), - SPH_C64(0x5920ABF22059EB59), SPH_C64(0xC1E28746E2C15EC1), - SPH_C64(0x4F6E0D426E4FD14F), SPH_C64(0x32FABF8DFA325632), - SPH_C64(0x164EA6B04E163A16), SPH_C64(0xFA35798335FA13FA), - SPH_C64(0x74B9F387B9749C74), SPH_C64(0xFB30708B30FB10FB), - SPH_C64(0x63F25C3FF263A563), SPH_C64(0x9FD9138CD99FBC9F), - SPH_C64(0x34E489BDE4345C34), SPH_C64(0x1A72CAD0721A2E1A), - SPH_C64(0x2A82674D822A7E2A), SPH_C64(0x5A2FB0EA2F5AEE5A), - SPH_C64(0x8D83911C838D8A8D), SPH_C64(0xC9CACF06CAC946C9), - SPH_C64(0xCFD4F936D4CF4CCF), SPH_C64(0xF60915E309F607F6), - SPH_C64(0x90EA64F4EA90AD90), SPH_C64(0x2888755D88287828), - SPH_C64(0x8892BC3492888588), SPH_C64(0x9BCD37ACCD9BB09B), - SPH_C64(0x31F5A495F5315331), SPH_C64(0x0E367E70360E120E), - SPH_C64(0xBD733C8173BDDABD), SPH_C64(0x4A7F206A7F4ADE4A), - SPH_C64(0xE86FFB136FE825E8), SPH_C64(0x96F452C4F496A796), - SPH_C64(0xA604FF5904A6F7A6), SPH_C64(0x0C3C6C603C0C140C), - SPH_C64(0xC8CFC60ECFC845C8), SPH_C64(0x798096EF80798B79), - SPH_C64(0xBC76358976BCD9BC), SPH_C64(0xBE7C27997CBEDFBE), - SPH_C64(0xEF74C42B74EF2CEF), SPH_C64(0x6ECB3957CB6EB26E), - SPH_C64(0x46434C0A4346CA46), SPH_C64(0x97F15BCCF197A497), - SPH_C64(0x5B2AB9E22A5BED5B), SPH_C64(0xED7ED63B7EED2AED), - SPH_C64(0x197DD1C87D192B19), SPH_C64(0xD99A5F869AD976D9), - SPH_C64(0xAC26A50926ACE9AC), SPH_C64(0x99C725BCC799B699), - SPH_C64(0xA832812932A8E5A8), SPH_C64(0x298D7C558D297B29), - SPH_C64(0x64E96307E964AC64), SPH_C64(0x1F63E7F8631F211F), - SPH_C64(0xAD23AC0123ADEAAD), SPH_C64(0x551CC7921C55FF55), - SPH_C64(0x135F8B985F133513), SPH_C64(0xBB6D0AB16DBBD0BB), - SPH_C64(0xF70C1CEB0CF704F7), SPH_C64(0x6FCE305FCE6FB16F), - SPH_C64(0xB96718A167B9D6B9), SPH_C64(0x474645024647C947), - SPH_C64(0x2F934A65932F712F), SPH_C64(0xEE71CD2371EE2FEE), - SPH_C64(0xB86211A962B8D5B8), SPH_C64(0x7B8A84FF8A7B8D7B), - SPH_C64(0x8997B53C97898689), SPH_C64(0x30F0AD9DF0305030), - SPH_C64(0xD3B805D6B8D368D3), SPH_C64(0x7F9EA0DF9E7F817F), - SPH_C64(0x76B3E197B3769A76), SPH_C64(0x82B0E664B0829B82) -}; - -#endif - -static const sph_u64 old0_RC[10] = { - SPH_C64(0xE46A9D482BEBD068), - SPH_C64(0x9E85F17D8156A3E3), - SPH_C64(0xD561A917CA788E2C), - SPH_C64(0x422251773C8C0B5D), - SPH_C64(0x18B386CC8041543F), - SPH_C64(0x6BD136F46206572E), - SPH_C64(0xF92649DA1075651B), - SPH_C64(0xAB5250AEBAE766CB), - SPH_C64(0xFE20043B730DF005), - SPH_C64(0xA0C0B50A5FB4F5DD) -}; - -/* ====================================================================== */ -/* - * Constants for plain WHIRLPOOL-1 (second version). - */ - -static const sph_u64 old1_T0[256] = { - SPH_C64(0x78D8C07818281818), SPH_C64(0xAF2605AF23652323), - SPH_C64(0xF9B87EF9C657C6C6), SPH_C64(0x6FFB136FE825E8E8), - SPH_C64(0xA1CB4CA187948787), SPH_C64(0x6211A962B8D5B8B8), - SPH_C64(0x0509080501030101), SPH_C64(0x6E0D426E4FD14F4F), - SPH_C64(0xEE9BADEE365A3636), SPH_C64(0x04FF5904A6F7A6A6), - SPH_C64(0xBD0CDEBDD26BD2D2), SPH_C64(0x060EFB06F502F5F5), - SPH_C64(0x8096EF80798B7979), SPH_C64(0xCE305FCE6FB16F6F), - SPH_C64(0xEF6DFCEF91AE9191), SPH_C64(0x07F8AA0752F65252), - SPH_C64(0xFD4727FD60A06060), SPH_C64(0x76358976BCD9BCBC), - SPH_C64(0xCD37ACCD9BB09B9B), SPH_C64(0x8C8A048C8E8F8E8E), - SPH_C64(0x15D27115A3F8A3A3), SPH_C64(0x3C6C603C0C140C0C), - SPH_C64(0x8A84FF8A7B8D7B7B), SPH_C64(0xE180B5E1355F3535), - SPH_C64(0x69F5E8691D271D1D), SPH_C64(0x47B35347E03DE0E0), - SPH_C64(0xAC21F6ACD764D7D7), SPH_C64(0xED9C5EEDC25BC2C2), - SPH_C64(0x96436D962E722E2E), SPH_C64(0x7A29627A4BDD4B4B), - SPH_C64(0x215DA321FE1FFEFE), SPH_C64(0x16D5821657F95757), - SPH_C64(0x41BDA841153F1515), SPH_C64(0xB6E89FB677997777), - SPH_C64(0xEB92A5EB37593737), SPH_C64(0x569E7B56E532E5E5), - SPH_C64(0xD9138CD99FBC9F9F), SPH_C64(0x1723D317F00DF0F0), - SPH_C64(0x7F206A7F4ADE4A4A), SPH_C64(0x95449E95DA73DADA), - SPH_C64(0x25A2FA2558E85858), SPH_C64(0xCACF06CAC946C9C9), - SPH_C64(0x8D7C558D297B2929), SPH_C64(0x225A50220A1E0A0A), - SPH_C64(0x4F50E14FB1CEB1B1), SPH_C64(0x1AC9691AA0FDA0A0), - SPH_C64(0xDA147FDA6BBD6B6B), SPH_C64(0xABD95CAB85928585), - SPH_C64(0x733C8173BDDABDBD), SPH_C64(0x348FD2345DE75D5D), - SPH_C64(0x5090805010301010), SPH_C64(0x0307F303F401F4F4), - SPH_C64(0xC0DD16C0CB40CBCB), SPH_C64(0xC6D3EDC63E423E3E), - SPH_C64(0x112D2811050F0505), SPH_C64(0xE6781FE667A96767), - SPH_C64(0x53977353E431E4E4), SPH_C64(0xBB0225BB27692727), - SPH_C64(0x5873325841C34141), SPH_C64(0x9DA72C9D8B808B8B), - SPH_C64(0x01F65101A7F4A7A7), SPH_C64(0x94B2CF947D877D7D), - SPH_C64(0xFB49DCFB95A29595), SPH_C64(0x9F568E9FD875D8D8), - SPH_C64(0x30708B30FB10FBFB), SPH_C64(0x71CD2371EE2FEEEE), - SPH_C64(0x91BBC7917C847C7C), SPH_C64(0xE37117E366AA6666), - SPH_C64(0x8E7BA68EDD7ADDDD), SPH_C64(0x4BAFB84B17391717), - SPH_C64(0x4645024647C94747), SPH_C64(0xDC1A84DC9EBF9E9E), - SPH_C64(0xC5D41EC5CA43CACA), SPH_C64(0x995875992D772D2D), - SPH_C64(0x792E9179BFDCBFBF), SPH_C64(0x1B3F381B07090707), - SPH_C64(0x23AC0123ADEAADAD), SPH_C64(0x2FB0EA2F5AEE5A5A), - SPH_C64(0xB5EF6CB583988383), SPH_C64(0xFFB685FF33553333), - SPH_C64(0xF25C3FF263A56363), SPH_C64(0x0A12100A02060202), - SPH_C64(0x38933938AAE3AAAA), SPH_C64(0xA8DEAFA871937171), - SPH_C64(0xCFC60ECFC845C8C8), SPH_C64(0x7DD1C87D192B1919), - SPH_C64(0x703B727049DB4949), SPH_C64(0x9A5F869AD976D9D9), - SPH_C64(0x1D31C31DF20BF2F2), SPH_C64(0x48A84B48E338E3E3), - SPH_C64(0x2AB9E22A5BED5B5B), SPH_C64(0x92BC349288858888), - SPH_C64(0xC83EA4C89AB39A9A), SPH_C64(0xBE0B2DBE266A2626), - SPH_C64(0xFABF8DFA32563232), SPH_C64(0x4A59E94AB0CDB0B0), - SPH_C64(0x6AF21B6AE926E9E9), SPH_C64(0x337778330F110F0F), - SPH_C64(0xA633E6A6D562D5D5), SPH_C64(0xBAF474BA809D8080), - SPH_C64(0x7C27997CBEDFBEBE), SPH_C64(0xDEEB26DECD4ACDCD), - SPH_C64(0xE489BDE4345C3434), SPH_C64(0x75327A7548D84848), - SPH_C64(0x2454AB24FF1CFFFF), SPH_C64(0x8F8DF78F7A8E7A7A), - SPH_C64(0xEA64F4EA90AD9090), SPH_C64(0x3E9DC23E5FE15F5F), - SPH_C64(0xA03D1DA020602020), SPH_C64(0xD50F67D568B86868), - SPH_C64(0x72CAD0721A2E1A1A), SPH_C64(0x2CB7192CAEEFAEAE), - SPH_C64(0x5E7DC95EB4C1B4B4), SPH_C64(0x19CE9A1954FC5454), - SPH_C64(0xE57FECE593A89393), SPH_C64(0xAA2F0DAA22662222), - SPH_C64(0xE96307E964AC6464), SPH_C64(0x122ADB12F10EF1F1), - SPH_C64(0xA2CCBFA273957373), SPH_C64(0x5A82905A12361212), - SPH_C64(0x5D7A3A5D40C04040), SPH_C64(0x2848402808180808), - SPH_C64(0xE89556E8C358C3C3), SPH_C64(0x7BDF337BEC29ECEC), - SPH_C64(0x904D9690DB70DBDB), SPH_C64(0x1FC0611FA1FEA1A1), - SPH_C64(0x83911C838D8A8D8D), SPH_C64(0xC9C8F5C93D473D3D), - SPH_C64(0xF15BCCF197A49797), SPH_C64(0x0000000000000000), - SPH_C64(0xD4F936D4CF4CCFCF), SPH_C64(0x876E45872B7D2B2B), - SPH_C64(0xB3E197B3769A7676), SPH_C64(0xB0E664B0829B8282), - SPH_C64(0xA928FEA9D667D6D6), SPH_C64(0x77C3D8771B2D1B1B), - SPH_C64(0x5B74C15BB5C2B5B5), SPH_C64(0x29BE1129AFECAFAF), - SPH_C64(0xDF1D77DF6ABE6A6A), SPH_C64(0x0DEABA0D50F05050), - SPH_C64(0x4C57124C45CF4545), SPH_C64(0x1838CB18F308F3F3), - SPH_C64(0xF0AD9DF030503030), SPH_C64(0x74C42B74EF2CEFEF), - SPH_C64(0xC3DAE5C33F413F3F), SPH_C64(0x1CC7921C55FF5555), - SPH_C64(0x10DB7910A2FBA2A2), SPH_C64(0x65E90365EA23EAEA), - SPH_C64(0xEC6A0FEC65AF6565), SPH_C64(0x6803B968BAD3BABA), - SPH_C64(0x934A65932F712F2F), SPH_C64(0xE78E4EE7C05DC0C0), - SPH_C64(0x8160BE81DE7FDEDE), SPH_C64(0x6CFCE06C1C241C1C), - SPH_C64(0x2E46BB2EFD1AFDFD), SPH_C64(0x641F52644DD74D4D), - SPH_C64(0xE076E4E092AB9292), SPH_C64(0xBCFA8FBC759F7575), - SPH_C64(0x1E36301E060A0606), SPH_C64(0x98AE24988A838A8A), - SPH_C64(0x404BF940B2CBB2B2), SPH_C64(0x59856359E637E6E6), - SPH_C64(0x367E70360E120E0E), SPH_C64(0x63E7F8631F211F1F), - SPH_C64(0xF75537F762A66262), SPH_C64(0xA33AEEA3D461D4D4), - SPH_C64(0x32812932A8E5A8A8), SPH_C64(0xF452C4F496A79696), - SPH_C64(0x3A629B3AF916F9F9), SPH_C64(0xF6A366F6C552C5C5), - SPH_C64(0xB11035B1256F2525), SPH_C64(0x20ABF22059EB5959), - SPH_C64(0xAED054AE84918484), SPH_C64(0xA7C5B7A772967272), - SPH_C64(0xDDECD5DD394B3939), SPH_C64(0x61165A614CD44C4C), - SPH_C64(0x3B94CA3B5EE25E5E), SPH_C64(0x859FE78578887878), - SPH_C64(0xD8E5DDD838483838), SPH_C64(0x869814868C898C8C), - SPH_C64(0xB217C6B2D16ED1D1), SPH_C64(0x0BE4410BA5F2A5A5), - SPH_C64(0x4DA1434DE23BE2E2), SPH_C64(0xF84E2FF861A36161), - SPH_C64(0x4542F145B3C8B3B3), SPH_C64(0xA53415A521632121), - SPH_C64(0xD60894D69CB99C9C), SPH_C64(0x66EEF0661E221E1E), - SPH_C64(0x5261225243C54343), SPH_C64(0xFCB176FCC754C7C7), - SPH_C64(0x2B4FB32BFC19FCFC), SPH_C64(0x14242014040C0404), - SPH_C64(0x08E3B20851F35151), SPH_C64(0xC725BCC799B69999), - SPH_C64(0xC4224FC46DB76D6D), SPH_C64(0x396568390D170D0D), - SPH_C64(0x35798335FA13FAFA), SPH_C64(0x8469B684DF7CDFDF), - SPH_C64(0x9BA9D79B7E827E7E), SPH_C64(0xB4193DB4246C2424), - SPH_C64(0xD7FEC5D73B4D3B3B), SPH_C64(0x3D9A313DABE0ABAB), - SPH_C64(0xD1F03ED1CE4FCECE), SPH_C64(0x5599885511331111), - SPH_C64(0x89830C898F8C8F8F), SPH_C64(0x6B044A6B4ED24E4E), - SPH_C64(0x5166D151B7C4B7B7), SPH_C64(0x60E00B60EB20EBEB), - SPH_C64(0xCCC1FDCC3C443C3C), SPH_C64(0xBFFD7CBF819E8181), - SPH_C64(0xFE40D4FE94A19494), SPH_C64(0x0C1CEB0CF704F7F7), - SPH_C64(0x6718A167B9D6B9B9), SPH_C64(0x5F8B985F13351313), - SPH_C64(0x9C517D9C2C742C2C), SPH_C64(0xB805D6B8D368D3D3), - SPH_C64(0x5C8C6B5CE734E7E7), SPH_C64(0xCB3957CB6EB26E6E), - SPH_C64(0xF3AA6EF3C451C4C4), SPH_C64(0x0F1B180F03050303), - SPH_C64(0x13DC8A1356FA5656), SPH_C64(0x495E1A4944CC4444), - SPH_C64(0x9EA0DF9E7F817F7F), SPH_C64(0x37882137A9E6A9A9), - SPH_C64(0x82674D822A7E2A2A), SPH_C64(0x6D0AB16DBBD0BBBB), - SPH_C64(0xE28746E2C15EC1C1), SPH_C64(0x02F1A20253F55353), - SPH_C64(0x8B72AE8BDC79DCDC), SPH_C64(0x275358270B1D0B0B), - SPH_C64(0xD3019CD39DBA9D9D), SPH_C64(0xC12B47C16CB46C6C), - SPH_C64(0xF5A495F531533131), SPH_C64(0xB9F387B9749C7474), - SPH_C64(0x0915E309F607F6F6), SPH_C64(0x434C0A4346CA4646), - SPH_C64(0x26A50926ACE9ACAC), SPH_C64(0x97B53C9789868989), - SPH_C64(0x44B4A044143C1414), SPH_C64(0x42BA5B42E13EE1E1), - SPH_C64(0x4EA6B04E163A1616), SPH_C64(0xD2F7CDD23A4E3A3A), - SPH_C64(0xD0066FD069BB6969), SPH_C64(0x2D41482D091B0909), - SPH_C64(0xADD7A7AD70907070), SPH_C64(0x546FD954B6C7B6B6), - SPH_C64(0xB71ECEB7D06DD0D0), SPH_C64(0x7ED63B7EED2AEDED), - SPH_C64(0xDBE22EDBCC49CCCC), SPH_C64(0x57682A5742C64242), - SPH_C64(0xC22CB4C298B59898), SPH_C64(0x0EED490EA4F1A4A4), - SPH_C64(0x88755D8828782828), SPH_C64(0x3186DA315CE45C5C), - SPH_C64(0x3F6B933FF815F8F8), SPH_C64(0xA4C244A486978686) -}; - -#if !SPH_SMALL_FOOTPRINT_WHIRLPOOL - -static const sph_u64 old1_T1[256] = { - SPH_C64(0xD8C0781828181878), SPH_C64(0x2605AF23652323AF), - SPH_C64(0xB87EF9C657C6C6F9), SPH_C64(0xFB136FE825E8E86F), - SPH_C64(0xCB4CA187948787A1), SPH_C64(0x11A962B8D5B8B862), - SPH_C64(0x0908050103010105), SPH_C64(0x0D426E4FD14F4F6E), - SPH_C64(0x9BADEE365A3636EE), SPH_C64(0xFF5904A6F7A6A604), - SPH_C64(0x0CDEBDD26BD2D2BD), SPH_C64(0x0EFB06F502F5F506), - SPH_C64(0x96EF80798B797980), SPH_C64(0x305FCE6FB16F6FCE), - SPH_C64(0x6DFCEF91AE9191EF), SPH_C64(0xF8AA0752F6525207), - SPH_C64(0x4727FD60A06060FD), SPH_C64(0x358976BCD9BCBC76), - SPH_C64(0x37ACCD9BB09B9BCD), SPH_C64(0x8A048C8E8F8E8E8C), - SPH_C64(0xD27115A3F8A3A315), SPH_C64(0x6C603C0C140C0C3C), - SPH_C64(0x84FF8A7B8D7B7B8A), SPH_C64(0x80B5E1355F3535E1), - SPH_C64(0xF5E8691D271D1D69), SPH_C64(0xB35347E03DE0E047), - SPH_C64(0x21F6ACD764D7D7AC), SPH_C64(0x9C5EEDC25BC2C2ED), - SPH_C64(0x436D962E722E2E96), SPH_C64(0x29627A4BDD4B4B7A), - SPH_C64(0x5DA321FE1FFEFE21), SPH_C64(0xD5821657F9575716), - SPH_C64(0xBDA841153F151541), SPH_C64(0xE89FB677997777B6), - SPH_C64(0x92A5EB37593737EB), SPH_C64(0x9E7B56E532E5E556), - SPH_C64(0x138CD99FBC9F9FD9), SPH_C64(0x23D317F00DF0F017), - SPH_C64(0x206A7F4ADE4A4A7F), SPH_C64(0x449E95DA73DADA95), - SPH_C64(0xA2FA2558E8585825), SPH_C64(0xCF06CAC946C9C9CA), - SPH_C64(0x7C558D297B29298D), SPH_C64(0x5A50220A1E0A0A22), - SPH_C64(0x50E14FB1CEB1B14F), SPH_C64(0xC9691AA0FDA0A01A), - SPH_C64(0x147FDA6BBD6B6BDA), SPH_C64(0xD95CAB85928585AB), - SPH_C64(0x3C8173BDDABDBD73), SPH_C64(0x8FD2345DE75D5D34), - SPH_C64(0x9080501030101050), SPH_C64(0x07F303F401F4F403), - SPH_C64(0xDD16C0CB40CBCBC0), SPH_C64(0xD3EDC63E423E3EC6), - SPH_C64(0x2D2811050F050511), SPH_C64(0x781FE667A96767E6), - SPH_C64(0x977353E431E4E453), SPH_C64(0x0225BB27692727BB), - SPH_C64(0x73325841C3414158), SPH_C64(0xA72C9D8B808B8B9D), - SPH_C64(0xF65101A7F4A7A701), SPH_C64(0xB2CF947D877D7D94), - SPH_C64(0x49DCFB95A29595FB), SPH_C64(0x568E9FD875D8D89F), - SPH_C64(0x708B30FB10FBFB30), SPH_C64(0xCD2371EE2FEEEE71), - SPH_C64(0xBBC7917C847C7C91), SPH_C64(0x7117E366AA6666E3), - SPH_C64(0x7BA68EDD7ADDDD8E), SPH_C64(0xAFB84B173917174B), - SPH_C64(0x45024647C9474746), SPH_C64(0x1A84DC9EBF9E9EDC), - SPH_C64(0xD41EC5CA43CACAC5), SPH_C64(0x5875992D772D2D99), - SPH_C64(0x2E9179BFDCBFBF79), SPH_C64(0x3F381B070907071B), - SPH_C64(0xAC0123ADEAADAD23), SPH_C64(0xB0EA2F5AEE5A5A2F), - SPH_C64(0xEF6CB583988383B5), SPH_C64(0xB685FF33553333FF), - SPH_C64(0x5C3FF263A56363F2), SPH_C64(0x12100A020602020A), - SPH_C64(0x933938AAE3AAAA38), SPH_C64(0xDEAFA871937171A8), - SPH_C64(0xC60ECFC845C8C8CF), SPH_C64(0xD1C87D192B19197D), - SPH_C64(0x3B727049DB494970), SPH_C64(0x5F869AD976D9D99A), - SPH_C64(0x31C31DF20BF2F21D), SPH_C64(0xA84B48E338E3E348), - SPH_C64(0xB9E22A5BED5B5B2A), SPH_C64(0xBC34928885888892), - SPH_C64(0x3EA4C89AB39A9AC8), SPH_C64(0x0B2DBE266A2626BE), - SPH_C64(0xBF8DFA32563232FA), SPH_C64(0x59E94AB0CDB0B04A), - SPH_C64(0xF21B6AE926E9E96A), SPH_C64(0x7778330F110F0F33), - SPH_C64(0x33E6A6D562D5D5A6), SPH_C64(0xF474BA809D8080BA), - SPH_C64(0x27997CBEDFBEBE7C), SPH_C64(0xEB26DECD4ACDCDDE), - SPH_C64(0x89BDE4345C3434E4), SPH_C64(0x327A7548D8484875), - SPH_C64(0x54AB24FF1CFFFF24), SPH_C64(0x8DF78F7A8E7A7A8F), - SPH_C64(0x64F4EA90AD9090EA), SPH_C64(0x9DC23E5FE15F5F3E), - SPH_C64(0x3D1DA020602020A0), SPH_C64(0x0F67D568B86868D5), - SPH_C64(0xCAD0721A2E1A1A72), SPH_C64(0xB7192CAEEFAEAE2C), - SPH_C64(0x7DC95EB4C1B4B45E), SPH_C64(0xCE9A1954FC545419), - SPH_C64(0x7FECE593A89393E5), SPH_C64(0x2F0DAA22662222AA), - SPH_C64(0x6307E964AC6464E9), SPH_C64(0x2ADB12F10EF1F112), - SPH_C64(0xCCBFA273957373A2), SPH_C64(0x82905A123612125A), - SPH_C64(0x7A3A5D40C040405D), SPH_C64(0x4840280818080828), - SPH_C64(0x9556E8C358C3C3E8), SPH_C64(0xDF337BEC29ECEC7B), - SPH_C64(0x4D9690DB70DBDB90), SPH_C64(0xC0611FA1FEA1A11F), - SPH_C64(0x911C838D8A8D8D83), SPH_C64(0xC8F5C93D473D3DC9), - SPH_C64(0x5BCCF197A49797F1), SPH_C64(0x0000000000000000), - SPH_C64(0xF936D4CF4CCFCFD4), SPH_C64(0x6E45872B7D2B2B87), - SPH_C64(0xE197B3769A7676B3), SPH_C64(0xE664B0829B8282B0), - SPH_C64(0x28FEA9D667D6D6A9), SPH_C64(0xC3D8771B2D1B1B77), - SPH_C64(0x74C15BB5C2B5B55B), SPH_C64(0xBE1129AFECAFAF29), - SPH_C64(0x1D77DF6ABE6A6ADF), SPH_C64(0xEABA0D50F050500D), - SPH_C64(0x57124C45CF45454C), SPH_C64(0x38CB18F308F3F318), - SPH_C64(0xAD9DF030503030F0), SPH_C64(0xC42B74EF2CEFEF74), - SPH_C64(0xDAE5C33F413F3FC3), SPH_C64(0xC7921C55FF55551C), - SPH_C64(0xDB7910A2FBA2A210), SPH_C64(0xE90365EA23EAEA65), - SPH_C64(0x6A0FEC65AF6565EC), SPH_C64(0x03B968BAD3BABA68), - SPH_C64(0x4A65932F712F2F93), SPH_C64(0x8E4EE7C05DC0C0E7), - SPH_C64(0x60BE81DE7FDEDE81), SPH_C64(0xFCE06C1C241C1C6C), - SPH_C64(0x46BB2EFD1AFDFD2E), SPH_C64(0x1F52644DD74D4D64), - SPH_C64(0x76E4E092AB9292E0), SPH_C64(0xFA8FBC759F7575BC), - SPH_C64(0x36301E060A06061E), SPH_C64(0xAE24988A838A8A98), - SPH_C64(0x4BF940B2CBB2B240), SPH_C64(0x856359E637E6E659), - SPH_C64(0x7E70360E120E0E36), SPH_C64(0xE7F8631F211F1F63), - SPH_C64(0x5537F762A66262F7), SPH_C64(0x3AEEA3D461D4D4A3), - SPH_C64(0x812932A8E5A8A832), SPH_C64(0x52C4F496A79696F4), - SPH_C64(0x629B3AF916F9F93A), SPH_C64(0xA366F6C552C5C5F6), - SPH_C64(0x1035B1256F2525B1), SPH_C64(0xABF22059EB595920), - SPH_C64(0xD054AE84918484AE), SPH_C64(0xC5B7A772967272A7), - SPH_C64(0xECD5DD394B3939DD), SPH_C64(0x165A614CD44C4C61), - SPH_C64(0x94CA3B5EE25E5E3B), SPH_C64(0x9FE7857888787885), - SPH_C64(0xE5DDD838483838D8), SPH_C64(0x9814868C898C8C86), - SPH_C64(0x17C6B2D16ED1D1B2), SPH_C64(0xE4410BA5F2A5A50B), - SPH_C64(0xA1434DE23BE2E24D), SPH_C64(0x4E2FF861A36161F8), - SPH_C64(0x42F145B3C8B3B345), SPH_C64(0x3415A521632121A5), - SPH_C64(0x0894D69CB99C9CD6), SPH_C64(0xEEF0661E221E1E66), - SPH_C64(0x61225243C5434352), SPH_C64(0xB176FCC754C7C7FC), - SPH_C64(0x4FB32BFC19FCFC2B), SPH_C64(0x242014040C040414), - SPH_C64(0xE3B20851F3515108), SPH_C64(0x25BCC799B69999C7), - SPH_C64(0x224FC46DB76D6DC4), SPH_C64(0x6568390D170D0D39), - SPH_C64(0x798335FA13FAFA35), SPH_C64(0x69B684DF7CDFDF84), - SPH_C64(0xA9D79B7E827E7E9B), SPH_C64(0x193DB4246C2424B4), - SPH_C64(0xFEC5D73B4D3B3BD7), SPH_C64(0x9A313DABE0ABAB3D), - SPH_C64(0xF03ED1CE4FCECED1), SPH_C64(0x9988551133111155), - SPH_C64(0x830C898F8C8F8F89), SPH_C64(0x044A6B4ED24E4E6B), - SPH_C64(0x66D151B7C4B7B751), SPH_C64(0xE00B60EB20EBEB60), - SPH_C64(0xC1FDCC3C443C3CCC), SPH_C64(0xFD7CBF819E8181BF), - SPH_C64(0x40D4FE94A19494FE), SPH_C64(0x1CEB0CF704F7F70C), - SPH_C64(0x18A167B9D6B9B967), SPH_C64(0x8B985F133513135F), - SPH_C64(0x517D9C2C742C2C9C), SPH_C64(0x05D6B8D368D3D3B8), - SPH_C64(0x8C6B5CE734E7E75C), SPH_C64(0x3957CB6EB26E6ECB), - SPH_C64(0xAA6EF3C451C4C4F3), SPH_C64(0x1B180F030503030F), - SPH_C64(0xDC8A1356FA565613), SPH_C64(0x5E1A4944CC444449), - SPH_C64(0xA0DF9E7F817F7F9E), SPH_C64(0x882137A9E6A9A937), - SPH_C64(0x674D822A7E2A2A82), SPH_C64(0x0AB16DBBD0BBBB6D), - SPH_C64(0x8746E2C15EC1C1E2), SPH_C64(0xF1A20253F5535302), - SPH_C64(0x72AE8BDC79DCDC8B), SPH_C64(0x5358270B1D0B0B27), - SPH_C64(0x019CD39DBA9D9DD3), SPH_C64(0x2B47C16CB46C6CC1), - SPH_C64(0xA495F531533131F5), SPH_C64(0xF387B9749C7474B9), - SPH_C64(0x15E309F607F6F609), SPH_C64(0x4C0A4346CA464643), - SPH_C64(0xA50926ACE9ACAC26), SPH_C64(0xB53C978986898997), - SPH_C64(0xB4A044143C141444), SPH_C64(0xBA5B42E13EE1E142), - SPH_C64(0xA6B04E163A16164E), SPH_C64(0xF7CDD23A4E3A3AD2), - SPH_C64(0x066FD069BB6969D0), SPH_C64(0x41482D091B09092D), - SPH_C64(0xD7A7AD70907070AD), SPH_C64(0x6FD954B6C7B6B654), - SPH_C64(0x1ECEB7D06DD0D0B7), SPH_C64(0xD63B7EED2AEDED7E), - SPH_C64(0xE22EDBCC49CCCCDB), SPH_C64(0x682A5742C6424257), - SPH_C64(0x2CB4C298B59898C2), SPH_C64(0xED490EA4F1A4A40E), - SPH_C64(0x755D882878282888), SPH_C64(0x86DA315CE45C5C31), - SPH_C64(0x6B933FF815F8F83F), SPH_C64(0xC244A486978686A4) -}; - -static const sph_u64 old1_T2[256] = { - SPH_C64(0xC0781828181878D8), SPH_C64(0x05AF23652323AF26), - SPH_C64(0x7EF9C657C6C6F9B8), SPH_C64(0x136FE825E8E86FFB), - SPH_C64(0x4CA187948787A1CB), SPH_C64(0xA962B8D5B8B86211), - SPH_C64(0x0805010301010509), SPH_C64(0x426E4FD14F4F6E0D), - SPH_C64(0xADEE365A3636EE9B), SPH_C64(0x5904A6F7A6A604FF), - SPH_C64(0xDEBDD26BD2D2BD0C), SPH_C64(0xFB06F502F5F5060E), - SPH_C64(0xEF80798B79798096), SPH_C64(0x5FCE6FB16F6FCE30), - SPH_C64(0xFCEF91AE9191EF6D), SPH_C64(0xAA0752F6525207F8), - SPH_C64(0x27FD60A06060FD47), SPH_C64(0x8976BCD9BCBC7635), - SPH_C64(0xACCD9BB09B9BCD37), SPH_C64(0x048C8E8F8E8E8C8A), - SPH_C64(0x7115A3F8A3A315D2), SPH_C64(0x603C0C140C0C3C6C), - SPH_C64(0xFF8A7B8D7B7B8A84), SPH_C64(0xB5E1355F3535E180), - SPH_C64(0xE8691D271D1D69F5), SPH_C64(0x5347E03DE0E047B3), - SPH_C64(0xF6ACD764D7D7AC21), SPH_C64(0x5EEDC25BC2C2ED9C), - SPH_C64(0x6D962E722E2E9643), SPH_C64(0x627A4BDD4B4B7A29), - SPH_C64(0xA321FE1FFEFE215D), SPH_C64(0x821657F9575716D5), - SPH_C64(0xA841153F151541BD), SPH_C64(0x9FB677997777B6E8), - SPH_C64(0xA5EB37593737EB92), SPH_C64(0x7B56E532E5E5569E), - SPH_C64(0x8CD99FBC9F9FD913), SPH_C64(0xD317F00DF0F01723), - SPH_C64(0x6A7F4ADE4A4A7F20), SPH_C64(0x9E95DA73DADA9544), - SPH_C64(0xFA2558E8585825A2), SPH_C64(0x06CAC946C9C9CACF), - SPH_C64(0x558D297B29298D7C), SPH_C64(0x50220A1E0A0A225A), - SPH_C64(0xE14FB1CEB1B14F50), SPH_C64(0x691AA0FDA0A01AC9), - SPH_C64(0x7FDA6BBD6B6BDA14), SPH_C64(0x5CAB85928585ABD9), - SPH_C64(0x8173BDDABDBD733C), SPH_C64(0xD2345DE75D5D348F), - SPH_C64(0x8050103010105090), SPH_C64(0xF303F401F4F40307), - SPH_C64(0x16C0CB40CBCBC0DD), SPH_C64(0xEDC63E423E3EC6D3), - SPH_C64(0x2811050F0505112D), SPH_C64(0x1FE667A96767E678), - SPH_C64(0x7353E431E4E45397), SPH_C64(0x25BB27692727BB02), - SPH_C64(0x325841C341415873), SPH_C64(0x2C9D8B808B8B9DA7), - SPH_C64(0x5101A7F4A7A701F6), SPH_C64(0xCF947D877D7D94B2), - SPH_C64(0xDCFB95A29595FB49), SPH_C64(0x8E9FD875D8D89F56), - SPH_C64(0x8B30FB10FBFB3070), SPH_C64(0x2371EE2FEEEE71CD), - SPH_C64(0xC7917C847C7C91BB), SPH_C64(0x17E366AA6666E371), - SPH_C64(0xA68EDD7ADDDD8E7B), SPH_C64(0xB84B173917174BAF), - SPH_C64(0x024647C947474645), SPH_C64(0x84DC9EBF9E9EDC1A), - SPH_C64(0x1EC5CA43CACAC5D4), SPH_C64(0x75992D772D2D9958), - SPH_C64(0x9179BFDCBFBF792E), SPH_C64(0x381B070907071B3F), - SPH_C64(0x0123ADEAADAD23AC), SPH_C64(0xEA2F5AEE5A5A2FB0), - SPH_C64(0x6CB583988383B5EF), SPH_C64(0x85FF33553333FFB6), - SPH_C64(0x3FF263A56363F25C), SPH_C64(0x100A020602020A12), - SPH_C64(0x3938AAE3AAAA3893), SPH_C64(0xAFA871937171A8DE), - SPH_C64(0x0ECFC845C8C8CFC6), SPH_C64(0xC87D192B19197DD1), - SPH_C64(0x727049DB4949703B), SPH_C64(0x869AD976D9D99A5F), - SPH_C64(0xC31DF20BF2F21D31), SPH_C64(0x4B48E338E3E348A8), - SPH_C64(0xE22A5BED5B5B2AB9), SPH_C64(0x34928885888892BC), - SPH_C64(0xA4C89AB39A9AC83E), SPH_C64(0x2DBE266A2626BE0B), - SPH_C64(0x8DFA32563232FABF), SPH_C64(0xE94AB0CDB0B04A59), - SPH_C64(0x1B6AE926E9E96AF2), SPH_C64(0x78330F110F0F3377), - SPH_C64(0xE6A6D562D5D5A633), SPH_C64(0x74BA809D8080BAF4), - SPH_C64(0x997CBEDFBEBE7C27), SPH_C64(0x26DECD4ACDCDDEEB), - SPH_C64(0xBDE4345C3434E489), SPH_C64(0x7A7548D848487532), - SPH_C64(0xAB24FF1CFFFF2454), SPH_C64(0xF78F7A8E7A7A8F8D), - SPH_C64(0xF4EA90AD9090EA64), SPH_C64(0xC23E5FE15F5F3E9D), - SPH_C64(0x1DA020602020A03D), SPH_C64(0x67D568B86868D50F), - SPH_C64(0xD0721A2E1A1A72CA), SPH_C64(0x192CAEEFAEAE2CB7), - SPH_C64(0xC95EB4C1B4B45E7D), SPH_C64(0x9A1954FC545419CE), - SPH_C64(0xECE593A89393E57F), SPH_C64(0x0DAA22662222AA2F), - SPH_C64(0x07E964AC6464E963), SPH_C64(0xDB12F10EF1F1122A), - SPH_C64(0xBFA273957373A2CC), SPH_C64(0x905A123612125A82), - SPH_C64(0x3A5D40C040405D7A), SPH_C64(0x4028081808082848), - SPH_C64(0x56E8C358C3C3E895), SPH_C64(0x337BEC29ECEC7BDF), - SPH_C64(0x9690DB70DBDB904D), SPH_C64(0x611FA1FEA1A11FC0), - SPH_C64(0x1C838D8A8D8D8391), SPH_C64(0xF5C93D473D3DC9C8), - SPH_C64(0xCCF197A49797F15B), SPH_C64(0x0000000000000000), - SPH_C64(0x36D4CF4CCFCFD4F9), SPH_C64(0x45872B7D2B2B876E), - SPH_C64(0x97B3769A7676B3E1), SPH_C64(0x64B0829B8282B0E6), - SPH_C64(0xFEA9D667D6D6A928), SPH_C64(0xD8771B2D1B1B77C3), - SPH_C64(0xC15BB5C2B5B55B74), SPH_C64(0x1129AFECAFAF29BE), - SPH_C64(0x77DF6ABE6A6ADF1D), SPH_C64(0xBA0D50F050500DEA), - SPH_C64(0x124C45CF45454C57), SPH_C64(0xCB18F308F3F31838), - SPH_C64(0x9DF030503030F0AD), SPH_C64(0x2B74EF2CEFEF74C4), - SPH_C64(0xE5C33F413F3FC3DA), SPH_C64(0x921C55FF55551CC7), - SPH_C64(0x7910A2FBA2A210DB), SPH_C64(0x0365EA23EAEA65E9), - SPH_C64(0x0FEC65AF6565EC6A), SPH_C64(0xB968BAD3BABA6803), - SPH_C64(0x65932F712F2F934A), SPH_C64(0x4EE7C05DC0C0E78E), - SPH_C64(0xBE81DE7FDEDE8160), SPH_C64(0xE06C1C241C1C6CFC), - SPH_C64(0xBB2EFD1AFDFD2E46), SPH_C64(0x52644DD74D4D641F), - SPH_C64(0xE4E092AB9292E076), SPH_C64(0x8FBC759F7575BCFA), - SPH_C64(0x301E060A06061E36), SPH_C64(0x24988A838A8A98AE), - SPH_C64(0xF940B2CBB2B2404B), SPH_C64(0x6359E637E6E65985), - SPH_C64(0x70360E120E0E367E), SPH_C64(0xF8631F211F1F63E7), - SPH_C64(0x37F762A66262F755), SPH_C64(0xEEA3D461D4D4A33A), - SPH_C64(0x2932A8E5A8A83281), SPH_C64(0xC4F496A79696F452), - SPH_C64(0x9B3AF916F9F93A62), SPH_C64(0x66F6C552C5C5F6A3), - SPH_C64(0x35B1256F2525B110), SPH_C64(0xF22059EB595920AB), - SPH_C64(0x54AE84918484AED0), SPH_C64(0xB7A772967272A7C5), - SPH_C64(0xD5DD394B3939DDEC), SPH_C64(0x5A614CD44C4C6116), - SPH_C64(0xCA3B5EE25E5E3B94), SPH_C64(0xE78578887878859F), - SPH_C64(0xDDD838483838D8E5), SPH_C64(0x14868C898C8C8698), - SPH_C64(0xC6B2D16ED1D1B217), SPH_C64(0x410BA5F2A5A50BE4), - SPH_C64(0x434DE23BE2E24DA1), SPH_C64(0x2FF861A36161F84E), - SPH_C64(0xF145B3C8B3B34542), SPH_C64(0x15A521632121A534), - SPH_C64(0x94D69CB99C9CD608), SPH_C64(0xF0661E221E1E66EE), - SPH_C64(0x225243C543435261), SPH_C64(0x76FCC754C7C7FCB1), - SPH_C64(0xB32BFC19FCFC2B4F), SPH_C64(0x2014040C04041424), - SPH_C64(0xB20851F3515108E3), SPH_C64(0xBCC799B69999C725), - SPH_C64(0x4FC46DB76D6DC422), SPH_C64(0x68390D170D0D3965), - SPH_C64(0x8335FA13FAFA3579), SPH_C64(0xB684DF7CDFDF8469), - SPH_C64(0xD79B7E827E7E9BA9), SPH_C64(0x3DB4246C2424B419), - SPH_C64(0xC5D73B4D3B3BD7FE), SPH_C64(0x313DABE0ABAB3D9A), - SPH_C64(0x3ED1CE4FCECED1F0), SPH_C64(0x8855113311115599), - SPH_C64(0x0C898F8C8F8F8983), SPH_C64(0x4A6B4ED24E4E6B04), - SPH_C64(0xD151B7C4B7B75166), SPH_C64(0x0B60EB20EBEB60E0), - SPH_C64(0xFDCC3C443C3CCCC1), SPH_C64(0x7CBF819E8181BFFD), - SPH_C64(0xD4FE94A19494FE40), SPH_C64(0xEB0CF704F7F70C1C), - SPH_C64(0xA167B9D6B9B96718), SPH_C64(0x985F133513135F8B), - SPH_C64(0x7D9C2C742C2C9C51), SPH_C64(0xD6B8D368D3D3B805), - SPH_C64(0x6B5CE734E7E75C8C), SPH_C64(0x57CB6EB26E6ECB39), - SPH_C64(0x6EF3C451C4C4F3AA), SPH_C64(0x180F030503030F1B), - SPH_C64(0x8A1356FA565613DC), SPH_C64(0x1A4944CC4444495E), - SPH_C64(0xDF9E7F817F7F9EA0), SPH_C64(0x2137A9E6A9A93788), - SPH_C64(0x4D822A7E2A2A8267), SPH_C64(0xB16DBBD0BBBB6D0A), - SPH_C64(0x46E2C15EC1C1E287), SPH_C64(0xA20253F5535302F1), - SPH_C64(0xAE8BDC79DCDC8B72), SPH_C64(0x58270B1D0B0B2753), - SPH_C64(0x9CD39DBA9D9DD301), SPH_C64(0x47C16CB46C6CC12B), - SPH_C64(0x95F531533131F5A4), SPH_C64(0x87B9749C7474B9F3), - SPH_C64(0xE309F607F6F60915), SPH_C64(0x0A4346CA4646434C), - SPH_C64(0x0926ACE9ACAC26A5), SPH_C64(0x3C978986898997B5), - SPH_C64(0xA044143C141444B4), SPH_C64(0x5B42E13EE1E142BA), - SPH_C64(0xB04E163A16164EA6), SPH_C64(0xCDD23A4E3A3AD2F7), - SPH_C64(0x6FD069BB6969D006), SPH_C64(0x482D091B09092D41), - SPH_C64(0xA7AD70907070ADD7), SPH_C64(0xD954B6C7B6B6546F), - SPH_C64(0xCEB7D06DD0D0B71E), SPH_C64(0x3B7EED2AEDED7ED6), - SPH_C64(0x2EDBCC49CCCCDBE2), SPH_C64(0x2A5742C642425768), - SPH_C64(0xB4C298B59898C22C), SPH_C64(0x490EA4F1A4A40EED), - SPH_C64(0x5D88287828288875), SPH_C64(0xDA315CE45C5C3186), - SPH_C64(0x933FF815F8F83F6B), SPH_C64(0x44A486978686A4C2) -}; - -static const sph_u64 old1_T3[256] = { - SPH_C64(0x781828181878D8C0), SPH_C64(0xAF23652323AF2605), - SPH_C64(0xF9C657C6C6F9B87E), SPH_C64(0x6FE825E8E86FFB13), - SPH_C64(0xA187948787A1CB4C), SPH_C64(0x62B8D5B8B86211A9), - SPH_C64(0x0501030101050908), SPH_C64(0x6E4FD14F4F6E0D42), - SPH_C64(0xEE365A3636EE9BAD), SPH_C64(0x04A6F7A6A604FF59), - SPH_C64(0xBDD26BD2D2BD0CDE), SPH_C64(0x06F502F5F5060EFB), - SPH_C64(0x80798B79798096EF), SPH_C64(0xCE6FB16F6FCE305F), - SPH_C64(0xEF91AE9191EF6DFC), SPH_C64(0x0752F6525207F8AA), - SPH_C64(0xFD60A06060FD4727), SPH_C64(0x76BCD9BCBC763589), - SPH_C64(0xCD9BB09B9BCD37AC), SPH_C64(0x8C8E8F8E8E8C8A04), - SPH_C64(0x15A3F8A3A315D271), SPH_C64(0x3C0C140C0C3C6C60), - SPH_C64(0x8A7B8D7B7B8A84FF), SPH_C64(0xE1355F3535E180B5), - SPH_C64(0x691D271D1D69F5E8), SPH_C64(0x47E03DE0E047B353), - SPH_C64(0xACD764D7D7AC21F6), SPH_C64(0xEDC25BC2C2ED9C5E), - SPH_C64(0x962E722E2E96436D), SPH_C64(0x7A4BDD4B4B7A2962), - SPH_C64(0x21FE1FFEFE215DA3), SPH_C64(0x1657F9575716D582), - SPH_C64(0x41153F151541BDA8), SPH_C64(0xB677997777B6E89F), - SPH_C64(0xEB37593737EB92A5), SPH_C64(0x56E532E5E5569E7B), - SPH_C64(0xD99FBC9F9FD9138C), SPH_C64(0x17F00DF0F01723D3), - SPH_C64(0x7F4ADE4A4A7F206A), SPH_C64(0x95DA73DADA95449E), - SPH_C64(0x2558E8585825A2FA), SPH_C64(0xCAC946C9C9CACF06), - SPH_C64(0x8D297B29298D7C55), SPH_C64(0x220A1E0A0A225A50), - SPH_C64(0x4FB1CEB1B14F50E1), SPH_C64(0x1AA0FDA0A01AC969), - SPH_C64(0xDA6BBD6B6BDA147F), SPH_C64(0xAB85928585ABD95C), - SPH_C64(0x73BDDABDBD733C81), SPH_C64(0x345DE75D5D348FD2), - SPH_C64(0x5010301010509080), SPH_C64(0x03F401F4F40307F3), - SPH_C64(0xC0CB40CBCBC0DD16), SPH_C64(0xC63E423E3EC6D3ED), - SPH_C64(0x11050F0505112D28), SPH_C64(0xE667A96767E6781F), - SPH_C64(0x53E431E4E4539773), SPH_C64(0xBB27692727BB0225), - SPH_C64(0x5841C34141587332), SPH_C64(0x9D8B808B8B9DA72C), - SPH_C64(0x01A7F4A7A701F651), SPH_C64(0x947D877D7D94B2CF), - SPH_C64(0xFB95A29595FB49DC), SPH_C64(0x9FD875D8D89F568E), - SPH_C64(0x30FB10FBFB30708B), SPH_C64(0x71EE2FEEEE71CD23), - SPH_C64(0x917C847C7C91BBC7), SPH_C64(0xE366AA6666E37117), - SPH_C64(0x8EDD7ADDDD8E7BA6), SPH_C64(0x4B173917174BAFB8), - SPH_C64(0x4647C94747464502), SPH_C64(0xDC9EBF9E9EDC1A84), - SPH_C64(0xC5CA43CACAC5D41E), SPH_C64(0x992D772D2D995875), - SPH_C64(0x79BFDCBFBF792E91), SPH_C64(0x1B070907071B3F38), - SPH_C64(0x23ADEAADAD23AC01), SPH_C64(0x2F5AEE5A5A2FB0EA), - SPH_C64(0xB583988383B5EF6C), SPH_C64(0xFF33553333FFB685), - SPH_C64(0xF263A56363F25C3F), SPH_C64(0x0A020602020A1210), - SPH_C64(0x38AAE3AAAA389339), SPH_C64(0xA871937171A8DEAF), - SPH_C64(0xCFC845C8C8CFC60E), SPH_C64(0x7D192B19197DD1C8), - SPH_C64(0x7049DB4949703B72), SPH_C64(0x9AD976D9D99A5F86), - SPH_C64(0x1DF20BF2F21D31C3), SPH_C64(0x48E338E3E348A84B), - SPH_C64(0x2A5BED5B5B2AB9E2), SPH_C64(0x928885888892BC34), - SPH_C64(0xC89AB39A9AC83EA4), SPH_C64(0xBE266A2626BE0B2D), - SPH_C64(0xFA32563232FABF8D), SPH_C64(0x4AB0CDB0B04A59E9), - SPH_C64(0x6AE926E9E96AF21B), SPH_C64(0x330F110F0F337778), - SPH_C64(0xA6D562D5D5A633E6), SPH_C64(0xBA809D8080BAF474), - SPH_C64(0x7CBEDFBEBE7C2799), SPH_C64(0xDECD4ACDCDDEEB26), - SPH_C64(0xE4345C3434E489BD), SPH_C64(0x7548D8484875327A), - SPH_C64(0x24FF1CFFFF2454AB), SPH_C64(0x8F7A8E7A7A8F8DF7), - SPH_C64(0xEA90AD9090EA64F4), SPH_C64(0x3E5FE15F5F3E9DC2), - SPH_C64(0xA020602020A03D1D), SPH_C64(0xD568B86868D50F67), - SPH_C64(0x721A2E1A1A72CAD0), SPH_C64(0x2CAEEFAEAE2CB719), - SPH_C64(0x5EB4C1B4B45E7DC9), SPH_C64(0x1954FC545419CE9A), - SPH_C64(0xE593A89393E57FEC), SPH_C64(0xAA22662222AA2F0D), - SPH_C64(0xE964AC6464E96307), SPH_C64(0x12F10EF1F1122ADB), - SPH_C64(0xA273957373A2CCBF), SPH_C64(0x5A123612125A8290), - SPH_C64(0x5D40C040405D7A3A), SPH_C64(0x2808180808284840), - SPH_C64(0xE8C358C3C3E89556), SPH_C64(0x7BEC29ECEC7BDF33), - SPH_C64(0x90DB70DBDB904D96), SPH_C64(0x1FA1FEA1A11FC061), - SPH_C64(0x838D8A8D8D83911C), SPH_C64(0xC93D473D3DC9C8F5), - SPH_C64(0xF197A49797F15BCC), SPH_C64(0x0000000000000000), - SPH_C64(0xD4CF4CCFCFD4F936), SPH_C64(0x872B7D2B2B876E45), - SPH_C64(0xB3769A7676B3E197), SPH_C64(0xB0829B8282B0E664), - SPH_C64(0xA9D667D6D6A928FE), SPH_C64(0x771B2D1B1B77C3D8), - SPH_C64(0x5BB5C2B5B55B74C1), SPH_C64(0x29AFECAFAF29BE11), - SPH_C64(0xDF6ABE6A6ADF1D77), SPH_C64(0x0D50F050500DEABA), - SPH_C64(0x4C45CF45454C5712), SPH_C64(0x18F308F3F31838CB), - SPH_C64(0xF030503030F0AD9D), SPH_C64(0x74EF2CEFEF74C42B), - SPH_C64(0xC33F413F3FC3DAE5), SPH_C64(0x1C55FF55551CC792), - SPH_C64(0x10A2FBA2A210DB79), SPH_C64(0x65EA23EAEA65E903), - SPH_C64(0xEC65AF6565EC6A0F), SPH_C64(0x68BAD3BABA6803B9), - SPH_C64(0x932F712F2F934A65), SPH_C64(0xE7C05DC0C0E78E4E), - SPH_C64(0x81DE7FDEDE8160BE), SPH_C64(0x6C1C241C1C6CFCE0), - SPH_C64(0x2EFD1AFDFD2E46BB), SPH_C64(0x644DD74D4D641F52), - SPH_C64(0xE092AB9292E076E4), SPH_C64(0xBC759F7575BCFA8F), - SPH_C64(0x1E060A06061E3630), SPH_C64(0x988A838A8A98AE24), - SPH_C64(0x40B2CBB2B2404BF9), SPH_C64(0x59E637E6E6598563), - SPH_C64(0x360E120E0E367E70), SPH_C64(0x631F211F1F63E7F8), - SPH_C64(0xF762A66262F75537), SPH_C64(0xA3D461D4D4A33AEE), - SPH_C64(0x32A8E5A8A8328129), SPH_C64(0xF496A79696F452C4), - SPH_C64(0x3AF916F9F93A629B), SPH_C64(0xF6C552C5C5F6A366), - SPH_C64(0xB1256F2525B11035), SPH_C64(0x2059EB595920ABF2), - SPH_C64(0xAE84918484AED054), SPH_C64(0xA772967272A7C5B7), - SPH_C64(0xDD394B3939DDECD5), SPH_C64(0x614CD44C4C61165A), - SPH_C64(0x3B5EE25E5E3B94CA), SPH_C64(0x8578887878859FE7), - SPH_C64(0xD838483838D8E5DD), SPH_C64(0x868C898C8C869814), - SPH_C64(0xB2D16ED1D1B217C6), SPH_C64(0x0BA5F2A5A50BE441), - SPH_C64(0x4DE23BE2E24DA143), SPH_C64(0xF861A36161F84E2F), - SPH_C64(0x45B3C8B3B34542F1), SPH_C64(0xA521632121A53415), - SPH_C64(0xD69CB99C9CD60894), SPH_C64(0x661E221E1E66EEF0), - SPH_C64(0x5243C54343526122), SPH_C64(0xFCC754C7C7FCB176), - SPH_C64(0x2BFC19FCFC2B4FB3), SPH_C64(0x14040C0404142420), - SPH_C64(0x0851F3515108E3B2), SPH_C64(0xC799B69999C725BC), - SPH_C64(0xC46DB76D6DC4224F), SPH_C64(0x390D170D0D396568), - SPH_C64(0x35FA13FAFA357983), SPH_C64(0x84DF7CDFDF8469B6), - SPH_C64(0x9B7E827E7E9BA9D7), SPH_C64(0xB4246C2424B4193D), - SPH_C64(0xD73B4D3B3BD7FEC5), SPH_C64(0x3DABE0ABAB3D9A31), - SPH_C64(0xD1CE4FCECED1F03E), SPH_C64(0x5511331111559988), - SPH_C64(0x898F8C8F8F89830C), SPH_C64(0x6B4ED24E4E6B044A), - SPH_C64(0x51B7C4B7B75166D1), SPH_C64(0x60EB20EBEB60E00B), - SPH_C64(0xCC3C443C3CCCC1FD), SPH_C64(0xBF819E8181BFFD7C), - SPH_C64(0xFE94A19494FE40D4), SPH_C64(0x0CF704F7F70C1CEB), - SPH_C64(0x67B9D6B9B96718A1), SPH_C64(0x5F133513135F8B98), - SPH_C64(0x9C2C742C2C9C517D), SPH_C64(0xB8D368D3D3B805D6), - SPH_C64(0x5CE734E7E75C8C6B), SPH_C64(0xCB6EB26E6ECB3957), - SPH_C64(0xF3C451C4C4F3AA6E), SPH_C64(0x0F030503030F1B18), - SPH_C64(0x1356FA565613DC8A), SPH_C64(0x4944CC4444495E1A), - SPH_C64(0x9E7F817F7F9EA0DF), SPH_C64(0x37A9E6A9A9378821), - SPH_C64(0x822A7E2A2A82674D), SPH_C64(0x6DBBD0BBBB6D0AB1), - SPH_C64(0xE2C15EC1C1E28746), SPH_C64(0x0253F5535302F1A2), - SPH_C64(0x8BDC79DCDC8B72AE), SPH_C64(0x270B1D0B0B275358), - SPH_C64(0xD39DBA9D9DD3019C), SPH_C64(0xC16CB46C6CC12B47), - SPH_C64(0xF531533131F5A495), SPH_C64(0xB9749C7474B9F387), - SPH_C64(0x09F607F6F60915E3), SPH_C64(0x4346CA4646434C0A), - SPH_C64(0x26ACE9ACAC26A509), SPH_C64(0x978986898997B53C), - SPH_C64(0x44143C141444B4A0), SPH_C64(0x42E13EE1E142BA5B), - SPH_C64(0x4E163A16164EA6B0), SPH_C64(0xD23A4E3A3AD2F7CD), - SPH_C64(0xD069BB6969D0066F), SPH_C64(0x2D091B09092D4148), - SPH_C64(0xAD70907070ADD7A7), SPH_C64(0x54B6C7B6B6546FD9), - SPH_C64(0xB7D06DD0D0B71ECE), SPH_C64(0x7EED2AEDED7ED63B), - SPH_C64(0xDBCC49CCCCDBE22E), SPH_C64(0x5742C6424257682A), - SPH_C64(0xC298B59898C22CB4), SPH_C64(0x0EA4F1A4A40EED49), - SPH_C64(0x882878282888755D), SPH_C64(0x315CE45C5C3186DA), - SPH_C64(0x3FF815F8F83F6B93), SPH_C64(0xA486978686A4C244) -}; - -static const sph_u64 old1_T4[256] = { - SPH_C64(0x1828181878D8C078), SPH_C64(0x23652323AF2605AF), - SPH_C64(0xC657C6C6F9B87EF9), SPH_C64(0xE825E8E86FFB136F), - SPH_C64(0x87948787A1CB4CA1), SPH_C64(0xB8D5B8B86211A962), - SPH_C64(0x0103010105090805), SPH_C64(0x4FD14F4F6E0D426E), - SPH_C64(0x365A3636EE9BADEE), SPH_C64(0xA6F7A6A604FF5904), - SPH_C64(0xD26BD2D2BD0CDEBD), SPH_C64(0xF502F5F5060EFB06), - SPH_C64(0x798B79798096EF80), SPH_C64(0x6FB16F6FCE305FCE), - SPH_C64(0x91AE9191EF6DFCEF), SPH_C64(0x52F6525207F8AA07), - SPH_C64(0x60A06060FD4727FD), SPH_C64(0xBCD9BCBC76358976), - SPH_C64(0x9BB09B9BCD37ACCD), SPH_C64(0x8E8F8E8E8C8A048C), - SPH_C64(0xA3F8A3A315D27115), SPH_C64(0x0C140C0C3C6C603C), - SPH_C64(0x7B8D7B7B8A84FF8A), SPH_C64(0x355F3535E180B5E1), - SPH_C64(0x1D271D1D69F5E869), SPH_C64(0xE03DE0E047B35347), - SPH_C64(0xD764D7D7AC21F6AC), SPH_C64(0xC25BC2C2ED9C5EED), - SPH_C64(0x2E722E2E96436D96), SPH_C64(0x4BDD4B4B7A29627A), - SPH_C64(0xFE1FFEFE215DA321), SPH_C64(0x57F9575716D58216), - SPH_C64(0x153F151541BDA841), SPH_C64(0x77997777B6E89FB6), - SPH_C64(0x37593737EB92A5EB), SPH_C64(0xE532E5E5569E7B56), - SPH_C64(0x9FBC9F9FD9138CD9), SPH_C64(0xF00DF0F01723D317), - SPH_C64(0x4ADE4A4A7F206A7F), SPH_C64(0xDA73DADA95449E95), - SPH_C64(0x58E8585825A2FA25), SPH_C64(0xC946C9C9CACF06CA), - SPH_C64(0x297B29298D7C558D), SPH_C64(0x0A1E0A0A225A5022), - SPH_C64(0xB1CEB1B14F50E14F), SPH_C64(0xA0FDA0A01AC9691A), - SPH_C64(0x6BBD6B6BDA147FDA), SPH_C64(0x85928585ABD95CAB), - SPH_C64(0xBDDABDBD733C8173), SPH_C64(0x5DE75D5D348FD234), - SPH_C64(0x1030101050908050), SPH_C64(0xF401F4F40307F303), - SPH_C64(0xCB40CBCBC0DD16C0), SPH_C64(0x3E423E3EC6D3EDC6), - SPH_C64(0x050F0505112D2811), SPH_C64(0x67A96767E6781FE6), - SPH_C64(0xE431E4E453977353), SPH_C64(0x27692727BB0225BB), - SPH_C64(0x41C3414158733258), SPH_C64(0x8B808B8B9DA72C9D), - SPH_C64(0xA7F4A7A701F65101), SPH_C64(0x7D877D7D94B2CF94), - SPH_C64(0x95A29595FB49DCFB), SPH_C64(0xD875D8D89F568E9F), - SPH_C64(0xFB10FBFB30708B30), SPH_C64(0xEE2FEEEE71CD2371), - SPH_C64(0x7C847C7C91BBC791), SPH_C64(0x66AA6666E37117E3), - SPH_C64(0xDD7ADDDD8E7BA68E), SPH_C64(0x173917174BAFB84B), - SPH_C64(0x47C9474746450246), SPH_C64(0x9EBF9E9EDC1A84DC), - SPH_C64(0xCA43CACAC5D41EC5), SPH_C64(0x2D772D2D99587599), - SPH_C64(0xBFDCBFBF792E9179), SPH_C64(0x070907071B3F381B), - SPH_C64(0xADEAADAD23AC0123), SPH_C64(0x5AEE5A5A2FB0EA2F), - SPH_C64(0x83988383B5EF6CB5), SPH_C64(0x33553333FFB685FF), - SPH_C64(0x63A56363F25C3FF2), SPH_C64(0x020602020A12100A), - SPH_C64(0xAAE3AAAA38933938), SPH_C64(0x71937171A8DEAFA8), - SPH_C64(0xC845C8C8CFC60ECF), SPH_C64(0x192B19197DD1C87D), - SPH_C64(0x49DB4949703B7270), SPH_C64(0xD976D9D99A5F869A), - SPH_C64(0xF20BF2F21D31C31D), SPH_C64(0xE338E3E348A84B48), - SPH_C64(0x5BED5B5B2AB9E22A), SPH_C64(0x8885888892BC3492), - SPH_C64(0x9AB39A9AC83EA4C8), SPH_C64(0x266A2626BE0B2DBE), - SPH_C64(0x32563232FABF8DFA), SPH_C64(0xB0CDB0B04A59E94A), - SPH_C64(0xE926E9E96AF21B6A), SPH_C64(0x0F110F0F33777833), - SPH_C64(0xD562D5D5A633E6A6), SPH_C64(0x809D8080BAF474BA), - SPH_C64(0xBEDFBEBE7C27997C), SPH_C64(0xCD4ACDCDDEEB26DE), - SPH_C64(0x345C3434E489BDE4), SPH_C64(0x48D8484875327A75), - SPH_C64(0xFF1CFFFF2454AB24), SPH_C64(0x7A8E7A7A8F8DF78F), - SPH_C64(0x90AD9090EA64F4EA), SPH_C64(0x5FE15F5F3E9DC23E), - SPH_C64(0x20602020A03D1DA0), SPH_C64(0x68B86868D50F67D5), - SPH_C64(0x1A2E1A1A72CAD072), SPH_C64(0xAEEFAEAE2CB7192C), - SPH_C64(0xB4C1B4B45E7DC95E), SPH_C64(0x54FC545419CE9A19), - SPH_C64(0x93A89393E57FECE5), SPH_C64(0x22662222AA2F0DAA), - SPH_C64(0x64AC6464E96307E9), SPH_C64(0xF10EF1F1122ADB12), - SPH_C64(0x73957373A2CCBFA2), SPH_C64(0x123612125A82905A), - SPH_C64(0x40C040405D7A3A5D), SPH_C64(0x0818080828484028), - SPH_C64(0xC358C3C3E89556E8), SPH_C64(0xEC29ECEC7BDF337B), - SPH_C64(0xDB70DBDB904D9690), SPH_C64(0xA1FEA1A11FC0611F), - SPH_C64(0x8D8A8D8D83911C83), SPH_C64(0x3D473D3DC9C8F5C9), - SPH_C64(0x97A49797F15BCCF1), SPH_C64(0x0000000000000000), - SPH_C64(0xCF4CCFCFD4F936D4), SPH_C64(0x2B7D2B2B876E4587), - SPH_C64(0x769A7676B3E197B3), SPH_C64(0x829B8282B0E664B0), - SPH_C64(0xD667D6D6A928FEA9), SPH_C64(0x1B2D1B1B77C3D877), - SPH_C64(0xB5C2B5B55B74C15B), SPH_C64(0xAFECAFAF29BE1129), - SPH_C64(0x6ABE6A6ADF1D77DF), SPH_C64(0x50F050500DEABA0D), - SPH_C64(0x45CF45454C57124C), SPH_C64(0xF308F3F31838CB18), - SPH_C64(0x30503030F0AD9DF0), SPH_C64(0xEF2CEFEF74C42B74), - SPH_C64(0x3F413F3FC3DAE5C3), SPH_C64(0x55FF55551CC7921C), - SPH_C64(0xA2FBA2A210DB7910), SPH_C64(0xEA23EAEA65E90365), - SPH_C64(0x65AF6565EC6A0FEC), SPH_C64(0xBAD3BABA6803B968), - SPH_C64(0x2F712F2F934A6593), SPH_C64(0xC05DC0C0E78E4EE7), - SPH_C64(0xDE7FDEDE8160BE81), SPH_C64(0x1C241C1C6CFCE06C), - SPH_C64(0xFD1AFDFD2E46BB2E), SPH_C64(0x4DD74D4D641F5264), - SPH_C64(0x92AB9292E076E4E0), SPH_C64(0x759F7575BCFA8FBC), - SPH_C64(0x060A06061E36301E), SPH_C64(0x8A838A8A98AE2498), - SPH_C64(0xB2CBB2B2404BF940), SPH_C64(0xE637E6E659856359), - SPH_C64(0x0E120E0E367E7036), SPH_C64(0x1F211F1F63E7F863), - SPH_C64(0x62A66262F75537F7), SPH_C64(0xD461D4D4A33AEEA3), - SPH_C64(0xA8E5A8A832812932), SPH_C64(0x96A79696F452C4F4), - SPH_C64(0xF916F9F93A629B3A), SPH_C64(0xC552C5C5F6A366F6), - SPH_C64(0x256F2525B11035B1), SPH_C64(0x59EB595920ABF220), - SPH_C64(0x84918484AED054AE), SPH_C64(0x72967272A7C5B7A7), - SPH_C64(0x394B3939DDECD5DD), SPH_C64(0x4CD44C4C61165A61), - SPH_C64(0x5EE25E5E3B94CA3B), SPH_C64(0x78887878859FE785), - SPH_C64(0x38483838D8E5DDD8), SPH_C64(0x8C898C8C86981486), - SPH_C64(0xD16ED1D1B217C6B2), SPH_C64(0xA5F2A5A50BE4410B), - SPH_C64(0xE23BE2E24DA1434D), SPH_C64(0x61A36161F84E2FF8), - SPH_C64(0xB3C8B3B34542F145), SPH_C64(0x21632121A53415A5), - SPH_C64(0x9CB99C9CD60894D6), SPH_C64(0x1E221E1E66EEF066), - SPH_C64(0x43C5434352612252), SPH_C64(0xC754C7C7FCB176FC), - SPH_C64(0xFC19FCFC2B4FB32B), SPH_C64(0x040C040414242014), - SPH_C64(0x51F3515108E3B208), SPH_C64(0x99B69999C725BCC7), - SPH_C64(0x6DB76D6DC4224FC4), SPH_C64(0x0D170D0D39656839), - SPH_C64(0xFA13FAFA35798335), SPH_C64(0xDF7CDFDF8469B684), - SPH_C64(0x7E827E7E9BA9D79B), SPH_C64(0x246C2424B4193DB4), - SPH_C64(0x3B4D3B3BD7FEC5D7), SPH_C64(0xABE0ABAB3D9A313D), - SPH_C64(0xCE4FCECED1F03ED1), SPH_C64(0x1133111155998855), - SPH_C64(0x8F8C8F8F89830C89), SPH_C64(0x4ED24E4E6B044A6B), - SPH_C64(0xB7C4B7B75166D151), SPH_C64(0xEB20EBEB60E00B60), - SPH_C64(0x3C443C3CCCC1FDCC), SPH_C64(0x819E8181BFFD7CBF), - SPH_C64(0x94A19494FE40D4FE), SPH_C64(0xF704F7F70C1CEB0C), - SPH_C64(0xB9D6B9B96718A167), SPH_C64(0x133513135F8B985F), - SPH_C64(0x2C742C2C9C517D9C), SPH_C64(0xD368D3D3B805D6B8), - SPH_C64(0xE734E7E75C8C6B5C), SPH_C64(0x6EB26E6ECB3957CB), - SPH_C64(0xC451C4C4F3AA6EF3), SPH_C64(0x030503030F1B180F), - SPH_C64(0x56FA565613DC8A13), SPH_C64(0x44CC4444495E1A49), - SPH_C64(0x7F817F7F9EA0DF9E), SPH_C64(0xA9E6A9A937882137), - SPH_C64(0x2A7E2A2A82674D82), SPH_C64(0xBBD0BBBB6D0AB16D), - SPH_C64(0xC15EC1C1E28746E2), SPH_C64(0x53F5535302F1A202), - SPH_C64(0xDC79DCDC8B72AE8B), SPH_C64(0x0B1D0B0B27535827), - SPH_C64(0x9DBA9D9DD3019CD3), SPH_C64(0x6CB46C6CC12B47C1), - SPH_C64(0x31533131F5A495F5), SPH_C64(0x749C7474B9F387B9), - SPH_C64(0xF607F6F60915E309), SPH_C64(0x46CA4646434C0A43), - SPH_C64(0xACE9ACAC26A50926), SPH_C64(0x8986898997B53C97), - SPH_C64(0x143C141444B4A044), SPH_C64(0xE13EE1E142BA5B42), - SPH_C64(0x163A16164EA6B04E), SPH_C64(0x3A4E3A3AD2F7CDD2), - SPH_C64(0x69BB6969D0066FD0), SPH_C64(0x091B09092D41482D), - SPH_C64(0x70907070ADD7A7AD), SPH_C64(0xB6C7B6B6546FD954), - SPH_C64(0xD06DD0D0B71ECEB7), SPH_C64(0xED2AEDED7ED63B7E), - SPH_C64(0xCC49CCCCDBE22EDB), SPH_C64(0x42C6424257682A57), - SPH_C64(0x98B59898C22CB4C2), SPH_C64(0xA4F1A4A40EED490E), - SPH_C64(0x2878282888755D88), SPH_C64(0x5CE45C5C3186DA31), - SPH_C64(0xF815F8F83F6B933F), SPH_C64(0x86978686A4C244A4) -}; - -static const sph_u64 old1_T5[256] = { - SPH_C64(0x28181878D8C07818), SPH_C64(0x652323AF2605AF23), - SPH_C64(0x57C6C6F9B87EF9C6), SPH_C64(0x25E8E86FFB136FE8), - SPH_C64(0x948787A1CB4CA187), SPH_C64(0xD5B8B86211A962B8), - SPH_C64(0x0301010509080501), SPH_C64(0xD14F4F6E0D426E4F), - SPH_C64(0x5A3636EE9BADEE36), SPH_C64(0xF7A6A604FF5904A6), - SPH_C64(0x6BD2D2BD0CDEBDD2), SPH_C64(0x02F5F5060EFB06F5), - SPH_C64(0x8B79798096EF8079), SPH_C64(0xB16F6FCE305FCE6F), - SPH_C64(0xAE9191EF6DFCEF91), SPH_C64(0xF6525207F8AA0752), - SPH_C64(0xA06060FD4727FD60), SPH_C64(0xD9BCBC76358976BC), - SPH_C64(0xB09B9BCD37ACCD9B), SPH_C64(0x8F8E8E8C8A048C8E), - SPH_C64(0xF8A3A315D27115A3), SPH_C64(0x140C0C3C6C603C0C), - SPH_C64(0x8D7B7B8A84FF8A7B), SPH_C64(0x5F3535E180B5E135), - SPH_C64(0x271D1D69F5E8691D), SPH_C64(0x3DE0E047B35347E0), - SPH_C64(0x64D7D7AC21F6ACD7), SPH_C64(0x5BC2C2ED9C5EEDC2), - SPH_C64(0x722E2E96436D962E), SPH_C64(0xDD4B4B7A29627A4B), - SPH_C64(0x1FFEFE215DA321FE), SPH_C64(0xF9575716D5821657), - SPH_C64(0x3F151541BDA84115), SPH_C64(0x997777B6E89FB677), - SPH_C64(0x593737EB92A5EB37), SPH_C64(0x32E5E5569E7B56E5), - SPH_C64(0xBC9F9FD9138CD99F), SPH_C64(0x0DF0F01723D317F0), - SPH_C64(0xDE4A4A7F206A7F4A), SPH_C64(0x73DADA95449E95DA), - SPH_C64(0xE8585825A2FA2558), SPH_C64(0x46C9C9CACF06CAC9), - SPH_C64(0x7B29298D7C558D29), SPH_C64(0x1E0A0A225A50220A), - SPH_C64(0xCEB1B14F50E14FB1), SPH_C64(0xFDA0A01AC9691AA0), - SPH_C64(0xBD6B6BDA147FDA6B), SPH_C64(0x928585ABD95CAB85), - SPH_C64(0xDABDBD733C8173BD), SPH_C64(0xE75D5D348FD2345D), - SPH_C64(0x3010105090805010), SPH_C64(0x01F4F40307F303F4), - SPH_C64(0x40CBCBC0DD16C0CB), SPH_C64(0x423E3EC6D3EDC63E), - SPH_C64(0x0F0505112D281105), SPH_C64(0xA96767E6781FE667), - SPH_C64(0x31E4E453977353E4), SPH_C64(0x692727BB0225BB27), - SPH_C64(0xC341415873325841), SPH_C64(0x808B8B9DA72C9D8B), - SPH_C64(0xF4A7A701F65101A7), SPH_C64(0x877D7D94B2CF947D), - SPH_C64(0xA29595FB49DCFB95), SPH_C64(0x75D8D89F568E9FD8), - SPH_C64(0x10FBFB30708B30FB), SPH_C64(0x2FEEEE71CD2371EE), - SPH_C64(0x847C7C91BBC7917C), SPH_C64(0xAA6666E37117E366), - SPH_C64(0x7ADDDD8E7BA68EDD), SPH_C64(0x3917174BAFB84B17), - SPH_C64(0xC947474645024647), SPH_C64(0xBF9E9EDC1A84DC9E), - SPH_C64(0x43CACAC5D41EC5CA), SPH_C64(0x772D2D995875992D), - SPH_C64(0xDCBFBF792E9179BF), SPH_C64(0x0907071B3F381B07), - SPH_C64(0xEAADAD23AC0123AD), SPH_C64(0xEE5A5A2FB0EA2F5A), - SPH_C64(0x988383B5EF6CB583), SPH_C64(0x553333FFB685FF33), - SPH_C64(0xA56363F25C3FF263), SPH_C64(0x0602020A12100A02), - SPH_C64(0xE3AAAA38933938AA), SPH_C64(0x937171A8DEAFA871), - SPH_C64(0x45C8C8CFC60ECFC8), SPH_C64(0x2B19197DD1C87D19), - SPH_C64(0xDB4949703B727049), SPH_C64(0x76D9D99A5F869AD9), - SPH_C64(0x0BF2F21D31C31DF2), SPH_C64(0x38E3E348A84B48E3), - SPH_C64(0xED5B5B2AB9E22A5B), SPH_C64(0x85888892BC349288), - SPH_C64(0xB39A9AC83EA4C89A), SPH_C64(0x6A2626BE0B2DBE26), - SPH_C64(0x563232FABF8DFA32), SPH_C64(0xCDB0B04A59E94AB0), - SPH_C64(0x26E9E96AF21B6AE9), SPH_C64(0x110F0F337778330F), - SPH_C64(0x62D5D5A633E6A6D5), SPH_C64(0x9D8080BAF474BA80), - SPH_C64(0xDFBEBE7C27997CBE), SPH_C64(0x4ACDCDDEEB26DECD), - SPH_C64(0x5C3434E489BDE434), SPH_C64(0xD8484875327A7548), - SPH_C64(0x1CFFFF2454AB24FF), SPH_C64(0x8E7A7A8F8DF78F7A), - SPH_C64(0xAD9090EA64F4EA90), SPH_C64(0xE15F5F3E9DC23E5F), - SPH_C64(0x602020A03D1DA020), SPH_C64(0xB86868D50F67D568), - SPH_C64(0x2E1A1A72CAD0721A), SPH_C64(0xEFAEAE2CB7192CAE), - SPH_C64(0xC1B4B45E7DC95EB4), SPH_C64(0xFC545419CE9A1954), - SPH_C64(0xA89393E57FECE593), SPH_C64(0x662222AA2F0DAA22), - SPH_C64(0xAC6464E96307E964), SPH_C64(0x0EF1F1122ADB12F1), - SPH_C64(0x957373A2CCBFA273), SPH_C64(0x3612125A82905A12), - SPH_C64(0xC040405D7A3A5D40), SPH_C64(0x1808082848402808), - SPH_C64(0x58C3C3E89556E8C3), SPH_C64(0x29ECEC7BDF337BEC), - SPH_C64(0x70DBDB904D9690DB), SPH_C64(0xFEA1A11FC0611FA1), - SPH_C64(0x8A8D8D83911C838D), SPH_C64(0x473D3DC9C8F5C93D), - SPH_C64(0xA49797F15BCCF197), SPH_C64(0x0000000000000000), - SPH_C64(0x4CCFCFD4F936D4CF), SPH_C64(0x7D2B2B876E45872B), - SPH_C64(0x9A7676B3E197B376), SPH_C64(0x9B8282B0E664B082), - SPH_C64(0x67D6D6A928FEA9D6), SPH_C64(0x2D1B1B77C3D8771B), - SPH_C64(0xC2B5B55B74C15BB5), SPH_C64(0xECAFAF29BE1129AF), - SPH_C64(0xBE6A6ADF1D77DF6A), SPH_C64(0xF050500DEABA0D50), - SPH_C64(0xCF45454C57124C45), SPH_C64(0x08F3F31838CB18F3), - SPH_C64(0x503030F0AD9DF030), SPH_C64(0x2CEFEF74C42B74EF), - SPH_C64(0x413F3FC3DAE5C33F), SPH_C64(0xFF55551CC7921C55), - SPH_C64(0xFBA2A210DB7910A2), SPH_C64(0x23EAEA65E90365EA), - SPH_C64(0xAF6565EC6A0FEC65), SPH_C64(0xD3BABA6803B968BA), - SPH_C64(0x712F2F934A65932F), SPH_C64(0x5DC0C0E78E4EE7C0), - SPH_C64(0x7FDEDE8160BE81DE), SPH_C64(0x241C1C6CFCE06C1C), - SPH_C64(0x1AFDFD2E46BB2EFD), SPH_C64(0xD74D4D641F52644D), - SPH_C64(0xAB9292E076E4E092), SPH_C64(0x9F7575BCFA8FBC75), - SPH_C64(0x0A06061E36301E06), SPH_C64(0x838A8A98AE24988A), - SPH_C64(0xCBB2B2404BF940B2), SPH_C64(0x37E6E659856359E6), - SPH_C64(0x120E0E367E70360E), SPH_C64(0x211F1F63E7F8631F), - SPH_C64(0xA66262F75537F762), SPH_C64(0x61D4D4A33AEEA3D4), - SPH_C64(0xE5A8A832812932A8), SPH_C64(0xA79696F452C4F496), - SPH_C64(0x16F9F93A629B3AF9), SPH_C64(0x52C5C5F6A366F6C5), - SPH_C64(0x6F2525B11035B125), SPH_C64(0xEB595920ABF22059), - SPH_C64(0x918484AED054AE84), SPH_C64(0x967272A7C5B7A772), - SPH_C64(0x4B3939DDECD5DD39), SPH_C64(0xD44C4C61165A614C), - SPH_C64(0xE25E5E3B94CA3B5E), SPH_C64(0x887878859FE78578), - SPH_C64(0x483838D8E5DDD838), SPH_C64(0x898C8C869814868C), - SPH_C64(0x6ED1D1B217C6B2D1), SPH_C64(0xF2A5A50BE4410BA5), - SPH_C64(0x3BE2E24DA1434DE2), SPH_C64(0xA36161F84E2FF861), - SPH_C64(0xC8B3B34542F145B3), SPH_C64(0x632121A53415A521), - SPH_C64(0xB99C9CD60894D69C), SPH_C64(0x221E1E66EEF0661E), - SPH_C64(0xC543435261225243), SPH_C64(0x54C7C7FCB176FCC7), - SPH_C64(0x19FCFC2B4FB32BFC), SPH_C64(0x0C04041424201404), - SPH_C64(0xF3515108E3B20851), SPH_C64(0xB69999C725BCC799), - SPH_C64(0xB76D6DC4224FC46D), SPH_C64(0x170D0D396568390D), - SPH_C64(0x13FAFA35798335FA), SPH_C64(0x7CDFDF8469B684DF), - SPH_C64(0x827E7E9BA9D79B7E), SPH_C64(0x6C2424B4193DB424), - SPH_C64(0x4D3B3BD7FEC5D73B), SPH_C64(0xE0ABAB3D9A313DAB), - SPH_C64(0x4FCECED1F03ED1CE), SPH_C64(0x3311115599885511), - SPH_C64(0x8C8F8F89830C898F), SPH_C64(0xD24E4E6B044A6B4E), - SPH_C64(0xC4B7B75166D151B7), SPH_C64(0x20EBEB60E00B60EB), - SPH_C64(0x443C3CCCC1FDCC3C), SPH_C64(0x9E8181BFFD7CBF81), - SPH_C64(0xA19494FE40D4FE94), SPH_C64(0x04F7F70C1CEB0CF7), - SPH_C64(0xD6B9B96718A167B9), SPH_C64(0x3513135F8B985F13), - SPH_C64(0x742C2C9C517D9C2C), SPH_C64(0x68D3D3B805D6B8D3), - SPH_C64(0x34E7E75C8C6B5CE7), SPH_C64(0xB26E6ECB3957CB6E), - SPH_C64(0x51C4C4F3AA6EF3C4), SPH_C64(0x0503030F1B180F03), - SPH_C64(0xFA565613DC8A1356), SPH_C64(0xCC4444495E1A4944), - SPH_C64(0x817F7F9EA0DF9E7F), SPH_C64(0xE6A9A937882137A9), - SPH_C64(0x7E2A2A82674D822A), SPH_C64(0xD0BBBB6D0AB16DBB), - SPH_C64(0x5EC1C1E28746E2C1), SPH_C64(0xF5535302F1A20253), - SPH_C64(0x79DCDC8B72AE8BDC), SPH_C64(0x1D0B0B275358270B), - SPH_C64(0xBA9D9DD3019CD39D), SPH_C64(0xB46C6CC12B47C16C), - SPH_C64(0x533131F5A495F531), SPH_C64(0x9C7474B9F387B974), - SPH_C64(0x07F6F60915E309F6), SPH_C64(0xCA4646434C0A4346), - SPH_C64(0xE9ACAC26A50926AC), SPH_C64(0x86898997B53C9789), - SPH_C64(0x3C141444B4A04414), SPH_C64(0x3EE1E142BA5B42E1), - SPH_C64(0x3A16164EA6B04E16), SPH_C64(0x4E3A3AD2F7CDD23A), - SPH_C64(0xBB6969D0066FD069), SPH_C64(0x1B09092D41482D09), - SPH_C64(0x907070ADD7A7AD70), SPH_C64(0xC7B6B6546FD954B6), - SPH_C64(0x6DD0D0B71ECEB7D0), SPH_C64(0x2AEDED7ED63B7EED), - SPH_C64(0x49CCCCDBE22EDBCC), SPH_C64(0xC6424257682A5742), - SPH_C64(0xB59898C22CB4C298), SPH_C64(0xF1A4A40EED490EA4), - SPH_C64(0x78282888755D8828), SPH_C64(0xE45C5C3186DA315C), - SPH_C64(0x15F8F83F6B933FF8), SPH_C64(0x978686A4C244A486) -}; - -static const sph_u64 old1_T6[256] = { - SPH_C64(0x181878D8C0781828), SPH_C64(0x2323AF2605AF2365), - SPH_C64(0xC6C6F9B87EF9C657), SPH_C64(0xE8E86FFB136FE825), - SPH_C64(0x8787A1CB4CA18794), SPH_C64(0xB8B86211A962B8D5), - SPH_C64(0x0101050908050103), SPH_C64(0x4F4F6E0D426E4FD1), - SPH_C64(0x3636EE9BADEE365A), SPH_C64(0xA6A604FF5904A6F7), - SPH_C64(0xD2D2BD0CDEBDD26B), SPH_C64(0xF5F5060EFB06F502), - SPH_C64(0x79798096EF80798B), SPH_C64(0x6F6FCE305FCE6FB1), - SPH_C64(0x9191EF6DFCEF91AE), SPH_C64(0x525207F8AA0752F6), - SPH_C64(0x6060FD4727FD60A0), SPH_C64(0xBCBC76358976BCD9), - SPH_C64(0x9B9BCD37ACCD9BB0), SPH_C64(0x8E8E8C8A048C8E8F), - SPH_C64(0xA3A315D27115A3F8), SPH_C64(0x0C0C3C6C603C0C14), - SPH_C64(0x7B7B8A84FF8A7B8D), SPH_C64(0x3535E180B5E1355F), - SPH_C64(0x1D1D69F5E8691D27), SPH_C64(0xE0E047B35347E03D), - SPH_C64(0xD7D7AC21F6ACD764), SPH_C64(0xC2C2ED9C5EEDC25B), - SPH_C64(0x2E2E96436D962E72), SPH_C64(0x4B4B7A29627A4BDD), - SPH_C64(0xFEFE215DA321FE1F), SPH_C64(0x575716D5821657F9), - SPH_C64(0x151541BDA841153F), SPH_C64(0x7777B6E89FB67799), - SPH_C64(0x3737EB92A5EB3759), SPH_C64(0xE5E5569E7B56E532), - SPH_C64(0x9F9FD9138CD99FBC), SPH_C64(0xF0F01723D317F00D), - SPH_C64(0x4A4A7F206A7F4ADE), SPH_C64(0xDADA95449E95DA73), - SPH_C64(0x585825A2FA2558E8), SPH_C64(0xC9C9CACF06CAC946), - SPH_C64(0x29298D7C558D297B), SPH_C64(0x0A0A225A50220A1E), - SPH_C64(0xB1B14F50E14FB1CE), SPH_C64(0xA0A01AC9691AA0FD), - SPH_C64(0x6B6BDA147FDA6BBD), SPH_C64(0x8585ABD95CAB8592), - SPH_C64(0xBDBD733C8173BDDA), SPH_C64(0x5D5D348FD2345DE7), - SPH_C64(0x1010509080501030), SPH_C64(0xF4F40307F303F401), - SPH_C64(0xCBCBC0DD16C0CB40), SPH_C64(0x3E3EC6D3EDC63E42), - SPH_C64(0x0505112D2811050F), SPH_C64(0x6767E6781FE667A9), - SPH_C64(0xE4E453977353E431), SPH_C64(0x2727BB0225BB2769), - SPH_C64(0x41415873325841C3), SPH_C64(0x8B8B9DA72C9D8B80), - SPH_C64(0xA7A701F65101A7F4), SPH_C64(0x7D7D94B2CF947D87), - SPH_C64(0x9595FB49DCFB95A2), SPH_C64(0xD8D89F568E9FD875), - SPH_C64(0xFBFB30708B30FB10), SPH_C64(0xEEEE71CD2371EE2F), - SPH_C64(0x7C7C91BBC7917C84), SPH_C64(0x6666E37117E366AA), - SPH_C64(0xDDDD8E7BA68EDD7A), SPH_C64(0x17174BAFB84B1739), - SPH_C64(0x47474645024647C9), SPH_C64(0x9E9EDC1A84DC9EBF), - SPH_C64(0xCACAC5D41EC5CA43), SPH_C64(0x2D2D995875992D77), - SPH_C64(0xBFBF792E9179BFDC), SPH_C64(0x07071B3F381B0709), - SPH_C64(0xADAD23AC0123ADEA), SPH_C64(0x5A5A2FB0EA2F5AEE), - SPH_C64(0x8383B5EF6CB58398), SPH_C64(0x3333FFB685FF3355), - SPH_C64(0x6363F25C3FF263A5), SPH_C64(0x02020A12100A0206), - SPH_C64(0xAAAA38933938AAE3), SPH_C64(0x7171A8DEAFA87193), - SPH_C64(0xC8C8CFC60ECFC845), SPH_C64(0x19197DD1C87D192B), - SPH_C64(0x4949703B727049DB), SPH_C64(0xD9D99A5F869AD976), - SPH_C64(0xF2F21D31C31DF20B), SPH_C64(0xE3E348A84B48E338), - SPH_C64(0x5B5B2AB9E22A5BED), SPH_C64(0x888892BC34928885), - SPH_C64(0x9A9AC83EA4C89AB3), SPH_C64(0x2626BE0B2DBE266A), - SPH_C64(0x3232FABF8DFA3256), SPH_C64(0xB0B04A59E94AB0CD), - SPH_C64(0xE9E96AF21B6AE926), SPH_C64(0x0F0F337778330F11), - SPH_C64(0xD5D5A633E6A6D562), SPH_C64(0x8080BAF474BA809D), - SPH_C64(0xBEBE7C27997CBEDF), SPH_C64(0xCDCDDEEB26DECD4A), - SPH_C64(0x3434E489BDE4345C), SPH_C64(0x484875327A7548D8), - SPH_C64(0xFFFF2454AB24FF1C), SPH_C64(0x7A7A8F8DF78F7A8E), - SPH_C64(0x9090EA64F4EA90AD), SPH_C64(0x5F5F3E9DC23E5FE1), - SPH_C64(0x2020A03D1DA02060), SPH_C64(0x6868D50F67D568B8), - SPH_C64(0x1A1A72CAD0721A2E), SPH_C64(0xAEAE2CB7192CAEEF), - SPH_C64(0xB4B45E7DC95EB4C1), SPH_C64(0x545419CE9A1954FC), - SPH_C64(0x9393E57FECE593A8), SPH_C64(0x2222AA2F0DAA2266), - SPH_C64(0x6464E96307E964AC), SPH_C64(0xF1F1122ADB12F10E), - SPH_C64(0x7373A2CCBFA27395), SPH_C64(0x12125A82905A1236), - SPH_C64(0x40405D7A3A5D40C0), SPH_C64(0x0808284840280818), - SPH_C64(0xC3C3E89556E8C358), SPH_C64(0xECEC7BDF337BEC29), - SPH_C64(0xDBDB904D9690DB70), SPH_C64(0xA1A11FC0611FA1FE), - SPH_C64(0x8D8D83911C838D8A), SPH_C64(0x3D3DC9C8F5C93D47), - SPH_C64(0x9797F15BCCF197A4), SPH_C64(0x0000000000000000), - SPH_C64(0xCFCFD4F936D4CF4C), SPH_C64(0x2B2B876E45872B7D), - SPH_C64(0x7676B3E197B3769A), SPH_C64(0x8282B0E664B0829B), - SPH_C64(0xD6D6A928FEA9D667), SPH_C64(0x1B1B77C3D8771B2D), - SPH_C64(0xB5B55B74C15BB5C2), SPH_C64(0xAFAF29BE1129AFEC), - SPH_C64(0x6A6ADF1D77DF6ABE), SPH_C64(0x50500DEABA0D50F0), - SPH_C64(0x45454C57124C45CF), SPH_C64(0xF3F31838CB18F308), - SPH_C64(0x3030F0AD9DF03050), SPH_C64(0xEFEF74C42B74EF2C), - SPH_C64(0x3F3FC3DAE5C33F41), SPH_C64(0x55551CC7921C55FF), - SPH_C64(0xA2A210DB7910A2FB), SPH_C64(0xEAEA65E90365EA23), - SPH_C64(0x6565EC6A0FEC65AF), SPH_C64(0xBABA6803B968BAD3), - SPH_C64(0x2F2F934A65932F71), SPH_C64(0xC0C0E78E4EE7C05D), - SPH_C64(0xDEDE8160BE81DE7F), SPH_C64(0x1C1C6CFCE06C1C24), - SPH_C64(0xFDFD2E46BB2EFD1A), SPH_C64(0x4D4D641F52644DD7), - SPH_C64(0x9292E076E4E092AB), SPH_C64(0x7575BCFA8FBC759F), - SPH_C64(0x06061E36301E060A), SPH_C64(0x8A8A98AE24988A83), - SPH_C64(0xB2B2404BF940B2CB), SPH_C64(0xE6E659856359E637), - SPH_C64(0x0E0E367E70360E12), SPH_C64(0x1F1F63E7F8631F21), - SPH_C64(0x6262F75537F762A6), SPH_C64(0xD4D4A33AEEA3D461), - SPH_C64(0xA8A832812932A8E5), SPH_C64(0x9696F452C4F496A7), - SPH_C64(0xF9F93A629B3AF916), SPH_C64(0xC5C5F6A366F6C552), - SPH_C64(0x2525B11035B1256F), SPH_C64(0x595920ABF22059EB), - SPH_C64(0x8484AED054AE8491), SPH_C64(0x7272A7C5B7A77296), - SPH_C64(0x3939DDECD5DD394B), SPH_C64(0x4C4C61165A614CD4), - SPH_C64(0x5E5E3B94CA3B5EE2), SPH_C64(0x7878859FE7857888), - SPH_C64(0x3838D8E5DDD83848), SPH_C64(0x8C8C869814868C89), - SPH_C64(0xD1D1B217C6B2D16E), SPH_C64(0xA5A50BE4410BA5F2), - SPH_C64(0xE2E24DA1434DE23B), SPH_C64(0x6161F84E2FF861A3), - SPH_C64(0xB3B34542F145B3C8), SPH_C64(0x2121A53415A52163), - SPH_C64(0x9C9CD60894D69CB9), SPH_C64(0x1E1E66EEF0661E22), - SPH_C64(0x43435261225243C5), SPH_C64(0xC7C7FCB176FCC754), - SPH_C64(0xFCFC2B4FB32BFC19), SPH_C64(0x040414242014040C), - SPH_C64(0x515108E3B20851F3), SPH_C64(0x9999C725BCC799B6), - SPH_C64(0x6D6DC4224FC46DB7), SPH_C64(0x0D0D396568390D17), - SPH_C64(0xFAFA35798335FA13), SPH_C64(0xDFDF8469B684DF7C), - SPH_C64(0x7E7E9BA9D79B7E82), SPH_C64(0x2424B4193DB4246C), - SPH_C64(0x3B3BD7FEC5D73B4D), SPH_C64(0xABAB3D9A313DABE0), - SPH_C64(0xCECED1F03ED1CE4F), SPH_C64(0x1111559988551133), - SPH_C64(0x8F8F89830C898F8C), SPH_C64(0x4E4E6B044A6B4ED2), - SPH_C64(0xB7B75166D151B7C4), SPH_C64(0xEBEB60E00B60EB20), - SPH_C64(0x3C3CCCC1FDCC3C44), SPH_C64(0x8181BFFD7CBF819E), - SPH_C64(0x9494FE40D4FE94A1), SPH_C64(0xF7F70C1CEB0CF704), - SPH_C64(0xB9B96718A167B9D6), SPH_C64(0x13135F8B985F1335), - SPH_C64(0x2C2C9C517D9C2C74), SPH_C64(0xD3D3B805D6B8D368), - SPH_C64(0xE7E75C8C6B5CE734), SPH_C64(0x6E6ECB3957CB6EB2), - SPH_C64(0xC4C4F3AA6EF3C451), SPH_C64(0x03030F1B180F0305), - SPH_C64(0x565613DC8A1356FA), SPH_C64(0x4444495E1A4944CC), - SPH_C64(0x7F7F9EA0DF9E7F81), SPH_C64(0xA9A937882137A9E6), - SPH_C64(0x2A2A82674D822A7E), SPH_C64(0xBBBB6D0AB16DBBD0), - SPH_C64(0xC1C1E28746E2C15E), SPH_C64(0x535302F1A20253F5), - SPH_C64(0xDCDC8B72AE8BDC79), SPH_C64(0x0B0B275358270B1D), - SPH_C64(0x9D9DD3019CD39DBA), SPH_C64(0x6C6CC12B47C16CB4), - SPH_C64(0x3131F5A495F53153), SPH_C64(0x7474B9F387B9749C), - SPH_C64(0xF6F60915E309F607), SPH_C64(0x4646434C0A4346CA), - SPH_C64(0xACAC26A50926ACE9), SPH_C64(0x898997B53C978986), - SPH_C64(0x141444B4A044143C), SPH_C64(0xE1E142BA5B42E13E), - SPH_C64(0x16164EA6B04E163A), SPH_C64(0x3A3AD2F7CDD23A4E), - SPH_C64(0x6969D0066FD069BB), SPH_C64(0x09092D41482D091B), - SPH_C64(0x7070ADD7A7AD7090), SPH_C64(0xB6B6546FD954B6C7), - SPH_C64(0xD0D0B71ECEB7D06D), SPH_C64(0xEDED7ED63B7EED2A), - SPH_C64(0xCCCCDBE22EDBCC49), SPH_C64(0x424257682A5742C6), - SPH_C64(0x9898C22CB4C298B5), SPH_C64(0xA4A40EED490EA4F1), - SPH_C64(0x282888755D882878), SPH_C64(0x5C5C3186DA315CE4), - SPH_C64(0xF8F83F6B933FF815), SPH_C64(0x8686A4C244A48697) -}; - -static const sph_u64 old1_T7[256] = { - SPH_C64(0x1878D8C078182818), SPH_C64(0x23AF2605AF236523), - SPH_C64(0xC6F9B87EF9C657C6), SPH_C64(0xE86FFB136FE825E8), - SPH_C64(0x87A1CB4CA1879487), SPH_C64(0xB86211A962B8D5B8), - SPH_C64(0x0105090805010301), SPH_C64(0x4F6E0D426E4FD14F), - SPH_C64(0x36EE9BADEE365A36), SPH_C64(0xA604FF5904A6F7A6), - SPH_C64(0xD2BD0CDEBDD26BD2), SPH_C64(0xF5060EFB06F502F5), - SPH_C64(0x798096EF80798B79), SPH_C64(0x6FCE305FCE6FB16F), - SPH_C64(0x91EF6DFCEF91AE91), SPH_C64(0x5207F8AA0752F652), - SPH_C64(0x60FD4727FD60A060), SPH_C64(0xBC76358976BCD9BC), - SPH_C64(0x9BCD37ACCD9BB09B), SPH_C64(0x8E8C8A048C8E8F8E), - SPH_C64(0xA315D27115A3F8A3), SPH_C64(0x0C3C6C603C0C140C), - SPH_C64(0x7B8A84FF8A7B8D7B), SPH_C64(0x35E180B5E1355F35), - SPH_C64(0x1D69F5E8691D271D), SPH_C64(0xE047B35347E03DE0), - SPH_C64(0xD7AC21F6ACD764D7), SPH_C64(0xC2ED9C5EEDC25BC2), - SPH_C64(0x2E96436D962E722E), SPH_C64(0x4B7A29627A4BDD4B), - SPH_C64(0xFE215DA321FE1FFE), SPH_C64(0x5716D5821657F957), - SPH_C64(0x1541BDA841153F15), SPH_C64(0x77B6E89FB6779977), - SPH_C64(0x37EB92A5EB375937), SPH_C64(0xE5569E7B56E532E5), - SPH_C64(0x9FD9138CD99FBC9F), SPH_C64(0xF01723D317F00DF0), - SPH_C64(0x4A7F206A7F4ADE4A), SPH_C64(0xDA95449E95DA73DA), - SPH_C64(0x5825A2FA2558E858), SPH_C64(0xC9CACF06CAC946C9), - SPH_C64(0x298D7C558D297B29), SPH_C64(0x0A225A50220A1E0A), - SPH_C64(0xB14F50E14FB1CEB1), SPH_C64(0xA01AC9691AA0FDA0), - SPH_C64(0x6BDA147FDA6BBD6B), SPH_C64(0x85ABD95CAB859285), - SPH_C64(0xBD733C8173BDDABD), SPH_C64(0x5D348FD2345DE75D), - SPH_C64(0x1050908050103010), SPH_C64(0xF40307F303F401F4), - SPH_C64(0xCBC0DD16C0CB40CB), SPH_C64(0x3EC6D3EDC63E423E), - SPH_C64(0x05112D2811050F05), SPH_C64(0x67E6781FE667A967), - SPH_C64(0xE453977353E431E4), SPH_C64(0x27BB0225BB276927), - SPH_C64(0x415873325841C341), SPH_C64(0x8B9DA72C9D8B808B), - SPH_C64(0xA701F65101A7F4A7), SPH_C64(0x7D94B2CF947D877D), - SPH_C64(0x95FB49DCFB95A295), SPH_C64(0xD89F568E9FD875D8), - SPH_C64(0xFB30708B30FB10FB), SPH_C64(0xEE71CD2371EE2FEE), - SPH_C64(0x7C91BBC7917C847C), SPH_C64(0x66E37117E366AA66), - SPH_C64(0xDD8E7BA68EDD7ADD), SPH_C64(0x174BAFB84B173917), - SPH_C64(0x474645024647C947), SPH_C64(0x9EDC1A84DC9EBF9E), - SPH_C64(0xCAC5D41EC5CA43CA), SPH_C64(0x2D995875992D772D), - SPH_C64(0xBF792E9179BFDCBF), SPH_C64(0x071B3F381B070907), - SPH_C64(0xAD23AC0123ADEAAD), SPH_C64(0x5A2FB0EA2F5AEE5A), - SPH_C64(0x83B5EF6CB5839883), SPH_C64(0x33FFB685FF335533), - SPH_C64(0x63F25C3FF263A563), SPH_C64(0x020A12100A020602), - SPH_C64(0xAA38933938AAE3AA), SPH_C64(0x71A8DEAFA8719371), - SPH_C64(0xC8CFC60ECFC845C8), SPH_C64(0x197DD1C87D192B19), - SPH_C64(0x49703B727049DB49), SPH_C64(0xD99A5F869AD976D9), - SPH_C64(0xF21D31C31DF20BF2), SPH_C64(0xE348A84B48E338E3), - SPH_C64(0x5B2AB9E22A5BED5B), SPH_C64(0x8892BC3492888588), - SPH_C64(0x9AC83EA4C89AB39A), SPH_C64(0x26BE0B2DBE266A26), - SPH_C64(0x32FABF8DFA325632), SPH_C64(0xB04A59E94AB0CDB0), - SPH_C64(0xE96AF21B6AE926E9), SPH_C64(0x0F337778330F110F), - SPH_C64(0xD5A633E6A6D562D5), SPH_C64(0x80BAF474BA809D80), - SPH_C64(0xBE7C27997CBEDFBE), SPH_C64(0xCDDEEB26DECD4ACD), - SPH_C64(0x34E489BDE4345C34), SPH_C64(0x4875327A7548D848), - SPH_C64(0xFF2454AB24FF1CFF), SPH_C64(0x7A8F8DF78F7A8E7A), - SPH_C64(0x90EA64F4EA90AD90), SPH_C64(0x5F3E9DC23E5FE15F), - SPH_C64(0x20A03D1DA0206020), SPH_C64(0x68D50F67D568B868), - SPH_C64(0x1A72CAD0721A2E1A), SPH_C64(0xAE2CB7192CAEEFAE), - SPH_C64(0xB45E7DC95EB4C1B4), SPH_C64(0x5419CE9A1954FC54), - SPH_C64(0x93E57FECE593A893), SPH_C64(0x22AA2F0DAA226622), - SPH_C64(0x64E96307E964AC64), SPH_C64(0xF1122ADB12F10EF1), - SPH_C64(0x73A2CCBFA2739573), SPH_C64(0x125A82905A123612), - SPH_C64(0x405D7A3A5D40C040), SPH_C64(0x0828484028081808), - SPH_C64(0xC3E89556E8C358C3), SPH_C64(0xEC7BDF337BEC29EC), - SPH_C64(0xDB904D9690DB70DB), SPH_C64(0xA11FC0611FA1FEA1), - SPH_C64(0x8D83911C838D8A8D), SPH_C64(0x3DC9C8F5C93D473D), - SPH_C64(0x97F15BCCF197A497), SPH_C64(0x0000000000000000), - SPH_C64(0xCFD4F936D4CF4CCF), SPH_C64(0x2B876E45872B7D2B), - SPH_C64(0x76B3E197B3769A76), SPH_C64(0x82B0E664B0829B82), - SPH_C64(0xD6A928FEA9D667D6), SPH_C64(0x1B77C3D8771B2D1B), - SPH_C64(0xB55B74C15BB5C2B5), SPH_C64(0xAF29BE1129AFECAF), - SPH_C64(0x6ADF1D77DF6ABE6A), SPH_C64(0x500DEABA0D50F050), - SPH_C64(0x454C57124C45CF45), SPH_C64(0xF31838CB18F308F3), - SPH_C64(0x30F0AD9DF0305030), SPH_C64(0xEF74C42B74EF2CEF), - SPH_C64(0x3FC3DAE5C33F413F), SPH_C64(0x551CC7921C55FF55), - SPH_C64(0xA210DB7910A2FBA2), SPH_C64(0xEA65E90365EA23EA), - SPH_C64(0x65EC6A0FEC65AF65), SPH_C64(0xBA6803B968BAD3BA), - SPH_C64(0x2F934A65932F712F), SPH_C64(0xC0E78E4EE7C05DC0), - SPH_C64(0xDE8160BE81DE7FDE), SPH_C64(0x1C6CFCE06C1C241C), - SPH_C64(0xFD2E46BB2EFD1AFD), SPH_C64(0x4D641F52644DD74D), - SPH_C64(0x92E076E4E092AB92), SPH_C64(0x75BCFA8FBC759F75), - SPH_C64(0x061E36301E060A06), SPH_C64(0x8A98AE24988A838A), - SPH_C64(0xB2404BF940B2CBB2), SPH_C64(0xE659856359E637E6), - SPH_C64(0x0E367E70360E120E), SPH_C64(0x1F63E7F8631F211F), - SPH_C64(0x62F75537F762A662), SPH_C64(0xD4A33AEEA3D461D4), - SPH_C64(0xA832812932A8E5A8), SPH_C64(0x96F452C4F496A796), - SPH_C64(0xF93A629B3AF916F9), SPH_C64(0xC5F6A366F6C552C5), - SPH_C64(0x25B11035B1256F25), SPH_C64(0x5920ABF22059EB59), - SPH_C64(0x84AED054AE849184), SPH_C64(0x72A7C5B7A7729672), - SPH_C64(0x39DDECD5DD394B39), SPH_C64(0x4C61165A614CD44C), - SPH_C64(0x5E3B94CA3B5EE25E), SPH_C64(0x78859FE785788878), - SPH_C64(0x38D8E5DDD8384838), SPH_C64(0x8C869814868C898C), - SPH_C64(0xD1B217C6B2D16ED1), SPH_C64(0xA50BE4410BA5F2A5), - SPH_C64(0xE24DA1434DE23BE2), SPH_C64(0x61F84E2FF861A361), - SPH_C64(0xB34542F145B3C8B3), SPH_C64(0x21A53415A5216321), - SPH_C64(0x9CD60894D69CB99C), SPH_C64(0x1E66EEF0661E221E), - SPH_C64(0x435261225243C543), SPH_C64(0xC7FCB176FCC754C7), - SPH_C64(0xFC2B4FB32BFC19FC), SPH_C64(0x0414242014040C04), - SPH_C64(0x5108E3B20851F351), SPH_C64(0x99C725BCC799B699), - SPH_C64(0x6DC4224FC46DB76D), SPH_C64(0x0D396568390D170D), - SPH_C64(0xFA35798335FA13FA), SPH_C64(0xDF8469B684DF7CDF), - SPH_C64(0x7E9BA9D79B7E827E), SPH_C64(0x24B4193DB4246C24), - SPH_C64(0x3BD7FEC5D73B4D3B), SPH_C64(0xAB3D9A313DABE0AB), - SPH_C64(0xCED1F03ED1CE4FCE), SPH_C64(0x1155998855113311), - SPH_C64(0x8F89830C898F8C8F), SPH_C64(0x4E6B044A6B4ED24E), - SPH_C64(0xB75166D151B7C4B7), SPH_C64(0xEB60E00B60EB20EB), - SPH_C64(0x3CCCC1FDCC3C443C), SPH_C64(0x81BFFD7CBF819E81), - SPH_C64(0x94FE40D4FE94A194), SPH_C64(0xF70C1CEB0CF704F7), - SPH_C64(0xB96718A167B9D6B9), SPH_C64(0x135F8B985F133513), - SPH_C64(0x2C9C517D9C2C742C), SPH_C64(0xD3B805D6B8D368D3), - SPH_C64(0xE75C8C6B5CE734E7), SPH_C64(0x6ECB3957CB6EB26E), - SPH_C64(0xC4F3AA6EF3C451C4), SPH_C64(0x030F1B180F030503), - SPH_C64(0x5613DC8A1356FA56), SPH_C64(0x44495E1A4944CC44), - SPH_C64(0x7F9EA0DF9E7F817F), SPH_C64(0xA937882137A9E6A9), - SPH_C64(0x2A82674D822A7E2A), SPH_C64(0xBB6D0AB16DBBD0BB), - SPH_C64(0xC1E28746E2C15EC1), SPH_C64(0x5302F1A20253F553), - SPH_C64(0xDC8B72AE8BDC79DC), SPH_C64(0x0B275358270B1D0B), - SPH_C64(0x9DD3019CD39DBA9D), SPH_C64(0x6CC12B47C16CB46C), - SPH_C64(0x31F5A495F5315331), SPH_C64(0x74B9F387B9749C74), - SPH_C64(0xF60915E309F607F6), SPH_C64(0x46434C0A4346CA46), - SPH_C64(0xAC26A50926ACE9AC), SPH_C64(0x8997B53C97898689), - SPH_C64(0x1444B4A044143C14), SPH_C64(0xE142BA5B42E13EE1), - SPH_C64(0x164EA6B04E163A16), SPH_C64(0x3AD2F7CDD23A4E3A), - SPH_C64(0x69D0066FD069BB69), SPH_C64(0x092D41482D091B09), - SPH_C64(0x70ADD7A7AD709070), SPH_C64(0xB6546FD954B6C7B6), - SPH_C64(0xD0B71ECEB7D06DD0), SPH_C64(0xED7ED63B7EED2AED), - SPH_C64(0xCCDBE22EDBCC49CC), SPH_C64(0x4257682A5742C642), - SPH_C64(0x98C22CB4C298B598), SPH_C64(0xA40EED490EA4F1A4), - SPH_C64(0x2888755D88287828), SPH_C64(0x5C3186DA315CE45C), - SPH_C64(0xF83F6B933FF815F8), SPH_C64(0x86A4C244A4869786) -}; - -#endif - -static const sph_u64 old1_RC[10] = { - SPH_C64(0x4F01B887E8C62318), - SPH_C64(0x52916F79F5D2A636), - SPH_C64(0x357B0CA38E9BBC60), - SPH_C64(0x57FE4B2EC2D7E01D), - SPH_C64(0xDA4AF09FE5377715), - SPH_C64(0x856BA0B10A29C958), - SPH_C64(0x67053ECBF4105DBD), - SPH_C64(0xD8957DA78B4127E4), - SPH_C64(0x9E4717DD667CEEFB), - SPH_C64(0x33835AAD07BF2DCA) -}; - -/* ====================================================================== */ - -#define DECL8(z) sph_u64 z ## 0, z ## 1, z ## 2, z ## 3, \ - z ## 4, z ## 5, z ## 6, z ## 7 - -#if SPH_LITTLE_FAST -#define READ_DATA_W(x) do { \ - n ## x = sph_dec64le_aligned( \ - (const unsigned char *)src + 8 * (x)); \ - } while (0) -#define UPDATE_STATE_W(x) do { \ - state[x] ^= n ## x ^ sph_dec64le_aligned( \ - (const unsigned char *)src + 8 * (x)); \ - } while (0) -#define LVARS DECL8(n); DECL8(h); -#else -#define READ_DATA_W(x) do { \ - sn ## x = n ## x = sph_dec64le_aligned( \ - (const unsigned char *)src + 8 * (x)); \ - } while (0) -#define UPDATE_STATE_W(x) do { \ - state[x] ^= n ## x ^ sn ## x; \ - } while (0) -#define LVARS DECL8(n); DECL8(sn); DECL8(h); -#endif - -#define READ_STATE_W(x) do { h ## x = state[x]; } while (0) - -#define MUL8(FUN) do { \ - FUN(0); \ - FUN(1); \ - FUN(2); \ - FUN(3); \ - FUN(4); \ - FUN(5); \ - FUN(6); \ - FUN(7); \ - } while (0) - -/* - * First operation: XOR the input data with the first round key. - */ -#define ROUND0_W(x) do { \ - n ## x ^= h ## x; \ - } while (0) - -#define READ_DATA MUL8(READ_DATA_W) -#define READ_STATE MUL8(READ_STATE_W) -#define ROUND0 MUL8(ROUND0_W) -#define UPDATE_STATE MUL8(UPDATE_STATE_W) - -#define BYTE(x, n) ((unsigned)((x) >> (8 * (n))) & 0xFF) - -#if SPH_SMALL_FOOTPRINT_WHIRLPOOL - -static SPH_INLINE sph_u64 -table_skew(sph_u64 val, int num) -{ - return SPH_ROTL64(val, 8 * num); -} - -#define ROUND_ELT(table, in, i0, i1, i2, i3, i4, i5, i6, i7) \ - (table ## 0[BYTE(in ## i0, 0)] \ - ^ table_skew(table ## 0[BYTE(in ## i1, 1)], 1) \ - ^ table_skew(table ## 0[BYTE(in ## i2, 2)], 2) \ - ^ table_skew(table ## 0[BYTE(in ## i3, 3)], 3) \ - ^ table_skew(table ## 0[BYTE(in ## i4, 4)], 4) \ - ^ table_skew(table ## 0[BYTE(in ## i5, 5)], 5) \ - ^ table_skew(table ## 0[BYTE(in ## i6, 6)], 6) \ - ^ table_skew(table ## 0[BYTE(in ## i7, 7)], 7)) -#else -#define ROUND_ELT(table, in, i0, i1, i2, i3, i4, i5, i6, i7) \ - (table ## 0[BYTE(in ## i0, 0)] \ - ^ table ## 1[BYTE(in ## i1, 1)] \ - ^ table ## 2[BYTE(in ## i2, 2)] \ - ^ table ## 3[BYTE(in ## i3, 3)] \ - ^ table ## 4[BYTE(in ## i4, 4)] \ - ^ table ## 5[BYTE(in ## i5, 5)] \ - ^ table ## 6[BYTE(in ## i6, 6)] \ - ^ table ## 7[BYTE(in ## i7, 7)]) -#endif - -#define ROUND(table, in, out, c0, c1, c2, c3, c4, c5, c6, c7) do { \ - out ## 0 = ROUND_ELT(table, in, 0, 7, 6, 5, 4, 3, 2, 1) ^ c0; \ - out ## 1 = ROUND_ELT(table, in, 1, 0, 7, 6, 5, 4, 3, 2) ^ c1; \ - out ## 2 = ROUND_ELT(table, in, 2, 1, 0, 7, 6, 5, 4, 3) ^ c2; \ - out ## 3 = ROUND_ELT(table, in, 3, 2, 1, 0, 7, 6, 5, 4) ^ c3; \ - out ## 4 = ROUND_ELT(table, in, 4, 3, 2, 1, 0, 7, 6, 5) ^ c4; \ - out ## 5 = ROUND_ELT(table, in, 5, 4, 3, 2, 1, 0, 7, 6) ^ c5; \ - out ## 6 = ROUND_ELT(table, in, 6, 5, 4, 3, 2, 1, 0, 7) ^ c6; \ - out ## 7 = ROUND_ELT(table, in, 7, 6, 5, 4, 3, 2, 1, 0) ^ c7; \ - } while (0) - -#define ROUND_KSCHED(table, in, out, c) \ - ROUND(table, in, out, c, 0, 0, 0, 0, 0, 0, 0) - -#define ROUND_WENC(table, in, key, out) \ - ROUND(table, in, out, key ## 0, key ## 1, key ## 2, \ - key ## 3, key ## 4, key ## 5, key ## 6, key ## 7) - -#define TRANSFER(dst, src) do { \ - dst ## 0 = src ## 0; \ - dst ## 1 = src ## 1; \ - dst ## 2 = src ## 2; \ - dst ## 3 = src ## 3; \ - dst ## 4 = src ## 4; \ - dst ## 5 = src ## 5; \ - dst ## 6 = src ## 6; \ - dst ## 7 = src ## 7; \ - } while (0) - -/* see sph_whirlpool.h */ -void -sph_whirlpool_init(void *cc) -{ - sph_whirlpool_context *sc; - - sc = cc; - /* - * We want to set all eight 64-bit words to 0. A "memset()" - * is not, theoretically, fully standard, but in practice it - * will work everywhere. - */ - memset(sc->state, 0, sizeof sc->state); -#if SPH_64 - sc->count = 0; -#else - sc->count_high = sc->count_low = 0; -#endif -} - -#define ROUND_FUN(name, type) \ -static void \ -name ## _round(const void *src, sph_u64 *state) \ -{ \ - LVARS \ - int r; \ - \ - READ_DATA; \ - READ_STATE; \ - ROUND0; \ - for (r = 0; r < 10; r ++) { \ - DECL8(tmp); \ - \ - ROUND_KSCHED(type ## _T, h, tmp, type ## _RC[r]); \ - TRANSFER(h, tmp); \ - ROUND_WENC(type ## _T, n, h, tmp); \ - TRANSFER(n, tmp); \ - } \ - UPDATE_STATE; \ -} - -ROUND_FUN(whirlpool, plain) -ROUND_FUN(whirlpool0, old0) -ROUND_FUN(whirlpool1, old1) - -/* - * We want big-endian encoding of the message length, over 256 bits. BE64 - * triggers that. However, our block length is 512 bits, not 1024 bits. - * Internally, our encoding/decoding is little-endian, which is not a - * problem here since we also deactivate output in md_helper.c. - */ -#define BE64 1 -#define SVAL sc->state -#define BLEN 64U -#define PLW4 1 - -#define RFUN whirlpool_round -#define HASH whirlpool -#include "md_helper.c" -#undef RFUN -#undef HASH - -#define RFUN whirlpool0_round -#define HASH whirlpool0 -#include "md_helper.c" -#undef RFUN -#undef HASH - -#define RFUN whirlpool1_round -#define HASH whirlpool1 -#include "md_helper.c" -#undef RFUN -#undef HASH - -#define MAKE_CLOSE(name) \ -void \ -sph_ ## name ## _close(void *cc, void *dst) \ -{ \ - sph_ ## name ## _context *sc; \ - int i; \ - \ - name ## _close(cc, dst, 0); \ - sc = cc; \ - for (i = 0; i < 8; i ++) \ - sph_enc64le((unsigned char *)dst + 8 * i, sc->state[i]); \ - sph_ ## name ## _init(cc); \ -} - -MAKE_CLOSE(whirlpool) -MAKE_CLOSE(whirlpool0) -MAKE_CLOSE(whirlpool1) - -#ifdef __cplusplus -} -#endif diff --git a/tribus/cuda_echo512_aes.cuh b/tribus/cuda_echo512_aes.cuh deleted file mode 100644 index ff205aae..00000000 --- a/tribus/cuda_echo512_aes.cuh +++ /dev/null @@ -1,318 +0,0 @@ -#ifdef __INTELLISENSE__ -#define __byte_perm(x, y, b) x -#define __CUDA_ARCH__ 520 -#include -#endif - -#undef ROL8 -#undef ROR8 -#undef ROL16 - -#ifdef __CUDA_ARCH__ -__device__ __forceinline__ -uint32_t ROL8(const uint32_t a) { - return __byte_perm(a, 0, 0x2103); -} -__device__ __forceinline__ -uint32_t ROR8(const uint32_t a) { - return __byte_perm(a, 0, 0x0321); -} -__device__ __forceinline__ -uint32_t ROL16(const uint32_t a) { - return __byte_perm(a, 0, 0x1032); -} -#else -#define ROL8(u) ROTL32(u, 8) -#define ROR8(u) ROTR32(u, 8) -#define ROL16(u) ROTL32(u,16) -#endif - -__device__ uint32_t d_AES0[256] = { - 0xA56363C6, 0x847C7CF8, 0x997777EE, 0x8D7B7BF6, 0x0DF2F2FF, 0xBD6B6BD6, 0xB16F6FDE, 0x54C5C591, - 0x50303060, 0x03010102, 0xA96767CE, 0x7D2B2B56, 0x19FEFEE7, 0x62D7D7B5, 0xE6ABAB4D, 0x9A7676EC, - 0x45CACA8F, 0x9D82821F, 0x40C9C989, 0x877D7DFA, 0x15FAFAEF, 0xEB5959B2, 0xC947478E, 0x0BF0F0FB, - 0xECADAD41, 0x67D4D4B3, 0xFDA2A25F, 0xEAAFAF45, 0xBF9C9C23, 0xF7A4A453, 0x967272E4, 0x5BC0C09B, - 0xC2B7B775, 0x1CFDFDE1, 0xAE93933D, 0x6A26264C, 0x5A36366C, 0x413F3F7E, 0x02F7F7F5, 0x4FCCCC83, - 0x5C343468, 0xF4A5A551, 0x34E5E5D1, 0x08F1F1F9, 0x937171E2, 0x73D8D8AB, 0x53313162, 0x3F15152A, - 0x0C040408, 0x52C7C795, 0x65232346, 0x5EC3C39D, 0x28181830, 0xA1969637, 0x0F05050A, 0xB59A9A2F, - 0x0907070E, 0x36121224, 0x9B80801B, 0x3DE2E2DF, 0x26EBEBCD, 0x6927274E, 0xCDB2B27F, 0x9F7575EA, - 0x1B090912, 0x9E83831D, 0x742C2C58, 0x2E1A1A34, 0x2D1B1B36, 0xB26E6EDC, 0xEE5A5AB4, 0xFBA0A05B, - 0xF65252A4, 0x4D3B3B76, 0x61D6D6B7, 0xCEB3B37D, 0x7B292952, 0x3EE3E3DD, 0x712F2F5E, 0x97848413, - 0xF55353A6, 0x68D1D1B9, 0x00000000, 0x2CEDEDC1, 0x60202040, 0x1FFCFCE3, 0xC8B1B179, 0xED5B5BB6, - 0xBE6A6AD4, 0x46CBCB8D, 0xD9BEBE67, 0x4B393972, 0xDE4A4A94, 0xD44C4C98, 0xE85858B0, 0x4ACFCF85, - 0x6BD0D0BB, 0x2AEFEFC5, 0xE5AAAA4F, 0x16FBFBED, 0xC5434386, 0xD74D4D9A, 0x55333366, 0x94858511, - 0xCF45458A, 0x10F9F9E9, 0x06020204, 0x817F7FFE, 0xF05050A0, 0x443C3C78, 0xBA9F9F25, 0xE3A8A84B, - 0xF35151A2, 0xFEA3A35D, 0xC0404080, 0x8A8F8F05, 0xAD92923F, 0xBC9D9D21, 0x48383870, 0x04F5F5F1, - 0xDFBCBC63, 0xC1B6B677, 0x75DADAAF, 0x63212142, 0x30101020, 0x1AFFFFE5, 0x0EF3F3FD, 0x6DD2D2BF, - 0x4CCDCD81, 0x140C0C18, 0x35131326, 0x2FECECC3, 0xE15F5FBE, 0xA2979735, 0xCC444488, 0x3917172E, - 0x57C4C493, 0xF2A7A755, 0x827E7EFC, 0x473D3D7A, 0xAC6464C8, 0xE75D5DBA, 0x2B191932, 0x957373E6, - 0xA06060C0, 0x98818119, 0xD14F4F9E, 0x7FDCDCA3, 0x66222244, 0x7E2A2A54, 0xAB90903B, 0x8388880B, - 0xCA46468C, 0x29EEEEC7, 0xD3B8B86B, 0x3C141428, 0x79DEDEA7, 0xE25E5EBC, 0x1D0B0B16, 0x76DBDBAD, - 0x3BE0E0DB, 0x56323264, 0x4E3A3A74, 0x1E0A0A14, 0xDB494992, 0x0A06060C, 0x6C242448, 0xE45C5CB8, - 0x5DC2C29F, 0x6ED3D3BD, 0xEFACAC43, 0xA66262C4, 0xA8919139, 0xA4959531, 0x37E4E4D3, 0x8B7979F2, - 0x32E7E7D5, 0x43C8C88B, 0x5937376E, 0xB76D6DDA, 0x8C8D8D01, 0x64D5D5B1, 0xD24E4E9C, 0xE0A9A949, - 0xB46C6CD8, 0xFA5656AC, 0x07F4F4F3, 0x25EAEACF, 0xAF6565CA, 0x8E7A7AF4, 0xE9AEAE47, 0x18080810, - 0xD5BABA6F, 0x887878F0, 0x6F25254A, 0x722E2E5C, 0x241C1C38, 0xF1A6A657, 0xC7B4B473, 0x51C6C697, - 0x23E8E8CB, 0x7CDDDDA1, 0x9C7474E8, 0x211F1F3E, 0xDD4B4B96, 0xDCBDBD61, 0x868B8B0D, 0x858A8A0F, - 0x907070E0, 0x423E3E7C, 0xC4B5B571, 0xAA6666CC, 0xD8484890, 0x05030306, 0x01F6F6F7, 0x120E0E1C, - 0xA36161C2, 0x5F35356A, 0xF95757AE, 0xD0B9B969, 0x91868617, 0x58C1C199, 0x271D1D3A, 0xB99E9E27, - 0x38E1E1D9, 0x13F8F8EB, 0xB398982B, 0x33111122, 0xBB6969D2, 0x70D9D9A9, 0x898E8E07, 0xA7949433, - 0xB69B9B2D, 0x221E1E3C, 0x92878715, 0x20E9E9C9, 0x49CECE87, 0xFF5555AA, 0x78282850, 0x7ADFDFA5, - 0x8F8C8C03, 0xF8A1A159, 0x80898909, 0x170D0D1A, 0xDABFBF65, 0x31E6E6D7, 0xC6424284, 0xB86868D0, - 0xC3414182, 0xB0999929, 0x772D2D5A, 0x110F0F1E, 0xCBB0B07B, 0xFC5454A8, 0xD6BBBB6D, 0x3A16162C -}; - -__device__ uint32_t d_AES3[256] = { - 0xC6A56363, 0xF8847C7C, 0xEE997777, 0xF68D7B7B, 0xFF0DF2F2, 0xD6BD6B6B, 0xDEB16F6F, 0x9154C5C5, - 0x60503030, 0x02030101, 0xCEA96767, 0x567D2B2B, 0xE719FEFE, 0xB562D7D7, 0x4DE6ABAB, 0xEC9A7676, - 0x8F45CACA, 0x1F9D8282, 0x8940C9C9, 0xFA877D7D, 0xEF15FAFA, 0xB2EB5959, 0x8EC94747, 0xFB0BF0F0, - 0x41ECADAD, 0xB367D4D4, 0x5FFDA2A2, 0x45EAAFAF, 0x23BF9C9C, 0x53F7A4A4, 0xE4967272, 0x9B5BC0C0, - 0x75C2B7B7, 0xE11CFDFD, 0x3DAE9393, 0x4C6A2626, 0x6C5A3636, 0x7E413F3F, 0xF502F7F7, 0x834FCCCC, - 0x685C3434, 0x51F4A5A5, 0xD134E5E5, 0xF908F1F1, 0xE2937171, 0xAB73D8D8, 0x62533131, 0x2A3F1515, - 0x080C0404, 0x9552C7C7, 0x46652323, 0x9D5EC3C3, 0x30281818, 0x37A19696, 0x0A0F0505, 0x2FB59A9A, - 0x0E090707, 0x24361212, 0x1B9B8080, 0xDF3DE2E2, 0xCD26EBEB, 0x4E692727, 0x7FCDB2B2, 0xEA9F7575, - 0x121B0909, 0x1D9E8383, 0x58742C2C, 0x342E1A1A, 0x362D1B1B, 0xDCB26E6E, 0xB4EE5A5A, 0x5BFBA0A0, - 0xA4F65252, 0x764D3B3B, 0xB761D6D6, 0x7DCEB3B3, 0x527B2929, 0xDD3EE3E3, 0x5E712F2F, 0x13978484, - 0xA6F55353, 0xB968D1D1, 0x00000000, 0xC12CEDED, 0x40602020, 0xE31FFCFC, 0x79C8B1B1, 0xB6ED5B5B, - 0xD4BE6A6A, 0x8D46CBCB, 0x67D9BEBE, 0x724B3939, 0x94DE4A4A, 0x98D44C4C, 0xB0E85858, 0x854ACFCF, - 0xBB6BD0D0, 0xC52AEFEF, 0x4FE5AAAA, 0xED16FBFB, 0x86C54343, 0x9AD74D4D, 0x66553333, 0x11948585, - 0x8ACF4545, 0xE910F9F9, 0x04060202, 0xFE817F7F, 0xA0F05050, 0x78443C3C, 0x25BA9F9F, 0x4BE3A8A8, - 0xA2F35151, 0x5DFEA3A3, 0x80C04040, 0x058A8F8F, 0x3FAD9292, 0x21BC9D9D, 0x70483838, 0xF104F5F5, - 0x63DFBCBC, 0x77C1B6B6, 0xAF75DADA, 0x42632121, 0x20301010, 0xE51AFFFF, 0xFD0EF3F3, 0xBF6DD2D2, - 0x814CCDCD, 0x18140C0C, 0x26351313, 0xC32FECEC, 0xBEE15F5F, 0x35A29797, 0x88CC4444, 0x2E391717, - 0x9357C4C4, 0x55F2A7A7, 0xFC827E7E, 0x7A473D3D, 0xC8AC6464, 0xBAE75D5D, 0x322B1919, 0xE6957373, - 0xC0A06060, 0x19988181, 0x9ED14F4F, 0xA37FDCDC, 0x44662222, 0x547E2A2A, 0x3BAB9090, 0x0B838888, - 0x8CCA4646, 0xC729EEEE, 0x6BD3B8B8, 0x283C1414, 0xA779DEDE, 0xBCE25E5E, 0x161D0B0B, 0xAD76DBDB, - 0xDB3BE0E0, 0x64563232, 0x744E3A3A, 0x141E0A0A, 0x92DB4949, 0x0C0A0606, 0x486C2424, 0xB8E45C5C, - 0x9F5DC2C2, 0xBD6ED3D3, 0x43EFACAC, 0xC4A66262, 0x39A89191, 0x31A49595, 0xD337E4E4, 0xF28B7979, - 0xD532E7E7, 0x8B43C8C8, 0x6E593737, 0xDAB76D6D, 0x018C8D8D, 0xB164D5D5, 0x9CD24E4E, 0x49E0A9A9, - 0xD8B46C6C, 0xACFA5656, 0xF307F4F4, 0xCF25EAEA, 0xCAAF6565, 0xF48E7A7A, 0x47E9AEAE, 0x10180808, - 0x6FD5BABA, 0xF0887878, 0x4A6F2525, 0x5C722E2E, 0x38241C1C, 0x57F1A6A6, 0x73C7B4B4, 0x9751C6C6, - 0xCB23E8E8, 0xA17CDDDD, 0xE89C7474, 0x3E211F1F, 0x96DD4B4B, 0x61DCBDBD, 0x0D868B8B, 0x0F858A8A, - 0xE0907070, 0x7C423E3E, 0x71C4B5B5, 0xCCAA6666, 0x90D84848, 0x06050303, 0xF701F6F6, 0x1C120E0E, - 0xC2A36161, 0x6A5F3535, 0xAEF95757, 0x69D0B9B9, 0x17918686, 0x9958C1C1, 0x3A271D1D, 0x27B99E9E, - 0xD938E1E1, 0xEB13F8F8, 0x2BB39898, 0x22331111, 0xD2BB6969, 0xA970D9D9, 0x07898E8E, 0x33A79494, - 0x2DB69B9B, 0x3C221E1E, 0x15928787, 0xC920E9E9, 0x8749CECE, 0xAAFF5555, 0x50782828, 0xA57ADFDF, - 0x038F8C8C, 0x59F8A1A1, 0x09808989, 0x1A170D0D, 0x65DABFBF, 0xD731E6E6, 0x84C64242, 0xD0B86868, - 0x82C34141, 0x29B09999, 0x5A772D2D, 0x1E110F0F, 0x7BCBB0B0, 0xA8FC5454, 0x6DD6BBBB, 0x2C3A1616 -}; - -__device__ __forceinline__ -void aes_gpu_init_mt_256(uint32_t sharedMemory[4][256]) -{ - /* each thread startup will fill a uint32 */ - if (threadIdx.x < 256) { - uint32_t temp = __ldg(&d_AES0[threadIdx.x]); - sharedMemory[0][threadIdx.x] = temp; - sharedMemory[1][threadIdx.x] = ROL8(temp); - sharedMemory[2][threadIdx.x] = ROL16(temp); - sharedMemory[3][threadIdx.x] = ROR8(temp); - } -} - -__device__ __forceinline__ -void aes_gpu_init256(uint32_t sharedMemory[4][256]) -{ - /* each thread startup will fill a uint32 */ - uint32_t temp = __ldg(&d_AES0[threadIdx.x]); - sharedMemory[0][threadIdx.x] = temp; - sharedMemory[1][threadIdx.x] = ROL8(temp); - sharedMemory[2][threadIdx.x] = ROL16(temp); - sharedMemory[3][threadIdx.x] = ROR8(temp); -} - -__device__ __forceinline__ -void aes_gpu_init128(uint32_t sharedMemory[4][256]) -{ - /* each thread startup will fill 2 uint32 */ - uint2 temp = __ldg(&((uint2*)&d_AES0)[threadIdx.x]); - - sharedMemory[0][(threadIdx.x << 1) + 0] = temp.x; - sharedMemory[0][(threadIdx.x << 1) + 1] = temp.y; - sharedMemory[1][(threadIdx.x << 1) + 0] = ROL8(temp.x); - sharedMemory[1][(threadIdx.x << 1) + 1] = ROL8(temp.y); - sharedMemory[2][(threadIdx.x << 1) + 0] = ROL16(temp.x); - sharedMemory[2][(threadIdx.x << 1) + 1] = ROL16(temp.y); - sharedMemory[3][(threadIdx.x << 1) + 0] = ROR8(temp.x); - sharedMemory[3][(threadIdx.x << 1) + 1] = ROR8(temp.y); -} - -__device__ __forceinline__ -void aes_gpu_init_lt_256(uint32_t sharedMemory[4][256]) -{ - if (threadIdx.x < 128) { - /* each thread startup will fill 2 uint32 */ - uint2 temp = __ldg(&((uint2*)&d_AES0)[threadIdx.x]); - - sharedMemory[0][(threadIdx.x << 1) + 0] = temp.x; - sharedMemory[0][(threadIdx.x << 1) + 1] = temp.y; - sharedMemory[1][(threadIdx.x << 1) + 0] = ROL8(temp.x); - sharedMemory[1][(threadIdx.x << 1) + 1] = ROL8(temp.y); - sharedMemory[2][(threadIdx.x << 1) + 0] = ROL16(temp.x); - sharedMemory[2][(threadIdx.x << 1) + 1] = ROL16(temp.y); - sharedMemory[3][(threadIdx.x << 1) + 0] = ROR8(temp.x); - sharedMemory[3][(threadIdx.x << 1) + 1] = ROR8(temp.y); - } -} - -__device__ __forceinline__ -static void aes_round(const uint32_t sharedMemory[4][256], const uint32_t x0, const uint32_t x1, const uint32_t x2, const uint32_t x3, - const uint32_t k0, uint32_t &y0, uint32_t &y1, uint32_t &y2, uint32_t &y3) -{ - y0 = __ldg(&d_AES0[__byte_perm(x0, 0, 0x4440)]); - y3 = sharedMemory[1][__byte_perm(x0, 0, 0x4441)]; - y2 = sharedMemory[2][__byte_perm(x0, 0, 0x4442)]; - y1 = __ldg(&d_AES3[__byte_perm(x0, 0, 0x4443)]); - - y1 ^= sharedMemory[0][__byte_perm(x1, 0, 0x4440)]; - y0 ^= sharedMemory[1][__byte_perm(x1, 0, 0x4441)]; - y3 ^= sharedMemory[2][__byte_perm(x1, 0, 0x4442)]; -#ifdef INTENSIVE_GMF - y2 ^= __ldg(&d_AES3[__byte_perm(x1, 0, 0x4443)]); -#else - y2 ^= sharedMemory[3][__byte_perm(x1, 0, 0x4443)]; -#endif - - y0 ^= k0; - - y2 ^= __ldg(&d_AES0[__byte_perm(x2, 0, 0x4440)]); - y1 ^= sharedMemory[1][__byte_perm(x2, 0, 0x4441)]; - y0 ^= sharedMemory[2][__byte_perm(x2, 0, 0x4442)]; - y3 ^= __ldg(&d_AES3[__byte_perm(x2, 0, 0x4443)]); - - y3 ^= sharedMemory[0][__byte_perm(x3, 0, 0x4440)]; - y2 ^= sharedMemory[1][__byte_perm(x3, 0, 0x4441)]; - y1 ^= sharedMemory[2][__byte_perm(x3, 0, 0x4442)]; - y0 ^= __ldg(&d_AES3[__byte_perm(x3, 0, 0x4443)]); -} - -__device__ __forceinline__ -static void aes_round_LDG(const uint32_t sharedMemory[4][256], const uint32_t x0, const uint32_t x1, const uint32_t x2, const uint32_t x3, - const uint32_t k0, uint32_t &y0, uint32_t &y1, uint32_t &y2, uint32_t &y3) -{ - y0 = __ldg(&d_AES0[__byte_perm(x0, 0, 0x4440)]); - y3 = sharedMemory[1][__byte_perm(x0, 0, 0x4441)]; - y2 = sharedMemory[2][__byte_perm(x0, 0, 0x4442)]; - y1 = __ldg(&d_AES3[__byte_perm(x0, 0, 0x4443)]); - - y1 ^= sharedMemory[0][__byte_perm(x1, 0, 0x4440)]; - y0 ^= sharedMemory[1][__byte_perm(x1, 0, 0x4441)]; - y3 ^= sharedMemory[2][__byte_perm(x1, 0, 0x4442)]; - y2 ^= __ldg(&d_AES3[__byte_perm(x1, 0, 0x4443)]); - - y0 ^= k0; - - y2 ^= __ldg(&d_AES0[__byte_perm(x2, 0, 0x4440)]); - y1 ^= sharedMemory[1][__byte_perm(x2, 0, 0x4441)]; - y0 ^= sharedMemory[2][__byte_perm(x2, 0, 0x4442)]; - y3 ^= __ldg(&d_AES3[__byte_perm(x2, 0, 0x4443)]); - - y3 ^= __ldg(&d_AES0[__byte_perm(x3, 0, 0x4440)]); - y2 ^= sharedMemory[1][__byte_perm(x3, 0, 0x4441)]; - y1 ^= sharedMemory[2][__byte_perm(x3, 0, 0x4442)]; - y0 ^= __ldg(&d_AES3[__byte_perm(x3, 0, 0x4443)]); -} - -__device__ __forceinline__ -static void aes_round(const uint32_t sharedMemory[4][256], const uint32_t x0, const uint32_t x1, const uint32_t x2, const uint32_t x3, - uint32_t &y0, uint32_t &y1, uint32_t &y2, uint32_t &y3) -{ - y0 = sharedMemory[0][__byte_perm(x0, 0, 0x4440)]; - y3 = sharedMemory[1][__byte_perm(x0, 0, 0x4441)]; - y2 = sharedMemory[2][__byte_perm(x0, 0, 0x4442)]; - y1 = __ldg(&d_AES3[__byte_perm(x0, 0, 0x4443)]); - -#ifdef INTENSIVE_GMF - y1 ^= __ldg(&d_AES0[__byte_perm(x1, 0, 0x4440)]); -#else - y1 ^= sharedMemory[0][__byte_perm(x1, 0, 0x4440)]; -#endif - y0 ^= sharedMemory[1][__byte_perm(x1, 0, 0x4441)]; - y3 ^= sharedMemory[2][__byte_perm(x1, 0, 0x4442)]; - y2 ^= __ldg(&d_AES3[__byte_perm(x1, 0, 0x4443)]); - - y2 ^= sharedMemory[0][__byte_perm(x2, 0, 0x4440)]; - y1 ^= sharedMemory[1][__byte_perm(x2, 0, 0x4441)]; - y0 ^= sharedMemory[2][__byte_perm(x2, 0, 0x4442)]; - y3 ^= __ldg(&d_AES3[__byte_perm(x2, 0, 0x4443)]); - - y3 ^= sharedMemory[0][__byte_perm(x3, 0, 0x4440)]; - y2 ^= sharedMemory[1][__byte_perm(x3, 0, 0x4441)]; - y1 ^= sharedMemory[2][__byte_perm(x3, 0, 0x4442)]; - y0 ^= __ldg(&d_AES3[__byte_perm(x3, 0, 0x4443)]); -} - -__device__ __forceinline__ -static void aes_round_LDG(const uint32_t sharedMemory[4][256], const uint32_t x0, const uint32_t x1, const uint32_t x2, const uint32_t x3, - uint32_t &y0, uint32_t &y1, uint32_t &y2, uint32_t &y3) -{ - y0 = sharedMemory[0][__byte_perm(x0, 0, 0x4440)]; - y3 = sharedMemory[1][__byte_perm(x0, 0, 0x4441)]; - y2 = sharedMemory[2][__byte_perm(x0, 0, 0x4442)]; - y1 = __ldg(&d_AES3[__byte_perm(x0, 0, 0x4443)]); - - y1 ^= __ldg(&d_AES0[__byte_perm(x1, 0, 0x4440)]); - y0 ^= sharedMemory[1][__byte_perm(x1, 0, 0x4441)]; - y3 ^= sharedMemory[2][__byte_perm(x1, 0, 0x4442)]; - y2 ^= __ldg(&d_AES3[__byte_perm(x1, 0, 0x4443)]); - - y2 ^= sharedMemory[0][__byte_perm(x2, 0, 0x4440)]; - y1 ^= sharedMemory[1][__byte_perm(x2, 0, 0x4441)]; - y0 ^= sharedMemory[2][__byte_perm(x2, 0, 0x4442)]; - y3 ^= __ldg(&d_AES3[__byte_perm(x2, 0, 0x4443)]); - - y3 ^= sharedMemory[0][__byte_perm(x3, 0, 0x4440)]; - y2 ^= sharedMemory[1][__byte_perm(x3, 0, 0x4441)]; - y1 ^= sharedMemory[2][__byte_perm(x3, 0, 0x4442)]; - y0 ^= __ldg(&d_AES3[__byte_perm(x3, 0, 0x4443)]); -} - -__device__ __forceinline__ -static void AES_2ROUND(const uint32_t sharedMemory[4][256], uint32_t &x0, uint32_t &x1, uint32_t &x2, uint32_t &x3, uint32_t &k0) -{ - uint32_t y0, y1, y2, y3; - - aes_round(sharedMemory, x0, x1, x2, x3, k0, y0, y1, y2, y3); - - aes_round(sharedMemory, y0, y1, y2, y3, x0, x1, x2, x3); - - // hier werden wir ein carry brauchen (oder auch nicht) - k0++; -} - -__device__ __forceinline__ -static void AES_2ROUND_LDG(const uint32_t sharedMemory[4][256], uint32_t &x0, uint32_t &x1, uint32_t &x2, uint32_t &x3, uint32_t &k0) -{ - uint32_t y0, y1, y2, y3; - - aes_round_LDG(sharedMemory, x0, x1, x2, x3, k0, y0, y1, y2, y3); - - aes_round_LDG(sharedMemory, y0, y1, y2, y3, x0, x1, x2, x3); - - // hier werden wir ein carry brauchen (oder auch nicht) - k0++; -} - -__device__ __forceinline__ -static void AES_ROUND_NOKEY(const uint32_t sharedMemory[4][256], uint4* x) -{ - uint32_t y0, y1, y2, y3; - aes_round(sharedMemory, x->x, x->y, x->z, x->w, y0, y1, y2, y3); - - x->x = y0; - x->y = y1; - x->z = y2; - x->w = y3; -} - -__device__ __forceinline__ -static void KEY_EXPAND_ELT(const uint32_t sharedMemory[4][256], uint32_t *k) -{ - uint32_t y0, y1, y2, y3; - aes_round(sharedMemory, k[0], k[1], k[2], k[3], y0, y1, y2, y3); - - k[0] = y1; - k[1] = y2; - k[2] = y3; - k[3] = y0; -} diff --git a/tribus/cuda_echo512_final.cu b/tribus/cuda_echo512_final.cu deleted file mode 100644 index b68a9c6e..00000000 --- a/tribus/cuda_echo512_final.cu +++ /dev/null @@ -1,285 +0,0 @@ -/** - * Based on Provos Alexis work - 2016 FOR SM 5+ - * - * final touch by tpruvot for tribus - 09 2017 - */ -#include -#include -#include - -#define INTENSIVE_GMF -#include "tribus/cuda_echo512_aes.cuh" - -#ifdef __INTELLISENSE__ -#define __byte_perm(x, y, b) x -#define atomicExch(p,y) (*p) = y -#endif - -__device__ -static void echo_round(const uint32_t sharedMemory[4][256], uint32_t *W, uint32_t &k0) -{ - // Big Sub Words - #pragma unroll 16 - for (int idx = 0; idx < 16; idx++) - AES_2ROUND(sharedMemory,W[(idx<<2) + 0], W[(idx<<2) + 1], W[(idx<<2) + 2], W[(idx<<2) + 3], k0); - - // Shift Rows - #pragma unroll 4 - for (int i = 0; i < 4; i++) - { - uint32_t t[4]; - /// 1, 5, 9, 13 - t[0] = W[i + 4]; - t[1] = W[i + 8]; - t[2] = W[i + 24]; - t[3] = W[i + 60]; - - W[i + 4] = W[i + 20]; - W[i + 8] = W[i + 40]; - W[i + 24] = W[i + 56]; - W[i + 60] = W[i + 44]; - - W[i + 20] = W[i + 36]; - W[i + 40] = t[1]; - W[i + 56] = t[2]; - W[i + 44] = W[i + 28]; - - W[i + 28] = W[i + 12]; - W[i + 12] = t[3]; - W[i + 36] = W[i + 52]; - W[i + 52] = t[0]; - } - // Mix Columns - #pragma unroll 4 - for (int i = 0; i < 4; i++) - { - #pragma unroll 4 - for (int idx = 0; idx < 64; idx += 16) - { - uint32_t a[4]; - a[0] = W[idx + i]; - a[1] = W[idx + i + 4]; - a[2] = W[idx + i + 8]; - a[3] = W[idx + i +12]; - - uint32_t ab = a[0] ^ a[1]; - uint32_t bc = a[1] ^ a[2]; - uint32_t cd = a[2] ^ a[3]; - - uint32_t t, t2, t3; - t = (ab & 0x80808080); - t2 = (bc & 0x80808080); - t3 = (cd & 0x80808080); - - uint32_t abx = (t >> 7) * 27U ^ ((ab^t) << 1); - uint32_t bcx = (t2 >> 7) * 27U ^ ((bc^t2) << 1); - uint32_t cdx = (t3 >> 7) * 27U ^ ((cd^t3) << 1); - - W[idx + i] = bc ^ a[3] ^ abx; - W[idx + i + 4] = a[0] ^ cd ^ bcx; - W[idx + i + 8] = ab ^ a[3] ^ cdx; - W[idx + i +12] = ab ^ a[2] ^ (abx ^ bcx ^ cdx); - } - } -} - -__global__ __launch_bounds__(256, 3) /* will force 80 registers */ -static void tribus_echo512_gpu_final(uint32_t threads, uint64_t *g_hash, uint32_t* resNonce, const uint64_t target) -{ - __shared__ uint32_t sharedMemory[4][256]; - - aes_gpu_init256(sharedMemory); - - const uint32_t P[48] = { - 0xe7e9f5f5, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af,0xa4213d7e, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, - //8-12 - 0x01425eb8, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af,0x65978b09, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, - //21-25 - 0x2cb6b661, 0x6b23b3b3, 0xcf93a7cf, 0x9d9d3751,0x9ac2dea3, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, - //34-38 - 0x579f9f33, 0xfbfbfbfb, 0xfbfbfbfb, 0xefefd3c7,0xdbfde1dd, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, - 0x34514d9e, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af,0xb134347e, 0xea6f7e7e, 0xbd7731bd, 0x8a8a1968, - 0x14b8a457, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af,0x265f4382, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af - //58-61 - }; - uint32_t k0; - uint32_t h[16]; - - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const uint32_t *hash = (uint32_t*)&g_hash[thread<<3]; - - *(uint2x4*)&h[0] = __ldg4((uint2x4*)&hash[0]); - *(uint2x4*)&h[8] = __ldg4((uint2x4*)&hash[8]); - - uint64_t backup = *(uint64_t*)&h[6]; - - k0 = 512 + 8; - - #pragma unroll 4 - for (uint32_t idx = 0; idx < 16; idx += 4) - AES_2ROUND(sharedMemory,h[idx + 0], h[idx + 1], h[idx + 2], h[idx + 3], k0); - - k0 += 4; - - uint32_t W[64]; - - #pragma unroll 4 - for (uint32_t i = 0; i < 4; i++) - { - uint32_t a = P[i]; - uint32_t b = P[i + 4]; - uint32_t c = h[i + 8]; - uint32_t d = P[i + 8]; - - uint32_t ab = a ^ b; - uint32_t bc = b ^ c; - uint32_t cd = c ^ d; - - uint32_t t = ((a ^ b) & 0x80808080); - uint32_t t2 = ((b ^ c) & 0x80808080); - uint32_t t3 = ((c ^ d) & 0x80808080); - - uint32_t abx = ((t >> 7) * 27U) ^ ((ab^t) << 1); - uint32_t bcx = ((t2 >> 7) * 27U) ^ ((bc^t2) << 1); - uint32_t cdx = ((t3 >> 7) * 27U) ^ ((cd^t3) << 1); - - W[0 + i] = bc ^ d ^ abx; - W[4 + i] = a ^ cd ^ bcx; - W[8 + i] = ab ^ d ^ cdx; - W[12+ i] = abx ^ bcx ^ cdx ^ ab ^ c; - - a = P[12 + i]; - b = h[i + 4]; - c = P[12 + i + 4]; - d = P[12 + i + 8]; - - ab = a ^ b; - bc = b ^ c; - cd = c ^ d; - - t = (ab & 0x80808080); - t2 = (bc & 0x80808080); - t3 = (cd & 0x80808080); - - abx = (t >> 7) * 27U ^ ((ab^t) << 1); - bcx = (t2 >> 7) * 27U ^ ((bc^t2) << 1); - cdx = (t3 >> 7) * 27U ^ ((cd^t3) << 1); - - W[16 + i] = abx ^ bc ^ d; - W[16 + i + 4] = bcx ^ a ^ cd; - W[16 + i + 8] = cdx ^ ab ^ d; - W[16 + i +12] = abx ^ bcx ^ cdx ^ ab ^ c; - - a = h[i]; - b = P[24 + i]; - c = P[24 + i + 4]; - d = P[24 + i + 8]; - - ab = a ^ b; - bc = b ^ c; - cd = c ^ d; - - t = (ab & 0x80808080); - t2 = (bc & 0x80808080); - t3 = (cd & 0x80808080); - - abx = (t >> 7) * 27U ^ ((ab^t) << 1); - bcx = (t2 >> 7) * 27U ^ ((bc^t2) << 1); - cdx = (t3 >> 7) * 27U ^ ((cd^t3) << 1); - - W[32 + i] = abx ^ bc ^ d; - W[32 + i + 4] = bcx ^ a ^ cd; - W[32 + i + 8] = cdx ^ ab ^ d; - W[32 + i +12] = abx ^ bcx ^ cdx ^ ab ^ c; - - a = P[36 + i ]; - b = P[36 + i + 4]; - c = P[36 + i + 8]; - d = h[i + 12]; - - ab = a ^ b; - bc = b ^ c; - cd = c ^ d; - - t = (ab & 0x80808080); - t2 = (bc & 0x80808080); - t3 = (cd & 0x80808080); - - abx = (t >> 7) * 27U ^ ((ab^t) << 1); - bcx = (t2 >> 7) * 27U ^ ((bc^t2) << 1); - cdx = (t3 >> 7) * 27U ^ ((cd^t3) << 1); - - W[48 + i] = abx ^ bc ^ d; - W[48 + i + 4] = bcx ^ a ^ cd; - W[48 + i + 8] = cdx ^ ab ^ d; - W[48 + i +12] = abx ^ bcx ^ cdx ^ ab ^ c; - } - - for (int k = 1; k < 9; k++) - echo_round(sharedMemory,W,k0); - - // Big Sub Words - uint32_t y0, y1, y2, y3; -// AES_2ROUND(sharedMemory,W[ 0], W[ 1], W[ 2], W[ 3], k0); - aes_round(sharedMemory, W[ 0], W[ 1], W[ 2], W[ 3], k0, y0, y1, y2, y3); - aes_round(sharedMemory, y0, y1, y2, y3, W[ 0], W[ 1], W[ 2], W[ 3]); - - aes_round(sharedMemory, W[ 4], W[ 5], W[ 6], W[ 7], k0, y0, y1, y2, y3); - aes_round(sharedMemory, y0, y1, y2, y3, W[ 4], W[ 5], W[ 6], W[ 7]); - aes_round(sharedMemory, W[ 8], W[ 9], W[10], W[11], k0, y0, y1, y2, y3); - aes_round(sharedMemory, y0, y1, y2, y3, W[ 8], W[ 9], W[10], W[11]); - - aes_round(sharedMemory, W[20], W[21], W[22], W[23], k0, y0, y1, y2, y3); - aes_round(sharedMemory, y0, y1, y2, y3, W[20], W[21], W[22], W[23]); - aes_round(sharedMemory, W[28], W[29], W[30], W[31], k0, y0, y1, y2, y3); - aes_round(sharedMemory, y0, y1, y2, y3, W[28], W[29], W[30], W[31]); - - aes_round(sharedMemory, W[32], W[33], W[34], W[35], k0, y0, y1, y2, y3); - aes_round(sharedMemory, y0, y1, y2, y3, W[32], W[33], W[34], W[35]); - aes_round(sharedMemory, W[40], W[41], W[42], W[43], k0, y0, y1, y2, y3); - aes_round(sharedMemory, y0, y1, y2, y3, W[40], W[41], W[42], W[43]); - - aes_round(sharedMemory, W[52], W[53], W[54], W[55], k0, y0, y1, y2, y3); - aes_round(sharedMemory, y0, y1, y2, y3, W[52], W[53], W[54], W[55]); - aes_round(sharedMemory, W[60], W[61], W[62], W[63], k0, y0, y1, y2, y3); - aes_round(sharedMemory, y0, y1, y2, y3, W[60], W[61], W[62], W[63]); - - uint32_t bc = W[22] ^ W[42]; - uint32_t t2 = (bc & 0x80808080); - W[ 6] = (t2 >> 7) * 27U ^ ((bc^t2) << 1); - - bc = W[23] ^ W[43]; - t2 = (bc & 0x80808080); - W[ 7] = (t2 >> 7) * 27U ^ ((bc^t2) << 1); - - bc = W[10] ^ W[54]; - t2 = (bc & 0x80808080); - W[38] = (t2 >> 7) * 27U ^ ((bc^t2) << 1); - - bc = W[11] ^ W[55]; - t2 = (bc & 0x80808080); - W[39] = (t2 >> 7) * 27U ^ ((bc^t2) << 1); - - uint64_t check = backup ^ *(uint64_t*)&W[2] ^ *(uint64_t*)&W[6] ^ *(uint64_t*)&W[10] ^ *(uint64_t*)&W[30] - ^ *(uint64_t*)&W[34] ^ *(uint64_t*)&W[38] ^ *(uint64_t*)&W[42] ^ *(uint64_t*)&W[62]; - - if(check <= target){ - uint32_t tmp = atomicExch(&resNonce[0], thread); - if (tmp != UINT32_MAX) - resNonce[1] = tmp; - } - } -} - -__host__ -void tribus_echo512_final(int thr_id, uint32_t threads, uint32_t *d_hash, uint32_t *d_resNonce, const uint64_t target) -{ - const uint32_t threadsperblock = 256; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - tribus_echo512_gpu_final <<>> (threads, (uint64_t*)d_hash, d_resNonce, target); -} diff --git a/tribus/tribus.cu b/tribus/tribus.cu deleted file mode 100644 index 4516e7d6..00000000 --- a/tribus/tribus.cu +++ /dev/null @@ -1,184 +0,0 @@ -/** - * Tribus Algo for Denarius - * - * tpruvot@github 09 2017 - GPLv3 - * - */ -extern "C" { -#include "sph/sph_jh.h" -#include "sph/sph_keccak.h" -#include "sph/sph_echo.h" -} - -#include "miner.h" -#include "cuda_helper.h" -#include "x11/cuda_x11.h" - -void jh512_setBlock_80(int thr_id, uint32_t *endiandata); -void jh512_cuda_hash_80(const int thr_id, const uint32_t threads, const uint32_t startNounce, uint32_t *d_hash); -void tribus_echo512_final(int thr_id, uint32_t threads, uint32_t *d_hash, uint32_t *d_resNonce, const uint64_t target); - -static uint32_t *d_hash[MAX_GPUS]; -static uint32_t *d_resNonce[MAX_GPUS]; - -// cpu hash - -extern "C" void tribus_hash(void *state, const void *input) -{ - uint8_t _ALIGN(64) hash[64]; - - sph_jh512_context ctx_jh; - sph_keccak512_context ctx_keccak; - sph_echo512_context ctx_echo; - - sph_jh512_init(&ctx_jh); - sph_jh512(&ctx_jh, input, 80); - sph_jh512_close(&ctx_jh, (void*) hash); - - sph_keccak512_init(&ctx_keccak); - sph_keccak512(&ctx_keccak, (const void*) hash, 64); - sph_keccak512_close(&ctx_keccak, (void*) hash); - - sph_echo512_init(&ctx_echo); - sph_echo512(&ctx_echo, (const void*) hash, 64); - sph_echo512_close(&ctx_echo, (void*) hash); - - memcpy(state, hash, 32); -} - -static bool init[MAX_GPUS] = { 0 }; -static bool use_compat_kernels[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_tribus(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t _ALIGN(64) endiandata[20]; - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - - int8_t intensity = is_windows() ? 20 : 23; - uint32_t throughput = cuda_default_throughput(thr_id, 1 << intensity); - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ((uint32_t*)ptarget)[7] = 0x00FF; - - if (!init[thr_id]) - { - int dev_id = device_map[thr_id]; - cudaSetDevice(dev_id); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - quark_jh512_cpu_init(thr_id, throughput); - quark_keccak512_cpu_init(thr_id, throughput); - - cuda_get_arch(thr_id); - use_compat_kernels[thr_id] = (cuda_arch[dev_id] < 500); - if (use_compat_kernels[thr_id]) - x11_echo512_cpu_init(thr_id, throughput); - - // char[64] work space for hashes results - CUDA_SAFE_CALL(cudaMalloc(&d_hash[thr_id], (size_t)64 * throughput)); - CUDA_SAFE_CALL(cudaMalloc(&d_resNonce[thr_id], 2 * sizeof(uint32_t))); - - cuda_check_cpu_init(thr_id, throughput); - init[thr_id] = true; - } - - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - jh512_setBlock_80(thr_id, endiandata); - if (use_compat_kernels[thr_id]) - cuda_check_cpu_setTarget(ptarget); - else - cudaMemset(d_resNonce[thr_id], 0xFF, 2 * sizeof(uint32_t)); - - work->valid_nonces = 0; - - do { - int order = 1; - jh512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); - quark_keccak512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - - if (use_compat_kernels[thr_id]) { - x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - work->nonces[1] = UINT32_MAX; - } else { - tribus_echo512_final(thr_id, throughput, d_hash[thr_id], d_resNonce[thr_id], AS_U64(&ptarget[6])); - cudaMemcpy(&work->nonces[0], d_resNonce[thr_id], 2 * sizeof(uint32_t), cudaMemcpyDeviceToHost); - } - - *hashes_done = pdata[19] - first_nonce + throughput; - - if (work->nonces[0] != UINT32_MAX) - { - uint32_t _ALIGN(64) vhash[8]; - const uint32_t Htarg = ptarget[7]; - const uint32_t startNounce = pdata[19]; - if (!use_compat_kernels[thr_id]) work->nonces[0] += startNounce; - be32enc(&endiandata[19], work->nonces[0]); - tribus_hash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - if (work->nonces[1] != UINT32_MAX) { - work->nonces[1] += startNounce; - be32enc(&endiandata[19], work->nonces[1]); - tribus_hash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - goto out; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - cudaMemset(d_resNonce[thr_id], 0xFF, 2 * sizeof(uint32_t)); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - -out: -// *hashes_done = pdata[19] - first_nonce; - return work->valid_nonces; -} - -// ressources cleanup -extern "C" void free_tribus(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - cudaFree(d_resNonce[thr_id]); - - cuda_check_cpu_free(thr_id); - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/util.cpp b/util.cpp index 6307f036..7d5d485a 100644 --- a/util.cpp +++ b/util.cpp @@ -36,8 +36,6 @@ #include "miner.h" #include "elist.h" -#include "crypto/xmr-rpc.h" - extern pthread_mutex_t stratum_sock_lock; extern pthread_mutex_t stratum_work_lock; extern bool opt_debug_diff; @@ -1320,9 +1318,6 @@ bool stratum_authorize(struct stratum_ctx *sctx, const char *user, const char *p json_error_t err; bool ret = false; - if (sctx->rpc2) - return rpc2_stratum_authorize(sctx, user, pass); - s = (char*)malloc(80 + strlen(user) + strlen(pass)); sprintf(s, "{\"id\": 2, \"method\": \"mining.authorize\", \"params\": [\"%s\", \"%s\"]}", user, pass); @@ -1454,10 +1449,6 @@ static bool stratum_notify(struct stratum_ctx *sctx, json_t *params) get_currentalgo(algo, sizeof(algo)); bool has_claim = !strcasecmp(algo, "lbry"); - if (sctx->is_equihash) { - return equi_stratum_notify(sctx, params); - } - job_id = json_string_value(json_array_get(params, p++)); prevhash = json_string_value(json_array_get(params, p++)); if (has_claim) { @@ -1786,9 +1777,6 @@ static bool stratum_show_message(struct stratum_ctx *sctx, json_t *id, json_t *p json_t *val; bool ret; - if (sctx->is_equihash) - return equi_stratum_show_message(sctx, id, params); - val = json_array_get(params, 0); if (val) applog(LOG_NOTICE, "MESSAGE FROM SERVER: %s", json_string_value(val)); @@ -1863,8 +1851,7 @@ bool stratum_handle_method(struct stratum_ctx *sctx, const char *s) goto out; } if (!strcasecmp(method, "mining.set_target")) { - sctx->is_equihash = true; - ret = equi_stratum_set_target(sctx, params); + //ret = equi_stratum_set_target(sctx, params); goto out; } if (!strcasecmp(method, "mining.set_extranonce")) { @@ -1894,10 +1881,6 @@ bool stratum_handle_method(struct stratum_ctx *sctx, const char *s) ret = stratum_show_message(sctx, id, params); goto out; } - if (sctx->rpc2 && !strcasecmp(method, "job")) { // xmr/bbr - ret = rpc2_stratum_job(sctx, id, params); - goto out; - } if (!ret) { // don't fail = disconnect stratum on unknown (and optional?) methods @@ -2164,181 +2147,9 @@ void print_hash_tests(void) printf(CL_WHT "CPU HASH ON EMPTY BUFFER RESULTS:" CL_N "\n"); - bastionhash(&hash[0], &buf[0]); - printpfx("bastion", hash); - - blake256hash(&hash[0], &buf[0], 8); - printpfx("blakecoin", hash); - - blake256hash(&hash[0], &buf[0], 14); - printpfx("blake", hash); - - blake2s_hash(&hash[0], &buf[0]); - printpfx("blake2s", hash); - - bmw_hash(&hash[0], &buf[0]); - printpfx("bmw", hash); - - c11hash(&hash[0], &buf[0]); - printpfx("c11", hash); - - cryptolight_hash(&hash[0], &buf[0], 76); - printpfx("cryptolight", hash); - - cryptonight_hash(&hash[0], &buf[0], 76); - printpfx("cryptonight", hash); - - memset(buf, 0, 180); - decred_hash(&hash[0], &buf[0]); - printpfx("decred", hash); - - deephash(&hash[0], &buf[0]); - printpfx("deep", hash); - - fresh_hash(&hash[0], &buf[0]); - printpfx("fresh", hash); - - fugue256_hash(&hash[0], &buf[0], 32); - printpfx("fugue256", hash); - - groestlhash(&hash[0], &buf[0]); - printpfx("groestl", hash); - - heavycoin_hash(&hash[0], &buf[0], 32); - printpfx("heavy", hash); - - hmq17hash(&hash[0], &buf[0]); - printpfx("hmq1725", hash); - - hsr_hash(&hash[0], &buf[0]); - printpfx("hsr", hash); - - jha_hash(&hash[0], &buf[0]); - printpfx("jha", hash); - keccak256_hash(&hash[0], &buf[0]); printpfx("keccak", hash); - memset(buf, 0, 128); - lbry_hash(&hash[0], &buf[0]); - printpfx("lbry", hash); - - luffa_hash(&hash[0], &buf[0]); - printpfx("luffa", hash); - - lyra2re_hash(&hash[0], &buf[0]); - printpfx("lyra2", hash); - - lyra2v2_hash(&hash[0], &buf[0]); - printpfx("lyra2v2", hash); - - lyra2Z_hash(&hash[0], &buf[0]); - printpfx("lyra2z", hash); - - myriadhash(&hash[0], &buf[0]); - printpfx("myriad", hash); - - neoscrypt(&hash[0], &buf[0], 80000620); - printpfx("neoscrypt", hash); - - nist5hash(&hash[0], &buf[0]); - printpfx("nist5", hash); - - pentablakehash(&hash[0], &buf[0]); - printpfx("pentablake", hash); - - phihash(&hash[0], &buf[0]); - printpfx("phi", hash); - - polytimos_hash(&hash[0], &buf[0]); - printpfx("polytimos", hash); - - quarkhash(&hash[0], &buf[0]); - printpfx("quark", hash); - - qubithash(&hash[0], &buf[0]); - printpfx("qubit", hash); - - scrypthash(&hash[0], &buf[0]); - printpfx("scrypt", hash); - - scryptjane_hash(&hash[0], &buf[0]); - printpfx("scrypt-jane", hash); - - sha256d_hash(&hash[0], &buf[0]); - printpfx("sha256d", hash); - - sha256t_hash(&hash[0], &buf[0]); - printpfx("sha256t", hash); - - blake2b_hash(&hash[0], &buf[0]); - printpfx("sia", hash); - - sibhash(&hash[0], &buf[0]); - printpfx("sib", hash); - - skeincoinhash(&hash[0], &buf[0]); - printpfx("skein", hash); - - skein2hash(&hash[0], &buf[0]); - printpfx("skein2", hash); - - skunk_hash(&hash[0], &buf[0]); - printpfx("skunk", hash); - - s3hash(&hash[0], &buf[0]); - printpfx("S3", hash); - - timetravel_hash(&hash[0], &buf[0]); - printpfx("timetravel", hash); - - bitcore_hash(&hash[0], &buf[0]); - printpfx("bitcore", hash); - - blake256hash(&hash[0], &buf[0], 8); - printpfx("vanilla", hash); - - tribus_hash(&hash[0], &buf[0]); - printpfx("tribus", hash); - - veltorhash(&hash[0], &buf[0]); - printpfx("veltor", hash); - - wcoinhash(&hash[0], &buf[0]); - printpfx("whirlpool", hash); - - //whirlxHash(&hash[0], &buf[0]); - //printpfx("whirlpoolx", hash); - - x11evo_hash(&hash[0], &buf[0]); - printpfx("x11evo", hash); - - x11hash(&hash[0], &buf[0]); - printpfx("X11", hash); - - x13hash(&hash[0], &buf[0]); - printpfx("X13", hash); - - x14hash(&hash[0], &buf[0]); - printpfx("X14", hash); - - x15hash(&hash[0], &buf[0]); - printpfx("X15", hash); - - x16r_hash(&hash[0], &buf[0]); - printpfx("X16r", hash); - - x16s_hash(&hash[0], &buf[0]); - printpfx("X16s", hash); - - x17hash(&hash[0], &buf[0]); - printpfx("X17", hash); - - //memcpy(buf, zrtest, 80); - zr5hash(&hash[0], &buf[0]); - //zr5hash_pok(&hash[0], (uint32_t*) &buf[0]); - printpfx("ZR5", hash); - printf("\n"); do_gpu_tests(); diff --git a/x11/bitcore.cu b/x11/bitcore.cu deleted file mode 100644 index 78739679..00000000 --- a/x11/bitcore.cu +++ /dev/null @@ -1,439 +0,0 @@ -/** - * Timetravel-10 (bitcore) CUDA implementation - * by tpruvot@github - May 2017 - */ - -#include -#include -#include - -#define HASH_FUNC_BASE_TIMESTAMP 1492973331U -#define HASH_FUNC_COUNT 10 -#define HASH_FUNC_COUNT_PERMUTATIONS 40320U - -extern "C" { -#include "sph/sph_blake.h" -#include "sph/sph_bmw.h" -#include "sph/sph_groestl.h" -#include "sph/sph_skein.h" -#include "sph/sph_jh.h" -#include "sph/sph_keccak.h" -#include "sph/sph_luffa.h" -#include "sph/sph_cubehash.h" -#include "sph/sph_shavite.h" -#include "sph/sph_simd.h" -#if HASH_FUNC_COUNT > 10 -#include "sph/sph_echo.h" -#endif -} - -#include "miner.h" -#include "cuda_helper.h" -#include "cuda_x11.h" - -static uint32_t *d_hash[MAX_GPUS]; - -enum Algo { - BLAKE = 0, - BMW, - GROESTL, - SKEIN, - JH, - KECCAK, - LUFFA, - CUBEHASH, - SHAVITE, - SIMD, -#if HASH_FUNC_COUNT > 10 - ECHO, -#endif - MAX_ALGOS_COUNT -}; - -inline void swap8(uint8_t *a, uint8_t *b) -{ - uint8_t t = *a; - *a = *b; - *b = t; -} - -inline void initPerm(uint8_t n[], int count) -{ - for (int i = 0; i < count; i++) - n[i] = i; -} - -static int nextPerm(uint8_t n[], int count) -{ - int tail, i, j; - - if (count <= 1) - return 0; - - for (i = count - 1; i>0 && n[i - 1] >= n[i]; i--); - tail = i; - - if (tail > 0) { - for (j = count - 1; j>tail && n[j] <= n[tail - 1]; j--); - swap8(&n[tail - 1], &n[j]); - } - - for (i = tail, j = count - 1; i= 10) - sprintf(sptr, "%c", 'A' + (algoList[j] - 10)); - else - sprintf(sptr, "%u", (uint32_t) algoList[j]); - sptr++; - } - *sptr = '\0'; -} - -static __thread uint32_t s_ntime = 0; -static uint32_t s_sequence = UINT32_MAX; -static uint8_t s_firstalgo = 0xFF; -static char hashOrder[HASH_FUNC_COUNT + 1] = { 0 }; - -#define INITIAL_DATE HASH_FUNC_BASE_TIMESTAMP -static inline uint32_t getCurrentAlgoSeq(uint32_t ntime) -{ - // unlike x11evo, the permutation changes often (with ntime) - return (uint32_t) (ntime - INITIAL_DATE) % HASH_FUNC_COUNT_PERMUTATIONS; -} - -// To finish... -static void get_travel_order(uint32_t ntime, char *permstr) -{ - uint32_t seq = getCurrentAlgoSeq(ntime); - if (s_sequence != seq) { - getAlgoString(permstr, seq); - s_sequence = seq; - } -} - -// CPU Hash -extern "C" void bitcore_hash(void *output, const void *input) -{ - uint32_t _ALIGN(64) hash[64/4] = { 0 }; - - sph_blake512_context ctx_blake; - sph_bmw512_context ctx_bmw; - sph_groestl512_context ctx_groestl; - sph_skein512_context ctx_skein; - sph_jh512_context ctx_jh; - sph_keccak512_context ctx_keccak; - sph_luffa512_context ctx_luffa1; - sph_cubehash512_context ctx_cubehash1; - sph_shavite512_context ctx_shavite1; - sph_simd512_context ctx_simd1; -#if HASH_FUNC_COUNT > 10 - sph_echo512_context ctx_echo1; -#endif - - if (s_sequence == UINT32_MAX) { - uint32_t *data = (uint32_t*) input; - const uint32_t ntime = (opt_benchmark || !data[17]) ? (uint32_t) time(NULL) : data[17]; - get_travel_order(ntime, hashOrder); - } - - void *in = (void*) input; - int size = 80; - - const int hashes = (int) strlen(hashOrder); - - for (int i = 0; i < hashes; i++) - { - const char elem = hashOrder[i]; - uint8_t algo = elem >= 'A' ? elem - 'A' + 10 : elem - '0'; - - if (i > 0) { - in = (void*) hash; - size = 64; - } - - switch (algo) { - case BLAKE: - sph_blake512_init(&ctx_blake); - sph_blake512(&ctx_blake, in, size); - sph_blake512_close(&ctx_blake, hash); - break; - case BMW: - sph_bmw512_init(&ctx_bmw); - sph_bmw512(&ctx_bmw, in, size); - sph_bmw512_close(&ctx_bmw, hash); - break; - case GROESTL: - sph_groestl512_init(&ctx_groestl); - sph_groestl512(&ctx_groestl, in, size); - sph_groestl512_close(&ctx_groestl, hash); - break; - case SKEIN: - sph_skein512_init(&ctx_skein); - sph_skein512(&ctx_skein, in, size); - sph_skein512_close(&ctx_skein, hash); - break; - case JH: - sph_jh512_init(&ctx_jh); - sph_jh512(&ctx_jh, in, size); - sph_jh512_close(&ctx_jh, hash); - break; - case KECCAK: - sph_keccak512_init(&ctx_keccak); - sph_keccak512(&ctx_keccak, in, size); - sph_keccak512_close(&ctx_keccak, hash); - break; - case LUFFA: - sph_luffa512_init(&ctx_luffa1); - sph_luffa512(&ctx_luffa1, in, size); - sph_luffa512_close(&ctx_luffa1, hash); - break; - case CUBEHASH: - sph_cubehash512_init(&ctx_cubehash1); - sph_cubehash512(&ctx_cubehash1, in, size); - sph_cubehash512_close(&ctx_cubehash1, hash); - break; - case SHAVITE: - sph_shavite512_init(&ctx_shavite1); - sph_shavite512(&ctx_shavite1, in, size); - sph_shavite512_close(&ctx_shavite1, hash); - break; - case SIMD: - sph_simd512_init(&ctx_simd1); - sph_simd512(&ctx_simd1, in, size); - sph_simd512_close(&ctx_simd1, hash); - break; -#if HASH_FUNC_COUNT > 10 - case ECHO: - sph_echo512_init(&ctx_echo1); - sph_echo512(&ctx_echo1, in, size); - sph_echo512_close(&ctx_echo1, hash); - break; -#endif - } - } - - memcpy(output, hash, 32); -} - -//#define _DEBUG -#define _DEBUG_PREFIX "tt-" -#include "cuda_debug.cuh" - -void quark_blake512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_outputHash, int order); - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_bitcore(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - int intensity = (device_sm[device_map[thr_id]] >= 500 && !is_windows()) ? 20 : 19; - uint32_t throughput = cuda_default_throughput(thr_id, 1U << intensity); // 19=256*256*8; - //if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) pdata[17] = swab32(0x59090909); - - if (opt_debug || s_ntime != pdata[17] || s_sequence == UINT32_MAX) { - uint32_t ntime = swab32(work->data[17]); - get_travel_order(ntime, hashOrder); - s_ntime = pdata[17]; - if (opt_debug && !thr_id) { - applog(LOG_DEBUG, "timetravel10 hash order %s (%08x)", hashOrder, ntime); - } - } - - if (opt_benchmark) - ptarget[7] = 0x5; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - quark_blake512_cpu_init(thr_id, throughput); - quark_bmw512_cpu_init(thr_id, throughput); - quark_groestl512_cpu_init(thr_id, throughput); - quark_skein512_cpu_init(thr_id, throughput); - quark_keccak512_cpu_init(thr_id, throughput); - quark_jh512_cpu_init(thr_id, throughput); - x11_luffa512_cpu_init(thr_id, throughput); - x11_cubehash512_cpu_init(thr_id, throughput); - x11_shavite512_cpu_init(thr_id, throughput); - if (x11_simd512_cpu_init(thr_id, throughput) != 0) { - return 0; - } -#if HASH_FUNC_COUNT > 10 - x11_echo512_cpu_init(thr_id, throughput); -#endif - CUDA_CALL_OR_RET_X(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput), -1); - CUDA_CALL_OR_RET_X(cudaMemset(d_hash[thr_id], 0, (size_t) 64 * throughput), -1); - - cuda_check_cpu_init(thr_id, throughput); - - init[thr_id] = true; - } - - uint32_t endiandata[20]; - for (int k=0; k < 19; k++) - be32enc(&endiandata[k], pdata[k]); - - cuda_check_cpu_setTarget(ptarget); - - const int hashes = (int) strlen(hashOrder); - const char first = hashOrder[0]; - const uint8_t algo80 = first >= 'A' ? first - 'A' + 10 : first - '0'; - if (algo80 != s_firstalgo) { - s_firstalgo = algo80; - } - - // first algo seems locked to blake in bitcore, fine! - quark_blake512_cpu_setBlock_80(thr_id, endiandata); - - do { - // Hash with CUDA - - quark_blake512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); - TRACE("blake80:"); - - for (int i = 1; i < hashes; i++) - { - const char elem = hashOrder[i]; - const uint8_t algo64 = elem >= 'A' ? elem - 'A' + 10 : elem - '0'; - - switch (algo64) { - case BLAKE: - quark_blake512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], i); - TRACE("blake :"); - break; - case BMW: - quark_bmw512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], i); - TRACE("bmw :"); - break; - case GROESTL: - quark_groestl512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], i); - TRACE("groestl:"); - break; - case SKEIN: - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], i); - TRACE("skein :"); - break; - case JH: - quark_jh512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], i); - TRACE("jh512 :"); - break; - case KECCAK: - quark_keccak512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], i); - TRACE("keccak :"); - break; - case LUFFA: - x11_luffa512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], i); - TRACE("luffa :"); - break; - case CUBEHASH: - x11_cubehash512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], i); - TRACE("cube :"); - break; - case SHAVITE: - x11_shavite512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], i); - TRACE("shavite:"); - break; - case SIMD: - x11_simd512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], i); - TRACE("simd :"); - break; -#if HASH_FUNC_COUNT > 10 - case ECHO: - x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], i); - TRACE("echo :"); - break; -#endif - } - } - - *hashes_done = pdata[19] - first_nonce + throughput; - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - if (work->nonces[0] != UINT32_MAX) - { - uint32_t _ALIGN(64) vhash[8]; - const uint32_t Htarg = ptarget[7]; - be32enc(&endiandata[19], work->nonces[0]); - bitcore_hash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - pdata[19] = work->nonces[0]; - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - bitcore_hash(vhash, endiandata); - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - } - pdata[19] = max(pdata[19], work->nonces[1]) + 1; - } - return work->valid_nonces; - } else if (vhash[7] > Htarg) { - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - return 0; -} - -// cleanup -extern "C" void free_bitcore(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - - quark_blake512_cpu_free(thr_id); - quark_groestl512_cpu_free(thr_id); - x11_simd512_cpu_free(thr_id); - - cuda_check_cpu_free(thr_id); - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/x11/c11.cu b/x11/c11.cu deleted file mode 100644 index 8f8f6663..00000000 --- a/x11/c11.cu +++ /dev/null @@ -1,269 +0,0 @@ -extern "C" -{ -#include "sph/sph_blake.h" -#include "sph/sph_bmw.h" -#include "sph/sph_groestl.h" -#include "sph/sph_skein.h" -#include "sph/sph_jh.h" -#include "sph/sph_keccak.h" - -#include "sph/sph_luffa.h" -#include "sph/sph_cubehash.h" -#include "sph/sph_shavite.h" -#include "sph/sph_simd.h" -#include "sph/sph_echo.h" -} - -#include "miner.h" -#include "cuda_helper.h" -#include "cuda_x11.h" - -void tribus_echo512_final(int thr_id, uint32_t threads, uint32_t *d_hash, uint32_t *d_resNonce, const uint64_t target); - -#include -#include - -static uint32_t *d_hash[MAX_GPUS]; -static uint32_t *d_resNonce[MAX_GPUS]; - -// Flax/Chaincoin C11 CPU Hash -extern "C" void c11hash(void *output, const void *input) -{ - unsigned char hash[128] = { 0 }; - - sph_blake512_context ctx_blake; - sph_bmw512_context ctx_bmw; - sph_groestl512_context ctx_groestl; - sph_jh512_context ctx_jh; - sph_keccak512_context ctx_keccak; - sph_skein512_context ctx_skein; - sph_luffa512_context ctx_luffa; - sph_cubehash512_context ctx_cubehash; - sph_shavite512_context ctx_shavite; - sph_simd512_context ctx_simd; - sph_echo512_context ctx_echo; - - sph_blake512_init(&ctx_blake); - sph_blake512 (&ctx_blake, input, 80); - sph_blake512_close(&ctx_blake, (void*) hash); - - sph_bmw512_init(&ctx_bmw); - sph_bmw512 (&ctx_bmw, (const void*) hash, 64); - sph_bmw512_close(&ctx_bmw, (void*) hash); - - sph_groestl512_init(&ctx_groestl); - sph_groestl512 (&ctx_groestl, (const void*) hash, 64); - sph_groestl512_close(&ctx_groestl, (void*) hash); - - sph_jh512_init(&ctx_jh); - sph_jh512 (&ctx_jh, (const void*) hash, 64); - sph_jh512_close(&ctx_jh, (void*) hash); - - sph_keccak512_init(&ctx_keccak); - sph_keccak512 (&ctx_keccak, (const void*) hash, 64); - sph_keccak512_close(&ctx_keccak, (void*) hash); - - sph_skein512_init(&ctx_skein); - sph_skein512 (&ctx_skein, (const void*) hash, 64); - sph_skein512_close(&ctx_skein, (void*) hash); - - sph_luffa512_init(&ctx_luffa); - sph_luffa512 (&ctx_luffa, (const void*) hash, 64); - sph_luffa512_close (&ctx_luffa, (void*) hash); - - sph_cubehash512_init(&ctx_cubehash); - sph_cubehash512 (&ctx_cubehash, (const void*) hash, 64); - sph_cubehash512_close(&ctx_cubehash, (void*) hash); - - sph_shavite512_init(&ctx_shavite); - sph_shavite512 (&ctx_shavite, (const void*) hash, 64); - sph_shavite512_close(&ctx_shavite, (void*) hash); - - sph_simd512_init(&ctx_simd); - sph_simd512 (&ctx_simd, (const void*) hash, 64); - sph_simd512_close(&ctx_simd, (void*) hash); - - sph_echo512_init(&ctx_echo); - sph_echo512 (&ctx_echo, (const void*) hash, 64); - sph_echo512_close(&ctx_echo, (void*) hash); - - memcpy(output, hash, 32); -} - -#ifdef _DEBUG -#define TRACE(algo) { \ - if (max_nonce == 1 && pdata[19] <= 1) { \ - uint32_t* debugbuf = NULL; \ - cudaMallocHost(&debugbuf, 8*sizeof(uint32_t)); \ - cudaMemcpy(debugbuf, d_hash[thr_id], 8*sizeof(uint32_t), cudaMemcpyDeviceToHost); \ - printf("X11 %s %08x %08x %08x %08x...\n", algo, swab32(debugbuf[0]), swab32(debugbuf[1]), \ - swab32(debugbuf[2]), swab32(debugbuf[3])); \ - cudaFreeHost(debugbuf); \ - } \ -} -#else -#define TRACE(algo) {} -#endif - -static bool init[MAX_GPUS] = { 0 }; -static bool use_compat_kernels[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_c11(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - int intensity = (device_sm[device_map[thr_id]] >= 500 && !is_windows()) ? 20 : 19; - uint32_t throughput = cuda_default_throughput(thr_id, 1U << intensity); // 19=256*256*8; - //if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ((uint32_t*)ptarget)[7] = 0x5; - - if (!init[thr_id]) - { - int dev_id = device_map[thr_id]; - cudaSetDevice(dev_id); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - cuda_get_arch(thr_id); - use_compat_kernels[thr_id] = (cuda_arch[dev_id] < 500); - - quark_blake512_cpu_init(thr_id, throughput); - quark_bmw512_cpu_init(thr_id, throughput); - quark_groestl512_cpu_init(thr_id, throughput); - quark_skein512_cpu_init(thr_id, throughput); - quark_keccak512_cpu_init(thr_id, throughput); - quark_jh512_cpu_init(thr_id, throughput); - x11_luffaCubehash512_cpu_init(thr_id, throughput); - x11_shavite512_cpu_init(thr_id, throughput); - if (use_compat_kernels[thr_id]) - x11_echo512_cpu_init(thr_id, throughput); - if (x11_simd512_cpu_init(thr_id, throughput) != 0) { - return 0; - } - CUDA_CALL_OR_RET_X(cudaMalloc(&d_hash[thr_id], 64 * throughput), 0); - CUDA_SAFE_CALL(cudaMalloc(&d_resNonce[thr_id], 2 * sizeof(uint32_t))); - - cuda_check_cpu_init(thr_id, throughput); - - init[thr_id] = true; - } - - uint32_t endiandata[20]; - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - quark_blake512_cpu_setBlock_80(thr_id, endiandata); - if (use_compat_kernels[thr_id]) - cuda_check_cpu_setTarget(ptarget); - else - cudaMemset(d_resNonce[thr_id], 0xFF, 2 * sizeof(uint32_t)); - - do { - int order = 0; - - // Hash with CUDA - quark_blake512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("blake :"); - quark_bmw512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("bmw :"); - quark_groestl512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("groestl:"); - quark_jh512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("jh512 :"); - quark_keccak512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("keccak :"); - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("skein :"); - x11_luffaCubehash512_cpu_hash_64(thr_id, throughput, d_hash[thr_id], order++); - TRACE("luffa+c:"); - x11_shavite512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("shavite:"); - x11_simd512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("simd :"); - - if (use_compat_kernels[thr_id]) { - x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - work->nonces[1] = UINT32_MAX; - } else { - tribus_echo512_final(thr_id, throughput, d_hash[thr_id], d_resNonce[thr_id], AS_U64(&ptarget[6])); - cudaMemcpy(&work->nonces[0], d_resNonce[thr_id], 2 * sizeof(uint32_t), cudaMemcpyDeviceToHost); - } - - *hashes_done = pdata[19] - first_nonce + throughput; - - if (work->nonces[0] != UINT32_MAX) - { - uint32_t _ALIGN(64) vhash[8]; - const uint32_t Htarg = ptarget[7]; - const uint32_t startNounce = pdata[19]; - if (!use_compat_kernels[thr_id]) work->nonces[0] += startNounce; - be32enc(&endiandata[19], work->nonces[0]); - c11hash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - if (work->nonces[1] != UINT32_MAX) { - work->nonces[1] += startNounce; - be32enc(&endiandata[19], work->nonces[1]); - c11hash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - cudaMemset(d_resNonce[thr_id], 0xFF, 2 * sizeof(uint32_t)); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - return 0; -} - -// cleanup -extern "C" void free_c11(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - cudaFree(d_resNonce[thr_id]); - - quark_blake512_cpu_free(thr_id); - quark_groestl512_cpu_free(thr_id); - x11_simd512_cpu_free(thr_id); - - cuda_check_cpu_free(thr_id); - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/x11/cuda_streebog.cu b/x11/cuda_streebog.cu deleted file mode 100644 index d6e3685e..00000000 --- a/x11/cuda_streebog.cu +++ /dev/null @@ -1,1008 +0,0 @@ -/* - * Streebog GOST R 34.10-2012 CUDA implementation. - * - * https://tools.ietf.org/html/rfc6986 - * https://en.wikipedia.org/wiki/Streebog - * - * ==========================(LICENSE BEGIN)============================ - * - * @author Tanguy Pruvot - 2015 - * @author Alexis Provos - 2016 - */ - -// Further improved with shared memory utilization, Provos Alexis, June 2016 - -#include - -#include -#include -#include "neoscrypt/cuda_vectors.h" - -typedef unsigned char uchar; - -//#define FULL_UNROLL - -// Tables for function F -__constant__ uint2 T02[256] = { - {0x5B711FD0,0xE6F87E5C}, {0x0924FA16,0x25837780}, {0x852EA4A8,0xC849E07E}, {0x8F06C16A,0x5B4686A1}, - {0xD77B416E,0x0B32E9A2}, {0x67815C66,0xABDA37A4}, {0x1A686676,0xF61796A8}, {0x6391954B,0xF5DC0B70}, - {0xB7E64BF1,0x4862F38D}, {0x68BD85C5,0xFF5C629A}, {0xFCD75795,0xCB827DA6}, {0x69B9F089,0x66D36DAF}, - {0x483D83B0,0x356C9F74}, {0x238C99A1,0x7CBCECB1}, {0x31C4708D,0x36A702AC}, {0x2FBCDFD6,0x9EB6A8D0}, - {0xE5B3AE37,0x8B19FA51}, {0x8A127D0B,0x9CCFB540}, {0x08208F5A,0xBC0C78B5}, {0x2288ECED,0xE533E384}, - {0x77C15FD2,0xCEC2C7D3}, {0x505D0F5E,0xEC7817B6}, {0x8336871D,0xB94CC2C0}, {0xCB0B04AD,0x8C205DB4}, - {0x28A0892F,0x763C855B}, {0xF6FF3257,0x588D1B79}, {0x4311933E,0x3FECF69E}, {0x803A18C9,0x0FC0D39F}, - {0xF5F3AD83,0xEE010A26}, {0x411979A6,0x10EFE8F4}, {0x7DE93A10,0x5DCDA10C}, {0x1248E92C,0x4A1BEE1D}, - {0x21847339,0x53BFF2DB}, {0xA6A23D09,0xB4F50CCF}, {0xD84798CD,0x5FB4BC9C}, {0x071C56F9,0xE88A2D8B}, - {0x5A756A9C,0x7F777169}, {0xA0BA1EBC,0xC5F02E71}, {0x4215E672,0xA663F9AB}, {0xDE5FBB78,0x2EB19E22}, - {0x2594BA14,0x0DB9CE0F}, {0x97664D84,0x82520E63}, {0x0208EA98,0x2F031E6A}, {0xA1BE6BF0,0x5C7F2144}, - {0xD16362DB,0x7A37CB1C}, {0x4B311C64,0x83E08E2B}, {0xAB960E32,0xCF70479B}, {0xB9DEE71E,0x856BA986}, - {0x7AF56CE9,0xB5478C87}, {0x5F61D6FD,0xB8FE4288}, {0x966238C8,0x1BDD0156}, {0x3EF8A92E,0x62215792}, - {0x114476F8,0xFC97FF42}, {0x56452CEB,0x9D7D3508}, {0xE0A71256,0x4C90C9B0}, {0xFBCB016C,0x2308502D}, - {0xA7A64845,0x2D7A03FA}, {0xBFC6C4AB,0xF46E8B38}, {0xD477DEBA,0xBDBEF8FD}, {0xC8079B79,0x3AAC4CEB}, - {0xE8879D0C,0xF09CB105}, {0xAC8A58CB,0x27FA6A10}, {0x401D0CEA,0x8960E7C1}, {0x4A356928,0x1A6F811E}, - {0x73D196FF,0x90C4FB07}, {0x609D0A9F,0x43501A2F}, {0xC63F3796,0xF7A516E0}, {0xB8DA9252,0x1CE4A6B3}, - {0x38E08A9B,0x1324752C}, {0x3BEC154F,0xA5A86473}, {0x5549B33F,0x2BF12457}, {0x440DC5C7,0xD766DB15}, - {0x9E42B792,0xA7D179E3}, {0x61997FD3,0xDADF151A}, {0xC0271423,0x86A0345E}, {0x6DA939A4,0x38D5517B}, - {0x104003B4,0x6518F077}, {0xA5AEA2DD,0x02791D90}, {0x9C4A5D0A,0x88D26789}, {0x0A2865C2,0x930F66DF}, - {0x4509B08B,0x4EE9D420}, {0x6685292A,0x32553891}, {0xC533A842,0x412907BF}, {0x544DC673,0xB27E2B62}, - {0x6295E007,0x6C530445}, {0x5351908A,0x5AF406E9}, {0xC123616F,0x1F2F3B6B}, {0x5255E5C6,0xC37B09DC}, - {0xB1FE6844,0x3967D133}, {0xF0E711E2,0x298839C7}, {0x1964F9A2,0x409B87F7}, {0xDB4B0719,0xE938ADC3}, - {0xF9C3EBF4,0x0C0B4E47}, {0xD36B8843,0x5534D576}, {0xEB8B02D8,0x4610A05A}, {0x8232F251,0x20C3CDF5}, - {0xBEC2B1E7,0x6DE1840D}, {0xB0FA1D08,0xA0E8DE06}, {0x0D34333B,0x7B854B54}, {0xBCCA5B7F,0x42E29A67}, - {0xC437DD0E,0xD8A6088A}, {0xD943ED81,0xC63BB3A9}, {0x5E65A3B1,0x21714DBD}, {0xB5EEA169,0x6761EDE7}, - {0xD573ABF6,0x2431F7C8}, {0xE1A3671A,0xD51FC685}, {0x0410C92D,0x5E063CD4}, {0x2CB04002,0x283AB98F}, - {0xB2F2F790,0x8FEBC06C}, {0x6FA1D33C,0x17D64F11}, {0xA99EE4AA,0xE07359F1}, {0x74CDC006,0x784ED68C}, - {0xC73B42DA,0x6E2A19D5}, {0x1C7045C3,0x8712B416}, {0xED93216D,0x371582E4}, {0x4939F6FC,0xACE39041}, - {0x86223B7C,0x7EC5F121}, {0x2BAC16FB,0xC0B09404}, {0x9A527EBF,0xF9D74537}, {0xA3B68168,0x737C3F2E}, - {0xBAD278CA,0x33E7B8D9}, {0xC22FFEBB,0xA9A32A34}, {0xFEDFBD0D,0xE48163CC}, {0x6EA5A670,0x8E594024}, - {0x842AD1E4,0x51C6EF4B}, {0x279C508C,0x22BAD065}, {0x18608CEE,0xD91488C2}, {0x1F7CDA17,0x319EA549}, - {0x134C9C60,0xD394E128}, {0x72D5E3B3,0x094BF432}, {0xA4AAD791,0x9BF612A5}, {0xD26FFD0F,0xCCBBDA43}, - {0x946AD250,0x34DE1F3C}, {0x995EE16B,0x4F5B5468}, {0xEA8F7794,0xDF9FAF6F}, {0x70DD092B,0x2648EA58}, - {0x71D97C67,0xBFC7E56D}, {0x4F21D549,0xDDE6B2FF}, {0x3AE86003,0x3C276B46}, {0xAF86C71F,0x91767B4F}, - {0x35D4B9A0,0x68A13E78}, {0x030C9FD4,0xB68C115F}, {0x16582001,0x141DD2C9}, {0xDD5324AC,0x983D8F7D}, - {0xCC175254,0x64AA703F}, {0x8E02B426,0xC2C98994}, {0x9F46C2DE,0x3E5E76D6}, {0x587D8004,0x50746F03}, - {0x9272F1E5,0x45DB3D82}, {0x9B560BF3,0x60584A02}, {0x3FFCDC62,0xFBAE58A7}, {0x6CAD4CE8,0xA15A5E4E}, - {0xCE1FB8CC,0x4BA96E55}, {0xAE82B253,0x08F9747A}, {0xF7FB471B,0xC102144C}, {0xF3EB8E36,0x9F042898}, - {0xF2EFFB7A,0x068B27AD}, {0x8C0A5EBE,0xEDCA97FE}, {0xF4F7D8CF,0x778E0513}, {0xC32B8BF7,0x302C2501}, - {0x175C554D,0x8D92DDFC}, {0x46052F5F,0xF865C57F}, {0xA2B2F424,0xEAF3301B}, {0xBBD60D86,0xAA68B7EC}, - {0x0104754C,0x998F0F35}, {0x00000000,0x00000000}, {0x34D0CCEC,0xF12E314D}, {0x061823B5,0x710522BE}, - {0x30C005C1,0xAF280D99}, {0x5D693C65,0x97FD5CE2}, {0x33CC9A15,0x19A41CC6}, {0xF8C79EB8,0x95844172}, - {0x937684A9,0xDC5432B7}, {0x2490CF58,0x9436C13A}, {0x32C8EF59,0x802B13F3}, {0x7CED4F5C,0xC442AE39}, - {0xE3AB8D82,0xFA1CD8EF}, {0x4D293FD1,0xF2E5AC95}, {0x907A1B7D,0x6AD823E8}, {0x3CF043B6,0x4D2249F8}, - {0x79F9F33D,0x03CB9DD8}, {0x36D82674,0xDE2D2F27}, {0x891EE2DF,0x2A43A41F}, {0x1B6C133A,0x6F98999D}, - {0x3DF436FA,0xD4AD46CD}, {0x269825C0,0xBB35DF50}, {0x813E6D85,0x964FDCAA}, {0x7EE5A5C4,0xEB41B053}, - {0x8B160847,0x0540BA75}, {0xE7BB44AF,0xA41AE43B}, {0xD0671797,0xE3B8C429}, {0xEE9FBEB9,0x819993BB}, - {0xEC975421,0xAE9A8DD1}, {0x917E6E31,0xF3572CDD}, {0xE2AFF8CE,0x6393D7DA}, {0x37DC5338,0x47A22012}, - {0xC903EE35,0xA32343DE}, {0xA89A91E6,0x79FC56C4}, {0xDC5751E0,0x01B28048}, {0xE4B7DB7B,0x1296F564}, - {0x51597A12,0x75F71883}, {0xBDCE2E33,0xDB6D9552}, {0x1D74308F,0x1E9DBB23}, {0xFDD322D9,0x520D7293}, - {0x0C304677,0xE20A4461}, {0xB4EAD425,0xFEEEE2D2}, {0x20800675,0xCA30FDEE}, {0x47015A13,0x61EACA4A}, - {0x87264E30,0xE74AFE14}, {0x7BF119A5,0x2CC883B2}, {0xB3F682DC,0x1664CF59}, {0x1E78AF5B,0xA811AA7C}, - {0x648DC3B2,0x1D5626FB}, {0xDF5BCE34,0xB73E9117}, {0x6AB56F5D,0xD05F7CF0}, {0xCD132718,0xFD257F0A}, - {0x76C52A9E,0x574DC8E6}, {0x2EB8AA9A,0x0739A7E5}, {0x0F3CD9A3,0x5486553E}, {0xAA927B7E,0x56FF48AE}, - {0xAD8E2D87,0xBE756525}, {0xFFDBC841,0x7D0E6CF9}, {0x1450CA99,0x3B1ECCA3}, {0xE983E840,0x6913BE30}, - {0x956EA71C,0xAD511009}, {0x2DB4354E,0xB1B5B6BA}, {0x4E25A005,0x4469BDCA}, {0xCA0F71E1,0x15AF5281}, - {0x8D0E2BF2,0x744598CB}, {0x2AA863B7,0x593F9B31}, {0x29A4FC63,0xEFB38A6E}, {0x4C2D4A9D,0x6B6AA3A0}, - {0xE6BF31E3,0x3D95EB0E}, {0x1554BFD5,0xA291C396}, {0xEF9BCBF5,0x18169C8E}, {0x9D4E2846,0x115D68BC}, - {0xFACF7420,0xBA875F18}, {0xB6E23EBD,0xD1EDFCB8}, {0xF1E364AE,0xB00736F2}, {0x6589B6FE,0x84D929CE}, - {0xDA4F7255,0x70B7A2F6}, {0x5C6D4929,0x0E7253D7}, {0x574159A7,0x04F23A3D}, {0x0B2C108E,0x0A8069EA}, - {0x6BB11A11,0x49D073C5}, {0x39E4FFD7,0x8AAB7A19}, {0x0E38ACEF,0xCD095A0B}, {0x5979F548,0xC9FB6036}, - {0xD67F3422,0x92BDE697}, {0x0514BC61,0xC78933E1}, {0x75C9B54A,0xE1C1D9B9}, {0xCF1BCD80,0xD2266160}, - {0x78FD8671,0x9A4492ED}, {0x881A9793,0xB3CCAB2A}, {0x7FE1D088,0x72CEBF66}, {0x985A9427,0xD6D45B5D}, -}; - -__constant__ uint2 T12[256] = { - {0x8C3F55DE,0xC811A805}, {0x96B50619,0x65F5B431}, {0xD6706E43,0xF74F96B1}, {0xCB43D336,0x859D1E8B}, - {0xCCFA3D84,0x5AAB8A85}, {0xC295FCFD,0xF9C7BF99}, {0xDE4B630F,0xA21FD5A1}, {0x3B8B456D,0xCDB3EF76}, - {0x7CF7C385,0x803F59F8}, {0x5F31913C,0xB27C73BE}, {0x33B04821,0x98E3AC66}, {0x26B8F818,0xBF61674C}, - {0xC4C130C8,0x0FFBC995}, {0x10761A98,0xAAA08620}, {0x210116AA,0x6057F342}, {0x0654CC35,0xF63C760C}, - {0x667D9042,0x2DDB45CC}, {0x4BD40382,0xBCF45A96}, {0xEF3C6F3D,0x68E8A0C3}, {0x69FF73BC,0xA7BD92D2}, - {0x01ED2287,0x290AE202}, {0xE885818F,0xB7DE34CD}, {0xDD61059B,0xD901EEA7}, {0x19A03553,0xD6FA2732}, - {0x74CCCEC9,0xD56F1AE8}, {0x2E83F554,0xEA31245C}, {0xA07BE499,0x7034555D}, {0x56E7BEF7,0xCE26D2AC}, - {0xA5054E38,0xFD161857}, {0x527436D1,0x6A0E7DA4}, {0x1CDE9FF2,0x5BD86A38}, {0x31770C32,0xCAF77562}, - {0xE279C8D0,0xB09AAED9}, {0xC60674DB,0x5DEF1091}, {0x515E5045,0x111046A2}, {0x729802FC,0x23536CE4}, - {0xF5B63CFA,0xC50CBCF7}, {0xCD171F03,0x73A16887}, {0xD9F28DBD,0x7D2941AF}, {0x5A4F3B9D,0x3F5E3EB4}, - {0x1B677140,0x84EEFE36}, {0xE7076271,0x3DB8E3D3}, {0xF20FD248,0x1A3A28F9}, {0xB49E7627,0x7EBC7C75}, - {0xC7EB565C,0x74E5F293}, {0x4F478BA4,0x18DCF59E}, {0xA9ADCB52,0x0C6EF44F}, {0x98DAC760,0xC699812D}, - {0x6E469D0E,0x788B06DC}, {0x7521EC4E,0xFC65F8EA}, {0x9E8E0B55,0x30A5F721}, {0xBCA57B6B,0x2BEC3F65}, - {0xBAF1B75E,0xDDD04969}, {0xE394EA57,0x99904CDB}, {0xE6EA40F6,0x14B201D1}, {0x41284ADD,0xBBB0C082}, - {0xBF8F1DFF,0x50F20463}, {0x93CBACB8,0xE8D7F93B}, {0x477C86E8,0x4D8CB68E}, {0x92268E3F,0xC1DD1B39}, - {0x09D62FCB,0x7C5AA112}, {0xDB35C9AE,0x2F3D98AB}, {0x2BFD5FF5,0x67136956}, {0x36CEE280,0x15C1E16C}, - {0xF8F39B17,0x1D7EB2ED}, {0xB00DFE01,0xDA94D37D}, {0x760B8ADA,0x877BC3EC}, {0xE153AE44,0xCB8495DF}, - {0xB7B410B3,0x05A24773}, {0x3C32ABDF,0x12857B78}, {0x6812513B,0x8EB770D0}, {0xD2E3E665,0x536739B9}, - {0x71B26468,0x584D57E2}, {0xC9849725,0xD789C78F}, {0x7D1AE102,0xA935BBFA}, {0xDFA64188,0x8B1537A3}, - {0xC378DE7A,0xD0CD5D9B}, {0x4D80CFB7,0x4AC82C9A}, {0x83BDB620,0x42777F1B}, {0x1D33BD75,0x72D2883A}, - {0xAB6A8F41,0x5E7A2D4B}, {0xBB1C95D9,0xF4DAAB6B}, {0xFD8D31B6,0x905CFFE7}, {0x119B381F,0x83AA6422}, - {0x42022C49,0xC0AEFB84}, {0x63033AE3,0xA0F908C6}, {0x04938826,0xA428AF08}, {0x1A8A53C7,0xADE41C34}, - {0x77E6A85D,0xAE7121EE}, {0x25929E8C,0xC47F5C4A}, {0x55CDD863,0xB538E9AA}, {0xDAD8EB29,0x06377AA9}, - {0xB3279895,0xA18AE87B}, {0x35E48414,0x6EDFDA6A}, {0x825094A7,0x6B7D9D19}, {0xA4E86CBF,0xD41CFA55}, - {0xEA42C59C,0xE5CAEDC9}, {0x0E6FC179,0xA36C351C}, {0x6FABBF89,0x5181E4DE}, {0x184D17D4,0xFFF0C530}, - {0x84045892,0x9D41EB15}, {0x28D73961,0x1C0D5250}, {0x0CA8856A,0xF178EC18}, {0x8EF811CD,0x9A057101}, - {0x3EF5EFCC,0x4091A27C}, {0x9F6329D2,0x19AF1523}, {0xF91EB990,0x347450EF}, {0x8DD27759,0xE11B4A07}, - {0xFC601331,0xB9561DE5}, {0x2DA993C0,0x912F1F5A}, {0x5BA2191A,0x1654DCB6}, {0x8A6B99EB,0x3E2DDE09}, - {0x0F82E3FE,0x8A66D71E}, {0xD55A08D7,0x8C51ADB7}, {0x8941FF7F,0x4533E50F}, {0xBD4859EC,0x02E6DD67}, - {0x5DF6D52F,0xE068AABA}, {0xFF4A75A5,0xC24826E3}, {0x88ACDDF8,0x6C39070D}, {0x4691A46F,0x6486548C}, - {0x135C7C0C,0xD1BEBD26}, {0x8F15334A,0xB30F9303}, {0xC1BF9A69,0x82D9849F}, {0x5420FAE4,0x9C320BA8}, - {0xAFF90767,0xFA528243}, {0xE968A308,0x9ED4D6CF}, {0x2C44B147,0xB825FD58}, {0x5EDCB3BB,0x9B7691BC}, - {0x48FE6516,0xC7EA6190}, {0x817AF233,0x1063A61F}, {0x3409A693,0x47D53868}, {0x4C6DED30,0x63C2CE98}, - {0x6C81D91D,0x2A9FDFD8}, {0x032A6694,0x7B1E3B06}, {0xFBD9FD83,0x666089EB}, {0x7375207B,0x0A598EE6}, - {0x0AFC495F,0x07449A14}, {0xB6593234,0x2CA8A571}, {0x45BBC2FB,0x1F986F8A}, {0x50B372C2,0x381AA4A0}, - {0xD81FAF3A,0x5423A3AD}, {0x8B86BB6C,0x17273C0B}, {0xC869B5A2,0xFE83258D}, {0xD1C980F1,0x287902BF}, - {0x6B3837AF,0xF5A94BD6}, {0xB2CABA12,0x88800A79}, {0x083B0D4C,0x55504310}, {0x07B9EEB2,0xDF36940E}, - {0x6790B2C5,0x04D1A7CE}, {0xF125B4DC,0x612413FF}, {0xC52C124F,0x26F12B97}, {0xA62F28AC,0x86082351}, - {0x9937E5E7,0xEF93632F}, {0x293A1BE6,0x3507B052}, {0x570A9C70,0xE72C30AE}, {0xAE1425E0,0xD3586041}, - {0xD79D4CC4,0xDE4574B3}, {0x40C5685A,0x92BA2280}, {0xDC8C271C,0xF00B0CA5}, {0xF69C5A6E,0xBE1287F1}, - {0xB1E0DC86,0xF39E317F}, {0x20EC342D,0x495D1140}, {0x3F18CD4B,0x699B407E}, {0x6AD51528,0xDCA3A9D4}, - {0x79896924,0x0D1D14F2}, {0x00000000,0x00000000}, {0xA196C61E,0x593EB75F}, {0x0B116BD8,0x2E4E7816}, - {0x58887F8E,0x6D4AE7B0}, {0x872E3E06,0xE65FD013}, {0xD30EC4E2,0x7A6DDBBB}, {0xCAAEF1B1,0xAC97FC89}, - {0x1E19DBE1,0x09CCB33C}, {0x62EE1864,0x89F3EAC4}, {0xAA87ADC6,0x7770CF49}, {0x6557F6D6,0x56C57ECA}, - {0x6D6CFB9A,0x03953DDA}, {0x4456E07C,0x36928D88}, {0x959F608D,0x1EEB8F37}, {0x4EAAA923,0x31D6179C}, - {0xE5C02662,0x6FAC3AD7}, {0x53991456,0x43049FA6}, {0xC052B8EE,0xABD3669D}, {0xA7C20A2B,0xAF02C153}, - {0x3723C007,0x3CCB036E}, {0x90E1CA2C,0x93C9C23D}, {0x2F6ED7D3,0xC33BC65E}, {0x9758249E,0x4CFF5633}, - {0x325D6AA6,0xB1E94E64}, {0x9472420A,0x37E16D35}, {0xBE623F78,0x79F8E661}, {0x02C74413,0x5214D904}, - {0xF0C8965B,0x482EF1FD}, {0xEC1609A9,0x13F69BC5}, {0x14E592BE,0x0E882928}, {0x2A107D72,0x4E198B54}, - {0xEBAFE71B,0xCCC00FCB}, {0x222B703E,0x1B49C844}, {0xA840E9D5,0x2564164D}, {0x1FF4F966,0x20C6513E}, - {0x910CE8AB,0xBAC3203F}, {0x61C47EF0,0xF2EDD1C2}, {0xACD361F3,0x814CB945}, {0x4A392105,0x95FEB894}, - {0x1622D6AD,0x5C9CF02C}, {0xF77178E9,0x971865F3}, {0x9BF0A1F4,0xBD87BA2B}, {0x59655D09,0x444005B2}, - {0x247FBC0B,0xED75BE48}, {0x17CFF42A,0x7596122E}, {0x85E97A15,0xB44B0917}, {0x2755DA9F,0x966B854E}, - {0x49134791,0xEEE08392}, {0x23C652B9,0x32432A46}, {0xAD3E4374,0xA8465B47}, {0x12B15E8B,0xF8B45F24}, - {0x78644BA3,0x2417F6F0}, {0x7FDDA511,0xFB2162FE}, {0x9DA46DC1,0x4BBBCC27}, {0xD024A276,0x0173E0BD}, - {0xA2BCA08A,0x22208C59}, {0xB836F34D,0x8FC4906D}, {0x3A6667EA,0xE4B90D74}, {0x705F46EF,0x7147B5E0}, - {0x1508B039,0x2782CB2A}, {0xF45B1E7D,0xEC065EF5}, {0xCFD05B10,0x21B5B183}, {0x60295C77,0xDBE733C0}, - {0x394C017E,0x9FA73672}, {0x86C31C81,0xCF553211}, {0x0D45A7ED,0xD8720E1A}, {0x3DDF8958,0x3B8F997A}, - {0xEDFB2B2E,0x3AFC79C7}, {0x43EF0ECE,0xE9A41986}, {0x7B4E2D37,0x5F09CDF6}, {0xFA34DF04,0x4F6A6BE9}, - {0x38A123F9,0xB6ADD470}, {0x057EAAA1,0x8D224D0A}, {0x5C1BF7A8,0xC96248B8}, {0x309A2EB5,0xE3FD9760}, - {0xA351820D,0x0B2A6E5B}, {0xFEA75722,0xEB42C4E1}, {0x9A1D8373,0x948D5829}, {0x64BAD451,0x7FCF9CC8}, - {0xD4B72A50,0xA55B4FB5}, {0xCE3D7997,0x08BF5381}, {0xE42D04E5,0x46A6D8D5}, {0x7E308796,0xD22B80FC}, - {0xB57354A0,0x57B69E77}, {0x8097D0B4,0x3969441D}, {0xF3E2F0CF,0x3330CAFB}, {0xE0BE8CC3,0xE28E77DD}, - {0x9C494F46,0x62B12E25}, {0xB9DBD1CA,0xA6CE726F}, {0xEED14DBA,0x41E242C1}, {0x7AA30FB0,0x76032FF4}, -}; - -__constant__ uint2 T22[256] = { - {0x3ACDE4CC,0x45B268A9}, {0x84549D08,0xAF7F0BE8}, {0xC1468263,0x048354B3}, {0xC80EFED2,0x925435C2}, - {0x7FDFFBA7,0xEE4E37F2}, {0x0C60F14D,0x167A3392}, {0xEA03E584,0xFB123B52}, {0xFDBB9007,0x4A0CAB53}, - {0x0F788A19,0x9DEAF638}, {0x8F0CB32A,0xCB48EC55}, {0xD6FEF7E0,0xB59DC4B2}, {0xF4F3ECB6,0xDCDBCA22}, - {0x549A9C40,0x11DF5813}, {0x568ACED3,0xE33FDEDF}, {0x4322E9C3,0xA0C1C812}, {0x58FA6D0D,0x07A56B81}, - {0xB1E1F3DD,0x77279579}, {0x422AC004,0xD9B18B74}, {0xFFABC294,0xB8EC2D9F}, {0x2D75914F,0xF4ACF8A8}, - {0xEF2B6878,0x7BBF69B1}, {0x487AC7E1,0xC4F62FAF}, {0xC67E5D0C,0x76CE809C}, {0x92E4C14C,0x6711D88F}, - {0x243DEDFE,0x627B99D9}, {0xDFB68B51,0x234AA5C3}, {0x262DBF6D,0x909B1F15}, {0x4B62BCB5,0x4F66EA05}, - {0x52AA6AE8,0x1AE2CF5A}, {0xD0CE0148,0xBEA053FB}, {0xE66314C9,0xED6808C0}, {0x15A82710,0x43FE16CD}, - {0xA06970F6,0xCD049231}, {0x97CC4CB0,0xE7BC8A6C}, {0xFCB3B9C0,0x337CE835}, {0x7CC780F3,0x65DEF258}, - {0x4132BB50,0x52214EDE}, {0x90F493DF,0x95F15E43}, {0x5DD2E0F1,0x87083962}, {0xFB8B66AF,0x41313C1A}, - {0x51B211BC,0x91720AF0}, {0xD4EEA573,0x477D427E}, {0xF6E3BE25,0x2E3B4CEE}, {0xEB0BCC43,0x82627834}, - {0x78E724C8,0x9C03E3DD}, {0xD9867DF9,0x2877328A}, {0xE243B0F2,0x14B51945}, {0xF7EB97E2,0x574B0F88}, - {0x9AA4943A,0x88B6FA98}, {0xCB168586,0x19C4F068}, {0xAF11FAEF,0x50EE6409}, {0xC04EABA4,0x7DF317D5}, - {0x98B4C6A9,0x7A567C54}, {0x4F42188E,0xB6BBFB80}, {0x3BC5CD0B,0x3CC22BCF}, {0xAA397713,0xD04336EA}, - {0xEC33132C,0xF02FAC1B}, {0xF0D3488D,0x2506DBA7}, {0xF2C31A1E,0xD7E65D6B}, {0x1FF820F5,0x5EB9B216}, - {0xC46E0F9F,0x842E0650}, {0x9E843001,0x716BEB1D}, {0xAB315ED4,0xA933758C}, {0xA2792265,0x3FE414FD}, - {0x1EF00932,0x27C9F170}, {0x70A771BE,0x73A4C1CA}, {0xE76B3D0E,0x94184BA6}, {0x8C14C87E,0x40D829FF}, - {0xC77674CB,0x0FBEC3FA}, {0x4A6A9572,0x3616A963}, {0xC25EF937,0x8F139119}, {0x5AEA3F9E,0xF545ED4D}, - {0x50BA387B,0xE8024996}, {0x0B582E22,0x6437E7BD}, {0xE053E261,0xE6559F89}, {0x05288DFC,0x80AD52E3}, - {0xE34B9935,0x6DC55A23}, {0x1AD0AD09,0xDE14E0F5}, {0xA659865E,0xC6390578}, {0x09487CB1,0x96D76171}, - {0x21156002,0xE2D6CB3A}, {0x779FAED1,0x01E915E5}, {0x6A77DCB7,0xADB0213F}, {0xB9A1A6AB,0x9880B76E}, - {0x8644CF9B,0x5D9F8D24}, {0xC5662658,0xFD5E4536}, {0x9BACBDFD,0xF1C6B9FE}, {0xBE9979C4,0xEACD6341}, - {0x08405576,0xEFA72217}, {0xD88E543E,0x510771EC}, {0x671F043D,0xC2BA51CB}, {0x71AF5879,0x0AD482AC}, - {0x5CDAC936,0xFE787A04}, {0x8E049AED,0xB238AF33}, {0x4972EE26,0xBD866CC9}, {0xBD810290,0x615DA6EB}, - {0x8B2C1711,0x3295FDD0}, {0x73BF0AEA,0xF8340460}, {0x758FFC42,0xF3099329}, {0x7DCFA934,0x1CAEB13E}, - {0x1188832B,0xBA230748}, {0x874CE65C,0x24EFCE42}, {0xB0E9DA1A,0x0E57D61F}, {0xF99B343C,0xB3D1BAD6}, - {0x893C4582,0xC0757B1C}, {0x403A9297,0x2B510DB8}, {0xF1DB614A,0x5C7698C1}, {0xD5E68CB4,0x3E0D0118}, - {0x855CB4CF,0xD60F488E}, {0xF3CB33D9,0xAE961E0D}, {0x14A00ED7,0x3A8E55AB}, {0x623789C1,0x42170328}, - {0x9C946292,0x838B6DD1}, {0xED3B3AEB,0x895FEF7D}, {0x4E4A3149,0xCFCBB8E6}, {0x2F65C3DC,0x064C7E64}, - {0x4C5A63DA,0x3D2B3E2A}, {0xA9210C47,0x5BD3F340}, {0xA1615931,0xB474D157}, {0x1DE87266,0xAC5934DA}, - {0x7AF7765B,0x6EE36511}, {0x16B05C44,0xC86ED367}, {0x201D49C5,0x9BA6885C}, {0x88346C45,0xB905387A}, - {0xBAB9DDFF,0x131072C4}, {0xA751AF99,0xBF49461E}, {0x1CE05BA1,0xD52977BC}, {0x6027DB52,0xB0F785E4}, - {0x6E57788C,0x546D30BA}, {0x650F56AE,0x305AD707}, {0x612FF295,0xC987C682}, {0xF5FBC571,0xA5AB8944}, - {0x59F244CA,0x7ED528E7}, {0x2C7DB888,0x8DDCBBCE}, {0x328DB1BA,0xAA154ABE}, {0x93ECE88B,0x1E619BE9}, - {0xE813B717,0x09F2BD9E}, {0x285D1CB3,0x7401AA4B}, {0x3195CAEE,0x21858F14}, {0x1398D1B8,0x48C38184}, - {0xB2F98889,0xFCB750D3}, {0x8D1CE1B9,0x39A86A99}, {0xE473465A,0x1F888E0C}, {0x76978716,0x78995683}, - {0xEE2341BF,0x02CF2AD7}, {0xB3F1A14E,0x85C713B5}, {0x2B4567E7,0xFF916FE1}, {0xB7D10575,0x7C1A0230}, - {0x5ECA9BA5,0x0C98FCC8}, {0xDA9E06AD,0xA3E7F720}, {0xBBB1F438,0x6A6031A2}, {0x7ED7D260,0x973E7494}, - {0x18C0FF9A,0x2CF46639}, {0x68678E24,0x5F50A7F3}, {0xA449D4CD,0x34D983B4}, {0x5592B587,0x68AF1B75}, - {0x2E6DEA1B,0x7F3C3D02}, {0x45121F6B,0xABFC5F5B}, {0x29553574,0x0D71E92D}, {0x6D4F03D8,0xDFFDF510}, - {0x9F8C19C6,0x081BA87B}, {0xAC0981BB,0xDB7EA1A3}, {0x66172DFA,0xBBCA12AD}, {0x010829C7,0x79704366}, - {0x7BFF5F9C,0x17932677}, {0x00000000,0x00000000}, {0xC906D715,0xEB2476A4}, {0x0738DF6F,0x724DD42F}, - {0x38DDB65F,0xB752EE65}, {0x3DF53BA3,0x37FFBC86}, {0xB5C157E6,0x8EFA84FC}, {0x272596AA,0xE9EB5C73}, - {0x2535C439,0x1B0BDABF}, {0x2A4D4E20,0x86E12C87}, {0xCE3E087A,0x9969A28B}, {0x9D9C4B55,0xFAFB2EB7}, - {0xB6D92CB2,0x056A4156}, {0xDEBEA296,0x5A3AE6A5}, {0xA8292580,0x22A3B026}, {0x36AD1581,0x53C85B3B}, - {0x17B87583,0xB11E9001}, {0x3FE56930,0xC51F3A4A}, {0xCF3621BD,0xE019E1ED}, {0x91FCBA18,0xEC811D25}, - {0x4D524A1D,0x445B7D4C}, {0xDCAEF005,0xA8DA6069}, {0x309DE329,0x58F5CC72}, {0x6B7FF570,0xD4C06259}, - {0x39D59F98,0xCE22AD03}, {0x47024DF8,0x591CD997}, {0x03187B54,0x8B90C5AA}, {0xC356D0F0,0xF663D27F}, - {0x35B56ED5,0xD8589E91}, {0xD3D67A1C,0x35309651}, {0xCD26732E,0x12F96721}, {0x441A36AC,0xD28C1C3D}, - {0x64077F69,0x492A9461}, {0x6F5F514B,0x2D1D73DC}, {0x0D68D88A,0x6F0A70F4}, {0xCA1EAC41,0x60B4B30E}, - {0x3385987D,0xD36509D8}, {0x0630F6A8,0x0B3D9749}, {0x96C46577,0x9ECCC90A}, {0xAD01A87C,0xA20EE2C5}, - {0x0E70A3DE,0xE49AB55E}, {0x82646BA0,0xA4429CA1}, {0xDB962F6A,0xDA97B446}, {0xD7F6DE27,0xCCED87D4}, - {0x37A53C46,0x2AB8185D}, {0xE15BCBA6,0x9F25DCEF}, {0xFEA3EB53,0xC19C6EF9}, {0x1BD884CE,0xA764A393}, - {0x817C10F4,0x2FD2590B}, {0x80743933,0x56A21A6D}, {0x79EF0D0F,0xE573A0BB}, {0x95DC1E23,0x155C0CA0}, - {0x94D437E4,0x6C2C4FC6}, {0x23053291,0x10364DF6}, {0x836C4267,0xDD32DFC7}, {0x99BCEF6E,0x03263F32}, - {0xE57B6F9D,0x66F8CD6A}, {0x5BE21659,0x8C35AE2B}, {0x1290F87F,0x31B3C2E2}, {0xBF915003,0x93BD2027}, - {0x220D1B56,0x69460E90}, {0xAE19D328,0x299E276F}, {0x53A2432F,0x63928C3C}, {0xE91B9ED0,0x7082FEF8}, - {0x3EED40F7,0xBC6F792C}, {0xD2DE53DB,0x4C40D537}, {0x5FC2B262,0x75E8BFAE}, {0xA541FD0A,0x4DA9C0D2}, - {0x3CFD1264,0x4E8FFFE0}, {0x696FA7E3,0x2620E495}, {0xB8A98F6C,0xE1F0F408}, {0xDDA6D9C2,0xD1AA230F}, - {0xD1C6288F,0xC7D0109D}, {0x7487D585,0x8A79D04F}, {0xA3710BA2,0x4694579B}, {0xFA834F68,0x38417F7C}, - {0x0A5007E5,0x1D47A4DB}, {0x460A643F,0x206C9AF1}, {0x34BD4712,0xA128DDF7}, {0x72B7232D,0x81444706}, - {0x02105293,0xF2E086CC}, {0xBC892B57,0x182DE58D}, {0xF8931DFB,0xCAA1F9B0}, {0xCC2E5AE9,0x6B892447}, - {0x0420A43B,0xF9DD1185}, {0x8A243ED6,0x4BE5BEB6}, {0x19C8D65D,0x5584255F}, {0x633FA006,0x3B67404E}, - {0x6C472A1F,0xA68DB676}, {0xB4C97E21,0xF78AC79A}, {0x1080AAEC,0xC353442E}, {0x5782E714,0x9A4F9DB9}, -}; - -__constant__ uint2 T32[256] = { - {0x2C9B3220,0x05BA7BC8}, {0xF8B65E4F,0x31A54665}, {0x7547F4D4,0xB1B651F7}, {0x7BA46682,0x8BFA0D85}, - {0xA16A98BB,0x85A96C5A}, {0x08EB79C9,0x990FAEF9}, {0x47F4A62D,0xA15E37A2}, {0x5D27741E,0x76857DCD}, - {0x0A1820BC,0xF8C50B80}, {0x01F7A2B4,0xBE65DCB2}, {0x6F9426E7,0x666D1B98}, {0x53C4E648,0x4CC921BF}, - {0x93D9CA42,0x95410A0F}, {0x647BA4EF,0x20CDCCAA}, {0x890A1871,0x429A4060}, {0x9B32B38B,0x0C4EA4F6}, - {0xDE354CD3,0xCCDA362D}, {0x7C5B2FA9,0x96DC23BC}, {0xAA851AB3,0xC309BB68}, {0x3648E013,0xD26131A7}, - {0x41FC4DB2,0x021DC529}, {0x704BE48A,0xCD5ADAB7}, {0x84ED71E6,0xA77965D9}, {0x1734BBA4,0x32386FD6}, - {0x38AB7245,0xE82D6DD5}, {0x6177B4B1,0x5C2147EA}, {0xCF091CE8,0x5DA1AB70}, {0x72B8BDFF,0xAC907FCE}, - {0x972278A8,0x57C85DFD}, {0x6B6F940D,0xA4E44C6A}, {0x4F1FDFE4,0x3851995B}, {0xED71BC9E,0x62578CCA}, - {0xC01D2C0A,0xD9882BB0}, {0x113C503B,0x917B9D5D}, {0xA87643C6,0xA2C31E11}, {0xA399C1CE,0xE463C923}, - {0x7EA876DC,0xF71686C5}, {0xE096D509,0x87B4A973}, {0x9D3A5814,0xAF0D567D}, {0x59DCC6F4,0xB40C2A3F}, - {0x95D121DD,0x3602F884}, {0x9836484A,0xD3E1DD3D}, {0xA46688E5,0xF945E71A}, {0xB2A591F5,0x7518547E}, - {0x50C01D89,0x93665874}, {0x658C065B,0x9EA81018}, {0xBC4603A3,0x4F54080C}, {0x5137BF3D,0x2D0384C6}, - {0xEC861E2A,0xDC325078}, {0x79573FF7,0xEA30A8FC}, {0xCA050CB6,0x214D2030}, {0x8016C30C,0x65F0322B}, - {0x1B247087,0x69BE96DD}, {0x81E161B8,0xDB95EE99}, {0xD9CA05F8,0xD1FC1814}, {0xCC0DE729,0x820ED2BB}, - {0x430F14C7,0x63D76050}, {0xA09D3A0F,0x3BCCB0E8}, {0x573F54A2,0x8E40764D}, {0xE16177BD,0x39D175C1}, - {0x734F1F4B,0x12F5A37C}, {0x1FDFC26D,0xAB37C12F}, {0x395CD0F1,0x5648B167}, {0x37BF42A7,0x6C04ED15}, - {0x14304065,0xED97161D}, {0xAB72B807,0x7D6C67DA}, {0xBA4EE83C,0xEC17FA87}, {0x0304FBC1,0xDFAF79CB}, - {0x71BC463E,0x733F0605}, {0x87E98A27,0x78D61C12}, {0x77B4ADA1,0xD07CF48E}, {0x6C90DD26,0xB9C26253}, - {0x60801605,0xE2449B58}, {0xF941FCFB,0x8FC09AD7}, {0x4BE46D0E,0xFAD8CEA9}, {0x0608EB9F,0xA343F28B}, - {0x4917347B,0x9B126BD0}, {0xE7699C22,0x9A92874A}, {0xC4E69EE0,0x1B017C42}, {0x0EE39256,0x3A4C5C72}, - {0x3EA399DA,0x4B6E9F5E}, {0x5AD83D35,0x6BA353F4}, {0x4C1B2425,0xE7FEE090}, {0x2587E95D,0x22D00983}, - {0x0F1430E2,0x842980C0}, {0x861E2893,0xC6B3C0A0}, {0x19D729F2,0x087433A4}, {0xD42D6C6F,0x341F3DAD}, - {0xFBB2A58E,0xEE0A3FAE}, {0x90DD3183,0x4AEE73C4}, {0xB1A16A34,0xAAB72DB5}, {0x5E238FDF,0xA92A0406}, - {0x686B6FCC,0x7B4B35A1}, {0xF4A6956C,0x6A23BF6E}, {0x851AD352,0x191CB96B}, {0xD6DE351A,0x55D598D4}, - {0xF2AE7EF3,0xC9604DE5}, {0xA981E172,0x1CA6C2A3}, {0xAD7A5398,0xDE2F9551}, {0x56C8F616,0x3025AAFF}, - {0x1E2860D9,0x15521D9D}, {0xFA45073A,0x506FE31C}, {0x2B647B0B,0x189C55F1}, {0xAE7EA859,0x0180EC9A}, - {0x050C105E,0x7CEC8B40}, {0x8BF94104,0x2350E519}, {0x55CC0DD7,0xEF8AD334}, {0x6D677F92,0x07A7BEE1}, - {0x0DE76997,0xE5E325B9}, {0xA26E637A,0x5A061591}, {0x18208B46,0xB611EF16}, {0xB7A981AB,0x09F4DF3E}, - {0xE87DACC0,0x1EBB078A}, {0xB65E231F,0xB791038C}, {0x74B05660,0x0FD38D45}, {0xC1EA8EBE,0x67EDF702}, - {0x831238CD,0xBA5F4BE0}, {0xCEFEBE5C,0xE3C477C2}, {0x354C1BD2,0x0DCE486C}, {0x16C31910,0x8C5DB364}, - {0xA7627324,0x26EA9ED1}, {0xEF82E5EB,0x039D29B3}, {0xCBF2AE02,0x9F28FC82}, {0xF05D2786,0xA8AAE89C}, - {0x2774B028,0x431AACFA}, {0x31B7A938,0xCF471F9E}, {0xE3922EC8,0x581BD0B8}, {0x400BEF06,0xBC78199B}, - {0xBF42F862,0x90FB71C7}, {0x46030499,0x1F3BEB10}, {0xB55AD8DE,0x683E7A47}, {0xA695D190,0x988F4263}, - {0x6E638453,0xD808C72A}, {0xC319D7CB,0x0627527B}, {0xD72997AE,0xEBB04466}, {0xE2658C7C,0xE67E0C0A}, - {0xB056C880,0x14D2F107}, {0x30400B8C,0x7122C32C}, {0xD5DACEDB,0x8A7AE11F}, {0xE98A0E74,0xA0DEDB38}, - {0xDCC615A6,0xAD109354}, {0xF655CC19,0x0BE91A17}, {0xB8BDB149,0x8DDD5FFE}, {0xAF890AED,0xBFE53028}, - {0xB4AD7A6A,0xD65BA6F5}, {0x2997227E,0x7956F088}, {0x32B352F9,0x10E86655}, {0xDACEFE39,0x0E5361DF}, - {0x9FC90161,0xCEC7F304}, {0x677F5F2E,0xFF62B561}, {0xD22587F0,0x975CCF26}, {0x543BAF63,0x51EF0F86}, - {0x10CBF28F,0x2F1E41EF}, {0xBBB94A88,0x52722635}, {0x3344F04D,0xAE8DBAE7}, {0x6688FD9A,0x410769D3}, - {0x34BBB966,0xB3AB94DE}, {0x8DF1AA9B,0x80131792}, {0xC5113C54,0xA564A0F0}, {0xBDB1A117,0xF131D4BE}, - {0xEA8EF5B5,0x7F71A2F3}, {0xC8F655C3,0x40878549}, {0x44F05DEC,0x7EF14E69}, {0xF55137D8,0xD44663DC}, - {0x523344FC,0xF2ACFD0D}, {0x00000000,0x00000000}, {0x8EF5515A,0x5FBC6E59}, {0xF1AA8532,0x16CF342E}, - {0xDB395C8D,0xB036BD6D}, {0xDD31B712,0x13754FE6}, {0x2D6C9094,0xBBDFA77A}, {0x3A582B30,0x89E7C8AC}, - {0xCDFA459D,0x3C6B0E09}, {0xC7E26521,0xC4AE0589}, {0x7F5FD468,0x49735A77}, {0x1D2C9B18,0xCAFD6456}, - {0x2F9FC9E1,0xDA150203}, {0x94268369,0x88672436}, {0x3BAF8984,0x3782141E}, {0x24704BE9,0x9CB5D531}, - {0x1AD3D233,0xD7DB4A6F}, {0x2A93D9BF,0xA6F98943}, {0x8A0EE3B0,0x9D3539AB}, {0x15C7E2D1,0x53F2CAAF}, - {0x76430F15,0x6E19283C}, {0x6384EDC4,0x3DEBE293}, {0x208BF903,0x5E3C82C3}, {0xB94A13FD,0x33B8834C}, - {0x2E686B55,0x6470DEB1}, {0x7A53C436,0x359FD137}, {0x02F35975,0x61CAA579}, {0x82E59A79,0x043A9752}, - {0x2683129C,0xFD7F7048}, {0x699CCD78,0xC52EE913}, {0x7DAC8D1D,0x28B9FF0E}, {0x78A09D43,0x5455744E}, - {0xB3523341,0xCB7D88CC}, {0x4A13CFBA,0x44BD121B}, {0xFDBA4E11,0x4D49CD25}, {0x8C06082F,0x3E76CB20}, - {0x2278A076,0x3FF627BA}, {0x04FBB2EA,0xC28957F2}, {0xE46D67E3,0x453DFE81}, {0x3DA7621B,0x94C1E695}, - {0xFF491764,0x2C83685C}, {0xFC4DECA5,0xF32C1197}, {0x922E68F6,0x2B24D6BD}, {0x9AC5113F,0xB22B7844}, - {0xD1217C31,0x48F3B6ED}, {0xBEB55AD6,0x2E9EAD75}, {0x5FD42D6B,0x174FD8B4}, {0x1238ABFA,0x4ED4E496}, - {0xFEBEB5D0,0x92E6B4EE}, {0x0BEF8208,0x46A0D732}, {0xA5912A51,0x47203BA8}, {0xE69E3E96,0x24F75BF8}, - {0x13CF094E,0xF0B13824}, {0xC901F777,0xFEE259FB}, {0x091CDB7D,0x276A724B}, {0xEE75475F,0xBDF8F501}, - {0x4DEC8691,0x599B3C22}, {0x99C1EAFE,0x6D84018F}, {0x1CDB39AC,0x7498B8E4}, {0x217C5BB7,0xE0595E71}, - {0x3C50C0AF,0x2AA43A27}, {0x3F543B6E,0xF50B43EC}, {0x62734F70,0x838E3E21}, {0x4507FF58,0xC09492DB}, - {0xDFC2EE67,0x72BFEA9F}, {0x9CCDFAA0,0x11688ACF}, {0x6A9836B9,0x1A8190D8}, {0xC615C795,0x7ACBD93B}, - {0x286080CA,0xC7332C3A}, {0x4EE87D50,0x863445E9}, {0xD0D6DE85,0xF6966A5F}, {0x96D5DA1C,0xE9AD814F}, - {0x9E3EA3D5,0x70A22FB6}, {0x582B6440,0x0A69F68D}, {0xC2EE757F,0xB8428EC9}, {0xAC8DF12C,0x604A49E3}, - {0x0C10CB23,0x5B86F90B}, {0x8F02F3EE,0xE1D9B2EB}, {0xD3D22544,0x29391394}, {0x5CD0D6AA,0xC8E0A17F}, - {0xF7A26EAD,0xB58CC6A5}, {0x238F02C2,0x8193FB08}, {0x5B2F9F81,0xD5C68F46}, {0x88FDBAC5,0xFCFF9CD2}, - {0xF359DC47,0x77059157}, {0x07FF492B,0x1D262E39}, {0xE59AC557,0xFB582233}, {0x42F8B673,0xDDB2BCE2}, - {0x48E096CF,0x2577B762}, {0xD83DA74C,0x6F99C4A6}, {0xEB795701,0xC1147E41}, {0x912A9337,0xF48BAF76}, -}; - -__constant__ uint2 T42[256] = { - {0x9B2C0A19,0x3EF29D24}, {0xB6F8622F,0xE9E16322}, {0x47757F7A,0x55369940}, {0xA47B0B33,0x9F4D56D5}, - {0x6AA1174C,0x82256746}, {0xEB082FB2,0xB8F5057D}, {0xF4475F53,0xCC48C10B}, {0x275DEC3A,0x373088D4}, - {0x180AED10,0x968F4325}, {0xF7016151,0x173D232C}, {0x946FCC13,0xAE4ED09F}, {0xC4539873,0xFD4B4741}, - {0xD9933765,0x1B5B3F0D}, {0x7B644052,0x2FFCB096}, {0x0A89840C,0xE02376D2}, {0x329B18D7,0xA3AE3A70}, - {0x35DE8526,0x419CBD23}, {0x5B7C3199,0xFAFEBF11}, {0x85AA9B0D,0x0397074F}, {0x4836B970,0xC58AD4FB}, - {0xFC4104A8,0xBEC60BE3}, {0x4B708772,0x1EFF36DC}, {0xED8453B6,0x131FDC33}, {0x341764D3,0x0844E33E}, - {0xAB38CD39,0x0FF11B6E}, {0x7761B85A,0x64351F0A}, {0x09CFBA0E,0x3B5694F5}, {0xB87245D0,0x30857084}, - {0x2297AE3C,0x47AFB3BD}, {0x6F6B554A,0xF2BA5C2F}, {0x1F4F70E1,0x74BDC476}, {0x71EDC45E,0xCFDFC644}, - {0x1DC0AF16,0xE610784C}, {0x3C113F28,0x7ACA29D6}, {0x76A859AF,0x2DED4117}, {0x99A3D5EE,0xAC5F211E}, - {0xA87EF33B,0xD484F949}, {0x96E013E4,0x3CE36CA5}, {0x3A9D432C,0xD120F098}, {0xDC597563,0x6BC40464}, - {0xD1956C9E,0x69D5F5E5}, {0x3698BB24,0x9AE95F04}, {0x66A4EF44,0xC9ECC8DA}, {0xA5B2EAC6,0xD69508C8}, - {0xC0503B80,0xC40C2235}, {0x8C652103,0x38C193BA}, {0x46BC9E8F,0x1CEEC75D}, {0x37515AD1,0xD3310119}, - {0x86ECA50F,0xD8E2E568}, {0x5779C991,0xB137108D}, {0x05CA4206,0x709F3B69}, {0x1680CAEF,0x4FEB5083}, - {0x241BD238,0xEC456AF3}, {0xE181ABBE,0x58D673AF}, {0xCAD9BF8C,0x242F54E7}, {0x0DCC19FD,0x0211F181}, - {0x0F43C60A,0x90BC4DBB}, {0x9DA0761D,0x9518446A}, {0x3F57012A,0xA1BFCBF1}, {0x61E172B5,0x2BDE4F89}, - {0x4F732481,0x27B853A8}, {0xDF1F4B61,0xB0B1E643}, {0x5C39AC68,0x18CC3842}, {0xBF37D821,0xD2B7F7D7}, - {0x3014C720,0x3103864A}, {0x72ABFA5C,0x14AA2463}, {0x4EBAC574,0x6E600DB5}, {0x0403A3F3,0x39476574}, - {0xBC71E623,0x09C215F0}, {0xE987F045,0x2A58B947}, {0xB477BDD8,0x7B4CDF18}, {0x906C6FE0,0x9709B5EB}, - {0x8060D90B,0x73083C26}, {0x41F9037E,0xFEDC400E}, {0xE44BE9B8,0x284948C6}, {0x08065BFB,0x728ECAE8}, - {0x17492B1A,0x06330E9E}, {0x69E7294E,0x59508561}, {0xE6C4364F,0xBAE4F4FC}, {0xE30E7449,0xCA7BCF95}, - {0xA33E96C2,0x7D7FD186}, {0xD85AD690,0x52836110}, {0x1B4CD312,0x4DFAA102}, {0x872544FA,0x913ABB75}, - {0x140F1518,0xDD46ECB9}, {0x1E869114,0x3D659A6B}, {0xD719109A,0xC23F2CAB}, {0x2DD46836,0xD713FE06}, - {0xB2FBC1DC,0xD0A60656}, {0xDD909496,0x221C5A79}, {0xA1B14935,0xEFD26DBC}, {0x235E4FC9,0x0E77EDA0}, - {0x6B68F6B9,0xCBFD395B}, {0xA6F4D4C4,0x0DE0EAEF}, {0x1A8532E7,0x0422FF1F}, {0xDED6AA94,0xF969B85E}, - {0xAEF28F3F,0x7F6E2007}, {0x81A938FE,0x3AD0623B}, {0x7AADA1A7,0x6624EE8B}, {0xC856607B,0xB682E8DD}, - {0x281E2A30,0xA78CC56F}, {0x45FAA08D,0xC79B257A}, {0x642B30B3,0x5B4174E0}, {0x7EAE0254,0x5F638BFF}, - {0x0C05F808,0x4BC9AF9C}, {0xF98B46AE,0xCE59308A}, {0xCC55C388,0x8FC58DA9}, {0x676D0EB1,0x803496C7}, - {0xE70DD7BA,0xF33CAAE1}, {0x6EA2B4BF,0xBB620232}, {0x201871CB,0xD5020F87}, {0xA9B712CE,0x9D5CA754}, - {0x7DE83C56,0x841669D8}, {0x5EB6739F,0x8A618478}, {0xB0741E2B,0x420BBA6C}, {0xEAC1CE47,0xF12D5B60}, - {0x1283691C,0x76AC35F7}, {0xFECEDB5F,0x2C6BB7D9}, {0x4C351A83,0xFCCDB18F}, {0xC3160582,0x1F79C012}, - {0x62A74CB7,0xF0ABADAE}, {0x82EF06FC,0xE1A5801C}, {0xF2CB2357,0x67A21845}, {0x5DF04D9D,0x5114665F}, - {0x74278658,0xBF40FD2D}, {0xB73183DA,0xA0393D3F}, {0x92E3B017,0x05A409D1}, {0x0B4065F9,0xA9FB28CF}, - {0x42BF3D7C,0x25A9A229}, {0x03463E02,0xDB75E227}, {0x5AB5D06C,0xB326E10C}, {0x95A62DE6,0xE7968E82}, - {0x636EAD42,0xB973F3B3}, {0x19C30CE5,0xDF571D38}, {0x29D7CBC5,0xEE549B72}, {0x65E2D146,0x12992AFD}, - {0x56B02864,0xF8EF4E90}, {0x4030E28B,0xB7041E13}, {0xDAD50967,0xC02EDD2A}, {0x8AE95D07,0x932B4AF4}, - {0xC6DC4784,0x6FE6FB7B}, {0x55F61666,0x239AACB7}, {0xBDB807D6,0x401A4BED}, {0x89AF6305,0x485EA8D3}, - {0xADB4B13D,0xA41BC220}, {0x9729F211,0x753B32B8}, {0xB3322029,0x997E584B}, {0xCEDA1C7F,0x1D683193}, - {0xC99F818E,0xFF5AB6C0}, {0x7F67E3A1,0x16BBD5E2}, {0x25D233CD,0xA59D34EE}, {0x3B54A2D9,0x98F8AE85}, - {0xCB105E79,0x6DF70AFA}, {0xB9BBA425,0x795D2E99}, {0x44334178,0x8E437B67}, {0x886682F0,0x0186F6CE}, - {0xBB347BD2,0xEBF092A3}, {0xF18D1D55,0xBCD7FA62}, {0x11C5571E,0xADD9D7D0}, {0xB1BDFFDE,0x0BD3E471}, - {0x8EEAFEF4,0xAA6C2F80}, {0xF6C880A4,0x5EE57D31}, {0xF044FCA0,0xF50FA47F}, {0x51F5B595,0x1ADDC9C3}, - {0x3352F922,0xEA76646D}, {0x00000000,0x00000000}, {0xF58EBEA6,0x85909F16}, {0xAAF12CCC,0x46294573}, - {0x39DB7D2E,0x0A5512BF}, {0x31DD26D5,0x78DBD857}, {0x6C2D6B48,0x29CFBE08}, {0x583A0F9B,0x218B5D36}, - {0xFACD78AC,0x152CD2AD}, {0xE2C795BC,0x83A39188}, {0x5F7F926A,0xC3B9DA65}, {0x2C1D89C3,0x9ECBA01B}, - {0x9F2FA9EA,0x07B5F850}, {0x26940DCF,0x7EE8D6C9}, {0xAF3B6ECA,0x36B67E1A}, {0x702425AB,0x86079859}, - {0xD31AB369,0xFB7849DF}, {0x932A51E2,0x4C7C57CC}, {0x0E8A27FF,0xD96413A6}, {0xC715A671,0x263EA566}, - {0x4376DC89,0x6C71FC34}, {0x84637AF8,0x4A4F5952}, {0x8B20BCF2,0xDAF314E9}, {0x4AB96687,0x572768C1}, - {0x682EC8BB,0x1088DB7C}, {0x537A6A62,0x887075F9}, {0xF302C2A2,0x2E7A4658}, {0xE582084D,0x619116DB}, - {0x8326E709,0xA87DDE01}, {0x9C6997E8,0xDCC01A77}, {0xAC7D50C8,0xEDC39C3D}, {0xA078A8C0,0xA60A33A1}, - {0x52B38B97,0xC1A82BE4}, {0x134A88E9,0x3F746BEA}, {0xBAFD9A27,0xA228CCBE}, {0x068C7C04,0xABEAD94E}, - {0x78227E50,0xF48952B1}, {0xFB049959,0x5CF48CB0}, {0x6DE48ABD,0x6017E015}, {0xA73D3531,0x4438B4F2}, - {0x49FF5885,0x8C528AE6}, {0x4DFCFB76,0xB515EF92}, {0x2E925634,0x0C661C21}, {0xC59A7986,0xB493195C}, - {0x21D1903E,0x9CDA519A}, {0xB5BE5C2D,0x32948105}, {0xD45F2E98,0x194ACE8C}, {0x38129CDB,0x438D4CA2}, - {0xBEFE39D4,0x9B6FA9CA}, {0xEF0B8C41,0x81B26009}, {0x91A58E15,0xDED1EBF6}, {0x9EE6481F,0x4E6DA64D}, - {0xCF13FD8A,0x54B06F8E}, {0x01C9E1F5,0x49D85E1D}, {0x1C094EE3,0xAFC82651}, {0x75EE67AD,0xF698A330}, - {0xEC4DB243,0x5AC7822E}, {0xC199DA75,0x8DD47C28}, {0xDB1CE892,0x89F68337}, {0x7C21DDA3,0xCDCE37C5}, - {0x503C5460,0x530597DE}, {0x543FF793,0x6A42F2AA}, {0x73621BA9,0x5D727A7E}, {0x07459DF1,0xE2328753}, - {0xC2DFE477,0x56A19E0F}, {0xCD9C227D,0xC61DD3B4}, {0x986A341B,0xE5877F03}, {0x15C6F4ED,0x949EB2A4}, - {0x60289340,0x62061194}, {0xE84E11B0,0x6380E75A}, {0xD6D0F16F,0x8BE772B6}, {0xD596CF6D,0x50929091}, - {0x3E9EE0DF,0xE86795EC}, {0x2B581432,0x7CF92748}, {0xEEC26DB4,0xC86A3E14}, {0x8DACC0F6,0x7119CDA7}, - {0x100CB6EB,0xE40189CD}, {0x028FDFF7,0x92ADBC3A}, {0xD2D3529C,0xB2A017C2}, {0xD05C8D6B,0x200DABF8}, - {0xA2F77737,0x34A78F9B}, {0x8F231F01,0xE3B4719D}, {0x2F5BB7C1,0x45BE423C}, {0xFD88E55D,0xF71E55FE}, - {0x59F3EE6E,0x6853032B}, {0xFF073AAA,0x65B3E9C4}, {0x9AE5EBEC,0x772AC339}, {0xF842A75B,0x87816E97}, - {0xE0484A4B,0x110E2DB2}, {0x3DD8DEDD,0x331277CB}, {0x79EB9FA5,0xBD510CAC}, {0x2A91F5C7,0x35217955}, -}; - -__constant__ uint2 T52[256] = { - {0x46E06A6D,0x8AB0A968}, {0x4BF0B33A,0x43C7E80B}, {0x6B161EE5,0x08C9B354}, {0xEBA990BE,0x39F1C235}, - {0x6606C7B2,0xC1BEF237}, {0x614569AA,0x2C209233}, {0x6FC3289A,0xEB01523B}, {0x935ACEDD,0x946953AB}, - {0x3E13340E,0x272838F6}, {0xA12BA052,0x8B0455EC}, {0x978FF8A2,0x77A1B2C4}, {0x13E54086,0xA55122CA}, - {0x62D3F1CD,0x22761358}, {0x08B76CFE,0xDB8DDFDE}, {0x9E4A178A,0x5D1E12C8}, {0x03969867,0x0E56816B}, - {0x3303ED59,0xEE5F7995}, {0xAB78D71D,0xAFED748B}, {0xF93E53EE,0x6D929F2D}, {0xBA798C2A,0xF5D8A8F8}, - {0x8E39CF6B,0xF619B169}, {0x749104E2,0x95DDAF2F}, {0xE0886427,0xEC2A9C80}, {0x825B95EA,0xCE5C8FD8}, - {0x3AC60271,0xC4E0D999}, {0x173076F9,0x4699C3A5}, {0x50A29F42,0x3D1B151F}, {0x2BC75946,0x9ED505EA}, - {0xDC7F4B98,0x34665ACF}, {0x292342F7,0x61B1FB53}, {0x0E864130,0xC721C008}, {0x96FD7B74,0x8693CD16}, - {0x7136B14B,0x87273192}, {0x63A1721B,0xD3446C8A}, {0xA6680E4A,0x669A35E8}, {0x39509A16,0xCAB658F2}, - {0xF42E8AB9,0xA4E5DE4E}, {0xE83F08D9,0x37A7435E}, {0xE26C7F96,0x134E6239}, {0x2DF67488,0x82791A3C}, - {0x8329163C,0x3F6EF00A}, {0xFDEB6591,0x8E5A7E42}, {0x7981DDB5,0x5CAAEE4C}, {0x5AF1E80D,0x19F23478}, - {0xED98BD70,0x255DDDE3}, {0xA99CCCAC,0x50898A32}, {0xDA4E6656,0x28CA4519}, {0x4CB31D22,0xAE59880F}, - {0x37D6DB26,0x0D9798FA}, {0xB4FFCD1A,0x32F968F0}, {0x4F258545,0xA00F0964}, {0x5E24DE72,0xFA3AD517}, - {0x5DB24615,0xF46C547C}, {0xFF0F7E20,0x713E80FB}, {0x73D2AAFA,0x7843CF2B}, {0xAEDF62B4,0xBD17EA36}, - {0xD16F92CF,0xFD111BAC}, {0xC72D67E0,0x4ABAA7DB}, {0xAD49FAD3,0xB3416B5D}, {0x4914A88B,0xBCA316B2}, - {0x8AECF914,0x15D15006}, {0xE31EFC40,0xE27C1DEB}, {0x9BEDA223,0x4FE48C75}, {0x1B522C78,0x7EDCFD14}, - {0x7C26681C,0x4E5070F1}, {0x5815F3BC,0xE696CAC1}, {0x3BB481A7,0x35D2A64B}, {0xFE7DFDF6,0x800CFF29}, - {0xD5BAA4B0,0x1ED9FAC3}, {0x1EF599D1,0x6C2663A9}, {0x34404341,0x03C11991}, {0x69F20554,0xF7AD4DED}, - {0xB61BD6AB,0xCD9D9649}, {0xEADB1368,0xC8C3BDE7}, {0xB02AFB65,0xD131899F}, {0xE1FAE7F1,0x1D18E352}, - {0xEF7CA6C1,0xDA39235A}, {0xA8EE4F7A,0xA1BBF5E0}, {0xCF9A0B1E,0x91377805}, {0x80BF8E5B,0x31387161}, - {0xDB3CE580,0xD9F83ACB}, {0xD38B897E,0x0275E515}, {0xF0FBBCC6,0x472D3F21}, {0x868EA395,0x2D946EB7}, - {0x21942E09,0xBA3C248D}, {0xBFDE3983,0xE7223645}, {0x02E41BB1,0xFF64FEB9}, {0x0D10D957,0xC9774163}, - {0xB58D4ECC,0xC3CB1722}, {0x9CAE0C3B,0xA27AEC71}, {0xA48C15FB,0x99FECB51}, {0x6D27332B,0x1465AC82}, - {0xD75EBF01,0xE1BD047A}, {0x941960C5,0x79F733AF}, {0x41A3C475,0x672EC96C}, {0x524684F3,0xC27FEBA6}, - {0x75E38734,0x64EFD0FD}, {0x0743AE18,0xED9E6004}, {0xB9EF144D,0xFB8E2993}, {0x0C625A81,0x38453EB1}, - {0x42355C12,0x69784807}, {0x14A6EE9E,0x48CF42CE}, {0x06312DCE,0x1CAC1FD6}, {0x4792E9BB,0x7B82D6BA}, - {0x1F871A07,0x9D141C7B}, {0xC11C4A2E,0x5616B80D}, {0xF21FA777,0xB849C198}, {0xC8D9A506,0x7CA91801}, - {0x7EC273AD,0xB1348E48}, {0x987B3A44,0x41B20D1E}, {0xA3CFBBE3,0x7460AB55}, {0x4576F20A,0x84E62803}, - {0x897A6173,0x1B87D16D}, {0xE45D5258,0x0FE27DEF}, {0xCA3DBEB7,0x83CDE6B8}, {0xD01D1119,0x0C23647E}, - {0xA0592384,0x7A362A3E}, {0xF1893F10,0xB61F40F3}, {0x440471DC,0x75D457D1}, {0x237035B8,0x4558DA34}, - {0x87FC2043,0xDCA61165}, {0xC9AB26D0,0x8D9B67D3}, {0xEE0E2517,0x2B0B5C88}, {0x2AB5DA90,0x6FE77A38}, - {0xD9D8FE31,0x269CC472}, {0xFAA8CB89,0x63C41E46}, {0x1642F52F,0xB7ABBC77}, {0x2F126F39,0x7D1DE485}, - {0x24339BA0,0xA8C6BA30}, {0xCEE888C8,0x600507D7}, {0x1A20AFAE,0x8FEE82C6}, {0x26D78011,0x57A24489}, - {0x36A458F0,0xFCA5E728}, {0x8F4B4CBD,0x072BCEBB}, {0xF36D24A1,0x497BBE4A}, {0xB769557D,0x3CAFE99B}, - {0x05A7B5A9,0x12FA9EBD}, {0x5B836BDB,0xE8C04BAA}, {0xAC3B7905,0x4273148F}, {0x2851C121,0x90838481}, - {0x6C55B0FD,0xE557D350}, {0xCB4F3D61,0x72FF996A}, {0x64E2DC03,0x3EDA0C8E}, {0xE6B949E9,0xF0868356}, - {0xBB0B0FFC,0x04EAD72A}, {0x5967706A,0x17A4B513}, {0x04D5367F,0xE3C8E16F}, {0x8DAF570C,0xF84F3002}, - {0xBD3A2232,0x1846C8FC}, {0xF6CA9108,0x5B8120F7}, {0xECEA3EA6,0xD46FA231}, {0x53340725,0x334D9474}, - {0xC28AD249,0x58403966}, {0x9A9F21F5,0xBED6F3A7}, {0xA5FE962D,0x68CCB483}, {0x57E1315A,0xD085751B}, - {0xE52FD18E,0xFED0023D}, {0x20E6ADDF,0x4B0E5B5F}, {0x6EB1AB4C,0x1A332DE9}, {0x7B65C604,0xA3CE10F5}, - {0xD62C3CD7,0x108F7BA8}, {0x1073D8E1,0xAB07A3A1}, {0x91BED56C,0x6B0DAD12}, {0x3532C097,0xF2F36643}, - {0xB2CEE0D4,0x2E557726}, {0x00000000,0x00000000}, {0xDE9B5029,0xCB02A476}, {0x8B9E7AC2,0xE4E32FD4}, - {0x2C84F75E,0x734B65EE}, {0xCD7E10AF,0x6E5386BC}, {0xE7CBCA3F,0x01B4FC84}, {0x65905FD5,0xCFE8735C}, - {0x0FF4C2E6,0x3613BFDA}, {0x31E7F6E8,0x113B872C}, {0x55052AEB,0x2FE18BA2}, {0xBC48A1E4,0xE974B72E}, - {0xB89D979B,0x0ABC5641}, {0x2202B66E,0xB46AA5E6}, {0xC4BBFF87,0x44EC26B0}, {0x27A503C7,0xA6903B5B}, - {0xFC99E647,0x7F680190}, {0xA71A8D9C,0x97A84A3A}, {0x6037EA7C,0xDD12EDE1}, {0xDD0DC84E,0xC554251D}, - {0x956BE313,0x88C54C7D}, {0x48662B5D,0x4D916960}, {0x9909B992,0xB08072CC}, {0xC5C97C51,0xB5DE5962}, - {0x19B637C9,0x81B803AD}, {0x4A8230EC,0xB2F597D9}, {0x5F565DA4,0x0B08AAC5}, {0x017283D6,0xF1327FD2}, - {0x78F35E63,0xAD98919E}, {0x76751F53,0x6AB95196}, {0x0A53774F,0x24E92167}, {0x15D46D48,0xB9FD3D1C}, - {0xFBDA485F,0x92F66194}, {0x11015B37,0x5A35DC73}, {0x5477A93D,0xDED3F470}, {0x81CD0D8D,0xC00A0EB3}, - {0xC65FE436,0xBB88D809}, {0xBEACBA55,0x16104997}, {0x5693B28C,0x21B70AC9}, {0x25411876,0x59F4C5E2}, - {0x0B21F499,0xD5DB5EB5}, {0xF55C096F,0x55D7A19C}, {0xC3F8519F,0xA97246B4}, {0xA2BD3835,0x8552D487}, - {0x1297C350,0x54635D18}, {0x85183BF2,0x23C2EFDC}, {0xCC0C9379,0x9F61F96E}, {0x9DDC8FED,0x534893A3}, - {0xAA0A54CB,0x5EDF0B59}, {0x9F38945C,0xAC2C6D1A}, {0xD8AA7DE7,0xD7AEBBA0}, {0x09C5EF28,0x2ABFA00C}, - {0x3CF72FBF,0xD84CC64F}, {0xB15878B3,0x2003F64D}, {0xC06EC9F8,0xA724C7DF}, {0x68808682,0x069F323F}, - {0x51D01C94,0xCC296ACD}, {0x5CC0C5C3,0x055E2BAE}, {0x1D6301B6,0x6270E2C2}, {0x382219C0,0x3B842720}, - {0x846AB824,0xD2F0900E}, {0x7A1745D2,0x52FC6F27}, {0xE94D8B0F,0xC6953C8C}, {0x3095753E,0xE009F8FE}, - {0x92284D0B,0x655B2C79}, {0x4347DFC4,0x984A37D5}, {0x8808E2A5,0xEAB5AEBF}, {0x90CC56BA,0x9A3FD2C0}, - {0xF84CD038,0x9CA0E0FF}, {0xAFADE162,0x4C2595E4}, {0xB3BC6302,0xDF6708F4}, {0x7D54EBCA,0xBF620F23}, - {0x1C118260,0x93429D10}, {0x8CDDD4DA,0x097D4FD0}, {0x2E60ECEF,0x8C2F9B57}, {0x18C4B41F,0x708A7C7F}, - {0xDFE9D3FF,0x3A30DBA4}, {0x7FB0F07B,0x4006F19A}, {0x4DC19EF4,0x5F6BF7DD}, {0x32716E8F,0x1F6D0647}, - {0x6A649D33,0xF9FBCC86}, {0x67744464,0x308C8DE5}, {0x72A0292C,0x8971B0F9}, {0x3F61B7D8,0xD61A4724}, - {0xD4C82766,0xEFEB8511}, {0x40D147A3,0x961CB6BE}, {0xF7B812DE,0xAAB35F25}, {0x7044329D,0x76154E40}, - {0x4E570693,0x513D76B6}, {0xD2F90AA8,0xF3479AC7}, {0x77079C85,0x9B8B2E44}, {0x3D85AC69,0x297EB99D}, -}; - -__constant__ uint2 T62[256] = { - {0xFC7D40C3,0x7E37E62D}, {0xEE939E5B,0x776F25A4}, {0xDD8FB5AD,0xE045C850}, {0x11FF1952,0x86ED5BA7}, - {0xCF616B35,0xE91D0BD9}, {0x6E408FFB,0x37E0AB25}, {0x31025A7A,0x9607F6C0}, {0x16D23C9D,0x0B02F5E1}, - {0xFB50650C,0xF3D8486B}, {0xC40875F5,0x621CFF27}, {0xFA5FD34A,0x7D40CB71}, {0xDAA29062,0x6DAA6616}, - {0x23EC84E2,0x9F5F3549}, {0xC507C3B3,0xEC847C3D}, {0x043CE205,0x025A3668}, {0x4DAC0B19,0xA8BF9E6C}, - {0xE9BEBB94,0xFA808BE2}, {0x77C74FA3,0xB5B99C52}, {0xF0397BCC,0x78D9BC95}, {0xDBAD2624,0xE332E50C}, - {0x9332797E,0xC74FCE12}, {0x2EA709AB,0x1729ECEB}, {0x9954D1F8,0xC2D6B9F6}, {0xBAB8551A,0x5D898CBF}, - {0x17DD8ADB,0x859A76FB}, {0x362F7FB5,0x1BE85886}, {0xF136CD8A,0xF6413F8F}, {0xBBB7E35C,0xD3110FA5}, - {0x14CC4D11,0x0A2FEED5}, {0xCD7F1AB9,0xE83010ED}, {0x5F42D581,0xA1E75DE5}, {0xC13B21B6,0xEEDE4A55}, - {0xF94E1480,0xF2F5535F}, {0x1888761E,0x0CC1B46D}, {0x6529913B,0xBCE15FDB}, {0x5A7181C2,0x2D25E897}, - {0xE2D7A554,0x71817F1C}, {0x5C53124B,0x2E52C5CB}, {0xEF9C281D,0xF9F7A6BE}, {0x21F2F56E,0x9E722E7D}, - {0x81DCA7E6,0xCE170D9B}, {0x1CB4941B,0x0E9B8205}, {0x3C49D733,0x1E712F62}, {0x42F9F7DC,0x21E45CFA}, - {0x8BBA0F60,0xCB8E7A7F}, {0x010FB646,0x8E98831A}, {0x8E895B23,0x474CCF0D}, {0x4FB27A95,0xA9928558}, - {0x05335443,0x8CC2B572}, {0x84EFF3A5,0x42D5B8E9}, {0x021E718C,0x012D1B34}, {0xAE74180B,0x57A6626A}, - {0xE3D81312,0xFF19FC06}, {0x6A7C6DFE,0x35BA9D4D}, {0x8F86ED65,0xC9D44C17}, {0xA02E5288,0x506523E6}, - {0x06229389,0x03772D5C}, {0x0B691EC0,0x8B01F4FE}, {0xED825991,0xF8DABD8A}, {0x985B67BE,0x4C4E3AEC}, - {0x7FBF96A9,0xB10DF082}, {0xD4F8DAE1,0x6A69279A}, {0xD3D5FF2E,0xE78689DC}, {0x1FA553D1,0x812E1A2B}, - {0xEBA0CA18,0xFBAD90D6}, {0x34310E39,0x1AC543B2}, {0x2CB97827,0x1604F7DF}, {0x51189F02,0xA6241C69}, - {0xEAAF7C5E,0x753513CC}, {0xC84C4EFA,0x64F2A59F}, {0x489F5F5A,0x247D2B1E}, {0xAB474C48,0xDB64D718}, - {0xF2270A40,0x79F4A7A1}, {0x2A9BEBAE,0x1573DA83}, {0x68621C72,0x34978679}, {0xA2302304,0x514838D2}, - {0xFD72F685,0xF0AF6537}, {0x3A6B44BA,0x1D06023E}, {0xCE6EDD73,0x678588C3}, {0xCC70ACFF,0x66A893F7}, - {0xB5EDA9DF,0xD4D24E29}, {0x70EA6A6C,0x38563214}, {0x0E5A4A83,0x07C3418C}, {0x5635BACD,0x2BCBB22F}, - {0x0878D90A,0x04B46CD0}, {0x0C443B0F,0x06EE5AB8}, {0x76C8F9E5,0x3B211F48}, {0x12EEDE98,0x0958C389}, - {0xBF8B0159,0xD14B39CD}, {0x72F41BE0,0x397B2920}, {0x13E168DE,0x87C04093}, {0x47CAA39F,0xAD26E988}, - {0x9C6785BB,0x4E140C84}, {0xB7F3D853,0xD5FF551D}, {0x5D5CA40D,0xA0CA46D1}, {0x87FE346F,0xCD6020C7}, - {0x15C3FB57,0x84B76DCF}, {0xA121E4CE,0xDEFDA0FC}, {0x96012D3D,0x4B8D7B60}, {0x298A2C64,0x9AC642AD}, - {0x10F0AF14,0x0875D8BD}, {0x7B8374AC,0xB357C6EA}, {0x9A451632,0x4D6321D8}, {0xC719B23F,0xEDA96709}, - {0xF328BC06,0xF76C24BB}, {0x912C08F2,0xC662D526}, {0x7892B366,0x3CE25EC4}, {0x6F4F39BD,0xB978283F}, - {0x9D6833FD,0xC08C8F9E}, {0x9E79F437,0x4F3917B0}, {0xB2C08C10,0x593DE06F}, {0xB1D14BDA,0xD6887841}, - {0x32139DB0,0x19B26EEE}, {0x75D93E2F,0xB4948766}, {0x1987C058,0x82593777}, {0x3D466175,0x90E9AC78}, - {0xFF6C8709,0xF1827E03}, {0x353EB87F,0x945DC0A8}, {0x8AB5B926,0x4516F965}, {0x7EB020EF,0x3F957398}, - {0x6D514831,0xB855330B}, {0x542BCB41,0x2AE6A91B}, {0xC6160479,0x6331E413}, {0x80D311A0,0x408F8E81}, - {0xC325503A,0xEFF35161}, {0xBD9570D5,0xD06622F9}, {0x0D4B8D49,0x8876D9A2}, {0x573A0C8B,0xA5533135}, - {0xDF91C421,0xE168D364}, {0xF50A2F8F,0xF41B09E7}, {0x24C1A12D,0x12B09B0F}, {0xA9593DC4,0xDA49CC2C}, - {0x3E57A6BF,0x1F5C3456}, {0xA8568B82,0x54D14F36}, {0x43F6419A,0xAF7CDFE0}, {0xC943F8BC,0xEA6A2685}, - {0xD7E91D2B,0xE5DCBFB4}, {0x799D0520,0xB27ADDDE}, {0xD6E6AB6D,0x6B443CAE}, {0xF61BE845,0x7BAE91C9}, - {0x7CAE5163,0x3EB868AC}, {0x22E332A4,0x11C7B653}, {0xB9A992D0,0xD23C1491}, {0x0311C7CA,0x8FB5982E}, - {0xE0C9D4D8,0x70AC6428}, {0x0F55FCC5,0x895BC296}, {0xEC8DEFD7,0x76423E90}, {0xDE9E7267,0x6FF0507E}, - {0x7A8CC2EA,0x3DCF45F0}, {0x941F5CB1,0x4AA06054}, {0xB0DEFD9C,0x5810FB5B}, {0xBC9AC693,0x5EFEA1E3}, - {0xDC8003EB,0x6EDD4B4A}, {0xE8B10DD2,0x741808F8}, {0x28859A22,0x145EC1B7}, {0x50172944,0x28BC9F73}, - {0x4EBDCCD3,0x270A0642}, {0x331C2BF6,0x972AEDF4}, {0x0A66A886,0x059977E4}, {0x4A812ED6,0x2550302A}, - {0xA7037747,0xDD8A8DA0}, {0x970E9B7B,0xC515F87A}, {0x601AC578,0x3023EAA9}, {0x73FBADA6,0xB7E3AA3A}, - {0x1EAAE597,0x0FB69931}, {0x00000000,0x00000000}, {0x6204B4F4,0x310EF19D}, {0x44DB6455,0x229371A6}, - {0x1A960792,0x0DECAF59}, {0xB8A62496,0x5CA4978B}, {0x38753536,0x1C2B190A}, {0x82CD602C,0x41A295B5}, - {0x6426277D,0x3279DCC1}, {0x9F764271,0xC1A194AA}, {0x26DFD0A1,0x139D803B}, {0x41E83016,0xAE51C4D4}, - {0xAD65DFC1,0xD813FA44}, {0x45D4D213,0xAC0BF2BC}, {0x46C515D9,0x23BE6A92}, {0x923DCF38,0x49D74D08}, - {0x27D066E7,0x9D050321}, {0x5E4D63C7,0x2F7FDEFF}, {0x55247D07,0xA47E2A01}, {0x2FA8BFED,0x99B16FF1}, - {0x8C972AAF,0x4661D439}, {0xA33F9542,0xDFD0BBC8}, {0xA51D06CB,0xDCA79694}, {0x7DA1E725,0xB020EBB6}, - {0x696DAA34,0xBA0F0563}, {0xD5F76CA7,0xE4F1A480}, {0x9510EAF7,0xC438E34E}, {0x3B64F2FC,0x939E8124}, - {0x072D25CF,0x8DEFAE46}, {0x586FF04E,0x2C08F3A3}, {0xB3CF3A56,0xD7A56375}, {0x40E78650,0x20C947CE}, - {0x86F18229,0x43F8A3DD}, {0xAC6A6987,0x568B795E}, {0x1DBB225D,0x8003011F}, {0xF7145E03,0xF53612D3}, - {0x300DEC3C,0x189F75DA}, {0x3720C9F3,0x9570DB9C}, {0x6B73DBB8,0xBB221E57}, {0xE4F536DD,0x72F65240}, - {0x88ABC8AA,0x443BE251}, {0xD9B357A8,0xE21FFE38}, {0xE7E4F117,0xFD43CA6E}, {0x89A47EEC,0xCAA3614B}, - {0xE1C6629E,0xFE34E732}, {0x1B99B1D4,0x83742C43}, {0x83C2D66A,0xCF3A16AF}, {0x4990E91C,0xAAE5A804}, - {0x4CA3BD5F,0x26271D76}, {0x3F5810F9,0x91C4B74C}, {0xF841A2C6,0x7C6DD045}, {0xFE63314F,0x7F1AFD19}, - {0x8D989CE9,0xC8F95723}, {0x5306EE8E,0xA709075D}, {0xAA48FA0E,0x55FC5402}, {0x9023BEB4,0x48FA563C}, - {0xCA523F76,0x65DFBEAB}, {0xD8BCE1EE,0x6C877D22}, {0x85E045E3,0xCC4D3BF3}, {0x6115733E,0xBEBB69B3}, - {0x20FD4328,0x10EAAD67}, {0x71E5DC2A,0xB6CEB10E}, {0x6737E0B7,0xBDCC44EF}, {0xA412B08D,0x523F158E}, - {0x2DB6CE61,0x989C74C5}, {0x2B945DE8,0x9BEB5999}, {0x09776F4C,0x8A2CEFCA}, {0x5B7E3784,0xA3BD6B8D}, - {0xCB5D8930,0xEB473DB1}, {0x9B4AA074,0xC3FBA2C2}, {0x25CE176B,0x9C281815}, {0xD0C438E4,0x683311F2}, - {0xBE84B71F,0x5FD3BAD7}, {0xE5FA809B,0xFC6ED15A}, {0x6C5EFE77,0x36CDB011}, {0x520958C8,0x29918447}, - {0x59604608,0xA29070B9}, {0xA60CC101,0x53120EBA}, {0x74D68869,0x3A0C047C}, {0xD2DA4968,0x691E0AC6}, - {0xE6EB4751,0x73DB4974}, {0xF40599C9,0x7A838AFD}, {0xB4E21F99,0x5A4ACD33}, {0xC03497F0,0x6046C94F}, - {0xD1CB8EA2,0xE6AB92E8}, {0x663856F1,0x3354C7F5}, {0xAF7BAE4D,0xD93EE170}, {0xC22AE67C,0x616BD27B}, - {0x397A8370,0x92B39A10}, {0x4B8E9890,0xABC8B330}, {0x630B02B2,0xBF967287}, {0xB6FC6E15,0x5B67D607}, -}; - -__constant__ uint2 T72[256] = { - {0xCE553FE6,0xD031C397}, {0xB006B525,0x16BA5B01}, {0x296E70C8,0xA89BADE6}, {0x77D3435B,0x6A1F525D}, - {0x573DFA0B,0x6E103570}, {0x17FC95AB,0x660EFB2A}, {0x97634BF6,0x76327A9E}, {0x62458BF5,0x4BAD9D64}, - {0xDBC3F748,0xF1830CAE}, {0x669131FF,0xC5C8F542}, {0xDC48B0CB,0x95044A1C}, {0x3CF8B866,0x892962DF}, - {0xE930C135,0xB0B9E208}, {0x611A767C,0xA14FB3F0}, {0x1C160136,0x8D2605F2}, {0xFECC549E,0xD6B71922}, - {0xA5907D8B,0x37089438}, {0x5803D49C,0x0B5DA38E}, {0xEA6F3CBC,0x5A5BCC9C}, {0x3B73FFE5,0xEDAE246D}, - {0xDE22EDCE,0xD2B87E0F}, {0xCA8185EC,0x5E54ABB1}, {0xE80561B9,0x1DE7F88F}, {0x0135A08C,0xAD5E1A87}, - {0x65CECC76,0x2F2ADBD6}, {0x82F58358,0x5780B5A7}, {0xEDE47B3F,0x3EDC8A2E}, {0x06BEE70F,0xC9D95C35}, - {0x6C4E05EE,0x83BE111D}, {0x59367410,0xA603B909}, {0x809FDE5D,0x103C81B4}, {0x7D0C774A,0x2C69B602}, - {0xD5C87953,0x399080D7}, {0x487406B4,0x09D41E16}, {0x26505E5F,0xCDD63B18}, {0x9B0298E8,0xF99DC2F4}, - {0x943CB67F,0x9CD0540A}, {0x891F17C5,0xBCA84B7F}, {0xB78DF2A6,0x723D1DB3}, {0xE73B4F2E,0x78AA6E71}, - {0xA071670D,0x1433E699}, {0x54620782,0x84F21BE4}, {0xB4D20F2F,0x98DF3327}, {0xD3769E5C,0xF049DCE2}, - {0x9656EB7A,0xDB6C6019}, {0x078B4783,0x648746B2}, {0x8DCBADCF,0x32CD2359}, {0xF0C7DA85,0x1EA4955B}, - {0x1B9D46B5,0xE9A14340}, {0xBBEC21B8,0xFD92A5D9}, {0x0E0B8E1B,0xC8138C79}, {0x6D7BA562,0x2EE00B9A}, - {0x93B7F1FC,0xF85712B8}, {0x0BEA949D,0xEB28FED8}, {0x8A40EA4C,0x564A65EB}, {0x474A2823,0x6C9988E8}, - {0x121D8F2D,0x4535898B}, {0x31ACCBF4,0xABD8C032}, {0xB9867CBD,0xBA2E91CA}, {0xEF8E263A,0x7960BE3D}, - {0x602FD6F0,0x0C11A977}, {0x16C93527,0xCB50E1AD}, {0x035FFD89,0xEAE22E94}, {0x5DE2CE1A,0x2866D12F}, - {0xAB9BF390,0xFF1B1841}, {0x8CFE0D43,0x9F9339DE}, {0xC48A0BF7,0x964727C8}, {0xAAAE531C,0x524502C6}, - {0xAC10B413,0x9B9C5EF3}, {0x42AB32A5,0x4FA2FA49}, {0xE551122B,0x3F165A62}, {0x76E6E3D7,0xC74148DA}, - {0xE464B2A7,0x924840E5}, {0xD69784DA,0xD372AE43}, {0x05E11A86,0x233B72A1}, {0x4941A638,0xA48A0491}, - {0xC9DE7865,0xB4B68525}, {0xA6CF8002,0xDDEABAAC}, {0x50B6BD88,0x0A9773C2}, {0x5EBD3393,0xC284FFBB}, - {0x2C8F6A4E,0x8BA0DF47}, {0x4D951C32,0x2AEF6CB7}, {0x2A318D41,0x42798372}, {0xBF389BB2,0x73F7CDFF}, - {0x382C026C,0x074C0AF9}, {0x243A035A,0x8A6A0F0B}, {0x5F88931F,0x6FDAE53C}, {0x7E538AC3,0xC68B9896}, - {0x1AA8E639,0x44FF59C7}, {0x439E9229,0xE2FCE0CE}, {0x79D8CD40,0xA20CDE24}, {0xC8EBD8E9,0x19E89FA2}, - {0xF398270C,0xF446BBCF}, {0x2284E455,0x43B3533E}, {0x8E945046,0xD82F0DCD}, {0xB26CE820,0x51066F12}, - {0x6BC5426D,0xE73957AF}, {0x40C16FA0,0x081ECE5A}, {0xC5BFAB7B,0x3B193D4F}, {0xDF174D42,0x7FE66488}, - {0x705804D8,0x0E9814EF}, {0x7C39D7C6,0x8137AC85}, {0xE185A821,0xB1733244}, {0x6F11F867,0x695C3F89}, - {0xE3EFF524,0xF6CF0657}, {0xD02963D5,0x1AABF276}, {0x75B91E5E,0x2DA3664E}, {0x1077D228,0x0289BD98}, - {0xF413608F,0x90C1FD7D}, {0xFD93A917,0x3C5537B6}, {0x3919A2E0,0xAA12107E}, {0x30996B78,0x0686DAB5}, - {0x9EE3826E,0xDAA6B055}, {0x56085A87,0xC34E2FF7}, {0x4FFF4137,0x6D5358A4}, {0xB35948AC,0xFC587595}, - {0xC7D5F67E,0x7CA5095C}, {0x8B754AC0,0xFB147F6C}, {0x91DDACF9,0xBFEB26AB}, {0x67A49173,0x6896EFC5}, - {0x1E7C5C33,0xCA9A31E1}, {0xB13315A9,0xBBE44186}, {0x689ABFE4,0x0DDB793B}, {0xA7FA208E,0x70B4A02B}, - {0x7307F951,0xE47A3A7B}, {0x14A36822,0x8CECD5BE}, {0x23B144D9,0xEEED49B9}, {0xB8B3DC31,0x17708B4D}, - {0x2765FED3,0x6088219F}, {0xF1F27A09,0xB3FA8FDC}, {0xFCA6099B,0x910B2D31}, {0x78ED6DCC,0x0F52C4A3}, - {0xBAD98134,0x50CCBF5E}, {0x7F662A4F,0x6BD58211}, {0xD4FDD9DF,0x94CE9A50}, {0x45207526,0x2B25BCFB}, - {0x1F49FCBF,0x67C42B66}, {0x723259DD,0x492420FC}, {0x18C2BB3C,0x03436DD4}, {0xF872B391,0x1F6E4517}, - {0x69AF1F68,0xA08563BC}, {0xEEBB86B6,0xD43EA4BA}, {0x08B56914,0x01CAD04C}, {0x0980C998,0xAC94CACB}, - {0x9A373864,0x54C3D873}, {0x2DBACAC2,0x26FEC5C0}, {0xBE0D3B3E,0xDEA9D778}, {0x20EEB950,0x040F672D}, - {0x7BB29045,0xE5B0EA37}, {0xCBB42560,0xF30AB136}, {0x37122CFB,0x62019C07}, {0x13282FA1,0xE86B930C}, - {0x2EE5374B,0xCC1CEB54}, {0xA21B3A08,0x538FD28A}, {0xD89C0AC1,0x1B61223A}, {0xAD25149F,0x36C24474}, - {0xF74C9D06,0x7A23D3E9}, {0x9968C5ED,0xBE21F6E7}, {0x36278C77,0xCF5F8680}, {0xEB5A9C30,0xF705D61B}, - {0x52DCE08D,0x4D2B47D1}, {0xC234ECF8,0x5F9E7BFD}, {0x3DCD18EA,0x24777858}, {0x4415D5AA,0x867BA67C}, - {0x5A698999,0x4CE1979D}, {0x00000000,0x00000000}, {0x33C696F1,0xEC64F421}, {0xC16B1171,0xB57C5569}, - {0x467F88AF,0xC1C7926F}, {0x0F3E2E97,0x654D96FE}, {0xA8C40E19,0x15F936D5}, {0xA9F1AE95,0xB8A72C52}, - {0x21DB19DC,0xA9517DAA}, {0xFA18EE94,0x58D27104}, {0xF2AD8780,0x5918A148}, {0xDAF657C4,0x5CDD1629}, - {0x64FB6CFA,0x8274C151}, {0xC6E056F2,0xD1FB13DB}, {0xCF609F6A,0x7D6FD910}, {0xD9A9AA4D,0xB63F38BD}, - {0xF526C003,0x3D9FE7FA}, {0x871499DE,0x74BBC706}, {0xB6B8522A,0xDF630734}, {0xCD0AC26F,0x3AD3ED03}, - {0x83C023D4,0xFADEAF20}, {0x4ECAE1BB,0xC00D4223}, {0x5CD76E96,0x8538CBA8}, {0x6E2458EB,0xC402250E}, - {0x026A5D05,0x47BC3413}, {0x114272A4,0xAFD7A71F}, {0xCC3F62E3,0x978DF784}, {0xA144C781,0xB96DFC1E}, - {0x1596C8AE,0x21B2CF39}, {0x950916F3,0x318E4E8D}, {0x3E92E563,0xCE9556CC}, {0xDD7D1047,0x385A509B}, - {0xB5E7AFA3,0x358129A0}, {0x63702B79,0xE6F387E3}, {0x53E94001,0xE0755D56}, {0xFFF9F412,0x7BE903A5}, - {0x90E80C75,0x12B53C2C}, {0x857EC4DB,0x3307F315}, {0x0C61D31E,0x8FAFB86A}, {0x86213952,0xD9E5DD81}, - {0x9FD622E2,0x77F8AAD2}, {0x357871FE,0x25BDA814}, {0x8FA1F0CA,0x7571174A}, {0x985D6561,0x137FEC60}, - {0x9DBC7FE7,0x30449EC1}, {0x41F4CF2C,0xA540D4DD}, {0xAE7AE916,0xDC206AE0}, {0xE2DA55A8,0x5B911CD0}, - {0xF947131D,0xB2305F90}, {0xBD52C6B7,0x344BF9EC}, {0xD2433ED0,0x5D17C665}, {0xC05EB1FD,0x18224FEE}, - {0x844B6457,0x9E59E992}, {0xA4A5DD07,0x9A568EBF}, {0x716DA454,0xA3C60E68}, {0xD7A22456,0x7E2CB4C4}, - {0x4CA0BCBE,0x87B17630}, {0x32F3367D,0x413AEEA6}, {0xBC67663B,0x9915E36B}, {0x3A465F69,0x40F03EEA}, - {0xE0B008AD,0x1C2D28C3}, {0x4A1E5BB1,0x4E682A05}, {0x285BD044,0x05C5B761}, {0x5B5C2915,0xE1BF8D1A}, - {0xC3014C74,0xF2C0617A}, {0xD11CC359,0xB7F5E8F1}, {0x3FA745EF,0x63CB4C4B}, {0x9C89DF6B,0x9D1A8446}, - {0x4B2BFB3D,0xE3363082}, {0xE60EEFA2,0xD5F474F6}, {0xFB2D4E18,0xF58C6B83}, {0x0ADF3411,0x4676E45F}, - {0x1D23A1BA,0x20781F75}, {0x81AA7ED1,0xBD629B33}, {0x19F71BB0,0xAE1D7753}, {0xA32E9A84,0xFED1C80D}, - {0x92825170,0x5509083F}, {0x5557A70E,0x29AC0163}, {0x51831D04,0xA7C96945}, {0x04D4BA0A,0x8E656826}, - {0x882AB749,0x11F651F8}, {0xF6793D8A,0xD77DC96E}, {0x2B042DCD,0xEF2799F5}, {0x7A8730C9,0x48EEF0B0}, - {0x0D547392,0x22F1A2ED}, {0x2FD097C7,0x6142F1D3}, {0x6AF0E2E1,0x4A674D28}, {0x748CBED2,0x80FD7CC9}, - {0xAF4F499A,0x717E7067}, {0xECD1DBB3,0x938290A9}, {0x344DD172,0x88E3B293}, {0x250FA3D6,0x2734158C}, -}; -// KeySchedule -__constant__ static uint64_t _ALIGN(32) CC[12][8] = { - {0xe9daca1eda5b08b1, 0x1f7c65c0812fcbeb, 0x16d0452e43766a2f, 0xfcc485758db84e71, 0x0169679291e07c4b, 0x15d360a4082a42a2, 0x234d74cc36747605, 0x0745a6f2596580dd}, - {0x1a2f9da98ab5a36f, 0xd7b5700f469de34f, 0x982b230a72eafef3, 0x3101b5160f5ed561, 0x5899d6126b17b59a, 0xcaa70adbc261b55c, 0x56cdcbd71ba2dd55, 0xb79bb121700479e6}, - {0xc72fce2bacdc74f5, 0x35843d6a28fc390a, 0x8b1f9c525f5ef106, 0x7b7b29b11475eaf2, 0xb19e3590e40fe2d3, 0x09db6260373ac9c1, 0x31db7a8643f4b6c2, 0xb20aba0af5961e99}, - {0xd26615e8b3df1fef, 0xdde4715da0e148f9, 0x7d3c5c337e858e48, 0x3f355e68ad1c729d, 0x75d603ed822cd7a9, 0xbe0352933313b7d8, 0xf137e893a1ea5334, 0x2ed1e384bcbe0c22}, - {0x994747adac6bea4b, 0x6323a96c0c413f9a, 0x4a1086161f1c157f, 0xbdff0f80d7359e35, 0xa3f53a254717cdbf, 0x161a2723b700ffdf, 0xf563eaa97ea2567a, 0x57fe6c7cfd581760}, - {0xd9d33a1daeae4fae, 0xc039307a3bc3a46f, 0x6ca44251f9c4662d, 0xc68ef09ab49a7f18, 0xb4b79a1cb7a6facf, 0xb6c6bec2661ff20a, 0x354f903672c571bf, 0x6e7d64467a4068fa}, - {0xecc5aaee160ec7f4, 0x540924bffe86ac51, 0xc987bfe6c7c69e39, 0xc9937a19333e47d3, 0x372c822dc5ab9209, 0x04054a2883694706, 0xf34a3ca24c451735, 0x93d4143a4d568688}, - {0xa7c9934d425b1f9b, 0x41416e0c02aae703, 0x1ede369c71f8b74e, 0x9ac4db4d3b44b489, 0x90069b92cb2b89f4, 0x2fc4a5d12b8dd169, 0xd9a8515935c2ac36, 0x1ee702bfd40d7fa4}, - {0x9b223116545a8f37, 0xde5f16ecd89a4c94, 0x244289251b3a7d3a, 0x84090de0b755d93c, 0xb1ceb2db0b440a80, 0x549c07a69a8a2b7b, 0x602a1fcb92dc380e, 0xdb5a238351446172}, - {0x526f0580a6debeab, 0xf3f3e4b248e52a38, 0xdb788aff1ce74189, 0x0361331b8ae1ff1f, 0x4b3369af0267e79f, 0xf452763b306c1e7a, 0xc3b63b15d1fa9836, 0xed9c4598fbc7b474}, - {0xfb89c8efd09ecd7b, 0x94fe5a63cdc60230, 0x6107abebbb6bfad8, 0x7966841421800120, 0xcab948eaef711d8a, 0x986e477d1dcdbaef, 0x5dd86fc04a59a2de, 0x1b2df381cda4ca6b}, - {0xba3116f167e78e37, 0x7ab14904b08013d2, 0x771ddfbc323ca4cd, 0x9b9f2130d41220f8, 0x86cc91189def805d, 0x5228e188aaa41de7, 0x991bb2d9d517f4fa, 0x20d71bf14a92bc48} -}; - -__constant__ static uint64_t _ALIGN(32) precomputed_values[12][8] = { - 0x8FD72F640708B0D0, 0x0DE874C7EBC3F213, 0xE92EEF3AD202E9E0, 0xC1E9DA0708013DA7, 0x9727DAB2F014BE88, 0x103051A02BCD6935, 0x33EC7E1DBD28F736, 0x1ECF460CF78AD1F4, - 0x0B2D9F89C775449D, 0x6B6EEFC6DAB7E8B0, 0xF1A0D31667F6EC44, 0x2A71132D5E108166, 0x0E9357C2EC87931A, 0xC99F5C1B4A01612D, 0x7E60B16E637D4EE2, 0xA9FCB827F9BA6D81, - 0x231FECA5AB3D285C, 0x70C6E1483C838C3B, 0x9C21C3C40CE4E2DA, 0x2FA796BD5688E573, 0x04C0E3FF55809FDF, 0x5FF978BFB8E3CDC8, 0xC54A19D6A3D07033, 0x0FCA83FDDE872478, - 0xBDF9312726339F10, 0x51A5BA1793BC9C56, 0xC4428DA14F96D2D4, 0xEC925222374EAB1F, 0x79477893747DD92F, 0xC495E19A46886304, 0x9C23F893BA7CFA36, 0x0C47268881FC5FEB, - 0xCF117966029B2CB3, 0x07179ABE77088A8F, 0x671EF4CC2650E257, 0x7474B8B170DAB5C6, 0x4224FEBECF35113E, 0x993D156C675C5537, 0x2DEE3A5782C39B45, 0xE7C586F2990DD385, - 0x8608FD95B1C1138A, 0x8BB0847D9E9849AC, 0x5E76623F4F0EB0C7, 0x34C2BDBAFC5060CE, 0xE9E814475907826C, 0x22C9ED94D6AAC7C9, 0xE6B75E28171EB0D6, 0xF1329E5534E60215, - 0x86BB4814B1C3CE52, 0xE8F226C9FBDDD017, 0xCEDED67991CB3087, 0x76C33E32FDBFACA5, 0xDBB13BE1A9F7474C, 0x3D0273470342C356, 0x8E7246C51CF07F61, 0xAC8C125DDEF8DF71, - 0x6D73E747795B8CF3, 0x4E4AA65EA0072050, 0xA14A1582CB43C2B9, 0x748EF2B7BB63B938, 0x126789534410D7D4, 0xD4D48FF40301D791, 0xC67DFBE315C41FC0, 0x35E7A1A1AF88601C, - 0x9BD33EA0FAB34007, 0xF51B7CDBE3D67D25, 0xD3ABDA0CE4186E6B, 0x8E61DDADCBCE1706, 0x58994565B41BE6A5, 0x7A87ABC1240CD31D, 0xFAFE6C28487968D0, 0x15B368609FF9EEA7, - 0xAE33263CCF115818, 0x93B2DBE9CADFCFC8, 0x0A91952BF91B0147, 0x458E67CA5F1ED73A, 0x94C2E5F288F074E3, 0x377895E85C69E996, 0xF11A4456AAB37B10, 0x163131934816821A, - 0xD07E4A2366BF469D, 0x5EF1A3D220213B6C, 0x3C5BB78971D8ED0F, 0x0DE05E6B9006F2D2, 0xC58CFB00B8EAA1C9, 0xEFCDB54D1F250B76, 0xFD135634FA527042, 0x4CEE791290516407, - 0xD800B9264010790F, 0x974C4823E2B668D7, 0xA605A4B385C5E361, 0x3F6C92DA5A56D8D2, 0x82B9D67C12EF8277, 0x0AB6B4582561BF90, 0x46954FD98FC2CBA3, 0x70BE45CB21B6760D -}; - - -#define T0(x) shared[0][x] -#define T1(x) shared[1][x] -#define T2(x) shared[2][x] -#define T3(x) shared[3][x] -#define T4(x) shared[4][x] -#define T5(x) shared[5][x] -#define T6(x) shared[6][x] -#define T7(x) shared[7][x] - -__device__ __forceinline__ -void GOST_FS(const uint2* state,uint2* return_state, const uint2 shared[8][256]){ - - #pragma unroll 4 - for(uint32_t i=0;i<4;i++){ - return_state[i] = T0(__byte_perm(state[7].x,0,0x44440 + (i&3))) ^ T1(__byte_perm(state[6].x,0,0x44440 + (i&3))) - ^ T2(__byte_perm(state[5].x,0,0x44440 + (i&3))) ^ T3(__byte_perm(state[4].x,0,0x44440 + (i&3))) - ^ T4(__byte_perm(state[3].x,0,0x44440 + (i&3))) ^ T5(__byte_perm(state[2].x,0,0x44440 + (i&3))) - ^ T6(__byte_perm(state[1].x,0,0x44440 + (i&3))) ^ T7(__byte_perm(state[0].x,0,0x44440 + (i&3))); - } - - #pragma unroll 4 - for(uint32_t i=0;i<4;i++){ - return_state[i+4] = T0(__byte_perm(state[7].y,0,0x44440 + (i&3))) ^ T1(__byte_perm(state[6].y,0,0x44440 + (i&3))) - ^ T2(__byte_perm(state[5].y,0,0x44440 + (i&3))) ^ T3(__byte_perm(state[4].y,0,0x44440 + (i&3))) - ^ T4(__byte_perm(state[3].y,0,0x44440 + (i&3))) ^ T5(__byte_perm(state[2].y,0,0x44440 + (i&3))) - ^ T6(__byte_perm(state[1].y,0,0x44440 + (i&3))) ^ T7(__byte_perm(state[0].y,0,0x44440 + (i&3))); - } -} - -__device__ __forceinline__ -static void GOST_E12(uint2* K, uint2* state,const uint2 shared[8][256]){ - - uint2 t[ 8]; - - #pragma unroll 2 - for(uint32_t i=0; i<12; i++){ - GOST_FS(state, t, shared); - #pragma unroll 8 - for(uint32_t j=0;j<8;j++){ - state[ j] = t[ j]; - K[ j] ^= *(uint2*)&CC[i][j]; - } - - GOST_FS(K, t, shared); - #pragma unroll 8 - for(uint32_t j=0;j<8;j++){ - K[ j] = t[ j]; - state[ j] = state[ j] ^ t[ j]; - } - } -} - -#define TPB 128 -__global__ -__launch_bounds__(TPB, 4) -void streebog_gpu_hash_64(uint64_t *g_hash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - uint2 buf[8], t[8], temp[8],K0[8], hash[8]; - - __shared__ uint2 shared[8][256]; - shared[0][threadIdx.x] = T02[threadIdx.x]; - shared[1][threadIdx.x] = T12[threadIdx.x]; - shared[2][threadIdx.x] = T22[threadIdx.x]; - shared[3][threadIdx.x] = T32[threadIdx.x]; - shared[4][threadIdx.x] = T42[threadIdx.x]; - shared[5][threadIdx.x] = T52[threadIdx.x]; - shared[6][threadIdx.x] = T62[threadIdx.x]; - shared[7][threadIdx.x] = T72[threadIdx.x]; - - const uint32_t t2 = (threadIdx.x & 0x7f) + 0x80; - shared[0][t2] = T02[t2]; shared[1][t2] = T12[t2]; - shared[2][t2] = T22[t2]; shared[3][t2] = T32[t2]; - shared[4][t2] = T42[t2]; shared[5][t2] = T52[t2]; - shared[6][t2] = T62[t2]; shared[7][t2] = T72[t2]; - - __syncthreads(); -// if (thread < threads) -// { - uint64_t* inout = &g_hash[thread<<3]; - - *(uint2x4*)&hash[0] = __ldg4((uint2x4*)&inout[0]); - *(uint2x4*)&hash[4] = __ldg4((uint2x4*)&inout[4]); - - K0[0] = K0[1] = K0[2] = K0[3] = K0[4] = K0[5] = K0[6] = K0[7] = vectorize(0x74a5d4ce2efc83b3); - - #pragma unroll 8 - for(uint32_t i=0;i<8;i++){ - buf[ i] = hash[ i] ^ K0[ i]; - } - - #pragma unroll 11 - for(uint32_t i=0; i<11; i++){ - GOST_FS(buf, temp, shared); - #pragma unroll 8 - for(uint32_t j=0;j<8;j++){ - buf[ j] = temp[ j] ^ *(uint2*)&precomputed_values[i][j]; - } - } - GOST_FS(buf, temp, shared); - #pragma unroll 8 - for(uint32_t j=0;j<8;j++){ - buf[ j] = hash[ j] ^ temp[ j] ^ *(uint2*)&precomputed_values[11][j]; - K0[ j] = buf[ j]; - } - - K0[7].y ^= 0x00020000; - - GOST_FS(K0, t, shared); - - #pragma unroll 8 - for(uint32_t i=0;i<8;i++) - K0[ i] = t[ i]; - - t[7].y ^= 0x01000000; - - #pragma unroll 1 - for(uint32_t i=0; i<11; i++){ - GOST_FS(t, temp, shared); - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++){ - t[ j] = temp[ j]; - K0[ j] = K0[ j] ^ *(uint2*)&CC[i][j]; - } - - GOST_FS(K0, temp, shared); - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++){ - K0[ j] = temp[ j]; - t[ j] ^= temp[ j]; - } - } - GOST_FS(t, temp, shared); - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++){ - t[ j] = temp[ j]; - K0[ j] = K0[ j] ^ *(uint2*)&CC[11][j]; - } - - GOST_FS(K0, temp, shared); - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++){ - t[ j] ^= temp[ j]; - } - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++) - buf[ j] ^= t[ j]; - - buf[7].y ^= 0x01000000; - - GOST_FS(buf,K0, shared); - - buf[7].y ^= 0x00020000; - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++) - t[ j] = K0[ j]; - - t[7].y ^= 0x00020000; - - GOST_E12(K0, t, shared); - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++) - buf[ j] ^= t[ j]; - - GOST_FS(buf,K0, shared); // K = F(h) - - hash[7]+= vectorize(0x0100000000000000); - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++) - t[ j] = K0[ j] ^ hash[ j]; - - GOST_E12(K0, t, shared); - - *(ulonglong2to8*)&t[ 0] = *(ulonglong2to8*)&t[ 0] ^ *(ulonglong2to8*)&hash[ 0] ^ *(ulonglong2to8*)&buf[ 0]; - *(uint2x4*)&inout[ 0] = *(uint2x4*)&t[ 0]; - *(uint2x4*)&inout[ 4] = *(uint2x4*)&t[ 4]; -} - -__host__ -void streebog_cpu_hash_64(int thr_id, uint32_t threads, uint32_t *d_hash) -{ - dim3 grid((threads + TPB-1) / TPB); - dim3 block(TPB); - if(((float)((threads + TPB-1) / TPB) - (int)((threads + TPB-1) / TPB))!=0.0){ - applog(LOG_WARNING,"Invalid intensity for streeebog"); - } - - streebog_gpu_hash_64<<>>((uint64_t*)d_hash); -} - -#undef T0 -#undef T1 -#undef T2 -#undef T3 -#undef T4 -#undef T5 -#undef T6 -#undef T7 - -#define T0(x) shared[0][x] -#define T1(x) shared[1][x] -#define T2(x) shared[2][x] -#define T3(x) shared[3][x] -#define T4(x) shared[4][x] -#define T5(x) shared[5][x] -#define T6(x) shared[6][x] -#define T7(x) shared[7][x] - -// Streebog final for Veltor and skunk on SM 3.x -__constant__ uint64_t target64[4]; - -__host__ -void streebog_sm3_set_target(uint32_t* ptarget) -{ - cudaMemcpyToSymbol(target64,ptarget,4*sizeof(uint64_t),0,cudaMemcpyHostToDevice); -} - -__global__ -__launch_bounds__(TPB, 4) -void streebog_gpu_hash_64_final(uint64_t *g_hash, uint32_t* resNonce) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - uint2 buf[8], t[8], temp[8],K0[8], hash[8]; - - __shared__ uint2 shared[8][256]; - shared[0][threadIdx.x] = T02[threadIdx.x]; - shared[1][threadIdx.x] = T12[threadIdx.x]; - shared[2][threadIdx.x] = T22[threadIdx.x]; - shared[3][threadIdx.x] = T32[threadIdx.x]; - shared[4][threadIdx.x] = T42[threadIdx.x]; - shared[5][threadIdx.x] = T52[threadIdx.x]; - shared[6][threadIdx.x] = T62[threadIdx.x]; - shared[7][threadIdx.x] = T72[threadIdx.x]; - - const uint32_t t2 = (threadIdx.x & 0x7f) + 0x80; - shared[0][t2] = T02[t2]; shared[1][t2] = T12[t2]; - shared[2][t2] = T22[t2]; shared[3][t2] = T32[t2]; - shared[4][t2] = T42[t2]; shared[5][t2] = T52[t2]; - shared[6][t2] = T62[t2]; shared[7][t2] = T72[t2]; - - __syncthreads(); -// if (thread < threads) -// { - uint64_t* inout = &g_hash[thread<<3]; - - *(uint2x4*)&hash[0] = __ldg4((uint2x4*)&inout[0]); - *(uint2x4*)&hash[4] = __ldg4((uint2x4*)&inout[4]); - - K0[0] = K0[1] = K0[2] = K0[3] = K0[4] = K0[5] = K0[6] = K0[7] = vectorize(0x74a5d4ce2efc83b3); - - #pragma unroll 8 - for(uint32_t i=0;i<8;i++){ - buf[ i] = hash[ i] ^ K0[ i]; - } - - #pragma unroll 11 - for(uint32_t i=0; i<11; i++){ - GOST_FS(buf, temp, shared); - #pragma unroll 8 - for(uint32_t j=0;j<8;j++){ - buf[ j] = temp[ j] ^ *(uint2*)&precomputed_values[i][j]; - } - } - GOST_FS(buf, temp, shared); - #pragma unroll 8 - for(uint32_t j=0;j<8;j++){ - buf[ j] = hash[ j] ^ temp[ j] ^ *(uint2*)&precomputed_values[11][j]; - K0[ j] = buf[ j]; - } - - K0[7].y ^= 0x00020000; - - GOST_FS(K0, t, shared); - - #pragma unroll 8 - for(uint32_t i=0;i<8;i++) - K0[ i] = t[ i]; - - t[7].y ^= 0x01000000; - - #pragma unroll 1 - for(uint32_t i=0; i<11; i++){ - GOST_FS(t, temp, shared); - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++){ - t[ j] = temp[ j]; - K0[ j] = K0[ j] ^ *(uint2*)&CC[i][j]; - } - - GOST_FS(K0, temp, shared); - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++){ - K0[ j] = temp[ j]; - t[ j] ^= temp[ j]; - } - } - GOST_FS(t, temp, shared); - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++){ - t[ j] = temp[ j]; - K0[ j] = K0[ j] ^ *(uint2*)&CC[11][j]; - } - - GOST_FS(K0, temp, shared); - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++){ - t[ j] ^= temp[ j]; - } - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++) - buf[ j] ^= t[ j]; - - buf[7].y ^= 0x01000000; - - GOST_FS(buf,K0, shared); - - buf[7].y ^= 0x00020000; - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++) - t[ j] = K0[ j]; - - t[7].y ^= 0x00020000; - - GOST_E12(K0, t, shared); - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++) - buf[ j] ^= t[ j]; - - GOST_FS(buf,K0, shared); // K = F(h) - - hash[7]+= vectorize(0x0100000000000000); - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++) - t[ j] = K0[ j] ^ hash[ j]; - -// #pragma unroll - for(uint32_t i=0; i<10; i++){ - GOST_FS(t, temp, shared); - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++){ - t[ j] = temp[ j]; - K0[ j] = K0[ j] ^ *(uint2*)&CC[ i][ j]; - } - - GOST_FS(K0, temp, shared); - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++){ - K0[ j] = temp[ j]; - t[ j]^= temp[ j]; - } - } - - GOST_FS(t, temp, shared); - - #pragma unroll 8 - for(uint32_t j=0;j<8;j++){ - t[ j] = temp[ j]; - K0[ j] = K0[ j] ^ *(uint2*)&CC[10][ j]; - } - - GOST_FS(K0, temp, shared); - - #pragma unroll 8 - for(int i=7;i>=0;i--){ - t[i].x = t[i].x ^ temp[i].x; - temp[i].x = temp[i].x ^ ((uint32_t*)&CC[11])[i<<1]; - } - - uint2 last[2]; - - last[ 0] = T0(__byte_perm(t[7].x,0,0x44443)) ^ T1(__byte_perm(t[6].x,0,0x44443)) - ^ T2(__byte_perm(t[5].x,0,0x44443)) ^ T3(__byte_perm(t[4].x,0,0x44443)) - ^ T4(__byte_perm(t[3].x,0,0x44443)) ^ T5(__byte_perm(t[2].x,0,0x44443)) - ^ T6(__byte_perm(t[1].x,0,0x44443)) ^ T7(__byte_perm(t[0].x,0,0x44443)); - - last[ 1] = T0(__byte_perm(temp[7].x,0,0x44443)) ^ T1(__byte_perm(temp[6].x,0,0x44443)) - ^ T2(__byte_perm(temp[5].x,0,0x44443)) ^ T3(__byte_perm(temp[4].x,0,0x44443)) - ^ T4(__byte_perm(temp[3].x,0,0x44443)) ^ T5(__byte_perm(temp[2].x,0,0x44443)) - ^ T6(__byte_perm(temp[1].x,0,0x44443)) ^ T7(__byte_perm(temp[0].x,0,0x44443)); - - if(devectorize(buf[3] ^ hash[3] ^ last[ 0] ^ last[ 1]) <= target64[3]){ - uint32_t tmp = atomicExch(&resNonce[0], thread); - if (tmp != UINT32_MAX) - resNonce[1] = tmp; - } -} - -__host__ -void streebog_sm3_hash_64_final(int thr_id, uint32_t threads, uint32_t *d_hash,uint32_t* d_resNonce) -{ - dim3 grid((threads + TPB-1) / TPB); - dim3 block(TPB); - if(((float)((threads + TPB-1) / TPB) - (int)((threads + TPB-1) / TPB))!=0.0){ - applog(LOG_WARNING,"Invalid intensity for streeebog final"); - } - - streebog_gpu_hash_64_final<<>>((uint64_t*)d_hash, d_resNonce); -} diff --git a/x11/cuda_streebog_maxwell.cu b/x11/cuda_streebog_maxwell.cu deleted file mode 100644 index 6a063329..00000000 --- a/x11/cuda_streebog_maxwell.cu +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Streebog GOST R 34.10-2012 CUDA implementation. - * - * https://tools.ietf.org/html/rfc6986 - * https://en.wikipedia.org/wiki/Streebog - * - * ==========================(LICENSE BEGIN)============================ - * - * @author Tanguy Pruvot - 2015 - * @author Alexis Provos - 2016 - */ - -// Further improved with shared memory partial utilization -// Tested under CUDA7.5 toolkit for cp 5.0/5.2 - -//#include -#include -#include -#include - -#include "streebog_arrays.cuh" - -//#define FULL_UNROLL -__device__ __forceinline__ -static void GOST_FS(const uint2 shared[8][256],const uint2 *const __restrict__ state,uint2* return_state) -{ - return_state[0] = __ldg(&T02[__byte_perm(state[7].x,0,0x44440)]) - ^ shared[1][__byte_perm(state[6].x,0,0x44440)] - ^ shared[2][__byte_perm(state[5].x,0,0x44440)] - ^ shared[3][__byte_perm(state[4].x,0,0x44440)] - ^ shared[4][__byte_perm(state[3].x,0,0x44440)] - ^ shared[5][__byte_perm(state[2].x,0,0x44440)] - ^ shared[6][__byte_perm(state[1].x,0,0x44440)] - ^ __ldg(&T72[__byte_perm(state[0].x,0,0x44440)]); - - return_state[1] = __ldg(&T02[__byte_perm(state[7].x,0,0x44441)]) - ^ __ldg(&T12[__byte_perm(state[6].x,0,0x44441)]) - ^ shared[2][__byte_perm(state[5].x,0,0x44441)] - ^ shared[3][__byte_perm(state[4].x,0,0x44441)] - ^ shared[4][__byte_perm(state[3].x,0,0x44441)] - ^ shared[5][__byte_perm(state[2].x,0,0x44441)] - ^ shared[6][__byte_perm(state[1].x,0,0x44441)] - ^ __ldg(&T72[__byte_perm(state[0].x,0,0x44441)]); - - return_state[2] = __ldg(&T02[__byte_perm(state[7].x,0,0x44442)]) - ^ __ldg(&T12[__byte_perm(state[6].x,0,0x44442)]) - ^ shared[2][__byte_perm(state[5].x,0,0x44442)] - ^ shared[3][__byte_perm(state[4].x,0,0x44442)] - ^ shared[4][__byte_perm(state[3].x,0,0x44442)] - ^ shared[5][__byte_perm(state[2].x,0,0x44442)] - ^ __ldg(&T72[__byte_perm(state[0].x,0,0x44442)]) - ^ shared[6][__byte_perm(state[1].x,0,0x44442)]; - - return_state[3] = __ldg(&T02[__byte_perm(state[7].x,0,0x44443)]) - ^ shared[1][__byte_perm(state[6].x,0,0x44443)] - ^ shared[2][__byte_perm(state[5].x,0,0x44443)] - ^ shared[3][__byte_perm(state[4].x,0,0x44443)] - ^ __ldg(&T42[__byte_perm(state[3].x,0,0x44443)]) - ^ shared[5][__byte_perm(state[2].x,0,0x44443)] - ^ __ldg(&T72[__byte_perm(state[0].x,0,0x44443)]) - ^ shared[6][__byte_perm(state[1].x,0,0x44443)]; - - return_state[4] = __ldg(&T02[__byte_perm(state[7].y,0,0x44440)]) - ^ shared[1][__byte_perm(state[6].y,0,0x44440)] - ^ __ldg(&T22[__byte_perm(state[5].y,0,0x44440)]) - ^ shared[3][__byte_perm(state[4].y,0,0x44440)] - ^ shared[4][__byte_perm(state[3].y,0,0x44440)] - ^ __ldg(&T62[__byte_perm(state[1].y,0,0x44440)]) - ^ shared[5][__byte_perm(state[2].y,0,0x44440)] - ^ __ldg(&T72[__byte_perm(state[0].y,0,0x44440)]); - - return_state[5] = __ldg(&T02[__byte_perm(state[7].y,0,0x44441)]) - ^ shared[2][__byte_perm(state[5].y,0,0x44441)] - ^ __ldg(&T12[__byte_perm(state[6].y,0,0x44441)]) - ^ shared[3][__byte_perm(state[4].y,0,0x44441)] - ^ shared[4][__byte_perm(state[3].y,0,0x44441)] - ^ shared[5][__byte_perm(state[2].y,0,0x44441)] - ^ __ldg(&T62[__byte_perm(state[1].y,0,0x44441)]) - ^ __ldg(&T72[__byte_perm(state[0].y,0,0x44441)]); - - return_state[6] = __ldg(&T02[__byte_perm(state[7].y,0,0x44442)]) - ^ shared[1][__byte_perm(state[6].y,0,0x44442)] - ^ shared[2][__byte_perm(state[5].y,0,0x44442)] - ^ shared[3][__byte_perm(state[4].y,0,0x44442)] - ^ shared[4][__byte_perm(state[3].y,0,0x44442)] - ^ shared[5][__byte_perm(state[2].y,0,0x44442)] - ^ __ldg(&T62[__byte_perm(state[1].y,0,0x44442)]) - ^ __ldg(&T72[__byte_perm(state[0].y,0,0x44442)]); - - return_state[7] = __ldg(&T02[__byte_perm(state[7].y,0,0x44443)]) - ^ __ldg(&T12[__byte_perm(state[6].y,0,0x44443)]) - ^ shared[2][__byte_perm(state[5].y,0,0x44443)] - ^ shared[3][__byte_perm(state[4].y,0,0x44443)] - ^ shared[4][__byte_perm(state[3].y,0,0x44443)] - ^ shared[5][__byte_perm(state[2].y,0,0x44443)] - ^ __ldg(&T62[__byte_perm(state[1].y,0,0x44443)]) - ^ __ldg(&T72[__byte_perm(state[0].y,0,0x44443)]); -} - -__device__ __forceinline__ -static void GOST_FS_LDG(const uint2 shared[8][256],const uint2 *const __restrict__ state,uint2* return_state) -{ - return_state[0] = __ldg(&T02[__byte_perm(state[7].x,0,0x44440)]) - ^ __ldg(&T12[__byte_perm(state[6].x,0,0x44440)]) - ^ shared[2][__byte_perm(state[5].x,0,0x44440)] - ^ shared[3][__byte_perm(state[4].x,0,0x44440)] - ^ shared[4][__byte_perm(state[3].x,0,0x44440)] - ^ shared[5][__byte_perm(state[2].x,0,0x44440)] - ^ shared[6][__byte_perm(state[1].x,0,0x44440)] - ^ __ldg(&T72[__byte_perm(state[0].x,0,0x44440)]); - - return_state[1] = __ldg(&T02[__byte_perm(state[7].x,0,0x44441)]) - ^ __ldg(&T12[__byte_perm(state[6].x,0,0x44441)]) - ^ shared[2][__byte_perm(state[5].x,0,0x44441)] - ^ shared[3][__byte_perm(state[4].x,0,0x44441)] - ^ shared[4][__byte_perm(state[3].x,0,0x44441)] - ^ shared[5][__byte_perm(state[2].x,0,0x44441)] - ^ __ldg(&T72[__byte_perm(state[0].x,0,0x44441)]) - ^ shared[6][__byte_perm(state[1].x,0,0x44441)]; - - return_state[2] = __ldg(&T02[__byte_perm(state[7].x,0,0x44442)]) - ^ __ldg(&T12[__byte_perm(state[6].x,0,0x44442)]) - ^ shared[2][__byte_perm(state[5].x,0,0x44442)] - ^ shared[3][__byte_perm(state[4].x,0,0x44442)] - ^ shared[4][__byte_perm(state[3].x,0,0x44442)] - ^ shared[5][__byte_perm(state[2].x,0,0x44442)] - ^ shared[6][__byte_perm(state[1].x,0,0x44442)] - ^ __ldg(&T72[__byte_perm(state[0].x,0,0x44442)]); - - return_state[3] = __ldg(&T02[__byte_perm(state[7].x,0,0x44443)]) - ^ __ldg(&T12[__byte_perm(state[6].x,0,0x44443)]) - ^ shared[2][__byte_perm(state[5].x,0,0x44443)] - ^ shared[3][__byte_perm(state[4].x,0,0x44443)] - ^ shared[4][__byte_perm(state[3].x,0,0x44443)] - ^ shared[5][__byte_perm(state[2].x,0,0x44443)] - ^ shared[6][__byte_perm(state[1].x,0,0x44443)] - ^ __ldg(&T72[__byte_perm(state[0].x,0,0x44443)]); - - return_state[4] = __ldg(&T02[__byte_perm(state[7].y,0,0x44440)]) - ^ shared[1][__byte_perm(state[6].y,0,0x44440)] - ^ __ldg(&T22[__byte_perm(state[5].y,0,0x44440)]) - ^ shared[3][__byte_perm(state[4].y,0,0x44440)] - ^ shared[4][__byte_perm(state[3].y,0,0x44440)] - ^ shared[5][__byte_perm(state[2].y,0,0x44440)] - ^ __ldg(&T72[__byte_perm(state[0].y,0,0x44440)]) - ^ __ldg(&T62[__byte_perm(state[1].y,0,0x44440)]); - - return_state[5] = __ldg(&T02[__byte_perm(state[7].y,0,0x44441)]) - ^ __ldg(&T12[__byte_perm(state[6].y,0,0x44441)]) - ^ shared[2][__byte_perm(state[5].y,0,0x44441)] - ^ shared[3][__byte_perm(state[4].y,0,0x44441)] - ^ shared[4][__byte_perm(state[3].y,0,0x44441)] - ^ shared[5][__byte_perm(state[2].y,0,0x44441)] - ^ __ldg(&T72[__byte_perm(state[0].y,0,0x44441)]) - ^ __ldg(&T62[__byte_perm(state[1].y,0,0x44441)]); - - return_state[6] = __ldg(&T02[__byte_perm(state[7].y,0,0x44442)]) - ^ __ldg(&T12[__byte_perm(state[6].y,0,0x44442)]) - ^ __ldg(&T22[__byte_perm(state[5].y,0,0x44442)]) - ^ shared[3][__byte_perm(state[4].y,0,0x44442)] - ^ shared[4][__byte_perm(state[3].y,0,0x44442)] - ^ shared[5][__byte_perm(state[2].y,0,0x44442)] - ^ __ldg(&T72[__byte_perm(state[0].y,0,0x44442)]) - ^ __ldg(&T62[__byte_perm(state[1].y,0,0x44442)]); - - return_state[7] = __ldg(&T02[__byte_perm(state[7].y,0,0x44443)]) - ^ shared[1][__byte_perm(state[6].y,0,0x44443)] - ^ __ldg(&T22[__byte_perm(state[5].y,0,0x44443)]) - ^ shared[3][__byte_perm(state[4].y,0,0x44443)] - ^ shared[4][__byte_perm(state[3].y,0,0x44443)] - ^ shared[5][__byte_perm(state[2].y,0,0x44443)] - ^ __ldg(&T72[__byte_perm(state[0].y,0,0x44443)]) - ^ __ldg(&T62[__byte_perm(state[1].y,0,0x44443)]); -} - -__device__ __forceinline__ -static void GOST_E12(const uint2 shared[8][256],uint2 *const __restrict__ K, uint2 *const __restrict__ state) -{ - uint2 t[8]; - for(int i=0; i<12; i++){ - GOST_FS(shared,state, t); - - #pragma unroll 8 - for(int j=0;j<8;j++) - K[ j] ^= *(uint2*)&CC[i][j]; - - #pragma unroll 8 - for(int j=0;j<8;j++) - state[ j] = t[ j]; - - GOST_FS_LDG(shared,K, t); - - #pragma unroll 8 - for(int j=0;j<8;j++) - state[ j]^= t[ j]; - - #pragma unroll 8 - for(int j=0;j<8;j++) - K[ j] = t[ j]; - } -} - -#define TPB 256 -__global__ -#if __CUDA_ARCH__ > 500 -__launch_bounds__(TPB, 3) -#else -__launch_bounds__(TPB, 3) -#endif -void streebog_gpu_hash_64_maxwell(uint64_t *g_hash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - uint2 buf[8], t[8], temp[8], K0[8], hash[8]; - - __shared__ uint2 shared[8][256]; - shared[0][threadIdx.x] = __ldg(&T02[threadIdx.x]); - shared[1][threadIdx.x] = __ldg(&T12[threadIdx.x]); - shared[2][threadIdx.x] = __ldg(&T22[threadIdx.x]); - shared[3][threadIdx.x] = __ldg(&T32[threadIdx.x]); - shared[4][threadIdx.x] = __ldg(&T42[threadIdx.x]); - shared[5][threadIdx.x] = __ldg(&T52[threadIdx.x]); - shared[6][threadIdx.x] = __ldg(&T62[threadIdx.x]); - shared[7][threadIdx.x] = __ldg(&T72[threadIdx.x]); - - uint64_t* inout = &g_hash[thread<<3]; - - *(uint2x4*)&hash[0] = __ldg4((uint2x4*)&inout[0]); - *(uint2x4*)&hash[4] = __ldg4((uint2x4*)&inout[4]); - - __threadfence_block(); - - K0[0] = vectorize(0x74a5d4ce2efc83b3); - - #pragma unroll 8 - for(int i=0;i<8;i++){ - buf[ i] = K0[ 0] ^ hash[ i]; - } - - for(int i=0; i<12; i++){ - GOST_FS(shared, buf, temp); - #pragma unroll 8 - for(uint32_t j=0;j<8;j++){ - buf[ j] = temp[ j] ^ *(uint2*)&precomputed_values[i][j]; - } - } - #pragma unroll 8 - for(int j=0;j<8;j++){ - buf[ j]^= hash[ j]; - } - #pragma unroll 8 - for(int j=0;j<8;j++){ - K0[ j] = buf[ j]; - } - - K0[7].y ^= 0x00020000; - - GOST_FS(shared, K0, t); - - #pragma unroll 8 - for(int i=0;i<8;i++) - K0[ i] = t[ i]; - - t[7].y ^= 0x01000000; - - GOST_E12(shared, K0, t); - - #pragma unroll 8 - for(int j=0;j<8;j++) - buf[ j] ^= t[ j]; - - buf[7].y ^= 0x01000000; - - GOST_FS(shared, buf,K0); - - buf[7].y ^= 0x00020000; - - #pragma unroll 8 - for(int j=0;j<8;j++) - t[ j] = K0[ j]; - - t[7].y ^= 0x00020000; - - GOST_E12(shared, K0, t); - - #pragma unroll 8 - for(int j=0;j<8;j++) - buf[ j] ^= t[ j]; - - GOST_FS(shared, buf,K0); // K = F(h) - - hash[7]+= vectorize(0x0100000000000000); - - #pragma unroll 8 - for(int j=0;j<8;j++) - t[ j] = K0[ j] ^ hash[ j]; - - GOST_E12(shared, K0, t); - - *(uint2x4*)&inout[0] = *(uint2x4*)&t[0] ^ *(uint2x4*)&hash[0] ^ *(uint2x4*)&buf[0]; - *(uint2x4*)&inout[4] = *(uint2x4*)&t[4] ^ *(uint2x4*)&hash[4] ^ *(uint2x4*)&buf[4]; -} - -__host__ -void streebog_hash_64_maxwell(int thr_id, uint32_t threads, uint32_t *d_hash) -{ - dim3 grid((threads + TPB-1) / TPB); - dim3 block(TPB); - streebog_gpu_hash_64_maxwell <<>> ((uint64_t*)d_hash); -} diff --git a/x11/cuda_x11.h b/x11/cuda_x11.h deleted file mode 100644 index 85521579..00000000 --- a/x11/cuda_x11.h +++ /dev/null @@ -1,21 +0,0 @@ -#include "quark/cuda_quark.h" - -extern void x11_luffaCubehash512_cpu_init(int thr_id, uint32_t threads); -extern void x11_luffaCubehash512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t *d_hash, int order); - -extern void x11_luffa512_cpu_init(int thr_id, uint32_t threads); -extern void x11_luffa512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void x11_cubehash512_cpu_init(int thr_id, uint32_t threads); -extern void x11_cubehash512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void x11_shavite512_cpu_init(int thr_id, uint32_t threads); -extern void x11_shavite512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern int x11_simd512_cpu_init(int thr_id, uint32_t threads); -extern void x11_simd512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -extern void x11_simd512_cpu_free(int thr_id); - -extern void x11_echo512_cpu_init(int thr_id, uint32_t threads); -extern void x11_echo512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - diff --git a/x11/cuda_x11_aes.cuh b/x11/cuda_x11_aes.cuh deleted file mode 100644 index 362dd9c1..00000000 --- a/x11/cuda_x11_aes.cuh +++ /dev/null @@ -1,400 +0,0 @@ - -/* AES Helper for inline-usage from SPH */ -#define AESx(x) (x ##UL) /* SPH_C32(x) */ - -//#define DEVICE_DIRECT_CONSTANTS - -#ifdef DEVICE_DIRECT_CONSTANTS -__constant__ __align__(64) uint32_t d_AES0[256] = { -#else -static const uint32_t h_AES0[256] = { -#endif - AESx(0xA56363C6), AESx(0x847C7CF8), AESx(0x997777EE), AESx(0x8D7B7BF6), - AESx(0x0DF2F2FF), AESx(0xBD6B6BD6), AESx(0xB16F6FDE), AESx(0x54C5C591), - AESx(0x50303060), AESx(0x03010102), AESx(0xA96767CE), AESx(0x7D2B2B56), - AESx(0x19FEFEE7), AESx(0x62D7D7B5), AESx(0xE6ABAB4D), AESx(0x9A7676EC), - AESx(0x45CACA8F), AESx(0x9D82821F), AESx(0x40C9C989), AESx(0x877D7DFA), - AESx(0x15FAFAEF), AESx(0xEB5959B2), AESx(0xC947478E), AESx(0x0BF0F0FB), - AESx(0xECADAD41), AESx(0x67D4D4B3), AESx(0xFDA2A25F), AESx(0xEAAFAF45), - AESx(0xBF9C9C23), AESx(0xF7A4A453), AESx(0x967272E4), AESx(0x5BC0C09B), - AESx(0xC2B7B775), AESx(0x1CFDFDE1), AESx(0xAE93933D), AESx(0x6A26264C), - AESx(0x5A36366C), AESx(0x413F3F7E), AESx(0x02F7F7F5), AESx(0x4FCCCC83), - AESx(0x5C343468), AESx(0xF4A5A551), AESx(0x34E5E5D1), AESx(0x08F1F1F9), - AESx(0x937171E2), AESx(0x73D8D8AB), AESx(0x53313162), AESx(0x3F15152A), - AESx(0x0C040408), AESx(0x52C7C795), AESx(0x65232346), AESx(0x5EC3C39D), - AESx(0x28181830), AESx(0xA1969637), AESx(0x0F05050A), AESx(0xB59A9A2F), - AESx(0x0907070E), AESx(0x36121224), AESx(0x9B80801B), AESx(0x3DE2E2DF), - AESx(0x26EBEBCD), AESx(0x6927274E), AESx(0xCDB2B27F), AESx(0x9F7575EA), - AESx(0x1B090912), AESx(0x9E83831D), AESx(0x742C2C58), AESx(0x2E1A1A34), - AESx(0x2D1B1B36), AESx(0xB26E6EDC), AESx(0xEE5A5AB4), AESx(0xFBA0A05B), - AESx(0xF65252A4), AESx(0x4D3B3B76), AESx(0x61D6D6B7), AESx(0xCEB3B37D), - AESx(0x7B292952), AESx(0x3EE3E3DD), AESx(0x712F2F5E), AESx(0x97848413), - AESx(0xF55353A6), AESx(0x68D1D1B9), AESx(0x00000000), AESx(0x2CEDEDC1), - AESx(0x60202040), AESx(0x1FFCFCE3), AESx(0xC8B1B179), AESx(0xED5B5BB6), - AESx(0xBE6A6AD4), AESx(0x46CBCB8D), AESx(0xD9BEBE67), AESx(0x4B393972), - AESx(0xDE4A4A94), AESx(0xD44C4C98), AESx(0xE85858B0), AESx(0x4ACFCF85), - AESx(0x6BD0D0BB), AESx(0x2AEFEFC5), AESx(0xE5AAAA4F), AESx(0x16FBFBED), - AESx(0xC5434386), AESx(0xD74D4D9A), AESx(0x55333366), AESx(0x94858511), - AESx(0xCF45458A), AESx(0x10F9F9E9), AESx(0x06020204), AESx(0x817F7FFE), - AESx(0xF05050A0), AESx(0x443C3C78), AESx(0xBA9F9F25), AESx(0xE3A8A84B), - AESx(0xF35151A2), AESx(0xFEA3A35D), AESx(0xC0404080), AESx(0x8A8F8F05), - AESx(0xAD92923F), AESx(0xBC9D9D21), AESx(0x48383870), AESx(0x04F5F5F1), - AESx(0xDFBCBC63), AESx(0xC1B6B677), AESx(0x75DADAAF), AESx(0x63212142), - AESx(0x30101020), AESx(0x1AFFFFE5), AESx(0x0EF3F3FD), AESx(0x6DD2D2BF), - AESx(0x4CCDCD81), AESx(0x140C0C18), AESx(0x35131326), AESx(0x2FECECC3), - AESx(0xE15F5FBE), AESx(0xA2979735), AESx(0xCC444488), AESx(0x3917172E), - AESx(0x57C4C493), AESx(0xF2A7A755), AESx(0x827E7EFC), AESx(0x473D3D7A), - AESx(0xAC6464C8), AESx(0xE75D5DBA), AESx(0x2B191932), AESx(0x957373E6), - AESx(0xA06060C0), AESx(0x98818119), AESx(0xD14F4F9E), AESx(0x7FDCDCA3), - AESx(0x66222244), AESx(0x7E2A2A54), AESx(0xAB90903B), AESx(0x8388880B), - AESx(0xCA46468C), AESx(0x29EEEEC7), AESx(0xD3B8B86B), AESx(0x3C141428), - AESx(0x79DEDEA7), AESx(0xE25E5EBC), AESx(0x1D0B0B16), AESx(0x76DBDBAD), - AESx(0x3BE0E0DB), AESx(0x56323264), AESx(0x4E3A3A74), AESx(0x1E0A0A14), - AESx(0xDB494992), AESx(0x0A06060C), AESx(0x6C242448), AESx(0xE45C5CB8), - AESx(0x5DC2C29F), AESx(0x6ED3D3BD), AESx(0xEFACAC43), AESx(0xA66262C4), - AESx(0xA8919139), AESx(0xA4959531), AESx(0x37E4E4D3), AESx(0x8B7979F2), - AESx(0x32E7E7D5), AESx(0x43C8C88B), AESx(0x5937376E), AESx(0xB76D6DDA), - AESx(0x8C8D8D01), AESx(0x64D5D5B1), AESx(0xD24E4E9C), AESx(0xE0A9A949), - AESx(0xB46C6CD8), AESx(0xFA5656AC), AESx(0x07F4F4F3), AESx(0x25EAEACF), - AESx(0xAF6565CA), AESx(0x8E7A7AF4), AESx(0xE9AEAE47), AESx(0x18080810), - AESx(0xD5BABA6F), AESx(0x887878F0), AESx(0x6F25254A), AESx(0x722E2E5C), - AESx(0x241C1C38), AESx(0xF1A6A657), AESx(0xC7B4B473), AESx(0x51C6C697), - AESx(0x23E8E8CB), AESx(0x7CDDDDA1), AESx(0x9C7474E8), AESx(0x211F1F3E), - AESx(0xDD4B4B96), AESx(0xDCBDBD61), AESx(0x868B8B0D), AESx(0x858A8A0F), - AESx(0x907070E0), AESx(0x423E3E7C), AESx(0xC4B5B571), AESx(0xAA6666CC), - AESx(0xD8484890), AESx(0x05030306), AESx(0x01F6F6F7), AESx(0x120E0E1C), - AESx(0xA36161C2), AESx(0x5F35356A), AESx(0xF95757AE), AESx(0xD0B9B969), - AESx(0x91868617), AESx(0x58C1C199), AESx(0x271D1D3A), AESx(0xB99E9E27), - AESx(0x38E1E1D9), AESx(0x13F8F8EB), AESx(0xB398982B), AESx(0x33111122), - AESx(0xBB6969D2), AESx(0x70D9D9A9), AESx(0x898E8E07), AESx(0xA7949433), - AESx(0xB69B9B2D), AESx(0x221E1E3C), AESx(0x92878715), AESx(0x20E9E9C9), - AESx(0x49CECE87), AESx(0xFF5555AA), AESx(0x78282850), AESx(0x7ADFDFA5), - AESx(0x8F8C8C03), AESx(0xF8A1A159), AESx(0x80898909), AESx(0x170D0D1A), - AESx(0xDABFBF65), AESx(0x31E6E6D7), AESx(0xC6424284), AESx(0xB86868D0), - AESx(0xC3414182), AESx(0xB0999929), AESx(0x772D2D5A), AESx(0x110F0F1E), - AESx(0xCBB0B07B), AESx(0xFC5454A8), AESx(0xD6BBBB6D), AESx(0x3A16162C) -}; - -#ifdef DEVICE_DIRECT_CONSTANTS -__constant__ __align__(64) uint32_t d_AES1[256] = { -#else -static const uint32_t h_AES1[256] = { -#endif - AESx(0x6363C6A5), AESx(0x7C7CF884), AESx(0x7777EE99), AESx(0x7B7BF68D), - AESx(0xF2F2FF0D), AESx(0x6B6BD6BD), AESx(0x6F6FDEB1), AESx(0xC5C59154), - AESx(0x30306050), AESx(0x01010203), AESx(0x6767CEA9), AESx(0x2B2B567D), - AESx(0xFEFEE719), AESx(0xD7D7B562), AESx(0xABAB4DE6), AESx(0x7676EC9A), - AESx(0xCACA8F45), AESx(0x82821F9D), AESx(0xC9C98940), AESx(0x7D7DFA87), - AESx(0xFAFAEF15), AESx(0x5959B2EB), AESx(0x47478EC9), AESx(0xF0F0FB0B), - AESx(0xADAD41EC), AESx(0xD4D4B367), AESx(0xA2A25FFD), AESx(0xAFAF45EA), - AESx(0x9C9C23BF), AESx(0xA4A453F7), AESx(0x7272E496), AESx(0xC0C09B5B), - AESx(0xB7B775C2), AESx(0xFDFDE11C), AESx(0x93933DAE), AESx(0x26264C6A), - AESx(0x36366C5A), AESx(0x3F3F7E41), AESx(0xF7F7F502), AESx(0xCCCC834F), - AESx(0x3434685C), AESx(0xA5A551F4), AESx(0xE5E5D134), AESx(0xF1F1F908), - AESx(0x7171E293), AESx(0xD8D8AB73), AESx(0x31316253), AESx(0x15152A3F), - AESx(0x0404080C), AESx(0xC7C79552), AESx(0x23234665), AESx(0xC3C39D5E), - AESx(0x18183028), AESx(0x969637A1), AESx(0x05050A0F), AESx(0x9A9A2FB5), - AESx(0x07070E09), AESx(0x12122436), AESx(0x80801B9B), AESx(0xE2E2DF3D), - AESx(0xEBEBCD26), AESx(0x27274E69), AESx(0xB2B27FCD), AESx(0x7575EA9F), - AESx(0x0909121B), AESx(0x83831D9E), AESx(0x2C2C5874), AESx(0x1A1A342E), - AESx(0x1B1B362D), AESx(0x6E6EDCB2), AESx(0x5A5AB4EE), AESx(0xA0A05BFB), - AESx(0x5252A4F6), AESx(0x3B3B764D), AESx(0xD6D6B761), AESx(0xB3B37DCE), - AESx(0x2929527B), AESx(0xE3E3DD3E), AESx(0x2F2F5E71), AESx(0x84841397), - AESx(0x5353A6F5), AESx(0xD1D1B968), AESx(0x00000000), AESx(0xEDEDC12C), - AESx(0x20204060), AESx(0xFCFCE31F), AESx(0xB1B179C8), AESx(0x5B5BB6ED), - AESx(0x6A6AD4BE), AESx(0xCBCB8D46), AESx(0xBEBE67D9), AESx(0x3939724B), - AESx(0x4A4A94DE), AESx(0x4C4C98D4), AESx(0x5858B0E8), AESx(0xCFCF854A), - AESx(0xD0D0BB6B), AESx(0xEFEFC52A), AESx(0xAAAA4FE5), AESx(0xFBFBED16), - AESx(0x434386C5), AESx(0x4D4D9AD7), AESx(0x33336655), AESx(0x85851194), - AESx(0x45458ACF), AESx(0xF9F9E910), AESx(0x02020406), AESx(0x7F7FFE81), - AESx(0x5050A0F0), AESx(0x3C3C7844), AESx(0x9F9F25BA), AESx(0xA8A84BE3), - AESx(0x5151A2F3), AESx(0xA3A35DFE), AESx(0x404080C0), AESx(0x8F8F058A), - AESx(0x92923FAD), AESx(0x9D9D21BC), AESx(0x38387048), AESx(0xF5F5F104), - AESx(0xBCBC63DF), AESx(0xB6B677C1), AESx(0xDADAAF75), AESx(0x21214263), - AESx(0x10102030), AESx(0xFFFFE51A), AESx(0xF3F3FD0E), AESx(0xD2D2BF6D), - AESx(0xCDCD814C), AESx(0x0C0C1814), AESx(0x13132635), AESx(0xECECC32F), - AESx(0x5F5FBEE1), AESx(0x979735A2), AESx(0x444488CC), AESx(0x17172E39), - AESx(0xC4C49357), AESx(0xA7A755F2), AESx(0x7E7EFC82), AESx(0x3D3D7A47), - AESx(0x6464C8AC), AESx(0x5D5DBAE7), AESx(0x1919322B), AESx(0x7373E695), - AESx(0x6060C0A0), AESx(0x81811998), AESx(0x4F4F9ED1), AESx(0xDCDCA37F), - AESx(0x22224466), AESx(0x2A2A547E), AESx(0x90903BAB), AESx(0x88880B83), - AESx(0x46468CCA), AESx(0xEEEEC729), AESx(0xB8B86BD3), AESx(0x1414283C), - AESx(0xDEDEA779), AESx(0x5E5EBCE2), AESx(0x0B0B161D), AESx(0xDBDBAD76), - AESx(0xE0E0DB3B), AESx(0x32326456), AESx(0x3A3A744E), AESx(0x0A0A141E), - AESx(0x494992DB), AESx(0x06060C0A), AESx(0x2424486C), AESx(0x5C5CB8E4), - AESx(0xC2C29F5D), AESx(0xD3D3BD6E), AESx(0xACAC43EF), AESx(0x6262C4A6), - AESx(0x919139A8), AESx(0x959531A4), AESx(0xE4E4D337), AESx(0x7979F28B), - AESx(0xE7E7D532), AESx(0xC8C88B43), AESx(0x37376E59), AESx(0x6D6DDAB7), - AESx(0x8D8D018C), AESx(0xD5D5B164), AESx(0x4E4E9CD2), AESx(0xA9A949E0), - AESx(0x6C6CD8B4), AESx(0x5656ACFA), AESx(0xF4F4F307), AESx(0xEAEACF25), - AESx(0x6565CAAF), AESx(0x7A7AF48E), AESx(0xAEAE47E9), AESx(0x08081018), - AESx(0xBABA6FD5), AESx(0x7878F088), AESx(0x25254A6F), AESx(0x2E2E5C72), - AESx(0x1C1C3824), AESx(0xA6A657F1), AESx(0xB4B473C7), AESx(0xC6C69751), - AESx(0xE8E8CB23), AESx(0xDDDDA17C), AESx(0x7474E89C), AESx(0x1F1F3E21), - AESx(0x4B4B96DD), AESx(0xBDBD61DC), AESx(0x8B8B0D86), AESx(0x8A8A0F85), - AESx(0x7070E090), AESx(0x3E3E7C42), AESx(0xB5B571C4), AESx(0x6666CCAA), - AESx(0x484890D8), AESx(0x03030605), AESx(0xF6F6F701), AESx(0x0E0E1C12), - AESx(0x6161C2A3), AESx(0x35356A5F), AESx(0x5757AEF9), AESx(0xB9B969D0), - AESx(0x86861791), AESx(0xC1C19958), AESx(0x1D1D3A27), AESx(0x9E9E27B9), - AESx(0xE1E1D938), AESx(0xF8F8EB13), AESx(0x98982BB3), AESx(0x11112233), - AESx(0x6969D2BB), AESx(0xD9D9A970), AESx(0x8E8E0789), AESx(0x949433A7), - AESx(0x9B9B2DB6), AESx(0x1E1E3C22), AESx(0x87871592), AESx(0xE9E9C920), - AESx(0xCECE8749), AESx(0x5555AAFF), AESx(0x28285078), AESx(0xDFDFA57A), - AESx(0x8C8C038F), AESx(0xA1A159F8), AESx(0x89890980), AESx(0x0D0D1A17), - AESx(0xBFBF65DA), AESx(0xE6E6D731), AESx(0x424284C6), AESx(0x6868D0B8), - AESx(0x414182C3), AESx(0x999929B0), AESx(0x2D2D5A77), AESx(0x0F0F1E11), - AESx(0xB0B07BCB), AESx(0x5454A8FC), AESx(0xBBBB6DD6), AESx(0x16162C3A) -}; - -#ifdef DEVICE_DIRECT_CONSTANTS -__constant__ __align__(64) uint32_t d_AES2[256] = { -#else -static const uint32_t h_AES2[256] = { -#endif - AESx(0x63C6A563), AESx(0x7CF8847C), AESx(0x77EE9977), AESx(0x7BF68D7B), - AESx(0xF2FF0DF2), AESx(0x6BD6BD6B), AESx(0x6FDEB16F), AESx(0xC59154C5), - AESx(0x30605030), AESx(0x01020301), AESx(0x67CEA967), AESx(0x2B567D2B), - AESx(0xFEE719FE), AESx(0xD7B562D7), AESx(0xAB4DE6AB), AESx(0x76EC9A76), - AESx(0xCA8F45CA), AESx(0x821F9D82), AESx(0xC98940C9), AESx(0x7DFA877D), - AESx(0xFAEF15FA), AESx(0x59B2EB59), AESx(0x478EC947), AESx(0xF0FB0BF0), - AESx(0xAD41ECAD), AESx(0xD4B367D4), AESx(0xA25FFDA2), AESx(0xAF45EAAF), - AESx(0x9C23BF9C), AESx(0xA453F7A4), AESx(0x72E49672), AESx(0xC09B5BC0), - AESx(0xB775C2B7), AESx(0xFDE11CFD), AESx(0x933DAE93), AESx(0x264C6A26), - AESx(0x366C5A36), AESx(0x3F7E413F), AESx(0xF7F502F7), AESx(0xCC834FCC), - AESx(0x34685C34), AESx(0xA551F4A5), AESx(0xE5D134E5), AESx(0xF1F908F1), - AESx(0x71E29371), AESx(0xD8AB73D8), AESx(0x31625331), AESx(0x152A3F15), - AESx(0x04080C04), AESx(0xC79552C7), AESx(0x23466523), AESx(0xC39D5EC3), - AESx(0x18302818), AESx(0x9637A196), AESx(0x050A0F05), AESx(0x9A2FB59A), - AESx(0x070E0907), AESx(0x12243612), AESx(0x801B9B80), AESx(0xE2DF3DE2), - AESx(0xEBCD26EB), AESx(0x274E6927), AESx(0xB27FCDB2), AESx(0x75EA9F75), - AESx(0x09121B09), AESx(0x831D9E83), AESx(0x2C58742C), AESx(0x1A342E1A), - AESx(0x1B362D1B), AESx(0x6EDCB26E), AESx(0x5AB4EE5A), AESx(0xA05BFBA0), - AESx(0x52A4F652), AESx(0x3B764D3B), AESx(0xD6B761D6), AESx(0xB37DCEB3), - AESx(0x29527B29), AESx(0xE3DD3EE3), AESx(0x2F5E712F), AESx(0x84139784), - AESx(0x53A6F553), AESx(0xD1B968D1), AESx(0x00000000), AESx(0xEDC12CED), - AESx(0x20406020), AESx(0xFCE31FFC), AESx(0xB179C8B1), AESx(0x5BB6ED5B), - AESx(0x6AD4BE6A), AESx(0xCB8D46CB), AESx(0xBE67D9BE), AESx(0x39724B39), - AESx(0x4A94DE4A), AESx(0x4C98D44C), AESx(0x58B0E858), AESx(0xCF854ACF), - AESx(0xD0BB6BD0), AESx(0xEFC52AEF), AESx(0xAA4FE5AA), AESx(0xFBED16FB), - AESx(0x4386C543), AESx(0x4D9AD74D), AESx(0x33665533), AESx(0x85119485), - AESx(0x458ACF45), AESx(0xF9E910F9), AESx(0x02040602), AESx(0x7FFE817F), - AESx(0x50A0F050), AESx(0x3C78443C), AESx(0x9F25BA9F), AESx(0xA84BE3A8), - AESx(0x51A2F351), AESx(0xA35DFEA3), AESx(0x4080C040), AESx(0x8F058A8F), - AESx(0x923FAD92), AESx(0x9D21BC9D), AESx(0x38704838), AESx(0xF5F104F5), - AESx(0xBC63DFBC), AESx(0xB677C1B6), AESx(0xDAAF75DA), AESx(0x21426321), - AESx(0x10203010), AESx(0xFFE51AFF), AESx(0xF3FD0EF3), AESx(0xD2BF6DD2), - AESx(0xCD814CCD), AESx(0x0C18140C), AESx(0x13263513), AESx(0xECC32FEC), - AESx(0x5FBEE15F), AESx(0x9735A297), AESx(0x4488CC44), AESx(0x172E3917), - AESx(0xC49357C4), AESx(0xA755F2A7), AESx(0x7EFC827E), AESx(0x3D7A473D), - AESx(0x64C8AC64), AESx(0x5DBAE75D), AESx(0x19322B19), AESx(0x73E69573), - AESx(0x60C0A060), AESx(0x81199881), AESx(0x4F9ED14F), AESx(0xDCA37FDC), - AESx(0x22446622), AESx(0x2A547E2A), AESx(0x903BAB90), AESx(0x880B8388), - AESx(0x468CCA46), AESx(0xEEC729EE), AESx(0xB86BD3B8), AESx(0x14283C14), - AESx(0xDEA779DE), AESx(0x5EBCE25E), AESx(0x0B161D0B), AESx(0xDBAD76DB), - AESx(0xE0DB3BE0), AESx(0x32645632), AESx(0x3A744E3A), AESx(0x0A141E0A), - AESx(0x4992DB49), AESx(0x060C0A06), AESx(0x24486C24), AESx(0x5CB8E45C), - AESx(0xC29F5DC2), AESx(0xD3BD6ED3), AESx(0xAC43EFAC), AESx(0x62C4A662), - AESx(0x9139A891), AESx(0x9531A495), AESx(0xE4D337E4), AESx(0x79F28B79), - AESx(0xE7D532E7), AESx(0xC88B43C8), AESx(0x376E5937), AESx(0x6DDAB76D), - AESx(0x8D018C8D), AESx(0xD5B164D5), AESx(0x4E9CD24E), AESx(0xA949E0A9), - AESx(0x6CD8B46C), AESx(0x56ACFA56), AESx(0xF4F307F4), AESx(0xEACF25EA), - AESx(0x65CAAF65), AESx(0x7AF48E7A), AESx(0xAE47E9AE), AESx(0x08101808), - AESx(0xBA6FD5BA), AESx(0x78F08878), AESx(0x254A6F25), AESx(0x2E5C722E), - AESx(0x1C38241C), AESx(0xA657F1A6), AESx(0xB473C7B4), AESx(0xC69751C6), - AESx(0xE8CB23E8), AESx(0xDDA17CDD), AESx(0x74E89C74), AESx(0x1F3E211F), - AESx(0x4B96DD4B), AESx(0xBD61DCBD), AESx(0x8B0D868B), AESx(0x8A0F858A), - AESx(0x70E09070), AESx(0x3E7C423E), AESx(0xB571C4B5), AESx(0x66CCAA66), - AESx(0x4890D848), AESx(0x03060503), AESx(0xF6F701F6), AESx(0x0E1C120E), - AESx(0x61C2A361), AESx(0x356A5F35), AESx(0x57AEF957), AESx(0xB969D0B9), - AESx(0x86179186), AESx(0xC19958C1), AESx(0x1D3A271D), AESx(0x9E27B99E), - AESx(0xE1D938E1), AESx(0xF8EB13F8), AESx(0x982BB398), AESx(0x11223311), - AESx(0x69D2BB69), AESx(0xD9A970D9), AESx(0x8E07898E), AESx(0x9433A794), - AESx(0x9B2DB69B), AESx(0x1E3C221E), AESx(0x87159287), AESx(0xE9C920E9), - AESx(0xCE8749CE), AESx(0x55AAFF55), AESx(0x28507828), AESx(0xDFA57ADF), - AESx(0x8C038F8C), AESx(0xA159F8A1), AESx(0x89098089), AESx(0x0D1A170D), - AESx(0xBF65DABF), AESx(0xE6D731E6), AESx(0x4284C642), AESx(0x68D0B868), - AESx(0x4182C341), AESx(0x9929B099), AESx(0x2D5A772D), AESx(0x0F1E110F), - AESx(0xB07BCBB0), AESx(0x54A8FC54), AESx(0xBB6DD6BB), AESx(0x162C3A16) -}; - -#ifdef DEVICE_DIRECT_CONSTANTS -__constant__ __align__(64) uint32_t d_AES3[256] = { -#else -static const uint32_t h_AES3[256] = { -#endif - AESx(0xC6A56363), AESx(0xF8847C7C), AESx(0xEE997777), AESx(0xF68D7B7B), - AESx(0xFF0DF2F2), AESx(0xD6BD6B6B), AESx(0xDEB16F6F), AESx(0x9154C5C5), - AESx(0x60503030), AESx(0x02030101), AESx(0xCEA96767), AESx(0x567D2B2B), - AESx(0xE719FEFE), AESx(0xB562D7D7), AESx(0x4DE6ABAB), AESx(0xEC9A7676), - AESx(0x8F45CACA), AESx(0x1F9D8282), AESx(0x8940C9C9), AESx(0xFA877D7D), - AESx(0xEF15FAFA), AESx(0xB2EB5959), AESx(0x8EC94747), AESx(0xFB0BF0F0), - AESx(0x41ECADAD), AESx(0xB367D4D4), AESx(0x5FFDA2A2), AESx(0x45EAAFAF), - AESx(0x23BF9C9C), AESx(0x53F7A4A4), AESx(0xE4967272), AESx(0x9B5BC0C0), - AESx(0x75C2B7B7), AESx(0xE11CFDFD), AESx(0x3DAE9393), AESx(0x4C6A2626), - AESx(0x6C5A3636), AESx(0x7E413F3F), AESx(0xF502F7F7), AESx(0x834FCCCC), - AESx(0x685C3434), AESx(0x51F4A5A5), AESx(0xD134E5E5), AESx(0xF908F1F1), - AESx(0xE2937171), AESx(0xAB73D8D8), AESx(0x62533131), AESx(0x2A3F1515), - AESx(0x080C0404), AESx(0x9552C7C7), AESx(0x46652323), AESx(0x9D5EC3C3), - AESx(0x30281818), AESx(0x37A19696), AESx(0x0A0F0505), AESx(0x2FB59A9A), - AESx(0x0E090707), AESx(0x24361212), AESx(0x1B9B8080), AESx(0xDF3DE2E2), - AESx(0xCD26EBEB), AESx(0x4E692727), AESx(0x7FCDB2B2), AESx(0xEA9F7575), - AESx(0x121B0909), AESx(0x1D9E8383), AESx(0x58742C2C), AESx(0x342E1A1A), - AESx(0x362D1B1B), AESx(0xDCB26E6E), AESx(0xB4EE5A5A), AESx(0x5BFBA0A0), - AESx(0xA4F65252), AESx(0x764D3B3B), AESx(0xB761D6D6), AESx(0x7DCEB3B3), - AESx(0x527B2929), AESx(0xDD3EE3E3), AESx(0x5E712F2F), AESx(0x13978484), - AESx(0xA6F55353), AESx(0xB968D1D1), AESx(0x00000000), AESx(0xC12CEDED), - AESx(0x40602020), AESx(0xE31FFCFC), AESx(0x79C8B1B1), AESx(0xB6ED5B5B), - AESx(0xD4BE6A6A), AESx(0x8D46CBCB), AESx(0x67D9BEBE), AESx(0x724B3939), - AESx(0x94DE4A4A), AESx(0x98D44C4C), AESx(0xB0E85858), AESx(0x854ACFCF), - AESx(0xBB6BD0D0), AESx(0xC52AEFEF), AESx(0x4FE5AAAA), AESx(0xED16FBFB), - AESx(0x86C54343), AESx(0x9AD74D4D), AESx(0x66553333), AESx(0x11948585), - AESx(0x8ACF4545), AESx(0xE910F9F9), AESx(0x04060202), AESx(0xFE817F7F), - AESx(0xA0F05050), AESx(0x78443C3C), AESx(0x25BA9F9F), AESx(0x4BE3A8A8), - AESx(0xA2F35151), AESx(0x5DFEA3A3), AESx(0x80C04040), AESx(0x058A8F8F), - AESx(0x3FAD9292), AESx(0x21BC9D9D), AESx(0x70483838), AESx(0xF104F5F5), - AESx(0x63DFBCBC), AESx(0x77C1B6B6), AESx(0xAF75DADA), AESx(0x42632121), - AESx(0x20301010), AESx(0xE51AFFFF), AESx(0xFD0EF3F3), AESx(0xBF6DD2D2), - AESx(0x814CCDCD), AESx(0x18140C0C), AESx(0x26351313), AESx(0xC32FECEC), - AESx(0xBEE15F5F), AESx(0x35A29797), AESx(0x88CC4444), AESx(0x2E391717), - AESx(0x9357C4C4), AESx(0x55F2A7A7), AESx(0xFC827E7E), AESx(0x7A473D3D), - AESx(0xC8AC6464), AESx(0xBAE75D5D), AESx(0x322B1919), AESx(0xE6957373), - AESx(0xC0A06060), AESx(0x19988181), AESx(0x9ED14F4F), AESx(0xA37FDCDC), - AESx(0x44662222), AESx(0x547E2A2A), AESx(0x3BAB9090), AESx(0x0B838888), - AESx(0x8CCA4646), AESx(0xC729EEEE), AESx(0x6BD3B8B8), AESx(0x283C1414), - AESx(0xA779DEDE), AESx(0xBCE25E5E), AESx(0x161D0B0B), AESx(0xAD76DBDB), - AESx(0xDB3BE0E0), AESx(0x64563232), AESx(0x744E3A3A), AESx(0x141E0A0A), - AESx(0x92DB4949), AESx(0x0C0A0606), AESx(0x486C2424), AESx(0xB8E45C5C), - AESx(0x9F5DC2C2), AESx(0xBD6ED3D3), AESx(0x43EFACAC), AESx(0xC4A66262), - AESx(0x39A89191), AESx(0x31A49595), AESx(0xD337E4E4), AESx(0xF28B7979), - AESx(0xD532E7E7), AESx(0x8B43C8C8), AESx(0x6E593737), AESx(0xDAB76D6D), - AESx(0x018C8D8D), AESx(0xB164D5D5), AESx(0x9CD24E4E), AESx(0x49E0A9A9), - AESx(0xD8B46C6C), AESx(0xACFA5656), AESx(0xF307F4F4), AESx(0xCF25EAEA), - AESx(0xCAAF6565), AESx(0xF48E7A7A), AESx(0x47E9AEAE), AESx(0x10180808), - AESx(0x6FD5BABA), AESx(0xF0887878), AESx(0x4A6F2525), AESx(0x5C722E2E), - AESx(0x38241C1C), AESx(0x57F1A6A6), AESx(0x73C7B4B4), AESx(0x9751C6C6), - AESx(0xCB23E8E8), AESx(0xA17CDDDD), AESx(0xE89C7474), AESx(0x3E211F1F), - AESx(0x96DD4B4B), AESx(0x61DCBDBD), AESx(0x0D868B8B), AESx(0x0F858A8A), - AESx(0xE0907070), AESx(0x7C423E3E), AESx(0x71C4B5B5), AESx(0xCCAA6666), - AESx(0x90D84848), AESx(0x06050303), AESx(0xF701F6F6), AESx(0x1C120E0E), - AESx(0xC2A36161), AESx(0x6A5F3535), AESx(0xAEF95757), AESx(0x69D0B9B9), - AESx(0x17918686), AESx(0x9958C1C1), AESx(0x3A271D1D), AESx(0x27B99E9E), - AESx(0xD938E1E1), AESx(0xEB13F8F8), AESx(0x2BB39898), AESx(0x22331111), - AESx(0xD2BB6969), AESx(0xA970D9D9), AESx(0x07898E8E), AESx(0x33A79494), - AESx(0x2DB69B9B), AESx(0x3C221E1E), AESx(0x15928787), AESx(0xC920E9E9), - AESx(0x8749CECE), AESx(0xAAFF5555), AESx(0x50782828), AESx(0xA57ADFDF), - AESx(0x038F8C8C), AESx(0x59F8A1A1), AESx(0x09808989), AESx(0x1A170D0D), - AESx(0x65DABFBF), AESx(0xD731E6E6), AESx(0x84C64242), AESx(0xD0B86868), - AESx(0x82C34141), AESx(0x29B09999), AESx(0x5A772D2D), AESx(0x1E110F0F), - AESx(0x7BCBB0B0), AESx(0xA8FC5454), AESx(0x6DD6BBBB), AESx(0x2C3A1616) -}; - -#ifndef DEVICE_DIRECT_CONSTANTS -static __constant__ __align__(64) uint32_t d_AES0[256]; -static __constant__ __align__(64) uint32_t d_AES1[256]; -static __constant__ __align__(64) uint32_t d_AES2[256]; -static __constant__ __align__(64) uint32_t d_AES3[256]; - -static void aes_cpu_init(int thr_id) -{ - CUDA_CALL_OR_RET(cudaMemcpyToSymbol( d_AES0, - h_AES0, - sizeof(h_AES0), - 0, cudaMemcpyHostToDevice)); - - CUDA_CALL_OR_RET(cudaMemcpyToSymbol( d_AES1, - h_AES1, - sizeof(h_AES1), - 0, cudaMemcpyHostToDevice)); - - CUDA_CALL_OR_RET(cudaMemcpyToSymbol( d_AES2, - h_AES2, - sizeof(h_AES2), - 0, cudaMemcpyHostToDevice)); - - CUDA_CALL_OR_RET(cudaMemcpyToSymbol( d_AES3, - h_AES3, - sizeof(h_AES3), - 0, cudaMemcpyHostToDevice)); -} -#else -static void aes_cpu_init(int thr_id) {} -#endif - -__device__ __forceinline__ -void aes_gpu_init(uint32_t *sharedMemory) -{ - /* each thread startup will fill a uint32 */ - if (threadIdx.x < 256) { - sharedMemory[threadIdx.x] = d_AES0[threadIdx.x]; - sharedMemory[threadIdx.x+256] = d_AES1[threadIdx.x]; - sharedMemory[threadIdx.x+512] = d_AES2[threadIdx.x]; - sharedMemory[threadIdx.x+768] = d_AES3[threadIdx.x]; - } -} - -/* tried with 3 xor.b32 asm, not faster */ -#define xor4_32(a,b,c,d) ((a ^ b) ^ (c ^ d)); - -__device__ -static void aes_round( - const uint32_t *sharedMemory, - uint32_t x0, uint32_t x1, uint32_t x2, uint32_t x3, uint32_t k0, - uint32_t &y0, uint32_t &y1, uint32_t &y2, uint32_t &y3) -{ - y0 = xor4_32( - sharedMemory[__byte_perm(x0, 0, 0x4440)], - sharedMemory[__byte_perm(x1, 0, 0x4441) + 256], - sharedMemory[__byte_perm(x2, 0, 0x4442) + 512], - sharedMemory[__byte_perm(x3, 0, 0x4443) + 768]); - - y1 = xor4_32( - sharedMemory[__byte_perm(x1, 0, 0x4440)], - sharedMemory[__byte_perm(x2, 0, 0x4441) + 256], - sharedMemory[__byte_perm(x3, 0, 0x4442) + 512], - sharedMemory[__byte_perm(x0, 0, 0x4443) + 768]); - - y2 = xor4_32( - sharedMemory[__byte_perm(x2, 0, 0x4440)], - sharedMemory[__byte_perm(x3, 0, 0x4441) + 256], - sharedMemory[__byte_perm(x0, 0, 0x4442) + 512], - sharedMemory[__byte_perm(x1, 0, 0x4443) + 768]); // ^k2 - - y0 ^= k0; - - y3 = xor4_32( - sharedMemory[__byte_perm(x3, 0, 0x4440)], - sharedMemory[__byte_perm(x0, 0, 0x4441) + 256], - sharedMemory[__byte_perm(x1, 0, 0x4442) + 512], - sharedMemory[__byte_perm(x2, 0, 0x4443) + 768]); // ^k3 -} - -__device__ -static void aes_round( - const uint32_t *sharedMemory, - uint32_t x0, uint32_t x1, uint32_t x2, uint32_t x3, - uint32_t &y0, uint32_t &y1, uint32_t &y2, uint32_t &y3) -{ - y0 = xor4_32( - sharedMemory[__byte_perm(x0, 0, 0x4440)], - sharedMemory[__byte_perm(x1, 0, 0x4441) + 256], - sharedMemory[__byte_perm(x2, 0, 0x4442) + 512], - sharedMemory[__byte_perm(x3, 0, 0x4443) + 768]); - - y1 = xor4_32( - sharedMemory[__byte_perm(x1, 0, 0x4440)], - sharedMemory[__byte_perm(x2, 0, 0x4441) + 256], - sharedMemory[__byte_perm(x3, 0, 0x4442) + 512], - sharedMemory[__byte_perm(x0, 0, 0x4443) + 768]); - - y2 = xor4_32( - sharedMemory[__byte_perm(x2, 0, 0x4440)], - sharedMemory[__byte_perm(x3, 0, 0x4441) + 256], - sharedMemory[__byte_perm(x0, 0, 0x4442) + 512], - sharedMemory[__byte_perm(x1, 0, 0x4443) + 768]); // ^k2 - - y3 = xor4_32( - sharedMemory[__byte_perm(x3, 0, 0x4440)], - sharedMemory[__byte_perm(x0, 0, 0x4441) + 256], - sharedMemory[__byte_perm(x1, 0, 0x4442) + 512], - sharedMemory[__byte_perm(x2, 0, 0x4443) + 768]); // ^k3 -} diff --git a/x11/cuda_x11_aes_alexis.cuh b/x11/cuda_x11_aes_alexis.cuh deleted file mode 100644 index b8a684d7..00000000 --- a/x11/cuda_x11_aes_alexis.cuh +++ /dev/null @@ -1,257 +0,0 @@ -#include "miner.h" -#include "cuda_vectors_alexis.h" - -__device__ uint32_t d_AES0[256] = { - 0xA56363C6, 0x847C7CF8, 0x997777EE, 0x8D7B7BF6, 0x0DF2F2FF, 0xBD6B6BD6, 0xB16F6FDE, 0x54C5C591, 0x50303060, 0x03010102, 0xA96767CE, 0x7D2B2B56, 0x19FEFEE7, 0x62D7D7B5, 0xE6ABAB4D, 0x9A7676EC, - 0x45CACA8F, 0x9D82821F, 0x40C9C989, 0x877D7DFA, 0x15FAFAEF, 0xEB5959B2, 0xC947478E, 0x0BF0F0FB, 0xECADAD41, 0x67D4D4B3, 0xFDA2A25F, 0xEAAFAF45, 0xBF9C9C23, 0xF7A4A453, 0x967272E4, 0x5BC0C09B, - 0xC2B7B775, 0x1CFDFDE1, 0xAE93933D, 0x6A26264C, 0x5A36366C, 0x413F3F7E, 0x02F7F7F5, 0x4FCCCC83, 0x5C343468, 0xF4A5A551, 0x34E5E5D1, 0x08F1F1F9, 0x937171E2, 0x73D8D8AB, 0x53313162, 0x3F15152A, - 0x0C040408, 0x52C7C795, 0x65232346, 0x5EC3C39D, 0x28181830, 0xA1969637, 0x0F05050A, 0xB59A9A2F, 0x0907070E, 0x36121224, 0x9B80801B, 0x3DE2E2DF, 0x26EBEBCD, 0x6927274E, 0xCDB2B27F, 0x9F7575EA, - 0x1B090912, 0x9E83831D, 0x742C2C58, 0x2E1A1A34, 0x2D1B1B36, 0xB26E6EDC, 0xEE5A5AB4, 0xFBA0A05B, 0xF65252A4, 0x4D3B3B76, 0x61D6D6B7, 0xCEB3B37D, 0x7B292952, 0x3EE3E3DD, 0x712F2F5E, 0x97848413, - 0xF55353A6, 0x68D1D1B9, 0x00000000, 0x2CEDEDC1, 0x60202040, 0x1FFCFCE3, 0xC8B1B179, 0xED5B5BB6, 0xBE6A6AD4, 0x46CBCB8D, 0xD9BEBE67, 0x4B393972, 0xDE4A4A94, 0xD44C4C98, 0xE85858B0, 0x4ACFCF85, - 0x6BD0D0BB, 0x2AEFEFC5, 0xE5AAAA4F, 0x16FBFBED, 0xC5434386, 0xD74D4D9A, 0x55333366, 0x94858511, 0xCF45458A, 0x10F9F9E9, 0x06020204, 0x817F7FFE, 0xF05050A0, 0x443C3C78, 0xBA9F9F25, 0xE3A8A84B, - 0xF35151A2, 0xFEA3A35D, 0xC0404080, 0x8A8F8F05, 0xAD92923F, 0xBC9D9D21, 0x48383870, 0x04F5F5F1, 0xDFBCBC63, 0xC1B6B677, 0x75DADAAF, 0x63212142, 0x30101020, 0x1AFFFFE5, 0x0EF3F3FD, 0x6DD2D2BF, - 0x4CCDCD81, 0x140C0C18, 0x35131326, 0x2FECECC3, 0xE15F5FBE, 0xA2979735, 0xCC444488, 0x3917172E, 0x57C4C493, 0xF2A7A755, 0x827E7EFC, 0x473D3D7A, 0xAC6464C8, 0xE75D5DBA, 0x2B191932, 0x957373E6, - 0xA06060C0, 0x98818119, 0xD14F4F9E, 0x7FDCDCA3, 0x66222244, 0x7E2A2A54, 0xAB90903B, 0x8388880B, 0xCA46468C, 0x29EEEEC7, 0xD3B8B86B, 0x3C141428, 0x79DEDEA7, 0xE25E5EBC, 0x1D0B0B16, 0x76DBDBAD, - 0x3BE0E0DB, 0x56323264, 0x4E3A3A74, 0x1E0A0A14, 0xDB494992, 0x0A06060C, 0x6C242448, 0xE45C5CB8, 0x5DC2C29F, 0x6ED3D3BD, 0xEFACAC43, 0xA66262C4, 0xA8919139, 0xA4959531, 0x37E4E4D3, 0x8B7979F2, - 0x32E7E7D5, 0x43C8C88B, 0x5937376E, 0xB76D6DDA, 0x8C8D8D01, 0x64D5D5B1, 0xD24E4E9C, 0xE0A9A949, 0xB46C6CD8, 0xFA5656AC, 0x07F4F4F3, 0x25EAEACF, 0xAF6565CA, 0x8E7A7AF4, 0xE9AEAE47, 0x18080810, - 0xD5BABA6F, 0x887878F0, 0x6F25254A, 0x722E2E5C, 0x241C1C38, 0xF1A6A657, 0xC7B4B473, 0x51C6C697, 0x23E8E8CB, 0x7CDDDDA1, 0x9C7474E8, 0x211F1F3E, 0xDD4B4B96, 0xDCBDBD61, 0x868B8B0D, 0x858A8A0F, - 0x907070E0, 0x423E3E7C, 0xC4B5B571, 0xAA6666CC, 0xD8484890, 0x05030306, 0x01F6F6F7, 0x120E0E1C, 0xA36161C2, 0x5F35356A, 0xF95757AE, 0xD0B9B969, 0x91868617, 0x58C1C199, 0x271D1D3A, 0xB99E9E27, - 0x38E1E1D9, 0x13F8F8EB, 0xB398982B, 0x33111122, 0xBB6969D2, 0x70D9D9A9, 0x898E8E07, 0xA7949433, 0xB69B9B2D, 0x221E1E3C, 0x92878715, 0x20E9E9C9, 0x49CECE87, 0xFF5555AA, 0x78282850, 0x7ADFDFA5, - 0x8F8C8C03, 0xF8A1A159, 0x80898909, 0x170D0D1A, 0xDABFBF65, 0x31E6E6D7, 0xC6424284, 0xB86868D0, 0xC3414182, 0xB0999929, 0x772D2D5A, 0x110F0F1E, 0xCBB0B07B, 0xFC5454A8, 0xD6BBBB6D, 0x3A16162C -}; - -__device__ uint32_t d_AES3[256] = { - 0xC6A56363, 0xF8847C7C, 0xEE997777, 0xF68D7B7B, 0xFF0DF2F2, 0xD6BD6B6B, 0xDEB16F6F, 0x9154C5C5, 0x60503030, 0x02030101, 0xCEA96767, 0x567D2B2B, 0xE719FEFE, 0xB562D7D7, 0x4DE6ABAB, 0xEC9A7676, - 0x8F45CACA, 0x1F9D8282, 0x8940C9C9, 0xFA877D7D, 0xEF15FAFA, 0xB2EB5959, 0x8EC94747, 0xFB0BF0F0, 0x41ECADAD, 0xB367D4D4, 0x5FFDA2A2, 0x45EAAFAF, 0x23BF9C9C, 0x53F7A4A4, 0xE4967272, 0x9B5BC0C0, - 0x75C2B7B7, 0xE11CFDFD, 0x3DAE9393, 0x4C6A2626, 0x6C5A3636, 0x7E413F3F, 0xF502F7F7, 0x834FCCCC, 0x685C3434, 0x51F4A5A5, 0xD134E5E5, 0xF908F1F1, 0xE2937171, 0xAB73D8D8, 0x62533131, 0x2A3F1515, - 0x080C0404, 0x9552C7C7, 0x46652323, 0x9D5EC3C3, 0x30281818, 0x37A19696, 0x0A0F0505, 0x2FB59A9A, 0x0E090707, 0x24361212, 0x1B9B8080, 0xDF3DE2E2, 0xCD26EBEB, 0x4E692727, 0x7FCDB2B2, 0xEA9F7575, - 0x121B0909, 0x1D9E8383, 0x58742C2C, 0x342E1A1A, 0x362D1B1B, 0xDCB26E6E, 0xB4EE5A5A, 0x5BFBA0A0, 0xA4F65252, 0x764D3B3B, 0xB761D6D6, 0x7DCEB3B3, 0x527B2929, 0xDD3EE3E3, 0x5E712F2F, 0x13978484, - 0xA6F55353, 0xB968D1D1, 0x00000000, 0xC12CEDED, 0x40602020, 0xE31FFCFC, 0x79C8B1B1, 0xB6ED5B5B, 0xD4BE6A6A, 0x8D46CBCB, 0x67D9BEBE, 0x724B3939, 0x94DE4A4A, 0x98D44C4C, 0xB0E85858, 0x854ACFCF, - 0xBB6BD0D0, 0xC52AEFEF, 0x4FE5AAAA, 0xED16FBFB, 0x86C54343, 0x9AD74D4D, 0x66553333, 0x11948585, 0x8ACF4545, 0xE910F9F9, 0x04060202, 0xFE817F7F, 0xA0F05050, 0x78443C3C, 0x25BA9F9F, 0x4BE3A8A8, - 0xA2F35151, 0x5DFEA3A3, 0x80C04040, 0x058A8F8F, 0x3FAD9292, 0x21BC9D9D, 0x70483838, 0xF104F5F5, 0x63DFBCBC, 0x77C1B6B6, 0xAF75DADA, 0x42632121, 0x20301010, 0xE51AFFFF, 0xFD0EF3F3, 0xBF6DD2D2, - 0x814CCDCD, 0x18140C0C, 0x26351313, 0xC32FECEC, 0xBEE15F5F, 0x35A29797, 0x88CC4444, 0x2E391717, 0x9357C4C4, 0x55F2A7A7, 0xFC827E7E, 0x7A473D3D, 0xC8AC6464, 0xBAE75D5D, 0x322B1919, 0xE6957373, - 0xC0A06060, 0x19988181, 0x9ED14F4F, 0xA37FDCDC, 0x44662222, 0x547E2A2A, 0x3BAB9090, 0x0B838888, 0x8CCA4646, 0xC729EEEE, 0x6BD3B8B8, 0x283C1414, 0xA779DEDE, 0xBCE25E5E, 0x161D0B0B, 0xAD76DBDB, - 0xDB3BE0E0, 0x64563232, 0x744E3A3A, 0x141E0A0A, 0x92DB4949, 0x0C0A0606, 0x486C2424, 0xB8E45C5C, 0x9F5DC2C2, 0xBD6ED3D3, 0x43EFACAC, 0xC4A66262, 0x39A89191, 0x31A49595, 0xD337E4E4, 0xF28B7979, - 0xD532E7E7, 0x8B43C8C8, 0x6E593737, 0xDAB76D6D, 0x018C8D8D, 0xB164D5D5, 0x9CD24E4E, 0x49E0A9A9, 0xD8B46C6C, 0xACFA5656, 0xF307F4F4, 0xCF25EAEA, 0xCAAF6565, 0xF48E7A7A, 0x47E9AEAE, 0x10180808, - 0x6FD5BABA, 0xF0887878, 0x4A6F2525, 0x5C722E2E, 0x38241C1C, 0x57F1A6A6, 0x73C7B4B4, 0x9751C6C6, 0xCB23E8E8, 0xA17CDDDD, 0xE89C7474, 0x3E211F1F, 0x96DD4B4B, 0x61DCBDBD, 0x0D868B8B, 0x0F858A8A, - 0xE0907070, 0x7C423E3E, 0x71C4B5B5, 0xCCAA6666, 0x90D84848, 0x06050303, 0xF701F6F6, 0x1C120E0E, 0xC2A36161, 0x6A5F3535, 0xAEF95757, 0x69D0B9B9, 0x17918686, 0x9958C1C1, 0x3A271D1D, 0x27B99E9E, - 0xD938E1E1, 0xEB13F8F8, 0x2BB39898, 0x22331111, 0xD2BB6969, 0xA970D9D9, 0x07898E8E, 0x33A79494, 0x2DB69B9B, 0x3C221E1E, 0x15928787, 0xC920E9E9, 0x8749CECE, 0xAAFF5555, 0x50782828, 0xA57ADFDF, - 0x038F8C8C, 0x59F8A1A1, 0x09808989, 0x1A170D0D, 0x65DABFBF, 0xD731E6E6, 0x84C64242, 0xD0B86868, 0x82C34141, 0x29B09999, 0x5A772D2D, 0x1E110F0F, 0x7BCBB0B0, 0xA8FC5454, 0x6DD6BBBB, 0x2C3A1616 -}; - -__device__ __forceinline__ -void aes_gpu_init_mt_256(uint32_t sharedMemory[4][256]) -{ - /* each thread startup will fill a uint32 */ - if(threadIdx.x<256){ - uint32_t temp = __ldg(&d_AES0[threadIdx.x]); - sharedMemory[0][threadIdx.x] = temp; - sharedMemory[1][threadIdx.x] = ROL8(temp); - sharedMemory[2][threadIdx.x] = ROL16(temp); - sharedMemory[3][threadIdx.x] = ROR8(temp); - } -} - -__device__ __forceinline__ -void aes_gpu_init256(uint32_t sharedMemory[4][256]) -{ - /* each thread startup will fill a uint32 */ - uint32_t temp = __ldg(&d_AES0[threadIdx.x]); - sharedMemory[0][threadIdx.x] = temp; - sharedMemory[1][threadIdx.x] = ROL8(temp); - sharedMemory[2][threadIdx.x] = ROL16(temp); - sharedMemory[3][threadIdx.x] = ROR8(temp); -} - -__device__ __forceinline__ -void aes_gpu_init128(uint32_t sharedMemory[4][256]) -{ - /* each thread startup will fill 2 uint32 */ - uint2 temp = __ldg(&((uint2*)&d_AES0)[threadIdx.x]); - - sharedMemory[0][(threadIdx.x<<1) + 0] = temp.x; - sharedMemory[0][(threadIdx.x<<1) + 1] = temp.y; - sharedMemory[1][(threadIdx.x<<1) + 0] = ROL8(temp.x); - sharedMemory[1][(threadIdx.x<<1) + 1] = ROL8(temp.y); - sharedMemory[2][(threadIdx.x<<1) + 0] = ROL16(temp.x); - sharedMemory[2][(threadIdx.x<<1) + 1] = ROL16(temp.y); - sharedMemory[3][(threadIdx.x<<1) + 0] = ROR8(temp.x); - sharedMemory[3][(threadIdx.x<<1) + 1] = ROR8(temp.y); -} - -__device__ __forceinline__ -void aes_gpu_init_lt_256(uint32_t sharedMemory[4][256]) -{ - if(threadIdx.x<128){ - /* each thread startup will fill 2 uint32 */ - uint2 temp = __ldg(&((uint2*)&d_AES0)[threadIdx.x]); - - sharedMemory[0][(threadIdx.x<<1) + 0] = temp.x; - sharedMemory[0][(threadIdx.x<<1) + 1] = temp.y; - sharedMemory[1][(threadIdx.x<<1) + 0] = ROL8(temp.x); - sharedMemory[1][(threadIdx.x<<1) + 1] = ROL8(temp.y); - sharedMemory[2][(threadIdx.x<<1) + 0] = ROL16(temp.x); - sharedMemory[2][(threadIdx.x<<1) + 1] = ROL16(temp.y); - sharedMemory[3][(threadIdx.x<<1) + 0] = ROR8(temp.x); - sharedMemory[3][(threadIdx.x<<1) + 1] = ROR8(temp.y); - } -} - - -__device__ __forceinline__ -static void aes_round(const uint32_t sharedMemory[4][256],const uint32_t x0,const uint32_t x1,const uint32_t x2,const uint32_t x3,const uint32_t k0,uint32_t &y0, uint32_t &y1, uint32_t &y2, uint32_t &y3){ - - y0 = __ldg(&d_AES0[__byte_perm(x0, 0, 0x4440)]); - y3 = sharedMemory[1][__byte_perm(x0, 0, 0x4441)]; - y2 = sharedMemory[2][__byte_perm(x0, 0, 0x4442)]; - y1 = __ldg(&d_AES3[__byte_perm(x0, 0, 0x4443)]); - - y1^= sharedMemory[0][__byte_perm(x1, 0, 0x4440)]; - y0^= sharedMemory[1][__byte_perm(x1, 0, 0x4441)]; - y3^= sharedMemory[2][__byte_perm(x1, 0, 0x4442)]; - #ifdef INTENSIVE_GMF - y2^= __ldg(&d_AES3[__byte_perm(x1, 0, 0x4443)]); - #else - y2^= sharedMemory[3][__byte_perm(x1, 0, 0x4443)]; - #endif - - y0^= k0; - - y2^= __ldg(&d_AES0[__byte_perm(x2, 0, 0x4440)]); - y1^= sharedMemory[1][__byte_perm(x2, 0, 0x4441)]; - y0^= sharedMemory[2][__byte_perm(x2, 0, 0x4442)]; - y3^= __ldg(&d_AES3[__byte_perm(x2, 0, 0x4443)]); - - y3^= sharedMemory[0][__byte_perm(x3, 0, 0x4440)]; - y2^= sharedMemory[1][__byte_perm(x3, 0, 0x4441)]; - y1^= sharedMemory[2][__byte_perm(x3, 0, 0x4442)]; - y0^= __ldg(&d_AES3[__byte_perm(x3, 0, 0x4443)]); -} - -__device__ __forceinline__ -static void aes_round_LDG(const uint32_t sharedMemory[4][256],const uint32_t x0,const uint32_t x1,const uint32_t x2,const uint32_t x3,const uint32_t k0,uint32_t &y0, uint32_t &y1, uint32_t &y2, uint32_t &y3){ - - y0 = __ldg(&d_AES0[__byte_perm(x0, 0, 0x4440)]); - y3 = sharedMemory[1][__byte_perm(x0, 0, 0x4441)]; - y2 = sharedMemory[2][__byte_perm(x0, 0, 0x4442)]; - y1 = __ldg(&d_AES3[__byte_perm(x0, 0, 0x4443)]); - - y1^= sharedMemory[0][__byte_perm(x1, 0, 0x4440)]; - y0^= sharedMemory[1][__byte_perm(x1, 0, 0x4441)]; - y3^= sharedMemory[2][__byte_perm(x1, 0, 0x4442)]; - y2^= __ldg(&d_AES3[__byte_perm(x1, 0, 0x4443)]); - - y0^= k0; - - y2^= __ldg(&d_AES0[__byte_perm(x2, 0, 0x4440)]); - y1^= sharedMemory[1][__byte_perm(x2, 0, 0x4441)]; - y0^= sharedMemory[2][__byte_perm(x2, 0, 0x4442)]; - y3^= __ldg(&d_AES3[__byte_perm(x2, 0, 0x4443)]); - - y3^= __ldg(&d_AES0[__byte_perm(x3, 0, 0x4440)]); - y2^= sharedMemory[1][__byte_perm(x3, 0, 0x4441)]; - y1^= sharedMemory[2][__byte_perm(x3, 0, 0x4442)]; - y0^= __ldg(&d_AES3[__byte_perm(x3, 0, 0x4443)]); -} - -__device__ __forceinline__ -static void aes_round(const uint32_t sharedMemory[4][256],const uint32_t x0,const uint32_t x1,const uint32_t x2,const uint32_t x3,uint32_t &y0, uint32_t &y1, uint32_t &y2, uint32_t &y3){ - - y0 = sharedMemory[0][__byte_perm(x0, 0, 0x4440)]; - y3 = sharedMemory[1][__byte_perm(x0, 0, 0x4441)]; - y2 = sharedMemory[2][__byte_perm(x0, 0, 0x4442)]; - y1 = __ldg(&d_AES3[__byte_perm(x0, 0, 0x4443)]); - - #ifdef INTENSIVE_GMF - y1^= __ldg(&d_AES0[__byte_perm(x1, 0, 0x4440)]); - #else - y1^= sharedMemory[0][__byte_perm(x1, 0, 0x4440)]; - #endif - y0^= sharedMemory[1][__byte_perm(x1, 0, 0x4441)]; - y3^= sharedMemory[2][__byte_perm(x1, 0, 0x4442)]; - y2^= __ldg(&d_AES3[__byte_perm(x1, 0, 0x4443)]); - - y2^= sharedMemory[0][__byte_perm(x2, 0, 0x4440)]; - y1^= sharedMemory[1][__byte_perm(x2, 0, 0x4441)]; - y0^= sharedMemory[2][__byte_perm(x2, 0, 0x4442)]; - y3^= __ldg(&d_AES3[__byte_perm(x2, 0, 0x4443)]); - - y3^= sharedMemory[0][__byte_perm(x3, 0, 0x4440)]; - y2^= sharedMemory[1][__byte_perm(x3, 0, 0x4441)]; - y1^= sharedMemory[2][__byte_perm(x3, 0, 0x4442)]; - y0^= __ldg(&d_AES3[__byte_perm(x3, 0, 0x4443)]); -} - -__device__ __forceinline__ -static void aes_round_LDG(const uint32_t sharedMemory[4][256],const uint32_t x0,const uint32_t x1,const uint32_t x2,const uint32_t x3,uint32_t &y0, uint32_t &y1, uint32_t &y2, uint32_t &y3){ - - y0 = sharedMemory[0][__byte_perm(x0, 0, 0x4440)]; - y3 = sharedMemory[1][__byte_perm(x0, 0, 0x4441)]; - y2 = sharedMemory[2][__byte_perm(x0, 0, 0x4442)]; - y1 = __ldg(&d_AES3[__byte_perm(x0, 0, 0x4443)]); - - y1^= __ldg(&d_AES0[__byte_perm(x1, 0, 0x4440)]); - y0^= sharedMemory[1][__byte_perm(x1, 0, 0x4441)]; - y3^= sharedMemory[2][__byte_perm(x1, 0, 0x4442)]; - y2^= __ldg(&d_AES3[__byte_perm(x1, 0, 0x4443)]); - - y2^= sharedMemory[0][__byte_perm(x2, 0, 0x4440)]; - y1^= sharedMemory[1][__byte_perm(x2, 0, 0x4441)]; - y0^= sharedMemory[2][__byte_perm(x2, 0, 0x4442)]; - y3^= __ldg(&d_AES3[__byte_perm(x2, 0, 0x4443)]); - - y3^= sharedMemory[0][__byte_perm(x3, 0, 0x4440)]; - y2^= sharedMemory[1][__byte_perm(x3, 0, 0x4441)]; - y1^= sharedMemory[2][__byte_perm(x3, 0, 0x4442)]; - y0^= __ldg(&d_AES3[__byte_perm(x3, 0, 0x4443)]); -} - -__device__ __forceinline__ -static void AES_2ROUND(const uint32_t sharedMemory[4][256], uint32_t &x0, uint32_t &x1, uint32_t &x2, uint32_t &x3, uint32_t &k0){ - - uint32_t y0, y1, y2, y3; - - aes_round(sharedMemory, x0, x1, x2, x3, k0, y0, y1, y2, y3); - - aes_round(sharedMemory, y0, y1, y2, y3, x0, x1, x2, x3); - - // hier werden wir ein carry brauchen (oder auch nicht) - k0++; -} - -__device__ __forceinline__ -static void AES_2ROUND_LDG(const uint32_t sharedMemory[4][256], uint32_t &x0, uint32_t &x1, uint32_t &x2, uint32_t &x3, uint32_t &k0){ - - uint32_t y0, y1, y2, y3; - - aes_round_LDG(sharedMemory, x0, x1, x2, x3, k0, y0, y1, y2, y3); - - aes_round_LDG(sharedMemory, y0, y1, y2, y3, x0, x1, x2, x3); - - // hier werden wir ein carry brauchen (oder auch nicht) - k0++; -} - -__device__ __forceinline__ -static void AES_ROUND_NOKEY(const uint32_t sharedMemory[4][256],uint4* x){ - - uint32_t y0, y1, y2, y3; - aes_round(sharedMemory, x->x, x->y, x->z, x->w, y0, y1, y2, y3); - - x->x = y0; - x->y = y1; - x->z = y2; - x->w = y3; - -} -__device__ __forceinline__ -static void KEY_EXPAND_ELT(const uint32_t sharedMemory[4][256],uint32_t *k){ - - uint32_t y0, y1, y2, y3; - aes_round(sharedMemory, k[0], k[1], k[2], k[3], y0, y1, y2, y3); - - k[0] = y1; - k[1] = y2; - k[2] = y3; - k[3] = y0; -} diff --git a/x11/cuda_x11_cubehash512.cu b/x11/cuda_x11_cubehash512.cu deleted file mode 100644 index f7ce97c4..00000000 --- a/x11/cuda_x11_cubehash512.cu +++ /dev/null @@ -1,320 +0,0 @@ -#include -#include - -#define CUBEHASH_ROUNDS 16 /* this is r for CubeHashr/b */ -#define CUBEHASH_BLOCKBYTES 32 /* this is b for CubeHashr/b */ - -#if __CUDA_ARCH__ < 350 -#define LROT(x,bits) ((x << bits) | (x >> (32 - bits))) -#else -#define LROT(x, bits) __funnelshift_l(x, x, bits) -#endif - -#define ROTATEUPWARDS7(a) LROT(a,7) -#define ROTATEUPWARDS11(a) LROT(a,11) - -#define SWAP(a,b) { uint32_t u = a; a = b; b = u; } - -__device__ __constant__ -static const uint32_t c_IV_512[32] = { - 0x2AEA2A61, 0x50F494D4, 0x2D538B8B, 0x4167D83E, - 0x3FEE2313, 0xC701CF8C, 0xCC39968E, 0x50AC5695, - 0x4D42C787, 0xA647A8B3, 0x97CF0BEF, 0x825B4537, - 0xEEF864D2, 0xF22090C4, 0xD0E5CD33, 0xA23911AE, - 0xFCD398D9, 0x148FE485, 0x1B017BEF, 0xB6444532, - 0x6A536159, 0x2FF5781C, 0x91FA7934, 0x0DBADEA9, - 0xD65C8A2B, 0xA5A70E75, 0xB1C62456, 0xBC796576, - 0x1921C8F7, 0xE7989AF1, 0x7795D246, 0xD43E3B44 -}; - -__device__ __forceinline__ -static void rrounds(uint32_t x[2][2][2][2][2]) -{ - int r; - int j; - int k; - int l; - int m; - -//#pragma unroll 16 - for (r = 0;r < CUBEHASH_ROUNDS;++r) { - - /* "add x_0jklm into x_1jklmn modulo 2^32" */ -#pragma unroll 2 - for (j = 0;j < 2;++j) -#pragma unroll 2 - for (k = 0;k < 2;++k) -#pragma unroll 2 - for (l = 0;l < 2;++l) -#pragma unroll 2 - for (m = 0;m < 2;++m) - x[1][j][k][l][m] += x[0][j][k][l][m]; - - /* "rotate x_0jklm upwards by 7 bits" */ -#pragma unroll 2 - for (j = 0;j < 2;++j) -#pragma unroll 2 - for (k = 0;k < 2;++k) -#pragma unroll 2 - for (l = 0;l < 2;++l) -#pragma unroll 2 - for (m = 0;m < 2;++m) - x[0][j][k][l][m] = ROTATEUPWARDS7(x[0][j][k][l][m]); - - /* "swap x_00klm with x_01klm" */ -#pragma unroll 2 - for (k = 0;k < 2;++k) -#pragma unroll 2 - for (l = 0;l < 2;++l) -#pragma unroll 2 - for (m = 0;m < 2;++m) - SWAP(x[0][0][k][l][m],x[0][1][k][l][m]) - - /* "xor x_1jklm into x_0jklm" */ -#pragma unroll 2 - for (j = 0;j < 2;++j) -#pragma unroll 2 - for (k = 0;k < 2;++k) -#pragma unroll 2 - for (l = 0;l < 2;++l) -#pragma unroll 2 - for (m = 0;m < 2;++m) - x[0][j][k][l][m] ^= x[1][j][k][l][m]; - - /* "swap x_1jk0m with x_1jk1m" */ -#pragma unroll 2 - for (j = 0;j < 2;++j) -#pragma unroll 2 - for (k = 0;k < 2;++k) -#pragma unroll 2 - for (m = 0;m < 2;++m) - SWAP(x[1][j][k][0][m],x[1][j][k][1][m]) - - /* "add x_0jklm into x_1jklm modulo 2^32" */ -#pragma unroll 2 - for (j = 0;j < 2;++j) -#pragma unroll 2 - for (k = 0;k < 2;++k) -#pragma unroll 2 - for (l = 0;l < 2;++l) -#pragma unroll 2 - for (m = 0;m < 2;++m) - x[1][j][k][l][m] += x[0][j][k][l][m]; - - /* "rotate x_0jklm upwards by 11 bits" */ -#pragma unroll 2 - for (j = 0;j < 2;++j) -#pragma unroll 2 - for (k = 0;k < 2;++k) -#pragma unroll 2 - for (l = 0;l < 2;++l) -#pragma unroll 2 - for (m = 0;m < 2;++m) - x[0][j][k][l][m] = ROTATEUPWARDS11(x[0][j][k][l][m]); - - /* "swap x_0j0lm with x_0j1lm" */ -#pragma unroll 2 - for (j = 0;j < 2;++j) -#pragma unroll 2 - for (l = 0;l < 2;++l) -#pragma unroll 2 - for (m = 0;m < 2;++m) - SWAP(x[0][j][0][l][m],x[0][j][1][l][m]) - - /* "xor x_1jklm into x_0jklm" */ -#pragma unroll 2 - for (j = 0;j < 2;++j) -#pragma unroll 2 - for (k = 0;k < 2;++k) -#pragma unroll 2 - for (l = 0;l < 2;++l) -#pragma unroll 2 - for (m = 0;m < 2;++m) - x[0][j][k][l][m] ^= x[1][j][k][l][m]; - - /* "swap x_1jkl0 with x_1jkl1" */ -#pragma unroll 2 - for (j = 0;j < 2;++j) -#pragma unroll 2 - for (k = 0;k < 2;++k) -#pragma unroll 2 - for (l = 0;l < 2;++l) - SWAP(x[1][j][k][l][0],x[1][j][k][l][1]) - - } -} - -__device__ __forceinline__ -static void block_tox(uint32_t* const block, uint32_t x[2][2][2][2][2]) -{ - // read 32 bytes input from global mem with uint2 chunks - AS_UINT2(x[0][0][0][0]) ^= AS_UINT2(&block[0]); - AS_UINT2(x[0][0][0][1]) ^= AS_UINT2(&block[2]); - AS_UINT2(x[0][0][1][0]) ^= AS_UINT2(&block[4]); - AS_UINT2(x[0][0][1][1]) ^= AS_UINT2(&block[6]); -} - -__device__ __forceinline__ -static void hash_fromx(uint32_t hash[16], uint32_t const x[2][2][2][2][2]) -{ - // used to write final hash to global mem - AS_UINT2(&hash[ 0]) = AS_UINT2(x[0][0][0][0]); - AS_UINT2(&hash[ 2]) = AS_UINT2(x[0][0][0][1]); - AS_UINT2(&hash[ 4]) = AS_UINT2(x[0][0][1][0]); - AS_UINT2(&hash[ 6]) = AS_UINT2(x[0][0][1][1]); - AS_UINT2(&hash[ 8]) = AS_UINT2(x[0][1][0][0]); - AS_UINT2(&hash[10]) = AS_UINT2(x[0][1][0][1]); - AS_UINT2(&hash[12]) = AS_UINT2(x[0][1][1][0]); - AS_UINT2(&hash[14]) = AS_UINT2(x[0][1][1][1]); -} - -#define Init(x) \ - AS_UINT2(x[0][0][0][0]) = AS_UINT2(&c_IV_512[ 0]); \ - AS_UINT2(x[0][0][0][1]) = AS_UINT2(&c_IV_512[ 2]); \ - AS_UINT2(x[0][0][1][0]) = AS_UINT2(&c_IV_512[ 4]); \ - AS_UINT2(x[0][0][1][1]) = AS_UINT2(&c_IV_512[ 6]); \ - AS_UINT2(x[0][1][0][0]) = AS_UINT2(&c_IV_512[ 8]); \ - AS_UINT2(x[0][1][0][1]) = AS_UINT2(&c_IV_512[10]); \ - AS_UINT2(x[0][1][1][0]) = AS_UINT2(&c_IV_512[12]); \ - AS_UINT2(x[0][1][1][1]) = AS_UINT2(&c_IV_512[14]); \ - AS_UINT2(x[1][0][0][0]) = AS_UINT2(&c_IV_512[16]); \ - AS_UINT2(x[1][0][0][1]) = AS_UINT2(&c_IV_512[18]); \ - AS_UINT2(x[1][0][1][0]) = AS_UINT2(&c_IV_512[20]); \ - AS_UINT2(x[1][0][1][1]) = AS_UINT2(&c_IV_512[22]); \ - AS_UINT2(x[1][1][0][0]) = AS_UINT2(&c_IV_512[24]); \ - AS_UINT2(x[1][1][0][1]) = AS_UINT2(&c_IV_512[26]); \ - AS_UINT2(x[1][1][1][0]) = AS_UINT2(&c_IV_512[28]); \ - AS_UINT2(x[1][1][1][1]) = AS_UINT2(&c_IV_512[30]); - -__device__ __forceinline__ -static void Update32(uint32_t x[2][2][2][2][2], uint32_t* const data) -{ - /* "xor the block into the first b bytes of the state" */ - block_tox(data, x); - /* "and then transform the state invertibly through r identical rounds" */ - rrounds(x); -} - -__device__ __forceinline__ -static void Final(uint32_t x[2][2][2][2][2], uint32_t *hashval) -{ - /* "the integer 1 is xored into the last state word x_11111" */ - x[1][1][1][1][1] ^= 1; - - /* "the state is then transformed invertibly through 10r identical rounds" */ - #pragma unroll 10 - for (int i = 0; i < 10; i++) rrounds(x); - - /* "output the first h/8 bytes of the state" */ - hash_fromx(hashval, x); -} - - -/***************************************************/ - -__global__ -void x11_cubehash512_gpu_hash_64(uint32_t threads, uint32_t startNounce, uint64_t *g_hash, uint32_t *g_nonceVector) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t nounce = (g_nonceVector != NULL) ? g_nonceVector[thread] : (startNounce + thread); - - int hashPosition = nounce - startNounce; - uint32_t *Hash = (uint32_t*)&g_hash[8 * hashPosition]; - - uint32_t x[2][2][2][2][2]; - Init(x); - - Update32(x, &Hash[0]); - Update32(x, &Hash[8]); - - // Padding Block - uint32_t last[8]; - last[0] = 0x80; - #pragma unroll 7 - for (int i=1; i < 8; i++) last[i] = 0; - Update32(x, last); - - Final(x, Hash); - } -} - -__host__ -void x11_cubehash512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order) -{ - const uint32_t threadsperblock = 256; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - size_t shared_size = 0; - - x11_cubehash512_gpu_hash_64<<>>(threads, startNounce, (uint64_t*)d_hash, d_nonceVector); -} - -__host__ -void x11_cubehash512_cpu_init(int thr_id, uint32_t threads) { } - - -/***************************************************/ - -#define WANT_CUBEHASH80 -#ifdef WANT_CUBEHASH80 - -__constant__ -static uint32_t c_PaddedMessage80[20]; - -__host__ -void cubehash512_setBlock_80(int thr_id, uint32_t* endiandata) -{ - cudaMemcpyToSymbol(c_PaddedMessage80, endiandata, sizeof(c_PaddedMessage80), 0, cudaMemcpyHostToDevice); -} - -__global__ -void cubehash512_gpu_hash_80(const uint32_t threads, const uint32_t startNounce, uint64_t *g_outhash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const uint32_t nonce = startNounce + thread; - - uint32_t x[2][2][2][2][2]; - Init(x); - - uint32_t message[8]; - // first 32 bytes - AS_UINT4(&message[0]) = AS_UINT4(&c_PaddedMessage80[0]); - AS_UINT4(&message[4]) = AS_UINT4(&c_PaddedMessage80[4]); - Update32(x, message); - - // second 32 bytes - AS_UINT4(&message[0]) = AS_UINT4(&c_PaddedMessage80[8]); - AS_UINT4(&message[4]) = AS_UINT4(&c_PaddedMessage80[12]); - Update32(x, message); - - // last 16 bytes + Padding - AS_UINT4(&message[0]) = AS_UINT4(&c_PaddedMessage80[16]); - message[3] = cuda_swab32(nonce); - message[4] = 0x80; - message[5] = 0; - message[6] = 0; - message[7] = 0; - Update32(x, message); - - uint32_t* output = (uint32_t*) (&g_outhash[(size_t)8 * thread]); - Final(x, output); - } -} - -__host__ -void cubehash512_cuda_hash_80(const int thr_id, const uint32_t threads, const uint32_t startNounce, uint32_t *d_hash) -{ - const uint32_t threadsperblock = 256; - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - cubehash512_gpu_hash_80 <<>> (threads, startNounce, (uint64_t*) d_hash); -} - -#endif \ No newline at end of file diff --git a/x11/cuda_x11_echo.cu b/x11/cuda_x11_echo.cu deleted file mode 100644 index 723b4ec3..00000000 --- a/x11/cuda_x11_echo.cu +++ /dev/null @@ -1,319 +0,0 @@ -#include -#include - -#include "cuda_helper.h" - -extern __device__ __device_builtin__ void __threadfence_block(void); - -#include "cuda_x11_aes.cuh" - -__device__ __forceinline__ void AES_2ROUND( - const uint32_t* __restrict__ sharedMemory, - uint32_t &x0, uint32_t &x1, uint32_t &x2, uint32_t &x3, - uint32_t &k0) -{ - uint32_t y0, y1, y2, y3; - - aes_round(sharedMemory, - x0, x1, x2, x3, - k0, - y0, y1, y2, y3); - - aes_round(sharedMemory, - y0, y1, y2, y3, - x0, x1, x2, x3); - - // hier werden wir ein carry brauchen (oder auch nicht) - k0++; -} - -__device__ __forceinline__ -void cuda_echo_round( - const uint32_t *const __restrict__ sharedMemory, uint32_t *const __restrict__ hash) -{ - const uint32_t P[48] = { - 0xe7e9f5f5, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, - 0xa4213d7e, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, - //8-12 - 0x01425eb8, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, - 0x65978b09, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, - //21-25 - 0x2cb6b661, 0x6b23b3b3, 0xcf93a7cf, 0x9d9d3751, - 0x9ac2dea3, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, - //34-38 - 0x579f9f33, 0xfbfbfbfb, 0xfbfbfbfb, 0xefefd3c7, - 0xdbfde1dd, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, - 0x34514d9e, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, - 0xb134347e, 0xea6f7e7e, 0xbd7731bd, 0x8a8a1968, - 0x14b8a457, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, - 0x265f4382, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af - //58-61 - }; - uint32_t k0; - uint32_t h[16]; - - #pragma unroll 16 - for (int i = 0; i < 16; i++) - { - h[i] = hash[i]; - } - - k0 = 512 + 8; - - #pragma unroll 4 - for (int idx = 0; idx < 16; idx += 4) - { - AES_2ROUND(sharedMemory, - h[idx + 0], h[idx + 1], h[idx + 2], h[idx + 3], k0); - } - k0 += 4; - - uint32_t W[64]; - - #pragma unroll 4 - for (int i = 0; i < 4; i++) - { - uint32_t a = P[i]; - uint32_t b = P[i + 4]; - uint32_t c = h[i + 8]; - uint32_t d = P[i + 8]; - - uint32_t ab = a ^ b; - uint32_t bc = b ^ c; - uint32_t cd = c ^ d; - - - uint32_t t = (ab & 0x80808080); - uint32_t t2 = (bc & 0x80808080); - uint32_t t3 = (cd & 0x80808080); - - uint32_t abx = (t >> 7) * 27 ^ ((ab^t) << 1); - uint32_t bcx = (t2 >> 7) * 27 ^ ((bc^t2) << 1); - uint32_t cdx = (t3 >> 7) * 27 ^ ((cd^t3) << 1); - - W[0 + i] = abx ^ bc ^ d; - W[0 + i + 4] = bcx ^ a ^ cd; - W[0 + i + 8] = cdx ^ ab ^ d; - W[0 + i + 12] = abx ^ bcx ^ cdx ^ ab ^ c; - - a = P[12 + i]; - b = h[i + 4]; - c = P[12 + i + 4]; - d = P[12 + i + 8]; - - ab = a ^ b; - bc = b ^ c; - cd = c ^ d; - - - t = (ab & 0x80808080); - t2 = (bc & 0x80808080); - t3 = (cd & 0x80808080); - - abx = (t >> 7) * 27 ^ ((ab^t) << 1); - bcx = (t2 >> 7) * 27 ^ ((bc^t2) << 1); - cdx = (t3 >> 7) * 27 ^ ((cd^t3) << 1); - - W[16 + i] = abx ^ bc ^ d; - W[16 + i + 4] = bcx ^ a ^ cd; - W[16 + i + 8] = cdx ^ ab ^ d; - W[16 + i + 12] = abx ^ bcx ^ cdx ^ ab ^ c; - - a = h[i]; - b = P[24 + i + 0]; - c = P[24 + i + 4]; - d = P[24 + i + 8]; - - ab = a ^ b; - bc = b ^ c; - cd = c ^ d; - - - t = (ab & 0x80808080); - t2 = (bc & 0x80808080); - t3 = (cd & 0x80808080); - - abx = (t >> 7) * 27 ^ ((ab^t) << 1); - bcx = (t2 >> 7) * 27 ^ ((bc^t2) << 1); - cdx = (t3 >> 7) * 27 ^ ((cd^t3) << 1); - - W[32 + i] = abx ^ bc ^ d; - W[32 + i + 4] = bcx ^ a ^ cd; - W[32 + i + 8] = cdx ^ ab ^ d; - W[32 + i + 12] = abx ^ bcx ^ cdx ^ ab ^ c; - - a = P[36 + i ]; - b = P[36 + i + 4]; - c = P[36 + i + 8]; - d = h[i + 12]; - - ab = a ^ b; - bc = b ^ c; - cd = c ^ d; - - t = (ab & 0x80808080); - t2 = (bc & 0x80808080); - t3 = (cd & 0x80808080); - - abx = (t >> 7) * 27 ^ ((ab^t) << 1); - bcx = (t2 >> 7) * 27 ^ ((bc^t2) << 1); - cdx = (t3 >> 7) * 27 ^ ((cd^t3) << 1); - - W[48 + i] = abx ^ bc ^ d; - W[48 + i + 4] = bcx ^ a ^ cd; - W[48 + i + 8] = cdx ^ ab ^ d; - W[48 + i + 12] = abx ^ bcx ^ cdx ^ ab ^ c; - - } - - for (int k = 1; k < 10; k++) - { - - // Big Sub Words - #pragma unroll 4 - for (int idx = 0; idx < 64; idx += 16) - { - AES_2ROUND(sharedMemory, - W[idx + 0], W[idx + 1], W[idx + 2], W[idx + 3], - k0); - AES_2ROUND(sharedMemory, - W[idx + 4], W[idx + 5], W[idx + 6], W[idx + 7], - k0); - AES_2ROUND(sharedMemory, - W[idx + 8], W[idx + 9], W[idx + 10], W[idx + 11], - k0); - AES_2ROUND(sharedMemory, - W[idx + 12], W[idx + 13], W[idx + 14], W[idx + 15], - k0); - } - - // Shift Rows - #pragma unroll 4 - for (int i = 0; i < 4; i++) - { - uint32_t t; - - /// 1, 5, 9, 13 - t = W[4 + i]; - W[4 + i] = W[20 + i]; - W[20 + i] = W[36 + i]; - W[36 + i] = W[52 + i]; - W[52 + i] = t; - - // 2, 6, 10, 14 - t = W[8 + i]; - W[8 + i] = W[40 + i]; - W[40 + i] = t; - t = W[24 + i]; - W[24 + i] = W[56 + i]; - W[56 + i] = t; - - // 15, 11, 7, 3 - t = W[60 + i]; - W[60 + i] = W[44 + i]; - W[44 + i] = W[28 + i]; - W[28 + i] = W[12 + i]; - W[12 + i] = t; - } - - // Mix Columns - #pragma unroll 4 - for (int i = 0; i < 4; i++) // Schleife über je 2*uint32_t - { - #pragma unroll 4 - for (int idx = 0; idx < 64; idx += 16) // Schleife über die elemnte - { - uint32_t a = W[idx + i]; - uint32_t b = W[idx + i + 4]; - uint32_t c = W[idx + i + 8]; - uint32_t d = W[idx + i + 12]; - - uint32_t ab = a ^ b; - uint32_t bc = b ^ c; - uint32_t cd = c ^ d; - - uint32_t t, t2, t3; - t = (ab & 0x80808080); - t2 = (bc & 0x80808080); - t3 = (cd & 0x80808080); - - uint32_t abx = (t >> 7) * 27 ^ ((ab^t) << 1); - uint32_t bcx = (t2 >> 7) * 27 ^ ((bc^t2) << 1); - uint32_t cdx = (t3 >> 7) * 27 ^ ((cd^t3) << 1); - - W[idx + i] = abx ^ bc ^ d; - W[idx + i + 4] = bcx ^ a ^ cd; - W[idx + i + 8] = cdx ^ ab ^ d; - W[idx + i + 12] = abx ^ bcx ^ cdx ^ ab ^ c; - } - } - } - - #pragma unroll - for (int i = 0; i < 16; i += 4) - { - W[i] ^= W[32 + i] ^ 512; - W[i + 1] ^= W[32 + i + 1]; - W[i + 2] ^= W[32 + i + 2]; - W[i + 3] ^= W[32 + i + 3]; - } - - #pragma unroll - for (int i = 0; i < 16; i++) - hash[i] ^= W[i]; -} - -__device__ __forceinline__ -void echo_gpu_init(uint32_t *const __restrict__ sharedMemory) -{ - /* each thread startup will fill a uint32 */ - if (threadIdx.x < 128) { - sharedMemory[threadIdx.x] = d_AES0[threadIdx.x]; - sharedMemory[threadIdx.x + 256] = d_AES1[threadIdx.x]; - sharedMemory[threadIdx.x + 512] = d_AES2[threadIdx.x]; - sharedMemory[threadIdx.x + 768] = d_AES3[threadIdx.x]; - - sharedMemory[threadIdx.x + 64 * 2] = d_AES0[threadIdx.x + 64 * 2]; - sharedMemory[threadIdx.x + 64 * 2 + 256] = d_AES1[threadIdx.x + 64 * 2]; - sharedMemory[threadIdx.x + 64 * 2 + 512] = d_AES2[threadIdx.x + 64 * 2]; - sharedMemory[threadIdx.x + 64 * 2 + 768] = d_AES3[threadIdx.x + 64 * 2]; - } -} - -__global__ __launch_bounds__(128, 7) /* will force 72 registers */ -void x11_echo512_gpu_hash_64(uint32_t threads, uint32_t startNounce, uint64_t *g_hash, uint32_t *g_nonceVector) -{ - __shared__ uint32_t sharedMemory[1024]; - - echo_gpu_init(sharedMemory); - __threadfence_block(); - - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t nounce = (g_nonceVector != NULL) ? g_nonceVector[thread] : (startNounce + thread); - - int hashPosition = nounce - startNounce; - uint32_t *Hash = (uint32_t*)&g_hash[hashPosition<<3]; - - cuda_echo_round(sharedMemory, Hash); - } -} - -__host__ -void x11_echo512_cpu_init(int thr_id, uint32_t threads) -{ - aes_cpu_init(thr_id); -} - -__host__ -void x11_echo512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order) -{ - const uint32_t threadsperblock = 128; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - x11_echo512_gpu_hash_64<<>>(threads, startNounce, (uint64_t*)d_hash, d_nonceVector); - //MyStreamSynchronize(NULL, order, thr_id); -} diff --git a/x11/cuda_x11_echo_alexis.cu b/x11/cuda_x11_echo_alexis.cu deleted file mode 100644 index 7a99fd42..00000000 --- a/x11/cuda_x11_echo_alexis.cu +++ /dev/null @@ -1,527 +0,0 @@ -/* - Based on Tanguy Pruvot's repo - Provos Alexis - 2016 -*/ - -#include "cuda_helper_alexis.h" -#include "cuda_vectors_alexis.h" - -#define INTENSIVE_GMF -#include "cuda_x11_aes_alexis.cuh" - -__device__ -static void echo_round_alexis(const uint32_t sharedMemory[4][256], uint32_t *W, uint32_t &k0){ - // Big Sub Words - #pragma unroll 16 - for (int idx = 0; idx < 16; idx++) - AES_2ROUND(sharedMemory,W[(idx<<2) + 0], W[(idx<<2) + 1], W[(idx<<2) + 2], W[(idx<<2) + 3], k0); - - // Shift Rows - #pragma unroll 4 - for (int i = 0; i < 4; i++){ - uint32_t t[4]; - /// 1, 5, 9, 13 - t[0] = W[i+ 4]; - t[1] = W[i+ 8]; - t[2] = W[i+24]; - t[3] = W[i+60]; - W[i + 4] = W[i + 20]; - W[i + 8] = W[i + 40]; - W[i +24] = W[i + 56]; - W[i +60] = W[i + 44]; - - W[i +20] = W[i +36]; - W[i +40] = t[1]; - W[i +56] = t[2]; - W[i +44] = W[i +28]; - - W[i +28] = W[i +12]; - W[i +12] = t[3]; - W[i +36] = W[i +52]; - W[i +52] = t[0]; - } - // Mix Columns - #pragma unroll 4 - for (int i = 0; i < 4; i++){ // Schleife über je 2*uint32_t - #pragma unroll 4 - for (int idx = 0; idx < 64; idx += 16){ // Schleife über die elemnte - uint32_t a[4]; - a[0] = W[idx + i]; - a[1] = W[idx + i + 4]; - a[2] = W[idx + i + 8]; - a[3] = W[idx + i +12]; - - uint32_t ab = a[0] ^ a[1]; - uint32_t bc = a[1] ^ a[2]; - uint32_t cd = a[2] ^ a[3]; - - uint32_t t, t2, t3; - t = (ab & 0x80808080); - t2 = (bc & 0x80808080); - t3 = (cd & 0x80808080); - - uint32_t abx = (t >> 7) * 27U ^ ((ab^t) << 1); - uint32_t bcx = (t2 >> 7) * 27U ^ ((bc^t2) << 1); - uint32_t cdx = (t3 >> 7) * 27U ^ ((cd^t3) << 1); - - W[idx + i] = bc ^ a[3] ^ abx; - W[idx + i + 4] = a[0] ^ cd ^ bcx; - W[idx + i + 8] = ab ^ a[3] ^ cdx; - W[idx + i +12] = ab ^ a[2] ^ (abx ^ bcx ^ cdx); - } - } -} - -__global__ __launch_bounds__(256, 3) /* will force 80 registers */ -static void x11_echo512_gpu_hash_64_final_alexis(uint32_t threads, uint64_t *g_hash,uint32_t* resNonce, const uint64_t target){ - __shared__ uint32_t sharedMemory[4][256]; - - aes_gpu_init256(sharedMemory); - - const uint32_t P[48] = { - 0xe7e9f5f5, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af,0xa4213d7e, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, - //8-12 - 0x01425eb8, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af,0x65978b09, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, - //21-25 - 0x2cb6b661, 0x6b23b3b3, 0xcf93a7cf, 0x9d9d3751,0x9ac2dea3, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, - //34-38 - 0x579f9f33, 0xfbfbfbfb, 0xfbfbfbfb, 0xefefd3c7,0xdbfde1dd, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, - 0x34514d9e, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af,0xb134347e, 0xea6f7e7e, 0xbd7731bd, 0x8a8a1968, - 0x14b8a457, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af,0x265f4382, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af - //58-61 - }; - uint32_t k0; - uint32_t h[16]; - - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - - if (thread < threads){ - - const uint32_t *hash = (uint32_t*)&g_hash[thread<<3]; - - *(uint2x4*)&h[ 0] = __ldg4((uint2x4*)&hash[ 0]); - *(uint2x4*)&h[ 8] = __ldg4((uint2x4*)&hash[ 8]); - - uint64_t backup = *(uint64_t*)&h[ 6]; - - k0 = 512 + 8; - - #pragma unroll 4 - for (uint32_t idx = 0; idx < 16; idx += 4) - AES_2ROUND(sharedMemory,h[idx + 0], h[idx + 1], h[idx + 2], h[idx + 3], k0); - - k0 += 4; - - uint32_t W[64]; - - #pragma unroll 4 - for (uint32_t i = 0; i < 4; i++){ - uint32_t a = P[i]; - uint32_t b = P[i + 4]; - uint32_t c = h[i + 8]; - uint32_t d = P[i + 8]; - - uint32_t ab = a ^ b; - uint32_t bc = b ^ c; - uint32_t cd = c ^ d; - - - uint32_t t = ((a ^ b) & 0x80808080); - uint32_t t2 = ((b ^ c) & 0x80808080); - uint32_t t3 = ((c ^ d) & 0x80808080); - - uint32_t abx = ((t >> 7) * 27U) ^ ((ab^t) << 1); - uint32_t bcx = ((t2 >> 7) * 27U) ^ ((bc^t2) << 1); - uint32_t cdx = ((t3 >> 7) * 27U) ^ ((cd^t3) << 1); - - W[0 + i] = bc ^ d ^ abx; - W[4 + i] = a ^ cd ^ bcx; - W[8 + i] = ab ^ d ^ cdx; - W[12+ i] = abx ^ bcx ^ cdx ^ ab ^ c; - - a = P[12 + i]; - b = h[i + 4]; - c = P[12 + i + 4]; - d = P[12 + i + 8]; - - ab = a ^ b; - bc = b ^ c; - cd = c ^ d; - - - t = (ab & 0x80808080); - t2 = (bc & 0x80808080); - t3 = (cd & 0x80808080); - - abx = (t >> 7) * 27U ^ ((ab^t) << 1); - bcx = (t2 >> 7) * 27U ^ ((bc^t2) << 1); - cdx = (t3 >> 7) * 27U ^ ((cd^t3) << 1); - - W[16 + i] = abx ^ bc ^ d; - W[16 + i + 4] = bcx ^ a ^ cd; - W[16 + i + 8] = cdx ^ ab ^ d; - W[16 + i +12] = abx ^ bcx ^ cdx ^ ab ^ c; - - a = h[i]; - b = P[24 + i]; - c = P[24 + i + 4]; - d = P[24 + i + 8]; - - ab = a ^ b; - bc = b ^ c; - cd = c ^ d; - - - t = (ab & 0x80808080); - t2 = (bc & 0x80808080); - t3 = (cd & 0x80808080); - - abx = (t >> 7) * 27U ^ ((ab^t) << 1); - bcx = (t2 >> 7) * 27U ^ ((bc^t2) << 1); - cdx = (t3 >> 7) * 27U ^ ((cd^t3) << 1); - - W[32 + i] = abx ^ bc ^ d; - W[32 + i + 4] = bcx ^ a ^ cd; - W[32 + i + 8] = cdx ^ ab ^ d; - W[32 + i +12] = abx ^ bcx ^ cdx ^ ab ^ c; - - a = P[36 + i ]; - b = P[36 + i + 4]; - c = P[36 + i + 8]; - d = h[i + 12]; - - ab = a ^ b; - bc = b ^ c; - cd = c ^ d; - - t = (ab & 0x80808080); - t2 = (bc & 0x80808080); - t3 = (cd & 0x80808080); - - abx = (t >> 7) * 27U ^ ((ab^t) << 1); - bcx = (t2 >> 7) * 27U ^ ((bc^t2) << 1); - cdx = (t3 >> 7) * 27U ^ ((cd^t3) << 1); - - W[48 + i] = abx ^ bc ^ d; - W[48 + i + 4] = bcx ^ a ^ cd; - W[48 + i + 8] = cdx ^ ab ^ d; - W[48 + i +12] = abx ^ bcx ^ cdx ^ ab ^ c; - } - - for (int k = 1; k < 9; k++) - echo_round_alexis(sharedMemory,W,k0); - // Big Sub Words - uint32_t y0, y1, y2, y3; -// AES_2ROUND(sharedMemory,W[ 0], W[ 1], W[ 2], W[ 3], k0); - aes_round(sharedMemory, W[ 0], W[ 1], W[ 2], W[ 3], k0, y0, y1, y2, y3); - aes_round(sharedMemory, y0, y1, y2, y3, W[ 0], W[ 1], W[ 2], W[ 3]); -// AES_2ROUND(sharedMemory,W[ 4], W[ 5], W[ 6], W[ 7], k0); - aes_round(sharedMemory, W[ 4], W[ 5], W[ 6], W[ 7], k0, y0, y1, y2, y3); - aes_round(sharedMemory, y0, y1, y2, y3, W[ 4], W[ 5], W[ 6], W[ 7]); -// AES_2ROUND(sharedMemory,W[ 8], W[ 9], W[10], W[11], k0); - aes_round(sharedMemory, W[ 8], W[ 9], W[10], W[11], k0, y0, y1, y2, y3); - aes_round(sharedMemory, y0, y1, y2, y3, W[ 8], W[ 9], W[10], W[11]); - -// AES_2ROUND(sharedMemory,W[20], W[21], W[22], W[23], k0); - aes_round(sharedMemory, W[20], W[21], W[22], W[23], k0, y0, y1, y2, y3); - aes_round(sharedMemory, y0, y1, y2, y3, W[20], W[21], W[22], W[23]); -// AES_2ROUND(sharedMemory,W[28], W[29], W[30], W[31], k0); - aes_round(sharedMemory, W[28], W[29], W[30], W[31], k0, y0, y1, y2, y3); - aes_round(sharedMemory, y0, y1, y2, y3, W[28], W[29], W[30], W[31]); - -// AES_2ROUND(sharedMemory,W[32], W[33], W[34], W[35], k0); - aes_round(sharedMemory, W[32], W[33], W[34], W[35], k0, y0, y1, y2, y3); - aes_round(sharedMemory, y0, y1, y2, y3, W[32], W[33], W[34], W[35]); -// AES_2ROUND(sharedMemory,W[40], W[41], W[42], W[43], k0); - aes_round(sharedMemory, W[40], W[41], W[42], W[43], k0, y0, y1, y2, y3); - aes_round(sharedMemory, y0, y1, y2, y3, W[40], W[41], W[42], W[43]); - - aes_round(sharedMemory, W[52], W[53], W[54], W[55], k0, y0, y1, y2, y3); - aes_round(sharedMemory, y0, y1, y2, y3, W[52], W[53], W[54], W[55]); -// AES_2ROUND(sharedMemory,W[60], W[61], W[62], W[63], k0); - aes_round(sharedMemory, W[60], W[61], W[62], W[63], k0, y0, y1, y2, y3); - aes_round(sharedMemory, y0, y1, y2, y3, W[60], W[61], W[62], W[63]); - - uint32_t bc = W[22] ^ W[42]; - uint32_t t2 = (bc & 0x80808080); - W[ 6] = (t2 >> 7) * 27U ^ ((bc^t2) << 1); - - bc = W[23] ^ W[43]; - t2 = (bc & 0x80808080); - W[ 7] = (t2 >> 7) * 27U ^ ((bc^t2) << 1); - - bc = W[10] ^ W[54]; - t2 = (bc & 0x80808080); - W[38] = (t2 >> 7) * 27U ^ ((bc^t2) << 1); - - bc = W[11] ^ W[55]; - t2 = (bc & 0x80808080); - W[39] = (t2 >> 7) * 27U ^ ((bc^t2) << 1); - - uint64_t check = backup ^ *(uint64_t*)&W[2] ^ *(uint64_t*)&W[6] ^ *(uint64_t*)&W[10] ^ *(uint64_t*)&W[30] ^ *(uint64_t*)&W[34] ^ *(uint64_t*)&W[38] ^ *(uint64_t*)&W[42] ^ *(uint64_t*)&W[62]; - if(check <= target){ - uint32_t tmp = atomicExch(&resNonce[0], thread); - if (tmp != UINT32_MAX) - resNonce[1] = tmp; - } - } -} - -__host__ -void x11_echo512_cpu_hash_64_final_alexis(int thr_id, uint32_t threads, uint32_t *d_hash, uint32_t *d_resNonce, const uint64_t target) -{ - const uint32_t threadsperblock = 256; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - x11_echo512_gpu_hash_64_final_alexis<<>>(threads, (uint64_t*)d_hash,d_resNonce,target); -} - -__global__ __launch_bounds__(128, 5) /* will force 80 registers */ -static void x11_echo512_gpu_hash_64_alexis(uint32_t threads, uint32_t *g_hash) -{ - __shared__ uint32_t sharedMemory[4][256]; - - aes_gpu_init128(sharedMemory); - - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - uint32_t k0; - uint32_t h[16]; - uint32_t hash[16]; - if (thread < threads){ - - uint32_t *Hash = &g_hash[thread<<4]; - - *(uint2x4*)&h[ 0] = __ldg4((uint2x4*)&Hash[ 0]); - *(uint2x4*)&h[ 8] = __ldg4((uint2x4*)&Hash[ 8]); - - *(uint2x4*)&hash[ 0] = *(uint2x4*)&h[ 0]; - *(uint2x4*)&hash[ 8] = *(uint2x4*)&h[ 8]; - - __syncthreads(); - - const uint32_t P[48] = { - 0xe7e9f5f5, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, 0xa4213d7e, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, - //8-12 - 0x01425eb8, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, 0x65978b09, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, - //21-25 - 0x2cb6b661, 0x6b23b3b3, 0xcf93a7cf, 0x9d9d3751, 0x9ac2dea3, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, - //34-38 - 0x579f9f33, 0xfbfbfbfb, 0xfbfbfbfb, 0xefefd3c7, 0xdbfde1dd, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, - 0x34514d9e, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, 0xb134347e, 0xea6f7e7e, 0xbd7731bd, 0x8a8a1968, - 0x14b8a457, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af, 0x265f4382, 0xf5e7e9f5, 0xb3b36b23, 0xb3dbe7af - //58-61 - }; - - k0 = 520; - - #pragma unroll 4 - for (uint32_t idx = 0; idx < 16; idx += 4) - { - AES_2ROUND(sharedMemory, h[idx + 0], h[idx + 1], h[idx + 2], h[idx + 3], k0); - } - k0 += 4; - - uint32_t W[64]; - - #pragma unroll 4 - for (uint32_t i = 0; i < 4; i++) - { - uint32_t a = P[i]; - uint32_t b = P[i + 4]; - uint32_t c = h[i + 8]; - uint32_t d = P[i + 8]; - - uint32_t ab = a ^ b; - uint32_t bc = b ^ c; - uint32_t cd = c ^ d; - - - uint32_t t = (ab & 0x80808080); - uint32_t t2 = (bc & 0x80808080); - uint32_t t3 = (cd & 0x80808080); - - uint32_t abx = (t >> 7) * 27U ^ ((ab^t) << 1); - uint32_t bcx = (t2 >> 7) * 27U ^ ((bc^t2) << 1); - uint32_t cdx = (t3 >> 7) * 27U ^ ((cd^t3) << 1); - - W[i] = abx ^ bc ^ d; - W[i + 4] = bcx ^ a ^ cd; - W[i + 8] = cdx ^ ab ^ d; - W[i +12] = abx ^ bcx ^ cdx ^ ab ^ c; - - a = P[i +12]; - b = h[i + 4]; - c = P[i +16]; - d = P[i +20]; - - ab = a ^ b; - bc = b ^ c; - cd = c ^ d; - - - t = (ab & 0x80808080); - t2 = (bc & 0x80808080); - t3 = (cd & 0x80808080); - - abx = (t >> 7) * 27U ^ ((ab^t) << 1); - bcx = (t2 >> 7) * 27U ^ ((bc^t2) << 1); - cdx = (t3 >> 7) * 27U ^ ((cd^t3) << 1); - - W[16 + i] = bc ^ d ^ abx; - W[16 + i + 4] = a ^ cd ^ bcx; - W[16 + i + 8] = d ^ ab ^ cdx; - W[16 + i + 12] = c ^ ab ^ abx ^ bcx ^ cdx; - - a = h[i]; - b = P[24 + i + 0]; - c = P[24 + i + 4]; - d = P[24 + i + 8]; - - ab = a ^ b; - bc = b ^ c; - cd = c ^ d; - - - t = (ab & 0x80808080); - t2 = (bc & 0x80808080); - t3 = (cd & 0x80808080); - - abx = (t >> 7) * 27U ^ ((ab^t) << 1); - bcx = (t2 >> 7) * 27U ^ ((bc^t2) << 1); - cdx = (t3 >> 7) * 27U ^ ((cd^t3) << 1); - - W[32 + i] = bc ^ d ^ abx; - W[32 + i + 4] = a ^ cd ^ bcx; - W[32 + i + 8] = d ^ ab ^ cdx; - W[32 + i + 12] = c ^ ab ^ abx ^ bcx ^ cdx; - - a = P[36 + i ]; - b = P[36 + i + 4]; - c = P[36 + i + 8]; - d = h[i + 12]; - - ab = a ^ b; - bc = b ^ c; - cd = c ^ d; - - t = (ab & 0x80808080); - t2 = (bc & 0x80808080); - t3 = (cd & 0x80808080); - - abx = (t >> 7) * 27U ^ ((ab^t) << 1); - bcx = (t2 >> 7) * 27U ^ ((bc^t2) << 1); - cdx = (t3 >> 7) * 27U ^ ((cd^t3) << 1); - - W[48 + i] = bc ^ d ^ abx; - W[48 + i + 4] = a ^ cd ^ bcx; - W[48 + i + 8] = d ^ ab ^ cdx; - W[48 + i + 12] = c ^ ab ^ abx ^ bcx ^ cdx; - - } - - for (int k = 1; k < 10; k++) - echo_round_alexis(sharedMemory,W,k0); - - #pragma unroll 4 - for (int i = 0; i < 16; i += 4) - { - W[i] ^= W[32 + i] ^ 512; - W[i + 1] ^= W[32 + i + 1]; - W[i + 2] ^= W[32 + i + 2]; - W[i + 3] ^= W[32 + i + 3]; - } - *(uint2x4*)&Hash[ 0] = *(uint2x4*)&hash[ 0] ^ *(uint2x4*)&W[ 0]; - *(uint2x4*)&Hash[ 8] = *(uint2x4*)&hash[ 8] ^ *(uint2x4*)&W[ 8]; - } -} - -__host__ -void x11_echo512_cpu_hash_64_alexis(int thr_id, uint32_t threads, uint32_t *d_hash){ - - const uint32_t threadsperblock = 128; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - x11_echo512_gpu_hash_64_alexis<<>>(threads, d_hash); -} - -__constant__ static uint32_t c_PaddedMessage80[20]; - -__global__ __launch_bounds__(128, 5) /* will force 80 registers */ -static void x11_echo512_gpu_hash_80_alexis(uint32_t threads, uint32_t startNonce, uint32_t *g_hash) -{ - __shared__ uint32_t sharedMemory[4][256]; - - aes_gpu_init128(sharedMemory); - - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - uint32_t k0; - uint32_t h[29]; - if (thread < threads){ - - uint32_t *Hash = &g_hash[thread<<4]; - - *(uint2x4*)&h[0] = __ldg4((uint2x4*)&c_PaddedMessage80[0]); - *(uint2x4*)&h[8] = __ldg4((uint2x4*)&c_PaddedMessage80[8]); - *(uint2*)&h[16] = __ldg((uint2*)&c_PaddedMessage80[16]); - h[18] = c_PaddedMessage80[18]; - h[19] = cuda_swab32(startNonce + thread); - h[20] = 0x80; - h[21] = h[22] = h[23] = h[24] = h[25] = h[26] = 0; - h[27] = 0x2000000; - h[28] = 0x280; - - __syncthreads(); - - k0 = 640; - - uint32_t W[64]; - - #pragma unroll 8 - for (int i = 0; i < 32; i+=4) { - W[i] = 512; // L - W[i+1] = 0; // H - W[i+2] = 0; // X - W[i+3] = 0; - } - - uint32_t Z[16]; - #pragma unroll - for (int i = 0; i<16; i++) Z[i] = W[i]; - #pragma unroll - for (int i = 32; i<61; i++) W[i] = h[i - 32]; - #pragma unroll - for (int i = 61; i<64; i++) W[i] = 0; - - for (int k = 0; k < 10; k++) - echo_round_alexis(sharedMemory,W,k0); - - #pragma unroll 16 - for (int i = 0; i < 16; i++) { - Z[i] ^= h[i] ^ W[i] ^ W[i + 32]; - } - - *(uint2x4*)&Hash[0] = *(uint2x4*)&Z[0]; - *(uint2x4*)&Hash[8] = *(uint2x4*)&Z[8]; - } -} - -__host__ -void x11_echo512_setBlock_80_alexis(void *endiandata) -{ - cudaMemcpyToSymbol(c_PaddedMessage80, endiandata, sizeof(c_PaddedMessage80), 0, cudaMemcpyHostToDevice); -} - -__host__ -void x11_echo512_cpu_hash_80_alexis(int thr_id, uint32_t threads, const uint32_t startNonce, uint32_t *d_hash){ - - const uint32_t threadsperblock = 128; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - x11_echo512_gpu_hash_80_alexis<<>>(threads, startNonce, d_hash); -} diff --git a/x11/cuda_x11_luffa512.cu b/x11/cuda_x11_luffa512.cu deleted file mode 100644 index 2e71d775..00000000 --- a/x11/cuda_x11_luffa512.cu +++ /dev/null @@ -1,381 +0,0 @@ -/* - * luffa_for_32.c - * Version 2.0 (Sep 15th 2009) - * - * Copyright (C) 2008-2009 Hitachi, Ltd. All rights reserved. - * - * Hitachi, Ltd. is the owner of this software and hereby grant - * the U.S. Government and any interested party the right to use - * this software for the purposes of the SHA-3 evaluation process, - * notwithstanding that this software is copyrighted. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "cuda_helper.h" - -typedef unsigned char BitSequence; - -typedef struct { - uint32_t buffer[8]; /* Buffer to be hashed */ - uint32_t chainv[40]; /* Chaining values */ -} hashState; - -#define MULT2(a,j)\ - tmp = a[7+(8*j)];\ - a[7+(8*j)] = a[6+(8*j)];\ - a[6+(8*j)] = a[5+(8*j)];\ - a[5+(8*j)] = a[4+(8*j)];\ - a[4+(8*j)] = a[3+(8*j)] ^ tmp;\ - a[3+(8*j)] = a[2+(8*j)] ^ tmp;\ - a[2+(8*j)] = a[1+(8*j)];\ - a[1+(8*j)] = a[0+(8*j)] ^ tmp;\ - a[0+(8*j)] = tmp; - -#if __CUDA_ARCH__ < 350 -#define LROT(x,bits) ((x << bits) | (x >> (32 - bits))) -#else -#define LROT(x, bits) __funnelshift_l(x, x, bits) -#endif - -#define TWEAK(a0,a1,a2,a3,j)\ - a0 = LROT(a0,j);\ - a1 = LROT(a1,j);\ - a2 = LROT(a2,j);\ - a3 = LROT(a3,j); - -#define STEP(c0,c1)\ - SUBCRUMB(chainv[0],chainv[1],chainv[2],chainv[3],tmp);\ - SUBCRUMB(chainv[5],chainv[6],chainv[7],chainv[4],tmp);\ - MIXWORD(chainv[0],chainv[4]);\ - MIXWORD(chainv[1],chainv[5]);\ - MIXWORD(chainv[2],chainv[6]);\ - MIXWORD(chainv[3],chainv[7]);\ - ADD_CONSTANT(chainv[0],chainv[4],c0,c1); - -#define SUBCRUMB(a0,a1,a2,a3,a4)\ - a4 = a0;\ - a0 |= a1;\ - a2 ^= a3;\ - a1 = ~a1;\ - a0 ^= a3;\ - a3 &= a4;\ - a1 ^= a3;\ - a3 ^= a2;\ - a2 &= a0;\ - a0 = ~a0;\ - a2 ^= a1;\ - a1 |= a3;\ - a4 ^= a1;\ - a3 ^= a2;\ - a2 &= a1;\ - a1 ^= a0;\ - a0 = a4; - -#define MIXWORD(a0,a4)\ - a4 ^= a0;\ - a0 = LROT(a0,2);\ - a0 ^= a4;\ - a4 = LROT(a4,14);\ - a4 ^= a0;\ - a0 = LROT(a0,10);\ - a0 ^= a4;\ - a4 = LROT(a4,1); - -#define ADD_CONSTANT(a0,b0,c0,c1)\ - a0 ^= c0;\ - b0 ^= c1; - -/* initial values of chaining variables */ -__device__ __constant__ uint32_t c_IV[40]; -const uint32_t h_IV[40] = { - 0x6d251e69,0x44b051e0,0x4eaa6fb4,0xdbf78465, - 0x6e292011,0x90152df4,0xee058139,0xdef610bb, - 0xc3b44b95,0xd9d2f256,0x70eee9a0,0xde099fa3, - 0x5d9b0557,0x8fc944b3,0xcf1ccf0e,0x746cd581, - 0xf7efc89d,0x5dba5781,0x04016ce5,0xad659c05, - 0x0306194f,0x666d1836,0x24aa230a,0x8b264ae7, - 0x858075d5,0x36d79cce,0xe571f7d7,0x204b1f67, - 0x35870c6a,0x57e9e923,0x14bcb808,0x7cde72ce, - 0x6c68e9be,0x5ec41e22,0xc825b7c7,0xaffb4363, - 0xf5df3999,0x0fc688f1,0xb07224cc,0x03e86cea}; - -__device__ __constant__ uint32_t c_CNS[80]; -const uint32_t h_CNS[80] = { - 0x303994a6,0xe0337818,0xc0e65299,0x441ba90d, - 0x6cc33a12,0x7f34d442,0xdc56983e,0x9389217f, - 0x1e00108f,0xe5a8bce6,0x7800423d,0x5274baf4, - 0x8f5b7882,0x26889ba7,0x96e1db12,0x9a226e9d, - 0xb6de10ed,0x01685f3d,0x70f47aae,0x05a17cf4, - 0x0707a3d4,0xbd09caca,0x1c1e8f51,0xf4272b28, - 0x707a3d45,0x144ae5cc,0xaeb28562,0xfaa7ae2b, - 0xbaca1589,0x2e48f1c1,0x40a46f3e,0xb923c704, - 0xfc20d9d2,0xe25e72c1,0x34552e25,0xe623bb72, - 0x7ad8818f,0x5c58a4a4,0x8438764a,0x1e38e2e7, - 0xbb6de032,0x78e38b9d,0xedb780c8,0x27586719, - 0xd9847356,0x36eda57f,0xa2c78434,0x703aace7, - 0xb213afa5,0xe028c9bf,0xc84ebe95,0x44756f91, - 0x4e608a22,0x7e8fce32,0x56d858fe,0x956548be, - 0x343b138f,0xfe191be2,0xd0ec4e3d,0x3cb226e5, - 0x2ceb4882,0x5944a28e,0xb3ad2208,0xa1c4c355, - 0xf0d2e9e3,0x5090d577,0xac11d7fa,0x2d1925ab, - 0x1bcb66f2,0xb46496ac,0x6f2d9bc9,0xd1925ab0, - 0x78602649,0x29131ab6,0x8edae952,0x0fc053c3, - 0x3b6ba548,0x3f014f0c,0xedae9520,0xfc053c31}; - - -/***************************************************/ -__device__ __forceinline__ -void rnd512(hashState *state) -{ - int i,j; - uint32_t t[40]; - uint32_t chainv[8]; - uint32_t tmp; - -#pragma unroll 8 - for(i=0;i<8;i++) { - t[i]=0; -#pragma unroll 5 - for(j=0;j<5;j++) { - t[i] ^= state->chainv[i+8*j]; - } - } - - MULT2(t, 0); - -#pragma unroll 5 - for(j=0;j<5;j++) { -#pragma unroll 8 - for(i=0;i<8;i++) { - state->chainv[i+8*j] ^= t[i]; - } - } - -#pragma unroll 5 - for(j=0;j<5;j++) { -#pragma unroll 8 - for(i=0;i<8;i++) { - t[i+8*j] = state->chainv[i+8*j]; - } - } - -#pragma unroll 5 - for(j=0;j<5;j++) { - MULT2(state->chainv, j); - } - -#pragma unroll 5 - for(j=0;j<5;j++) { -#pragma unroll 8 - for(i=0;i<8;i++) { - state->chainv[8*j+i] ^= t[8*((j+1)%5)+i]; - } - } - -#pragma unroll 5 - for(j=0;j<5;j++) { -#pragma unroll 8 - for(i=0;i<8;i++) { - t[i+8*j] = state->chainv[i+8*j]; - } - } - -#pragma unroll 5 - for(j=0;j<5;j++) { - MULT2(state->chainv, j); - } - -#pragma unroll 5 - for(j=0;j<5;j++) { -#pragma unroll 8 - for(i=0;i<8;i++) { - state->chainv[8*j+i] ^= t[8*((j+4)%5)+i]; - } - } - -#pragma unroll 5 - for(j=0;j<5;j++) { -#pragma unroll 8 - for(i=0;i<8;i++) { - state->chainv[i+8*j] ^= state->buffer[i]; - } - MULT2(state->buffer, 0); - } - -#pragma unroll 8 - for(i=0;i<8;i++) { - chainv[i] = state->chainv[i]; - } - -#pragma unroll 8 - for(i=0;i<8;i++) { - STEP(c_CNS[(2*i)],c_CNS[(2*i)+1]); - } - -#pragma unroll 8 - for(i=0;i<8;i++) { - state->chainv[i] = chainv[i]; - chainv[i] = state->chainv[i+8]; - } - - TWEAK(chainv[4],chainv[5],chainv[6],chainv[7],1); - -#pragma unroll 8 - for(i=0;i<8;i++) { - STEP(c_CNS[(2*i)+16],c_CNS[(2*i)+16+1]); - } - -#pragma unroll 8 - for(i=0;i<8;i++) { - state->chainv[i+8] = chainv[i]; - chainv[i] = state->chainv[i+16]; - } - - TWEAK(chainv[4],chainv[5],chainv[6],chainv[7],2); - -#pragma unroll 8 - for(i=0;i<8;i++) { - STEP(c_CNS[(2*i)+32],c_CNS[(2*i)+32+1]); - } - -#pragma unroll 8 - for(i=0;i<8;i++) { - state->chainv[i+16] = chainv[i]; - chainv[i] = state->chainv[i+24]; - } - - TWEAK(chainv[4],chainv[5],chainv[6],chainv[7],3); - -#pragma unroll 8 - for(i=0;i<8;i++) { - STEP(c_CNS[(2*i)+48],c_CNS[(2*i)+48+1]); - } - -#pragma unroll 8 - for(i=0;i<8;i++) { - state->chainv[i+24] = chainv[i]; - chainv[i] = state->chainv[i+32]; - } - - TWEAK(chainv[4],chainv[5],chainv[6],chainv[7],4); - -#pragma unroll 8 - for(i=0;i<8;i++) { - STEP(c_CNS[(2*i)+64],c_CNS[(2*i)+64+1]); - } - -#pragma unroll 8 - for(i=0;i<8;i++) { - state->chainv[i+32] = chainv[i]; - } -} - - -__device__ __forceinline__ -void Update512(hashState *state, const BitSequence *data) -{ -#pragma unroll 8 - for(int i=0;i<8;i++) state->buffer[i] = cuda_swab32(((uint32_t*)data)[i]); - rnd512(state); - -#pragma unroll 8 - for(int i=0;i<8;i++) state->buffer[i] = cuda_swab32(((uint32_t*)(data+32))[i]); - rnd512(state); -} - - -/***************************************************/ -__device__ __forceinline__ -void finalization512(hashState *state, uint32_t *b) -{ - int i,j; - - state->buffer[0] = 0x80000000; -#pragma unroll 7 - for(int i=1;i<8;i++) state->buffer[i] = 0; - rnd512(state); - - /*---- blank round with m=0 ----*/ -#pragma unroll 8 - for(i=0;i<8;i++) state->buffer[i] =0; - rnd512(state); - -#pragma unroll 8 - for(i=0;i<8;i++) { - b[i] = 0; -#pragma unroll 5 - for(j=0;j<5;j++) { - b[i] ^= state->chainv[i+8*j]; - } - b[i] = cuda_swab32((b[i])); - } - -#pragma unroll 8 - for(i=0;i<8;i++) state->buffer[i]=0; - rnd512(state); - -#pragma unroll 8 - for(i=0;i<8;i++) { - b[8+i] = 0; -#pragma unroll 5 - for(j=0;j<5;j++) { - b[8+i] ^= state->chainv[i+8*j]; - } - b[8 + i] = cuda_swab32((b[8 + i])); - } -} - - -/***************************************************/ -// Die Hash-Funktion -__global__ void x11_luffa512_gpu_hash_64(uint32_t threads, uint32_t startNounce, uint64_t *g_hash, uint32_t *g_nonceVector) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t nounce = (g_nonceVector != NULL) ? g_nonceVector[thread] : (startNounce + thread); - - int hashPosition = nounce - startNounce; - uint32_t *Hash = (uint32_t*)&g_hash[8 * hashPosition]; - - hashState state; -#pragma unroll 40 - for(int i=0;i<40;i++) state.chainv[i] = c_IV[i]; -#pragma unroll 8 - for(int i=0;i<8;i++) state.buffer[i] = 0; - Update512(&state, (BitSequence*)Hash); - finalization512(&state, (uint32_t*)Hash); - } -} - - -// Setup Function -__host__ -void x11_luffa512_cpu_init(int thr_id, uint32_t threads) -{ - CUDA_CALL_OR_RET(cudaMemcpyToSymbol(c_IV, h_IV, sizeof(h_IV), 0, cudaMemcpyHostToDevice)); - CUDA_CALL_OR_RET(cudaMemcpyToSymbol(c_CNS, h_CNS, sizeof(h_CNS), 0, cudaMemcpyHostToDevice)); -} - -__host__ void x11_luffa512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order) -{ - const uint32_t threadsperblock = 256; - - // berechne wie viele Thread Blocks wir brauchen - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - // Größe des dynamischen Shared Memory Bereichs - size_t shared_size = 0; - - x11_luffa512_gpu_hash_64<<>>(threads, startNounce, (uint64_t*)d_hash, d_nonceVector); - //MyStreamSynchronize(NULL, order, thr_id); -} - diff --git a/x11/cuda_x11_luffa512_Cubehash.cu b/x11/cuda_x11_luffa512_Cubehash.cu deleted file mode 100644 index cab00624..00000000 --- a/x11/cuda_x11_luffa512_Cubehash.cu +++ /dev/null @@ -1,833 +0,0 @@ -/* - * Merged LUFFA512 64 + CUBE512 64 - from sp - */ - -#include "cuda_helper.h" - -#define MULT0(a) {\ - tmp = a[7]; \ - a[7] = a[6]; \ - a[6] = a[5]; \ - a[5] = a[4]; \ - a[4] = a[3] ^ tmp; \ - a[3] = a[2] ^ tmp; \ - a[2] = a[1]; \ - a[1] = a[0] ^ tmp; \ - a[0] = tmp; \ -} - -#define MULT2(a,j) { \ - tmp = a[(j<<3)+7]; \ - a[(j*8)+7] = a[(j*8)+6]; \ - a[(j*8)+6] = a[(j*8)+5]; \ - a[(j*8)+5] = a[(j*8)+4]; \ - a[(j*8)+4] = a[(j*8)+3] ^ tmp; \ - a[(j*8)+3] = a[(j*8)+2] ^ tmp; \ - a[(j*8)+2] = a[(j*8)+1]; \ - a[(j*8)+1] = a[(j*8)+0] ^ tmp; \ - a[j*8] = tmp; \ -} - -#define TWEAK(a0,a1,a2,a3,j) { \ - a0 = ROTL32(a0,j); \ - a1 = ROTL32(a1,j); \ - a2 = ROTL32(a2,j); \ - a3 = ROTL32(a3,j); \ -} - -#define STEP(c0,c1) { \ - SUBCRUMB(chainv[0],chainv[1],chainv[2],chainv[3],tmp); \ - SUBCRUMB(chainv[5],chainv[6],chainv[7],chainv[4],tmp); \ - MIXWORD(chainv[0],chainv[4]); \ - MIXWORD(chainv[1],chainv[5]); \ - MIXWORD(chainv[2],chainv[6]); \ - MIXWORD(chainv[3],chainv[7]); \ - ADD_CONSTANT(chainv[0],chainv[4],c0,c1); \ -} - -#define SUBCRUMB(a0,a1,a2,a3,a4) { \ - a4 = a0; \ - a0 |= a1; \ - a2 ^= a3; \ - a1 = ~a1;\ - a0 ^= a3; \ - a3 &= a4; \ - a1 ^= a3; \ - a3 ^= a2; \ - a2 &= a0; \ - a0 = ~a0;\ - a2 ^= a1; \ - a1 |= a3; \ - a4 ^= a1; \ - a3 ^= a2; \ - a2 &= a1; \ - a1 ^= a0; \ - a0 = a4; \ -} - -#define MIXWORD(a0,a4) { \ - a4 ^= a0; \ - a0 = ROTL32(a0,2); \ - a0 ^= a4; \ - a4 = ROTL32(a4,14); \ - a4 ^= a0; \ - a0 = ROTL32(a0,10); \ - a0 ^= a4; \ - a4 = ROTL32(a4,1); \ -} - -#define ADD_CONSTANT(a0,b0,c0,c1) { \ - a0 ^= c0; \ - b0 ^= c1; \ -} - -__device__ __constant__ uint32_t c_CNS[80] = { - 0x303994a6,0xe0337818,0xc0e65299,0x441ba90d, - 0x6cc33a12,0x7f34d442,0xdc56983e,0x9389217f, - 0x1e00108f,0xe5a8bce6,0x7800423d,0x5274baf4, - 0x8f5b7882,0x26889ba7,0x96e1db12,0x9a226e9d, - 0xb6de10ed,0x01685f3d,0x70f47aae,0x05a17cf4, - 0x0707a3d4,0xbd09caca,0x1c1e8f51,0xf4272b28, - 0x707a3d45,0x144ae5cc,0xaeb28562,0xfaa7ae2b, - 0xbaca1589,0x2e48f1c1,0x40a46f3e,0xb923c704, - 0xfc20d9d2,0xe25e72c1,0x34552e25,0xe623bb72, - 0x7ad8818f,0x5c58a4a4,0x8438764a,0x1e38e2e7, - 0xbb6de032,0x78e38b9d,0xedb780c8,0x27586719, - 0xd9847356,0x36eda57f,0xa2c78434,0x703aace7, - 0xb213afa5,0xe028c9bf,0xc84ebe95,0x44756f91, - 0x4e608a22,0x7e8fce32,0x56d858fe,0x956548be, - 0x343b138f,0xfe191be2,0xd0ec4e3d,0x3cb226e5, - 0x2ceb4882,0x5944a28e,0xb3ad2208,0xa1c4c355, - 0xf0d2e9e3,0x5090d577,0xac11d7fa,0x2d1925ab, - 0x1bcb66f2,0xb46496ac,0x6f2d9bc9,0xd1925ab0, - 0x78602649,0x29131ab6,0x8edae952,0x0fc053c3, - 0x3b6ba548,0x3f014f0c,0xedae9520,0xfc053c31 -}; - -// Precalculated chaining values -__device__ __constant__ uint32_t c_IV[40] = { - 0x8bb0a761, 0xc2e4aa8b, 0x2d539bc9, 0x381408f8, - 0x478f6633, 0x255a46ff, 0x581c37f7, 0x601c2e8e, - 0x266c5f9d, 0xc34715d8, 0x8900670e, 0x51a540be, - 0xe4ce69fb, 0x5089f4d4, 0x3cc0a506, 0x609bcb02, - 0xa4e3cd82, 0xd24fd6ca, 0xc0f196dc, 0xcf41eafe, - 0x0ff2e673, 0x303804f2, 0xa7b3cd48, 0x677addd4, - 0x66e66a8a, 0x2303208f, 0x486dafb4, 0xc0d37dc6, - 0x634d15af, 0xe5af6747, 0x10af7e38, 0xee7e6428, - 0x01262e5d, 0xc92c2e64, 0x82fee966, 0xcea738d3, - 0x867de2b0, 0xe0714818, 0xda6e831f, 0xa7062529 -}; - -/***************************************************/ -__device__ __forceinline__ -static void rnd512(uint32_t *statebuffer, uint32_t *statechainv) -{ - uint32_t t[40]; - uint32_t chainv[8]; - uint32_t tmp; - int i,j; - - #pragma unroll - for(i=0;i<8;i++) { - t[i] = 0; - #pragma unroll 5 - for(j=0;j<5;j++) - t[i] ^= statechainv[i+8*j]; - } - - MULT0(t); - - #pragma unroll - for(j=0;j<5;j++) { - #pragma unroll - for(i=0;i<8;i++) - statechainv[i+8*j] ^= t[i]; - } - - #pragma unroll - for(j=0;j<5;j++) { - #pragma unroll - for(i=0;i<8;i++) - t[i+8*j] = statechainv[i+8*j]; - } - - MULT0(statechainv); - #pragma unroll 4 - for(j=1;j<5;j++) { - MULT2(statechainv, j); - } - - #pragma unroll - for(j=0;j<5;j++) { - #pragma unroll - for(i=0;i<8;i++) - statechainv[8*j+i] ^= t[8*((j+1)%5)+i]; - } - - #pragma unroll - for(j=0;j<5;j++) { - #pragma unroll - for(i=0;i<8;i++) - t[i+8*j] = statechainv[i+8*j]; - } - - MULT0(statechainv); - #pragma unroll 4 - for(j=1;j<5;j++) { - MULT2(statechainv, j); - } - - #pragma unroll - for(j=0;j<5;j++) { - #pragma unroll - for(i=0;i<8;i++) - statechainv[8*j+i] ^= t[8*((j+4)%5)+i]; - } - - #pragma unroll - for(j=0;j<5;j++) { - #pragma unroll 8 - for(i=0;i<8;i++) - statechainv[i+8*j] ^= statebuffer[i]; - MULT0(statebuffer); - } - - #pragma unroll - for(i=0;i<8;i++) { - chainv[i] = statechainv[i]; - } - - #pragma unroll 1 - for(i=0;i<8;i++) { - STEP(c_CNS[(2*i)],c_CNS[(2*i)+1]); - } - - #pragma unroll - for(i=0;i<8;i++) { - statechainv[i] = chainv[i]; - chainv[i] = statechainv[i+8]; - } - - TWEAK(chainv[4],chainv[5],chainv[6],chainv[7],1); - - #pragma unroll 1 - for(i=0;i<8;i++) { - STEP(c_CNS[(2*i)+16],c_CNS[(2*i)+16+1]); - } - - #pragma unroll - for(i=0;i<8;i++) { - statechainv[i+8] = chainv[i]; - chainv[i] = statechainv[i+16]; - } - - TWEAK(chainv[4],chainv[5],chainv[6],chainv[7],2); - - #pragma unroll 1 - for(i=0;i<8;i++) { - STEP(c_CNS[(2*i)+32],c_CNS[(2*i)+32+1]); - } - - #pragma unroll - for(i=0;i<8;i++) { - statechainv[i+16] = chainv[i]; - chainv[i] = statechainv[i+24]; - } - - TWEAK(chainv[4],chainv[5],chainv[6],chainv[7],3); - - #pragma unroll 1 - for(i=0;i<8;i++) { - STEP(c_CNS[(2*i)+48],c_CNS[(2*i)+48+1]); - } - - #pragma unroll - for(i=0;i<8;i++) { - statechainv[i+24] = chainv[i]; - chainv[i] = statechainv[i+32]; - } - - TWEAK(chainv[4],chainv[5],chainv[6],chainv[7],4); - - #pragma unroll 1 - for(i=0;i<8;i++) { - STEP(c_CNS[(2*i)+64],c_CNS[(2*i)+64+1]); - } - - #pragma unroll - for(i=0;i<8;i++) { - statechainv[i+32] = chainv[i]; - } -} - -__device__ __forceinline__ -static void rnd512_first(uint32_t state[40], uint32_t buffer[8]) -{ - uint32_t chainv[8]; - uint32_t tmp; - int i, j; - - for (j = 0; j<5; j++) { - state[8 * j] ^= buffer[0]; - - #pragma unroll 7 - for (i = 1; i<8; i++) - state[i + 8 * j] ^= buffer[i]; - MULT0(buffer); - } - - #pragma unroll - for (i = 0; i<8; i++) - chainv[i] = state[i]; - - #pragma unroll 1 - for (i = 0; i<8; i++) { - STEP(c_CNS[(2 * i)], c_CNS[(2 * i) + 1]); - } - - #pragma unroll - for (i = 0; i<8; i++) { - state[i] = chainv[i]; - chainv[i] = state[i + 8]; - } - - TWEAK(chainv[4], chainv[5], chainv[6], chainv[7], 1); - - #pragma unroll 1 - for (i = 0; i<8; i++) { - STEP(c_CNS[(2 * i) + 16], c_CNS[(2 * i) + 16 + 1]); - } - - #pragma unroll - for (i = 0; i<8; i++) { - state[i + 8] = chainv[i]; - chainv[i] = state[i + 16]; - } - - TWEAK(chainv[4], chainv[5], chainv[6], chainv[7], 2); - - #pragma unroll 1 - for (i = 0; i<8; i++) { - STEP(c_CNS[(2 * i) + 32], c_CNS[(2 * i) + 32 + 1]); - } - - #pragma unroll - for (i = 0; i<8; i++) { - state[i + 16] = chainv[i]; - chainv[i] = state[i + 24]; - } - - TWEAK(chainv[4], chainv[5], chainv[6], chainv[7], 3); - - #pragma unroll 1 - for (i = 0; i<8; i++) { - STEP(c_CNS[(2 * i) + 48], c_CNS[(2 * i) + 48 + 1]); - } - - #pragma unroll - for (i = 0; i<8; i++) { - state[i + 24] = chainv[i]; - chainv[i] = state[i + 32]; - } - - TWEAK(chainv[4], chainv[5], chainv[6], chainv[7], 4); - - #pragma unroll 1 - for (i = 0; i<8; i++) { - STEP(c_CNS[(2 * i) + 64], c_CNS[(2 * i) + 64 + 1]); - } - - #pragma unroll - for (i = 0; i<8; i++) - state[i + 32] = chainv[i]; -} - -/***************************************************/ -__device__ __forceinline__ -static void rnd512_nullhash(uint32_t *state) -{ - uint32_t t[40]; - uint32_t chainv[8]; - uint32_t tmp; - int i, j; - - #pragma unroll - for (i = 0; i<8; i++) { - t[i] = state[i + 8 * 0]; - #pragma unroll 4 - for (j = 1; j<5; j++) - t[i] ^= state[i + 8 * j]; - } - - MULT0(t); - - #pragma unroll - for (j = 0; j<5; j++) { - #pragma unroll - for (i = 0; i<8; i++) - state[i + 8 * j] ^= t[i]; - } - - #pragma unroll - for (j = 0; j<5; j++) { - #pragma unroll - for (i = 0; i<8; i++) - t[i + 8 * j] = state[i + 8 * j]; - } - - MULT0(state); - #pragma unroll 4 - for(j=1; j<5; j++) { - MULT2(state, j); - } - - #pragma unroll - for (j = 0; j<5; j++) { - #pragma unroll - for (i = 0; i<8; i++) - state[8 * j + i] ^= t[8 * ((j + 1) % 5) + i]; - } - - #pragma unroll - for (j = 0; j<5; j++) { - #pragma unroll 8 - for (i = 0; i<8; i++) - t[i + 8 * j] = state[i + 8 * j]; - } - - MULT0(state); - #pragma unroll 4 - for(j=1; j<5; j++) { - MULT2(state, j); - } - - #pragma unroll - for (j = 0; j<5; j++) { - #pragma unroll - for (i = 0; i<8; i++) - state[8 * j + i] ^= t[8 * ((j + 4) % 5) + i]; - } - - #pragma unroll - for (i = 0; i<8; i++) - chainv[i] = state[i]; - - #pragma unroll 1 - for (i = 0; i<8; i++) { - STEP(c_CNS[(2 * i)], c_CNS[(2 * i) + 1]); - } - - #pragma unroll - for (i = 0; i<8; i++) { - state[i] = chainv[i]; - chainv[i] = state[i + 8]; - } - - TWEAK(chainv[4], chainv[5], chainv[6], chainv[7], 1); - - #pragma unroll 1 - for (i = 0; i<8; i++) { - STEP(c_CNS[(2 * i) + 16], c_CNS[(2 * i) + 16 + 1]); - } - - #pragma unroll - for (i = 0; i<8; i++) { - state[i + 8] = chainv[i]; - chainv[i] = state[i + 16]; - } - - TWEAK(chainv[4], chainv[5], chainv[6], chainv[7], 2); - - #pragma unroll 1 - for (i = 0; i<8; i++) { - STEP(c_CNS[(2 * i) + 32], c_CNS[(2 * i) + 32 + 1]); - } - - #pragma unroll - for (i = 0; i<8; i++) { - state[i + 16] = chainv[i]; - chainv[i] = state[i + 24]; - } - - TWEAK(chainv[4], chainv[5], chainv[6], chainv[7], 3); - - #pragma unroll 1 - for (i = 0; i<8; i++) { - STEP(c_CNS[(2 * i) + 48], c_CNS[(2 * i) + 48 + 1]); - } - - #pragma unroll - for (i = 0; i<8; i++) { - state[i + 24] = chainv[i]; - chainv[i] = state[i + 32]; - } - - TWEAK(chainv[4], chainv[5], chainv[6], chainv[7], 4); - - #pragma unroll 1 - for (i = 0; i<8; i++) { - STEP(c_CNS[(2 * i) + 64], c_CNS[(2 * i) + 64 + 1]); - } - - #pragma unroll - for (i = 0; i<8; i++) { - state[i + 32] = chainv[i]; - } -} - -__device__ __forceinline__ -static void Update512(uint32_t *statebuffer, uint32_t *statechainv, const uint32_t *data) -{ - #pragma unroll - for (int i = 0; i < 8; i++) statebuffer[i] = cuda_swab32(data[i]); - rnd512_first(statechainv, statebuffer); - - #pragma unroll - for (int i = 0; i < 8; i++) statebuffer[i] = cuda_swab32(data[i + 8]); - rnd512(statebuffer, statechainv); -} - -/***************************************************/ -__device__ __forceinline__ -static void finalization512(uint32_t *statebuffer, uint32_t *statechainv, uint32_t *b) -{ - int i,j; - - statebuffer[0] = 0x80000000; - #pragma unroll 7 - for(int i=1;i<8;i++) statebuffer[i] = 0; - rnd512(statebuffer, statechainv); - - /*---- blank round with m=0 ----*/ - rnd512_nullhash(statechainv); - - #pragma unroll - for(i=0;i<8;i++) { - b[i] = statechainv[i]; - #pragma unroll 4 - for(j=1;j<5;j++) { - b[i] ^= statechainv[i+8*j]; - } - b[i] = cuda_swab32((b[i])); - } - - rnd512_nullhash(statechainv); - - #pragma unroll - for(i=0;i<8;i++) { - b[8 + i] = statechainv[i]; - #pragma unroll 4 - for(j=1;j<5;j++) { - b[8+i] ^= statechainv[i+8*j]; - } - b[8 + i] = cuda_swab32((b[8 + i])); - } -} - -#define ROUND_EVEN { \ - xg = (x0 + xg); \ - x0 = ROTL32(x0, 7); \ - xh = (x1 + xh); \ - x1 = ROTL32(x1, 7); \ - xi = (x2 + xi); \ - x2 = ROTL32(x2, 7); \ - xj = (x3 + xj); \ - x3 = ROTL32(x3, 7); \ - xk = (x4 + xk); \ - x4 = ROTL32(x4, 7); \ - xl = (x5 + xl); \ - x5 = ROTL32(x5, 7); \ - xm = (x6 + xm); \ - x6 = ROTL32(x6, 7); \ - xn = (x7 + xn); \ - x7 = ROTL32(x7, 7); \ - xo = (x8 + xo); \ - x8 = ROTL32(x8, 7); \ - xp = (x9 + xp); \ - x9 = ROTL32(x9, 7); \ - xq = (xa + xq); \ - xa = ROTL32(xa, 7); \ - xr = (xb + xr); \ - xb = ROTL32(xb, 7); \ - xs = (xc + xs); \ - xc = ROTL32(xc, 7); \ - xt = (xd + xt); \ - xd = ROTL32(xd, 7); \ - xu = (xe + xu); \ - xe = ROTL32(xe, 7); \ - xv = (xf + xv); \ - xf = ROTL32(xf, 7); \ - x8 ^= xg; \ - x9 ^= xh; \ - xa ^= xi; \ - xb ^= xj; \ - xc ^= xk; \ - xd ^= xl; \ - xe ^= xm; \ - xf ^= xn; \ - x0 ^= xo; \ - x1 ^= xp; \ - x2 ^= xq; \ - x3 ^= xr; \ - x4 ^= xs; \ - x5 ^= xt; \ - x6 ^= xu; \ - x7 ^= xv; \ - xi = (x8 + xi); \ - x8 = ROTL32(x8, 11); \ - xj = (x9 + xj); \ - x9 = ROTL32(x9, 11); \ - xg = (xa + xg); \ - xa = ROTL32(xa, 11); \ - xh = (xb + xh); \ - xb = ROTL32(xb, 11); \ - xm = (xc + xm); \ - xc = ROTL32(xc, 11); \ - xn = (xd + xn); \ - xd = ROTL32(xd, 11); \ - xk = (xe + xk); \ - xe = ROTL32(xe, 11); \ - xl = (xf + xl); \ - xf = ROTL32(xf, 11); \ - xq = (x0 + xq); \ - x0 = ROTL32(x0, 11); \ - xr = (x1 + xr); \ - x1 = ROTL32(x1, 11); \ - xo = (x2 + xo); \ - x2 = ROTL32(x2, 11); \ - xp = (x3 + xp); \ - x3 = ROTL32(x3, 11); \ - xu = (x4 + xu); \ - x4 = ROTL32(x4, 11); \ - xv = (x5 + xv); \ - x5 = ROTL32(x5, 11); \ - xs = (x6 + xs); \ - x6 = ROTL32(x6, 11); \ - xt = (x7 + xt); \ - x7 = ROTL32(x7, 11); \ - xc ^= xi; \ - xd ^= xj; \ - xe ^= xg; \ - xf ^= xh; \ - x8 ^= xm; \ - x9 ^= xn; \ - xa ^= xk; \ - xb ^= xl; \ - x4 ^= xq; \ - x5 ^= xr; \ - x6 ^= xo; \ - x7 ^= xp; \ - x0 ^= xu; \ - x1 ^= xv; \ - x2 ^= xs; \ - x3 ^= xt; \ -} - -#define ROUND_ODD { \ - xj = (xc + xj); \ - xc = ROTL32(xc, 7); \ - xi = (xd + xi); \ - xd = ROTL32(xd, 7); \ - xh = (xe + xh); \ - xe = ROTL32(xe, 7); \ - xg = (xf + xg); \ - xf = ROTL32(xf, 7); \ - xn = (x8 + xn); \ - x8 = ROTL32(x8, 7); \ - xm = (x9 + xm); \ - x9 = ROTL32(x9, 7); \ - xl = (xa + xl); \ - xa = ROTL32(xa, 7); \ - xk = (xb + xk); \ - xb = ROTL32(xb, 7); \ - xr = (x4 + xr); \ - x4 = ROTL32(x4, 7); \ - xq = (x5 + xq); \ - x5 = ROTL32(x5, 7); \ - xp = (x6 + xp); \ - x6 = ROTL32(x6, 7); \ - xo = (x7 + xo); \ - x7 = ROTL32(x7, 7); \ - xv = (x0 + xv); \ - x0 = ROTL32(x0, 7); \ - xu = (x1 + xu); \ - x1 = ROTL32(x1, 7); \ - xt = (x2 + xt); \ - x2 = ROTL32(x2, 7); \ - xs = (x3 + xs); \ - x3 = ROTL32(x3, 7); \ - x4 ^= xj; \ - x5 ^= xi; \ - x6 ^= xh; \ - x7 ^= xg; \ - x0 ^= xn; \ - x1 ^= xm; \ - x2 ^= xl; \ - x3 ^= xk; \ - xc ^= xr; \ - xd ^= xq; \ - xe ^= xp; \ - xf ^= xo; \ - x8 ^= xv; \ - x9 ^= xu; \ - xa ^= xt; \ - xb ^= xs; \ - xh = (x4 + xh); \ - x4 = ROTL32(x4, 11); \ - xg = (x5 + xg); \ - x5 = ROTL32(x5, 11); \ - xj = (x6 + xj); \ - x6 = ROTL32(x6, 11); \ - xi = (x7 + xi); \ - x7 = ROTL32(x7, 11); \ - xl = (x0 + xl); \ - x0 = ROTL32(x0, 11); \ - xk = (x1 + xk); \ - x1 = ROTL32(x1, 11); \ - xn = (x2 + xn); \ - x2 = ROTL32(x2, 11); \ - xm = (x3 + xm); \ - x3 = ROTL32(x3, 11); \ - xp = (xc + xp); \ - xc = ROTL32(xc, 11); \ - xo = (xd + xo); \ - xd = ROTL32(xd, 11); \ - xr = (xe + xr); \ - xe = ROTL32(xe, 11); \ - xq = (xf + xq); \ - xf = ROTL32(xf, 11); \ - xt = (x8 + xt); \ - x8 = ROTL32(x8, 11); \ - xs = (x9 + xs); \ - x9 = ROTL32(x9, 11); \ - xv = (xa + xv); \ - xa = ROTL32(xa, 11); \ - xu = (xb + xu); \ - xb = ROTL32(xb, 11); \ - x0 ^= xh; \ - x1 ^= xg; \ - x2 ^= xj; \ - x3 ^= xi; \ - x4 ^= xl; \ - x5 ^= xk; \ - x6 ^= xn; \ - x7 ^= xm; \ - x8 ^= xp; \ - x9 ^= xo; \ - xa ^= xr; \ - xb ^= xq; \ - xc ^= xt; \ - xd ^= xs; \ - xe ^= xv; \ - xf ^= xu; \ -} - -#define SIXTEEN_ROUNDS \ - for (int j = 0; j < 8; j ++) { \ - ROUND_EVEN; \ - ROUND_ODD; \ - } - -__global__ -#if __CUDA_ARCH__ > 500 -__launch_bounds__(256, 4) -#endif -void x11_luffaCubehash512_gpu_hash_64(uint32_t threads, uint32_t *g_hash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t statechainv[40] = { - 0x8bb0a761, 0xc2e4aa8b, 0x2d539bc9, 0x381408f8, - 0x478f6633, 0x255a46ff, 0x581c37f7, 0x601c2e8e, - 0x266c5f9d, 0xc34715d8, 0x8900670e, 0x51a540be, - 0xe4ce69fb, 0x5089f4d4, 0x3cc0a506, 0x609bcb02, - 0xa4e3cd82, 0xd24fd6ca, 0xc0f196dc, 0xcf41eafe, - 0x0ff2e673, 0x303804f2, 0xa7b3cd48, 0x677addd4, - 0x66e66a8a, 0x2303208f, 0x486dafb4, 0xc0d37dc6, - 0x634d15af, 0xe5af6747, 0x10af7e38, 0xee7e6428, - 0x01262e5d, 0xc92c2e64, 0x82fee966, 0xcea738d3, - 0x867de2b0, 0xe0714818, 0xda6e831f, 0xa7062529 - }; - - uint32_t statebuffer[8]; - uint32_t *const Hash = &g_hash[thread * 16U]; - - Update512(statebuffer, statechainv, Hash); - finalization512(statebuffer, statechainv, Hash); - - //Cubehash - - uint32_t x0 = 0x2AEA2A61, x1 = 0x50F494D4, x2 = 0x2D538B8B, x3 = 0x4167D83E; - uint32_t x4 = 0x3FEE2313, x5 = 0xC701CF8C, x6 = 0xCC39968E, x7 = 0x50AC5695; - uint32_t x8 = 0x4D42C787, x9 = 0xA647A8B3, xa = 0x97CF0BEF, xb = 0x825B4537; - uint32_t xc = 0xEEF864D2, xd = 0xF22090C4, xe = 0xD0E5CD33, xf = 0xA23911AE; - uint32_t xg = 0xFCD398D9, xh = 0x148FE485, xi = 0x1B017BEF, xj = 0xB6444532; - uint32_t xk = 0x6A536159, xl = 0x2FF5781C, xm = 0x91FA7934, xn = 0x0DBADEA9; - uint32_t xo = 0xD65C8A2B, xp = 0xA5A70E75, xq = 0xB1C62456, xr = 0xBC796576; - uint32_t xs = 0x1921C8F7, xt = 0xE7989AF1, xu = 0x7795D246, xv = 0xD43E3B44; - - x0 ^= Hash[0]; - x1 ^= Hash[1]; - x2 ^= Hash[2]; - x3 ^= Hash[3]; - x4 ^= Hash[4]; - x5 ^= Hash[5]; - x6 ^= Hash[6]; - x7 ^= Hash[7]; - - SIXTEEN_ROUNDS; - - x0 ^= Hash[8]; - x1 ^= Hash[9]; - x2 ^= Hash[10]; - x3 ^= Hash[11]; - x4 ^= Hash[12]; - x5 ^= Hash[13]; - x6 ^= Hash[14]; - x7 ^= Hash[15]; - - SIXTEEN_ROUNDS; - x0 ^= 0x80; - - SIXTEEN_ROUNDS; - xv ^= 1; - - for (int i = 3; i < 13; i++) { - SIXTEEN_ROUNDS; - } - - Hash[0] = x0; - Hash[1] = x1; - Hash[2] = x2; - Hash[3] = x3; - Hash[4] = x4; - Hash[5] = x5; - Hash[6] = x6; - Hash[7] = x7; - Hash[8] = x8; - Hash[9] = x9; - Hash[10] = xa; - Hash[11] = xb; - Hash[12] = xc; - Hash[13] = xd; - Hash[14] = xe; - Hash[15] = xf; - } -} - -__host__ -void x11_luffaCubehash512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t *d_hash, int order) -{ - const uint32_t threadsperblock = 256; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - x11_luffaCubehash512_gpu_hash_64 <<>> (threads, d_hash); - MyStreamSynchronize(NULL, order, thr_id); -} - -// Setup -__host__ -void x11_luffaCubehash512_cpu_init(int thr_id, uint32_t threads) {} diff --git a/x11/cuda_x11_shavite512.cu b/x11/cuda_x11_shavite512.cu deleted file mode 100644 index cfebf0d8..00000000 --- a/x11/cuda_x11_shavite512.cu +++ /dev/null @@ -1,1480 +0,0 @@ -#include // memcpy() - -#include "cuda_helper.h" - -extern __device__ __device_builtin__ void __threadfence_block(void); - -#define TPB 128 - -__constant__ uint32_t c_PaddedMessage80[32]; // padded message (80 bytes + padding) - -#include "cuda_x11_aes.cuh" - -__device__ __forceinline__ -static void AES_ROUND_NOKEY( - const uint32_t* __restrict__ sharedMemory, - uint32_t &x0, uint32_t &x1, uint32_t &x2, uint32_t &x3) -{ - uint32_t y0, y1, y2, y3; - aes_round(sharedMemory, - x0, x1, x2, x3, - y0, y1, y2, y3); - - x0 = y0; - x1 = y1; - x2 = y2; - x3 = y3; -} - -__device__ __forceinline__ -static void KEY_EXPAND_ELT( - const uint32_t* __restrict__ sharedMemory, - uint32_t &k0, uint32_t &k1, uint32_t &k2, uint32_t &k3) -{ - uint32_t y0, y1, y2, y3; - aes_round(sharedMemory, - k0, k1, k2, k3, - y0, y1, y2, y3); - - k0 = y1; - k1 = y2; - k2 = y3; - k3 = y0; -} - -__device__ __forceinline__ -static void c512(const uint32_t* sharedMemory, uint32_t *state, uint32_t *msg, const uint32_t count) -{ - uint32_t p0, p1, p2, p3, p4, p5, p6, p7; - uint32_t p8, p9, pA, pB, pC, pD, pE, pF; - uint32_t x0, x1, x2, x3; - uint32_t rk00, rk01, rk02, rk03, rk04, rk05, rk06, rk07; - uint32_t rk08, rk09, rk0A, rk0B, rk0C, rk0D, rk0E, rk0F; - uint32_t rk10, rk11, rk12, rk13, rk14, rk15, rk16, rk17; - uint32_t rk18, rk19, rk1A, rk1B, rk1C, rk1D, rk1E, rk1F; - const uint32_t counter = count; - - p0 = state[0x0]; - p1 = state[0x1]; - p2 = state[0x2]; - p3 = state[0x3]; - p4 = state[0x4]; - p5 = state[0x5]; - p6 = state[0x6]; - p7 = state[0x7]; - p8 = state[0x8]; - p9 = state[0x9]; - pA = state[0xA]; - pB = state[0xB]; - pC = state[0xC]; - pD = state[0xD]; - pE = state[0xE]; - pF = state[0xF]; - - /* round 0 */ - rk00 = msg[0]; - x0 = p4 ^ msg[0]; - rk01 = msg[1]; - x1 = p5 ^ msg[1]; - rk02 = msg[2]; - x2 = p6 ^ msg[2]; - rk03 = msg[3]; - x3 = p7 ^ msg[3]; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk04 = msg[4]; - x0 ^= msg[4]; - rk05 = msg[5]; - x1 ^= msg[5]; - rk06 = msg[6]; - x2 ^= msg[6]; - rk07 = msg[7]; - x3 ^= msg[7]; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk08 = msg[8]; - x0 ^= msg[8]; - rk09 = msg[9]; - x1 ^= msg[9]; - rk0A = msg[10]; - x2 ^= msg[10]; - rk0B = msg[11]; - x3 ^= msg[11]; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk0C = msg[12]; - x0 ^= msg[12]; - rk0D = msg[13]; - x1 ^= msg[13]; - rk0E = msg[14]; - x2 ^= msg[14]; - rk0F = msg[15]; - x3 ^= msg[15]; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - if (count == 512) - { - rk10 = 0x80U; - x0 = pC ^ 0x80U; - rk11 = 0; - x1 = pD; - rk12 = 0; - x2 = pE; - rk13 = 0; - x3 = pF; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk14 = 0; - rk15 = 0; - rk16 = 0; - rk17 = 0; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk18 = 0; - rk19 = 0; - rk1A = 0; - rk1B = 0x02000000U; - x3 ^= 0x02000000U; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk1C = 0; - rk1D = 0; - rk1E = 0; - rk1F = 0x02000000; - x3 ^= 0x02000000; - } - else - { - rk10 = msg[16]; - x0 = pC ^ msg[16]; - rk11 = msg[17]; - x1 = pD ^ msg[17]; - rk12 = msg[18]; - x2 = pE ^ msg[18]; - rk13 = msg[19]; - x3 = pF ^ msg[19]; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk14 = msg[20]; - x0 ^= msg[20]; - rk15 = msg[21]; - x1 ^= msg[21]; - rk16 = msg[22]; - x2 ^= msg[22]; - rk17 = msg[23]; - x3 ^= msg[23]; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk18 = msg[24]; - x0 ^= msg[24]; - rk19 = msg[25]; - x1 ^= msg[25]; - rk1A = msg[26]; - x2 ^= msg[26]; - rk1B = msg[27]; - x3 ^= msg[27]; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk1C = msg[28]; - x0 ^= msg[28]; - rk1D = msg[29]; - x1 ^= msg[29]; - rk1E = msg[30]; - x2 ^= msg[30]; - rk1F = msg[31]; - x3 ^= msg[31]; - } - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - p8 ^= x0; - p9 ^= x1; - pA ^= x2; - pB ^= x3; - - // 1 - KEY_EXPAND_ELT(sharedMemory, rk00, rk01, rk02, rk03); - rk00 ^= rk1C; - rk01 ^= rk1D; - rk02 ^= rk1E; - rk03 ^= rk1F; - rk00 ^= counter; - rk03 ^= 0xFFFFFFFF; - x0 = p0 ^ rk00; - x1 = p1 ^ rk01; - x2 = p2 ^ rk02; - x3 = p3 ^ rk03; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk04, rk05, rk06, rk07); - rk04 ^= rk00; - rk05 ^= rk01; - rk06 ^= rk02; - rk07 ^= rk03; - x0 ^= rk04; - x1 ^= rk05; - x2 ^= rk06; - x3 ^= rk07; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk08, rk09, rk0A, rk0B); - rk08 ^= rk04; - rk09 ^= rk05; - rk0A ^= rk06; - rk0B ^= rk07; - x0 ^= rk08; - x1 ^= rk09; - x2 ^= rk0A; - x3 ^= rk0B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk0C, rk0D, rk0E, rk0F); - rk0C ^= rk08; - rk0D ^= rk09; - rk0E ^= rk0A; - rk0F ^= rk0B; - x0 ^= rk0C; - x1 ^= rk0D; - x2 ^= rk0E; - x3 ^= rk0F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - pC ^= x0; - pD ^= x1; - pE ^= x2; - pF ^= x3; - KEY_EXPAND_ELT(sharedMemory, rk10, rk11, rk12, rk13); - rk10 ^= rk0C; - rk11 ^= rk0D; - rk12 ^= rk0E; - rk13 ^= rk0F; - x0 = p8 ^ rk10; - x1 = p9 ^ rk11; - x2 = pA ^ rk12; - x3 = pB ^ rk13; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk14, rk15, rk16, rk17); - rk14 ^= rk10; - rk15 ^= rk11; - rk16 ^= rk12; - rk17 ^= rk13; - x0 ^= rk14; - x1 ^= rk15; - x2 ^= rk16; - x3 ^= rk17; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk18, rk19, rk1A, rk1B); - rk18 ^= rk14; - rk19 ^= rk15; - rk1A ^= rk16; - rk1B ^= rk17; - x0 ^= rk18; - x1 ^= rk19; - x2 ^= rk1A; - x3 ^= rk1B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk1C, rk1D, rk1E, rk1F); - rk1C ^= rk18; - rk1D ^= rk19; - rk1E ^= rk1A; - rk1F ^= rk1B; - x0 ^= rk1C; - x1 ^= rk1D; - x2 ^= rk1E; - x3 ^= rk1F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - - rk00 ^= rk19; - x0 = pC ^ rk00; - rk01 ^= rk1A; - x1 = pD ^ rk01; - rk02 ^= rk1B; - x2 = pE ^ rk02; - rk03 ^= rk1C; - x3 = pF ^ rk03; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk04 ^= rk1D; - x0 ^= rk04; - rk05 ^= rk1E; - x1 ^= rk05; - rk06 ^= rk1F; - x2 ^= rk06; - rk07 ^= rk00; - x3 ^= rk07; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk08 ^= rk01; - x0 ^= rk08; - rk09 ^= rk02; - x1 ^= rk09; - rk0A ^= rk03; - x2 ^= rk0A; - rk0B ^= rk04; - x3 ^= rk0B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk0C ^= rk05; - x0 ^= rk0C; - rk0D ^= rk06; - x1 ^= rk0D; - rk0E ^= rk07; - x2 ^= rk0E; - rk0F ^= rk08; - x3 ^= rk0F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - p8 ^= x0; - p9 ^= x1; - pA ^= x2; - pB ^= x3; - rk10 ^= rk09; - x0 = p4 ^ rk10; - rk11 ^= rk0A; - x1 = p5 ^ rk11; - rk12 ^= rk0B; - x2 = p6 ^ rk12; - rk13 ^= rk0C; - x3 = p7 ^ rk13; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk14 ^= rk0D; - x0 ^= rk14; - rk15 ^= rk0E; - x1 ^= rk15; - rk16 ^= rk0F; - x2 ^= rk16; - rk17 ^= rk10; - x3 ^= rk17; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk18 ^= rk11; - x0 ^= rk18; - rk19 ^= rk12; - x1 ^= rk19; - rk1A ^= rk13; - x2 ^= rk1A; - rk1B ^= rk14; - x3 ^= rk1B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk1C ^= rk15; - x0 ^= rk1C; - rk1D ^= rk16; - x1 ^= rk1D; - rk1E ^= rk17; - x2 ^= rk1E; - rk1F ^= rk18; - x3 ^= rk1F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - - /* round 3, 7, 11 */ - KEY_EXPAND_ELT(sharedMemory, rk00, rk01, rk02, rk03); - rk00 ^= rk1C; - rk01 ^= rk1D; - rk02 ^= rk1E; - rk03 ^= rk1F; - x0 = p8 ^ rk00; - x1 = p9 ^ rk01; - x2 = pA ^ rk02; - x3 = pB ^ rk03; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk04, rk05, rk06, rk07); - rk04 ^= rk00; - rk05 ^= rk01; - rk06 ^= rk02; - rk07 ^= rk03; - x0 ^= rk04; - x1 ^= rk05; - x2 ^= rk06; - x3 ^= rk07; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk08, rk09, rk0A, rk0B); - rk08 ^= rk04; - rk09 ^= rk05; - rk0A ^= rk06; - rk0B ^= rk07; - x0 ^= rk08; - x1 ^= rk09; - x2 ^= rk0A; - x3 ^= rk0B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk0C, rk0D, rk0E, rk0F); - rk0C ^= rk08; - rk0D ^= rk09; - rk0E ^= rk0A; - rk0F ^= rk0B; - x0 ^= rk0C; - x1 ^= rk0D; - x2 ^= rk0E; - x3 ^= rk0F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - KEY_EXPAND_ELT(sharedMemory, rk10, rk11, rk12, rk13); - rk10 ^= rk0C; - rk11 ^= rk0D; - rk12 ^= rk0E; - rk13 ^= rk0F; - x0 = p0 ^ rk10; - x1 = p1 ^ rk11; - x2 = p2 ^ rk12; - x3 = p3 ^ rk13; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk14, rk15, rk16, rk17); - rk14 ^= rk10; - rk15 ^= rk11; - rk16 ^= rk12; - rk17 ^= rk13; - x0 ^= rk14; - x1 ^= rk15; - x2 ^= rk16; - x3 ^= rk17; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk18, rk19, rk1A, rk1B); - rk18 ^= rk14; - rk19 ^= rk15; - rk1A ^= rk16; - rk1B ^= rk17; - x0 ^= rk18; - x1 ^= rk19; - x2 ^= rk1A; - x3 ^= rk1B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk1C, rk1D, rk1E, rk1F); - rk1C ^= rk18; - rk1D ^= rk19; - rk1E ^= rk1A; - rk1F ^= rk1B; - x0 ^= rk1C; - x1 ^= rk1D; - x2 ^= rk1E; - x3 ^= rk1F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - pC ^= x0; - pD ^= x1; - pE ^= x2; - pF ^= x3; - - /* round 4, 8, 12 */ - rk00 ^= rk19; - x0 = p4 ^ rk00; - rk01 ^= rk1A; - x1 = p5 ^ rk01; - rk02 ^= rk1B; - x2 = p6 ^ rk02; - rk03 ^= rk1C; - x3 = p7 ^ rk03; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk04 ^= rk1D; - x0 ^= rk04; - rk05 ^= rk1E; - x1 ^= rk05; - rk06 ^= rk1F; - x2 ^= rk06; - rk07 ^= rk00; - x3 ^= rk07; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk08 ^= rk01; - x0 ^= rk08; - rk09 ^= rk02; - x1 ^= rk09; - rk0A ^= rk03; - x2 ^= rk0A; - rk0B ^= rk04; - x3 ^= rk0B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk0C ^= rk05; - x0 ^= rk0C; - rk0D ^= rk06; - x1 ^= rk0D; - rk0E ^= rk07; - x2 ^= rk0E; - rk0F ^= rk08; - x3 ^= rk0F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - rk10 ^= rk09; - x0 = pC ^ rk10; - rk11 ^= rk0A; - x1 = pD ^ rk11; - rk12 ^= rk0B; - x2 = pE ^ rk12; - rk13 ^= rk0C; - x3 = pF ^ rk13; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk14 ^= rk0D; - x0 ^= rk14; - rk15 ^= rk0E; - x1 ^= rk15; - rk16 ^= rk0F; - x2 ^= rk16; - rk17 ^= rk10; - x3 ^= rk17; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk18 ^= rk11; - x0 ^= rk18; - rk19 ^= rk12; - x1 ^= rk19; - rk1A ^= rk13; - x2 ^= rk1A; - rk1B ^= rk14; - x3 ^= rk1B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk1C ^= rk15; - x0 ^= rk1C; - rk1D ^= rk16; - x1 ^= rk1D; - rk1E ^= rk17; - x2 ^= rk1E; - rk1F ^= rk18; - x3 ^= rk1F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - p8 ^= x0; - p9 ^= x1; - pA ^= x2; - pB ^= x3; - - // 2 - KEY_EXPAND_ELT(sharedMemory, rk00, rk01, rk02, rk03); - rk00 ^= rk1C; - rk01 ^= rk1D; - rk02 ^= rk1E; - rk03 ^= rk1F; - x0 = p0 ^ rk00; - x1 = p1 ^ rk01; - x2 = p2 ^ rk02; - x3 = p3 ^ rk03; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk04, rk05, rk06, rk07); - rk04 ^= rk00; - rk05 ^= rk01; - rk06 ^= rk02; - rk07 ^= rk03; - rk07 ^= SPH_T32(~counter); - x0 ^= rk04; - x1 ^= rk05; - x2 ^= rk06; - x3 ^= rk07; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk08, rk09, rk0A, rk0B); - rk08 ^= rk04; - rk09 ^= rk05; - rk0A ^= rk06; - rk0B ^= rk07; - x0 ^= rk08; - x1 ^= rk09; - x2 ^= rk0A; - x3 ^= rk0B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk0C, rk0D, rk0E, rk0F); - rk0C ^= rk08; - rk0D ^= rk09; - rk0E ^= rk0A; - rk0F ^= rk0B; - x0 ^= rk0C; - x1 ^= rk0D; - x2 ^= rk0E; - x3 ^= rk0F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - pC ^= x0; - pD ^= x1; - pE ^= x2; - pF ^= x3; - KEY_EXPAND_ELT(sharedMemory, rk10, rk11, rk12, rk13); - rk10 ^= rk0C; - rk11 ^= rk0D; - rk12 ^= rk0E; - rk13 ^= rk0F; - x0 = p8 ^ rk10; - x1 = p9 ^ rk11; - x2 = pA ^ rk12; - x3 = pB ^ rk13; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk14, rk15, rk16, rk17); - rk14 ^= rk10; - rk15 ^= rk11; - rk16 ^= rk12; - rk17 ^= rk13; - x0 ^= rk14; - x1 ^= rk15; - x2 ^= rk16; - x3 ^= rk17; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk18, rk19, rk1A, rk1B); - rk18 ^= rk14; - rk19 ^= rk15; - rk1A ^= rk16; - rk1B ^= rk17; - x0 ^= rk18; - x1 ^= rk19; - x2 ^= rk1A; - x3 ^= rk1B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk1C, rk1D, rk1E, rk1F); - rk1C ^= rk18; - rk1D ^= rk19; - rk1E ^= rk1A; - rk1F ^= rk1B; - x0 ^= rk1C; - x1 ^= rk1D; - x2 ^= rk1E; - x3 ^= rk1F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - - rk00 ^= rk19; - x0 = pC ^ rk00; - rk01 ^= rk1A; - x1 = pD ^ rk01; - rk02 ^= rk1B; - x2 = pE ^ rk02; - rk03 ^= rk1C; - x3 = pF ^ rk03; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk04 ^= rk1D; - x0 ^= rk04; - rk05 ^= rk1E; - x1 ^= rk05; - rk06 ^= rk1F; - x2 ^= rk06; - rk07 ^= rk00; - x3 ^= rk07; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk08 ^= rk01; - x0 ^= rk08; - rk09 ^= rk02; - x1 ^= rk09; - rk0A ^= rk03; - x2 ^= rk0A; - rk0B ^= rk04; - x3 ^= rk0B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk0C ^= rk05; - x0 ^= rk0C; - rk0D ^= rk06; - x1 ^= rk0D; - rk0E ^= rk07; - x2 ^= rk0E; - rk0F ^= rk08; - x3 ^= rk0F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - p8 ^= x0; - p9 ^= x1; - pA ^= x2; - pB ^= x3; - rk10 ^= rk09; - x0 = p4 ^ rk10; - rk11 ^= rk0A; - x1 = p5 ^ rk11; - rk12 ^= rk0B; - x2 = p6 ^ rk12; - rk13 ^= rk0C; - x3 = p7 ^ rk13; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk14 ^= rk0D; - x0 ^= rk14; - rk15 ^= rk0E; - x1 ^= rk15; - rk16 ^= rk0F; - x2 ^= rk16; - rk17 ^= rk10; - x3 ^= rk17; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk18 ^= rk11; - x0 ^= rk18; - rk19 ^= rk12; - x1 ^= rk19; - rk1A ^= rk13; - x2 ^= rk1A; - rk1B ^= rk14; - x3 ^= rk1B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk1C ^= rk15; - x0 ^= rk1C; - rk1D ^= rk16; - x1 ^= rk1D; - rk1E ^= rk17; - x2 ^= rk1E; - rk1F ^= rk18; - x3 ^= rk1F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - - /* round 3, 7, 11 */ - KEY_EXPAND_ELT(sharedMemory, rk00, rk01, rk02, rk03); - rk00 ^= rk1C; - rk01 ^= rk1D; - rk02 ^= rk1E; - rk03 ^= rk1F; - x0 = p8 ^ rk00; - x1 = p9 ^ rk01; - x2 = pA ^ rk02; - x3 = pB ^ rk03; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk04, rk05, rk06, rk07); - rk04 ^= rk00; - rk05 ^= rk01; - rk06 ^= rk02; - rk07 ^= rk03; - x0 ^= rk04; - x1 ^= rk05; - x2 ^= rk06; - x3 ^= rk07; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk08, rk09, rk0A, rk0B); - rk08 ^= rk04; - rk09 ^= rk05; - rk0A ^= rk06; - rk0B ^= rk07; - x0 ^= rk08; - x1 ^= rk09; - x2 ^= rk0A; - x3 ^= rk0B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk0C, rk0D, rk0E, rk0F); - rk0C ^= rk08; - rk0D ^= rk09; - rk0E ^= rk0A; - rk0F ^= rk0B; - x0 ^= rk0C; - x1 ^= rk0D; - x2 ^= rk0E; - x3 ^= rk0F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - KEY_EXPAND_ELT(sharedMemory, rk10, rk11, rk12, rk13); - rk10 ^= rk0C; - rk11 ^= rk0D; - rk12 ^= rk0E; - rk13 ^= rk0F; - x0 = p0 ^ rk10; - x1 = p1 ^ rk11; - x2 = p2 ^ rk12; - x3 = p3 ^ rk13; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk14, rk15, rk16, rk17); - rk14 ^= rk10; - rk15 ^= rk11; - rk16 ^= rk12; - rk17 ^= rk13; - x0 ^= rk14; - x1 ^= rk15; - x2 ^= rk16; - x3 ^= rk17; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk18, rk19, rk1A, rk1B); - rk18 ^= rk14; - rk19 ^= rk15; - rk1A ^= rk16; - rk1B ^= rk17; - x0 ^= rk18; - x1 ^= rk19; - x2 ^= rk1A; - x3 ^= rk1B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk1C, rk1D, rk1E, rk1F); - rk1C ^= rk18; - rk1D ^= rk19; - rk1E ^= rk1A; - rk1F ^= rk1B; - x0 ^= rk1C; - x1 ^= rk1D; - x2 ^= rk1E; - x3 ^= rk1F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - pC ^= x0; - pD ^= x1; - pE ^= x2; - pF ^= x3; - - /* round 4, 8, 12 */ - rk00 ^= rk19; - x0 = p4 ^ rk00; - rk01 ^= rk1A; - x1 = p5 ^ rk01; - rk02 ^= rk1B; - x2 = p6 ^ rk02; - rk03 ^= rk1C; - x3 = p7 ^ rk03; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk04 ^= rk1D; - x0 ^= rk04; - rk05 ^= rk1E; - x1 ^= rk05; - rk06 ^= rk1F; - x2 ^= rk06; - rk07 ^= rk00; - x3 ^= rk07; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk08 ^= rk01; - x0 ^= rk08; - rk09 ^= rk02; - x1 ^= rk09; - rk0A ^= rk03; - x2 ^= rk0A; - rk0B ^= rk04; - x3 ^= rk0B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk0C ^= rk05; - x0 ^= rk0C; - rk0D ^= rk06; - x1 ^= rk0D; - rk0E ^= rk07; - x2 ^= rk0E; - rk0F ^= rk08; - x3 ^= rk0F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - rk10 ^= rk09; - x0 = pC ^ rk10; - rk11 ^= rk0A; - x1 = pD ^ rk11; - rk12 ^= rk0B; - x2 = pE ^ rk12; - rk13 ^= rk0C; - x3 = pF ^ rk13; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk14 ^= rk0D; - x0 ^= rk14; - rk15 ^= rk0E; - x1 ^= rk15; - rk16 ^= rk0F; - x2 ^= rk16; - rk17 ^= rk10; - x3 ^= rk17; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk18 ^= rk11; - x0 ^= rk18; - rk19 ^= rk12; - x1 ^= rk19; - rk1A ^= rk13; - x2 ^= rk1A; - rk1B ^= rk14; - x3 ^= rk1B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk1C ^= rk15; - x0 ^= rk1C; - rk1D ^= rk16; - x1 ^= rk1D; - rk1E ^= rk17; - x2 ^= rk1E; - rk1F ^= rk18; - x3 ^= rk1F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - p8 ^= x0; - p9 ^= x1; - pA ^= x2; - pB ^= x3; - - // 3 - KEY_EXPAND_ELT(sharedMemory, rk00, rk01, rk02, rk03); - rk00 ^= rk1C; - rk01 ^= rk1D; - rk02 ^= rk1E; - rk03 ^= rk1F; - x0 = p0 ^ rk00; - x1 = p1 ^ rk01; - x2 = p2 ^ rk02; - x3 = p3 ^ rk03; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk04, rk05, rk06, rk07); - rk04 ^= rk00; - rk05 ^= rk01; - rk06 ^= rk02; - rk07 ^= rk03; - x0 ^= rk04; - x1 ^= rk05; - x2 ^= rk06; - x3 ^= rk07; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk08, rk09, rk0A, rk0B); - rk08 ^= rk04; - rk09 ^= rk05; - rk0A ^= rk06; - rk0B ^= rk07; - x0 ^= rk08; - x1 ^= rk09; - x2 ^= rk0A; - x3 ^= rk0B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk0C, rk0D, rk0E, rk0F); - rk0C ^= rk08; - rk0D ^= rk09; - rk0E ^= rk0A; - rk0F ^= rk0B; - x0 ^= rk0C; - x1 ^= rk0D; - x2 ^= rk0E; - x3 ^= rk0F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - pC ^= x0; - pD ^= x1; - pE ^= x2; - pF ^= x3; - KEY_EXPAND_ELT(sharedMemory, rk10, rk11, rk12, rk13); - rk10 ^= rk0C; - rk11 ^= rk0D; - rk12 ^= rk0E; - rk13 ^= rk0F; - x0 = p8 ^ rk10; - x1 = p9 ^ rk11; - x2 = pA ^ rk12; - x3 = pB ^ rk13; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk14, rk15, rk16, rk17); - rk14 ^= rk10; - rk15 ^= rk11; - rk16 ^= rk12; - rk17 ^= rk13; - x0 ^= rk14; - x1 ^= rk15; - x2 ^= rk16; - x3 ^= rk17; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk18, rk19, rk1A, rk1B); - rk18 ^= rk14; - rk19 ^= rk15; - rk1A ^= rk16; - rk1B ^= rk17; - x0 ^= rk18; - x1 ^= rk19; - x2 ^= rk1A; - x3 ^= rk1B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk1C, rk1D, rk1E, rk1F); - rk1C ^= rk18; - rk1D ^= rk19; - rk1E ^= rk1A; - rk1F ^= rk1B; - rk1E ^= counter; - rk1F ^= 0xFFFFFFFF; - x0 ^= rk1C; - x1 ^= rk1D; - x2 ^= rk1E; - x3 ^= rk1F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - - rk00 ^= rk19; - x0 = pC ^ rk00; - rk01 ^= rk1A; - x1 = pD ^ rk01; - rk02 ^= rk1B; - x2 = pE ^ rk02; - rk03 ^= rk1C; - x3 = pF ^ rk03; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk04 ^= rk1D; - x0 ^= rk04; - rk05 ^= rk1E; - x1 ^= rk05; - rk06 ^= rk1F; - x2 ^= rk06; - rk07 ^= rk00; - x3 ^= rk07; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk08 ^= rk01; - x0 ^= rk08; - rk09 ^= rk02; - x1 ^= rk09; - rk0A ^= rk03; - x2 ^= rk0A; - rk0B ^= rk04; - x3 ^= rk0B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk0C ^= rk05; - x0 ^= rk0C; - rk0D ^= rk06; - x1 ^= rk0D; - rk0E ^= rk07; - x2 ^= rk0E; - rk0F ^= rk08; - x3 ^= rk0F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - p8 ^= x0; - p9 ^= x1; - pA ^= x2; - pB ^= x3; - rk10 ^= rk09; - x0 = p4 ^ rk10; - rk11 ^= rk0A; - x1 = p5 ^ rk11; - rk12 ^= rk0B; - x2 = p6 ^ rk12; - rk13 ^= rk0C; - x3 = p7 ^ rk13; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk14 ^= rk0D; - x0 ^= rk14; - rk15 ^= rk0E; - x1 ^= rk15; - rk16 ^= rk0F; - x2 ^= rk16; - rk17 ^= rk10; - x3 ^= rk17; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk18 ^= rk11; - x0 ^= rk18; - rk19 ^= rk12; - x1 ^= rk19; - rk1A ^= rk13; - x2 ^= rk1A; - rk1B ^= rk14; - x3 ^= rk1B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk1C ^= rk15; - x0 ^= rk1C; - rk1D ^= rk16; - x1 ^= rk1D; - rk1E ^= rk17; - x2 ^= rk1E; - rk1F ^= rk18; - x3 ^= rk1F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - - /* round 3, 7, 11 */ - KEY_EXPAND_ELT(sharedMemory, rk00, rk01, rk02, rk03); - rk00 ^= rk1C; - rk01 ^= rk1D; - rk02 ^= rk1E; - rk03 ^= rk1F; - x0 = p8 ^ rk00; - x1 = p9 ^ rk01; - x2 = pA ^ rk02; - x3 = pB ^ rk03; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk04, rk05, rk06, rk07); - rk04 ^= rk00; - rk05 ^= rk01; - rk06 ^= rk02; - rk07 ^= rk03; - x0 ^= rk04; - x1 ^= rk05; - x2 ^= rk06; - x3 ^= rk07; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk08, rk09, rk0A, rk0B); - rk08 ^= rk04; - rk09 ^= rk05; - rk0A ^= rk06; - rk0B ^= rk07; - x0 ^= rk08; - x1 ^= rk09; - x2 ^= rk0A; - x3 ^= rk0B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk0C, rk0D, rk0E, rk0F); - rk0C ^= rk08; - rk0D ^= rk09; - rk0E ^= rk0A; - rk0F ^= rk0B; - x0 ^= rk0C; - x1 ^= rk0D; - x2 ^= rk0E; - x3 ^= rk0F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - KEY_EXPAND_ELT(sharedMemory, rk10, rk11, rk12, rk13); - rk10 ^= rk0C; - rk11 ^= rk0D; - rk12 ^= rk0E; - rk13 ^= rk0F; - x0 = p0 ^ rk10; - x1 = p1 ^ rk11; - x2 = p2 ^ rk12; - x3 = p3 ^ rk13; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk14, rk15, rk16, rk17); - rk14 ^= rk10; - rk15 ^= rk11; - rk16 ^= rk12; - rk17 ^= rk13; - x0 ^= rk14; - x1 ^= rk15; - x2 ^= rk16; - x3 ^= rk17; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk18, rk19, rk1A, rk1B); - rk18 ^= rk14; - rk19 ^= rk15; - rk1A ^= rk16; - rk1B ^= rk17; - x0 ^= rk18; - x1 ^= rk19; - x2 ^= rk1A; - x3 ^= rk1B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk1C, rk1D, rk1E, rk1F); - rk1C ^= rk18; - rk1D ^= rk19; - rk1E ^= rk1A; - rk1F ^= rk1B; - x0 ^= rk1C; - x1 ^= rk1D; - x2 ^= rk1E; - x3 ^= rk1F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - pC ^= x0; - pD ^= x1; - pE ^= x2; - pF ^= x3; - /* round 4, 8, 12 */ - rk00 ^= rk19; - x0 = p4 ^ rk00; - rk01 ^= rk1A; - x1 = p5 ^ rk01; - rk02 ^= rk1B; - x2 = p6 ^ rk02; - rk03 ^= rk1C; - x3 = p7 ^ rk03; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk04 ^= rk1D; - x0 ^= rk04; - rk05 ^= rk1E; - x1 ^= rk05; - rk06 ^= rk1F; - x2 ^= rk06; - rk07 ^= rk00; - x3 ^= rk07; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk08 ^= rk01; - x0 ^= rk08; - rk09 ^= rk02; - x1 ^= rk09; - rk0A ^= rk03; - x2 ^= rk0A; - rk0B ^= rk04; - x3 ^= rk0B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk0C ^= rk05; - x0 ^= rk0C; - rk0D ^= rk06; - x1 ^= rk0D; - rk0E ^= rk07; - x2 ^= rk0E; - rk0F ^= rk08; - x3 ^= rk0F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - rk10 ^= rk09; - x0 = pC ^ rk10; - rk11 ^= rk0A; - x1 = pD ^ rk11; - rk12 ^= rk0B; - x2 = pE ^ rk12; - rk13 ^= rk0C; - x3 = pF ^ rk13; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk14 ^= rk0D; - x0 ^= rk14; - rk15 ^= rk0E; - x1 ^= rk15; - rk16 ^= rk0F; - x2 ^= rk16; - rk17 ^= rk10; - x3 ^= rk17; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk18 ^= rk11; - x0 ^= rk18; - rk19 ^= rk12; - x1 ^= rk19; - rk1A ^= rk13; - x2 ^= rk1A; - rk1B ^= rk14; - x3 ^= rk1B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - rk1C ^= rk15; - x0 ^= rk1C; - rk1D ^= rk16; - x1 ^= rk1D; - rk1E ^= rk17; - x2 ^= rk1E; - rk1F ^= rk18; - x3 ^= rk1F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - p8 ^= x0; - p9 ^= x1; - pA ^= x2; - pB ^= x3; - - /* round 13 */ - KEY_EXPAND_ELT(sharedMemory, rk00, rk01, rk02, rk03); - rk00 ^= rk1C; - rk01 ^= rk1D; - rk02 ^= rk1E; - rk03 ^= rk1F; - x0 = p0 ^ rk00; - x1 = p1 ^ rk01; - x2 = p2 ^ rk02; - x3 = p3 ^ rk03; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk04, rk05, rk06, rk07); - rk04 ^= rk00; - rk05 ^= rk01; - rk06 ^= rk02; - rk07 ^= rk03; - x0 ^= rk04; - x1 ^= rk05; - x2 ^= rk06; - x3 ^= rk07; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk08, rk09, rk0A, rk0B); - rk08 ^= rk04; - rk09 ^= rk05; - rk0A ^= rk06; - rk0B ^= rk07; - x0 ^= rk08; - x1 ^= rk09; - x2 ^= rk0A; - x3 ^= rk0B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk0C, rk0D, rk0E, rk0F); - rk0C ^= rk08; - rk0D ^= rk09; - rk0E ^= rk0A; - rk0F ^= rk0B; - x0 ^= rk0C; - x1 ^= rk0D; - x2 ^= rk0E; - x3 ^= rk0F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - pC ^= x0; - pD ^= x1; - pE ^= x2; - pF ^= x3; - KEY_EXPAND_ELT(sharedMemory, rk10, rk11, rk12, rk13); - rk10 ^= rk0C; - rk11 ^= rk0D; - rk12 ^= rk0E; - rk13 ^= rk0F; - x0 = p8 ^ rk10; - x1 = p9 ^ rk11; - x2 = pA ^ rk12; - x3 = pB ^ rk13; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk14, rk15, rk16, rk17); - rk14 ^= rk10; - rk15 ^= rk11; - rk16 ^= rk12; - rk17 ^= rk13; - x0 ^= rk14; - x1 ^= rk15; - x2 ^= rk16; - x3 ^= rk17; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk18, rk19, rk1A, rk1B); - rk18 ^= rk14; - rk19 ^= rk15 ^ counter; - rk1A ^= rk16; - rk1B ^= rk17 ^ 0xFFFFFFFF; - x0 ^= rk18; - x1 ^= rk19; - x2 ^= rk1A; - x3 ^= rk1B; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - KEY_EXPAND_ELT(sharedMemory, rk1C, rk1D, rk1E, rk1F); - rk1C ^= rk18; - rk1D ^= rk19; - rk1E ^= rk1A; - rk1F ^= rk1B; - x0 ^= rk1C; - x1 ^= rk1D; - x2 ^= rk1E; - x3 ^= rk1F; - AES_ROUND_NOKEY(sharedMemory, x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - state[0x0] ^= p8; - state[0x1] ^= p9; - state[0x2] ^= pA; - state[0x3] ^= pB; - state[0x4] ^= pC; - state[0x5] ^= pD; - state[0x6] ^= pE; - state[0x7] ^= pF; - state[0x8] ^= p0; - state[0x9] ^= p1; - state[0xA] ^= p2; - state[0xB] ^= p3; - state[0xC] ^= p4; - state[0xD] ^= p5; - state[0xE] ^= p6; - state[0xF] ^= p7; -} - -__device__ __forceinline__ -void shavite_gpu_init(uint32_t *sharedMemory) -{ - /* each thread startup will fill a uint32 */ - if (threadIdx.x < 128) { - sharedMemory[threadIdx.x] = d_AES0[threadIdx.x]; - sharedMemory[threadIdx.x + 256] = d_AES1[threadIdx.x]; - sharedMemory[threadIdx.x + 512] = d_AES2[threadIdx.x]; - sharedMemory[threadIdx.x + 768] = d_AES3[threadIdx.x]; - - sharedMemory[threadIdx.x + 64 * 2] = d_AES0[threadIdx.x + 64 * 2]; - sharedMemory[threadIdx.x + 64 * 2 + 256] = d_AES1[threadIdx.x + 64 * 2]; - sharedMemory[threadIdx.x + 64 * 2 + 512] = d_AES2[threadIdx.x + 64 * 2]; - sharedMemory[threadIdx.x + 64 * 2 + 768] = d_AES3[threadIdx.x + 64 * 2]; - } -} - -// GPU Hash -__global__ __launch_bounds__(TPB, 7) /* 64 registers with 128,8 - 72 regs with 128,7 */ -void x11_shavite512_gpu_hash_64(uint32_t threads, uint32_t startNounce, uint64_t *g_hash, uint32_t *g_nonceVector) -{ - __shared__ uint32_t sharedMemory[1024]; - - shavite_gpu_init(sharedMemory); - __threadfence_block(); - - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t nounce = (g_nonceVector != NULL) ? g_nonceVector[thread] : (startNounce + thread); - - int hashPosition = nounce - startNounce; - uint32_t *Hash = (uint32_t*)&g_hash[hashPosition<<3]; - - // kopiere init-state - uint32_t state[16] = { - SPH_C32(0x72FCCDD8), SPH_C32(0x79CA4727), SPH_C32(0x128A077B), SPH_C32(0x40D55AEC), - SPH_C32(0xD1901A06), SPH_C32(0x430AE307), SPH_C32(0xB29F5CD1), SPH_C32(0xDF07FBFC), - SPH_C32(0x8E45D73D), SPH_C32(0x681AB538), SPH_C32(0xBDE86578), SPH_C32(0xDD577E47), - SPH_C32(0xE275EADE), SPH_C32(0x502D9FCD), SPH_C32(0xB9357178), SPH_C32(0x022A4B9A) - }; - - // nachricht laden - uint32_t msg[32]; - - // fülle die Nachricht mit 64-byte (vorheriger Hash) - #pragma unroll 16 - for(int i=0;i<16;i++) - msg[i] = Hash[i]; - - // Nachrichtenende - msg[16] = 0x80; - #pragma unroll 10 - for(int i=17;i<27;i++) - msg[i] = 0; - - msg[27] = 0x02000000; - msg[28] = 0; - msg[29] = 0; - msg[30] = 0; - msg[31] = 0x02000000; - - c512(sharedMemory, state, msg, 512); - - #pragma unroll 16 - for(int i=0;i<16;i++) - Hash[i] = state[i]; - } -} - -__global__ __launch_bounds__(TPB, 7) -void x11_shavite512_gpu_hash_80(uint32_t threads, uint32_t startNounce, void *outputHash) -{ - __shared__ uint32_t sharedMemory[1024]; - - shavite_gpu_init(sharedMemory); - __threadfence_block(); - - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const uint32_t nounce = startNounce + thread; - - // initial state - uint32_t state[16] = { - SPH_C32(0x72FCCDD8), SPH_C32(0x79CA4727), SPH_C32(0x128A077B), SPH_C32(0x40D55AEC), - SPH_C32(0xD1901A06), SPH_C32(0x430AE307), SPH_C32(0xB29F5CD1), SPH_C32(0xDF07FBFC), - SPH_C32(0x8E45D73D), SPH_C32(0x681AB538), SPH_C32(0xBDE86578), SPH_C32(0xDD577E47), - SPH_C32(0xE275EADE), SPH_C32(0x502D9FCD), SPH_C32(0xB9357178), SPH_C32(0x022A4B9A) - }; - - uint32_t msg[32]; - - #pragma unroll 32 - for(int i=0;i<32;i++) { - msg[i] = c_PaddedMessage80[i]; - } - msg[19] = cuda_swab32(nounce); - msg[20] = 0x80; - msg[27] = 0x2800000; - msg[31] = 0x2000000; - - c512(sharedMemory, state, msg, 640); - - uint32_t *outHash = (uint32_t *)outputHash + 16 * thread; - - #pragma unroll 16 - for(int i=0;i<16;i++) - outHash[i] = state[i]; - - } //thread < threads -} - -__host__ -void x11_shavite512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order) -{ - const uint32_t threadsperblock = TPB; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - // note: 128 threads minimum are required to init the shared memory array - x11_shavite512_gpu_hash_64<<>>(threads, startNounce, (uint64_t*)d_hash, d_nonceVector); - //MyStreamSynchronize(NULL, order, thr_id); -} - -__host__ -void x11_shavite512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_outputHash, int order) -{ - const uint32_t threadsperblock = TPB; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - x11_shavite512_gpu_hash_80<<>>(threads, startNounce, d_outputHash); -} - -__host__ -void x11_shavite512_cpu_init(int thr_id, uint32_t threads) -{ - aes_cpu_init(thr_id); -} - -__host__ -void x11_shavite512_setBlock_80(void *pdata) -{ - // Message with Padding - // The nonce is at Byte 76. - unsigned char PaddedMessage[128]; - memcpy(PaddedMessage, pdata, 80); - memset(PaddedMessage+80, 0, 48); - - cudaMemcpyToSymbol(c_PaddedMessage80, PaddedMessage, 32*sizeof(uint32_t), 0, cudaMemcpyHostToDevice); -} diff --git a/x11/cuda_x11_shavite512_alexis.cu b/x11/cuda_x11_shavite512_alexis.cu deleted file mode 100644 index db931e5a..00000000 --- a/x11/cuda_x11_shavite512_alexis.cu +++ /dev/null @@ -1,437 +0,0 @@ -/* - Based on Tanguy Pruvot's repo - Provos Alexis - 2016 -*/ -#include "cuda_helper_alexis.h" -#include "cuda_vectors_alexis.h" - -#define INTENSIVE_GMF -#include "cuda_x11_aes_alexis.cuh" - -#define TPB 384 - - - -__device__ __forceinline__ -static void round_3_7_11(const uint32_t sharedMemory[4][256], uint32_t* r, uint4 *p, uint4 &x){ - KEY_EXPAND_ELT(sharedMemory, &r[ 0]); - *(uint4*)&r[ 0] ^= *(uint4*)&r[28]; - x = p[ 2] ^ *(uint4*)&r[ 0]; - KEY_EXPAND_ELT(sharedMemory, &r[ 4]); - r[4] ^= r[0]; - r[5] ^= r[1]; - r[6] ^= r[2]; - r[7] ^= r[3]; - AES_ROUND_NOKEY(sharedMemory, &x); - x.x ^= r[4]; - x.y ^= r[5]; - x.z ^= r[6]; - x.w ^= r[7]; - KEY_EXPAND_ELT(sharedMemory, &r[ 8]); - r[8] ^= r[4]; - r[9] ^= r[5]; - r[10]^= r[6]; - r[11]^= r[7]; - AES_ROUND_NOKEY(sharedMemory, &x); - x.x ^= r[8]; - x.y ^= r[9]; - x.z ^= r[10]; - x.w ^= r[11]; - KEY_EXPAND_ELT(sharedMemory, &r[12]); - r[12] ^= r[8]; - r[13] ^= r[9]; - r[14]^= r[10]; - r[15]^= r[11]; - AES_ROUND_NOKEY(sharedMemory, &x); - x.x ^= r[12]; - x.y ^= r[13]; - x.z ^= r[14]; - x.w ^= r[15]; - AES_ROUND_NOKEY(sharedMemory, &x); - p[ 1].x ^= x.x; - p[ 1].y ^= x.y; - p[ 1].z ^= x.z; - p[ 1].w ^= x.w; - KEY_EXPAND_ELT(sharedMemory, &r[16]); - *(uint4*)&r[16] ^= *(uint4*)&r[12]; - x = p[ 0] ^ *(uint4*)&r[16]; - KEY_EXPAND_ELT(sharedMemory, &r[20]); - *(uint4*)&r[20] ^= *(uint4*)&r[16]; - AES_ROUND_NOKEY(sharedMemory, &x); - x ^= *(uint4*)&r[20]; - KEY_EXPAND_ELT(sharedMemory, &r[24]); - *(uint4*)&r[24] ^= *(uint4*)&r[20]; - AES_ROUND_NOKEY(sharedMemory, &x); - x ^= *(uint4*)&r[24]; - KEY_EXPAND_ELT(sharedMemory,&r[28]); - AES_ROUND_NOKEY(sharedMemory, &x); - *(uint4*)&r[28] ^= *(uint4*)&r[24]; - x ^= *(uint4*)&r[28]; - AES_ROUND_NOKEY(sharedMemory, &x); - p[ 3] ^= x; -} - -__device__ __forceinline__ -static void round_4_8_12(const uint32_t sharedMemory[4][256], uint32_t* r, uint4 *p, uint4 &x){ - *(uint4*)&r[ 0] ^= *(uint4*)&r[25]; - x = p[ 1] ^ *(uint4*)&r[ 0]; - AES_ROUND_NOKEY(sharedMemory, &x); - - r[ 4] ^= r[29]; r[ 5] ^= r[30]; - r[ 6] ^= r[31]; r[ 7] ^= r[ 0]; - - x ^= *(uint4*)&r[ 4]; - *(uint4*)&r[ 8] ^= *(uint4*)&r[ 1]; - AES_ROUND_NOKEY(sharedMemory, &x); - x ^= *(uint4*)&r[ 8]; - *(uint4*)&r[12] ^= *(uint4*)&r[ 5]; - AES_ROUND_NOKEY(sharedMemory, &x); - x ^= *(uint4*)&r[12]; - AES_ROUND_NOKEY(sharedMemory, &x); - p[ 0] ^= x; - *(uint4*)&r[16] ^= *(uint4*)&r[ 9]; - x = p[ 3] ^ *(uint4*)&r[16]; - AES_ROUND_NOKEY(sharedMemory, &x); - *(uint4*)&r[20] ^= *(uint4*)&r[13]; - x ^= *(uint4*)&r[20]; - AES_ROUND_NOKEY(sharedMemory, &x); - *(uint4*)&r[24] ^= *(uint4*)&r[17]; - x ^= *(uint4*)&r[24]; - *(uint4*)&r[28] ^= *(uint4*)&r[21]; - AES_ROUND_NOKEY(sharedMemory, &x); - x ^= *(uint4*)&r[28]; - AES_ROUND_NOKEY(sharedMemory, &x); - p[ 2] ^= x; -} - -// GPU Hash -__global__ __launch_bounds__(TPB,2) /* 64 registers with 128,8 - 72 regs with 128,7 */ -void x11_shavite512_gpu_hash_64_alexis(const uint32_t threads, uint64_t *g_hash) -{ - __shared__ uint32_t sharedMemory[4][256]; - - aes_gpu_init_mt_256(sharedMemory); - - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - - uint4 p[ 4]; - uint4 x; - uint32_t r[32]; - - // kopiere init-state - const uint32_t state[16] = { - 0x72FCCDD8, 0x79CA4727, 0x128A077B, 0x40D55AEC, 0xD1901A06, 0x430AE307, 0xB29F5CD1, 0xDF07FBFC, - 0x8E45D73D, 0x681AB538, 0xBDE86578, 0xDD577E47, 0xE275EADE, 0x502D9FCD, 0xB9357178, 0x022A4B9A - }; - if (thread < threads) - { - uint64_t *Hash = &g_hash[thread<<3]; - - // fülle die Nachricht mit 64-byte (vorheriger Hash) - *(uint2x4*)&r[ 0] = __ldg4((uint2x4*)&Hash[ 0]); - *(uint2x4*)&r[ 8] = __ldg4((uint2x4*)&Hash[ 4]); - __syncthreads(); - - *(uint2x4*)&p[ 0] = *(uint2x4*)&state[ 0]; - *(uint2x4*)&p[ 2] = *(uint2x4*)&state[ 8]; - r[16] = 0x80; r[17] = 0; r[18] = 0; r[19] = 0; - r[20] = 0; r[21] = 0; r[22] = 0; r[23] = 0; - r[24] = 0; r[25] = 0; r[26] = 0; r[27] = 0x02000000; - r[28] = 0; r[29] = 0; r[30] = 0; r[31] = 0x02000000; - /* round 0 */ - x = p[ 1] ^ *(uint4*)&r[ 0]; - AES_ROUND_NOKEY(sharedMemory, &x); - x ^= *(uint4*)&r[ 4]; - AES_ROUND_NOKEY(sharedMemory, &x); - x ^= *(uint4*)&r[ 8]; - AES_ROUND_NOKEY(sharedMemory, &x); - x ^= *(uint4*)&r[12]; - AES_ROUND_NOKEY(sharedMemory, &x); - p[ 0] ^= x; - x = p[ 3]; - x.x ^= 0x80; - - AES_ROUND_NOKEY(sharedMemory, &x); - - AES_ROUND_NOKEY(sharedMemory, &x); - - x.w ^= 0x02000000; - AES_ROUND_NOKEY(sharedMemory, &x); - - x.w ^= 0x02000000; - AES_ROUND_NOKEY(sharedMemory, &x); - p[ 2]^= x; - // 1 - KEY_EXPAND_ELT(sharedMemory, &r[ 0]); - *(uint4*)&r[ 0]^=*(uint4*)&r[28]; - r[ 0] ^= 0x200; - r[ 3] ^= 0xFFFFFFFF; - x = p[ 0] ^ *(uint4*)&r[ 0]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory, &r[ 4]); - *(uint4*)&r[ 4] ^= *(uint4*)&r[ 0]; - x ^= *(uint4*)&r[ 4]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory, &r[ 8]); - *(uint4*)&r[ 8] ^= *(uint4*)&r[ 4]; - x ^= *(uint4*)&r[ 8]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory, &r[12]); - *(uint4*)&r[12] ^= *(uint4*)&r[ 8]; - x ^= *(uint4*)&r[12]; - AES_ROUND_NOKEY(sharedMemory, &x); - p[ 3] ^= x; - KEY_EXPAND_ELT(sharedMemory, &r[16]); - *(uint4*)&r[16] ^= *(uint4*)&r[12]; - x = p[ 2] ^ *(uint4*)&r[16]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory, &r[20]); - *(uint4*)&r[20] ^= *(uint4*)&r[16]; - x ^= *(uint4*)&r[20]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory, &r[24]); - *(uint4*)&r[24] ^= *(uint4*)&r[20]; - x ^= *(uint4*)&r[24]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory, &r[28]); - *(uint4*)&r[28] ^= *(uint4*)&r[24]; - x ^= *(uint4*)&r[28]; - AES_ROUND_NOKEY(sharedMemory, &x); - p[ 1] ^= x; - *(uint4*)&r[ 0] ^= *(uint4*)&r[25]; - x = p[ 3] ^ *(uint4*)&r[ 0]; - AES_ROUND_NOKEY(sharedMemory, &x); - - r[ 4] ^= r[29]; r[ 5] ^= r[30]; - r[ 6] ^= r[31]; r[ 7] ^= r[ 0]; - - x ^= *(uint4*)&r[ 4]; - AES_ROUND_NOKEY(sharedMemory, &x); - *(uint4*)&r[ 8] ^= *(uint4*)&r[ 1]; - x ^= *(uint4*)&r[ 8]; - AES_ROUND_NOKEY(sharedMemory, &x); - *(uint4*)&r[12] ^= *(uint4*)&r[ 5]; - x ^= *(uint4*)&r[12]; - AES_ROUND_NOKEY(sharedMemory, &x); - p[ 2] ^= x; - *(uint4*)&r[16] ^= *(uint4*)&r[ 9]; - x = p[ 1] ^ *(uint4*)&r[16]; - AES_ROUND_NOKEY(sharedMemory, &x); - *(uint4*)&r[20] ^= *(uint4*)&r[13]; - x ^= *(uint4*)&r[20]; - AES_ROUND_NOKEY(sharedMemory, &x); - *(uint4*)&r[24] ^= *(uint4*)&r[17]; - x ^= *(uint4*)&r[24]; - AES_ROUND_NOKEY(sharedMemory, &x); - *(uint4*)&r[28] ^= *(uint4*)&r[21]; - x ^= *(uint4*)&r[28]; - AES_ROUND_NOKEY(sharedMemory, &x); - - p[ 0] ^= x; - - /* round 3, 7, 11 */ - round_3_7_11(sharedMemory,r,p,x); - - - /* round 4, 8, 12 */ - round_4_8_12(sharedMemory,r,p,x); - - // 2 - KEY_EXPAND_ELT(sharedMemory,&r[ 0]); - *(uint4*)&r[ 0] ^= *(uint4*)&r[28]; - x = p[ 0] ^ *(uint4*)&r[ 0]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory, &r[ 4]); - *(uint4*)&r[ 4] ^= *(uint4*)&r[ 0]; - r[ 7] ^= (~0x200); - x ^= *(uint4*)&r[ 4]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory, &r[ 8]); - *(uint4*)&r[ 8] ^= *(uint4*)&r[ 4]; - x ^= *(uint4*)&r[ 8]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory, &r[12]); - *(uint4*)&r[12] ^= *(uint4*)&r[ 8]; - x ^= *(uint4*)&r[12]; - AES_ROUND_NOKEY(sharedMemory, &x); - p[ 3] ^= x; - KEY_EXPAND_ELT(sharedMemory, &r[16]); - *(uint4*)&r[16] ^= *(uint4*)&r[12]; - x = p[ 2] ^ *(uint4*)&r[16]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory, &r[20]); - *(uint4*)&r[20] ^= *(uint4*)&r[16]; - x ^= *(uint4*)&r[20]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory, &r[24]); - *(uint4*)&r[24] ^= *(uint4*)&r[20]; - x ^= *(uint4*)&r[24]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory,&r[28]); - *(uint4*)&r[28] ^= *(uint4*)&r[24]; - x ^= *(uint4*)&r[28]; - AES_ROUND_NOKEY(sharedMemory, &x); - p[ 1] ^= x; - - *(uint4*)&r[ 0] ^= *(uint4*)&r[25]; - x = p[ 3] ^ *(uint4*)&r[ 0]; - AES_ROUND_NOKEY(sharedMemory, &x); - r[ 4] ^= r[29]; - r[ 5] ^= r[30]; - r[ 6] ^= r[31]; - r[ 7] ^= r[ 0]; - x ^= *(uint4*)&r[ 4]; - AES_ROUND_NOKEY(sharedMemory, &x); - *(uint4*)&r[ 8] ^= *(uint4*)&r[ 1]; - x ^= *(uint4*)&r[ 8]; - AES_ROUND_NOKEY(sharedMemory, &x); - *(uint4*)&r[12] ^= *(uint4*)&r[ 5]; - x ^= *(uint4*)&r[12]; - AES_ROUND_NOKEY(sharedMemory, &x); - p[ 2] ^= x; - *(uint4*)&r[16] ^= *(uint4*)&r[ 9]; - x = p[ 1] ^ *(uint4*)&r[16]; - AES_ROUND_NOKEY(sharedMemory, &x); - *(uint4*)&r[20] ^= *(uint4*)&r[13]; - x ^= *(uint4*)&r[20]; - AES_ROUND_NOKEY(sharedMemory, &x); - *(uint4*)&r[24] ^= *(uint4*)&r[17]; - x ^= *(uint4*)&r[24]; - AES_ROUND_NOKEY(sharedMemory, &x); - *(uint4*)&r[28] ^= *(uint4*)&r[21]; - x ^= *(uint4*)&r[28]; - AES_ROUND_NOKEY(sharedMemory, &x); - p[ 0] ^= x; - - /* round 3, 7, 11 */ - round_3_7_11(sharedMemory,r,p,x); - - /* round 4, 8, 12 */ - round_4_8_12(sharedMemory,r,p,x); - - // 3 - KEY_EXPAND_ELT(sharedMemory,&r[ 0]); - *(uint4*)&r[ 0] ^= *(uint4*)&r[28]; - x = p[ 0] ^ *(uint4*)&r[ 0]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory, &r[ 4]); - *(uint4*)&r[ 4] ^= *(uint4*)&r[ 0]; - x ^= *(uint4*)&r[ 4]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory, &r[ 8]); - *(uint4*)&r[ 8] ^= *(uint4*)&r[ 4]; - x ^= *(uint4*)&r[ 8]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory, &r[12]); - *(uint4*)&r[12] ^= *(uint4*)&r[ 8]; - x ^= *(uint4*)&r[12]; - AES_ROUND_NOKEY(sharedMemory, &x); - p[ 3] ^= x; - KEY_EXPAND_ELT(sharedMemory, &r[16]); - *(uint4*)&r[16] ^= *(uint4*)&r[12]; - x = p[ 2] ^ *(uint4*)&r[16]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory, &r[20]); - *(uint4*)&r[20] ^= *(uint4*)&r[16]; - x^=*(uint4*)&r[20]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory, &r[24]); - *(uint4*)&r[24]^=*(uint4*)&r[20]; - x ^= *(uint4*)&r[24]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory,&r[28]); - *(uint4*)&r[28] ^= *(uint4*)&r[24]; - r[30] ^= 0x200; - r[31] ^= 0xFFFFFFFF; - x ^= *(uint4*)&r[28]; - AES_ROUND_NOKEY(sharedMemory, &x); - p[ 1] ^= x; - - *(uint4*)&r[ 0] ^= *(uint4*)&r[25]; - x = p[ 3] ^ *(uint4*)&r[ 0]; - AES_ROUND_NOKEY(sharedMemory, &x); - r[ 4] ^= r[29]; - r[ 5] ^= r[30]; - r[ 6] ^= r[31]; - r[ 7] ^= r[ 0]; - x ^= *(uint4*)&r[ 4]; - AES_ROUND_NOKEY(sharedMemory, &x); - *(uint4*)&r[ 8] ^= *(uint4*)&r[ 1]; - x ^= *(uint4*)&r[ 8]; - AES_ROUND_NOKEY(sharedMemory, &x); - *(uint4*)&r[12] ^= *(uint4*)&r[ 5]; - x ^= *(uint4*)&r[12]; - AES_ROUND_NOKEY(sharedMemory, &x); - p[ 2] ^= x; - *(uint4*)&r[16] ^= *(uint4*)&r[ 9]; - x = p[ 1] ^ *(uint4*)&r[16]; - AES_ROUND_NOKEY(sharedMemory, &x); - *(uint4*)&r[20] ^= *(uint4*)&r[13]; - x ^= *(uint4*)&r[20]; - AES_ROUND_NOKEY(sharedMemory, &x); - *(uint4*)&r[24] ^= *(uint4*)&r[17]; - x ^= *(uint4*)&r[24]; - AES_ROUND_NOKEY(sharedMemory, &x); - *(uint4*)&r[28] ^= *(uint4*)&r[21]; - x ^= *(uint4*)&r[28]; - AES_ROUND_NOKEY(sharedMemory, &x); - p[ 0] ^= x; - - /* round 3, 7, 11 */ - round_3_7_11(sharedMemory,r,p,x); - - /* round 4, 8, 12 */ - round_4_8_12(sharedMemory,r,p,x); - - /* round 13 */ - KEY_EXPAND_ELT(sharedMemory,&r[ 0]); - *(uint4*)&r[ 0] ^= *(uint4*)&r[28]; - x = p[ 0] ^ *(uint4*)&r[ 0]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory, &r[ 4]); - *(uint4*)&r[ 4] ^= *(uint4*)&r[ 0]; - x ^= *(uint4*)&r[ 4]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory, &r[ 8]); - *(uint4*)&r[ 8] ^= *(uint4*)&r[ 4]; - x ^= *(uint4*)&r[ 8]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory, &r[12]); - *(uint4*)&r[12] ^= *(uint4*)&r[ 8]; - x ^= *(uint4*)&r[12]; - AES_ROUND_NOKEY(sharedMemory, &x); - p[ 3] ^= x; - KEY_EXPAND_ELT(sharedMemory, &r[16]); - *(uint4*)&r[16] ^= *(uint4*)&r[12]; - x = p[ 2] ^ *(uint4*)&r[16]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory, &r[20]); - *(uint4*)&r[20] ^= *(uint4*)&r[16]; - x ^= *(uint4*)&r[20]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory, &r[24]); - *(uint4*)&r[24] ^= *(uint4*)&r[20]; - r[25] ^= 0x200; - r[27] ^= 0xFFFFFFFF; - x ^= *(uint4*)&r[24]; - AES_ROUND_NOKEY(sharedMemory, &x); - KEY_EXPAND_ELT(sharedMemory,&r[28]); - *(uint4*)&r[28] ^= *(uint4*)&r[24]; - x ^= *(uint4*)&r[28]; - AES_ROUND_NOKEY(sharedMemory, &x); - p[ 1] ^= x; - - *(uint2x4*)&Hash[ 0] = *(uint2x4*)&state[ 0] ^ *(uint2x4*)&p[ 2]; - *(uint2x4*)&Hash[ 4] = *(uint2x4*)&state[ 8] ^ *(uint2x4*)&p[ 0]; - } -} - -__host__ -void x11_shavite512_cpu_hash_64_alexis(int thr_id, uint32_t threads, uint32_t *d_hash) -{ - dim3 grid((threads + TPB-1)/TPB); - dim3 block(TPB); - - // note: 128 threads minimum are required to init the shared memory array - x11_shavite512_gpu_hash_64_alexis<<>>(threads, (uint64_t*)d_hash); -} diff --git a/x11/cuda_x11_simd512.cu b/x11/cuda_x11_simd512.cu deleted file mode 100644 index 5495edad..00000000 --- a/x11/cuda_x11_simd512.cu +++ /dev/null @@ -1,734 +0,0 @@ -/*************************************************************************************************** - * SIMD512 SM3+ CUDA IMPLEMENTATION (require cuda_x11_simd512_func.cuh) - */ - -#include "miner.h" -#include "cuda_helper.h" - -#define TPB 128 - -uint32_t *d_state[MAX_GPUS]; -uint4 *d_temp4[MAX_GPUS]; - -// texture bound to d_temp4[thr_id], for read access in Compaction kernel -texture texRef1D_128; - -#define DEVICE_DIRECT_CONSTANTS - -#ifdef DEVICE_DIRECT_CONSTANTS -__constant__ uint8_t c_perm[8][8] = { -#else -__constant__ uint8_t c_perm[8][8]; -const uint8_t h_perm[8][8] = { -#endif - { 2, 3, 6, 7, 0, 1, 4, 5 }, - { 6, 7, 2, 3, 4, 5, 0, 1 }, - { 7, 6, 5, 4, 3, 2, 1, 0 }, - { 1, 0, 3, 2, 5, 4, 7, 6 }, - { 0, 1, 4, 5, 6, 7, 2, 3 }, - { 6, 7, 2, 3, 0, 1, 4, 5 }, - { 6, 7, 0, 1, 4, 5, 2, 3 }, - { 4, 5, 2, 3, 6, 7, 0, 1 } -}; - -/* used in cuda_x11_simd512_func.cuh (SIMD_Compress2) */ -#ifdef DEVICE_DIRECT_CONSTANTS -__constant__ uint32_t c_IV_512[32] = { -#else -__constant__ uint32_t c_IV_512[32]; -const uint32_t h_IV_512[32] = { -#endif - 0x0ba16b95, 0x72f999ad, 0x9fecc2ae, 0xba3264fc, 0x5e894929, 0x8e9f30e5, 0x2f1daa37, 0xf0f2c558, - 0xac506643, 0xa90635a5, 0xe25b878b, 0xaab7878f, 0x88817f7a, 0x0a02892b, 0x559a7550, 0x598f657e, - 0x7eef60a1, 0x6b70e3e8, 0x9c1714d1, 0xb958e2a8, 0xab02675e, 0xed1c014f, 0xcd8d65bb, 0xfdb7a257, - 0x09254899, 0xd699c7bc, 0x9019b6dc, 0x2b9022e4, 0x8fa14956, 0x21bf9bd3, 0xb94d0943, 0x6ffddc22 -}; - -#ifdef DEVICE_DIRECT_CONSTANTS -__constant__ short c_FFT128_8_16_Twiddle[128] = { -#else -__constant__ short c_FFT128_8_16_Twiddle[128]; -static const short h_FFT128_8_16_Twiddle[128] = { -#endif - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 60, 2, 120, 4, -17, 8, -34, 16, -68, 32, 121, 64, -15, 128, -30, - 1, 46, 60, -67, 2, 92, 120, 123, 4, -73, -17, -11, 8, 111, -34, -22, - 1, -67, 120, -73, 8, -22, -68, -70, 64, 81, -30, -46, -2,-123, 17,-111, - 1,-118, 46, -31, 60, 116, -67, -61, 2, 21, 92, -62, 120, -25, 123,-122, - 1, 116, 92,-122, -17, 84, -22, 18, 32, 114, 117, -49, -30, 118, 67, 62, - 1, -31, -67, 21, 120, -122, -73, -50, 8, 9, -22, -89, -68, 52, -70, 114, - 1, -61, 123, -50, -34, 18, -70, -99, 128, -98, 67, 25, 17, -9, 35, -79 -}; - -#ifdef DEVICE_DIRECT_CONSTANTS -__constant__ short c_FFT256_2_128_Twiddle[128] = { -#else -__constant__ short c_FFT256_2_128_Twiddle[128]; -static const short h_FFT256_2_128_Twiddle[128] = { -#endif - 1, 41,-118, 45, 46, 87, -31, 14, - 60,-110, 116,-127, -67, 80, -61, 69, - 2, 82, 21, 90, 92, -83, -62, 28, - 120, 37, -25, 3, 123, -97,-122,-119, - 4, -93, 42, -77, -73, 91,-124, 56, - -17, 74, -50, 6, -11, 63, 13, 19, - 8, 71, 84, 103, 111, -75, 9, 112, - -34,-109,-100, 12, -22, 126, 26, 38, - 16,-115, -89, -51, -35, 107, 18, -33, - -68, 39, 57, 24, -44, -5, 52, 76, - 32, 27, 79,-102, -70, -43, 36, -66, - 121, 78, 114, 48, -88, -10, 104,-105, - 64, 54, -99, 53, 117, -86, 72, 125, - -15,-101, -29, 96, 81, -20, -49, 47, - 128, 108, 59, 106, -23, 85,-113, -7, - -30, 55, -58, -65, -95, -40, -98, 94 -}; - -/************* the round function ****************/ -#define IF(x, y, z) (((y ^ z) & x) ^ z) -#define MAJ(x, y, z) ((z &y) | ((z|y) & x)) - -#include "cuda_x11_simd512_sm2.cuh" -#include "cuda_x11_simd512_func.cuh" - -#ifdef __INTELLISENSE__ -/* just for vstudio code colors */ -#define __CUDA_ARCH__ 500 -#endif - -#if __CUDA_ARCH__ >= 300 - -/********************* Message expansion ************************/ - -/* - * Reduce modulo 257; result is in [-127; 383] - * REDUCE(x) := (x&255) - (x>>8) - */ -#define REDUCE(x) \ - (((x)&255) - ((x)>>8)) - -/* - * Reduce from [-127; 383] to [-128; 128] - * EXTRA_REDUCE_S(x) := x<=128 ? x : x-257 - */ -#define EXTRA_REDUCE_S(x) \ - ((x)<=128 ? (x) : (x)-257) - -/* - * Reduce modulo 257; result is in [-128; 128] - */ -#define REDUCE_FULL_S(x) \ - EXTRA_REDUCE_S(REDUCE(x)) - -// Parallelization: -// -// FFT_8 wird 2 times 8-fach parallel ausgeführt (in FFT_64) -// and 1 time 16-fach parallel (in FFT_128_full) -// -// STEP8_IF and STEP8_MAJ beinhalten je 2x 8-fach parallel Operations - -/** - * FFT_8 using w=4 as 8th root of unity - * Unrolled decimation in frequency (DIF) radix-2 NTT. - * Output data is in revbin_permuted order. - */ -__device__ __forceinline__ -void FFT_8(int *y, int stripe) -{ -#define X(i) y[stripe*i] - -#define DO_REDUCE(i) \ - X(i) = REDUCE(X(i)) - -#define DO_REDUCE_FULL_S(i) \ -do { \ - X(i) = REDUCE(X(i)); \ - X(i) = EXTRA_REDUCE_S(X(i)); \ -} while(0) - -#define BUTTERFLY(i,j,n) \ -do { \ - int u= X(i); \ - int v= X(j); \ - X(i) = u+v; \ - X(j) = (u-v) << (2*n); \ -} while(0) - - BUTTERFLY(0, 4, 0); - BUTTERFLY(1, 5, 1); - BUTTERFLY(2, 6, 2); - BUTTERFLY(3, 7, 3); - - DO_REDUCE(6); - DO_REDUCE(7); - - BUTTERFLY(0, 2, 0); - BUTTERFLY(4, 6, 0); - BUTTERFLY(1, 3, 2); - BUTTERFLY(5, 7, 2); - - DO_REDUCE(7); - - BUTTERFLY(0, 1, 0); - BUTTERFLY(2, 3, 0); - BUTTERFLY(4, 5, 0); - BUTTERFLY(6, 7, 0); - - DO_REDUCE_FULL_S(0); - DO_REDUCE_FULL_S(1); - DO_REDUCE_FULL_S(2); - DO_REDUCE_FULL_S(3); - DO_REDUCE_FULL_S(4); - DO_REDUCE_FULL_S(5); - DO_REDUCE_FULL_S(6); - DO_REDUCE_FULL_S(7); - -#undef X -#undef DO_REDUCE -#undef DO_REDUCE_FULL_S -#undef BUTTERFLY -} - -#if defined(__CUDA_ARCH__) -#if __CUDA_ARCH__ < 300 - #define __shfl(var, srcLane, width) (uint32_t)(var) - // #error __shfl() not supported by SM 2.x -#endif -#endif - -/** - * FFT_16 using w=2 as 16th root of unity - * Unrolled decimation in frequency (DIF) radix-2 NTT. - * Output data is in revbin_permuted order. - */ -__device__ __forceinline__ -void FFT_16(int *y) -{ -#define DO_REDUCE_FULL_S(i) \ - do { \ - y[i] = REDUCE(y[i]); \ - y[i] = EXTRA_REDUCE_S(y[i]); \ - } while(0) - - int u,v; - - // BUTTERFLY(0, 8, 0); - // BUTTERFLY(1, 9, 1); - // BUTTERFLY(2, 10, 2); - // BUTTERFLY(3, 11, 3); - // BUTTERFLY(4, 12, 4); - // BUTTERFLY(5, 13, 5); - // BUTTERFLY(6, 14, 6); - // BUTTERFLY(7, 15, 7); - { - u = y[0]; // 0..7 - v = y[1]; // 8..15 - y[0] = u+v; - y[1] = (u-v) << (threadIdx.x&7); - } - - // DO_REDUCE(11); - // DO_REDUCE(12); - // DO_REDUCE(13); - // DO_REDUCE(14); - // DO_REDUCE(15); - if ((threadIdx.x&7) >=3) y[1] = REDUCE(y[1]); // 11...15 - - // BUTTERFLY( 0, 4, 0); - // BUTTERFLY( 1, 5, 2); - // BUTTERFLY( 2, 6, 4); - // BUTTERFLY( 3, 7, 6); - { - u = __shfl((int)y[0], (threadIdx.x&3),8); // 0,1,2,3 0,1,2,3 - v = __shfl((int)y[0],4+(threadIdx.x&3),8); // 4,5,6,7 4,5,6,7 - y[0] = ((threadIdx.x&7) < 4) ? (u+v) : ((u-v) << (2*(threadIdx.x&3))); - } - - // BUTTERFLY( 8, 12, 0); - // BUTTERFLY( 9, 13, 2); - // BUTTERFLY(10, 14, 4); - // BUTTERFLY(11, 15, 6); - { - u = __shfl((int)y[1], (threadIdx.x&3),8); // 8,9,10,11 8,9,10,11 - v = __shfl((int)y[1],4+(threadIdx.x&3),8); // 12,13,14,15 12,13,14,15 - y[1] = ((threadIdx.x&7) < 4) ? (u+v) : ((u-v) << (2*(threadIdx.x&3))); - } - - // DO_REDUCE(5); - // DO_REDUCE(7); - // DO_REDUCE(13); - // DO_REDUCE(15); - if ((threadIdx.x&1) && (threadIdx.x&7) >= 4) { - y[0] = REDUCE(y[0]); // 5, 7 - y[1] = REDUCE(y[1]); // 13, 15 - } - - // BUTTERFLY( 0, 2, 0); - // BUTTERFLY( 1, 3, 4); - // BUTTERFLY( 4, 6, 0); - // BUTTERFLY( 5, 7, 4); - { - u = __shfl((int)y[0], (threadIdx.x&5),8); // 0,1,0,1 4,5,4,5 - v = __shfl((int)y[0],2+(threadIdx.x&5),8); // 2,3,2,3 6,7,6,7 - y[0] = ((threadIdx.x&3) < 2) ? (u+v) : ((u-v) << (4*(threadIdx.x&1))); - } - - // BUTTERFLY( 8, 10, 0); - // BUTTERFLY( 9, 11, 4); - // BUTTERFLY(12, 14, 0); - // BUTTERFLY(13, 15, 4); - { - u = __shfl((int)y[1], (threadIdx.x&5),8); // 8,9,8,9 12,13,12,13 - v = __shfl((int)y[1],2+(threadIdx.x&5),8); // 10,11,10,11 14,15,14,15 - y[1] = ((threadIdx.x&3) < 2) ? (u+v) : ((u-v) << (4*(threadIdx.x&1))); - } - - // BUTTERFLY( 0, 1, 0); - // BUTTERFLY( 2, 3, 0); - // BUTTERFLY( 4, 5, 0); - // BUTTERFLY( 6, 7, 0); - { - u = __shfl((int)y[0], (threadIdx.x&6),8); // 0,0,2,2 4,4,6,6 - v = __shfl((int)y[0],1+(threadIdx.x&6),8); // 1,1,3,3 5,5,7,7 - y[0] = ((threadIdx.x&1) < 1) ? (u+v) : (u-v); - } - - // BUTTERFLY( 8, 9, 0); - // BUTTERFLY(10, 11, 0); - // BUTTERFLY(12, 13, 0); - // BUTTERFLY(14, 15, 0); - { - u = __shfl((int)y[1], (threadIdx.x&6),8); // 8,8,10,10 12,12,14,14 - v = __shfl((int)y[1],1+(threadIdx.x&6),8); // 9,9,11,11 13,13,15,15 - y[1] = ((threadIdx.x&1) < 1) ? (u+v) : (u-v); - } - - DO_REDUCE_FULL_S( 0); // 0...7 - DO_REDUCE_FULL_S( 1); // 8...15 - -#undef DO_REDUCE_FULL_S -} - -__device__ __forceinline__ -void FFT_128_full(int y[128]) -{ - int i; - - FFT_8(y+0,2); // eight parallel FFT8's - FFT_8(y+1,2); // eight parallel FFT8's - -#pragma unroll 16 - for (i=0; i<16; i++) - /*if (i & 7)*/ y[i] = REDUCE(y[i]*c_FFT128_8_16_Twiddle[i*8+(threadIdx.x&7)]); - -#pragma unroll 8 - for (i=0; i<8; i++) - FFT_16(y+2*i); // eight sequential FFT16's, each one executed in parallel by 8 threads -} - -__device__ __forceinline__ -void FFT_256_halfzero(int y[256]) -{ - /* - * FFT_256 using w=41 as 256th root of unity. - * Decimation in frequency (DIF) NTT. - * Output data is in revbin_permuted order. - * In place. - */ - const int tmp = y[15]; - -#pragma unroll 8 - for (int i=0; i<8; i++) - y[16+i] = REDUCE(y[i] * c_FFT256_2_128_Twiddle[8*i+(threadIdx.x&7)]); -#pragma unroll 8 - for (int i=8; i<16; i++) - y[16+i] = 0; - - /* handle X^255 with an additional butterfly */ - if ((threadIdx.x&7) == 7) - { - y[15] = REDUCE(tmp + 1); - y[31] = REDUCE((tmp - 1) * c_FFT256_2_128_Twiddle[127]); - } - - FFT_128_full(y); - FFT_128_full(y+16); -} - -/***************************************************/ - -__device__ __forceinline__ -void Expansion(const uint32_t *data, uint4 *g_temp4) -{ - /* Message Expansion using Number Theoretical Transform similar to FFT */ - int expanded[32]; -#pragma unroll 4 - for (int i=0; i < 4; i++) { - expanded[ i] = __byte_perm(__shfl((int)data[0], 2*i, 8), __shfl((int)data[0], (2*i)+1, 8), threadIdx.x&7)&0xff; - expanded[4+i] = __byte_perm(__shfl((int)data[1], 2*i, 8), __shfl((int)data[1], (2*i)+1, 8), threadIdx.x&7)&0xff; - } -#pragma unroll 8 - for (int i=8; i < 16; i++) - expanded[i] = 0; - - FFT_256_halfzero(expanded); - - // store w matrices in global memory - -#define mul_185(x) ( (x)*185 ) -#define mul_233(x) ( (x)*233 ) - - uint4 vec0; - int P, Q, P1, Q1, P2, Q2; - bool even = (threadIdx.x & 1) == 0; - -// 0 8 4 12 2 10 6 14 16 24 20 28 18 26 22 30 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 -// 0 8 4 12 2 10 6 14 16 24 20 28 18 26 22 30 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 -// 0 8 4 12 2 10 6 14 16 24 20 28 18 26 22 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -// 0 8 4 12 2 10 6 14 16 24 20 28 18 26 22 30 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 - - // 2 6 0 4 - - P1 = expanded[ 0]; P2 = __shfl(expanded[ 2], (threadIdx.x-1)&7, 8); P = even ? P1 : P2; - Q1 = expanded[16]; Q2 = __shfl(expanded[18], (threadIdx.x-1)&7, 8); Q = even ? Q1 : Q2; - vec0.x = __shfl((int)__byte_perm(mul_185(P), mul_185(Q) , 0x5410), c_perm[0][threadIdx.x&7], 8); - P1 = expanded[ 8]; P2 = __shfl(expanded[10], (threadIdx.x-1)&7, 8); P = even ? P1 : P2; - Q1 = expanded[24]; Q2 = __shfl(expanded[26], (threadIdx.x-1)&7, 8); Q = even ? Q1 : Q2; - vec0.y = __shfl((int)__byte_perm(mul_185(P), mul_185(Q) , 0x5410), c_perm[0][threadIdx.x&7], 8); - P1 = expanded[ 4]; P2 = __shfl(expanded[ 6], (threadIdx.x-1)&7, 8); P = even ? P1 : P2; - Q1 = expanded[20]; Q2 = __shfl(expanded[22], (threadIdx.x-1)&7, 8); Q = even ? Q1 : Q2; - vec0.z = __shfl((int)__byte_perm(mul_185(P), mul_185(Q) , 0x5410), c_perm[0][threadIdx.x&7], 8); - P1 = expanded[12]; P2 = __shfl(expanded[14], (threadIdx.x-1)&7, 8); P = even ? P1 : P2; - Q1 = expanded[28]; Q2 = __shfl(expanded[30], (threadIdx.x-1)&7, 8); Q = even ? Q1 : Q2; - vec0.w = __shfl((int)__byte_perm(mul_185(P), mul_185(Q) , 0x5410), c_perm[0][threadIdx.x&7], 8); - g_temp4[threadIdx.x&7] = vec0; - -// 1 9 5 13 3 11 7 15 17 25 21 29 19 27 23 31 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 -// 1 9 5 13 3 11 7 15 17 25 21 29 19 27 23 31 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 -// 1 9 5 13 3 11 7 15 17 25 21 29 19 27 23 31 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 -// 1 9 5 13 3 11 7 15 17 25 21 29 19 27 23 31 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - - // 6 2 4 0 - - P1 = expanded[ 1]; P2 = __shfl(expanded[ 3], (threadIdx.x-1)&7, 8); P = even ? P1 : P2; - Q1 = expanded[17]; Q2 = __shfl(expanded[19], (threadIdx.x-1)&7, 8); Q = even ? Q1 : Q2; - vec0.x = __shfl((int)__byte_perm(mul_185(P), mul_185(Q) , 0x5410), c_perm[1][threadIdx.x&7], 8); - P1 = expanded[ 9]; P2 = __shfl(expanded[11], (threadIdx.x-1)&7, 8); P = even ? P1 : P2; - Q1 = expanded[25]; Q2 = __shfl(expanded[27], (threadIdx.x-1)&7, 8); Q = even ? Q1 : Q2; - vec0.y = __shfl((int)__byte_perm(mul_185(P), mul_185(Q) , 0x5410), c_perm[1][threadIdx.x&7], 8); - P1 = expanded[ 5]; P2 = __shfl(expanded[ 7], (threadIdx.x-1)&7, 8); P = even ? P1 : P2; - Q1 = expanded[21]; Q2 = __shfl(expanded[23], (threadIdx.x-1)&7, 8); Q = even ? Q1 : Q2; - vec0.z = __shfl((int)__byte_perm(mul_185(P), mul_185(Q) , 0x5410), c_perm[1][threadIdx.x&7], 8); - P1 = expanded[13]; P2 = __shfl(expanded[15], (threadIdx.x-1)&7, 8); P = even ? P1 : P2; - Q1 = expanded[29]; Q2 = __shfl(expanded[31], (threadIdx.x-1)&7, 8); Q = even ? Q1 : Q2; - vec0.w = __shfl((int)__byte_perm(mul_185(P), mul_185(Q) , 0x5410), c_perm[1][threadIdx.x&7], 8); - g_temp4[8+(threadIdx.x&7)] = vec0; - -// 1 9 5 13 3 11 7 15 17 25 21 29 19 27 23 31 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 -// 1 9 5 13 3 11 7 15 17 25 21 29 19 27 23 31 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 -// 0 8 4 12 2 10 6 14 16 24 20 28 18 26 22 30 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 -// 0 8 4 12 2 10 6 14 16 24 20 28 18 26 22 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - - // 7 5 3 1 - - bool hi = (threadIdx.x&7)>=4; - - P1 = hi?expanded[ 1]:expanded[ 0]; P2 = __shfl(hi?expanded[ 3]:expanded[ 2], (threadIdx.x+1)&7, 8); P = !even ? P1 : P2; - Q1 = hi?expanded[17]:expanded[16]; Q2 = __shfl(hi?expanded[19]:expanded[18], (threadIdx.x+1)&7, 8); Q = !even ? Q1 : Q2; - vec0.x = __shfl((int)__byte_perm(mul_185(P), mul_185(Q) , 0x5410), c_perm[2][threadIdx.x&7], 8); - P1 = hi?expanded[ 9]:expanded[ 8]; P2 = __shfl(hi?expanded[11]:expanded[10], (threadIdx.x+1)&7, 8); P = !even ? P1 : P2; - Q1 = hi?expanded[25]:expanded[24]; Q2 = __shfl(hi?expanded[27]:expanded[26], (threadIdx.x+1)&7, 8); Q = !even ? Q1 : Q2; - vec0.y = __shfl((int)__byte_perm(mul_185(P), mul_185(Q) , 0x5410), c_perm[2][threadIdx.x&7], 8); - P1 = hi?expanded[ 5]:expanded[ 4]; P2 = __shfl(hi?expanded[ 7]:expanded[ 6], (threadIdx.x+1)&7, 8); P = !even ? P1 : P2; - Q1 = hi?expanded[21]:expanded[20]; Q2 = __shfl(hi?expanded[23]:expanded[22], (threadIdx.x+1)&7, 8); Q = !even ? Q1 : Q2; - vec0.z = __shfl((int)__byte_perm(mul_185(P), mul_185(Q) , 0x5410), c_perm[2][threadIdx.x&7], 8); - P1 = hi?expanded[13]:expanded[12]; P2 = __shfl(hi?expanded[15]:expanded[14], (threadIdx.x+1)&7, 8); P = !even ? P1 : P2; - Q1 = hi?expanded[29]:expanded[28]; Q2 = __shfl(hi?expanded[31]:expanded[30], (threadIdx.x+1)&7, 8); Q = !even ? Q1 : Q2; - vec0.w = __shfl((int)__byte_perm(mul_185(P), mul_185(Q) , 0x5410), c_perm[2][threadIdx.x&7], 8); - g_temp4[16+(threadIdx.x&7)] = vec0; - -// 1 9 5 13 3 11 7 15 17 25 21 29 19 27 23 31 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -// 1 9 5 13 3 11 7 15 17 25 21 29 19 27 23 31 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 -// 0 8 4 12 2 10 6 14 16 24 20 28 18 26 22 30 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 -// 0 8 4 12 2 10 6 14 16 24 20 28 18 26 22 30 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 - - // 1 3 5 7 - - bool lo = (threadIdx.x&7)<4; - - P1 = lo?expanded[ 1]:expanded[ 0]; P2 = __shfl(lo?expanded[ 3]:expanded[ 2], (threadIdx.x+1)&7, 8); P = !even ? P1 : P2; - Q1 = lo?expanded[17]:expanded[16]; Q2 = __shfl(lo?expanded[19]:expanded[18], (threadIdx.x+1)&7, 8); Q = !even ? Q1 : Q2; - vec0.x = __shfl((int)__byte_perm(mul_185(P), mul_185(Q) , 0x5410), c_perm[3][threadIdx.x&7], 8); - P1 = lo?expanded[ 9]:expanded[ 8]; P2 = __shfl(lo?expanded[11]:expanded[10], (threadIdx.x+1)&7, 8); P = !even ? P1 : P2; - Q1 = lo?expanded[25]:expanded[24]; Q2 = __shfl(lo?expanded[27]:expanded[26], (threadIdx.x+1)&7, 8); Q = !even ? Q1 : Q2; - vec0.y = __shfl((int)__byte_perm(mul_185(P), mul_185(Q) , 0x5410), c_perm[3][threadIdx.x&7], 8); - P1 = lo?expanded[ 5]:expanded[ 4]; P2 = __shfl(lo?expanded[ 7]:expanded[ 6], (threadIdx.x+1)&7, 8); P = !even ? P1 : P2; - Q1 = lo?expanded[21]:expanded[20]; Q2 = __shfl(lo?expanded[23]:expanded[22], (threadIdx.x+1)&7, 8); Q = !even ? Q1 : Q2; - vec0.z = __shfl((int)__byte_perm(mul_185(P), mul_185(Q) , 0x5410), c_perm[3][threadIdx.x&7], 8); - P1 = lo?expanded[13]:expanded[12]; P2 = __shfl(lo?expanded[15]:expanded[14], (threadIdx.x+1)&7, 8); P = !even ? P1 : P2; - Q1 = lo?expanded[29]:expanded[28]; Q2 = __shfl(lo?expanded[31]:expanded[30], (threadIdx.x+1)&7, 8); Q = !even ? Q1 : Q2; - vec0.w = __shfl((int)__byte_perm(mul_185(P), mul_185(Q) , 0x5410), c_perm[3][threadIdx.x&7], 8); - g_temp4[24+(threadIdx.x&7)] = vec0; - -// 1 9 5 13 3 11 7 15 1 9 5 13 3 11 7 15 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 -// 0 8 4 12 2 10 6 14 0 8 4 12 2 10 6 14 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 -// 1 9 5 13 3 11 7 15 1 9 5 13 3 11 7 15 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 -// 0 8 4 12 2 10 6 14 0 8 4 12 2 10 6 14 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 - -//{ 8, 72, 40, 104, 24, 88, 56, 120 }, { 9, 73, 41, 105, 25, 89, 57, 121 }, -//{ 4, 68, 36, 100, 20, 84, 52, 116 }, { 5, 69, 37, 101, 21, 85, 53, 117 }, -//{ 14, 78, 46, 110, 30, 94, 62, 126 }, { 15, 79, 47, 111, 31, 95, 63, 127 }, -//{ 2, 66, 34, 98, 18, 82, 50, 114 }, { 3, 67, 35, 99, 19, 83, 51, 115 }, - - bool sel = ((threadIdx.x+2)&7) >= 4; // 2,3,4,5 - - P1 = sel?expanded[0]:expanded[1]; Q1 = __shfl(P1, threadIdx.x^1, 8); - Q2 = sel?expanded[2]:expanded[3]; P2 = __shfl(Q2, threadIdx.x^1, 8); - P = even? P1 : P2; Q = even? Q1 : Q2; - vec0.x = __shfl((int)__byte_perm(mul_233(P), mul_233(Q) , 0x5410), c_perm[4][threadIdx.x&7], 8); - P1 = sel?expanded[8]:expanded[9]; Q1 = __shfl(P1, threadIdx.x^1, 8); - Q2 = sel?expanded[10]:expanded[11]; P2 = __shfl(Q2, threadIdx.x^1, 8); - P = even? P1 : P2; Q = even? Q1 : Q2; - vec0.y = __shfl((int)__byte_perm(mul_233(P), mul_233(Q) , 0x5410), c_perm[4][threadIdx.x&7], 8); - P1 = sel?expanded[4]:expanded[5]; Q1 = __shfl(P1, threadIdx.x^1, 8); - Q2 = sel?expanded[6]:expanded[7]; P2 = __shfl(Q2, threadIdx.x^1, 8); - P = even? P1 : P2; Q = even? Q1 : Q2; - vec0.z = __shfl((int)__byte_perm(mul_233(P), mul_233(Q) , 0x5410), c_perm[4][threadIdx.x&7], 8); - P1 = sel?expanded[12]:expanded[13]; Q1 = __shfl(P1, threadIdx.x^1, 8); - Q2 = sel?expanded[14]:expanded[15]; P2 = __shfl(Q2, threadIdx.x^1, 8); - P = even? P1 : P2; Q = even? Q1 : Q2; - vec0.w = __shfl((int)__byte_perm(mul_233(P), mul_233(Q) , 0x5410), c_perm[4][threadIdx.x&7], 8); - - g_temp4[32+(threadIdx.x&7)] = vec0; - -// 0 8 4 12 2 10 6 14 0 8 4 12 2 10 6 14 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 -// 1 9 5 13 3 11 7 15 1 9 5 13 3 11 7 15 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 -// 0 8 4 12 2 10 6 14 0 8 4 12 2 10 6 14 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 -// 1 9 5 13 3 11 7 15 1 9 5 13 3 11 7 15 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 - - P1 = sel?expanded[1]:expanded[0]; Q1 = __shfl(P1, threadIdx.x^1, 8); - Q2 = sel?expanded[3]:expanded[2]; P2 = __shfl(Q2, threadIdx.x^1, 8); - P = even? P1 : P2; Q = even? Q1 : Q2; - vec0.x = __shfl((int)__byte_perm(mul_233(P), mul_233(Q) , 0x5410), c_perm[5][threadIdx.x&7], 8); - P1 = sel?expanded[9]:expanded[8]; Q1 = __shfl(P1, threadIdx.x^1, 8); - Q2 = sel?expanded[11]:expanded[10]; P2 = __shfl(Q2, threadIdx.x^1, 8); - P = even? P1 : P2; Q = even? Q1 : Q2; - vec0.y = __shfl((int)__byte_perm(mul_233(P), mul_233(Q) , 0x5410), c_perm[5][threadIdx.x&7], 8); - P1 = sel?expanded[5]:expanded[4]; Q1 = __shfl(P1, threadIdx.x^1, 8); - Q2 = sel?expanded[7]:expanded[6]; P2 = __shfl(Q2, threadIdx.x^1, 8); - P = even? P1 : P2; Q = even? Q1 : Q2; - vec0.z = __shfl((int)__byte_perm(mul_233(P), mul_233(Q) , 0x5410), c_perm[5][threadIdx.x&7], 8); - P1 = sel?expanded[13]:expanded[12]; Q1 = __shfl(P1, threadIdx.x^1, 8); - Q2 = sel?expanded[15]:expanded[14]; P2 = __shfl(Q2, threadIdx.x^1, 8); - P = even? P1 : P2; Q = even? Q1 : Q2; - vec0.w = __shfl((int)__byte_perm(mul_233(P), mul_233(Q) , 0x5410), c_perm[5][threadIdx.x&7], 8); - - g_temp4[40+(threadIdx.x&7)] = vec0; - -// 16 24 20 28 18 26 22 30 16 24 20 28 18 26 22 30 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 -// 16 24 20 28 18 26 22 30 16 24 20 28 18 26 22 30 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 -// 17 25 21 29 19 27 23 31 17 25 21 29 19 27 23 31 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 -// 17 25 21 29 19 27 23 31 17 25 21 29 19 27 23 31 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 - - // sel markiert threads 2,3,4,5 - - int t; - t = __shfl(expanded[17],(threadIdx.x+4)&7,8); P1 = sel?t:expanded[16]; Q1 = __shfl(P1, threadIdx.x^1, 8); - t = __shfl(expanded[19],(threadIdx.x+4)&7,8); Q2 = sel?t:expanded[18]; P2 = __shfl(Q2, threadIdx.x^1, 8); - P = even? P1 : P2; Q = even? Q1 : Q2; - vec0.x = __shfl((int)__byte_perm(mul_233(P), mul_233(Q) , 0x5410), c_perm[6][threadIdx.x&7], 8); - t = __shfl(expanded[25],(threadIdx.x+4)&7,8); P1 = sel?t:expanded[24]; Q1 = __shfl(P1, threadIdx.x^1, 8); - t = __shfl(expanded[27],(threadIdx.x+4)&7,8); Q2 = sel?t:expanded[26]; P2 = __shfl(Q2, threadIdx.x^1, 8); - P = even? P1 : P2; Q = even? Q1 : Q2; - vec0.y = __shfl((int)__byte_perm(mul_233(P), mul_233(Q) , 0x5410), c_perm[6][threadIdx.x&7], 8); - t = __shfl(expanded[21],(threadIdx.x+4)&7,8); P1 = sel?t:expanded[20]; Q1 = __shfl(P1, threadIdx.x^1, 8); - t = __shfl(expanded[23],(threadIdx.x+4)&7,8); Q2 = sel?t:expanded[22]; P2 = __shfl(Q2, threadIdx.x^1, 8); - P = even? P1 : P2; Q = even? Q1 : Q2; - vec0.z = __shfl((int)__byte_perm(mul_233(P), mul_233(Q) , 0x5410), c_perm[6][threadIdx.x&7], 8); - t = __shfl(expanded[29],(threadIdx.x+4)&7,8); P1 = sel?t:expanded[28]; Q1 = __shfl(P1, threadIdx.x^1, 8); - t = __shfl(expanded[31],(threadIdx.x+4)&7,8); Q2 = sel?t:expanded[30]; P2 = __shfl(Q2, threadIdx.x^1, 8); - P = even? P1 : P2; Q = even? Q1 : Q2; - vec0.w = __shfl((int)__byte_perm(mul_233(P), mul_233(Q) , 0x5410), c_perm[6][threadIdx.x&7], 8); - - g_temp4[48+(threadIdx.x&7)] = vec0; - -// 17 25 21 29 19 27 23 31 17 25 21 29 19 27 23 31 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 -// 17 25 21 29 19 27 23 31 17 25 21 29 19 27 23 31 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 -// 16 24 20 28 18 26 22 30 16 24 20 28 18 26 22 30 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 -// 16 24 20 28 18 26 22 30 16 24 20 28 18 26 22 30 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 - - // sel markiert threads 2,3,4,5 - - t = __shfl(expanded[16],(threadIdx.x+4)&7,8); P1 = sel?expanded[17]:t; Q1 = __shfl(P1, threadIdx.x^1, 8); - t = __shfl(expanded[18],(threadIdx.x+4)&7,8); Q2 = sel?expanded[19]:t; P2 = __shfl(Q2, threadIdx.x^1, 8); - P = even? P1 : P2; Q = even? Q1 : Q2; - vec0.x = __shfl((int)__byte_perm(mul_233(P), mul_233(Q) , 0x5410), c_perm[7][threadIdx.x&7], 8); - t = __shfl(expanded[24],(threadIdx.x+4)&7,8); P1 = sel?expanded[25]:t; Q1 = __shfl(P1, threadIdx.x^1, 8); - t = __shfl(expanded[26],(threadIdx.x+4)&7,8); Q2 = sel?expanded[27]:t; P2 = __shfl(Q2, threadIdx.x^1, 8); - P = even? P1 : P2; Q = even? Q1 : Q2; - vec0.y = __shfl((int)__byte_perm(mul_233(P), mul_233(Q) , 0x5410), c_perm[7][threadIdx.x&7], 8); - t = __shfl(expanded[20],(threadIdx.x+4)&7,8); P1 = sel?expanded[21]:t; Q1 = __shfl(P1, threadIdx.x^1, 8); - t = __shfl(expanded[22],(threadIdx.x+4)&7,8); Q2 = sel?expanded[23]:t; P2 = __shfl(Q2, threadIdx.x^1, 8); - P = even? P1 : P2; Q = even? Q1 : Q2; - vec0.z = __shfl((int)__byte_perm(mul_233(P), mul_233(Q) , 0x5410), c_perm[7][threadIdx.x&7], 8); - t = __shfl(expanded[28],(threadIdx.x+4)&7,8); P1 = sel?expanded[29]:t; Q1 = __shfl(P1, threadIdx.x^1, 8); - t = __shfl(expanded[30],(threadIdx.x+4)&7,8); Q2 = sel?expanded[31]:t; P2 = __shfl(Q2, threadIdx.x^1, 8); - P = even? P1 : P2; Q = even? Q1 : Q2; - vec0.w = __shfl((int)__byte_perm(mul_233(P), mul_233(Q) , 0x5410), c_perm[7][threadIdx.x&7], 8); - - g_temp4[56+(threadIdx.x&7)] = vec0; - -#undef mul_185 -#undef mul_233 -} - -/***************************************************/ - -__global__ __launch_bounds__(TPB, 4) -void x11_simd512_gpu_expand_64(uint32_t threads, uint32_t *g_hash, uint4 *g_temp4) -{ - int threadBloc = (blockDim.x * blockIdx.x + threadIdx.x) / 8; - if (threadBloc < threads) - { - int hashPosition = threadBloc * 16; - uint32_t *inpHash = &g_hash[hashPosition]; - - // Read hash per 8 threads - uint32_t Hash[2]; - int ndx = threadIdx.x & 7; - Hash[0] = inpHash[ndx]; - Hash[1] = inpHash[ndx + 8]; - - // Puffer für expandierte Nachricht - uint4 *temp4 = &g_temp4[hashPosition * 4]; - - Expansion(Hash, temp4); - } -} - -__global__ __launch_bounds__(TPB, 1) -void x11_simd512_gpu_compress1_64(uint32_t threads, uint32_t *g_hash, uint4 *g_fft4, uint32_t *g_state) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t *Hash = &g_hash[thread * 16]; - Compression1(Hash, thread, g_fft4, g_state); - } -} - -__global__ __launch_bounds__(TPB, 1) -void x11_simd512_gpu_compress2_64(uint32_t threads, uint4 *g_fft4, uint32_t *g_state) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - Compression2(thread, g_fft4, g_state); - } -} - -__global__ __launch_bounds__(TPB, 2) -void x11_simd512_gpu_compress_64_maxwell(uint32_t threads, uint32_t *g_hash, uint4 *g_fft4, uint32_t *g_state) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t *Hash = &g_hash[thread * 16]; - Compression1(Hash, thread, g_fft4, g_state); - Compression2(thread, g_fft4, g_state); - } -} - -__global__ __launch_bounds__(TPB, 2) -void x11_simd512_gpu_final_64(uint32_t threads, uint32_t *g_hash, uint4 *g_fft4, uint32_t *g_state) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t *Hash = &g_hash[thread * 16]; - Final(Hash, thread, g_fft4, g_state); - } -} - -#else -__global__ void x11_simd512_gpu_expand_64(uint32_t threads, uint32_t *g_hash, uint4 *g_temp4) {} -__global__ void x11_simd512_gpu_compress1_64(uint32_t threads, uint32_t *g_hash, uint4 *g_fft4, uint32_t *g_state) {} -__global__ void x11_simd512_gpu_compress2_64(uint32_t threads, uint4 *g_fft4, uint32_t *g_state) {} -__global__ void x11_simd512_gpu_compress_64_maxwell(uint32_t threads, uint32_t *g_hash, uint4 *g_fft4, uint32_t *g_state) {} -__global__ void x11_simd512_gpu_final_64(uint32_t threads, uint32_t *g_hash, uint4 *g_fft4, uint32_t *g_state) {} -#endif /* SM3+ */ - -__host__ -int x11_simd512_cpu_init(int thr_id, uint32_t threads) -{ - int dev_id = device_map[thr_id]; - cuda_get_arch(thr_id); - if (device_sm[dev_id] < 300 || cuda_arch[dev_id] < 300) { - x11_simd512_cpu_init_sm2(thr_id); - return 0; - } - - CUDA_CALL_OR_RET_X(cudaMalloc(&d_temp4[thr_id], 64*sizeof(uint4)*threads), (int) err); /* todo: prevent -i 21 */ - CUDA_CALL_OR_RET_X(cudaMalloc(&d_state[thr_id], 32*sizeof(int)*threads), (int) err); - -#ifndef DEVICE_DIRECT_CONSTANTS - cudaMemcpyToSymbol(c_perm, h_perm, sizeof(h_perm), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(c_IV_512, h_IV_512, sizeof(h_IV_512), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(c_FFT128_8_16_Twiddle, h_FFT128_8_16_Twiddle, sizeof(h_FFT128_8_16_Twiddle), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(c_FFT256_2_128_Twiddle, h_FFT256_2_128_Twiddle, sizeof(h_FFT256_2_128_Twiddle), 0, cudaMemcpyHostToDevice); - - cudaMemcpyToSymbol(d_cw0, h_cw0, sizeof(h_cw0), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(d_cw1, h_cw1, sizeof(h_cw1), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(d_cw2, h_cw2, sizeof(h_cw2), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(d_cw3, h_cw3, sizeof(h_cw3), 0, cudaMemcpyHostToDevice); -#endif - - // Texture for 128-Bit Zugriffe - cudaChannelFormatDesc channelDesc128 = cudaCreateChannelDesc(); - texRef1D_128.normalized = 0; - texRef1D_128.filterMode = cudaFilterModePoint; - texRef1D_128.addressMode[0] = cudaAddressModeClamp; - - CUDA_CALL_OR_RET_X(cudaBindTexture(NULL, &texRef1D_128, d_temp4[thr_id], &channelDesc128, 64*sizeof(uint4)*threads), (int) err); - - return 0; -} - -__host__ -void x11_simd512_cpu_free(int thr_id) -{ - int dev_id = device_map[thr_id]; - if (device_sm[dev_id] >= 300 && cuda_arch[dev_id] >= 300) { - cudaFree(d_temp4[thr_id]); - cudaFree(d_state[thr_id]); - } -} - -__host__ -void x11_simd512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order) -{ - const uint32_t threadsperblock = TPB; - int dev_id = device_map[thr_id]; - - dim3 block(threadsperblock); - dim3 grid((threads + threadsperblock-1) / threadsperblock); - dim3 gridX8(grid.x * 8); - - if (d_nonceVector != NULL || device_sm[dev_id] < 300 || cuda_arch[dev_id] < 300) { - x11_simd512_cpu_hash_64_sm2(thr_id, threads, startNounce, d_nonceVector, d_hash, order); - return; - } - - x11_simd512_gpu_expand_64 <<>> (threads, d_hash, d_temp4[thr_id]); - - if (device_sm[dev_id] >= 500 && cuda_arch[dev_id] >= 500) { - x11_simd512_gpu_compress_64_maxwell <<< grid, block >>> (threads, d_hash, d_temp4[thr_id], d_state[thr_id]); - } else { - x11_simd512_gpu_compress1_64 <<< grid, block >>> (threads, d_hash, d_temp4[thr_id], d_state[thr_id]); - x11_simd512_gpu_compress2_64 <<< grid, block >>> (threads, d_temp4[thr_id], d_state[thr_id]); - } - - x11_simd512_gpu_final_64 <<>> (threads, d_hash, d_temp4[thr_id], d_state[thr_id]); - - //MyStreamSynchronize(NULL, order, thr_id); -} diff --git a/x11/cuda_x11_simd512_func.cuh b/x11/cuda_x11_simd512_func.cuh deleted file mode 100644 index f61eaa4f..00000000 --- a/x11/cuda_x11_simd512_func.cuh +++ /dev/null @@ -1,1396 +0,0 @@ -#define SIMD_FUNCTIONS_CUH - -__device__ __forceinline__ void STEP8_IF_0(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for(int j=0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + IF(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[1]; - temp = D[1] + w[1] + IF(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[0]; - temp = D[2] + w[2] + IF(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[3]; - temp = D[3] + w[3] + IF(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[2]; - temp = D[4] + w[4] + IF(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[5]; - temp = D[5] + w[5] + IF(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[4]; - temp = D[6] + w[6] + IF(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[7]; - temp = D[7] + w[7] + IF(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[6]; -#pragma unroll 8 - for(int j=0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_IF_1(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + IF(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[6]; - temp = D[1] + w[1] + IF(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[7]; - temp = D[2] + w[2] + IF(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[4]; - temp = D[3] + w[3] + IF(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[5]; - temp = D[4] + w[4] + IF(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[2]; - temp = D[5] + w[5] + IF(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[3]; - temp = D[6] + w[6] + IF(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[0]; - temp = D[7] + w[7] + IF(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[1]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_IF_2(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + IF(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[2]; - temp = D[1] + w[1] + IF(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[3]; - temp = D[2] + w[2] + IF(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[0]; - temp = D[3] + w[3] + IF(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[1]; - temp = D[4] + w[4] + IF(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[6]; - temp = D[5] + w[5] + IF(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[7]; - temp = D[6] + w[6] + IF(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[4]; - temp = D[7] + w[7] + IF(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[5]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_IF_3(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + IF(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[3]; - temp = D[1] + w[1] + IF(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[2]; - temp = D[2] + w[2] + IF(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[1]; - temp = D[3] + w[3] + IF(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[0]; - temp = D[4] + w[4] + IF(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[7]; - temp = D[5] + w[5] + IF(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[6]; - temp = D[6] + w[6] + IF(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[5]; - temp = D[7] + w[7] + IF(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[4]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_MAJ_4(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + MAJ(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[5]; - temp = D[1] + w[1] + MAJ(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[4]; - temp = D[2] + w[2] + MAJ(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[7]; - temp = D[3] + w[3] + MAJ(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[6]; - temp = D[4] + w[4] + MAJ(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[1]; - temp = D[5] + w[5] + MAJ(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[0]; - temp = D[6] + w[6] + MAJ(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[3]; - temp = D[7] + w[7] + MAJ(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[2]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_MAJ_5(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + MAJ(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[7]; - temp = D[1] + w[1] + MAJ(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[6]; - temp = D[2] + w[2] + MAJ(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[5]; - temp = D[3] + w[3] + MAJ(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[4]; - temp = D[4] + w[4] + MAJ(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[3]; - temp = D[5] + w[5] + MAJ(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[2]; - temp = D[6] + w[6] + MAJ(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[1]; - temp = D[7] + w[7] + MAJ(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[0]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_MAJ_6(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + MAJ(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[4]; - temp = D[1] + w[1] + MAJ(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[5]; - temp = D[2] + w[2] + MAJ(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[6]; - temp = D[3] + w[3] + MAJ(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[7]; - temp = D[4] + w[4] + MAJ(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[0]; - temp = D[5] + w[5] + MAJ(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[1]; - temp = D[6] + w[6] + MAJ(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[2]; - temp = D[7] + w[7] + MAJ(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[3]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_MAJ_7(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + MAJ(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[1]; - temp = D[1] + w[1] + MAJ(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[0]; - temp = D[2] + w[2] + MAJ(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[3]; - temp = D[3] + w[3] + MAJ(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[2]; - temp = D[4] + w[4] + MAJ(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[5]; - temp = D[5] + w[5] + MAJ(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[4]; - temp = D[6] + w[6] + MAJ(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[7]; - temp = D[7] + w[7] + MAJ(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[6]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_IF_8(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + IF(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[6]; - temp = D[1] + w[1] + IF(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[7]; - temp = D[2] + w[2] + IF(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[4]; - temp = D[3] + w[3] + IF(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[5]; - temp = D[4] + w[4] + IF(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[2]; - temp = D[5] + w[5] + IF(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[3]; - temp = D[6] + w[6] + IF(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[0]; - temp = D[7] + w[7] + IF(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[1]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_IF_9(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + IF(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[2]; - temp = D[1] + w[1] + IF(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[3]; - temp = D[2] + w[2] + IF(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[0]; - temp = D[3] + w[3] + IF(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[1]; - temp = D[4] + w[4] + IF(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[6]; - temp = D[5] + w[5] + IF(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[7]; - temp = D[6] + w[6] + IF(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[4]; - temp = D[7] + w[7] + IF(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[5]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_IF_10(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + IF(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[3]; - temp = D[1] + w[1] + IF(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[2]; - temp = D[2] + w[2] + IF(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[1]; - temp = D[3] + w[3] + IF(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[0]; - temp = D[4] + w[4] + IF(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[7]; - temp = D[5] + w[5] + IF(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[6]; - temp = D[6] + w[6] + IF(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[5]; - temp = D[7] + w[7] + IF(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[4]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_IF_11(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + IF(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[5]; - temp = D[1] + w[1] + IF(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[4]; - temp = D[2] + w[2] + IF(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[7]; - temp = D[3] + w[3] + IF(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[6]; - temp = D[4] + w[4] + IF(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[1]; - temp = D[5] + w[5] + IF(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[0]; - temp = D[6] + w[6] + IF(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[3]; - temp = D[7] + w[7] + IF(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[2]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_MAJ_12(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + MAJ(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[7]; - temp = D[1] + w[1] + MAJ(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[6]; - temp = D[2] + w[2] + MAJ(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[5]; - temp = D[3] + w[3] + MAJ(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[4]; - temp = D[4] + w[4] + MAJ(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[3]; - temp = D[5] + w[5] + MAJ(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[2]; - temp = D[6] + w[6] + MAJ(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[1]; - temp = D[7] + w[7] + MAJ(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[0]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_MAJ_13(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + MAJ(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[4]; - temp = D[1] + w[1] + MAJ(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[5]; - temp = D[2] + w[2] + MAJ(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[6]; - temp = D[3] + w[3] + MAJ(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[7]; - temp = D[4] + w[4] + MAJ(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[0]; - temp = D[5] + w[5] + MAJ(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[1]; - temp = D[6] + w[6] + MAJ(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[2]; - temp = D[7] + w[7] + MAJ(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[3]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_MAJ_14(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + MAJ(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[1]; - temp = D[1] + w[1] + MAJ(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[0]; - temp = D[2] + w[2] + MAJ(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[3]; - temp = D[3] + w[3] + MAJ(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[2]; - temp = D[4] + w[4] + MAJ(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[5]; - temp = D[5] + w[5] + MAJ(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[4]; - temp = D[6] + w[6] + MAJ(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[7]; - temp = D[7] + w[7] + MAJ(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[6]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_MAJ_15(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + MAJ(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[6]; - temp = D[1] + w[1] + MAJ(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[7]; - temp = D[2] + w[2] + MAJ(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[4]; - temp = D[3] + w[3] + MAJ(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[5]; - temp = D[4] + w[4] + MAJ(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[2]; - temp = D[5] + w[5] + MAJ(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[3]; - temp = D[6] + w[6] + MAJ(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[0]; - temp = D[7] + w[7] + MAJ(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[1]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_IF_16(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + IF(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[2]; - temp = D[1] + w[1] + IF(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[3]; - temp = D[2] + w[2] + IF(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[0]; - temp = D[3] + w[3] + IF(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[1]; - temp = D[4] + w[4] + IF(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[6]; - temp = D[5] + w[5] + IF(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[7]; - temp = D[6] + w[6] + IF(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[4]; - temp = D[7] + w[7] + IF(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[5]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_IF_17(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + IF(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[3]; - temp = D[1] + w[1] + IF(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[2]; - temp = D[2] + w[2] + IF(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[1]; - temp = D[3] + w[3] + IF(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[0]; - temp = D[4] + w[4] + IF(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[7]; - temp = D[5] + w[5] + IF(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[6]; - temp = D[6] + w[6] + IF(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[5]; - temp = D[7] + w[7] + IF(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[4]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_IF_18(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + IF(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[5]; - temp = D[1] + w[1] + IF(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[4]; - temp = D[2] + w[2] + IF(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[7]; - temp = D[3] + w[3] + IF(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[6]; - temp = D[4] + w[4] + IF(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[1]; - temp = D[5] + w[5] + IF(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[0]; - temp = D[6] + w[6] + IF(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[3]; - temp = D[7] + w[7] + IF(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[2]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_IF_19(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + IF(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[7]; - temp = D[1] + w[1] + IF(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[6]; - temp = D[2] + w[2] + IF(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[5]; - temp = D[3] + w[3] + IF(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[4]; - temp = D[4] + w[4] + IF(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[3]; - temp = D[5] + w[5] + IF(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[2]; - temp = D[6] + w[6] + IF(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[1]; - temp = D[7] + w[7] + IF(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[0]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_MAJ_20(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + MAJ(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[4]; - temp = D[1] + w[1] + MAJ(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[5]; - temp = D[2] + w[2] + MAJ(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[6]; - temp = D[3] + w[3] + MAJ(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[7]; - temp = D[4] + w[4] + MAJ(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[0]; - temp = D[5] + w[5] + MAJ(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[1]; - temp = D[6] + w[6] + MAJ(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[2]; - temp = D[7] + w[7] + MAJ(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[3]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_MAJ_21(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + MAJ(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[1]; - temp = D[1] + w[1] + MAJ(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[0]; - temp = D[2] + w[2] + MAJ(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[3]; - temp = D[3] + w[3] + MAJ(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[2]; - temp = D[4] + w[4] + MAJ(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[5]; - temp = D[5] + w[5] + MAJ(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[4]; - temp = D[6] + w[6] + MAJ(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[7]; - temp = D[7] + w[7] + MAJ(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[6]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_MAJ_22(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + MAJ(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[6]; - temp = D[1] + w[1] + MAJ(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[7]; - temp = D[2] + w[2] + MAJ(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[4]; - temp = D[3] + w[3] + MAJ(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[5]; - temp = D[4] + w[4] + MAJ(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[2]; - temp = D[5] + w[5] + MAJ(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[3]; - temp = D[6] + w[6] + MAJ(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[0]; - temp = D[7] + w[7] + MAJ(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[1]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_MAJ_23(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + MAJ(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[2]; - temp = D[1] + w[1] + MAJ(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[3]; - temp = D[2] + w[2] + MAJ(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[0]; - temp = D[3] + w[3] + MAJ(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[1]; - temp = D[4] + w[4] + MAJ(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[6]; - temp = D[5] + w[5] + MAJ(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[7]; - temp = D[6] + w[6] + MAJ(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[4]; - temp = D[7] + w[7] + MAJ(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[5]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_IF_24(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + IF(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[3]; - temp = D[1] + w[1] + IF(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[2]; - temp = D[2] + w[2] + IF(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[1]; - temp = D[3] + w[3] + IF(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[0]; - temp = D[4] + w[4] + IF(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[7]; - temp = D[5] + w[5] + IF(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[6]; - temp = D[6] + w[6] + IF(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[5]; - temp = D[7] + w[7] + IF(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[4]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_IF_25(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + IF(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[5]; - temp = D[1] + w[1] + IF(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[4]; - temp = D[2] + w[2] + IF(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[7]; - temp = D[3] + w[3] + IF(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[6]; - temp = D[4] + w[4] + IF(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[1]; - temp = D[5] + w[5] + IF(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[0]; - temp = D[6] + w[6] + IF(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[3]; - temp = D[7] + w[7] + IF(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[2]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_IF_26(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + IF(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[7]; - temp = D[1] + w[1] + IF(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[6]; - temp = D[2] + w[2] + IF(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[5]; - temp = D[3] + w[3] + IF(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[4]; - temp = D[4] + w[4] + IF(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[3]; - temp = D[5] + w[5] + IF(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[2]; - temp = D[6] + w[6] + IF(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[1]; - temp = D[7] + w[7] + IF(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[0]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_IF_27(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + IF(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[4]; - temp = D[1] + w[1] + IF(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[5]; - temp = D[2] + w[2] + IF(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[6]; - temp = D[3] + w[3] + IF(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[7]; - temp = D[4] + w[4] + IF(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[0]; - temp = D[5] + w[5] + IF(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[1]; - temp = D[6] + w[6] + IF(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[2]; - temp = D[7] + w[7] + IF(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[3]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_MAJ_28(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + MAJ(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[1]; - temp = D[1] + w[1] + MAJ(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[0]; - temp = D[2] + w[2] + MAJ(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[3]; - temp = D[3] + w[3] + MAJ(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[2]; - temp = D[4] + w[4] + MAJ(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[5]; - temp = D[5] + w[5] + MAJ(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[4]; - temp = D[6] + w[6] + MAJ(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[7]; - temp = D[7] + w[7] + MAJ(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[6]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_MAJ_29(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + MAJ(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[6]; - temp = D[1] + w[1] + MAJ(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[7]; - temp = D[2] + w[2] + MAJ(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[4]; - temp = D[3] + w[3] + MAJ(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[5]; - temp = D[4] + w[4] + MAJ(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[2]; - temp = D[5] + w[5] + MAJ(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[3]; - temp = D[6] + w[6] + MAJ(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[0]; - temp = D[7] + w[7] + MAJ(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[1]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_MAJ_30(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + MAJ(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[2]; - temp = D[1] + w[1] + MAJ(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[3]; - temp = D[2] + w[2] + MAJ(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[0]; - temp = D[3] + w[3] + MAJ(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[1]; - temp = D[4] + w[4] + MAJ(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[6]; - temp = D[5] + w[5] + MAJ(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[7]; - temp = D[6] + w[6] + MAJ(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[4]; - temp = D[7] + w[7] + MAJ(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[5]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_MAJ_31(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + MAJ(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[3]; - temp = D[1] + w[1] + MAJ(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[2]; - temp = D[2] + w[2] + MAJ(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[1]; - temp = D[3] + w[3] + MAJ(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[0]; - temp = D[4] + w[4] + MAJ(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[7]; - temp = D[5] + w[5] + MAJ(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[6]; - temp = D[6] + w[6] + MAJ(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[5]; - temp = D[7] + w[7] + MAJ(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[4]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_IF_32(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + IF(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[5]; - temp = D[1] + w[1] + IF(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[4]; - temp = D[2] + w[2] + IF(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[7]; - temp = D[3] + w[3] + IF(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[6]; - temp = D[4] + w[4] + IF(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[1]; - temp = D[5] + w[5] + IF(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[0]; - temp = D[6] + w[6] + IF(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[3]; - temp = D[7] + w[7] + IF(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[2]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_IF_33(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + IF(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[7]; - temp = D[1] + w[1] + IF(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[6]; - temp = D[2] + w[2] + IF(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[5]; - temp = D[3] + w[3] + IF(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[4]; - temp = D[4] + w[4] + IF(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[3]; - temp = D[5] + w[5] + IF(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[2]; - temp = D[6] + w[6] + IF(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[1]; - temp = D[7] + w[7] + IF(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[0]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_IF_34(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + IF(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[4]; - temp = D[1] + w[1] + IF(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[5]; - temp = D[2] + w[2] + IF(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[6]; - temp = D[3] + w[3] + IF(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[7]; - temp = D[4] + w[4] + IF(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[0]; - temp = D[5] + w[5] + IF(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[1]; - temp = D[6] + w[6] + IF(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[2]; - temp = D[7] + w[7] + IF(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[3]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} -__device__ __forceinline__ void STEP8_IF_35(const uint32_t *w, const int r, const int s, uint32_t * A, const uint32_t * B, const uint32_t * C, uint32_t * D) -{ - uint32_t temp; - uint32_t R[8]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - temp = D[0] + w[0] + IF(A[0], B[0], C[0]); - D[0] = ROTL32(temp, s) + R[1]; - temp = D[1] + w[1] + IF(A[1], B[1], C[1]); - D[1] = ROTL32(temp, s) + R[0]; - temp = D[2] + w[2] + IF(A[2], B[2], C[2]); - D[2] = ROTL32(temp, s) + R[3]; - temp = D[3] + w[3] + IF(A[3], B[3], C[3]); - D[3] = ROTL32(temp, s) + R[2]; - temp = D[4] + w[4] + IF(A[4], B[4], C[4]); - D[4] = ROTL32(temp, s) + R[5]; - temp = D[5] + w[5] + IF(A[5], B[5], C[5]); - D[5] = ROTL32(temp, s) + R[4]; - temp = D[6] + w[6] + IF(A[6], B[6], C[6]); - D[6] = ROTL32(temp, s) + R[7]; - temp = D[7] + w[7] + IF(A[7], B[7], C[7]); - D[7] = ROTL32(temp, s) + R[6]; -#pragma unroll 8 - for (int j = 0; j<8; j++) { - A[j] = R[j]; - } -} - -#ifdef DEVICE_DIRECT_CONSTANTS -static __constant__ uint32_t d_cw0[8][8] = { -#else -static __constant__ uint32_t d_cw0[8][8]; -static const uint32_t h_cw0[8][8] = { -#endif - 0x531B1720, 0xAC2CDE09, 0x0B902D87, 0x2369B1F4, 0x2931AA01, 0x02E4B082, 0xC914C914, 0xC1DAE1A6, - 0xF18C2B5C, 0x08AC306B, 0x27BFC914, 0xCEDC548D, 0xC630C4BE, 0xF18C4335, 0xF0D3427C, 0xBE3DA380, - 0x143C02E4, 0xA948C630, 0xA4F2DE09, 0xA71D2085, 0xA439BD84, 0x109FCD6A, 0xEEA8EF61, 0xA5AB1CE8, - 0x0B90D4A4, 0x3D6D039D, 0x25944D53, 0xBAA0E034, 0x5BC71E5A, 0xB1F4F2FE, 0x12CADE09, 0x548D41C3, - 0x3CB4F80D, 0x36ECEBC4, 0xA66443EE, 0x43351ABD, 0xC7A20C49, 0xEB0BB366, 0xF5293F98, 0x49B6DE09, - 0x531B29EA, 0x02E402E4, 0xDB25C405, 0x53D4E543, 0x0AD71720, 0xE1A61A04, 0xB87534C1, 0x3EDF43EE, - 0x213E50F0, 0x39173EDF, 0xA9485B0E, 0xEEA82EF9, 0x14F55771, 0xFAF15546, 0x3D6DD9B3, 0xAB73B92E, - 0x582A48FD, 0xEEA81892, 0x4F7EAA01, 0xAF10A88F, 0x11581720, 0x34C124DB, 0xD1C0AB73, 0x1E5AF0D3 -}; - -__device__ __forceinline__ void Round8_0_final(uint32_t *A, int r, int s, int t, int u) -{ - STEP8_IF_0(d_cw0[0], r, s, A, &A[8], &A[16], &A[24]); - STEP8_IF_1(d_cw0[1], s, t, &A[24], A, &A[8], &A[16]); - STEP8_IF_2(d_cw0[2], t, u, &A[16], &A[24], A, &A[8]); - STEP8_IF_3(d_cw0[3], u, r, &A[8], &A[16], &A[24], A); - STEP8_MAJ_4(d_cw0[4], r, s, A, &A[8], &A[16], &A[24]); - STEP8_MAJ_5(d_cw0[5], s, t, &A[24], A, &A[8], &A[16]); - STEP8_MAJ_6(d_cw0[6], t, u, &A[16], &A[24], A, &A[8]); - STEP8_MAJ_7(d_cw0[7], u, r, &A[8], &A[16], &A[24], A); -} - -#ifdef DEVICE_DIRECT_CONSTANTS -static __constant__ uint32_t d_cw1[8][8] = { -#else -static __constant__ uint32_t d_cw1[8][8]; -static const uint32_t h_cw1[8][8] = { -#endif - 0xC34C07F3, 0xC914143C, 0x599CBC12, 0xBCCBE543, 0x385EF3B7, 0x14F54C9A, 0x0AD7C068, 0xB64A21F7, - 0xDEC2AF10, 0xC6E9C121, 0x56B8A4F2, 0x1158D107, 0xEB0BA88F, 0x050FAABA, 0xC293264D, 0x548D46D2, - 0xACE5E8E0, 0x53D421F7, 0xF470D279, 0xDC974E0C, 0xD6CF55FF, 0xFD1C4F7E, 0x36EC36EC, 0x3E261E5A, - 0xEBC4FD1C, 0x56B839D0, 0x5B0E21F7, 0x58E3DF7B, 0x5BC7427C, 0xEF613296, 0x1158109F, 0x5A55E318, - 0xA7D6B703, 0x1158E76E, 0xB08255FF, 0x50F05771, 0xEEA8E8E0, 0xCB3FDB25, 0x2E40548D, 0xE1A60F2D, - 0xACE5D616, 0xFD1CFD1C, 0x24DB3BFB, 0xAC2C1ABD, 0xF529E8E0, 0x1E5AE5FC, 0x478BCB3F, 0xC121BC12, - 0xF4702B5C, 0xC293FC63, 0xDA6CB2AD, 0x45601FCC, 0xA439E1A6, 0x4E0C0D02, 0xED3621F7, 0xAB73BE3D, - 0x0E74D4A4, 0xF754CF95, 0xD84136EC, 0x3124AB73, 0x39D03B42, 0x0E74BCCB, 0x0F2DBD84, 0x41C35C80 -}; - -__device__ __forceinline__ void Round8_1_final(uint32_t *A, int r, int s, int t, int u) -{ - STEP8_IF_8(d_cw1[0], r, s, A, &A[8], &A[16], &A[24]); - STEP8_IF_9(d_cw1[1], s, t, &A[24], A, &A[8], &A[16]); - STEP8_IF_10(d_cw1[2], t, u, &A[16], &A[24], A, &A[8]); - STEP8_IF_11(d_cw1[3], u, r, &A[8], &A[16], &A[24], A); - STEP8_MAJ_12(d_cw1[4], r, s, A, &A[8], &A[16], &A[24]); - STEP8_MAJ_13(d_cw1[5], s, t, &A[24], A, &A[8], &A[16]); - STEP8_MAJ_14(d_cw1[6], t, u, &A[16], &A[24], A, &A[8]); - STEP8_MAJ_15(d_cw1[7], u, r, &A[8], &A[16], &A[24], A); -} - -#ifdef DEVICE_DIRECT_CONSTANTS -static __constant__ uint32_t d_cw2[8][8] = { -#else -static __constant__ uint32_t d_cw2[8][8]; -static const uint32_t h_cw2[8][8] = { -#endif - 0xA4135BED, 0xE10E1EF2, 0x6C4F93B1, 0x6E2191DF, 0xE2E01D20, 0xD1952E6B, 0x6A7D9583, 0x131DECE3, - 0x369CC964, 0xFB73048D, 0x9E9D6163, 0x280CD7F4, 0xD9C6263A, 0x1062EF9E, 0x2AC7D539, 0xAD2D52D3, - 0x0A03F5FD, 0x197CE684, 0xAA72558E, 0xDE5321AD, 0xF0870F79, 0x607A9F86, 0xAFE85018, 0x2AC7D539, - 0xE2E01D20, 0x2AC7D539, 0xC6A93957, 0x624C9DB4, 0x6C4F93B1, 0x641E9BE2, 0x452CBAD4, 0x263AD9C6, - 0xC964369C, 0xC3053CFB, 0x452CBAD4, 0x95836A7D, 0x4AA2B55E, 0xAB5B54A5, 0xAC4453BC, 0x74808B80, - 0xCB3634CA, 0xFC5C03A4, 0x4B8BB475, 0x21ADDE53, 0xE2E01D20, 0xDF3C20C4, 0xBD8F4271, 0xAA72558E, - 0xFC5C03A4, 0x48D0B730, 0x2AC7D539, 0xD70B28F5, 0x53BCAC44, 0x3FB6C04A, 0x14EFEB11, 0xDB982468, - 0x9A1065F0, 0xB0D14F2F, 0x8D5272AE, 0xC4D73B29, 0x91DF6E21, 0x949A6B66, 0x303DCFC3, 0x5932A6CE -}; - -__device__ __forceinline__ void Round8_2_final(uint32_t *A, int r, int s, int t, int u) -{ - STEP8_IF_16(d_cw2[0], r, s, A, &A[8], &A[16], &A[24]); - STEP8_IF_17(d_cw2[1], s, t, &A[24], A, &A[8], &A[16]); - STEP8_IF_18(d_cw2[2], t, u, &A[16], &A[24], A, &A[8]); - STEP8_IF_19(d_cw2[3], u, r, &A[8], &A[16], &A[24], A); - STEP8_MAJ_20(d_cw2[4], r, s, A, &A[8], &A[16], &A[24]); - STEP8_MAJ_21(d_cw2[5], s, t, &A[24], A, &A[8], &A[16]); - STEP8_MAJ_22(d_cw2[6], t, u, &A[16], &A[24], A, &A[8]); - STEP8_MAJ_23(d_cw2[7], u, r, &A[8], &A[16], &A[24], A); -} - -#ifdef DEVICE_DIRECT_CONSTANTS -static __constant__ uint32_t d_cw3[8][8] = { -#else -static __constant__ uint32_t d_cw3[8][8]; -static const uint32_t h_cw3[8][8] = { -#endif - 0x1234EDCC, 0xF5140AEC, 0xCDF1320F, 0x3DE4C21C, 0x48D0B730, 0x1234EDCC, 0x131DECE3, 0x52D3AD2D, - 0xE684197C, 0x6D3892C8, 0x72AE8D52, 0x6FF3900D, 0x73978C69, 0xEB1114EF, 0x15D8EA28, 0x71C58E3B, - 0x90F66F0A, 0x15D8EA28, 0x9BE2641E, 0x65F09A10, 0xEA2815D8, 0xBD8F4271, 0x3A40C5C0, 0xD9C6263A, - 0xB38C4C74, 0xBAD4452C, 0x70DC8F24, 0xAB5B54A5, 0x46FEB902, 0x1A65E59B, 0x0DA7F259, 0xA32A5CD6, - 0xD62229DE, 0xB81947E7, 0x6D3892C8, 0x15D8EA28, 0xE59B1A65, 0x065FF9A1, 0xB2A34D5D, 0x6A7D9583, - 0x975568AB, 0xFC5C03A4, 0x2E6BD195, 0x966C6994, 0xF2590DA7, 0x263AD9C6, 0x5A1BA5E5, 0xB0D14F2F, - 0x975568AB, 0x6994966C, 0xF1700E90, 0xD3672C99, 0xCC1F33E1, 0xFC5C03A4, 0x452CBAD4, 0x4E46B1BA, - 0xF1700E90, 0xB2A34D5D, 0xD0AC2F54, 0x5760A8A0, 0x8C697397, 0x624C9DB4, 0xE85617AA, 0x95836A7D -}; - -__device__ __forceinline__ void Round8_3_final(uint32_t *A, int r, int s, int t, int u) -{ - STEP8_IF_24(d_cw3[0], r, s, A, &A[8], &A[16], &A[24]); - STEP8_IF_25(d_cw3[1], s, t, &A[24], A, &A[8], &A[16]); - STEP8_IF_26(d_cw3[2], t, u, &A[16], &A[24], A, &A[8]); - STEP8_IF_27(d_cw3[3], u, r, &A[8], &A[16], &A[24], A); - STEP8_MAJ_28(d_cw3[4], r, s, A, &A[8], &A[16], &A[24]); - STEP8_MAJ_29(d_cw3[5], s, t, &A[24], A, &A[8], &A[16]); - STEP8_MAJ_30(d_cw3[6], t, u, &A[16], &A[24], A, &A[8]); - STEP8_MAJ_31(d_cw3[7], u, r, &A[8], &A[16], &A[24], A); -} - -#if __CUDA_ARCH__ < 350 -#define expanded_vector(x) tex1Dfetch(texRef1D_128, (x)) -#else -//#define expanded_vector(x) tex1Dfetch(texRef1D_128, (x)) -#define expanded_vector(x) __ldg(&g_fft4[x]) -#endif - -__device__ __forceinline__ void Round8_0(uint32_t *A, const int thr_offset, - int r, int s, int t, int u, uint4 *g_fft4) { - uint32_t w[8]; - uint4 hv1, hv2; - - int tmp = 0 + thr_offset; - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_IF_0(w, r, s, A, &A[8], &A[16], &A[24]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_IF_1(w, s, t, &A[24], A, &A[8], &A[16]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_IF_2(w, t, u, &A[16], &A[24], A, &A[8]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_IF_3(w, u, r, &A[8], &A[16], &A[24], A); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_MAJ_4(w, r, s, A, &A[8], &A[16], &A[24]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_MAJ_5(w, s, t, &A[24], A, &A[8], &A[16]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_MAJ_6(w, t, u, &A[16], &A[24], A, &A[8]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_MAJ_7(w, u, r, &A[8], &A[16], &A[24], A); - - -} -__device__ __forceinline__ void Round8_1(uint32_t *A, const int thr_offset, - int r, int s, int t, int u, uint4 *g_fft4) { - uint32_t w[8]; - uint4 hv1, hv2; - - int tmp = 16 + thr_offset; - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_IF_8(w, r, s, A, &A[8], &A[16], &A[24]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_IF_9(w, s, t, &A[24], A, &A[8], &A[16]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_IF_10(w, t, u, &A[16], &A[24], A, &A[8]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_IF_11(w, u, r, &A[8], &A[16], &A[24], A); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_MAJ_12(w, r, s, A, &A[8], &A[16], &A[24]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_MAJ_13(w, s, t, &A[24], A, &A[8], &A[16]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_MAJ_14(w, t, u, &A[16], &A[24], A, &A[8]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_MAJ_15(w, u, r, &A[8], &A[16], &A[24], A); - - -} -__device__ __forceinline__ void Round8_2(uint32_t *A, const int thr_offset, - int r, int s, int t, int u, uint4 *g_fft4) { - uint32_t w[8]; - uint4 hv1, hv2; - - int tmp = 32 + thr_offset; - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_IF_16(w, r, s, A, &A[8], &A[16], &A[24]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_IF_17(w, s, t, &A[24], A, &A[8], &A[16]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_IF_18(w, t, u, &A[16], &A[24], A, &A[8]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_IF_19(w, u, r, &A[8], &A[16], &A[24], A); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_MAJ_20(w, r, s, A, &A[8], &A[16], &A[24]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_MAJ_21(w, s, t, &A[24], A, &A[8], &A[16]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_MAJ_22(w, t, u, &A[16], &A[24], A, &A[8]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_MAJ_23(w, u, r, &A[8], &A[16], &A[24], A); - - -} -__device__ __forceinline__ void Round8_3(uint32_t *A, const int thr_offset, - int r, int s, int t, int u, uint4 *g_fft4) { - uint32_t w[8]; - uint4 hv1, hv2; - - int tmp = 48 + thr_offset; - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_IF_24(w, r, s, A, &A[8], &A[16], &A[24]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_IF_25(w, s, t, &A[24], A, &A[8], &A[16]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_IF_26(w, t, u, &A[16], &A[24], A, &A[8]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_IF_27(w, u, r, &A[8], &A[16], &A[24], A); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_MAJ_28(w, r, s, A, &A[8], &A[16], &A[24]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_MAJ_29(w, s, t, &A[24], A, &A[8], &A[16]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_MAJ_30(w, t, u, &A[16], &A[24], A, &A[8]); - hv1 = expanded_vector(tmp++); w[0] = hv1.x; w[1] = hv1.y; w[2] = hv1.z; w[3] = hv1.w; - hv2 = expanded_vector(tmp++); w[4] = hv2.x; w[5] = hv2.y; w[6] = hv2.z; w[7] = hv2.w; - STEP8_MAJ_31(w, u, r, &A[8], &A[16], &A[24], A); - - -} - -__device__ __forceinline__ void SIMD_Compress1(uint32_t *A, const int thr_id, const uint32_t *M, uint4 *g_fft4) { - int i; - const int thr_offset = thr_id << 6; // thr_id * 128 (je zwei elemente) -#pragma unroll 8 - for(i=0; i<8; i++) { - A[i] ^= M[i]; - (&A[8])[i] ^= M[8+i]; - } - Round8_0(A, thr_offset, 3, 23, 17, 27, g_fft4); - Round8_1(A, thr_offset, 28, 19, 22, 7, g_fft4); -} - -__device__ __forceinline__ void Compression1(const uint32_t *hashval, const int texture_id, uint4 *g_fft4, uint32_t *g_state) { - uint32_t A[32]; - int i; -#pragma unroll 32 - for (i=0; i < 32; i++) A[i] = c_IV_512[i]; - uint32_t buffer[16]; -#pragma unroll 16 - for (i=0; i < 16; i++) buffer[i] = hashval[i]; - SIMD_Compress1(A, texture_id, buffer, g_fft4); - uint32_t *state = (uint32_t*)&g_state[blockIdx.x * (blockDim.x*32)]; -#pragma unroll 32 - for (i=0; i < 32; i++) state[threadIdx.x+blockDim.x*i] = A[i]; -} - -__device__ __forceinline__ void SIMD_Compress2(uint32_t *A, const int thr_id, uint4 *g_fft4) { - uint32_t IV[4][8]; - int i; - const int thr_offset = thr_id << 6; // thr_id * 128 (je zwei elemente) -#pragma unroll 8 - for(i=0; i<8; i++) { - IV[0][i] = c_IV_512[i]; - IV[1][i] = c_IV_512[8+i]; - IV[2][i] = c_IV_512[16+i]; - IV[3][i] = c_IV_512[24+i]; - } - Round8_2(A, thr_offset, 29, 9, 15, 5, g_fft4); - Round8_3(A, thr_offset, 4, 13, 10, 25, g_fft4); - STEP8_IF_32(IV[0], 4, 13, A, &A[8], &A[16], &A[24]); - STEP8_IF_33(IV[1], 13, 10, &A[24], A, &A[8], &A[16]); - STEP8_IF_34(IV[2], 10, 25, &A[16], &A[24], A, &A[8]); - STEP8_IF_35(IV[3], 25, 4, &A[8], &A[16], &A[24], A); -} - -__device__ __forceinline__ void Compression2(const int texture_id, uint4 *g_fft4, uint32_t *g_state) { - uint32_t A[32]; - int i; - uint32_t *state = &g_state[blockIdx.x * (blockDim.x*32)]; -#pragma unroll 32 - for (i=0; i < 32; i++) A[i] = state[threadIdx.x+blockDim.x*i]; - SIMD_Compress2(A, texture_id, g_fft4); -#pragma unroll 32 - for (i=0; i < 32; i++) state[threadIdx.x+blockDim.x*i] = A[i]; -} - -__device__ __forceinline__ void SIMD_Compress_Final(uint32_t *A, const uint32_t *M) { - uint32_t IV[4][8]; - int i; -#pragma unroll 8 - for(i=0; i<8; i++) { - IV[0][i] = A[i]; - IV[1][i] = (&A[8])[i]; - IV[2][i] = (&A[16])[i]; - IV[3][i] = (&A[24])[i]; - } -#pragma unroll 8 - for(i=0; i<8; i++) { - A[i] ^= M[i]; - (&A[8])[i] ^= M[8+i]; - } - Round8_0_final(A, 3, 23, 17, 27); - Round8_1_final(A, 28, 19, 22, 7); - Round8_2_final(A, 29, 9, 15, 5); - Round8_3_final(A, 4, 13, 10, 25); - STEP8_IF_32(IV[0], 4, 13, A, &A[8], &A[16], &A[24]); - STEP8_IF_33(IV[1], 13, 10, &A[24], A, &A[8], &A[16]); - STEP8_IF_34(IV[2], 10, 25, &A[16], &A[24], A, &A[8]); - STEP8_IF_35(IV[3], 25, 4, &A[8], &A[16], &A[24], A); -} - -__device__ __forceinline__ void Final(uint32_t *hashval, const int texture_id, uint4 *g_fft4, uint32_t *g_state) { - uint32_t A[32]; - int i; - uint32_t *state = &g_state[blockIdx.x * (blockDim.x*32)]; -#pragma unroll 32 - for (i=0; i < 32; i++) A[i] = state[threadIdx.x+blockDim.x*i]; - uint32_t buffer[16]; - buffer[0] = 512; -#pragma unroll 15 - for (i=1; i < 16; i++) buffer[i] = 0; - SIMD_Compress_Final(A, buffer); -#pragma unroll 16 - for (i=0; i < 16; i++) - hashval[i] = A[i]; -} diff --git a/x11/cuda_x11_simd512_sm2.cuh b/x11/cuda_x11_simd512_sm2.cuh deleted file mode 100644 index 1c5b3143..00000000 --- a/x11/cuda_x11_simd512_sm2.cuh +++ /dev/null @@ -1,575 +0,0 @@ -/*************************************************************************************************** - * SM 2.x SIMD512 CUDA Implementation without shuffle - * - * cbuchner 2014 / tpruvot 2015 - */ - -#include "cuda_helper.h" - -#ifdef __INTELLISENSE__ -/* just for vstudio code colors */ -#define __CUDA_ARCH__ 210 -#endif - -#if __CUDA_ARCH__ < 300 - -#define T32(x) (x) - -#if 0 /* already declared in SM 3+ implementation */ -__constant__ uint32_t c_IV_512[32]; -const uint32_t h_IV_512[32] = { - 0x0ba16b95, 0x72f999ad, 0x9fecc2ae, 0xba3264fc, 0x5e894929, 0x8e9f30e5, 0x2f1daa37, 0xf0f2c558, - 0xac506643, 0xa90635a5, 0xe25b878b, 0xaab7878f, 0x88817f7a, 0x0a02892b, 0x559a7550, 0x598f657e, - 0x7eef60a1, 0x6b70e3e8, 0x9c1714d1, 0xb958e2a8, 0xab02675e, 0xed1c014f, 0xcd8d65bb, 0xfdb7a257, - 0x09254899, 0xd699c7bc, 0x9019b6dc, 0x2b9022e4, 0x8fa14956, 0x21bf9bd3, 0xb94d0943, 0x6ffddc22 -}; - -__constant__ int c_FFT128_8_16_Twiddle[128]; -static const int h_FFT128_8_16_Twiddle[128] = { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 60, 2, 120, 4, -17, 8, -34, 16, -68, 32, 121, 64, -15, 128, -30, - 1, 46, 60, -67, 2, 92, 120, 123, 4, -73, -17, -11, 8, 111, -34, -22, - 1, -67, 120, -73, 8, -22, -68, -70, 64, 81, -30, -46, -2,-123, 17,-111, - 1,-118, 46, -31, 60, 116, -67, -61, 2, 21, 92, -62, 120, -25, 123,-122, - 1, 116, 92,-122, -17, 84, -22, 18, 32, 114, 117, -49, -30, 118, 67, 62, - 1, -31, -67, 21, 120, -122, -73, -50, 8, 9, -22, -89, -68, 52, -70, 114, - 1, -61, 123, -50, -34, 18, -70, -99, 128, -98, 67, 25, 17, -9, 35, -79 -}; - -__constant__ int c_FFT256_2_128_Twiddle[128]; -static const int h_FFT256_2_128_Twiddle[128] = { - 1, 41,-118, 45, 46, 87, -31, 14, - 60,-110, 116,-127, -67, 80, -61, 69, - 2, 82, 21, 90, 92, -83, -62, 28, - 120, 37, -25, 3, 123, -97,-122,-119, - 4, -93, 42, -77, -73, 91,-124, 56, - -17, 74, -50, 6, -11, 63, 13, 19, - 8, 71, 84, 103, 111, -75, 9, 112, - -34,-109,-100, 12, -22, 126, 26, 38, - 16,-115, -89, -51, -35, 107, 18, -33, - -68, 39, 57, 24, -44, -5, 52, 76, - 32, 27, 79,-102, -70, -43, 36, -66, - 121, 78, 114, 48, -88, -10, 104,-105, - 64, 54, -99, 53, 117, -86, 72, 125, - -15,-101, -29, 96, 81, -20, -49, 47, - 128, 108, 59, 106, -23, 85,-113, -7, - -30, 55, -58, -65, -95, -40, -98, 94 -}; -#endif - -__constant__ int c_FFT[256] = { - // this is the FFT result in revbin permuted order - 4, -4, 32, -32, -60, 60, 60, -60, 101, -101, 58, -58, 112, -112, -11, 11, -92, 92, - -119, 119, 42, -42, -82, 82, 32, -32, 32, -32, 121, -121, 17, -17, -47, 47, 63, - -63, 107, -107, -76, 76, -119, 119, -83, 83, 126, -126, 94, -94, -23, 23, -76, - 76, -47, 47, 92, -92, -117, 117, 73, -73, -53, 53, 88, -88, -80, 80, -47, 47, - 5, -5, 67, -67, 34, -34, 4, -4, 87, -87, -28, 28, -70, 70, -110, 110, -18, 18, 93, - -93, 51, -51, 36, -36, 118, -118, -106, 106, 45, -45, -108, 108, -44, 44, 117, - -117, -121, 121, -37, 37, 65, -65, 37, -37, 40, -40, -42, 42, 91, -91, -128, 128, - -21, 21, 94, -94, -98, 98, -47, 47, 28, -28, 115, -115, 16, -16, -20, 20, 122, - -122, 115, -115, 46, -46, 84, -84, -127, 127, 57, -57, 127, -127, -80, 80, 24, - -24, 15, -15, 29, -29, -78, 78, -126, 126, 16, -16, 52, -52, 55, -55, 110, -110, - -51, 51, -120, 120, -124, 124, -24, 24, -76, 76, 26, -26, -21, 21, -64, 64, -99, - 99, 85, -85, -15, 15, -120, 120, -116, 116, 85, -85, 12, -12, -24, 24, 4, -4, - 79, -79, 76, -76, 23, -23, 4, -4, -108, 108, -20, 20, 73, -73, -42, 42, -7, 7, - -29, 29, -123, 123, 49, -49, -96, 96, -68, 68, -112, 112, 116, -116, -24, 24, 93, - -93, -125, 125, -86, 86, 117, -117, -91, 91, 42, -42, 87, -87, -117, 117, 102, -102 -}; - -__constant__ int c_P8[32][8] = { - { 2, 66, 34, 98, 18, 82, 50, 114 }, - { 6, 70, 38, 102, 22, 86, 54, 118 }, - { 0, 64, 32, 96, 16, 80, 48, 112 }, - { 4, 68, 36, 100, 20, 84, 52, 116 }, - { 14, 78, 46, 110, 30, 94, 62, 126 }, - { 10, 74, 42, 106, 26, 90, 58, 122 }, - { 12, 76, 44, 108, 28, 92, 60, 124 }, - { 8, 72, 40, 104, 24, 88, 56, 120 }, - { 15, 79, 47, 111, 31, 95, 63, 127 }, - { 13, 77, 45, 109, 29, 93, 61, 125 }, - { 3, 67, 35, 99, 19, 83, 51, 115 }, - { 1, 65, 33, 97, 17, 81, 49, 113 }, - { 9, 73, 41, 105, 25, 89, 57, 121 }, - { 11, 75, 43, 107, 27, 91, 59, 123 }, - { 5, 69, 37, 101, 21, 85, 53, 117 }, - { 7, 71, 39, 103, 23, 87, 55, 119 }, - { 8, 72, 40, 104, 24, 88, 56, 120 }, - { 4, 68, 36, 100, 20, 84, 52, 116 }, - { 14, 78, 46, 110, 30, 94, 62, 126 }, - { 2, 66, 34, 98, 18, 82, 50, 114 }, - { 6, 70, 38, 102, 22, 86, 54, 118 }, - { 10, 74, 42, 106, 26, 90, 58, 122 }, - { 0, 64, 32, 96, 16, 80, 48, 112 }, - { 12, 76, 44, 108, 28, 92, 60, 124 }, - { 134, 198, 166, 230, 150, 214, 182, 246 }, - { 128, 192, 160, 224, 144, 208, 176, 240 }, - { 136, 200, 168, 232, 152, 216, 184, 248 }, - { 142, 206, 174, 238, 158, 222, 190, 254 }, - { 140, 204, 172, 236, 156, 220, 188, 252 }, - { 138, 202, 170, 234, 154, 218, 186, 250 }, - { 130, 194, 162, 226, 146, 210, 178, 242 }, - { 132, 196, 164, 228, 148, 212, 180, 244 }, -}; - -__constant__ int c_Q8[32][8] = { - { 130, 194, 162, 226, 146, 210, 178, 242 }, - { 134, 198, 166, 230, 150, 214, 182, 246 }, - { 128, 192, 160, 224, 144, 208, 176, 240 }, - { 132, 196, 164, 228, 148, 212, 180, 244 }, - { 142, 206, 174, 238, 158, 222, 190, 254 }, - { 138, 202, 170, 234, 154, 218, 186, 250 }, - { 140, 204, 172, 236, 156, 220, 188, 252 }, - { 136, 200, 168, 232, 152, 216, 184, 248 }, - { 143, 207, 175, 239, 159, 223, 191, 255 }, - { 141, 205, 173, 237, 157, 221, 189, 253 }, - { 131, 195, 163, 227, 147, 211, 179, 243 }, - { 129, 193, 161, 225, 145, 209, 177, 241 }, - { 137, 201, 169, 233, 153, 217, 185, 249 }, - { 139, 203, 171, 235, 155, 219, 187, 251 }, - { 133, 197, 165, 229, 149, 213, 181, 245 }, - { 135, 199, 167, 231, 151, 215, 183, 247 }, - { 9, 73, 41, 105, 25, 89, 57, 121 }, - { 5, 69, 37, 101, 21, 85, 53, 117 }, - { 15, 79, 47, 111, 31, 95, 63, 127 }, - { 3, 67, 35, 99, 19, 83, 51, 115 }, - { 7, 71, 39, 103, 23, 87, 55, 119 }, - { 11, 75, 43, 107, 27, 91, 59, 123 }, - { 1, 65, 33, 97, 17, 81, 49, 113 }, - { 13, 77, 45, 109, 29, 93, 61, 125 }, - { 135, 199, 167, 231, 151, 215, 183, 247 }, - { 129, 193, 161, 225, 145, 209, 177, 241 }, - { 137, 201, 169, 233, 153, 217, 185, 249 }, - { 143, 207, 175, 239, 159, 223, 191, 255 }, - { 141, 205, 173, 237, 157, 221, 189, 253 }, - { 139, 203, 171, 235, 155, 219, 187, 251 }, - { 131, 195, 163, 227, 147, 211, 179, 243 }, - { 133, 197, 165, 229, 149, 213, 181, 245 }, -}; - -#define p8_xor(x) ( ((x)%7) == 0 ? 1 : \ - ((x)%7) == 1 ? 6 : \ - ((x)%7) == 2 ? 2 : \ - ((x)%7) == 3 ? 3 : \ - ((x)%7) == 4 ? 5 : \ - ((x)%7) == 5 ? 7 : 4 ) - -/************* the round function ****************/ - -//#define IF(x, y, z) ((((y) ^ (z)) & (x)) ^ (z)) -//#define MAJ(x, y, z) (((z) & (y)) | (((z) | (y)) & (x))) - -__device__ __forceinline__ -void STEP8_IF(const uint32_t *w, const int i, const int r, const int s, uint32_t *A, const uint32_t *B, const uint32_t *C, uint32_t *D) -{ - uint32_t R[8]; - #pragma unroll 8 - for(int j=0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - #pragma unroll 8 - for(int j=0; j<8; j++) { - D[j] = D[j] + w[j] + IF(A[j], B[j], C[j]); - D[j] = T32(ROTL32(T32(D[j]), s) + R[j^p8_xor(i)]); - A[j] = R[j]; - } -} - -__device__ __forceinline__ -void STEP8_MAJ(const uint32_t *w, const int i, const int r, const int s, uint32_t *A, const uint32_t *B, const uint32_t *C, uint32_t *D) -{ - uint32_t R[8]; - #pragma unroll 8 - for(int j=0; j<8; j++) { - R[j] = ROTL32(A[j], r); - } - #pragma unroll 8 - for(int j=0; j<8; j++) { - D[j] = D[j] + w[j] + MAJ(A[j], B[j], C[j]); - D[j] = T32(ROTL32(T32(D[j]), s) + R[j^p8_xor(i)]); - A[j] = R[j]; - } -} - -__device__ __forceinline__ -void Round8(uint32_t A[32], const int y[256], int i, int r, int s, int t, int u) -{ - uint32_t w[8][8]; - int code = i<2? 185: 233; - - /* - * The FFT output y is in revbin permuted order, - * but this is included in the tables P and Q - */ - - #pragma unroll 8 - for(int a=0; a<8; a++) { - #pragma unroll 8 - for(int b=0; b<8; b++) { - w[a][b] = __byte_perm( (y[c_P8[8*i+a][b]] * code), (y[c_Q8[8*i+a][b]] * code), 0x5410); - } - } - - STEP8_IF(w[0], 8*i+0, r, s, A, &A[8], &A[16], &A[24]); - STEP8_IF(w[1], 8*i+1, s, t, &A[24], A, &A[8], &A[16]); - STEP8_IF(w[2], 8*i+2, t, u, &A[16], &A[24], A, &A[8]); - STEP8_IF(w[3], 8*i+3, u, r, &A[8], &A[16], &A[24], A); - - STEP8_MAJ(w[4], 8*i+4, r, s, A, &A[8], &A[16], &A[24]); - STEP8_MAJ(w[5], 8*i+5, s, t, &A[24], A, &A[8], &A[16]); - STEP8_MAJ(w[6], 8*i+6, t, u, &A[16], &A[24], A, &A[8]); - STEP8_MAJ(w[7], 8*i+7, u, r, &A[8], &A[16], &A[24], A); -} - - -/********************* Message expansion ************************/ - -/* - * Reduce modulo 257; result is in [-127; 383] - * REDUCE(x) := (x&255) - (x>>8) - */ -#define REDUCE(x) (((x)&255) - ((x)>>8)) - -/* - * Reduce from [-127; 383] to [-128; 128] - * EXTRA_REDUCE_S(x) := x<=128 ? x : x-257 - */ -#define EXTRA_REDUCE_S(x) \ - ((x)<=128 ? (x) : (x)-257) - -/* - * Reduce modulo 257; result is in [-128; 128] - */ -#define REDUCE_FULL_S(x) \ - EXTRA_REDUCE_S(REDUCE(x)) - -__device__ __forceinline__ -void FFT_8(int *y, int stripe) -{ - /* - * FFT_8 using w=4 as 8th root of unity - * Unrolled decimation in frequency (DIF) radix-2 NTT. - * Output data is in revbin_permuted order. - */ - #define X(i) y[stripe*i] - - #define DO_REDUCE(i) \ - X(i) = REDUCE(X(i)) - - #define DO_REDUCE_FULL_S(i) { \ - X(i) = REDUCE(X(i)); \ - X(i) = EXTRA_REDUCE_S(X(i)); \ - } - - #define BUTTERFLY(i,j,n) { \ - int u= X(i); \ - int v= X(j); \ - X(i) = u+v; \ - X(j) = (u-v) << (2*n); \ - } - - BUTTERFLY(0, 4, 0); - BUTTERFLY(1, 5, 1); - BUTTERFLY(2, 6, 2); - BUTTERFLY(3, 7, 3); - - DO_REDUCE(6); - DO_REDUCE(7); - - BUTTERFLY(0, 2, 0); - BUTTERFLY(4, 6, 0); - BUTTERFLY(1, 3, 2); - BUTTERFLY(5, 7, 2); - - DO_REDUCE(7); - - BUTTERFLY(0, 1, 0); - BUTTERFLY(2, 3, 0); - BUTTERFLY(4, 5, 0); - BUTTERFLY(6, 7, 0); - - DO_REDUCE_FULL_S(0); - DO_REDUCE_FULL_S(1); - DO_REDUCE_FULL_S(2); - DO_REDUCE_FULL_S(3); - DO_REDUCE_FULL_S(4); - DO_REDUCE_FULL_S(5); - DO_REDUCE_FULL_S(6); - DO_REDUCE_FULL_S(7); - - #undef X - #undef DO_REDUCE - #undef DO_REDUCE_FULL_S - #undef BUTTERFLY -} - -__device__ __forceinline__ -void FFT_16(int *y, int stripe) -{ - /* - * FFT_16 using w=2 as 16th root of unity - * Unrolled decimation in frequency (DIF) radix-2 NTT. - * Output data is in revbin_permuted order. - */ - - #define X(i) y[stripe*i] - - #define DO_REDUCE(i) \ - X(i) = REDUCE(X(i)) - - #define DO_REDUCE_FULL_S(i) { \ - X(i) = REDUCE(X(i)); \ - X(i) = EXTRA_REDUCE_S(X(i)); \ - } - - #define BUTTERFLY(i,j,n) { \ - int u= X(i); \ - int v= X(j); \ - X(i) = u+v; \ - X(j) = (u-v) << n; \ - } - - BUTTERFLY(0, 8, 0); - BUTTERFLY(1, 9, 1); - BUTTERFLY(2, 10, 2); - BUTTERFLY(3, 11, 3); - BUTTERFLY(4, 12, 4); - BUTTERFLY(5, 13, 5); - BUTTERFLY(6, 14, 6); - BUTTERFLY(7, 15, 7); - - DO_REDUCE(11); - DO_REDUCE(12); - DO_REDUCE(13); - DO_REDUCE(14); - DO_REDUCE(15); - - BUTTERFLY( 0, 4, 0); - BUTTERFLY( 1, 5, 2); - BUTTERFLY( 2, 6, 4); - BUTTERFLY( 3, 7, 6); - - BUTTERFLY( 8, 12, 0); - BUTTERFLY( 9, 13, 2); - BUTTERFLY(10, 14, 4); - BUTTERFLY(11, 15, 6); - - DO_REDUCE(5); - DO_REDUCE(7); - DO_REDUCE(13); - DO_REDUCE(15); - - BUTTERFLY( 0, 2, 0); - BUTTERFLY( 1, 3, 4); - BUTTERFLY( 4, 6, 0); - BUTTERFLY( 5, 7, 4); - - BUTTERFLY( 8, 10, 0); - BUTTERFLY(12, 14, 0); - BUTTERFLY( 9, 11, 4); - BUTTERFLY(13, 15, 4); - - BUTTERFLY( 0, 1, 0); - BUTTERFLY( 2, 3, 0); - BUTTERFLY( 4, 5, 0); - BUTTERFLY( 6, 7, 0); - - BUTTERFLY( 8, 9, 0); - BUTTERFLY(10, 11, 0); - BUTTERFLY(12, 13, 0); - BUTTERFLY(14, 15, 0); - - DO_REDUCE_FULL_S( 0); - DO_REDUCE_FULL_S( 1); - DO_REDUCE_FULL_S( 2); - DO_REDUCE_FULL_S( 3); - DO_REDUCE_FULL_S( 4); - DO_REDUCE_FULL_S( 5); - DO_REDUCE_FULL_S( 6); - DO_REDUCE_FULL_S( 7); - DO_REDUCE_FULL_S( 8); - DO_REDUCE_FULL_S( 9); - DO_REDUCE_FULL_S(10); - DO_REDUCE_FULL_S(11); - DO_REDUCE_FULL_S(12); - DO_REDUCE_FULL_S(13); - DO_REDUCE_FULL_S(14); - DO_REDUCE_FULL_S(15); - - #undef X - #undef DO_REDUCE - #undef DO_REDUCE_FULL_S - #undef BUTTERFLY -} - -__device__ __forceinline__ -void FFT_128_full(int *y) -{ - #pragma unroll 16 - for (int i=0; i<16; i++) { - FFT_8(y+i,16); - } - - #pragma unroll 128 - for (int i=0; i<128; i++) - /*if (i & 7)*/ y[i] = REDUCE(y[i]*c_FFT128_8_16_Twiddle[i]); - - #pragma unroll 8 - for (int i=0; i<8; i++) { - FFT_16(y+16*i,1); - } -} - -__device__ __forceinline__ -void FFT_256_halfzero(int y[256]) -{ - /* - * FFT_256 using w=41 as 256th root of unity. - * Decimation in frequency (DIF) NTT. - * Output data is in revbin_permuted order. - * In place. - */ - const int tmp = y[127]; - - #pragma unroll 127 - for (int i=0; i<127; i++) - y[128+i] = REDUCE(y[i] * c_FFT256_2_128_Twiddle[i]); - - /* handle X^255 with an additionnal butterfly */ - y[127] = REDUCE(tmp + 1); - y[255] = REDUCE((tmp - 1) * c_FFT256_2_128_Twiddle[127]); - - FFT_128_full(y); - FFT_128_full(y+128); -} - -__device__ __forceinline__ -void SIMD_Compress(uint32_t A[32], const int *expanded, const uint32_t *M) -{ - uint32_t IV[4][8]; - - /* Save the chaining value for the feed-forward */ - - #pragma unroll 8 - for(int i=0; i<8; i++) { - IV[0][i] = A[i]; - IV[1][i] = (&A[8])[i]; - IV[2][i] = (&A[16])[i]; - IV[3][i] = (&A[24])[i]; - } - - /* XOR the message to the chaining value */ - /* we can XOR word-by-word */ - #pragma unroll 8 - for(int i=0; i<8; i++) { - A[i] ^= M[i]; - (&A[8])[i] ^= M[8+i]; - } - - /* Run the feistel ladders with the expanded message */ - Round8(A, expanded, 0, 3, 23, 17, 27); - Round8(A, expanded, 1, 28, 19, 22, 7); - Round8(A, expanded, 2, 29, 9, 15, 5); - Round8(A, expanded, 3, 4, 13, 10, 25); - - STEP8_IF(IV[0], 32, 4, 13, A, &A[8], &A[16], &A[24]); - STEP8_IF(IV[1], 33, 13, 10, &A[24], A, &A[8], &A[16]); - STEP8_IF(IV[2], 34, 10, 25, &A[16], &A[24], A, &A[8]); - STEP8_IF(IV[3], 35, 25, 4, &A[8], &A[16], &A[24], A); -} - - -/***************************************************/ - -__device__ __forceinline__ -void SIMDHash(const uint32_t *data, uint32_t *hashval) -{ - uint32_t A[32]; - uint32_t buffer[16]; - - #pragma unroll 32 - for (int i=0; i < 32; i++) A[i] = c_IV_512[i]; - - #pragma unroll 16 - for (int i=0; i < 16; i++) buffer[i] = data[i]; - - /* Message Expansion using Number Theoretical Transform similar to FFT */ - int expanded[256]; - { - #pragma unroll 16 - for(int i=0; i<64; i+=4) { - expanded[i+0] = __byte_perm(buffer[i/4],0,0x4440); - expanded[i+1] = __byte_perm(buffer[i/4],0,0x4441); - expanded[i+2] = __byte_perm(buffer[i/4],0,0x4442); - expanded[i+3] = __byte_perm(buffer[i/4],0,0x4443); - } - - #pragma unroll 16 - for(int i=64; i<128; i+=4) { - expanded[i+0] = 0; - expanded[i+1] = 0; - expanded[i+2] = 0; - expanded[i+3] = 0; - } - - FFT_256_halfzero(expanded); - } - - /* Compression Function */ - SIMD_Compress(A, expanded, buffer); - - /* Padding Round with known input (hence the FFT can be precomputed) */ - buffer[0] = 512; - - #pragma unroll 15 - for (int i=1; i < 16; i++) buffer[i] = 0; - - SIMD_Compress(A, c_FFT, buffer); - - #pragma unroll 16 - for (int i=0; i < 16; i++) - hashval[i] = A[i]; -} - -/***************************************************/ -__global__ -void x11_simd512_gpu_hash_64_sm2(const uint32_t threads, const uint32_t startNounce, uint64_t *g_hash, uint32_t *g_nonceVector) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t nounce = (g_nonceVector != NULL) ? g_nonceVector[thread] : (startNounce + thread); - - const int hashPosition = nounce - startNounce; - uint32_t *Hash = (uint32_t*) &g_hash[8 * hashPosition]; - - SIMDHash(Hash, Hash); - } -} - -#else -__global__ void x11_simd512_gpu_hash_64_sm2(const uint32_t threads, const uint32_t startNounce, uint64_t *g_hash, uint32_t *g_nonceVector) {} -#endif /* __CUDA_ARCH__ < 300 */ - -__host__ -static void x11_simd512_cpu_init_sm2(int thr_id) -{ -#ifndef DEVICE_DIRECT_CONSTANTS - cudaMemcpyToSymbol( c_IV_512, h_IV_512, sizeof(h_IV_512), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol( c_FFT128_8_16_Twiddle, h_FFT128_8_16_Twiddle, sizeof(h_FFT128_8_16_Twiddle), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol( c_FFT256_2_128_Twiddle, h_FFT256_2_128_Twiddle, sizeof(h_FFT256_2_128_Twiddle), 0, cudaMemcpyHostToDevice); -#endif -} - -__host__ -static void x11_simd512_cpu_hash_64_sm2(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order) -{ - const int threadsperblock = 256; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - size_t shared_size = 0; - - x11_simd512_gpu_hash_64_sm2<<>>(threads, startNounce, (uint64_t*)d_hash, d_nonceVector); - MyStreamSynchronize(NULL, order, thr_id); -} diff --git a/x11/fresh.cu b/x11/fresh.cu deleted file mode 100644 index f67a54e7..00000000 --- a/x11/fresh.cu +++ /dev/null @@ -1,185 +0,0 @@ -/** - * Fresh algorithm - */ -extern "C" { -#include "sph/sph_shavite.h" -#include "sph/sph_simd.h" -#include "sph/sph_echo.h" -} -#include "miner.h" -#include "cuda_helper.h" - -// to test gpu hash on a null buffer -#define NULLTEST 0 - -static uint32_t *d_hash[MAX_GPUS]; - -extern void x11_shavite512_cpu_init(int thr_id, uint32_t threads); -extern void x11_shavite512_setBlock_80(void *pdata); -extern void x11_shavite512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, int order); -extern void x11_shavite512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern int x11_simd512_cpu_init(int thr_id, uint32_t threads); -extern void x11_simd512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -extern void x11_simd512_cpu_free(int thr_id); - -extern void x11_echo512_cpu_init(int thr_id, uint32_t threads); -extern void x11_echo512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - - -// CPU Hash -extern "C" void fresh_hash(void *state, const void *input) -{ - // shavite-simd-shavite-simd-echo - - sph_shavite512_context ctx_shavite; - sph_simd512_context ctx_simd; - sph_echo512_context ctx_echo; - - unsigned char hash[128]; // uint32_t hashA[16], hashB[16]; - #define hashA hash - #define hashB hash+64 - - memset(hash, 0, sizeof hash); - - sph_shavite512_init(&ctx_shavite); - sph_shavite512(&ctx_shavite, input, 80); - sph_shavite512_close(&ctx_shavite, hashA); - - sph_simd512_init(&ctx_simd); - sph_simd512(&ctx_simd, hashA, 64); - sph_simd512_close(&ctx_simd, hashB); - - sph_shavite512_init(&ctx_shavite); - sph_shavite512(&ctx_shavite, hashB, 64); - sph_shavite512_close(&ctx_shavite, hashA); - - sph_simd512_init(&ctx_simd); - sph_simd512(&ctx_simd, hashA, 64); - sph_simd512_close(&ctx_simd, hashB); - - sph_echo512_init(&ctx_echo); - sph_echo512(&ctx_echo, hashB, 64); - sph_echo512_close(&ctx_echo, hashA); - - memcpy(state, hash, 32); -} - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_fresh(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - uint32_t endiandata[20]; - - uint32_t throughput = cuda_default_throughput(thr_id, 1 << 19); - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ptarget[7] = 0x00ff; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - CUDA_CALL_OR_RET_X(cudaMalloc(&d_hash[thr_id], (size_t)64 * throughput + 4), -1); - - x11_shavite512_cpu_init(thr_id, throughput); - x11_simd512_cpu_init(thr_id, throughput); - x11_echo512_cpu_init(thr_id, throughput); - - cuda_check_cpu_init(thr_id, throughput); - - init[thr_id] = true; - } - - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - x11_shavite512_setBlock_80((void*)endiandata); - cuda_check_cpu_setTarget(ptarget); - do { - int order = 0; - - // GPU Hash - x11_shavite512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - x11_simd512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_shavite512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_simd512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - -#if NULLTEST - uint32_t buf[8]; memset(buf, 0, sizeof buf); - CUDA_SAFE_CALL(cudaMemcpy(buf, d_hash[thr_id], sizeof buf, cudaMemcpyDeviceToHost)); - CUDA_SAFE_CALL(cudaThreadSynchronize()); - print_hash((unsigned char*)buf); printf("\n"); -#endif - *hashes_done = pdata[19] - first_nonce + throughput; - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - be32enc(&endiandata[19], work->nonces[0]); - fresh_hash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - work_set_target_ratio(work, vhash); - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - fresh_hash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce + 1; - return 0; -} - -// cleanup -extern "C" void free_fresh(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaSetDevice(device_map[thr_id]); - - cudaFree(d_hash[thr_id]); - x11_simd512_cpu_free(thr_id); - - cuda_check_cpu_free(thr_id); - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/x11/phi.cu b/x11/phi.cu deleted file mode 100644 index ab1f3083..00000000 --- a/x11/phi.cu +++ /dev/null @@ -1,223 +0,0 @@ -// -// -// PHI1612 algo -// Skein + JH + CubeHash + Fugue + Gost + Echo -// -// Implemented by anorganix @ bitcointalk on 01.10.2017 -// Feel free to send some satoshis to 1Bitcoin8tfbtGAQNFxDRUVUfFgFWKoWi9 -// -// - -extern "C" { -#include "sph/sph_skein.h" -#include "sph/sph_jh.h" -#include "sph/sph_cubehash.h" -#include "sph/sph_fugue.h" -#include "sph/sph_streebog.h" -#include "sph/sph_echo.h" -} - -#include "miner.h" -#include "cuda_helper.h" -#include "cuda_x11.h" - -extern void skein512_cpu_setBlock_80(void *pdata); -extern void skein512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNonce, uint32_t *d_hash, int swap); -extern void streebog_cpu_hash_64(int thr_id, uint32_t threads, uint32_t *d_hash); -extern void streebog_hash_64_maxwell(int thr_id, uint32_t threads, uint32_t *d_hash); - -extern void x13_fugue512_cpu_init(int thr_id, uint32_t threads); -extern void x13_fugue512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNonce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -extern void x13_fugue512_cpu_free(int thr_id); - -extern void tribus_echo512_final(int thr_id, uint32_t threads, uint32_t *d_hash, uint32_t *d_resNonce, const uint64_t target); - -#include -#include - -static uint32_t *d_hash[MAX_GPUS]; -static uint32_t *d_resNonce[MAX_GPUS]; - -extern "C" void phihash(void *output, const void *input) -{ - unsigned char _ALIGN(128) hash[128] = { 0 }; - - sph_skein512_context ctx_skein; - sph_jh512_context ctx_jh; - sph_cubehash512_context ctx_cubehash; - sph_fugue512_context ctx_fugue; - sph_gost512_context ctx_gost; - sph_echo512_context ctx_echo; - - sph_skein512_init(&ctx_skein); - sph_skein512(&ctx_skein, input, 80); - sph_skein512_close(&ctx_skein, (void*)hash); - - sph_jh512_init(&ctx_jh); - sph_jh512(&ctx_jh, (const void*)hash, 64); - sph_jh512_close(&ctx_jh, (void*)hash); - - sph_cubehash512_init(&ctx_cubehash); - sph_cubehash512(&ctx_cubehash, (const void*)hash, 64); - sph_cubehash512_close(&ctx_cubehash, (void*)hash); - - sph_fugue512_init(&ctx_fugue); - sph_fugue512(&ctx_fugue, (const void*)hash, 64); - sph_fugue512_close(&ctx_fugue, (void*)hash); - - sph_gost512_init(&ctx_gost); - sph_gost512(&ctx_gost, (const void*)hash, 64); - sph_gost512_close(&ctx_gost, (void*)hash); - - sph_echo512_init(&ctx_echo); - sph_echo512(&ctx_echo, (const void*)hash, 64); - sph_echo512_close(&ctx_echo, (void*)hash); - - memcpy(output, hash, 32); -} - -#define _DEBUG_PREFIX "phi" -#include "cuda_debug.cuh" - -static bool init[MAX_GPUS] = { 0 }; -static bool use_compat_kernels[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_phi(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - - const uint32_t first_nonce = pdata[19]; - const int dev_id = device_map[thr_id]; - - int intensity = (device_sm[dev_id] >= 500 && !is_windows()) ? 19 : 18; // 2^18 = 262144 cuda threads - if (device_sm[dev_id] >= 600) intensity = 20; - - uint32_t throughput = cuda_default_throughput(thr_id, 1U << intensity); - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ptarget[7] = 0xf; - - if (!init[thr_id]) - { - cudaSetDevice(dev_id); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - cuda_get_arch(thr_id); - use_compat_kernels[thr_id] = (cuda_arch[dev_id] < 500); - - quark_skein512_cpu_init(thr_id, throughput); - quark_jh512_cpu_init(thr_id, throughput); - x11_cubehash512_cpu_init(thr_id, throughput); - x13_fugue512_cpu_init(thr_id, throughput); - if (use_compat_kernels[thr_id]) - x11_echo512_cpu_init(thr_id, throughput); - - CUDA_CALL_OR_RET_X(cudaMalloc(&d_hash[thr_id], (size_t)64 * throughput), -1); - CUDA_SAFE_CALL(cudaMalloc(&d_resNonce[thr_id], 2 * sizeof(uint32_t))); - - cuda_check_cpu_init(thr_id, throughput); - init[thr_id] = true; - } - - uint32_t endiandata[20]; - - for (int k = 0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - skein512_cpu_setBlock_80((void*)endiandata); - if (use_compat_kernels[thr_id]) - cuda_check_cpu_setTarget(ptarget); - else - cudaMemset(d_resNonce[thr_id], 0xFF, 2 * sizeof(uint32_t)); - - do { - int order = 0; - - skein512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], 1); order++; - quark_jh512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_cubehash512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x13_fugue512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - if (use_compat_kernels[thr_id]) { - streebog_cpu_hash_64(thr_id, throughput, d_hash[thr_id]); - x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - } else { - streebog_hash_64_maxwell(thr_id, throughput, d_hash[thr_id]); - tribus_echo512_final(thr_id, throughput, d_hash[thr_id], d_resNonce[thr_id], AS_U64(&ptarget[6])); - cudaMemcpy(&work->nonces[0], d_resNonce[thr_id], 2 * sizeof(uint32_t), cudaMemcpyDeviceToHost); - } - - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - const uint32_t startNonce = pdata[19]; - uint32_t _ALIGN(64) vhash[8]; - if (!use_compat_kernels[thr_id]) work->nonces[0] += startNonce; - be32enc(&endiandata[19], work->nonces[0]); - phihash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - *hashes_done = pdata[19] - first_nonce + throughput; - //work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - //if (work->nonces[1] != 0) { - if (work->nonces[1] != UINT32_MAX) { - work->nonces[1] += startNonce; - be32enc(&endiandata[19], work->nonces[1]); - phihash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } - else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - cudaMemset(d_resNonce[thr_id], 0xFF, 2 * sizeof(uint32_t)); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t)throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - return 0; -} - -// cleanup -extern "C" void free_phi(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - cudaFree(d_hash[thr_id]); - cudaFree(d_resNonce[thr_id]); - x13_fugue512_cpu_free(thr_id); - - cuda_check_cpu_free(thr_id); - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/x11/s3.cu b/x11/s3.cu deleted file mode 100644 index 85eaaa6a..00000000 --- a/x11/s3.cu +++ /dev/null @@ -1,181 +0,0 @@ -/** - * S3 Hash (Also called Triple S - Used by 1Coin) - */ - -extern "C" { -#include "sph/sph_skein.h" -#include "sph/sph_shavite.h" -#include "sph/sph_simd.h" -} - -#include "miner.h" -#include "cuda_helper.h" -#include "cuda_x11.h" - -extern void x11_shavite512_setBlock_80(void *pdata); -extern void x11_shavite512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, int order); - -#include - -static uint32_t *d_hash[MAX_GPUS]; - -/* CPU HASH */ -extern "C" void s3hash(void *output, const void *input) -{ - sph_shavite512_context ctx_shavite; - sph_simd512_context ctx_simd; - sph_skein512_context ctx_skein; - - unsigned char hash[64]; - - sph_shavite512_init(&ctx_shavite); - sph_shavite512(&ctx_shavite, input, 80); - sph_shavite512_close(&ctx_shavite, (void*) hash); - - sph_simd512_init(&ctx_simd); - sph_simd512(&ctx_simd, (const void*) hash, 64); - sph_simd512_close(&ctx_simd, (void*) hash); - - sph_skein512_init(&ctx_skein); - sph_skein512(&ctx_skein, (const void*) hash, 64); - sph_skein512_close(&ctx_skein, (void*) hash); - - memcpy(output, hash, 32); -} - -#ifdef _DEBUG -#define TRACE(algo) { \ - if (max_nonce == 1 && pdata[19] <= 1) { \ - uint32_t* debugbuf = NULL; \ - cudaMallocHost(&debugbuf, 32); \ - cudaMemcpy(debugbuf, d_hash[thr_id], 32, cudaMemcpyDeviceToHost); \ - printf("S3 %s %08x %08x %08x %08x...%08x\n", algo, swab32(debugbuf[0]), swab32(debugbuf[1]), \ - swab32(debugbuf[2]), swab32(debugbuf[3]), swab32(debugbuf[7])); \ - cudaFreeHost(debugbuf); \ - } \ -} -#else -#define TRACE(algo) {} -#endif - -static bool init[MAX_GPUS] = { 0 }; - -/* Main S3 entry point */ -extern "C" int scanhash_s3(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - int intensity = 20; // 256*256*8*2; -#ifdef WIN32 - // reduce by one the intensity on windows - intensity--; -#endif - uint32_t throughput = cuda_default_throughput(thr_id, 1 << intensity); - //if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ptarget[7] = 0xF; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - CUDA_SAFE_CALL(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput)); - - x11_shavite512_cpu_init(thr_id, throughput); - x11_simd512_cpu_init(thr_id, throughput); - quark_skein512_cpu_init(thr_id, throughput); - - cuda_check_cpu_init(thr_id, throughput); - - init[thr_id] = true; - } - - uint32_t endiandata[20]; - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - x11_shavite512_setBlock_80((void*)endiandata); - cuda_check_cpu_setTarget(ptarget); - - do { - int order = 0; - - x11_shavite512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - TRACE("shavite:"); - x11_simd512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("simd :"); - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("skein :"); - - *hashes_done = pdata[19] - first_nonce + throughput; - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - be32enc(&endiandata[19], work->nonces[0]); - s3hash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - s3hash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - return 0; -} - -// cleanup -extern "C" void free_s3(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - x11_simd512_cpu_free(thr_id); - - cuda_check_cpu_free(thr_id); - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/x11/sib.cu b/x11/sib.cu deleted file mode 100644 index c437523d..00000000 --- a/x11/sib.cu +++ /dev/null @@ -1,251 +0,0 @@ -extern "C" { -#include "sph/sph_blake.h" -#include "sph/sph_bmw.h" -#include "sph/sph_groestl.h" -#include "sph/sph_skein.h" -#include "sph/sph_jh.h" -#include "sph/sph_keccak.h" -#include "sph/sph_luffa.h" -#include "sph/sph_cubehash.h" -#include "sph/sph_shavite.h" -#include "sph/sph_simd.h" -#include "sph/sph_echo.h" -#include "sph/sph_streebog.h" -} - -#include "miner.h" -#include "cuda_helper.h" -#include "cuda_x11.h" - -extern void streebog_cpu_hash_64(int thr_id, uint32_t threads, uint32_t *d_hash); -extern void streebog_hash_64_maxwell(int thr_id, uint32_t threads, uint32_t *d_hash); - -#include -#include - -static uint32_t *d_hash[MAX_GPUS]; - -// Sibcoin CPU Hash -extern "C" void sibhash(void *output, const void *input) -{ - unsigned char _ALIGN(128) hash[128] = { 0 }; - - sph_blake512_context ctx_blake; - sph_bmw512_context ctx_bmw; - sph_groestl512_context ctx_groestl; - sph_skein512_context ctx_skein; - sph_jh512_context ctx_jh; - sph_keccak512_context ctx_keccak; - sph_gost512_context ctx_gost; - sph_luffa512_context ctx_luffa; - sph_cubehash512_context ctx_cubehash; - sph_shavite512_context ctx_shavite; - sph_simd512_context ctx_simd; - sph_echo512_context ctx_echo; - - sph_blake512_init(&ctx_blake); - sph_blake512 (&ctx_blake, input, 80); - sph_blake512_close(&ctx_blake, (void*) hash); - - sph_bmw512_init(&ctx_bmw); - sph_bmw512 (&ctx_bmw, (const void*) hash, 64); - sph_bmw512_close(&ctx_bmw, (void*) hash); - - sph_groestl512_init(&ctx_groestl); - sph_groestl512 (&ctx_groestl, (const void*) hash, 64); - sph_groestl512_close(&ctx_groestl, (void*) hash); - - sph_skein512_init(&ctx_skein); - sph_skein512 (&ctx_skein, (const void*) hash, 64); - sph_skein512_close(&ctx_skein, (void*) hash); - - sph_jh512_init(&ctx_jh); - sph_jh512 (&ctx_jh, (const void*) hash, 64); - sph_jh512_close(&ctx_jh, (void*) hash); - - sph_keccak512_init(&ctx_keccak); - sph_keccak512 (&ctx_keccak, (const void*) hash, 64); - sph_keccak512_close(&ctx_keccak, (void*) hash); - - sph_gost512_init(&ctx_gost); - sph_gost512(&ctx_gost, (const void*) hash, 64); - sph_gost512_close(&ctx_gost, (void*) hash); - - sph_luffa512_init(&ctx_luffa); - sph_luffa512 (&ctx_luffa, (const void*) hash, 64); - sph_luffa512_close (&ctx_luffa, (void*) hash); - - sph_cubehash512_init(&ctx_cubehash); - sph_cubehash512 (&ctx_cubehash, (const void*) hash, 64); - sph_cubehash512_close(&ctx_cubehash, (void*) hash); - - sph_shavite512_init(&ctx_shavite); - sph_shavite512 (&ctx_shavite, (const void*) hash, 64); - sph_shavite512_close(&ctx_shavite, (void*) hash); - - sph_simd512_init(&ctx_simd); - sph_simd512 (&ctx_simd, (const void*) hash, 64); - sph_simd512_close(&ctx_simd, (void*) hash); - - sph_echo512_init(&ctx_echo); - sph_echo512 (&ctx_echo, (const void*) hash, 64); - sph_echo512_close(&ctx_echo, (void*) hash); - - memcpy(output, hash, 32); -} - -//#define _DEBUG -#define _DEBUG_PREFIX "sib" -#include "cuda_debug.cuh" - -static bool init[MAX_GPUS] = { 0 }; -static bool use_compat_kernels[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_sib(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - const int dev_id = device_map[thr_id]; - int intensity = (device_sm[dev_id] >= 500 && !is_windows()) ? 19 : 18; // 2^18 = 262144 cuda threads - if (device_sm[dev_id] >= 600) intensity = 20; - uint32_t throughput = cuda_default_throughput(thr_id, 1U << intensity); - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ptarget[7] = 0xf; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - cuda_get_arch(thr_id); - use_compat_kernels[thr_id] = (cuda_arch[dev_id] < 500); - - quark_blake512_cpu_init(thr_id, throughput); - quark_bmw512_cpu_init(thr_id, throughput); - quark_groestl512_cpu_init(thr_id, throughput); - quark_skein512_cpu_init(thr_id, throughput); - quark_keccak512_cpu_init(thr_id, throughput); - quark_jh512_cpu_init(thr_id, throughput); - x11_luffaCubehash512_cpu_init(thr_id, throughput); - x11_shavite512_cpu_init(thr_id, throughput); - x11_echo512_cpu_init(thr_id, throughput); - if (x11_simd512_cpu_init(thr_id, throughput) != 0) { - return -1; - } - CUDA_CALL_OR_RET_X(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput), -1); - - cuda_check_cpu_init(thr_id, throughput); - - init[thr_id] = true; - } - - uint32_t endiandata[20]; - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - quark_blake512_cpu_setBlock_80(thr_id, endiandata); - cuda_check_cpu_setTarget(ptarget); - - do { - int order = 0; - - // Hash with CUDA - quark_blake512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("blake :"); - quark_bmw512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("bmw :"); - quark_groestl512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("groestl:"); - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("skein :"); - quark_jh512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("jh512 :"); - quark_keccak512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("keccak :"); - if (use_compat_kernels[thr_id]) - streebog_cpu_hash_64(thr_id, throughput, d_hash[thr_id]); - else - streebog_hash_64_maxwell(thr_id, throughput, d_hash[thr_id]); - TRACE("gost :"); - x11_luffaCubehash512_cpu_hash_64(thr_id, throughput, d_hash[thr_id], order++); - TRACE("luffa+c:"); - x11_shavite512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("shavite:"); - x11_simd512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("simd :"); - x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("echo => "); - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - be32enc(&endiandata[19], work->nonces[0]); - sibhash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - work->nonces[1] =cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - *hashes_done = pdata[19] - first_nonce + throughput; - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - sibhash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - return 0; -} - -// cleanup -extern "C" void free_sib(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - - quark_blake512_cpu_free(thr_id); - quark_groestl512_cpu_free(thr_id); - x11_simd512_cpu_free(thr_id); - - cuda_check_cpu_free(thr_id); - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/x11/streebog_arrays.cuh b/x11/streebog_arrays.cuh deleted file mode 100644 index 78362937..00000000 --- a/x11/streebog_arrays.cuh +++ /dev/null @@ -1,567 +0,0 @@ -// Tables for function F -__device__ uint2 T02[256] = { - { 0x5B711FD0, 0xE6F87E5C }, { 0x0924FA16, 0x25837780 }, { 0x852EA4A8, 0xC849E07E }, { 0x8F06C16A, 0x5B4686A1 }, - { 0xD77B416E, 0x0B32E9A2 }, { 0x67815C66, 0xABDA37A4 }, { 0x1A686676, 0xF61796A8 }, { 0x6391954B, 0xF5DC0B70 }, - { 0xB7E64BF1, 0x4862F38D }, { 0x68BD85C5, 0xFF5C629A }, { 0xFCD75795, 0xCB827DA6 }, { 0x69B9F089, 0x66D36DAF }, - { 0x483D83B0, 0x356C9F74 }, { 0x238C99A1, 0x7CBCECB1 }, { 0x31C4708D, 0x36A702AC }, { 0x2FBCDFD6, 0x9EB6A8D0 }, - { 0xE5B3AE37, 0x8B19FA51 }, { 0x8A127D0B, 0x9CCFB540 }, { 0x08208F5A, 0xBC0C78B5 }, { 0x2288ECED, 0xE533E384 }, - { 0x77C15FD2, 0xCEC2C7D3 }, { 0x505D0F5E, 0xEC7817B6 }, { 0x8336871D, 0xB94CC2C0 }, { 0xCB0B04AD, 0x8C205DB4 }, - { 0x28A0892F, 0x763C855B }, { 0xF6FF3257, 0x588D1B79 }, { 0x4311933E, 0x3FECF69E }, { 0x803A18C9, 0x0FC0D39F }, - { 0xF5F3AD83, 0xEE010A26 }, { 0x411979A6, 0x10EFE8F4 }, { 0x7DE93A10, 0x5DCDA10C }, { 0x1248E92C, 0x4A1BEE1D }, - { 0x21847339, 0x53BFF2DB }, { 0xA6A23D09, 0xB4F50CCF }, { 0xD84798CD, 0x5FB4BC9C }, { 0x071C56F9, 0xE88A2D8B }, - { 0x5A756A9C, 0x7F777169 }, { 0xA0BA1EBC, 0xC5F02E71 }, { 0x4215E672, 0xA663F9AB }, { 0xDE5FBB78, 0x2EB19E22 }, - { 0x2594BA14, 0x0DB9CE0F }, { 0x97664D84, 0x82520E63 }, { 0x0208EA98, 0x2F031E6A }, { 0xA1BE6BF0, 0x5C7F2144 }, - { 0xD16362DB, 0x7A37CB1C }, { 0x4B311C64, 0x83E08E2B }, { 0xAB960E32, 0xCF70479B }, { 0xB9DEE71E, 0x856BA986 }, - { 0x7AF56CE9, 0xB5478C87 }, { 0x5F61D6FD, 0xB8FE4288 }, { 0x966238C8, 0x1BDD0156 }, { 0x3EF8A92E, 0x62215792 }, - { 0x114476F8, 0xFC97FF42 }, { 0x56452CEB, 0x9D7D3508 }, { 0xE0A71256, 0x4C90C9B0 }, { 0xFBCB016C, 0x2308502D }, - { 0xA7A64845, 0x2D7A03FA }, { 0xBFC6C4AB, 0xF46E8B38 }, { 0xD477DEBA, 0xBDBEF8FD }, { 0xC8079B79, 0x3AAC4CEB }, - { 0xE8879D0C, 0xF09CB105 }, { 0xAC8A58CB, 0x27FA6A10 }, { 0x401D0CEA, 0x8960E7C1 }, { 0x4A356928, 0x1A6F811E }, - { 0x73D196FF, 0x90C4FB07 }, { 0x609D0A9F, 0x43501A2F }, { 0xC63F3796, 0xF7A516E0 }, { 0xB8DA9252, 0x1CE4A6B3 }, - { 0x38E08A9B, 0x1324752C }, { 0x3BEC154F, 0xA5A86473 }, { 0x5549B33F, 0x2BF12457 }, { 0x440DC5C7, 0xD766DB15 }, - { 0x9E42B792, 0xA7D179E3 }, { 0x61997FD3, 0xDADF151A }, { 0xC0271423, 0x86A0345E }, { 0x6DA939A4, 0x38D5517B }, - { 0x104003B4, 0x6518F077 }, { 0xA5AEA2DD, 0x02791D90 }, { 0x9C4A5D0A, 0x88D26789 }, { 0x0A2865C2, 0x930F66DF }, - { 0x4509B08B, 0x4EE9D420 }, { 0x6685292A, 0x32553891 }, { 0xC533A842, 0x412907BF }, { 0x544DC673, 0xB27E2B62 }, - { 0x6295E007, 0x6C530445 }, { 0x5351908A, 0x5AF406E9 }, { 0xC123616F, 0x1F2F3B6B }, { 0x5255E5C6, 0xC37B09DC }, - { 0xB1FE6844, 0x3967D133 }, { 0xF0E711E2, 0x298839C7 }, { 0x1964F9A2, 0x409B87F7 }, { 0xDB4B0719, 0xE938ADC3 }, - { 0xF9C3EBF4, 0x0C0B4E47 }, { 0xD36B8843, 0x5534D576 }, { 0xEB8B02D8, 0x4610A05A }, { 0x8232F251, 0x20C3CDF5 }, - { 0xBEC2B1E7, 0x6DE1840D }, { 0xB0FA1D08, 0xA0E8DE06 }, { 0x0D34333B, 0x7B854B54 }, { 0xBCCA5B7F, 0x42E29A67 }, - { 0xC437DD0E, 0xD8A6088A }, { 0xD943ED81, 0xC63BB3A9 }, { 0x5E65A3B1, 0x21714DBD }, { 0xB5EEA169, 0x6761EDE7 }, - { 0xD573ABF6, 0x2431F7C8 }, { 0xE1A3671A, 0xD51FC685 }, { 0x0410C92D, 0x5E063CD4 }, { 0x2CB04002, 0x283AB98F }, - { 0xB2F2F790, 0x8FEBC06C }, { 0x6FA1D33C, 0x17D64F11 }, { 0xA99EE4AA, 0xE07359F1 }, { 0x74CDC006, 0x784ED68C }, - { 0xC73B42DA, 0x6E2A19D5 }, { 0x1C7045C3, 0x8712B416 }, { 0xED93216D, 0x371582E4 }, { 0x4939F6FC, 0xACE39041 }, - { 0x86223B7C, 0x7EC5F121 }, { 0x2BAC16FB, 0xC0B09404 }, { 0x9A527EBF, 0xF9D74537 }, { 0xA3B68168, 0x737C3F2E }, - { 0xBAD278CA, 0x33E7B8D9 }, { 0xC22FFEBB, 0xA9A32A34 }, { 0xFEDFBD0D, 0xE48163CC }, { 0x6EA5A670, 0x8E594024 }, - { 0x842AD1E4, 0x51C6EF4B }, { 0x279C508C, 0x22BAD065 }, { 0x18608CEE, 0xD91488C2 }, { 0x1F7CDA17, 0x319EA549 }, - { 0x134C9C60, 0xD394E128 }, { 0x72D5E3B3, 0x094BF432 }, { 0xA4AAD791, 0x9BF612A5 }, { 0xD26FFD0F, 0xCCBBDA43 }, - { 0x946AD250, 0x34DE1F3C }, { 0x995EE16B, 0x4F5B5468 }, { 0xEA8F7794, 0xDF9FAF6F }, { 0x70DD092B, 0x2648EA58 }, - { 0x71D97C67, 0xBFC7E56D }, { 0x4F21D549, 0xDDE6B2FF }, { 0x3AE86003, 0x3C276B46 }, { 0xAF86C71F, 0x91767B4F }, - { 0x35D4B9A0, 0x68A13E78 }, { 0x030C9FD4, 0xB68C115F }, { 0x16582001, 0x141DD2C9 }, { 0xDD5324AC, 0x983D8F7D }, - { 0xCC175254, 0x64AA703F }, { 0x8E02B426, 0xC2C98994 }, { 0x9F46C2DE, 0x3E5E76D6 }, { 0x587D8004, 0x50746F03 }, - { 0x9272F1E5, 0x45DB3D82 }, { 0x9B560BF3, 0x60584A02 }, { 0x3FFCDC62, 0xFBAE58A7 }, { 0x6CAD4CE8, 0xA15A5E4E }, - { 0xCE1FB8CC, 0x4BA96E55 }, { 0xAE82B253, 0x08F9747A }, { 0xF7FB471B, 0xC102144C }, { 0xF3EB8E36, 0x9F042898 }, - { 0xF2EFFB7A, 0x068B27AD }, { 0x8C0A5EBE, 0xEDCA97FE }, { 0xF4F7D8CF, 0x778E0513 }, { 0xC32B8BF7, 0x302C2501 }, - { 0x175C554D, 0x8D92DDFC }, { 0x46052F5F, 0xF865C57F }, { 0xA2B2F424, 0xEAF3301B }, { 0xBBD60D86, 0xAA68B7EC }, - { 0x0104754C, 0x998F0F35 }, { 0x00000000, 0x00000000 }, { 0x34D0CCEC, 0xF12E314D }, { 0x061823B5, 0x710522BE }, - { 0x30C005C1, 0xAF280D99 }, { 0x5D693C65, 0x97FD5CE2 }, { 0x33CC9A15, 0x19A41CC6 }, { 0xF8C79EB8, 0x95844172 }, - { 0x937684A9, 0xDC5432B7 }, { 0x2490CF58, 0x9436C13A }, { 0x32C8EF59, 0x802B13F3 }, { 0x7CED4F5C, 0xC442AE39 }, - { 0xE3AB8D82, 0xFA1CD8EF }, { 0x4D293FD1, 0xF2E5AC95 }, { 0x907A1B7D, 0x6AD823E8 }, { 0x3CF043B6, 0x4D2249F8 }, - { 0x79F9F33D, 0x03CB9DD8 }, { 0x36D82674, 0xDE2D2F27 }, { 0x891EE2DF, 0x2A43A41F }, { 0x1B6C133A, 0x6F98999D }, - { 0x3DF436FA, 0xD4AD46CD }, { 0x269825C0, 0xBB35DF50 }, { 0x813E6D85, 0x964FDCAA }, { 0x7EE5A5C4, 0xEB41B053 }, - { 0x8B160847, 0x0540BA75 }, { 0xE7BB44AF, 0xA41AE43B }, { 0xD0671797, 0xE3B8C429 }, { 0xEE9FBEB9, 0x819993BB }, - { 0xEC975421, 0xAE9A8DD1 }, { 0x917E6E31, 0xF3572CDD }, { 0xE2AFF8CE, 0x6393D7DA }, { 0x37DC5338, 0x47A22012 }, - { 0xC903EE35, 0xA32343DE }, { 0xA89A91E6, 0x79FC56C4 }, { 0xDC5751E0, 0x01B28048 }, { 0xE4B7DB7B, 0x1296F564 }, - { 0x51597A12, 0x75F71883 }, { 0xBDCE2E33, 0xDB6D9552 }, { 0x1D74308F, 0x1E9DBB23 }, { 0xFDD322D9, 0x520D7293 }, - { 0x0C304677, 0xE20A4461 }, { 0xB4EAD425, 0xFEEEE2D2 }, { 0x20800675, 0xCA30FDEE }, { 0x47015A13, 0x61EACA4A }, - { 0x87264E30, 0xE74AFE14 }, { 0x7BF119A5, 0x2CC883B2 }, { 0xB3F682DC, 0x1664CF59 }, { 0x1E78AF5B, 0xA811AA7C }, - { 0x648DC3B2, 0x1D5626FB }, { 0xDF5BCE34, 0xB73E9117 }, { 0x6AB56F5D, 0xD05F7CF0 }, { 0xCD132718, 0xFD257F0A }, - { 0x76C52A9E, 0x574DC8E6 }, { 0x2EB8AA9A, 0x0739A7E5 }, { 0x0F3CD9A3, 0x5486553E }, { 0xAA927B7E, 0x56FF48AE }, - { 0xAD8E2D87, 0xBE756525 }, { 0xFFDBC841, 0x7D0E6CF9 }, { 0x1450CA99, 0x3B1ECCA3 }, { 0xE983E840, 0x6913BE30 }, - { 0x956EA71C, 0xAD511009 }, { 0x2DB4354E, 0xB1B5B6BA }, { 0x4E25A005, 0x4469BDCA }, { 0xCA0F71E1, 0x15AF5281 }, - { 0x8D0E2BF2, 0x744598CB }, { 0x2AA863B7, 0x593F9B31 }, { 0x29A4FC63, 0xEFB38A6E }, { 0x4C2D4A9D, 0x6B6AA3A0 }, - { 0xE6BF31E3, 0x3D95EB0E }, { 0x1554BFD5, 0xA291C396 }, { 0xEF9BCBF5, 0x18169C8E }, { 0x9D4E2846, 0x115D68BC }, - { 0xFACF7420, 0xBA875F18 }, { 0xB6E23EBD, 0xD1EDFCB8 }, { 0xF1E364AE, 0xB00736F2 }, { 0x6589B6FE, 0x84D929CE }, - { 0xDA4F7255, 0x70B7A2F6 }, { 0x5C6D4929, 0x0E7253D7 }, { 0x574159A7, 0x04F23A3D }, { 0x0B2C108E, 0x0A8069EA }, - { 0x6BB11A11, 0x49D073C5 }, { 0x39E4FFD7, 0x8AAB7A19 }, { 0x0E38ACEF, 0xCD095A0B }, { 0x5979F548, 0xC9FB6036 }, - { 0xD67F3422, 0x92BDE697 }, { 0x0514BC61, 0xC78933E1 }, { 0x75C9B54A, 0xE1C1D9B9 }, { 0xCF1BCD80, 0xD2266160 }, - { 0x78FD8671, 0x9A4492ED }, { 0x881A9793, 0xB3CCAB2A }, { 0x7FE1D088, 0x72CEBF66 }, { 0x985A9427, 0xD6D45B5D }, -}; - -__device__ uint2 T12[256] = { - { 0x8C3F55DE, 0xC811A805 }, { 0x96B50619, 0x65F5B431 }, { 0xD6706E43, 0xF74F96B1 }, { 0xCB43D336, 0x859D1E8B }, - { 0xCCFA3D84, 0x5AAB8A85 }, { 0xC295FCFD, 0xF9C7BF99 }, { 0xDE4B630F, 0xA21FD5A1 }, { 0x3B8B456D, 0xCDB3EF76 }, - { 0x7CF7C385, 0x803F59F8 }, { 0x5F31913C, 0xB27C73BE }, { 0x33B04821, 0x98E3AC66 }, { 0x26B8F818, 0xBF61674C }, - { 0xC4C130C8, 0x0FFBC995 }, { 0x10761A98, 0xAAA08620 }, { 0x210116AA, 0x6057F342 }, { 0x0654CC35, 0xF63C760C }, - { 0x667D9042, 0x2DDB45CC }, { 0x4BD40382, 0xBCF45A96 }, { 0xEF3C6F3D, 0x68E8A0C3 }, { 0x69FF73BC, 0xA7BD92D2 }, - { 0x01ED2287, 0x290AE202 }, { 0xE885818F, 0xB7DE34CD }, { 0xDD61059B, 0xD901EEA7 }, { 0x19A03553, 0xD6FA2732 }, - { 0x74CCCEC9, 0xD56F1AE8 }, { 0x2E83F554, 0xEA31245C }, { 0xA07BE499, 0x7034555D }, { 0x56E7BEF7, 0xCE26D2AC }, - { 0xA5054E38, 0xFD161857 }, { 0x527436D1, 0x6A0E7DA4 }, { 0x1CDE9FF2, 0x5BD86A38 }, { 0x31770C32, 0xCAF77562 }, - { 0xE279C8D0, 0xB09AAED9 }, { 0xC60674DB, 0x5DEF1091 }, { 0x515E5045, 0x111046A2 }, { 0x729802FC, 0x23536CE4 }, - { 0xF5B63CFA, 0xC50CBCF7 }, { 0xCD171F03, 0x73A16887 }, { 0xD9F28DBD, 0x7D2941AF }, { 0x5A4F3B9D, 0x3F5E3EB4 }, - { 0x1B677140, 0x84EEFE36 }, { 0xE7076271, 0x3DB8E3D3 }, { 0xF20FD248, 0x1A3A28F9 }, { 0xB49E7627, 0x7EBC7C75 }, - { 0xC7EB565C, 0x74E5F293 }, { 0x4F478BA4, 0x18DCF59E }, { 0xA9ADCB52, 0x0C6EF44F }, { 0x98DAC760, 0xC699812D }, - { 0x6E469D0E, 0x788B06DC }, { 0x7521EC4E, 0xFC65F8EA }, { 0x9E8E0B55, 0x30A5F721 }, { 0xBCA57B6B, 0x2BEC3F65 }, - { 0xBAF1B75E, 0xDDD04969 }, { 0xE394EA57, 0x99904CDB }, { 0xE6EA40F6, 0x14B201D1 }, { 0x41284ADD, 0xBBB0C082 }, - { 0xBF8F1DFF, 0x50F20463 }, { 0x93CBACB8, 0xE8D7F93B }, { 0x477C86E8, 0x4D8CB68E }, { 0x92268E3F, 0xC1DD1B39 }, - { 0x09D62FCB, 0x7C5AA112 }, { 0xDB35C9AE, 0x2F3D98AB }, { 0x2BFD5FF5, 0x67136956 }, { 0x36CEE280, 0x15C1E16C }, - { 0xF8F39B17, 0x1D7EB2ED }, { 0xB00DFE01, 0xDA94D37D }, { 0x760B8ADA, 0x877BC3EC }, { 0xE153AE44, 0xCB8495DF }, - { 0xB7B410B3, 0x05A24773 }, { 0x3C32ABDF, 0x12857B78 }, { 0x6812513B, 0x8EB770D0 }, { 0xD2E3E665, 0x536739B9 }, - { 0x71B26468, 0x584D57E2 }, { 0xC9849725, 0xD789C78F }, { 0x7D1AE102, 0xA935BBFA }, { 0xDFA64188, 0x8B1537A3 }, - { 0xC378DE7A, 0xD0CD5D9B }, { 0x4D80CFB7, 0x4AC82C9A }, { 0x83BDB620, 0x42777F1B }, { 0x1D33BD75, 0x72D2883A }, - { 0xAB6A8F41, 0x5E7A2D4B }, { 0xBB1C95D9, 0xF4DAAB6B }, { 0xFD8D31B6, 0x905CFFE7 }, { 0x119B381F, 0x83AA6422 }, - { 0x42022C49, 0xC0AEFB84 }, { 0x63033AE3, 0xA0F908C6 }, { 0x04938826, 0xA428AF08 }, { 0x1A8A53C7, 0xADE41C34 }, - { 0x77E6A85D, 0xAE7121EE }, { 0x25929E8C, 0xC47F5C4A }, { 0x55CDD863, 0xB538E9AA }, { 0xDAD8EB29, 0x06377AA9 }, - { 0xB3279895, 0xA18AE87B }, { 0x35E48414, 0x6EDFDA6A }, { 0x825094A7, 0x6B7D9D19 }, { 0xA4E86CBF, 0xD41CFA55 }, - { 0xEA42C59C, 0xE5CAEDC9 }, { 0x0E6FC179, 0xA36C351C }, { 0x6FABBF89, 0x5181E4DE }, { 0x184D17D4, 0xFFF0C530 }, - { 0x84045892, 0x9D41EB15 }, { 0x28D73961, 0x1C0D5250 }, { 0x0CA8856A, 0xF178EC18 }, { 0x8EF811CD, 0x9A057101 }, - { 0x3EF5EFCC, 0x4091A27C }, { 0x9F6329D2, 0x19AF1523 }, { 0xF91EB990, 0x347450EF }, { 0x8DD27759, 0xE11B4A07 }, - { 0xFC601331, 0xB9561DE5 }, { 0x2DA993C0, 0x912F1F5A }, { 0x5BA2191A, 0x1654DCB6 }, { 0x8A6B99EB, 0x3E2DDE09 }, - { 0x0F82E3FE, 0x8A66D71E }, { 0xD55A08D7, 0x8C51ADB7 }, { 0x8941FF7F, 0x4533E50F }, { 0xBD4859EC, 0x02E6DD67 }, - { 0x5DF6D52F, 0xE068AABA }, { 0xFF4A75A5, 0xC24826E3 }, { 0x88ACDDF8, 0x6C39070D }, { 0x4691A46F, 0x6486548C }, - { 0x135C7C0C, 0xD1BEBD26 }, { 0x8F15334A, 0xB30F9303 }, { 0xC1BF9A69, 0x82D9849F }, { 0x5420FAE4, 0x9C320BA8 }, - { 0xAFF90767, 0xFA528243 }, { 0xE968A308, 0x9ED4D6CF }, { 0x2C44B147, 0xB825FD58 }, { 0x5EDCB3BB, 0x9B7691BC }, - { 0x48FE6516, 0xC7EA6190 }, { 0x817AF233, 0x1063A61F }, { 0x3409A693, 0x47D53868 }, { 0x4C6DED30, 0x63C2CE98 }, - { 0x6C81D91D, 0x2A9FDFD8 }, { 0x032A6694, 0x7B1E3B06 }, { 0xFBD9FD83, 0x666089EB }, { 0x7375207B, 0x0A598EE6 }, - { 0x0AFC495F, 0x07449A14 }, { 0xB6593234, 0x2CA8A571 }, { 0x45BBC2FB, 0x1F986F8A }, { 0x50B372C2, 0x381AA4A0 }, - { 0xD81FAF3A, 0x5423A3AD }, { 0x8B86BB6C, 0x17273C0B }, { 0xC869B5A2, 0xFE83258D }, { 0xD1C980F1, 0x287902BF }, - { 0x6B3837AF, 0xF5A94BD6 }, { 0xB2CABA12, 0x88800A79 }, { 0x083B0D4C, 0x55504310 }, { 0x07B9EEB2, 0xDF36940E }, - { 0x6790B2C5, 0x04D1A7CE }, { 0xF125B4DC, 0x612413FF }, { 0xC52C124F, 0x26F12B97 }, { 0xA62F28AC, 0x86082351 }, - { 0x9937E5E7, 0xEF93632F }, { 0x293A1BE6, 0x3507B052 }, { 0x570A9C70, 0xE72C30AE }, { 0xAE1425E0, 0xD3586041 }, - { 0xD79D4CC4, 0xDE4574B3 }, { 0x40C5685A, 0x92BA2280 }, { 0xDC8C271C, 0xF00B0CA5 }, { 0xF69C5A6E, 0xBE1287F1 }, - { 0xB1E0DC86, 0xF39E317F }, { 0x20EC342D, 0x495D1140 }, { 0x3F18CD4B, 0x699B407E }, { 0x6AD51528, 0xDCA3A9D4 }, - { 0x79896924, 0x0D1D14F2 }, { 0x00000000, 0x00000000 }, { 0xA196C61E, 0x593EB75F }, { 0x0B116BD8, 0x2E4E7816 }, - { 0x58887F8E, 0x6D4AE7B0 }, { 0x872E3E06, 0xE65FD013 }, { 0xD30EC4E2, 0x7A6DDBBB }, { 0xCAAEF1B1, 0xAC97FC89 }, - { 0x1E19DBE1, 0x09CCB33C }, { 0x62EE1864, 0x89F3EAC4 }, { 0xAA87ADC6, 0x7770CF49 }, { 0x6557F6D6, 0x56C57ECA }, - { 0x6D6CFB9A, 0x03953DDA }, { 0x4456E07C, 0x36928D88 }, { 0x959F608D, 0x1EEB8F37 }, { 0x4EAAA923, 0x31D6179C }, - { 0xE5C02662, 0x6FAC3AD7 }, { 0x53991456, 0x43049FA6 }, { 0xC052B8EE, 0xABD3669D }, { 0xA7C20A2B, 0xAF02C153 }, - { 0x3723C007, 0x3CCB036E }, { 0x90E1CA2C, 0x93C9C23D }, { 0x2F6ED7D3, 0xC33BC65E }, { 0x9758249E, 0x4CFF5633 }, - { 0x325D6AA6, 0xB1E94E64 }, { 0x9472420A, 0x37E16D35 }, { 0xBE623F78, 0x79F8E661 }, { 0x02C74413, 0x5214D904 }, - { 0xF0C8965B, 0x482EF1FD }, { 0xEC1609A9, 0x13F69BC5 }, { 0x14E592BE, 0x0E882928 }, { 0x2A107D72, 0x4E198B54 }, - { 0xEBAFE71B, 0xCCC00FCB }, { 0x222B703E, 0x1B49C844 }, { 0xA840E9D5, 0x2564164D }, { 0x1FF4F966, 0x20C6513E }, - { 0x910CE8AB, 0xBAC3203F }, { 0x61C47EF0, 0xF2EDD1C2 }, { 0xACD361F3, 0x814CB945 }, { 0x4A392105, 0x95FEB894 }, - { 0x1622D6AD, 0x5C9CF02C }, { 0xF77178E9, 0x971865F3 }, { 0x9BF0A1F4, 0xBD87BA2B }, { 0x59655D09, 0x444005B2 }, - { 0x247FBC0B, 0xED75BE48 }, { 0x17CFF42A, 0x7596122E }, { 0x85E97A15, 0xB44B0917 }, { 0x2755DA9F, 0x966B854E }, - { 0x49134791, 0xEEE08392 }, { 0x23C652B9, 0x32432A46 }, { 0xAD3E4374, 0xA8465B47 }, { 0x12B15E8B, 0xF8B45F24 }, - { 0x78644BA3, 0x2417F6F0 }, { 0x7FDDA511, 0xFB2162FE }, { 0x9DA46DC1, 0x4BBBCC27 }, { 0xD024A276, 0x0173E0BD }, - { 0xA2BCA08A, 0x22208C59 }, { 0xB836F34D, 0x8FC4906D }, { 0x3A6667EA, 0xE4B90D74 }, { 0x705F46EF, 0x7147B5E0 }, - { 0x1508B039, 0x2782CB2A }, { 0xF45B1E7D, 0xEC065EF5 }, { 0xCFD05B10, 0x21B5B183 }, { 0x60295C77, 0xDBE733C0 }, - { 0x394C017E, 0x9FA73672 }, { 0x86C31C81, 0xCF553211 }, { 0x0D45A7ED, 0xD8720E1A }, { 0x3DDF8958, 0x3B8F997A }, - { 0xEDFB2B2E, 0x3AFC79C7 }, { 0x43EF0ECE, 0xE9A41986 }, { 0x7B4E2D37, 0x5F09CDF6 }, { 0xFA34DF04, 0x4F6A6BE9 }, - { 0x38A123F9, 0xB6ADD470 }, { 0x057EAAA1, 0x8D224D0A }, { 0x5C1BF7A8, 0xC96248B8 }, { 0x309A2EB5, 0xE3FD9760 }, - { 0xA351820D, 0x0B2A6E5B }, { 0xFEA75722, 0xEB42C4E1 }, { 0x9A1D8373, 0x948D5829 }, { 0x64BAD451, 0x7FCF9CC8 }, - { 0xD4B72A50, 0xA55B4FB5 }, { 0xCE3D7997, 0x08BF5381 }, { 0xE42D04E5, 0x46A6D8D5 }, { 0x7E308796, 0xD22B80FC }, - { 0xB57354A0, 0x57B69E77 }, { 0x8097D0B4, 0x3969441D }, { 0xF3E2F0CF, 0x3330CAFB }, { 0xE0BE8CC3, 0xE28E77DD }, - { 0x9C494F46, 0x62B12E25 }, { 0xB9DBD1CA, 0xA6CE726F }, { 0xEED14DBA, 0x41E242C1 }, { 0x7AA30FB0, 0x76032FF4 }, -}; - -__device__ uint2 T22[256] = { - { 0x3ACDE4CC, 0x45B268A9 }, { 0x84549D08, 0xAF7F0BE8 }, { 0xC1468263, 0x048354B3 }, { 0xC80EFED2, 0x925435C2 }, - { 0x7FDFFBA7, 0xEE4E37F2 }, { 0x0C60F14D, 0x167A3392 }, { 0xEA03E584, 0xFB123B52 }, { 0xFDBB9007, 0x4A0CAB53 }, - { 0x0F788A19, 0x9DEAF638 }, { 0x8F0CB32A, 0xCB48EC55 }, { 0xD6FEF7E0, 0xB59DC4B2 }, { 0xF4F3ECB6, 0xDCDBCA22 }, - { 0x549A9C40, 0x11DF5813 }, { 0x568ACED3, 0xE33FDEDF }, { 0x4322E9C3, 0xA0C1C812 }, { 0x58FA6D0D, 0x07A56B81 }, - { 0xB1E1F3DD, 0x77279579 }, { 0x422AC004, 0xD9B18B74 }, { 0xFFABC294, 0xB8EC2D9F }, { 0x2D75914F, 0xF4ACF8A8 }, - { 0xEF2B6878, 0x7BBF69B1 }, { 0x487AC7E1, 0xC4F62FAF }, { 0xC67E5D0C, 0x76CE809C }, { 0x92E4C14C, 0x6711D88F }, - { 0x243DEDFE, 0x627B99D9 }, { 0xDFB68B51, 0x234AA5C3 }, { 0x262DBF6D, 0x909B1F15 }, { 0x4B62BCB5, 0x4F66EA05 }, - { 0x52AA6AE8, 0x1AE2CF5A }, { 0xD0CE0148, 0xBEA053FB }, { 0xE66314C9, 0xED6808C0 }, { 0x15A82710, 0x43FE16CD }, - { 0xA06970F6, 0xCD049231 }, { 0x97CC4CB0, 0xE7BC8A6C }, { 0xFCB3B9C0, 0x337CE835 }, { 0x7CC780F3, 0x65DEF258 }, - { 0x4132BB50, 0x52214EDE }, { 0x90F493DF, 0x95F15E43 }, { 0x5DD2E0F1, 0x87083962 }, { 0xFB8B66AF, 0x41313C1A }, - { 0x51B211BC, 0x91720AF0 }, { 0xD4EEA573, 0x477D427E }, { 0xF6E3BE25, 0x2E3B4CEE }, { 0xEB0BCC43, 0x82627834 }, - { 0x78E724C8, 0x9C03E3DD }, { 0xD9867DF9, 0x2877328A }, { 0xE243B0F2, 0x14B51945 }, { 0xF7EB97E2, 0x574B0F88 }, - { 0x9AA4943A, 0x88B6FA98 }, { 0xCB168586, 0x19C4F068 }, { 0xAF11FAEF, 0x50EE6409 }, { 0xC04EABA4, 0x7DF317D5 }, - { 0x98B4C6A9, 0x7A567C54 }, { 0x4F42188E, 0xB6BBFB80 }, { 0x3BC5CD0B, 0x3CC22BCF }, { 0xAA397713, 0xD04336EA }, - { 0xEC33132C, 0xF02FAC1B }, { 0xF0D3488D, 0x2506DBA7 }, { 0xF2C31A1E, 0xD7E65D6B }, { 0x1FF820F5, 0x5EB9B216 }, - { 0xC46E0F9F, 0x842E0650 }, { 0x9E843001, 0x716BEB1D }, { 0xAB315ED4, 0xA933758C }, { 0xA2792265, 0x3FE414FD }, - { 0x1EF00932, 0x27C9F170 }, { 0x70A771BE, 0x73A4C1CA }, { 0xE76B3D0E, 0x94184BA6 }, { 0x8C14C87E, 0x40D829FF }, - { 0xC77674CB, 0x0FBEC3FA }, { 0x4A6A9572, 0x3616A963 }, { 0xC25EF937, 0x8F139119 }, { 0x5AEA3F9E, 0xF545ED4D }, - { 0x50BA387B, 0xE8024996 }, { 0x0B582E22, 0x6437E7BD }, { 0xE053E261, 0xE6559F89 }, { 0x05288DFC, 0x80AD52E3 }, - { 0xE34B9935, 0x6DC55A23 }, { 0x1AD0AD09, 0xDE14E0F5 }, { 0xA659865E, 0xC6390578 }, { 0x09487CB1, 0x96D76171 }, - { 0x21156002, 0xE2D6CB3A }, { 0x779FAED1, 0x01E915E5 }, { 0x6A77DCB7, 0xADB0213F }, { 0xB9A1A6AB, 0x9880B76E }, - { 0x8644CF9B, 0x5D9F8D24 }, { 0xC5662658, 0xFD5E4536 }, { 0x9BACBDFD, 0xF1C6B9FE }, { 0xBE9979C4, 0xEACD6341 }, - { 0x08405576, 0xEFA72217 }, { 0xD88E543E, 0x510771EC }, { 0x671F043D, 0xC2BA51CB }, { 0x71AF5879, 0x0AD482AC }, - { 0x5CDAC936, 0xFE787A04 }, { 0x8E049AED, 0xB238AF33 }, { 0x4972EE26, 0xBD866CC9 }, { 0xBD810290, 0x615DA6EB }, - { 0x8B2C1711, 0x3295FDD0 }, { 0x73BF0AEA, 0xF8340460 }, { 0x758FFC42, 0xF3099329 }, { 0x7DCFA934, 0x1CAEB13E }, - { 0x1188832B, 0xBA230748 }, { 0x874CE65C, 0x24EFCE42 }, { 0xB0E9DA1A, 0x0E57D61F }, { 0xF99B343C, 0xB3D1BAD6 }, - { 0x893C4582, 0xC0757B1C }, { 0x403A9297, 0x2B510DB8 }, { 0xF1DB614A, 0x5C7698C1 }, { 0xD5E68CB4, 0x3E0D0118 }, - { 0x855CB4CF, 0xD60F488E }, { 0xF3CB33D9, 0xAE961E0D }, { 0x14A00ED7, 0x3A8E55AB }, { 0x623789C1, 0x42170328 }, - { 0x9C946292, 0x838B6DD1 }, { 0xED3B3AEB, 0x895FEF7D }, { 0x4E4A3149, 0xCFCBB8E6 }, { 0x2F65C3DC, 0x064C7E64 }, - { 0x4C5A63DA, 0x3D2B3E2A }, { 0xA9210C47, 0x5BD3F340 }, { 0xA1615931, 0xB474D157 }, { 0x1DE87266, 0xAC5934DA }, - { 0x7AF7765B, 0x6EE36511 }, { 0x16B05C44, 0xC86ED367 }, { 0x201D49C5, 0x9BA6885C }, { 0x88346C45, 0xB905387A }, - { 0xBAB9DDFF, 0x131072C4 }, { 0xA751AF99, 0xBF49461E }, { 0x1CE05BA1, 0xD52977BC }, { 0x6027DB52, 0xB0F785E4 }, - { 0x6E57788C, 0x546D30BA }, { 0x650F56AE, 0x305AD707 }, { 0x612FF295, 0xC987C682 }, { 0xF5FBC571, 0xA5AB8944 }, - { 0x59F244CA, 0x7ED528E7 }, { 0x2C7DB888, 0x8DDCBBCE }, { 0x328DB1BA, 0xAA154ABE }, { 0x93ECE88B, 0x1E619BE9 }, - { 0xE813B717, 0x09F2BD9E }, { 0x285D1CB3, 0x7401AA4B }, { 0x3195CAEE, 0x21858F14 }, { 0x1398D1B8, 0x48C38184 }, - { 0xB2F98889, 0xFCB750D3 }, { 0x8D1CE1B9, 0x39A86A99 }, { 0xE473465A, 0x1F888E0C }, { 0x76978716, 0x78995683 }, - { 0xEE2341BF, 0x02CF2AD7 }, { 0xB3F1A14E, 0x85C713B5 }, { 0x2B4567E7, 0xFF916FE1 }, { 0xB7D10575, 0x7C1A0230 }, - { 0x5ECA9BA5, 0x0C98FCC8 }, { 0xDA9E06AD, 0xA3E7F720 }, { 0xBBB1F438, 0x6A6031A2 }, { 0x7ED7D260, 0x973E7494 }, - { 0x18C0FF9A, 0x2CF46639 }, { 0x68678E24, 0x5F50A7F3 }, { 0xA449D4CD, 0x34D983B4 }, { 0x5592B587, 0x68AF1B75 }, - { 0x2E6DEA1B, 0x7F3C3D02 }, { 0x45121F6B, 0xABFC5F5B }, { 0x29553574, 0x0D71E92D }, { 0x6D4F03D8, 0xDFFDF510 }, - { 0x9F8C19C6, 0x081BA87B }, { 0xAC0981BB, 0xDB7EA1A3 }, { 0x66172DFA, 0xBBCA12AD }, { 0x010829C7, 0x79704366 }, - { 0x7BFF5F9C, 0x17932677 }, { 0x00000000, 0x00000000 }, { 0xC906D715, 0xEB2476A4 }, { 0x0738DF6F, 0x724DD42F }, - { 0x38DDB65F, 0xB752EE65 }, { 0x3DF53BA3, 0x37FFBC86 }, { 0xB5C157E6, 0x8EFA84FC }, { 0x272596AA, 0xE9EB5C73 }, - { 0x2535C439, 0x1B0BDABF }, { 0x2A4D4E20, 0x86E12C87 }, { 0xCE3E087A, 0x9969A28B }, { 0x9D9C4B55, 0xFAFB2EB7 }, - { 0xB6D92CB2, 0x056A4156 }, { 0xDEBEA296, 0x5A3AE6A5 }, { 0xA8292580, 0x22A3B026 }, { 0x36AD1581, 0x53C85B3B }, - { 0x17B87583, 0xB11E9001 }, { 0x3FE56930, 0xC51F3A4A }, { 0xCF3621BD, 0xE019E1ED }, { 0x91FCBA18, 0xEC811D25 }, - { 0x4D524A1D, 0x445B7D4C }, { 0xDCAEF005, 0xA8DA6069 }, { 0x309DE329, 0x58F5CC72 }, { 0x6B7FF570, 0xD4C06259 }, - { 0x39D59F98, 0xCE22AD03 }, { 0x47024DF8, 0x591CD997 }, { 0x03187B54, 0x8B90C5AA }, { 0xC356D0F0, 0xF663D27F }, - { 0x35B56ED5, 0xD8589E91 }, { 0xD3D67A1C, 0x35309651 }, { 0xCD26732E, 0x12F96721 }, { 0x441A36AC, 0xD28C1C3D }, - { 0x64077F69, 0x492A9461 }, { 0x6F5F514B, 0x2D1D73DC }, { 0x0D68D88A, 0x6F0A70F4 }, { 0xCA1EAC41, 0x60B4B30E }, - { 0x3385987D, 0xD36509D8 }, { 0x0630F6A8, 0x0B3D9749 }, { 0x96C46577, 0x9ECCC90A }, { 0xAD01A87C, 0xA20EE2C5 }, - { 0x0E70A3DE, 0xE49AB55E }, { 0x82646BA0, 0xA4429CA1 }, { 0xDB962F6A, 0xDA97B446 }, { 0xD7F6DE27, 0xCCED87D4 }, - { 0x37A53C46, 0x2AB8185D }, { 0xE15BCBA6, 0x9F25DCEF }, { 0xFEA3EB53, 0xC19C6EF9 }, { 0x1BD884CE, 0xA764A393 }, - { 0x817C10F4, 0x2FD2590B }, { 0x80743933, 0x56A21A6D }, { 0x79EF0D0F, 0xE573A0BB }, { 0x95DC1E23, 0x155C0CA0 }, - { 0x94D437E4, 0x6C2C4FC6 }, { 0x23053291, 0x10364DF6 }, { 0x836C4267, 0xDD32DFC7 }, { 0x99BCEF6E, 0x03263F32 }, - { 0xE57B6F9D, 0x66F8CD6A }, { 0x5BE21659, 0x8C35AE2B }, { 0x1290F87F, 0x31B3C2E2 }, { 0xBF915003, 0x93BD2027 }, - { 0x220D1B56, 0x69460E90 }, { 0xAE19D328, 0x299E276F }, { 0x53A2432F, 0x63928C3C }, { 0xE91B9ED0, 0x7082FEF8 }, - { 0x3EED40F7, 0xBC6F792C }, { 0xD2DE53DB, 0x4C40D537 }, { 0x5FC2B262, 0x75E8BFAE }, { 0xA541FD0A, 0x4DA9C0D2 }, - { 0x3CFD1264, 0x4E8FFFE0 }, { 0x696FA7E3, 0x2620E495 }, { 0xB8A98F6C, 0xE1F0F408 }, { 0xDDA6D9C2, 0xD1AA230F }, - { 0xD1C6288F, 0xC7D0109D }, { 0x7487D585, 0x8A79D04F }, { 0xA3710BA2, 0x4694579B }, { 0xFA834F68, 0x38417F7C }, - { 0x0A5007E5, 0x1D47A4DB }, { 0x460A643F, 0x206C9AF1 }, { 0x34BD4712, 0xA128DDF7 }, { 0x72B7232D, 0x81444706 }, - { 0x02105293, 0xF2E086CC }, { 0xBC892B57, 0x182DE58D }, { 0xF8931DFB, 0xCAA1F9B0 }, { 0xCC2E5AE9, 0x6B892447 }, - { 0x0420A43B, 0xF9DD1185 }, { 0x8A243ED6, 0x4BE5BEB6 }, { 0x19C8D65D, 0x5584255F }, { 0x633FA006, 0x3B67404E }, - { 0x6C472A1F, 0xA68DB676 }, { 0xB4C97E21, 0xF78AC79A }, { 0x1080AAEC, 0xC353442E }, { 0x5782E714, 0x9A4F9DB9 }, -}; - -__device__ uint2 T32[256] = { - { 0x2C9B3220, 0x05BA7BC8 }, { 0xF8B65E4F, 0x31A54665 }, { 0x7547F4D4, 0xB1B651F7 }, { 0x7BA46682, 0x8BFA0D85 }, - { 0xA16A98BB, 0x85A96C5A }, { 0x08EB79C9, 0x990FAEF9 }, { 0x47F4A62D, 0xA15E37A2 }, { 0x5D27741E, 0x76857DCD }, - { 0x0A1820BC, 0xF8C50B80 }, { 0x01F7A2B4, 0xBE65DCB2 }, { 0x6F9426E7, 0x666D1B98 }, { 0x53C4E648, 0x4CC921BF }, - { 0x93D9CA42, 0x95410A0F }, { 0x647BA4EF, 0x20CDCCAA }, { 0x890A1871, 0x429A4060 }, { 0x9B32B38B, 0x0C4EA4F6 }, - { 0xDE354CD3, 0xCCDA362D }, { 0x7C5B2FA9, 0x96DC23BC }, { 0xAA851AB3, 0xC309BB68 }, { 0x3648E013, 0xD26131A7 }, - { 0x41FC4DB2, 0x021DC529 }, { 0x704BE48A, 0xCD5ADAB7 }, { 0x84ED71E6, 0xA77965D9 }, { 0x1734BBA4, 0x32386FD6 }, - { 0x38AB7245, 0xE82D6DD5 }, { 0x6177B4B1, 0x5C2147EA }, { 0xCF091CE8, 0x5DA1AB70 }, { 0x72B8BDFF, 0xAC907FCE }, - { 0x972278A8, 0x57C85DFD }, { 0x6B6F940D, 0xA4E44C6A }, { 0x4F1FDFE4, 0x3851995B }, { 0xED71BC9E, 0x62578CCA }, - { 0xC01D2C0A, 0xD9882BB0 }, { 0x113C503B, 0x917B9D5D }, { 0xA87643C6, 0xA2C31E11 }, { 0xA399C1CE, 0xE463C923 }, - { 0x7EA876DC, 0xF71686C5 }, { 0xE096D509, 0x87B4A973 }, { 0x9D3A5814, 0xAF0D567D }, { 0x59DCC6F4, 0xB40C2A3F }, - { 0x95D121DD, 0x3602F884 }, { 0x9836484A, 0xD3E1DD3D }, { 0xA46688E5, 0xF945E71A }, { 0xB2A591F5, 0x7518547E }, - { 0x50C01D89, 0x93665874 }, { 0x658C065B, 0x9EA81018 }, { 0xBC4603A3, 0x4F54080C }, { 0x5137BF3D, 0x2D0384C6 }, - { 0xEC861E2A, 0xDC325078 }, { 0x79573FF7, 0xEA30A8FC }, { 0xCA050CB6, 0x214D2030 }, { 0x8016C30C, 0x65F0322B }, - { 0x1B247087, 0x69BE96DD }, { 0x81E161B8, 0xDB95EE99 }, { 0xD9CA05F8, 0xD1FC1814 }, { 0xCC0DE729, 0x820ED2BB }, - { 0x430F14C7, 0x63D76050 }, { 0xA09D3A0F, 0x3BCCB0E8 }, { 0x573F54A2, 0x8E40764D }, { 0xE16177BD, 0x39D175C1 }, - { 0x734F1F4B, 0x12F5A37C }, { 0x1FDFC26D, 0xAB37C12F }, { 0x395CD0F1, 0x5648B167 }, { 0x37BF42A7, 0x6C04ED15 }, - { 0x14304065, 0xED97161D }, { 0xAB72B807, 0x7D6C67DA }, { 0xBA4EE83C, 0xEC17FA87 }, { 0x0304FBC1, 0xDFAF79CB }, - { 0x71BC463E, 0x733F0605 }, { 0x87E98A27, 0x78D61C12 }, { 0x77B4ADA1, 0xD07CF48E }, { 0x6C90DD26, 0xB9C26253 }, - { 0x60801605, 0xE2449B58 }, { 0xF941FCFB, 0x8FC09AD7 }, { 0x4BE46D0E, 0xFAD8CEA9 }, { 0x0608EB9F, 0xA343F28B }, - { 0x4917347B, 0x9B126BD0 }, { 0xE7699C22, 0x9A92874A }, { 0xC4E69EE0, 0x1B017C42 }, { 0x0EE39256, 0x3A4C5C72 }, - { 0x3EA399DA, 0x4B6E9F5E }, { 0x5AD83D35, 0x6BA353F4 }, { 0x4C1B2425, 0xE7FEE090 }, { 0x2587E95D, 0x22D00983 }, - { 0x0F1430E2, 0x842980C0 }, { 0x861E2893, 0xC6B3C0A0 }, { 0x19D729F2, 0x087433A4 }, { 0xD42D6C6F, 0x341F3DAD }, - { 0xFBB2A58E, 0xEE0A3FAE }, { 0x90DD3183, 0x4AEE73C4 }, { 0xB1A16A34, 0xAAB72DB5 }, { 0x5E238FDF, 0xA92A0406 }, - { 0x686B6FCC, 0x7B4B35A1 }, { 0xF4A6956C, 0x6A23BF6E }, { 0x851AD352, 0x191CB96B }, { 0xD6DE351A, 0x55D598D4 }, - { 0xF2AE7EF3, 0xC9604DE5 }, { 0xA981E172, 0x1CA6C2A3 }, { 0xAD7A5398, 0xDE2F9551 }, { 0x56C8F616, 0x3025AAFF }, - { 0x1E2860D9, 0x15521D9D }, { 0xFA45073A, 0x506FE31C }, { 0x2B647B0B, 0x189C55F1 }, { 0xAE7EA859, 0x0180EC9A }, - { 0x050C105E, 0x7CEC8B40 }, { 0x8BF94104, 0x2350E519 }, { 0x55CC0DD7, 0xEF8AD334 }, { 0x6D677F92, 0x07A7BEE1 }, - { 0x0DE76997, 0xE5E325B9 }, { 0xA26E637A, 0x5A061591 }, { 0x18208B46, 0xB611EF16 }, { 0xB7A981AB, 0x09F4DF3E }, - { 0xE87DACC0, 0x1EBB078A }, { 0xB65E231F, 0xB791038C }, { 0x74B05660, 0x0FD38D45 }, { 0xC1EA8EBE, 0x67EDF702 }, - { 0x831238CD, 0xBA5F4BE0 }, { 0xCEFEBE5C, 0xE3C477C2 }, { 0x354C1BD2, 0x0DCE486C }, { 0x16C31910, 0x8C5DB364 }, - { 0xA7627324, 0x26EA9ED1 }, { 0xEF82E5EB, 0x039D29B3 }, { 0xCBF2AE02, 0x9F28FC82 }, { 0xF05D2786, 0xA8AAE89C }, - { 0x2774B028, 0x431AACFA }, { 0x31B7A938, 0xCF471F9E }, { 0xE3922EC8, 0x581BD0B8 }, { 0x400BEF06, 0xBC78199B }, - { 0xBF42F862, 0x90FB71C7 }, { 0x46030499, 0x1F3BEB10 }, { 0xB55AD8DE, 0x683E7A47 }, { 0xA695D190, 0x988F4263 }, - { 0x6E638453, 0xD808C72A }, { 0xC319D7CB, 0x0627527B }, { 0xD72997AE, 0xEBB04466 }, { 0xE2658C7C, 0xE67E0C0A }, - { 0xB056C880, 0x14D2F107 }, { 0x30400B8C, 0x7122C32C }, { 0xD5DACEDB, 0x8A7AE11F }, { 0xE98A0E74, 0xA0DEDB38 }, - { 0xDCC615A6, 0xAD109354 }, { 0xF655CC19, 0x0BE91A17 }, { 0xB8BDB149, 0x8DDD5FFE }, { 0xAF890AED, 0xBFE53028 }, - { 0xB4AD7A6A, 0xD65BA6F5 }, { 0x2997227E, 0x7956F088 }, { 0x32B352F9, 0x10E86655 }, { 0xDACEFE39, 0x0E5361DF }, - { 0x9FC90161, 0xCEC7F304 }, { 0x677F5F2E, 0xFF62B561 }, { 0xD22587F0, 0x975CCF26 }, { 0x543BAF63, 0x51EF0F86 }, - { 0x10CBF28F, 0x2F1E41EF }, { 0xBBB94A88, 0x52722635 }, { 0x3344F04D, 0xAE8DBAE7 }, { 0x6688FD9A, 0x410769D3 }, - { 0x34BBB966, 0xB3AB94DE }, { 0x8DF1AA9B, 0x80131792 }, { 0xC5113C54, 0xA564A0F0 }, { 0xBDB1A117, 0xF131D4BE }, - { 0xEA8EF5B5, 0x7F71A2F3 }, { 0xC8F655C3, 0x40878549 }, { 0x44F05DEC, 0x7EF14E69 }, { 0xF55137D8, 0xD44663DC }, - { 0x523344FC, 0xF2ACFD0D }, { 0x00000000, 0x00000000 }, { 0x8EF5515A, 0x5FBC6E59 }, { 0xF1AA8532, 0x16CF342E }, - { 0xDB395C8D, 0xB036BD6D }, { 0xDD31B712, 0x13754FE6 }, { 0x2D6C9094, 0xBBDFA77A }, { 0x3A582B30, 0x89E7C8AC }, - { 0xCDFA459D, 0x3C6B0E09 }, { 0xC7E26521, 0xC4AE0589 }, { 0x7F5FD468, 0x49735A77 }, { 0x1D2C9B18, 0xCAFD6456 }, - { 0x2F9FC9E1, 0xDA150203 }, { 0x94268369, 0x88672436 }, { 0x3BAF8984, 0x3782141E }, { 0x24704BE9, 0x9CB5D531 }, - { 0x1AD3D233, 0xD7DB4A6F }, { 0x2A93D9BF, 0xA6F98943 }, { 0x8A0EE3B0, 0x9D3539AB }, { 0x15C7E2D1, 0x53F2CAAF }, - { 0x76430F15, 0x6E19283C }, { 0x6384EDC4, 0x3DEBE293 }, { 0x208BF903, 0x5E3C82C3 }, { 0xB94A13FD, 0x33B8834C }, - { 0x2E686B55, 0x6470DEB1 }, { 0x7A53C436, 0x359FD137 }, { 0x02F35975, 0x61CAA579 }, { 0x82E59A79, 0x043A9752 }, - { 0x2683129C, 0xFD7F7048 }, { 0x699CCD78, 0xC52EE913 }, { 0x7DAC8D1D, 0x28B9FF0E }, { 0x78A09D43, 0x5455744E }, - { 0xB3523341, 0xCB7D88CC }, { 0x4A13CFBA, 0x44BD121B }, { 0xFDBA4E11, 0x4D49CD25 }, { 0x8C06082F, 0x3E76CB20 }, - { 0x2278A076, 0x3FF627BA }, { 0x04FBB2EA, 0xC28957F2 }, { 0xE46D67E3, 0x453DFE81 }, { 0x3DA7621B, 0x94C1E695 }, - { 0xFF491764, 0x2C83685C }, { 0xFC4DECA5, 0xF32C1197 }, { 0x922E68F6, 0x2B24D6BD }, { 0x9AC5113F, 0xB22B7844 }, - { 0xD1217C31, 0x48F3B6ED }, { 0xBEB55AD6, 0x2E9EAD75 }, { 0x5FD42D6B, 0x174FD8B4 }, { 0x1238ABFA, 0x4ED4E496 }, - { 0xFEBEB5D0, 0x92E6B4EE }, { 0x0BEF8208, 0x46A0D732 }, { 0xA5912A51, 0x47203BA8 }, { 0xE69E3E96, 0x24F75BF8 }, - { 0x13CF094E, 0xF0B13824 }, { 0xC901F777, 0xFEE259FB }, { 0x091CDB7D, 0x276A724B }, { 0xEE75475F, 0xBDF8F501 }, - { 0x4DEC8691, 0x599B3C22 }, { 0x99C1EAFE, 0x6D84018F }, { 0x1CDB39AC, 0x7498B8E4 }, { 0x217C5BB7, 0xE0595E71 }, - { 0x3C50C0AF, 0x2AA43A27 }, { 0x3F543B6E, 0xF50B43EC }, { 0x62734F70, 0x838E3E21 }, { 0x4507FF58, 0xC09492DB }, - { 0xDFC2EE67, 0x72BFEA9F }, { 0x9CCDFAA0, 0x11688ACF }, { 0x6A9836B9, 0x1A8190D8 }, { 0xC615C795, 0x7ACBD93B }, - { 0x286080CA, 0xC7332C3A }, { 0x4EE87D50, 0x863445E9 }, { 0xD0D6DE85, 0xF6966A5F }, { 0x96D5DA1C, 0xE9AD814F }, - { 0x9E3EA3D5, 0x70A22FB6 }, { 0x582B6440, 0x0A69F68D }, { 0xC2EE757F, 0xB8428EC9 }, { 0xAC8DF12C, 0x604A49E3 }, - { 0x0C10CB23, 0x5B86F90B }, { 0x8F02F3EE, 0xE1D9B2EB }, { 0xD3D22544, 0x29391394 }, { 0x5CD0D6AA, 0xC8E0A17F }, - { 0xF7A26EAD, 0xB58CC6A5 }, { 0x238F02C2, 0x8193FB08 }, { 0x5B2F9F81, 0xD5C68F46 }, { 0x88FDBAC5, 0xFCFF9CD2 }, - { 0xF359DC47, 0x77059157 }, { 0x07FF492B, 0x1D262E39 }, { 0xE59AC557, 0xFB582233 }, { 0x42F8B673, 0xDDB2BCE2 }, - { 0x48E096CF, 0x2577B762 }, { 0xD83DA74C, 0x6F99C4A6 }, { 0xEB795701, 0xC1147E41 }, { 0x912A9337, 0xF48BAF76 }, -}; - -__device__ uint2 T42[256] = { - { 0x9B2C0A19, 0x3EF29D24 }, { 0xB6F8622F, 0xE9E16322 }, { 0x47757F7A, 0x55369940 }, { 0xA47B0B33, 0x9F4D56D5 }, - { 0x6AA1174C, 0x82256746 }, { 0xEB082FB2, 0xB8F5057D }, { 0xF4475F53, 0xCC48C10B }, { 0x275DEC3A, 0x373088D4 }, - { 0x180AED10, 0x968F4325 }, { 0xF7016151, 0x173D232C }, { 0x946FCC13, 0xAE4ED09F }, { 0xC4539873, 0xFD4B4741 }, - { 0xD9933765, 0x1B5B3F0D }, { 0x7B644052, 0x2FFCB096 }, { 0x0A89840C, 0xE02376D2 }, { 0x329B18D7, 0xA3AE3A70 }, - { 0x35DE8526, 0x419CBD23 }, { 0x5B7C3199, 0xFAFEBF11 }, { 0x85AA9B0D, 0x0397074F }, { 0x4836B970, 0xC58AD4FB }, - { 0xFC4104A8, 0xBEC60BE3 }, { 0x4B708772, 0x1EFF36DC }, { 0xED8453B6, 0x131FDC33 }, { 0x341764D3, 0x0844E33E }, - { 0xAB38CD39, 0x0FF11B6E }, { 0x7761B85A, 0x64351F0A }, { 0x09CFBA0E, 0x3B5694F5 }, { 0xB87245D0, 0x30857084 }, - { 0x2297AE3C, 0x47AFB3BD }, { 0x6F6B554A, 0xF2BA5C2F }, { 0x1F4F70E1, 0x74BDC476 }, { 0x71EDC45E, 0xCFDFC644 }, - { 0x1DC0AF16, 0xE610784C }, { 0x3C113F28, 0x7ACA29D6 }, { 0x76A859AF, 0x2DED4117 }, { 0x99A3D5EE, 0xAC5F211E }, - { 0xA87EF33B, 0xD484F949 }, { 0x96E013E4, 0x3CE36CA5 }, { 0x3A9D432C, 0xD120F098 }, { 0xDC597563, 0x6BC40464 }, - { 0xD1956C9E, 0x69D5F5E5 }, { 0x3698BB24, 0x9AE95F04 }, { 0x66A4EF44, 0xC9ECC8DA }, { 0xA5B2EAC6, 0xD69508C8 }, - { 0xC0503B80, 0xC40C2235 }, { 0x8C652103, 0x38C193BA }, { 0x46BC9E8F, 0x1CEEC75D }, { 0x37515AD1, 0xD3310119 }, - { 0x86ECA50F, 0xD8E2E568 }, { 0x5779C991, 0xB137108D }, { 0x05CA4206, 0x709F3B69 }, { 0x1680CAEF, 0x4FEB5083 }, - { 0x241BD238, 0xEC456AF3 }, { 0xE181ABBE, 0x58D673AF }, { 0xCAD9BF8C, 0x242F54E7 }, { 0x0DCC19FD, 0x0211F181 }, - { 0x0F43C60A, 0x90BC4DBB }, { 0x9DA0761D, 0x9518446A }, { 0x3F57012A, 0xA1BFCBF1 }, { 0x61E172B5, 0x2BDE4F89 }, - { 0x4F732481, 0x27B853A8 }, { 0xDF1F4B61, 0xB0B1E643 }, { 0x5C39AC68, 0x18CC3842 }, { 0xBF37D821, 0xD2B7F7D7 }, - { 0x3014C720, 0x3103864A }, { 0x72ABFA5C, 0x14AA2463 }, { 0x4EBAC574, 0x6E600DB5 }, { 0x0403A3F3, 0x39476574 }, - { 0xBC71E623, 0x09C215F0 }, { 0xE987F045, 0x2A58B947 }, { 0xB477BDD8, 0x7B4CDF18 }, { 0x906C6FE0, 0x9709B5EB }, - { 0x8060D90B, 0x73083C26 }, { 0x41F9037E, 0xFEDC400E }, { 0xE44BE9B8, 0x284948C6 }, { 0x08065BFB, 0x728ECAE8 }, - { 0x17492B1A, 0x06330E9E }, { 0x69E7294E, 0x59508561 }, { 0xE6C4364F, 0xBAE4F4FC }, { 0xE30E7449, 0xCA7BCF95 }, - { 0xA33E96C2, 0x7D7FD186 }, { 0xD85AD690, 0x52836110 }, { 0x1B4CD312, 0x4DFAA102 }, { 0x872544FA, 0x913ABB75 }, - { 0x140F1518, 0xDD46ECB9 }, { 0x1E869114, 0x3D659A6B }, { 0xD719109A, 0xC23F2CAB }, { 0x2DD46836, 0xD713FE06 }, - { 0xB2FBC1DC, 0xD0A60656 }, { 0xDD909496, 0x221C5A79 }, { 0xA1B14935, 0xEFD26DBC }, { 0x235E4FC9, 0x0E77EDA0 }, - { 0x6B68F6B9, 0xCBFD395B }, { 0xA6F4D4C4, 0x0DE0EAEF }, { 0x1A8532E7, 0x0422FF1F }, { 0xDED6AA94, 0xF969B85E }, - { 0xAEF28F3F, 0x7F6E2007 }, { 0x81A938FE, 0x3AD0623B }, { 0x7AADA1A7, 0x6624EE8B }, { 0xC856607B, 0xB682E8DD }, - { 0x281E2A30, 0xA78CC56F }, { 0x45FAA08D, 0xC79B257A }, { 0x642B30B3, 0x5B4174E0 }, { 0x7EAE0254, 0x5F638BFF }, - { 0x0C05F808, 0x4BC9AF9C }, { 0xF98B46AE, 0xCE59308A }, { 0xCC55C388, 0x8FC58DA9 }, { 0x676D0EB1, 0x803496C7 }, - { 0xE70DD7BA, 0xF33CAAE1 }, { 0x6EA2B4BF, 0xBB620232 }, { 0x201871CB, 0xD5020F87 }, { 0xA9B712CE, 0x9D5CA754 }, - { 0x7DE83C56, 0x841669D8 }, { 0x5EB6739F, 0x8A618478 }, { 0xB0741E2B, 0x420BBA6C }, { 0xEAC1CE47, 0xF12D5B60 }, - { 0x1283691C, 0x76AC35F7 }, { 0xFECEDB5F, 0x2C6BB7D9 }, { 0x4C351A83, 0xFCCDB18F }, { 0xC3160582, 0x1F79C012 }, - { 0x62A74CB7, 0xF0ABADAE }, { 0x82EF06FC, 0xE1A5801C }, { 0xF2CB2357, 0x67A21845 }, { 0x5DF04D9D, 0x5114665F }, - { 0x74278658, 0xBF40FD2D }, { 0xB73183DA, 0xA0393D3F }, { 0x92E3B017, 0x05A409D1 }, { 0x0B4065F9, 0xA9FB28CF }, - { 0x42BF3D7C, 0x25A9A229 }, { 0x03463E02, 0xDB75E227 }, { 0x5AB5D06C, 0xB326E10C }, { 0x95A62DE6, 0xE7968E82 }, - { 0x636EAD42, 0xB973F3B3 }, { 0x19C30CE5, 0xDF571D38 }, { 0x29D7CBC5, 0xEE549B72 }, { 0x65E2D146, 0x12992AFD }, - { 0x56B02864, 0xF8EF4E90 }, { 0x4030E28B, 0xB7041E13 }, { 0xDAD50967, 0xC02EDD2A }, { 0x8AE95D07, 0x932B4AF4 }, - { 0xC6DC4784, 0x6FE6FB7B }, { 0x55F61666, 0x239AACB7 }, { 0xBDB807D6, 0x401A4BED }, { 0x89AF6305, 0x485EA8D3 }, - { 0xADB4B13D, 0xA41BC220 }, { 0x9729F211, 0x753B32B8 }, { 0xB3322029, 0x997E584B }, { 0xCEDA1C7F, 0x1D683193 }, - { 0xC99F818E, 0xFF5AB6C0 }, { 0x7F67E3A1, 0x16BBD5E2 }, { 0x25D233CD, 0xA59D34EE }, { 0x3B54A2D9, 0x98F8AE85 }, - { 0xCB105E79, 0x6DF70AFA }, { 0xB9BBA425, 0x795D2E99 }, { 0x44334178, 0x8E437B67 }, { 0x886682F0, 0x0186F6CE }, - { 0xBB347BD2, 0xEBF092A3 }, { 0xF18D1D55, 0xBCD7FA62 }, { 0x11C5571E, 0xADD9D7D0 }, { 0xB1BDFFDE, 0x0BD3E471 }, - { 0x8EEAFEF4, 0xAA6C2F80 }, { 0xF6C880A4, 0x5EE57D31 }, { 0xF044FCA0, 0xF50FA47F }, { 0x51F5B595, 0x1ADDC9C3 }, - { 0x3352F922, 0xEA76646D }, { 0x00000000, 0x00000000 }, { 0xF58EBEA6, 0x85909F16 }, { 0xAAF12CCC, 0x46294573 }, - { 0x39DB7D2E, 0x0A5512BF }, { 0x31DD26D5, 0x78DBD857 }, { 0x6C2D6B48, 0x29CFBE08 }, { 0x583A0F9B, 0x218B5D36 }, - { 0xFACD78AC, 0x152CD2AD }, { 0xE2C795BC, 0x83A39188 }, { 0x5F7F926A, 0xC3B9DA65 }, { 0x2C1D89C3, 0x9ECBA01B }, - { 0x9F2FA9EA, 0x07B5F850 }, { 0x26940DCF, 0x7EE8D6C9 }, { 0xAF3B6ECA, 0x36B67E1A }, { 0x702425AB, 0x86079859 }, - { 0xD31AB369, 0xFB7849DF }, { 0x932A51E2, 0x4C7C57CC }, { 0x0E8A27FF, 0xD96413A6 }, { 0xC715A671, 0x263EA566 }, - { 0x4376DC89, 0x6C71FC34 }, { 0x84637AF8, 0x4A4F5952 }, { 0x8B20BCF2, 0xDAF314E9 }, { 0x4AB96687, 0x572768C1 }, - { 0x682EC8BB, 0x1088DB7C }, { 0x537A6A62, 0x887075F9 }, { 0xF302C2A2, 0x2E7A4658 }, { 0xE582084D, 0x619116DB }, - { 0x8326E709, 0xA87DDE01 }, { 0x9C6997E8, 0xDCC01A77 }, { 0xAC7D50C8, 0xEDC39C3D }, { 0xA078A8C0, 0xA60A33A1 }, - { 0x52B38B97, 0xC1A82BE4 }, { 0x134A88E9, 0x3F746BEA }, { 0xBAFD9A27, 0xA228CCBE }, { 0x068C7C04, 0xABEAD94E }, - { 0x78227E50, 0xF48952B1 }, { 0xFB049959, 0x5CF48CB0 }, { 0x6DE48ABD, 0x6017E015 }, { 0xA73D3531, 0x4438B4F2 }, - { 0x49FF5885, 0x8C528AE6 }, { 0x4DFCFB76, 0xB515EF92 }, { 0x2E925634, 0x0C661C21 }, { 0xC59A7986, 0xB493195C }, - { 0x21D1903E, 0x9CDA519A }, { 0xB5BE5C2D, 0x32948105 }, { 0xD45F2E98, 0x194ACE8C }, { 0x38129CDB, 0x438D4CA2 }, - { 0xBEFE39D4, 0x9B6FA9CA }, { 0xEF0B8C41, 0x81B26009 }, { 0x91A58E15, 0xDED1EBF6 }, { 0x9EE6481F, 0x4E6DA64D }, - { 0xCF13FD8A, 0x54B06F8E }, { 0x01C9E1F5, 0x49D85E1D }, { 0x1C094EE3, 0xAFC82651 }, { 0x75EE67AD, 0xF698A330 }, - { 0xEC4DB243, 0x5AC7822E }, { 0xC199DA75, 0x8DD47C28 }, { 0xDB1CE892, 0x89F68337 }, { 0x7C21DDA3, 0xCDCE37C5 }, - { 0x503C5460, 0x530597DE }, { 0x543FF793, 0x6A42F2AA }, { 0x73621BA9, 0x5D727A7E }, { 0x07459DF1, 0xE2328753 }, - { 0xC2DFE477, 0x56A19E0F }, { 0xCD9C227D, 0xC61DD3B4 }, { 0x986A341B, 0xE5877F03 }, { 0x15C6F4ED, 0x949EB2A4 }, - { 0x60289340, 0x62061194 }, { 0xE84E11B0, 0x6380E75A }, { 0xD6D0F16F, 0x8BE772B6 }, { 0xD596CF6D, 0x50929091 }, - { 0x3E9EE0DF, 0xE86795EC }, { 0x2B581432, 0x7CF92748 }, { 0xEEC26DB4, 0xC86A3E14 }, { 0x8DACC0F6, 0x7119CDA7 }, - { 0x100CB6EB, 0xE40189CD }, { 0x028FDFF7, 0x92ADBC3A }, { 0xD2D3529C, 0xB2A017C2 }, { 0xD05C8D6B, 0x200DABF8 }, - { 0xA2F77737, 0x34A78F9B }, { 0x8F231F01, 0xE3B4719D }, { 0x2F5BB7C1, 0x45BE423C }, { 0xFD88E55D, 0xF71E55FE }, - { 0x59F3EE6E, 0x6853032B }, { 0xFF073AAA, 0x65B3E9C4 }, { 0x9AE5EBEC, 0x772AC339 }, { 0xF842A75B, 0x87816E97 }, - { 0xE0484A4B, 0x110E2DB2 }, { 0x3DD8DEDD, 0x331277CB }, { 0x79EB9FA5, 0xBD510CAC }, { 0x2A91F5C7, 0x35217955 }, -}; - -__device__ uint2 T52[256] = { - { 0x46E06A6D, 0x8AB0A968 }, { 0x4BF0B33A, 0x43C7E80B }, { 0x6B161EE5, 0x08C9B354 }, { 0xEBA990BE, 0x39F1C235 }, - { 0x6606C7B2, 0xC1BEF237 }, { 0x614569AA, 0x2C209233 }, { 0x6FC3289A, 0xEB01523B }, { 0x935ACEDD, 0x946953AB }, - { 0x3E13340E, 0x272838F6 }, { 0xA12BA052, 0x8B0455EC }, { 0x978FF8A2, 0x77A1B2C4 }, { 0x13E54086, 0xA55122CA }, - { 0x62D3F1CD, 0x22761358 }, { 0x08B76CFE, 0xDB8DDFDE }, { 0x9E4A178A, 0x5D1E12C8 }, { 0x03969867, 0x0E56816B }, - { 0x3303ED59, 0xEE5F7995 }, { 0xAB78D71D, 0xAFED748B }, { 0xF93E53EE, 0x6D929F2D }, { 0xBA798C2A, 0xF5D8A8F8 }, - { 0x8E39CF6B, 0xF619B169 }, { 0x749104E2, 0x95DDAF2F }, { 0xE0886427, 0xEC2A9C80 }, { 0x825B95EA, 0xCE5C8FD8 }, - { 0x3AC60271, 0xC4E0D999 }, { 0x173076F9, 0x4699C3A5 }, { 0x50A29F42, 0x3D1B151F }, { 0x2BC75946, 0x9ED505EA }, - { 0xDC7F4B98, 0x34665ACF }, { 0x292342F7, 0x61B1FB53 }, { 0x0E864130, 0xC721C008 }, { 0x96FD7B74, 0x8693CD16 }, - { 0x7136B14B, 0x87273192 }, { 0x63A1721B, 0xD3446C8A }, { 0xA6680E4A, 0x669A35E8 }, { 0x39509A16, 0xCAB658F2 }, - { 0xF42E8AB9, 0xA4E5DE4E }, { 0xE83F08D9, 0x37A7435E }, { 0xE26C7F96, 0x134E6239 }, { 0x2DF67488, 0x82791A3C }, - { 0x8329163C, 0x3F6EF00A }, { 0xFDEB6591, 0x8E5A7E42 }, { 0x7981DDB5, 0x5CAAEE4C }, { 0x5AF1E80D, 0x19F23478 }, - { 0xED98BD70, 0x255DDDE3 }, { 0xA99CCCAC, 0x50898A32 }, { 0xDA4E6656, 0x28CA4519 }, { 0x4CB31D22, 0xAE59880F }, - { 0x37D6DB26, 0x0D9798FA }, { 0xB4FFCD1A, 0x32F968F0 }, { 0x4F258545, 0xA00F0964 }, { 0x5E24DE72, 0xFA3AD517 }, - { 0x5DB24615, 0xF46C547C }, { 0xFF0F7E20, 0x713E80FB }, { 0x73D2AAFA, 0x7843CF2B }, { 0xAEDF62B4, 0xBD17EA36 }, - { 0xD16F92CF, 0xFD111BAC }, { 0xC72D67E0, 0x4ABAA7DB }, { 0xAD49FAD3, 0xB3416B5D }, { 0x4914A88B, 0xBCA316B2 }, - { 0x8AECF914, 0x15D15006 }, { 0xE31EFC40, 0xE27C1DEB }, { 0x9BEDA223, 0x4FE48C75 }, { 0x1B522C78, 0x7EDCFD14 }, - { 0x7C26681C, 0x4E5070F1 }, { 0x5815F3BC, 0xE696CAC1 }, { 0x3BB481A7, 0x35D2A64B }, { 0xFE7DFDF6, 0x800CFF29 }, - { 0xD5BAA4B0, 0x1ED9FAC3 }, { 0x1EF599D1, 0x6C2663A9 }, { 0x34404341, 0x03C11991 }, { 0x69F20554, 0xF7AD4DED }, - { 0xB61BD6AB, 0xCD9D9649 }, { 0xEADB1368, 0xC8C3BDE7 }, { 0xB02AFB65, 0xD131899F }, { 0xE1FAE7F1, 0x1D18E352 }, - { 0xEF7CA6C1, 0xDA39235A }, { 0xA8EE4F7A, 0xA1BBF5E0 }, { 0xCF9A0B1E, 0x91377805 }, { 0x80BF8E5B, 0x31387161 }, - { 0xDB3CE580, 0xD9F83ACB }, { 0xD38B897E, 0x0275E515 }, { 0xF0FBBCC6, 0x472D3F21 }, { 0x868EA395, 0x2D946EB7 }, - { 0x21942E09, 0xBA3C248D }, { 0xBFDE3983, 0xE7223645 }, { 0x02E41BB1, 0xFF64FEB9 }, { 0x0D10D957, 0xC9774163 }, - { 0xB58D4ECC, 0xC3CB1722 }, { 0x9CAE0C3B, 0xA27AEC71 }, { 0xA48C15FB, 0x99FECB51 }, { 0x6D27332B, 0x1465AC82 }, - { 0xD75EBF01, 0xE1BD047A }, { 0x941960C5, 0x79F733AF }, { 0x41A3C475, 0x672EC96C }, { 0x524684F3, 0xC27FEBA6 }, - { 0x75E38734, 0x64EFD0FD }, { 0x0743AE18, 0xED9E6004 }, { 0xB9EF144D, 0xFB8E2993 }, { 0x0C625A81, 0x38453EB1 }, - { 0x42355C12, 0x69784807 }, { 0x14A6EE9E, 0x48CF42CE }, { 0x06312DCE, 0x1CAC1FD6 }, { 0x4792E9BB, 0x7B82D6BA }, - { 0x1F871A07, 0x9D141C7B }, { 0xC11C4A2E, 0x5616B80D }, { 0xF21FA777, 0xB849C198 }, { 0xC8D9A506, 0x7CA91801 }, - { 0x7EC273AD, 0xB1348E48 }, { 0x987B3A44, 0x41B20D1E }, { 0xA3CFBBE3, 0x7460AB55 }, { 0x4576F20A, 0x84E62803 }, - { 0x897A6173, 0x1B87D16D }, { 0xE45D5258, 0x0FE27DEF }, { 0xCA3DBEB7, 0x83CDE6B8 }, { 0xD01D1119, 0x0C23647E }, - { 0xA0592384, 0x7A362A3E }, { 0xF1893F10, 0xB61F40F3 }, { 0x440471DC, 0x75D457D1 }, { 0x237035B8, 0x4558DA34 }, - { 0x87FC2043, 0xDCA61165 }, { 0xC9AB26D0, 0x8D9B67D3 }, { 0xEE0E2517, 0x2B0B5C88 }, { 0x2AB5DA90, 0x6FE77A38 }, - { 0xD9D8FE31, 0x269CC472 }, { 0xFAA8CB89, 0x63C41E46 }, { 0x1642F52F, 0xB7ABBC77 }, { 0x2F126F39, 0x7D1DE485 }, - { 0x24339BA0, 0xA8C6BA30 }, { 0xCEE888C8, 0x600507D7 }, { 0x1A20AFAE, 0x8FEE82C6 }, { 0x26D78011, 0x57A24489 }, - { 0x36A458F0, 0xFCA5E728 }, { 0x8F4B4CBD, 0x072BCEBB }, { 0xF36D24A1, 0x497BBE4A }, { 0xB769557D, 0x3CAFE99B }, - { 0x05A7B5A9, 0x12FA9EBD }, { 0x5B836BDB, 0xE8C04BAA }, { 0xAC3B7905, 0x4273148F }, { 0x2851C121, 0x90838481 }, - { 0x6C55B0FD, 0xE557D350 }, { 0xCB4F3D61, 0x72FF996A }, { 0x64E2DC03, 0x3EDA0C8E }, { 0xE6B949E9, 0xF0868356 }, - { 0xBB0B0FFC, 0x04EAD72A }, { 0x5967706A, 0x17A4B513 }, { 0x04D5367F, 0xE3C8E16F }, { 0x8DAF570C, 0xF84F3002 }, - { 0xBD3A2232, 0x1846C8FC }, { 0xF6CA9108, 0x5B8120F7 }, { 0xECEA3EA6, 0xD46FA231 }, { 0x53340725, 0x334D9474 }, - { 0xC28AD249, 0x58403966 }, { 0x9A9F21F5, 0xBED6F3A7 }, { 0xA5FE962D, 0x68CCB483 }, { 0x57E1315A, 0xD085751B }, - { 0xE52FD18E, 0xFED0023D }, { 0x20E6ADDF, 0x4B0E5B5F }, { 0x6EB1AB4C, 0x1A332DE9 }, { 0x7B65C604, 0xA3CE10F5 }, - { 0xD62C3CD7, 0x108F7BA8 }, { 0x1073D8E1, 0xAB07A3A1 }, { 0x91BED56C, 0x6B0DAD12 }, { 0x3532C097, 0xF2F36643 }, - { 0xB2CEE0D4, 0x2E557726 }, { 0x00000000, 0x00000000 }, { 0xDE9B5029, 0xCB02A476 }, { 0x8B9E7AC2, 0xE4E32FD4 }, - { 0x2C84F75E, 0x734B65EE }, { 0xCD7E10AF, 0x6E5386BC }, { 0xE7CBCA3F, 0x01B4FC84 }, { 0x65905FD5, 0xCFE8735C }, - { 0x0FF4C2E6, 0x3613BFDA }, { 0x31E7F6E8, 0x113B872C }, { 0x55052AEB, 0x2FE18BA2 }, { 0xBC48A1E4, 0xE974B72E }, - { 0xB89D979B, 0x0ABC5641 }, { 0x2202B66E, 0xB46AA5E6 }, { 0xC4BBFF87, 0x44EC26B0 }, { 0x27A503C7, 0xA6903B5B }, - { 0xFC99E647, 0x7F680190 }, { 0xA71A8D9C, 0x97A84A3A }, { 0x6037EA7C, 0xDD12EDE1 }, { 0xDD0DC84E, 0xC554251D }, - { 0x956BE313, 0x88C54C7D }, { 0x48662B5D, 0x4D916960 }, { 0x9909B992, 0xB08072CC }, { 0xC5C97C51, 0xB5DE5962 }, - { 0x19B637C9, 0x81B803AD }, { 0x4A8230EC, 0xB2F597D9 }, { 0x5F565DA4, 0x0B08AAC5 }, { 0x017283D6, 0xF1327FD2 }, - { 0x78F35E63, 0xAD98919E }, { 0x76751F53, 0x6AB95196 }, { 0x0A53774F, 0x24E92167 }, { 0x15D46D48, 0xB9FD3D1C }, - { 0xFBDA485F, 0x92F66194 }, { 0x11015B37, 0x5A35DC73 }, { 0x5477A93D, 0xDED3F470 }, { 0x81CD0D8D, 0xC00A0EB3 }, - { 0xC65FE436, 0xBB88D809 }, { 0xBEACBA55, 0x16104997 }, { 0x5693B28C, 0x21B70AC9 }, { 0x25411876, 0x59F4C5E2 }, - { 0x0B21F499, 0xD5DB5EB5 }, { 0xF55C096F, 0x55D7A19C }, { 0xC3F8519F, 0xA97246B4 }, { 0xA2BD3835, 0x8552D487 }, - { 0x1297C350, 0x54635D18 }, { 0x85183BF2, 0x23C2EFDC }, { 0xCC0C9379, 0x9F61F96E }, { 0x9DDC8FED, 0x534893A3 }, - { 0xAA0A54CB, 0x5EDF0B59 }, { 0x9F38945C, 0xAC2C6D1A }, { 0xD8AA7DE7, 0xD7AEBBA0 }, { 0x09C5EF28, 0x2ABFA00C }, - { 0x3CF72FBF, 0xD84CC64F }, { 0xB15878B3, 0x2003F64D }, { 0xC06EC9F8, 0xA724C7DF }, { 0x68808682, 0x069F323F }, - { 0x51D01C94, 0xCC296ACD }, { 0x5CC0C5C3, 0x055E2BAE }, { 0x1D6301B6, 0x6270E2C2 }, { 0x382219C0, 0x3B842720 }, - { 0x846AB824, 0xD2F0900E }, { 0x7A1745D2, 0x52FC6F27 }, { 0xE94D8B0F, 0xC6953C8C }, { 0x3095753E, 0xE009F8FE }, - { 0x92284D0B, 0x655B2C79 }, { 0x4347DFC4, 0x984A37D5 }, { 0x8808E2A5, 0xEAB5AEBF }, { 0x90CC56BA, 0x9A3FD2C0 }, - { 0xF84CD038, 0x9CA0E0FF }, { 0xAFADE162, 0x4C2595E4 }, { 0xB3BC6302, 0xDF6708F4 }, { 0x7D54EBCA, 0xBF620F23 }, - { 0x1C118260, 0x93429D10 }, { 0x8CDDD4DA, 0x097D4FD0 }, { 0x2E60ECEF, 0x8C2F9B57 }, { 0x18C4B41F, 0x708A7C7F }, - { 0xDFE9D3FF, 0x3A30DBA4 }, { 0x7FB0F07B, 0x4006F19A }, { 0x4DC19EF4, 0x5F6BF7DD }, { 0x32716E8F, 0x1F6D0647 }, - { 0x6A649D33, 0xF9FBCC86 }, { 0x67744464, 0x308C8DE5 }, { 0x72A0292C, 0x8971B0F9 }, { 0x3F61B7D8, 0xD61A4724 }, - { 0xD4C82766, 0xEFEB8511 }, { 0x40D147A3, 0x961CB6BE }, { 0xF7B812DE, 0xAAB35F25 }, { 0x7044329D, 0x76154E40 }, - { 0x4E570693, 0x513D76B6 }, { 0xD2F90AA8, 0xF3479AC7 }, { 0x77079C85, 0x9B8B2E44 }, { 0x3D85AC69, 0x297EB99D }, -}; - -__device__ uint2 T62[256] = { - { 0xFC7D40C3, 0x7E37E62D }, { 0xEE939E5B, 0x776F25A4 }, { 0xDD8FB5AD, 0xE045C850 }, { 0x11FF1952, 0x86ED5BA7 }, - { 0xCF616B35, 0xE91D0BD9 }, { 0x6E408FFB, 0x37E0AB25 }, { 0x31025A7A, 0x9607F6C0 }, { 0x16D23C9D, 0x0B02F5E1 }, - { 0xFB50650C, 0xF3D8486B }, { 0xC40875F5, 0x621CFF27 }, { 0xFA5FD34A, 0x7D40CB71 }, { 0xDAA29062, 0x6DAA6616 }, - { 0x23EC84E2, 0x9F5F3549 }, { 0xC507C3B3, 0xEC847C3D }, { 0x043CE205, 0x025A3668 }, { 0x4DAC0B19, 0xA8BF9E6C }, - { 0xE9BEBB94, 0xFA808BE2 }, { 0x77C74FA3, 0xB5B99C52 }, { 0xF0397BCC, 0x78D9BC95 }, { 0xDBAD2624, 0xE332E50C }, - { 0x9332797E, 0xC74FCE12 }, { 0x2EA709AB, 0x1729ECEB }, { 0x9954D1F8, 0xC2D6B9F6 }, { 0xBAB8551A, 0x5D898CBF }, - { 0x17DD8ADB, 0x859A76FB }, { 0x362F7FB5, 0x1BE85886 }, { 0xF136CD8A, 0xF6413F8F }, { 0xBBB7E35C, 0xD3110FA5 }, - { 0x14CC4D11, 0x0A2FEED5 }, { 0xCD7F1AB9, 0xE83010ED }, { 0x5F42D581, 0xA1E75DE5 }, { 0xC13B21B6, 0xEEDE4A55 }, - { 0xF94E1480, 0xF2F5535F }, { 0x1888761E, 0x0CC1B46D }, { 0x6529913B, 0xBCE15FDB }, { 0x5A7181C2, 0x2D25E897 }, - { 0xE2D7A554, 0x71817F1C }, { 0x5C53124B, 0x2E52C5CB }, { 0xEF9C281D, 0xF9F7A6BE }, { 0x21F2F56E, 0x9E722E7D }, - { 0x81DCA7E6, 0xCE170D9B }, { 0x1CB4941B, 0x0E9B8205 }, { 0x3C49D733, 0x1E712F62 }, { 0x42F9F7DC, 0x21E45CFA }, - { 0x8BBA0F60, 0xCB8E7A7F }, { 0x010FB646, 0x8E98831A }, { 0x8E895B23, 0x474CCF0D }, { 0x4FB27A95, 0xA9928558 }, - { 0x05335443, 0x8CC2B572 }, { 0x84EFF3A5, 0x42D5B8E9 }, { 0x021E718C, 0x012D1B34 }, { 0xAE74180B, 0x57A6626A }, - { 0xE3D81312, 0xFF19FC06 }, { 0x6A7C6DFE, 0x35BA9D4D }, { 0x8F86ED65, 0xC9D44C17 }, { 0xA02E5288, 0x506523E6 }, - { 0x06229389, 0x03772D5C }, { 0x0B691EC0, 0x8B01F4FE }, { 0xED825991, 0xF8DABD8A }, { 0x985B67BE, 0x4C4E3AEC }, - { 0x7FBF96A9, 0xB10DF082 }, { 0xD4F8DAE1, 0x6A69279A }, { 0xD3D5FF2E, 0xE78689DC }, { 0x1FA553D1, 0x812E1A2B }, - { 0xEBA0CA18, 0xFBAD90D6 }, { 0x34310E39, 0x1AC543B2 }, { 0x2CB97827, 0x1604F7DF }, { 0x51189F02, 0xA6241C69 }, - { 0xEAAF7C5E, 0x753513CC }, { 0xC84C4EFA, 0x64F2A59F }, { 0x489F5F5A, 0x247D2B1E }, { 0xAB474C48, 0xDB64D718 }, - { 0xF2270A40, 0x79F4A7A1 }, { 0x2A9BEBAE, 0x1573DA83 }, { 0x68621C72, 0x34978679 }, { 0xA2302304, 0x514838D2 }, - { 0xFD72F685, 0xF0AF6537 }, { 0x3A6B44BA, 0x1D06023E }, { 0xCE6EDD73, 0x678588C3 }, { 0xCC70ACFF, 0x66A893F7 }, - { 0xB5EDA9DF, 0xD4D24E29 }, { 0x70EA6A6C, 0x38563214 }, { 0x0E5A4A83, 0x07C3418C }, { 0x5635BACD, 0x2BCBB22F }, - { 0x0878D90A, 0x04B46CD0 }, { 0x0C443B0F, 0x06EE5AB8 }, { 0x76C8F9E5, 0x3B211F48 }, { 0x12EEDE98, 0x0958C389 }, - { 0xBF8B0159, 0xD14B39CD }, { 0x72F41BE0, 0x397B2920 }, { 0x13E168DE, 0x87C04093 }, { 0x47CAA39F, 0xAD26E988 }, - { 0x9C6785BB, 0x4E140C84 }, { 0xB7F3D853, 0xD5FF551D }, { 0x5D5CA40D, 0xA0CA46D1 }, { 0x87FE346F, 0xCD6020C7 }, - { 0x15C3FB57, 0x84B76DCF }, { 0xA121E4CE, 0xDEFDA0FC }, { 0x96012D3D, 0x4B8D7B60 }, { 0x298A2C64, 0x9AC642AD }, - { 0x10F0AF14, 0x0875D8BD }, { 0x7B8374AC, 0xB357C6EA }, { 0x9A451632, 0x4D6321D8 }, { 0xC719B23F, 0xEDA96709 }, - { 0xF328BC06, 0xF76C24BB }, { 0x912C08F2, 0xC662D526 }, { 0x7892B366, 0x3CE25EC4 }, { 0x6F4F39BD, 0xB978283F }, - { 0x9D6833FD, 0xC08C8F9E }, { 0x9E79F437, 0x4F3917B0 }, { 0xB2C08C10, 0x593DE06F }, { 0xB1D14BDA, 0xD6887841 }, - { 0x32139DB0, 0x19B26EEE }, { 0x75D93E2F, 0xB4948766 }, { 0x1987C058, 0x82593777 }, { 0x3D466175, 0x90E9AC78 }, - { 0xFF6C8709, 0xF1827E03 }, { 0x353EB87F, 0x945DC0A8 }, { 0x8AB5B926, 0x4516F965 }, { 0x7EB020EF, 0x3F957398 }, - { 0x6D514831, 0xB855330B }, { 0x542BCB41, 0x2AE6A91B }, { 0xC6160479, 0x6331E413 }, { 0x80D311A0, 0x408F8E81 }, - { 0xC325503A, 0xEFF35161 }, { 0xBD9570D5, 0xD06622F9 }, { 0x0D4B8D49, 0x8876D9A2 }, { 0x573A0C8B, 0xA5533135 }, - { 0xDF91C421, 0xE168D364 }, { 0xF50A2F8F, 0xF41B09E7 }, { 0x24C1A12D, 0x12B09B0F }, { 0xA9593DC4, 0xDA49CC2C }, - { 0x3E57A6BF, 0x1F5C3456 }, { 0xA8568B82, 0x54D14F36 }, { 0x43F6419A, 0xAF7CDFE0 }, { 0xC943F8BC, 0xEA6A2685 }, - { 0xD7E91D2B, 0xE5DCBFB4 }, { 0x799D0520, 0xB27ADDDE }, { 0xD6E6AB6D, 0x6B443CAE }, { 0xF61BE845, 0x7BAE91C9 }, - { 0x7CAE5163, 0x3EB868AC }, { 0x22E332A4, 0x11C7B653 }, { 0xB9A992D0, 0xD23C1491 }, { 0x0311C7CA, 0x8FB5982E }, - { 0xE0C9D4D8, 0x70AC6428 }, { 0x0F55FCC5, 0x895BC296 }, { 0xEC8DEFD7, 0x76423E90 }, { 0xDE9E7267, 0x6FF0507E }, - { 0x7A8CC2EA, 0x3DCF45F0 }, { 0x941F5CB1, 0x4AA06054 }, { 0xB0DEFD9C, 0x5810FB5B }, { 0xBC9AC693, 0x5EFEA1E3 }, - { 0xDC8003EB, 0x6EDD4B4A }, { 0xE8B10DD2, 0x741808F8 }, { 0x28859A22, 0x145EC1B7 }, { 0x50172944, 0x28BC9F73 }, - { 0x4EBDCCD3, 0x270A0642 }, { 0x331C2BF6, 0x972AEDF4 }, { 0x0A66A886, 0x059977E4 }, { 0x4A812ED6, 0x2550302A }, - { 0xA7037747, 0xDD8A8DA0 }, { 0x970E9B7B, 0xC515F87A }, { 0x601AC578, 0x3023EAA9 }, { 0x73FBADA6, 0xB7E3AA3A }, - { 0x1EAAE597, 0x0FB69931 }, { 0x00000000, 0x00000000 }, { 0x6204B4F4, 0x310EF19D }, { 0x44DB6455, 0x229371A6 }, - { 0x1A960792, 0x0DECAF59 }, { 0xB8A62496, 0x5CA4978B }, { 0x38753536, 0x1C2B190A }, { 0x82CD602C, 0x41A295B5 }, - { 0x6426277D, 0x3279DCC1 }, { 0x9F764271, 0xC1A194AA }, { 0x26DFD0A1, 0x139D803B }, { 0x41E83016, 0xAE51C4D4 }, - { 0xAD65DFC1, 0xD813FA44 }, { 0x45D4D213, 0xAC0BF2BC }, { 0x46C515D9, 0x23BE6A92 }, { 0x923DCF38, 0x49D74D08 }, - { 0x27D066E7, 0x9D050321 }, { 0x5E4D63C7, 0x2F7FDEFF }, { 0x55247D07, 0xA47E2A01 }, { 0x2FA8BFED, 0x99B16FF1 }, - { 0x8C972AAF, 0x4661D439 }, { 0xA33F9542, 0xDFD0BBC8 }, { 0xA51D06CB, 0xDCA79694 }, { 0x7DA1E725, 0xB020EBB6 }, - { 0x696DAA34, 0xBA0F0563 }, { 0xD5F76CA7, 0xE4F1A480 }, { 0x9510EAF7, 0xC438E34E }, { 0x3B64F2FC, 0x939E8124 }, - { 0x072D25CF, 0x8DEFAE46 }, { 0x586FF04E, 0x2C08F3A3 }, { 0xB3CF3A56, 0xD7A56375 }, { 0x40E78650, 0x20C947CE }, - { 0x86F18229, 0x43F8A3DD }, { 0xAC6A6987, 0x568B795E }, { 0x1DBB225D, 0x8003011F }, { 0xF7145E03, 0xF53612D3 }, - { 0x300DEC3C, 0x189F75DA }, { 0x3720C9F3, 0x9570DB9C }, { 0x6B73DBB8, 0xBB221E57 }, { 0xE4F536DD, 0x72F65240 }, - { 0x88ABC8AA, 0x443BE251 }, { 0xD9B357A8, 0xE21FFE38 }, { 0xE7E4F117, 0xFD43CA6E }, { 0x89A47EEC, 0xCAA3614B }, - { 0xE1C6629E, 0xFE34E732 }, { 0x1B99B1D4, 0x83742C43 }, { 0x83C2D66A, 0xCF3A16AF }, { 0x4990E91C, 0xAAE5A804 }, - { 0x4CA3BD5F, 0x26271D76 }, { 0x3F5810F9, 0x91C4B74C }, { 0xF841A2C6, 0x7C6DD045 }, { 0xFE63314F, 0x7F1AFD19 }, - { 0x8D989CE9, 0xC8F95723 }, { 0x5306EE8E, 0xA709075D }, { 0xAA48FA0E, 0x55FC5402 }, { 0x9023BEB4, 0x48FA563C }, - { 0xCA523F76, 0x65DFBEAB }, { 0xD8BCE1EE, 0x6C877D22 }, { 0x85E045E3, 0xCC4D3BF3 }, { 0x6115733E, 0xBEBB69B3 }, - { 0x20FD4328, 0x10EAAD67 }, { 0x71E5DC2A, 0xB6CEB10E }, { 0x6737E0B7, 0xBDCC44EF }, { 0xA412B08D, 0x523F158E }, - { 0x2DB6CE61, 0x989C74C5 }, { 0x2B945DE8, 0x9BEB5999 }, { 0x09776F4C, 0x8A2CEFCA }, { 0x5B7E3784, 0xA3BD6B8D }, - { 0xCB5D8930, 0xEB473DB1 }, { 0x9B4AA074, 0xC3FBA2C2 }, { 0x25CE176B, 0x9C281815 }, { 0xD0C438E4, 0x683311F2 }, - { 0xBE84B71F, 0x5FD3BAD7 }, { 0xE5FA809B, 0xFC6ED15A }, { 0x6C5EFE77, 0x36CDB011 }, { 0x520958C8, 0x29918447 }, - { 0x59604608, 0xA29070B9 }, { 0xA60CC101, 0x53120EBA }, { 0x74D68869, 0x3A0C047C }, { 0xD2DA4968, 0x691E0AC6 }, - { 0xE6EB4751, 0x73DB4974 }, { 0xF40599C9, 0x7A838AFD }, { 0xB4E21F99, 0x5A4ACD33 }, { 0xC03497F0, 0x6046C94F }, - { 0xD1CB8EA2, 0xE6AB92E8 }, { 0x663856F1, 0x3354C7F5 }, { 0xAF7BAE4D, 0xD93EE170 }, { 0xC22AE67C, 0x616BD27B }, - { 0x397A8370, 0x92B39A10 }, { 0x4B8E9890, 0xABC8B330 }, { 0x630B02B2, 0xBF967287 }, { 0xB6FC6E15, 0x5B67D607 }, -}; - -__device__ uint2 T72[256] = { - { 0xCE553FE6, 0xD031C397 }, { 0xB006B525, 0x16BA5B01 }, { 0x296E70C8, 0xA89BADE6 }, { 0x77D3435B, 0x6A1F525D }, - { 0x573DFA0B, 0x6E103570 }, { 0x17FC95AB, 0x660EFB2A }, { 0x97634BF6, 0x76327A9E }, { 0x62458BF5, 0x4BAD9D64 }, - { 0xDBC3F748, 0xF1830CAE }, { 0x669131FF, 0xC5C8F542 }, { 0xDC48B0CB, 0x95044A1C }, { 0x3CF8B866, 0x892962DF }, - { 0xE930C135, 0xB0B9E208 }, { 0x611A767C, 0xA14FB3F0 }, { 0x1C160136, 0x8D2605F2 }, { 0xFECC549E, 0xD6B71922 }, - { 0xA5907D8B, 0x37089438 }, { 0x5803D49C, 0x0B5DA38E }, { 0xEA6F3CBC, 0x5A5BCC9C }, { 0x3B73FFE5, 0xEDAE246D }, - { 0xDE22EDCE, 0xD2B87E0F }, { 0xCA8185EC, 0x5E54ABB1 }, { 0xE80561B9, 0x1DE7F88F }, { 0x0135A08C, 0xAD5E1A87 }, - { 0x65CECC76, 0x2F2ADBD6 }, { 0x82F58358, 0x5780B5A7 }, { 0xEDE47B3F, 0x3EDC8A2E }, { 0x06BEE70F, 0xC9D95C35 }, - { 0x6C4E05EE, 0x83BE111D }, { 0x59367410, 0xA603B909 }, { 0x809FDE5D, 0x103C81B4 }, { 0x7D0C774A, 0x2C69B602 }, - { 0xD5C87953, 0x399080D7 }, { 0x487406B4, 0x09D41E16 }, { 0x26505E5F, 0xCDD63B18 }, { 0x9B0298E8, 0xF99DC2F4 }, - { 0x943CB67F, 0x9CD0540A }, { 0x891F17C5, 0xBCA84B7F }, { 0xB78DF2A6, 0x723D1DB3 }, { 0xE73B4F2E, 0x78AA6E71 }, - { 0xA071670D, 0x1433E699 }, { 0x54620782, 0x84F21BE4 }, { 0xB4D20F2F, 0x98DF3327 }, { 0xD3769E5C, 0xF049DCE2 }, - { 0x9656EB7A, 0xDB6C6019 }, { 0x078B4783, 0x648746B2 }, { 0x8DCBADCF, 0x32CD2359 }, { 0xF0C7DA85, 0x1EA4955B }, - { 0x1B9D46B5, 0xE9A14340 }, { 0xBBEC21B8, 0xFD92A5D9 }, { 0x0E0B8E1B, 0xC8138C79 }, { 0x6D7BA562, 0x2EE00B9A }, - { 0x93B7F1FC, 0xF85712B8 }, { 0x0BEA949D, 0xEB28FED8 }, { 0x8A40EA4C, 0x564A65EB }, { 0x474A2823, 0x6C9988E8 }, - { 0x121D8F2D, 0x4535898B }, { 0x31ACCBF4, 0xABD8C032 }, { 0xB9867CBD, 0xBA2E91CA }, { 0xEF8E263A, 0x7960BE3D }, - { 0x602FD6F0, 0x0C11A977 }, { 0x16C93527, 0xCB50E1AD }, { 0x035FFD89, 0xEAE22E94 }, { 0x5DE2CE1A, 0x2866D12F }, - { 0xAB9BF390, 0xFF1B1841 }, { 0x8CFE0D43, 0x9F9339DE }, { 0xC48A0BF7, 0x964727C8 }, { 0xAAAE531C, 0x524502C6 }, - { 0xAC10B413, 0x9B9C5EF3 }, { 0x42AB32A5, 0x4FA2FA49 }, { 0xE551122B, 0x3F165A62 }, { 0x76E6E3D7, 0xC74148DA }, - { 0xE464B2A7, 0x924840E5 }, { 0xD69784DA, 0xD372AE43 }, { 0x05E11A86, 0x233B72A1 }, { 0x4941A638, 0xA48A0491 }, - { 0xC9DE7865, 0xB4B68525 }, { 0xA6CF8002, 0xDDEABAAC }, { 0x50B6BD88, 0x0A9773C2 }, { 0x5EBD3393, 0xC284FFBB }, - { 0x2C8F6A4E, 0x8BA0DF47 }, { 0x4D951C32, 0x2AEF6CB7 }, { 0x2A318D41, 0x42798372 }, { 0xBF389BB2, 0x73F7CDFF }, - { 0x382C026C, 0x074C0AF9 }, { 0x243A035A, 0x8A6A0F0B }, { 0x5F88931F, 0x6FDAE53C }, { 0x7E538AC3, 0xC68B9896 }, - { 0x1AA8E639, 0x44FF59C7 }, { 0x439E9229, 0xE2FCE0CE }, { 0x79D8CD40, 0xA20CDE24 }, { 0xC8EBD8E9, 0x19E89FA2 }, - { 0xF398270C, 0xF446BBCF }, { 0x2284E455, 0x43B3533E }, { 0x8E945046, 0xD82F0DCD }, { 0xB26CE820, 0x51066F12 }, - { 0x6BC5426D, 0xE73957AF }, { 0x40C16FA0, 0x081ECE5A }, { 0xC5BFAB7B, 0x3B193D4F }, { 0xDF174D42, 0x7FE66488 }, - { 0x705804D8, 0x0E9814EF }, { 0x7C39D7C6, 0x8137AC85 }, { 0xE185A821, 0xB1733244 }, { 0x6F11F867, 0x695C3F89 }, - { 0xE3EFF524, 0xF6CF0657 }, { 0xD02963D5, 0x1AABF276 }, { 0x75B91E5E, 0x2DA3664E }, { 0x1077D228, 0x0289BD98 }, - { 0xF413608F, 0x90C1FD7D }, { 0xFD93A917, 0x3C5537B6 }, { 0x3919A2E0, 0xAA12107E }, { 0x30996B78, 0x0686DAB5 }, - { 0x9EE3826E, 0xDAA6B055 }, { 0x56085A87, 0xC34E2FF7 }, { 0x4FFF4137, 0x6D5358A4 }, { 0xB35948AC, 0xFC587595 }, - { 0xC7D5F67E, 0x7CA5095C }, { 0x8B754AC0, 0xFB147F6C }, { 0x91DDACF9, 0xBFEB26AB }, { 0x67A49173, 0x6896EFC5 }, - { 0x1E7C5C33, 0xCA9A31E1 }, { 0xB13315A9, 0xBBE44186 }, { 0x689ABFE4, 0x0DDB793B }, { 0xA7FA208E, 0x70B4A02B }, - { 0x7307F951, 0xE47A3A7B }, { 0x14A36822, 0x8CECD5BE }, { 0x23B144D9, 0xEEED49B9 }, { 0xB8B3DC31, 0x17708B4D }, - { 0x2765FED3, 0x6088219F }, { 0xF1F27A09, 0xB3FA8FDC }, { 0xFCA6099B, 0x910B2D31 }, { 0x78ED6DCC, 0x0F52C4A3 }, - { 0xBAD98134, 0x50CCBF5E }, { 0x7F662A4F, 0x6BD58211 }, { 0xD4FDD9DF, 0x94CE9A50 }, { 0x45207526, 0x2B25BCFB }, - { 0x1F49FCBF, 0x67C42B66 }, { 0x723259DD, 0x492420FC }, { 0x18C2BB3C, 0x03436DD4 }, { 0xF872B391, 0x1F6E4517 }, - { 0x69AF1F68, 0xA08563BC }, { 0xEEBB86B6, 0xD43EA4BA }, { 0x08B56914, 0x01CAD04C }, { 0x0980C998, 0xAC94CACB }, - { 0x9A373864, 0x54C3D873 }, { 0x2DBACAC2, 0x26FEC5C0 }, { 0xBE0D3B3E, 0xDEA9D778 }, { 0x20EEB950, 0x040F672D }, - { 0x7BB29045, 0xE5B0EA37 }, { 0xCBB42560, 0xF30AB136 }, { 0x37122CFB, 0x62019C07 }, { 0x13282FA1, 0xE86B930C }, - { 0x2EE5374B, 0xCC1CEB54 }, { 0xA21B3A08, 0x538FD28A }, { 0xD89C0AC1, 0x1B61223A }, { 0xAD25149F, 0x36C24474 }, - { 0xF74C9D06, 0x7A23D3E9 }, { 0x9968C5ED, 0xBE21F6E7 }, { 0x36278C77, 0xCF5F8680 }, { 0xEB5A9C30, 0xF705D61B }, - { 0x52DCE08D, 0x4D2B47D1 }, { 0xC234ECF8, 0x5F9E7BFD }, { 0x3DCD18EA, 0x24777858 }, { 0x4415D5AA, 0x867BA67C }, - { 0x5A698999, 0x4CE1979D }, { 0x00000000, 0x00000000 }, { 0x33C696F1, 0xEC64F421 }, { 0xC16B1171, 0xB57C5569 }, - { 0x467F88AF, 0xC1C7926F }, { 0x0F3E2E97, 0x654D96FE }, { 0xA8C40E19, 0x15F936D5 }, { 0xA9F1AE95, 0xB8A72C52 }, - { 0x21DB19DC, 0xA9517DAA }, { 0xFA18EE94, 0x58D27104 }, { 0xF2AD8780, 0x5918A148 }, { 0xDAF657C4, 0x5CDD1629 }, - { 0x64FB6CFA, 0x8274C151 }, { 0xC6E056F2, 0xD1FB13DB }, { 0xCF609F6A, 0x7D6FD910 }, { 0xD9A9AA4D, 0xB63F38BD }, - { 0xF526C003, 0x3D9FE7FA }, { 0x871499DE, 0x74BBC706 }, { 0xB6B8522A, 0xDF630734 }, { 0xCD0AC26F, 0x3AD3ED03 }, - { 0x83C023D4, 0xFADEAF20 }, { 0x4ECAE1BB, 0xC00D4223 }, { 0x5CD76E96, 0x8538CBA8 }, { 0x6E2458EB, 0xC402250E }, - { 0x026A5D05, 0x47BC3413 }, { 0x114272A4, 0xAFD7A71F }, { 0xCC3F62E3, 0x978DF784 }, { 0xA144C781, 0xB96DFC1E }, - { 0x1596C8AE, 0x21B2CF39 }, { 0x950916F3, 0x318E4E8D }, { 0x3E92E563, 0xCE9556CC }, { 0xDD7D1047, 0x385A509B }, - { 0xB5E7AFA3, 0x358129A0 }, { 0x63702B79, 0xE6F387E3 }, { 0x53E94001, 0xE0755D56 }, { 0xFFF9F412, 0x7BE903A5 }, - { 0x90E80C75, 0x12B53C2C }, { 0x857EC4DB, 0x3307F315 }, { 0x0C61D31E, 0x8FAFB86A }, { 0x86213952, 0xD9E5DD81 }, - { 0x9FD622E2, 0x77F8AAD2 }, { 0x357871FE, 0x25BDA814 }, { 0x8FA1F0CA, 0x7571174A }, { 0x985D6561, 0x137FEC60 }, - { 0x9DBC7FE7, 0x30449EC1 }, { 0x41F4CF2C, 0xA540D4DD }, { 0xAE7AE916, 0xDC206AE0 }, { 0xE2DA55A8, 0x5B911CD0 }, - { 0xF947131D, 0xB2305F90 }, { 0xBD52C6B7, 0x344BF9EC }, { 0xD2433ED0, 0x5D17C665 }, { 0xC05EB1FD, 0x18224FEE }, - { 0x844B6457, 0x9E59E992 }, { 0xA4A5DD07, 0x9A568EBF }, { 0x716DA454, 0xA3C60E68 }, { 0xD7A22456, 0x7E2CB4C4 }, - { 0x4CA0BCBE, 0x87B17630 }, { 0x32F3367D, 0x413AEEA6 }, { 0xBC67663B, 0x9915E36B }, { 0x3A465F69, 0x40F03EEA }, - { 0xE0B008AD, 0x1C2D28C3 }, { 0x4A1E5BB1, 0x4E682A05 }, { 0x285BD044, 0x05C5B761 }, { 0x5B5C2915, 0xE1BF8D1A }, - { 0xC3014C74, 0xF2C0617A }, { 0xD11CC359, 0xB7F5E8F1 }, { 0x3FA745EF, 0x63CB4C4B }, { 0x9C89DF6B, 0x9D1A8446 }, - { 0x4B2BFB3D, 0xE3363082 }, { 0xE60EEFA2, 0xD5F474F6 }, { 0xFB2D4E18, 0xF58C6B83 }, { 0x0ADF3411, 0x4676E45F }, - { 0x1D23A1BA, 0x20781F75 }, { 0x81AA7ED1, 0xBD629B33 }, { 0x19F71BB0, 0xAE1D7753 }, { 0xA32E9A84, 0xFED1C80D }, - { 0x92825170, 0x5509083F }, { 0x5557A70E, 0x29AC0163 }, { 0x51831D04, 0xA7C96945 }, { 0x04D4BA0A, 0x8E656826 }, - { 0x882AB749, 0x11F651F8 }, { 0xF6793D8A, 0xD77DC96E }, { 0x2B042DCD, 0xEF2799F5 }, { 0x7A8730C9, 0x48EEF0B0 }, - { 0x0D547392, 0x22F1A2ED }, { 0x2FD097C7, 0x6142F1D3 }, { 0x6AF0E2E1, 0x4A674D28 }, { 0x748CBED2, 0x80FD7CC9 }, - { 0xAF4F499A, 0x717E7067 }, { 0xECD1DBB3, 0x938290A9 }, { 0x344DD172, 0x88E3B293 }, { 0x250FA3D6, 0x2734158C }, -}; - -// KeySchedule -__constant__ const uint64_t CC[12][8] = { -{ 0xe9daca1eda5b08b1, 0x1f7c65c0812fcbeb, 0x16d0452e43766a2f, 0xfcc485758db84e71, 0x0169679291e07c4b, 0x15d360a4082a42a2, 0x234d74cc36747605, 0x0745a6f2596580dd }, -{ 0x1a2f9da98ab5a36f, 0xd7b5700f469de34f, 0x982b230a72eafef3, 0x3101b5160f5ed561, 0x5899d6126b17b59a, 0xcaa70adbc261b55c, 0x56cdcbd71ba2dd55, 0xb79bb121700479e6 }, -{ 0xc72fce2bacdc74f5, 0x35843d6a28fc390a, 0x8b1f9c525f5ef106, 0x7b7b29b11475eaf2, 0xb19e3590e40fe2d3, 0x09db6260373ac9c1, 0x31db7a8643f4b6c2, 0xb20aba0af5961e99 }, -{ 0xd26615e8b3df1fef, 0xdde4715da0e148f9, 0x7d3c5c337e858e48, 0x3f355e68ad1c729d, 0x75d603ed822cd7a9, 0xbe0352933313b7d8, 0xf137e893a1ea5334, 0x2ed1e384bcbe0c22 }, -{ 0x994747adac6bea4b, 0x6323a96c0c413f9a, 0x4a1086161f1c157f, 0xbdff0f80d7359e35, 0xa3f53a254717cdbf, 0x161a2723b700ffdf, 0xf563eaa97ea2567a, 0x57fe6c7cfd581760 }, -{ 0xd9d33a1daeae4fae, 0xc039307a3bc3a46f, 0x6ca44251f9c4662d, 0xc68ef09ab49a7f18, 0xb4b79a1cb7a6facf, 0xb6c6bec2661ff20a, 0x354f903672c571bf, 0x6e7d64467a4068fa }, -{ 0xecc5aaee160ec7f4, 0x540924bffe86ac51, 0xc987bfe6c7c69e39, 0xc9937a19333e47d3, 0x372c822dc5ab9209, 0x04054a2883694706, 0xf34a3ca24c451735, 0x93d4143a4d568688 }, -{ 0xa7c9934d425b1f9b, 0x41416e0c02aae703, 0x1ede369c71f8b74e, 0x9ac4db4d3b44b489, 0x90069b92cb2b89f4, 0x2fc4a5d12b8dd169, 0xd9a8515935c2ac36, 0x1ee702bfd40d7fa4 }, -{ 0x9b223116545a8f37, 0xde5f16ecd89a4c94, 0x244289251b3a7d3a, 0x84090de0b755d93c, 0xb1ceb2db0b440a80, 0x549c07a69a8a2b7b, 0x602a1fcb92dc380e, 0xdb5a238351446172 }, -{ 0x526f0580a6debeab, 0xf3f3e4b248e52a38, 0xdb788aff1ce74189, 0x0361331b8ae1ff1f, 0x4b3369af0267e79f, 0xf452763b306c1e7a, 0xc3b63b15d1fa9836, 0xed9c4598fbc7b474 }, -{ 0xfb89c8efd09ecd7b, 0x94fe5a63cdc60230, 0x6107abebbb6bfad8, 0x7966841421800120, 0xcab948eaef711d8a, 0x986e477d1dcdbaef, 0x5dd86fc04a59a2de, 0x1b2df381cda4ca6b }, -{ 0xba3116f167e78e37, 0x7ab14904b08013d2, 0x771ddfbc323ca4cd, 0x9b9f2130d41220f8, 0x86cc91189def805d, 0x5228e188aaa41de7, 0x991bb2d9d517f4fa, 0x20d71bf14a92bc48 } -}; - -__constant__ const uint64_t precomputed_values[12][8] = { - 0x8FD72F640708B0D0, 0x0DE874C7EBC3F213, 0xE92EEF3AD202E9E0, 0xC1E9DA0708013DA7, 0x9727DAB2F014BE88, 0x103051A02BCD6935, 0x33EC7E1DBD28F736, 0x1ECF460CF78AD1F4, - 0x0B2D9F89C775449D, 0x6B6EEFC6DAB7E8B0, 0xF1A0D31667F6EC44, 0x2A71132D5E108166, 0x0E9357C2EC87931A, 0xC99F5C1B4A01612D, 0x7E60B16E637D4EE2, 0xA9FCB827F9BA6D81, - 0x231FECA5AB3D285C, 0x70C6E1483C838C3B, 0x9C21C3C40CE4E2DA, 0x2FA796BD5688E573, 0x04C0E3FF55809FDF, 0x5FF978BFB8E3CDC8, 0xC54A19D6A3D07033, 0x0FCA83FDDE872478, - 0xBDF9312726339F10, 0x51A5BA1793BC9C56, 0xC4428DA14F96D2D4, 0xEC925222374EAB1F, 0x79477893747DD92F, 0xC495E19A46886304, 0x9C23F893BA7CFA36, 0x0C47268881FC5FEB, - 0xCF117966029B2CB3, 0x07179ABE77088A8F, 0x671EF4CC2650E257, 0x7474B8B170DAB5C6, 0x4224FEBECF35113E, 0x993D156C675C5537, 0x2DEE3A5782C39B45, 0xE7C586F2990DD385, - 0x8608FD95B1C1138A, 0x8BB0847D9E9849AC, 0x5E76623F4F0EB0C7, 0x34C2BDBAFC5060CE, 0xE9E814475907826C, 0x22C9ED94D6AAC7C9, 0xE6B75E28171EB0D6, 0xF1329E5534E60215, - 0x86BB4814B1C3CE52, 0xE8F226C9FBDDD017, 0xCEDED67991CB3087, 0x76C33E32FDBFACA5, 0xDBB13BE1A9F7474C, 0x3D0273470342C356, 0x8E7246C51CF07F61, 0xAC8C125DDEF8DF71, - 0x6D73E747795B8CF3, 0x4E4AA65EA0072050, 0xA14A1582CB43C2B9, 0x748EF2B7BB63B938, 0x126789534410D7D4, 0xD4D48FF40301D791, 0xC67DFBE315C41FC0, 0x35E7A1A1AF88601C, - 0x9BD33EA0FAB34007, 0xF51B7CDBE3D67D25, 0xD3ABDA0CE4186E6B, 0x8E61DDADCBCE1706, 0x58994565B41BE6A5, 0x7A87ABC1240CD31D, 0xFAFE6C28487968D0, 0x15B368609FF9EEA7, - 0xAE33263CCF115818, 0x93B2DBE9CADFCFC8, 0x0A91952BF91B0147, 0x458E67CA5F1ED73A, 0x94C2E5F288F074E3, 0x377895E85C69E996, 0xF11A4456AAB37B10, 0x163131934816821A, - 0xD07E4A2366BF469D, 0x5EF1A3D220213B6C, 0x3C5BB78971D8ED0F, 0x0DE05E6B9006F2D2, 0xC58CFB00B8EAA1C9, 0xEFCDB54D1F250B76, 0xFD135634FA527042, 0x4CEE791290516407, - 0xD800B9264010790F, 0x974C4823E2B668D7, 0xA605A4B385C5E361, 0x3F6C92DA5A56D8D2, 0x82B9D67C12EF8277, 0x0AB6B4582561BF90, 0x46954FD98FC2CBA3, 0x70BE45CB21B6760D -}; diff --git a/x11/timetravel.cu b/x11/timetravel.cu deleted file mode 100644 index 93c3fd19..00000000 --- a/x11/timetravel.cu +++ /dev/null @@ -1,554 +0,0 @@ -/** - * Timetravel CUDA implementation - * by tpruvot@github - March 2017 - */ - -#include -#include -#include - -#define HASH_FUNC_BASE_TIMESTAMP 1389040865U // Machinecoin Genesis Timestamp -#define HASH_FUNC_COUNT 8 -#define HASH_FUNC_COUNT_PERMUTATIONS 40320U - -extern "C" { -#include "sph/sph_blake.h" -#include "sph/sph_bmw.h" -#include "sph/sph_groestl.h" -#include "sph/sph_skein.h" -#include "sph/sph_jh.h" -#include "sph/sph_keccak.h" -#include "sph/sph_luffa.h" -#include "sph/sph_cubehash.h" -#if HASH_FUNC_COUNT > 8 -#include "sph/sph_shavite.h" -#include "sph/sph_simd.h" -#include "sph/sph_echo.h" -#endif -} - -#include "miner.h" -#include "cuda_helper.h" -#include "cuda_x11.h" - -static uint32_t *d_hash[MAX_GPUS]; - -enum Algo { - BLAKE = 0, - BMW, - GROESTL, - SKEIN, - JH, - KECCAK, - LUFFA, - CUBEHASH, -#if HASH_FUNC_COUNT > 8 - SHAVITE, - SIMD, - ECHO, -#endif - MAX_ALGOS_COUNT -}; - -static const char* algo_strings[] = { - "blake", - "bmw512", - "groestl", - "skein", - "jh512", - "keccak", - "luffa", - "cube", - NULL -}; - -inline void swap8(uint8_t *a, uint8_t *b) -{ - uint8_t t = *a; - *a = *b; - *b = t; -} - -inline void initPerm(uint8_t n[], int count) -{ - for (int i = 0; i < count; i++) - n[i] = i; -} - -static int nextPerm(uint8_t n[], int count) -{ - int tail, i, j; - - if (count <= 1) - return 0; - - for (i = count - 1; i>0 && n[i - 1] >= n[i]; i--); - tail = i; - - if (tail > 0) { - for (j = count - 1; j>tail && n[j] <= n[tail - 1]; j--); - swap8(&n[tail - 1], &n[j]); - } - - for (i = tail, j = count - 1; i= 10) - sprintf(sptr, "%c", 'A' + (algoList[j] - 10)); - else - sprintf(sptr, "%u", (uint32_t) algoList[j]); - sptr++; - } - *sptr = '\0'; -} - -static __thread uint32_t s_ntime = 0; -static uint32_t s_sequence = UINT32_MAX; -static uint8_t s_firstalgo = 0xFF; -static char hashOrder[HASH_FUNC_COUNT + 1] = { 0 }; - -#define INITIAL_DATE HASH_FUNC_BASE_TIMESTAMP -static inline uint32_t getCurrentAlgoSeq(uint32_t ntime) -{ - // unlike x11evo, the permutation changes often (with ntime) - return (uint32_t) (ntime - INITIAL_DATE) % HASH_FUNC_COUNT_PERMUTATIONS; -} - -// To finish... -static void get_travel_order(uint32_t ntime, char *permstr) -{ - uint32_t seq = getCurrentAlgoSeq(ntime); - if (s_sequence != seq) { - getAlgoString(permstr, seq); - s_sequence = seq; - } -} - -// CPU Hash -extern "C" void timetravel_hash(void *output, const void *input) -{ - uint32_t _ALIGN(64) hash[64/4] = { 0 }; - - sph_blake512_context ctx_blake; - sph_bmw512_context ctx_bmw; - sph_groestl512_context ctx_groestl; - sph_skein512_context ctx_skein; - sph_jh512_context ctx_jh; - sph_keccak512_context ctx_keccak; - sph_luffa512_context ctx_luffa1; - sph_cubehash512_context ctx_cubehash1; -#if HASH_FUNC_COUNT > 8 - sph_shavite512_context ctx_shavite1; - sph_simd512_context ctx_simd1; - sph_echo512_context ctx_echo1; -#endif - - if (s_sequence == UINT32_MAX) { - uint32_t *data = (uint32_t*) input; - const uint32_t ntime = (opt_benchmark || !data[17]) ? (uint32_t) time(NULL) : data[17]; - get_travel_order(ntime, hashOrder); - } - - void *in = (void*) input; - int size = 80; - - const int hashes = (int) strlen(hashOrder); - - for (int i = 0; i < hashes; i++) - { - const char elem = hashOrder[i]; - uint8_t algo = elem >= 'A' ? elem - 'A' + 10 : elem - '0'; - - if (i > 0) { - in = (void*) hash; - size = 64; - } - - switch (algo) { - case BLAKE: - sph_blake512_init(&ctx_blake); - sph_blake512(&ctx_blake, in, size); - sph_blake512_close(&ctx_blake, hash); - break; - case BMW: - sph_bmw512_init(&ctx_bmw); - sph_bmw512(&ctx_bmw, in, size); - sph_bmw512_close(&ctx_bmw, hash); - break; - case GROESTL: - sph_groestl512_init(&ctx_groestl); - sph_groestl512(&ctx_groestl, in, size); - sph_groestl512_close(&ctx_groestl, hash); - //applog_hex((void*)hash, 32); - break; - case SKEIN: - sph_skein512_init(&ctx_skein); - sph_skein512(&ctx_skein, in, size); - sph_skein512_close(&ctx_skein, hash); - break; - case JH: - sph_jh512_init(&ctx_jh); - sph_jh512(&ctx_jh, in, size); - sph_jh512_close(&ctx_jh, hash); - break; - case KECCAK: - sph_keccak512_init(&ctx_keccak); - sph_keccak512(&ctx_keccak, in, size); - sph_keccak512_close(&ctx_keccak, hash); - break; - case LUFFA: - sph_luffa512_init(&ctx_luffa1); - sph_luffa512(&ctx_luffa1, in, size); - sph_luffa512_close(&ctx_luffa1, hash); - break; - case CUBEHASH: - sph_cubehash512_init(&ctx_cubehash1); - sph_cubehash512(&ctx_cubehash1, in, size); - sph_cubehash512_close(&ctx_cubehash1, hash); - break; -#if HASH_FUNC_COUNT > 8 - case SHAVITE: - sph_shavite512_init(&ctx_shavite1); - sph_shavite512(&ctx_shavite1, in, size); - sph_shavite512_close(&ctx_shavite1, hash); - break; - case SIMD: - sph_simd512_init(&ctx_simd1); - sph_simd512(&ctx_simd1, in, size); - sph_simd512_close(&ctx_simd1, hash); - break; - case ECHO: - sph_echo512_init(&ctx_echo1); - sph_echo512(&ctx_echo1, in, size); - sph_echo512_close(&ctx_echo1, hash); - break; -#endif - } - } - - memcpy(output, hash, 32); -} - -static uint32_t get_next_time(uint32_t ntime, char* curOrder) -{ - char nextOrder[HASH_FUNC_COUNT + 1] = { 0 }; - uint32_t secs = 15; - do { - uint32_t nseq = getCurrentAlgoSeq(ntime+secs); - getAlgoString(nextOrder, nseq); - secs += 15; - } while (curOrder[0] == nextOrder[0]); - return secs; -} - -//#define _DEBUG -#define _DEBUG_PREFIX "tt-" -#include "cuda_debug.cuh" - -void quark_bmw512_cpu_setBlock_80(void *pdata); -void quark_bmw512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, int order); - -void groestl512_setBlock_80(int thr_id, uint32_t *endiandata); -void groestl512_cuda_hash_80(const int thr_id, const uint32_t threads, const uint32_t startNounce, uint32_t *d_hash); - -void skein512_cpu_setBlock_80(void *pdata); -void skein512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, int swap); - -void qubit_luffa512_cpu_init(int thr_id, uint32_t threads); -void qubit_luffa512_cpu_setBlock_80(void *pdata); -void qubit_luffa512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, int order); - -void jh512_setBlock_80(int thr_id, uint32_t *endiandata); -void jh512_cuda_hash_80(const int thr_id, const uint32_t threads, const uint32_t startNounce, uint32_t *d_hash); - -void keccak512_setBlock_80(int thr_id, uint32_t *endiandata); -void keccak512_cuda_hash_80(const int thr_id, const uint32_t threads, const uint32_t startNounce, uint32_t *d_hash); - -void cubehash512_setBlock_80(int thr_id, uint32_t* endiandata); -void cubehash512_cuda_hash_80(const int thr_id, const uint32_t threads, const uint32_t startNounce, uint32_t *d_hash); - -void quark_blake512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_outputHash, int order); - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_timetravel(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - int intensity = (device_sm[device_map[thr_id]] >= 500 && !is_windows()) ? 20 : 19; - uint32_t throughput = cuda_default_throughput(thr_id, 1U << intensity); // 19=256*256*8; - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - // if (opt_benchmark) pdata[17] = swab32(0x5886a4be); // TO DEBUG GROESTL 80 - - if (opt_debug || s_ntime != pdata[17] || s_sequence == UINT32_MAX) { - uint32_t ntime = swab32(work->data[17]); - get_travel_order(ntime, hashOrder); - s_ntime = pdata[17]; - if (opt_debug && !thr_id) { - applog(LOG_DEBUG, "timetravel hash order %s (%08x)", hashOrder, ntime); - } - } - - if (opt_benchmark) - ptarget[7] = 0x5; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - quark_blake512_cpu_init(thr_id, throughput); - quark_bmw512_cpu_init(thr_id, throughput); - quark_groestl512_cpu_init(thr_id, throughput); - quark_skein512_cpu_init(thr_id, throughput); - quark_keccak512_cpu_init(thr_id, throughput); - quark_jh512_cpu_init(thr_id, throughput); - qubit_luffa512_cpu_init(thr_id, throughput); // only constants (480 bytes) - x11_luffa512_cpu_init(thr_id, throughput); - x11_cubehash512_cpu_init(thr_id, throughput); -#if HASH_FUNC_COUNT > 8 - x11_shavite512_cpu_init(thr_id, throughput); - x11_echo512_cpu_init(thr_id, throughput); - if (x11_simd512_cpu_init(thr_id, throughput) != 0) { - return 0; - } -#endif - CUDA_CALL_OR_RET_X(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput), -1); - CUDA_CALL_OR_RET_X(cudaMemset(d_hash[thr_id], 0, (size_t) 64 * throughput), -1); - - cuda_check_cpu_init(thr_id, throughput); - - init[thr_id] = true; - } - - uint32_t endiandata[20]; - for (int k=0; k < 19; k++) - be32enc(&endiandata[k], pdata[k]); - - cuda_check_cpu_setTarget(ptarget); - - const int hashes = (int) strlen(hashOrder); - const char first = hashOrder[0]; - const uint8_t algo80 = first >= 'A' ? first - 'A' + 10 : first - '0'; - if (algo80 != s_firstalgo) { - s_firstalgo = algo80; - applog(LOG_INFO, "Timetravel first algo is now %s", algo_strings[algo80 % HASH_FUNC_COUNT]); - } - - switch (algo80) { - case BLAKE: - quark_blake512_cpu_setBlock_80(thr_id, endiandata); - break; - case BMW: - quark_bmw512_cpu_setBlock_80(endiandata); - break; - case GROESTL: - groestl512_setBlock_80(thr_id, endiandata); - break; - case SKEIN: - skein512_cpu_setBlock_80((void*)endiandata); - break; - case JH: - jh512_setBlock_80(thr_id, endiandata); - break; - case KECCAK: - keccak512_setBlock_80(thr_id, endiandata); - break; - case LUFFA: - qubit_luffa512_cpu_setBlock_80((void*)endiandata); - break; - case CUBEHASH: - cubehash512_setBlock_80(thr_id, endiandata); - break; - default: { - uint32_t next = get_next_time(swab32(s_ntime), hashOrder); - if (!thr_id) - applog(LOG_WARNING, "kernel %c unimplemented, next in %u mn", first, next/60); - sleep(next > 30 ? 60 : 10); - return -1; - } - } - - do { - int order = 0; - - // Hash with CUDA - - switch (algo80) { - case BLAKE: - quark_blake512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("blake80:"); - break; - case BMW: - quark_bmw512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - TRACE("bmw80 :"); - break; - case GROESTL: - groestl512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("grstl80:"); - break; - case SKEIN: - skein512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], 1); order++; - TRACE("skein80:"); - break; - case JH: - jh512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("jh51280:"); - break; - case KECCAK: - keccak512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("kecck80:"); - break; - case LUFFA: - qubit_luffa512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - TRACE("luffa80:"); - break; - case CUBEHASH: - cubehash512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("cube 80:"); - break; - } - - for (int i = 1; i < hashes; i++) - { - const char elem = hashOrder[i]; - const uint8_t algo64 = elem >= 'A' ? elem - 'A' + 10 : elem - '0'; - - switch (algo64) { - case BLAKE: - quark_blake512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("blake :"); - break; - case BMW: - quark_bmw512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("bmw :"); - break; - case GROESTL: - quark_groestl512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("groestl:"); - break; - case SKEIN: - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("skein :"); - break; - case JH: - quark_jh512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("jh512 :"); - break; - case KECCAK: - quark_keccak512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("keccak :"); - break; - case LUFFA: - x11_luffa512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("luffa :"); - break; - case CUBEHASH: - x11_cubehash512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("cube :"); - break; -#if HASH_FUNC_COUNT > 8 - case SHAVITE: - x11_shavite512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("shavite:"); - break; - case SIMD: - x11_simd512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("simd :"); - break; - case ECHO: - x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("echo :"); - break; -#endif - } - } - - *hashes_done = pdata[19] - first_nonce + throughput; - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - if (work->nonces[0] != UINT32_MAX) - { - uint32_t _ALIGN(64) vhash[8]; - const uint32_t Htarg = ptarget[7]; - be32enc(&endiandata[19], work->nonces[0]); - timetravel_hash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - pdata[19] = work->nonces[0]; - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - timetravel_hash(vhash, endiandata); - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - } - pdata[19] = max(pdata[19], work->nonces[1]) + 1; - } - return work->valid_nonces; - } else if (vhash[7] > Htarg) { - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - return 0; -} - -// cleanup -extern "C" void free_timetravel(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - - quark_blake512_cpu_free(thr_id); - quark_groestl512_cpu_free(thr_id); -#if HASH_FUNC_COUNT > 8 - x11_simd512_cpu_free(thr_id); -#endif - cuda_check_cpu_free(thr_id); - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/x11/veltor.cu b/x11/veltor.cu deleted file mode 100644 index 7bc1e18d..00000000 --- a/x11/veltor.cu +++ /dev/null @@ -1,197 +0,0 @@ -extern "C" { -#include "sph/sph_skein.h" -#include "sph/sph_shavite.h" -#include "sph/sph_shabal.h" -#include "sph/sph_streebog.h" -} - -#include "miner.h" -#include "cuda_helper.h" -#include "cuda_x11.h" - -extern void skein512_cpu_setBlock_80(void *pdata); -extern void skein512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, int swap); -extern void x14_shabal512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -// for SM3.x -extern void streebog_sm3_set_target(uint32_t* ptarget); -extern void streebog_sm3_hash_64_final(int thr_id, uint32_t threads, uint32_t *d_hash, uint32_t* d_resNonce); - -// for latest cards only -extern void skunk_cpu_init(int thr_id, uint32_t threads); -extern void skunk_streebog_set_target(uint32_t* ptarget); -extern void skunk_cuda_streebog(int thr_id, uint32_t threads, uint32_t *d_hash, uint32_t* d_resNonce); - -#include -#include - -#define NBN 2 -static uint32_t *d_hash[MAX_GPUS]; -static uint32_t *d_resNonce[MAX_GPUS]; - -// veltor CPU Hash -extern "C" void veltorhash(void *output, const void *input) -{ - unsigned char _ALIGN(128) hash[128] = { 0 }; - - sph_skein512_context ctx_skein; - sph_gost512_context ctx_gost; - sph_shabal512_context ctx_shabal; - sph_shavite512_context ctx_shavite; - - sph_skein512_init(&ctx_skein); - sph_skein512(&ctx_skein, input, 80); - sph_skein512_close(&ctx_skein, (void*) hash); - - sph_shavite512_init(&ctx_shavite); - sph_shavite512(&ctx_shavite, (const void*) hash, 64); - sph_shavite512_close(&ctx_shavite, (void*) hash); - - sph_shabal512_init(&ctx_shabal); - sph_shabal512(&ctx_shabal, (const void*) hash, 64); - sph_shabal512_close(&ctx_shabal, (void*) hash); - - sph_gost512_init(&ctx_gost); - sph_gost512(&ctx_gost, (const void*) hash, 64); - sph_gost512_close(&ctx_gost, (void*) hash); - - memcpy(output, hash, 32); -} - -static bool init[MAX_GPUS] = { 0 }; -static bool use_compat_kernels[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_veltor(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - int dev_id = device_map[thr_id]; - - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - int intensity = (device_sm[device_map[thr_id]] > 500) ? 20 : 18; - if (strstr(device_name[dev_id], "GTX 10")) intensity = 21; - uint32_t throughput = cuda_default_throughput(thr_id, 1U << intensity); - //if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ptarget[7] = 0xf; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - skunk_cpu_init(thr_id, throughput); - use_compat_kernels[thr_id] = (cuda_arch[dev_id] < 500); - - x11_shavite512_cpu_init(thr_id, throughput); - - CUDA_CALL_OR_RET_X(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput), 0); - CUDA_CALL_OR_RET_X(cudaMalloc(&d_resNonce[thr_id], NBN * sizeof(uint32_t)), -1); - - init[thr_id] = true; - } - - uint32_t _ALIGN(64) h_resNonce[NBN]; - uint32_t _ALIGN(64) endiandata[20]; - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - skein512_cpu_setBlock_80(endiandata); - - cudaMemset(d_resNonce[thr_id], 0xff, NBN*sizeof(uint32_t)); - if(use_compat_kernels[thr_id]) - streebog_sm3_set_target(ptarget); - else - skunk_streebog_set_target(ptarget); - - do { - int order = 0; - skein512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], 1); order++; - x11_shavite512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x14_shabal512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - if(use_compat_kernels[thr_id]) - streebog_sm3_hash_64_final(thr_id, throughput, d_hash[thr_id], d_resNonce[thr_id]); - else - skunk_cuda_streebog(thr_id, throughput, d_hash[thr_id], d_resNonce[thr_id]); - - cudaMemcpy(h_resNonce, d_resNonce[thr_id], NBN*sizeof(uint32_t), cudaMemcpyDeviceToHost); - - *hashes_done = pdata[19] - first_nonce + throughput; - - if (h_resNonce[0] != UINT32_MAX) - { - uint32_t _ALIGN(64) vhash[8]; - const uint32_t Htarg = ptarget[7]; - const uint32_t startNounce = pdata[19]; - - be32enc(&endiandata[19], startNounce + h_resNonce[0]); - veltorhash(vhash, endiandata); - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) - { - work->nonces[0] = startNounce + h_resNonce[0]; - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - if (h_resNonce[1] != UINT32_MAX) - { - uint32_t secNonce = work->nonces[1] = startNounce + h_resNonce[1]; - be32enc(&endiandata[19], secNonce); - veltorhash(vhash, endiandata); - work->nonces[1] = secNonce; - if (bn_hash_target_ratio(vhash, ptarget) > work->shareratio[0]) { - work_set_target_ratio(work, vhash); - xchg(work->nonces[1], work->nonces[0]); - } else { - bn_set_target_ratio(work, vhash, work->valid_nonces); - } - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", h_resNonce[0]); - cudaMemset(d_resNonce[thr_id], 0xff, NBN*sizeof(uint32_t)); - pdata[19] = startNounce + h_resNonce[0] + 1; - continue; - } - } - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - - return 0; -} - -// cleanup -extern "C" void free_veltor(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - cudaFree(d_resNonce[thr_id]); - - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/x11/x11.cu b/x11/x11.cu deleted file mode 100644 index a7f1b601..00000000 --- a/x11/x11.cu +++ /dev/null @@ -1,233 +0,0 @@ -extern "C" { -#include "sph/sph_blake.h" -#include "sph/sph_bmw.h" -#include "sph/sph_groestl.h" -#include "sph/sph_skein.h" -#include "sph/sph_jh.h" -#include "sph/sph_keccak.h" -#include "sph/sph_luffa.h" -#include "sph/sph_cubehash.h" -#include "sph/sph_shavite.h" -#include "sph/sph_simd.h" -#include "sph/sph_echo.h" -} - -#include "miner.h" -#include "cuda_helper.h" -#include "cuda_x11.h" - -#include -#include - -static uint32_t *d_hash[MAX_GPUS]; - -// X11 CPU Hash -extern "C" void x11hash(void *output, const void *input) -{ - unsigned char _ALIGN(128) hash[128] = { 0 }; - - // blake1-bmw2-grs3-skein4-jh5-keccak6-luffa7-cubehash8-shavite9-simd10-echo11 - - sph_blake512_context ctx_blake; - sph_bmw512_context ctx_bmw; - sph_groestl512_context ctx_groestl; - sph_jh512_context ctx_jh; - sph_keccak512_context ctx_keccak; - sph_skein512_context ctx_skein; - sph_luffa512_context ctx_luffa; - sph_cubehash512_context ctx_cubehash; - sph_shavite512_context ctx_shavite; - sph_simd512_context ctx_simd; - sph_echo512_context ctx_echo; - - sph_blake512_init(&ctx_blake); - sph_blake512 (&ctx_blake, input, 80); - sph_blake512_close(&ctx_blake, (void*) hash); - - sph_bmw512_init(&ctx_bmw); - sph_bmw512 (&ctx_bmw, (const void*) hash, 64); - sph_bmw512_close(&ctx_bmw, (void*) hash); - - sph_groestl512_init(&ctx_groestl); - sph_groestl512 (&ctx_groestl, (const void*) hash, 64); - sph_groestl512_close(&ctx_groestl, (void*) hash); - - sph_skein512_init(&ctx_skein); - sph_skein512 (&ctx_skein, (const void*) hash, 64); - sph_skein512_close(&ctx_skein, (void*) hash); - - sph_jh512_init(&ctx_jh); - sph_jh512 (&ctx_jh, (const void*) hash, 64); - sph_jh512_close(&ctx_jh, (void*) hash); - - sph_keccak512_init(&ctx_keccak); - sph_keccak512 (&ctx_keccak, (const void*) hash, 64); - sph_keccak512_close(&ctx_keccak, (void*) hash); - - sph_luffa512_init(&ctx_luffa); - sph_luffa512 (&ctx_luffa, (const void*) hash, 64); - sph_luffa512_close (&ctx_luffa, (void*) hash); - - sph_cubehash512_init(&ctx_cubehash); - sph_cubehash512 (&ctx_cubehash, (const void*) hash, 64); - sph_cubehash512_close(&ctx_cubehash, (void*) hash); - - sph_shavite512_init(&ctx_shavite); - sph_shavite512 (&ctx_shavite, (const void*) hash, 64); - sph_shavite512_close(&ctx_shavite, (void*) hash); - - sph_simd512_init(&ctx_simd); - sph_simd512 (&ctx_simd, (const void*) hash, 64); - sph_simd512_close(&ctx_simd, (void*) hash); - - sph_echo512_init(&ctx_echo); - sph_echo512 (&ctx_echo, (const void*) hash, 64); - sph_echo512_close(&ctx_echo, (void*) hash); - - memcpy(output, hash, 32); -} - -//#define _DEBUG -#define _DEBUG_PREFIX "x11" -#include "cuda_debug.cuh" - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_x11(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - int intensity = (device_sm[device_map[thr_id]] >= 500 && !is_windows()) ? 20 : 19; - uint32_t throughput = cuda_default_throughput(thr_id, 1U << intensity); // 19=256*256*8; - //if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ptarget[7] = 0x5; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - quark_blake512_cpu_init(thr_id, throughput); - quark_bmw512_cpu_init(thr_id, throughput); - quark_groestl512_cpu_init(thr_id, throughput); - quark_skein512_cpu_init(thr_id, throughput); - quark_keccak512_cpu_init(thr_id, throughput); - quark_jh512_cpu_init(thr_id, throughput); - x11_luffaCubehash512_cpu_init(thr_id, throughput); - x11_shavite512_cpu_init(thr_id, throughput); - x11_echo512_cpu_init(thr_id, throughput); - if (x11_simd512_cpu_init(thr_id, throughput) != 0) { - return 0; - } - CUDA_CALL_OR_RET_X(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput), 0); - - cuda_check_cpu_init(thr_id, throughput); - - init[thr_id] = true; - } - - uint32_t endiandata[20]; - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - quark_blake512_cpu_setBlock_80(thr_id, endiandata); - cuda_check_cpu_setTarget(ptarget); - - do { - int order = 0; - - // Hash with CUDA - quark_blake512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("blake :"); - quark_bmw512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("bmw :"); - quark_groestl512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("groestl:"); - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("skein :"); - quark_jh512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("jh512 :"); - quark_keccak512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("keccak :"); - x11_luffaCubehash512_cpu_hash_64(thr_id, throughput, d_hash[thr_id], order++); - TRACE("luffa+c:"); - x11_shavite512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("shavite:"); - x11_simd512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("simd :"); - x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("echo => "); - - *hashes_done = pdata[19] - first_nonce + throughput; - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - be32enc(&endiandata[19], work->nonces[0]); - x11hash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - x11hash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } else { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - return 0; -} - -// cleanup -extern "C" void free_x11(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - - quark_blake512_cpu_free(thr_id); - quark_groestl512_cpu_free(thr_id); - x11_simd512_cpu_free(thr_id); - - cuda_check_cpu_free(thr_id); - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/x11/x11evo.cu b/x11/x11evo.cu deleted file mode 100644 index 53799f9b..00000000 --- a/x11/x11evo.cu +++ /dev/null @@ -1,414 +0,0 @@ -/** - * X11EVO algo implementation - * Cuda implementation by tpruvot@github - May 2016 - */ -#include -#include - -extern "C" { -#include "sph/sph_blake.h" -#include "sph/sph_bmw.h" -#include "sph/sph_groestl.h" -#include "sph/sph_skein.h" -#include "sph/sph_jh.h" -#include "sph/sph_keccak.h" -#include "sph/sph_luffa.h" -#include "sph/sph_cubehash.h" -#include "sph/sph_shavite.h" -#include "sph/sph_simd.h" -#include "sph/sph_echo.h" -} - -#include "miner.h" -#include "cuda_helper.h" -#include "cuda_x11.h" - -static uint32_t *d_hash[MAX_GPUS]; - -enum Algo { - BLAKE = 0, - BMW, - GROESTL, - SKEIN, - JH, - KECCAK, - LUFFA, - CUBEHASH, - SHAVITE, - SIMD, - ECHO, - HASH_FUNC_COUNT -}; - -static void swap8(uint8_t *a, uint8_t *b) -{ - uint8_t t = *a; - *a = *b; - *b = t; -} - -static void initPerm(uint8_t n[], int count) -{ - for (int i = 0; i < count; i++) - n[i] = i; -} - -static int nextPerm(uint8_t n[], int count) -{ - int tail, i, j; - - if (count <= 1) - return 0; - - for (i = count - 1; i>0 && n[i - 1] >= n[i]; i--); - tail = i; - - if (tail > 0) { - for (j = count - 1; j>tail && n[j] <= n[tail - 1]; j--); - swap8(&n[tail - 1], &n[j]); - } - - for (i = tail, j = count - 1; i= 10) - sprintf(sptr, "%c", 'A' + (algoList[j] - 10)); - else - sprintf(sptr, "%u", (uint32_t) algoList[j]); - sptr++; - } - *sptr = '\0'; - //applog(LOG_DEBUG, "nextPerm %s", str); -} - -static __thread uint32_t s_ntime = 0; -static char hashOrder[HASH_FUNC_COUNT + 1] = { 0 }; -static int s_sequence = -1; - -#define INITIAL_DATE 0x57254700 -static inline int getCurrentAlgoSeq(uint32_t current_time) -{ - // change once per day - return (int) (current_time - INITIAL_DATE) / (60 * 60 * 24); -} - -static void evo_twisted_code(uint32_t ntime, char *permstr) -{ - int seq = getCurrentAlgoSeq(ntime); - if (s_sequence != seq) { - getAlgoString(permstr, seq); - s_sequence = seq; - } -} - -// X11evo CPU Hash -extern "C" void x11evo_hash(void *output, const void *input) -{ - uint32_t _ALIGN(64) hash[64/4] = { 0 }; - - sph_blake512_context ctx_blake; - sph_bmw512_context ctx_bmw; - sph_groestl512_context ctx_groestl; - sph_skein512_context ctx_skein; - sph_jh512_context ctx_jh; - sph_keccak512_context ctx_keccak; - sph_luffa512_context ctx_luffa1; - sph_cubehash512_context ctx_cubehash1; - sph_shavite512_context ctx_shavite1; - sph_simd512_context ctx_simd1; - sph_echo512_context ctx_echo1; - - if (s_sequence == -1) { - uint32_t *data = (uint32_t*) input; - const uint32_t ntime = data[17]; - evo_twisted_code(ntime, hashOrder); - } - - void *in = (void*) input; - int size = 80; - - const int hashes = (int) strlen(hashOrder); - - for (int i = 0; i < hashes; i++) - { - const char elem = hashOrder[i]; - uint8_t algo = elem >= 'A' ? elem - 'A' + 10 : elem - '0'; - - if (i > 0) { - in = (void*) hash; - size = 64; - } - - switch (algo) { - case BLAKE: - sph_blake512_init(&ctx_blake); - sph_blake512(&ctx_blake, in, size); - sph_blake512_close(&ctx_blake, hash); - break; - case BMW: - sph_bmw512_init(&ctx_bmw); - sph_bmw512(&ctx_bmw, in, size); - sph_bmw512_close(&ctx_bmw, hash); - break; - case GROESTL: - sph_groestl512_init(&ctx_groestl); - sph_groestl512(&ctx_groestl, in, size); - sph_groestl512_close(&ctx_groestl, hash); - break; - case SKEIN: - sph_skein512_init(&ctx_skein); - sph_skein512(&ctx_skein, in, size); - sph_skein512_close(&ctx_skein, hash); - break; - case JH: - sph_jh512_init(&ctx_jh); - sph_jh512(&ctx_jh, in, size); - sph_jh512_close(&ctx_jh, hash); - break; - case KECCAK: - sph_keccak512_init(&ctx_keccak); - sph_keccak512(&ctx_keccak, in, size); - sph_keccak512_close(&ctx_keccak, hash); - break; - case LUFFA: - sph_luffa512_init(&ctx_luffa1); - sph_luffa512(&ctx_luffa1, in, size); - sph_luffa512_close(&ctx_luffa1, hash); - break; - case CUBEHASH: - sph_cubehash512_init(&ctx_cubehash1); - sph_cubehash512(&ctx_cubehash1, in, size); - sph_cubehash512_close(&ctx_cubehash1, hash); - break; - case SHAVITE: - sph_shavite512_init(&ctx_shavite1); - sph_shavite512(&ctx_shavite1, in, size); - sph_shavite512_close(&ctx_shavite1, hash); - break; - case SIMD: - sph_simd512_init(&ctx_simd1); - sph_simd512(&ctx_simd1, in, size); - sph_simd512_close(&ctx_simd1, hash); - break; - case ECHO: - sph_echo512_init(&ctx_echo1); - sph_echo512(&ctx_echo1, in, size); - sph_echo512_close(&ctx_echo1, hash); - break; - } - } - - memcpy(output, hash, 32); -} - -//#define _DEBUG -#define _DEBUG_PREFIX "evo" -#include "cuda_debug.cuh" - -static bool init[MAX_GPUS] = { 0 }; - -extern void quark_blake512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_outputHash, int order); - -extern "C" int scanhash_x11evo(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - int intensity = (device_sm[device_map[thr_id]] >= 500 && !is_windows()) ? 20 : 19; - uint32_t throughput = cuda_default_throughput(thr_id, 1U << intensity); // 19=256*256*8; - //if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_debug || s_ntime != pdata[17] || s_sequence == -1) { - uint32_t ntime = swab32(work->data[17]); - evo_twisted_code(ntime, hashOrder); - s_ntime = pdata[17]; - if (opt_debug) { - int secs = (int) (ntime - INITIAL_DATE) % (60 * 60 * 24); - secs = (60 * 60 * 24) - secs; - applog(LOG_DEBUG, "evo hash order %s, next in %d mn", hashOrder, secs/60); - } - } - - if (opt_benchmark) - ptarget[7] = 0x5; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - quark_blake512_cpu_init(thr_id, throughput); - quark_bmw512_cpu_init(thr_id, throughput); - quark_groestl512_cpu_init(thr_id, throughput); - quark_skein512_cpu_init(thr_id, throughput); - quark_keccak512_cpu_init(thr_id, throughput); - quark_jh512_cpu_init(thr_id, throughput); - x11_luffa512_cpu_init(thr_id, throughput); - x11_cubehash512_cpu_init(thr_id, throughput); - x11_shavite512_cpu_init(thr_id, throughput); - x11_echo512_cpu_init(thr_id, throughput); - if (x11_simd512_cpu_init(thr_id, throughput) != 0) { - return 0; - } - CUDA_CALL_OR_RET_X(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput), 0); - - cuda_check_cpu_init(thr_id, throughput); - - init[thr_id] = true; - } - - uint32_t endiandata[20]; - for (int k=0; k < 19; k++) - be32enc(&endiandata[k], pdata[k]); - - cuda_check_cpu_setTarget(ptarget); - quark_blake512_cpu_setBlock_80(thr_id, endiandata); - - const int hashes = (int) strlen(hashOrder); - - do { - int order = 1; - - // Hash with CUDA - quark_blake512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); - TRACE("blake80:"); - - for (int i = 1; i < hashes; i++) - { - const char elem = hashOrder[i]; - const uint8_t algo64 = elem >= 'A' ? elem - 'A' + 10 : elem - '0'; - - switch (algo64) { - case BLAKE: - quark_blake512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("blake :"); - break; - case BMW: - quark_bmw512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("bmw :"); - break; - case GROESTL: - quark_groestl512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("groestl:"); - break; - case SKEIN: - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("skein :"); - break; - case JH: - quark_jh512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("jh512 :"); - break; - case KECCAK: - quark_keccak512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("keccak :"); - break; - case LUFFA: - x11_luffa512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("luffa :"); - break; - case CUBEHASH: - x11_cubehash512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("cube :"); - break; - case SHAVITE: - x11_shavite512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("shavite:"); - break; - case SIMD: - x11_simd512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("simd :"); - break; - case ECHO: - x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("echo :"); - break; - } - } - - *hashes_done = pdata[19] - first_nonce + throughput; - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - be32enc(&endiandata[19], work->nonces[0]); - x11evo_hash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - pdata[19] = work->nonces[0] + 1; // cursor - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - x11evo_hash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - gpulog(LOG_DEBUG, thr_id, "second nonce %08x! cursor %08x", work->nonces[1], pdata[19]); - work->valid_nonces++; - } - return work->valid_nonces; - } else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce + 1; - return 0; -} - -// cleanup -extern "C" void free_x11evo(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - - quark_blake512_cpu_free(thr_id); - quark_groestl512_cpu_free(thr_id); - x11_simd512_cpu_free(thr_id); - - cuda_check_cpu_free(thr_id); - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/x13/cuda_hsr_sm3.cu b/x13/cuda_hsr_sm3.cu deleted file mode 100644 index 5ce01862..00000000 --- a/x13/cuda_hsr_sm3.cu +++ /dev/null @@ -1,139 +0,0 @@ -#include -#include -#include - -#include -#include - -#define F(x, y, z) (((x) ^ (y) ^ (z))) -#define FF(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) -#define GG(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) - -#define P0(x) x ^ ROTL32(x, 9) ^ ROTL32(x, 17) -#define P1(x) x ^ ROTL32(x, 15) ^ ROTL32(x, 23) - -static __forceinline__ __device__ -void sm3_compress2(uint32_t digest[8], const uint32_t pblock[16]) -{ - uint32_t tt1, tt2, i, t, ss1, ss2, x, y; - uint32_t w[68]; - uint32_t a = digest[0]; - uint32_t b = digest[1]; - uint32_t c = digest[2]; - uint32_t d = digest[3]; - uint32_t e = digest[4]; - uint32_t f = digest[5]; - uint32_t g = digest[6]; - uint32_t h = digest[7]; - - #pragma unroll - for (i = 0; i<16; i++) { - w[i] = cuda_swab32(pblock[i]); - } - - for (i = 16; i<68; i++) { - x = ROTL32(w[i - 3], 15); - y = ROTL32(w[i - 13], 7); - - x ^= w[i - 16]; - x ^= w[i - 9]; - y ^= w[i - 6]; - - w[i] = P1(x) ^ y; - } - - for (i = 0; i<64; i++) { - - t = (i < 16) ? 0x79cc4519 : 0x7a879d8a; - - ss2 = ROTL32(a, 12); - ss1 = ROTL32(ss2 + e + ROTL32(t, i), 7); - ss2 ^= ss1; - - tt1 = d + ss2 + (w[i] ^ w[i + 4]); - tt2 = h + ss1 + w[i]; - - if (i < 16) { - tt1 += F(a, b, c); - tt2 += F(e, f, g); - } - else { - tt1 += FF(a, b, c); - tt2 += GG(e, f, g); - } - d = c; - c = ROTL32(b, 9); - b = a; - a = tt1; - h = g; - g = ROTL32(f, 19); - f = e; - e = P0(tt2); - } - - digest[0] ^= a; - digest[1] ^= b; - digest[2] ^= c; - digest[3] ^= d; - digest[4] ^= e; - digest[5] ^= f; - digest[6] ^= g; - digest[7] ^= h; -} - -/***************************************************/ -// GPU Hash Function -__global__ -void sm3_gpu_hash_64(const uint32_t threads, uint32_t *g_hash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - - if (thread < threads) - { - const size_t hashPosition = thread; - - uint32_t digest[8]; - digest[0] = 0x7380166F; - digest[1] = 0x4914B2B9; - digest[2] = 0x172442D7; - digest[3] = 0xDA8A0600; - digest[4] = 0xA96F30BC; - digest[5] = 0x163138AA; - digest[6] = 0xE38DEE4D; - digest[7] = 0xB0FB0E4E; - - uint32_t *pHash = &g_hash[hashPosition << 4]; - sm3_compress2(digest, pHash); - - uint32_t block[16]; - block[0] = 0x80; - - #pragma unroll - for (int i = 1; i < 14; i++) - block[i] = 0; - - // count - block[14] = cuda_swab32(1 >> 23); - block[15] = cuda_swab32((1 << 9) + (0 << 3)); - - sm3_compress2(digest, block); - - for (int i = 0; i < 8; i++) - pHash[i] = cuda_swab32(digest[i]); - - for (int i = 8; i < 16; i++) - pHash[i] = 0; - } -} - -__host__ -void sm3_cuda_hash_64(int thr_id, uint32_t threads, uint32_t *g_hash, int order) -{ - const uint32_t threadsperblock = 256; - - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - - sm3_gpu_hash_64 <<>>(threads, g_hash); - //MyStreamSynchronize(NULL, order, thr_id); -} diff --git a/x13/cuda_x13_fugue512.cu b/x13/cuda_x13_fugue512.cu deleted file mode 100644 index b69ddb63..00000000 --- a/x13/cuda_x13_fugue512.cu +++ /dev/null @@ -1,405 +0,0 @@ - -#include - -#define TPB 256 - -/* - * fugue512 x13 kernel implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2014-2017 phm, tpruvot - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - */ - -#ifdef __INTELLISENSE__ -#define __byte_perm(x, y, m) (x|y) -#define tex1Dfetch(t, n) (n) -#define __CUDACC__ -#include -#endif - -// store allocated textures device addresses -static unsigned int* d_textures[MAX_GPUS][1]; - -#define mixtab0(x) mixtabs[(x)] -#define mixtab1(x) mixtabs[(x)+256] -#define mixtab2(x) mixtabs[(x)+512] -#define mixtab3(x) mixtabs[(x)+768] - -static texture mixTab0Tex; - -static const uint32_t mixtab0[] = { - 0x63633297, 0x7c7c6feb, 0x77775ec7, 0x7b7b7af7, 0xf2f2e8e5, 0x6b6b0ab7, 0x6f6f16a7, 0xc5c56d39, - 0x303090c0, 0x01010704, 0x67672e87, 0x2b2bd1ac, 0xfefeccd5, 0xd7d71371, 0xabab7c9a, 0x767659c3, - 0xcaca4005, 0x8282a33e, 0xc9c94909, 0x7d7d68ef, 0xfafad0c5, 0x5959947f, 0x4747ce07, 0xf0f0e6ed, - 0xadad6e82, 0xd4d41a7d, 0xa2a243be, 0xafaf608a, 0x9c9cf946, 0xa4a451a6, 0x727245d3, 0xc0c0762d, - 0xb7b728ea, 0xfdfdc5d9, 0x9393d47a, 0x2626f298, 0x363682d8, 0x3f3fbdfc, 0xf7f7f3f1, 0xcccc521d, - 0x34348cd0, 0xa5a556a2, 0xe5e58db9, 0xf1f1e1e9, 0x71714cdf, 0xd8d83e4d, 0x313197c4, 0x15156b54, - 0x04041c10, 0xc7c76331, 0x2323e98c, 0xc3c37f21, 0x18184860, 0x9696cf6e, 0x05051b14, 0x9a9aeb5e, - 0x0707151c, 0x12127e48, 0x8080ad36, 0xe2e298a5, 0xebeba781, 0x2727f59c, 0xb2b233fe, 0x757550cf, - 0x09093f24, 0x8383a43a, 0x2c2cc4b0, 0x1a1a4668, 0x1b1b416c, 0x6e6e11a3, 0x5a5a9d73, 0xa0a04db6, - 0x5252a553, 0x3b3ba1ec, 0xd6d61475, 0xb3b334fa, 0x2929dfa4, 0xe3e39fa1, 0x2f2fcdbc, 0x8484b126, - 0x5353a257, 0xd1d10169, 0x00000000, 0xededb599, 0x2020e080, 0xfcfcc2dd, 0xb1b13af2, 0x5b5b9a77, - 0x6a6a0db3, 0xcbcb4701, 0xbebe17ce, 0x3939afe4, 0x4a4aed33, 0x4c4cff2b, 0x5858937b, 0xcfcf5b11, - 0xd0d0066d, 0xefefbb91, 0xaaaa7b9e, 0xfbfbd7c1, 0x4343d217, 0x4d4df82f, 0x333399cc, 0x8585b622, - 0x4545c00f, 0xf9f9d9c9, 0x02020e08, 0x7f7f66e7, 0x5050ab5b, 0x3c3cb4f0, 0x9f9ff04a, 0xa8a87596, - 0x5151ac5f, 0xa3a344ba, 0x4040db1b, 0x8f8f800a, 0x9292d37e, 0x9d9dfe42, 0x3838a8e0, 0xf5f5fdf9, - 0xbcbc19c6, 0xb6b62fee, 0xdada3045, 0x2121e784, 0x10107040, 0xffffcbd1, 0xf3f3efe1, 0xd2d20865, - 0xcdcd5519, 0x0c0c2430, 0x1313794c, 0xececb29d, 0x5f5f8667, 0x9797c86a, 0x4444c70b, 0x1717655c, - 0xc4c46a3d, 0xa7a758aa, 0x7e7e61e3, 0x3d3db3f4, 0x6464278b, 0x5d5d886f, 0x19194f64, 0x737342d7, - 0x60603b9b, 0x8181aa32, 0x4f4ff627, 0xdcdc225d, 0x2222ee88, 0x2a2ad6a8, 0x9090dd76, 0x88889516, - 0x4646c903, 0xeeeebc95, 0xb8b805d6, 0x14146c50, 0xdede2c55, 0x5e5e8163, 0x0b0b312c, 0xdbdb3741, - 0xe0e096ad, 0x32329ec8, 0x3a3aa6e8, 0x0a0a3628, 0x4949e43f, 0x06061218, 0x2424fc90, 0x5c5c8f6b, - 0xc2c27825, 0xd3d30f61, 0xacac6986, 0x62623593, 0x9191da72, 0x9595c662, 0xe4e48abd, 0x797974ff, - 0xe7e783b1, 0xc8c84e0d, 0x373785dc, 0x6d6d18af, 0x8d8d8e02, 0xd5d51d79, 0x4e4ef123, 0xa9a97292, - 0x6c6c1fab, 0x5656b943, 0xf4f4fafd, 0xeaeaa085, 0x6565208f, 0x7a7a7df3, 0xaeae678e, 0x08083820, - 0xbaba0bde, 0x787873fb, 0x2525fb94, 0x2e2ecab8, 0x1c1c5470, 0xa6a65fae, 0xb4b421e6, 0xc6c66435, - 0xe8e8ae8d, 0xdddd2559, 0x747457cb, 0x1f1f5d7c, 0x4b4bea37, 0xbdbd1ec2, 0x8b8b9c1a, 0x8a8a9b1e, - 0x70704bdb, 0x3e3ebaf8, 0xb5b526e2, 0x66662983, 0x4848e33b, 0x0303090c, 0xf6f6f4f5, 0x0e0e2a38, - 0x61613c9f, 0x35358bd4, 0x5757be47, 0xb9b902d2, 0x8686bf2e, 0xc1c17129, 0x1d1d5374, 0x9e9ef74e, - 0xe1e191a9, 0xf8f8decd, 0x9898e556, 0x11117744, 0x696904bf, 0xd9d93949, 0x8e8e870e, 0x9494c166, - 0x9b9bec5a, 0x1e1e5a78, 0x8787b82a, 0xe9e9a989, 0xcece5c15, 0x5555b04f, 0x2828d8a0, 0xdfdf2b51, - 0x8c8c8906, 0xa1a14ab2, 0x89899212, 0x0d0d2334, 0xbfbf10ca, 0xe6e684b5, 0x4242d513, 0x686803bb, - 0x4141dc1f, 0x9999e252, 0x2d2dc3b4, 0x0f0f2d3c, 0xb0b03df6, 0x5454b74b, 0xbbbb0cda, 0x16166258 -}; - -#define TIX4(q, x00, x01, x04, x07, x08, x22, x24, x27, x30) { \ - x22 ^= x00; \ - x00 = (q); \ - x08 ^= x00; \ - x01 ^= x24; \ - x04 ^= x27; \ - x07 ^= x30; \ -} - -#define CMIX36(x00, x01, x02, x04, x05, x06, x18, x19, x20) { \ - x00 ^= x04; \ - x01 ^= x05; \ - x02 ^= x06; \ - x18 ^= x04; \ - x19 ^= x05; \ - x20 ^= x06; \ -} - -#define SMIX(x0, x1, x2, x3) { \ - uint32_t tmp; \ - uint32_t r0 = 0; \ - uint32_t r1 = 0; \ - uint32_t r2 = 0; \ - uint32_t r3 = 0; \ - uint32_t c0 = mixtab0(x0 >> 24); \ - tmp = mixtab1((x0 >> 16) & 0xFF); \ - c0 ^= tmp; \ - r1 ^= tmp; \ - tmp = mixtab2((x0 >> 8) & 0xFF); \ - c0 ^= tmp; \ - r2 ^= tmp; \ - tmp = mixtab3(x0 & 0xFF); \ - c0 ^= tmp; \ - r3 ^= tmp; \ - tmp = mixtab0(x1 >> 24); \ - uint32_t c1 = tmp; \ - r0 ^= tmp; \ - tmp = mixtab1((x1 >> 16) & 0xFF); \ - c1 ^= tmp; \ - tmp = mixtab2((x1 >> 8) & 0xFF); \ - c1 ^= tmp; \ - r2 ^= tmp; \ - tmp = mixtab3(x1 & 0xFF); \ - c1 ^= tmp; \ - r3 ^= tmp; \ - tmp = mixtab0(x2 >> 24); \ - uint32_t c2 = tmp; \ - r0 ^= tmp; \ - tmp = mixtab1((x2 >> 16) & 0xFF); \ - c2 ^= tmp; \ - r1 ^= tmp; \ - tmp = mixtab2((x2 >> 8) & 0xFF); \ - c2 ^= tmp; \ - tmp = mixtab3(x2 & 0xFF); \ - c2 ^= tmp; \ - r3 ^= tmp; \ - tmp = mixtab0(x3 >> 24); \ - uint32_t c3 = tmp; \ - r0 ^= tmp; \ - tmp = mixtab1((x3 >> 16) & 0xFF); \ - c3 ^= tmp; \ - r1 ^= tmp; \ - tmp = mixtab2((x3 >> 8) & 0xFF); \ - c3 ^= tmp; \ - r2 ^= tmp; \ - tmp = mixtab3(x3 & 0xFF); \ - c3 ^= tmp; \ - x0 = ((c0 ^ r0) & 0xFF000000) | ((c1 ^ r1) & 0x00FF0000) \ - | ((c2 ^ r2) & 0x0000FF00) | ((c3 ^ r3) & 0x000000FF); \ - x1 = ((c1 ^ (r0 << 8)) & 0xFF000000) | ((c2 ^ (r1 << 8)) & 0x00FF0000) \ - | ((c3 ^ (r2 << 8)) & 0x0000FF00) | ((c0 ^ (r3 >> 24)) & 0x000000FF); \ - x2 = ((c2 ^ (r0 << 16)) & 0xFF000000) | ((c3 ^ (r1 << 16)) & 0x00FF0000) \ - | ((c0 ^ (r2 >> 16)) & 0x0000FF00) | ((c1 ^ (r3 >> 16)) & 0x000000FF); \ - x3 = ((c3 ^ (r0 << 24)) & 0xFF000000) | ((c0 ^ (r1 >> 8)) & 0x00FF0000) \ - | ((c1 ^ (r2 >> 8)) & 0x0000FF00) | ((c2 ^ (r3 >> 8)) & 0x000000FF); \ -} - -#define SUB_ROR3 { \ - B33 = S33, B34 = S34, B35 = S35; \ - S35 = S32; S34 = S31; S33 = S30; S32 = S29; S31 = S28; S30 = S27; S29 = S26; S28 = S25; S27 = S24; \ - S26 = S23; S25 = S22; S24 = S21; S23 = S20; S22 = S19; S21 = S18; S20 = S17; S19 = S16; S18 = S15; \ - S17 = S14; S16 = S13; S15 = S12; S14 = S11; S13 = S10; S12 = S09; S11 = S08; S10 = S07; S09 = S06; \ - S08 = S05; S07 = S04; S06 = S03; S05 = S02; S04 = S01; S03 = S00; S02 = B35; S01 = B34; S00 = B33; \ -} - -#define SUB_ROR8 { \ - B28 = S28, B29 = S29, B30 = S30, B31 = S31, B32 = S32, B33 = S33, B34 = S34, B35 = S35; \ - S35 = S27; S34 = S26; S33 = S25; S32 = S24; S31 = S23; S30 = S22; S29 = S21; S28 = S20; S27 = S19; \ - S26 = S18; S25 = S17; S24 = S16; S23 = S15; S22 = S14; S21 = S13; S20 = S12; S19 = S11; S18 = S10; \ - S17 = S09; S16 = S08; S15 = S07; S14 = S06; S13 = S05; S12 = S04; S11 = S03; S10 = S02; S09 = S01; \ - S08 = S00; S07 = B35; S06 = B34; S05 = B33; S04 = B32; S03 = B31; S02 = B30; S01 = B29; S00 = B28; \ -} - -#define SUB_ROR9 { \ - B27 = S27, B28 = S28, B29 = S29, B30 = S30, B31 = S31, B32 = S32, B33 = S33, B34 = S34, B35 = S35; \ - S35 = S26; S34 = S25; S33 = S24; S32 = S23; S31 = S22; S30 = S21; S29 = S20; S28 = S19; S27 = S18; \ - S26 = S17; S25 = S16; S24 = S15; S23 = S14; S22 = S13; S21 = S12; S20 = S11; S19 = S10; S18 = S09; \ - S17 = S08; S16 = S07; S15 = S06; S14 = S05; S13 = S04; S12 = S03; S11 = S02; S10 = S01; S09 = S00; \ - S08 = B35; S07 = B34; S06 = B33; S05 = B32; S04 = B31; S03 = B30; S02 = B29; S01 = B28; S00 = B27; \ -} - -#define FUGUE512_3(x, y, z) { \ - TIX4(x, S00, S01, S04, S07, S08, S22, S24, S27, S30); \ - CMIX36(S33, S34, S35, S01, S02, S03, S15, S16, S17); \ - SMIX(S33, S34, S35, S00); \ - CMIX36(S30, S31, S32, S34, S35, S00, S12, S13, S14); \ - SMIX(S30, S31, S32, S33); \ - CMIX36(S27, S28, S29, S31, S32, S33, S09, S10, S11); \ - SMIX(S27, S28, S29, S30); \ - CMIX36(S24, S25, S26, S28, S29, S30, S06, S07, S08); \ - SMIX(S24, S25, S26, S27); \ - \ - TIX4(y, S24, S25, S28, S31, S32, S10, S12, S15, S18); \ - CMIX36(S21, S22, S23, S25, S26, S27, S03, S04, S05); \ - SMIX(S21, S22, S23, S24); \ - CMIX36(S18, S19, S20, S22, S23, S24, S00, S01, S02); \ - SMIX(S18, S19, S20, S21); \ - CMIX36(S15, S16, S17, S19, S20, S21, S33, S34, S35); \ - SMIX(S15, S16, S17, S18); \ - CMIX36(S12, S13, S14, S16, S17, S18, S30, S31, S32); \ - SMIX(S12, S13, S14, S15); \ - \ - TIX4(z, S12, S13, S16, S19, S20, S34, S00, S03, S06); \ - CMIX36(S09, S10, S11, S13, S14, S15, S27, S28, S29); \ - SMIX(S09, S10, S11, S12); \ - CMIX36(S06, S07, S08, S10, S11, S12, S24, S25, S26); \ - SMIX(S06, S07, S08, S09); \ - CMIX36(S03, S04, S05, S07, S08, S09, S21, S22, S23); \ - SMIX(S03, S04, S05, S06); \ - CMIX36(S00, S01, S02, S04, S05, S06, S18, S19, S20); \ - SMIX(S00, S01, S02, S03); \ -} - -#undef ROL8 -#ifdef __CUDA_ARCH__ -__device__ __forceinline__ -uint32_t ROL8(const uint32_t a) { - return __byte_perm(a, 0, 0x2103); -} -__device__ __forceinline__ -uint32_t ROR8(const uint32_t a) { - return __byte_perm(a, 0, 0x0321); -} -__device__ __forceinline__ -uint32_t ROL16(const uint32_t a) { - return __byte_perm(a, 0, 0x1032); -} -#else -#define ROL8(u) ROTL32(u, 8) -#define ROR8(u) ROTR32(u, 8) -#define ROL16(u) ROTL32(u,16) -#endif - - -#define AS_UINT4(addr) *((uint4*)(addr)) - -/***************************************************/ -__global__ -__launch_bounds__(TPB) -void x13_fugue512_gpu_hash_64(uint32_t threads, uint64_t *g_hash) -{ - __shared__ uint32_t mixtabs[1024]; - - // load shared mem (with 256 threads) - const uint32_t thr = threadIdx.x & 0xFF; - const uint32_t tmp = tex1Dfetch(mixTab0Tex, thr); - mixtabs[thr] = tmp; - mixtabs[thr+256] = ROR8(tmp); - mixtabs[thr+512] = ROL16(tmp); - mixtabs[thr+768] = ROL8(tmp); -#if TPB <= 256 - if (blockDim.x < 256) { - const uint32_t thr = (threadIdx.x + 0x80) & 0xFF; - const uint32_t tmp = tex1Dfetch(mixTab0Tex, thr); - mixtabs[thr] = tmp; - mixtabs[thr + 256] = ROR8(tmp); - mixtabs[thr + 512] = ROL16(tmp); - mixtabs[thr + 768] = ROL8(tmp); - } -#endif - - __syncthreads(); - - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const size_t hashPosition = thread; - uint64_t*pHash = &g_hash[hashPosition<<3]; - uint32_t Hash[16]; - - #pragma unroll 4 - for(int i = 0; i < 4; i++) - AS_UINT4(&Hash[i*4]) = AS_UINT4(&pHash[i*2]); - - #pragma unroll 16 - for(int i = 0; i < 16; i++) - Hash[i] = cuda_swab32(Hash[i]); - - uint32_t S00, S01, S02, S03, S04, S05, S06, S07, S08, S09; - uint32_t S10, S11, S12, S13, S14, S15, S16, S17, S18, S19; - uint32_t S20, S21, S22, S23, S24, S25, S26, S27, S28, S29; - uint32_t S30, S31, S32, S33, S34, S35; - - uint32_t B27, B28, B29, B30, B31, B32, B33, B34, B35; - //const uint64_t bc = (64ULL << 3); // 512 - //const uint32_t bclo = (uint32_t)(bc); - //const uint32_t bchi = (uint32_t)(bc >> 32); - - S00 = S01 = S02 = S03 = S04 = S05 = S06 = S07 = S08 = S09 = 0; - S10 = S11 = S12 = S13 = S14 = S15 = S16 = S17 = S18 = S19 = 0; - S20 = 0x8807a57e; S21 = 0xe616af75; S22 = 0xc5d3e4db; S23 = 0xac9ab027; - S24 = 0xd915f117; S25 = 0xb6eecc54; S26 = 0x06e8020b; S27 = 0x4a92efd1; - S28 = 0xaac6e2c9; S29 = 0xddb21398; S30 = 0xcae65838; S31 = 0x437f203f; - S32 = 0x25ea78e7; S33 = 0x951fddd6; S34 = 0xda6ed11d; S35 = 0xe13e3567; - - FUGUE512_3((Hash[0x0]), (Hash[0x1]), (Hash[0x2])); - FUGUE512_3((Hash[0x3]), (Hash[0x4]), (Hash[0x5])); - FUGUE512_3((Hash[0x6]), (Hash[0x7]), (Hash[0x8])); - FUGUE512_3((Hash[0x9]), (Hash[0xA]), (Hash[0xB])); - FUGUE512_3((Hash[0xC]), (Hash[0xD]), (Hash[0xE])); - FUGUE512_3((Hash[0xF]), 0u /*bchi*/, 512u /*bclo*/); - - #pragma unroll 32 - for (int i = 0; i < 32; i ++) { - SUB_ROR3; - CMIX36(S00, S01, S02, S04, S05, S06, S18, S19, S20); - SMIX(S00, S01, S02, S03); - } - #pragma unroll 13 - for (int i = 0; i < 13; i++) { - S04 ^= S00; - S09 ^= S00; - S18 ^= S00; - S27 ^= S00; - SUB_ROR9; - SMIX(S00, S01, S02, S03); - S04 ^= S00; - S10 ^= S00; - S18 ^= S00; - S27 ^= S00; - SUB_ROR9; - SMIX(S00, S01, S02, S03); - S04 ^= S00; - S10 ^= S00; - S19 ^= S00; - S27 ^= S00; - SUB_ROR9; - SMIX(S00, S01, S02, S03); - S04 ^= S00; - S10 ^= S00; - S19 ^= S00; - S28 ^= S00; - SUB_ROR8; - SMIX(S00, S01, S02, S03); - } - S04 ^= S00; - S09 ^= S00; - S18 ^= S00; - S27 ^= S00; - - Hash[0] = cuda_swab32(S01); - Hash[1] = cuda_swab32(S02); - Hash[2] = cuda_swab32(S03); - Hash[3] = cuda_swab32(S04); - Hash[4] = cuda_swab32(S09); - Hash[5] = cuda_swab32(S10); - Hash[6] = cuda_swab32(S11); - Hash[7] = cuda_swab32(S12); - Hash[8] = cuda_swab32(S18); - Hash[9] = cuda_swab32(S19); - Hash[10] = cuda_swab32(S20); - Hash[11] = cuda_swab32(S21); - Hash[12] = cuda_swab32(S27); - Hash[13] = cuda_swab32(S28); - Hash[14] = cuda_swab32(S29); - Hash[15] = cuda_swab32(S30); - - #pragma unroll 4 - for(int i = 0; i < 4; i++) - AS_UINT4(&pHash[i*2]) = AS_UINT4(&Hash[i*4]); - } -} - -#define texDef(id, texname, texmem, texsource, texsize) { \ - unsigned int *texmem; \ - cudaMalloc(&texmem, texsize); \ - d_textures[thr_id][id] = texmem; \ - cudaMemcpy(texmem, texsource, texsize, cudaMemcpyHostToDevice); \ - texname.normalized = 0; \ - texname.filterMode = cudaFilterModePoint; \ - texname.addressMode[0] = cudaAddressModeClamp; \ - { cudaChannelFormatDesc channelDesc = cudaCreateChannelDesc(); \ - cudaBindTexture(NULL, &texname, texmem, &channelDesc, texsize ); \ - } \ -} - -__host__ -void x13_fugue512_cpu_init(int thr_id, uint32_t threads) -{ - texDef(0, mixTab0Tex, mixTab0m, mixtab0, sizeof(uint32_t)*256); -} - -__host__ -void x13_fugue512_cpu_free(int thr_id) -{ - cudaFree(d_textures[thr_id][0]); -} - -__host__ -//void fugue512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t *d_hash) -void x13_fugue512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order) -{ - const uint32_t threadsperblock = TPB; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - x13_fugue512_gpu_hash_64 <<>> (threads, (uint64_t*)d_hash); -} diff --git a/x13/cuda_x13_fugue512_alexis.cu b/x13/cuda_x13_fugue512_alexis.cu deleted file mode 100644 index cccec877..00000000 --- a/x13/cuda_x13_fugue512_alexis.cu +++ /dev/null @@ -1,413 +0,0 @@ -/* - * Quick and dirty addition of Fugue-512 for X13 - * - * Built on cbuchner1's implementation, actual hashing code - * heavily based on phm's sgminer - * - * - */ -#include "cuda_helper_alexis.h" -#include "miner.h" -#include "cuda_vectors_alexis.h" -/* - * X13 kernel implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2014-2016 phm, Provos Alexis - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software", to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author phm - * @author Provos Alexis (Applied partial shared Mem utilization under CUDA 7.5 for compute5.0/5.2 / 2016) - */ - -static __constant__ const uint32_t c_S[16] = { - 0x8807a57e, 0xe616af75, 0xc5d3e4db, 0xac9ab027, - 0xd915f117, 0xb6eecc54, 0x06e8020b, 0x4a92efd1, - 0xaac6e2c9, 0xddb21398, 0xcae65838, 0x437f203f, - 0x25ea78e7, 0x951fddd6, 0xda6ed11d, 0xe13e3567 -}; - -static __device__ uint32_t mixtab0[256] = { - 0x63633297, 0x7c7c6feb, 0x77775ec7, 0x7b7b7af7, 0xf2f2e8e5, 0x6b6b0ab7, 0x6f6f16a7, 0xc5c56d39, 0x303090c0, 0x01010704, 0x67672e87, 0x2b2bd1ac, 0xfefeccd5, 0xd7d71371, 0xabab7c9a, - 0x767659c3, 0xcaca4005, 0x8282a33e, 0xc9c94909, 0x7d7d68ef, 0xfafad0c5, 0x5959947f, 0x4747ce07, 0xf0f0e6ed, 0xadad6e82, 0xd4d41a7d, 0xa2a243be, 0xafaf608a, 0x9c9cf946, 0xa4a451a6, - 0x727245d3, 0xc0c0762d, 0xb7b728ea, 0xfdfdc5d9, 0x9393d47a, 0x2626f298, 0x363682d8, 0x3f3fbdfc, 0xf7f7f3f1, 0xcccc521d, 0x34348cd0, 0xa5a556a2, 0xe5e58db9, 0xf1f1e1e9, 0x71714cdf, - 0xd8d83e4d, 0x313197c4, 0x15156b54, 0x04041c10, 0xc7c76331, 0x2323e98c, 0xc3c37f21, 0x18184860, 0x9696cf6e, 0x05051b14, 0x9a9aeb5e, 0x0707151c, 0x12127e48, 0x8080ad36, 0xe2e298a5, - 0xebeba781, 0x2727f59c, 0xb2b233fe, 0x757550cf, 0x09093f24, 0x8383a43a, 0x2c2cc4b0, 0x1a1a4668, 0x1b1b416c, 0x6e6e11a3, 0x5a5a9d73, 0xa0a04db6, 0x5252a553, 0x3b3ba1ec, 0xd6d61475, - 0xb3b334fa, 0x2929dfa4, 0xe3e39fa1, 0x2f2fcdbc, 0x8484b126, 0x5353a257, 0xd1d10169, 0x00000000, 0xededb599, 0x2020e080, 0xfcfcc2dd, 0xb1b13af2, 0x5b5b9a77, 0x6a6a0db3, 0xcbcb4701, - 0xbebe17ce, 0x3939afe4, 0x4a4aed33, 0x4c4cff2b, 0x5858937b, 0xcfcf5b11, 0xd0d0066d, 0xefefbb91, 0xaaaa7b9e, 0xfbfbd7c1, 0x4343d217, 0x4d4df82f, 0x333399cc, 0x8585b622, 0x4545c00f, - 0xf9f9d9c9, 0x02020e08, 0x7f7f66e7, 0x5050ab5b, 0x3c3cb4f0, 0x9f9ff04a, 0xa8a87596, 0x5151ac5f, 0xa3a344ba, 0x4040db1b, 0x8f8f800a, 0x9292d37e, 0x9d9dfe42, 0x3838a8e0, 0xf5f5fdf9, - 0xbcbc19c6, 0xb6b62fee, 0xdada3045, 0x2121e784, 0x10107040, 0xffffcbd1, 0xf3f3efe1, 0xd2d20865, 0xcdcd5519, 0x0c0c2430, 0x1313794c, 0xececb29d, 0x5f5f8667, 0x9797c86a, 0x4444c70b, - 0x1717655c, 0xc4c46a3d, 0xa7a758aa, 0x7e7e61e3, 0x3d3db3f4, 0x6464278b, 0x5d5d886f, 0x19194f64, 0x737342d7, 0x60603b9b, 0x8181aa32, 0x4f4ff627, 0xdcdc225d, 0x2222ee88, 0x2a2ad6a8, - 0x9090dd76, 0x88889516, 0x4646c903, 0xeeeebc95, 0xb8b805d6, 0x14146c50, 0xdede2c55, 0x5e5e8163, 0x0b0b312c, 0xdbdb3741, 0xe0e096ad, 0x32329ec8, 0x3a3aa6e8, 0x0a0a3628, 0x4949e43f, - 0x06061218, 0x2424fc90, 0x5c5c8f6b, 0xc2c27825, 0xd3d30f61, 0xacac6986, 0x62623593, 0x9191da72, 0x9595c662, 0xe4e48abd, 0x797974ff, 0xe7e783b1, 0xc8c84e0d, 0x373785dc, 0x6d6d18af, - 0x8d8d8e02, 0xd5d51d79, 0x4e4ef123, 0xa9a97292, 0x6c6c1fab, 0x5656b943, 0xf4f4fafd, 0xeaeaa085, 0x6565208f, 0x7a7a7df3, 0xaeae678e, 0x08083820, 0xbaba0bde, 0x787873fb, 0x2525fb94, - 0x2e2ecab8, 0x1c1c5470, 0xa6a65fae, 0xb4b421e6, 0xc6c66435, 0xe8e8ae8d, 0xdddd2559, 0x747457cb, 0x1f1f5d7c, 0x4b4bea37, 0xbdbd1ec2, 0x8b8b9c1a, 0x8a8a9b1e, 0x70704bdb, 0x3e3ebaf8, - 0xb5b526e2, 0x66662983, 0x4848e33b, 0x0303090c, 0xf6f6f4f5, 0x0e0e2a38, 0x61613c9f, 0x35358bd4, 0x5757be47, 0xb9b902d2, 0x8686bf2e, 0xc1c17129, 0x1d1d5374, 0x9e9ef74e, 0xe1e191a9, - 0xf8f8decd, 0x9898e556, 0x11117744, 0x696904bf, 0xd9d93949, 0x8e8e870e, 0x9494c166, 0x9b9bec5a, 0x1e1e5a78, 0x8787b82a, 0xe9e9a989, 0xcece5c15, 0x5555b04f, 0x2828d8a0, 0xdfdf2b51, - 0x8c8c8906, 0xa1a14ab2, 0x89899212, 0x0d0d2334, 0xbfbf10ca, 0xe6e684b5, 0x4242d513, 0x686803bb, 0x4141dc1f, 0x9999e252, 0x2d2dc3b4, 0x0f0f2d3c, 0xb0b03df6, 0x5454b74b, 0xbbbb0cda, - 0x16166258 -}; - -#define mixtab0(x) shared[0][x] -#define mixtab1(x) shared[1][x] -#define mixtab2(x) shared[2][x] -#define mixtab3(x) shared[3][x] - -#define TIX4(q, x00, x01, x04, x07, x08, x22, x24, x27, x30) { \ - x22 ^= x00; \ - x00 = (q); \ - x08 ^= (q); \ - x01 ^= x24; \ - x04 ^= x27; \ - x07 ^= x30; \ - } - -#define CMIX36(x00, x01, x02, x04, x05, x06, x18, x19, x20) { \ - x00 ^= x04; \ - x01 ^= x05; \ - x02 ^= x06; \ - x18 ^= x04; \ - x19 ^= x05; \ - x20 ^= x06; \ - } - -__device__ __forceinline__ -static void SMIX(const uint32_t shared[4][256], uint32_t &x0,uint32_t &x1,uint32_t &x2,uint32_t &x3){ - uint32_t c0 = mixtab0(__byte_perm(x0,0,0x4443)); - uint32_t r1 = mixtab1(__byte_perm(x0,0,0x4442)); - uint32_t r2 = mixtab2(__byte_perm(x0,0,0x4441)); - uint32_t r3 = mixtab3(__byte_perm(x0,0,0x4440)); - c0 = c0 ^ r1 ^ r2 ^ r3; - uint32_t r0 = mixtab0(__byte_perm(x1,0,0x4443)); - uint32_t c1 = r0 ^ mixtab1(__byte_perm(x1,0,0x4442)); - uint32_t tmp = mixtab2(__byte_perm(x1,0,0x4441)); - c1 ^= tmp; - r2 ^= tmp; - tmp = mixtab3(__byte_perm(x1,0,0x4440)); - c1 ^= tmp; - r3 ^= tmp; - uint32_t c2 = mixtab0(__byte_perm(x2,0,0x4443)); - r0 ^= c2; - tmp = mixtab1(__byte_perm(x2,0,0x4442)); - c2 ^= tmp; - r1 ^= tmp; - tmp = mixtab2(__byte_perm(x2,0,0x4441)); - c2 ^= tmp; - tmp = mixtab3(__byte_perm(x2,0,0x4440)); - c2 ^= tmp; - r3 ^= tmp; - uint32_t c3 = mixtab0(__byte_perm(x3,0,0x4443)); - r0 ^= c3; - tmp = mixtab1(__byte_perm(x3,0,0x4442)); - c3 ^= tmp; - r1 ^= tmp; - tmp = mixtab2(__byte_perm(x3,0,0x4441)); - c3 ^= tmp; - r2 ^= tmp; - tmp = mixtab3(__byte_perm(x3,0,0x4440)); - c3 ^= tmp; - x0 = ((c0 ^ (r0 << 0)) & 0xFF000000) | ((c1 ^ (r1 << 0)) & 0x00FF0000) | ((c2 ^ (r2 << 0)) & 0x0000FF00) | ((c3 ^ (r3 << 0)) & 0x000000FF); - x1 = ((c1 ^ (r0 << 8)) & 0xFF000000) | ((c2 ^ (r1 << 8)) & 0x00FF0000) | ((c3 ^ (r2 << 8)) & 0x0000FF00) | ((c0 ^ (r3 >>24)) & 0x000000FF); - x2 = ((c2 ^ (r0 <<16)) & 0xFF000000) | ((c3 ^ (r1 <<16)) & 0x00FF0000) | ((c0 ^ (r2 >>16)) & 0x0000FF00) | ((c1 ^ (r3 >>16)) & 0x000000FF); - x3 = ((c3 ^ (r0 <<24)) & 0xFF000000) | ((c0 ^ (r1 >> 8)) & 0x00FF0000) | ((c1 ^ (r2 >> 8)) & 0x0000FF00) | ((c2 ^ (r3 >> 8)) & 0x000000FF); -} - -__device__ -static void SMIX_LDG(const uint32_t shared[4][256], uint32_t &x0,uint32_t &x1,uint32_t &x2,uint32_t &x3){ - uint32_t c0 = __ldg(&mixtab0[__byte_perm(x0,0,0x4443)]); - uint32_t r1 = mixtab1(__byte_perm(x0,0,0x4442)); - uint32_t r2 = mixtab2(__byte_perm(x0,0,0x4441)); - uint32_t r3 = mixtab3(__byte_perm(x0,0,0x4440)); - c0 = c0 ^ r1 ^ r2 ^ r3; - uint32_t r0 = __ldg(&mixtab0[__byte_perm(x1,0,0x4443)]); - uint32_t c1 = r0 ^ mixtab1(__byte_perm(x1,0,0x4442)); - uint32_t tmp = mixtab2(__byte_perm(x1,0,0x4441)); - c1 ^= tmp; - r2 ^= tmp; - tmp = mixtab3(__byte_perm(x1,0,0x4440)); - c1 ^= tmp; - r3 ^= tmp; - uint32_t c2 = __ldg(&mixtab0[__byte_perm(x2,0,0x4443)]); - r0 ^= c2; - tmp = mixtab1(__byte_perm(x2,0,0x4442)); - c2 ^= tmp; - r1 ^= tmp; - tmp = mixtab2(__byte_perm(x2,0,0x4441)); - c2 ^= tmp; - tmp = mixtab3(__byte_perm(x2,0,0x4440)); - c2 ^= tmp; - r3 ^= tmp; - uint32_t c3 = __ldg(&mixtab0[__byte_perm(x3,0,0x4443)]); - r0 ^= c3; - tmp = mixtab1(__byte_perm(x3,0,0x4442)); - c3 ^= tmp; - r1 ^= tmp; - tmp = mixtab2(__byte_perm(x3,0,0x4441)); - c3 ^= tmp; - r2 ^= tmp; - tmp = ROL8(__ldg(&mixtab0[__byte_perm(x3,0,0x4440)])); - c3 ^= tmp; - x0 = ((c0 ^ (r0 << 0)) & 0xFF000000) | ((c1 ^ (r1 << 0)) & 0x00FF0000) | ((c2 ^ (r2 << 0)) & 0x0000FF00) | ((c3 ^ (r3 << 0)) & 0x000000FF); - x1 = ((c1 ^ (r0 << 8)) & 0xFF000000) | ((c2 ^ (r1 << 8)) & 0x00FF0000) | ((c3 ^ (r2 << 8)) & 0x0000FF00) | ((c0 ^ (r3 >>24)) & 0x000000FF); - x2 = ((c2 ^ (r0 <<16)) & 0xFF000000) | ((c3 ^ (r1 <<16)) & 0x00FF0000) | ((c0 ^ (r2 >>16)) & 0x0000FF00) | ((c1 ^ (r3 >>16)) & 0x000000FF); - x3 = ((c3 ^ (r0 <<24)) & 0xFF000000) | ((c0 ^ (r1 >> 8)) & 0x00FF0000) | ((c1 ^ (r2 >> 8)) & 0x0000FF00) | ((c2 ^ (r3 >> 8)) & 0x000000FF); -} -#define mROR3 { \ - B[ 6] = S[33], B[ 7] = S[34], B[ 8] = S[35]; \ - S[35] = S[32]; S[34] = S[31]; S[33] = S[30]; S[32] = S[29]; S[31] = S[28]; S[30] = S[27]; S[29] = S[26]; S[28] = S[25]; S[27] = S[24]; \ - S[26] = S[23]; S[25] = S[22]; S[24] = S[21]; S[23] = S[20]; S[22] = S[19]; S[21] = S[18]; S[20] = S[17]; S[19] = S[16]; S[18] = S[15]; \ - S[17] = S[14]; S[16] = S[13]; S[15] = S[12]; S[14] = S[11]; S[13] = S[10]; S[12] = S[ 9]; S[11] = S[ 8]; S[10] = S[ 7]; S[ 9] = S[ 6]; \ - S[ 8] = S[ 5]; S[ 7] = S[ 4]; S[ 6] = S[ 3]; S[ 5] = S[ 2]; S[ 4] = S[ 1]; S[ 3] = S[ 0]; S[ 2] = B[ 8]; S[ 1] = B[ 7]; S[ 0] = B[ 6]; \ - } - -#define mROR8 { \ - B[ 1] = S[28], B[ 2] = S[29], B[ 3] = S[30], B[ 4] = S[31], B[ 5] = S[32], B[ 6] = S[33], B[ 7] = S[34], B[ 8] = S[35]; \ - S[35] = S[27]; S[34] = S[26]; S[33] = S[25]; S[32] = S[24]; S[31] = S[23]; S[30] = S[22]; S[29] = S[21]; S[28] = S[20]; S[27] = S[19]; \ - S[26] = S[18]; S[25] = S[17]; S[24] = S[16]; S[23] = S[15]; S[22] = S[14]; S[21] = S[13]; S[20] = S[12]; S[19] = S[11]; S[18] = S[10]; \ - S[17] = S[ 9]; S[16] = S[ 8]; S[15] = S[ 7]; S[14] = S[ 6]; S[13] = S[ 5]; S[12] = S[ 4]; S[11] = S[ 3]; S[10] = S[ 2]; S[ 9] = S[ 1]; \ - S[ 8] = S[ 0]; S[ 7] = B[ 8]; S[ 6] = B[ 7]; S[ 5] = B[ 6]; S[ 4] = B[ 5]; S[ 3] = B[ 4]; S[ 2] = B[ 3]; S[ 1] = B[ 2]; S[ 0] = B[ 1]; \ - } - -#define mROR9 { \ - B[ 0] = S[27], B[ 1] = S[28], B[ 2] = S[29], B[ 3] = S[30], B[ 4] = S[31], B[ 5] = S[32], B[ 6] = S[33], B[ 7] = S[34], B[ 8] = S[35]; \ - S[35] = S[26]; S[34] = S[25]; S[33] = S[24]; S[32] = S[23]; S[31] = S[22]; S[30] = S[21]; S[29] = S[20]; S[28] = S[19]; S[27] = S[18]; \ - S[26] = S[17]; S[25] = S[16]; S[24] = S[15]; S[23] = S[14]; S[22] = S[13]; S[21] = S[12]; S[20] = S[11]; S[19] = S[10]; S[18] = S[ 9]; \ - S[17] = S[ 8]; S[16] = S[ 7]; S[15] = S[ 6]; S[14] = S[ 5]; S[13] = S[ 4]; S[12] = S[ 3]; S[11] = S[ 2]; S[10] = S[ 1]; S[ 9] = S[ 0]; \ - S[ 8] = B[ 8]; S[ 7] = B[ 7]; S[ 6] = B[ 6]; S[ 5] = B[ 5]; S[ 4] = B[ 4]; S[ 3] = B[ 3]; S[ 2] = B[ 2]; S[ 1] = B[ 1]; S[ 0] = B[ 0]; \ - } - -#define FUGUE512_3(x, y, z) { \ - TIX4(x, S[ 0], S[ 1], S[ 4], S[ 7], S[ 8], S[22], S[24], S[27], S[30]); \ - CMIX36(S[33], S[34], S[35], S[ 1], S[ 2], S[ 3], S[15], S[16], S[17]); \ - SMIX_LDG(shared, S[33], S[34], S[35], S[ 0]); \ - CMIX36(S[30], S[31], S[32], S[34], S[35], S[ 0], S[12], S[13], S[14]); \ - SMIX_LDG(shared, S[30], S[31], S[32], S[33]); \ - CMIX36(S[27], S[28], S[29], S[31], S[32], S[33], S[ 9], S[10], S[11]); \ - SMIX(shared, S[27], S[28], S[29], S[30]); \ - CMIX36(S[24], S[25], S[26], S[28], S[29], S[30], S[ 6], S[ 7], S[ 8]); \ - SMIX_LDG(shared, S[24], S[25], S[26], S[27]); \ - \ - TIX4(y, S[24], S[25], S[28], S[31], S[32], S[10], S[12], S[15], S[18]); \ - CMIX36(S[21], S[22], S[23], S[25], S[26], S[27], S[ 3], S[ 4], S[ 5]); \ - SMIX(shared, S[21], S[22], S[23], S[24]); \ - CMIX36(S[18], S[19], S[20], S[22], S[23], S[24], S[ 0], S[ 1], S[ 2]); \ - SMIX_LDG(shared, S[18], S[19], S[20], S[21]); \ - CMIX36(S[15], S[16], S[17], S[19], S[20], S[21], S[33], S[34], S[35]); \ - SMIX_LDG(shared, S[15], S[16], S[17], S[18]); \ - CMIX36(S[12], S[13], S[14], S[16], S[17], S[18], S[30], S[31], S[32]); \ - SMIX(shared, S[12], S[13], S[14], S[15]); \ - \ - TIX4(z, S[12], S[13], S[16], S[19], S[20], S[34], S[ 0], S[ 3], S[ 6]); \ - CMIX36(S[ 9], S[10], S[11], S[13], S[14], S[15], S[27], S[28], S[29]); \ - SMIX_LDG(shared, S[ 9], S[10], S[11], S[12]); \ - CMIX36(S[ 6], S[ 7], S[ 8], S[10], S[11], S[12], S[24], S[25], S[26]); \ - SMIX_LDG(shared, S[ 6], S[ 7], S[ 8], S[ 9]); \ - CMIX36(S[ 3], S[ 4], S[ 5], S[ 7], S[ 8], S[ 9], S[21], S[22], S[23]); \ - SMIX_LDG(shared, S[ 3], S[ 4], S[ 5], S[ 6]); \ - CMIX36(S[ 0], S[ 1], S[ 2], S[ 4], S[ 5], S[ 6], S[18], S[19], S[20]); \ - SMIX_LDG(shared, S[ 0], S[ 1], S[ 2], S[ 3]); \ - } - -/***************************************************/ -// Die Hash-Funktion -__global__ __launch_bounds__(256,3) -void x13_fugue512_gpu_hash_64_alexis(uint32_t threads, uint64_t *g_hash) -{ - __shared__ uint32_t shared[4][256]; - -// if(threadIdx.x<256){ - const uint32_t tmp = mixtab0[threadIdx.x]; - shared[0][threadIdx.x] = tmp; - shared[1][threadIdx.x] = ROR8(tmp); - shared[2][threadIdx.x] = ROL16(tmp); - shared[3][threadIdx.x] = ROL8(tmp); -// } - __syncthreads(); - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t *hash = (uint32_t*)&g_hash[thread<<3]; - - uint32_t S[36]; - uint32_t B[ 9]; - - uint32_t Hash[16]; - - *(uint2x4*)&Hash[0] = __ldg4((uint2x4*)&hash[0]); - *(uint2x4*)&Hash[8] = __ldg4((uint2x4*)&hash[8]); - - #pragma unroll 16 - for(int i = 0; i < 16; i++) - Hash[i] = cuda_swab32(Hash[i]); - - __syncthreads(); - - S[ 0] = S[ 1] = S[ 2] = S[ 3] = S[ 4] = S[ 5] = S[ 6] = S[ 7] = S[ 8] = S[ 9] = S[10] = S[11] = S[12] = S[13] = S[14] = S[15] = S[16] = S[17] = S[18] = S[19] = 0; - *(uint2x4*)&S[20] = *(uint2x4*)&c_S[ 0]; - *(uint2x4*)&S[28] = *(uint2x4*)&c_S[ 8]; - - FUGUE512_3(Hash[0x0], Hash[0x1], Hash[0x2]); - FUGUE512_3(Hash[0x3], Hash[0x4], Hash[0x5]); - FUGUE512_3(Hash[0x6], Hash[0x7], Hash[0x8]); - FUGUE512_3(Hash[0x9], Hash[0xA], Hash[0xB]); - FUGUE512_3(Hash[0xC], Hash[0xD], Hash[0xE]); - FUGUE512_3(Hash[0xF], 0U, 512U); - - for (uint32_t i = 0; i < 32; i+=2){ - mROR3; - CMIX36(S[ 0], S[ 1], S[ 2], S[ 4], S[ 5], S[ 6], S[18], S[19], S[20]); - SMIX_LDG(shared, S[ 0], S[ 1], S[ 2], S[ 3]); - mROR3; - CMIX36(S[ 0], S[ 1], S[ 2], S[ 4], S[ 5], S[ 6], S[18], S[19], S[20]); - SMIX_LDG(shared, S[ 0], S[ 1], S[ 2], S[ 3]); - } - #pragma unroll - for (uint32_t i = 0; i < 13; i ++) { - S[ 4] ^= S[ 0]; S[ 9] ^= S[ 0]; S[18] ^= S[ 0]; S[27] ^= S[ 0]; - mROR9; - SMIX_LDG(shared, S[ 0], S[ 1], S[ 2], S[ 3]); - S[ 4] ^= S[ 0]; S[10] ^= S[ 0]; S[18] ^= S[ 0]; S[27] ^= S[ 0]; - mROR9; - SMIX_LDG(shared, S[ 0], S[ 1], S[ 2], S[ 3]); - S[ 4] ^= S[ 0]; S[10] ^= S[ 0]; S[19] ^= S[ 0]; S[27] ^= S[ 0]; - mROR9; - SMIX_LDG(shared, S[ 0], S[ 1], S[ 2], S[ 3]); - S[ 4] ^= S[ 0]; S[10] ^= S[ 0]; S[19] ^= S[ 0]; S[28] ^= S[ 0]; - mROR8; - SMIX_LDG(shared, S[ 0], S[ 1], S[ 2], S[ 3]); - } - S[ 4] ^= S[ 0]; S[ 9] ^= S[ 0]; S[18] ^= S[ 0]; S[27] ^= S[ 0]; - - S[ 0] = cuda_swab32(S[ 1]); S[ 1] = cuda_swab32(S[ 2]); S[ 2] = cuda_swab32(S[ 3]); S[ 3] = cuda_swab32(S[ 4]); - S[ 4] = cuda_swab32(S[ 9]); S[ 5] = cuda_swab32(S[10]); S[ 6] = cuda_swab32(S[11]); S[ 7] = cuda_swab32(S[12]); - S[ 8] = cuda_swab32(S[18]); S[ 9] = cuda_swab32(S[19]); S[10] = cuda_swab32(S[20]); S[11] = cuda_swab32(S[21]); - S[12] = cuda_swab32(S[27]); S[13] = cuda_swab32(S[28]); S[14] = cuda_swab32(S[29]); S[15] = cuda_swab32(S[30]); - - *(uint2x4*)&hash[ 0] = *(uint2x4*)&S[ 0]; - *(uint2x4*)&hash[ 8] = *(uint2x4*)&S[ 8]; - } -} - -/***************************************************/ -// The final hash function -__global__ __launch_bounds__(512,2) /* force 56 registers */ -void x13_fugue512_gpu_hash_64_final_alexis(uint32_t threads,const uint32_t* __restrict__ g_hash,uint32_t* resNonce, const uint64_t target){ - - __shared__ uint32_t shared[4][256]; - - if(threadIdx.x<256){ - const uint32_t tmp = mixtab0[threadIdx.x]; - shared[0][threadIdx.x] = tmp; - shared[1][threadIdx.x] = ROR8(tmp); - shared[2][threadIdx.x] = ROL16(tmp); - shared[3][threadIdx.x] = ROL8(tmp); - } - - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const uint32_t* __restrict__ hash = &g_hash[thread<<4]; - - uint32_t S[36]; - uint32_t B[ 9]; - uint32_t Hash[16]; - - *(uint2x4*)&Hash[0] = __ldg4((uint2x4*)&hash[0]); - *(uint2x4*)&Hash[8] = __ldg4((uint2x4*)&hash[8]); - __syncthreads(); - S[ 0] = S[ 1] = S[ 2] = S[ 3] = S[ 4] = S[ 5] = S[ 6] = S[ 7] = S[ 8] = S[ 9] = S[10] = S[11] = S[12] = S[13] = S[14] = S[15] = S[16] = S[17] = S[18] = S[19] = 0; - *(uint2x4*)&S[20] = *(uint2x4*)&c_S[ 0]; - *(uint2x4*)&S[28] = *(uint2x4*)&c_S[ 8]; - - FUGUE512_3(Hash[0x0], Hash[0x1], Hash[0x2]); - FUGUE512_3(Hash[0x3], Hash[0x4], Hash[0x5]); - FUGUE512_3(Hash[0x6], Hash[0x7], Hash[0x8]); - FUGUE512_3(Hash[0x9], Hash[0xA], Hash[0xB]); - FUGUE512_3(Hash[0xC], Hash[0xD], Hash[0xE]); - FUGUE512_3(Hash[0xF], 0, 512); - - for (int i = 0; i < 32; i++){ - mROR3; - CMIX36(S[ 0], S[ 1], S[ 2], S[ 4], S[ 5], S[ 6], S[18], S[19], S[20]); - SMIX_LDG(shared, S[ 0], S[ 1], S[ 2], S[ 3]); - } - #pragma unroll - for (int i = 0; i < 12; i++) { - S[ 4] ^= S[ 0]; S[ 9] ^= S[ 0]; S[18] ^= S[ 0]; S[27] ^= S[ 0]; - mROR9; - SMIX_LDG(shared, S[ 0], S[ 1], S[ 2], S[ 3]); - S[ 4] ^= S[ 0]; S[10] ^= S[ 0]; S[18] ^= S[ 0]; S[27] ^= S[ 0]; - mROR9; - SMIX_LDG(shared, S[ 0], S[ 1], S[ 2], S[ 3]); - S[ 4] ^= S[ 0]; S[10] ^= S[ 0]; S[19] ^= S[ 0]; S[27] ^= S[ 0]; - mROR9; - SMIX_LDG(shared, S[ 0], S[ 1], S[ 2], S[ 3]); - S[ 4] ^= S[ 0]; S[10] ^= S[ 0]; S[19] ^= S[ 0]; S[28] ^= S[ 0]; - mROR8; - SMIX_LDG(shared, S[ 0], S[ 1], S[ 2], S[ 3]); - } - S[ 4] ^= S[ 0]; S[ 9] ^= S[ 0]; S[18] ^= S[ 0]; S[27] ^= S[ 0]; - mROR9; - SMIX_LDG(shared, S[ 0], S[ 1], S[ 2], S[ 3]); - S[ 4] ^= S[ 0]; S[10] ^= S[ 0]; S[18] ^= S[ 0]; S[27] ^= S[ 0]; - mROR9; - SMIX_LDG(shared, S[ 0], S[ 1], S[ 2], S[ 3]); - S[ 4] ^= S[ 0]; S[10] ^= S[ 0]; S[19] ^= S[ 0]; S[27] ^= S[ 0]; - mROR9; - SMIX_LDG(shared, S[ 0], S[ 1], S[ 2], S[ 3]); - - S[ 3] = cuda_swab32(S[3]); S[ 4] = cuda_swab32(S[4]^S[ 0]); - - const uint64_t check = *(uint64_t*)&S[ 3]; - if(check <= target){ - uint32_t tmp = atomicExch(&resNonce[0], thread); - if (tmp != UINT32_MAX) - resNonce[1] = tmp; - } - } -} - -__host__ -void x13_fugue512_cpu_hash_64_alexis(int thr_id, uint32_t threads, uint32_t *d_hash){ - - const uint32_t threadsperblock = 256; - - // berechne wie viele Thread Blocks wir brauchen - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - x13_fugue512_gpu_hash_64_alexis<<>>(threads, (uint64_t*)d_hash); -} - -__host__ -void x13_fugue512_cpu_hash_64_final_alexis(int thr_id, uint32_t threads, uint32_t *d_hash, uint32_t *d_resNonce, const uint64_t target){ - - const uint32_t threadsperblock = 512; - - // berechne wie viele Thread Blocks wir brauchen - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - x13_fugue512_gpu_hash_64_final_alexis<<>>(threads, d_hash,d_resNonce,target); -} diff --git a/x13/cuda_x13_hamsi512.cu b/x13/cuda_x13_hamsi512.cu deleted file mode 100644 index 3c21f7f1..00000000 --- a/x13/cuda_x13_hamsi512.cu +++ /dev/null @@ -1,551 +0,0 @@ -/* - * Quick Hamsi-512 for X13 by tsiv - 2014 - * + Hamsi-512 80 by tpruvot - 2018 - */ - -#include -#include -#include - -#include "cuda_helper.h" - -typedef unsigned char BitSequence; - -static __constant__ uint32_t d_alpha_n[32]; -static __constant__ uint32_t d_alpha_f[32]; -static __constant__ uint32_t d_T512[64][16]; - -static const uint32_t alpha_n[] = { - 0xff00f0f0, 0xccccaaaa, 0xf0f0cccc, 0xff00aaaa, 0xccccaaaa, 0xf0f0ff00, 0xaaaacccc, 0xf0f0ff00, - 0xf0f0cccc, 0xaaaaff00, 0xccccff00, 0xaaaaf0f0, 0xaaaaf0f0, 0xff00cccc, 0xccccf0f0, 0xff00aaaa, - 0xccccaaaa, 0xff00f0f0, 0xff00aaaa, 0xf0f0cccc, 0xf0f0ff00, 0xccccaaaa, 0xf0f0ff00, 0xaaaacccc, - 0xaaaaff00, 0xf0f0cccc, 0xaaaaf0f0, 0xccccff00, 0xff00cccc, 0xaaaaf0f0, 0xff00aaaa, 0xccccf0f0 -}; - -static const uint32_t alpha_f[] = { - 0xcaf9639c, 0x0ff0f9c0, 0x639c0ff0, 0xcaf9f9c0, 0x0ff0f9c0, 0x639ccaf9, 0xf9c00ff0, 0x639ccaf9, - 0x639c0ff0, 0xf9c0caf9, 0x0ff0caf9, 0xf9c0639c, 0xf9c0639c, 0xcaf90ff0, 0x0ff0639c, 0xcaf9f9c0, - 0x0ff0f9c0, 0xcaf9639c, 0xcaf9f9c0, 0x639c0ff0, 0x639ccaf9, 0x0ff0f9c0, 0x639ccaf9, 0xf9c00ff0, - 0xf9c0caf9, 0x639c0ff0, 0xf9c0639c, 0x0ff0caf9, 0xcaf90ff0, 0xf9c0639c, 0xcaf9f9c0, 0x0ff0639c -}; - -#define hamsi_s00 m0 -#define hamsi_s01 m1 -#define hamsi_s02 c0 -#define hamsi_s03 c1 -#define hamsi_s04 m2 -#define hamsi_s05 m3 -#define hamsi_s06 c2 -#define hamsi_s07 c3 -#define hamsi_s08 c4 -#define hamsi_s09 c5 -#define hamsi_s0A m4 -#define hamsi_s0B m5 -#define hamsi_s0C c6 -#define hamsi_s0D c7 -#define hamsi_s0E m6 -#define hamsi_s0F m7 -#define hamsi_s10 m8 -#define hamsi_s11 m9 -#define hamsi_s12 c8 -#define hamsi_s13 c9 -#define hamsi_s14 mA -#define hamsi_s15 mB -#define hamsi_s16 cA -#define hamsi_s17 cB -#define hamsi_s18 cC -#define hamsi_s19 cD -#define hamsi_s1A mC -#define hamsi_s1B mD -#define hamsi_s1C cE -#define hamsi_s1D cF -#define hamsi_s1E mE -#define hamsi_s1F mF - -#define SBOX(a, b, c, d) { \ - uint32_t t; \ - t = (a); \ - (a) &= (c); \ - (a) ^= (d); \ - (c) ^= (b); \ - (c) ^= (a); \ - (d) |= t; \ - (d) ^= (b); \ - t ^= (c); \ - (b) = (d); \ - (d) |= t; \ - (d) ^= (a); \ - (a) &= (b); \ - t ^= (a); \ - (b) ^= (d); \ - (b) ^= t; \ - (a) = (c); \ - (c) = (b); \ - (b) = (d); \ - (d) = SPH_T32(~t); \ - } - -#define HAMSI_L(a, b, c, d) { \ - (a) = ROTL32(a, 13); \ - (c) = ROTL32(c, 3); \ - (b) ^= (a) ^ (c); \ - (d) ^= (c) ^ ((a) << 3); \ - (b) = ROTL32(b, 1); \ - (d) = ROTL32(d, 7); \ - (a) ^= (b) ^ (d); \ - (c) ^= (d) ^ ((b) << 7); \ - (a) = ROTL32(a, 5); \ - (c) = ROTL32(c, 22); \ - } - -#define ROUND_BIG(rc, alpha) { \ - hamsi_s00 ^= alpha[0x00]; \ - hamsi_s08 ^= alpha[0x08]; \ - hamsi_s10 ^= alpha[0x10]; \ - hamsi_s18 ^= alpha[0x18]; \ - hamsi_s01 ^= alpha[0x01] ^ (uint32_t)(rc); \ - hamsi_s09 ^= alpha[0x09]; \ - hamsi_s11 ^= alpha[0x11]; \ - hamsi_s19 ^= alpha[0x19]; \ - hamsi_s02 ^= alpha[0x02]; \ - hamsi_s0A ^= alpha[0x0A]; \ - hamsi_s12 ^= alpha[0x12]; \ - hamsi_s1A ^= alpha[0x1A]; \ - hamsi_s03 ^= alpha[0x03]; \ - hamsi_s0B ^= alpha[0x0B]; \ - hamsi_s13 ^= alpha[0x13]; \ - hamsi_s1B ^= alpha[0x1B]; \ - hamsi_s04 ^= alpha[0x04]; \ - hamsi_s0C ^= alpha[0x0C]; \ - hamsi_s14 ^= alpha[0x14]; \ - hamsi_s1C ^= alpha[0x1C]; \ - hamsi_s05 ^= alpha[0x05]; \ - hamsi_s0D ^= alpha[0x0D]; \ - hamsi_s15 ^= alpha[0x15]; \ - hamsi_s1D ^= alpha[0x1D]; \ - hamsi_s06 ^= alpha[0x06]; \ - hamsi_s0E ^= alpha[0x0E]; \ - hamsi_s16 ^= alpha[0x16]; \ - hamsi_s1E ^= alpha[0x1E]; \ - hamsi_s07 ^= alpha[0x07]; \ - hamsi_s0F ^= alpha[0x0F]; \ - hamsi_s17 ^= alpha[0x17]; \ - hamsi_s1F ^= alpha[0x1F]; \ - SBOX(hamsi_s00, hamsi_s08, hamsi_s10, hamsi_s18); \ - SBOX(hamsi_s01, hamsi_s09, hamsi_s11, hamsi_s19); \ - SBOX(hamsi_s02, hamsi_s0A, hamsi_s12, hamsi_s1A); \ - SBOX(hamsi_s03, hamsi_s0B, hamsi_s13, hamsi_s1B); \ - SBOX(hamsi_s04, hamsi_s0C, hamsi_s14, hamsi_s1C); \ - SBOX(hamsi_s05, hamsi_s0D, hamsi_s15, hamsi_s1D); \ - SBOX(hamsi_s06, hamsi_s0E, hamsi_s16, hamsi_s1E); \ - SBOX(hamsi_s07, hamsi_s0F, hamsi_s17, hamsi_s1F); \ - HAMSI_L(hamsi_s00, hamsi_s09, hamsi_s12, hamsi_s1B); \ - HAMSI_L(hamsi_s01, hamsi_s0A, hamsi_s13, hamsi_s1C); \ - HAMSI_L(hamsi_s02, hamsi_s0B, hamsi_s14, hamsi_s1D); \ - HAMSI_L(hamsi_s03, hamsi_s0C, hamsi_s15, hamsi_s1E); \ - HAMSI_L(hamsi_s04, hamsi_s0D, hamsi_s16, hamsi_s1F); \ - HAMSI_L(hamsi_s05, hamsi_s0E, hamsi_s17, hamsi_s18); \ - HAMSI_L(hamsi_s06, hamsi_s0F, hamsi_s10, hamsi_s19); \ - HAMSI_L(hamsi_s07, hamsi_s08, hamsi_s11, hamsi_s1A); \ - HAMSI_L(hamsi_s00, hamsi_s02, hamsi_s05, hamsi_s07); \ - HAMSI_L(hamsi_s10, hamsi_s13, hamsi_s15, hamsi_s16); \ - HAMSI_L(hamsi_s09, hamsi_s0B, hamsi_s0C, hamsi_s0E); \ - HAMSI_L(hamsi_s19, hamsi_s1A, hamsi_s1C, hamsi_s1F); \ - } - - -#define P_BIG { \ - for( int r = 0; r < 6; r++ ) \ - ROUND_BIG(r, d_alpha_n); \ - } - -#define PF_BIG { \ - for( int r = 0; r < 12; r++ ) \ - ROUND_BIG(r, d_alpha_f); \ - } - -#define T_BIG { \ - /* order is important */ \ - cF = (h[0xF] ^= hamsi_s17); \ - cE = (h[0xE] ^= hamsi_s16); \ - cD = (h[0xD] ^= hamsi_s15); \ - cC = (h[0xC] ^= hamsi_s14); \ - cB = (h[0xB] ^= hamsi_s13); \ - cA = (h[0xA] ^= hamsi_s12); \ - c9 = (h[0x9] ^= hamsi_s11); \ - c8 = (h[0x8] ^= hamsi_s10); \ - c7 = (h[0x7] ^= hamsi_s07); \ - c6 = (h[0x6] ^= hamsi_s06); \ - c5 = (h[0x5] ^= hamsi_s05); \ - c4 = (h[0x4] ^= hamsi_s04); \ - c3 = (h[0x3] ^= hamsi_s03); \ - c2 = (h[0x2] ^= hamsi_s02); \ - c1 = (h[0x1] ^= hamsi_s01); \ - c0 = (h[0x0] ^= hamsi_s00); \ - } - - -static const uint32_t T512[64][16] = { -{ 0xef0b0270, 0x3afd0000, 0x5dae0000, 0x69490000, 0x9b0f3c06, 0x4405b5f9, 0x66140a51, 0x924f5d0a, // 0 - 0xc96b0030, 0xe7250000, 0x2f840000, 0x264f0000, 0x08695bf9, 0x6dfcf137, 0x509f6984, 0x9e69af68 }, -{ 0xc96b0030, 0xe7250000, 0x2f840000, 0x264f0000, 0x08695bf9, 0x6dfcf137, 0x509f6984, 0x9e69af68, - 0x26600240, 0xddd80000, 0x722a0000, 0x4f060000, 0x936667ff, 0x29f944ce, 0x368b63d5, 0x0c26f262 }, -{ 0x145a3c00, 0xb9e90000, 0x61270000, 0xf1610000, 0xce613d6c, 0xb0493d78, 0x47a96720, 0xe18e24c5, - 0x23671400, 0xc8b90000, 0xf4c70000, 0xfb750000, 0x73cd2465, 0xf8a6a549, 0x02c40a3f, 0xdc24e61f }, -{ 0x23671400, 0xc8b90000, 0xf4c70000, 0xfb750000, 0x73cd2465, 0xf8a6a549, 0x02c40a3f, 0xdc24e61f, - 0x373d2800, 0x71500000, 0x95e00000, 0x0a140000, 0xbdac1909, 0x48ef9831, 0x456d6d1f, 0x3daac2da }, -{ 0x54285c00, 0xeaed0000, 0xc5d60000, 0xa1c50000, 0xb3a26770, 0x94a5c4e1, 0x6bb0419d, 0x551b3782, - 0x9cbb1800, 0xb0d30000, 0x92510000, 0xed930000, 0x593a4345, 0xe114d5f4, 0x430633da, 0x78cace29 }, -{ 0x9cbb1800, 0xb0d30000, 0x92510000, 0xed930000, 0x593a4345, 0xe114d5f4, 0x430633da, 0x78cace29, - 0xc8934400, 0x5a3e0000, 0x57870000, 0x4c560000, 0xea982435, 0x75b11115, 0x28b67247, 0x2dd1f9ab }, -{ 0x29449c00, 0x64e70000, 0xf24b0000, 0xc2f30000, 0x0ede4e8f, 0x56c23745, 0xf3e04259, 0x8d0d9ec4, - 0x466d0c00, 0x08620000, 0xdd5d0000, 0xbadd0000, 0x6a927942, 0x441f2b93, 0x218ace6f, 0xbf2c0be2 }, -{ 0x466d0c00, 0x08620000, 0xdd5d0000, 0xbadd0000, 0x6a927942, 0x441f2b93, 0x218ace6f, 0xbf2c0be2, // 7 - 0x6f299000, 0x6c850000, 0x2f160000, 0x782e0000, 0x644c37cd, 0x12dd1cd6, 0xd26a8c36, 0x32219526 }, -{ 0xf6800005, 0x3443c000, 0x24070000, 0x8f3d0000, 0x21373bfb, 0x0ab8d5ae, 0xcdc58b19, 0xd795ba31, - 0xa67f0001, 0x71378000, 0x19fc0000, 0x96db0000, 0x3a8b6dfd, 0xebcaaef3, 0x2c6d478f, 0xac8e6c88 }, -{ 0xa67f0001, 0x71378000, 0x19fc0000, 0x96db0000, 0x3a8b6dfd, 0xebcaaef3, 0x2c6d478f, 0xac8e6c88, - 0x50ff0004, 0x45744000, 0x3dfb0000, 0x19e60000, 0x1bbc5606, 0xe1727b5d, 0xe1a8cc96, 0x7b1bd6b9 }, -{ 0xf7750009, 0xcf3cc000, 0xc3d60000, 0x04920000, 0x029519a9, 0xf8e836ba, 0x7a87f14e, 0x9e16981a, - 0xd46a0000, 0x8dc8c000, 0xa5af0000, 0x4a290000, 0xfc4e427a, 0xc9b4866c, 0x98369604, 0xf746c320 }, -{ 0xd46a0000, 0x8dc8c000, 0xa5af0000, 0x4a290000, 0xfc4e427a, 0xc9b4866c, 0x98369604, 0xf746c320, - 0x231f0009, 0x42f40000, 0x66790000, 0x4ebb0000, 0xfedb5bd3, 0x315cb0d6, 0xe2b1674a, 0x69505b3a }, -{ 0x774400f0, 0xf15a0000, 0xf5b20000, 0x34140000, 0x89377e8c, 0x5a8bec25, 0x0bc3cd1e, 0xcf3775cb, - 0xf46c0050, 0x96180000, 0x14a50000, 0x031f0000, 0x42947eb8, 0x66bf7e19, 0x9ca470d2, 0x8a341574 }, -{ 0xf46c0050, 0x96180000, 0x14a50000, 0x031f0000, 0x42947eb8, 0x66bf7e19, 0x9ca470d2, 0x8a341574, - 0x832800a0, 0x67420000, 0xe1170000, 0x370b0000, 0xcba30034, 0x3c34923c, 0x9767bdcc, 0x450360bf }, -{ 0xe8870170, 0x9d720000, 0x12db0000, 0xd4220000, 0xf2886b27, 0xa921e543, 0x4ef8b518, 0x618813b1, // 14 - 0xb4370060, 0x0c4c0000, 0x56c20000, 0x5cae0000, 0x94541f3f, 0x3b3ef825, 0x1b365f3d, 0xf3d45758 }, -{ 0xb4370060, 0x0c4c0000, 0x56c20000, 0x5cae0000, 0x94541f3f, 0x3b3ef825, 0x1b365f3d, 0xf3d45758, - 0x5cb00110, 0x913e0000, 0x44190000, 0x888c0000, 0x66dc7418, 0x921f1d66, 0x55ceea25, 0x925c44e9 }, -{ 0x0c720000, 0x49e50f00, 0x42790000, 0x5cea0000, 0x33aa301a, 0x15822514, 0x95a34b7b, 0xb44b0090, - 0xfe220000, 0xa7580500, 0x25d10000, 0xf7600000, 0x893178da, 0x1fd4f860, 0x4ed0a315, 0xa123ff9f }, -{ 0xfe220000, 0xa7580500, 0x25d10000, 0xf7600000, 0x893178da, 0x1fd4f860, 0x4ed0a315, 0xa123ff9f, - 0xf2500000, 0xeebd0a00, 0x67a80000, 0xab8a0000, 0xba9b48c0, 0x0a56dd74, 0xdb73e86e, 0x1568ff0f }, -{ 0x45180000, 0xa5b51700, 0xf96a0000, 0x3b480000, 0x1ecc142c, 0x231395d6, 0x16bca6b0, 0xdf33f4df, - 0xb83d0000, 0x16710600, 0x379a0000, 0xf5b10000, 0x228161ac, 0xae48f145, 0x66241616, 0xc5c1eb3e }, -{ 0xb83d0000, 0x16710600, 0x379a0000, 0xf5b10000, 0x228161ac, 0xae48f145, 0x66241616, 0xc5c1eb3e, - 0xfd250000, 0xb3c41100, 0xcef00000, 0xcef90000, 0x3c4d7580, 0x8d5b6493, 0x7098b0a6, 0x1af21fe1 }, -{ 0x75a40000, 0xc28b2700, 0x94a40000, 0x90f50000, 0xfb7857e0, 0x49ce0bae, 0x1767c483, 0xaedf667e, - 0xd1660000, 0x1bbc0300, 0x9eec0000, 0xf6940000, 0x03024527, 0xcf70fcf2, 0xb4431b17, 0x857f3c2b }, -{ 0xd1660000, 0x1bbc0300, 0x9eec0000, 0xf6940000, 0x03024527, 0xcf70fcf2, 0xb4431b17, 0x857f3c2b, // 21 - 0xa4c20000, 0xd9372400, 0x0a480000, 0x66610000, 0xf87a12c7, 0x86bef75c, 0xa324df94, 0x2ba05a55 }, -{ 0x75c90003, 0x0e10c000, 0xd1200000, 0xbaea0000, 0x8bc42f3e, 0x8758b757, 0xbb28761d, 0x00b72e2b, - 0xeecf0001, 0x6f564000, 0xf33e0000, 0xa79e0000, 0xbdb57219, 0xb711ebc5, 0x4a3b40ba, 0xfeabf254 }, -{ 0xeecf0001, 0x6f564000, 0xf33e0000, 0xa79e0000, 0xbdb57219, 0xb711ebc5, 0x4a3b40ba, 0xfeabf254, - 0x9b060002, 0x61468000, 0x221e0000, 0x1d740000, 0x36715d27, 0x30495c92, 0xf11336a7, 0xfe1cdc7f }, -{ 0x86790000, 0x3f390002, 0xe19ae000, 0x98560000, 0x9565670e, 0x4e88c8ea, 0xd3dd4944, 0x161ddab9, - 0x30b70000, 0xe5d00000, 0xf4f46000, 0x42c40000, 0x63b83d6a, 0x78ba9460, 0x21afa1ea, 0xb0a51834 }, -{ 0x30b70000, 0xe5d00000, 0xf4f46000, 0x42c40000, 0x63b83d6a, 0x78ba9460, 0x21afa1ea, 0xb0a51834, - 0xb6ce0000, 0xdae90002, 0x156e8000, 0xda920000, 0xf6dd5a64, 0x36325c8a, 0xf272e8ae, 0xa6b8c28d }, -{ 0x14190000, 0x23ca003c, 0x50df0000, 0x44b60000, 0x1b6c67b0, 0x3cf3ac75, 0x61e610b0, 0xdbcadb80, - 0xe3430000, 0x3a4e0014, 0xf2c60000, 0xaa4e0000, 0xdb1e42a6, 0x256bbe15, 0x123db156, 0x3a4e99d7 }, -{ 0xe3430000, 0x3a4e0014, 0xf2c60000, 0xaa4e0000, 0xdb1e42a6, 0x256bbe15, 0x123db156, 0x3a4e99d7, - 0xf75a0000, 0x19840028, 0xa2190000, 0xeef80000, 0xc0722516, 0x19981260, 0x73dba1e6, 0xe1844257 }, -{ 0x54500000, 0x0671005c, 0x25ae0000, 0x6a1e0000, 0x2ea54edf, 0x664e8512, 0xbfba18c3, 0x7e715d17, // 28 - 0xbc8d0000, 0xfc3b0018, 0x19830000, 0xd10b0000, 0xae1878c4, 0x42a69856, 0x0012da37, 0x2c3b504e }, -{ 0xbc8d0000, 0xfc3b0018, 0x19830000, 0xd10b0000, 0xae1878c4, 0x42a69856, 0x0012da37, 0x2c3b504e, - 0xe8dd0000, 0xfa4a0044, 0x3c2d0000, 0xbb150000, 0x80bd361b, 0x24e81d44, 0xbfa8c2f4, 0x524a0d59 }, -{ 0x69510000, 0xd4e1009c, 0xc3230000, 0xac2f0000, 0xe4950bae, 0xcea415dc, 0x87ec287c, 0xbce1a3ce, - 0xc6730000, 0xaf8d000c, 0xa4c10000, 0x218d0000, 0x23111587, 0x7913512f, 0x1d28ac88, 0x378dd173 }, -{ 0xc6730000, 0xaf8d000c, 0xa4c10000, 0x218d0000, 0x23111587, 0x7913512f, 0x1d28ac88, 0x378dd173, - 0xaf220000, 0x7b6c0090, 0x67e20000, 0x8da20000, 0xc7841e29, 0xb7b744f3, 0x9ac484f4, 0x8b6c72bd }, -{ 0xcc140000, 0xa5630000, 0x5ab90780, 0x3b500000, 0x4bd013ff, 0x879b3418, 0x694348c1, 0xca5a87fe, - 0x819e0000, 0xec570000, 0x66320280, 0x95f30000, 0x5da92802, 0x48f43cbc, 0xe65aa22d, 0x8e67b7fa }, -{ 0x819e0000, 0xec570000, 0x66320280, 0x95f30000, 0x5da92802, 0x48f43cbc, 0xe65aa22d, 0x8e67b7fa, - 0x4d8a0000, 0x49340000, 0x3c8b0500, 0xaea30000, 0x16793bfd, 0xcf6f08a4, 0x8f19eaec, 0x443d3004 }, -{ 0x78230000, 0x12fc0000, 0xa93a0b80, 0x90a50000, 0x713e2879, 0x7ee98924, 0xf08ca062, 0x636f8bab, - 0x02af0000, 0xb7280000, 0xba1c0300, 0x56980000, 0xba8d45d3, 0x8048c667, 0xa95c149a, 0xf4f6ea7b }, -{ 0x02af0000, 0xb7280000, 0xba1c0300, 0x56980000, 0xba8d45d3, 0x8048c667, 0xa95c149a, 0xf4f6ea7b, // 35 - 0x7a8c0000, 0xa5d40000, 0x13260880, 0xc63d0000, 0xcbb36daa, 0xfea14f43, 0x59d0b4f8, 0x979961d0 }, -{ 0xac480000, 0x1ba60000, 0x45fb1380, 0x03430000, 0x5a85316a, 0x1fb250b6, 0xfe72c7fe, 0x91e478f6, - 0x1e4e0000, 0xdecf0000, 0x6df80180, 0x77240000, 0xec47079e, 0xf4a0694e, 0xcda31812, 0x98aa496e }, -{ 0x1e4e0000, 0xdecf0000, 0x6df80180, 0x77240000, 0xec47079e, 0xf4a0694e, 0xcda31812, 0x98aa496e, - 0xb2060000, 0xc5690000, 0x28031200, 0x74670000, 0xb6c236f4, 0xeb1239f8, 0x33d1dfec, 0x094e3198 }, -{ 0xaec30000, 0x9c4f0001, 0x79d1e000, 0x2c150000, 0x45cc75b3, 0x6650b736, 0xab92f78f, 0xa312567b, - 0xdb250000, 0x09290000, 0x49aac000, 0x81e10000, 0xcafe6b59, 0x42793431, 0x43566b76, 0xe86cba2e }, -{ 0xdb250000, 0x09290000, 0x49aac000, 0x81e10000, 0xcafe6b59, 0x42793431, 0x43566b76, 0xe86cba2e, - 0x75e60000, 0x95660001, 0x307b2000, 0xadf40000, 0x8f321eea, 0x24298307, 0xe8c49cf9, 0x4b7eec55 }, -{ 0x58430000, 0x807e0000, 0x78330001, 0xc66b3800, 0xe7375cdc, 0x79ad3fdd, 0xac73fe6f, 0x3a4479b1, - 0x1d5a0000, 0x2b720000, 0x488d0000, 0xaf611800, 0x25cb2ec5, 0xc879bfd0, 0x81a20429, 0x1e7536a6 }, -{ 0x1d5a0000, 0x2b720000, 0x488d0000, 0xaf611800, 0x25cb2ec5, 0xc879bfd0, 0x81a20429, 0x1e7536a6, - 0x45190000, 0xab0c0000, 0x30be0001, 0x690a2000, 0xc2fc7219, 0xb1d4800d, 0x2dd1fa46, 0x24314f17 }, -{ 0xa53b0000, 0x14260000, 0x4e30001e, 0x7cae0000, 0x8f9e0dd5, 0x78dfaa3d, 0xf73168d8, 0x0b1b4946, // 42 - 0x07ed0000, 0xb2500000, 0x8774000a, 0x970d0000, 0x437223ae, 0x48c76ea4, 0xf4786222, 0x9075b1ce }, -{ 0x07ed0000, 0xb2500000, 0x8774000a, 0x970d0000, 0x437223ae, 0x48c76ea4, 0xf4786222, 0x9075b1ce, - 0xa2d60000, 0xa6760000, 0xc9440014, 0xeba30000, 0xccec2e7b, 0x3018c499, 0x03490afa, 0x9b6ef888 }, -{ 0x88980000, 0x1f940000, 0x7fcf002e, 0xfb4e0000, 0xf158079a, 0x61ae9167, 0xa895706c, 0xe6107494, - 0x0bc20000, 0xdb630000, 0x7e88000c, 0x15860000, 0x91fd48f3, 0x7581bb43, 0xf460449e, 0xd8b61463 }, -{ 0x0bc20000, 0xdb630000, 0x7e88000c, 0x15860000, 0x91fd48f3, 0x7581bb43, 0xf460449e, 0xd8b61463, - 0x835a0000, 0xc4f70000, 0x01470022, 0xeec80000, 0x60a54f69, 0x142f2a24, 0x5cf534f2, 0x3ea660f7 }, -{ 0x52500000, 0x29540000, 0x6a61004e, 0xf0ff0000, 0x9a317eec, 0x452341ce, 0xcf568fe5, 0x5303130f, - 0x538d0000, 0xa9fc0000, 0x9ef70006, 0x56ff0000, 0x0ae4004e, 0x92c5cdf9, 0xa9444018, 0x7f975691 }, -{ 0x538d0000, 0xa9fc0000, 0x9ef70006, 0x56ff0000, 0x0ae4004e, 0x92c5cdf9, 0xa9444018, 0x7f975691, - 0x01dd0000, 0x80a80000, 0xf4960048, 0xa6000000, 0x90d57ea2, 0xd7e68c37, 0x6612cffd, 0x2c94459e }, -{ 0xe6280000, 0x4c4b0000, 0xa8550000, 0xd3d002e0, 0xd86130b8, 0x98a7b0da, 0x289506b4, 0xd75a4897, - 0xf0c50000, 0x59230000, 0x45820000, 0xe18d00c0, 0x3b6d0631, 0xc2ed5699, 0xcbe0fe1c, 0x56a7b19f }, -{ 0xf0c50000, 0x59230000, 0x45820000, 0xe18d00c0, 0x3b6d0631, 0xc2ed5699, 0xcbe0fe1c, 0x56a7b19f, // 49 - 0x16ed0000, 0x15680000, 0xedd70000, 0x325d0220, 0xe30c3689, 0x5a4ae643, 0xe375f8a8, 0x81fdf908 }, -{ 0xb4310000, 0x77330000, 0xb15d0000, 0x7fd004e0, 0x78a26138, 0xd116c35d, 0xd256d489, 0x4e6f74de, - 0xe3060000, 0xbdc10000, 0x87130000, 0xbff20060, 0x2eba0a1a, 0x8db53751, 0x73c5ab06, 0x5bd61539 }, -{ 0xe3060000, 0xbdc10000, 0x87130000, 0xbff20060, 0x2eba0a1a, 0x8db53751, 0x73c5ab06, 0x5bd61539, - 0x57370000, 0xcaf20000, 0x364e0000, 0xc0220480, 0x56186b22, 0x5ca3f40c, 0xa1937f8f, 0x15b961e7 }, -{ 0x02f20000, 0xa2810000, 0x873f0000, 0xe36c7800, 0x1e1d74ef, 0x073d2bd6, 0xc4c23237, 0x7f32259e, - 0xbadd0000, 0x13ad0000, 0xb7e70000, 0xf7282800, 0xdf45144d, 0x361ac33a, 0xea5a8d14, 0x2a2c18f0 }, -{ 0xbadd0000, 0x13ad0000, 0xb7e70000, 0xf7282800, 0xdf45144d, 0x361ac33a, 0xea5a8d14, 0x2a2c18f0, - 0xb82f0000, 0xb12c0000, 0x30d80000, 0x14445000, 0xc15860a2, 0x3127e8ec, 0x2e98bf23, 0x551e3d6e }, -{ 0x1e6c0000, 0xc4420000, 0x8a2e0000, 0xbcb6b800, 0x2c4413b6, 0x8bfdd3da, 0x6a0c1bc8, 0xb99dc2eb, - 0x92560000, 0x1eda0000, 0xea510000, 0xe8b13000, 0xa93556a5, 0xebfb6199, 0xb15c2254, 0x33c5244f }, -{ 0x92560000, 0x1eda0000, 0xea510000, 0xe8b13000, 0xa93556a5, 0xebfb6199, 0xb15c2254, 0x33c5244f, - 0x8c3a0000, 0xda980000, 0x607f0000, 0x54078800, 0x85714513, 0x6006b243, 0xdb50399c, 0x8a58e6a4 }, -{ 0x033d0000, 0x08b30000, 0xf33a0000, 0x3ac20007, 0x51298a50, 0x6b6e661f, 0x0ea5cfe3, 0xe6da7ffe, // 56 - 0xa8da0000, 0x96be0000, 0x5c1d0000, 0x07da0002, 0x7d669583, 0x1f98708a, 0xbb668808, 0xda878000 }, -{ 0xa8da0000, 0x96be0000, 0x5c1d0000, 0x07da0002, 0x7d669583, 0x1f98708a, 0xbb668808, 0xda878000, - 0xabe70000, 0x9e0d0000, 0xaf270000, 0x3d180005, 0x2c4f1fd3, 0x74f61695, 0xb5c347eb, 0x3c5dfffe }, -{ 0x01930000, 0xe7820000, 0xedfb0000, 0xcf0c000b, 0x8dd08d58, 0xbca3b42e, 0x063661e1, 0x536f9e7b, - 0x92280000, 0xdc850000, 0x57fa0000, 0x56dc0003, 0xbae92316, 0x5aefa30c, 0x90cef752, 0x7b1675d7 }, -{ 0x92280000, 0xdc850000, 0x57fa0000, 0x56dc0003, 0xbae92316, 0x5aefa30c, 0x90cef752, 0x7b1675d7, - 0x93bb0000, 0x3b070000, 0xba010000, 0x99d00008, 0x3739ae4e, 0xe64c1722, 0x96f896b3, 0x2879ebac }, -{ 0x5fa80000, 0x56030000, 0x43ae0000, 0x64f30013, 0x257e86bf, 0x1311944e, 0x541e95bf, 0x8ea4db69, - 0x00440000, 0x7f480000, 0xda7c0000, 0x2a230001, 0x3badc9cc, 0xa9b69c87, 0x030a9e60, 0xbe0a679e }, -{ 0x00440000, 0x7f480000, 0xda7c0000, 0x2a230001, 0x3badc9cc, 0xa9b69c87, 0x030a9e60, 0xbe0a679e, - 0x5fec0000, 0x294b0000, 0x99d20000, 0x4ed00012, 0x1ed34f73, 0xbaa708c9, 0x57140bdf, 0x30aebcf7 }, -{ 0xee930000, 0xd6070000, 0x92c10000, 0x2b9801e0, 0x9451287c, 0x3b6cfb57, 0x45312374, 0x201f6a64, - 0x7b280000, 0x57420000, 0xa9e50000, 0x634300a0, 0x9edb442f, 0x6d9995bb, 0x27f83b03, 0xc7ff60f0 }, -{ 0x7b280000, 0x57420000, 0xa9e50000, 0x634300a0, 0x9edb442f, 0x6d9995bb, 0x27f83b03, 0xc7ff60f0, - 0x95bb0000, 0x81450000, 0x3b240000, 0x48db0140, 0x0a8a6c53, 0x56f56eec, 0x62c91877, 0xe7e00a94 } -}; - -__global__ -void x13_hamsi512_gpu_hash_64(uint32_t threads, uint32_t startNounce, uint64_t *g_hash, uint32_t *g_nonceVector) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t nounce = (g_nonceVector != NULL) ? g_nonceVector[thread] : (startNounce + thread); - - int hashPosition = nounce - startNounce; - uint32_t *Hash = (uint32_t*)&g_hash[hashPosition<<3]; - unsigned char *h1 = (unsigned char *)Hash; - - uint32_t c0 = 0x73746565, c1 = 0x6c706172, c2 = 0x6b204172, c3 = 0x656e6265; - uint32_t c4 = 0x72672031, c5 = 0x302c2062, c6 = 0x75732032, c7 = 0x3434362c; - uint32_t c8 = 0x20422d33, c9 = 0x30303120, cA = 0x4c657576, cB = 0x656e2d48; - uint32_t cC = 0x65766572, cD = 0x6c65652c, cE = 0x2042656c, cF = 0x6769756d; - uint32_t h[16] = { c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, cA, cB, cC, cD, cE, cF }; - uint32_t m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, mA, mB, mC, mD, mE, mF; - uint32_t *tp, db, dm; - - for(int i = 0; i < 64; i += 8) { - - m0 = 0; m1 = 0; m2 = 0; m3 = 0; m4 = 0; m5 = 0; m6 = 0; m7 = 0; - m8 = 0; m9 = 0; mA = 0; mB = 0; mC = 0; mD = 0; mE = 0; mF = 0; - tp = &d_T512[0][0]; - - #pragma unroll 2 - for (int u = 0; u < 8; u ++) { - db = h1[i+u]; - #pragma unroll 2 - for (int v = 0; v < 8; v ++, db >>= 1) { - dm = -(uint32_t)(db & 1); - m0 ^= dm & *(tp+ 0); m1 ^= dm & *(tp+ 1); - m2 ^= dm & *(tp+ 2); m3 ^= dm & *(tp+ 3); - m4 ^= dm & *(tp+ 4); m5 ^= dm & *(tp+ 5); - m6 ^= dm & *(tp+ 6); m7 ^= dm & *(tp+ 7); - m8 ^= dm & *(tp+ 8); m9 ^= dm & *(tp+ 9); - mA ^= dm & *(tp+10); mB ^= dm & *(tp+11); - mC ^= dm & *(tp+12); mD ^= dm & *(tp+13); - mE ^= dm & *(tp+14); mF ^= dm & *(tp+15); - tp += 16; - } - } - - for( int r = 0; r < 6; r += 2 ) { - ROUND_BIG(r, d_alpha_n); - ROUND_BIG(r+1, d_alpha_n); - } - T_BIG; - } - - // precomputed for 64 bytes blocks ? - tp = &d_T512[0][0] + 112; - m0 = tp[ 0]; m1 = tp[ 1]; - m2 = tp[ 2]; m3 = tp[ 3]; - m4 = tp[ 4]; m5 = tp[ 5]; - m6 = tp[ 6]; m7 = tp[ 7]; - m8 = tp[ 8]; m9 = tp[ 9]; - mA = tp[10]; mB = tp[11]; - mC = tp[12]; mD = tp[13]; - mE = tp[14]; mF = tp[15]; - - for( int r = 0; r < 6; r += 2 ) { - ROUND_BIG(r, d_alpha_n); - ROUND_BIG(r+1, d_alpha_n); - } - T_BIG; - - tp = &d_T512[0][0] + 784; - m0 = tp[ 0]; m1 = tp[ 1]; - m2 = tp[ 2]; m3 = tp[ 3]; - m4 = tp[ 4]; m5 = tp[ 5]; - m6 = tp[ 6]; m7 = tp[ 7]; - m8 = tp[ 8]; m9 = tp[ 9]; - mA = tp[10]; mB = tp[11]; - mC = tp[12]; mD = tp[13]; - mE = tp[14]; mF = tp[15]; - - for( int r = 0; r < 12; r += 2 ) { - ROUND_BIG(r, d_alpha_f); - ROUND_BIG(r+1, d_alpha_f); - } - T_BIG; - - #pragma unroll 16 - for (int i = 0; i < 16; i++) - Hash[i] = cuda_swab32(h[i]); - } -} - -__host__ -void x13_hamsi512_cpu_init(int thr_id, uint32_t threads) -{ - cudaMemcpyToSymbol(d_alpha_n, alpha_n, sizeof(uint32_t)*32, 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(d_alpha_f, alpha_f, sizeof(uint32_t)*32, 0, cudaMemcpyHostToDevice); - CUDA_SAFE_CALL(cudaMemcpyToSymbol(d_T512, T512, sizeof(uint32_t)*64*16, 0, cudaMemcpyHostToDevice)); -} - -__host__ -void x13_hamsi512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order) -{ - const uint32_t threadsperblock = 128; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - x13_hamsi512_gpu_hash_64<<>>(threads, startNounce, (uint64_t*)d_hash, d_nonceVector); - //MyStreamSynchronize(NULL, order, thr_id); -} - -__constant__ static uint64_t c_PaddedMessage80[10]; - -__host__ -void x16_hamsi512_setBlock_80(void *pdata) -{ - cudaMemcpyToSymbol(c_PaddedMessage80, pdata, sizeof(c_PaddedMessage80), 0, cudaMemcpyHostToDevice); -} - -__global__ -void x16_hamsi512_gpu_hash_80(const uint32_t threads, const uint32_t startNonce, uint64_t *g_hash) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - unsigned char h1[80]; - #pragma unroll - for (int i = 0; i < 10; i++) - ((uint2*)h1)[i] = ((uint2*)c_PaddedMessage80)[i]; - //((uint64_t*)h1)[9] = REPLACE_HIDWORD(c_PaddedMessage80[9], cuda_swab32(startNonce + thread)); - ((uint32_t*)h1)[19] = cuda_swab32(startNonce + thread); - - uint32_t c0 = 0x73746565, c1 = 0x6c706172, c2 = 0x6b204172, c3 = 0x656e6265; - uint32_t c4 = 0x72672031, c5 = 0x302c2062, c6 = 0x75732032, c7 = 0x3434362c; - uint32_t c8 = 0x20422d33, c9 = 0x30303120, cA = 0x4c657576, cB = 0x656e2d48; - uint32_t cC = 0x65766572, cD = 0x6c65652c, cE = 0x2042656c, cF = 0x6769756d; - uint32_t h[16] = { c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, cA, cB, cC, cD, cE, cF }; - uint32_t m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, mA, mB, mC, mD, mE, mF; - uint32_t *tp, db, dm; - - for(int i = 0; i < 80; i += 8) - { - m0 = 0; m1 = 0; m2 = 0; m3 = 0; m4 = 0; m5 = 0; m6 = 0; m7 = 0; - m8 = 0; m9 = 0; mA = 0; mB = 0; mC = 0; mD = 0; mE = 0; mF = 0; - tp = &d_T512[0][0]; - - #pragma unroll - for (int u = 0; u < 8; u++) { - db = h1[i + u]; - #pragma unroll 2 - for (int v = 0; v < 8; v++, db >>= 1) { - dm = -(uint32_t)(db & 1); - m0 ^= dm & tp[ 0]; m1 ^= dm & tp[ 1]; - m2 ^= dm & tp[ 2]; m3 ^= dm & tp[ 3]; - m4 ^= dm & tp[ 4]; m5 ^= dm & tp[ 5]; - m6 ^= dm & tp[ 6]; m7 ^= dm & tp[ 7]; - m8 ^= dm & tp[ 8]; m9 ^= dm & tp[ 9]; - mA ^= dm & tp[10]; mB ^= dm & tp[11]; - mC ^= dm & tp[12]; mD ^= dm & tp[13]; - mE ^= dm & tp[14]; mF ^= dm & tp[15]; - tp += 16; - } - } - - #pragma unroll - for (int r = 0; r < 6; r++) { - ROUND_BIG(r, d_alpha_n); - } - T_BIG; - } - - #define INPUT_BIG { \ - m0 = 0; m1 = 0; m2 = 0; m3 = 0; m4 = 0; m5 = 0; m6 = 0; m7 = 0; \ - m8 = 0; m9 = 0; mA = 0; mB = 0; mC = 0; mD = 0; mE = 0; mF = 0; \ - tp = &d_T512[0][0]; \ - for (int u = 0; u < 8; u++) { \ - db = endtag[u]; \ - for (int v = 0; v < 8; v++, db >>= 1) { \ - dm = -(uint32_t)(db & 1); \ - m0 ^= dm & tp[ 0]; m1 ^= dm & tp[ 1]; \ - m2 ^= dm & tp[ 2]; m3 ^= dm & tp[ 3]; \ - m4 ^= dm & tp[ 4]; m5 ^= dm & tp[ 5]; \ - m6 ^= dm & tp[ 6]; m7 ^= dm & tp[ 7]; \ - m8 ^= dm & tp[ 8]; m9 ^= dm & tp[ 9]; \ - mA ^= dm & tp[10]; mB ^= dm & tp[11]; \ - mC ^= dm & tp[12]; mD ^= dm & tp[13]; \ - mE ^= dm & tp[14]; mF ^= dm & tp[15]; \ - tp += 16; \ - } \ - } \ - } - - // close - uint8_t endtag[8] = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - INPUT_BIG; - - #pragma unroll - for (int r = 0; r < 6; r++) { - ROUND_BIG(r, d_alpha_n); - } - T_BIG; - - endtag[0] = endtag[1] = 0x00; - endtag[6] = 0x02; - endtag[7] = 0x80; - INPUT_BIG; - - // PF_BIG - #pragma unroll - for(int r = 0; r < 12; r++) { - ROUND_BIG(r, d_alpha_f); - } - T_BIG; - - uint64_t hashPosition = thread; - uint32_t *Hash = (uint32_t*)&g_hash[hashPosition << 3]; - #pragma unroll 16 - for(int i = 0; i < 16; i++) - Hash[i] = cuda_swab32(h[i]); - - #undef INPUT_BIG - } -} - -__host__ -void x16_hamsi512_cuda_hash_80(int thr_id, const uint32_t threads, const uint32_t startNounce, uint32_t *d_hash) -{ - const uint32_t threadsperblock = 128; - - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - - x16_hamsi512_gpu_hash_80 <<>> (threads, startNounce, (uint64_t*)d_hash); -} diff --git a/x13/cuda_x13_hamsi512_alexis.cu b/x13/cuda_x13_hamsi512_alexis.cu deleted file mode 100644 index dc3b32be..00000000 --- a/x13/cuda_x13_hamsi512_alexis.cu +++ /dev/null @@ -1,299 +0,0 @@ -/* - * Quick Hamsi-512 for X13 - * by tsiv - 2014 - * - * Provos Alexis - 2016 - */ - -#include "miner.h" -#include "cuda_helper_alexis.h" -#include "cuda_vectors_alexis.h" - -static __constant__ const uint32_t d_alpha_n[] = { - 0xff00f0f0, 0xccccaaaa, 0xf0f0cccc, 0xff00aaaa, 0xccccaaaa, 0xf0f0ff00, 0xaaaacccc, 0xf0f0ff00, 0xf0f0cccc, 0xaaaaff00, 0xccccff00, 0xaaaaf0f0, 0xaaaaf0f0, 0xff00cccc, 0xccccf0f0, 0xff00aaaa, - 0xccccaaaa, 0xff00f0f0, 0xff00aaaa, 0xf0f0cccc, 0xf0f0ff00, 0xccccaaaa, 0xf0f0ff00, 0xaaaacccc, 0xaaaaff00, 0xf0f0cccc, 0xaaaaf0f0, 0xccccff00, 0xff00cccc, 0xaaaaf0f0, 0xff00aaaa, 0xccccf0f0 -}; - -static __constant__ const uint32_t d_alpha_f[] = { - 0xcaf9639c, 0x0ff0f9c0, 0x639c0ff0, 0xcaf9f9c0, 0x0ff0f9c0, 0x639ccaf9, 0xf9c00ff0, 0x639ccaf9, 0x639c0ff0, 0xf9c0caf9, 0x0ff0caf9, 0xf9c0639c, 0xf9c0639c, 0xcaf90ff0, 0x0ff0639c, 0xcaf9f9c0, - 0x0ff0f9c0, 0xcaf9639c, 0xcaf9f9c0, 0x639c0ff0, 0x639ccaf9, 0x0ff0f9c0, 0x639ccaf9, 0xf9c00ff0, 0xf9c0caf9, 0x639c0ff0, 0xf9c0639c, 0x0ff0caf9, 0xcaf90ff0, 0xf9c0639c, 0xcaf9f9c0, 0x0ff0639c -}; - -static __constant__ const uint32_t c_c[] = { - 0x73746565, 0x6c706172, 0x6b204172, 0x656e6265, 0x72672031, 0x302c2062, 0x75732032, 0x3434362c, - 0x20422d33, 0x30303120, 0x4c657576, 0x656e2d48, 0x65766572, 0x6c65652c, 0x2042656c, 0x6769756d -}; - -static __constant__ const uint32_t d_T512[1024] = { - 0xef0b0270, 0x3afd0000, 0x5dae0000, 0x69490000, 0x9b0f3c06, 0x4405b5f9, 0x66140a51, 0x924f5d0a, 0xc96b0030, 0xe7250000, 0x2f840000, 0x264f0000, 0x08695bf9, 0x6dfcf137, 0x509f6984, 0x9e69af68, - 0xc96b0030, 0xe7250000, 0x2f840000, 0x264f0000, 0x08695bf9, 0x6dfcf137, 0x509f6984, 0x9e69af68, 0x26600240, 0xddd80000, 0x722a0000, 0x4f060000, 0x936667ff, 0x29f944ce, 0x368b63d5, 0x0c26f262, - 0x145a3c00, 0xb9e90000, 0x61270000, 0xf1610000, 0xce613d6c, 0xb0493d78, 0x47a96720, 0xe18e24c5, 0x23671400, 0xc8b90000, 0xf4c70000, 0xfb750000, 0x73cd2465, 0xf8a6a549, 0x02c40a3f, 0xdc24e61f, - 0x23671400, 0xc8b90000, 0xf4c70000, 0xfb750000, 0x73cd2465, 0xf8a6a549, 0x02c40a3f, 0xdc24e61f, 0x373d2800, 0x71500000, 0x95e00000, 0x0a140000, 0xbdac1909, 0x48ef9831, 0x456d6d1f, 0x3daac2da, - 0x54285c00, 0xeaed0000, 0xc5d60000, 0xa1c50000, 0xb3a26770, 0x94a5c4e1, 0x6bb0419d, 0x551b3782, 0x9cbb1800, 0xb0d30000, 0x92510000, 0xed930000, 0x593a4345, 0xe114d5f4, 0x430633da, 0x78cace29, - 0x9cbb1800, 0xb0d30000, 0x92510000, 0xed930000, 0x593a4345, 0xe114d5f4, 0x430633da, 0x78cace29, 0xc8934400, 0x5a3e0000, 0x57870000, 0x4c560000, 0xea982435, 0x75b11115, 0x28b67247, 0x2dd1f9ab, - 0x29449c00, 0x64e70000, 0xf24b0000, 0xc2f30000, 0x0ede4e8f, 0x56c23745, 0xf3e04259, 0x8d0d9ec4, 0x466d0c00, 0x08620000, 0xdd5d0000, 0xbadd0000, 0x6a927942, 0x441f2b93, 0x218ace6f, 0xbf2c0be2, - 0x466d0c00, 0x08620000, 0xdd5d0000, 0xbadd0000, 0x6a927942, 0x441f2b93, 0x218ace6f, 0xbf2c0be2, 0x6f299000, 0x6c850000, 0x2f160000, 0x782e0000, 0x644c37cd, 0x12dd1cd6, 0xd26a8c36, 0x32219526, - 0xf6800005, 0x3443c000, 0x24070000, 0x8f3d0000, 0x21373bfb, 0x0ab8d5ae, 0xcdc58b19, 0xd795ba31, 0xa67f0001, 0x71378000, 0x19fc0000, 0x96db0000, 0x3a8b6dfd, 0xebcaaef3, 0x2c6d478f, 0xac8e6c88, - 0xa67f0001, 0x71378000, 0x19fc0000, 0x96db0000, 0x3a8b6dfd, 0xebcaaef3, 0x2c6d478f, 0xac8e6c88, 0x50ff0004, 0x45744000, 0x3dfb0000, 0x19e60000, 0x1bbc5606, 0xe1727b5d, 0xe1a8cc96, 0x7b1bd6b9, - 0xf7750009, 0xcf3cc000, 0xc3d60000, 0x04920000, 0x029519a9, 0xf8e836ba, 0x7a87f14e, 0x9e16981a, 0xd46a0000, 0x8dc8c000, 0xa5af0000, 0x4a290000, 0xfc4e427a, 0xc9b4866c, 0x98369604, 0xf746c320, - 0xd46a0000, 0x8dc8c000, 0xa5af0000, 0x4a290000, 0xfc4e427a, 0xc9b4866c, 0x98369604, 0xf746c320, 0x231f0009, 0x42f40000, 0x66790000, 0x4ebb0000, 0xfedb5bd3, 0x315cb0d6, 0xe2b1674a, 0x69505b3a, - 0x774400f0, 0xf15a0000, 0xf5b20000, 0x34140000, 0x89377e8c, 0x5a8bec25, 0x0bc3cd1e, 0xcf3775cb, 0xf46c0050, 0x96180000, 0x14a50000, 0x031f0000, 0x42947eb8, 0x66bf7e19, 0x9ca470d2, 0x8a341574, - 0xf46c0050, 0x96180000, 0x14a50000, 0x031f0000, 0x42947eb8, 0x66bf7e19, 0x9ca470d2, 0x8a341574, 0x832800a0, 0x67420000, 0xe1170000, 0x370b0000, 0xcba30034, 0x3c34923c, 0x9767bdcc, 0x450360bf, - 0xe8870170, 0x9d720000, 0x12db0000, 0xd4220000, 0xf2886b27, 0xa921e543, 0x4ef8b518, 0x618813b1, 0xb4370060, 0x0c4c0000, 0x56c20000, 0x5cae0000, 0x94541f3f, 0x3b3ef825, 0x1b365f3d, 0xf3d45758, - 0xb4370060, 0x0c4c0000, 0x56c20000, 0x5cae0000, 0x94541f3f, 0x3b3ef825, 0x1b365f3d, 0xf3d45758, 0x5cb00110, 0x913e0000, 0x44190000, 0x888c0000, 0x66dc7418, 0x921f1d66, 0x55ceea25, 0x925c44e9, - 0x0c720000, 0x49e50f00, 0x42790000, 0x5cea0000, 0x33aa301a, 0x15822514, 0x95a34b7b, 0xb44b0090, 0xfe220000, 0xa7580500, 0x25d10000, 0xf7600000, 0x893178da, 0x1fd4f860, 0x4ed0a315, 0xa123ff9f, - 0xfe220000, 0xa7580500, 0x25d10000, 0xf7600000, 0x893178da, 0x1fd4f860, 0x4ed0a315, 0xa123ff9f, 0xf2500000, 0xeebd0a00, 0x67a80000, 0xab8a0000, 0xba9b48c0, 0x0a56dd74, 0xdb73e86e, 0x1568ff0f, - 0x45180000, 0xa5b51700, 0xf96a0000, 0x3b480000, 0x1ecc142c, 0x231395d6, 0x16bca6b0, 0xdf33f4df, 0xb83d0000, 0x16710600, 0x379a0000, 0xf5b10000, 0x228161ac, 0xae48f145, 0x66241616, 0xc5c1eb3e, - 0xb83d0000, 0x16710600, 0x379a0000, 0xf5b10000, 0x228161ac, 0xae48f145, 0x66241616, 0xc5c1eb3e, 0xfd250000, 0xb3c41100, 0xcef00000, 0xcef90000, 0x3c4d7580, 0x8d5b6493, 0x7098b0a6, 0x1af21fe1, - 0x75a40000, 0xc28b2700, 0x94a40000, 0x90f50000, 0xfb7857e0, 0x49ce0bae, 0x1767c483, 0xaedf667e, 0xd1660000, 0x1bbc0300, 0x9eec0000, 0xf6940000, 0x03024527, 0xcf70fcf2, 0xb4431b17, 0x857f3c2b, - 0xd1660000, 0x1bbc0300, 0x9eec0000, 0xf6940000, 0x03024527, 0xcf70fcf2, 0xb4431b17, 0x857f3c2b, 0xa4c20000, 0xd9372400, 0x0a480000, 0x66610000, 0xf87a12c7, 0x86bef75c, 0xa324df94, 0x2ba05a55, - 0x75c90003, 0x0e10c000, 0xd1200000, 0xbaea0000, 0x8bc42f3e, 0x8758b757, 0xbb28761d, 0x00b72e2b, 0xeecf0001, 0x6f564000, 0xf33e0000, 0xa79e0000, 0xbdb57219, 0xb711ebc5, 0x4a3b40ba, 0xfeabf254, - 0xeecf0001, 0x6f564000, 0xf33e0000, 0xa79e0000, 0xbdb57219, 0xb711ebc5, 0x4a3b40ba, 0xfeabf254, 0x9b060002, 0x61468000, 0x221e0000, 0x1d740000, 0x36715d27, 0x30495c92, 0xf11336a7, 0xfe1cdc7f, - 0x86790000, 0x3f390002, 0xe19ae000, 0x98560000, 0x9565670e, 0x4e88c8ea, 0xd3dd4944, 0x161ddab9, 0x30b70000, 0xe5d00000, 0xf4f46000, 0x42c40000, 0x63b83d6a, 0x78ba9460, 0x21afa1ea, 0xb0a51834, - 0x30b70000, 0xe5d00000, 0xf4f46000, 0x42c40000, 0x63b83d6a, 0x78ba9460, 0x21afa1ea, 0xb0a51834, 0xb6ce0000, 0xdae90002, 0x156e8000, 0xda920000, 0xf6dd5a64, 0x36325c8a, 0xf272e8ae, 0xa6b8c28d, - 0x14190000, 0x23ca003c, 0x50df0000, 0x44b60000, 0x1b6c67b0, 0x3cf3ac75, 0x61e610b0, 0xdbcadb80, 0xe3430000, 0x3a4e0014, 0xf2c60000, 0xaa4e0000, 0xdb1e42a6, 0x256bbe15, 0x123db156, 0x3a4e99d7, - 0xe3430000, 0x3a4e0014, 0xf2c60000, 0xaa4e0000, 0xdb1e42a6, 0x256bbe15, 0x123db156, 0x3a4e99d7, 0xf75a0000, 0x19840028, 0xa2190000, 0xeef80000, 0xc0722516, 0x19981260, 0x73dba1e6, 0xe1844257, - 0x54500000, 0x0671005c, 0x25ae0000, 0x6a1e0000, 0x2ea54edf, 0x664e8512, 0xbfba18c3, 0x7e715d17, 0xbc8d0000, 0xfc3b0018, 0x19830000, 0xd10b0000, 0xae1878c4, 0x42a69856, 0x0012da37, 0x2c3b504e, - 0xbc8d0000, 0xfc3b0018, 0x19830000, 0xd10b0000, 0xae1878c4, 0x42a69856, 0x0012da37, 0x2c3b504e, 0xe8dd0000, 0xfa4a0044, 0x3c2d0000, 0xbb150000, 0x80bd361b, 0x24e81d44, 0xbfa8c2f4, 0x524a0d59, - 0x69510000, 0xd4e1009c, 0xc3230000, 0xac2f0000, 0xe4950bae, 0xcea415dc, 0x87ec287c, 0xbce1a3ce, 0xc6730000, 0xaf8d000c, 0xa4c10000, 0x218d0000, 0x23111587, 0x7913512f, 0x1d28ac88, 0x378dd173, - 0xc6730000, 0xaf8d000c, 0xa4c10000, 0x218d0000, 0x23111587, 0x7913512f, 0x1d28ac88, 0x378dd173, 0xaf220000, 0x7b6c0090, 0x67e20000, 0x8da20000, 0xc7841e29, 0xb7b744f3, 0x9ac484f4, 0x8b6c72bd, - 0xcc140000, 0xa5630000, 0x5ab90780, 0x3b500000, 0x4bd013ff, 0x879b3418, 0x694348c1, 0xca5a87fe, 0x819e0000, 0xec570000, 0x66320280, 0x95f30000, 0x5da92802, 0x48f43cbc, 0xe65aa22d, 0x8e67b7fa, - 0x819e0000, 0xec570000, 0x66320280, 0x95f30000, 0x5da92802, 0x48f43cbc, 0xe65aa22d, 0x8e67b7fa, 0x4d8a0000, 0x49340000, 0x3c8b0500, 0xaea30000, 0x16793bfd, 0xcf6f08a4, 0x8f19eaec, 0x443d3004, - 0x78230000, 0x12fc0000, 0xa93a0b80, 0x90a50000, 0x713e2879, 0x7ee98924, 0xf08ca062, 0x636f8bab, 0x02af0000, 0xb7280000, 0xba1c0300, 0x56980000, 0xba8d45d3, 0x8048c667, 0xa95c149a, 0xf4f6ea7b, - 0x02af0000, 0xb7280000, 0xba1c0300, 0x56980000, 0xba8d45d3, 0x8048c667, 0xa95c149a, 0xf4f6ea7b, 0x7a8c0000, 0xa5d40000, 0x13260880, 0xc63d0000, 0xcbb36daa, 0xfea14f43, 0x59d0b4f8, 0x979961d0, - 0xac480000, 0x1ba60000, 0x45fb1380, 0x03430000, 0x5a85316a, 0x1fb250b6, 0xfe72c7fe, 0x91e478f6, 0x1e4e0000, 0xdecf0000, 0x6df80180, 0x77240000, 0xec47079e, 0xf4a0694e, 0xcda31812, 0x98aa496e, - 0x1e4e0000, 0xdecf0000, 0x6df80180, 0x77240000, 0xec47079e, 0xf4a0694e, 0xcda31812, 0x98aa496e, 0xb2060000, 0xc5690000, 0x28031200, 0x74670000, 0xb6c236f4, 0xeb1239f8, 0x33d1dfec, 0x094e3198, - 0xaec30000, 0x9c4f0001, 0x79d1e000, 0x2c150000, 0x45cc75b3, 0x6650b736, 0xab92f78f, 0xa312567b, 0xdb250000, 0x09290000, 0x49aac000, 0x81e10000, 0xcafe6b59, 0x42793431, 0x43566b76, 0xe86cba2e, - 0xdb250000, 0x09290000, 0x49aac000, 0x81e10000, 0xcafe6b59, 0x42793431, 0x43566b76, 0xe86cba2e, 0x75e60000, 0x95660001, 0x307b2000, 0xadf40000, 0x8f321eea, 0x24298307, 0xe8c49cf9, 0x4b7eec55, - 0x58430000, 0x807e0000, 0x78330001, 0xc66b3800, 0xe7375cdc, 0x79ad3fdd, 0xac73fe6f, 0x3a4479b1, 0x1d5a0000, 0x2b720000, 0x488d0000, 0xaf611800, 0x25cb2ec5, 0xc879bfd0, 0x81a20429, 0x1e7536a6, - 0x1d5a0000, 0x2b720000, 0x488d0000, 0xaf611800, 0x25cb2ec5, 0xc879bfd0, 0x81a20429, 0x1e7536a6, 0x45190000, 0xab0c0000, 0x30be0001, 0x690a2000, 0xc2fc7219, 0xb1d4800d, 0x2dd1fa46, 0x24314f17, - 0xa53b0000, 0x14260000, 0x4e30001e, 0x7cae0000, 0x8f9e0dd5, 0x78dfaa3d, 0xf73168d8, 0x0b1b4946, 0x07ed0000, 0xb2500000, 0x8774000a, 0x970d0000, 0x437223ae, 0x48c76ea4, 0xf4786222, 0x9075b1ce, - 0x07ed0000, 0xb2500000, 0x8774000a, 0x970d0000, 0x437223ae, 0x48c76ea4, 0xf4786222, 0x9075b1ce, 0xa2d60000, 0xa6760000, 0xc9440014, 0xeba30000, 0xccec2e7b, 0x3018c499, 0x03490afa, 0x9b6ef888, - 0x88980000, 0x1f940000, 0x7fcf002e, 0xfb4e0000, 0xf158079a, 0x61ae9167, 0xa895706c, 0xe6107494, 0x0bc20000, 0xdb630000, 0x7e88000c, 0x15860000, 0x91fd48f3, 0x7581bb43, 0xf460449e, 0xd8b61463, - 0x0bc20000, 0xdb630000, 0x7e88000c, 0x15860000, 0x91fd48f3, 0x7581bb43, 0xf460449e, 0xd8b61463, 0x835a0000, 0xc4f70000, 0x01470022, 0xeec80000, 0x60a54f69, 0x142f2a24, 0x5cf534f2, 0x3ea660f7, - 0x52500000, 0x29540000, 0x6a61004e, 0xf0ff0000, 0x9a317eec, 0x452341ce, 0xcf568fe5, 0x5303130f, 0x538d0000, 0xa9fc0000, 0x9ef70006, 0x56ff0000, 0x0ae4004e, 0x92c5cdf9, 0xa9444018, 0x7f975691, - 0x538d0000, 0xa9fc0000, 0x9ef70006, 0x56ff0000, 0x0ae4004e, 0x92c5cdf9, 0xa9444018, 0x7f975691, 0x01dd0000, 0x80a80000, 0xf4960048, 0xa6000000, 0x90d57ea2, 0xd7e68c37, 0x6612cffd, 0x2c94459e, - 0xe6280000, 0x4c4b0000, 0xa8550000, 0xd3d002e0, 0xd86130b8, 0x98a7b0da, 0x289506b4, 0xd75a4897, 0xf0c50000, 0x59230000, 0x45820000, 0xe18d00c0, 0x3b6d0631, 0xc2ed5699, 0xcbe0fe1c, 0x56a7b19f, - 0xf0c50000, 0x59230000, 0x45820000, 0xe18d00c0, 0x3b6d0631, 0xc2ed5699, 0xcbe0fe1c, 0x56a7b19f, 0x16ed0000, 0x15680000, 0xedd70000, 0x325d0220, 0xe30c3689, 0x5a4ae643, 0xe375f8a8, 0x81fdf908, - 0xb4310000, 0x77330000, 0xb15d0000, 0x7fd004e0, 0x78a26138, 0xd116c35d, 0xd256d489, 0x4e6f74de, 0xe3060000, 0xbdc10000, 0x87130000, 0xbff20060, 0x2eba0a1a, 0x8db53751, 0x73c5ab06, 0x5bd61539, - 0xe3060000, 0xbdc10000, 0x87130000, 0xbff20060, 0x2eba0a1a, 0x8db53751, 0x73c5ab06, 0x5bd61539, 0x57370000, 0xcaf20000, 0x364e0000, 0xc0220480, 0x56186b22, 0x5ca3f40c, 0xa1937f8f, 0x15b961e7, - 0x02f20000, 0xa2810000, 0x873f0000, 0xe36c7800, 0x1e1d74ef, 0x073d2bd6, 0xc4c23237, 0x7f32259e, 0xbadd0000, 0x13ad0000, 0xb7e70000, 0xf7282800, 0xdf45144d, 0x361ac33a, 0xea5a8d14, 0x2a2c18f0, - 0xbadd0000, 0x13ad0000, 0xb7e70000, 0xf7282800, 0xdf45144d, 0x361ac33a, 0xea5a8d14, 0x2a2c18f0, 0xb82f0000, 0xb12c0000, 0x30d80000, 0x14445000, 0xc15860a2, 0x3127e8ec, 0x2e98bf23, 0x551e3d6e, - 0x1e6c0000, 0xc4420000, 0x8a2e0000, 0xbcb6b800, 0x2c4413b6, 0x8bfdd3da, 0x6a0c1bc8, 0xb99dc2eb, 0x92560000, 0x1eda0000, 0xea510000, 0xe8b13000, 0xa93556a5, 0xebfb6199, 0xb15c2254, 0x33c5244f, - 0x92560000, 0x1eda0000, 0xea510000, 0xe8b13000, 0xa93556a5, 0xebfb6199, 0xb15c2254, 0x33c5244f, 0x8c3a0000, 0xda980000, 0x607f0000, 0x54078800, 0x85714513, 0x6006b243, 0xdb50399c, 0x8a58e6a4, - 0x033d0000, 0x08b30000, 0xf33a0000, 0x3ac20007, 0x51298a50, 0x6b6e661f, 0x0ea5cfe3, 0xe6da7ffe, 0xa8da0000, 0x96be0000, 0x5c1d0000, 0x07da0002, 0x7d669583, 0x1f98708a, 0xbb668808, 0xda878000, - 0xa8da0000, 0x96be0000, 0x5c1d0000, 0x07da0002, 0x7d669583, 0x1f98708a, 0xbb668808, 0xda878000, 0xabe70000, 0x9e0d0000, 0xaf270000, 0x3d180005, 0x2c4f1fd3, 0x74f61695, 0xb5c347eb, 0x3c5dfffe, - 0x01930000, 0xe7820000, 0xedfb0000, 0xcf0c000b, 0x8dd08d58, 0xbca3b42e, 0x063661e1, 0x536f9e7b, 0x92280000, 0xdc850000, 0x57fa0000, 0x56dc0003, 0xbae92316, 0x5aefa30c, 0x90cef752, 0x7b1675d7, - 0x92280000, 0xdc850000, 0x57fa0000, 0x56dc0003, 0xbae92316, 0x5aefa30c, 0x90cef752, 0x7b1675d7, 0x93bb0000, 0x3b070000, 0xba010000, 0x99d00008, 0x3739ae4e, 0xe64c1722, 0x96f896b3, 0x2879ebac, - 0x5fa80000, 0x56030000, 0x43ae0000, 0x64f30013, 0x257e86bf, 0x1311944e, 0x541e95bf, 0x8ea4db69, 0x00440000, 0x7f480000, 0xda7c0000, 0x2a230001, 0x3badc9cc, 0xa9b69c87, 0x030a9e60, 0xbe0a679e, - 0x00440000, 0x7f480000, 0xda7c0000, 0x2a230001, 0x3badc9cc, 0xa9b69c87, 0x030a9e60, 0xbe0a679e, 0x5fec0000, 0x294b0000, 0x99d20000, 0x4ed00012, 0x1ed34f73, 0xbaa708c9, 0x57140bdf, 0x30aebcf7, - 0xee930000, 0xd6070000, 0x92c10000, 0x2b9801e0, 0x9451287c, 0x3b6cfb57, 0x45312374, 0x201f6a64, 0x7b280000, 0x57420000, 0xa9e50000, 0x634300a0, 0x9edb442f, 0x6d9995bb, 0x27f83b03, 0xc7ff60f0, - 0x7b280000, 0x57420000, 0xa9e50000, 0x634300a0, 0x9edb442f, 0x6d9995bb, 0x27f83b03, 0xc7ff60f0, 0x95bb0000, 0x81450000, 0x3b240000, 0x48db0140, 0x0a8a6c53, 0x56f56eec, 0x62c91877, 0xe7e00a94 -}; - -#define SBOX(a, b, c, d) { \ - uint32_t t; \ - t =(a); \ - a =(a & c) ^ d; \ - c =(c ^ b) ^ a; \ - d =(d | t) ^ b; \ - b = d; \ - d =((d | (t ^ c)) ^ a); \ - a&= b; \ - t^=(c ^ a); \ - b = b ^ d ^ t; \ - (a) = (c); \ - (c) = (b); \ - (b) = (d); \ - (d) = (~t); \ - } - -#define HAMSI_L(a, b, c, d) { \ - (a) = ROTL32(a, 13); \ - (c) = ROTL32(c, 3); \ - (b) ^= (a) ^ (c); \ - (d) ^= (c) ^ ((a) << 3); \ - (b) = ROTL32(b, 1); \ - (d) = ROTL32(d, 7); \ - (a) = ROTL32(a ^ b ^ d, 5); \ - (c) = ROTL32(c ^ d ^ (b<<7), 22); \ - } - -#define ROUND_BIG(rc, alpha) { \ - m[ 0] ^= alpha[ 0]; \ - c[ 4] ^= alpha[ 8]; \ - m[ 8] ^= alpha[16]; \ - c[12] ^= alpha[24]; \ - m[ 1] ^= alpha[ 1] ^ (rc); \ - c[ 5] ^= alpha[ 9]; \ - m[ 9] ^= alpha[17]; \ - c[13] ^= alpha[25]; \ - c[ 0] ^= alpha[ 2]; \ - m[ 4] ^= alpha[10]; \ - c[ 8] ^= alpha[18]; \ - m[12] ^= alpha[26]; \ - c[ 1] ^= alpha[ 3]; \ - m[ 5] ^= alpha[11]; \ - c[ 9] ^= alpha[19]; \ - m[13] ^= alpha[27]; \ - m[ 2] ^= alpha[ 4]; \ - c[ 6] ^= alpha[12]; \ - m[10] ^= alpha[20]; \ - c[14] ^= alpha[28]; \ - m[ 3] ^= alpha[ 5]; \ - c[ 7] ^= alpha[13]; \ - m[11] ^= alpha[21]; \ - c[15] ^= alpha[29]; \ - c[ 2] ^= alpha[ 6]; \ - m[ 6] ^= alpha[14]; \ - c[10] ^= alpha[22]; \ - m[14] ^= alpha[30]; \ - c[ 3] ^= alpha[ 7]; \ - m[ 7] ^= alpha[15]; \ - c[11] ^= alpha[23]; \ - m[15] ^= alpha[31]; \ - SBOX(m[ 0], c[ 4], m[ 8], c[12]); \ - SBOX(m[ 1], c[ 5], m[ 9], c[13]); \ - SBOX(c[ 0], m[ 4], c[ 8], m[12]); \ - SBOX(c[ 1], m[ 5], c[ 9], m[13]); \ - HAMSI_L(m[ 0], c[ 5], c[ 8], m[13]); \ - SBOX(m[ 2], c[ 6], m[10], c[14]); \ - HAMSI_L(m[ 1], m[ 4], c[ 9], c[14]); \ - SBOX(m[ 3], c[ 7], m[11], c[15]); \ - HAMSI_L(c[ 0], m[ 5], m[10], c[15]); \ - SBOX(c[ 2], m[ 6], c[10], m[14]); \ - HAMSI_L(c[ 1], c[ 6], m[11], m[14]); \ - SBOX(c[ 3], m[ 7], c[11], m[15]); \ - HAMSI_L(m[ 2], c[ 7], c[10], m[15]); \ - HAMSI_L(m[ 3], m[ 6], c[11], c[12]); \ - HAMSI_L(c[ 2], m[ 7], m[ 8], c[13]); \ - HAMSI_L(c[ 3], c[ 4], m[ 9], m[12]); \ - HAMSI_L(m[ 0], c[ 0], m[ 3], c[ 3]); \ - HAMSI_L(m[ 8], c[ 9], m[11], c[10]); \ - HAMSI_L(c[ 5], m[ 5], c[ 6], m[ 6]); \ - HAMSI_L(c[13], m[12], c[14], m[15]); \ - } - -__global__ __launch_bounds__(384,2) -void x13_hamsi512_gpu_hash_64_alexis(uint32_t threads, uint32_t *g_hash){ - - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t *Hash = &g_hash[thread<<4]; - uint8_t h1[64]; - *(uint2x4*)&h1[ 0] = *(uint2x4*)&Hash[0]; - *(uint2x4*)&h1[32] = *(uint2x4*)&Hash[8]; - - uint32_t c[16], h[16], m[16]; - *(uint16*)&c[ 0] = *(uint16*)&c_c[ 0]; - *(uint16*)&h[ 0] = *(uint16*)&c_c[ 0]; - - const uint32_t *tp; - uint32_t dm; - - for(int i = 0; i < 64; i += 8) { - tp = &d_T512[0]; - - dm = -(h1[i] & 1); - m[ 0] = dm & tp[ 0]; m[ 1] = dm & tp[ 1]; - m[ 2] = dm & tp[ 2]; m[ 3] = dm & tp[ 3]; - m[ 4] = dm & tp[ 4]; m[ 5] = dm & tp[ 5]; - m[ 6] = dm & tp[ 6]; m[ 7] = dm & tp[ 7]; - m[ 8] = dm & tp[ 8]; m[ 9] = dm & tp[ 9]; - m[10] = dm & tp[10]; m[11] = dm & tp[11]; - m[12] = dm & tp[12]; m[13] = dm & tp[13]; - m[14] = dm & tp[14]; m[15] = dm & tp[15]; - tp += 16; - #pragma unroll 7 - for (int v = 1; v < 8; v ++) { - dm = -((h1[i]>>v) & 1); - m[ 0] ^= dm & tp[ 0]; m[ 1] ^= dm & tp[ 1]; - m[ 2] ^= dm & tp[ 2]; m[ 3] ^= dm & tp[ 3]; - m[ 4] ^= dm & tp[ 4]; m[ 5] ^= dm & tp[ 5]; - m[ 6] ^= dm & tp[ 6]; m[ 7] ^= dm & tp[ 7]; - m[ 8] ^= dm & tp[ 8]; m[ 9] ^= dm & tp[ 9]; - m[10] ^= dm & tp[10]; m[11] ^= dm & tp[11]; - m[12] ^= dm & tp[12]; m[13] ^= dm & tp[13]; - m[14] ^= dm & tp[14]; m[15] ^= dm & tp[15]; - tp += 16; - } - #pragma unroll - for (int u = 1; u < 8; u ++) { - #pragma unroll 8 - for (int v = 0; v < 8; v ++) { - dm = -((h1[i+u]>>v) & 1); - m[ 0] ^= dm & tp[ 0]; m[ 1] ^= dm & tp[ 1]; - m[ 2] ^= dm & tp[ 2]; m[ 3] ^= dm & tp[ 3]; - m[ 4] ^= dm & tp[ 4]; m[ 5] ^= dm & tp[ 5]; - m[ 6] ^= dm & tp[ 6]; m[ 7] ^= dm & tp[ 7]; - m[ 8] ^= dm & tp[ 8]; m[ 9] ^= dm & tp[ 9]; - m[10] ^= dm & tp[10]; m[11] ^= dm & tp[11]; - m[12] ^= dm & tp[12]; m[13] ^= dm & tp[13]; - m[14] ^= dm & tp[14]; m[15] ^= dm & tp[15]; - tp += 16; - } - } - - #pragma unroll 6 - for( int r = 0; r < 6; r++ ) { - ROUND_BIG(r, d_alpha_n); - } - /* order is (no more) important */ - h[ 0] ^= m[ 0]; h[ 1] ^= m[ 1]; h[ 2] ^= c[ 0]; h[ 3] ^= c[ 1]; - h[ 4] ^= m[ 2]; h[ 5] ^= m[ 3]; h[ 6] ^= c[ 2]; h[ 7] ^= c[ 3]; - h[ 8] ^= m[ 8]; h[ 9] ^= m[ 9]; h[10] ^= c[ 8]; h[11] ^= c[ 9]; - h[12] ^= m[10]; h[13] ^= m[11]; h[14] ^= c[10]; h[15] ^= c[11]; - - *(uint16*)&c[ 0] = *(uint16*)&h[ 0]; - } - - *(uint2x4*)&m[ 0] = *(uint2x4*)&d_T512[112]; - *(uint2x4*)&m[ 8] = *(uint2x4*)&d_T512[120]; - - #pragma unroll 6 - for( int r = 0; r < 6; r++ ) { - ROUND_BIG(r, d_alpha_n); - } - - /* order is (no more) important */ - h[ 0] ^= m[ 0]; h[ 1] ^= m[ 1]; h[ 2] ^= c[ 0]; h[ 3] ^= c[ 1]; - h[ 4] ^= m[ 2]; h[ 5] ^= m[ 3]; h[ 6] ^= c[ 2]; h[ 7] ^= c[ 3]; - h[ 8] ^= m[ 8]; h[ 9] ^= m[ 9]; h[10] ^= c[ 8]; h[11] ^= c[ 9]; - h[12] ^= m[10]; h[13] ^= m[11]; h[14] ^= c[10]; h[15] ^= c[11]; - - *(uint16*)&c[ 0] = *(uint16*)&h[ 0]; - - *(uint2x4*)&m[ 0] = *(uint2x4*)&d_T512[784]; - *(uint2x4*)&m[ 8] = *(uint2x4*)&d_T512[792]; - - #pragma unroll 12 - for( int r = 0; r < 12; r++ ) - ROUND_BIG(r, d_alpha_f); - - /* order is (no more) important */ - h[ 0] ^= m[ 0]; h[ 1] ^= m[ 1]; h[ 2] ^= c[ 0]; h[ 3] ^= c[ 1]; - h[ 4] ^= m[ 2]; h[ 5] ^= m[ 3]; h[ 6] ^= c[ 2]; h[ 7] ^= c[ 3]; - h[ 8] ^= m[ 8]; h[ 9] ^= m[ 9]; h[10] ^= c[ 8]; h[11] ^= c[ 9]; - h[12] ^= m[10]; h[13] ^= m[11]; h[14] ^= c[10]; h[15] ^= c[11]; - - *(uint2x4*)&Hash[ 0] = *(uint2x4*)&h[ 0]; - *(uint2x4*)&Hash[ 8] = *(uint2x4*)&h[ 8]; - - #pragma unroll 16 - for(int i = 0; i < 16; i++) - Hash[i] = cuda_swab32(Hash[i]); - } -} - -__host__ -void x13_hamsi512_cpu_hash_64_alexis(int thr_id, uint32_t threads, uint32_t *d_hash) -{ - const uint32_t threadsperblock = 384; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - x13_hamsi512_gpu_hash_64_alexis<<>>(threads, d_hash); - -} diff --git a/x13/hsr.cu b/x13/hsr.cu deleted file mode 100644 index e8644462..00000000 --- a/x13/hsr.cu +++ /dev/null @@ -1,265 +0,0 @@ -/* - * X13 algorithm - */ -extern "C" -{ -#include "sph/sph_blake.h" -#include "sph/sph_bmw.h" -#include "sph/sph_groestl.h" -#include "sph/sph_skein.h" -#include "sph/sph_jh.h" -#include "sph/sph_keccak.h" - -#include "sph/sph_luffa.h" -#include "sph/sph_cubehash.h" -#include "sph/sph_shavite.h" -#include "sph/sph_simd.h" -#include "sph/sph_echo.h" - -#include "sph/sph_hamsi.h" -#include "sph/sph_fugue.h" -} -#include "sm3.h" - -#include "miner.h" - -#include "cuda_helper.h" -#include "x11/cuda_x11.h" - -static uint32_t *d_hash[MAX_GPUS]; - -extern void sm3_cuda_hash_64(int thr_id, uint32_t threads, uint32_t *d_hash, int order); - -extern void x13_hamsi512_cpu_init(int thr_id, uint32_t threads); -extern void x13_hamsi512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void x13_fugue512_cpu_init(int thr_id, uint32_t threads); -extern void x13_fugue512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -extern void x13_fugue512_cpu_free(int thr_id); - -// HSR CPU Hash -extern "C" void hsr_hash(void *output, const void *input) -{ - // blake1-bmw2-grs3-skein4-jh5-keccak6-luffa7-cubehash8-shavite9-simd10-echo11-hamsi12-fugue13 - - sph_blake512_context ctx_blake; - sph_bmw512_context ctx_bmw; - sph_groestl512_context ctx_groestl; - sph_jh512_context ctx_jh; - sph_keccak512_context ctx_keccak; - sph_skein512_context ctx_skein; - sph_luffa512_context ctx_luffa; - sph_cubehash512_context ctx_cubehash; - sph_shavite512_context ctx_shavite; - sph_simd512_context ctx_simd; - sph_echo512_context ctx_echo; - sm3_ctx_t ctx_sm3; - sph_hamsi512_context ctx_hamsi; - sph_fugue512_context ctx_fugue; - - uint32_t hash[32]; - memset(hash, 0, sizeof hash); - - sph_blake512_init(&ctx_blake); - sph_blake512(&ctx_blake, input, 80); - sph_blake512_close(&ctx_blake, (void*) hash); - - sph_bmw512_init(&ctx_bmw); - sph_bmw512(&ctx_bmw, (const void*) hash, 64); - sph_bmw512_close(&ctx_bmw, (void*) hash); - - sph_groestl512_init(&ctx_groestl); - sph_groestl512(&ctx_groestl, (const void*) hash, 64); - sph_groestl512_close(&ctx_groestl, (void*) hash); - - sph_skein512_init(&ctx_skein); - sph_skein512(&ctx_skein, (const void*) hash, 64); - sph_skein512_close(&ctx_skein, (void*) hash); - - sph_jh512_init(&ctx_jh); - sph_jh512(&ctx_jh, (const void*) hash, 64); - sph_jh512_close(&ctx_jh, (void*) hash); - - sph_keccak512_init(&ctx_keccak); - sph_keccak512(&ctx_keccak, (const void*) hash, 64); - sph_keccak512_close(&ctx_keccak, (void*) hash); - - sph_luffa512_init(&ctx_luffa); - sph_luffa512(&ctx_luffa, (const void*) hash, 64); - sph_luffa512_close (&ctx_luffa, (void*) hash); - - sph_cubehash512_init(&ctx_cubehash); - sph_cubehash512(&ctx_cubehash, (const void*) hash, 64); - sph_cubehash512_close(&ctx_cubehash, (void*) hash); - - sph_shavite512_init(&ctx_shavite); - sph_shavite512(&ctx_shavite, (const void*) hash, 64); - sph_shavite512_close(&ctx_shavite, (void*) hash); - - sph_simd512_init(&ctx_simd); - sph_simd512(&ctx_simd, (const void*) hash, 64); - sph_simd512_close(&ctx_simd, (void*) hash); - - sph_echo512_init(&ctx_echo); - sph_echo512(&ctx_echo, (const void*) hash, 64); - sph_echo512_close(&ctx_echo, (void*) hash); - - sm3_init(&ctx_sm3); - sm3_update(&ctx_sm3, (const unsigned char*) hash, 64); - memset(hash, 0, sizeof hash); - sm3_close(&ctx_sm3, (void*) hash); - - sph_hamsi512_init(&ctx_hamsi); - sph_hamsi512(&ctx_hamsi, (const void*) hash, 64); - sph_hamsi512_close(&ctx_hamsi, (void*) hash); - - sph_fugue512_init(&ctx_fugue); - sph_fugue512(&ctx_fugue, (const void*) hash, 64); - sph_fugue512_close(&ctx_fugue, (void*) hash); - - memcpy(output, hash, 32); -} - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_hsr(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - int intensity = 19; // (device_sm[device_map[thr_id]] > 500 && !is_windows()) ? 20 : 19; - uint32_t throughput = cuda_default_throughput(thr_id, 1 << intensity); // 19=256*256*8; - //if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ((uint32_t*)ptarget)[7] = 0x000f; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - quark_blake512_cpu_init(thr_id, throughput); - quark_groestl512_cpu_init(thr_id, throughput); - quark_skein512_cpu_init(thr_id, throughput); - quark_bmw512_cpu_init(thr_id, throughput); - quark_keccak512_cpu_init(thr_id, throughput); - quark_jh512_cpu_init(thr_id, throughput); - x11_luffaCubehash512_cpu_init(thr_id, throughput); - x11_shavite512_cpu_init(thr_id, throughput); - if (x11_simd512_cpu_init(thr_id, throughput) != 0) { - return 0; - } - x11_echo512_cpu_init(thr_id, throughput); - x13_hamsi512_cpu_init(thr_id, throughput); - x13_fugue512_cpu_init(thr_id, throughput); - - CUDA_CALL_OR_RET_X(cudaMalloc(&d_hash[thr_id], 16 * sizeof(uint32_t) * throughput), 0); - - cuda_check_cpu_init(thr_id, throughput); - - init[thr_id] = true; - } - - uint32_t endiandata[20]; - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - quark_blake512_cpu_setBlock_80(thr_id, endiandata); - cuda_check_cpu_setTarget(ptarget); - - do { - int order = 0; - - quark_blake512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - quark_bmw512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_groestl512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_jh512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_keccak512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_luffaCubehash512_cpu_hash_64(thr_id, throughput, d_hash[thr_id], order++); - x11_shavite512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_simd512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - sm3_cuda_hash_64(thr_id, throughput, d_hash[thr_id], order++); - x13_hamsi512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x13_fugue512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - - *hashes_done = pdata[19] - first_nonce + throughput; - - CUDA_LOG_ERROR(); - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - be32enc(&endiandata[19], work->nonces[0]); - hsr_hash(vhash, endiandata); - - if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - work_set_target_ratio(work, vhash); - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - hsr_hash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t)throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - - CUDA_LOG_ERROR(); - - return 0; -} - -// cleanup -extern "C" void free_hsr(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - - quark_blake512_cpu_free(thr_id); - quark_groestl512_cpu_free(thr_id); - x11_simd512_cpu_free(thr_id); - x13_fugue512_cpu_free(thr_id); - - cuda_check_cpu_free(thr_id); - CUDA_LOG_ERROR(); - - cudaDeviceSynchronize(); - init[thr_id] = false; -} diff --git a/x13/sm3.c b/x13/sm3.c deleted file mode 100644 index 295ba150..00000000 --- a/x13/sm3.c +++ /dev/null @@ -1,220 +0,0 @@ -/* ==================================================================== - * Copyright (c) 2014 - 2017 The GmSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the GmSSL Project. - * (http://gmssl.org/)" - * - * 4. The name "GmSSL Project" must not be used to endorse or promote - * products derived from this software without prior written - * permission. For written permission, please contact - * guanzhi1980@gmail.com. - * - * 5. Products derived from this software may not be called "GmSSL" - * nor may "GmSSL" appear in their names without prior written - * permission of the GmSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the GmSSL Project - * (http://gmssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE GmSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE GmSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - */ - -#include - -#include "sm3.h" - -void sm3_init(sm3_ctx_t *ctx) -{ - ctx->digest[0] = 0x7380166F; - ctx->digest[1] = 0x4914B2B9; - ctx->digest[2] = 0x172442D7; - ctx->digest[3] = 0xDA8A0600; - ctx->digest[4] = 0xA96F30BC; - ctx->digest[5] = 0x163138AA; - ctx->digest[6] = 0xE38DEE4D; - ctx->digest[7] = 0xB0FB0E4E; - - ctx->nblocks = 0; - ctx->num = 0; -} - -void sm3_update(sm3_ctx_t *ctx, const unsigned char* data, size_t data_len) -{ - if (ctx->num) { - unsigned int left = SM3_BLOCK_SIZE - ctx->num; - if (data_len < left) { - memcpy(ctx->block + ctx->num, data, data_len); - ctx->num += data_len; - return; - } else { - memcpy(ctx->block + ctx->num, data, left); - sm3_compress(ctx->digest, ctx->block); - ctx->nblocks++; - data += left; - data_len -= left; - } - } - while (data_len >= SM3_BLOCK_SIZE) { - sm3_compress(ctx->digest, data); - ctx->nblocks++; - data += SM3_BLOCK_SIZE; - data_len -= SM3_BLOCK_SIZE; - } - ctx->num = data_len; - if (data_len) { - memcpy(ctx->block, data, data_len); - } -} - -void sm3_close(void *cc, void *dst) -{ - sm3_final(cc, dst); - memset(cc, 0, sizeof(sm3_ctx_t)); -} - -void sm3_final(sm3_ctx_t *ctx, unsigned char *digest) -{ - int i; - uint32_t *pdigest = (uint32_t *)digest; - uint32_t *count = (uint32_t *)(ctx->block + SM3_BLOCK_SIZE - 8); - - ctx->block[ctx->num] = 0x80; - - if (ctx->num + 9 <= SM3_BLOCK_SIZE) { - memset(ctx->block + ctx->num + 1, 0, SM3_BLOCK_SIZE - ctx->num - 9); - } else { - memset(ctx->block + ctx->num + 1, 0, SM3_BLOCK_SIZE - ctx->num - 1); - sm3_compress(ctx->digest, ctx->block); - memset(ctx->block, 0, SM3_BLOCK_SIZE - 8); - } - - count[0] = cpu_to_be32((ctx->nblocks) >> 23); - count[1] = cpu_to_be32((ctx->nblocks << 9) + (ctx->num << 3)); - - sm3_compress(ctx->digest, ctx->block); - for (i = 0; i < sizeof(ctx->digest)/sizeof(ctx->digest[0]); i++) { - pdigest[i] = cpu_to_be32(ctx->digest[i]); - } -} - -#define ROTATELEFT(X,n) (((X)<<(n)) | ((X)>>(32-(n)))) - -#define P0(x) ((x) ^ ROTATELEFT((x),9) ^ ROTATELEFT((x),17)) -#define P1(x) ((x) ^ ROTATELEFT((x),15) ^ ROTATELEFT((x),23)) - -#define FF0(x,y,z) ( (x) ^ (y) ^ (z)) -#define FF1(x,y,z) (((x) & (y)) | ( (x) & (z)) | ( (y) & (z))) - -#define GG0(x,y,z) ( (x) ^ (y) ^ (z)) -#define GG1(x,y,z) (((x) & (y)) | ( (~(x)) & (z)) ) - - -void sm3_compress(uint32_t digest[8], const unsigned char block[64]) -{ - int j; - uint32_t W[68], W1[64]; - const uint32_t *pblock = (const uint32_t *)block; - - uint32_t A = digest[0]; - uint32_t B = digest[1]; - uint32_t C = digest[2]; - uint32_t D = digest[3]; - uint32_t E = digest[4]; - uint32_t F = digest[5]; - uint32_t G = digest[6]; - uint32_t H = digest[7]; - uint32_t SS1,SS2,TT1,TT2,T[64]; - - for (j = 0; j < 16; j++) { - W[j] = cpu_to_be32(pblock[j]); - } - for (j = 16; j < 68; j++) { - W[j] = P1( W[j-16] ^ W[j-9] ^ ROTATELEFT(W[j-3],15)) ^ ROTATELEFT(W[j - 13],7 ) ^ W[j-6];; - } - for( j = 0; j < 64; j++) { - W1[j] = W[j] ^ W[j+4]; - } - - for(j =0; j < 16; j++) { - - T[j] = 0x79CC4519; - SS1 = ROTATELEFT((ROTATELEFT(A,12) + E + ROTATELEFT(T[j],j)), 7); - SS2 = SS1 ^ ROTATELEFT(A,12); - TT1 = FF0(A,B,C) + D + SS2 + W1[j]; - TT2 = GG0(E,F,G) + H + SS1 + W[j]; - D = C; - C = ROTATELEFT(B,9); - B = A; - A = TT1; - H = G; - G = ROTATELEFT(F,19); - F = E; - E = P0(TT2); - } - - for(j =16; j < 64; j++) { - - T[j] = 0x7A879D8A; - SS1 = ROTATELEFT((ROTATELEFT(A,12) + E + ROTATELEFT(T[j],j)), 7); - SS2 = SS1 ^ ROTATELEFT(A,12); - TT1 = FF1(A,B,C) + D + SS2 + W1[j]; - TT2 = GG1(E,F,G) + H + SS1 + W[j]; - D = C; - C = ROTATELEFT(B,9); - B = A; - A = TT1; - H = G; - G = ROTATELEFT(F,19); - F = E; - E = P0(TT2); - } - - digest[0] ^= A; - digest[1] ^= B; - digest[2] ^= C; - digest[3] ^= D; - digest[4] ^= E; - digest[5] ^= F; - digest[6] ^= G; - digest[7] ^= H; -} - -void sm3(const unsigned char *msg, size_t msglen, - unsigned char dgst[SM3_DIGEST_LENGTH]) -{ - sm3_ctx_t ctx; - - sm3_init(&ctx); - sm3_update(&ctx, msg, msglen); - sm3_final(&ctx, dgst); - - memset(&ctx, 0, sizeof(sm3_ctx_t)); -} diff --git a/x13/sm3.h b/x13/sm3.h deleted file mode 100644 index 05c6595d..00000000 --- a/x13/sm3.h +++ /dev/null @@ -1,109 +0,0 @@ -/* ==================================================================== - * Copyright (c) 2014 - 2016 The GmSSL Project. All rights reserved. - * Copyright (c) 2017 - YiiMP (cleaned hmac dead stuff) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the GmSSL Project. - * (http://gmssl.org/)" - * - * 4. The name "GmSSL Project" must not be used to endorse or promote - * products derived from this software without prior written - * permission. For written permission, please contact - * guanzhi1980@gmail.com. - * - * 5. Products derived from this software may not be called "GmSSL" - * nor may "GmSSL" appear in their names without prior written - * permission of the GmSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the GmSSL Project - * (http://gmssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE GmSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE GmSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - */ - -#ifndef _SM3_H -#define _SM3_H - -#define SM3_DIGEST_LENGTH 32 -#define SM3_BLOCK_SIZE 64 -#define SM3_CBLOCK (SM3_BLOCK_SIZE) -#define SM3_HMAC_SIZE (SM3_DIGEST_LENGTH) - - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef struct { - uint32_t digest[8]; - int nblocks; - unsigned char block[64]; - int num; -} sm3_ctx_t; - -void sm3_init(sm3_ctx_t *ctx); -void sm3_update(sm3_ctx_t *ctx, const unsigned char* data, size_t data_len); -void sm3_close(void *cc, void *dst); - -void sm3_final(sm3_ctx_t *ctx, unsigned char digest[SM3_DIGEST_LENGTH]); -void sm3_compress(uint32_t digest[8], const unsigned char block[SM3_BLOCK_SIZE]); -void sm3(const unsigned char *data, size_t datalen, - unsigned char digest[SM3_DIGEST_LENGTH]); - -#ifdef CPU_BIGENDIAN - -#define cpu_to_be16(v) (v) -#define cpu_to_be32(v) (v) -#define be16_to_cpu(v) (v) -#define be32_to_cpu(v) (v) - -#else - -#define cpu_to_le16(v) (v) -#define cpu_to_le32(v) (v) -#define le16_to_cpu(v) (v) -#define le32_to_cpu(v) (v) - -#define cpu_to_be16(v) (((v)<< 8) | ((v)>>8)) -#define cpu_to_be32(v) (((v)>>24) | (((v)>>8)&0xff00) | (((v)<<8)&0xff0000) | ((v)<<24)) -#define be16_to_cpu(v) cpu_to_be16(v) -#define be32_to_cpu(v) cpu_to_be32(v) - -#endif - -#ifdef __cplusplus -} -#endif -#endif diff --git a/x13/x13.cu b/x13/x13.cu deleted file mode 100644 index 0f5d88c3..00000000 --- a/x13/x13.cu +++ /dev/null @@ -1,254 +0,0 @@ -/* - * X13 algorithm - */ -extern "C" -{ -#include "sph/sph_blake.h" -#include "sph/sph_bmw.h" -#include "sph/sph_groestl.h" -#include "sph/sph_skein.h" -#include "sph/sph_jh.h" -#include "sph/sph_keccak.h" - -#include "sph/sph_luffa.h" -#include "sph/sph_cubehash.h" -#include "sph/sph_shavite.h" -#include "sph/sph_simd.h" -#include "sph/sph_echo.h" - -#include "sph/sph_hamsi.h" -#include "sph/sph_fugue.h" -} -#include "miner.h" - -#include "cuda_helper.h" -#include "x11/cuda_x11.h" - -static uint32_t *d_hash[MAX_GPUS]; - -extern void x13_hamsi512_cpu_init(int thr_id, uint32_t threads); -extern void x13_hamsi512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void x13_fugue512_cpu_init(int thr_id, uint32_t threads); -extern void x13_fugue512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -extern void x13_fugue512_cpu_free(int thr_id); - -// X13 CPU Hash -extern "C" void x13hash(void *output, const void *input) -{ - // blake1-bmw2-grs3-skein4-jh5-keccak6-luffa7-cubehash8-shavite9-simd10-echo11-hamsi12-fugue13 - - sph_blake512_context ctx_blake; - sph_bmw512_context ctx_bmw; - sph_groestl512_context ctx_groestl; - sph_jh512_context ctx_jh; - sph_keccak512_context ctx_keccak; - sph_skein512_context ctx_skein; - sph_luffa512_context ctx_luffa; - sph_cubehash512_context ctx_cubehash; - sph_shavite512_context ctx_shavite; - sph_simd512_context ctx_simd; - sph_echo512_context ctx_echo; - sph_hamsi512_context ctx_hamsi; - sph_fugue512_context ctx_fugue; - - uint32_t hash[32]; - memset(hash, 0, sizeof hash); - - sph_blake512_init(&ctx_blake); - sph_blake512 (&ctx_blake, input, 80); - sph_blake512_close(&ctx_blake, (void*) hash); - - sph_bmw512_init(&ctx_bmw); - sph_bmw512 (&ctx_bmw, (const void*) hash, 64); - sph_bmw512_close(&ctx_bmw, (void*) hash); - - sph_groestl512_init(&ctx_groestl); - sph_groestl512 (&ctx_groestl, (const void*) hash, 64); - sph_groestl512_close(&ctx_groestl, (void*) hash); - - sph_skein512_init(&ctx_skein); - sph_skein512 (&ctx_skein, (const void*) hash, 64); - sph_skein512_close(&ctx_skein, (void*) hash); - - sph_jh512_init(&ctx_jh); - sph_jh512 (&ctx_jh, (const void*) hash, 64); - sph_jh512_close(&ctx_jh, (void*) hash); - - sph_keccak512_init(&ctx_keccak); - sph_keccak512 (&ctx_keccak, (const void*) hash, 64); - sph_keccak512_close(&ctx_keccak, (void*) hash); - - sph_luffa512_init(&ctx_luffa); - sph_luffa512 (&ctx_luffa, (const void*) hash, 64); - sph_luffa512_close (&ctx_luffa, (void*) hash); - - sph_cubehash512_init(&ctx_cubehash); - sph_cubehash512 (&ctx_cubehash, (const void*) hash, 64); - sph_cubehash512_close(&ctx_cubehash, (void*) hash); - - sph_shavite512_init(&ctx_shavite); - sph_shavite512 (&ctx_shavite, (const void*) hash, 64); - sph_shavite512_close(&ctx_shavite, (void*) hash); - - sph_simd512_init(&ctx_simd); - sph_simd512 (&ctx_simd, (const void*) hash, 64); - sph_simd512_close(&ctx_simd, (void*) hash); - - sph_echo512_init(&ctx_echo); - sph_echo512 (&ctx_echo, (const void*) hash, 64); - sph_echo512_close(&ctx_echo, (void*) hash); - - sph_hamsi512_init(&ctx_hamsi); - sph_hamsi512 (&ctx_hamsi, (const void*) hash, 64); - sph_hamsi512_close(&ctx_hamsi, (void*) hash); - - sph_fugue512_init(&ctx_fugue); - sph_fugue512 (&ctx_fugue, (const void*) hash, 64); - sph_fugue512_close(&ctx_fugue, (void*) hash); - - memcpy(output, hash, 32); -} - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_x13(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - int intensity = 19; // (device_sm[device_map[thr_id]] > 500 && !is_windows()) ? 20 : 19; - uint32_t throughput = cuda_default_throughput(thr_id, 1 << intensity); // 19=256*256*8; - //if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ((uint32_t*)ptarget)[7] = 0x000f; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - quark_blake512_cpu_init(thr_id, throughput); - quark_groestl512_cpu_init(thr_id, throughput); - quark_skein512_cpu_init(thr_id, throughput); - quark_bmw512_cpu_init(thr_id, throughput); - quark_keccak512_cpu_init(thr_id, throughput); - quark_jh512_cpu_init(thr_id, throughput); - x11_luffaCubehash512_cpu_init(thr_id, throughput); - x11_shavite512_cpu_init(thr_id, throughput); - if (x11_simd512_cpu_init(thr_id, throughput) != 0) { - return 0; - } - x11_echo512_cpu_init(thr_id, throughput); - x13_hamsi512_cpu_init(thr_id, throughput); - x13_fugue512_cpu_init(thr_id, throughput); - - CUDA_CALL_OR_RET_X(cudaMalloc(&d_hash[thr_id], 16 * sizeof(uint32_t) * throughput), 0); - - cuda_check_cpu_init(thr_id, throughput); - - init[thr_id] = true; - } - - uint32_t endiandata[20]; - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - quark_blake512_cpu_setBlock_80(thr_id, endiandata); - cuda_check_cpu_setTarget(ptarget); - - do { - int order = 0; - - quark_blake512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - quark_bmw512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_groestl512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_jh512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_keccak512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_luffaCubehash512_cpu_hash_64(thr_id, throughput, d_hash[thr_id], order++); - x11_shavite512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_simd512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x13_hamsi512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x13_fugue512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - - *hashes_done = pdata[19] - first_nonce + throughput; - - CUDA_LOG_ERROR(); - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - be32enc(&endiandata[19], work->nonces[0]); - x13hash(vhash, endiandata); - - if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - work_set_target_ratio(work, vhash); - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - x13hash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t)throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - - CUDA_LOG_ERROR(); - - return 0; -} - -// cleanup -extern "C" void free_x13(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - - quark_blake512_cpu_free(thr_id); - quark_groestl512_cpu_free(thr_id); - x11_simd512_cpu_free(thr_id); - x13_fugue512_cpu_free(thr_id); - - cuda_check_cpu_free(thr_id); - CUDA_LOG_ERROR(); - - cudaDeviceSynchronize(); - init[thr_id] = false; -} diff --git a/x15/cuda_whirlpool_tables.cuh b/x15/cuda_whirlpool_tables.cuh deleted file mode 100644 index 0690eb59..00000000 --- a/x15/cuda_whirlpool_tables.cuh +++ /dev/null @@ -1,190 +0,0 @@ -/* CUDA whirlpool huge constant tables */ - -static const uint64_t old1_T0[256] = { - 0x78D8C07818281818, 0xAF2605AF23652323, 0xF9B87EF9C657C6C6, 0x6FFB136FE825E8E8, - 0xA1CB4CA187948787, 0x6211A962B8D5B8B8, 0x0509080501030101, 0x6E0D426E4FD14F4F, - 0xEE9BADEE365A3636, 0x04FF5904A6F7A6A6, 0xBD0CDEBDD26BD2D2, 0x060EFB06F502F5F5, - 0x8096EF80798B7979, 0xCE305FCE6FB16F6F, 0xEF6DFCEF91AE9191, 0x07F8AA0752F65252, - 0xFD4727FD60A06060, 0x76358976BCD9BCBC, 0xCD37ACCD9BB09B9B, 0x8C8A048C8E8F8E8E, - 0x15D27115A3F8A3A3, 0x3C6C603C0C140C0C, 0x8A84FF8A7B8D7B7B, 0xE180B5E1355F3535, - 0x69F5E8691D271D1D, 0x47B35347E03DE0E0, 0xAC21F6ACD764D7D7, 0xED9C5EEDC25BC2C2, - 0x96436D962E722E2E, 0x7A29627A4BDD4B4B, 0x215DA321FE1FFEFE, 0x16D5821657F95757, - 0x41BDA841153F1515, 0xB6E89FB677997777, 0xEB92A5EB37593737, 0x569E7B56E532E5E5, - 0xD9138CD99FBC9F9F, 0x1723D317F00DF0F0, 0x7F206A7F4ADE4A4A, 0x95449E95DA73DADA, - 0x25A2FA2558E85858, 0xCACF06CAC946C9C9, 0x8D7C558D297B2929, 0x225A50220A1E0A0A, - 0x4F50E14FB1CEB1B1, 0x1AC9691AA0FDA0A0, 0xDA147FDA6BBD6B6B, 0xABD95CAB85928585, - 0x733C8173BDDABDBD, 0x348FD2345DE75D5D, 0x5090805010301010, 0x0307F303F401F4F4, - 0xC0DD16C0CB40CBCB, 0xC6D3EDC63E423E3E, 0x112D2811050F0505, 0xE6781FE667A96767, - 0x53977353E431E4E4, 0xBB0225BB27692727, 0x5873325841C34141, 0x9DA72C9D8B808B8B, - 0x01F65101A7F4A7A7, 0x94B2CF947D877D7D, 0xFB49DCFB95A29595, 0x9F568E9FD875D8D8, - 0x30708B30FB10FBFB, 0x71CD2371EE2FEEEE, 0x91BBC7917C847C7C, 0xE37117E366AA6666, - 0x8E7BA68EDD7ADDDD, 0x4BAFB84B17391717, 0x4645024647C94747, 0xDC1A84DC9EBF9E9E, - 0xC5D41EC5CA43CACA, 0x995875992D772D2D, 0x792E9179BFDCBFBF, 0x1B3F381B07090707, - 0x23AC0123ADEAADAD, 0x2FB0EA2F5AEE5A5A, 0xB5EF6CB583988383, 0xFFB685FF33553333, - 0xF25C3FF263A56363, 0x0A12100A02060202, 0x38933938AAE3AAAA, 0xA8DEAFA871937171, - 0xCFC60ECFC845C8C8, 0x7DD1C87D192B1919, 0x703B727049DB4949, 0x9A5F869AD976D9D9, - 0x1D31C31DF20BF2F2, 0x48A84B48E338E3E3, 0x2AB9E22A5BED5B5B, 0x92BC349288858888, - 0xC83EA4C89AB39A9A, 0xBE0B2DBE266A2626, 0xFABF8DFA32563232, 0x4A59E94AB0CDB0B0, - 0x6AF21B6AE926E9E9, 0x337778330F110F0F, 0xA633E6A6D562D5D5, 0xBAF474BA809D8080, - 0x7C27997CBEDFBEBE, 0xDEEB26DECD4ACDCD, 0xE489BDE4345C3434, 0x75327A7548D84848, - 0x2454AB24FF1CFFFF, 0x8F8DF78F7A8E7A7A, 0xEA64F4EA90AD9090, 0x3E9DC23E5FE15F5F, - 0xA03D1DA020602020, 0xD50F67D568B86868, 0x72CAD0721A2E1A1A, 0x2CB7192CAEEFAEAE, - 0x5E7DC95EB4C1B4B4, 0x19CE9A1954FC5454, 0xE57FECE593A89393, 0xAA2F0DAA22662222, - 0xE96307E964AC6464, 0x122ADB12F10EF1F1, 0xA2CCBFA273957373, 0x5A82905A12361212, - 0x5D7A3A5D40C04040, 0x2848402808180808, 0xE89556E8C358C3C3, 0x7BDF337BEC29ECEC, - 0x904D9690DB70DBDB, 0x1FC0611FA1FEA1A1, 0x83911C838D8A8D8D, 0xC9C8F5C93D473D3D, - 0xF15BCCF197A49797, 0x0000000000000000, 0xD4F936D4CF4CCFCF, 0x876E45872B7D2B2B, - 0xB3E197B3769A7676, 0xB0E664B0829B8282, 0xA928FEA9D667D6D6, 0x77C3D8771B2D1B1B, - 0x5B74C15BB5C2B5B5, 0x29BE1129AFECAFAF, 0xDF1D77DF6ABE6A6A, 0x0DEABA0D50F05050, - 0x4C57124C45CF4545, 0x1838CB18F308F3F3, 0xF0AD9DF030503030, 0x74C42B74EF2CEFEF, - 0xC3DAE5C33F413F3F, 0x1CC7921C55FF5555, 0x10DB7910A2FBA2A2, 0x65E90365EA23EAEA, - 0xEC6A0FEC65AF6565, 0x6803B968BAD3BABA, 0x934A65932F712F2F, 0xE78E4EE7C05DC0C0, - 0x8160BE81DE7FDEDE, 0x6CFCE06C1C241C1C, 0x2E46BB2EFD1AFDFD, 0x641F52644DD74D4D, - 0xE076E4E092AB9292, 0xBCFA8FBC759F7575, 0x1E36301E060A0606, 0x98AE24988A838A8A, - 0x404BF940B2CBB2B2, 0x59856359E637E6E6, 0x367E70360E120E0E, 0x63E7F8631F211F1F, - 0xF75537F762A66262, 0xA33AEEA3D461D4D4, 0x32812932A8E5A8A8, 0xF452C4F496A79696, - 0x3A629B3AF916F9F9, 0xF6A366F6C552C5C5, 0xB11035B1256F2525, 0x20ABF22059EB5959, - 0xAED054AE84918484, 0xA7C5B7A772967272, 0xDDECD5DD394B3939, 0x61165A614CD44C4C, - 0x3B94CA3B5EE25E5E, 0x859FE78578887878, 0xD8E5DDD838483838, 0x869814868C898C8C, - 0xB217C6B2D16ED1D1, 0x0BE4410BA5F2A5A5, 0x4DA1434DE23BE2E2, 0xF84E2FF861A36161, - 0x4542F145B3C8B3B3, 0xA53415A521632121, 0xD60894D69CB99C9C, 0x66EEF0661E221E1E, - 0x5261225243C54343, 0xFCB176FCC754C7C7, 0x2B4FB32BFC19FCFC, 0x14242014040C0404, - 0x08E3B20851F35151, 0xC725BCC799B69999, 0xC4224FC46DB76D6D, 0x396568390D170D0D, - 0x35798335FA13FAFA, 0x8469B684DF7CDFDF, 0x9BA9D79B7E827E7E, 0xB4193DB4246C2424, - 0xD7FEC5D73B4D3B3B, 0x3D9A313DABE0ABAB, 0xD1F03ED1CE4FCECE, 0x5599885511331111, - 0x89830C898F8C8F8F, 0x6B044A6B4ED24E4E, 0x5166D151B7C4B7B7, 0x60E00B60EB20EBEB, - 0xCCC1FDCC3C443C3C, 0xBFFD7CBF819E8181, 0xFE40D4FE94A19494, 0x0C1CEB0CF704F7F7, - 0x6718A167B9D6B9B9, 0x5F8B985F13351313, 0x9C517D9C2C742C2C, 0xB805D6B8D368D3D3, - 0x5C8C6B5CE734E7E7, 0xCB3957CB6EB26E6E, 0xF3AA6EF3C451C4C4, 0x0F1B180F03050303, - 0x13DC8A1356FA5656, 0x495E1A4944CC4444, 0x9EA0DF9E7F817F7F, 0x37882137A9E6A9A9, - 0x82674D822A7E2A2A, 0x6D0AB16DBBD0BBBB, 0xE28746E2C15EC1C1, 0x02F1A20253F55353, - 0x8B72AE8BDC79DCDC, 0x275358270B1D0B0B, 0xD3019CD39DBA9D9D, 0xC12B47C16CB46C6C, - 0xF5A495F531533131, 0xB9F387B9749C7474, 0x0915E309F607F6F6, 0x434C0A4346CA4646, - 0x26A50926ACE9ACAC, 0x97B53C9789868989, 0x44B4A044143C1414, 0x42BA5B42E13EE1E1, - 0x4EA6B04E163A1616, 0xD2F7CDD23A4E3A3A, 0xD0066FD069BB6969, 0x2D41482D091B0909, - 0xADD7A7AD70907070, 0x546FD954B6C7B6B6, 0xB71ECEB7D06DD0D0, 0x7ED63B7EED2AEDED, - 0xDBE22EDBCC49CCCC, 0x57682A5742C64242, 0xC22CB4C298B59898, 0x0EED490EA4F1A4A4, - 0x88755D8828782828, 0x3186DA315CE45C5C, 0x3F6B933FF815F8F8, 0xA4C244A486978686 -}; - -static const uint64_t old1_RC[10] = { - 0x4F01B887E8C62318, 0x52916F79F5D2A636, 0x357B0CA38E9BBC60, 0x57FE4B2EC2D7E01D, 0xDA4AF09FE5377715, - 0x856BA0B10A29C958, 0x67053ECBF4105DBD, 0xD8957DA78B4127E4, 0x9E4717DD667CEEFB, 0x33835AAD07BF2DCA -}; - -static const uint64_t old1_precomputed_round_key_64[72] = { - 0xECE7FCC7F808AB3B, 0x44E9CB45024545CB, 0xB289A43CA4A489FE, 0xC5E1F3E1E1C5A9A0, - 0xFCD4FCFCAC5C48AC, 0x418F8F0E90F70E8F, 0x7979078514077946, 0xF8B87868B8F8D8F8, - 0xE4B6012A17B9C1EF, 0xAFF6AD2866D6C68D, 0xB0C745991504968F, 0x74E93F120FE2E675, - 0xC1D216198D2A495B, 0x35B6A53DF6716FD7, 0xD6983228CCDC354F, 0xC3B8BFCB242AB159, - 0x4AC0340260B548D4, 0x3B3582BB4F9BB769, 0xD8683C4AF17C46F8, 0x9EE05220D8214E61, - 0xFED2431F5098E0E5, 0x387AF50F0776E24F, 0x7FFD300A74DE5AE1, 0xB753981921AEB24B, - 0x296F5919978BA0BD, 0x52CC9DD7031E59AC, 0xE5E646C9A5165AE3, 0x4F848BDF70532817, - 0xA01ADD556B693C51, 0xC7268B83DDB75E97, 0xCB908F9316E2C076, 0x8FC39EE0D946E9C5, - 0x5B256B0FE7937D86, 0xF77C51751A22932C, 0x2582A83CD34108C4, 0xE218CDE28A9C790D, - 0xC93A572E592E3594, 0xEA70CF71BC4E55AC, 0xC135C8214155BC85, 0x50989643A6B8456E, - 0x60E970DFD74C71E6, 0xC0B5A520AB7C88D8, 0x3A66AA761D5B1400, 0x0502AB3087300DE6, - 0xC06203EDED483DEA, 0xC2620EDF55C1CB74, 0xF36A22CF9AA452F1, 0xB3502DC83BA2660F, - 0xCF249B6DB82273C3, 0xC74DADAB026388F2, 0xB8B77B3275AFCDE8, 0xC9947382C6D6A3C0, - 0x84938F2258A6BC21, 0x1E51E15A3B99CDF7, 0xC812F9AC41F5CC05, 0x21BFEC61E9B9393E, - 0xF576066160243540, 0x3A62D1CB6404180D, 0x8807A55C2AC7AFE2, 0x804237B54859503E, - 0x1619B3612106744B, 0xC1ECB5643D81C76F, 0xBA7CBB8C13214C6C, 0xD241AEAD7622701E, - 0xDD900A1B66BF748C, 0xCACCF665EC2391FE, 0xF9BED90100B89447, 0x4CF5D284E56B7A0F, - 0x003EB289B6993F96, 0xE9DB01146199245D, 0x97701270F3F41CCB, 0x9C8CA117E01E4B49 -}; - -//---------------------------------------------------------------------------------------------------------- - -static const uint64_t plain_T0[256] = { - 0xD83078C018601818, 0x2646AF05238C2323, 0xB891F97EC63FC6C6, 0xFBCD6F13E887E8E8, - 0xCB13A14C87268787, 0x116D62A9B8DAB8B8, 0x0902050801040101, 0x0D9E6E424F214F4F, - 0x9B6CEEAD36D83636, 0xFF510459A6A2A6A6, 0x0CB9BDDED26FD2D2, 0x0EF706FBF5F3F5F5, - 0x96F280EF79F97979, 0x30DECE5F6FA16F6F, 0x6D3FEFFC917E9191, 0xF8A407AA52555252, - 0x47C0FD27609D6060, 0x35657689BCCABCBC, 0x372BCDAC9B569B9B, 0x8A018C048E028E8E, - 0xD25B1571A3B6A3A3, 0x6C183C600C300C0C, 0x84F68AFF7BF17B7B, 0x806AE1B535D43535, - 0xF53A69E81D741D1D, 0xB3DD4753E0A7E0E0, 0x21B3ACF6D77BD7D7, 0x9C99ED5EC22FC2C2, - 0x435C966D2EB82E2E, 0x29967A624B314B4B, 0x5DE121A3FEDFFEFE, 0xD5AE168257415757, - 0xBD2A41A815541515, 0xE8EEB69F77C17777, 0x926EEBA537DC3737, 0x9ED7567BE5B3E5E5, - 0x1323D98C9F469F9F, 0x23FD17D3F0E7F0F0, 0x20947F6A4A354A4A, 0x44A9959EDA4FDADA, - 0xA2B025FA587D5858, 0xCF8FCA06C903C9C9, 0x7C528D5529A42929, 0x5A1422500A280A0A, - 0x507F4FE1B1FEB1B1, 0xC95D1A69A0BAA0A0, 0x14D6DA7F6BB16B6B, 0xD917AB5C852E8585, - 0x3C677381BDCEBDBD, 0x8FBA34D25D695D5D, 0x9020508010401010, 0x07F503F3F4F7F4F4, - 0xDD8BC016CB0BCBCB, 0xD37CC6ED3EF83E3E, 0x2D0A112805140505, 0x78CEE61F67816767, - 0x97D55373E4B7E4E4, 0x024EBB25279C2727, 0x7382583241194141, 0xA70B9D2C8B168B8B, - 0xF6530151A7A6A7A7, 0xB2FA94CF7DE97D7D, 0x4937FBDC956E9595, 0x56AD9F8ED847D8D8, - 0x70EB308BFBCBFBFB, 0xCDC17123EE9FEEEE, 0xBBF891C77CED7C7C, 0x71CCE31766856666, - 0x7BA78EA6DD53DDDD, 0xAF2E4BB8175C1717, 0x458E460247014747, 0x1A21DC849E429E9E, - 0xD489C51ECA0FCACA, 0x585A99752DB42D2D, 0x2E637991BFC6BFBF, 0x3F0E1B38071C0707, - 0xAC472301AD8EADAD, 0xB0B42FEA5A755A5A, 0xEF1BB56C83368383, 0xB666FF8533CC3333, - 0x5CC6F23F63916363, 0x12040A1002080202, 0x93493839AA92AAAA, 0xDEE2A8AF71D97171, - 0xC68DCF0EC807C8C8, 0xD1327DC819641919, 0x3B92707249394949, 0x5FAF9A86D943D9D9, - 0x31F91DC3F2EFF2F2, 0xA8DB484BE3ABE3E3, 0xB9B62AE25B715B5B, 0xBC0D9234881A8888, - 0x3E29C8A49A529A9A, 0x0B4CBE2D26982626, 0xBF64FA8D32C83232, 0x597D4AE9B0FAB0B0, - 0xF2CF6A1BE983E9E9, 0x771E33780F3C0F0F, 0x33B7A6E6D573D5D5, 0xF41DBA74803A8080, - 0x27617C99BEC2BEBE, 0xEB87DE26CD13CDCD, 0x8968E4BD34D03434, 0x3290757A483D4848, - 0x54E324ABFFDBFFFF, 0x8DF48FF77AF57A7A, 0x643DEAF4907A9090, 0x9DBE3EC25F615F5F, - 0x3D40A01D20802020, 0x0FD0D56768BD6868, 0xCA3472D01A681A1A, 0xB7412C19AE82AEAE, - 0x7D755EC9B4EAB4B4, 0xCEA8199A544D5454, 0x7F3BE5EC93769393, 0x2F44AA0D22882222, - 0x63C8E907648D6464, 0x2AFF12DBF1E3F1F1, 0xCCE6A2BF73D17373, 0x82245A9012481212, - 0x7A805D3A401D4040, 0x4810284008200808, 0x959BE856C32BC3C3, 0xDFC57B33EC97ECEC, - 0x4DAB9096DB4BDBDB, 0xC05F1F61A1BEA1A1, 0x9107831C8D0E8D8D, 0xC87AC9F53DF43D3D, - 0x5B33F1CC97669797, 0x0000000000000000, 0xF983D436CF1BCFCF, 0x6E5687452BAC2B2B, - 0xE1ECB39776C57676, 0xE619B06482328282, 0x28B1A9FED67FD6D6, 0xC33677D81B6C1B1B, - 0x74775BC1B5EEB5B5, 0xBE432911AF86AFAF, 0x1DD4DF776AB56A6A, 0xEAA00DBA505D5050, - 0x578A4C1245094545, 0x38FB18CBF3EBF3F3, 0xAD60F09D30C03030, 0xC4C3742BEF9BEFEF, - 0xDA7EC3E53FFC3F3F, 0xC7AA1C9255495555, 0xDB591079A2B2A2A2, 0xE9C96503EA8FEAEA, - 0x6ACAEC0F65896565, 0x036968B9BAD2BABA, 0x4A5E93652FBC2F2F, 0x8E9DE74EC027C0C0, - 0x60A181BEDE5FDEDE, 0xFC386CE01C701C1C, 0x46E72EBBFDD3FDFD, 0x1F9A64524D294D4D, - 0x7639E0E492729292, 0xFAEABC8F75C97575, 0x360C1E3006180606, 0xAE0998248A128A8A, - 0x4B7940F9B2F2B2B2, 0x85D15963E6BFE6E6, 0x7E1C36700E380E0E, 0xE73E63F81F7C1F1F, - 0x55C4F73762956262, 0x3AB5A3EED477D4D4, 0x814D3229A89AA8A8, 0x5231F4C496629696, - 0x62EF3A9BF9C3F9F9, 0xA397F666C533C5C5, 0x104AB13525942525, 0xABB220F259795959, - 0xD015AE54842A8484, 0xC5E4A7B772D57272, 0xEC72DDD539E43939, 0x1698615A4C2D4C4C, - 0x94BC3BCA5E655E5E, 0x9FF085E778FD7878, 0xE570D8DD38E03838, 0x980586148C0A8C8C, - 0x17BFB2C6D163D1D1, 0xE4570B41A5AEA5A5, 0xA1D94D43E2AFE2E2, 0x4EC2F82F61996161, - 0x427B45F1B3F6B3B3, 0x3442A51521842121, 0x0825D6949C4A9C9C, 0xEE3C66F01E781E1E, - 0x6186522243114343, 0xB193FC76C73BC7C7, 0x4FE52BB3FCD7FCFC, 0x2408142004100404, - 0xE3A208B251595151, 0x252FC7BC995E9999, 0x22DAC44F6DA96D6D, 0x651A39680D340D0D, - 0x79E93583FACFFAFA, 0x69A384B6DF5BDFDF, 0xA9FC9BD77EE57E7E, 0x1948B43D24902424, - 0xFE76D7C53BEC3B3B, 0x9A4B3D31AB96ABAB, 0xF081D13ECE1FCECE, 0x9922558811441111, - 0x8303890C8F068F8F, 0x049C6B4A4E254E4E, 0x667351D1B7E6B7B7, 0xE0CB600BEB8BEBEB, - 0xC178CCFD3CF03C3C, 0xFD1FBF7C813E8181, 0x4035FED4946A9494, 0x1CF30CEBF7FBF7F7, - 0x186F67A1B9DEB9B9, 0x8B265F98134C1313, 0x51589C7D2CB02C2C, 0x05BBB8D6D36BD3D3, - 0x8CD35C6BE7BBE7E7, 0x39DCCB576EA56E6E, 0xAA95F36EC437C4C4, 0x1B060F18030C0303, - 0xDCAC138A56455656, 0x5E88491A440D4444, 0xA0FE9EDF7FE17F7F, 0x884F3721A99EA9A9, - 0x6754824D2AA82A2A, 0x0A6B6DB1BBD6BBBB, 0x879FE246C123C1C1, 0xF1A602A253515353, - 0x72A58BAEDC57DCDC, 0x531627580B2C0B0B, 0x0127D39C9D4E9D9D, 0x2BD8C1476CAD6C6C, - 0xA462F59531C43131, 0xF3E8B98774CD7474, 0x15F109E3F6FFF6F6, 0x4C8C430A46054646, - 0xA5452609AC8AACAC, 0xB50F973C891E8989, 0xB42844A014501414, 0xBADF425BE1A3E1E1, - 0xA62C4EB016581616, 0xF774D2CD3AE83A3A, 0x06D2D06F69B96969, 0x41122D4809240909, - 0xD7E0ADA770DD7070, 0x6F7154D9B6E2B6B6, 0x1EBDB7CED067D0D0, 0xD6C77E3BED93EDED, - 0xE285DB2ECC17CCCC, 0x6884572A42154242, 0x2C2DC2B4985A9898, 0xED550E49A4AAA4A4, - 0x7550885D28A02828, 0x86B831DA5C6D5C5C, 0x6BED3F93F8C7F8F8, 0xC211A44486228686 -}; - -static const uint64_t plain_RC[10] = { - 0x4F01B887E8C62318, 0x52916F79F5D2A636, 0x357B0CA38E9BBC60, 0x57FE4B2EC2D7E01D, 0xDA4AF09FE5377715, - 0x856BA0B10A29C958, 0x67053ECBF4105DBD, 0xD8957DA78B4127E4, 0x9E4717DD667CEEFB, 0x33835AAD07BF2DCA -}; - -static const uint64_t plain_precomputed_round_key_64[72] = { - 0x24AED1EAF889AB3B, 0xAFCBE94566454544, 0x89B2A4C5A4A4FE70, 0xA0E1CCE1E1A9FAC5, - 0xFCB8FCFC5CC0AC48, 0x698F8F90260EF78F, 0x797985D707147996, 0xF878C8B868F8A8F8, - 0x58704630DBBF19D3, 0xDB37CFAFD1235B29, 0x98AC958BC28A2C01, 0xA706B2C0B19E6381, - 0xDB09B2B07A605E44, 0x71BC8CBCCF2C5B73, 0xD3DDEDEF240967DC, 0x197D3BD7F03B8D7B, - 0x866511DEC1AABE38, 0x7F33874AD0F37C68, 0x57F0AD98DBFA37F3, 0xBC8D35EE5842E2C5, - 0x7E246E99E8F00911, 0x0134B010EDD6C501, 0xD3EC287BF152C9FB, 0x4027F1C70CDC5632, - 0x14CF9B9420A525AF, 0x4D53C4E3A92636C1, 0xE1F94077867D0FE6, 0x29066AE2BBE65D91, - 0x8D5EFE4CCC545A96, 0xA63A3262CB31E9BE, 0x476A849618597BB1, 0x31AF592736C9F0D4, - 0xB00B3725C0B5F9E2, 0xA5948416A2CB2B39, 0x148C34FACEF88A60, 0x19928C416437A57A, - 0x893F83FAA146F3B3, 0x7CCF0278483F4997, 0x238F001EBAE8ADDC, 0x3D32B0ED494F7792, - 0x2FFF4D7782634175, 0x00460355D038FAFF, 0x61F3983E49027DBF, 0x0BCEE59AC260A8F4, - 0x279D5DEE445ADFC8, 0xA4007504555AF423, 0x8CE2F902121016B0, 0x1D33336829CD30AC, - 0x89AD846882F16B03, 0x637146D862C64099, 0x10C2194B173E434C, 0xC586FF4CD3CF9CE2, - 0x5326DF42A011FF21, 0x134BE46CCB008E1B, 0xCEB747A3F73B12A6, 0xCA33283B0E9018D9, - 0xF92C9A0A7A671CD0, 0xB2B6634A532F942A, 0xB4A8ACFE46224288, 0x5935583DC75C4A47, - 0xA16F5CA55D92A674, 0x395C73C48CE61777, 0xC61AEC530B3B2A08, 0x62E74D81EB58F62A, - 0x3ABCEE01B6489548, 0x818EED6BC66B0DA5, 0x755A2688CF3DCEE0, 0xE99CF6C0DB4A8CC2, - 0x1385717FD59CB754, 0x7B0B7D978A4B4143, 0x7A15F6DBBB351963, 0x27820137F64E7A6A -}; - diff --git a/x15/cuda_whirlpoolx.cu b/x15/cuda_whirlpoolx.cu deleted file mode 100644 index d5f94eb8..00000000 --- a/x15/cuda_whirlpoolx.cu +++ /dev/null @@ -1,594 +0,0 @@ -/* - * Built on cbuchner1's implementation, actual hashing code - * based on sphlib 3.0 - */ -#include -#include - -#define threadsPerBlock 1024 - -#include "cuda_helper.h" - -__constant__ uint64_t c_PaddedMessage80[16]; // padded message (80 bytes + padding) -__constant__ uint64_t c_xtra[8]; -__constant__ uint64_t c_tmp[72]; -__constant__ uint64_t pTarget[4]; - -static uint32_t *h_wxnounce[MAX_GPUS] = { 0 }; -static uint32_t *d_WXNonce[MAX_GPUS] = { 0 }; - -/** - * Whirlpool CUDA kernel implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2014 djm34 & tpruvot & SP & Provos Alexis - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * @author djm34 - * @author tpruvot - * @author SP - * @author Provos Alexis - */ - -__constant__ __align__(64) uint64_t mixTob0Tox[256]; - -const uint64_t plain_T0[256]= { - 0xD83078C018601818,0x2646AF05238C2323,0xB891F97EC63FC6C6,0xFBCD6F13E887E8E8,0xCB13A14C87268787,0x116D62A9B8DAB8B8,0x0902050801040101,0x0D9E6E424F214F4F,0x9B6CEEAD36D83636, - 0xFF510459A6A2A6A6,0x0CB9BDDED26FD2D2,0x0EF706FBF5F3F5F5,0x96F280EF79F97979,0x30DECE5F6FA16F6F,0x6D3FEFFC917E9191,0xF8A407AA52555252,0x47C0FD27609D6060,0x35657689BCCABCBC, - 0x372BCDAC9B569B9B,0x8A018C048E028E8E,0xD25B1571A3B6A3A3,0x6C183C600C300C0C,0x84F68AFF7BF17B7B,0x806AE1B535D43535,0xF53A69E81D741D1D,0xB3DD4753E0A7E0E0,0x21B3ACF6D77BD7D7, - 0x9C99ED5EC22FC2C2,0x435C966D2EB82E2E,0x29967A624B314B4B,0x5DE121A3FEDFFEFE,0xD5AE168257415757,0xBD2A41A815541515,0xE8EEB69F77C17777,0x926EEBA537DC3737,0x9ED7567BE5B3E5E5, - 0x1323D98C9F469F9F,0x23FD17D3F0E7F0F0,0x20947F6A4A354A4A,0x44A9959EDA4FDADA,0xA2B025FA587D5858,0xCF8FCA06C903C9C9,0x7C528D5529A42929,0x5A1422500A280A0A,0x507F4FE1B1FEB1B1, - 0xC95D1A69A0BAA0A0,0x14D6DA7F6BB16B6B,0xD917AB5C852E8585,0x3C677381BDCEBDBD,0x8FBA34D25D695D5D,0x9020508010401010,0x07F503F3F4F7F4F4,0xDD8BC016CB0BCBCB,0xD37CC6ED3EF83E3E, - 0x2D0A112805140505,0x78CEE61F67816767,0x97D55373E4B7E4E4,0x024EBB25279C2727,0x7382583241194141,0xA70B9D2C8B168B8B,0xF6530151A7A6A7A7,0xB2FA94CF7DE97D7D,0x4937FBDC956E9595, - 0x56AD9F8ED847D8D8,0x70EB308BFBCBFBFB,0xCDC17123EE9FEEEE,0xBBF891C77CED7C7C,0x71CCE31766856666,0x7BA78EA6DD53DDDD,0xAF2E4BB8175C1717,0x458E460247014747,0x1A21DC849E429E9E, - 0xD489C51ECA0FCACA,0x585A99752DB42D2D,0x2E637991BFC6BFBF,0x3F0E1B38071C0707,0xAC472301AD8EADAD,0xB0B42FEA5A755A5A,0xEF1BB56C83368383,0xB666FF8533CC3333,0x5CC6F23F63916363, - 0x12040A1002080202,0x93493839AA92AAAA,0xDEE2A8AF71D97171,0xC68DCF0EC807C8C8,0xD1327DC819641919,0x3B92707249394949,0x5FAF9A86D943D9D9,0x31F91DC3F2EFF2F2,0xA8DB484BE3ABE3E3, - 0xB9B62AE25B715B5B,0xBC0D9234881A8888,0x3E29C8A49A529A9A,0x0B4CBE2D26982626,0xBF64FA8D32C83232,0x597D4AE9B0FAB0B0,0xF2CF6A1BE983E9E9,0x771E33780F3C0F0F,0x33B7A6E6D573D5D5, - 0xF41DBA74803A8080,0x27617C99BEC2BEBE,0xEB87DE26CD13CDCD,0x8968E4BD34D03434,0x3290757A483D4848,0x54E324ABFFDBFFFF,0x8DF48FF77AF57A7A,0x643DEAF4907A9090,0x9DBE3EC25F615F5F, - 0x3D40A01D20802020,0x0FD0D56768BD6868,0xCA3472D01A681A1A,0xB7412C19AE82AEAE,0x7D755EC9B4EAB4B4,0xCEA8199A544D5454,0x7F3BE5EC93769393,0x2F44AA0D22882222,0x63C8E907648D6464, - 0x2AFF12DBF1E3F1F1,0xCCE6A2BF73D17373,0x82245A9012481212,0x7A805D3A401D4040,0x4810284008200808,0x959BE856C32BC3C3,0xDFC57B33EC97ECEC,0x4DAB9096DB4BDBDB,0xC05F1F61A1BEA1A1, - 0x9107831C8D0E8D8D,0xC87AC9F53DF43D3D,0x5B33F1CC97669797,0x0000000000000000,0xF983D436CF1BCFCF,0x6E5687452BAC2B2B,0xE1ECB39776C57676,0xE619B06482328282,0x28B1A9FED67FD6D6, - 0xC33677D81B6C1B1B,0x74775BC1B5EEB5B5,0xBE432911AF86AFAF,0x1DD4DF776AB56A6A,0xEAA00DBA505D5050,0x578A4C1245094545,0x38FB18CBF3EBF3F3,0xAD60F09D30C03030,0xC4C3742BEF9BEFEF, - 0xDA7EC3E53FFC3F3F,0xC7AA1C9255495555,0xDB591079A2B2A2A2,0xE9C96503EA8FEAEA,0x6ACAEC0F65896565,0x036968B9BAD2BABA,0x4A5E93652FBC2F2F,0x8E9DE74EC027C0C0,0x60A181BEDE5FDEDE, - 0xFC386CE01C701C1C,0x46E72EBBFDD3FDFD,0x1F9A64524D294D4D,0x7639E0E492729292,0xFAEABC8F75C97575,0x360C1E3006180606,0xAE0998248A128A8A,0x4B7940F9B2F2B2B2,0x85D15963E6BFE6E6, - 0x7E1C36700E380E0E,0xE73E63F81F7C1F1F,0x55C4F73762956262,0x3AB5A3EED477D4D4,0x814D3229A89AA8A8,0x5231F4C496629696,0x62EF3A9BF9C3F9F9,0xA397F666C533C5C5,0x104AB13525942525, - 0xABB220F259795959,0xD015AE54842A8484,0xC5E4A7B772D57272,0xEC72DDD539E43939,0x1698615A4C2D4C4C,0x94BC3BCA5E655E5E,0x9FF085E778FD7878,0xE570D8DD38E03838,0x980586148C0A8C8C, - 0x17BFB2C6D163D1D1,0xE4570B41A5AEA5A5,0xA1D94D43E2AFE2E2,0x4EC2F82F61996161,0x427B45F1B3F6B3B3,0x3442A51521842121,0x0825D6949C4A9C9C,0xEE3C66F01E781E1E,0x6186522243114343, - 0xB193FC76C73BC7C7,0x4FE52BB3FCD7FCFC,0x2408142004100404,0xE3A208B251595151,0x252FC7BC995E9999,0x22DAC44F6DA96D6D,0x651A39680D340D0D,0x79E93583FACFFAFA,0x69A384B6DF5BDFDF, - 0xA9FC9BD77EE57E7E,0x1948B43D24902424,0xFE76D7C53BEC3B3B,0x9A4B3D31AB96ABAB,0xF081D13ECE1FCECE,0x9922558811441111,0x8303890C8F068F8F,0x049C6B4A4E254E4E,0x667351D1B7E6B7B7, - 0xE0CB600BEB8BEBEB,0xC178CCFD3CF03C3C,0xFD1FBF7C813E8181,0x4035FED4946A9494,0x1CF30CEBF7FBF7F7,0x186F67A1B9DEB9B9,0x8B265F98134C1313,0x51589C7D2CB02C2C,0x05BBB8D6D36BD3D3, - 0x8CD35C6BE7BBE7E7,0x39DCCB576EA56E6E,0xAA95F36EC437C4C4,0x1B060F18030C0303,0xDCAC138A56455656,0x5E88491A440D4444,0xA0FE9EDF7FE17F7F,0x884F3721A99EA9A9,0x6754824D2AA82A2A, - 0x0A6B6DB1BBD6BBBB,0x879FE246C123C1C1,0xF1A602A253515353,0x72A58BAEDC57DCDC,0x531627580B2C0B0B,0x0127D39C9D4E9D9D,0x2BD8C1476CAD6C6C,0xA462F59531C43131,0xF3E8B98774CD7474, - 0x15F109E3F6FFF6F6,0x4C8C430A46054646,0xA5452609AC8AACAC,0xB50F973C891E8989,0xB42844A014501414,0xBADF425BE1A3E1E1,0xA62C4EB016581616,0xF774D2CD3AE83A3A,0x06D2D06F69B96969, - 0x41122D4809240909,0xD7E0ADA770DD7070,0x6F7154D9B6E2B6B6,0x1EBDB7CED067D0D0,0xD6C77E3BED93EDED,0xE285DB2ECC17CCCC,0x6884572A42154242,0x2C2DC2B4985A9898,0xED550E49A4AAA4A4, - 0x7550885D28A02828,0x86B831DA5C6D5C5C,0x6BED3F93F8C7F8F8,0xC211A44486228686 -}; - -/** - * Round constants. - */ -__constant__ uint64_t InitVector_RC[10]; - -const uint64_t plain_RC[10] = { - 0x4F01B887E8C62318,0x52916F79F5D2A636,0x357B0CA38E9BBC60,0x57FE4B2EC2D7E01D,0xDA4AF09FE5377715, - 0x856BA0B10A29C958,0x67053ECBF4105DBD,0xD8957DA78B4127E4,0x9E4717DD667CEEFB,0x33835AAD07BF2DCA -}; - -/* ====================================================================== */ - -__device__ __forceinline__ -static uint64_t ROUND_ELT(const uint64_t* sharedMemory, const uint64_t* __restrict__ in, const int i0, const int i1, const int i2, const int i3, const int i4, const int i5, const int i6, const int i7) -{ - uint32_t* in32 = (uint32_t*)in; - return xor8( sharedMemory[__byte_perm(in32[(i0 << 1)], 0, 0x4440)], - sharedMemory[__byte_perm(in32[(i1 << 1)], 0, 0x4441) + 256], - sharedMemory[__byte_perm(in32[(i2 << 1)], 0, 0x4442) + 512], - sharedMemory[__byte_perm(in32[(i3 << 1)], 0, 0x4443) + 768], - sharedMemory[__byte_perm(in32[(i4 << 1) + 1], 0, 0x4440) + 1024], - sharedMemory[__byte_perm(in32[(i5 << 1) + 1], 0, 0x4441) + 1280], - sharedMemory[__byte_perm(in32[(i6 << 1) + 1], 0, 0x4442) + 1536], - sharedMemory[__byte_perm(in32[(i7 << 1) + 1], 0, 0x4443) + 1792]); -} - -#define TRANSFER(dst, src) { \ - dst[0] = src ## 0; \ - dst[1] = src ## 1; \ - dst[2] = src ## 2; \ - dst[3] = src ## 3; \ - dst[4] = src ## 4; \ - dst[5] = src ## 5; \ - dst[6] = src ## 6; \ - dst[7] = src ## 7; \ -} - -#define ROUND(table, in, out, c0, c1, c2, c3, c4, c5, c6, c7) { \ - out ## 0 = xor1(ROUND_ELT(table, in, 0, 7, 6, 5, 4, 3, 2, 1), c0); \ - out ## 1 = xor1(ROUND_ELT(table, in, 1, 0, 7, 6, 5, 4, 3, 2), c1); \ - out ## 2 = xor1(ROUND_ELT(table, in, 2, 1, 0, 7, 6, 5, 4, 3), c2); \ - out ## 3 = xor1(ROUND_ELT(table, in, 3, 2, 1, 0, 7, 6, 5, 4), c3); \ - out ## 4 = xor1(ROUND_ELT(table, in, 4, 3, 2, 1, 0, 7, 6, 5), c4); \ - out ## 5 = xor1(ROUND_ELT(table, in, 5, 4, 3, 2, 1, 0, 7, 6), c5); \ - out ## 6 = xor1(ROUND_ELT(table, in, 6, 5, 4, 3, 2, 1, 0, 7), c6); \ - out ## 7 = xor1(ROUND_ELT(table, in, 7, 6, 5, 4, 3, 2, 1, 0), c7); \ -} - -#define ROUND1(table, in, out, c) { \ - out ## 0 = xor1(ROUND_ELT(table, in, 0, 7, 6, 5, 4, 3, 2, 1), c); \ - out ## 1 = ROUND_ELT(table, in, 1, 0, 7, 6, 5, 4, 3, 2); \ - out ## 2 = ROUND_ELT(table, in, 2, 1, 0, 7, 6, 5, 4, 3); \ - out ## 3 = ROUND_ELT(table, in, 3, 2, 1, 0, 7, 6, 5, 4); \ - out ## 4 = ROUND_ELT(table, in, 4, 3, 2, 1, 0, 7, 6, 5); \ - out ## 5 = ROUND_ELT(table, in, 5, 4, 3, 2, 1, 0, 7, 6); \ - out ## 6 = ROUND_ELT(table, in, 6, 5, 4, 3, 2, 1, 0, 7); \ - out ## 7 = ROUND_ELT(table, in, 7, 6, 5, 4, 3, 2, 1, 0); \ -} - -#define ROUND_KSCHED(table, in, out, c) \ - ROUND1(table, in, out, c) \ - TRANSFER(in, out) - -#define ROUND_WENC(table, in, key, out) \ - ROUND(table, in, out, key[0], key[1], key[2],key[3], key[4], key[5], key[6], key[7]) \ - TRANSFER(in, out) - -static uint64_t* d_xtra[MAX_GPUS] = { 0 }; -static uint64_t* d_tmp[MAX_GPUS] = { 0 }; - -__device__ __forceinline__ -static void whirlpoolx_getShared(uint64_t* sharedMemory) -{ - if (threadIdx.x < 256) { - sharedMemory[threadIdx.x] = mixTob0Tox[threadIdx.x]; - sharedMemory[threadIdx.x+256] = ROTL64(sharedMemory[threadIdx.x], 8); - sharedMemory[threadIdx.x+512] = ROTL64(sharedMemory[threadIdx.x],16); - sharedMemory[threadIdx.x+768] = ROTL64(sharedMemory[threadIdx.x],24); - sharedMemory[threadIdx.x+1024] = ROTL64(sharedMemory[threadIdx.x],32); - sharedMemory[threadIdx.x+1280] = ROTR64(sharedMemory[threadIdx.x],24); - sharedMemory[threadIdx.x+1536] = ROTR64(sharedMemory[threadIdx.x],16); - sharedMemory[threadIdx.x+1792] = ROTR64(sharedMemory[threadIdx.x], 8); - } - __syncthreads(); -} - - -__global__ -void whirlpoolx_gpu_precompute(uint32_t threads, uint64_t* d_xtra, uint64_t* d_tmp) -{ - __shared__ uint64_t sharedMemory[2048]; - - whirlpoolx_getShared(sharedMemory); - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint64_t n[8]; - uint64_t h[8] = { 0 }; - - #pragma unroll 8 - for (int i=0; i<8; i++) { - n[i] = c_PaddedMessage80[i]; // read data - } - //#pragma unroll 10 - for (unsigned int r=0; r < 10; r++) { - uint64_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - ROUND_KSCHED(sharedMemory, h, tmp, InitVector_RC[r]); - ROUND_WENC(sharedMemory, n, h, tmp); - } - #pragma unroll 8 - for (int i=0; i < 8; i++) { - h[i] = xor1(n[i],c_PaddedMessage80[i]); - } - - if(threadIdx.x==0)d_xtra[threadIdx.x]=h[1]; - uint64_t atLastCalc=xor1(h[3],h[5]); - - ////////////////////////////////// - n[0] = c_PaddedMessage80[8]; //read data - n[1] = c_PaddedMessage80[9]; //whirlpool - n[2] = 0x0000000000000080; //whirlpool - n[3] = 0; - n[4] = 0; - n[5] = 0; - n[6] = 0; - n[7] = 0x8002000000000000; - - n[0] = xor1(n[0],h[0]); - n[2] = xor1(n[2],h[2]); n[3] = h[3]; - n[4] = h[4]; n[5] = h[5]; - n[6] = h[6]; n[7] = xor1(n[7],h[7]); - uint64_t tmp[8]; - tmp[0] = xor1(ROUND_ELT(sharedMemory, h, 0, 7, 6, 5, 4, 3, 2, 1),InitVector_RC[0]); - tmp[1] = ROUND_ELT(sharedMemory, h, 1, 0, 7, 6, 5, 4, 3, 2); - tmp[2] = ROUND_ELT(sharedMemory, h, 2, 1, 0, 7, 6, 5, 4, 3); - tmp[3] = ROUND_ELT(sharedMemory, h, 3, 2, 1, 0, 7, 6, 5, 4); - tmp[4] = ROUND_ELT(sharedMemory, h, 4, 3, 2, 1, 0, 7, 6, 5); - tmp[5] = ROUND_ELT(sharedMemory, h, 5, 4, 3, 2, 1, 0, 7, 6); - tmp[6] = ROUND_ELT(sharedMemory, h, 6, 5, 4, 3, 2, 1, 0, 7); - tmp[7] = ROUND_ELT(sharedMemory, h, 7, 6, 5, 4, 3, 2, 1, 0); - - uint64_t tmp2[8]; - uint32_t* n32 = (uint32_t*)n; - tmp2[0]=xor8( sharedMemory[__byte_perm(n32[ 0], 0, 0x4440)] ,sharedMemory[__byte_perm(n32[14], 0, 0x4441) + 256], - sharedMemory[__byte_perm(n32[12], 0, 0x4442) + 512] ,sharedMemory[__byte_perm(n32[10], 0, 0x4443) + 768], - sharedMemory[__byte_perm(n32[ 9], 0, 0x4440) + 1024] ,sharedMemory[__byte_perm(n32[ 7], 0, 0x4441) + 1280], - sharedMemory[__byte_perm(n32[ 5], 0, 0x4442) + 1536] ,tmp[0]); - - tmp2[1]=xor8( tmp[1] ,sharedMemory[__byte_perm(n32[ 0], 0, 0x4441) + 256], - sharedMemory[__byte_perm(n32[14], 0, 0x4442) + 512] ,sharedMemory[__byte_perm(n32[12], 0, 0x4443) + 768], - sharedMemory[__byte_perm(n32[11], 0, 0x4440) + 1024] ,sharedMemory[__byte_perm(n32[ 9], 0, 0x4441) + 1280], - sharedMemory[__byte_perm(n32[ 7], 0, 0x4442) + 1536] ,sharedMemory[__byte_perm(n32[ 5], 0, 0x4443) + 1792]); - - tmp2[2]=xor8( sharedMemory[__byte_perm(n32[ 4], 0, 0x4440)] ,tmp[2] , - sharedMemory[__byte_perm(n32[ 0], 0, 0x4442) + 512] ,sharedMemory[__byte_perm(n32[14], 0, 0x4443) + 768], - sharedMemory[__byte_perm(n32[13], 0, 0x4440) + 1024] ,sharedMemory[__byte_perm(n32[11], 0, 0x4441) + 1280], - sharedMemory[__byte_perm(n32[ 9], 0, 0x4442) + 1536] ,sharedMemory[__byte_perm(n32[ 7], 0, 0x4443) + 1792]); - - tmp2[3]=xor8( sharedMemory[__byte_perm(n32[ 6], 0, 0x4440)] ,sharedMemory[__byte_perm(n32[ 4], 0, 0x4441) + 256], - tmp[3] ,sharedMemory[__byte_perm(n32[ 0], 0, 0x4443) + 768], - sharedMemory[__byte_perm(n32[15], 0, 0x4440) + 1024] ,sharedMemory[__byte_perm(n32[13], 0, 0x4441) + 1280], - sharedMemory[__byte_perm(n32[11], 0, 0x4442) + 1536] ,sharedMemory[__byte_perm(n32[ 9], 0, 0x4443) + 1792]); - - tmp2[4]=xor8( sharedMemory[__byte_perm(n32[ 8], 0, 0x4440)] ,sharedMemory[__byte_perm(n32[ 6], 0, 0x4441) + 256] , - sharedMemory[__byte_perm(n32[ 4], 0, 0x4442) + 512] ,tmp[4] , - sharedMemory[__byte_perm(n32[ 1], 0, 0x4440) + 1024] ,sharedMemory[__byte_perm(n32[15], 0, 0x4441) + 1280] , - sharedMemory[__byte_perm(n32[13], 0, 0x4442) + 1536] ,sharedMemory[__byte_perm(n32[11], 0, 0x4443) + 1792]); - - tmp2[5]=xor8( sharedMemory[__byte_perm(n32[10], 0, 0x4440)] ,sharedMemory[__byte_perm(n32[ 8], 0, 0x4441) + 256], - sharedMemory[__byte_perm(n32[ 6], 0, 0x4442) + 512] ,sharedMemory[__byte_perm(n32[ 4], 0, 0x4443) + 768], - tmp[5] ,sharedMemory[__byte_perm(n32[ 1], 0, 0x4441) + 1280], - sharedMemory[__byte_perm(n32[15], 0, 0x4442) + 1536] ,sharedMemory[__byte_perm(n32[13], 0, 0x4443) + 1792]); - - tmp2[6]=xor8( sharedMemory[__byte_perm(n32[12], 0, 0x4440)] ,sharedMemory[__byte_perm(n32[10], 0, 0x4441) + 256], - sharedMemory[__byte_perm(n32[ 8], 0, 0x4442) + 512] ,sharedMemory[__byte_perm(n32[ 6], 0, 0x4443) + 768], - sharedMemory[__byte_perm(n32[ 5], 0, 0x4440) + 1024] ,tmp[6], - sharedMemory[__byte_perm(n32[ 1], 0, 0x4442) + 1536] ,sharedMemory[__byte_perm(n32[15], 0, 0x4443) + 1792]); - - tmp2[7]=xor8( sharedMemory[__byte_perm(n32[14], 0, 0x4440)] ,sharedMemory[__byte_perm(n32[12], 0, 0x4441) + 256], - sharedMemory[__byte_perm(n32[10], 0, 0x4442) + 512] ,sharedMemory[__byte_perm(n32[ 8], 0, 0x4443) + 768], - sharedMemory[__byte_perm(n32[ 7], 0, 0x4440) + 1024] ,sharedMemory[__byte_perm(n32[ 5], 0, 0x4441) + 1280], - tmp[7] ,sharedMemory[__byte_perm(n32[ 1], 0, 0x4443) + 1792]); - - n[1] ^= h[1]; - tmp2[1]^=sharedMemory[__byte_perm(n32[2], 0, 0x4440)]; - tmp2[2]^=sharedMemory[__byte_perm(n32[2], 0, 0x4441) + 256]; - tmp2[3]^=sharedMemory[__byte_perm(n32[2], 0, 0x4442) + 512]; - tmp2[4]^=sharedMemory[__byte_perm(n32[2], 0, 0x4443) + 768]; - - d_tmp[threadIdx.x]=tmp2[threadIdx.x]; - - uint64_t tmp3[8]; - tmp3[0] = xor1(ROUND_ELT(sharedMemory, tmp, 0, 7, 6, 5, 4, 3, 2, 1), InitVector_RC[1]); - tmp3[1] = ROUND_ELT(sharedMemory, tmp, 1, 0, 7, 6, 5, 4, 3, 2); - tmp3[2] = ROUND_ELT(sharedMemory, tmp, 2, 1, 0, 7, 6, 5, 4, 3); - tmp3[3] = ROUND_ELT(sharedMemory, tmp, 3, 2, 1, 0, 7, 6, 5, 4); - tmp3[4] = ROUND_ELT(sharedMemory, tmp, 4, 3, 2, 1, 0, 7, 6, 5); - tmp3[5] = ROUND_ELT(sharedMemory, tmp, 5, 4, 3, 2, 1, 0, 7, 6); - tmp3[6] = ROUND_ELT(sharedMemory, tmp, 6, 5, 4, 3, 2, 1, 0, 7); - tmp3[7] = ROUND_ELT(sharedMemory, tmp, 7, 6, 5, 4, 3, 2, 1, 0); - - n32 = (uint32_t*)tmp2; - uint64_t tmp4[8]; - tmp4[0]=( sharedMemory[__byte_perm(n32[ 9], 0, 0x4440) + 1024] ^sharedMemory[__byte_perm(n32[ 7], 0, 0x4441) + 1280]^ - sharedMemory[__byte_perm(n32[ 5], 0, 0x4442) + 1536] ^sharedMemory[__byte_perm(n32[ 3], 0, 0x4443) + 1792]) ^tmp3[0]; - - tmp4[1]=(sharedMemory[__byte_perm(n32[ 2], 0, 0x4440)] ^sharedMemory[__byte_perm(n32[ 9], 0, 0x4441) + 1280]^ - sharedMemory[__byte_perm(n32[ 7], 0, 0x4442) + 1536] ^sharedMemory[__byte_perm(n32[ 5], 0, 0x4443) + 1792]) ^tmp3[1]; - - tmp4[2]=(sharedMemory[__byte_perm(n32[ 4], 0, 0x4440)] ^sharedMemory[__byte_perm(n32[ 2], 0, 0x4441) + 256]^ - sharedMemory[__byte_perm(n32[ 9], 0, 0x4442) + 1536] ^sharedMemory[__byte_perm(n32[ 7], 0, 0x4443) + 1792]) ^tmp3[2]; - - tmp4[3]=(sharedMemory[__byte_perm(n32[ 6], 0, 0x4440)] ^sharedMemory[__byte_perm(n32[ 4], 0, 0x4441) + 256]^ - sharedMemory[__byte_perm(n32[ 2], 0, 0x4442) + 512] ^sharedMemory[__byte_perm(n32[ 9], 0, 0x4443) + 1792]) ^tmp3[3]; - - tmp4[4]=(sharedMemory[__byte_perm(n32[ 8], 0, 0x4440)] ^sharedMemory[__byte_perm(n32[ 6], 0, 0x4441) + 256]^ - sharedMemory[__byte_perm(n32[ 4], 0, 0x4442) + 512] ^sharedMemory[__byte_perm(n32[ 2], 0, 0x4443) + 768]) ^tmp3[4]; - - tmp4[5]=(sharedMemory[__byte_perm(n32[ 8], 0, 0x4441) + 256] ^sharedMemory[__byte_perm(n32[ 6], 0, 0x4442) + 512]^ - sharedMemory[__byte_perm(n32[ 4], 0, 0x4443) + 768] ^sharedMemory[__byte_perm(n32[ 3], 0, 0x4440) + 1024]) ^tmp3[5]; - - tmp4[6]=(sharedMemory[__byte_perm(n32[ 8], 0, 0x4442) + 512] ^sharedMemory[__byte_perm(n32[ 6], 0, 0x4443) + 768]^ - sharedMemory[__byte_perm(n32[ 5], 0, 0x4440) + 1024] ^sharedMemory[__byte_perm(n32[ 3], 0, 0x4441) + 1280]) ^tmp3[6]; - - tmp4[7]=(sharedMemory[__byte_perm(n32[ 8], 0, 0x4443) + 768] ^sharedMemory[__byte_perm(n32[ 7], 0, 0x4440) + 1024]^ - sharedMemory[__byte_perm(n32[ 5], 0, 0x4441) + 1280] ^sharedMemory[__byte_perm(n32[ 3], 0, 0x4442) + 1536]) ^tmp3[7]; - - d_tmp[threadIdx.x+16]=tmp4[threadIdx.x]; - - uint64_t tmp5[8]; - tmp5[0] = xor1(ROUND_ELT(sharedMemory, tmp3, 0, 7, 6, 5, 4, 3, 2, 1), InitVector_RC[2]); - tmp5[1] = ROUND_ELT(sharedMemory, tmp3, 1, 0, 7, 6, 5, 4, 3, 2); - tmp5[2] = ROUND_ELT(sharedMemory, tmp3, 2, 1, 0, 7, 6, 5, 4, 3); - tmp5[3] = ROUND_ELT(sharedMemory, tmp3, 3, 2, 1, 0, 7, 6, 5, 4); - tmp5[4] = ROUND_ELT(sharedMemory, tmp3, 4, 3, 2, 1, 0, 7, 6, 5); - tmp5[5] = ROUND_ELT(sharedMemory, tmp3, 5, 4, 3, 2, 1, 0, 7, 6); - tmp5[6] = ROUND_ELT(sharedMemory, tmp3, 6, 5, 4, 3, 2, 1, 0, 7); - tmp5[7] = ROUND_ELT(sharedMemory, tmp3, 7, 6, 5, 4, 3, 2, 1, 0); - - d_tmp[threadIdx.x+8]=tmp5[threadIdx.x]; - - uint64_t tmp6[8]; - tmp6[0] = xor1(ROUND_ELT(sharedMemory, tmp5, 0, 7, 6, 5, 4, 3, 2, 1), InitVector_RC[3]); - tmp6[1] = ROUND_ELT(sharedMemory, tmp5, 1, 0, 7, 6, 5, 4, 3, 2); - tmp6[2] = ROUND_ELT(sharedMemory, tmp5, 2, 1, 0, 7, 6, 5, 4, 3); - tmp6[3] = ROUND_ELT(sharedMemory, tmp5, 3, 2, 1, 0, 7, 6, 5, 4); - tmp6[4] = ROUND_ELT(sharedMemory, tmp5, 4, 3, 2, 1, 0, 7, 6, 5); - tmp6[5] = ROUND_ELT(sharedMemory, tmp5, 5, 4, 3, 2, 1, 0, 7, 6); - tmp6[6] = ROUND_ELT(sharedMemory, tmp5, 6, 5, 4, 3, 2, 1, 0, 7); - tmp6[7] = ROUND_ELT(sharedMemory, tmp5, 7, 6, 5, 4, 3, 2, 1, 0); - - d_tmp[threadIdx.x+24]=tmp6[threadIdx.x]; - - uint64_t tmp7[8]; - tmp7[0] = xor1(ROUND_ELT(sharedMemory, tmp6, 0, 7, 6, 5, 4, 3, 2, 1), InitVector_RC[4]); - tmp7[1] = ROUND_ELT(sharedMemory, tmp6, 1, 0, 7, 6, 5, 4, 3, 2); - tmp7[2] = ROUND_ELT(sharedMemory, tmp6, 2, 1, 0, 7, 6, 5, 4, 3); - tmp7[3] = ROUND_ELT(sharedMemory, tmp6, 3, 2, 1, 0, 7, 6, 5, 4); - tmp7[4] = ROUND_ELT(sharedMemory, tmp6, 4, 3, 2, 1, 0, 7, 6, 5); - tmp7[5] = ROUND_ELT(sharedMemory, tmp6, 5, 4, 3, 2, 1, 0, 7, 6); - tmp7[6] = ROUND_ELT(sharedMemory, tmp6, 6, 5, 4, 3, 2, 1, 0, 7); - tmp7[7] = ROUND_ELT(sharedMemory, tmp6, 7, 6, 5, 4, 3, 2, 1, 0); - - d_tmp[threadIdx.x+32]=tmp7[threadIdx.x]; - - uint64_t tmp8[8]; - tmp8[0] = xor1(ROUND_ELT(sharedMemory, tmp7, 0, 7, 6, 5, 4, 3, 2, 1), InitVector_RC[5]); - tmp8[1] = ROUND_ELT(sharedMemory, tmp7, 1, 0, 7, 6, 5, 4, 3, 2); - tmp8[2] = ROUND_ELT(sharedMemory, tmp7, 2, 1, 0, 7, 6, 5, 4, 3); - tmp8[3] = ROUND_ELT(sharedMemory, tmp7, 3, 2, 1, 0, 7, 6, 5, 4); - tmp8[4] = ROUND_ELT(sharedMemory, tmp7, 4, 3, 2, 1, 0, 7, 6, 5); - tmp8[5] = ROUND_ELT(sharedMemory, tmp7, 5, 4, 3, 2, 1, 0, 7, 6); - tmp8[6] = ROUND_ELT(sharedMemory, tmp7, 6, 5, 4, 3, 2, 1, 0, 7); - tmp8[7] = ROUND_ELT(sharedMemory, tmp7, 7, 6, 5, 4, 3, 2, 1, 0); - - d_tmp[threadIdx.x+40]=tmp8[threadIdx.x]; - - uint64_t tmp9[8]; - tmp9[0] = xor1(ROUND_ELT(sharedMemory, tmp8, 0, 7, 6, 5, 4, 3, 2, 1), InitVector_RC[6]); - tmp9[1] = ROUND_ELT(sharedMemory, tmp8, 1, 0, 7, 6, 5, 4, 3, 2); - tmp9[2] = ROUND_ELT(sharedMemory, tmp8, 2, 1, 0, 7, 6, 5, 4, 3); - tmp9[3] = ROUND_ELT(sharedMemory, tmp8, 3, 2, 1, 0, 7, 6, 5, 4); - tmp9[4] = ROUND_ELT(sharedMemory, tmp8, 4, 3, 2, 1, 0, 7, 6, 5); - tmp9[5] = ROUND_ELT(sharedMemory, tmp8, 5, 4, 3, 2, 1, 0, 7, 6); - tmp9[6] = ROUND_ELT(sharedMemory, tmp8, 6, 5, 4, 3, 2, 1, 0, 7); - tmp9[7] = ROUND_ELT(sharedMemory, tmp8, 7, 6, 5, 4, 3, 2, 1, 0); - - d_tmp[threadIdx.x+48]=tmp9[threadIdx.x]; - - uint64_t tmp10[8]; - tmp10[0] = xor1(ROUND_ELT(sharedMemory, tmp9, 0, 7, 6, 5, 4, 3, 2, 1), InitVector_RC[7]); - tmp10[1] = ROUND_ELT(sharedMemory, tmp9, 1, 0, 7, 6, 5, 4, 3, 2); - tmp10[2] = ROUND_ELT(sharedMemory, tmp9, 2, 1, 0, 7, 6, 5, 4, 3); - tmp10[3] = ROUND_ELT(sharedMemory, tmp9, 3, 2, 1, 0, 7, 6, 5, 4); - tmp10[4] = ROUND_ELT(sharedMemory, tmp9, 4, 3, 2, 1, 0, 7, 6, 5); - tmp10[5] = ROUND_ELT(sharedMemory, tmp9, 5, 4, 3, 2, 1, 0, 7, 6); - tmp10[6] = ROUND_ELT(sharedMemory, tmp9, 6, 5, 4, 3, 2, 1, 0, 7); - tmp10[7] = ROUND_ELT(sharedMemory, tmp9, 7, 6, 5, 4, 3, 2, 1, 0); - - - d_tmp[threadIdx.x+56]=tmp10[threadIdx.x]; - - uint64_t tmp11[8]; - tmp11[0] = xor1(ROUND_ELT(sharedMemory, tmp10, 0, 7, 6, 5, 4, 3, 2, 1), InitVector_RC[8]); - tmp11[1] = ROUND_ELT(sharedMemory, tmp10, 1, 0, 7, 6, 5, 4, 3, 2); - tmp11[2] = ROUND_ELT(sharedMemory, tmp10, 2, 1, 0, 7, 6, 5, 4, 3); - tmp11[3] = ROUND_ELT(sharedMemory, tmp10, 3, 2, 1, 0, 7, 6, 5, 4); - tmp11[4] = ROUND_ELT(sharedMemory, tmp10, 4, 3, 2, 1, 0, 7, 6, 5); - tmp11[5] = ROUND_ELT(sharedMemory, tmp10, 5, 4, 3, 2, 1, 0, 7, 6); - tmp11[6] = ROUND_ELT(sharedMemory, tmp10, 6, 5, 4, 3, 2, 1, 0, 7); - tmp11[7] = ROUND_ELT(sharedMemory, tmp10, 7, 6, 5, 4, 3, 2, 1, 0); - - d_tmp[threadIdx.x+64]=tmp11[threadIdx.x]; - - if(threadIdx.x==1){ - tmp[0]=ROUND_ELT(sharedMemory,tmp11, 3, 2, 1, 0, 7, 6, 5, 4); - tmp[1]=ROUND_ELT(sharedMemory,tmp11, 5, 4, 3, 2, 1, 0, 7, 6); - tmp[4] = xor3(tmp[0],tmp[1],atLastCalc); - d_xtra[threadIdx.x]=tmp[4]; - } - } -} - -__global__ __launch_bounds__(threadsPerBlock,2) -void whirlpoolx_gpu_hash(uint32_t threads, uint32_t startNounce, uint32_t *resNounce) -{ - __shared__ uint64_t sharedMemory[2048]; - - whirlpoolx_getShared(sharedMemory); - - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint64_t n[8]; - uint64_t tmp[8]; - uint32_t nounce = startNounce + thread; - - n[1] = xor1(REPLACE_HIDWORD(c_PaddedMessage80[9], cuda_swab32(nounce)),c_xtra[0]); - - uint32_t* n32 = (uint32_t*)&n[0]; - n[0]=sharedMemory[__byte_perm(n32[3], 0, 0x4443) + 1792]; - n[5]=sharedMemory[__byte_perm(n32[3], 0, 0x4440) + 1024]; - n[6]=sharedMemory[__byte_perm(n32[3], 0, 0x4441) + 1280]; - n[7]=sharedMemory[__byte_perm(n32[3], 0, 0x4442) + 1536]; - n[0]=xor1(c_tmp[0],n[0]); - n[1]=c_tmp[1]; - n[2]=c_tmp[2]; - n[3]=c_tmp[3]; - n[4]=c_tmp[4]; - n[5]=xor1(c_tmp[5],n[5]); - n[6]=xor1(c_tmp[6],n[6]); - n[7]=xor1(c_tmp[7],n[7]); - - tmp[0]=xor3(sharedMemory[__byte_perm(n32[10],0,0x4443)+768],sharedMemory[__byte_perm(n32[12],0,0x4442)+512],sharedMemory[__byte_perm(n32[14],0,0x4441)+256]); - tmp[1]=xor3(sharedMemory[__byte_perm(n32[11],0,0x4440)+1024],sharedMemory[__byte_perm(n32[12],0,0x4443)+768],sharedMemory[__byte_perm(n32[14],0,0x4442)+512]); - tmp[2]=xor3(sharedMemory[__byte_perm(n32[11],0,0x4441)+1280],sharedMemory[__byte_perm(n32[13],0,0x4440)+1024],sharedMemory[__byte_perm(n32[14],0,0x4443)+768]); - tmp[3]=xor3(sharedMemory[__byte_perm(n32[11],0,0x4442)+1536],sharedMemory[__byte_perm(n32[13],0,0x4441)+1280],sharedMemory[__byte_perm(n32[15],0,0x4440)+1024]); - tmp[4]=xor3(sharedMemory[__byte_perm(n32[11],0,0x4443)+1792],sharedMemory[__byte_perm(n32[13],0,0x4442)+1536],sharedMemory[__byte_perm(n32[15],0,0x4441)+1280]); - tmp[5]=xor3(sharedMemory[__byte_perm(n32[10],0,0x4440)],sharedMemory[__byte_perm(n32[13],0,0x4443)+1792],sharedMemory[__byte_perm(n32[15],0,0x4442)+1536]); - tmp[6]=xor3(sharedMemory[__byte_perm(n32[12],0,0x4440)],sharedMemory[__byte_perm(n32[10],0,0x4441)+256],sharedMemory[__byte_perm(n32[15],0,0x4443)+1792]); - tmp[7]=xor3(sharedMemory[__byte_perm(n32[14],0,0x4440)],sharedMemory[__byte_perm(n32[12],0,0x4441)+256],sharedMemory[__byte_perm(n32[10],0,0x4442)+ 512]); - - tmp[0]=xor3(sharedMemory[__byte_perm(n32[ 0], 0, 0x4440)],tmp[0],c_tmp[0+16]); - tmp[1]=xor3(sharedMemory[__byte_perm(n32[ 0], 0, 0x4441) + 256],tmp[1],c_tmp[1+16]); - tmp[2]=xor3(sharedMemory[__byte_perm(n32[ 0], 0, 0x4442) + 512],tmp[2],c_tmp[2+16]); - tmp[3]=xor3(sharedMemory[__byte_perm(n32[ 0], 0, 0x4443) + 768],tmp[3],c_tmp[3+16]); - tmp[4]=xor3(sharedMemory[__byte_perm(n32[ 1], 0, 0x4440) + 1024],tmp[4],c_tmp[4+16]); - tmp[5]=xor3(sharedMemory[__byte_perm(n32[ 1], 0, 0x4441) + 1280],tmp[5],c_tmp[5+16]); - tmp[6]=xor3(sharedMemory[__byte_perm(n32[ 1], 0, 0x4442) + 1536],tmp[6],c_tmp[6+16]); - tmp[7]=xor3(sharedMemory[__byte_perm(n32[ 1], 0, 0x4443) + 1792],tmp[7],c_tmp[7+16]); - - n[0]=tmp[0]; - n[1]=tmp[1]; - n[2]=tmp[2]; - n[3]=tmp[3]; - n[4]=tmp[4]; - n[5]=tmp[5]; - n[6]=tmp[6]; - n[7]=tmp[7]; - - tmp[0] = xor1(ROUND_ELT(sharedMemory, n, 0, 7, 6, 5, 4, 3, 2, 1), c_tmp[0+8]); - tmp[1] = xor1(ROUND_ELT(sharedMemory, n, 1, 0, 7, 6, 5, 4, 3, 2), c_tmp[1+8]); - tmp[2] = xor1(ROUND_ELT(sharedMemory, n, 2, 1, 0, 7, 6, 5, 4, 3), c_tmp[2+8]); - tmp[3] = xor1(ROUND_ELT(sharedMemory, n, 3, 2, 1, 0, 7, 6, 5, 4), c_tmp[3+8]); - tmp[4] = xor1(ROUND_ELT(sharedMemory, n, 4, 3, 2, 1, 0, 7, 6, 5), c_tmp[4+8]); - tmp[5] = xor1(ROUND_ELT(sharedMemory, n, 5, 4, 3, 2, 1, 0, 7, 6), c_tmp[5+8]); - tmp[6] = xor1(ROUND_ELT(sharedMemory, n, 6, 5, 4, 3, 2, 1, 0, 7), c_tmp[6+8]); - tmp[7] = xor1(ROUND_ELT(sharedMemory, n, 7, 6, 5, 4, 3, 2, 1, 0), c_tmp[7+8]); - - n[0] = xor1(ROUND_ELT(sharedMemory, tmp, 0, 7, 6, 5, 4, 3, 2, 1), c_tmp[0+24]); - n[1] = xor1(ROUND_ELT(sharedMemory, tmp, 1, 0, 7, 6, 5, 4, 3, 2), c_tmp[1+24]); - n[2] = xor1(ROUND_ELT(sharedMemory, tmp, 2, 1, 0, 7, 6, 5, 4, 3), c_tmp[2+24]); - n[3] = xor1(ROUND_ELT(sharedMemory, tmp, 3, 2, 1, 0, 7, 6, 5, 4), c_tmp[3+24]); - n[4] = xor1(ROUND_ELT(sharedMemory, tmp, 4, 3, 2, 1, 0, 7, 6, 5), c_tmp[4+24]); - n[5] = xor1(ROUND_ELT(sharedMemory, tmp, 5, 4, 3, 2, 1, 0, 7, 6), c_tmp[5+24]); - n[6] = xor1(ROUND_ELT(sharedMemory, tmp, 6, 5, 4, 3, 2, 1, 0, 7), c_tmp[6+24]); - n[7] = xor1(ROUND_ELT(sharedMemory, tmp, 7, 6, 5, 4, 3, 2, 1, 0), c_tmp[7+24]); - - tmp[0] = xor1(ROUND_ELT(sharedMemory, n, 0, 7, 6, 5, 4, 3, 2, 1), c_tmp[0+32]); - tmp[1] = xor1(ROUND_ELT(sharedMemory, n, 1, 0, 7, 6, 5, 4, 3, 2), c_tmp[1+32]); - tmp[2] = xor1(ROUND_ELT(sharedMemory, n, 2, 1, 0, 7, 6, 5, 4, 3), c_tmp[2+32]); - tmp[3] = xor1(ROUND_ELT(sharedMemory, n, 3, 2, 1, 0, 7, 6, 5, 4), c_tmp[3+32]); - tmp[4] = xor1(ROUND_ELT(sharedMemory, n, 4, 3, 2, 1, 0, 7, 6, 5), c_tmp[4+32]); - tmp[5] = xor1(ROUND_ELT(sharedMemory, n, 5, 4, 3, 2, 1, 0, 7, 6), c_tmp[5+32]); - tmp[6] = xor1(ROUND_ELT(sharedMemory, n, 6, 5, 4, 3, 2, 1, 0, 7), c_tmp[6+32]); - tmp[7] = xor1(ROUND_ELT(sharedMemory, n, 7, 6, 5, 4, 3, 2, 1, 0), c_tmp[7+32]); - - n[0] = xor1(ROUND_ELT(sharedMemory, tmp, 0, 7, 6, 5, 4, 3, 2, 1), c_tmp[0+40]); - n[1] = xor1(ROUND_ELT(sharedMemory, tmp, 1, 0, 7, 6, 5, 4, 3, 2), c_tmp[1+40]); - n[2] = xor1(ROUND_ELT(sharedMemory, tmp, 2, 1, 0, 7, 6, 5, 4, 3), c_tmp[2+40]); - n[3] = xor1(ROUND_ELT(sharedMemory, tmp, 3, 2, 1, 0, 7, 6, 5, 4), c_tmp[3+40]); - n[4] = xor1(ROUND_ELT(sharedMemory, tmp, 4, 3, 2, 1, 0, 7, 6, 5), c_tmp[4+40]); - n[5] = xor1(ROUND_ELT(sharedMemory, tmp, 5, 4, 3, 2, 1, 0, 7, 6), c_tmp[5+40]); - n[6] = xor1(ROUND_ELT(sharedMemory, tmp, 6, 5, 4, 3, 2, 1, 0, 7), c_tmp[6+40]); - n[7] = xor1(ROUND_ELT(sharedMemory, tmp, 7, 6, 5, 4, 3, 2, 1, 0), c_tmp[7+40]); - - tmp[0] = xor1(ROUND_ELT(sharedMemory, n, 0, 7, 6, 5, 4, 3, 2, 1), c_tmp[0+48]); - tmp[1] = xor1(ROUND_ELT(sharedMemory, n, 1, 0, 7, 6, 5, 4, 3, 2), c_tmp[1+48]); - tmp[2] = xor1(ROUND_ELT(sharedMemory, n, 2, 1, 0, 7, 6, 5, 4, 3), c_tmp[2+48]); - tmp[3] = xor1(ROUND_ELT(sharedMemory, n, 3, 2, 1, 0, 7, 6, 5, 4), c_tmp[3+48]); - tmp[4] = xor1(ROUND_ELT(sharedMemory, n, 4, 3, 2, 1, 0, 7, 6, 5), c_tmp[4+48]); - tmp[5] = xor1(ROUND_ELT(sharedMemory, n, 5, 4, 3, 2, 1, 0, 7, 6), c_tmp[5+48]); - tmp[6] = xor1(ROUND_ELT(sharedMemory, n, 6, 5, 4, 3, 2, 1, 0, 7), c_tmp[6+48]); - tmp[7] = xor1(ROUND_ELT(sharedMemory, n, 7, 6, 5, 4, 3, 2, 1, 0), c_tmp[7+48]); - - n[0] = xor1(ROUND_ELT(sharedMemory, tmp, 0, 7, 6, 5, 4, 3, 2, 1), c_tmp[0+56]); - n[1] = xor1(ROUND_ELT(sharedMemory, tmp, 1, 0, 7, 6, 5, 4, 3, 2), c_tmp[1+56]); - n[2] = xor1(ROUND_ELT(sharedMemory, tmp, 2, 1, 0, 7, 6, 5, 4, 3), c_tmp[2+56]); - n[3] = xor1(ROUND_ELT(sharedMemory, tmp, 3, 2, 1, 0, 7, 6, 5, 4), c_tmp[3+56]); - n[4] = xor1(ROUND_ELT(sharedMemory, tmp, 4, 3, 2, 1, 0, 7, 6, 5), c_tmp[4+56]); - n[5] = xor1(ROUND_ELT(sharedMemory, tmp, 5, 4, 3, 2, 1, 0, 7, 6), c_tmp[5+56]); - n[6] = xor1(ROUND_ELT(sharedMemory, tmp, 6, 5, 4, 3, 2, 1, 0, 7), c_tmp[6+56]); - n[7] = xor1(ROUND_ELT(sharedMemory, tmp, 7, 6, 5, 4, 3, 2, 1, 0), c_tmp[7+56]); - - tmp[0] = xor1(ROUND_ELT(sharedMemory, n, 0, 7, 6, 5, 4, 3, 2, 1), c_tmp[0+64]); - tmp[1] = xor1(ROUND_ELT(sharedMemory, n, 1, 0, 7, 6, 5, 4, 3, 2), c_tmp[1+64]); - tmp[2] = xor1(ROUND_ELT(sharedMemory, n, 2, 1, 0, 7, 6, 5, 4, 3), c_tmp[2+64]); - tmp[3] = xor1(ROUND_ELT(sharedMemory, n, 3, 2, 1, 0, 7, 6, 5, 4), c_tmp[3+64]); - tmp[4] = xor1(ROUND_ELT(sharedMemory, n, 4, 3, 2, 1, 0, 7, 6, 5), c_tmp[4+64]); - tmp[5] = xor1(ROUND_ELT(sharedMemory, n, 5, 4, 3, 2, 1, 0, 7, 6), c_tmp[5+64]); - tmp[6] = xor1(ROUND_ELT(sharedMemory, n, 6, 5, 4, 3, 2, 1, 0, 7), c_tmp[6+64]); - tmp[7] = xor1(ROUND_ELT(sharedMemory, n, 7, 6, 5, 4, 3, 2, 1, 0), c_tmp[7+64]); - - if (xor3(c_xtra[1], ROUND_ELT(sharedMemory, tmp, 3, 2, 1, 0, 7, 6, 5, 4), ROUND_ELT(sharedMemory, tmp, 5, 4, 3, 2, 1, 0, 7, 6)) <= pTarget[3]) { - atomicMin(&resNounce[0], nounce); - } - } -} - -__host__ -extern void whirlpoolx_cpu_init(int thr_id, uint32_t threads) -{ - cudaMemcpyToSymbol(InitVector_RC, plain_RC, sizeof(plain_RC), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(mixTob0Tox, plain_T0, sizeof(plain_T0), 0, cudaMemcpyHostToDevice); - cudaMalloc(&d_WXNonce[thr_id], sizeof(uint32_t)); - cudaMallocHost(&h_wxnounce[thr_id], sizeof(uint32_t)); - cudaMalloc(&d_xtra[thr_id], 8 * sizeof(uint64_t)); - CUDA_SAFE_CALL(cudaMalloc(&d_tmp[thr_id], 8 * 9 * sizeof(uint64_t))); // d_tmp[threadIdx.x+64] (7+64) -} - -__host__ -extern void whirlpoolx_cpu_free(int thr_id) -{ - cudaFree(d_WXNonce[thr_id]); - cudaFreeHost(h_wxnounce[thr_id]); - cudaFree(d_xtra[thr_id]); - cudaFree(d_tmp[thr_id]); -} - -__host__ -void whirlpoolx_setBlock_80(void *pdata, const void *ptarget) -{ - uint64_t PaddedMessage[16]; - memcpy(PaddedMessage, pdata, 80); - memset((uint8_t*)&PaddedMessage+80, 0, 48); - ((uint8_t*)PaddedMessage)[80] = 0x80; /* ending */ - cudaMemcpyToSymbol(pTarget, ptarget, 4*sizeof(uint64_t), 0, cudaMemcpyHostToDevice); - CUDA_SAFE_CALL(cudaMemcpyToSymbol(c_PaddedMessage80, PaddedMessage, 16 * sizeof(uint64_t), 0, cudaMemcpyHostToDevice)); -} - -__host__ -void whirlpoolx_precompute(int thr_id) -{ - dim3 grid(1); - dim3 block(256); - - whirlpoolx_gpu_precompute <<>>(8, d_xtra[thr_id], d_tmp[thr_id]); - cudaThreadSynchronize(); - - cudaMemcpyToSymbol(c_xtra, d_xtra[thr_id], 8 * sizeof(uint64_t), 0, cudaMemcpyDeviceToDevice); - CUDA_SAFE_CALL(cudaMemcpyToSymbol(c_tmp, d_tmp[thr_id], 8 * 9 * sizeof(uint64_t), 0, cudaMemcpyDeviceToDevice)); -} - -__host__ -uint32_t whirlpoolx_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce) -{ - dim3 grid((threads + threadsPerBlock-1) / threadsPerBlock); - dim3 block(threadsPerBlock); - - cudaMemset(d_WXNonce[thr_id], 0xff, sizeof(uint32_t)); - - whirlpoolx_gpu_hash<<>>(threads, startNounce, d_WXNonce[thr_id]); - cudaThreadSynchronize(); - - cudaMemcpy(h_wxnounce[thr_id], d_WXNonce[thr_id], sizeof(uint32_t), cudaMemcpyDeviceToHost); - - return *(h_wxnounce[thr_id]); -} diff --git a/x15/cuda_x14_shabal512.cu b/x15/cuda_x14_shabal512.cu deleted file mode 100644 index 43c5ebf1..00000000 --- a/x15/cuda_x14_shabal512.cu +++ /dev/null @@ -1,475 +0,0 @@ -/* - * Shabal-512 for X14/X15 - */ -#include "cuda_helper.h" - -/* $Id: shabal.c 175 2010-05-07 16:03:20Z tp $ */ -/* - * Shabal implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -/* - * Part of this code was automatically generated (the part between - * the "BEGIN" and "END" markers). - */ - -#define sM 16 - -#define C32 SPH_C32 -#define T32 SPH_T32 - -#define O1 13 -#define O2 9 -#define O3 6 - -/* - * We copy the state into local variables, so that the compiler knows - * that it can optimize them at will. - */ - -/* BEGIN -- automatically generated code. */ - -#define INPUT_BLOCK_ADD do { \ - B0 = T32(B0 + M0); \ - B1 = T32(B1 + M1); \ - B2 = T32(B2 + M2); \ - B3 = T32(B3 + M3); \ - B4 = T32(B4 + M4); \ - B5 = T32(B5 + M5); \ - B6 = T32(B6 + M6); \ - B7 = T32(B7 + M7); \ - B8 = T32(B8 + M8); \ - B9 = T32(B9 + M9); \ - BA = T32(BA + MA); \ - BB = T32(BB + MB); \ - BC = T32(BC + MC); \ - BD = T32(BD + MD); \ - BE = T32(BE + ME); \ - BF = T32(BF + MF); \ - } while (0) - -#define INPUT_BLOCK_SUB do { \ - C0 = T32(C0 - M0); \ - C1 = T32(C1 - M1); \ - C2 = T32(C2 - M2); \ - C3 = T32(C3 - M3); \ - C4 = T32(C4 - M4); \ - C5 = T32(C5 - M5); \ - C6 = T32(C6 - M6); \ - C7 = T32(C7 - M7); \ - C8 = T32(C8 - M8); \ - C9 = T32(C9 - M9); \ - CA = T32(CA - MA); \ - CB = T32(CB - MB); \ - CC = T32(CC - MC); \ - CD = T32(CD - MD); \ - CE = T32(CE - ME); \ - CF = T32(CF - MF); \ - } while (0) - -#define XOR_W do { \ - A00 ^= Wlow; \ - A01 ^= Whigh; \ - } while (0) - -#define SWAP(v1, v2) do { \ - uint32_t tmp = (v1); \ - (v1) = (v2); \ - (v2) = tmp; \ - } while (0) - -#define SWAP_BC do { \ - SWAP(B0, C0); \ - SWAP(B1, C1); \ - SWAP(B2, C2); \ - SWAP(B3, C3); \ - SWAP(B4, C4); \ - SWAP(B5, C5); \ - SWAP(B6, C6); \ - SWAP(B7, C7); \ - SWAP(B8, C8); \ - SWAP(B9, C9); \ - SWAP(BA, CA); \ - SWAP(BB, CB); \ - SWAP(BC, CC); \ - SWAP(BD, CD); \ - SWAP(BE, CE); \ - SWAP(BF, CF); \ - } while (0) - -#define PERM_ELT(xa0, xa1, xb0, xb1, xb2, xb3, xc, xm) do { \ - xa0 = T32((xa0 \ - ^ (ROTL32(xa1, 15) * 5U) \ - ^ xc) * 3U) \ - ^ xb1 ^ (xb2 & ~xb3) ^ xm; \ - xb0 = T32(~(ROTL32(xb0, 1) ^ xa0)); \ - } while (0) - -#define PERM_STEP_0 do { \ - PERM_ELT(A00, A0B, B0, BD, B9, B6, C8, M0); \ - PERM_ELT(A01, A00, B1, BE, BA, B7, C7, M1); \ - PERM_ELT(A02, A01, B2, BF, BB, B8, C6, M2); \ - PERM_ELT(A03, A02, B3, B0, BC, B9, C5, M3); \ - PERM_ELT(A04, A03, B4, B1, BD, BA, C4, M4); \ - PERM_ELT(A05, A04, B5, B2, BE, BB, C3, M5); \ - PERM_ELT(A06, A05, B6, B3, BF, BC, C2, M6); \ - PERM_ELT(A07, A06, B7, B4, B0, BD, C1, M7); \ - PERM_ELT(A08, A07, B8, B5, B1, BE, C0, M8); \ - PERM_ELT(A09, A08, B9, B6, B2, BF, CF, M9); \ - PERM_ELT(A0A, A09, BA, B7, B3, B0, CE, MA); \ - PERM_ELT(A0B, A0A, BB, B8, B4, B1, CD, MB); \ - PERM_ELT(A00, A0B, BC, B9, B5, B2, CC, MC); \ - PERM_ELT(A01, A00, BD, BA, B6, B3, CB, MD); \ - PERM_ELT(A02, A01, BE, BB, B7, B4, CA, ME); \ - PERM_ELT(A03, A02, BF, BC, B8, B5, C9, MF); \ - } while (0) - -#define PERM_STEP_1 do { \ - PERM_ELT(A04, A03, B0, BD, B9, B6, C8, M0); \ - PERM_ELT(A05, A04, B1, BE, BA, B7, C7, M1); \ - PERM_ELT(A06, A05, B2, BF, BB, B8, C6, M2); \ - PERM_ELT(A07, A06, B3, B0, BC, B9, C5, M3); \ - PERM_ELT(A08, A07, B4, B1, BD, BA, C4, M4); \ - PERM_ELT(A09, A08, B5, B2, BE, BB, C3, M5); \ - PERM_ELT(A0A, A09, B6, B3, BF, BC, C2, M6); \ - PERM_ELT(A0B, A0A, B7, B4, B0, BD, C1, M7); \ - PERM_ELT(A00, A0B, B8, B5, B1, BE, C0, M8); \ - PERM_ELT(A01, A00, B9, B6, B2, BF, CF, M9); \ - PERM_ELT(A02, A01, BA, B7, B3, B0, CE, MA); \ - PERM_ELT(A03, A02, BB, B8, B4, B1, CD, MB); \ - PERM_ELT(A04, A03, BC, B9, B5, B2, CC, MC); \ - PERM_ELT(A05, A04, BD, BA, B6, B3, CB, MD); \ - PERM_ELT(A06, A05, BE, BB, B7, B4, CA, ME); \ - PERM_ELT(A07, A06, BF, BC, B8, B5, C9, MF); \ - } while (0) - -#define PERM_STEP_2 do { \ - PERM_ELT(A08, A07, B0, BD, B9, B6, C8, M0); \ - PERM_ELT(A09, A08, B1, BE, BA, B7, C7, M1); \ - PERM_ELT(A0A, A09, B2, BF, BB, B8, C6, M2); \ - PERM_ELT(A0B, A0A, B3, B0, BC, B9, C5, M3); \ - PERM_ELT(A00, A0B, B4, B1, BD, BA, C4, M4); \ - PERM_ELT(A01, A00, B5, B2, BE, BB, C3, M5); \ - PERM_ELT(A02, A01, B6, B3, BF, BC, C2, M6); \ - PERM_ELT(A03, A02, B7, B4, B0, BD, C1, M7); \ - PERM_ELT(A04, A03, B8, B5, B1, BE, C0, M8); \ - PERM_ELT(A05, A04, B9, B6, B2, BF, CF, M9); \ - PERM_ELT(A06, A05, BA, B7, B3, B0, CE, MA); \ - PERM_ELT(A07, A06, BB, B8, B4, B1, CD, MB); \ - PERM_ELT(A08, A07, BC, B9, B5, B2, CC, MC); \ - PERM_ELT(A09, A08, BD, BA, B6, B3, CB, MD); \ - PERM_ELT(A0A, A09, BE, BB, B7, B4, CA, ME); \ - PERM_ELT(A0B, A0A, BF, BC, B8, B5, C9, MF); \ - } while (0) - -#define APPLY_P do { \ - B0 = T32(B0 << 17) | (B0 >> 15); \ - B1 = T32(B1 << 17) | (B1 >> 15); \ - B2 = T32(B2 << 17) | (B2 >> 15); \ - B3 = T32(B3 << 17) | (B3 >> 15); \ - B4 = T32(B4 << 17) | (B4 >> 15); \ - B5 = T32(B5 << 17) | (B5 >> 15); \ - B6 = T32(B6 << 17) | (B6 >> 15); \ - B7 = T32(B7 << 17) | (B7 >> 15); \ - B8 = T32(B8 << 17) | (B8 >> 15); \ - B9 = T32(B9 << 17) | (B9 >> 15); \ - BA = T32(BA << 17) | (BA >> 15); \ - BB = T32(BB << 17) | (BB >> 15); \ - BC = T32(BC << 17) | (BC >> 15); \ - BD = T32(BD << 17) | (BD >> 15); \ - BE = T32(BE << 17) | (BE >> 15); \ - BF = T32(BF << 17) | (BF >> 15); \ - PERM_STEP_0; \ - PERM_STEP_1; \ - PERM_STEP_2; \ - A0B = T32(A0B + C6); \ - A0A = T32(A0A + C5); \ - A09 = T32(A09 + C4); \ - A08 = T32(A08 + C3); \ - A07 = T32(A07 + C2); \ - A06 = T32(A06 + C1); \ - A05 = T32(A05 + C0); \ - A04 = T32(A04 + CF); \ - A03 = T32(A03 + CE); \ - A02 = T32(A02 + CD); \ - A01 = T32(A01 + CC); \ - A00 = T32(A00 + CB); \ - A0B = T32(A0B + CA); \ - A0A = T32(A0A + C9); \ - A09 = T32(A09 + C8); \ - A08 = T32(A08 + C7); \ - A07 = T32(A07 + C6); \ - A06 = T32(A06 + C5); \ - A05 = T32(A05 + C4); \ - A04 = T32(A04 + C3); \ - A03 = T32(A03 + C2); \ - A02 = T32(A02 + C1); \ - A01 = T32(A01 + C0); \ - A00 = T32(A00 + CF); \ - A0B = T32(A0B + CE); \ - A0A = T32(A0A + CD); \ - A09 = T32(A09 + CC); \ - A08 = T32(A08 + CB); \ - A07 = T32(A07 + CA); \ - A06 = T32(A06 + C9); \ - A05 = T32(A05 + C8); \ - A04 = T32(A04 + C7); \ - A03 = T32(A03 + C6); \ - A02 = T32(A02 + C5); \ - A01 = T32(A01 + C4); \ - A00 = T32(A00 + C3); \ - } while (0) - -#define INCR_W do { \ - if ((Wlow = T32(Wlow + 1)) == 0) \ - Whigh = T32(Whigh + 1); \ - } while (0) - - -#if 0 /* other hash sizes init */ - -static const uint32_t A_init_192[] = { - C32(0xFD749ED4), C32(0xB798E530), C32(0x33904B6F), C32(0x46BDA85E), - C32(0x076934B4), C32(0x454B4058), C32(0x77F74527), C32(0xFB4CF465), - C32(0x62931DA9), C32(0xE778C8DB), C32(0x22B3998E), C32(0xAC15CFB9) -}; - -static const uint32_t B_init_192[] = { - C32(0x58BCBAC4), C32(0xEC47A08E), C32(0xAEE933B2), C32(0xDFCBC824), - C32(0xA7944804), C32(0xBF65BDB0), C32(0x5A9D4502), C32(0x59979AF7), - C32(0xC5CEA54E), C32(0x4B6B8150), C32(0x16E71909), C32(0x7D632319), - C32(0x930573A0), C32(0xF34C63D1), C32(0xCAF914B4), C32(0xFDD6612C) -}; - -static const uint32_t C_init_192[] = { - C32(0x61550878), C32(0x89EF2B75), C32(0xA1660C46), C32(0x7EF3855B), - C32(0x7297B58C), C32(0x1BC67793), C32(0x7FB1C723), C32(0xB66FC640), - C32(0x1A48B71C), C32(0xF0976D17), C32(0x088CE80A), C32(0xA454EDF3), - C32(0x1C096BF4), C32(0xAC76224B), C32(0x5215781C), C32(0xCD5D2669) -}; - -static const uint32_t A_init_224[] = { - C32(0xA5201467), C32(0xA9B8D94A), C32(0xD4CED997), C32(0x68379D7B), - C32(0xA7FC73BA), C32(0xF1A2546B), C32(0x606782BF), C32(0xE0BCFD0F), - C32(0x2F25374E), C32(0x069A149F), C32(0x5E2DFF25), C32(0xFAECF061) -}; - -static const uint32_t B_init_224[] = { - C32(0xEC9905D8), C32(0xF21850CF), C32(0xC0A746C8), C32(0x21DAD498), - C32(0x35156EEB), C32(0x088C97F2), C32(0x26303E40), C32(0x8A2D4FB5), - C32(0xFEEE44B6), C32(0x8A1E9573), C32(0x7B81111A), C32(0xCBC139F0), - C32(0xA3513861), C32(0x1D2C362E), C32(0x918C580E), C32(0xB58E1B9C) -}; - -static const uint32_t C_init_224[] = { - C32(0xE4B573A1), C32(0x4C1A0880), C32(0x1E907C51), C32(0x04807EFD), - C32(0x3AD8CDE5), C32(0x16B21302), C32(0x02512C53), C32(0x2204CB18), - C32(0x99405F2D), C32(0xE5B648A1), C32(0x70AB1D43), C32(0xA10C25C2), - C32(0x16F1AC05), C32(0x38BBEB56), C32(0x9B01DC60), C32(0xB1096D83) -}; - -static const uint32_t A_init_256[] = { - C32(0x52F84552), C32(0xE54B7999), C32(0x2D8EE3EC), C32(0xB9645191), - C32(0xE0078B86), C32(0xBB7C44C9), C32(0xD2B5C1CA), C32(0xB0D2EB8C), - C32(0x14CE5A45), C32(0x22AF50DC), C32(0xEFFDBC6B), C32(0xEB21B74A) -}; - -static const uint32_t B_init_256[] = { - C32(0xB555C6EE), C32(0x3E710596), C32(0xA72A652F), C32(0x9301515F), - C32(0xDA28C1FA), C32(0x696FD868), C32(0x9CB6BF72), C32(0x0AFE4002), - C32(0xA6E03615), C32(0x5138C1D4), C32(0xBE216306), C32(0xB38B8890), - C32(0x3EA8B96B), C32(0x3299ACE4), C32(0x30924DD4), C32(0x55CB34A5) -}; - -static const uint32_t C_init_256[] = { - C32(0xB405F031), C32(0xC4233EBA), C32(0xB3733979), C32(0xC0DD9D55), - C32(0xC51C28AE), C32(0xA327B8E1), C32(0x56C56167), C32(0xED614433), - C32(0x88B59D60), C32(0x60E2CEBA), C32(0x758B4B8B), C32(0x83E82A7F), - C32(0xBC968828), C32(0xE6E00BF7), C32(0xBA839E55), C32(0x9B491C60) -}; - -static const uint32_t A_init_384[] = { - C32(0xC8FCA331), C32(0xE55C504E), C32(0x003EBF26), C32(0xBB6B8D83), - C32(0x7B0448C1), C32(0x41B82789), C32(0x0A7C9601), C32(0x8D659CFF), - C32(0xB6E2673E), C32(0xCA54C77B), C32(0x1460FD7E), C32(0x3FCB8F2D) -}; - -static const uint32_t B_init_384[] = { - C32(0x527291FC), C32(0x2A16455F), C32(0x78E627E5), C32(0x944F169F), - C32(0x1CA6F016), C32(0xA854EA25), C32(0x8DB98ABE), C32(0xF2C62641), - C32(0x30117DCB), C32(0xCF5C4309), C32(0x93711A25), C32(0xF9F671B8), - C32(0xB01D2116), C32(0x333F4B89), C32(0xB285D165), C32(0x86829B36) -}; - -static const uint32_t C_init_384[] = { - C32(0xF764B11A), C32(0x76172146), C32(0xCEF6934D), C32(0xC6D28399), - C32(0xFE095F61), C32(0x5E6018B4), C32(0x5048ECF5), C32(0x51353261), - C32(0x6E6E36DC), C32(0x63130DAD), C32(0xA9C69BD6), C32(0x1E90EA0C), - C32(0x7C35073B), C32(0x28D95E6D), C32(0xAA340E0D), C32(0xCB3DEE70) -}; -#endif - -__device__ __constant__ -static const uint32_t d_A512[] = { - C32(0x20728DFD), C32(0x46C0BD53), C32(0xE782B699), C32(0x55304632), - C32(0x71B4EF90), C32(0x0EA9E82C), C32(0xDBB930F1), C32(0xFAD06B8B), - C32(0xBE0CAE40), C32(0x8BD14410), C32(0x76D2ADAC), C32(0x28ACAB7F) -}; - -__device__ __constant__ -static const uint32_t d_B512[] = { - C32(0xC1099CB7), C32(0x07B385F3), C32(0xE7442C26), C32(0xCC8AD640), - C32(0xEB6F56C7), C32(0x1EA81AA9), C32(0x73B9D314), C32(0x1DE85D08), - C32(0x48910A5A), C32(0x893B22DB), C32(0xC5A0DF44), C32(0xBBC4324E), - C32(0x72D2F240), C32(0x75941D99), C32(0x6D8BDE82), C32(0xA1A7502B) -}; - -__device__ __constant__ -static const uint32_t d_C512[] = { - C32(0xD9BF68D1), C32(0x58BAD750), C32(0x56028CB2), C32(0x8134F359), - C32(0xB5D469D8), C32(0x941A8CC2), C32(0x418B2A6E), C32(0x04052780), - C32(0x7F07D787), C32(0x5194358F), C32(0x3C60D665), C32(0xBE97D79A), - C32(0x950C3434), C32(0xAED9A06D), C32(0x2537DC8D), C32(0x7CDB5969) -}; - -/***************************************************/ -// GPU Hash Function -__global__ void x14_shabal512_gpu_hash_64(uint32_t threads, uint32_t startNounce, uint64_t *g_hash, uint32_t *g_nonceVector) -{ - __syncthreads(); - - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - - if (thread < threads) - { - uint32_t nounce = (g_nonceVector != NULL) ? g_nonceVector[thread] : (startNounce + thread); - int hashPosition = nounce - startNounce; - uint32_t *Hash = (uint32_t*)&g_hash[hashPosition<<3]; // [hashPosition * 8] - - uint32_t A00 = d_A512[0], A01 = d_A512[1], A02 = d_A512[2], A03 = d_A512[3], - A04 = d_A512[4], A05 = d_A512[5], A06 = d_A512[6], A07 = d_A512[7], - A08 = d_A512[8], A09 = d_A512[9], A0A = d_A512[10], A0B = d_A512[11]; - uint32_t B0 = d_B512[0], B1 = d_B512[1], B2 = d_B512[2], B3 = d_B512[3], - B4 = d_B512[4], B5 = d_B512[5], B6 = d_B512[6], B7 = d_B512[7], - B8 = d_B512[8], B9 = d_B512[9], BA = d_B512[10], BB = d_B512[11], - BC = d_B512[12], BD = d_B512[13], BE = d_B512[14], BF = d_B512[15]; - uint32_t C0 = d_C512[0], C1 = d_C512[1], C2 = d_C512[2], C3 = d_C512[3], - C4 = d_C512[4], C5 = d_C512[5], C6 = d_C512[6], C7 = d_C512[7], - C8 = d_C512[8], C9 = d_C512[9], CA = d_C512[10], CB = d_C512[11], - CC = d_C512[12], CD = d_C512[13], CE = d_C512[14], CF = d_C512[15]; - uint32_t M0, M1, M2, M3, M4, M5, M6, M7, M8, M9, MA, MB, MC, MD, ME, MF; - uint32_t Wlow = 1, Whigh = 0; - - M0 = Hash[0]; - M1 = Hash[1]; - M2 = Hash[2]; - M3 = Hash[3]; - M4 = Hash[4]; - M5 = Hash[5]; - M6 = Hash[6]; - M7 = Hash[7]; - - M8 = Hash[8]; - M9 = Hash[9]; - MA = Hash[10]; - MB = Hash[11]; - MC = Hash[12]; - MD = Hash[13]; - ME = Hash[14]; - MF = Hash[15]; - - INPUT_BLOCK_ADD; - XOR_W; - APPLY_P; - INPUT_BLOCK_SUB; - SWAP_BC; - INCR_W; - - M0 = 0x80; - M1 = M2 = M3 = M4 = M5 = M6 = M7 = M8 = M9 = MA = MB = MC = MD = ME = MF = 0; - - INPUT_BLOCK_ADD; - XOR_W; - APPLY_P; - - for (uint8_t i = 0; i < 3; i ++) - { - SWAP_BC; - XOR_W; - APPLY_P; - } - - Hash[0] = B0; - Hash[1] = B1; - Hash[2] = B2; - Hash[3] = B3; - Hash[4] = B4; - Hash[5] = B5; - Hash[6] = B6; - Hash[7] = B7; - - Hash[8] = B8; - Hash[9] = B9; - Hash[10] = BA; - Hash[11] = BB; - Hash[12] = BC; - Hash[13] = BD; - Hash[14] = BE; - Hash[15] = BF; - - //result = (Hash[3] <= target); - - uint32_t *outpHash = (uint32_t*)&g_hash[hashPosition << 3]; // [8 * hashPosition]; - - for (int i = 0; i < 16; i++) - outpHash[i] = Hash[i]; - } -} - -__host__ void x14_shabal512_cpu_init(int thr_id, uint32_t threads) -{ -} - -// #include -__host__ void x14_shabal512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order) -{ - const uint32_t threadsperblock = 256; - - // berechne wie viele Thread Blocks wir brauchen - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - size_t shared_size = 0; - - // fprintf(stderr, "threads=%d, %d blocks, %d threads per block, %d bytes shared\n", threads, grid.x, block.x, shared_size); - - x14_shabal512_gpu_hash_64<<>>(threads, startNounce, (uint64_t*)d_hash, d_nonceVector); - //MyStreamSynchronize(NULL, order, thr_id); -} diff --git a/x15/cuda_x14_shabal512_alexis.cu b/x15/cuda_x14_shabal512_alexis.cu deleted file mode 100644 index a8a7226d..00000000 --- a/x15/cuda_x14_shabal512_alexis.cu +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Shabal-512 for X14/X15 - * Provos Alexis - 2016 - */ -#include "cuda_helper_alexis.h" -#include "cuda_vectors_alexis.h" - -/* $Id: shabal.c 175 2010-05-07 16:03:20Z tp $ */ -/* - * Shabal implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS B[14] LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -__device__ __forceinline__ void PERM_ELT(uint32_t &xa0,const uint32_t xa1,uint32_t &xb0,const uint32_t xb1,const uint32_t xb2,const uint32_t xb3,const uint32_t xc,const uint32_t xm){ - - uint32_t tmp; - #if __CUDA_ARCH__ >= 500 && CUDA_VERSION >= 7050 - asm ("lop3.b32 %0, %1, %2, %3, 0x9A;" : "=r"(tmp) : "r"(xb2),"r"(xb3),"r"(xm)); // 0x9A = (F0 &(~CC)) ^ (AA) - #else - tmp = (xb2 & ~xb3) ^ xm; - #endif - - xa0 = ((xa0 ^ xc ^ (ROTL32(xa1, 15) * 5U)) * 3U) ^ xb1 ^ tmp; - xb0 = xor3x(0xFFFFFFFF, xa0, ROTL32(xb0, 1)); -} - -__device__ __forceinline__ -void PERM_STEP_0(uint32_t *A,uint32_t *B,const uint32_t *C,const uint32_t* M){ - PERM_ELT(A[ 0], A[11], B[ 0], B[13], B[ 9], B[ 6], C[ 8], M[ 0]); PERM_ELT(A[ 1], A[ 0], B[ 1], B[14], B[10], B[ 7], C[ 7], M[ 1]); - PERM_ELT(A[ 2], A[ 1], B[ 2], B[15], B[11], B[ 8], C[ 6], M[ 2]); PERM_ELT(A[ 3], A[ 2], B[ 3], B[ 0], B[12], B[ 9], C[ 5], M[ 3]); - PERM_ELT(A[ 4], A[ 3], B[ 4], B[ 1], B[13], B[10], C[ 4], M[ 4]); PERM_ELT(A[ 5], A[ 4], B[ 5], B[ 2], B[14], B[11], C[ 3], M[ 5]); - PERM_ELT(A[ 6], A[ 5], B[ 6], B[ 3], B[15], B[12], C[ 2], M[ 6]); PERM_ELT(A[ 7], A[ 6], B[ 7], B[ 4], B[ 0], B[13], C[ 1], M[ 7]); - PERM_ELT(A[ 8], A[ 7], B[ 8], B[ 5], B[ 1], B[14], C[ 0], M[ 8]); PERM_ELT(A[ 9], A[ 8], B[ 9], B[ 6], B[ 2], B[15], C[15], M[ 9]); - PERM_ELT(A[10], A[ 9], B[10], B[ 7], B[ 3], B[ 0], C[14], M[10]); PERM_ELT(A[11], A[10], B[11], B[ 8], B[ 4], B[ 1], C[13], M[11]); - PERM_ELT(A[ 0], A[11], B[12], B[ 9], B[ 5], B[ 2], C[12], M[12]); PERM_ELT(A[ 1], A[ 0], B[13], B[10], B[ 6], B[ 3], C[11], M[13]); - PERM_ELT(A[ 2], A[ 1], B[14], B[11], B[ 7], B[ 4], C[10], M[14]); PERM_ELT(A[ 3], A[ 2], B[15], B[12], B[ 8], B[ 5], C[ 9], M[15]); -} - -__device__ __forceinline__ -void PERM_STEP_1(uint32_t *A,uint32_t *B,const uint32_t *C,const uint32_t* M){ - PERM_ELT(A[ 4], A[ 3], B[ 0], B[13], B[ 9], B[ 6], C[ 8], M[ 0]); PERM_ELT(A[ 5], A[ 4], B[ 1], B[14], B[10], B[ 7], C[ 7], M[ 1]); - PERM_ELT(A[ 6], A[ 5], B[ 2], B[15], B[11], B[ 8], C[ 6], M[ 2]); PERM_ELT(A[ 7], A[ 6], B[ 3], B[ 0], B[12], B[ 9], C[ 5], M[ 3]); - PERM_ELT(A[ 8], A[ 7], B[ 4], B[ 1], B[13], B[10], C[ 4], M[ 4]); PERM_ELT(A[ 9], A[ 8], B[ 5], B[ 2], B[14], B[11], C[ 3], M[ 5]); - PERM_ELT(A[10], A[ 9], B[ 6], B[ 3], B[15], B[12], C[ 2], M[ 6]); PERM_ELT(A[11], A[10], B[ 7], B[ 4], B[ 0], B[13], C[ 1], M[ 7]); - PERM_ELT(A[ 0], A[11], B[ 8], B[ 5], B[ 1], B[14], C[ 0], M[ 8]); PERM_ELT(A[ 1], A[ 0], B[ 9], B[ 6], B[ 2], B[15], C[15], M[ 9]); - PERM_ELT(A[ 2], A[ 1], B[10], B[ 7], B[ 3], B[ 0], C[14], M[10]); PERM_ELT(A[ 3], A[ 2], B[11], B[ 8], B[ 4], B[ 1], C[13], M[11]); - PERM_ELT(A[ 4], A[ 3], B[12], B[ 9], B[ 5], B[ 2], C[12], M[12]); PERM_ELT(A[ 5], A[ 4], B[13], B[10], B[ 6], B[ 3], C[11], M[13]); - PERM_ELT(A[ 6], A[ 5], B[14], B[11], B[ 7], B[ 4], C[10], M[14]); PERM_ELT(A[ 7], A[ 6], B[15], B[12], B[ 8], B[ 5], C[ 9], M[15]); -} - -__device__ __forceinline__ -void PERM_STEP_2(uint32_t *A,uint32_t *B,const uint32_t *C,const uint32_t* M){ - PERM_ELT(A[ 8], A[ 7], B[ 0], B[13], B[ 9], B[ 6], C[ 8], M[ 0]); PERM_ELT(A[ 9], A[ 8], B[ 1], B[14], B[10], B[ 7], C[ 7], M[ 1]); - PERM_ELT(A[10], A[ 9], B[ 2], B[15], B[11], B[ 8], C[ 6], M[ 2]); PERM_ELT(A[11], A[10], B[ 3], B[ 0], B[12], B[ 9], C[ 5], M[ 3]); - PERM_ELT(A[ 0], A[11], B[ 4], B[ 1], B[13], B[10], C[ 4], M[ 4]); PERM_ELT(A[ 1], A[ 0], B[ 5], B[ 2], B[14], B[11], C[ 3], M[ 5]); - PERM_ELT(A[ 2], A[ 1], B[ 6], B[ 3], B[15], B[12], C[ 2], M[ 6]); PERM_ELT(A[ 3], A[ 2], B[ 7], B[ 4], B[ 0], B[13], C[ 1], M[ 7]); - PERM_ELT(A[ 4], A[ 3], B[ 8], B[ 5], B[ 1], B[14], C[ 0], M[ 8]); PERM_ELT(A[ 5], A[ 4], B[ 9], B[ 6], B[ 2], B[15], C[15], M[ 9]); - PERM_ELT(A[ 6], A[ 5], B[10], B[ 7], B[ 3], B[ 0], C[14], M[10]); PERM_ELT(A[ 7], A[ 6], B[11], B[ 8], B[ 4], B[ 1], C[13], M[11]); - PERM_ELT(A[ 8], A[ 7], B[12], B[ 9], B[ 5], B[ 2], C[12], M[12]); PERM_ELT(A[ 9], A[ 8], B[13], B[10], B[ 6], B[ 3], C[11], M[13]); - PERM_ELT(A[10], A[ 9], B[14], B[11], B[ 7], B[ 4], C[10], M[14]); PERM_ELT(A[11], A[10], B[15], B[12], B[ 8], B[ 5], C[ 9], M[15]); -} - -__device__ __forceinline__ -void ADD_BLOCK(uint32_t* A, const uint32_t *B){ - A[11]+= B[ 6]; A[10]+= B[ 5]; A[ 9]+= B[ 4]; A[ 8]+= B[ 3]; A[ 7]+= B[ 2]; A[ 6]+= B[ 1]; A[ 5]+= B[ 0]; A[ 4]+= B[15]; A[ 3]+= B[14]; A[ 2]+= B[13]; A[ 1]+= B[12]; A[ 0]+= B[11]; - A[11]+= B[10]; A[10]+= B[ 9]; A[ 9]+= B[ 8]; A[ 8]+= B[ 7]; A[ 7]+= B[ 6]; A[ 6]+= B[ 5]; A[ 5]+= B[ 4]; A[ 4]+= B[ 3]; A[ 3]+= B[ 2]; A[ 2]+= B[ 1]; A[ 1]+= B[ 0]; A[ 0]+= B[15]; - A[11]+= B[14]; A[10]+= B[13]; A[ 9]+= B[12]; A[ 8]+= B[11]; A[ 7]+= B[10]; A[ 6]+= B[ 9]; A[ 5]+= B[ 8]; A[ 4]+= B[ 7]; A[ 3]+= B[ 6]; A[ 2]+= B[ 5]; A[ 1]+= B[ 4]; A[ 0]+= B[ 3]; -} -__device__ __forceinline__ -void ROTATE(uint32_t* A){ - #pragma unroll 16 - for(int i=0;i<16;i++){ - A[ i] = ROTL32(A[ i],17); - } -} -/***************************************************/ -// GPU Hash Function -__global__ __launch_bounds__(384,3) -void x14_shabal512_gpu_hash_64_alexis(uint32_t threads, uint32_t *g_hash){ - - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - - uint32_t A[]={ - 0x20728DFD, 0x46C0BD53, 0xE782B699, 0x55304632, 0x71B4EF90, 0x0EA9E82C, 0xDBB930F1, 0xFAD06B8B, - 0xBE0CAE40, 0x8BD14410, 0x76D2ADAC, 0x28ACAB7F}; - uint32_t B[]={ - 0xC1099CB7, 0x07B385F3, 0xE7442C26, 0xCC8AD640, 0xEB6F56C7, 0x1EA81AA9, 0x73B9D314, 0x1DE85D08, - 0x48910A5A, 0x893B22DB, 0xC5A0DF44, 0xBBC4324E, 0x72D2F240, 0x75941D99, 0x6D8BDE82, 0xA1A7502B}; - uint32_t C[]={ - 0xD9BF68D1, 0x58BAD750, 0x56028CB2, 0x8134F359, 0xB5D469D8, 0x941A8CC2, 0x418B2A6E, 0x04052780, - 0x7F07D787, 0x5194358F, 0x3C60D665, 0xBE97D79A, 0x950C3434, 0xAED9A06D, 0x2537DC8D, 0x7CDB5969}; - uint32_t M[16]; - - if (thread < threads){ - - uint32_t *Hash = &g_hash[thread<<4]; - - *(uint2x4*)&M[ 0] = __ldg4((uint2x4*)&Hash[ 0]); - *(uint2x4*)&M[ 8] = __ldg4((uint2x4*)&Hash[ 8]); - - *(uint16*)&B[ 0]+= *(uint16*)&M[ 0]; - A[ 0] ^= 1; - ROTATE(B); - PERM_STEP_0(A,B,C,M); - PERM_STEP_1(A,B,C,M); - PERM_STEP_2(A,B,C,M); - ADD_BLOCK(A,C); - *(uint16*)&C[ 0]-= *(uint16*)&M[ 0]; -// SWAP_BC; - - M[ 0] = 0x80; - M[ 1] = M[ 2] = M[ 3] = M[ 4] = M[ 5] = M[ 6] = M[ 7] = M[ 8] = M[ 9] = M[10] = M[11] = M[12] = M[13] = M[14] = M[15] = 0; - C[ 0]+= M[ 0]; - A[ 0]^= 0x02; - ROTATE(C); - PERM_STEP_0(A,C,B,M); - PERM_STEP_1(A,C,B,M); - PERM_STEP_2(A,C,B,M); - ADD_BLOCK(A,B); - A[ 0] ^= 0x02; - ROTATE(B); - PERM_STEP_0(A,B,C,M); - PERM_STEP_1(A,B,C,M); - PERM_STEP_2(A,B,C,M); - ADD_BLOCK(A,C); - A[ 0] ^= 0x02; - ROTATE(C); - PERM_STEP_0(A,C,B,M); - PERM_STEP_1(A,C,B,M); - PERM_STEP_2(A,C,B,M); - ADD_BLOCK(A,B); - A[ 0] ^= 0x02; - ROTATE(B); - PERM_STEP_0(A,B,C,M); - PERM_STEP_1(A,B,C,M); - PERM_STEP_2(A,B,C,M); - - *(uint2x4*)&Hash[ 0] = *(uint2x4*)&B[ 0]; - *(uint2x4*)&Hash[ 8] = *(uint2x4*)&B[ 8]; - } -} - -__host__ void x14_shabal512_cpu_hash_64_alexis(int thr_id, uint32_t threads, uint32_t *d_hash) -{ - const uint32_t threadsperblock = 384; - - // berechne wie viele Thread Blocks wir brauchen - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - x14_shabal512_gpu_hash_64_alexis<<>>(threads, d_hash); -} - -__global__ __launch_bounds__(512,2) -void x14_shabal512_gpu_hash_64_final_alexis(uint32_t threads,const uint32_t* __restrict__ g_hash,uint32_t* resNonce, const uint64_t target){ - - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - - uint32_t A[]={ - 0x20728DFD, 0x46C0BD53, 0xE782B699, 0x55304632, 0x71B4EF90, 0x0EA9E82C, 0xDBB930F1, 0xFAD06B8B, - 0xBE0CAE40, 0x8BD14410, 0x76D2ADAC, 0x28ACAB7F}; - uint32_t B[]={ - 0xC1099CB7, 0x07B385F3, 0xE7442C26, 0xCC8AD640, 0xEB6F56C7, 0x1EA81AA9, 0x73B9D314, 0x1DE85D08, - 0x48910A5A, 0x893B22DB, 0xC5A0DF44, 0xBBC4324E, 0x72D2F240, 0x75941D99, 0x6D8BDE82, 0xA1A7502B}; - uint32_t C[]={ - 0xD9BF68D1, 0x58BAD750, 0x56028CB2, 0x8134F359, 0xB5D469D8, 0x941A8CC2, 0x418B2A6E, 0x04052780, - 0x7F07D787, 0x5194358F, 0x3C60D665, 0xBE97D79A, 0x950C3434, 0xAED9A06D, 0x2537DC8D, 0x7CDB5969}; - uint32_t M[16]; - - if (thread < threads){ - - const uint32_t *Hash = &g_hash[thread<<4]; - - *(uint2x4*)&M[ 0] = __ldg4((uint2x4*)&Hash[ 0]); - *(uint2x4*)&M[ 8] = __ldg4((uint2x4*)&Hash[ 8]); - - *(uint16*)&B[ 0]+= *(uint16*)&M[ 0]; - A[ 0] ^= 1; - ROTATE(B); - PERM_STEP_0(A,B,C,M); - PERM_STEP_1(A,B,C,M); - PERM_STEP_2(A,B,C,M); - ADD_BLOCK(A,C); - *(uint16*)&C[ 0]-= *(uint16*)&M[ 0]; -// SWAP_BC; - - M[ 0] = 0x80; - M[ 1] = M[ 2] = M[ 3] = M[ 4] = M[ 5] = M[ 6] = M[ 7] = M[ 8] = M[ 9] = M[10] = M[11] = M[12] = M[13] = M[14] = M[15] = 0; - C[ 0]+= M[ 0]; - A[ 0]^= 0x02; - ROTATE(C); - PERM_STEP_0(A,C,B,M); - PERM_STEP_1(A,C,B,M); - PERM_STEP_2(A,C,B,M); - ADD_BLOCK(A,B); - A[ 0] ^= 0x02; - ROTATE(B); - PERM_STEP_0(A,B,C,M); - PERM_STEP_1(A,B,C,M); - PERM_STEP_2(A,B,C,M); - ADD_BLOCK(A,C); - A[ 0] ^= 0x02; - ROTATE(C); - PERM_STEP_0(A,C,B,M); - PERM_STEP_1(A,C,B,M); - PERM_STEP_2(A,C,B,M); - ADD_BLOCK(A,B); - A[ 0] ^= 0x02; - ROTATE(B); - PERM_STEP_0(A,B,C,M); - PERM_STEP_1(A,B,C,M); -// PERM_STEP_2(A,B,C,M); - PERM_ELT(A[ 8], A[ 7], B[ 0], B[13], B[ 9], B[ 6], C[ 8], M[ 0]); PERM_ELT(A[ 9], A[ 8], B[ 1], B[14], B[10], B[ 7], C[ 7], M[ 1]); - PERM_ELT(A[10], A[ 9], B[ 2], B[15], B[11], B[ 8], C[ 6], M[ 2]); PERM_ELT(A[11], A[10], B[ 3], B[ 0], B[12], B[ 9], C[ 5], M[ 3]); - PERM_ELT(A[ 0], A[11], B[ 4], B[ 1], B[13], B[10], C[ 4], M[ 4]); PERM_ELT(A[ 1], A[ 0], B[ 5], B[ 2], B[14], B[11], C[ 3], M[ 5]); - PERM_ELT(A[ 2], A[ 1], B[ 6], B[ 3], B[15], B[12], C[ 2], M[ 6]); PERM_ELT(A[ 3], A[ 2], B[ 7], B[ 4], B[ 0], B[13], C[ 1], M[ 7]); - - if(*(uint64_t*)&B[ 6] <= target){ - uint32_t tmp = atomicExch(&resNonce[0], thread); - if (tmp != UINT32_MAX) - resNonce[1] = tmp; - } - } -} - -__host__ void x14_shabal512_cpu_hash_64_final_alexis(int thr_id, uint32_t threads, uint32_t *d_hash, uint32_t *d_resNonce, const uint64_t target){ - - const uint32_t threadsperblock = 512; - - // berechne wie viele Thread Blocks wir brauchen - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - x14_shabal512_gpu_hash_64_final_alexis<<>>(threads, d_hash, d_resNonce, target); -} diff --git a/x15/cuda_x15_whirlpool.cu b/x15/cuda_x15_whirlpool.cu deleted file mode 100644 index a5419197..00000000 --- a/x15/cuda_x15_whirlpool.cu +++ /dev/null @@ -1,743 +0,0 @@ -/** - * Whirlpool-512 CUDA implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2014-2016 djm34, tpruvot, SP, Provos Alexis - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * @author djm34 (initial draft) - * @author tpruvot (dual old/whirlpool modes, midstate) - * @author SP ("final" function opt and tuning) - * @author Provos Alexis (Applied partial shared memory utilization, precomputations, merging & tuning for 970/750ti under CUDA7.5 -> +93% increased throughput of whirlpool) - */ - - -// Change with caution, used by shared mem fetch -#define TPB80 384 -#define TPB64 384 - -extern "C" { -#include -#include -} - -#include -#include -#include - -#define xor3x(a,b,c) (a^b^c) - -#include "cuda_whirlpool_tables.cuh" - -__device__ static uint64_t b0[256]; -__device__ static uint64_t b7[256]; - -__constant__ static uint2 precomputed_round_key_64[72]; -__constant__ static uint2 precomputed_round_key_80[80]; - -__device__ static uint2 c_PaddedMessage80[16]; - -/** - * Round constants. - */ -__device__ uint2 InitVector_RC[10]; - -static uint32_t *d_resNonce[MAX_GPUS] = { 0 }; - -//--------START OF WHIRLPOOL DEVICE MACROS--------------------------------------------------------------------------- -__device__ __forceinline__ -void static TRANSFER(uint2 *const __restrict__ dst,const uint2 *const __restrict__ src){ - dst[0] = src[ 0]; - dst[1] = src[ 1]; - dst[2] = src[ 2]; - dst[3] = src[ 3]; - dst[4] = src[ 4]; - dst[5] = src[ 5]; - dst[6] = src[ 6]; - dst[7] = src[ 7]; -} - -__device__ __forceinline__ -static uint2 d_ROUND_ELT_LDG(const uint2 sharedMemory[7][256],const uint2 *const __restrict__ in,const int i0, const int i1, const int i2, const int i3, const int i4, const int i5, const int i6, const int i7){ - uint2 ret = __ldg((uint2*)&b0[__byte_perm(in[i0].x, 0, 0x4440)]); - ret ^= sharedMemory[1][__byte_perm(in[i1].x, 0, 0x4441)]; - ret ^= sharedMemory[2][__byte_perm(in[i2].x, 0, 0x4442)]; - ret ^= sharedMemory[3][__byte_perm(in[i3].x, 0, 0x4443)]; - ret ^= sharedMemory[4][__byte_perm(in[i4].y, 0, 0x4440)]; - ret ^= ROR24(__ldg((uint2*)&b0[__byte_perm(in[i5].y, 0, 0x4441)])); - ret ^= ROR8(__ldg((uint2*)&b7[__byte_perm(in[i6].y, 0, 0x4442)])); - ret ^= __ldg((uint2*)&b7[__byte_perm(in[i7].y, 0, 0x4443)]); - return ret; -} - -__device__ __forceinline__ -static uint2 d_ROUND_ELT(const uint2 sharedMemory[7][256],const uint2 *const __restrict__ in,const int i0, const int i1, const int i2, const int i3, const int i4, const int i5, const int i6, const int i7){ - - uint2 ret = __ldg((uint2*)&b0[__byte_perm(in[i0].x, 0, 0x4440)]); - ret ^= sharedMemory[1][__byte_perm(in[i1].x, 0, 0x4441)]; - ret ^= sharedMemory[2][__byte_perm(in[i2].x, 0, 0x4442)]; - ret ^= sharedMemory[3][__byte_perm(in[i3].x, 0, 0x4443)]; - ret ^= sharedMemory[4][__byte_perm(in[i4].y, 0, 0x4440)]; - ret ^= sharedMemory[5][__byte_perm(in[i5].y, 0, 0x4441)]; - ret ^= ROR8(__ldg((uint2*)&b7[__byte_perm(in[i6].y, 0, 0x4442)])); - ret ^= __ldg((uint2*)&b7[__byte_perm(in[i7].y, 0, 0x4443)]); - return ret; -} - -__device__ __forceinline__ -static uint2 d_ROUND_ELT1_LDG(const uint2 sharedMemory[7][256],const uint2 *const __restrict__ in,const int i0, const int i1, const int i2, const int i3, const int i4, const int i5, const int i6, const int i7, const uint2 c0){ - - uint2 ret = __ldg((uint2*)&b0[__byte_perm(in[i0].x, 0, 0x4440)]); - ret ^= sharedMemory[1][__byte_perm(in[i1].x, 0, 0x4441)]; - ret ^= sharedMemory[2][__byte_perm(in[i2].x, 0, 0x4442)]; - ret ^= sharedMemory[3][__byte_perm(in[i3].x, 0, 0x4443)]; - ret ^= sharedMemory[4][__byte_perm(in[i4].y, 0, 0x4440)]; - ret ^= ROR24(__ldg((uint2*)&b0[__byte_perm(in[i5].y, 0, 0x4441)])); - ret ^= ROR8(__ldg((uint2*)&b7[__byte_perm(in[i6].y, 0, 0x4442)])); - ret ^= __ldg((uint2*)&b7[__byte_perm(in[i7].y, 0, 0x4443)]); - ret ^= c0; - return ret; -} - -__device__ __forceinline__ -static uint2 d_ROUND_ELT1(const uint2 sharedMemory[7][256],const uint2 *const __restrict__ in,const int i0, const int i1, const int i2, const int i3, const int i4, const int i5, const int i6, const int i7, const uint2 c0){ - uint2 ret = __ldg((uint2*)&b0[__byte_perm(in[i0].x, 0, 0x4440)]); - ret ^= sharedMemory[1][__byte_perm(in[i1].x, 0, 0x4441)]; - ret ^= sharedMemory[2][__byte_perm(in[i2].x, 0, 0x4442)]; - ret ^= sharedMemory[3][__byte_perm(in[i3].x, 0, 0x4443)]; - ret ^= sharedMemory[4][__byte_perm(in[i4].y, 0, 0x4440)]; - ret ^= sharedMemory[5][__byte_perm(in[i5].y, 0, 0x4441)]; - ret ^= ROR8(__ldg((uint2*)&b7[__byte_perm(in[i6].y, 0, 0x4442)]));//sharedMemory[6][__byte_perm(in[i6].y, 0, 0x4442)] - ret ^= __ldg((uint2*)&b7[__byte_perm(in[i7].y, 0, 0x4443)]);//sharedMemory[7][__byte_perm(in[i7].y, 0, 0x4443)] - ret ^= c0; - return ret; -} - -//--------END OF WHIRLPOOL DEVICE MACROS----------------------------------------------------------------------------- - -//--------START OF WHIRLPOOL HOST MACROS----------------------------------------------------------------------------- - -#define table_skew(val,num) SPH_ROTL64(val,8*num) -#define BYTE(x, n) ((unsigned)((x) >> (8 * (n))) & 0xFF) - -#define ROUND_ELT(table, in, i0, i1, i2, i3, i4, i5, i6, i7) \ - (table[BYTE(in[i0], 0)] \ - ^ table_skew(table[BYTE(in[i1], 1)], 1) \ - ^ table_skew(table[BYTE(in[i2], 2)], 2) \ - ^ table_skew(table[BYTE(in[i3], 3)], 3) \ - ^ table_skew(table[BYTE(in[i4], 4)], 4) \ - ^ table_skew(table[BYTE(in[i5], 5)], 5) \ - ^ table_skew(table[BYTE(in[i6], 6)], 6) \ - ^ table_skew(table[BYTE(in[i7], 7)], 7)) - -#define ROUND(table, in, out, c0, c1, c2, c3, c4, c5, c6, c7) do { \ - out[0] = ROUND_ELT(table, in, 0, 7, 6, 5, 4, 3, 2, 1) ^ c0; \ - out[1] = ROUND_ELT(table, in, 1, 0, 7, 6, 5, 4, 3, 2) ^ c1; \ - out[2] = ROUND_ELT(table, in, 2, 1, 0, 7, 6, 5, 4, 3) ^ c2; \ - out[3] = ROUND_ELT(table, in, 3, 2, 1, 0, 7, 6, 5, 4) ^ c3; \ - out[4] = ROUND_ELT(table, in, 4, 3, 2, 1, 0, 7, 6, 5) ^ c4; \ - out[5] = ROUND_ELT(table, in, 5, 4, 3, 2, 1, 0, 7, 6) ^ c5; \ - out[6] = ROUND_ELT(table, in, 6, 5, 4, 3, 2, 1, 0, 7) ^ c6; \ - out[7] = ROUND_ELT(table, in, 7, 6, 5, 4, 3, 2, 1, 0) ^ c7; \ - } while (0) - -__host__ -static void ROUND_KSCHED(const uint64_t *in,uint64_t *out,const uint64_t c){ - const uint64_t *a = in; - uint64_t *b = out; - ROUND(old1_T0, a, b, c, 0, 0, 0, 0, 0, 0, 0); -} - - -//--------END OF WHIRLPOOL HOST MACROS------------------------------------------------------------------------------- - -__host__ -void x15_whirlpool_cpu_init(int thr_id, uint32_t threads, int mode) -{ - uint64_t* table0 = NULL; - - switch (mode) { - case 0: /* x15 with rotated T1-T7 (based on T0) */ - table0 = (uint64_t*)plain_T0; - cudaMemcpyToSymbol(InitVector_RC, plain_RC, 10*sizeof(uint64_t),0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(precomputed_round_key_64, plain_precomputed_round_key_64, 72*sizeof(uint64_t),0, cudaMemcpyHostToDevice); - break; - case 1: /* old whirlpool */ - table0 = (uint64_t*)old1_T0; - cudaMemcpyToSymbol(InitVector_RC, old1_RC, 10*sizeof(uint64_t),0,cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(precomputed_round_key_64, old1_precomputed_round_key_64, 72*sizeof(uint64_t),0, cudaMemcpyHostToDevice); - break; - default: - applog(LOG_ERR,"Bad whirlpool mode"); - exit(0); - } - cudaMemcpyToSymbol(b0, table0, 256*sizeof(uint64_t),0, cudaMemcpyHostToDevice); - uint64_t table7[256]; - for(int i=0;i<256;i++){ - table7[i] = ROTR64(table0[i],8); - } - cudaMemcpyToSymbol(b7, table7, 256*sizeof(uint64_t),0, cudaMemcpyHostToDevice); - - CUDA_SAFE_CALL(cudaMalloc(&d_resNonce[thr_id], 2 * sizeof(uint32_t))); - - cuda_get_arch(thr_id); -} - -__host__ -static void whirl_midstate(void *state, const void *input) -{ - sph_whirlpool_context ctx; - - sph_whirlpool1_init(&ctx); - sph_whirlpool1(&ctx, input, 64); - - memcpy(state, ctx.state, 64); -} - -__host__ -void whirlpool512_setBlock_80(void *pdata, const void *ptarget) -{ - uint64_t PaddedMessage[16]; - - memcpy(PaddedMessage, pdata, 80); - memset(((uint8_t*)&PaddedMessage)+80, 0, 48); - ((uint8_t*)&PaddedMessage)[80] = 0x80; /* ending */ - - // compute constant first block - uint64_t midstate[16] = { 0 }; - whirl_midstate(midstate, pdata); - memcpy(PaddedMessage, midstate, 64); - - uint64_t round_constants[80]; - uint64_t n[8]; - - n[0] = PaddedMessage[0] ^ PaddedMessage[8]; //read data - n[1] = PaddedMessage[1] ^ PaddedMessage[9]; - n[2] = PaddedMessage[2] ^ 0x0000000000000080; //whirlpool - n[3] = PaddedMessage[3]; - n[4] = PaddedMessage[4]; - n[5] = PaddedMessage[5]; - n[6] = PaddedMessage[6]; - n[7] = PaddedMessage[7] ^ 0x8002000000000000; - - ROUND_KSCHED(PaddedMessage,round_constants,old1_RC[0]); - - for(int i=1;i<10;i++){ - ROUND_KSCHED(&round_constants[8*(i-1)],&round_constants[8*i],old1_RC[i]); - } - - //USE the same memory place to store keys and state - round_constants[ 0]^= old1_T0[BYTE(n[0], 0)] - ^ table_skew(old1_T0[BYTE(n[7], 1)], 1) ^ table_skew(old1_T0[BYTE(n[6], 2)], 2) ^ table_skew(old1_T0[BYTE(n[5], 3)], 3) - ^ table_skew(old1_T0[BYTE(n[4], 4)], 4) ^ table_skew(old1_T0[BYTE(n[3], 5)], 5) ^ table_skew(old1_T0[BYTE(n[2], 6)], 6); - - round_constants[ 1]^= old1_T0[BYTE(n[1], 0)] - ^ table_skew(old1_T0[BYTE(n[0], 1)], 1) ^ table_skew(old1_T0[BYTE(n[7], 2)], 2) ^ table_skew(old1_T0[BYTE(n[6], 3)], 3) - ^ table_skew(old1_T0[BYTE(n[5], 4)], 4) ^ table_skew(old1_T0[BYTE(n[4], 5)], 5) ^ table_skew(old1_T0[BYTE(n[3], 6)], 6) - ^ table_skew(old1_T0[BYTE(n[2], 7)], 7); - - round_constants[ 2]^= old1_T0[BYTE(n[2], 0)] - ^ table_skew(old1_T0[BYTE(n[1], 1)], 1) ^ table_skew(old1_T0[BYTE(n[0], 2)], 2) ^ table_skew(old1_T0[BYTE(n[7], 3)], 3) - ^ table_skew(old1_T0[BYTE(n[6], 4)], 4) ^ table_skew(old1_T0[BYTE(n[5], 5)], 5) ^ table_skew(old1_T0[BYTE(n[4], 6)], 6) - ^ table_skew(old1_T0[BYTE(n[3], 7)], 7); - - round_constants[ 3]^= old1_T0[BYTE(n[3], 0)] - ^ table_skew(old1_T0[BYTE(n[2], 1)], 1) ^ table_skew(old1_T0[BYTE(n[1], 2)], 2) ^ table_skew(old1_T0[BYTE(n[0], 3)], 3) - ^ table_skew(old1_T0[BYTE(n[7], 4)], 4) ^ table_skew(old1_T0[BYTE(n[6], 5)], 5) ^ table_skew(old1_T0[BYTE(n[5], 6)], 6) - ^ table_skew(old1_T0[BYTE(n[4], 7)], 7); - - round_constants[ 4]^= old1_T0[BYTE(n[4], 0)] - ^ table_skew(old1_T0[BYTE(n[3], 1)], 1) ^ table_skew(old1_T0[BYTE(n[2], 2)], 2) ^ table_skew(old1_T0[BYTE(n[1], 3)], 3) - ^ table_skew(old1_T0[BYTE(n[0], 4)], 4) ^ table_skew(old1_T0[BYTE(n[7], 5)], 5) ^ table_skew(old1_T0[BYTE(n[6], 6)], 6) - ^ table_skew(old1_T0[BYTE(n[5], 7)], 7); - - round_constants[ 5]^= old1_T0[BYTE(n[5], 0)] - ^ table_skew(old1_T0[BYTE(n[4], 1)], 1) ^ table_skew(old1_T0[BYTE(n[3], 2)], 2) ^ table_skew(old1_T0[BYTE(n[2], 3)], 3) - ^ table_skew(old1_T0[BYTE(n[0], 5)], 5) ^ table_skew(old1_T0[BYTE(n[7], 6)], 6) ^ table_skew(old1_T0[BYTE(n[6], 7)], 7); - - round_constants[ 6]^= old1_T0[BYTE(n[6], 0)] - ^ table_skew(old1_T0[BYTE(n[5], 1)], 1) ^ table_skew(old1_T0[BYTE(n[4], 2)], 2) ^ table_skew(old1_T0[BYTE(n[3], 3)], 3) - ^ table_skew(old1_T0[BYTE(n[2], 4)], 4) ^ table_skew(old1_T0[BYTE(n[0], 6)], 6) ^ table_skew(old1_T0[BYTE(n[7], 7)], 7); - - round_constants[ 7]^= old1_T0[BYTE(n[7], 0)] - ^ table_skew(old1_T0[BYTE(n[6], 1)], 1) ^ table_skew(old1_T0[BYTE(n[5], 2)], 2) ^ table_skew(old1_T0[BYTE(n[4], 3)], 3) - ^ table_skew(old1_T0[BYTE(n[3], 4)], 4) ^ table_skew(old1_T0[BYTE(n[2], 5)], 5) ^ table_skew(old1_T0[BYTE(n[0], 7)], 7); - - for(int i=1;i<5;i++) - n[i] = round_constants[i]; - - round_constants[ 8]^= table_skew(old1_T0[BYTE(n[4], 4)], 4) - ^ table_skew(old1_T0[BYTE(n[3], 5)], 5) ^ table_skew(old1_T0[BYTE(n[2], 6)], 6) ^ table_skew(old1_T0[BYTE(n[1], 7)], 7); - - round_constants[ 9]^= old1_T0[BYTE(n[1], 0)] - ^ table_skew(old1_T0[BYTE(n[4], 5)], 5) ^ table_skew(old1_T0[BYTE(n[3], 6)], 6) ^ table_skew(old1_T0[BYTE(n[2], 7)], 7); - - round_constants[10]^= old1_T0[BYTE(n[2], 0)] - ^ table_skew(old1_T0[BYTE(n[1], 1)], 1) ^ table_skew(old1_T0[BYTE(n[4], 6)], 6) ^ table_skew(old1_T0[BYTE(n[3], 7)], 7); - - round_constants[11]^= old1_T0[BYTE(n[3], 0)] - ^ table_skew(old1_T0[BYTE(n[2], 1)], 1) ^ table_skew(old1_T0[BYTE(n[1], 2)], 2) ^ table_skew(old1_T0[BYTE(n[4], 7)], 7); - - round_constants[12]^= old1_T0[BYTE(n[4], 0)] - ^ table_skew(old1_T0[BYTE(n[3], 1)], 1) ^ table_skew(old1_T0[BYTE(n[2], 2)], 2) ^ table_skew(old1_T0[BYTE(n[1], 3)], 3); - - round_constants[13]^= table_skew(old1_T0[BYTE(n[4], 1)], 1) ^ table_skew(old1_T0[BYTE(n[3], 2)], 2) - ^ table_skew(old1_T0[BYTE(n[2], 3)], 3) ^ table_skew(old1_T0[BYTE(n[1], 4)], 4); - - round_constants[14]^= table_skew(old1_T0[BYTE(n[4], 2)], 2) ^ table_skew(old1_T0[BYTE(n[3], 3)], 3) - ^ table_skew(old1_T0[BYTE(n[2], 4)], 4) ^ table_skew(old1_T0[BYTE(n[1], 5)], 5); - - round_constants[15]^= table_skew(old1_T0[BYTE(n[4], 3)], 3) ^ table_skew(old1_T0[BYTE(n[3], 4)], 4) - ^ table_skew(old1_T0[BYTE(n[2], 5)], 5) ^ table_skew(old1_T0[BYTE(n[1], 6)], 6); - - PaddedMessage[0] ^= PaddedMessage[8]; - - cudaMemcpyToSymbol(c_PaddedMessage80, PaddedMessage, 128, 0, cudaMemcpyHostToDevice); - - cudaMemcpyToSymbol(precomputed_round_key_80, round_constants, 80*sizeof(uint64_t), 0, cudaMemcpyHostToDevice); -} - -__host__ -extern void x15_whirlpool_cpu_free(int thr_id) -{ - if (d_resNonce[thr_id]) - cudaFree(d_resNonce[thr_id]); -} - -__global__ -__launch_bounds__(TPB80,2) -void oldwhirlpool_gpu_hash_80(uint32_t threads, uint32_t startNounce, uint32_t* resNonce, const uint64_t target) -{ - __shared__ uint2 sharedMemory[7][256]; - - if (threadIdx.x < 256) { - const uint2 tmp = __ldg((uint2*)&b0[threadIdx.x]); - sharedMemory[0][threadIdx.x] = tmp; - sharedMemory[1][threadIdx.x] = ROL8(tmp); - sharedMemory[2][threadIdx.x] = ROL16(tmp); - sharedMemory[3][threadIdx.x] = ROL24(tmp); - sharedMemory[4][threadIdx.x] = SWAPUINT2(tmp); - sharedMemory[5][threadIdx.x] = ROR24(tmp); - sharedMemory[6][threadIdx.x] = ROR16(tmp); - } - - __syncthreads(); - - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - - if (thread < threads){ - - uint2 hash[8], state[8],n[8], tmp[8]; - uint32_t nonce = cuda_swab32(startNounce + thread); - uint2 temp = c_PaddedMessage80[9]; - temp.y = nonce; - - /// round 2 /////// - ////////////////////////////////// - temp = temp ^ c_PaddedMessage80[1]; - - *(uint2x4*)&n[ 0] = *(uint2x4*)&precomputed_round_key_80[ 0]; - *(uint2x4*)&n[ 4] = *(uint2x4*)&precomputed_round_key_80[ 4]; - *(uint2x4*)&tmp[ 0] = *(uint2x4*)&precomputed_round_key_80[ 8]; - *(uint2x4*)&tmp[ 4] = *(uint2x4*)&precomputed_round_key_80[12]; - - n[ 0]^= __ldg((uint2*)&b7[__byte_perm(temp.y, 0, 0x4443)]); - n[ 5]^= sharedMemory[4][__byte_perm(temp.y, 0, 0x4440)]; - n[ 6]^= sharedMemory[5][__byte_perm(temp.y, 0, 0x4441)]; - n[ 7]^= sharedMemory[6][__byte_perm(temp.y, 0, 0x4442)]; - - tmp[ 0]^= __ldg((uint2*)&b0[__byte_perm(n[0].x, 0, 0x4440)]); - tmp[ 0]^= sharedMemory[1][__byte_perm(n[7].x, 0, 0x4441)]; - tmp[ 0]^= sharedMemory[2][__byte_perm(n[6].x, 0, 0x4442)]; - tmp[ 0]^= sharedMemory[3][__byte_perm(n[5].x, 0, 0x4443)]; - - tmp[ 1]^= sharedMemory[1][__byte_perm(n[0].x, 0, 0x4441)]; - tmp[ 1]^= sharedMemory[2][__byte_perm(n[7].x, 0, 0x4442)]; - tmp[ 1]^= sharedMemory[3][__byte_perm(n[6].x, 0, 0x4443)]; - tmp[ 1]^= sharedMemory[4][__byte_perm(n[5].y, 0, 0x4440)]; - - tmp[ 2]^= sharedMemory[2][__byte_perm(n[0].x, 0, 0x4442)]; - tmp[ 2]^= sharedMemory[3][__byte_perm(n[7].x, 0, 0x4443)]; - tmp[ 2]^= sharedMemory[4][__byte_perm(n[6].y, 0, 0x4440)]; - tmp[ 2]^= sharedMemory[5][__byte_perm(n[5].y, 0, 0x4441)]; - - tmp[ 3]^= sharedMemory[3][__byte_perm(n[0].x, 0, 0x4443)]; - tmp[ 3]^= sharedMemory[4][__byte_perm(n[7].y, 0, 0x4440)]; - tmp[ 3]^= ROR24(__ldg((uint2*)&b0[__byte_perm(n[6].y, 0, 0x4441)])); - tmp[ 3]^= ROR8(__ldg((uint2*)&b7[__byte_perm(n[5].y, 0, 0x4442)])); - - tmp[ 4]^= sharedMemory[4][__byte_perm(n[0].y, 0, 0x4440)]; - tmp[ 4]^= sharedMemory[5][__byte_perm(n[7].y, 0, 0x4441)]; - tmp[ 4]^= ROR8(__ldg((uint2*)&b7[__byte_perm(n[6].y, 0, 0x4442)])); - tmp[ 4]^= __ldg((uint2*)&b7[__byte_perm(n[5].y, 0, 0x4443)]); - - tmp[ 5]^= __ldg((uint2*)&b0[__byte_perm(n[5].x, 0, 0x4440)]); - tmp[ 5]^= sharedMemory[5][__byte_perm(n[0].y, 0, 0x4441)]; - tmp[ 5]^= sharedMemory[6][__byte_perm(n[7].y, 0, 0x4442)]; - tmp[ 5]^= __ldg((uint2*)&b7[__byte_perm(n[6].y, 0, 0x4443)]); - - tmp[ 6]^= __ldg((uint2*)&b0[__byte_perm(n[6].x, 0, 0x4440)]); - tmp[ 6]^= sharedMemory[1][__byte_perm(n[5].x, 0, 0x4441)]; - tmp[ 6]^= sharedMemory[6][__byte_perm(n[0].y, 0, 0x4442)]; - tmp[ 6]^= __ldg((uint2*)&b7[__byte_perm(n[7].y, 0, 0x4443)]); - - tmp[ 7]^= __ldg((uint2*)&b0[__byte_perm(n[7].x, 0, 0x4440)]); - tmp[ 7]^= sharedMemory[1][__byte_perm(n[6].x, 0, 0x4441)]; - tmp[ 7]^= sharedMemory[2][__byte_perm(n[5].x, 0, 0x4442)]; - tmp[ 7]^= __ldg((uint2*)&b7[__byte_perm(n[0].y, 0, 0x4443)]); - - TRANSFER(n, tmp); - - for (int i=2; i<10; i++) { - tmp[ 0] = d_ROUND_ELT1_LDG(sharedMemory,n, 0, 7, 6, 5, 4, 3, 2, 1, precomputed_round_key_80[i*8+0]); - tmp[ 1] = d_ROUND_ELT1( sharedMemory,n, 1, 0, 7, 6, 5, 4, 3, 2, precomputed_round_key_80[i*8+1]); - tmp[ 2] = d_ROUND_ELT1( sharedMemory,n, 2, 1, 0, 7, 6, 5, 4, 3, precomputed_round_key_80[i*8+2]); - tmp[ 3] = d_ROUND_ELT1_LDG(sharedMemory,n, 3, 2, 1, 0, 7, 6, 5, 4, precomputed_round_key_80[i*8+3]); - tmp[ 4] = d_ROUND_ELT1_LDG(sharedMemory,n, 4, 3, 2, 1, 0, 7, 6, 5, precomputed_round_key_80[i*8+4]); - tmp[ 5] = d_ROUND_ELT1( sharedMemory,n, 5, 4, 3, 2, 1, 0, 7, 6, precomputed_round_key_80[i*8+5]); - tmp[ 6] = d_ROUND_ELT1( sharedMemory,n, 6, 5, 4, 3, 2, 1, 0, 7, precomputed_round_key_80[i*8+6]); - tmp[ 7] = d_ROUND_ELT1_LDG(sharedMemory,n, 7, 6, 5, 4, 3, 2, 1, 0, precomputed_round_key_80[i*8+7]); - TRANSFER(n, tmp); - } - - state[0] = c_PaddedMessage80[0] ^ n[0]; - state[1] = c_PaddedMessage80[1] ^ n[1] ^ vectorize(REPLACE_HIDWORD(devectorize(c_PaddedMessage80[9]),nonce)); - state[2] = c_PaddedMessage80[2] ^ n[2] ^ vectorize(0x0000000000000080); - state[3] = c_PaddedMessage80[3] ^ n[3]; - state[4] = c_PaddedMessage80[4] ^ n[4]; - state[5] = c_PaddedMessage80[5] ^ n[5]; - state[6] = c_PaddedMessage80[6] ^ n[6]; - state[7] = c_PaddedMessage80[7] ^ n[7] ^ vectorize(0x8002000000000000); - - #pragma unroll 2 - for(int r=0;r<2;r++){ - #pragma unroll 8 - for(int i=0;i<8;i++) - hash[ i] = n[ i] = state[ i]; - - uint2 h[8] = { - {0xC0EE0B30,0x672990AF},{0x28282828,0x28282828},{0x28282828,0x28282828},{0x28282828,0x28282828}, - {0x28282828,0x28282828},{0x28282828,0x28282828},{0x28282828,0x28282828},{0x28282828,0x28282828} - }; - - tmp[ 0] = d_ROUND_ELT1_LDG(sharedMemory,n, 0, 7, 6, 5, 4, 3, 2, 1, h[0]); - tmp[ 1] = d_ROUND_ELT1(sharedMemory,n, 1, 0, 7, 6, 5, 4, 3, 2, h[1]); - tmp[ 2] = d_ROUND_ELT1(sharedMemory,n, 2, 1, 0, 7, 6, 5, 4, 3, h[2]); - tmp[ 3] = d_ROUND_ELT1_LDG(sharedMemory,n, 3, 2, 1, 0, 7, 6, 5, 4, h[3]); - tmp[ 4] = d_ROUND_ELT1(sharedMemory,n, 4, 3, 2, 1, 0, 7, 6, 5, h[4]); - tmp[ 5] = d_ROUND_ELT1_LDG(sharedMemory,n, 5, 4, 3, 2, 1, 0, 7, 6, h[5]); - tmp[ 6] = d_ROUND_ELT1(sharedMemory,n, 6, 5, 4, 3, 2, 1, 0, 7, h[6]); - tmp[ 7] = d_ROUND_ELT1_LDG(sharedMemory,n, 7, 6, 5, 4, 3, 2, 1, 0, h[7]); - TRANSFER(n, tmp); - // #pragma unroll 10 - for (int i=1; i <10; i++){ - tmp[ 0] = d_ROUND_ELT1_LDG(sharedMemory,n, 0, 7, 6, 5, 4, 3, 2, 1, precomputed_round_key_64[(i-1)*8+0]); - tmp[ 1] = d_ROUND_ELT1( sharedMemory,n, 1, 0, 7, 6, 5, 4, 3, 2, precomputed_round_key_64[(i-1)*8+1]); - tmp[ 2] = d_ROUND_ELT1( sharedMemory,n, 2, 1, 0, 7, 6, 5, 4, 3, precomputed_round_key_64[(i-1)*8+2]); - tmp[ 3] = d_ROUND_ELT1_LDG(sharedMemory,n, 3, 2, 1, 0, 7, 6, 5, 4, precomputed_round_key_64[(i-1)*8+3]); - tmp[ 4] = d_ROUND_ELT1( sharedMemory,n, 4, 3, 2, 1, 0, 7, 6, 5, precomputed_round_key_64[(i-1)*8+4]); - tmp[ 5] = d_ROUND_ELT1( sharedMemory,n, 5, 4, 3, 2, 1, 0, 7, 6, precomputed_round_key_64[(i-1)*8+5]); - tmp[ 6] = d_ROUND_ELT1( sharedMemory,n, 6, 5, 4, 3, 2, 1, 0, 7, precomputed_round_key_64[(i-1)*8+6]); - tmp[ 7] = d_ROUND_ELT1_LDG(sharedMemory,n, 7, 6, 5, 4, 3, 2, 1, 0, precomputed_round_key_64[(i-1)*8+7]); - TRANSFER(n, tmp); - } - #pragma unroll 8 - for (int i=0; i<8; i++) - state[i] = n[i] ^ hash[i]; - - #pragma unroll 6 - for (int i=1; i<7; i++) - n[i]=vectorize(0); - - n[0] = vectorize(0x80); - n[7] = vectorize(0x2000000000000); - - #pragma unroll 8 - for (int i=0; i < 8; i++) { - h[i] = state[i]; - n[i] = n[i] ^ h[i]; - } - - // #pragma unroll 10 - for (int i=0; i < 10; i++) { - tmp[ 0] = d_ROUND_ELT1(sharedMemory, h, 0, 7, 6, 5, 4, 3, 2, 1, InitVector_RC[i]); - tmp[ 1] = d_ROUND_ELT(sharedMemory, h, 1, 0, 7, 6, 5, 4, 3, 2); - tmp[ 2] = d_ROUND_ELT_LDG(sharedMemory, h, 2, 1, 0, 7, 6, 5, 4, 3); - tmp[ 3] = d_ROUND_ELT(sharedMemory, h, 3, 2, 1, 0, 7, 6, 5, 4); - tmp[ 4] = d_ROUND_ELT_LDG(sharedMemory, h, 4, 3, 2, 1, 0, 7, 6, 5); - tmp[ 5] = d_ROUND_ELT(sharedMemory, h, 5, 4, 3, 2, 1, 0, 7, 6); - tmp[ 6] = d_ROUND_ELT_LDG(sharedMemory, h, 6, 5, 4, 3, 2, 1, 0, 7); - tmp[ 7] = d_ROUND_ELT(sharedMemory, h, 7, 6, 5, 4, 3, 2, 1, 0); - TRANSFER(h, tmp); - tmp[ 0] = d_ROUND_ELT1(sharedMemory,n, 0, 7, 6, 5, 4, 3, 2, 1, tmp[0]); - tmp[ 1] = d_ROUND_ELT1(sharedMemory,n, 1, 0, 7, 6, 5, 4, 3, 2, tmp[1]); - tmp[ 2] = d_ROUND_ELT1_LDG(sharedMemory,n, 2, 1, 0, 7, 6, 5, 4, 3, tmp[2]); - tmp[ 3] = d_ROUND_ELT1(sharedMemory,n, 3, 2, 1, 0, 7, 6, 5, 4, tmp[3]); - tmp[ 4] = d_ROUND_ELT1(sharedMemory,n, 4, 3, 2, 1, 0, 7, 6, 5, tmp[4]); - tmp[ 5] = d_ROUND_ELT1(sharedMemory,n, 5, 4, 3, 2, 1, 0, 7, 6, tmp[5]); - tmp[ 6] = d_ROUND_ELT1(sharedMemory,n, 6, 5, 4, 3, 2, 1, 0, 7, tmp[6]); - tmp[ 7] = d_ROUND_ELT1_LDG(sharedMemory,n, 7, 6, 5, 4, 3, 2, 1, 0, tmp[7]); - TRANSFER(n, tmp); - } - - state[0] = xor3x(state[0], n[0], vectorize(0x80)); - state[1] = state[1]^ n[1]; - state[2] = state[2]^ n[2]; - state[3] = state[3]^ n[3]; - state[4] = state[4]^ n[4]; - state[5] = state[5]^ n[5]; - state[6] = state[6]^ n[6]; - state[7] = xor3x(state[7], n[7], vectorize(0x2000000000000)); - } - - uint2 h[8] = { - {0xC0EE0B30,0x672990AF},{0x28282828,0x28282828},{0x28282828,0x28282828},{0x28282828,0x28282828}, - {0x28282828,0x28282828},{0x28282828,0x28282828},{0x28282828,0x28282828},{0x28282828,0x28282828} - }; - - #pragma unroll 8 - for(int i=0;i<8;i++) - n[i]=hash[i] = state[ i]; - - tmp[ 0] = d_ROUND_ELT1(sharedMemory,n, 0, 7, 6, 5, 4, 3, 2, 1, h[0]); - tmp[ 1] = d_ROUND_ELT1_LDG(sharedMemory,n, 1, 0, 7, 6, 5, 4, 3, 2, h[1]); - tmp[ 2] = d_ROUND_ELT1(sharedMemory,n, 2, 1, 0, 7, 6, 5, 4, 3, h[2]); - tmp[ 3] = d_ROUND_ELT1_LDG(sharedMemory,n, 3, 2, 1, 0, 7, 6, 5, 4, h[3]); - tmp[ 4] = d_ROUND_ELT1(sharedMemory,n, 4, 3, 2, 1, 0, 7, 6, 5, h[4]); - tmp[ 5] = d_ROUND_ELT1_LDG(sharedMemory,n, 5, 4, 3, 2, 1, 0, 7, 6, h[5]); - tmp[ 6] = d_ROUND_ELT1(sharedMemory,n, 6, 5, 4, 3, 2, 1, 0, 7, h[6]); - tmp[ 7] = d_ROUND_ELT1_LDG(sharedMemory,n, 7, 6, 5, 4, 3, 2, 1, 0, h[7]); - TRANSFER(n, tmp); -// #pragma unroll 10 - for (int i=1; i <10; i++){ - tmp[ 0] = d_ROUND_ELT1_LDG(sharedMemory,n, 0, 7, 6, 5, 4, 3, 2, 1, precomputed_round_key_64[(i-1)*8+0]); - tmp[ 1] = d_ROUND_ELT1( sharedMemory,n, 1, 0, 7, 6, 5, 4, 3, 2, precomputed_round_key_64[(i-1)*8+1]); - tmp[ 2] = d_ROUND_ELT1( sharedMemory,n, 2, 1, 0, 7, 6, 5, 4, 3, precomputed_round_key_64[(i-1)*8+2]); - tmp[ 3] = d_ROUND_ELT1_LDG(sharedMemory,n, 3, 2, 1, 0, 7, 6, 5, 4, precomputed_round_key_64[(i-1)*8+3]); - tmp[ 4] = d_ROUND_ELT1( sharedMemory,n, 4, 3, 2, 1, 0, 7, 6, 5, precomputed_round_key_64[(i-1)*8+4]); - tmp[ 5] = d_ROUND_ELT1( sharedMemory,n, 5, 4, 3, 2, 1, 0, 7, 6, precomputed_round_key_64[(i-1)*8+5]); - tmp[ 6] = d_ROUND_ELT1( sharedMemory,n, 6, 5, 4, 3, 2, 1, 0, 7, precomputed_round_key_64[(i-1)*8+6]); - tmp[ 7] = d_ROUND_ELT1_LDG(sharedMemory,n, 7, 6, 5, 4, 3, 2, 1, 0, precomputed_round_key_64[(i-1)*8+7]); - TRANSFER(n, tmp); - } - - #pragma unroll 8 - for (int i=0; i<8; i++) - n[ i] = h[i] = n[i] ^ hash[i]; - - uint2 backup = h[ 3]; - - n[0]^= vectorize(0x80); - n[7]^= vectorize(0x2000000000000); - -// #pragma unroll 8 - for (int i=0; i < 8; i++) { - tmp[ 0] = d_ROUND_ELT1(sharedMemory, h, 0, 7, 6, 5, 4, 3, 2, 1, InitVector_RC[i]); - tmp[ 1] = d_ROUND_ELT(sharedMemory, h, 1, 0, 7, 6, 5, 4, 3, 2); - tmp[ 2] = d_ROUND_ELT_LDG(sharedMemory, h, 2, 1, 0, 7, 6, 5, 4, 3); - tmp[ 3] = d_ROUND_ELT(sharedMemory, h, 3, 2, 1, 0, 7, 6, 5, 4); - tmp[ 4] = d_ROUND_ELT_LDG(sharedMemory, h, 4, 3, 2, 1, 0, 7, 6, 5); - tmp[ 5] = d_ROUND_ELT(sharedMemory, h, 5, 4, 3, 2, 1, 0, 7, 6); - tmp[ 6] = d_ROUND_ELT_LDG(sharedMemory, h, 6, 5, 4, 3, 2, 1, 0, 7); - tmp[ 7] = d_ROUND_ELT(sharedMemory, h, 7, 6, 5, 4, 3, 2, 1, 0); - TRANSFER(h, tmp); - tmp[ 0] = d_ROUND_ELT1(sharedMemory,n, 0, 7, 6, 5, 4, 3, 2, 1, tmp[0]); - tmp[ 1] = d_ROUND_ELT1(sharedMemory,n, 1, 0, 7, 6, 5, 4, 3, 2, tmp[1]); - tmp[ 2] = d_ROUND_ELT1_LDG(sharedMemory,n, 2, 1, 0, 7, 6, 5, 4, 3, tmp[2]); - tmp[ 3] = d_ROUND_ELT1(sharedMemory,n, 3, 2, 1, 0, 7, 6, 5, 4, tmp[3]); - tmp[ 4] = d_ROUND_ELT1(sharedMemory,n, 4, 3, 2, 1, 0, 7, 6, 5, tmp[4]); - tmp[ 5] = d_ROUND_ELT1(sharedMemory,n, 5, 4, 3, 2, 1, 0, 7, 6, tmp[5]); - tmp[ 6] = d_ROUND_ELT1(sharedMemory,n, 6, 5, 4, 3, 2, 1, 0, 7, tmp[6]); - tmp[ 7] = d_ROUND_ELT1_LDG(sharedMemory,n, 7, 6, 5, 4, 3, 2, 1, 0, tmp[7]); - TRANSFER(n, tmp); - } - tmp[ 0] = d_ROUND_ELT1(sharedMemory, h, 0, 7, 6, 5, 4, 3, 2, 1, InitVector_RC[8]); - tmp[ 1] = d_ROUND_ELT(sharedMemory, h, 1, 0, 7, 6, 5, 4, 3, 2); - tmp[ 2] = d_ROUND_ELT_LDG(sharedMemory, h, 2, 1, 0, 7, 6, 5, 4, 3); - tmp[ 3] = d_ROUND_ELT(sharedMemory, h, 3, 2, 1, 0, 7, 6, 5, 4); - tmp[ 4] = d_ROUND_ELT_LDG(sharedMemory, h, 4, 3, 2, 1, 0, 7, 6, 5); - tmp[ 5] = d_ROUND_ELT(sharedMemory, h, 5, 4, 3, 2, 1, 0, 7, 6); - tmp[ 6] = d_ROUND_ELT(sharedMemory, h, 6, 5, 4, 3, 2, 1, 0, 7); - tmp[ 7] = d_ROUND_ELT(sharedMemory, h, 7, 6, 5, 4, 3, 2, 1, 0); - TRANSFER(h, tmp); - tmp[ 0] = d_ROUND_ELT1(sharedMemory,n, 0, 7, 6, 5, 4, 3, 2, 1, tmp[0]); - tmp[ 1] = d_ROUND_ELT1(sharedMemory,n, 1, 0, 7, 6, 5, 4, 3, 2, tmp[1]); - tmp[ 2] = d_ROUND_ELT1(sharedMemory,n, 2, 1, 0, 7, 6, 5, 4, 3, tmp[2]); - tmp[ 3] = d_ROUND_ELT1(sharedMemory,n, 3, 2, 1, 0, 7, 6, 5, 4, tmp[3]); - tmp[ 4] = d_ROUND_ELT1(sharedMemory,n, 4, 3, 2, 1, 0, 7, 6, 5, tmp[4]); - tmp[ 5] = d_ROUND_ELT1(sharedMemory,n, 5, 4, 3, 2, 1, 0, 7, 6, tmp[5]); - tmp[ 6] = d_ROUND_ELT1_LDG(sharedMemory,n, 6, 5, 4, 3, 2, 1, 0, 7, tmp[6]); - tmp[ 7] = d_ROUND_ELT1(sharedMemory,n, 7, 6, 5, 4, 3, 2, 1, 0, tmp[7]); - - n[ 3] = backup ^ d_ROUND_ELT(sharedMemory, h, 3, 2, 1, 0, 7, 6, 5, 4) - ^ d_ROUND_ELT(sharedMemory,tmp, 3, 2, 1, 0, 7, 6, 5, 4); - - if(devectorize(n[3]) <= target) { - uint32_t tmp = atomicExch(&resNonce[0], thread); - if (tmp != UINT32_MAX) - resNonce[1] = tmp; - } - - } // thread < threads -} - -/* only for whirlpool algo, no data out!! */ -__host__ -void whirlpool512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *h_resNonces, const uint64_t target) -{ - dim3 grid((threads + TPB80-1) / TPB80); - dim3 block(TPB80); - - cudaMemset(d_resNonce[thr_id], 0xff, 2*sizeof(uint32_t)); - - oldwhirlpool_gpu_hash_80<<>>(threads, startNounce, d_resNonce[thr_id], target); - - cudaMemcpy(h_resNonces, d_resNonce[thr_id], 2*sizeof(uint32_t), cudaMemcpyDeviceToHost); - if (h_resNonces[0] != UINT32_MAX) h_resNonces[0] += startNounce; - if (h_resNonces[1] != UINT32_MAX) h_resNonces[1] += startNounce; -} - -__global__ -__launch_bounds__(TPB64,2) -void x15_whirlpool_gpu_hash_64(uint32_t threads, uint64_t *g_hash) -{ - __shared__ uint2 sharedMemory[7][256]; - - if (threadIdx.x < 256) { - const uint2 tmp = __ldg((uint2*)&b0[threadIdx.x]); - sharedMemory[0][threadIdx.x] = tmp; - sharedMemory[1][threadIdx.x] = ROL8(tmp); - sharedMemory[2][threadIdx.x] = ROL16(tmp); - sharedMemory[3][threadIdx.x] = ROL24(tmp); - sharedMemory[4][threadIdx.x] = SWAPUINT2(tmp); - sharedMemory[5][threadIdx.x] = ROR24(tmp); - sharedMemory[6][threadIdx.x] = ROR16(tmp); - } - - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads){ - - uint2 hash[8], n[8], h[ 8]; - uint2 tmp[8] = { - {0xC0EE0B30,0x672990AF},{0x28282828,0x28282828},{0x28282828,0x28282828},{0x28282828,0x28282828}, - {0x28282828,0x28282828},{0x28282828,0x28282828},{0x28282828,0x28282828},{0x28282828,0x28282828} - }; - - *(uint2x4*)&hash[ 0] = __ldg4((uint2x4*)&g_hash[(thread<<3) + 0]); - *(uint2x4*)&hash[ 4] = __ldg4((uint2x4*)&g_hash[(thread<<3) + 4]); - - __syncthreads(); - - #pragma unroll 8 - for(int i=0;i<8;i++) - n[i]=hash[i]; - - tmp[ 0]^= d_ROUND_ELT(sharedMemory,n, 0, 7, 6, 5, 4, 3, 2, 1); - tmp[ 1]^= d_ROUND_ELT_LDG(sharedMemory,n, 1, 0, 7, 6, 5, 4, 3, 2); - tmp[ 2]^= d_ROUND_ELT(sharedMemory,n, 2, 1, 0, 7, 6, 5, 4, 3); - tmp[ 3]^= d_ROUND_ELT_LDG(sharedMemory,n, 3, 2, 1, 0, 7, 6, 5, 4); - tmp[ 4]^= d_ROUND_ELT(sharedMemory,n, 4, 3, 2, 1, 0, 7, 6, 5); - tmp[ 5]^= d_ROUND_ELT_LDG(sharedMemory,n, 5, 4, 3, 2, 1, 0, 7, 6); - tmp[ 6]^= d_ROUND_ELT(sharedMemory,n, 6, 5, 4, 3, 2, 1, 0, 7); - tmp[ 7]^= d_ROUND_ELT_LDG(sharedMemory,n, 7, 6, 5, 4, 3, 2, 1, 0); - for (int i=1; i <10; i++){ - TRANSFER(n, tmp); - tmp[ 0] = d_ROUND_ELT1_LDG(sharedMemory,n, 0, 7, 6, 5, 4, 3, 2, 1, precomputed_round_key_64[(i-1)*8+0]); - tmp[ 1] = d_ROUND_ELT1( sharedMemory,n, 1, 0, 7, 6, 5, 4, 3, 2, precomputed_round_key_64[(i-1)*8+1]); - tmp[ 2] = d_ROUND_ELT1( sharedMemory,n, 2, 1, 0, 7, 6, 5, 4, 3, precomputed_round_key_64[(i-1)*8+2]); - tmp[ 3] = d_ROUND_ELT1_LDG(sharedMemory,n, 3, 2, 1, 0, 7, 6, 5, 4, precomputed_round_key_64[(i-1)*8+3]); - tmp[ 4] = d_ROUND_ELT1( sharedMemory,n, 4, 3, 2, 1, 0, 7, 6, 5, precomputed_round_key_64[(i-1)*8+4]); - tmp[ 5] = d_ROUND_ELT1( sharedMemory,n, 5, 4, 3, 2, 1, 0, 7, 6, precomputed_round_key_64[(i-1)*8+5]); - tmp[ 6] = d_ROUND_ELT1( sharedMemory,n, 6, 5, 4, 3, 2, 1, 0, 7, precomputed_round_key_64[(i-1)*8+6]); - tmp[ 7] = d_ROUND_ELT1_LDG(sharedMemory,n, 7, 6, 5, 4, 3, 2, 1, 0, precomputed_round_key_64[(i-1)*8+7]); - } - - TRANSFER(h, tmp); - #pragma unroll 8 - for (int i=0; i<8; i++) - hash[ i] = h[i] = h[i] ^ hash[i]; - - #pragma unroll 6 - for (int i=1; i<7; i++) - n[i]=vectorize(0); - - n[0] = vectorize(0x80); - n[7] = vectorize(0x2000000000000); - - #pragma unroll 8 - for (int i=0; i < 8; i++) { - n[i] = n[i] ^ h[i]; - } - -// #pragma unroll 10 - for (int i=0; i < 10; i++) { - tmp[ 0] = InitVector_RC[i]; - tmp[ 0]^= d_ROUND_ELT(sharedMemory, h, 0, 7, 6, 5, 4, 3, 2, 1); - tmp[ 1] = d_ROUND_ELT(sharedMemory, h, 1, 0, 7, 6, 5, 4, 3, 2); - tmp[ 2] = d_ROUND_ELT_LDG(sharedMemory, h, 2, 1, 0, 7, 6, 5, 4, 3); - tmp[ 3] = d_ROUND_ELT(sharedMemory, h, 3, 2, 1, 0, 7, 6, 5, 4); - tmp[ 4] = d_ROUND_ELT_LDG(sharedMemory, h, 4, 3, 2, 1, 0, 7, 6, 5); - tmp[ 5] = d_ROUND_ELT(sharedMemory, h, 5, 4, 3, 2, 1, 0, 7, 6); - tmp[ 6] = d_ROUND_ELT(sharedMemory, h, 6, 5, 4, 3, 2, 1, 0, 7); - tmp[ 7] = d_ROUND_ELT(sharedMemory, h, 7, 6, 5, 4, 3, 2, 1, 0); - TRANSFER(h, tmp); - tmp[ 0] = d_ROUND_ELT1(sharedMemory,n, 0, 7, 6, 5, 4, 3, 2, 1, tmp[0]); - tmp[ 1] = d_ROUND_ELT1_LDG(sharedMemory,n, 1, 0, 7, 6, 5, 4, 3, 2, tmp[1]); - tmp[ 2] = d_ROUND_ELT1(sharedMemory,n, 2, 1, 0, 7, 6, 5, 4, 3, tmp[2]); - tmp[ 3] = d_ROUND_ELT1(sharedMemory,n, 3, 2, 1, 0, 7, 6, 5, 4, tmp[3]); - tmp[ 4] = d_ROUND_ELT1_LDG(sharedMemory,n, 4, 3, 2, 1, 0, 7, 6, 5, tmp[4]); - tmp[ 5] = d_ROUND_ELT1(sharedMemory,n, 5, 4, 3, 2, 1, 0, 7, 6, tmp[5]); - tmp[ 6] = d_ROUND_ELT1_LDG(sharedMemory,n, 6, 5, 4, 3, 2, 1, 0, 7, tmp[6]); - tmp[ 7] = d_ROUND_ELT1(sharedMemory,n, 7, 6, 5, 4, 3, 2, 1, 0, tmp[7]); - TRANSFER(n, tmp); - } - - hash[0] = xor3x(hash[0], n[0], vectorize(0x80)); - hash[1] = hash[1]^ n[1]; - hash[2] = hash[2]^ n[2]; - hash[3] = hash[3]^ n[3]; - hash[4] = hash[4]^ n[4]; - hash[5] = hash[5]^ n[5]; - hash[6] = hash[6]^ n[6]; - hash[7] = xor3x(hash[7], n[7], vectorize(0x2000000000000)); - - *(uint2x4*)&g_hash[(thread<<3)+ 0] = *(uint2x4*)&hash[ 0]; - *(uint2x4*)&g_hash[(thread<<3)+ 4] = *(uint2x4*)&hash[ 4]; - } -} - -__host__ -static void x15_whirlpool_cpu_hash_64(int thr_id, uint32_t threads, uint32_t *d_hash) -{ - dim3 grid((threads + TPB64-1) / TPB64); - dim3 block(TPB64); - - x15_whirlpool_gpu_hash_64 <<>> (threads, (uint64_t*)d_hash); -} - -__host__ -void x15_whirlpool_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order) -{ - x15_whirlpool_cpu_hash_64(thr_id, threads, d_hash); -} - diff --git a/x15/cuda_x15_whirlpool_sm3.cu b/x15/cuda_x15_whirlpool_sm3.cu deleted file mode 100644 index 013e095f..00000000 --- a/x15/cuda_x15_whirlpool_sm3.cu +++ /dev/null @@ -1,2429 +0,0 @@ -/** - * Whirlpool-512 CUDA implementation. (better for SM 3.0) - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2014-2016 djm34, tpruvot, SP - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * @author djm34 (initial draft) - * @author tpruvot (dual old/whirlpool modes, midstate) - * @author SP ("final" function opt and tuning) - */ -#include -#include - -// don't change, used by shared mem fetch! -#define threadsperblock 256 - -#include -#include -#include "cuda_whirlpool_tables.cuh" -#include "../sph/sph_whirlpool.h" - -extern __device__ __device_builtin__ void __threadfence_block(void); - -__device__ static uint64_t c_PaddedMessage80[16]; -__device__ static uint32_t pTarget[8]; - -static uint32_t *h_wnounce[MAX_GPUS] = { 0 }; -static uint32_t *d_WNonce[MAX_GPUS] = { 0 }; - -#define HOST_MIDSTATE 1 -#define USE_ALL_TABLES 1 - -__constant__ static uint64_t mixTob0Tox[256]; -#if USE_ALL_TABLES -__constant__ static uint64_t mixTob1Tox[256]; -__constant__ static uint64_t mixTob2Tox[256]; -__constant__ static uint64_t mixTob3Tox[256]; -__constant__ static uint64_t mixTob4Tox[256]; -__constant__ static uint64_t mixTob5Tox[256]; -__constant__ static uint64_t mixTob6Tox[256]; -__constant__ static uint64_t mixTob7Tox[256]; -#endif - -#if USE_ALL_TABLES -static const uint64_t old1_T1[256] = { - SPH_C64(0xD8C0781828181878), SPH_C64(0x2605AF23652323AF), - SPH_C64(0xB87EF9C657C6C6F9), SPH_C64(0xFB136FE825E8E86F), - SPH_C64(0xCB4CA187948787A1), SPH_C64(0x11A962B8D5B8B862), - SPH_C64(0x0908050103010105), SPH_C64(0x0D426E4FD14F4F6E), - SPH_C64(0x9BADEE365A3636EE), SPH_C64(0xFF5904A6F7A6A604), - SPH_C64(0x0CDEBDD26BD2D2BD), SPH_C64(0x0EFB06F502F5F506), - SPH_C64(0x96EF80798B797980), SPH_C64(0x305FCE6FB16F6FCE), - SPH_C64(0x6DFCEF91AE9191EF), SPH_C64(0xF8AA0752F6525207), - SPH_C64(0x4727FD60A06060FD), SPH_C64(0x358976BCD9BCBC76), - SPH_C64(0x37ACCD9BB09B9BCD), SPH_C64(0x8A048C8E8F8E8E8C), - SPH_C64(0xD27115A3F8A3A315), SPH_C64(0x6C603C0C140C0C3C), - SPH_C64(0x84FF8A7B8D7B7B8A), SPH_C64(0x80B5E1355F3535E1), - SPH_C64(0xF5E8691D271D1D69), SPH_C64(0xB35347E03DE0E047), - SPH_C64(0x21F6ACD764D7D7AC), SPH_C64(0x9C5EEDC25BC2C2ED), - SPH_C64(0x436D962E722E2E96), SPH_C64(0x29627A4BDD4B4B7A), - SPH_C64(0x5DA321FE1FFEFE21), SPH_C64(0xD5821657F9575716), - SPH_C64(0xBDA841153F151541), SPH_C64(0xE89FB677997777B6), - SPH_C64(0x92A5EB37593737EB), SPH_C64(0x9E7B56E532E5E556), - SPH_C64(0x138CD99FBC9F9FD9), SPH_C64(0x23D317F00DF0F017), - SPH_C64(0x206A7F4ADE4A4A7F), SPH_C64(0x449E95DA73DADA95), - SPH_C64(0xA2FA2558E8585825), SPH_C64(0xCF06CAC946C9C9CA), - SPH_C64(0x7C558D297B29298D), SPH_C64(0x5A50220A1E0A0A22), - SPH_C64(0x50E14FB1CEB1B14F), SPH_C64(0xC9691AA0FDA0A01A), - SPH_C64(0x147FDA6BBD6B6BDA), SPH_C64(0xD95CAB85928585AB), - SPH_C64(0x3C8173BDDABDBD73), SPH_C64(0x8FD2345DE75D5D34), - SPH_C64(0x9080501030101050), SPH_C64(0x07F303F401F4F403), - SPH_C64(0xDD16C0CB40CBCBC0), SPH_C64(0xD3EDC63E423E3EC6), - SPH_C64(0x2D2811050F050511), SPH_C64(0x781FE667A96767E6), - SPH_C64(0x977353E431E4E453), SPH_C64(0x0225BB27692727BB), - SPH_C64(0x73325841C3414158), SPH_C64(0xA72C9D8B808B8B9D), - SPH_C64(0xF65101A7F4A7A701), SPH_C64(0xB2CF947D877D7D94), - SPH_C64(0x49DCFB95A29595FB), SPH_C64(0x568E9FD875D8D89F), - SPH_C64(0x708B30FB10FBFB30), SPH_C64(0xCD2371EE2FEEEE71), - SPH_C64(0xBBC7917C847C7C91), SPH_C64(0x7117E366AA6666E3), - SPH_C64(0x7BA68EDD7ADDDD8E), SPH_C64(0xAFB84B173917174B), - SPH_C64(0x45024647C9474746), SPH_C64(0x1A84DC9EBF9E9EDC), - SPH_C64(0xD41EC5CA43CACAC5), SPH_C64(0x5875992D772D2D99), - SPH_C64(0x2E9179BFDCBFBF79), SPH_C64(0x3F381B070907071B), - SPH_C64(0xAC0123ADEAADAD23), SPH_C64(0xB0EA2F5AEE5A5A2F), - SPH_C64(0xEF6CB583988383B5), SPH_C64(0xB685FF33553333FF), - SPH_C64(0x5C3FF263A56363F2), SPH_C64(0x12100A020602020A), - SPH_C64(0x933938AAE3AAAA38), SPH_C64(0xDEAFA871937171A8), - SPH_C64(0xC60ECFC845C8C8CF), SPH_C64(0xD1C87D192B19197D), - SPH_C64(0x3B727049DB494970), SPH_C64(0x5F869AD976D9D99A), - SPH_C64(0x31C31DF20BF2F21D), SPH_C64(0xA84B48E338E3E348), - SPH_C64(0xB9E22A5BED5B5B2A), SPH_C64(0xBC34928885888892), - SPH_C64(0x3EA4C89AB39A9AC8), SPH_C64(0x0B2DBE266A2626BE), - SPH_C64(0xBF8DFA32563232FA), SPH_C64(0x59E94AB0CDB0B04A), - SPH_C64(0xF21B6AE926E9E96A), SPH_C64(0x7778330F110F0F33), - SPH_C64(0x33E6A6D562D5D5A6), SPH_C64(0xF474BA809D8080BA), - SPH_C64(0x27997CBEDFBEBE7C), SPH_C64(0xEB26DECD4ACDCDDE), - SPH_C64(0x89BDE4345C3434E4), SPH_C64(0x327A7548D8484875), - SPH_C64(0x54AB24FF1CFFFF24), SPH_C64(0x8DF78F7A8E7A7A8F), - SPH_C64(0x64F4EA90AD9090EA), SPH_C64(0x9DC23E5FE15F5F3E), - SPH_C64(0x3D1DA020602020A0), SPH_C64(0x0F67D568B86868D5), - SPH_C64(0xCAD0721A2E1A1A72), SPH_C64(0xB7192CAEEFAEAE2C), - SPH_C64(0x7DC95EB4C1B4B45E), SPH_C64(0xCE9A1954FC545419), - SPH_C64(0x7FECE593A89393E5), SPH_C64(0x2F0DAA22662222AA), - SPH_C64(0x6307E964AC6464E9), SPH_C64(0x2ADB12F10EF1F112), - SPH_C64(0xCCBFA273957373A2), SPH_C64(0x82905A123612125A), - SPH_C64(0x7A3A5D40C040405D), SPH_C64(0x4840280818080828), - SPH_C64(0x9556E8C358C3C3E8), SPH_C64(0xDF337BEC29ECEC7B), - SPH_C64(0x4D9690DB70DBDB90), SPH_C64(0xC0611FA1FEA1A11F), - SPH_C64(0x911C838D8A8D8D83), SPH_C64(0xC8F5C93D473D3DC9), - SPH_C64(0x5BCCF197A49797F1), SPH_C64(0x0000000000000000), - SPH_C64(0xF936D4CF4CCFCFD4), SPH_C64(0x6E45872B7D2B2B87), - SPH_C64(0xE197B3769A7676B3), SPH_C64(0xE664B0829B8282B0), - SPH_C64(0x28FEA9D667D6D6A9), SPH_C64(0xC3D8771B2D1B1B77), - SPH_C64(0x74C15BB5C2B5B55B), SPH_C64(0xBE1129AFECAFAF29), - SPH_C64(0x1D77DF6ABE6A6ADF), SPH_C64(0xEABA0D50F050500D), - SPH_C64(0x57124C45CF45454C), SPH_C64(0x38CB18F308F3F318), - SPH_C64(0xAD9DF030503030F0), SPH_C64(0xC42B74EF2CEFEF74), - SPH_C64(0xDAE5C33F413F3FC3), SPH_C64(0xC7921C55FF55551C), - SPH_C64(0xDB7910A2FBA2A210), SPH_C64(0xE90365EA23EAEA65), - SPH_C64(0x6A0FEC65AF6565EC), SPH_C64(0x03B968BAD3BABA68), - SPH_C64(0x4A65932F712F2F93), SPH_C64(0x8E4EE7C05DC0C0E7), - SPH_C64(0x60BE81DE7FDEDE81), SPH_C64(0xFCE06C1C241C1C6C), - SPH_C64(0x46BB2EFD1AFDFD2E), SPH_C64(0x1F52644DD74D4D64), - SPH_C64(0x76E4E092AB9292E0), SPH_C64(0xFA8FBC759F7575BC), - SPH_C64(0x36301E060A06061E), SPH_C64(0xAE24988A838A8A98), - SPH_C64(0x4BF940B2CBB2B240), SPH_C64(0x856359E637E6E659), - SPH_C64(0x7E70360E120E0E36), SPH_C64(0xE7F8631F211F1F63), - SPH_C64(0x5537F762A66262F7), SPH_C64(0x3AEEA3D461D4D4A3), - SPH_C64(0x812932A8E5A8A832), SPH_C64(0x52C4F496A79696F4), - SPH_C64(0x629B3AF916F9F93A), SPH_C64(0xA366F6C552C5C5F6), - SPH_C64(0x1035B1256F2525B1), SPH_C64(0xABF22059EB595920), - SPH_C64(0xD054AE84918484AE), SPH_C64(0xC5B7A772967272A7), - SPH_C64(0xECD5DD394B3939DD), SPH_C64(0x165A614CD44C4C61), - SPH_C64(0x94CA3B5EE25E5E3B), SPH_C64(0x9FE7857888787885), - SPH_C64(0xE5DDD838483838D8), SPH_C64(0x9814868C898C8C86), - SPH_C64(0x17C6B2D16ED1D1B2), SPH_C64(0xE4410BA5F2A5A50B), - SPH_C64(0xA1434DE23BE2E24D), SPH_C64(0x4E2FF861A36161F8), - SPH_C64(0x42F145B3C8B3B345), SPH_C64(0x3415A521632121A5), - SPH_C64(0x0894D69CB99C9CD6), SPH_C64(0xEEF0661E221E1E66), - SPH_C64(0x61225243C5434352), SPH_C64(0xB176FCC754C7C7FC), - SPH_C64(0x4FB32BFC19FCFC2B), SPH_C64(0x242014040C040414), - SPH_C64(0xE3B20851F3515108), SPH_C64(0x25BCC799B69999C7), - SPH_C64(0x224FC46DB76D6DC4), SPH_C64(0x6568390D170D0D39), - SPH_C64(0x798335FA13FAFA35), SPH_C64(0x69B684DF7CDFDF84), - SPH_C64(0xA9D79B7E827E7E9B), SPH_C64(0x193DB4246C2424B4), - SPH_C64(0xFEC5D73B4D3B3BD7), SPH_C64(0x9A313DABE0ABAB3D), - SPH_C64(0xF03ED1CE4FCECED1), SPH_C64(0x9988551133111155), - SPH_C64(0x830C898F8C8F8F89), SPH_C64(0x044A6B4ED24E4E6B), - SPH_C64(0x66D151B7C4B7B751), SPH_C64(0xE00B60EB20EBEB60), - SPH_C64(0xC1FDCC3C443C3CCC), SPH_C64(0xFD7CBF819E8181BF), - SPH_C64(0x40D4FE94A19494FE), SPH_C64(0x1CEB0CF704F7F70C), - SPH_C64(0x18A167B9D6B9B967), SPH_C64(0x8B985F133513135F), - SPH_C64(0x517D9C2C742C2C9C), SPH_C64(0x05D6B8D368D3D3B8), - SPH_C64(0x8C6B5CE734E7E75C), SPH_C64(0x3957CB6EB26E6ECB), - SPH_C64(0xAA6EF3C451C4C4F3), SPH_C64(0x1B180F030503030F), - SPH_C64(0xDC8A1356FA565613), SPH_C64(0x5E1A4944CC444449), - SPH_C64(0xA0DF9E7F817F7F9E), SPH_C64(0x882137A9E6A9A937), - SPH_C64(0x674D822A7E2A2A82), SPH_C64(0x0AB16DBBD0BBBB6D), - SPH_C64(0x8746E2C15EC1C1E2), SPH_C64(0xF1A20253F5535302), - SPH_C64(0x72AE8BDC79DCDC8B), SPH_C64(0x5358270B1D0B0B27), - SPH_C64(0x019CD39DBA9D9DD3), SPH_C64(0x2B47C16CB46C6CC1), - SPH_C64(0xA495F531533131F5), SPH_C64(0xF387B9749C7474B9), - SPH_C64(0x15E309F607F6F609), SPH_C64(0x4C0A4346CA464643), - SPH_C64(0xA50926ACE9ACAC26), SPH_C64(0xB53C978986898997), - SPH_C64(0xB4A044143C141444), SPH_C64(0xBA5B42E13EE1E142), - SPH_C64(0xA6B04E163A16164E), SPH_C64(0xF7CDD23A4E3A3AD2), - SPH_C64(0x066FD069BB6969D0), SPH_C64(0x41482D091B09092D), - SPH_C64(0xD7A7AD70907070AD), SPH_C64(0x6FD954B6C7B6B654), - SPH_C64(0x1ECEB7D06DD0D0B7), SPH_C64(0xD63B7EED2AEDED7E), - SPH_C64(0xE22EDBCC49CCCCDB), SPH_C64(0x682A5742C6424257), - SPH_C64(0x2CB4C298B59898C2), SPH_C64(0xED490EA4F1A4A40E), - SPH_C64(0x755D882878282888), SPH_C64(0x86DA315CE45C5C31), - SPH_C64(0x6B933FF815F8F83F), SPH_C64(0xC244A486978686A4) -}; - -static const uint64_t old1_T2[256] = { - SPH_C64(0xC0781828181878D8), SPH_C64(0x05AF23652323AF26), - SPH_C64(0x7EF9C657C6C6F9B8), SPH_C64(0x136FE825E8E86FFB), - SPH_C64(0x4CA187948787A1CB), SPH_C64(0xA962B8D5B8B86211), - SPH_C64(0x0805010301010509), SPH_C64(0x426E4FD14F4F6E0D), - SPH_C64(0xADEE365A3636EE9B), SPH_C64(0x5904A6F7A6A604FF), - SPH_C64(0xDEBDD26BD2D2BD0C), SPH_C64(0xFB06F502F5F5060E), - SPH_C64(0xEF80798B79798096), SPH_C64(0x5FCE6FB16F6FCE30), - SPH_C64(0xFCEF91AE9191EF6D), SPH_C64(0xAA0752F6525207F8), - SPH_C64(0x27FD60A06060FD47), SPH_C64(0x8976BCD9BCBC7635), - SPH_C64(0xACCD9BB09B9BCD37), SPH_C64(0x048C8E8F8E8E8C8A), - SPH_C64(0x7115A3F8A3A315D2), SPH_C64(0x603C0C140C0C3C6C), - SPH_C64(0xFF8A7B8D7B7B8A84), SPH_C64(0xB5E1355F3535E180), - SPH_C64(0xE8691D271D1D69F5), SPH_C64(0x5347E03DE0E047B3), - SPH_C64(0xF6ACD764D7D7AC21), SPH_C64(0x5EEDC25BC2C2ED9C), - SPH_C64(0x6D962E722E2E9643), SPH_C64(0x627A4BDD4B4B7A29), - SPH_C64(0xA321FE1FFEFE215D), SPH_C64(0x821657F9575716D5), - SPH_C64(0xA841153F151541BD), SPH_C64(0x9FB677997777B6E8), - SPH_C64(0xA5EB37593737EB92), SPH_C64(0x7B56E532E5E5569E), - SPH_C64(0x8CD99FBC9F9FD913), SPH_C64(0xD317F00DF0F01723), - SPH_C64(0x6A7F4ADE4A4A7F20), SPH_C64(0x9E95DA73DADA9544), - SPH_C64(0xFA2558E8585825A2), SPH_C64(0x06CAC946C9C9CACF), - SPH_C64(0x558D297B29298D7C), SPH_C64(0x50220A1E0A0A225A), - SPH_C64(0xE14FB1CEB1B14F50), SPH_C64(0x691AA0FDA0A01AC9), - SPH_C64(0x7FDA6BBD6B6BDA14), SPH_C64(0x5CAB85928585ABD9), - SPH_C64(0x8173BDDABDBD733C), SPH_C64(0xD2345DE75D5D348F), - SPH_C64(0x8050103010105090), SPH_C64(0xF303F401F4F40307), - SPH_C64(0x16C0CB40CBCBC0DD), SPH_C64(0xEDC63E423E3EC6D3), - SPH_C64(0x2811050F0505112D), SPH_C64(0x1FE667A96767E678), - SPH_C64(0x7353E431E4E45397), SPH_C64(0x25BB27692727BB02), - SPH_C64(0x325841C341415873), SPH_C64(0x2C9D8B808B8B9DA7), - SPH_C64(0x5101A7F4A7A701F6), SPH_C64(0xCF947D877D7D94B2), - SPH_C64(0xDCFB95A29595FB49), SPH_C64(0x8E9FD875D8D89F56), - SPH_C64(0x8B30FB10FBFB3070), SPH_C64(0x2371EE2FEEEE71CD), - SPH_C64(0xC7917C847C7C91BB), SPH_C64(0x17E366AA6666E371), - SPH_C64(0xA68EDD7ADDDD8E7B), SPH_C64(0xB84B173917174BAF), - SPH_C64(0x024647C947474645), SPH_C64(0x84DC9EBF9E9EDC1A), - SPH_C64(0x1EC5CA43CACAC5D4), SPH_C64(0x75992D772D2D9958), - SPH_C64(0x9179BFDCBFBF792E), SPH_C64(0x381B070907071B3F), - SPH_C64(0x0123ADEAADAD23AC), SPH_C64(0xEA2F5AEE5A5A2FB0), - SPH_C64(0x6CB583988383B5EF), SPH_C64(0x85FF33553333FFB6), - SPH_C64(0x3FF263A56363F25C), SPH_C64(0x100A020602020A12), - SPH_C64(0x3938AAE3AAAA3893), SPH_C64(0xAFA871937171A8DE), - SPH_C64(0x0ECFC845C8C8CFC6), SPH_C64(0xC87D192B19197DD1), - SPH_C64(0x727049DB4949703B), SPH_C64(0x869AD976D9D99A5F), - SPH_C64(0xC31DF20BF2F21D31), SPH_C64(0x4B48E338E3E348A8), - SPH_C64(0xE22A5BED5B5B2AB9), SPH_C64(0x34928885888892BC), - SPH_C64(0xA4C89AB39A9AC83E), SPH_C64(0x2DBE266A2626BE0B), - SPH_C64(0x8DFA32563232FABF), SPH_C64(0xE94AB0CDB0B04A59), - SPH_C64(0x1B6AE926E9E96AF2), SPH_C64(0x78330F110F0F3377), - SPH_C64(0xE6A6D562D5D5A633), SPH_C64(0x74BA809D8080BAF4), - SPH_C64(0x997CBEDFBEBE7C27), SPH_C64(0x26DECD4ACDCDDEEB), - SPH_C64(0xBDE4345C3434E489), SPH_C64(0x7A7548D848487532), - SPH_C64(0xAB24FF1CFFFF2454), SPH_C64(0xF78F7A8E7A7A8F8D), - SPH_C64(0xF4EA90AD9090EA64), SPH_C64(0xC23E5FE15F5F3E9D), - SPH_C64(0x1DA020602020A03D), SPH_C64(0x67D568B86868D50F), - SPH_C64(0xD0721A2E1A1A72CA), SPH_C64(0x192CAEEFAEAE2CB7), - SPH_C64(0xC95EB4C1B4B45E7D), SPH_C64(0x9A1954FC545419CE), - SPH_C64(0xECE593A89393E57F), SPH_C64(0x0DAA22662222AA2F), - SPH_C64(0x07E964AC6464E963), SPH_C64(0xDB12F10EF1F1122A), - SPH_C64(0xBFA273957373A2CC), SPH_C64(0x905A123612125A82), - SPH_C64(0x3A5D40C040405D7A), SPH_C64(0x4028081808082848), - SPH_C64(0x56E8C358C3C3E895), SPH_C64(0x337BEC29ECEC7BDF), - SPH_C64(0x9690DB70DBDB904D), SPH_C64(0x611FA1FEA1A11FC0), - SPH_C64(0x1C838D8A8D8D8391), SPH_C64(0xF5C93D473D3DC9C8), - SPH_C64(0xCCF197A49797F15B), SPH_C64(0x0000000000000000), - SPH_C64(0x36D4CF4CCFCFD4F9), SPH_C64(0x45872B7D2B2B876E), - SPH_C64(0x97B3769A7676B3E1), SPH_C64(0x64B0829B8282B0E6), - SPH_C64(0xFEA9D667D6D6A928), SPH_C64(0xD8771B2D1B1B77C3), - SPH_C64(0xC15BB5C2B5B55B74), SPH_C64(0x1129AFECAFAF29BE), - SPH_C64(0x77DF6ABE6A6ADF1D), SPH_C64(0xBA0D50F050500DEA), - SPH_C64(0x124C45CF45454C57), SPH_C64(0xCB18F308F3F31838), - SPH_C64(0x9DF030503030F0AD), SPH_C64(0x2B74EF2CEFEF74C4), - SPH_C64(0xE5C33F413F3FC3DA), SPH_C64(0x921C55FF55551CC7), - SPH_C64(0x7910A2FBA2A210DB), SPH_C64(0x0365EA23EAEA65E9), - SPH_C64(0x0FEC65AF6565EC6A), SPH_C64(0xB968BAD3BABA6803), - SPH_C64(0x65932F712F2F934A), SPH_C64(0x4EE7C05DC0C0E78E), - SPH_C64(0xBE81DE7FDEDE8160), SPH_C64(0xE06C1C241C1C6CFC), - SPH_C64(0xBB2EFD1AFDFD2E46), SPH_C64(0x52644DD74D4D641F), - SPH_C64(0xE4E092AB9292E076), SPH_C64(0x8FBC759F7575BCFA), - SPH_C64(0x301E060A06061E36), SPH_C64(0x24988A838A8A98AE), - SPH_C64(0xF940B2CBB2B2404B), SPH_C64(0x6359E637E6E65985), - SPH_C64(0x70360E120E0E367E), SPH_C64(0xF8631F211F1F63E7), - SPH_C64(0x37F762A66262F755), SPH_C64(0xEEA3D461D4D4A33A), - SPH_C64(0x2932A8E5A8A83281), SPH_C64(0xC4F496A79696F452), - SPH_C64(0x9B3AF916F9F93A62), SPH_C64(0x66F6C552C5C5F6A3), - SPH_C64(0x35B1256F2525B110), SPH_C64(0xF22059EB595920AB), - SPH_C64(0x54AE84918484AED0), SPH_C64(0xB7A772967272A7C5), - SPH_C64(0xD5DD394B3939DDEC), SPH_C64(0x5A614CD44C4C6116), - SPH_C64(0xCA3B5EE25E5E3B94), SPH_C64(0xE78578887878859F), - SPH_C64(0xDDD838483838D8E5), SPH_C64(0x14868C898C8C8698), - SPH_C64(0xC6B2D16ED1D1B217), SPH_C64(0x410BA5F2A5A50BE4), - SPH_C64(0x434DE23BE2E24DA1), SPH_C64(0x2FF861A36161F84E), - SPH_C64(0xF145B3C8B3B34542), SPH_C64(0x15A521632121A534), - SPH_C64(0x94D69CB99C9CD608), SPH_C64(0xF0661E221E1E66EE), - SPH_C64(0x225243C543435261), SPH_C64(0x76FCC754C7C7FCB1), - SPH_C64(0xB32BFC19FCFC2B4F), SPH_C64(0x2014040C04041424), - SPH_C64(0xB20851F3515108E3), SPH_C64(0xBCC799B69999C725), - SPH_C64(0x4FC46DB76D6DC422), SPH_C64(0x68390D170D0D3965), - SPH_C64(0x8335FA13FAFA3579), SPH_C64(0xB684DF7CDFDF8469), - SPH_C64(0xD79B7E827E7E9BA9), SPH_C64(0x3DB4246C2424B419), - SPH_C64(0xC5D73B4D3B3BD7FE), SPH_C64(0x313DABE0ABAB3D9A), - SPH_C64(0x3ED1CE4FCECED1F0), SPH_C64(0x8855113311115599), - SPH_C64(0x0C898F8C8F8F8983), SPH_C64(0x4A6B4ED24E4E6B04), - SPH_C64(0xD151B7C4B7B75166), SPH_C64(0x0B60EB20EBEB60E0), - SPH_C64(0xFDCC3C443C3CCCC1), SPH_C64(0x7CBF819E8181BFFD), - SPH_C64(0xD4FE94A19494FE40), SPH_C64(0xEB0CF704F7F70C1C), - SPH_C64(0xA167B9D6B9B96718), SPH_C64(0x985F133513135F8B), - SPH_C64(0x7D9C2C742C2C9C51), SPH_C64(0xD6B8D368D3D3B805), - SPH_C64(0x6B5CE734E7E75C8C), SPH_C64(0x57CB6EB26E6ECB39), - SPH_C64(0x6EF3C451C4C4F3AA), SPH_C64(0x180F030503030F1B), - SPH_C64(0x8A1356FA565613DC), SPH_C64(0x1A4944CC4444495E), - SPH_C64(0xDF9E7F817F7F9EA0), SPH_C64(0x2137A9E6A9A93788), - SPH_C64(0x4D822A7E2A2A8267), SPH_C64(0xB16DBBD0BBBB6D0A), - SPH_C64(0x46E2C15EC1C1E287), SPH_C64(0xA20253F5535302F1), - SPH_C64(0xAE8BDC79DCDC8B72), SPH_C64(0x58270B1D0B0B2753), - SPH_C64(0x9CD39DBA9D9DD301), SPH_C64(0x47C16CB46C6CC12B), - SPH_C64(0x95F531533131F5A4), SPH_C64(0x87B9749C7474B9F3), - SPH_C64(0xE309F607F6F60915), SPH_C64(0x0A4346CA4646434C), - SPH_C64(0x0926ACE9ACAC26A5), SPH_C64(0x3C978986898997B5), - SPH_C64(0xA044143C141444B4), SPH_C64(0x5B42E13EE1E142BA), - SPH_C64(0xB04E163A16164EA6), SPH_C64(0xCDD23A4E3A3AD2F7), - SPH_C64(0x6FD069BB6969D006), SPH_C64(0x482D091B09092D41), - SPH_C64(0xA7AD70907070ADD7), SPH_C64(0xD954B6C7B6B6546F), - SPH_C64(0xCEB7D06DD0D0B71E), SPH_C64(0x3B7EED2AEDED7ED6), - SPH_C64(0x2EDBCC49CCCCDBE2), SPH_C64(0x2A5742C642425768), - SPH_C64(0xB4C298B59898C22C), SPH_C64(0x490EA4F1A4A40EED), - SPH_C64(0x5D88287828288875), SPH_C64(0xDA315CE45C5C3186), - SPH_C64(0x933FF815F8F83F6B), SPH_C64(0x44A486978686A4C2) -}; - -static const uint64_t old1_T3[256] = { - SPH_C64(0x781828181878D8C0), SPH_C64(0xAF23652323AF2605), - SPH_C64(0xF9C657C6C6F9B87E), SPH_C64(0x6FE825E8E86FFB13), - SPH_C64(0xA187948787A1CB4C), SPH_C64(0x62B8D5B8B86211A9), - SPH_C64(0x0501030101050908), SPH_C64(0x6E4FD14F4F6E0D42), - SPH_C64(0xEE365A3636EE9BAD), SPH_C64(0x04A6F7A6A604FF59), - SPH_C64(0xBDD26BD2D2BD0CDE), SPH_C64(0x06F502F5F5060EFB), - SPH_C64(0x80798B79798096EF), SPH_C64(0xCE6FB16F6FCE305F), - SPH_C64(0xEF91AE9191EF6DFC), SPH_C64(0x0752F6525207F8AA), - SPH_C64(0xFD60A06060FD4727), SPH_C64(0x76BCD9BCBC763589), - SPH_C64(0xCD9BB09B9BCD37AC), SPH_C64(0x8C8E8F8E8E8C8A04), - SPH_C64(0x15A3F8A3A315D271), SPH_C64(0x3C0C140C0C3C6C60), - SPH_C64(0x8A7B8D7B7B8A84FF), SPH_C64(0xE1355F3535E180B5), - SPH_C64(0x691D271D1D69F5E8), SPH_C64(0x47E03DE0E047B353), - SPH_C64(0xACD764D7D7AC21F6), SPH_C64(0xEDC25BC2C2ED9C5E), - SPH_C64(0x962E722E2E96436D), SPH_C64(0x7A4BDD4B4B7A2962), - SPH_C64(0x21FE1FFEFE215DA3), SPH_C64(0x1657F9575716D582), - SPH_C64(0x41153F151541BDA8), SPH_C64(0xB677997777B6E89F), - SPH_C64(0xEB37593737EB92A5), SPH_C64(0x56E532E5E5569E7B), - SPH_C64(0xD99FBC9F9FD9138C), SPH_C64(0x17F00DF0F01723D3), - SPH_C64(0x7F4ADE4A4A7F206A), SPH_C64(0x95DA73DADA95449E), - SPH_C64(0x2558E8585825A2FA), SPH_C64(0xCAC946C9C9CACF06), - SPH_C64(0x8D297B29298D7C55), SPH_C64(0x220A1E0A0A225A50), - SPH_C64(0x4FB1CEB1B14F50E1), SPH_C64(0x1AA0FDA0A01AC969), - SPH_C64(0xDA6BBD6B6BDA147F), SPH_C64(0xAB85928585ABD95C), - SPH_C64(0x73BDDABDBD733C81), SPH_C64(0x345DE75D5D348FD2), - SPH_C64(0x5010301010509080), SPH_C64(0x03F401F4F40307F3), - SPH_C64(0xC0CB40CBCBC0DD16), SPH_C64(0xC63E423E3EC6D3ED), - SPH_C64(0x11050F0505112D28), SPH_C64(0xE667A96767E6781F), - SPH_C64(0x53E431E4E4539773), SPH_C64(0xBB27692727BB0225), - SPH_C64(0x5841C34141587332), SPH_C64(0x9D8B808B8B9DA72C), - SPH_C64(0x01A7F4A7A701F651), SPH_C64(0x947D877D7D94B2CF), - SPH_C64(0xFB95A29595FB49DC), SPH_C64(0x9FD875D8D89F568E), - SPH_C64(0x30FB10FBFB30708B), SPH_C64(0x71EE2FEEEE71CD23), - SPH_C64(0x917C847C7C91BBC7), SPH_C64(0xE366AA6666E37117), - SPH_C64(0x8EDD7ADDDD8E7BA6), SPH_C64(0x4B173917174BAFB8), - SPH_C64(0x4647C94747464502), SPH_C64(0xDC9EBF9E9EDC1A84), - SPH_C64(0xC5CA43CACAC5D41E), SPH_C64(0x992D772D2D995875), - SPH_C64(0x79BFDCBFBF792E91), SPH_C64(0x1B070907071B3F38), - SPH_C64(0x23ADEAADAD23AC01), SPH_C64(0x2F5AEE5A5A2FB0EA), - SPH_C64(0xB583988383B5EF6C), SPH_C64(0xFF33553333FFB685), - SPH_C64(0xF263A56363F25C3F), SPH_C64(0x0A020602020A1210), - SPH_C64(0x38AAE3AAAA389339), SPH_C64(0xA871937171A8DEAF), - SPH_C64(0xCFC845C8C8CFC60E), SPH_C64(0x7D192B19197DD1C8), - SPH_C64(0x7049DB4949703B72), SPH_C64(0x9AD976D9D99A5F86), - SPH_C64(0x1DF20BF2F21D31C3), SPH_C64(0x48E338E3E348A84B), - SPH_C64(0x2A5BED5B5B2AB9E2), SPH_C64(0x928885888892BC34), - SPH_C64(0xC89AB39A9AC83EA4), SPH_C64(0xBE266A2626BE0B2D), - SPH_C64(0xFA32563232FABF8D), SPH_C64(0x4AB0CDB0B04A59E9), - SPH_C64(0x6AE926E9E96AF21B), SPH_C64(0x330F110F0F337778), - SPH_C64(0xA6D562D5D5A633E6), SPH_C64(0xBA809D8080BAF474), - SPH_C64(0x7CBEDFBEBE7C2799), SPH_C64(0xDECD4ACDCDDEEB26), - SPH_C64(0xE4345C3434E489BD), SPH_C64(0x7548D8484875327A), - SPH_C64(0x24FF1CFFFF2454AB), SPH_C64(0x8F7A8E7A7A8F8DF7), - SPH_C64(0xEA90AD9090EA64F4), SPH_C64(0x3E5FE15F5F3E9DC2), - SPH_C64(0xA020602020A03D1D), SPH_C64(0xD568B86868D50F67), - SPH_C64(0x721A2E1A1A72CAD0), SPH_C64(0x2CAEEFAEAE2CB719), - SPH_C64(0x5EB4C1B4B45E7DC9), SPH_C64(0x1954FC545419CE9A), - SPH_C64(0xE593A89393E57FEC), SPH_C64(0xAA22662222AA2F0D), - SPH_C64(0xE964AC6464E96307), SPH_C64(0x12F10EF1F1122ADB), - SPH_C64(0xA273957373A2CCBF), SPH_C64(0x5A123612125A8290), - SPH_C64(0x5D40C040405D7A3A), SPH_C64(0x2808180808284840), - SPH_C64(0xE8C358C3C3E89556), SPH_C64(0x7BEC29ECEC7BDF33), - SPH_C64(0x90DB70DBDB904D96), SPH_C64(0x1FA1FEA1A11FC061), - SPH_C64(0x838D8A8D8D83911C), SPH_C64(0xC93D473D3DC9C8F5), - SPH_C64(0xF197A49797F15BCC), SPH_C64(0x0000000000000000), - SPH_C64(0xD4CF4CCFCFD4F936), SPH_C64(0x872B7D2B2B876E45), - SPH_C64(0xB3769A7676B3E197), SPH_C64(0xB0829B8282B0E664), - SPH_C64(0xA9D667D6D6A928FE), SPH_C64(0x771B2D1B1B77C3D8), - SPH_C64(0x5BB5C2B5B55B74C1), SPH_C64(0x29AFECAFAF29BE11), - SPH_C64(0xDF6ABE6A6ADF1D77), SPH_C64(0x0D50F050500DEABA), - SPH_C64(0x4C45CF45454C5712), SPH_C64(0x18F308F3F31838CB), - SPH_C64(0xF030503030F0AD9D), SPH_C64(0x74EF2CEFEF74C42B), - SPH_C64(0xC33F413F3FC3DAE5), SPH_C64(0x1C55FF55551CC792), - SPH_C64(0x10A2FBA2A210DB79), SPH_C64(0x65EA23EAEA65E903), - SPH_C64(0xEC65AF6565EC6A0F), SPH_C64(0x68BAD3BABA6803B9), - SPH_C64(0x932F712F2F934A65), SPH_C64(0xE7C05DC0C0E78E4E), - SPH_C64(0x81DE7FDEDE8160BE), SPH_C64(0x6C1C241C1C6CFCE0), - SPH_C64(0x2EFD1AFDFD2E46BB), SPH_C64(0x644DD74D4D641F52), - SPH_C64(0xE092AB9292E076E4), SPH_C64(0xBC759F7575BCFA8F), - SPH_C64(0x1E060A06061E3630), SPH_C64(0x988A838A8A98AE24), - SPH_C64(0x40B2CBB2B2404BF9), SPH_C64(0x59E637E6E6598563), - SPH_C64(0x360E120E0E367E70), SPH_C64(0x631F211F1F63E7F8), - SPH_C64(0xF762A66262F75537), SPH_C64(0xA3D461D4D4A33AEE), - SPH_C64(0x32A8E5A8A8328129), SPH_C64(0xF496A79696F452C4), - SPH_C64(0x3AF916F9F93A629B), SPH_C64(0xF6C552C5C5F6A366), - SPH_C64(0xB1256F2525B11035), SPH_C64(0x2059EB595920ABF2), - SPH_C64(0xAE84918484AED054), SPH_C64(0xA772967272A7C5B7), - SPH_C64(0xDD394B3939DDECD5), SPH_C64(0x614CD44C4C61165A), - SPH_C64(0x3B5EE25E5E3B94CA), SPH_C64(0x8578887878859FE7), - SPH_C64(0xD838483838D8E5DD), SPH_C64(0x868C898C8C869814), - SPH_C64(0xB2D16ED1D1B217C6), SPH_C64(0x0BA5F2A5A50BE441), - SPH_C64(0x4DE23BE2E24DA143), SPH_C64(0xF861A36161F84E2F), - SPH_C64(0x45B3C8B3B34542F1), SPH_C64(0xA521632121A53415), - SPH_C64(0xD69CB99C9CD60894), SPH_C64(0x661E221E1E66EEF0), - SPH_C64(0x5243C54343526122), SPH_C64(0xFCC754C7C7FCB176), - SPH_C64(0x2BFC19FCFC2B4FB3), SPH_C64(0x14040C0404142420), - SPH_C64(0x0851F3515108E3B2), SPH_C64(0xC799B69999C725BC), - SPH_C64(0xC46DB76D6DC4224F), SPH_C64(0x390D170D0D396568), - SPH_C64(0x35FA13FAFA357983), SPH_C64(0x84DF7CDFDF8469B6), - SPH_C64(0x9B7E827E7E9BA9D7), SPH_C64(0xB4246C2424B4193D), - SPH_C64(0xD73B4D3B3BD7FEC5), SPH_C64(0x3DABE0ABAB3D9A31), - SPH_C64(0xD1CE4FCECED1F03E), SPH_C64(0x5511331111559988), - SPH_C64(0x898F8C8F8F89830C), SPH_C64(0x6B4ED24E4E6B044A), - SPH_C64(0x51B7C4B7B75166D1), SPH_C64(0x60EB20EBEB60E00B), - SPH_C64(0xCC3C443C3CCCC1FD), SPH_C64(0xBF819E8181BFFD7C), - SPH_C64(0xFE94A19494FE40D4), SPH_C64(0x0CF704F7F70C1CEB), - SPH_C64(0x67B9D6B9B96718A1), SPH_C64(0x5F133513135F8B98), - SPH_C64(0x9C2C742C2C9C517D), SPH_C64(0xB8D368D3D3B805D6), - SPH_C64(0x5CE734E7E75C8C6B), SPH_C64(0xCB6EB26E6ECB3957), - SPH_C64(0xF3C451C4C4F3AA6E), SPH_C64(0x0F030503030F1B18), - SPH_C64(0x1356FA565613DC8A), SPH_C64(0x4944CC4444495E1A), - SPH_C64(0x9E7F817F7F9EA0DF), SPH_C64(0x37A9E6A9A9378821), - SPH_C64(0x822A7E2A2A82674D), SPH_C64(0x6DBBD0BBBB6D0AB1), - SPH_C64(0xE2C15EC1C1E28746), SPH_C64(0x0253F5535302F1A2), - SPH_C64(0x8BDC79DCDC8B72AE), SPH_C64(0x270B1D0B0B275358), - SPH_C64(0xD39DBA9D9DD3019C), SPH_C64(0xC16CB46C6CC12B47), - SPH_C64(0xF531533131F5A495), SPH_C64(0xB9749C7474B9F387), - SPH_C64(0x09F607F6F60915E3), SPH_C64(0x4346CA4646434C0A), - SPH_C64(0x26ACE9ACAC26A509), SPH_C64(0x978986898997B53C), - SPH_C64(0x44143C141444B4A0), SPH_C64(0x42E13EE1E142BA5B), - SPH_C64(0x4E163A16164EA6B0), SPH_C64(0xD23A4E3A3AD2F7CD), - SPH_C64(0xD069BB6969D0066F), SPH_C64(0x2D091B09092D4148), - SPH_C64(0xAD70907070ADD7A7), SPH_C64(0x54B6C7B6B6546FD9), - SPH_C64(0xB7D06DD0D0B71ECE), SPH_C64(0x7EED2AEDED7ED63B), - SPH_C64(0xDBCC49CCCCDBE22E), SPH_C64(0x5742C6424257682A), - SPH_C64(0xC298B59898C22CB4), SPH_C64(0x0EA4F1A4A40EED49), - SPH_C64(0x882878282888755D), SPH_C64(0x315CE45C5C3186DA), - SPH_C64(0x3FF815F8F83F6B93), SPH_C64(0xA486978686A4C244) -}; - -static const uint64_t old1_T4[256] = { - SPH_C64(0x1828181878D8C078), SPH_C64(0x23652323AF2605AF), - SPH_C64(0xC657C6C6F9B87EF9), SPH_C64(0xE825E8E86FFB136F), - SPH_C64(0x87948787A1CB4CA1), SPH_C64(0xB8D5B8B86211A962), - SPH_C64(0x0103010105090805), SPH_C64(0x4FD14F4F6E0D426E), - SPH_C64(0x365A3636EE9BADEE), SPH_C64(0xA6F7A6A604FF5904), - SPH_C64(0xD26BD2D2BD0CDEBD), SPH_C64(0xF502F5F5060EFB06), - SPH_C64(0x798B79798096EF80), SPH_C64(0x6FB16F6FCE305FCE), - SPH_C64(0x91AE9191EF6DFCEF), SPH_C64(0x52F6525207F8AA07), - SPH_C64(0x60A06060FD4727FD), SPH_C64(0xBCD9BCBC76358976), - SPH_C64(0x9BB09B9BCD37ACCD), SPH_C64(0x8E8F8E8E8C8A048C), - SPH_C64(0xA3F8A3A315D27115), SPH_C64(0x0C140C0C3C6C603C), - SPH_C64(0x7B8D7B7B8A84FF8A), SPH_C64(0x355F3535E180B5E1), - SPH_C64(0x1D271D1D69F5E869), SPH_C64(0xE03DE0E047B35347), - SPH_C64(0xD764D7D7AC21F6AC), SPH_C64(0xC25BC2C2ED9C5EED), - SPH_C64(0x2E722E2E96436D96), SPH_C64(0x4BDD4B4B7A29627A), - SPH_C64(0xFE1FFEFE215DA321), SPH_C64(0x57F9575716D58216), - SPH_C64(0x153F151541BDA841), SPH_C64(0x77997777B6E89FB6), - SPH_C64(0x37593737EB92A5EB), SPH_C64(0xE532E5E5569E7B56), - SPH_C64(0x9FBC9F9FD9138CD9), SPH_C64(0xF00DF0F01723D317), - SPH_C64(0x4ADE4A4A7F206A7F), SPH_C64(0xDA73DADA95449E95), - SPH_C64(0x58E8585825A2FA25), SPH_C64(0xC946C9C9CACF06CA), - SPH_C64(0x297B29298D7C558D), SPH_C64(0x0A1E0A0A225A5022), - SPH_C64(0xB1CEB1B14F50E14F), SPH_C64(0xA0FDA0A01AC9691A), - SPH_C64(0x6BBD6B6BDA147FDA), SPH_C64(0x85928585ABD95CAB), - SPH_C64(0xBDDABDBD733C8173), SPH_C64(0x5DE75D5D348FD234), - SPH_C64(0x1030101050908050), SPH_C64(0xF401F4F40307F303), - SPH_C64(0xCB40CBCBC0DD16C0), SPH_C64(0x3E423E3EC6D3EDC6), - SPH_C64(0x050F0505112D2811), SPH_C64(0x67A96767E6781FE6), - SPH_C64(0xE431E4E453977353), SPH_C64(0x27692727BB0225BB), - SPH_C64(0x41C3414158733258), SPH_C64(0x8B808B8B9DA72C9D), - SPH_C64(0xA7F4A7A701F65101), SPH_C64(0x7D877D7D94B2CF94), - SPH_C64(0x95A29595FB49DCFB), SPH_C64(0xD875D8D89F568E9F), - SPH_C64(0xFB10FBFB30708B30), SPH_C64(0xEE2FEEEE71CD2371), - SPH_C64(0x7C847C7C91BBC791), SPH_C64(0x66AA6666E37117E3), - SPH_C64(0xDD7ADDDD8E7BA68E), SPH_C64(0x173917174BAFB84B), - SPH_C64(0x47C9474746450246), SPH_C64(0x9EBF9E9EDC1A84DC), - SPH_C64(0xCA43CACAC5D41EC5), SPH_C64(0x2D772D2D99587599), - SPH_C64(0xBFDCBFBF792E9179), SPH_C64(0x070907071B3F381B), - SPH_C64(0xADEAADAD23AC0123), SPH_C64(0x5AEE5A5A2FB0EA2F), - SPH_C64(0x83988383B5EF6CB5), SPH_C64(0x33553333FFB685FF), - SPH_C64(0x63A56363F25C3FF2), SPH_C64(0x020602020A12100A), - SPH_C64(0xAAE3AAAA38933938), SPH_C64(0x71937171A8DEAFA8), - SPH_C64(0xC845C8C8CFC60ECF), SPH_C64(0x192B19197DD1C87D), - SPH_C64(0x49DB4949703B7270), SPH_C64(0xD976D9D99A5F869A), - SPH_C64(0xF20BF2F21D31C31D), SPH_C64(0xE338E3E348A84B48), - SPH_C64(0x5BED5B5B2AB9E22A), SPH_C64(0x8885888892BC3492), - SPH_C64(0x9AB39A9AC83EA4C8), SPH_C64(0x266A2626BE0B2DBE), - SPH_C64(0x32563232FABF8DFA), SPH_C64(0xB0CDB0B04A59E94A), - SPH_C64(0xE926E9E96AF21B6A), SPH_C64(0x0F110F0F33777833), - SPH_C64(0xD562D5D5A633E6A6), SPH_C64(0x809D8080BAF474BA), - SPH_C64(0xBEDFBEBE7C27997C), SPH_C64(0xCD4ACDCDDEEB26DE), - SPH_C64(0x345C3434E489BDE4), SPH_C64(0x48D8484875327A75), - SPH_C64(0xFF1CFFFF2454AB24), SPH_C64(0x7A8E7A7A8F8DF78F), - SPH_C64(0x90AD9090EA64F4EA), SPH_C64(0x5FE15F5F3E9DC23E), - SPH_C64(0x20602020A03D1DA0), SPH_C64(0x68B86868D50F67D5), - SPH_C64(0x1A2E1A1A72CAD072), SPH_C64(0xAEEFAEAE2CB7192C), - SPH_C64(0xB4C1B4B45E7DC95E), SPH_C64(0x54FC545419CE9A19), - SPH_C64(0x93A89393E57FECE5), SPH_C64(0x22662222AA2F0DAA), - SPH_C64(0x64AC6464E96307E9), SPH_C64(0xF10EF1F1122ADB12), - SPH_C64(0x73957373A2CCBFA2), SPH_C64(0x123612125A82905A), - SPH_C64(0x40C040405D7A3A5D), SPH_C64(0x0818080828484028), - SPH_C64(0xC358C3C3E89556E8), SPH_C64(0xEC29ECEC7BDF337B), - SPH_C64(0xDB70DBDB904D9690), SPH_C64(0xA1FEA1A11FC0611F), - SPH_C64(0x8D8A8D8D83911C83), SPH_C64(0x3D473D3DC9C8F5C9), - SPH_C64(0x97A49797F15BCCF1), SPH_C64(0x0000000000000000), - SPH_C64(0xCF4CCFCFD4F936D4), SPH_C64(0x2B7D2B2B876E4587), - SPH_C64(0x769A7676B3E197B3), SPH_C64(0x829B8282B0E664B0), - SPH_C64(0xD667D6D6A928FEA9), SPH_C64(0x1B2D1B1B77C3D877), - SPH_C64(0xB5C2B5B55B74C15B), SPH_C64(0xAFECAFAF29BE1129), - SPH_C64(0x6ABE6A6ADF1D77DF), SPH_C64(0x50F050500DEABA0D), - SPH_C64(0x45CF45454C57124C), SPH_C64(0xF308F3F31838CB18), - SPH_C64(0x30503030F0AD9DF0), SPH_C64(0xEF2CEFEF74C42B74), - SPH_C64(0x3F413F3FC3DAE5C3), SPH_C64(0x55FF55551CC7921C), - SPH_C64(0xA2FBA2A210DB7910), SPH_C64(0xEA23EAEA65E90365), - SPH_C64(0x65AF6565EC6A0FEC), SPH_C64(0xBAD3BABA6803B968), - SPH_C64(0x2F712F2F934A6593), SPH_C64(0xC05DC0C0E78E4EE7), - SPH_C64(0xDE7FDEDE8160BE81), SPH_C64(0x1C241C1C6CFCE06C), - SPH_C64(0xFD1AFDFD2E46BB2E), SPH_C64(0x4DD74D4D641F5264), - SPH_C64(0x92AB9292E076E4E0), SPH_C64(0x759F7575BCFA8FBC), - SPH_C64(0x060A06061E36301E), SPH_C64(0x8A838A8A98AE2498), - SPH_C64(0xB2CBB2B2404BF940), SPH_C64(0xE637E6E659856359), - SPH_C64(0x0E120E0E367E7036), SPH_C64(0x1F211F1F63E7F863), - SPH_C64(0x62A66262F75537F7), SPH_C64(0xD461D4D4A33AEEA3), - SPH_C64(0xA8E5A8A832812932), SPH_C64(0x96A79696F452C4F4), - SPH_C64(0xF916F9F93A629B3A), SPH_C64(0xC552C5C5F6A366F6), - SPH_C64(0x256F2525B11035B1), SPH_C64(0x59EB595920ABF220), - SPH_C64(0x84918484AED054AE), SPH_C64(0x72967272A7C5B7A7), - SPH_C64(0x394B3939DDECD5DD), SPH_C64(0x4CD44C4C61165A61), - SPH_C64(0x5EE25E5E3B94CA3B), SPH_C64(0x78887878859FE785), - SPH_C64(0x38483838D8E5DDD8), SPH_C64(0x8C898C8C86981486), - SPH_C64(0xD16ED1D1B217C6B2), SPH_C64(0xA5F2A5A50BE4410B), - SPH_C64(0xE23BE2E24DA1434D), SPH_C64(0x61A36161F84E2FF8), - SPH_C64(0xB3C8B3B34542F145), SPH_C64(0x21632121A53415A5), - SPH_C64(0x9CB99C9CD60894D6), SPH_C64(0x1E221E1E66EEF066), - SPH_C64(0x43C5434352612252), SPH_C64(0xC754C7C7FCB176FC), - SPH_C64(0xFC19FCFC2B4FB32B), SPH_C64(0x040C040414242014), - SPH_C64(0x51F3515108E3B208), SPH_C64(0x99B69999C725BCC7), - SPH_C64(0x6DB76D6DC4224FC4), SPH_C64(0x0D170D0D39656839), - SPH_C64(0xFA13FAFA35798335), SPH_C64(0xDF7CDFDF8469B684), - SPH_C64(0x7E827E7E9BA9D79B), SPH_C64(0x246C2424B4193DB4), - SPH_C64(0x3B4D3B3BD7FEC5D7), SPH_C64(0xABE0ABAB3D9A313D), - SPH_C64(0xCE4FCECED1F03ED1), SPH_C64(0x1133111155998855), - SPH_C64(0x8F8C8F8F89830C89), SPH_C64(0x4ED24E4E6B044A6B), - SPH_C64(0xB7C4B7B75166D151), SPH_C64(0xEB20EBEB60E00B60), - SPH_C64(0x3C443C3CCCC1FDCC), SPH_C64(0x819E8181BFFD7CBF), - SPH_C64(0x94A19494FE40D4FE), SPH_C64(0xF704F7F70C1CEB0C), - SPH_C64(0xB9D6B9B96718A167), SPH_C64(0x133513135F8B985F), - SPH_C64(0x2C742C2C9C517D9C), SPH_C64(0xD368D3D3B805D6B8), - SPH_C64(0xE734E7E75C8C6B5C), SPH_C64(0x6EB26E6ECB3957CB), - SPH_C64(0xC451C4C4F3AA6EF3), SPH_C64(0x030503030F1B180F), - SPH_C64(0x56FA565613DC8A13), SPH_C64(0x44CC4444495E1A49), - SPH_C64(0x7F817F7F9EA0DF9E), SPH_C64(0xA9E6A9A937882137), - SPH_C64(0x2A7E2A2A82674D82), SPH_C64(0xBBD0BBBB6D0AB16D), - SPH_C64(0xC15EC1C1E28746E2), SPH_C64(0x53F5535302F1A202), - SPH_C64(0xDC79DCDC8B72AE8B), SPH_C64(0x0B1D0B0B27535827), - SPH_C64(0x9DBA9D9DD3019CD3), SPH_C64(0x6CB46C6CC12B47C1), - SPH_C64(0x31533131F5A495F5), SPH_C64(0x749C7474B9F387B9), - SPH_C64(0xF607F6F60915E309), SPH_C64(0x46CA4646434C0A43), - SPH_C64(0xACE9ACAC26A50926), SPH_C64(0x8986898997B53C97), - SPH_C64(0x143C141444B4A044), SPH_C64(0xE13EE1E142BA5B42), - SPH_C64(0x163A16164EA6B04E), SPH_C64(0x3A4E3A3AD2F7CDD2), - SPH_C64(0x69BB6969D0066FD0), SPH_C64(0x091B09092D41482D), - SPH_C64(0x70907070ADD7A7AD), SPH_C64(0xB6C7B6B6546FD954), - SPH_C64(0xD06DD0D0B71ECEB7), SPH_C64(0xED2AEDED7ED63B7E), - SPH_C64(0xCC49CCCCDBE22EDB), SPH_C64(0x42C6424257682A57), - SPH_C64(0x98B59898C22CB4C2), SPH_C64(0xA4F1A4A40EED490E), - SPH_C64(0x2878282888755D88), SPH_C64(0x5CE45C5C3186DA31), - SPH_C64(0xF815F8F83F6B933F), SPH_C64(0x86978686A4C244A4) -}; - -static const uint64_t old1_T5[256] = { - SPH_C64(0x28181878D8C07818), SPH_C64(0x652323AF2605AF23), - SPH_C64(0x57C6C6F9B87EF9C6), SPH_C64(0x25E8E86FFB136FE8), - SPH_C64(0x948787A1CB4CA187), SPH_C64(0xD5B8B86211A962B8), - SPH_C64(0x0301010509080501), SPH_C64(0xD14F4F6E0D426E4F), - SPH_C64(0x5A3636EE9BADEE36), SPH_C64(0xF7A6A604FF5904A6), - SPH_C64(0x6BD2D2BD0CDEBDD2), SPH_C64(0x02F5F5060EFB06F5), - SPH_C64(0x8B79798096EF8079), SPH_C64(0xB16F6FCE305FCE6F), - SPH_C64(0xAE9191EF6DFCEF91), SPH_C64(0xF6525207F8AA0752), - SPH_C64(0xA06060FD4727FD60), SPH_C64(0xD9BCBC76358976BC), - SPH_C64(0xB09B9BCD37ACCD9B), SPH_C64(0x8F8E8E8C8A048C8E), - SPH_C64(0xF8A3A315D27115A3), SPH_C64(0x140C0C3C6C603C0C), - SPH_C64(0x8D7B7B8A84FF8A7B), SPH_C64(0x5F3535E180B5E135), - SPH_C64(0x271D1D69F5E8691D), SPH_C64(0x3DE0E047B35347E0), - SPH_C64(0x64D7D7AC21F6ACD7), SPH_C64(0x5BC2C2ED9C5EEDC2), - SPH_C64(0x722E2E96436D962E), SPH_C64(0xDD4B4B7A29627A4B), - SPH_C64(0x1FFEFE215DA321FE), SPH_C64(0xF9575716D5821657), - SPH_C64(0x3F151541BDA84115), SPH_C64(0x997777B6E89FB677), - SPH_C64(0x593737EB92A5EB37), SPH_C64(0x32E5E5569E7B56E5), - SPH_C64(0xBC9F9FD9138CD99F), SPH_C64(0x0DF0F01723D317F0), - SPH_C64(0xDE4A4A7F206A7F4A), SPH_C64(0x73DADA95449E95DA), - SPH_C64(0xE8585825A2FA2558), SPH_C64(0x46C9C9CACF06CAC9), - SPH_C64(0x7B29298D7C558D29), SPH_C64(0x1E0A0A225A50220A), - SPH_C64(0xCEB1B14F50E14FB1), SPH_C64(0xFDA0A01AC9691AA0), - SPH_C64(0xBD6B6BDA147FDA6B), SPH_C64(0x928585ABD95CAB85), - SPH_C64(0xDABDBD733C8173BD), SPH_C64(0xE75D5D348FD2345D), - SPH_C64(0x3010105090805010), SPH_C64(0x01F4F40307F303F4), - SPH_C64(0x40CBCBC0DD16C0CB), SPH_C64(0x423E3EC6D3EDC63E), - SPH_C64(0x0F0505112D281105), SPH_C64(0xA96767E6781FE667), - SPH_C64(0x31E4E453977353E4), SPH_C64(0x692727BB0225BB27), - SPH_C64(0xC341415873325841), SPH_C64(0x808B8B9DA72C9D8B), - SPH_C64(0xF4A7A701F65101A7), SPH_C64(0x877D7D94B2CF947D), - SPH_C64(0xA29595FB49DCFB95), SPH_C64(0x75D8D89F568E9FD8), - SPH_C64(0x10FBFB30708B30FB), SPH_C64(0x2FEEEE71CD2371EE), - SPH_C64(0x847C7C91BBC7917C), SPH_C64(0xAA6666E37117E366), - SPH_C64(0x7ADDDD8E7BA68EDD), SPH_C64(0x3917174BAFB84B17), - SPH_C64(0xC947474645024647), SPH_C64(0xBF9E9EDC1A84DC9E), - SPH_C64(0x43CACAC5D41EC5CA), SPH_C64(0x772D2D995875992D), - SPH_C64(0xDCBFBF792E9179BF), SPH_C64(0x0907071B3F381B07), - SPH_C64(0xEAADAD23AC0123AD), SPH_C64(0xEE5A5A2FB0EA2F5A), - SPH_C64(0x988383B5EF6CB583), SPH_C64(0x553333FFB685FF33), - SPH_C64(0xA56363F25C3FF263), SPH_C64(0x0602020A12100A02), - SPH_C64(0xE3AAAA38933938AA), SPH_C64(0x937171A8DEAFA871), - SPH_C64(0x45C8C8CFC60ECFC8), SPH_C64(0x2B19197DD1C87D19), - SPH_C64(0xDB4949703B727049), SPH_C64(0x76D9D99A5F869AD9), - SPH_C64(0x0BF2F21D31C31DF2), SPH_C64(0x38E3E348A84B48E3), - SPH_C64(0xED5B5B2AB9E22A5B), SPH_C64(0x85888892BC349288), - SPH_C64(0xB39A9AC83EA4C89A), SPH_C64(0x6A2626BE0B2DBE26), - SPH_C64(0x563232FABF8DFA32), SPH_C64(0xCDB0B04A59E94AB0), - SPH_C64(0x26E9E96AF21B6AE9), SPH_C64(0x110F0F337778330F), - SPH_C64(0x62D5D5A633E6A6D5), SPH_C64(0x9D8080BAF474BA80), - SPH_C64(0xDFBEBE7C27997CBE), SPH_C64(0x4ACDCDDEEB26DECD), - SPH_C64(0x5C3434E489BDE434), SPH_C64(0xD8484875327A7548), - SPH_C64(0x1CFFFF2454AB24FF), SPH_C64(0x8E7A7A8F8DF78F7A), - SPH_C64(0xAD9090EA64F4EA90), SPH_C64(0xE15F5F3E9DC23E5F), - SPH_C64(0x602020A03D1DA020), SPH_C64(0xB86868D50F67D568), - SPH_C64(0x2E1A1A72CAD0721A), SPH_C64(0xEFAEAE2CB7192CAE), - SPH_C64(0xC1B4B45E7DC95EB4), SPH_C64(0xFC545419CE9A1954), - SPH_C64(0xA89393E57FECE593), SPH_C64(0x662222AA2F0DAA22), - SPH_C64(0xAC6464E96307E964), SPH_C64(0x0EF1F1122ADB12F1), - SPH_C64(0x957373A2CCBFA273), SPH_C64(0x3612125A82905A12), - SPH_C64(0xC040405D7A3A5D40), SPH_C64(0x1808082848402808), - SPH_C64(0x58C3C3E89556E8C3), SPH_C64(0x29ECEC7BDF337BEC), - SPH_C64(0x70DBDB904D9690DB), SPH_C64(0xFEA1A11FC0611FA1), - SPH_C64(0x8A8D8D83911C838D), SPH_C64(0x473D3DC9C8F5C93D), - SPH_C64(0xA49797F15BCCF197), SPH_C64(0x0000000000000000), - SPH_C64(0x4CCFCFD4F936D4CF), SPH_C64(0x7D2B2B876E45872B), - SPH_C64(0x9A7676B3E197B376), SPH_C64(0x9B8282B0E664B082), - SPH_C64(0x67D6D6A928FEA9D6), SPH_C64(0x2D1B1B77C3D8771B), - SPH_C64(0xC2B5B55B74C15BB5), SPH_C64(0xECAFAF29BE1129AF), - SPH_C64(0xBE6A6ADF1D77DF6A), SPH_C64(0xF050500DEABA0D50), - SPH_C64(0xCF45454C57124C45), SPH_C64(0x08F3F31838CB18F3), - SPH_C64(0x503030F0AD9DF030), SPH_C64(0x2CEFEF74C42B74EF), - SPH_C64(0x413F3FC3DAE5C33F), SPH_C64(0xFF55551CC7921C55), - SPH_C64(0xFBA2A210DB7910A2), SPH_C64(0x23EAEA65E90365EA), - SPH_C64(0xAF6565EC6A0FEC65), SPH_C64(0xD3BABA6803B968BA), - SPH_C64(0x712F2F934A65932F), SPH_C64(0x5DC0C0E78E4EE7C0), - SPH_C64(0x7FDEDE8160BE81DE), SPH_C64(0x241C1C6CFCE06C1C), - SPH_C64(0x1AFDFD2E46BB2EFD), SPH_C64(0xD74D4D641F52644D), - SPH_C64(0xAB9292E076E4E092), SPH_C64(0x9F7575BCFA8FBC75), - SPH_C64(0x0A06061E36301E06), SPH_C64(0x838A8A98AE24988A), - SPH_C64(0xCBB2B2404BF940B2), SPH_C64(0x37E6E659856359E6), - SPH_C64(0x120E0E367E70360E), SPH_C64(0x211F1F63E7F8631F), - SPH_C64(0xA66262F75537F762), SPH_C64(0x61D4D4A33AEEA3D4), - SPH_C64(0xE5A8A832812932A8), SPH_C64(0xA79696F452C4F496), - SPH_C64(0x16F9F93A629B3AF9), SPH_C64(0x52C5C5F6A366F6C5), - SPH_C64(0x6F2525B11035B125), SPH_C64(0xEB595920ABF22059), - SPH_C64(0x918484AED054AE84), SPH_C64(0x967272A7C5B7A772), - SPH_C64(0x4B3939DDECD5DD39), SPH_C64(0xD44C4C61165A614C), - SPH_C64(0xE25E5E3B94CA3B5E), SPH_C64(0x887878859FE78578), - SPH_C64(0x483838D8E5DDD838), SPH_C64(0x898C8C869814868C), - SPH_C64(0x6ED1D1B217C6B2D1), SPH_C64(0xF2A5A50BE4410BA5), - SPH_C64(0x3BE2E24DA1434DE2), SPH_C64(0xA36161F84E2FF861), - SPH_C64(0xC8B3B34542F145B3), SPH_C64(0x632121A53415A521), - SPH_C64(0xB99C9CD60894D69C), SPH_C64(0x221E1E66EEF0661E), - SPH_C64(0xC543435261225243), SPH_C64(0x54C7C7FCB176FCC7), - SPH_C64(0x19FCFC2B4FB32BFC), SPH_C64(0x0C04041424201404), - SPH_C64(0xF3515108E3B20851), SPH_C64(0xB69999C725BCC799), - SPH_C64(0xB76D6DC4224FC46D), SPH_C64(0x170D0D396568390D), - SPH_C64(0x13FAFA35798335FA), SPH_C64(0x7CDFDF8469B684DF), - SPH_C64(0x827E7E9BA9D79B7E), SPH_C64(0x6C2424B4193DB424), - SPH_C64(0x4D3B3BD7FEC5D73B), SPH_C64(0xE0ABAB3D9A313DAB), - SPH_C64(0x4FCECED1F03ED1CE), SPH_C64(0x3311115599885511), - SPH_C64(0x8C8F8F89830C898F), SPH_C64(0xD24E4E6B044A6B4E), - SPH_C64(0xC4B7B75166D151B7), SPH_C64(0x20EBEB60E00B60EB), - SPH_C64(0x443C3CCCC1FDCC3C), SPH_C64(0x9E8181BFFD7CBF81), - SPH_C64(0xA19494FE40D4FE94), SPH_C64(0x04F7F70C1CEB0CF7), - SPH_C64(0xD6B9B96718A167B9), SPH_C64(0x3513135F8B985F13), - SPH_C64(0x742C2C9C517D9C2C), SPH_C64(0x68D3D3B805D6B8D3), - SPH_C64(0x34E7E75C8C6B5CE7), SPH_C64(0xB26E6ECB3957CB6E), - SPH_C64(0x51C4C4F3AA6EF3C4), SPH_C64(0x0503030F1B180F03), - SPH_C64(0xFA565613DC8A1356), SPH_C64(0xCC4444495E1A4944), - SPH_C64(0x817F7F9EA0DF9E7F), SPH_C64(0xE6A9A937882137A9), - SPH_C64(0x7E2A2A82674D822A), SPH_C64(0xD0BBBB6D0AB16DBB), - SPH_C64(0x5EC1C1E28746E2C1), SPH_C64(0xF5535302F1A20253), - SPH_C64(0x79DCDC8B72AE8BDC), SPH_C64(0x1D0B0B275358270B), - SPH_C64(0xBA9D9DD3019CD39D), SPH_C64(0xB46C6CC12B47C16C), - SPH_C64(0x533131F5A495F531), SPH_C64(0x9C7474B9F387B974), - SPH_C64(0x07F6F60915E309F6), SPH_C64(0xCA4646434C0A4346), - SPH_C64(0xE9ACAC26A50926AC), SPH_C64(0x86898997B53C9789), - SPH_C64(0x3C141444B4A04414), SPH_C64(0x3EE1E142BA5B42E1), - SPH_C64(0x3A16164EA6B04E16), SPH_C64(0x4E3A3AD2F7CDD23A), - SPH_C64(0xBB6969D0066FD069), SPH_C64(0x1B09092D41482D09), - SPH_C64(0x907070ADD7A7AD70), SPH_C64(0xC7B6B6546FD954B6), - SPH_C64(0x6DD0D0B71ECEB7D0), SPH_C64(0x2AEDED7ED63B7EED), - SPH_C64(0x49CCCCDBE22EDBCC), SPH_C64(0xC6424257682A5742), - SPH_C64(0xB59898C22CB4C298), SPH_C64(0xF1A4A40EED490EA4), - SPH_C64(0x78282888755D8828), SPH_C64(0xE45C5C3186DA315C), - SPH_C64(0x15F8F83F6B933FF8), SPH_C64(0x978686A4C244A486) -}; - -static const uint64_t old1_T6[256] = { - SPH_C64(0x181878D8C0781828), SPH_C64(0x2323AF2605AF2365), - SPH_C64(0xC6C6F9B87EF9C657), SPH_C64(0xE8E86FFB136FE825), - SPH_C64(0x8787A1CB4CA18794), SPH_C64(0xB8B86211A962B8D5), - SPH_C64(0x0101050908050103), SPH_C64(0x4F4F6E0D426E4FD1), - SPH_C64(0x3636EE9BADEE365A), SPH_C64(0xA6A604FF5904A6F7), - SPH_C64(0xD2D2BD0CDEBDD26B), SPH_C64(0xF5F5060EFB06F502), - SPH_C64(0x79798096EF80798B), SPH_C64(0x6F6FCE305FCE6FB1), - SPH_C64(0x9191EF6DFCEF91AE), SPH_C64(0x525207F8AA0752F6), - SPH_C64(0x6060FD4727FD60A0), SPH_C64(0xBCBC76358976BCD9), - SPH_C64(0x9B9BCD37ACCD9BB0), SPH_C64(0x8E8E8C8A048C8E8F), - SPH_C64(0xA3A315D27115A3F8), SPH_C64(0x0C0C3C6C603C0C14), - SPH_C64(0x7B7B8A84FF8A7B8D), SPH_C64(0x3535E180B5E1355F), - SPH_C64(0x1D1D69F5E8691D27), SPH_C64(0xE0E047B35347E03D), - SPH_C64(0xD7D7AC21F6ACD764), SPH_C64(0xC2C2ED9C5EEDC25B), - SPH_C64(0x2E2E96436D962E72), SPH_C64(0x4B4B7A29627A4BDD), - SPH_C64(0xFEFE215DA321FE1F), SPH_C64(0x575716D5821657F9), - SPH_C64(0x151541BDA841153F), SPH_C64(0x7777B6E89FB67799), - SPH_C64(0x3737EB92A5EB3759), SPH_C64(0xE5E5569E7B56E532), - SPH_C64(0x9F9FD9138CD99FBC), SPH_C64(0xF0F01723D317F00D), - SPH_C64(0x4A4A7F206A7F4ADE), SPH_C64(0xDADA95449E95DA73), - SPH_C64(0x585825A2FA2558E8), SPH_C64(0xC9C9CACF06CAC946), - SPH_C64(0x29298D7C558D297B), SPH_C64(0x0A0A225A50220A1E), - SPH_C64(0xB1B14F50E14FB1CE), SPH_C64(0xA0A01AC9691AA0FD), - SPH_C64(0x6B6BDA147FDA6BBD), SPH_C64(0x8585ABD95CAB8592), - SPH_C64(0xBDBD733C8173BDDA), SPH_C64(0x5D5D348FD2345DE7), - SPH_C64(0x1010509080501030), SPH_C64(0xF4F40307F303F401), - SPH_C64(0xCBCBC0DD16C0CB40), SPH_C64(0x3E3EC6D3EDC63E42), - SPH_C64(0x0505112D2811050F), SPH_C64(0x6767E6781FE667A9), - SPH_C64(0xE4E453977353E431), SPH_C64(0x2727BB0225BB2769), - SPH_C64(0x41415873325841C3), SPH_C64(0x8B8B9DA72C9D8B80), - SPH_C64(0xA7A701F65101A7F4), SPH_C64(0x7D7D94B2CF947D87), - SPH_C64(0x9595FB49DCFB95A2), SPH_C64(0xD8D89F568E9FD875), - SPH_C64(0xFBFB30708B30FB10), SPH_C64(0xEEEE71CD2371EE2F), - SPH_C64(0x7C7C91BBC7917C84), SPH_C64(0x6666E37117E366AA), - SPH_C64(0xDDDD8E7BA68EDD7A), SPH_C64(0x17174BAFB84B1739), - SPH_C64(0x47474645024647C9), SPH_C64(0x9E9EDC1A84DC9EBF), - SPH_C64(0xCACAC5D41EC5CA43), SPH_C64(0x2D2D995875992D77), - SPH_C64(0xBFBF792E9179BFDC), SPH_C64(0x07071B3F381B0709), - SPH_C64(0xADAD23AC0123ADEA), SPH_C64(0x5A5A2FB0EA2F5AEE), - SPH_C64(0x8383B5EF6CB58398), SPH_C64(0x3333FFB685FF3355), - SPH_C64(0x6363F25C3FF263A5), SPH_C64(0x02020A12100A0206), - SPH_C64(0xAAAA38933938AAE3), SPH_C64(0x7171A8DEAFA87193), - SPH_C64(0xC8C8CFC60ECFC845), SPH_C64(0x19197DD1C87D192B), - SPH_C64(0x4949703B727049DB), SPH_C64(0xD9D99A5F869AD976), - SPH_C64(0xF2F21D31C31DF20B), SPH_C64(0xE3E348A84B48E338), - SPH_C64(0x5B5B2AB9E22A5BED), SPH_C64(0x888892BC34928885), - SPH_C64(0x9A9AC83EA4C89AB3), SPH_C64(0x2626BE0B2DBE266A), - SPH_C64(0x3232FABF8DFA3256), SPH_C64(0xB0B04A59E94AB0CD), - SPH_C64(0xE9E96AF21B6AE926), SPH_C64(0x0F0F337778330F11), - SPH_C64(0xD5D5A633E6A6D562), SPH_C64(0x8080BAF474BA809D), - SPH_C64(0xBEBE7C27997CBEDF), SPH_C64(0xCDCDDEEB26DECD4A), - SPH_C64(0x3434E489BDE4345C), SPH_C64(0x484875327A7548D8), - SPH_C64(0xFFFF2454AB24FF1C), SPH_C64(0x7A7A8F8DF78F7A8E), - SPH_C64(0x9090EA64F4EA90AD), SPH_C64(0x5F5F3E9DC23E5FE1), - SPH_C64(0x2020A03D1DA02060), SPH_C64(0x6868D50F67D568B8), - SPH_C64(0x1A1A72CAD0721A2E), SPH_C64(0xAEAE2CB7192CAEEF), - SPH_C64(0xB4B45E7DC95EB4C1), SPH_C64(0x545419CE9A1954FC), - SPH_C64(0x9393E57FECE593A8), SPH_C64(0x2222AA2F0DAA2266), - SPH_C64(0x6464E96307E964AC), SPH_C64(0xF1F1122ADB12F10E), - SPH_C64(0x7373A2CCBFA27395), SPH_C64(0x12125A82905A1236), - SPH_C64(0x40405D7A3A5D40C0), SPH_C64(0x0808284840280818), - SPH_C64(0xC3C3E89556E8C358), SPH_C64(0xECEC7BDF337BEC29), - SPH_C64(0xDBDB904D9690DB70), SPH_C64(0xA1A11FC0611FA1FE), - SPH_C64(0x8D8D83911C838D8A), SPH_C64(0x3D3DC9C8F5C93D47), - SPH_C64(0x9797F15BCCF197A4), SPH_C64(0x0000000000000000), - SPH_C64(0xCFCFD4F936D4CF4C), SPH_C64(0x2B2B876E45872B7D), - SPH_C64(0x7676B3E197B3769A), SPH_C64(0x8282B0E664B0829B), - SPH_C64(0xD6D6A928FEA9D667), SPH_C64(0x1B1B77C3D8771B2D), - SPH_C64(0xB5B55B74C15BB5C2), SPH_C64(0xAFAF29BE1129AFEC), - SPH_C64(0x6A6ADF1D77DF6ABE), SPH_C64(0x50500DEABA0D50F0), - SPH_C64(0x45454C57124C45CF), SPH_C64(0xF3F31838CB18F308), - SPH_C64(0x3030F0AD9DF03050), SPH_C64(0xEFEF74C42B74EF2C), - SPH_C64(0x3F3FC3DAE5C33F41), SPH_C64(0x55551CC7921C55FF), - SPH_C64(0xA2A210DB7910A2FB), SPH_C64(0xEAEA65E90365EA23), - SPH_C64(0x6565EC6A0FEC65AF), SPH_C64(0xBABA6803B968BAD3), - SPH_C64(0x2F2F934A65932F71), SPH_C64(0xC0C0E78E4EE7C05D), - SPH_C64(0xDEDE8160BE81DE7F), SPH_C64(0x1C1C6CFCE06C1C24), - SPH_C64(0xFDFD2E46BB2EFD1A), SPH_C64(0x4D4D641F52644DD7), - SPH_C64(0x9292E076E4E092AB), SPH_C64(0x7575BCFA8FBC759F), - SPH_C64(0x06061E36301E060A), SPH_C64(0x8A8A98AE24988A83), - SPH_C64(0xB2B2404BF940B2CB), SPH_C64(0xE6E659856359E637), - SPH_C64(0x0E0E367E70360E12), SPH_C64(0x1F1F63E7F8631F21), - SPH_C64(0x6262F75537F762A6), SPH_C64(0xD4D4A33AEEA3D461), - SPH_C64(0xA8A832812932A8E5), SPH_C64(0x9696F452C4F496A7), - SPH_C64(0xF9F93A629B3AF916), SPH_C64(0xC5C5F6A366F6C552), - SPH_C64(0x2525B11035B1256F), SPH_C64(0x595920ABF22059EB), - SPH_C64(0x8484AED054AE8491), SPH_C64(0x7272A7C5B7A77296), - SPH_C64(0x3939DDECD5DD394B), SPH_C64(0x4C4C61165A614CD4), - SPH_C64(0x5E5E3B94CA3B5EE2), SPH_C64(0x7878859FE7857888), - SPH_C64(0x3838D8E5DDD83848), SPH_C64(0x8C8C869814868C89), - SPH_C64(0xD1D1B217C6B2D16E), SPH_C64(0xA5A50BE4410BA5F2), - SPH_C64(0xE2E24DA1434DE23B), SPH_C64(0x6161F84E2FF861A3), - SPH_C64(0xB3B34542F145B3C8), SPH_C64(0x2121A53415A52163), - SPH_C64(0x9C9CD60894D69CB9), SPH_C64(0x1E1E66EEF0661E22), - SPH_C64(0x43435261225243C5), SPH_C64(0xC7C7FCB176FCC754), - SPH_C64(0xFCFC2B4FB32BFC19), SPH_C64(0x040414242014040C), - SPH_C64(0x515108E3B20851F3), SPH_C64(0x9999C725BCC799B6), - SPH_C64(0x6D6DC4224FC46DB7), SPH_C64(0x0D0D396568390D17), - SPH_C64(0xFAFA35798335FA13), SPH_C64(0xDFDF8469B684DF7C), - SPH_C64(0x7E7E9BA9D79B7E82), SPH_C64(0x2424B4193DB4246C), - SPH_C64(0x3B3BD7FEC5D73B4D), SPH_C64(0xABAB3D9A313DABE0), - SPH_C64(0xCECED1F03ED1CE4F), SPH_C64(0x1111559988551133), - SPH_C64(0x8F8F89830C898F8C), SPH_C64(0x4E4E6B044A6B4ED2), - SPH_C64(0xB7B75166D151B7C4), SPH_C64(0xEBEB60E00B60EB20), - SPH_C64(0x3C3CCCC1FDCC3C44), SPH_C64(0x8181BFFD7CBF819E), - SPH_C64(0x9494FE40D4FE94A1), SPH_C64(0xF7F70C1CEB0CF704), - SPH_C64(0xB9B96718A167B9D6), SPH_C64(0x13135F8B985F1335), - SPH_C64(0x2C2C9C517D9C2C74), SPH_C64(0xD3D3B805D6B8D368), - SPH_C64(0xE7E75C8C6B5CE734), SPH_C64(0x6E6ECB3957CB6EB2), - SPH_C64(0xC4C4F3AA6EF3C451), SPH_C64(0x03030F1B180F0305), - SPH_C64(0x565613DC8A1356FA), SPH_C64(0x4444495E1A4944CC), - SPH_C64(0x7F7F9EA0DF9E7F81), SPH_C64(0xA9A937882137A9E6), - SPH_C64(0x2A2A82674D822A7E), SPH_C64(0xBBBB6D0AB16DBBD0), - SPH_C64(0xC1C1E28746E2C15E), SPH_C64(0x535302F1A20253F5), - SPH_C64(0xDCDC8B72AE8BDC79), SPH_C64(0x0B0B275358270B1D), - SPH_C64(0x9D9DD3019CD39DBA), SPH_C64(0x6C6CC12B47C16CB4), - SPH_C64(0x3131F5A495F53153), SPH_C64(0x7474B9F387B9749C), - SPH_C64(0xF6F60915E309F607), SPH_C64(0x4646434C0A4346CA), - SPH_C64(0xACAC26A50926ACE9), SPH_C64(0x898997B53C978986), - SPH_C64(0x141444B4A044143C), SPH_C64(0xE1E142BA5B42E13E), - SPH_C64(0x16164EA6B04E163A), SPH_C64(0x3A3AD2F7CDD23A4E), - SPH_C64(0x6969D0066FD069BB), SPH_C64(0x09092D41482D091B), - SPH_C64(0x7070ADD7A7AD7090), SPH_C64(0xB6B6546FD954B6C7), - SPH_C64(0xD0D0B71ECEB7D06D), SPH_C64(0xEDED7ED63B7EED2A), - SPH_C64(0xCCCCDBE22EDBCC49), SPH_C64(0x424257682A5742C6), - SPH_C64(0x9898C22CB4C298B5), SPH_C64(0xA4A40EED490EA4F1), - SPH_C64(0x282888755D882878), SPH_C64(0x5C5C3186DA315CE4), - SPH_C64(0xF8F83F6B933FF815), SPH_C64(0x8686A4C244A48697) -}; - -static const uint64_t old1_T7[256] = { - SPH_C64(0x1878D8C078182818), SPH_C64(0x23AF2605AF236523), - SPH_C64(0xC6F9B87EF9C657C6), SPH_C64(0xE86FFB136FE825E8), - SPH_C64(0x87A1CB4CA1879487), SPH_C64(0xB86211A962B8D5B8), - SPH_C64(0x0105090805010301), SPH_C64(0x4F6E0D426E4FD14F), - SPH_C64(0x36EE9BADEE365A36), SPH_C64(0xA604FF5904A6F7A6), - SPH_C64(0xD2BD0CDEBDD26BD2), SPH_C64(0xF5060EFB06F502F5), - SPH_C64(0x798096EF80798B79), SPH_C64(0x6FCE305FCE6FB16F), - SPH_C64(0x91EF6DFCEF91AE91), SPH_C64(0x5207F8AA0752F652), - SPH_C64(0x60FD4727FD60A060), SPH_C64(0xBC76358976BCD9BC), - SPH_C64(0x9BCD37ACCD9BB09B), SPH_C64(0x8E8C8A048C8E8F8E), - SPH_C64(0xA315D27115A3F8A3), SPH_C64(0x0C3C6C603C0C140C), - SPH_C64(0x7B8A84FF8A7B8D7B), SPH_C64(0x35E180B5E1355F35), - SPH_C64(0x1D69F5E8691D271D), SPH_C64(0xE047B35347E03DE0), - SPH_C64(0xD7AC21F6ACD764D7), SPH_C64(0xC2ED9C5EEDC25BC2), - SPH_C64(0x2E96436D962E722E), SPH_C64(0x4B7A29627A4BDD4B), - SPH_C64(0xFE215DA321FE1FFE), SPH_C64(0x5716D5821657F957), - SPH_C64(0x1541BDA841153F15), SPH_C64(0x77B6E89FB6779977), - SPH_C64(0x37EB92A5EB375937), SPH_C64(0xE5569E7B56E532E5), - SPH_C64(0x9FD9138CD99FBC9F), SPH_C64(0xF01723D317F00DF0), - SPH_C64(0x4A7F206A7F4ADE4A), SPH_C64(0xDA95449E95DA73DA), - SPH_C64(0x5825A2FA2558E858), SPH_C64(0xC9CACF06CAC946C9), - SPH_C64(0x298D7C558D297B29), SPH_C64(0x0A225A50220A1E0A), - SPH_C64(0xB14F50E14FB1CEB1), SPH_C64(0xA01AC9691AA0FDA0), - SPH_C64(0x6BDA147FDA6BBD6B), SPH_C64(0x85ABD95CAB859285), - SPH_C64(0xBD733C8173BDDABD), SPH_C64(0x5D348FD2345DE75D), - SPH_C64(0x1050908050103010), SPH_C64(0xF40307F303F401F4), - SPH_C64(0xCBC0DD16C0CB40CB), SPH_C64(0x3EC6D3EDC63E423E), - SPH_C64(0x05112D2811050F05), SPH_C64(0x67E6781FE667A967), - SPH_C64(0xE453977353E431E4), SPH_C64(0x27BB0225BB276927), - SPH_C64(0x415873325841C341), SPH_C64(0x8B9DA72C9D8B808B), - SPH_C64(0xA701F65101A7F4A7), SPH_C64(0x7D94B2CF947D877D), - SPH_C64(0x95FB49DCFB95A295), SPH_C64(0xD89F568E9FD875D8), - SPH_C64(0xFB30708B30FB10FB), SPH_C64(0xEE71CD2371EE2FEE), - SPH_C64(0x7C91BBC7917C847C), SPH_C64(0x66E37117E366AA66), - SPH_C64(0xDD8E7BA68EDD7ADD), SPH_C64(0x174BAFB84B173917), - SPH_C64(0x474645024647C947), SPH_C64(0x9EDC1A84DC9EBF9E), - SPH_C64(0xCAC5D41EC5CA43CA), SPH_C64(0x2D995875992D772D), - SPH_C64(0xBF792E9179BFDCBF), SPH_C64(0x071B3F381B070907), - SPH_C64(0xAD23AC0123ADEAAD), SPH_C64(0x5A2FB0EA2F5AEE5A), - SPH_C64(0x83B5EF6CB5839883), SPH_C64(0x33FFB685FF335533), - SPH_C64(0x63F25C3FF263A563), SPH_C64(0x020A12100A020602), - SPH_C64(0xAA38933938AAE3AA), SPH_C64(0x71A8DEAFA8719371), - SPH_C64(0xC8CFC60ECFC845C8), SPH_C64(0x197DD1C87D192B19), - SPH_C64(0x49703B727049DB49), SPH_C64(0xD99A5F869AD976D9), - SPH_C64(0xF21D31C31DF20BF2), SPH_C64(0xE348A84B48E338E3), - SPH_C64(0x5B2AB9E22A5BED5B), SPH_C64(0x8892BC3492888588), - SPH_C64(0x9AC83EA4C89AB39A), SPH_C64(0x26BE0B2DBE266A26), - SPH_C64(0x32FABF8DFA325632), SPH_C64(0xB04A59E94AB0CDB0), - SPH_C64(0xE96AF21B6AE926E9), SPH_C64(0x0F337778330F110F), - SPH_C64(0xD5A633E6A6D562D5), SPH_C64(0x80BAF474BA809D80), - SPH_C64(0xBE7C27997CBEDFBE), SPH_C64(0xCDDEEB26DECD4ACD), - SPH_C64(0x34E489BDE4345C34), SPH_C64(0x4875327A7548D848), - SPH_C64(0xFF2454AB24FF1CFF), SPH_C64(0x7A8F8DF78F7A8E7A), - SPH_C64(0x90EA64F4EA90AD90), SPH_C64(0x5F3E9DC23E5FE15F), - SPH_C64(0x20A03D1DA0206020), SPH_C64(0x68D50F67D568B868), - SPH_C64(0x1A72CAD0721A2E1A), SPH_C64(0xAE2CB7192CAEEFAE), - SPH_C64(0xB45E7DC95EB4C1B4), SPH_C64(0x5419CE9A1954FC54), - SPH_C64(0x93E57FECE593A893), SPH_C64(0x22AA2F0DAA226622), - SPH_C64(0x64E96307E964AC64), SPH_C64(0xF1122ADB12F10EF1), - SPH_C64(0x73A2CCBFA2739573), SPH_C64(0x125A82905A123612), - SPH_C64(0x405D7A3A5D40C040), SPH_C64(0x0828484028081808), - SPH_C64(0xC3E89556E8C358C3), SPH_C64(0xEC7BDF337BEC29EC), - SPH_C64(0xDB904D9690DB70DB), SPH_C64(0xA11FC0611FA1FEA1), - SPH_C64(0x8D83911C838D8A8D), SPH_C64(0x3DC9C8F5C93D473D), - SPH_C64(0x97F15BCCF197A497), SPH_C64(0x0000000000000000), - SPH_C64(0xCFD4F936D4CF4CCF), SPH_C64(0x2B876E45872B7D2B), - SPH_C64(0x76B3E197B3769A76), SPH_C64(0x82B0E664B0829B82), - SPH_C64(0xD6A928FEA9D667D6), SPH_C64(0x1B77C3D8771B2D1B), - SPH_C64(0xB55B74C15BB5C2B5), SPH_C64(0xAF29BE1129AFECAF), - SPH_C64(0x6ADF1D77DF6ABE6A), SPH_C64(0x500DEABA0D50F050), - SPH_C64(0x454C57124C45CF45), SPH_C64(0xF31838CB18F308F3), - SPH_C64(0x30F0AD9DF0305030), SPH_C64(0xEF74C42B74EF2CEF), - SPH_C64(0x3FC3DAE5C33F413F), SPH_C64(0x551CC7921C55FF55), - SPH_C64(0xA210DB7910A2FBA2), SPH_C64(0xEA65E90365EA23EA), - SPH_C64(0x65EC6A0FEC65AF65), SPH_C64(0xBA6803B968BAD3BA), - SPH_C64(0x2F934A65932F712F), SPH_C64(0xC0E78E4EE7C05DC0), - SPH_C64(0xDE8160BE81DE7FDE), SPH_C64(0x1C6CFCE06C1C241C), - SPH_C64(0xFD2E46BB2EFD1AFD), SPH_C64(0x4D641F52644DD74D), - SPH_C64(0x92E076E4E092AB92), SPH_C64(0x75BCFA8FBC759F75), - SPH_C64(0x061E36301E060A06), SPH_C64(0x8A98AE24988A838A), - SPH_C64(0xB2404BF940B2CBB2), SPH_C64(0xE659856359E637E6), - SPH_C64(0x0E367E70360E120E), SPH_C64(0x1F63E7F8631F211F), - SPH_C64(0x62F75537F762A662), SPH_C64(0xD4A33AEEA3D461D4), - SPH_C64(0xA832812932A8E5A8), SPH_C64(0x96F452C4F496A796), - SPH_C64(0xF93A629B3AF916F9), SPH_C64(0xC5F6A366F6C552C5), - SPH_C64(0x25B11035B1256F25), SPH_C64(0x5920ABF22059EB59), - SPH_C64(0x84AED054AE849184), SPH_C64(0x72A7C5B7A7729672), - SPH_C64(0x39DDECD5DD394B39), SPH_C64(0x4C61165A614CD44C), - SPH_C64(0x5E3B94CA3B5EE25E), SPH_C64(0x78859FE785788878), - SPH_C64(0x38D8E5DDD8384838), SPH_C64(0x8C869814868C898C), - SPH_C64(0xD1B217C6B2D16ED1), SPH_C64(0xA50BE4410BA5F2A5), - SPH_C64(0xE24DA1434DE23BE2), SPH_C64(0x61F84E2FF861A361), - SPH_C64(0xB34542F145B3C8B3), SPH_C64(0x21A53415A5216321), - SPH_C64(0x9CD60894D69CB99C), SPH_C64(0x1E66EEF0661E221E), - SPH_C64(0x435261225243C543), SPH_C64(0xC7FCB176FCC754C7), - SPH_C64(0xFC2B4FB32BFC19FC), SPH_C64(0x0414242014040C04), - SPH_C64(0x5108E3B20851F351), SPH_C64(0x99C725BCC799B699), - SPH_C64(0x6DC4224FC46DB76D), SPH_C64(0x0D396568390D170D), - SPH_C64(0xFA35798335FA13FA), SPH_C64(0xDF8469B684DF7CDF), - SPH_C64(0x7E9BA9D79B7E827E), SPH_C64(0x24B4193DB4246C24), - SPH_C64(0x3BD7FEC5D73B4D3B), SPH_C64(0xAB3D9A313DABE0AB), - SPH_C64(0xCED1F03ED1CE4FCE), SPH_C64(0x1155998855113311), - SPH_C64(0x8F89830C898F8C8F), SPH_C64(0x4E6B044A6B4ED24E), - SPH_C64(0xB75166D151B7C4B7), SPH_C64(0xEB60E00B60EB20EB), - SPH_C64(0x3CCCC1FDCC3C443C), SPH_C64(0x81BFFD7CBF819E81), - SPH_C64(0x94FE40D4FE94A194), SPH_C64(0xF70C1CEB0CF704F7), - SPH_C64(0xB96718A167B9D6B9), SPH_C64(0x135F8B985F133513), - SPH_C64(0x2C9C517D9C2C742C), SPH_C64(0xD3B805D6B8D368D3), - SPH_C64(0xE75C8C6B5CE734E7), SPH_C64(0x6ECB3957CB6EB26E), - SPH_C64(0xC4F3AA6EF3C451C4), SPH_C64(0x030F1B180F030503), - SPH_C64(0x5613DC8A1356FA56), SPH_C64(0x44495E1A4944CC44), - SPH_C64(0x7F9EA0DF9E7F817F), SPH_C64(0xA937882137A9E6A9), - SPH_C64(0x2A82674D822A7E2A), SPH_C64(0xBB6D0AB16DBBD0BB), - SPH_C64(0xC1E28746E2C15EC1), SPH_C64(0x5302F1A20253F553), - SPH_C64(0xDC8B72AE8BDC79DC), SPH_C64(0x0B275358270B1D0B), - SPH_C64(0x9DD3019CD39DBA9D), SPH_C64(0x6CC12B47C16CB46C), - SPH_C64(0x31F5A495F5315331), SPH_C64(0x74B9F387B9749C74), - SPH_C64(0xF60915E309F607F6), SPH_C64(0x46434C0A4346CA46), - SPH_C64(0xAC26A50926ACE9AC), SPH_C64(0x8997B53C97898689), - SPH_C64(0x1444B4A044143C14), SPH_C64(0xE142BA5B42E13EE1), - SPH_C64(0x164EA6B04E163A16), SPH_C64(0x3AD2F7CDD23A4E3A), - SPH_C64(0x69D0066FD069BB69), SPH_C64(0x092D41482D091B09), - SPH_C64(0x70ADD7A7AD709070), SPH_C64(0xB6546FD954B6C7B6), - SPH_C64(0xD0B71ECEB7D06DD0), SPH_C64(0xED7ED63B7EED2AED), - SPH_C64(0xCCDBE22EDBCC49CC), SPH_C64(0x4257682A5742C642), - SPH_C64(0x98C22CB4C298B598), SPH_C64(0xA40EED490EA4F1A4), - SPH_C64(0x2888755D88287828), SPH_C64(0x5C3186DA315CE45C), - SPH_C64(0xF83F6B933FF815F8), SPH_C64(0x86A4C244A4869786) -}; - -static const uint64_t plain_T1[256] = { - SPH_C64(0x3078C018601818D8), SPH_C64(0x46AF05238C232326), - SPH_C64(0x91F97EC63FC6C6B8), SPH_C64(0xCD6F13E887E8E8FB), - SPH_C64(0x13A14C87268787CB), SPH_C64(0x6D62A9B8DAB8B811), - SPH_C64(0x0205080104010109), SPH_C64(0x9E6E424F214F4F0D), - SPH_C64(0x6CEEAD36D836369B), SPH_C64(0x510459A6A2A6A6FF), - SPH_C64(0xB9BDDED26FD2D20C), SPH_C64(0xF706FBF5F3F5F50E), - SPH_C64(0xF280EF79F9797996), SPH_C64(0xDECE5F6FA16F6F30), - SPH_C64(0x3FEFFC917E91916D), SPH_C64(0xA407AA52555252F8), - SPH_C64(0xC0FD27609D606047), SPH_C64(0x657689BCCABCBC35), - SPH_C64(0x2BCDAC9B569B9B37), SPH_C64(0x018C048E028E8E8A), - SPH_C64(0x5B1571A3B6A3A3D2), SPH_C64(0x183C600C300C0C6C), - SPH_C64(0xF68AFF7BF17B7B84), SPH_C64(0x6AE1B535D4353580), - SPH_C64(0x3A69E81D741D1DF5), SPH_C64(0xDD4753E0A7E0E0B3), - SPH_C64(0xB3ACF6D77BD7D721), SPH_C64(0x99ED5EC22FC2C29C), - SPH_C64(0x5C966D2EB82E2E43), SPH_C64(0x967A624B314B4B29), - SPH_C64(0xE121A3FEDFFEFE5D), SPH_C64(0xAE168257415757D5), - SPH_C64(0x2A41A815541515BD), SPH_C64(0xEEB69F77C17777E8), - SPH_C64(0x6EEBA537DC373792), SPH_C64(0xD7567BE5B3E5E59E), - SPH_C64(0x23D98C9F469F9F13), SPH_C64(0xFD17D3F0E7F0F023), - SPH_C64(0x947F6A4A354A4A20), SPH_C64(0xA9959EDA4FDADA44), - SPH_C64(0xB025FA587D5858A2), SPH_C64(0x8FCA06C903C9C9CF), - SPH_C64(0x528D5529A429297C), SPH_C64(0x1422500A280A0A5A), - SPH_C64(0x7F4FE1B1FEB1B150), SPH_C64(0x5D1A69A0BAA0A0C9), - SPH_C64(0xD6DA7F6BB16B6B14), SPH_C64(0x17AB5C852E8585D9), - SPH_C64(0x677381BDCEBDBD3C), SPH_C64(0xBA34D25D695D5D8F), - SPH_C64(0x2050801040101090), SPH_C64(0xF503F3F4F7F4F407), - SPH_C64(0x8BC016CB0BCBCBDD), SPH_C64(0x7CC6ED3EF83E3ED3), - SPH_C64(0x0A1128051405052D), SPH_C64(0xCEE61F6781676778), - SPH_C64(0xD55373E4B7E4E497), SPH_C64(0x4EBB25279C272702), - SPH_C64(0x8258324119414173), SPH_C64(0x0B9D2C8B168B8BA7), - SPH_C64(0x530151A7A6A7A7F6), SPH_C64(0xFA94CF7DE97D7DB2), - SPH_C64(0x37FBDC956E959549), SPH_C64(0xAD9F8ED847D8D856), - SPH_C64(0xEB308BFBCBFBFB70), SPH_C64(0xC17123EE9FEEEECD), - SPH_C64(0xF891C77CED7C7CBB), SPH_C64(0xCCE3176685666671), - SPH_C64(0xA78EA6DD53DDDD7B), SPH_C64(0x2E4BB8175C1717AF), - SPH_C64(0x8E46024701474745), SPH_C64(0x21DC849E429E9E1A), - SPH_C64(0x89C51ECA0FCACAD4), SPH_C64(0x5A99752DB42D2D58), - SPH_C64(0x637991BFC6BFBF2E), SPH_C64(0x0E1B38071C07073F), - SPH_C64(0x472301AD8EADADAC), SPH_C64(0xB42FEA5A755A5AB0), - SPH_C64(0x1BB56C83368383EF), SPH_C64(0x66FF8533CC3333B6), - SPH_C64(0xC6F23F639163635C), SPH_C64(0x040A100208020212), - SPH_C64(0x493839AA92AAAA93), SPH_C64(0xE2A8AF71D97171DE), - SPH_C64(0x8DCF0EC807C8C8C6), SPH_C64(0x327DC819641919D1), - SPH_C64(0x927072493949493B), SPH_C64(0xAF9A86D943D9D95F), - SPH_C64(0xF91DC3F2EFF2F231), SPH_C64(0xDB484BE3ABE3E3A8), - SPH_C64(0xB62AE25B715B5BB9), SPH_C64(0x0D9234881A8888BC), - SPH_C64(0x29C8A49A529A9A3E), SPH_C64(0x4CBE2D269826260B), - SPH_C64(0x64FA8D32C83232BF), SPH_C64(0x7D4AE9B0FAB0B059), - SPH_C64(0xCF6A1BE983E9E9F2), SPH_C64(0x1E33780F3C0F0F77), - SPH_C64(0xB7A6E6D573D5D533), SPH_C64(0x1DBA74803A8080F4), - SPH_C64(0x617C99BEC2BEBE27), SPH_C64(0x87DE26CD13CDCDEB), - SPH_C64(0x68E4BD34D0343489), SPH_C64(0x90757A483D484832), - SPH_C64(0xE324ABFFDBFFFF54), SPH_C64(0xF48FF77AF57A7A8D), - SPH_C64(0x3DEAF4907A909064), SPH_C64(0xBE3EC25F615F5F9D), - SPH_C64(0x40A01D208020203D), SPH_C64(0xD0D56768BD68680F), - SPH_C64(0x3472D01A681A1ACA), SPH_C64(0x412C19AE82AEAEB7), - SPH_C64(0x755EC9B4EAB4B47D), SPH_C64(0xA8199A544D5454CE), - SPH_C64(0x3BE5EC937693937F), SPH_C64(0x44AA0D228822222F), - SPH_C64(0xC8E907648D646463), SPH_C64(0xFF12DBF1E3F1F12A), - SPH_C64(0xE6A2BF73D17373CC), SPH_C64(0x245A901248121282), - SPH_C64(0x805D3A401D40407A), SPH_C64(0x1028400820080848), - SPH_C64(0x9BE856C32BC3C395), SPH_C64(0xC57B33EC97ECECDF), - SPH_C64(0xAB9096DB4BDBDB4D), SPH_C64(0x5F1F61A1BEA1A1C0), - SPH_C64(0x07831C8D0E8D8D91), SPH_C64(0x7AC9F53DF43D3DC8), - SPH_C64(0x33F1CC976697975B), SPH_C64(0x0000000000000000), - SPH_C64(0x83D436CF1BCFCFF9), SPH_C64(0x5687452BAC2B2B6E), - SPH_C64(0xECB39776C57676E1), SPH_C64(0x19B06482328282E6), - SPH_C64(0xB1A9FED67FD6D628), SPH_C64(0x3677D81B6C1B1BC3), - SPH_C64(0x775BC1B5EEB5B574), SPH_C64(0x432911AF86AFAFBE), - SPH_C64(0xD4DF776AB56A6A1D), SPH_C64(0xA00DBA505D5050EA), - SPH_C64(0x8A4C124509454557), SPH_C64(0xFB18CBF3EBF3F338), - SPH_C64(0x60F09D30C03030AD), SPH_C64(0xC3742BEF9BEFEFC4), - SPH_C64(0x7EC3E53FFC3F3FDA), SPH_C64(0xAA1C9255495555C7), - SPH_C64(0x591079A2B2A2A2DB), SPH_C64(0xC96503EA8FEAEAE9), - SPH_C64(0xCAEC0F658965656A), SPH_C64(0x6968B9BAD2BABA03), - SPH_C64(0x5E93652FBC2F2F4A), SPH_C64(0x9DE74EC027C0C08E), - SPH_C64(0xA181BEDE5FDEDE60), SPH_C64(0x386CE01C701C1CFC), - SPH_C64(0xE72EBBFDD3FDFD46), SPH_C64(0x9A64524D294D4D1F), - SPH_C64(0x39E0E49272929276), SPH_C64(0xEABC8F75C97575FA), - SPH_C64(0x0C1E300618060636), SPH_C64(0x0998248A128A8AAE), - SPH_C64(0x7940F9B2F2B2B24B), SPH_C64(0xD15963E6BFE6E685), - SPH_C64(0x1C36700E380E0E7E), SPH_C64(0x3E63F81F7C1F1FE7), - SPH_C64(0xC4F7376295626255), SPH_C64(0xB5A3EED477D4D43A), - SPH_C64(0x4D3229A89AA8A881), SPH_C64(0x31F4C49662969652), - SPH_C64(0xEF3A9BF9C3F9F962), SPH_C64(0x97F666C533C5C5A3), - SPH_C64(0x4AB1352594252510), SPH_C64(0xB220F259795959AB), - SPH_C64(0x15AE54842A8484D0), SPH_C64(0xE4A7B772D57272C5), - SPH_C64(0x72DDD539E43939EC), SPH_C64(0x98615A4C2D4C4C16), - SPH_C64(0xBC3BCA5E655E5E94), SPH_C64(0xF085E778FD78789F), - SPH_C64(0x70D8DD38E03838E5), SPH_C64(0x0586148C0A8C8C98), - SPH_C64(0xBFB2C6D163D1D117), SPH_C64(0x570B41A5AEA5A5E4), - SPH_C64(0xD94D43E2AFE2E2A1), SPH_C64(0xC2F82F619961614E), - SPH_C64(0x7B45F1B3F6B3B342), SPH_C64(0x42A5152184212134), - SPH_C64(0x25D6949C4A9C9C08), SPH_C64(0x3C66F01E781E1EEE), - SPH_C64(0x8652224311434361), SPH_C64(0x93FC76C73BC7C7B1), - SPH_C64(0xE52BB3FCD7FCFC4F), SPH_C64(0x0814200410040424), - SPH_C64(0xA208B251595151E3), SPH_C64(0x2FC7BC995E999925), - SPH_C64(0xDAC44F6DA96D6D22), SPH_C64(0x1A39680D340D0D65), - SPH_C64(0xE93583FACFFAFA79), SPH_C64(0xA384B6DF5BDFDF69), - SPH_C64(0xFC9BD77EE57E7EA9), SPH_C64(0x48B43D2490242419), - SPH_C64(0x76D7C53BEC3B3BFE), SPH_C64(0x4B3D31AB96ABAB9A), - SPH_C64(0x81D13ECE1FCECEF0), SPH_C64(0x2255881144111199), - SPH_C64(0x03890C8F068F8F83), SPH_C64(0x9C6B4A4E254E4E04), - SPH_C64(0x7351D1B7E6B7B766), SPH_C64(0xCB600BEB8BEBEBE0), - SPH_C64(0x78CCFD3CF03C3CC1), SPH_C64(0x1FBF7C813E8181FD), - SPH_C64(0x35FED4946A949440), SPH_C64(0xF30CEBF7FBF7F71C), - SPH_C64(0x6F67A1B9DEB9B918), SPH_C64(0x265F98134C13138B), - SPH_C64(0x589C7D2CB02C2C51), SPH_C64(0xBBB8D6D36BD3D305), - SPH_C64(0xD35C6BE7BBE7E78C), SPH_C64(0xDCCB576EA56E6E39), - SPH_C64(0x95F36EC437C4C4AA), SPH_C64(0x060F18030C03031B), - SPH_C64(0xAC138A56455656DC), SPH_C64(0x88491A440D44445E), - SPH_C64(0xFE9EDF7FE17F7FA0), SPH_C64(0x4F3721A99EA9A988), - SPH_C64(0x54824D2AA82A2A67), SPH_C64(0x6B6DB1BBD6BBBB0A), - SPH_C64(0x9FE246C123C1C187), SPH_C64(0xA602A253515353F1), - SPH_C64(0xA58BAEDC57DCDC72), SPH_C64(0x1627580B2C0B0B53), - SPH_C64(0x27D39C9D4E9D9D01), SPH_C64(0xD8C1476CAD6C6C2B), - SPH_C64(0x62F59531C43131A4), SPH_C64(0xE8B98774CD7474F3), - SPH_C64(0xF109E3F6FFF6F615), SPH_C64(0x8C430A460546464C), - SPH_C64(0x452609AC8AACACA5), SPH_C64(0x0F973C891E8989B5), - SPH_C64(0x2844A014501414B4), SPH_C64(0xDF425BE1A3E1E1BA), - SPH_C64(0x2C4EB016581616A6), SPH_C64(0x74D2CD3AE83A3AF7), - SPH_C64(0xD2D06F69B9696906), SPH_C64(0x122D480924090941), - SPH_C64(0xE0ADA770DD7070D7), SPH_C64(0x7154D9B6E2B6B66F), - SPH_C64(0xBDB7CED067D0D01E), SPH_C64(0xC77E3BED93EDEDD6), - SPH_C64(0x85DB2ECC17CCCCE2), SPH_C64(0x84572A4215424268), - SPH_C64(0x2DC2B4985A98982C), SPH_C64(0x550E49A4AAA4A4ED), - SPH_C64(0x50885D28A0282875), SPH_C64(0xB831DA5C6D5C5C86), - SPH_C64(0xED3F93F8C7F8F86B), SPH_C64(0x11A44486228686C2) -}; - -static const uint64_t plain_T2[256] = { - SPH_C64(0x78C018601818D830), SPH_C64(0xAF05238C23232646), - SPH_C64(0xF97EC63FC6C6B891), SPH_C64(0x6F13E887E8E8FBCD), - SPH_C64(0xA14C87268787CB13), SPH_C64(0x62A9B8DAB8B8116D), - SPH_C64(0x0508010401010902), SPH_C64(0x6E424F214F4F0D9E), - SPH_C64(0xEEAD36D836369B6C), SPH_C64(0x0459A6A2A6A6FF51), - SPH_C64(0xBDDED26FD2D20CB9), SPH_C64(0x06FBF5F3F5F50EF7), - SPH_C64(0x80EF79F9797996F2), SPH_C64(0xCE5F6FA16F6F30DE), - SPH_C64(0xEFFC917E91916D3F), SPH_C64(0x07AA52555252F8A4), - SPH_C64(0xFD27609D606047C0), SPH_C64(0x7689BCCABCBC3565), - SPH_C64(0xCDAC9B569B9B372B), SPH_C64(0x8C048E028E8E8A01), - SPH_C64(0x1571A3B6A3A3D25B), SPH_C64(0x3C600C300C0C6C18), - SPH_C64(0x8AFF7BF17B7B84F6), SPH_C64(0xE1B535D43535806A), - SPH_C64(0x69E81D741D1DF53A), SPH_C64(0x4753E0A7E0E0B3DD), - SPH_C64(0xACF6D77BD7D721B3), SPH_C64(0xED5EC22FC2C29C99), - SPH_C64(0x966D2EB82E2E435C), SPH_C64(0x7A624B314B4B2996), - SPH_C64(0x21A3FEDFFEFE5DE1), SPH_C64(0x168257415757D5AE), - SPH_C64(0x41A815541515BD2A), SPH_C64(0xB69F77C17777E8EE), - SPH_C64(0xEBA537DC3737926E), SPH_C64(0x567BE5B3E5E59ED7), - SPH_C64(0xD98C9F469F9F1323), SPH_C64(0x17D3F0E7F0F023FD), - SPH_C64(0x7F6A4A354A4A2094), SPH_C64(0x959EDA4FDADA44A9), - SPH_C64(0x25FA587D5858A2B0), SPH_C64(0xCA06C903C9C9CF8F), - SPH_C64(0x8D5529A429297C52), SPH_C64(0x22500A280A0A5A14), - SPH_C64(0x4FE1B1FEB1B1507F), SPH_C64(0x1A69A0BAA0A0C95D), - SPH_C64(0xDA7F6BB16B6B14D6), SPH_C64(0xAB5C852E8585D917), - SPH_C64(0x7381BDCEBDBD3C67), SPH_C64(0x34D25D695D5D8FBA), - SPH_C64(0x5080104010109020), SPH_C64(0x03F3F4F7F4F407F5), - SPH_C64(0xC016CB0BCBCBDD8B), SPH_C64(0xC6ED3EF83E3ED37C), - SPH_C64(0x1128051405052D0A), SPH_C64(0xE61F6781676778CE), - SPH_C64(0x5373E4B7E4E497D5), SPH_C64(0xBB25279C2727024E), - SPH_C64(0x5832411941417382), SPH_C64(0x9D2C8B168B8BA70B), - SPH_C64(0x0151A7A6A7A7F653), SPH_C64(0x94CF7DE97D7DB2FA), - SPH_C64(0xFBDC956E95954937), SPH_C64(0x9F8ED847D8D856AD), - SPH_C64(0x308BFBCBFBFB70EB), SPH_C64(0x7123EE9FEEEECDC1), - SPH_C64(0x91C77CED7C7CBBF8), SPH_C64(0xE3176685666671CC), - SPH_C64(0x8EA6DD53DDDD7BA7), SPH_C64(0x4BB8175C1717AF2E), - SPH_C64(0x460247014747458E), SPH_C64(0xDC849E429E9E1A21), - SPH_C64(0xC51ECA0FCACAD489), SPH_C64(0x99752DB42D2D585A), - SPH_C64(0x7991BFC6BFBF2E63), SPH_C64(0x1B38071C07073F0E), - SPH_C64(0x2301AD8EADADAC47), SPH_C64(0x2FEA5A755A5AB0B4), - SPH_C64(0xB56C83368383EF1B), SPH_C64(0xFF8533CC3333B666), - SPH_C64(0xF23F639163635CC6), SPH_C64(0x0A10020802021204), - SPH_C64(0x3839AA92AAAA9349), SPH_C64(0xA8AF71D97171DEE2), - SPH_C64(0xCF0EC807C8C8C68D), SPH_C64(0x7DC819641919D132), - SPH_C64(0x7072493949493B92), SPH_C64(0x9A86D943D9D95FAF), - SPH_C64(0x1DC3F2EFF2F231F9), SPH_C64(0x484BE3ABE3E3A8DB), - SPH_C64(0x2AE25B715B5BB9B6), SPH_C64(0x9234881A8888BC0D), - SPH_C64(0xC8A49A529A9A3E29), SPH_C64(0xBE2D269826260B4C), - SPH_C64(0xFA8D32C83232BF64), SPH_C64(0x4AE9B0FAB0B0597D), - SPH_C64(0x6A1BE983E9E9F2CF), SPH_C64(0x33780F3C0F0F771E), - SPH_C64(0xA6E6D573D5D533B7), SPH_C64(0xBA74803A8080F41D), - SPH_C64(0x7C99BEC2BEBE2761), SPH_C64(0xDE26CD13CDCDEB87), - SPH_C64(0xE4BD34D034348968), SPH_C64(0x757A483D48483290), - SPH_C64(0x24ABFFDBFFFF54E3), SPH_C64(0x8FF77AF57A7A8DF4), - SPH_C64(0xEAF4907A9090643D), SPH_C64(0x3EC25F615F5F9DBE), - SPH_C64(0xA01D208020203D40), SPH_C64(0xD56768BD68680FD0), - SPH_C64(0x72D01A681A1ACA34), SPH_C64(0x2C19AE82AEAEB741), - SPH_C64(0x5EC9B4EAB4B47D75), SPH_C64(0x199A544D5454CEA8), - SPH_C64(0xE5EC937693937F3B), SPH_C64(0xAA0D228822222F44), - SPH_C64(0xE907648D646463C8), SPH_C64(0x12DBF1E3F1F12AFF), - SPH_C64(0xA2BF73D17373CCE6), SPH_C64(0x5A90124812128224), - SPH_C64(0x5D3A401D40407A80), SPH_C64(0x2840082008084810), - SPH_C64(0xE856C32BC3C3959B), SPH_C64(0x7B33EC97ECECDFC5), - SPH_C64(0x9096DB4BDBDB4DAB), SPH_C64(0x1F61A1BEA1A1C05F), - SPH_C64(0x831C8D0E8D8D9107), SPH_C64(0xC9F53DF43D3DC87A), - SPH_C64(0xF1CC976697975B33), SPH_C64(0x0000000000000000), - SPH_C64(0xD436CF1BCFCFF983), SPH_C64(0x87452BAC2B2B6E56), - SPH_C64(0xB39776C57676E1EC), SPH_C64(0xB06482328282E619), - SPH_C64(0xA9FED67FD6D628B1), SPH_C64(0x77D81B6C1B1BC336), - SPH_C64(0x5BC1B5EEB5B57477), SPH_C64(0x2911AF86AFAFBE43), - SPH_C64(0xDF776AB56A6A1DD4), SPH_C64(0x0DBA505D5050EAA0), - SPH_C64(0x4C1245094545578A), SPH_C64(0x18CBF3EBF3F338FB), - SPH_C64(0xF09D30C03030AD60), SPH_C64(0x742BEF9BEFEFC4C3), - SPH_C64(0xC3E53FFC3F3FDA7E), SPH_C64(0x1C9255495555C7AA), - SPH_C64(0x1079A2B2A2A2DB59), SPH_C64(0x6503EA8FEAEAE9C9), - SPH_C64(0xEC0F658965656ACA), SPH_C64(0x68B9BAD2BABA0369), - SPH_C64(0x93652FBC2F2F4A5E), SPH_C64(0xE74EC027C0C08E9D), - SPH_C64(0x81BEDE5FDEDE60A1), SPH_C64(0x6CE01C701C1CFC38), - SPH_C64(0x2EBBFDD3FDFD46E7), SPH_C64(0x64524D294D4D1F9A), - SPH_C64(0xE0E4927292927639), SPH_C64(0xBC8F75C97575FAEA), - SPH_C64(0x1E3006180606360C), SPH_C64(0x98248A128A8AAE09), - SPH_C64(0x40F9B2F2B2B24B79), SPH_C64(0x5963E6BFE6E685D1), - SPH_C64(0x36700E380E0E7E1C), SPH_C64(0x63F81F7C1F1FE73E), - SPH_C64(0xF7376295626255C4), SPH_C64(0xA3EED477D4D43AB5), - SPH_C64(0x3229A89AA8A8814D), SPH_C64(0xF4C4966296965231), - SPH_C64(0x3A9BF9C3F9F962EF), SPH_C64(0xF666C533C5C5A397), - SPH_C64(0xB13525942525104A), SPH_C64(0x20F259795959ABB2), - SPH_C64(0xAE54842A8484D015), SPH_C64(0xA7B772D57272C5E4), - SPH_C64(0xDDD539E43939EC72), SPH_C64(0x615A4C2D4C4C1698), - SPH_C64(0x3BCA5E655E5E94BC), SPH_C64(0x85E778FD78789FF0), - SPH_C64(0xD8DD38E03838E570), SPH_C64(0x86148C0A8C8C9805), - SPH_C64(0xB2C6D163D1D117BF), SPH_C64(0x0B41A5AEA5A5E457), - SPH_C64(0x4D43E2AFE2E2A1D9), SPH_C64(0xF82F619961614EC2), - SPH_C64(0x45F1B3F6B3B3427B), SPH_C64(0xA515218421213442), - SPH_C64(0xD6949C4A9C9C0825), SPH_C64(0x66F01E781E1EEE3C), - SPH_C64(0x5222431143436186), SPH_C64(0xFC76C73BC7C7B193), - SPH_C64(0x2BB3FCD7FCFC4FE5), SPH_C64(0x1420041004042408), - SPH_C64(0x08B251595151E3A2), SPH_C64(0xC7BC995E9999252F), - SPH_C64(0xC44F6DA96D6D22DA), SPH_C64(0x39680D340D0D651A), - SPH_C64(0x3583FACFFAFA79E9), SPH_C64(0x84B6DF5BDFDF69A3), - SPH_C64(0x9BD77EE57E7EA9FC), SPH_C64(0xB43D249024241948), - SPH_C64(0xD7C53BEC3B3BFE76), SPH_C64(0x3D31AB96ABAB9A4B), - SPH_C64(0xD13ECE1FCECEF081), SPH_C64(0x5588114411119922), - SPH_C64(0x890C8F068F8F8303), SPH_C64(0x6B4A4E254E4E049C), - SPH_C64(0x51D1B7E6B7B76673), SPH_C64(0x600BEB8BEBEBE0CB), - SPH_C64(0xCCFD3CF03C3CC178), SPH_C64(0xBF7C813E8181FD1F), - SPH_C64(0xFED4946A94944035), SPH_C64(0x0CEBF7FBF7F71CF3), - SPH_C64(0x67A1B9DEB9B9186F), SPH_C64(0x5F98134C13138B26), - SPH_C64(0x9C7D2CB02C2C5158), SPH_C64(0xB8D6D36BD3D305BB), - SPH_C64(0x5C6BE7BBE7E78CD3), SPH_C64(0xCB576EA56E6E39DC), - SPH_C64(0xF36EC437C4C4AA95), SPH_C64(0x0F18030C03031B06), - SPH_C64(0x138A56455656DCAC), SPH_C64(0x491A440D44445E88), - SPH_C64(0x9EDF7FE17F7FA0FE), SPH_C64(0x3721A99EA9A9884F), - SPH_C64(0x824D2AA82A2A6754), SPH_C64(0x6DB1BBD6BBBB0A6B), - SPH_C64(0xE246C123C1C1879F), SPH_C64(0x02A253515353F1A6), - SPH_C64(0x8BAEDC57DCDC72A5), SPH_C64(0x27580B2C0B0B5316), - SPH_C64(0xD39C9D4E9D9D0127), SPH_C64(0xC1476CAD6C6C2BD8), - SPH_C64(0xF59531C43131A462), SPH_C64(0xB98774CD7474F3E8), - SPH_C64(0x09E3F6FFF6F615F1), SPH_C64(0x430A460546464C8C), - SPH_C64(0x2609AC8AACACA545), SPH_C64(0x973C891E8989B50F), - SPH_C64(0x44A014501414B428), SPH_C64(0x425BE1A3E1E1BADF), - SPH_C64(0x4EB016581616A62C), SPH_C64(0xD2CD3AE83A3AF774), - SPH_C64(0xD06F69B9696906D2), SPH_C64(0x2D48092409094112), - SPH_C64(0xADA770DD7070D7E0), SPH_C64(0x54D9B6E2B6B66F71), - SPH_C64(0xB7CED067D0D01EBD), SPH_C64(0x7E3BED93EDEDD6C7), - SPH_C64(0xDB2ECC17CCCCE285), SPH_C64(0x572A421542426884), - SPH_C64(0xC2B4985A98982C2D), SPH_C64(0x0E49A4AAA4A4ED55), - SPH_C64(0x885D28A028287550), SPH_C64(0x31DA5C6D5C5C86B8), - SPH_C64(0x3F93F8C7F8F86BED), SPH_C64(0xA44486228686C211) -}; - -static const uint64_t plain_T3[256] = { - SPH_C64(0xC018601818D83078), SPH_C64(0x05238C23232646AF), - SPH_C64(0x7EC63FC6C6B891F9), SPH_C64(0x13E887E8E8FBCD6F), - SPH_C64(0x4C87268787CB13A1), SPH_C64(0xA9B8DAB8B8116D62), - SPH_C64(0x0801040101090205), SPH_C64(0x424F214F4F0D9E6E), - SPH_C64(0xAD36D836369B6CEE), SPH_C64(0x59A6A2A6A6FF5104), - SPH_C64(0xDED26FD2D20CB9BD), SPH_C64(0xFBF5F3F5F50EF706), - SPH_C64(0xEF79F9797996F280), SPH_C64(0x5F6FA16F6F30DECE), - SPH_C64(0xFC917E91916D3FEF), SPH_C64(0xAA52555252F8A407), - SPH_C64(0x27609D606047C0FD), SPH_C64(0x89BCCABCBC356576), - SPH_C64(0xAC9B569B9B372BCD), SPH_C64(0x048E028E8E8A018C), - SPH_C64(0x71A3B6A3A3D25B15), SPH_C64(0x600C300C0C6C183C), - SPH_C64(0xFF7BF17B7B84F68A), SPH_C64(0xB535D43535806AE1), - SPH_C64(0xE81D741D1DF53A69), SPH_C64(0x53E0A7E0E0B3DD47), - SPH_C64(0xF6D77BD7D721B3AC), SPH_C64(0x5EC22FC2C29C99ED), - SPH_C64(0x6D2EB82E2E435C96), SPH_C64(0x624B314B4B29967A), - SPH_C64(0xA3FEDFFEFE5DE121), SPH_C64(0x8257415757D5AE16), - SPH_C64(0xA815541515BD2A41), SPH_C64(0x9F77C17777E8EEB6), - SPH_C64(0xA537DC3737926EEB), SPH_C64(0x7BE5B3E5E59ED756), - SPH_C64(0x8C9F469F9F1323D9), SPH_C64(0xD3F0E7F0F023FD17), - SPH_C64(0x6A4A354A4A20947F), SPH_C64(0x9EDA4FDADA44A995), - SPH_C64(0xFA587D5858A2B025), SPH_C64(0x06C903C9C9CF8FCA), - SPH_C64(0x5529A429297C528D), SPH_C64(0x500A280A0A5A1422), - SPH_C64(0xE1B1FEB1B1507F4F), SPH_C64(0x69A0BAA0A0C95D1A), - SPH_C64(0x7F6BB16B6B14D6DA), SPH_C64(0x5C852E8585D917AB), - SPH_C64(0x81BDCEBDBD3C6773), SPH_C64(0xD25D695D5D8FBA34), - SPH_C64(0x8010401010902050), SPH_C64(0xF3F4F7F4F407F503), - SPH_C64(0x16CB0BCBCBDD8BC0), SPH_C64(0xED3EF83E3ED37CC6), - SPH_C64(0x28051405052D0A11), SPH_C64(0x1F6781676778CEE6), - SPH_C64(0x73E4B7E4E497D553), SPH_C64(0x25279C2727024EBB), - SPH_C64(0x3241194141738258), SPH_C64(0x2C8B168B8BA70B9D), - SPH_C64(0x51A7A6A7A7F65301), SPH_C64(0xCF7DE97D7DB2FA94), - SPH_C64(0xDC956E95954937FB), SPH_C64(0x8ED847D8D856AD9F), - SPH_C64(0x8BFBCBFBFB70EB30), SPH_C64(0x23EE9FEEEECDC171), - SPH_C64(0xC77CED7C7CBBF891), SPH_C64(0x176685666671CCE3), - SPH_C64(0xA6DD53DDDD7BA78E), SPH_C64(0xB8175C1717AF2E4B), - SPH_C64(0x0247014747458E46), SPH_C64(0x849E429E9E1A21DC), - SPH_C64(0x1ECA0FCACAD489C5), SPH_C64(0x752DB42D2D585A99), - SPH_C64(0x91BFC6BFBF2E6379), SPH_C64(0x38071C07073F0E1B), - SPH_C64(0x01AD8EADADAC4723), SPH_C64(0xEA5A755A5AB0B42F), - SPH_C64(0x6C83368383EF1BB5), SPH_C64(0x8533CC3333B666FF), - SPH_C64(0x3F639163635CC6F2), SPH_C64(0x100208020212040A), - SPH_C64(0x39AA92AAAA934938), SPH_C64(0xAF71D97171DEE2A8), - SPH_C64(0x0EC807C8C8C68DCF), SPH_C64(0xC819641919D1327D), - SPH_C64(0x72493949493B9270), SPH_C64(0x86D943D9D95FAF9A), - SPH_C64(0xC3F2EFF2F231F91D), SPH_C64(0x4BE3ABE3E3A8DB48), - SPH_C64(0xE25B715B5BB9B62A), SPH_C64(0x34881A8888BC0D92), - SPH_C64(0xA49A529A9A3E29C8), SPH_C64(0x2D269826260B4CBE), - SPH_C64(0x8D32C83232BF64FA), SPH_C64(0xE9B0FAB0B0597D4A), - SPH_C64(0x1BE983E9E9F2CF6A), SPH_C64(0x780F3C0F0F771E33), - SPH_C64(0xE6D573D5D533B7A6), SPH_C64(0x74803A8080F41DBA), - SPH_C64(0x99BEC2BEBE27617C), SPH_C64(0x26CD13CDCDEB87DE), - SPH_C64(0xBD34D034348968E4), SPH_C64(0x7A483D4848329075), - SPH_C64(0xABFFDBFFFF54E324), SPH_C64(0xF77AF57A7A8DF48F), - SPH_C64(0xF4907A9090643DEA), SPH_C64(0xC25F615F5F9DBE3E), - SPH_C64(0x1D208020203D40A0), SPH_C64(0x6768BD68680FD0D5), - SPH_C64(0xD01A681A1ACA3472), SPH_C64(0x19AE82AEAEB7412C), - SPH_C64(0xC9B4EAB4B47D755E), SPH_C64(0x9A544D5454CEA819), - SPH_C64(0xEC937693937F3BE5), SPH_C64(0x0D228822222F44AA), - SPH_C64(0x07648D646463C8E9), SPH_C64(0xDBF1E3F1F12AFF12), - SPH_C64(0xBF73D17373CCE6A2), SPH_C64(0x901248121282245A), - SPH_C64(0x3A401D40407A805D), SPH_C64(0x4008200808481028), - SPH_C64(0x56C32BC3C3959BE8), SPH_C64(0x33EC97ECECDFC57B), - SPH_C64(0x96DB4BDBDB4DAB90), SPH_C64(0x61A1BEA1A1C05F1F), - SPH_C64(0x1C8D0E8D8D910783), SPH_C64(0xF53DF43D3DC87AC9), - SPH_C64(0xCC976697975B33F1), SPH_C64(0x0000000000000000), - SPH_C64(0x36CF1BCFCFF983D4), SPH_C64(0x452BAC2B2B6E5687), - SPH_C64(0x9776C57676E1ECB3), SPH_C64(0x6482328282E619B0), - SPH_C64(0xFED67FD6D628B1A9), SPH_C64(0xD81B6C1B1BC33677), - SPH_C64(0xC1B5EEB5B574775B), SPH_C64(0x11AF86AFAFBE4329), - SPH_C64(0x776AB56A6A1DD4DF), SPH_C64(0xBA505D5050EAA00D), - SPH_C64(0x1245094545578A4C), SPH_C64(0xCBF3EBF3F338FB18), - SPH_C64(0x9D30C03030AD60F0), SPH_C64(0x2BEF9BEFEFC4C374), - SPH_C64(0xE53FFC3F3FDA7EC3), SPH_C64(0x9255495555C7AA1C), - SPH_C64(0x79A2B2A2A2DB5910), SPH_C64(0x03EA8FEAEAE9C965), - SPH_C64(0x0F658965656ACAEC), SPH_C64(0xB9BAD2BABA036968), - SPH_C64(0x652FBC2F2F4A5E93), SPH_C64(0x4EC027C0C08E9DE7), - SPH_C64(0xBEDE5FDEDE60A181), SPH_C64(0xE01C701C1CFC386C), - SPH_C64(0xBBFDD3FDFD46E72E), SPH_C64(0x524D294D4D1F9A64), - SPH_C64(0xE4927292927639E0), SPH_C64(0x8F75C97575FAEABC), - SPH_C64(0x3006180606360C1E), SPH_C64(0x248A128A8AAE0998), - SPH_C64(0xF9B2F2B2B24B7940), SPH_C64(0x63E6BFE6E685D159), - SPH_C64(0x700E380E0E7E1C36), SPH_C64(0xF81F7C1F1FE73E63), - SPH_C64(0x376295626255C4F7), SPH_C64(0xEED477D4D43AB5A3), - SPH_C64(0x29A89AA8A8814D32), SPH_C64(0xC4966296965231F4), - SPH_C64(0x9BF9C3F9F962EF3A), SPH_C64(0x66C533C5C5A397F6), - SPH_C64(0x3525942525104AB1), SPH_C64(0xF259795959ABB220), - SPH_C64(0x54842A8484D015AE), SPH_C64(0xB772D57272C5E4A7), - SPH_C64(0xD539E43939EC72DD), SPH_C64(0x5A4C2D4C4C169861), - SPH_C64(0xCA5E655E5E94BC3B), SPH_C64(0xE778FD78789FF085), - SPH_C64(0xDD38E03838E570D8), SPH_C64(0x148C0A8C8C980586), - SPH_C64(0xC6D163D1D117BFB2), SPH_C64(0x41A5AEA5A5E4570B), - SPH_C64(0x43E2AFE2E2A1D94D), SPH_C64(0x2F619961614EC2F8), - SPH_C64(0xF1B3F6B3B3427B45), SPH_C64(0x15218421213442A5), - SPH_C64(0x949C4A9C9C0825D6), SPH_C64(0xF01E781E1EEE3C66), - SPH_C64(0x2243114343618652), SPH_C64(0x76C73BC7C7B193FC), - SPH_C64(0xB3FCD7FCFC4FE52B), SPH_C64(0x2004100404240814), - SPH_C64(0xB251595151E3A208), SPH_C64(0xBC995E9999252FC7), - SPH_C64(0x4F6DA96D6D22DAC4), SPH_C64(0x680D340D0D651A39), - SPH_C64(0x83FACFFAFA79E935), SPH_C64(0xB6DF5BDFDF69A384), - SPH_C64(0xD77EE57E7EA9FC9B), SPH_C64(0x3D249024241948B4), - SPH_C64(0xC53BEC3B3BFE76D7), SPH_C64(0x31AB96ABAB9A4B3D), - SPH_C64(0x3ECE1FCECEF081D1), SPH_C64(0x8811441111992255), - SPH_C64(0x0C8F068F8F830389), SPH_C64(0x4A4E254E4E049C6B), - SPH_C64(0xD1B7E6B7B7667351), SPH_C64(0x0BEB8BEBEBE0CB60), - SPH_C64(0xFD3CF03C3CC178CC), SPH_C64(0x7C813E8181FD1FBF), - SPH_C64(0xD4946A94944035FE), SPH_C64(0xEBF7FBF7F71CF30C), - SPH_C64(0xA1B9DEB9B9186F67), SPH_C64(0x98134C13138B265F), - SPH_C64(0x7D2CB02C2C51589C), SPH_C64(0xD6D36BD3D305BBB8), - SPH_C64(0x6BE7BBE7E78CD35C), SPH_C64(0x576EA56E6E39DCCB), - SPH_C64(0x6EC437C4C4AA95F3), SPH_C64(0x18030C03031B060F), - SPH_C64(0x8A56455656DCAC13), SPH_C64(0x1A440D44445E8849), - SPH_C64(0xDF7FE17F7FA0FE9E), SPH_C64(0x21A99EA9A9884F37), - SPH_C64(0x4D2AA82A2A675482), SPH_C64(0xB1BBD6BBBB0A6B6D), - SPH_C64(0x46C123C1C1879FE2), SPH_C64(0xA253515353F1A602), - SPH_C64(0xAEDC57DCDC72A58B), SPH_C64(0x580B2C0B0B531627), - SPH_C64(0x9C9D4E9D9D0127D3), SPH_C64(0x476CAD6C6C2BD8C1), - SPH_C64(0x9531C43131A462F5), SPH_C64(0x8774CD7474F3E8B9), - SPH_C64(0xE3F6FFF6F615F109), SPH_C64(0x0A460546464C8C43), - SPH_C64(0x09AC8AACACA54526), SPH_C64(0x3C891E8989B50F97), - SPH_C64(0xA014501414B42844), SPH_C64(0x5BE1A3E1E1BADF42), - SPH_C64(0xB016581616A62C4E), SPH_C64(0xCD3AE83A3AF774D2), - SPH_C64(0x6F69B9696906D2D0), SPH_C64(0x480924090941122D), - SPH_C64(0xA770DD7070D7E0AD), SPH_C64(0xD9B6E2B6B66F7154), - SPH_C64(0xCED067D0D01EBDB7), SPH_C64(0x3BED93EDEDD6C77E), - SPH_C64(0x2ECC17CCCCE285DB), SPH_C64(0x2A42154242688457), - SPH_C64(0xB4985A98982C2DC2), SPH_C64(0x49A4AAA4A4ED550E), - SPH_C64(0x5D28A02828755088), SPH_C64(0xDA5C6D5C5C86B831), - SPH_C64(0x93F8C7F8F86BED3F), SPH_C64(0x4486228686C211A4) -}; - -static const uint64_t plain_T4[256] = { - SPH_C64(0x18601818D83078C0), SPH_C64(0x238C23232646AF05), - SPH_C64(0xC63FC6C6B891F97E), SPH_C64(0xE887E8E8FBCD6F13), - SPH_C64(0x87268787CB13A14C), SPH_C64(0xB8DAB8B8116D62A9), - SPH_C64(0x0104010109020508), SPH_C64(0x4F214F4F0D9E6E42), - SPH_C64(0x36D836369B6CEEAD), SPH_C64(0xA6A2A6A6FF510459), - SPH_C64(0xD26FD2D20CB9BDDE), SPH_C64(0xF5F3F5F50EF706FB), - SPH_C64(0x79F9797996F280EF), SPH_C64(0x6FA16F6F30DECE5F), - SPH_C64(0x917E91916D3FEFFC), SPH_C64(0x52555252F8A407AA), - SPH_C64(0x609D606047C0FD27), SPH_C64(0xBCCABCBC35657689), - SPH_C64(0x9B569B9B372BCDAC), SPH_C64(0x8E028E8E8A018C04), - SPH_C64(0xA3B6A3A3D25B1571), SPH_C64(0x0C300C0C6C183C60), - SPH_C64(0x7BF17B7B84F68AFF), SPH_C64(0x35D43535806AE1B5), - SPH_C64(0x1D741D1DF53A69E8), SPH_C64(0xE0A7E0E0B3DD4753), - SPH_C64(0xD77BD7D721B3ACF6), SPH_C64(0xC22FC2C29C99ED5E), - SPH_C64(0x2EB82E2E435C966D), SPH_C64(0x4B314B4B29967A62), - SPH_C64(0xFEDFFEFE5DE121A3), SPH_C64(0x57415757D5AE1682), - SPH_C64(0x15541515BD2A41A8), SPH_C64(0x77C17777E8EEB69F), - SPH_C64(0x37DC3737926EEBA5), SPH_C64(0xE5B3E5E59ED7567B), - SPH_C64(0x9F469F9F1323D98C), SPH_C64(0xF0E7F0F023FD17D3), - SPH_C64(0x4A354A4A20947F6A), SPH_C64(0xDA4FDADA44A9959E), - SPH_C64(0x587D5858A2B025FA), SPH_C64(0xC903C9C9CF8FCA06), - SPH_C64(0x29A429297C528D55), SPH_C64(0x0A280A0A5A142250), - SPH_C64(0xB1FEB1B1507F4FE1), SPH_C64(0xA0BAA0A0C95D1A69), - SPH_C64(0x6BB16B6B14D6DA7F), SPH_C64(0x852E8585D917AB5C), - SPH_C64(0xBDCEBDBD3C677381), SPH_C64(0x5D695D5D8FBA34D2), - SPH_C64(0x1040101090205080), SPH_C64(0xF4F7F4F407F503F3), - SPH_C64(0xCB0BCBCBDD8BC016), SPH_C64(0x3EF83E3ED37CC6ED), - SPH_C64(0x051405052D0A1128), SPH_C64(0x6781676778CEE61F), - SPH_C64(0xE4B7E4E497D55373), SPH_C64(0x279C2727024EBB25), - SPH_C64(0x4119414173825832), SPH_C64(0x8B168B8BA70B9D2C), - SPH_C64(0xA7A6A7A7F6530151), SPH_C64(0x7DE97D7DB2FA94CF), - SPH_C64(0x956E95954937FBDC), SPH_C64(0xD847D8D856AD9F8E), - SPH_C64(0xFBCBFBFB70EB308B), SPH_C64(0xEE9FEEEECDC17123), - SPH_C64(0x7CED7C7CBBF891C7), SPH_C64(0x6685666671CCE317), - SPH_C64(0xDD53DDDD7BA78EA6), SPH_C64(0x175C1717AF2E4BB8), - SPH_C64(0x47014747458E4602), SPH_C64(0x9E429E9E1A21DC84), - SPH_C64(0xCA0FCACAD489C51E), SPH_C64(0x2DB42D2D585A9975), - SPH_C64(0xBFC6BFBF2E637991), SPH_C64(0x071C07073F0E1B38), - SPH_C64(0xAD8EADADAC472301), SPH_C64(0x5A755A5AB0B42FEA), - SPH_C64(0x83368383EF1BB56C), SPH_C64(0x33CC3333B666FF85), - SPH_C64(0x639163635CC6F23F), SPH_C64(0x0208020212040A10), - SPH_C64(0xAA92AAAA93493839), SPH_C64(0x71D97171DEE2A8AF), - SPH_C64(0xC807C8C8C68DCF0E), SPH_C64(0x19641919D1327DC8), - SPH_C64(0x493949493B927072), SPH_C64(0xD943D9D95FAF9A86), - SPH_C64(0xF2EFF2F231F91DC3), SPH_C64(0xE3ABE3E3A8DB484B), - SPH_C64(0x5B715B5BB9B62AE2), SPH_C64(0x881A8888BC0D9234), - SPH_C64(0x9A529A9A3E29C8A4), SPH_C64(0x269826260B4CBE2D), - SPH_C64(0x32C83232BF64FA8D), SPH_C64(0xB0FAB0B0597D4AE9), - SPH_C64(0xE983E9E9F2CF6A1B), SPH_C64(0x0F3C0F0F771E3378), - SPH_C64(0xD573D5D533B7A6E6), SPH_C64(0x803A8080F41DBA74), - SPH_C64(0xBEC2BEBE27617C99), SPH_C64(0xCD13CDCDEB87DE26), - SPH_C64(0x34D034348968E4BD), SPH_C64(0x483D48483290757A), - SPH_C64(0xFFDBFFFF54E324AB), SPH_C64(0x7AF57A7A8DF48FF7), - SPH_C64(0x907A9090643DEAF4), SPH_C64(0x5F615F5F9DBE3EC2), - SPH_C64(0x208020203D40A01D), SPH_C64(0x68BD68680FD0D567), - SPH_C64(0x1A681A1ACA3472D0), SPH_C64(0xAE82AEAEB7412C19), - SPH_C64(0xB4EAB4B47D755EC9), SPH_C64(0x544D5454CEA8199A), - SPH_C64(0x937693937F3BE5EC), SPH_C64(0x228822222F44AA0D), - SPH_C64(0x648D646463C8E907), SPH_C64(0xF1E3F1F12AFF12DB), - SPH_C64(0x73D17373CCE6A2BF), SPH_C64(0x1248121282245A90), - SPH_C64(0x401D40407A805D3A), SPH_C64(0x0820080848102840), - SPH_C64(0xC32BC3C3959BE856), SPH_C64(0xEC97ECECDFC57B33), - SPH_C64(0xDB4BDBDB4DAB9096), SPH_C64(0xA1BEA1A1C05F1F61), - SPH_C64(0x8D0E8D8D9107831C), SPH_C64(0x3DF43D3DC87AC9F5), - SPH_C64(0x976697975B33F1CC), SPH_C64(0x0000000000000000), - SPH_C64(0xCF1BCFCFF983D436), SPH_C64(0x2BAC2B2B6E568745), - SPH_C64(0x76C57676E1ECB397), SPH_C64(0x82328282E619B064), - SPH_C64(0xD67FD6D628B1A9FE), SPH_C64(0x1B6C1B1BC33677D8), - SPH_C64(0xB5EEB5B574775BC1), SPH_C64(0xAF86AFAFBE432911), - SPH_C64(0x6AB56A6A1DD4DF77), SPH_C64(0x505D5050EAA00DBA), - SPH_C64(0x45094545578A4C12), SPH_C64(0xF3EBF3F338FB18CB), - SPH_C64(0x30C03030AD60F09D), SPH_C64(0xEF9BEFEFC4C3742B), - SPH_C64(0x3FFC3F3FDA7EC3E5), SPH_C64(0x55495555C7AA1C92), - SPH_C64(0xA2B2A2A2DB591079), SPH_C64(0xEA8FEAEAE9C96503), - SPH_C64(0x658965656ACAEC0F), SPH_C64(0xBAD2BABA036968B9), - SPH_C64(0x2FBC2F2F4A5E9365), SPH_C64(0xC027C0C08E9DE74E), - SPH_C64(0xDE5FDEDE60A181BE), SPH_C64(0x1C701C1CFC386CE0), - SPH_C64(0xFDD3FDFD46E72EBB), SPH_C64(0x4D294D4D1F9A6452), - SPH_C64(0x927292927639E0E4), SPH_C64(0x75C97575FAEABC8F), - SPH_C64(0x06180606360C1E30), SPH_C64(0x8A128A8AAE099824), - SPH_C64(0xB2F2B2B24B7940F9), SPH_C64(0xE6BFE6E685D15963), - SPH_C64(0x0E380E0E7E1C3670), SPH_C64(0x1F7C1F1FE73E63F8), - SPH_C64(0x6295626255C4F737), SPH_C64(0xD477D4D43AB5A3EE), - SPH_C64(0xA89AA8A8814D3229), SPH_C64(0x966296965231F4C4), - SPH_C64(0xF9C3F9F962EF3A9B), SPH_C64(0xC533C5C5A397F666), - SPH_C64(0x25942525104AB135), SPH_C64(0x59795959ABB220F2), - SPH_C64(0x842A8484D015AE54), SPH_C64(0x72D57272C5E4A7B7), - SPH_C64(0x39E43939EC72DDD5), SPH_C64(0x4C2D4C4C1698615A), - SPH_C64(0x5E655E5E94BC3BCA), SPH_C64(0x78FD78789FF085E7), - SPH_C64(0x38E03838E570D8DD), SPH_C64(0x8C0A8C8C98058614), - SPH_C64(0xD163D1D117BFB2C6), SPH_C64(0xA5AEA5A5E4570B41), - SPH_C64(0xE2AFE2E2A1D94D43), SPH_C64(0x619961614EC2F82F), - SPH_C64(0xB3F6B3B3427B45F1), SPH_C64(0x218421213442A515), - SPH_C64(0x9C4A9C9C0825D694), SPH_C64(0x1E781E1EEE3C66F0), - SPH_C64(0x4311434361865222), SPH_C64(0xC73BC7C7B193FC76), - SPH_C64(0xFCD7FCFC4FE52BB3), SPH_C64(0x0410040424081420), - SPH_C64(0x51595151E3A208B2), SPH_C64(0x995E9999252FC7BC), - SPH_C64(0x6DA96D6D22DAC44F), SPH_C64(0x0D340D0D651A3968), - SPH_C64(0xFACFFAFA79E93583), SPH_C64(0xDF5BDFDF69A384B6), - SPH_C64(0x7EE57E7EA9FC9BD7), SPH_C64(0x249024241948B43D), - SPH_C64(0x3BEC3B3BFE76D7C5), SPH_C64(0xAB96ABAB9A4B3D31), - SPH_C64(0xCE1FCECEF081D13E), SPH_C64(0x1144111199225588), - SPH_C64(0x8F068F8F8303890C), SPH_C64(0x4E254E4E049C6B4A), - SPH_C64(0xB7E6B7B7667351D1), SPH_C64(0xEB8BEBEBE0CB600B), - SPH_C64(0x3CF03C3CC178CCFD), SPH_C64(0x813E8181FD1FBF7C), - SPH_C64(0x946A94944035FED4), SPH_C64(0xF7FBF7F71CF30CEB), - SPH_C64(0xB9DEB9B9186F67A1), SPH_C64(0x134C13138B265F98), - SPH_C64(0x2CB02C2C51589C7D), SPH_C64(0xD36BD3D305BBB8D6), - SPH_C64(0xE7BBE7E78CD35C6B), SPH_C64(0x6EA56E6E39DCCB57), - SPH_C64(0xC437C4C4AA95F36E), SPH_C64(0x030C03031B060F18), - SPH_C64(0x56455656DCAC138A), SPH_C64(0x440D44445E88491A), - SPH_C64(0x7FE17F7FA0FE9EDF), SPH_C64(0xA99EA9A9884F3721), - SPH_C64(0x2AA82A2A6754824D), SPH_C64(0xBBD6BBBB0A6B6DB1), - SPH_C64(0xC123C1C1879FE246), SPH_C64(0x53515353F1A602A2), - SPH_C64(0xDC57DCDC72A58BAE), SPH_C64(0x0B2C0B0B53162758), - SPH_C64(0x9D4E9D9D0127D39C), SPH_C64(0x6CAD6C6C2BD8C147), - SPH_C64(0x31C43131A462F595), SPH_C64(0x74CD7474F3E8B987), - SPH_C64(0xF6FFF6F615F109E3), SPH_C64(0x460546464C8C430A), - SPH_C64(0xAC8AACACA5452609), SPH_C64(0x891E8989B50F973C), - SPH_C64(0x14501414B42844A0), SPH_C64(0xE1A3E1E1BADF425B), - SPH_C64(0x16581616A62C4EB0), SPH_C64(0x3AE83A3AF774D2CD), - SPH_C64(0x69B9696906D2D06F), SPH_C64(0x0924090941122D48), - SPH_C64(0x70DD7070D7E0ADA7), SPH_C64(0xB6E2B6B66F7154D9), - SPH_C64(0xD067D0D01EBDB7CE), SPH_C64(0xED93EDEDD6C77E3B), - SPH_C64(0xCC17CCCCE285DB2E), SPH_C64(0x421542426884572A), - SPH_C64(0x985A98982C2DC2B4), SPH_C64(0xA4AAA4A4ED550E49), - SPH_C64(0x28A028287550885D), SPH_C64(0x5C6D5C5C86B831DA), - SPH_C64(0xF8C7F8F86BED3F93), SPH_C64(0x86228686C211A444) -}; - -static const uint64_t plain_T5[256] = { - SPH_C64(0x601818D83078C018), SPH_C64(0x8C23232646AF0523), - SPH_C64(0x3FC6C6B891F97EC6), SPH_C64(0x87E8E8FBCD6F13E8), - SPH_C64(0x268787CB13A14C87), SPH_C64(0xDAB8B8116D62A9B8), - SPH_C64(0x0401010902050801), SPH_C64(0x214F4F0D9E6E424F), - SPH_C64(0xD836369B6CEEAD36), SPH_C64(0xA2A6A6FF510459A6), - SPH_C64(0x6FD2D20CB9BDDED2), SPH_C64(0xF3F5F50EF706FBF5), - SPH_C64(0xF9797996F280EF79), SPH_C64(0xA16F6F30DECE5F6F), - SPH_C64(0x7E91916D3FEFFC91), SPH_C64(0x555252F8A407AA52), - SPH_C64(0x9D606047C0FD2760), SPH_C64(0xCABCBC35657689BC), - SPH_C64(0x569B9B372BCDAC9B), SPH_C64(0x028E8E8A018C048E), - SPH_C64(0xB6A3A3D25B1571A3), SPH_C64(0x300C0C6C183C600C), - SPH_C64(0xF17B7B84F68AFF7B), SPH_C64(0xD43535806AE1B535), - SPH_C64(0x741D1DF53A69E81D), SPH_C64(0xA7E0E0B3DD4753E0), - SPH_C64(0x7BD7D721B3ACF6D7), SPH_C64(0x2FC2C29C99ED5EC2), - SPH_C64(0xB82E2E435C966D2E), SPH_C64(0x314B4B29967A624B), - SPH_C64(0xDFFEFE5DE121A3FE), SPH_C64(0x415757D5AE168257), - SPH_C64(0x541515BD2A41A815), SPH_C64(0xC17777E8EEB69F77), - SPH_C64(0xDC3737926EEBA537), SPH_C64(0xB3E5E59ED7567BE5), - SPH_C64(0x469F9F1323D98C9F), SPH_C64(0xE7F0F023FD17D3F0), - SPH_C64(0x354A4A20947F6A4A), SPH_C64(0x4FDADA44A9959EDA), - SPH_C64(0x7D5858A2B025FA58), SPH_C64(0x03C9C9CF8FCA06C9), - SPH_C64(0xA429297C528D5529), SPH_C64(0x280A0A5A1422500A), - SPH_C64(0xFEB1B1507F4FE1B1), SPH_C64(0xBAA0A0C95D1A69A0), - SPH_C64(0xB16B6B14D6DA7F6B), SPH_C64(0x2E8585D917AB5C85), - SPH_C64(0xCEBDBD3C677381BD), SPH_C64(0x695D5D8FBA34D25D), - SPH_C64(0x4010109020508010), SPH_C64(0xF7F4F407F503F3F4), - SPH_C64(0x0BCBCBDD8BC016CB), SPH_C64(0xF83E3ED37CC6ED3E), - SPH_C64(0x1405052D0A112805), SPH_C64(0x81676778CEE61F67), - SPH_C64(0xB7E4E497D55373E4), SPH_C64(0x9C2727024EBB2527), - SPH_C64(0x1941417382583241), SPH_C64(0x168B8BA70B9D2C8B), - SPH_C64(0xA6A7A7F6530151A7), SPH_C64(0xE97D7DB2FA94CF7D), - SPH_C64(0x6E95954937FBDC95), SPH_C64(0x47D8D856AD9F8ED8), - SPH_C64(0xCBFBFB70EB308BFB), SPH_C64(0x9FEEEECDC17123EE), - SPH_C64(0xED7C7CBBF891C77C), SPH_C64(0x85666671CCE31766), - SPH_C64(0x53DDDD7BA78EA6DD), SPH_C64(0x5C1717AF2E4BB817), - SPH_C64(0x014747458E460247), SPH_C64(0x429E9E1A21DC849E), - SPH_C64(0x0FCACAD489C51ECA), SPH_C64(0xB42D2D585A99752D), - SPH_C64(0xC6BFBF2E637991BF), SPH_C64(0x1C07073F0E1B3807), - SPH_C64(0x8EADADAC472301AD), SPH_C64(0x755A5AB0B42FEA5A), - SPH_C64(0x368383EF1BB56C83), SPH_C64(0xCC3333B666FF8533), - SPH_C64(0x9163635CC6F23F63), SPH_C64(0x08020212040A1002), - SPH_C64(0x92AAAA93493839AA), SPH_C64(0xD97171DEE2A8AF71), - SPH_C64(0x07C8C8C68DCF0EC8), SPH_C64(0x641919D1327DC819), - SPH_C64(0x3949493B92707249), SPH_C64(0x43D9D95FAF9A86D9), - SPH_C64(0xEFF2F231F91DC3F2), SPH_C64(0xABE3E3A8DB484BE3), - SPH_C64(0x715B5BB9B62AE25B), SPH_C64(0x1A8888BC0D923488), - SPH_C64(0x529A9A3E29C8A49A), SPH_C64(0x9826260B4CBE2D26), - SPH_C64(0xC83232BF64FA8D32), SPH_C64(0xFAB0B0597D4AE9B0), - SPH_C64(0x83E9E9F2CF6A1BE9), SPH_C64(0x3C0F0F771E33780F), - SPH_C64(0x73D5D533B7A6E6D5), SPH_C64(0x3A8080F41DBA7480), - SPH_C64(0xC2BEBE27617C99BE), SPH_C64(0x13CDCDEB87DE26CD), - SPH_C64(0xD034348968E4BD34), SPH_C64(0x3D48483290757A48), - SPH_C64(0xDBFFFF54E324ABFF), SPH_C64(0xF57A7A8DF48FF77A), - SPH_C64(0x7A9090643DEAF490), SPH_C64(0x615F5F9DBE3EC25F), - SPH_C64(0x8020203D40A01D20), SPH_C64(0xBD68680FD0D56768), - SPH_C64(0x681A1ACA3472D01A), SPH_C64(0x82AEAEB7412C19AE), - SPH_C64(0xEAB4B47D755EC9B4), SPH_C64(0x4D5454CEA8199A54), - SPH_C64(0x7693937F3BE5EC93), SPH_C64(0x8822222F44AA0D22), - SPH_C64(0x8D646463C8E90764), SPH_C64(0xE3F1F12AFF12DBF1), - SPH_C64(0xD17373CCE6A2BF73), SPH_C64(0x48121282245A9012), - SPH_C64(0x1D40407A805D3A40), SPH_C64(0x2008084810284008), - SPH_C64(0x2BC3C3959BE856C3), SPH_C64(0x97ECECDFC57B33EC), - SPH_C64(0x4BDBDB4DAB9096DB), SPH_C64(0xBEA1A1C05F1F61A1), - SPH_C64(0x0E8D8D9107831C8D), SPH_C64(0xF43D3DC87AC9F53D), - SPH_C64(0x6697975B33F1CC97), SPH_C64(0x0000000000000000), - SPH_C64(0x1BCFCFF983D436CF), SPH_C64(0xAC2B2B6E5687452B), - SPH_C64(0xC57676E1ECB39776), SPH_C64(0x328282E619B06482), - SPH_C64(0x7FD6D628B1A9FED6), SPH_C64(0x6C1B1BC33677D81B), - SPH_C64(0xEEB5B574775BC1B5), SPH_C64(0x86AFAFBE432911AF), - SPH_C64(0xB56A6A1DD4DF776A), SPH_C64(0x5D5050EAA00DBA50), - SPH_C64(0x094545578A4C1245), SPH_C64(0xEBF3F338FB18CBF3), - SPH_C64(0xC03030AD60F09D30), SPH_C64(0x9BEFEFC4C3742BEF), - SPH_C64(0xFC3F3FDA7EC3E53F), SPH_C64(0x495555C7AA1C9255), - SPH_C64(0xB2A2A2DB591079A2), SPH_C64(0x8FEAEAE9C96503EA), - SPH_C64(0x8965656ACAEC0F65), SPH_C64(0xD2BABA036968B9BA), - SPH_C64(0xBC2F2F4A5E93652F), SPH_C64(0x27C0C08E9DE74EC0), - SPH_C64(0x5FDEDE60A181BEDE), SPH_C64(0x701C1CFC386CE01C), - SPH_C64(0xD3FDFD46E72EBBFD), SPH_C64(0x294D4D1F9A64524D), - SPH_C64(0x7292927639E0E492), SPH_C64(0xC97575FAEABC8F75), - SPH_C64(0x180606360C1E3006), SPH_C64(0x128A8AAE0998248A), - SPH_C64(0xF2B2B24B7940F9B2), SPH_C64(0xBFE6E685D15963E6), - SPH_C64(0x380E0E7E1C36700E), SPH_C64(0x7C1F1FE73E63F81F), - SPH_C64(0x95626255C4F73762), SPH_C64(0x77D4D43AB5A3EED4), - SPH_C64(0x9AA8A8814D3229A8), SPH_C64(0x6296965231F4C496), - SPH_C64(0xC3F9F962EF3A9BF9), SPH_C64(0x33C5C5A397F666C5), - SPH_C64(0x942525104AB13525), SPH_C64(0x795959ABB220F259), - SPH_C64(0x2A8484D015AE5484), SPH_C64(0xD57272C5E4A7B772), - SPH_C64(0xE43939EC72DDD539), SPH_C64(0x2D4C4C1698615A4C), - SPH_C64(0x655E5E94BC3BCA5E), SPH_C64(0xFD78789FF085E778), - SPH_C64(0xE03838E570D8DD38), SPH_C64(0x0A8C8C980586148C), - SPH_C64(0x63D1D117BFB2C6D1), SPH_C64(0xAEA5A5E4570B41A5), - SPH_C64(0xAFE2E2A1D94D43E2), SPH_C64(0x9961614EC2F82F61), - SPH_C64(0xF6B3B3427B45F1B3), SPH_C64(0x8421213442A51521), - SPH_C64(0x4A9C9C0825D6949C), SPH_C64(0x781E1EEE3C66F01E), - SPH_C64(0x1143436186522243), SPH_C64(0x3BC7C7B193FC76C7), - SPH_C64(0xD7FCFC4FE52BB3FC), SPH_C64(0x1004042408142004), - SPH_C64(0x595151E3A208B251), SPH_C64(0x5E9999252FC7BC99), - SPH_C64(0xA96D6D22DAC44F6D), SPH_C64(0x340D0D651A39680D), - SPH_C64(0xCFFAFA79E93583FA), SPH_C64(0x5BDFDF69A384B6DF), - SPH_C64(0xE57E7EA9FC9BD77E), SPH_C64(0x9024241948B43D24), - SPH_C64(0xEC3B3BFE76D7C53B), SPH_C64(0x96ABAB9A4B3D31AB), - SPH_C64(0x1FCECEF081D13ECE), SPH_C64(0x4411119922558811), - SPH_C64(0x068F8F8303890C8F), SPH_C64(0x254E4E049C6B4A4E), - SPH_C64(0xE6B7B7667351D1B7), SPH_C64(0x8BEBEBE0CB600BEB), - SPH_C64(0xF03C3CC178CCFD3C), SPH_C64(0x3E8181FD1FBF7C81), - SPH_C64(0x6A94944035FED494), SPH_C64(0xFBF7F71CF30CEBF7), - SPH_C64(0xDEB9B9186F67A1B9), SPH_C64(0x4C13138B265F9813), - SPH_C64(0xB02C2C51589C7D2C), SPH_C64(0x6BD3D305BBB8D6D3), - SPH_C64(0xBBE7E78CD35C6BE7), SPH_C64(0xA56E6E39DCCB576E), - SPH_C64(0x37C4C4AA95F36EC4), SPH_C64(0x0C03031B060F1803), - SPH_C64(0x455656DCAC138A56), SPH_C64(0x0D44445E88491A44), - SPH_C64(0xE17F7FA0FE9EDF7F), SPH_C64(0x9EA9A9884F3721A9), - SPH_C64(0xA82A2A6754824D2A), SPH_C64(0xD6BBBB0A6B6DB1BB), - SPH_C64(0x23C1C1879FE246C1), SPH_C64(0x515353F1A602A253), - SPH_C64(0x57DCDC72A58BAEDC), SPH_C64(0x2C0B0B531627580B), - SPH_C64(0x4E9D9D0127D39C9D), SPH_C64(0xAD6C6C2BD8C1476C), - SPH_C64(0xC43131A462F59531), SPH_C64(0xCD7474F3E8B98774), - SPH_C64(0xFFF6F615F109E3F6), SPH_C64(0x0546464C8C430A46), - SPH_C64(0x8AACACA5452609AC), SPH_C64(0x1E8989B50F973C89), - SPH_C64(0x501414B42844A014), SPH_C64(0xA3E1E1BADF425BE1), - SPH_C64(0x581616A62C4EB016), SPH_C64(0xE83A3AF774D2CD3A), - SPH_C64(0xB9696906D2D06F69), SPH_C64(0x24090941122D4809), - SPH_C64(0xDD7070D7E0ADA770), SPH_C64(0xE2B6B66F7154D9B6), - SPH_C64(0x67D0D01EBDB7CED0), SPH_C64(0x93EDEDD6C77E3BED), - SPH_C64(0x17CCCCE285DB2ECC), SPH_C64(0x1542426884572A42), - SPH_C64(0x5A98982C2DC2B498), SPH_C64(0xAAA4A4ED550E49A4), - SPH_C64(0xA028287550885D28), SPH_C64(0x6D5C5C86B831DA5C), - SPH_C64(0xC7F8F86BED3F93F8), SPH_C64(0x228686C211A44486) -}; - -static const uint64_t plain_T6[256] = { - SPH_C64(0x1818D83078C01860), SPH_C64(0x23232646AF05238C), - SPH_C64(0xC6C6B891F97EC63F), SPH_C64(0xE8E8FBCD6F13E887), - SPH_C64(0x8787CB13A14C8726), SPH_C64(0xB8B8116D62A9B8DA), - SPH_C64(0x0101090205080104), SPH_C64(0x4F4F0D9E6E424F21), - SPH_C64(0x36369B6CEEAD36D8), SPH_C64(0xA6A6FF510459A6A2), - SPH_C64(0xD2D20CB9BDDED26F), SPH_C64(0xF5F50EF706FBF5F3), - SPH_C64(0x797996F280EF79F9), SPH_C64(0x6F6F30DECE5F6FA1), - SPH_C64(0x91916D3FEFFC917E), SPH_C64(0x5252F8A407AA5255), - SPH_C64(0x606047C0FD27609D), SPH_C64(0xBCBC35657689BCCA), - SPH_C64(0x9B9B372BCDAC9B56), SPH_C64(0x8E8E8A018C048E02), - SPH_C64(0xA3A3D25B1571A3B6), SPH_C64(0x0C0C6C183C600C30), - SPH_C64(0x7B7B84F68AFF7BF1), SPH_C64(0x3535806AE1B535D4), - SPH_C64(0x1D1DF53A69E81D74), SPH_C64(0xE0E0B3DD4753E0A7), - SPH_C64(0xD7D721B3ACF6D77B), SPH_C64(0xC2C29C99ED5EC22F), - SPH_C64(0x2E2E435C966D2EB8), SPH_C64(0x4B4B29967A624B31), - SPH_C64(0xFEFE5DE121A3FEDF), SPH_C64(0x5757D5AE16825741), - SPH_C64(0x1515BD2A41A81554), SPH_C64(0x7777E8EEB69F77C1), - SPH_C64(0x3737926EEBA537DC), SPH_C64(0xE5E59ED7567BE5B3), - SPH_C64(0x9F9F1323D98C9F46), SPH_C64(0xF0F023FD17D3F0E7), - SPH_C64(0x4A4A20947F6A4A35), SPH_C64(0xDADA44A9959EDA4F), - SPH_C64(0x5858A2B025FA587D), SPH_C64(0xC9C9CF8FCA06C903), - SPH_C64(0x29297C528D5529A4), SPH_C64(0x0A0A5A1422500A28), - SPH_C64(0xB1B1507F4FE1B1FE), SPH_C64(0xA0A0C95D1A69A0BA), - SPH_C64(0x6B6B14D6DA7F6BB1), SPH_C64(0x8585D917AB5C852E), - SPH_C64(0xBDBD3C677381BDCE), SPH_C64(0x5D5D8FBA34D25D69), - SPH_C64(0x1010902050801040), SPH_C64(0xF4F407F503F3F4F7), - SPH_C64(0xCBCBDD8BC016CB0B), SPH_C64(0x3E3ED37CC6ED3EF8), - SPH_C64(0x05052D0A11280514), SPH_C64(0x676778CEE61F6781), - SPH_C64(0xE4E497D55373E4B7), SPH_C64(0x2727024EBB25279C), - SPH_C64(0x4141738258324119), SPH_C64(0x8B8BA70B9D2C8B16), - SPH_C64(0xA7A7F6530151A7A6), SPH_C64(0x7D7DB2FA94CF7DE9), - SPH_C64(0x95954937FBDC956E), SPH_C64(0xD8D856AD9F8ED847), - SPH_C64(0xFBFB70EB308BFBCB), SPH_C64(0xEEEECDC17123EE9F), - SPH_C64(0x7C7CBBF891C77CED), SPH_C64(0x666671CCE3176685), - SPH_C64(0xDDDD7BA78EA6DD53), SPH_C64(0x1717AF2E4BB8175C), - SPH_C64(0x4747458E46024701), SPH_C64(0x9E9E1A21DC849E42), - SPH_C64(0xCACAD489C51ECA0F), SPH_C64(0x2D2D585A99752DB4), - SPH_C64(0xBFBF2E637991BFC6), SPH_C64(0x07073F0E1B38071C), - SPH_C64(0xADADAC472301AD8E), SPH_C64(0x5A5AB0B42FEA5A75), - SPH_C64(0x8383EF1BB56C8336), SPH_C64(0x3333B666FF8533CC), - SPH_C64(0x63635CC6F23F6391), SPH_C64(0x020212040A100208), - SPH_C64(0xAAAA93493839AA92), SPH_C64(0x7171DEE2A8AF71D9), - SPH_C64(0xC8C8C68DCF0EC807), SPH_C64(0x1919D1327DC81964), - SPH_C64(0x49493B9270724939), SPH_C64(0xD9D95FAF9A86D943), - SPH_C64(0xF2F231F91DC3F2EF), SPH_C64(0xE3E3A8DB484BE3AB), - SPH_C64(0x5B5BB9B62AE25B71), SPH_C64(0x8888BC0D9234881A), - SPH_C64(0x9A9A3E29C8A49A52), SPH_C64(0x26260B4CBE2D2698), - SPH_C64(0x3232BF64FA8D32C8), SPH_C64(0xB0B0597D4AE9B0FA), - SPH_C64(0xE9E9F2CF6A1BE983), SPH_C64(0x0F0F771E33780F3C), - SPH_C64(0xD5D533B7A6E6D573), SPH_C64(0x8080F41DBA74803A), - SPH_C64(0xBEBE27617C99BEC2), SPH_C64(0xCDCDEB87DE26CD13), - SPH_C64(0x34348968E4BD34D0), SPH_C64(0x48483290757A483D), - SPH_C64(0xFFFF54E324ABFFDB), SPH_C64(0x7A7A8DF48FF77AF5), - SPH_C64(0x9090643DEAF4907A), SPH_C64(0x5F5F9DBE3EC25F61), - SPH_C64(0x20203D40A01D2080), SPH_C64(0x68680FD0D56768BD), - SPH_C64(0x1A1ACA3472D01A68), SPH_C64(0xAEAEB7412C19AE82), - SPH_C64(0xB4B47D755EC9B4EA), SPH_C64(0x5454CEA8199A544D), - SPH_C64(0x93937F3BE5EC9376), SPH_C64(0x22222F44AA0D2288), - SPH_C64(0x646463C8E907648D), SPH_C64(0xF1F12AFF12DBF1E3), - SPH_C64(0x7373CCE6A2BF73D1), SPH_C64(0x121282245A901248), - SPH_C64(0x40407A805D3A401D), SPH_C64(0x0808481028400820), - SPH_C64(0xC3C3959BE856C32B), SPH_C64(0xECECDFC57B33EC97), - SPH_C64(0xDBDB4DAB9096DB4B), SPH_C64(0xA1A1C05F1F61A1BE), - SPH_C64(0x8D8D9107831C8D0E), SPH_C64(0x3D3DC87AC9F53DF4), - SPH_C64(0x97975B33F1CC9766), SPH_C64(0x0000000000000000), - SPH_C64(0xCFCFF983D436CF1B), SPH_C64(0x2B2B6E5687452BAC), - SPH_C64(0x7676E1ECB39776C5), SPH_C64(0x8282E619B0648232), - SPH_C64(0xD6D628B1A9FED67F), SPH_C64(0x1B1BC33677D81B6C), - SPH_C64(0xB5B574775BC1B5EE), SPH_C64(0xAFAFBE432911AF86), - SPH_C64(0x6A6A1DD4DF776AB5), SPH_C64(0x5050EAA00DBA505D), - SPH_C64(0x4545578A4C124509), SPH_C64(0xF3F338FB18CBF3EB), - SPH_C64(0x3030AD60F09D30C0), SPH_C64(0xEFEFC4C3742BEF9B), - SPH_C64(0x3F3FDA7EC3E53FFC), SPH_C64(0x5555C7AA1C925549), - SPH_C64(0xA2A2DB591079A2B2), SPH_C64(0xEAEAE9C96503EA8F), - SPH_C64(0x65656ACAEC0F6589), SPH_C64(0xBABA036968B9BAD2), - SPH_C64(0x2F2F4A5E93652FBC), SPH_C64(0xC0C08E9DE74EC027), - SPH_C64(0xDEDE60A181BEDE5F), SPH_C64(0x1C1CFC386CE01C70), - SPH_C64(0xFDFD46E72EBBFDD3), SPH_C64(0x4D4D1F9A64524D29), - SPH_C64(0x92927639E0E49272), SPH_C64(0x7575FAEABC8F75C9), - SPH_C64(0x0606360C1E300618), SPH_C64(0x8A8AAE0998248A12), - SPH_C64(0xB2B24B7940F9B2F2), SPH_C64(0xE6E685D15963E6BF), - SPH_C64(0x0E0E7E1C36700E38), SPH_C64(0x1F1FE73E63F81F7C), - SPH_C64(0x626255C4F7376295), SPH_C64(0xD4D43AB5A3EED477), - SPH_C64(0xA8A8814D3229A89A), SPH_C64(0x96965231F4C49662), - SPH_C64(0xF9F962EF3A9BF9C3), SPH_C64(0xC5C5A397F666C533), - SPH_C64(0x2525104AB1352594), SPH_C64(0x5959ABB220F25979), - SPH_C64(0x8484D015AE54842A), SPH_C64(0x7272C5E4A7B772D5), - SPH_C64(0x3939EC72DDD539E4), SPH_C64(0x4C4C1698615A4C2D), - SPH_C64(0x5E5E94BC3BCA5E65), SPH_C64(0x78789FF085E778FD), - SPH_C64(0x3838E570D8DD38E0), SPH_C64(0x8C8C980586148C0A), - SPH_C64(0xD1D117BFB2C6D163), SPH_C64(0xA5A5E4570B41A5AE), - SPH_C64(0xE2E2A1D94D43E2AF), SPH_C64(0x61614EC2F82F6199), - SPH_C64(0xB3B3427B45F1B3F6), SPH_C64(0x21213442A5152184), - SPH_C64(0x9C9C0825D6949C4A), SPH_C64(0x1E1EEE3C66F01E78), - SPH_C64(0x4343618652224311), SPH_C64(0xC7C7B193FC76C73B), - SPH_C64(0xFCFC4FE52BB3FCD7), SPH_C64(0x0404240814200410), - SPH_C64(0x5151E3A208B25159), SPH_C64(0x9999252FC7BC995E), - SPH_C64(0x6D6D22DAC44F6DA9), SPH_C64(0x0D0D651A39680D34), - SPH_C64(0xFAFA79E93583FACF), SPH_C64(0xDFDF69A384B6DF5B), - SPH_C64(0x7E7EA9FC9BD77EE5), SPH_C64(0x24241948B43D2490), - SPH_C64(0x3B3BFE76D7C53BEC), SPH_C64(0xABAB9A4B3D31AB96), - SPH_C64(0xCECEF081D13ECE1F), SPH_C64(0x1111992255881144), - SPH_C64(0x8F8F8303890C8F06), SPH_C64(0x4E4E049C6B4A4E25), - SPH_C64(0xB7B7667351D1B7E6), SPH_C64(0xEBEBE0CB600BEB8B), - SPH_C64(0x3C3CC178CCFD3CF0), SPH_C64(0x8181FD1FBF7C813E), - SPH_C64(0x94944035FED4946A), SPH_C64(0xF7F71CF30CEBF7FB), - SPH_C64(0xB9B9186F67A1B9DE), SPH_C64(0x13138B265F98134C), - SPH_C64(0x2C2C51589C7D2CB0), SPH_C64(0xD3D305BBB8D6D36B), - SPH_C64(0xE7E78CD35C6BE7BB), SPH_C64(0x6E6E39DCCB576EA5), - SPH_C64(0xC4C4AA95F36EC437), SPH_C64(0x03031B060F18030C), - SPH_C64(0x5656DCAC138A5645), SPH_C64(0x44445E88491A440D), - SPH_C64(0x7F7FA0FE9EDF7FE1), SPH_C64(0xA9A9884F3721A99E), - SPH_C64(0x2A2A6754824D2AA8), SPH_C64(0xBBBB0A6B6DB1BBD6), - SPH_C64(0xC1C1879FE246C123), SPH_C64(0x5353F1A602A25351), - SPH_C64(0xDCDC72A58BAEDC57), SPH_C64(0x0B0B531627580B2C), - SPH_C64(0x9D9D0127D39C9D4E), SPH_C64(0x6C6C2BD8C1476CAD), - SPH_C64(0x3131A462F59531C4), SPH_C64(0x7474F3E8B98774CD), - SPH_C64(0xF6F615F109E3F6FF), SPH_C64(0x46464C8C430A4605), - SPH_C64(0xACACA5452609AC8A), SPH_C64(0x8989B50F973C891E), - SPH_C64(0x1414B42844A01450), SPH_C64(0xE1E1BADF425BE1A3), - SPH_C64(0x1616A62C4EB01658), SPH_C64(0x3A3AF774D2CD3AE8), - SPH_C64(0x696906D2D06F69B9), SPH_C64(0x090941122D480924), - SPH_C64(0x7070D7E0ADA770DD), SPH_C64(0xB6B66F7154D9B6E2), - SPH_C64(0xD0D01EBDB7CED067), SPH_C64(0xEDEDD6C77E3BED93), - SPH_C64(0xCCCCE285DB2ECC17), SPH_C64(0x42426884572A4215), - SPH_C64(0x98982C2DC2B4985A), SPH_C64(0xA4A4ED550E49A4AA), - SPH_C64(0x28287550885D28A0), SPH_C64(0x5C5C86B831DA5C6D), - SPH_C64(0xF8F86BED3F93F8C7), SPH_C64(0x8686C211A4448622) -}; - -static const uint64_t plain_T7[256] = { - SPH_C64(0x18D83078C0186018), SPH_C64(0x232646AF05238C23), - SPH_C64(0xC6B891F97EC63FC6), SPH_C64(0xE8FBCD6F13E887E8), - SPH_C64(0x87CB13A14C872687), SPH_C64(0xB8116D62A9B8DAB8), - SPH_C64(0x0109020508010401), SPH_C64(0x4F0D9E6E424F214F), - SPH_C64(0x369B6CEEAD36D836), SPH_C64(0xA6FF510459A6A2A6), - SPH_C64(0xD20CB9BDDED26FD2), SPH_C64(0xF50EF706FBF5F3F5), - SPH_C64(0x7996F280EF79F979), SPH_C64(0x6F30DECE5F6FA16F), - SPH_C64(0x916D3FEFFC917E91), SPH_C64(0x52F8A407AA525552), - SPH_C64(0x6047C0FD27609D60), SPH_C64(0xBC35657689BCCABC), - SPH_C64(0x9B372BCDAC9B569B), SPH_C64(0x8E8A018C048E028E), - SPH_C64(0xA3D25B1571A3B6A3), SPH_C64(0x0C6C183C600C300C), - SPH_C64(0x7B84F68AFF7BF17B), SPH_C64(0x35806AE1B535D435), - SPH_C64(0x1DF53A69E81D741D), SPH_C64(0xE0B3DD4753E0A7E0), - SPH_C64(0xD721B3ACF6D77BD7), SPH_C64(0xC29C99ED5EC22FC2), - SPH_C64(0x2E435C966D2EB82E), SPH_C64(0x4B29967A624B314B), - SPH_C64(0xFE5DE121A3FEDFFE), SPH_C64(0x57D5AE1682574157), - SPH_C64(0x15BD2A41A8155415), SPH_C64(0x77E8EEB69F77C177), - SPH_C64(0x37926EEBA537DC37), SPH_C64(0xE59ED7567BE5B3E5), - SPH_C64(0x9F1323D98C9F469F), SPH_C64(0xF023FD17D3F0E7F0), - SPH_C64(0x4A20947F6A4A354A), SPH_C64(0xDA44A9959EDA4FDA), - SPH_C64(0x58A2B025FA587D58), SPH_C64(0xC9CF8FCA06C903C9), - SPH_C64(0x297C528D5529A429), SPH_C64(0x0A5A1422500A280A), - SPH_C64(0xB1507F4FE1B1FEB1), SPH_C64(0xA0C95D1A69A0BAA0), - SPH_C64(0x6B14D6DA7F6BB16B), SPH_C64(0x85D917AB5C852E85), - SPH_C64(0xBD3C677381BDCEBD), SPH_C64(0x5D8FBA34D25D695D), - SPH_C64(0x1090205080104010), SPH_C64(0xF407F503F3F4F7F4), - SPH_C64(0xCBDD8BC016CB0BCB), SPH_C64(0x3ED37CC6ED3EF83E), - SPH_C64(0x052D0A1128051405), SPH_C64(0x6778CEE61F678167), - SPH_C64(0xE497D55373E4B7E4), SPH_C64(0x27024EBB25279C27), - SPH_C64(0x4173825832411941), SPH_C64(0x8BA70B9D2C8B168B), - SPH_C64(0xA7F6530151A7A6A7), SPH_C64(0x7DB2FA94CF7DE97D), - SPH_C64(0x954937FBDC956E95), SPH_C64(0xD856AD9F8ED847D8), - SPH_C64(0xFB70EB308BFBCBFB), SPH_C64(0xEECDC17123EE9FEE), - SPH_C64(0x7CBBF891C77CED7C), SPH_C64(0x6671CCE317668566), - SPH_C64(0xDD7BA78EA6DD53DD), SPH_C64(0x17AF2E4BB8175C17), - SPH_C64(0x47458E4602470147), SPH_C64(0x9E1A21DC849E429E), - SPH_C64(0xCAD489C51ECA0FCA), SPH_C64(0x2D585A99752DB42D), - SPH_C64(0xBF2E637991BFC6BF), SPH_C64(0x073F0E1B38071C07), - SPH_C64(0xADAC472301AD8EAD), SPH_C64(0x5AB0B42FEA5A755A), - SPH_C64(0x83EF1BB56C833683), SPH_C64(0x33B666FF8533CC33), - SPH_C64(0x635CC6F23F639163), SPH_C64(0x0212040A10020802), - SPH_C64(0xAA93493839AA92AA), SPH_C64(0x71DEE2A8AF71D971), - SPH_C64(0xC8C68DCF0EC807C8), SPH_C64(0x19D1327DC8196419), - SPH_C64(0x493B927072493949), SPH_C64(0xD95FAF9A86D943D9), - SPH_C64(0xF231F91DC3F2EFF2), SPH_C64(0xE3A8DB484BE3ABE3), - SPH_C64(0x5BB9B62AE25B715B), SPH_C64(0x88BC0D9234881A88), - SPH_C64(0x9A3E29C8A49A529A), SPH_C64(0x260B4CBE2D269826), - SPH_C64(0x32BF64FA8D32C832), SPH_C64(0xB0597D4AE9B0FAB0), - SPH_C64(0xE9F2CF6A1BE983E9), SPH_C64(0x0F771E33780F3C0F), - SPH_C64(0xD533B7A6E6D573D5), SPH_C64(0x80F41DBA74803A80), - SPH_C64(0xBE27617C99BEC2BE), SPH_C64(0xCDEB87DE26CD13CD), - SPH_C64(0x348968E4BD34D034), SPH_C64(0x483290757A483D48), - SPH_C64(0xFF54E324ABFFDBFF), SPH_C64(0x7A8DF48FF77AF57A), - SPH_C64(0x90643DEAF4907A90), SPH_C64(0x5F9DBE3EC25F615F), - SPH_C64(0x203D40A01D208020), SPH_C64(0x680FD0D56768BD68), - SPH_C64(0x1ACA3472D01A681A), SPH_C64(0xAEB7412C19AE82AE), - SPH_C64(0xB47D755EC9B4EAB4), SPH_C64(0x54CEA8199A544D54), - SPH_C64(0x937F3BE5EC937693), SPH_C64(0x222F44AA0D228822), - SPH_C64(0x6463C8E907648D64), SPH_C64(0xF12AFF12DBF1E3F1), - SPH_C64(0x73CCE6A2BF73D173), SPH_C64(0x1282245A90124812), - SPH_C64(0x407A805D3A401D40), SPH_C64(0x0848102840082008), - SPH_C64(0xC3959BE856C32BC3), SPH_C64(0xECDFC57B33EC97EC), - SPH_C64(0xDB4DAB9096DB4BDB), SPH_C64(0xA1C05F1F61A1BEA1), - SPH_C64(0x8D9107831C8D0E8D), SPH_C64(0x3DC87AC9F53DF43D), - SPH_C64(0x975B33F1CC976697), SPH_C64(0x0000000000000000), - SPH_C64(0xCFF983D436CF1BCF), SPH_C64(0x2B6E5687452BAC2B), - SPH_C64(0x76E1ECB39776C576), SPH_C64(0x82E619B064823282), - SPH_C64(0xD628B1A9FED67FD6), SPH_C64(0x1BC33677D81B6C1B), - SPH_C64(0xB574775BC1B5EEB5), SPH_C64(0xAFBE432911AF86AF), - SPH_C64(0x6A1DD4DF776AB56A), SPH_C64(0x50EAA00DBA505D50), - SPH_C64(0x45578A4C12450945), SPH_C64(0xF338FB18CBF3EBF3), - SPH_C64(0x30AD60F09D30C030), SPH_C64(0xEFC4C3742BEF9BEF), - SPH_C64(0x3FDA7EC3E53FFC3F), SPH_C64(0x55C7AA1C92554955), - SPH_C64(0xA2DB591079A2B2A2), SPH_C64(0xEAE9C96503EA8FEA), - SPH_C64(0x656ACAEC0F658965), SPH_C64(0xBA036968B9BAD2BA), - SPH_C64(0x2F4A5E93652FBC2F), SPH_C64(0xC08E9DE74EC027C0), - SPH_C64(0xDE60A181BEDE5FDE), SPH_C64(0x1CFC386CE01C701C), - SPH_C64(0xFD46E72EBBFDD3FD), SPH_C64(0x4D1F9A64524D294D), - SPH_C64(0x927639E0E4927292), SPH_C64(0x75FAEABC8F75C975), - SPH_C64(0x06360C1E30061806), SPH_C64(0x8AAE0998248A128A), - SPH_C64(0xB24B7940F9B2F2B2), SPH_C64(0xE685D15963E6BFE6), - SPH_C64(0x0E7E1C36700E380E), SPH_C64(0x1FE73E63F81F7C1F), - SPH_C64(0x6255C4F737629562), SPH_C64(0xD43AB5A3EED477D4), - SPH_C64(0xA8814D3229A89AA8), SPH_C64(0x965231F4C4966296), - SPH_C64(0xF962EF3A9BF9C3F9), SPH_C64(0xC5A397F666C533C5), - SPH_C64(0x25104AB135259425), SPH_C64(0x59ABB220F2597959), - SPH_C64(0x84D015AE54842A84), SPH_C64(0x72C5E4A7B772D572), - SPH_C64(0x39EC72DDD539E439), SPH_C64(0x4C1698615A4C2D4C), - SPH_C64(0x5E94BC3BCA5E655E), SPH_C64(0x789FF085E778FD78), - SPH_C64(0x38E570D8DD38E038), SPH_C64(0x8C980586148C0A8C), - SPH_C64(0xD117BFB2C6D163D1), SPH_C64(0xA5E4570B41A5AEA5), - SPH_C64(0xE2A1D94D43E2AFE2), SPH_C64(0x614EC2F82F619961), - SPH_C64(0xB3427B45F1B3F6B3), SPH_C64(0x213442A515218421), - SPH_C64(0x9C0825D6949C4A9C), SPH_C64(0x1EEE3C66F01E781E), - SPH_C64(0x4361865222431143), SPH_C64(0xC7B193FC76C73BC7), - SPH_C64(0xFC4FE52BB3FCD7FC), SPH_C64(0x0424081420041004), - SPH_C64(0x51E3A208B2515951), SPH_C64(0x99252FC7BC995E99), - SPH_C64(0x6D22DAC44F6DA96D), SPH_C64(0x0D651A39680D340D), - SPH_C64(0xFA79E93583FACFFA), SPH_C64(0xDF69A384B6DF5BDF), - SPH_C64(0x7EA9FC9BD77EE57E), SPH_C64(0x241948B43D249024), - SPH_C64(0x3BFE76D7C53BEC3B), SPH_C64(0xAB9A4B3D31AB96AB), - SPH_C64(0xCEF081D13ECE1FCE), SPH_C64(0x1199225588114411), - SPH_C64(0x8F8303890C8F068F), SPH_C64(0x4E049C6B4A4E254E), - SPH_C64(0xB7667351D1B7E6B7), SPH_C64(0xEBE0CB600BEB8BEB), - SPH_C64(0x3CC178CCFD3CF03C), SPH_C64(0x81FD1FBF7C813E81), - SPH_C64(0x944035FED4946A94), SPH_C64(0xF71CF30CEBF7FBF7), - SPH_C64(0xB9186F67A1B9DEB9), SPH_C64(0x138B265F98134C13), - SPH_C64(0x2C51589C7D2CB02C), SPH_C64(0xD305BBB8D6D36BD3), - SPH_C64(0xE78CD35C6BE7BBE7), SPH_C64(0x6E39DCCB576EA56E), - SPH_C64(0xC4AA95F36EC437C4), SPH_C64(0x031B060F18030C03), - SPH_C64(0x56DCAC138A564556), SPH_C64(0x445E88491A440D44), - SPH_C64(0x7FA0FE9EDF7FE17F), SPH_C64(0xA9884F3721A99EA9), - SPH_C64(0x2A6754824D2AA82A), SPH_C64(0xBB0A6B6DB1BBD6BB), - SPH_C64(0xC1879FE246C123C1), SPH_C64(0x53F1A602A2535153), - SPH_C64(0xDC72A58BAEDC57DC), SPH_C64(0x0B531627580B2C0B), - SPH_C64(0x9D0127D39C9D4E9D), SPH_C64(0x6C2BD8C1476CAD6C), - SPH_C64(0x31A462F59531C431), SPH_C64(0x74F3E8B98774CD74), - SPH_C64(0xF615F109E3F6FFF6), SPH_C64(0x464C8C430A460546), - SPH_C64(0xACA5452609AC8AAC), SPH_C64(0x89B50F973C891E89), - SPH_C64(0x14B42844A0145014), SPH_C64(0xE1BADF425BE1A3E1), - SPH_C64(0x16A62C4EB0165816), SPH_C64(0x3AF774D2CD3AE83A), - SPH_C64(0x6906D2D06F69B969), SPH_C64(0x0941122D48092409), - SPH_C64(0x70D7E0ADA770DD70), SPH_C64(0xB66F7154D9B6E2B6), - SPH_C64(0xD01EBDB7CED067D0), SPH_C64(0xEDD6C77E3BED93ED), - SPH_C64(0xCCE285DB2ECC17CC), SPH_C64(0x426884572A421542), - SPH_C64(0x982C2DC2B4985A98), SPH_C64(0xA4ED550E49A4AAA4), - SPH_C64(0x287550885D28A028), SPH_C64(0x5C86B831DA5C6D5C), - SPH_C64(0xF86BED3F93F8C7F8), SPH_C64(0x86C211A444862286) -}; -#endif /* USE_ALL_TABLES */ - - -/** - * Round constants. - */ -__device__ uint64_t InitVector_RC[10]; - -/* ====================================================================== */ - - -#define TRANSFER(dst, src) { \ - dst[0] = src ## 0; \ - dst[1] = src ## 1; \ - dst[2] = src ## 2; \ - dst[3] = src ## 3; \ - dst[4] = src ## 4; \ - dst[5] = src ## 5; \ - dst[6] = src ## 6; \ - dst[7] = src ## 7; \ -} - -#if !USE_ALL_TABLES -#define BYTE(x, n) ((unsigned)((x) >> (8 * (n))) & 0xFF) - -/* method disabled to reduce code size */ -__device__ __forceinline__ -static uint64_t table_skew(uint64_t val, int num) { - return ROTL64(val, 8 * num); -} - -__device__ __forceinline__ -static uint64_t ROUND_ELT(const uint64_t* sharedMemory, uint64_t* __restrict__ in, - int i0,int i1,int i2,int i3,int i4,int i5,int i6,int i7) -{ - uint32_t idx0, idx1, idx2, idx3, idx4, idx5, idx6, idx7; - idx0 = BYTE(in[i0], 0); - idx1 = BYTE(in[i1], 1); - idx2 = BYTE(in[i2], 2); - idx3 = BYTE(in[i3], 3); - idx4 = BYTE(in[i4], 4); - idx5 = BYTE(in[i5], 5); - idx6 = BYTE(in[i6], 6); - idx7 = BYTE(in[i7], 7); - - return xor8( - sharedMemory[idx0], - table_skew(sharedMemory[idx1], 1), - table_skew(sharedMemory[idx2], 2), - table_skew(sharedMemory[idx3], 3), - table_skew(sharedMemory[idx4], 4), - table_skew(sharedMemory[idx5], 5), - table_skew(sharedMemory[idx6], 6), - table_skew(sharedMemory[idx7], 7) - ); -} - -#else - -__device__ __forceinline__ -static uint64_t ROUND_ELT(const uint64_t* sharedMemory, uint64_t* __restrict__ in, -const int i0, const int i1, const int i2, const int i3, const int i4, const int i5, const int i6, const int i7) -{ - uint32_t* in32 = (uint32_t*)in; - return (sharedMemory[__byte_perm(in32[(i0 << 1)], 0, 0x4440)] ^ sharedMemory[__byte_perm(in32[(i1 << 1)], 0, 0x4441) + 256] ^ - sharedMemory[__byte_perm(in32[(i2 << 1)], 0, 0x4442) + 512] ^ sharedMemory[__byte_perm(in32[(i3 << 1)], 0, 0x4443) + 768] ^ - sharedMemory[__byte_perm(in32[(i4 << 1) + 1], 0, 0x4440) + 1024] ^ sharedMemory[__byte_perm(in32[(i5 << 1) + 1], 0, 0x4441) + 1280] ^ - sharedMemory[__byte_perm(in32[(i6 << 1) + 1], 0, 0x4442) + 1536] ^ sharedMemory[__byte_perm(in32[(i7 << 1) + 1], 0, 0x4443) + 1792]); -} -#endif /* USE_ALL_TABLES */ - -#define ROUND(table, in, out, c0, c1, c2, c3, c4, c5, c6, c7) { \ - out ## 0 = xor1(ROUND_ELT(table, in, 0, 7, 6, 5, 4, 3, 2, 1), c0); \ - out ## 1 = xor1(ROUND_ELT(table, in, 1, 0, 7, 6, 5, 4, 3, 2), c1); \ - out ## 2 = xor1(ROUND_ELT(table, in, 2, 1, 0, 7, 6, 5, 4, 3), c2); \ - out ## 3 = xor1(ROUND_ELT(table, in, 3, 2, 1, 0, 7, 6, 5, 4), c3); \ - out ## 4 = xor1(ROUND_ELT(table, in, 4, 3, 2, 1, 0, 7, 6, 5), c4); \ - out ## 5 = xor1(ROUND_ELT(table, in, 5, 4, 3, 2, 1, 0, 7, 6), c5); \ - out ## 6 = xor1(ROUND_ELT(table, in, 6, 5, 4, 3, 2, 1, 0, 7), c6); \ - out ## 7 = xor1(ROUND_ELT(table, in, 7, 6, 5, 4, 3, 2, 1, 0), c7); \ -} - -#define ROUND1(table, in, out, c) { \ - out ## 0 = xor1(ROUND_ELT(table, in, 0, 7, 6, 5, 4, 3, 2, 1), c); \ - out ## 1 = ROUND_ELT(table, in, 1, 0, 7, 6, 5, 4, 3, 2); \ - out ## 2 = ROUND_ELT(table, in, 2, 1, 0, 7, 6, 5, 4, 3); \ - out ## 3 = ROUND_ELT(table, in, 3, 2, 1, 0, 7, 6, 5, 4); \ - out ## 4 = ROUND_ELT(table, in, 4, 3, 2, 1, 0, 7, 6, 5); \ - out ## 5 = ROUND_ELT(table, in, 5, 4, 3, 2, 1, 0, 7, 6); \ - out ## 6 = ROUND_ELT(table, in, 6, 5, 4, 3, 2, 1, 0, 7); \ - out ## 7 = ROUND_ELT(table, in, 7, 6, 5, 4, 3, 2, 1, 0); \ -} - -#define ROUND_KSCHED(table, in, out, c) \ - ROUND1(table, in, out, c) \ - TRANSFER(in, out) - -#define ROUND_WENC(table, in, key, out) \ - ROUND(table, in, out, key[0], key[1], key[2],key[3], key[4], key[5], key[6], key[7]) \ - TRANSFER(in, out) - - -__global__ -void oldwhirlpool_gpu_hash_80(const uint32_t threads, const uint32_t startNounce, void *outputHash, int swab) -{ - __shared__ uint64_t sharedMemory[2048]; - - if (threadIdx.x < 256) { - sharedMemory[threadIdx.x] = mixTob0Tox[threadIdx.x]; - #if USE_ALL_TABLES - sharedMemory[threadIdx.x+256] = mixTob1Tox[threadIdx.x]; - sharedMemory[threadIdx.x+512] = mixTob2Tox[threadIdx.x]; - sharedMemory[threadIdx.x+768] = mixTob3Tox[threadIdx.x]; - sharedMemory[threadIdx.x+1024] = mixTob4Tox[threadIdx.x]; - sharedMemory[threadIdx.x+1280] = mixTob5Tox[threadIdx.x]; - sharedMemory[threadIdx.x+1536] = mixTob6Tox[threadIdx.x]; - sharedMemory[threadIdx.x+1792] = mixTob7Tox[threadIdx.x]; - #endif - } - //__threadfence_block(); // ensure shared mem is ready - __syncthreads(); - - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint64_t n[8]; - uint64_t h[8]; - uint32_t nonce = startNounce + thread; - nonce = swab ? cuda_swab32(nonce) : nonce; - -#if HOST_MIDSTATE - uint64_t state[8]; - #pragma unroll 8 - for (int i=0; i < 8; i++) { - //state[i] = c_PaddedMessage80[i]; - AS_UINT2(&state[i]) = AS_UINT2(&c_PaddedMessage80[i]); - } -#else - #pragma unroll 8 - for (int i=0; i<8; i++) { - n[i] = c_PaddedMessage80[i]; // read data - h[i] = 0; // read state - } - - #pragma unroll 1 - for (unsigned r=0; r < 10; r++) { - uint64_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - ROUND_KSCHED(sharedMemory, h, tmp, InitVector_RC[r]); - ROUND_WENC(sharedMemory, n, h, tmp); - } - - uint64_t state[8]; - #pragma unroll 8 - for (int i=0; i < 8; i++) { - state[i] = xor1(n[i],c_PaddedMessage80[i]); - } -#endif - - /// round 2 /////// - ////////////////////////////////// - n[0] = c_PaddedMessage80[8]; //read data - n[1] = REPLACE_HIDWORD(c_PaddedMessage80[9], nonce); //whirlpool - n[2] = 0x0000000000000080; //whirlpool - n[3] = 0; - n[4] = 0; - n[5] = 0; - n[6] = 0; - n[7] = 0x8002000000000000; - - #pragma unroll 8 - for (int i=0; i<8; i++) { - h[i] = state[i]; //read state - n[i] = xor1(n[i],h[i]); - } - -// #pragma unroll - for (unsigned r=0; r < 10; r++) { - uint64_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - ROUND_KSCHED(sharedMemory, h, tmp, InitVector_RC[r]); - ROUND_WENC(sharedMemory, n, h, tmp); - } - - state[0] = xor3(state[0], n[0], c_PaddedMessage80[8]); - state[1] = xor3(state[1], n[1], REPLACE_HIDWORD(c_PaddedMessage80[9], nonce) ); - state[2] = xor3(state[2], n[2], 0x0000000000000080); - state[3] = xor1(state[3], n[3]); - state[4] = xor1(state[4], n[4]); - state[5] = xor1(state[5], n[5]); - state[6] = xor1(state[6], n[6]); - state[7] = xor3(state[7], n[7], 0x8002000000000000); - - uint64_t* outHash = &(((uint64_t*)outputHash)[(size_t)8 * thread]); - #pragma unroll 8 - for (unsigned i = 0; i < 8; i++) - outHash[i] = state[i]; - - } // thread < threads -} - -__global__ -void x15_whirlpool_gpu_hash_64(uint32_t threads, uint32_t startNounce, uint64_t *g_hash, uint32_t *g_nonceVector) -{ - __shared__ uint64_t sharedMemory[2048]; - - if (threadIdx.x < 256) { - sharedMemory[threadIdx.x] = mixTob0Tox[threadIdx.x]; - #if USE_ALL_TABLES - sharedMemory[threadIdx.x+256] = mixTob1Tox[threadIdx.x]; - sharedMemory[threadIdx.x+512] = mixTob2Tox[threadIdx.x]; - sharedMemory[threadIdx.x+768] = mixTob3Tox[threadIdx.x]; - sharedMemory[threadIdx.x+1024] = mixTob4Tox[threadIdx.x]; - sharedMemory[threadIdx.x+1280] = mixTob5Tox[threadIdx.x]; - sharedMemory[threadIdx.x+1536] = mixTob6Tox[threadIdx.x]; - sharedMemory[threadIdx.x+1792] = mixTob7Tox[threadIdx.x]; - #endif - } - __threadfence_block(); // ensure shared mem is ready - - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t nounce = g_nonceVector ? g_nonceVector[thread] : (startNounce + thread); - uint32_t hashPosition = (nounce - startNounce) << 3; - uint64_t hash[8], state[8], n[8], h[8] = { 0 }; - uint8_t i; - - #pragma unroll 8 - for (i=0; i<8; i++) - n[i] = hash[i] = g_hash[hashPosition + i]; - -// #pragma unroll 10 - for (i=0; i < 10; i++) { - uint64_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - ROUND_KSCHED(sharedMemory, h, tmp, InitVector_RC[i]); - ROUND_WENC(sharedMemory, n, h, tmp); - } - - #pragma unroll 8 - for (i=0; i<8; i++) - state[i] = xor1(n[i], hash[i]); - - #pragma unroll 6 - for (i=1; i<7; i++) - n[i]=0; - - n[0] = 0x80; - n[7] = 0x2000000000000; - - #pragma unroll 8 - for (i=0; i < 8; i++) { - h[i] = state[i]; - n[i] = xor1(n[i], h[i]); - } - -// #pragma unroll 10 - for (i=0; i < 10; i++) { - uint64_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - ROUND_KSCHED(sharedMemory, h, tmp, InitVector_RC[i]); - ROUND_WENC(sharedMemory, n, h, tmp); - } - - state[0] = xor3(state[0], n[0], 0x80); - state[1] = xor1(state[1], n[1]); - state[2] = xor1(state[2], n[2]); - state[3] = xor1(state[3], n[3]); - state[4] = xor1(state[4], n[4]); - state[5] = xor1(state[5], n[5]); - state[6] = xor1(state[6], n[6]); - state[7] = xor3(state[7], n[7], 0x2000000000000); - - #pragma unroll 8 - for (i=0; i < 8; i++) - g_hash[hashPosition + i] = state[i]; - } -} - -__global__ -void oldwhirlpool_gpu_finalhash_64(uint32_t threads, uint32_t startNounce, uint64_t *g_hash, uint32_t *resNounce) -{ - __shared__ uint64_t sharedMemory[2048]; - - if (threadIdx.x < 256) - { - sharedMemory[threadIdx.x] = mixTob0Tox[threadIdx.x]; - #if USE_ALL_TABLES - sharedMemory[threadIdx.x+256] = mixTob1Tox[threadIdx.x]; - sharedMemory[threadIdx.x+512] = mixTob2Tox[threadIdx.x]; - sharedMemory[threadIdx.x+768] = mixTob3Tox[threadIdx.x]; - sharedMemory[threadIdx.x+1024] = mixTob4Tox[threadIdx.x]; - sharedMemory[threadIdx.x+1280] = mixTob5Tox[threadIdx.x]; - sharedMemory[threadIdx.x+1536] = mixTob6Tox[threadIdx.x]; - sharedMemory[threadIdx.x+1792] = mixTob7Tox[threadIdx.x]; - #endif - } - __threadfence_block(); // ensure shared mem is ready - - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t nonce = startNounce + thread; - uint64_t *inpHash = (uint64_t*) &g_hash[(size_t)8 * thread]; - uint64_t h8[8]; - - #pragma unroll 8 - for (int i=0; i<8; i++) { - h8[i] = inpHash[i]; - } - - uint64_t state[8]; - uint64_t n[8]; - uint64_t h[8]; - - #pragma unroll 8 - for (int i=0; i<8; i++) { - n[i] = h8[i]; - h[i] = 0; - } - -// #pragma unroll 10 - for (unsigned r=0; r < 10; r++) { - uint64_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - ROUND_KSCHED(sharedMemory, h, tmp, InitVector_RC[r]); - ROUND_WENC(sharedMemory, n, h, tmp); - } - - #pragma unroll 8 - for (int i=0; i<8; i++) { - state[i] = xor1(n[i], h8[i]); - n[i]=0; - } - - n[0] = 0x80; - n[7] = 0x2000000000000; - - #pragma unroll 8 - for (int i=0; i<8; i++) { - h[i] = state[i]; - n[i] = xor1(n[i], h[i]); - } - -// #pragma unroll 10 - for (unsigned r=0; r < 10; r++) { - uint64_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - ROUND_KSCHED(sharedMemory, h, tmp, InitVector_RC[r]); - ROUND_WENC(sharedMemory, n, h, tmp); - } - - state[0] = xor3(state[0], n[0], 0x80); - state[1] = xor1(state[1], n[1]); - state[2] = xor1(state[2], n[2]); - state[3] = xor1(state[3], n[3]); - state[4] = xor1(state[4], n[4]); - state[5] = xor1(state[5], n[5]); - state[6] = xor1(state[6], n[6]); - state[7] = xor3(state[7], n[7], 0x2000000000000); - - bool rc = (state[3] <= ((uint64_t*)pTarget)[3]); - if (rc && resNounce[0] > nonce) - resNounce[0] = nonce; - } -} - -__host__ -void whirlpool512_init_sm3(int thr_id, uint32_t threads, int mode) -{ - switch (mode) { - case 0: /* x15 with rotated T1-T7 (based on T0) */ - cudaMemcpyToSymbol(InitVector_RC, plain_RC, sizeof(plain_RC), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(mixTob0Tox, plain_T0, sizeof(plain_T0), 0, cudaMemcpyHostToDevice); -#if USE_ALL_TABLES - cudaMemcpyToSymbol(mixTob1Tox, plain_T1, (256*8), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(mixTob2Tox, plain_T2, (256*8), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(mixTob3Tox, plain_T3, (256*8), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(mixTob4Tox, plain_T4, (256*8), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(mixTob5Tox, plain_T5, (256*8), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(mixTob6Tox, plain_T6, (256*8), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(mixTob7Tox, plain_T7, (256*8), 0, cudaMemcpyHostToDevice); -#endif - break; - - case 1: /* old whirlpool */ - cudaMemcpyToSymbol(InitVector_RC, old1_RC, sizeof(plain_RC), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(mixTob0Tox, old1_T0, sizeof(plain_T0), 0, cudaMemcpyHostToDevice); -#if USE_ALL_TABLES - cudaMemcpyToSymbol(mixTob1Tox, old1_T1, (256*8), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(mixTob2Tox, old1_T2, (256*8), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(mixTob3Tox, old1_T3, (256*8), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(mixTob4Tox, old1_T4, (256*8), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(mixTob5Tox, old1_T5, (256*8), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(mixTob6Tox, old1_T6, (256*8), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(mixTob7Tox, old1_T7, (256*8), 0, cudaMemcpyHostToDevice); -#endif - cudaMalloc(&d_WNonce[thr_id], sizeof(uint32_t)); - cudaMallocHost(&h_wnounce[thr_id], sizeof(uint32_t)); - break; - } -} - -__host__ -void whirlpool512_free_sm3(int thr_id) -{ - if (h_wnounce[thr_id]) { - cudaFree(d_WNonce[thr_id]); - cudaFreeHost(h_wnounce[thr_id]); - h_wnounce[thr_id] = NULL; - } -} - -__host__ -void whirlpool512_hash_64_sm3(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order) -{ - dim3 grid((threads + threadsperblock-1) / threadsperblock); - dim3 block(threadsperblock); - - x15_whirlpool_gpu_hash_64 <<>> (threads, startNounce, (uint64_t*)d_hash, d_nonceVector); - - //MyStreamSynchronize(NULL, order, thr_id); -} - -__host__ -extern uint32_t whirlpool512_finalhash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order) -{ - uint32_t result = 0xffffffff; - - dim3 grid((threads + threadsperblock-1) / threadsperblock); - dim3 block(threadsperblock); - - cudaMemset(d_WNonce[thr_id], 0xff, sizeof(uint32_t)); - - oldwhirlpool_gpu_finalhash_64 <<>> (threads, startNounce, (uint64_t*)d_hash, d_WNonce[thr_id]); - - cudaMemcpy(h_wnounce[thr_id], d_WNonce[thr_id], sizeof(uint32_t), cudaMemcpyDeviceToHost); - - result = *h_wnounce[thr_id]; - - return result; -} - -__host__ -void whirlpool512_hash_80_sm3(int thr_id, uint32_t threads, uint32_t startNonce, uint32_t *d_outputHash) -{ - dim3 grid((threads + threadsperblock-1) / threadsperblock); - dim3 block(threadsperblock); - - if (threads < 256) - applog(LOG_WARNING, "whirlpool requires a minimum of 256 threads to fetch constant tables!"); - - oldwhirlpool_gpu_hash_80<<>>(threads, startNonce, d_outputHash, 1); -} - -extern void whirl_midstate(void *state, const void *input); - -__host__ -void whirlpool512_setBlock_80_sm3(void *pdata, const void *ptarget) -{ - unsigned char PaddedMessage[128]; - - memcpy(PaddedMessage, pdata, 80); - memset(PaddedMessage+80, 0, 48); - PaddedMessage[80] = 0x80; /* ending */ - -#if HOST_MIDSTATE - // compute constant first block - unsigned char midstate[64] = { 0 }; - whirl_midstate(midstate, pdata); - memcpy(PaddedMessage, midstate, 64); -#endif - - cudaMemcpyToSymbol(c_PaddedMessage80, PaddedMessage, 128, 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(pTarget, ptarget, 32, 0, cudaMemcpyHostToDevice); -} - -// ------------------------------------------------------------------------------------------------ - -__host__ -void x16_whirlpool512_init(int thr_id, uint32_t threads) -{ - cudaMemcpyToSymbol(InitVector_RC, plain_RC, sizeof(plain_RC), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(mixTob0Tox, plain_T0, sizeof(plain_T0), 0, cudaMemcpyHostToDevice); -#if USE_ALL_TABLES - cudaMemcpyToSymbol(mixTob1Tox, plain_T1, (256 * 8), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(mixTob2Tox, plain_T2, (256 * 8), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(mixTob3Tox, plain_T3, (256 * 8), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(mixTob4Tox, plain_T4, (256 * 8), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(mixTob5Tox, plain_T5, (256 * 8), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(mixTob6Tox, plain_T6, (256 * 8), 0, cudaMemcpyHostToDevice); - cudaMemcpyToSymbol(mixTob7Tox, plain_T7, (256 * 8), 0, cudaMemcpyHostToDevice); -#endif -} - -__host__ -void whirlpool_midstate(void *state, const void *input) -{ - sph_whirlpool_context ctx; - - sph_whirlpool_init(&ctx); - sph_whirlpool(&ctx, input, 64); - - memcpy(state, ctx.state, 64); -} - -__host__ -void x16_whirlpool512_setBlock_80(void *pdata) -{ - unsigned char PaddedMessage[128]; - - memcpy(PaddedMessage, pdata, 80); - memset(PaddedMessage + 80, 0, 48); - PaddedMessage[80] = 0x80; /* ending */ - -#if HOST_MIDSTATE - // compute constant first block - unsigned char midstate[64] = { 0 }; - whirlpool_midstate(midstate, pdata); - memcpy(PaddedMessage, midstate, 64); -#endif - - cudaMemcpyToSymbol(c_PaddedMessage80, PaddedMessage, 128, 0, cudaMemcpyHostToDevice); -} - -__host__ -void x16_whirlpool512_hash_80(int thr_id, const uint32_t threads, const uint32_t startNonce, uint32_t *d_outputHash) -{ - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - - if (threads < 256) - applog(LOG_WARNING, "whirlpool requires a minimum of 256 threads to fetch constant tables!"); - - oldwhirlpool_gpu_hash_80 <<>> (threads, startNonce, d_outputHash, 1); -} diff --git a/x15/whirlpool.cu b/x15/whirlpool.cu deleted file mode 100644 index ae5bc996..00000000 --- a/x15/whirlpool.cu +++ /dev/null @@ -1,181 +0,0 @@ -/* - * whirlpool routine - */ -extern "C" { -#include -#include -} - -#include - -//#define SM3_VARIANT - -#ifdef SM3_VARIANT -static uint32_t *d_hash[MAX_GPUS]; -extern void whirlpool512_init_sm3(int thr_id, uint32_t threads, int mode); -extern void whirlpool512_free_sm3(int thr_id); -extern void whirlpool512_setBlock_80_sm3(void *pdata, const void *ptarget); -extern void whirlpool512_hash_64_sm3(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -extern void whirlpool512_hash_80_sm3(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash); -extern uint32_t whirlpool512_finalhash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -//#define _DEBUG -#define _DEBUG_PREFIX "whirl" -#include -#else -extern void x15_whirlpool_cpu_init(int thr_id, uint32_t threads, int mode); -extern void x15_whirlpool_cpu_free(int thr_id); -extern void whirlpool512_setBlock_80(void *pdata, const void *ptarget); -extern void whirlpool512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *resNonces, const uint64_t target); -#endif - - -// CPU Hash function -extern "C" void wcoinhash(void *state, const void *input) -{ - sph_whirlpool_context ctx_whirlpool; - - unsigned char hash[128]; // uint32_t hashA[16], hashB[16]; - #define hashB hash+64 - - memset(hash, 0, sizeof hash); - - sph_whirlpool1_init(&ctx_whirlpool); - sph_whirlpool1(&ctx_whirlpool, input, 80); - sph_whirlpool1_close(&ctx_whirlpool, hash); - - sph_whirlpool1_init(&ctx_whirlpool); - sph_whirlpool1(&ctx_whirlpool, hash, 64); - sph_whirlpool1_close(&ctx_whirlpool, hashB); - - sph_whirlpool1_init(&ctx_whirlpool); - sph_whirlpool1(&ctx_whirlpool, hashB, 64); - sph_whirlpool1_close(&ctx_whirlpool, hash); - - sph_whirlpool1_init(&ctx_whirlpool); - sph_whirlpool1(&ctx_whirlpool, hash, 64); - sph_whirlpool1_close(&ctx_whirlpool, hash); - - memcpy(state, hash, 32); -} - -void whirl_midstate(void *state, const void *input) -{ - sph_whirlpool_context ctx; - - sph_whirlpool1_init(&ctx); - sph_whirlpool1(&ctx, input, 64); - - memcpy(state, ctx.state, 64); -} - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_whirl(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t _ALIGN(128) endiandata[20]; - uint32_t* pdata = work->data; - uint32_t* ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - - uint32_t throughput = cuda_default_throughput(thr_id, 1U << 19); // 19=256*256*8; - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - if (init[thr_id]) throughput = max(throughput, 256); // shared mem requirement - - if (opt_benchmark) - ((uint32_t*)ptarget)[7] = 0x0000ff; - - if (!init[thr_id]) { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); -#ifdef SM3_VARIANT - CUDA_SAFE_CALL(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput)); - whirlpool512_init_sm3(thr_id, throughput, 1 /* old whirlpool */); -#else - x15_whirlpool_cpu_init(thr_id, throughput, 1 /* old whirlpool */); -#endif - init[thr_id] = true; - } - - for (int k=0; k < 20; k++) { - be32enc(&endiandata[k], pdata[k]); - } - -#ifdef SM3_VARIANT - whirlpool512_setBlock_80_sm3((void*)endiandata, ptarget); -#else - whirlpool512_setBlock_80((void*)endiandata, ptarget); -#endif - - do { -#ifdef SM3_VARIANT - int order = 1; - whirlpool512_hash_80_sm3(thr_id, throughput, pdata[19], d_hash[thr_id]); - TRACE64(" 80 :", d_hash); - whirlpool512_hash_64_sm3(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE64(" 64 :", d_hash); - whirlpool512_hash_64_sm3(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE64(" 64 :", d_hash); - work->nonces[0] = whirlpool512_finalhash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); -#else - whirlpool512_cpu_hash_80(thr_id, throughput, pdata[19], work->nonces, *(uint64_t*)&ptarget[6]); -#endif - *hashes_done = pdata[19] - first_nonce + throughput; - - if (work->nonces[0] != UINT32_MAX && bench_algo < 0) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - be32enc(&endiandata[19], work->nonces[0]); - wcoinhash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - pdata[19] = work->nonces[0] + 1; // cursor - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - return 0; -} - -// cleanup -extern "C" void free_whirl(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - -#ifdef SM3_VARIANT - cudaFree(d_hash[thr_id]); - whirlpool512_free_sm3(thr_id); -#else - x15_whirlpool_cpu_free(thr_id); -#endif - init[thr_id] = false; - - cudaDeviceSynchronize(); -} - diff --git a/x15/whirlpoolx.cu b/x15/whirlpoolx.cu deleted file mode 100644 index e9ec79ba..00000000 --- a/x15/whirlpoolx.cu +++ /dev/null @@ -1,127 +0,0 @@ -/* - * whirlpool routine (djm) - * whirlpoolx routine (provos alexis, tpruvot) - */ -extern "C" { -#include "sph/sph_whirlpool.h" -} - -#include "miner.h" -#include "cuda_helper.h" - -static uint32_t *d_hash[MAX_GPUS] = { 0 }; - -extern void whirlpoolx_cpu_init(int thr_id, uint32_t threads); -extern void whirlpoolx_cpu_free(int thr_id); -extern void whirlpoolx_setBlock_80(void *pdata, const void *ptarget); -extern uint32_t whirlpoolx_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce); -extern void whirlpoolx_precompute(int thr_id); - -// CPU Hash function -extern "C" void whirlxHash(void *state, const void *input) -{ - sph_whirlpool_context ctx_whirlpool; - - unsigned char hash[64]; - unsigned char hash_xored[32]; - - sph_whirlpool_init(&ctx_whirlpool); - sph_whirlpool(&ctx_whirlpool, input, 80); - sph_whirlpool_close(&ctx_whirlpool, hash); - - // compress the 48 first bytes of the hash to 32 - for (int i = 0; i < 32; i++) { - hash_xored[i] = hash[i] ^ hash[i + 16]; - } - memcpy(state, hash_xored, 32); -} - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_whirlx(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - uint32_t endiandata[20]; - int intensity = is_windows() ? 20 : 22; - uint32_t throughput = cuda_default_throughput(thr_id, 1U << intensity); - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ptarget[7] = 0x000f; - - if (!init[thr_id]) { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - CUDA_CALL_OR_RET_X(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput), -1); - - whirlpoolx_cpu_init(thr_id, throughput); - - init[thr_id] = true; - } - - for (int k=0; k < 20; k++) { - be32enc(&endiandata[k], pdata[k]); - } - - whirlpoolx_setBlock_80((void*)endiandata, ptarget); - whirlpoolx_precompute(thr_id); - - do { - uint32_t foundNonce = whirlpoolx_cpu_hash(thr_id, throughput, pdata[19]); - - *(hashes_done) = pdata[19] - first_nonce + throughput; - - if (foundNonce != UINT32_MAX && bench_algo < 0) - { - const uint32_t Htarg = ptarget[7]; - uint32_t vhash64[8]; - be32enc(&endiandata[19], foundNonce); - whirlxHash(vhash64, endiandata); - - if (vhash64[7] <= Htarg && fulltest(vhash64, ptarget)) { - work_set_target_ratio(work, vhash64); - pdata[19] = foundNonce; - return 1; - } else { - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", foundNonce); - } - } - - if ((uint64_t)throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *(hashes_done) = pdata[19] - first_nonce; - - return 0; -} - -// cleanup -extern "C" void free_whirlx(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - - whirlpoolx_cpu_free(thr_id); - init[thr_id] = false; - - cudaDeviceSynchronize(); -} diff --git a/x15/x14.cu b/x15/x14.cu deleted file mode 100644 index 4232c690..00000000 --- a/x15/x14.cu +++ /dev/null @@ -1,270 +0,0 @@ -/* - * X14 algorithm - * Added in ccminer by Tanguy Pruvot - 2014 - */ - -extern "C" { -#include "sph/sph_blake.h" -#include "sph/sph_bmw.h" -#include "sph/sph_groestl.h" -#include "sph/sph_skein.h" -#include "sph/sph_jh.h" -#include "sph/sph_keccak.h" - -#include "sph/sph_luffa.h" -#include "sph/sph_cubehash.h" -#include "sph/sph_shavite.h" -#include "sph/sph_simd.h" -#include "sph/sph_echo.h" - -#include "sph/sph_hamsi.h" -#include "sph/sph_fugue.h" -#include "sph/sph_shabal.h" -} - -#include "miner.h" - -#include "cuda_helper.h" -#include "x11/cuda_x11.h" - -// Memory for the hash functions -static uint32_t *d_hash[MAX_GPUS] = { 0 }; - -extern void x13_hamsi512_cpu_init(int thr_id, uint32_t threads); -extern void x13_hamsi512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void x13_fugue512_cpu_init(int thr_id, uint32_t threads); -extern void x13_fugue512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -extern void x13_fugue512_cpu_free(int thr_id); - -extern void x14_shabal512_cpu_init(int thr_id, uint32_t threads); -extern void x14_shabal512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - - -// X14 CPU Hash function -extern "C" void x14hash(void *output, const void *input) -{ - unsigned char hash[128]; // uint32_t hashA[16], hashB[16]; - #define hashB hash+64 - - memset(hash, 0, sizeof hash); - - sph_blake512_context ctx_blake; - sph_bmw512_context ctx_bmw; - sph_groestl512_context ctx_groestl; - sph_jh512_context ctx_jh; - sph_keccak512_context ctx_keccak; - sph_skein512_context ctx_skein; - sph_luffa512_context ctx_luffa; - sph_cubehash512_context ctx_cubehash; - sph_shavite512_context ctx_shavite; - sph_simd512_context ctx_simd; - sph_echo512_context ctx_echo; - sph_hamsi512_context ctx_hamsi; - sph_fugue512_context ctx_fugue; - sph_shabal512_context ctx_shabal; - - sph_blake512_init(&ctx_blake); - sph_blake512(&ctx_blake, input, 80); - sph_blake512_close(&ctx_blake, hash); - - sph_bmw512_init(&ctx_bmw); - sph_bmw512(&ctx_bmw, hash, 64); - sph_bmw512_close(&ctx_bmw, hashB); - - sph_groestl512_init(&ctx_groestl); - sph_groestl512(&ctx_groestl, hashB, 64); - sph_groestl512_close(&ctx_groestl, hash); - - sph_skein512_init(&ctx_skein); - sph_skein512(&ctx_skein, hash, 64); - sph_skein512_close(&ctx_skein, hashB); - - sph_jh512_init(&ctx_jh); - sph_jh512(&ctx_jh, hashB, 64); - sph_jh512_close(&ctx_jh, hash); - - sph_keccak512_init(&ctx_keccak); - sph_keccak512(&ctx_keccak, hash, 64); - sph_keccak512_close(&ctx_keccak, hashB); - - sph_luffa512_init(&ctx_luffa); - sph_luffa512(&ctx_luffa, hashB, 64); - sph_luffa512_close(&ctx_luffa, hash); - - sph_cubehash512_init(&ctx_cubehash); - sph_cubehash512(&ctx_cubehash, hash, 64); - sph_cubehash512_close(&ctx_cubehash, hashB); - - sph_shavite512_init(&ctx_shavite); - sph_shavite512(&ctx_shavite, hashB, 64); - sph_shavite512_close(&ctx_shavite, hash); - - sph_simd512_init(&ctx_simd); - sph_simd512(&ctx_simd, hash, 64); - sph_simd512_close(&ctx_simd, hashB); - - sph_echo512_init(&ctx_echo); - sph_echo512(&ctx_echo, hashB, 64); - sph_echo512_close(&ctx_echo, hash); - - sph_hamsi512_init(&ctx_hamsi); - sph_hamsi512(&ctx_hamsi, hash, 64); - sph_hamsi512_close(&ctx_hamsi, hashB); - - sph_fugue512_init(&ctx_fugue); - sph_fugue512(&ctx_fugue, hashB, 64); - sph_fugue512_close(&ctx_fugue, hash); - - sph_shabal512_init(&ctx_shabal); - sph_shabal512(&ctx_shabal, hash, 64); - sph_shabal512_close(&ctx_shabal, hash); - - memcpy(output, hash, 32); -} - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_x14(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - uint32_t endiandata[20]; - - uint32_t throughput = cuda_default_throughput(thr_id, 1U << 19); // 19=256*256*8; - //if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ptarget[7] = 0x000f; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - quark_blake512_cpu_init(thr_id, throughput); - quark_groestl512_cpu_init(thr_id, throughput); - quark_skein512_cpu_init(thr_id, throughput); - quark_bmw512_cpu_init(thr_id, throughput); - quark_keccak512_cpu_init(thr_id, throughput); - quark_jh512_cpu_init(thr_id, throughput); - x11_luffaCubehash512_cpu_init(thr_id, throughput); - x11_shavite512_cpu_init(thr_id, throughput); - x11_simd512_cpu_init(thr_id, throughput); - x11_echo512_cpu_init(thr_id, throughput); - x13_hamsi512_cpu_init(thr_id, throughput); - x13_fugue512_cpu_init(thr_id, throughput); - x14_shabal512_cpu_init(thr_id, throughput); - - cuda_check_cpu_init(thr_id, throughput); - - cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput); - - CUDA_LOG_ERROR(); - - init[thr_id] = true; - } - - for (int k = 0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - quark_blake512_cpu_setBlock_80(thr_id, endiandata); - cuda_check_cpu_setTarget(ptarget); - - do { - int order = 0; - quark_blake512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - quark_bmw512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_groestl512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_jh512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_keccak512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_luffaCubehash512_cpu_hash_64(thr_id, throughput, d_hash[thr_id], order++); - x11_shavite512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_simd512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x13_hamsi512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x13_fugue512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x14_shabal512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - - CUDA_LOG_ERROR(); - - *hashes_done = pdata[19] - first_nonce + throughput; - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - /* check now with the CPU to confirm */ - be32enc(&endiandata[19], work->nonces[0]); - x14hash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - work_set_target_ratio(work, vhash); - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - x14hash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t)throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - CUDA_LOG_ERROR(); - - *hashes_done = pdata[19] - first_nonce; - return 0; -} - -// cleanup -extern "C" void free_x14(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - quark_blake512_cpu_free(thr_id); - quark_groestl512_cpu_free(thr_id); - x11_simd512_cpu_free(thr_id); - x13_fugue512_cpu_free(thr_id); - - cudaFree(d_hash[thr_id]); - d_hash[thr_id] = NULL; - - cuda_check_cpu_free(thr_id); - - cudaDeviceSynchronize(); - init[thr_id] = false; -} diff --git a/x15/x15.cu b/x15/x15.cu deleted file mode 100644 index cdfbd81f..00000000 --- a/x15/x15.cu +++ /dev/null @@ -1,275 +0,0 @@ -/* - * X15 algorithm (CHC, BBC, X15C) - * Added in ccminer by Tanguy Pruvot - 2014 - */ - -extern "C" { -#include "sph/sph_blake.h" -#include "sph/sph_bmw.h" -#include "sph/sph_groestl.h" -#include "sph/sph_skein.h" -#include "sph/sph_jh.h" -#include "sph/sph_keccak.h" - -#include "sph/sph_luffa.h" -#include "sph/sph_cubehash.h" -#include "sph/sph_shavite.h" -#include "sph/sph_simd.h" -#include "sph/sph_echo.h" - -#include "sph/sph_hamsi.h" -#include "sph/sph_fugue.h" -#include "sph/sph_shabal.h" -#include "sph/sph_whirlpool.h" -} - -#include "miner.h" - -#include "cuda_helper.h" -#include "x11/cuda_x11.h" - -// Memory for the hash functions -static uint32_t *d_hash[MAX_GPUS] = { 0 }; - -extern void x13_hamsi512_cpu_init(int thr_id, uint32_t threads); -extern void x13_hamsi512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void x13_fugue512_cpu_init(int thr_id, uint32_t threads); -extern void x13_fugue512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -extern void x13_fugue512_cpu_free(int thr_id); - -extern void x14_shabal512_cpu_init(int thr_id, uint32_t threads); -extern void x14_shabal512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void x15_whirlpool_cpu_init(int thr_id, uint32_t threads, int mode); -extern void x15_whirlpool_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -extern void x15_whirlpool_cpu_free(int thr_id); - - -// X15 CPU Hash function -extern "C" void x15hash(void *output, const void *input) -{ - sph_blake512_context ctx_blake; - sph_bmw512_context ctx_bmw; - sph_groestl512_context ctx_groestl; - sph_jh512_context ctx_jh; - sph_keccak512_context ctx_keccak; - sph_skein512_context ctx_skein; - sph_luffa512_context ctx_luffa; - sph_cubehash512_context ctx_cubehash; - sph_shavite512_context ctx_shavite; - sph_simd512_context ctx_simd; - sph_echo512_context ctx_echo; - sph_hamsi512_context ctx_hamsi; - sph_fugue512_context ctx_fugue; - sph_shabal512_context ctx_shabal; - sph_whirlpool_context ctx_whirlpool; - - unsigned char hash[128]; // uint32_t hashA[16], hashB[16]; - #define hashB hash+64 - - memset(hash, 0, sizeof hash); - - sph_blake512_init(&ctx_blake); - sph_blake512(&ctx_blake, input, 80); - sph_blake512_close(&ctx_blake, hash); - - sph_bmw512_init(&ctx_bmw); - sph_bmw512(&ctx_bmw, hash, 64); - sph_bmw512_close(&ctx_bmw, hashB); - - sph_groestl512_init(&ctx_groestl); - sph_groestl512(&ctx_groestl, hashB, 64); - sph_groestl512_close(&ctx_groestl, hash); - - sph_skein512_init(&ctx_skein); - sph_skein512(&ctx_skein, hash, 64); - sph_skein512_close(&ctx_skein, hashB); - - sph_jh512_init(&ctx_jh); - sph_jh512(&ctx_jh, hashB, 64); - sph_jh512_close(&ctx_jh, hash); - - sph_keccak512_init(&ctx_keccak); - sph_keccak512(&ctx_keccak, hash, 64); - sph_keccak512_close(&ctx_keccak, hashB); - - sph_luffa512_init(&ctx_luffa); - sph_luffa512(&ctx_luffa, hashB, 64); - sph_luffa512_close(&ctx_luffa, hash); - - sph_cubehash512_init(&ctx_cubehash); - sph_cubehash512(&ctx_cubehash, hash, 64); - sph_cubehash512_close(&ctx_cubehash, hashB); - - sph_shavite512_init(&ctx_shavite); - sph_shavite512(&ctx_shavite, hashB, 64); - sph_shavite512_close(&ctx_shavite, hash); - - sph_simd512_init(&ctx_simd); - sph_simd512(&ctx_simd, hash, 64); - sph_simd512_close(&ctx_simd, hashB); - - sph_echo512_init(&ctx_echo); - sph_echo512(&ctx_echo, hashB, 64); - sph_echo512_close(&ctx_echo, hash); - - sph_hamsi512_init(&ctx_hamsi); - sph_hamsi512(&ctx_hamsi, hash, 64); - sph_hamsi512_close(&ctx_hamsi, hashB); - - sph_fugue512_init(&ctx_fugue); - sph_fugue512(&ctx_fugue, hashB, 64); - sph_fugue512_close(&ctx_fugue, hash); - - sph_shabal512_init(&ctx_shabal); - sph_shabal512(&ctx_shabal, hash, 64); - sph_shabal512_close(&ctx_shabal, hashB); - - sph_whirlpool_init(&ctx_whirlpool); - sph_whirlpool(&ctx_whirlpool, hashB, 64); - sph_whirlpool_close(&ctx_whirlpool, hash); - - memcpy(output, hash, 32); -} - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_x15(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - uint32_t endiandata[20]; - - uint32_t throughput = cuda_default_throughput(thr_id, 1U << 19); // 19=256*256*8; - //if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ptarget[7] = 0x00FF; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - quark_blake512_cpu_init(thr_id, throughput); - quark_groestl512_cpu_init(thr_id, throughput); - quark_skein512_cpu_init(thr_id, throughput); - quark_bmw512_cpu_init(thr_id, throughput); - quark_keccak512_cpu_init(thr_id, throughput); - quark_jh512_cpu_init(thr_id, throughput); - x11_luffaCubehash512_cpu_init(thr_id, throughput); - x11_shavite512_cpu_init(thr_id, throughput); - x11_simd512_cpu_init(thr_id, throughput); - x11_echo512_cpu_init(thr_id, throughput); - x13_hamsi512_cpu_init(thr_id, throughput); - x13_fugue512_cpu_init(thr_id, throughput); - x14_shabal512_cpu_init(thr_id, throughput); - x15_whirlpool_cpu_init(thr_id, throughput, 0); - - CUDA_CALL_OR_RET_X(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput), 0); - - cuda_check_cpu_init(thr_id, throughput); - init[thr_id] = true; - } - - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - quark_blake512_cpu_setBlock_80(thr_id, endiandata); - cuda_check_cpu_setTarget(ptarget); - - do { - int order = 0; - quark_blake512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - quark_bmw512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_groestl512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_jh512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_keccak512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_luffaCubehash512_cpu_hash_64(thr_id, throughput, d_hash[thr_id], order++); - x11_shavite512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_simd512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x13_hamsi512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x13_fugue512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x14_shabal512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x15_whirlpool_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - - *hashes_done = pdata[19] - first_nonce + throughput; - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - /* check now with the CPU to confirm */ - be32enc(&endiandata[19], work->nonces[0]); - x15hash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - work_set_target_ratio(work, vhash); - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - x15hash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[19] = work->nonces[0] + 1; - continue; - } - } - - if ((uint64_t) throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (!work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - - return 0; -} - -// cleanup -extern "C" void free_x15(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - - quark_blake512_cpu_free(thr_id); - quark_groestl512_cpu_free(thr_id); - x11_simd512_cpu_free(thr_id); - x13_fugue512_cpu_free(thr_id); - x15_whirlpool_cpu_free(thr_id); - - cuda_check_cpu_free(thr_id); - - cudaDeviceSynchronize(); - init[thr_id] = false; -} diff --git a/x16/cuda_x16.h b/x16/cuda_x16.h deleted file mode 100644 index b07cda56..00000000 --- a/x16/cuda_x16.h +++ /dev/null @@ -1,75 +0,0 @@ -#include "x11/cuda_x11.h" - -extern void x11_echo512_cpu_hash_64_alexis(int thr_id, uint32_t threads, uint32_t *d_hash); -extern void x11_luffa512_cpu_hash_64_alexis(int thr_id, uint32_t threads,uint32_t *d_hash); -extern void x11_shavite512_cpu_hash_64_alexis(int thr_id, uint32_t threads, uint32_t *d_hash); -extern void x13_hamsi512_cpu_hash_64_alexis(int thr_id, uint32_t threads, uint32_t *d_hash); -extern void x13_fugue512_cpu_hash_64_alexis(int thr_id, uint32_t threads, uint32_t *d_hash); -extern void x14_shabal512_cpu_hash_64_alexis(int thr_id, uint32_t threads, uint32_t *d_hash); - -extern void x15_whirlpool_cpu_init(int thr_id, uint32_t threads, int flag); -extern void x15_whirlpool_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNonce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -extern void x15_whirlpool_cpu_free(int thr_id); - -extern void x17_sha512_cpu_init(int thr_id, uint32_t threads); -extern void x17_sha512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNonce, uint32_t *d_hash); - -extern void x17_haval256_cpu_init(int thr_id, uint32_t threads); -extern void x17_haval256_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNonce, uint32_t *d_hash, const int outlen); - -void quark_blake512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNonce, uint32_t *d_nonceVector, uint32_t *d_outputHash, int order); - -// ---- 80 bytes kernels - -void quark_bmw512_cpu_setBlock_80(void *pdata); -void quark_bmw512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNonce, uint32_t *d_hash, int order); - -void groestl512_setBlock_80(int thr_id, uint32_t *endiandata); -void groestl512_cuda_hash_80(const int thr_id, const uint32_t threads, const uint32_t startNonce, uint32_t *d_hash); - -void skein512_cpu_setBlock_80(void *pdata); -void skein512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNonce, uint32_t *d_hash, int swap); - -extern void qubit_luffa512_cpu_setBlock_80_alexis(void *pdata); -extern void qubit_luffa512_cpu_hash_80_alexis(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_outputHash); - -void jh512_setBlock_80(int thr_id, uint32_t *endiandata); -void jh512_cuda_hash_80(const int thr_id, const uint32_t threads, const uint32_t startNonce, uint32_t *d_hash); - -void keccak512_setBlock_80(int thr_id, uint32_t *endiandata); -void keccak512_cuda_hash_80(const int thr_id, const uint32_t threads, const uint32_t startNonce, uint32_t *d_hash); - -void cubehash512_setBlock_80(int thr_id, uint32_t* endiandata); -void cubehash512_cuda_hash_80(const int thr_id, const uint32_t threads, const uint32_t startNonce, uint32_t *d_hash); - -void x11_shavite512_setBlock_80(void *pdata); -void x11_shavite512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNonce, uint32_t *d_hash, int order); - -void x16_shabal512_setBlock_80(void *pdata); -void x16_shabal512_cuda_hash_80(int thr_id, const uint32_t threads, const uint32_t startNonce, uint32_t *d_hash); - -void x16_simd512_setBlock_80(void *pdata); -void x16_simd512_cuda_hash_80(int thr_id, const uint32_t threads, const uint32_t startNonce, uint32_t *d_hash); - -// void x16_echo512_cuda_init(int thr_id, const uint32_t threads); -// void x16_echo512_setBlock_80(void *pdata); -// void x16_echo512_cuda_hash_80(int thr_id, const uint32_t threads, const uint32_t startNonce, uint32_t *d_hash); - -extern void x11_echo512_setBlock_80_alexis(void *endiandata); -extern void x11_echo512_cpu_hash_80_alexis(int thr_id, uint32_t threads, const uint32_t startNonce, uint32_t *d_hash); - -extern void x13_hamsi512_cpu_init(int thr_id, uint32_t threads); -void x16_hamsi512_setBlock_80(void *pdata); -void x16_hamsi512_cuda_hash_80(int thr_id, const uint32_t threads, const uint32_t startNonce, uint32_t *d_hash); - -void x16_fugue512_cpu_init(int thr_id, uint32_t threads); -void x16_fugue512_cpu_free(int thr_id); -void x16_fugue512_setBlock_80(void *pdata); -void x16_fugue512_cuda_hash_80(int thr_id, const uint32_t threads, const uint32_t startNonce, uint32_t *d_hash); - -void x16_whirlpool512_init(int thr_id, uint32_t threads); -void x16_whirlpool512_setBlock_80(void* endiandata); -void x16_whirlpool512_hash_80(int thr_id, const uint32_t threads, const uint32_t startNonce, uint32_t *d_hash); - -void x16_sha512_setBlock_80(void *pdata); -void x16_sha512_cuda_hash_80(int thr_id, const uint32_t threads, const uint32_t startNonce, uint32_t *d_hash); diff --git a/x16/cuda_x16_echo512.cu b/x16/cuda_x16_echo512.cu deleted file mode 100644 index 5e6013d2..00000000 --- a/x16/cuda_x16_echo512.cu +++ /dev/null @@ -1,214 +0,0 @@ -/** - * echo512-80 cuda kernel for X16R algorithm - * - * tpruvot 2018 - GPL code - */ - -#include -#include - -#include "cuda_helper.h" - -extern __device__ __device_builtin__ void __threadfence_block(void); - -#include "../x11/cuda_x11_aes.cuh" - -__device__ __forceinline__ void AES_2ROUND(const uint32_t* __restrict__ sharedMemory, - uint32_t &x0, uint32_t &x1, uint32_t &x2, uint32_t &x3, - uint32_t &k0) -{ - uint32_t y0, y1, y2, y3; - - aes_round(sharedMemory, - x0, x1, x2, x3, - k0, - y0, y1, y2, y3); - - aes_round(sharedMemory, - y0, y1, y2, y3, - x0, x1, x2, x3); - - k0++; -} - -__device__ -static void echo_round(uint32_t* const sharedMemory, uint32_t *W, uint32_t &k0) -{ - // Big Sub Words - #pragma unroll 16 - for (int idx = 0; idx < 16; idx++) { - AES_2ROUND(sharedMemory, W[(idx << 2) + 0], W[(idx << 2) + 1], W[(idx << 2) + 2], W[(idx << 2) + 3], k0); - } - - // Shift Rows - #pragma unroll 4 - for (int i = 0; i < 4; i++) - { - uint32_t t[4]; - /// 1, 5, 9, 13 - t[0] = W[i + 4]; - t[1] = W[i + 8]; - t[2] = W[i + 24]; - t[3] = W[i + 60]; - - W[i + 4] = W[i + 20]; - W[i + 8] = W[i + 40]; - W[i + 24] = W[i + 56]; - W[i + 60] = W[i + 44]; - - W[i + 20] = W[i + 36]; - W[i + 40] = t[1]; - W[i + 56] = t[2]; - W[i + 44] = W[i + 28]; - - W[i + 28] = W[i + 12]; - W[i + 12] = t[3]; - W[i + 36] = W[i + 52]; - W[i + 52] = t[0]; - } - - // Mix Columns - #pragma unroll 4 - for (int i = 0; i < 4; i++) - { - #pragma unroll 4 - for (int idx = 0; idx < 64; idx += 16) - { - uint32_t a[4]; - a[0] = W[idx + i]; - a[1] = W[idx + i + 4]; - a[2] = W[idx + i + 8]; - a[3] = W[idx + i + 12]; - - uint32_t ab = a[0] ^ a[1]; - uint32_t bc = a[1] ^ a[2]; - uint32_t cd = a[2] ^ a[3]; - - uint32_t t, t2, t3; - t = (ab & 0x80808080); - t2 = (bc & 0x80808080); - t3 = (cd & 0x80808080); - - uint32_t abx = (t >> 7) * 27U ^ ((ab^t) << 1); - uint32_t bcx = (t2 >> 7) * 27U ^ ((bc^t2) << 1); - uint32_t cdx = (t3 >> 7) * 27U ^ ((cd^t3) << 1); - - W[idx + i] = bc ^ a[3] ^ abx; - W[idx + i + 4] = a[0] ^ cd ^ bcx; - W[idx + i + 8] = ab ^ a[3] ^ cdx; - W[idx + i + 12] = ab ^ a[2] ^ (abx ^ bcx ^ cdx); - } - } -} - -__device__ __forceinline__ -void cuda_echo_round_80(uint32_t *const __restrict__ sharedMemory, uint32_t *const __restrict__ data, const uint32_t nonce, uint32_t *hash) -{ - uint32_t h[29]; // <= 127 bytes input - - #pragma unroll 8 - for (int i = 0; i < 18; i += 2) - AS_UINT2(&h[i]) = AS_UINT2(&data[i]); - h[18] = data[18]; - h[19] = cuda_swab32(nonce); - h[20] = 0x80; - h[21] = h[22] = h[23] = h[24] = h[25] = h[26] = 0; - //((uint8_t*)h)[80] = 0x80; - //((uint8_t*)h)[128-17] = 0x02; - //((uint8_t*)h)[128-16] = 0x80; - //((uint8_t*)h)[128-15] = 0x02; - h[27] = 0x2000000; - h[28] = 0x280; - //h[29] = h[30] = h[31] = 0; - - uint32_t k0 = 640; // bitlen - uint32_t W[64]; - - #pragma unroll 8 - for (int i = 0; i < 32; i+=4) { - W[i] = 512; // L - W[i+1] = 0; // H - W[i+2] = 0; // X - W[i+3] = 0; - } - - uint32_t Z[16]; - #pragma unroll - for (int i = 0; i<16; i++) Z[i] = W[i]; - #pragma unroll - for (int i = 32; i<61; i++) W[i] = h[i - 32]; - #pragma unroll - for (int i = 61; i<64; i++) W[i] = 0; - - for (int i = 0; i < 10; i++) - echo_round(sharedMemory, W, k0); - - #pragma unroll 16 - for (int i = 0; i < 16; i++) { - Z[i] ^= h[i] ^ W[i] ^ W[i + 32]; - } - - #pragma unroll 8 - for (int i = 0; i < 16; i += 2) - AS_UINT2(&hash[i]) = AS_UINT2(&Z[i]); -} - -__device__ __forceinline__ -void echo_gpu_init(uint32_t *const __restrict__ sharedMemory) -{ - /* each thread startup will fill a uint32 */ - if (threadIdx.x < 128) { - sharedMemory[threadIdx.x] = d_AES0[threadIdx.x]; - sharedMemory[threadIdx.x + 256] = d_AES1[threadIdx.x]; - sharedMemory[threadIdx.x + 512] = d_AES2[threadIdx.x]; - sharedMemory[threadIdx.x + 768] = d_AES3[threadIdx.x]; - - sharedMemory[threadIdx.x + 64 * 2] = d_AES0[threadIdx.x + 64 * 2]; - sharedMemory[threadIdx.x + 64 * 2 + 256] = d_AES1[threadIdx.x + 64 * 2]; - sharedMemory[threadIdx.x + 64 * 2 + 512] = d_AES2[threadIdx.x + 64 * 2]; - sharedMemory[threadIdx.x + 64 * 2 + 768] = d_AES3[threadIdx.x + 64 * 2]; - } -} - -__host__ -void x16_echo512_cuda_init(int thr_id, const uint32_t threads) -{ - aes_cpu_init(thr_id); -} - -__constant__ static uint32_t c_PaddedMessage80[20]; - -__host__ -void x16_echo512_setBlock_80(void *endiandata) -{ - cudaMemcpyToSymbol(c_PaddedMessage80, endiandata, sizeof(c_PaddedMessage80), 0, cudaMemcpyHostToDevice); -} - -__global__ __launch_bounds__(128, 7) /* will force 72 registers */ -void x16_echo512_gpu_hash_80(uint32_t threads, uint32_t startNonce, uint64_t *g_hash) -{ - __shared__ uint32_t sharedMemory[1024]; - - echo_gpu_init(sharedMemory); - __threadfence_block(); - - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint64_t hashPosition = thread; - uint32_t *pHash = (uint32_t*)&g_hash[hashPosition<<3]; - - cuda_echo_round_80(sharedMemory, c_PaddedMessage80, startNonce + thread, pHash); - } -} - -__host__ -void x16_echo512_cuda_hash_80(int thr_id, const uint32_t threads, const uint32_t startNonce, uint32_t *d_hash) -{ - const uint32_t threadsperblock = 128; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - x16_echo512_gpu_hash_80<<>>(threads, startNonce, (uint64_t*)d_hash); -} diff --git a/x16/cuda_x16_fugue512.cu b/x16/cuda_x16_fugue512.cu deleted file mode 100644 index 7f3438c2..00000000 --- a/x16/cuda_x16_fugue512.cu +++ /dev/null @@ -1,467 +0,0 @@ - -#include -#include - -#define TPB 256 - -/* - * fugue512-80 x16r kernel implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2018 tpruvot - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - */ - -#ifdef __INTELLISENSE__ -#define __byte_perm(x, y, m) (x|y) -#define tex1Dfetch(t, n) (n) -#define __CUDACC__ -#include -#endif - -// store allocated textures device addresses -static unsigned int* d_textures[MAX_GPUS][1]; - -#define mixtab0(x) mixtabs[(x)] -#define mixtab1(x) mixtabs[(x)+256] -#define mixtab2(x) mixtabs[(x)+512] -#define mixtab3(x) mixtabs[(x)+768] - -static texture mixTab0Tex; - -static const uint32_t mixtab0[] = { - 0x63633297, 0x7c7c6feb, 0x77775ec7, 0x7b7b7af7, 0xf2f2e8e5, 0x6b6b0ab7, 0x6f6f16a7, 0xc5c56d39, - 0x303090c0, 0x01010704, 0x67672e87, 0x2b2bd1ac, 0xfefeccd5, 0xd7d71371, 0xabab7c9a, 0x767659c3, - 0xcaca4005, 0x8282a33e, 0xc9c94909, 0x7d7d68ef, 0xfafad0c5, 0x5959947f, 0x4747ce07, 0xf0f0e6ed, - 0xadad6e82, 0xd4d41a7d, 0xa2a243be, 0xafaf608a, 0x9c9cf946, 0xa4a451a6, 0x727245d3, 0xc0c0762d, - 0xb7b728ea, 0xfdfdc5d9, 0x9393d47a, 0x2626f298, 0x363682d8, 0x3f3fbdfc, 0xf7f7f3f1, 0xcccc521d, - 0x34348cd0, 0xa5a556a2, 0xe5e58db9, 0xf1f1e1e9, 0x71714cdf, 0xd8d83e4d, 0x313197c4, 0x15156b54, - 0x04041c10, 0xc7c76331, 0x2323e98c, 0xc3c37f21, 0x18184860, 0x9696cf6e, 0x05051b14, 0x9a9aeb5e, - 0x0707151c, 0x12127e48, 0x8080ad36, 0xe2e298a5, 0xebeba781, 0x2727f59c, 0xb2b233fe, 0x757550cf, - 0x09093f24, 0x8383a43a, 0x2c2cc4b0, 0x1a1a4668, 0x1b1b416c, 0x6e6e11a3, 0x5a5a9d73, 0xa0a04db6, - 0x5252a553, 0x3b3ba1ec, 0xd6d61475, 0xb3b334fa, 0x2929dfa4, 0xe3e39fa1, 0x2f2fcdbc, 0x8484b126, - 0x5353a257, 0xd1d10169, 0x00000000, 0xededb599, 0x2020e080, 0xfcfcc2dd, 0xb1b13af2, 0x5b5b9a77, - 0x6a6a0db3, 0xcbcb4701, 0xbebe17ce, 0x3939afe4, 0x4a4aed33, 0x4c4cff2b, 0x5858937b, 0xcfcf5b11, - 0xd0d0066d, 0xefefbb91, 0xaaaa7b9e, 0xfbfbd7c1, 0x4343d217, 0x4d4df82f, 0x333399cc, 0x8585b622, - 0x4545c00f, 0xf9f9d9c9, 0x02020e08, 0x7f7f66e7, 0x5050ab5b, 0x3c3cb4f0, 0x9f9ff04a, 0xa8a87596, - 0x5151ac5f, 0xa3a344ba, 0x4040db1b, 0x8f8f800a, 0x9292d37e, 0x9d9dfe42, 0x3838a8e0, 0xf5f5fdf9, - 0xbcbc19c6, 0xb6b62fee, 0xdada3045, 0x2121e784, 0x10107040, 0xffffcbd1, 0xf3f3efe1, 0xd2d20865, - 0xcdcd5519, 0x0c0c2430, 0x1313794c, 0xececb29d, 0x5f5f8667, 0x9797c86a, 0x4444c70b, 0x1717655c, - 0xc4c46a3d, 0xa7a758aa, 0x7e7e61e3, 0x3d3db3f4, 0x6464278b, 0x5d5d886f, 0x19194f64, 0x737342d7, - 0x60603b9b, 0x8181aa32, 0x4f4ff627, 0xdcdc225d, 0x2222ee88, 0x2a2ad6a8, 0x9090dd76, 0x88889516, - 0x4646c903, 0xeeeebc95, 0xb8b805d6, 0x14146c50, 0xdede2c55, 0x5e5e8163, 0x0b0b312c, 0xdbdb3741, - 0xe0e096ad, 0x32329ec8, 0x3a3aa6e8, 0x0a0a3628, 0x4949e43f, 0x06061218, 0x2424fc90, 0x5c5c8f6b, - 0xc2c27825, 0xd3d30f61, 0xacac6986, 0x62623593, 0x9191da72, 0x9595c662, 0xe4e48abd, 0x797974ff, - 0xe7e783b1, 0xc8c84e0d, 0x373785dc, 0x6d6d18af, 0x8d8d8e02, 0xd5d51d79, 0x4e4ef123, 0xa9a97292, - 0x6c6c1fab, 0x5656b943, 0xf4f4fafd, 0xeaeaa085, 0x6565208f, 0x7a7a7df3, 0xaeae678e, 0x08083820, - 0xbaba0bde, 0x787873fb, 0x2525fb94, 0x2e2ecab8, 0x1c1c5470, 0xa6a65fae, 0xb4b421e6, 0xc6c66435, - 0xe8e8ae8d, 0xdddd2559, 0x747457cb, 0x1f1f5d7c, 0x4b4bea37, 0xbdbd1ec2, 0x8b8b9c1a, 0x8a8a9b1e, - 0x70704bdb, 0x3e3ebaf8, 0xb5b526e2, 0x66662983, 0x4848e33b, 0x0303090c, 0xf6f6f4f5, 0x0e0e2a38, - 0x61613c9f, 0x35358bd4, 0x5757be47, 0xb9b902d2, 0x8686bf2e, 0xc1c17129, 0x1d1d5374, 0x9e9ef74e, - 0xe1e191a9, 0xf8f8decd, 0x9898e556, 0x11117744, 0x696904bf, 0xd9d93949, 0x8e8e870e, 0x9494c166, - 0x9b9bec5a, 0x1e1e5a78, 0x8787b82a, 0xe9e9a989, 0xcece5c15, 0x5555b04f, 0x2828d8a0, 0xdfdf2b51, - 0x8c8c8906, 0xa1a14ab2, 0x89899212, 0x0d0d2334, 0xbfbf10ca, 0xe6e684b5, 0x4242d513, 0x686803bb, - 0x4141dc1f, 0x9999e252, 0x2d2dc3b4, 0x0f0f2d3c, 0xb0b03df6, 0x5454b74b, 0xbbbb0cda, 0x16166258 -}; - -#define TIX4(q, x00, x01, x04, x07, x08, x22, x24, x27, x30) { \ - x22 ^= x00; \ - x00 = (q); \ - x08 ^= x00; \ - x01 ^= x24; \ - x04 ^= x27; \ - x07 ^= x30; \ -} - -#define CMIX36(x00, x01, x02, x04, x05, x06, x18, x19, x20) { \ - x00 ^= x04; \ - x01 ^= x05; \ - x02 ^= x06; \ - x18 ^= x04; \ - x19 ^= x05; \ - x20 ^= x06; \ -} - -#define SMIX(x0, x1, x2, x3) { \ - uint32_t tmp; \ - uint32_t r0 = 0; \ - uint32_t r1 = 0; \ - uint32_t r2 = 0; \ - uint32_t r3 = 0; \ - uint32_t c0 = mixtab0(x0 >> 24); \ - tmp = mixtab1((x0 >> 16) & 0xFF); \ - c0 ^= tmp; \ - r1 ^= tmp; \ - tmp = mixtab2((x0 >> 8) & 0xFF); \ - c0 ^= tmp; \ - r2 ^= tmp; \ - tmp = mixtab3(x0 & 0xFF); \ - c0 ^= tmp; \ - r3 ^= tmp; \ - tmp = mixtab0(x1 >> 24); \ - uint32_t c1 = tmp; \ - r0 ^= tmp; \ - tmp = mixtab1((x1 >> 16) & 0xFF); \ - c1 ^= tmp; \ - tmp = mixtab2((x1 >> 8) & 0xFF); \ - c1 ^= tmp; \ - r2 ^= tmp; \ - tmp = mixtab3(x1 & 0xFF); \ - c1 ^= tmp; \ - r3 ^= tmp; \ - tmp = mixtab0(x2 >> 24); \ - uint32_t c2 = tmp; \ - r0 ^= tmp; \ - tmp = mixtab1((x2 >> 16) & 0xFF); \ - c2 ^= tmp; \ - r1 ^= tmp; \ - tmp = mixtab2((x2 >> 8) & 0xFF); \ - c2 ^= tmp; \ - tmp = mixtab3(x2 & 0xFF); \ - c2 ^= tmp; \ - r3 ^= tmp; \ - tmp = mixtab0(x3 >> 24); \ - uint32_t c3 = tmp; \ - r0 ^= tmp; \ - tmp = mixtab1((x3 >> 16) & 0xFF); \ - c3 ^= tmp; \ - r1 ^= tmp; \ - tmp = mixtab2((x3 >> 8) & 0xFF); \ - c3 ^= tmp; \ - r2 ^= tmp; \ - tmp = mixtab3(x3 & 0xFF); \ - c3 ^= tmp; \ - x0 = ((c0 ^ r0) & 0xFF000000) | ((c1 ^ r1) & 0x00FF0000) \ - | ((c2 ^ r2) & 0x0000FF00) | ((c3 ^ r3) & 0x000000FF); \ - x1 = ((c1 ^ (r0 << 8)) & 0xFF000000) | ((c2 ^ (r1 << 8)) & 0x00FF0000) \ - | ((c3 ^ (r2 << 8)) & 0x0000FF00) | ((c0 ^ (r3 >> 24)) & 0x000000FF); \ - x2 = ((c2 ^ (r0 << 16)) & 0xFF000000) | ((c3 ^ (r1 << 16)) & 0x00FF0000) \ - | ((c0 ^ (r2 >> 16)) & 0x0000FF00) | ((c1 ^ (r3 >> 16)) & 0x000000FF); \ - x3 = ((c3 ^ (r0 << 24)) & 0xFF000000) | ((c0 ^ (r1 >> 8)) & 0x00FF0000) \ - | ((c1 ^ (r2 >> 8)) & 0x0000FF00) | ((c2 ^ (r3 >> 8)) & 0x000000FF); \ -} - -#define SUB_ROR3 { \ - B33 = S33, B34 = S34, B35 = S35; \ - S35 = S32; S34 = S31; S33 = S30; S32 = S29; S31 = S28; S30 = S27; S29 = S26; S28 = S25; S27 = S24; \ - S26 = S23; S25 = S22; S24 = S21; S23 = S20; S22 = S19; S21 = S18; S20 = S17; S19 = S16; S18 = S15; \ - S17 = S14; S16 = S13; S15 = S12; S14 = S11; S13 = S10; S12 = S09; S11 = S08; S10 = S07; S09 = S06; \ - S08 = S05; S07 = S04; S06 = S03; S05 = S02; S04 = S01; S03 = S00; S02 = B35; S01 = B34; S00 = B33; \ -} - -#define SUB_ROR8 { \ - B28 = S28, B29 = S29, B30 = S30, B31 = S31, B32 = S32, B33 = S33, B34 = S34, B35 = S35; \ - S35 = S27; S34 = S26; S33 = S25; S32 = S24; S31 = S23; S30 = S22; S29 = S21; S28 = S20; S27 = S19; \ - S26 = S18; S25 = S17; S24 = S16; S23 = S15; S22 = S14; S21 = S13; S20 = S12; S19 = S11; S18 = S10; \ - S17 = S09; S16 = S08; S15 = S07; S14 = S06; S13 = S05; S12 = S04; S11 = S03; S10 = S02; S09 = S01; \ - S08 = S00; S07 = B35; S06 = B34; S05 = B33; S04 = B32; S03 = B31; S02 = B30; S01 = B29; S00 = B28; \ -} - -#define SUB_ROR9 { \ - B27 = S27, B28 = S28, B29 = S29, B30 = S30, B31 = S31, B32 = S32, B33 = S33, B34 = S34, B35 = S35; \ - S35 = S26; S34 = S25; S33 = S24; S32 = S23; S31 = S22; S30 = S21; S29 = S20; S28 = S19; S27 = S18; \ - S26 = S17; S25 = S16; S24 = S15; S23 = S14; S22 = S13; S21 = S12; S20 = S11; S19 = S10; S18 = S09; \ - S17 = S08; S16 = S07; S15 = S06; S14 = S05; S13 = S04; S12 = S03; S11 = S02; S10 = S01; S09 = S00; \ - S08 = B35; S07 = B34; S06 = B33; S05 = B32; S04 = B31; S03 = B30; S02 = B29; S01 = B28; S00 = B27; \ -} - -#define SUB_ROR9_3 { \ - SUB_ROR3; SUB_ROR3; SUB_ROR3; \ -} - -#define SUB_ROR12 { /* to fix */ \ - B24 = S00; B25 = S01; B26 = S02; B27 = S03; B28 = S04; B29 = S05; B30 = S06; B31 = S07; B32 = S08; B33 = S09; B34 = S10; B35 = S11; \ - S00 = S12; S01 = S13; S02 = S14; S03 = S15; S04 = S16; S05 = S17; S06 = S18; S07 = S19; S08 = S20; S09 = S21; S10 = S22; S11 = S23; \ - S12 = S24; S13 = S25; S14 = S26; S15 = S27; S16 = S28; S17 = S29; S18 = S30; S19 = S31; S20 = S32; S21 = S33; S22 = S34; S23 = S35; \ - S24 = B24; S25 = B25; S26 = B26; S27 = B27; S28 = B28; S29 = B29; S30 = B30; S31 = B31; S32 = B32; S33 = B33; S34 = B34; S35 = B35; \ -} - -#define FUGUE512_3(x, y, z) { \ - TIX4(x, S00, S01, S04, S07, S08, S22, S24, S27, S30); \ - CMIX36(S33, S34, S35, S01, S02, S03, S15, S16, S17); \ - SMIX(S33, S34, S35, S00); \ - CMIX36(S30, S31, S32, S34, S35, S00, S12, S13, S14); \ - SMIX(S30, S31, S32, S33); \ - CMIX36(S27, S28, S29, S31, S32, S33, S09, S10, S11); \ - SMIX(S27, S28, S29, S30); \ - CMIX36(S24, S25, S26, S28, S29, S30, S06, S07, S08); \ - SMIX(S24, S25, S26, S27); \ - \ - TIX4(y, S24, S25, S28, S31, S32, S10, S12, S15, S18); \ - CMIX36(S21, S22, S23, S25, S26, S27, S03, S04, S05); \ - SMIX(S21, S22, S23, S24); \ - CMIX36(S18, S19, S20, S22, S23, S24, S00, S01, S02); \ - SMIX(S18, S19, S20, S21); \ - CMIX36(S15, S16, S17, S19, S20, S21, S33, S34, S35); \ - SMIX(S15, S16, S17, S18); \ - CMIX36(S12, S13, S14, S16, S17, S18, S30, S31, S32); \ - SMIX(S12, S13, S14, S15); \ - \ - TIX4(z, S12, S13, S16, S19, S20, S34, S00, S03, S06); \ - CMIX36(S09, S10, S11, S13, S14, S15, S27, S28, S29); \ - SMIX(S09, S10, S11, S12); \ - CMIX36(S06, S07, S08, S10, S11, S12, S24, S25, S26); \ - SMIX(S06, S07, S08, S09); \ - CMIX36(S03, S04, S05, S07, S08, S09, S21, S22, S23); \ - SMIX(S03, S04, S05, S06); \ - CMIX36(S00, S01, S02, S04, S05, S06, S18, S19, S20); \ - SMIX(S00, S01, S02, S03); \ -} - -#define FUGUE512_F(w, x, y, z) { \ - TIX4(w, S00, S01, S04, S07, S08, S22, S24, S27, S30); \ - CMIX36(S33, S34, S35, S01, S02, S03, S15, S16, S17); \ - SMIX(S33, S34, S35, S00); \ - CMIX36(S30, S31, S32, S34, S35, S00, S12, S13, S14); \ - SMIX(S30, S31, S32, S33); \ - CMIX36(S27, S28, S29, S31, S32, S33, S09, S10, S11); \ - SMIX(S27, S28, S29, S30); \ - CMIX36(S24, S25, S26, S28, S29, S30, S06, S07, S08); \ - SMIX(S24, S25, S26, S27); \ - \ - TIX4(x, S24, S25, S28, S31, S32, S10, S12, S15, S18); \ - CMIX36(S21, S22, S23, S25, S26, S27, S03, S04, S05); \ - SMIX(S21, S22, S23, S24); \ - CMIX36(S18, S19, S20, S22, S23, S24, S00, S01, S02); \ - SMIX(S18, S19, S20, S21); \ - CMIX36(S15, S16, S17, S19, S20, S21, S33, S34, S35); \ - SMIX(S15, S16, S17, S18); \ - CMIX36(S12, S13, S14, S16, S17, S18, S30, S31, S32); \ - SMIX(S12, S13, S14, S15); \ - \ - TIX4(y, S12, S13, S16, S19, S20, S34, S00, S03, S06); \ - CMIX36(S09, S10, S11, S13, S14, S15, S27, S28, S29); \ - SMIX(S09, S10, S11, S12); \ - CMIX36(S06, S07, S08, S10, S11, S12, S24, S25, S26); \ - SMIX(S06, S07, S08, S09); \ - CMIX36(S03, S04, S05, S07, S08, S09, S21, S22, S23); \ - SMIX(S03, S04, S05, S06); \ - CMIX36(S00, S01, S02, S04, S05, S06, S18, S19, S20); \ - SMIX(S00, S01, S02, S03); \ - \ - TIX4(z, S00, S01, S04, S07, S08, S22, S24, S27, S30); \ - CMIX36(S33, S34, S35, S01, S02, S03, S15, S16, S17); \ - SMIX(S33, S34, S35, S00); \ - CMIX36(S30, S31, S32, S34, S35, S00, S12, S13, S14); \ - SMIX(S30, S31, S32, S33); \ - CMIX36(S27, S28, S29, S31, S32, S33, S09, S10, S11); \ - SMIX(S27, S28, S29, S30); \ - CMIX36(S24, S25, S26, S28, S29, S30, S06, S07, S08); \ - SMIX(S24, S25, S26, S27); \ -} - -#undef ROL8 -#ifdef __CUDA_ARCH__ -__device__ __forceinline__ -uint32_t ROL8(const uint32_t a) { - return __byte_perm(a, 0, 0x2103); -} -__device__ __forceinline__ -uint32_t ROR8(const uint32_t a) { - return __byte_perm(a, 0, 0x0321); -} -__device__ __forceinline__ -uint32_t ROL16(const uint32_t a) { - return __byte_perm(a, 0, 0x1032); -} -#else -#define ROL8(u) ROTL32(u, 8) -#define ROR8(u) ROTR32(u, 8) -#define ROL16(u) ROTL32(u,16) -#endif - -//#define AS_UINT4(addr) *((uint4*)(addr)) - -__constant__ static uint64_t c_PaddedMessage80[10]; - -__host__ -void x16_fugue512_setBlock_80(void *pdata) -{ - cudaMemcpyToSymbol(c_PaddedMessage80, pdata, sizeof(c_PaddedMessage80), 0, cudaMemcpyHostToDevice); -} - -/***************************************************/ - -__global__ -__launch_bounds__(TPB) -void x16_fugue512_gpu_hash_80(const uint32_t threads, const uint32_t startNonce, uint64_t *g_hash) -{ - __shared__ uint32_t mixtabs[1024]; - - // load shared mem (with 256 threads) - const uint32_t thr = threadIdx.x & 0xFF; - const uint32_t tmp = tex1Dfetch(mixTab0Tex, thr); - mixtabs[thr] = tmp; - mixtabs[thr+256] = ROR8(tmp); - mixtabs[thr+512] = ROL16(tmp); - mixtabs[thr+768] = ROL8(tmp); -#if TPB <= 256 - if (blockDim.x < 256) { - const uint32_t thr = (threadIdx.x + 0x80) & 0xFF; - const uint32_t tmp = tex1Dfetch(mixTab0Tex, thr); - mixtabs[thr] = tmp; - mixtabs[thr + 256] = ROR8(tmp); - mixtabs[thr + 512] = ROL16(tmp); - mixtabs[thr + 768] = ROL8(tmp); - } -#endif - - __syncthreads(); - - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t Data[20]; - - #pragma unroll - for(int i = 0; i < 10; i++) - AS_UINT2(&Data[i * 2]) = AS_UINT2(&c_PaddedMessage80[i]); - Data[19] = (startNonce + thread); - - uint32_t S00, S01, S02, S03, S04, S05, S06, S07, S08, S09, S10, S11; - uint32_t S12, S13, S14, S15, S16, S17, S18, S19, S20, S21, S22, S23; - uint32_t S24, S25, S26, S27, S28, S29, S30, S31, S32, S33, S34, S35; - //uint32_t B24, B25, B26, - uint32_t B27, B28, B29, B30, B31, B32, B33, B34, B35; - //const uint64_t bc = 640 bits to hash - //const uint32_t bclo = (uint32_t)(bc); - //const uint32_t bchi = (uint32_t)(bc >> 32); - - S00 = S01 = S02 = S03 = S04 = S05 = S06 = S07 = S08 = S09 = 0; - S10 = S11 = S12 = S13 = S14 = S15 = S16 = S17 = S18 = S19 = 0; - S20 = 0x8807a57e; S21 = 0xe616af75; S22 = 0xc5d3e4db; S23 = 0xac9ab027; - S24 = 0xd915f117; S25 = 0xb6eecc54; S26 = 0x06e8020b; S27 = 0x4a92efd1; - S28 = 0xaac6e2c9; S29 = 0xddb21398; S30 = 0xcae65838; S31 = 0x437f203f; - S32 = 0x25ea78e7; S33 = 0x951fddd6; S34 = 0xda6ed11d; S35 = 0xe13e3567; - - FUGUE512_3((Data[ 0]), (Data[ 1]), (Data[ 2])); - FUGUE512_3((Data[ 3]), (Data[ 4]), (Data[ 5])); - FUGUE512_3((Data[ 6]), (Data[ 7]), (Data[ 8])); - FUGUE512_3((Data[ 9]), (Data[10]), (Data[11])); - FUGUE512_3((Data[12]), (Data[13]), (Data[14])); - FUGUE512_3((Data[15]), (Data[16]), (Data[17])); - FUGUE512_F((Data[18]), (Data[19]), 0/*bchi*/, (80*8)/*bclo*/); - - // rotate right state by 3 dwords (S00 = S33, S03 = S00) - SUB_ROR3; - SUB_ROR9; - - #pragma unroll 32 - for (int i = 0; i < 32; i++) { - SUB_ROR3; - CMIX36(S00, S01, S02, S04, S05, S06, S18, S19, S20); - SMIX(S00, S01, S02, S03); - } - #pragma unroll 13 - for (int i = 0; i < 13; i++) { - S04 ^= S00; - S09 ^= S00; - S18 ^= S00; - S27 ^= S00; - SUB_ROR9; - SMIX(S00, S01, S02, S03); - S04 ^= S00; - S10 ^= S00; - S18 ^= S00; - S27 ^= S00; - SUB_ROR9; - SMIX(S00, S01, S02, S03); - S04 ^= S00; - S10 ^= S00; - S19 ^= S00; - S27 ^= S00; - SUB_ROR9; - SMIX(S00, S01, S02, S03); - S04 ^= S00; - S10 ^= S00; - S19 ^= S00; - S28 ^= S00; - SUB_ROR8; - SMIX(S00, S01, S02, S03); - } - S04 ^= S00; - S09 ^= S00; - S18 ^= S00; - S27 ^= S00; - - Data[ 0] = cuda_swab32(S01); - Data[ 1] = cuda_swab32(S02); - Data[ 2] = cuda_swab32(S03); - Data[ 3] = cuda_swab32(S04); - Data[ 4] = cuda_swab32(S09); - Data[ 5] = cuda_swab32(S10); - Data[ 6] = cuda_swab32(S11); - Data[ 7] = cuda_swab32(S12); - Data[ 8] = cuda_swab32(S18); - Data[ 9] = cuda_swab32(S19); - Data[10] = cuda_swab32(S20); - Data[11] = cuda_swab32(S21); - Data[12] = cuda_swab32(S27); - Data[13] = cuda_swab32(S28); - Data[14] = cuda_swab32(S29); - Data[15] = cuda_swab32(S30); - - const size_t hashPosition = thread; - uint64_t* pHash = &g_hash[hashPosition << 3]; - #pragma unroll 4 - for(int i = 0; i < 4; i++) - AS_UINT4(&pHash[i * 2]) = AS_UINT4(&Data[i * 4]); - } -} - -#define texDef(id, texname, texmem, texsource, texsize) { \ - unsigned int *texmem; \ - cudaMalloc(&texmem, texsize); \ - d_textures[thr_id][id] = texmem; \ - cudaMemcpy(texmem, texsource, texsize, cudaMemcpyHostToDevice); \ - texname.normalized = 0; \ - texname.filterMode = cudaFilterModePoint; \ - texname.addressMode[0] = cudaAddressModeClamp; \ - { cudaChannelFormatDesc channelDesc = cudaCreateChannelDesc(); \ - cudaBindTexture(NULL, &texname, texmem, &channelDesc, texsize ); \ - } \ -} - -__host__ -void x16_fugue512_cpu_init(int thr_id, uint32_t threads) -{ - texDef(0, mixTab0Tex, mixTab0m, mixtab0, sizeof(uint32_t)*256); -} - -__host__ -void x16_fugue512_cpu_free(int thr_id) -{ - cudaFree(d_textures[thr_id][0]); -} - -__host__ -void x16_fugue512_cuda_hash_80(int thr_id, const uint32_t threads, const uint32_t startNonce, uint32_t *d_hash) -{ - const uint32_t threadsperblock = TPB; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - x16_fugue512_gpu_hash_80 <<>> (threads, startNonce, (uint64_t*)d_hash); -} diff --git a/x16/cuda_x16_shabal512.cu b/x16/cuda_x16_shabal512.cu deleted file mode 100644 index ca00b507..00000000 --- a/x16/cuda_x16_shabal512.cu +++ /dev/null @@ -1,350 +0,0 @@ -/* -* Shabal-512 for X16R -* tpruvot 2018, based on alexis x14 and xevan kernlx code -*/ - -#include -#include -#include - -typedef uint32_t sph_u32; - -#define C32(x) (x) -#define T32(x) (x) - -#define INPUT_BLOCK_ADD do { \ - B0 = T32(B0 + M0); \ - B1 = T32(B1 + M1); \ - B2 = T32(B2 + M2); \ - B3 = T32(B3 + M3); \ - B4 = T32(B4 + M4); \ - B5 = T32(B5 + M5); \ - B6 = T32(B6 + M6); \ - B7 = T32(B7 + M7); \ - B8 = T32(B8 + M8); \ - B9 = T32(B9 + M9); \ - BA = T32(BA + MA); \ - BB = T32(BB + MB); \ - BC = T32(BC + MC); \ - BD = T32(BD + MD); \ - BE = T32(BE + ME); \ - BF = T32(BF + MF); \ - } while (0) - -#define INPUT_BLOCK_SUB do { \ - C0 = T32(C0 - M0); \ - C1 = T32(C1 - M1); \ - C2 = T32(C2 - M2); \ - C3 = T32(C3 - M3); \ - C4 = T32(C4 - M4); \ - C5 = T32(C5 - M5); \ - C6 = T32(C6 - M6); \ - C7 = T32(C7 - M7); \ - C8 = T32(C8 - M8); \ - C9 = T32(C9 - M9); \ - CA = T32(CA - MA); \ - CB = T32(CB - MB); \ - CC = T32(CC - MC); \ - CD = T32(CD - MD); \ - CE = T32(CE - ME); \ - CF = T32(CF - MF); \ - } while (0) - -#define XOR_W do { \ - A00 ^= Wlow; \ - A01 ^= Whigh; \ - } while (0) - -#define SWAP(v1, v2) do { \ - sph_u32 tmp = (v1); \ - (v1) = (v2); \ - (v2) = tmp; \ - } while (0) - -#define SWAP_BC do { \ - SWAP(B0, C0); \ - SWAP(B1, C1); \ - SWAP(B2, C2); \ - SWAP(B3, C3); \ - SWAP(B4, C4); \ - SWAP(B5, C5); \ - SWAP(B6, C6); \ - SWAP(B7, C7); \ - SWAP(B8, C8); \ - SWAP(B9, C9); \ - SWAP(BA, CA); \ - SWAP(BB, CB); \ - SWAP(BC, CC); \ - SWAP(BD, CD); \ - SWAP(BE, CE); \ - SWAP(BF, CF); \ - } while (0) - -#define PERM_ELT(xa0, xa1, xb0, xb1, xb2, xb3, xc, xm) do { \ - xa0 = T32((xa0 \ - ^ (((xa1 << 15) | (xa1 >> 17)) * 5U) \ - ^ xc) * 3U) \ - ^ xb1 ^ (xb2 & ~xb3) ^ xm; \ - xb0 = T32(~(((xb0 << 1) | (xb0 >> 31)) ^ xa0)); \ - } while (0) - -#define PERM_STEP_0 do { \ - PERM_ELT(A00, A0B, B0, BD, B9, B6, C8, M0); \ - PERM_ELT(A01, A00, B1, BE, BA, B7, C7, M1); \ - PERM_ELT(A02, A01, B2, BF, BB, B8, C6, M2); \ - PERM_ELT(A03, A02, B3, B0, BC, B9, C5, M3); \ - PERM_ELT(A04, A03, B4, B1, BD, BA, C4, M4); \ - PERM_ELT(A05, A04, B5, B2, BE, BB, C3, M5); \ - PERM_ELT(A06, A05, B6, B3, BF, BC, C2, M6); \ - PERM_ELT(A07, A06, B7, B4, B0, BD, C1, M7); \ - PERM_ELT(A08, A07, B8, B5, B1, BE, C0, M8); \ - PERM_ELT(A09, A08, B9, B6, B2, BF, CF, M9); \ - PERM_ELT(A0A, A09, BA, B7, B3, B0, CE, MA); \ - PERM_ELT(A0B, A0A, BB, B8, B4, B1, CD, MB); \ - PERM_ELT(A00, A0B, BC, B9, B5, B2, CC, MC); \ - PERM_ELT(A01, A00, BD, BA, B6, B3, CB, MD); \ - PERM_ELT(A02, A01, BE, BB, B7, B4, CA, ME); \ - PERM_ELT(A03, A02, BF, BC, B8, B5, C9, MF); \ - } while (0) - -#define PERM_STEP_1 do { \ - PERM_ELT(A04, A03, B0, BD, B9, B6, C8, M0); \ - PERM_ELT(A05, A04, B1, BE, BA, B7, C7, M1); \ - PERM_ELT(A06, A05, B2, BF, BB, B8, C6, M2); \ - PERM_ELT(A07, A06, B3, B0, BC, B9, C5, M3); \ - PERM_ELT(A08, A07, B4, B1, BD, BA, C4, M4); \ - PERM_ELT(A09, A08, B5, B2, BE, BB, C3, M5); \ - PERM_ELT(A0A, A09, B6, B3, BF, BC, C2, M6); \ - PERM_ELT(A0B, A0A, B7, B4, B0, BD, C1, M7); \ - PERM_ELT(A00, A0B, B8, B5, B1, BE, C0, M8); \ - PERM_ELT(A01, A00, B9, B6, B2, BF, CF, M9); \ - PERM_ELT(A02, A01, BA, B7, B3, B0, CE, MA); \ - PERM_ELT(A03, A02, BB, B8, B4, B1, CD, MB); \ - PERM_ELT(A04, A03, BC, B9, B5, B2, CC, MC); \ - PERM_ELT(A05, A04, BD, BA, B6, B3, CB, MD); \ - PERM_ELT(A06, A05, BE, BB, B7, B4, CA, ME); \ - PERM_ELT(A07, A06, BF, BC, B8, B5, C9, MF); \ - } while (0) - -#define PERM_STEP_2 do { \ - PERM_ELT(A08, A07, B0, BD, B9, B6, C8, M0); \ - PERM_ELT(A09, A08, B1, BE, BA, B7, C7, M1); \ - PERM_ELT(A0A, A09, B2, BF, BB, B8, C6, M2); \ - PERM_ELT(A0B, A0A, B3, B0, BC, B9, C5, M3); \ - PERM_ELT(A00, A0B, B4, B1, BD, BA, C4, M4); \ - PERM_ELT(A01, A00, B5, B2, BE, BB, C3, M5); \ - PERM_ELT(A02, A01, B6, B3, BF, BC, C2, M6); \ - PERM_ELT(A03, A02, B7, B4, B0, BD, C1, M7); \ - PERM_ELT(A04, A03, B8, B5, B1, BE, C0, M8); \ - PERM_ELT(A05, A04, B9, B6, B2, BF, CF, M9); \ - PERM_ELT(A06, A05, BA, B7, B3, B0, CE, MA); \ - PERM_ELT(A07, A06, BB, B8, B4, B1, CD, MB); \ - PERM_ELT(A08, A07, BC, B9, B5, B2, CC, MC); \ - PERM_ELT(A09, A08, BD, BA, B6, B3, CB, MD); \ - PERM_ELT(A0A, A09, BE, BB, B7, B4, CA, ME); \ - PERM_ELT(A0B, A0A, BF, BC, B8, B5, C9, MF); \ - } while (0) - -#define APPLY_P do { \ - B0 = T32(B0 << 17) | (B0 >> 15); \ - B1 = T32(B1 << 17) | (B1 >> 15); \ - B2 = T32(B2 << 17) | (B2 >> 15); \ - B3 = T32(B3 << 17) | (B3 >> 15); \ - B4 = T32(B4 << 17) | (B4 >> 15); \ - B5 = T32(B5 << 17) | (B5 >> 15); \ - B6 = T32(B6 << 17) | (B6 >> 15); \ - B7 = T32(B7 << 17) | (B7 >> 15); \ - B8 = T32(B8 << 17) | (B8 >> 15); \ - B9 = T32(B9 << 17) | (B9 >> 15); \ - BA = T32(BA << 17) | (BA >> 15); \ - BB = T32(BB << 17) | (BB >> 15); \ - BC = T32(BC << 17) | (BC >> 15); \ - BD = T32(BD << 17) | (BD >> 15); \ - BE = T32(BE << 17) | (BE >> 15); \ - BF = T32(BF << 17) | (BF >> 15); \ - PERM_STEP_0; \ - PERM_STEP_1; \ - PERM_STEP_2; \ - A0B = T32(A0B + C6); \ - A0A = T32(A0A + C5); \ - A09 = T32(A09 + C4); \ - A08 = T32(A08 + C3); \ - A07 = T32(A07 + C2); \ - A06 = T32(A06 + C1); \ - A05 = T32(A05 + C0); \ - A04 = T32(A04 + CF); \ - A03 = T32(A03 + CE); \ - A02 = T32(A02 + CD); \ - A01 = T32(A01 + CC); \ - A00 = T32(A00 + CB); \ - A0B = T32(A0B + CA); \ - A0A = T32(A0A + C9); \ - A09 = T32(A09 + C8); \ - A08 = T32(A08 + C7); \ - A07 = T32(A07 + C6); \ - A06 = T32(A06 + C5); \ - A05 = T32(A05 + C4); \ - A04 = T32(A04 + C3); \ - A03 = T32(A03 + C2); \ - A02 = T32(A02 + C1); \ - A01 = T32(A01 + C0); \ - A00 = T32(A00 + CF); \ - A0B = T32(A0B + CE); \ - A0A = T32(A0A + CD); \ - A09 = T32(A09 + CC); \ - A08 = T32(A08 + CB); \ - A07 = T32(A07 + CA); \ - A06 = T32(A06 + C9); \ - A05 = T32(A05 + C8); \ - A04 = T32(A04 + C7); \ - A03 = T32(A03 + C6); \ - A02 = T32(A02 + C5); \ - A01 = T32(A01 + C4); \ - A00 = T32(A00 + C3); \ - } while (0) - -#define INCR_W do { \ - if ((Wlow = T32(Wlow + 1)) == 0) \ - Whigh = T32(Whigh + 1); \ - } while (0) - -__constant__ static const sph_u32 A_init_512[] = { - C32(0x20728DFD), C32(0x46C0BD53), C32(0xE782B699), C32(0x55304632), - C32(0x71B4EF90), C32(0x0EA9E82C), C32(0xDBB930F1), C32(0xFAD06B8B), - C32(0xBE0CAE40), C32(0x8BD14410), C32(0x76D2ADAC), C32(0x28ACAB7F) -}; - -__constant__ static const sph_u32 B_init_512[] = { - C32(0xC1099CB7), C32(0x07B385F3), C32(0xE7442C26), C32(0xCC8AD640), - C32(0xEB6F56C7), C32(0x1EA81AA9), C32(0x73B9D314), C32(0x1DE85D08), - C32(0x48910A5A), C32(0x893B22DB), C32(0xC5A0DF44), C32(0xBBC4324E), - C32(0x72D2F240), C32(0x75941D99), C32(0x6D8BDE82), C32(0xA1A7502B) -}; - -__constant__ static const sph_u32 C_init_512[] = { - C32(0xD9BF68D1), C32(0x58BAD750), C32(0x56028CB2), C32(0x8134F359), - C32(0xB5D469D8), C32(0x941A8CC2), C32(0x418B2A6E), C32(0x04052780), - C32(0x7F07D787), C32(0x5194358F), C32(0x3C60D665), C32(0xBE97D79A), - C32(0x950C3434), C32(0xAED9A06D), C32(0x2537DC8D), C32(0x7CDB5969) -}; - -__constant__ static uint32_t c_PaddedMessage80[20]; - -__host__ -void x16_shabal512_setBlock_80(void *pdata) -{ - cudaMemcpyToSymbol(c_PaddedMessage80, pdata, sizeof(c_PaddedMessage80), 0, cudaMemcpyHostToDevice); -} - -#define TPB_SHABAL 256 - -__global__ __launch_bounds__(TPB_SHABAL, 2) -void x16_shabal512_gpu_hash_80(uint32_t threads, const uint32_t startNonce, uint32_t *g_hash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - - uint32_t B[] = { - 0xC1099CB7, 0x07B385F3, 0xE7442C26, 0xCC8AD640, 0xEB6F56C7, 0x1EA81AA9, 0x73B9D314, 0x1DE85D08, - 0x48910A5A, 0x893B22DB, 0xC5A0DF44, 0xBBC4324E, 0x72D2F240, 0x75941D99, 0x6D8BDE82, 0xA1A7502B - }; - uint32_t M[16]; - - if (thread < threads) - { - // todo: try __ldc - *(uint2x4*)&M[0] = *(uint2x4*)&c_PaddedMessage80[0]; - *(uint2x4*)&M[8] = *(uint2x4*)&c_PaddedMessage80[8]; - - sph_u32 A00 = A_init_512[0], A01 = A_init_512[1], A02 = A_init_512[ 2], A03 = A_init_512[ 3]; - sph_u32 A04 = A_init_512[4], A05 = A_init_512[5], A06 = A_init_512[ 6], A07 = A_init_512[ 7]; - sph_u32 A08 = A_init_512[8], A09 = A_init_512[9], A0A = A_init_512[10], A0B = A_init_512[11]; - - sph_u32 B0 = B_init_512[ 0], B1 = B_init_512[ 1], B2 = B_init_512[ 2], B3 = B_init_512 [3]; - sph_u32 B4 = B_init_512[ 4], B5 = B_init_512[ 5], B6 = B_init_512[ 6], B7 = B_init_512[ 7]; - sph_u32 B8 = B_init_512[ 8], B9 = B_init_512[ 9], BA = B_init_512[10], BB = B_init_512[11]; - sph_u32 BC = B_init_512[12], BD = B_init_512[13], BE = B_init_512[14], BF = B_init_512[15]; - - sph_u32 C0 = C_init_512[ 0], C1 = C_init_512[ 1], C2 = C_init_512[ 2], C3 = C_init_512[ 3]; - sph_u32 C4 = C_init_512[ 4], C5 = C_init_512[ 5], C6 = C_init_512[ 6], C7 = C_init_512[ 7]; - sph_u32 C8 = C_init_512[ 8], C9 = C_init_512[ 9], CA = C_init_512[10], CB = C_init_512[11]; - sph_u32 CC = C_init_512[12], CD = C_init_512[13], CE = C_init_512[14], CF = C_init_512[15]; - - sph_u32 M0, M1, M2, M3, M4, M5, M6, M7, M8, M9, MA, MB, MC, MD, ME, MF; - sph_u32 Wlow = 1, Whigh = 0; - - M0 = M[ 0]; - M1 = M[ 1]; - M2 = M[ 2]; - M3 = M[ 3]; - M4 = M[ 4]; - M5 = M[ 5]; - M6 = M[ 6]; - M7 = M[ 7]; - M8 = M[ 8]; - M9 = M[ 9]; - MA = M[10]; - MB = M[11]; - MC = M[12]; - MD = M[13]; - ME = M[14]; - MF = M[15]; - - INPUT_BLOCK_ADD; - XOR_W; - APPLY_P; - INPUT_BLOCK_SUB; - SWAP_BC; - INCR_W; - - M0 = c_PaddedMessage80[16]; - M1 = c_PaddedMessage80[17]; - M2 = c_PaddedMessage80[18]; - M3 = cuda_swab32(startNonce + thread); - M4 = 0x80; - M5 = M6 = M7 = M8 = M9 = MA = MB = MC = MD = ME = MF = 0; - - INPUT_BLOCK_ADD; - XOR_W; - APPLY_P; - - for (unsigned i = 0; i < 3; i++) { - SWAP_BC; - XOR_W; - APPLY_P; - } - - B[ 0] = B0; - B[ 1] = B1; - B[ 2] = B2; - B[ 3] = B3; - B[ 4] = B4; - B[ 5] = B5; - B[ 6] = B6; - B[ 7] = B7; - B[ 8] = B8; - B[ 9] = B9; - B[10] = BA; - B[11] = BB; - B[12] = BC; - B[13] = BD; - B[14] = BE; - B[15] = BF; - - // output - uint64_t hashPosition = thread; - uint32_t *Hash = &g_hash[hashPosition << 4]; - *(uint2x4*)&Hash[0] = *(uint2x4*)&B[0]; - *(uint2x4*)&Hash[8] = *(uint2x4*)&B[8]; - } -} - -__host__ -void x16_shabal512_cuda_hash_80(int thr_id, const uint32_t threads, const uint32_t startNonce, uint32_t *d_hash) -{ - const uint32_t threadsperblock = TPB_SHABAL; - - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - - x16_shabal512_gpu_hash_80 <<>>(threads, startNonce, d_hash); -} diff --git a/x16/cuda_x16_simd512_80.cu b/x16/cuda_x16_simd512_80.cu deleted file mode 100644 index 142180a3..00000000 --- a/x16/cuda_x16_simd512_80.cu +++ /dev/null @@ -1,1836 +0,0 @@ -/** - * SIMD512 CUDA IMPLEMENTATION based on sph simd code - * tpruvot 2018 (with the help of kernelx xevan code) - */ - -#include -#include -#include - -#ifdef __INTELLISENSE__ -/* just for vstudio code colors */ -#define __CUDA_ARCH__ 500 -#define __byte_perm(x, y, m) (x|y) -#endif - -#define TPB50_1 128 -#define TPB50_2 128 -#define TPB52_1 128 -#define TPB52_2 128 - -#define sph_u32 uint32_t -#define sph_s32 int32_t -typedef uint32_t u32; -typedef int32_t s32; - -#define C32 SPH_C32 -#define T32 SPH_T32 -#define ROL32 ROTL32 -#define XCAT(x, y) XCAT_(x, y) -#define XCAT_(x, y) x ## y - -/* - * The powers of 41 modulo 257. We use exponents from 0 to 255, inclusive. - */ -__constant__ static const s32 alpha_tab[] = { - 1, 41, 139, 45, 46, 87, 226, 14, 60, 147, 116, 130, 190, 80, 196, 69, - 2, 82, 21, 90, 92, 174, 195, 28, 120, 37, 232, 3, 123, 160, 135, 138, - 4, 164, 42, 180, 184, 91, 133, 56, 240, 74, 207, 6, 246, 63, 13, 19, - 8, 71, 84, 103, 111, 182, 9, 112, 223, 148, 157, 12, 235, 126, 26, 38, - 16, 142, 168, 206, 222, 107, 18, 224, 189, 39, 57, 24, 213, 252, 52, 76, - 32, 27, 79, 155, 187, 214, 36, 191, 121, 78, 114, 48, 169, 247, 104, 152, - 64, 54, 158, 53, 117, 171, 72, 125, 242, 156, 228, 96, 81, 237, 208, 47, - 128, 108, 59, 106, 234, 85, 144, 250, 227, 55, 199, 192, 162, 217, 159, 94, - 256, 216, 118, 212, 211, 170, 31, 243, 197, 110, 141, 127, 67, 177, 61, 188, - 255, 175, 236, 167, 165, 83, 62, 229, 137, 220, 25, 254, 134, 97, 122, 119, - 253, 93, 215, 77, 73, 166, 124, 201, 17, 183, 50, 251, 11, 194, 244, 238, - 249, 186, 173, 154, 146, 75, 248, 145, 34, 109, 100, 245, 22, 131, 231, 219, - 241, 115, 89, 51, 35, 150, 239, 33, 68, 218, 200, 233, 44, 5, 205, 181, - 225, 230, 178, 102, 70, 43, 221, 66, 136, 179, 143, 209, 88, 10, 153, 105, - 193, 203, 99, 204, 140, 86, 185, 132, 15, 101, 29, 161, 176, 20, 49, 210, - 129, 149, 198, 151, 23, 172, 113, 7, 30, 202, 58, 65, 95, 40, 98, 163 -}; - -/* - * Ranges: - * REDS1: from -32768..98302 to -383..383 - * REDS2: from -2^31..2^31-1 to -32768..98302 - */ -#define REDS1(x) (((x) & 0x00FF) - ((x) >> 8)) -#define REDS2(x) (((x) & 0xFFFF) + ((x) >> 16)) - -/* - * If, upon entry, the values of q[] are all in the -N..N range (where - * N >= 98302) then the new values of q[] are in the -2N..2N range. - * - * Since alpha_tab[v] <= 256, maximum allowed range is for N = 8388608. - */ -#define FFT_LOOP_16_8(rb) do { \ - s32 m = q[(rb)]; \ - s32 n = q[(rb) + 16]; \ - q[(rb)] = m + n; \ - q[(rb) + 16] = m - n; \ - s32 t; \ - m = q[(rb) + 0 + 1]; \ - n = q[(rb) + 0 + 1 + 16]; \ - t = REDS2(n * alpha_tab[0 + 1 * 8]); \ - q[(rb) + 0 + 1] = m + t; \ - q[(rb) + 0 + 1 + 16] = m - t; \ - m = q[(rb) + 0 + 2]; \ - n = q[(rb) + 0 + 2 + 16]; \ - t = REDS2(n * alpha_tab[0 + 2 * 8]); \ - q[(rb) + 0 + 2] = m + t; \ - q[(rb) + 0 + 2 + 16] = m - t; \ - m = q[(rb) + 0 + 3]; \ - n = q[(rb) + 0 + 3 + 16]; \ - t = REDS2(n * alpha_tab[0 + 3 * 8]); \ - q[(rb) + 0 + 3] = m + t; \ - q[(rb) + 0 + 3 + 16] = m - t; \ - \ - m = q[(rb) + 4 + 0]; \ - n = q[(rb) + 4 + 0 + 16]; \ - t = REDS2(n * alpha_tab[32 + 0 * 8]); \ - q[(rb) + 4 + 0] = m + t; \ - q[(rb) + 4 + 0 + 16] = m - t; \ - m = q[(rb) + 4 + 1]; \ - n = q[(rb) + 4 + 1 + 16]; \ - t = REDS2(n * alpha_tab[32 + 1 * 8]); \ - q[(rb) + 4 + 1] = m + t; \ - q[(rb) + 4 + 1 + 16] = m - t; \ - m = q[(rb) + 4 + 2]; \ - n = q[(rb) + 4 + 2 + 16]; \ - t = REDS2(n * alpha_tab[32 + 2 * 8]); \ - q[(rb) + 4 + 2] = m + t; \ - q[(rb) + 4 + 2 + 16] = m - t; \ - m = q[(rb) + 4 + 3]; \ - n = q[(rb) + 4 + 3 + 16]; \ - t = REDS2(n * alpha_tab[32 + 3 * 8]); \ - q[(rb) + 4 + 3] = m + t; \ - q[(rb) + 4 + 3 + 16] = m - t; \ - \ - m = q[(rb) + 8 + 0]; \ - n = q[(rb) + 8 + 0 + 16]; \ - t = REDS2(n * alpha_tab[64 + 0 * 8]); \ - q[(rb) + 8 + 0] = m + t; \ - q[(rb) + 8 + 0 + 16] = m - t; \ - m = q[(rb) + 8 + 1]; \ - n = q[(rb) + 8 + 1 + 16]; \ - t = REDS2(n * alpha_tab[64 + 1 * 8]); \ - q[(rb) + 8 + 1] = m + t; \ - q[(rb) + 8 + 1 + 16] = m - t; \ - m = q[(rb) + 8 + 2]; \ - n = q[(rb) + 8 + 2 + 16]; \ - t = REDS2(n * alpha_tab[64 + 2 * 8]); \ - q[(rb) + 8 + 2] = m + t; \ - q[(rb) + 8 + 2 + 16] = m - t; \ - m = q[(rb) + 8 + 3]; \ - n = q[(rb) + 8 + 3 + 16]; \ - t = REDS2(n * alpha_tab[64 + 3 * 8]); \ - q[(rb) + 8 + 3] = m + t; \ - q[(rb) + 8 + 3 + 16] = m - t; \ - \ - m = q[(rb) + 12 + 0]; \ - n = q[(rb) + 12 + 0 + 16]; \ - t = REDS2(n * alpha_tab[96 + 0 * 8]); \ - q[(rb) + 12 + 0] = m + t; \ - q[(rb) + 12 + 0 + 16] = m - t; \ - m = q[(rb) + 12 + 1]; \ - n = q[(rb) + 12 + 1 + 16]; \ - t = REDS2(n * alpha_tab[96 + 1 * 8]); \ - q[(rb) + 12 + 1] = m + t; \ - q[(rb) + 12 + 1 + 16] = m - t; \ - m = q[(rb) + 12 + 2]; \ - n = q[(rb) + 12 + 2 + 16]; \ - t = REDS2(n * alpha_tab[96 + 2 * 8]); \ - q[(rb) + 12 + 2] = m + t; \ - q[(rb) + 12 + 2 + 16] = m - t; \ - m = q[(rb) + 12 + 3]; \ - n = q[(rb) + 12 + 3 + 16]; \ - t = REDS2(n * alpha_tab[96 + 3 * 8]); \ - q[(rb) + 12 + 3] = m + t; \ - q[(rb) + 12 + 3 + 16] = m - t; \ - } while (0) - -#define FFT_LOOP_32_4(rb) do { \ - s32 m = q[(rb)]; \ - s32 n = q[(rb) + 32]; \ - q[(rb)] = m + n; \ - q[(rb) + 32] = m - n; \ - s32 t; \ - m = q[(rb) + 0 + 1]; \ - n = q[(rb) + 0 + 1 + 32]; \ - t = REDS2(n * alpha_tab[0 + 1 * 4]); \ - q[(rb) + 0 + 1] = m + t; \ - q[(rb) + 0 + 1 + 32] = m - t; \ - m = q[(rb) + 0 + 2]; \ - n = q[(rb) + 0 + 2 + 32]; \ - t = REDS2(n * alpha_tab[0 + 2 * 4]); \ - q[(rb) + 0 + 2] = m + t; \ - q[(rb) + 0 + 2 + 32] = m - t; \ - m = q[(rb) + 0 + 3]; \ - n = q[(rb) + 0 + 3 + 32]; \ - t = REDS2(n * alpha_tab[0 + 3 * 4]); \ - q[(rb) + 0 + 3] = m + t; \ - q[(rb) + 0 + 3 + 32] = m - t; \ - \ - m = q[(rb) + 4 + 0]; \ - n = q[(rb) + 4 + 0 + 32]; \ - t = REDS2(n * alpha_tab[16 + 0 * 4]); \ - q[(rb) + 4 + 0] = m + t; \ - q[(rb) + 4 + 0 + 32] = m - t; \ - m = q[(rb) + 4 + 1]; \ - n = q[(rb) + 4 + 1 + 32]; \ - t = REDS2(n * alpha_tab[16 + 1 * 4]); \ - q[(rb) + 4 + 1] = m + t; \ - q[(rb) + 4 + 1 + 32] = m - t; \ - m = q[(rb) + 4 + 2]; \ - n = q[(rb) + 4 + 2 + 32]; \ - t = REDS2(n * alpha_tab[16 + 2 * 4]); \ - q[(rb) + 4 + 2] = m + t; \ - q[(rb) + 4 + 2 + 32] = m - t; \ - m = q[(rb) + 4 + 3]; \ - n = q[(rb) + 4 + 3 + 32]; \ - t = REDS2(n * alpha_tab[16 + 3 * 4]); \ - q[(rb) + 4 + 3] = m + t; \ - q[(rb) + 4 + 3 + 32] = m - t; \ - \ - m = q[(rb) + 8 + 0]; \ - n = q[(rb) + 8 + 0 + 32]; \ - t = REDS2(n * alpha_tab[32 + 0 * 4]); \ - q[(rb) + 8 + 0] = m + t; \ - q[(rb) + 8 + 0 + 32] = m - t; \ - m = q[(rb) + 8 + 1]; \ - n = q[(rb) + 8 + 1 + 32]; \ - t = REDS2(n * alpha_tab[32 + 1 * 4]); \ - q[(rb) + 8 + 1] = m + t; \ - q[(rb) + 8 + 1 + 32] = m - t; \ - m = q[(rb) + 8 + 2]; \ - n = q[(rb) + 8 + 2 + 32]; \ - t = REDS2(n * alpha_tab[32 + 2 * 4]); \ - q[(rb) + 8 + 2] = m + t; \ - q[(rb) + 8 + 2 + 32] = m - t; \ - m = q[(rb) + 8 + 3]; \ - n = q[(rb) + 8 + 3 + 32]; \ - t = REDS2(n * alpha_tab[32 + 3 * 4]); \ - q[(rb) + 8 + 3] = m + t; \ - q[(rb) + 8 + 3 + 32] = m - t; \ - \ - m = q[(rb) + 12 + 0]; \ - n = q[(rb) + 12 + 0 + 32]; \ - t = REDS2(n * alpha_tab[48 + 0 * 4]); \ - q[(rb) + 12 + 0] = m + t; \ - q[(rb) + 12 + 0 + 32] = m - t; \ - m = q[(rb) + 12 + 1]; \ - n = q[(rb) + 12 + 1 + 32]; \ - t = REDS2(n * alpha_tab[48 + 1 * 4]); \ - q[(rb) + 12 + 1] = m + t; \ - q[(rb) + 12 + 1 + 32] = m - t; \ - m = q[(rb) + 12 + 2]; \ - n = q[(rb) + 12 + 2 + 32]; \ - t = REDS2(n * alpha_tab[48 + 2 * 4]); \ - q[(rb) + 12 + 2] = m + t; \ - q[(rb) + 12 + 2 + 32] = m - t; \ - m = q[(rb) + 12 + 3]; \ - n = q[(rb) + 12 + 3 + 32]; \ - t = REDS2(n * alpha_tab[48 + 3 * 4]); \ - q[(rb) + 12 + 3] = m + t; \ - q[(rb) + 12 + 3 + 32] = m - t; \ - \ - m = q[(rb) + 16 + 0]; \ - n = q[(rb) + 16 + 0 + 32]; \ - t = REDS2(n * alpha_tab[64 + 0 * 4]); \ - q[(rb) + 16 + 0] = m + t; \ - q[(rb) + 16 + 0 + 32] = m - t; \ - m = q[(rb) + 16 + 1]; \ - n = q[(rb) + 16 + 1 + 32]; \ - t = REDS2(n * alpha_tab[64 + 1 * 4]); \ - q[(rb) + 16 + 1] = m + t; \ - q[(rb) + 16 + 1 + 32] = m - t; \ - m = q[(rb) + 16 + 2]; \ - n = q[(rb) + 16 + 2 + 32]; \ - t = REDS2(n * alpha_tab[64 + 2 * 4]); \ - q[(rb) + 16 + 2] = m + t; \ - q[(rb) + 16 + 2 + 32] = m - t; \ - m = q[(rb) + 16 + 3]; \ - n = q[(rb) + 16 + 3 + 32]; \ - t = REDS2(n * alpha_tab[64 + 3 * 4]); \ - q[(rb) + 16 + 3] = m + t; \ - q[(rb) + 16 + 3 + 32] = m - t; \ - \ - m = q[(rb) + 20 + 0]; \ - n = q[(rb) + 20 + 0 + 32]; \ - t = REDS2(n * alpha_tab[80 + 0 * 4]); \ - q[(rb) + 20 + 0] = m + t; \ - q[(rb) + 20 + 0 + 32] = m - t; \ - m = q[(rb) + 20 + 1]; \ - n = q[(rb) + 20 + 1 + 32]; \ - t = REDS2(n * alpha_tab[80 + 1 * 4]); \ - q[(rb) + 20 + 1] = m + t; \ - q[(rb) + 20 + 1 + 32] = m - t; \ - m = q[(rb) + 20 + 2]; \ - n = q[(rb) + 20 + 2 + 32]; \ - t = REDS2(n * alpha_tab[80 + 2 * 4]); \ - q[(rb) + 20 + 2] = m + t; \ - q[(rb) + 20 + 2 + 32] = m - t; \ - m = q[(rb) + 20 + 3]; \ - n = q[(rb) + 20 + 3 + 32]; \ - t = REDS2(n * alpha_tab[80 + 3 * 4]); \ - q[(rb) + 20 + 3] = m + t; \ - q[(rb) + 20 + 3 + 32] = m - t; \ - \ - m = q[(rb) + 24 + 0]; \ - n = q[(rb) + 24 + 0 + 32]; \ - t = REDS2(n * alpha_tab[96 + 0 * 4]); \ - q[(rb) + 24 + 0] = m + t; \ - q[(rb) + 24 + 0 + 32] = m - t; \ - m = q[(rb) + 24 + 1]; \ - n = q[(rb) + 24 + 1 + 32]; \ - t = REDS2(n * alpha_tab[96 + 1 * 4]); \ - q[(rb) + 24 + 1] = m + t; \ - q[(rb) + 24 + 1 + 32] = m - t; \ - m = q[(rb) + 24 + 2]; \ - n = q[(rb) + 24 + 2 + 32]; \ - t = REDS2(n * alpha_tab[96 + 2 * 4]); \ - q[(rb) + 24 + 2] = m + t; \ - q[(rb) + 24 + 2 + 32] = m - t; \ - m = q[(rb) + 24 + 3]; \ - n = q[(rb) + 24 + 3 + 32]; \ - t = REDS2(n * alpha_tab[96 + 3 * 4]); \ - q[(rb) + 24 + 3] = m + t; \ - q[(rb) + 24 + 3 + 32] = m - t; \ - \ - m = q[(rb) + 28 + 0]; \ - n = q[(rb) + 28 + 0 + 32]; \ - t = REDS2(n * alpha_tab[112 + 0 * 4]); \ - q[(rb) + 28 + 0] = m + t; \ - q[(rb) + 28 + 0 + 32] = m - t; \ - m = q[(rb) + 28 + 1]; \ - n = q[(rb) + 28 + 1 + 32]; \ - t = REDS2(n * alpha_tab[112 + 1 * 4]); \ - q[(rb) + 28 + 1] = m + t; \ - q[(rb) + 28 + 1 + 32] = m - t; \ - m = q[(rb) + 28 + 2]; \ - n = q[(rb) + 28 + 2 + 32]; \ - t = REDS2(n * alpha_tab[112 + 2 * 4]); \ - q[(rb) + 28 + 2] = m + t; \ - q[(rb) + 28 + 2 + 32] = m - t; \ - m = q[(rb) + 28 + 3]; \ - n = q[(rb) + 28 + 3 + 32]; \ - t = REDS2(n * alpha_tab[112 + 3 * 4]); \ - q[(rb) + 28 + 3] = m + t; \ - q[(rb) + 28 + 3 + 32] = m - t; \ - } while (0) - -#define FFT_LOOP_64_2(rb) do { \ - s32 m = q[(rb)]; \ - s32 n = q[(rb) + 64]; \ - q[(rb)] = m + n; \ - q[(rb) + 64] = m - n; \ - s32 t; \ - m = q[(rb) + 0 + 1]; \ - n = q[(rb) + 0 + 1 + 64]; \ - t = REDS2(n * alpha_tab[0 + 1 * 2]); \ - q[(rb) + 0 + 1] = m + t; \ - q[(rb) + 0 + 1 + 64] = m - t; \ - m = q[(rb) + 0 + 2]; \ - n = q[(rb) + 0 + 2 + 64]; \ - t = REDS2(n * alpha_tab[0 + 2 * 2]); \ - q[(rb) + 0 + 2] = m + t; \ - q[(rb) + 0 + 2 + 64] = m - t; \ - m = q[(rb) + 0 + 3]; \ - n = q[(rb) + 0 + 3 + 64]; \ - t = REDS2(n * alpha_tab[0 + 3 * 2]); \ - q[(rb) + 0 + 3] = m + t; \ - q[(rb) + 0 + 3 + 64] = m - t; \ - \ - m = q[(rb) + 4 + 0]; \ - n = q[(rb) + 4 + 0 + 64]; \ - t = REDS2(n * alpha_tab[8 + 0 * 2]); \ - q[(rb) + 4 + 0] = m + t; \ - q[(rb) + 4 + 0 + 64] = m - t; \ - m = q[(rb) + 4 + 1]; \ - n = q[(rb) + 4 + 1 + 64]; \ - t = REDS2(n * alpha_tab[8 + 1 * 2]); \ - q[(rb) + 4 + 1] = m + t; \ - q[(rb) + 4 + 1 + 64] = m - t; \ - m = q[(rb) + 4 + 2]; \ - n = q[(rb) + 4 + 2 + 64]; \ - t = REDS2(n * alpha_tab[8 + 2 * 2]); \ - q[(rb) + 4 + 2] = m + t; \ - q[(rb) + 4 + 2 + 64] = m - t; \ - m = q[(rb) + 4 + 3]; \ - n = q[(rb) + 4 + 3 + 64]; \ - t = REDS2(n * alpha_tab[8 + 3 * 2]); \ - q[(rb) + 4 + 3] = m + t; \ - q[(rb) + 4 + 3 + 64] = m - t; \ - \ - m = q[(rb) + 8 + 0]; \ - n = q[(rb) + 8 + 0 + 64]; \ - t = REDS2(n * alpha_tab[16 + 0 * 2]); \ - q[(rb) + 8 + 0] = m + t; \ - q[(rb) + 8 + 0 + 64] = m - t; \ - m = q[(rb) + 8 + 1]; \ - n = q[(rb) + 8 + 1 + 64]; \ - t = REDS2(n * alpha_tab[16 + 1 * 2]); \ - q[(rb) + 8 + 1] = m + t; \ - q[(rb) + 8 + 1 + 64] = m - t; \ - m = q[(rb) + 8 + 2]; \ - n = q[(rb) + 8 + 2 + 64]; \ - t = REDS2(n * alpha_tab[16 + 2 * 2]); \ - q[(rb) + 8 + 2] = m + t; \ - q[(rb) + 8 + 2 + 64] = m - t; \ - m = q[(rb) + 8 + 3]; \ - n = q[(rb) + 8 + 3 + 64]; \ - t = REDS2(n * alpha_tab[16 + 3 * 2]); \ - q[(rb) + 8 + 3] = m + t; \ - q[(rb) + 8 + 3 + 64] = m - t; \ - \ - m = q[(rb) + 12 + 0]; \ - n = q[(rb) + 12 + 0 + 64]; \ - t = REDS2(n * alpha_tab[24 + 0 * 2]); \ - q[(rb) + 12 + 0] = m + t; \ - q[(rb) + 12 + 0 + 64] = m - t; \ - m = q[(rb) + 12 + 1]; \ - n = q[(rb) + 12 + 1 + 64]; \ - t = REDS2(n * alpha_tab[24 + 1 * 2]); \ - q[(rb) + 12 + 1] = m + t; \ - q[(rb) + 12 + 1 + 64] = m - t; \ - m = q[(rb) + 12 + 2]; \ - n = q[(rb) + 12 + 2 + 64]; \ - t = REDS2(n * alpha_tab[24 + 2 * 2]); \ - q[(rb) + 12 + 2] = m + t; \ - q[(rb) + 12 + 2 + 64] = m - t; \ - m = q[(rb) + 12 + 3]; \ - n = q[(rb) + 12 + 3 + 64]; \ - t = REDS2(n * alpha_tab[24 + 3 * 2]); \ - q[(rb) + 12 + 3] = m + t; \ - q[(rb) + 12 + 3 + 64] = m - t; \ - \ - m = q[(rb) + 16 + 0]; \ - n = q[(rb) + 16 + 0 + 64]; \ - t = REDS2(n * alpha_tab[32 + 0 * 2]); \ - q[(rb) + 16 + 0] = m + t; \ - q[(rb) + 16 + 0 + 64] = m - t; \ - m = q[(rb) + 16 + 1]; \ - n = q[(rb) + 16 + 1 + 64]; \ - t = REDS2(n * alpha_tab[32 + 1 * 2]); \ - q[(rb) + 16 + 1] = m + t; \ - q[(rb) + 16 + 1 + 64] = m - t; \ - m = q[(rb) + 16 + 2]; \ - n = q[(rb) + 16 + 2 + 64]; \ - t = REDS2(n * alpha_tab[32 + 2 * 2]); \ - q[(rb) + 16 + 2] = m + t; \ - q[(rb) + 16 + 2 + 64] = m - t; \ - m = q[(rb) + 16 + 3]; \ - n = q[(rb) + 16 + 3 + 64]; \ - t = REDS2(n * alpha_tab[32 + 3 * 2]); \ - q[(rb) + 16 + 3] = m + t; \ - q[(rb) + 16 + 3 + 64] = m - t; \ - \ - m = q[(rb) + 20 + 0]; \ - n = q[(rb) + 20 + 0 + 64]; \ - t = REDS2(n * alpha_tab[40 + 0 * 2]); \ - q[(rb) + 20 + 0] = m + t; \ - q[(rb) + 20 + 0 + 64] = m - t; \ - m = q[(rb) + 20 + 1]; \ - n = q[(rb) + 20 + 1 + 64]; \ - t = REDS2(n * alpha_tab[40 + 1 * 2]); \ - q[(rb) + 20 + 1] = m + t; \ - q[(rb) + 20 + 1 + 64] = m - t; \ - m = q[(rb) + 20 + 2]; \ - n = q[(rb) + 20 + 2 + 64]; \ - t = REDS2(n * alpha_tab[40 + 2 * 2]); \ - q[(rb) + 20 + 2] = m + t; \ - q[(rb) + 20 + 2 + 64] = m - t; \ - m = q[(rb) + 20 + 3]; \ - n = q[(rb) + 20 + 3 + 64]; \ - t = REDS2(n * alpha_tab[40 + 3 * 2]); \ - q[(rb) + 20 + 3] = m + t; \ - q[(rb) + 20 + 3 + 64] = m - t; \ - \ - m = q[(rb) + 24 + 0]; \ - n = q[(rb) + 24 + 0 + 64]; \ - t = REDS2(n * alpha_tab[48 + 0 * 2]); \ - q[(rb) + 24 + 0] = m + t; \ - q[(rb) + 24 + 0 + 64] = m - t; \ - m = q[(rb) + 24 + 1]; \ - n = q[(rb) + 24 + 1 + 64]; \ - t = REDS2(n * alpha_tab[48 + 1 * 2]); \ - q[(rb) + 24 + 1] = m + t; \ - q[(rb) + 24 + 1 + 64] = m - t; \ - m = q[(rb) + 24 + 2]; \ - n = q[(rb) + 24 + 2 + 64]; \ - t = REDS2(n * alpha_tab[48 + 2 * 2]); \ - q[(rb) + 24 + 2] = m + t; \ - q[(rb) + 24 + 2 + 64] = m - t; \ - m = q[(rb) + 24 + 3]; \ - n = q[(rb) + 24 + 3 + 64]; \ - t = REDS2(n * alpha_tab[48 + 3 * 2]); \ - q[(rb) + 24 + 3] = m + t; \ - q[(rb) + 24 + 3 + 64] = m - t; \ - \ - m = q[(rb) + 28 + 0]; \ - n = q[(rb) + 28 + 0 + 64]; \ - t = REDS2(n * alpha_tab[56 + 0 * 2]); \ - q[(rb) + 28 + 0] = m + t; \ - q[(rb) + 28 + 0 + 64] = m - t; \ - m = q[(rb) + 28 + 1]; \ - n = q[(rb) + 28 + 1 + 64]; \ - t = REDS2(n * alpha_tab[56 + 1 * 2]); \ - q[(rb) + 28 + 1] = m + t; \ - q[(rb) + 28 + 1 + 64] = m - t; \ - m = q[(rb) + 28 + 2]; \ - n = q[(rb) + 28 + 2 + 64]; \ - t = REDS2(n * alpha_tab[56 + 2 * 2]); \ - q[(rb) + 28 + 2] = m + t; \ - q[(rb) + 28 + 2 + 64] = m - t; \ - m = q[(rb) + 28 + 3]; \ - n = q[(rb) + 28 + 3 + 64]; \ - t = REDS2(n * alpha_tab[56 + 3 * 2]); \ - q[(rb) + 28 + 3] = m + t; \ - q[(rb) + 28 + 3 + 64] = m - t; \ - \ - m = q[(rb) + 32 + 0]; \ - n = q[(rb) + 32 + 0 + 64]; \ - t = REDS2(n * alpha_tab[64 + 0 * 2]); \ - q[(rb) + 32 + 0] = m + t; \ - q[(rb) + 32 + 0 + 64] = m - t; \ - m = q[(rb) + 32 + 1]; \ - n = q[(rb) + 32 + 1 + 64]; \ - t = REDS2(n * alpha_tab[64 + 1 * 2]); \ - q[(rb) + 32 + 1] = m + t; \ - q[(rb) + 32 + 1 + 64] = m - t; \ - m = q[(rb) + 32 + 2]; \ - n = q[(rb) + 32 + 2 + 64]; \ - t = REDS2(n * alpha_tab[64 + 2 * 2]); \ - q[(rb) + 32 + 2] = m + t; \ - q[(rb) + 32 + 2 + 64] = m - t; \ - m = q[(rb) + 32 + 3]; \ - n = q[(rb) + 32 + 3 + 64]; \ - t = REDS2(n * alpha_tab[64 + 3 * 2]); \ - q[(rb) + 32 + 3] = m + t; \ - q[(rb) + 32 + 3 + 64] = m - t; \ - \ - m = q[(rb) + 36 + 0]; \ - n = q[(rb) + 36 + 0 + 64]; \ - t = REDS2(n * alpha_tab[72 + 0 * 2]); \ - q[(rb) + 36 + 0] = m + t; \ - q[(rb) + 36 + 0 + 64] = m - t; \ - m = q[(rb) + 36 + 1]; \ - n = q[(rb) + 36 + 1 + 64]; \ - t = REDS2(n * alpha_tab[72 + 1 * 2]); \ - q[(rb) + 36 + 1] = m + t; \ - q[(rb) + 36 + 1 + 64] = m - t; \ - m = q[(rb) + 36 + 2]; \ - n = q[(rb) + 36 + 2 + 64]; \ - t = REDS2(n * alpha_tab[72 + 2 * 2]); \ - q[(rb) + 36 + 2] = m + t; \ - q[(rb) + 36 + 2 + 64] = m - t; \ - m = q[(rb) + 36 + 3]; \ - n = q[(rb) + 36 + 3 + 64]; \ - t = REDS2(n * alpha_tab[72 + 3 * 2]); \ - q[(rb) + 36 + 3] = m + t; \ - q[(rb) + 36 + 3 + 64] = m - t; \ - \ - m = q[(rb) + 40 + 0]; \ - n = q[(rb) + 40 + 0 + 64]; \ - t = REDS2(n * alpha_tab[80 + 0 * 2]); \ - q[(rb) + 40 + 0] = m + t; \ - q[(rb) + 40 + 0 + 64] = m - t; \ - m = q[(rb) + 40 + 1]; \ - n = q[(rb) + 40 + 1 + 64]; \ - t = REDS2(n * alpha_tab[80 + 1 * 2]); \ - q[(rb) + 40 + 1] = m + t; \ - q[(rb) + 40 + 1 + 64] = m - t; \ - m = q[(rb) + 40 + 2]; \ - n = q[(rb) + 40 + 2 + 64]; \ - t = REDS2(n * alpha_tab[80 + 2 * 2]); \ - q[(rb) + 40 + 2] = m + t; \ - q[(rb) + 40 + 2 + 64] = m - t; \ - m = q[(rb) + 40 + 3]; \ - n = q[(rb) + 40 + 3 + 64]; \ - t = REDS2(n * alpha_tab[80 + 3 * 2]); \ - q[(rb) + 40 + 3] = m + t; \ - q[(rb) + 40 + 3 + 64] = m - t; \ - \ - m = q[(rb) + 44 + 0]; \ - n = q[(rb) + 44 + 0 + 64]; \ - t = REDS2(n * alpha_tab[88 + 0 * 2]); \ - q[(rb) + 44 + 0] = m + t; \ - q[(rb) + 44 + 0 + 64] = m - t; \ - m = q[(rb) + 44 + 1]; \ - n = q[(rb) + 44 + 1 + 64]; \ - t = REDS2(n * alpha_tab[88 + 1 * 2]); \ - q[(rb) + 44 + 1] = m + t; \ - q[(rb) + 44 + 1 + 64] = m - t; \ - m = q[(rb) + 44 + 2]; \ - n = q[(rb) + 44 + 2 + 64]; \ - t = REDS2(n * alpha_tab[88 + 2 * 2]); \ - q[(rb) + 44 + 2] = m + t; \ - q[(rb) + 44 + 2 + 64] = m - t; \ - m = q[(rb) + 44 + 3]; \ - n = q[(rb) + 44 + 3 + 64]; \ - t = REDS2(n * alpha_tab[88 + 3 * 2]); \ - q[(rb) + 44 + 3] = m + t; \ - q[(rb) + 44 + 3 + 64] = m - t; \ - \ - m = q[(rb) + 48 + 0]; \ - n = q[(rb) + 48 + 0 + 64]; \ - t = REDS2(n * alpha_tab[96 + 0 * 2]); \ - q[(rb) + 48 + 0] = m + t; \ - q[(rb) + 48 + 0 + 64] = m - t; \ - m = q[(rb) + 48 + 1]; \ - n = q[(rb) + 48 + 1 + 64]; \ - t = REDS2(n * alpha_tab[96 + 1 * 2]); \ - q[(rb) + 48 + 1] = m + t; \ - q[(rb) + 48 + 1 + 64] = m - t; \ - m = q[(rb) + 48 + 2]; \ - n = q[(rb) + 48 + 2 + 64]; \ - t = REDS2(n * alpha_tab[96 + 2 * 2]); \ - q[(rb) + 48 + 2] = m + t; \ - q[(rb) + 48 + 2 + 64] = m - t; \ - m = q[(rb) + 48 + 3]; \ - n = q[(rb) + 48 + 3 + 64]; \ - t = REDS2(n * alpha_tab[96 + 3 * 2]); \ - q[(rb) + 48 + 3] = m + t; \ - q[(rb) + 48 + 3 + 64] = m - t; \ - \ - m = q[(rb) + 52 + 0]; \ - n = q[(rb) + 52 + 0 + 64]; \ - t = REDS2(n * alpha_tab[104 + 0 * 2]); \ - q[(rb) + 52 + 0] = m + t; \ - q[(rb) + 52 + 0 + 64] = m - t; \ - m = q[(rb) + 52 + 1]; \ - n = q[(rb) + 52 + 1 + 64]; \ - t = REDS2(n * alpha_tab[104 + 1 * 2]); \ - q[(rb) + 52 + 1] = m + t; \ - q[(rb) + 52 + 1 + 64] = m - t; \ - m = q[(rb) + 52 + 2]; \ - n = q[(rb) + 52 + 2 + 64]; \ - t = REDS2(n * alpha_tab[104 + 2 * 2]); \ - q[(rb) + 52 + 2] = m + t; \ - q[(rb) + 52 + 2 + 64] = m - t; \ - m = q[(rb) + 52 + 3]; \ - n = q[(rb) + 52 + 3 + 64]; \ - t = REDS2(n * alpha_tab[104 + 3 * 2]); \ - q[(rb) + 52 + 3] = m + t; \ - q[(rb) + 52 + 3 + 64] = m - t; \ - \ - m = q[(rb) + 56 + 0]; \ - n = q[(rb) + 56 + 0 + 64]; \ - t = REDS2(n * alpha_tab[112 + 0 * 2]); \ - q[(rb) + 56 + 0] = m + t; \ - q[(rb) + 56 + 0 + 64] = m - t; \ - m = q[(rb) + 56 + 1]; \ - n = q[(rb) + 56 + 1 + 64]; \ - t = REDS2(n * alpha_tab[112 + 1 * 2]); \ - q[(rb) + 56 + 1] = m + t; \ - q[(rb) + 56 + 1 + 64] = m - t; \ - m = q[(rb) + 56 + 2]; \ - n = q[(rb) + 56 + 2 + 64]; \ - t = REDS2(n * alpha_tab[112 + 2 * 2]); \ - q[(rb) + 56 + 2] = m + t; \ - q[(rb) + 56 + 2 + 64] = m - t; \ - m = q[(rb) + 56 + 3]; \ - n = q[(rb) + 56 + 3 + 64]; \ - t = REDS2(n * alpha_tab[112 + 3 * 2]); \ - q[(rb) + 56 + 3] = m + t; \ - q[(rb) + 56 + 3 + 64] = m - t; \ - \ - m = q[(rb) + 60 + 0]; \ - n = q[(rb) + 60 + 0 + 64]; \ - t = REDS2(n * alpha_tab[120 + 0 * 2]); \ - q[(rb) + 60 + 0] = m + t; \ - q[(rb) + 60 + 0 + 64] = m - t; \ - m = q[(rb) + 60 + 1]; \ - n = q[(rb) + 60 + 1 + 64]; \ - t = REDS2(n * alpha_tab[120 + 1 * 2]); \ - q[(rb) + 60 + 1] = m + t; \ - q[(rb) + 60 + 1 + 64] = m - t; \ - m = q[(rb) + 60 + 2]; \ - n = q[(rb) + 60 + 2 + 64]; \ - t = REDS2(n * alpha_tab[120 + 2 * 2]); \ - q[(rb) + 60 + 2] = m + t; \ - q[(rb) + 60 + 2 + 64] = m - t; \ - m = q[(rb) + 60 + 3]; \ - n = q[(rb) + 60 + 3 + 64]; \ - t = REDS2(n * alpha_tab[120 + 3 * 2]); \ - q[(rb) + 60 + 3] = m + t; \ - q[(rb) + 60 + 3 + 64] = m - t; \ - } while (0) - -#define FFT_LOOP_128_1(rb) do { \ - s32 m = q[(rb)]; \ - s32 n = q[(rb) + 128]; \ - q[(rb)] = m + n; \ - q[(rb) + 128] = m - n; \ - s32 t; \ - m = q[(rb) + 0 + 1]; \ - n = q[(rb) + 0 + 1 + 128]; \ - t = REDS2(n * alpha_tab[0 + 1 * 1]); \ - q[(rb) + 0 + 1] = m + t; \ - q[(rb) + 0 + 1 + 128] = m - t; \ - m = q[(rb) + 0 + 2]; \ - n = q[(rb) + 0 + 2 + 128]; \ - t = REDS2(n * alpha_tab[0 + 2 * 1]); \ - q[(rb) + 0 + 2] = m + t; \ - q[(rb) + 0 + 2 + 128] = m - t; \ - m = q[(rb) + 0 + 3]; \ - n = q[(rb) + 0 + 3 + 128]; \ - t = REDS2(n * alpha_tab[0 + 3 * 1]); \ - q[(rb) + 0 + 3] = m + t; \ - q[(rb) + 0 + 3 + 128] = m - t; \ - m = q[(rb) + 4 + 0]; \ - n = q[(rb) + 4 + 0 + 128]; \ - t = REDS2(n * alpha_tab[4 + 0 * 1]); \ - q[(rb) + 4 + 0] = m + t; \ - q[(rb) + 4 + 0 + 128] = m - t; \ - m = q[(rb) + 4 + 1]; \ - n = q[(rb) + 4 + 1 + 128]; \ - t = REDS2(n * alpha_tab[4 + 1 * 1]); \ - q[(rb) + 4 + 1] = m + t; \ - q[(rb) + 4 + 1 + 128] = m - t; \ - m = q[(rb) + 4 + 2]; \ - n = q[(rb) + 4 + 2 + 128]; \ - t = REDS2(n * alpha_tab[4 + 2 * 1]); \ - q[(rb) + 4 + 2] = m + t; \ - q[(rb) + 4 + 2 + 128] = m - t; \ - m = q[(rb) + 4 + 3]; \ - n = q[(rb) + 4 + 3 + 128]; \ - t = REDS2(n * alpha_tab[4 + 3 * 1]); \ - q[(rb) + 4 + 3] = m + t; \ - q[(rb) + 4 + 3 + 128] = m - t; \ - m = q[(rb) + 8 + 0]; \ - n = q[(rb) + 8 + 0 + 128]; \ - t = REDS2(n * alpha_tab[8 + 0 * 1]); \ - q[(rb) + 8 + 0] = m + t; \ - q[(rb) + 8 + 0 + 128] = m - t; \ - m = q[(rb) + 8 + 1]; \ - n = q[(rb) + 8 + 1 + 128]; \ - t = REDS2(n * alpha_tab[8 + 1 * 1]); \ - q[(rb) + 8 + 1] = m + t; \ - q[(rb) + 8 + 1 + 128] = m - t; \ - m = q[(rb) + 8 + 2]; \ - n = q[(rb) + 8 + 2 + 128]; \ - t = REDS2(n * alpha_tab[8 + 2 * 1]); \ - q[(rb) + 8 + 2] = m + t; \ - q[(rb) + 8 + 2 + 128] = m - t; \ - m = q[(rb) + 8 + 3]; \ - n = q[(rb) + 8 + 3 + 128]; \ - t = REDS2(n * alpha_tab[8 + 3 * 1]); \ - q[(rb) + 8 + 3] = m + t; \ - q[(rb) + 8 + 3 + 128] = m - t; \ - m = q[(rb) + 12 + 0]; \ - n = q[(rb) + 12 + 0 + 128]; \ - t = REDS2(n * alpha_tab[12 + 0 * 1]); \ - q[(rb) + 12 + 0] = m + t; \ - q[(rb) + 12 + 0 + 128] = m - t; \ - m = q[(rb) + 12 + 1]; \ - n = q[(rb) + 12 + 1 + 128]; \ - t = REDS2(n * alpha_tab[12 + 1 * 1]); \ - q[(rb) + 12 + 1] = m + t; \ - q[(rb) + 12 + 1 + 128] = m - t; \ - m = q[(rb) + 12 + 2]; \ - n = q[(rb) + 12 + 2 + 128]; \ - t = REDS2(n * alpha_tab[12 + 2 * 1]); \ - q[(rb) + 12 + 2] = m + t; \ - q[(rb) + 12 + 2 + 128] = m - t; \ - m = q[(rb) + 12 + 3]; \ - n = q[(rb) + 12 + 3 + 128]; \ - t = REDS2(n * alpha_tab[12 + 3 * 1]); \ - q[(rb) + 12 + 3] = m + t; \ - q[(rb) + 12 + 3 + 128] = m - t; \ - m = q[(rb) + 16 + 0]; \ - n = q[(rb) + 16 + 0 + 128]; \ - t = REDS2(n * alpha_tab[16 + 0 * 1]); \ - q[(rb) + 16 + 0] = m + t; \ - q[(rb) + 16 + 0 + 128] = m - t; \ - m = q[(rb) + 16 + 1]; \ - n = q[(rb) + 16 + 1 + 128]; \ - t = REDS2(n * alpha_tab[16 + 1 * 1]); \ - q[(rb) + 16 + 1] = m + t; \ - q[(rb) + 16 + 1 + 128] = m - t; \ - m = q[(rb) + 16 + 2]; \ - n = q[(rb) + 16 + 2 + 128]; \ - t = REDS2(n * alpha_tab[16 + 2 * 1]); \ - q[(rb) + 16 + 2] = m + t; \ - q[(rb) + 16 + 2 + 128] = m - t; \ - m = q[(rb) + 16 + 3]; \ - n = q[(rb) + 16 + 3 + 128]; \ - t = REDS2(n * alpha_tab[16 + 3 * 1]); \ - q[(rb) + 16 + 3] = m + t; \ - q[(rb) + 16 + 3 + 128] = m - t; \ - m = q[(rb) + 20 + 0]; \ - n = q[(rb) + 20 + 0 + 128]; \ - t = REDS2(n * alpha_tab[20 + 0 * 1]); \ - q[(rb) + 20 + 0] = m + t; \ - q[(rb) + 20 + 0 + 128] = m - t; \ - m = q[(rb) + 20 + 1]; \ - n = q[(rb) + 20 + 1 + 128]; \ - t = REDS2(n * alpha_tab[20 + 1 * 1]); \ - q[(rb) + 20 + 1] = m + t; \ - q[(rb) + 20 + 1 + 128] = m - t; \ - m = q[(rb) + 20 + 2]; \ - n = q[(rb) + 20 + 2 + 128]; \ - t = REDS2(n * alpha_tab[20 + 2 * 1]); \ - q[(rb) + 20 + 2] = m + t; \ - q[(rb) + 20 + 2 + 128] = m - t; \ - m = q[(rb) + 20 + 3]; \ - n = q[(rb) + 20 + 3 + 128]; \ - t = REDS2(n * alpha_tab[20 + 3 * 1]); \ - q[(rb) + 20 + 3] = m + t; \ - q[(rb) + 20 + 3 + 128] = m - t; \ - m = q[(rb) + 24 + 0]; \ - n = q[(rb) + 24 + 0 + 128]; \ - t = REDS2(n * alpha_tab[24 + 0 * 1]); \ - q[(rb) + 24 + 0] = m + t; \ - q[(rb) + 24 + 0 + 128] = m - t; \ - m = q[(rb) + 24 + 1]; \ - n = q[(rb) + 24 + 1 + 128]; \ - t = REDS2(n * alpha_tab[24 + 1 * 1]); \ - q[(rb) + 24 + 1] = m + t; \ - q[(rb) + 24 + 1 + 128] = m - t; \ - m = q[(rb) + 24 + 2]; \ - n = q[(rb) + 24 + 2 + 128]; \ - t = REDS2(n * alpha_tab[24 + 2 * 1]); \ - q[(rb) + 24 + 2] = m + t; \ - q[(rb) + 24 + 2 + 128] = m - t; \ - m = q[(rb) + 24 + 3]; \ - n = q[(rb) + 24 + 3 + 128]; \ - t = REDS2(n * alpha_tab[24 + 3 * 1]); \ - q[(rb) + 24 + 3] = m + t; \ - q[(rb) + 24 + 3 + 128] = m - t; \ - m = q[(rb) + 28 + 0]; \ - n = q[(rb) + 28 + 0 + 128]; \ - t = REDS2(n * alpha_tab[28 + 0 * 1]); \ - q[(rb) + 28 + 0] = m + t; \ - q[(rb) + 28 + 0 + 128] = m - t; \ - m = q[(rb) + 28 + 1]; \ - n = q[(rb) + 28 + 1 + 128]; \ - t = REDS2(n * alpha_tab[28 + 1 * 1]); \ - q[(rb) + 28 + 1] = m + t; \ - q[(rb) + 28 + 1 + 128] = m - t; \ - m = q[(rb) + 28 + 2]; \ - n = q[(rb) + 28 + 2 + 128]; \ - t = REDS2(n * alpha_tab[28 + 2 * 1]); \ - q[(rb) + 28 + 2] = m + t; \ - q[(rb) + 28 + 2 + 128] = m - t; \ - m = q[(rb) + 28 + 3]; \ - n = q[(rb) + 28 + 3 + 128]; \ - t = REDS2(n * alpha_tab[28 + 3 * 1]); \ - q[(rb) + 28 + 3] = m + t; \ - q[(rb) + 28 + 3 + 128] = m - t; \ - m = q[(rb) + 32 + 0]; \ - n = q[(rb) + 32 + 0 + 128]; \ - t = REDS2(n * alpha_tab[32 + 0 * 1]); \ - q[(rb) + 32 + 0] = m + t; \ - q[(rb) + 32 + 0 + 128] = m - t; \ - m = q[(rb) + 32 + 1]; \ - n = q[(rb) + 32 + 1 + 128]; \ - t = REDS2(n * alpha_tab[32 + 1 * 1]); \ - q[(rb) + 32 + 1] = m + t; \ - q[(rb) + 32 + 1 + 128] = m - t; \ - m = q[(rb) + 32 + 2]; \ - n = q[(rb) + 32 + 2 + 128]; \ - t = REDS2(n * alpha_tab[32 + 2 * 1]); \ - q[(rb) + 32 + 2] = m + t; \ - q[(rb) + 32 + 2 + 128] = m - t; \ - m = q[(rb) + 32 + 3]; \ - n = q[(rb) + 32 + 3 + 128]; \ - t = REDS2(n * alpha_tab[32 + 3 * 1]); \ - q[(rb) + 32 + 3] = m + t; \ - q[(rb) + 32 + 3 + 128] = m - t; \ - m = q[(rb) + 36 + 0]; \ - n = q[(rb) + 36 + 0 + 128]; \ - t = REDS2(n * alpha_tab[36 + 0 * 1]); \ - q[(rb) + 36 + 0] = m + t; \ - q[(rb) + 36 + 0 + 128] = m - t; \ - m = q[(rb) + 36 + 1]; \ - n = q[(rb) + 36 + 1 + 128]; \ - t = REDS2(n * alpha_tab[36 + 1 * 1]); \ - q[(rb) + 36 + 1] = m + t; \ - q[(rb) + 36 + 1 + 128] = m - t; \ - m = q[(rb) + 36 + 2]; \ - n = q[(rb) + 36 + 2 + 128]; \ - t = REDS2(n * alpha_tab[36 + 2 * 1]); \ - q[(rb) + 36 + 2] = m + t; \ - q[(rb) + 36 + 2 + 128] = m - t; \ - m = q[(rb) + 36 + 3]; \ - n = q[(rb) + 36 + 3 + 128]; \ - t = REDS2(n * alpha_tab[36 + 3 * 1]); \ - q[(rb) + 36 + 3] = m + t; \ - q[(rb) + 36 + 3 + 128] = m - t; \ - m = q[(rb) + 40 + 0]; \ - n = q[(rb) + 40 + 0 + 128]; \ - t = REDS2(n * alpha_tab[40 + 0 * 1]); \ - q[(rb) + 40 + 0] = m + t; \ - q[(rb) + 40 + 0 + 128] = m - t; \ - m = q[(rb) + 40 + 1]; \ - n = q[(rb) + 40 + 1 + 128]; \ - t = REDS2(n * alpha_tab[40 + 1 * 1]); \ - q[(rb) + 40 + 1] = m + t; \ - q[(rb) + 40 + 1 + 128] = m - t; \ - m = q[(rb) + 40 + 2]; \ - n = q[(rb) + 40 + 2 + 128]; \ - t = REDS2(n * alpha_tab[40 + 2 * 1]); \ - q[(rb) + 40 + 2] = m + t; \ - q[(rb) + 40 + 2 + 128] = m - t; \ - m = q[(rb) + 40 + 3]; \ - n = q[(rb) + 40 + 3 + 128]; \ - t = REDS2(n * alpha_tab[40 + 3 * 1]); \ - q[(rb) + 40 + 3] = m + t; \ - q[(rb) + 40 + 3 + 128] = m - t; \ - m = q[(rb) + 44 + 0]; \ - n = q[(rb) + 44 + 0 + 128]; \ - t = REDS2(n * alpha_tab[44 + 0 * 1]); \ - q[(rb) + 44 + 0] = m + t; \ - q[(rb) + 44 + 0 + 128] = m - t; \ - m = q[(rb) + 44 + 1]; \ - n = q[(rb) + 44 + 1 + 128]; \ - t = REDS2(n * alpha_tab[44 + 1 * 1]); \ - q[(rb) + 44 + 1] = m + t; \ - q[(rb) + 44 + 1 + 128] = m - t; \ - m = q[(rb) + 44 + 2]; \ - n = q[(rb) + 44 + 2 + 128]; \ - t = REDS2(n * alpha_tab[44 + 2 * 1]); \ - q[(rb) + 44 + 2] = m + t; \ - q[(rb) + 44 + 2 + 128] = m - t; \ - m = q[(rb) + 44 + 3]; \ - n = q[(rb) + 44 + 3 + 128]; \ - t = REDS2(n * alpha_tab[44 + 3 * 1]); \ - q[(rb) + 44 + 3] = m + t; \ - q[(rb) + 44 + 3 + 128] = m - t; \ - m = q[(rb) + 48 + 0]; \ - n = q[(rb) + 48 + 0 + 128]; \ - t = REDS2(n * alpha_tab[48 + 0 * 1]); \ - q[(rb) + 48 + 0] = m + t; \ - q[(rb) + 48 + 0 + 128] = m - t; \ - m = q[(rb) + 48 + 1]; \ - n = q[(rb) + 48 + 1 + 128]; \ - t = REDS2(n * alpha_tab[48 + 1 * 1]); \ - q[(rb) + 48 + 1] = m + t; \ - q[(rb) + 48 + 1 + 128] = m - t; \ - m = q[(rb) + 48 + 2]; \ - n = q[(rb) + 48 + 2 + 128]; \ - t = REDS2(n * alpha_tab[48 + 2 * 1]); \ - q[(rb) + 48 + 2] = m + t; \ - q[(rb) + 48 + 2 + 128] = m - t; \ - m = q[(rb) + 48 + 3]; \ - n = q[(rb) + 48 + 3 + 128]; \ - t = REDS2(n * alpha_tab[48 + 3 * 1]); \ - q[(rb) + 48 + 3] = m + t; \ - q[(rb) + 48 + 3 + 128] = m - t; \ - m = q[(rb) + 52 + 0]; \ - n = q[(rb) + 52 + 0 + 128]; \ - t = REDS2(n * alpha_tab[52 + 0 * 1]); \ - q[(rb) + 52 + 0] = m + t; \ - q[(rb) + 52 + 0 + 128] = m - t; \ - m = q[(rb) + 52 + 1]; \ - n = q[(rb) + 52 + 1 + 128]; \ - t = REDS2(n * alpha_tab[52 + 1 * 1]); \ - q[(rb) + 52 + 1] = m + t; \ - q[(rb) + 52 + 1 + 128] = m - t; \ - m = q[(rb) + 52 + 2]; \ - n = q[(rb) + 52 + 2 + 128]; \ - t = REDS2(n * alpha_tab[52 + 2 * 1]); \ - q[(rb) + 52 + 2] = m + t; \ - q[(rb) + 52 + 2 + 128] = m - t; \ - m = q[(rb) + 52 + 3]; \ - n = q[(rb) + 52 + 3 + 128]; \ - t = REDS2(n * alpha_tab[52 + 3 * 1]); \ - q[(rb) + 52 + 3] = m + t; \ - q[(rb) + 52 + 3 + 128] = m - t; \ - m = q[(rb) + 56 + 0]; \ - n = q[(rb) + 56 + 0 + 128]; \ - t = REDS2(n * alpha_tab[56 + 0 * 1]); \ - q[(rb) + 56 + 0] = m + t; \ - q[(rb) + 56 + 0 + 128] = m - t; \ - m = q[(rb) + 56 + 1]; \ - n = q[(rb) + 56 + 1 + 128]; \ - t = REDS2(n * alpha_tab[56 + 1 * 1]); \ - q[(rb) + 56 + 1] = m + t; \ - q[(rb) + 56 + 1 + 128] = m - t; \ - m = q[(rb) + 56 + 2]; \ - n = q[(rb) + 56 + 2 + 128]; \ - t = REDS2(n * alpha_tab[56 + 2 * 1]); \ - q[(rb) + 56 + 2] = m + t; \ - q[(rb) + 56 + 2 + 128] = m - t; \ - m = q[(rb) + 56 + 3]; \ - n = q[(rb) + 56 + 3 + 128]; \ - t = REDS2(n * alpha_tab[56 + 3 * 1]); \ - q[(rb) + 56 + 3] = m + t; \ - q[(rb) + 56 + 3 + 128] = m - t; \ - m = q[(rb) + 60 + 0]; \ - n = q[(rb) + 60 + 0 + 128]; \ - t = REDS2(n * alpha_tab[60 + 0 * 1]); \ - q[(rb) + 60 + 0] = m + t; \ - q[(rb) + 60 + 0 + 128] = m - t; \ - m = q[(rb) + 60 + 1]; \ - n = q[(rb) + 60 + 1 + 128]; \ - t = REDS2(n * alpha_tab[60 + 1 * 1]); \ - q[(rb) + 60 + 1] = m + t; \ - q[(rb) + 60 + 1 + 128] = m - t; \ - m = q[(rb) + 60 + 2]; \ - n = q[(rb) + 60 + 2 + 128]; \ - t = REDS2(n * alpha_tab[60 + 2 * 1]); \ - q[(rb) + 60 + 2] = m + t; \ - q[(rb) + 60 + 2 + 128] = m - t; \ - m = q[(rb) + 60 + 3]; \ - n = q[(rb) + 60 + 3 + 128]; \ - t = REDS2(n * alpha_tab[60 + 3 * 1]); \ - q[(rb) + 60 + 3] = m + t; \ - q[(rb) + 60 + 3 + 128] = m - t; \ - m = q[(rb) + 64 + 0]; \ - n = q[(rb) + 64 + 0 + 128]; \ - t = REDS2(n * alpha_tab[64 + 0 * 1]); \ - q[(rb) + 64 + 0] = m + t; \ - q[(rb) + 64 + 0 + 128] = m - t; \ - m = q[(rb) + 64 + 1]; \ - n = q[(rb) + 64 + 1 + 128]; \ - t = REDS2(n * alpha_tab[64 + 1 * 1]); \ - q[(rb) + 64 + 1] = m + t; \ - q[(rb) + 64 + 1 + 128] = m - t; \ - m = q[(rb) + 64 + 2]; \ - n = q[(rb) + 64 + 2 + 128]; \ - t = REDS2(n * alpha_tab[64 + 2 * 1]); \ - q[(rb) + 64 + 2] = m + t; \ - q[(rb) + 64 + 2 + 128] = m - t; \ - m = q[(rb) + 64 + 3]; \ - n = q[(rb) + 64 + 3 + 128]; \ - t = REDS2(n * alpha_tab[64 + 3 * 1]); \ - q[(rb) + 64 + 3] = m + t; \ - q[(rb) + 64 + 3 + 128] = m - t; \ - m = q[(rb) + 68 + 0]; \ - n = q[(rb) + 68 + 0 + 128]; \ - t = REDS2(n * alpha_tab[68 + 0 * 1]); \ - q[(rb) + 68 + 0] = m + t; \ - q[(rb) + 68 + 0 + 128] = m - t; \ - m = q[(rb) + 68 + 1]; \ - n = q[(rb) + 68 + 1 + 128]; \ - t = REDS2(n * alpha_tab[68 + 1 * 1]); \ - q[(rb) + 68 + 1] = m + t; \ - q[(rb) + 68 + 1 + 128] = m - t; \ - m = q[(rb) + 68 + 2]; \ - n = q[(rb) + 68 + 2 + 128]; \ - t = REDS2(n * alpha_tab[68 + 2 * 1]); \ - q[(rb) + 68 + 2] = m + t; \ - q[(rb) + 68 + 2 + 128] = m - t; \ - m = q[(rb) + 68 + 3]; \ - n = q[(rb) + 68 + 3 + 128]; \ - t = REDS2(n * alpha_tab[68 + 3 * 1]); \ - q[(rb) + 68 + 3] = m + t; \ - q[(rb) + 68 + 3 + 128] = m - t; \ - m = q[(rb) + 72 + 0]; \ - n = q[(rb) + 72 + 0 + 128]; \ - t = REDS2(n * alpha_tab[72 + 0 * 1]); \ - q[(rb) + 72 + 0] = m + t; \ - q[(rb) + 72 + 0 + 128] = m - t; \ - m = q[(rb) + 72 + 1]; \ - n = q[(rb) + 72 + 1 + 128]; \ - t = REDS2(n * alpha_tab[72 + 1 * 1]); \ - q[(rb) + 72 + 1] = m + t; \ - q[(rb) + 72 + 1 + 128] = m - t; \ - m = q[(rb) + 72 + 2]; \ - n = q[(rb) + 72 + 2 + 128]; \ - t = REDS2(n * alpha_tab[72 + 2 * 1]); \ - q[(rb) + 72 + 2] = m + t; \ - q[(rb) + 72 + 2 + 128] = m - t; \ - m = q[(rb) + 72 + 3]; \ - n = q[(rb) + 72 + 3 + 128]; \ - t = REDS2(n * alpha_tab[72 + 3 * 1]); \ - q[(rb) + 72 + 3] = m + t; \ - q[(rb) + 72 + 3 + 128] = m - t; \ - m = q[(rb) + 76 + 0]; \ - n = q[(rb) + 76 + 0 + 128]; \ - t = REDS2(n * alpha_tab[76 + 0 * 1]); \ - q[(rb) + 76 + 0] = m + t; \ - q[(rb) + 76 + 0 + 128] = m - t; \ - m = q[(rb) + 76 + 1]; \ - n = q[(rb) + 76 + 1 + 128]; \ - t = REDS2(n * alpha_tab[76 + 1 * 1]); \ - q[(rb) + 76 + 1] = m + t; \ - q[(rb) + 76 + 1 + 128] = m - t; \ - m = q[(rb) + 76 + 2]; \ - n = q[(rb) + 76 + 2 + 128]; \ - t = REDS2(n * alpha_tab[76 + 2 * 1]); \ - q[(rb) + 76 + 2] = m + t; \ - q[(rb) + 76 + 2 + 128] = m - t; \ - m = q[(rb) + 76 + 3]; \ - n = q[(rb) + 76 + 3 + 128]; \ - t = REDS2(n * alpha_tab[76 + 3 * 1]); \ - q[(rb) + 76 + 3] = m + t; \ - q[(rb) + 76 + 3 + 128] = m - t; \ - m = q[(rb) + 80 + 0]; \ - n = q[(rb) + 80 + 0 + 128]; \ - t = REDS2(n * alpha_tab[80 + 0 * 1]); \ - q[(rb) + 80 + 0] = m + t; \ - q[(rb) + 80 + 0 + 128] = m - t; \ - m = q[(rb) + 80 + 1]; \ - n = q[(rb) + 80 + 1 + 128]; \ - t = REDS2(n * alpha_tab[80 + 1 * 1]); \ - q[(rb) + 80 + 1] = m + t; \ - q[(rb) + 80 + 1 + 128] = m - t; \ - m = q[(rb) + 80 + 2]; \ - n = q[(rb) + 80 + 2 + 128]; \ - t = REDS2(n * alpha_tab[80 + 2 * 1]); \ - q[(rb) + 80 + 2] = m + t; \ - q[(rb) + 80 + 2 + 128] = m - t; \ - m = q[(rb) + 80 + 3]; \ - n = q[(rb) + 80 + 3 + 128]; \ - t = REDS2(n * alpha_tab[80 + 3 * 1]); \ - q[(rb) + 80 + 3] = m + t; \ - q[(rb) + 80 + 3 + 128] = m - t; \ - m = q[(rb) + 84 + 0]; \ - n = q[(rb) + 84 + 0 + 128]; \ - t = REDS2(n * alpha_tab[84 + 0 * 1]); \ - q[(rb) + 84 + 0] = m + t; \ - q[(rb) + 84 + 0 + 128] = m - t; \ - m = q[(rb) + 84 + 1]; \ - n = q[(rb) + 84 + 1 + 128]; \ - t = REDS2(n * alpha_tab[84 + 1 * 1]); \ - q[(rb) + 84 + 1] = m + t; \ - q[(rb) + 84 + 1 + 128] = m - t; \ - m = q[(rb) + 84 + 2]; \ - n = q[(rb) + 84 + 2 + 128]; \ - t = REDS2(n * alpha_tab[84 + 2 * 1]); \ - q[(rb) + 84 + 2] = m + t; \ - q[(rb) + 84 + 2 + 128] = m - t; \ - m = q[(rb) + 84 + 3]; \ - n = q[(rb) + 84 + 3 + 128]; \ - t = REDS2(n * alpha_tab[84 + 3 * 1]); \ - q[(rb) + 84 + 3] = m + t; \ - q[(rb) + 84 + 3 + 128] = m - t; \ - m = q[(rb) + 88 + 0]; \ - n = q[(rb) + 88 + 0 + 128]; \ - t = REDS2(n * alpha_tab[88 + 0 * 1]); \ - q[(rb) + 88 + 0] = m + t; \ - q[(rb) + 88 + 0 + 128] = m - t; \ - m = q[(rb) + 88 + 1]; \ - n = q[(rb) + 88 + 1 + 128]; \ - t = REDS2(n * alpha_tab[88 + 1 * 1]); \ - q[(rb) + 88 + 1] = m + t; \ - q[(rb) + 88 + 1 + 128] = m - t; \ - m = q[(rb) + 88 + 2]; \ - n = q[(rb) + 88 + 2 + 128]; \ - t = REDS2(n * alpha_tab[88 + 2 * 1]); \ - q[(rb) + 88 + 2] = m + t; \ - q[(rb) + 88 + 2 + 128] = m - t; \ - m = q[(rb) + 88 + 3]; \ - n = q[(rb) + 88 + 3 + 128]; \ - t = REDS2(n * alpha_tab[88 + 3 * 1]); \ - q[(rb) + 88 + 3] = m + t; \ - q[(rb) + 88 + 3 + 128] = m - t; \ - m = q[(rb) + 92 + 0]; \ - n = q[(rb) + 92 + 0 + 128]; \ - t = REDS2(n * alpha_tab[92 + 0 * 1]); \ - q[(rb) + 92 + 0] = m + t; \ - q[(rb) + 92 + 0 + 128] = m - t; \ - m = q[(rb) + 92 + 1]; \ - n = q[(rb) + 92 + 1 + 128]; \ - t = REDS2(n * alpha_tab[92 + 1 * 1]); \ - q[(rb) + 92 + 1] = m + t; \ - q[(rb) + 92 + 1 + 128] = m - t; \ - m = q[(rb) + 92 + 2]; \ - n = q[(rb) + 92 + 2 + 128]; \ - t = REDS2(n * alpha_tab[92 + 2 * 1]); \ - q[(rb) + 92 + 2] = m + t; \ - q[(rb) + 92 + 2 + 128] = m - t; \ - m = q[(rb) + 92 + 3]; \ - n = q[(rb) + 92 + 3 + 128]; \ - t = REDS2(n * alpha_tab[92 + 3 * 1]); \ - q[(rb) + 92 + 3] = m + t; \ - q[(rb) + 92 + 3 + 128] = m - t; \ - m = q[(rb) + 96 + 0]; \ - n = q[(rb) + 96 + 0 + 128]; \ - t = REDS2(n * alpha_tab[96 + 0 * 1]); \ - q[(rb) + 96 + 0] = m + t; \ - q[(rb) + 96 + 0 + 128] = m - t; \ - m = q[(rb) + 96 + 1]; \ - n = q[(rb) + 96 + 1 + 128]; \ - t = REDS2(n * alpha_tab[96 + 1 * 1]); \ - q[(rb) + 96 + 1] = m + t; \ - q[(rb) + 96 + 1 + 128] = m - t; \ - m = q[(rb) + 96 + 2]; \ - n = q[(rb) + 96 + 2 + 128]; \ - t = REDS2(n * alpha_tab[96 + 2 * 1]); \ - q[(rb) + 96 + 2] = m + t; \ - q[(rb) + 96 + 2 + 128] = m - t; \ - m = q[(rb) + 96 + 3]; \ - n = q[(rb) + 96 + 3 + 128]; \ - t = REDS2(n * alpha_tab[96 + 3 * 1]); \ - q[(rb) + 96 + 3] = m + t; \ - q[(rb) + 96 + 3 + 128] = m - t; \ - m = q[(rb) + 100 + 0]; \ - n = q[(rb) + 100 + 0 + 128]; \ - t = REDS2(n * alpha_tab[100 + 0 * 1]); \ - q[(rb) + 100 + 0] = m + t; \ - q[(rb) + 100 + 0 + 128] = m - t; \ - m = q[(rb) + 100 + 1]; \ - n = q[(rb) + 100 + 1 + 128]; \ - t = REDS2(n * alpha_tab[100 + 1 * 1]); \ - q[(rb) + 100 + 1] = m + t; \ - q[(rb) + 100 + 1 + 128] = m - t; \ - m = q[(rb) + 100 + 2]; \ - n = q[(rb) + 100 + 2 + 128]; \ - t = REDS2(n * alpha_tab[100 + 2 * 1]); \ - q[(rb) + 100 + 2] = m + t; \ - q[(rb) + 100 + 2 + 128] = m - t; \ - m = q[(rb) + 100 + 3]; \ - n = q[(rb) + 100 + 3 + 128]; \ - t = REDS2(n * alpha_tab[100 + 3 * 1]); \ - q[(rb) + 100 + 3] = m + t; \ - q[(rb) + 100 + 3 + 128] = m - t; \ - m = q[(rb) + 104 + 0]; \ - n = q[(rb) + 104 + 0 + 128]; \ - t = REDS2(n * alpha_tab[104 + 0 * 1]); \ - q[(rb) + 104 + 0] = m + t; \ - q[(rb) + 104 + 0 + 128] = m - t; \ - m = q[(rb) + 104 + 1]; \ - n = q[(rb) + 104 + 1 + 128]; \ - t = REDS2(n * alpha_tab[104 + 1 * 1]); \ - q[(rb) + 104 + 1] = m + t; \ - q[(rb) + 104 + 1 + 128] = m - t; \ - m = q[(rb) + 104 + 2]; \ - n = q[(rb) + 104 + 2 + 128]; \ - t = REDS2(n * alpha_tab[104 + 2 * 1]); \ - q[(rb) + 104 + 2] = m + t; \ - q[(rb) + 104 + 2 + 128] = m - t; \ - m = q[(rb) + 104 + 3]; \ - n = q[(rb) + 104 + 3 + 128]; \ - t = REDS2(n * alpha_tab[104 + 3 * 1]); \ - q[(rb) + 104 + 3] = m + t; \ - q[(rb) + 104 + 3 + 128] = m - t; \ - m = q[(rb) + 108 + 0]; \ - n = q[(rb) + 108 + 0 + 128]; \ - t = REDS2(n * alpha_tab[108 + 0 * 1]); \ - q[(rb) + 108 + 0] = m + t; \ - q[(rb) + 108 + 0 + 128] = m - t; \ - m = q[(rb) + 108 + 1]; \ - n = q[(rb) + 108 + 1 + 128]; \ - t = REDS2(n * alpha_tab[108 + 1 * 1]); \ - q[(rb) + 108 + 1] = m + t; \ - q[(rb) + 108 + 1 + 128] = m - t; \ - m = q[(rb) + 108 + 2]; \ - n = q[(rb) + 108 + 2 + 128]; \ - t = REDS2(n * alpha_tab[108 + 2 * 1]); \ - q[(rb) + 108 + 2] = m + t; \ - q[(rb) + 108 + 2 + 128] = m - t; \ - m = q[(rb) + 108 + 3]; \ - n = q[(rb) + 108 + 3 + 128]; \ - t = REDS2(n * alpha_tab[108 + 3 * 1]); \ - q[(rb) + 108 + 3] = m + t; \ - q[(rb) + 108 + 3 + 128] = m - t; \ - m = q[(rb) + 112 + 0]; \ - n = q[(rb) + 112 + 0 + 128]; \ - t = REDS2(n * alpha_tab[112 + 0 * 1]); \ - q[(rb) + 112 + 0] = m + t; \ - q[(rb) + 112 + 0 + 128] = m - t; \ - m = q[(rb) + 112 + 1]; \ - n = q[(rb) + 112 + 1 + 128]; \ - t = REDS2(n * alpha_tab[112 + 1 * 1]); \ - q[(rb) + 112 + 1] = m + t; \ - q[(rb) + 112 + 1 + 128] = m - t; \ - m = q[(rb) + 112 + 2]; \ - n = q[(rb) + 112 + 2 + 128]; \ - t = REDS2(n * alpha_tab[112 + 2 * 1]); \ - q[(rb) + 112 + 2] = m + t; \ - q[(rb) + 112 + 2 + 128] = m - t; \ - m = q[(rb) + 112 + 3]; \ - n = q[(rb) + 112 + 3 + 128]; \ - t = REDS2(n * alpha_tab[112 + 3 * 1]); \ - q[(rb) + 112 + 3] = m + t; \ - q[(rb) + 112 + 3 + 128] = m - t; \ - m = q[(rb) + 116 + 0]; \ - n = q[(rb) + 116 + 0 + 128]; \ - t = REDS2(n * alpha_tab[116 + 0 * 1]); \ - q[(rb) + 116 + 0] = m + t; \ - q[(rb) + 116 + 0 + 128] = m - t; \ - m = q[(rb) + 116 + 1]; \ - n = q[(rb) + 116 + 1 + 128]; \ - t = REDS2(n * alpha_tab[116 + 1 * 1]); \ - q[(rb) + 116 + 1] = m + t; \ - q[(rb) + 116 + 1 + 128] = m - t; \ - m = q[(rb) + 116 + 2]; \ - n = q[(rb) + 116 + 2 + 128]; \ - t = REDS2(n * alpha_tab[116 + 2 * 1]); \ - q[(rb) + 116 + 2] = m + t; \ - q[(rb) + 116 + 2 + 128] = m - t; \ - m = q[(rb) + 116 + 3]; \ - n = q[(rb) + 116 + 3 + 128]; \ - t = REDS2(n * alpha_tab[116 + 3 * 1]); \ - q[(rb) + 116 + 3] = m + t; \ - q[(rb) + 116 + 3 + 128] = m - t; \ - m = q[(rb) + 120 + 0]; \ - n = q[(rb) + 120 + 0 + 128]; \ - t = REDS2(n * alpha_tab[120 + 0 * 1]); \ - q[(rb) + 120 + 0] = m + t; \ - q[(rb) + 120 + 0 + 128] = m - t; \ - m = q[(rb) + 120 + 1]; \ - n = q[(rb) + 120 + 1 + 128]; \ - t = REDS2(n * alpha_tab[120 + 1 * 1]); \ - q[(rb) + 120 + 1] = m + t; \ - q[(rb) + 120 + 1 + 128] = m - t; \ - m = q[(rb) + 120 + 2]; \ - n = q[(rb) + 120 + 2 + 128]; \ - t = REDS2(n * alpha_tab[120 + 2 * 1]); \ - q[(rb) + 120 + 2] = m + t; \ - q[(rb) + 120 + 2 + 128] = m - t; \ - m = q[(rb) + 120 + 3]; \ - n = q[(rb) + 120 + 3 + 128]; \ - t = REDS2(n * alpha_tab[120 + 3 * 1]); \ - q[(rb) + 120 + 3] = m + t; \ - q[(rb) + 120 + 3 + 128] = m - t; \ - m = q[(rb) + 124 + 0]; \ - n = q[(rb) + 124 + 0 + 128]; \ - t = REDS2(n * alpha_tab[124 + 0 * 1]); \ - q[(rb) + 124 + 0] = m + t; \ - q[(rb) + 124 + 0 + 128] = m - t; \ - m = q[(rb) + 124 + 1]; \ - n = q[(rb) + 124 + 1 + 128]; \ - t = REDS2(n * alpha_tab[124 + 1 * 1]); \ - q[(rb) + 124 + 1] = m + t; \ - q[(rb) + 124 + 1 + 128] = m - t; \ - m = q[(rb) + 124 + 2]; \ - n = q[(rb) + 124 + 2 + 128]; \ - t = REDS2(n * alpha_tab[124 + 2 * 1]); \ - q[(rb) + 124 + 2] = m + t; \ - q[(rb) + 124 + 2 + 128] = m - t; \ - m = q[(rb) + 124 + 3]; \ - n = q[(rb) + 124 + 3 + 128]; \ - t = REDS2(n * alpha_tab[124 + 3 * 1]); \ - q[(rb) + 124 + 3] = m + t; \ - q[(rb) + 124 + 3 + 128] = m - t; \ - } while (0) - -/* - * Output ranges: - * d0: min= 0 max= 1020 - * d1: min= -67 max= 4587 - * d2: min=-4335 max= 4335 - * d3: min=-4147 max= 507 - * d4: min= -510 max= 510 - * d5: min= -252 max= 4402 - * d6: min=-4335 max= 4335 - * d7: min=-4332 max= 322 - */ -#define FFT8(xb, xs, d) do { \ - s32 x0 = x[(xb)]; \ - s32 x1 = x[(xb) + (xs)]; \ - s32 x2 = x[(xb) + 2 * (xs)]; \ - s32 x3 = x[(xb) + 3 * (xs)]; \ - s32 a0 = x0 + x2; \ - s32 a1 = x0 + (x2 << 4); \ - s32 a2 = x0 - x2; \ - s32 a3 = x0 - (x2 << 4); \ - s32 b0 = x1 + x3; \ - s32 b1 = REDS1((x1 << 2) + (x3 << 6)); \ - s32 b2 = (x1 << 4) - (x3 << 4); \ - s32 b3 = REDS1((x1 << 6) + (x3 << 2)); \ - d ## 0 = a0 + b0; \ - d ## 1 = a1 + b1; \ - d ## 2 = a2 + b2; \ - d ## 3 = a3 + b3; \ - d ## 4 = a0 - b0; \ - d ## 5 = a1 - b1; \ - d ## 6 = a2 - b2; \ - d ## 7 = a3 - b3; \ - } while (0) - -/* - * When k=16, we have alpha=2. Multiplication by alpha^i is then reduced - * to some shifting. - * - * Output: within -591471..591723 - */ -#define FFT16(xb, xs, rb) do { \ - s32 d1_0, d1_1, d1_2, d1_3, d1_4, d1_5, d1_6, d1_7; \ - s32 d2_0, d2_1, d2_2, d2_3, d2_4, d2_5, d2_6, d2_7; \ - FFT8(xb, (xs) << 1, d1_); \ - FFT8((xb) + (xs), (xs) << 1, d2_); \ - q[(rb) + 0] = d1_0 + d2_0; \ - q[(rb) + 1] = d1_1 + (d2_1 << 1); \ - q[(rb) + 2] = d1_2 + (d2_2 << 2); \ - q[(rb) + 3] = d1_3 + (d2_3 << 3); \ - q[(rb) + 4] = d1_4 + (d2_4 << 4); \ - q[(rb) + 5] = d1_5 + (d2_5 << 5); \ - q[(rb) + 6] = d1_6 + (d2_6 << 6); \ - q[(rb) + 7] = d1_7 + (d2_7 << 7); \ - q[(rb) + 8] = d1_0 - d2_0; \ - q[(rb) + 9] = d1_1 - (d2_1 << 1); \ - q[(rb) + 10] = d1_2 - (d2_2 << 2); \ - q[(rb) + 11] = d1_3 - (d2_3 << 3); \ - q[(rb) + 12] = d1_4 - (d2_4 << 4); \ - q[(rb) + 13] = d1_5 - (d2_5 << 5); \ - q[(rb) + 14] = d1_6 - (d2_6 << 6); \ - q[(rb) + 15] = d1_7 - (d2_7 << 7); \ - } while (0) - -/* - * Output range: |q| <= 1183446 - */ -#define FFT32(xb, xs, rb, id) do { \ - FFT16(xb, (xs) << 1, rb); \ - FFT16((xb) + (xs), (xs) << 1, (rb) + 16); \ - FFT_LOOP_16_8(rb); \ - } while (0) - -/* - * Output range: |q| <= 2366892 - */ -#define FFT64(xb, xs, rb) do { \ - FFT32(xb, (xs) << 1, (rb), label_a); \ - FFT32((xb) + (xs), (xs) << 1, (rb) + 32, label_b); \ - FFT_LOOP_32_4(rb); \ - } while (0) - -/* - * Output range: |q| <= 9467568 - */ -#define FFT256(xb, xs, rb, id) do { \ - FFT64((xb) + ((xs) * 0), (xs) << 2, (rb + 0)); \ - FFT64((xb) + ((xs) * 2), (xs) << 2, (rb + 64)); \ - FFT_LOOP_64_2(rb); \ - FFT64((xb) + ((xs) * 1), (xs) << 2, (rb + 128)); \ - FFT64((xb) + ((xs) * 3), (xs) << 2, (rb + 192)); \ - FFT_LOOP_64_2((rb) + 128); \ - FFT_LOOP_128_1(rb); \ - } while (0) - -/* - * beta^(255*i) mod 257 - */ -__constant__ static const unsigned short yoff_b_n[] = { - 1, 163, 98, 40, 95, 65, 58, 202, 30, 7, 113, 172, - 23, 151, 198, 149, 129, 210, 49, 20, 176, 161, 29, 101, - 15, 132, 185, 86, 140, 204, 99, 203, 193, 105, 153, 10, - 88, 209, 143, 179, 136, 66, 221, 43, 70, 102, 178, 230, - 225, 181, 205, 5, 44, 233, 200, 218, 68, 33, 239, 150, - 35, 51, 89, 115, 241, 219, 231, 131, 22, 245, 100, 109, - 34, 145, 248, 75, 146, 154, 173, 186, 249, 238, 244, 194, - 11, 251, 50, 183, 17, 201, 124, 166, 73, 77, 215, 93, - 253, 119, 122, 97, 134, 254, 25, 220, 137, 229, 62, 83, - 165, 167, 236, 175, 255, 188, 61, 177, 67, 127, 141, 110, - 197, 243, 31, 170, 211, 212, 118, 216, 256, 94, 159, 217, - 162, 192, 199, 55, 227, 250, 144, 85, 234, 106, 59, 108, - 128, 47, 208, 237, 81, 96, 228, 156, 242, 125, 72, 171, - 117, 53, 158, 54, 64, 152, 104, 247, 169, 48, 114, 78, - 121, 191, 36, 214, 187, 155, 79, 27, 32, 76, 52, 252, - 213, 24, 57, 39, 189, 224, 18, 107, 222, 206, 168, 142, - 16, 38, 26, 126, 235, 12, 157, 148, 223, 112, 9, 182, - 111, 103, 84, 71, 8, 19, 13, 63, 246, 6, 207, 74, - 240, 56, 133, 91, 184, 180, 42, 164, 4, 138, 135, 160, - 123, 3, 232, 37, 120, 28, 195, 174, 92, 90, 21, 82, - 2, 69, 196, 80, 190, 130, 116, 147, 60, 14, 226, 87, - 46, 45, 139, 41 -}; - -#define INNER(l, h, mm) (((u32)((l) * (mm)) & 0xFFFFU) \ - + ((u32)((h) * (mm)) << 16)) - -#define W_BIG(sb, o1, o2, mm) \ - (INNER(q[16 * (sb) + 2 * 0 + o1], q[16 * (sb) + 2 * 0 + o2], mm), \ - INNER(q[16 * (sb) + 2 * 1 + o1], q[16 * (sb) + 2 * 1 + o2], mm), \ - INNER(q[16 * (sb) + 2 * 2 + o1], q[16 * (sb) + 2 * 2 + o2], mm), \ - INNER(q[16 * (sb) + 2 * 3 + o1], q[16 * (sb) + 2 * 3 + o2], mm), \ - INNER(q[16 * (sb) + 2 * 4 + o1], q[16 * (sb) + 2 * 4 + o2], mm), \ - INNER(q[16 * (sb) + 2 * 5 + o1], q[16 * (sb) + 2 * 5 + o2], mm), \ - INNER(q[16 * (sb) + 2 * 6 + o1], q[16 * (sb) + 2 * 6 + o2], mm), \ - INNER(q[16 * (sb) + 2 * 7 + o1], q[16 * (sb) + 2 * 7 + o2], mm) - -#define WB_0_0 W_BIG( 4, 0, 1, 185) -#define WB_0_1 W_BIG( 6, 0, 1, 185) -#define WB_0_2 W_BIG( 0, 0, 1, 185) -#define WB_0_3 W_BIG( 2, 0, 1, 185) -#define WB_0_4 W_BIG( 7, 0, 1, 185) -#define WB_0_5 W_BIG( 5, 0, 1, 185) -#define WB_0_6 W_BIG( 3, 0, 1, 185) -#define WB_0_7 W_BIG( 1, 0, 1, 185) -#define WB_1_0 W_BIG(15, 0, 1, 185) -#define WB_1_1 W_BIG(11, 0, 1, 185) -#define WB_1_2 W_BIG(12, 0, 1, 185) -#define WB_1_3 W_BIG( 8, 0, 1, 185) -#define WB_1_4 W_BIG( 9, 0, 1, 185) -#define WB_1_5 W_BIG(13, 0, 1, 185) -#define WB_1_6 W_BIG(10, 0, 1, 185) -#define WB_1_7 W_BIG(14, 0, 1, 185) -#define WB_2_0 W_BIG(17, -256, -128, 233) -#define WB_2_1 W_BIG(18, -256, -128, 233) -#define WB_2_2 W_BIG(23, -256, -128, 233) -#define WB_2_3 W_BIG(20, -256, -128, 233) -#define WB_2_4 W_BIG(22, -256, -128, 233) -#define WB_2_5 W_BIG(21, -256, -128, 233) -#define WB_2_6 W_BIG(16, -256, -128, 233) -#define WB_2_7 W_BIG(19, -256, -128, 233) -#define WB_3_0 W_BIG(30, -383, -255, 233) -#define WB_3_1 W_BIG(24, -383, -255, 233) -#define WB_3_2 W_BIG(25, -383, -255, 233) -#define WB_3_3 W_BIG(31, -383, -255, 233) -#define WB_3_4 W_BIG(27, -383, -255, 233) -#define WB_3_5 W_BIG(29, -383, -255, 233) -#define WB_3_6 W_BIG(28, -383, -255, 233) -#define WB_3_7 W_BIG(26, -383, -255, 233) - -#define IF(x, y, z) ((((y) ^ (z)) & (x)) ^ (z)) -#define MAJ(x, y, z) (((x) & (y)) | (((x) | (y)) & (z))) - -#define PP4_0_0 1 -#define PP4_0_1 0 -#define PP4_0_2 3 -#define PP4_0_3 2 -#define PP4_1_0 2 -#define PP4_1_1 3 -#define PP4_1_2 0 -#define PP4_1_3 1 -#define PP4_2_0 3 -#define PP4_2_1 2 -#define PP4_2_2 1 -#define PP4_2_3 0 - -#define PP8_0_0 1 -#define PP8_0_1 0 -#define PP8_0_2 3 -#define PP8_0_3 2 -#define PP8_0_4 5 -#define PP8_0_5 4 -#define PP8_0_6 7 -#define PP8_0_7 6 - -#define PP8_1_0 6 -#define PP8_1_1 7 -#define PP8_1_2 4 -#define PP8_1_3 5 -#define PP8_1_4 2 -#define PP8_1_5 3 -#define PP8_1_6 0 -#define PP8_1_7 1 - -#define PP8_2_0 2 -#define PP8_2_1 3 -#define PP8_2_2 0 -#define PP8_2_3 1 -#define PP8_2_4 6 -#define PP8_2_5 7 -#define PP8_2_6 4 -#define PP8_2_7 5 - -#define PP8_3_0 3 -#define PP8_3_1 2 -#define PP8_3_2 1 -#define PP8_3_3 0 -#define PP8_3_4 7 -#define PP8_3_5 6 -#define PP8_3_6 5 -#define PP8_3_7 4 - -#define PP8_4_0 5 -#define PP8_4_1 4 -#define PP8_4_2 7 -#define PP8_4_3 6 -#define PP8_4_4 1 -#define PP8_4_5 0 -#define PP8_4_6 3 -#define PP8_4_7 2 - -#define PP8_5_0 7 -#define PP8_5_1 6 -#define PP8_5_2 5 -#define PP8_5_3 4 -#define PP8_5_4 3 -#define PP8_5_5 2 -#define PP8_5_6 1 -#define PP8_5_7 0 - -#define PP8_6_0 4 -#define PP8_6_1 5 -#define PP8_6_2 6 -#define PP8_6_3 7 -#define PP8_6_4 0 -#define PP8_6_5 1 -#define PP8_6_6 2 -#define PP8_6_7 3 - -#define STEP_ELT(n, w, fun, s, ppb) do { \ - u32 tt = T32(D ## n + (w) + fun(A ## n, B ## n, C ## n)); \ - A ## n = T32(ROL32(tt, s) + XCAT(tA, XCAT(ppb, n))); \ - D ## n = C ## n; \ - C ## n = B ## n; \ - B ## n = tA ## n; \ - } while (0) - -#define STEP_BIG(w0, w1, w2, w3, w4, w5, w6, w7, fun, r, s, pp8b) do { \ - u32 tA0 = ROL32(A0, r); \ - u32 tA1 = ROL32(A1, r); \ - u32 tA2 = ROL32(A2, r); \ - u32 tA3 = ROL32(A3, r); \ - u32 tA4 = ROL32(A4, r); \ - u32 tA5 = ROL32(A5, r); \ - u32 tA6 = ROL32(A6, r); \ - u32 tA7 = ROL32(A7, r); \ - STEP_ELT(0, w0, fun, s, pp8b); \ - STEP_ELT(1, w1, fun, s, pp8b); \ - STEP_ELT(2, w2, fun, s, pp8b); \ - STEP_ELT(3, w3, fun, s, pp8b); \ - STEP_ELT(4, w4, fun, s, pp8b); \ - STEP_ELT(5, w5, fun, s, pp8b); \ - STEP_ELT(6, w6, fun, s, pp8b); \ - STEP_ELT(7, w7, fun, s, pp8b); \ - } while (0) - -#define SIMD_M3_0_0 0_ -#define SIMD_M3_1_0 1_ -#define SIMD_M3_2_0 2_ -#define SIMD_M3_3_0 0_ -#define SIMD_M3_4_0 1_ -#define SIMD_M3_5_0 2_ -#define SIMD_M3_6_0 0_ -#define SIMD_M3_7_0 1_ - -#define SIMD_M3_0_1 1_ -#define SIMD_M3_1_1 2_ -#define SIMD_M3_2_1 0_ -#define SIMD_M3_3_1 1_ -#define SIMD_M3_4_1 2_ -#define SIMD_M3_5_1 0_ -#define SIMD_M3_6_1 1_ -#define SIMD_M3_7_1 2_ - -#define SIMD_M3_0_2 2_ -#define SIMD_M3_1_2 0_ -#define SIMD_M3_2_2 1_ -#define SIMD_M3_3_2 2_ -#define SIMD_M3_4_2 0_ -#define SIMD_M3_5_2 1_ -#define SIMD_M3_6_2 2_ -#define SIMD_M3_7_2 0_ - -#define M7_0_0 0_ -#define M7_1_0 1_ -#define M7_2_0 2_ -#define M7_3_0 3_ -#define M7_4_0 4_ -#define M7_5_0 5_ -#define M7_6_0 6_ -#define M7_7_0 0_ - -#define M7_0_1 1_ -#define M7_1_1 2_ -#define M7_2_1 3_ -#define M7_3_1 4_ -#define M7_4_1 5_ -#define M7_5_1 6_ -#define M7_6_1 0_ -#define M7_7_1 1_ - -#define M7_0_2 2_ -#define M7_1_2 3_ -#define M7_2_2 4_ -#define M7_3_2 5_ -#define M7_4_2 6_ -#define M7_5_2 0_ -#define M7_6_2 1_ -#define M7_7_2 2_ - -#define M7_0_3 3_ -#define M7_1_3 4_ -#define M7_2_3 5_ -#define M7_3_3 6_ -#define M7_4_3 0_ -#define M7_5_3 1_ -#define M7_6_3 2_ -#define M7_7_3 3_ - -#define STEP_BIG_(w, fun, r, s, pp8b) STEP_BIG w, fun, r, s, pp8b) - -#define ONE_ROUND_BIG(ri, isp, p0, p1, p2, p3) do { \ - STEP_BIG_(WB_ ## ri ## 0, \ - IF, p0, p1, XCAT(PP8_, M7_0_ ## isp)); \ - STEP_BIG_(WB_ ## ri ## 1, \ - IF, p1, p2, XCAT(PP8_, M7_1_ ## isp)); \ - STEP_BIG_(WB_ ## ri ## 2, \ - IF, p2, p3, XCAT(PP8_, M7_2_ ## isp)); \ - STEP_BIG_(WB_ ## ri ## 3, \ - IF, p3, p0, XCAT(PP8_, M7_3_ ## isp)); \ - STEP_BIG_(WB_ ## ri ## 4, \ - MAJ, p0, p1, XCAT(PP8_, M7_4_ ## isp)); \ - STEP_BIG_(WB_ ## ri ## 5, \ - MAJ, p1, p2, XCAT(PP8_, M7_5_ ## isp)); \ - STEP_BIG_(WB_ ## ri ## 6, \ - MAJ, p2, p3, XCAT(PP8_, M7_6_ ## isp)); \ - STEP_BIG_(WB_ ## ri ## 7, \ - MAJ, p3, p0, XCAT(PP8_, M7_7_ ## isp)); \ - } while (0) - -//__constant__ static const s32 SIMD_Q_64[] = { -// 4, 28, -80, -120, -47, -126, 45, -123, -92, -127, -70, 23, -23, -24, 40, -125, 101, 122, 34, -24, -119, 110, -121, -112, 32, 24, 51, 73, -117, -64, -21, 42, -60, 16, 5, 85, 107, 52, -44, -96, 42, 127, -18, -108, -47, 26, 91, 117, 112, 46, 87, 79, 126, -120, 65, -24, 121, 29, 118, -7, -53, 85, -98, -117, 32, 115, -47, -116, 63, 16, -108, 49, -119, 57, -110, 4, -76, -76, -42, -86, 58, 115, 4, 4, -83, -51, -37, 116, 32, 15, 36, -42, 73, -99, 94, 87, 60, -20, 67, 12, -76, 55, 117, -68, -82, -80, 93, -20, 92, -21, -128, -91, -11, 84, -28, 76, 94, -124, 37, 93, 17, -78, -106, -29, 88, -15, -47, 102, -4, -28, 80, 120, 47, 126, -45, 123, 92, 127, 70, -23, 23, 24, -40, 125, -101, -122, -34, 24, 119, -110, 121, 112, -32, -24, -51, -73, 117, 64, 21, -42, 60, -16, -5, -85, -107, -52, 44, 96, -42, -127, 18, 108, 47, -26, -91, -117, -112, -46, -87, -79, -126, 120, -65, 24, -121, -29, -118, 7, 53, -85, 98, 117, -32, -115, 47, 116, -63, -16, 108, -49, 119, -57, 110, -4, 76, 76, 42, 86, -58, -115, -4, -4, 83, 51, 37, -116, -32, -15, -36, 42, -73, 99, -94, -87, -60, 20, -67, -12, 76, -55, -117, 68, 82, 80, -93, 20, -92, 21, 128, 91, 11, -84, 28, -76, -94, 124, -37, -93, -17, 78, 106, 29, -88, 15, 47, -102 -//}; -__constant__ static const s32 SIMD_Q_80[] = { - -125, -101, 48, 8, 81, 2, -84, 5, 36, 1, 58, -106, 105, 104, -89, 3, -28, -7, -95, 104, 9, -19, 7, 16, -97, -105, -78, -56, 11, 64, 107, -87, 68, -113, -124, -44, -22, -77, 84, 32, -87, -2, 110, 20, 81, -103, -38, -12, -17, -83, -42, -50, -3, 8, -64, 104, -8, -100, -11, 121, 75, -44, 30, 11, -97, -14, 81, 12, -66, -113, 20, -80, 9, -72, 18, -125, 52, 52, 86, 42, -71, -14, -125, -125, 45, 77, 91, -13, -97, -114, -93, 86, -56, 29, -35, -42, -69, 108, -62, -117, 52, -74, -12, 60, 46, 48, -36, 108, -37, 107, 0, 37, 117, -45, 100, -53, -35, 4, -92, -36, -112, 50, 22, 99, -41, 113, 81, -27, 124, 100, -49, -9, -82, -3, 83, -6, -37, -2, -59, 105, -106, -105, 88, -4, 27, 6, 94, -105, -10, 18, -8, -17, 96, 104, 77, 55, -12, -65, -108, 86, -69, 112, 123, 43, 21, 76, -85, -33, 86, 1, -111, -21, -82, 102, 37, 11, 16, 82, 41, 49, 2, -9, 63, -105, 7, 99, 10, -122, -76, 43, -31, -12, 96, 13, -82, -13, 65, 112, -21, 79, -10, 71, -19, 124, -53, -53, -87, -43, 70, 13, 124, 124, -46, -78, -92, 12, 96, 113, 92, -87, 55, -30, 34, 41, 68, -109, 61, 116, -53, 73, 11, -61, -47, -49, 35, -109, 36, -108, -1, -38, -118, 44, -101, 52, 34, -5, 91, 35, 111, -51, -23, -100, 40, -114, -82, 26 -}; - -__constant__ static uint32_t c_PaddedMessage80[20]; - -__host__ -void x16_simd512_setBlock_80(void *pdata) -{ - cudaMemcpyToSymbol(c_PaddedMessage80, pdata, sizeof(c_PaddedMessage80), 0, cudaMemcpyHostToDevice); -} - -#define TPB_SIMD 128 -__global__ -__launch_bounds__(TPB_SIMD,1) -static void x16_simd512_gpu_80(const uint32_t threads, const uint32_t startNonce, uint64_t *g_outputhash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t A[20]; - #pragma unroll 10 - for (int i=0; i < 20; i += 2) - AS_UINT2(&A[i]) = AS_UINT2(&c_PaddedMessage80[i]); - A[19] = cuda_swab32(startNonce + thread); - - // simd - unsigned char x[128]; - #pragma unroll - for (int i = 0; i < 20; i += 2) - AS_UINT2(&x[i*4]) = AS_UINT2(&A[i]); - #pragma unroll - for(int i = 80; i < 128; i+=4) AS_U32(&x[i]) = 0; - - // SIMD_IV512 - u32 A0 = 0x0BA16B95, A1 = 0x72F999AD, A2 = 0x9FECC2AE, A3 = 0xBA3264FC, A4 = 0x5E894929, A5 = 0x8E9F30E5, A6 = 0x2F1DAA37, A7 = 0xF0F2C558; - u32 B0 = 0xAC506643, B1 = 0xA90635A5, B2 = 0xE25B878B, B3 = 0xAAB7878F, B4 = 0x88817F7A, B5 = 0x0A02892B, B6 = 0x559A7550, B7 = 0x598F657E; - u32 C0 = 0x7EEF60A1, C1 = 0x6B70E3E8, C2 = 0x9C1714D1, C3 = 0xB958E2A8, C4 = 0xAB02675E, C5 = 0xED1C014F, C6 = 0xCD8D65BB, C7 = 0xFDB7A257; - u32 D0 = 0x09254899, D1 = 0xD699C7BC, D2 = 0x9019B6DC, D3 = 0x2B9022E4, D4 = 0x8FA14956, D5 = 0x21BF9BD3, D6 = 0xB94D0943, D7 = 0x6FFDDC22; - - s32 q[256]; - FFT256(0, 1, 0, ll1); - - #pragma unroll - for (int i = 0; i < 256; i ++) { - s32 tq = q[i] + yoff_b_n[i]; - tq = REDS2(tq); - tq = REDS1(tq); - tq = REDS1(tq); - q[i] = (tq <= 128 ? tq : tq - 257); - } - - A0 ^= A[ 0]; - A1 ^= A[ 1]; - A2 ^= A[ 2]; - A3 ^= A[ 3]; - A4 ^= A[ 4]; - A5 ^= A[ 5]; - A6 ^= A[ 6]; - A7 ^= A[ 7]; - B0 ^= A[ 8]; - B1 ^= A[ 9]; - B2 ^= A[10]; - B3 ^= A[11]; - B4 ^= A[12]; - B5 ^= A[13]; - B6 ^= A[14]; - B7 ^= A[15]; - C0 ^= A[16]; - C1 ^= A[17]; - C2 ^= A[18]; - C3 ^= A[19]; - - ONE_ROUND_BIG(0_, 0, 3, 23, 17, 27); - ONE_ROUND_BIG(1_, 1, 28, 19, 22, 7); - ONE_ROUND_BIG(2_, 2, 29, 9, 15, 5); - ONE_ROUND_BIG(3_, 3, 4, 13, 10, 25); - - STEP_BIG( - C32(0x0BA16B95), C32(0x72F999AD), C32(0x9FECC2AE), C32(0xBA3264FC), - C32(0x5E894929), C32(0x8E9F30E5), C32(0x2F1DAA37), C32(0xF0F2C558), - IF, 4, 13, PP8_4_); - - STEP_BIG( - C32(0xAC506643), C32(0xA90635A5), C32(0xE25B878B), C32(0xAAB7878F), - C32(0x88817F7A), C32(0x0A02892B), C32(0x559A7550), C32(0x598F657E), - IF, 13, 10, PP8_5_); - - STEP_BIG( - C32(0x7EEF60A1), C32(0x6B70E3E8), C32(0x9C1714D1), C32(0xB958E2A8), - C32(0xAB02675E), C32(0xED1C014F), C32(0xCD8D65BB), C32(0xFDB7A257), - IF, 10, 25, PP8_6_); - - STEP_BIG( - C32(0x09254899), C32(0xD699C7BC), C32(0x9019B6DC), C32(0x2B9022E4), - C32(0x8FA14956), C32(0x21BF9BD3), C32(0xB94D0943), C32(0x6FFDDC22), - IF, 25, 4, PP8_0_); - - // Second round - - u32 COPY_A0 = A0, COPY_A1 = A1, COPY_A2 = A2, COPY_A3 = A3, COPY_A4 = A4, COPY_A5 = A5, COPY_A6 = A6, COPY_A7 = A7; - u32 COPY_B0 = B0, COPY_B1 = B1, COPY_B2 = B2, COPY_B3 = B3, COPY_B4 = B4, COPY_B5 = B5, COPY_B6 = B6, COPY_B7 = B7; - u32 COPY_C0 = C0, COPY_C1 = C1, COPY_C2 = C2, COPY_C3 = C3, COPY_C4 = C4, COPY_C5 = C5, COPY_C6 = C6, COPY_C7 = C7; - u32 COPY_D0 = D0, COPY_D1 = D1, COPY_D2 = D2, COPY_D3 = D3, COPY_D4 = D4, COPY_D5 = D5, COPY_D6 = D6, COPY_D7 = D7; - - #define q SIMD_Q_80 - - A0 ^= 0x280; // bitlen - - ONE_ROUND_BIG(0_, 0, 3, 23, 17, 27); - ONE_ROUND_BIG(1_, 1, 28, 19, 22, 7); - ONE_ROUND_BIG(2_, 2, 29, 9, 15, 5); - ONE_ROUND_BIG(3_, 3, 4, 13, 10, 25); - - STEP_BIG( - COPY_A0, COPY_A1, COPY_A2, COPY_A3, - COPY_A4, COPY_A5, COPY_A6, COPY_A7, - IF, 4, 13, PP8_4_); - - STEP_BIG( - COPY_B0, COPY_B1, COPY_B2, COPY_B3, - COPY_B4, COPY_B5, COPY_B6, COPY_B7, - IF, 13, 10, PP8_5_); - - STEP_BIG( - COPY_C0, COPY_C1, COPY_C2, COPY_C3, - COPY_C4, COPY_C5, COPY_C6, COPY_C7, - IF, 10, 25, PP8_6_); - - STEP_BIG( - COPY_D0, COPY_D1, COPY_D2, COPY_D3, - COPY_D4, COPY_D5, COPY_D6, COPY_D7, - IF, 25, 4, PP8_0_); - - #undef q - - A[ 0] = A0; - A[ 1] = A1; - A[ 2] = A2; - A[ 3] = A3; - A[ 4] = A4; - A[ 5] = A5; - A[ 6] = A6; - A[ 7] = A7; - A[ 8] = B0; - A[ 9] = B1; - A[10] = B2; - A[11] = B3; - A[12] = B4; - A[13] = B5; - A[14] = B6; - A[15] = B7; - - const uint64_t hashPosition = thread; - uint32_t *Hash = (uint32_t*)(&g_outputhash[(size_t)8 * hashPosition]); - #pragma unroll - for (int i=0; i < 16; i += 2) - *(uint2*)&Hash[i] = *(uint2*)&A[i]; - } -} - -/***************************************************/ - -__host__ -void x16_simd512_cuda_hash_80(int thr_id, const uint32_t threads, const uint32_t startNonce, uint32_t *d_hash) -{ - const uint32_t tpb = 128; - const dim3 grid((threads + tpb - 1) / tpb); - const dim3 block(tpb); - x16_simd512_gpu_80 <<>> (threads, startNonce, (uint64_t*) d_hash); -} diff --git a/x16/x16r.cu b/x16/x16r.cu deleted file mode 100644 index 4e279820..00000000 --- a/x16/x16r.cu +++ /dev/null @@ -1,608 +0,0 @@ -/** - * X16R algorithm (X16 with Randomized chain order) - * - * tpruvot 2018 - GPL code - */ - -#include -#include -#include - -extern "C" { -#include "sph/sph_blake.h" -#include "sph/sph_bmw.h" -#include "sph/sph_groestl.h" -#include "sph/sph_skein.h" -#include "sph/sph_jh.h" -#include "sph/sph_keccak.h" - -#include "sph/sph_luffa.h" -#include "sph/sph_cubehash.h" -#include "sph/sph_shavite.h" -#include "sph/sph_simd.h" -#include "sph/sph_echo.h" - -#include "sph/sph_hamsi.h" -#include "sph/sph_fugue.h" -#include "sph/sph_shabal.h" -#include "sph/sph_whirlpool.h" -#include "sph/sph_sha2.h" -} - -#include "miner.h" -#include "cuda_helper.h" -#include "cuda_x16.h" - -static uint32_t *d_hash[MAX_GPUS]; - -enum Algo { - BLAKE = 0, - BMW, - GROESTL, - JH, - KECCAK, - SKEIN, - LUFFA, - CUBEHASH, - SHAVITE, - SIMD, - ECHO, - HAMSI, - FUGUE, - SHABAL, - WHIRLPOOL, - SHA512, - HASH_FUNC_COUNT -}; - -static const char* algo_strings[] = { - "blake", - "bmw512", - "groestl", - "jh512", - "keccak", - "skein", - "luffa", - "cube", - "shavite", - "simd", - "echo", - "hamsi", - "fugue", - "shabal", - "whirlpool", - "sha512", - NULL -}; - -static __thread uint32_t s_ntime = UINT32_MAX; -static __thread bool s_implemented = false; -static __thread char hashOrder[HASH_FUNC_COUNT + 1] = { 0 }; - -static void getAlgoString(const uint32_t* prevblock, char *output) -{ - char *sptr = output; - uint8_t* data = (uint8_t*)prevblock; - - for (uint8_t j = 0; j < HASH_FUNC_COUNT; j++) { - uint8_t b = (15 - j) >> 1; // 16 ascii hex chars, reversed - uint8_t algoDigit = (j & 1) ? data[b] & 0xF : data[b] >> 4; - if (algoDigit >= 10) - sprintf(sptr, "%c", 'A' + (algoDigit - 10)); - else - sprintf(sptr, "%u", (uint32_t) algoDigit); - sptr++; - } - *sptr = '\0'; -} - -// X16R CPU Hash (Validation) -extern "C" void x16r_hash(void *output, const void *input) -{ - unsigned char _ALIGN(64) hash[128]; - - sph_blake512_context ctx_blake; - sph_bmw512_context ctx_bmw; - sph_groestl512_context ctx_groestl; - sph_jh512_context ctx_jh; - sph_keccak512_context ctx_keccak; - sph_skein512_context ctx_skein; - sph_luffa512_context ctx_luffa; - sph_cubehash512_context ctx_cubehash; - sph_shavite512_context ctx_shavite; - sph_simd512_context ctx_simd; - sph_echo512_context ctx_echo; - sph_hamsi512_context ctx_hamsi; - sph_fugue512_context ctx_fugue; - sph_shabal512_context ctx_shabal; - sph_whirlpool_context ctx_whirlpool; - sph_sha512_context ctx_sha512; - - void *in = (void*) input; - int size = 80; - - uint32_t *in32 = (uint32_t*) input; - getAlgoString(&in32[1], hashOrder); - - for (int i = 0; i < 16; i++) - { - const char elem = hashOrder[i]; - const uint8_t algo = elem >= 'A' ? elem - 'A' + 10 : elem - '0'; - - switch (algo) { - case BLAKE: - sph_blake512_init(&ctx_blake); - sph_blake512(&ctx_blake, in, size); - sph_blake512_close(&ctx_blake, hash); - break; - case BMW: - sph_bmw512_init(&ctx_bmw); - sph_bmw512(&ctx_bmw, in, size); - sph_bmw512_close(&ctx_bmw, hash); - break; - case GROESTL: - sph_groestl512_init(&ctx_groestl); - sph_groestl512(&ctx_groestl, in, size); - sph_groestl512_close(&ctx_groestl, hash); - break; - case SKEIN: - sph_skein512_init(&ctx_skein); - sph_skein512(&ctx_skein, in, size); - sph_skein512_close(&ctx_skein, hash); - break; - case JH: - sph_jh512_init(&ctx_jh); - sph_jh512(&ctx_jh, in, size); - sph_jh512_close(&ctx_jh, hash); - break; - case KECCAK: - sph_keccak512_init(&ctx_keccak); - sph_keccak512(&ctx_keccak, in, size); - sph_keccak512_close(&ctx_keccak, hash); - break; - case LUFFA: - sph_luffa512_init(&ctx_luffa); - sph_luffa512(&ctx_luffa, in, size); - sph_luffa512_close(&ctx_luffa, hash); - break; - case CUBEHASH: - sph_cubehash512_init(&ctx_cubehash); - sph_cubehash512(&ctx_cubehash, in, size); - sph_cubehash512_close(&ctx_cubehash, hash); - break; - case SHAVITE: - sph_shavite512_init(&ctx_shavite); - sph_shavite512(&ctx_shavite, in, size); - sph_shavite512_close(&ctx_shavite, hash); - break; - case SIMD: - sph_simd512_init(&ctx_simd); - sph_simd512(&ctx_simd, in, size); - sph_simd512_close(&ctx_simd, hash); - break; - case ECHO: - sph_echo512_init(&ctx_echo); - sph_echo512(&ctx_echo, in, size); - sph_echo512_close(&ctx_echo, hash); - break; - case HAMSI: - sph_hamsi512_init(&ctx_hamsi); - sph_hamsi512(&ctx_hamsi, in, size); - sph_hamsi512_close(&ctx_hamsi, hash); - break; - case FUGUE: - sph_fugue512_init(&ctx_fugue); - sph_fugue512(&ctx_fugue, in, size); - sph_fugue512_close(&ctx_fugue, hash); - break; - case SHABAL: - sph_shabal512_init(&ctx_shabal); - sph_shabal512(&ctx_shabal, in, size); - sph_shabal512_close(&ctx_shabal, hash); - break; - case WHIRLPOOL: - sph_whirlpool_init(&ctx_whirlpool); - sph_whirlpool(&ctx_whirlpool, in, size); - sph_whirlpool_close(&ctx_whirlpool, hash); - break; - case SHA512: - sph_sha512_init(&ctx_sha512); - sph_sha512(&ctx_sha512,(const void*) in, size); - sph_sha512_close(&ctx_sha512,(void*) hash); - break; - } - in = (void*) hash; - size = 64; - } - memcpy(output, hash, 32); -} - -static bool init[MAX_GPUS] = { 0 }; - -//#define _DEBUG -#define _DEBUG_PREFIX "x16r-" -#include "cuda_debug.cuh" - -// #define GPU_HASH_CHECK_LOG - -#ifdef GPU_HASH_CHECK_LOG - static int algo80_tests[HASH_FUNC_COUNT] = { 0 }; - static int algo64_tests[HASH_FUNC_COUNT] = { 0 }; -#endif -static int algo80_fails[HASH_FUNC_COUNT] = { 0 }; - -extern "C" int scanhash_x16r(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - const int dev_id = device_map[thr_id]; - int intensity = (device_sm[dev_id] > 500 && !is_windows()) ? 20 : 19; - if (strstr(device_name[dev_id], "GTX 1080")) intensity = 19; - uint32_t throughput = cuda_default_throughput(thr_id, 1U << intensity); - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - //quark_blake512_cpu_init(thr_id, throughput); // Redundant - //quark_bmw512_cpu_init(thr_id, throughput); // Redundant - quark_groestl512_cpu_init(thr_id, throughput); - //quark_skein512_cpu_init(thr_id, throughput); // Redundant - //quark_jh512_cpu_init(thr_id, throughput); // Redundant - quark_keccak512_cpu_init(thr_id, throughput); - x11_shavite512_cpu_init(thr_id, throughput); - x11_simd512_cpu_init(thr_id, throughput); // 64 - x13_hamsi512_cpu_init(thr_id, throughput); - x16_fugue512_cpu_init(thr_id, throughput); - x15_whirlpool_cpu_init(thr_id, throughput, 0); - x16_whirlpool512_init(thr_id, throughput); - x17_sha512_cpu_init(thr_id, throughput); - - CUDA_CALL_OR_RET_X(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput), 0); - - cuda_check_cpu_init(thr_id, throughput); - - init[thr_id] = true; - } - - if (opt_benchmark) { - ((uint32_t*)ptarget)[7] = 0x003f; - ((uint32_t*)pdata)[1] = 0xEFCDAB89; - ((uint32_t*)pdata)[2] = 0x67452301; - } - uint32_t _ALIGN(64) endiandata[20]; - - for (int k=0; k < 19; k++) - be32enc(&endiandata[k], pdata[k]); - - uint32_t ntime = swab32(pdata[17]); - if (s_ntime != ntime) { - getAlgoString(&endiandata[1], hashOrder); - s_ntime = ntime; - s_implemented = true; - if (!thr_id) applog(LOG_INFO, "hash order %s (%08x)", hashOrder, ntime); - } - - if (!s_implemented) { - sleep(1); - return -1; - } - - cuda_check_cpu_setTarget(ptarget); - - char elem = hashOrder[0]; - const uint8_t algo80 = elem >= 'A' ? elem - 'A' + 10 : elem - '0'; - - switch (algo80) { - case BLAKE: - quark_blake512_cpu_setBlock_80(thr_id, endiandata); - break; - case BMW: - quark_bmw512_cpu_setBlock_80(endiandata); - break; - case GROESTL: - groestl512_setBlock_80(thr_id, endiandata); - break; - case JH: - jh512_setBlock_80(thr_id, endiandata); - break; - case KECCAK: - keccak512_setBlock_80(thr_id, endiandata); - break; - case SKEIN: - skein512_cpu_setBlock_80((void*)endiandata); - break; - case LUFFA: - qubit_luffa512_cpu_setBlock_80_alexis((void*)endiandata); - break; - case CUBEHASH: - cubehash512_setBlock_80(thr_id, endiandata); - break; - case SHAVITE: - x11_shavite512_setBlock_80((void*)endiandata); - break; - case SIMD: - x16_simd512_setBlock_80((void*)endiandata); - break; - case ECHO: - x11_echo512_setBlock_80_alexis((void*)endiandata); - break; - case HAMSI: - x16_hamsi512_setBlock_80((void*)endiandata); - break; - case FUGUE: - x16_fugue512_setBlock_80((void*)pdata); - break; - case SHABAL: - x16_shabal512_setBlock_80((void*)endiandata); - break; - case WHIRLPOOL: - x16_whirlpool512_setBlock_80((void*)endiandata); - break; - case SHA512: - x16_sha512_setBlock_80(endiandata); - break; - default: { - if (!thr_id) - applog(LOG_WARNING, "kernel %s %c unimplemented, order %s", algo_strings[algo80], elem, hashOrder); - s_implemented = false; - sleep(5); - return -1; - } - } - - int warn = 0; - - do { - int order = 0; - - // Hash with CUDA - - switch (algo80) { - case BLAKE: - quark_blake512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("blake80:"); - break; - case BMW: - quark_bmw512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - TRACE("bmw80 :"); - break; - case GROESTL: - groestl512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("grstl80:"); - break; - case JH: - jh512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("jh51280:"); - break; - case KECCAK: - keccak512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("kecck80:"); - break; - case SKEIN: - skein512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], 1); order++; - TRACE("skein80:"); - break; - case LUFFA: - qubit_luffa512_cpu_hash_80_alexis(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("luffa80:"); - break; - case CUBEHASH: - cubehash512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("cube 80:"); - break; - case SHAVITE: - x11_shavite512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - TRACE("shavite:"); - break; - case SIMD: - x16_simd512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("simd512:"); - break; - case ECHO: - x11_echo512_cpu_hash_80_alexis(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("echo :"); - break; - case HAMSI: - x16_hamsi512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("hamsi :"); - break; - case FUGUE: - x16_fugue512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("fugue :"); - break; - case SHABAL: - x16_shabal512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("shabal :"); - break; - case WHIRLPOOL: - x16_whirlpool512_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("whirl :"); - break; - case SHA512: - x16_sha512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("sha512 :"); - break; - } - - for (int i = 1; i < 16; i++) - { - const char elem = hashOrder[i]; - const uint8_t algo64 = elem >= 'A' ? elem - 'A' + 10 : elem - '0'; - - switch (algo64) { - case BLAKE: - quark_blake512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("blake :"); - break; - case BMW: - quark_bmw512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("bmw :"); - break; - case GROESTL: - quark_groestl512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("groestl:"); - break; - case JH: - quark_jh512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("jh512 :"); - break; - case KECCAK: - quark_keccak512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("keccak :"); - break; - case SKEIN: - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("skein :"); - break; - case LUFFA: - x11_luffa512_cpu_hash_64_alexis(thr_id, throughput, d_hash[thr_id]); order++; - TRACE("luffa :"); - break; - case CUBEHASH: - x11_cubehash512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("cube :"); - break; - case SHAVITE: - x11_shavite512_cpu_hash_64_alexis(thr_id, throughput, d_hash[thr_id]); order++; - TRACE("shavite:"); - break; - case SIMD: - x11_simd512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("simd :"); - break; - case ECHO: - x11_echo512_cpu_hash_64_alexis(thr_id, throughput, d_hash[thr_id]); order++; - TRACE("echo :"); - break; - case HAMSI: - x13_hamsi512_cpu_hash_64_alexis(thr_id, throughput, d_hash[thr_id]); order++; - TRACE("hamsi :"); - break; - case FUGUE: - x13_fugue512_cpu_hash_64_alexis(thr_id, throughput, d_hash[thr_id]); order++; - TRACE("fugue :"); - break; - case SHABAL: - x14_shabal512_cpu_hash_64_alexis(thr_id, throughput, d_hash[thr_id]); order++; - TRACE("shabal :"); - break; - case WHIRLPOOL: - x15_whirlpool_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("shabal :"); - break; - case SHA512: - x17_sha512_cpu_hash_64(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("sha512 :"); - break; - } - } - - *hashes_done = pdata[19] - first_nonce + throughput; - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); -#ifdef _DEBUG - uint32_t _ALIGN(64) dhash[8]; - be32enc(&endiandata[19], pdata[19]); - x16r_hash(dhash, endiandata); - applog_hash(dhash); - return -1; -#endif - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - be32enc(&endiandata[19], work->nonces[0]); - x16r_hash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - work_set_target_ratio(work, vhash); - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - x16r_hash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - #ifdef GPU_HASH_CHECK_LOG - gpulog(LOG_INFO, thr_id, "hash found with %s 80!", algo_strings[algo80]); - - algo80_tests[algo80] += work->valid_nonces; - char oks64[128] = { 0 }; - char oks80[128] = { 0 }; - char fails[128] = { 0 }; - for (int a = 0; a < HASH_FUNC_COUNT; a++) { - const char elem = hashOrder[a]; - const uint8_t algo64 = elem >= 'A' ? elem - 'A' + 10 : elem - '0'; - if (a > 0) algo64_tests[algo64] += work->valid_nonces; - sprintf(&oks64[strlen(oks64)], "|%X:%2d", a, algo64_tests[a] < 100 ? algo64_tests[a] : 99); - sprintf(&oks80[strlen(oks80)], "|%X:%2d", a, algo80_tests[a] < 100 ? algo80_tests[a] : 99); - sprintf(&fails[strlen(fails)], "|%X:%2d", a, algo80_fails[a] < 100 ? algo80_fails[a] : 99); - } - applog(LOG_INFO, "K64: %s", oks64); - applog(LOG_INFO, "K80: %s", oks80); - applog(LOG_ERR, "F80: %s", fails); - #endif - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - // x11+ coins could do some random error, but not on retry - gpu_increment_reject(thr_id); - algo80_fails[algo80]++; - if (!warn) { - warn++; - pdata[19] = work->nonces[0] + 1; - continue; - } else { - if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU! %s %s", - work->nonces[0], algo_strings[algo80], hashOrder); - warn = 0; - } - } - } - - if ((uint64_t)throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (pdata[19] < max_nonce && !work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - return 0; -} - -// cleanup -extern "C" void free_x16r(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - - quark_blake512_cpu_free(thr_id); - quark_groestl512_cpu_free(thr_id); - x11_simd512_cpu_free(thr_id); - x16_fugue512_cpu_free(thr_id); // to merge with x13_fugue512 ? - x15_whirlpool_cpu_free(thr_id); - - cuda_check_cpu_free(thr_id); - - cudaDeviceSynchronize(); - init[thr_id] = false; -} diff --git a/x16/x16s.cu b/x16/x16s.cu deleted file mode 100644 index c3c3e667..00000000 --- a/x16/x16s.cu +++ /dev/null @@ -1,609 +0,0 @@ -/** - * X16S algorithm (X16 with Shuffled chain order) - * - * Adapted from tpruvot X16R kernel. - * brianmct 2018 - GPL code - */ - -#include -#include -#include - -extern "C" { -#include "sph/sph_blake.h" -#include "sph/sph_bmw.h" -#include "sph/sph_groestl.h" -#include "sph/sph_skein.h" -#include "sph/sph_jh.h" -#include "sph/sph_keccak.h" - -#include "sph/sph_luffa.h" -#include "sph/sph_cubehash.h" -#include "sph/sph_shavite.h" -#include "sph/sph_simd.h" -#include "sph/sph_echo.h" - -#include "sph/sph_hamsi.h" -#include "sph/sph_fugue.h" -#include "sph/sph_shabal.h" -#include "sph/sph_whirlpool.h" -#include "sph/sph_sha2.h" -} - -#include "miner.h" -#include "cuda_helper.h" -#include "cuda_x16.h" - -static uint32_t *d_hash[MAX_GPUS]; - -enum Algo { - BLAKE = 0, - BMW, - GROESTL, - JH, - KECCAK, - SKEIN, - LUFFA, - CUBEHASH, - SHAVITE, - SIMD, - ECHO, - HAMSI, - FUGUE, - SHABAL, - WHIRLPOOL, - SHA512, - HASH_FUNC_COUNT -}; - -static const char* algo_strings[] = { - "blake", - "bmw512", - "groestl", - "jh512", - "keccak", - "skein", - "luffa", - "cube", - "shavite", - "simd", - "echo", - "hamsi", - "fugue", - "shabal", - "whirlpool", - "sha512", - NULL -}; - -static __thread uint32_t s_ntime = UINT32_MAX; -static __thread bool s_implemented = false; -static __thread char hashOrder[HASH_FUNC_COUNT + 1] = { 0 }; - -static void getAlgoString(const uint32_t* prevblock, char *output) -{ - uint8_t* data = (uint8_t*)prevblock; - - strcpy(output, "0123456789ABCDEF"); - - for(int i = 0; i < 16; i++){ - uint8_t b = (15 - i) >> 1; // 16 ascii hex chars, reversed - uint8_t algoDigit = (i & 1) ? data[b] & 0xF : data[b] >> 4; - int offset = algoDigit; - // insert the nth character at the front - char oldVal = output[offset]; - for(int j=offset; j-->0;) - output[j+1] = output[j]; - output[0] = oldVal; - } -} - -// X16S CPU Hash (Validation) -extern "C" void x16s_hash(void *output, const void *input) -{ - unsigned char _ALIGN(64) hash[128]; - sph_blake512_context ctx_blake; - sph_bmw512_context ctx_bmw; - sph_groestl512_context ctx_groestl; - sph_jh512_context ctx_jh; - sph_keccak512_context ctx_keccak; - sph_skein512_context ctx_skein; - sph_luffa512_context ctx_luffa; - sph_cubehash512_context ctx_cubehash; - sph_shavite512_context ctx_shavite; - sph_simd512_context ctx_simd; - sph_echo512_context ctx_echo; - sph_hamsi512_context ctx_hamsi; - sph_fugue512_context ctx_fugue; - sph_shabal512_context ctx_shabal; - sph_whirlpool_context ctx_whirlpool; - sph_sha512_context ctx_sha512; - - void *in = (void*) input; - int size = 80; - - uint32_t *in32 = (uint32_t*) input; - getAlgoString(&in32[1], hashOrder); - - for (int i = 0; i < 16; i++) - { - const char elem = hashOrder[i]; - const uint8_t algo = elem >= 'A' ? elem - 'A' + 10 : elem - '0'; - - switch (algo) { - case BLAKE: - sph_blake512_init(&ctx_blake); - sph_blake512(&ctx_blake, in, size); - sph_blake512_close(&ctx_blake, hash); - break; - case BMW: - sph_bmw512_init(&ctx_bmw); - sph_bmw512(&ctx_bmw, in, size); - sph_bmw512_close(&ctx_bmw, hash); - break; - case GROESTL: - sph_groestl512_init(&ctx_groestl); - sph_groestl512(&ctx_groestl, in, size); - sph_groestl512_close(&ctx_groestl, hash); - break; - case SKEIN: - sph_skein512_init(&ctx_skein); - sph_skein512(&ctx_skein, in, size); - sph_skein512_close(&ctx_skein, hash); - break; - case JH: - sph_jh512_init(&ctx_jh); - sph_jh512(&ctx_jh, in, size); - sph_jh512_close(&ctx_jh, hash); - break; - case KECCAK: - sph_keccak512_init(&ctx_keccak); - sph_keccak512(&ctx_keccak, in, size); - sph_keccak512_close(&ctx_keccak, hash); - break; - case LUFFA: - sph_luffa512_init(&ctx_luffa); - sph_luffa512(&ctx_luffa, in, size); - sph_luffa512_close(&ctx_luffa, hash); - break; - case CUBEHASH: - sph_cubehash512_init(&ctx_cubehash); - sph_cubehash512(&ctx_cubehash, in, size); - sph_cubehash512_close(&ctx_cubehash, hash); - break; - case SHAVITE: - sph_shavite512_init(&ctx_shavite); - sph_shavite512(&ctx_shavite, in, size); - sph_shavite512_close(&ctx_shavite, hash); - break; - case SIMD: - sph_simd512_init(&ctx_simd); - sph_simd512(&ctx_simd, in, size); - sph_simd512_close(&ctx_simd, hash); - break; - case ECHO: - sph_echo512_init(&ctx_echo); - sph_echo512(&ctx_echo, in, size); - sph_echo512_close(&ctx_echo, hash); - break; - case HAMSI: - sph_hamsi512_init(&ctx_hamsi); - sph_hamsi512(&ctx_hamsi, in, size); - sph_hamsi512_close(&ctx_hamsi, hash); - break; - case FUGUE: - sph_fugue512_init(&ctx_fugue); - sph_fugue512(&ctx_fugue, in, size); - sph_fugue512_close(&ctx_fugue, hash); - break; - case SHABAL: - sph_shabal512_init(&ctx_shabal); - sph_shabal512(&ctx_shabal, in, size); - sph_shabal512_close(&ctx_shabal, hash); - break; - case WHIRLPOOL: - sph_whirlpool_init(&ctx_whirlpool); - sph_whirlpool(&ctx_whirlpool, in, size); - sph_whirlpool_close(&ctx_whirlpool, hash); - break; - case SHA512: - sph_sha512_init(&ctx_sha512); - sph_sha512(&ctx_sha512,(const void*) in, size); - sph_sha512_close(&ctx_sha512,(void*) hash); - break; - } - in = (void*) hash; - size = 64; - } - memcpy(output, hash, 32); -} - -static bool init[MAX_GPUS] = { 0 }; - -//#define _DEBUG -#define _DEBUG_PREFIX "x16s-" -#include "cuda_debug.cuh" - -// #define GPU_HASH_CHECK_LOG - -#ifdef GPU_HASH_CHECK_LOG - static int algo80_tests[HASH_FUNC_COUNT] = { 0 }; - static int algo64_tests[HASH_FUNC_COUNT] = { 0 }; -#endif -static int algo80_fails[HASH_FUNC_COUNT] = { 0 }; - -extern "C" int scanhash_x16s(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - const int dev_id = device_map[thr_id]; - int intensity = (device_sm[dev_id] > 500 && !is_windows()) ? 20 : 19; - if (strstr(device_name[dev_id], "GTX 1080")) intensity = 19; - uint32_t throughput = cuda_default_throughput(thr_id, 1U << intensity); - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - //quark_blake512_cpu_init(thr_id, throughput); // Redundant - //quark_bmw512_cpu_init(thr_id, throughput); // Redundant - quark_groestl512_cpu_init(thr_id, throughput); - //quark_skein512_cpu_init(thr_id, throughput); // Redundant - //quark_jh512_cpu_init(thr_id, throughput); // Redundant - quark_keccak512_cpu_init(thr_id, throughput); - x11_shavite512_cpu_init(thr_id, throughput); - x11_simd512_cpu_init(thr_id, throughput); // 64 - x13_hamsi512_cpu_init(thr_id, throughput); - x16_fugue512_cpu_init(thr_id, throughput); - x15_whirlpool_cpu_init(thr_id, throughput, 0); - x16_whirlpool512_init(thr_id, throughput); - x17_sha512_cpu_init(thr_id, throughput); - - CUDA_CALL_OR_RET_X(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput), 0); - - cuda_check_cpu_init(thr_id, throughput); - - init[thr_id] = true; - } - - if (opt_benchmark) { - ((uint32_t*)ptarget)[7] = 0x003f; - ((uint32_t*)pdata)[1] = 0xEFCDAB89; - ((uint32_t*)pdata)[2] = 0x67452301; - } - uint32_t _ALIGN(64) endiandata[20]; - - for (int k=0; k < 19; k++) - be32enc(&endiandata[k], pdata[k]); - - uint32_t ntime = swab32(pdata[17]); - if (s_ntime != ntime) { - getAlgoString(&endiandata[1], hashOrder); - s_ntime = ntime; - s_implemented = true; - if (!thr_id) applog(LOG_INFO, "hash order %s (%08x)", hashOrder, ntime); - } - - if (!s_implemented) { - sleep(1); - return -1; - } - - cuda_check_cpu_setTarget(ptarget); - - char elem = hashOrder[0]; - const uint8_t algo80 = elem >= 'A' ? elem - 'A' + 10 : elem - '0'; - - switch (algo80) { - case BLAKE: - quark_blake512_cpu_setBlock_80(thr_id, endiandata); - break; - case BMW: - quark_bmw512_cpu_setBlock_80(endiandata); - break; - case GROESTL: - groestl512_setBlock_80(thr_id, endiandata); - break; - case JH: - jh512_setBlock_80(thr_id, endiandata); - break; - case KECCAK: - keccak512_setBlock_80(thr_id, endiandata); - break; - case SKEIN: - skein512_cpu_setBlock_80((void*)endiandata); - break; - case LUFFA: - qubit_luffa512_cpu_setBlock_80_alexis((void*)endiandata); - break; - case CUBEHASH: - cubehash512_setBlock_80(thr_id, endiandata); - break; - case SHAVITE: - x11_shavite512_setBlock_80((void*)endiandata); - break; - case SIMD: - x16_simd512_setBlock_80((void*)endiandata); - break; - case ECHO: - x11_echo512_setBlock_80_alexis((void*)endiandata); - break; - case HAMSI: - x16_hamsi512_setBlock_80((void*)endiandata); - break; - case FUGUE: - x16_fugue512_setBlock_80((void*)pdata); - break; - case SHABAL: - x16_shabal512_setBlock_80((void*)endiandata); - break; - case WHIRLPOOL: - x16_whirlpool512_setBlock_80((void*)endiandata); - break; - case SHA512: - x16_sha512_setBlock_80(endiandata); - break; - default: { - if (!thr_id) - applog(LOG_WARNING, "kernel %s %c unimplemented, order %s", algo_strings[algo80], elem, hashOrder); - s_implemented = false; - sleep(5); - return -1; - } - } - - int warn = 0; - - do { - int order = 0; - - // Hash with CUDA - - switch (algo80) { - case BLAKE: - quark_blake512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("blake80:"); - break; - case BMW: - quark_bmw512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - TRACE("bmw80 :"); - break; - case GROESTL: - groestl512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("grstl80:"); - break; - case JH: - jh512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("jh51280:"); - break; - case KECCAK: - keccak512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("kecck80:"); - break; - case SKEIN: - skein512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], 1); order++; - TRACE("skein80:"); - break; - case LUFFA: - qubit_luffa512_cpu_hash_80_alexis(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("luffa80:"); - break; - case CUBEHASH: - cubehash512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("cube 80:"); - break; - case SHAVITE: - x11_shavite512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - TRACE("shavite:"); - break; - case SIMD: - x16_simd512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("simd512:"); - break; - case ECHO: - x11_echo512_cpu_hash_80_alexis(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("echo :"); - break; - case HAMSI: - x16_hamsi512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("hamsi :"); - break; - case FUGUE: - x16_fugue512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("fugue :"); - break; - case SHABAL: - x16_shabal512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("shabal :"); - break; - case WHIRLPOOL: - x16_whirlpool512_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("whirl :"); - break; - case SHA512: - x16_sha512_cuda_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("sha512 :"); - break; - } - - for (int i = 1; i < 16; i++) - { - const char elem = hashOrder[i]; - const uint8_t algo64 = elem >= 'A' ? elem - 'A' + 10 : elem - '0'; - - switch (algo64) { - case BLAKE: - quark_blake512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("blake :"); - break; - case BMW: - quark_bmw512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("bmw :"); - break; - case GROESTL: - quark_groestl512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("groestl:"); - break; - case JH: - quark_jh512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("jh512 :"); - break; - case KECCAK: - quark_keccak512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("keccak :"); - break; - case SKEIN: - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("skein :"); - break; - case LUFFA: - x11_luffa512_cpu_hash_64_alexis(thr_id, throughput, d_hash[thr_id]); order++; - TRACE("luffa :"); - break; - case CUBEHASH: - x11_cubehash512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("cube :"); - break; - case SHAVITE: - x11_shavite512_cpu_hash_64_alexis(thr_id, throughput, d_hash[thr_id]); order++; - TRACE("shavite:"); - break; - case SIMD: - x11_simd512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("simd :"); - break; - case ECHO: - x11_echo512_cpu_hash_64_alexis(thr_id, throughput, d_hash[thr_id]); order++; - TRACE("echo :"); - break; - case HAMSI: - x13_hamsi512_cpu_hash_64_alexis(thr_id, throughput, d_hash[thr_id]); order++; - TRACE("hamsi :"); - break; - case FUGUE: - x13_fugue512_cpu_hash_64_alexis(thr_id, throughput, d_hash[thr_id]); order++; - TRACE("fugue :"); - break; - case SHABAL: - x14_shabal512_cpu_hash_64_alexis(thr_id, throughput, d_hash[thr_id]); order++; - TRACE("shabal :"); - break; - case WHIRLPOOL: - x15_whirlpool_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("shabal :"); - break; - case SHA512: - x17_sha512_cpu_hash_64(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("sha512 :"); - break; - } - } - - *hashes_done = pdata[19] - first_nonce + throughput; - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); -#ifdef _DEBUG - uint32_t _ALIGN(64) dhash[8]; - be32enc(&endiandata[19], pdata[19]); - x16s_hash(dhash, endiandata); - applog_hash(dhash); - return -1; -#endif - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - be32enc(&endiandata[19], work->nonces[0]); - x16s_hash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - work_set_target_ratio(work, vhash); - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - x16s_hash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - #ifdef GPU_HASH_CHECK_LOG - gpulog(LOG_INFO, thr_id, "hash found with %s 80!", algo_strings[algo80]); - - algo80_tests[algo80] += work->valid_nonces; - char oks64[128] = { 0 }; - char oks80[128] = { 0 }; - char fails[128] = { 0 }; - for (int a = 0; a < HASH_FUNC_COUNT; a++) { - const char elem = hashOrder[a]; - const uint8_t algo64 = elem >= 'A' ? elem - 'A' + 10 : elem - '0'; - if (a > 0) algo64_tests[algo64] += work->valid_nonces; - sprintf(&oks64[strlen(oks64)], "|%X:%2d", a, algo64_tests[a] < 100 ? algo64_tests[a] : 99); - sprintf(&oks80[strlen(oks80)], "|%X:%2d", a, algo80_tests[a] < 100 ? algo80_tests[a] : 99); - sprintf(&fails[strlen(fails)], "|%X:%2d", a, algo80_fails[a] < 100 ? algo80_fails[a] : 99); - } - applog(LOG_INFO, "K64: %s", oks64); - applog(LOG_INFO, "K80: %s", oks80); - applog(LOG_ERR, "F80: %s", fails); - #endif - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - // x11+ coins could do some random error, but not on retry - gpu_increment_reject(thr_id); - algo80_fails[algo80]++; - if (!warn) { - warn++; - pdata[19] = work->nonces[0] + 1; - continue; - } else { - if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU! %s %s", - work->nonces[0], algo_strings[algo80], hashOrder); - warn = 0; - } - } - } - - if ((uint64_t)throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (pdata[19] < max_nonce && !work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - return 0; -} - -// cleanup -extern "C" void free_x16s(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - - quark_blake512_cpu_free(thr_id); - quark_groestl512_cpu_free(thr_id); - x11_simd512_cpu_free(thr_id); - x16_fugue512_cpu_free(thr_id); // to merge with x13_fugue512 ? - x15_whirlpool_cpu_free(thr_id); - - cuda_check_cpu_free(thr_id); - - cudaDeviceSynchronize(); - init[thr_id] = false; -} diff --git a/x17/cuda_x17_haval256.cu b/x17/cuda_x17_haval256.cu deleted file mode 100644 index 74b311e2..00000000 --- a/x17/cuda_x17_haval256.cu +++ /dev/null @@ -1,351 +0,0 @@ -/* - * haval-256 kernel implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2014 djm34 - * 2016 tpruvot - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - */ -#include -#include - -#include "cuda_helper.h" - -#define F1(x6, x5, x4, x3, x2, x1, x0) \ - (((x1) & ((x0) ^ (x4))) ^ ((x2) & (x5)) ^ ((x3) & (x6)) ^ (x0)) - -#define F2(x6, x5, x4, x3, x2, x1, x0) \ - (((x2) & (((x1) & ~(x3)) ^ ((x4) & (x5)) ^ (x6) ^ (x0))) \ - ^ ((x4) & ((x1) ^ (x5))) ^ ((x3 & (x5)) ^ (x0))) - -#define F3(x6, x5, x4, x3, x2, x1, x0) \ - (((x3) & (((x1) & (x2)) ^ (x6) ^ (x0))) \ - ^ ((x1) & (x4)) ^ ((x2) & (x5)) ^ (x0)) - -#define F4(x6, x5, x4, x3, x2, x1, x0) \ - (((x3) & (((x1) & (x2)) ^ ((x4) | (x6)) ^ (x5))) \ - ^ ((x4) & ((~(x2) & (x5)) ^ (x1) ^ (x6) ^ (x0))) \ - ^ ((x2) & (x6)) ^ (x0)) - -#define F5(x6, x5, x4, x3, x2, x1, x0) \ - (((x0) & ~(((x1) & (x2) & (x3)) ^ (x5))) \ - ^ ((x1) & (x4)) ^ ((x2) & (x5)) ^ ((x3) & (x6))) - -#define FP5_1(x6, x5, x4, x3, x2, x1, x0) \ - F1(x3, x4, x1, x0, x5, x2, x6) -#define FP5_2(x6, x5, x4, x3, x2, x1, x0) \ - F2(x6, x2, x1, x0, x3, x4, x5) -#define FP5_3(x6, x5, x4, x3, x2, x1, x0) \ - F3(x2, x6, x0, x4, x3, x1, x5) -#define FP5_4(x6, x5, x4, x3, x2, x1, x0) \ - F4(x1, x5, x3, x2, x0, x4, x6) -#define FP5_5(x6, x5, x4, x3, x2, x1, x0) \ - F5(x2, x5, x0, x6, x4, x3, x1) - -#define STEP(n, p, x7, x6, x5, x4, x3, x2, x1, x0, w, c) { \ - uint32_t t = FP ## n ## _ ## p(x6, x5, x4, x3, x2, x1, x0); \ - (x7) = (uint32_t)(ROTR32(t, 7) + ROTR32((x7), 11) + (w) + (c)); \ -} - -#define PASS1(n, in) { \ - STEP(n, 1, s7, s6, s5, s4, s3, s2, s1, s0, in[ 0], 0U); \ - STEP(n, 1, s6, s5, s4, s3, s2, s1, s0, s7, in[ 1], 0U); \ - STEP(n, 1, s5, s4, s3, s2, s1, s0, s7, s6, in[ 2], 0U); \ - STEP(n, 1, s4, s3, s2, s1, s0, s7, s6, s5, in[ 3], 0U); \ - STEP(n, 1, s3, s2, s1, s0, s7, s6, s5, s4, in[ 4], 0U); \ - STEP(n, 1, s2, s1, s0, s7, s6, s5, s4, s3, in[ 5], 0U); \ - STEP(n, 1, s1, s0, s7, s6, s5, s4, s3, s2, in[ 6], 0U); \ - STEP(n, 1, s0, s7, s6, s5, s4, s3, s2, s1, in[ 7], 0U); \ - \ - STEP(n, 1, s7, s6, s5, s4, s3, s2, s1, s0, in[ 8], 0U); \ - STEP(n, 1, s6, s5, s4, s3, s2, s1, s0, s7, in[ 9], 0U); \ - STEP(n, 1, s5, s4, s3, s2, s1, s0, s7, s6, in[10], 0U); \ - STEP(n, 1, s4, s3, s2, s1, s0, s7, s6, s5, in[11], 0U); \ - STEP(n, 1, s3, s2, s1, s0, s7, s6, s5, s4, in[12], 0U); \ - STEP(n, 1, s2, s1, s0, s7, s6, s5, s4, s3, in[13], 0U); \ - STEP(n, 1, s1, s0, s7, s6, s5, s4, s3, s2, in[14], 0U); \ - STEP(n, 1, s0, s7, s6, s5, s4, s3, s2, s1, in[15], 0U); \ - \ - STEP(n, 1, s7, s6, s5, s4, s3, s2, s1, s0, in[16], 0U); \ - STEP(n, 1, s6, s5, s4, s3, s2, s1, s0, s7, in[17], 0U); \ - STEP(n, 1, s5, s4, s3, s2, s1, s0, s7, s6, in[18], 0U); \ - STEP(n, 1, s4, s3, s2, s1, s0, s7, s6, s5, in[19], 0U); \ - STEP(n, 1, s3, s2, s1, s0, s7, s6, s5, s4, in[20], 0U); \ - STEP(n, 1, s2, s1, s0, s7, s6, s5, s4, s3, in[21], 0U); \ - STEP(n, 1, s1, s0, s7, s6, s5, s4, s3, s2, in[22], 0U); \ - STEP(n, 1, s0, s7, s6, s5, s4, s3, s2, s1, in[23], 0U); \ - \ - STEP(n, 1, s7, s6, s5, s4, s3, s2, s1, s0, in[24], 0U); \ - STEP(n, 1, s6, s5, s4, s3, s2, s1, s0, s7, in[25], 0U); \ - STEP(n, 1, s5, s4, s3, s2, s1, s0, s7, s6, in[26], 0U); \ - STEP(n, 1, s4, s3, s2, s1, s0, s7, s6, s5, in[27], 0U); \ - STEP(n, 1, s3, s2, s1, s0, s7, s6, s5, s4, in[28], 0U); \ - STEP(n, 1, s2, s1, s0, s7, s6, s5, s4, s3, in[29], 0U); \ - STEP(n, 1, s1, s0, s7, s6, s5, s4, s3, s2, in[30], 0U); \ - STEP(n, 1, s0, s7, s6, s5, s4, s3, s2, s1, in[31], 0U); \ -} - -#define PASS2(n, in) { \ - STEP(n, 2, s7, s6, s5, s4, s3, s2, s1, s0, in[ 5], 0x452821E6); \ - STEP(n, 2, s6, s5, s4, s3, s2, s1, s0, s7, in[14], 0x38D01377); \ - STEP(n, 2, s5, s4, s3, s2, s1, s0, s7, s6, in[26], 0xBE5466CF); \ - STEP(n, 2, s4, s3, s2, s1, s0, s7, s6, s5, in[18], 0x34E90C6C); \ - STEP(n, 2, s3, s2, s1, s0, s7, s6, s5, s4, in[11], 0xC0AC29B7); \ - STEP(n, 2, s2, s1, s0, s7, s6, s5, s4, s3, in[28], 0xC97C50DD); \ - STEP(n, 2, s1, s0, s7, s6, s5, s4, s3, s2, in[ 7], 0x3F84D5B5); \ - STEP(n, 2, s0, s7, s6, s5, s4, s3, s2, s1, in[16], 0xB5470917); \ - \ - STEP(n, 2, s7, s6, s5, s4, s3, s2, s1, s0, in[ 0], 0x9216D5D9); \ - STEP(n, 2, s6, s5, s4, s3, s2, s1, s0, s7, in[23], 0x8979FB1B); \ - STEP(n, 2, s5, s4, s3, s2, s1, s0, s7, s6, in[20], 0xD1310BA6); \ - STEP(n, 2, s4, s3, s2, s1, s0, s7, s6, s5, in[22], 0x98DFB5AC); \ - STEP(n, 2, s3, s2, s1, s0, s7, s6, s5, s4, in[ 1], 0x2FFD72DB); \ - STEP(n, 2, s2, s1, s0, s7, s6, s5, s4, s3, in[10], 0xD01ADFB7); \ - STEP(n, 2, s1, s0, s7, s6, s5, s4, s3, s2, in[ 4], 0xB8E1AFED); \ - STEP(n, 2, s0, s7, s6, s5, s4, s3, s2, s1, in[ 8], 0x6A267E96); \ - \ - STEP(n, 2, s7, s6, s5, s4, s3, s2, s1, s0, in[30], 0xBA7C9045); \ - STEP(n, 2, s6, s5, s4, s3, s2, s1, s0, s7, in[ 3], 0xF12C7F99); \ - STEP(n, 2, s5, s4, s3, s2, s1, s0, s7, s6, in[21], 0x24A19947); \ - STEP(n, 2, s4, s3, s2, s1, s0, s7, s6, s5, in[ 9], 0xB3916CF7); \ - STEP(n, 2, s3, s2, s1, s0, s7, s6, s5, s4, in[17], 0x0801F2E2); \ - STEP(n, 2, s2, s1, s0, s7, s6, s5, s4, s3, in[24], 0x858EFC16); \ - STEP(n, 2, s1, s0, s7, s6, s5, s4, s3, s2, in[29], 0x636920D8); \ - STEP(n, 2, s0, s7, s6, s5, s4, s3, s2, s1, in[ 6], 0x71574E69); \ - \ - STEP(n, 2, s7, s6, s5, s4, s3, s2, s1, s0, in[19], 0xA458FEA3); \ - STEP(n, 2, s6, s5, s4, s3, s2, s1, s0, s7, in[12], 0xF4933D7E); \ - STEP(n, 2, s5, s4, s3, s2, s1, s0, s7, s6, in[15], 0x0D95748F); \ - STEP(n, 2, s4, s3, s2, s1, s0, s7, s6, s5, in[13], 0x728EB658); \ - STEP(n, 2, s3, s2, s1, s0, s7, s6, s5, s4, in[ 2], 0x718BCD58); \ - STEP(n, 2, s2, s1, s0, s7, s6, s5, s4, s3, in[25], 0x82154AEE); \ - STEP(n, 2, s1, s0, s7, s6, s5, s4, s3, s2, in[31], 0x7B54A41D); \ - STEP(n, 2, s0, s7, s6, s5, s4, s3, s2, s1, in[27], 0xC25A59B5); \ -} - -#define PASS3(n, in) { \ - STEP(n, 3, s7, s6, s5, s4, s3, s2, s1, s0, in[19], 0x9C30D539); \ - STEP(n, 3, s6, s5, s4, s3, s2, s1, s0, s7, in[ 9], 0x2AF26013); \ - STEP(n, 3, s5, s4, s3, s2, s1, s0, s7, s6, in[ 4], 0xC5D1B023); \ - STEP(n, 3, s4, s3, s2, s1, s0, s7, s6, s5, in[20], 0x286085F0); \ - STEP(n, 3, s3, s2, s1, s0, s7, s6, s5, s4, in[28], 0xCA417918); \ - STEP(n, 3, s2, s1, s0, s7, s6, s5, s4, s3, in[17], 0xB8DB38EF); \ - STEP(n, 3, s1, s0, s7, s6, s5, s4, s3, s2, in[ 8], 0x8E79DCB0); \ - STEP(n, 3, s0, s7, s6, s5, s4, s3, s2, s1, in[22], 0x603A180E); \ - \ - STEP(n, 3, s7, s6, s5, s4, s3, s2, s1, s0, in[29], 0x6C9E0E8B); \ - STEP(n, 3, s6, s5, s4, s3, s2, s1, s0, s7, in[14], 0xB01E8A3E); \ - STEP(n, 3, s5, s4, s3, s2, s1, s0, s7, s6, in[25], 0xD71577C1); \ - STEP(n, 3, s4, s3, s2, s1, s0, s7, s6, s5, in[12], 0xBD314B27); \ - STEP(n, 3, s3, s2, s1, s0, s7, s6, s5, s4, in[24], 0x78AF2FDA); \ - STEP(n, 3, s2, s1, s0, s7, s6, s5, s4, s3, in[30], 0x55605C60); \ - STEP(n, 3, s1, s0, s7, s6, s5, s4, s3, s2, in[16], 0xE65525F3); \ - STEP(n, 3, s0, s7, s6, s5, s4, s3, s2, s1, in[26], 0xAA55AB94); \ - \ - STEP(n, 3, s7, s6, s5, s4, s3, s2, s1, s0, in[31], 0x57489862); \ - STEP(n, 3, s6, s5, s4, s3, s2, s1, s0, s7, in[15], 0x63E81440); \ - STEP(n, 3, s5, s4, s3, s2, s1, s0, s7, s6, in[ 7], 0x55CA396A); \ - STEP(n, 3, s4, s3, s2, s1, s0, s7, s6, s5, in[ 3], 0x2AAB10B6); \ - STEP(n, 3, s3, s2, s1, s0, s7, s6, s5, s4, in[ 1], 0xB4CC5C34); \ - STEP(n, 3, s2, s1, s0, s7, s6, s5, s4, s3, in[ 0], 0x1141E8CE); \ - STEP(n, 3, s1, s0, s7, s6, s5, s4, s3, s2, in[18], 0xA15486AF); \ - STEP(n, 3, s0, s7, s6, s5, s4, s3, s2, s1, in[27], 0x7C72E993); \ - \ - STEP(n, 3, s7, s6, s5, s4, s3, s2, s1, s0, in[13], 0xB3EE1411); \ - STEP(n, 3, s6, s5, s4, s3, s2, s1, s0, s7, in[ 6], 0x636FBC2A); \ - STEP(n, 3, s5, s4, s3, s2, s1, s0, s7, s6, in[21], 0x2BA9C55D); \ - STEP(n, 3, s4, s3, s2, s1, s0, s7, s6, s5, in[10], 0x741831F6); \ - STEP(n, 3, s3, s2, s1, s0, s7, s6, s5, s4, in[23], 0xCE5C3E16); \ - STEP(n, 3, s2, s1, s0, s7, s6, s5, s4, s3, in[11], 0x9B87931E); \ - STEP(n, 3, s1, s0, s7, s6, s5, s4, s3, s2, in[ 5], 0xAFD6BA33); \ - STEP(n, 3, s0, s7, s6, s5, s4, s3, s2, s1, in[ 2], 0x6C24CF5C); \ -} - -#define PASS4(n, in) { \ - STEP(n, 4, s7, s6, s5, s4, s3, s2, s1, s0, in[24], 0x7A325381); \ - STEP(n, 4, s6, s5, s4, s3, s2, s1, s0, s7, in[ 4], 0x28958677); \ - STEP(n, 4, s5, s4, s3, s2, s1, s0, s7, s6, in[ 0], 0x3B8F4898); \ - STEP(n, 4, s4, s3, s2, s1, s0, s7, s6, s5, in[14], 0x6B4BB9AF); \ - STEP(n, 4, s3, s2, s1, s0, s7, s6, s5, s4, in[ 2], 0xC4BFE81B); \ - STEP(n, 4, s2, s1, s0, s7, s6, s5, s4, s3, in[ 7], 0x66282193); \ - STEP(n, 4, s1, s0, s7, s6, s5, s4, s3, s2, in[28], 0x61D809CC); \ - STEP(n, 4, s0, s7, s6, s5, s4, s3, s2, s1, in[23], 0xFB21A991); \ - \ - STEP(n, 4, s7, s6, s5, s4, s3, s2, s1, s0, in[26], 0x487CAC60); \ - STEP(n, 4, s6, s5, s4, s3, s2, s1, s0, s7, in[ 6], 0x5DEC8032); \ - STEP(n, 4, s5, s4, s3, s2, s1, s0, s7, s6, in[30], 0xEF845D5D); \ - STEP(n, 4, s4, s3, s2, s1, s0, s7, s6, s5, in[20], 0xE98575B1); \ - STEP(n, 4, s3, s2, s1, s0, s7, s6, s5, s4, in[18], 0xDC262302); \ - STEP(n, 4, s2, s1, s0, s7, s6, s5, s4, s3, in[25], 0xEB651B88); \ - STEP(n, 4, s1, s0, s7, s6, s5, s4, s3, s2, in[19], 0x23893E81); \ - STEP(n, 4, s0, s7, s6, s5, s4, s3, s2, s1, in[ 3], 0xD396ACC5); \ - \ - STEP(n, 4, s7, s6, s5, s4, s3, s2, s1, s0, in[22], 0x0F6D6FF3); \ - STEP(n, 4, s6, s5, s4, s3, s2, s1, s0, s7, in[11], 0x83F44239); \ - STEP(n, 4, s5, s4, s3, s2, s1, s0, s7, s6, in[31], 0x2E0B4482); \ - STEP(n, 4, s4, s3, s2, s1, s0, s7, s6, s5, in[21], 0xA4842004); \ - STEP(n, 4, s3, s2, s1, s0, s7, s6, s5, s4, in[ 8], 0x69C8F04A); \ - STEP(n, 4, s2, s1, s0, s7, s6, s5, s4, s3, in[27], 0x9E1F9B5E); \ - STEP(n, 4, s1, s0, s7, s6, s5, s4, s3, s2, in[12], 0x21C66842); \ - STEP(n, 4, s0, s7, s6, s5, s4, s3, s2, s1, in[ 9], 0xF6E96C9A); \ - \ - STEP(n, 4, s7, s6, s5, s4, s3, s2, s1, s0, in[ 1], 0x670C9C61); \ - STEP(n, 4, s6, s5, s4, s3, s2, s1, s0, s7, in[29], 0xABD388F0); \ - STEP(n, 4, s5, s4, s3, s2, s1, s0, s7, s6, in[ 5], 0x6A51A0D2); \ - STEP(n, 4, s4, s3, s2, s1, s0, s7, s6, s5, in[15], 0xD8542F68); \ - STEP(n, 4, s3, s2, s1, s0, s7, s6, s5, s4, in[17], 0x960FA728); \ - STEP(n, 4, s2, s1, s0, s7, s6, s5, s4, s3, in[10], 0xAB5133A3); \ - STEP(n, 4, s1, s0, s7, s6, s5, s4, s3, s2, in[16], 0x6EEF0B6C); \ - STEP(n, 4, s0, s7, s6, s5, s4, s3, s2, s1, in[13], 0x137A3BE4); \ -} - -#define PASS5(n, in) { \ - STEP(n, 5, s7, s6, s5, s4, s3, s2, s1, s0, in[27], 0xBA3BF050); \ - STEP(n, 5, s6, s5, s4, s3, s2, s1, s0, s7, in[ 3], 0x7EFB2A98); \ - STEP(n, 5, s5, s4, s3, s2, s1, s0, s7, s6, in[21], 0xA1F1651D); \ - STEP(n, 5, s4, s3, s2, s1, s0, s7, s6, s5, in[26], 0x39AF0176); \ - STEP(n, 5, s3, s2, s1, s0, s7, s6, s5, s4, in[17], 0x66CA593E); \ - STEP(n, 5, s2, s1, s0, s7, s6, s5, s4, s3, in[11], 0x82430E88); \ - STEP(n, 5, s1, s0, s7, s6, s5, s4, s3, s2, in[20], 0x8CEE8619); \ - STEP(n, 5, s0, s7, s6, s5, s4, s3, s2, s1, in[29], 0x456F9FB4); \ - \ - STEP(n, 5, s7, s6, s5, s4, s3, s2, s1, s0, in[19], 0x7D84A5C3); \ - STEP(n, 5, s6, s5, s4, s3, s2, s1, s0, s7, in[ 0], 0x3B8B5EBE); \ - STEP(n, 5, s5, s4, s3, s2, s1, s0, s7, s6, in[12], 0xE06F75D8); \ - STEP(n, 5, s4, s3, s2, s1, s0, s7, s6, s5, in[ 7], 0x85C12073); \ - STEP(n, 5, s3, s2, s1, s0, s7, s6, s5, s4, in[13], 0x401A449F); \ - STEP(n, 5, s2, s1, s0, s7, s6, s5, s4, s3, in[ 8], 0x56C16AA6); \ - STEP(n, 5, s1, s0, s7, s6, s5, s4, s3, s2, in[31], 0x4ED3AA62); \ - STEP(n, 5, s0, s7, s6, s5, s4, s3, s2, s1, in[10], 0x363F7706); \ - \ - STEP(n, 5, s7, s6, s5, s4, s3, s2, s1, s0, in[ 5], 0x1BFEDF72); \ - STEP(n, 5, s6, s5, s4, s3, s2, s1, s0, s7, in[ 9], 0x429B023D); \ - STEP(n, 5, s5, s4, s3, s2, s1, s0, s7, s6, in[14], 0x37D0D724); \ - STEP(n, 5, s4, s3, s2, s1, s0, s7, s6, s5, in[30], 0xD00A1248); \ - STEP(n, 5, s3, s2, s1, s0, s7, s6, s5, s4, in[18], 0xDB0FEAD3); \ - STEP(n, 5, s2, s1, s0, s7, s6, s5, s4, s3, in[ 6], 0x49F1C09B); \ - STEP(n, 5, s1, s0, s7, s6, s5, s4, s3, s2, in[28], 0x075372C9); \ - STEP(n, 5, s0, s7, s6, s5, s4, s3, s2, s1, in[24], 0x80991B7B); \ - \ - STEP(n, 5, s7, s6, s5, s4, s3, s2, s1, s0, in[ 2], 0x25D479D8); \ - STEP(n, 5, s6, s5, s4, s3, s2, s1, s0, s7, in[23], 0xF6E8DEF7); \ - STEP(n, 5, s5, s4, s3, s2, s1, s0, s7, s6, in[16], 0xE3FE501A); \ - STEP(n, 5, s4, s3, s2, s1, s0, s7, s6, s5, in[22], 0xB6794C3B); \ - STEP(n, 5, s3, s2, s1, s0, s7, s6, s5, s4, in[ 4], 0x976CE0BD); \ - STEP(n, 5, s2, s1, s0, s7, s6, s5, s4, s3, in[ 1], 0x04C006BA); \ - STEP(n, 5, s1, s0, s7, s6, s5, s4, s3, s2, in[25], 0xC1A94FB6); \ - STEP(n, 5, s0, s7, s6, s5, s4, s3, s2, s1, in[15], 0x409F60C4); \ -} - -__global__ /* __launch_bounds__(256, 6) */ -void x17_haval256_gpu_hash_64(const uint32_t threads, uint64_t *g_hash, const int outlen) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const uint64_t hashPosition = thread*8U; - uint64_t *pHash = &g_hash[hashPosition]; - - uint32_t s0, s1, s2, s3, s4, s5, s6, s7; - const uint32_t u0 = s0 = 0x243F6A88; - const uint32_t u1 = s1 = 0x85A308D3; - const uint32_t u2 = s2 = 0x13198A2E; - const uint32_t u3 = s3 = 0x03707344; - const uint32_t u4 = s4 = 0xA4093822; - const uint32_t u5 = s5 = 0x299F31D0; - const uint32_t u6 = s6 = 0x082EFA98; - const uint32_t u7 = s7 = 0xEC4E6C89; - - union { - uint32_t h4[16]; - uint64_t h8[8]; - } hash; - - #pragma unroll - for (int i=0; i<8; i++) { - hash.h8[i] = pHash[i]; - } - - ///////// input big ///////////////////// - - uint32_t buf[32]; - - #pragma unroll - for (int i=0; i<16; i++) - buf[i] = hash.h4[i]; - - buf[16] = 0x00000001; - - #pragma unroll - for (int i=17; i<29; i++) - buf[i] = 0; - - buf[29] = 0x40290000; - buf[30] = 0x00000200; - buf[31] = 0; - - PASS1(5, buf); - PASS2(5, buf); - PASS3(5, buf); - PASS4(5, buf); - PASS5(5, buf); - - hash.h4[0] = s0 + u0; - hash.h4[1] = s1 + u1; - hash.h4[2] = s2 + u2; - hash.h4[3] = s3 + u3; - hash.h4[4] = s4 + u4; - hash.h4[5] = s5 + u5; - hash.h4[6] = s6 + u6; - hash.h4[7] = s7 + u7; - - pHash[0] = hash.h8[0]; - pHash[1] = hash.h8[1]; - pHash[2] = hash.h8[2]; - pHash[3] = hash.h8[3]; - - if (outlen == 512) { - pHash[4] = 0; //hash.h8[4]; - pHash[5] = 0; //hash.h8[5]; - pHash[6] = 0; //hash.h8[6]; - pHash[7] = 0; //hash.h8[7]; - } - } -} - -__host__ -void x17_haval256_cpu_init(int thr_id, uint32_t threads) -{ -} - -__host__ -void x17_haval256_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, const int outlen) -{ - const uint32_t threadsperblock = 256; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - x17_haval256_gpu_hash_64 <<>> (threads, (uint64_t*)d_hash, outlen); -} diff --git a/x17/cuda_x17_sha512.cu b/x17/cuda_x17_sha512.cu deleted file mode 100644 index a0757d0e..00000000 --- a/x17/cuda_x17_sha512.cu +++ /dev/null @@ -1,248 +0,0 @@ -/* - * sha-512 cuda kernel implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2014 djm34 - * 2016 tpruvot - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - */ -#include - -#define NEED_HASH_512 - -#include "cuda_helper.h" - -#define SWAP64(u64) cuda_swab64(u64) - -static __constant__ uint64_t c_WB[80]; - -static const uint64_t WB[80] = { - 0x428A2F98D728AE22, 0x7137449123EF65CD, 0xB5C0FBCFEC4D3B2F, 0xE9B5DBA58189DBBC, - 0x3956C25BF348B538, 0x59F111F1B605D019, 0x923F82A4AF194F9B, 0xAB1C5ED5DA6D8118, - 0xD807AA98A3030242, 0x12835B0145706FBE, 0x243185BE4EE4B28C, 0x550C7DC3D5FFB4E2, - 0x72BE5D74F27B896F, 0x80DEB1FE3B1696B1, 0x9BDC06A725C71235, 0xC19BF174CF692694, - 0xE49B69C19EF14AD2, 0xEFBE4786384F25E3, 0x0FC19DC68B8CD5B5, 0x240CA1CC77AC9C65, - 0x2DE92C6F592B0275, 0x4A7484AA6EA6E483, 0x5CB0A9DCBD41FBD4, 0x76F988DA831153B5, - 0x983E5152EE66DFAB, 0xA831C66D2DB43210, 0xB00327C898FB213F, 0xBF597FC7BEEF0EE4, - 0xC6E00BF33DA88FC2, 0xD5A79147930AA725, 0x06CA6351E003826F, 0x142929670A0E6E70, - 0x27B70A8546D22FFC, 0x2E1B21385C26C926, 0x4D2C6DFC5AC42AED, 0x53380D139D95B3DF, - 0x650A73548BAF63DE, 0x766A0ABB3C77B2A8, 0x81C2C92E47EDAEE6, 0x92722C851482353B, - 0xA2BFE8A14CF10364, 0xA81A664BBC423001, 0xC24B8B70D0F89791, 0xC76C51A30654BE30, - 0xD192E819D6EF5218, 0xD69906245565A910, 0xF40E35855771202A, 0x106AA07032BBD1B8, - 0x19A4C116B8D2D0C8, 0x1E376C085141AB53, 0x2748774CDF8EEB99, 0x34B0BCB5E19B48A8, - 0x391C0CB3C5C95A63, 0x4ED8AA4AE3418ACB, 0x5B9CCA4F7763E373, 0x682E6FF3D6B2B8A3, - 0x748F82EE5DEFB2FC, 0x78A5636F43172F60, 0x84C87814A1F0AB72, 0x8CC702081A6439EC, - 0x90BEFFFA23631E28, 0xA4506CEBDE82BDE9, 0xBEF9A3F7B2C67915, 0xC67178F2E372532B, - 0xCA273ECEEA26619C, 0xD186B8C721C0C207, 0xEADA7DD6CDE0EB1E, 0xF57D4F7FEE6ED178, - 0x06F067AA72176FBA, 0x0A637DC5A2C898A6, 0x113F9804BEF90DAE, 0x1B710B35131C471B, - 0x28DB77F523047D84, 0x32CAAB7B40C72493, 0x3C9EBE0A15C9BEBC, 0x431D67C49C100D4C, - 0x4CC5D4BECB3E42B6, 0x597F299CFC657E2A, 0x5FCB6FAB3AD6FAEC, 0x6C44198C4A475817 -}; - -#define BSG5_0(x) xor3(ROTR64(x,28), ROTR64(x,34), ROTR64(x,39)) -#define SSG5_0(x) xor3(ROTR64(x, 1), ROTR64(x ,8), shr_t64(x,7)) -#define SSG5_1(x) xor3(ROTR64(x,19), ROTR64(x,61), shr_t64(x,6)) - -//#define MAJ(X, Y, Z) (((X) & (Y)) | (((X) | (Y)) & (Z))) -#define MAJ(x, y, z) andor(x,y,z) - -__device__ __forceinline__ -uint64_t Tone(uint64_t* K, uint64_t* r, uint64_t* W, const int a, const int i) -{ - //asm("// TONE \n"); - const uint64_t e = r[(a+4) & 7]; - uint64_t BSG51 = xor3(ROTR64(e, 14), ROTR64(e, 18), ROTR64(e, 41)); - const uint64_t f = r[(a+5) & 7]; - const uint64_t g = r[(a+6) & 7]; - uint64_t CHl = ((f ^ g) & e) ^ g; // xandx(e, f, g); - return (r[(a+7) & 7] + BSG51 + CHl + K[i] + W[i]); -} - -#define SHA3_STEP(K, r, W, ord, i) { \ - const int a = (8 - ord) & 7; \ - uint64_t T1 = Tone(K, r, W, a, i); \ - r[(a+3) & 7] += T1; \ - uint64_t T2 = (BSG5_0(r[a]) + MAJ(r[a], r[(a+1) & 7], r[(a+2) & 7])); \ - r[(a+7) & 7] = T1 + T2; \ -} - -__global__ -/*__launch_bounds__(256, 4)*/ -void x17_sha512_gpu_hash_64(const uint32_t threads, uint64_t *g_hash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const uint64_t hashPosition = thread; - uint64_t *pHash = &g_hash[hashPosition*8U]; - - uint64_t W[80]; - #pragma unroll - for (int i = 0; i < 8; i ++) { - W[i] = SWAP64(pHash[i]); - } - W[8] = 0x8000000000000000; - - #pragma unroll 69 - for (int i = 9; i<78; i++) { - W[i] = 0U; - } - W[15] = 0x0000000000000200; - - #pragma unroll 64 - for (int i = 16; i < 80; i ++) { - W[i] = SSG5_1(W[i-2]) + W[i-7]; - W[i] += SSG5_0(W[i-15]) + W[i-16]; - } - - const uint64_t IV512[8] = { - 0x6A09E667F3BCC908, 0xBB67AE8584CAA73B, - 0x3C6EF372FE94F82B, 0xA54FF53A5F1D36F1, - 0x510E527FADE682D1, 0x9B05688C2B3E6C1F, - 0x1F83D9ABFB41BD6B, 0x5BE0CD19137E2179 - }; - - uint64_t r[8]; - #pragma unroll - for (int i = 0; i < 8; i ++) { - r[i] = IV512[i]; - } - -#if CUDART_VERSION >= 7050 - #pragma unroll 10 -#endif - for (int i = 0; i < 80; i += 8) { - #pragma unroll - for (int ord = 0; ord < 8; ord++) { - SHA3_STEP(c_WB, r, W, ord, i+ord); - } - } - - #pragma unroll - for (int u = 0; u < 4; u ++) { - pHash[u] = SWAP64(r[u] + IV512[u]); - } - -#ifdef NEED_HASH_512 - #pragma unroll - for (int u = 4; u < 8; u ++) { - pHash[u] = SWAP64(r[u] + IV512[u]); - } -#endif - } -} - -__host__ -void x17_sha512_cpu_init(int thr_id, uint32_t threads) -{ - cudaMemcpyToSymbol(c_WB, WB, 80*sizeof(uint64_t), 0, cudaMemcpyHostToDevice); -} - -__host__ -void x17_sha512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash) -{ - const uint32_t threadsperblock = 256; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - x17_sha512_gpu_hash_64 <<>> (threads, (uint64_t*)d_hash); -} - -__constant__ -static uint64_t c_PaddedMessage80[10]; - -__global__ -/*__launch_bounds__(256, 4)*/ -void x16_sha512_gpu_hash_80(const uint32_t threads, const uint32_t startNonce, uint64_t *g_hash) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint64_t W[80]; - #pragma unroll - for (int i = 0; i < 9; i ++) { - W[i] = SWAP64(c_PaddedMessage80[i]); - } - const uint32_t nonce = startNonce + thread; - //((uint32_t*)W)[19] = cuda_swab32(nonce); - W[9] = REPLACE_HIDWORD(c_PaddedMessage80[9], cuda_swab32(nonce)); - W[9] = cuda_swab64(W[9]); - W[10] = 0x8000000000000000; - - #pragma unroll - for (int i = 11; i<15; i++) { - W[i] = 0U; - } - W[15] = 0x0000000000000280; - - #pragma unroll 64 - for (int i = 16; i < 80; i ++) { - W[i] = SSG5_1(W[i-2]) + W[i-7]; - W[i] += SSG5_0(W[i-15]) + W[i-16]; - } - - const uint64_t IV512[8] = { - 0x6A09E667F3BCC908, 0xBB67AE8584CAA73B, - 0x3C6EF372FE94F82B, 0xA54FF53A5F1D36F1, - 0x510E527FADE682D1, 0x9B05688C2B3E6C1F, - 0x1F83D9ABFB41BD6B, 0x5BE0CD19137E2179 - }; - - uint64_t r[8]; - #pragma unroll - for (int i = 0; i < 8; i++) { - r[i] = IV512[i]; - } - - #pragma unroll - for (int i = 0; i < 80; i++) { - SHA3_STEP(c_WB, r, W, i&7, i); - } - - const uint64_t hashPosition = thread; - uint64_t *pHash = &g_hash[hashPosition << 3]; - #pragma unroll - for (int u = 0; u < 8; u ++) { - pHash[u] = SWAP64(r[u] + IV512[u]); - } - } -} - -__host__ -void x16_sha512_cuda_hash_80(int thr_id, const uint32_t threads, const uint32_t startNounce, uint32_t *d_hash) -{ - const uint32_t threadsperblock = 256; - - dim3 grid((threads + threadsperblock-1)/threadsperblock); - dim3 block(threadsperblock); - - x16_sha512_gpu_hash_80 <<>> (threads, startNounce, (uint64_t*)d_hash); -} - -__host__ -void x16_sha512_setBlock_80(void *pdata) -{ - cudaMemcpyToSymbol(c_PaddedMessage80, pdata, sizeof(c_PaddedMessage80), 0, cudaMemcpyHostToDevice); -} \ No newline at end of file diff --git a/x17/hmq17.cu b/x17/hmq17.cu deleted file mode 100644 index 8fdbcdf4..00000000 --- a/x17/hmq17.cu +++ /dev/null @@ -1,542 +0,0 @@ -/** - * HMQ1725 algorithm - * @author tpruvot@github 02-2017 - */ - -extern "C" { -#include "sph/sph_blake.h" -#include "sph/sph_bmw.h" -#include "sph/sph_groestl.h" -#include "sph/sph_skein.h" -#include "sph/sph_jh.h" -#include "sph/sph_keccak.h" -#include "sph/sph_luffa.h" -#include "sph/sph_cubehash.h" -#include "sph/sph_shavite.h" -#include "sph/sph_simd.h" -#include "sph/sph_echo.h" -#include "sph/sph_hamsi.h" -#include "sph/sph_fugue.h" -#include "sph/sph_shabal.h" -#include "sph/sph_whirlpool.h" -#include "sph/sph_sha2.h" -#include "sph/sph_haval.h" -} - -#include -#include - -#include "x11/cuda_x11.h" - -static uint32_t *d_hash[MAX_GPUS]; -static uint32_t *d_hash_br2[MAX_GPUS]; -static uint32_t *d_tempBranch[MAX_GPUS]; - -extern void quark_bmw512_cpu_setBlock_80(void *pdata); -extern void quark_bmw512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, int order); - -extern void x11_luffa512_cpu_init(int thr_id, uint32_t threads); -extern void x11_luffa512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void x13_hamsi512_cpu_init(int thr_id, uint32_t threads); -extern void x13_hamsi512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void x13_fugue512_cpu_init(int thr_id, uint32_t threads); -extern void x13_fugue512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -extern void x13_fugue512_cpu_free(int thr_id); - -extern void x14_shabal512_cpu_init(int thr_id, uint32_t threads); -extern void x14_shabal512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void x15_whirlpool_cpu_init(int thr_id, uint32_t threads, int flag); -extern void x15_whirlpool_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -extern void x15_whirlpool_cpu_free(int thr_id); - -extern void x17_sha512_cpu_init(int thr_id, uint32_t threads); -extern void x17_sha512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash); - -extern void x17_haval256_cpu_init(int thr_id, uint32_t threads); -extern void x17_haval256_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, const int outlen); - -struct hmq_contexts -{ - sph_blake512_context blake1, blake2; - sph_bmw512_context bmw1, bmw2, bmw3; - sph_groestl512_context groestl1, groestl2; - sph_skein512_context skein1, skein2; - sph_jh512_context jh1, jh2; - sph_keccak512_context keccak1, keccak2; - sph_luffa512_context luffa1, luffa2; - sph_cubehash512_context cubehash; - sph_shavite512_context shavite1, shavite2; - sph_simd512_context simd1, simd2; - sph_echo512_context echo1, echo2; - sph_hamsi512_context hamsi; - sph_fugue512_context fugue1, fugue2; - sph_shabal512_context shabal; - sph_whirlpool_context whirlpool1, whirlpool2, whirlpool3, whirlpool4; - sph_sha512_context sha1, sha2; - sph_haval256_5_context haval1, haval2; -}; - -static __thread hmq_contexts base_contexts; -static __thread bool hmq_context_init = false; - -static void init_contexts(hmq_contexts *ctx) -{ - sph_bmw512_init(&ctx->bmw1); - sph_bmw512_init(&ctx->bmw2); - sph_bmw512_init(&ctx->bmw2); - sph_bmw512_init(&ctx->bmw3); - sph_whirlpool_init(&ctx->whirlpool1); - sph_whirlpool_init(&ctx->whirlpool2); - sph_whirlpool_init(&ctx->whirlpool3); - sph_whirlpool_init(&ctx->whirlpool4); - sph_groestl512_init(&ctx->groestl1); - sph_groestl512_init(&ctx->groestl2); - sph_skein512_init(&ctx->skein1); - sph_skein512_init(&ctx->skein2); - sph_jh512_init(&ctx->jh1); - sph_jh512_init(&ctx->jh2); - sph_keccak512_init(&ctx->keccak1); - sph_keccak512_init(&ctx->keccak2); - sph_blake512_init(&ctx->blake1); - sph_blake512_init(&ctx->blake2); - sph_luffa512_init(&ctx->luffa1); - sph_luffa512_init(&ctx->luffa2); - sph_cubehash512_init(&ctx->cubehash); - sph_shavite512_init(&ctx->shavite1); - sph_shavite512_init(&ctx->shavite2); - sph_simd512_init(&ctx->simd1); - sph_simd512_init(&ctx->simd2); - sph_echo512_init(&ctx->echo1); - sph_echo512_init(&ctx->echo2); - sph_hamsi512_init(&ctx->hamsi); - sph_fugue512_init(&ctx->fugue1); - sph_fugue512_init(&ctx->fugue2); - sph_shabal512_init(&ctx->shabal); - sph_sha512_init(&ctx->sha1); - sph_sha512_init(&ctx->sha2); - sph_haval256_5_init(&ctx->haval1); - sph_haval256_5_init(&ctx->haval2); -} - -// CPU Check -extern "C" void hmq17hash(void *output, const void *input) -{ - uint32_t _ALIGN(64) hash[32]; - - const uint32_t mask = 24; - - hmq_contexts ctx; - if (!hmq_context_init) { - init_contexts(&base_contexts); - hmq_context_init = true; - } - memcpy(&ctx, &base_contexts, sizeof(hmq_contexts)); - - sph_bmw512(&ctx.bmw1, input, 80); - sph_bmw512_close(&ctx.bmw1, hash); - - sph_whirlpool(&ctx.whirlpool1, hash, 64); - sph_whirlpool_close(&ctx.whirlpool1, hash); - - if (hash[0] & mask) { - sph_groestl512(&ctx.groestl1, hash, 64); - sph_groestl512_close(&ctx.groestl1, hash); - } else { - sph_skein512(&ctx.skein1, hash, 64); - sph_skein512_close(&ctx.skein1, hash); - } - - sph_jh512(&ctx.jh1, hash, 64); - sph_jh512_close(&ctx.jh1, hash); - sph_keccak512(&ctx.keccak1, hash, 64); - sph_keccak512_close(&ctx.keccak1, hash); - - if (hash[0] & mask) { - sph_blake512(&ctx.blake1, hash, 64); - sph_blake512_close(&ctx.blake1, hash); - } else { - sph_bmw512(&ctx.bmw2, hash, 64); - sph_bmw512_close(&ctx.bmw2, hash); - } - - sph_luffa512(&ctx.luffa1, hash, 64); - sph_luffa512_close(&ctx.luffa1, hash); - - sph_cubehash512(&ctx.cubehash, hash, 64); - sph_cubehash512_close(&ctx.cubehash, hash); - - if (hash[0] & mask) { - sph_keccak512(&ctx.keccak2, hash, 64); - sph_keccak512_close(&ctx.keccak2, hash); - } else { - sph_jh512(&ctx.jh2, hash, 64); - sph_jh512_close(&ctx.jh2, hash); - } - - sph_shavite512(&ctx.shavite1, hash, 64); - sph_shavite512_close(&ctx.shavite1, hash); - - sph_simd512(&ctx.simd1, hash, 64); - sph_simd512_close(&ctx.simd1, hash); - //applog_hash(hash); - - if (hash[0] & mask) { - sph_whirlpool(&ctx.whirlpool2, hash, 64); - sph_whirlpool_close(&ctx.whirlpool2, hash); - } else { - sph_haval256_5(&ctx.haval1, hash, 64); - sph_haval256_5_close(&ctx.haval1, hash); - memset(&hash[8], 0, 32); - } - - sph_echo512(&ctx.echo1, hash, 64); - sph_echo512_close(&ctx.echo1, hash); - - sph_blake512(&ctx.blake2, hash, 64); - sph_blake512_close(&ctx.blake2, hash); - //applog_hash(hash); - - if (hash[0] & mask) { - sph_shavite512(&ctx.shavite2, hash, 64); - sph_shavite512_close(&ctx.shavite2, hash); - } else { - sph_luffa512(&ctx.luffa2, hash, 64); - sph_luffa512_close(&ctx.luffa2, hash); - } - - sph_hamsi512(&ctx.hamsi, hash, 64); - sph_hamsi512_close(&ctx.hamsi, hash); - - sph_fugue512(&ctx.fugue1, hash, 64); - sph_fugue512_close(&ctx.fugue1, hash); - //applog_hash(hash); - - if (hash[0] & mask) { - sph_echo512(&ctx.echo2, hash, 64); - sph_echo512_close(&ctx.echo2, hash); - } else { - sph_simd512(&ctx.simd2, hash, 64); - sph_simd512_close(&ctx.simd2, hash); - } - - sph_shabal512(&ctx.shabal, hash, 64); - sph_shabal512_close(&ctx.shabal, hash); - - sph_whirlpool(&ctx.whirlpool3, hash, 64); - sph_whirlpool_close(&ctx.whirlpool3, hash); - //applog_hash(hash); - - if (hash[0] & mask) { - sph_fugue512(&ctx.fugue2, hash, 64); - sph_fugue512_close(&ctx.fugue2, hash); - } else { - sph_sha512(&ctx.sha1, hash, 64); - sph_sha512_close(&ctx.sha1, hash); - } - - sph_groestl512(&ctx.groestl2, hash, 64); - sph_groestl512_close(&ctx.groestl2, hash); - - sph_sha512(&ctx.sha2, hash, 64); - sph_sha512_close(&ctx.sha2, hash); - //applog_hash(hash); - - if (hash[0] & mask) { - sph_haval256_5(&ctx.haval2, hash, 64); - sph_haval256_5_close(&ctx.haval2, hash); - memset(&hash[8], 0, 32); - } else { - sph_whirlpool(&ctx.whirlpool4, hash, 64); - sph_whirlpool_close(&ctx.whirlpool4, hash); - } - //applog_hash(hash); - - sph_bmw512(&ctx.bmw3, hash, 64); - sph_bmw512_close(&ctx.bmw3, hash); - - memcpy(output, hash, 32); -} - -__global__ __launch_bounds__(128, 8) -void hmq_filter_gpu(const uint32_t threads, const uint32_t* d_hash, uint32_t* d_branch2, uint32_t* d_NonceBranch) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const uint32_t offset = thread * 16U; // 64U / sizeof(uint32_t); - uint4 *psrc = (uint4*) (&d_hash[offset]); - d_NonceBranch[thread] = ((uint8_t*)psrc)[0] & 24U; - if (d_NonceBranch[thread]) return; - // uint4 = 4x uint32_t = 16 bytes - uint4 *pdst = (uint4*) (&d_branch2[offset]); - pdst[0] = psrc[0]; - pdst[1] = psrc[1]; - pdst[2] = psrc[2]; - pdst[3] = psrc[3]; - } -} - -__global__ __launch_bounds__(128, 8) -void hmq_merge_gpu(const uint32_t threads, uint32_t* d_hash, uint32_t* d_branch2, uint32_t* const d_NonceBranch) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads && !d_NonceBranch[thread]) - { - const uint32_t offset = thread * 16U; - uint4 *pdst = (uint4*) (&d_hash[offset]); - uint4 *psrc = (uint4*) (&d_branch2[offset]); - pdst[0] = psrc[0]; - pdst[1] = psrc[1]; - pdst[2] = psrc[2]; - pdst[3] = psrc[3]; - } -} - -__host__ -uint32_t hmq_filter_cpu(const int thr_id, const uint32_t threads, const uint32_t *inpHashes, uint32_t* d_branch2) -{ - const uint32_t threadsperblock = 128; - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - // extract algo permution hashes to a second branch buffer - hmq_filter_gpu <<>> (threads, inpHashes, d_branch2, d_tempBranch[thr_id]); - return threads; -} - -__host__ -void hmq_merge_cpu(const int thr_id, const uint32_t threads, uint32_t *outpHashes, uint32_t* d_branch2) -{ - const uint32_t threadsperblock = 128; - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - // put back second branch hashes to the common buffer d_hash - hmq_merge_gpu <<>> (threads, outpHashes, d_branch2, d_tempBranch[thr_id]); -} - -static bool init[MAX_GPUS] = { 0 }; - -//#define _DEBUG -#define _DEBUG_PREFIX "hmq-" -#include "cuda_debug.cuh" - -extern "C" int scanhash_hmq17(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - - uint32_t throughput = cuda_default_throughput(thr_id, 1U << 19); // 19=256*256*8; - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ((uint32_t*)ptarget)[7] = 0x00ff; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", - throughput2intensity(throughput), throughput); - - quark_bmw512_cpu_init(thr_id, throughput); - x15_whirlpool_cpu_init(thr_id, throughput, 0); - quark_groestl512_cpu_init(thr_id, throughput); - quark_skein512_cpu_init(thr_id, throughput); - quark_jh512_cpu_init(thr_id, throughput); - quark_blake512_cpu_init(thr_id, throughput); - x11_luffaCubehash512_cpu_init(thr_id, throughput); - quark_keccak512_cpu_init(thr_id, throughput); - x11_simd512_cpu_init(thr_id, throughput); - x17_haval256_cpu_init(thr_id, throughput); - x11_echo512_cpu_init(thr_id, throughput); - x11_shavite512_cpu_init(thr_id, throughput); - x11_luffa512_cpu_init(thr_id, throughput); - x13_hamsi512_cpu_init(thr_id, throughput); - x13_fugue512_cpu_init(thr_id, throughput); - x14_shabal512_cpu_init(thr_id, throughput); - x17_sha512_cpu_init(thr_id, throughput); - - CUDA_CALL_OR_RET_X(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput), 0); - CUDA_CALL_OR_RET_X(cudaMalloc(&d_hash_br2[thr_id], (size_t) 64 * throughput), 0); - CUDA_CALL_OR_RET_X(cudaMalloc(&d_tempBranch[thr_id], sizeof(uint32_t) * throughput), 0); - - cuda_check_cpu_init(thr_id, throughput); - - init[thr_id] = true; - } - - int warn = 0; - uint32_t endiandata[20]; - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - quark_bmw512_cpu_setBlock_80(endiandata); - cuda_check_cpu_setTarget(ptarget); - - do { - int order = 0; - - // Hash with CUDA - quark_bmw512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], order++); - TRACE("bmw512 "); - x15_whirlpool_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("whirl "); - - hmq_filter_cpu(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - quark_groestl512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash_br2[thr_id], order++); - hmq_merge_cpu(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - - quark_jh512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_keccak512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("keccak "); - - hmq_filter_cpu(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - quark_blake512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_bmw512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash_br2[thr_id], order++); - hmq_merge_cpu(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - - x11_luffaCubehash512_cpu_hash_64(thr_id, throughput, d_hash[thr_id], order++); - TRACE("cube "); - - hmq_filter_cpu(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - quark_keccak512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_jh512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash_br2[thr_id], order++); - hmq_merge_cpu(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - - x11_shavite512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_simd512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("simd "); - - hmq_filter_cpu(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - x15_whirlpool_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x17_haval256_cpu_hash_64(thr_id, throughput, pdata[19], d_hash_br2[thr_id], 512); order++; - hmq_merge_cpu(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - - x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_blake512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("blake "); - - hmq_filter_cpu(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - x11_shavite512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_luffa512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash_br2[thr_id], order++); - hmq_merge_cpu(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - - x13_hamsi512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x13_fugue512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("fugue "); - - hmq_filter_cpu(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_simd512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash_br2[thr_id], order++); - hmq_merge_cpu(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - - x14_shabal512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x15_whirlpool_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("whirl "); - - hmq_filter_cpu(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - x13_fugue512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x17_sha512_cpu_hash_64(thr_id, throughput, pdata[19], d_hash_br2[thr_id]); order++; - hmq_merge_cpu(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - - quark_groestl512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x17_sha512_cpu_hash_64(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - TRACE("sha512 "); - - hmq_filter_cpu(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - x17_haval256_cpu_hash_64(thr_id, throughput, pdata[19], d_hash[thr_id], 512); order++; - x15_whirlpool_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash_br2[thr_id], order++); - hmq_merge_cpu(thr_id, throughput, d_hash[thr_id], d_hash_br2[thr_id]); - TRACE("hav/wh "); - - quark_bmw512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - TRACE("bmw512 => "); - - *hashes_done = pdata[19] - first_nonce + throughput; - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - be32enc(&endiandata[19], work->nonces[0]); - hmq17hash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - work_set_target_ratio(work, vhash); - if (work->nonces[1] != 0 && work->nonces[1] != work->nonces[0]) { - be32enc(&endiandata[19], work->nonces[1]); - hmq17hash(vhash, endiandata); - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - } else if (vhash[7] > Htarg) { - gpu_increment_reject(thr_id); - } - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - // x11+ coins could do some random error, but not on retry - gpu_increment_reject(thr_id); - if (!warn) { - warn++; - pdata[19] = work->nonces[0] + 1; - continue; - } else { - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - warn = 0; - } - } - } - - if ((uint64_t)throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (pdata[19] < max_nonce && !work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - return 0; -} - -// cleanup -extern "C" void free_hmq17(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - cudaFree(d_hash_br2[thr_id]); - cudaFree(d_tempBranch[thr_id]); - - quark_blake512_cpu_free(thr_id); - quark_groestl512_cpu_free(thr_id); - x11_simd512_cpu_free(thr_id); - x13_fugue512_cpu_free(thr_id); - x15_whirlpool_cpu_free(thr_id); - - cuda_check_cpu_free(thr_id); - - cudaDeviceSynchronize(); - init[thr_id] = false; -} diff --git a/x17/x17.cu b/x17/x17.cu deleted file mode 100644 index 816e5e06..00000000 --- a/x17/x17.cu +++ /dev/null @@ -1,304 +0,0 @@ -/** - * X17 algorithm (X15 + sha512 + haval256) - */ - -extern "C" { -#include "sph/sph_blake.h" -#include "sph/sph_bmw.h" -#include "sph/sph_groestl.h" -#include "sph/sph_skein.h" -#include "sph/sph_jh.h" -#include "sph/sph_keccak.h" - -#include "sph/sph_luffa.h" -#include "sph/sph_cubehash.h" -#include "sph/sph_shavite.h" -#include "sph/sph_simd.h" -#include "sph/sph_echo.h" - -#include "sph/sph_hamsi.h" -#include "sph/sph_fugue.h" - -#include "sph/sph_shabal.h" -#include "sph/sph_whirlpool.h" - -#include "sph/sph_sha2.h" -#include "sph/sph_haval.h" -} - -#include "miner.h" -#include "cuda_helper.h" -#include "x11/cuda_x11.h" - -static uint32_t *d_hash[MAX_GPUS]; - -extern void x13_hamsi512_cpu_init(int thr_id, uint32_t threads); -extern void x13_hamsi512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void x13_fugue512_cpu_init(int thr_id, uint32_t threads); -extern void x13_fugue512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -extern void x13_fugue512_cpu_free(int thr_id); - -extern void x14_shabal512_cpu_init(int thr_id, uint32_t threads); -extern void x14_shabal512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void x15_whirlpool_cpu_init(int thr_id, uint32_t threads, int flag); -extern void x15_whirlpool_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -extern void x15_whirlpool_cpu_free(int thr_id); - -extern void x17_sha512_cpu_init(int thr_id, uint32_t threads); -extern void x17_sha512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash); - -extern void x17_haval256_cpu_init(int thr_id, uint32_t threads); -extern void x17_haval256_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, const int outlen); - - -// X17 CPU Hash (Validation) -extern "C" void x17hash(void *output, const void *input) -{ - unsigned char _ALIGN(64) hash[128]; - - // x11 + hamsi12-fugue13-shabal14-whirlpool15-sha512-haval256 - - sph_blake512_context ctx_blake; - sph_bmw512_context ctx_bmw; - sph_groestl512_context ctx_groestl; - sph_jh512_context ctx_jh; - sph_keccak512_context ctx_keccak; - sph_skein512_context ctx_skein; - sph_luffa512_context ctx_luffa; - sph_cubehash512_context ctx_cubehash; - sph_shavite512_context ctx_shavite; - sph_simd512_context ctx_simd; - sph_echo512_context ctx_echo; - sph_hamsi512_context ctx_hamsi; - sph_fugue512_context ctx_fugue; - sph_shabal512_context ctx_shabal; - sph_whirlpool_context ctx_whirlpool; - sph_sha512_context ctx_sha512; - sph_haval256_5_context ctx_haval; - - - sph_blake512_init(&ctx_blake); - sph_blake512(&ctx_blake, input, 80); - sph_blake512_close(&ctx_blake, hash); - - sph_bmw512_init(&ctx_bmw); - sph_bmw512(&ctx_bmw, (const void*) hash, 64); - sph_bmw512_close(&ctx_bmw, hash); - - sph_groestl512_init(&ctx_groestl); - sph_groestl512(&ctx_groestl, (const void*) hash, 64); - sph_groestl512_close(&ctx_groestl, hash); - - sph_skein512_init(&ctx_skein); - sph_skein512(&ctx_skein, (const void*) hash, 64); - sph_skein512_close(&ctx_skein, hash); - - sph_jh512_init(&ctx_jh); - sph_jh512(&ctx_jh, (const void*) hash, 64); - sph_jh512_close(&ctx_jh, hash); - - sph_keccak512_init(&ctx_keccak); - sph_keccak512(&ctx_keccak, (const void*) hash, 64); - sph_keccak512_close(&ctx_keccak, hash); - - sph_luffa512_init(&ctx_luffa); - sph_luffa512(&ctx_luffa, (const void*) hash, 64); - sph_luffa512_close (&ctx_luffa, hash); - - sph_cubehash512_init(&ctx_cubehash); - sph_cubehash512(&ctx_cubehash, (const void*) hash, 64); - sph_cubehash512_close(&ctx_cubehash, hash); - - sph_shavite512_init(&ctx_shavite); - sph_shavite512(&ctx_shavite, (const void*) hash, 64); - sph_shavite512_close(&ctx_shavite, hash); - - sph_simd512_init(&ctx_simd); - sph_simd512(&ctx_simd, (const void*) hash, 64); - sph_simd512_close(&ctx_simd, hash); - - sph_echo512_init(&ctx_echo); - sph_echo512(&ctx_echo, (const void*) hash, 64); - sph_echo512_close(&ctx_echo, hash); - - sph_hamsi512_init(&ctx_hamsi); - sph_hamsi512(&ctx_hamsi, (const void*) hash, 64); - sph_hamsi512_close(&ctx_hamsi, hash); - - sph_fugue512_init(&ctx_fugue); - sph_fugue512(&ctx_fugue, (const void*) hash, 64); - sph_fugue512_close(&ctx_fugue, hash); - - sph_shabal512_init(&ctx_shabal); - sph_shabal512(&ctx_shabal, (const void*) hash, 64); - sph_shabal512_close(&ctx_shabal, hash); - - sph_whirlpool_init(&ctx_whirlpool); - sph_whirlpool (&ctx_whirlpool, (const void*) hash, 64); - sph_whirlpool_close(&ctx_whirlpool, hash); - - sph_sha512_init(&ctx_sha512); - sph_sha512(&ctx_sha512,(const void*) hash, 64); - sph_sha512_close(&ctx_sha512,(void*) hash); - - sph_haval256_5_init(&ctx_haval); - sph_haval256_5(&ctx_haval,(const void*) hash, 64); - sph_haval256_5_close(&ctx_haval,hash); - - memcpy(output, hash, 32); -} - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_x17(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t first_nonce = pdata[19]; - - uint32_t throughput = cuda_default_throughput(thr_id, 1U << 19); // 19=256*256*8; - //if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ((uint32_t*)ptarget)[7] = 0x00ff; - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - quark_blake512_cpu_init(thr_id, throughput); - quark_groestl512_cpu_init(thr_id, throughput); - quark_skein512_cpu_init(thr_id, throughput); - quark_bmw512_cpu_init(thr_id, throughput); - quark_keccak512_cpu_init(thr_id, throughput); - quark_jh512_cpu_init(thr_id, throughput); - x11_luffaCubehash512_cpu_init(thr_id, throughput); - x11_shavite512_cpu_init(thr_id, throughput); - x11_simd512_cpu_init(thr_id, throughput); - x11_echo512_cpu_init(thr_id, throughput); - x13_hamsi512_cpu_init(thr_id, throughput); - x13_fugue512_cpu_init(thr_id, throughput); - x14_shabal512_cpu_init(thr_id, throughput); - x15_whirlpool_cpu_init(thr_id, throughput, 0); - x17_sha512_cpu_init(thr_id, throughput); - x17_haval256_cpu_init(thr_id, throughput); - - CUDA_CALL_OR_RET_X(cudaMalloc(&d_hash[thr_id], 16 * sizeof(uint32_t) * throughput), 0); - - cuda_check_cpu_init(thr_id, throughput); - - init[thr_id] = true; - } - - uint32_t _ALIGN(64) endiandata[20]; - for (int k=0; k < 20; k++) - be32enc(&endiandata[k], pdata[k]); - - quark_blake512_cpu_setBlock_80(thr_id, endiandata); - cuda_check_cpu_setTarget(ptarget); - - int warn = 0; - - do { - int order = 0; - - // Hash with CUDA - quark_blake512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - quark_bmw512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_groestl512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_jh512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - quark_keccak512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_luffaCubehash512_cpu_hash_64(thr_id, throughput, d_hash[thr_id], order++); - x11_shavite512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_simd512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x13_hamsi512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x13_fugue512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x14_shabal512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x15_whirlpool_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++); - x17_sha512_cpu_hash_64(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; - x17_haval256_cpu_hash_64(thr_id, throughput, pdata[19], d_hash[thr_id], 256); order++; - - *hashes_done = pdata[19] - first_nonce + throughput; - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - if (work->nonces[0] != UINT32_MAX) - { - const uint32_t Htarg = ptarget[7]; - uint32_t _ALIGN(64) vhash[8]; - be32enc(&endiandata[19], work->nonces[0]); - x17hash(vhash, endiandata); - - if (vhash[7] <= Htarg && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - work_set_target_ratio(work, vhash); - if (work->nonces[1] != 0) { - be32enc(&endiandata[19], work->nonces[1]); - x17hash(vhash, endiandata); - bn_set_target_ratio(work, vhash, 1); - work->valid_nonces++; - pdata[19] = max(work->nonces[0], work->nonces[1]) + 1; - } else { - pdata[19] = work->nonces[0] + 1; // cursor - } - return work->valid_nonces; - } - else if (vhash[7] > Htarg) { - // x11+ coins could do some random error, but not on retry - gpu_increment_reject(thr_id); - if (!warn) { - warn++; - pdata[19] = work->nonces[0] + 1; - continue; - } else { - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - warn = 0; - } - } - } - - if ((uint64_t)throughput + pdata[19] >= max_nonce) { - pdata[19] = max_nonce; - break; - } - - pdata[19] += throughput; - - } while (pdata[19] < max_nonce && !work_restart[thr_id].restart); - - *hashes_done = pdata[19] - first_nonce; - return 0; -} - -// cleanup -extern "C" void free_x17(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - - quark_blake512_cpu_free(thr_id); - quark_groestl512_cpu_free(thr_id); - x11_simd512_cpu_free(thr_id); - x13_fugue512_cpu_free(thr_id); - x15_whirlpool_cpu_free(thr_id); - - cuda_check_cpu_free(thr_id); - - cudaDeviceSynchronize(); - init[thr_id] = false; -} diff --git a/zr5.cu b/zr5.cu deleted file mode 100644 index 11140b0f..00000000 --- a/zr5.cu +++ /dev/null @@ -1,514 +0,0 @@ -/* Ziftrcoin ZR5 CUDA Implementation, (c) tpruvot 2015 */ - -extern "C" { -#include "sph/sph_blake.h" -#include "sph/sph_groestl.h" -#include "sph/sph_skein.h" -#include "sph/sph_jh.h" -#include "sph/sph_keccak.h" -} - -#include "miner.h" -#include "cuda_helper.h" - -#include -#include - -#define ZR_BLAKE 0 -#define ZR_GROESTL 1 -#define ZR_JH512 2 -#define ZR_SKEIN 3 - -#define POK_BOOL_MASK 0x00008000 -#define POK_DATA_MASK 0xFFFF0000 - -static uint32_t* d_hash[MAX_GPUS]; -static uint16_t* d_poks[MAX_GPUS]; - -static uint32_t**d_buffers[MAX_GPUS]; -static uint8_t* d_permut[MAX_GPUS]; - -static uint32_t* d_blake[MAX_GPUS]; -static uint32_t* d_groes[MAX_GPUS]; -static uint32_t* d_jh512[MAX_GPUS]; -static uint32_t* d_skein[MAX_GPUS]; - -static uint8_t* d_txs[MAX_GPUS]; -__constant__ uint16_t c_txlens[POK_MAX_TXS]; - -__constant__ uint8_t c_permut[24][4]; -static const uint8_t permut[24][4] = { - {0, 1, 2, 3}, - {0, 1, 3, 2}, - {0, 2, 1, 3}, - {0, 2, 3, 1}, - {0, 3, 1, 2}, - {0, 3, 2, 1}, - {1, 0, 2, 3}, - {1, 0, 3, 2}, - {1, 2, 0, 3}, - {1, 2, 3, 0}, - {1, 3, 0, 2}, - {1, 3, 2, 0}, - {2, 0, 1, 3}, - {2, 0, 3, 1}, - {2, 1, 0, 3}, - {2, 1, 3, 0}, - {2, 3, 0, 1}, - {2, 3, 1, 0}, - {3, 0, 1, 2}, - {3, 0, 2, 1}, - {3, 1, 0, 2}, - {3, 1, 2, 0}, - {3, 2, 0, 1}, - {3, 2, 1, 0} -}; - -// CPU HASH -extern "C" void zr5hash(void *output, const void *input) -{ - sph_keccak512_context ctx_keccak; - sph_blake512_context ctx_blake; - sph_groestl512_context ctx_groestl; - sph_jh512_context ctx_jh; - sph_skein512_context ctx_skein; - - uchar _ALIGN(64) hash[64]; - uint32_t *phash = (uint32_t *) hash; - uint32_t norder; - - sph_keccak512_init(&ctx_keccak); - sph_keccak512(&ctx_keccak, (const void*) input, 80); - sph_keccak512_close(&ctx_keccak, (void*) phash); - - norder = phash[0] % ARRAY_SIZE(permut); /* % 24 */ - - for(int i = 0; i < 4; i++) - { - switch (permut[norder][i]) { - case ZR_BLAKE: - sph_blake512_init(&ctx_blake); - sph_blake512(&ctx_blake, (const void*) phash, 64); - sph_blake512_close(&ctx_blake, phash); - break; - case ZR_GROESTL: - sph_groestl512_init(&ctx_groestl); - sph_groestl512(&ctx_groestl, (const void*) phash, 64); - sph_groestl512_close(&ctx_groestl, phash); - break; - case ZR_JH512: - sph_jh512_init(&ctx_jh); - sph_jh512(&ctx_jh, (const void*) phash, 64); - sph_jh512_close(&ctx_jh, phash); - break; - case ZR_SKEIN: - sph_skein512_init(&ctx_skein); - sph_skein512(&ctx_skein, (const void*) phash, 64); - sph_skein512_close(&ctx_skein, phash); - break; - default: - break; - } - } - memcpy(output, phash, 32); -} - -extern "C" void zr5hash_pok(void *output, uint32_t *pdata) -{ - uint32_t _ALIGN(64) hash[8]; - const uint32_t version = (pdata[0] & (~POK_DATA_MASK)) | (use_pok ? POK_BOOL_MASK : 0); - - pdata[0] = version; - zr5hash(hash, pdata); - - // fill PoK - pdata[0] = version | (hash[0] & POK_DATA_MASK); - zr5hash(hash, pdata); - - memcpy(output, hash, 32); -} - -// ------------------------------------------------------------------------------------------------ - -__global__ __launch_bounds__(128, 8) -void zr5_init_vars_gpu(uint32_t threads, uint32_t* d_hash, uint8_t* d_permut, uint32_t** d_buffers, - uint32_t* d_blake, uint32_t* d_groes, uint32_t* d_jh512, uint32_t* d_skein) -{ - uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - uint32_t offset = thread * 16U; // 64U / sizeof(uint32_t); - uint32_t *phash = &d_hash[offset]; - - // store the algos order for other procs - const uint8_t norder = (phash[0] % ARRAY_SIZE(permut)); - const uint8_t algo = c_permut[norder][0]; - d_permut[thread] = norder; - - // init array for other procs - d_buffers[0] = d_blake; - d_buffers[1] = d_groes; - d_buffers[2] = d_jh512; - d_buffers[3] = d_skein; - - // Copy From d_hash to the first algo buffer - // uint4 = 4x uint32_t = 16 bytes - uint4 *psrc = (uint4*) phash; - uint4 *pdst = (uint4*) (d_buffers[algo] + offset); - pdst[0] = psrc[0]; - pdst[1] = psrc[1]; - pdst[2] = psrc[2]; - pdst[3] = psrc[3]; - } -} - -__host__ -void zr5_init_vars(int thr_id, uint32_t threads) -{ - const uint32_t threadsperblock = 128; - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - - zr5_init_vars_gpu <<>> ( - threads, d_hash[thr_id], d_permut[thr_id], d_buffers[thr_id], - d_blake[thr_id], d_groes[thr_id], d_jh512[thr_id], d_skein[thr_id] - ); -} - - -__global__ __launch_bounds__(128, 8) -void zr5_move_data_to_hash_gpu(const uint32_t threads, const int rnd, uint32_t** const d_buffers, uint8_t *d_permut, uint32_t *d_hash) -{ - // copy 64 bytes hash from/to the right algo buffers - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const uint8_t norder = d_permut[thread]; - const uint8_t algodst = c_permut[norder][rnd]; - const uint8_t algosrc = c_permut[norder][rnd-1]; - - const uint32_t offset = thread * (64 / 4); - - // uint4 = 4x uint32_t = 16 bytes - uint4 *psrc = (uint4*) (d_buffers[algosrc] + offset); - uint4 *pdst = (uint4*) (d_buffers[algodst] + offset); - pdst[0] = psrc[0]; - pdst[1] = psrc[1]; - pdst[2] = psrc[2]; - pdst[3] = psrc[3]; - } -} - -__host__ -void zr5_move_data_to_hash(int thr_id, uint32_t threads, int rnd) -{ - const uint32_t threadsperblock = 128; - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - - zr5_move_data_to_hash_gpu <<>> (threads, rnd, d_buffers[thr_id], d_permut[thr_id], d_hash[thr_id]); -} - - -__global__ __launch_bounds__(128, 8) -void zr5_get_poks_gpu(uint32_t threads, uint32_t** const d_buffers, uint8_t* const d_permut, uint16_t *d_poks) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const uint8_t norder = d_permut[thread]; - const uint8_t algosrc = c_permut[norder][3]; - - // copy only pok - const uint32_t offset = thread * 16U; // 64 / 4; - uint16_t* hash0 = (uint16_t*) (d_buffers[algosrc] + offset); - d_poks[thread] = hash0[1]; - } -} - -__global__ __launch_bounds__(128, 4) -void zr5_get_poks_xor_gpu(uint32_t threads, uint32_t** const d_buffers, uint8_t* d_permut, uint16_t* d_poks, uint8_t* d_txs, uint8_t txs) -{ - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const uint8_t norder = d_permut[thread]; - const uint8_t algo = c_permut[norder][3]; - const uint8_t ntx = norder % txs; // generally 0 on testnet... - const uint32_t offset = thread * 16U; // 64 / 4; - uint32_t* hash = (uint32_t*) (d_buffers[algo] + offset); - uint32_t randNdx = hash[1] % c_txlens[ntx]; - uint8_t* ptx = &d_txs[POK_MAX_TX_SZ*ntx] + randNdx; - uint32_t x = 0x100UL * ptx[3] + ptx[2]; - - d_poks[thread] = x ^ (hash[2] >> 16); - } -} - -__host__ -void zr5_get_poks(int thr_id, uint32_t threads, uint16_t* d_poks, struct work* work) -{ - const uint32_t threadsperblock = 128; - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - - uint8_t txs = (uint8_t) work->tx_count; - - if (txs && use_pok) - { - uint32_t txlens[POK_MAX_TXS]; - uint8_t* txdata = (uint8_t*) calloc(POK_MAX_TXS, POK_MAX_TX_SZ); - if (!txdata) { - applog(LOG_ERR, "%s: error, memory alloc failure", __func__); - return; - } - // create blocs to copy on device - for (uint8_t tx=0; tx < txs; tx++) { - txlens[tx] = (uint32_t) (work->txs[tx].len - 3U); - memcpy(&txdata[POK_MAX_TX_SZ*tx], work->txs[tx].data, min(POK_MAX_TX_SZ, txlens[tx]+3U)); - } - cudaMemcpy(d_txs[thr_id], txdata, txs * POK_MAX_TX_SZ, cudaMemcpyHostToDevice); - CUDA_SAFE_CALL(cudaMemcpyToSymbol(c_txlens, txlens, txs * sizeof(uint32_t), 0, cudaMemcpyHostToDevice)); - zr5_get_poks_xor_gpu <<>> (threads, d_buffers[thr_id], d_permut[thr_id], d_poks, d_txs[thr_id], txs); - free(txdata); - } else { - zr5_get_poks_gpu <<>> (threads, d_buffers[thr_id], d_permut[thr_id], d_poks); - } -} - - -__global__ __launch_bounds__(128, 8) -void zr5_final_round_data_gpu(uint32_t threads, uint32_t** const d_buffers, uint8_t* const d_permut, uint32_t *d_hash, uint16_t *d_poks) -{ - // after the 4 algos rounds, copy back hash to d_hash - const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); - if (thread < threads) - { - const uint8_t norder = d_permut[thread]; - const uint8_t algosrc = c_permut[norder][3]; - const uint32_t offset = thread * 16U; // 64 / 4; - - // copy only hash[4..7] - uint2 *psrc = (uint2*) (d_buffers[algosrc] + offset); - uint2 *phash = (uint2*) (&d_hash[offset]); - - phash[2] = psrc[2]; - phash[3] = psrc[3]; - } -} - -__host__ -void zr5_final_round(int thr_id, uint32_t threads) -{ - const uint32_t threadsperblock = 128; - dim3 grid((threads + threadsperblock - 1) / threadsperblock); - dim3 block(threadsperblock); - - zr5_final_round_data_gpu <<>> (threads, d_buffers[thr_id], d_permut[thr_id], d_hash[thr_id], d_poks[thr_id]); -} - - -extern void jackpot_keccak512_cpu_init(int thr_id, uint32_t threads); -extern void jackpot_keccak512_cpu_setBlock(void *pdata, size_t inlen); - -extern void zr5_keccak512_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash); -extern void zr5_keccak512_cpu_hash_pok(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t* pdata, uint32_t *d_hash, uint16_t *d_poks); - -extern void quark_blake512_cpu_init(int thr_id, uint32_t threads); -extern void quark_blake512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -extern void quark_blake512_cpu_free(int thr_id); - -extern void quark_groestl512_cpu_init(int thr_id, uint32_t threads); -extern void quark_groestl512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); -extern void quark_groestl512_cpu_free(int thr_id); - -extern void quark_jh512_cpu_init(int thr_id, uint32_t threads); -extern void quark_jh512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -extern void quark_skein512_cpu_init(int thr_id, uint32_t threads); -extern void quark_skein512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); - -static bool init[MAX_GPUS] = { 0 }; - -extern "C" int scanhash_zr5(int thr_id, struct work *work, - uint32_t max_nonce, unsigned long *hashes_done) -{ - uint32_t _ALIGN(64) tmpdata[20]; - uint32_t *pdata = work->data; - uint32_t *ptarget = work->target; - const uint32_t oldp0 = pdata[0]; - const uint32_t version = (oldp0 & (~POK_DATA_MASK)) | (use_pok ? POK_BOOL_MASK : 0); - const uint32_t first_nonce = pdata[19]; - uint32_t throughput = cuda_default_throughput(thr_id, 1U << 18); - throughput = min(throughput, (1U << 20)-1024); - if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce); - - if (opt_benchmark) - ptarget[7] = 0x0000ff; - - memcpy(tmpdata, pdata, 80); - - if (!init[thr_id]) - { - cudaSetDevice(device_map[thr_id]); - if (opt_cudaschedule == -1 && gpu_threads == 1) { - cudaDeviceReset(); - // reduce cpu usage - cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); - CUDA_LOG_ERROR(); - } - gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); - - // constants - cudaMemcpyToSymbol(c_permut, permut, 24*4, 0, cudaMemcpyHostToDevice); - - // hash buffer = keccak hash 64 required - cudaMalloc(&d_hash[thr_id], 64 * throughput); - cudaMalloc(&d_poks[thr_id], sizeof(uint16_t) * throughput); - cudaMalloc(&d_permut[thr_id], sizeof(uint8_t) * throughput); - cudaMalloc(&d_buffers[thr_id], 4 * sizeof(uint32_t*)); - - // data buffers for the 4 rounds - cudaMalloc(&d_blake[thr_id], 64 * throughput); - cudaMalloc(&d_groes[thr_id], 64 * throughput); - cudaMalloc(&d_jh512[thr_id], 64 * throughput); - cudaMalloc(&d_skein[thr_id], 64 * throughput); - - cudaMalloc(&d_txs[thr_id], POK_MAX_TXS * POK_MAX_TX_SZ); - - jackpot_keccak512_cpu_init(thr_id, throughput); - - quark_blake512_cpu_init(thr_id, throughput); - quark_groestl512_cpu_init(thr_id, throughput); - quark_jh512_cpu_init(thr_id, throughput); - quark_skein512_cpu_init(thr_id, throughput); - - cuda_check_cpu_init(thr_id, throughput); - - CUDA_SAFE_CALL(cudaDeviceSynchronize()); - - init[thr_id] = true; - } - - tmpdata[0] = version; - jackpot_keccak512_cpu_setBlock((void*)tmpdata, 80); - cuda_check_cpu_setTarget(ptarget); - - do { - int order = 0; - - // Keccak512 Hash with CUDA - zr5_keccak512_cpu_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - zr5_init_vars(thr_id, throughput); - - for (int rnd=0; rnd<4; rnd++) { - if (rnd > 0) - zr5_move_data_to_hash(thr_id, throughput, rnd); - quark_blake512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_blake[thr_id], order++); - quark_groestl512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_groes[thr_id], order++); - quark_jh512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_jh512[thr_id], order++); - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_skein[thr_id], order++); - } - - // store on device d_poks all hash[0] prefixes - zr5_get_poks(thr_id, throughput, d_poks[thr_id], work); - - // Keccak512 with pok - zr5_keccak512_cpu_hash_pok(thr_id, throughput, pdata[19], pdata, d_hash[thr_id], d_poks[thr_id]); - zr5_init_vars(thr_id, throughput); - - for (int rnd=0; rnd<4; rnd++) { - if (rnd > 0) - zr5_move_data_to_hash(thr_id, throughput, rnd); - quark_blake512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_blake[thr_id], order++); - quark_groestl512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_groes[thr_id], order++); - quark_jh512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_jh512[thr_id], order++); - quark_skein512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_skein[thr_id], order++); - } - zr5_final_round(thr_id, throughput); - - // do not scan results on interuption - if (work_restart[thr_id].restart) - return -1; - - work->nonces[0] = cuda_check_hash(thr_id, throughput, pdata[19], d_hash[thr_id]); - if (work->nonces[0] != UINT32_MAX) - { - uint32_t _ALIGN(64) vhash[8]; - uint32_t oldp19 = pdata[19]; - uint32_t offset = work->nonces[0] - pdata[19]; - uint32_t pok = 0; - uint16_t h_pok; - - *hashes_done = pdata[19] - first_nonce + throughput; - - cudaMemcpy(&h_pok, d_poks[thr_id] + offset, sizeof(uint16_t), cudaMemcpyDeviceToHost); - pok = version | (0x10000UL * h_pok); - pdata[0] = pok; pdata[19] = work->nonces[0]; - zr5hash(vhash, pdata); - if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { - work->valid_nonces = 1; - work_set_target_ratio(work, vhash); - work->nonces[1] = cuda_check_hash_suppl(thr_id, throughput, oldp19, d_hash[thr_id], 1); - if (work->nonces[1] != 0) { - offset = work->nonces[1] - oldp19; - cudaMemcpy(&h_pok, d_poks[thr_id] + offset, sizeof(uint16_t), cudaMemcpyDeviceToHost); - pok = version | (0x10000UL * h_pok); - memcpy(tmpdata, pdata, 80); - tmpdata[0] = pok; tmpdata[19] = work->nonces[1]; - zr5hash(vhash, tmpdata); - if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { - bn_set_target_ratio(work, vhash, 1); - pdata[19] = max(pdata[19], work->nonces[1]); // cursor - pdata[20] = pok; // second nonce "pok" - work->valid_nonces++; - } - pdata[19]++; - } - return work->valid_nonces; - } - else if (vhash[7] > ptarget[7]) { - gpu_increment_reject(thr_id); - if (!opt_quiet) - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); - pdata[0] = oldp0; - } - } else - pdata[19] += throughput; - - } while (pdata[19] < max_nonce && !work_restart[thr_id].restart); - - pdata[0] = oldp0; - - *hashes_done = pdata[19] - first_nonce + 1; - return 0; -} - -// cleanup -extern "C" void free_zr5(int thr_id) -{ - if (!init[thr_id]) - return; - - cudaThreadSynchronize(); - - cudaFree(d_hash[thr_id]); - - cudaFree(d_poks[thr_id]); - cudaFree(d_permut[thr_id]); - cudaFree(d_buffers[thr_id]); - - cudaFree(d_blake[thr_id]); - cudaFree(d_groes[thr_id]); - cudaFree(d_jh512[thr_id]); - cudaFree(d_skein[thr_id]); - - cudaFree(d_txs[thr_id]); - - quark_blake512_cpu_free(thr_id); - quark_groestl512_cpu_free(thr_id); - cuda_check_cpu_free(thr_id); - init[thr_id] = false; - - cudaDeviceSynchronize(); -}