llcrypto: Implement `Into<[u8;32]>` for Ed25519Identity

This commit is contained in:
Nick Mathewson 2023-01-30 14:10:34 -05:00
parent 72448b704a
commit 59b981ea5e
2 changed files with 7 additions and 0 deletions

View File

@ -80,6 +80,12 @@ impl From<[u8; ED25519_ID_LEN]> for Ed25519Identity {
}
}
impl From<Ed25519Identity> for [u8; ED25519_ID_LEN] {
fn from(value: Ed25519Identity) -> Self {
value.id.into()
}
}
impl From<PublicKey> for Ed25519Identity {
fn from(pk: PublicKey) -> Self {
(&pk).into()

View File

@ -0,0 +1 @@
ADDED: `Into<[u8;_]>` for Ed25519Identity