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:
Ivan Mikushin
2023-02-21 05:53:49 -08:00
committed by GitHub
parent f64bfe6c2a
commit 56b1085c11
26 changed files with 443 additions and 483 deletions

View File

@@ -5,17 +5,17 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
ark-bls12-381 = { version = "0.3.0", default-features = false, features = [ "curve" ] }
ark-ff = { version = "^0.3.0", default-features = false }
ark-poly = { version = "^0.3.0", default-features = false }
ark-serialize = { version = "^0.3.0", default-features = false }
ark-std = { version = "^0.3.0", default-features = false }
ark-bls12-381 = { version = "0.4.0", default-features = false, features = [ "curve" ] }
ark-ff = { version = "^0.4.0", default-features = false }
ark-poly = { version = "^0.4.0", default-features = false }
ark-serialize = { version = "^0.4.0", default-features = false }
ark-std = { version = "^0.4.0", default-features = false }
displaydoc = { version = "0.2.3", default-features = false }
rand_chacha = { version = "0.3.0", default-features = false }
rayon = { version = "1.5.2", default-features = false, optional = true }
[dev-dependencies]
ark-ec = { version = "^0.3.0", default-features = false }
ark-ec = { version = "^0.4.0", default-features = false }
criterion = "0.4.0"
[features]

View File

@@ -81,8 +81,8 @@ pub fn get_uni_domain<F: PrimeField>(
mod test {
use super::*;
use ark_bls12_381::Fr;
use ark_ff::{field_new, One};
use ark_poly::UVPolynomial;
use ark_ff::{MontFp, One};
use ark_poly::DenseUVPolynomial;
#[test]
fn test_build_l_with_suffix() -> Result<(), ArithErrors> {
@@ -121,7 +121,7 @@ mod test {
{
let domain = get_uni_domain::<Fr>(3)?;
let l = build_l(&[point1, point2, point3], &domain, true)?;
let l = build_l::<Fr>(&[point1, point2, point3], &domain, true)?;
// sage: q = 52435875175126190479447740508185965837690552500527637822603658699938581184513
// sage: P.<x> = PolynomialRing(Zmod(q))
@@ -142,20 +142,16 @@ mod test {
// 13108968793781547619861935127046491459422638125131909455650914674984645296128*x +
// 39326906381344642859585805381139474378267914375395728366952744024953935888385
let l0 = DensePolynomial::from_coefficients_vec(vec![
field_new!(
Fr,
MontFp!(
"39326906381344642859585805381139474378267914375395728366952744024953935888385"
),
field_new!(
Fr,
MontFp!(
"13108968793781547619861935127046491459422638125131909455650914674984645296128"
),
field_new!(
Fr,
MontFp!(
"39326906381344642859585805381139474378267914375395728366952744024953935888385"
),
field_new!(
Fr,
MontFp!(
"13108968793781547619861935127046491459422638125131909455650914674984645296128"
),
]);
@@ -170,22 +166,16 @@ mod test {
// 52435875175126190478581454301667552757996485117855702128036095582747240693761*x +
// 39326906381344642859585805381139474378267914375395728366952744024953935888385
let l1 = DensePolynomial::from_coefficients_vec(vec![
field_new!(
Fr,
MontFp!(
"39326906381344642859585805381139474378267914375395728366952744024953935888385"
),
field_new!(
Fr,
MontFp!(
"52435875175126190478581454301667552757996485117855702128036095582747240693761"
),
field_new!(
Fr,
MontFp!(
"13108968793781547619861935127046491459422638125131909455650914674984645296128"
),
field_new!(
Fr,
"866286206518413079694067382671935694567563117191340490752"
),
MontFp!("866286206518413079694067382671935694567563117191340490752"),
]);
// ========================
@@ -198,22 +188,16 @@ mod test {
// 52435875175126190476848881888630726598608350352511830738900969348364559712256*x +
// 39326906381344642859585805381139474378267914375395728366952744024953935888387
let l2 = DensePolynomial::from_coefficients_vec(vec![
field_new!(
Fr,
MontFp!(
"39326906381344642859585805381139474378267914375395728366952744024953935888387"
),
field_new!(
Fr,
MontFp!(
"52435875175126190476848881888630726598608350352511830738900969348364559712256"
),
field_new!(
Fr,
MontFp!(
"13108968793781547619861935127046491459422638125131909455650914674984645296129"
),
field_new!(
Fr,
"2598858619555239239082202148015807083702689351574021472255"
),
MontFp!("2598858619555239239082202148015807083702689351574021472255"),
]);
// ========================
@@ -227,15 +211,11 @@ mod test {
// 3
let l3 = DensePolynomial::from_coefficients_vec(vec![
Fr::from(3u64),
field_new!(
Fr,
MontFp!(
"52435875175126190475982595682112313518914282969839895044333406231173219221504"
),
Fr::one(),
field_new!(
Fr,
"3465144826073652318776269530687742778270252468765361963007"
),
MontFp!("3465144826073652318776269530687742778270252468765361963007"),
]);
assert_eq!(l0, l[0], "l0 not equal");
@@ -298,22 +278,16 @@ mod test {
// 52435875175126190476848881888630726598608350352511830738900969348364559712256*x +
// 39326906381344642859585805381139474378267914375395728366952744024953935888387
let l0 = DensePolynomial::from_coefficients_vec(vec![
field_new!(
Fr,
MontFp!(
"39326906381344642859585805381139474378267914375395728366952744024953935888387"
),
field_new!(
Fr,
MontFp!(
"52435875175126190476848881888630726598608350352511830738900969348364559712256"
),
field_new!(
Fr,
MontFp!(
"13108968793781547619861935127046491459422638125131909455650914674984645296129"
),
field_new!(
Fr,
"2598858619555239239082202148015807083702689351574021472255"
),
MontFp!("2598858619555239239082202148015807083702689351574021472255"),
]);
// ========================
@@ -327,15 +301,11 @@ mod test {
// 3
let l1 = DensePolynomial::from_coefficients_vec(vec![
Fr::from(3u64),
field_new!(
Fr,
MontFp!(
"52435875175126190475982595682112313518914282969839895044333406231173219221504"
),
Fr::one(),
field_new!(
Fr,
"3465144826073652318776269530687742778270252468765361963007"
),
MontFp!("3465144826073652318776269530687742778270252468765361963007"),
]);
assert_eq!(l0, l[0], "l0 not equal");

View File

@@ -10,7 +10,7 @@
use crate::{errors::ArithErrors, multilinear_polynomial::random_zero_mle_list, random_mle_list};
use ark_ff::PrimeField;
use ark_poly::{DenseMultilinearExtension, MultilinearExtension};
use ark_serialize::{CanonicalSerialize, SerializationError, Write};
use ark_serialize::CanonicalSerialize;
use ark_std::{
end_timer,
rand::{Rng, RngCore},
@@ -546,7 +546,6 @@ mod test {
let mle = DenseMultilinearExtension::from_evaluations_vec(num_var, eval);
let res = Arc::new(mle);
res
Arc::new(mle)
}
}