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

Unified Diff: crypto/random.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/random.h ('k') | crypto/random_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/random.cc
diff --git a/crypto/random.cc b/crypto/random.cc
new file mode 100644
index 0000000000000000000000000000000000000000..641e23f71ef3359893ac4ca0ac6421ff4277e381
--- /dev/null
+++ b/crypto/random.cc
@@ -0,0 +1,19 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "crypto/random.h"
+
+#include "base/rand_util.h"
+
+namespace crypto {
+
+void RandBytes(void *bytes, size_t length) {
+ // It's OK to call base::RandBytes(), because it's already strongly random.
+ // But _other_ code should go through this function to ensure that code which
+ // needs secure randomness is easily discoverable.
+ base::RandBytes(bytes, length);
+}
+
+} // namespace crypto
+
« no previous file with comments | « crypto/random.h ('k') | crypto/random_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698