lib-q-romulus 0.0.4

Romulus-N and Romulus-M AEAD (SKINNY-128-384+), no_std / wasm-friendly
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Fixed-size secrets copied to the stack behind [`Zeroizing`].

use zeroize::Zeroizing;

/// Block size for Romulus key, nonce, and tag (bytes).
pub(crate) const LEN: usize = 16;

/// Copy `bytes` (must be exactly [`LEN`] bytes) into stack memory cleared on drop.
pub(crate) fn zeroizing_copy_16(bytes: &[u8]) -> Zeroizing<[u8; LEN]> {
    let mut out = Zeroizing::new([0u8; LEN]);
    out.copy_from_slice(bytes);
    out
}