Original HUSH source code based on ZEC 1.0.8 . For historical purposes only!
https://hush.is
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
500 B
23 lines
500 B
#include "Address.hpp"
|
|
#include "NoteEncryption.hpp"
|
|
#include "prf.h"
|
|
|
|
namespace libzcash {
|
|
|
|
uint256 ViewingKey::pk_enc() {
|
|
return ZCNoteEncryption::generate_pubkey(*this);
|
|
}
|
|
|
|
ViewingKey SpendingKey::viewing_key() const {
|
|
return ViewingKey(ZCNoteEncryption::generate_privkey(*this));
|
|
}
|
|
|
|
SpendingKey SpendingKey::random() {
|
|
return SpendingKey(random_uint252());
|
|
}
|
|
|
|
PaymentAddress SpendingKey::address() const {
|
|
return PaymentAddress(PRF_addr_a_pk(*this), viewing_key().pk_enc());
|
|
}
|
|
|
|
}
|
|
|