Crypto.Cipher.DSA

cryptocipher-0.2.8: Symmetrical Block, Stream and PubKey Ciphers

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

Crypto.Cipher.DSA

Description

Synopsis

- data Error
  - = InvalidSignature
  - | RandomGenFailure GenError
- type Params = (Integer, Integer, Integer)
- type Signature = (Integer, Integer)
- data PublicKey = PublicKey {
  - public_params :: Params
  - public_y :: Integer
  }
- data PrivateKey = PrivateKey {
  - private_params :: Params
  - private_x :: Integer
  }
- sign :: CryptoRandomGen g => g -> (ByteString -> ByteString) -> PrivateKey -> ByteString -> Either GenError (Signature, g)
- verify :: Signature -> (ByteString -> ByteString) -> PublicKey -> ByteString -> Either Error Bool

# Documentation

data Error

Constructors

InvalidSignature | signature is not valid r or s is not between the bound 0..q
RandomGenFailure GenError | the random generator returns an error. give the opportunity to reseed for example.

Instances

Eq Error |
Show Error |

type Params = (Integer, Integer, Integer)

type Signature = (Integer, Integer)

data PublicKey

Constructors

PublicKey |
Fields public_params :: Params public_y :: Integer

Instances

Show PublicKey |

data PrivateKey

Constructors

PrivateKey |
Fields private_params :: Params private_x :: Integer

Instances

Show PrivateKey |

sign :: CryptoRandomGen g => g -> (ByteString -> ByteString) -> PrivateKey -> ByteString -> Either GenError (Signature, g)

sign message using the private key.

verify :: Signature -> (ByteString -> ByteString) -> PublicKey -> ByteString -> Either Error Bool

verify a bytestring using the public key.