Skip to content

#333 add rejection conditions for signer index 0 for TE constructs - #334

Merged
PropzSaladaz merged 1 commit into
enhancement/security-hardeningfrom
enhancement/333-reject-any-constructions-using-signer-index-0
Sep 24, 2026
Merged

PropzSaladaz merged 1 commit into
enhancement/security-hardeningfrom
enhancement/333-reject-any-constructions-using-signer-index-0

Conversation

@PropzSaladaz

Copy link
Copy Markdown
Contributor

Description

This PR addresses inconsistent signer-index validation across the threshold-encryption codebase.

A signer index of 0 is invalid: it is reserved for the interpolation target f(0), while participant shares use indices 1..totalSigners. Previously, several TE constructors and TEDecryptSet accepted 0; the invalid input only failed later when combineShares reached Lagrange interpolation.

This PR:

  • rejects 0 in TEPrivateKeyShare, TEPublicKeyShare, and TEDecryptionShare;
  • enforces the full 1..totalSigners range in TEDecryptSet;
  • adds a defensive zero-index check in lagrangeCoeffs;
  • updates affected tests and adds regressions.

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

@PropzSaladaz PropzSaladaz self-assigned this Sep 22, 2026
@PropzSaladaz
PropzSaladaz requested a review from a team as a code owner September 22, 2026 16:22
@PropzSaladaz PropzSaladaz linked an issue Sep 22, 2026 that may be closed by this pull request
@PropzSaladaz
PropzSaladaz requested a lite review from Copilot September 22, 2026 16:55

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

🟢 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
@PropzSaladaz
PropzSaladaz merged commit d04098c into enhancement/security-hardening Sep 24, 2026
18 of 19 checks passed
@PropzSaladaz
PropzSaladaz deleted the enhancement/333-reject-any-constructions-using-signer-index-0 branch September 24, 2026 17:53
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 24, 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.

Reject any constructions using signer index 0

3 participants