[−][src]Enum elliptic_curve::weierstrass::public_key::PublicKey
feature="weierstrass"
only.Public keys for Weierstrass curves
Variants
Compressed(CompressedPoint<C>)
feature="weierstrass"
only.Compressed Weierstrass elliptic curve point
Uncompressed(UncompressedPoint<C>)
feature="weierstrass"
only.Uncompressed Weierstrass elliptic curve point
Implementations
impl<C> PublicKey<C> where
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
[src]
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
pub fn from_bytes(bytes: impl AsRef<[u8]>) -> Option<Self>
[src]
feature="weierstrass"
only.Decode public key from an elliptic curve point
(compressed or uncompressed) encoded using the
Elliptic-Curve-Point-to-Octet-String
algorithm described in
SEC 1: Elliptic Curve Cryptography (Version 2.0) section
2.3.3 (page 10).
pub fn from_untagged_point(
bytes: &GenericArray<u8, UntaggedPointSize<C>>
) -> Self where
<C::ElementSize as Add>::Output: ArrayLength<u8>,
[src]
bytes: &GenericArray<u8, UntaggedPointSize<C>>
) -> Self where
<C::ElementSize as Add>::Output: ArrayLength<u8>,
feature="weierstrass"
only.Decode public key from a raw uncompressed point serialized
as a bytestring, without a 0x04
-byte tag.
This will be twice the modulus size, or 1-byte smaller than the
Elliptic-Curve-Point-to-Octet-String
encoding i.e
with the leading 0x04
byte in that encoding removed.
pub fn compress(&mut self)
[src]
feature="weierstrass"
only.Compress this PublicKey
.
If the key is already compressed, this is a no-op.
pub fn as_bytes(&self) -> &[u8]
[src]
feature="weierstrass"
only.Obtain public key as a byte array reference
impl<C> PublicKey<C> where
C: Curve + Arithmetic,
C::AffinePoint: Mul<NonZeroScalar<C>, Output = C::AffinePoint>,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPoint<C>: From<C::AffinePoint>,
UncompressedPoint<C>: From<C::AffinePoint>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
[src]
C: Curve + Arithmetic,
C::AffinePoint: Mul<NonZeroScalar<C>, Output = C::AffinePoint>,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPoint<C>: From<C::AffinePoint>,
UncompressedPoint<C>: From<C::AffinePoint>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
pub fn from_secret_key(
secret_key: &SecretKey<C>,
compress: bool
) -> Result<Self, Error>
[src]
secret_key: &SecretKey<C>,
compress: bool
) -> Result<Self, Error>
feature="weierstrass"
only.Trait Implementations
impl<C> AsRef<[u8]> for PublicKey<C> where
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
[src]
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C: Clone> Clone for PublicKey<C> where
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
[src]
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> Copy for PublicKey<C> where
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
<CompressedPointSize<C> as ArrayLength<u8>>::ArrayType: Copy,
<UncompressedPointSize<C> as ArrayLength<u8>>::ArrayType: Copy,
[src]
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
<CompressedPointSize<C> as ArrayLength<u8>>::ArrayType: Copy,
<UncompressedPointSize<C> as ArrayLength<u8>>::ArrayType: Copy,
impl<C> Debug for PublicKey<C> where
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
[src]
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C: Eq> Eq for PublicKey<C> where
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
[src]
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C, '_> From<&'_ EphemeralSecret<C>> for PublicKey<C> where
C: Curve + Arithmetic,
C::Scalar: Clone + Generate + Zeroize,
C::AffinePoint: FromPublicKey<C> + Mul<NonZeroScalar<C>, Output = C::AffinePoint> + Zeroize,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPoint<C>: From<C::AffinePoint>,
UncompressedPoint<C>: From<C::AffinePoint>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
[src]
C: Curve + Arithmetic,
C::Scalar: Clone + Generate + Zeroize,
C::AffinePoint: FromPublicKey<C> + Mul<NonZeroScalar<C>, Output = C::AffinePoint> + Zeroize,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPoint<C>: From<C::AffinePoint>,
UncompressedPoint<C>: From<C::AffinePoint>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
fn from(ephemeral_secret: &EphemeralSecret<C>) -> Self
[src]
impl<C> From<CompressedPoint<C>> for PublicKey<C> where
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
[src]
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
fn from(point: CompressedPoint<C>) -> Self
[src]
impl<C> From<UncompressedPoint<C>> for PublicKey<C> where
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
[src]
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
fn from(point: UncompressedPoint<C>) -> Self
[src]
impl<C: Ord> Ord for PublicKey<C> where
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
[src]
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
fn cmp(&self, other: &PublicKey<C>) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<C: PartialEq> PartialEq<PublicKey<C>> for PublicKey<C> where
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
[src]
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C: PartialOrd> PartialOrd<PublicKey<C>> for PublicKey<C> where
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
[src]
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
fn partial_cmp(&self, other: &PublicKey<C>) -> Option<Ordering>
[src]
fn lt(&self, other: &PublicKey<C>) -> bool
[src]
fn le(&self, other: &PublicKey<C>) -> bool
[src]
fn gt(&self, other: &PublicKey<C>) -> bool
[src]
fn ge(&self, other: &PublicKey<C>) -> bool
[src]
impl<C> StructuralEq for PublicKey<C> where
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
[src]
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> StructuralPartialEq for PublicKey<C> where
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
[src]
C: Curve,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C, '_> TryFrom<&'_ SecretKey<C>> for PublicKey<C> where
C: Curve + Arithmetic,
C::AffinePoint: Mul<NonZeroScalar<C>, Output = C::AffinePoint>,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPoint<C>: From<C::AffinePoint>,
UncompressedPoint<C>: From<C::AffinePoint>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
[src]
C: Curve + Arithmetic,
C::AffinePoint: Mul<NonZeroScalar<C>, Output = C::AffinePoint>,
C::ElementSize: Add<U1>,
<C::ElementSize as Add>::Output: Add<U1>,
CompressedPoint<C>: From<C::AffinePoint>,
UncompressedPoint<C>: From<C::AffinePoint>,
CompressedPointSize<C>: ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
Auto Trait Implementations
impl<C> RefUnwindSafe for PublicKey<C> where
<<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: RefUnwindSafe,
<<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: RefUnwindSafe,
<C as Curve>::ElementSize: Add<<C as Curve>::ElementSize>,
<<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: RefUnwindSafe,
<<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: RefUnwindSafe,
<C as Curve>::ElementSize: Add<<C as Curve>::ElementSize>,
impl<C> Send for PublicKey<C> where
<C as Curve>::ElementSize: Add<<C as Curve>::ElementSize>,
<C as Curve>::ElementSize: Add<<C as Curve>::ElementSize>,
impl<C> Sync for PublicKey<C> where
<C as Curve>::ElementSize: Add<<C as Curve>::ElementSize>,
<C as Curve>::ElementSize: Add<<C as Curve>::ElementSize>,
impl<C> Unpin for PublicKey<C> where
<<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: Unpin,
<<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: Unpin,
<C as Curve>::ElementSize: Add<<C as Curve>::ElementSize>,
<<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: Unpin,
<<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: Unpin,
<C as Curve>::ElementSize: Add<<C as Curve>::ElementSize>,
impl<C> UnwindSafe for PublicKey<C> where
<<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: UnwindSafe,
<<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: UnwindSafe,
<C as Curve>::ElementSize: Add<<C as Curve>::ElementSize>,
<<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: UnwindSafe,
<<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: UnwindSafe,
<C as Curve>::ElementSize: Add<<C as Curve>::ElementSize>,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,