Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Add hash pointer to the ecmh finalize function in secp256k1 #4

Open
elichai opened this issue Nov 19, 2020 · 0 comments
Open

Add hash pointer to the ecmh finalize function in secp256k1 #4

elichai opened this issue Nov 19, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@elichai
Copy link
Member

elichai commented Nov 19, 2020

The common interface in secp256k1 is to pass a function pointer to the hash function so you can easily replace the hash function if needed.
that is missing in the ECMH interface

SECP256K1_API int secp256k1_multiset_finalize(

After the C API will be implemented for ECMH finalize, it can be used like the rest of the functions (schnorr/ecdsa)

In Schnorr we now are passing NULL which makes it use an internal C impl of sha256, but if we'll need to replace it - it is possible to pass a go function https://github.com/golang/go/wiki/cgo#function-pointer-callbacks

Probably the simplest way would be to implement a dummy hash function in go-secp that will just return the coordinates and then hash them via the supplied go callback outside of C.

something like: rust-bitcoin/rust-secp256k1#201

@elichai elichai added the enhancement New feature or request label Nov 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant