byte: Common Byte Operations

Data types

No data types are defined in this module.

API

int8_t byte_cmp(const void *a, const void *b, size_t len)

Compare two byte strings and return the difference.

void byte_copy(void *dst, const void *src, size_t len)

Copy a byte string.

bool byte_equal(const void *a, const void *b, size_t len)

Check if two byte strings are equal.

Warning

Do not use to compare passwords, see byte_equal_safe().

bool byte_equal_safe(const void *a, const void *b, size_t len)

Check if two byte strings are equal by doing a full XOR comparison of both byte strings and checking the result.

void byte_zero(void *buf, size_t len)

Set the contents of a byte string to all zero.