pub struct AffinePoint { /* private fields */ }Expand description
NIST P-256 (secp256r1) 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 AffineXCoordinate<NistP256> for AffinePoint
impl AffineXCoordinate<NistP256> for AffinePoint
Source§fn x(&self) -> FieldBytes
fn x(&self) -> FieldBytes
Get the affine x-coordinate as a serialized field element.
Source§impl Clone for AffinePoint
impl Clone for AffinePoint
Source§fn clone(&self) -> AffinePoint
fn clone(&self) -> AffinePoint
Returns a duplicate 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<NistP256> for AffinePoint
impl DecompactPoint<NistP256> for AffinePoint
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<NistP256> for AffinePoint
impl DecompressPoint<NistP256> 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<'de> Deserialize<'de> for AffinePoint
Available on crate feature serde only.
impl<'de> Deserialize<'de> for AffinePoint
Available on crate feature
serde only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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<NistP256>> for AffinePoint
impl From<&PublicKey<NistP256>> 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<NistP256>> for AffinePoint
impl From<PublicKey<NistP256>> 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<NistP256> for AffinePoint
impl FromEncodedPoint<NistP256> 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 secp256r1 curve.
Source§impl GroupEncoding for AffinePoint
impl GroupEncoding for AffinePoint
Source§fn from_bytes(bytes: &Self::Repr) -> CtOption<Self>
fn from_bytes(bytes: &Self::Repr) -> CtOption<Self>
NOTE: not constant-time with respect to identity point
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_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
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 for AffinePoint
impl PartialEq for AffinePoint
Source§impl PrimeCurveAffine for AffinePoint
impl PrimeCurveAffine for AffinePoint
type Scalar = Scalar
type Curve = ProjectivePoint
Source§fn identity() -> AffinePoint
fn identity() -> AffinePoint
Returns the additive identity.
Source§fn generator() -> AffinePoint
fn generator() -> AffinePoint
Returns a fixed generator of unknown exponent.
Source§fn is_identity(&self) -> Choice
fn is_identity(&self) -> Choice
Determines if this point represents the point at infinity; the
additive identity.
Source§fn to_curve(&self) -> ProjectivePoint
fn to_curve(&self) -> ProjectivePoint
Converts this element to its curve representation.
Source§impl Serialize for AffinePoint
Available on crate feature serde only.
impl Serialize for AffinePoint
Available on crate feature
serde only.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 ToCompactEncodedPoint<NistP256> for AffinePoint
impl ToCompactEncodedPoint<NistP256> for AffinePoint
Source§fn to_compact_encoded_point(&self) -> CtOption<EncodedPoint>
fn to_compact_encoded_point(&self) -> CtOption<EncodedPoint>
Serialize this value as a SEC1 compact EncodedPoint
Source§impl ToEncodedPoint<NistP256> for AffinePoint
impl ToEncodedPoint<NistP256> 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<<<NistP256 as Curve>::UInt as ArrayEncoding>::ByteSize>> for AffinePoint
impl TryFrom<&EncodedPoint<<<NistP256 as Curve>::UInt as ArrayEncoding>::ByteSize>> 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<<<NistP256 as Curve>::UInt as ArrayEncoding>::ByteSize>> for AffinePoint
impl TryFrom<EncodedPoint<<<NistP256 as Curve>::UInt as ArrayEncoding>::ByteSize>> for AffinePoint
Source§fn try_from(point: EncodedPoint) -> Result<AffinePoint>
fn try_from(point: EncodedPoint) -> Result<AffinePoint>
Performs the conversion.
Source§impl VerifyPrimitive<NistP256> for AffinePoint
Available on crate feature ecdsa only.
impl VerifyPrimitive<NistP256> for AffinePoint
Available on crate feature
ecdsa only.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