pub struct PublicKey { /* private fields */ }Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn from_coordinates(x: Fr, y: Fr) -> Result<Self, CryptoError>
pub fn from_coordinates(x: Fr, y: Fr) -> Result<Self, CryptoError>
Construct from coordinates with on-curve and subgroup membership validation.
Sourcepub fn is_on_curve(&self) -> bool
pub fn is_on_curve(&self) -> bool
Check: A*x^2 + y^2 == 1 + D*x^2*y^2
Sourcepub fn add(&self, other: &Self) -> Result<Self, CryptoError>
pub fn add(&self, other: &Self) -> Result<Self, CryptoError>
Twisted Edwards point addition (complete – no exceptional cases).
Sourcepub fn mul_scalar(&self, scalar_le_bytes: &[u8]) -> Result<Self, CryptoError>
pub fn mul_scalar(&self, scalar_le_bytes: &[u8]) -> Result<Self, CryptoError>
Constant-time double-and-add scalar multiplication. Scalar is little-endian bytes.
pub fn to_hex(&self) -> String
Sourcepub fn from_hex(hex_str: &str) -> Result<Self, CryptoError>
pub fn from_hex(hex_str: &str) -> Result<Self, CryptoError>
Decompress from hex with full validation (curve check + subgroup membership).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PublicKey
impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for PublicKey
impl Eq for PublicKey
impl StructuralPartialEq for PublicKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more