MIPS assembly pack: add support for SmartMIPS ASE.
[openssl.git] / crypto / sha / sha.h
index aa4c9dd5d708afa39763a59255882fec4481b427..16cacf9fc01b2733e337493864769ec11e16478f 100644 (file)
@@ -60,6 +60,7 @@
 #define HEADER_SHA_H
 
 #include <openssl/e_os2.h>
+#include <stddef.h>
 
 #ifdef  __cplusplus
 extern "C" {
@@ -69,6 +70,10 @@ extern "C" {
 #error SHA is disabled.
 #endif
 
+#if defined(OPENSSL_FIPS)
+#define FIPS_SHA_SIZE_T size_t
+#endif
+
 /*
  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  * ! SHA_LONG has to be at least 32 bits wide. If it's wider, then !
@@ -76,7 +81,7 @@ extern "C" {
  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  */
 
-#if defined(OPENSSL_SYS_WIN16) || defined(__LP32__)
+#if defined(__LP32__)
 #define SHA_LONG unsigned long
 #elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
 #define SHA_LONG unsigned long
@@ -97,7 +102,7 @@ typedef struct SHAstate_st
        SHA_LONG h0,h1,h2,h3,h4;
        SHA_LONG Nl,Nh;
        SHA_LONG data[SHA_LBLOCK];
-       int num;
+       unsigned int num;
        } SHA_CTX;
 
 #ifndef OPENSSL_NO_SHA0
@@ -126,7 +131,7 @@ typedef struct SHA256state_st
        SHA_LONG h[8];
        SHA_LONG Nl,Nh;
        SHA_LONG data[SHA_LBLOCK];
-       int num;
+       unsigned int num,md_len;
        } SHA256_CTX;
 
 #ifndef OPENSSL_NO_SHA256
@@ -144,6 +149,7 @@ void SHA256_Transform(SHA256_CTX *c, const unsigned char *data);
 #define SHA384_DIGEST_LENGTH   48
 #define SHA512_DIGEST_LENGTH   64
 
+#ifndef OPENSSL_NO_SHA512
 /*
  * Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64
  * being exactly 64-bit wide. See Implementation Notes in sha512.c
@@ -155,6 +161,9 @@ void SHA256_Transform(SHA256_CTX *c, const unsigned char *data);
 #if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
 #define SHA_LONG64 unsigned __int64
 #define U64(C)     C##UI64
+#elif defined(__arch64__)
+#define SHA_LONG64 unsigned long
+#define U64(C)     C##UL
 #else
 #define SHA_LONG64 unsigned long long
 #define U64(C)     C##ULL
@@ -168,8 +177,9 @@ typedef struct SHA512state_st
                SHA_LONG64      d[SHA_LBLOCK];
                unsigned char   p[SHA512_CBLOCK];
        } u;
-       int num;
+       unsigned int num,md_len;
        } SHA512_CTX;
+#endif
 
 #ifndef OPENSSL_NO_SHA512
 int SHA384_Init(SHA512_CTX *c);