summaryrefslogtreecommitdiffstats
path: root/crypto/des/qud_cksm.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>1999-05-16 12:26:16 +0000
committerBodo Möller <bodo@openssl.org>1999-05-16 12:26:16 +0000
commitedf0bfb52b46bb9c8bf44e9c486be60c7087618c (patch)
tree6ad2135e6ba0e639b8938729fd55696605913011 /crypto/des/qud_cksm.c
parente186bf96b433b85fc3a87b3ca2fd6c1929212d72 (diff)
Change type of various DES function arguments from des_cblock
(meaning pointer to char) to des_cblock * (meaning pointer to array with 8 char elements), which allows the compiler to do more typechecking. (The changed argument types were of type des_cblock * back in SSLeay, and a lot of ugly casts were used then to turn them into pointers to elements; but it can be done without those casts.) Introduce new type const_des_cblock -- before, the pointers rather than the elements pointed to were declared const, and for some reason gcc did not complain about this (but some other compilers did).
Diffstat (limited to 'crypto/des/qud_cksm.c')
-rw-r--r--crypto/des/qud_cksm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/crypto/des/qud_cksm.c b/crypto/des/qud_cksm.c
index 09797f2257..6ce8c61b42 100644
--- a/crypto/des/qud_cksm.c
+++ b/crypto/des/qud_cksm.c
@@ -73,8 +73,8 @@
/* Got the value MIT uses via brute force :-) 2/10/90 eay */
#define NOISE ((DES_LONG)83653421L)
-DES_LONG des_quad_cksum(const unsigned char *input, des_cblocks output,
- long length, int out_count, des_cblock seed)
+DES_LONG des_quad_cksum(const unsigned char *input, des_cblock output[],
+ long length, int out_count, des_cblock *seed)
{
DES_LONG z0,z1,t0,t1;
int i;
@@ -83,10 +83,10 @@ DES_LONG des_quad_cksum(const unsigned char *input, des_cblocks output,
unsigned char *lp;
if (out_count < 1) out_count=1;
- lp=output;
+ lp = &(output[0])[0];
- 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]);
+ 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++)
{
@@ -129,7 +129,7 @@ DES_LONG des_quad_cksum(const unsigned char *input, des_cblocks output,
}
else
{
- lp=&output[(out_count-i-1)*8];
+ lp = &(output[out_count-i-1])[0];
l2n(z1,lp);
l2n(z0,lp);
}