mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-03 08:46:46 +00:00
Add ZKP and ciphertext malleability tests (#6999)
This commit is contained in:
@@ -94,6 +94,7 @@ ConfidentialMPTClawback::preclaim(PreclaimContext const& ctx)
|
||||
return tecNO_PERMISSION; // LCOV_EXCL_LINE
|
||||
|
||||
// Sanity check: claw amount can not exceed confidential outstanding amount
|
||||
// or total outstanding amount (prevents underflow in doApply)
|
||||
auto const amount = ctx.tx[sfMPTAmount];
|
||||
if (amount > (*sleIssuance)[~sfConfidentialOutstandingAmount].value_or(0) ||
|
||||
amount > (*sleIssuance)[sfOutstandingAmount])
|
||||
|
||||
@@ -248,6 +248,9 @@ ConfidentialMPTConvert::doApply()
|
||||
// homomorphically add auditor's encrypted balance
|
||||
if (auditorEc)
|
||||
{
|
||||
if (!sleMptoken->isFieldPresent(sfAuditorEncryptedBalance))
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
auto sum = homomorphicAdd(*auditorEc, (*sleMptoken)[sfAuditorEncryptedBalance]);
|
||||
if (!sum)
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
@@ -258,7 +261,8 @@ ConfidentialMPTConvert::doApply()
|
||||
else if (
|
||||
!sleMptoken->isFieldPresent(sfIssuerEncryptedBalance) &&
|
||||
!sleMptoken->isFieldPresent(sfConfidentialBalanceInbox) &&
|
||||
!sleMptoken->isFieldPresent(sfConfidentialBalanceSpending))
|
||||
!sleMptoken->isFieldPresent(sfConfidentialBalanceSpending) &&
|
||||
!sleMptoken->isFieldPresent(sfAuditorEncryptedBalance))
|
||||
{
|
||||
// Case 2: First-time convert - initialize all confidential fields
|
||||
(*sleMptoken)[sfConfidentialBalanceInbox] = holderEc;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user