Updated to libdes 4.01
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1923 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,17 +1,22 @@
|
||||
/* lib/des/qud_cksm.c */
|
||||
/* Copyright (C) 1995 Eric Young (eay@mincom.oz.au)
|
||||
/* crypto/des/qud_cksm.c */
|
||||
/* Copyright (C) 1995-1997 Eric Young (eay@mincom.oz.au)
|
||||
* All rights reserved.
|
||||
*
|
||||
* This file is part of an SSL implementation written
|
||||
*
|
||||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@mincom.oz.au).
|
||||
* The implementation was written so as to conform with Netscapes SSL
|
||||
* specification. This library and applications are
|
||||
* FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
|
||||
* as long as the following conditions are aheared to.
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@mincom.oz.au).
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed. If this code is used in a product,
|
||||
* Eric Young should be given attribution as the author of the parts used.
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
@@ -25,7 +30,13 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Eric Young (eay@mincom.oz.au)
|
||||
* "This product includes cryptographic software written by
|
||||
* Eric Young (eay@mincom.oz.au)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@mincom.oz.au)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
@@ -53,10 +64,10 @@
|
||||
#include "des_locl.h"
|
||||
|
||||
/* bug fix for dos - 7/6/91 - Larry hughes@logos.ucs.indiana.edu */
|
||||
#define B0(a) (((DES_LONG)(a)))
|
||||
#define B1(a) (((DES_LONG)(a))<<8)
|
||||
#define B2(a) (((DES_LONG)(a))<<16)
|
||||
#define B3(a) (((DES_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 */
|
||||
@@ -71,7 +82,7 @@ DES_LONG des_quad_cksum(input, output, length, out_count, seed)
|
||||
{
|
||||
DES_LONG z0,z1,t0,t1;
|
||||
int i;
|
||||
long l=0;
|
||||
long l;
|
||||
#ifdef _CRAY
|
||||
typedef struct {
|
||||
unsigned int a:32;
|
||||
@@ -86,8 +97,8 @@ DES_LONG des_quad_cksum(input, output, length, out_count, seed)
|
||||
if (out_count < 1) out_count=1;
|
||||
lp=(XXX*)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++)
|
||||
{
|
||||
@@ -98,7 +109,7 @@ DES_LONG des_quad_cksum(input, output, length, out_count, seed)
|
||||
if (l > 1)
|
||||
{
|
||||
t0= (DES_LONG)(*(cp++));
|
||||
t0|=(DES_LONG)B1(*(cp++));
|
||||
t0|=(DES_LONG)Q_B1(*(cp++));
|
||||
l--;
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user