@@ -15,7 +15,8 @@ use ark_ff::PrimeField;
1515use o1_utils:: FieldHelpers ;
1616
1717/// The domain parameter trait is used during hashing to convey extra
18- /// arguments to domain string generation. It is also used by generic signing code.
18+ /// arguments to domain string generation. It is also used by generic signing
19+ /// code.
1920pub trait DomainParameter : Clone {
2021 /// Conversion into vector of bytes
2122 fn into_bytes ( self ) -> Vec < u8 > ;
@@ -41,13 +42,16 @@ impl DomainParameter for u64 {
4142
4243/// Interface for hashable objects
4344///
44- /// Mina uses fixed-length hashing with domain separation for each type of object hashed.
45- /// The prior means that `Hashable` only supports types whose size is not variable.
45+ /// Mina uses fixed-length hashing with domain separation for each type of
46+ /// object hashed. The prior means that `Hashable` only supports types whose
47+ /// size is not variable.
4648///
47- /// **Important:** The developer MUST assure that all domain strings used throughout the
48- /// system are unique and that all structures hashed are of fixed size.
49+ /// **Important:** The developer MUST assure that all domain strings used
50+ /// throughout the system are unique and that all structures hashed are of fixed
51+ /// size.
4952///
50- /// Here is an example of how to implement the `Hashable` trait for am `Example` type.
53+ /// Here is an example of how to implement the `Hashable` trait for am `Example`
54+ /// type.
5155///
5256/// ```rust
5357/// use mina_hasher::{Hashable, ROInput};
@@ -81,8 +85,8 @@ pub trait Hashable: Clone {
8185
8286 /// Generate unique domain string of length `<= 20`.
8387 ///
84- /// The length bound is guarded by an assertion, but uniqueness must
85- /// be enforced by the developer implementing the traits (see [`Hashable`] for
88+ /// The length bound is guarded by an assertion, but uniqueness must be
89+ /// enforced by the developer implementing the traits (see [`Hashable`] for
8690 /// more details). The domain string may be parameterized by the contents of
8791 /// the generic `domain_param` argument.
8892 ///
@@ -93,9 +97,11 @@ pub trait Hashable: Clone {
9397
9498/// Interface for hashing [`Hashable`] inputs
9599///
96- /// Mina uses a unique hasher configured with domain separation for each type of object hashed.
97- /// The underlying hash parameters are large and costly to initialize, so the [`Hasher`] interface
98- /// provides a reusable context for efficient hashing with domain separation.
100+ /// Mina uses a unique hasher configured with domain separation for each type of
101+ /// object hashed.
102+ /// The underlying hash parameters are large and costly to initialize, so the
103+ /// [`Hasher`] interface provides a reusable context for efficient hashing with
104+ /// domain separation.
99105///
100106/// Example usage
101107///
@@ -124,8 +130,8 @@ pub trait Hashable: Clone {
124130/// ```
125131///
126132pub trait Hasher < H : Hashable > {
127- /// Set the initial state based on domain separation string
128- /// generated from `H::domain_string(domain_param)`
133+ /// Set the initial state based on domain separation string generated from
134+ /// `H::domain_string(domain_param)`
129135 fn init ( & mut self , domain_param : H :: D ) -> & mut dyn Hasher < H > ;
130136
131137 /// Restore the initial state that was set most recently
0 commit comments