pub struct Point { /* private fields */ }
Expand description
Affine coordinates (x, y) or identity; š½ā is built from FieldElement
Implementations§
Source§impl Point
impl Point
Sourcepub fn new_uncompressed(x_bytes: &[u8; 24], y_bytes: &[u8; 24]) -> Result<Self>
pub fn new_uncompressed(x_bytes: &[u8; 24], y_bytes: &[u8; 24]) -> Result<Self>
Create a new affine point from uncompressed byte coordinates
Sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
Is this the identity point?
Sourcepub fn x_coordinate_bytes(&self) -> [u8; 24]
pub fn x_coordinate_bytes(&self) -> [u8; 24]
Extract xācoordinate as bigāendian bytes
Sourcepub fn y_coordinate_bytes(&self) -> [u8; 24]
pub fn y_coordinate_bytes(&self) -> [u8; 24]
Extract yācoordinate as bigāendian bytes
Sourcepub fn detect_format(bytes: &[u8]) -> Result<PointFormat>
pub fn detect_format(bytes: &[u8]) -> Result<PointFormat>
Detect serialized point format
Sourcepub fn serialize_uncompressed(&self) -> [u8; 49]
pub fn serialize_uncompressed(&self) -> [u8; 49]
Serialize this point as uncompressed: 0x04 ā„ x ā„ y
Sourcepub fn deserialize_uncompressed(bytes: &[u8]) -> Result<Self>
pub fn deserialize_uncompressed(bytes: &[u8]) -> Result<Self>
Deserialize from uncompressed bytes (0x04 ā„ x ā„ y), or allāzeros for identity
Sourcepub fn serialize_compressed(&self) -> [u8; 25]
pub fn serialize_compressed(&self) -> [u8; 25]
Serialize this point in compressed form: 0x02/0x03 ā„ x
Sourcepub fn deserialize_compressed(bytes: &[u8]) -> Result<Self>
pub fn deserialize_compressed(bytes: &[u8]) -> Result<Self>
Deserialize from compressed bytes (0x02/0x03 ā„ x) or allāzeros for identity
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Point
impl RefUnwindSafe for Point
impl Send for Point
impl Sync for Point
impl Unpin for Point
impl UnwindSafe for Point
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