cryptonite-0.24: Cryptography Primitives sink

LicenseBSD-style
MaintainerOlivier Chéron <olivier.cheron@gmail.com>
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Crypto.PubKey.Ed448

Contents

Description

Ed448 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 8032.

Synopsis

Documentation

data SecretKey #

An Ed448 Secret key

Instances

Eq SecretKey # 
Show SecretKey # 
NFData SecretKey # 

Methods

rnf :: SecretKey -> () #

ByteArrayAccess SecretKey # 

Methods

length :: SecretKey -> Int

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

data PublicKey #

An Ed448 public key

Instances

Eq PublicKey # 
Show PublicKey # 
NFData PublicKey # 

Methods

rnf :: PublicKey -> () #

ByteArrayAccess PublicKey # 

Methods

length :: PublicKey -> Int

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

data Signature #

An Ed448 signature

Instances

Eq Signature # 
Show Signature # 
NFData Signature # 

Methods

rnf :: Signature -> () #

ByteArrayAccess Signature # 

Methods

length :: Signature -> Int

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

Size constants

publicKeySize :: Int #

A public key is 57 bytes

secretKeySize :: Int #

A secret key is 57 bytes

signatureSize :: Int #

A signature is 114 bytes

Smart constructors

signature :: ByteArrayAccess ba => ba -> CryptoFailable Signature #

Try to build a signature from a bytearray

publicKey :: ByteArrayAccess ba => ba -> CryptoFailable PublicKey #

Try to build a public key from a bytearray

secretKey :: ByteArrayAccess ba => ba -> CryptoFailable SecretKey #

Try to build a secret key from a bytearray

methods

toPublic :: SecretKey -> PublicKey #

Create a public key from a secret key

sign :: ByteArrayAccess ba => SecretKey -> PublicKey -> ba -> Signature #

Sign a message using the key pair

verify :: ByteArrayAccess ba => PublicKey -> ba -> Signature -> Bool #

Verify a message

generateSecretKey :: MonadRandom m => m SecretKey #

Generate a secret key