netatalk  4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
constant_time.c File Reference

Functions

int atalk_ct_memcmp (const void *a, const void *b, size_t n)
 Constant-time memory equality check.
 

Function Documentation

◆ atalk_ct_memcmp()

int atalk_ct_memcmp ( const void *  a,
const void *  b,
size_t  n 
)

Constant-time memory equality check.

Compares exactly n bytes and returns 0 if the buffers are equal, non-zero if they differ.

Note
Unlike memcmp(), this function does not provide lexicographic ordering and must not be used for sorting.
Returns
0 if the buffers are equal, non-zero if they differ.