Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
Signed-off-by: Tiancheng Xie <niconiconi@sjtu.edu.cn>
  • Loading branch information
niconiconi authored Feb 14, 2025
2 parents c4b0dc9 + d40fd2d commit 56e17a4
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 5 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion gkr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ pub mod executor;

pub mod gkr_configs;
pub use gkr_configs::*;

#[cfg(test)]
mod tests;
19 changes: 19 additions & 0 deletions gkr/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,25 @@ fn main() {

let mpi_config = MPIConfig::new();

declare_gkr_config!(
M31ExtConfigSha2,
FieldType::M31,
FiatShamirHashType::SHA256,
PolynomialCommitmentType::Raw
);
declare_gkr_config!(
BN254ConfigSha2,
FieldType::BN254,
FiatShamirHashType::SHA256,
PolynomialCommitmentType::Raw
);
declare_gkr_config!(
GF2ExtConfigSha2,
FieldType::GF2,
FiatShamirHashType::SHA256,
PolynomialCommitmentType::Orion
);

match args.field.as_str() {
"m31ext3" => match args.scheme.as_str() {
"keccak" => run_benchmark::<M31ExtConfigSha2Orion>(
Expand Down
19 changes: 19 additions & 0 deletions gkr/src/main_mpi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,25 @@ fn main() {

let mpi_config = MPIConfig::new();

declare_gkr_config!(
M31ExtConfigSha2,
FieldType::M31,
FiatShamirHashType::SHA256,
PolynomialCommitmentType::Raw
);
declare_gkr_config!(
BN254ConfigSha2,
FieldType::BN254,
FiatShamirHashType::SHA256,
PolynomialCommitmentType::Raw
);
declare_gkr_config!(
GF2ExtConfigSha2,
FieldType::GF2,
FiatShamirHashType::SHA256,
PolynomialCommitmentType::Orion
);

match args.field.as_str() {
"m31ext3" => match args.scheme.as_str() {
"keccak" => run_benchmark::<M31ExtConfigSha2Orion>(
Expand Down
1 change: 1 addition & 0 deletions gkr/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use sumcheck::{GKRVerifierHelper, VerifierScratchPad};
use transcript::{transcript_verifier_sync, Proof, Transcript};
use utils::timer::Timer;


#[cfg(feature = "grinding")]
use crate::grind;

Expand Down
4 changes: 0 additions & 4 deletions scripts/test_recursion.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def change_working_dir():
if "Expander/scripts" in cwd:
os.chdir("..")


def in_recursion_dir(closure: Callable[..., Any]):
def wrapped():
os.chdir("./recursion")
Expand Down Expand Up @@ -128,7 +127,6 @@ def gkr_prove(proof_config: ProofConfig, mpi_config: MPIConfig) -> str:
print("gkr prove done.")
return proof_file


def vanilla_gkr_verify_check(
proof_config: ProofConfig,
proof_path: str,
Expand Down Expand Up @@ -202,7 +200,6 @@ def test_m31_gkr_to_gkr_recursion_payload():
# minor - check golang if exists on the machine
if subprocess.run("go env", shell=True).returncode != 0:
raise Exception("golang support missing")

change_working_dir()
expander_compile()

Expand All @@ -211,7 +208,6 @@ def test_m31_gkr_to_gkr_recursion_payload():
BN254_GKR_TO_GROTH16_RECURSION_PROOF_CONFIG,
MPI_CONFIG
)

test_m31_gkr_to_gkr_recursion(
M31_GKR_TO_GKR_RECURSION_PROOF_CONFIG,
MPI_CONFIG
Expand Down
2 changes: 2 additions & 0 deletions tree/src/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ impl Tree {

non_leaf_nodes
.iter_mut()

.enumerate()
.take(upper_bound)
.skip(start_index)
Expand All @@ -166,6 +167,7 @@ impl Tree {
let upper_bound = left_child_index(start_index);
let mut buf = non_leaf_nodes[start_index..upper_bound].to_vec();
buf.iter_mut().enumerate().for_each(|(index, node)| {

*node = Node::node_hash(
&non_leaf_nodes[left_child_index(index + start_index)],
&non_leaf_nodes[right_child_index(index + start_index)],
Expand Down

0 comments on commit 56e17a4

Please sign in to comment.