[−][src]Struct zerocaf::edwards::EdwardsPoint
An EdwardsPoint
represents a point on the Sonny Curve which is expressed
in the Twisted Edwards Extended Coordinates format, eg. (X, Y, Z, T).
Extended coordinates represent X & Y as(X Y Z T)
satisfying the following equations:
X=X/Z
Y=Y/Z
X*Y=T/Z
Fields
X: FieldElement
Y: FieldElement
Z: FieldElement
T: FieldElement
Methods
impl EdwardsPoint
[src][−]
pub fn to_montgomery(&self) -> MontgomeryPoint
[src][−]
Convert this EdwardsPoint
on the Edwards model to the
corresponding MontgomeryPoint
on the Montgomery model.
pub fn coset4(&self) -> [EdwardsPoint; 4]
[src][−]
Prints the 4Coset where the input EdwardsPoint
lives in.
pub fn compress(&self) -> CompressedEdwardsY
[src][−]
Compress this point to CompressedEdwardsY
format.
pub fn new_from_y_coord(y: &FieldElement, sign: Choice) -> Option<EdwardsPoint>
[src][−]
This function tries to build a Point over the Sonny Curve from
a Y
coordinate and a Choice that determines the sign of the X
coordinate that the user wants to use.
The function gets X
by solving:
+-X = mod_sqrt((y^2 -1)/(dy^2 - a))
.
The sign of x
is choosen with a Choice
parameter.
For Choice(0) -> Negative result. For Choice(1) -> Positive result.
Then Z is always equal to 1
.
Returns
Some(EdwardsPoint)
if there exists a result for themod_sqrt
.None
if the resultingx^2
isn't a QR moduloFIELD_L
.
pub fn new_random_point<T: Rng + CryptoRng>(rand: &mut T) -> EdwardsPoint
[src][−]
This function tries to build a Point over the Sonny Curve from
a random Y
coordinate and a random Choice that determines the
sign of the X
coordinate.
Trait Implementations
impl<'a, 'b> Add<&'b EdwardsPoint> for &'a EdwardsPoint
[src][+]
impl Add<EdwardsPoint> for EdwardsPoint
[src][+]
impl Clone for EdwardsPoint
[src][+]
impl ConstantTimeEq for EdwardsPoint
[src][+]
impl Copy for EdwardsPoint
[src]
impl Debug for EdwardsPoint
[src][+]
impl Default for EdwardsPoint
[src][+]
impl<'a> Double for &'a EdwardsPoint
[src][+]
impl Eq for EdwardsPoint
[src]
impl From<AffinePoint> for EdwardsPoint
[src][+]
impl From<EdwardsPoint> for ProjectivePoint
[src][+]
impl From<EdwardsPoint> for AffinePoint
[src][+]
impl From<ProjectivePoint> for EdwardsPoint
[src][+]
impl Identity for EdwardsPoint
[src][+]
impl<'a, 'b> Mul<&'b Scalar> for &'a EdwardsPoint
[src][+]
impl Mul<Scalar> for EdwardsPoint
[src][+]
impl<'a> Neg for &'a EdwardsPoint
[src][+]
impl Neg for EdwardsPoint
[src][+]
impl PartialEq<EdwardsPoint> for EdwardsPoint
[src][+]
impl<'a, 'b> Sub<&'b EdwardsPoint> for &'a EdwardsPoint
[src][+]
impl Sub<EdwardsPoint> for EdwardsPoint
[src][+]
impl ValidityCheck for EdwardsPoint
[src][+]
Auto Trait Implementations
impl RefUnwindSafe for EdwardsPoint
impl Send for EdwardsPoint
impl Sync for EdwardsPoint
impl Unpin for EdwardsPoint
impl UnwindSafe for EdwardsPoint
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> Clear for T where
T: InitializableFromZeroed + ?Sized,
[+]
T: InitializableFromZeroed + ?Sized,
impl<T> From<T> for T
[src][+]
impl<T> InitializableFromZeroed for T where
T: Default,
[+]
T: Default,
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[+]
V: MultiLane<T>,