mirror of
https://github.com/rosenpass/rosenpass.git
synced 2026-02-28 06:23:08 -08:00
- Use a new nomenclature for these functions based on the idea of a hash domain (as in domain separation); this makes much more sence - Remove the ciphers::hash export; we did not even export a hash function in the purest sence of the word. This gets us around the difficulty of figuring out what we should call the underlying primitive
25 lines
645 B
Rust
25 lines
645 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 {
|
|
pub use rosenpass_sodium::aead::chacha20poly1305_ietf::{
|
|
decrypt, encrypt, KEY_LEN, NONCE_LEN, TAG_LEN,
|
|
};
|
|
}
|
|
|
|
/// Authenticated encryption with associated data with a constant nonce
|
|
pub mod xaead {
|
|
pub use rosenpass_sodium::aead::xchacha20poly1305_ietf::{
|
|
decrypt, encrypt, KEY_LEN, NONCE_LEN, TAG_LEN,
|
|
};
|
|
}
|
|
|
|
pub mod hash_domain;
|