Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
feat: allow updating an empty CRS buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed May 19, 2023
1 parent d613c79 commit 82615c6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/acvm_interop/common_reference_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ impl CommonReferenceString for Barretenberg {
common_reference_string: Vec<u8>,
circuit: &Circuit,
) -> Result<Vec<u8>, Self::Error> {
// Treat an empty vector as a request for a fresh CRS.
if common_reference_string.is_empty() {
return self.generate_common_reference_string(circuit).await;
}

// Otherwise parse CRS and update.
let mut crs = common_reference_string.try_into()?;
let constraint_system = &circuit.try_into()?;
let common_reference_string = self
Expand Down

0 comments on commit 82615c6

Please sign in to comment.