Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/ecdh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ impl SharedSecret {

/// Returns the shared secret as a byte value.
#[inline]
pub fn secret_bytes(&self) -> [u8; SHARED_SECRET_SIZE] { self.0 }
pub fn to_secret_bytes(&self) -> [u8; SHARED_SECRET_SIZE] { self.0 }

/// Returns the shared secret as a byte value.
#[deprecated(since = "TBD", note = "Use `to_secret_bytes` instead.")]
#[inline]
pub fn secret_bytes(&self) -> [u8; SHARED_SECRET_SIZE] { self.to_secret_bytes() }

/// Creates a shared secret from `bytes` array.
#[inline]
Expand Down
7 changes: 6 additions & 1 deletion src/key/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,10 +612,15 @@ impl Keypair {

/// Returns the secret bytes for this key pair.
#[inline]
pub fn secret_bytes(&self) -> [u8; constants::SECRET_KEY_SIZE] {
pub fn to_secret_bytes(&self) -> [u8; constants::SECRET_KEY_SIZE] {
*SecretKey::from_keypair(self).as_ref()
}

/// Returns the secret bytes for this key pair.
#[deprecated(since = "TBD", note = "use to_secret_bytes instead")]
#[inline]
pub fn secret_bytes(&self) -> [u8; constants::SECRET_KEY_SIZE] { self.to_secret_bytes() }

/// Tweaks a keypair by first converting the public key to an xonly key and tweaking it.
///
/// # Errors
Expand Down
Loading