Skip to content

Commit

Permalink
(broken) Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda committed Feb 18, 2022
1 parent 4523d65 commit 55fad1b
Show file tree
Hide file tree
Showing 19 changed files with 881 additions and 649 deletions.
59 changes: 24 additions & 35 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,14 @@ rust-version = "1.56"
version = "2.0.0-pre.1"

[features]
default = ["ristretto255_u64", "serde"]
p256 = ["p256_", "voprf/p256"]
ristretto255 = []
ristretto255_fiat_u32 = [
"curve25519-dalek/fiat_u32_backend",
"ristretto255",
"voprf/ristretto255_fiat_u32",
]
ristretto255_fiat_u64 = [
"curve25519-dalek/fiat_u64_backend",
"ristretto255",
"voprf/ristretto255_fiat_u64",
]
ristretto255_simd = [
"curve25519-dalek/simd_backend",
"ristretto255",
"voprf/ristretto255_simd",
]
ristretto255_u32 = [
"curve25519-dalek/u32_backend",
"ristretto255",
"voprf/ristretto255_u32",
]
ristretto255_u64 = [
"curve25519-dalek/u64_backend",
"ristretto255",
"voprf/ristretto255_u64",
]
default = ["ristretto255_u64", "ristretto255_voprf", "serde"]
ristretto255 = ["voprf/ristretto255"]
ristretto255_fiat_u32 = ["curve25519-dalek/fiat_u32_backend", "ristretto255"]
ristretto255_fiat_u64 = ["curve25519-dalek/fiat_u64_backend", "ristretto255"]
ristretto255_simd = ["curve25519-dalek/simd_backend", "ristretto255"]
ristretto255_u32 = ["curve25519-dalek/u32_backend", "ristretto255"]
ristretto255_u64 = ["curve25519-dalek/u64_backend", "ristretto255"]
ristretto255_voprf = ["ristretto255", "voprf/ristretto255-ciphersuite"]
serde = ["serde_", "generic-array/serde", "voprf/serde"]
slow-hash = ["argon2"]
std = ["getrandom", "rand/std", "rand/std_rng", "voprf/std"]
Expand All @@ -60,26 +40,24 @@ argon2 = { version = "0.3", default-features = false, features = [
"alloc",
], optional = true }
constant_time_eq = "0.1"
curve25519-dalek = { version = "3", default-features = false, optional = true }
derive-where = { version = "1.0.0-rc.1", features = ["zeroize"] }
curve25519-dalek = { version = "=4.0.0-pre.1", default-features = false, optional = true }
derive-where = { version = "=1.0.0-rc.2", features = ["zeroize-on-drop"] }
digest = "0.10"
displaydoc = { version = "0.2", default-features = false }
elliptic-curve = { version = "0.12.0-pre.1", features = ["sec1"] }
generic-array = "0.14"
getrandom = { version = "0.2", optional = true }
hkdf = "0.12"
hmac = "0.12"
p256_ = { package = "p256", version = "0.10", default-features = false, features = [
"arithmetic",
], optional = true }
rand = { version = "0.8", default-features = false }
serde_ = { version = "1", package = "serde", default-features = false, features = [
"derive",
], optional = true }
subtle = { version = "2.3", default-features = false }
voprf = { git = "https://github.com/novifinancial/voprf", rev = "55ef981a3f9a12eddd8c372ffdf51818011343ee", default-features = false, features = [
voprf = { version = "0.3", default-features = false, features = [
"danger",
] }
x25519-dalek = { version = "1", default-features = false, optional = true }
x25519-dalek = { version = "=2.0.0-pre.1", default-features = false, optional = true }
zeroize = { version = "1", features = ["zeroize_derive"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
Expand All @@ -93,6 +71,7 @@ criterion = "0.3"
hex = "0.4"
json = "0.12"
lazy_static = "1"
p256 = { version = "=0.11.0-pre.0", default-features = false }
proptest = "1"
regex = "1"
rustyline = "9"
Expand All @@ -102,3 +81,13 @@ sha2 = "0.10"
[[bench]]
harness = false
name = "opaque"

[package.metadata.docs.rs]
features = ["std", "slow-hash", "x25519_u64"]
targets = []

[patch.crates-io]
chacha20 = { git = "https://github.com/RustCrypto/stream-ciphers" }
chacha20poly1305 = { git = "https://github.com/khonsulabs/aeads", branch = "update-dependencies" }
poly1305 = { git = "https://github.com/RustCrypto/universal-hashes" }
voprf = { git = "https://github.com/khonsulabs/voprf", branch = "v08" }
2 changes: 1 addition & 1 deletion benches/opaque.rs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static SUFFIX: &str = "ristretto255_u32";
static SUFFIX: &str = "ristretto255_fiat_u64";
#[cfg(feature = "ristretto255_fiat_u32")]
static SUFFIX: &str = "ristretto255_fiat_u32";
#[cfg(all(not(feature = "ristretto255"), feature = "p256"))]
#[cfg(all(not(feature = "ristretto255")))]
static SUFFIX: &str = "p256";

struct Default;
Expand Down
25 changes: 14 additions & 11 deletions src/ciphersuite.rs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
//! OPAQUE

use digest::core_api::{BlockSizeUser, CoreProxy};
use generic_array::typenum::{IsLess, Le, NonZero, U256};
use voprf::Group as OprfGroup;
use digest::OutputSizeUser;
use generic_array::typenum::{IsLess, IsLessOrEqual, Le, NonZero, U256};

use crate::hash::{Hash, ProxyHash};
use crate::key_exchange::group::KeGroup;
Expand All @@ -28,21 +28,24 @@ use crate::slow_hash::SlowHash;
/// * `SlowHash`: A slow hashing function, typically used for password hashing
pub trait CipherSuite
where
<Self::Hash as CoreProxy>::Core: ProxyHash,
<<Self::Hash as CoreProxy>::Core as BlockSizeUser>::BlockSize: IsLess<U256>,
Le<<<Self::Hash as CoreProxy>::Core as BlockSizeUser>::BlockSize, U256>: NonZero,
<OprfHash<Self> as OutputSizeUser>::OutputSize:
IsLess<U256> + IsLessOrEqual<<OprfHash<Self> as BlockSizeUser>::BlockSize>,
OprfHash<Self>: Hash,
<OprfHash<Self> as CoreProxy>::Core: ProxyHash,
<<OprfHash<Self> as CoreProxy>::Core as BlockSizeUser>::BlockSize: IsLess<U256>,
Le<<<OprfHash<Self> as CoreProxy>::Core as BlockSizeUser>::BlockSize, U256>: NonZero,
{
/// A finite cyclic group along with a point representation along with an
/// extension trait PasswordToCurve that allows some customization on how to
/// hash a password to a curve point. See `group::Group`.
type OprfGroup: OprfGroup;
type OprfGroup: voprf::CipherSuite;
/// A `Group` used for the `KeyExchange`.
type KeGroup: KeGroup;
/// A key exchange protocol
type KeyExchange: KeyExchange<Self::Hash, Self::KeGroup>;
/// The main hash function use (for HKDF computations and hashing
/// transcripts)
type Hash: Hash;
type KeyExchange: KeyExchange<OprfHash<Self>, Self::KeGroup>;
/// A slow hashing function, typically used for password hashing
type SlowHash: SlowHash<Self::Hash>;
type SlowHash: SlowHash;
}

pub type OprfGroup<CS> = <<CS as CipherSuite>::OprfGroup as voprf::CipherSuite>::Group;
pub type OprfHash<CS> = <<CS as CipherSuite>::OprfGroup as voprf::CipherSuite>::Hash;

0 comments on commit 55fad1b

Please sign in to comment.