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

Unified Diff: crypto/openpgp_symmetric_encryption.cc

Issue 10698177: Added crypto random-number generator (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed #include/base:: problem Created 8 years, 5 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
« no previous file with comments | « crypto/crypto.gyp ('k') | crypto/p224_spake.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/openpgp_symmetric_encryption.cc
diff --git a/crypto/openpgp_symmetric_encryption.cc b/crypto/openpgp_symmetric_encryption.cc
index 3f37d4c2db1a81d1eb252738e1275b8c2b02d4c6..b163f09c81cc1855e29e59522123365a430a69ff 100644
--- a/crypto/openpgp_symmetric_encryption.cc
+++ b/crypto/openpgp_symmetric_encryption.cc
@@ -12,7 +12,7 @@
#include <vector>
#include "base/logging.h"
-#include "base/rand_util.h"
+#include "crypto/random.h"
#include "crypto/scoped_nss_types.h"
#include "crypto/nss_util.h"
@@ -680,7 +680,8 @@ class Encrypter {
ske.push_back(3); // iterated and salted S2K
ske.push_back(2); // SHA-1
- uint64 salt64 = base::RandUint64();
+ uint64 salt64;
+ crypto::RandBytes(&salt64, sizeof(salt64));
ByteString salt(sizeof(salt64), 0);
// It's a random value, so endianness doesn't matter.
@@ -710,7 +711,7 @@ class Encrypter {
static const unsigned kBlockSize = 16; // AES block size
uint8 prefix[kBlockSize + 2], fre[kBlockSize], iv[kBlockSize];
- base::RandBytes(iv, kBlockSize);
+ crypto::RandBytes(iv, kBlockSize);
memset(fre, 0, sizeof(fre));
ScopedPK11Context aes_context;
« no previous file with comments | « crypto/crypto.gyp ('k') | crypto/p224_spake.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698