pub type EncodedPoint<C> = EncodedPoint<FieldSize<C>>;
Expand description
Encoded elliptic curve point sized appropriately for a given curve.
Aliased Type§
struct EncodedPoint<C> { /* private fields */ }
Implementations
§impl<Size> EncodedPoint<Size>where
Size: ModulusSize,
impl<Size> EncodedPoint<Size>where
Size: ModulusSize,
pub fn from_bytes(input: impl AsRef<[u8]>) -> Result<EncodedPoint<Size>, Error>
pub fn from_bytes(input: impl AsRef<[u8]>) -> Result<EncodedPoint<Size>, Error>
Decode elliptic curve point (compressed or uncompressed) from the
Elliptic-Curve-Point-to-Octet-String
encoding described in
SEC 1: Elliptic Curve Cryptography (Version 2.0) section
2.3.3 (page 10).
pub fn from_untagged_bytes(
bytes: &GenericArray<u8, <Size as ModulusSize>::UntaggedPointSize>,
) -> EncodedPoint<Size>
pub fn from_untagged_bytes( bytes: &GenericArray<u8, <Size as ModulusSize>::UntaggedPointSize>, ) -> EncodedPoint<Size>
Decode elliptic curve point from raw uncompressed coordinates, i.e.
encoded as the concatenated x || y
coordinates with no leading SEC1
tag byte (which would otherwise be 0x04
for an uncompressed point).
pub fn from_affine_coordinates(
x: &GenericArray<u8, Size>,
y: &GenericArray<u8, Size>,
compress: bool,
) -> EncodedPoint<Size>
pub fn from_affine_coordinates( x: &GenericArray<u8, Size>, y: &GenericArray<u8, Size>, compress: bool, ) -> EncodedPoint<Size>
Encode an elliptic curve point from big endian serialized coordinates (with optional point compression)
pub fn identity() -> EncodedPoint<Size>
pub fn identity() -> EncodedPoint<Size>
Return [EncodedPoint
] representing the additive identity
(a.k.a. point at infinity)
pub fn is_compact(&self) -> bool
pub fn is_compact(&self) -> bool
Is this [EncodedPoint
] compact?
pub fn is_compressed(&self) -> bool
pub fn is_compressed(&self) -> bool
Is this [EncodedPoint
] compressed?
pub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
Is this [EncodedPoint
] the additive identity? (a.k.a. point at infinity)
pub fn compress(&self) -> EncodedPoint<Size>
pub fn compress(&self) -> EncodedPoint<Size>
Compress this [EncodedPoint
], returning a new [EncodedPoint
].
pub fn coordinates(&self) -> Coordinates<'_, Size>
pub fn coordinates(&self) -> Coordinates<'_, Size>
Get the Coordinates
for this [EncodedPoint
].
Trait Implementations§
Source§impl<C> From<&PublicKey<C>> for EncodedPoint<C>where
C: Curve + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
impl<C> From<&PublicKey<C>> for EncodedPoint<C>where
C: Curve + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
Source§fn from(public_key: &PublicKey<C>) -> EncodedPoint<C>
fn from(public_key: &PublicKey<C>) -> EncodedPoint<C>
Source§impl<C> From<PublicKey<C>> for EncodedPoint<C>where
C: Curve + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
impl<C> From<PublicKey<C>> for EncodedPoint<C>where
C: Curve + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
Source§fn from(public_key: PublicKey<C>) -> EncodedPoint<C>
fn from(public_key: PublicKey<C>) -> EncodedPoint<C>
§impl<Size> AsRef<[u8]> for EncodedPoint<Size>where
Size: ModulusSize,
impl<Size> AsRef<[u8]> for EncodedPoint<Size>where
Size: ModulusSize,
§impl<Size> ConditionallySelectable for EncodedPoint<Size>where
Size: ModulusSize,
<<Size as ModulusSize>::UncompressedPointSize as ArrayLength<u8>>::ArrayType: Copy,
impl<Size> ConditionallySelectable for EncodedPoint<Size>where
Size: ModulusSize,
<<Size as ModulusSize>::UncompressedPointSize as ArrayLength<u8>>::ArrayType: Copy,
§fn conditional_select(
a: &EncodedPoint<Size>,
b: &EncodedPoint<Size>,
choice: Choice,
) -> EncodedPoint<Size>
fn conditional_select( a: &EncodedPoint<Size>, b: &EncodedPoint<Size>, choice: Choice, ) -> EncodedPoint<Size>
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 more§impl<Size> Debug for EncodedPoint<Size>where
Size: ModulusSize,
impl<Size> Debug for EncodedPoint<Size>where
Size: ModulusSize,
§impl<'de, Size> Deserialize<'de> for EncodedPoint<Size>where
Size: ModulusSize,
impl<'de, Size> Deserialize<'de> for EncodedPoint<Size>where
Size: ModulusSize,
§fn deserialize<D>(
deserializer: D,
) -> Result<EncodedPoint<Size>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<EncodedPoint<Size>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl<Size> Display for EncodedPoint<Size>where
Size: ModulusSize,
impl<Size> Display for EncodedPoint<Size>where
Size: ModulusSize,
§impl<Size> FromStr for EncodedPoint<Size>where
Size: ModulusSize,
Decode a SEC1-encoded point from hexadecimal.
impl<Size> FromStr for EncodedPoint<Size>where
Size: ModulusSize,
Decode a SEC1-encoded point from hexadecimal.
Upper and lower case hexadecimal are both accepted, however mixed case is rejected.