From 7909aa7c23f04dc5dd471824ea04443d96189618 Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Tue, 26 Apr 2016 16:31:38 -0700 Subject: [PATCH] Pass array by reference in newhope speed test. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is another thing that MSVC can't cope with: ..\tool\speed.cc(537) : error C2536: 'SpeedNewHope::<⋯>::SpeedNewHope::<⋯>::clientmsg' : cannot specify explicit initializer for arrays Change-Id: I6b4cb430895f7794e9cef1b1c12b57ba5d537c64 --- tool/speed.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tool/speed.cc b/tool/speed.cc index 46430585..68d78e2b 100644 --- a/tool/speed.cc +++ b/tool/speed.cc @@ -525,12 +525,12 @@ static bool SpeedNewHope(const std::string &selected) { uint8_t clientmsg[NEWHOPE_CLIENTMSG_LENGTH]; RAND_bytes(clientmsg, sizeof(clientmsg)); - if (!TimeFunction(&results, [sk, clientmsg]() -> bool { + if (!TimeFunction(&results, [sk, &clientmsg]() -> bool { uint8_t server_key[SHA256_DIGEST_LENGTH]; uint8_t servermsg[NEWHOPE_SERVERMSG_LENGTH]; NEWHOPE_keygen(servermsg, sk); if (!NEWHOPE_server_compute_key(server_key, sk, clientmsg, - sizeof(clientmsg))) { + NEWHOPE_CLIENTMSG_LENGTH)) { return false; } return true;