[cmake, core] refactor: update mbedtls and make YUZU_USE_CPM better (#485)
update mbedtls functors to support mbedtls3 signatures moved some vulkan stuff from externals to root, yuzu_use_cpm manages them now needs testing: - all key/derivation related things - nca verification - game loading/updates/stuff Reviewed-on: #485 Reviewed-by: MaranBr <maranbr@eden-emu.dev>
This commit is contained in:
parent
28d26b0d76
commit
d207df959a
16 changed files with 114 additions and 139 deletions
|
@ -178,7 +178,7 @@ std::array<u8, key_size> FindKeyFromHex(const std::vector<u8>& binary,
|
|||
|
||||
std::array<u8, 0x20> temp{};
|
||||
for (size_t i = 0; i < binary.size() - key_size; ++i) {
|
||||
mbedtls_sha256_ret(binary.data() + i, key_size, temp.data(), 0);
|
||||
mbedtls_sha256(binary.data() + i, key_size, temp.data(), 0);
|
||||
|
||||
if (temp != hash)
|
||||
continue;
|
||||
|
@ -206,7 +206,7 @@ static std::array<Key128, 0x20> FindEncryptedMasterKeyFromHex(const std::vector<
|
|||
AESCipher<Key128> cipher(key, Mode::ECB);
|
||||
for (size_t i = 0; i < binary.size() - 0x10; ++i) {
|
||||
cipher.Transcode(binary.data() + i, dec_temp.size(), dec_temp.data(), Op::Decrypt);
|
||||
mbedtls_sha256_ret(dec_temp.data(), dec_temp.size(), temp.data(), 0);
|
||||
mbedtls_sha256(dec_temp.data(), dec_temp.size(), temp.data(), 0);
|
||||
|
||||
for (size_t k = 0; k < out.size(); ++k) {
|
||||
if (temp == master_key_hashes[k]) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue