summaryrefslogtreecommitdiff
path: root/utils/nwztools/upgtools/keysig_search.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/nwztools/upgtools/keysig_search.h')
-rw-r--r--utils/nwztools/upgtools/keysig_search.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/utils/nwztools/upgtools/keysig_search.h b/utils/nwztools/upgtools/keysig_search.h
new file mode 100644
index 0000000000..46639dfb47
--- /dev/null
+++ b/utils/nwztools/upgtools/keysig_search.h
@@ -0,0 +1,50 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2012 Amaury Pouly
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef __keysig_search_h__
22#define __keysig_search_h__
23
24#include <stdbool.h>
25#include <stdint.h>
26
27enum keysig_search_method_t
28{
29 KEYSIG_SEARCH_NONE = 0,
30 KEYSIG_SEARCH_FIRST,
31 KEYSIG_SEARCH_ASCII_STUPID = KEYSIG_SEARCH_FIRST,
32 KEYSIG_SEARCH_ASCII_BRUTE,
33 KEYSIG_SEARCH_LAST
34};
35
36/* notify returns true if the key seems ok */
37typedef bool (*keysig_notify_fn_t)(void *user, uint8_t key[8], uint8_t sig[8]);
38/* returns true if a key was accepted by notify */
39typedef bool (*keysig_search_fn_t)(uint8_t *cipher, keysig_notify_fn_t notify, void *user);
40
41struct keysig_search_desc_t
42{
43 const char *name;
44 const char *comment;
45 keysig_search_fn_t fn;
46};
47
48struct keysig_search_desc_t keysig_search_desc[KEYSIG_SEARCH_LAST];
49
50#endif /* __keysig_search_h__ */