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

Implementations§

source§

impl<E: Environment> Group<E>

source

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

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.

source§

impl<E: Environment> Group<E>

source

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

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.

source§

impl<E: Environment> Group<E>

source

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

Returns the product of the group element and the cofactor.

source§

impl<E: Environment> Group<E>

source

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

Returns the x-coordinate of the group element.

source§

impl<E: Environment> Group<E>

source

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

Returns the y-coordinate of the group element.

source§

impl<E: Environment> Group<E>

source

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§

source§

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

§

type Output = Group<E>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

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

§

type Output = Group<E>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

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

§

type Output = Group<E>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

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

source§

fn add_assign(&mut self, other: &Self)

Performs the += operation. Read more
source§

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

source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
source§

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

source§

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
source§

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

source§

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

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

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

source§

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

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

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

§

type Output = Group<E>

source§

fn double(&self) -> Self::Output

source§

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

source§

fn eject_mode(&self) -> Mode

Ejects the mode of the group element.

source§

fn eject_value(&self) -> Self::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.
source§

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

source§

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

Returns true if self and other are equal.

This method costs 8 constraints.

source§

fn is_not_equal(&self, other: &Self) -> Self::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>

source§

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

source§

fn from(group: &Group<E>) -> Self

Converts to this type from the input type.
source§

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

source§

fn from(group: Group<E>) -> Self

Converts to this type from the input type.
source§

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

source§

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

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

source§

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

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

§

type Boolean = Boolean<E>

source§

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

source§

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

Parses a string into a group circuit.

§

type Err = Error

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

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

source§

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

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.
source§

impl<E: Environment> Metrics<dyn Add<Group<E>, Output = Group<E>>> for Group<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> Metrics<dyn Neg<Output = Group<E>>> for Group<E>

§

type Case = Mode

source§

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

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

impl<E: Environment> Metrics<dyn Sub<Group<E>, Output = Group<E>>> for Group<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> Metrics<dyn Ternary<Output = Group<E>, Boolean = Boolean<E>>> for Group<E>

§

type Case = (Mode, Mode, Mode)

source§

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

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

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

§

type Output = Group<E>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

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

§

type Output = Group<E>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

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

§

type Output = Group<E>

The resulting type after applying the * operator.
source§

fn mul(self, other: &Group<E>) -> Self::Output

Performs the * operation. Read more
source§

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

§

type Output = Group<E>

The resulting type after applying the * operator.
source§

fn mul(self, other: &Group<E>) -> Self::Output

Performs the * operation. Read more
source§

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

§

type Output = Group<E>

The resulting type after applying the * operator.
source§

fn mul(self, other: &Group<E>) -> Self::Output

Performs the * operation. Read more
source§

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

§

type Output = Group<E>

The resulting type after applying the * operator.
source§

fn mul(self, other: &Group<E>) -> Self::Output

Performs the * operation. Read more
source§

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

§

type Output = Group<E>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

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

§

type Output = Group<E>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

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

§

type Output = Group<E>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

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

§

type Output = Group<E>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

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

§

type Output = Group<E>

The resulting type after applying the * operator.
source§

fn mul(self, other: Group<E>) -> Self::Output

Performs the * operation. Read more
source§

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

§

type Output = Group<E>

The resulting type after applying the * operator.
source§

fn mul(self, other: Group<E>) -> Self::Output

Performs the * operation. Read more
source§

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

§

type Output = Group<E>

The resulting type after applying the * operator.
source§

fn mul(self, other: Group<E>) -> Self::Output

Performs the * operation. Read more
source§

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

§

type Output = Group<E>

The resulting type after applying the * operator.
source§

fn mul(self, other: Group<E>) -> Self::Output

Performs the * operation. Read more
source§

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

§

type Output = Group<E>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

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

§

type Output = Group<E>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

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

source§

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

Performs the *= operation. Read more
source§

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

source§

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

Performs the *= operation. Read more
source§

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

source§

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

Performs the *= operation. Read more
source§

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

source§

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

Performs the *= operation. Read more
source§

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

source§

fn neg(self) -> Self::Output

Performs the unary - operation.

§

type Output = Group<E>

The resulting type after applying the - operator.
source§

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

source§

fn neg(self) -> Self::Output

Performs the unary - operation.

§

type Output = Group<E>

The resulting type after applying the - operator.
source§

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

§

type Case = (Mode, Mode)

source§

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

Returns the mode of the output.
source§

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

§

type Case = Mode

source§

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

Returns the mode of the output.
source§

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

§

type Case = (Mode, Mode)

source§

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

Returns the mode of the output.
source§

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

§

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

source§

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

Returns the mode of the output.
source§

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

source§

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

Parses a string into a group circuit.

source§

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

§

type Output = Group<E>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

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

§

type Output = Group<E>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

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

§

type Output = Group<E>

The resulting type after applying the - operator.
source§

fn sub(self, other: Self) -> Self::Output

Performs the - operation. Read more
source§

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

source§

fn sub_assign(&mut self, other: &Self)

Performs the -= operation. Read more
source§

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

source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
source§

impl<E: Environment> Ternary for Group<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 = Group<E>

source§

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

source§

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

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

source§

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

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

§

type Boolean = Boolean<E>

source§

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

source§

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

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

source§

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

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

§

type Boolean = Boolean<E>

source§

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

source§

fn type_name() -> &'static str

Returns the type name of the circuit as a string.

source§

impl<E: Environment> Zero for Group<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> GroupTrait<Scalar<E>> for Group<E>

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