diff options
author | Ulf Möller <ulf@openssl.org> | 1999-05-05 00:23:53 +0000 |
---|---|---|
committer | Ulf Möller <ulf@openssl.org> | 1999-05-05 00:23:53 +0000 |
commit | 8e7f966bf3579629ce553f9512ee6952588c02a4 (patch) | |
tree | 56a280158be8a9da490d215564792ca4a4967553 /crypto/sha/sha.h | |
parent | 744029c15470a6b16e9645a16c76bbff15be7596 (diff) |
SHA-1 cleanups and performance enhancements.
Submitted by: Andy Polyakov <appro@fy.chalmers.se>
Diffstat (limited to 'crypto/sha/sha.h')
-rw-r--r-- | crypto/sha/sha.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/crypto/sha/sha.h b/crypto/sha/sha.h index ba40aafc13..cd6960ee1a 100644 --- a/crypto/sha/sha.h +++ b/crypto/sha/sha.h @@ -67,18 +67,28 @@ extern "C" { #error SHA is disabled. #endif -#define SHA_CBLOCK 64 -#define SHA_LBLOCK 16 -#define SHA_BLOCK 16 -#define SHA_LAST_BLOCK 56 -#define SHA_LENGTH_BLOCK 8 -#define SHA_DIGEST_LENGTH 20 +/* + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * ! SHA_LONG has to be at least 32 bits wide. If it's wider, then ! + * ! SHA_LONG_LOG2 has to be defined along. ! + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + */ -#ifdef WIN16 +#if defined(WIN16) || defined(__LP32__) +#define SHA_LONG unsigned long +#elif defined(_CRAY) || defined(__ILP64__) #define SHA_LONG unsigned long +#define SHA_LONG_LOG2 3 #else #define SHA_LONG unsigned int -#endif +#endif + +#define SHA_LBLOCK 16 +#define SHA_CBLOCK (SHA_LBLOCK*4) /* SHA treats input data as a + * contiguous array of 32 bit + * wide big-endian values. */ +#define SHA_LAST_BLOCK (SHA_CBLOCK-8) +#define SHA_DIGEST_LENGTH 20 typedef struct SHAstate_st { |