EthWallet.Utils.Crypto (eth_wallet v0.0.11)

Crypto Lib

Link to this section Summary

Link to this section Functions

Link to this function

decrypt_key(encrypted_key, password)

Specs

decrypt_key(binary(), binary()) :: binary()
Link to this function

double_sha256(data)

Specs

double_sha256(binary()) :: binary()
Link to this function

encrypt_key(unencrypted_key, password)

Specs

encrypt_key(binary(), binary()) :: binary()
Link to this function

generate_key_secp256k1()

Link to this function

generate_key_secp256k1(privkey)

Link to this function

pad(data, block_size)

Link to this function

pubkey_to_address(public_key)

Link to this function

ripemd160(data)

Link to this function

sign_hash(hash, privkey, chain_id \\ nil)

Specs

sign_hash(<<_::256>>, <<_::256>>, nil | integer()) ::
  {non_neg_integer(), non_neg_integer(), non_neg_integer()}

The test is here:

https://github.com/exthereum/exth_crypto/blob/master/lib/signature/signature.ex

Attention: hash should be 32 bytes.

Link to this function

sign_msg(msg, privkey)

Link to this function

verify_hash(hash, sig, pubkey)

Specs

verify_hash(<<_::256>>, <<_::512>>, binary()) :: boolean()

The test is here:

https://github.com/exthereum/exth_crypto/blob/master/lib/signature/signature.ex

Attention: hash should be 32 bytes.

Link to this function

verify_msg_sig(msg, sig, pubkey)