Struct mithril_stm::multi_sig::SigningKey
source · pub struct SigningKey(/* private fields */);
Expand description
MultiSig secret key, which is a wrapper over the BlstSk type from the blst library.
Implementations§
source§impl SigningKey
impl SigningKey
sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, MultiSignatureError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, MultiSignatureError>
Convert a string of bytes into a SigningKey
.
§Error
Fails if the byte string represents a scalar larger than the group order.
Trait Implementations§
source§impl Clone for SigningKey
impl Clone for SigningKey
source§fn clone(&self) -> SigningKey
fn clone(&self) -> SigningKey
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SigningKey
impl Debug for SigningKey
source§impl<'de> Deserialize<'de> for SigningKey
impl<'de> Deserialize<'de> for SigningKey
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<&SigningKey> for ProofOfPossession
impl From<&SigningKey> for ProofOfPossession
source§fn from(sk: &SigningKey) -> Self
fn from(sk: &SigningKey) -> Self
Convert a secret key into an MspPoP
. This is performed by computing
k1 = H_G1(b"PoP" || mvk)
and k2 = g1 * sk
where H_G1
hashes into
G1
and g1
is the generator in G1
.
source§impl From<&SigningKey> for VerificationKey
impl From<&SigningKey> for VerificationKey
source§fn from(sk: &SigningKey) -> Self
fn from(sk: &SigningKey) -> Self
Convert a secret key into an MspMvk
. This is performed by computing
MspMvk = g2 * sk
, where g2
is the generator in G2. We can use the
blst built-in function sk_to_pk
.
source§impl From<&SigningKey> for VerificationKeyPoP
impl From<&SigningKey> for VerificationKeyPoP
source§fn from(sk: &SigningKey) -> Self
fn from(sk: &SigningKey) -> Self
Convert a secret key into a VerificationKeyPoP
by simply converting to a
MspMvk
and MspPoP
.
Auto Trait Implementations§
impl Freeze for SigningKey
impl RefUnwindSafe for SigningKey
impl Send for SigningKey
impl Sync for SigningKey
impl Unpin for SigningKey
impl UnwindSafe for SigningKey
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)