diff options
Diffstat (limited to 'utils/nwztools/upgtools/keysig_search.h')
-rw-r--r-- | utils/nwztools/upgtools/keysig_search.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/utils/nwztools/upgtools/keysig_search.h b/utils/nwztools/upgtools/keysig_search.h index 9009a73284..f419e2621c 100644 --- a/utils/nwztools/upgtools/keysig_search.h +++ b/utils/nwztools/upgtools/keysig_search.h | |||
@@ -23,30 +23,30 @@ | |||
23 | 23 | ||
24 | #include <stdbool.h> | 24 | #include <stdbool.h> |
25 | #include <stdint.h> | 25 | #include <stdint.h> |
26 | #include <stddef.h> | ||
26 | #include "fwp.h" | 27 | #include "fwp.h" |
27 | 28 | ||
28 | enum keysig_search_method_t | 29 | enum keysig_search_method_t |
29 | { | 30 | { |
30 | KEYSIG_SEARCH_NONE = 0, | 31 | KEYSIG_SEARCH_NONE = 0, |
31 | KEYSIG_SEARCH_FIRST, | 32 | KEYSIG_SEARCH_FIRST, |
32 | KEYSIG_SEARCH_ASCII_STUPID = KEYSIG_SEARCH_FIRST, | 33 | KEYSIG_SEARCH_ASCII_HEX = KEYSIG_SEARCH_FIRST, |
33 | KEYSIG_SEARCH_ASCII_BRUTE, | ||
34 | KEYSIG_SEARCH_LAST | 34 | KEYSIG_SEARCH_LAST |
35 | }; | 35 | }; |
36 | 36 | ||
37 | /* notify returns true if the key seems ok */ | 37 | /* notify returns true if the key seems ok */ |
38 | typedef bool (*keysig_notify_fn_t)(void *user, uint8_t key[NWZ_KEY_SIZE], | 38 | typedef bool (*keysig_notify_fn_t)(void *user, uint8_t key[NWZ_KEY_SIZE], |
39 | uint8_t sig[NWZ_SIG_SIZE]); | 39 | uint8_t sig[NWZ_SIG_SIZE]); |
40 | /* returns true if a key was accepted by notify */ | ||
41 | typedef bool (*keysig_search_fn_t)(uint8_t *cipher, keysig_notify_fn_t notify, void *user); | ||
42 | 40 | ||
43 | struct keysig_search_desc_t | 41 | struct keysig_search_desc_t |
44 | { | 42 | { |
45 | const char *name; | 43 | const char *name; |
46 | const char *comment; | 44 | const char *comment; |
47 | keysig_search_fn_t fn; | ||
48 | }; | 45 | }; |
49 | 46 | ||
50 | struct keysig_search_desc_t keysig_search_desc[KEYSIG_SEARCH_LAST]; | 47 | struct keysig_search_desc_t keysig_search_desc[KEYSIG_SEARCH_LAST]; |
51 | 48 | ||
49 | bool keysig_search(int method, uint8_t *enc_buf, size_t buf_sz, | ||
50 | keysig_notify_fn_t notify, void *user, int nr_threads); | ||
51 | |||
52 | #endif /* __keysig_search_h__ */ | 52 | #endif /* __keysig_search_h__ */ |