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
Labels
enhancement
New feature or request
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/include/secp256k1_multiset.h
Line 124 in b8c5c3f
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
The text was updated successfully, but these errors were encountered: