aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cipher/ChangeLog8
-rw-r--r--cipher/blowfish.c6
-rw-r--r--cipher/md5.c4
-rw-r--r--cipher/rmd160.c4
-rw-r--r--cipher/sha1.c4
-rw-r--r--cipher/sha256.c4
-rw-r--r--cipher/sha512.c4
7 files changed, 21 insertions, 13 deletions
diff --git a/cipher/ChangeLog b/cipher/ChangeLog
index e01163631..10f56e1dc 100644
--- a/cipher/ChangeLog
+++ b/cipher/ChangeLog
@@ -1,3 +1,11 @@
+2006-03-19 David Shaw <[email protected]>
+
+ * blowfish.c, md5.c, rmd160.c, sha1.c, sha256.c, sha512.c: Use
+ '#if' rather than '#ifdef' BIG_ENDIAN_HOST. Harmless as we
+ explicitly define BIG_ENDIAN_HOST to 1 when we need it, but needed
+ for OSX fat builds when we define BIG_ENDIAN_HOST to another
+ macro.
+
2006-02-14 Werner Koch <[email protected]>
* random.c (lock_seed_file): Build even when not used.
diff --git a/cipher/blowfish.c b/cipher/blowfish.c
index 1a1ce5678..1d33bbb8d 100644
--- a/cipher/blowfish.c
+++ b/cipher/blowfish.c
@@ -251,7 +251,7 @@ function_F( BLOWFISH_context *bc, u32 x )
{
u16 a, b, c, d;
-#ifdef BIG_ENDIAN_HOST
+#if BIG_ENDIAN_HOST
a = ((byte*)&x)[0];
b = ((byte*)&x)[1];
c = ((byte*)&x)[2];
@@ -267,7 +267,7 @@ function_F( BLOWFISH_context *bc, u32 x )
}
#endif
-#ifdef BIG_ENDIAN_HOST
+#if BIG_ENDIAN_HOST
#define F(x) ((( s0[((byte*)&x)[0]] + s1[((byte*)&x)[1]]) \
^ s2[((byte*)&x)[2]]) + s3[((byte*)&x)[3]] )
#else
@@ -528,7 +528,7 @@ do_bf_setkey( BLOWFISH_context *c, const byte *key, unsigned keylen )
}
for(i=j=0; i < BLOWFISH_ROUNDS+2; i++ ) {
-#ifdef BIG_ENDIAN_HOST
+#if BIG_ENDIAN_HOST
((byte*)&data)[0] = key[j];
((byte*)&data)[1] = key[(j+1)%keylen];
((byte*)&data)[2] = key[(j+2)%keylen];
diff --git a/cipher/md5.c b/cipher/md5.c
index 270e3fe3e..f8bd3abb9 100644
--- a/cipher/md5.c
+++ b/cipher/md5.c
@@ -100,7 +100,7 @@ transform( MD5_CONTEXT *ctx, byte *data )
u32 D = ctx->D;
u32 *cwp = correct_words;
-#ifdef BIG_ENDIAN_HOST
+#if BIG_ENDIAN_HOST
{ int i;
byte *p2, *p1;
for(i=0, p1=data, p2=(byte*)correct_words; i < 16; i++, p2 += 4 ) {
@@ -311,7 +311,7 @@ md5_final( MD5_CONTEXT *hd )
burn_stack (80+6*sizeof(void*));
p = hd->buf;
-#ifdef BIG_ENDIAN_HOST
+#if BIG_ENDIAN_HOST
#define X(a) do { *p++ = hd-> a ; *p++ = hd-> a >> 8; \
*p++ = hd-> a >> 16; *p++ = hd-> a >> 24; } while(0)
#else /* little endian */
diff --git a/cipher/rmd160.c b/cipher/rmd160.c
index 7a7230f38..1f759aa88 100644
--- a/cipher/rmd160.c
+++ b/cipher/rmd160.c
@@ -176,7 +176,7 @@ static void
transform( RMD160_CONTEXT *hd, byte *data )
{
u32 a,b,c,d,e,aa,bb,cc,dd,ee,t;
-#ifdef BIG_ENDIAN_HOST
+#if BIG_ENDIAN_HOST
u32 x[16];
{ int i;
byte *p2, *p1;
@@ -515,7 +515,7 @@ rmd160_final( RMD160_CONTEXT *hd )
burn_stack (108+5*sizeof(void*));
p = hd->buf;
-#ifdef BIG_ENDIAN_HOST
+#if BIG_ENDIAN_HOST
#define X(a) do { *p++ = hd->h##a ; *p++ = hd->h##a >> 8; \
*p++ = hd->h##a >> 16; *p++ = hd->h##a >> 24; } while(0)
#else /* little endian */
diff --git a/cipher/sha1.c b/cipher/sha1.c
index d150fad1e..63d6325da 100644
--- a/cipher/sha1.c
+++ b/cipher/sha1.c
@@ -91,7 +91,7 @@ transform( SHA1_CONTEXT *hd, byte *data )
d = hd->h3;
e = hd->h4;
-#ifdef BIG_ENDIAN_HOST
+#if BIG_ENDIAN_HOST
memcpy( x, data, 64 );
#else
{ int i;
@@ -305,7 +305,7 @@ sha1_final(SHA1_CONTEXT *hd)
burn_stack (88+4*sizeof(void*));
p = hd->buf;
-#ifdef BIG_ENDIAN_HOST
+#if BIG_ENDIAN_HOST
#define X(a) do { *(u32*)p = hd->h##a ; p += 4; } while(0)
#else /* little endian */
#define X(a) do { *p++ = hd->h##a >> 24; *p++ = hd->h##a >> 16; \
diff --git a/cipher/sha256.c b/cipher/sha256.c
index 47c754101..7e864cc73 100644
--- a/cipher/sha256.c
+++ b/cipher/sha256.c
@@ -111,7 +111,7 @@ transform( SHA256_CONTEXT *hd, byte *data )
g = hd->h6;
h = hd->h7;
-#ifdef BIG_ENDIAN_HOST
+#if BIG_ENDIAN_HOST
memcpy( w, data, 64 );
#else
{
@@ -257,7 +257,7 @@ sha256_final(SHA256_CONTEXT *hd)
burn_stack (328);
p = hd->buf;
-#ifdef BIG_ENDIAN_HOST
+#if BIG_ENDIAN_HOST
#define X(a) do { *(u32*)p = hd->h##a ; p += 4; } while(0)
#else /* little endian */
#define X(a) do { *p++ = hd->h##a >> 24; *p++ = hd->h##a >> 16; \
diff --git a/cipher/sha512.c b/cipher/sha512.c
index 523579d25..4b4018941 100644
--- a/cipher/sha512.c
+++ b/cipher/sha512.c
@@ -171,7 +171,7 @@ transform( SHA512_CONTEXT *hd, byte *data )
g = hd->h6;
h = hd->h7;
-#ifdef BIG_ENDIAN_HOST
+#if BIG_ENDIAN_HOST
memcpy( w, data, 128 );
#else
{
@@ -332,7 +332,7 @@ sha512_final(SHA512_CONTEXT *hd)
burn_stack (768);
p = hd->buf;
-#ifdef BIG_ENDIAN_HOST
+#if BIG_ENDIAN_HOST
#define X(a) do { *(u64*)p = hd->h##a ; p += 8; } while(0)
#else /* little endian */
#define X(a) do { *p++ = hd->h##a >> 56; *p++ = hd->h##a >> 48; \