Crypto.PubKey.Ed448

cryptonite-0.29: Cryptography Primitives sink

License | BSD-style
Maintainer | Olivier Chéron <olivier.cheron@gmail.com>
Stability | experimental
Portability | unknown
Safe Haskell | Safe-Inferred
Language | Haskell2010

Crypto.PubKey.Ed448

Contents

- Size constants
- Smart constructors
- Methods

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

- data SecretKey
- data PublicKey
- data Signature
- publicKeySize :: Int
- secretKeySize :: Int
- signatureSize :: Int
- signature :: ByteArrayAccess ba => ba -> CryptoFailable Signature
- publicKey :: ByteArrayAccess ba => ba -> CryptoFailable PublicKey
- secretKey :: ByteArrayAccess ba => ba -> CryptoFailable SecretKey
- toPublic :: SecretKey -> PublicKey
- sign :: ByteArrayAccess ba => SecretKey -> PublicKey -> ba -> Signature
- verify :: ByteArrayAccess ba => PublicKey -> ba -> Signature -> Bool
- generateSecretKey :: MonadRandom m => m SecretKey

# Documentation

data SecretKey #

An Ed448 Secret key

#### Instances

Instances details

Show SecretKey # |
Instance details Defined in Crypto.PubKey.Ed448 Methods showsPrec :: Int -> SecretKey -> ShowS # show :: SecretKey -> String # showList :: [SecretKey] -> ShowS #
NFData SecretKey # |
Instance details Defined in Crypto.PubKey.Ed448 Methods rnf :: SecretKey -> () #
Eq SecretKey # |
Instance details Defined in Crypto.PubKey.Ed448 Methods (==) :: SecretKey -> SecretKey -> Bool # (/=) :: SecretKey -> SecretKey -> Bool #
ByteArrayAccess SecretKey # |
Instance details Defined in Crypto.PubKey.Ed448 Methods length :: SecretKey -> Int # withByteArray :: SecretKey -> (Ptr p -> IO a) -> IO a # copyByteArrayToPtr :: SecretKey -> Ptr p -> IO () #

data PublicKey #

An Ed448 public key

#### Instances

Instances details

Show PublicKey # |
Instance details Defined in Crypto.PubKey.Ed448 Methods showsPrec :: Int -> PublicKey -> ShowS # show :: PublicKey -> String # showList :: [PublicKey] -> ShowS #
NFData PublicKey # |
Instance details Defined in Crypto.PubKey.Ed448 Methods rnf :: PublicKey -> () #
Eq PublicKey # |
Instance details Defined in Crypto.PubKey.Ed448 Methods (==) :: PublicKey -> PublicKey -> Bool # (/=) :: PublicKey -> PublicKey -> Bool #
ByteArrayAccess PublicKey # |
Instance details Defined in Crypto.PubKey.Ed448 Methods length :: PublicKey -> Int # withByteArray :: PublicKey -> (Ptr p -> IO a) -> IO a # copyByteArrayToPtr :: PublicKey -> Ptr p -> IO () #

data Signature #

An Ed448 signature

#### Instances

Instances details

Show Signature # |
Instance details Defined in Crypto.PubKey.Ed448 Methods showsPrec :: Int -> Signature -> ShowS # show :: Signature -> String # showList :: [Signature] -> ShowS #
NFData Signature # |
Instance details Defined in Crypto.PubKey.Ed448 Methods rnf :: Signature -> () #
Eq Signature # |
Instance details Defined in Crypto.PubKey.Ed448 Methods (==) :: Signature -> Signature -> Bool # (/=) :: Signature -> Signature -> Bool #
ByteArrayAccess Signature # |
Instance details Defined in Crypto.PubKey.Ed448 Methods length :: Signature -> Int # withByteArray :: Signature -> (Ptr p -> IO a) -> IO a # copyByteArrayToPtr :: Signature -> Ptr p -> IO () #

# 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