From 5f85d05f21ab50c7abba870873e93f0379cd69af Mon Sep 17 00:00:00 2001 From: Matt Hess Date: Wed, 24 Dec 2025 15:18:46 +0000 Subject: [PATCH] call_once fix, removed rx: OFF configs --- .github/workflows/c-cpp.yml | 4 +--- src/carrot_crypto.cpp | 12 +++++------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 5255e8f..36328f4 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -516,11 +516,9 @@ jobs: strategy: matrix: config: + # Salvium requires RandomX (rx: ON) for carrot_crypto blake2 dependency - {vs: Visual Studio 17 2022, os: 2022, vspath: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise", rx: "ON", upnp: "ON", grpc: "ON", tls: "ON"} - {vs: Visual Studio 17 2022, os: 2022, vspath: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise", rx: "ON", upnp: "ON", grpc: "OFF", tls: "ON"} - - {vs: Visual Studio 17 2022, os: 2022, vspath: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise", rx: "OFF", upnp: "ON", grpc: "OFF", tls: "ON"} - - {vs: Visual Studio 17 2022, os: 2022, vspath: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise", rx: "OFF", upnp: "OFF", grpc: "OFF", tls: "ON"} - - {vs: Visual Studio 17 2022, os: 2022, vspath: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise", rx: "OFF", upnp: "OFF", grpc: "OFF", tls: "OFF"} steps: - name: Checkout repository diff --git a/src/carrot_crypto.cpp b/src/carrot_crypto.cpp index 06bc662..6b600dd 100644 --- a/src/carrot_crypto.cpp +++ b/src/carrot_crypto.cpp @@ -9,7 +9,6 @@ extern "C" { } #include -#include #include "log.h" LOG_CATEGORY(CarrotCrypto) @@ -59,15 +58,14 @@ static const uint8_t identity_point[32] = { // Get mx25519 implementation (cached) static const mx25519_impl* get_mx25519_impl() { - static std::once_flag of; - static const mx25519_impl *impl; - std::call_once(of, [&](){ - impl = mx25519_select_impl(MX25519_TYPE_AUTO); - if (!impl) { + static const mx25519_impl *impl = [](){ + auto i = mx25519_select_impl(MX25519_TYPE_AUTO); + if (!i) { LOGERR(0, "Failed to select mx25519 implementation - unsupported platform"); PANIC_STOP(); } - }); + return i; + }(); return impl; }