diff --git a/src/sponge/merlin/mod.rs b/src/sponge/merlin/mod.rs index cb873df7..fd2de54c 100644 --- a/src/sponge/merlin/mod.rs +++ b/src/sponge/merlin/mod.rs @@ -13,14 +13,14 @@ impl CryptographicSponge for Transcript { } fn squeeze_bytes(&mut self, num_bytes: usize) -> Vec { - let mut dest = Vec::with_capacity(num_bytes); + let mut dest = vec![0; num_bytes]; self.challenge_bytes(b"", &mut dest); dest } fn squeeze_bits(&mut self, num_bits: usize) -> Vec { let num_bytes = (num_bits + 7) / 8; - let mut tmp = Vec::with_capacity(num_bytes); + let mut tmp = vec![0; num_bytes]; self.challenge_bytes(b"", &mut tmp); let dest = tmp .iter()