Struct Keypair

Source
pub struct Keypair<E: EngineBLS> {
    pub secret: SecretKey<E>,
    pub public: PublicKey<E>,
}
Expand description

BLS Keypair

We create Signed messages with a Keypair to avoid recomputing the public key, which usually takes longer than signing when the public key group is G2.

We provide constant-time signing using key splitting.

Fields§

§secret: SecretKey<E>§public: PublicKey<E>

Implementations§

Source§

impl<E: EngineBLS> Keypair<E>

Source

pub fn generate<R: Rng>(rng: R) -> Self

Generate a Keypair

Source§

impl<E: EngineBLS> Keypair<E>

Source

pub fn into_vartime(&self) -> KeypairVT<E>

Create a representative usable for operations lacking side channel protections.

Source

pub fn sign_with_rng<R: Rng>( &mut self, message: &Message, rng: R, ) -> Signature<E>

Sign a message creating a Signature using a user supplied CSPRNG for the key splitting.

Source

pub fn sign_with_random_seed( &mut self, message: &Message, seed: [u8; 32], ) -> Signature<E>

Sign a message using a Seedabale RNG created from user supplied seed

Source

pub fn sign(&mut self, message: &Message) -> Signature<E>

Sign a message using a Seedabale RNG created from a seed derived from the message and key

Source

pub fn sign_thread_rng(&mut self, message: &Message) -> Signature<E>

Sign a message creating a Signature using the default ThreadRng.

Source

pub fn signed_message(&mut self, message: &Message) -> SignedMessage<E>

Create a SignedMessage using the default ThreadRng.

Trait Implementations§

Source§

impl<E: EngineBLS> Clone for Keypair<E>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<E: EngineBLS> DoublePublicKeyScheme<E> for Keypair<E>

Source§

fn sign(&mut self, message: &Message) -> DoubleSignature<E>

Sign a message using a Seedabale RNG created from a seed derived from the message and key

Source§

fn into_public_key_in_signature_group(&self) -> PublicKeyInSignatureGroup<E>

Source§

fn into_double_public_key(&self) -> DoublePublicKey<E>

Return a double public object containing public keys both in G1 and G2
Source§

impl<E: EngineBLS, H: DynDigest + Default + Clone> ProofOfPossessionGenerator<E, H, DoublePublicKey<E>, NuggetBLSPoP<E>> for Keypair<E>

Source§

fn generate_pok(&mut self) -> NuggetBLSPoP<E>

The proof of possession generator is supposed to to produce a schnorr signature or a bls signature using the secret key which it claims to possess. This proves that that the secret key is known.
Source§

impl<E: EngineBLS, H: DynDigest + Default + Clone> ProofOfPossessionGenerator<E, H, DoublePublicKey<E>, NuggetBLSnCPPoP<E>> for Keypair<E>

Source§

fn generate_pok(&mut self) -> NuggetBLSnCPPoP<E>

The proof of possession generator is supposed to to produce a schnorr signature or a bls signature using the secret key which it claims to possess. This proves that that the secret key is known.
Source§

impl<E: EngineBLS, H: DynDigest + Default + Clone> ProofOfPossessionGenerator<E, H, PublicKey<E>, SchnorrPoP<E>> for Keypair<E>

Source§

fn generate_pok(&mut self) -> SchnorrPoP<E>

The proof of possession generator is supposed to to produce a schnorr signature or a bls signature using the secret key which it claims to possess. This proves that that the secret key is known.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V