call_once fix, removed rx: OFF configs
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user