Skip to content

Commit

Permalink
Add PublicAddress constructor from internal fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
ebfull committed Jan 4, 2016
1 parent 53c30e6 commit 1503312
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libzerocash/Address.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ PublicAddress::PublicAddress(): a_pk(ZC_A_PK_SIZE) {
this->pk_enc = "";
}

PublicAddress::PublicAddress(const std::vector<unsigned char>& a_pk, std::string& pk_enc) : a_pk(a_pk), pk_enc(pk_enc) {}

PublicAddress::PublicAddress(const PrivateAddress& addr_sk): a_pk(ZC_A_PK_SIZE) {
std::vector<bool> a_sk_bool(ZC_A_SK_SIZE * 8);
convertBytesVectorToVector(addr_sk.getAddressSecret(), a_sk_bool);
Expand Down
1 change: 1 addition & 0 deletions libzerocash/Address.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class PublicAddress {
public:
/* This constructor is to be used ONLY for deserialization. */
PublicAddress();
PublicAddress(const std::vector<unsigned char>& a_pk, std::string& pk_enc);
PublicAddress(const PrivateAddress& addr_sk);

bool operator==(const PublicAddress& rhs) const;
Expand Down

1 comment on commit 1503312

@nathan-at-least
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Please sign in to comment.