rust-bitcoin-unsafe-fast/hashes/src
Andrew Poelstra 8869f35a69
hashes: drop the `all_zeros` method on arbitrary hashes
Manually implement it for Wtxid, Txid and BlockHash, where the all-zero
"hash" has a consensus meaning. But in general we should not be
implementing this method unless we have a good reason to do so. It can
be emulated or implemeted in terms of from_byte_array.

The use of Wtxid::all_zeros is obscure and specific enough that I am
tempted to drop it. But for txid and blockhash, the 0 hash appears in
actual blockdata and we should keep it.

All other uses of all_zeros were either in test code or in places where
the specific hash was not important and [u8; 32] was a more appropriate
type.
2024-06-22 15:09:28 +00:00
..
cmp.rs hashes: Introduce SPDX license identifiers 2023-05-01 09:26:36 +10:00
hash160.rs Add inherent functions to hashes 2024-06-14 10:17:00 +10:00
hkdf.rs 2024-06-02 automated rustfmt nightly 2024-06-02 01:07:10 +00:00
hmac.rs hashes: drop the `all_zeros` method on arbitrary hashes 2024-06-22 15:09:28 +00:00
impls.rs Removed //! spare line at end of headers 2024-05-22 12:00:25 +01:00
internal_macros.rs hashes: drop the `all_zeros` method on arbitrary hashes 2024-06-22 15:09:28 +00:00
lib.rs hashes: drop the `all_zeros` method on arbitrary hashes 2024-06-22 15:09:28 +00:00
ripemd160.rs Add inherent functions to hashes 2024-06-14 10:17:00 +10:00
serde_macros.rs Removed //! spare line at end of headers 2024-05-22 12:00:25 +01:00
sha1.rs Add inherent functions to hashes 2024-06-14 10:17:00 +10:00
sha256.rs Add inherent functions to hashes 2024-06-14 10:17:00 +10:00
sha256d.rs Add inherent functions to hashes 2024-06-14 10:17:00 +10:00
sha256t.rs hashes: drop the `all_zeros` method on arbitrary hashes 2024-06-22 15:09:28 +00:00
sha384.rs Add inherent functions to hashes 2024-06-14 10:17:00 +10:00
sha512.rs Add inherent functions to hashes 2024-06-14 10:17:00 +10:00
sha512_256.rs Add inherent functions to hashes 2024-06-14 10:17:00 +10:00
siphash24.rs Add inherent functions to hashes 2024-06-14 10:17:00 +10:00
util.rs hashes: drop the `all_zeros` method on arbitrary hashes 2024-06-22 15:09:28 +00:00