-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
crypto: add better support for alternative backends #1686
Conversation
e79963f
to
c195527
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't remove OpenSSL support.
- OpenSSL is packaged for many systems, boring crypto isn't.
- This is an experiment that may never land.
Adding support for boringcrypto makes sense, just don't drop OpenSSL support.
I don't have boring crypto installed on my system and yet it work. I have no problem adding openssl back in, however this discussion started because it seems no one has time to maintain go-openssl. |
a53eee6
to
ce04d11
Compare
My understanding is that boringssl is packaged within applications. It's not dynamically linked from the system libraries.
From https://boringssl.googlesource.com/boringssl/
Seems like there's appetite for it though. This came from a separate branch to being part of the standard branch and enabled with an environment variable. I need to think a bit more about the go-openssl bit, maybe not worth removing it just yet. But if we get the same performance benefits and we get rid of a dependency it seems tempting. |
Ah, that makes more sense.
I'm confused. go-openssl works now and doesn't require a fork of the go compiler. BoringSSL support isn't a replacement. Removing go-openssl in favor of boringcrypto would be a matter of removing a working feature that people are using in production, in favor of an experimental feature that requires a custom go toolchain. That's definitely not how you keep your users happy. |
I misunderstood how boringcrypto works. I thought you had to run Maybe in the future it becomes part of the standard toolchain, until then I agree that we should keep the go-openssl library (it’s pretty trivial anyways). |
I had the same misunderstanding. @Jorropo, are you aware of any plans that this might make it into the standard Go build chain?
Indeed, that was the plan. It would be super nice if we could drop the OpenSSL dependency, especially since 1. the v3 release complicates things, as we now have to maintain compatibility with two versions of OpenSSL for the foreseeable future and 2. there’s an upcoming hard fork of OpenSSL, and I already see the inevitable ask to make the library work with that fork as well. It would be a sad outcome, if we now had to maintain 3 different versions (standard library crypto, OpenSSL and Boring) in the long term. I’m ok with doing it for a limited amount of time, to give us time try out Boring (would be good to get some real-world performance data). I’d regard relying on a custom build of the Go toolchain is a dealbreaker, so it would be good to get some clarity on the Go team’s plans here. |
No |
f322141
to
b09101d
Compare
Update: |
3ac66f8
to
14ff310
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This should be part of the v0.22.0 release (it is anyway, because the #1688 also updates the respective dependency, but let's make it explicit).
@Stebalien, can you please re-review this?
I've benchmarked the things with the current PR and I see slightly different results than when I tested stuff directly (without going through
I don't know why boring is slower in some cases, so this probably need more investigation before people start using it in production (I still think it's fine to merge as is for now). |
I misunderstood again, Anyways it's still marked experimental and we don't need to make the decision to drop openssl now. This PR is good as is. Thanks for adding the boringcrypto version to the test matrix @Jorropo . and sorry for the confusion here. |
Rebased on master due to #1689 (:tada:) |
I reran the RSA part of the benchmark on a Linode machine with 2 virtual CPUs (AMD EPYC 7642 48-Core Processor) and Go 1.19.4, and I'm getting slightly different numbers, that make BoringSSL look a lot more attractive, especially for signature verification.
(all values in microseconds) |
@marten-seemann thoses benchmarks have similar results to my previous ones: #1686 (comment) I was disappointed by the Ed25519 performance regressions. Given that unlike openssl, we can't use it only for RSA. If you enable boring it's for everything. |
Based on #1683.