| 2338 | DWORD WINAPI thread_process_minikeys(LPVOID vargp) { |
| 2339 | #else |
| 2340 | void *thread_process_minikeys(void *vargp) { |
| 2341 | #endif |
| 2342 | FILE *keys; |
| 2343 | Point publickey[4]; |
| 2344 | Int key_mpz[4]; |
| 2345 | struct tothread *tt; |
| 2346 | uint64_t count; |
| 2347 | char publickeyhashrmd160_uncompress[4][20]; |
| 2348 | char public_key_uncompressed_hex[131]; |
| 2349 | char address[4][40],minikey[4][24],minikeys[8][24],buffer_b58[21],minikey2check[24],rawvalue[4][32]; |
| 2350 | char *hextemp,*rawbuffer; |
| 2351 | int r,thread_number,continue_flag = 1,k,j,count_valid; |
| 2352 | Int counter; |
| 2353 | tt = (struct tothread *)vargp; |
| 2354 | thread_number = tt->nt; |
| 2355 | free(tt); |
| 2356 | rawbuffer = (char*) &counter.bits64; |
| 2357 | count_valid = 0; |
| 2358 | for(k = 0; k < 4; k++) { |
| 2359 | minikey[k][0] = 'S'; |
| 2360 | minikey[k][22] = '?'; |
| 2361 | minikey[k][23] = 0x00; |
| 2362 | } |
| 2363 | minikey2check[0] = 'S'; |
| 2364 | minikey2check[22] = '?'; |
| 2365 | minikey2check[23] = 0x00; |
| 2366 | |
| 2367 | do { |
| 2368 | if(FLAGRANDOM) { |
| 2369 | counter.Rand(256); |
| 2370 | for(k = 0; k < 21; k++) { |
| 2371 | buffer_b58[k] =(uint8_t)((uint8_t) rawbuffer[k] % 58); |
| 2372 | } |
| 2373 | } |
| 2374 | else { |
| 2375 | if(FLAGBASEMINIKEY) { |
| 2376 | #if defined(_WIN64) && !defined(__CYGWIN__) |
| 2377 | WaitForSingleObject(write_random, INFINITE); |
| 2378 | memcpy(buffer_b58,raw_baseminikey,21); |
| 2379 | increment_minikey_N(raw_baseminikey); |
| 2380 | ReleaseMutex(write_random); |
| 2381 | #else |
| 2382 | pthread_mutex_lock(&write_random); |
| 2383 | memcpy(buffer_b58,raw_baseminikey,21); |
| 2384 | increment_minikey_N(raw_baseminikey); |
| 2385 | pthread_mutex_unlock(&write_random); |
| 2386 | #endif |
| 2387 | } |
| 2388 | else { |
| 2389 | #if defined(_WIN64) && !defined(__CYGWIN__) |
| 2390 | WaitForSingleObject(write_random, INFINITE); |
| 2391 | #else |
| 2392 | pthread_mutex_lock(&write_random); |
| 2393 | #endif |
| 2394 | if(raw_baseminikey == NULL){ |
| 2395 | raw_baseminikey = (char *) malloc(22); |
| 2396 | checkpointer((void *)raw_baseminikey,__FILE__,"malloc","raw_baseminikey" ,__LINE__ -1 ); |
| 2397 | counter.Rand(256); |
nothing calls this directly
no test coverage detected