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>
impl<E: EngineBLS> Keypair<E>
Sourcepub fn into_vartime(&self) -> KeypairVT<E>
pub fn into_vartime(&self) -> KeypairVT<E>
Create a representative usable for operations lacking side channel protections.
Sourcepub fn sign_with_rng<R: Rng>(
&mut self,
message: &Message,
rng: R,
) -> Signature<E>
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.
Sourcepub fn sign_with_random_seed(
&mut self,
message: &Message,
seed: [u8; 32],
) -> Signature<E>
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
Sourcepub fn sign(&mut self, message: &Message) -> Signature<E>
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
Sourcepub fn sign_thread_rng(&mut self, message: &Message) -> Signature<E>
pub fn sign_thread_rng(&mut self, message: &Message) -> Signature<E>
Sign a message creating a Signature
using the default ThreadRng
.
Sourcepub fn signed_message(&mut self, message: &Message) -> SignedMessage<E>
pub fn signed_message(&mut self, message: &Message) -> SignedMessage<E>
Create a SignedMessage
using the default ThreadRng
.
Trait Implementations§
Source§impl<E: EngineBLS> DoublePublicKeyScheme<E> for Keypair<E>
impl<E: EngineBLS> DoublePublicKeyScheme<E> for Keypair<E>
Source§fn sign(&mut self, message: &Message) -> DoubleSignature<E>
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
fn into_public_key_in_signature_group(&self) -> PublicKeyInSignatureGroup<E>
Source§fn into_double_public_key(&self) -> DoublePublicKey<E>
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>
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>
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>
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>
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>
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>
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§
impl<E> Freeze for Keypair<E>where
<E as EngineBLS>::SignatureGroup: Freeze,
<E as EngineBLS>::PublicKeyGroup: Freeze,
<E as EngineBLS>::Scalar: Freeze,
impl<E> RefUnwindSafe for Keypair<E>where
<E as EngineBLS>::SignatureGroup: RefUnwindSafe,
<E as EngineBLS>::PublicKeyGroup: RefUnwindSafe,
<E as EngineBLS>::Scalar: RefUnwindSafe,
impl<E> Send for Keypair<E>
impl<E> Sync for Keypair<E>
impl<E> Unpin for Keypair<E>where
<E as EngineBLS>::SignatureGroup: Unpin,
<E as EngineBLS>::PublicKeyGroup: Unpin,
<E as EngineBLS>::Scalar: Unpin,
impl<E> UnwindSafe for Keypair<E>where
<E as EngineBLS>::SignatureGroup: UnwindSafe,
<E as EngineBLS>::PublicKeyGroup: UnwindSafe,
<E as EngineBLS>::Scalar: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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