[unit test] Complete all providers unit tests #12
This commit is contained in:
@@ -174,6 +174,10 @@ public:
|
||||
calculate_encrypted_size(std::string_view source_path, bool uses_kdf)
|
||||
-> std::uint64_t;
|
||||
|
||||
[[nodiscard]] static auto calculate_encrypted_size(std::uint64_t size,
|
||||
bool uses_kdf)
|
||||
-> std::uint64_t;
|
||||
|
||||
[[nodiscard]] auto create_iostream() const -> std::shared_ptr<iostream>;
|
||||
|
||||
[[nodiscard]] static constexpr auto get_encrypted_chunk_size()
|
||||
|
@@ -430,11 +430,16 @@ auto encrypting_reader::calculate_encrypted_size(std::string_view source_path,
|
||||
source_path,
|
||||
});
|
||||
}
|
||||
auto file_size{opt_size.value()};
|
||||
|
||||
return calculate_encrypted_size(opt_size.value(), uses_kdf);
|
||||
}
|
||||
|
||||
auto encrypting_reader::calculate_encrypted_size(std::uint64_t size,
|
||||
bool uses_kdf)
|
||||
-> std::uint64_t {
|
||||
auto total_chunks = utils::divide_with_ceiling(
|
||||
file_size, static_cast<std::uint64_t>(data_chunk_size_));
|
||||
return file_size + (total_chunks * encryption_header_size) +
|
||||
size, static_cast<std::uint64_t>(data_chunk_size_));
|
||||
return size + (total_chunks * encryption_header_size) +
|
||||
(uses_kdf ? kdf_config::size() : 0U);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user