Category : C Source Code
Archive   : PGP20SRC.ZIP
Filename : RANDOM.H

 
Output of file : RANDOM.H contained in archive : PGP20SRC.ZIP
/* random.h - Header include file for random.c
Last revised 15 Dec 90
(c) 1989 Philip Zimmermann. All rights reserved.
*/


#include "usuals.h" /* typedefs for byte, word16, boolean, etc. */

int pseudorand(void); /* 16-bit LCG pseudorandom generator */

/* Don't define PSEUDORANDOM unless you want only pseudorandom numbers.
If you do want PSEDORANDOM defined, it's better to define it right
here in this include file because then you can be sure that all the
files that include random.h will be properly affected. */
/* #define PSEUDORANDOM */

#ifdef PSEUDORANDOM /* use pseudorandom numbers */
#define randombyte() ((byte) pseudorand()) /* pseudorandom generator */
#define randaccum(bitcount) /* null function */
#define randload(bitcount) /* null function */
#define randflush() /* null function */
#define capturecounter() /* null function */
#define keypress() kbhit() /* TRUE iff keyboard input ready */
#define getkey() getch() /* returns data from keyboard (no echo). */
#endif /* ifdef PSEUDORANDOM */

#ifndef PSEUDORANDOM /* use truly random numbers */

extern int randcount; /* number of random bytes accumulated in pool */

void capturecounter(void); /* capture a fast counter into the random pool. */
/* Should be called when the user clicks the mouse, or from getkey(). */

short randombyte(void); /* returns truly random byte from pool */

int getstring(char *strbuf,int maxlen,boolean echo);

void randaccum(short bitcount); /* get this many raw random bits ready */

short randload(short bitcount);
/* Get fresh load of raw random bits into recyclepool for key generation */

void randflush(void); /* flush recycled random bytes */

boolean keypress(void); /* TRUE iff keyboard input ready */
#ifndef AMIGA
short getkey(void); /* returns data from keyboard (no echo). */
#endif /* !AMIGA */

#endif /* ifndef PSEUDORANDOM */



  3 Responses to “Category : C Source Code
Archive   : PGP20SRC.ZIP
Filename : RANDOM.H

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/