ed25519-0.0.3.0: ed25519 cryptographic signatures

Copyright(c) Austin Seipp 2013-2015
LicenseMIT
Maintaineraseipp@pobox.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Crypto.Sign.Ed25519

Contents

Description

This module provides bindings to the ed25519 public-key signature system, including detached signatures. The underlying implementation uses the ref10 implementation of ed25519 from SUPERCOP, and should be relatively fast.

For more information (including how to get a copy of the software) visit http://ed25519.cr.yp.to.

Synopsis

Keypair creation

newtype SecretKey Source

A SecretKey created by createKeypair. Be sure to keep this safe!

Constructors

SecretKey 

createKeypair :: IO (PublicKey, SecretKey) Source

Randomly generate a SecretKey and PublicKey for doing authenticated signing and verification.

createKeypairFromSeed Source

Arguments

:: ByteString

Two byte seed input

-> (PublicKey, SecretKey)

Resulting keypair

Generate a deterministic PublicKey and SecretKey from a given 32-byte seed. Note that this will fail if the given input is not 32 bytes in length.

toPublicKey Source

Arguments

:: SecretKey

Any valid SecretKey

-> PublicKey

Corresponding PublicKey

Calculate the PublicKey for a given SecretKey.

Signing and verifying messages

sign Source

Arguments

:: SecretKey

Signers SecretKey

-> ByteString

Input message

-> ByteString

Resulting signed message

Sign a message with a particular SecretKey. Note that the resulting signed message contains both the message itself, and the signature attached. If you only want the signature of a given input string, please see sign'.

verify Source

Arguments

:: PublicKey

Signers PublicKey

-> ByteString

Signed message

-> Bool

Verification result

Verifies a signed message against a PublicKey. Note that the input message must be generated by sign (that is, it is the message itself plus its signature). If you want to verify an arbitrary signature against an arbitrary message, please see verify'.

Detached signatures

newtype Signature Source

A Signature which is detached from the message it signed.

Constructors

Signature 

sign' Source

Arguments

:: SecretKey

Signers SecretKey

-> ByteString

Input message

-> Signature

Message Signature, without the message

Sign a message with a particular SecretKey, only returning the Signature without the message.

verify' Source

Arguments

:: PublicKey

Signers PublicKey

-> ByteString

Raw input message

-> Signature

Message Signature

-> Bool

Verification result

Verify a message with a detached Signature against a given PublicKey.