From dfd7ab0373a24fcb6c62b2a6202ffafcf80cfdc3 Mon Sep 17 00:00:00 2001 From: Daniel Knopik Date: Tue, 14 Jan 2025 21:36:13 +0100 Subject: [PATCH] add `point` and `from_point` to `GenericSecretKey` --- crypto/bls/src/generic_secret_key.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crypto/bls/src/generic_secret_key.rs b/crypto/bls/src/generic_secret_key.rs index a0a4331110..c48fdc4198 100644 --- a/crypto/bls/src/generic_secret_key.rs +++ b/crypto/bls/src/generic_secret_key.rs @@ -61,6 +61,20 @@ where GenericPublicKey::from_point(self.point.public_key()) } + /// Returns a reference to the underlying BLS point. + pub fn point(&self) -> &Sec { + &self.point + } + + /// Instantiates `Self` from a `point`. + pub fn from_point(point: Sec) -> Self { + Self { + point, + _phantom_signature: PhantomData, + _phantom_public_key: PhantomData, + } + } + /// Serialize `self` as compressed bytes. /// /// ## Note