commit | 0c61efe6da4dd29556e9d2bf7321d2f9283a4e13 | [log] [tgz] |
---|---|---|
author | Pete Bentley <prb@google.com> | Tue Aug 13 09:32:23 2019 +0100 |
committer | Pete Bentley <prb@google.com> | Tue Aug 13 10:27:15 2019 +0100 |
tree | 207a60c135efaef5dfec5f7b3343034555943fc0 | |
parent | dd42a613176ed39d12be02cf21aeae057d9ef6e6 [diff] [blame] |
external/boringssl: Sync to bc2a2013e03754a89a701739a7b58c422391efa2. Third time's the charm. This includes the following changes: https://boringssl.googlesource.com/boringssl/+log/c9827e073f64e353c4891ecc2c73721882543ee0..bc2a2013e03754a89a701739a7b58c422391efa2 Test: atest CtsLibcoreTestCases Test: atest CtsLibcoreOkHttpTestCases Change-Id: I7943c83d12237ec6e4dc54fb3d5a9cecb909e6e7
diff --git a/src/crypto/constant_time_test.cc b/src/crypto/constant_time_test.cc index 59a7bb1..ae80003 100644 --- a/src/crypto/constant_time_test.cc +++ b/src/crypto/constant_time_test.cc
@@ -153,3 +153,19 @@ } } } + +TEST(ConstantTimeTest, ValueBarrier) { + for (int i = 0; i < 10; i++) { + crypto_word_t word; + RAND_bytes(reinterpret_cast<uint8_t *>(&word), sizeof(word)); + EXPECT_EQ(word, value_barrier_w(word)); + + uint32_t u32; + RAND_bytes(reinterpret_cast<uint8_t *>(&u32), sizeof(u32)); + EXPECT_EQ(u32, value_barrier_u32(u32)); + + uint64_t u64; + RAND_bytes(reinterpret_cast<uint8_t *>(&u64), sizeof(u64)); + EXPECT_EQ(u64, value_barrier_u64(u64)); + } +}