Struct AffinePoint
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§
§impl AffinePoint
impl AffinePoint
pub const IDENTITY: AffinePoint
pub const IDENTITY: AffinePoint
Additive identity of the group: the point at infinity.
pub const GENERATOR: AffinePoint
pub const GENERATOR: AffinePoint
Base point of secp256k1.
Gₓ = 79be667e f9dcbbac 55a06295 ce870b07 029bfcdb 2dce28d9 59f2815b 16f81798
Gᵧ = 483ada77 26a3c465 5da4fbfc 0e1108a8 fd17b448 a6855419 9c47d08f fb10d4b8Trait Implementations§
§impl Add<&AffinePoint> for &ProjectivePoint
impl Add<&AffinePoint> for &ProjectivePoint
§type Output = ProjectivePoint
type Output = ProjectivePoint
+ operator.§fn add(self, other: &AffinePoint) -> ProjectivePoint
fn add(self, other: &AffinePoint) -> ProjectivePoint
+ operation. Read more§impl Add<&AffinePoint> for ProjectivePoint
impl Add<&AffinePoint> for ProjectivePoint
§type Output = ProjectivePoint
type Output = ProjectivePoint
+ operator.§fn add(self, other: &AffinePoint) -> ProjectivePoint
fn add(self, other: &AffinePoint) -> ProjectivePoint
+ operation. Read more§impl Add<AffinePoint> for ProjectivePoint
impl Add<AffinePoint> for ProjectivePoint
§type Output = ProjectivePoint
type Output = ProjectivePoint
+ operator.§fn add(self, other: AffinePoint) -> ProjectivePoint
fn add(self, other: AffinePoint) -> ProjectivePoint
+ operation. Read more§impl AddAssign<&AffinePoint> for ProjectivePoint
impl AddAssign<&AffinePoint> for ProjectivePoint
§fn add_assign(&mut self, rhs: &AffinePoint)
fn add_assign(&mut self, rhs: &AffinePoint)
+= operation. Read more§impl AddAssign<AffinePoint> for ProjectivePoint
impl AddAssign<AffinePoint> for ProjectivePoint
§fn add_assign(&mut self, rhs: AffinePoint)
fn add_assign(&mut self, rhs: AffinePoint)
+= operation. Read more§impl AffineCoordinates for AffinePoint
impl AffineCoordinates for AffinePoint
§type FieldRepr = GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>
type FieldRepr = GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>
§fn x(&self) -> GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>
fn x(&self) -> GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>
§impl Clone for AffinePoint
impl Clone for AffinePoint
§fn clone(&self) -> AffinePoint
fn clone(&self) -> AffinePoint
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl ConditionallySelectable for AffinePoint
impl ConditionallySelectable for AffinePoint
§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)
self and other if choice == 1; otherwise,
reassign both unto themselves. Read more§impl ConstantTimeEq for AffinePoint
impl ConstantTimeEq for AffinePoint
§impl Debug for AffinePoint
impl Debug for AffinePoint
§impl DecompactPoint<Secp256k1> for AffinePoint
Decompaction using Taproot conventions as described in BIP 340.
impl DecompactPoint<Secp256k1> for AffinePoint
Decompaction using Taproot conventions as described in BIP 340.
§fn decompact(
x_bytes: &GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>,
) -> CtOption<AffinePoint>
fn decompact( x_bytes: &GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>, ) -> CtOption<AffinePoint>
§impl DecompressPoint<Secp256k1> for AffinePoint
impl DecompressPoint<Secp256k1> for AffinePoint
§fn decompress(
x_bytes: &GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>,
y_is_odd: Choice,
) -> CtOption<AffinePoint>
fn decompress( x_bytes: &GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>, y_is_odd: Choice, ) -> CtOption<AffinePoint>
§impl Default for AffinePoint
impl Default for AffinePoint
§fn default() -> AffinePoint
fn default() -> AffinePoint
§impl From<&AffinePoint> for EncodedPoint<<Secp256k1 as Curve>::FieldBytesSize>
impl From<&AffinePoint> for EncodedPoint<<Secp256k1 as Curve>::FieldBytesSize>
§fn from(
affine_point: &AffinePoint,
) -> EncodedPoint<<Secp256k1 as Curve>::FieldBytesSize>
fn from( affine_point: &AffinePoint, ) -> EncodedPoint<<Secp256k1 as Curve>::FieldBytesSize>
§impl From<&AffinePoint> for ProjectivePoint
impl From<&AffinePoint> for ProjectivePoint
§fn from(p: &AffinePoint) -> ProjectivePoint
fn from(p: &AffinePoint) -> ProjectivePoint
§impl From<&ProjectivePoint> for AffinePoint
impl From<&ProjectivePoint> for AffinePoint
§fn from(p: &ProjectivePoint) -> AffinePoint
fn from(p: &ProjectivePoint) -> AffinePoint
§impl From<&PublicKey<Secp256k1>> for AffinePoint
impl From<&PublicKey<Secp256k1>> for AffinePoint
§fn from(public_key: &PublicKey<Secp256k1>) -> AffinePoint
fn from(public_key: &PublicKey<Secp256k1>) -> AffinePoint
§impl From<AffinePoint> for EncodedPoint<<Secp256k1 as Curve>::FieldBytesSize>
impl From<AffinePoint> for EncodedPoint<<Secp256k1 as Curve>::FieldBytesSize>
§fn from(
affine_point: AffinePoint,
) -> EncodedPoint<<Secp256k1 as Curve>::FieldBytesSize>
fn from( affine_point: AffinePoint, ) -> EncodedPoint<<Secp256k1 as Curve>::FieldBytesSize>
§impl From<AffinePoint> for ProjectivePoint
impl From<AffinePoint> for ProjectivePoint
§fn from(p: AffinePoint) -> ProjectivePoint
fn from(p: AffinePoint) -> ProjectivePoint
§impl From<ProjectivePoint> for AffinePoint
impl From<ProjectivePoint> for AffinePoint
§fn from(p: ProjectivePoint) -> AffinePoint
fn from(p: ProjectivePoint) -> AffinePoint
§impl From<PublicKey<Secp256k1>> for AffinePoint
impl From<PublicKey<Secp256k1>> for AffinePoint
§fn from(public_key: PublicKey<Secp256k1>) -> AffinePoint
fn from(public_key: PublicKey<Secp256k1>) -> AffinePoint
§impl FromEncodedPoint<Secp256k1> for AffinePoint
impl FromEncodedPoint<Secp256k1> for AffinePoint
§fn from_encoded_point(
encoded_point: &EncodedPoint<<Secp256k1 as Curve>::FieldBytesSize>,
) -> CtOption<AffinePoint>
fn from_encoded_point( encoded_point: &EncodedPoint<<Secp256k1 as Curve>::FieldBytesSize>, ) -> CtOption<AffinePoint>
Attempts to parse the given EncodedPoint as an SEC1-encoded AffinePoint.
§Returns
None value if encoded_point is not on the secp256k1 curve.
§impl 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>>
§fn from_bytes(
bytes: &<AffinePoint as GroupEncoding>::Repr,
) -> CtOption<AffinePoint>
fn from_bytes( bytes: &<AffinePoint as GroupEncoding>::Repr, ) -> CtOption<AffinePoint>
§fn from_bytes_unchecked(
bytes: &<AffinePoint as GroupEncoding>::Repr,
) -> CtOption<AffinePoint>
fn from_bytes_unchecked( bytes: &<AffinePoint as GroupEncoding>::Repr, ) -> CtOption<AffinePoint>
§fn to_bytes(&self) -> <AffinePoint as GroupEncoding>::Repr
fn to_bytes(&self) -> <AffinePoint as GroupEncoding>::Repr
§impl Mul<&Scalar> for AffinePoint
impl Mul<&Scalar> for AffinePoint
§type Output = ProjectivePoint
type Output = ProjectivePoint
* operator.§fn mul(self, scalar: &Scalar) -> ProjectivePoint
fn mul(self, scalar: &Scalar) -> ProjectivePoint
* operation. Read more§impl Mul<Scalar> for AffinePoint
impl Mul<Scalar> for AffinePoint
§type Output = ProjectivePoint
type Output = ProjectivePoint
* operator.§fn mul(self, scalar: Scalar) -> ProjectivePoint
fn mul(self, scalar: Scalar) -> ProjectivePoint
* operation. Read more§impl Neg for AffinePoint
impl Neg for AffinePoint
§type Output = AffinePoint
type Output = AffinePoint
- operator.§impl PartialEq<AffinePoint> for ProjectivePoint
impl PartialEq<AffinePoint> for ProjectivePoint
§impl PartialEq<ProjectivePoint> for AffinePoint
impl PartialEq<ProjectivePoint> for AffinePoint
§impl PartialEq for AffinePoint
impl PartialEq for AffinePoint
§impl PrimeCurveAffine for AffinePoint
impl PrimeCurveAffine for AffinePoint
§fn identity() -> AffinePoint
fn identity() -> AffinePoint
Returns the identity of the group: the point at infinity.
§fn generator() -> AffinePoint
fn generator() -> AffinePoint
Returns the base point of secp256k1.
§fn is_identity(&self) -> Choice
fn is_identity(&self) -> Choice
Is this point the identity point?
§fn to_curve(&self) -> ProjectivePoint
fn to_curve(&self) -> ProjectivePoint
Convert to curve representation.
type Scalar = Scalar
type Curve = ProjectivePoint
§impl Sub<&AffinePoint> for &ProjectivePoint
impl Sub<&AffinePoint> for &ProjectivePoint
§type Output = ProjectivePoint
type Output = ProjectivePoint
- operator.§fn sub(self, other: &AffinePoint) -> ProjectivePoint
fn sub(self, other: &AffinePoint) -> ProjectivePoint
- operation. Read more§impl Sub<&AffinePoint> for ProjectivePoint
impl Sub<&AffinePoint> for ProjectivePoint
§type Output = ProjectivePoint
type Output = ProjectivePoint
- operator.§fn sub(self, other: &AffinePoint) -> ProjectivePoint
fn sub(self, other: &AffinePoint) -> ProjectivePoint
- operation. Read more§impl Sub<AffinePoint> for ProjectivePoint
impl Sub<AffinePoint> for ProjectivePoint
§type Output = ProjectivePoint
type Output = ProjectivePoint
- operator.§fn sub(self, other: AffinePoint) -> ProjectivePoint
fn sub(self, other: AffinePoint) -> ProjectivePoint
- operation. Read more§impl SubAssign<&AffinePoint> for ProjectivePoint
impl SubAssign<&AffinePoint> for ProjectivePoint
§fn sub_assign(&mut self, rhs: &AffinePoint)
fn sub_assign(&mut self, rhs: &AffinePoint)
-= operation. Read more§impl SubAssign<AffinePoint> for ProjectivePoint
impl SubAssign<AffinePoint> for ProjectivePoint
§fn sub_assign(&mut self, rhs: AffinePoint)
fn sub_assign(&mut self, rhs: AffinePoint)
-= operation. Read more§impl ToEncodedPoint<Secp256k1> for AffinePoint
impl ToEncodedPoint<Secp256k1> for AffinePoint
§fn to_encoded_point(
&self,
compress: bool,
) -> EncodedPoint<<Secp256k1 as Curve>::FieldBytesSize>
fn to_encoded_point( &self, compress: bool, ) -> EncodedPoint<<Secp256k1 as Curve>::FieldBytesSize>
EncodedPoint, optionally applying
point compression.§impl TryFrom<&AffinePoint> for PublicKey<Secp256k1>
impl TryFrom<&AffinePoint> for PublicKey<Secp256k1>
§impl TryFrom<&EncodedPoint<<Secp256k1 as Curve>::FieldBytesSize>> for AffinePoint
impl TryFrom<&EncodedPoint<<Secp256k1 as Curve>::FieldBytesSize>> for AffinePoint
§impl TryFrom<AffinePoint> for PublicKey<Secp256k1>
impl TryFrom<AffinePoint> for PublicKey<Secp256k1>
§impl TryFrom<EncodedPoint<<Secp256k1 as Curve>::FieldBytesSize>> for AffinePoint
impl TryFrom<EncodedPoint<<Secp256k1 as Curve>::FieldBytesSize>> for AffinePoint
§impl VerifyPrimitive<Secp256k1> for AffinePoint
Available on crate feature ecdsa only.
impl VerifyPrimitive<Secp256k1> for AffinePoint
ecdsa only.§fn verify_prehashed(
&self,
z: &GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>,
sig: &Signature<Secp256k1>,
) -> Result<(), Error>
fn verify_prehashed( &self, z: &GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>, sig: &Signature<Secp256k1>, ) -> Result<(), Error>
§fn verify_digest<D>(
&self,
msg_digest: D,
sig: &Signature<C>,
) -> Result<(), Error>
fn verify_digest<D>( &self, msg_digest: D, sig: &Signature<C>, ) -> Result<(), Error>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more