forked from KengoSawa2/RapidCopy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tapi32ex.cpp
400 lines (382 loc) · 30.6 KB
/
tapi32ex.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
static char *tap32ex_id =
"@(#)Copyright (C) 1996-2011 H.Shirouzu tap32ex.cpp Ver0.99";
/* ========================================================================
Project Name : Win32 Lightweight Class Library Test
Module Name : Application Frame Class
Create : 1996-06-01(Sat)
Update : 2011-03-27(Sun)
ported update : 2016-02-28
Copyright : H.Shirouzu,Kengo Sawatsu
Summary :
Reference :
======================================================================== */
#include "tlib.h"
#include "osl.h"
TDigest::TDigest()
{
hHash = NULL;
xxHash = NULL;
}
TDigest::~TDigest()
{
if(hHash != NULL){
delete hHash;
hHash = NULL;
}
if(xxHash != NULL){
XXH64_freeState(xxHash);
xxHash = NULL;
}
}
BOOL TDigest::Init(TDigest::Type _type)
{
type = _type;
if(type == MD5 ||
type == SHA1 ||
type == SHA2_256 ||
type == SHA2_512 ||
type == SHA3_256 ||
type == SHA3_512){
if (hHash != NULL) {
delete hHash;
hHash = NULL;
}
updateSize = 0;
hHash = new QCryptographicHash(type == SHA1 ? QCryptographicHash::Sha1 :
type == MD5 ? QCryptographicHash::Md5 :
type == SHA2_256 ? QCryptographicHash::Sha256 :
type == SHA2_512 ? QCryptographicHash::Sha512 :
type == SHA3_256 ? QCryptographicHash::Sha3_256 :
QCryptographicHash::Sha3_512);
}
//XX
else{
xxHash = XXH64_createState();
if(XXH64_reset(xxHash,0)){
qDebug("XXH64_reset error %d",__LINE__);
}
}
return hHash ? true : false;
}
BOOL TDigest::Reset()
{
if (updateSize > 0) {
//xx
if(type == XX){
if(XXH64_reset(xxHash,0)){
qDebug("XXH64_reset error %d",__LINE__);
}
}
//MD5 to SHA3-512
else{
hHash->reset();
}
}
return TRUE;
}
BOOL TDigest::Update(void *data, int size)
{
//xx
if(type == XX){
if(XXH64_update(xxHash,data,size)){
qDebug("XXH64_update error %d",__LINE__);
}
}
//MD5 to SHA3-512
else{
hHash->addData((char*)data,size);
}
updateSize += size;
return(true);
}
BOOL TDigest::GetVal(void *data)
{
//xx
if(type == XX){
unsigned long long result = XXH64_digest(xxHash);
//そのままコピるとリトルエンディアン出力になっちゃって読みにくい&MD5とSHA1がビッグなので、
//合わせるためにビッグに変換
unsigned char *a = (unsigned char*)&result;
unsigned long long v = 0;
for (unsigned long long i = 0; i < sizeof(unsigned long long); i++) {
v = (v << 8) | a[i];
}
//bigに変換した内容をコピっておく。
memcpy(data,&v,sizeof(v));
}
//result copy..
else{
memcpy(data,hHash->result(),GetDigestSize());
}
return(true);
}
void TDigest::GetEmptyVal(void *data)
{
#define EMPTY_MD5 "\xd4\x1d\x8c\xd9\x8f\x00\xb2\x04\xe9\x80\x09\x98\xec\xf8\x42\x7e"
#define EMPTY_SHA1 "\xda\x39\xa3\xee\x5e\x6b\x4b\x0d\x32\x55\xbf\xef\x95\x60\x18\x90" \
"\xaf\xd8\x07\x09"
#define EMPTY_SHAX_256 "\xd4\x1d\x8c\xd9\x8f\x00\xb2\x04\xe9\x80\x09\x98\xec\xf8\x42\x7e" \
"\x54\xdd\x8a\x09\x6b\x12\xfd\x8f\x00\x83\x40\x00\x12\x55\xac\xf0"
#define EMPTY_SHAX_512 "\xd4\x1d\x8c\xd9\x8f\x00\xb2\x04\xe9\x80\x09\x98\xec\xf8\x42\x7e" \
"\x54\xdd\x8a\x09\x6b\x12\xfd\x8f\x00\x83\x40\x00\x12\x55\xac\xf0" \
"\xd4\x1d\x8c\xd9\x8f\x01\xb2\x04\xe9\x80\x09\x89\xec\xf8\x42\x7e" \
"\x44\xdd\x8a\x19\x6b\x12\xfd\x8f\x00\x83\x40\x00\x12\x55\xac\xfa"
#define EMPTY_XX "\x16\xd2\xbc\xdf\x22\x0b\x9c\xce"
if (type == MD5) {
memcpy(data, EMPTY_MD5, sizeof(EMPTY_MD5));
}
else if(type == SHA1) {
memcpy(data, EMPTY_SHA1, sizeof(EMPTY_SHA1));
}
else if(type == SHA2_256 || type == SHA3_256){
memcpy(data,EMPTY_SHAX_256,sizeof(EMPTY_SHAX_256));
}
else if(type == SHA2_512 || type == SHA3_512){
memcpy(data,EMPTY_SHAX_512,sizeof(EMPTY_SHAX_512));
}
//XX
else{
memcpy(data, EMPTY_XX, sizeof(EMPTY_XX));
}
}
BOOL TGenRandom(void *buf, int len)
{
arc4random_buf(buf,len);
return TRUE;
}
#define THASH_RAND_NUM1 757 /* prime number */
#define THASH_RAND_NUM2 769 /* prime number */
/* generated by CryptGenRandom */
int rand_data1[THASH_RAND_NUM1] = {
(int)0x83f16d1d,(int)0x8f9a43ea,(int)0x8137d56a,(int)0xd36d4791,(int)0x9bbfd36b,(int)0xcaae44df,(int)0xb8dfd12d,(int)0x57174455,
(int)0x0bbdac9a,(int)0x1162bcbf,(int)0xde3eefa3,(int)0x9970a137,(int)0x49ba608a,(int)0xc79d6b33,(int)0x3d52b4f2,(int)0x711509e9,
(int)0x2646b1cd,(int)0x7ddade5d,(int)0xfcaaea1a,(int)0x146fec6f,(int)0x1a99d198,(int)0xc3d1c634,(int)0xd1a50845,(int)0x2e06b32b,
(int)0x02807095,(int)0x9afc923a,(int)0x3c5448e7,(int)0xe5b387dc,(int)0x8b289d96,(int)0xb0428716,(int)0xd965f716,(int)0xc6b9f02a,
(int)0x650142c2,(int)0xd4be9b82,(int)0xe70c8d48,(int)0x311ecccf,(int)0x7f73a9eb,(int)0x52477384,(int)0x0f2e6a13,(int)0x6fd35a0c,
(int)0x2af035da,(int)0x9e2ada92,(int)0x5492ee63,(int)0x201a5d29,(int)0x892daad7,(int)0x200d2990,(int)0x8ddf2e7d,(int)0x775d8563,
(int)0x6a09945f,(int)0x1b3a3cf6,(int)0x977f76be,(int)0xba7db608,(int)0x6604c211,(int)0xf480c049,(int)0x76db5fef,(int)0x22615181,
(int)0xb51f2fca,(int)0xd7305926,(int)0x750a5dfc,(int)0x102e7459,(int)0xa64f139d,(int)0x05416e29,(int)0x1b32a4bd,(int)0xb8f76a72,
(int)0x248dbbd5,(int)0xbd5e2fc5,(int)0x82d98566,(int)0x9c52316a,(int)0x89e39f4f,(int)0x0e1e89d5,(int)0x76bb803f,(int)0x34357c5a,
(int)0x39434706,(int)0x80bd3414,(int)0x46fed670,(int)0x897ba8ea,(int)0xbff460f7,(int)0xcdaa0885,(int)0xf2024518,(int)0xc85b7524,
(int)0x38e895ef,(int)0x6bb2d9ae,(int)0x6093be57,(int)0xbd00241e,(int)0x5c8e23fb,(int)0xc75b176f,(int)0x5c016859,(int)0x9dce0784,
(int)0x12114c85,(int)0x808e0480,(int)0x7c739056,(int)0x21f64706,(int)0x173447c8,(int)0xa7ae2f34,(int)0xdd57cd5a,(int)0x02e6d856,
(int)0x57ddc904,(int)0x623a2543,(int)0x4b1e727a,(int)0x70ba1821,(int)0xa0aec212,(int)0x4b96c66e,(int)0xf4865658,(int)0x474dbb7b,
(int)0x70c7d122,(int)0x7e9f63ca,(int)0x015d9bad,(int)0x92a10824,(int)0xcb6561f1,(int)0x8c34c2fa,(int)0x1db47841,(int)0xafe357b2,
(int)0x9ffcedb4,(int)0xacce9e6d,(int)0x22a36d9f,(int)0xaaea180e,(int)0x0b9b5283,(int)0x381e12f0,(int)0x6119d5fa,(int)0x2f394b36,
(int)0xb7ec64d2,(int)0x59fc8f69,(int)0xae328ec0,(int)0x79349901,(int)0x9f3c4e40,(int)0xcafa12a7,(int)0x1e224042,(int)0x5210dbe5,
(int)0xfe3b7711,(int)0x04a81740,(int)0x8620fa1d,(int)0xb8482c88,(int)0x0ae5c4e4,(int)0x73803efc,(int)0x9a0551e7,(int)0xe665e262,
(int)0x0d49c1b2,(int)0x2bfd34d1,(int)0x6624ec5a,(int)0x3c66e9d0,(int)0xc14cffdd,(int)0x16bb3524,(int)0xe2625791,(int)0x9c2e0727,
(int)0xa442f0c1,(int)0x195f5ff0,(int)0xbbfc5c1e,(int)0xebeedeea,(int)0x473adc54,(int)0xcce00cb3,(int)0xab4d130b,(int)0x87acc30d,
(int)0x8e9e0b77,(int)0x2351c837,(int)0x39492be6,(int)0x00806c1a,(int)0x88145505,(int)0x87fbafa3,(int)0x835bb731,(int)0x68434f8d,
(int)0xd7fd168c,(int)0x29b00d49,(int)0xc1fd645e,(int)0x389b531d,(int)0xa6d957df,(int)0x9c995f5e,(int)0x0cec9ce9,(int)0x2de48896,
(int)0x04133f46,(int)0xe76ee748,(int)0x160c0b21,(int)0xb2983583,(int)0xe47cabb8,(int)0x23304d75,(int)0xe25f6248,(int)0x2274c01d,
(int)0x03a1cd6c,(int)0xc6cb44c3,(int)0x641cff47,(int)0xf2bfa660,(int)0x9f66db66,(int)0x15b12437,(int)0xc24b5574,(int)0xca225ed7,
(int)0x410b830b,(int)0x8eb74256,(int)0xbe4cbf9c,(int)0x231f69a8,(int)0xba0ecf62,(int)0xd7f87bdd,(int)0x5b14c532,(int)0xc5ccbaf7,
(int)0x3a00e928,(int)0x31cedd89,(int)0x730c3a87,(int)0xabd193ca,(int)0x8d937e8f,(int)0x3c6de267,(int)0xdadd60f7,(int)0xc555b16a,
(int)0x5353be48,(int)0x80d6ba82,(int)0x623ef108,(int)0x29b87505,(int)0xdc163326,(int)0x0abde254,(int)0x34fd474c,(int)0xf967dee1,
(int)0xa36e119f,(int)0x2dfc5975,(int)0x76421ec5,(int)0xa1aa3ee6,(int)0x47fb621e,(int)0xde104a0d,(int)0xbbd2c2f9,(int)0x3810df16,
(int)0x859d0d84,(int)0x9f5f2f74,(int)0x8b101404,(int)0x9f6bcd1b,(int)0xa06dc932,(int)0x553eed9f,(int)0x665e6cb8,(int)0xe98f8caa,
(int)0x07efd2ce,(int)0xf0faecb2,(int)0x5970501e,(int)0x83ce1b51,(int)0x689ff96f,(int)0x74b9f4e8,(int)0x833b9a2e,(int)0x7506ce11,
(int)0xd04f1919,(int)0x3ff4a56a,(int)0xe577eafa,(int)0x230d0432,(int)0x5fbc3d2e,(int)0xd3d2d05a,(int)0x01daf511,(int)0x2c298a83,
(int)0xee2871e3,(int)0xa81fc823,(int)0x7773838b,(int)0x859bd60c,(int)0x42e750dd,(int)0x0671ccb5,(int)0x5d0f0e44,(int)0x08349890,
(int)0x564e1b13,(int)0x88187f9d,(int)0x7b0481be,(int)0x802b5677,(int)0x7c4efd37,(int)0x81f76d89,(int)0xd40d027d,(int)0x984a7384,
(int)0x78f49b71,(int)0xb5244f77,(int)0xa12159e6,(int)0x5f1a4b09,(int)0xe2f3550c,(int)0xe61a90de,(int)0x3161716f,(int)0xe12cf69c,
(int)0xcb78db9d,(int)0xae31a2a3,(int)0xa9f0961a,(int)0xb5b39ec4,(int)0xb7b8c99b,(int)0x89043c08,(int)0x83daa61d,(int)0x46f54b5c,
(int)0x896cb3a6,(int)0xd97bc43c,(int)0x3af11d39,(int)0xf1c92693,(int)0x8912da39,(int)0x1d0f94aa,(int)0xfe051646,(int)0xa149e75a,
(int)0xeb95491a,(int)0xe0887f04,(int)0x0eaa30c3,(int)0x5c4a24f3,(int)0xb10b7152,(int)0x4a91bbd1,(int)0x79f04264,(int)0xc8aab9b3,
(int)0xd8a0e32c,(int)0xc080a374,(int)0xe586c0e7,(int)0x491a4091,(int)0xc05c0219,(int)0x8a4107ab,(int)0xbe781695,(int)0xe7d52f8a,
(int)0x5362894d,(int)0xa75e62e1,(int)0xe900914f,(int)0x11a1800d,(int)0xbb1cb0e3,(int)0x200a1e96,(int)0x206f409a,(int)0x49f6d722,
(int)0x54dd351b,(int)0xc4566fec,(int)0x77cc85b1,(int)0x233dbc3c,(int)0x74d1848b,(int)0xd9619738,(int)0xb585006f,(int)0x25ad8dec,
(int)0x49a742e9,(int)0x8caecdd4,(int)0xc80e0829,(int)0x253ce2a8,(int)0x87faeaff,(int)0xccfed2d8,(int)0x7a092b02,(int)0xfce50644,
(int)0x0ce33e52,(int)0x9bbc1f4d,(int)0xf0f5e6e8,(int)0xa54f2a69,(int)0xc1a5ab5e,(int)0x319d8b40,(int)0xe7376e63,(int)0xb6642bfc,
(int)0x317fd8e4,(int)0x03174c12,(int)0x9aafc16e,(int)0x6fb06595,(int)0x68dcefde,(int)0x92a3c672,(int)0x5dad62e8,(int)0x6e96a51b,
(int)0xe961bd35,(int)0x8f4e8b4b,(int)0xcc02af7a,(int)0xb4307e73,(int)0xe7ef84bb,(int)0x92e797f9,(int)0xca9ba6bb,(int)0xf3b7f071,
(int)0x847cefd9,(int)0x913ea1e0,(int)0xc367cb13,(int)0x01e41639,(int)0x6474b250,(int)0xfba15fa4,(int)0x87d8b078,(int)0x1b12e507,
(int)0x68b680e0,(int)0xe0f1a8f4,(int)0x760a797e,(int)0x0d755e07,(int)0x15e009fb,(int)0x7025ddf9,(int)0x82a93603,(int)0x70624a3f,
(int)0xe6040d0d,(int)0x479c398c,(int)0x94ab4bd6,(int)0x61a1abaf,(int)0xd04306e6,(int)0xc60d97b2,(int)0x67ef7729,(int)0x45df4f4c,
(int)0xe49e7676,(int)0xd811e7e7,(int)0x5d953b30,(int)0xbc31ed53,(int)0x58ae0c76,(int)0xc3c3fe8b,(int)0xf0133b46,(int)0x66b46471,
(int)0x5ec5caa0,(int)0x3f2fcd10,(int)0x84d34b29,(int)0xdf93fa60,(int)0x08dc000b,(int)0xb85a726e,(int)0x341c51ae,(int)0xd92ab209,
(int)0xc2370b4c,(int)0x6c162eac,(int)0x7b1ced53,(int)0xcb615a1c,(int)0xe533949f,(int)0x5664cc6a,(int)0x89e10f89,(int)0x8cc3cb21,
(int)0x2a7993c3,(int)0xb0495388,(int)0x0c152054,(int)0x9a90060d,(int)0x0a4a73ca,(int)0xf5ea4045,(int)0x788a508f,(int)0x901af6bd,
(int)0xb6fda95f,(int)0x36447609,(int)0xafc8cd4b,(int)0x51d85600,(int)0x02e0b211,(int)0x1f8b81c9,(int)0x08c29120,(int)0x277ac975,
(int)0x196f98a3,(int)0x28524cda,(int)0x62af2cb0,(int)0xd529f178,(int)0xa1f4b017,(int)0xc770b8a6,(int)0xeca6ac2b,(int)0x50ec84eb,
(int)0xaa689a43,(int)0x31934739,(int)0xe70b8338,(int)0x84898138,(int)0x939e84ec,(int)0xbc17182d,(int)0x0736f753,(int)0x0451dc2d,
(int)0x2ed324ae,(int)0x4f6dcaf1,(int)0xbd2f1f0f,(int)0xb4b5656b,(int)0x663b6795,(int)0x12198072,(int)0x5e112975,(int)0x0a2b5b70,
(int)0x393f7991,(int)0x1c32285b,(int)0xad14eb66,(int)0x17b8054c,(int)0xb96acb10,(int)0xc39f99f8,(int)0x8efbc29a,(int)0xb4f29c49,
(int)0xe664a4a4,(int)0x350af3a3,(int)0xada98024,(int)0xc7b3c3fb,(int)0xa77314fc,(int)0xde3c896f,(int)0x5fe7fa94,(int)0x2b8e8556,
(int)0xc2284712,(int)0x16d56132,(int)0xbf57b98e,(int)0x4fc6d518,(int)0xecead967,(int)0xaf112372,(int)0x1c79f121,(int)0x83b89ea3,
(int)0x86831167,(int)0xa57f277a,(int)0x313cfa7f,(int)0x8e8a85d2,(int)0x7933f6e4,(int)0x1d4f1a16,(int)0x4cfa2498,(int)0x61028dcb,
(int)0x9ebeb662,(int)0x68276c98,(int)0x9029cb83,(int)0xf9489fbd,(int)0xaa0db1ec,(int)0x5c934601,(int)0xf6b06029,(int)0xbf58ca0c,
(int)0x311cf9b7,(int)0x3cb80d50,(int)0x23a4f363,(int)0x96384f2c,(int)0xca62e804,(int)0xbf3707b1,(int)0x522ff5ec,(int)0x90945aa4,
(int)0x63779b3b,(int)0x04b7c791,(int)0x4c14d79b,(int)0x6684ed1b,(int)0xffa41088,(int)0xec486d66,(int)0xc7c17dac,(int)0xc5e26402,
(int)0x66a414af,(int)0xb05338c2,(int)0x975f1556,(int)0x48b85fb0,(int)0xb1950f29,(int)0x1693df5c,(int)0xbbebc4a6,(int)0x147aa717,
(int)0x5c734f65,(int)0x7684a4e9,(int)0xb2fa29e9,(int)0x464e001b,(int)0x8144156b,(int)0x7dba42a1,(int)0x317734e0,(int)0x4051eab2,
(int)0x10088e7e,(int)0xf75ab750,(int)0x9c0a7e45,(int)0x518471cd,(int)0x51b4c6fb,(int)0x6877d480,(int)0xeceec069,(int)0xeef3e798,
(int)0x6975bce0,(int)0x42149736,(int)0xb5935a29,(int)0xa2e22668,(int)0xb4cd36a5,(int)0x29211652,(int)0x8c98bebe,(int)0x01c7384a,
(int)0xf2ed70a0,(int)0x5f256cf4,(int)0xf30b6953,(int)0x0483bad5,(int)0x4152579d,(int)0xa8e0ec70,(int)0x0c6c2c90,(int)0x60aad99a,
(int)0xa493afd9,(int)0xe4dc4e3f,(int)0xd49d901c,(int)0x4b62708e,(int)0x000262bf,(int)0xebbc6ea3,(int)0x1618fa0f,(int)0xde380975,
(int)0x2004f481,(int)0xdecfa349,(int)0xac331def,(int)0xf6646b4e,(int)0x4c2cb555,(int)0xb559a36f,(int)0xec112fa1,(int)0xe136ba6f,
(int)0x4503d8c9,(int)0x6e4ea40a,(int)0x84d432ef,(int)0xd3c8e82c,(int)0x758f7802,(int)0xc37b226c,(int)0xfcbafe4c,(int)0x17e1b316,
(int)0x1a2627d7,(int)0x950e28cd,(int)0x6a46ee01,(int)0x230bcefe,(int)0x15958fca,(int)0xf71aad1b,(int)0x2a06831d,(int)0x135bc2b1,
(int)0xcca6aff5,(int)0x60f9dee7,(int)0xbd60652b,(int)0xdc07a8ad,(int)0xd7797298,(int)0x4f965b7e,(int)0x1b25de2b,(int)0xc726ad3f,
(int)0xc73d4448,(int)0x5dbbd65e,(int)0x4810d538,(int)0xb1c6db7c,(int)0x554ea737,(int)0x46d2bf94,(int)0xa7db9cc1,(int)0x6a6d2ded,
(int)0xf8890fbe,(int)0x8b28c3d2,(int)0x9c0fa1d2,(int)0xa37e3f03,(int)0xf7fe82a2,(int)0x23095bd0,(int)0x8115acf8,(int)0xc2e91340,
(int)0x3ca2c6cf,(int)0x90a7a81b,(int)0xaa26761c,(int)0x465cba52,(int)0xf11e955c,(int)0x6d3a7df0,(int)0xb0dc1b40,(int)0x675d4650,
(int)0xc4c01362,(int)0x54cfe021,(int)0x6a891b9b,(int)0xd5bae0b0,(int)0xbcba6c28,(int)0xbf2c3a17,(int)0xb5d97723,(int)0x524711d7,
(int)0xb6b5310d,(int)0x1b9551b0,(int)0xa341666c,(int)0xab33a8a4,(int)0x856efe36,(int)0x3ead5590,(int)0xcf1efdde,(int)0xb1308338,
(int)0x408b4edd,(int)0x7dbff72e,(int)0xeed185e7,(int)0x3ed2c3d2,(int)0xa0200959,(int)0x925e2fd7,(int)0xfcbac04e,(int)0x367e9b6c,
(int)0x9b841f7e,(int)0x3ca16926,(int)0x01be3ac6,(int)0x4cb3c1b3,(int)0x6493460f,(int)0xa9676d0e,(int)0x87369cf8,(int)0x2744649c,
(int)0x736dc3bd,(int)0xc80ec3c2,(int)0x10cca1a8,(int)0x8e2c8095,(int)0x9af8f210,(int)0x80bbd84c,(int)0x67a6435a,(int)0xb69e14a9,
(int)0x06cc32d8,(int)0x63aa64f4,(int)0xa443d8b1,(int)0x5918e881,(int)0x4a2c4204,(int)0x15b60774,(int)0x50f847ab,(int)0x2f4f13ee,
(int)0x40f8c1d6,(int)0xe33f4561,(int)0xfac255af,(int)0x060d6690,(int)0x83586e97,(int)0x83389c0f,(int)0x6536598b,(int)0x9a89198e,
(int)0x81475f9a,(int)0x87337ece,(int)0x8bab6e47,(int)0xe4b20aa0,(int)0x954862f1,(int)0xa7f55367,(int)0x2e0e1aad,(int)0x65438a27,
(int)0x50c9c18f,(int)0x79f33149,(int)0x9d42f8bf,(int)0xc6d51b7e,(int)0x7381a140,(int)0x90551a78,(int)0xd562a5c6,(int)0x5e7ef8a7,
(int)0x2d56b0b0,(int)0xf60bda4a,(int)0x1bbf7276,(int)0x13ca4d74,(int)0xa8553e44,(int)0x7f42f4d3,(int)0xea69f6a3,(int)0x49752831,
(int)0x23723da2,(int)0x234f5de8,(int)0x0b7d3a81,(int)0xf2b5e56f,(int)0x65b0abbb,(int)0x905d7e96,(int)0xcc21c3b8,(int)0x36f28d36,
(int)0x96bb335e,(int)0x93428d20,(int)0xe55b3897,(int)0xc80cd1ac,(int)0x6f88ff78,(int)0x9f66500d,(int)0xcac5fe1c,(int)0x4477be82,
(int)0x50843d4a,(int)0x809e86da,(int)0x251aa38a,(int)0x5736c998,(int)0xc832d161,(int)0x6453cb7f,(int)0x4f556ca9,(int)0x41333009,
(int)0x0a74ddd8,(int)0x79350459,(int)0x458364c3,(int)0x63d3dabb,(int)0x614203d8,(int)0x69e27270,(int)0x382b5996,(int)0x36cf6d45,
(int)0x308751ef,(int)0x4027bc18,(int)0x848e96a3,(int)0xa5d1b4ea,(int)0xf7a0a30d,(int)0xd90fcdc3,(int)0x4bd39ead,(int)0x780b2268,
(int)0xd6582446,(int)0x0bc8e465,(int)0x1e596236,(int)0x20418b93,(int)0x4041560d,(int)0xb2328e65,(int)0x4b238769,(int)0xc52bd2fc,
(int)0x32866d02,(int)0x7117d525,(int)0xa508f2e5,(int)0x950dcef3,(int)0x0c36b726,(int)0x9841482f,(int)0x51d05bcb,(int)0xf2c0b29c,
(int)0xb9acf94a,(int)0x4b72057f,(int)0x102e0249,(int)0x52b8bbc9,(int)0x79dc7033,(int)0x422e65c0,(int)0xa2c21d57,(int)0x332c0d7e,
(int)0xfc655e85,(int)0xce6b61ef,(int)0xa1bf673d,(int)0xa7e18e7a,(int)0x7cb12def,(int)0x7750cfda,(int)0x7a51b8a4,(int)0x95b34e37,
(int)0x20133849,(int)0xb86bc47c,(int)0xffabc8e8,(int)0xa3f90fcf,(int)0x4fe16e3b,(int)0x933272c3,(int)0xd5afec19,(int)0x15a86790,
(int)0x57c9faa9,(int)0xc7772eee,(int)0xb99053fc,(int)0xfdf3eba9,(int)0xfd97a3e3,/*0x7195046c,0xc44a2c13,*/
};
int rand_data2[THASH_RAND_NUM2] = {
(int)0xa99a70d7,(int)0x0e3bff64,(int)0x310259ac,(int)0x10cfeef3,(int)0x8367cf8b,(int)0x5cafab2e,(int)0xe5be5c2c,(int)0xc613cdff,
(int)0xf3280f61,(int)0x1f45e7e6,(int)0x96b1867c,(int)0xd0a376f5,(int)0x2f18be07,(int)0x75267077,(int)0xa1cc0262,(int)0x1e76dc5f,
(int)0xfc35344c,(int)0xc9b8d885,(int)0x6760e957,(int)0x96f4ae65,(int)0x50e3df03,(int)0xf77e3b8c,(int)0x7af9d838,(int)0x4c13eab9,
(int)0xac22160e,(int)0x9a23a02f,(int)0x8c907055,(int)0x4a629c62,(int)0x6087b3e5,(int)0xf3c696cf,(int)0x537ddb04,(int)0x7c3c6bdf,
(int)0x63790239,(int)0x3468833b,(int)0xe336d247,(int)0x72a519a1,(int)0x6438b794,(int)0x9a350fcd,(int)0x1a3297da,(int)0x45112059,
(int)0x9c6b335d,(int)0x54051fb8,(int)0xaa7872c3,(int)0x6f7d965d,(int)0xa6a5c229,(int)0x23198c2b,(int)0x94d0b03c,(int)0x3640e540,
(int)0x8c26e85b,(int)0xecb0970a,(int)0x74e93a49,(int)0xf4b576da,(int)0x6c3f911b,(int)0xb2c5ba4c,(int)0x541b4e85,(int)0xf145531c,
(int)0xf51dd83f,(int)0x8d3b1bd7,(int)0x83eb5942,(int)0x4cb60adf,(int)0x895290ee,(int)0xa24d8c0f,(int)0xe9ef6a86,(int)0xf67585f0,
(int)0x6e7b9213,(int)0xfa6462b0,(int)0x874ea4c2,(int)0x5a704809,(int)0x6a8c51d6,(int)0xe09e7c19,(int)0x1ffbc2c5,(int)0xc0467dc7,
(int)0x3dbe9f57,(int)0x4b9c647a,(int)0xc604b3c0,(int)0x30e6039e,(int)0x64f26eaa,(int)0x068d94c7,(int)0x6a2fa5cd,(int)0x1d291b73,
(int)0xb0c3c154,(int)0xc1964706,(int)0x213f69c2,(int)0x644e4ccd,(int)0xcd02a88b,(int)0x96f2928e,(int)0x867302d8,(int)0x16949c9a,
(int)0x10b6d545,(int)0x238a12ea,(int)0xc051614a,(int)0xc5af7f73,(int)0xec1e984b,(int)0x8d298867,(int)0xed5dafb2,(int)0xcffe21af,
(int)0x121bd3a7,(int)0x85f006d7,(int)0xc21337d2,(int)0xa34a3a71,(int)0x0c508cc1,(int)0xaa3bfc08,(int)0x481aa994,(int)0x79b3baca,
(int)0xdeea59f4,(int)0xc3d08698,(int)0x75dd7c3b,(int)0x585912d0,(int)0x026f4afb,(int)0x967d67ee,(int)0xd33efc37,(int)0x98e5738f,
(int)0x43e00a55,(int)0x2c34c222,(int)0x9c7b8034,(int)0x0ef9ad07,(int)0x909ec9bb,(int)0x72604575,(int)0xd74995d7,(int)0x4a9f7570,
(int)0x88fca31d,(int)0x683f212f,(int)0xf6b0a845,(int)0x24c69154,(int)0x30bdd059,(int)0x4858f353,(int)0xed24fa0d,(int)0xed41b5d7,
(int)0x5f7d63cb,(int)0xc8c94b3e,(int)0xf3605afe,(int)0xe069467f,(int)0xbf21cbc0,(int)0x7477f32d,(int)0xb673fc61,(int)0x3f020fe8,
(int)0xf0519cab,(int)0x47723551,(int)0x3581afda,(int)0xe4321c7b,(int)0xf6274551,(int)0xf344187a,(int)0xda1f7e03,(int)0x87464528,
(int)0x84191473,(int)0x18e5b44f,(int)0x1b323516,(int)0xfd1c3207,(int)0xcb481f43,(int)0x349b30e1,(int)0xfb597740,(int)0x5a596983,
(int)0x3705b516,(int)0xe8d7d730,(int)0xee986bce,(int)0x01b6bb74,(int)0x19bebed9,(int)0xb2f99dac,(int)0x5842a2f7,(int)0x7499e685,
(int)0x9b87aaf8,(int)0xf92f619c,(int)0x0a387f9a,(int)0xa5b9b751,(int)0x0c9923aa,(int)0x0fda4bad,(int)0xd9b72016,(int)0x60141382,
(int)0xacf64a48,(int)0x978d4f12,(int)0xe34c9540,(int)0xbee2e8b7,(int)0x99d1ea5e,(int)0x20f69025,(int)0x4b3eef38,(int)0x413850c4,
(int)0xe91f4526,(int)0xa33a6473,(int)0x5d3e58d4,(int)0xe5058ed5,(int)0x8e4f96e5,(int)0x8c986dfa,(int)0x085545ce,(int)0xba1c9a79,
(int)0x67ac0aef,(int)0x11b0ff31,(int)0x72a316e8,(int)0x88fba36f,(int)0x99b7f8a3,(int)0x838a0f9e,(int)0xbfe7c933,(int)0x7d1f8710,
(int)0xe5c7b7fc,(int)0x080e5883,(int)0xc3e69f26,(int)0x21d4bf53,(int)0x733a226c,(int)0x36296a9a,(int)0x5de47f9c,(int)0x951deb1d,
(int)0x7c41472a,(int)0xbfca14fe,(int)0xc85db49a,(int)0x47628602,(int)0x8b00ceac,(int)0x5637bb37,(int)0xb441d010,(int)0x15c5920d,
(int)0x9b485068,(int)0x3326fdf9,(int)0xcf684cda,(int)0xe7dca6e5,(int)0xfbf0f962,(int)0x0a0a0d0a,(int)0x153e9d8c,(int)0x63de678f,
(int)0x41c1ff1d,(int)0xc00653a6,(int)0x4c3a3c7d,(int)0xcf4ae1d6,(int)0x1ba19315,(int)0x2bdd69e2,(int)0xe111da35,(int)0xc846c4fb,
(int)0xa697d92a,(int)0x68e06597,(int)0x03b6e361,(int)0x4b4b4844,(int)0xdf247c2b,(int)0x8cf9f6e9,(int)0x4b6b0761,(int)0x2d0cfc57,
(int)0xb2ae19ca,(int)0x8f334098,(int)0x16e4f3b8,(int)0x30d871e9,(int)0xcd7cd6ec,(int)0x0dde9c5c,(int)0x9f185789,(int)0x99d70131,
(int)0x8f0cb6e0,(int)0xb9c946dc,(int)0x28f26ae4,(int)0xc057d669,(int)0xeaade933,(int)0xd00c23d0,(int)0x5bc546df,(int)0xa5b3debe,
(int)0x81727aef,(int)0xaac4c603,(int)0xcd7ff71a,(int)0x82b6f723,(int)0x98cb4013,(int)0xea88fc6f,(int)0x57081be8,(int)0x2fb382bf,
(int)0x53b4a1cb,(int)0x8840640d,(int)0x04f5dba6,(int)0x34a816e7,(int)0x6f7c97c7,(int)0xd378df2a,(int)0xb018c109,(int)0x5082215a,
(int)0x36ec9ae1,(int)0x2804685d,(int)0x8c0e93f9,(int)0x72818552,(int)0x5d69e90a,(int)0x1f38b26e,(int)0x5fc040eb,(int)0xbc03016c,
(int)0x12764a68,(int)0x5f7482f9,(int)0x8a9172fd,(int)0x7b1f8a29,(int)0x9d392eef,(int)0x88ab003e,(int)0x58810c0c,(int)0x89491ff1,
(int)0x0c3a52e5,(int)0x5ea71cc9,(int)0x2c93b8fd,(int)0x315a59dc,(int)0xb4baf85d,(int)0x51ac3de9,(int)0x1d177dd1,(int)0x1fcd7268,
(int)0x1853ddd6,(int)0x48c40ea8,(int)0xedd365bf,(int)0x7d1ab3c4,(int)0x5a3a1122,(int)0xfc0165e6,(int)0x5036f139,(int)0x1ec9067a,
(int)0x34de9209,(int)0xb92aea49,(int)0xe572a02b,(int)0x9f866363,(int)0x0bf5439f,(int)0xe62dd59d,(int)0xea2cc649,(int)0x3358ba6f,
(int)0xc17ba822,(int)0xc8ba84f3,(int)0xc608f209,(int)0xcc8da1ec,(int)0x61fe69f2,(int)0x286209b2,(int)0x752f0078,(int)0xf33dabe0,
(int)0x27bbbafb,(int)0x0e5dfbd7,(int)0x6e63cee5,(int)0x28e5288e,(int)0x87c10d41,(int)0x1a442a02,(int)0xf0d48240,(int)0x32514c87,
(int)0xafef4c38,(int)0x59464e58,(int)0x786f9abf,(int)0x9072c748,(int)0x2e4354b0,(int)0xbaf0fa1b,(int)0x3ee3da81,(int)0xb8feb007,
(int)0x65718ce6,(int)0x1600a86b,(int)0x34a56703,(int)0x20441067,(int)0x4a7739d4,(int)0xc918822f,(int)0x1f7c4c59,(int)0xdb7aefeb,
(int)0xb12d7a15,(int)0x5f68bdfc,(int)0x88851801,(int)0x1fd42cbf,(int)0xa379869e,(int)0x0a473fec,(int)0x0d1af4c2,(int)0xc255c0af,
(int)0x27897359,(int)0x234866ec,(int)0x8c1f5cb6,(int)0x5657805b,(int)0x0ed873f9,(int)0xe511246c,(int)0x4d06ea31,(int)0x6dfc99d1,
(int)0xc90b5c34,(int)0x1d16215b,(int)0x6978dee3,(int)0x933289ae,(int)0xb11c06d3,(int)0xd700e7e7,(int)0x4486618a,(int)0x9af8115b,
(int)0xc58c0553,(int)0xda04a053,(int)0x524e0c90,(int)0xa20f7d97,(int)0x42abaa3e,(int)0x0bf790e2,(int)0x9a85cea9,(int)0xf304425d,
(int)0x31b1da91,(int)0x4ff62c44,(int)0x374caff2,(int)0xd4ecb50d,(int)0x5dd0517f,(int)0x7662be4c,(int)0x7b58679d,(int)0x0aa7361d,
(int)0x805168a6,(int)0xce0a363e,(int)0xa85088df,(int)0x2c4af23e,(int)0x924f4275,(int)0x0114a01a,(int)0xbb910738,(int)0xc250884d,
(int)0x58da5d3b,(int)0x341207e7,(int)0x03aa142d,(int)0x7899161f,(int)0x3c24f18b,(int)0x18865e50,(int)0x656ba6a8,(int)0x31a80d30,
(int)0x6b24ecc2,(int)0x5f4931e6,(int)0x901c3e7a,(int)0xdfc40760,(int)0x4f43757e,(int)0xed651c0e,(int)0xbdaff1b0,(int)0x3f2baa63,
(int)0xb2b5c17f,(int)0xf0f7f8aa,(int)0x6c165fe1,(int)0x5042a1a9,(int)0x852e7850,(int)0xa8a871aa,(int)0xc5a15551,(int)0xe8b9488a,
(int)0xe3977f2b,(int)0xd6849e56,(int)0x3e5cd175,(int)0x39957066,(int)0xe22a3f0f,(int)0x175d4ed2,(int)0x3383383a,(int)0xa0d33bda,
(int)0xe36d4f93,(int)0x9cd5bdb5,(int)0x7face3f5,(int)0x67cd6128,(int)0xd84dd459,(int)0x4a907a2d,(int)0x7a14cc5c,(int)0xc25ab6fd,
(int)0x58cf3cc6,(int)0x70191524,(int)0x176c3613,(int)0x80d6c3b7,(int)0x5d630b16,(int)0x84c874e3,(int)0x4dfce0b7,(int)0xc6457b05,
(int)0x0ac3d064,(int)0xca4595e1,(int)0x5f512121,(int)0xedb638df,(int)0x48552e45,(int)0x5102a2eb,(int)0xdb8f5d0b,(int)0xb9cfc11a,
(int)0x59daad06,(int)0xb3536891,(int)0x060c22dd,(int)0x18a0339c,(int)0xab6b9f87,(int)0x27439924,(int)0xb2180df5,(int)0x1d4aac4f,
(int)0x69b336b4,(int)0x777bb79c,(int)0x857a354d,(int)0x83665051,(int)0x4115c822,(int)0x0112db91,(int)0xecb7f774,(int)0xc004b3b6,
(int)0x0b2ca3d8,(int)0xda04cdd3,(int)0x0446aa51,(int)0x9af391ff,(int)0x20941762,(int)0xe5b2dc29,(int)0x54b76d2f,(int)0xaec3afb0,
(int)0xecfd8fee,(int)0x0c0b2f41,(int)0x2a76cefe,(int)0xcd9caff9,(int)0x406888d7,(int)0xaca4c6a4,(int)0x2da160e4,(int)0x8c50a390,
(int)0x9a07333d,(int)0x6db08d90,(int)0xa1efef95,(int)0xad224c56,(int)0xe09907b8,(int)0xc2de0514,(int)0x3d78f11f,(int)0x763689c5,
(int)0xb775c493,(int)0x357184f6,(int)0x2f4f5551,(int)0x1571aec0,(int)0xd46740a2,(int)0xf8e9adbb,(int)0x381905ac,(int)0x7cfc9c50,
(int)0x9eafeb12,(int)0x3afce12b,(int)0x71598537,(int)0xa198eae3,(int)0x393cd128,(int)0x3a689c6e,(int)0xe8ac6464,(int)0xf05efc9a,
(int)0x8db2c6c5,(int)0x4ee129ad,(int)0x1759c9db,(int)0x827b636e,(int)0x70745e79,(int)0x7cadf3d4,(int)0x7961fe5a,(int)0x3c34f1d0,
(int)0x61a1984c,(int)0xf95e6490,(int)0x2bbc2b06,(int)0x45956fb3,(int)0x664dfc37,(int)0x7c6d4d36,(int)0x1175e06e,(int)0xdc399108,
(int)0x1eafd5d5,(int)0x2d09a2b1,(int)0x90d7dd5a,(int)0x19f7dfce,(int)0x9137377a,(int)0x0c0ba128,(int)0xe581acfb,(int)0xecfadf6e,
(int)0xd8923f60,(int)0x45e39440,(int)0xf70d0343,(int)0x6324b057,(int)0x4f9aa32c,(int)0xf3471d88,(int)0xc7052442,(int)0x909183d1,
(int)0x67ff9fef,(int)0x33c5d66c,(int)0xf8addd48,(int)0x821084b1,(int)0xadeb5a2f,(int)0x1536309c,(int)0x3ea31cad,(int)0xdeb7b029,
(int)0xca30bb3f,(int)0xadc0d7b4,(int)0xe90f2f22,(int)0x45655f0e,(int)0xb8d8a594,(int)0xf366af23,(int)0x12a40203,(int)0x6669c6ba,
(int)0x42bcf2db,(int)0x6afa5a32,(int)0x46300ae0,(int)0x1dd82125,(int)0x69e2014f,(int)0x558e6bbf,(int)0xb44dbf78,(int)0xf0714769,
(int)0x9f021ff1,(int)0xf9dcd981,(int)0x7f43c05e,(int)0x8470d112,(int)0x17584e25,(int)0xfa1c57f2,(int)0x4a5e2595,(int)0x0880e5d8,
(int)0x082428a0,(int)0xa18d702d,(int)0xe09d8ea9,(int)0x61397568,(int)0x21681a35,(int)0x141347e3,(int)0xaded5409,(int)0x36f0ea6b,
(int)0xadc34162,(int)0x8957608f,(int)0xfeac1769,(int)0x81f7d698,(int)0x057d29b0,(int)0xb34fce1f,(int)0x0e7cc9d0,(int)0x78bb50a0,
(int)0x614b84e7,(int)0xd543bf1c,(int)0x40864d92,(int)0x11c953be,(int)0x28488665,(int)0xd9f51500,(int)0xa4741451,(int)0x3eb5c669,
(int)0x87e3b2bd,(int)0xd892dd00,(int)0x61211812,(int)0xe5c4237b,(int)0x40942b79,(int)0x927c23b9,(int)0x9fa99e4d,(int)0x40322ceb,
(int)0x33fe12c2,(int)0xc565f691,(int)0x476d3955,(int)0xa662e8b4,(int)0xaf4aa861,(int)0x5d73e65e,(int)0x75f9bde9,(int)0x63261652,
(int)0x94bf5870,(int)0xe3a9f89d,(int)0x7562de78,(int)0x905cbbf0,(int)0x36553a61,(int)0xd9cf2a5a,(int)0xee473c67,(int)0x2aafc6d6,
(int)0xb2b9c0f1,(int)0x6ddd02b4,(int)0x5e5c3829,(int)0xed8adec0,(int)0x716afe6c,(int)0x7506598a,(int)0x2be4bbd2,(int)0x1e3dd772,
(int)0x5056fd16,(int)0xea369392,(int)0x36210c02,(int)0xa37816ce,(int)0x8d0d2f58,(int)0xb6524835,(int)0x8131befe,(int)0x92b1f875,
(int)0xe5c0e3f5,(int)0x6b470c74,(int)0x2f4e0dca,(int)0x863bc8a7,(int)0xd1105591,(int)0x03ee5c43,(int)0x74b6388c,(int)0x00662765,
(int)0x341c4cca,(int)0xd5af530c,(int)0xa3cb805e,(int)0xbfa9692a,(int)0x03eeaf06,(int)0x80ed28aa,(int)0x80515097,(int)0xf7ba6159,
(int)0x3f1214fc,(int)0x45da0f44,(int)0x7afd8d91,(int)0x220ccf35,(int)0x58bb92c4,(int)0x3456bb2b,(int)0x6366fcf6,(int)0x2eb16561,
(int)0x7eb86c35,(int)0x9aacf183,(int)0xdd194ccb,(int)0xeaf3c784,(int)0xe91abf6c,(int)0x7070caca,(int)0xf135d304,(int)0x1a9487db,
(int)0x55ad140d,(int)0x00239050,(int)0x9b9b1b42,(int)0xdcdfd437,(int)0xcbabb060,(int)0x2f6c60bb,(int)0xedc603f0,(int)0xb9cc5d75,
(int)0xe6bd1a25,(int)0x2f33e520,(int)0x65d93ddb,(int)0xfb958d05,(int)0xa3cd8777,(int)0x1cc38a68,(int)0x1839185b,(int)0x004722a0,
(int)0xe3912518,(int)0x5a9b1755,(int)0xdc61cfdb,(int)0xc1693458,(int)0x92f6f8cd,(int)0x0d8cae41,(int)0xdc954978,(int)0xb9785907,
(int)0x4358caea,(int)0xef7bd8d8,(int)0xc0cb5989,(int)0xd43c47a9,(int)0x4bd2daf2,(int)0xf9316311,(int)0x85a42afb,(int)0xd468e8f6,
(int)0xa2133f5b,(int)0x271f4bed,(int)0x4390729c,(int)0x2405a0fd,(int)0xa01cec1a,(int)0x53bd92d2,(int)0x743aaeb8,(int)0x5cef1cd6,
(int)0x94d9ea0a,(int)0x127d04df,(int)0x8d7ae261,(int)0x03132498,(int)0xf81c4790,(int)0x95f3b7be,(int)0x45c5d589,(int)0xb12c5a9d,
(int)0x4b447a91,(int)0xafccc0e1,(int)0xd92b48e4,(int)0xfdeda286,(int)0xb27d3515,(int)0x03f9ee84,(int)0x2d69ba1b,(int)0x96889f64,
(int)0x98783d2c,(int)0x8f5df16c,(int)0xf891e3a7,(int)0x32780504,(int)0x31b6e525,(int)0x680b34b1,(int)0xbb1be889,(int)0x851baa4e,
(int)0x19a93890,(int)0x3179f63e,(int)0xd0d2f757,(int)0x530a8f8e,(int)0x3e34256a,(int)0xf80a4bf4,(int)0xe353e68c,(int)0x96f60026,
(int)0x5291965a,(int)0x1e621492,(int)0x3614690b,(int)0x85dedc84,(int)0xdbc5e725,(int)0xff762b8b,(int)0x8873f574,(int)0x86771df3,
(int)0xf8f9ad3c,(int)0x1fee4a28,(int)0xabcf6785,(int)0x8d3a8def,(int)0x2ecf7680,(int)0x564b8695,(int)0x11c136b4,(int)0xc2a94343,
(int)0x173b68e1,(int)0xe9a66e49,(int)0x8e6980fc,(int)0xa015713e,(int)0xb0639b00,(int)0xb714b41c,(int)0xe878f944,(int)0x4f97269d,
(int)0xb81866c4,(int)0xff8c7235,(int)0x4e96579c,(int)0x10c3552b,(int)0x74bb2d64,(int)0xeed90518,(int)0x6107ccb2,(int)0xa4650c85,
(int)0x3549206d,(int)0x78bfe476,(int)0x0c9a4f8e,(int)0xcc5e655b,(int)0x975f05f3,(int)0xe1f1d64d,(int)0xa62cfc41,(int)0xb6f1fa62,
(int)0xa68bb10d,
};
/*
手抜きハッシュ生成ルーチン
*/
u_int MakeHash(const void *data, int size, DWORD iv)
{
//#define MAKE_HASH_CORE(sum, data, offset) \
// ((((sum) << 7) | ((sum) >> 25)) ^ data ^ \
// rand_data1[(rand_data2[(offset ^ iv) % THASH_RAND_NUM2] ^ data ^ iv) % THASH_RAND_NUM1])
#define MAKE_HASH_CORE(sum, data, offset) (\
(((sum) << 7) | ((sum) >> 25)) \
^ data \
^ rand_data1[(data ^ offset) % THASH_RAND_NUM1] \
^ rand_data2[(data) % THASH_RAND_NUM2] \
)
u_int val = rand_data1[(size ^ iv) % THASH_RAND_NUM1]
^ rand_data2[(size ^ iv) % THASH_RAND_NUM2]
^ 0xe31a021d;
u_int offset = val ^ 0x8f8e053a;
int max_loop = size / sizeof(u_int);
int mod = size % sizeof(u_int);
u_int *p = (u_int *)data;
for (u_int *end = p + max_loop; p < end; p++) {
val = MAKE_HASH_CORE(val, *p, offset);
offset+=11;
}
if (mod) {
u_int mod_val;
switch (mod) {
case 1: mod_val = 0x01010101; memcpy(&mod_val, p, 1); break;
case 2: mod_val = 0x02020202; memcpy(&mod_val, p, 2); break;
case 3: mod_val = 0x03030303; memcpy(&mod_val, p, 3); break;
default:mod_val = 0x04040404; memcpy(&mod_val, p, 4); break; /* not reached */
}
val = MAKE_HASH_CORE(val, mod_val, offset + mod);
}
return val;
}