Skip to content

Commit

Permalink
Merge pull request #143 from zcash/generalise-spend-desc-conversion
Browse files Browse the repository at this point in the history
Broaden `Authorization`s from `SpendDescriptionV5::into_spend_description`
  • Loading branch information
str4d authored Oct 24, 2024
2 parents 0351517 + 6527e79 commit 44c4b17
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ and this library adheres to Rust's notion of
`sapling_crypto::keys::EphemeralSecretKey`, matching the existing public APIs
that expose it.

### Changed
- `sapling_crypto::bundle::SpendDescriptionV5::into_spend_description` now
supports any `Authorization` for which the `SpendDescription` itself is fully
authorized.

## [0.3.0] - 2024-10-02

### Changed
Expand Down
7 changes: 5 additions & 2 deletions src/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,15 @@ impl SpendDescriptionV5 {
Self { cv, nullifier, rk }
}

pub fn into_spend_description(
pub fn into_spend_description<A>(
self,
anchor: bls12_381::Scalar,
zkproof: GrothProofBytes,
spend_auth_sig: redjubjub::Signature<SpendAuth>,
) -> SpendDescription<Authorized> {
) -> SpendDescription<A>
where
A: Authorization<SpendProof = GrothProofBytes, AuthSig = redjubjub::Signature<SpendAuth>>,
{
SpendDescription {
cv: self.cv,
anchor,
Expand Down

0 comments on commit 44c4b17

Please sign in to comment.