summaryrefslogtreecommitdiff
path: root/controller/fw/src/crypto.h
diff options
context:
space:
mode:
authorjaseg <git-bigdata-wsl-arch@jaseg.de>2020-03-10 12:20:55 +0100
committerjaseg <git-bigdata-wsl-arch@jaseg.de>2020-03-10 12:20:55 +0100
commit0cd07d397fb5a5e7710af66cb1e9e0b61705c94a (patch)
tree165d2e639614ae662f552b0d5cd88b3d8041f1db /controller/fw/src/crypto.h
parent6880468862a498d359a0a6ed4bd9dd116a478fa9 (diff)
downloadmaster-thesis-0cd07d397fb5a5e7710af66cb1e9e0b61705c94a.tar.gz
master-thesis-0cd07d397fb5a5e7710af66cb1e9e0b61705c94a.tar.bz2
master-thesis-0cd07d397fb5a5e7710af66cb1e9e0b61705c94a.zip
Crypto v2 draft working
Diffstat (limited to 'controller/fw/src/crypto.h')
-rw-r--r--controller/fw/src/crypto.h20
1 files changed, 8 insertions, 12 deletions
diff --git a/controller/fw/src/crypto.h b/controller/fw/src/crypto.h
index 61a0da8..05a3c0d 100644
--- a/controller/fw/src/crypto.h
+++ b/controller/fw/src/crypto.h
@@ -3,12 +3,8 @@
#include <stdint.h>
-#include <sodium.h>
-
-
-#define OOB_TRIGGER_LEN 16
#define PRESIG_MSG_LEN 16
-
+#define OOB_TRIGGER_LEN PRESIG_MSG_LEN
enum trigger_domain {
TRIGGER_DOMAIN_ALL,
@@ -19,15 +15,15 @@ enum trigger_domain {
_TRIGGER_DOMAIN_COUNT
};
-extern uint8_t presig_store[_TRIGGER_DOMAIN_COUNT][PRESIG_STORE_SIZE][crypto_sign_BYTES];
-extern uint8_t oob_trigger_pubkey[crypto_sign_PUBLICKEYBYTES];
-extern uint8_t presig_messages[_TRIGGER_DOMAIN_COUNT][PRESIG_STORE_SIZE][PRESIG_MSG_LEN];
-extern uint8_t oob_presig_iv[16];
-extern int presig_first_serial;
-
+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 serial);
+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__ */