pub struct PublicKey(/* private fields */);Expand description
A crypto_box512 public key - a curve point’s x-coordinate only (64 bytes), see the module
doc’s own section on why this compression is safe.
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn from_bytes(bytes: &[u8; 64]) -> Option<Self>
pub fn from_bytes(bytes: &[u8; 64]) -> Option<Self>
Reconstructs a public key from its compressed 64-byte x-coordinate encoding. Returns
None if bytes isn’t a valid field element, or doesn’t reconstruct to a point inside the
base point’s own prime-order subgroup (curve512::point_from_x’s own rejection gauntlet).
pub fn to_bytes(&self) -> [u8; 64]
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnsafeUnpin for PublicKey
impl UnwindSafe for PublicKey
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