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.
2016-10-15 12:37:59 -04:00
|
|
|
#ifndef NNTPCHAN_CRYPTO_HPP
|
|
|
|
|
#define NNTPCHAN_CRYPTO_HPP
|
|
|
|
|
|
|
|
|
|
#include <array>
|
2017-10-17 10:29:56 -04:00
|
|
|
#include <sodium/crypto_hash.h>
|
2017-10-24 08:51:21 -04:00
|
|
|
#include <sodium/crypto_generichash.h>
|
2016-10-15 12:37:59 -04:00
|
|
|
|
|
|
|
|
namespace nntpchan
|
|
|
|
|
{
|
2017-10-17 10:29:56 -04:00
|
|
|
typedef std::array<uint8_t, crypto_hash_BYTES> SHA512Digest;
|
2017-05-03 11:37:09 -04:00
|
|
|
|
2017-10-17 10:29:56 -04:00
|
|
|
void SHA512(const uint8_t *d, std::size_t l, SHA512Digest &h);
|
2017-05-03 11:37:09 -04:00
|
|
|
|
2017-10-24 08:51:21 -04:00
|
|
|
typedef std::array<uint8_t, crypto_generichash_BYTES> Blake2BDigest;
|
|
|
|
|
void Blake2B(const uint8_t *d, std::size_t l, Blake2BDigest & h);
|
|
|
|
|
|
|
|
|
|
std::string Blake2B_base32(const std::string & str);
|
|
|
|
|
|
|
|
|
|
|
2017-10-17 10:29:56 -04:00
|
|
|
/** global crypto initializer */
|
|
|
|
|
struct Crypto
|
|
|
|
|
{
|
|
|
|
|
Crypto();
|
|
|
|
|
~Crypto();
|
|
|
|
|
};
|
2016-10-15 12:37:59 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|