summaryrefslogtreecommitdiff
path: root/reset-controller/fw/src/crypto.h
diff options
context:
space:
mode:
authorjaseg <git-bigdata-wsl-arch@jaseg.de>2021-04-09 18:38:02 +0200
committerjaseg <git-bigdata-wsl-arch@jaseg.de>2021-04-09 18:38:57 +0200
commit50998fcfb916ae251309bd4b464f2c122e8cb30d (patch)
tree4ecf7a7443b75ab51c4dc0c0fc9289342dc7d6a0 /reset-controller/fw/src/crypto.h
parent312fee491cfab436d52db4b6265107e20f3e1293 (diff)
downloadmaster-thesis-50998fcfb916ae251309bd4b464f2c122e8cb30d.tar.gz
master-thesis-50998fcfb916ae251309bd4b464f2c122e8cb30d.tar.bz2
master-thesis-50998fcfb916ae251309bd4b464f2c122e8cb30d.zip
Repo re-org
Diffstat (limited to 'reset-controller/fw/src/crypto.h')
-rw-r--r--reset-controller/fw/src/crypto.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/reset-controller/fw/src/crypto.h b/reset-controller/fw/src/crypto.h
new file mode 100644
index 0000000..18a9816
--- /dev/null
+++ b/reset-controller/fw/src/crypto.h
@@ -0,0 +1,30 @@
+#ifndef __CRYPTO_H__
+#define __CRYPTO_H__
+
+#include <stdint.h>
+
+/* Presig message length: 15 byte = 120 bit ^= 20 * 6-bit symbols of 5-bit bipolar DSSS */
+#define PRESIG_MSG_LEN 15
+#define OOB_TRIGGER_LEN PRESIG_MSG_LEN
+
+enum trigger_domain {
+ TRIGGER_DOMAIN_ALL,
+ TRIGGER_DOMAIN_VENDOR,
+ TRIGGER_DOMAIN_SERIES,
+ TRIGGER_DOMAIN_COUNTRY,
+ TRIGGER_DOMAIN_REGION,
+ _TRIGGER_DOMAIN_COUNT
+};
+
+extern const char *presig_domain_strings[_TRIGGER_DOMAIN_COUNT];
+extern uint8_t presig_keys[_TRIGGER_DOMAIN_COUNT][PRESIG_MSG_LEN];
+extern int presig_height;
+extern uint8_t presig_bundle_id[16];
+extern uint64_t bundle_timestamp;
+
+extern void oob_trigger_activated(enum trigger_domain domain, int height);
+
+int oob_message_received(uint8_t msg[static OOB_TRIGGER_LEN]);
+int verify_trigger(const uint8_t inkey[PRESIG_MSG_LEN], int *height_out, int *domain_out);
+
+#endif /* __CRYPTO_H__ */