Skip to content

crypto.getDiffieHellman() much slower after OpenSSL 1.1.1c update #28404

Closed
@Trott

Description

@Trott
  • Version: master branch (v13.0.0-pre)
  • Platform: macOS Mojave but I've seen it on Linux in CI too
  • Subsystem: crypto

node compiled from the master branch takes 24 seconds while Node.js 12.4.0 takes less than 2 seconds.

$ time ./node -e "require('crypto').getDiffieHellman('modp18')" 

real	0m24.159s
user	0m23.687s
sys	0m0.066s
$ time node -e "require('crypto').getDiffieHellman('modp18')"

real	0m1.403s
user	0m1.173s
sys	0m0.070s
$

@bnoordhuis notes that the default key size in 1.1.1c was increased from 1024 bits to 2048 bits, but IIUC, specifying modp18 sets the key size for both to a large value.

Bug? Ot maybe it's not-a-bug because it's using a more reliable source of randomness so things are slower or something like that?

@nodejs/crypto

Metadata

Metadata

Assignees

No one assigned

    Labels

    cryptoIssues and PRs related to the crypto subsystem.opensslIssues and PRs related to the OpenSSL dependency.performanceIssues and PRs related to the performance of Node.js.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions