INNER CODE UNIT · Rust

setup

arkworks-rs/crypto-primitives · crypto-primitives/src/commitment/blake2s/mod.rs:16

    fn setup<R: Rng>(_: &mut R) -> Result<Self::Parameters, Error> {
        Ok(())
    }

    fn commit(
        _: &Self::Parameters,
        input: &[u8],
        r: &Self::Randomness,
    ) -> Result<Self::Output, Error> {
        let mut h = b2s::new();
        h.update(input);
        h.update(r.as_ref());
        let mut result = [0u8; 32];
        result.copy_from_slice(&h.finalize());
        Ok(result)
    }
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…