Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: groth16 return object in-memory #268

Merged
merged 5 commits into from
Jul 19, 2024
Merged

feat: groth16 return object in-memory #268

merged 5 commits into from
Jul 19, 2024

Conversation

ibmp33
Copy link
Contributor

@ibmp33 ibmp33 commented Jul 14, 2024

fix ##267

Task CPU CPU with Cache GPU GPU with Cache
t1: Initialize the WitnessCalculator from the specified WASM_FILE 0.1 0.1 0.1 0.1
t2: Load inputs from INPUT_FILE, and calculate the witness 43.4 40.5 43.1 40.8
t3: Read the proving key (pk) from the specified ZKEY_FILE 6.4 - 13.1 -
t4: Create a CircomCircuit from the CIRCUIT_FILE using the calculated witness values 50.1 2.7 50.0 4.0
t5: Generate a Groth16 proof using the proving key (pk) and the created circuit (CircomCircuit) 33.6 37.6 14.7 14.1
Total Time 133.6 80.9 121.0 59.0

let circuit = create_circuit_from_file::<Scalar>(circuit_file, None);
let (pk, vk): (Parameters<Bls12>, VerifyingKey<Bls12>) =
Groth16::circuit_specific_setup(circuit.clone(), &mut rng)?;
write_pk_vk_to_files(curve_type, pk.clone(), vk.clone(), pk_file, vk_file, to_hex)?;
Copy link
Member

Choose a reason for hiding this comment

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

@ibmp33 if we have return the whole structure, we don't have to write them into local file. Meanwhile, you can change the groth16_setup_and_cache to groth16_setup_inplace and remove the arguments xx_file.

@eigmax eigmax changed the title Groth16 with cache feat: groth16 return object in-memory Jul 19, 2024
@eigmax eigmax merged commit 31bda35 into main Jul 19, 2024
5 checks passed
@eigmax eigmax deleted the groth16_with_cache branch July 19, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants