Skip to content

crypto: use EVP_MAC for HMAC on OpenSSL >=3#63942

Open
panva wants to merge 2 commits into
nodejs:mainfrom
panva:use-evp_mac
Open

crypto: use EVP_MAC for HMAC on OpenSSL >=3#63942
panva wants to merge 2 commits into
nodejs:mainfrom
panva:use-evp_mac

Conversation

@panva

@panva panva commented Jun 16, 2026

Copy link
Copy Markdown
Member

Closes: #59493

Use OpenSSL 3 provider-backed EVP_MAC APIs for HMAC when available, while keeping the existing HMAC_* implementation around for OpenSSL 1.1.1 and BoringSSL compatibility. Provider fetch/setup failures on OpenSSL 3 surface as HMAC initialization failures instead of falling back to deprecated HMAC_* APIs.

Closes: nodejs#59493
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/security-wg

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Jun 16, 2026
@panva

panva commented Jun 16, 2026

Copy link
Copy Markdown
Member Author

https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1872/

The EVP_MAC path shows a statistically significant HMAC construction slowdown
in this run, around 4.5% across the createHmac() configurations. That's construction, but then HMAC throughput and WebCrypto HMAC are mostly flat.

@panva panva requested review from jasnell and tniessen June 16, 2026 14:12
@panva panva added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Jun 17, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 17, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please port ncrypto from deprecated HMAC_ apis to EVP_MAC apis

3 participants