mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-14 15:14:23 -04:00
Loader: Use HW-acceleration for SHA256
This commit is contained in:
parent
e58927a8ab
commit
dd4993dfda
5 changed files with 287 additions and 171 deletions
|
@ -36,7 +36,7 @@ Result NroUtils::LoadNro(Registration::Process *target_proc, Handle process_h, u
|
|||
unsigned int i;
|
||||
Result rc;
|
||||
u8 nro_hash[0x20];
|
||||
SHA256_CTX sha_ctx;
|
||||
struct sha256_state sha_ctx;
|
||||
/* Ensure there is an available NRO slot. */
|
||||
if (std::all_of(target_proc->nro_infos.begin(), target_proc->nro_infos.end(), std::mem_fn(&Registration::NroInfo::in_use))) {
|
||||
return 0x6E09;
|
||||
|
@ -78,7 +78,8 @@ Result NroUtils::LoadNro(Registration::Process *target_proc, Handle process_h, u
|
|||
|
||||
sha256_init(&sha_ctx);
|
||||
sha256_update(&sha_ctx, (u8 *)nro, nro->nro_size);
|
||||
sha256_final(&sha_ctx, nro_hash);
|
||||
sha256_finalize(&sha_ctx);
|
||||
sha256_finish(&sha_ctx, nro_hash);
|
||||
|
||||
if (!Registration::IsNroHashPresent(target_proc->index, nro_hash)) {
|
||||
rc = 0x6C09;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue