Skip to content

Commit

Permalink
Fixes verification with plonky2
Browse files Browse the repository at this point in the history
  • Loading branch information
brweisz committed May 28, 2024
1 parent 05b0975 commit 9d423f6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tooling/backend_interface/src/cli/prove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl ProveCommand {

let output = command.output()?;
if output.status.success() {
println!("{}", String::from_utf8_lossy(&output.stdout));
println!("{}", string_from_stderr(&output.stderr));
Ok(output.stdout)
} else {
Err(BackendError::CommandFailed(string_from_stderr(&output.stderr)))
Expand Down
3 changes: 2 additions & 1 deletion tooling/backend_interface/src/cli/verify.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::path::{Path, PathBuf};

use crate::BackendError;
use crate::cli::string_from_stderr;

/// VerifyCommand will call the barretenberg binary
/// to verify a proof
Expand All @@ -24,7 +25,7 @@ impl VerifyCommand {
.arg(self.vk_path);

let output = command.output()?;
println!("{:?}", output);
println!("{:?}", string_from_stderr(&output.stderr));

// We currently do not distinguish between an invalid proof and an error inside the backend.
Ok(output.status.success())
Expand Down
2 changes: 1 addition & 1 deletion tooling/backend_interface/src/cli/write_vk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl WriteVkCommand {
.arg(self.vk_path_output);

let output = command.output()?;
println!("{:?}", output);
println!("{:?}", string_from_stderr(&output.stderr));
if output.status.success() {
Ok(())
} else {
Expand Down
13 changes: 8 additions & 5 deletions tooling/backend_interface/src/proof_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@ impl Backend {
ProveCommand { crs_path: self.crs_directory(), bytecode_path, witness_path }
.run(binary_path)?;

let proof = bb_abstraction_leaks::remove_public_inputs(
// This is coupled with Barretenberg
/*let proof = bb_abstraction_leaks::remove_public_inputs(
// TODO(https://github.com/noir-lang/noir/issues/4428)
program.functions[0].public_inputs().0.len(),
&proof_with_public_inputs,
);
Ok(proof)
Ok(proof)*/
Ok(proof_with_public_inputs)
}

#[tracing::instrument(level = "trace", skip_all)]
Expand All @@ -84,8 +86,10 @@ impl Backend {
let temp_directory = temp_directory.path().to_path_buf();

// Create a temporary file for the proof
let proof_with_public_inputs =
bb_abstraction_leaks::prepend_public_inputs(proof.to_vec(), public_inputs);
// This is coupled with Barretenberg
/*let proof_with_public_inputs =
bb_abstraction_leaks::prepend_public_inputs(proof.to_vec(), public_inputs);*/
let proof_with_public_inputs = proof.to_vec();
let proof_path = temp_directory.join("proof").with_extension("proof");
write_to_file(&proof_with_public_inputs, &proof_path);

Expand All @@ -97,7 +101,6 @@ impl Backend {
// Create the verification key and write it to the specified path
let vk_path = temp_directory.join("vk");

println!("Estamos en la verificacion");

WriteVkCommand {
crs_path: self.crs_directory(),
Expand Down

0 comments on commit 9d423f6

Please sign in to comment.