Rename AttemptSaplingEncDecryptionUsingFullViewingKey and use function overloading.
This commit is contained in:
@@ -113,7 +113,7 @@ TEST(noteencryption, NotePlaintext)
|
|||||||
ASSERT_TRUE(decrypted_out_ct_unwrapped.esk == out_pt.esk);
|
ASSERT_TRUE(decrypted_out_ct_unwrapped.esk == out_pt.esk);
|
||||||
|
|
||||||
// Test sender can decrypt the note ciphertext.
|
// Test sender can decrypt the note ciphertext.
|
||||||
foo = SaplingNotePlaintext::decryptUsingFullViewingKey(
|
foo = SaplingNotePlaintext::decrypt(
|
||||||
ct,
|
ct,
|
||||||
epk,
|
epk,
|
||||||
decrypted_out_ct_unwrapped.esk,
|
decrypted_out_ct_unwrapped.esk,
|
||||||
|
|||||||
@@ -208,14 +208,14 @@ boost::optional<SaplingNotePlaintext> SaplingNotePlaintext::decrypt(
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::optional<SaplingNotePlaintext> SaplingNotePlaintext::decryptUsingFullViewingKey(
|
boost::optional<SaplingNotePlaintext> SaplingNotePlaintext::decrypt(
|
||||||
const SaplingEncCiphertext &ciphertext,
|
const SaplingEncCiphertext &ciphertext,
|
||||||
const uint256 &epk,
|
const uint256 &epk,
|
||||||
const uint256 &esk,
|
const uint256 &esk,
|
||||||
const uint256 &pk_d
|
const uint256 &pk_d
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
auto pt = AttemptSaplingEncDecryptionUsingFullViewingKey(ciphertext, epk, esk, pk_d);
|
auto pt = AttemptSaplingEncDecryption(ciphertext, epk, esk, pk_d);
|
||||||
if (!pt) {
|
if (!pt) {
|
||||||
return boost::none;
|
return boost::none;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ public:
|
|||||||
const uint256 &epk
|
const uint256 &epk
|
||||||
);
|
);
|
||||||
|
|
||||||
static boost::optional<SaplingNotePlaintext> decryptUsingFullViewingKey(
|
static boost::optional<SaplingNotePlaintext> decrypt(
|
||||||
const SaplingEncCiphertext &ciphertext,
|
const SaplingEncCiphertext &ciphertext,
|
||||||
const uint256 &epk,
|
const uint256 &epk,
|
||||||
const uint256 &esk,
|
const uint256 &esk,
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ boost::optional<SaplingEncPlaintext> AttemptSaplingEncDecryption(
|
|||||||
return plaintext;
|
return plaintext;
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::optional<SaplingEncPlaintext> AttemptSaplingEncDecryptionUsingFullViewingKey (
|
boost::optional<SaplingEncPlaintext> AttemptSaplingEncDecryption (
|
||||||
const SaplingEncCiphertext &ciphertext,
|
const SaplingEncCiphertext &ciphertext,
|
||||||
const uint256 &epk,
|
const uint256 &epk,
|
||||||
const uint256 &esk,
|
const uint256 &esk,
|
||||||
|
|||||||
@@ -73,9 +73,9 @@ boost::optional<SaplingEncPlaintext> AttemptSaplingEncDecryption(
|
|||||||
const uint256 &epk
|
const uint256 &epk
|
||||||
);
|
);
|
||||||
|
|
||||||
// Attempts to decrypt a Sapling note using full viewing key.
|
// Attempts to decrypt a Sapling note using outgoing plaintext.
|
||||||
// This will not check that the contents of the ciphertext are correct.
|
// This will not check that the contents of the ciphertext are correct.
|
||||||
boost::optional<SaplingEncPlaintext> AttemptSaplingEncDecryptionUsingFullViewingKey (
|
boost::optional<SaplingEncPlaintext> AttemptSaplingEncDecryption (
|
||||||
const SaplingEncCiphertext &ciphertext,
|
const SaplingEncCiphertext &ciphertext,
|
||||||
const uint256 &epk,
|
const uint256 &epk,
|
||||||
const uint256 &esk,
|
const uint256 &esk,
|
||||||
|
|||||||
Reference in New Issue
Block a user