[−][src]Struct schnorr_fun::KeyPair
A secret and public key-pair for generating Schnorr signatures.
The KeyPair
struct is exists because it is more efficient to pre-compute the public key and
pass it in rather pass it in when signing with the same key multiple times.
Create a KeyPair
from a Schnorr
instance.
let my_secret_key = Scalar::random(&mut rand::thread_rng()); let my_keypair = schnorr.new_keypair(my_secret_key);
Implementations
impl KeyPair
[src]
pub fn secret_key(&self) -> &Scalar
[src]
Returns a reference to the secret key.
pub fn public_key(&self) -> &XOnly<EvenY>
[src]
Returns a reference to the public key.
pub fn as_tuple(&self) -> (&Scalar, &XOnly<EvenY>)
[src]
Gets a reference to the key-pair as a tuple
Example
let (secret_key, public_key) = keypair.as_tuple();
pub fn verification_key(&self) -> Point<EvenY>
[src]
Returns the full Point<EvenY>
for the public key which is used in verify
.
This is just a descriptive short version of:
let verification_key = keypair.public_key().to_point();
Trait Implementations
impl Clone for KeyPair
[src]
impl Debug for KeyPair
[src]
impl From<KeyPair> for (Scalar, XOnly<EvenY>)
[src]
Auto Trait Implementations
impl RefUnwindSafe for KeyPair
impl Send for KeyPair
impl Sync for KeyPair
impl Unpin for KeyPair
impl UnwindSafe for KeyPair
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Mark for T
[src]
#[must_use]fn mark<M>(self) -> <M as ChangeMark<T>>::Out where
M: ChangeMark<T>,
[src]
M: ChangeMark<T>,
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>,