Solved the endianess issue with CPAN's version of Crypt::DES. The code
for this module originally came from www.cryptix.com. I compared the two
files and found where Cryptix had fixed theirs for endianess. I am going
to include the patch below for anyone else who is butting their heads up
against this one--and I will email the maintainer of the Crypt::DES module
in CPAN this patch as well.
(This patch also includes explicit typedefs for u_*_t--which, in my opinion
should be checked for in the perl Makefile.PL step and auto added or not...
Having to explicitly rely on their existence is stupid. So if you get errors
about the first two typedefs that are added below, comment them out and see
if that helps.)
(mikedoug) dinky:~/Crypt-DES-1.01$ rcsdiff -c des.h des.c 2>/dev/null
*** /home/staff/mikedoug/.tmp/T0L3L3Y_ Mon Dec 27 14:23:55 1999
--- des.c Mon Dec 27 14:20:55 1999
***************
*** 443,450 ****
static int i;
static unsigned long * s;
! l=input[0];
! r=input[1];
/* do IP */
PERM_OP(r,l,t, 4,0x0f0f0f0f);
--- 443,450 ----
static int i;
static unsigned long * s;
! c2l( input, l );
! c2l( input, r );
/* do IP */
PERM_OP(r,l,t, 4,0x0f0f0f0f);
***************
*** 505,512 ****
PERM_OP(l,r,t,16,0x0000ffff);
PERM_OP(r,l,t, 4,0x0f0f0f0f);
! output[0]=l;
! output[1]=r;
}
void
--- 505,512 ----
PERM_OP(l,r,t,16,0x0000ffff);
PERM_OP(r,l,t, 4,0x0f0f0f0f);
! l2c( l, output );
! l2c( r, output );
}
void
***************
*** 521,530 ****
k=(unsigned long *)ks;
in=(unsigned char *)userKey;
- /*
c2l(in,c);
c2l(in,d);
- */
/* do PC1 in 60 simple operations */
/* PERM_OP(d,c,t,4,0x0f0f0f0f);
--- 521,528 ----
This archive was generated by hypermail 2.1.3 : Tue Oct 19 2004 - 23:38:00 EDT