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

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
        !             8:  and are governed by the TrueCrypt License 2.8 the full text of which is
        !             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.11  root       20: #define RNG_POOL_SIZE  640     // Must be divisible by the size of the output of each of the implemented hash functions. (in bytes)
                     21: #if RNG_POOL_SIZE % SHA512_DIGESTSIZE || RNG_POOL_SIZE % WHIRLPOOL_DIGESTSIZE || RNG_POOL_SIZE % RIPEMD160_DIGESTSIZE
1.1.1.6   root       22: #error RNG_POOL_SIZE must be divisible by the size of the output of each of the implemented hash functions.
                     23: #endif
                     24: 
                     25: #define RANDOMPOOL_ALLOCSIZE   RNG_POOL_SIZE
                     26: 
1.1.1.11  root       27: // After every RANDMIX_BYTE_INTERVAL-th byte written to the pool, the pool mixing function is applied to the entire pool
                     28: #define RANDMIX_BYTE_INTERVAL  16
                     29: 
                     30: // FastPoll interval (in milliseconds)
                     31: #define FASTPOLL_INTERVAL              500
                     32: 
1.1.1.8   root       33: void RandAddInt ( unsigned __int32 x );
1.1       root       34: int Randinit ( void );
1.1.1.14  root       35: void RandStop (BOOL freePool);
                     36: BOOL IsRandomNumberGeneratorStarted ();
1.1.1.6   root       37: void RandSetHashFunction ( int hash_algo_id );
                     38: int RandGetHashFunction (void);
1.1.1.14  root       39: void SetRandomPoolEnrichedByUserStatus (BOOL enriched);
                     40: BOOL IsRandomPoolEnrichedByUser ();
1.1.1.8   root       41: BOOL Randmix ( void );
1.1       root       42: void RandaddBuf ( void *buf , int len );
1.1.1.8   root       43: BOOL FastPoll ( void );
                     44: BOOL SlowPoll ( void );
                     45: BOOL RandpeekBytes ( unsigned char *buf , int len );
                     46: BOOL RandgetBytes ( unsigned char *buf , int len, BOOL forceSlowPoll );
                     47: 
                     48: #ifdef _WIN32
                     49: 
                     50: extern BOOL volatile bFastPollEnabled;
                     51: extern BOOL volatile bRandmixEnabled;
                     52: 
1.1       root       53: LRESULT CALLBACK MouseProc ( int nCode , WPARAM wParam , LPARAM lParam );
                     54: LRESULT CALLBACK KeyboardProc ( int nCode , WPARAM wParam , LPARAM lParam );
1.1.1.16  root       55: static unsigned __stdcall PeriodicFastPollThreadProc (void *dummy);
1.1.1.7   root       56: 
                     57: #endif
1.1.1.11  root       58: 
                     59: #ifdef __cplusplus
                     60: }
                     61: #endif

unix.superglobalmegacorp.com

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