diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2026-10-04 16:05:09 -0500 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2026-10-21 14:04:34 -0500 |
| commit | 7e46e85e8fb3cff68f05bc160c7ac3ed77b1414b (patch) | |
| tree | f301d674548530ec1dcbc51b140c38bcc90ba6df /Source/Core/DiscIO | |
| parent | 304086d3179d5c9f3bc94c4487e943ec449280ab (diff) | |
DiscIO/VolumeVerifier: Use Common::MD5Context instead of mbedtls.
Diffstat (limited to 'Source/Core/DiscIO')
| -rw-r--r-- | Source/Core/DiscIO/VolumeVerifier.cpp | 8 | ||||
| -rw-r--r-- | Source/Core/DiscIO/VolumeVerifier.h | 5 |
2 files changed, 5 insertions, 8 deletions
diff --git a/Source/Core/DiscIO/VolumeVerifier.cpp b/Source/Core/DiscIO/VolumeVerifier.cpp index 3031f14a0f..a8122f6711 100644 --- a/Source/Core/DiscIO/VolumeVerifier.cpp +++ b/Source/Core/DiscIO/VolumeVerifier.cpp @@ -10,7 +10,6 @@ #include <string> #include <string_view> -#include <mbedtls/md5.h> #include <mz.h> #include <mz_strm.h> #include <mz_zip.h> @@ -1087,8 +1086,7 @@ void VolumeVerifier::SetUpHashing() if (m_hashes_to_calculate.md5) { - mbedtls_md5_init(&m_md5_context); - mbedtls_md5_starts_ret(&m_md5_context); + m_md5_context.emplace(); } if (m_hashes_to_calculate.sha1) @@ -1231,7 +1229,7 @@ void VolumeVerifier::Process() if (m_hashes_to_calculate.md5) { m_md5_future = std::async(std::launch::async, [this, byte_increment] { - mbedtls_md5_update_ret(&m_md5_context, m_data.data(), byte_increment); + m_md5_context->Update(std::span{m_data}.first(byte_increment)); }); } @@ -1324,7 +1322,7 @@ void VolumeVerifier::Finish() if (m_hashes_to_calculate.md5) { m_result.hashes.md5 = std::vector<u8>(16); - mbedtls_md5_finish_ret(&m_md5_context, m_result.hashes.md5.data()); + m_md5_context->Finish(m_result.hashes.md5.data()); } if (m_hashes_to_calculate.sha1) diff --git a/Source/Core/DiscIO/VolumeVerifier.h b/Source/Core/DiscIO/VolumeVerifier.h index d057fc83d3..141954741d 100644 --- a/Source/Core/DiscIO/VolumeVerifier.h +++ b/Source/Core/DiscIO/VolumeVerifier.h @@ -10,10 +10,9 @@ #include <string> #include <vector> -#include <mbedtls/md5.h> - #include "Common/CommonTypes.h" #include "Common/Crypto/SHA1.h" +#include "Common/Hash.h" #include "Core/IOS/ES/Formats.h" #include "DiscIO/DiscScrubber.h" #include "DiscIO/Volume.h" @@ -175,7 +174,7 @@ private: Hashes<bool> m_hashes_to_calculate{}; bool m_calculating_any_hash = false; u32 m_crc32_context = 0; - mbedtls_md5_context m_md5_context{}; + std::optional<Common::MD5Context> m_md5_context; std::unique_ptr<Common::SHA1::Context> m_sha1_context; u64 m_excess_bytes = 0; |
