test: Fuzz the human-readable part of bech32 as well #30623

pull paplorinc wants to merge 2 commits into bitcoin:master from paplorinc:l0rinc/bech32-testing changing 3 files +50 −26
  1. paplorinc commented at 7:56 am on August 10, 2024: contributor

    Split out of https://github.com/bitcoin/bitcoin/pull/30596/files#r1706957219

    Instead of the static “bc” human-readable part, it’s now randomly generated based on https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki and the extra restrictions in the code:

    The human-readable part, which is intended to convey the type of data, or anything else that is relevant to the reader. This part MUST contain 1 to 83 US-ASCII characters, with each character having a value in the range [33-126]. HRP validity may be further restricted by specific applications.

    Since bech32::Encode rejects uppercase letters, we’re actually generating values in the [33-126] - ['A'-'Z'] range.

  2. Split out bech32 separator char to header 988eb2f8ff
  3. DrahtBot commented at 7:56 am on August 10, 2024: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

  4. DrahtBot added the label Tests on Aug 10, 2024
  5. DrahtBot added the label CI failed on Aug 10, 2024
  6. Fuzz HRP of bech32 as well
    Also separated the roundtrip testing from the random string decoding for clarity
    
    Note that while BIP 173 claims:
    ```
    The human-readable part, which is intended to convey the type of data, or anything else that is relevant to the reader. This part MUST contain 1 to 83 US-ASCII characters, with each character having a value in the range [33-126]. HRP validity may be further restricted by specific applications.
    ```
    bech32::Encode rejects uppercase letters.
    0c5bba5313
  7. paplorinc force-pushed on Aug 10, 2024
  8. DrahtBot removed the label CI failed on Aug 10, 2024
  9. paplorinc marked this as ready for review on Aug 18, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-09-29 01:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me