paritytech / libsecp256k1

Pure Rust Implementation of secp256k1.
Apache License 2.0
172 stars 84 forks source link

Lack of documentation for SharedSecret generation. #115

Open Dominically opened 2 years ago

Dominically commented 2 years ago

I cannot figure out how to provide a type that implements Digest for creating a SharedSecret and there is no examples or documentation which show how to get a shared secret from a secret key and a public key (from a different key-pair). It would help if an example was provided as to how to generate a shared secret using ECDH with this library.

undersquire commented 1 year ago

You need to provide the hasher. For example, use the sha2 crate you should be able to provide the Sha512 as the type.