Checkpoint

This commit is contained in:
Eduard S 2024-01-22 16:03:06 +00:00
parent e004913a52
commit fd80a62776
7 changed files with 38 additions and 35 deletions

View File

@ -1 +1,4 @@
#![allow(dead_code)] // TODO: Remove
#![allow(unused_imports)] // TODO: Remove
pub mod plonk;

View File

@ -2,21 +2,17 @@ use group::Curve;
use halo2_middleware::ff::{Field, FromUniformBytes, WithSmallOrderMulGroup};
use rand_core::RngCore;
use std::collections::{BTreeSet, HashSet};
use std::ops::RangeTo;
use std::{collections::HashMap, iter};
use super::{
circuit::{
compile_circuit,
sealed::{self},
Assignment, Circuit, Selector, WitnessCalculator,
},
use halo2_common::plonk::{
circuit::{sealed, Assignment, Circuit, Selector},
lookup, permutation, shuffle, vanishing, ChallengeBeta, ChallengeGamma, ChallengeTheta,
ChallengeX, ChallengeY, Error, ProvingKey,
};
use halo2_middleware::circuit::{Advice, Any, Challenge, Column, Fixed, Instance};
use crate::{
use group::prime::PrimeCurveAffine;
use halo2_common::{
arithmetic::{eval_polynomial, CurveAffine},
circuit::Value,
plonk::Assigned,
@ -25,11 +21,10 @@ use crate::{
Basis, Coeff, LagrangeCoeff, Polynomial, ProverQuery,
},
};
use crate::{
use halo2_common::{
poly::batch_invert_assigned,
transcript::{EncodedChallenge, TranscriptWrite},
};
use group::prime::PrimeCurveAffine;
/// Collection of instance data used during proving for a single circuit proof.
#[derive(Debug)]
@ -742,6 +737,8 @@ impl<
}
}
// TODO: Move this to halo2_proofs as a legacy wrapper
/*
/// This creates a proof for the provided `circuit` when given the public
/// parameters `params` and the proving key [`ProvingKey`] that was
/// generated previously for the same circuit. The provided `instances`
@ -853,3 +850,4 @@ fn test_create_proof() {
)
.expect("proof generation should not fail");
}
*/

View File

@ -1,11 +1,13 @@
//! # halo2_proofs
#![allow(dead_code)] // TODO: Remove
#![allow(unused_imports)] // TODO: Remove
#![cfg_attr(docsrs, feature(doc_cfg))]
// The actual lints we want to disable.
#![allow(clippy::op_ref, clippy::many_single_char_names)]
#![deny(rustdoc::broken_intra_doc_links)]
#![deny(missing_debug_implementations)]
#![deny(missing_docs)]
// #![deny(missing_debug_implementations)] // TODO: Uncomment
// #![deny(missing_docs)] // TODO: Uncomment
#![deny(unsafe_code)]
pub mod arithmetic;

View File

@ -25,17 +25,17 @@ use halo2_middleware::circuit::{
};
use halo2_middleware::poly::Rotation;
mod assigned;
mod circuit;
mod error;
mod evaluation;
mod keygen;
mod lookup;
pub mod assigned;
pub mod circuit;
pub mod error;
pub mod evaluation;
pub mod keygen;
pub mod lookup;
pub mod permutation;
mod shuffle;
mod vanishing;
pub mod shuffle;
pub mod vanishing;
mod verifier;
pub mod verifier;
pub use assigned::*;
pub use circuit::*;
@ -532,21 +532,21 @@ impl<C: CurveAffine> VerifyingKey<C> {
}
#[derive(Clone, Copy, Debug)]
struct Theta;
type ChallengeTheta<F> = ChallengeScalar<F, Theta>;
pub struct Theta;
pub type ChallengeTheta<F> = ChallengeScalar<F, Theta>;
#[derive(Clone, Copy, Debug)]
struct Beta;
type ChallengeBeta<F> = ChallengeScalar<F, Beta>;
pub struct Beta;
pub type ChallengeBeta<F> = ChallengeScalar<F, Beta>;
#[derive(Clone, Copy, Debug)]
struct Gamma;
type ChallengeGamma<F> = ChallengeScalar<F, Gamma>;
pub struct Gamma;
pub type ChallengeGamma<F> = ChallengeScalar<F, Gamma>;
#[derive(Clone, Copy, Debug)]
struct Y;
type ChallengeY<F> = ChallengeScalar<F, Y>;
pub struct Y;
pub type ChallengeY<F> = ChallengeScalar<F, Y>;
#[derive(Clone, Copy, Debug)]
struct X;
type ChallengeX<F> = ChallengeScalar<F, X>;
pub struct X;
pub type ChallengeX<F> = ChallengeScalar<F, X>;

View File

@ -28,7 +28,7 @@ use std::{
mod compress_selectors;
// TODO: Move sealed phase to frontend, and always use u8 in middleware and backend
pub(crate) mod sealed {
pub mod sealed {
/// Phase of advice column
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct Phase(pub(crate) u8);

View File

@ -3,8 +3,8 @@ use halo2_middleware::circuit::ExpressionMid;
use halo2_middleware::ff::Field;
use std::fmt::{self, Debug};
pub(crate) mod prover;
pub(crate) mod verifier;
pub mod prover;
pub mod verifier;
/// Expressions involved in a lookup argument, with a name as metadata.
#[derive(Clone)]

View File

@ -197,7 +197,7 @@ impl<F: SerdePrimeField, B> Polynomial<F, B> {
}
}
pub(crate) fn batch_invert_assigned<F: Field>(
pub fn batch_invert_assigned<F: Field>(
assigned: Vec<Polynomial<Assigned<F>, LagrangeCoeff>>,
) -> Vec<Polynomial<F, LagrangeCoeff>> {
let mut assigned_denominators: Vec<_> = assigned