libq/aead.rs
1//! AEAD backed by `lib-q-aead` (SHAKE256-AEAD and feature-gated algorithms).
2//!
3//! Use [`context`] to obtain a configured [`AeadContext`].
4
5#[cfg(all(feature = "alloc", not(feature = "std")))]
6use alloc::boxed::Box;
7
8#[cfg(feature = "alloc")]
9pub use lib_q_core::{
10 AeadContext,
11 AeadKey,
12 Algorithm,
13 Nonce,
14};
15
16/// Returns an `AeadContext` wired to `lib-q-aead`.
17#[cfg(feature = "alloc")]
18pub fn context() -> AeadContext {
19 AeadContext::with_aead_operations(Box::new(
20 lib_q_aead::LibQAeadProvider::new()
21 .expect("lib-q-aead LibQAeadProvider / SecurityValidator initialization"),
22 ))
23}