Title: Support GMAC and multiple AAD chunks for AEAD · Issue #48314 · nodejs/node · GitHub
Open Graph Title: Support GMAC and multiple AAD chunks for AEAD · Issue #48314 · nodejs/node
X Title: Support GMAC and multiple AAD chunks for AEAD · Issue #48314 · nodejs/node
Description: What is the problem this feature will solve? Node.js only allows a single call to setAAD() for AEAD algorithms. AAD that consists of multiple chunks must be concatenated in memory before it can be passed to setAAD(), which is highly inef...
Open Graph Description: What is the problem this feature will solve? Node.js only allows a single call to setAAD() for AEAD algorithms. AAD that consists of multiple chunks must be concatenated in memory before it can be ...
X Description: What is the problem this feature will solve? Node.js only allows a single call to setAAD() for AEAD algorithms. AAD that consists of multiple chunks must be concatenated in memory before it can be ...
Opengraph URL: https://github.com/nodejs/node/issues/48314
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support GMAC and multiple AAD chunks for AEAD","articleBody":"### What is the problem this feature will solve?\n\nNode.js only allows a single call to `setAAD()` for AEAD algorithms. AAD that consists of multiple chunks must be concatenated in memory before it can be passed to `setAAD()`, which is highly inefficient.\r\n\r\nGMAC is a MAC algorithm based on AES-GCM that consumes the entire input data as AAD and leaves the plaintext/ciphertext empty. The AES-GCM authentication tag is the MAC produced by GMAC. Implementing GMAC on top of Node.js again requires concatenating all input data in memory before calling `setAAD()`.\n\n### What is the feature you are proposing to solve the problem?\n\nExtend the API to allow appending multiple chunks of AAD. This is common practice and supported by various cryptographic libraries, including OpenSSL.\r\n\r\nWe should consider carefully if such an extension should be a separate `WritableStream` or if a simpler API makes more sense.\n\n### What alternatives have you considered?\n\nConcatenating all data in memory before passing it to `setAAD()`.\r\n\r\nMy primary use case for multiple calls to `setAAD()` is GMAC, so a separate GMAC API (similar to the existing [HMAC API](https://nodejs.org/docs/latest-v18.x/api/crypto.html#cryptocreatehmacalgorithm-key-options)) would also be sufficient for my purposes. However, it would leave a gap between AES-GCM and GMAC for those rare use cases that have multiple chunks of AAD and a non-empty plaintext/ciphertext.\r\n\r\nOn a side note, I preliminarily decided against adding streaming support for AAD in https://github.com/wintercg/proposal-webcrypto-streams, see [this section of the explainer](https://github.com/wintercg/proposal-webcrypto-streams/blob/31630ad4581e594f84e511aaaeae376bd8628fc0/explainer.md#additional-data-in-aead-ciphers). However, that is mostly due to the API constraints of the Web Crypto API.","author":{"url":"https://github.com/tniessen","@type":"Person","name":"tniessen"},"datePublished":"2023-06-03T10:00:00Z","url":"https://github.com/nodejs/node/issues/48314"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:49b987ad-05ab-8cb2-a059-3c7e0535380f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A7CA:203847:2CD06:3B80A:6AED3075 |
| html-safe-nonce | f169bad10b41c0b7e30610b61e5b6633624a0c0d7de041e8619bb80636e43f67 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBN0NBOjIwMzg0NzoyQ0QwNjozQjgwQTo2QUVEMzA3NSIsInZpc2l0b3JfaWQiOiI2MjQ3MDcwODgxMDA5NjI0MjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ef4e0d19b85fd7aba1dbd51c3e77941008b7c14547483b7052f9f59630e9b498 |
| hovercard-subject-tag | issue:1739345184 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/48314/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a140eb1bc68435b4f13f62538c83e8d4efae186a518860513dbffadbb2d0e529/nodejs/node/issues/48314 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a140eb1bc68435b4f13f62538c83e8d4efae186a518860513dbffadbb2d0e529/nodejs/node/issues/48314 |
| og:image:alt | What is the problem this feature will solve? Node.js only allows a single call to setAAD() for AEAD algorithms. AAD that consists of multiple chunks must be concatenated in memory before it can be ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tniessen |
| hostname | github.com |
| expected-hostname | github.com |
| None | e51d0b7b5ab34b1688c05b54c3ed17b8658b2fa9bca973a9c740683ccb12cf4a |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 59ebb7b901cc154ecc179a44f266fcf69f343b30 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width