Skip to content

Commit

Permalink
Expose to_bytes() for Ed25519 SecretKey
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-markin committed Apr 23, 2024
1 parent 059e12c commit 8f11c14
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/crypto/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit 8f11c14

Please sign in to comment.