Skip to content
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

deps: replace tweetnacl-util with @scure/base #358

Merged
merged 1 commit into from
May 1, 2024

Conversation

legobeat
Copy link
Contributor

  • tweetnacl-util is no longer actively maintained
  • @scure/base is already pulled in transitively through ethereum-cryptography
  • Remove redundant base64 encode/decode step when decoding hex input

Related

@legobeat legobeat marked this pull request as ready for review November 22, 2023 07:13
@legobeat legobeat added the dependencies Pull requests that update a dependency file label Nov 22, 2023
@legobeat legobeat requested a review from a team April 22, 2024 08:50
- `tweetnacl-util` is no longer actively maintained
- `@scure/base` is already pulled in transitively through `ethereum-cryptography`
- Remove redundant base64 encode/decode step when decoding hex input
@@ -165,18 +165,15 @@ export function decrypt({

switch (encryptedData.version) {
case 'x25519-xsalsa20-poly1305': {
// string to buffer to UInt8Array
const receiverPrivateKeyUint8Array = naclDecodeHex(privateKey);
const receiverPrivateKeyUint8Array = Buffer.from(privateKey, 'hex');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use @metamask/utils instead of Node.js globals?

Copy link
Contributor Author

@legobeat legobeat May 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we address that in a separate PR? The native Buffer.from is already used by this function (from here), so we're not introducing it in this PR.

@legobeat legobeat requested a review from Mrtenz May 1, 2024 07:09
@legobeat legobeat merged commit 09ecd4f into MetaMask:main May 1, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants