Skip to content

Commit

Permalink
Merge #180: checksum: introduce PrintImpl object that can compute v…
Browse files Browse the repository at this point in the history
…arious code properties

caefc44 checksum: add unit test to print parameters of the descriptor checksum (Andrew Poelstra)
b44431f checksum: introduce `PrintImpl` object to print `impl Checksum` blocks (Andrew Poelstra)
65aefd2 gf_ext: add cubic extension field of GF32, GF32768 (Andrew Poelstra)
4c06f72 PackedFe32: introduce ability to re-pack elements (Andrew Poelstra)
a24825d primitives: introduce `Polynomial` type, generator polynomial analysis (Andrew Poelstra)
cf545e4 primitives: add extension field module, define GF1024 (Andrew Poelstra)
8b08535 primitives: introduce Field trait (Andrew Poelstra)
bd6f2f6 bump MSRV to 1.56.1. (Andrew Poelstra)

Pull request description:

  This PR does a couple things:

  * Bumps the MSRV to 1.56.1 to match rust-bitcoin (and get us const generics which are useful for defining extension fields) as well as cleaning up a couple warnings.
  * Introduces the GF1024 field, a simple polynomial type, the Chein root-finding algorithm, and a couple other misc algorithms that will be useful for error correction. (All this is internal and not reflected in the public API.)
  * Introduces the GF32768 field which will be needed for error correction of the descriptor checksum.
  * To demonstrate this new functionality, adds an object to the API which can produce the `impl Checksum` block for codes which can be corrected using a quadratic or cubic field extension. This will hopefully provide some context for people not super familiar with BCH code about where these magic numbers come from.

  We also add unit tests that produce the parameters for codex32 and the descriptor checksum. A later PR will introduce more parameters which will be needed for error correction.

ACKs for top commit:
  clarkmoody:
    ACK caefc44

Tree-SHA512: a2408123e61b029f61e51cc9678e8c285c989316eb3e629b522f5d0724f29b727dd76054d3e1545504619711f8b0d086c0bafb4da287b55223f40e8798b04b23
  • Loading branch information
apoelstra committed Jul 6, 2024
2 parents 8529aff + caefc44 commit b03c2cc
Show file tree
Hide file tree
Showing 13 changed files with 1,987 additions and 83 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ jobs:
run: ./contrib/test.sh

MSRV:
name: Test - 1.48.0 toolchain
name: Test - 1.56.1 toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout Crate
uses: actions/checkout@v3
- name: Checkout Toolchain
uses: dtolnay/rust-toolchain@1.48.0
uses: dtolnay/rust-toolchain@1.56.1
- name: Running test script
env:
DO_FEATURE_MATRIX: true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Bitcoin-specific address encoding is handled by the `bitcoin-bech32` crate.

## MSRV

This library should always compile with any combination of features on **Rust 1.48.0**.
This library should always compile with any combination of features on **Rust 1.56.1**.


## Githooks
Expand Down
198 changes: 198 additions & 0 deletions api/all-features.txt

Large diffs are not rendered by default.

198 changes: 198 additions & 0 deletions api/alloc-only.txt

Large diffs are not rendered by default.

186 changes: 186 additions & 0 deletions api/no-features.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv = "1.48.0"
msrv = "1.56.1"
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,13 @@ use crate::primitives::decode::{ChecksumError, UncheckedHrpstring, UncheckedHrps
pub use {
crate::primitives::checksum::Checksum,
crate::primitives::gf32::Fe32,
crate::primitives::gf32_ext::{Fe1024, Fe32768},
crate::primitives::hrp::Hrp,
crate::primitives::iter::{ByteIterExt, Fe32IterExt},
crate::primitives::{Bech32, Bech32m, NoChecksum},
};
#[cfg(feature = "alloc")]
pub use crate::primitives::checksum::PrintImpl;

// Write to fmt buffer, small during testing to exercise full code path.
#[cfg(not(test))]
Expand Down
Loading

0 comments on commit b03c2cc

Please sign in to comment.