Pass array by reference in newhope speed test.

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
This commit is contained in:
Adam Langley 2016-04-26 16:31:38 -07:00
parent e75f0530a0
commit 7909aa7c23

View File

@ -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;