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

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
        !             6:  the original source code (contained in this file) and all other portions of
        !             7:  this file are Copyright (c) 2003-2008 TrueCrypt Foundation and are governed
        !             8:  by the TrueCrypt License 2.4 the full text of which is contained in the
        !             9:  file License.txt included in TrueCrypt binary and source code distribution
1.1.1.9   root       10:  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 );
                     35: void Randfree ( void );
1.1.1.6   root       36: void RandSetHashFunction ( int hash_algo_id );
                     37: int RandGetHashFunction (void);
1.1.1.8   root       38: BOOL Randmix ( void );
1.1       root       39: void RandaddBuf ( void *buf , int len );
1.1.1.8   root       40: BOOL FastPoll ( void );
                     41: BOOL SlowPoll ( void );
                     42: BOOL RandpeekBytes ( unsigned char *buf , int len );
                     43: BOOL RandgetBytes ( unsigned char *buf , int len, BOOL forceSlowPoll );
                     44: 
                     45: #ifdef _WIN32
                     46: 
                     47: extern BOOL volatile bFastPollEnabled;
                     48: extern BOOL volatile bRandmixEnabled;
                     49: 
1.1       root       50: LRESULT CALLBACK MouseProc ( int nCode , WPARAM wParam , LPARAM lParam );
                     51: LRESULT CALLBACK KeyboardProc ( int nCode , WPARAM wParam , LPARAM lParam );
                     52: void ThreadSafeThreadFunction ( void *dummy );
1.1.1.7   root       53: 
                     54: #endif
1.1.1.11! root       55: 
        !            56: #ifdef __cplusplus
        !            57: }
        !            58: #endif

unix.superglobalmegacorp.com

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