Conversation
Add AES-OCB support to subtle.encrypt/decrypt/generateKey/importKey/ exportKey/wrapKey/unwrapKey, matching Node.js WebCrypto behavior. - Add aesOcbCipher() with OCB-specific validation (tag lengths 64/96/128, IV max 15 bytes) - Fix OCBCipher.cpp tag length minimum from 12 to 8 bytes - Add AesOcbParams type and wire AES-OCB through all subtle API paths - Fix stale coverage docs: wrap/unwrap from #914, getCurves from #913 - Add 11 AES-OCB tests (roundtrip, key sizes, AAD, tag lengths, tampering, wrap/unwrap) Closes #382
…er collision Extract shared aesAeadCipher helper to deduplicate GCM/OCB cipher logic. Remove as-any casts in OCB tests by using proper AesOcbParams type. Fix OCB error assertion to match actual C++ error message. Fix IV validation message to mention 1-byte minimum. Fix wrap/unwrap test comment numbering. Exclude ncrypto version.h from pod sources to avoid shadowing libsodium's version.h in flattened Pods/Headers directory.
Contributor
🤖 End-to-End Test Results - AndroidStatus: ✅ Passed 📸 Final Test ScreenshotScreenshot automatically captured from End-to-End tests and will expire in 30 days This comment is automatically updated on each test run. |
Contributor
🤖 End-to-End Test Results - iOSStatus: ✅ Passed 📸 Final Test ScreenshotScreenshot automatically captured from End-to-End tests and will expire in 30 days This comment is automatically updated on each test run. |
Add raw-secret format support to importKey/exportKey as a Node.js- compatible alias for raw. Fix getAlgorithmName to produce correct JWK alg field values (e.g. A256GCM instead of AES-GCM256). Add AES-OCB JWK and raw-secret import/export tests. Fix existing raw-secret tests to actually use raw-secret format. Update coverage docs to mark all symmetric key import/export as implemented.
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.


Summary
Adds AES-OCB (Offset Codebook Mode) support to the WebCrypto
subtleAPI, including encrypt/decrypt, key generate/import/export, and wrap/unwrap operations.Changes
aesAeadCipherto deduplicate ~160 lines between GCM and OCB cipher implementationstagLength(64 | 96 | 128) andadditionalDatasupportversion.hfrom pod sources to prevent it from shadowing libsodium'sversion.hin the flattenedPods/Headers/PrivatedirectoryassertThrowsAsyncexpected messages to match actual C++ error stringsTesting
Tested on iOS device via the example app: