-
Notifications
You must be signed in to change notification settings - Fork 1
Rm encoding #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rm encoding #9
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the ECIES encryption library to version 0.1.7, introducing breaking API changes that improve type safety by switching from string-based to byte array-based function signatures. The changes standardize all encryption/decryption functions to work with Uint8Array inputs and outputs, while adding utility functions for hex conversion and key derivation.
- Refactored all TypeScript encryption/decryption functions to use
Uint8Arrayinstead of strings - Added utility functions for hex conversion (
toHexString,fromHexString,ensureBytes) and key derivation (publicKeyFromPrivateKey) - Updated CLI and integration tests to handle the new byte array-based API
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| ts/lib/src/index.ts | Core library refactoring with new byte-based APIs, utility functions, and comprehensive documentation |
| ts/cli/index.ts | CLI updates to work with new byte array APIs, adding encoding/decoding steps |
| tests/integration-test.sh | Added debug output for integration test troubleshooting |
| package.json, ts/lib/package.json, rust/lib/Cargo.toml | Version bumps to 0.1.7 |
| rust/lib/src/lib.rs | Added public key derivation method and improved function documentation |
Comments suppressed due to low confidence (1)
Marcin-Radecki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job!
This pull request updates the ECIES encryption library to version 0.2.0 and introduces significant improvements to the TypeScript and Rust implementations, focusing on clearer APIs, better type safety, and improved interoperability between the two languages. The changes include refactoring encryption/decryption functions to consistently use byte arrays, adding new utility functions for key conversion and hex handling, and enhancing documentation and error handling. Integration tests and CLI commands are also updated to reflect these improvements.
API and Type Safety Improvements
encrypt,decrypt,encryptPadded, etc.) to accept and returnUint8Arrayinstead of strings, improving type safety and clarity. Added utility functions liketoHexString,fromHexString, andensureBytesfor robust hex conversion and byte handling.publicKeyFromPrivateKeyto TypeScript for deriving a public key from a private key, and documented all major functions for clarity.Rust Library Enhancements
PrivKey::public_key) and improved documentation for all major functions inrust/lib/src/lib.rs.Version Bumps
0.2.0inpackage.json,ts/lib/package.json, andrust/lib/Cargo.tomlto reflect these breaking and additive changes.