mirror of
https://github.com/arnaucube/hyperplonk.git
synced 2026-01-11 08:31:29 +01:00
Bump to arkworks-0.4.0 (#126)
* Bump to arkworks-0.4.0 * Replace remaining usages of `msm_bigint` with `msm_unchecked` Using `msm_unchecked` instead of `msm_bigint` allows to delete the BigInt conversion code by letting the library take care of it.
This commit is contained in:
@@ -16,7 +16,7 @@ use subroutines::{
|
||||
},
|
||||
};
|
||||
|
||||
type KZG = MultilinearKzgPCS<Bls12_381>;
|
||||
type Kzg = MultilinearKzgPCS<Bls12_381>;
|
||||
|
||||
fn main() -> Result<(), PolyIOPErrors> {
|
||||
bench_permutation_check()?;
|
||||
@@ -139,8 +139,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, None, Some(nv + 1))?;
|
||||
let srs = Kzg::gen_srs_for_testing(&mut rng, nv + 1)?;
|
||||
let (pcs_param, _) = Kzg::trim(&srs, None, Some(nv + 1))?;
|
||||
|
||||
let repetition = if nv < 10 {
|
||||
100
|
||||
@@ -159,12 +159,12 @@ 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 (proof, _q_x, _frac_poly) = <PolyIOP<Fr> as PermutationCheck<
|
||||
Bls12_381,
|
||||
KZG,
|
||||
Kzg,
|
||||
>>::prove(
|
||||
&pcs_param, &ws, &ws, &perms, &mut transcript
|
||||
)?;
|
||||
@@ -186,9 +186,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,
|
||||
@@ -210,8 +210,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, None, Some(nv + 1))?;
|
||||
let srs = Kzg::gen_srs_for_testing(&mut rng, nv + 1)?;
|
||||
let (pcs_param, _) = Kzg::trim(&srs, None, Some(nv + 1))?;
|
||||
|
||||
let repetition = if nv < 10 {
|
||||
100
|
||||
@@ -229,11 +229,11 @@ 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, _frac_poly) =
|
||||
<PolyIOP<Fr> as ProductCheck<Bls12_381, KZG>>::prove(
|
||||
<PolyIOP<Fr> as ProductCheck<Bls12_381, Kzg>>::prove(
|
||||
&pcs_param,
|
||||
&fs,
|
||||
&gs,
|
||||
@@ -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