Struct hacspec_weierstrass::EllipticCurvePoint
source · pub struct EllipticCurvePoint<T> { /* private fields */ }Implementations§
source§impl<T: Numeric + NumericCopy + PartialEq + Integer + Div<Output = T>> EllipticCurvePoint<T>
impl<T: Numeric + NumericCopy + PartialEq + Integer + Div<Output = T>> EllipticCurvePoint<T>
sourcepub fn new(
x: T,
y: T,
isPointAtInfinity: bool,
curve: WeiestrassCurve<T>
) -> EllipticCurvePoint<T>
pub fn new(
x: T,
y: T,
isPointAtInfinity: bool,
curve: WeiestrassCurve<T>
) -> EllipticCurvePoint<T>
Create point on a weierstrass curve. If given point is not on the curve, the point at infinity will be created instead.
Arguments
x- the x-coordinatey- the y-coordinateisPointAtInfinity- the size of the scalar field used for scalar multiplication- ‘curve’ - The ‘WeiestrassCurve
’ object defining the curve
sourcepub fn is_identity(self) -> bool
pub fn is_identity(self) -> bool
Checks if point is identity/point at infinity
sourcepub fn double(self) -> EllipticCurvePoint<T>
pub fn double(self) -> EllipticCurvePoint<T>
Doubles point
sourcepub fn neg(self) -> EllipticCurvePoint<T>
pub fn neg(self) -> EllipticCurvePoint<T>
negates point as (x,-y)
sourcepub fn is_on_curve(self) -> bool
pub fn is_on_curve(self) -> bool
Checks if point is on the curve point is on the curve IFF the point satisfies the Weiestrass equation: Yˆ2 + a_1XY + a_3Y = xˆ3 + a_2Xˆ2 + a_4X + a_6 or it is the point at infinity
Trait Implementations§
source§impl<T: Numeric + NumericCopy + PartialEq + Integer + Div<Output = T>> Add<EllipticCurvePoint<T>> for EllipticCurvePoint<T>
impl<T: Numeric + NumericCopy + PartialEq + Integer + Div<Output = T>> Add<EllipticCurvePoint<T>> for EllipticCurvePoint<T>
source§fn add(self, other: EllipticCurvePoint<T>) -> Self
fn add(self, other: EllipticCurvePoint<T>) -> Self
Adds two curve points
§type Output = EllipticCurvePoint<T>
type Output = EllipticCurvePoint<T>
The resulting type after applying the
+ operator.source§impl<T: Clone> Clone for EllipticCurvePoint<T>
impl<T: Clone> Clone for EllipticCurvePoint<T>
source§fn clone(&self) -> EllipticCurvePoint<T>
fn clone(&self) -> EllipticCurvePoint<T>
Returns a copy 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 more