1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-keygen synced 2026-06-18 04:00:03 +02:00

search: define a key_result struct and store position and length in public key for the word found.

This commit is contained in:
Henrik Hautakoski 2020-01-16 14:04:54 +01:00
parent 8c8d88c631
commit 075144c72b
4 changed files with 26 additions and 14 deletions

View file

@ -21,10 +21,10 @@ static void _thr_proc(const strlist_t& word_list) {
struct ec_keypair pair;
while (g_count < g_max) {
std::string word;
struct key_result res;
ec_generate_key(&pair);
if (key_contains_word(&pair, word_list, word)) {
if (key_contains_word(&pair, word_list, &res)) {
// Guard output with mutex, so we don't get
// interrupted mid write and can write to g_count safely.
@ -39,7 +39,7 @@ static void _thr_proc(const strlist_t& word_list) {
// Update count and print result.
g_count++;
key_search_result(word, &pair);
key_search_result(&pair, &res);
}
}
}