Skip to content

Commit

Permalink
Fix #26.
Browse files Browse the repository at this point in the history
Remove generic_array dependency from Cargo.toml.
  • Loading branch information
mmaker committed Dec 18, 2024
1 parent 1b7abd7 commit 8a68d70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion nimue/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ license = "BSD-3-Clause"
zeroize = { version = "1.6.0", features = ["zeroize_derive"] }
rand = { version = "0.8", features = ["getrandom"] }
digest = "^0.10.7"
generic-array = "^0.14.4"
# used as default hasher for the prover
keccak = { version = "0.1.4"}
log = "0.4.20"
Expand Down
8 changes: 4 additions & 4 deletions nimue/src/hash/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
//! and finally `squeeze_end` will set the state `cv` to the current squeeze digest and length.
//!
use digest::{core_api::BlockSizeUser, typenum::Unsigned, Digest, FixedOutputReset, Reset};
use generic_array::GenericArray;
use digest::crypto_common::generic_array::GenericArray;
use zeroize::Zeroize;

use super::DuplexHash;

/// A Bridge to our sponge interface for legacy `Digest` implementations.
#[derive(Clone)]
pub struct DigestBridge<D: Digest + Clone + Reset> {
pub struct DigestBridge<D: Digest + Clone + Reset + BlockSizeUser> {
/// The underlying hasher.
hasher: D,
/// Cached digest
Expand Down Expand Up @@ -90,14 +90,14 @@ impl<D: BlockSizeUser + Digest + Clone + Reset> DigestBridge<D> {
}
}

impl<D: Clone + Digest + Reset> Zeroize for DigestBridge<D> {
impl<D: Clone + Digest + Reset + BlockSizeUser> Zeroize for DigestBridge<D> {
fn zeroize(&mut self) {
self.cv.zeroize();
Digest::reset(&mut self.hasher);
}
}

impl<D: Clone + Digest + Reset> Drop for DigestBridge<D> {
impl<D: Clone + Digest + Reset + BlockSizeUser> Drop for DigestBridge<D> {
fn drop(&mut self) {
self.zeroize();
}
Expand Down

0 comments on commit 8a68d70

Please sign in to comment.