#include <openssl/evp.h>
#include <openssl/pem.h>
-extern "C" {
+extern "C"
+{
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
class SodiumED25519DNSCryptoKeyEngine : public DNSCryptoKeyEngine
{
public:
- explicit SodiumED25519DNSCryptoKeyEngine(unsigned int algo) : DNSCryptoKeyEngine(algo)
+ explicit SodiumED25519DNSCryptoKeyEngine(unsigned int algo) :
+ DNSCryptoKeyEngine(algo)
{}
string getName() const override { return "Sodium ED25519"; }
void create(unsigned int bits) override;
void SodiumED25519DNSCryptoKeyEngine::create(unsigned int bits)
{
- if(bits != crypto_sign_ed25519_SEEDBYTES * 8) {
- throw runtime_error("Unsupported key length of "+std::to_string(bits)+" bits requested, SodiumED25519 class");
+ if (bits != crypto_sign_ed25519_SEEDBYTES * 8) {
+ throw runtime_error("Unsupported key length of " + std::to_string(bits) + " bits requested, SodiumED25519 class");
}
crypto_sign_ed25519_keypair(d_pubkey, d_seckey);
}
return storvector;
}
-void SodiumED25519DNSCryptoKeyEngine::fromISCMap(DNSKEYRecordContent& drc, std::map<std::string, std::string>& stormap )
+void SodiumED25519DNSCryptoKeyEngine::fromISCMap(DNSKEYRecordContent& drc, std::map<std::string, std::string>& stormap)
{
/*
Private-key-format: v1.2
return crypto_sign_ed25519_verify_detached((const unsigned char*)signature.c_str(), (const unsigned char*)msg.c_str(), msg.length(), d_pubkey) == 0;
}
-namespace {
+namespace
+{
const struct LoaderSodiumStruct
{
LoaderSodiumStruct()