--- truecrypt/common/random.h 2018/04/24 16:44:46 1.1.1.7 +++ truecrypt/common/random.h 2018/04/24 16:46:35 1.1.1.9 @@ -1,13 +1,13 @@ -/* Legal Notice: The source code contained in this file has been derived from - the source code of Encryption for the Masses 2.02a, which is Copyright (c) - 1998-99 Paul Le Roux and which is covered by the 'License Agreement for - Encryption for the Masses'. Modifications and additions to that source code - contained in this file are Copyright (c) 2004-2006 TrueCrypt Foundation and - Copyright (c) 2004 TrueCrypt Team, and are covered by TrueCrypt License 2.0 - the full text of which is contained in the file License.txt included in - TrueCrypt binary and source code distribution archives. */ +/* + Legal Notice: The source code contained in this file has been derived from + the source code of Encryption for the Masses 2.02a, which is Copyright (c) + Paul Le Roux and which is covered by the 'License Agreement for Encryption + for the Masses'. Modifications and additions to that source code contained + in this file are Copyright (c) TrueCrypt Foundation and are covered by the + TrueCrypt License 2.2 the full text of which is contained in the file + License.txt included in TrueCrypt binary and source code distribution + packages. */ -#ifdef _WIN32 #include "Crypto.h" @@ -19,23 +19,25 @@ #define RANDOMPOOL_ALLOCSIZE RNG_POOL_SIZE -extern BOOL volatile bFastPollEnabled; -extern BOOL volatile bRandmixEnabled; - -_inline void _RandaddInt32 ( unsigned __int32 x ); +void RandAddInt ( unsigned __int32 x ); int Randinit ( void ); void Randfree ( void ); void RandSetHashFunction ( int hash_algo_id ); int RandGetHashFunction (void); -void Randmix ( void ); +BOOL Randmix ( void ); void RandaddBuf ( void *buf , int len ); +BOOL FastPoll ( void ); +BOOL SlowPoll ( void ); +BOOL RandpeekBytes ( unsigned char *buf , int len ); +BOOL RandgetBytes ( unsigned char *buf , int len, BOOL forceSlowPoll ); + +#ifdef _WIN32 + +extern BOOL volatile bFastPollEnabled; +extern BOOL volatile bRandmixEnabled; + LRESULT CALLBACK MouseProc ( int nCode , WPARAM wParam , LPARAM lParam ); LRESULT CALLBACK KeyboardProc ( int nCode , WPARAM wParam , LPARAM lParam ); void ThreadSafeThreadFunction ( void *dummy ); -void SlowPollWinNT ( void ); -void FastPoll ( void ); #endif - -BOOL RandpeekBytes ( unsigned char *buf , int len ); -BOOL RandgetBytes ( unsigned char *buf , int len, BOOL forceSlowPoll );