Struct k256::AffinePoint
source · [−]pub struct AffinePoint { /* private fields */ }
Available on crate feature
arithmetic
only.Expand description
secp256k1 curve point expressed in affine coordinates.
serde
support
When the serde
feature of this crate is enabled, the Serialize
and
Deserialize
traits are impl’d for this type.
The serialization uses the SEC1 Elliptic-Curve-Point-to-Octet-String
encoding, serialized as binary.
When serialized with a text-based format, the SEC1 representation is subsequently hex encoded.
Implementations
sourceimpl AffinePoint
impl AffinePoint
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<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 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<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 AffineXCoordinate<Secp256k1> for AffinePoint
impl AffineXCoordinate<Secp256k1> for AffinePoint
sourcefn x(&self) -> FieldBytes
fn x(&self) -> FieldBytes
Get the affine x-coordinate as a serialized field element.
sourceimpl Clone for AffinePoint
impl Clone for AffinePoint
sourcefn clone(&self) -> AffinePoint
fn clone(&self) -> AffinePoint
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 AffinePoint
impl ConditionallySelectable for AffinePoint
sourcefn conditional_select(
a: &AffinePoint,
b: &AffinePoint,
choice: Choice
) -> AffinePoint
fn conditional_select(
a: &AffinePoint,
b: &AffinePoint,
choice: Choice
) -> AffinePoint
sourcefn conditional_assign(&mut self, other: &Self, choice: Choice)
fn conditional_assign(&mut self, other: &Self, choice: Choice)
sourceimpl ConstantTimeEq for AffinePoint
impl ConstantTimeEq for AffinePoint
sourcefn ct_eq(&self, other: &AffinePoint) -> Choice
fn ct_eq(&self, other: &AffinePoint) -> Choice
Determine if two items are equal. Read more
sourceimpl Debug for AffinePoint
impl Debug for AffinePoint
sourceimpl DecompactPoint<Secp256k1> for AffinePoint
impl DecompactPoint<Secp256k1> for AffinePoint
Decompaction using Taproot conventions as described in BIP 340.
sourcefn decompact(x_bytes: &FieldBytes) -> CtOption<Self>
fn decompact(x_bytes: &FieldBytes) -> CtOption<Self>
Attempt to decompact an elliptic curve point
sourceimpl DecompressPoint<Secp256k1> for AffinePoint
impl DecompressPoint<Secp256k1> for AffinePoint
sourcefn decompress(x_bytes: &FieldBytes, y_is_odd: Choice) -> CtOption<Self>
fn decompress(x_bytes: &FieldBytes, y_is_odd: Choice) -> CtOption<Self>
Attempt to decompress an elliptic curve point.
sourceimpl Default for AffinePoint
impl Default for AffinePoint
sourceimpl From<&AffinePoint> for EncodedPoint
impl From<&AffinePoint> for EncodedPoint
sourcefn from(affine_point: &AffinePoint) -> EncodedPoint
fn from(affine_point: &AffinePoint) -> EncodedPoint
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.
sourcefn from(affine: &AffinePoint) -> SharedSecret
fn from(affine: &AffinePoint) -> SharedSecret
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 AffinePoint
impl From<&PublicKey<Secp256k1>> for AffinePoint
sourcefn from(public_key: &PublicKey) -> AffinePoint
fn from(public_key: &PublicKey) -> AffinePoint
Converts to this type from the input type.
sourceimpl From<&VerifyingKey> for AffinePoint
Available on crate feature schnorr
only.
impl From<&VerifyingKey> for AffinePoint
Available on crate feature
schnorr
only.sourcefn from(vk: &VerifyingKey) -> AffinePoint
fn from(vk: &VerifyingKey) -> AffinePoint
Converts to this type from the input type.
sourceimpl From<AffinePoint> for EncodedPoint
impl From<AffinePoint> for EncodedPoint
sourcefn from(affine_point: AffinePoint) -> EncodedPoint
fn from(affine_point: AffinePoint) -> EncodedPoint
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 AffinePoint
impl From<PublicKey<Secp256k1>> for AffinePoint
sourcefn from(public_key: PublicKey) -> AffinePoint
fn from(public_key: PublicKey) -> AffinePoint
Converts to this type from the input type.
sourceimpl From<VerifyingKey> for AffinePoint
Available on crate feature schnorr
only.
impl From<VerifyingKey> for AffinePoint
Available on crate feature
schnorr
only.sourcefn from(vk: VerifyingKey) -> AffinePoint
fn from(vk: VerifyingKey) -> AffinePoint
Converts to this type from the input type.
sourceimpl FromEncodedPoint<Secp256k1> for AffinePoint
impl FromEncodedPoint<Secp256k1> for AffinePoint
sourcefn from_encoded_point(encoded_point: &EncodedPoint) -> CtOption<Self>
fn from_encoded_point(encoded_point: &EncodedPoint) -> CtOption<Self>
Attempts to parse the given EncodedPoint
as an SEC1-encoded AffinePoint
.
Returns
None
value if encoded_point
is not on the secp256k1 curve.
sourceimpl GroupEncoding for AffinePoint
impl GroupEncoding for AffinePoint
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 Mul<&Scalar> for AffinePoint
impl Mul<&Scalar> for AffinePoint
type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
*
operator.sourcefn mul(self, scalar: &Scalar) -> ProjectivePoint
fn mul(self, scalar: &Scalar) -> ProjectivePoint
Performs the
*
operation. Read moresourceimpl Mul<Scalar> for AffinePoint
impl Mul<Scalar> for AffinePoint
type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
*
operator.sourcefn mul(self, scalar: Scalar) -> ProjectivePoint
fn mul(self, scalar: Scalar) -> ProjectivePoint
Performs the
*
operation. Read moresourceimpl Neg for AffinePoint
impl Neg for AffinePoint
sourceimpl PartialEq<AffinePoint> for AffinePoint
impl PartialEq<AffinePoint> for AffinePoint
sourcefn eq(&self, other: &AffinePoint) -> bool
fn eq(&self, other: &AffinePoint) -> bool
sourceimpl 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 PrimeCurveAffine for AffinePoint
impl PrimeCurveAffine for AffinePoint
sourcefn is_identity(&self) -> Choice
fn is_identity(&self) -> Choice
Is this point the identity point?
sourcefn to_curve(&self) -> ProjectivePoint
fn to_curve(&self) -> ProjectivePoint
Convert to curve representation.
type Scalar = Scalar
type Curve = ProjectivePoint
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<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 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<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 ToEncodedPoint<Secp256k1> for AffinePoint
impl ToEncodedPoint<Secp256k1> for AffinePoint
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<&AffinePoint> for PublicKey
impl TryFrom<&AffinePoint> for PublicKey
sourceimpl TryFrom<&AffinePoint> for VerifyingKey
Available on crate feature ecdsa-core
only.
impl TryFrom<&AffinePoint> for VerifyingKey
Available on crate feature
ecdsa-core
only.sourcefn try_from(affine_point: &AffinePoint) -> Result<VerifyingKey, Error>
fn try_from(affine_point: &AffinePoint) -> Result<VerifyingKey, Error>
Performs the conversion.
sourceimpl TryFrom<&EncodedPoint<<<Secp256k1 as Curve>::UInt as ArrayEncoding>::ByteSize>> for AffinePoint
impl TryFrom<&EncodedPoint<<<Secp256k1 as Curve>::UInt as ArrayEncoding>::ByteSize>> for AffinePoint
sourcefn try_from(point: &EncodedPoint) -> Result<AffinePoint>
fn try_from(point: &EncodedPoint) -> Result<AffinePoint>
Performs the conversion.
sourceimpl TryFrom<AffinePoint> for PublicKey
impl TryFrom<AffinePoint> for PublicKey
sourceimpl TryFrom<AffinePoint> for VerifyingKey
Available on crate feature ecdsa-core
only.
impl TryFrom<AffinePoint> for VerifyingKey
Available on crate feature
ecdsa-core
only.sourcefn try_from(affine_point: AffinePoint) -> Result<VerifyingKey, Error>
fn try_from(affine_point: AffinePoint) -> Result<VerifyingKey, Error>
Performs the conversion.
sourceimpl TryFrom<EncodedPoint<<<Secp256k1 as Curve>::UInt as ArrayEncoding>::ByteSize>> for AffinePoint
impl TryFrom<EncodedPoint<<<Secp256k1 as Curve>::UInt as ArrayEncoding>::ByteSize>> for AffinePoint
sourcefn try_from(point: EncodedPoint) -> Result<AffinePoint>
fn try_from(point: EncodedPoint) -> Result<AffinePoint>
Performs the conversion.
sourceimpl VerifyPrimitive<Secp256k1> for AffinePoint
Available on crate feature ecdsa-core
only.
impl VerifyPrimitive<Secp256k1> for AffinePoint
Available on crate feature
ecdsa-core
only.sourcefn verify_prehashed(&self, z: FieldBytes, signature: &Signature) -> Result<()>
fn verify_prehashed(&self, z: FieldBytes, signature: &Signature) -> Result<()>
Verify the prehashed message against the provided signature Read more
impl Copy for AffinePoint
impl DefaultIsZeroes for AffinePoint
impl Eq for AffinePoint
Auto Trait Implementations
impl RefUnwindSafe for AffinePoint
impl Send for AffinePoint
impl Sync for AffinePoint
impl Unpin for AffinePoint
impl UnwindSafe for AffinePoint
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