Struct k256::ProjectivePoint
source · [−]pub struct ProjectivePoint { /* private fields */ }
Available on crate feature
arithmetic
only.Expand description
A point on the secp256k1 curve in projective coordinates.
Implementations
sourceimpl ProjectivePoint
impl ProjectivePoint
sourcepub const fn identity() -> ProjectivePoint
👎Deprecated since 0.10.2: use ProjectivePoint::IDENTITY
instead
pub const fn identity() -> ProjectivePoint
ProjectivePoint::IDENTITY
insteadReturns the additive identity of SECP256k1, also known as the “neutral element” or “point at infinity”.
sourcepub fn generator() -> ProjectivePoint
👎Deprecated since 0.10.2: use ProjectivePoint::GENERATOR
instead
pub fn generator() -> ProjectivePoint
ProjectivePoint::GENERATOR
insteadReturns the base point of SECP256k1.
sourcepub fn to_affine(&self) -> AffinePoint
pub fn to_affine(&self) -> AffinePoint
Returns the affine representation of this point, or None
if it is the identity.
sourcepub fn double(&self) -> ProjectivePoint
pub fn double(&self) -> ProjectivePoint
Doubles this point.
sourcepub fn endomorphism(&self) -> Self
pub fn endomorphism(&self) -> Self
Calculates SECP256k1 endomorphism: self * lambda
.
sourcepub fn eq_affine(&self, other: &AffinePoint) -> Choice
pub fn eq_affine(&self, other: &AffinePoint) -> Choice
Check whether self
is equal to an affine point.
This is a lot faster than first converting self
to an AffinePoint
and then doing the
comparision. It is a little bit faster than converting other
to a ProjectivePoint
first.
Trait Implementations
sourceimpl Add<&AffinePoint> for &ProjectivePoint
impl Add<&AffinePoint> for &ProjectivePoint
type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
+
operator.sourcefn add(self, other: &AffinePoint) -> ProjectivePoint
fn add(self, other: &AffinePoint) -> ProjectivePoint
Performs the
+
operation. Read moresourceimpl Add<&AffinePoint> for ProjectivePoint
impl Add<&AffinePoint> for ProjectivePoint
type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
+
operator.sourcefn add(self, other: &AffinePoint) -> ProjectivePoint
fn add(self, other: &AffinePoint) -> ProjectivePoint
Performs the
+
operation. Read moresourceimpl Add<&ProjectivePoint> for &ProjectivePoint
impl Add<&ProjectivePoint> for &ProjectivePoint
type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
+
operator.sourcefn add(self, other: &ProjectivePoint) -> ProjectivePoint
fn add(self, other: &ProjectivePoint) -> ProjectivePoint
Performs the
+
operation. Read moresourceimpl Add<&ProjectivePoint> for ProjectivePoint
impl Add<&ProjectivePoint> for ProjectivePoint
type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
+
operator.sourcefn add(self, other: &ProjectivePoint) -> ProjectivePoint
fn add(self, other: &ProjectivePoint) -> ProjectivePoint
Performs the
+
operation. Read moresourceimpl Add<AffinePoint> for ProjectivePoint
impl Add<AffinePoint> for ProjectivePoint
type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
+
operator.sourcefn add(self, other: AffinePoint) -> ProjectivePoint
fn add(self, other: AffinePoint) -> ProjectivePoint
Performs the
+
operation. Read moresourceimpl Add<ProjectivePoint> for ProjectivePoint
impl Add<ProjectivePoint> for ProjectivePoint
type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
+
operator.sourcefn add(self, other: ProjectivePoint) -> ProjectivePoint
fn add(self, other: ProjectivePoint) -> ProjectivePoint
Performs the
+
operation. Read moresourceimpl AddAssign<&AffinePoint> for ProjectivePoint
impl AddAssign<&AffinePoint> for ProjectivePoint
sourcefn add_assign(&mut self, rhs: &AffinePoint)
fn add_assign(&mut self, rhs: &AffinePoint)
Performs the
+=
operation. Read moresourceimpl AddAssign<&ProjectivePoint> for ProjectivePoint
impl AddAssign<&ProjectivePoint> for ProjectivePoint
sourcefn add_assign(&mut self, rhs: &ProjectivePoint)
fn add_assign(&mut self, rhs: &ProjectivePoint)
Performs the
+=
operation. Read moresourceimpl AddAssign<AffinePoint> for ProjectivePoint
impl AddAssign<AffinePoint> for ProjectivePoint
sourcefn add_assign(&mut self, rhs: AffinePoint)
fn add_assign(&mut self, rhs: AffinePoint)
Performs the
+=
operation. Read moresourceimpl AddAssign<ProjectivePoint> for ProjectivePoint
impl AddAssign<ProjectivePoint> for ProjectivePoint
sourcefn add_assign(&mut self, rhs: ProjectivePoint)
fn add_assign(&mut self, rhs: ProjectivePoint)
Performs the
+=
operation. Read moresourceimpl Clone for ProjectivePoint
impl Clone for ProjectivePoint
sourcefn clone(&self) -> ProjectivePoint
fn clone(&self) -> ProjectivePoint
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl ConditionallySelectable for ProjectivePoint
impl ConditionallySelectable for ProjectivePoint
sourcefn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
sourcefn conditional_assign(&mut self, other: &Self, choice: Choice)
fn conditional_assign(&mut self, other: &Self, choice: Choice)
sourceimpl ConstantTimeEq for ProjectivePoint
impl ConstantTimeEq for ProjectivePoint
sourceimpl Curve for ProjectivePoint
impl Curve for ProjectivePoint
type AffineRepr = AffinePoint
type AffineRepr = AffinePoint
The affine representation for this elliptic curve.
sourcefn to_affine(&self) -> AffinePoint
fn to_affine(&self) -> AffinePoint
Converts this element into its affine representation.
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()
. Read moresourceimpl Debug for ProjectivePoint
impl Debug for ProjectivePoint
sourceimpl Default for ProjectivePoint
impl Default for ProjectivePoint
sourceimpl From<&AffinePoint> for ProjectivePoint
impl From<&AffinePoint> for ProjectivePoint
sourcefn from(p: &AffinePoint) -> Self
fn from(p: &AffinePoint) -> Self
Converts to this type from the input type.
sourceimpl From<&ProjectivePoint> for AffinePoint
impl From<&ProjectivePoint> for AffinePoint
sourcefn from(p: &ProjectivePoint) -> AffinePoint
fn from(p: &ProjectivePoint) -> AffinePoint
Converts to this type from the input type.
sourceimpl From<&PublicKey<Secp256k1>> for ProjectivePoint
impl From<&PublicKey<Secp256k1>> for ProjectivePoint
sourcefn from(public_key: &PublicKey) -> ProjectivePoint
fn from(public_key: &PublicKey) -> ProjectivePoint
Converts to this type from the input type.
sourceimpl From<&VerifyingKey> for ProjectivePoint
Available on crate feature ecdsa-core
only.
impl From<&VerifyingKey> for ProjectivePoint
Available on crate feature
ecdsa-core
only.sourcefn from(verifying_key: &VerifyingKey) -> ProjectivePoint
fn from(verifying_key: &VerifyingKey) -> ProjectivePoint
Converts to this type from the input type.
sourceimpl From<AffinePoint> for ProjectivePoint
impl From<AffinePoint> for ProjectivePoint
sourcefn from(p: AffinePoint) -> Self
fn from(p: AffinePoint) -> Self
Converts to this type from the input type.
sourceimpl From<ProjectivePoint> for AffinePoint
impl From<ProjectivePoint> for AffinePoint
sourcefn from(p: ProjectivePoint) -> AffinePoint
fn from(p: ProjectivePoint) -> AffinePoint
Converts to this type from the input type.
sourceimpl From<PublicKey<Secp256k1>> for ProjectivePoint
impl From<PublicKey<Secp256k1>> for ProjectivePoint
sourcefn from(public_key: PublicKey) -> ProjectivePoint
fn from(public_key: PublicKey) -> ProjectivePoint
Converts to this type from the input type.
sourceimpl From<VerifyingKey> for ProjectivePoint
Available on crate feature ecdsa-core
only.
impl From<VerifyingKey> for ProjectivePoint
Available on crate feature
ecdsa-core
only.sourcefn from(verifying_key: VerifyingKey) -> ProjectivePoint
fn from(verifying_key: VerifyingKey) -> ProjectivePoint
Converts to this type from the input type.
sourceimpl FromEncodedPoint<Secp256k1> for ProjectivePoint
impl FromEncodedPoint<Secp256k1> for ProjectivePoint
sourcefn from_encoded_point(p: &EncodedPoint) -> CtOption<Self>
fn from_encoded_point(p: &EncodedPoint) -> CtOption<Self>
Deserialize the type this trait is impl’d on from an
EncodedPoint
.sourceimpl Group for ProjectivePoint
impl Group for ProjectivePoint
sourceimpl GroupEncoding for ProjectivePoint
impl GroupEncoding for ProjectivePoint
type Repr = GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B1>>
type Repr = GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B1>>
The encoding of group elements. Read more
sourcefn from_bytes(bytes: &Self::Repr) -> CtOption<Self>
fn from_bytes(bytes: &Self::Repr) -> CtOption<Self>
Attempts to deserialize a group element from its encoding.
sourcefn from_bytes_unchecked(bytes: &Self::Repr) -> CtOption<Self>
fn from_bytes_unchecked(bytes: &Self::Repr) -> CtOption<Self>
Attempts to deserialize a group element, not checking if the element is valid. Read more
sourceimpl LinearCombination for ProjectivePoint
impl LinearCombination for ProjectivePoint
sourcefn lincomb(
x: &ProjectivePoint,
k: &Scalar,
y: &ProjectivePoint,
l: &Scalar
) -> ProjectivePoint
fn lincomb(
x: &ProjectivePoint,
k: &Scalar,
y: &ProjectivePoint,
l: &Scalar
) -> ProjectivePoint
Calculates
x * k + y * l
.sourceimpl Mul<&Scalar> for &ProjectivePoint
impl Mul<&Scalar> for &ProjectivePoint
type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
*
operator.sourcefn mul(self, other: &Scalar) -> ProjectivePoint
fn mul(self, other: &Scalar) -> ProjectivePoint
Performs the
*
operation. Read moresourceimpl Mul<&Scalar> for ProjectivePoint
impl Mul<&Scalar> for ProjectivePoint
type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
*
operator.sourcefn mul(self, other: &Scalar) -> ProjectivePoint
fn mul(self, other: &Scalar) -> ProjectivePoint
Performs the
*
operation. Read moresourceimpl Mul<Scalar> for ProjectivePoint
impl Mul<Scalar> for ProjectivePoint
type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
*
operator.sourcefn mul(self, other: Scalar) -> ProjectivePoint
fn mul(self, other: Scalar) -> ProjectivePoint
Performs the
*
operation. Read moresourceimpl MulAssign<&Scalar> for ProjectivePoint
impl MulAssign<&Scalar> for ProjectivePoint
sourcefn mul_assign(&mut self, rhs: &Scalar)
fn mul_assign(&mut self, rhs: &Scalar)
Performs the
*=
operation. Read moresourceimpl MulAssign<Scalar> for ProjectivePoint
impl MulAssign<Scalar> for ProjectivePoint
sourcefn mul_assign(&mut self, rhs: Scalar)
fn mul_assign(&mut self, rhs: Scalar)
Performs the
*=
operation. Read moresourceimpl<'a> Neg for &'a ProjectivePoint
impl<'a> Neg for &'a ProjectivePoint
type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
-
operator.sourcefn neg(self) -> ProjectivePoint
fn neg(self) -> ProjectivePoint
Performs the unary
-
operation. Read moresourceimpl Neg for ProjectivePoint
impl Neg for ProjectivePoint
type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
-
operator.sourcefn neg(self) -> ProjectivePoint
fn neg(self) -> ProjectivePoint
Performs the unary
-
operation. Read moresourceimpl PartialEq<AffinePoint> for ProjectivePoint
impl PartialEq<AffinePoint> for ProjectivePoint
sourcefn eq(&self, other: &AffinePoint) -> bool
fn eq(&self, other: &AffinePoint) -> bool
sourceimpl PartialEq<ProjectivePoint> for AffinePoint
impl PartialEq<ProjectivePoint> for AffinePoint
sourcefn eq(&self, other: &ProjectivePoint) -> bool
fn eq(&self, other: &ProjectivePoint) -> bool
sourceimpl PartialEq<ProjectivePoint> for ProjectivePoint
impl PartialEq<ProjectivePoint> for ProjectivePoint
sourceimpl PrimeCurve for ProjectivePoint
impl PrimeCurve for ProjectivePoint
type Affine = AffinePoint
sourceimpl Sub<&AffinePoint> for &ProjectivePoint
impl Sub<&AffinePoint> for &ProjectivePoint
type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
-
operator.sourcefn sub(self, other: &AffinePoint) -> ProjectivePoint
fn sub(self, other: &AffinePoint) -> ProjectivePoint
Performs the
-
operation. Read moresourceimpl Sub<&AffinePoint> for ProjectivePoint
impl Sub<&AffinePoint> for ProjectivePoint
type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
-
operator.sourcefn sub(self, other: &AffinePoint) -> ProjectivePoint
fn sub(self, other: &AffinePoint) -> ProjectivePoint
Performs the
-
operation. Read moresourceimpl Sub<&ProjectivePoint> for &ProjectivePoint
impl Sub<&ProjectivePoint> for &ProjectivePoint
type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
-
operator.sourcefn sub(self, other: &ProjectivePoint) -> ProjectivePoint
fn sub(self, other: &ProjectivePoint) -> ProjectivePoint
Performs the
-
operation. Read moresourceimpl Sub<&ProjectivePoint> for ProjectivePoint
impl Sub<&ProjectivePoint> for ProjectivePoint
type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
-
operator.sourcefn sub(self, other: &ProjectivePoint) -> ProjectivePoint
fn sub(self, other: &ProjectivePoint) -> ProjectivePoint
Performs the
-
operation. Read moresourceimpl Sub<AffinePoint> for ProjectivePoint
impl Sub<AffinePoint> for ProjectivePoint
type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
-
operator.sourcefn sub(self, other: AffinePoint) -> ProjectivePoint
fn sub(self, other: AffinePoint) -> ProjectivePoint
Performs the
-
operation. Read moresourceimpl Sub<ProjectivePoint> for ProjectivePoint
impl Sub<ProjectivePoint> for ProjectivePoint
type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
-
operator.sourcefn sub(self, other: ProjectivePoint) -> ProjectivePoint
fn sub(self, other: ProjectivePoint) -> ProjectivePoint
Performs the
-
operation. Read moresourceimpl SubAssign<&AffinePoint> for ProjectivePoint
impl SubAssign<&AffinePoint> for ProjectivePoint
sourcefn sub_assign(&mut self, rhs: &AffinePoint)
fn sub_assign(&mut self, rhs: &AffinePoint)
Performs the
-=
operation. Read moresourceimpl SubAssign<&ProjectivePoint> for ProjectivePoint
impl SubAssign<&ProjectivePoint> for ProjectivePoint
sourcefn sub_assign(&mut self, rhs: &ProjectivePoint)
fn sub_assign(&mut self, rhs: &ProjectivePoint)
Performs the
-=
operation. Read moresourceimpl SubAssign<AffinePoint> for ProjectivePoint
impl SubAssign<AffinePoint> for ProjectivePoint
sourcefn sub_assign(&mut self, rhs: AffinePoint)
fn sub_assign(&mut self, rhs: AffinePoint)
Performs the
-=
operation. Read moresourceimpl SubAssign<ProjectivePoint> for ProjectivePoint
impl SubAssign<ProjectivePoint> for ProjectivePoint
sourcefn sub_assign(&mut self, rhs: ProjectivePoint)
fn sub_assign(&mut self, rhs: ProjectivePoint)
Performs the
-=
operation. Read moresourceimpl<'a> Sum<&'a ProjectivePoint> for ProjectivePoint
impl<'a> Sum<&'a ProjectivePoint> for ProjectivePoint
sourcefn sum<I: Iterator<Item = &'a ProjectivePoint>>(iter: I) -> Self
fn sum<I: Iterator<Item = &'a ProjectivePoint>>(iter: I) -> Self
Method which takes an iterator and generates
Self
from the elements by
“summing up” the items. Read moresourceimpl Sum<ProjectivePoint> for ProjectivePoint
impl Sum<ProjectivePoint> for ProjectivePoint
sourceimpl ToEncodedPoint<Secp256k1> for ProjectivePoint
impl ToEncodedPoint<Secp256k1> for ProjectivePoint
sourcefn to_encoded_point(&self, compress: bool) -> EncodedPoint
fn to_encoded_point(&self, compress: bool) -> EncodedPoint
Serialize this value as a SEC1
EncodedPoint
, optionally applying
point compression. Read moresourceimpl TryFrom<&ProjectivePoint> for PublicKey
impl TryFrom<&ProjectivePoint> for PublicKey
sourceimpl TryFrom<&ProjectivePoint> for VerifyingKey
Available on crate feature ecdsa-core
only.
impl TryFrom<&ProjectivePoint> for VerifyingKey
Available on crate feature
ecdsa-core
only.sourcefn try_from(point: &ProjectivePoint) -> Result<VerifyingKey, Error>
fn try_from(point: &ProjectivePoint) -> Result<VerifyingKey, Error>
Performs the conversion.
sourceimpl TryFrom<ProjectivePoint> for PublicKey
impl TryFrom<ProjectivePoint> for PublicKey
sourceimpl TryFrom<ProjectivePoint> for VerifyingKey
Available on crate feature ecdsa-core
only.
impl TryFrom<ProjectivePoint> for VerifyingKey
Available on crate feature
ecdsa-core
only.sourcefn try_from(point: ProjectivePoint) -> Result<VerifyingKey, Error>
fn try_from(point: ProjectivePoint) -> Result<VerifyingKey, Error>
Performs the conversion.
impl Copy for ProjectivePoint
impl DefaultIsZeroes for ProjectivePoint
impl Eq for ProjectivePoint
impl PrimeGroup for ProjectivePoint
Auto Trait Implementations
impl RefUnwindSafe for ProjectivePoint
impl Send for ProjectivePoint
impl Sync for ProjectivePoint
impl Unpin for ProjectivePoint
impl UnwindSafe for ProjectivePoint
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more