From 64662f3090bafa3dc79e98c932682e006d266c44 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Fri, 24 Nov 2023 17:54:38 +0100 Subject: [PATCH 1/3] switch from rand to rand_core the traits used here are rand_core re-exports --- traits/Cargo.toml | 2 +- traits/src/lib.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/traits/Cargo.toml b/traits/Cargo.toml index e041095..0e07640 100644 --- a/traits/Cargo.toml +++ b/traits/Cargo.toml @@ -12,6 +12,6 @@ repository = "https://github.com/franziskuskiefer/hpke-rs" [dependencies] serde_json = { version = "1.0" } serde = { version = "1.0", features = ["derive"] } -rand = { version = "0.8" } +rand_core = { version = "0.6.4" } getrandom = { version = "0.2", features = ["js"] } tls_codec = { version = "0.4.0", features = ["derive"] } diff --git a/traits/src/lib.rs b/traits/src/lib.rs index c205eab..fa1d2bb 100644 --- a/traits/src/lib.rs +++ b/traits/src/lib.rs @@ -7,13 +7,13 @@ pub mod error; pub mod types; // re-export trait -pub use rand::{CryptoRng, RngCore}; +pub use rand_core::{CryptoRng, RngCore}; /// The [`HpkeCrypto`] trait defines the necessary cryptographic functions used /// in the HPKE implementation. pub trait HpkeCrypto: core::fmt::Debug + Send + Sync { /// The PRNG implementation returned in [`HpkeCrypto::prng()`]. - type HpkePrng: rand::RngCore + rand::CryptoRng + HpkeTestRng; + type HpkePrng: RngCore + CryptoRng + HpkeTestRng; /// The name of the implementation. fn name() -> String; @@ -122,7 +122,7 @@ pub trait HpkeCrypto: core::fmt::Debug + Send + Sync { /// PRNG extension for testing that is supposed to return pre-configured bytes. pub trait HpkeTestRng { /// Like [`RngCore::try_fill_bytes`] but the result is expected to be known. - fn try_fill_test_bytes(&mut self, dest: &mut [u8]) -> Result<(), rand::Error>; + fn try_fill_test_bytes(&mut self, dest: &mut [u8]) -> Result<(), rand_core::Error>; /// Set the randomness state of this test PRNG. fn seed(&mut self, seed: &[u8]); From 1208be8c3e69c7cc4b16337ada24f77e10860a18 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Fri, 24 Nov 2023 17:54:57 +0100 Subject: [PATCH 2/3] rm unused serde_json dependency --- traits/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/traits/Cargo.toml b/traits/Cargo.toml index 0e07640..b9d9e55 100644 --- a/traits/Cargo.toml +++ b/traits/Cargo.toml @@ -10,7 +10,6 @@ readme = "Readme.md" repository = "https://github.com/franziskuskiefer/hpke-rs" [dependencies] -serde_json = { version = "1.0" } serde = { version = "1.0", features = ["derive"] } rand_core = { version = "0.6.4" } getrandom = { version = "0.2", features = ["js"] } From 4307e164d28653e93c1501a9dfbd9d21c0062b65 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Fri, 24 Nov 2023 18:02:03 +0100 Subject: [PATCH 3/3] rm unused tls_codec dependency --- traits/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/traits/Cargo.toml b/traits/Cargo.toml index b9d9e55..ea704fc 100644 --- a/traits/Cargo.toml +++ b/traits/Cargo.toml @@ -13,4 +13,3 @@ repository = "https://github.com/franziskuskiefer/hpke-rs" serde = { version = "1.0", features = ["derive"] } rand_core = { version = "0.6.4" } getrandom = { version = "0.2", features = ["js"] } -tls_codec = { version = "0.4.0", features = ["derive"] }