From a3070a3706bf8040a4cb78c7df1a93f947590ae3 Mon Sep 17 00:00:00 2001 From: mxaddict Date: Mon, 19 Feb 2024 20:52:31 +0800 Subject: [PATCH] Added a check for MCLBN_COMPILED_TIME_VAR value in mcl_init.h --- src/blsct/arith/mcl/mcl_init.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/blsct/arith/mcl/mcl_init.h b/src/blsct/arith/mcl/mcl_init.h index 76132cba7b50b6..f1f27b98a8c1a2 100644 --- a/src/blsct/arith/mcl/mcl_init.h +++ b/src/blsct/arith/mcl/mcl_init.h @@ -35,7 +35,13 @@ class MclInit static bool is_initialized = false; if (is_initialized) return; - if (blsInit(MCL_BLS12_381, MCLBN_COMPILED_TIME_VAR) != 0) { +#ifndef MCLBN_COMPILED_TIME_VAR + int compiledTimeVar = 0; +#else + int compiledTimeVar = MCLBN_COMPILED_TIME_VAR; +#endif + + if (blsInit(MCL_BLS12_381, compiledTimeVar) != 0) { throw std::runtime_error("blsInit failed"); } mclBn_setETHserialization(1);