32#include "generated/keys_uav.h" 
   33#include "../ext/hacl-c/Hacl_Ed25519.h" 
   34#include "../ext/hacl-c/Hacl_Curve25519.h" 
   35#include "../ext/hacl-c/Hacl_SHA2_512.h" 
   36#include "../ext/hacl-c/Hacl_Chacha20Poly1305.h" 
   37#include "../ext/hacl-c/kremlib.h" 
   39#define PPRZ_MSG_TYPE_PLAINTEXT 0xaa 
   40#define PPRZ_MSG_TYPE_ENCRYPTED 0x55 
   44#define PPRZ_CNTR_IDX 1 
   46#define PPRZ_AUTH_IDX 5 
   49#define PPRZ_SIGN_LEN 64 
   51#define PPRZ_HASH_LEN 64 
   53#define PPRZ_KEY_LEN 32 
   55#define PPRZ_MAC_LEN 16 
   57#define PPRZ_NONCE_LEN 12 
   59#define PPRZ_COUNTER_LEN 4 
   61#define PPRZ_CRYPTO_OVERHEAD 20 
   63#define PPRZ_CURVE_BASEPOINT 9 
struct gec_pubkey their_public_key
uint8_t pub[PPRZ_KEY_LEN]
uint8_t pub[PPRZ_KEY_LEN]
void gec_derive_key_material(struct gec_sts_ctx *sts, uint8_t *z)
Derive key material for both sender and receiver.
struct gec_privkey my_private_ephemeral
struct gec_sym_key tx_sym_key
uint8_t nonce[PPRZ_NONCE_LEN]
void gec_counter_to_bytes(uint32_t n, uint8_t *bytes)
Convert counter to bytes in network byte order.
uint8_t priv[PPRZ_KEY_LEN]
void gec_clear_sts(struct gec_sts_ctx *sts)
unsigned char ed25519_signature[64]
void gec_sts_init(struct gec_sts_ctx *sts)
void gec_generate_ephemeral_keys(struct gec_privkey *sk)
Generate private and public key pairs for future use.
struct gec_pubkey their_public_ephemeral
@ UNEXPECTED_MSG_TYPE_ERROR
@ UNEXPECTED_MSG_DATA_ERROR
struct gec_sym_key rx_sym_key
uint32_t gec_bytes_to_counter(uint8_t *bytes)
Convert from network byte order (big endian) to the machine byte order.
uint8_t key[PPRZ_KEY_LEN]
struct gec_privkey my_private_key
arch independent Random Number Generator API
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.