This repository has been archived on 2023-08-12. You can view files and clone it. You cannot open issues or pull requests or push a commit.
2017-10-11 09:48:27 -04:00
|
|
|
#include <nntpchan/crypto.hpp>
|
2017-05-03 11:37:09 -04:00
|
|
|
#include <sodium.h>
|
|
|
|
|
#include <cassert>
|
2016-10-15 12:37:59 -04:00
|
|
|
|
|
|
|
|
namespace nntpchan
|
|
|
|
|
{
|
|
|
|
|
void SHA512(const uint8_t * d, const std::size_t l, SHA512Digest & h)
|
|
|
|
|
{
|
|
|
|
|
crypto_hash(h.data(), d, l);
|
|
|
|
|
}
|
2017-05-03 11:37:09 -04:00
|
|
|
|
|
|
|
|
Crypto::Crypto()
|
|
|
|
|
{
|
|
|
|
|
assert(sodium_init() == 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Crypto::~Crypto()
|
|
|
|
|
{
|
|
|
|
|
}
|
2016-10-15 12:37:59 -04:00
|
|
|
}
|