From 484ebe94bb75d5a50691fa88babc635e2a3ed37c Mon Sep 17 00:00:00 2001 From: Adrian Nagy Date: Tue, 28 Nov 2023 11:49:59 +0100 Subject: [PATCH] feat(signer): Create method to multiply with secret key scalar --- signer/src/keypair.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/signer/src/keypair.rs b/signer/src/keypair.rs index 45e00dda43..fc81dce32e 100644 --- a/signer/src/keypair.rs +++ b/signer/src/keypair.rs @@ -93,6 +93,13 @@ impl Keypair { pub fn to_hex(&self) -> String { hex::encode(self.to_bytes()) } + + /// Performs scalar multiplication with the secret key + pub fn secret_multiply_with_curve_point(&self, multiplicand: CurvePoint) -> CurvePoint { + use ark_ec::AffineCurve; + use ark_ec::ProjectiveCurve; + multiplicand.mul(self.secret.clone().into_scalar()).into_affine() + } } impl fmt::Debug for Keypair {