mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-10 01:33:07 +00:00
Intra doc link
This commit is contained in:
parent
33def0841d
commit
85524cfacc
@ -63,7 +63,7 @@ where
|
||||
}
|
||||
|
||||
/// Standard addition formula for elliptic curves, restricted to the cases
|
||||
/// https://en.wikipedia.org/wiki/Elliptic_curve#Algebraic_interpretation
|
||||
/// <https://en.wikipedia.org/wiki/Elliptic_curve#Algebraic_interpretation>
|
||||
impl<T: FieldExt> Add for Curve<T> {
|
||||
type Output = Self;
|
||||
|
||||
@ -201,7 +201,7 @@ pub(crate) fn bn_tate(p: Curve<BN254>, q: Curve<Fp2<BN254>>) -> Fp12<BN254> {
|
||||
}
|
||||
|
||||
/// Standard code for miller loop, can be found on page 99 at this url:
|
||||
/// https://static1.squarespace.com/static/5fdbb09f31d71c1227082339/t/5ff394720493bd28278889c6/1609798774687/PairingsForBeginners.pdf#page=107
|
||||
/// <https://static1.squarespace.com/static/5fdbb09f31d71c1227082339/t/5ff394720493bd28278889c6/1609798774687/PairingsForBeginners.pdf#page=107>
|
||||
/// where BN_EXP is a hardcoding of the array of Booleans that the loop traverses
|
||||
pub(crate) fn bn_miller_loop(p: Curve<BN254>, q: Curve<Fp2<BN254>>) -> Fp12<BN254> {
|
||||
let mut r = p;
|
||||
|
||||
@ -40,7 +40,7 @@ impl<F: Field> Lookup<F> {
|
||||
}
|
||||
}
|
||||
|
||||
/// logUp protocol from https://ia.cr/2022/1530
|
||||
/// logUp protocol from <https://ia.cr/2022/1530>
|
||||
/// Compute the helper columns for the lookup argument.
|
||||
/// Given columns `f0,...,fk` and a column `t`, such that `∪fi ⊆ t`, and challenges `x`,
|
||||
/// this computes the helper columns `h_i = 1/(x+f_2i) + 1/(x+f_2i+1)`, `g = 1/(x+t)`,
|
||||
|
||||
@ -20,7 +20,7 @@ use crate::plonk::vars::{
|
||||
};
|
||||
use crate::util::serialization::{Buffer, IoResult, Read, Write};
|
||||
|
||||
/// A gate which can perform a weighted multiply-add, i.e. `result = c0 x y + c1 z`. If the config
|
||||
/// A gate which can perform a weighted multiply-add, i.e. `result = c0.x.y + c1.z`. If the config
|
||||
/// supports enough routed wires, it can support several such operations in one gate.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ArithmeticGate {
|
||||
|
||||
@ -16,7 +16,7 @@ use crate::plonk::circuit_data::{CircuitConfig, CommonCircuitData};
|
||||
use crate::plonk::vars::{EvaluationTargets, EvaluationVars, EvaluationVarsBase};
|
||||
use crate::util::serialization::{Buffer, IoResult, Read, Write};
|
||||
|
||||
/// A gate which can perform a weighted multiply-add, i.e. `result = c0 x y + c1 z`. If the config
|
||||
/// A gate which can perform a weighted multiply-add, i.e. `result = c0.x.y + c1.z`. If the config
|
||||
/// supports enough routed wires, it can support several such operations in one gate.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ArithmeticExtensionGate<const D: usize> {
|
||||
|
||||
@ -16,7 +16,7 @@ use crate::plonk::circuit_data::{CircuitConfig, CommonCircuitData};
|
||||
use crate::plonk::vars::{EvaluationTargets, EvaluationVars, EvaluationVarsBase};
|
||||
use crate::util::serialization::{Buffer, IoResult, Read, Write};
|
||||
|
||||
/// A gate which can perform a weighted multiplication, i.e. `result = c0 x y`. If the config
|
||||
/// A gate which can perform a weighted multiplication, i.e. `result = c0.x.y`. If the config
|
||||
/// supports enough routed wires, it can support several such operations in one gate.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct MulExtensionGate<const D: usize> {
|
||||
|
||||
@ -14,11 +14,11 @@ use crate::plonk::circuit_data::CircuitConfig;
|
||||
///
|
||||
/// When generating a proof for a given circuit, the prover will "set" the values of some
|
||||
/// (or all) targets, so that they satisfy the circuit constraints. This is done through
|
||||
/// the [`PartialWitness`] interface.
|
||||
/// the [PartialWitness](crate::iop::witness::PartialWitness) interface.
|
||||
///
|
||||
/// There are different "variants" of the `Target` type, namely [`ExtensionTarget`],
|
||||
/// [`ExtensionAlgebraTarget`], but the `Target` type is the default one for most circuits
|
||||
/// verifying some simple statement.
|
||||
/// [ExtensionAlgebraTarget](crate::iop::ext_target::ExtensionAlgebraTarget), but the `Target`
|
||||
/// type is the default one for most circuits verifying some simple statement.
|
||||
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Serialize, Deserialize)]
|
||||
pub enum Target {
|
||||
/// A target that has a fixed location in the witness (seen as a `degree x num_wires` grid).
|
||||
|
||||
@ -181,7 +181,8 @@ pub struct CircuitBuilder<F: RichField + Extendable<D>, const D: usize> {
|
||||
/// List of constant generators used to fill the constant wires.
|
||||
constant_generators: Vec<ConstantGenerator<F>>,
|
||||
|
||||
/// Rows for each LUT: LookupWire contains: first `LookupGate`, first [`LookupTableGate`], last `LookupTableGate`.
|
||||
/// Rows for each LUT: [`LookupWire`] contains: first [`LookupGate`], first and last
|
||||
/// [LookupTableGate](crate::gates::lookup_table::LookupTableGate).
|
||||
lookup_rows: Vec<LookupWire>,
|
||||
|
||||
/// For each LUT index, vector of `(looking_in, looking_out)` pairs.
|
||||
@ -1007,7 +1008,7 @@ impl<F: RichField + Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
||||
/// In PLONK's permutation argument, there's a slight chance of division by zero. We can
|
||||
/// mitigate this by randomizing some unused witness elements, so if proving fails with
|
||||
/// division by zero, the next attempt will have an (almost) independent chance of success.
|
||||
/// See https://github.com/0xPolygonZero/plonky2/issues/456
|
||||
/// See <https://github.com/0xPolygonZero/plonky2/issues/456>.
|
||||
fn randomize_unused_pi_wires(&mut self, pi_gate: usize) {
|
||||
for wire in PublicInputGate::wires_public_inputs_hash().end..self.config.num_wires {
|
||||
self.add_simple_generator(RandomValueGenerator {
|
||||
|
||||
@ -443,7 +443,7 @@ fn wires_permutation_partial_products_and_zs<
|
||||
}
|
||||
|
||||
/// Computes lookup polynomials for a given challenge.
|
||||
/// The polynomials hold the value of RE, Sum and Ldc of the Tip5 paper (https://eprint.iacr.org/2023/107.pdf). To reduce their
|
||||
/// The polynomials hold the value of RE, Sum and Ldc of the Tip5 paper (<https://eprint.iacr.org/2023/107.pdf>). To reduce their
|
||||
/// numbers, we batch multiple slots in a single polynomial. Since RE only involves degree one constraints, we can batch
|
||||
/// all the slots of a row. For Sum and Ldc, batching increases the constraint degree, so we bound the number of
|
||||
/// partial polynomials according to `max_quotient_degree_factor`.
|
||||
|
||||
@ -323,8 +323,8 @@ pub(crate) fn eval_vanishing_poly_base_batch<F: RichField + Extendable<D>, const
|
||||
res_batch
|
||||
}
|
||||
|
||||
/// Evaluates all lookup constraints, based on the logarithmic derivatives paper (https://eprint.iacr.org/2022/1530.pdf),
|
||||
/// following the Tip5 paper's implementation (https://eprint.iacr.org/2023/107.pdf).
|
||||
/// Evaluates all lookup constraints, based on the logarithmic derivatives paper (<https://eprint.iacr.org/2022/1530.pdf>),
|
||||
/// following the Tip5 paper's implementation (<https://eprint.iacr.org/2023/107.pdf>).
|
||||
///
|
||||
/// There are three polynomials to check:
|
||||
/// - RE ensures the well formation of lookup tables;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user