cacophony-0.4.0: A library implementing the Noise protocol.

MaintainerJohn Galt <jgalt@centromere.net>
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Crypto.Noise.Curve

Contents

Description

 

Synopsis

Classes

class Curve c where Source

Typeclass for EC curves.

Associated Types

data PublicKey c :: * Source

Represents a public key.

data SecretKey c :: * Source

Represents a secret key.

Methods

curveName :: proxy c -> ScrubbedBytes Source

Returns the name of the curve. This is used when generating the handshake name.

curveLength :: proxy c -> Int Source

Returns the length of public keys for this Curve in bytes.

curveGenKey :: IO (KeyPair c) Source

Generates a KeyPair.

curveDH :: SecretKey c -> PublicKey c -> ScrubbedBytes Source

Performs ECDH.

curvePubToBytes :: PublicKey c -> ScrubbedBytes Source

Exports a PublicKey.

curveBytesToPub :: ScrubbedBytes -> PublicKey c Source

Imports a PublicKey.

curveSecToBytes :: SecretKey c -> ScrubbedBytes Source

Exports a SecretKey.

curveBytesToPair :: ScrubbedBytes -> KeyPair c Source

Imports a SecretKey.

Types

type KeyPair c = (SecretKey c, PublicKey c) Source

Represents a private/public EC keypair for a given Curve.