pub struct Coordinate<E: Curve>(/* private fields */);
Expand description
Affine coordinate of a point on elliptic curve
Implementations§
Source§impl<E: Curve> Coordinate<E>
impl<E: Curve> Coordinate<E>
Sourcepub fn as_be_bytes(&self) -> &[u8] ⓘ
pub fn as_be_bytes(&self) -> &[u8] ⓘ
(Big-endian) bytes representation of a coordinate
Sourcepub fn from_be_bytes(bytes: &[u8]) -> Result<Self, InvalidCoordinate>
pub fn from_be_bytes(bytes: &[u8]) -> Result<Self, InvalidCoordinate>
Parses (big-endian) bytes representation of a coordinate
Sourcepub fn to_scalar(&self) -> Scalar<E>
pub fn to_scalar(&self) -> Scalar<E>
Converts coordinate into scalar (coordinate is reduced modulo curve order)
Sourcepub fn new(bytes: E::CoordinateArray) -> Self
pub fn new(bytes: E::CoordinateArray) -> Self
Constructs a coordinate from a byte array
Sourcepub fn as_array(&self) -> &E::CoordinateArray
pub fn as_array(&self) -> &E::CoordinateArray
Bytes representation of a coordinate
Trait Implementations§
Source§impl<E: Clone + Curve> Clone for Coordinate<E>where
E::CoordinateArray: Clone,
impl<E: Clone + Curve> Clone for Coordinate<E>where
E::CoordinateArray: Clone,
Source§fn clone(&self) -> Coordinate<E>
fn clone(&self) -> Coordinate<E>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<E: Curve> Debug for Coordinate<E>
impl<E: Curve> Debug for Coordinate<E>
Source§impl<E: Curve> Default for Coordinate<E>
impl<E: Curve> Default for Coordinate<E>
Source§impl<E: Curve> Hash for Coordinate<E>
impl<E: Curve> Hash for Coordinate<E>
Source§impl<E: Curve> Ord for Coordinate<E>
impl<E: Curve> Ord for Coordinate<E>
Source§impl<E: Curve> PartialEq for Coordinate<E>
impl<E: Curve> PartialEq for Coordinate<E>
Source§impl<E: Curve> PartialOrd for Coordinate<E>
impl<E: Curve> PartialOrd for Coordinate<E>
impl<E: Curve> Eq for Coordinate<E>
Auto Trait Implementations§
impl<E> Freeze for Coordinate<E>
impl<E> RefUnwindSafe for Coordinate<E>
impl<E> Send for Coordinate<E>
impl<E> Sync for Coordinate<E>
impl<E> Unpin for Coordinate<E>
impl<E> UnwindSafe for Coordinate<E>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)