Skip to content

Re-randomize after each send#7535

Merged
yinyiqian1 merged 3 commits into
XRPLF:ripple/confidential-transferfrom
yinyiqian1:re-randomize
Jun 17, 2026
Merged

Re-randomize after each send#7535
yinyiqian1 merged 3 commits into
XRPLF:ripple/confidential-transferfrom
yinyiqian1:re-randomize

Conversation

@yinyiqian1

@yinyiqian1 yinyiqian1 commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator
  • Add receiver-side ciphertext re-randomization for ConfidentialMPTSend
  1. The destination encrypted amount is re-randomized by adding Enc_dest(0; e)
  2. The issuer-encrypted mirror amount is also re-randomized by adding Enc_issuer(0; e)
  • Added rerandomizeCiphertext in ConfidentialTransfer.cpp to encrypt zero and homomorphically adds it to an existing ciphertext.
  • Added test testSendRerandomizesRecipientInboxAgainstMergeCancellation to test the attack senario described in TOB-RIPCTXR-5.

High Level Overview of Change

Context of Change

API Impact

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

@yinyiqian1 yinyiqian1 changed the base branch from develop to ripple/confidential-transfer June 12, 2026 16:46
@yinyiqian1 yinyiqian1 marked this pull request as ready for review June 12, 2026 21:11
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.3%. Comparing base (9854b3e) to head (b10ba12).
⚠️ Report is 12 commits behind head on ripple/confidential-transfer.

Files with missing lines Patch % Lines
src/libxrpl/protocol/ConfidentialTransfer.cpp 80.0% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                      Coverage Diff                       @@
##           ripple/confidential-transfer   #7535     +/-   ##
==============================================================
+ Coverage                          81.6%   82.3%   +0.7%     
==============================================================
  Files                              1026    1026             
  Lines                             78124   78143     +19     
  Branches                           9309    8941    -368     
==============================================================
+ Hits                              63729   64287    +558     
+ Misses                            14386   13847    -539     
  Partials                              9       9             
Files with missing lines Coverage Δ
include/xrpl/protocol/ConfidentialTransfer.h 100.0% <ø> (+100.0%) ⬆️
...bxrpl/tx/transactors/token/ConfidentialMPTSend.cpp 93.2% <100.0%> (+93.2%) ⬆️
src/libxrpl/protocol/ConfidentialTransfer.cpp 94.0% <80.0%> (+48.2%) ⬆️

... and 18 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

{
auto zero = encryptAmount(0, pubKeySlice, randomness);
if (!zero)
return std::nullopt;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

exclude line cov

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Sorry, I just merged the code. Would you mind adding it in the next PR?

@yinyiqian1 yinyiqian1 merged commit 31a3a0d into XRPLF:ripple/confidential-transfer Jun 17, 2026
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants