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 3bb9349 commit 484ebe9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions signer/src/keypair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 484ebe9

Please sign in to comment.