diff options
author | Fernando S <fsahmkow27@gmail.com> | 2023-08-21 16:29:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-21 16:29:04 +0200 |
commit | 861597eb2e32663dba37813273ff91434566523a (patch) | |
tree | a05b7c596209f754a822c03cca162c6f32b6a565 /src/core/file_sys/fssystem/fssystem_integrity_romfs_storage.cpp | |
parent | Merge pull request #11320 from Kelebek1/mask_depthstencil_clear (diff) | |
parent | file_sys: tolerate empty NCA (diff) | |
download | yuzu-861597eb2e32663dba37813273ff91434566523a.tar yuzu-861597eb2e32663dba37813273ff91434566523a.tar.gz yuzu-861597eb2e32663dba37813273ff91434566523a.tar.bz2 yuzu-861597eb2e32663dba37813273ff91434566523a.tar.lz yuzu-861597eb2e32663dba37813273ff91434566523a.tar.xz yuzu-861597eb2e32663dba37813273ff91434566523a.tar.zst yuzu-861597eb2e32663dba37813273ff91434566523a.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.cpp | 30 |
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 |