Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ zcash_note_encryption = { version = "0.4", features = ["pre-zip-212"] }
incrementalmerkletree = { version = "0.4", features = ["test-dependencies"] }

[target.'cfg(unix)'.dev-dependencies]
hashbrown = ">= 0.12, <0.13"
dashmap = ">= 5.4, <5.5"
inferno = ">= 0.11, < 0.11.15"
pprof = { version = "0.9", features = ["criterion", "flamegraph"] } # MSRV 1.56

Expand Down
12 changes: 6 additions & 6 deletions src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ impl plonk::Circuit<pallas::Base> for Circuit {

// Constrain split_flag to be boolean
// Constrain v_old * (1 - split_flag) - v_new = magnitude * sign (https://p.z.cash/ZKS:action-cv-net-integrity?partial).
// Constrain (v_old = 0 and split_flag = 0) or (calculated root = anchor) (https://p.z.cash/ZKS:action-merkle-path-validity?partial).
// Constrain (v_old = 0 and is_native_asset = 1) or (calculated root = anchor) (https://p.z.cash/ZKS:action-merkle-path-validity?partial).
// Constrain v_old = 0 or enable_spends = 1 (https://p.z.cash/ZKS:action-enable-spend).
// Constrain v_new = 0 or enable_outputs = 1 (https://p.z.cash/ZKS:action-enable-output).
// Constrain is_native_asset to be boolean
Expand Down Expand Up @@ -278,12 +278,12 @@ impl plonk::Circuit<pallas::Base> for Circuit {
- magnitude * sign,
),
// We already checked that
// * split_flag is boolean (just above), and
// * v_old is a 64 bit integer (in the note commitment evaluation).
// So, split_flag + v_old = 0 only when (split_flag = 0 and v_old = 0), no overflow can occur.
// * is_native_asset is boolean (just below), and
// * v_old is a 64 bit unsigned integer (in the note commitment evaluation).
// So, 1 - is_native_asset + v_old = 0 only when (is_native_asset = 1 and v_old = 0), no overflow can occur.
(
"(v_old = 0 and split_flag = 0) or (root = anchor)",
(v_old.clone() + split_flag.clone()) * (root - anchor),
"(v_old = 0 and is_native_asset = 1) or (root = anchor)",
(v_old.clone() + one.clone() - is_native_asset.clone()) * (root - anchor),
),
(
"v_old = 0 or enable_spends = 1",
Expand Down
33 changes: 20 additions & 13 deletions src/circuit_description
Original file line number Diff line number Diff line change
Expand Up @@ -261,20 +261,27 @@ PinnedVerificationKey {
),
Product(
Sum(
Advice {
query_index: 0,
column_index: 0,
rotation: Rotation(
0,
),
},
Advice {
query_index: 8,
column_index: 8,
rotation: Rotation(
0,
Sum(
Advice {
query_index: 0,
column_index: 0,
rotation: Rotation(
0,
),
},
Constant(
0x0000000000000000000000000000000000000000000000000000000000000001,
),
},
),
Negated(
Advice {
query_index: 9,
column_index: 9,
rotation: Rotation(
0,
),
},
),
),
Sum(
Advice {
Expand Down
Binary file modified src/circuit_proof_test_case.bin
Binary file not shown.