summaryrefslogtreecommitdiffstats
path: root/crypto/random.h
diff options
context:
space:
mode:
authormniknami@chromium.org <mniknami@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-02 20:22:25 +0000
committermniknami@chromium.org <mniknami@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-02 20:22:25 +0000
commit9b2057825d45aab8c753c5764228f8e8a069e470 (patch)
tree5a64a7de6c123f4548b9ee7e3cb312db8dfa7779 /crypto/random.h
parentbebe1d02eb8b14a6e7db2cce1a6d13f556a5390f (diff)
downloadchromium_src-9b2057825d45aab8c753c5764228f8e8a069e470.zip
chromium_src-9b2057825d45aab8c753c5764228f8e8a069e470.tar.gz
chromium_src-9b2057825d45aab8c753c5764228f8e8a069e470.tar.bz2
Added crypto random-number generator
Added a cryptographic random-number generator to crypto/. Modified sync to use this function instead. May also be used by Cloud Print in the future. Review URL: https://chromiumcodereview.appspot.com/10698177 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149689 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'crypto/random.h')
-rw-r--r--crypto/random.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/crypto/random.h b/crypto/random.h
new file mode 100644
index 0000000..cdbe8a9
--- /dev/null
+++ b/crypto/random.h
@@ -0,0 +1,21 @@
+// 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.
+
+#ifndef CRYPTO_RANDOM_H_
+#define CRYPTO_RANDOM_H_
+
+#include <stdlib.h>
+
+#include "crypto/crypto_export.h"
+
+namespace crypto {
+
+// Fills the given buffer with |length| random bytes of cryptographically
+// secure random numbers.
+// |length| must be positive.
+CRYPTO_EXPORT void RandBytes(void *bytes, size_t length);
+
+}
+
+#endif