From 83dd7b6693054140470af8fbf09387bd89f404bc Mon Sep 17 00:00:00 2001 From: sam Date: Sun, 10 Dec 2023 08:44:36 -0700 Subject: [PATCH] chore: move to latest nargo --- circuits/Nargo.toml | 4 +++- circuits/src/main.nr | 7 ++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/circuits/Nargo.toml b/circuits/Nargo.toml index 84079d8..89bda2a 100644 --- a/circuits/Nargo.toml +++ b/circuits/Nargo.toml @@ -1,6 +1,8 @@ [package] +name = "dizklosure" authors = ["sambarnes"] -compiler_version = "0.1" +type = "bin" +compiler_version = ">=0.19.4" [dependencies] \ No newline at end of file diff --git a/circuits/src/main.nr b/circuits/src/main.nr index 383291b..b71a3cb 100644 --- a/circuits/src/main.nr +++ b/circuits/src/main.nr @@ -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 { @@ -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]