mirror of https://github.com/zcash/orchard.git
Merge pull request #223 from dconnolly/patch-1
Add `orchard::circuit::Instance::from_parts()`
This commit is contained in:
commit
d43ad00b8d
|
@ -805,7 +805,7 @@ impl ProvingKey {
|
|||
}
|
||||
|
||||
/// Public inputs to the Orchard Action circuit.
|
||||
#[derive(Debug)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Instance {
|
||||
pub(crate) anchor: Anchor,
|
||||
pub(crate) cv_net: ValueCommitment,
|
||||
|
@ -817,6 +817,33 @@ pub struct Instance {
|
|||
}
|
||||
|
||||
impl Instance {
|
||||
/// Constructs an [`Instance`] from its constituent parts.
|
||||
///
|
||||
/// This API can be used in combination with [`Proof::verify`] to build verification
|
||||
/// pipelines for many proofs, where you don't want to pass around the full bundle.
|
||||
/// Use [`Bundle::verify_proof`] instead if you have the full bundle.
|
||||
///
|
||||
/// [`Bundle::verify_proof`]: crate::Bundle::verify_proof
|
||||
pub fn from_parts(
|
||||
anchor: Anchor,
|
||||
cv_net: ValueCommitment,
|
||||
nf_old: Nullifier,
|
||||
rk: VerificationKey<SpendAuth>,
|
||||
cmx: ExtractedNoteCommitment,
|
||||
enable_spend: bool,
|
||||
enable_output: bool,
|
||||
) -> Self {
|
||||
Instance {
|
||||
anchor,
|
||||
cv_net,
|
||||
nf_old,
|
||||
rk,
|
||||
cmx,
|
||||
enable_spend,
|
||||
enable_output,
|
||||
}
|
||||
}
|
||||
|
||||
fn to_halo2_instance(&self) -> [[vesta::Scalar; 9]; 1] {
|
||||
let mut instance = [vesta::Scalar::zero(); 9];
|
||||
|
||||
|
|
Loading…
Reference in New Issue