pub struct Binary<R: EuclideanRing> { /* private fields */ }Expand description
Binary field structure for the field GF(2^m) that contains the XOR ring
and irreducible value.
See crate::gf::binary for the full example.
Implementations§
Trait Implementations§
Source§impl<R: EuclideanRing> Field for Binary<R>
impl<R: EuclideanRing> Field for Binary<R>
Source§type Item = <R as EuclideanRing>::Item
type Item = <R as EuclideanRing>::Item
The type of the field elements.
Source§fn one(&self) -> Self::Item
fn one(&self) -> Self::Item
Get the one element of the field (the identity by multiplication).
Source§fn eq(&self, a: &Self::Item, b: &Self::Item) -> bool
fn eq(&self, a: &Self::Item, b: &Self::Item) -> bool
Perform the equity operation in the field.
Source§fn add(&self, a: &Self::Item, b: &Self::Item) -> Self::Item
fn add(&self, a: &Self::Item, b: &Self::Item) -> Self::Item
Perform addition operation in the field.
Source§fn sub(&self, a: &Self::Item, b: &Self::Item) -> Self::Item
fn sub(&self, a: &Self::Item, b: &Self::Item) -> Self::Item
Perform
sub operation. By default it is implemented through
add and neg but it can be overridden for optimization purposes.Source§fn mul(&self, a: &Self::Item, b: &Self::Item) -> Self::Item
fn mul(&self, a: &Self::Item, b: &Self::Item) -> Self::Item
Perform multiplication operation in the field.
Source§fn add_assign(&self, a: &mut Self::Item, b: &Self::Item)
fn add_assign(&self, a: &mut Self::Item, b: &Self::Item)
Perform
add_assign operation. By default it is implemented through
add but it can be overridden for optimization purposes.Source§fn sub_assign(&self, a: &mut Self::Item, b: &Self::Item)
fn sub_assign(&self, a: &mut Self::Item, b: &Self::Item)
Perform
sub_assign operation. By default it is implemented through
sub but it can be overridden for optimization purposes.Source§fn neg_assign(&self, a: &mut Self::Item)
fn neg_assign(&self, a: &mut Self::Item)
Perform
neg_assign operation. By default it is implemented through
neg but it can be overridden for optimization purposes.Source§fn mul_scalar<I>(&self, a: &Self::Item, bits_iter: I) -> Self::Item
fn mul_scalar<I>(&self, a: &Self::Item, bits_iter: I) -> Self::Item
Perform multiplication in the group by a scalar given as an iterator
of bits according to the double and add algorithm.
Source§fn pow_scalar<I>(&self, a: &Self::Item, bits_iter: I) -> Self::Item
fn pow_scalar<I>(&self, a: &Self::Item, bits_iter: I) -> Self::Item
Perform multiplication in the group by a scalar given as an iterator
of bits according to the exponentiation by squaring algorithm.
Source§fn div(&self, a: &Self::Item, b: &Self::Item) -> Option<Self::Item>
fn div(&self, a: &Self::Item, b: &Self::Item) -> Option<Self::Item>
Perform
div operation. By default it is implemented through
mul and inv but it can be overridden for optimization purposes.Source§fn mul_assign(&self, a: &mut Self::Item, b: &Self::Item)
fn mul_assign(&self, a: &mut Self::Item, b: &Self::Item)
Perform
mul_assign operation. By default it is implemented through
mul but it can be overridden for optimization purposes.Source§fn div_assign(&self, a: &mut Self::Item, b: &Self::Item) -> Option<()>
fn div_assign(&self, a: &mut Self::Item, b: &Self::Item) -> Option<()>
Perform
div_assign operation. By default it is implemented through
div but it can be overridden for optimization purposes.Source§fn inv_assign(&self, a: &mut Self::Item) -> Option<()>
fn inv_assign(&self, a: &mut Self::Item) -> Option<()>
Perform
inv_assign operation. By default it is implemented through
inv but it can be overridden for optimization purposes.Source§fn mul_scalar_assign<I>(&self, a: &mut Self::Item, bits_iter: I)
fn mul_scalar_assign<I>(&self, a: &mut Self::Item, bits_iter: I)
Perform
through
mul_scalar_assign operation. By default it is implementedthrough
mul_scalar but it can be overridden for optimization purposes.Source§fn pow_scalar_assign<I>(&self, a: &mut Self::Item, bits_iter: I)
fn pow_scalar_assign<I>(&self, a: &mut Self::Item, bits_iter: I)
Perform
through
pow_scalar_assign operation. By default it is implementedthrough
pow_scalar but it can be overridden for optimization purposes.Source§fn as_add_group(&self) -> FieldAddGroup<'_, Self>
fn as_add_group(&self) -> FieldAddGroup<'_, Self>
Represent the field as a group by addition.
Source§fn as_mul_group(&self) -> FieldMulGroup<'_, Self>
fn as_mul_group(&self) -> FieldMulGroup<'_, Self>
Represent the field as a group by multiplication.
Auto Trait Implementations§
impl<R> Freeze for Binary<R>
impl<R> RefUnwindSafe for Binary<R>
impl<R> Send for Binary<R>
impl<R> Sync for Binary<R>
impl<R> Unpin for Binary<R>
impl<R> UnwindSafe for Binary<R>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more