Make KeyExchange generic in KeyFormat

This commit is contained in:
François Garillot
2020-09-21 14:46:04 -04:00
parent 56d38dba2c
commit c97ddaf5d2
2 changed files with 38 additions and 32 deletions
+2 -2
View File
@@ -6,13 +6,13 @@
use crate::{
errors::{InternalPakeError, ProtocolError},
hash::Hash,
keypair::{Key, KeyPair},
keypair::KeyPair,
};
use rand_core::{CryptoRng, RngCore};
use std::convert::TryFrom;
pub trait KeyExchange<D: Hash, KeyFormat: KeyPair<Repr = Key>> {
pub trait KeyExchange<D: Hash, KeyFormat: KeyPair> {
type KE1State: TryFrom<Vec<u8>, Error = InternalPakeError> + ToBytes;
type KE2State: TryFrom<Vec<u8>, Error = ProtocolError> + ToBytes;
type KE1Message: TryFrom<Vec<u8>, Error = InternalPakeError> + ToBytes;