2020-07-07 22:34:52 -07:00
|
|
|
|
//! Equihash is a Proof-of-Work algorithm, based on a generalization of the Birthday
|
|
|
|
|
//! problem which finds colliding hash values. It was designed to be memory-hard; more
|
|
|
|
|
//! specifically, the bottle-neck for parallel implementations of Equihash solvers would
|
|
|
|
|
//! be memory bandwidth.
|
|
|
|
|
//!
|
|
|
|
|
//! This crate implements Equihash as specified for the Zcash consensus rules. It can
|
|
|
|
|
//! verify solutions for any valid `(n, k)` parameters, as long as the row indices are no
|
|
|
|
|
//! larger than 32 bits (that is, `ceiling(((n / (k + 1)) + 1) / 8) <= 4`).
|
|
|
|
|
//!
|
|
|
|
|
//! References
|
|
|
|
|
//! ==========
|
|
|
|
|
//! - [Section 7.6.1: Equihash.] Zcash Protocol Specification, version 2020.1.10 or later.
|
|
|
|
|
//! - Alex Biryukov and Dmitry Khovratovich.
|
|
|
|
|
//! [*Equihash: Asymmetric Proof-of-Work Based on the Generalized Birthday Problem.*][BK16]
|
|
|
|
|
//! NDSS ’16.
|
|
|
|
|
//!
|
|
|
|
|
//! [Section 7.6.1: Equihash.]: https://zips.z.cash/protocol/protocol.pdf#equihash
|
|
|
|
|
//! [BK16]: https://www.internetsociety.org/sites/default/files/blogs-media/equihash-asymmetric-proof-of-work-based-generalized-birthday-problem.pdf
|
2020-06-25 18:01:04 -07:00
|
|
|
|
|
2021-03-26 12:27:17 -07:00
|
|
|
|
// Catch documentation errors caused by code changes.
|
2022-07-29 14:56:44 -07:00
|
|
|
|
#![deny(rustdoc::broken_intra_doc_links)]
|
2021-03-26 12:27:17 -07:00
|
|
|
|
|
2024-04-18 14:01:36 -07:00
|
|
|
|
mod params;
|
2020-06-25 18:01:04 -07:00
|
|
|
|
mod verify;
|
|
|
|
|
|
2020-07-10 01:35:23 -07:00
|
|
|
|
#[cfg(test)]
|
|
|
|
|
mod test_vectors;
|
|
|
|
|
|
2020-07-07 20:13:41 -07:00
|
|
|
|
pub use verify::{is_valid_solution, Error};
|