29 #include "pprzlink/pprzlink_transport.h"
30 #include "pprzlink/pprz_transport.h"
44 #define KEY_EXCHANGE_MSG_ID_UAV 239
45 #define KEY_EXCHANGE_MSG_ID_GCS 159
46 #define WHITELIST_LEN 20
103 uint8_t *buf,
bool *msg_available);
bool gec_decrypt_message(uint8_t *buf, volatile uint8_t *payload_len)
Attemp message decryption If a message is unencrypted, pass it through only if the MSG_ID is in the w...
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
bool gec_encrypt_message(uint8_t *buf, uint8_t *payload_len)
Attempts message encryption Adds crypto_byte, counter and tag Returns encrypted pprzlink message (cry...
void gec_process_msg1(uint8_t *buf)
NOTE: for RESPONDER party only Process incoming message (expected MSG1) if the right (KEY_EXCHANGE) m...
void gec_check_and_parse(struct link_device *dev, struct gec_transport *trans, uint8_t *buf, bool *msg_available)
Parsing a frame data and copy the payload to the datalink buffer.
void gec_dl_event(void)
Datalink Event.
Galois embedded crypto implementation.
uint8_t msg[TRANSPORT_PAYLOAD_LEN]
Auxilliary message buffer for storing precomputed key exchange messages.
void gec_dl_init(void)
Init function.
struct transport_tx trans_tx
void gec_add_to_whitelist(struct gec_whitelist *whitelist, uint8_t id)
void respond_sts(struct link_device *dev, struct gec_transport *trans, uint8_t *buf)
bool gec_process_msg3(uint8_t *buf)
Process incoming message (expected MSG3) if the right (KEY_EXCHANGE) message received with the right ...
void finish_sts(struct link_device *dev, struct gec_transport *trans, uint8_t *buf)
struct gec_whitelist whitelist
struct pprz_transport pprz_tp
uint8_t tx_msg[TRANSPORT_PAYLOAD_LEN]
Whitelist for sending and receiving unencrypted messages (mostly for KEY_EXCHANGE messages) ...
void gec_process_sts_msg(struct link_device *dev, struct gec_transport *trans, uint8_t *buf)
uint8_t whitelist[WHITELIST_LEN]
static const struct usb_device_descriptor dev
struct gec_transport gec_tp
PPRZ transport structure.
Utility functions and macros to abstract some RTOS functionalities such as mutexes.
void gec_transport_init(struct gec_transport *t)
struct transport_rx trans_rx
bool gec_is_in_the_whitelist(struct gec_whitelist *whitelist, uint8_t id)