diff --git a/hashes/src/hash160.rs b/hashes/src/hash160.rs index c9b2bc51c..a0a8f715c 100644 --- a/hashes/src/hash160.rs +++ b/hashes/src/hash160.rs @@ -9,7 +9,7 @@ use crate::{ripemd160, sha256}; -crate::internal_macros::hash_type! { +crate::internal_macros::general_hash_type! { 160, false, "Output of the Bitcoin HASH160 hash function. (RIPEMD160(SHA256))" diff --git a/hashes/src/internal_macros.rs b/hashes/src/internal_macros.rs index 4e5f61bd1..f8272cd09 100644 --- a/hashes/src/internal_macros.rs +++ b/hashes/src/internal_macros.rs @@ -112,7 +112,7 @@ macro_rules! hash_trait_impls { } pub(crate) use hash_trait_impls; -/// Creates a type called `Hash` and implements standard interface for it. +/// Creates a type called `Hash` and implements the standard general hashing interface for it. /// /// The created type has a single field and will have all standard derives as well as an /// implementation of [`crate::Hash`]. @@ -125,7 +125,7 @@ pub(crate) use hash_trait_impls; /// /// The `from_engine` free-standing function is still required with this macro. See the doc of /// [`hash_trait_impls`]. -macro_rules! hash_type { +macro_rules! general_hash_type { ($bits:expr, $reverse:expr, $doc:literal) => { $crate::internal_macros::hash_type_no_default!($bits, $reverse, $doc); @@ -157,7 +157,7 @@ macro_rules! hash_type { } }; } -pub(crate) use hash_type; +pub(crate) use general_hash_type; macro_rules! hash_type_no_default { ($bits:expr, $reverse:expr, $doc:literal) => { diff --git a/hashes/src/ripemd160.rs b/hashes/src/ripemd160.rs index a423c2282..d77a2d928 100644 --- a/hashes/src/ripemd160.rs +++ b/hashes/src/ripemd160.rs @@ -6,7 +6,7 @@ use core::cmp; use crate::{incomplete_block_len, HashEngine as _}; -crate::internal_macros::hash_type! { +crate::internal_macros::general_hash_type! { 160, false, "Output of the RIPEMD160 hash function." diff --git a/hashes/src/sha1.rs b/hashes/src/sha1.rs index 8d2f28aab..b028dd75a 100644 --- a/hashes/src/sha1.rs +++ b/hashes/src/sha1.rs @@ -6,7 +6,7 @@ use core::cmp; use crate::{incomplete_block_len, HashEngine as _}; -crate::internal_macros::hash_type! { +crate::internal_macros::general_hash_type! { 160, false, "Output of the SHA1 hash function." diff --git a/hashes/src/sha256.rs b/hashes/src/sha256.rs index 6be32f92a..53bffcf2b 100644 --- a/hashes/src/sha256.rs +++ b/hashes/src/sha256.rs @@ -14,7 +14,7 @@ use crate::{incomplete_block_len, sha256d, HashEngine as _}; #[cfg(doc)] use crate::{sha256t, sha256t_tag}; -crate::internal_macros::hash_type! { +crate::internal_macros::general_hash_type! { 256, false, "Output of the SHA256 hash function." diff --git a/hashes/src/sha256d.rs b/hashes/src/sha256d.rs index b9437184d..44e6580f3 100644 --- a/hashes/src/sha256d.rs +++ b/hashes/src/sha256d.rs @@ -4,7 +4,7 @@ use crate::sha256; -crate::internal_macros::hash_type! { +crate::internal_macros::general_hash_type! { 256, true, "Output of the SHA256d hash function." diff --git a/hashes/src/sha384.rs b/hashes/src/sha384.rs index 4b197bac9..e6e1aec3a 100644 --- a/hashes/src/sha384.rs +++ b/hashes/src/sha384.rs @@ -4,7 +4,7 @@ use crate::sha512; -crate::internal_macros::hash_type! { +crate::internal_macros::general_hash_type! { 384, false, "Output of the SHA384 hash function." diff --git a/hashes/src/sha512.rs b/hashes/src/sha512.rs index 42f1da922..0b3168133 100644 --- a/hashes/src/sha512.rs +++ b/hashes/src/sha512.rs @@ -6,7 +6,7 @@ use core::cmp; use crate::{incomplete_block_len, HashEngine as _}; -crate::internal_macros::hash_type! { +crate::internal_macros::general_hash_type! { 512, false, "Output of the SHA512 hash function." diff --git a/hashes/src/sha512_256.rs b/hashes/src/sha512_256.rs index 6698d0319..53d08e3de 100644 --- a/hashes/src/sha512_256.rs +++ b/hashes/src/sha512_256.rs @@ -9,7 +9,7 @@ use crate::sha512; -crate::internal_macros::hash_type! { +crate::internal_macros::general_hash_type! { 256, false, "Output of the SHA512/256 hash function.\n\nSHA512/256 is a hash function that uses the sha512 algorithm but it truncates the output to 256 bits. It has different initial constants than sha512 so it produces an entirely different hash compared to sha512. More information at ."