Annotation of pgp/src/random.h, revision 1.1.1.4

1.1.1.3   root        1: /*     random.h - Header include file for random.c
                      2:        Last revised 15 Dec 90
                      3:        (c) 1989 Philip Zimmermann.  All rights reserved.
                      4: */
                      5: 
                      6: 
                      7: #include "usuals.h"  /* typedefs for byte, word16, boolean, etc. */
                      8: 
                      9: 
                     10: /*     Don't define PSEUDORANDOM unless you want only pseudorandom numbers.
                     11:        If you do want PSEDORANDOM defined, it's better to define it right 
                     12:        here in this include file because then you can be sure that all the 
                     13:        files that include random.h will be properly affected. */
                     14: /* #define PSEUDORANDOM */
                     15: 
                     16: #ifdef PSEUDORANDOM            /* use pseudorandom numbers */
                     17: #define randombyte()  ((byte) pseudorand())    /* pseudorandom generator */
1.1.1.4 ! root       18: #define randaccum_later(bitcount)              /* null function */
1.1.1.3   root       19: #define randaccum(bitcount)            /* null function */
                     20: #define randload(bitcount)     /* null function */
                     21: #define randflush()            /* null function */
                     22: #define capturecounter()       /* null function */
                     23: #define keypress() kbhit()     /* TRUE iff keyboard input ready */
                     24: #define getkey() getch()       /* returns data from keyboard (no echo). */
                     25: #endif /* ifdef PSEUDORANDOM */
                     26: 
                     27: #ifndef PSEUDORANDOM           /* use truly random numbers */
                     28: 
1.1.1.4 ! root       29: short try_randombyte(void);    /* returns truly random byte, or -1 */
1.1.1.3   root       30: short randombyte(void);        /* returns truly random byte from pool */
                     31: 
                     32: int getstring(char *strbuf,int maxlen,boolean echo);
                     33: 
1.1.1.4 ! root       34: void randaccum_later(short bitcount);  /* get random bits later */
1.1.1.3   root       35: void randaccum(short bitcount);        /* get this many raw random bits ready */
                     36: 
                     37: short randload(short bitcount);
                     38: /* Get fresh load of raw random bits into recyclepool for key generation */
                     39: 
                     40: void randflush(void);  /* flush recycled random bytes */
                     41: 
                     42: #endif                 /* ifndef PSEUDORANDOM */
                     43: 
1.1.1.4 ! root       44: /*     DJGPP includes a getkey() which works, but PGP also uses getkey() to
        !            45:        accumulate random bytes.  To avoid a conflict, getkey is #defined as
        !            46:        pgp_getkey.  You don't really need to know this. */
        !            47: #ifdef __GO32__
        !            48:     #define getkey pgp_getkey
        !            49: #endif
        !            50: 
        !            51: extern void flush_input(void);

unix.superglobalmegacorp.com

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