Skip to content

Commit

Permalink
add test that uses expression_width in manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
vezenovm committed Jul 12, 2024
1 parent 6fe8275 commit aa8d3d8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "poseidon_bn254_hash_width_3"
type = "bin"
authors = [""]
compiler_version = ">=0.31.0"
expression_width = "3"

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
x1 = [1,2]
y1 = "0x115cc0f5e7d690413df64c6b9662e9cf2a3617f2743245519e19607a4417189a"
x2 = [1,2,3,4]
y2 = "0x299c867db6c1fdd79dcefa40e4510b9837e60ebb1ce0663dbaa525df65250465"
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
use std::hash::poseidon;

fn main(x1: [Field; 2], y1: pub Field, x2: [Field; 4], y2: pub Field) {
let hash1 = poseidon::bn254::hash_2(x1);
assert(hash1 == y1);

let hash2 = poseidon::bn254::hash_4(x2);
assert(hash2 == y2);
}

0 comments on commit aa8d3d8

Please sign in to comment.