Copyright | No rights reserved |
---|---|
License | UNLICENSE |
Maintainer | xenog@protonmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Network.Haskoin.Crypto
Description
Hashing functions and ECDSA signatures.
Synopsis
- data Hash512
- data Hash256
- data Hash160
- data CheckSum32
- sha512 :: ByteArrayAccess b => b -> Hash512
- sha256 :: ByteArrayAccess b => b -> Hash256
- ripemd160 :: ByteArrayAccess b => b -> Hash160
- sha1 :: ByteArrayAccess b => b -> Hash160
- doubleSHA256 :: ByteArrayAccess b => b -> Hash256
- addressHash :: ByteArrayAccess b => b -> Hash160
- checkSum32 :: ByteArrayAccess b => b -> CheckSum32
- hmac512 :: ByteString -> ByteString -> Hash512
- hmac256 :: (ByteArrayAccess k, ByteArrayAccess m) => k -> m -> Hash256
- split512 :: Hash512 -> (Hash256, Hash256)
- join512 :: (Hash256, Hash256) -> Hash512
- putSig :: Putter Sig
- getSig :: Get Sig
- signHash :: SecKey -> Hash256 -> Sig
- verifyHashSig :: Hash256 -> Sig -> PubKey -> Bool
- isCanonicalHalfOrder :: Sig -> Bool
- decodeStrictSig :: ByteString -> Maybe Sig
- exportSig :: Sig -> ByteString
- module Crypto.Secp256k1
Hashes
Hashes
Type for 512-bit hashes.
Instances
Eq Hash512 Source # | |
Ord Hash512 Source # | |
Defined in Network.Haskoin.Crypto.Hash | |
Read Hash512 Source # | |
Show Hash512 Source # | |
IsString Hash512 Source # | |
Defined in Network.Haskoin.Crypto.Hash Methods fromString :: String -> Hash512 # | |
Hashable Hash512 Source # | |
Defined in Network.Haskoin.Crypto.Hash | |
Serialize Hash512 Source # | |
Type for 256-bit hashes.
Instances
Eq Hash256 Source # | |
Ord Hash256 Source # | |
Defined in Network.Haskoin.Crypto.Hash | |
Read Hash256 Source # | |
Show Hash256 Source # | |
IsString Hash256 Source # | |
Defined in Network.Haskoin.Crypto.Hash Methods fromString :: String -> Hash256 # | |
Hashable Hash256 Source # | |
Defined in Network.Haskoin.Crypto.Hash | |
Serialize Hash256 Source # | |
Type for 160-bit hashes.
Instances
Eq Hash160 Source # | |
Ord Hash160 Source # | |
Defined in Network.Haskoin.Crypto.Hash | |
Read Hash160 Source # | |
Show Hash160 Source # | |
IsString Hash160 Source # | |
Defined in Network.Haskoin.Crypto.Hash Methods fromString :: String -> Hash160 # | |
Hashable Hash160 Source # | |
Defined in Network.Haskoin.Crypto.Hash | |
Serialize Hash160 Source # | |
data CheckSum32 Source #
Word32
wrapped for type-safe 32-bit checksums.
Instances
Eq CheckSum32 Source # | |
Defined in Network.Haskoin.Crypto.Hash | |
Ord CheckSum32 Source # | |
Defined in Network.Haskoin.Crypto.Hash Methods compare :: CheckSum32 -> CheckSum32 -> Ordering # (<) :: CheckSum32 -> CheckSum32 -> Bool # (<=) :: CheckSum32 -> CheckSum32 -> Bool # (>) :: CheckSum32 -> CheckSum32 -> Bool # (>=) :: CheckSum32 -> CheckSum32 -> Bool # max :: CheckSum32 -> CheckSum32 -> CheckSum32 # min :: CheckSum32 -> CheckSum32 -> CheckSum32 # | |
Read CheckSum32 Source # | |
Defined in Network.Haskoin.Crypto.Hash Methods readsPrec :: Int -> ReadS CheckSum32 # readList :: ReadS [CheckSum32] # readPrec :: ReadPrec CheckSum32 # readListPrec :: ReadPrec [CheckSum32] # | |
Show CheckSum32 Source # | |
Defined in Network.Haskoin.Crypto.Hash Methods showsPrec :: Int -> CheckSum32 -> ShowS # show :: CheckSum32 -> String # showList :: [CheckSum32] -> ShowS # | |
Hashable CheckSum32 Source # | |
Defined in Network.Haskoin.Crypto.Hash | |
Serialize CheckSum32 Source # | |
Defined in Network.Haskoin.Crypto.Hash |
sha512 :: ByteArrayAccess b => b -> Hash512 Source #
Calculate SHA512 hash.
sha256 :: ByteArrayAccess b => b -> Hash256 Source #
Calculate SHA256 hash.
ripemd160 :: ByteArrayAccess b => b -> Hash160 Source #
Calculate RIPEMD160 hash.
sha1 :: ByteArrayAccess b => b -> Hash160 Source #
Claculate SHA1 hash.
doubleSHA256 :: ByteArrayAccess b => b -> Hash256 Source #
Compute two rounds of SHA-256.
addressHash :: ByteArrayAccess b => b -> Hash160 Source #
Compute SHA-256 followed by RIPMED-160.
checkSum32 :: ByteArrayAccess b => b -> CheckSum32 Source #
Computes a 32 bit checksum.
hmac512 :: ByteString -> ByteString -> Hash512 Source #
Computes HMAC over SHA-512.
hmac256 :: (ByteArrayAccess k, ByteArrayAccess m) => k -> m -> Hash256 Source #
Computes HMAC over SHA-256.
Signatures
verifyHashSig :: Hash256 -> Sig -> PubKey -> Bool Source #
Verify an ECDSA signature for a 256-bit hash.
isCanonicalHalfOrder :: Sig -> Bool Source #
Is canonical half order.
decodeStrictSig :: ByteString -> Maybe Sig Source #
Decode signature strictly.
exportSig :: Sig -> ByteString #
Encode signature as strict DER.
Secp256k1 (re-exported)
module Crypto.Secp256k1