1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 07:28:10 +00:00

fix(crypto): fix undefined behaviour of IS_ALIGNED_64 macro

This commit is contained in:
Ondřej Vejpustek 2021-11-08 17:12:43 +01:00
parent fb88db41a0
commit f96e737ef5

View File

@ -27,7 +27,7 @@
#define I64(x) x##LL
#define ROTL64(qword, n) ((qword) << (n) ^ ((qword) >> (64 - (n))))
#define le2me_64(x) (x)
#define IS_ALIGNED_64(p) (0 == (7 & ((const char*)(p) - (const char*)0)))
#define IS_ALIGNED_64(p) (0 == (((uintptr_t)(const void *)(p) & 0x7)))
# define me64_to_le_str(to, from, length) memcpy((to), (from), (length))
/* constants */