byte_equal(3)
π¦ byte_equal(3) π¦
okay bestie, welcome to the Library Functions Manual page for byte_equal(3) β she's a tiny little function with main character energy, and she has ONE job: comparing two strings. let's get into it π
β¨ NAME β¨
byte_equal β compare two strings π«Ά
πΈ SYNTAX πΈ
#include <libowfat/byte.h>
int byte_equal(const char *one,size_t len,const char *two);
like, that's the whole vibe. include the header, call the function, boom. β
π DESCRIPTION π
so byte_equal returns 1 if the strings are equal, and 0 otherwise. that's it, that's the tea. π
BUT here's the part you actually need to know, bestie, because it's giving important: when the strings are different, byte_equal does not read bytes past the first difference. so it stops the second it finds a mismatch. lowkey efficient, highkey a problem depending on what you're doing. π
the way that an attacker observing the execution timing can learn where the first mismatch happened?? yeah. that's a real thing. the time it takes leaks info, and that's not the vibe you want for secrets. π
so if you're comparing keys, passphrases, cookies or hashes β do NOT usebyte_equal, okay?? usebyte_equal_notimingattackinstead. periodt. π₯
π SEE ALSO π
okay that's the whole page, bestie!! tysm for reading, you ate that. this was the byte_equal(3) manual page, mwah πβ¨π bye bye π¦π
π¦ where this page comes from
- alpine 3.24: libowfat-doc 0.34-r0 Β· GPL-2.0-only
- nixos 26.05: libowfat 0.34
- nixpkgs unstable: libowfat 0.34
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- ubuntu resolute: libowfat-dev 0.34-2 Β· GPL-2.0-only
- ubuntu stonking: libowfat-dev 0.34-2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms