Refactoring: rename NotePlaintext --> SproutNotePlaintext

Also renames:
CNotePlaintextEntry --> CSproutNotePlaintextEntry
CUnspentNotePlaintextEntry --> CUnspentSproutNotePlaintextEntry
This commit is contained in:
Simon
2018-04-25 23:08:36 -07:00
parent 9354f8e568
commit 5020a93631
12 changed files with 45 additions and 45 deletions

View File

@@ -246,7 +246,7 @@ public:
ZCNoteEncryption encryptor(h_sig);
for (size_t i = 0; i < NumOutputs; i++) {
NotePlaintext pt(out_notes[i], outputs[i].memo);
SproutNotePlaintext pt(out_notes[i], outputs[i].memo);
out_ciphertexts[i] = pt.encrypt(encryptor, outputs[i].addr.pk_enc);
}

View File

@@ -38,7 +38,7 @@ uint256 SproutNote::nullifier(const SpendingKey& a_sk) const {
return PRF_nf(a_sk, rho);
}
NotePlaintext::NotePlaintext(
SproutNotePlaintext::SproutNotePlaintext(
const SproutNote& note,
boost::array<unsigned char, ZC_MEMO_SIZE> memo) : memo(memo)
{
@@ -47,12 +47,12 @@ NotePlaintext::NotePlaintext(
r = note.r;
}
SproutNote NotePlaintext::note(const PaymentAddress& addr) const
SproutNote SproutNotePlaintext::note(const PaymentAddress& addr) const
{
return SproutNote(addr.a_pk, value, rho, r);
}
NotePlaintext NotePlaintext::decrypt(const ZCNoteDecryption& decryptor,
SproutNotePlaintext SproutNotePlaintext::decrypt(const ZCNoteDecryption& decryptor,
const ZCNoteDecryption::Ciphertext& ciphertext,
const uint256& ephemeralKey,
const uint256& h_sig,
@@ -64,7 +64,7 @@ NotePlaintext NotePlaintext::decrypt(const ZCNoteDecryption& decryptor,
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss << plaintext;
NotePlaintext ret;
SproutNotePlaintext ret;
ss >> ret;
assert(ss.size() == 0);
@@ -72,7 +72,7 @@ NotePlaintext NotePlaintext::decrypt(const ZCNoteDecryption& decryptor,
return ret;
}
ZCNoteEncryption::Ciphertext NotePlaintext::encrypt(ZCNoteEncryption& encryptor,
ZCNoteEncryption::Ciphertext SproutNotePlaintext::encrypt(ZCNoteEncryption& encryptor,
const uint256& pk_enc
) const
{

View File

@@ -38,16 +38,16 @@ public:
uint256 nullifier(const SpendingKey& a_sk) const;
};
class NotePlaintext {
class SproutNotePlaintext {
public:
uint64_t value = 0;
uint256 rho;
uint256 r;
boost::array<unsigned char, ZC_MEMO_SIZE> memo;
NotePlaintext() {}
SproutNotePlaintext() {}
NotePlaintext(const SproutNote& note, boost::array<unsigned char, ZC_MEMO_SIZE> memo);
SproutNotePlaintext(const SproutNote& note, boost::array<unsigned char, ZC_MEMO_SIZE> memo);
SproutNote note(const PaymentAddress& addr) const;
@@ -59,7 +59,7 @@ public:
READWRITE(leadingByte);
if (leadingByte != 0x00) {
throw std::ios_base::failure("lead byte of NotePlaintext is not recognized");
throw std::ios_base::failure("lead byte of SproutNotePlaintext is not recognized");
}
READWRITE(value);
@@ -68,7 +68,7 @@ public:
READWRITE(memo);
}
static NotePlaintext decrypt(const ZCNoteDecryption& decryptor,
static SproutNotePlaintext decrypt(const ZCNoteDecryption& decryptor,
const ZCNoteDecryption::Ciphertext& ciphertext,
const uint256& ephemeralKey,
const uint256& h_sig,