Skip to content

Commit

Permalink
Fix BE platforms by updating endianness macros to match upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
apoelstra authored and jonasnick committed Oct 12, 2020
1 parent d1b13b0 commit 8b70795
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/modules/rangeproof/borromean_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
#include <limits.h>
#include <string.h>

#ifdef WORDS_BIGENDIAN
#if defined(SECP256K1_BIG_ENDIAN)
#define BE32(x) (x)
#else
#elif defined(SECP256K1_LITTLE_ENDIAN)
#define BE32(p) ((((p) & 0xFF) << 24) | (((p) & 0xFF00) << 8) | (((p) & 0xFF0000) >> 8) | (((p) & 0xFF000000) >> 24))
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/scalar_4x64_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -974,9 +974,9 @@ static SECP256K1_INLINE void secp256k1_scalar_cmov(secp256k1_scalar *r, const se
a += b; d = ROTL32(d ^ a, 8); \
c += d; b = ROTL32(b ^ c, 7);

#ifdef WORDS_BIGENDIAN
#if defined(SECP256K1_BIG_ENDIAN)
#define LE32(p) ((((p) & 0xFF) << 24) | (((p) & 0xFF00) << 8) | (((p) & 0xFF0000) >> 8) | (((p) & 0xFF000000) >> 24))
#else
#elif defined(SECP256K1_LITTLE_ENDIAN)
#define LE32(p) (p)
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/scalar_8x32_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -753,9 +753,9 @@ static SECP256K1_INLINE void secp256k1_scalar_cmov(secp256k1_scalar *r, const se
a += b; d = ROTL32(d ^ a, 8); \
c += d; b = ROTL32(b ^ c, 7);

#ifdef WORDS_BIGENDIAN
#if defined(SECP256K1_BIG_ENDIAN)
#define LE32(p) ((((p) & 0xFF) << 24) | (((p) & 0xFF00) << 8) | (((p) & 0xFF0000) >> 8) | (((p) & 0xFF000000) >> 24))
#else
#elif defined(SECP256K1_LITTLE_ENDIAN)
#define LE32(p) (p)
#endif

Expand Down

0 comments on commit 8b70795

Please sign in to comment.