diff options
Diffstat (limited to 'openpgp/src/crypto/backend/interface.rs')
-rw-r--r-- | openpgp/src/crypto/backend/interface.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/openpgp/src/crypto/backend/interface.rs b/openpgp/src/crypto/backend/interface.rs index 81343c6c..21034862 100644 --- a/openpgp/src/crypto/backend/interface.rs +++ b/openpgp/src/crypto/backend/interface.rs @@ -36,4 +36,20 @@ pub trait Asymmetric { /// Computes the shared point. fn x25519_shared_point(secret: &Protected, public: &[u8; 32]) -> Result<Protected>; + + /// Generates an Ed25519 key pair. + /// + /// Returns a tuple containing the secret and public key. + fn ed25519_generate_key() -> Result<(Protected, [u8; 32])>; + + /// Computes the public key for a given secret key. + fn ed25519_derive_public(secret: &Protected) -> Result<[u8; 32]>; + + /// Creates an Ed25519 signature. + fn ed25519_sign(secret: &Protected, public: &[u8; 32], digest: &[u8]) + -> Result<[u8; 64]>; + + /// Verifies an Ed25519 signature. + fn ed25519_verify(public: &[u8; 32], digest: &[u8], signature: &[u8; 64]) + -> Result<bool>; } |