Skip to content

Commit

Permalink
Update poly.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitrisPapac authored Oct 11, 2023
1 parent 2b0c671 commit 9d42dd2
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/modified_scrape/poly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
use ark_ec::{PairingEngine, ProjectiveCurve};
use ark_ff::{Field, Zero, One, PrimeField};
use ark_poly::{UVPolynomial, Polynomial as Poly, polynomial::univariate::DensePolynomial};
use ark_std::ops::AddAssign;
//use ark_std::ops::AddAssign;

use rand::Rng;

Expand Down Expand Up @@ -139,7 +139,7 @@ mod test {
Scalar,
};

use ark_bls12_381::{Bls12_381 as E}; // implements PairingEngine
use ark_bls12_381::Bls12_381 as E; // implements PairingEngine
use ark_ec::{PairingEngine, AffineCurve};
use ark_ff::PrimeField;
use ark_poly::{UVPolynomial, Polynomial as Poly};
Expand Down Expand Up @@ -176,10 +176,10 @@ mod test {

#[test]
fn test_ensure_degree() {
let rng = &mut thread_rng();
let rng = &mut thread_rng();
let deg = rng.gen_range(MIN_DEGREE, MAX_DEGREE) as u64;

// we use random group elemements from G_2 since it doesn't matter here.
// we use random group elemements from G_2 since it doesn't matter here.
let evals = vec![<E as PairingEngine>::G2Projective::rand(rng); (deg+4) as usize];
assert_eq!(ensure_degree::<E, _>(rng, &evals, deg).unwrap(), ());
}
Expand All @@ -188,10 +188,10 @@ mod test {
#[test]
#[should_panic]
fn test_ensure_degree_insufficient_evals() {
let rng = &mut thread_rng();
let rng = &mut thread_rng();
let deg = rng.gen_range(MIN_DEGREE, MAX_DEGREE) as u64;

// we use random group elemements from G_2 since it doesn't matter here.
// we use random group elemements from G_2 since it doesn't matter here.
let evals = vec![<E as PairingEngine>::G2Projective::rand(rng); (deg-1) as usize];
ensure_degree::<E, _>(rng, &evals, deg).unwrap();
}
Expand All @@ -200,13 +200,13 @@ mod test {
#[test]
#[should_panic]
fn test_lagrange_interpolation_simple_insufficient_evals() {
let rng = &mut thread_rng();
let rng = &mut thread_rng();
let deg = rng.gen_range(MIN_DEGREE, MAX_DEGREE) as u64;

// we use random group elemements from G_2 since it doesn't matter here.
// we use random group elemements from G_2 since it doesn't matter here.
let evals = vec![<E as PairingEngine>::G2Projective::rand(rng); (deg-1) as usize];

_ = lagrange_interpolation_simple::<E>(&evals, deg).unwrap();
_ = lagrange_interpolation_simple::<E>(&evals, deg).unwrap();
}


Expand All @@ -232,7 +232,6 @@ mod test {
}



#[test]
#[should_panic]
fn test_lagrange_interpolation_insufficient_evals() {
Expand Down

0 comments on commit 9d42dd2

Please sign in to comment.