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.Curve25519

Contents

- Smart constructors
- methods

Description

Curve25519 support

Synopsis

- data SecretKey
- data PublicKey
- data DhSecret
- dhSecret :: ByteArrayAccess b => b -> CryptoFailable DhSecret
- publicKey :: ByteArrayAccess bs => bs -> CryptoFailable PublicKey
- secretKey :: ByteArrayAccess bs => bs -> CryptoFailable SecretKey
- dh :: PublicKey -> SecretKey -> DhSecret
- toPublic :: SecretKey -> PublicKey

# Documentation

data SecretKey Source

A Curve25519 Secret key

Instances

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

data PublicKey Source

A Curve25519 public key

Instances

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

data DhSecret Source

A Curve25519 Diffie Hellman secret related to a public key and a secret key.

Instances

Eq DhSecret Source |
Show DhSecret Source |
NFData DhSecret Source |
ByteArrayAccess DhSecret Source |

# Smart constructors

dhSecret :: ByteArrayAccess b => b -> CryptoFailable DhSecret Source

Create a DhSecret from a bytearray object

publicKey :: ByteArrayAccess bs => bs -> CryptoFailable PublicKey Source

Try to build a public key from a bytearray

secretKey :: ByteArrayAccess bs => bs -> CryptoFailable SecretKey Source

Try to build a secret key from a bytearray

# methods

dh :: PublicKey -> SecretKey -> DhSecret Source

Compute the Diffie Hellman secret from a public key and a secret key

toPublic :: SecretKey -> PublicKey Source

Create a public key from a secret key