Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR performs a comprehensive refactoring of the cryptography package and its test utilities, focusing on code organization, API improvements, and type safety enhancements.
Key changes:
- Renamed test library file from
cryptography_test.darttocryptography_testing.dartto better reflect its purpose - Simplified test code structure by removing unnecessary nesting and using lambda expressions
- Improved browser implementation type safety by replacing
ByteBufferwithUint8Listthroughout - Removed empty key validation in HMAC to allow empty keys
- Added utility methods to Ed25519 for key/signature length validation
- Reorganized class members in Blake2b/Blake2s for better readability
- Made X25519
keyPairTypenon-virtual in the base class
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| cryptography_test/test/main_test.dart | Updated import to use renamed test library file |
| cryptography_test/lib/cryptography_testing.dart | New test library file (renamed from cryptography_test.dart) |
| cryptography_test/lib/algorithms/x25519.dart | Simplified test structure by removing unnecessary group wrapper and using lambda expressions |
| cryptography_test/lib/algorithms/hmac.dart | Updated test to reflect that empty keys are now allowed |
| cryptography/lib/src/dart/x25519.dart | Removed redundant keyPairType override now that base class has @nonvirtual annotation |
| cryptography/lib/src/cryptography/mac_algorithm.dart | Removed empty key validation and improved error message for unsupported AAD |
| cryptography/lib/src/cryptography/algorithms.dart | Reorganized Blake2b/Blake2s class members, added Ed25519 validation helpers, made X25519 keyPairType @nonvirtual |
| cryptography/lib/src/browser/rsa_ssa_pkcs1v15.dart | Improved type safety by using Uint8List directly instead of ByteBuffer |
| cryptography/lib/src/browser/rsa_pss.dart | Improved type safety by using Uint8List directly instead of ByteBuffer |
| cryptography/lib/src/browser/pbkdf2.dart | Improved type safety by using Uint8List directly instead of ByteBuffer |
| cryptography/lib/src/browser/hmac.dart | Improved type safety by using Uint8List directly instead of ByteBuffer |
| cryptography/lib/src/browser/hkdf.dart | Improved type safety and reordered imports for consistency |
| cryptography/lib/src/browser/ecdsa.dart | Improved type safety by using Uint8List directly instead of ByteBuffer |
| cryptography/lib/src/browser/ecdh.dart | Improved type safety and renamed extension type to be more descriptive |
| cryptography/lib/src/browser/browser_secret_key.dart | Improved type safety by using Uint8List directly instead of ByteBuffer |
| cryptography/lib/src/browser/_javascript_bindings.dart | Updated return types to Uint8List and added new extension types for better type safety |
| .github/workflows/dart.yml | Added cryptography_test package to the test matrix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.