cloudflare / boringtun

Userspace WireGuard® Implementation in Rust
BSD 3-Clause "New" or "Revised" License
5.93k stars 397 forks source link

Replace bespoke x25519 with a library #265

Closed jeff-hiner closed 2 years ago

jeff-hiner commented 2 years ago

This completely removes the bespoke X25519 implementation, replacing it with the x25519_dalek crate.

I couldn't use ring because it doesn't allow DH agreements with static keys, nor does it allow "reusable" ephemeral keys required for Noise implementations. Turns out x25519_dalek is far more ergonomic anyway.

This change removes approximately 1000 lines of code, and on my machine improves the x25519 key generation speed by a factor of 3.

Noah-Kennedy commented 2 years ago

@jeff-hiner we've got conflicts sadly. Also, this integration test can be deleted. I'm about to redo the tests anyways.