From 117b47505d9f276506adfa8c6f0bed6afa7ee493 Mon Sep 17 00:00:00 2001 From: Timofey Luin Date: Mon, 26 Feb 2024 16:22:19 +0100 Subject: [PATCH] fix --- lightclient-circuits/config/sync_step_testnet.json | 6 +++--- lightclient-circuits/src/sync_step_circuit.rs | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lightclient-circuits/config/sync_step_testnet.json b/lightclient-circuits/config/sync_step_testnet.json index 8534ae8..b584876 100644 --- a/lightclient-circuits/config/sync_step_testnet.json +++ b/lightclient-circuits/config/sync_step_testnet.json @@ -15,12 +15,12 @@ }, "break_points": [ [ - 2097142, - 2097142, + 2097141, 2097141, 2097142, + 2097140, 2097142, - 2097140 + 2097141 ] ] } \ No newline at end of file diff --git a/lightclient-circuits/src/sync_step_circuit.rs b/lightclient-circuits/src/sync_step_circuit.rs index 0045719..1914a5c 100644 --- a/lightclient-circuits/src/sync_step_circuit.rs +++ b/lightclient-circuits/src/sync_step_circuit.rs @@ -382,7 +382,10 @@ impl StepCircuit { .copied() .zip(assigned_affines.iter_mut()) { - let sum = g1_chip.add_unequal(ctx, acc.clone(), point.clone(), true); + let is_equal = g1_chip.is_equal(ctx, acc.clone(), point.clone()); + let add = g1_chip.add_unequal(ctx, acc.clone(), point.clone(), true); + let doub = g1_chip.double(ctx, acc.clone()); + let sum = g1_chip.select(ctx, doub, add, is_equal); acc = g1_chip.select(ctx, sum, acc, bit); } let agg_pubkey = g1_chip.sub_unequal(ctx, acc, rand_point, false);