Add Ed25519-to-X25519 WASM functions for session key vault access#26
Merged
Add Ed25519-to-X25519 WASM functions for session key vault access#26
Conversation
Adds two new WASM-exported functions that enable Ed25519 session keys to participate in vault encryption without requiring a wallet signature: - vault_ed25519_seed_to_x25519: Converts Ed25519 seed to X25519 key pair via SHA-512 derivation (standard Ed25519→X25519 conversion) - vault_ed25519_pub_to_x25519: Converts Ed25519 public key to X25519 public key via Edwards→Montgomery birational map This allows share link recipients (who only have a session key) to derive the X25519 keys needed for vault grant decryption, removing the requirement for a wallet signature to access shared encrypted content.
c756f2e to
5e73a4d
Compare
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
vault_ed25519_seed_to_x25519()— converts Ed25519 seed to X25519 key pair via SHA-512 (standard conversion)vault_ed25519_pub_to_x25519()— converts Ed25519 public key to X25519 via Edwards→Montgomery birational mapcurve25519-dalekdependency for the public key point conversionThese enable session keys (Ed25519, embedded in share tokens) to derive X25519 keys for vault grant operations, removing the requirement for wallet signatures when accessing shared encrypted content.
Test plan
cargo check --target wasm32-unknown-unknownpassescargo testin tinycloud-sdk-wasm passesvault_ed25519_pub_to_x25519correctly maps known Ed25519 public keys to their X25519 equivalents