diff --git a/src/crypto/ed25519.rs b/src/crypto/ed25519.rs index 852d4e0f..2d43ebf1 100644 --- a/src/crypto/ed25519.rs +++ b/src/crypto/ed25519.rs @@ -202,6 +202,11 @@ impl SecretKey { sk_bytes.zeroize(); Ok(SecretKey(secret)) } + + /// Convert this secret key to a byte array. + pub fn to_bytes(&self) -> [u8; 32] { + self.0.to_bytes() + } } #[cfg(test)] diff --git a/src/types.rs b/src/types.rs index 5b125129..8f40b78b 100644 --- a/src/types.rs +++ b/src/types.rs @@ -22,6 +22,14 @@ use rand::Rng; +// Re-export the types used in public interfaces. +pub mod multiaddr { + pub use multiaddr::{Error, Iter, Multiaddr, Onion3Addr, Protocol}; +} +pub mod multihash { + pub use multihash::{Code, Error, Multihash, MultihashDigest}; +} + pub mod protocol; /// Substream ID.