aboutsummaryrefslogtreecommitdiff
path: root/src/StormCommon.h
diff options
context:
space:
mode:
authorLadislav Zezula <ladislav.zezula@avast.com>2021-05-17 12:57:54 +0200
committerLadislav Zezula <ladislav.zezula@avast.com>2021-05-17 12:57:54 +0200
commit33bdae86c2345db9514addbf9d5a698eada56fb2 (patch)
treeff40d644d75b5976b051bf6534e459805e9d184c /src/StormCommon.h
parenta3332c7c9bc36f13aace6543ebc719f833882dfc (diff)
Added alignment-aware block encryption/decryption
Diffstat (limited to 'src/StormCommon.h')
-rw-r--r--src/StormCommon.h5
1 files changed, 4 insertions, 1 deletions
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