Skip to content

Commit 34b68d4

Browse files
authored
fix api after expander v1.1 (#149)
1 parent 35244d8 commit 34b68d4

File tree

8 files changed

+121
-91
lines changed

8 files changed

+121
-91
lines changed

Cargo.lock

Lines changed: 106 additions & 79 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ babybear = { git = "https://github.com/PolyhedraZK/Expander", branch = "main" }
4646
crosslayer_prototype = { git = "https://github.com/PolyhedraZK/Expander", branch = "main"}
4747
expander_circuit = { git = "https://github.com/PolyhedraZK/Expander", branch = "main", package = "circuit" }
4848
expander_transcript = { git = "https://github.com/PolyhedraZK/Expander", branch = "main", package = "transcript" }
49+
expander_binary = { git = "https://github.com/PolyhedraZK/Expander", branch = "main", package = "bin" }
4950
gf2 = { git = "https://github.com/PolyhedraZK/Expander", branch = "main" }
5051
gkr = { git = "https://github.com/PolyhedraZK/Expander", branch = "main" }
5152
gkr_engine = { git = "https://github.com/PolyhedraZK/Expander", branch = "main", package = "gkr_engine" }

expander_compiler/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ clap.workspace = true
1313
crosslayer_prototype.workspace = true
1414
macros = { path = "./macros" }
1515
ethnum.workspace = true
16+
expander_binary.workspace = true
1617
expander_circuit.workspace = true
1718
expander_transcript.workspace = true
1819
gf2.workspace = true

expander_compiler/ec_go_lib/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ crate-type = ["dylib"]
88

99
[dependencies]
1010
arith.workspace = true
11+
expander_binary.workspace = true
1112
expander_circuit.workspace = true
1213
expander_transcript.workspace = true
1314
gkr.workspace = true

expander_compiler/ec_go_lib/src/proving.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::ptr;
22
use std::slice;
33

4+
use expander_binary::executor;
45
use expander_compiler::frontend::ChallengeField;
56
use expander_compiler::frontend::SIMDField;
67

@@ -31,8 +32,8 @@ fn prove_circuit_file_inner<C: config::Config>(
3132
circuit.layers[0].input_vals = simd_input;
3233
circuit.public_input = simd_public_input;
3334
circuit.evaluate();
34-
let (claimed_v, proof) = gkr::executor::prove::<C>(&mut circuit, mpi_config.clone());
35-
gkr::executor::dump_proof_and_claimed_v(&proof, &claimed_v).map_err(|e| e.to_string())
35+
let (claimed_v, proof) = executor::prove::<C>(&mut circuit, mpi_config.clone());
36+
executor::dump_proof_and_claimed_v(&proof, &claimed_v).map_err(|e| e.to_string())
3637
}
3738

3839
fn verify_circuit_file_inner<C: config::Config>(
@@ -49,13 +50,13 @@ fn verify_circuit_file_inner<C: config::Config>(
4950
circuit.layers[0].input_vals = simd_input;
5051
circuit.public_input = simd_public_input.clone();
5152
let (proof, claimed_v) =
52-
match gkr::executor::load_proof_and_claimed_v::<ChallengeField<C>>(proof_and_claimed_v) {
53+
match executor::load_proof_and_claimed_v::<ChallengeField<C>>(proof_and_claimed_v) {
5354
Ok((proof, claimed_v)) => (proof, claimed_v),
5455
Err(_) => {
5556
return Ok(0);
5657
}
5758
};
58-
Ok(gkr::executor::verify::<C>(&mut circuit, mpi_config, &proof, &claimed_v) as u8)
59+
Ok(executor::verify::<C>(&mut circuit, mpi_config, &proof, &claimed_v) as u8)
5960
}
6061

6162
#[no_mangle]

expander_compiler/tests/example_call_expander.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use arith::Field;
22
use arith::SimdField as _SimdField;
3+
use expander_binary::executor;
34
use expander_compiler::frontend::*;
45
use gkr_engine::{MPIConfig, MPIEngine};
56
use rand::SeedableRng;
@@ -54,10 +55,10 @@ fn example<C: Config>() {
5455

5556
// prove
5657
expander_circuit.evaluate();
57-
let (claimed_v, proof) = gkr::executor::prove::<C>(&mut expander_circuit, mpi_config.clone());
58+
let (claimed_v, proof) = executor::prove::<C>(&mut expander_circuit, mpi_config.clone());
5859

5960
// verify
60-
assert!(gkr::executor::verify::<C>(
61+
assert!(executor::verify::<C>(
6162
&mut expander_circuit,
6263
mpi_config,
6364
&proof,

expander_compiler/tests/keccak_gf2_full.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use expander_binary::executor;
12
use expander_compiler::frontend::*;
23
use gkr_engine::{MPIConfig, MPIEngine};
34
use rand::{Rng, SeedableRng};
@@ -295,10 +296,10 @@ fn keccak_gf2_full() {
295296
expander_circuit.evaluate();
296297
let mpi_config = MPIConfig::prover_new();
297298
let (claimed_v, proof) =
298-
gkr::executor::prove::<GF2Config>(&mut expander_circuit, mpi_config.clone());
299+
executor::prove::<GF2Config>(&mut expander_circuit, mpi_config.clone());
299300

300301
// verify
301-
assert!(gkr::executor::verify::<GF2Config>(
302+
assert!(executor::verify::<GF2Config>(
302303
&mut expander_circuit,
303304
mpi_config,
304305
&proof,

expander_compiler/tests/keccak_gf2_full_crosslayer.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,7 @@ fn keccak_gf2_full_crosslayer() {
279279
println!("{} {}", simd_input.len(), simd_public_input.len());
280280
assert_eq!(simd_public_input.len(), 0); // public input is not supported in current virgo++
281281

282-
let mut transcript = BytesHashTranscript::<
283-
<gkr_engine::GF2ExtConfig as gkr_engine::FieldEngine>::ChallengeField,
284-
SHA256hasher,
285-
>::new();
282+
let mut transcript = BytesHashTranscript::<SHA256hasher>::new();
286283

287284
let connections = crosslayer_prototype::CrossLayerConnections::parse_circuit(&expander_circuit);
288285

0 commit comments

Comments
 (0)