ML-KEM: Add a branchless pre-path to `scalar_from_keccak_block_vartime`. This mirrors https://go.dev/cl/818725. On aarch64 Apple M1 Pro: Did 33376 BM_SpeedMLKEM768KeyGenDecap/threads:1 operations (47765.6 ops/sec) [+19.4%] Did 53730 BM_SpeedMLKEM768ParseEncap/threads:1 operations (76357.6 ops/sec) [+9.5%] Did 24107 BM_SpeedMLKEM1024KeyGenDecap/threads:1 operations (34840.2 ops/sec) [+23.7%] Did 39086 BM_SpeedMLKEM1024ParseEncap/threads:1 operations (55732.7 ops/sec) [+16.0%] On x86-64 AMD EPYC 7B13: Did 13426 BM_SpeedMLKEM768KeyGenDecap/threads:1 operations (19159.0 ops/sec) [+7.9%] Did 22704 BM_SpeedMLKEM768ParseEncap/threads:1 operations (32587.3 ops/sec) [+3.4%] Did 9885 BM_SpeedMLKEM1024KeyGenDecap/threads:1 operations (14088.9 ops/sec) [+11.0%] Did 16832 BM_SpeedMLKEM1024ParseEncap/threads:1 operations (24070.4 ops/sec) [+6.2%] Also tried 1x (about 2% worse), 4x (about 1% better), 8x (much worse), where the factor refers to iterations of the branchful loop (each writing zero to two output words from 3 input bytes). Staying away from 4x for now as running out of registers has awful performance consequences, but leaving the option open if a confirmed speedup on all relevant platforms. Bug: 503700354 Change-Id: I29afe4aa283b686b9fc3877e059931f46a6a6964 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/101987 Reviewed-by: David Benjamin <davidben@google.com> Auto-Submit: Rudolf Polzer <rpolzer@google.com> Commit-Queue: Rudolf Polzer <rpolzer@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: