Skip to content

Commit

Permalink
chore: move to latest nargo
Browse files Browse the repository at this point in the history
  • Loading branch information
sambarnes committed Dec 10, 2023
1 parent 8bc1d64 commit 83dd7b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 3 additions & 1 deletion circuits/Nargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[package]
name = "dizklosure"
authors = ["sambarnes"]
compiler_version = "0.1"
type = "bin"
compiler_version = ">=0.19.4"

[dependencies]

7 changes: 2 additions & 5 deletions circuits/src/main.nr
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn construct_claim_payload(
birthmonth : Field,
birthday : Field,
) -> [u8; 32] {
let h1 = std::hash::pedersen([subject, birthyear, birthmonth, birthday])[0];
let h1 = std::hash::pedersen_hash([subject, birthyear, birthmonth, birthday]);
let h2 = h1.to_be_bytes(32);
let mut result = [0; 32];
for i in 0..32 {
Expand Down Expand Up @@ -80,12 +80,9 @@ fn main(

#[test]
fn test_construct_claim_payload() {
let want = [0x0b, 0xb7, 0xda, 0x0f, 0x91, 0x33, 0x82, 0x0c, 0xee, 0x8a, 0x9c, 0xe7, 0xda, 0x04, 0x1e, 0x22, 0x6a, 0x19, 0x12, 0xbe, 0xb5, 0x2b, 0x96, 0xa1, 0x41, 0x3e, 0xb7, 0x41, 0x15, 0xeb, 0x7a, 0xd7];
let want = [0x1a, 0xd8, 0x9b, 0x2e, 0xb5, 0x9f, 0x2, 0xb1, 0x81, 0xd2, 0x76, 0x17, 0x31, 0x39, 0xcd, 0x90, 0xc5, 0x1a, 0x91, 0xa9, 0x2f, 0xd, 0xb7, 0x17, 0x10, 0xb0, 0x52, 0x3c, 0x71, 0xcc, 0x80, 0x5f];
let got = construct_claim_payload(1234567890, 2003, 1, 2);
assert(want == got);

// uncomment & inspect with: nargo test --show-output
// std::println(got);
}

#[test]
Expand Down

0 comments on commit 83dd7b6

Please sign in to comment.