feat(libScePosixForWebKit): implement arc4random_buf #1637
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1637"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-08T15:24:15Z.
What
Implements
arc4random_buf(n1KOc0lTUEs) in libScePosixForWebKit. Part of #1578: PPSA99039 (EVO-PLAYER-PS5) imports it.It fills the buffer from a thread-local
std::random_device, assceRandomGetRandomNumberin libSceRandom already does (getrandom//dev/urandomwith libstdc++ on Linux,rand_swith MinGW), and writes exactlynbytes. Like FreeBSDarc4random_buf, it has no failure result.Tested
Linux (Ubuntu 24.04, GCC 13, Release): new
guest_posix_randomand existingguest_resolverpass with--repeat until-fail:3. The test checks that a zero size writes nothing, that sizes 1, 3, 5 and 4098 leave the following bytes untouched, that two 4099-byte buffers differ, and that no byte value occurs 64 or more times in one of them. It fails when the last partial word is written whole.check_test_registration.pyandcheck_conventions.pypass. Windows: both files compile with MinGW-w64 GCC 13 (-Wall -Wextra -fsyntax-only); not run on Windows. No title run.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-10-08T15:32:34Z.
Review: APPROVED
LGTM. Clean implementation of arc4random_buf using thread-local std::random_device, consistent with the existing sceRandomGetRandomNumber approach in libSceRandom. The 4-byte-at-a-time write pattern is efficient, and the test coverage is thorough - checking zero size, various sizes, buffer boundaries, and randomness quality (no byte value occurring too frequently). Good addition to support EVO-PLAYER-PS5's import requirements.
Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-08T17:37:10Z.
Fork CI while the upstream run waits for approval: Build run, all jobs green on 6b16cd65 (Linux 467/467, Windows 458/458, relinker on Linux, macOS and Windows). It builds the branch head, not the merge with
main.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T09:29:35Z.
Closing: EVO-PLAYER (PPSA99039) stops at other imports on main before
arc4random_buf, and the Linux run in #1578 needed about 17 other open PRs before the title loaded. Reopen when it's a title's next stop on main, with the log line.Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-10T16:53:06Z.
This is now a title's next stop on
main, so it is open again as #2865 (GitHub would not reopen this one). ProsperoTV (PPSA99003) onmain57f96fd2: Linuxapp.elf: symbol lookup error: app.elf: undefined symbol: n1KOc0lTUEs, WindowsFAIL: unresolved ELF import n1KOc0lTUEs (arc4random_buf) from libScePosixForWebKit.prx; with the branch it goes on to_umtx_op(#1482). Details and tests are in #2865.Pull request closed