From 9554362b1532d8292ab805cefb9c886cd55ac205 Mon Sep 17 00:00:00 2001 From: Nicolas Iooss Date: Wed, 8 May 2024 19:13:35 +0200 Subject: [PATCH] tests: call secp256k1_ecmult_multi_var with a non-NULL error callback Function secp256k1_ecmult_multi_var expects to be called with a non-NULL error_callback parameter. Fix the invocation in test_ecmult_accumulate to do this. While at it, wrap the call in a CHECK macro to ensure it succeeds. Fixes: https://github.com/bitcoin-core/secp256k1/issues/1527 --- src/tests.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests.c b/src/tests.c index 2eb3fbfdce..dab47608c2 100644 --- a/src/tests.c +++ b/src/tests.c @@ -5494,8 +5494,8 @@ static void test_ecmult_accumulate(secp256k1_sha256* acc, const secp256k1_scalar secp256k1_ecmult_gen(&CTX->ecmult_gen_ctx, &rj1, x); secp256k1_ecmult(&rj2, &gj, x, &secp256k1_scalar_zero); secp256k1_ecmult(&rj3, &infj, &secp256k1_scalar_zero, x); - secp256k1_ecmult_multi_var(NULL, scratch, &rj4, x, NULL, NULL, 0); - secp256k1_ecmult_multi_var(NULL, scratch, &rj5, &secp256k1_scalar_zero, test_ecmult_accumulate_cb, (void*)x, 1); + CHECK(secp256k1_ecmult_multi_var(&CTX->error_callback, scratch, &rj4, x, NULL, NULL, 0)); + CHECK(secp256k1_ecmult_multi_var(&CTX->error_callback, scratch, &rj5, &secp256k1_scalar_zero, test_ecmult_accumulate_cb, (void*)x, 1)); secp256k1_ecmult_const(&rj6, &secp256k1_ge_const_g, x); secp256k1_ge_set_gej_var(&r, &rj1); CHECK(secp256k1_gej_eq_ge_var(&rj2, &r));