Add ECIES encryption support to subxt-signer#2198
Add ECIES encryption support to subxt-signer#2198hitchhooker wants to merge 3 commits intoparitytech:masterfrom
Conversation
Adds encrypt/decrypt methods to sr25519::Keypair using schnorrkel's new ECIES module. Gated behind the `ecies` feature flag. Depends on: paritytech/schnorrkel#116
| # ecdsa compiling to WASM on my mac; following this comment helped: | ||
| # https://github.com/rust-bitcoin/rust-bitcoin/issues/930#issuecomment-1215538699 | ||
| sr25519 = ["schnorrkel"] | ||
| ecies = ["sr25519", "schnorrkel/ecies"] |
There was a problem hiding this comment.
I wonder whether this feature would be better called "sr25519-ecies" since it seems specific to that (and then it would be a stronger hint that this enables some feature in the sr25519 module)
| hmac = { version = "0.12.1", default-features = false } | ||
| pbkdf2 = { version = "0.12.2", default-features = false } | ||
| schnorrkel = { version = "0.11.4", default-features = false } | ||
| schnorrkel = { version = "0.11.5", default-features = false, git = "https://github.com/hitchhooker/schnorrkel", branch = "ecies" } |
There was a problem hiding this comment.
Until the original non-fork version of this has the relevant feature and is available on crates.io, we won't be able to merge this: git URLs prevent publishing, and I would not want to deviate from the Parity crate, in large part for security reasons :)
|
Thankyou; offhand this looks good to me! Will need to wait for the My only general reservation is that the |
- add Keypair::viewing_key() to derive FullViewingKey - encrypt now takes recipient ivk public + sender ovk - decrypt unchanged (secret key path still works) - example uses viewing key hierarchy (ivk/ovk)
Summary
encrypt/decryptmethods tosr25519::Keypairusing schnorrkel's ECIES moduleeciesfeature flag in subxt-signercargo run -p subxt-signer --features ecies --example eciesDepends on: paritytech/schnorrkel#116 (schnorrkel needs to publish with the
eciesfeature before this can use a crates.io version)Test plan