summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/VolumeVerifier.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/DiscIO/VolumeVerifier.cpp')
-rw-r--r--Source/Core/DiscIO/VolumeVerifier.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/Core/DiscIO/VolumeVerifier.cpp b/Source/Core/DiscIO/VolumeVerifier.cpp
index 03b50e7d82..c32bda8ed4 100644
--- a/Source/Core/DiscIO/VolumeVerifier.cpp
+++ b/Source/Core/DiscIO/VolumeVerifier.cpp
@@ -13,7 +13,6 @@
#include <unordered_set>
#include <mbedtls/md5.h>
-#include <mbedtls/sha1.h>
#include <mz_compat.h>
#include <pugixml.hpp>
@@ -21,6 +20,7 @@
#include "Common/Assert.h"
#include "Common/CommonPaths.h"
#include "Common/CommonTypes.h"
+#include "Common/Crypto/SHA1.h"
#include "Common/FileUtil.h"
#include "Common/Hash.h"
#include "Common/HttpRequest.h"
@@ -1053,8 +1053,7 @@ void VolumeVerifier::SetUpHashing()
if (m_hashes_to_calculate.sha1)
{
- mbedtls_sha1_init(&m_sha1_context);
- mbedtls_sha1_starts_ret(&m_sha1_context);
+ m_sha1_context = Common::SHA1::CreateContext();
}
}
@@ -1191,7 +1190,7 @@ void VolumeVerifier::Process()
if (m_hashes_to_calculate.sha1)
{
m_sha1_future = std::async(std::launch::async, [this, byte_increment] {
- mbedtls_sha1_update_ret(&m_sha1_context, m_data.data(), byte_increment);
+ m_sha1_context->Update(m_data.data(), byte_increment);
});
}
}
@@ -1283,8 +1282,8 @@ void VolumeVerifier::Finish()
if (m_hashes_to_calculate.sha1)
{
- m_result.hashes.sha1 = std::vector<u8>(20);
- mbedtls_sha1_finish_ret(&m_sha1_context, m_result.hashes.sha1.data());
+ const auto digest = m_sha1_context->Finish();
+ m_result.hashes.sha1 = std::vector<u8>(digest.begin(), digest.end());
}
}