pub struct Affine<P: TECurveConfig> {
    pub x: P::BaseField,
    pub y: P::BaseField,
}
Expand description

Affine coordinates for a point on a twisted Edwards curve, over the base field P::BaseField.

Fields§

§x: P::BaseField

X coordinate of the point represented as a field element

§y: P::BaseField

Y coordinate of the point represented as a field element

Implementations§

Construct a new group element without checking whether the coordinates specify a point in the subgroup.

Construct a new group element in a way while enforcing that points are in the prime-order subgroup.

Construct the identity of the group

Is this point the identity?

Attempts to construct an affine point given an y-coordinate. The point is not guaranteed to be in the prime order subgroup.

If and only if greatest is set will the lexicographically largest x-coordinate be selected.

a * X^2 + Y^2 = 1 + d * X^2 * Y^2 a * X^2 - d * X^2 * Y^2 = 1 - Y^2 X^2 * (a - d * Y^2) = 1 - Y^2 X^2 = (1 - Y^2) / (a - d * Y^2)

Attempts to recover the x-coordinate given an y-coordinate. The resulting point is not guaranteed to be in the prime order subgroup.

If and only if greatest is set will the lexicographically largest x-coordinate be selected.

a * X^2 + Y^2 = 1 + d * X^2 * Y^2 a * X^2 - d * X^2 * Y^2 = 1 - Y^2 X^2 * (a - d * Y^2) = 1 - Y^2 X^2 = (1 - Y^2) / (a - d * Y^2)

Checks that the current point is on the elliptic curve.

Checks if self is in the subgroup having order equaling that of P::ScalarField given it is on the curve.

Trait Implementations§

The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more

Multiplies this element by the cofactor and output the resulting projective element.

Performs cofactor clearing. The default method is simply to multiply by the cofactor. Some curves can implement a more efficient algorithm.

The finite field over which this curve is defined.
The projective representation of points on this curve.
Returns the x and y coordinates of this affine point.
Returns a fixed generator of unknown exponent.
Returns the point at infinity.
Returns a group element if the set of bytes forms a valid group element, otherwise returns None. This function is primarily intended for sampling random group elements from a hash-function or RNG output.
Performs scalar multiplication of this element with mixed addition.
Returns the x coordinate of this affine point.
Returns the y coordinate of this affine point.
Is self the point at infinity?
Converts self into the projective representation.
Multiplies this element by the cofactor.
Multiplies this element by the inverse of the cofactor in Self::ScalarField.
The general deserialize method that takes in customization flags.
The general serialize method that takes in customization flags.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Formats the value using the given formatter. Read more

Generates a uniformly random instance of the curve.

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
Create a distribution of values of ‘S’ by mapping the output of Self through the closure F Read more
Converts to this type from the input type.
Converts to this type from the input type.
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the - operator.
Performs the unary - operation. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
The resulting type after applying the - operator.
Performs the - operation. Read more
Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Checks if this value is equivalent to the given key. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.