Struct snarkvm_circuit::Scalar
pub struct Scalar<E>where
E: Environment,{ /* private fields */ }
Trait Implementations§
§impl<E> Add<&Scalar<E>> for &Scalar<E>where
E: Environment,
impl<E> Add<&Scalar<E>> for &Scalar<E>where
E: Environment,
§impl<E> Add<&Scalar<E>> for Scalar<E>where
E: Environment,
impl<E> Add<&Scalar<E>> for Scalar<E>where
E: Environment,
§impl<E> Add<Scalar<E>> for &Scalar<E>where
E: Environment,
impl<E> Add<Scalar<E>> for &Scalar<E>where
E: Environment,
§impl<E> Add<Scalar<E>> for Scalar<E>where
E: Environment,
impl<E> Add<Scalar<E>> for Scalar<E>where
E: Environment,
§impl<E> AddAssign<&Scalar<E>> for Scalar<E>where
E: Environment,
impl<E> AddAssign<&Scalar<E>> for Scalar<E>where
E: Environment,
§fn add_assign(&mut self, other: &Scalar<E>)
fn add_assign(&mut self, other: &Scalar<E>)
Performs the
+=
operation. Read more§impl<E> AddAssign<Scalar<E>> for Scalar<E>where
E: Environment,
impl<E> AddAssign<Scalar<E>> for Scalar<E>where
E: Environment,
§fn add_assign(&mut self, other: Scalar<E>)
fn add_assign(&mut self, other: Scalar<E>)
Performs the
+=
operation. Read more§impl<E> Clone for Scalar<E>where
E: Clone + Environment,
impl<E> Clone for Scalar<E>where
E: Clone + Environment,
§impl<E> Compare<Scalar<E>> for Scalar<E>where
E: Environment,
impl<E> Compare<Scalar<E>> for Scalar<E>where
E: Environment,
§fn is_less_than(
&self,
other: &Scalar<E>
) -> <Scalar<E> as Compare<Scalar<E>>>::Output
fn is_less_than(
&self,
other: &Scalar<E>
) -> <Scalar<E> as Compare<Scalar<E>>>::Output
Returns true
if self
is less than other
.
§fn is_greater_than(
&self,
other: &Scalar<E>
) -> <Scalar<E> as Compare<Scalar<E>>>::Output
fn is_greater_than(
&self,
other: &Scalar<E>
) -> <Scalar<E> as Compare<Scalar<E>>>::Output
Returns true
if self
is greater than other
.
§fn is_less_than_or_equal(
&self,
other: &Scalar<E>
) -> <Scalar<E> as Compare<Scalar<E>>>::Output
fn is_less_than_or_equal(
&self,
other: &Scalar<E>
) -> <Scalar<E> as Compare<Scalar<E>>>::Output
Returns true
if self
is less than or equal to other
.
§fn is_greater_than_or_equal(
&self,
other: &Scalar<E>
) -> <Scalar<E> as Compare<Scalar<E>>>::Output
fn is_greater_than_or_equal(
&self,
other: &Scalar<E>
) -> <Scalar<E> as Compare<Scalar<E>>>::Output
Returns true
if self
is greater than or equal to other
.
type Output = Boolean<E>
§impl<E> Debug for Scalar<E>where
E: Environment,
impl<E> Debug for Scalar<E>where
E: Environment,
§impl<E> Display for Scalar<E>where
E: Environment,
impl<E> Display for Scalar<E>where
E: Environment,
§impl<E> Eject for Scalar<E>where
E: Environment,
impl<E> Eject for Scalar<E>where
E: Environment,
§fn eject_mode(&self) -> Mode
fn eject_mode(&self) -> Mode
Ejects the mode of the scalar.
§fn eject_value(&self) -> <Scalar<E> as Eject>::Primitive
fn eject_value(&self) -> <Scalar<E> as Eject>::Primitive
Ejects the scalar circuit as a console scalar.
type Primitive = Scalar<<E as Environment>::Network>
source§fn eject(&self) -> (Mode, Self::Primitive)
fn eject(&self) -> (Mode, Self::Primitive)
Ejects the mode and primitive value of the circuit type. Read more
source§fn is_constant(&self) -> bool
fn is_constant(&self) -> bool
Returns
true
if the circuit is a constant. Read moresource§fn is_private(&self) -> bool
fn is_private(&self) -> bool
Returns
true
if the circuit is a private. Read more§impl<E> Equal<Scalar<E>> for Scalar<E>where
E: Environment,
impl<E> Equal<Scalar<E>> for Scalar<E>where
E: Environment,
§impl<E> From<&Scalar<E>> for LinearCombination<<E as Environment>::BaseField>where
E: Environment,
impl<E> From<&Scalar<E>> for LinearCombination<<E as Environment>::BaseField>where
E: Environment,
§fn from(scalar: &Scalar<E>) -> LinearCombination<<E as Environment>::BaseField>
fn from(scalar: &Scalar<E>) -> LinearCombination<<E as Environment>::BaseField>
Converts to this type from the input type.
§impl<E> From<Scalar<E>> for LinearCombination<<E as Environment>::BaseField>where
E: Environment,
impl<E> From<Scalar<E>> for LinearCombination<<E as Environment>::BaseField>where
E: Environment,
§fn from(scalar: Scalar<E>) -> LinearCombination<<E as Environment>::BaseField>
fn from(scalar: Scalar<E>) -> LinearCombination<<E as Environment>::BaseField>
Converts to this type from the input type.
§impl<E> FromBits for Scalar<E>where
E: Environment,
impl<E> FromBits for Scalar<E>where
E: Environment,
§fn from_bits_le(bits_le: &[<Scalar<E> as FromBits>::Boolean]) -> Scalar<E>
fn from_bits_le(bits_le: &[<Scalar<E> as FromBits>::Boolean]) -> Scalar<E>
Initializes a new scalar field element from a list of little-endian bits.
- If
bits_le
is longer thanE::ScalarField::size_in_bits()
, the excess bits are enforced to be0
s. - If
bits_le
is shorter thanE::ScalarField::size_in_bits()
, it is padded with0
s up to scalar field size.
§fn from_bits_be(bits_be: &[<Scalar<E> as FromBits>::Boolean]) -> Scalar<E>
fn from_bits_be(bits_be: &[<Scalar<E> as FromBits>::Boolean]) -> Scalar<E>
Initializes a new scalar field element from a list of big-endian bits without leading zeros.
type Boolean = Boolean<E>
§impl<E> FromStr for Scalar<E>where
E: Environment,
impl<E> FromStr for Scalar<E>where
E: Environment,
§impl<E> Inject for Scalar<E>where
E: Environment,
impl<E> Inject for Scalar<E>where
E: Environment,
§impl<E> Metrics<dyn Add<Scalar<E>, Output = Scalar<E>> + 'static> for Scalar<E>where
E: Environment,
impl<E> Metrics<dyn Add<Scalar<E>, Output = Scalar<E>> + 'static> for Scalar<E>where
E: Environment,
§impl<E> Mul<&Group<E>> for &Scalar<E>where
E: Environment,
impl<E> Mul<&Group<E>> for &Scalar<E>where
E: Environment,
§impl<E> Mul<&Group<E>> for Scalar<E>where
E: Environment,
impl<E> Mul<&Group<E>> for Scalar<E>where
E: Environment,
§impl<E> Mul<&Scalar<E>> for &Group<E>where
E: Environment,
impl<E> Mul<&Scalar<E>> for &Group<E>where
E: Environment,
§impl<E> Mul<&Scalar<E>> for Group<E>where
E: Environment,
impl<E> Mul<&Scalar<E>> for Group<E>where
E: Environment,
§impl<E> Mul<Group<E>> for &Scalar<E>where
E: Environment,
impl<E> Mul<Group<E>> for &Scalar<E>where
E: Environment,
§impl<E> Mul<Group<E>> for Scalar<E>where
E: Environment,
impl<E> Mul<Group<E>> for Scalar<E>where
E: Environment,
§impl<E> Mul<Scalar<E>> for &Group<E>where
E: Environment,
impl<E> Mul<Scalar<E>> for &Group<E>where
E: Environment,
§impl<E> Mul<Scalar<E>> for Group<E>where
E: Environment,
impl<E> Mul<Scalar<E>> for Group<E>where
E: Environment,
§impl<E> MulAssign<&Scalar<E>> for Group<E>where
E: Environment,
impl<E> MulAssign<&Scalar<E>> for Group<E>where
E: Environment,
§fn mul_assign(&mut self, other: &Scalar<E>)
fn mul_assign(&mut self, other: &Scalar<E>)
Performs the
*=
operation. Read more§impl<E> MulAssign<Scalar<E>> for Group<E>where
E: Environment,
impl<E> MulAssign<Scalar<E>> for Group<E>where
E: Environment,
§fn mul_assign(&mut self, other: Scalar<E>)
fn mul_assign(&mut self, other: Scalar<E>)
Performs the
*=
operation. Read more§impl<E> One for Scalar<E>where
E: Environment,
impl<E> One for Scalar<E>where
E: Environment,
§impl<E> OutputMode<dyn Add<Scalar<E>, Output = Scalar<E>> + 'static> for Scalar<E>where
E: Environment,
impl<E> OutputMode<dyn Add<Scalar<E>, Output = Scalar<E>> + 'static> for Scalar<E>where
E: Environment,
§impl<E> Parser for Scalar<E>where
E: Environment,
impl<E> Parser for Scalar<E>where
E: Environment,
§impl<E> Ternary for Scalar<E>where
E: Environment,
impl<E> Ternary for Scalar<E>where
E: Environment,
§impl<E> ToBits for &Scalar<E>where
E: Environment,
impl<E> ToBits for &Scalar<E>where
E: Environment,
§fn to_bits_le(&self) -> Vec<<&Scalar<E> as ToBits>::Boolean, Global> ⓘ
fn to_bits_le(&self) -> Vec<<&Scalar<E> as ToBits>::Boolean, Global> ⓘ
Outputs the little-endian bit representation of self
without trailing zeros.
§fn to_bits_be(&self) -> Vec<<&Scalar<E> as ToBits>::Boolean, Global> ⓘ
fn to_bits_be(&self) -> Vec<<&Scalar<E> as ToBits>::Boolean, Global> ⓘ
Outputs the big-endian bit representation of self
without leading zeros.
type Boolean = Boolean<E>
§impl<E> ToBits for Scalar<E>where
E: Environment,
impl<E> ToBits for Scalar<E>where
E: Environment,
§fn to_bits_le(&self) -> Vec<<Scalar<E> as ToBits>::Boolean, Global> ⓘ
fn to_bits_le(&self) -> Vec<<Scalar<E> as ToBits>::Boolean, Global> ⓘ
Outputs the little-endian bit representation of self
without trailing zeros.
§fn to_bits_be(&self) -> Vec<<Scalar<E> as ToBits>::Boolean, Global> ⓘ
fn to_bits_be(&self) -> Vec<<Scalar<E> as ToBits>::Boolean, Global> ⓘ
Outputs the big-endian bit representation of self
without leading zeros.