Skip to content

Commit cf545e4

Browse files
committed
primitives: add extension field module, define GF1024
Again, strictly adding API surface, not removing anything.
1 parent 8b08535 commit cf545e4

File tree

6 files changed

+535
-0
lines changed

6 files changed

+535
-0
lines changed

api/all-features.txt

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
#[repr(transparent)] pub struct bech32::primitives::gf32::Fe32(_)
2121
impl !core::panic::unwind_safe::RefUnwindSafe for bech32::EncodeIoError
2222
impl !core::panic::unwind_safe::UnwindSafe for bech32::EncodeIoError
23+
impl bech32::primitives::ExtensionField for bech32::primitives::gf32_ext::Fe1024
2324
impl bech32::primitives::Field for bech32::primitives::gf32::Fe32
25+
impl bech32::primitives::Field for bech32::primitives::gf32_ext::Fe1024
2426
impl bech32::primitives::checksum::Checksum for bech32::primitives::Bech32
2527
impl bech32::primitives::checksum::Checksum for bech32::primitives::Bech32m
2628
impl bech32::primitives::checksum::Checksum for bech32::primitives::NoChecksum
@@ -333,28 +335,44 @@ impl core::marker::Unpin for bech32::segwit::EncodeError
333335
impl core::ops::arith::Add for bech32::primitives::gf32::Fe32
334336
impl core::ops::arith::Add<&bech32::primitives::gf32::Fe32> for &bech32::primitives::gf32::Fe32
335337
impl core::ops::arith::Add<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32
338+
impl core::ops::arith::Add<&bech32::primitives::gf32_ext::Fe32Ext<2>> for &bech32::primitives::gf32_ext::Fe1024
339+
impl core::ops::arith::Add<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024
336340
impl core::ops::arith::Add<bech32::primitives::gf32::Fe32> for &bech32::primitives::gf32::Fe32
341+
impl core::ops::arith::Add<bech32::primitives::gf32_ext::Fe32Ext<2>> for &bech32::primitives::gf32_ext::Fe1024
337342
impl core::ops::arith::AddAssign for bech32::primitives::gf32::Fe32
338343
impl core::ops::arith::AddAssign<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32
344+
impl core::ops::arith::AddAssign<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024
339345
impl core::ops::arith::Div for bech32::primitives::gf32::Fe32
340346
impl core::ops::arith::Div<&bech32::primitives::gf32::Fe32> for &bech32::primitives::gf32::Fe32
341347
impl core::ops::arith::Div<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32
348+
impl core::ops::arith::Div<&bech32::primitives::gf32_ext::Fe32Ext<2>> for &bech32::primitives::gf32_ext::Fe1024
349+
impl core::ops::arith::Div<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024
342350
impl core::ops::arith::Div<bech32::primitives::gf32::Fe32> for &bech32::primitives::gf32::Fe32
351+
impl core::ops::arith::Div<bech32::primitives::gf32_ext::Fe32Ext<2>> for &bech32::primitives::gf32_ext::Fe1024
343352
impl core::ops::arith::DivAssign for bech32::primitives::gf32::Fe32
344353
impl core::ops::arith::DivAssign<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32
354+
impl core::ops::arith::DivAssign<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024
345355
impl core::ops::arith::Mul for bech32::primitives::gf32::Fe32
346356
impl core::ops::arith::Mul<&bech32::primitives::gf32::Fe32> for &bech32::primitives::gf32::Fe32
347357
impl core::ops::arith::Mul<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32
358+
impl core::ops::arith::Mul<&bech32::primitives::gf32_ext::Fe32Ext<2>> for &bech32::primitives::gf32_ext::Fe1024
359+
impl core::ops::arith::Mul<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024
348360
impl core::ops::arith::Mul<bech32::primitives::gf32::Fe32> for &bech32::primitives::gf32::Fe32
361+
impl core::ops::arith::Mul<bech32::primitives::gf32_ext::Fe32Ext<2>> for &bech32::primitives::gf32_ext::Fe1024
349362
impl core::ops::arith::MulAssign for bech32::primitives::gf32::Fe32
350363
impl core::ops::arith::MulAssign<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32
364+
impl core::ops::arith::MulAssign<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024
351365
impl core::ops::arith::Neg for bech32::primitives::gf32::Fe32
352366
impl core::ops::arith::Sub for bech32::primitives::gf32::Fe32
353367
impl core::ops::arith::Sub<&bech32::primitives::gf32::Fe32> for &bech32::primitives::gf32::Fe32
354368
impl core::ops::arith::Sub<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32
369+
impl core::ops::arith::Sub<&bech32::primitives::gf32_ext::Fe32Ext<2>> for &bech32::primitives::gf32_ext::Fe1024
370+
impl core::ops::arith::Sub<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024
355371
impl core::ops::arith::Sub<bech32::primitives::gf32::Fe32> for &bech32::primitives::gf32::Fe32
372+
impl core::ops::arith::Sub<bech32::primitives::gf32_ext::Fe32Ext<2>> for &bech32::primitives::gf32_ext::Fe1024
356373
impl core::ops::arith::SubAssign for bech32::primitives::gf32::Fe32
357374
impl core::ops::arith::SubAssign<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32::Fe32
375+
impl core::ops::arith::SubAssign<&bech32::primitives::gf32_ext::Fe32Ext<2>> for bech32::primitives::gf32_ext::Fe1024
358376
impl core::ops::bit::BitXor for bech32::primitives::checksum::PackedNull
359377
impl core::panic::unwind_safe::RefUnwindSafe for bech32::DecodeError
360378
impl core::panic::unwind_safe::RefUnwindSafe for bech32::EncodeError
@@ -585,6 +603,26 @@ impl<I> core::panic::unwind_safe::RefUnwindSafe for bech32::primitives::iter::Fe
585603
impl<I> core::panic::unwind_safe::UnwindSafe for bech32::primitives::encode::WitnessVersionIter<I> where I: core::panic::unwind_safe::UnwindSafe
586604
impl<I> core::panic::unwind_safe::UnwindSafe for bech32::primitives::iter::BytesToFes<I> where I: core::panic::unwind_safe::UnwindSafe
587605
impl<I> core::panic::unwind_safe::UnwindSafe for bech32::primitives::iter::FesToBytes<I> where I: core::panic::unwind_safe::UnwindSafe
606+
impl<const DEG: usize> bech32::primitives::gf32_ext::Fe32Ext<DEG> where Self: bech32::primitives::ExtensionField
607+
impl<const DEG: usize> core::clone::Clone for bech32::primitives::gf32_ext::Fe32Ext<DEG>
608+
impl<const DEG: usize> core::cmp::Eq for bech32::primitives::gf32_ext::Fe32Ext<DEG>
609+
impl<const DEG: usize> core::cmp::PartialEq for bech32::primitives::gf32_ext::Fe32Ext<DEG>
610+
impl<const DEG: usize> core::convert::From<bech32::primitives::gf32::Fe32> for bech32::primitives::gf32_ext::Fe32Ext<DEG>
611+
impl<const DEG: usize> core::fmt::Debug for bech32::primitives::gf32_ext::Fe32Ext<DEG>
612+
impl<const DEG: usize> core::fmt::Display for bech32::primitives::gf32_ext::Fe32Ext<DEG>
613+
impl<const DEG: usize> core::hash::Hash for bech32::primitives::gf32_ext::Fe32Ext<DEG>
614+
impl<const DEG: usize> core::marker::Copy for bech32::primitives::gf32_ext::Fe32Ext<DEG>
615+
impl<const DEG: usize> core::marker::Freeze for bech32::primitives::gf32_ext::Fe32Ext<DEG>
616+
impl<const DEG: usize> core::marker::Send for bech32::primitives::gf32_ext::Fe32Ext<DEG>
617+
impl<const DEG: usize> core::marker::StructuralPartialEq for bech32::primitives::gf32_ext::Fe32Ext<DEG>
618+
impl<const DEG: usize> core::marker::Sync for bech32::primitives::gf32_ext::Fe32Ext<DEG>
619+
impl<const DEG: usize> core::marker::Unpin for bech32::primitives::gf32_ext::Fe32Ext<DEG>
620+
impl<const DEG: usize> core::ops::arith::Mul<&bech32::primitives::gf32::Fe32> for &bech32::primitives::gf32_ext::Fe32Ext<DEG>
621+
impl<const DEG: usize> core::ops::arith::Mul<&bech32::primitives::gf32::Fe32> for bech32::primitives::gf32_ext::Fe32Ext<DEG>
622+
impl<const DEG: usize> core::ops::arith::Mul<bech32::primitives::gf32::Fe32> for &bech32::primitives::gf32_ext::Fe32Ext<DEG>
623+
impl<const DEG: usize> core::ops::arith::Mul<bech32::primitives::gf32::Fe32> for bech32::primitives::gf32_ext::Fe32Ext<DEG>
624+
impl<const DEG: usize> core::panic::unwind_safe::RefUnwindSafe for bech32::primitives::gf32_ext::Fe32Ext<DEG>
625+
impl<const DEG: usize> core::panic::unwind_safe::UnwindSafe for bech32::primitives::gf32_ext::Fe32Ext<DEG>
588626
pub bech32::DecodeError::Checksum(bech32::primitives::decode::ChecksumError)
589627
pub bech32::DecodeError::Parse(bech32::primitives::decode::UncheckedHrpstringError)
590628
pub bech32::EncodeError::Fmt(core::fmt::Error)
@@ -700,6 +738,14 @@ pub const bech32::primitives::gf32::Fe32::_6: bech32::primitives::gf32::Fe32
700738
pub const bech32::primitives::gf32::Fe32::_7: bech32::primitives::gf32::Fe32
701739
pub const bech32::primitives::gf32::Fe32::_8: bech32::primitives::gf32::Fe32
702740
pub const bech32::primitives::gf32::Fe32::_9: bech32::primitives::gf32::Fe32
741+
pub const bech32::primitives::gf32_ext::Fe1024::DEGREE: usize
742+
pub const bech32::primitives::gf32_ext::Fe1024::EXT_ELEM: Self
743+
pub const bech32::primitives::gf32_ext::Fe1024::GENERATOR: Self
744+
pub const bech32::primitives::gf32_ext::Fe1024::MULTIPLICATIVE_ORDER: usize
745+
pub const bech32::primitives::gf32_ext::Fe1024::MULTIPLICATIVE_ORDER_FACTORS: &'static [usize]
746+
pub const bech32::primitives::gf32_ext::Fe1024::ONE: Self
747+
pub const bech32::primitives::gf32_ext::Fe1024::POLYNOMIAL: Self
748+
pub const bech32::primitives::gf32_ext::Fe1024::ZERO: Self
703749
pub const bech32::primitives::hrp::BC: bech32::primitives::hrp::Hrp
704750
pub const bech32::primitives::hrp::BCRT: bech32::primitives::hrp::Hrp
705751
pub const bech32::primitives::hrp::TB: bech32::primitives::hrp::Hrp
@@ -708,6 +754,7 @@ pub const bech32::primitives::segwit::VERSION_0: bech32::primitives::gf32::Fe32
708754
pub const bech32::primitives::segwit::VERSION_1: bech32::primitives::gf32::Fe32
709755
pub const bech32::segwit::VERSION_0: bech32::primitives::gf32::Fe32
710756
pub const bech32::segwit::VERSION_1: bech32::primitives::gf32::Fe32
757+
pub const fn bech32::primitives::gf32_ext::Fe32Ext<DEG>::new(inner: [bech32::primitives::gf32::Fe32; DEG]) -> Self
711758
pub const fn bech32::primitives::hrp::Hrp::parse_unchecked(hrp: &str) -> Self
712759
pub const u128::ONE: Self
713760
pub const u32::ONE: Self
@@ -726,6 +773,16 @@ pub fn &bech32::primitives::gf32::Fe32::mul(self, other: &bech32::primitives::gf
726773
pub fn &bech32::primitives::gf32::Fe32::mul(self, other: bech32::primitives::gf32::Fe32) -> bech32::primitives::gf32::Fe32
727774
pub fn &bech32::primitives::gf32::Fe32::sub(self, other: &bech32::primitives::gf32::Fe32) -> bech32::primitives::gf32::Fe32
728775
pub fn &bech32::primitives::gf32::Fe32::sub(self, other: bech32::primitives::gf32::Fe32) -> bech32::primitives::gf32::Fe32
776+
pub fn &bech32::primitives::gf32_ext::Fe1024::add(self, other: &bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024
777+
pub fn &bech32::primitives::gf32_ext::Fe1024::add(self, other: bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024
778+
pub fn &bech32::primitives::gf32_ext::Fe1024::div(self, other: &bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024
779+
pub fn &bech32::primitives::gf32_ext::Fe1024::div(self, other: bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024
780+
pub fn &bech32::primitives::gf32_ext::Fe1024::mul(self, other: &bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024
781+
pub fn &bech32::primitives::gf32_ext::Fe1024::mul(self, other: bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024
782+
pub fn &bech32::primitives::gf32_ext::Fe1024::sub(self, other: &bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024
783+
pub fn &bech32::primitives::gf32_ext::Fe1024::sub(self, other: bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024
784+
pub fn &bech32::primitives::gf32_ext::Fe32Ext<DEG>::mul(self, other: &bech32::primitives::gf32::Fe32) -> Self::Output
785+
pub fn &bech32::primitives::gf32_ext::Fe32Ext<DEG>::mul(self, other: bech32::primitives::gf32::Fe32) -> Self::Output
729786
pub fn bech32::ByteIterExt::bytes_to_fes(self) -> bech32::primitives::iter::BytesToFes<Self>
730787
pub fn bech32::Checksum::sanity_check()
731788
pub fn bech32::DecodeError::clone(&self) -> bech32::DecodeError
@@ -948,6 +1005,27 @@ pub fn bech32::primitives::gf32::TryFromError::fmt(&self, f: &mut core::fmt::For
9481005
pub fn bech32::primitives::gf32::TryFromError::from(e: core::num::error::TryFromIntError) -> Self
9491006
pub fn bech32::primitives::gf32::TryFromError::from(i: core::convert::Infallible) -> Self
9501007
pub fn bech32::primitives::gf32::TryFromError::source(&self) -> core::option::Option<&(dyn core::error::Error + 'static)>
1008+
pub fn bech32::primitives::gf32_ext::Fe1024::_add(&self, other: &Self) -> Self
1009+
pub fn bech32::primitives::gf32_ext::Fe1024::_div(&self, other: &Self) -> Self
1010+
pub fn bech32::primitives::gf32_ext::Fe1024::_mul(&self, other: &Self) -> Self
1011+
pub fn bech32::primitives::gf32_ext::Fe1024::_neg(self) -> Self
1012+
pub fn bech32::primitives::gf32_ext::Fe1024::_sub(&self, other: &Self) -> Self
1013+
pub fn bech32::primitives::gf32_ext::Fe1024::add(self, other: &bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024
1014+
pub fn bech32::primitives::gf32_ext::Fe1024::add_assign(&mut self, other: &bech32::primitives::gf32_ext::Fe1024)
1015+
pub fn bech32::primitives::gf32_ext::Fe1024::div(self, other: &bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024
1016+
pub fn bech32::primitives::gf32_ext::Fe1024::div_assign(&mut self, other: &bech32::primitives::gf32_ext::Fe1024)
1017+
pub fn bech32::primitives::gf32_ext::Fe1024::mul(self, other: &bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024
1018+
pub fn bech32::primitives::gf32_ext::Fe1024::mul_assign(&mut self, other: &bech32::primitives::gf32_ext::Fe1024)
1019+
pub fn bech32::primitives::gf32_ext::Fe1024::multiplicative_inverse(self) -> Self
1020+
pub fn bech32::primitives::gf32_ext::Fe1024::sub(self, other: &bech32::primitives::gf32_ext::Fe1024) -> bech32::primitives::gf32_ext::Fe1024
1021+
pub fn bech32::primitives::gf32_ext::Fe1024::sub_assign(&mut self, other: &bech32::primitives::gf32_ext::Fe1024)
1022+
pub fn bech32::primitives::gf32_ext::Fe32Ext<DEG>::clone(&self) -> bech32::primitives::gf32_ext::Fe32Ext<DEG>
1023+
pub fn bech32::primitives::gf32_ext::Fe32Ext<DEG>::eq(&self, other: &bech32::primitives::gf32_ext::Fe32Ext<DEG>) -> bool
1024+
pub fn bech32::primitives::gf32_ext::Fe32Ext<DEG>::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
1025+
pub fn bech32::primitives::gf32_ext::Fe32Ext<DEG>::from(fe: bech32::primitives::gf32::Fe32) -> Self
1026+
pub fn bech32::primitives::gf32_ext::Fe32Ext<DEG>::hash<__H: core::hash::Hasher>(&self, state: &mut __H)
1027+
pub fn bech32::primitives::gf32_ext::Fe32Ext<DEG>::mul(self, other: &bech32::primitives::gf32::Fe32) -> Self::Output
1028+
pub fn bech32::primitives::gf32_ext::Fe32Ext<DEG>::mul(self, other: bech32::primitives::gf32::Fe32) -> Self::Output
9511029
pub fn bech32::primitives::hrp::ByteIter<'b>::len(&self) -> usize
9521030
pub fn bech32::primitives::hrp::ByteIter<'b>::next(&mut self) -> core::option::Option<u8>
9531031
pub fn bech32::primitives::hrp::ByteIter<'b>::next_back(&mut self) -> core::option::Option<Self::Item>
@@ -1057,6 +1135,7 @@ pub mod bech32::primitives::checksum
10571135
pub mod bech32::primitives::decode
10581136
pub mod bech32::primitives::encode
10591137
pub mod bech32::primitives::gf32
1138+
pub mod bech32::primitives::gf32_ext
10601139
pub mod bech32::primitives::hrp
10611140
pub mod bech32::primitives::iter
10621141
pub mod bech32::primitives::segwit
@@ -1076,6 +1155,7 @@ pub struct bech32::primitives::encode::CharIter<'hrp, I, Ck> where I: core::iter
10761155
pub struct bech32::primitives::encode::Encoder<'hrp, I, Ck> where I: core::iter::traits::iterator::Iterator<Item = bech32::primitives::gf32::Fe32>, Ck: bech32::primitives::checksum::Checksum
10771156
pub struct bech32::primitives::encode::Fe32Iter<'hrp, I, Ck> where I: core::iter::traits::iterator::Iterator<Item = bech32::primitives::gf32::Fe32>, Ck: bech32::primitives::checksum::Checksum
10781157
pub struct bech32::primitives::encode::WitnessVersionIter<I> where I: core::iter::traits::iterator::Iterator<Item = bech32::primitives::gf32::Fe32>
1158+
pub struct bech32::primitives::gf32_ext::Fe32Ext<const DEG: usize>
10791159
pub struct bech32::primitives::hrp::ByteIter<'b>
10801160
pub struct bech32::primitives::hrp::CharIter<'b>
10811161
pub struct bech32::primitives::hrp::Hrp
@@ -1094,7 +1174,10 @@ pub trait bech32::primitives::checksum::PackedFe32: core::marker::Copy + core::c
10941174
pub trait bech32::primitives::iter::ByteIterExt: core::marker::Sized + core::iter::traits::iterator::Iterator<Item = u8>
10951175
pub trait bech32::primitives::iter::Fe32IterExt: core::marker::Sized + core::iter::traits::iterator::Iterator<Item = bech32::primitives::gf32::Fe32>
10961176
pub type &bech32::primitives::gf32::Fe32::Output = bech32::primitives::gf32::Fe32
1177+
pub type &bech32::primitives::gf32_ext::Fe1024::Output = bech32::primitives::gf32_ext::Fe32Ext<2>
1178+
pub type &bech32::primitives::gf32_ext::Fe32Ext<DEG>::Output = bech32::primitives::gf32_ext::Fe32Ext<DEG>
10971179
pub type bech32::Checksum::MidstateRepr: bech32::primitives::checksum::PackedFe32
1180+
pub type bech32::Fe1024 = bech32::primitives::gf32_ext::Fe32Ext<2>
10981181
pub type bech32::primitives::Bech32::MidstateRepr = u32
10991182
pub type bech32::primitives::Bech32m::MidstateRepr = u32
11001183
pub type bech32::primitives::ExtensionField::BaseField: bech32::primitives::Field
@@ -1110,6 +1193,10 @@ pub type bech32::primitives::encode::Fe32Iter<'hrp, I, Ck>::Item = bech32::primi
11101193
pub type bech32::primitives::encode::WitnessVersionIter<I>::Item = bech32::primitives::gf32::Fe32
11111194
pub type bech32::primitives::gf32::Fe32::Error = bech32::primitives::gf32::TryFromError
11121195
pub type bech32::primitives::gf32::Fe32::Output = bech32::primitives::gf32::Fe32
1196+
pub type bech32::primitives::gf32_ext::Fe1024 = bech32::primitives::gf32_ext::Fe32Ext<2>
1197+
pub type bech32::primitives::gf32_ext::Fe1024::BaseField = bech32::primitives::gf32::Fe32
1198+
pub type bech32::primitives::gf32_ext::Fe1024::Output = bech32::primitives::gf32_ext::Fe32Ext<2>
1199+
pub type bech32::primitives::gf32_ext::Fe32Ext<DEG>::Output = bech32::primitives::gf32_ext::Fe32Ext<DEG>
11131200
pub type bech32::primitives::hrp::ByteIter<'b>::Item = u8
11141201
pub type bech32::primitives::hrp::CharIter<'b>::Item = char
11151202
pub type bech32::primitives::hrp::LowercaseByteIter<'b>::Item = u8

0 commit comments

Comments
 (0)