Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: crypto/curve25519_unittest.cc

Issue 1539353003: Switch to standard integer types in crypto/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « crypto/curve25519_openssl.cc ('k') | crypto/ec_private_key.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "crypto/curve25519.h" 5 #include "crypto/curve25519.h"
6 6
7 #include <stdint.h>
8
7 #include <string> 9 #include <string>
8 10
9 #include "crypto/random.h" 11 #include "crypto/random.h"
10 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
11 13
12 namespace crypto { 14 namespace crypto {
13 15
14 // Test that the basic shared key exchange identity holds: that both parties end 16 // Test that the basic shared key exchange identity holds: that both parties end
15 // up with the same shared key. This test starts with a fixed private key for 17 // up with the same shared key. This test starts with a fixed private key for
16 // two parties: alice and bob. Runs ScalarBaseMult and ScalarMult to compute 18 // two parties: alice and bob. Runs ScalarBaseMult and ScalarMult to compute
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 0xb1, 0xfd, 0x86, 0x62, 0x05, 0x16, 0x5f, 0x49, 0xb8, 50 0xb1, 0xfd, 0x86, 0x62, 0x05, 0x16, 0x5f, 0x49, 0xb8,
49 }; 51 };
50 52
51 uint8_t out[32], private_key[32]; 53 uint8_t out[32], private_key[32];
52 memset(private_key, 0x11, sizeof(private_key)); 54 memset(private_key, 0x11, sizeof(private_key));
53 55
54 EXPECT_FALSE(curve25519::ScalarMult(private_key, kSmallOrderPoint, out)); 56 EXPECT_FALSE(curve25519::ScalarMult(private_key, kSmallOrderPoint, out));
55 } 57 }
56 58
57 } // namespace crypto 59 } // namespace crypto
OLDNEW
« no previous file with comments | « crypto/curve25519_openssl.cc ('k') | crypto/ec_private_key.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698