From 85524cfacc4f7dcebd8f765108af643f24e5a7ff Mon Sep 17 00:00:00 2001 From: Robin Salen Date: Wed, 10 Jan 2024 09:06:34 +0100 Subject: [PATCH] Intra doc link --- evm/src/curve_pairings.rs | 4 ++-- evm/src/lookup.rs | 2 +- plonky2/src/gates/arithmetic_base.rs | 2 +- plonky2/src/gates/arithmetic_extension.rs | 2 +- plonky2/src/gates/multiplication_extension.rs | 2 +- plonky2/src/iop/target.rs | 6 +++--- plonky2/src/plonk/circuit_builder.rs | 5 +++-- plonky2/src/plonk/prover.rs | 2 +- plonky2/src/plonk/vanishing_poly.rs | 4 ++-- 9 files changed, 15 insertions(+), 14 deletions(-) diff --git a/evm/src/curve_pairings.rs b/evm/src/curve_pairings.rs index 1380c96e9d..71188a216f 100644 --- a/evm/src/curve_pairings.rs +++ b/evm/src/curve_pairings.rs @@ -63,7 +63,7 @@ where } /// Standard addition formula for elliptic curves, restricted to the cases -/// https://en.wikipedia.org/wiki/Elliptic_curve#Algebraic_interpretation +/// impl Add for Curve { type Output = Self; @@ -201,7 +201,7 @@ pub(crate) fn bn_tate(p: Curve, q: Curve>) -> Fp12 { } /// 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 +/// /// where BN_EXP is a hardcoding of the array of Booleans that the loop traverses pub(crate) fn bn_miller_loop(p: Curve, q: Curve>) -> Fp12 { let mut r = p; diff --git a/evm/src/lookup.rs b/evm/src/lookup.rs index 8bf0c8f61b..5d5d1a7b33 100644 --- a/evm/src/lookup.rs +++ b/evm/src/lookup.rs @@ -40,7 +40,7 @@ impl Lookup { } } -/// logUp protocol from https://ia.cr/2022/1530 +/// logUp protocol from /// 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)`, diff --git a/plonky2/src/gates/arithmetic_base.rs b/plonky2/src/gates/arithmetic_base.rs index f47bd18fd1..e06c58aff3 100644 --- a/plonky2/src/gates/arithmetic_base.rs +++ b/plonky2/src/gates/arithmetic_base.rs @@ -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 { diff --git a/plonky2/src/gates/arithmetic_extension.rs b/plonky2/src/gates/arithmetic_extension.rs index 084a14d6f0..37482a5d92 100644 --- a/plonky2/src/gates/arithmetic_extension.rs +++ b/plonky2/src/gates/arithmetic_extension.rs @@ -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 { diff --git a/plonky2/src/gates/multiplication_extension.rs b/plonky2/src/gates/multiplication_extension.rs index 11fd88ebad..1d85817ade 100644 --- a/plonky2/src/gates/multiplication_extension.rs +++ b/plonky2/src/gates/multiplication_extension.rs @@ -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 { diff --git a/plonky2/src/iop/target.rs b/plonky2/src/iop/target.rs index f12257145e..b1fe9bf9b6 100644 --- a/plonky2/src/iop/target.rs +++ b/plonky2/src/iop/target.rs @@ -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). diff --git a/plonky2/src/plonk/circuit_builder.rs b/plonky2/src/plonk/circuit_builder.rs index be905cc273..227af85bba 100644 --- a/plonky2/src/plonk/circuit_builder.rs +++ b/plonky2/src/plonk/circuit_builder.rs @@ -181,7 +181,8 @@ pub struct CircuitBuilder, const D: usize> { /// List of constant generators used to fill the constant wires. constant_generators: Vec>, - /// 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, /// For each LUT index, vector of `(looking_in, looking_out)` pairs. @@ -1007,7 +1008,7 @@ impl, const D: usize> CircuitBuilder { /// 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 . 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 { diff --git a/plonky2/src/plonk/prover.rs b/plonky2/src/plonk/prover.rs index e0c8d727ff..153610dcb6 100644 --- a/plonky2/src/plonk/prover.rs +++ b/plonky2/src/plonk/prover.rs @@ -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 (). 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`. diff --git a/plonky2/src/plonk/vanishing_poly.rs b/plonky2/src/plonk/vanishing_poly.rs index 2c53efcfd3..e3ddcf5b88 100644 --- a/plonky2/src/plonk/vanishing_poly.rs +++ b/plonky2/src/plonk/vanishing_poly.rs @@ -323,8 +323,8 @@ pub(crate) fn eval_vanishing_poly_base_batch, 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 (), +/// following the Tip5 paper's implementation (). /// /// There are three polynomials to check: /// - RE ensures the well formation of lookup tables;