Repository navigation
feat(javascript): Add diffiehellman - #8
jrepucci-rh wants to merge 6 commits into
Conversation
| - pattern: | | ||
| $ECDH = <... $C.$MAKE(...) ...> | ||
| ... | ||
| $ECDH2 = <... $ECDH ...> |
There was a problem hiding this comment.
This matches any assignment that mentions $ECDH, not only a copy of it. That's what causes the { ec, ff } false positive from #7.
Suggestion: replace it with two patterns, $ECDH2 = $ECDH and $ECDH2 = $ECDH.$M(...). I tested it: the chained case still works, your four false positives go away, and the existing fixtures pass. Same on lines 87, 108 and 118.
Please also add the alias case and one negative to the fixture.
|
Hey @isasmendiagus could you point me to the functions/objects that invoke finite field Diffiehellman? I thought I was covering every major Diffiehellman fucntion in the crypto library. |
|
@isasmendiagus Comments addressed. Lots of new test files, as in order to catch these new aliases I need a new file per test. Let me know if anything more is needed! |
isasmendiagus
left a comment
There was a problem hiding this comment.
LGTM, thanks for the extra fixtures.
On your question: I read "diffiehellman" as the finite-field algorithm (createDiffieHellman(), getDiffieHellman(), and diffieHellman() over 'dh' keys), which your rules leave out on purpose. You meant the crypto.diffieHellman() function, which is covered. So nothing is missing, just the title could say "ECDH, X25519 and X448". Not blocking.
Description
Added Node.js Crypto rules for Diffie-Hellman key exchanges.
AI Generated by: Claude (using Opus 5)
Type of change
Checklist
make testpasses locallyopengrep --validateNotes for reviewers
Header comments in these files were written by AI and likely inaccurate. View them as notes for the reviewer that may point to blind spots in the patterns. Take them with a grain of salt.