-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into kw/x86-call-instruction
- Loading branch information
Showing
13 changed files
with
458 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
".": "0.6.0", | ||
"crates/wasm": "0.6.0" | ||
".": "0.7.0", | ||
"crates/wasm": "0.7.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ default-members = ["crates/nargo_cli"] | |
|
||
[workspace.package] | ||
# x-release-please-start-version | ||
version = "0.6.0" | ||
version = "0.7.0" | ||
# x-release-please-end | ||
authors = ["The Noir Team <[email protected]>"] | ||
edition = "2021" | ||
|
5 changes: 5 additions & 0 deletions
5
crates/nargo_cli/tests/test_data_ssa_refactor/simple_shield/Nargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[package] | ||
authors = [""] | ||
compiler_version = "0.1" | ||
|
||
[dependencies] |
11 changes: 11 additions & 0 deletions
11
crates/nargo_cli/tests/test_data_ssa_refactor/simple_shield/Prover.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Random test key | ||
priv_key = "0x000000000000000000000000000000000000000000000000000000616c696365" | ||
note_root = "0x21386402d57460963f45f32577dc3902c38a6f6fab9ec7b1b708a92e48745de7" | ||
index = "0" | ||
note_hash_path = [ | ||
"0x1cdcf02431ba623767fe389337d011df1048dcc24b98ed81cec97627bab454a0", | ||
"0x0b5e9666e7323ce925c28201a97ddf4144ac9d148448ed6f49f9008719c1b85b", | ||
"0x22ec636f8ad30ef78c42b7fe2be4a4cacf5a445cfb5948224539f59a11d70775", | ||
] | ||
to_pubkey_x = "0x0000000000000000000000000000000000000000000000000000000000000001" | ||
to_pubkey_y = "0x0000000000000002cf135e7506a45d632d270d45f1181294833fc48d823f272c" |
35 changes: 35 additions & 0 deletions
35
crates/nargo_cli/tests/test_data_ssa_refactor/simple_shield/src/main.nr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use dep::std; | ||
|
||
fn main( | ||
// Public key of note | ||
// all notes have the same denomination | ||
priv_key: Field, | ||
|
||
// Merkle membership proof | ||
note_root: pub Field, | ||
index: Field, | ||
note_hash_path: [Field; 3], | ||
|
||
// Receiver public key | ||
to_pubkey_x: Field, | ||
to_pubkey_y: Field, | ||
) -> pub [Field; 2] { | ||
// Compute public key from private key to show ownership | ||
let pubkey = std::scalar_mul::fixed_base(priv_key); | ||
let pubkey_x = pubkey[0]; | ||
let pubkey_y = pubkey[1]; | ||
|
||
// Compute input note commitment | ||
let note_commitment = std::hash::pedersen([pubkey_x, pubkey_y]); | ||
|
||
// Compute input note nullifier | ||
let nullifier = std::hash::pedersen([note_commitment[0], index, priv_key]); | ||
|
||
// Compute output note nullifier | ||
let receiver_note_commitment = std::hash::pedersen([to_pubkey_x, to_pubkey_y]); | ||
|
||
// Check that the input note nullifier is in the root | ||
assert(note_root == std::merkle::compute_merkle_root(note_commitment[0], index, note_hash_path)); | ||
|
||
[nullifier[0], receiver_note_commitment[0]] | ||
} |
Oops, something went wrong.