Skip to main content

Point

Struct Point 

Source
pub struct Point<F> {
    pub x: F,
    pub y: F,
    /* private fields */
}
Expand description

Affine representation of a point on the circle. x^2 + y^2 == 1

Fields§

§x: F§y: F

Implementations§

Source§

impl<F: Field> Point<F>

Source

pub fn new(x: F, y: F) -> Self

Source

pub fn from_projective_line(t: F) -> Self

Circle STARKs, Section 3, Lemma 1: (page 4 of the first revision PDF)

(x, y) = ((1-t^2)/(1+t^2), 2t/(1+t^2))

Panics if t^2 = -1, corresponding to either of the points at infinity (on the projective circle) (1 : ±i : 0)

Source

pub fn to_projective_line(self) -> Option<F>

Circle STARKs, Section 3, Lemma 1: (page 4 of the first revision PDF)

t = y / (x + 1)

Returns None if self.x = -1, corresponding to Inf on the projective line

This is also used as a selector polynomial, with a simple zero at (1,0) and a simple pole at (-1,0), which in the paper is called v_0 Circle STARKs, Section 5.1, Lemma 11 (page 21 of the first revision PDF)

Source

pub fn double(self) -> Self

The “squaring map”, or doubling in additive notation, denoted π(x,y) Circle STARKs, Section 3.1, Equation 1: (page 5 of the first revision PDF)

Source

pub fn repeated_double(self, n: usize) -> Self

Apply the doubling map n times: π^n(x,y)

Source

pub fn v_n(self, log_n: usize) -> F

Evaluate the vanishing polynomial for the standard position coset of size 2^log_n at this point Circle STARKs, Section 3.3, Equation 8 (page 10 of the first revision PDF)

Source

pub fn v_n_prod(self, log_n: usize) -> F

Compute a product of successive v_n’s.

More explicitly this computes (1..log_n).map(|i| self.v_n(i)).product() but uses far fewer self.x.square().double() - F::ONE steps compared to the naive implementation.

Source

pub fn v_tilde_p<EF: ExtensionField<F>>(self, at: Point<EF>) -> EF

Evaluate the selector function which is zero at self and nonzero elsewhere, at at. Called v_0 . T_p⁻¹ or ṽ_p(x,y) in the paper, used for constraint selectors. Panics if p = -self, the pole. Section 5.1, Lemma 11 of Circle Starks (page 21 of first edition PDF)

Source

pub fn s_p_at_p(self, log_n: usize) -> F

The concrete value of the selector s_P = v_n / (v_0 . T_p⁻¹) at P=self, used for normalization. Circle STARKs, Section 5.1, Remark 16 (page 22 of the first revision PDF)

Source

pub fn v_p<EF: ExtensionField<F>>(self, at: Point<EF>) -> (EF, EF)

Evaluate the alternate single-point vanishing function v_p(x), used for DEEP quotient. Returns (a, b), representing the complex number a + bi. Simple zero at p, simple pole at +-infinity. Circle STARKs, Section 3.3, Equation 11 (page 11 of the first edition PDF).

Source§

impl<F: ComplexExtendable> Point<F>

Source

pub fn generator(log_n: usize) -> Self

Trait Implementations§

Source§

impl<F: Field, EF: ExtensionField<F>> Add<Point<F>> for Point<EF>

Source§

type Output = Point<EF>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Point<F>) -> Self::Output

Performs the + operation. Read more
Source§

impl<F: Field> AddAssign for Point<F>

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl<F: Clone> Clone for Point<F>

Source§

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

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<F: Copy> Copy for Point<F>

Source§

impl<F: Debug> Debug for Point<F>

Source§

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

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

impl<F: Eq> Eq for Point<F>

Source§

impl<F: Hash> Hash for Point<F>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<F: Field> Mul<usize> for Point<F>

Source§

type Output = Point<F>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: usize) -> Self::Output

Performs the * operation. Read more
Source§

impl<F: Field> Neg for Point<F>

Circle STARKs, Section 3.1, Equation 2: (page 5 of the first revision PDF) The inverse map J(x,y) = (x,-y)

Source§

type Output = Point<F>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<F: PartialEq> PartialEq for Point<F>

Source§

fn eq(&self, other: &Point<F>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<F: PartialEq> StructuralPartialEq for Point<F>

Source§

impl<F: Field, EF: ExtensionField<F>> Sub<Point<F>> for Point<EF>

Source§

type Output = Point<EF>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Point<F>) -> Self::Output

Performs the - operation. Read more

Auto Trait Implementations§

§

impl<F> Freeze for Point<F>
where F: Freeze,

§

impl<F> RefUnwindSafe for Point<F>
where F: RefUnwindSafe,

§

impl<F> Send for Point<F>
where F: Send,

§

impl<F> Sync for Point<F>
where F: Sync,

§

impl<F> Unpin for Point<F>
where F: Unpin,

§

impl<F> UnsafeUnpin for Point<F>
where F: UnsafeUnpin,

§

impl<F> UnwindSafe for Point<F>
where F: UnwindSafe,

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> Dup for T
where T: Copy + Clone,

Source§

fn dup(&self) -> T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more