mq-bridge 0.3.9

An asynchronous message bridging library connecting Kafka, MQTT, AMQP, NATS, MongoDB, HTTP, and more.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//  mq-bridge
//  © Copyright 2026, by Marco Mengelkoch
//  Licensed under MIT License, see License file for more details
//  git clone https://github.com/marcomq/mq-bridge

//! Wire-format constants of the crypto envelope. Kept out of [`super::crypto`]
//! so at-rest detection still works without the `encryption` feature.

pub(crate) const ENVELOPE_VERSION: u8 = 1;
pub(crate) const CIPHER_XCHACHA: u8 = 0;
pub(crate) const CIPHER_AES_GCM: u8 = 1;
#[cfg(feature = "encryption")]
pub(crate) const XCHACHA_NONCE_LEN: usize = 24;
pub(crate) const AES_GCM_NONCE_LEN: usize = 12;

/// Header (`version`, `cipher`, `key_id_len`) + shortest key id + shortest nonce.
pub(crate) const MIN_ENVELOPE_LEN: usize = 3 + 1 + AES_GCM_NONCE_LEN;