{
unsigned char *sk = nullptr;
unsigned char *pk = nullptr;
- if(keysSet.load(std::memory_order_relaxed)) {
+ if(keysSet.load()) {
sk = this->sk;
pk = this->pk;
}
}
unsigned char *sk = nullptr;
unsigned char *pk = nullptr;
- if(keysSet.load(std::memory_order_relaxed)) {
+ if(keysSet.load()) {
sk = this->sk;
pk = this->pk;
}
return 0;
}
- std::lock_guard<std::mutex> lock(c->conMapMutex);
std::memcpy(c->sk, sk, crypto_sign_SECRETKEYBYTES);
std::memcpy(c->pk, pk, crypto_sign_PUBLICKEYBYTES);
c->keysSet.store(true);
return 0;
}
- std::lock_guard<std::mutex> lock(c->conMapMutex);
c->keysSet.store(false);
std::memset(c->pk, 0, crypto_sign_PUBLICKEYBYTES);
std::memset(c->sk, 0, crypto_sign_SECRETKEYBYTES);