cryptonite-0.6: Cryptography Primitives sink

LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Crypto.PubKey.Curve25519

Contents

Description

Curve25519 support

Synopsis

Documentation

data SecretKey

A Curve25519 Secret key

data PublicKey

A Curve25519 public key

data DhSecret

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

Smart constructors

dhSecret :: ByteArrayAccess b => b -> Either String DhSecret

Create a DhSecret from a bytearray object

publicKey :: ByteArrayAccess bs => bs -> Either String PublicKey

Try to build a public key from a bytearray

secretKey :: ByteArrayAccess bs => bs -> Either String SecretKey

Try to build a secret key from a bytearray

methods

dh :: PublicKey -> SecretKey -> DhSecret

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

toPublic :: SecretKey -> PublicKey

Create a public key from a secret key