diff options
author | Ralf S. Engelschall <rse@openssl.org> | 1998-12-21 11:00:56 +0000 |
---|---|---|
committer | Ralf S. Engelschall <rse@openssl.org> | 1998-12-21 11:00:56 +0000 |
commit | dfeab0689f69c0b4bd3480ffd37a9cacc2f17d9c (patch) | |
tree | 2f74e0cfd76a9e092548a9bf52e579aef984299b /crypto/des/destest.c | |
parent | 58964a492275ca9a59a0cd9c8155cb2491b4b909 (diff) |
Import of old SSLeay release: SSLeay 0.9.1b (unreleased)SSLeay
Diffstat (limited to 'crypto/des/destest.c')
-rw-r--r-- | crypto/des/destest.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/crypto/des/destest.c b/crypto/des/destest.c index 620c13ba6f..5700608b9b 100644 --- a/crypto/des/destest.c +++ b/crypto/des/destest.c @@ -72,6 +72,10 @@ #include <string.h> #include "des.h" +#if defined(PERL5) || defined(__FreeBSD__) +#define crypt(c,s) (des_crypt((c),(s))) +#endif + /* tisk tisk - the test keys don't all have odd parity :-( */ /* test data */ #define NUM_TESTS 34 @@ -660,17 +664,20 @@ plain[8+4], plain[8+5], plain[8+6], plain[8+7]); printf("Doing quad_cksum\n"); cs=quad_cksum((C_Block *)cbc_data,(C_Block *)qret, (long)strlen(cbc_data),2,(C_Block *)cbc_iv); + + { /* Big-endian fix */ + static DES_LONG l=1; + static unsigned char *c=(unsigned char *)&l; + DES_LONG ll; + j=sizeof(lqret[0])-4; for (i=0; i<4; i++) { lqret[i]=0; memcpy(&(lqret[i]),&(qret[i][0]),4); - if (j > 0) lqret[i]=lqret[i]>>(j*8); /* For Cray */ + if (!c[0] && (j > 0)) + lqret[i]=lqret[i]>>(j*8); /* For Cray */ } - { /* Big-endian fix */ - static DES_LONG l=1; - static unsigned char *c=(unsigned char *)&l; - DES_LONG ll; if (!c[0]) { |