From 42ed4e96e0cb1e657e9f622c385fac8a9f96c286 Mon Sep 17 00:00:00 2001 From: DcruBro Date: Tue, 20 Oct 2026 16:25:21 +0200 Subject: [PATCH] key definitions --- include/bravais.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/include/bravais.h b/include/bravais.h index ef3ed6f..f84e6b1 100644 --- a/include/bravais.h +++ b/include/bravais.h @@ -22,7 +22,19 @@ extern "C" { #define BRAVAIS_MAX_DATAGRAM_SIZE 1500 #define BRAVAIS_MAX_PLAINTEXT_SIZE 65535 -#define BRAVAIS_KEY_LENGTH 32 // For X25519 private and public - do PQC later +#define BRAVAIS_NONCE_LENGTH 12 +#define BRAVAIS_AEAD_TAG_LENGTH 16 // Poly1305 and GCM alike +#define BRAVAIS_CHACHA20_POLY1305_KEY_LENGTH 32 +#define BRAVAIS_QUIC_INITIAL_KEY_LENGTH 16 // AES-128-GCM +#define BRAVAIS_QUIC_INITIAL_IV_LENGTH 12 // XORed with the packet number +#define BRAVAIS_QUIC_HP_KEY_LENGTH 16 // AES-128-ECB header protection +#define BRAVAIS_QUIC_HP_SAMPLE_LENGTH 16 +#define BRAVAIS_X25519_KEY_LENGTH 32 // For X25519 private and public +#define BRAVAIS_ML_KEM_768_PUBLIC_KEY_LENGTH 1184 // encapsulation key +#define BRAVAIS_ML_KEM_768_PRIVATE_KEY_LENGTH 2400 // decapsulation key, expanded +#define BRAVAIS_ML_KEM_768_SEED_LENGTH 64 // d || z, expands to the private key +#define BRAVAIS_ML_KEM_768_CIPHERTEXT_LENGTH 1088 +#define BRAVAIS_ML_KEM_768_SHARED_SECRET_LENGTH 32 typedef enum { // Error codes; Generally <0 = error, 0 = success