Skip to content

Fix Shamir leading coefficient generation#80

Open
KingParmenides wants to merge 1 commit into
bitaps-com:masterfrom
KingParmenides:codex-shamir-leading-coeff-bounty-20260511
Open

Fix Shamir leading coefficient generation#80
KingParmenides wants to merge 1 commit into
bitaps-com:masterfrom
KingParmenides:codex-shamir-leading-coeff-bounty-20260511

Conversation

@KingParmenides
Copy link
Copy Markdown

Summary

  • Prevent generated Shamir polynomials from using 0 as the highest-degree coefficient.
  • Leave secret restoration compatible with existing shares.
  • Add a regression test that forces a zero leading coefficient and verifies two shares no longer recover a 3-of-3 secret.

This applies the same defensive fix to the Python implementation linked from the Bitaps Shamir bug bounty page.

Verification

  • Direct Shamir regression script with stubbed entropy: passed
  • PYTHONPYCACHEPREFIX=/private/tmp/pybtc-pycache .venv/bin/python -m py_compile pybtc/functions/shamir.py tests/test_shamir_functions.py
  • git diff --check

Note: full pytest tests/test_shamir_functions.py -q could not collect in this environment because the package imports compiled crypto extensions before the Shamir test module; local editable install is blocked by missing autoreconf for libsecp256k1.

Bounty payout address if accepted: 39Q34P8A7g375yqEr8buvNJkUbRgKfbKQZ

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