const_time_eq_bin() function
const_time_eq_bin - Constant time memory comparison @a: First buffer to compare @b: Second buffer to compare @len: Number of octets to compare Returns: -1 if buffers are equal, 0 if not This function is meant for comparing passwords or hash values where difference in execution time or memory access pattern could provide external observer information about the location of the difference in the memory buffers. The return value does not behave like memcmp(), i.e., const_time_eq_bin() cannot be used to sort items into a defined order. Unlike memcmp(), the execution time of const_time_eq_bin() does not depend on the contents of the compared memory buffers, but only on the total compared length.
Syntax
static inline unsigned int const_time_eq_bin(const void *a,
const void *b,
size_t len);
![]()
static inline unsigned int const_time_eq_bin(const void *a, const void *b,
const_time_eq_bin() calls 1 function:
![]()
const_time_eq_bin()
const_time_eq_bin():
![]()
const_time_eq_bin()