Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/5105)
size_t size
) DECAF_NONNULL DECAF_API_VIS;
-/** Compare two buffers, returning DECAF_TRUE if they are equal. */
-decaf_bool_t decaf_memeq (
- const void *data1,
- const void *data2,
- size_t size
-) DECAF_NONNULL DECAF_WARN_UNUSED DECAF_API_VIS;
#ifdef __cplusplus
} /* extern "C" */
*destroy = 0;
#endif
}
-
-decaf_bool_t decaf_memeq (
- const void *data1_,
- const void *data2_,
- size_t size
-) {
- const unsigned char *data1 = (const unsigned char *)data1_;
- const unsigned char *data2 = (const unsigned char *)data2_;
- unsigned char ret = 0;
- for (; size; size--, data1++, data2++) {
- ret |= *data1 ^ *data2;
- }
- return (((decaf_dword_t)ret) - 1) >> 8;
-}