comparison libtomcrypt/src/prngs/rng_get_bytes.c @ 435:337c45621e81

merge of 'a9b0496634cdd25647b65e585cc3240f3fa699ee' and 'c22be8b8f570b48e9662dac32c7b3e7148a42206'
author Matt Johnston <matt@ucc.asn.au>
date Thu, 22 Feb 2007 14:53:49 +0000
parents 0cbe8f6dbf9e
children f849a5ca2efc
comparison
equal deleted inserted replaced
434:0aaaf68e97dc 435:337c45621e81
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 $ */