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

Unified Diff: base/rand_util.h

Issue 10698177: Added crypto random-number generator (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Use WriteInto 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 | « no previous file | crypto/crypto.gyp » ('j') | crypto/random.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/rand_util.h
diff --git a/base/rand_util.h b/base/rand_util.h
index c5c4ef88114427a8ddf8ddebdd9499422e2f14fe..9c1f2060b873ebf93ee9a500d1366fa2c13ef1cc 100644
--- a/base/rand_util.h
+++ b/base/rand_util.h
@@ -32,12 +32,16 @@ BASE_EXPORT double RandDouble();
// the range [0, 1). Thread-safe.
BASE_EXPORT double BitsToOpenEndedUnitInterval(uint64 bits);
-// Fills |output_length| bytes of |output| with cryptographically strong random
-// data.
+// Fills |output_length| bytes of |output| with random data.
+// Note: The random data is cryptographically secure, but use the RNG in crypto/
+// for security-sensitive purposes instead of this function.
Ryan Sleevi 2012/07/31 23:03:48 nit: I'm mixed on specifically referencing crypto/
Mehrdad 2012/07/31 23:36:33 I feel that not saying this function is cryptograp
Ryan Sleevi 2012/08/01 17:08:55 My view of the motivation of crypto::RandBytes() i
Mehrdad 2012/08/01 17:19:03 No, I agree, RandBytes should definitely be in cry
BASE_EXPORT void RandBytes(void* output, size_t output_length);
-// Fills a string of length |length| with with cryptographically strong random
-// data and returns it. |length| should be nonzero.
+// Fills a string of length |length| with with random data and returns it.
+// |length| should be nonzero.
+//
+// Note: The random data is cryptographically secure, but use the RNG in crypto/
+// for security-sensitive purposes instead of this function.
//
// Note that this is a variation of |RandBytes| with a different return type.
BASE_EXPORT std::string RandBytesAsString(size_t length);
« no previous file with comments | « no previous file | crypto/crypto.gyp » ('j') | crypto/random.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698