Repository navigation
testing/crypto: add ECDH test to dhm - #4089
Merged
Merged
Conversation
ThePassionate
force-pushed
the
crypto-ecdh-test
branch
2 times, most recently
from
November 19, 2026 13:38
da5a60e to
2dbb0aa
Compare
xiaoxiang781216
approved these changes
Nov 19, 2026
ThePassionate
force-pushed
the
crypto-ecdh-test
branch
from
November 20, 2026 02:14
2dbb0aa to
4feb100
Compare
xiaoxiang781216
approved these changes
Nov 20, 2026
Exercise the ECDH key agreement commands (CRK_ECDH_GEN_PUBLIC / CRK_ECDH_COMPUTE_SHARED) as a standalone `ecdh` program: * Fixed vectors: private keys dA/dB and public keys QA/QB generated with pure Python affine EC arithmetic, cross-checked bidirectionally against the python cryptography package; both directions must derive the same shared secret Z. * Ephemeral key pairs generated through the kernel commands must also agree in both directions. The dhm program keeps the RFC 5114 modp DH test only; both programs are built from the existing TESTING_CRYPTO_ECDH option. Also fixes test_dh_compute_key() swallowing errors (it returned 0 unconditionally) and adds setbuf(stdout, NULL) to both programs. Signed-off-by: makejian <makejian <makejian@xiaomi.com>
ThePassionate
force-pushed
the
crypto-ecdh-test
branch
from
November 20, 2026 08:26
4feb100 to
e9d1e12
Compare
GUIDINGLI
approved these changes
Nov 20, 2026
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.
Summary
Add a standalone
ecdhtest program for the ECDH key agreement commands of apache/nuttx#22054 (CRK_ECDH_GEN_PUBLIC / CRK_ECDH_COMPUTE_SHARED):The existing
dhmprogram keeps the RFC 5114 modp DH test only (both programs build from the existingTESTING_CRYPTO_ECDHoption, which previously produced onlydhm). Also fixestest_dh_compute_key()swallowing errors (it returned 0 unconditionally) and addssetbuf(stdout, NULL).Impact
Testing
Depends on apache/nuttx#22054. On sim:sim/crypto with that kernel PR:
tools/checkpatch.sh -c -u -m -g <base>..HEAD(via the paired nuttx tree) passes.