[−][src]Struct schnorr::keys::PublicKey
An Schnorr public key.
Methods
impl PublicKey
[src]
pub fn as_compressed(&self) -> &CompressedRistretto
[src]
Access the compressed Ristretto form
pub fn into_compressed(self) -> CompressedRistretto
[src]
Extract the compressed Ristretto form
pub fn as_point(&self) -> &RistrettoPoint
[src]
Access the point form
pub fn into_point(self) -> RistrettoPoint
[src]
Extract the point form
pub fn from_compressed(
compressed: CompressedRistretto
) -> Result<PublicKey, SchnorrError>
[src]
compressed: CompressedRistretto
) -> Result<PublicKey, SchnorrError>
Decompress into the PublicKey
format that also retains the
compressed form.
pub fn from_point(point: RistrettoPoint) -> PublicKey
[src]
Compress into the PublicKey
format that also retains the
uncompressed form.
pub fn to_bytes(&self) -> [u8; 32]
[src]
Convert this public key to a byte array.
pub fn as_bytes<'a>(&'a self) -> &'a [u8; 32]
[src]
View this public key as a byte array.
pub fn from_bytes(bytes: &[u8]) -> Result<PublicKey, SchnorrError>
[src]
Construct a PublicKey
from a slice of bytes.
Warning
The caller is responsible for ensuring that the bytes passed into this
method actually represent a curve25519_dalek::curve::CompressedRistretto
and that said compressed point is actually a point on the curve.
Example
use schnorr::*; let public_key_bytes: [u8; PUBLIC_KEY_LENGTH] = [ 215, 90, 152, 1, 130, 177, 10, 183, 213, 75, 254, 211, 201, 100, 7, 58, 14, 225, 114, 243, 218, 166, 35, 37, 175, 2, 26, 104, 247, 7, 81, 26]; let public_key = PublicKey::from_bytes(&public_key_bytes)?;
Returns
A Result
whose okay value is an Schnorr PublicKey
or whose error value
is an SchnorrError
describing the error that occurred.
pub fn from_secret(secret_key: &SecretKey) -> PublicKey
[src]
Derive this public key from its corresponding SecretKey
.
Trait Implementations
impl Clone for PublicKey
[src]
impl Copy for PublicKey
[src]
impl Debug for PublicKey
[src]
impl Default for PublicKey
[src]
impl<'d> Deserialize<'d> for PublicKey
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'d>,
[src]
D: Deserializer<'d>,
impl Eq for PublicKey
[src]
impl From<SecretKey> for PublicKey
[src]
impl Ord for PublicKey
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<PublicKey> for PublicKey
[src]
impl PartialOrd<PublicKey> for PublicKey
[src]
fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Readable for PublicKey
[src]
impl Serialize for PublicKey
[src]
impl Writeable for PublicKey
[src]
impl Zeroize for PublicKey
[src]
Auto Trait Implementations
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> Cast<U> for T where
U: FromCast<T>,
U: FromCast<T>,
fn cast(self) -> U
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> FromBits<T> for T
fn from_bits(t: T) -> T
impl<T> FromCast<T> for T
fn from_cast(t: T) -> T
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> IntoBits<U> for T where
U: FromBits<T>,
U: FromBits<T>,
fn into_bits(self) -> U
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<Z> Zeroize for Z where
Z: DefaultIsZeroes,
[src]
Z: DefaultIsZeroes,