License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | experimental |
Portability | unknown |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Crypto.PubKey.Ed25519
Description
Ed25519 support
Synopsis
- data SecretKey
- data PublicKey
- data Signature
- publicKeySize :: Int
- secretKeySize :: Int
- signatureSize :: Int
- signature :: ByteArrayAccess ba => ba -> CryptoFailable Signature
- publicKey :: ByteArrayAccess ba => ba -> CryptoFailable PublicKey
- secretKey :: ByteArrayAccess ba => ba -> CryptoFailable SecretKey
- toPublic :: SecretKey -> PublicKey
- sign :: ByteArrayAccess ba => SecretKey -> PublicKey -> ba -> Signature
- unsafeSign :: ByteArrayAccess ba => SecretKey -> PublicKey -> ba -> Signature
- verify :: ByteArrayAccess ba => PublicKey -> ba -> Signature -> Bool
- generateSecretKey :: MonadRandom m => m SecretKey
Documentation
An Ed25519 Secret key
An Ed25519 public key
An Ed25519 signature
Size constants
publicKeySize :: Int Source #
A public key is 32 bytes
secretKeySize :: Int Source #
A secret key is 32 bytes
signatureSize :: Int Source #
A signature is 64 bytes
Smart constructors
signature :: ByteArrayAccess ba => ba -> CryptoFailable Signature Source #
Try to build a signature from a bytearray
publicKey :: ByteArrayAccess ba => ba -> CryptoFailable PublicKey Source #
Try to build a public key from a bytearray
secretKey :: ByteArrayAccess ba => ba -> CryptoFailable SecretKey Source #
Try to build a secret key from a bytearray
Methods
sign :: ByteArrayAccess ba => SecretKey -> PublicKey -> ba -> Signature Source #
Sign a message using the key pair. The public key parameter is ignored and its public key is generated from the secret key parameter to prevent Double Public Key Signing Function Oracle Attack.
unsafeSign :: ByteArrayAccess ba => SecretKey -> PublicKey -> ba -> Signature Source #
Sign a message using the key pair. This is old sign
, which is
vulnerable to private key compromise if the given public key does
not correspond to the secret key. This function is provided for
performance critical applications. To use it safely, applications
must verify or derive the public key.
generateSecretKey :: MonadRandom m => m SecretKey Source #
Generate a secret key