Skip to content

Commit

Permalink
ed: Add SigningKey::as_bytes (#561)
Browse files Browse the repository at this point in the history
Allows to get a reference to the secret bytes without making a copy.
  • Loading branch information
soerenmeier authored Aug 27, 2023
1 parent b93ace8 commit 098658d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ed25519-dalek/src/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ impl SigningKey {
self.secret_key
}

/// Convert this [`SigningKey`] into a [`SecretKey`] reference
#[inline]
pub fn as_bytes(&self) -> &SecretKey {
&self.secret_key
}

/// Construct a [`SigningKey`] from the bytes of a `VerifyingKey` and `SecretKey`.
///
/// # Inputs
Expand Down

0 comments on commit 098658d

Please sign in to comment.