From 7606d3892a0806beed0d4c47f54e862c8d7546b5 Mon Sep 17 00:00:00 2001 From: Zhiyong Fang Date: Tue, 27 Aug 2024 12:25:15 -0500 Subject: [PATCH] mac debug; temporarily disable other ci --- .github/workflows/benchmarks.yml | 76 +++++----- .github/workflows/build.yml | 76 +++++----- .github/workflows/ci.yml | 146 ++++++++++---------- arith/benches/ext_field.rs | 33 +++-- arith/src/extension_field/gf2_128x8/neon.rs | 131 +++++++++++++++++- tests/gkr_correctness.rs | 1 - 6 files changed, 289 insertions(+), 174 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 6f792773..9304ef6e 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -1,40 +1,40 @@ -name: Run Benchmarks +# name: Run Benchmarks -on: - push: - pull_request: +# on: +# push: +# pull_request: -jobs: - benchmark: - runs-on: 7950x3d - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up Python - run: python3 --version - - name: update toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - name: 'Authenticate to Google Cloud' - uses: 'google-github-actions/auth@v1' - with: - credentials_json: '${{ secrets.GCP_SA_KEY }}' - - name: Set up Google Cloud SDK - uses: google-github-actions/setup-gcloud@v1 - with: - project_id: ${{ secrets.GCP_PROJECT_ID }} - - name: Install criterion - run: cargo install cargo-criterion - - name: Run benchmark - run: RUSTFLAGS="-C target-cpu=native" cargo criterion --message-format=json > benchmark_results.json - - name: Clean benchmark results - run: | - wget https://raw.githubusercontent.com/PolyhedraZK/Expander-rs/main/scripts/parse_benchmark_result.py - python3 parse_benchmark_result.py benchmark_results.json benchmark_results_clean.json - - name: Upload benchmark results to Google Cloud Storage - run: | - commit_hash=$(git rev-parse HEAD) - repo_name="${GITHUB_REPOSITORY#*/}" - gsutil cp benchmark_results_clean.json gs://github_micro_bench/${repo_name}/benchmark_${commit_hash}.json \ No newline at end of file +# jobs: +# benchmark: +# runs-on: 7950x3d +# steps: +# - uses: actions/checkout@v4 +# with: +# fetch-depth: 0 +# - name: Set up Python +# run: python3 --version +# - name: update toolchain +# uses: actions-rs/toolchain@v1 +# with: +# toolchain: stable +# - name: 'Authenticate to Google Cloud' +# uses: 'google-github-actions/auth@v1' +# with: +# credentials_json: '${{ secrets.GCP_SA_KEY }}' +# - name: Set up Google Cloud SDK +# uses: google-github-actions/setup-gcloud@v1 +# with: +# project_id: ${{ secrets.GCP_PROJECT_ID }} +# - name: Install criterion +# run: cargo install cargo-criterion +# - name: Run benchmark +# run: RUSTFLAGS="-C target-cpu=native" cargo criterion --message-format=json > benchmark_results.json +# - name: Clean benchmark results +# run: | +# wget https://raw.githubusercontent.com/PolyhedraZK/Expander-rs/main/scripts/parse_benchmark_result.py +# python3 parse_benchmark_result.py benchmark_results.json benchmark_results_clean.json +# - name: Upload benchmark results to Google Cloud Storage +# run: | +# commit_hash=$(git rev-parse HEAD) +# repo_name="${GITHUB_REPOSITORY#*/}" +# gsutil cp benchmark_results_clean.json gs://github_micro_bench/${repo_name}/benchmark_${commit_hash}.json \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2c96d152..d47555ae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,40 +1,40 @@ -name: build-expander-exec -on: - release: - types: [released] +# name: build-expander-exec +# on: +# release: +# types: [released] -env: - RUSTFLAGS: "-Dwarnings" - RUST_BACKTRACE: 1 +# env: +# RUSTFLAGS: "-Dwarnings" +# RUST_BACKTRACE: 1 -jobs: - build: - strategy: - matrix: - platform: [macos, linux-avx2] - include: - - platform: macos - ci_image: macos-latest - flags: '' - - platform: linux-avx2 - ci_image: ubuntu-latest - flags: 'RUSTFLAGS="-C target-feature=+avx2"' - runs-on: ${{ matrix.ci_image }} - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - name: Prepare binary - run: ${{ matrix.flags }} cargo build --release --bin expander-exec - - name: Upload release asset - uses: actions/github-script@v6 - with: - script: | - const fs = require('fs').promises; - github.rest.repos.uploadReleaseAsset({ - owner: context.repo.owner, - repo: context.repo.repo, - release_id: ${{ github.event.release.id }}, - name: 'expander-exec-${{ matrix.platform }}', - data: await fs.readFile('target/release/expander-exec') - }); +# jobs: +# build: +# strategy: +# matrix: +# platform: [macos, linux-avx2] +# include: +# - platform: macos +# ci_image: macos-latest +# flags: '' +# - platform: linux-avx2 +# ci_image: ubuntu-latest +# flags: 'RUSTFLAGS="-C target-feature=+avx2"' +# runs-on: ${{ matrix.ci_image }} +# steps: +# - uses: actions/checkout@v4 +# - uses: dtolnay/rust-toolchain@stable +# - uses: Swatinem/rust-cache@v2 +# - name: Prepare binary +# run: ${{ matrix.flags }} cargo build --release --bin expander-exec +# - name: Upload release asset +# uses: actions/github-script@v6 +# with: +# script: | +# const fs = require('fs').promises; +# github.rest.repos.uploadReleaseAsset({ +# owner: context.repo.owner, +# repo: context.repo.repo, +# release_id: ${{ github.event.release.id }}, +# name: 'expander-exec-${{ matrix.platform }}', +# data: await fs.readFile('target/release/expander-exec') +# }); diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index caf6338a..de849eab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,76 +41,76 @@ jobs: - run: cargo test -p bi-kzg --release - run: cargo test --no-default-features --release - run: cargo test --all-features --release - Bench-mac-m31-ext3: - name: Bench-mac-m31-ext3 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - run: wget -P data https://storage.googleapis.com/keccak8/circuit.txt - - run: wget -P data https://storage.googleapis.com/keccak8/witness.txt - - run: RUSTFLAGS="-C target-cpu=native" cargo run --release -- -t 2 -f m31ext3 - Bench-mac-BN254: - name: Bench-mac-BN254 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - run: wget -P data https://storage.googleapis.com/keccak8/circuit.txt - - run: wget -P data https://storage.googleapis.com/keccak8/witness.txt - - run: RUSTFLAGS="-C target-cpu=native" cargo run --release -- -t 2 -f fr - Bench-mac-gf2-ext128: - name: Bench-mac-gf2ext128 - runs-on: macos-latest - steps: - - uses: styfle/cancel-workflow-action@0.11.0 - with: - all_but_latest: true - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - run: wget -P data https://storage.googleapis.com/expander-compiled-circuits/keccak-ci/gf2/circuit.txt - - run: RUSTFLAGS="-C target-cpu=native" cargo run --release -- -t 2 -f gf2ext128 - Test-linux: - name: Test-linux - runs-on: 7950x3d - steps: - - uses: actions/checkout@v4 - - run: . "$HOME/.cargo/env" - - run: wget -P data https://storage.googleapis.com/keccak8/circuit.txt - - run: wget -P data https://storage.googleapis.com/keccak8/witness.txt - - run: RUSTFLAGS="-C target-cpu=native" cargo test -p arith --release - - run: RUSTFLAGS="-C target-cpu=native" cargo test -p bi-kzg --release - - run: RUSTFLAGS="-C target-cpu=native" cargo test --no-default-features --release - - run: RUSTFLAGS="-C target-cpu=native" cargo test --all-features --release - Bench-linux-m31-ext3: - name: Bench-linux-m31-ext3 - runs-on: 7950x3d - steps: - - uses: actions/checkout@v4 - - run: . "$HOME/.cargo/env" - - run: wget -P data https://storage.googleapis.com/keccak8/circuit.txt - - run: wget -P data https://storage.googleapis.com/keccak8/witness.txt - - run: RUSTFLAGS="-C target-cpu=native" cargo run --release -- -t 16 -f m31ext3 - Bench-linux-BN254: - name: Bench-linux-BN254 - runs-on: 7950x3d - steps: - - uses: actions/checkout@v4 - - run: . "$HOME/.cargo/env" - - run: wget -P data https://storage.googleapis.com/keccak8/circuit.txt - - run: wget -P data https://storage.googleapis.com/keccak8/witness.txt - - run: RUSTFLAGS="-C target-cpu=native" cargo run --release -- -t 16 -f fr - Bench-linux-gf2-ext128: - name: Bench-linux-gf2-ext128 - runs-on: 7950x3d - steps: - - uses: styfle/cancel-workflow-action@0.11.0 - with: - all_but_latest: true - - uses: actions/checkout@v4 - - run: . "$HOME/.cargo/env" - - run: wget -P data https://storage.googleapis.com/expander-compiled-circuits/keccak-ci/gf2/circuit.txt - - run: RUSTFLAGS="-C target-cpu=native" cargo run --release -- -t 16 -f gf2ext128 + # Bench-mac-m31-ext3: + # name: Bench-mac-m31-ext3 + # runs-on: macos-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: dtolnay/rust-toolchain@stable + # - uses: Swatinem/rust-cache@v2 + # - run: wget -P data https://storage.googleapis.com/keccak8/circuit.txt + # - run: wget -P data https://storage.googleapis.com/keccak8/witness.txt + # - run: RUSTFLAGS="-C target-cpu=native" cargo run --release -- -t 2 -f m31ext3 + # Bench-mac-BN254: + # name: Bench-mac-BN254 + # runs-on: macos-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: dtolnay/rust-toolchain@stable + # - uses: Swatinem/rust-cache@v2 + # - run: wget -P data https://storage.googleapis.com/keccak8/circuit.txt + # - run: wget -P data https://storage.googleapis.com/keccak8/witness.txt + # - run: RUSTFLAGS="-C target-cpu=native" cargo run --release -- -t 2 -f fr + # Bench-mac-gf2-ext128: + # name: Bench-mac-gf2ext128 + # runs-on: macos-latest + # steps: + # - uses: styfle/cancel-workflow-action@0.11.0 + # with: + # all_but_latest: true + # - uses: actions/checkout@v4 + # - uses: dtolnay/rust-toolchain@stable + # - uses: Swatinem/rust-cache@v2 + # - run: wget -P data https://storage.googleapis.com/expander-compiled-circuits/keccak-ci/gf2/circuit.txt + # - run: RUSTFLAGS="-C target-cpu=native" cargo run --release -- -t 2 -f gf2ext128 + # Test-linux: + # name: Test-linux + # runs-on: 7950x3d + # steps: + # - uses: actions/checkout@v4 + # - run: . "$HOME/.cargo/env" + # - run: wget -P data https://storage.googleapis.com/keccak8/circuit.txt + # - run: wget -P data https://storage.googleapis.com/keccak8/witness.txt + # - run: RUSTFLAGS="-C target-cpu=native" cargo test -p arith --release + # - run: RUSTFLAGS="-C target-cpu=native" cargo test -p bi-kzg --release + # - run: RUSTFLAGS="-C target-cpu=native" cargo test --no-default-features --release + # - run: RUSTFLAGS="-C target-cpu=native" cargo test --all-features --release + # Bench-linux-m31-ext3: + # name: Bench-linux-m31-ext3 + # runs-on: 7950x3d + # steps: + # - uses: actions/checkout@v4 + # - run: . "$HOME/.cargo/env" + # - run: wget -P data https://storage.googleapis.com/keccak8/circuit.txt + # - run: wget -P data https://storage.googleapis.com/keccak8/witness.txt + # - run: RUSTFLAGS="-C target-cpu=native" cargo run --release -- -t 16 -f m31ext3 + # Bench-linux-BN254: + # name: Bench-linux-BN254 + # runs-on: 7950x3d + # steps: + # - uses: actions/checkout@v4 + # - run: . "$HOME/.cargo/env" + # - run: wget -P data https://storage.googleapis.com/keccak8/circuit.txt + # - run: wget -P data https://storage.googleapis.com/keccak8/witness.txt + # - run: RUSTFLAGS="-C target-cpu=native" cargo run --release -- -t 16 -f fr + # Bench-linux-gf2-ext128: + # name: Bench-linux-gf2-ext128 + # runs-on: 7950x3d + # steps: + # - uses: styfle/cancel-workflow-action@0.11.0 + # with: + # all_but_latest: true + # - uses: actions/checkout@v4 + # - run: . "$HOME/.cargo/env" + # - run: wget -P data https://storage.googleapis.com/expander-compiled-circuits/keccak-ci/gf2/circuit.txt + # - run: RUSTFLAGS="-C target-cpu=native" cargo run --release -- -t 16 -f gf2ext128 diff --git a/arith/benches/ext_field.rs b/arith/benches/ext_field.rs index 3d8adc68..814292f3 100644 --- a/arith/benches/ext_field.rs +++ b/arith/benches/ext_field.rs @@ -1,4 +1,4 @@ -use arith::{Field, BinomialExtensionField, GF2_128x8, M31Ext3, M31Ext3x16, GF2_128}; +use arith::{BinomialExtensionField, Field, GF2_128x8, M31Ext3, M31Ext3x16, GF2_128}; use ark_std::test_rng; use criterion::{criterion_group, criterion_main, BatchSize, Criterion}; use tynm::type_name; @@ -8,7 +8,7 @@ fn random_element() -> F { F::random_unsafe(&mut rng) } -pub(crate) fn bench_field(c: &mut Criterion) { +pub(crate) fn bench_field(c: &mut Criterion) { c.bench_function( &format!( "mul-by-base-throughput<{}> 100x times {}x ", @@ -31,7 +31,12 @@ pub(crate) fn bench_field(c: &mut Criterion) { }, |(mut x, mut y, mut z, mut w, xx, yy, zz, ww)| { for _ in 0..25 { - (x, y, z, w) = (x.mul_by_base_field(&xx), y.mul_by_base_field(&yy), z.mul_by_base_field(&zz), w.mul_by_base_field(&ww)); + (x, y, z, w) = ( + x.mul_by_base_field(&xx), + y.mul_by_base_field(&yy), + z.mul_by_base_field(&zz), + w.mul_by_base_field(&ww), + ); } (x, y, z, w) }, @@ -48,12 +53,7 @@ pub(crate) fn bench_field(c: &mut Criterion) { ), |b| { b.iter_batched( - || { - ( - random_element::(), - random_element::(), - ) - }, + || (random_element::(), random_element::()), |(mut x, xx)| { for _ in 0..100 { x = x.mul_by_base_field(&xx); @@ -87,7 +87,12 @@ pub(crate) fn bench_field(c: &mut Criterion) { }, |(mut x, mut y, mut z, mut w, xx, yy, zz, ww)| { for _ in 0..25 { - (x, y, z, w) = (x.add_by_base_field(&xx), y.add_by_base_field(&yy), z.add_by_base_field(&zz), w.add_by_base_field(&ww)); + (x, y, z, w) = ( + x.add_by_base_field(&xx), + y.add_by_base_field(&yy), + z.add_by_base_field(&zz), + w.add_by_base_field(&ww), + ); } (x, y, z, w) }, @@ -104,12 +109,7 @@ pub(crate) fn bench_field(c: &mut Criterion) { ), |b| { b.iter_batched( - || { - ( - random_element::(), - random_element::(), - ) - }, + || (random_element::(), random_element::()), |(mut x, xx)| { for _ in 0..100 { x = x.add_by_base_field(&xx); @@ -120,7 +120,6 @@ pub(crate) fn bench_field(c: &mut Criterion) { ) }, ); - } fn ext_by_base_benchmark(c: &mut Criterion) { diff --git a/arith/src/extension_field/gf2_128x8/neon.rs b/arith/src/extension_field/gf2_128x8/neon.rs index 9084d444..64248473 100644 --- a/arith/src/extension_field/gf2_128x8/neon.rs +++ b/arith/src/extension_field/gf2_128x8/neon.rs @@ -237,13 +237,13 @@ impl From for NeonGF2_128x8 { NeonGF2_128x8 { v: [ unsafe { transmute::<[u32; 4], uint32x4_t>([v, 0, 0, 0]) }, - unsafe { transmute::<[u32; 4], uint32x4_t>([0, 0, 0, 0]) }, - unsafe { transmute::<[u32; 4], uint32x4_t>([0, 0, 0, 0]) }, - unsafe { transmute::<[u32; 4], uint32x4_t>([0, 0, 0, 0]) }, - unsafe { transmute::<[u32; 4], uint32x4_t>([0, 0, 0, 0]) }, - unsafe { transmute::<[u32; 4], uint32x4_t>([0, 0, 0, 0]) }, - unsafe { transmute::<[u32; 4], uint32x4_t>([0, 0, 0, 0]) }, - unsafe { transmute::<[u32; 4], uint32x4_t>([0, 0, 0, 0]) }, + unsafe { transmute::<[u32; 4], uint32x4_t>([v, 0, 0, 0]) }, + unsafe { transmute::<[u32; 4], uint32x4_t>([v, 0, 0, 0]) }, + unsafe { transmute::<[u32; 4], uint32x4_t>([v, 0, 0, 0]) }, + unsafe { transmute::<[u32; 4], uint32x4_t>([v, 0, 0, 0]) }, + unsafe { transmute::<[u32; 4], uint32x4_t>([v, 0, 0, 0]) }, + unsafe { transmute::<[u32; 4], uint32x4_t>([v, 0, 0, 0]) }, + unsafe { transmute::<[u32; 4], uint32x4_t>([v, 0, 0, 0]) }, ], } } @@ -285,3 +285,120 @@ fn mul_internal(a: &NeonGF2_128x8, b: &NeonGF2_128x8) -> NeonGF2_128x8 { ], } } + +impl BinomialExtensionField for NeonGF2_128x8 { + const DEGREE: usize = 128; + const W: u32 = 0x87; + + type BaseField = GF2x8; + + #[inline(always)] + fn mul_by_base_field(&self, base: &Self::BaseField) -> Self { + let v0 = ((base.v >> 7) & 1u8) as u32; + let v1 = ((base.v >> 6) & 1u8) as u32; + let v2 = ((base.v >> 5) & 1u8) as u32; + let v3 = ((base.v >> 4) & 1u8) as u32; + let v4 = ((base.v >> 3) & 1u8) as u32; + let v5 = ((base.v >> 2) & 1u8) as u32; + let v6 = ((base.v >> 1) & 1u8) as u32; + let v7 = ((base.v >> 0) & 1u8) as u32; + + Self { + v: [ + gfmul(res.v[0], transmute::<[u32; 4], uint32x4_t>([v0, 0, 0, 0])), + gfmul(res.v[1], transmute::<[u32; 4], uint32x4_t>([v2, 0, 0, 0])), + gfmul(res.v[2], transmute::<[u32; 4], uint32x4_t>([v4, 0, 0, 0])), + gfmul(res.v[3], transmute::<[u32; 4], uint32x4_t>([v6, 0, 0, 0])), + gfmul(res.v[4], transmute::<[u32; 4], uint32x4_t>([v1, 0, 0, 0])), + gfmul(res.v[5], transmute::<[u32; 4], uint32x4_t>([v3, 0, 0, 0])), + gfmul(res.v[6], transmute::<[u32; 4], uint32x4_t>([v5, 0, 0, 0])), + gfmul(res.v[7], transmute::<[u32; 4], uint32x4_t>([v7, 0, 0, 0])), + ], + } + } + + #[inline(always)] + fn add_by_base_field(&self, base: &Self::BaseField) -> Self { + let v0 = ((base.v >> 7) & 1u8) as u32; + let v1 = ((base.v >> 6) & 1u8) as u32; + let v2 = ((base.v >> 5) & 1u8) as u32; + let v3 = ((base.v >> 4) & 1u8) as u32; + let v4 = ((base.v >> 3) & 1u8) as u32; + let v5 = ((base.v >> 2) & 1u8) as u32; + let v6 = ((base.v >> 1) & 1u8) as u32; + let v7 = ((base.v >> 0) & 1u8) as u32; + + Self { + v: [ + unsafe { gfadd(res.v[0], transmute::<[u32; 4], uint32x4_t>([v0, 0, 0, 0])) }, + unsafe { gfadd(res.v[1], transmute::<[u32; 4], uint32x4_t>([v2, 0, 0, 0])) }, + unsafe { gfadd(res.v[2], transmute::<[u32; 4], uint32x4_t>([v4, 0, 0, 0])) }, + unsafe { gfadd(res.v[3], transmute::<[u32; 4], uint32x4_t>([v6, 0, 0, 0])) }, + unsafe { gfadd(res.v[4], transmute::<[u32; 4], uint32x4_t>([v1, 0, 0, 0])) }, + unsafe { gfadd(res.v[5], transmute::<[u32; 4], uint32x4_t>([v3, 0, 0, 0])) }, + unsafe { gfadd(res.v[6], transmute::<[u32; 4], uint32x4_t>([v5, 0, 0, 0])) }, + unsafe { gfadd(res.v[7], transmute::<[u32; 4], uint32x4_t>([v7, 0, 0, 0])) }, + ], + } + } +} + +impl From for NeonGF2_128x8 { + #[inline(always)] + fn from(v: GF2x8) -> Self { + let v0 = ((v.v >> 7) & 1u8) as u32; + let v1 = ((v.v >> 6) & 1u8) as u32; + let v2 = ((v.v >> 5) & 1u8) as u32; + let v3 = ((v.v >> 4) & 1u8) as u32; + let v4 = ((v.v >> 3) & 1u8) as u32; + let v5 = ((v.v >> 2) & 1u8) as u32; + let v6 = ((v.v >> 1) & 1u8) as u32; + let v7 = ((v.v >> 0) & 1u8) as u32; + + NeonGF2_128x8 { + v: [ + unsafe { transmute::<[u32; 4], uint32x4_t>([v0, 0, 0, 0]) }, + unsafe { transmute::<[u32; 4], uint32x4_t>([v2, 0, 0, 0]) }, + unsafe { transmute::<[u32; 4], uint32x4_t>([v4, 0, 0, 0]) }, + unsafe { transmute::<[u32; 4], uint32x4_t>([v6, 0, 0, 0]) }, + unsafe { transmute::<[u32; 4], uint32x4_t>([v1, 0, 0, 0]) }, + unsafe { transmute::<[u32; 4], uint32x4_t>([v3, 0, 0, 0]) }, + unsafe { transmute::<[u32; 4], uint32x4_t>([v5, 0, 0, 0]) }, + unsafe { transmute::<[u32; 4], uint32x4_t>([v7, 0, 0, 0]) }, + ], + } + } +} + +impl Mul for NeonGF2_128x8 { + type Output = NeonGF2_128x8; + + #[inline(always)] + fn mul(self, rhs: GF2) -> Self::Output { + if rhs.is_zero() { + Self::zero() + } else { + self + } + } +} + +impl Add for NeonGF2_128x8 { + type Output = NeonGF2_128x8; + #[inline(always)] + fn add(self, rhs: GF2) -> Self::Output { + let rhs_extended = unsafe { transmute::<[u32; 4], uint32x4_t>([rhs.v, 0, 0, 0]) }; + NeonGF2_128x8 { + v: [ + unsafe { gfmul(self.v[0], rhs_extended) }, + unsafe { gfmul(self.v[1], rhs_extended) }, + unsafe { gfmul(self.v[2], rhs_extended) }, + unsafe { gfmul(self.v[3], rhs_extended) }, + unsafe { gfmul(self.v[4], rhs_extended) }, + unsafe { gfmul(self.v[5], rhs_extended) }, + unsafe { gfmul(self.v[6], rhs_extended) }, + unsafe { gfmul(self.v[7], rhs_extended) }, + ], + } + } +} diff --git a/tests/gkr_correctness.rs b/tests/gkr_correctness.rs index e6cc553f..80f40184 100644 --- a/tests/gkr_correctness.rs +++ b/tests/gkr_correctness.rs @@ -58,7 +58,6 @@ fn test_gkr_correctness() { fn test_gkr_correctness_helper(config: &Config) { println!("Config created."); let mut circuit = Circuit::::load_circuit(CIRCUIT_NAME); - circuit.identify_rnd_coefs(); // circuit.layers = circuit.layers[6..7].to_vec(); // for only evaluate certain layer // let mut circuit = gen_simple_circuit(); // for custom circuit