diff options
author | Adam Langley <agl@google.com> | 2015-11-18 02:15:05 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-11-18 02:15:05 +0300 |
commit | 3ac32b1eda0da7a99d9c2b6c605fe50af80ccd90 (patch) | |
tree | 0cbf10fef5010f1c0941e50e163eb89392f7117f /tool | |
parent | 4fb0dc4b031df7c9ac9d91fc34536e4e08b35d6a (diff) |
Fix curve25519 code for MSVC.
MSVC doesn't like unary minus on unsigned types. Also, the speed test
always failed because the inputs were all zeros and thus had small
order.
Change-Id: Ic2d3c2c9bd57dc66295d93891396871cebac1e0b
Diffstat (limited to 'tool')
-rw-r--r-- | tool/speed.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tool/speed.cc b/tool/speed.cc index e9584a13..54f3c75e 100644 --- a/tool/speed.cc +++ b/tool/speed.cc @@ -456,6 +456,8 @@ static bool Speed25519(const std::string &selected) { uint8_t out[32], in1[32], in2[32]; memset(in1, 0, sizeof(in1)); memset(in2, 0, sizeof(in2)); + in1[0] = 1; + in2[0] = 9; return X25519(out, in1, in2) == 1; })) { fprintf(stderr, "Curve25519 arbitrary point multiplication failed.\n"); |