We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 632cf42 commit 7bfc8e9Copy full SHA for 7bfc8e9
crypto/src/fiat_shamir/transcript.rs
@@ -4,20 +4,23 @@ pub struct Transcript {
4
hasher: Sha3_256,
5
}
6
7
+impl Default for Transcript {
8
+ fn default() -> Self {
9
+ Self::new()
10
+ }
11
+}
12
+
13
impl Transcript {
- #[allow(clippy::new_without_default)]
14
pub fn new() -> Self {
15
Self {
16
hasher: Sha3_256::new(),
17
18
19
- #[allow(unused)]
20
pub fn append(&mut self, new_data: &[u8]) {
21
self.hasher.update(&mut new_data.to_owned());
22
23
24
pub fn challenge(&mut self) -> [u8; 32] {
25
let mut result_hash = [0_u8; 32];
26
result_hash.copy_from_slice(&self.hasher.finalize_reset());
0 commit comments