pub struct AffinePoint { /* private fields */ }
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§
source§impl AffinePoint
impl AffinePoint
Trait Implementations§
source§impl Add<&AffinePoint> for &ProjectivePoint
impl Add<&AffinePoint> for &ProjectivePoint
source§type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
+
operator.source§fn add(self, other: &AffinePoint) -> ProjectivePoint
fn add(self, other: &AffinePoint) -> ProjectivePoint
Performs the
+
operation. Read moresource§impl Add<&AffinePoint> for ProjectivePoint
impl Add<&AffinePoint> for ProjectivePoint
source§type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
+
operator.source§fn add(self, other: &AffinePoint) -> ProjectivePoint
fn add(self, other: &AffinePoint) -> ProjectivePoint
Performs the
+
operation. Read moresource§impl Add<AffinePoint> for ProjectivePoint
impl Add<AffinePoint> for ProjectivePoint
source§type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
+
operator.source§fn add(self, other: AffinePoint) -> ProjectivePoint
fn add(self, other: AffinePoint) -> ProjectivePoint
Performs the
+
operation. Read moresource§impl AddAssign<&AffinePoint> for ProjectivePoint
impl AddAssign<&AffinePoint> for ProjectivePoint
source§fn add_assign(&mut self, rhs: &AffinePoint)
fn add_assign(&mut self, rhs: &AffinePoint)
Performs the
+=
operation. Read moresource§impl AddAssign<AffinePoint> for ProjectivePoint
impl AddAssign<AffinePoint> for ProjectivePoint
source§fn add_assign(&mut self, rhs: AffinePoint)
fn add_assign(&mut self, rhs: AffinePoint)
Performs the
+=
operation. Read moresource§impl AffineCoordinates for AffinePoint
impl AffineCoordinates for AffinePoint
source§impl Clone for AffinePoint
impl Clone for AffinePoint
source§fn clone(&self) -> AffinePoint
fn clone(&self) -> AffinePoint
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 ConditionallySelectable for AffinePoint
impl ConditionallySelectable for AffinePoint
source§fn conditional_select(
a: &AffinePoint,
b: &AffinePoint,
choice: Choice,
) -> AffinePoint
fn conditional_select( a: &AffinePoint, b: &AffinePoint, choice: Choice, ) -> AffinePoint
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 ConstantTimeEq for AffinePoint
impl ConstantTimeEq for AffinePoint
source§impl Debug for AffinePoint
impl Debug for AffinePoint
source§impl DecompactPoint<Secp256k1> for AffinePoint
impl DecompactPoint<Secp256k1> for AffinePoint
Decompaction using Taproot conventions as described in BIP 340.
source§fn decompact(x_bytes: &FieldBytes) -> CtOption<Self>
fn decompact(x_bytes: &FieldBytes) -> CtOption<Self>
Attempt to decompact an elliptic curve point
source§impl DecompressPoint<Secp256k1> for AffinePoint
impl DecompressPoint<Secp256k1> for AffinePoint
source§fn 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.
source§impl Default for AffinePoint
impl Default for AffinePoint
source§impl From<&AffinePoint> for EncodedPoint
impl From<&AffinePoint> for EncodedPoint
source§fn from(affine_point: &AffinePoint) -> EncodedPoint
fn from(affine_point: &AffinePoint) -> EncodedPoint
Converts to this type from the input type.
source§impl From<&AffinePoint> for ProjectivePoint
impl From<&AffinePoint> for ProjectivePoint
source§fn from(p: &AffinePoint) -> Self
fn from(p: &AffinePoint) -> Self
Converts to this type from the input type.
source§impl From<&ProjectivePoint> for AffinePoint
impl From<&ProjectivePoint> for AffinePoint
source§fn from(p: &ProjectivePoint) -> AffinePoint
fn from(p: &ProjectivePoint) -> AffinePoint
Converts to this type from the input type.
source§impl From<&PublicKey<Secp256k1>> for AffinePoint
impl From<&PublicKey<Secp256k1>> for AffinePoint
source§fn from(public_key: &PublicKey) -> AffinePoint
fn from(public_key: &PublicKey) -> AffinePoint
Converts to this type from the input type.
source§impl From<&VerifyingKey> for AffinePoint
impl From<&VerifyingKey> for AffinePoint
source§fn from(vk: &VerifyingKey) -> AffinePoint
fn from(vk: &VerifyingKey) -> AffinePoint
Converts to this type from the input type.
source§impl From<AffinePoint> for EncodedPoint
impl From<AffinePoint> for EncodedPoint
source§fn from(affine_point: AffinePoint) -> EncodedPoint
fn from(affine_point: AffinePoint) -> EncodedPoint
Converts to this type from the input type.
source§impl From<AffinePoint> for ProjectivePoint
impl From<AffinePoint> for ProjectivePoint
source§fn from(p: AffinePoint) -> Self
fn from(p: AffinePoint) -> Self
Converts to this type from the input type.
source§impl From<ProjectivePoint> for AffinePoint
impl From<ProjectivePoint> for AffinePoint
source§fn from(p: ProjectivePoint) -> AffinePoint
fn from(p: ProjectivePoint) -> AffinePoint
Converts to this type from the input type.
source§impl From<PublicKey<Secp256k1>> for AffinePoint
impl From<PublicKey<Secp256k1>> for AffinePoint
source§fn from(public_key: PublicKey) -> AffinePoint
fn from(public_key: PublicKey) -> AffinePoint
Converts to this type from the input type.
source§impl From<VerifyingKey> for AffinePoint
impl From<VerifyingKey> for AffinePoint
source§fn from(vk: VerifyingKey) -> AffinePoint
fn from(vk: VerifyingKey) -> AffinePoint
Converts to this type from the input type.
source§impl FromEncodedPoint<Secp256k1> for AffinePoint
impl FromEncodedPoint<Secp256k1> for AffinePoint
source§fn 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.
source§impl GroupEncoding for AffinePoint
impl GroupEncoding for AffinePoint
source§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
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 Mul<&Scalar> for AffinePoint
impl Mul<&Scalar> for AffinePoint
source§type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
*
operator.source§impl Mul<Scalar> for AffinePoint
impl Mul<Scalar> for AffinePoint
source§type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
*
operator.source§impl Neg for AffinePoint
impl Neg for AffinePoint
source§impl PartialEq<AffinePoint> for ProjectivePoint
impl PartialEq<AffinePoint> for ProjectivePoint
source§impl PartialEq<ProjectivePoint> for AffinePoint
impl PartialEq<ProjectivePoint> for AffinePoint
source§impl PartialEq for AffinePoint
impl PartialEq for AffinePoint
source§impl PrimeCurveAffine for AffinePoint
impl PrimeCurveAffine for AffinePoint
source§impl Sub<&AffinePoint> for &ProjectivePoint
impl Sub<&AffinePoint> for &ProjectivePoint
source§type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
-
operator.source§fn sub(self, other: &AffinePoint) -> ProjectivePoint
fn sub(self, other: &AffinePoint) -> ProjectivePoint
Performs the
-
operation. Read moresource§impl Sub<&AffinePoint> for ProjectivePoint
impl Sub<&AffinePoint> for ProjectivePoint
source§type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
-
operator.source§fn sub(self, other: &AffinePoint) -> ProjectivePoint
fn sub(self, other: &AffinePoint) -> ProjectivePoint
Performs the
-
operation. Read moresource§impl Sub<AffinePoint> for ProjectivePoint
impl Sub<AffinePoint> for ProjectivePoint
source§type Output = ProjectivePoint
type Output = ProjectivePoint
The resulting type after applying the
-
operator.source§fn sub(self, other: AffinePoint) -> ProjectivePoint
fn sub(self, other: AffinePoint) -> ProjectivePoint
Performs the
-
operation. Read moresource§impl SubAssign<&AffinePoint> for ProjectivePoint
impl SubAssign<&AffinePoint> for ProjectivePoint
source§fn sub_assign(&mut self, rhs: &AffinePoint)
fn sub_assign(&mut self, rhs: &AffinePoint)
Performs the
-=
operation. Read moresource§impl SubAssign<AffinePoint> for ProjectivePoint
impl SubAssign<AffinePoint> for ProjectivePoint
source§fn sub_assign(&mut self, rhs: AffinePoint)
fn sub_assign(&mut self, rhs: AffinePoint)
Performs the
-=
operation. Read moresource§impl ToEncodedPoint<Secp256k1> for AffinePoint
impl ToEncodedPoint<Secp256k1> for AffinePoint
source§fn 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.source§impl TryFrom<&AffinePoint> for PublicKey
impl TryFrom<&AffinePoint> for PublicKey
source§impl TryFrom<&EncodedPoint<<Secp256k1 as Curve>::FieldBytesSize>> for AffinePoint
impl TryFrom<&EncodedPoint<<Secp256k1 as Curve>::FieldBytesSize>> for AffinePoint
source§fn try_from(point: &EncodedPoint) -> Result<AffinePoint>
fn try_from(point: &EncodedPoint) -> Result<AffinePoint>
Performs the conversion.
source§impl TryFrom<AffinePoint> for PublicKey
impl TryFrom<AffinePoint> for PublicKey
source§impl TryFrom<EncodedPoint<<Secp256k1 as Curve>::FieldBytesSize>> for AffinePoint
impl TryFrom<EncodedPoint<<Secp256k1 as Curve>::FieldBytesSize>> for AffinePoint
source§fn try_from(point: EncodedPoint) -> Result<AffinePoint>
fn try_from(point: EncodedPoint) -> Result<AffinePoint>
Performs the conversion.
source§impl VerifyPrimitive<Secp256k1> for AffinePoint
impl VerifyPrimitive<Secp256k1> for AffinePoint
source§fn verify_prehashed(&self, z: &FieldBytes, sig: &Signature) -> Result<(), Error>
fn verify_prehashed(&self, z: &FieldBytes, sig: &Signature) -> Result<(), Error>
Verify the prehashed message against the provided ECDSA signature. Read more
impl Copy for AffinePoint
impl DefaultIsZeroes for AffinePoint
impl Eq for AffinePoint
Auto Trait Implementations§
impl Freeze for AffinePoint
impl RefUnwindSafe for AffinePoint
impl Send for AffinePoint
impl Sync for AffinePoint
impl Unpin for AffinePoint
impl UnwindSafe for AffinePoint
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)