General Improvements (#268)

* Move `elliptic-curve` implementation to points to allow `Zeroize`

* Simplify `Ristretto255::random_scalar` implementation

* Fix `Ristretto255` deserialization

* Remove unnecessary check in `Ristretto255::random_scalar`

* Base `X25519` implementation on `curve25519-dalek`

* Constrain public and secret key to `Copy`

* Replace manual `ZeroizeOnDrop` implementation with `derive`

* Update dependencies

* Add `warn(unused_crate_dependencies)`

* Sync crate feature naming with `voprf`

* Remove unnecessary dependency crate features

* Never produce a zero scalar

* Rename `OprfGroup` to `OprfCs`

* Rename `TripleDH` to `TripleDh`

* Remove `slow-hash` crate feature

* Rename `NoOpHash` to `Identity`

* Rename `SlowHash` to `Ksf`

* Move `KeyExchange` type definitions down

* Deserialize secret and public keys from slices

* Remove `PrivateKey::from_bytes`

* Rename `From/ToBytes` to `De/Serialize`

* Re-export `serde_` as `serde`

* Custom `De/Serialize` implementation for keys

* Remove custom `De/Serialize` implementation

* Run Taplo v0.6
This commit is contained in:
daxpedda
2022-04-01 16:10:00 -07:00
committed by GitHub
parent f952a26e29
commit 384207acbb
25 changed files with 849 additions and 1109 deletions
+14 -14
View File
@@ -12,14 +12,14 @@ use criterion::Criterion;
use opaque_ke::*;
use rand::rngs::OsRng;
#[cfg(feature = "ristretto255_u64")]
static SUFFIX: &str = "ristretto255_u64";
#[cfg(feature = "ristretto255_u32")]
static SUFFIX: &str = "ristretto255_u32";
#[cfg(feature = "ristretto255_fiat_u64")]
static SUFFIX: &str = "ristretto255_fiat_u64";
#[cfg(feature = "ristretto255_fiat_u32")]
static SUFFIX: &str = "ristretto255_fiat_u32";
#[cfg(feature = "ristretto255-u64")]
static SUFFIX: &str = "ristretto255-u64";
#[cfg(feature = "ristretto255-u32")]
static SUFFIX: &str = "ristretto255-u32";
#[cfg(feature = "ristretto255-fiat-u64")]
static SUFFIX: &str = "ristretto255-fiat-u64";
#[cfg(feature = "ristretto255-fiat-u32")]
static SUFFIX: &str = "ristretto255-fiat-u32";
#[cfg(all(not(feature = "ristretto255")))]
static SUFFIX: &str = "p256";
@@ -27,18 +27,18 @@ struct Default;
#[cfg(feature = "ristretto255")]
impl CipherSuite for Default {
type OprfGroup = opaque_ke::Ristretto255;
type OprfCs = opaque_ke::Ristretto255;
type KeGroup = opaque_ke::Ristretto255;
type KeyExchange = opaque_ke::key_exchange::tripledh::TripleDH;
type SlowHash = opaque_ke::slow_hash::NoOpHash;
type KeyExchange = opaque_ke::key_exchange::tripledh::TripleDh;
type Ksf = opaque_ke::ksf::Identity;
}
#[cfg(not(feature = "ristretto255"))]
impl CipherSuite for Default {
type OprfGroup = p256::NistP256;
type OprfCs = p256::NistP256;
type KeGroup = p256::NistP256;
type KeyExchange = opaque_ke::key_exchange::tripledh::TripleDH;
type SlowHash = opaque_ke::slow_hash::NoOpHash;
type KeyExchange = opaque_ke::key_exchange::tripledh::TripleDh;
type Ksf = opaque_ke::ksf::Identity;
}
fn server_setup(c: &mut Criterion) {