Skip to content

Commit 42ba0c0

Browse files
committed
Fix bug
1 parent c3d9388 commit 42ba0c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sponge/merlin/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ impl CryptographicSponge for Transcript {
1313
}
1414

1515
fn squeeze_bytes(&mut self, num_bytes: usize) -> Vec<u8> {
16-
let mut dest = Vec::with_capacity(num_bytes);
16+
let mut dest = vec![0; num_bytes];
1717
self.challenge_bytes(b"", &mut dest);
1818
dest
1919
}
2020

2121
fn squeeze_bits(&mut self, num_bits: usize) -> Vec<bool> {
2222
let num_bytes = (num_bits + 7) / 8;
23-
let mut tmp = Vec::with_capacity(num_bytes);
23+
let mut tmp = vec![0; num_bytes];
2424
self.challenge_bytes(b"", &mut tmp);
2525
let dest = tmp
2626
.iter()

0 commit comments

Comments
 (0)