summaryrefslogtreecommitdiffstats
path: root/secure/lib/libdes/qud_cksm.c
diff options
context:
space:
mode:
Diffstat (limited to 'secure/lib/libdes/qud_cksm.c')
-rw-r--r--secure/lib/libdes/qud_cksm.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/secure/lib/libdes/qud_cksm.c b/secure/lib/libdes/qud_cksm.c
index e2c6ffd..dc74c94 100644
--- a/secure/lib/libdes/qud_cksm.c
+++ b/secure/lib/libdes/qud_cksm.c
@@ -1,5 +1,5 @@
-/* lib/des/qud_cksm.c */
-/* Copyright (C) 1995 Eric Young (eay@mincom.oz.au)
+/* crypto/des/qud_cksm.c */
+/* Copyright (C) 1995-1996 Eric Young (eay@mincom.oz.au)
* All rights reserved.
*
* This file is part of an SSL implementation written
@@ -53,33 +53,33 @@
#include "des_locl.h"
/* bug fix for dos - 7/6/91 - Larry hughes@logos.ucs.indiana.edu */
-#define B0(a) (((unsigned long)(a)))
-#define B1(a) (((unsigned long)(a))<<8)
-#define B2(a) (((unsigned long)(a))<<16)
-#define B3(a) (((unsigned long)(a))<<24)
+#define Q_B0(a) (((DES_LONG)(a)))
+#define Q_B1(a) (((DES_LONG)(a))<<8)
+#define Q_B2(a) (((DES_LONG)(a))<<16)
+#define Q_B3(a) (((DES_LONG)(a))<<24)
/* used to scramble things a bit */
/* Got the value MIT uses via brute force :-) 2/10/90 eay */
-#define NOISE ((unsigned long)83653421L)
+#define NOISE ((DES_LONG)83653421L)
-unsigned long des_quad_cksum(input, output, length, out_count, seed)
+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);
{
- unsigned long z0,z1,t0,t1;
+ DES_LONG z0,z1,t0,t1;
int i;
- long l=0;
+ long l;
unsigned char *cp;
unsigned char *lp;
if (out_count < 1) out_count=1;
lp=(unsigned char *)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]);
+ z0=Q_B0((*seed)[0])|Q_B1((*seed)[1])|Q_B2((*seed)[2])|Q_B3((*seed)[3]);
+ z1=Q_B0((*seed)[4])|Q_B1((*seed)[5])|Q_B2((*seed)[6])|Q_B3((*seed)[7]);
for (i=0; ((i<4)&&(i<out_count)); i++)
{
@@ -89,12 +89,12 @@ des_cblock (*seed);
{
if (l > 1)
{
- t0= (unsigned long)(*(cp++));
- t0|=(unsigned long)B1(*(cp++));
+ t0= (DES_LONG)(*(cp++));
+ t0|=(DES_LONG)Q_B1(*(cp++));
l--;
}
else
- t0= (unsigned long)(*(cp++));
+ t0= (DES_LONG)(*(cp++));
l--;
/* add */
t0+=z0;
@@ -112,7 +112,7 @@ des_cblock (*seed);
* is one huge number and it is returned in a
* host dependant byte order.
*/
- static unsigned long ltmp=1;
+ static DES_LONG ltmp=1;
static unsigned char *c=(unsigned char *)&ltmp;
if (c[0])
OpenPOWER on IntegriCloud