Skip to main content

JacobiIntersectionPoint

Struct JacobiIntersectionPoint 

Source
pub struct JacobiIntersectionPoint<F: FieldOps> {
    pub s: F,
    pub c: F,
    pub d: F,
}
Expand description

An affine point $(s, c, d)$ on a Jacobi intersection.

Fields§

§s: F

The coordinate s of the point

§c: F

The coordinate c of the point

§d: F

The coordinate d of the point

Implementations§

Source§

impl<F: FieldOps> JacobiIntersectionPoint<F>

Source

pub fn new(s: F, c: F, d: F) -> Self

Creates a new point on a Jacobi intersection

The point should satisfy $$ s^2 + c^2 = 1 \quad a s^2 + d^2 = 1. $$

§Arguments
  • s - Element of F (type: F)
  • c - Element of F (type: F)
  • d - Element of F (type: F)
§Returns

Returns the point on the Jacobi intersection (type: Self)

Source

pub fn identity() -> Self

The neutral element $(0, 1, 1)$.

Source

pub fn is_identity(&self) -> bool

Checks if the point is the indentity point

§Arguments
  • &self - A point on the curve (type: self)
§Returns

True if and only if it is $(0,1,1)$ (type: bool)

Source§

impl<F: FieldOps> JacobiIntersectionPoint<F>

Source

pub fn negate(&self, _curve: &JacobiIntersectionCurve<F>) -> Self

Negation: -(s, c, d) = (-s, c, d).

Source

pub fn add(&self, other: &Self, curve: &JacobiIntersectionCurve<F>) -> Self

Affine addition formulas from the EFD:

s₃ = (c₂ s₁ d₂ + d₁ s₂ c₁)/(c₂² + (d₁ s₂)²)
c₃ = (c₂ c₁ - d₁ s₂ s₁ d₂)/(c₂² + (d₁ s₂)²)
d₃ = (d₁ d₂ - a s₁ c₁ s₂ c₂)/(c₂² + (d₁ s₂)²).
Source

pub fn double(&self, curve: &JacobiIntersectionCurve<F>) -> Self

Affine doubling formulas from the EFD:

s₃ = 2c s d / (c² + (d s)²)
c₃ = (c² - d² s²) / (c² + (d s)²)
d₃ = (d² - a s² c²) / (c² + (d s)²).
Source

pub fn scalar_mul(&self, k: &[u64], curve: &JacobiIntersectionCurve<F>) -> Self

Scalar multiplication on the curve

Multiplies a point by an integers

§Arguments
  • &self - Point on the curve (type: Self)
  • k - An integer represented as a vec of u64 (type: &[u64])
  • curve - The curve on which self lies (type: &JacobiIntersectionCurve<F>)
§Returns

The point k * self (type: Self)

Trait Implementations§

Source§

impl<F: Clone + FieldOps> Clone for JacobiIntersectionPoint<F>

Source§

fn clone(&self) -> JacobiIntersectionPoint<F>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<F> ConditionallySelectable for JacobiIntersectionPoint<F>
where F: FieldOps + Copy,

Source§

fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self

Select a or b according to choice. Read more
Source§

fn conditional_assign(&mut self, other: &Self, choice: Choice)

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

fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)

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

impl<F> ConstantTimeEq for JacobiIntersectionPoint<F>

Source§

fn ct_eq(&self, other: &Self) -> Choice

Determine if two items are equal. Read more
Source§

fn ct_ne(&self, other: &Self) -> Choice

Determine if two items are NOT equal. Read more
Source§

impl<F: Debug + FieldOps> Debug for JacobiIntersectionPoint<F>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<F> Display for JacobiIntersectionPoint<F>
where F: FieldOps + Display,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<F: FieldOps> PartialEq for JacobiIntersectionPoint<F>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<F: FieldOps> PointAdd for JacobiIntersectionPoint<F>

Source§

fn add(&self, other: &Self, curve: &Self::Curve) -> Self

Add a pair of points
Source§

impl<F: FieldOps> PointOps for JacobiIntersectionPoint<F>

Source§

type BaseField = F

The base field $\mathbb{F}_{p^M}$
Source§

type Curve = JacobiIntersectionCurve<F>

The elliptic curve we’re working on
Source§

fn identity(_curve: &Self::Curve) -> Self

Returns the identity
Source§

fn is_identity(&self) -> bool

Returns true if and only if self is the identity
Source§

fn negate(&self, curve: &Self::Curve) -> Self

Negate a point
Source§

fn scalar_mul(&self, k: &[u64], curve: &Self::Curve) -> Self

Scalar multiplication [k]P (variable-time double-and-add). Read more
Source§

impl<F: Copy + FieldOps> Copy for JacobiIntersectionPoint<F>

Source§

impl<F: FieldOps> Eq for JacobiIntersectionPoint<F>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.