Skip to content

Commit

Permalink
-b param fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
albertobsd committed Mar 8, 2021
1 parent 15af06e commit 8c6eb83
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
bPfile
hexcharstoraw
*.bin
keyhunt
Expand Down
2 changes: 1 addition & 1 deletion bPfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
5 changes: 3 additions & 2 deletions keyhunt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 8c6eb83

Please sign in to comment.