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

Side by Side Diff: mozilla/security/nss/lib/freebl/sysrand.c

Issue 14249009: Change the NSS and NSPR source tree to the new directory structure to be (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mozilla/security/nss/lib/freebl/shvfy.c ('k') | mozilla/security/nss/lib/freebl/tlsprfalg.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 #ifdef FREEBL_NO_DEPEND
6 #include "stubs.h"
7 #endif
8
9 #include "seccomon.h"
10
11 static size_t rng_systemFromNoise(unsigned char *dest, size_t maxLen);
12
13 #if defined(XP_UNIX) || defined(XP_BEOS)
14 #include "unix_rand.c"
15 #endif
16 #ifdef XP_WIN
17 #include "win_rand.c"
18 #endif
19 #ifdef XP_OS2
20 #include "os2_rand.c"
21 #endif
22
23 /*
24 * Normal RNG_SystemRNG() isn't available, use the system noise to collect
25 * the required amount of entropy.
26 */
27 static size_t
28 rng_systemFromNoise(unsigned char *dest, size_t maxLen)
29 {
30 size_t retBytes = maxLen;
31
32 while (maxLen) {
33 size_t nbytes = RNG_GetNoise(dest, maxLen);
34
35 PORT_Assert(nbytes != 0);
36
37 dest += nbytes;
38 maxLen -= nbytes;
39
40 /* some hw op to try to introduce more entropy into the next
41 * RNG_GetNoise call */
42 rng_systemJitter();
43 }
44 return retBytes;
45 }
46
OLDNEW
« no previous file with comments | « mozilla/security/nss/lib/freebl/shvfy.c ('k') | mozilla/security/nss/lib/freebl/tlsprfalg.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698