Annotation of truecrypt/common/random.h, revision 1.1.1.18

1.1.1.9   root        1: /*
1.1.1.11  root        2:  Legal Notice: Some portions of the source code contained in this file were
                      3:  derived from the source code of Encryption for the Masses 2.02a, which is
                      4:  Copyright (c) 1998-2000 Paul Le Roux and which is governed by the 'License
                      5:  Agreement for Encryption for the Masses'. Modifications and additions to
1.1.1.17  root        6:  the original source code (contained in this file) and all other portions
                      7:  of this file are Copyright (c) 2003-2009 TrueCrypt Developers Association
1.1.1.18! root        8:  and are governed by the TrueCrypt License 3.0 the full text of which is
1.1.1.17  root        9:  contained in the file License.txt included in TrueCrypt binary and source
                     10:  code distribution packages. */
1.1       root       11: 
1.1.1.7   root       12: 
1.1.1.6   root       13: #include "Crypto.h"
1.1       root       14: 
1.1.1.11  root       15: #ifdef __cplusplus
                     16: extern "C" {
                     17: #endif
                     18: 
1.1.1.6   root       19: /* RNG defines & pool pointers */
1.1.1.18! root       20: #define RNG_POOL_SIZE  320     // Must be divisible by the size of the output of each of the implemented hash functions. (in bytes)
        !            21: 
1.1.1.11  root       22: #if RNG_POOL_SIZE % SHA512_DIGESTSIZE || RNG_POOL_SIZE % WHIRLPOOL_DIGESTSIZE || RNG_POOL_SIZE % RIPEMD160_DIGESTSIZE
1.1.1.6   root       23: #error RNG_POOL_SIZE must be divisible by the size of the output of each of the implemented hash functions.
                     24: #endif
                     25: 
                     26: #define RANDOMPOOL_ALLOCSIZE   RNG_POOL_SIZE
                     27: 
1.1.1.11  root       28: // After every RANDMIX_BYTE_INTERVAL-th byte written to the pool, the pool mixing function is applied to the entire pool
                     29: #define RANDMIX_BYTE_INTERVAL  16
                     30: 
                     31: // FastPoll interval (in milliseconds)
                     32: #define FASTPOLL_INTERVAL              500
                     33: 
1.1.1.8   root       34: void RandAddInt ( unsigned __int32 x );
1.1       root       35: int Randinit ( void );
1.1.1.14  root       36: void RandStop (BOOL freePool);
                     37: BOOL IsRandomNumberGeneratorStarted ();
1.1.1.6   root       38: void RandSetHashFunction ( int hash_algo_id );
                     39: int RandGetHashFunction (void);
1.1.1.14  root       40: void SetRandomPoolEnrichedByUserStatus (BOOL enriched);
                     41: BOOL IsRandomPoolEnrichedByUser ();
1.1.1.8   root       42: BOOL Randmix ( void );
1.1       root       43: void RandaddBuf ( void *buf , int len );
1.1.1.8   root       44: BOOL FastPoll ( void );
                     45: BOOL SlowPoll ( void );
                     46: BOOL RandpeekBytes ( unsigned char *buf , int len );
                     47: BOOL RandgetBytes ( unsigned char *buf , int len, BOOL forceSlowPoll );
                     48: 
                     49: #ifdef _WIN32
                     50: 
                     51: extern BOOL volatile bFastPollEnabled;
                     52: extern BOOL volatile bRandmixEnabled;
                     53: 
1.1       root       54: LRESULT CALLBACK MouseProc ( int nCode , WPARAM wParam , LPARAM lParam );
                     55: LRESULT CALLBACK KeyboardProc ( int nCode , WPARAM wParam , LPARAM lParam );
1.1.1.16  root       56: static unsigned __stdcall PeriodicFastPollThreadProc (void *dummy);
1.1.1.7   root       57: 
                     58: #endif
1.1.1.11  root       59: 
                     60: #ifdef __cplusplus
                     61: }
                     62: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.