Skip to content

fix(confidential): restore bounded MPT decryption - #345

Open
kpitapeersyst wants to merge 8 commits into
confidential-transfersfrom
fix/bounded-decryption-cgo
Open

fix(confidential): restore bounded MPT decryption#345
kpitapeersyst wants to merge 8 commits into
confidential-transfersfrom
fix/bounded-decryption-cgo

Conversation

@kpitapeersyst

Copy link
Copy Markdown
Collaborator

fix(confidential): restore bounded MPT decryption

Description

This PR restores the bounded decryption contract required by the current vendored mpt-crypto library. It validates inclusive amount ranges and propagates them through the low-level CGo bindings, ElGamal helpers, and high-level confidential transaction builders.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactoring

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code where needed
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective
  • New and existing unit tests pass locally with my changes

Changes

  • Add inclusive amount-range validation to ElGamal decryption.
  • Update the CGo and !cgo DecryptAmount contracts to accept lower and upper bounds.
  • Propagate decryption ranges through the send and convert-back builders.
  • Add coverage for valid, invalid, and out-of-range decryption attempts.
  • Document bounded decryption behavior and its linear search cost.

Tests

  • CGO_ENABLED=1 CC=gcc go test ./confidential/...
  • CGO_ENABLED=0 go test ./confidential/...

Notes

  • This PR targets the temporary confidential-transfers integration branch.
  • The exported decryption APIs now require explicit amount bounds.
  • Changelog updates are intentionally deferred until the integration branch stabilizes.

@kpitapeersyst
kpitapeersyst force-pushed the fix/bounded-decryption-cgo branch from dde8671 to 2620ec2 Compare July 28, 2026 13:32
@kpitapeersyst
kpitapeersyst force-pushed the fix/bounded-decryption-cgo branch from 27f662f to 528753b Compare July 28, 2026 15:29
@kpitapeersyst
kpitapeersyst marked this pull request as ready for review July 28, 2026 16:00
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.

1 participant