crypto: add a generic MAC API - #65553
Conversation
Add getMacs() and createMac() to node:crypto as a layer on top of OpenSSL EVP_MAC. Support incremental and streaming operations with provider parameter validation and configurable output sizes. Signed-off-by: Filip Skokan <panva.ip@gmail.com>
|
Review requested:
|
|
Compared
|
|
Based on the referenced issues and prior work: cc @bnoordhuis @mscdex @tniessen @paragonie-security |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #65553 +/- ##
==========================================
- Coverage 90.08% 90.06% -0.03%
==========================================
Files 751 754 +3
Lines 254075 255607 +1532
Branches 47910 48281 +371
==========================================
+ Hits 228882 230209 +1327
- Misses 16412 16525 +113
- Partials 8781 8873 +92
🚀 New features to boost your workflow:
|
|
The
notable-change
Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section. |
|
Benchmark GHA (crypto / mac): https://github.com/nodejs/node/actions/runs/33089847500 |
Add getMacs() and createMac() to node:crypto as a layer on top of OpenSSL EVP_MAC. Support incremental and streaming operations with provider parameter validation and configurable output sizes.
Refs: #32433
Refs: #40921
Refs: #48314
Refs: #32448
Refs: #32477
Possible followups:
mac.copy([options])to get a new Mac instance with a copied state, not for GMAC and Poly1305crypto.mac(algorithm, key, data[, options])one-shot akin tocrypto.hash()