From 33bdae86c2345db9514addbf9d5a698eada56fb2 Mon Sep 17 00:00:00 2001 From: Ladislav Zezula Date: Mon, 17 May 2021 12:57:54 +0200 Subject: Added alignment-aware block encryption/decryption --- src/StormCommon.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/StormCommon.h') diff --git a/src/StormCommon.h b/src/StormCommon.h index ff14a32..e9187f9 100644 --- a/src/StormCommon.h +++ b/src/StormCommon.h @@ -67,8 +67,11 @@ #define STORMLIB_MAX(a, b) ((a > b) ? a : b) #define STORMLIB_UNUSED(p) ((void)(p)) +// Checks for data pointers aligned to 4-byte boundary +#define STORMLIB_DWORD_ALIGNED(ptr) (((size_t)(ptr) & 0x03) == 0) + // Macro for building 64-bit file offset from two 32-bit -#define MAKE_OFFSET64(hi, lo) (((ULONGLONG)hi << 32) | (ULONGLONG)lo) +#define MAKE_OFFSET64(hi, lo) (((ULONGLONG)hi << 32) | (ULONGLONG)lo) //----------------------------------------------------------------------------- // MTYPE definition - specifies what kind of MPQ is the map type -- cgit v1.2.3