updated build system
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit

This commit is contained in:
2025-08-26 20:08:47 -05:00
parent 8fabc142f2
commit 1d7e96f3a4
20 changed files with 521 additions and 47 deletions

View File

@@ -25,9 +25,19 @@
#include "utils/collection.hpp"
#include "utils/encrypting_reader.hpp"
#include "utils/hash.hpp"
#include "utils/path.hpp"
namespace repertory::utils::encryption {
auto kdf_config::to_header() const -> data_buffer {
kdf_config tmp{*this};
tmp.checksum = boost::endian::native_to_big(tmp.checksum);
tmp.magic = boost::endian::native_to_big(tmp.magic);
data_buffer ret(size());
std::memcpy(ret.data(), &tmp, ret.size());
return ret;
}
auto kdf_config::generate_checksum() const -> std::uint64_t {
REPERTORY_USES_FUNCTION_NAME();
@@ -35,18 +45,8 @@ auto kdf_config::generate_checksum() const -> std::uint64_t {
kdf_config tmp = *this;
tmp.checksum = 0;
auto hdr = tmp.to_header();
std::uint64_t ret{0};
if (crypto_generichash(reinterpret_cast<unsigned char *>(&ret), sizeof(ret),
hdr.data(), hdr.size(), nullptr, 0) != 0) {
throw utils::error::create_exception(function_name,
{
"failed to calculate checksum",
});
}
return ret;
auto hash = utils::hash::create_hash_blake2b_64(tmp.to_header());
return *reinterpret_cast<std::uint64_t *>(hash.data());
}
void kdf_config::generate_salt() {