Clean up code.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1582 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -63,20 +63,20 @@
|
||||
#define NOISE ((DES_LONG)83653421L)
|
||||
|
||||
DES_LONG des_quad_cksum(input, output, length, out_count, seed)
|
||||
des_cblock (*input);
|
||||
des_cblock (*output);
|
||||
long length;
|
||||
int out_count;
|
||||
des_cblock (*seed);
|
||||
{
|
||||
des_cblock (*input);
|
||||
des_cblock (*output);
|
||||
long length;
|
||||
int out_count;
|
||||
des_cblock (*seed);
|
||||
{
|
||||
DES_LONG z0,z1,t0,t1;
|
||||
int i;
|
||||
long l=0;
|
||||
unsigned char *cp;
|
||||
unsigned char *lp;
|
||||
DES_LONG *lp;
|
||||
|
||||
if (out_count < 1) out_count=1;
|
||||
lp=(unsigned char *)output;
|
||||
lp=(DES_LONG*)output;
|
||||
|
||||
z0=B0((*seed)[0])|B1((*seed)[1])|B2((*seed)[2])|B3((*seed)[3]);
|
||||
z1=B0((*seed)[4])|B1((*seed)[5])|B2((*seed)[6])|B3((*seed)[7]);
|
||||
@@ -107,32 +107,12 @@ des_cblock (*seed);
|
||||
}
|
||||
if (lp != NULL)
|
||||
{
|
||||
/* I believe I finally have things worked out.
|
||||
* The MIT library assumes that the checksum
|
||||
* is one huge number and it is returned in a
|
||||
* host dependant byte order.
|
||||
*/
|
||||
static DES_LONG ltmp=1;
|
||||
static unsigned char *c=(unsigned char *)<mp;
|
||||
|
||||
if (c[0])
|
||||
{
|
||||
l2c(z0,lp);
|
||||
l2c(z1,lp);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if 0
|
||||
lp=output[out_count-i-1];
|
||||
l2n(z1,lp);
|
||||
l2n(z0,lp);
|
||||
#else
|
||||
l2n(z0,lp);
|
||||
l2n(z1,lp);
|
||||
#endif
|
||||
}
|
||||
/* The MIT library assumes that the checksum is
|
||||
* composed of 2*out_count 32 bit ints */
|
||||
*lp++ = z0;
|
||||
*lp++ = z1;
|
||||
}
|
||||
}
|
||||
return(z0);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user