#333 add rejection conditions for signer index 0 for TE constructs - #334
Merged
PropzSaladaz merged 1 commit intoSep 24, 2026
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
Validation changes and regressions are covered; only minor formatting nits remain.
Review effort: Lite
Findings: None
What changed in this PR
This PR adds early validation for invalid signer indices across threshold-encryption APIs and interpolation.
Changes:
- Rejects zero and out-of-range signer indices.
- Adds defensive Lagrange interpolation validation.
- Updates regression and compatibility tests.
| File | Summary |
|---|---|
threshold_encryption/TEPublicKeyShare.cpp |
Validates public-key share indices. |
threshold_encryption/TEPrivateKeyShare.cpp |
Validates private-key share indices. |
threshold_encryption/TEDecryptSet.cpp |
Enforces the valid signer range. |
threshold_encryption/TEDecryptionShare.cpp |
Rejects zero-index decryption shares; two line-wrapping nits noted. |
test/unit_tests_backend.cpp |
Adds interpolation and inverse regressions. |
test/test_TE_wrappers.cpp |
Updates fixtures and adds constructor regressions. |
backends/interface/functions.cpp |
Rejects zero interpolation indices. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Base automatically changed from
enhancement/331-move-to-256-bit-entropy-aes
to
enhancement/security-hardening
September 23, 2026 16:36
badrogger
approved these changes
Sep 24, 2026
PropzSaladaz
merged commit Sep 24, 2026
d04098c
into
enhancement/security-hardening
18 of 19 checks passed
PropzSaladaz
deleted the
enhancement/333-reject-any-constructions-using-signer-index-0
branch
September 24, 2026 17:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses inconsistent signer-index validation across the threshold-encryption codebase.
A signer index of
0is invalid: it is reserved for the interpolation targetf(0), while participant shares use indices1..totalSigners. Previously, several TE constructors andTEDecryptSetaccepted0; the invalid input only failed later whencombineSharesreached Lagrange interpolation.This PR:
0inTEPrivateKeyShare,TEPublicKeyShare, andTEDecryptionShare;1..totalSignersrange inTEDecryptSet;lagrangeCoeffs;This does not change valid threshold-encryption behavior or address a new cryptographic security condition. It makes invalid input fail at the API boundary, with a clear validation error, rather than at merge time.
Fixes #333