feat(libSceLibreSsl3): implement BN_div #15770
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15770"
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 alvaroelpob on 2026-11-04T13:42:08Z.
What
Implements the libSceLibreSsl3 BN_div export on libSceLibreSsl's BIGNUM layout, as in LibreSSL 4.0.0: it truncates the quotient, gives the remainder the numerator's sign and makes either output optional. Writes happen in the same order when outputs alias, and division by zero, untrimmed numerators and expansion failures queue the same errors.
Tested
Full suite on e0dc7c1c8e (Linux): 3883/3883 passed, including the new guest_libressl3_bignum_divide test. It checks 14 quotient and remainder vectors computed with Python integers (single-word to 9-word numerators, every sign combination), each output alone and both null, the constant-time flag, quotient and remainder aliasing the inputs or each other, a zero numerator, division by zero, an untrimmed numerator, both allocation failures, and a static-data output. check_conventions passes.
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)