Secp256k1. ECDH
(secp256k1 v0.7.2)
View Source
Module implementing libsecp256k1 ECDH shared secret computation.
This returns libsecp256k1's default hashed ECDH output, currently SHA256 over
the compressed shared point. For generic raw ECDH, use :crypto.compute_key/4.
Examples
iex> seckey = <<1::256>>
iex> pubkey = Secp256k1.pubkey(<<2::256>>, :compressed)
iex> shared_secret = Secp256k1.ECDH.ecdh(seckey, pubkey)
iex> byte_size(shared_secret)
32
Summary
Functions
Compute libsecp256k1's default hashed ECDH shared secret.
Functions
@spec ecdh( seckey :: Secp256k1.seckey(), pubkey :: Secp256k1.compressed_pubkey() | Secp256k1.uncompressed_pubkey() ) :: Secp256k1.shared_secret()
Compute libsecp256k1's default hashed ECDH shared secret.