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

Function main

bsgsd.cpp:285–1365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283Secp256K1 *secp;
284
285int main(int argc, char **argv) {
286 // File pointers
287 FILE *fd_aux1, *fd_aux2, *fd_aux3;
288
289 // Strings
290 char *hextemp = NULL;
291 char *bf_ptr = NULL;
292 char *bPload_threads_available;
293
294 // Buffers
295 char rawvalue[32];
296
297 // 64-bit integers
298 uint64_t BASE, PERTHREAD_R, itemsbloom, itemsbloom2, itemsbloom3;
299
300 // 32-bit integers
301 uint32_t finished;
302 int readed, c, salir,i,s;
303
304 // Custom integers
305 Int total, pretotal, debugcount_mpz, seconds, div_pretotal, int_aux, int_r, int_q, int58;
306
307 // Pointers
308 struct bPload *bPload_temp_ptr;
309
310 // Sizes
311 size_t rsize;
312
313
314 pthread_mutex_init(&write_keys,NULL);
315 pthread_mutex_init(&write_random,NULL);
316 pthread_mutex_init(&mutex_bsgs_thread,NULL);
317
318 srand(time(NULL));
319
320 secp = new Secp256K1();
321 secp->Init();
322 ZERO.SetInt32(0);
323 ONE.SetInt32(1);
324 BSGS_GROUP_SIZE.SetInt32(CPU_GRP_SIZE);
325
326 unsigned long rseedvalue;
327 int bytes_read = getrandom(&rseedvalue, sizeof(unsigned long), GRND_NONBLOCK);
328 if(bytes_read > 0) {
329 rseed(rseedvalue);
330 /*
331 In any case that seed is for a failsafe RNG, the default source on linux is getrandom function
332 See https://www.2uo.de/myths-about-urandom/
333 */
334 }
335 else {
336 /*
337 what year is??
338 WTF linux without RNG ?
339 */
340 fprintf(stderr,"[E] Error getrandom() ?\n");
341 exit(0);
342 rseed(clock() + time(NULL) + rand()*rand());

Callers

nothing calls this directly

Calls 15

rseedFunction · 0.85
bloom_init2Function · 0.85
menuFunction · 0.70
init_generatorFunction · 0.70
checkpointerFunction · 0.70
sha256Function · 0.70
bsgs_sortFunction · 0.70
InitMethod · 0.45
SetInt32Method · 0.45
SetMethod · 0.45
SetInt64Method · 0.45
SetBase16Method · 0.45

Tested by

no test coverage detected