diff --git a/pallas-crypto/src/key/ed25519.rs b/pallas-crypto/src/key/ed25519.rs index f09e7bc..e40d2fd 100644 --- a/pallas-crypto/src/key/ed25519.rs +++ b/pallas-crypto/src/key/ed25519.rs @@ -311,6 +311,30 @@ impl From<[u8; Self::SIZE]> for Signature { } } +impl From<[u8; Self::SIZE]> for SecretKey { + fn from(bytes: [u8; Self::SIZE]) -> Self { + Self(bytes) + } +} + +impl From for [u8; SecretKey::SIZE] { + fn from(sk: SecretKey) -> Self { + sk.0 + } +} + +impl From<[u8; Self::SIZE]> for SecretKeyExtended { + fn from(bytes: [u8; Self::SIZE]) -> Self { + Self(bytes) + } +} + +impl From for [u8; SecretKeyExtended::SIZE] { + fn from(ske: SecretKeyExtended) -> Self { + ske.0 + } +} + impl<'a> TryFrom<&'a [u8]> for PublicKey { type Error = TryFromPublicKeyError; fn try_from(value: &'a [u8]) -> Result {