Skip to content

fix(threshold): bound raw combine inputs - #491

Draft
samgbafa wants to merge 1 commit into
mainfrom
skgbafa/tc-2219-threshold-input-bounds
Draft

samgbafa wants to merge 1 commit into
mainfrom
skgbafa/tc-2219-threshold-input-bounds

Conversation

@samgbafa

Copy link
Copy Markdown
Contributor

Behavior

  • Limit raw combine inputs to at most twice the validated current member count. Duplicates count toward the limit.
  • Return CombineError::TooManyShares without a member before request/share bindings, supplied-entry processing or algebra when the input exceeds the limit.
  • Preserve binding-first verification, per-member deduplication and lowest-threshold-index selection within the limit.
  • Add boundary, precedence and canonical identity-c3 mutation regressions. Identity decoding roles are unchanged; the specified mutated response returns the existing member-specific Invalid result.
  • Append the exact bound and precedence to SPEC/README. No layout, algorithm, dependency, fixture, checker or node-runtime changes.

Base: 00643ae8b445e019b45a03923caf65400102825d
Head: bb6133098d247bd2c3fb67e3cfd3de6faee8096b

Verification

Executed on the final Rust source before the documentation-only additions:

  • Tests first: one cargo test --locked -p tinycloud-threshold p3_ -- --nocapture run produced 3 passes and 2 behavior failures: over-limit acceptance and count-check precedence. The identity-c3 regression already passed before the guard.
  • cargo test --locked -p tinycloud-threshold — 50 passed, 0 failed, 0 ignored; 0 doc-tests. Includes the existing primitive byte-for-byte comparison.
  • cargo clippy --locked -p tinycloud-threshold --all-targets -- -D warnings — exit 0.
  • cargo fmt --check -p tinycloud-threshold — exit 0.
  • One native binary compiled the actual production modules with a local 4-member fixture: 8 inputs combine/decrypt/unwrap successfully; 9 return TooManyShares before binding/equation checks; 8 copies from one member return NotEnoughShares; bounded inputs retain all-bindings-before-algebra ordering; the canonical identity-c3 mutation returns Invalid for its issuing member. Compile and execution both exit 0. S0.1 has no public key-set constructor; the fixture is local to the temporary module harness, not a new product API.

All local Cargo work used isolated homes/target and two build jobs. Both granted slots were released immediately. The existing threshold lane in .github/workflows/rust.yml runs the full crate suite, including these inline tests; no CI configuration change is needed.

Dependency licences (unchanged)

Role Dependency Licence
Production blst 0.3.16 Apache-2.0
Production sha2 0.10.9 MIT OR Apache-2.0
Production zeroize 1.8.2 Apache-2.0 OR MIT
Production subtle 2.6.1 BSD-3-Clause
Production rand_core 0.6.4 MIT OR Apache-2.0
Production thiserror 2.0.18 MIT OR Apache-2.0
Development proptest 1.9.0 MIT OR Apache-2.0
Development rand_chacha 0.3.1 MIT OR Apache-2.0
Development serde 1.0.228 MIT OR Apache-2.0
Development serde_json 1.0.149 MIT OR Apache-2.0
Development hex 0.4.3 MIT OR Apache-2.0

The crate retains the workspace TinyCloud EGPL v1.5 licence file, publish = false, existing release configuration and unwired workspace membership.

PROVENANCE

  • TinyCloud's existing SPEC §3.6 and own input-bound policy: count limit, error precedence and unchanged accepted-length ordering.
  • Existing TinyCloud derive.rs, error.rs and deterministic checkpoint.rs fixture/dealer: existing API conventions, valid responses and regression construction.
  • Existing crate README and locked build metadata: unchanged dependency/licence inventory. Compiler-generated dependency-path metadata selected the matching prebuilt RNG artefacts for the temporary smoke; no dependency implementation was inspected.
  • Existing threshold workflow: confirmation that all inline crate tests run in CI.
  • No external implementation, new dependency implementation source or independent checker source was consulted for this change. Primitive JSON remains unchanged; the Rust-free count/error/precedence contract was sent to the separate checker owner without assigning checker edits.

Clean-room statement. tinycloud-threshold is written from published papers and standards only: Shamir 1979; Feldman 1987; Pedersen 1991; Gennaro–Jarecki–Krawczyk–Rabin 1999/2007; Boneh–Franklin 2001/2003; Fujisaki–Okamoto 1999; Desmedt–Jajodia 1997; Wong–Wang–Wing 2002; Herzberg–Jarecki–Krawczyk–Yung 1995; CHURP (ePrint 2019/017); vetKeys (ePrint 2023/616); RFC 9380; RFC 9180; the IRTF pairing-friendly-curves draft; and TinyCloud's own design and plan. No source code, tests, issues or other material from TACo, nucypher, nucypher-core, ferveo, umbral or taco-web (GPL-3.0/AGPL-3.0) was opened, fetched, cloned, searched or used. Dependencies are permissively licensed and listed in the PR. Each PR keeps a provenance log of the sources consulted.

test-ruling: TC-2219

The boundary and canonical identity-c3 regression additions are authorized by the owner disposition in TC-2219 comment ab185d99-1b8f-4cab-83a2-e235e0994ba1 and the scoped implementation instruction. Existing test assertions and fixtures are unchanged.

Details: TC-2219

This branch has not been deployed

No deployments
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