pub struct AffinePoint { /* private fields */ }
Expand description

This represents a Jubjub point in the affine (u, v) coordinates.

Implementations

Constructs the neutral element (0, 1).

Determines if this point is the identity.

Multiplies this point by the cofactor, producing an ExtendedPoint

Determines if this point is of small order.

Determines if this point is torsion free and so is in the prime order subgroup.

Determines if this point is prime order, or in other words that the smallest scalar multiplied by this point that produces the identity is r. This is equivalent to checking that the point is both torsion free and not the identity.

Converts this element into its byte representation.

Attempts to interpret a byte representation of an affine point, failing if the element is not on the curve or non-canonical.

Attempts to interpret a byte representation of an affine point, failing if the element is not on the curve.

Most non-canonical encodings will also cause a failure. However, this API preserves (for use in consensus-critical protocols) a bug in the parsing code that caused two non-canonical encodings to be silently accepted:

  • (0, 1), which is the identity;
  • (0, -1), which is a point of order two.

Each of these has a single non-canonical encoding in which the value of the sign bit is 1.

See ZIP 216 for a more detailed description of the bug, as well as its fix.

Attempts to interpret a batch of byte representations of affine points.

Returns None for each element if it is not on the curve, or is non-canonical according to ZIP 216.

Returns the u-coordinate of this point.

Returns the v-coordinate of this point.

Returns an ExtendedPoint for use in arithmetic operations.

Performs a pre-processing step that produces an AffineNielsPoint for use in multiple additions.

Constructs an AffinePoint given u and v without checking that the point 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

The resulting type after applying the + operator.

Performs the + operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the additive identity.

Returns a fixed generator of unknown exponent.

Determines if this point represents the point at infinity; the additive identity. Read more

Converts this element to its curve representation.

Select a or b according to choice. Read more

Conditionally assign other to self, according to choice. Read more

Conditionally swap self and other if choice == 1; otherwise, reassign both unto themselves. Read more

Determine if two items are equal. Read more

Formats the value using the given formatter. Read more

Returns the identity.

Formats the value using the given formatter. Read more

Constructs an affine point from an extended point using the map (U, V, Z, T1, T2) => (U/Z, V/Z) as Z is always nonzero. This requires a field inversion and so it is recommended to perform these in a batch using batch_normalize instead.

Constructs an extended point (with Z = 1) from an affine point using the map (u, v) => (u, v, 1, u, v).

Converts to this type from the input type.

The encoding of group elements. Read more

Attempts to deserialize a group element from its encoding.

Attempts to deserialize a group element, not checking if the element is valid. Read more

Converts this element into its byte encoding. This may or may not support encoding the identity. 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

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

This computes the negation of a point P = (u, v) as -P = (-u, v).

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

The resulting type after applying the - operator.

Performs the - operation. Read more

Performs the -= operation. Read more

Performs the -= operation. 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

Converts self into T using Into<T>. Read more

Causes self to use its Binary implementation when Debug-formatted. Read more

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted. Read more

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Formats each item in a sequence. 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.

Pipes by value. This is generally the method you want to use. Read more

Borrows self and passes that borrow into the pipe function. Read more

Mutably borrows self and passes that borrow into the pipe function. Read more

Borrows self, then passes self.borrow() into the pipe function. Read more

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

Borrows self, then passes self.as_ref() into the pipe function.

Mutably borrows self, then passes self.as_mut() into the pipe function. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

Immutable access to a value. Read more

Mutable access to a value. Read more

Immutable access to the Borrow<B> of a value. Read more

Mutable access to the BorrowMut<B> of a value. Read more

Immutable access to the AsRef<R> view of a value. Read more

Mutable access to the AsMut<R> view of a value. Read more

Immutable access to the Deref::Target of a value. Read more

Mutable access to the Deref::Target of a value. Read more

Calls .tap() only in debug builds, and is erased in release builds.

Calls .tap_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

Converts the given value to a String. Read more

Attempts to convert self into T using TryInto<T>. 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.