Repository navigation
feat(libSceLibreSsl): implement EC_POINT_mul - #17275
Merged
oneandonlydean merged 1 commit intoNov 12, 2026
Merged
Conversation
EC_POINT_mul follows LibreSSL 2.5.4's ec_lib.c and ec_wNAF_mul on mbedtls's named curves: the generator and point terms are optional, and scalars are taken modulo the group order, which gives LibreSSL's points for negative scalars and scalars above the order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.
|
Contributor
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.
AI-assisted: yes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements
EC_POINT_mul(NIDSw6hs2iJZkU) on the EC code from #10395 and #15827, following LibreSSL 2.5.4'sEC_POINT_muland the early returns ofec_wNAF_mul:g_scalartimes the generator plusp_scalartimespoint; a term whose scalar or point is null is left out, and with neither the result is the point at infinity; it returns 1;BIGNUMand taken modulo the group order, negative ones included.ec_wNAF_mulmultiplies by the scalar itself, and every point on the 11 supported curves has the group order, so the residue gives the same point;MBEDTLS_ECP_FIXED_POINT_OPTIM), so the guest'sEC_GROUPis never written and calls sharing one group do not race.Gaps, in a new debt entry: a point off the curve throws, where LibreSSL computes with it; a point of another curve throws, as for the other
EC_POINTfunctions; no error code is queued.Export.cppgoes from 100 to 99NotImplemented_nid_no_patchstubs.It does not read or store private keys, so it is independent of #11146 (
EC_KEY_get0_private_key,EC_KEY_set_private_key).Tested
Linux (Ubuntu 24.04 container, GCC 13.3), full configure with
-DBUILD_TESTING=ON, Release: builtlibSceLibreSsl,libSceLibreSsl3, their patched.prxfiles and the 107 LibreSSL tests;ctest -R 'libressl|crypto_memcmp|public_headers'passes 172 of 172 (the 107 LibreSSL tests,public_headersand its 64 compile checks) on head492e88855e, based onmainf35f1e5eca. The newguest_libressl_ec_point_multakes 0.6 s and checks, on all 11 curves:cryptography46 for nine curves,openssl ecfor secp192k1 and secp224k1); and the RFC 6979 A.2.5 P-256 public key from its private key;ECDH_compute_keywith the scalar times the generator.The test fails when the negative-scalar handling or the two-term sum is removed, and throws when points at infinity are no longer skipped.
nm -Don the patchedlibSceLibreSsl.prxlistsSw6hs2iJZkU. With AddressSanitizer and leak detection, a driver running the sameEC_POINT_mulcases on stackBIGNUMs is clean, and so areguest_libressl_ec_keys,guest_libressl_ecandguest_libressl3_key_reference; the new test itself stops at its firstBIGNUMallocation in that sanitizer build, asguest_libressl_bnonmaindoes.tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.py --branchfinds no overlap with the open PRs it could compare; the 21 that share files and conflict withmainwere checked by hand, and none changesEC_POINT_mul(#11146 and #11466 also touchEc.cpp, and #11146 implements the private-key stubs next to this one). No title tested.Windows: JJenkx ran
guest_libressl_ec_point_mulon head492e88855emerged ontomain(Windows 11, WinLibs GCC 15.2 UCRT, Release); it passes in 3 of 3 runs (comment).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