Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(iroh-net): unify key handling (#1373)
## Description Moves all keys being used to `ed25519` keys, and only converts them to `crypto_box` keys only when needed. ### Breaking Changes - This is a breaking change to the derp protocol, as now only `ed25519` keys are sent over the wire. - The encrypted packets also changed, as first the sealed message and then the nonce is now sent - All configs and cli options now use `secret_key` not `keypair` or `private_key` - MSRV from `1.66` to `1.67` due to updated dependencies - `PeerId` is removed in favor of just using `PublicKey` directly ## Notes & open questions - [x] This is more expensive as the conversions are not cached at the moment, we should do so either in this PR or in a follow up. - [x] Depends on RustCrypto/nacl-compat#137 as otherwise the upgrade of `ed25519` breaks the code. ## Caching There is a performance benefit to caching, so for public key we always cache the `crypto_box::PublicKey`, and for `SecretKey`s we cache using `OnceCell`. --------- Co-authored-by: Diva M <[email protected]>
- Loading branch information