mirror of
https://github.com/rosenpass/rosenpass.git
synced 2025-12-05 20:40:02 -08:00
add fine-grained features
This commit is contained in:
@@ -10,12 +10,16 @@ repository = "https://github.com/rosenpass/rosenpass"
|
||||
readme = "readme.md"
|
||||
|
||||
[features]
|
||||
experiment_libcrux = [
|
||||
"dep:libcrux",
|
||||
"dep:libcrux-blake2",
|
||||
"dep:libcrux-chacha20poly1305",
|
||||
"dep:libcrux-ml-kem",
|
||||
#default = ["experiment_libcrux_all"]
|
||||
|
||||
experiment_libcrux_all = [
|
||||
"experiment_libcrux_blake2",
|
||||
"experiment_libcrux_chachapoly",
|
||||
"experiment_libcrux_kyber",
|
||||
]
|
||||
experiment_libcrux_blake2 = ["dep:libcrux-blake2"]
|
||||
experiment_libcrux_chachapoly = ["dep:libcrux-chacha20poly1305", "dep:libcrux"]
|
||||
experiment_libcrux_kyber = ["dep:libcrux-ml-kem", "dep:rand"]
|
||||
|
||||
[dependencies]
|
||||
anyhow = { workspace = true }
|
||||
@@ -31,10 +35,10 @@ chacha20poly1305 = { workspace = true }
|
||||
blake2 = { workspace = true }
|
||||
libcrux = { workspace = true, optional = true }
|
||||
libcrux-chacha20poly1305 = { workspace = true, optional = true }
|
||||
rand = { workspace = true }
|
||||
libcrux-blake2 = { workspace = true, optional = true }
|
||||
libcrux-ml-kem = { workspace = true, optional = true, features = ["kyber"] }
|
||||
sha3 = { workspace = true }
|
||||
rand = { workspace = true, optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
rand = { workspace = true }
|
||||
|
||||
@@ -18,12 +18,12 @@ pub use crate::subtle::keyed_hash::KeyedHash;
|
||||
|
||||
/// Authenticated encryption with associated data (AEAD)
|
||||
/// Chacha20poly1305 is used.
|
||||
#[cfg(feature = "experiment_libcrux")]
|
||||
#[cfg(feature = "experiment_libcrux_chachapoly")]
|
||||
pub use subtle::libcrux::chacha20poly1305_ietf::ChaCha20Poly1305 as Aead;
|
||||
|
||||
/// Authenticated encryption with associated data (AEAD)
|
||||
/// Chacha20poly1305 is used.
|
||||
#[cfg(not(feature = "experiment_libcrux"))]
|
||||
#[cfg(not(feature = "experiment_libcrux_chachapoly"))]
|
||||
pub use crate::subtle::rust_crypto::chacha20poly1305_ietf::ChaCha20Poly1305 as Aead;
|
||||
|
||||
/// Authenticated encryption with associated data with a extended-length nonce (XAEAD)
|
||||
@@ -38,6 +38,9 @@ pub use rosenpass_oqs::ClassicMceliece460896 as StaticKem;
|
||||
/// Use Kyber-512 as the Static KEM
|
||||
///
|
||||
/// See [rosenpass_oqs::Kyber512] for more details.
|
||||
#[cfg(not(feature = "experiment_libcrux_kyber"))]
|
||||
pub use rosenpass_oqs::Kyber512 as EphemeralKem;
|
||||
#[cfg(feature = "experiment_libcrux_kyber")]
|
||||
pub use subtle::libcrux::kyber512::Kyber512 as EphemeralKem;
|
||||
|
||||
pub mod hash_domain;
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
//! Implementations backed by libcrux, a verified crypto library
|
||||
|
||||
#[cfg(feature = "experiment_libcrux_blake2")]
|
||||
pub mod blake2b;
|
||||
|
||||
#[cfg(feature = "experiment_libcrux_chachapoly")]
|
||||
pub mod chacha20poly1305_ietf;
|
||||
|
||||
#[cfg(feature = "experiment_libcrux_kyber")]
|
||||
pub mod kyber512;
|
||||
|
||||
@@ -6,5 +6,9 @@ pub use rust_crypto::{blake2b, keyed_shake256};
|
||||
pub mod custom;
|
||||
pub mod rust_crypto;
|
||||
|
||||
#[cfg(feature = "experiment_libcrux")]
|
||||
#[cfg(any(
|
||||
feature = "experiment_libcrux_blake2",
|
||||
feature = "experiment_libcrux_chachapoly",
|
||||
feature = "experiment_libcrux_kyber"
|
||||
))]
|
||||
pub mod libcrux;
|
||||
|
||||
Reference in New Issue
Block a user