cryptonite-0.23: Cryptography Primitives sink

License | BSD-style
Maintainer | John Galt <jgalt@centromere.net>
Stability | experimental
Portability | unknown
Safe Haskell | None
Language | Haskell2010

Crypto.PubKey.Curve448

Contents

- Smart constructors
- methods

Description

Curve448 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
- generateSecretKey :: MonadRandom m => m SecretKey

# Documentation

data SecretKey Source #

A Curve448 Secret key

Instances

Eq SecretKey Source # |
Methods (==) :: SecretKey -> SecretKey -> Bool # (/=) :: SecretKey -> SecretKey -> Bool #
Show SecretKey Source # |
Methods showsPrec :: Int -> SecretKey -> ShowS # show :: SecretKey -> String # showList :: [SecretKey] -> ShowS #
NFData SecretKey Source # |
Methods rnf :: SecretKey -> () #
ByteArrayAccess SecretKey Source # |
Methods length :: SecretKey -> Int # withByteArray :: SecretKey -> (Ptr p -> IO a) -> IO a #

data PublicKey Source #

A Curve448 public key

Instances

Eq PublicKey Source # |
Methods (==) :: PublicKey -> PublicKey -> Bool # (/=) :: PublicKey -> PublicKey -> Bool #
Show PublicKey Source # |
Methods showsPrec :: Int -> PublicKey -> ShowS # show :: PublicKey -> String # showList :: [PublicKey] -> ShowS #
NFData PublicKey Source # |
Methods rnf :: PublicKey -> () #
ByteArrayAccess PublicKey Source # |
Methods length :: PublicKey -> Int # withByteArray :: PublicKey -> (Ptr p -> IO a) -> IO a #

data DhSecret Source #

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

Instances

Eq DhSecret Source # |
Methods (==) :: DhSecret -> DhSecret -> Bool # (/=) :: DhSecret -> DhSecret -> Bool #
Show DhSecret Source # |
Methods showsPrec :: Int -> DhSecret -> ShowS # show :: DhSecret -> String # showList :: [DhSecret] -> ShowS #
NFData DhSecret Source # |
Methods rnf :: DhSecret -> () #
ByteArrayAccess DhSecret Source # |
Methods length :: DhSecret -> Int # withByteArray :: DhSecret -> (Ptr p -> IO a) -> IO a #

# 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

generateSecretKey :: MonadRandom m => m SecretKey Source #

Generate a secret key.