3.8.6 Correct transcript to scalar derivation

Replaces the externally passed in Digest with C::H since C is available.
This commit is contained in:
Luke Parker
2023-03-02 10:04:18 -05:00
parent 530671795a
commit 97374a3e24
6 changed files with 54 additions and 36 deletions

View File

@@ -11,7 +11,8 @@ use rand_core::{RngCore, CryptoRng};
use zeroize::Zeroize;
use subtle::ConstantTimeEq;
use digest::{core_api::BlockSizeUser, Digest};
use digest::{core_api::BlockSizeUser, Digest, HashMarker};
use transcript::SecureDigest;
use group::{
ff::{Field, PrimeField, PrimeFieldBits},
@@ -49,7 +50,7 @@ pub trait Ciphersuite: Clone + Copy + PartialEq + Eq + Debug + Zeroize {
type G: Group<Scalar = Self::F> + GroupOps + PrimeGroup + Zeroize + ConstantTimeEq;
/// Hash algorithm used with this curve.
// Requires BlockSizeUser so it can be used within Hkdf which requies that.
type H: Clone + BlockSizeUser + Digest;
type H: Clone + BlockSizeUser + Digest + HashMarker + SecureDigest;
/// ID for this curve.
const ID: &'static [u8];