General improvements (#250)

* Remove unnecessary constraints on hash

* Remove unnecessary `Result` on `KeyPair::generate_random`

* Fix de-serialization issue on `Ke1State`

* Fix rustfmt

* Remove allocations in `envelope`

* Run Clippy for tests and rustdoc lints too

* Fix `Debug` implementation

* Fix missing constraints on `ClientRegistration`

* Fix de-serialization

* Pin temporary dependency

* Update dependencies

* Replace macro with derive-where

* Remove unnecessary installation of Rust components

* Improve macro naming

* Implement `Copy`, `Debug`, `Ord` and `PartialOrd` for high-level items

* Add `rust-version` field to `Cargo.toml`

* Remove unnecessary allocations

* Fix MSRV

* Fix no_std

* Remove unnecessary allocations

* Remove unnecessary allocations

* Not importing items from voprf helps readability

* Fix rustdoc

* Remove unnecessary allocations

* Remove unnecessary allocations

* Replace `Vec` from `diffie_hellman` with `GenericArray`

* Remove unnecessary allocations

* Remove unnecessary allocations

* Remove `cfg(feature = bench)` guard for `missing_docs`

* Fix documentation

* Remove all remaining allocations from `KeyExchange`

* Improve type-safety

* Remove all remaining allocations in `keypair`

* Remove last remaining allocations except `NonVerifiableClient` input

* Remove base64 encoding in Serde implementation

* Remove unnecessary Serde `alloc` feature

* Make curve25519-dalek optional

* Rename `serialize` crate feature to `serde`

* Switch `KeGroup` implementations to higher-level libraries

- Fixes missing clamping in X25519
- X25519 is now a separate crate feature

* Fix typo
This commit is contained in:
daxpedda
2022-01-03 15:50:40 -08:00
committed by GitHub
parent d59d0b775b
commit 82e4436d39
25 changed files with 3604 additions and 2606 deletions
Regular → Executable
+25 -13
View File
@@ -10,22 +10,33 @@ license = "Apache-2.0 OR MIT"
edition = "2018"
readme = "README.md"
resolver = "2"
rust-version = "1.51"
[features]
default = ["u64_backend", "serialize"]
default = ["ristretto255_u64", "serde"]
slow-hash = ["argon2"]
p256 = ["p256_", "voprf/p256"]
bench = []
u64_backend = ["curve25519-dalek/u64_backend", "voprf/ristretto255_u64"]
u32_backend = ["curve25519-dalek/u32_backend", "voprf/ristretto255_u32"]
std = ["curve25519-dalek/std", "getrandom", "rand/std", "rand/std_rng", "voprf/std"]
serialize = ["serde", "base64", "generic-array/serde", "curve25519-dalek/serde", "voprf/serde"]
ristretto255 = []
ristretto255_u64 = ["curve25519-dalek/u64_backend", "ristretto255", "voprf/ristretto255_u64"]
ristretto255_u32 = ["curve25519-dalek/u32_backend", "ristretto255", "voprf/ristretto255_u32"]
ristretto255_fiat_u64 = ["curve25519-dalek/fiat_u64_backend", "ristretto255", "voprf/ristretto255_fiat_u64"]
ristretto255_fiat_u32 = ["curve25519-dalek/fiat_u32_backend", "ristretto255", "voprf/ristretto255_fiat_u32"]
ristretto255_simd = ["curve25519-dalek/simd_backend", "ristretto255", "voprf/ristretto255_simd"]
x25519 = []
x25519_u64 = ["x25519", "x25519-dalek/u64_backend"]
x25519_u32 = ["x25519", "x25519-dalek/u32_backend"]
x25519_fiat_u64 = ["x25519", "x25519-dalek/fiat_u64_backend"]
x25519_fiat_u32 = ["x25519", "x25519-dalek/fiat_u32_backend"]
# x25519-dalek isn't properly re-exposing `simd_backend`.
x25519_simd = ["curve25519-dalek/simd_backend", "x25519", "x25519-dalek/nightly"]
std = ["getrandom", "rand/std", "rand/std_rng", "voprf/std"]
serde = ["serde_", "generic-array/serde", "voprf/serde"]
[dependencies]
argon2 = { version = "0.3", default-features = false, features = ["alloc"], optional = true }
base64 = { version = "0.13", default-features = false, features = ["alloc"], optional = true }
constant_time_eq = "0.1"
curve25519-dalek = { version = "3", default-features = false }
curve25519-dalek = { version = "3", default-features = false, optional = true }
derive-where = { version = "1.0.0-rc.1", features = ["zeroize"] }
digest = "0.9"
displaydoc = { version = "0.2", default-features = false }
generic-array = "0.14"
@@ -34,9 +45,10 @@ hkdf = "0.11"
hmac = "0.11"
p256_ = { package = "p256", version = "0.9", default-features = false, features = ["arithmetic", "zeroize"], optional = true }
rand = { version = "0.8", default-features = false }
serde = { version = "1", default-features = false, features = ["alloc", "derive"], optional = true }
serde_ = { version = "1", package = "serde", default-features = false, features = ["derive"], optional = true }
subtle = { version = "2.3", default-features = false }
voprf = { version = "0.2", default-features = false, features = ["danger"] }
voprf = { git = "https://github.com/khonsulabs/voprf", rev = "f8c19eab4ecc9e7a2a5ae26c59661ce797229566", default-features = false, features = ["danger"] }
x25519-dalek = { version = "1", default-features = false, optional = true }
zeroize = { version = "1", features = ["zeroize_derive"] }
[target.'cfg(target_arch = "wasm32")'.dependencies]
@@ -45,7 +57,7 @@ getrandom = { version = "0.2", features = ["js"], optional = true }
[dev-dependencies]
base64 = "0.13"
bincode = "1"
chacha20poly1305 = "0.8"
chacha20poly1305 = "0.9"
criterion = "0.3"
hex = "0.4"
json = "0.12"
@@ -55,9 +67,9 @@ serde_json = "1"
sha2 = "0.9"
proptest = "1"
regex = "1"
rustyline = "8"
# Version 9.1 requires an MSRV of 1.56
rustyline = "~9.0"
[[bench]]
name = "opaque"
harness = false
required-features = ["bench"]