Introducing a trait for key exchange (#20)

This commit is contained in:
Kevin Lewi
2020-07-13 15:23:29 -07:00
committed by GitHub
parent 2959290582
commit f8285c60ba
10 changed files with 627 additions and 490 deletions
+10
View File
@@ -7,6 +7,7 @@
use crate::{
errors::InternalPakeError,
key_exchange::traits::KeyExchange,
keypair::{Key, KeyPair},
map_to_curve::GroupWithMapToCurve,
slow_hash::SlowHash,
@@ -15,6 +16,13 @@ use crate::{
use rand_core::{CryptoRng, RngCore};
/// Configures the underlying primitives used in OPAQUE
/// * `Group`: 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` and
/// `map_to_curve::GroupWithMapToCurve`.
/// * `KeyFormat`: a keypair type composed of public and private components
/// * `KeyExchange`: The key exchange protocol to use in the login step
/// * `SlowHash`: a slow hashing function, typically used for password hashing
pub trait CipherSuite {
/// A finite cyclic group along with a point representation along with
/// an extension trait PasswordToCurve that allows some customization on
@@ -23,6 +31,8 @@ pub trait CipherSuite {
type Group: GroupWithMapToCurve;
/// A keypair type composed of public and private components
type KeyFormat: KeyPair<Repr = Key> + PartialEq;
/// A key exchange protocol
type KeyExchange: KeyExchange;
/// A slow hashing function, typically used for password hashing
type SlowHash: SlowHash;