Add NoteCommitment.extract_u()

This commit is contained in:
Deirdre Connolly 2020-07-14 05:04:45 -04:00 committed by Deirdre Connolly
parent 33730a05cb
commit dfb10ab10f
2 changed files with 10 additions and 1 deletions

View File

@ -109,6 +109,15 @@ impl ZcashDeserialize for NoteCommitment {
}
}
impl NoteCommitment {
/// Hash Extractor for Jubjub (?)
///
/// https://zips.z.cash/protocol/protocol.pdf#concreteextractorjubjub
pub fn extract_u(self) -> jubjub::Fq {
self.0.get_u()
}
}
/// The decrypted form of encrypted Sapling notes on the blockchain.
pub struct NotePlaintext {
diversifier: Diversifier,

View File

@ -106,7 +106,7 @@ impl Arbitrary for Output {
.prop_map(
|(cv, cm, ephemeral_key_bytes, enc_ciphertext, out_ciphertext, zkproof)| Self {
cv,
cm_u: cm.0.get_u(),
cm_u: cm.extract_u(),
ephemeral_key: jubjub::AffinePoint::from_bytes(ephemeral_key_bytes).unwrap(),
enc_ciphertext,
out_ciphertext,