Fixed a bug for BE architectures (#1478)

Fixed a bug in the internal implementation of libgcrypt for bigendian architectures
This commit is contained in:
Vitaly Lavrov
2022-03-05 11:44:21 +01:00
committed by GitHub
parent a173d3e98f
commit 438f04066b
3 changed files with 3 additions and 20 deletions
+2 -2
View File
@@ -94,9 +94,9 @@
#elif defined(__BIG_ENDIAN__) || defined(__BIG_ENDIAN)
#define MBEDTLS_GET_UINT32_LE(b,i) htonl(*(uint32_t *) (&(b)[(i)]))
#define MBEDTLS_GET_UINT32_LE(b,i) bswap_32(*(uint32_t *) (&(b)[(i)]))
#define MBEDTLS_GET_UINT32_BE(b,i) (*(uint32_t *) (&(b)[(i)]))
#define MBEDTLS_PUT_UINT32_LE(n,b,i) *(uint32_t *) (&(b)[(i)]) = htonl(n);
#define MBEDTLS_PUT_UINT32_LE(n,b,i) *(uint32_t *) (&(b)[(i)]) = bswap_32(n);
#define MBEDTLS_PUT_UINT64_BE(n,b,i) *(uint64_t *) (&(b)[(i)]) = (n);
#else