pub struct JacobianPoint<const LIMBS: usize> {
pub x: FieldElement<LIMBS>,
pub y: FieldElement<LIMBS>,
pub z: FieldElement<LIMBS>,
}Expand description
A point on a short Weierstrass curve in Jacobian projective
coordinates (X, Y, Z).
The corresponding affine point is (X / Z^2, Y / Z^3). The point
at infinity is represented by Z == 0. Working in projective
coordinates lets the point doubling and addition formulas avoid
the field inversion that the affine forms would need on every
operation; only Self::to_affine performs an inversion (once,
at the boundary back to the user-visible representation).
Fields§
§x: FieldElement<LIMBS>Projective X coordinate.
y: FieldElement<LIMBS>Projective Y coordinate.
z: FieldElement<LIMBS>Projective Z coordinate. Z == 0 encodes the point at infinity.
Implementations§
Source§impl<const LIMBS: usize> JacobianPoint<LIMBS>
impl<const LIMBS: usize> JacobianPoint<LIMBS>
Sourcepub fn from_affine(x: FieldElement<LIMBS>, y: FieldElement<LIMBS>) -> Self
pub fn from_affine(x: FieldElement<LIMBS>, y: FieldElement<LIMBS>) -> Self
Create a point from affine coordinates (x, y). Z = 1.
Sourcepub fn is_infinity(&self) -> bool
pub fn is_infinity(&self) -> bool
Returns true if this point is the point at infinity (Z == 0).
Sourcepub fn to_affine(
&self,
p: &[u64; LIMBS],
) -> Option<(FieldElement<LIMBS>, FieldElement<LIMBS>)>
pub fn to_affine( &self, p: &[u64; LIMBS], ) -> Option<(FieldElement<LIMBS>, FieldElement<LIMBS>)>
Convert to affine coordinates (x, y). Returns None for point at infinity.
Trait Implementations§
Source§impl<const LIMBS: usize> Clone for JacobianPoint<LIMBS>
impl<const LIMBS: usize> Clone for JacobianPoint<LIMBS>
Source§fn clone(&self) -> JacobianPoint<LIMBS>
fn clone(&self) -> JacobianPoint<LIMBS>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<const LIMBS: usize> Debug for JacobianPoint<LIMBS>
impl<const LIMBS: usize> Debug for JacobianPoint<LIMBS>
impl<const LIMBS: usize> Copy for JacobianPoint<LIMBS>
Auto Trait Implementations§
impl<const LIMBS: usize> Freeze for JacobianPoint<LIMBS>
impl<const LIMBS: usize> RefUnwindSafe for JacobianPoint<LIMBS>
impl<const LIMBS: usize> Send for JacobianPoint<LIMBS>
impl<const LIMBS: usize> Sync for JacobianPoint<LIMBS>
impl<const LIMBS: usize> Unpin for JacobianPoint<LIMBS>
impl<const LIMBS: usize> UnsafeUnpin for JacobianPoint<LIMBS>
impl<const LIMBS: usize> UnwindSafe for JacobianPoint<LIMBS>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more