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

Side by Side Diff: sky/engine/wtf/CryptographicallyRandomNumber.cpp

Issue 746023002: Make absolute and sort all Sky headers (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « sky/engine/wtf/CryptographicallyRandomNumber.h ('k') | sky/engine/wtf/CurrentTime.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 1996, David Mazieres <dm@uun.org> 2 * Copyright (c) 1996, David Mazieres <dm@uun.org>
3 * Copyright (c) 2008, Damien Miller <djm@openbsd.org> 3 * Copyright (c) 2008, Damien Miller <djm@openbsd.org>
4 * 4 *
5 * Permission to use, copy, modify, and distribute this software for any 5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above 6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies. 7 * copyright notice and this permission notice appear in all copies.
8 * 8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */ 16 */
17 17
18 /* 18 /*
19 * Arc4 random number generator for OpenBSD. 19 * Arc4 random number generator for OpenBSD.
20 * 20 *
21 * This code is derived from section 17.1 of Applied Cryptography, 21 * This code is derived from section 17.1 of Applied Cryptography,
22 * second edition, which describes a stream cipher allegedly 22 * second edition, which describes a stream cipher allegedly
23 * compatible with RSA Labs "RC4" cipher (the actual description of 23 * compatible with RSA Labs "RC4" cipher (the actual description of
24 * which is a trade secret). The same algorithm is used as a stream 24 * which is a trade secret). The same algorithm is used as a stream
25 * cipher called "arcfour" in Tatu Ylonen's ssh package. 25 * cipher called "arcfour" in Tatu Ylonen's ssh package.
26 * 26 *
27 * RC4 is a registered trademark of RSA Laboratories. 27 * RC4 is a registered trademark of RSA Laboratories.
28 */ 28 */
29 29
30 #include "config.h" 30 #include "sky/engine/config.h"
31 #include "wtf/CryptographicallyRandomNumber.h" 31 #include "sky/engine/wtf/CryptographicallyRandomNumber.h"
32 32
33 #include "wtf/StdLibExtras.h" 33 #include "sky/engine/wtf/StdLibExtras.h"
34 #include "wtf/Threading.h" 34 #include "sky/engine/wtf/Threading.h"
35 #include "wtf/ThreadingPrimitives.h" 35 #include "sky/engine/wtf/ThreadingPrimitives.h"
36 36
37 namespace WTF { 37 namespace WTF {
38 38
39 static RandomNumberSource sourceFunction; 39 static RandomNumberSource sourceFunction;
40 40
41 void setRandomSource(RandomNumberSource source) 41 void setRandomSource(RandomNumberSource source)
42 { 42 {
43 sourceFunction = source; 43 sourceFunction = source;
44 } 44 }
45 45
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 { 176 {
177 return sharedRandomNumberGenerator().randomNumber(); 177 return sharedRandomNumberGenerator().randomNumber();
178 } 178 }
179 179
180 void cryptographicallyRandomValues(void* buffer, size_t length) 180 void cryptographicallyRandomValues(void* buffer, size_t length)
181 { 181 {
182 sharedRandomNumberGenerator().randomValues(buffer, length); 182 sharedRandomNumberGenerator().randomValues(buffer, length);
183 } 183 }
184 184
185 } 185 }
OLDNEW
« no previous file with comments | « sky/engine/wtf/CryptographicallyRandomNumber.h ('k') | sky/engine/wtf/CurrentTime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698