Struct primeorder::AffinePoint
source · pub struct AffinePoint<C: PrimeOrderCurve> { /* private fields */ }
Expand description
Point on a Weierstrass curve in affine coordinates.
Implementations
sourceimpl<C> AffinePoint<C>where
C: PrimeOrderCurve,
impl<C> AffinePoint<C>where
C: PrimeOrderCurve,
Trait Implementations
sourceimpl<C> Add<&AffinePoint<C>> for &ProjectivePoint<C>where
C: PrimeOrderCurve,
impl<C> Add<&AffinePoint<C>> for &ProjectivePoint<C>where
C: PrimeOrderCurve,
type Output = ProjectivePoint<C>
type Output = ProjectivePoint<C>
The resulting type after applying the
+
operator.sourcefn add(self, other: &AffinePoint<C>) -> ProjectivePoint<C>
fn add(self, other: &AffinePoint<C>) -> ProjectivePoint<C>
Performs the
+
operation. Read moresourceimpl<C> Add<&AffinePoint<C>> for ProjectivePoint<C>where
C: PrimeOrderCurve,
impl<C> Add<&AffinePoint<C>> for ProjectivePoint<C>where
C: PrimeOrderCurve,
type Output = ProjectivePoint<C>
type Output = ProjectivePoint<C>
The resulting type after applying the
+
operator.sourcefn add(self, other: &AffinePoint<C>) -> ProjectivePoint<C>
fn add(self, other: &AffinePoint<C>) -> ProjectivePoint<C>
Performs the
+
operation. Read moresourceimpl<C> Add<AffinePoint<C>> for ProjectivePoint<C>where
C: PrimeOrderCurve,
impl<C> Add<AffinePoint<C>> for ProjectivePoint<C>where
C: PrimeOrderCurve,
type Output = ProjectivePoint<C>
type Output = ProjectivePoint<C>
The resulting type after applying the
+
operator.sourcefn add(self, other: AffinePoint<C>) -> ProjectivePoint<C>
fn add(self, other: AffinePoint<C>) -> ProjectivePoint<C>
Performs the
+
operation. Read moresourceimpl<C> AddAssign<&AffinePoint<C>> for ProjectivePoint<C>where
C: PrimeOrderCurve,
impl<C> AddAssign<&AffinePoint<C>> for ProjectivePoint<C>where
C: PrimeOrderCurve,
sourcefn add_assign(&mut self, rhs: &AffinePoint<C>)
fn add_assign(&mut self, rhs: &AffinePoint<C>)
Performs the
+=
operation. Read moresourceimpl<C> AddAssign<AffinePoint<C>> for ProjectivePoint<C>where
C: PrimeOrderCurve,
impl<C> AddAssign<AffinePoint<C>> for ProjectivePoint<C>where
C: PrimeOrderCurve,
sourcefn add_assign(&mut self, rhs: AffinePoint<C>)
fn add_assign(&mut self, rhs: AffinePoint<C>)
Performs the
+=
operation. Read moresourceimpl<C> AffineXCoordinate<C> for AffinePoint<C>where
C: PrimeOrderCurve,
impl<C> AffineXCoordinate<C> for AffinePoint<C>where
C: PrimeOrderCurve,
sourcefn x(&self) -> FieldBytes<C>
fn x(&self) -> FieldBytes<C>
Get the affine x-coordinate as a serialized field element.
sourceimpl<C: Clone + PrimeOrderCurve> Clone for AffinePoint<C>where
C::FieldElement: Clone,
C::FieldElement: Clone,
impl<C: Clone + PrimeOrderCurve> Clone for AffinePoint<C>where
C::FieldElement: Clone,
C::FieldElement: Clone,
sourcefn clone(&self) -> AffinePoint<C>
fn clone(&self) -> AffinePoint<C>
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 moresourceimpl<C> ConditionallySelectable for AffinePoint<C>where
C: PrimeOrderCurve,
impl<C> ConditionallySelectable for AffinePoint<C>where
C: PrimeOrderCurve,
sourcefn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
sourcefn conditional_assign(&mut self, other: &Self, choice: Choice)
fn conditional_assign(&mut self, other: &Self, choice: Choice)
sourceimpl<C> ConstantTimeEq for AffinePoint<C>where
C: PrimeOrderCurve,
impl<C> ConstantTimeEq for AffinePoint<C>where
C: PrimeOrderCurve,
sourceimpl<C: Debug + PrimeOrderCurve> Debug for AffinePoint<C>where
C::FieldElement: Debug,
C::FieldElement: Debug,
impl<C: Debug + PrimeOrderCurve> Debug for AffinePoint<C>where
C::FieldElement: Debug,
C::FieldElement: Debug,
sourceimpl<C> DecompactPoint<C> for AffinePoint<C>where
C: PrimeOrderCurve,
FieldBytes<C>: Copy,
impl<C> DecompactPoint<C> for AffinePoint<C>where
C: PrimeOrderCurve,
FieldBytes<C>: Copy,
sourcefn decompact(x_bytes: &FieldBytes<C>) -> CtOption<Self>
fn decompact(x_bytes: &FieldBytes<C>) -> CtOption<Self>
Attempt to decompact an elliptic curve point
sourceimpl<C> DecompressPoint<C> for AffinePoint<C>where
C: PrimeOrderCurve,
FieldBytes<C>: Copy,
impl<C> DecompressPoint<C> for AffinePoint<C>where
C: PrimeOrderCurve,
FieldBytes<C>: Copy,
sourcefn decompress(x_bytes: &FieldBytes<C>, y_is_odd: Choice) -> CtOption<Self>
fn decompress(x_bytes: &FieldBytes<C>, y_is_odd: Choice) -> CtOption<Self>
Attempt to decompress an elliptic curve point.
sourceimpl<C> Default for AffinePoint<C>where
C: PrimeOrderCurve,
impl<C> Default for AffinePoint<C>where
C: PrimeOrderCurve,
sourceimpl<'de, C> Deserialize<'de> for AffinePoint<C>where
C: PrimeOrderCurve,
FieldBytes<C>: Copy,
FieldSize<C>: ModulusSize,
CompressedPoint<C>: Copy,
Available on crate feature serde
only.
impl<'de, C> Deserialize<'de> for AffinePoint<C>where
C: PrimeOrderCurve,
FieldBytes<C>: Copy,
FieldSize<C>: ModulusSize,
CompressedPoint<C>: Copy,
Available on crate feature
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<C> From<&AffinePoint<C>> for ProjectivePoint<C>where
C: PrimeOrderCurve,
impl<C> From<&AffinePoint<C>> for ProjectivePoint<C>where
C: PrimeOrderCurve,
sourcefn from(p: &AffinePoint<C>) -> Self
fn from(p: &AffinePoint<C>) -> Self
Converts to this type from the input type.
sourceimpl<C> From<&ProjectivePoint<C>> for AffinePoint<C>where
C: PrimeOrderCurve,
impl<C> From<&ProjectivePoint<C>> for AffinePoint<C>where
C: PrimeOrderCurve,
sourcefn from(p: &ProjectivePoint<C>) -> AffinePoint<C>
fn from(p: &ProjectivePoint<C>) -> AffinePoint<C>
Converts to this type from the input type.
sourceimpl<C> From<&PublicKey<C>> for AffinePoint<C>where
C: PrimeOrderCurve,
impl<C> From<&PublicKey<C>> for AffinePoint<C>where
C: PrimeOrderCurve,
sourcefn from(public_key: &PublicKey<C>) -> AffinePoint<C>
fn from(public_key: &PublicKey<C>) -> AffinePoint<C>
Converts to this type from the input type.
sourceimpl<C> From<AffinePoint<C>> for EncodedPoint<C>where
C: PrimeOrderCurve,
FieldSize<C>: ModulusSize,
CompressedPoint<C>: Copy,
<UncompressedPointSize<C> as ArrayLength<u8>>::ArrayType: Copy,
impl<C> From<AffinePoint<C>> for EncodedPoint<C>where
C: PrimeOrderCurve,
FieldSize<C>: ModulusSize,
CompressedPoint<C>: Copy,
<UncompressedPointSize<C> as ArrayLength<u8>>::ArrayType: Copy,
sourcefn from(affine: AffinePoint<C>) -> EncodedPoint<C>
fn from(affine: AffinePoint<C>) -> EncodedPoint<C>
Converts to this type from the input type.
sourceimpl<C> From<AffinePoint<C>> for ProjectivePoint<C>where
C: PrimeOrderCurve,
impl<C> From<AffinePoint<C>> for ProjectivePoint<C>where
C: PrimeOrderCurve,
sourcefn from(p: AffinePoint<C>) -> Self
fn from(p: AffinePoint<C>) -> Self
Converts to this type from the input type.
sourceimpl<C> From<ProjectivePoint<C>> for AffinePoint<C>where
C: PrimeOrderCurve,
impl<C> From<ProjectivePoint<C>> for AffinePoint<C>where
C: PrimeOrderCurve,
sourcefn from(p: ProjectivePoint<C>) -> AffinePoint<C>
fn from(p: ProjectivePoint<C>) -> AffinePoint<C>
Converts to this type from the input type.
sourceimpl<C> From<PublicKey<C>> for AffinePoint<C>where
C: PrimeOrderCurve,
impl<C> From<PublicKey<C>> for AffinePoint<C>where
C: PrimeOrderCurve,
sourcefn from(public_key: PublicKey<C>) -> AffinePoint<C>
fn from(public_key: PublicKey<C>) -> AffinePoint<C>
Converts to this type from the input type.
sourceimpl<C> FromEncodedPoint<C> for AffinePoint<C>where
C: PrimeOrderCurve,
FieldBytes<C>: Copy,
FieldSize<C>: ModulusSize,
CompressedPoint<C>: Copy,
impl<C> FromEncodedPoint<C> for AffinePoint<C>where
C: PrimeOrderCurve,
FieldBytes<C>: Copy,
FieldSize<C>: ModulusSize,
CompressedPoint<C>: Copy,
sourcefn from_encoded_point(encoded_point: &EncodedPoint<C>) -> CtOption<Self>
fn from_encoded_point(encoded_point: &EncodedPoint<C>) -> 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<C> GroupEncoding for AffinePoint<C>where
C: PrimeOrderCurve,
FieldBytes<C>: Copy,
FieldSize<C>: ModulusSize,
CompressedPoint<C>: Copy,
<UncompressedPointSize<C> as ArrayLength<u8>>::ArrayType: Copy,
impl<C> GroupEncoding for AffinePoint<C>where
C: PrimeOrderCurve,
FieldBytes<C>: Copy,
FieldSize<C>: ModulusSize,
CompressedPoint<C>: Copy,
<UncompressedPointSize<C> as ArrayLength<u8>>::ArrayType: Copy,
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, <<<C as Curve>::UInt as ArrayEncoding>::ByteSize as ModulusSize>::CompressedPointSize>
type Repr = GenericArray<u8, <<<C as Curve>::UInt as ArrayEncoding>::ByteSize as ModulusSize>::CompressedPointSize>
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<C, S> Mul<S> for AffinePoint<C>where
C: PrimeOrderCurve,
S: Borrow<Scalar<C>>,
impl<C, S> Mul<S> for AffinePoint<C>where
C: PrimeOrderCurve,
S: Borrow<Scalar<C>>,
type Output = ProjectivePoint<C>
type Output = ProjectivePoint<C>
The resulting type after applying the
*
operator.sourcefn mul(self, scalar: S) -> ProjectivePoint<C>
fn mul(self, scalar: S) -> ProjectivePoint<C>
Performs the
*
operation. Read moresourceimpl<C> Neg for &AffinePoint<C>where
C: PrimeOrderCurve,
impl<C> Neg for &AffinePoint<C>where
C: PrimeOrderCurve,
type Output = AffinePoint<C>
type Output = AffinePoint<C>
The resulting type after applying the
-
operator.sourcefn neg(self) -> AffinePoint<C>
fn neg(self) -> AffinePoint<C>
Performs the unary
-
operation. Read moresourceimpl<C> Neg for AffinePoint<C>where
C: PrimeOrderCurve,
impl<C> Neg for AffinePoint<C>where
C: PrimeOrderCurve,
type Output = AffinePoint<C>
type Output = AffinePoint<C>
The resulting type after applying the
-
operator.sourceimpl<C> PartialEq<AffinePoint<C>> for AffinePoint<C>where
C: PrimeOrderCurve,
impl<C> PartialEq<AffinePoint<C>> for AffinePoint<C>where
C: PrimeOrderCurve,
sourceimpl<C> PrimeCurveAffine for AffinePoint<C>where
C: PrimeOrderCurve,
FieldBytes<C>: Copy,
FieldSize<C>: ModulusSize,
CompressedPoint<C>: Copy,
<UncompressedPointSize<C> as ArrayLength<u8>>::ArrayType: Copy,
impl<C> PrimeCurveAffine for AffinePoint<C>where
C: PrimeOrderCurve,
FieldBytes<C>: Copy,
FieldSize<C>: ModulusSize,
CompressedPoint<C>: Copy,
<UncompressedPointSize<C> as ArrayLength<u8>>::ArrayType: Copy,
type Curve = ProjectivePoint<C>
type Scalar = <C as ScalarArithmetic>::Scalar
sourcefn identity() -> AffinePoint<C>
fn identity() -> AffinePoint<C>
Returns the additive identity.
sourcefn generator() -> AffinePoint<C>
fn generator() -> AffinePoint<C>
Returns a fixed generator of unknown exponent.
sourcefn is_identity(&self) -> Choice
fn is_identity(&self) -> Choice
Determines if this point represents the point at infinity; the
additive identity. Read more
sourcefn to_curve(&self) -> ProjectivePoint<C>
fn to_curve(&self) -> ProjectivePoint<C>
Converts this element to its curve representation.
sourceimpl<C> Serialize for AffinePoint<C>where
C: PrimeOrderCurve,
FieldSize<C>: ModulusSize,
CompressedPoint<C>: Copy,
<UncompressedPointSize<C> as ArrayLength<u8>>::ArrayType: Copy,
Available on crate feature serde
only.
impl<C> Serialize for AffinePoint<C>where
C: PrimeOrderCurve,
FieldSize<C>: ModulusSize,
CompressedPoint<C>: Copy,
<UncompressedPointSize<C> as ArrayLength<u8>>::ArrayType: Copy,
Available on crate feature
serde
only.sourceimpl<C> Sub<&AffinePoint<C>> for &ProjectivePoint<C>where
C: PrimeOrderCurve,
impl<C> Sub<&AffinePoint<C>> for &ProjectivePoint<C>where
C: PrimeOrderCurve,
type Output = ProjectivePoint<C>
type Output = ProjectivePoint<C>
The resulting type after applying the
-
operator.sourcefn sub(self, other: &AffinePoint<C>) -> ProjectivePoint<C>
fn sub(self, other: &AffinePoint<C>) -> ProjectivePoint<C>
Performs the
-
operation. Read moresourceimpl<C> Sub<&AffinePoint<C>> for ProjectivePoint<C>where
C: PrimeOrderCurve,
impl<C> Sub<&AffinePoint<C>> for ProjectivePoint<C>where
C: PrimeOrderCurve,
type Output = ProjectivePoint<C>
type Output = ProjectivePoint<C>
The resulting type after applying the
-
operator.sourcefn sub(self, other: &AffinePoint<C>) -> ProjectivePoint<C>
fn sub(self, other: &AffinePoint<C>) -> ProjectivePoint<C>
Performs the
-
operation. Read moresourceimpl<C> Sub<AffinePoint<C>> for ProjectivePoint<C>where
C: PrimeOrderCurve,
impl<C> Sub<AffinePoint<C>> for ProjectivePoint<C>where
C: PrimeOrderCurve,
type Output = ProjectivePoint<C>
type Output = ProjectivePoint<C>
The resulting type after applying the
-
operator.sourcefn sub(self, other: AffinePoint<C>) -> ProjectivePoint<C>
fn sub(self, other: AffinePoint<C>) -> ProjectivePoint<C>
Performs the
-
operation. Read moresourceimpl<C> SubAssign<&AffinePoint<C>> for ProjectivePoint<C>where
C: PrimeOrderCurve,
impl<C> SubAssign<&AffinePoint<C>> for ProjectivePoint<C>where
C: PrimeOrderCurve,
sourcefn sub_assign(&mut self, rhs: &AffinePoint<C>)
fn sub_assign(&mut self, rhs: &AffinePoint<C>)
Performs the
-=
operation. Read moresourceimpl<C> SubAssign<AffinePoint<C>> for ProjectivePoint<C>where
C: PrimeOrderCurve,
impl<C> SubAssign<AffinePoint<C>> for ProjectivePoint<C>where
C: PrimeOrderCurve,
sourcefn sub_assign(&mut self, rhs: AffinePoint<C>)
fn sub_assign(&mut self, rhs: AffinePoint<C>)
Performs the
-=
operation. Read moresourceimpl<C> ToCompactEncodedPoint<C> for AffinePoint<C>where
C: PrimeOrderCurve,
FieldSize<C>: ModulusSize,
CompressedPoint<C>: Copy,
<UncompressedPointSize<C> as ArrayLength<u8>>::ArrayType: Copy,
impl<C> ToCompactEncodedPoint<C> for AffinePoint<C>where
C: PrimeOrderCurve,
FieldSize<C>: ModulusSize,
CompressedPoint<C>: Copy,
<UncompressedPointSize<C> as ArrayLength<u8>>::ArrayType: Copy,
sourcefn to_compact_encoded_point(&self) -> CtOption<EncodedPoint<C>>
fn to_compact_encoded_point(&self) -> CtOption<EncodedPoint<C>>
Serialize this value as a SEC1 compact EncodedPoint
sourceimpl<C> ToEncodedPoint<C> for AffinePoint<C>where
C: PrimeOrderCurve,
FieldSize<C>: ModulusSize,
CompressedPoint<C>: Copy,
<UncompressedPointSize<C> as ArrayLength<u8>>::ArrayType: Copy,
impl<C> ToEncodedPoint<C> for AffinePoint<C>where
C: PrimeOrderCurve,
FieldSize<C>: ModulusSize,
CompressedPoint<C>: Copy,
<UncompressedPointSize<C> as ArrayLength<u8>>::ArrayType: Copy,
sourcefn to_encoded_point(&self, compress: bool) -> EncodedPoint<C>
fn to_encoded_point(&self, compress: bool) -> EncodedPoint<C>
Serialize this value as a SEC1
EncodedPoint
, optionally applying
point compression. Read moresourceimpl<C> TryFrom<&AffinePoint<C>> for PublicKey<C>where
C: PrimeOrderCurve,
impl<C> TryFrom<&AffinePoint<C>> for PublicKey<C>where
C: PrimeOrderCurve,
sourceimpl<C> TryFrom<&EncodedPoint<<<C as Curve>::UInt as ArrayEncoding>::ByteSize>> for AffinePoint<C>where
C: PrimeOrderCurve,
FieldBytes<C>: Copy,
FieldSize<C>: ModulusSize,
CompressedPoint<C>: Copy,
impl<C> TryFrom<&EncodedPoint<<<C as Curve>::UInt as ArrayEncoding>::ByteSize>> for AffinePoint<C>where
C: PrimeOrderCurve,
FieldBytes<C>: Copy,
FieldSize<C>: ModulusSize,
CompressedPoint<C>: Copy,
sourcefn try_from(point: &EncodedPoint<C>) -> Result<AffinePoint<C>>
fn try_from(point: &EncodedPoint<C>) -> Result<AffinePoint<C>>
Performs the conversion.
sourceimpl<C> TryFrom<AffinePoint<C>> for PublicKey<C>where
C: PrimeOrderCurve,
impl<C> TryFrom<AffinePoint<C>> for PublicKey<C>where
C: PrimeOrderCurve,
sourceimpl<C> TryFrom<EncodedPoint<<<C as Curve>::UInt as ArrayEncoding>::ByteSize>> for AffinePoint<C>where
C: PrimeOrderCurve,
FieldBytes<C>: Copy,
FieldSize<C>: ModulusSize,
CompressedPoint<C>: Copy,
impl<C> TryFrom<EncodedPoint<<<C as Curve>::UInt as ArrayEncoding>::ByteSize>> for AffinePoint<C>where
C: PrimeOrderCurve,
FieldBytes<C>: Copy,
FieldSize<C>: ModulusSize,
CompressedPoint<C>: Copy,
sourcefn try_from(point: EncodedPoint<C>) -> Result<AffinePoint<C>>
fn try_from(point: EncodedPoint<C>) -> Result<AffinePoint<C>>
Performs the conversion.
impl<C: Copy + PrimeOrderCurve> Copy for AffinePoint<C>where
C::FieldElement: Copy,
C::FieldElement: Copy,
impl<C> DefaultIsZeroes for AffinePoint<C>where
C: PrimeOrderCurve,
impl<C> Eq for AffinePoint<C>where
C: PrimeOrderCurve,
Auto Trait Implementations
impl<C> RefUnwindSafe for AffinePoint<C>where
<C as PrimeOrderCurve>::FieldElement: RefUnwindSafe,
impl<C> Send for AffinePoint<C>
impl<C> Sync for AffinePoint<C>
impl<C> Unpin for AffinePoint<C>where
<C as PrimeOrderCurve>::FieldElement: Unpin,
impl<C> UnwindSafe for AffinePoint<C>where
<C as PrimeOrderCurve>::FieldElement: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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