add methods and struct for e2ee#788
Closed
mikelodder7 wants to merge 7 commits intofeat/rc-naga-2025-04-07from
Closed
add methods and struct for e2ee#788mikelodder7 wants to merge 7 commits intofeat/rc-naga-2025-04-07from
mikelodder7 wants to merge 7 commits intofeat/rc-naga-2025-04-07from
Conversation
Signed-off-by: Michael Lodder <mike@litprotocol.com>
| message: Uint8Array | ||
| ): Promise<WalletEncryptedPayload> => { | ||
| const random = new Uint8Array(16); | ||
| window.crypto.getRandomValues(random); |
Contributor
There was a problem hiding this comment.
Using window won't work on node side, neither deno if we want to put the SDK in LAs. However the method exists on nodes and denos crypto module
| timestamp.writeBigUInt64BE(BigInt(createdAt), 0); | ||
|
|
||
| const myWalletPublicKey = new Uint8Array(32); | ||
| nacl.crypto_scalarmult_base(myWalletPublicKey, myWalletSecretKey); |
Contributor
There was a problem hiding this comment.
nit: if we can use @noble curves and hashes way better so we move towards lib unification (and drop tweetnacl)
Ansonhkg
suggested changes
Apr 9, 2025
Contributor
There was a problem hiding this comment.
need to handle node environment and unit test is required
Update:
- Fixed them here #815, review needed @DashKash54 @mikelodder7
Anson/propose change for 788
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.
Description
This adds the methods that will be necessary for End-to-End Encryption with lit-node coming shortly after Naga release.
This only uses tweet-nacl and thus no new dependencies are added.
Type of change
How Has This Been Tested?
I'm not familiar with how to test in the SDK but would love help in adding unit tests for this.