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
diff --git a/tool/speed.cc b/tool/speed.cc
index 4643058..68d78e2 100644
--- a/tool/speed.cc
+++ b/tool/speed.cc
@@ -525,12 +525,12 @@
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;