Article View: sci.crypt
Article #2068Re: URNG
From: Robert Cain
Date: Sat, 21 Nov 1992 16:27
Date: Sat, 21 Nov 1992 16:27
47 lines
1815 bytes
1815 bytes
I should have attributed that IDEA code fragment to Richard De Moliner
of the Swiss Federal Institute of Technology. Now that I think about
it it probably would be fine to seed the dataIn with all zeros and
begin the URNG stream with the first output. Only the key then would
need be known by two people to generate the same stream.
I forgot the Mul() function and some constants. They are included below.
Bob
#define mulMod 0x10001 /* 2**16 + 1 */
#define addMod 0x10000 /* 2**16 */
#define ones 0xFFFF /* 2**16 - 1 */
#define nofKeyPerRound 6 /* number of used keys per round */
#define nofRound 8 /* number of rounds */
/* multiplication */
u_int32 Mul(a, b)
u_int32 a, b;
{
int32 p;
u_int32 q;
if (a == 0)
p = mulMod - b;
else if (b == 0)
p = mulMod - a;
else
{
q = a * b;
p = (q & ones) - (q >> 16);
if (p <= 0)
p += mulMod;
}
return (u_int32)(p & ones);
} /* Mul */
--
Bob Cain rcain@netcom.com 408-358-2007
"There are some strings. They're just not attached."
Victoria Roberts
PGP 1.0 or 2.0 public key available on request.
Technical Details
Message-ID:
<1992Nov21.162754.26769@netcom.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!umn.edu!csus.edu!netcom.com!rcainReferences:
<By1C9x.3K1@chinet.chi.il.us>Show Full Headers
Complete Article Headers
Newsgroups: sci.crypt Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!umn.edu!csus.edu!netcom.com!rcain From: rcain@netcom.com (Robert Cain) Subject: Re: URNG Message-ID: <1992Nov21.162754.26769@netcom.com> Organization: Netcom - Online Communication Services (408 241-9760 guest) References: <By1C9x.3K1@chinet.chi.il.us> Date: Sat, 21 Nov 1992 16:27:54 GMT Lines: 47