Skip to content

Commit

Permalink
feat(signer): Create method to multiply with secret key scalar
Browse files Browse the repository at this point in the history
  • Loading branch information
adonagy authored and sebastiencs committed Sep 18, 2024
1 parent 5dd80ac commit f07ca8c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions signer/src/keypair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ 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 {
multiplicand.mul(self.secret.clone().into_scalar()).into_affine()
}
}

impl fmt::Debug for Keypair {
Expand Down

0 comments on commit f07ca8c

Please sign in to comment.