call_once fix, removed rx: OFF configs

This commit is contained in:
Matt Hess
2025-12-24 15:18:46 +00:00
parent e15484c14c
commit 5f85d05f21
2 changed files with 6 additions and 10 deletions

View File

@@ -9,7 +9,6 @@ extern "C" {
}
#include <cstring>
#include <mutex>
#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;
}