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

Side by Side Diff: openssl/crypto/rand/rand_nw.c

Issue 9254031: Upgrade chrome's OpenSSL to same version Android ships with. (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/openssl/
Patch Set: '' Created 8 years, 11 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 | « openssl/crypto/rand/rand_lib.c ('k') | openssl/crypto/rand/rand_os2.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* crypto/rand/rand_nw.c */ 1 /* crypto/rand/rand_nw.c */
2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * This package is an SSL implementation written 5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com). 6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL. 7 * The implementation was written so as to conform with Netscapes SSL.
8 * 8 *
9 * This library is free for commercial and non-commercial use as long as 9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions 10 * the following conditions are aheared to. The following conditions
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 RAND_add(&l,sizeof(l),1); 153 RAND_add(&l,sizeof(l),1);
154 154
155 for( i=2; i<ENTROPY_NEEDED; i++) 155 for( i=2; i<ENTROPY_NEEDED; i++)
156 { 156 {
157 #ifdef __MWERKS__ 157 #ifdef __MWERKS__
158 asm 158 asm
159 { 159 {
160 rdtsc 160 rdtsc
161 mov tsc, eax 161 mov tsc, eax
162 } 162 }
163 #else 163 #elif defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(O PENSSL_NO_INLINE_ASM)
164 asm volatile("rdtsc":"=A" (tsc)); 164 asm volatile("rdtsc":"=a"(tsc)::"edx");
165 #endif 165 #endif
166 166
167 RAND_add(&tsc, sizeof(tsc), 1); 167 RAND_add(&tsc, sizeof(tsc), 1);
168 168
169 l = GetSuperHighResolutionTimer(); 169 l = GetSuperHighResolutionTimer();
170 RAND_add(&l, sizeof(l), 0); 170 RAND_add(&l, sizeof(l), 0);
171 171
172 # if defined(NETWARE_LIBC) 172 # if defined(NETWARE_LIBC)
173 NXThreadYield(); 173 NXThreadYield();
174 # else /* NETWARE_CLIB */ 174 # else /* NETWARE_CLIB */
175 ThreadSwitchWithDelay(); 175 ThreadSwitchWithDelay();
176 # endif 176 # endif
177 } 177 }
178 178
179 return 1; 179 return 1;
180 } 180 }
181 181
182 #endif 182 #endif
183 183
OLDNEW
« no previous file with comments | « openssl/crypto/rand/rand_lib.c ('k') | openssl/crypto/rand/rand_os2.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698