OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "net/test/channel_id_test_util.h" |
| 6 |
| 7 #include <string> |
| 8 |
| 9 #include "crypto/ec_private_key.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 |
| 12 namespace net { |
| 13 |
| 14 void ExpectKeysEqual(crypto::ECPrivateKey* key1, crypto::ECPrivateKey* key2) { |
| 15 ASSERT_TRUE(key1); |
| 16 ASSERT_TRUE(key2); |
| 17 std::string public_key1, public_key2; |
| 18 EXPECT_TRUE(key1->ExportRawPublicKey(&public_key1)); |
| 19 EXPECT_TRUE(key2->ExportRawPublicKey(&public_key2)); |
| 20 EXPECT_EQ(public_key1, public_key2); |
| 21 } |
| 22 |
| 23 void ExpectKeysNotEqual(crypto::ECPrivateKey* key1, |
| 24 crypto::ECPrivateKey* key2) { |
| 25 ASSERT_TRUE(key1); |
| 26 ASSERT_TRUE(key2); |
| 27 std::string public_key1, public_key2; |
| 28 EXPECT_TRUE(key1->ExportRawPublicKey(&public_key1)); |
| 29 EXPECT_TRUE(key2->ExportRawPublicKey(&public_key2)); |
| 30 EXPECT_NE(public_key1, public_key2); |
| 31 } |
| 32 |
| 33 } // namespace net |
OLD | NEW |