ed25519-0.0.2.0: ed25519 cryptographic signatures

Portability | portable
Stability | experimental
Maintainer | aseipp@pobox.com
Safe Haskell | None

Crypto.Sign.Ed25519

Contents

- Keypair creation
- Signing and verifying messages
- Detached signatures

Description

This module provides bindings to the ed25519 public-key signature system, including detached signatures. The underlying implementation uses the `ref10` implementation of ed25519 from SUPERCOP, and should be relatively fast.

For more information (including how to get a copy of the software) visit http://ed25519.cr.yp.to.

Synopsis

- newtype PublicKey = PublicKey {
  - unPublicKey :: ByteString
  }
- newtype SecretKey = SecretKey {
  - unSecretKey :: ByteString
  }
- createKeypair :: IO (PublicKey, SecretKey)
- sign :: SecretKey -> ByteString -> ByteString
- verify :: PublicKey -> ByteString -> Bool
- newtype Signature = Signature {
  - unSignature :: ByteString
  }
- sign' :: SecretKey -> ByteString -> Signature
- verify' :: PublicKey -> ByteString -> Signature -> Bool

# Keypair creation

newtype PublicKey Source

A `PublicKey` created by `createKeypair`.

Constructors

PublicKey |

Fields

unPublicKey :: ByteString

Instances

Eq PublicKey |
Ord PublicKey |
Show PublicKey |

newtype SecretKey Source

A `SecretKey` created by `createKeypair`. Be sure to keep this safe!

Constructors

SecretKey |

Fields

unSecretKey :: ByteString

Instances

Eq SecretKey |
Ord SecretKey |
Show SecretKey |

createKeypair :: IO (PublicKey, SecretKey)Source

Randomly generate a public and private key for doing authenticated signing and verification.

# Signing and verifying messages

sign Source

Arguments

:: SecretKey | Signers secret key
-> ByteString | Input message
-> ByteString | Resulting signed message

Sign a message with a particular `SecretKey`.

verify Source

Arguments

:: PublicKey | Signers public key
-> ByteString | Signed message
-> Bool | Verification check

Verifies a signed message against a `PublicKey`.

# Detached signatures

newtype Signature Source

A `Signature` which is detached from the message it signed.

Constructors

Signature |

Fields

unSignature :: ByteString

Instances

Eq Signature |
Ord Signature |
Show Signature |

sign'Source

Arguments

:: SecretKey | Signers secret key
-> ByteString | Input message
-> Signature | Message signature, without the message

Sign a message with a particular `SecretKey`, only returning the signature without the message.

verify'Source

Arguments

:: PublicKey | Signers public key
-> ByteString | Input message, without signature
-> Signature | Message signature
-> Bool |

Verify a message with a detached `Signature`, for a given `PublicKey`.