mirror of
https://github.com/arnaucube/hyperplonk.git
synced 2026-01-12 17:01:28 +01:00
PCS crate moved to other repository.
This commit is contained in:
@@ -2,14 +2,14 @@ use arithmetic::{VPAuxInfo, VirtualPolynomial};
|
||||
use ark_bls12_381::{Bls12_381, Fr};
|
||||
use ark_poly::{DenseMultilinearExtension, MultilinearExtension};
|
||||
use ark_std::test_rng;
|
||||
use pcs::{prelude::KZGMultilinearPCS, PolynomialCommitmentScheme};
|
||||
use jf_primitives::pcs::{prelude::MultilinearKzgPCS, PolynomialCommitmentScheme};
|
||||
use poly_iop::prelude::{
|
||||
identity_permutation_mle, PermutationCheck, PolyIOP, PolyIOPErrors, ProductCheck, SumCheck,
|
||||
ZeroCheck,
|
||||
};
|
||||
use std::{marker::PhantomData, rc::Rc, time::Instant};
|
||||
|
||||
type KZG = KZGMultilinearPCS<Bls12_381>;
|
||||
type Kzg = MultilinearKzgPCS<Bls12_381>;
|
||||
|
||||
fn main() -> Result<(), PolyIOPErrors> {
|
||||
bench_permutation_check()?;
|
||||
@@ -140,8 +140,8 @@ fn bench_permutation_check() -> Result<(), PolyIOPErrors> {
|
||||
let mut rng = test_rng();
|
||||
|
||||
for nv in 4..20 {
|
||||
let srs = KZG::gen_srs_for_testing(&mut rng, nv + 1)?;
|
||||
let (pcs_param, _) = KZG::trim(&srs, nv + 1, Some(nv + 1))?;
|
||||
let srs = Kzg::gen_srs_for_testing(&mut rng, nv + 1)?;
|
||||
let (pcs_param, _) = Kzg::trim(&srs, nv + 1, Some(nv + 1))?;
|
||||
|
||||
let repetition = if nv < 10 {
|
||||
100
|
||||
@@ -159,10 +159,10 @@ fn bench_permutation_check() -> Result<(), PolyIOPErrors> {
|
||||
let proof = {
|
||||
let start = Instant::now();
|
||||
let mut transcript =
|
||||
<PolyIOP<Fr> as PermutationCheck<Bls12_381, KZG>>::init_transcript();
|
||||
<PolyIOP<Fr> as PermutationCheck<Bls12_381, Kzg>>::init_transcript();
|
||||
transcript.append_message(b"testing", b"initializing transcript for testing")?;
|
||||
|
||||
let (proof, _q_x) = <PolyIOP<Fr> as PermutationCheck<Bls12_381, KZG>>::prove(
|
||||
let (proof, _q_x) = <PolyIOP<Fr> as PermutationCheck<Bls12_381, Kzg>>::prove(
|
||||
&pcs_param,
|
||||
&w,
|
||||
&w,
|
||||
@@ -187,9 +187,9 @@ fn bench_permutation_check() -> Result<(), PolyIOPErrors> {
|
||||
|
||||
let start = Instant::now();
|
||||
let mut transcript =
|
||||
<PolyIOP<Fr> as PermutationCheck<Bls12_381, KZG>>::init_transcript();
|
||||
<PolyIOP<Fr> as PermutationCheck<Bls12_381, Kzg>>::init_transcript();
|
||||
transcript.append_message(b"testing", b"initializing transcript for testing")?;
|
||||
let _perm_check_sum_claim = <PolyIOP<Fr> as PermutationCheck<Bls12_381, KZG>>::verify(
|
||||
let _perm_check_sum_claim = <PolyIOP<Fr> as PermutationCheck<Bls12_381, Kzg>>::verify(
|
||||
&proof,
|
||||
&poly_info,
|
||||
&mut transcript,
|
||||
@@ -211,8 +211,8 @@ fn bench_prod_check() -> Result<(), PolyIOPErrors> {
|
||||
let mut rng = test_rng();
|
||||
|
||||
for nv in 4..20 {
|
||||
let srs = KZG::gen_srs_for_testing(&mut rng, nv + 1)?;
|
||||
let (pcs_param, _) = KZG::trim(&srs, nv + 1, Some(nv + 1))?;
|
||||
let srs = Kzg::gen_srs_for_testing(&mut rng, nv + 1)?;
|
||||
let (pcs_param, _) = Kzg::trim(&srs, nv + 1, Some(nv + 1))?;
|
||||
|
||||
let repetition = if nv < 10 {
|
||||
100
|
||||
@@ -230,10 +230,10 @@ fn bench_prod_check() -> Result<(), PolyIOPErrors> {
|
||||
|
||||
let proof = {
|
||||
let start = Instant::now();
|
||||
let mut transcript = <PolyIOP<Fr> as ProductCheck<Bls12_381, KZG>>::init_transcript();
|
||||
let mut transcript = <PolyIOP<Fr> as ProductCheck<Bls12_381, Kzg>>::init_transcript();
|
||||
transcript.append_message(b"testing", b"initializing transcript for testing")?;
|
||||
|
||||
let (proof, _prod_x) = <PolyIOP<Fr> as ProductCheck<Bls12_381, KZG>>::prove(
|
||||
let (proof, _prod_x) = <PolyIOP<Fr> as ProductCheck<Bls12_381, Kzg>>::prove(
|
||||
&pcs_param,
|
||||
&f,
|
||||
&g,
|
||||
@@ -256,9 +256,9 @@ fn bench_prod_check() -> Result<(), PolyIOPErrors> {
|
||||
};
|
||||
|
||||
let start = Instant::now();
|
||||
let mut transcript = <PolyIOP<Fr> as ProductCheck<Bls12_381, KZG>>::init_transcript();
|
||||
let mut transcript = <PolyIOP<Fr> as ProductCheck<Bls12_381, Kzg>>::init_transcript();
|
||||
transcript.append_message(b"testing", b"initializing transcript for testing")?;
|
||||
let _perm_check_sum_claim = <PolyIOP<Fr> as ProductCheck<Bls12_381, KZG>>::verify(
|
||||
let _perm_check_sum_claim = <PolyIOP<Fr> as ProductCheck<Bls12_381, Kzg>>::verify(
|
||||
&proof,
|
||||
&poly_info,
|
||||
&mut transcript,
|
||||
|
||||
Reference in New Issue
Block a user