pub struct ProjectivePoint<C: ECDSACurve> {
pub inner: AffinePoint<C>,
}Expand description
The SP1 accelerated projective point.
Fields§
§inner: AffinePoint<C>The inner affine point.
SP1 uses affine arithmetic for all operations.
Implementations§
Source§impl<C: ECDSACurve> ProjectivePoint<C>
impl<C: ECDSACurve> ProjectivePoint<C>
pub fn identity() -> Self
Sourcepub fn to_affine(self) -> AffinePoint<C>
pub fn to_affine(self) -> AffinePoint<C>
Convert the projective point to an affine point.
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<&ProjectivePoint<C>> for ProjectivePoint<C>
impl<C: ECDSACurve> Add<&ProjectivePoint<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> Add for ProjectivePoint<C>
impl<C: ECDSACurve> Add 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<&ProjectivePoint<C>> for ProjectivePoint<C>
impl<C: ECDSACurve> AddAssign<&ProjectivePoint<C>> for ProjectivePoint<C>
Source§fn add_assign(&mut self, rhs: &ProjectivePoint<C>)
fn add_assign(&mut self, rhs: &ProjectivePoint<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> AddAssign for ProjectivePoint<C>
impl<C: ECDSACurve> AddAssign for ProjectivePoint<C>
Source§fn add_assign(&mut self, rhs: ProjectivePoint<C>)
fn add_assign(&mut self, rhs: ProjectivePoint<C>)
Performs the
+= operation. Read moreSource§impl<C: Clone + ECDSACurve> Clone for ProjectivePoint<C>
impl<C: Clone + ECDSACurve> Clone for ProjectivePoint<C>
Source§fn clone(&self) -> ProjectivePoint<C>
fn clone(&self) -> ProjectivePoint<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> CofactorGroup for ProjectivePoint<C>
The scalar field has prime order, so the cofactor is 1.
impl<C: ECDSACurve> CofactorGroup for ProjectivePoint<C>
The scalar field has prime order, so the cofactor is 1.
Source§type Subgroup = ProjectivePoint<C>
type Subgroup = ProjectivePoint<C>
The large prime-order subgroup in which cryptographic operations are performed.
If
Self implements PrimeGroup, then Self::Subgroup may be Self.Source§fn clear_cofactor(&self) -> Self
fn clear_cofactor(&self) -> Self
Maps
self to the prime-order subgroup by multiplying this element by some
k-multiple of the cofactor. Read moreSource§fn into_subgroup(self) -> CtOption<Self>
fn into_subgroup(self) -> CtOption<Self>
Returns
self if it is contained in the prime-order subgroup. Read moreSource§fn is_torsion_free(&self) -> Choice
fn is_torsion_free(&self) -> Choice
Determines if this element is “torsion free”, i.e., is contained in the
prime-order subgroup. Read more
Source§fn is_small_order(&self) -> Choice
fn is_small_order(&self) -> Choice
Determines if this element is of small order. Read more
Source§impl<C: ECDSACurve> ConditionallySelectable for ProjectivePoint<C>
impl<C: ECDSACurve> ConditionallySelectable for ProjectivePoint<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 ProjectivePoint<C>
impl<C: ECDSACurve> ConstantTimeEq for ProjectivePoint<C>
Source§impl<C: ECDSACurve> Curve for ProjectivePoint<C>
impl<C: ECDSACurve> Curve for ProjectivePoint<C>
Source§type AffineRepr = AffinePoint<C>
type AffineRepr = AffinePoint<C>
The affine representation for this elliptic curve.
Source§fn to_affine(&self) -> Self::AffineRepr
fn to_affine(&self) -> Self::AffineRepr
Converts this element into its affine representation.
Source§fn batch_normalize(p: &[Self], q: &mut [Self::AffineRepr])
fn batch_normalize(p: &[Self], q: &mut [Self::AffineRepr])
Converts a batch of projective elements into affine elements. This function will
panic if
p.len() != q.len().Source§impl<C: Debug + ECDSACurve> Debug for ProjectivePoint<C>
impl<C: Debug + ECDSACurve> Debug for ProjectivePoint<C>
Source§impl<C: ECDSACurve> Default for ProjectivePoint<C>
impl<C: ECDSACurve> Default for ProjectivePoint<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§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> Group for ProjectivePoint<C>
impl<C: ECDSACurve> Group for ProjectivePoint<C>
Source§type Scalar = <C as CurveArithmetic>::Scalar
type Scalar = <C as CurveArithmetic>::Scalar
Scalars modulo the order of this group’s scalar field.
Source§fn random(rng: impl RngCore) -> Self
fn random(rng: impl RngCore) -> Self
Returns an element chosen uniformly at random from the non-identity elements of
this group. Read more
Source§fn is_identity(&self) -> Choice
fn is_identity(&self) -> Choice
Determines if this point is the identity.
Source§impl<C: ECDSACurve> GroupEncoding for ProjectivePoint<C>
impl<C: ECDSACurve> GroupEncoding for ProjectivePoint<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> LinearCombination for ProjectivePoint<C>
impl<C: ECDSACurve> LinearCombination for ProjectivePoint<C>
Source§impl<C: ECDSACurve, T: Borrow<C::Scalar>> Mul<T> for ProjectivePoint<C>
impl<C: ECDSACurve, T: Borrow<C::Scalar>> Mul<T> for ProjectivePoint<C>
Source§impl<C: ECDSACurve, T: Borrow<C::Scalar>> MulAssign<T> for ProjectivePoint<C>
impl<C: ECDSACurve, T: Borrow<C::Scalar>> MulAssign<T> for ProjectivePoint<C>
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*= operation. Read moreSource§impl<C: ECDSACurve> MulByGenerator for ProjectivePoint<C>
impl<C: ECDSACurve> MulByGenerator for ProjectivePoint<C>
Source§fn mul_by_generator(scalar: &Self::Scalar) -> Self
fn mul_by_generator(scalar: &Self::Scalar) -> Self
Multiply by the generator of the prime-order subgroup.
Source§impl<C: ECDSACurve> Neg for ProjectivePoint<C>
impl<C: ECDSACurve> Neg for ProjectivePoint<C>
Source§impl<C: ECDSACurve> PartialEq for ProjectivePoint<C>
impl<C: ECDSACurve> PartialEq for ProjectivePoint<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<&ProjectivePoint<C>> for ProjectivePoint<C>
impl<C: ECDSACurve> Sub<&ProjectivePoint<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> Sub for ProjectivePoint<C>
impl<C: ECDSACurve> Sub 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<&ProjectivePoint<C>> for ProjectivePoint<C>
impl<C: ECDSACurve> SubAssign<&ProjectivePoint<C>> for ProjectivePoint<C>
Source§fn sub_assign(&mut self, rhs: &ProjectivePoint<C>)
fn sub_assign(&mut self, rhs: &ProjectivePoint<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> SubAssign for ProjectivePoint<C>
impl<C: ECDSACurve> SubAssign for ProjectivePoint<C>
Source§fn sub_assign(&mut self, rhs: ProjectivePoint<C>)
fn sub_assign(&mut self, rhs: ProjectivePoint<C>)
Performs the
-= operation. Read moreSource§impl<'a, C: ECDSACurve> Sum<&'a ProjectivePoint<C>> for ProjectivePoint<C>
impl<'a, C: ECDSACurve> Sum<&'a ProjectivePoint<C>> for ProjectivePoint<C>
Source§fn sum<I: Iterator<Item = &'a ProjectivePoint<C>>>(iter: I) -> Self
fn sum<I: Iterator<Item = &'a ProjectivePoint<C>>>(iter: I) -> Self
Takes an iterator and generates
Self from the elements by “summing up”
the items.Source§impl<C: ECDSACurve> Sum for ProjectivePoint<C>
impl<C: ECDSACurve> Sum for ProjectivePoint<C>
impl<C: Copy + ECDSACurve> Copy for ProjectivePoint<C>
impl<C: ECDSACurve> DefaultIsZeroes for ProjectivePoint<C>
impl<C: ECDSACurve> Eq for ProjectivePoint<C>
impl<C: ECDSACurve> PrimeGroup for ProjectivePoint<C>
Auto Trait Implementations§
impl<C> Freeze for ProjectivePoint<C>
impl<C> RefUnwindSafe for ProjectivePoint<C>
impl<C> Send for ProjectivePoint<C>
impl<C> Sync for ProjectivePoint<C>
impl<C> Unpin for ProjectivePoint<C>
impl<C> UnwindSafe for ProjectivePoint<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