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<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 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
)Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self
to use its Binary
implementation when Debug
-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self
to use its Display
implementation when
Debug
-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self
to use its LowerExp
implementation when
Debug
-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self
to use its LowerHex
implementation when
Debug
-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self
to use its Octal
implementation when Debug
-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self
to use its Pointer
implementation when
Debug
-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self
to use its UpperExp
implementation when
Debug
-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self
to use its UpperHex
implementation when
Debug
-formatted.Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self
, then passes self.as_ref()
into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self
, then passes self.as_mut()
into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self
, then passes self.deref()
into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref()
only in debug builds, and is erased in release
builds.