Main index | Section 3 | Options |
#include <string.h>
Additionally, their running times are independent of the byte sequences compared, making them safe to use for comparing secret values such as cryptographic MACs. In contrast, bcmp(3) and memcmp(3) may short-circuit after finding the first differing byte.
The timingsafe_memcmp() function returns a negative value, 0, or positive value if the byte sequence pointed to by b1 compares less than, equal to, or greater than (respectively) the byte sequence pointed to by b2.
The timingsafe_memcmp() function first appeared in OpenBSD 5.6 .
Both functions first appeared in FreeBSD 12.0 .
TIMINGSAFE_BCMP (3) | August 15, 2016 |
Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | How do you pronounce UNIX ? You Nix ! | ” |