Some small fixes
This commit is contained in:
@ -517,6 +517,7 @@ void * update_predictions_thread(void* p){
|
|||||||
if(space){
|
if(space){
|
||||||
total_states = craptev1_sizeof_space(space);
|
total_states = craptev1_sizeof_space(space);
|
||||||
}
|
}
|
||||||
|
sleep(1); // We don't need to check this more often than once per second
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include "crypto1_bs.h"
|
#include "crypto1_bs.h"
|
||||||
#include "crypto1_bs_crack.h"
|
#include "crypto1_bs_crack.h"
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
#include <math.h>
|
||||||
#define __STDC_FORMAT_MACROS
|
#define __STDC_FORMAT_MACROS
|
||||||
#define llx PRIx64
|
#define llx PRIx64
|
||||||
#define lli PRIi64
|
#define lli PRIi64
|
||||||
@ -16,7 +17,7 @@
|
|||||||
#define VT100_cleareol "\r\33[2K"
|
#define VT100_cleareol "\r\33[2K"
|
||||||
|
|
||||||
uint32_t **space;
|
uint32_t **space;
|
||||||
size_t thread_count = 1;
|
uint8_t thread_count = 1;
|
||||||
|
|
||||||
uint64_t *readnonces(char* fname) {
|
uint64_t *readnonces(char* fname) {
|
||||||
int i, j;
|
int i, j;
|
||||||
@ -120,7 +121,7 @@ int main(int argc, char* argv[]){
|
|||||||
total_states_tested = 0;
|
total_states_tested = 0;
|
||||||
keys_found = 0;
|
keys_found = 0;
|
||||||
|
|
||||||
printf("Starting %zu threads to test %"llu" states\n", thread_count, total_states);
|
printf("Starting %u threads to test %"llu" (~2^%0.2f) states\n", thread_count, total_states, log(total_states) / log(2));
|
||||||
|
|
||||||
signal(SIGALRM, notify_status_offline);
|
signal(SIGALRM, notify_status_offline);
|
||||||
alarm(1);
|
alarm(1);
|
||||||
@ -134,7 +135,9 @@ int main(int argc, char* argv[]){
|
|||||||
|
|
||||||
alarm(0);
|
alarm(0);
|
||||||
|
|
||||||
printf("Tested %"llu" states\n", total_states_tested);
|
printf("\nTested %"llu" states\n", total_states_tested);
|
||||||
|
|
||||||
|
if(!keys_found) fprintf(stderr, "No solution found :(\n");
|
||||||
|
|
||||||
craptev1_destroy_space(space);
|
craptev1_destroy_space(space);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include "crypto1_bs.h"
|
#include "crypto1_bs.h"
|
||||||
#include "crypto1_bs_crack.h"
|
#include "crypto1_bs_crack.h"
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
#include <math.h>
|
||||||
#define __STDC_FORMAT_MACROS
|
#define __STDC_FORMAT_MACROS
|
||||||
#define llx PRIx64
|
#define llx PRIx64
|
||||||
#define lli PRIi64
|
#define lli PRIi64
|
||||||
@ -23,6 +24,10 @@ uint32_t uid;
|
|||||||
uint64_t *readnonces(char* fname){
|
uint64_t *readnonces(char* fname){
|
||||||
int i;
|
int i;
|
||||||
FILE *f = fopen(fname, "rb");
|
FILE *f = fopen(fname, "rb");
|
||||||
|
if (f == NULL) {
|
||||||
|
fprintf(stderr, "Cannot open file.\n");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
uint64_t *nonces = malloc(sizeof (uint64_t) << 24);
|
uint64_t *nonces = malloc(sizeof (uint64_t) << 24);
|
||||||
if(fread(&uid, 1, 4, f)){
|
if(fread(&uid, 1, 4, f)){
|
||||||
uid = rev32(uid);
|
uid = rev32(uid);
|
||||||
@ -119,7 +124,7 @@ int main(int argc, char* argv[]){
|
|||||||
total_states_tested = 0;
|
total_states_tested = 0;
|
||||||
keys_found = 0;
|
keys_found = 0;
|
||||||
|
|
||||||
printf("Starting %u threads to test %"llu" states\n", thread_count, total_states);
|
printf("Starting %u threads to test %"llu" (~2^%0.2f) states\n", thread_count, total_states, log(total_states) / log(2));
|
||||||
|
|
||||||
signal(SIGALRM, notify_status_offline);
|
signal(SIGALRM, notify_status_offline);
|
||||||
alarm(1);
|
alarm(1);
|
||||||
|
Reference in New Issue
Block a user