Copyright | Alexander Krupenkin 2018 |
---|---|
License | BSD3 |
Maintainer | mail@akru.me |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
EC cryptography on Secp256k1 curve.
Synopsis
- importKey :: ByteArrayAccess privateKey => privateKey -> PrivateKey
- exportKey :: ByteArray privateKey => PrivateKey -> privateKey
- derivePubKey :: PrivateKey -> PublicKey
- exportPubKey :: ByteArray publicKey => PublicKey -> publicKey
- sha3 :: (ByteArrayAccess bin, ByteArray bout) => bin -> bout
Documentation
importKey :: ByteArrayAccess privateKey => privateKey -> PrivateKey Source #
Import Ethereum private key from byte array.
Input array should have 32 byte length.
exportKey :: ByteArray privateKey => PrivateKey -> privateKey Source #
Export private key to byte array (32 byte length).
derivePubKey :: PrivateKey -> PublicKey Source #
Get public key appropriate to private key.
WARNING: Vulnerable to timing attacks.
exportPubKey :: ByteArray publicKey => PublicKey -> publicKey Source #
Export public key to byte array (64 byte length).
sha3 :: (ByteArrayAccess bin, ByteArray bout) => bin -> bout Source #
Keccak 256 hash function.