Skip to content

Commit

Permalink
docs(ivc): fold_W
Browse files Browse the repository at this point in the history
  • Loading branch information
cyphersnake committed Jan 1, 2024
1 parent d3a7d5d commit 463f927
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/ivc/fold_relaxed_plonk_instance_chip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,24 @@ where
})
}

// TODO #32 rustdoc
/// Fold with proof [`RelaxedPlonkInstance::W_commitments`] & [`PlonkInstance::W_commitments`]
///
/// # Description
///
/// This function is responsible for combining the current `folded_W` accumulator with `input_W_commitments`.
/// This is achieved through a scalar multiplication followed by an elliptic curve addition.
/// The scalar multiplication is defined by a random scalar `r`.
///
/// # Implementation Details
///
/// 1. **Scalar Multiplication**: Each `W` component from `input_W_commitments` is multiplied
/// by random the scalar `r` (challenge). This is executed using the [`EccChip`] for elliptic curve operations.
/// 2. **Accumulation**: The result of the scalar multiplication is then added to the corresponding component in
/// the current `folded_W` accumulator.
///
/// ```markdown
/// new_folded_W[i] = folded_W[i] + input_W[i] * r
/// ```
fn fold_W<const T: usize>(
region: &mut RegionCtx<C::Base>,
config: &MainGateConfig<T>,
Expand Down

0 comments on commit 463f927

Please sign in to comment.