WIP cryptographic design
This commit is contained in:
parent
b0a5232487
commit
6880468862
9 changed files with 292 additions and 6 deletions
33
controller/fw/src/crypto.h
Normal file
33
controller/fw/src/crypto.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#ifndef __CRYPTO_H__
|
||||
#define __CRYPTO_H__
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <sodium.h>
|
||||
|
||||
|
||||
#define OOB_TRIGGER_LEN 16
|
||||
#define PRESIG_MSG_LEN 16
|
||||
|
||||
|
||||
enum trigger_domain {
|
||||
TRIGGER_DOMAIN_ALL,
|
||||
TRIGGER_DOMAIN_VENDOR,
|
||||
TRIGGER_DOMAIN_SERIES,
|
||||
TRIGGER_DOMAIN_COUNTRY,
|
||||
TRIGGER_DOMAIN_REGION,
|
||||
_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 void oob_trigger_activated(enum trigger_domain domain, int serial);
|
||||
|
||||
int oob_message_received(uint8_t msg[static OOB_TRIGGER_LEN]);
|
||||
|
||||
#endif /* __CRYPTO_H__ */
|
||||
Loading…
Add table
Add a link
Reference in a new issue