Skip to content

Commit

Permalink
Bug 1536734 - Don't endian-swap on big endian machines, r=jcj
Browse files Browse the repository at this point in the history
Summary:
Identity works in that case.

Reviewers: jcj

Tags: #secure-revision

Bug #: 1536734

Differential Revision: https://phabricator.services.mozilla.com/D24128

--HG--
extra : rebase_source : 50cd2037e9dc3fb3d6adbd97d7a2d69357977437
  • Loading branch information
martinthomson committed Mar 20, 2019
1 parent b7b584f commit 7ac4b63
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/freebl/crypto_primitives.h
Expand Up @@ -34,6 +34,7 @@
/*
* FREEBL_HTONLL(x): swap bytes in a 64-bit integer.
*/
#if defined(IS_LITTLE_ENDIAN)
#if defined(_MSC_VER)

#pragma intrinsic(_byteswap_uint64)
Expand All @@ -57,4 +58,8 @@ PRUint64 swap8b(PRUint64 x);

#endif /* _MSC_VER */

#else /* IS_LITTLE_ENDIAN */
#define FREEBL_HTONLL(x) (x)
#endif

#endif /* HAVE_LONG_LONG */

0 comments on commit 7ac4b63

Please sign in to comment.