MCPcopy Create free account
hub / github.com/albertobsd/keyhunt / thread_process_minikeys

Function thread_process_minikeys

keyhunt.cpp:2340–2505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2338DWORD WINAPI thread_process_minikeys(LPVOID vargp) {
2339#else
2340void *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);

Callers

nothing calls this directly

Calls 15

bloom_checkFunction · 0.85
increment_minikey_NFunction · 0.70
checkpointerFunction · 0.70
set_minikeyFunction · 0.70
increment_minikey_indexFunction · 0.70
sha256sse_23Function · 0.70
sha256sse_22Function · 0.70
searchbinaryFunction · 0.70
rmd160toaddress_dstFunction · 0.70
RandMethod · 0.45
Set32BytesMethod · 0.45
ComputePublicKeyMethod · 0.45

Tested by

no test coverage detected