lib1305(3)
β¨ lib1305(3) β¨
okay bestie, sit down, hydrate, and let me tell you about lib1305 π β it's the C API for the lib1305 implementation of the Poly1305 one-time authenticator. yes, THE one. the icon. the moment. π
πΈ NAME πΈ
lib1305 β a C API for the lib1305 implementation of the Poly1305 one-time authenticator. that's it, that's the whole vibe. π
π¦ SYNOPSIS π¦
Using lib1305:
#include <lib1305.h>
and link with -l1305. that's the whole linking situation, no cap. π«Ά
Authenticating a message:
unsigned char a[poly1305_BYTES];
const unsigned char m[mlen];
const unsigned char k[poly1305_KEYBYTES];
poly1305(a,m,mlen,k);
Verifying an authenticator:
const unsigned char a[poly1305_BYTES];
const unsigned char m[mlen];
const unsigned char k[poly1305_KEYBYTES];
int result;
result = poly1305_verify(a,m,mlen,k);
π DESCRIPTION π
so lib1305 is an implementation of the Poly1305 one-time authenticator. periodt. π
the lib1305 functions follow the SUPERCOP onetimeauth API⦠except that (and bestie, listen, there are three little exceptions and they matter):
- the function names are lib1305-specific instead of
crypto_onetimeauth_*π - message lengths are
long longinstead ofunsigned long longπ - and the
poly1305function returnsvoidinstead ofintπ«Ά
the poly1305 function generates an authenticator a[0], a[1], ..., a[poly1305_BYTES-1] given a message m[0], m[1], ..., m[mlen-1] and a secret key k[0], k[1], ..., k[poly1305_KEYBYTES-1]. β¨
β οΈ okay so "one-time" means the secret key must not be reused to generate an authenticator of another message. like, do NOT recycle that key. that's the whole entire point. iykyk. π₯
the poly1305_verify function verifies an authenticator a[0], a[1], ..., a[poly1305_BYTES-1] given a message m[0], m[1], ..., m[mlen-1] and a secret key k[0], k[1], ..., k[poly1305_KEYBYTES-1]. π¦
it returns 0 if the authenticator is valid, otherwise nonzero. that's the vibe check right there β zero means slay, nonzero means nope. π
π SEE ALSO π
randombytes(3)β go get yourself some random bytes, bestie, you're gonna need 'em π
π and that's the tea, babe π β this little masterpiece lives in the lib1305(3) manual page, and the footer says the same thing, so likeβ¦ it's lib1305(3) all the way down. iconic. no date, no version drama, just the name. periodt. π
β¨π¦
π¦ where this page comes from
- debian trixie: lib1305-dev 0~20250415-1 Β· LicenseRef-PD-hp OR CC0-1.0 OR 0BSD OR MIT-0 OR MIT
- ubuntu questing: lib1305-dev 0~20250415-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms