From 42ba0c02b0b09fbfd18272307d03fda8705f5005 Mon Sep 17 00:00:00 2001 From: Hossein Moghaddas Date: Tue, 23 Jan 2024 15:55:27 +0100 Subject: [PATCH] Fix bug --- src/sponge/merlin/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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()