Skip to content

Commit

Permalink
Upgrade bech32 dependency
Browse files Browse the repository at this point in the history
Upgrade to the newest release of the `bech32` crate.

Please note I quickly skimmed bip 380 and briefly thought what the code
length should be, but the value used (1023) needs reviewing by a
cryptographer - FTR I copied it from `bech32`.
  • Loading branch information
tcharding committed Mar 21, 2024
1 parent 5719714 commit e4a5bff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ rand = ["bitcoin/rand"]
base64 = ["bitcoin/base64"]

[dependencies]
bech32 = { version = "0.10.0-beta", default-features = false }
bech32 = { version = "0.11.0", default-features = false }
bitcoin = { version = "0.31.0", default-features = false }

# Do NOT use this as a feature! Use the `serde` feature instead.
Expand Down
2 changes: 2 additions & 0 deletions src/descriptor/checksum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use crate::prelude::*;
use crate::Error;

const CHECKSUM_LENGTH: usize = 8;
const CODE_LENGTH: usize = 1023;

/// Compute the checksum of a descriptor.
///
Expand Down Expand Up @@ -142,6 +143,7 @@ const GEN: [u64; 5] = [0xf5dee51989, 0xa9fdca3312, 0x1bab10e32d, 0x3706b1677a, 0
impl Checksum for DescriptorChecksum {
type MidstateRepr = u64; // We need 40 bits (8 * 5).
const CHECKSUM_LENGTH: usize = CHECKSUM_LENGTH;
const CODE_LENGTH: usize = CODE_LENGTH;
const GENERATOR_SH: [u64; 5] = GEN;
const TARGET_RESIDUE: u64 = 1;
}
Expand Down

0 comments on commit e4a5bff

Please sign in to comment.