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

Performs the conversion.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Returns a new instance of the invocant that will be marked with M. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.