poseidon-bn128

Crates.ioposeidon-bn128
lib.rsposeidon-bn128
version0.1.1
sourcesrc
created_at2024-09-10 00:12:25.148484
updated_at2024-09-10 21:03:29.488263
descriptionPoseidon over alt_bn128 compatible with circomlib
homepagehttps://github.com/chancehudson/poseidon-bn128
repositoryhttps://github.com/chancehudson/poseidon-bn128.git
max_upload_size
id1369903
size1,008,298
Chance (chancehudson)

documentation

README

poseidon-bn128 Build Docs Version

Poseidon over alt_bn128 compatible with circomlib. Uses scalarff for representing field elements.

Example

cargo add poseidon-bn128

use poseidon_bn128::poseidon;
use scalarff::Bn128FieldElement;
use anyhow::Result;

fn main() -> Result<()> {
    let inputs = vec![
        Bn128FieldElement::from(99),
        Bn128FieldElement::from(100)
    ];
    let result = poseidon(2, &inputs)?;
    println!("{:?}", result);
    Ok(())
}
Commit count: 0

cargo fmt