commit | 3b6e1be4391d96e81cee022f77f7bab85d51cf4e | [log] [tgz] |
---|---|---|
author | Eric Biggers <ebiggers@google.com> | Tue Dec 17 03:54:56 2024 +0000 |
committer | Boringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Jan 06 14:14:57 2025 -0800 |
tree | ea3ac43c00b15fed50fa3f0ee9f4be0900bdb7da | |
parent | e869bfb4141ece8bc180fc4faeeaa07c4e87f53f [diff] |
Add VAES + AVX2 optimized AES-GCM Add a VAES-optimized AES-GCM implementation that is optimized for AMD Zen 3 processors, using AVX2 instead of AVX512 / AVX10. With AVX2 only 16 vector registers are available and some instructions are missing, which is inconvenient and makes the code not easily sharable with the AVX512 / AVX10 version. However, using VAES still gives a significant performance improvement, about 80-85% on long messages as shown by the following tables which show the change in AES-256-GCM throughput in MB/s on a Zen 3 "Milan" processor for various message lengths in bytes. Encryption: | 16384 | 4096 | 4095 | 1420 | 512 | 500 | --------+-------+-------+-------+-------+-------+-------+ Before | 3955 | 3749 | 3597 | 3054 | 2411 | 2038 | After | 7128 | 6631 | 5975 | 4788 | 3807 | 2676 | | 300 | 200 | 64 | 63 | 16 | --------+-------+-------+-------+-------+-------+ Before | 1757 | 1405 | 856 | 602 | 356 | After | 1885 | 1430 | 940 | 593 | 381 | Decryption: | 16384 | 4096 | 4095 | 1420 | 512 | 500 | --------+-------+-------+-------+-------+-------+-------+ Before | 3962 | 3774 | 3593 | 2978 | 2510 | 1998 | After | 7378 | 6836 | 6282 | 4826 | 3868 | 2753 | | 300 | 200 | 64 | 63 | 16 | --------+-------+-------+-------+-------+-------+ Before | 1742 | 1428 | 856 | 535 | 383 | After | 1940 | 1534 | 940 | 573 | 383 | Change-Id: I583dd6b48b81ab3c6df51bfe8729366cad500537 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/74368 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@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:
To file a security issue, use the Chromium process and mention in the report this is for BoringSSL. You can ignore the parts of the process that are specific to Chromium/Chrome.
There are other files in this directory which might be helpful: