#poseidon #compatible #field #elements #alt-bn128 #circomlib #scalarff

poseidon-bn128

Poseidon over alt_bn128 compatible with circomlib

2 releases

0.1.1 Sep 10, 2024
0.1.0 Sep 10, 2024

#864 in Cryptography

MIT/Apache

555KB
150 lines

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(())
}

Dependencies

~5–16MB
~159K SLoC