Skip to content

Update call names; update & improve docs on library usage - #336

Merged
PropzSaladaz merged 3 commits into
enhancement/security-hardeningfrom
refactor/threshold-decryption-api-cleanup
Sep 25, 2026
Merged

PropzSaladaz merged 3 commits into
enhancement/security-hardeningfrom
refactor/threshold-decryption-api-cleanup

Conversation

@PropzSaladaz

Copy link
Copy Markdown
Contributor

Description

This PR is mostly about improving call readability & improving documentation on library usage:

  • API Rename (getSharesRaw $\to$ getThresholdSharesRaw):

    • Renamed on TEDecryptSet to accurately reflect that it returns a threshold-bounded subset ($t$ shares) for reconstruction rather than all collected shares.
    • Updated callers in ThresholdEncryption.cpp and tests in test_TE_wrappers.cpp.
  • Docs Improvements (using-threshold-encryption.md):

    • Clarified 1-based participant indexing (1 <= index <= n; 0 is rejected).
    • Updated code examples to use EncryptMetaData for TE and AES AAD.
    • Added decrypt_set.canMerge() check prior to share combination.
    • Recommended validateAndDecrypt(...) to eliminate double-decryption overhead.
    • Added wire serialization (toBytes/fromBytes, toString) and batch/parallel API references.
  • Thread-Safety Documentation (AesGcmCipher.h):

    • Documented that AesGcmCipher is not thread-safe and requires single-threaded use or external synchronization.

    Fixes Clarify threshold decryption share handling and update usage docs #335

@PropzSaladaz PropzSaladaz self-assigned this Sep 23, 2026
Base automatically changed from enhancement/331-move-to-256-bit-entropy-aes to enhancement/security-hardening September 23, 2026 16:36
@PropzSaladaz
PropzSaladaz marked this pull request as ready for review September 24, 2026 17:53
@PropzSaladaz
PropzSaladaz requested review from a team as code owners September 24, 2026 17:53
@PropzSaladaz
PropzSaladaz requested a lite review from Copilot September 24, 2026 17:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Remaining deleted-API calls break test compilation, and documentation inconsistencies should be corrected.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 2 Low severity

Open (3)
What changed in this PR

This PR renames threshold-encryption APIs, limits reconstruction shares to the threshold, and expands usage and thread-safety documentation.

Changes:

  • Renamed share-management and combination APIs.
  • Updated callers, tests, samples, and benchmarks.
  • Expanded TE/DKG, serialization, batch API, and AES thread-safety guidance.
File Summary
tools/​decryptMessage.cpp Updated decryption API usage.
threshold_encryption/​ThresholdEncryption.h Renamed combination APIs; brief still incorrectly refers to all shares.
threshold_encryption/​ThresholdEncryption.cpp Implemented renamed combination methods.
threshold_encryption/​threshold_encryption.cpp Updated helper documentation; contains an “auxiliar” typo.
threshold_encryption/​TEDecryptSet.h Renamed share-management and raw-share APIs.
threshold_encryption/​TEDecryptSet.cpp Implemented validated insertion and threshold-limited export.
threshold_encryption/​AesGcmCipher.h Documented thread-safety requirements.
test/​test_TE_wrappers.cpp Updated tests, but remaining calls to deleted addDecryptShare prevent compilation.
test/​test_encrypt_message.cpp Updated combination API usage.
test/​te_sample_sgx.cpp Updated validated share workflow.
docs/​usage/​using-threshold-encryption.md Expanded guidance; examples have an aes_key scope issue and overly broad indexing statement.
docs/​usage/​using-distributed-key-generation.md Updated DKG usage guidance.
benchmarks/​bench_te.cpp Updated benchmark API usage.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test/test_TE_wrappers.cpp
Comment thread docs/usage/using-threshold-encryption.md
Comment thread threshold_encryption/ThresholdEncryption.h
@PropzSaladaz
PropzSaladaz merged commit fac1022 into enhancement/security-hardening Sep 25, 2026
16 checks passed
@PropzSaladaz
PropzSaladaz deleted the refactor/threshold-decryption-api-cleanup branch September 25, 2026 17:41
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify threshold decryption share handling and update usage docs

3 participants