Trait sapling_crypto::prover::SpendProver
source · pub trait SpendProver {
type Proof;
// Required methods
fn prepare_circuit(
proof_generation_key: ProofGenerationKey,
diversifier: Diversifier,
rseed: Rseed,
value: NoteValue,
alpha: Fr,
rcv: ValueCommitTrapdoor,
anchor: Scalar,
merkle_path: MerklePath
) -> Option<Spend>;
fn create_proof<R: RngCore>(
&self,
circuit: Spend,
rng: &mut R
) -> Self::Proof;
fn encode_proof(proof: Self::Proof) -> GrothProofBytes;
}
Expand description
Interface for creating Sapling Spend proofs.
Required Associated Types§
Required Methods§
sourcefn prepare_circuit(
proof_generation_key: ProofGenerationKey,
diversifier: Diversifier,
rseed: Rseed,
value: NoteValue,
alpha: Fr,
rcv: ValueCommitTrapdoor,
anchor: Scalar,
merkle_path: MerklePath
) -> Option<Spend>
fn prepare_circuit( proof_generation_key: ProofGenerationKey, diversifier: Diversifier, rseed: Rseed, value: NoteValue, alpha: Fr, rcv: ValueCommitTrapdoor, anchor: Scalar, merkle_path: MerklePath ) -> Option<Spend>
Prepares an instance of the Sapling Spend circuit for the given inputs.
Returns None
if diversifier
is not a valid Sapling diversifier.
sourcefn create_proof<R: RngCore>(&self, circuit: Spend, rng: &mut R) -> Self::Proof
fn create_proof<R: RngCore>(&self, circuit: Spend, rng: &mut R) -> Self::Proof
Create the proof for a Sapling SpendDescription
.
sourcefn encode_proof(proof: Self::Proof) -> GrothProofBytes
fn encode_proof(proof: Self::Proof) -> GrothProofBytes
Encodes the given Sapling SpendDescription
proof, erasing its type.
Object Safety§
This trait is not object safe.
Implementors§
source§impl SpendProver for SpendParameters
impl SpendProver for SpendParameters
source§impl SpendProver for MockSpendProver
Available on crate feature test-dependencies
only.
impl SpendProver for MockSpendProver
Available on crate feature
test-dependencies
only.