|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
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
42 #define PPRZ_GEC_IDX 0
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
void gec_clear_sts(struct gec_sts_ctx *sts)
uint8_t nonce[PPRZ_NONCE_LEN]
struct gec_privkey my_private_ephemeral
unsigned char ed25519_signature[64]
struct gec_pubkey their_public_ephemeral
void gec_derive_key_material(struct gec_sts_ctx *sts, uint8_t *z)
Derive key material for both sender and receiver.
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]
arch independent Random Number Generator API
struct gec_sym_key tx_sym_key
uint8_t pub[PPRZ_KEY_LEN]
void gec_generate_ephemeral_keys(struct gec_privkey *sk)
Generate private and public key pairs for future use.
uint8_t priv[PPRZ_KEY_LEN]
struct gec_privkey my_private_key
struct gec_pubkey their_public_key
@ UNEXPECTED_MSG_DATA_ERROR
void gec_sts_init(struct gec_sts_ctx *sts)
struct gec_sym_key rx_sym_key
void gec_counter_to_bytes(uint32_t n, uint8_t *bytes)
Convert counter to bytes in network byte order.
uint8_t pub[PPRZ_KEY_LEN]
@ UNEXPECTED_MSG_TYPE_ERROR