Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hpks-rs-crypto: simplify Cargo.toml #47

Merged
merged 3 commits into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions traits/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +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 = { version = "0.8" }
rand_core = { version = "0.6.4" }
getrandom = { version = "0.2", features = ["js"] }
tls_codec = { version = "0.4.0", features = ["derive"] }
6 changes: 3 additions & 3 deletions traits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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]);
Expand Down
Loading