diff --git a/CHANGELOG.md b/CHANGELOG.md index f45ff4b4c..604a97254 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,15 +2,37 @@ ## Pending -- (`ark-poly`) Reduce the number of field multiplications performed by `SparseMultilinearExtension::evaluate` and `DenseMultilinearExtension::evaluate` +### Breaking changes + +### Features + +### Improvements + +### Bugfixes + +## v0.4.2 + +### Breaking changes + +### Features + +### Improvements + +### Bugfixes + - [\#610](https://github.com/arkworks-rs/algebra/pull/610) (`ark-ec`) Fix panic in `final_exponentiation` step for MNT4/6 curves if inverse does not exist. +## v0.4.1 + + ### Breaking changes ### Features ### Improvements +- [\#603](https://github.com/arkworks-rs/algebra/pull/603) (`ark-poly`) Reduce the number of field multiplications performed by `SparseMultilinearExtension::evaluate` and `DenseMultilinearExtension::evaluate` + ### Bugfixes ## v0.4.0 diff --git a/bench-templates/Cargo.toml b/bench-templates/Cargo.toml index fa60dd7d5..f8b9b72b6 100644 --- a/bench-templates/Cargo.toml +++ b/bench-templates/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ark-algebra-bench-templates" -version = "0.4.0" +version = "0.4.2" authors = [ "arkworks contributors" ] description = "A benchmark library for finite fields and elliptic curves" homepage = "https://arkworks.rs" @@ -18,9 +18,9 @@ rust-version = "1.63" [dependencies] criterion = { version = "0.4.0", features = [ "html_reports" ] } ark-std = { version = "0.4.0", default-features = false } -ark-ec = { version = "0.4.0", path = "../ec", default-features = false } -ark-ff = { version = "0.4.0", path = "../ff", default-features = false } -ark-serialize = { version = "0.4.0", path = "../serialize", default-features = false } +ark-ec = { version = "0.4.2-alpha.1", path = "../ec", default-features = false } +ark-ff = { version = "0.4.2-alpha.1", path = "../ff", default-features = false } +ark-serialize = { version = "0.4.2-alpha.1", path = "../serialize", default-features = false } paste = { version = "1.0" } [features] diff --git a/ec/Cargo.toml b/ec/Cargo.toml index 60d6b7875..70b3d7e92 100644 --- a/ec/Cargo.toml +++ b/ec/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ark-ec" -version = "0.4.0" +version = "0.4.2" authors = [ "arkworks contributors" ] description = "A library for elliptic curves and pairings" homepage = "https://arkworks.rs" @@ -15,9 +15,9 @@ rust-version = "1.63" [dependencies] ark-std = { version = "0.4.0", default-features = false } -ark-serialize = { version = "0.4.0", path = "../serialize", default-features = false } -ark-ff = { version = "0.4.0", path = "../ff", default-features = false } -ark-poly = { version = "0.4.0", path = "../poly", default-features = false } +ark-serialize = { version = "0.4.2-alpha.1", path = "../serialize", default-features = false } +ark-ff = { version = "0.4.2-alpha.1", path = "../ff", default-features = false } +ark-poly = { version = "0.4.2-alpha.1", path = "../poly", default-features = false } derivative = { version = "2", features = ["use_core"] } num-traits = { version = "0.2", default-features = false } rayon = { version = "1", optional = true } @@ -26,7 +26,7 @@ hashbrown = "0.13.1" itertools = { version = "0.10", default-features = false } [dev-dependencies] -ark-test-curves = { version = "0.4.0", path = "../test-curves", default-features = false, features = ["bls12_381_curve"] } +ark-test-curves = { version = "0.4.2-alpha.1", path = "../test-curves", default-features = false, features = ["bls12_381_curve"] } sha2 = { version = "0.10", default-features = false } libtest-mimic = "0.6.0" serde = "1.0.110" diff --git a/ff-asm/Cargo.toml b/ff-asm/Cargo.toml index 980020941..4e2680073 100644 --- a/ff-asm/Cargo.toml +++ b/ff-asm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ark-ff-asm" -version = "0.4.0" +version = "0.4.2" authors = [ "arkworks contributors" ] description = "A library for generating x86-64 assembly for finite field multiplication" homepage = "https://arkworks.rs" diff --git a/ff-macros/Cargo.toml b/ff-macros/Cargo.toml index ca96782ff..2bd7dd464 100644 --- a/ff-macros/Cargo.toml +++ b/ff-macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ark-ff-macros" -version = "0.4.0" +version = "0.4.2" authors = [ "arkworks contributors" ] description = "A library for generating x86-64 assembly for finite field multiplication" homepage = "https://arkworks.rs" diff --git a/ff-macros/src/montgomery/mod.rs b/ff-macros/src/montgomery/mod.rs index 4b3cdd146..f07facf0d 100644 --- a/ff-macros/src/montgomery/mod.rs +++ b/ff-macros/src/montgomery/mod.rs @@ -1,28 +1,27 @@ -use quote::format_ident; use std::str::FromStr; use num_bigint::BigUint; use num_traits::One; mod biginteger; -use biginteger::*; +use biginteger::{add_with_carry_impl, sub_with_borrow_impl, subtract_modulus_impl}; mod add; -use add::*; +use add::add_assign_impl; mod double; -use double::*; +use double::double_in_place_impl; mod mul; -use mul::*; +use mul::mul_assign_impl; mod square; -use square::*; +use square::square_in_place_impl; mod sum_of_products; -use sum_of_products::*; +use sum_of_products::sum_of_products_impl; use crate::utils; -pub fn mont_config_helper( +pub(crate) fn mont_config_helper( modulus: BigUint, generator: BigUint, small_subgroup_base: Option, @@ -61,10 +60,10 @@ pub fn mont_config_helper( let modulus_has_spare_bit = modulus_limbs.last().unwrap() >> 63 == 0; let can_use_no_carry_mul_opt = { let first_limb_check = *modulus_limbs.last().unwrap() < (u64::MAX >> 1); - if limbs != 1 { - first_limb_check && modulus_limbs[..limbs - 1].iter().any(|l| *l != u64::MAX) - } else { + if limbs == 1 { first_limb_check + } else { + first_limb_check && modulus_limbs[..limbs - 1].iter().any(|l| *l != u64::MAX) } }; let modulus = quote::quote! { BigInt([ #( #modulus_limbs ),* ]) }; @@ -100,9 +99,8 @@ pub fn mont_config_helper( quote::quote! {} }; - let scope_name = format_ident!("{}___", config_name.to_string().to_lowercase()); quote::quote! { - fn #scope_name() { + const _: () = { use ark_ff::{fields::Fp, BigInt, BigInteger, biginteger::arithmetic as fa, fields::*}; type B = BigInt<#limbs>; type F = Fp, #limbs>; @@ -168,6 +166,6 @@ pub fn mont_config_helper( #add_with_carry #sub_with_borrow - } + }; } } diff --git a/ff/Cargo.toml b/ff/Cargo.toml index 826063f0d..9903f8946 100644 --- a/ff/Cargo.toml +++ b/ff/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ark-ff" -version = "0.4.0" +version = "0.4.2" authors = [ "arkworks contributors" ] description = "A library for finite fields" homepage = "https://arkworks.rs" @@ -14,10 +14,10 @@ edition = "2021" rust-version = "1.63" [dependencies] -ark-ff-asm = { version = "0.4.0", path = "../ff-asm" } -ark-ff-macros = { version = "0.4.0", path = "../ff-macros" } +ark-ff-asm = { version = "0.4.2-alpha.1", path = "../ff-asm" } +ark-ff-macros = { version = "0.4.2-alpha.1", path = "../ff-macros" } ark-std = { version = "0.4.0", default-features = false } -ark-serialize = { version = "0.4.0", path = "../serialize", default-features = false } +ark-serialize = { version = "0.4.2-alpha.1", path = "../serialize", default-features = false } derivative = { version = "2", features = ["use_core"] } num-traits = { version = "0.2", default-features = false } paste = "1.0" @@ -28,7 +28,7 @@ digest = { version = "0.10", default-features = false, features = ["alloc"] } itertools = { version = "0.10", default-features = false } [dev-dependencies] -ark-test-curves = { version = "0.4.0", path = "../test-curves", default-features = false, features = [ "bls12_381_curve", "mnt6_753", "secp256k1"] } +ark-test-curves = { version = "0.4.2-alpha.1", path = "../test-curves", default-features = false, features = [ "bls12_381_curve", "mnt6_753", "secp256k1"] } blake2 = { version = "0.10", default-features = false } sha3 = { version = "0.10", default-features = false } sha2 = { version = "0.10", default-features = false } diff --git a/poly/Cargo.toml b/poly/Cargo.toml index e1d414ff8..b499ab78c 100644 --- a/poly/Cargo.toml +++ b/poly/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ark-poly" -version = "0.4.0" +version = "0.4.2" authors = [ "arkworks contributors" ] description = "A library for efficient polynomial arithmetic via FFTs over finite fields" homepage = "https://arkworks.rs" @@ -14,8 +14,8 @@ edition = "2021" rust-version = "1.63" [dependencies] -ark-ff = { version = "0.4.0", path = "../ff", default-features = false } -ark-serialize = { version = "0.4.0", path = "../serialize", default-features = false, features = ["derive"] } +ark-ff = { version = "0.4.2-alpha.1", path = "../ff", default-features = false } +ark-serialize = { version = "0.4.2-alpha.1", path = "../serialize", default-features = false, features = ["derive"] } ark-std = { version = "0.4.0", default-features = false } rayon = { version = "1", optional = true } derivative = { version = "2", default-features = false, features = [ "use_core" ] } diff --git a/serialize-derive/Cargo.toml b/serialize-derive/Cargo.toml index 71915b17d..50182e67e 100644 --- a/serialize-derive/Cargo.toml +++ b/serialize-derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ark-serialize-derive" -version = "0.4.0" +version = "0.4.2" authors = [ "arkworks Contributors" ] description = "A library for deriving serialization traits for the arkworks ecosystem" homepage = "https://arkworks.rs" diff --git a/serialize/Cargo.toml b/serialize/Cargo.toml index b1d4b2bce..8edfdc2b0 100644 --- a/serialize/Cargo.toml +++ b/serialize/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ark-serialize" -version = "0.4.0" +version = "0.4.2" authors = [ "arkworks contributors" ] description = "A library for serializing types in the arkworks ecosystem" homepage = "https://arkworks.rs" @@ -14,7 +14,7 @@ edition = "2021" rust-version = "1.63" [dependencies] -ark-serialize-derive = { version = "0.4.0", path = "../serialize-derive", optional = true } +ark-serialize-derive = { version = "0.4.2-alpha.1", path = "../serialize-derive", optional = true } ark-std = { version = "0.4.0", default-features = false } digest = { version = "0.10", default-features = false } num-bigint = { version = "0.4", default-features = false } @@ -23,7 +23,7 @@ num-bigint = { version = "0.4", default-features = false } sha2 = { version = "0.10", default-features = false} sha3 = { version = "0.10", default-features = false} blake2 = { version = "0.10", default-features = false} -ark-test-curves = { version = "0.4.0", path = "../test-curves", default-features = false, features = [ "bls12_381_curve"] } +ark-test-curves = { version = "0.4.2-alpha.1", path = "../test-curves", default-features = false, features = [ "bls12_381_curve"] } [features] diff --git a/test-curves/Cargo.toml b/test-curves/Cargo.toml index 01221fdfa..7b0fcb2f2 100644 --- a/test-curves/Cargo.toml +++ b/test-curves/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ark-test-curves" -version = "0.4.0" +version = "0.4.2" authors = [ "arkworks contributors" ] description = "A library for testing ark-ec & ark-poly" homepage = "https://arkworks.rs" @@ -15,13 +15,13 @@ rust-version = "1.63" [dependencies] ark-std = { version = "0.4.0", default-features = false } -ark-ff = { version = "0.4.0", path = "../ff", default-features = false } -ark-ec = { version = "0.4.0", path = "../ec", default-features = false } +ark-ff = { version = "0.4.2-alpha.1", path = "../ff", default-features = false } +ark-ec = { version = "0.4.2-alpha.1", path = "../ec", default-features = false } [dev-dependencies] -ark-serialize = { version = "0.4.0", path = "../serialize", default-features = false } -ark-algebra-test-templates = { version = "0.4.0", path = "../test-templates", default-features = false } -ark-algebra-bench-templates = { version = "0.4.0", path = "../bench-templates", default-features = false } +ark-serialize = { version = "0.4.2-alpha.1", path = "../serialize", default-features = false } +ark-algebra-test-templates = { version = "0.4.2-alpha.1", path = "../test-templates", default-features = false } +ark-algebra-bench-templates = { version = "0.4.2-alpha.1", path = "../bench-templates", default-features = false } [features] default = [] diff --git a/test-templates/Cargo.toml b/test-templates/Cargo.toml index be273039e..ca208f3c1 100644 --- a/test-templates/Cargo.toml +++ b/test-templates/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ark-algebra-test-templates" -version = "0.4.0" +version = "0.4.2" authors = [ "arkworks contributors" ] description = "A library for tests for finite fields, elliptic curves, and pairings" homepage = "https://arkworks.rs" @@ -15,9 +15,9 @@ rust-version = "1.63" [dependencies] ark-std = { version = "0.4.0", default-features = false } -ark-serialize = { version = "0.4.0", path = "../serialize", default-features = false } -ark-ff = { version = "0.4.0", path = "../ff", default-features = false } -ark-ec = { version = "0.4.0", path = "../ec", default-features = false } +ark-serialize = { version = "0.4.2-alpha.1", path = "../serialize", default-features = false } +ark-ff = { version = "0.4.2-alpha.1", path = "../ff", default-features = false } +ark-ec = { version = "0.4.2-alpha.1", path = "../ec", default-features = false } num-bigint = { version = "0.4", default-features = false } num-integer = { version = "0.1", default-features = false } num-traits = { version = "0.2", default-features = false }