Repository navigation
feat(cryptography): accept AES-GCM associated data and empty HKDF input - #10628
Merged
Merged
Conversation
Noise authenticates every handshake message with associated data, and Split derives the transport keys from an empty HKDF input. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…-empty-hkdf Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # packages/cryptography/CHANGELOG.md
… decrypt Co-authored-by: Cursor <cursoragent@cursor.com>
FrederikBolding
approved these changes
Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
@metamask/cryptographycan cover the Noise primitives in the MFA wallet SDK except for two gaps:encryptanddecryptnever passed associated data through to WebCrypto. Noise authenticates the handshake hash on every message, so ciphertext produced without that data does not interoperate.unsafeInputKeyingMaterialwas set. NoiseSplitderives the two transport keys withHKDF(chaining_key, zerolen).additionalDatais now an option on both AES-GCM calls. An empty HKDF input is accepted whenunsafeInputKeyingMaterialis set; without that flag the call still throws. AES-GCM associated data is covered by NIST GCM test case 4. The empty-input HKDF vector matches Node'shkdfSync.References
Checklist
Made with Cursor