pub struct Gf2(/* private fields */);Expand description
The prime field GF(2) = {0, 1}, with addition given by XOR and multiplication by AND.
This is the base case of the characteristic-2 tower GF(2) ⊂ GF(4) ⊂ … ⊂ GF(2^128).
The serde encoding is canonical: every field element has exactly one valid byte
representation (see the manual Deserialize impl below). #[serde(transparent)] makes the
derived Serialize emit the backing integer itself, which is what that impl reads back.
Implementations§
Trait Implementations§
Source§impl Add<BinaryField2> for Gf2
impl Add<BinaryField2> for Gf2
Source§type Output = BinaryField2
type Output = BinaryField2
+ operator.Source§impl Add<BinaryField4> for Gf2
impl Add<BinaryField4> for Gf2
Source§type Output = BinaryField4
type Output = BinaryField4
+ operator.Source§impl Add<BinaryField8> for Gf2
impl Add<BinaryField8> for Gf2
Source§type Output = BinaryField8
type Output = BinaryField8
+ operator.Source§impl Add<BinaryField16> for Gf2
impl Add<BinaryField16> for Gf2
Source§type Output = BinaryField16
type Output = BinaryField16
+ operator.Source§impl Add<BinaryField32> for Gf2
impl Add<BinaryField32> for Gf2
Source§type Output = BinaryField32
type Output = BinaryField32
+ operator.Source§impl Add<BinaryField64> for Gf2
impl Add<BinaryField64> for Gf2
Source§type Output = BinaryField64
type Output = BinaryField64
+ operator.Source§impl Add<BinaryField128> for Gf2
impl Add<BinaryField128> for Gf2
Source§type Output = BinaryField128
type Output = BinaryField128
+ operator.Source§impl Add<Gf2> for Rijndael8b
impl Add<Gf2> for Rijndael8b
Source§impl Add<Gf2> for BinaryField2
impl Add<Gf2> for BinaryField2
Source§impl Add<Gf2> for BinaryField4
impl Add<Gf2> for BinaryField4
Source§impl Add<Gf2> for BinaryField8
impl Add<Gf2> for BinaryField8
Source§impl Add<Gf2> for BinaryField16
impl Add<Gf2> for BinaryField16
Source§impl Add<Gf2> for BinaryField32
impl Add<Gf2> for BinaryField32
Source§impl Add<Gf2> for BinaryField64
impl Add<Gf2> for BinaryField64
Source§impl Add<Gf2> for BinaryField128
impl Add<Gf2> for BinaryField128
Source§impl Add<Rijndael8b> for Gf2
impl Add<Rijndael8b> for Gf2
Source§type Output = Rijndael8b
type Output = Rijndael8b
+ operator.Source§impl<T: Into<Self>> AddAssign<T> for Gf2
impl<T: Into<Self>> AddAssign<T> for Gf2
Source§fn add_assign(&mut self, rhs: T)
fn add_assign(&mut self, rhs: T)
+= operation. Read moreSource§impl<const N: usize> Algebra<Gf2> for PackedRijndael8b<N>
impl<const N: usize> Algebra<Gf2> for PackedRijndael8b<N>
Source§fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
Source§fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
Source§const BATCHED_LC_CHUNK: usize = 8
const BATCHED_LC_CHUNK: usize = 8
batched_linear_combination. Read moreSource§impl Algebra<Gf2> for Rijndael8b
impl Algebra<Gf2> for Rijndael8b
Source§fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
Source§fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
Source§const BATCHED_LC_CHUNK: usize = 8
const BATCHED_LC_CHUNK: usize = 8
batched_linear_combination. Read moreSource§impl<U: Underlier> Algebra<Gf2> for PackedGf2<U>
impl<U: Underlier> Algebra<Gf2> for PackedGf2<U>
Source§fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
Source§fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
Source§const BATCHED_LC_CHUNK: usize = 8
const BATCHED_LC_CHUNK: usize = 8
batched_linear_combination. Read moreSource§impl Algebra<Gf2> for Ghash128
impl Algebra<Gf2> for Ghash128
Source§fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
Source§fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
Source§const BATCHED_LC_CHUNK: usize = 8
const BATCHED_LC_CHUNK: usize = 8
batched_linear_combination. Read moreSource§impl Algebra<Gf2> for Poly192
impl Algebra<Gf2> for Poly192
Source§fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
Source§fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
Source§const BATCHED_LC_CHUNK: usize = 8
const BATCHED_LC_CHUNK: usize = 8
batched_linear_combination. Read moreSource§impl Algebra<Gf2> for Poly64
impl Algebra<Gf2> for Poly64
Source§fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
Source§fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
Source§const BATCHED_LC_CHUNK: usize = 8
const BATCHED_LC_CHUNK: usize = 8
batched_linear_combination. Read moreSource§impl Algebra<Gf2> for BinaryField2
impl Algebra<Gf2> for BinaryField2
Source§fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
Source§fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
Source§const BATCHED_LC_CHUNK: usize = 8
const BATCHED_LC_CHUNK: usize = 8
batched_linear_combination. Read moreSource§impl Algebra<Gf2> for BinaryField4
impl Algebra<Gf2> for BinaryField4
Source§fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
Source§fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
Source§const BATCHED_LC_CHUNK: usize = 8
const BATCHED_LC_CHUNK: usize = 8
batched_linear_combination. Read moreSource§impl Algebra<Gf2> for BinaryField8
impl Algebra<Gf2> for BinaryField8
Source§fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
Source§fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
Source§const BATCHED_LC_CHUNK: usize = 8
const BATCHED_LC_CHUNK: usize = 8
batched_linear_combination. Read moreSource§impl Algebra<Gf2> for BinaryField16
impl Algebra<Gf2> for BinaryField16
Source§fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
Source§fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
Source§const BATCHED_LC_CHUNK: usize = 8
const BATCHED_LC_CHUNK: usize = 8
batched_linear_combination. Read moreSource§impl Algebra<Gf2> for BinaryField32
impl Algebra<Gf2> for BinaryField32
Source§fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
Source§fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
Source§const BATCHED_LC_CHUNK: usize = 8
const BATCHED_LC_CHUNK: usize = 8
batched_linear_combination. Read moreSource§impl Algebra<Gf2> for BinaryField64
impl Algebra<Gf2> for BinaryField64
Source§fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
Source§fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
Source§const BATCHED_LC_CHUNK: usize = 8
const BATCHED_LC_CHUNK: usize = 8
batched_linear_combination. Read moreSource§impl Algebra<Gf2> for BinaryField128
impl Algebra<Gf2> for BinaryField128
Source§fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
Source§fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
Source§const BATCHED_LC_CHUNK: usize = 8
const BATCHED_LC_CHUNK: usize = 8
batched_linear_combination. Read moreimpl Copy for Gf2
Source§impl<'de> Deserialize<'de> for Gf2
impl<'de> Deserialize<'de> for Gf2
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Source§impl Distribution<Gf2> for StandardUniform
impl Distribution<Gf2> for StandardUniform
Source§impl DivAssign for Gf2
impl DivAssign for Gf2
Source§fn div_assign(&mut self, rhs: Gf2)
fn div_assign(&mut self, rhs: Gf2)
/= operation. Read moreSource§impl<U: Underlier> DivAssign<Gf2> for PackedGf2<U>
impl<U: Underlier> DivAssign<Gf2> for PackedGf2<U>
Source§fn div_assign(&mut self, rhs: Gf2)
fn div_assign(&mut self, rhs: Gf2)
/= operation. Read moreimpl Eq for Gf2
Source§impl Field for Gf2
impl Field for Gf2
Source§type Packing = Gf2
type Packing = Gf2
No packing: the packed-value contract needs a cast to an array of WIDTH scalars.
Eight elements are eight bytes as scalars and one byte bit-sliced, so that cast lies.
The bit-sliced packings therefore live beside this type rather than inside it.
Source§fn bits() -> usize
fn bits() -> usize
An element of GF(2) is exactly one bit wide.
The default implementation returns order().bits(), which over-reports by one whenever
the order is an exact power of two.
Source§fn interpolation_node(i: usize) -> Self
fn interpolation_node(i: usize) -> Self
The enumeration interpolation_node(0) = 0, interpolation_node(1) = 1 is the only
injective enumeration of the two elements of GF(2) satisfying Field::interpolation_node’s
contract.
§Panics
Panics if i > 1. new keeps only the low bit, so a larger index would otherwise alias
one of the two nodes and break an interpolation argument silently.
Source§fn try_inverse(&self) -> Option<Self>
fn try_inverse(&self) -> Option<Self>
Source§fn try_sqrt(&self) -> Option<Self>
fn try_sqrt(&self) -> Option<Self>
Source§const BENEFITS_FROM_LOCKSTEP_EVALUATION: bool = false
const BENEFITS_FROM_LOCKSTEP_EVALUATION: bool = false
Source§fn is_zero(&self) -> bool
fn is_zero(&self) -> bool
Source§fn is_one(&self) -> bool
fn is_one(&self) -> bool
Source§fn add_slices(slice_1: &mut [Self], slice_2: &[Self])
fn add_slices(slice_1: &mut [Self], slice_2: &[Self])
Source§fn batched_columnwise_dot_product<EF, R, I, const N: usize>(
acc: &mut [<EF as ExtensionField<Self>>::ExtensionPacking],
items: I,
)where
EF: ExtensionField<Self>,
R: Iterator<Item = Self::Packing>,
I: Iterator<Item = (R, [EF; N])>,
fn batched_columnwise_dot_product<EF, R, I, const N: usize>(
acc: &mut [<EF as ExtensionField<Self>>::ExtensionPacking],
items: I,
)where
EF: ExtensionField<Self>,
R: Iterator<Item = Self::Packing>,
I: Iterator<Item = (R, [EF; N])>,
acc[c * N + j] += scales[j] * row[c] over a stream of packed rows. Read moreSource§impl From<Gf2> for Rijndael8b
impl From<Gf2> for Rijndael8b
Source§impl From<Gf2> for BinaryField2
impl From<Gf2> for BinaryField2
Source§impl From<Gf2> for BinaryField4
impl From<Gf2> for BinaryField4
Source§impl From<Gf2> for BinaryField8
impl From<Gf2> for BinaryField8
Source§impl From<Gf2> for BinaryField16
impl From<Gf2> for BinaryField16
Source§impl From<Gf2> for BinaryField32
impl From<Gf2> for BinaryField32
Source§impl From<Gf2> for BinaryField64
impl From<Gf2> for BinaryField64
Source§impl From<Gf2> for BinaryField128
impl From<Gf2> for BinaryField128
Source§impl Mul<BinaryField2> for Gf2
impl Mul<BinaryField2> for Gf2
Source§type Output = BinaryField2
type Output = BinaryField2
* operator.Source§fn mul(self, rhs: BinaryField2) -> BinaryField2
fn mul(self, rhs: BinaryField2) -> BinaryField2
* operation. Read moreSource§impl Mul<BinaryField4> for Gf2
impl Mul<BinaryField4> for Gf2
Source§type Output = BinaryField4
type Output = BinaryField4
* operator.Source§fn mul(self, rhs: BinaryField4) -> BinaryField4
fn mul(self, rhs: BinaryField4) -> BinaryField4
* operation. Read moreSource§impl Mul<BinaryField8> for Gf2
impl Mul<BinaryField8> for Gf2
Source§type Output = BinaryField8
type Output = BinaryField8
* operator.Source§fn mul(self, rhs: BinaryField8) -> BinaryField8
fn mul(self, rhs: BinaryField8) -> BinaryField8
* operation. Read moreSource§impl Mul<BinaryField16> for Gf2
impl Mul<BinaryField16> for Gf2
Source§type Output = BinaryField16
type Output = BinaryField16
* operator.Source§fn mul(self, rhs: BinaryField16) -> BinaryField16
fn mul(self, rhs: BinaryField16) -> BinaryField16
* operation. Read moreSource§impl Mul<BinaryField32> for Gf2
impl Mul<BinaryField32> for Gf2
Source§type Output = BinaryField32
type Output = BinaryField32
* operator.Source§fn mul(self, rhs: BinaryField32) -> BinaryField32
fn mul(self, rhs: BinaryField32) -> BinaryField32
* operation. Read moreSource§impl Mul<BinaryField64> for Gf2
impl Mul<BinaryField64> for Gf2
Source§type Output = BinaryField64
type Output = BinaryField64
* operator.Source§fn mul(self, rhs: BinaryField64) -> BinaryField64
fn mul(self, rhs: BinaryField64) -> BinaryField64
* operation. Read moreSource§impl Mul<BinaryField128> for Gf2
impl Mul<BinaryField128> for Gf2
Source§type Output = BinaryField128
type Output = BinaryField128
* operator.Source§fn mul(self, rhs: BinaryField128) -> BinaryField128
fn mul(self, rhs: BinaryField128) -> BinaryField128
* operation. Read moreSource§impl Mul<Gf2> for Rijndael8b
impl Mul<Gf2> for Rijndael8b
Source§impl Mul<Gf2> for BinaryField2
impl Mul<Gf2> for BinaryField2
Source§impl Mul<Gf2> for BinaryField4
impl Mul<Gf2> for BinaryField4
Source§impl Mul<Gf2> for BinaryField8
impl Mul<Gf2> for BinaryField8
Source§impl Mul<Gf2> for BinaryField16
impl Mul<Gf2> for BinaryField16
Source§impl Mul<Gf2> for BinaryField32
impl Mul<Gf2> for BinaryField32
Source§impl Mul<Gf2> for BinaryField64
impl Mul<Gf2> for BinaryField64
Source§impl Mul<Gf2> for BinaryField128
impl Mul<Gf2> for BinaryField128
Source§impl Mul<Rijndael8b> for Gf2
impl Mul<Rijndael8b> for Gf2
Source§type Output = Rijndael8b
type Output = Rijndael8b
* operator.Source§impl<T: Into<Self>> MulAssign<T> for Gf2
impl<T: Into<Self>> MulAssign<T> for Gf2
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
*= operation. Read moreSource§impl Ord for Gf2
impl Ord for Gf2
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
impl Packable for Gf2
Source§impl PartialOrd for Gf2
impl PartialOrd for Gf2
Source§impl PrimeCharacteristicRing for Gf2
impl PrimeCharacteristicRing for Gf2
Source§fn div_2exp_u64(&self, _exp: u64) -> Self
fn div_2exp_u64(&self, _exp: u64) -> Self
§Panics
Always panics: 2 is not invertible in characteristic 2.
Source§type PrimeSubfield = Gf2
type PrimeSubfield = Gf2
ℤ/p where the characteristic of this ring is p.Source§fn from_prime_subfield(f: Self::PrimeSubfield) -> Self
fn from_prime_subfield(f: Self::PrimeSubfield) -> Self
Source§fn xor(&self, y: &Self) -> Self
fn xor(&self, y: &Self) -> Self
xor. Read moreSource§fn mul_2exp_u64(&self, exp: u64) -> Self
fn mul_2exp_u64(&self, exp: u64) -> Self
mul_2exp_u64(a, exp) = a * 2^{exp}. Read moreSource§fn from_usize(int: usize) -> Self
fn from_usize(int: usize) -> Self
Source§fn from_isize(int: isize) -> Self
fn from_isize(int: isize) -> Self
Source§fn xor3(&self, y: &Self, z: &Self) -> Self
fn xor3(&self, y: &Self, z: &Self) -> Self
xor. Read moreSource§fn bool_check(&self) -> Self
fn bool_check(&self) -> Self
x * (x - 1). Read moreSource§fn exp_const_u64<const POWER: u64>(&self) -> Self
fn exp_const_u64<const POWER: u64>(&self) -> Self
Source§fn exp_power_of_2(&self, power_log: usize) -> Self
fn exp_power_of_2(&self, power_log: usize) -> Self
exp_power_of_2(a, power_log) = a^{2^power_log}. Read moreSource§fn powers(&self) -> Powers<Self> ⓘ
fn powers(&self) -> Powers<Self> ⓘ
self: self^0, self^1, self^2, ....Source§fn shifted_powers(&self, start: Self) -> Powers<Self> ⓘ
fn shifted_powers(&self, start: Self) -> Powers<Self> ⓘ
self shifted by start: start, start*self^1, start*self^2, ....Source§fn dot_product<const N: usize>(u: &[Self; N], v: &[Self; N]) -> Self
fn dot_product<const N: usize>(u: &[Self; N], v: &[Self; N]) -> Self
Source§fn sum_array<const N: usize>(input: &[Self]) -> Self
fn sum_array<const N: usize>(input: &[Self]) -> Self
Source§fn zero_vec(len: usize) -> Vec<Self>
fn zero_vec(len: usize) -> Vec<Self>
len. Many operating systems zero pages
before assigning them to a userspace process. In that case, our process should not need to
write zeros, which would be redundant. However, the compiler may not always recognize this. Read moreSource§impl PrimeField for Gf2
impl PrimeField for Gf2
Source§fn as_canonical_biguint(&self) -> BigUint
fn as_canonical_biguint(&self) -> BigUint
value in canonical form
which lies in the range 0 <= x < self.order().Source§impl PrimeField32 for Gf2
impl PrimeField32 for Gf2
const ORDER_U32: u32 = 2
Source§fn as_canonical_u32(&self) -> u32
fn as_canonical_u32(&self) -> u32
value in canonical form
which lies in the range 0 <= x < ORDER_U64.Source§fn to_unique_u32(&self) -> u32
fn to_unique_u32(&self) -> u32
u32 such that any two field elements
are converted to the same u32 if and only if they represent the same value. Read moreSource§impl PrimeField64 for Gf2
impl PrimeField64 for Gf2
const ORDER_U64: u64 = 2
Source§fn as_canonical_u64(&self) -> u64
fn as_canonical_u64(&self) -> u64
value in canonical form
which lies in the range 0 <= x < ORDER_U64.Source§fn to_unique_u64(&self) -> u64
fn to_unique_u64(&self) -> u64
u64 such that any two field elements
are converted to the same u64 if and only if they represent the same value. Read moreSource§impl QuotientMap<i8> for Gf2
impl QuotientMap<i8> for Gf2
Source§fn from_canonical_checked(int: i8) -> Option<Self>
fn from_canonical_checked(int: i8) -> Option<Self>
Convert a given i8 integer into an element of the Gf2 field.
Returns None if the input does not lie in the range [0, 1].
Source§unsafe fn from_canonical_unchecked(int: i8) -> Self
unsafe fn from_canonical_unchecked(int: i8) -> Self
Convert a given i8 integer into an element of the Gf2 field.
§Safety
The caller must guarantee that int lies in [0, 1].
Source§impl QuotientMap<i16> for Gf2
impl QuotientMap<i16> for Gf2
Source§fn from_int(int: i16) -> Gf2
fn from_int(int: i16) -> Gf2
Convert a given i16 integer into an element of the Gf2 field.
This checks the sign and then makes use of the equivalent method for unsigned integers. This should be avoided in performance critical locations.
Source§impl QuotientMap<i32> for Gf2
impl QuotientMap<i32> for Gf2
Source§fn from_int(int: i32) -> Gf2
fn from_int(int: i32) -> Gf2
Convert a given i32 integer into an element of the Gf2 field.
This checks the sign and then makes use of the equivalent method for unsigned integers. This should be avoided in performance critical locations.
Source§impl QuotientMap<i64> for Gf2
impl QuotientMap<i64> for Gf2
Source§fn from_int(int: i64) -> Gf2
fn from_int(int: i64) -> Gf2
Convert a given i64 integer into an element of the Gf2 field.
This checks the sign and then makes use of the equivalent method for unsigned integers. This should be avoided in performance critical locations.
Source§impl QuotientMap<i128> for Gf2
impl QuotientMap<i128> for Gf2
Source§fn from_int(int: i128) -> Gf2
fn from_int(int: i128) -> Gf2
Convert a given i128 integer into an element of the Gf2 field.
This checks the sign and then makes use of the equivalent method for unsigned integers. This should be avoided in performance critical locations.
Source§impl QuotientMap<u8> for Gf2
impl QuotientMap<u8> for Gf2
Source§fn from_canonical_checked(int: u8) -> Option<Self>
fn from_canonical_checked(int: u8) -> Option<Self>
Convert a given u8 integer into an element of the Gf2 field.
Returns None if the input does not lie in the range [0, 1].
Source§unsafe fn from_canonical_unchecked(int: u8) -> Self
unsafe fn from_canonical_unchecked(int: u8) -> Self
Convert a given u8 integer into an element of the Gf2 field.
§Safety
The caller must guarantee that int < 2.
Source§impl QuotientMap<u16> for Gf2
impl QuotientMap<u16> for Gf2
Source§fn from_int(int: u16) -> Gf2
fn from_int(int: u16) -> Gf2
Convert a given u16 integer into an element of the Gf2 field.
Uses a modular reduction to reduce to canonical form. This should be avoided in performance critical locations.
Source§impl QuotientMap<u32> for Gf2
impl QuotientMap<u32> for Gf2
Source§fn from_int(int: u32) -> Gf2
fn from_int(int: u32) -> Gf2
Convert a given u32 integer into an element of the Gf2 field.
Uses a modular reduction to reduce to canonical form. This should be avoided in performance critical locations.
Source§impl QuotientMap<u64> for Gf2
impl QuotientMap<u64> for Gf2
Source§fn from_int(int: u64) -> Gf2
fn from_int(int: u64) -> Gf2
Convert a given u64 integer into an element of the Gf2 field.
Uses a modular reduction to reduce to canonical form. This should be avoided in performance critical locations.
Source§impl QuotientMap<u128> for Gf2
impl QuotientMap<u128> for Gf2
Source§fn from_int(int: u128) -> Gf2
fn from_int(int: u128) -> Gf2
Convert a given u128 integer into an element of the Gf2 field.
Uses a modular reduction to reduce to canonical form. This should be avoided in performance critical locations.
Source§impl RawDataSerializable for Gf2
impl RawDataSerializable for Gf2
Source§const NUM_BYTES: usize = 1
const NUM_BYTES: usize = 1
Source§fn into_bytes(self) -> impl IntoIterator<Item = u8>
fn into_bytes(self) -> impl IntoIterator<Item = u8>
Source§fn into_byte_stream(
input: impl IntoIterator<Item = Self>,
) -> impl IntoIterator<Item = u8>
fn into_byte_stream( input: impl IntoIterator<Item = Self>, ) -> impl IntoIterator<Item = u8>
Source§fn into_u32_stream(
input: impl IntoIterator<Item = Self>,
) -> impl IntoIterator<Item = u32>
fn into_u32_stream( input: impl IntoIterator<Item = Self>, ) -> impl IntoIterator<Item = u32>
Source§fn into_u64_stream(
input: impl IntoIterator<Item = Self>,
) -> impl IntoIterator<Item = u64>
fn into_u64_stream( input: impl IntoIterator<Item = Self>, ) -> impl IntoIterator<Item = u64>
Source§fn into_parallel_byte_streams<const N: usize>(
input: impl IntoIterator<Item = [Self; N]>,
) -> impl IntoIterator<Item = [u8; N]>
fn into_parallel_byte_streams<const N: usize>( input: impl IntoIterator<Item = [Self; N]>, ) -> impl IntoIterator<Item = [u8; N]>
Source§fn into_parallel_u32_streams<const N: usize>(
input: impl IntoIterator<Item = [Self; N]>,
) -> impl IntoIterator<Item = [u32; N]>
fn into_parallel_u32_streams<const N: usize>( input: impl IntoIterator<Item = [Self; N]>, ) -> impl IntoIterator<Item = [u32; N]>
Source§fn into_parallel_u64_streams<const N: usize>(
input: impl IntoIterator<Item = [Self; N]>,
) -> impl IntoIterator<Item = [u64; N]>
fn into_parallel_u64_streams<const N: usize>( input: impl IntoIterator<Item = [Self; N]>, ) -> impl IntoIterator<Item = [u64; N]>
impl StructuralPartialEq for Gf2
Source§impl Sub<BinaryField2> for Gf2
impl Sub<BinaryField2> for Gf2
Source§type Output = BinaryField2
type Output = BinaryField2
- operator.Source§impl Sub<BinaryField4> for Gf2
impl Sub<BinaryField4> for Gf2
Source§type Output = BinaryField4
type Output = BinaryField4
- operator.Source§impl Sub<BinaryField8> for Gf2
impl Sub<BinaryField8> for Gf2
Source§type Output = BinaryField8
type Output = BinaryField8
- operator.Source§impl Sub<BinaryField16> for Gf2
impl Sub<BinaryField16> for Gf2
Source§type Output = BinaryField16
type Output = BinaryField16
- operator.Source§impl Sub<BinaryField32> for Gf2
impl Sub<BinaryField32> for Gf2
Source§type Output = BinaryField32
type Output = BinaryField32
- operator.Source§impl Sub<BinaryField64> for Gf2
impl Sub<BinaryField64> for Gf2
Source§type Output = BinaryField64
type Output = BinaryField64
- operator.Source§impl Sub<BinaryField128> for Gf2
impl Sub<BinaryField128> for Gf2
Source§type Output = BinaryField128
type Output = BinaryField128
- operator.Source§impl Sub<Gf2> for Rijndael8b
impl Sub<Gf2> for Rijndael8b
Source§impl Sub<Gf2> for BinaryField2
impl Sub<Gf2> for BinaryField2
Source§impl Sub<Gf2> for BinaryField4
impl Sub<Gf2> for BinaryField4
Source§impl Sub<Gf2> for BinaryField8
impl Sub<Gf2> for BinaryField8
Source§impl Sub<Gf2> for BinaryField16
impl Sub<Gf2> for BinaryField16
Source§impl Sub<Gf2> for BinaryField32
impl Sub<Gf2> for BinaryField32
Source§impl Sub<Gf2> for BinaryField64
impl Sub<Gf2> for BinaryField64
Source§impl Sub<Gf2> for BinaryField128
impl Sub<Gf2> for BinaryField128
Source§impl Sub<Rijndael8b> for Gf2
impl Sub<Rijndael8b> for Gf2
Source§type Output = Rijndael8b
type Output = Rijndael8b
- operator.Source§impl<T: Into<Self>> SubAssign<T> for Gf2
impl<T: Into<Self>> SubAssign<T> for Gf2
Source§fn sub_assign(&mut self, rhs: T)
fn sub_assign(&mut self, rhs: T)
-= operation. Read moreSource§impl TowerLevel for Gf2
impl TowerLevel for Gf2
Source§fn cantor_basis(i: usize) -> Self
fn cantor_basis(i: usize) -> Self
GF(2) holds only v_0 = 1.
Source§fn from_repr(r: Self::Repr) -> Self
fn from_repr(r: Self::Repr) -> Self
2^LOG_BITS.Source§fn from_le_byte_iter(bytes: impl Iterator<Item = u8>) -> Self
fn from_le_byte_iter(bytes: impl Iterator<Item = u8>) -> Self
RawDataSerializable::NUM_BYTES bytes of a
little-endian byte stream, discarding the bits above 2^LOG_BITS. Read moreAuto Trait Implementations§
impl Freeze for Gf2
impl RefUnwindSafe for Gf2
impl Send for Gf2
impl Sync for Gf2
impl Unpin for Gf2
impl UnsafeUnpin for Gf2
impl UnwindSafe for Gf2
Blanket Implementations§
Source§impl<R> Algebra<R> for Rwhere
R: PrimeCharacteristicRing,
impl<R> Algebra<R> for Rwhere
R: PrimeCharacteristicRing,
Source§fn mixed_dot_product<const N: usize>(a: &[R; N], f: &[R; N]) -> R
fn mixed_dot_product<const N: usize>(a: &[R; N], f: &[R; N]) -> R
Source§fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
fn quadratic_extension_square(a: &[Self; 2], w: F) -> [Self; 2]
Source§const BATCHED_LC_CHUNK: usize = 8
const BATCHED_LC_CHUNK: usize = 8
batched_linear_combination. Read moreSource§impl<F> AlgebraIdentity<F> for Fwhere
F: PrimeCharacteristicRing,
impl<F> AlgebraIdentity<F> for Fwhere
F: PrimeCharacteristicRing,
Source§impl<F> BasedVectorSpace<F> for Fwhere
F: PrimeCharacteristicRing,
impl<F> BasedVectorSpace<F> for Fwhere
F: PrimeCharacteristicRing,
Source§const DIMENSION: usize = 1
const DIMENSION: usize = 1
Source§fn as_basis_coefficients_slice(&self) -> &[F]
fn as_basis_coefficients_slice(&self) -> &[F]
A and uses this to
map an element of A to a slice of DIMENSION F elements. Read moreSource§fn from_basis_coefficients_fn<Fn>(f: Fn) -> F
fn from_basis_coefficients_fn<Fn>(f: Fn) -> F
A and uses this to
map DIMENSION F elements to an element of A. Similar
to core:array::from_fn, the DIMENSION F elements are
given by Fn(0), ..., Fn(DIMENSION - 1) called in that order. Read moreSource§fn from_basis_coefficients_iter<I>(iter: I) -> Option<F>where
I: ExactSizeIterator<Item = F>,
fn from_basis_coefficients_iter<I>(iter: I) -> Option<F>where
I: ExactSizeIterator<Item = F>,
A and uses this to
map DIMENSION F elements to an element of A. Read moreSource§fn flatten_to_base(vec: Vec<F>) -> Vec<F>
fn flatten_to_base(vec: Vec<F>) -> Vec<F>
Source§fn reconstitute_from_base(vec: Vec<F>) -> Vec<F>
fn reconstitute_from_base(vec: Vec<F>) -> Vec<F>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<F> ExtensionField<F> for Fwhere
F: Field,
impl<F> ExtensionField<F> for Fwhere
F: Field,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<F> PackedField for Fwhere
F: Field,
impl<F> PackedField for Fwhere
F: Field,
type Scalar = F
Source§fn packed_powers(base: Self::Scalar) -> Powers<Self> ⓘ
fn packed_powers(base: Self::Scalar) -> Powers<Self> ⓘ
base packed into packed field elements. Read moreSource§impl<F> PackedFieldPow2 for Fwhere
F: Field,
impl<F> PackedFieldPow2 for Fwhere
F: Field,
Source§impl<T> PackedValue for Twhere
T: Packable,
impl<T> PackedValue for Twhere
T: Packable,
Source§fn from_slice(slice: &[<T as PackedValue>::Value]) -> &T
fn from_slice(slice: &[<T as PackedValue>::Value]) -> &T
Source§fn from_slice_mut(slice: &mut [<T as PackedValue>::Value]) -> &mut T
fn from_slice_mut(slice: &mut [<T as PackedValue>::Value]) -> &mut T
Source§fn from_fn<Fn>(f: Fn) -> T
fn from_fn<Fn>(f: Fn) -> T
Source§fn as_slice(&self) -> &[<T as PackedValue>::Value]
fn as_slice(&self) -> &[<T as PackedValue>::Value]
Source§fn as_slice_mut(&mut self) -> &mut [<T as PackedValue>::Value]
fn as_slice_mut(&mut self) -> &mut [<T as PackedValue>::Value]
Source§fn broadcast(value: Self::Value) -> Self
fn broadcast(value: Self::Value) -> Self
Source§fn extract(&self, lane: usize) -> Self::Value
fn extract(&self, lane: usize) -> Self::Value
Source§fn pack_slice(buf: &[Self::Value]) -> &[Self]
fn pack_slice(buf: &[Self::Value]) -> &[Self]
Source§fn pack_slice_mut(buf: &mut [Self::Value]) -> &mut [Self]
fn pack_slice_mut(buf: &mut [Self::Value]) -> &mut [Self]
Source§fn pack_maybe_uninit_slice_mut(
buf: &mut [MaybeUninit<Self::Value>],
) -> &mut [MaybeUninit<Self>]
fn pack_maybe_uninit_slice_mut( buf: &mut [MaybeUninit<Self::Value>], ) -> &mut [MaybeUninit<Self>]
Source§fn pack_slice_with_suffix(buf: &[Self::Value]) -> (&[Self], &[Self::Value])
fn pack_slice_with_suffix(buf: &[Self::Value]) -> (&[Self], &[Self::Value])
Source§fn pack_slice_with_suffix_mut(
buf: &mut [Self::Value],
) -> (&mut [Self], &mut [Self::Value])
fn pack_slice_with_suffix_mut( buf: &mut [Self::Value], ) -> (&mut [Self], &mut [Self::Value])
Source§fn pack_maybe_uninit_slice_with_suffix_mut(
buf: &mut [MaybeUninit<Self::Value>],
) -> (&mut [MaybeUninit<Self>], &mut [MaybeUninit<Self::Value>])
fn pack_maybe_uninit_slice_with_suffix_mut( buf: &mut [MaybeUninit<Self::Value>], ) -> (&mut [MaybeUninit<Self>], &mut [MaybeUninit<Self::Value>])
Source§fn unpack_slice(buf: &[Self]) -> &[Self::Value]
fn unpack_slice(buf: &[Self]) -> &[Self::Value]
Source§fn pack_columns_fn<const N: usize>(
row_fn: impl Fn(usize) -> [Self::Value; N],
) -> [Self; N]
fn pack_columns_fn<const N: usize>( row_fn: impl Fn(usize) -> [Self::Value; N], ) -> [Self; N]
Source§impl<F> QuotientMap<isize> for Fwhere
F: QuotientMap<i8> + QuotientMap<i16> + QuotientMap<i32> + QuotientMap<i64> + QuotientMap<i128>,
impl<F> QuotientMap<isize> for Fwhere
F: QuotientMap<i8> + QuotientMap<i16> + QuotientMap<i32> + QuotientMap<i64> + QuotientMap<i128>,
Source§fn from_int(int: isize) -> F
fn from_int(int: isize) -> F
We use the from_int method of the primitive integer type identical to isize on this machine
Source§fn from_canonical_checked(int: isize) -> Option<F>
fn from_canonical_checked(int: isize) -> Option<F>
We use the from_canonical_checked method of the primitive integer type identical to isize on this machine
Source§unsafe fn from_canonical_unchecked(int: isize) -> F
unsafe fn from_canonical_unchecked(int: isize) -> F
We use the from_canonical_unchecked method of the primitive integer type identical to isize on this machine
Source§impl<F> QuotientMap<usize> for Fwhere
F: QuotientMap<u8> + QuotientMap<u16> + QuotientMap<u32> + QuotientMap<u64> + QuotientMap<u128>,
impl<F> QuotientMap<usize> for Fwhere
F: QuotientMap<u8> + QuotientMap<u16> + QuotientMap<u32> + QuotientMap<u64> + QuotientMap<u128>,
Source§fn from_int(int: usize) -> F
fn from_int(int: usize) -> F
We use the from_int method of the primitive integer type identical to usize on this machine
Source§fn from_canonical_checked(int: usize) -> Option<F>
fn from_canonical_checked(int: usize) -> Option<F>
We use the from_canonical_checked method of the primitive integer type identical to usize on this machine
Source§unsafe fn from_canonical_unchecked(int: usize) -> F
unsafe fn from_canonical_unchecked(int: usize) -> F
We use the from_canonical_unchecked method of the primitive integer type identical to usize on this machine
Source§impl<T> SpongePaddingValue for Twhere
T: PrimeCharacteristicRing + Copy,
impl<T> SpongePaddingValue for Twhere
T: PrimeCharacteristicRing + Copy,
Source§impl<F> TranscriptField for Fwhere
F: PrimeField64,
impl<F> TranscriptField for Fwhere
F: PrimeField64,
Source§fn algebra_tag(degree: usize, basis: [u8; 32]) -> TypeTag
fn algebra_tag(degree: usize, basis: [u8; 32]) -> TypeTag
degree coefficients over this field.
basis is Keccak-256 of its p3_field::AlgebraIdentity bytes and must be
included unchanged in the returned tag.