diff --git a/ciphers/src/lib.rs b/ciphers/src/lib.rs index 12dbca2..ada564e 100644 --- a/ciphers/src/lib.rs +++ b/ciphers/src/lib.rs @@ -2,6 +2,7 @@ use static_assertions::const_assert; pub mod subtle; +/// All keyed primitives in this crate use 32 byte keys pub const KEY_LEN: usize = 32; const_assert!(KEY_LEN == aead::KEY_LEN); const_assert!(KEY_LEN == xaead::KEY_LEN); @@ -19,6 +20,7 @@ pub mod keyed_hash { } /// Authenticated encryption with associated data +/// Chacha20poly1305 is used. pub mod aead { #[cfg(not(feature = "experiment_libcrux"))] pub use crate::subtle::chacha20poly1305_ietf::{decrypt, encrypt, KEY_LEN, NONCE_LEN, TAG_LEN}; @@ -29,6 +31,7 @@ pub mod aead { } /// Authenticated encryption with associated data with a constant nonce +/// XChacha20poly1305 is used. pub mod xaead { pub use crate::subtle::xchacha20poly1305_ietf::{ decrypt, encrypt, KEY_LEN, NONCE_LEN, TAG_LEN, @@ -37,6 +40,12 @@ pub mod xaead { pub mod hash_domain; +/// This crate includes two key encapsulation mechanisms. +/// Namely ClassicMceliece460896 (as [StaticKem]) and Kyber512 (as [EphemeralKem]). +/// +/// See [rosenpass_oqs::ClassicMceliece460896](rosenpass_oqs::ClassicMceliece460896) +/// and [rosenpass_oqs::Kyber512](rosenpass_oqs::Kyber512) for more details on the specific KEMS. +/// pub mod kem { pub use rosenpass_oqs::ClassicMceliece460896 as StaticKem; pub use rosenpass_oqs::Kyber512 as EphemeralKem; diff --git a/ciphers/src/subtle/incorrect_hmac_blake2b.rs b/ciphers/src/subtle/incorrect_hmac_blake2b.rs index 78b0282..27c5f0e 100644 --- a/ciphers/src/subtle/incorrect_hmac_blake2b.rs +++ b/ciphers/src/subtle/incorrect_hmac_blake2b.rs @@ -20,7 +20,6 @@ pub const OUT_MAX: usize = blake2b::OUT_MAX; /// This is a woefully incorrect implementation of hmac_blake2b. /// See /// -/// /// It accepts 32 byte keys, exclusively. /// /// This will be replaced, likely by Kekkac at some point soon. diff --git a/ciphers/src/subtle/mod.rs b/ciphers/src/subtle/mod.rs index b716164..0f19e37 100644 --- a/ciphers/src/subtle/mod.rs +++ b/ciphers/src/subtle/mod.rs @@ -1,7 +1,13 @@ +/// This module provides the following cryptographic schemes: +/// - [blake2b]: The blake2b hash function +/// - [chacha20poly1305_ietf]: The Chacha20Poly1305 AEAD as implemented in [RustCrypto](https://crates.io/crates/chacha20poly1305) (only used when the feature `experiment_libcrux` is disabled. +/// - [chacha20poly1305_ietf_libcrux]: The Chacha20Poly1305 AEAD as implemented in [libcrux](https://github.com/cryspen/libcrux) (only used when the feature `experiment_libcrux` is enabled. +/// - [incorrect_hmac_blake2b]: An (incorrect) hmac based on [blake2b]. +/// - [xchacha20poly1305_ietf] The Chacha20Poly1305 AEAD as implemented in [RustCrypto](https://crates.io/crates/chacha20poly1305) pub mod blake2b; #[cfg(not(feature = "experiment_libcrux"))] pub mod chacha20poly1305_ietf; #[cfg(feature = "experiment_libcrux")] pub mod chacha20poly1305_ietf_libcrux; pub mod incorrect_hmac_blake2b; -pub mod xchacha20poly1305_ietf; +pub mod xchacha20poly1305_ietf; \ No newline at end of file