diff --git a/crypto/dleq/src/lib.rs b/crypto/dleq/src/lib.rs index 1936d5aa..71b9cb4b 100644 --- a/crypto/dleq/src/lib.rs +++ b/crypto/dleq/src/lib.rs @@ -215,6 +215,7 @@ pub struct MultiDLEqProof { impl MultiDLEqProof { /// Prove for each scalar that the series of points created by multiplying it against its /// matching generators share a discrete logarithm. + /// This function panics if `generators.len() != scalars.len()`. pub fn prove( rng: &mut R, transcript: &mut T, @@ -224,6 +225,12 @@ impl MultiDLEqProof { where G::Scalar: Zeroize, { + assert_eq!( + generators.len(), + scalars.len(), + "amount of series of generators doesn't match the amount of scalars" + ); + transcript.domain_separate(b"multi_dleq"); let mut nonces = vec![];