Skip to content

Commit

Permalink
Removed the BuildParams::proof_generation_key function because its su…
Browse files Browse the repository at this point in the history
…perceded by the ExtendedKey trait. Removed BuildParams::auth_sig because signatures can be modified after the build using the MapAuth trait.
  • Loading branch information
murisi committed Sep 24, 2024
1 parent 87c2419 commit dacba7f
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions masp_primitives/src/transaction/components/sapling/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ pub struct SpendBuildParams {
pub rcv: jubjub::Fr,
/// The spend authorization randomizer
pub alpha: jubjub::Fr,
/// The authorization signature
pub auth_sig: Option<Signature>,
/// The proof generation key
pub proof_generation_key: Option<ProofGenerationKey>,
}

impl BorshSerialize for SpendBuildParams {
Expand All @@ -103,10 +99,6 @@ impl BorshSerialize for SpendBuildParams {
writer.write_all(&self.rcv.to_repr())?;
// Write spend authorization randomizer
writer.write_all(&self.alpha.to_repr())?;
// Write the authorization signature
self.auth_sig.serialize(writer)?;
// Write the proof generation key
self.proof_generation_key.serialize(writer)?;
Ok(())
}
}
Expand All @@ -123,16 +115,10 @@ impl BorshDeserialize for SpendBuildParams {
let alpha = Option::from(jubjub::Fr::from_bytes(&alpha_bytes)).ok_or_else(|| {
std::io::Error::new(std::io::ErrorKind::InvalidData, "alpha not in field")
})?;
// Read the authorization signature
let auth_sig = Option::<Signature>::deserialize_reader(reader)?;
// Read the proof generation key
let proof_generation_key = Option::<ProofGenerationKey>::deserialize_reader(reader)?;
// Finally, aggregate the spend parameters
Ok(SpendBuildParams {
rcv,
alpha,
auth_sig,
proof_generation_key,
})
}
}
Expand Down Expand Up @@ -347,8 +333,6 @@ impl<R: CryptoRng + RngCore> RngBuildParams<R> {
self.spends.entry(i).or_insert_with(|| SpendBuildParams {
rcv: jubjub::Fr::random(&mut self.rng),
alpha: jubjub::Fr::random(&mut self.rng),
auth_sig: None,
proof_generation_key: None,
})
}

Expand Down

0 comments on commit dacba7f

Please sign in to comment.