mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-08 08:43:06 +00:00
Minor
This commit is contained in:
parent
3d83d9ff42
commit
5a9c5b295c
@ -103,7 +103,7 @@ fn fri_committed_trees<F: Field + Extendable<D>, const D: usize>(
|
||||
values = coeffs.coset_fft(shift.into())
|
||||
}
|
||||
|
||||
/// The coefficients being removed here should always be zero.
|
||||
// The coefficients being removed here should always be zero.
|
||||
coeffs.coeffs.truncate(coeffs.len() >> config.rate_bits);
|
||||
|
||||
challenger.observe_extension_elements(&coeffs.coeffs);
|
||||
|
||||
@ -91,7 +91,7 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
||||
// Size of the LDE domain.
|
||||
let n = proof.final_poly.len() << (total_arities + config.rate_bits);
|
||||
|
||||
challenger.observe_opening_set(&os);
|
||||
challenger.observe_opening_set(os);
|
||||
|
||||
// Scaling factor to combine polynomials.
|
||||
let alpha = challenger.get_extension_challenge(self);
|
||||
@ -284,8 +284,8 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
||||
// TODO: Do we need to range check `x_index` to a target smaller than `p`?
|
||||
let x_index = challenger.get_challenge(self);
|
||||
let mut x_index_bits = self.low_bits(x_index, n_log, 64);
|
||||
let cap_index = self
|
||||
.le_sum(x_index_bits[x_index_bits.len() - common_data.config.cap_height..].into_iter());
|
||||
let cap_index =
|
||||
self.le_sum(x_index_bits[x_index_bits.len() - common_data.config.cap_height..].iter());
|
||||
with_context!(
|
||||
self,
|
||||
"check FRI initial proof",
|
||||
@ -305,7 +305,6 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
||||
let phi = self.exp_from_bits(phi, x_index_bits.iter().rev());
|
||||
let g_ext = self.convert_to_ext(g);
|
||||
let phi_ext = self.convert_to_ext(phi);
|
||||
let zero = self.zero_extension();
|
||||
// `subgroup_x = g*phi, vanish_zeta = g*phi - zeta`
|
||||
let subgroup_x = self.mul(g, phi);
|
||||
let vanish_zeta = self.mul_sub_extension(g_ext, phi_ext, zeta);
|
||||
@ -349,7 +348,7 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
||||
"infer evaluation using interpolation",
|
||||
self.compute_evaluation(
|
||||
subgroup_x,
|
||||
&x_index_within_coset_bits,
|
||||
x_index_within_coset_bits,
|
||||
arity_bits,
|
||||
evals,
|
||||
betas[i],
|
||||
@ -389,7 +388,6 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
||||
struct PrecomputedReducedEvalsTarget<const D: usize> {
|
||||
pub single: ExtensionTarget<D>,
|
||||
pub zs: ExtensionTarget<D>,
|
||||
pub zs_right: ExtensionTarget<D>,
|
||||
/// Slope of the line from `(zeta, zs)` to `(zeta_right, zs_right)`.
|
||||
pub slope: ExtensionTarget<D>,
|
||||
pub zeta_right: ExtensionTarget<D>,
|
||||
@ -426,7 +424,6 @@ impl<const D: usize> PrecomputedReducedEvalsTarget<D> {
|
||||
Self {
|
||||
single,
|
||||
zs,
|
||||
zs_right,
|
||||
slope: builder.div_extension(numerator, denominator),
|
||||
zeta_right,
|
||||
}
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
use std::convert::TryInto;
|
||||
|
||||
use itertools::Itertools;
|
||||
use num::Integer;
|
||||
|
||||
use crate::field::extension_field::target::{ExtensionAlgebraTarget, ExtensionTarget};
|
||||
@ -9,7 +8,6 @@ use crate::field::field_types::Field;
|
||||
use crate::gates::arithmetic::{ArithmeticExtensionGate, NUM_ARITHMETIC_OPS};
|
||||
use crate::iop::generator::{GeneratedValues, SimpleGenerator};
|
||||
use crate::iop::target::Target;
|
||||
use crate::iop::wire::Wire;
|
||||
use crate::iop::witness::PartialWitness;
|
||||
use crate::plonk::circuit_builder::CircuitBuilder;
|
||||
use crate::util::bits_u64;
|
||||
@ -455,7 +453,6 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
||||
z: ExtensionTarget<D>,
|
||||
) -> ExtensionTarget<D> {
|
||||
let inv = self.add_virtual_extension_target();
|
||||
let zero = self.zero_extension();
|
||||
let one = self.one_extension();
|
||||
self.add_generator(QuotientGeneratorExtension {
|
||||
numerator: one,
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
use crate::field::extension_field::target::ExtensionTarget;
|
||||
use crate::field::extension_field::Extendable;
|
||||
use crate::gates::arithmetic::ArithmeticExtensionGate;
|
||||
use crate::iop::target::{BoolTarget, Target};
|
||||
use crate::plonk::circuit_builder::CircuitBuilder;
|
||||
|
||||
|
||||
@ -139,7 +139,7 @@ impl<F: Extendable<D>, const D: usize, const R: usize> Gate<F, D> for GMiMCGate<
|
||||
|
||||
for r in 0..R {
|
||||
let active = r % W;
|
||||
let cubing_input = state[active] + addition_buffer + self.constants[r].into();
|
||||
let cubing_input = state[active] + addition_buffer + self.constants[r];
|
||||
let cubing_input_wire = vars.local_wires[Self::wire_cubing_input(r)];
|
||||
constraints.push(cubing_input - cubing_input_wire);
|
||||
let f = cubing_input_wire.cube();
|
||||
@ -160,8 +160,6 @@ impl<F: Extendable<D>, const D: usize, const R: usize> Gate<F, D> for GMiMCGate<
|
||||
builder: &mut CircuitBuilder<F, D>,
|
||||
vars: EvaluationTargets<D>,
|
||||
) -> Vec<ExtensionTarget<D>> {
|
||||
let one = builder.one_extension();
|
||||
let neg_one = builder.neg_one_extension();
|
||||
let mut constraints = Vec::with_capacity(self.num_constraints());
|
||||
|
||||
let swap = vars.local_wires[Self::WIRE_SWAP];
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
use std::convert::identity;
|
||||
use std::fmt::Debug;
|
||||
|
||||
use crate::field::extension_field::target::ExtensionTarget;
|
||||
@ -75,11 +74,6 @@ pub(crate) fn generate_partial_witness<F: Field>(
|
||||
|
||||
pending_generator_indices = next_pending_generator_indices;
|
||||
}
|
||||
|
||||
// assert!(
|
||||
// generator_is_expired.into_iter().all(identity),
|
||||
// "Some generators weren't run."
|
||||
// );
|
||||
}
|
||||
|
||||
/// A generator participates in the generation of the witness.
|
||||
|
||||
@ -37,7 +37,7 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
||||
self.constants(&inner_common_data.circuit_digest.elements),
|
||||
);
|
||||
challenger.observe_hash(&digest);
|
||||
challenger.observe_hash(&public_inputs_hash);
|
||||
challenger.observe_hash(public_inputs_hash);
|
||||
|
||||
challenger.observe_cap(&proof.wires_cap);
|
||||
let betas = challenger.get_n_challenges(self, num_challenges);
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
use num::Integer;
|
||||
|
||||
use crate::field::extension_field::target::ExtensionTarget;
|
||||
use crate::field::extension_field::Extendable;
|
||||
use crate::field::field_types::Field;
|
||||
|
||||
@ -1,11 +1,8 @@
|
||||
use std::borrow::Borrow;
|
||||
|
||||
use num::Integer;
|
||||
|
||||
use crate::field::extension_field::target::ExtensionTarget;
|
||||
use crate::field::extension_field::{Extendable, Frobenius};
|
||||
use crate::field::field_types::Field;
|
||||
use crate::gates::arithmetic::ArithmeticExtensionGate;
|
||||
use crate::gates::reducing::ReducingGate;
|
||||
use crate::iop::target::Target;
|
||||
use crate::plonk::circuit_builder::CircuitBuilder;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user