From 5c9376d0f3127142a8f1006f71a666582b4c05e5 Mon Sep 17 00:00:00 2001 From: Enrico Bottazzi <85900164+enricobottazzi@users.noreply.github.com> Date: Tue, 5 Dec 2023 14:09:32 +0100 Subject: [PATCH] chore: minor fixes --- README.md | 22 ++++++++++++---------- examples/bfv.rs | 4 ++-- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a343d7f..f81f221 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,9 @@ Many polynomial operations performed inside the [circuit](./examples/bfv.rs) inv **Mock Prover** -`cargo run --example bfv -- --name bfv -k 9 --input bfv.in mock` +``` +cargo run --example bfv -- --name bfv -k 9 --input bfv.in mock +``` The `MockProver` does not run the cryptographic prover on your circuit, but instead directly checks if constraints are satisfied. This is useful for testing purposes, and runs faster than the actual prover. @@ -28,7 +30,9 @@ The `MockProver` does not run the cryptographic prover on your circuit, but inst **Key Generation** -`cargo run --example bfv -- --name bfv -k 9 --input bfv.in keygen` +```bash +cargo run --example bfv -- --name bfv -k 9 --input bfv.in keygen +``` To generate a random universal trusted setup (for testing only!) and the proving and verifying keys for your circuit. @@ -38,17 +42,15 @@ This will generate a proving key `data/bfv.pk` and a verifying key `data/bfv.vk` **Proof Generation** -`cargo run --example bfv -- --name bfv -k 9 --input bfv.in prove` - -This creates a SNARK proof, stored as a binary file `data/bfv.snark`, using the inputs read (by default) from `data/halbfvo2_lib.in``. You can specify a different input file with the option `--input filename.in`, which would look for a file at `data/filename.in``. - -Using the same proving key, you can generate proofs for the same ZK circuit on different inputs using this command. +``` +cargo run --example bfv -- --name bfv -k 9 --input bfv.in prove +``` **Proof Verification** -`cargo run --example bfv -- --name bfv -k 9 --input bfv.in verify` - -Verify the proof generated above +``` +cargo run --example bfv -- --name bfv -k 9 --input bfv.in verify +``` ## Chips diff --git a/examples/bfv.rs b/examples/bfv.rs index 350bc94..de6ea53 100644 --- a/examples/bfv.rs +++ b/examples/bfv.rs @@ -64,13 +64,13 @@ use zk_fhe::chips::PolyWithLength; const DEG: usize = 4; const Q: u64 = 4637; const T: u64 = 7; -const B: u64 = 18; +const B: u64 = 19; // These are the parameters used for the real world application - to match with input file `data/bfv_2.in` // const DEG: usize = 1024; // const Q: u64 = 536870909; // const T: u64 = 7; -// const B: u64 = 18; +// const B: u64 = 19; #[derive(Clone, Debug, Serialize, Deserialize)] pub struct CircuitInput {