mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 16:55:46 +00:00
Expose blst internals (#6829)
This commit is contained in:
@@ -61,6 +61,11 @@ where
|
||||
GenericPublicKey::from_point(self.point.public_key())
|
||||
}
|
||||
|
||||
/// Returns a reference to the underlying BLS point.
|
||||
pub fn point(&self) -> &Sec {
|
||||
&self.point
|
||||
}
|
||||
|
||||
/// Serialize `self` as compressed bytes.
|
||||
///
|
||||
/// ## Note
|
||||
@@ -89,3 +94,20 @@ where
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<Sig, Pub, Sec> GenericSecretKey<Sig, Pub, Sec>
|
||||
where
|
||||
Sig: TSignature<Pub>,
|
||||
Pub: TPublicKey,
|
||||
Sec: TSecretKey<Sig, Pub> + Clone,
|
||||
{
|
||||
/// Instantiates `Self` from a `point`.
|
||||
/// Takes a reference, as moves might accidentally leave behind key material
|
||||
pub fn from_point(point: &Sec) -> Self {
|
||||
Self {
|
||||
point: point.clone(),
|
||||
_phantom_signature: PhantomData,
|
||||
_phantom_public_key: PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user