Anemoi Hash

The precompiles Anemoi hash function in zytron kit

Anemoi Hash Function SDK

Anemoi is a zk-friendly hash function.

We provide Solidity, Rust, Javascript (WebAssembly based) and C (FFI support) SDK.

Rust Crate

Crate Namecratesdocs.rs
uzkge

Add dependency to Cargo.toml

uzkge = "0.1"

Use the following code:

let mut prng = ChaChaRng::from_seed([0u8; 32]);
let f1 = Fr::rand(&mut prng);
let f2 = Fr::rand(&mut prng);
let f3 = Fr::rand(&mut prng);

// Build inputs

let h1 = f1.into_bigint().to_bytes_be();
let h2 = f2.into_bigint().to_bytes_be();
let h3 = f3.into_bigint().to_bytes_be();

let data = ethabi::encode(&[
    Token::Array(vec![
        Token::FixedBytes(h1),
        Token::FixedBytes(h2),
        Token::FixedBytes(h3)
    ]),
]);

Javascript SDK

TODO

C SDK

TODO