Skip to content

Commit

Permalink
k256: add schnorr::SigningKey::as_nonzero_scalar (#690)
Browse files Browse the repository at this point in the history
Adds an accessor for the inner `NonZeroScalar` value that represents a
Schnorr secret key.
  • Loading branch information
tarcieri authored Nov 20, 2022
1 parent 2a9b0d7 commit 2b819cb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions k256/src/schnorr/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,17 @@ impl SigningKey {
&self.verifying_key
}

/// Borrow the secret [`NonZeroScalar`] value for this key.
///
/// # ⚠️ Warning
///
/// This value is key material.
///
/// Please treat it with the care it deserves!
pub fn as_nonzero_scalar(&self) -> &NonZeroScalar {
&self.secret_key
}

/// Compute Schnorr signature.
///
/// # ⚠️ Warning
Expand Down

0 comments on commit 2b819cb

Please sign in to comment.