summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/fssystem/fssystem_integrity_romfs_storage.cpp
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-08-11 03:34:43 +0200
committerLiam <byteslice@airmail.cc>2023-08-15 23:47:25 +0200
commit86f6b6b7b2d930e8203114332b04a5c49a780b06 (patch)
treebf7ff58b0a36051d3c3489a40999d80357c570d0 /src/core/file_sys/fssystem/fssystem_integrity_romfs_storage.cpp
parentMerge pull request #11287 from liamwhite/replaced-bytes (diff)
downloadyuzu-86f6b6b7b2d930e8203114332b04a5c49a780b06.tar
yuzu-86f6b6b7b2d930e8203114332b04a5c49a780b06.tar.gz
yuzu-86f6b6b7b2d930e8203114332b04a5c49a780b06.tar.bz2
yuzu-86f6b6b7b2d930e8203114332b04a5c49a780b06.tar.lz
yuzu-86f6b6b7b2d930e8203114332b04a5c49a780b06.tar.xz
yuzu-86f6b6b7b2d930e8203114332b04a5c49a780b06.tar.zst
yuzu-86f6b6b7b2d930e8203114332b04a5c49a780b06.zip
Diffstat (limited to 'src/core/file_sys/fssystem/fssystem_integrity_romfs_storage.cpp')
-rw-r--r--src/core/file_sys/fssystem/fssystem_integrity_romfs_storage.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/core/file_sys/fssystem/fssystem_integrity_romfs_storage.cpp b/src/core/file_sys/fssystem/fssystem_integrity_romfs_storage.cpp
new file mode 100644
index 000000000..2c3da230c
--- /dev/null
+++ b/src/core/file_sys/fssystem/fssystem_integrity_romfs_storage.cpp
@@ -0,0 +1,30 @@
+// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "core/file_sys/fssystem/fssystem_integrity_romfs_storage.h"
+
+namespace FileSys {
+
+Result IntegrityRomFsStorage::Initialize(
+ HierarchicalIntegrityVerificationInformation level_hash_info, Hash master_hash,
+ HierarchicalIntegrityVerificationStorage::HierarchicalStorageInformation storage_info,
+ int max_data_cache_entries, int max_hash_cache_entries, s8 buffer_level) {
+ // Set master hash.
+ m_master_hash = master_hash;
+ m_master_hash_storage = std::make_shared<ArrayVfsFile<sizeof(Hash)>>(m_master_hash.value);
+ R_UNLESS(m_master_hash_storage != nullptr,
+ ResultAllocationMemoryFailedInIntegrityRomFsStorageA);
+
+ // Set the master hash storage.
+ storage_info[0] = m_master_hash_storage;
+
+ // Initialize our integrity storage.
+ R_RETURN(m_integrity_storage.Initialize(level_hash_info, storage_info, max_data_cache_entries,
+ max_hash_cache_entries, buffer_level));
+}
+
+void IntegrityRomFsStorage::Finalize() {
+ m_integrity_storage.Finalize();
+}
+
+} // namespace FileSys