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
+ operator.Source§fn add(self, rhs: &AffinePoint) -> ProjectivePoint
fn add(self, rhs: &AffinePoint) -> ProjectivePoint
+ operation. Read moreSource§impl Add<&AffinePoint> for ProjectivePoint
impl Add<&AffinePoint> for ProjectivePoint
Source§type Output = ProjectivePoint
type Output = ProjectivePoint
+ operator.Source§fn add(self, rhs: &AffinePoint) -> ProjectivePoint
fn add(self, rhs: &AffinePoint) -> ProjectivePoint
+ operation. Read moreSource§impl Add<AffinePoint> for ProjectivePoint
impl Add<AffinePoint> for ProjectivePoint
Source§type Output = ProjectivePoint
type Output = ProjectivePoint
+ operator.Source§fn add(self, rhs: AffinePoint) -> ProjectivePoint
fn add(self, rhs: AffinePoint) -> ProjectivePoint
+ 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)
+= 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)
+= operation. Read moreSource§impl AffineCoordinates for AffinePoint
impl AffineCoordinates for AffinePoint
Source§type FieldRepr = Array<u8, <Secp256k1 as Curve>::FieldBytesSize>
type FieldRepr = Array<u8, <Secp256k1 as Curve>::FieldBytesSize>
Source§fn from_coordinates(x: &Self::FieldRepr, y: &Self::FieldRepr) -> CtOption<Self>
fn from_coordinates(x: &Self::FieldRepr, y: &Self::FieldRepr) -> CtOption<Self>
Source§fn x(&self) -> FieldBytes
fn x(&self) -> FieldBytes
Source§fn y(&self) -> FieldBytes
fn y(&self) -> FieldBytes
Source§impl Clone for AffinePoint
impl Clone for AffinePoint
Source§fn clone(&self) -> AffinePoint
fn clone(&self) -> AffinePoint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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)
self and other if choice == 1; otherwise,
reassign both unto themselves. Read moreSource§impl ConstantTimeEq for AffinePoint
impl ConstantTimeEq for AffinePoint
impl Copy for AffinePoint
Source§impl CtEq for AffinePoint
impl CtEq for AffinePoint
Source§impl CtSelect for AffinePoint
impl CtSelect for AffinePoint
Source§impl CurveAffine for AffinePoint
impl CurveAffine for AffinePoint
Source§fn is_identity(&self) -> Choice
fn is_identity(&self) -> Choice
Is this point the identity point?
Source§fn to_curve(&self) -> ProjectivePoint
fn to_curve(&self) -> ProjectivePoint
Convert to curve representation.
Source§type Curve = ProjectivePoint
type Curve = ProjectivePoint
Source§impl Debug for AffinePoint
impl Debug for AffinePoint
Source§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.
Source§fn decompact(x_bytes: &FieldBytes) -> CtOption<Self>
fn decompact(x_bytes: &FieldBytes) -> CtOption<Self>
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>
Source§impl Default for AffinePoint
impl Default for AffinePoint
impl DefaultIsZeroes for AffinePoint
impl Eq for AffinePoint
Source§impl From<&AffinePoint> for Sec1Point
impl From<&AffinePoint> for Sec1Point
Source§fn from(affine_point: &AffinePoint) -> Sec1Point
fn from(affine_point: &AffinePoint) -> Sec1Point
Source§impl From<&AffinePoint> for ProjectivePoint
impl From<&AffinePoint> for ProjectivePoint
Source§fn from(p: &AffinePoint) -> Self
fn from(p: &AffinePoint) -> Self
Source§impl From<&ProjectivePoint> for AffinePoint
impl From<&ProjectivePoint> for AffinePoint
Source§fn from(p: &ProjectivePoint) -> AffinePoint
fn from(p: &ProjectivePoint) -> AffinePoint
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
Source§impl From<&VerifyingKey> for AffinePoint
impl From<&VerifyingKey> for AffinePoint
Source§fn from(vk: &VerifyingKey) -> AffinePoint
fn from(vk: &VerifyingKey) -> AffinePoint
Source§impl From<AffinePoint> for Sec1Point
impl From<AffinePoint> for Sec1Point
Source§fn from(affine_point: AffinePoint) -> Sec1Point
fn from(affine_point: AffinePoint) -> Sec1Point
Source§impl From<AffinePoint> for ProjectivePoint
impl From<AffinePoint> for ProjectivePoint
Source§fn from(p: AffinePoint) -> Self
fn from(p: AffinePoint) -> Self
Source§impl From<NonIdentity<AffinePoint>> for AffinePoint
impl From<NonIdentity<AffinePoint>> for AffinePoint
Source§fn from(affine_point: NonIdentity<AffinePoint>) -> Self
fn from(affine_point: NonIdentity<AffinePoint>) -> Self
Source§impl From<ProjectivePoint> for AffinePoint
impl From<ProjectivePoint> for AffinePoint
Source§fn from(p: ProjectivePoint) -> AffinePoint
fn from(p: ProjectivePoint) -> AffinePoint
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
Source§impl From<VerifyingKey> for AffinePoint
impl From<VerifyingKey> for AffinePoint
Source§fn from(vk: VerifyingKey) -> AffinePoint
fn from(vk: VerifyingKey) -> AffinePoint
Source§impl FromSec1Point<Secp256k1> for AffinePoint
impl FromSec1Point<Secp256k1> for AffinePoint
Source§fn from_sec1_point(encoded_point: &Sec1Point) -> CtOption<Self>
fn from_sec1_point(encoded_point: &Sec1Point) -> CtOption<Self>
Attempts to parse the given Sec1Point as an SEC1-encoded AffinePoint.
§Returns
None value if encoded_point is not on the secp256k1 curve.
Source§fn from_sec1_bytes(bytes: &[u8]) -> Result<Self, Error>
fn from_sec1_bytes(bytes: &[u8]) -> Result<Self, Error>
Octet-String-to-Elliptic-Curve-Point conversion. Read moreSource§fn from_encoded_point(
point: &EncodedPoint<<C as Curve>::FieldBytesSize>,
) -> CtOption<Self>
fn from_encoded_point( point: &EncodedPoint<<C as Curve>::FieldBytesSize>, ) -> CtOption<Self>
use FromSec1Point::from_sec1_point instead
FromSec1Point::from_sec1_point.Source§impl Generate for AffinePoint
impl Generate for AffinePoint
Source§fn try_generate_from_rng<R: TryCryptoRng + ?Sized>(
rng: &mut R,
) -> Result<Self, R::Error>
fn try_generate_from_rng<R: TryCryptoRng + ?Sized>( rng: &mut R, ) -> Result<Self, R::Error>
TryCryptoRng. Read moreSource§fn generate_from_rng<R>(rng: &mut R) -> Self
fn generate_from_rng<R>(rng: &mut R) -> Self
CryptoRng.Source§impl GroupEncoding for AffinePoint
impl GroupEncoding for AffinePoint
Source§type Repr = Array<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B1>>
type Repr = Array<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B1>>
Source§fn from_bytes(bytes: &Self::Repr) -> CtOption<Self>
fn from_bytes(bytes: &Self::Repr) -> CtOption<Self>
Source§impl Mul<&Scalar> for AffinePoint
impl Mul<&Scalar> for AffinePoint
Source§type Output = ProjectivePoint
type Output = ProjectivePoint
* operator.Source§impl Mul<Scalar> for AffinePoint
impl Mul<Scalar> for AffinePoint
Source§type Output = ProjectivePoint
type Output = ProjectivePoint
* operator.Source§impl MulVartime<&Scalar> for AffinePoint
impl MulVartime<&Scalar> for AffinePoint
Source§fn mul_vartime(self, scalar: &Scalar) -> ProjectivePoint
fn mul_vartime(self, scalar: &Scalar) -> ProjectivePoint
self by rhs in variable-time.Source§impl MulVartime<Scalar> for AffinePoint
impl MulVartime<Scalar> for AffinePoint
Source§fn mul_vartime(self, scalar: Scalar) -> ProjectivePoint
fn mul_vartime(self, scalar: Scalar) -> ProjectivePoint
self by rhs in variable-time.Source§impl Neg for AffinePoint
impl Neg for AffinePoint
Source§impl PartialEq for AffinePoint
impl PartialEq 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 Sub<&AffinePoint> for &ProjectivePoint
impl Sub<&AffinePoint> for &ProjectivePoint
Source§type Output = ProjectivePoint
type Output = ProjectivePoint
- operator.Source§fn sub(self, rhs: &AffinePoint) -> ProjectivePoint
fn sub(self, rhs: &AffinePoint) -> ProjectivePoint
- operation. Read moreSource§impl Sub<&AffinePoint> for ProjectivePoint
impl Sub<&AffinePoint> for ProjectivePoint
Source§type Output = ProjectivePoint
type Output = ProjectivePoint
- operator.Source§fn sub(self, rhs: &AffinePoint) -> ProjectivePoint
fn sub(self, rhs: &AffinePoint) -> ProjectivePoint
- operation. Read moreSource§impl Sub<AffinePoint> for ProjectivePoint
impl Sub<AffinePoint> for ProjectivePoint
Source§type Output = ProjectivePoint
type Output = ProjectivePoint
- operator.Source§fn sub(self, rhs: AffinePoint) -> ProjectivePoint
fn sub(self, rhs: AffinePoint) -> ProjectivePoint
- 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)
-= 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)
-= operation. Read moreSource§impl ToSec1Point<Secp256k1> for AffinePoint
impl ToSec1Point<Secp256k1> for AffinePoint
Source§fn to_sec1_point(&self, compress: bool) -> Sec1Point
fn to_sec1_point(&self, compress: bool) -> Sec1Point
Sec1Point, optionally applying point compression
according to the compress flag.Source§fn to_sec1_bytes(&self) -> Box<[u8]>where
C: PointCompression,
fn to_sec1_bytes(&self) -> Box<[u8]>where
C: PointCompression,
Elliptic-Curve-Point-to-Octet-String conversion and the
point compression default for this curve as specified by the PointCompression trait.Source§fn to_compressed_point(
&self,
) -> Array<u8, <<C as Curve>::FieldBytesSize as ModulusSize>::CompressedPointSize>
fn to_compressed_point( &self, ) -> Array<u8, <<C as Curve>::FieldBytesSize as ModulusSize>::CompressedPointSize>
CompressedPoint.Source§fn to_uncompressed_point(
&self,
) -> Array<u8, <<C as Curve>::FieldBytesSize as ModulusSize>::UncompressedPointSize>
fn to_uncompressed_point( &self, ) -> Array<u8, <<C as Curve>::FieldBytesSize as ModulusSize>::UncompressedPointSize>
CompressedPoint.Source§fn to_encoded_point(
&self,
compress: bool,
) -> EncodedPoint<<C as Curve>::FieldBytesSize>
fn to_encoded_point( &self, compress: bool, ) -> EncodedPoint<<C as Curve>::FieldBytesSize>
use ToSec1Point::to_sec1_point instead
ToSec1Point::to_sec1_point.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§impl TryFrom<AffinePoint> for NonIdentity<AffinePoint>
The constant-time alternative is available at NonIdentity::new().
impl TryFrom<AffinePoint> for NonIdentity<AffinePoint>
The constant-time alternative is available at NonIdentity::new().