Skip to content

Commit

Permalink
Rename arkworks to arkworks4
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtiomTr authored and sauliusgrigaitis committed Jan 21, 2025
1 parent 24dc6b2 commit 8ac5410
Show file tree
Hide file tree
Showing 64 changed files with 156 additions and 172 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/backend-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
# Excluding mcl for now due to they have different project layout
backend: [blst, zkcrypto, arkworks, arkworks3, constantine]
backend: [blst, zkcrypto, arkworks4, arkworks3, constantine]
include:
# Setup exec_once_per_backend flag
- os: ubuntu-latest
Expand All @@ -21,7 +21,7 @@ jobs:
support_ckzg: true
- backend: zkcrypto
support_ckzg: true
- backend: arkworks
- backend: arkworks4
support_ckzg: true
- backend: arkworks3
support_ckzg: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/backend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
# Excluding mcl for now due to they have different project layout
backend: [blst, zkcrypto, arkworks, arkworks3, constantine]
backend: [blst, zkcrypto, arkworks4, arkworks3, constantine]
include:
# Set default clippy flag
- clippy-flag: --features=default,std,rand,parallel
Expand All @@ -80,7 +80,7 @@ jobs:
support_wasm: true
support_ckzg: true
clippy-flag: --all-features
- backend: arkworks
- backend: arkworks4
support_wasm: true
support_ckzg: true
- backend: arkworks3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
backend: [blst, zkcrypto, arkworks, arkworks3, constantine]
backend: [blst, zkcrypto, arkworks4, arkworks3, constantine]
target: [windows, linux]
include:
# Set target-name for target builds
Expand Down
38 changes: 19 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace]
resolver = "2"
members = [
"arkworks",
"arkworks4",
"arkworks3",
"arkworks3-sppark",
"arkworks3-sppark-wlc",
Expand Down
2 changes: 1 addition & 1 deletion arkworks/Cargo.toml → arkworks4/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "rust-kzg-arkworks"
name = "rust-kzg-arkworks4"
version = "0.1.0"
edition = "2021"

Expand Down
4 changes: 2 additions & 2 deletions arkworks/benches/das.rs → arkworks4/benches/das.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use criterion::{criterion_group, criterion_main, Criterion};
use kzg_bench::benches::das::bench_das_extension;
use rust_kzg_arkworks::kzg_proofs::FFTSettings;
use rust_kzg_arkworks::kzg_types::ArkFr;
use rust_kzg_arkworks4::kzg_proofs::FFTSettings;
use rust_kzg_arkworks4::kzg_types::ArkFr;

fn bench_das_extension_(c: &mut Criterion) {
bench_das_extension::<ArkFr, FFTSettings>(c);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ use kzg::eip_4844::{
verify_kzg_proof_rust,
};
use kzg_bench::benches::eip_4844::bench_eip_4844;
use rust_kzg_arkworks::eip_4844::load_trusted_setup_filename_rust;
use rust_kzg_arkworks::kzg_proofs::{FFTSettings, KZGSettings};
use rust_kzg_arkworks::kzg_types::{ArkFp, ArkFr, ArkG1, ArkG1Affine, ArkG2};
use rust_kzg_arkworks::utils::PolyData;
use rust_kzg_arkworks4::eip_4844::load_trusted_setup_filename_rust;
use rust_kzg_arkworks4::kzg_proofs::{FFTSettings, KZGSettings};
use rust_kzg_arkworks4::kzg_types::{ArkFp, ArkFr, ArkG1, ArkG1Affine, ArkG2};
use rust_kzg_arkworks4::utils::PolyData;

fn bench_eip_4844_(c: &mut Criterion) {
bench_eip_4844::<ArkFr, ArkG1, ArkG2, PolyData, FFTSettings, KZGSettings, ArkFp, ArkG1Affine>(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use criterion::{criterion_group, criterion_main, Criterion};
use kzg::eip_4844::{blob_to_kzg_commitment_rust, bytes_to_blob};
use kzg_bench::benches::eip_7594::bench_eip_7594;
use rust_kzg_arkworks::{eip_4844::load_trusted_setup_filename_rust, eip_7594::ArkBackend};
use rust_kzg_arkworks4::{eip_4844::load_trusted_setup_filename_rust, eip_7594::ArkBackend};

fn bench_eip_7594_(c: &mut Criterion) {
bench_eip_7594::<ArkBackend>(
Expand Down
4 changes: 2 additions & 2 deletions arkworks/benches/fft.rs → arkworks4/benches/fft.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use criterion::{criterion_group, criterion_main, Criterion};
use kzg_bench::benches::fft::{bench_fft_fr, bench_fft_g1};
use rust_kzg_arkworks::kzg_proofs::FFTSettings;
use rust_kzg_arkworks::kzg_types::{ArkFr, ArkG1};
use rust_kzg_arkworks4::kzg_proofs::FFTSettings;
use rust_kzg_arkworks4::kzg_types::{ArkFr, ArkG1};

fn bench_fft_fr_(c: &mut Criterion) {
bench_fft_fr::<ArkFr, FFTSettings>(c);
Expand Down
6 changes: 3 additions & 3 deletions arkworks/benches/fk_20.rs → arkworks4/benches/fk_20.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use criterion::{criterion_group, criterion_main, Criterion};
use kzg_bench::benches::fk20::{bench_fk_multi_da, bench_fk_single_da};
use rust_kzg_arkworks::eip_7594::ArkBackend;
use rust_kzg_arkworks::fk20_proofs::{KzgFK20MultiSettings, KzgFK20SingleSettings};
use rust_kzg_arkworks::kzg_proofs::generate_trusted_setup;
use rust_kzg_arkworks4::eip_7594::ArkBackend;
use rust_kzg_arkworks4::fk20_proofs::{KzgFK20MultiSettings, KzgFK20SingleSettings};
use rust_kzg_arkworks4::kzg_proofs::generate_trusted_setup;

fn bench_fk_single_da_(c: &mut Criterion) {
bench_fk_single_da::<ArkBackend, KzgFK20SingleSettings>(c, &generate_trusted_setup)
Expand Down
4 changes: 2 additions & 2 deletions arkworks/benches/kzg.rs → arkworks4/benches/kzg.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use criterion::{criterion_group, criterion_main, Criterion};
use kzg_bench::benches::kzg::{bench_commit_to_poly, bench_compute_proof_single};

use rust_kzg_arkworks::eip_7594::ArkBackend;
use rust_kzg_arkworks::kzg_proofs::generate_trusted_setup;
use rust_kzg_arkworks4::eip_7594::ArkBackend;
use rust_kzg_arkworks4::kzg_proofs::generate_trusted_setup;

fn bench_commit_to_poly_(c: &mut Criterion) {
bench_commit_to_poly::<ArkBackend>(c, &generate_trusted_setup);
Expand Down
4 changes: 2 additions & 2 deletions arkworks/benches/lincomb.rs → arkworks4/benches/lincomb.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use criterion::{criterion_group, criterion_main, Criterion};
use kzg_bench::benches::lincomb::bench_g1_lincomb;
use rust_kzg_arkworks::fft_g1::g1_linear_combination;
use rust_kzg_arkworks::kzg_types::{ArkFp, ArkFr, ArkG1, ArkG1Affine};
use rust_kzg_arkworks4::fft_g1::g1_linear_combination;
use rust_kzg_arkworks4::kzg_types::{ArkFp, ArkFr, ArkG1, ArkG1Affine};

fn bench_g1_lincomb_(c: &mut Criterion) {
bench_g1_lincomb::<ArkFr, ArkG1, ArkFp, ArkG1Affine>(c, &g1_linear_combination);
Expand Down
4 changes: 2 additions & 2 deletions arkworks/benches/poly.rs → arkworks4/benches/poly.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use criterion::{criterion_group, criterion_main, Criterion};
use kzg_bench::benches::poly::bench_new_poly_div;
use rust_kzg_arkworks::kzg_types::ArkFr;
use rust_kzg_arkworks::utils::PolyData;
use rust_kzg_arkworks4::kzg_types::ArkFr;
use rust_kzg_arkworks4::utils::PolyData;

fn bench_new_poly_div_(c: &mut Criterion) {
bench_new_poly_div::<ArkFr, PolyData>(c);
Expand Down
6 changes: 3 additions & 3 deletions arkworks/benches/recover.rs → arkworks4/benches/recover.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use criterion::{criterion_group, criterion_main, Criterion};
use kzg_bench::benches::recover::bench_recover;

use rust_kzg_arkworks::kzg_proofs::FFTSettings;
use rust_kzg_arkworks::kzg_types::ArkFr;
use rust_kzg_arkworks::utils::PolyData;
use rust_kzg_arkworks4::kzg_proofs::FFTSettings;
use rust_kzg_arkworks4::kzg_types::ArkFr;
use rust_kzg_arkworks4::utils::PolyData;

fn bench_recover_(c: &mut Criterion) {
bench_recover::<ArkFr, FFTSettings, PolyData, PolyData>(c);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use criterion::{criterion_group, criterion_main, Criterion};
use kzg_bench::benches::zero_poly::bench_zero_poly;

use rust_kzg_arkworks::kzg_proofs::FFTSettings;
use rust_kzg_arkworks::kzg_types::ArkFr;
use rust_kzg_arkworks::utils::PolyData;
use rust_kzg_arkworks4::kzg_proofs::FFTSettings;
use rust_kzg_arkworks4::kzg_types::ArkFr;
use rust_kzg_arkworks4::utils::PolyData;

fn bench_zero_poly_(c: &mut Criterion) {
bench_zero_poly::<ArkFr, FFTSettings, PolyData>(c);
Expand Down
2 changes: 1 addition & 1 deletion arkworks/csharp.patch → arkworks4/csharp.patch
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ index df1730c..f115db1 100644
.PHONY: ckzg
ckzg: blst
- $(CLANG_EXECUTABLE) $(CFLAGS) -o $(CKZG_LIBRARY_PATH) $(TARGETS)
+ $(CLANG_EXECUTABLE) $(CFLAGS) -o $(CKZG_LIBRARY_PATH) $(TARGETS) -L ../../lib -lrust_kzg_arkworks -u verify_cell_kzg_proof_batch
+ $(CLANG_EXECUTABLE) $(CFLAGS) -o $(CKZG_LIBRARY_PATH) $(TARGETS) -L ../../lib -lrust_kzg_arkworks4 -u verify_cell_kzg_proof_batch

.PHONY: ckzg-dotnet
ckzg-dotnet: ckzg
Expand Down
2 changes: 1 addition & 1 deletion arkworks/go.patch → arkworks4/go.patch
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ index c912d09..edcc96f 100644
+// #endif
+// #include <stdlib.h>
+// #include "ckzg.h"
+// #cgo LDFLAGS: -ldl -L${SRCDIR}/../../lib -lrust_kzg_arkworks -lm
+// #cgo LDFLAGS: -ldl -L${SRCDIR}/../../lib -lrust_kzg_arkworks4 -lm
import "C"

import (
Expand Down
2 changes: 1 addition & 1 deletion arkworks/java.patch → arkworks4/java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ index 3f646ef..4be49ba 100644
INCLUDE_DIRS = ../../src ../../blst/bindings

-TARGETS=ckzg_jni.c ../../src/ckzg.c ../../lib/libblst.a
+TARGETS=ckzg_jni.c ../../lib/librust_kzg_arkworks.a
+TARGETS=ckzg_jni.c ../../lib/librust_kzg_arkworks4.a

CC_FLAGS=
OPTIMIZATION_LEVEL=-O2
Expand Down
2 changes: 1 addition & 1 deletion arkworks/nim.patch → arkworks4/nim.patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ index 0570efd..59e678e 100644

-{.compile: srcPath & "ckzg.c"}
+{.passl: "-L" & kzgPath & "lib" .}
+{.passl: "-lrust_kzg_arkworks" .}
+{.passl: "-lrust_kzg_arkworks4" .}
+{.passl: "-lm" .}

{.passc: "-I" & escape(bindingsPath) .}
Expand Down
2 changes: 1 addition & 1 deletion arkworks/nodejs.patch → arkworks4/nodejs.patch
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ index d01e38b..1591b8e 100644
"<!@(node -p \"require('node-addon-api').include\")"
],
+ "libraries": [
+ "<(module_root_dir)/../../lib/librust_kzg_arkworks.a"
+ "<(module_root_dir)/../../lib/librust_kzg_arkworks4.a"
+ ],
"defines": [
"__BLST_PORTABLE__",
Expand Down
2 changes: 1 addition & 1 deletion arkworks/python.patch → arkworks4/python.patch
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ index d16c833..b604f1d 100644
include_dirs=["inc", "src"],
library_dirs=["lib"],
- libraries=["blst"]
+ libraries=["rust_kzg_arkworks"]
+ libraries=["rust_kzg_arkworks4"]
)
],
cmdclass={
Expand Down
2 changes: 1 addition & 1 deletion arkworks/rust.patch → arkworks4/rust.patch
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ index 45eb72d..994c83f 100644
- // Finally, tell cargo this provides ckzg/ckzg_min
- println!("cargo:rustc-link-lib=ckzg");
+ println!("cargo:rustc-link-search={}", rust_kzg_target_dir.display());
+ println!("cargo:rustc-link-arg=-lrust_kzg_arkworks");
+ println!("cargo:rustc-link-arg=-lrust_kzg_arkworks4");
}

#[cfg(feature = "generate-bindings")]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mod tests {
test_phase_one_p_add_q_twice, test_phase_one_zero_or_neg, test_phase_two_p_add_neg,
test_phase_two_p_add_p, test_phase_two_p_add_q, test_phase_two_zero_add_p,
};
use rust_kzg_arkworks::kzg_types::{ArkFp, ArkG1, ArkG1Affine};
use rust_kzg_arkworks4::kzg_types::{ArkFp, ArkG1, ArkG1Affine};

#[test]
fn test_phase_one_zero_or_neg_() {
Expand Down
6 changes: 3 additions & 3 deletions arkworks/tests/bls12_381.rs → arkworks4/tests/bls12_381.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
mod tests {
use kzg::common_utils::log_2_byte;
use kzg_bench::tests::bls12_381::*;
use rust_kzg_arkworks::fft_g1::g1_linear_combination;
use rust_kzg_arkworks::kzg_proofs::pairings_verify;
use rust_kzg_arkworks::kzg_types::{ArkFp, ArkFr, ArkG1, ArkG1Affine, ArkG2};
use rust_kzg_arkworks4::fft_g1::g1_linear_combination;
use rust_kzg_arkworks4::kzg_proofs::pairings_verify;
use rust_kzg_arkworks4::kzg_types::{ArkFp, ArkFr, ArkG1, ArkG1Affine, ArkG2};

#[test]
pub fn log_2_byte_works_() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mod tests {
test_process_point_and_slices_deal_three_points,
test_process_point_and_slices_glv_deal_two_points,
};
use rust_kzg_arkworks::kzg_types::{ArkFp, ArkG1, ArkG1Affine, ArkG1ProjAddAffine};
use rust_kzg_arkworks4::kzg_types::{ArkFp, ArkG1, ArkG1Affine, ArkG1ProjAddAffine};

#[test]
pub fn test_process_point_and_slices_deal_three_points_() {
Expand Down
8 changes: 4 additions & 4 deletions arkworks/tests/consts.rs → arkworks4/tests/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ mod tests {
expand_roots_is_plausible, new_fft_settings_is_plausible, roots_of_unity_are_plausible,
roots_of_unity_is_the_expected_size, roots_of_unity_out_of_bounds_fails,
};
use rust_kzg_arkworks::consts::SCALE2_ROOT_OF_UNITY;
use rust_kzg_arkworks::kzg_proofs::expand_root_of_unity;
use rust_kzg_arkworks::kzg_proofs::FFTSettings;
use rust_kzg_arkworks::kzg_types::ArkFr;
use rust_kzg_arkworks4::consts::SCALE2_ROOT_OF_UNITY;
use rust_kzg_arkworks4::kzg_proofs::expand_root_of_unity;
use rust_kzg_arkworks4::kzg_proofs::FFTSettings;
use rust_kzg_arkworks4::kzg_types::ArkFr;

#[test]
fn roots_of_unity_out_of_bounds_fails_() {
Expand Down
4 changes: 2 additions & 2 deletions arkworks/tests/das.rs → arkworks4/tests/das.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#[cfg(test)]
mod tests {
use kzg_bench::tests::das::{das_extension_test_known, das_extension_test_random};
use rust_kzg_arkworks::kzg_proofs::FFTSettings;
use rust_kzg_arkworks::kzg_types::ArkFr;
use rust_kzg_arkworks4::kzg_proofs::FFTSettings;
use rust_kzg_arkworks4::kzg_types::ArkFr;

#[test]
fn das_extension_test_known_() {
Expand Down
10 changes: 5 additions & 5 deletions arkworks/tests/eip_4844.rs → arkworks4/tests/eip_4844.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ mod tests {
test_vectors_verify_kzg_proof, verify_kzg_proof_batch_fails_with_incorrect_proof_test,
verify_kzg_proof_batch_test,
};
use rust_kzg_arkworks::consts::SCALE2_ROOT_OF_UNITY;
use rust_kzg_arkworks::eip_4844::load_trusted_setup_filename_rust;
use rust_kzg_arkworks::kzg_proofs::{expand_root_of_unity, FFTSettings, KZGSettings};
use rust_kzg_arkworks::kzg_types::{ArkFp, ArkFr, ArkG1, ArkG1Affine, ArkG2};
use rust_kzg_arkworks::utils::PolyData;
use rust_kzg_arkworks4::consts::SCALE2_ROOT_OF_UNITY;
use rust_kzg_arkworks4::eip_4844::load_trusted_setup_filename_rust;
use rust_kzg_arkworks4::kzg_proofs::{expand_root_of_unity, FFTSettings, KZGSettings};
use rust_kzg_arkworks4::kzg_types::{ArkFp, ArkFr, ArkG1, ArkG1Affine, ArkG2};
use rust_kzg_arkworks4::utils::PolyData;

#[test]
pub fn bytes_to_bls_field_test_() {
Expand Down
4 changes: 2 additions & 2 deletions arkworks/tests/eip_7594.rs → arkworks4/tests/eip_7594.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ mod tests {
test_vectors_compute_cells_and_kzg_proofs, test_vectors_recover_cells_and_kzg_proofs,
test_vectors_verify_cell_kzg_proof_batch,
};
use rust_kzg_arkworks::eip_4844::load_trusted_setup_filename_rust;
use rust_kzg_arkworks::eip_7594::ArkBackend;
use rust_kzg_arkworks4::eip_4844::load_trusted_setup_filename_rust;
use rust_kzg_arkworks4::eip_7594::ArkBackend;

#[test]
pub fn test_vectors_compute_cells_and_kzg_proofs_() {
Expand Down
6 changes: 3 additions & 3 deletions arkworks/tests/fft_fr.rs → arkworks4/tests/fft_fr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ mod batch_adder;
#[cfg(test)]
mod tests {
use kzg_bench::tests::fft_fr::{compare_sft_fft, inverse_fft, roundtrip_fft, stride_fft};
use rust_kzg_arkworks::fft::{fft_fr_fast, fft_fr_slow};
use rust_kzg_arkworks::kzg_proofs::FFTSettings;
use rust_kzg_arkworks::kzg_types::ArkFr;
use rust_kzg_arkworks4::fft::{fft_fr_fast, fft_fr_slow};
use rust_kzg_arkworks4::kzg_proofs::FFTSettings;
use rust_kzg_arkworks4::kzg_types::ArkFr;

#[test]
fn compare_sft_fft_() {
Expand Down
6 changes: 3 additions & 3 deletions arkworks/tests/fft_g1.rs → arkworks4/tests/fft_g1.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#[cfg(test)]
mod tests {
use kzg_bench::tests::fft_g1::{compare_ft_fft, roundtrip_fft, stride_fft};
use rust_kzg_arkworks::fft_g1::{fft_g1_fast, fft_g1_slow, make_data};
use rust_kzg_arkworks::kzg_proofs::FFTSettings;
use rust_kzg_arkworks::kzg_types::{ArkFr, ArkG1};
use rust_kzg_arkworks4::fft_g1::{fft_g1_fast, fft_g1_slow, make_data};
use rust_kzg_arkworks4::kzg_proofs::FFTSettings;
use rust_kzg_arkworks4::kzg_types::{ArkFr, ArkG1};

#[test]
fn roundtrip_fft_() {
Expand Down
Loading

0 comments on commit 8ac5410

Please sign in to comment.