Skip to content

Commit

Permalink
add test to check that we have an equivalent method
Browse files Browse the repository at this point in the history
  • Loading branch information
kevaundray committed Oct 29, 2023
1 parent f7eff88 commit 1637083
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
use dep::std;

fn main(input : Field) -> pub Field {
std::hash::hash_to_field([input])
}
let expected = std::hash::hash_to_field([input]);

let input_bytes = input.to_le_bytes(32);
let blake2s = std::hash::blake2s(input_bytes);
let got = dep::std::field::bytes32_to_field(blake2s);

assert(expected == got);
expected
}

0 comments on commit 1637083

Please sign in to comment.