cryptonite-0.8: Cryptography Primitives sink

Safe HaskellNone
LanguageHaskell2010

Crypto.PubKey.ECC.ECDSA

Description

WARNING: Signature operations may leak the private key. Signature verification should be safe.

Synopsis

Documentation

data Signature Source

Represent a ECDSA signature namely R and S.

Constructors

Signature 

Fields

sign_r :: Integer

ECDSA r

sign_s :: Integer

ECDSA s

type PublicPoint = Point Source

ECC Public Point

type PrivateNumber = Integer Source

ECC Private Number

toPublicKey :: KeyPair -> PublicKey Source

Public key of a ECDSA Key pair.

toPrivateKey :: KeyPair -> PrivateKey Source

Private key of a ECDSA Key pair.

signWith Source

Arguments

:: (ByteArrayAccess msg, HashAlgorithm hash) 
=> Integer

k random number

-> PrivateKey

private key

-> hash

hash function

-> msg

message to sign

-> Maybe Signature 

Sign message using the private key and an explicit k number.

WARNING: Vulnerable to timing attacks.

sign :: (ByteArrayAccess msg, HashAlgorithm hash, MonadRandom m) => PrivateKey -> hash -> msg -> m Signature Source

Sign message using the private key.

WARNING: Vulnerable to timing attacks.

verify :: (ByteArrayAccess msg, HashAlgorithm hash) => hash -> PublicKey -> Signature -> msg -> Bool Source

Verify a bytestring using the public key.