diff --git a/api/all-features.txt b/api/all-features.txt index 648605452..34562bf4e 100644 --- a/api/all-features.txt +++ b/api/all-features.txt @@ -21,8 +21,10 @@ impl !core::panic::unwind_safe::RefUnwindSafe for bech32::EncodeIoError impl !core::panic::unwind_safe::UnwindSafe for bech32::EncodeIoError impl bech32::primitives::ExtensionField for bech32::primitives::gf32_ext::Fe1024 +impl bech32::primitives::ExtensionField for bech32::primitives::gf32_ext::Fe32768 impl bech32::primitives::Field for bech32::primitives::gf32::Fe32 impl bech32::primitives::Field for bech32::primitives::gf32_ext::Fe1024 +impl bech32::primitives::Field for bech32::primitives::gf32_ext::Fe32768 impl bech32::primitives::checksum::Checksum for bech32::primitives::Bech32 impl bech32::primitives::checksum::Checksum for bech32::primitives::Bech32m impl bech32::primitives::checksum::Checksum for bech32::primitives::NoChecksum @@ -337,42 +339,58 @@ impl core::ops::arith::Add<&bech32::primitives::gf32::Fe32> for &bech32::primiti impl core::ops::arith::Add<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::Add<&bech32::primitives::gf32_ext::Fe32Ext<2>> for &bech32::primitives::gf32_ext::Fe1024 impl core::ops::arith::Add<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Add<&bech32::primitives::gf32_ext::Fe32Ext<3>> for &bech32::primitives::gf32_ext::Fe32768 +impl core::ops::arith::Add<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::Add for &bech32::primitives::gf32::Fe32 impl core::ops::arith::Add> for &bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Add> for &bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::AddAssign for bech32::primitives::gf32::Fe32 impl core::ops::arith::AddAssign<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::AddAssign<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::AddAssign<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::Div for bech32::primitives::gf32::Fe32 impl core::ops::arith::Div<&bech32::primitives::gf32::Fe32> for &bech32::primitives::gf32::Fe32 impl core::ops::arith::Div<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::Div<&bech32::primitives::gf32_ext::Fe32Ext<2>> for &bech32::primitives::gf32_ext::Fe1024 impl core::ops::arith::Div<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Div<&bech32::primitives::gf32_ext::Fe32Ext<3>> for &bech32::primitives::gf32_ext::Fe32768 +impl core::ops::arith::Div<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::Div for &bech32::primitives::gf32::Fe32 impl core::ops::arith::Div> for &bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Div> for &bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::DivAssign for bech32::primitives::gf32::Fe32 impl core::ops::arith::DivAssign<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::DivAssign<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::DivAssign<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::Mul for bech32::primitives::gf32::Fe32 impl core::ops::arith::Mul<&bech32::primitives::gf32::Fe32> for &bech32::primitives::gf32::Fe32 impl core::ops::arith::Mul<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::Mul<&bech32::primitives::gf32_ext::Fe32Ext<2>> for &bech32::primitives::gf32_ext::Fe1024 impl core::ops::arith::Mul<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Mul<&bech32::primitives::gf32_ext::Fe32Ext<3>> for &bech32::primitives::gf32_ext::Fe32768 +impl core::ops::arith::Mul<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::Mul for &bech32::primitives::gf32::Fe32 impl core::ops::arith::Mul> for &bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Mul> for &bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::MulAssign for bech32::primitives::gf32::Fe32 impl core::ops::arith::MulAssign<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::MulAssign<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::MulAssign<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::Neg for bech32::primitives::gf32::Fe32 impl core::ops::arith::Sub for bech32::primitives::gf32::Fe32 impl core::ops::arith::Sub<&bech32::primitives::gf32::Fe32> for &bech32::primitives::gf32::Fe32 impl core::ops::arith::Sub<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::Sub<&bech32::primitives::gf32_ext::Fe32Ext<2>> for &bech32::primitives::gf32_ext::Fe1024 impl core::ops::arith::Sub<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Sub<&bech32::primitives::gf32_ext::Fe32Ext<3>> for &bech32::primitives::gf32_ext::Fe32768 +impl core::ops::arith::Sub<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::Sub for &bech32::primitives::gf32::Fe32 impl core::ops::arith::Sub> for &bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Sub> for &bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::SubAssign for bech32::primitives::gf32::Fe32 impl core::ops::arith::SubAssign<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::SubAssign<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::SubAssign<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::bit::BitXor for bech32::primitives::checksum::PackedNull impl core::panic::unwind_safe::RefUnwindSafe for bech32::DecodeError impl core::panic::unwind_safe::RefUnwindSafe for bech32::EncodeError @@ -746,6 +764,14 @@ pub const bech32::primitives::gf32_ext::Fe1024::MULTIPLICATIVE_ORDER_FACTORS: &' pub const bech32::primitives::gf32_ext::Fe1024::ONE: Self pub const bech32::primitives::gf32_ext::Fe1024::POLYNOMIAL: Self pub const bech32::primitives::gf32_ext::Fe1024::ZERO: Self +pub const bech32::primitives::gf32_ext::Fe32768::DEGREE: usize +pub const bech32::primitives::gf32_ext::Fe32768::EXT_ELEM: Self +pub const bech32::primitives::gf32_ext::Fe32768::GENERATOR: Self +pub const bech32::primitives::gf32_ext::Fe32768::MULTIPLICATIVE_ORDER: usize +pub const bech32::primitives::gf32_ext::Fe32768::MULTIPLICATIVE_ORDER_FACTORS: &'static [usize] +pub const bech32::primitives::gf32_ext::Fe32768::ONE: Self +pub const bech32::primitives::gf32_ext::Fe32768::POLYNOMIAL: Self +pub const bech32::primitives::gf32_ext::Fe32768::ZERO: Self pub const bech32::primitives::hrp::BC: bech32::primitives::hrp::Hrp pub const bech32::primitives::hrp::BCRT: bech32::primitives::hrp::Hrp pub const bech32::primitives::hrp::TB: bech32::primitives::hrp::Hrp @@ -781,6 +807,14 @@ pub fn &bech32::primitives::gf32_ext::Fe1024::mul(self, other: &bech32::primitiv pub fn &bech32::primitives::gf32_ext::Fe1024::mul(self, other: bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024 pub fn &bech32::primitives::gf32_ext::Fe1024::sub(self, other: &bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024 pub fn &bech32::primitives::gf32_ext::Fe1024::sub(self, other: bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024 +pub fn &bech32::primitives::gf32_ext::Fe32768::add(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn &bech32::primitives::gf32_ext::Fe32768::add(self, other: bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn &bech32::primitives::gf32_ext::Fe32768::div(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn &bech32::primitives::gf32_ext::Fe32768::div(self, other: bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn &bech32::primitives::gf32_ext::Fe32768::mul(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn &bech32::primitives::gf32_ext::Fe32768::mul(self, other: bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn &bech32::primitives::gf32_ext::Fe32768::sub(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn &bech32::primitives::gf32_ext::Fe32768::sub(self, other: bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 pub fn &bech32::primitives::gf32_ext::Fe32Ext::mul(self, other: &bech32::primitives::gf32::Fe32) -> Self::Output pub fn &bech32::primitives::gf32_ext::Fe32Ext::mul(self, other: bech32::primitives::gf32::Fe32) -> Self::Output pub fn bech32::ByteIterExt::bytes_to_fes(self) -> bech32::primitives::iter::BytesToFes @@ -1021,6 +1055,20 @@ pub fn bech32::primitives::gf32_ext::Fe1024::mul_assign(&mut self, other: &bech3 pub fn bech32::primitives::gf32_ext::Fe1024::multiplicative_inverse(self) -> Self pub fn bech32::primitives::gf32_ext::Fe1024::sub(self, other: &bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024 pub fn bech32::primitives::gf32_ext::Fe1024::sub_assign(&mut self, other: &bech32::primitives::gf32_ext::Fe1024) +pub fn bech32::primitives::gf32_ext::Fe32768::_add(&self, other: &Self) -> Self +pub fn bech32::primitives::gf32_ext::Fe32768::_div(&self, other: &Self) -> Self +pub fn bech32::primitives::gf32_ext::Fe32768::_mul(&self, other: &Self) -> Self +pub fn bech32::primitives::gf32_ext::Fe32768::_neg(self) -> Self +pub fn bech32::primitives::gf32_ext::Fe32768::_sub(&self, other: &Self) -> Self +pub fn bech32::primitives::gf32_ext::Fe32768::add(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn bech32::primitives::gf32_ext::Fe32768::add_assign(&mut self, other: &bech32::primitives::gf32_ext::Fe32768) +pub fn bech32::primitives::gf32_ext::Fe32768::div(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn bech32::primitives::gf32_ext::Fe32768::div_assign(&mut self, other: &bech32::primitives::gf32_ext::Fe32768) +pub fn bech32::primitives::gf32_ext::Fe32768::mul(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn bech32::primitives::gf32_ext::Fe32768::mul_assign(&mut self, other: &bech32::primitives::gf32_ext::Fe32768) +pub fn bech32::primitives::gf32_ext::Fe32768::multiplicative_inverse(self) -> Self +pub fn bech32::primitives::gf32_ext::Fe32768::sub(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn bech32::primitives::gf32_ext::Fe32768::sub_assign(&mut self, other: &bech32::primitives::gf32_ext::Fe32768) pub fn bech32::primitives::gf32_ext::Fe32Ext::clone(&self) -> bech32::primitives::gf32_ext::Fe32Ext pub fn bech32::primitives::gf32_ext::Fe32Ext::eq(&self, other: &bech32::primitives::gf32_ext::Fe32Ext) -> bool pub fn bech32::primitives::gf32_ext::Fe32Ext::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result @@ -1180,9 +1228,11 @@ pub trait bech32::primitives::iter::ByteIterExt: core::marker::Sized + core::ite pub trait bech32::primitives::iter::Fe32IterExt: core::marker::Sized + core::iter::traits::iterator::Iterator pub type &bech32::primitives::gf32::Fe32::Output = bech32::primitives::gf32::Fe32 pub type &bech32::primitives::gf32_ext::Fe1024::Output = bech32::primitives::gf32_ext::Fe32Ext<2> +pub type &bech32::primitives::gf32_ext::Fe32768::Output = bech32::primitives::gf32_ext::Fe32Ext<3> pub type &bech32::primitives::gf32_ext::Fe32Ext::Output = bech32::primitives::gf32_ext::Fe32Ext pub type bech32::Checksum::MidstateRepr: bech32::primitives::checksum::PackedFe32 pub type bech32::Fe1024 = bech32::primitives::gf32_ext::Fe32Ext<2> +pub type bech32::Fe32768 = bech32::primitives::gf32_ext::Fe32Ext<3> pub type bech32::primitives::Bech32::MidstateRepr = u32 pub type bech32::primitives::Bech32m::MidstateRepr = u32 pub type bech32::primitives::ExtensionField::BaseField: bech32::primitives::Field @@ -1201,6 +1251,9 @@ pub type bech32::primitives::gf32::Fe32::Output = bech32::primitives::gf32::Fe32 pub type bech32::primitives::gf32_ext::Fe1024 = bech32::primitives::gf32_ext::Fe32Ext<2> pub type bech32::primitives::gf32_ext::Fe1024::BaseField = bech32::primitives::gf32::Fe32 pub type bech32::primitives::gf32_ext::Fe1024::Output = bech32::primitives::gf32_ext::Fe32Ext<2> +pub type bech32::primitives::gf32_ext::Fe32768 = bech32::primitives::gf32_ext::Fe32Ext<3> +pub type bech32::primitives::gf32_ext::Fe32768::BaseField = bech32::primitives::gf32::Fe32 +pub type bech32::primitives::gf32_ext::Fe32768::Output = bech32::primitives::gf32_ext::Fe32Ext<3> pub type bech32::primitives::gf32_ext::Fe32Ext::Output = bech32::primitives::gf32_ext::Fe32Ext pub type bech32::primitives::hrp::ByteIter<'b>::Item = u8 pub type bech32::primitives::hrp::CharIter<'b>::Item = char diff --git a/api/alloc-only.txt b/api/alloc-only.txt index b09a4ab9a..a13fc1f5f 100644 --- a/api/alloc-only.txt +++ b/api/alloc-only.txt @@ -18,8 +18,10 @@ #[repr(transparent)] pub struct bech32::Fe32(_) #[repr(transparent)] pub struct bech32::primitives::gf32::Fe32(_) impl bech32::primitives::ExtensionField for bech32::primitives::gf32_ext::Fe1024 +impl bech32::primitives::ExtensionField for bech32::primitives::gf32_ext::Fe32768 impl bech32::primitives::Field for bech32::primitives::gf32::Fe32 impl bech32::primitives::Field for bech32::primitives::gf32_ext::Fe1024 +impl bech32::primitives::Field for bech32::primitives::gf32_ext::Fe32768 impl bech32::primitives::checksum::Checksum for bech32::primitives::Bech32 impl bech32::primitives::checksum::Checksum for bech32::primitives::Bech32m impl bech32::primitives::checksum::Checksum for bech32::primitives::NoChecksum @@ -308,42 +310,58 @@ impl core::ops::arith::Add<&bech32::primitives::gf32::Fe32> for &bech32::primiti impl core::ops::arith::Add<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::Add<&bech32::primitives::gf32_ext::Fe32Ext<2>> for &bech32::primitives::gf32_ext::Fe1024 impl core::ops::arith::Add<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Add<&bech32::primitives::gf32_ext::Fe32Ext<3>> for &bech32::primitives::gf32_ext::Fe32768 +impl core::ops::arith::Add<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::Add for &bech32::primitives::gf32::Fe32 impl core::ops::arith::Add> for &bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Add> for &bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::AddAssign for bech32::primitives::gf32::Fe32 impl core::ops::arith::AddAssign<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::AddAssign<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::AddAssign<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::Div for bech32::primitives::gf32::Fe32 impl core::ops::arith::Div<&bech32::primitives::gf32::Fe32> for &bech32::primitives::gf32::Fe32 impl core::ops::arith::Div<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::Div<&bech32::primitives::gf32_ext::Fe32Ext<2>> for &bech32::primitives::gf32_ext::Fe1024 impl core::ops::arith::Div<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Div<&bech32::primitives::gf32_ext::Fe32Ext<3>> for &bech32::primitives::gf32_ext::Fe32768 +impl core::ops::arith::Div<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::Div for &bech32::primitives::gf32::Fe32 impl core::ops::arith::Div> for &bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Div> for &bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::DivAssign for bech32::primitives::gf32::Fe32 impl core::ops::arith::DivAssign<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::DivAssign<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::DivAssign<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::Mul for bech32::primitives::gf32::Fe32 impl core::ops::arith::Mul<&bech32::primitives::gf32::Fe32> for &bech32::primitives::gf32::Fe32 impl core::ops::arith::Mul<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::Mul<&bech32::primitives::gf32_ext::Fe32Ext<2>> for &bech32::primitives::gf32_ext::Fe1024 impl core::ops::arith::Mul<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Mul<&bech32::primitives::gf32_ext::Fe32Ext<3>> for &bech32::primitives::gf32_ext::Fe32768 +impl core::ops::arith::Mul<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::Mul for &bech32::primitives::gf32::Fe32 impl core::ops::arith::Mul> for &bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Mul> for &bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::MulAssign for bech32::primitives::gf32::Fe32 impl core::ops::arith::MulAssign<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::MulAssign<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::MulAssign<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::Neg for bech32::primitives::gf32::Fe32 impl core::ops::arith::Sub for bech32::primitives::gf32::Fe32 impl core::ops::arith::Sub<&bech32::primitives::gf32::Fe32> for &bech32::primitives::gf32::Fe32 impl core::ops::arith::Sub<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::Sub<&bech32::primitives::gf32_ext::Fe32Ext<2>> for &bech32::primitives::gf32_ext::Fe1024 impl core::ops::arith::Sub<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Sub<&bech32::primitives::gf32_ext::Fe32Ext<3>> for &bech32::primitives::gf32_ext::Fe32768 +impl core::ops::arith::Sub<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::Sub for &bech32::primitives::gf32::Fe32 impl core::ops::arith::Sub> for &bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Sub> for &bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::SubAssign for bech32::primitives::gf32::Fe32 impl core::ops::arith::SubAssign<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::SubAssign<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::SubAssign<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::bit::BitXor for bech32::primitives::checksum::PackedNull impl core::panic::unwind_safe::RefUnwindSafe for bech32::DecodeError impl core::panic::unwind_safe::RefUnwindSafe for bech32::EncodeError @@ -715,6 +733,14 @@ pub const bech32::primitives::gf32_ext::Fe1024::MULTIPLICATIVE_ORDER_FACTORS: &' pub const bech32::primitives::gf32_ext::Fe1024::ONE: Self pub const bech32::primitives::gf32_ext::Fe1024::POLYNOMIAL: Self pub const bech32::primitives::gf32_ext::Fe1024::ZERO: Self +pub const bech32::primitives::gf32_ext::Fe32768::DEGREE: usize +pub const bech32::primitives::gf32_ext::Fe32768::EXT_ELEM: Self +pub const bech32::primitives::gf32_ext::Fe32768::GENERATOR: Self +pub const bech32::primitives::gf32_ext::Fe32768::MULTIPLICATIVE_ORDER: usize +pub const bech32::primitives::gf32_ext::Fe32768::MULTIPLICATIVE_ORDER_FACTORS: &'static [usize] +pub const bech32::primitives::gf32_ext::Fe32768::ONE: Self +pub const bech32::primitives::gf32_ext::Fe32768::POLYNOMIAL: Self +pub const bech32::primitives::gf32_ext::Fe32768::ZERO: Self pub const bech32::primitives::hrp::BC: bech32::primitives::hrp::Hrp pub const bech32::primitives::hrp::BCRT: bech32::primitives::hrp::Hrp pub const bech32::primitives::hrp::TB: bech32::primitives::hrp::Hrp @@ -750,6 +776,14 @@ pub fn &bech32::primitives::gf32_ext::Fe1024::mul(self, other: &bech32::primitiv pub fn &bech32::primitives::gf32_ext::Fe1024::mul(self, other: bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024 pub fn &bech32::primitives::gf32_ext::Fe1024::sub(self, other: &bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024 pub fn &bech32::primitives::gf32_ext::Fe1024::sub(self, other: bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024 +pub fn &bech32::primitives::gf32_ext::Fe32768::add(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn &bech32::primitives::gf32_ext::Fe32768::add(self, other: bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn &bech32::primitives::gf32_ext::Fe32768::div(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn &bech32::primitives::gf32_ext::Fe32768::div(self, other: bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn &bech32::primitives::gf32_ext::Fe32768::mul(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn &bech32::primitives::gf32_ext::Fe32768::mul(self, other: bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn &bech32::primitives::gf32_ext::Fe32768::sub(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn &bech32::primitives::gf32_ext::Fe32768::sub(self, other: bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 pub fn &bech32::primitives::gf32_ext::Fe32Ext::mul(self, other: &bech32::primitives::gf32::Fe32) -> Self::Output pub fn &bech32::primitives::gf32_ext::Fe32Ext::mul(self, other: bech32::primitives::gf32::Fe32) -> Self::Output pub fn bech32::ByteIterExt::bytes_to_fes(self) -> bech32::primitives::iter::BytesToFes @@ -971,6 +1005,20 @@ pub fn bech32::primitives::gf32_ext::Fe1024::mul_assign(&mut self, other: &bech3 pub fn bech32::primitives::gf32_ext::Fe1024::multiplicative_inverse(self) -> Self pub fn bech32::primitives::gf32_ext::Fe1024::sub(self, other: &bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024 pub fn bech32::primitives::gf32_ext::Fe1024::sub_assign(&mut self, other: &bech32::primitives::gf32_ext::Fe1024) +pub fn bech32::primitives::gf32_ext::Fe32768::_add(&self, other: &Self) -> Self +pub fn bech32::primitives::gf32_ext::Fe32768::_div(&self, other: &Self) -> Self +pub fn bech32::primitives::gf32_ext::Fe32768::_mul(&self, other: &Self) -> Self +pub fn bech32::primitives::gf32_ext::Fe32768::_neg(self) -> Self +pub fn bech32::primitives::gf32_ext::Fe32768::_sub(&self, other: &Self) -> Self +pub fn bech32::primitives::gf32_ext::Fe32768::add(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn bech32::primitives::gf32_ext::Fe32768::add_assign(&mut self, other: &bech32::primitives::gf32_ext::Fe32768) +pub fn bech32::primitives::gf32_ext::Fe32768::div(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn bech32::primitives::gf32_ext::Fe32768::div_assign(&mut self, other: &bech32::primitives::gf32_ext::Fe32768) +pub fn bech32::primitives::gf32_ext::Fe32768::mul(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn bech32::primitives::gf32_ext::Fe32768::mul_assign(&mut self, other: &bech32::primitives::gf32_ext::Fe32768) +pub fn bech32::primitives::gf32_ext::Fe32768::multiplicative_inverse(self) -> Self +pub fn bech32::primitives::gf32_ext::Fe32768::sub(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn bech32::primitives::gf32_ext::Fe32768::sub_assign(&mut self, other: &bech32::primitives::gf32_ext::Fe32768) pub fn bech32::primitives::gf32_ext::Fe32Ext::clone(&self) -> bech32::primitives::gf32_ext::Fe32Ext pub fn bech32::primitives::gf32_ext::Fe32Ext::eq(&self, other: &bech32::primitives::gf32_ext::Fe32Ext) -> bool pub fn bech32::primitives::gf32_ext::Fe32Ext::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result @@ -1122,9 +1170,11 @@ pub trait bech32::primitives::iter::ByteIterExt: core::marker::Sized + core::ite pub trait bech32::primitives::iter::Fe32IterExt: core::marker::Sized + core::iter::traits::iterator::Iterator pub type &bech32::primitives::gf32::Fe32::Output = bech32::primitives::gf32::Fe32 pub type &bech32::primitives::gf32_ext::Fe1024::Output = bech32::primitives::gf32_ext::Fe32Ext<2> +pub type &bech32::primitives::gf32_ext::Fe32768::Output = bech32::primitives::gf32_ext::Fe32Ext<3> pub type &bech32::primitives::gf32_ext::Fe32Ext::Output = bech32::primitives::gf32_ext::Fe32Ext pub type bech32::Checksum::MidstateRepr: bech32::primitives::checksum::PackedFe32 pub type bech32::Fe1024 = bech32::primitives::gf32_ext::Fe32Ext<2> +pub type bech32::Fe32768 = bech32::primitives::gf32_ext::Fe32Ext<3> pub type bech32::primitives::Bech32::MidstateRepr = u32 pub type bech32::primitives::Bech32m::MidstateRepr = u32 pub type bech32::primitives::ExtensionField::BaseField: bech32::primitives::Field @@ -1143,6 +1193,9 @@ pub type bech32::primitives::gf32::Fe32::Output = bech32::primitives::gf32::Fe32 pub type bech32::primitives::gf32_ext::Fe1024 = bech32::primitives::gf32_ext::Fe32Ext<2> pub type bech32::primitives::gf32_ext::Fe1024::BaseField = bech32::primitives::gf32::Fe32 pub type bech32::primitives::gf32_ext::Fe1024::Output = bech32::primitives::gf32_ext::Fe32Ext<2> +pub type bech32::primitives::gf32_ext::Fe32768 = bech32::primitives::gf32_ext::Fe32Ext<3> +pub type bech32::primitives::gf32_ext::Fe32768::BaseField = bech32::primitives::gf32::Fe32 +pub type bech32::primitives::gf32_ext::Fe32768::Output = bech32::primitives::gf32_ext::Fe32Ext<3> pub type bech32::primitives::gf32_ext::Fe32Ext::Output = bech32::primitives::gf32_ext::Fe32Ext pub type bech32::primitives::hrp::ByteIter<'b>::Item = u8 pub type bech32::primitives::hrp::CharIter<'b>::Item = char diff --git a/api/no-features.txt b/api/no-features.txt index 74b0f119d..4357094c9 100644 --- a/api/no-features.txt +++ b/api/no-features.txt @@ -15,8 +15,10 @@ #[repr(transparent)] pub struct bech32::Fe32(_) #[repr(transparent)] pub struct bech32::primitives::gf32::Fe32(_) impl bech32::primitives::ExtensionField for bech32::primitives::gf32_ext::Fe1024 +impl bech32::primitives::ExtensionField for bech32::primitives::gf32_ext::Fe32768 impl bech32::primitives::Field for bech32::primitives::gf32::Fe32 impl bech32::primitives::Field for bech32::primitives::gf32_ext::Fe1024 +impl bech32::primitives::Field for bech32::primitives::gf32_ext::Fe32768 impl bech32::primitives::checksum::Checksum for bech32::primitives::Bech32 impl bech32::primitives::checksum::Checksum for bech32::primitives::Bech32m impl bech32::primitives::checksum::Checksum for bech32::primitives::NoChecksum @@ -269,42 +271,58 @@ impl core::ops::arith::Add<&bech32::primitives::gf32::Fe32> for &bech32::primiti impl core::ops::arith::Add<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::Add<&bech32::primitives::gf32_ext::Fe32Ext<2>> for &bech32::primitives::gf32_ext::Fe1024 impl core::ops::arith::Add<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Add<&bech32::primitives::gf32_ext::Fe32Ext<3>> for &bech32::primitives::gf32_ext::Fe32768 +impl core::ops::arith::Add<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::Add for &bech32::primitives::gf32::Fe32 impl core::ops::arith::Add> for &bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Add> for &bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::AddAssign for bech32::primitives::gf32::Fe32 impl core::ops::arith::AddAssign<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::AddAssign<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::AddAssign<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::Div for bech32::primitives::gf32::Fe32 impl core::ops::arith::Div<&bech32::primitives::gf32::Fe32> for &bech32::primitives::gf32::Fe32 impl core::ops::arith::Div<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::Div<&bech32::primitives::gf32_ext::Fe32Ext<2>> for &bech32::primitives::gf32_ext::Fe1024 impl core::ops::arith::Div<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Div<&bech32::primitives::gf32_ext::Fe32Ext<3>> for &bech32::primitives::gf32_ext::Fe32768 +impl core::ops::arith::Div<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::Div for &bech32::primitives::gf32::Fe32 impl core::ops::arith::Div> for &bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Div> for &bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::DivAssign for bech32::primitives::gf32::Fe32 impl core::ops::arith::DivAssign<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::DivAssign<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::DivAssign<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::Mul for bech32::primitives::gf32::Fe32 impl core::ops::arith::Mul<&bech32::primitives::gf32::Fe32> for &bech32::primitives::gf32::Fe32 impl core::ops::arith::Mul<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::Mul<&bech32::primitives::gf32_ext::Fe32Ext<2>> for &bech32::primitives::gf32_ext::Fe1024 impl core::ops::arith::Mul<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Mul<&bech32::primitives::gf32_ext::Fe32Ext<3>> for &bech32::primitives::gf32_ext::Fe32768 +impl core::ops::arith::Mul<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::Mul for &bech32::primitives::gf32::Fe32 impl core::ops::arith::Mul> for &bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Mul> for &bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::MulAssign for bech32::primitives::gf32::Fe32 impl core::ops::arith::MulAssign<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::MulAssign<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::MulAssign<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::Neg for bech32::primitives::gf32::Fe32 impl core::ops::arith::Sub for bech32::primitives::gf32::Fe32 impl core::ops::arith::Sub<&bech32::primitives::gf32::Fe32> for &bech32::primitives::gf32::Fe32 impl core::ops::arith::Sub<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::Sub<&bech32::primitives::gf32_ext::Fe32Ext<2>> for &bech32::primitives::gf32_ext::Fe1024 impl core::ops::arith::Sub<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Sub<&bech32::primitives::gf32_ext::Fe32Ext<3>> for &bech32::primitives::gf32_ext::Fe32768 +impl core::ops::arith::Sub<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::Sub for &bech32::primitives::gf32::Fe32 impl core::ops::arith::Sub> for &bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::Sub> for &bech32::primitives::gf32_ext::Fe32768 impl core::ops::arith::SubAssign for bech32::primitives::gf32::Fe32 impl core::ops::arith::SubAssign<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32 impl core::ops::arith::SubAssign<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024 +impl core::ops::arith::SubAssign<&bech32::primitives::gf32_ext::Fe32Ext<3>> for bech32::primitives::gf32_ext::Fe32768 impl core::ops::bit::BitXor for bech32::primitives::checksum::PackedNull impl core::panic::unwind_safe::RefUnwindSafe for bech32::EncodeError impl core::panic::unwind_safe::RefUnwindSafe for bech32::primitives::Bech32 @@ -664,6 +682,14 @@ pub const bech32::primitives::gf32_ext::Fe1024::MULTIPLICATIVE_ORDER_FACTORS: &' pub const bech32::primitives::gf32_ext::Fe1024::ONE: Self pub const bech32::primitives::gf32_ext::Fe1024::POLYNOMIAL: Self pub const bech32::primitives::gf32_ext::Fe1024::ZERO: Self +pub const bech32::primitives::gf32_ext::Fe32768::DEGREE: usize +pub const bech32::primitives::gf32_ext::Fe32768::EXT_ELEM: Self +pub const bech32::primitives::gf32_ext::Fe32768::GENERATOR: Self +pub const bech32::primitives::gf32_ext::Fe32768::MULTIPLICATIVE_ORDER: usize +pub const bech32::primitives::gf32_ext::Fe32768::MULTIPLICATIVE_ORDER_FACTORS: &'static [usize] +pub const bech32::primitives::gf32_ext::Fe32768::ONE: Self +pub const bech32::primitives::gf32_ext::Fe32768::POLYNOMIAL: Self +pub const bech32::primitives::gf32_ext::Fe32768::ZERO: Self pub const bech32::primitives::hrp::BC: bech32::primitives::hrp::Hrp pub const bech32::primitives::hrp::BCRT: bech32::primitives::hrp::Hrp pub const bech32::primitives::hrp::TB: bech32::primitives::hrp::Hrp @@ -699,6 +725,14 @@ pub fn &bech32::primitives::gf32_ext::Fe1024::mul(self, other: &bech32::primitiv pub fn &bech32::primitives::gf32_ext::Fe1024::mul(self, other: bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024 pub fn &bech32::primitives::gf32_ext::Fe1024::sub(self, other: &bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024 pub fn &bech32::primitives::gf32_ext::Fe1024::sub(self, other: bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024 +pub fn &bech32::primitives::gf32_ext::Fe32768::add(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn &bech32::primitives::gf32_ext::Fe32768::add(self, other: bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn &bech32::primitives::gf32_ext::Fe32768::div(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn &bech32::primitives::gf32_ext::Fe32768::div(self, other: bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn &bech32::primitives::gf32_ext::Fe32768::mul(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn &bech32::primitives::gf32_ext::Fe32768::mul(self, other: bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn &bech32::primitives::gf32_ext::Fe32768::sub(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn &bech32::primitives::gf32_ext::Fe32768::sub(self, other: bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 pub fn &bech32::primitives::gf32_ext::Fe32Ext::mul(self, other: &bech32::primitives::gf32::Fe32) -> Self::Output pub fn &bech32::primitives::gf32_ext::Fe32Ext::mul(self, other: bech32::primitives::gf32::Fe32) -> Self::Output pub fn bech32::ByteIterExt::bytes_to_fes(self) -> bech32::primitives::iter::BytesToFes @@ -912,6 +946,20 @@ pub fn bech32::primitives::gf32_ext::Fe1024::mul_assign(&mut self, other: &bech3 pub fn bech32::primitives::gf32_ext::Fe1024::multiplicative_inverse(self) -> Self pub fn bech32::primitives::gf32_ext::Fe1024::sub(self, other: &bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024 pub fn bech32::primitives::gf32_ext::Fe1024::sub_assign(&mut self, other: &bech32::primitives::gf32_ext::Fe1024) +pub fn bech32::primitives::gf32_ext::Fe32768::_add(&self, other: &Self) -> Self +pub fn bech32::primitives::gf32_ext::Fe32768::_div(&self, other: &Self) -> Self +pub fn bech32::primitives::gf32_ext::Fe32768::_mul(&self, other: &Self) -> Self +pub fn bech32::primitives::gf32_ext::Fe32768::_neg(self) -> Self +pub fn bech32::primitives::gf32_ext::Fe32768::_sub(&self, other: &Self) -> Self +pub fn bech32::primitives::gf32_ext::Fe32768::add(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn bech32::primitives::gf32_ext::Fe32768::add_assign(&mut self, other: &bech32::primitives::gf32_ext::Fe32768) +pub fn bech32::primitives::gf32_ext::Fe32768::div(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn bech32::primitives::gf32_ext::Fe32768::div_assign(&mut self, other: &bech32::primitives::gf32_ext::Fe32768) +pub fn bech32::primitives::gf32_ext::Fe32768::mul(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn bech32::primitives::gf32_ext::Fe32768::mul_assign(&mut self, other: &bech32::primitives::gf32_ext::Fe32768) +pub fn bech32::primitives::gf32_ext::Fe32768::multiplicative_inverse(self) -> Self +pub fn bech32::primitives::gf32_ext::Fe32768::sub(self, other: &bech32::primitives::gf32_ext::Fe32768) -> bech32::primitives::gf32_ext::Fe32768 +pub fn bech32::primitives::gf32_ext::Fe32768::sub_assign(&mut self, other: &bech32::primitives::gf32_ext::Fe32768) pub fn bech32::primitives::gf32_ext::Fe32Ext::clone(&self) -> bech32::primitives::gf32_ext::Fe32Ext pub fn bech32::primitives::gf32_ext::Fe32Ext::eq(&self, other: &bech32::primitives::gf32_ext::Fe32Ext) -> bool pub fn bech32::primitives::gf32_ext::Fe32Ext::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result @@ -1047,9 +1095,11 @@ pub trait bech32::primitives::iter::ByteIterExt: core::marker::Sized + core::ite pub trait bech32::primitives::iter::Fe32IterExt: core::marker::Sized + core::iter::traits::iterator::Iterator pub type &bech32::primitives::gf32::Fe32::Output = bech32::primitives::gf32::Fe32 pub type &bech32::primitives::gf32_ext::Fe1024::Output = bech32::primitives::gf32_ext::Fe32Ext<2> +pub type &bech32::primitives::gf32_ext::Fe32768::Output = bech32::primitives::gf32_ext::Fe32Ext<3> pub type &bech32::primitives::gf32_ext::Fe32Ext::Output = bech32::primitives::gf32_ext::Fe32Ext pub type bech32::Checksum::MidstateRepr: bech32::primitives::checksum::PackedFe32 pub type bech32::Fe1024 = bech32::primitives::gf32_ext::Fe32Ext<2> +pub type bech32::Fe32768 = bech32::primitives::gf32_ext::Fe32Ext<3> pub type bech32::primitives::Bech32::MidstateRepr = u32 pub type bech32::primitives::Bech32m::MidstateRepr = u32 pub type bech32::primitives::ExtensionField::BaseField: bech32::primitives::Field @@ -1068,6 +1118,9 @@ pub type bech32::primitives::gf32::Fe32::Output = bech32::primitives::gf32::Fe32 pub type bech32::primitives::gf32_ext::Fe1024 = bech32::primitives::gf32_ext::Fe32Ext<2> pub type bech32::primitives::gf32_ext::Fe1024::BaseField = bech32::primitives::gf32::Fe32 pub type bech32::primitives::gf32_ext::Fe1024::Output = bech32::primitives::gf32_ext::Fe32Ext<2> +pub type bech32::primitives::gf32_ext::Fe32768 = bech32::primitives::gf32_ext::Fe32Ext<3> +pub type bech32::primitives::gf32_ext::Fe32768::BaseField = bech32::primitives::gf32::Fe32 +pub type bech32::primitives::gf32_ext::Fe32768::Output = bech32::primitives::gf32_ext::Fe32Ext<3> pub type bech32::primitives::gf32_ext::Fe32Ext::Output = bech32::primitives::gf32_ext::Fe32Ext pub type bech32::primitives::hrp::ByteIter<'b>::Item = u8 pub type bech32::primitives::hrp::CharIter<'b>::Item = char diff --git a/src/lib.rs b/src/lib.rs index ab86aeb21..4ca1381b1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -161,7 +161,7 @@ use crate::primitives::decode::{ChecksumError, UncheckedHrpstring, UncheckedHrps pub use { crate::primitives::checksum::Checksum, crate::primitives::gf32::Fe32, - crate::primitives::gf32_ext::Fe1024, + crate::primitives::gf32_ext::{Fe1024, Fe32768}, crate::primitives::hrp::Hrp, crate::primitives::iter::{ByteIterExt, Fe32IterExt}, crate::primitives::{Bech32, Bech32m, NoChecksum}, diff --git a/src/primitives/gf32_ext.rs b/src/primitives/gf32_ext.rs index 5fddebed8..faff434b1 100644 --- a/src/primitives/gf32_ext.rs +++ b/src/primitives/gf32_ext.rs @@ -183,6 +183,95 @@ impl ExtensionField for Fe1024 { const EXT_ELEM: Self = Self::new([Fe32::Q, Fe32::P]); } +/// The field of order 32768. +pub type Fe32768 = Fe32Ext<3>; + +impl Field for Fe32768 { + /// The zero element of the field. + const ZERO: Self = Self::new([Fe32::Q, Fe32::Q, Fe32::Q]); + + /// The one element of the field. + const ONE: Self = Self::new([Fe32::P, Fe32::Q, Fe32::Q]); + + // Chosen somewhat arbitrarily, by just guessing values until one came + // out with the correct order. + /// A generator of the field. + const GENERATOR: Self = Self::new([Fe32::A, Fe32::C, Fe32::Q]); + + /// The order of the multiplicative group of the field. + /// + /// This constant also serves as a compile-time check that we can count + /// the entire field using a `usize` as a counter. + const MULTIPLICATIVE_ORDER: usize = 32767; + + const MULTIPLICATIVE_ORDER_FACTORS: &'static [usize] = &[1, 7, 31, 151, 217, 1057, 4681, 32767]; + + #[inline] + fn _add(&self, other: &Self) -> Self { + Self::new([ + self.inner[0] + other.inner[0], + self.inner[1] + other.inner[1], + self.inner[2] + other.inner[2], + ]) + } + + #[inline] + fn _sub(&self, other: &Self) -> Self { self._add(other) } + + #[inline] + fn _mul(&self, other: &Self) -> Self { self.mul_by_elem(other) } + + #[inline] + fn _div(&self, other: &Self) -> Self { other.multiplicative_inverse() * self } + + #[inline] + fn _neg(self) -> Self { self } + + fn multiplicative_inverse(self) -> Self { + // Unlike in the GF1024 case we don't bother being generic over + // arbitrary values of POLYNOMIAL, since doing so means a ton + // of extra work for everybody (me, the reviewer, and the CPU + // that has to do a bunch of mulitplications by values that + // turn out to always be 0). + debug_assert_eq!(Self::POLYNOMIAL, Self::new([Fe32::P, Fe32::P, Fe32::Q])); + // Aliases to make the below equations easier to read + let a0 = self.inner[0]; + let a1 = self.inner[1]; + let a2 = self.inner[2]; + + let a0_2 = a0 * a0; + let a1_2 = a1 * a1; + let a2_2 = a2 * a2; + + let a0a1 = a0 * a1; + let a0a2 = a0 * a2; + let a1a2 = a1 * a2; + + // Inverse of the 3x3 multiplication matrix defined by a0, a1, a2. + let det = (a0_2 * a0) + a1_2 * (a0 + a1) + a2_2 * (a0 + a1 + a2) + (a0 * a1a2); + Self::new([ + (a0_2 + a1_2 + a2_2 + a1a2) / det, + (a2_2 + a0a1) / det, + (a1_2 + a2_2 + a0a2) / det, + ]) + } +} +super::impl_ops_for_fe!(impl for Fe32768); + +impl ExtensionField for Fe32768 { + type BaseField = Fe32; + + const DEGREE: usize = 3; + + // Arbitrary irreducible polynomial x^3 = x + 1 + const POLYNOMIAL: Self = Self::new([Fe32::P, Fe32::P, Fe32::Q]); + + /// The element zeta such that the extension field is defined as `GF32[zeta]`. + /// + /// Alternately, the image of x in the mapping `GF32[x]/p(x) -> ` + const EXT_ELEM: Self = Self::new([Fe32::Q, Fe32::P, Fe32::Q]); +} + #[cfg(test)] mod tests { use super::*; @@ -269,4 +358,37 @@ mod tests { assert_eq!(elem.powi(3).multiplicative_order(), 341); assert_eq!(elem.powi(341).multiplicative_order(), 3); } + + #[test] + fn gf32768_mult_inverse() { + assert_eq!(Fe32768::ONE.multiplicative_inverse(), Fe32768::ONE); + + for i in 0..32 { + for j in 0..32 { + for k in 0..32 { + if i != 0 || j != 0 || k != 0 { + let fe32768 = Fe32768::new([Fe32(i), Fe32(j), Fe32(k)]); + assert_eq!( + fe32768.multiplicative_inverse().multiplicative_inverse(), + fe32768, + ); + } + } + } + } + } + + #[test] + fn gf32768_powi() { + // A "random" element + let elem = Fe32768::new([Fe32::A, Fe32::C, Fe32::Q]); + assert_eq!(elem.powi(2), elem * elem); + assert_eq!(elem.powi(3), elem * elem * elem); + assert_eq!(elem.powi(0), Fe32768::ONE); + assert_eq!(elem.powi(-1), elem.multiplicative_inverse()); + + assert_eq!(elem.multiplicative_order(), 32767); + assert_eq!(elem.powi(7).multiplicative_order(), 4681); + assert_eq!(elem.powi(341).multiplicative_order(), 1057); + } }