6 #ifndef PIVX_SAPLING_NOTE_H
7 #define PIVX_SAPLING_NOTE_H
56 std::array<unsigned char, ZC_MEMO_SIZE>
memo_ = {{0}};
66 inline const std::array<unsigned char, ZC_MEMO_SIZE> &
memo()
const {
return memo_; }
99 unsigned char leadingByte = 0x01;
102 if (leadingByte != 0x01) {
103 throw std::ios_base::failure(
"lead byte of SaplingNotePlaintext is not recognized");
Notes are main primitive of Sapling, similar to a a tree of commitments.
const std::array< unsigned char, ZC_MEMO_SIZE > & memo() const
BaseNotePlaintext(const BaseNote ¬e, const std::array< unsigned char, ZC_MEMO_SIZE > &memo)
virtual ~BaseNotePlaintext()
std::array< unsigned char, ZC_MEMO_SIZE > memo_
This is not a thread-safe API.
Optional< uint256 > cmu() const
SaplingNote(const diversifier_t &_d, const uint256 &_pk_d, uint64_t value, const uint256 &_r)
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
SERIALIZE_METHODS(SaplingNotePlaintext, obj)
virtual ~SaplingNotePlaintext()
static Optional< SaplingNotePlaintext > decrypt(const SaplingEncCiphertext &ciphertext, const uint256 &ivk, const uint256 &epk, const uint256 &cmu)
SaplingOutgoingPlaintext()
SaplingOutgoingPlaintext(const uint256 &_pk_d, const uint256 &_esk)
SaplingOutCiphertext encrypt(const uint256 &ovk, const uint256 &cv, const uint256 &cm, SaplingNoteEncryption &enc) const
SERIALIZE_METHODS(SaplingOutgoingPlaintext, obj)
static Optional< SaplingOutgoingPlaintext > decrypt(const SaplingOutCiphertext &ciphertext, const uint256 &ovk, const uint256 &cv, const uint256 &cm, const uint256 &epk)
std::array< unsigned char, ZC_SAPLING_ENCCIPHERTEXT_SIZE > SaplingEncCiphertext
std::pair< SaplingEncCiphertext, SaplingNoteEncryption > SaplingNotePlaintextEncryptionResult
std::array< unsigned char, ZC_SAPLING_OUTCIPHERTEXT_SIZE > SaplingOutCiphertext
boost::optional< T > Optional
Substitute for C++17 std::optional.
std::array< unsigned char, ZC_DIVERSIFIER_SIZE > diversifier_t
const uint256 UINT256_ZERO
constant uint256 instances