SIPHASH24(9)
π SIPHASH24(9) π
okay so welcome to SIPHASH24(9), straight out of the Kernel Developer's Manual, and it's literally the page for calculating SipHash24 hashes. bestie, it's giving secure little hash energy and we're obsessed π
π NAME π
SipHash24_InitSipHash24_UpdateSipHash24_EndSipHash24_FinalSipHash24
all of these are here to calculate SipHash24 hashes β¨
β¨ SYNOPSIS β¨
#include <crypto/siphash.h>
void
SipHash24_Init(SIPHASH_CTX *ctx, const SIPHASH_KEY *key);
void
SipHash24_Update(SIPHASH_CTX *ctx, const void *data, size_t len);
uint64_t
SipHash24_End(SIPHASH_CTX *ctx);
void
SipHash24_Final(void *digest, SIPHASH_CTX *ctx);
uint64_t
SipHash24(const SIPHASH_KEY *key, const void *data, size_t len);
π DESCRIPTION π
okay so the SipHash algorithm is a keyed hash algorithm optimised for short inputs, and it produces a 64-bit digest of data. The SipHash24 functions implement the algorithm with 2 compression rounds and 4 finalisation rounds. periodt. π
SipHash24_Init()β initialises aSIPHASH_CTXcontextctxwith the secret key. setting the vibe, basically π«ΆSipHash24_Update()β addsdataof lengthlento the contextctx. feed it the data, bestie πSipHash24_End()β this is called after all data has been added toctxviaSipHash24_Update(), and it returns a message digest in the host's native endian. iconic finishing move β¨SipHash24_Final()β this is called after all data has been added toctxviaSipHash24_Update(), and it stores the message digest at the address specified by thedigestparameter. The buffer atdigestmust beSIPHASH_DIGEST_LENGTHbytes long. do not skip that part, fr fr πSipHash24()β calculates the digest ofdataof lengthlenwith the secret key. one-shot main character energy π
It is recommended that the SIPHASH_KEY key be generated with arc4random_buf(9). that's the recommendation, bestie β key generation said go to arc4random_buf(9) π
π¦ CONTEXT π¦
vibe check: SipHash24_Init(), SipHash24_Update(), SipHash24_End(), SipHash24_Final() and SipHash24() can be called during autoconf, from process context, or from interrupt context. all five, same energy, no cap π
π RETURN VALUES π
SipHash24_End() and SipHash24() return the 64-bit message digest in the host's native endian representation. that's the whole return situation, slay π
π SEE ALSO π
arc4random_buf(9)
byeee π«Ά this page is from Debian, dated September 14, 2015, for SIPHASH24(9) β mwah π
π¦ where this page comes from
- nixpkgs unstable: cvs-export
- Copyright (c) 2014 David Gwynne <dlg@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms