shake_squeeze(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… shake_squeeze(9) β€” bestie edition

okay so this is a page from the Kernel API Manual, and today we're learning about shake_squeeze β€” the function that literally squeezes the juice out of your SHAKE128 or SHAKE256 πŸ“βœ¨


✨ NAME ✨

shake_squeeze β€” Generate output from SHAKE128 or SHAKE256 🫢


πŸŽ€ SYNOPSIS πŸŽ€

void shake_squeeze (struct shake_ctx *ctx , u8 *out , size_t out_len );

🌸 ARGUMENTS 🌸

  • ctx β€” the context you're about to squeeze. it must have been initialized already, no cap β€” don't come at this function with a raw uninitialized struct, bestie 😭
  • out β€” where the resulting output data gets written. this is the vibe destination πŸ’«
  • out_len β€” how much data to extract into out, measured in bytes.

πŸ’– DESCRIPTION πŸ’–

so here's the tea: you can call this multiple times, and that's totally fine, not me being weird about it.

The way it works β€” a bunch of consecutive squeezes laid end-to-end will yield the exact same output as one big squeeze that generates the same total amount of output. literally identical. it's giving "same energy, different packaging" πŸ‘‘

⚠️ but listen β€” more input cannot be provided after squeezing has begun. once you start squeezing, that's it, the input era is over, periodt. πŸ™ˆ

After the last squeeze, call shake_zeroize_ctx. that's the cleanup step, don't skip it, it's not optional bestie πŸ’…


πŸ¦‹ CONTEXT πŸ¦‹

Any context. that's it. any. go off ✨


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/crypto/sha3.h, plus the whole friend group:


🌈 and that's the whole page! this lil beauty lives in ./include/crypto and the date on it is October 2026 β€” iconic, timeless, main character energy fr fr. go squeeze something, bestie πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from