commit | 15b1f9c6a4f9656e7c172e03064fe7f8e03c666d | [log] [tgz] |
---|---|---|
author | David Benjamin <davidben@google.com> | Thu Sep 07 18:32:05 2023 -0400 |
committer | Boringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Sep 08 17:47:42 2023 +0000 |
tree | cba94e6e3eaee61387c59f53c3c43ec6da48a90a | |
parent | e5b6c141a19bb086481f914d4d55b35765505e6c [diff] |
Help the compiler dedup ia32cap and armcap accesses https://boringssl-review.googlesource.com/c/boringssl/+/62585 made the compiler emit multiple CRYPTO_library_init calls in functions which dispatch between a tower of alternatives. Ideally, the compiler would know that at most one call suffices. There doesn't seem to be such an attribute, but we can get the same effect with pure or const attributes. We tie init with returning the capability vector. On Intel, because the vector is so large, we have to go with a weaker version. Somewhat annoyingly, the getter must be out-of-line, because otherwise the compiler inlines first and loses the attribute. I went with pure because we allow our unit tests to mutate OPENSSL_armcap_P, which means the Arm one is, strictly speaking, pure, not const. This slightly reduces optimization potential, but should still allow deduping in most places. Confirmed that aes_init_key now only calls a helper function once. See discussion in https://boringssl-review.googlesource.com/c/boringssl/+/62585/comment/26083b88_b3db2b75/ Bug: 35 Change-Id: I9bc464f0e5a0ed9601017a5037028f906693a137 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/62985 Auto-Submit: David Benjamin <davidben@google.com> Reviewed-by: Bob Beck <bbe@google.com> Commit-Queue: Bob Beck <bbe@google.com>
BoringSSL is a fork of OpenSSL that is designed to meet Google's needs.
Although BoringSSL is an open source project, it is not intended for general use, as OpenSSL is. We don't recommend that third parties depend upon it. Doing so is likely to be frustrating because there are no guarantees of API or ABI stability.
Programs ship their own copies of BoringSSL when they use it and we update everything as needed when deciding to make API changes. This allows us to mostly avoid compromises in the name of compatibility. It works for us, but it may not work for you.
BoringSSL arose because Google used OpenSSL for many years in various ways and, over time, built up a large number of patches that were maintained while tracking upstream OpenSSL. As Google's product portfolio became more complex, more copies of OpenSSL sprung up and the effort involved in maintaining all these patches in multiple places was growing steadily.
Currently BoringSSL is the SSL library in Chrome/Chromium, Android (but it's not part of the NDK) and a number of other apps/programs.
Project links:
There are other files in this directory which might be helpful: