73 const std::array<unsigned char, ZC_MEMO_SIZE>& memo) :
BaseNotePlaintext(note, memo)
110 assert(ss.
size() == 0);
134 assert(ss.
size() == 0);
153 if (cmu_expected != cmu) {
192 if (cmu_expected != cmu) {
196 assert(ss.
size() == 0);
208 auto enc = sne.get();
214 assert(pt.size() == ss.
size());
218 auto encciphertext = enc.encrypt_to_recipient(pk_d, pt);
219 if (!encciphertext) {
237 assert(pt.size() == ss.
size());
Notes are main primitive of Sapling, similar to a a tree of commitments.
Optional< SaplingPaymentAddress > address(diversifier_t d) const
This is not a thread-safe API.
SaplingOutCiphertext encrypt_to_ourselves(const uint256 &ovk, const uint256 &cv, const uint256 &cm, const SaplingOutPlaintext &message)
static Optional< SaplingNoteEncryption > FromDiversifier(diversifier_t d)
Optional< uint256 > cmu() const
Optional< uint256 > nullifier(const SaplingFullViewingKey &vk, const uint64_t position) const
Optional< SaplingNote > note(const SaplingIncomingViewingKey &ivk) const
Optional< SaplingNotePlaintextEncryptionResult > encrypt(const uint256 &pk_d) const
static Optional< SaplingNotePlaintext > decrypt(const SaplingEncCiphertext &ciphertext, const uint256 &ivk, const uint256 &epk, const uint256 &cmu)
SaplingOutCiphertext encrypt(const uint256 &ovk, const uint256 &cv, const uint256 &cm, SaplingNoteEncryption &enc) const
static Optional< SaplingOutgoingPlaintext > decrypt(const SaplingOutCiphertext &ciphertext, const uint256 &ovk, const uint256 &cv, const uint256 &cm, const uint256 &epk)
void * memcpy(void *a, const void *b, size_t c)
bool librustzcash_sapling_compute_cm(const unsigned char *diversifier, const unsigned char *pk_d, const uint64_t value, const unsigned char *r, unsigned char *result)
Compute a Sapling commitment.
void librustzcash_sapling_generate_r(unsigned char *result)
Generate uniformly random scalar in Jubjub.
bool librustzcash_sapling_compute_nf(const unsigned char *diversifier, const unsigned char *pk_d, const uint64_t value, const unsigned char *r, const unsigned char *ak, const unsigned char *nk, const uint64_t position, unsigned char *result)
Compute a Sapling nullifier.
bool librustzcash_ivk_to_pkd(const unsigned char *ivk, const unsigned char *diversifier, unsigned char *result)
std::array< unsigned char, ZC_SAPLING_ENCPLAINTEXT_SIZE > SaplingEncPlaintext
Optional< SaplingEncPlaintext > AttemptSaplingEncDecryption(const SaplingEncCiphertext &ciphertext, const uint256 &ivk, const uint256 &epk)
std::array< unsigned char, ZC_SAPLING_OUTPLAINTEXT_SIZE > SaplingOutPlaintext
std::array< unsigned char, ZC_SAPLING_ENCCIPHERTEXT_SIZE > SaplingEncCiphertext
std::pair< SaplingEncCiphertext, SaplingNoteEncryption > SaplingNotePlaintextEncryptionResult
Optional< SaplingOutPlaintext > AttemptSaplingOutDecryption(const SaplingOutCiphertext &ciphertext, const uint256 &ovk, const uint256 &cv, const uint256 &cm, const uint256 &epk)
std::array< unsigned char, ZC_SAPLING_OUTCIPHERTEXT_SIZE > SaplingOutCiphertext
boost::optional< T > Optional
Substitute for C++17 std::optional.