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
Some checks failed
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user