Skip to content

Commit

Permalink
Make secp256k1_ecdh_{,xonly}_hash_function work on MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
sipa committed Jan 27, 2023
1 parent 51391e8 commit 090b20b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/modules/ecdh/main_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "../../../include/secp256k1_ecdh.h"
#include "../../ecmult_const_impl.h"

static int ecdh_hash_function_sha256(unsigned char *output, const unsigned char *x32, const unsigned char *y32, void *data) {
int secp256k1_ecdh_hash_function_sha256_internal(unsigned char *output, const unsigned char *x32, const unsigned char *y32, void *data) {
unsigned char version = (y32[31] & 0x01) | 0x02;
secp256k1_sha256 sha;
(void)data;
Expand All @@ -23,7 +23,7 @@ static int ecdh_hash_function_sha256(unsigned char *output, const unsigned char
return 1;
}

static int ecdh_xonly_hash_function_sha256(unsigned char *output, const unsigned char *x32, void *data) {
int secp256k1_ecdh_xonly_hash_function_sha256_internal(unsigned char *output, const unsigned char *x32, void *data) {
secp256k1_sha256 sha;
(void)data;

Expand All @@ -34,9 +34,9 @@ static int ecdh_xonly_hash_function_sha256(unsigned char *output, const unsigned
return 1;
}

const secp256k1_ecdh_hash_function secp256k1_ecdh_hash_function_sha256 = ecdh_hash_function_sha256;
const secp256k1_ecdh_hash_function secp256k1_ecdh_hash_function_default = ecdh_hash_function_sha256;
const secp256k1_ecdh_xonly_hash_function secp256k1_ecdh_xonly_hash_function_sha256 = ecdh_xonly_hash_function_sha256;
const secp256k1_ecdh_hash_function secp256k1_ecdh_hash_function_sha256 = &secp256k1_ecdh_hash_function_sha256_internal;
const secp256k1_ecdh_hash_function secp256k1_ecdh_hash_function_default = &secp256k1_ecdh_hash_function_sha256_internal;
const secp256k1_ecdh_xonly_hash_function secp256k1_ecdh_xonly_hash_function_sha256 = &secp256k1_ecdh_xonly_hash_function_sha256_internal;

int secp256k1_ecdh(const secp256k1_context* ctx, unsigned char *output, const secp256k1_pubkey *point, const unsigned char *scalar, secp256k1_ecdh_hash_function hashfp, void *data) {
int ret = 0;
Expand Down

0 comments on commit 090b20b

Please sign in to comment.