more
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
#include "crypto.hpp"
|
||||
#include <sodium.h>
|
||||
#include <cassert>
|
||||
|
||||
namespace nntpchan
|
||||
{
|
||||
@@ -6,4 +8,13 @@ namespace nntpchan
|
||||
{
|
||||
crypto_hash(h.data(), d, l);
|
||||
}
|
||||
|
||||
Crypto::Crypto()
|
||||
{
|
||||
assert(sodium_init() == 0);
|
||||
}
|
||||
|
||||
Crypto::~Crypto()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@@ -7,8 +7,15 @@
|
||||
namespace nntpchan
|
||||
{
|
||||
typedef std::array<uint8_t, crypto_hash_BYTES> SHA512Digest;
|
||||
|
||||
|
||||
void SHA512(const uint8_t * d, std::size_t l, SHA512Digest & h);
|
||||
|
||||
/** global crypto initializer */
|
||||
struct Crypto
|
||||
{
|
||||
Crypto();
|
||||
~Crypto();
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user