diff --git a/.gitignore b/.gitignore index edd5924..dcf3e65 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +bPfile hexcharstoraw *.bin keyhunt diff --git a/bPfile.c b/bPfile.c index 81a31ad..9c0117a 100644 --- a/bPfile.c +++ b/bPfile.c @@ -84,7 +84,7 @@ int main(int argc, char **argv) { mpz_init_set(P.x,G.x); mpz_init_set(P.y,G.y); - p_file = fopen(argv[2],"a+b"); + p_file = fopen(argv[2],"w+b"); if(p_file == NULL) { printf("Can't create file %s\n",argv[2]); diff --git a/keyhunt.c b/keyhunt.c index cdb0d10..4f09f55 100644 --- a/keyhunt.c +++ b/keyhunt.c @@ -247,9 +247,10 @@ int main(int argc, char **argv) { if(bitrange > 0 && bitrange <=256 ) { /*Buscar bit_range_str_min and bit_range_str_max*/ - mpz_pow_ui(MPZAUX,TWO,bitrange); + mpz_pow_ui(MPZAUX,TWO,bitrange-1); bit_range_str_min = mpz_get_str(NULL,16,MPZAUX); - mpz_pow_ui(MPZAUX,TWO,bitrange+1); + mpz_pow_ui(MPZAUX,TWO,bitrange); + mpz_sub_ui(MPZAUX,MPZAUX,1); bit_range_str_max = mpz_get_str(NULL,16,MPZAUX); if(bit_range_str_min == NULL||bit_range_str_max == NULL) { fprintf(stderr,"[E] error malloc()\n");