comparison src/prngs/rng_get_bytes.c @ 381:999a5eb4ed10 libtomcrypt-dropbear

propagate from branch 'au.asn.ucc.matt.ltc.orig' (head 52840647ac7f5c707c3bd158d119a15734a7ef28) to branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
author Matt Johnston <matt@ucc.asn.au>
date Thu, 11 Jan 2007 02:39:21 +0000
parents d5faf4814ddb
children
comparison
equal deleted inserted replaced
281:997e6f7dc01e 381:999a5eb4ed10
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 $ */