| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cardano.Crypto.DSIGN.EcdsaSecp256k1
Synopsis
- data MessageHash
- toMessageHash :: ByteString -> Maybe MessageHash
- fromMessageHash :: MessageHash -> ByteString
- hashAndPack :: forall (h :: Type). (HashAlgorithm h, SizeHash h ~ SECP256K1_ECDSA_MESSAGE_BYTES) => Proxy h -> ByteString -> MessageHash
- data EcdsaSecp256k1DSIGN
- data family VerKeyDSIGN v :: Type
- data family SignKeyDSIGN v :: Type
- data family SigDSIGN v :: Type
Documentation
data MessageHash #
As ECDSA signatures on the SECP256k1 curve sign 32-byte hashes, rather than whole messages, we provide a helper (opaque) newtype to ensure that the size of the input for signing and verification is strictly bounded.
Important note
If you are verifying a message using the algorithm provided here, you should hash the message yourself before verifying. Specifically, the sender should give you the message itself to verify, rather than the hash of the message used to compute the signature.
Instances
| Show MessageHash # | |
Defined in Cardano.Crypto.DSIGN.EcdsaSecp256k1 | |
| Eq MessageHash # | |
Defined in Cardano.Crypto.DSIGN.EcdsaSecp256k1 Methods (==) :: MessageHash -> MessageHash -> Bool Source # (/=) :: MessageHash -> MessageHash -> Bool Source # | |
toMessageHash :: ByteString -> Maybe MessageHash #
Take a blob of bytes (which is presumed to be a 32-byte hash), verify its
length, and package it into a MessageHash if that length is exactly 32.
fromMessageHash :: MessageHash -> ByteString #
Turn a MessageHash into its bytes without a length marker.
hashAndPack :: forall (h :: Type). (HashAlgorithm h, SizeHash h ~ SECP256K1_ECDSA_MESSAGE_BYTES) => Proxy h -> ByteString -> MessageHash #
A helper to use with the HashAlgorithm API, as this can ensure sizing.
data EcdsaSecp256k1DSIGN #
Instances
data family VerKeyDSIGN v :: Type #
Instances
data family SignKeyDSIGN v :: Type #
Instances
data family SigDSIGN v :: Type #