pub struct Affine<P: SWCurveConfig> { /* private fields */ }
Expand description

Affine coordinates for a point on an elliptic curve in short Weierstrass form, over the base field P::BaseField.

Implementations

Constructs a group element from x and y coordinates. Performs checks to ensure that the point is on the curve and is in the right subgroup.

Constructs a group element from x and y coordinates.

Warning

Does not perform any checks to ensure the point is in the curve or is in the right subgroup.

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

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

Returns the two possible y-coordinates corresponding to the given x-coordinate. The corresponding points are not guaranteed to be in the prime-order subgroup, but are guaranteed to be on the curve. That is, this method returns None if the x-coordinate corresponds to a non-curve point.

The results are sorted by lexicographical order. This means that, if P::BaseField: PrimeField, the results are sorted as integers.

Checks if self is a valid point on the curve.

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

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. Read more
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. Read more
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.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
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

If self.is_zero(), returns self (== Self::zero()). Else, returns (x, -y), where self = (x, y).

The resulting type after applying the - operator.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
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. Read more

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

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.