test(libSceLibreSsl3): pin the full RFC 8439 ChaCha20 ciphertext #16543
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16543"
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 MarcZX10 on 2026-11-07T02:54:34Z.
What
Implements
EVP_chacha20, which was ani-onlyNotImplementedstub in libSceLibreSsl3 (AdditionalExports.cpp, NID3tGgkjBQ82A).src/EvpChacha.cpp), next to the AES EVP ciphers, and is declared ininclude/Api.hpp.3tGgkjBQ82Ato it; the stub and its declaration are removed.evp/e_chacha.c: NID 937, block size 1, 32-byte key, 16-byte IV, flags STREAM_CIPHER | CUSTOM_IV | ALWAYS_CALL_INIT, context size ofChaCha_ctx.chacha/chacha-merged.c, including the counter carry and the reuse of a partial block's unused keystream.EVP_chacha20_poly1305is not part of this PR. The vendored LibreSSL has no EVP_CIPHER form of it (only the EVP_AEAD form), so its shape is not implemented here.Commits:
feat(libSceLibreSsl): add ChaCha20 key and IV setupfeat(libSceLibreSsl): add the ChaCha20 keystream and stream updatefeat(libSceLibreSsl): implement the EVP_chacha20 cipherfeat(libSceLibreSsl3): forward EVP_chacha20 to libSceLibreSsltest(libSceLibreSsl): pin EVP_chacha20 to RFC 8439 section 2.4.2test(libSceLibreSsl): cover the EVP_chacha20 counter carry and chunked updatesdocs(debt): drop EVP_chacha20 from the libSceLibreSsl3 unimplemented listdocs(debt): record the EVP_chacha20 descriptor and keystream as unverifiedTested
Linux 6.1.0-54-amd64 x86_64, the default compiler of the archive build. Built in the throwaway archive build (
run_tests.sh), with the HostCpu gate patched only in the archive copy.Build:
BUILD-EXIT 0Targets built:
guest_libressl_evp_cipher_ctx_testsandlibSceLibreSsl3.The test vectors:
00:00:00:4a:00:00:00:00). The expected ciphertext was recomputed with an independent ChaCha20 implementation before it was pinned.Not run against the unfixed code: the stub throws
NotImplementedbefore the first assertion, so the new tests fail onmain; this was reasoned, not executed. Not run on Windows, macOS, a console, or the title. The libSceLibreSsl3 forwarder is compiled and linked but no test calls it through the export; its only check is that the library builds. The debt entry lists the unverified parts (descriptor and keystream are not measured on a console).The build ran on the tree before the last docs-only amend (the debt link was changed to an upstream URL); no code differs.
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)