Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions Cargo.lock

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

4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,20 @@
members = [
"arith", # definitions of Field, Extensions, SIMDS
"arith/babybear",
"arith/gf2",
"arith/gf2_128",
"arith/goldilocks",
"arith/mersenne31",
"arith/polynomials",
"bin", # binary executables
"circuit",
"config_macros", # proc macros used to declare a new config, this has to a separate crate due to rust compilation issues
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The config_macros crate is removed from the workspace members, but it appears to be still in use in other parts of the codebase (e.g., in gkr/src/gkr_configs.rs). This will likely cause the build to fail because path dependencies to non-workspace members are not resolved correctly. Please consider re-adding config_macros to the workspace members.

A similar issue might exist for serdes_derive (removed on line 18) if it's still in use.

"gkr",
"gkr_engine", # definitions of GKR engine and associated types
"hasher", # definitions of FiatShamirFieldHasher, FiatShamirBytesHash, and associated types
"poly_commit",
"serdes", # serialization and deserialization of various data structures
"serdes_derive",
"sumcheck",
"crosslayer_prototype",
"transcript", # instantiations of transcripts
"tree",
"utils",
]
resolver = "2"
Expand Down
15 changes: 0 additions & 15 deletions bin/src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ async fn main() {
root_println!(&mpi_config, "field type: {:?}", field_type);

match (fs_hash_type.clone(), pcs_type.clone(), field_type.clone()) {
(FiatShamirHashType::SHA256, PolynomialCommitmentType::Orion, FieldType::M31x16) => {
run_command::<M31x16ConfigSha2OrionVanilla>(&expander_exec_args, &mpi_config).await;
}
(FiatShamirHashType::Poseidon, PolynomialCommitmentType::Raw, FieldType::M31x16) => {
run_command::<M31x16ConfigPoseidonRawVanilla>(&expander_exec_args, &mpi_config).await;
}
Expand All @@ -48,24 +45,12 @@ async fn main() {
(FiatShamirHashType::SHA256, PolynomialCommitmentType::Raw, FieldType::BN254) => {
run_command::<BN254ConfigSha2Raw>(&expander_exec_args, &mpi_config).await;
}
(FiatShamirHashType::SHA256, PolynomialCommitmentType::Hyrax, FieldType::BN254) => {
run_command::<BN254ConfigSha2Hyrax>(&expander_exec_args, &mpi_config).await;
}
(FiatShamirHashType::MIMC5, PolynomialCommitmentType::KZG, FieldType::BN254) => {
run_command::<BN254ConfigMIMC5KZG>(&expander_exec_args, &mpi_config).await;
}
(FiatShamirHashType::SHA256, PolynomialCommitmentType::Orion, FieldType::GF2Ext128) => {
run_command::<GF2ExtConfigSha2Orion>(&expander_exec_args, &mpi_config).await;
}
(FiatShamirHashType::SHA256, PolynomialCommitmentType::Raw, FieldType::GF2Ext128) => {
run_command::<GF2ExtConfigSha2Raw>(&expander_exec_args, &mpi_config).await;
}
(FiatShamirHashType::SHA256, PolynomialCommitmentType::Orion, FieldType::Goldilocksx8) => {
run_command::<Goldilocksx8ConfigSha2Orion>(&expander_exec_args, &mpi_config).await;
}
(FiatShamirHashType::SHA256, PolynomialCommitmentType::Orion, FieldType::BabyBearx16) => {
run_command::<BabyBearx16ConfigSha2Raw>(&expander_exec_args, &mpi_config).await;
}
_ => panic!(
"FS: {fs_hash_type:?}, PCS: {pcs_type:?}, Field: {field_type:?} setting is not yet integrated in expander-exec"
),
Expand Down
27 changes: 2 additions & 25 deletions bin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ use std::{
use circuit::Circuit;
use clap::Parser;
use gkr::{
BN254ConfigMIMC5KZG, BN254ConfigSha2Hyrax, BN254ConfigSha2Raw, GF2ExtConfigSha2Orion,
GF2ExtConfigSha2Raw, Goldilocksx8ConfigSha2Orion, Goldilocksx8ConfigSha2Raw,
M31x1ConfigSha2RawVanilla, M31x16ConfigSha2OrionSquare, M31x16ConfigSha2OrionVanilla,
M31x16ConfigSha2RawSquare, M31x16ConfigSha2RawVanilla, Prover,
BN254ConfigMIMC5KZG, BN254ConfigSha2Raw, GF2ExtConfigSha2Raw, Goldilocksx8ConfigSha2Raw,
M31x1ConfigSha2RawVanilla, M31x16ConfigSha2RawSquare, M31x16ConfigSha2RawVanilla, Prover,
utils::{
KECCAK_BABYBEAR_CIRCUIT, KECCAK_BABYBEAR_WITNESS, KECCAK_BN254_CIRCUIT,
KECCAK_BN254_WITNESS, KECCAK_GF2_CIRCUIT, KECCAK_GF2_WITNESS, KECCAK_GOLDILOCKS_CIRCUIT,
Expand Down Expand Up @@ -73,26 +71,13 @@ fn main() {
"poseidon" => run_benchmark::<M31x16ConfigSha2RawSquare>(&args, mpi_config.clone()),
_ => unreachable!(),
},
PolynomialCommitmentType::Orion => match args.circuit.as_str() {
"keccak" => {
run_benchmark::<M31x16ConfigSha2OrionVanilla>(&args, mpi_config.clone())
}
"poseidon" => {
run_benchmark::<M31x16ConfigSha2OrionSquare>(&args, mpi_config.clone())
}
_ => unreachable!(""),
},
_ => unreachable!("Unsupported PCS type for M31"),
},
"fr" => match pcs_type {
PolynomialCommitmentType::Raw => match args.circuit.as_str() {
"keccak" => run_benchmark::<BN254ConfigSha2Raw>(&args, mpi_config.clone()),
_ => unreachable!(),
},
PolynomialCommitmentType::Hyrax => match args.circuit.as_str() {
"keccak" => run_benchmark::<BN254ConfigSha2Hyrax>(&args, mpi_config.clone()),
_ => unreachable!(),
},
PolynomialCommitmentType::KZG => match args.circuit.as_str() {
"keccak" => run_benchmark::<BN254ConfigMIMC5KZG>(&args, mpi_config.clone()),
_ => unreachable!(),
Expand All @@ -104,21 +89,13 @@ fn main() {
"keccak" => run_benchmark::<GF2ExtConfigSha2Raw>(&args, mpi_config.clone()),
_ => unreachable!(),
},
PolynomialCommitmentType::Orion => match args.circuit.as_str() {
"keccak" => run_benchmark::<GF2ExtConfigSha2Orion>(&args, mpi_config.clone()),
_ => unreachable!(),
},
_ => unreachable!("Unsupported PCS type for GF2"),
},
"goldilocks" => match pcs_type {
PolynomialCommitmentType::Raw => match args.circuit.as_str() {
"keccak" => run_benchmark::<Goldilocksx8ConfigSha2Raw>(&args, mpi_config.clone()),
_ => unreachable!(),
},
PolynomialCommitmentType::Orion => match args.circuit.as_str() {
"keccak" => run_benchmark::<Goldilocksx8ConfigSha2Orion>(&args, mpi_config.clone()),
_ => unreachable!(),
},
_ => unreachable!("Unsupported PCS type for Goldilocks"),
},
_ => unreachable!(),
Expand Down
27 changes: 2 additions & 25 deletions bin/src/main_mpi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ use std::str::FromStr;
use circuit::Circuit;
use clap::Parser;
use gkr::{
BN254ConfigMIMC5KZG, BN254ConfigSha2Hyrax, BN254ConfigSha2Raw, GF2ExtConfigSha2Orion,
GF2ExtConfigSha2Raw, Goldilocksx8ConfigSha2Orion, Goldilocksx8ConfigSha2Raw,
M31x16ConfigSha2OrionSquare, M31x16ConfigSha2OrionVanilla, M31x16ConfigSha2RawSquare,
M31x16ConfigSha2RawVanilla, Prover,
BN254ConfigMIMC5KZG, BN254ConfigSha2Raw, GF2ExtConfigSha2Raw, Goldilocksx8ConfigSha2Raw,
M31x16ConfigSha2RawSquare, M31x16ConfigSha2RawVanilla, Prover,
utils::{
KECCAK_BABYBEAR_CIRCUIT, KECCAK_BABYBEAR_WITNESS, KECCAK_BN254_CIRCUIT,
KECCAK_BN254_WITNESS, KECCAK_GF2_CIRCUIT, KECCAK_GF2_WITNESS, KECCAK_GOLDILOCKS_CIRCUIT,
Expand Down Expand Up @@ -67,26 +65,13 @@ fn main() {
"poseidon" => run_benchmark::<M31x16ConfigSha2RawSquare>(&args, mpi_config.clone()),
_ => unreachable!(),
},
PolynomialCommitmentType::Orion => match args.circuit.as_str() {
"keccak" => {
run_benchmark::<M31x16ConfigSha2OrionVanilla>(&args, mpi_config.clone())
}
"poseidon" => {
run_benchmark::<M31x16ConfigSha2OrionSquare>(&args, mpi_config.clone())
}
_ => unreachable!(""),
},
_ => unreachable!("Unsupported PCS type for M31"),
},
"fr" => match pcs_type {
PolynomialCommitmentType::Raw => match args.circuit.as_str() {
"keccak" => run_benchmark::<BN254ConfigSha2Raw>(&args, mpi_config.clone()),
_ => unreachable!(),
},
PolynomialCommitmentType::Hyrax => match args.circuit.as_str() {
"keccak" => run_benchmark::<BN254ConfigSha2Hyrax>(&args, mpi_config.clone()),
_ => unreachable!(),
},
PolynomialCommitmentType::KZG => match args.circuit.as_str() {
"keccak" => run_benchmark::<BN254ConfigMIMC5KZG>(&args, mpi_config.clone()),
_ => unreachable!(),
Expand All @@ -98,21 +83,13 @@ fn main() {
"keccak" => run_benchmark::<GF2ExtConfigSha2Raw>(&args, mpi_config.clone()),
_ => unreachable!(),
},
PolynomialCommitmentType::Orion => match args.circuit.as_str() {
"keccak" => run_benchmark::<GF2ExtConfigSha2Orion>(&args, mpi_config.clone()),
_ => unreachable!(),
},
_ => unreachable!("Unsupported PCS type for GF2"),
},
"goldilocks" => match pcs_type {
PolynomialCommitmentType::Raw => match args.circuit.as_str() {
"keccak" => run_benchmark::<Goldilocksx8ConfigSha2Raw>(&args, mpi_config.clone()),
_ => unreachable!(),
},
PolynomialCommitmentType::Orion => match args.circuit.as_str() {
"keccak" => run_benchmark::<Goldilocksx8ConfigSha2Orion>(&args, mpi_config.clone()),
_ => unreachable!(),
},
_ => unreachable!("Unsupported PCS type for Goldilocks"),
},
_ => unreachable!(),
Expand Down
11 changes: 1 addition & 10 deletions config_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,11 @@ fn parse_polynomial_commitment_type(
"Raw".to_owned(),
format!("RawExpanderGKR::<{field_config}>").to_owned(),
),
("Hyrax", "BN254") => ("Hyrax".to_string(), "HyraxPCS::<G1Affine>".to_string()),
("KZG", "BN254") => ("KZG".to_owned(), "HyperBiKZGPCS::<Bn256>".to_string()),
("KZG", "BN254") => ("KZG".to_owned(), "HyperUniKZGPCS::<Bn256>".to_string()),
("Orion", "GF2Ext128") => (
"Orion".to_owned(),
format!("OrionPCSForGKR::<{field_config}, GF2x128>").to_owned(),
),
("Orion", "M31x16") => (
"Orion".to_owned(),
format!("OrionPCSForGKR::<{field_config}, M31x16>").to_owned(),
),
("Orion", "Goldilocksx8") => (
"Orion".to_owned(),
format!("OrionPCSForGKR::<{field_config}, Goldilocksx8>").to_owned(),
),
_ => panic!(
"Unknown polynomial commitment type in config macro expansion. PCS: '{pcs_type_str}', Field: '{field_type}'"
),
Expand Down
19 changes: 1 addition & 18 deletions config_macros/tests/macro_expansion.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
use std::any::type_name;

use config_macros::declare_gkr_config;
use gf2::GF2x128;
use gkr_engine::{
BN254Config, BabyBearx16Config, FieldEngine, GF2ExtConfig, GKREngine, GKRScheme,
Goldilocksx8Config, M31x16Config, MPIConfig,
};
use gkr_hashers::{Keccak256hasher, MiMC5FiatShamirHasher, PoseidonFiatShamirHasher, SHA256hasher};
use halo2curves::bn256::Bn256;
use mersenne31::M31x16;
use poly_commit::{HyperBiKZGPCS, OrionPCSForGKR, RawExpanderGKR};
use poly_commit::{HyperUniKZGPCS, RawExpanderGKR};
use transcript::BytesHashTranscript;

fn print_type_name<Cfg: GKREngine>() {
Expand All @@ -32,13 +31,6 @@ fn main() {
PolynomialCommitmentType::Raw,
GKRScheme::Vanilla,
);
declare_gkr_config!(
M31ExtPoseidonOrionConfig,
FieldType::M31x16,
FiatShamirHashType::Poseidon,
PolynomialCommitmentType::Orion,
GKRScheme::Vanilla,
);
declare_gkr_config!(
BN254MIMCConfig,
FieldType::BN254,
Expand All @@ -60,13 +52,6 @@ fn main() {
PolynomialCommitmentType::Raw,
GKRScheme::Vanilla,
);
declare_gkr_config!(
GF2ExtKeccak256OrionConfig,
FieldType::GF2Ext128,
FiatShamirHashType::Keccak256,
PolynomialCommitmentType::Orion,
GKRScheme::Vanilla,
);
declare_gkr_config!(
GoldilocksExtSHA256Config,
FieldType::Goldilocksx8,
Expand All @@ -84,11 +69,9 @@ fn main() {

print_type_name::<M31ExtSha256Config>();
print_type_name::<M31ExtPoseidonRawConfig>();
print_type_name::<M31ExtPoseidonOrionConfig>();
print_type_name::<BN254MIMCConfig>();
print_type_name::<BN254MIMCKZGConfig>();
print_type_name::<GF2ExtKeccak256Config>();
print_type_name::<GF2ExtKeccak256OrionConfig>();
print_type_name::<GoldilocksExtSHA256Config>();
print_type_name::<BabyBearExtSHA256Config>();
}
42 changes: 2 additions & 40 deletions gkr/src/gkr_configs.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
use config_macros::declare_gkr_config;
use gf2::GF2x128;
use gkr_engine::{
BN254Config, BabyBearx16Config, FieldEngine, GF2ExtConfig, GKREngine, GKRScheme,
Goldilocksx1Config, Goldilocksx8Config, M31x16Config, M31x1Config, MPIConfig,
};
use gkr_hashers::{MiMC5FiatShamirHasher, PoseidonFiatShamirHasher, SHA256hasher};
use goldilocks::Goldilocksx8;
use halo2curves::bn256::{Bn256, G1Affine};
use halo2curves::bn256::Bn256;
use mersenne31::M31x16;
use poly_commit::{raw::RawExpanderGKR, HyperBiKZGPCS, HyraxPCS, OrionPCSForGKR};
use poly_commit::{raw::RawExpanderGKR, HyperUniKZGPCS};
use transcript::BytesHashTranscript;

// ============== M31 ==============
Expand All @@ -34,20 +32,6 @@ declare_gkr_config!(
PolynomialCommitmentType::Raw,
GKRScheme::GkrSquare,
);
declare_gkr_config!(
pub M31x16ConfigSha2OrionVanilla,
FieldType::M31x16,
FiatShamirHashType::SHA256,
PolynomialCommitmentType::Orion,
GKRScheme::Vanilla,
);
declare_gkr_config!(
pub M31x16ConfigSha2OrionSquare,
FieldType::M31x16,
FiatShamirHashType::SHA256,
PolynomialCommitmentType::Orion,
GKRScheme::GkrSquare,
);
declare_gkr_config!(
pub M31x16ConfigSha2RawVanilla,
FieldType::M31x16,
Expand Down Expand Up @@ -78,13 +62,6 @@ declare_gkr_config!(
PolynomialCommitmentType::Raw,
GKRScheme::Vanilla,
);
declare_gkr_config!(
pub BN254ConfigSha2Hyrax,
FieldType::BN254,
FiatShamirHashType::SHA256,
PolynomialCommitmentType::Hyrax,
GKRScheme::Vanilla,
);
declare_gkr_config!(
pub BN254ConfigSha2KZG,
FieldType::BN254,
Expand All @@ -101,13 +78,6 @@ declare_gkr_config!(
);

// ============== GF2 ==============
declare_gkr_config!(
pub GF2ExtConfigSha2Orion,
FieldType::GF2Ext128,
FiatShamirHashType::SHA256,
PolynomialCommitmentType::Orion,
GKRScheme::Vanilla,
);
declare_gkr_config!(
pub GF2ExtConfigSha2Raw,
FieldType::GF2Ext128,
Expand All @@ -134,14 +104,6 @@ declare_gkr_config!(
GKRScheme::Vanilla,
);

declare_gkr_config!(
pub Goldilocksx8ConfigSha2Orion,
FieldType::Goldilocksx8,
FiatShamirHashType::SHA256,
PolynomialCommitmentType::Orion,
GKRScheme::Vanilla,
);

// ============== Babybear ==============
declare_gkr_config!(
pub BabyBearx16ConfigSha2Raw,
Expand Down
Loading
Loading