haskoin-core-0.8.4: Bitcoin & Bitcoin Cash library for Haskell

CopyrightNo rights reserved
LicenseUNLICENSE
Maintainerxenog@protonmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Network.Haskoin.Crypto

Contents

Description

Hashing functions and ECDSA signatures.

Synopsis

Hashes

Hashes

data Hash512 Source #

Type for 512-bit hashes.

data Hash256 Source #

Type for 256-bit hashes.

data Hash160 Source #

Type for 160-bit hashes.

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.

split512 :: Hash512 -> (Hash256, Hash256) Source #

Split a Hash512 into a pair of Hash256.

join512 :: (Hash256, Hash256) -> Hash512 Source #

Join a pair of Hash256 into a Hash512.

Signatures

putSig :: Putter Sig Source #

Serialize an ECDSA signature for Bitcoin use.

getSig :: Get Sig Source #

Deserialize an ECDSA signature as commonly encoded in Bitcoin.

signHash :: SecKey -> Hash256 -> Sig Source #

Sign a 256-bit hash using secp256k1 elliptic curve.

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)