X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/07871354bfa8bbbacb6c6a1966f25b596119c146..8cd9f01dac408893755906282d79284c1ee7ddd6:/lcrand.h diff --git a/lcrand.h b/lcrand.h index 24429c6..080370c 100644 --- a/lcrand.h +++ b/lcrand.h @@ -1,13 +1,13 @@ /* -*-c-*- * - * $Id: lcrand.h,v 1.1 1999/12/10 23:15:27 mdw Exp $ + * $Id: lcrand.h,v 1.3 2004/04/08 01:36:15 mdw Exp $ * * Simple linear congruential generator * * (c) 1999 Straylight/Edgeware */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Catacomb. * @@ -15,33 +15,18 @@ * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. - * + * * Catacomb is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. - * + * * You should have received a copy of the GNU Library General Public * License along with Catacomb; if not, write to the Free * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: lcrand.h,v $ - * Revision 1.1 1999/12/10 23:15:27 mdw - * Noncryptographic random number generator. - * - */ - -#ifndef CATACOMB_LCRAND_H -#define CATACOMB_LCRAND_H - -#ifdef __cplusplus - extern "C" { -#endif - /*----- Notes on the linear congruential generator ------------------------* * * This pseudorandom number generator is simple, but has absolutely no @@ -49,7 +34,10 @@ * are required but cryptographic strength is not, for example when * generating numbers for use in primality tests. To be honest, it's not * even particularly fast, although a certain amount of effort has been - * expended on making it better than awfully slow. + * expended on making it better than awfully slow. To put things in + * perspective, it can't quite spit bytes out as fast as OFB DES. (Then + * again, bytes aren't its natural output format.) Its main use is probably + * seeding a Fibonacci generator. * * There exists a fixed-point input @LCRAND_FIXEDPT@ -- when fed to the * generator it comes straight back out again. All other inputs less than @@ -65,6 +53,13 @@ * The fixed point value is determined as %$c / (1 - a) \bmod p$%. */ +#ifndef CATACOMB_LCRAND_H +#define CATACOMB_LCRAND_H + +#ifdef __cplusplus + extern "C" { +#endif + /*----- Header files ------------------------------------------------------*/ #include