| 1573 | } |
| 1574 | |
| 1575 | void *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); |
nothing calls this directly
no test coverage detected