Skip to content

fix: validate threshold DKG input parameters#176

Open
PROWLERx15 wants to merge 1 commit intoLFDT-Lockness:cggmp24/mfrom
PROWLERx15:validate-input-params
Open

fix: validate threshold DKG input parameters#176
PROWLERx15 wants to merge 1 commit intoLFDT-Lockness:cggmp24/mfrom
PROWLERx15:validate-input-params

Conversation

@PROWLERx15
Copy link
Copy Markdown

Fixes #39

run_threshold_keygen did not check t, n, or i up front. Bad
values like t > n would run the full protocol and fail later with
unclear errors deep in ZK proofs or share validation.

Added upfront checks at the start of run_threshold_keygen:

  • n < 2 → TooFewParties
  • t < 2 → ThresholdTooSmall
  • t > n → ThresholdTooLarge
  • i >= n → PartyIndexOutOfRange

All return KeygenError via new Bug variants immediately, before any
networking or computation.

Tests (all curves):

  • t_greater_than_n t=5, n=3 → error
  • t_too_small t=1, n=3 → error
  • n_too_small t=2, n=1 → error
  • i_out_of_range i=3, n=3 → error

Signed-off-by: PROWLERx15 <prowlerx15@gmail.com>
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.

Threshold DKG doesn't validate input parameters

1 participant