Skip to content

Commit 9f59765

Browse files
committed
Add gf32 module
We are attempting to get this crate to v0.1 (ie, API stabilization). Currently we use a type call `u5` for the 5 bit math, while valid this is slightly misleading because our `u5` is not basic integer type. Within the bech32 encoding scheme the 5 bit type is an element of GF32 (Galois Field). Add a `gf32` module that defines a type `Fe32` (Field Element). This type is similar to the current `u5` but includes add/sub/div/mul over the finite field. Introduce the `primitives` module to hold the `gf32` module (and other future primitive types). As yet do not make use of the `Fe32` type. Doing so is trivial and will be done later after more primitive types are added.
1 parent 360af7e commit 9f59765

File tree

4 files changed

+488
-4
lines changed

4 files changed

+488
-4
lines changed

Cargo.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[package]
22
name = "bech32"
33
version = "0.9.1"
4-
authors = ["Clark Moody", "The rust-bitcoin developers"]
4+
authors = ["Clark Moody", "Andrew Poelstra", "Tobin Harding", "The rust-bitcoin developers"]
55
repository = "https://github.com/rust-bitcoin/rust-bech32"
66
documentation = "https://docs.rs/bech32/"
7-
description = "Encodes and decodes the Bech32 format"
7+
description = "Encodes and decodes the Bech32 format and implements the bech32 and bech32m checksums"
88
readme = "README.md"
9-
keywords = ["base32", "encoding", "bech32"]
10-
categories = ["encoding"]
9+
keywords = ["base32", "encoding", "bech32", "bech32m", "bitcoin", "cryptocurrency"]
10+
categories = ["encoding", "cryptography::cryptocurrencies"]
1111
license = "MIT"
1212
edition = "2018"
1313

@@ -20,3 +20,6 @@ alloc = []
2020
version = "0.7.1"
2121
default-features = false
2222
optional = true
23+
24+
[target.'cfg(mutate)'.dev-dependencies]
25+
mutagen = { git = "https://github.com/llogiq/mutagen" }

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ use core::{fmt, mem};
5555
use std::borrow::Cow;
5656

5757
mod error;
58+
pub mod primitives;
5859

5960
#[cfg(feature = "arrayvec")]
6061
use arrayvec::{ArrayVec, CapacityError};

0 commit comments

Comments
 (0)