Archived
1
0
This commit is contained in:
Jeff Becker
2017-05-03 11:37:09 -04:00
parent 279faa56b7
commit 89c2398a96
7 changed files with 67 additions and 20 deletions

View File

@@ -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()
{
}
}

View File

@@ -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();
};
}