cryptonite-0.25: Cryptography Primitives sink

LicenseBSD-style
MaintainerJohn Galt <jgalt@centromere.net>
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Crypto.PubKey.Curve448

Contents

Description

Curve448 support

Internally uses Decaf point compression to omit the cofactor and implementation by Mike Hamburg. Externally API and data types are compatible with the encoding specified in RFC 7748.

Synopsis

Documentation

data SecretKey Source #

A Curve448 Secret key

Instances
Eq SecretKey Source # 
Instance details

Defined in Crypto.PubKey.Curve448

Methods

(==) :: SecretKey -> SecretKey -> Bool

(/=) :: SecretKey -> SecretKey -> Bool

Show SecretKey Source # 
Instance details

Defined in Crypto.PubKey.Curve448

Methods

showsPrec :: Int -> SecretKey -> ShowS

show :: SecretKey -> String

showList :: [SecretKey] -> ShowS

ByteArrayAccess SecretKey Source # 
Instance details

Defined in Crypto.PubKey.Curve448

Methods

length :: SecretKey -> Int

withByteArray :: SecretKey -> (Ptr p -> IO a) -> IO a

copyByteArrayToPtr :: SecretKey -> Ptr p -> IO ()

NFData SecretKey Source # 
Instance details

Defined in Crypto.PubKey.Curve448

Methods

rnf :: SecretKey -> ()

data PublicKey Source #

A Curve448 public key

Instances
Eq PublicKey Source # 
Instance details

Defined in Crypto.PubKey.Curve448

Methods

(==) :: PublicKey -> PublicKey -> Bool

(/=) :: PublicKey -> PublicKey -> Bool

Show PublicKey Source # 
Instance details

Defined in Crypto.PubKey.Curve448

Methods

showsPrec :: Int -> PublicKey -> ShowS

show :: PublicKey -> String

showList :: [PublicKey] -> ShowS

ByteArrayAccess PublicKey Source # 
Instance details

Defined in Crypto.PubKey.Curve448

Methods

length :: PublicKey -> Int

withByteArray :: PublicKey -> (Ptr p -> IO a) -> IO a

copyByteArrayToPtr :: PublicKey -> Ptr p -> IO ()

NFData PublicKey Source # 
Instance details

Defined in Crypto.PubKey.Curve448

Methods

rnf :: PublicKey -> ()

data DhSecret Source #

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

Instances
Eq DhSecret Source # 
Instance details

Defined in Crypto.PubKey.Curve448

Methods

(==) :: DhSecret -> DhSecret -> Bool

(/=) :: DhSecret -> DhSecret -> Bool

Show DhSecret Source # 
Instance details

Defined in Crypto.PubKey.Curve448

Methods

showsPrec :: Int -> DhSecret -> ShowS

show :: DhSecret -> String

showList :: [DhSecret] -> ShowS

ByteArrayAccess DhSecret Source # 
Instance details

Defined in Crypto.PubKey.Curve448

Methods

length :: DhSecret -> Int

withByteArray :: DhSecret -> (Ptr p -> IO a) -> IO a

copyByteArrayToPtr :: DhSecret -> Ptr p -> IO ()

NFData DhSecret Source # 
Instance details

Defined in Crypto.PubKey.Curve448

Methods

rnf :: DhSecret -> ()

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.

This implementation may return an all-zero value as it does not check for the condition.

toPublic :: SecretKey -> PublicKey Source #

Create a public key from a secret key

generateSecretKey :: MonadRandom m => m SecretKey Source #

Generate a secret key.