Skip to content

Commit

Permalink
remove the now-redundant definitions of Sponge in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mmagician committed Mar 11, 2024
1 parent c45e1e4 commit 53d161b
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 23 deletions.
5 changes: 1 addition & 4 deletions poly-commit/benches/pcs.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use ark_ec::AffineRepr;
use ark_pcs_bench_templates::*;
use ark_poly::DenseUVPolynomial;
use blake2::Blake2s256;

use ark_crypto_primitives::sponge::poseidon::PoseidonSponge;
use ark_ed_on_bls12_381::{EdwardsAffine, Fr};
use ark_ff::PrimeField;
use ark_poly::univariate::DensePolynomial as DenseUnivariatePoly;
Expand All @@ -12,11 +10,10 @@ use ark_poly_commit::ipa_pc::InnerProductArgPC;
use rand_chacha::ChaCha20Rng;

type UniPoly = DenseUnivariatePoly<Fr>;
type Sponge = PoseidonSponge<<EdwardsAffine as AffineRepr>::ScalarField>;

// IPA_PC over the JubJub curve with Blake2s as the hash function
#[allow(non_camel_case_types)]
type IPA_JubJub = InnerProductArgPC<EdwardsAffine, Blake2s256, UniPoly, Sponge>;
type IPA_JubJub = InnerProductArgPC<EdwardsAffine, Blake2s256, UniPoly>;

fn rand_poly_ipa_pc<F: PrimeField>(degree: usize, rng: &mut ChaCha20Rng) -> DenseUnivariatePoly<F> {
DenseUnivariatePoly::rand(degree, rng)
Expand Down
7 changes: 2 additions & 5 deletions poly-commit/benches/size.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use ark_ec::AffineRepr;
use ark_pcs_bench_templates::*;
use ark_poly::DenseUVPolynomial;
use blake2::Blake2s256;

use ark_crypto_primitives::sponge::poseidon::PoseidonSponge;
use ark_ed_on_bls12_381::{EdwardsAffine, Fr};
use ark_ff::PrimeField;
use ark_poly::univariate::DensePolynomial as DenseUnivariatePoly;
Expand All @@ -12,12 +10,11 @@ use ark_poly_commit::ipa_pc::InnerProductArgPC;
use rand_chacha::ChaCha20Rng;

type UniPoly = DenseUnivariatePoly<Fr>;
type Sponge = PoseidonSponge<<EdwardsAffine as AffineRepr>::ScalarField>;
type PC<E, D, P, S> = InnerProductArgPC<E, D, P, S>;
type PC<E, D, P> = InnerProductArgPC<E, D, P>;

// IPA_PC over the JubJub curve with Blake2s as the hash function
#[allow(non_camel_case_types)]
type IPA_JubJub = PC<EdwardsAffine, Blake2s256, UniPoly, Sponge>;
type IPA_JubJub = PC<EdwardsAffine, Blake2s256, UniPoly>;

fn rand_poly_ipa_pc<F: PrimeField>(degree: usize, rng: &mut ChaCha20Rng) -> DenseUnivariatePoly<F> {
DenseUnivariatePoly::rand(degree, rng)
Expand Down
3 changes: 0 additions & 3 deletions poly-commit/src/ipa_pc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1056,16 +1056,13 @@ mod tests {
#![allow(non_camel_case_types)]

use super::InnerProductArgPC;
use ark_crypto_primitives::sponge::poseidon::PoseidonSponge;
use ark_ec::AffineRepr;
use ark_ed_on_bls12_381::{EdwardsAffine, Fr};
use ark_ff::PrimeField;
use ark_poly::{univariate::DensePolynomial as DensePoly, DenseUVPolynomial};
use blake2::Blake2s256;
use rand_chacha::ChaCha20Rng;

type UniPoly = DensePoly<Fr>;
type Sponge = PoseidonSponge<<EdwardsAffine as AffineRepr>::ScalarField>;
type PC<E, D, P> = InnerProductArgPC<E, D, P>;
type PC_JJB2S = PC<EdwardsAffine, Blake2s256, UniPoly>;

Expand Down
4 changes: 0 additions & 4 deletions poly-commit/src/marlin/marlin_pc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,6 @@ mod tests {
use super::MarlinKZG10;
use ark_bls12_377::Bls12_377;
use ark_bls12_381::Bls12_381;
use ark_crypto_primitives::sponge::poseidon::PoseidonSponge;
use ark_ec::pairing::Pairing;
use ark_ff::UniformRand;
use ark_poly::{univariate::DensePolynomial as DensePoly, DenseUVPolynomial};
Expand All @@ -546,9 +545,6 @@ mod tests {

type PC<E, P> = MarlinKZG10<E, P>;

type Sponge_Bls12_381 = PoseidonSponge<<Bls12_381 as Pairing>::ScalarField>;
type Sponge_Bls12_377 = PoseidonSponge<<Bls12_377 as Pairing>::ScalarField>;

type PC_Bls12_381 = PC<Bls12_381, UniPoly_381>;
type PC_Bls12_377 = PC<Bls12_377, UniPoly_377>;

Expand Down
4 changes: 0 additions & 4 deletions poly-commit/src/marlin/marlin_pst13_pc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,6 @@ mod tests {
use super::MarlinPST13;
use ark_bls12_377::Bls12_377;
use ark_bls12_381::Bls12_381;
use ark_crypto_primitives::sponge::poseidon::PoseidonSponge;
use ark_ec::pairing::Pairing;
use ark_ff::UniformRand;
use ark_poly::{
Expand All @@ -715,9 +714,6 @@ mod tests {

type PC<E, P> = MarlinPST13<E, P>;

type Sponge_bls12_381 = PoseidonSponge<<Bls12_381 as Pairing>::ScalarField>;
type Sponge_Bls12_377 = PoseidonSponge<<Bls12_377 as Pairing>::ScalarField>;

type PC_Bls12_381 = PC<Bls12_381, MVPoly_381>;
type PC_Bls12_377 = PC<Bls12_377, MVPoly_377>;

Expand Down
3 changes: 0 additions & 3 deletions poly-commit/src/sonic_pc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,6 @@ mod tests {
use super::SonicKZG10;
use ark_bls12_377::Bls12_377;
use ark_bls12_381::Bls12_381;
use ark_crypto_primitives::sponge::poseidon::PoseidonSponge;
use ark_ec::pairing::Pairing;
use ark_ff::UniformRand;
use ark_poly::{univariate::DensePolynomial as DensePoly, DenseUVPolynomial};
Expand All @@ -684,8 +683,6 @@ mod tests {
type UniPoly_377 = DensePoly<<Bls12_377 as Pairing>::ScalarField>;

type PC<E, P> = SonicKZG10<E, P>;
type Sponge_Bls12_377 = PoseidonSponge<<Bls12_377 as Pairing>::ScalarField>;
type Sponge_Bls12_381 = PoseidonSponge<<Bls12_381 as Pairing>::ScalarField>;
type PC_Bls12_377 = PC<Bls12_377, UniPoly_377>;
type PC_Bls12_381 = PC<Bls12_381, UniPoly_381>;

Expand Down

0 comments on commit 53d161b

Please sign in to comment.