From e1748a0727d3493b1dba0441a020c7c0de0c5b33 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Sun, 8 Dec 2019 01:20:05 +0200 Subject: [PATCH] nyx: Boost eMMC backup/restore verification times This change allows SE to start verifying the first buffer while the 2nd is populated. Effectively cutting verification down to almost half. --- nyx/nyx_gui/frontend/fe_emmc_tools.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nyx/nyx_gui/frontend/fe_emmc_tools.c b/nyx/nyx_gui/frontend/fe_emmc_tools.c index 9d8f56f..8a9c2a3 100644 --- a/nyx/nyx_gui/frontend/fe_emmc_tools.c +++ b/nyx/nyx_gui/frontend/fe_emmc_tools.c @@ -228,6 +228,9 @@ static int _dump_emmc_verify(emmc_tool_gui_t *gui, sdmmc_storage_t *storage, u32 return 1; } + + se_calc_sha256(hashEm, NULL, bufEm, num << 9, 0, SHA_INIT_HASH, false); + f_lseek(&fp, (u64)sdFileSector << (u64)9); if (f_read_fast(&fp, bufSd, num << 9)) { @@ -246,7 +249,7 @@ static int _dump_emmc_verify(emmc_tool_gui_t *gui, sdmmc_storage_t *storage, u32 return 1; } - se_calc_sha256(hashEm, NULL, bufEm, num << 9, 0, SHA_INIT_HASH, true); + se_calc_sha256_finalize(hashEm, NULL); se_calc_sha256(hashSd, NULL, bufSd, num << 9, 0, SHA_INIT_HASH, true); res = memcmp(hashEm, hashSd, 0x10);