Fix cleartext confusion score#273
Draft
bigspider wants to merge 9 commits into
Draft
Conversation
key_derivation_orderings_count grouped occurrences by whole key expression, so a musig(@i,@j,...) counted as one unit. That undercounts the derivation-ordering ambiguity: the same cleartext also decodes to multi_a(...), where each musig member is an individual plain key that can repeat across leaves (and the key path) and be permuted. Count by individual key index instead, expanding every musig group into its members. We use a deliberate over-to keep things simple, and raise MAX_CONFUSION_SCORE from the 3600 to 100000.
- Add a musig-key-path vector with three shared 2-of-2 fallback leaves: the case that motivated the formula change. Its score (5184) over-counts the 54 actual decodings, so the round-trip test now asserts the decoder yields at most confusion_score variants rather than exactly that many; the test-vector schema docs are updated to call the score an upper bound. - Pin confusion_score on the ~29 vectors that previously omitted it, widening coverage of the confusion-score function.
This is needed because of composability (some patterns might appear inside other patterns). Instead, we capitalize the first character of each cleartext entry if it's a lowercase letter, which looks better in the UI of a hardware signer. Modified decoding code (and the unambiguity guards) to always work with lowercase text (this is a good tighter rule anyway).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.