| 4792 | DWORD WINAPI thread_process_bsgs_dance(LPVOID vargp) { |
| 4793 | #else |
| 4794 | void *thread_process_bsgs_dance(void *vargp) { |
| 4795 | #endif |
| 4796 | |
| 4797 | Point pts[CPU_GRP_SIZE]; |
| 4798 | Int dx[CPU_GRP_SIZE / 2 + 1]; |
| 4799 | Point pp,pn,startP,base_point,point_aux,point_found; |
| 4800 | FILE *filekey; |
| 4801 | struct tothread *tt; |
| 4802 | char xpoint_raw[32],*aux_c,*hextemp; |
| 4803 | Int base_key,keyfound,dy,dyn,_s,_p,km,intaux; |
| 4804 | IntGroup *grp = new IntGroup(CPU_GRP_SIZE / 2 + 1); |
| 4805 | uint32_t k,l,r,salir,thread_number,entrar,cycles; |
| 4806 | int hLength = (CPU_GRP_SIZE / 2 - 1); |
| 4807 | |
| 4808 | grp->Set(dx); |
| 4809 | |
| 4810 | tt = (struct tothread *)vargp; |
| 4811 | thread_number = tt->nt; |
| 4812 | free(tt); |
| 4813 | |
| 4814 | cycles = bsgs_aux / 1024; |
| 4815 | if(bsgs_aux % 1024 != 0) { |
| 4816 | cycles++; |
| 4817 | } |
| 4818 | |
| 4819 | intaux.Set(&BSGS_M_double); |
| 4820 | intaux.Mult(CPU_GRP_SIZE/2); |
| 4821 | intaux.Add(&BSGS_M); |
| 4822 | |
| 4823 | entrar = 1; |
| 4824 | |
| 4825 | |
| 4826 | /* |
| 4827 | while base_key is less than n_range_end then: |
| 4828 | */ |
| 4829 | do { |
| 4830 | r = rand() % 3; |
| 4831 | #if defined(_WIN64) && !defined(__CYGWIN__) |
| 4832 | WaitForSingleObject(bsgs_thread, INFINITE); |
| 4833 | #else |
| 4834 | pthread_mutex_lock(&bsgs_thread); |
| 4835 | #endif |
| 4836 | switch(r) { |
| 4837 | case 0: //TOP |
| 4838 | if(n_range_end.IsGreater(&BSGS_CURRENT)) { |
| 4839 | /* |
| 4840 | n_range_end.Sub(&BSGS_N); |
| 4841 | n_range_end.Sub(&BSGS_N); |
| 4842 | */ |
| 4843 | n_range_end.Sub(&BSGS_N_double); |
| 4844 | if(n_range_end.IsLower(&BSGS_CURRENT)) { |
| 4845 | base_key.Set(&BSGS_CURRENT); |
| 4846 | } |
| 4847 | else { |
| 4848 | base_key.Set(&n_range_end); |
| 4849 | } |
| 4850 | } |
| 4851 | else { |
nothing calls this directly
no test coverage detected