Struct schnorr_fun::KeyPair [−][src]
pub struct KeyPair { /* fields omitted */ }
Expand description
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
Returns a reference to the secret key.
Returns a reference to the public key.
Gets a reference to the key-pair as a tuple
Example
let (secret_key, public_key) = keypair.as_tuple();
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
Auto Trait Implementations
impl RefUnwindSafe for KeyPair
impl UnwindSafe for KeyPair
Blanket Implementations
Mutably borrows from an owned value. Read more
Returns a new instance of the invocant that will be marked with M
. Read more
type Output = T
type Output = T
Should always be Self