From db5bbbd6cf340fd8e77244ad452089fae0ff33ae Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Sun, 4 Oct 2026 16:04:21 -0500 Subject: Common: Create MD5Context class and ComputeMD5 function to minimize exposure to mbedtls throughout the project. --- Source/Core/Common/Hash.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'Source/Core/Common/Hash.h') diff --git a/Source/Core/Common/Hash.h b/Source/Core/Common/Hash.h index 6166b74bd9..531dcd94e1 100644 --- a/Source/Core/Common/Hash.h +++ b/Source/Core/Common/Hash.h @@ -4,6 +4,8 @@ #pragma once #include +#include +#include #include #include "Common/CommonTypes.h" @@ -21,4 +23,24 @@ u32 StartCRC32(); u32 UpdateCRC32(u32 crc, const u8* data, size_t len); u32 ComputeCRC32(const u8* data, size_t len); u32 ComputeCRC32(std::string_view data); + +class MD5Context +{ +public: + MD5Context(); + ~MD5Context(); + + void Update(std::span data); + + // output should point to 16 bytes. + void Finish(u8* output); + +private: + struct Impl; + std::unique_ptr m_impl; +}; + +// output should point to 16 bytes. +void ComputeMD5(std::span input, u8* output); + } // namespace Common -- cgit v1.2.3