BSV-ex v0.4.0 BSV.Crypto.Secp256k1 View Source

Wrapper module for common secp256k1 functions.integer()

By default uses the pure Elixir Curvy library. If the optional :libsecp256k1 dependency is installed then that is used instead.

Link to this section Summary

Functions

Adds the two elliptic curve points together.

Multiplies the elliptic curve point by the given scalar.

Recovers the public jey from the given compact signature.

Signs the given message hash with the private key.

Verifies the given signature with the message hash and public key.

Link to this section Functions

Link to this function

pubkey_add(pubkey, other)

View Source
pubkey_add(binary(), binary()) :: binary()

Adds the two elliptic curve points together.

Link to this function

pubkey_mul(pubkey, other)

View Source
pubkey_mul(binary(), binary()) :: binary()

Multiplies the elliptic curve point by the given scalar.

Link to this function

recover_key(sig, message, opts \\ [])

View Source
recover_key(binary(), binary(), keyword()) :: binary()

Recovers the public jey from the given compact signature.

Link to this function

sign(msghash, privkey, opts \\ [])

View Source
sign(binary(), binary(), keyword()) :: binary()

Signs the given message hash with the private key.

Link to this function

verify(sig, msghash, pubkey, opts \\ [])

View Source
verify(binary(), binary(), binary(), keyword()) :: boolean()

Verifies the given signature with the message hash and public key.