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

Function thread_process_bsgs

keyhunt.cpp:3778–4009  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3776DWORD WINAPI thread_process_bsgs(LPVOID vargp) {
3777#else
3778void *thread_process_bsgs(void *vargp) {
3779#endif
3780 // File-related variables
3781 FILE* filekey;
3782 struct tothread* tt;
3783
3784 // Character variables
3785 char xpoint_raw[32], *aux_c, *hextemp;
3786
3787 // Integer variables
3788 Int base_key, keyfound;
3789 IntGroup* grp = new IntGroup(CPU_GRP_SIZE / 2 + 1);
3790 Int dx[CPU_GRP_SIZE / 2 + 1];
3791 Int dy, dyn, _s, _p, km, intaux;
3792
3793 // Point variables
3794 Point base_point, point_aux, point_found;
3795 Point startP;
3796 Point pp, pn;
3797 Point pts[CPU_GRP_SIZE];
3798
3799 // Unsigned integer variables
3800 uint32_t k, l, r, salir, thread_number, cycles;
3801
3802 // Other variables
3803 int hLength = (CPU_GRP_SIZE / 2 - 1);
3804 grp->Set(dx);
3805
3806 tt = (struct tothread *)vargp;
3807 thread_number = tt->nt;
3808 free(tt);
3809
3810 cycles = bsgs_aux / 1024;
3811 if(bsgs_aux % 1024 != 0) {
3812 cycles++;
3813 }
3814
3815 intaux.Set(&BSGS_M_double);
3816 intaux.Mult(CPU_GRP_SIZE/2);
3817 intaux.Add(&BSGS_M);
3818
3819 do {
3820 /*
3821 We do this in an atomic pthread_mutex operation to not affect others threads
3822 so BSGS_CURRENT is never the same between threads
3823 */
3824#if defined(_WIN64) && !defined(__CYGWIN__)
3825 WaitForSingleObject(bsgs_thread, INFINITE);
3826#else
3827 pthread_mutex_lock(&bsgs_thread);
3828#endif
3829
3830 base_key.Set(&BSGS_CURRENT); /* we need to set our base_key to the current BSGS_CURRENT value*/
3831 BSGS_CURRENT.Add(&BSGS_N_double); /*Then add 2*BSGS_N to BSGS_CURRENT*/
3832 /*
3833 BSGS_CURRENT.Add(&BSGS_N); //Then add BSGS_N to BSGS_CURRENT
3834 BSGS_CURRENT.Add(&BSGS_N); //Then add BSGS_N to BSGS_CURRENT
3835 */

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
GetBase16Method · 0.45
ComputePublicKeyMethod · 0.45
NegMethod · 0.45
SubMethod · 0.45
AddDirectMethod · 0.45
ModSubMethod · 0.45

Tested by

no test coverage detected