pub struct AffinePoint<C: ECDSACurve> {
pub inner: C::SP1AffinePoint,
}Fields§
§inner: C::SP1AffinePointImplementations§
Source§impl<C: ECDSACurve> AffinePoint<C>
impl<C: ECDSACurve> AffinePoint<C>
Sourcepub fn from_field_elements_unchecked(
x: FieldElement<C>,
y: FieldElement<C>,
) -> Self
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.
Sourcepub fn field_elements(&self) -> (FieldElement<C>, FieldElement<C>)
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.
Sourcepub fn is_identity(&self) -> Choice
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>
impl<C: ECDSACurve> Add<&AffinePoint<C>> for ProjectivePoint<C>
Source§type Output = ProjectivePoint<C>
type Output = ProjectivePoint<C>
The resulting type after applying the
+ operator.Source§impl<C: ECDSACurve> Add<AffinePoint<C>> for ProjectivePoint<C>
impl<C: ECDSACurve> Add<AffinePoint<C>> for ProjectivePoint<C>
Source§type Output = ProjectivePoint<C>
type Output = ProjectivePoint<C>
The resulting type after applying the
+ operator.Source§impl<C: ECDSACurve> AddAssign<&AffinePoint<C>> for ProjectivePoint<C>
impl<C: ECDSACurve> AddAssign<&AffinePoint<C>> for ProjectivePoint<C>
Source§fn add_assign(&mut self, rhs: &AffinePoint<C>)
fn add_assign(&mut self, rhs: &AffinePoint<C>)
Performs the
+= operation. Read moreSource§impl<C: ECDSACurve> AddAssign<AffinePoint<C>> for ProjectivePoint<C>
impl<C: ECDSACurve> AddAssign<AffinePoint<C>> for ProjectivePoint<C>
Source§fn add_assign(&mut self, rhs: AffinePoint<C>)
fn add_assign(&mut self, rhs: AffinePoint<C>)
Performs the
+= operation. Read moreSource§impl<C: ECDSACurve> AffineCoordinates for AffinePoint<C>
impl<C: ECDSACurve> AffineCoordinates for AffinePoint<C>
Source§type FieldRepr = GenericArray<u8, <C as Curve>::FieldBytesSize>
type FieldRepr = GenericArray<u8, <C as Curve>::FieldBytesSize>
Field element representation.
Source§fn x(&self) -> FieldBytes<C>
fn x(&self) -> FieldBytes<C>
Get the affine x-coordinate as a serialized field element.
Source§impl<C: Clone + ECDSACurve> Clone for AffinePoint<C>where
C::SP1AffinePoint: Clone,
impl<C: Clone + ECDSACurve> Clone for AffinePoint<C>where
C::SP1AffinePoint: Clone,
Source§fn clone(&self) -> AffinePoint<C>
fn clone(&self) -> AffinePoint<C>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<C: ECDSACurve> ConditionallySelectable for AffinePoint<C>
impl<C: ECDSACurve> ConditionallySelectable for AffinePoint<C>
Source§fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
Source§fn conditional_assign(&mut self, other: &Self, choice: Choice)
fn conditional_assign(&mut self, other: &Self, choice: Choice)
Source§fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
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 moreSource§impl<C: ECDSACurve> ConstantTimeEq for AffinePoint<C>
impl<C: ECDSACurve> ConstantTimeEq for AffinePoint<C>
Source§impl<C: Debug + ECDSACurve> Debug for AffinePoint<C>where
C::SP1AffinePoint: Debug,
impl<C: Debug + ECDSACurve> Debug for AffinePoint<C>where
C::SP1AffinePoint: Debug,
Source§impl<C: ECDSACurve> DecompactPoint<C> for AffinePoint<C>
impl<C: ECDSACurve> DecompactPoint<C> for AffinePoint<C>
Source§fn decompact(x_bytes: &FieldBytes<C>) -> CtOption<Self>
fn decompact(x_bytes: &FieldBytes<C>) -> CtOption<Self>
Attempt to decompact an elliptic curve point
Source§impl<C: ECDSACurve> DecompressPoint<C> for AffinePoint<C>
impl<C: ECDSACurve> DecompressPoint<C> for AffinePoint<C>
Source§fn decompress(x_bytes: &FieldBytes<C>, y_is_odd: Choice) -> CtOption<Self>
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>
impl<C: ECDSACurve> Default for AffinePoint<C>
Source§impl<C: ECDSACurve> From<&AffinePoint<C>> for ProjectivePoint<C>
impl<C: ECDSACurve> From<&AffinePoint<C>> for ProjectivePoint<C>
Source§fn from(p: &AffinePoint<C>) -> Self
fn from(p: &AffinePoint<C>) -> Self
Converts to this type from the input type.
Source§fn from(affine: &AffinePoint<C>) -> SharedSecret<C>
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>
impl<C: ECDSACurve> From<&ProjectivePoint<C>> for AffinePoint<C>
Source§fn from(p: &ProjectivePoint<C>) -> Self
fn from(p: &ProjectivePoint<C>) -> Self
Converts to this type from the input type.
Source§impl<C: ECDSACurve> From<AffinePoint<C>> for ProjectivePoint<C>
impl<C: ECDSACurve> From<AffinePoint<C>> for ProjectivePoint<C>
Source§fn from(p: AffinePoint<C>) -> Self
fn from(p: AffinePoint<C>) -> Self
Converts to this type from the input type.
Source§impl<C: ECDSACurve> From<ProjectivePoint<C>> for AffinePoint<C>
impl<C: ECDSACurve> From<ProjectivePoint<C>> for AffinePoint<C>
Source§fn from(p: ProjectivePoint<C>) -> Self
fn from(p: ProjectivePoint<C>) -> Self
Converts to this type from the input type.
Source§impl<C: ECDSACurve> FromEncodedPoint<C> for AffinePoint<C>
impl<C: ECDSACurve> FromEncodedPoint<C> for AffinePoint<C>
Source§fn from_encoded_point(point: &EncodedPoint<C>) -> CtOption<Self>
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>
impl<C: ECDSACurve> GroupEncoding for AffinePoint<C>
Source§type Repr = GenericArray<u8, <<C as Curve>::FieldBytesSize as ModulusSize>::CompressedPointSize>
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>
fn from_bytes(bytes: &Self::Repr) -> CtOption<Self>
Attempts to deserialize a group element from its encoding.
Source§impl<C: ECDSACurve> PartialEq for AffinePoint<C>
impl<C: ECDSACurve> PartialEq for AffinePoint<C>
Source§impl<C: ECDSACurve> Sub<&AffinePoint<C>> for ProjectivePoint<C>
impl<C: ECDSACurve> Sub<&AffinePoint<C>> for ProjectivePoint<C>
Source§type Output = ProjectivePoint<C>
type Output = ProjectivePoint<C>
The resulting type after applying the
- operator.Source§impl<C: ECDSACurve> Sub<AffinePoint<C>> for ProjectivePoint<C>
impl<C: ECDSACurve> Sub<AffinePoint<C>> for ProjectivePoint<C>
Source§type Output = ProjectivePoint<C>
type Output = ProjectivePoint<C>
The resulting type after applying the
- operator.Source§impl<C: ECDSACurve> SubAssign<&AffinePoint<C>> for ProjectivePoint<C>
impl<C: ECDSACurve> SubAssign<&AffinePoint<C>> for ProjectivePoint<C>
Source§fn sub_assign(&mut self, rhs: &AffinePoint<C>)
fn sub_assign(&mut self, rhs: &AffinePoint<C>)
Performs the
-= operation. Read moreSource§impl<C: ECDSACurve> SubAssign<AffinePoint<C>> for ProjectivePoint<C>
impl<C: ECDSACurve> SubAssign<AffinePoint<C>> for ProjectivePoint<C>
Source§fn sub_assign(&mut self, rhs: AffinePoint<C>)
fn sub_assign(&mut self, rhs: AffinePoint<C>)
Performs the
-= operation. Read moreSource§impl<C: ECDSACurve> ToEncodedPoint<C> for AffinePoint<C>
impl<C: ECDSACurve> ToEncodedPoint<C> for AffinePoint<C>
Source§fn to_encoded_point(&self, compress: bool) -> EncodedPoint<C>
fn to_encoded_point(&self, compress: bool) -> EncodedPoint<C>
Serialize this value as a SEC1
EncodedPoint, optionally applying
point compression.impl<C: Copy + ECDSACurve> Copy for AffinePoint<C>where
C::SP1AffinePoint: Copy,
impl<C: ECDSACurve> DefaultIsZeroes for AffinePoint<C>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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