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

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

@elichai

Description

@elichai

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions