[][src]Trait zerocaf::traits::ValidityCheck

pub trait ValidityCheck {
#[must_use]
    fn is_valid(&self) -> Choice;
}

This trait pretends to be a verification in ct_time about a point correctness.

This is done through checking that the (X, Y) coordinates of the point are valid and satisfy the curve equation.

Required methods

#[must_use] fn is_valid(&self) -> Choice

Checks the point coordinates agains the curve equation to validate that the point relies on the curve and its valid.

Returns

  • Choice(0) if the point isn't a valid point.
  • Choice(1) if the point is valid.
Loading content...

Implementors

impl ValidityCheck for AffinePoint[src]

fn is_valid(&self) -> Choice[src]

Verifies if the curve equation holds given the (X, Y) coordinates of a point in Affine Coordinates.

impl ValidityCheck for EdwardsPoint[src]

fn is_valid(&self) -> Choice[src]

Verifies if the curve equation (in projective twisted edwards coordinates) holds given the (X, Y, Z) coordinates of a point in Projective Coordinates.

impl ValidityCheck for ProjectivePoint[src]

fn is_valid(&self) -> Choice[src]

Verifies if the curve equation (in projective twisted edwards coordinates) holds given the (X, Y, Z) coordinates of a point in Projective Coordinates.

impl ValidityCheck for RistrettoPoint[src]

fn is_valid(&self) -> Choice[src]

A valid RistrettoPoint should have exactly order L (Scalar Field Order) and also verify the curve equation.

This trait is mostly implemented for debugging purposes.

Returns

  • `Choice(1) if the point has order L (not 2L, 4L or 8L) & satisfies the curve equation.
  • `Choice(0) if the point does not satisfy one of the conditions mentioned avobe.
Loading content...