From be6d042d80a0e6ff0e2d059114a357b0f53d74df Mon Sep 17 00:00:00 2001 From: Kevin Lewi Date: Thu, 28 Jan 2021 14:31:20 -0800 Subject: [PATCH] Restricting ciphersuite group to match hash output (#125) --- src/ciphersuite.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ciphersuite.rs b/src/ciphersuite.rs index e5f5024..adb44d4 100644 --- a/src/ciphersuite.rs +++ b/src/ciphersuite.rs @@ -9,6 +9,7 @@ use crate::{ hash::Hash, key_exchange::traits::KeyExchange, keypair::KeyPair, map_to_curve::GroupWithMapToCurve, slow_hash::SlowHash, }; +use digest::Digest; use rand_core::{CryptoRng, RngCore}; @@ -25,7 +26,7 @@ pub trait CipherSuite { /// 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`. - type Group: GroupWithMapToCurve; + type Group: GroupWithMapToCurve::OutputSize>; /// A key exchange protocol type KeyExchange: KeyExchange; /// The main hash function use (for HKDF computations and hashing transcripts)