Copyright | Alexander Krupenkin 2018 |
---|---|
License | BSD3 |
Maintainer | mail@akru.me |
Stability | experimental |
Portability | unportable |
Safe Haskell | None |
Language | Haskell2010 |
Ethereum ECC support module.
Synopsis
- data PrivateKey
- data PublicKey
- importKey :: ByteArrayAccess privateKey => privateKey -> PrivateKey
- derivePubKey :: PrivateKey -> PublicKey
- signMessage :: (ByteArrayAccess message, ByteArray rsv) => PrivateKey -> message -> rsv
- sha3 :: (ByteArrayAccess bin, ByteArray bout) => bin -> bout
Ethereum crypto key ops
data PrivateKey #
ECDSA Private Key.
Instances
Eq PrivateKey | |
Defined in Crypto.PubKey.ECC.ECDSA (==) :: PrivateKey -> PrivateKey -> Bool # (/=) :: PrivateKey -> PrivateKey -> Bool # | |
Data PrivateKey | |
Defined in Crypto.PubKey.ECC.ECDSA gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PrivateKey -> c PrivateKey # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PrivateKey # toConstr :: PrivateKey -> Constr # dataTypeOf :: PrivateKey -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PrivateKey) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PrivateKey) # gmapT :: (forall b. Data b => b -> b) -> PrivateKey -> PrivateKey # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PrivateKey -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PrivateKey -> r # gmapQ :: (forall d. Data d => d -> u) -> PrivateKey -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> PrivateKey -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> PrivateKey -> m PrivateKey # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PrivateKey -> m PrivateKey # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PrivateKey -> m PrivateKey # | |
Read PrivateKey | |
Defined in Crypto.PubKey.ECC.ECDSA readsPrec :: Int -> ReadS PrivateKey # readList :: ReadS [PrivateKey] # readPrec :: ReadPrec PrivateKey # readListPrec :: ReadPrec [PrivateKey] # | |
Show PrivateKey | |
Defined in Crypto.PubKey.ECC.ECDSA showsPrec :: Int -> PrivateKey -> ShowS # show :: PrivateKey -> String # showList :: [PrivateKey] -> ShowS # |
ECDSA Public Key.
Instances
Eq PublicKey | |
Data PublicKey | |
Defined in Crypto.PubKey.ECC.ECDSA gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PublicKey -> c PublicKey # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PublicKey # toConstr :: PublicKey -> Constr # dataTypeOf :: PublicKey -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PublicKey) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PublicKey) # gmapT :: (forall b. Data b => b -> b) -> PublicKey -> PublicKey # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PublicKey -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PublicKey -> r # gmapQ :: (forall d. Data d => d -> u) -> PublicKey -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> PublicKey -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> PublicKey -> m PublicKey # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PublicKey -> m PublicKey # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PublicKey -> m PublicKey # | |
Read PublicKey | |
Show PublicKey | |
importKey :: ByteArrayAccess privateKey => privateKey -> PrivateKey Source #
Import Ethereum private key from byte array.
Input array should have 32 byte length.
derivePubKey :: PrivateKey -> PublicKey Source #
Get public key appropriate to private key.
WARNING: Vulnerable to timing attacks.
Digital Signature Algorithm
signMessage :: (ByteArrayAccess message, ByteArray rsv) => PrivateKey -> message -> rsv Source #
Make Ethereum standard signature.
The message is before enveloped as follows: "x19Ethereum Signed Message:n" + message.length + message
WARNING: Vulnerable to timing attacks.
Hash function
sha3 :: (ByteArrayAccess bin, ByteArray bout) => bin -> bout Source #
Keccak 256 hash function.