xpat
This commit is contained in:
@@ -10,6 +10,13 @@ std::string B64Encode(const uint8_t *data, const std::size_t l);
|
||||
|
||||
/** @brief returns true if decode was successful */
|
||||
bool B64Decode(const std::string &data, std::vector<uint8_t> &out);
|
||||
|
||||
/** returns base32 encoded string */
|
||||
std::string B32Encode(const uint8_t *data, const std::size_t l);
|
||||
|
||||
/** @brief returns true if decode was successful */
|
||||
bool B32Decode(const std::string &data, std::vector<uint8_t> &out);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <array>
|
||||
#include <sodium/crypto_hash.h>
|
||||
#include <sodium/crypto_generichash.h>
|
||||
|
||||
namespace nntpchan
|
||||
{
|
||||
@@ -10,6 +11,12 @@ typedef std::array<uint8_t, crypto_hash_BYTES> SHA512Digest;
|
||||
|
||||
void SHA512(const uint8_t *d, std::size_t l, SHA512Digest &h);
|
||||
|
||||
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);
|
||||
|
||||
|
||||
/** global crypto initializer */
|
||||
struct Crypto
|
||||
{
|
||||
|
@@ -40,6 +40,7 @@ private:
|
||||
bool init_skiplist(const std::string &subdir) const;
|
||||
|
||||
fs::path skiplist_root(const std::string &name) const;
|
||||
fs::path skiplist_dir(const fs::path & root, const std::string & name) const;
|
||||
|
||||
fs::path basedir;
|
||||
};
|
||||
|
Reference in New Issue
Block a user