Implement secure key via KDF for transparent data encryption/decryption #60
Some checks failed
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit

This commit is contained in:
2025-08-31 12:08:04 -05:00
parent 5a4e1302f1
commit e542aa64ad
16 changed files with 808 additions and 552 deletions

View File

@@ -63,7 +63,8 @@ auto kdf_config::generate_checksum() const -> std::uint64_t {
return *reinterpret_cast<std::uint64_t *>(hash.data());
}
auto kdf_config::from_header(data_cspan data, kdf_config &cfg) -> bool {
auto kdf_config::from_header(data_cspan data, kdf_config &cfg,
bool ignore_checksum) -> bool {
if (data.size() < kdf_config::size()) {
return false;
}
@@ -77,7 +78,7 @@ auto kdf_config::from_header(data_cspan data, kdf_config &cfg) -> bool {
cfg.memlimit <= memlimit_level::level4 &&
cfg.opslimit >= opslimit_level::level1 &&
cfg.opslimit <= opslimit_level::level3 &&
cfg.checksum == cfg.generate_checksum();
(ignore_checksum || cfg.checksum == cfg.generate_checksum());
}
void kdf_config::seal() {