mirror of https://github.com/zcash/orchard.git
Add `orchard::circuit::Instance::from_parts()`
This commit is contained in:
parent
4f9c0be42e
commit
e51e92e848
|
@ -817,6 +817,27 @@ pub struct Instance {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Instance {
|
impl Instance {
|
||||||
|
/// Constructs an [`Instance`] from its constituent parts
|
||||||
|
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] {
|
fn to_halo2_instance(&self) -> [[vesta::Scalar; 9]; 1] {
|
||||||
let mut instance = [vesta::Scalar::zero(); 9];
|
let mut instance = [vesta::Scalar::zero(); 9];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue