cacophony-0.10.1: A library implementing the Noise protocol.

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

Crypto.Noise.DH

Contents

Description

 
Synopsis

Classes

class DH d where Source #

Typeclass for Diffie-Hellman key agreement.

Associated Types

data PublicKey d :: * Source #

Represents a public key.

data SecretKey d :: * Source #

Represents a secret key.

Methods

dhName :: proxy d -> ScrubbedBytes Source #

Returns the name of the DH scheme. This is used when generating the handshake name.

dhLength :: proxy d -> Int Source #

Returns the length of public keys for this DH scheme in bytes.

dhGenKey :: IO (KeyPair d) Source #

Generates a KeyPair.

dhPerform :: SecretKey d -> PublicKey d -> ScrubbedBytes Source #

Performs DH.

dhPubToBytes :: PublicKey d -> ScrubbedBytes Source #

Exports a PublicKey.

dhBytesToPub :: ScrubbedBytes -> Maybe (PublicKey d) Source #

Imports a PublicKey.

dhSecToBytes :: SecretKey d -> ScrubbedBytes Source #

Exports a SecretKey.

dhBytesToPair :: ScrubbedBytes -> Maybe (KeyPair d) Source #

Imports a SecretKey.

dhPubEq :: PublicKey d -> PublicKey d -> Bool Source #

Tests PublicKeys for equality.

Types

type KeyPair d = (SecretKey d, PublicKey d) Source #

Represents a private/public key pair for a given DH.