ed: Add SigningKey::as_bytes (#561)

Allows to get a reference to the secret bytes without making a copy.
This commit is contained in:
Sören Meier 2023-08-27 22:28:06 +02:00 committed by GitHub
parent b93ace8c7f
commit 098658dc8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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