-
-
Notifications
You must be signed in to change notification settings - Fork 175
Use aws-lc-rs/ring implementation for AEAD ciphers
#535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thanks! I've added direct benchmarks for the ciphers and the GCM gains are just as dramatic on my side. Out of curiousity, why did you decide to switch to ring from aws-lc? It seems that the general ecosystem trend is heading towards aws-lc (see rustls), especially given how it is FIPS certified. |
|
We could switch to the aws-lc-rs implementations instead, I just wasn't able to figure out how to make it compile for Windows or WASM, so I went with ring for this PR. |
ring implementation for AEAD ciphersaws-lc-rs implementation for AEAD ciphers
aws-lc-rs implementation for AEAD ciphersaws-lc-rs/ring implementation for AEAD ciphers
|
Given that WebAssembly doesn't seem to be a supported platform for aws-lc-rs, I've replaced the dependency with ring for the target. Perhaps choosing between either package should be a feature flag in the same vein as rustls? EDIT: I've done just that. |
|
Looking great now 👍 👍 |
Closes #532.
By switching the ChaCha20Poly1305, AES-GCM-128 and AES-GCM-256 ciphers from the RustCrypto implementation to
ring's, my port forwarding benchmarks resulted in a substantial performance gain of an order of magnitude on my machine.mainBut results seem to vary depending on your hardware, where we see much smaller or no gains. On a different machine with limited memory and less CPU power (and a different benchmark):
mainThis implementation also changes the signature for the
OpeningKey::openmethod to not split the tag from the cipher prematurely.I have tested ChaCha20Poly1305 and AES-GCM-256 against the current release of russh and OpenSSH, but not AES-GCM-128, although I expect it to work the same.