comparison libtomcrypt/src/prngs/rng_get_bytes.c @ 382:0cbe8f6dbf9e

propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f) to branch 'au.asn.ucc.matt.dropbear' (head 02c413252c90e9de8e03d91e9939dde3029f5c0a)
author Matt Johnston <matt@ucc.asn.au>
date Thu, 11 Jan 2007 02:41:05 +0000
parents 1b9e69c058d2
children f849a5ca2efc
comparison
equal deleted inserted replaced
379:b66a00272a90 382:0cbe8f6dbf9e
4 * algorithms in a highly modular and flexible manner. 4 * algorithms in a highly modular and flexible manner.
5 * 5 *
6 * The library is free for all purposes without any express 6 * The library is free for all purposes without any express
7 * guarantee it works. 7 * guarantee it works.
8 * 8 *
9 * Tom St Denis, [email protected], http://libtomcrypt.org 9 * Tom St Denis, [email protected], http://libtomcrypt.com
10 */ 10 */
11 #include "tomcrypt.h" 11 #include "tomcrypt.h"
12 12
13 /** 13 /**
14 @file rng_get_bytes.c 14 @file rng_get_bytes.c
48 } 48 }
49 49
50 #endif /* DEVRANDOM */ 50 #endif /* DEVRANDOM */
51 51
52 /* on ANSI C platforms with 100 < CLOCKS_PER_SEC < 10000 */ 52 /* on ANSI C platforms with 100 < CLOCKS_PER_SEC < 10000 */
53 #if defined(CLOCKS_PER_SEC) 53 #if defined(CLOCKS_PER_SEC) && !defined(WINCE)
54 54
55 #define ANSI_RNG 55 #define ANSI_RNG
56 56
57 static unsigned long rng_ansic(unsigned char *buf, unsigned long len, 57 static unsigned long rng_ansic(unsigned char *buf, unsigned long len,
58 void (*callback)(void)) 58 void (*callback)(void))
85 } 85 }
86 86
87 #endif 87 #endif
88 88
89 /* Try the Microsoft CSP */ 89 /* Try the Microsoft CSP */
90 #ifdef WIN32 90 #if defined(WIN32) || defined(WINCE)
91 #define _WIN32_WINNT 0x0400 91 #define _WIN32_WINNT 0x0400
92 #ifdef WINCE
93 #define UNDER_CE
94 #define ARM
95 #endif
92 #include <windows.h> 96 #include <windows.h>
93 #include <wincrypt.h> 97 #include <wincrypt.h>
94 98
95 static unsigned long rng_win32(unsigned char *buf, unsigned long len, 99 static unsigned long rng_win32(unsigned char *buf, unsigned long len,
96 void (*callback)(void)) 100 void (*callback)(void))
138 #endif 142 #endif
139 return 0; 143 return 0;
140 } 144 }
141 145
142 /* $Source: /cvs/libtom/libtomcrypt/src/prngs/rng_get_bytes.c,v $ */ 146 /* $Source: /cvs/libtom/libtomcrypt/src/prngs/rng_get_bytes.c,v $ */
143 /* $Revision: 1.3 $ */ 147 /* $Revision: 1.5 $ */
144 /* $Date: 2005/05/05 14:35:59 $ */ 148 /* $Date: 2006/12/06 02:01:29 $ */