Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checksum: introduce PrintImpl object that can compute various code properties #180

Merged
merged 8 commits into from
Jul 6, 2024

Commits on Jul 5, 2024

  1. bump MSRV to 1.56.1.

    I want to use const generics and I need 1.56 to do it. The rest of the
    rust-bitcoin ecosystem has moved to 1.56.1.
    apoelstra committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    bd6f2f6 View commit details
    Browse the repository at this point in the history
  2. primitives: introduce Field trait

    This new trait covers a larger matrix of ops, and implements them all
    with a single macro. Will allow us to introduce new fields (in
    particular, extension fields of GF32) in a future commit with more
    consistent/less boilerplate heavy implementations of basic arithmetic.
    
    We run the API checker in this commit so you can see that the API
    changes are strictly additive and only add missing op implementations.
    apoelstra committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    8b08535 View commit details
    Browse the repository at this point in the history
  3. primitives: add extension field module, define GF1024

    Again, strictly adding API surface, not removing anything.
    apoelstra committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    cf545e4 View commit details
    Browse the repository at this point in the history
  4. primitives: introduce Polynomial type, generator polynomial analysis

    This introduces a type `Polynomial` which wraps a vector of field
    elements which it treats as the coefficients of a polynomial. It exposes
    only an ad-hoc set of functionality needed for error correction and is
    not intended to be a general-purpose polynomial type, so it is not
    exposed in the public API.
    
    Because it is backed by a `Vec` the type and its module are only
    available when the alloc feature is available.
    apoelstra committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    a24825d View commit details
    Browse the repository at this point in the history
  5. PackedFe32: introduce ability to re-pack elements

    Adds a couple elements to the API. Note that this *is* a breaking change
    because we are adding a method to the `PackedFe32` trait, which is not
    sealed, so any downstream implementors will be broken.
    apoelstra committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    4c06f72 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    65aefd2 View commit details
    Browse the repository at this point in the history
  7. checksum: introduce PrintImpl object to print impl Checksum blocks

    For the most part, BCH codes used in the ecosystem are defined as
    generator polynomials over GF32 and a target residue polynomial,
    and the remaining code parameters are not specified, or are only
    specified indirectly.
    
    It is difficult for non-experts to compute or even validate parameters
    such as the length of the code or the shifted+packed generator
    polynomials. It will be even more difficult in the sequel when we extend
    the Checksum trait to also cover error-correction parameters (some of
    which will depend on our particular choice of representation for GF1024
    elements, which is not canonical and differs between different
    documents).
    
    So we introduce an object `PrintImpl` and a unit test and doctest
    demonstrating its use, which will generate all of the needed parameters
    and output a block of Rust code.
    apoelstra committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    b44431f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    caefc44 View commit details
    Browse the repository at this point in the history