pub fn try_sapling_compact_note_decryption<P: consensus::Parameters>(
    params: &P,
    height: BlockHeight,
    ivk: &SaplingIvk,
    epk: &jubjub::ExtendedPoint,
    cmu: &bls12_381::Scalar,
    enc_ciphertext: &[u8],
) -> Option<(Note, PaymentAddress)> {
    assert_eq!(enc_ciphertext.len(), COMPACT_NOTE_SIZE);

    let shared_secret = sapling_ka_agree(&ivk.0, epk);
    let key = kdf_sapling(shared_secret, &epk);

    // Start from block 1 to skip over Poly1305 keying output
    let mut plaintext = [0; COMPACT_NOTE_SIZE];
    plaintext.copy_from_slice(&enc_ciphertext);
    ChaCha20Ietf::xor(key.as_bytes(), &[0u8; 12], 1, &mut plaintext);

    parse_note_plaintext_without_memo(params, height, ivk, epk, cmu, &plaintext)
}
/// Trial decryption of the compact note plaintext by the recipient for light clients.
///
/// Attempts to decrypt and validate the first 52 bytes of `enc_ciphertext` using the
/// given `ivk`. If successful, the corresponding Sapling note is returned, along with the
/// `PaymentAddress` to which the note was sent.
///
/// Implements the procedure specified in [`ZIP 307`].
///
/// [`ZIP 307`]: https://zips.z.cash/zip-0307
Trial decryption of the compact note plaintext by the recipient for light clients.
Attempts to decrypt and validate the first 52 bytes of `enc_ciphertext` using the
given `ivk`. If successful, the corresponding Sapling note is returned, along with the
`PaymentAddress` to which the note was sent.

Implements the procedure specified in [`ZIP 307`].


Trial decryption of the compact note plaintext by the recipient for light clients . Attempts to decrypt and validate the first 52 bytes of ` enc_ciphertext ` using the given ` ivk ` . If successful the corresponding Sapling note is returned along with the ` PaymentAddress ` to which the note was sent . Implements the procedure specified in [ ` ZIP 307 ` ] .
pub fn try_sapling_compact_note_decryption<P: consensus::Parameters>(
    params: &P,
    height: BlockHeight,
    ivk: &SaplingIvk,
    epk: &jubjub::ExtendedPoint,
    cmu: &bls12_381::Scalar,
    enc_ciphertext: &[u8],
) -> Option<(Note, PaymentAddress)> {
    assert_eq!(enc_ciphertext.len(), COMPACT_NOTE_SIZE);
    let shared_secret = sapling_ka_agree(&ivk.0, epk);
    let key = kdf_sapling(shared_secret, &epk);
    // Start from block 1 to skip over Poly1305 keying output
    let mut plaintext = [0; COMPACT_NOTE_SIZE];
    plaintext.copy_from_slice(&enc_ciphertext);
    ChaCha20Ietf::xor(key.as_bytes(), &[0u8; 12], 1, &mut plaintext);
    parse_note_plaintext_without_memo(params, height, ivk, epk, cmu, &plaintext)
}
pub fn try_sapling_compact_note_decryption < P : consensus :: Parameters > ( params : & P , height : BlockHeight , ivk : & SaplingIvk , epk : & jubjub :: ExtendedPoint , cmu : & bls12_381 :: Scalar , enc_ciphertext : & [ u8 ] , ) -> Option < ( Note , PaymentAddress ) > { assert_eq ! ( enc_ciphertext len ( ) COMPACT_NOTE_SIZE ) ; let shared_secret = sapling_ka_agree ( & ivk . 0 , epk ) ; let key = kdf_sapling ( shared_secret , & epk ) ; // Start from block 1 to skip over Poly1305 keying output let mut plaintext = [ 0 ; COMPACT_NOTE_SIZE ] ; plaintext . copy_from_slice ( & enc_ciphertext ) ; ChaCha20Ietf :: xor ( key . as_bytes ( ) , & [ 0u8 ; 12 ] , 1 , & mut plaintext ) ; parse_note_plaintext_without_memo ( params , height , ivk , epk , cmu , & plaintext ) }
Trial decryption of the compact note plaintext by the recipient for light clients.
Trial decryption of the compact note plaintext by the recipient for light clients .
params
&P
height
BlockHeight
ivk
&SaplingIvk
epk
&jubjub::ExtendedPoint
cmu
&bls12_381::Scalar
enc_ciphertext
&[u8]
params
&P
height
BlockHeight
ivk
&SaplingIvk
epk
&jubjub::ExtendedPoint
cmu
&bls12_381::Scalar
enc_ciphertext
&[u8]