Skip to content

Commit

Permalink
Match byte swap logic with wolfSSL (use WOLF_ALLOW_BUILTIN).
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarske committed Jan 26, 2024
1 parent b27e6c5 commit a2a45d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wolftpm/tpm2_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ static inline word16 ByteReverseWord16(word16 value)

static inline word32 ByteReverseWord32(word32 value)
{
#if !defined(WOLF_NO_BUILTIN) && defined(__GNUC_PREREQ) && __GNUC_PREREQ(4, 3)
#if defined(WOLF_ALLOW_BUILTIN) && defined(__GNUC_PREREQ) && __GNUC_PREREQ(4, 3)
return (word32)__builtin_bswap32(value);
#elif defined(PPC_INTRINSICS)
/* PPC: load reverse indexed instruction */
Expand Down Expand Up @@ -743,7 +743,7 @@ static inline word32 ByteReverseWord32(word32 value)

static inline word64 ByteReverseWord64(word64 value)
{
#if !defined(WOLF_NO_BUILTIN) && defined(__GNUC_PREREQ) && __GNUC_PREREQ(4, 3)
#if defined(WOLF_ALLOW_BUILTIN) && defined(__GNUC_PREREQ) && __GNUC_PREREQ(4, 3)
return (word64)__builtin_bswap64(value);
#else
return (word64)((word64)ByteReverseWord32((word32)value)) << 32 |
Expand Down

0 comments on commit a2a45d2

Please sign in to comment.