update master-with-bazel from master branch

This commit is contained in:
BoringSSL Robot
2023-02-03 17:16:18 +00:00
4 changed files with 8 additions and 12 deletions
-4
View File
@@ -35,10 +35,6 @@
// Various pre-computed constants.
#include "./curve25519_tables.h"
#if defined(OPENSSL_NO_ASM)
#define FIAT_25519_NO_ASM
#endif
#if defined(BORINGSSL_CURVE25519_64BIT)
#include "../../third_party/fiat/curve25519_64.h"
#else
+5 -1
View File
@@ -852,7 +852,11 @@ static int copy_from_prebuf(BIGNUM *b, int top, const BN_ULONG *table, int idx,
OPENSSL_memset(b->d, 0, sizeof(BN_ULONG) * top);
const int width = 1 << window;
for (int i = 0; i < width; i++, table += top) {
BN_ULONG mask = constant_time_eq_int(i, idx);
// Use a value barrier to prevent Clang from adding a branch when |i != idx|
// and making this copy not constant time. Clang is still allowed to learn
// that |mask| is constant across the inner loop, so this won't inhibit any
// vectorization it might do.
BN_ULONG mask = value_barrier_w(constant_time_eq_int(i, idx));
for (int j = 0; j < top; j++) {
b->d[j] |= table[j] & mask;
}
-4
View File
@@ -30,10 +30,6 @@
#include "../delocate.h"
#include "./internal.h"
#if defined(OPENSSL_NO_ASM)
#define FIAT_P256_NO_ASM
#endif
#if defined(BORINGSSL_HAS_UINT128)
#define BORINGSSL_NISTP256_64BIT 1
#include "../../../third_party/fiat/p256_64.h"
+3 -3
View File
@@ -302,7 +302,7 @@ typedef uint32_t crypto_word_t;
// always has the same output for a given input. This allows it to eliminate
// dead code, move computations across loops, and vectorize.
static inline crypto_word_t value_barrier_w(crypto_word_t a) {
#if !defined(OPENSSL_NO_ASM) && (defined(__GNUC__) || defined(__clang__))
#if defined(__GNUC__) || defined(__clang__)
__asm__("" : "+r"(a) : /* no inputs */);
#endif
return a;
@@ -310,7 +310,7 @@ static inline crypto_word_t value_barrier_w(crypto_word_t a) {
// value_barrier_u32 behaves like |value_barrier_w| but takes a |uint32_t|.
static inline uint32_t value_barrier_u32(uint32_t a) {
#if !defined(OPENSSL_NO_ASM) && (defined(__GNUC__) || defined(__clang__))
#if defined(__GNUC__) || defined(__clang__)
__asm__("" : "+r"(a) : /* no inputs */);
#endif
return a;
@@ -318,7 +318,7 @@ static inline uint32_t value_barrier_u32(uint32_t a) {
// value_barrier_u64 behaves like |value_barrier_w| but takes a |uint64_t|.
static inline uint64_t value_barrier_u64(uint64_t a) {
#if !defined(OPENSSL_NO_ASM) && (defined(__GNUC__) || defined(__clang__))
#if defined(__GNUC__) || defined(__clang__)
__asm__("" : "+r"(a) : /* no inputs */);
#endif
return a;