pub struct Field<E>where
E: Environment,{ /* private fields */ }
Implementations§
Source§impl<E> Field<E>where
E: Environment,
impl<E> Field<E>where
E: Environment,
Sourcepub fn even_square_root(&self) -> Field<E>
pub fn even_square_root(&self) -> Field<E>
Returns the square root of self
, where the least significant bit of the square root is zero.
Source§impl<E> Field<E>where
E: Environment,
impl<E> Field<E>where
E: Environment,
Sourcepub fn square_roots_flagged_nondeterministic(
&self,
) -> (Field<E>, Field<E>, Boolean<E>)
pub fn square_roots_flagged_nondeterministic( &self, ) -> (Field<E>, Field<E>, Boolean<E>)
Returns both square roots of self
and a Boolean
flag, which is set iff self
is not a square.
If self
is a non-zero square,
- the first field result is the positive root (i.e. closer to 0)
- the second field result is the negative root (i.e. closer to the prime)
- the flag is 0
If self
is 0,
- both field results are 0
- the flag is 0
If self
is not a square,
- both field results are 0
- the flag is 1
Note that the constraints do not impose an ordering on the two roots returned by this function;
this is what the nondeterministic
part of this function name refers to.
Trait Implementations§
Source§impl<E> Add for Field<E>where
E: Environment,
impl<E> Add for Field<E>where
E: Environment,
Source§impl<E> AddAssign<&Field<E>> for Field<E>where
E: Environment,
impl<E> AddAssign<&Field<E>> for Field<E>where
E: Environment,
Source§fn add_assign(&mut self, other: &Field<E>)
fn add_assign(&mut self, other: &Field<E>)
+=
operation. Read moreSource§impl<E> AddAssign for Field<E>where
E: Environment,
impl<E> AddAssign for Field<E>where
E: Environment,
Source§fn add_assign(&mut self, other: Field<E>)
fn add_assign(&mut self, other: Field<E>)
+=
operation. Read moreSource§impl<E, I> Cast<Field<E>> for Integer<E, I>where
E: Environment,
I: IntegerType,
impl<E, I> Cast<Field<E>> for Integer<E, I>where
E: Environment,
I: IntegerType,
Source§impl<E, I> Cast<Integer<E, I>> for Field<E>where
E: Environment,
I: IntegerType,
impl<E, I> Cast<Integer<E, I>> for Field<E>where
E: Environment,
I: IntegerType,
Source§impl<E> Cast for Field<E>where
E: Environment,
impl<E> Cast for Field<E>where
E: Environment,
Source§impl<E> CastLossy<Address<E>> for Field<E>where
E: Environment,
impl<E> CastLossy<Address<E>> for Field<E>where
E: Environment,
Source§fn cast_lossy(&self) -> Address<E>
fn cast_lossy(&self) -> Address<E>
Casts a Field
to an Address
.
This operation attempts to recover the group element from the given field,
which is then used to construct the address. See the documentation of Field::cast_lossy
on the Group
type for more details.
Source§impl<E> CastLossy<Boolean<E>> for Field<E>where
E: Environment,
impl<E> CastLossy<Boolean<E>> for Field<E>where
E: Environment,
Source§fn cast_lossy(&self) -> Boolean<E>
fn cast_lossy(&self) -> Boolean<E>
Casts a Field
to a Boolean
, with lossy truncation.
This operation returns the least significant bit of the field.
Source§impl<E> CastLossy<Field<E>> for Boolean<E>where
E: Environment,
impl<E> CastLossy<Field<E>> for Boolean<E>where
E: Environment,
Source§fn cast_lossy(&self) -> Field<E>
fn cast_lossy(&self) -> Field<E>
Casts a Boolean
to a Field
.
This is safe because casting from a boolean to any other type is always lossless.
Source§impl<E, I> CastLossy<Field<E>> for Integer<E, I>where
E: Environment,
I: IntegerType,
impl<E, I> CastLossy<Field<E>> for Integer<E, I>where
E: Environment,
I: IntegerType,
Source§fn cast_lossy(&self) -> Field<E>
fn cast_lossy(&self) -> Field<E>
Casts an Integer
to a Field
.
This is safe because casting from an integer to a field is always lossless.
Source§impl<E> CastLossy<Field<E>> for Scalar<E>where
E: Environment,
impl<E> CastLossy<Field<E>> for Scalar<E>where
E: Environment,
Source§fn cast_lossy(&self) -> Field<E>
fn cast_lossy(&self) -> Field<E>
Casts a Scalar
to a Field
.
This operation is always lossless.
Source§impl<E> CastLossy<Group<E>> for Field<E>where
E: Environment,
impl<E> CastLossy<Group<E>> for Field<E>where
E: Environment,
Source§fn cast_lossy(&self) -> Group<E>
fn cast_lossy(&self) -> Group<E>
Casts a Field
to a Group
.
This operation attempts to recover the group element from the given field.
If the field is a valid x-coordinate, then the group element is returned. If the field is not a valid x-coordinate, then if the field is the one element, the generator of the prime-order subgroup is returned. Otherwise, Elligator-2 is applied to the field element to recover a group element.
Source§impl<E, I> CastLossy<Integer<E, I>> for Field<E>where
E: Environment,
I: IntegerType,
impl<E, I> CastLossy<Integer<E, I>> for Field<E>where
E: Environment,
I: IntegerType,
Source§fn cast_lossy(&self) -> Integer<E, I>
fn cast_lossy(&self) -> Integer<E, I>
Casts a Field
to an Integer
, with lossy truncation.
This operation truncates the field to an integer.
Source§impl<E> CastLossy<Scalar<E>> for Field<E>where
E: Environment,
impl<E> CastLossy<Scalar<E>> for Field<E>where
E: Environment,
Source§fn cast_lossy(&self) -> Scalar<E>
fn cast_lossy(&self) -> Scalar<E>
Casts a Field
to a Scalar
, with lossy truncation.
This operation truncates the field to a scalar.
Source§impl<E> CastLossy for Field<E>where
E: Environment,
impl<E> CastLossy for Field<E>where
E: Environment,
Source§fn cast_lossy(&self) -> Field<E>
fn cast_lossy(&self) -> Field<E>
Casts a Field
to a Field
.
This is an identity cast, so it is always lossless.
Source§impl<E> Compare for Field<E>where
E: Environment,
impl<E> Compare for Field<E>where
E: Environment,
Source§fn is_less_than(&self, other: &Field<E>) -> <Field<E> as Compare>::Output
fn is_less_than(&self, other: &Field<E>) -> <Field<E> as Compare>::Output
Returns true
if self
is less than other
.
Source§fn is_greater_than(&self, other: &Field<E>) -> <Field<E> as Compare>::Output
fn is_greater_than(&self, other: &Field<E>) -> <Field<E> as Compare>::Output
Returns true
if self
is greater than other
.
Source§fn is_less_than_or_equal(
&self,
other: &Field<E>,
) -> <Field<E> as Compare>::Output
fn is_less_than_or_equal( &self, other: &Field<E>, ) -> <Field<E> as Compare>::Output
Returns true
if self
is less than or equal to other
.
Source§fn is_greater_than_or_equal(
&self,
other: &Field<E>,
) -> <Field<E> as Compare>::Output
fn is_greater_than_or_equal( &self, other: &Field<E>, ) -> <Field<E> as Compare>::Output
Returns true
if self
is greater than or equal to other
.
type Output = Boolean<E>
Source§impl<E> Debug for Field<E>where
E: Environment,
impl<E> Debug for Field<E>where
E: Environment,
Source§impl<E> Default for Field<E>where
E: Environment,
impl<E> Default for Field<E>where
E: Environment,
Source§impl<E> Display for Field<E>where
E: Environment,
impl<E> Display for Field<E>where
E: Environment,
Source§impl<E> Div for Field<E>where
E: Environment,
impl<E> Div for Field<E>where
E: Environment,
Source§impl<E> DivAssign<&Field<E>> for Field<E>where
E: Environment,
impl<E> DivAssign<&Field<E>> for Field<E>where
E: Environment,
Source§fn div_assign(&mut self, other: &Field<E>)
fn div_assign(&mut self, other: &Field<E>)
/=
operation. Read moreSource§impl<E> DivAssign for Field<E>where
E: Environment,
impl<E> DivAssign for Field<E>where
E: Environment,
Source§fn div_assign(&mut self, other: Field<E>)
fn div_assign(&mut self, other: Field<E>)
/=
operation. Read moreSource§impl<E> DivUnchecked for Field<E>where
E: Environment,
impl<E> DivUnchecked for Field<E>where
E: Environment,
Source§impl<E> Double for Field<E>where
E: Environment,
impl<E> Double for Field<E>where
E: Environment,
Source§impl<E> Eject for Field<E>where
E: Environment,
impl<E> Eject for Field<E>where
E: Environment,
Source§fn eject_mode(&self) -> Mode
fn eject_mode(&self) -> Mode
Ejects the mode of the field circuit.
Source§fn eject_value(&self) -> <Field<E> as Eject>::Primitive
fn eject_value(&self) -> <Field<E> as Eject>::Primitive
Ejects the field circuit as a console field.
type Primitive = Field<<E as Environment>::Network>
Source§fn eject(&self) -> (Mode, Self::Primitive)
fn eject(&self) -> (Mode, Self::Primitive)
Source§fn is_constant(&self) -> bool
fn is_constant(&self) -> bool
true
if the circuit is a constant.Source§fn is_private(&self) -> bool
fn is_private(&self) -> bool
true
if the circuit is a private.Source§impl<E> Equal for Field<E>where
E: Environment,
impl<E> Equal for Field<E>where
E: Environment,
Source§fn is_equal(&self, other: &Field<E>) -> <Field<E> as Equal>::Output
fn is_equal(&self, other: &Field<E>) -> <Field<E> as Equal>::Output
Returns true
if self
and other
are equal.
This method costs 2 constraints.
Source§fn is_not_equal(&self, other: &Field<E>) -> <Field<E> as Equal>::Output
fn is_not_equal(&self, other: &Field<E>) -> <Field<E> as Equal>::Output
Returns true
if self
and other
are not equal.
This method constructs a boolean that indicates if
self
and other
are not equal to each other.
This method costs 2 constraints.
type Output = Boolean<E>
Source§impl<E> From<&Field<E>> for LinearCombination<<E as Environment>::BaseField>where
E: Environment,
impl<E> From<&Field<E>> for LinearCombination<<E as Environment>::BaseField>where
E: Environment,
Source§fn from(field: &Field<E>) -> LinearCombination<<E as Environment>::BaseField>
fn from(field: &Field<E>) -> LinearCombination<<E as Environment>::BaseField>
Source§impl<E> From<&LinearCombination<<E as Environment>::BaseField>> for Field<E>where
E: Environment,
impl<E> From<&LinearCombination<<E as Environment>::BaseField>> for Field<E>where
E: Environment,
Source§fn from(
linear_combination: &LinearCombination<<E as Environment>::BaseField>,
) -> Field<E>
fn from( linear_combination: &LinearCombination<<E as Environment>::BaseField>, ) -> Field<E>
Source§impl<E> From<Field<E>> for LinearCombination<<E as Environment>::BaseField>where
E: Environment,
impl<E> From<Field<E>> for LinearCombination<<E as Environment>::BaseField>where
E: Environment,
Source§fn from(field: Field<E>) -> LinearCombination<<E as Environment>::BaseField>
fn from(field: Field<E>) -> LinearCombination<<E as Environment>::BaseField>
Source§impl<E> From<LinearCombination<<E as Environment>::BaseField>> for Field<E>where
E: Environment,
impl<E> From<LinearCombination<<E as Environment>::BaseField>> for Field<E>where
E: Environment,
Source§fn from(
linear_combination: LinearCombination<<E as Environment>::BaseField>,
) -> Field<E>
fn from( linear_combination: LinearCombination<<E as Environment>::BaseField>, ) -> Field<E>
Source§impl<E> FromBits for Field<E>where
E: Environment,
impl<E> FromBits for Field<E>where
E: Environment,
Source§fn from_bits_le(bits_le: &[<Field<E> as FromBits>::Boolean]) -> Field<E>
fn from_bits_le(bits_le: &[<Field<E> as FromBits>::Boolean]) -> Field<E>
Initializes a new base field element from a list of little-endian bits.
- If
bits_le
is longer thanE::BaseField::size_in_bits()
, the excess bits are enforced to be0
s. - If
bits_le
is shorter thanE::BaseField::size_in_bits()
, it is padded with0
s up to base field size.
Source§fn from_bits_be(bits_be: &[<Field<E> as FromBits>::Boolean]) -> Field<E>
fn from_bits_be(bits_be: &[<Field<E> as FromBits>::Boolean]) -> Field<E>
Initializes a new base field element from a list of big-endian bits without leading zeros.
type Boolean = Boolean<E>
Source§impl<E> FromBoolean for Field<E>where
E: Environment,
impl<E> FromBoolean for Field<E>where
E: Environment,
Source§impl<E> FromStr for Field<E>where
E: Environment,
impl<E> FromStr for Field<E>where
E: Environment,
Source§impl<E> Inject for Field<E>where
E: Environment,
impl<E> Inject for Field<E>where
E: Environment,
Source§impl<E> Inv for &Field<E>where
E: Environment,
impl<E> Inv for &Field<E>where
E: Environment,
Source§impl<E> Inv for Field<E>where
E: Environment,
impl<E> Inv for Field<E>where
E: Environment,
Source§impl<E> Inverse for Field<E>where
E: Environment,
impl<E> Inverse for Field<E>where
E: Environment,
Source§impl<E> Metrics<dyn DivUnchecked<Field<E>, Output = Field<E>>> for Field<E>where
E: Environment,
impl<E> Metrics<dyn DivUnchecked<Field<E>, Output = Field<E>>> for Field<E>where
E: Environment,
Source§impl<E> Metrics<dyn FromBoolean<Boolean = Boolean<E>>> for Field<E>where
E: Environment,
impl<E> Metrics<dyn FromBoolean<Boolean = Boolean<E>>> for Field<E>where
E: Environment,
Source§impl<E> Metrics<dyn SquareRoot<Output = Field<E>>> for Field<E>where
E: Environment,
impl<E> Metrics<dyn SquareRoot<Output = Field<E>>> for Field<E>where
E: Environment,
Source§impl<E> Metrics<dyn Ternary<Boolean = Boolean<E>, Output = Field<E>>> for Field<E>where
E: Environment,
impl<E> Metrics<dyn Ternary<Boolean = Boolean<E>, Output = Field<E>>> for Field<E>where
E: Environment,
Source§impl<E> Metrics<dyn ToLowerBits<Boolean = Boolean<E>>> for Field<E>where
E: Environment,
impl<E> Metrics<dyn ToLowerBits<Boolean = Boolean<E>>> for Field<E>where
E: Environment,
Source§impl<E> Metrics<dyn ToUpperBits<Boolean = Boolean<E>>> for Field<E>where
E: Environment,
impl<E> Metrics<dyn ToUpperBits<Boolean = Boolean<E>>> for Field<E>where
E: Environment,
Source§impl<E> Mul for Field<E>where
E: Environment,
impl<E> Mul for Field<E>where
E: Environment,
Source§impl<E> MulAssign<&Field<E>> for Field<E>where
E: Environment,
impl<E> MulAssign<&Field<E>> for Field<E>where
E: Environment,
Source§fn mul_assign(&mut self, other: &Field<E>)
fn mul_assign(&mut self, other: &Field<E>)
*=
operation. Read moreSource§impl<E> MulAssign for Field<E>where
E: Environment,
impl<E> MulAssign for Field<E>where
E: Environment,
Source§fn mul_assign(&mut self, other: Field<E>)
fn mul_assign(&mut self, other: Field<E>)
*=
operation. Read moreSource§impl<E> Neg for &Field<E>where
E: Environment,
impl<E> Neg for &Field<E>where
E: Environment,
Source§impl<E> Neg for Field<E>where
E: Environment,
impl<E> Neg for Field<E>where
E: Environment,
Source§impl<E> One for Field<E>where
E: Environment,
impl<E> One for Field<E>where
E: Environment,
Source§impl<E> OutputMode<dyn Add<Field<E>, Output = Field<E>>> for Field<E>where
E: Environment,
impl<E> OutputMode<dyn Add<Field<E>, Output = Field<E>>> for Field<E>where
E: Environment,
type Case = (CircuitType<Field<E>>, CircuitType<Field<E>>)
Source§fn output_mode(
case: &<Field<E> as OutputMode<dyn Add<Field<E>, Output = Field<E>>>>::Case,
) -> Mode
fn output_mode( case: &<Field<E> as OutputMode<dyn Add<Field<E>, Output = Field<E>>>>::Case, ) -> Mode
Source§impl<E> OutputMode<dyn Div<Field<E>, Output = Field<E>>> for Field<E>where
E: Environment,
impl<E> OutputMode<dyn Div<Field<E>, Output = Field<E>>> for Field<E>where
E: Environment,
type Case = (CircuitType<Field<E>>, CircuitType<Field<E>>)
Source§fn output_mode(
case: &<Field<E> as OutputMode<dyn Div<Field<E>, Output = Field<E>>>>::Case,
) -> Mode
fn output_mode( case: &<Field<E> as OutputMode<dyn Div<Field<E>, Output = Field<E>>>>::Case, ) -> Mode
Source§impl<E> OutputMode<dyn DivUnchecked<Field<E>, Output = Field<E>>> for Field<E>where
E: Environment,
impl<E> OutputMode<dyn DivUnchecked<Field<E>, Output = Field<E>>> for Field<E>where
E: Environment,
type Case = (CircuitType<Field<E>>, CircuitType<Field<E>>)
Source§fn output_mode(
case: &<Field<E> as OutputMode<dyn DivUnchecked<Field<E>, Output = Field<E>>>>::Case,
) -> Mode
fn output_mode( case: &<Field<E> as OutputMode<dyn DivUnchecked<Field<E>, Output = Field<E>>>>::Case, ) -> Mode
Source§impl<E> OutputMode<dyn Double<Output = Field<E>>> for Field<E>where
E: Environment,
impl<E> OutputMode<dyn Double<Output = Field<E>>> for Field<E>where
E: Environment,
Source§impl<E> OutputMode<dyn Equal<Field<E>, Output = Boolean<E>>> for Field<E>where
E: Environment,
impl<E> OutputMode<dyn Equal<Field<E>, Output = Boolean<E>>> for Field<E>where
E: Environment,
Source§impl<E> OutputMode<dyn FromBits<Boolean = Boolean<E>>> for Field<E>where
E: Environment,
impl<E> OutputMode<dyn FromBits<Boolean = Boolean<E>>> for Field<E>where
E: Environment,
Source§impl<E> OutputMode<dyn FromBoolean<Boolean = Boolean<E>>> for Field<E>where
E: Environment,
impl<E> OutputMode<dyn FromBoolean<Boolean = Boolean<E>>> for Field<E>where
E: Environment,
type Case = Mode
Source§fn output_mode(
case: &<Field<E> as OutputMode<dyn FromBoolean<Boolean = Boolean<E>>>>::Case,
) -> Mode
fn output_mode( case: &<Field<E> as OutputMode<dyn FromBoolean<Boolean = Boolean<E>>>>::Case, ) -> Mode
Source§impl<E> OutputMode<dyn Inverse<Output = Field<E>>> for Field<E>where
E: Environment,
impl<E> OutputMode<dyn Inverse<Output = Field<E>>> for Field<E>where
E: Environment,
Source§impl<E> OutputMode<dyn Mul<Field<E>, Output = Field<E>>> for Field<E>where
E: Environment,
impl<E> OutputMode<dyn Mul<Field<E>, Output = Field<E>>> for Field<E>where
E: Environment,
type Case = (CircuitType<Field<E>>, CircuitType<Field<E>>)
Source§fn output_mode(
case: &<Field<E> as OutputMode<dyn Mul<Field<E>, Output = Field<E>>>>::Case,
) -> Mode
fn output_mode( case: &<Field<E> as OutputMode<dyn Mul<Field<E>, Output = Field<E>>>>::Case, ) -> Mode
Source§impl<E> OutputMode<dyn Neg<Output = Field<E>>> for Field<E>where
E: Environment,
impl<E> OutputMode<dyn Neg<Output = Field<E>>> for Field<E>where
E: Environment,
Source§impl<E> OutputMode<dyn One<Boolean = Boolean<E>>> for Field<E>where
E: Environment,
impl<E> OutputMode<dyn One<Boolean = Boolean<E>>> for Field<E>where
E: Environment,
Source§impl<E> OutputMode<dyn Pow<Field<E>, Output = Field<E>>> for Field<E>where
E: Environment,
impl<E> OutputMode<dyn Pow<Field<E>, Output = Field<E>>> for Field<E>where
E: Environment,
type Case = (CircuitType<Field<E>>, CircuitType<Field<E>>)
Source§fn output_mode(
case: &<Field<E> as OutputMode<dyn Pow<Field<E>, Output = Field<E>>>>::Case,
) -> Mode
fn output_mode( case: &<Field<E> as OutputMode<dyn Pow<Field<E>, Output = Field<E>>>>::Case, ) -> Mode
Source§impl<E> OutputMode<dyn Square<Output = Field<E>>> for Field<E>where
E: Environment,
impl<E> OutputMode<dyn Square<Output = Field<E>>> for Field<E>where
E: Environment,
Source§impl<E> OutputMode<dyn SquareRoot<Output = Field<E>>> for Field<E>where
E: Environment,
impl<E> OutputMode<dyn SquareRoot<Output = Field<E>>> for Field<E>where
E: Environment,
type Case = Mode
Source§fn output_mode(
case: &<Field<E> as OutputMode<dyn SquareRoot<Output = Field<E>>>>::Case,
) -> Mode
fn output_mode( case: &<Field<E> as OutputMode<dyn SquareRoot<Output = Field<E>>>>::Case, ) -> Mode
Source§impl<E> OutputMode<dyn Sub<Field<E>, Output = Field<E>>> for Field<E>where
E: Environment,
impl<E> OutputMode<dyn Sub<Field<E>, Output = Field<E>>> for Field<E>where
E: Environment,
type Case = (CircuitType<Field<E>>, CircuitType<Field<E>>)
Source§fn output_mode(
case: &<Field<E> as OutputMode<dyn Sub<Field<E>, Output = Field<E>>>>::Case,
) -> Mode
fn output_mode( case: &<Field<E> as OutputMode<dyn Sub<Field<E>, Output = Field<E>>>>::Case, ) -> Mode
Source§impl<E> OutputMode<dyn Ternary<Boolean = Boolean<E>, Output = Field<E>>> for Field<E>where
E: Environment,
impl<E> OutputMode<dyn Ternary<Boolean = Boolean<E>, Output = Field<E>>> for Field<E>where
E: Environment,
Source§impl<E> OutputMode<dyn ToBits<Boolean = Boolean<E>>> for Field<E>where
E: Environment,
impl<E> OutputMode<dyn ToBits<Boolean = Boolean<E>>> for Field<E>where
E: Environment,
Source§impl<E> OutputMode<dyn ToLowerBits<Boolean = Boolean<E>>> for Field<E>where
E: Environment,
impl<E> OutputMode<dyn ToLowerBits<Boolean = Boolean<E>>> for Field<E>where
E: Environment,
type Case = Mode
Source§fn output_mode(
case: &<Field<E> as OutputMode<dyn ToLowerBits<Boolean = Boolean<E>>>>::Case,
) -> Mode
fn output_mode( case: &<Field<E> as OutputMode<dyn ToLowerBits<Boolean = Boolean<E>>>>::Case, ) -> Mode
Source§impl<E> OutputMode<dyn ToUpperBits<Boolean = Boolean<E>>> for Field<E>where
E: Environment,
impl<E> OutputMode<dyn ToUpperBits<Boolean = Boolean<E>>> for Field<E>where
E: Environment,
type Case = Mode
Source§fn output_mode(
case: &<Field<E> as OutputMode<dyn ToUpperBits<Boolean = Boolean<E>>>>::Case,
) -> Mode
fn output_mode( case: &<Field<E> as OutputMode<dyn ToUpperBits<Boolean = Boolean<E>>>>::Case, ) -> Mode
Source§impl<E> OutputMode<dyn Zero<Boolean = Boolean<E>>> for Field<E>where
E: Environment,
impl<E> OutputMode<dyn Zero<Boolean = Boolean<E>>> for Field<E>where
E: Environment,
Source§impl<E> Parser for Field<E>where
E: Environment,
impl<E> Parser for Field<E>where
E: Environment,
Source§impl<E> Square for Field<E>where
E: Environment,
impl<E> Square for Field<E>where
E: Environment,
Source§impl<E> SquareRoot for Field<E>where
E: Environment,
impl<E> SquareRoot for Field<E>where
E: Environment,
Source§fn square_root(&self) -> <Field<E> as SquareRoot>::Output
fn square_root(&self) -> <Field<E> as SquareRoot>::Output
Returns the square root of self
.
If there are two square roots, the bitwise lesser one is returned.
If there are no square roots, zero is returned.
type Output = Field<E>
Source§impl<E> Sub for Field<E>where
E: Environment,
impl<E> Sub for Field<E>where
E: Environment,
Source§impl<E> SubAssign<&Field<E>> for Field<E>where
E: Environment,
impl<E> SubAssign<&Field<E>> for Field<E>where
E: Environment,
Source§fn sub_assign(&mut self, other: &Field<E>)
fn sub_assign(&mut self, other: &Field<E>)
-=
operation. Read moreSource§impl<E> SubAssign for Field<E>where
E: Environment,
impl<E> SubAssign for Field<E>where
E: Environment,
Source§fn sub_assign(&mut self, other: Field<E>)
fn sub_assign(&mut self, other: Field<E>)
-=
operation. Read moreSource§impl<E> Ternary for Field<E>where
E: Environment,
impl<E> Ternary for Field<E>where
E: Environment,
Source§impl<E> ToBits for &Field<E>where
E: Environment,
impl<E> ToBits for &Field<E>where
E: Environment,
Source§fn write_bits_le(&self, vec: &mut Vec<<&Field<E> as ToBits>::Boolean>)
fn write_bits_le(&self, vec: &mut Vec<<&Field<E> as ToBits>::Boolean>)
Outputs the unique, minimal little-endian bit representation of self
without trailing zeros.
Source§fn write_bits_be(&self, vec: &mut Vec<<&Field<E> as ToBits>::Boolean>)
fn write_bits_be(&self, vec: &mut Vec<<&Field<E> as ToBits>::Boolean>)
Outputs the unique, minimal big-endian bit representation of self
without leading zeros.
type Boolean = Boolean<E>
Source§fn to_bits_le(&self) -> Vec<Self::Boolean>
fn to_bits_le(&self) -> Vec<Self::Boolean>
Source§fn to_bits_be(&self) -> Vec<Self::Boolean>
fn to_bits_be(&self) -> Vec<Self::Boolean>
Source§impl<E> ToBits for Field<E>where
E: Environment,
impl<E> ToBits for Field<E>where
E: Environment,
Source§fn write_bits_le(&self, vec: &mut Vec<<Field<E> as ToBits>::Boolean>)
fn write_bits_le(&self, vec: &mut Vec<<Field<E> as ToBits>::Boolean>)
Outputs the little-endian bit representation of self
without trailing zeros.
Source§fn write_bits_be(&self, vec: &mut Vec<<Field<E> as ToBits>::Boolean>)
fn write_bits_be(&self, vec: &mut Vec<<Field<E> as ToBits>::Boolean>)
Outputs the big-endian bit representation of self
without leading zeros.
type Boolean = Boolean<E>
Source§fn to_bits_le(&self) -> Vec<Self::Boolean>
fn to_bits_le(&self) -> Vec<Self::Boolean>
Source§fn to_bits_be(&self) -> Vec<Self::Boolean>
fn to_bits_be(&self) -> Vec<Self::Boolean>
Source§impl<E> ToLowerBits for Field<E>where
E: Environment,
impl<E> ToLowerBits for Field<E>where
E: Environment,
Source§fn to_lower_bits_le(&self, k: usize) -> Vec<<Field<E> as ToLowerBits>::Boolean>
fn to_lower_bits_le(&self, k: usize) -> Vec<<Field<E> as ToLowerBits>::Boolean>
Outputs the lower k
bits of an n
-bit field element in little-endian representation.
Enforces that the upper n - k
bits are zero.
Source§fn to_lower_bits_be(&self, k: usize) -> Vec<<Field<E> as ToLowerBits>::Boolean>
fn to_lower_bits_be(&self, k: usize) -> Vec<<Field<E> as ToLowerBits>::Boolean>
Outputs the lower k
bits of an n
-bit field element in big-endian representation.
Enforces that the upper n - k
bits are zero.
type Boolean = Boolean<E>
Source§impl<E> ToUpperBits for Field<E>where
E: Environment,
impl<E> ToUpperBits for Field<E>where
E: Environment,
Source§fn to_upper_bits_le(&self, k: usize) -> Vec<<Field<E> as ToUpperBits>::Boolean>
fn to_upper_bits_le(&self, k: usize) -> Vec<<Field<E> as ToUpperBits>::Boolean>
Outputs the upper k
bits of an n
-bit field element in little-endian representation.
Enforces that the lower n - k
bits are zero.
Source§fn to_upper_bits_be(&self, k: usize) -> Vec<<Field<E> as ToUpperBits>::Boolean>
fn to_upper_bits_be(&self, k: usize) -> Vec<<Field<E> as ToUpperBits>::Boolean>
Outputs the upper k
bits of an n
-bit field element in big-endian representation.
Enforces that the lower n - k
bits are zero.
type Boolean = Boolean<E>
Source§impl<E> TypeName for Field<E>where
E: Environment,
impl<E> TypeName for Field<E>where
E: Environment,
Source§impl<E> Zero for Field<E>where
E: Environment,
impl<E> Zero for Field<E>where
E: Environment,
impl<E> FieldTrait for Field<E>where
E: Environment,
Auto Trait Implementations§
impl<E> !Freeze for Field<E>
impl<E> RefUnwindSafe for Field<E>
impl<E> Send for Field<E>
impl<E> !Sync for Field<E>
impl<E> Unpin for Field<E>
impl<E> UnwindSafe for Field<E>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more