decomp: refine AES table and inverse-key XOR dependencies #984

Merged
coah80 merged 1 commits from agent/bittle/aes-round-dependencies into main 2026-10-02 23:09:46 +00:00
coah80 commented 2026-10-02 23:09:19 +00:00 (Migrated from github.com)

Five arithmetic-expression lines reconstruct the target's T-table XOR association and inverse-key XOR/rotation dependencies. Unsigned operands and tables are unchanged; no new functional path or correctness bug is claimed.

  • Encrypt: 62.58228%, up from 60.348103%; 158/158 instructions.
  • Decrypt: 67.64143%, up from 63.836655%; 251/251 instructions.
  • Unit decompiled/fuzzy: 77.700584% → 79.601746%; exact 7/9, code 1116/2752 and data 2800/2800 preserved. All seven exact APIs remain ctxdiff zero.
  • Parent reran 2,406 AES-128/192/256 known-answer and randomized CBC checks, including in-place/incremental operation. Endian-adjusted host test, not Wii execution.
  • Only same-sized AES text changes (2752 bytes); all data and other native objects unchanged. Pool 4/4 identical; literal audit 9 functions/5 arguments, no candidates/errors/skips.
  • Remote tree 45ffc18ebe equals tested tree. MD5 unchanged.

Fresh independent verification on 5a222cde: full 43U all_source/progress/report/DOL passes SHA1 26116613f624061ba99c8d1a299aaa6efa85670d; every unit/function report and all 1027 allocated objects audited with no score regressions. Workflow/literal/jump-table/pool tests 8/36/27/8, worktree checks and base-relative diff checks pass. No linking flags, fabricated padding, forced registers/volatile or new assembly. Partial decompilation progress, not full exact completion. Left for review; no merge performed.

Note

Reassociate XOR operand order in AES T-table macros and inverse-key mixing

Refines expression grouping in aes.c to match the original binary. The ENCRYPT and DECRYPT macros reorder how the four T-table XOR terms combine, and AESiDecryptBlock rewrites its three inverse-key mixing stages as explicit parenthesized XOR chains. All table indices, rotations, operands, and key traversal are unchanged. Adds a reconstruction log in allhands-aes-rounds.attempts.md.

Macroscope summarized c92c309.

Five arithmetic-expression lines reconstruct the target's T-table XOR association and inverse-key XOR/rotation dependencies. Unsigned operands and tables are unchanged; no new functional path or correctness bug is claimed. - Encrypt: 62.58228%, up from 60.348103%; 158/158 instructions. - Decrypt: 67.64143%, up from 63.836655%; 251/251 instructions. - Unit decompiled/fuzzy: 77.700584% → 79.601746%; exact 7/9, code 1116/2752 and data 2800/2800 preserved. All seven exact APIs remain ctxdiff zero. - Parent reran 2,406 AES-128/192/256 known-answer and randomized CBC checks, including in-place/incremental operation. Endian-adjusted host test, not Wii execution. - Only same-sized AES text changes (2752 bytes); all data and other native objects unchanged. Pool 4/4 identical; literal audit 9 functions/5 arguments, no candidates/errors/skips. - Remote tree 45ffc18ebe76ab02d032a97e2644b256fd68f9a7 equals tested tree. MD5 unchanged. Fresh independent verification on 5a222cde: full 43U all_source/progress/report/DOL passes SHA1 26116613f624061ba99c8d1a299aaa6efa85670d; every unit/function report and all 1027 allocated objects audited with no score regressions. Workflow/literal/jump-table/pool tests 8/36/27/8, worktree checks and base-relative diff checks pass. No linking flags, fabricated padding, forced registers/volatile or new assembly. Partial decompilation progress, not full exact completion. Left for review; no merge performed. <!-- Macroscope's pull request summary starts here --> <!-- Macroscope will only edit the content between these invisible markers, and the markers themselves will not be visible in the GitHub rendered markdown. --> <!-- If you delete either of the start / end markers from your PR's description, Macroscope will append its summary at the bottom of the description. --> > [!NOTE] > ### Reassociate XOR operand order in AES T-table macros and inverse-key mixing > Refines expression grouping in [aes.c](https://github.com/coah80/wii-ipl/pull/984/files#diff-7415b165f7916eb45d6d57b772d27d3eb931d2ce912411adf8b0ad45f3a5fbe9) to match the original binary. The `ENCRYPT` and `DECRYPT` macros reorder how the four T-table XOR terms combine, and `AESiDecryptBlock` rewrites its three inverse-key mixing stages as explicit parenthesized XOR chains. All table indices, rotations, operands, and key traversal are unchanged. Adds a reconstruction log in [allhands-aes-rounds.attempts.md](https://github.com/coah80/wii-ipl/pull/984/files#diff-fd1da930581d9c72407c57186fd629016d102da2ebaf69b7545152a0270d0639). > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized c92c309.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-02 23:09:43 +00:00 (Migrated from github.com)

Reviewed and merged: rebased on main, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 regressions, 0 forbidden patterns.

Reviewed and merged: rebased on main, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 regressions, 0 forbidden patterns.
Sign in to join this conversation.