Skip to content

Fix embedded mnemonic share index bit sizing#57

Open
unworthyzeus wants to merge 1 commit into
bitaps-com:masterfrom
unworthyzeus:codex/fix-embedded-index-bits
Open

Fix embedded mnemonic share index bit sizing#57
unworthyzeus wants to merge 1 commit into
bitaps-com:masterfrom
unworthyzeus:codex/fix-embedded-index-bits

Conversation

@unworthyzeus
Copy link
Copy Markdown

Summary

  • Size embedded mnemonic share indexes with ceil(log2(total + 1)) so 12-word mnemonics can use all valid 4-bit indexes, including 9-15 shares.
  • Reject embedded-index splits when the requested share count cannot fit in the mnemonic checksum bits, with the same clear max-share limit used by Wallet.
  • Add regression coverage for 12-word embedded-index shares: 15 shares recover successfully, while 16 shares fail before generating unusable shares.

Notes

This is limited to embeddedIndex mode. Non-embedded splitMnemonic still keeps share indexes in the returned object keys.

Tests

pm test

Addresses #55

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