-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crypto: simplify diffiehellman getFormat function #20246
Conversation
This commit aims to simplify the getFormat function in diffiehellman.js.
lib/internal/crypto/diffiehellman.js
Outdated
else if (format === 'hybrid') | ||
f = POINT_CONVERSION_HYBRID; | ||
return POINT_CONVERSION_HYBRID; | ||
// Default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this comment or move to line 231 as POINT_CONVERSION_UNCOMPRESSED
is the default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah thanks, I'll update shortly.
lib/internal/crypto/diffiehellman.js
Outdated
if (format) { | ||
if (format === 'compressed') | ||
f = POINT_CONVERSION_COMPRESSED; | ||
return POINT_CONVERSION_COMPRESSED; | ||
else if (format === 'hybrid') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The else becomes obsolete here. The same for the next one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I missed that. Will update shortly. Thanks
@BridgeAR Noted! 👍 |
Landed in 3b8ab2a. |
This commit aims to simplify the getFormat function in diffiehellman.js. PR-URL: nodejs#20246 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit aims to simplify the getFormat function in diffiehellman.js. PR-URL: #20246 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit aims to simplify the getFormat function in
diffiehellman.js.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes