feat(libSceLibreSsl3): implement DES_set_key_unchecked #15623

Merged
alvaroelpob merged 3 commits from upstream-pr/15623 into main 2026-11-10 08:44:24 +00:00
alvaroelpob commented 2026-11-03 22:14:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alvaroelpob on 2026-11-03T22:14:06Z.


What

Implements DES_set_key_unchecked in libSceLibreSsl3. LibreSSL 4.0.0 DES_set_key is DES_set_key_unchecked while DES_check_key is 0, its default, so it fills the schedule through the forwarded libSceLibreSsl DES_set_key, in the format the forwarded DES_ecb_encrypt reads.

Tested

Linux x86-64 (WSL2), Release: the full build passes and ctest --test-dir build -j16 passes 3829 of 3829 tests, including the new guest_libressl3_des_key. python3 tools/check_conventions.py --base upstream/main passes. Not run on a console or in a title.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #12945, #14366, #14889, #14890, #14992, #15031, #15045, #15119, #15289, #15303, #15472, #15514, #15544, #15591, #15599, #15616, #15618, #15620, #15622
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5145318524 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15623). Originally posted by [alvaroelpob](https://github.com/alvaroelpob) on 2026-11-03T22:14:06Z. --- ### What Implements `DES_set_key_unchecked` in libSceLibreSsl3. LibreSSL 4.0.0 [`DES_set_key`](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/des/des_key.c#L311-L345) is `DES_set_key_unchecked` while `DES_check_key` is 0, its default, so it fills the schedule through the forwarded libSceLibreSsl `DES_set_key`, in the format the forwarded `DES_ecb_encrypt` reads. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Linux x86-64 (WSL2), Release: the full build passes and `ctest --test-dir build -j16` passes 3829 of 3829 tests, including the new `guest_libressl3_des_key`. `python3 tools/check_conventions.py --base upstream/main` passes. Not run on a console or in a title. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #12945, #14366, #14889, #14890, #14992, #15031, #15045, #15119, #15289, #15303, #15472, #15514, #15544, #15591, #15599, #15616, #15618, #15620, #15622 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
BunnyFl commented 2026-11-04 02:31:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-04T02:31:40Z.

Review: APPROVED


@alvaroelpob thanks. In LibreSSL 4.0.0 (des/set_key.c at ce488b78e0, line 65) and in the 2.5.4 copy the forwarded export comes from (2e2c612066, line 69), DES_check_key defaults to 0, and DES_set_key then calls DES_set_key_unchecked. So forwarding to libSceLibreSsl's DES_set_key gives the unchecked schedule in the format the forwarded DES_ecb_encrypt reads.

What I ran: head 61017fb78d merged onto main 1c8c0efc8c, Windows 11, WinLibs GCC, Release:

  • guest_libressl3_des_key and public_headers pass (2 of 2);
  • mutation, the forwarded call removed: guest_libressl3_des_key fails;
  • tools/check_conventions.py --base upstream/main on the head: all checks passed;
  • tools/pr_overlap.py --branch: no shared exports. None of the 10 PRs it couldn't compare adds DES_set_key_unchecked.

As on #15618, your open LibreSsl3 PRs conflict with one another on the export count line and adjacent lines.

Approving.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5762392033 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15623#pullrequestreview-5762392033). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-11-04T02:31:40Z. **Review:** APPROVED --- @alvaroelpob thanks. In LibreSSL 4.0.0 (`des/set_key.c` at `ce488b78e0`, line 65) and in the 2.5.4 copy the forwarded export comes from (`2e2c612066`, line 69), `DES_check_key` defaults to 0, and `DES_set_key` then calls `DES_set_key_unchecked`. So forwarding to libSceLibreSsl's `DES_set_key` gives the unchecked schedule in the format the forwarded `DES_ecb_encrypt` reads. **What I ran:** head `61017fb78d` merged onto `main` `1c8c0efc8c`, Windows 11, WinLibs GCC, Release: - `guest_libressl3_des_key` and `public_headers` pass (2 of 2); - mutation, the forwarded call removed: `guest_libressl3_des_key` fails; - `tools/check_conventions.py --base upstream/main` on the head: all checks passed; - `tools/pr_overlap.py --branch`: no shared exports. None of the 10 PRs it couldn't compare adds `DES_set_key_unchecked`. As on #15618, your open LibreSsl3 PRs conflict with one another on the export count line and adjacent lines. Approving.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!15623
No description provided.