Struct k256::ProjectivePoint
source · [−]pub struct ProjectivePoint { /* private fields */ }
arithmetic
only.Expand description
A point on the secp256k1 curve in projective coordinates.
Implementations
sourceimpl ProjectivePoint
impl ProjectivePoint
sourcepub const IDENTITY: Self = Self {
x: FieldElement::ZERO,
y: FieldElement::ONE,
z: FieldElement::ZERO,
}
pub const IDENTITY: Self = Self { x: FieldElement::ZERO, y: FieldElement::ONE, z: FieldElement::ZERO, }
Additive identity of the group: the point at infinity.
sourcepub const GENERATOR: Self = Self {
x: AffinePoint::GENERATOR.x,
y: AffinePoint::GENERATOR.y,
z: FieldElement::ONE,
}
pub const GENERATOR: Self = Self { x: AffinePoint::GENERATOR.x, y: AffinePoint::GENERATOR.y, z: FieldElement::ONE, }
Base point of secp256k1.
sourcepub const fn identity() -> ProjectivePoint
👎 Deprecated since 0.10.2: use ProjectivePoint::IDENTITY
instead
pub const fn identity() -> ProjectivePoint
use ProjectivePoint::IDENTITY
instead
Returns 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
use ProjectivePoint::GENERATOR
instead
Returns 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
.
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 more
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 more
sourceimpl 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 more
sourceimpl 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 more
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 more
sourceimpl 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 more
sourceimpl 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 more
sourceimpl 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 more
sourceimpl 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 more
sourceimpl 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 more
sourceimpl 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 more
sourceimpl ConditionallySelectable for ProjectivePoint
impl ConditionallySelectable for ProjectivePoint
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 more
sourceimpl 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
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
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 more
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 more
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 more
sourceimpl 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 more
sourceimpl 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 more
sourceimpl 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 more
sourceimpl<'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 more
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 more
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 more
sourceimpl 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 more
sourceimpl 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 more
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 more
sourceimpl 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 more
sourceimpl 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 more
sourceimpl 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 more
sourceimpl 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 more
sourceimpl 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 more
sourceimpl<'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 more
sourceimpl 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 more
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
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
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ConditionallyNegatable for T where
T: ConditionallySelectable,
&'a T: for<'a> Neg,
<&'a T as Neg>::Output == T,
impl<T> ConditionallyNegatable for T where
T: ConditionallySelectable,
&'a T: for<'a> Neg,
<&'a T as Neg>::Output == T,
sourcefn conditional_negate(&mut self, choice: Choice)
fn conditional_negate(&mut self, choice: Choice)
Negate self
if choice == Choice(1)
; otherwise, leave it
unchanged. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more