Skip to content

Commit 2fb886c

Browse files
committed
dev: Deprecate old API impl
1 parent 2cb8058 commit 2fb886c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/ecdh.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,12 @@ impl SharedSecret {
5555

5656
/// Returns the shared secret as a byte value.
5757
#[inline]
58+
#[deprecated(since = "TBD", note = "use Shared::Secret::as_secret_bytes instead")]
5859
pub fn to_secret_bytes(&self) -> [u8; SHARED_SECRET_SIZE] { self.0 }
5960

6061
/// Returns the shared secret as secret bytes
6162
#[inline]
62-
pub fn as_secret_bytes(&self) -> [u8; SHARED_SECRET_SIZE] { self.0 }
63+
pub fn as_secret_bytes(&self) -> &[u8; SHARED_SECRET_SIZE] { &self.0 }
6364

6465
/// Returns the shared secret as a byte value.
6566
#[deprecated(since = "TBD", note = "Use `to_secret_bytes` instead.")]
@@ -68,6 +69,7 @@ impl SharedSecret {
6869

6970
/// Creates a shared secret from `bytes` array.
7071
#[inline]
72+
#[deprecated(since = "TBD", note = "use SharedSecret::from_secret_bytes instead")]
7173
pub fn from_bytes(bytes: [u8; SHARED_SECRET_SIZE]) -> SharedSecret { SharedSecret(bytes) }
7274

7375
/// Creates a shared secret from a secret `bytes` array.

0 commit comments

Comments
 (0)