Skip to content

Commit f697cc7

Browse files
committed
Merge rust-bitcoin#4919: Add a sha3_256 module with SHA3-256
5524934 Add a unit test for `sha3` (rustaceanrob) 5fa8a5d Add the SHA3-256 hash function (rustaceanrob) Pull request description: My first commit message motivates this change. The brief explanation is Tor nodes are advertised by ED25519 public key, but are often discoverable as `.onion` addresses. To go from public key to onion address, one must take `SHA3(".onion checksum" | PUBKEY | VERSION)` for a checksum. I will leave the rest for the commit message, as well as all reference material. ACKs for top commit: tcharding: ACK 5524934 apoelstra: ACK 5524934; successfully ran local tests Tree-SHA512: 36f4fdc58bf4a87370a4f3623c3c0d83f414e7e3acccb063e59abe5556b43d5f0dfbe977db3bc88948ee4f65f8b28eef13ebd35ba6a9114fa1ed15ef2fd7eb28
2 parents c9c0c0c + 5524934 commit f697cc7

File tree

4 files changed

+852
-3
lines changed

4 files changed

+852
-3
lines changed

hashes/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ pub mod sha384;
116116
pub mod sha512;
117117
pub mod sha512_256;
118118
pub mod siphash24;
119+
pub mod sha3_256;
119120

120121
use core::fmt::{self, Write as _};
121122
use core::{convert, hash};
@@ -153,6 +154,8 @@ pub use sha512_256::Hash as Sha512_256;
153154
/// SipHash-2-4: Alias for the [`siphash24::Hash`] hash type.
154155
#[doc(inline)]
155156
pub use siphash24::Hash as Siphash24;
157+
/// SHA3-256: Alias for the [`sha3_256::Hash`] hash type.
158+
pub use sha3_256::Hash as Sha3_256;
156159

157160
/// Attempted to create a hash from an invalid length slice.
158161
#[deprecated(since = "TBD", note = "unused now that `Hash::from_slice` is deprecated")]

0 commit comments

Comments
 (0)