mode bsgs for fast key search and bloom filter updated

This commit is contained in:
AlbertoBSD
2021-01-27 02:07:17 +01:00
parent e6eb2f1ed1
commit 21039af45b
4 changed files with 1270 additions and 294 deletions

View File

@@ -1,25 +1,30 @@
#Version 0.1.20210112 BSGS
- Added mode BSGS this work with a file with uncompressed keys
- Updated bloom filter to allow More items
#Version 0.1.20201228
- Change Quicksort to Introsort, this solve some edge cases of quicksort.
- Introsort is avaible to keyhunt and hexcharstoraw. worst case. O(N log N).
- Aling of some output text
Version 0.1.20201223
#Version 0.1.20201223
- Added new tool hexcharstoraw to create a raw binary file for xpoint from a text-hexadecimal file
- Added option -w to work with raw binary file, this file contains xpoint in binary format fixed to 32 bytes
Version 0.1.20201222
#Version 0.1.20201222
- Fixed some ugly bug in the searchbinary function thanks to Ujang
- Added to stdout the vanitykeys found with -v option
Version 0.1.20201221
#Version 0.1.20201221
- Fixed search by xpoint.
- Added -e option to skip the sort process whe the file is already sorted.
- Fixed debugcount when upto N is less than debugcount.
- Changed "-R upto" to "-R" and added "-n upto" option.
Version 0.1.20201218
#Version 0.1.20201218
- Minor bugs fixed.
Version 0.1.20201217
#Version 0.1.20201217
- First Realease
- Thanks to all CryptoHunters to make this code possible

View File

@@ -97,18 +97,18 @@ int bloom_init2(struct bloom * bloom, unsigned int entries, double error)
bloom->entries = entries;
bloom->error = error;
double num = -log(bloom->error);
double denom = 0.480453013918201; // ln(2)^2
long double num = -log(bloom->error);
long double denom = 0.480453013918201; // ln(2)^2
bloom->bpe = (num / denom);
long double dentries = (long double)entries;
long double allbits = dentries * bloom->bpe;
bloom->bits = (unsigned int)allbits;
bloom->bits = (unsigned long long int)allbits;
if (bloom->bits % 8) {
bloom->bytes = (bloom->bits / 8) + 1;
bloom->bytes = (unsigned int) (bloom->bits / 8) + 1;
} else {
bloom->bytes = bloom->bits / 8;
bloom->bytes = (unsigned int) bloom->bits / 8;
}
bloom->hashes = (unsigned char)ceil(0.693147180559945 * bloom->bpe); // ln(2)
@@ -146,7 +146,7 @@ void bloom_print(struct bloom * bloom)
printf(" ->version = %d.%d\n", bloom->major, bloom->minor);
printf(" ->entries = %u\n", bloom->entries);
printf(" ->error = %f\n", bloom->error);
printf(" ->bits = %u\n", bloom->bits);
printf(" ->bits = %llu\n", bloom->bits);
printf(" ->bits per elem = %f\n", bloom->bpe);
printf(" ->bytes = %u", bloom->bytes);
unsigned int KB = bloom->bytes / 1024;

View File

@@ -25,7 +25,7 @@ struct bloom
// Client code may read these values if desired. Client code MUST NOT
// modify any of these.
unsigned int entries;
unsigned int bits;
unsigned long long int bits;
unsigned int bytes;
unsigned char hashes;
double error;

1535
keyhunt.c

File diff suppressed because it is too large Load Diff