AffinePoint

Struct AffinePoint 

Source
pub struct AffinePoint<C: ECDSACurve> {
    pub inner: C::SP1AffinePoint,
}

Fields§

§inner: C::SP1AffinePoint

Implementations§

Source§

impl<C: ECDSACurve> AffinePoint<C>

Source

pub fn from_field_elements_unchecked( x: FieldElement<C>, y: FieldElement<C>, ) -> Self

Create an affine point from the given field elements, without checking if the point is on the curve.

Source

pub fn field_elements(&self) -> (FieldElement<C>, FieldElement<C>)

Get the x and y field elements of the point.

The returned elements are always normalized.

Source

pub fn generator() -> Self

Get the generator point.

Source

pub fn identity() -> Self

Get the identity point.

Source

pub fn is_identity(&self) -> Choice

Check if the point is the identity point.

Trait Implementations§

Source§

impl<C: ECDSACurve> Add<&AffinePoint<C>> for ProjectivePoint<C>

Source§

type Output = ProjectivePoint<C>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &AffinePoint<C>) -> Self::Output

Performs the + operation. Read more
Source§

impl<C: ECDSACurve> Add<AffinePoint<C>> for ProjectivePoint<C>

Source§

type Output = ProjectivePoint<C>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: AffinePoint<C>) -> Self::Output

Performs the + operation. Read more
Source§

impl<C: ECDSACurve> AddAssign<&AffinePoint<C>> for ProjectivePoint<C>

Source§

fn add_assign(&mut self, rhs: &AffinePoint<C>)

Performs the += operation. Read more
Source§

impl<C: ECDSACurve> AddAssign<AffinePoint<C>> for ProjectivePoint<C>

Source§

fn add_assign(&mut self, rhs: AffinePoint<C>)

Performs the += operation. Read more
Source§

impl<C: ECDSACurve> AffineCoordinates for AffinePoint<C>

Source§

type FieldRepr = GenericArray<u8, <C as Curve>::FieldBytesSize>

Field element representation.
Source§

fn x(&self) -> FieldBytes<C>

Get the affine x-coordinate as a serialized field element.
Source§

fn y_is_odd(&self) -> Choice

Is the affine y-coordinate odd?
Source§

impl<C: Clone + ECDSACurve> Clone for AffinePoint<C>

Source§

fn clone(&self) -> AffinePoint<C>

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<C: ECDSACurve> ConditionallySelectable for AffinePoint<C>

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<C: ECDSACurve> ConstantTimeEq for AffinePoint<C>

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<C: Debug + ECDSACurve> Debug for AffinePoint<C>

Source§

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

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

impl<C: ECDSACurve> DecompactPoint<C> for AffinePoint<C>

Source§

fn decompact(x_bytes: &FieldBytes<C>) -> CtOption<Self>

Attempt to decompact an elliptic curve point
Source§

impl<C: ECDSACurve> DecompressPoint<C> for AffinePoint<C>

Source§

fn decompress(x_bytes: &FieldBytes<C>, y_is_odd: Choice) -> CtOption<Self>

Attempt to decompress an elliptic curve point.
Source§

impl<C: ECDSACurve> Default for AffinePoint<C>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<C: ECDSACurve> From<&AffinePoint<C>> for ProjectivePoint<C>

Source§

fn from(p: &AffinePoint<C>) -> Self

Converts to this type from the input type.
Source§

impl<C: ECDSACurve> From<&AffinePoint<C>> for SharedSecret<C>

Source§

fn from(affine: &AffinePoint<C>) -> SharedSecret<C>

Converts to this type from the input type.
Source§

impl<C: ECDSACurve> From<&ProjectivePoint<C>> for AffinePoint<C>

Source§

fn from(p: &ProjectivePoint<C>) -> Self

Converts to this type from the input type.
Source§

impl<C: ECDSACurve> From<AffinePoint<C>> for ProjectivePoint<C>

Source§

fn from(p: AffinePoint<C>) -> Self

Converts to this type from the input type.
Source§

impl<C: ECDSACurve> From<ProjectivePoint<C>> for AffinePoint<C>

Source§

fn from(p: ProjectivePoint<C>) -> Self

Converts to this type from the input type.
Source§

impl<C: ECDSACurve> FromEncodedPoint<C> for AffinePoint<C>

Source§

fn from_encoded_point(point: &EncodedPoint<C>) -> CtOption<Self>

Deserialize the type this trait is impl’d on from an EncodedPoint.
Source§

impl<C: ECDSACurve> GroupEncoding for AffinePoint<C>

Source§

type Repr = GenericArray<u8, <<C as Curve>::FieldBytesSize as ModulusSize>::CompressedPointSize>

The encoding of group elements. Read more
Source§

fn from_bytes(bytes: &Self::Repr) -> CtOption<Self>

Attempts to deserialize a group element from its encoding.
Source§

fn from_bytes_unchecked(bytes: &Self::Repr) -> CtOption<Self>

Attempts to deserialize a group element, not checking if the element is valid. Read more
Source§

fn to_bytes(&self) -> Self::Repr

Converts this element into its byte encoding. This may or may not support encoding the identity.
Source§

impl<C: ECDSACurve> PartialEq for AffinePoint<C>

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<C: ECDSACurve> Sub<&AffinePoint<C>> for ProjectivePoint<C>

Source§

type Output = ProjectivePoint<C>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &AffinePoint<C>) -> Self::Output

Performs the - operation. Read more
Source§

impl<C: ECDSACurve> Sub<AffinePoint<C>> for ProjectivePoint<C>

Source§

type Output = ProjectivePoint<C>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: AffinePoint<C>) -> Self::Output

Performs the - operation. Read more
Source§

impl<C: ECDSACurve> SubAssign<&AffinePoint<C>> for ProjectivePoint<C>

Source§

fn sub_assign(&mut self, rhs: &AffinePoint<C>)

Performs the -= operation. Read more
Source§

impl<C: ECDSACurve> SubAssign<AffinePoint<C>> for ProjectivePoint<C>

Source§

fn sub_assign(&mut self, rhs: AffinePoint<C>)

Performs the -= operation. Read more
Source§

impl<C: ECDSACurve> ToEncodedPoint<C> for AffinePoint<C>

Source§

fn to_encoded_point(&self, compress: bool) -> EncodedPoint<C>

Serialize this value as a SEC1 EncodedPoint, optionally applying point compression.
Source§

impl<C: Copy + ECDSACurve> Copy for AffinePoint<C>
where C::SP1AffinePoint: Copy,

Source§

impl<C: ECDSACurve> DefaultIsZeroes for AffinePoint<C>

Source§

impl<C: ECDSACurve> Eq for AffinePoint<C>

Auto Trait Implementations§

§

impl<C> Freeze for AffinePoint<C>

§

impl<C> RefUnwindSafe for AffinePoint<C>

§

impl<C> Send for AffinePoint<C>

§

impl<C> Sync for AffinePoint<C>

§

impl<C> Unpin for AffinePoint<C>

§

impl<C> UnwindSafe for AffinePoint<C>

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> 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> Same for T

Source§

type Output = T

Should always be Self
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 = 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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

impl<Z> Zeroize for Z
where Z: DefaultIsZeroes,

Source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.