Skip to content

Commit

Permalink
Expose the last outputs and number of steps from RecursiveSNARK (#285)
Browse files Browse the repository at this point in the history
Both of these data are easily accessible, and could be very useful
to clients:
* Exposing the last outputs allows us to get the current state of
  the computation on the prover side without wasting energy
  recomputing it
* Exposing the number of steps makes it easier to eventually pass
  `num_steps` into `CompressedSNARK::verify`
  • Loading branch information
jbearer authored Jan 2, 2024
1 parent 0fb0b49 commit 5e584da
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,16 @@ where

Ok((self.zi_primary.clone(), self.zi_secondary.clone()))
}

/// Get the outputs after the last step of computation.
pub fn outputs(&self) -> (&[E1::Scalar], &[E2::Scalar]) {
(&self.zi_primary, &self.zi_secondary)
}

/// The number of steps which have been executed thus far.
pub fn num_steps(&self) -> usize {
self.i
}
}

/// A type that holds the prover key for `CompressedSNARK`
Expand Down

0 comments on commit 5e584da

Please sign in to comment.