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

Unified Diff: crypto/rsa_private_key_unittest.cc

Issue 6805019: Move crypto files out of base, to a top level directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: crypto/rsa_private_key_unittest.cc
===================================================================
--- crypto/rsa_private_key_unittest.cc (revision 79901)
+++ crypto/rsa_private_key_unittest.cc (working copy)
@@ -2,15 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/crypto/rsa_private_key.h"
wtc 2011/04/07 05:35:53 It is correct to include "crypto/rsa_private_key.h
#include "base/memory/scoped_ptr.h"
+#include "crypto/rsa_private_key.h"
#include "testing/gtest/include/gtest/gtest.h"
// Generate random private keys with two different sizes. Reimport, then
// export them again. We should get back the same exact bytes.
TEST(RSAPrivateKeyUnitTest, InitRandomTest) {
- scoped_ptr<base::RSAPrivateKey> keypair1(base::RSAPrivateKey::Create(1024));
- scoped_ptr<base::RSAPrivateKey> keypair2(base::RSAPrivateKey::Create(2048));
+ scoped_ptr<crypto::RSAPrivateKey> keypair1(
+ crypto::RSAPrivateKey::Create(1024));
+ scoped_ptr<crypto::RSAPrivateKey> keypair2(
+ crypto::RSAPrivateKey::Create(2048));
ASSERT_TRUE(keypair1.get());
ASSERT_TRUE(keypair2.get());
@@ -24,10 +26,10 @@
ASSERT_TRUE(keypair1->ExportPublicKey(&pubkey1));
ASSERT_TRUE(keypair2->ExportPublicKey(&pubkey2));
- scoped_ptr<base::RSAPrivateKey> keypair3(
- base::RSAPrivateKey::CreateFromPrivateKeyInfo(privkey1));
- scoped_ptr<base::RSAPrivateKey> keypair4(
- base::RSAPrivateKey::CreateFromPrivateKeyInfo(privkey2));
+ scoped_ptr<crypto::RSAPrivateKey> keypair3(
+ crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(privkey1));
+ scoped_ptr<crypto::RSAPrivateKey> keypair4(
+ crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(privkey2));
ASSERT_TRUE(keypair3.get());
ASSERT_TRUE(keypair4.get());
@@ -159,8 +161,8 @@
input.resize(sizeof(private_key_info));
memcpy(&input.front(), private_key_info, sizeof(private_key_info));
- scoped_ptr<base::RSAPrivateKey> key(
- base::RSAPrivateKey::CreateFromPrivateKeyInfo(input));
+ scoped_ptr<crypto::RSAPrivateKey> key(
+ crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(input));
ASSERT_TRUE(key.get());
std::vector<uint8> output;
@@ -362,10 +364,10 @@
memcpy(&input2.front(), short_integer_without_high_bit,
sizeof(short_integer_without_high_bit));
- scoped_ptr<base::RSAPrivateKey> keypair1(
- base::RSAPrivateKey::CreateFromPrivateKeyInfo(input1));
- scoped_ptr<base::RSAPrivateKey> keypair2(
- base::RSAPrivateKey::CreateFromPrivateKeyInfo(input2));
+ scoped_ptr<crypto::RSAPrivateKey> keypair1(
+ crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(input1));
+ scoped_ptr<crypto::RSAPrivateKey> keypair2(
+ crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(input2));
ASSERT_TRUE(keypair1.get());
ASSERT_TRUE(keypair2.get());

Powered by Google App Engine
This is Rietveld 408576698