Repository navigation
feat(libSceLibreSsl): implement DES_set_key, DES_ecb_encrypt and DES_set_odd_parity - #9047
Conversation
|
Tested on AMD Ryzen 7 9800X3D and AMD Radeon RX 7900 XTX (Fedora Linux, Mesa 26.2.5):
|
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
…set_odd_parity The DES block cipher and the parity helper come from mbedtls, which is already a submodule; DES_set_key follows LibreSSL with DES_check_key off and stores the key in the schedule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FzhWRMauD3ouc8kSxT2NnT
0c25692 to
1a8ee4d
Compare
|
Rebased onto current main after #9025 landed. The only conflicts were the shared files: core/libs/prx/libSceLibreSsl/CMakeLists.txt now keeps Digest.cpp and the digest test from #9025 and adds the mbedcrypto link and the DES test; docs/dev/debt/libSceLibreSsl.md keeps both entries and the pending count goes from 377 to 374 (Export.cpp has 374 NotImplemented stubs). guest_libressl_des and guest_libressl_digest pass, libSceLibreSsl.prx patches its NIDs, tools/check_conventions.py --base origin/main passes and the branch merges cleanly into main. If another LibreSsl PR lands first, I’ll rebase again. |
|
@VakzOs the exact-head CI on this PR fails The arguments are not the problem: the test passes Could you make the DES test match the digest one? - target_link_libraries(guest_libressl_des_tests PRIVATE libSceLibreSsl)
+ target_link_libraries(guest_libressl_des_tests PRIVATE libSceLibreSsl libc)
+ configure_windows_unwind(guest_libressl_des_tests)The test code and the library do not need to change. Since the PR allows edits from maintainers, I can also push that change on top of |
The DES test catches std::invalid_argument thrown through the library's sysv_abi frames; like the digest test, it now links libc and calls configure_windows_unwind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FzhWRMauD3ouc8kSxT2NnT
|
@oneandonlydean Thanks, you’re right: the DES test was missing the Windows unwind setup the digest test has. Pushed 3fe7217 with exactly your change (libc link plus configure_windows_unwind(guest_libressl_des_tests)); the library and the test code are unchanged. guest_libressl_des and guest_libressl_digest pass on Linux; I can’t run Windows here, so the next CI run will confirm. |
What
Implements three libSceLibreSsl exports that were throwing
NotImplemented:DES_set_key,DES_ecb_encryptandDES_set_odd_parity.mbedtls_des_*,mbedtls_des_key_set_parity), which is already a submodule built for libSceSsl, so no cipher code is added;libSceLibreSslnow linksmbedcryptoDES_set_keyfollows LibreSSL'sdes_key.cwithDES_check_keyoff, its default (the variable is not in the PS5 export inventory): no parity or weak-key check, returns 0DES_ecb_encryptencrypts for any nonzeroenc, as LibreSSL'sDES_encrypt1doesGap, recorded in the debt entry: the 128-byte
DES_key_schedulestores the 8-byte key followed by zeros instead of LibreSSL's precomputed subkeys, and the subkeys are derived on eachDES_ecb_encryptcall. Null pointers throw where LibreSSL faults. The pending-exports count goes from 399 to 396.The new
core/libs/prx/libSceLibreSsl/CMakeLists.txtoverlaps with the one added by #9025, #9033 and #9041; whichever is merged later only needs to merge the test andmbedcryptolines.Tested
Linux (Ubuntu, GCC), full build:
guest_libressl_deschecks the classic vectors (133457799BBCDFF1 / 0123456789ABCDEF → 85E813540F0AB405, 0E329232EA6D0D73 / 8787878787878787 → 0) and the SP 800-17 vector 0101010101010101 / 8000000000000000 → 95F8A5E5DD31D900, both directions, in-place decryption, a nonzeroencother than 1, all 256 parity bytes, the unchecked weak and bad-parity keys, and null pointers. The test fails when encryption and decryption are swapped.libSceLibreSsl.prxpatches its NIDs.tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.pycannot reach the GitHub API from my environment; I checked every open PR branch by hand right before opening: only #8747 (the declarations) touches these exports.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code