From 10bddd0a6049b21776bc7f63ffec9e6df4020b57 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Thu, 26 Sep 2024 14:41:05 +0100 Subject: [PATCH] rename monomial.rs to poly_coeff.rs --- cryptography/erasure_codes/src/reed_solomon.rs | 2 +- cryptography/kzg_multi_open/src/fk20/cosets.rs | 2 +- cryptography/kzg_multi_open/src/fk20/h_poly.rs | 2 +- cryptography/kzg_multi_open/src/fk20/naive.rs | 2 +- cryptography/kzg_multi_open/src/fk20/prover.rs | 2 +- cryptography/kzg_multi_open/src/fk20/verifier.rs | 2 +- cryptography/kzg_multi_open/src/naive.rs | 4 +++- cryptography/polynomial/benches/benchmark.rs | 2 +- cryptography/polynomial/src/domain.rs | 4 ++-- cryptography/polynomial/src/lib.rs | 2 +- cryptography/polynomial/src/{monomial.rs => poly_coeff.rs} | 0 11 files changed, 13 insertions(+), 11 deletions(-) rename cryptography/polynomial/src/{monomial.rs => poly_coeff.rs} (100%) diff --git a/cryptography/erasure_codes/src/reed_solomon.rs b/cryptography/erasure_codes/src/reed_solomon.rs index ef21f8e8..99207c6a 100644 --- a/cryptography/erasure_codes/src/reed_solomon.rs +++ b/cryptography/erasure_codes/src/reed_solomon.rs @@ -1,7 +1,7 @@ use bls12_381::{batch_inversion::batch_inverse, ff::Field, Scalar}; use crate::errors::RSError; -use polynomial::{domain::Domain, monomial::vanishing_poly}; +use polynomial::{domain::Domain, poly_coeff::vanishing_poly}; /// ErasurePattern is an abstraction created to capture the idea /// that erasures do not appear in completely random locations. diff --git a/cryptography/kzg_multi_open/src/fk20/cosets.rs b/cryptography/kzg_multi_open/src/fk20/cosets.rs index a2bf35e8..8558c93f 100644 --- a/cryptography/kzg_multi_open/src/fk20/cosets.rs +++ b/cryptography/kzg_multi_open/src/fk20/cosets.rs @@ -206,7 +206,7 @@ mod tests { use std::collections::HashSet; use bls12_381::Scalar; - use polynomial::{domain::Domain, monomial::poly_eval}; + use polynomial::{domain::Domain, poly_coeff::poly_eval}; use crate::fk20::{ batch_toeplitz::transpose, diff --git a/cryptography/kzg_multi_open/src/fk20/h_poly.rs b/cryptography/kzg_multi_open/src/fk20/h_poly.rs index 14d691bf..a9c5e248 100644 --- a/cryptography/kzg_multi_open/src/fk20/h_poly.rs +++ b/cryptography/kzg_multi_open/src/fk20/h_poly.rs @@ -1,6 +1,6 @@ use crate::fk20::toeplitz::ToeplitzMatrix; use bls12_381::{ff::Field, G1Projective, Scalar}; -use polynomial::monomial::PolyCoeff; +use polynomial::poly_coeff::PolyCoeff; use super::batch_toeplitz::BatchToeplitzMatrixVecMul; diff --git a/cryptography/kzg_multi_open/src/fk20/naive.rs b/cryptography/kzg_multi_open/src/fk20/naive.rs index ac30c1ba..9a2f388a 100644 --- a/cryptography/kzg_multi_open/src/fk20/naive.rs +++ b/cryptography/kzg_multi_open/src/fk20/naive.rs @@ -1,7 +1,7 @@ use crate::commit_key::CommitKey; use bls12_381::{g1_batch_normalize, G1Point, Scalar}; use polynomial::domain::Domain; -use polynomial::monomial::PolyCoeff; +use polynomial::poly_coeff::PolyCoeff; use super::cosets::reverse_bit_order; diff --git a/cryptography/kzg_multi_open/src/fk20/prover.rs b/cryptography/kzg_multi_open/src/fk20/prover.rs index 003214b2..89bbbde6 100644 --- a/cryptography/kzg_multi_open/src/fk20/prover.rs +++ b/cryptography/kzg_multi_open/src/fk20/prover.rs @@ -5,7 +5,7 @@ use crate::fk20::h_poly::take_every_nth; use bls12_381::fixed_base_msm::UsePrecomp; use bls12_381::group::prime::PrimeCurveAffine; use bls12_381::{g1_batch_normalize, G1Point, Scalar}; -use polynomial::{domain::Domain, monomial::PolyCoeff}; +use polynomial::{domain::Domain, poly_coeff::PolyCoeff}; use super::h_poly::compute_h_poly_commitments; diff --git a/cryptography/kzg_multi_open/src/fk20/verifier.rs b/cryptography/kzg_multi_open/src/fk20/verifier.rs index 95a9250e..769c493b 100644 --- a/cryptography/kzg_multi_open/src/fk20/verifier.rs +++ b/cryptography/kzg_multi_open/src/fk20/verifier.rs @@ -6,7 +6,7 @@ use bls12_381::{ batch_inversion::batch_inverse, ff::Field, g1_batch_normalize, lincomb::g1_lincomb, multi_pairings, reduce_bytes_to_scalar_bias, G1Point, G2Point, G2Prepared, Scalar, }; -use polynomial::{domain::Domain, monomial::poly_add}; +use polynomial::{domain::Domain, poly_coeff::poly_add}; use sha2::{Digest, Sha256}; use std::mem::size_of; diff --git a/cryptography/kzg_multi_open/src/naive.rs b/cryptography/kzg_multi_open/src/naive.rs index 0e3627ab..790d0c3e 100644 --- a/cryptography/kzg_multi_open/src/naive.rs +++ b/cryptography/kzg_multi_open/src/naive.rs @@ -1,6 +1,8 @@ use crate::{commit_key::CommitKey, opening_key::OpeningKey}; use bls12_381::{ff::Field, multi_pairings, G1Point, G1Projective, G2Point, G2Prepared, Scalar}; -use polynomial::monomial::{lagrange_interpolate, poly_eval, poly_sub, vanishing_poly, PolyCoeff}; +use polynomial::poly_coeff::{ + lagrange_interpolate, poly_eval, poly_sub, vanishing_poly, PolyCoeff, +}; /// This modules contains code to create and verify opening proofs in a naive way. /// It is also general, meaning the points we are creating opening proofs diff --git a/cryptography/polynomial/benches/benchmark.rs b/cryptography/polynomial/benches/benchmark.rs index 4bfd5959..2b7060de 100644 --- a/cryptography/polynomial/benches/benchmark.rs +++ b/cryptography/polynomial/benches/benchmark.rs @@ -1,6 +1,6 @@ use bls12_381::Scalar; use bls12_381::{ff::Field, group::Group, G1Projective}; -use crate_crypto_internal_eth_kzg_polynomial::{domain::Domain, monomial::poly_eval}; +use crate_crypto_internal_eth_kzg_polynomial::{domain::Domain, poly_coeff::poly_eval}; use criterion::{criterion_group, criterion_main, Criterion}; pub fn bench_polynomial_evaluation(c: &mut Criterion) { diff --git a/cryptography/polynomial/src/domain.rs b/cryptography/polynomial/src/domain.rs index 7ff4721b..1ce2f6df 100644 --- a/cryptography/polynomial/src/domain.rs +++ b/cryptography/polynomial/src/domain.rs @@ -1,4 +1,4 @@ -use crate::monomial::PolyCoeff; +use crate::poly_coeff::PolyCoeff; use bls12_381::ff::{Field, PrimeField}; use bls12_381::{ group::Group, @@ -330,7 +330,7 @@ fn precompute_twiddle_factors(omega: &F, n: usize) -> Vec { #[cfg(test)] mod tests { - use crate::monomial::poly_eval; + use crate::poly_coeff::poly_eval; use super::*; diff --git a/cryptography/polynomial/src/lib.rs b/cryptography/polynomial/src/lib.rs index bf1adc11..b4552172 100644 --- a/cryptography/polynomial/src/lib.rs +++ b/cryptography/polynomial/src/lib.rs @@ -1,2 +1,2 @@ pub mod domain; -pub mod monomial; +pub mod poly_coeff; diff --git a/cryptography/polynomial/src/monomial.rs b/cryptography/polynomial/src/poly_coeff.rs similarity index 100% rename from cryptography/polynomial/src/monomial.rs rename to cryptography/polynomial/src/poly_coeff.rs