This distribution has been tested as part of the cpan-testers
effort to test as many new uploads to CPAN as possible. See
http://testers.cpan.org/
Please cc any replies to [EMAIL PROTECTED] to keep other
test volunteers informed and to prevent any duplicate effort.
--
[ insert comments here ]
There is a patch needed to build on Wind*ows:
PATCH:
======
diff -urNw Crypt-IDEA-1.01-orig/MANIFEST Crypt-IDEA-1.01/MANIFEST
--- Crypt-IDEA-1.01-orig/MANIFEST Sat May 22 20:30:47 1999
+++ Crypt-IDEA-1.01/MANIFEST Thu Aug 23 13:31:18 2001
@@ -4,7 +4,7 @@
IDEA.xs
MANIFEST
Makefile.PL
-idea.c
+_idea.c
idea.h
test.pl
typemap
diff -urNw Crypt-IDEA-1.01-orig/Makefile.PL Crypt-IDEA-1.01/Makefile.PL
--- Crypt-IDEA-1.01-orig/Makefile.PL Sat May 22 20:41:27 1999
+++ Crypt-IDEA-1.01/Makefile.PL Thu Aug 23 13:39:06 2001
@@ -7,7 +7,8 @@
'NAME' => 'Crypt::IDEA',
'DISTNAME' => 'Crypt-IDEA',
'VERSION' => '1.01',
- 'OBJECT' => 'IDEA.o idea.o',
+ 'OBJECT' => 'IDEA.o _idea.o',
+ 'DEFINE' => '-DPERL_POLLUTE',
'dist' => {COMPRESS=>'gzip', SUFFIX=>'gz'}
);
diff -urNw Crypt-IDEA-1.01-orig/_idea.c Crypt-IDEA-1.01/_idea.c
--- Crypt-IDEA-1.01-orig/_idea.c Thu Jan 1 00:00:00 1970
+++ Crypt-IDEA-1.01/_idea.c Thu Aug 23 13:30:23 2001
@@ -0,0 +1,188 @@
+/*
+ * Copyright (C) 1995, 1996 Systemics Ltd (http://www.systemics.com/)
+ * All rights reserved.
+ */
+
+#include "idea.h"
+
+#include <sys/param.h>
+
+#define KEYS_PER_ROUND 6
+#define ROUNDS 8
+#define KEYLEN (KEYS_PER_ROUND*ROUNDS+4)
+
+/*
+ * Multiplication modulo (2**16)+1
+ */
+static u_int16_t
+mul(u_int16_t a, u_int16_t b)
+{
+ int32_t p;
+
+ if (a)
+ {
+ if (b)
+ {
+ p = a * b;
+ b = p & 0xFFFF;
+ a = p >> 16;
+ return b - a + (b < a);
+ }
+ else
+ return (1 - a);
+ }
+ return (1 - b);
+}
+
+
+/*
+ * Compute inverse of x, modulo (2**16)+1, using Euclidean gcd algorithm
+ */
+static u_int16_t
+inv(u_int16_t x)
+{
+ u_int16_t t0, t1, q, y;
+
+ if (x <= 1) /* Since zero and one are self inverse */
+ return x;
+
+ t1 = 0x10001L / x; /* Since x >= 2, the result is 16bit */
+ y = 0x10001L % x;
+ if (y == 1)
+ return ((1 - t1) & 0xFFFF);
+
+ t0 = 1;
+ do
+ {
+ q = x / y;
+ x %= y;
+ t0 += q * t1;
+ if (x == 1)
+ return t0;
+ q = y / x;
+ y = y % x;
+ t1 += q * t0;
+ } while (y != 1);
+
+ return (1-t1);
+}
+
+
+/*
+ * Encryption and decryption
+ */
+void
+idea_crypt(u_int16_t * in, u_int16_t * out, u_int16_t * key)
+{
+ int i = ROUNDS;
+ u_int16_t x0, x1, x2, x3, t0, t1;
+
+ x0 = *(in++);
+ x1 = *(in++);
+ x2 = *(in++);
+ x3 = *(in);
+
+#if (BYTE_ORDER == LITTLE_ENDIAN)
+ x0 = x0 >> 8 | x0 << 8;
+ x1 = x1 >> 8 | x1 << 8;
+ x2 = x2 >> 8 | x2 << 8;
+ x3 = x3 >> 8 | x3 << 8;
+#endif
+
+ do {
+ x0 = mul(x0, *(key++));
+ x1 += *(key++);
+ x2 += *(key++);
+ x3 = mul(x3, *(key++));
+
+ t0 = x2;
+ x2 = mul(x0^x2, *(key++));
+ t1 = x1;
+ x1 = mul((x1^x3)+x2, *(key++));
+ x2 += x1;
+
+ x0 ^= x1;
+ x3 ^= x2;
+ x1 ^= t0;
+ x2 ^= t1;
+
+ } while (--i);
+
+ x0 = mul(x0, *(key++));
+ t0 = x1;
+ x1 = x2 + *(key++);
+ x2 = t0 + *(key++);
+ x3 = mul(x3, *key);
+
+#if (BYTE_ORDER == LITTLE_ENDIAN)
+ x0 = x0 >> 8 | x0 << 8;
+ x1 = x1 >> 8 | x1 << 8;
+ x2 = x2 >> 8 | x2 << 8;
+ x3 = x3 >> 8 | x3 << 8;
+#endif
+
+ *(out++) = x0;
+ *(out++) = x1;
+ *(out++) = x2;
+ *(out) = x3;
+}
+
+
+/*
+ * Create decryption key
+ */
+void
+idea_invert_key(u_int16_t * key, u_int16_t * invKey)
+{
+ int i;
+
+ invKey[KEYS_PER_ROUND * ROUNDS + 0] = inv(*(key++));
+ invKey[KEYS_PER_ROUND * ROUNDS + 1] = -*(key++);
+ invKey[KEYS_PER_ROUND * ROUNDS + 2] = -*(key++);
+ invKey[KEYS_PER_ROUND * ROUNDS + 3] = inv(*(key++));
+
+ for (i = KEYS_PER_ROUND * (ROUNDS-1); i >= 0; i -= KEYS_PER_ROUND)
+ {
+ invKey[i+4] = *(key++);
+ invKey[i+5] = *(key++);
+ invKey[i+0] = inv(*(key++));
+ if (i > 0)
+ {
+ invKey[i+2] = -*(key++);
+ invKey[i+1] = -*(key++);
+ }
+ else
+ {
+ invKey[i+1] = -*(key++);
+ invKey[i+2] = -*(key++);
+ }
+ invKey[i+3]=inv(*(key++));
+ }
+}
+
+
+/*
+ * Expand user key of 128 bits to full of 832 bits
+ */
+void
+idea_expand_key(u_int16_t * userKey, u_int16_t * key)
+{
+ int i, j;
+
+#if (BYTE_ORDER == LITTLE_ENDIAN)
+ for(i = 0; i < 8; i++)
+ key[i] = userKey[i] << 8 | userKey[i] >> 8;
+#else
+ for(i = 0; i < 8; i++)
+ key[i] = userKey[i];
+#endif
+
+ j = 0;
+ for(; i < KEYLEN; i++)
+ {
+ j++;
+ key[j+7] = (key[j & 7] << 9 | key[(j+1) & 7] >> 7);
+ key += j & 8;
+ j &= 7;
+ }
+}
diff -urNw Crypt-IDEA-1.01-orig/idea.c Crypt-IDEA-1.01/idea.c
--- Crypt-IDEA-1.01-orig/idea.c Sat May 22 20:30:47 1999
+++ Crypt-IDEA-1.01/idea.c Thu Jan 1 00:00:00 1970
@@ -1,188 +0,0 @@
-/*
- * Copyright (C) 1995, 1996 Systemics Ltd (http://www.systemics.com/)
- * All rights reserved.
- */
-
-#include "idea.h"
-
-#include <endian.h>
-
-#define KEYS_PER_ROUND 6
-#define ROUNDS 8
-#define KEYLEN (KEYS_PER_ROUND*ROUNDS+4)
-
-/*
- * Multiplication modulo (2**16)+1
- */
-static u_int16_t
-mul(u_int16_t a, u_int16_t b)
-{
- int32_t p;
-
- if (a)
- {
- if (b)
- {
- p = a * b;
- b = p & 0xFFFF;
- a = p >> 16;
- return b - a + (b < a);
- }
- else
- return (1 - a);
- }
- return (1 - b);
-}
-
-
-/*
- * Compute inverse of x, modulo (2**16)+1, using Euclidean gcd algorithm
- */
-static u_int16_t
-inv(u_int16_t x)
-{
- u_int16_t t0, t1, q, y;
-
- if (x <= 1) /* Since zero and one are self inverse */
- return x;
-
- t1 = 0x10001L / x; /* Since x >= 2, the result is 16bit */
- y = 0x10001L % x;
- if (y == 1)
- return ((1 - t1) & 0xFFFF);
-
- t0 = 1;
- do
- {
- q = x / y;
- x %= y;
- t0 += q * t1;
- if (x == 1)
- return t0;
- q = y / x;
- y = y % x;
- t1 += q * t0;
- } while (y != 1);
-
- return (1-t1);
-}
-
-
-/*
- * Encryption and decryption
- */
-void
-idea_crypt(u_int16_t * in, u_int16_t * out, u_int16_t * key)
-{
- int i = ROUNDS;
- u_int16_t x0, x1, x2, x3, t0, t1;
-
- x0 = *(in++);
- x1 = *(in++);
- x2 = *(in++);
- x3 = *(in);
-
-#if (BYTE_ORDER == LITTLE_ENDIAN)
- x0 = x0 >> 8 | x0 << 8;
- x1 = x1 >> 8 | x1 << 8;
- x2 = x2 >> 8 | x2 << 8;
- x3 = x3 >> 8 | x3 << 8;
-#endif
-
- do {
- x0 = mul(x0, *(key++));
- x1 += *(key++);
- x2 += *(key++);
- x3 = mul(x3, *(key++));
-
- t0 = x2;
- x2 = mul(x0^x2, *(key++));
- t1 = x1;
- x1 = mul((x1^x3)+x2, *(key++));
- x2 += x1;
-
- x0 ^= x1;
- x3 ^= x2;
- x1 ^= t0;
- x2 ^= t1;
-
- } while (--i);
-
- x0 = mul(x0, *(key++));
- t0 = x1;
- x1 = x2 + *(key++);
- x2 = t0 + *(key++);
- x3 = mul(x3, *key);
-
-#if (BYTE_ORDER == LITTLE_ENDIAN)
- x0 = x0 >> 8 | x0 << 8;
- x1 = x1 >> 8 | x1 << 8;
- x2 = x2 >> 8 | x2 << 8;
- x3 = x3 >> 8 | x3 << 8;
-#endif
-
- *(out++) = x0;
- *(out++) = x1;
- *(out++) = x2;
- *(out) = x3;
-}
-
-
-/*
- * Create decryption key
- */
-void
-idea_invert_key(u_int16_t * key, u_int16_t * invKey)
-{
- int i;
-
- invKey[KEYS_PER_ROUND * ROUNDS + 0] = inv(*(key++));
- invKey[KEYS_PER_ROUND * ROUNDS + 1] = -*(key++);
- invKey[KEYS_PER_ROUND * ROUNDS + 2] = -*(key++);
- invKey[KEYS_PER_ROUND * ROUNDS + 3] = inv(*(key++));
-
- for (i = KEYS_PER_ROUND * (ROUNDS-1); i >= 0; i -= KEYS_PER_ROUND)
- {
- invKey[i+4] = *(key++);
- invKey[i+5] = *(key++);
- invKey[i+0] = inv(*(key++));
- if (i > 0)
- {
- invKey[i+2] = -*(key++);
- invKey[i+1] = -*(key++);
- }
- else
- {
- invKey[i+1] = -*(key++);
- invKey[i+2] = -*(key++);
- }
- invKey[i+3]=inv(*(key++));
- }
-}
-
-
-/*
- * Expand user key of 128 bits to full of 832 bits
- */
-void
-idea_expand_key(u_int16_t * userKey, u_int16_t * key)
-{
- int i, j;
-
-#if (BYTE_ORDER == LITTLE_ENDIAN)
- for(i = 0; i < 8; i++)
- key[i] = userKey[i] << 8 | userKey[i] >> 8;
-#else
- for(i = 0; i < 8; i++)
- key[i] = userKey[i];
-#endif
-
- j = 0;
- for(; i < KEYLEN; i++)
- {
- j++;
- key[j+7] = (key[j & 7] << 9 | key[(j+1) & 7] >> 7);
- key += j & 8;
- j &= 7;
- }
-}
END OF PATCH
--
Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
Platform:
osname=cygwin, osvers=1.3.2(0.3932), archname=cygwin-multi
uname='cygwin_nt-4.0 loreley 1.3.2(0.3932) 2001-05-20 23:28 i686 unknown '
config_args='-de -Dusemultiplicity'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=define
useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
Compiler:
cc='gcc', ccflags ='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing
-I/usr/local/include',
optimize='-O2',
cppflags='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='2.95.3-5 (cygwin special)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
alignbytes=8, usemymalloc=y, prototype=define
Linker and Libraries:
ld='ld2', ldflags =' -s -L/usr/local/lib'
libpth=/usr/local/lib /usr/lib /lib
libs=-lgdbm -lcrypt
perllibs=-lcrypt
libc=/usr/lib/libc.a, so=dll, useshrplib=true, libperl=libperl5_6_1.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' -s'
cccdlflags=' ', lddlflags=' -s -L/usr/local/lib'