As a way to roll back the genericity, implement an extension trait of group for password-to-curve hashing,

This supersedes #18.

Co-authored-by: KevinLewi <[email protected]>
This commit is contained in:
François Garillot
2020-07-03 21:05:18 -04:00
co-authored by KevinLewi
parent 41cd80ccb5
commit 9d40aa7659
9 changed files with 46 additions and 70 deletions
+3 -3
View File
@@ -23,7 +23,6 @@ use std::convert::TryFrom;
struct X255193dhNoSlowHash;
impl CipherSuite for X255193dhNoSlowHash {
type Digest = sha2::Sha256;
type Group = EdwardsPoint;
type KeyFormat = X25519KeyPair;
type SlowHash = NoOpHash;
@@ -248,13 +247,14 @@ fn generate_parameters<CS: CipherSuite>() -> TestVectorParameters {
)
.unwrap();
let r1_bytes = r1.to_bytes().to_vec();
let blinding_factor_bytes = *CS::Group::scalar_as_bytes(&client_registration.blinding_factor);
let blinding_factor_bytes =
CS::Group::scalar_as_bytes(&client_registration.blinding_factor).clone();
let client_registration_state = client_registration.to_bytes().to_vec();
let mut oprf_key_rng = CycleRng::new(oprf_key_raw.to_vec());
let (r2, server_registration) = ServerRegistration::<CS>::start(r1, &mut oprf_key_rng).unwrap();
let r2_bytes = r2.to_bytes().to_vec();
let oprf_key_bytes = *CS::Group::scalar_as_bytes(&server_registration.oprf_key);
let oprf_key_bytes = CS::Group::scalar_as_bytes(&server_registration.oprf_key).clone();
let server_registration_state = server_registration.to_bytes().to_vec();
let mut client_s_sk_and_nonce: Vec<u8> = Vec::new();
-1
View File
@@ -21,7 +21,6 @@ use std::convert::TryFrom;
struct Default;
impl CipherSuite for Default {
type Digest = sha2::Sha512;
type Group = RistrettoPoint;
type KeyFormat = crate::keypair::X25519KeyPair;
type SlowHash = crate::slow_hash::NoOpHash;