Temporary workaround for IRIX64 build.
[openssl.git] / crypto / sha / sha_dgst.c
index d90f497763be9a00cdfb7b46aaece74ad97aeb38..f4aa5a51442c540ca8c01071e3587f78ba60e37a 100644 (file)
@@ -211,7 +211,7 @@ void SHA_Update(SHA_CTX *c, const register unsigned char *data,
                data+=SHA_CBLOCK;
                sha_block(c,p=c->data,1);
                len-=SHA_CBLOCK;
-#else  /* little-endian */
+#elif defined(L_ENDIAN)
 #define BE_COPY(dst,src,i)     {                               \
                                l = ((SHA_LONG *)src)[i];       \
                                Endian_Reverse32(l);            \
@@ -269,17 +269,18 @@ void SHA_Update(SHA_CTX *c, const register unsigned char *data,
 void SHA_Transform(SHA_CTX *c, unsigned char *b)
        {
        SHA_LONG p[SHA_LBLOCK];
-       SHA_LONG *q;
-       int i;
 
 #if SHA_LONG_LOG2==2
 #if defined(B_ENDIAN) || defined(SHA_ASM)
        memcpy(p,b,SHA_CBLOCK);
        sha_block(c,p,1);
        return;
-#else
+#elif defined(L_ENDIAN)
        if (((unsigned long)b%sizeof(SHA_LONG)) == 0)
                {
+               SHA_LONG *q;
+               int i;
+
                q=p;
                for (i=(SHA_LBLOCK/4); i; i--)
                        {
@@ -297,16 +298,21 @@ void SHA_Transform(SHA_CTX *c, unsigned char *b)
 #endif
 #endif
 #ifndef SHA_NO_TAIL_CODE /* defined above, see comment */
-       q=p;
-       for (i=(SHA_LBLOCK/4); i; i--)
                {
-               SHA_LONG l;
-               c2nl(b,l); *(q++)=l;
-               c2nl(b,l); *(q++)=l;
-               c2nl(b,l); *(q++)=l;
-               c2nl(b,l); *(q++)=l; 
-               } 
-       sha_block(c,p,1);
+               SHA_LONG *q;
+               int i;
+
+               q=p;
+               for (i=(SHA_LBLOCK/4); i; i--)
+                       {
+                       SHA_LONG l;
+                       c2nl(b,l); *(q++)=l;
+                       c2nl(b,l); *(q++)=l;
+                       c2nl(b,l); *(q++)=l;
+                       c2nl(b,l); *(q++)=l; 
+                       } 
+               sha_block(c,p,1);
+               }
 #endif
        }