Struct twenty_first::shared_math::tip5::Tip5
source · pub struct Tip5 { /* private fields */ }
Implementations§
source§impl Tip5
impl Tip5
pub fn new() -> Self
pub fn mds_noswap(state: &mut [BFieldElement; 16])
sourcepub fn hash_10(&self, input: &[BFieldElement; 10]) -> [BFieldElement; 5]
pub fn hash_10(&self, input: &[BFieldElement; 10]) -> [BFieldElement; 5]
hash_10 Hash 10 elements, or two digests. There is no padding because the input length is fixed.
sourcepub fn hash_varlen(&self, input: &[BFieldElement]) -> [BFieldElement; 5]
pub fn hash_varlen(&self, input: &[BFieldElement]) -> [BFieldElement; 5]
Hash an arbitrary number of field elements.
This function takes care of padding by applying the padding
rule: append a single 1 ∈ Fp and as many 0 ∈ Fp elements as
are required to make the number of input elements a multiple
of RATE
.