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

Function thread_process_bsgs

bsgsd.cpp:1575–1825  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1573}
1574
1575void *thread_process_bsgs(void *vargp) {
1576
1577 FILE *filekey;
1578 char xpoint_raw[32],*aux_c,*hextemp;
1579 Int base_key,keyfound;
1580 Point base_point,point_aux,point_found;
1581 uint32_t r, cycles;
1582 IntGroup *grp = new IntGroup(CPU_GRP_SIZE / 2 + 1);
1583 Point startP;
1584
1585 int hLength = (CPU_GRP_SIZE / 2 - 1);
1586
1587 Int dx[CPU_GRP_SIZE / 2 + 1];
1588 Point pts[CPU_GRP_SIZE];
1589
1590 Int dy;
1591 Int dyn;
1592 Int _s;
1593 Int _p;
1594 Int km,intaux;
1595 Point pp;
1596 Point pn;
1597 grp->Set(dx);
1598
1599
1600
1601 cycles = bsgs_aux / 1024;
1602 if(bsgs_aux % 1024 != 0) {
1603 cycles++;
1604 }
1605
1606
1607 intaux.Set(&BSGS_M_double);
1608 intaux.Mult(CPU_GRP_SIZE/2);
1609 intaux.Add(&BSGS_M);
1610
1611 /*
1612 intaux hold the Current middle range value (Current)
1613 (BSGS_M*2) * (CPU_GRP_SIZE/2) + BSGS_M
1614 or
1615 (BSGS_M * 512) + BSGS_M
1616 */
1617 /*
1618 while base_key is less than n_range_end then:
1619 */
1620 do {
1621
1622 /*
1623 We do this in an atomic pthread_mutex operation to not affect others threads
1624 so BSGS_CURRENT is never the same between threads
1625 */
1626 pthread_mutex_lock(&mutex_bsgs_thread);
1627
1628 base_key.Set(&BSGS_CURRENT); /* we need to set our base_key to the current BSGS_CURRENT value*/
1629 BSGS_CURRENT.Add(&BSGS_N); /*Then add BSGS_N to BSGS_CURRENT*/
1630 BSGS_CURRENT.Add(&BSGS_N); /*Then add BSGS_N to BSGS_CURRENT*/
1631
1632 pthread_mutex_unlock(&mutex_bsgs_thread);

Callers

nothing calls this directly

Calls 15

bloom_checkFunction · 0.85
bsgs_secondcheckFunction · 0.70
SetMethod · 0.45
MultMethod · 0.45
AddMethod · 0.45
IsGreaterOrEqualMethod · 0.45
ComputePublicKeyMethod · 0.45
NegMethod · 0.45
SubMethod · 0.45
equalsMethod · 0.45
GetBase16Method · 0.45
GetPublicKeyHexMethod · 0.45

Tested by

no test coverage detected