Add NoteCommitment.extract_u()
This commit is contained in:
parent
33730a05cb
commit
dfb10ab10f
|
@ -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.
|
/// The decrypted form of encrypted Sapling notes on the blockchain.
|
||||||
pub struct NotePlaintext {
|
pub struct NotePlaintext {
|
||||||
diversifier: Diversifier,
|
diversifier: Diversifier,
|
||||||
|
|
|
@ -106,7 +106,7 @@ impl Arbitrary for Output {
|
||||||
.prop_map(
|
.prop_map(
|
||||||
|(cv, cm, ephemeral_key_bytes, enc_ciphertext, out_ciphertext, zkproof)| Self {
|
|(cv, cm, ephemeral_key_bytes, enc_ciphertext, out_ciphertext, zkproof)| Self {
|
||||||
cv,
|
cv,
|
||||||
cm_u: cm.0.get_u(),
|
cm_u: cm.extract_u(),
|
||||||
ephemeral_key: jubjub::AffinePoint::from_bytes(ephemeral_key_bytes).unwrap(),
|
ephemeral_key: jubjub::AffinePoint::from_bytes(ephemeral_key_bytes).unwrap(),
|
||||||
enc_ciphertext,
|
enc_ciphertext,
|
||||||
out_ciphertext,
|
out_ciphertext,
|
||||||
|
|
Loading…
Reference in New Issue