From b61e09718113c34d6da5c7ec1c94a96ad218044b Mon Sep 17 00:00:00 2001 From: weikengchen Date: Mon, 9 Sep 2024 11:32:38 +0800 Subject: [PATCH] sync with upstream change: channel digest location change --- src/bitcoin_script/fiat_shamir.rs | 2 +- src/fiat_shamir.rs | 4 ++++ src/split/mod.rs | 11 ++++------- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/bitcoin_script/fiat_shamir.rs b/src/bitcoin_script/fiat_shamir.rs index b6ff870..c3c862b 100644 --- a/src/bitcoin_script/fiat_shamir.rs +++ b/src/bitcoin_script/fiat_shamir.rs @@ -226,7 +226,7 @@ impl FibonacciFiatShamirGadget { { Sha256ChannelGadget::draw_numbers_with_hint(N_QUERIES, (FIB_LOG_SIZE + LOG_BLOWUP_FACTOR + 1) as usize) } // drop channel digest - { N_QUERIES } OP_ROLL OP_DROP + OP_DROP // stack: // c1, oods point (8) diff --git a/src/fiat_shamir.rs b/src/fiat_shamir.rs index 3d6809a..4a6f887 100644 --- a/src/fiat_shamir.rs +++ b/src/fiat_shamir.rs @@ -183,6 +183,10 @@ pub fn compute_fiat_shamir_hints( let column_log_sizes = components.components().column_log_sizes(); commitment_scheme.commit(proof.commitments[0], &column_log_sizes[0], channel); + if column_log_sizes.len() == 2 { + commitment_scheme.commit(proof.commitments[1], &column_log_sizes[1], channel); + } + channel.mix_felts( &proof .lookup_values diff --git a/src/split/mod.rs b/src/split/mod.rs index 354f617..8f1d143 100644 --- a/src/split/mod.rs +++ b/src/split/mod.rs @@ -349,16 +349,13 @@ impl CovenantProgram for FibonacciSplitProgram { }; let witness = convert_to_witness(script! { - { *fiat_shamir_hints.clone() } - }) - .unwrap(); + { *fiat_shamir_hints.clone() } + }) + .unwrap(); println!("fiat-shamir witness size: {}", witness.len()); - let final_stack = get_final_stack( - script, - witness, - ); + let final_stack = get_final_stack(script, witness); let stack_hash = StackHash::compute(&final_stack);