cryptonite-0.10: Cryptography Primitives sink

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | unknown
Safe Haskell | None
Language | Haskell2010

Crypto.PubKey.Ed25519

Contents

- Smart constructors
- methods

Description

Ed25519 support

Synopsis

- data SecretKey
- data PublicKey
- data Signature
- 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
- verify :: ByteArrayAccess ba => PublicKey -> ba -> Signature -> Bool

# Documentation

data SecretKey Source

An Ed25519 Secret key

Instances

Eq SecretKey Source |
NFData SecretKey Source |
ByteArrayAccess SecretKey Source |

data PublicKey Source

An Ed25519 public key

Instances

Eq PublicKey Source |
Show PublicKey Source |
NFData PublicKey Source |
ByteArrayAccess PublicKey Source |

data Signature Source

An Ed25519 signature

Instances

Eq Signature Source |
Show Signature Source |
NFData Signature Source |
ByteArrayAccess Signature Source |

# 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

toPublic :: SecretKey -> PublicKey Source

Create a public key from a secret key

sign :: ByteArrayAccess ba => SecretKey -> PublicKey -> ba -> Signature Source

Sign a message using the key pair

verify :: ByteArrayAccess ba => PublicKey -> ba -> Signature -> Bool Source

Verify a message