ViewingKey -> ReceivingKey per zcash/zips#117

This commit is contained in:
Jack Grigg
2017-02-23 18:27:41 +00:00
parent 89aaa67e9e
commit 642a1caf93
15 changed files with 44 additions and 44 deletions

View File

@@ -12,12 +12,12 @@ uint256 PaymentAddress::GetHash() const {
return Hash(ss.begin(), ss.end());
}
uint256 ViewingKey::pk_enc() {
uint256 ReceivingKey::pk_enc() {
return ZCNoteEncryption::generate_pubkey(*this);
}
ViewingKey SpendingKey::viewing_key() const {
return ViewingKey(ZCNoteEncryption::generate_privkey(*this));
ReceivingKey SpendingKey::receiving_key() const {
return ReceivingKey(ZCNoteEncryption::generate_privkey(*this));
}
SpendingKey SpendingKey::random() {
@@ -25,7 +25,7 @@ SpendingKey SpendingKey::random() {
}
PaymentAddress SpendingKey::address() const {
return PaymentAddress(PRF_addr_a_pk(*this), viewing_key().pk_enc());
return PaymentAddress(PRF_addr_a_pk(*this), receiving_key().pk_enc());
}
}

View File

@@ -38,9 +38,9 @@ public:
}
};
class ViewingKey : public uint256 {
class ReceivingKey : public uint256 {
public:
ViewingKey(uint256 sk_enc) : uint256(sk_enc) { }
ReceivingKey(uint256 sk_enc) : uint256(sk_enc) { }
uint256 pk_enc();
};
@@ -52,7 +52,7 @@ public:
static SpendingKey random();
ViewingKey viewing_key() const;
ReceivingKey receiving_key() const;
PaymentAddress address() const;
};