diff options
Diffstat (limited to 'src/lib/libcrypto/des/qud_cksm.c')
-rw-r--r-- | src/lib/libcrypto/des/qud_cksm.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/src/lib/libcrypto/des/qud_cksm.c b/src/lib/libcrypto/des/qud_cksm.c index 6ce8c61b42..5f0ec5387f 100644 --- a/src/lib/libcrypto/des/qud_cksm.c +++ b/src/lib/libcrypto/des/qud_cksm.c | |||
@@ -80,10 +80,14 @@ DES_LONG des_quad_cksum(const unsigned char *input, des_cblock output[], | |||
80 | int i; | 80 | int i; |
81 | long l; | 81 | long l; |
82 | const unsigned char *cp; | 82 | const unsigned char *cp; |
83 | unsigned char *lp; | 83 | #ifdef _CRAY |
84 | short *lp; | ||
85 | #else | ||
86 | DES_LONG *lp; | ||
87 | #endif | ||
84 | 88 | ||
85 | if (out_count < 1) out_count=1; | 89 | if (out_count < 1) out_count=1; |
86 | lp = &(output[0])[0]; | 90 | lp = (DES_LONG *) &(output[0])[0]; |
87 | 91 | ||
88 | z0=Q_B0((*seed)[0])|Q_B1((*seed)[1])|Q_B2((*seed)[2])|Q_B3((*seed)[3]); | 92 | z0=Q_B0((*seed)[0])|Q_B1((*seed)[1])|Q_B2((*seed)[2])|Q_B3((*seed)[3]); |
89 | z1=Q_B0((*seed)[4])|Q_B1((*seed)[5])|Q_B2((*seed)[6])|Q_B3((*seed)[7]); | 93 | z1=Q_B0((*seed)[4])|Q_B1((*seed)[5])|Q_B2((*seed)[6])|Q_B3((*seed)[7]); |
@@ -114,25 +118,10 @@ DES_LONG des_quad_cksum(const unsigned char *input, des_cblock output[], | |||
114 | } | 118 | } |
115 | if (lp != NULL) | 119 | if (lp != NULL) |
116 | { | 120 | { |
117 | /* I believe I finally have things worked out. | 121 | /* The MIT library assumes that the checksum is |
118 | * The MIT library assumes that the checksum | 122 | * composed of 2*out_count 32 bit ints */ |
119 | * is one huge number and it is returned in a | 123 | *lp++ = z0; |
120 | * host dependant byte order. | 124 | *lp++ = z1; |
121 | */ | ||
122 | static DES_LONG ltmp=1; | ||
123 | static unsigned char *c=(unsigned char *)<mp; | ||
124 | |||
125 | if (c[0]) | ||
126 | { | ||
127 | l2c(z0,lp); | ||
128 | l2c(z1,lp); | ||
129 | } | ||
130 | else | ||
131 | { | ||
132 | lp = &(output[out_count-i-1])[0]; | ||
133 | l2n(z1,lp); | ||
134 | l2n(z0,lp); | ||
135 | } | ||
136 | } | 125 | } |
137 | } | 126 | } |
138 | return(z0); | 127 | return(z0); |