Struct p384::AffinePoint
source · [−]pub struct AffinePoint { /* private fields */ }broken-arithmetic-do-not-use only.Expand description
NIST P-384 (secp384r1) 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
sourceimpl AffinePoint
impl AffinePoint
sourcepub fn identity() -> AffinePoint
pub fn identity() -> AffinePoint
Returns the identity of the group: the point at infinity.
sourcepub fn generator() -> AffinePoint
pub fn generator() -> AffinePoint
Returns the base point of P-384.
Defined in FIPS 186-4 § D.1.2.4:
Gₓ = aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98
59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7
Gᵧ = 3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c
e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5fsourcepub fn is_identity(&self) -> Choice
pub fn is_identity(&self) -> Choice
Is this point the identity point?
Trait Implementations
sourceimpl AffineXCoordinate<NistP384> for AffinePoint
impl AffineXCoordinate<NistP384> for AffinePoint
sourcefn x(&self) -> FieldBytes
fn x(&self) -> FieldBytes
Get the affine x-coordinate as a serialized field element.
sourceimpl Clone for AffinePoint
impl Clone for AffinePoint
sourcefn clone(&self) -> AffinePoint
fn clone(&self) -> AffinePoint
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl ConditionallySelectable for AffinePoint
impl ConditionallySelectable for AffinePoint
sourcefn conditional_select(
a: &AffinePoint,
b: &AffinePoint,
choice: Choice
) -> AffinePoint
fn conditional_select(
a: &AffinePoint,
b: &AffinePoint,
choice: Choice
) -> AffinePoint
Select a or b according to choice. Read more
sourcefn conditional_assign(&mut self, other: &Self, choice: Choice)
fn conditional_assign(&mut self, other: &Self, choice: Choice)
Conditionally assign other to self, according to choice. Read more
sourceimpl ConstantTimeEq for AffinePoint
impl ConstantTimeEq for AffinePoint
sourcefn ct_eq(&self, other: &AffinePoint) -> Choice
fn ct_eq(&self, other: &AffinePoint) -> Choice
Determine if two items are equal. Read more
sourceimpl Debug for AffinePoint
impl Debug for AffinePoint
sourceimpl DecompressPoint<NistP384> for AffinePoint
impl DecompressPoint<NistP384> for AffinePoint
sourcefn 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.
sourceimpl Default for AffinePoint
impl Default for AffinePoint
sourceimpl<'de> Deserialize<'de> for AffinePoint
Available on crate feature serde only.
impl<'de> Deserialize<'de> for AffinePoint
serde only.sourcefn 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
sourceimpl From<AffinePoint> for EncodedPoint
impl From<AffinePoint> for EncodedPoint
sourcefn from(affine_point: AffinePoint) -> EncodedPoint
fn from(affine_point: AffinePoint) -> EncodedPoint
Returns the SEC1 compressed encoding of this point.
sourceimpl FromEncodedPoint<NistP384> for AffinePoint
impl FromEncodedPoint<NistP384> for AffinePoint
sourcefn 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 secp384r1 curve.
sourceimpl GroupEncoding for AffinePoint
impl GroupEncoding for AffinePoint
sourcefn from_bytes(bytes: &Self::Repr) -> CtOption<Self>
fn from_bytes(bytes: &Self::Repr) -> CtOption<Self>
NOTE: not constant-time with respect to identity point
type Repr = GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B1>>
type Repr = GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B1>>
The encoding of group elements. Read more
sourcefn 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
sourceimpl Neg for AffinePoint
impl Neg for AffinePoint
sourceimpl PartialEq<AffinePoint> for AffinePoint
impl PartialEq<AffinePoint> for AffinePoint
sourceimpl Serialize for AffinePoint
Available on crate feature serde only.
impl Serialize for AffinePoint
serde only.sourceimpl ToEncodedPoint<NistP384> for AffinePoint
impl ToEncodedPoint<NistP384> for AffinePoint
sourcefn 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. Read more
sourceimpl TryFrom<&'_ EncodedPoint<<<NistP384 as Curve>::UInt as ArrayEncoding>::ByteSize>> for AffinePoint
impl TryFrom<&'_ EncodedPoint<<<NistP384 as Curve>::UInt as ArrayEncoding>::ByteSize>> for AffinePoint
sourcefn try_from(point: &EncodedPoint) -> Result<AffinePoint>
fn try_from(point: &EncodedPoint) -> Result<AffinePoint>
Performs the conversion.
sourceimpl TryFrom<EncodedPoint<<<NistP384 as Curve>::UInt as ArrayEncoding>::ByteSize>> for AffinePoint
impl TryFrom<EncodedPoint<<<NistP384 as Curve>::UInt as ArrayEncoding>::ByteSize>> for AffinePoint
sourcefn try_from(point: EncodedPoint) -> Result<AffinePoint>
fn try_from(point: EncodedPoint) -> Result<AffinePoint>
Performs the conversion.
impl Copy for AffinePoint
impl DefaultIsZeroes for AffinePoint
impl Eq for AffinePoint
Auto Trait Implementations
impl RefUnwindSafe for AffinePoint
impl Send for AffinePoint
impl Sync for AffinePoint
impl Unpin for AffinePoint
impl UnwindSafe for AffinePoint
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more