1#include "prism/internal/memequal.h"
5pm_memequal_256(
const unsigned char *a,
const unsigned char *b) {
6 uint64_t left[4], right[4];
7 memcpy(left, a,
sizeof(left));
8 memcpy(right, b,
sizeof(right));
10 uint64_t difference = 0;
11 for (
size_t idx = 0; idx < 4; ++idx) {
12 difference |= left[idx] ^ right[idx];
20pm_memequal_long(
const unsigned char *a,
const unsigned char *b,
size_t length) {
22 while (length - offset >= 32) {
23 if (!pm_memequal_256(a + offset, b + offset))
return false;
27 const size_t last = length - 8;
28 while (offset < last) {
29 if (!pm_memequal_64(a + offset, b + offset))
return false;
33 return pm_memequal_64(a + last, b + last);
#define PRISM_INLINE
Old Visual Studio versions do not support the inline keyword, so we need to define it to be __inline.