mirror of
https://github.com/rosenpass/rosenpass.git
synced 2026-01-17 23:36:08 -08:00
Before this, some parts of the code used an incorrect feature flag name, preventing libcrux from being used.
33 lines
958 B
Rust
33 lines
958 B
Rust
use static_assertions::const_assert;
|
|
|
|
pub mod subtle;
|
|
|
|
pub const KEY_LEN: usize = 32;
|
|
const_assert!(KEY_LEN == aead::KEY_LEN);
|
|
const_assert!(KEY_LEN == xaead::KEY_LEN);
|
|
const_assert!(KEY_LEN == hash_domain::KEY_LEN);
|
|
|
|
/// Authenticated encryption with associated data
|
|
pub mod aead {
|
|
#[cfg(not(feature = "experiment_libcrux"))]
|
|
pub use crate::subtle::chacha20poly1305_ietf::{decrypt, encrypt, KEY_LEN, NONCE_LEN, TAG_LEN};
|
|
#[cfg(feature = "experiment_libcrux")]
|
|
pub use crate::subtle::chacha20poly1305_ietf_libcrux::{
|
|
decrypt, encrypt, KEY_LEN, NONCE_LEN, TAG_LEN,
|
|
};
|
|
}
|
|
|
|
/// Authenticated encryption with associated data with a constant nonce
|
|
pub mod xaead {
|
|
pub use crate::subtle::xchacha20poly1305_ietf::{
|
|
decrypt, encrypt, KEY_LEN, NONCE_LEN, TAG_LEN,
|
|
};
|
|
}
|
|
|
|
pub mod hash_domain;
|
|
|
|
pub mod kem {
|
|
pub use rosenpass_oqs::ClassicMceliece460896 as StaticKem;
|
|
pub use rosenpass_oqs::Kyber512 as EphemeralKem;
|
|
}
|