From 2526c66b72892b32e0477aef124915d8590e9762 Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Wed, 12 Dec 2018 09:50:56 -0800 Subject: [PATCH] Fix bug in HRSS tests. I moved the |poly3_rand| code into a function and omitted to update a |sizeof|. Change-Id: I861fac4fe26ee3b5e5116d5cee71e64d9af9d175 Reviewed-on: https://boringssl-review.googlesource.com/c/33564 Reviewed-by: Adam Langley Commit-Queue: Adam Langley --- crypto/hrss/hrss_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/hrss/hrss_test.cc b/crypto/hrss/hrss_test.cc index d23e68e5..b37456ca 100644 --- a/crypto/hrss/hrss_test.cc +++ b/crypto/hrss/hrss_test.cc @@ -76,7 +76,7 @@ TEST(HRSS, Poly2RotateRight) { // poly3_rand sets |r| to a random value (albeit with bias). static void poly3_rand(poly3 *p) { - RAND_bytes(reinterpret_cast(p), sizeof(p)); + RAND_bytes(reinterpret_cast(p), sizeof(poly3)); p->s.v[WORDS_PER_POLY - 1] &= (UINT64_C(1) << BITS_IN_LAST_WORD) - 1; p->a.v[WORDS_PER_POLY - 1] &= (UINT64_C(1) << BITS_IN_LAST_WORD) - 1; // (s, a) = (1, 1) is invalid. Map those to one.