Browse Source
Simpler impl for bcat
Signed-off-by: crueter <crueter@eden-emu.dev>
pull/3606/head
crueter
2 weeks ago
No known key found for this signature in database
GPG Key ID: 425ACD2D4830EBC6
1 changed files with
2 additions and
9 deletions
-
src/core/hle/service/bcat/delivery_cache_directory_service.cpp
|
|
|
@ -21,16 +21,9 @@ static BcatDigest DigestFile(const FileSys::VirtualFile& file) { |
|
|
|
BcatDigest out{}; |
|
|
|
const auto bytes = file->ReadAllBytes(); |
|
|
|
|
|
|
|
unsigned int length = 0; |
|
|
|
EVP_MD_CTX* context = EVP_MD_CTX_new(); |
|
|
|
u32 hash_len = 0; |
|
|
|
EVP_Digest(bytes.data(), bytes.size(), out.data(), &hash_len, EVP_md5(), nullptr); |
|
|
|
|
|
|
|
if (!context) return out; |
|
|
|
|
|
|
|
EVP_DigestInit_ex(context, EVP_md5(), nullptr); |
|
|
|
EVP_DigestUpdate(context, bytes.data(), bytes.size()); |
|
|
|
EVP_DigestFinal_ex(context, reinterpret_cast<unsigned char*>(out.data()), &length); |
|
|
|
|
|
|
|
EVP_MD_CTX_free(context); |
|
|
|
return out; |
|
|
|
} |
|
|
|
|
|
|
|
|