Alter SaplingNote::nullifier() to take a SaplingFullViewingKey
This means the API will work if you only have a SaplingExtendedSpendingKey, as will be the case with ZIP 32.
This commit is contained in:
@@ -49,7 +49,7 @@ TEST(SaplingNote, TestVectors)
|
|||||||
|
|
||||||
// Test nullifier
|
// Test nullifier
|
||||||
SaplingSpendingKey spendingKey(sk);
|
SaplingSpendingKey spendingKey(sk);
|
||||||
ASSERT_EQ(note.nullifier(spendingKey, note_pos), nf);
|
ASSERT_EQ(note.nullifier(spendingKey.full_viewing_key(), note_pos), nf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -65,9 +65,8 @@ boost::optional<uint256> SaplingNote::cm() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Call librustzcash to compute the nullifier
|
// Call librustzcash to compute the nullifier
|
||||||
boost::optional<uint256> SaplingNote::nullifier(const SaplingSpendingKey& sk, const uint64_t position) const
|
boost::optional<uint256> SaplingNote::nullifier(const SaplingFullViewingKey& vk, const uint64_t position) const
|
||||||
{
|
{
|
||||||
auto vk = sk.full_viewing_key();
|
|
||||||
auto ak = vk.ak;
|
auto ak = vk.ak;
|
||||||
auto nk = vk.nk;
|
auto nk = vk.nk;
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public:
|
|||||||
virtual ~SaplingNote() {};
|
virtual ~SaplingNote() {};
|
||||||
|
|
||||||
boost::optional<uint256> cm() const;
|
boost::optional<uint256> cm() const;
|
||||||
boost::optional<uint256> nullifier(const SaplingSpendingKey &sk, const uint64_t position) const;
|
boost::optional<uint256> nullifier(const SaplingFullViewingKey &vk, const uint64_t position) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class BaseNotePlaintext {
|
class BaseNotePlaintext {
|
||||||
|
|||||||
Reference in New Issue
Block a user