pub struct Point { /* private fields */ }
Expand description
A point on the sect283k1 elliptic curve
Implementations§
Source§impl Point
impl Point
Sourcepub fn new_uncompressed(x: &[u8; 36], y: &[u8; 36]) -> Result<Self>
pub fn new_uncompressed(x: &[u8; 36], y: &[u8; 36]) -> Result<Self>
Create a new point from uncompressed coordinates.
Returns an error if the coordinates don’t satisfy the curve equation y² + xy = x³ + 1.
Sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
Check if this point is the identity element.
Sourcepub fn x_coordinate_bytes(&self) -> [u8; 36]
pub fn x_coordinate_bytes(&self) -> [u8; 36]
Get the x-coordinate of this point as bytes.
Sourcepub fn y_coordinate_bytes(&self) -> [u8; 36]
pub fn y_coordinate_bytes(&self) -> [u8; 36]
Get the y-coordinate of this point as bytes.
Sourcepub fn serialize_compressed(&self) -> [u8; 37]
pub fn serialize_compressed(&self) -> [u8; 37]
Serialize this point in compressed format.
The compressed format uses the trace to disambiguate the y-coordinate.
Sourcepub fn deserialize_compressed(bytes: &[u8]) -> Result<Self>
pub fn deserialize_compressed(bytes: &[u8]) -> Result<Self>
Deserialize a point from compressed format.
Recovers the y-coordinate from the x-coordinate and the compression flag. Returns an error if the bytes don’t represent a valid point.
Trait Implementations§
impl Eq for Point
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