Skip to content

Commit

Permalink
Remove y from the in-circuit hash
Browse files Browse the repository at this point in the history
  • Loading branch information
kayabaNerve committed May 6, 2024
1 parent 345b62e commit 166b1da
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion crypto/fcmps/src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ impl<C: Ciphersuite> Circuit<C> {
let c_blind = self.discrete_log(transcript, curve, c_blind);
self.incomplete_add_pub(C_tilde, c_blind, C);

self.tuple_member_of_list(transcript, vec![O.x, I.x, I.y, C.x], branch);
self.tuple_member_of_list(transcript, vec![O.x, I.x, C.x], branch);
}

pub(crate) fn additional_layer<T: Transcript>(
Expand Down
9 changes: 4 additions & 5 deletions crypto/fcmps/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ where
flattened_leaves.extend(&[
OC::G::to_xy(leaf.O).0,
OC::G::to_xy(leaf.I).0,
OC::G::to_xy(leaf.I).1,
OC::G::to_xy(leaf.C).0,
]);
}
Expand Down Expand Up @@ -668,9 +667,9 @@ where
(C[0], C[1]),
//
c1_branches[0]
.chunks(4)
.chunks(3)
.map(|chunk| {
assert_eq!(chunk.len(), 4);
assert_eq!(chunk.len(), 3);
chunk.to_vec()
})
.collect(),
Expand Down Expand Up @@ -912,9 +911,9 @@ where
(C[0], C[1]),
//
c1_branches[0]
.chunks(4)
.chunks(3)
.map(|chunk| {
assert_eq!(chunk.len(), 4);
assert_eq!(chunk.len(), 3);
chunk.to_vec()
})
.collect(),
Expand Down
3 changes: 1 addition & 2 deletions crypto/fcmps/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ fn test() {
[
<Ed25519 as Ciphersuite>::G::to_xy(output.O).0,
<Ed25519 as Ciphersuite>::G::to_xy(output.I).0,
<Ed25519 as Ciphersuite>::G::to_xy(output.I).1,
<Ed25519 as Ciphersuite>::G::to_xy(output.C).0,
]
})
Expand Down Expand Up @@ -146,7 +145,7 @@ fn test() {
curve_1_layers.push(curve_1_layer);
}

let mut layer_lens = vec![4 * leaves.len()];
let mut layer_lens = vec![3 * leaves.len()];
for (a, b) in curve_2_layers.iter().zip(&curve_1_layers) {
layer_lens.push(a.len());
layer_lens.push(b.len());
Expand Down

0 comments on commit 166b1da

Please sign in to comment.