diff --git a/cometbft/src/crypto/default.rs b/cometbft/src/crypto/default.rs index 441c35ad..c057a95d 100644 --- a/cometbft/src/crypto/default.rs +++ b/cometbft/src/crypto/default.rs @@ -15,11 +15,7 @@ pub use sha2::Sha256; impl super::Sha256 for Sha256 { fn digest(data: impl AsRef<[u8]>) -> [u8; HASH_SIZE] { - let digest = ::digest(data); - // copy the GenericArray out - let mut hash = [0u8; HASH_SIZE]; - hash.copy_from_slice(&digest); - hash + ::digest(data).into() } }