pub struct Scalar<E: Environment> { /* private fields */ }

Trait Implementations§

source§

impl<E: Environment> Add<&Scalar<E>> for &Scalar<E>

§

type Output = Scalar<E>

The resulting type after applying the + operator.
source§

fn add(self, other: &Scalar<E>) -> Self::Output

Performs the + operation. Read more
source§

impl<E: Environment> Add<&Scalar<E>> for Scalar<E>

§

type Output = Scalar<E>

The resulting type after applying the + operator.
source§

fn add(self, other: &Scalar<E>) -> Self::Output

Performs the + operation. Read more
source§

impl<E: Environment> Add<Scalar<E>> for &Scalar<E>

§

type Output = Scalar<E>

The resulting type after applying the + operator.
source§

fn add(self, other: Scalar<E>) -> Self::Output

Performs the + operation. Read more
source§

impl<E: Environment> Add<Scalar<E>> for Scalar<E>

§

type Output = Scalar<E>

The resulting type after applying the + operator.
source§

fn add(self, other: Scalar<E>) -> Self::Output

Performs the + operation. Read more
source§

impl<E: Environment> AddAssign<&Scalar<E>> for Scalar<E>

source§

fn add_assign(&mut self, other: &Scalar<E>)

Performs the += operation. Read more
source§

impl<E: Environment> AddAssign<Scalar<E>> for Scalar<E>

source§

fn add_assign(&mut self, other: Scalar<E>)

Performs the += operation. Read more
source§

impl<E: Clone + Environment> Clone for Scalar<E>

source§

fn clone(&self) -> Scalar<E>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<E: Environment> Compare<Scalar<E>> for Scalar<E>

source§

fn is_less_than(&self, other: &Self) -> Self::Output

Returns true if self is less than other.

source§

fn is_greater_than(&self, other: &Self) -> Self::Output

Returns true if self is greater than other.

source§

fn is_less_than_or_equal(&self, other: &Self) -> Self::Output

Returns true if self is less than or equal to other.

source§

fn is_greater_than_or_equal(&self, other: &Self) -> Self::Output

Returns true if self is greater than or equal to other.

§

type Output = Boolean<E>

source§

impl<E: Environment> Debug for Scalar<E>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<E: Environment> Display for Scalar<E>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<E: Environment> Eject for Scalar<E>

source§

fn eject_mode(&self) -> Mode

Ejects the mode of the scalar.

source§

fn eject_value(&self) -> Self::Primitive

Ejects the scalar circuit as a console scalar.

§

type Primitive = Scalar<<E as Environment>::Network>

source§

fn eject(&self) -> (Mode, Self::Primitive)

Ejects the mode and primitive value of the circuit type.
source§

fn is_constant(&self) -> bool

Returns true if the circuit is a constant.
source§

fn is_public(&self) -> bool

Returns true if the circuit is a public.
source§

fn is_private(&self) -> bool

Returns true if the circuit is a private.
source§

impl<E: Environment> Equal<Scalar<E>> for Scalar<E>

source§

fn is_equal(&self, other: &Self) -> Self::Output

Returns true if self and other are equal.

source§

fn is_not_equal(&self, other: &Self) -> Self::Output

Returns true if self and other are not equal.

§

type Output = Boolean<E>

source§

impl<E: Environment> From<&Scalar<E>> for LinearCombination<E::BaseField>

source§

fn from(scalar: &Scalar<E>) -> Self

Converts to this type from the input type.
source§

impl<E: Environment> From<Scalar<E>> for LinearCombination<E::BaseField>

source§

fn from(scalar: Scalar<E>) -> Self

Converts to this type from the input type.
source§

impl<E: Environment> FromBits for Scalar<E>

source§

fn from_bits_le(bits_le: &[Self::Boolean]) -> Self

Initializes a new scalar field element from a list of little-endian bits.

  • If bits_le is longer than E::ScalarField::size_in_bits(), the excess bits are enforced to be 0s.
  • If bits_le is shorter than E::ScalarField::size_in_bits(), it is padded with 0s up to scalar field size.
source§

fn from_bits_be(bits_be: &[Self::Boolean]) -> Self

Initializes a new scalar field element from a list of big-endian bits without leading zeros.

§

type Boolean = Boolean<E>

source§

impl<E: Environment> FromStr for Scalar<E>

source§

fn from_str(string: &str) -> Result<Self>

Parses a string into a scalar circuit.

§

type Err = Error

The associated error which can be returned from parsing.
source§

impl<E: Environment> Inject for Scalar<E>

source§

fn new(mode: Mode, scalar: Self::Primitive) -> Self

Initializes a scalar circuit from a console scalar.

§

type Primitive = Scalar<<E as Environment>::Network>

source§

fn constant(value: Self::Primitive) -> Selfwhere Self: Sized,

Initializes a constant of the given primitive value.
source§

impl<E: Environment> Metrics<dyn Add<Scalar<E>, Output = Scalar<E>> + 'static> for Scalar<E>

§

type Case = (Mode, Mode)

source§

fn count(case: &Self::Case) -> Count

Returns the number of constants, public inputs, private inputs, and constraints.
source§

impl<E: Environment> One for Scalar<E>

§

type Boolean = Boolean<E>

source§

fn one() -> Self

Returns a new one constant.
source§

fn is_one(&self) -> Self::Boolean

Returns true if self is one.
source§

impl<E: Environment> OutputMode<dyn Add<Scalar<E>, Output = Scalar<E>> + 'static> for Scalar<E>

§

type Case = (Mode, Mode)

source§

fn output_mode(case: &Self::Case) -> Mode

Returns the mode of the output.
source§

impl<E: Environment> Parser for Scalar<E>

source§

fn parse(string: &str) -> ParserResult<'_, Self>

Parses a string into a scalar circuit.

source§

impl<E: Environment> Ternary for Scalar<E>

source§

fn ternary( condition: &Self::Boolean, first: &Self, second: &Self ) -> Self::Output

Returns first if condition is true, otherwise returns second.

§

type Boolean = Boolean<E>

§

type Output = Scalar<E>

source§

impl<E: Environment> ToBits for &Scalar<E>

source§

fn to_bits_le(&self) -> Vec<Self::Boolean>

Outputs the little-endian bit representation of self without trailing zeros.

source§

fn to_bits_be(&self) -> Vec<Self::Boolean>

Outputs the big-endian bit representation of self without leading zeros.

§

type Boolean = Boolean<E>

source§

impl<E: Environment> ToBits for Scalar<E>

source§

fn to_bits_le(&self) -> Vec<Self::Boolean>

Outputs the little-endian bit representation of self without trailing zeros.

source§

fn to_bits_be(&self) -> Vec<Self::Boolean>

Outputs the big-endian bit representation of self without leading zeros.

§

type Boolean = Boolean<E>

source§

impl<E: Environment> ToField for Scalar<E>

source§

fn to_field(&self) -> Self::Field

Casts a scalar field element into a base field element.

§

type Field = Field<E>

source§

impl<E: Environment> ToFields for Scalar<E>

source§

fn to_fields(&self) -> Vec<Self::Field>

Casts a string into a list of base fields.

§

type Field = Field<E>

source§

impl<E: Environment> TypeName for Scalar<E>

source§

fn type_name() -> &'static str

Returns the type name of the circuit as a string.

source§

impl<E: Environment> Zero for Scalar<E>

§

type Boolean = Boolean<E>

source§

fn zero() -> Self

Returns a new zero constant.
source§

fn is_zero(&self) -> Self::Boolean

Returns true if self is zero.
source§

impl<E: Environment> ScalarTrait for Scalar<E>

Auto Trait Implementations§

§

impl<E> RefUnwindSafe for Scalar<E>where <E as Environment>::BaseField: UnwindSafe + RefUnwindSafe,

§

impl<E> !Send for Scalar<E>

§

impl<E> !Sync for Scalar<E>

§

impl<E> Unpin for Scalar<E>where <E as Environment>::BaseField: Unpin,

§

impl<E> UnwindSafe for Scalar<E>where <E as Environment>::BaseField: UnwindSafe + RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V