Skip to content

Commit 8d2506e

Browse files
committed
Hash noncedata into nonce in nonce_function_bipschnorr
1 parent ed20dbd commit 8d2506e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/secp256k1.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,6 @@ static SECP256K1_INLINE void buffer_append(unsigned char *buf, unsigned int *off
326326
* (https://github.com/sipa/bips/blob/bip-schnorr/bip-schnorr.mediawiki) */
327327
static int secp256k1_nonce_function_bipschnorr(unsigned char *nonce32, const unsigned char *msg32, const unsigned char *key32, const unsigned char *algo16, void *data, unsigned int counter) {
328328
secp256k1_sha256 sha;
329-
(void) data;
330329
(void) counter;
331330
VERIFY_CHECK(counter == 0);
332331

@@ -339,6 +338,9 @@ static int secp256k1_nonce_function_bipschnorr(unsigned char *nonce32, const uns
339338
if (algo16 != NULL) {
340339
secp256k1_sha256_write(&sha, algo16, 16);
341340
}
341+
if (data != NULL) {
342+
secp256k1_sha256_write(&sha, data, 32);
343+
}
342344
secp256k1_sha256_finalize(&sha, nonce32);
343345
return 1;
344346
}

0 commit comments

Comments
 (0)