Struct snarkvm_circuit::Group

pub struct Group<E>where
    E: Environment,{ /* private fields */ }

Implementations§

§

impl<E> Group<E>where E: Environment,

pub fn from_x_coordinate(x: Field<E>) -> Group<E>

Initializes an affine group element from a given x-coordinate field element. For safety, the resulting point is always enforced to be on the curve with constraints.

§

impl<E> Group<E>where E: Environment,

pub fn from_xy_coordinates(x: Field<E>, y: Field<E>) -> Group<E>

Initializes an affine group element from a given x- and y-coordinate field element. For safety, the resulting point is always enforced to be on the curve and in the subgroup.

§

impl<E> Group<E>where E: Environment,

pub fn mul_by_cofactor(&self) -> Group<E>

Returns the product of the group element and the cofactor.

§

impl<E> Group<E>where E: Environment,

pub fn to_x_coordinate(&self) -> Field<E>

Returns the x-coordinate of the group element.

§

impl<E> Group<E>where E: Environment,

pub fn to_y_coordinate(&self) -> Field<E>

Returns the y-coordinate of the group element.

§

impl<E> Group<E>where E: Environment,

pub fn enforce_on_curve(&self)

Checks (x, y) is on the curve.

Ensure ax^2 + y^2 = 1 + dx^2y^2 by checking that y^2 * (dx^2 - 1) = (ax^2 - 1)

Trait Implementations§

§

impl<E> Add<&Group<E>> for &Group<E>where E: Environment,

§

type Output = Group<E>

The resulting type after applying the + operator.
§

fn add(self, other: &Group<E>) -> <&Group<E> as Add<&Group<E>>>::Output

Performs the + operation. Read more
§

impl<E> Add<&Group<E>> for Group<E>where E: Environment,

§

type Output = Group<E>

The resulting type after applying the + operator.
§

fn add(self, other: &Group<E>) -> <Group<E> as Add<&Group<E>>>::Output

Performs the + operation. Read more
§

impl<E> Add<Group<E>> for Group<E>where E: Environment,

§

type Output = Group<E>

The resulting type after applying the + operator.
§

fn add(self, other: Group<E>) -> <Group<E> as Add<Group<E>>>::Output

Performs the + operation. Read more
§

impl<E> AddAssign<&Group<E>> for Group<E>where E: Environment,

§

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

Performs the += operation. Read more
§

impl<E> AddAssign<Group<E>> for Group<E>where E: Environment,

§

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

Performs the += operation. Read more
§

impl<E> Clone for Group<E>where E: Clone + Environment,

§

fn clone(&self) -> Group<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
§

impl<E> Debug for Group<E>where E: Environment,

§

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

Formats the value using the given formatter. Read more
§

impl<E> Display for Group<E>where E: Environment,

§

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

Formats the value using the given formatter. Read more
§

impl<E> Double for Group<E>where E: Environment,

§

type Output = Group<E>

§

fn double(&self) -> <Group<E> as Double>::Output

§

impl<E> Eject for Group<E>where E: Environment,

§

fn eject_mode(&self) -> Mode

Ejects the mode of the group element.

§

fn eject_value(&self) -> <Group<E> as Eject>::Primitive

Ejects the group as a constant group element.

§

type Primitive = Group<<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.
§

impl<E> Equal<Group<E>> for Group<E>where E: Environment,

§

fn is_equal(&self, other: &Group<E>) -> <Group<E> as Equal<Group<E>>>::Output

Returns true if self and other are equal.

This method costs 8 constraints.

§

fn is_not_equal( &self, other: &Group<E> ) -> <Group<E> as Equal<Group<E>>>::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 8 constraints.

§

type Output = Boolean<E>

§

impl<E> From<&Address<E>> for Group<E>where E: Environment,

§

fn from(value: &Address<E>) -> Group<E>

Returns the affine group element in the address.

§

impl<E> From<&Group<E>> for Address<E>where E: Environment,

§

fn from(value: &Group<E>) -> Address<E>

Initializes an address from an affine group element.

§

impl<E> From<&Group<E>> for LinearCombination<<E as Environment>::BaseField>where E: Environment,

§

fn from(group: &Group<E>) -> LinearCombination<<E as Environment>::BaseField>

Converts to this type from the input type.
§

impl<E> From<Address<E>> for Group<E>where E: Environment,

§

fn from(value: Address<E>) -> Group<E>

Returns the affine group element in the address.

§

impl<E> From<Group<E>> for Address<E>where E: Environment,

§

fn from(value: Group<E>) -> Address<E>

Initializes an address from an affine group element.

§

impl<E> From<Group<E>> for LinearCombination<<E as Environment>::BaseField>where E: Environment,

§

fn from(group: Group<E>) -> LinearCombination<<E as Environment>::BaseField>

Converts to this type from the input type.
§

impl<E> FromBits for Group<E>where E: Environment,

§

fn from_bits_le(bits_le: &[<Group<E> as FromBits>::Boolean]) -> Group<E>

Initializes a new group element from the x-coordinate as a list of little-endian bits without trailing zeros.

§

fn from_bits_be(bits_be: &[<Group<E> as FromBits>::Boolean]) -> Group<E>

Initializes a new group element from the x-coordinate as a list of big-endian bits without leading zeros.

§

type Boolean = Boolean<E>

§

impl<E> FromStr for Group<E>where E: Environment,

§

fn from_str(string: &str) -> Result<Group<E>, Error>

Parses a string into a group circuit.

§

type Err = Error

The associated error which can be returned from parsing.
§

impl<E> Inject for Group<E>where E: Environment,

§

fn new(mode: Mode, group: <Group<E> as Inject>::Primitive) -> Group<E>

Initializes a new affine group element.

For safety, the resulting point is always enforced to be on the curve with constraints. regardless of whether the y-coordinate was recovered.

§

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

source§

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

Initializes a constant of the given primitive value.
§

impl<E> Metrics<dyn Add<Group<E>, Output = Group<E>>> for Group<E>where E: Environment,

§

type Case = (Mode, Mode)

§

fn count( case: &<Group<E> as Metrics<dyn Add<Group<E>, Output = Group<E>>>>::Case ) -> Count

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

impl<E> Metrics<dyn Neg<Output = Group<E>>> for Group<E>where E: Environment,

§

type Case = Mode

§

fn count( _case: &<Group<E> as Metrics<dyn Neg<Output = Group<E>>>>::Case ) -> Count

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

impl<E> Metrics<dyn Sub<Group<E>, Output = Group<E>>> for Group<E>where E: Environment,

§

type Case = (Mode, Mode)

§

fn count( case: &<Group<E> as Metrics<dyn Sub<Group<E>, Output = Group<E>>>>::Case ) -> Count

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

impl<E> Metrics<dyn Ternary<Output = Group<E>, Boolean = Boolean<E>>> for Group<E>where E: Environment,

§

type Case = (Mode, Mode, Mode)

§

fn count( case: &<Group<E> as Metrics<dyn Ternary<Output = Group<E>, Boolean = Boolean<E>>>>::Case ) -> Count

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

impl<E> Mul<&[Boolean<E>]> for &Group<E>where E: Environment,

§

type Output = Group<E>

The resulting type after applying the * operator.
§

fn mul(self, other: &[Boolean<E>]) -> <&Group<E> as Mul<&[Boolean<E>]>>::Output

Performs the * operation. Read more
§

impl<E> Mul<&[Boolean<E>]> for Group<E>where E: Environment,

§

type Output = Group<E>

The resulting type after applying the * operator.
§

fn mul(self, other: &[Boolean<E>]) -> <Group<E> as Mul<&[Boolean<E>]>>::Output

Performs the * operation. Read more
§

impl<E> Mul<&Group<E>> for &[Boolean<E>]where E: Environment,

§

type Output = Group<E>

The resulting type after applying the * operator.
§

fn mul(self, other: &Group<E>) -> <&[Boolean<E>] as Mul<&Group<E>>>::Output

Performs the * operation. Read more
§

impl<E> Mul<&Group<E>> for &Scalar<E>where E: Environment,

§

type Output = Group<E>

The resulting type after applying the * operator.
§

fn mul(self, other: &Group<E>) -> <&Scalar<E> as Mul<&Group<E>>>::Output

Performs the * operation. Read more
§

impl<E, const N: usize> Mul<&Group<E>> for [Boolean<E>; N]where E: Environment,

§

type Output = Group<E>

The resulting type after applying the * operator.
§

fn mul(self, other: &Group<E>) -> <[Boolean<E>; N] as Mul<&Group<E>>>::Output

Performs the * operation. Read more
§

impl<E> Mul<&Group<E>> for Scalar<E>where E: Environment,

§

type Output = Group<E>

The resulting type after applying the * operator.
§

fn mul(self, other: &Group<E>) -> <Scalar<E> as Mul<&Group<E>>>::Output

Performs the * operation. Read more
§

impl<E> Mul<&Scalar<E>> for &Group<E>where E: Environment,

§

type Output = Group<E>

The resulting type after applying the * operator.
§

fn mul(self, other: &Scalar<E>) -> <&Group<E> as Mul<&Scalar<E>>>::Output

Performs the * operation. Read more
§

impl<E> Mul<&Scalar<E>> for Group<E>where E: Environment,

§

type Output = Group<E>

The resulting type after applying the * operator.
§

fn mul(self, other: &Scalar<E>) -> <Group<E> as Mul<&Scalar<E>>>::Output

Performs the * operation. Read more
§

impl<E, const N: usize> Mul<[Boolean<E>; N]> for &Group<E>where E: Environment,

§

type Output = Group<E>

The resulting type after applying the * operator.
§

fn mul( self, other: [Boolean<E>; N] ) -> <&Group<E> as Mul<[Boolean<E>; N]>>::Output

Performs the * operation. Read more
§

impl<E, const N: usize> Mul<[Boolean<E>; N]> for Group<E>where E: Environment,

§

type Output = Group<E>

The resulting type after applying the * operator.
§

fn mul( self, other: [Boolean<E>; N] ) -> <Group<E> as Mul<[Boolean<E>; N]>>::Output

Performs the * operation. Read more
§

impl<E> Mul<Group<E>> for &[Boolean<E>]where E: Environment,

§

type Output = Group<E>

The resulting type after applying the * operator.
§

fn mul(self, other: Group<E>) -> <&[Boolean<E>] as Mul<Group<E>>>::Output

Performs the * operation. Read more
§

impl<E> Mul<Group<E>> for &Scalar<E>where E: Environment,

§

type Output = Group<E>

The resulting type after applying the * operator.
§

fn mul(self, other: Group<E>) -> <&Scalar<E> as Mul<Group<E>>>::Output

Performs the * operation. Read more
§

impl<E, const N: usize> Mul<Group<E>> for [Boolean<E>; N]where E: Environment,

§

type Output = Group<E>

The resulting type after applying the * operator.
§

fn mul(self, other: Group<E>) -> <[Boolean<E>; N] as Mul<Group<E>>>::Output

Performs the * operation. Read more
§

impl<E> Mul<Group<E>> for Scalar<E>where E: Environment,

§

type Output = Group<E>

The resulting type after applying the * operator.
§

fn mul(self, other: Group<E>) -> <Scalar<E> as Mul<Group<E>>>::Output

Performs the * operation. Read more
§

impl<E> Mul<Scalar<E>> for &Group<E>where E: Environment,

§

type Output = Group<E>

The resulting type after applying the * operator.
§

fn mul(self, other: Scalar<E>) -> <&Group<E> as Mul<Scalar<E>>>::Output

Performs the * operation. Read more
§

impl<E> Mul<Scalar<E>> for Group<E>where E: Environment,

§

type Output = Group<E>

The resulting type after applying the * operator.
§

fn mul(self, other: Scalar<E>) -> <Group<E> as Mul<Scalar<E>>>::Output

Performs the * operation. Read more
§

impl<E> MulAssign<&[Boolean<E>]> for Group<E>where E: Environment,

§

fn mul_assign(&mut self, other: &[Boolean<E>])

Performs the *= operation. Read more
§

impl<E> MulAssign<&Scalar<E>> for Group<E>where E: Environment,

§

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

Performs the *= operation. Read more
§

impl<E, const N: usize> MulAssign<[Boolean<E>; N]> for Group<E>where E: Environment,

§

fn mul_assign(&mut self, other: [Boolean<E>; N])

Performs the *= operation. Read more
§

impl<E> MulAssign<Scalar<E>> for Group<E>where E: Environment,

§

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

Performs the *= operation. Read more
§

impl<E> Neg for &Group<E>where E: Environment,

§

fn neg(self) -> <&Group<E> as Neg>::Output

Performs the unary - operation.

§

type Output = Group<E>

The resulting type after applying the - operator.
§

impl<E> Neg for Group<E>where E: Environment,

§

fn neg(self) -> <Group<E> as Neg>::Output

Performs the unary - operation.

§

type Output = Group<E>

The resulting type after applying the - operator.
§

impl<E> OutputMode<dyn Add<Group<E>, Output = Group<E>>> for Group<E>where E: Environment,

§

type Case = (Mode, Mode)

§

fn output_mode( case: &<Group<E> as OutputMode<dyn Add<Group<E>, Output = Group<E>>>>::Case ) -> Mode

Returns the mode of the output.
§

impl<E> OutputMode<dyn Neg<Output = Group<E>>> for Group<E>where E: Environment,

§

type Case = Mode

§

fn output_mode( case: &<Group<E> as OutputMode<dyn Neg<Output = Group<E>>>>::Case ) -> Mode

Returns the mode of the output.
§

impl<E> OutputMode<dyn Sub<Group<E>, Output = Group<E>>> for Group<E>where E: Environment,

§

type Case = (Mode, Mode)

§

fn output_mode( case: &<Group<E> as OutputMode<dyn Sub<Group<E>, Output = Group<E>>>>::Case ) -> Mode

Returns the mode of the output.
§

impl<E> OutputMode<dyn Ternary<Output = Group<E>, Boolean = Boolean<E>>> for Group<E>where E: Environment,

§

type Case = (CircuitType<Boolean<E>>, Mode, Mode)

§

fn output_mode( parameter: &<Group<E> as OutputMode<dyn Ternary<Output = Group<E>, Boolean = Boolean<E>>>>::Case ) -> Mode

Returns the mode of the output.
§

impl<E> Parser for Group<E>where E: Environment,

§

fn parse(string: &str) -> Result<(&str, Group<E>), Err<VerboseError<&str>>>

Parses a string into a group circuit.

§

impl<E> Sub<&Group<E>> for &Group<E>where E: Environment,

§

type Output = Group<E>

The resulting type after applying the - operator.
§

fn sub(self, other: &Group<E>) -> <&Group<E> as Sub<&Group<E>>>::Output

Performs the - operation. Read more
§

impl<E> Sub<&Group<E>> for Group<E>where E: Environment,

§

type Output = Group<E>

The resulting type after applying the - operator.
§

fn sub(self, other: &Group<E>) -> <Group<E> as Sub<&Group<E>>>::Output

Performs the - operation. Read more
§

impl<E> Sub<Group<E>> for Group<E>where E: Environment,

§

type Output = Group<E>

The resulting type after applying the - operator.
§

fn sub(self, other: Group<E>) -> <Group<E> as Sub<Group<E>>>::Output

Performs the - operation. Read more
§

impl<E> SubAssign<&Group<E>> for Group<E>where E: Environment,

§

fn sub_assign(&mut self, other: &Group<E>)

Performs the -= operation. Read more
§

impl<E> SubAssign<Group<E>> for Group<E>where E: Environment,

§

fn sub_assign(&mut self, other: Group<E>)

Performs the -= operation. Read more
§

impl<E> Ternary for Group<E>where E: Environment,

§

fn ternary( condition: &<Group<E> as Ternary>::Boolean, first: &Group<E>, second: &Group<E> ) -> <Group<E> as Ternary>::Output

Returns first if condition is true, otherwise returns second.

§

type Boolean = Boolean<E>

§

type Output = Group<E>

§

impl<E> ToBits for &Group<E>where E: Environment,

§

fn to_bits_le(&self) -> Vec<<&Group<E> as ToBits>::Boolean, Global>

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

§

fn to_bits_be(&self) -> Vec<<&Group<E> as ToBits>::Boolean, Global>

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

§

type Boolean = Boolean<E>

§

impl<E> ToBits for Group<E>where E: Environment,

§

fn to_bits_le(&self) -> Vec<<Group<E> as ToBits>::Boolean, Global>

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

§

fn to_bits_be(&self) -> Vec<<Group<E> as ToBits>::Boolean, Global>

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

§

type Boolean = Boolean<E>

§

impl<E> TypeName for Group<E>where E: Environment,

§

fn type_name() -> &'static str

Returns the type name of the circuit as a string.

§

impl<E> Zero for Group<E>where E: Environment,

§

type Boolean = Boolean<E>

§

fn zero() -> Group<E>

Returns a new zero constant.
§

fn is_zero(&self) -> <Group<E> as Zero>::Boolean

Returns true if self is zero.
§

impl<E> GroupTrait<Scalar<E>> for Group<E>where E: Environment,

Auto Trait Implementations§

§

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

§

impl<E> !Send for Group<E>

§

impl<E> !Sync for Group<E>

§

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

§

impl<E> UnwindSafe for Group<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