Crypto.PubKey.Ed25519

cryptonite-0.20: Cryptography Primitives sink

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | unknown
Safe Haskell | None
Language | Haskell2010

Crypto.PubKey.Ed25519

Contents

- Smart constructors
- methods

Description

Ed25519 support

Synopsis

- data SecretKey
- data PublicKey
- data Signature
- 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

# Documentation

data SecretKey #

An Ed25519 Secret key

Instances

Eq SecretKey # |
Methods (==) :: SecretKey -> SecretKey -> Bool # (/=) :: SecretKey -> SecretKey -> Bool #
NFData SecretKey # |
Methods rnf :: SecretKey -> () #
ByteArrayAccess SecretKey # |
Methods length :: SecretKey -> Int # withByteArray :: SecretKey -> (Ptr p -> IO a) -> IO a #

data PublicKey #

An Ed25519 public key

Instances

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

data Signature #

An Ed25519 signature

Instances

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

# 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